mirror of
https://github.com/panatgithub/AnkiHeadingSync.git
synced 2026-07-22 06:51:43 +00:00
chore(release): bump version to 1.0.2
- bump package.json/manifest.json to 1.0.2 - add versions.json compatibility entry for 1.0.2 - include latest scope-row inline hint layout adjustments
This commit is contained in:
parent
488bd3d91f
commit
a898aa80e9
7 changed files with 48 additions and 13 deletions
10
main.js
10
main.js
File diff suppressed because one or more lines are too long
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "anki-heading-sync",
|
||||
"name": "Anki Heading Sync",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"minAppVersion": "1.8.7",
|
||||
"description": "Focused heading-based Markdown to Anki sync plugin.",
|
||||
"author": "Dusk",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "obsidian-anki-heading-sync",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"description": "Focused heading-based Markdown to Anki sync plugin.",
|
||||
"author": "Dusk",
|
||||
"main": "dist/plugin/main.js",
|
||||
|
|
|
|||
|
|
@ -1673,10 +1673,16 @@ describe("PluginSettingTab", () => {
|
|||
await flushPromises();
|
||||
|
||||
const overrideCheckbox = queryByDataset(tab.containerEl, "folderDeckModeOverride", "notes/sub");
|
||||
const childLabel = queryByDataset(tab.containerEl, "folderPathLabel", "notes/sub");
|
||||
const overrideAttributes = overrideCheckbox as unknown as { title?: string; "aria-label"?: string };
|
||||
const labelParent = (childLabel as unknown as { parent?: { children?: unknown[] } }).parent;
|
||||
const overrideParent = (overrideCheckbox as unknown as { parent?: { children?: unknown[] } }).parent;
|
||||
expect(overrideCheckbox.classList.contains("ahs-settings-folder-override-checkbox")).toBe(true);
|
||||
expect(overrideAttributes.title).toBe("当前全局为「文件夹」,勾选后此文件夹改用「文件夹及文件名」作为牌组名");
|
||||
expect(overrideAttributes["aria-label"]).toBe("切换 sub 的文件夹牌组映射模式");
|
||||
expect(overrideParent).toBe(labelParent);
|
||||
expect(labelParent?.children?.[0]).toBe(childLabel);
|
||||
expect(labelParent?.children?.[1]).toBe(overrideCheckbox);
|
||||
expect(() => queryByDataset(tab.containerEl, "folderDeckModeOverrideHint", "notes/sub")).toThrow();
|
||||
});
|
||||
|
||||
|
|
@ -1703,8 +1709,15 @@ describe("PluginSettingTab", () => {
|
|||
expect(plugin.updateCalls).toContainEqual({
|
||||
alternateFolderDeckModeFolders: ["notes/sub"],
|
||||
});
|
||||
const childLabel = queryByDataset(tab.containerEl, "folderPathLabel", "notes/sub");
|
||||
const rerenderedOverrideCheckbox = queryByDataset(tab.containerEl, "folderDeckModeOverride", "notes/sub");
|
||||
const hint = queryByDataset(tab.containerEl, "folderDeckModeOverrideHint", "notes/sub");
|
||||
const inlineParent = (childLabel as unknown as { parent?: { children?: unknown[] } }).parent;
|
||||
expect(hint.classList.contains("ahs-settings-folder-override-hint")).toBe(true);
|
||||
expect((hint as unknown as { parent?: unknown }).parent).toBe(inlineParent);
|
||||
expect(inlineParent?.children?.[0]).toBe(childLabel);
|
||||
expect(inlineParent?.children?.[1]).toBe(rerenderedOverrideCheckbox);
|
||||
expect(inlineParent?.children?.[2]).toBe(hint);
|
||||
expect(hint.textContent).toContain("文件夹及文件名");
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1698,13 +1698,16 @@ export class AnkiHeadingSyncSettingTab extends PluginSettingTab {
|
|||
const contentEl = row.createDiv();
|
||||
addClasses(contentEl, "ahs-settings-folder-label-stack");
|
||||
|
||||
const labelEl = contentEl.createSpan({ text: node.name });
|
||||
const inlineLabelEl = contentEl.createDiv();
|
||||
addClasses(inlineLabelEl, "ahs-settings-folder-label-inline");
|
||||
|
||||
const labelEl = inlineLabelEl.createSpan({ text: node.name });
|
||||
labelEl.dataset.folderPathLabel = node.path;
|
||||
addClasses(labelEl, "ahs-settings-folder-label");
|
||||
this.applyFluidEllipsis(labelEl);
|
||||
|
||||
if (scopeMode === "include" && node.checked && this.plugin.settings.folderDeckMode !== "off") {
|
||||
const overrideCheckbox = row.createEl("input");
|
||||
const overrideCheckbox = inlineLabelEl.createEl("input");
|
||||
const overrideLabel = t("settings.scope.folderDeckModeOverride.ariaLabel", { name: node.name });
|
||||
const overrideTitle = this.getFolderDeckModeOverrideTitle();
|
||||
const overrideChecked = this.plugin.settings.alternateFolderDeckModeFolders.includes(node.path);
|
||||
|
|
@ -1723,7 +1726,7 @@ export class AnkiHeadingSyncSettingTab extends PluginSettingTab {
|
|||
});
|
||||
|
||||
if (overrideChecked) {
|
||||
const hintEl = contentEl.createDiv({ text: this.getFolderDeckModeOverrideHint() });
|
||||
const hintEl = inlineLabelEl.createSpan({ text: this.getFolderDeckModeOverrideHint() });
|
||||
hintEl.dataset.folderDeckModeOverrideHint = node.path;
|
||||
addClasses(hintEl, "ahs-settings-folder-override-hint");
|
||||
}
|
||||
|
|
|
|||
22
styles.css
22
styles.css
|
|
@ -200,7 +200,7 @@
|
|||
|
||||
.anki-heading-sync-settings .ahs-settings-folder-row {
|
||||
display: grid;
|
||||
grid-template-columns: 24px 24px minmax(0, 1fr) auto;
|
||||
grid-template-columns: 24px 24px minmax(0, 1fr);
|
||||
align-items: center;
|
||||
column-gap: 0;
|
||||
width: 100%;
|
||||
|
|
@ -241,12 +241,22 @@
|
|||
.anki-heading-sync-settings .ahs-settings-folder-label-stack {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
min-width: 0;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.anki-heading-sync-settings .ahs-settings-folder-label-inline {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
align-self: flex-start;
|
||||
gap: 8px;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.anki-heading-sync-settings .ahs-settings-folder-override-checkbox {
|
||||
justify-self: end;
|
||||
flex: none;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin: 0;
|
||||
|
|
@ -271,9 +281,11 @@
|
|||
}
|
||||
|
||||
.anki-heading-sync-settings .ahs-settings-folder-override-hint {
|
||||
flex: none;
|
||||
color: var(--text-muted);
|
||||
font-size: var(--font-ui-smaller);
|
||||
line-height: 1.35;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.anki-heading-sync-settings .ahs-settings-inline-control-group {
|
||||
|
|
@ -320,6 +332,12 @@
|
|||
overflow: hidden;
|
||||
}
|
||||
|
||||
.anki-heading-sync-settings .ahs-settings-folder-label.ahs-settings-fluid-ellipsis {
|
||||
flex: 0 1 auto;
|
||||
width: auto;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.anki-heading-sync-settings select.ahs-settings-fluid-control,
|
||||
.anki-heading-sync-settings input.ahs-settings-fluid-control {
|
||||
box-sizing: border-box;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"1.0.0": "1.8.7",
|
||||
"1.0.1": "1.8.7"
|
||||
"1.0.1": "1.8.7",
|
||||
"1.0.2": "1.8.7"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue