Skip to content

Commit

Permalink
2.1.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
TfTHacker committed Apr 21, 2024
1 parent a5e4705 commit f6299a6
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 26 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
6 changes: 2 additions & 4 deletions src/ui/components/uic-ref--parent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,15 @@ 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')) {
node.setAttribute('snw-has-handler', 'true'); //prevent the event from being added twice
// 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);
Expand Down
18 changes: 10 additions & 8 deletions src/ui/components/uic-ref-title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ export const getUIC_Ref_Title_Div = (
handleSortOptionChangeCallback: () => void
): HTMLElement => {
const titleElJsx = (
<div
className={`${isPopover ? 'snw-ref-title-popover' : 'snw-ref-title-side-pane'} tree-item-self is-clickable`}
snw-ref-title-type={refType}
snw-ref-title-reallink={realLink}
snw-ref-title-key={key}
snw-data-file-name={filePath}
snw-data-line-number={lineNu.toString()}>
<div className="snw-ref-title-popover-label">{realLink}</div>
<div className={`${isPopover ? 'snw-ref-title-popover' : 'snw-ref-title-side-pane'} tree-item-self is-clickable`}>
<div
className="snw-ref-title-popover-label"
snw-ref-title-type={refType}
snw-ref-title-reallink={realLink}
snw-ref-title-key={key}
snw-data-file-name={filePath}
snw-data-line-number={lineNu.toString()}>
{realLink}
</div>
<SortOrderDropdown plugin={plugin} onChange={handleSortOptionChangeCallback} />
{isPopover && (
<span
Expand Down

0 comments on commit f6299a6

Please sign in to comment.