@openpresentation/opf-editor 0.20.0 → 0.20.2
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/dist/canvas.js +5 -1
- package/package.json +5 -5
package/dist/canvas.js
CHANGED
|
@@ -113,7 +113,7 @@ export function createCanvasEditor(container, options = {}) {
|
|
|
113
113
|
notice.hidden = true;
|
|
114
114
|
const style = doc.createElement("style");
|
|
115
115
|
style.textContent =
|
|
116
|
-
".opf-canvas-preview>svg{display:block;width:100%;height:auto}.opf-canvas [data-canvas-target]{cursor:text}.opf-canvas .opf-inline-input::selection{background:#8975d933;color:var(--opf-inline-selection-color,transparent)}.opf-canvas [data-canvas-target]:focus{outline:none}.opf-canvas [data-canvas-target]:hover>.opf-selection{stroke:#9c90df}.opf-canvas [data-canvas-selected]>.opf-selection,.opf-canvas [data-canvas-target]:focus-visible>.opf-selection{stroke:#7765d0}.opf-canvas button:focus-visible,.opf-canvas textarea:focus-visible,.opf-canvas input:focus-visible{outline:2px solid #8170d5;outline-offset:2px}";
|
|
116
|
+
".opf-canvas-preview>svg{display:block;width:100%;height:auto}.opf-canvas [data-canvas-target]{cursor:text}.opf-canvas .opf-inline-input::selection{background:#8975d933;color:var(--opf-inline-selection-color,transparent)}.opf-canvas [data-canvas-target]:focus{outline:none}.opf-canvas [data-canvas-target]:hover>.opf-selection{stroke:#9c90df}.opf-canvas [data-canvas-selected]>.opf-selection,.opf-canvas [data-canvas-target]:focus-visible>.opf-selection{stroke:#7765d0}.opf-canvas [data-canvas-target][data-canvas-editing]>.opf-selection{stroke:none}.opf-canvas button:focus-visible,.opf-canvas textarea:focus-visible,.opf-canvas input:focus-visible{outline:2px solid #8170d5;outline-offset:2px}";
|
|
117
117
|
root.append(style, preview, overlay, notice);
|
|
118
118
|
container.replaceChildren(root);
|
|
119
119
|
const report = (error) => {
|
|
@@ -449,6 +449,10 @@ export function createCanvasEditor(container, options = {}) {
|
|
|
449
449
|
const target = getTarget(active.path),
|
|
450
450
|
text = target?.matches("text") ? target : target?.querySelector("text");
|
|
451
451
|
if (!text) return;
|
|
452
|
+
// The scalar textarea supplies the editing boundary. Keep the SVG rectangle for hit testing,
|
|
453
|
+
// but suppress its second stroke, including after a draft render replaces the target.
|
|
454
|
+
// Rich text uses an invisible native input, so it keeps the SVG selection boundary.
|
|
455
|
+
target.setAttribute("data-canvas-editing", "");
|
|
452
456
|
const svg = preview.querySelector("svg"),
|
|
453
457
|
svgRect = svg.getBoundingClientRect(),
|
|
454
458
|
rootRect = root.getBoundingClientRect();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openpresentation/opf-editor",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.2",
|
|
4
4
|
"description": "Embeddable local OPF editor primitives built on the deterministic renderer.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -260,11 +260,11 @@
|
|
|
260
260
|
"@codemirror/autocomplete": "6.20.3",
|
|
261
261
|
"@codemirror/commands": "6.11.1",
|
|
262
262
|
"@codemirror/lang-json": "6.0.2",
|
|
263
|
-
"@codemirror/language": "6.
|
|
263
|
+
"@codemirror/language": "6.13.1",
|
|
264
264
|
"@codemirror/lint": "6.9.7",
|
|
265
265
|
"@codemirror/search": "6.7.2",
|
|
266
266
|
"@codemirror/state": "6.7.6",
|
|
267
|
-
"@codemirror/view": "6.43.
|
|
267
|
+
"@codemirror/view": "6.43.14",
|
|
268
268
|
"@lezer/highlight": "1.2.5",
|
|
269
269
|
"@openpresentation/opf": "^0.20.1",
|
|
270
270
|
"jsonc-parser": "3.3.1"
|
|
@@ -323,7 +323,7 @@
|
|
|
323
323
|
"@expo-google-fonts/roboto-mono": "0.4.2",
|
|
324
324
|
"@expo-google-fonts/stix-two-math": "0.4.0",
|
|
325
325
|
"@expo-google-fonts/tinos": "0.4.2",
|
|
326
|
-
"@openpresentation/opf-pptx": "^0.20.
|
|
326
|
+
"@openpresentation/opf-pptx": "^0.20.2",
|
|
327
327
|
"@openpresentation/opf-render": "^0.20.0",
|
|
328
328
|
"@resvg/resvg-js": "2.6.2",
|
|
329
329
|
"axe-core": "4.14.0",
|
|
@@ -331,6 +331,6 @@
|
|
|
331
331
|
"jszip": "3.10.2",
|
|
332
332
|
"pdf-lib": "1.17.1",
|
|
333
333
|
"pdfjs-dist": "6.4.299",
|
|
334
|
-
"playwright": "1.
|
|
334
|
+
"playwright": "1.64.0"
|
|
335
335
|
}
|
|
336
336
|
}
|