@immense/vue-pom-generator 1.0.108 → 1.0.109
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/RELEASE_NOTES.md +31 -36
- package/dist/index.cjs +66 -147
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +66 -147
- package/dist/index.mjs.map +1 -1
- package/dist/plugin/runtime/annotator/client.d.ts +1 -1
- package/dist/plugin/runtime/annotator/client.d.ts.map +1 -1
- package/dist/plugin/runtime/annotator/styles.d.ts +1 -1
- package/dist/plugin/runtime/annotator/styles.d.ts.map +1 -1
- package/dist/tests/annotator-keyboard.test.d.ts +2 -0
- package/dist/tests/annotator-keyboard.test.d.ts.map +1 -0
- package/dist/tests/annotator-preview.test.d.ts +2 -0
- package/dist/tests/annotator-preview.test.d.ts.map +1 -0
- package/package.json +1 -1
- package/plugin/runtime/annotator/client.ts +23 -137
- package/plugin/runtime/annotator/styles.ts +43 -26
package/RELEASE_NOTES.md
CHANGED
|
@@ -1,52 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
Git access is blocked, so I'll verify the change content by reading the affected files directly.
|
|
2
|
+
|
|
3
|
+
v1.0.109
|
|
3
4
|
|
|
4
5
|
Highlights
|
|
5
6
|
|
|
6
|
-
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
- Clean lint is enforced: the release workflow now fails on any lint warning (--max-warnings 0)
|
|
15
|
-
(]8;id=md-d87z0v;https://github.com/immense/vue-pom-generator/pull/72#72]8;;]8;;).]8;;
|
|
7
|
+
- Annotator keyboard shortcuts removed — all annotator control is now toolbar-driven. The
|
|
8
|
+
capture-phase keydown handler previously swallowed single-letter keys before text surfaces like the
|
|
9
|
+
Monaco terminal editor could handle them.
|
|
10
|
+
- Crosshair cursor while inspecting elements, making selection mode visually obvious.
|
|
11
|
+
- Live annotation count displayed in the annotator toolbar.
|
|
12
|
+
- Readable preview popout — sized wide with a tall monospace textarea so the full feedback text can
|
|
13
|
+
be read in one view.
|
|
14
|
+
- New regression tests lock in the keyboard policy and preview behavior.
|
|
16
15
|
|
|
17
16
|
Changes
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
Annotator
|
|
19
|
+
|
|
20
|
+
- Removed all window-level keyboard shortcuts (s, p, c, x, ,, Escape); the annotator no longer
|
|
21
|
+
binds any keydown listener at mount and is fully inert to keyboard input.
|
|
22
|
+
- Switched the inspect shield to a crosshair cursor.
|
|
23
|
+
- Added a count badge (N annotation(s)) to the toolbar.
|
|
24
|
+
- Enlarged the preview panel (720–940px wide) with a taller, vertically resizable monospace
|
|
25
|
+
textarea so copied/previewed feedback is readable together.
|
|
26
|
+
|
|
27
|
+
Tests
|
|
20
28
|
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
owns one cache per dev server and passes it into generateFiles.
|
|
26
|
-
- Skip writing generated files when content is unchanged, repairing removed or externally modified
|
|
27
|
-
outputs.
|
|
28
|
-
- Render the POM manifest module via the structured, cache-aware path (manifest-generator.ts).
|
|
29
|
-
- Add regression coverage (tests/incremental-generation.test.ts, tests/generated-outputs.test.ts)
|
|
30
|
-
plus a repro script and write-up (scripts/repro-hmr-regeneration.mjs,
|
|
31
|
-
docs/hmr-regeneration-reproduction.md).
|
|
29
|
+
- Added annotator-keyboard.test.ts: verifies no keydown listeners are bound and every former
|
|
30
|
+
shortcut key is ignored.
|
|
31
|
+
- Added annotator-preview.test.ts: verifies the preview panel opens and contains all seeded
|
|
32
|
+
feedback items.
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
Chores
|
|
34
35
|
|
|
35
|
-
-
|
|
36
|
-
matches Vue's function-parameter semantics for object/array destructuring.
|
|
37
|
-
- Update test fixtures (MyList, MyRadioGroup) to use canonical Vue loop bindings and satisfy lint
|
|
38
|
-
rules.
|
|
39
|
-
- Add a Lint step (--max-warnings 0) to the release workflow.
|
|
36
|
+
- Added .nodeterm/project.json (local tooling state).
|
|
40
37
|
|
|
41
38
|
Pull Requests Included
|
|
42
39
|
|
|
43
|
-
-
|
|
44
|
-
|
|
40
|
+
- #74 fix(annotator): remove keyboard shortcuts; crosshair cursor, count badge, readable preview —
|
|
41
|
+
]8;id=md-co8rmx;https://github.com/immense/vue-pom-generator/pull/74https://github.com/immense/vue-pom-generator/pull/74]8;;]8;; (@dkattan)]8;;
|
|
45
42
|
|
|
46
43
|
Testing
|
|
47
44
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
patterns, array patterns with of) and updated tests/generated-outputs.test.ts.
|
|
51
|
-
- Release CI now also runs the lint suite with warnings disallowed.
|
|
45
|
+
Two new vitest suites cover this change (jsdom): keyboard-inertness of the mounted annotator client
|
|
46
|
+
and preview-panel content/affordances.
|
|
52
47
|
|
package/dist/index.cjs
CHANGED
|
@@ -11994,6 +11994,20 @@ const ANNOTATOR_STYLES = `
|
|
|
11994
11994
|
max-width: min(320px, calc(100vw - 24px));
|
|
11995
11995
|
}
|
|
11996
11996
|
|
|
11997
|
+
.vpg-annotator-panel--preview {
|
|
11998
|
+
min-width: min(720px, calc(100vw - 24px));
|
|
11999
|
+
max-width: min(940px, calc(100vw - 24px));
|
|
12000
|
+
}
|
|
12001
|
+
|
|
12002
|
+
.vpg-annotator-panel--preview .vpg-annotator-textarea {
|
|
12003
|
+
height: min(52vh, 440px);
|
|
12004
|
+
resize: vertical;
|
|
12005
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
12006
|
+
white-space: pre;
|
|
12007
|
+
overflow: auto;
|
|
12008
|
+
}
|
|
12009
|
+
|
|
12010
|
+
|
|
11997
12011
|
.vpg-annotator-arrow {
|
|
11998
12012
|
position: absolute;
|
|
11999
12013
|
z-index: 0;
|
|
@@ -12108,18 +12122,6 @@ const ANNOTATOR_STYLES = `
|
|
|
12108
12122
|
margin-top: 12px;
|
|
12109
12123
|
}
|
|
12110
12124
|
|
|
12111
|
-
.vpg-annotator-shortcuts {
|
|
12112
|
-
display: grid;
|
|
12113
|
-
gap: 8px;
|
|
12114
|
-
}
|
|
12115
|
-
|
|
12116
|
-
.vpg-annotator-shortcut-row {
|
|
12117
|
-
display: flex;
|
|
12118
|
-
align-items: center;
|
|
12119
|
-
justify-content: space-between;
|
|
12120
|
-
gap: 12px;
|
|
12121
|
-
}
|
|
12122
|
-
|
|
12123
12125
|
.vpg-annotator-label {
|
|
12124
12126
|
font-size: 12px;
|
|
12125
12127
|
font-weight: 600;
|
|
@@ -12135,20 +12137,6 @@ const ANNOTATOR_STYLES = `
|
|
|
12135
12137
|
padding: 8px 10px;
|
|
12136
12138
|
}
|
|
12137
12139
|
|
|
12138
|
-
.vpg-annotator-kbd {
|
|
12139
|
-
min-width: 32px;
|
|
12140
|
-
padding: 4px 8px;
|
|
12141
|
-
border: 1px solid var(--vpg-annotator-border);
|
|
12142
|
-
border-radius: var(--vpg-annotator-radius);
|
|
12143
|
-
background: rgba(15, 23, 42, 0.72);
|
|
12144
|
-
color: var(--vpg-annotator-text);
|
|
12145
|
-
font: inherit;
|
|
12146
|
-
font-size: 11px;
|
|
12147
|
-
font-weight: 700;
|
|
12148
|
-
line-height: 1;
|
|
12149
|
-
text-align: center;
|
|
12150
|
-
}
|
|
12151
|
-
|
|
12152
12140
|
.vpg-annotator-highlight {
|
|
12153
12141
|
position: fixed;
|
|
12154
12142
|
z-index: 2147483646;
|
|
@@ -12180,6 +12168,7 @@ const ANNOTATOR_STYLES = `
|
|
|
12180
12168
|
inset: 0;
|
|
12181
12169
|
z-index: 2147483645;
|
|
12182
12170
|
background: transparent;
|
|
12171
|
+
cursor: crosshair;
|
|
12183
12172
|
}
|
|
12184
12173
|
|
|
12185
12174
|
.vpg-annotator-marker {
|
|
@@ -12212,6 +12201,34 @@ const ANNOTATOR_STYLES = `
|
|
|
12212
12201
|
font-size: 12px;
|
|
12213
12202
|
font-weight: 600;
|
|
12214
12203
|
}
|
|
12204
|
+
|
|
12205
|
+
.vpg-annotator-heading-row {
|
|
12206
|
+
display: flex;
|
|
12207
|
+
align-items: center;
|
|
12208
|
+
justify-content: space-between;
|
|
12209
|
+
gap: 8px;
|
|
12210
|
+
}
|
|
12211
|
+
|
|
12212
|
+
.vpg-annotator-heading-row .vpg-annotator-heading {
|
|
12213
|
+
margin-bottom: 4px;
|
|
12214
|
+
}
|
|
12215
|
+
|
|
12216
|
+
.vpg-annotator-panel-close {
|
|
12217
|
+
margin-left: auto;
|
|
12218
|
+
background: transparent;
|
|
12219
|
+
border: none;
|
|
12220
|
+
color: var(--vpg-annotator-text-soft);
|
|
12221
|
+
font-size: 16px;
|
|
12222
|
+
line-height: 1;
|
|
12223
|
+
padding: 2px 6px;
|
|
12224
|
+
cursor: pointer;
|
|
12225
|
+
border-radius: var(--vpg-annotator-radius);
|
|
12226
|
+
}
|
|
12227
|
+
|
|
12228
|
+
.vpg-annotator-panel-close:hover {
|
|
12229
|
+
color: var(--vpg-annotator-text);
|
|
12230
|
+
background: var(--vpg-annotator-bg-soft);
|
|
12231
|
+
}
|
|
12215
12232
|
`;
|
|
12216
12233
|
const ignoredComponentNamePattern = /^(?:items\[\d+\]\.template|template|anonymous|slot|transition|transition-group)$/i;
|
|
12217
12234
|
function getDirectVueInstances(element) {
|
|
@@ -12370,35 +12387,15 @@ const TOOLBAR_POSITION_STORAGE_KEY = "vpg-annotator-toolbar-position";
|
|
|
12370
12387
|
const RUNTIME_GUARD = "__VUE_POM_GENERATOR_ANNOTATOR_RUNTIME__";
|
|
12371
12388
|
const TOOLBAR_ICON_MARKUP = {
|
|
12372
12389
|
drag: '<svg viewBox="0 0 16 16"><path d="M5 3h1v1H5zM10 3h1v1h-1zM5 7h1v1H5zM10 7h1v1h-1zM5 11h1v1H5zM10 11h1v1h-1z" fill="currentColor" stroke="none" /></svg>',
|
|
12373
|
-
inspect: '<svg viewBox="0 0 16 16"><path d="M8
|
|
12390
|
+
inspect: '<svg viewBox="0 0 16 16"><circle cx="8" cy="8" r="4.5"/><path d="M8 1v2.5M8 12.5v2.5M1 8h2.5M12.5 8h2.5"/><circle cx="8" cy="8" r="0.9" fill="currentColor" stroke="none"/></svg>',
|
|
12374
12391
|
preview: '<svg viewBox="0 0 16 16"><path d="M1.5 8s2.4-4 6.5-4 6.5 4 6.5 4-2.4 4-6.5 4-6.5-4-6.5-4Z"/><circle cx="8" cy="8" r="1.8"/></svg>',
|
|
12375
12392
|
copy: '<svg viewBox="0 0 16 16"><path d="M6 2.5h6.5v9H6z"/><path d="M3.5 5.5H5v6.5h5.5v1.5h-7z"/></svg>',
|
|
12376
12393
|
clear: '<svg viewBox="0 0 16 16"><path d="M2.5 4.5h11"/><path d="M6 2.5h4"/><path d="M5 4.5v8"/><path d="M8 4.5v8"/><path d="M11 4.5v8"/><path d="M4 4.5h8l-.6 9H4.6z"/></svg>',
|
|
12377
12394
|
settings: '<svg viewBox="0 0 16 16"><path d="M8 2.2l1 .6 1.2-.2.8 1 .9.7-.3 1.2.5 1-.5 1 .3 1.2-.9.7-.8 1-1.2-.2-1 .6-1-.6-1.2.2-.8-1-.9-.7.3-1.2-.5-1 .5-1-.3-1.2.9-.7.8-1 1.2.2z"/><circle cx="8" cy="8" r="2.2"/></svg>'
|
|
12378
12395
|
};
|
|
12379
|
-
const SHORTCUT_LABELS = {
|
|
12380
|
-
select: "S",
|
|
12381
|
-
preview: "P",
|
|
12382
|
-
copy: "C",
|
|
12383
|
-
clear: "X",
|
|
12384
|
-
settings: ",",
|
|
12385
|
-
cancel: "Esc"
|
|
12386
|
-
};
|
|
12387
|
-
function formatShortcutTitle(label, shortcut) {
|
|
12388
|
-
return shortcut ? `${label} (${shortcut})` : label;
|
|
12389
|
-
}
|
|
12390
12396
|
function isInsideAnnotatorTree(node) {
|
|
12391
12397
|
return node instanceof Element && !!node.closest(`[${ANNOTATOR_ROOT_ATTR}]`);
|
|
12392
12398
|
}
|
|
12393
|
-
function isEditableTarget(node) {
|
|
12394
|
-
if (!(node instanceof Element)) {
|
|
12395
|
-
return false;
|
|
12396
|
-
}
|
|
12397
|
-
if (node instanceof HTMLInputElement || node instanceof HTMLTextAreaElement || node instanceof HTMLSelectElement) {
|
|
12398
|
-
return true;
|
|
12399
|
-
}
|
|
12400
|
-
return node.closest('[contenteditable=""], [contenteditable="true"]') !== null;
|
|
12401
|
-
}
|
|
12402
12399
|
function getElementSummary(element) {
|
|
12403
12400
|
const testId = element.getAttribute("data-testid");
|
|
12404
12401
|
if (testId) {
|
|
@@ -12463,10 +12460,7 @@ function createButtonBase(label, onClick, options = {}) {
|
|
|
12463
12460
|
button.className = `vpg-annotator-btn${options.primary ? " vpg-annotator-btn--primary" : ""}`;
|
|
12464
12461
|
button.setAttribute(ANNOTATOR_ROOT_ATTR, "");
|
|
12465
12462
|
button.setAttribute("aria-label", label);
|
|
12466
|
-
button.title =
|
|
12467
|
-
if (options.shortcut) {
|
|
12468
|
-
button.setAttribute("aria-keyshortcuts", options.shortcut);
|
|
12469
|
-
}
|
|
12463
|
+
button.title = label;
|
|
12470
12464
|
if (options.pressed) {
|
|
12471
12465
|
button.setAttribute("aria-pressed", "true");
|
|
12472
12466
|
}
|
|
@@ -12606,23 +12600,18 @@ class AnnotatorRuntime {
|
|
|
12606
12600
|
count.textContent = `${this.annotations.length} annotation${this.annotations.length === 1 ? "" : "s"}`;
|
|
12607
12601
|
const selectButton = createIconButton(this.inspectMode ? "Stop selecting" : "Select element", "inspect", () => {
|
|
12608
12602
|
this.setInspectMode(!this.inspectMode);
|
|
12609
|
-
}, { primary: this.inspectMode, pressed: this.inspectMode
|
|
12603
|
+
}, { primary: this.inspectMode, pressed: this.inspectMode });
|
|
12610
12604
|
const previewButton = createIconButton("Preview annotations", "preview", () => this.openPreview(), {
|
|
12611
|
-
disabled: this.annotations.length === 0
|
|
12612
|
-
shortcut: SHORTCUT_LABELS.preview
|
|
12605
|
+
disabled: this.annotations.length === 0
|
|
12613
12606
|
});
|
|
12614
12607
|
this.previewButton = previewButton;
|
|
12615
12608
|
const copyButton = createIconButton("Copy annotations", "copy", () => this.copyAnnotations(), {
|
|
12616
|
-
disabled: this.annotations.length === 0
|
|
12617
|
-
shortcut: SHORTCUT_LABELS.copy
|
|
12609
|
+
disabled: this.annotations.length === 0
|
|
12618
12610
|
});
|
|
12619
12611
|
const clearButton = createIconButton("Clear annotations", "clear", () => this.clearAnnotations(), {
|
|
12620
|
-
disabled: this.annotations.length === 0
|
|
12621
|
-
shortcut: SHORTCUT_LABELS.clear
|
|
12622
|
-
});
|
|
12623
|
-
const settingsButton = createIconButton("Annotator settings", "settings", () => this.openSettings(), {
|
|
12624
|
-
shortcut: SHORTCUT_LABELS.settings
|
|
12612
|
+
disabled: this.annotations.length === 0
|
|
12625
12613
|
});
|
|
12614
|
+
const settingsButton = createIconButton("Annotator settings", "settings", () => this.openSettings());
|
|
12626
12615
|
this.settingsButton = settingsButton;
|
|
12627
12616
|
this.toolbarEl.append(handle, selectButton, previewButton, copyButton, clearButton, settingsButton, count);
|
|
12628
12617
|
this.applyToolbarPosition();
|
|
@@ -12653,7 +12642,6 @@ class AnnotatorRuntime {
|
|
|
12653
12642
|
this.renderMarkers();
|
|
12654
12643
|
this.applyToolbarPosition();
|
|
12655
12644
|
});
|
|
12656
|
-
window.addEventListener("keydown", (event) => this.onWindowKeyDown(event), true);
|
|
12657
12645
|
}
|
|
12658
12646
|
loadSettings() {
|
|
12659
12647
|
try {
|
|
@@ -12780,60 +12768,6 @@ class AnnotatorRuntime {
|
|
|
12780
12768
|
window.addEventListener("pointercancel", onPointerUp);
|
|
12781
12769
|
});
|
|
12782
12770
|
}
|
|
12783
|
-
onWindowKeyDown(event) {
|
|
12784
|
-
if (event.defaultPrevented || event.metaKey || event.ctrlKey || event.altKey) {
|
|
12785
|
-
return;
|
|
12786
|
-
}
|
|
12787
|
-
if (event.key === "Escape") {
|
|
12788
|
-
if (!this.inspectMode && !this.currentPanelEl) {
|
|
12789
|
-
return;
|
|
12790
|
-
}
|
|
12791
|
-
event.preventDefault();
|
|
12792
|
-
if (this.inspectMode) {
|
|
12793
|
-
this.setInspectMode(false);
|
|
12794
|
-
} else {
|
|
12795
|
-
this.closePanel();
|
|
12796
|
-
}
|
|
12797
|
-
return;
|
|
12798
|
-
}
|
|
12799
|
-
if (isEditableTarget(event.target)) {
|
|
12800
|
-
return;
|
|
12801
|
-
}
|
|
12802
|
-
const key = event.key.toLowerCase();
|
|
12803
|
-
if (key === SHORTCUT_LABELS.select.toLowerCase()) {
|
|
12804
|
-
event.preventDefault();
|
|
12805
|
-
this.setInspectMode(!this.inspectMode);
|
|
12806
|
-
return;
|
|
12807
|
-
}
|
|
12808
|
-
if (key === SHORTCUT_LABELS.preview.toLowerCase()) {
|
|
12809
|
-
if (!this.annotations.length) {
|
|
12810
|
-
return;
|
|
12811
|
-
}
|
|
12812
|
-
event.preventDefault();
|
|
12813
|
-
this.openPreview();
|
|
12814
|
-
return;
|
|
12815
|
-
}
|
|
12816
|
-
if (key === SHORTCUT_LABELS.copy.toLowerCase()) {
|
|
12817
|
-
if (!this.annotations.length) {
|
|
12818
|
-
return;
|
|
12819
|
-
}
|
|
12820
|
-
event.preventDefault();
|
|
12821
|
-
void this.copyAnnotations();
|
|
12822
|
-
return;
|
|
12823
|
-
}
|
|
12824
|
-
if (key === SHORTCUT_LABELS.clear.toLowerCase()) {
|
|
12825
|
-
if (!this.annotations.length) {
|
|
12826
|
-
return;
|
|
12827
|
-
}
|
|
12828
|
-
event.preventDefault();
|
|
12829
|
-
this.clearAnnotations();
|
|
12830
|
-
return;
|
|
12831
|
-
}
|
|
12832
|
-
if (event.key === SHORTCUT_LABELS.settings) {
|
|
12833
|
-
event.preventDefault();
|
|
12834
|
-
this.openSettings();
|
|
12835
|
-
}
|
|
12836
|
-
}
|
|
12837
12771
|
setInspectMode(next) {
|
|
12838
12772
|
this.inspectMode = next;
|
|
12839
12773
|
this.shieldEl.hidden = !next;
|
|
@@ -13018,11 +12952,21 @@ class AnnotatorRuntime {
|
|
|
13018
12952
|
this.editingAnnotationId = annotation.id;
|
|
13019
12953
|
this.openInputForDraft(reference);
|
|
13020
12954
|
}
|
|
12955
|
+
createPanelCloseButton(ariaLabel) {
|
|
12956
|
+
const closeButton = document.createElement("button");
|
|
12957
|
+
closeButton.type = "button";
|
|
12958
|
+
closeButton.className = "vpg-annotator-panel-close";
|
|
12959
|
+
closeButton.setAttribute(ANNOTATOR_ROOT_ATTR, "");
|
|
12960
|
+
closeButton.setAttribute("aria-label", ariaLabel);
|
|
12961
|
+
closeButton.textContent = "×";
|
|
12962
|
+
closeButton.addEventListener("click", () => this.closePanel());
|
|
12963
|
+
return closeButton;
|
|
12964
|
+
}
|
|
13021
12965
|
openPreview() {
|
|
13022
12966
|
if (!this.previewButton || this.annotations.length === 0) {
|
|
13023
12967
|
return;
|
|
13024
12968
|
}
|
|
13025
|
-
const { panel, body, arrowEl } = this.createPanelBase("vpg-annotator-panel");
|
|
12969
|
+
const { panel, body, arrowEl } = this.createPanelBase("vpg-annotator-panel vpg-annotator-panel--preview");
|
|
13026
12970
|
const title = document.createElement("div");
|
|
13027
12971
|
title.className = "vpg-annotator-heading";
|
|
13028
12972
|
title.textContent = "Annotation preview";
|
|
@@ -13033,7 +12977,10 @@ class AnnotatorRuntime {
|
|
|
13033
12977
|
textarea.className = "vpg-annotator-textarea";
|
|
13034
12978
|
textarea.readOnly = true;
|
|
13035
12979
|
textarea.value = formatAnnotations(this.annotations, this.settings.outputDetail, window.location.href);
|
|
13036
|
-
|
|
12980
|
+
const headerRow = document.createElement("div");
|
|
12981
|
+
headerRow.className = "vpg-annotator-heading-row";
|
|
12982
|
+
headerRow.append(title, this.createPanelCloseButton("Close preview"));
|
|
12983
|
+
body.append(headerRow, subtitle, textarea);
|
|
13037
12984
|
this.showPanel(panel, () => this.attachFloating(this.previewButton, panel, arrowEl, "top-start", ["top-start", "left-start", "top-end", "left-end"]));
|
|
13038
12985
|
}
|
|
13039
12986
|
openSettings() {
|
|
@@ -13072,35 +13019,7 @@ class AnnotatorRuntime {
|
|
|
13072
13019
|
this.saveSettings();
|
|
13073
13020
|
});
|
|
13074
13021
|
showComponentField.append(showComponentCopy, showComponentCheckbox);
|
|
13075
|
-
|
|
13076
|
-
shortcutsField.className = "vpg-annotator-field";
|
|
13077
|
-
const shortcutsLabel = document.createElement("div");
|
|
13078
|
-
shortcutsLabel.className = "vpg-annotator-label";
|
|
13079
|
-
shortcutsLabel.textContent = "Keyboard shortcuts";
|
|
13080
|
-
const shortcutsList = document.createElement("div");
|
|
13081
|
-
shortcutsList.className = "vpg-annotator-shortcuts";
|
|
13082
|
-
for (const [shortcut, description] of [
|
|
13083
|
-
[SHORTCUT_LABELS.select, "Toggle selection mode"],
|
|
13084
|
-
[SHORTCUT_LABELS.preview, "Open preview"],
|
|
13085
|
-
[SHORTCUT_LABELS.copy, "Copy annotations"],
|
|
13086
|
-
[SHORTCUT_LABELS.clear, "Clear annotations"],
|
|
13087
|
-
[SHORTCUT_LABELS.settings, "Open settings"],
|
|
13088
|
-
[SHORTCUT_LABELS.cancel, "Close panel / cancel selection"]
|
|
13089
|
-
]) {
|
|
13090
|
-
const row = document.createElement("div");
|
|
13091
|
-
row.className = "vpg-annotator-shortcut-row";
|
|
13092
|
-
const text = document.createElement("span");
|
|
13093
|
-
text.className = "vpg-annotator-subtle";
|
|
13094
|
-
text.textContent = description;
|
|
13095
|
-
const kbd = document.createElement("kbd");
|
|
13096
|
-
kbd.className = "vpg-annotator-kbd";
|
|
13097
|
-
kbd.setAttribute(ANNOTATOR_ROOT_ATTR, "");
|
|
13098
|
-
kbd.textContent = shortcut;
|
|
13099
|
-
row.append(text, kbd);
|
|
13100
|
-
shortcutsList.appendChild(row);
|
|
13101
|
-
}
|
|
13102
|
-
shortcutsField.append(shortcutsLabel, shortcutsList);
|
|
13103
|
-
body.append(title, detailField, showComponentField, shortcutsField);
|
|
13022
|
+
body.append(title, detailField, showComponentField);
|
|
13104
13023
|
this.showPanel(panel, () => this.attachFloating(this.settingsButton, panel, arrowEl, "top-start", ["top-start", "left-start", "top-end", "left-end"]));
|
|
13105
13024
|
}
|
|
13106
13025
|
disposeCurrentPanel() {
|