From f6299a6eabca5c4b04ac84770d73321a6eafb4cf Mon Sep 17 00:00:00 2001 From: TfTHacker Date: Sun, 21 Apr 2024 10:07:09 +0200 Subject: [PATCH] 2.1.0 release --- CHANGELOG.md | 6 ++++++ package.json | 28 ++++++++++++++-------------- src/ui/components/uic-ref--parent.ts | 6 ++---- src/ui/components/uic-ref-title.tsx | 18 ++++++++++-------- 4 files changed, 32 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50fe05e..863e1f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 2.1.0 + +## New + +- Items shown in the refreence panel can now be sorted by File Name and Date Modified, in ascending and decending order. This can be changed in the reference count hover panel or sidepane. A change in either these places will be reflected in the other. + # 2.0.3 ## New diff --git a/package.json b/package.json index ac4f68b..bf31811 100644 --- a/package.json +++ b/package.json @@ -15,43 +15,43 @@ "author": "TfTHacker", "license": "MIT", "devDependencies": { - "@codemirror/commands": "^6.3.3", + "@codemirror/commands": "^6.5.0", "@codemirror/language": "^6.10.1", "@codemirror/search": "^6.5.6", "@codemirror/state": "^6.4.1", - "@codemirror/view": "^6.26.1", - "@types/node": "^20.12.4", + "@codemirror/view": "^6.26.3", + "@types/node": "^20.12.7", "builtin-modules": "3.3.0", "esbuild": "0.20.2", "eslint": "^8.57.0", - "@html-eslint/eslint-plugin": "^0.24.0", - "@html-eslint/parser": "^0.24.0", + "@html-eslint/eslint-plugin": "^0.24.1", + "@html-eslint/parser": "^0.24.1", "@types/obsidian-typings": "github:Fevol/obsidian-typings", - "@typescript-eslint/eslint-plugin": "^7.5.0", - "@typescript-eslint/parser": "^7.5.0", - "@typescript-eslint/utils": "^7.5.0", + "@typescript-eslint/eslint-plugin": "^7.7.0", + "@typescript-eslint/parser": "^7.7.0", + "@typescript-eslint/utils": "^7.7.0", "eslint-config-prettier": "^9.1.0", "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-css": "^0.9.2", "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-jsonc": "^2.15.0", + "eslint-plugin-jsonc": "^2.15.1", "eslint-plugin-mdx": "^3.1.5", "eslint-plugin-only-warn": "^1.1.0", "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-tsdoc": "^0.2.17", "eslint-plugin-yml": "^1.14.0", "prettier": "^3.2.5", - "remark-preset-lint-consistent": "^5.1.2", - "remark-preset-lint-markdown-style-guide": "^5.1.3", - "remark-preset-lint-recommended": "^6.1.3", + "remark-preset-lint-consistent": "^6.0.0", + "remark-preset-lint-markdown-style-guide": "^6.0.0", + "remark-preset-lint-recommended": "^7.0.0", "remark-preset-prettier": "^2.0.1", "tslib": "^2.6.2", - "typescript": "5.4.4", + "typescript": "5.4.5", "obsidian": "1.5.7" }, "dependencies": { - "preact": "^10.20.1", + "preact": "^10.20.2", "tippy.js": "^6.3.7" } } diff --git a/src/ui/components/uic-ref--parent.ts b/src/ui/components/uic-ref--parent.ts index 6878280..bb01844 100644 --- a/src/ui/components/uic-ref--parent.ts +++ b/src/ui/components/uic-ref--parent.ts @@ -53,7 +53,7 @@ export const getUIC_SidePane = async ( // Creates event handlers for components of the HoverView and sidepane export const setFileLinkHandlers = async (isHoverView: boolean, rootElementForViewEl: HTMLElement) => { const linksToFiles: NodeList = rootElementForViewEl.querySelectorAll( - '.snw-ref-item-file, .snw-ref-item-info, .snw-ref-title-side-pane, .snw-ref-title-popover' + '.snw-ref-item-file, .snw-ref-item-info, .snw-ref-title-popover-label' ); linksToFiles.forEach((node: Element) => { if (!node.getAttribute('snw-has-handler')) { @@ -61,9 +61,7 @@ export const setFileLinkHandlers = async (isHoverView: boolean, rootElementForVi // CLICK event node.addEventListener('click', async (e: MouseEvent) => { e.preventDefault(); - const handlerElement = (e.target as HTMLElement).closest( - '.snw-ref-item-file, .snw-ref-item-info, .snw-ref-title-side-pane, .snw-ref-title-popover' - ); + const handlerElement = (e.target as HTMLElement).closest('.snw-ref-item-file, .snw-ref-item-info, .snw-ref-title-popover-label'); let lineNu = Number(handlerElement.getAttribute('snw-data-line-number')); const filePath = handlerElement.getAttribute('snw-data-file-name'); const fileT = app.metadataCache.getFirstLinkpathDest(filePath, filePath); diff --git a/src/ui/components/uic-ref-title.tsx b/src/ui/components/uic-ref-title.tsx index 7a7ed39..da3061b 100644 --- a/src/ui/components/uic-ref-title.tsx +++ b/src/ui/components/uic-ref-title.tsx @@ -19,14 +19,16 @@ export const getUIC_Ref_Title_Div = ( handleSortOptionChangeCallback: () => void ): HTMLElement => { const titleElJsx = ( -
-
{realLink}
+
+
+ {realLink} +
{isPopover && (