diff --git a/main.js b/main.js index e579de2c..91836b5b 100644 --- a/main.js +++ b/main.js @@ -21160,6 +21160,7 @@ const DEFAULT_SETTINGS = { showTrail: true, showGrid: true, showPrevNext: true, + sortByNameShowAlias: false, squareDirectionsOrder: [0, 1, 2, 3, 4], limitTrailCheckboxes: [], limitJumpToFirstFields: [], @@ -24944,7 +24945,7 @@ class MatrixView extends require$$0.ItemView { getHierSquares(userHiers, currFile) { const { plugin } = this; const { mainG, settings } = plugin; - const { alphaSortAsc, enableAlphaSort, treatCurrNodeAsImpliedSibling, squareDirectionsOrder, } = settings; + const { alphaSortAsc, enableAlphaSort, treatCurrNodeAsImpliedSibling, squareDirectionsOrder, sortByNameShowAlias, } = settings; if (!mainG) return []; const { basename } = currFile; @@ -25007,7 +25008,8 @@ class MatrixView extends require$$0.ItemView { if (enableAlphaSort) { squares.forEach((sq) => sq.sort((a, b) => { var _a, _b; - return ((_a = a.alt) !== null && _a !== void 0 ? _a : a.to) < ((_b = b.alt) !== null && _b !== void 0 ? _b : b.to) + return (sortByNameShowAlias ? a.to : (_a = a.alt) !== null && _a !== void 0 ? _a : a.to) < + (sortByNameShowAlias ? b.to : (_b = b.alt) !== null && _b !== void 0 ? _b : b.to) ? alphaSortAsc ? -1 : 1 @@ -25356,6 +25358,16 @@ class BCSettingTab extends require$$0.PluginSettingTab { await plugin.saveSettings(); await plugin.getActiveTYPEView(MATRIX_VIEW).draw(); })); + new require$$0.Setting(MLViewDetails) + .setName("Sort by note name, but show alias") + .setDesc("When this is turned off, notes will first be sorted by their alias, and then by their name if no alias is found. Turn this on to sort by note name always, but still show the alias in the results.") + .addToggle((toggle) => toggle + .setValue(settings.sortByNameShowAlias) + .onChange(async (value) => { + settings.sortByNameShowAlias = value; + await plugin.saveSettings(); + await plugin.getActiveTYPEView(MATRIX_VIEW).draw(); + })); new require$$0.Setting(MLViewDetails) .setName("Make Current Note an Implied Sibling") .setDesc("Techincally, the current note is always it's own implied sibling. By default, it is not show as such. Toggle this on to make it show.") @@ -53087,6 +53099,7 @@ class BCPlugin extends require$$0.Plugin { return results; } codeblockError(parsedSource) { + var _a; const { dir, fields, type, title, depth, flat, content } = parsedSource; const { userHiers } = this.settings; let err = ""; @@ -53096,7 +53109,7 @@ class BCPlugin extends require$$0.Plugin { if (!validDir) err += `dir: ${dir} is not a valid direction.
`; const allFields = getFields(userHiers); - fields === null || fields === void 0 ? void 0 : fields.forEach((f) => { + (_a = [fields].flat()) === null || _a === void 0 ? void 0 : _a.forEach((f) => { if (!allFields.includes(f)) err += `field: ${f} is not a field in your hierarchies.
`; }); diff --git a/src/main.ts b/src/main.ts index 15d8d8a6..9406badc 100644 --- a/src/main.ts +++ b/src/main.ts @@ -657,7 +657,7 @@ export default class BCPlugin extends Plugin { err += `dir: ${dir} is not a valid direction.
`; const allFields = getFields(userHiers); - fields?.forEach((f) => { + [fields].flat()?.forEach((f) => { if (!allFields.includes(f)) err += `field: ${f} is not a field in your hierarchies.
`; });