@openpresentation/opf-editor 0.20.1 → 0.20.3
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.3",
|
|
4
4
|
"description": "Embeddable local OPF editor primitives built on the deterministic renderer.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -266,11 +266,11 @@
|
|
|
266
266
|
"@codemirror/state": "6.7.6",
|
|
267
267
|
"@codemirror/view": "6.43.14",
|
|
268
268
|
"@lezer/highlight": "1.2.5",
|
|
269
|
-
"@openpresentation/opf": "^0.20.
|
|
269
|
+
"@openpresentation/opf": "^0.20.2",
|
|
270
270
|
"jsonc-parser": "3.3.1"
|
|
271
271
|
},
|
|
272
272
|
"peerDependencies": {
|
|
273
|
-
"@openpresentation/opf-render": "^0.20.
|
|
273
|
+
"@openpresentation/opf-render": "^0.20.2"
|
|
274
274
|
},
|
|
275
275
|
"peerDependenciesMeta": {
|
|
276
276
|
"@openpresentation/opf-render": {
|
|
@@ -323,8 +323,8 @@
|
|
|
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.
|
|
327
|
-
"@openpresentation/opf-render": "^0.20.
|
|
326
|
+
"@openpresentation/opf-pptx": "^0.20.3",
|
|
327
|
+
"@openpresentation/opf-render": "^0.20.2",
|
|
328
328
|
"@resvg/resvg-js": "2.6.2",
|
|
329
329
|
"axe-core": "4.14.0",
|
|
330
330
|
"esbuild": "0.28.2",
|