185 - drop backward compatibility
- upgraded libraries and TS - fixed compilation issues - no other code changes yet
This commit is contained in:
parent
d3e21b2805
commit
5013b47e26
15
package.json
15
package.json
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "obsidian-custom-sort",
|
"name": "obsidian-custom-sort",
|
||||||
"version": "2.1.15",
|
"version": "3.0.0",
|
||||||
"description": "Custom Sort plugin for Obsidian (https://obsidian.md)",
|
"description": "Custom Sort plugin for Obsidian (https://obsidian.md)",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -24,12 +24,11 @@
|
||||||
"builtin-modules": "3.3.0",
|
"builtin-modules": "3.3.0",
|
||||||
"esbuild": "0.17.3",
|
"esbuild": "0.17.3",
|
||||||
"eslint": "^8.29.0",
|
"eslint": "^8.29.0",
|
||||||
"jest": "^28.1.1",
|
"jest": "^29.7.0",
|
||||||
"monkey-around": "^2.3.0",
|
"monkey-around": "^3.0.0",
|
||||||
"obsidian": "^0.15.4",
|
"obsidian": "^1.7.2",
|
||||||
"obsidian-1.4.11": "npm:obsidian@1.4.11",
|
"ts-jest": "^29.2.5",
|
||||||
"ts-jest": "^28.0.5",
|
"tslib": "2.8.1",
|
||||||
"tslib": "2.4.0",
|
"typescript": "5.7.2"
|
||||||
"typescript": "4.7.4"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,7 +124,7 @@ export default class CustomSortPlugin
|
||||||
if (failed) return
|
if (failed) return
|
||||||
if (file instanceof TFile) {
|
if (file instanceof TFile) {
|
||||||
const aFile: TFile = file as TFile
|
const aFile: TFile = file as TFile
|
||||||
const parent: TFolder = aFile.parent
|
const parent: TFolder = aFile.parent!
|
||||||
// Read sorting spec from three sources of equal priority:
|
// Read sorting spec from three sources of equal priority:
|
||||||
// - files with designated predefined name
|
// - files with designated predefined name
|
||||||
// - files with the same name as parent folders (aka folder notes), e.g.: References/References.md
|
// - files with the same name as parent folders (aka folder notes), e.g.: References/References.md
|
||||||
|
@ -396,7 +396,7 @@ export default class CustomSortPlugin
|
||||||
item.onClick(() => {
|
item.onClick(() => {
|
||||||
const bookmarksPlugin = getBookmarksPlugin(plugin.app, plugin.settings.bookmarksGroupToConsumeAsOrderingReference)
|
const bookmarksPlugin = getBookmarksPlugin(plugin.app, plugin.settings.bookmarksGroupToConsumeAsOrderingReference)
|
||||||
if (bookmarksPlugin) {
|
if (bookmarksPlugin) {
|
||||||
const orderedChildren: Array<TAbstractFile> = plugin.orderedFolderItemsForBookmarking(file.parent, bookmarksPlugin)
|
const orderedChildren: Array<TAbstractFile> = plugin.orderedFolderItemsForBookmarking(file.parent!, bookmarksPlugin)
|
||||||
bookmarksPlugin.bookmarkSiblings(orderedChildren)
|
bookmarksPlugin.bookmarkSiblings(orderedChildren)
|
||||||
bookmarksPlugin.saveDataAndUpdateBookmarkViews(true)
|
bookmarksPlugin.saveDataAndUpdateBookmarkViews(true)
|
||||||
}
|
}
|
||||||
|
@ -409,7 +409,7 @@ export default class CustomSortPlugin
|
||||||
item.onClick(() => {
|
item.onClick(() => {
|
||||||
const bookmarksPlugin = getBookmarksPlugin(plugin.app, plugin.settings.bookmarksGroupToConsumeAsOrderingReference)
|
const bookmarksPlugin = getBookmarksPlugin(plugin.app, plugin.settings.bookmarksGroupToConsumeAsOrderingReference)
|
||||||
if (bookmarksPlugin) {
|
if (bookmarksPlugin) {
|
||||||
const orderedChildren: Array<TAbstractFile> = file.parent.children.map((entry: TFile | TFolder) => entry)
|
const orderedChildren: Array<TAbstractFile> = file.parent!.children.map((entry: TFile | TFolder) => entry)
|
||||||
bookmarksPlugin.unbookmarkSiblings(orderedChildren)
|
bookmarksPlugin.unbookmarkSiblings(orderedChildren)
|
||||||
bookmarksPlugin.saveDataAndUpdateBookmarkViews(true)
|
bookmarksPlugin.saveDataAndUpdateBookmarkViews(true)
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,5 +48,6 @@
|
||||||
"2.1.12": "0.16.2",
|
"2.1.12": "0.16.2",
|
||||||
"2.1.13": "0.16.2",
|
"2.1.13": "0.16.2",
|
||||||
"2.1.14": "0.16.2",
|
"2.1.14": "0.16.2",
|
||||||
"2.1.15": "0.16.2"
|
"2.1.15": "0.16.2",
|
||||||
|
"3.0.0": "1.7.2"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue