@grida/svg-editor 1.0.0-alpha.16 → 1.0.0-alpha.18
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/README.md +33 -0
- package/dist/{dom-BO2-E9oK.d.ts → dom-BMzX1CXZ.d.ts} +13 -1
- package/dist/{dom-U6ae5fQF.js → dom-DKQ4Vt3z.js} +105 -12
- package/dist/{dom-DOvcMvl4.mjs → dom-OP-kmK8k.mjs} +105 -12
- package/dist/{dom-98AUOfsP.d.mts → dom-TctdgRnn.d.mts} +13 -1
- package/dist/dom.d.mts +2 -2
- package/dist/dom.d.ts +2 -2
- package/dist/dom.js +1 -1
- package/dist/dom.mjs +1 -1
- package/dist/{editor-CYoGJ3Hf.d.ts → editor-BSxTUsW_.d.ts} +246 -4
- package/dist/{editor-C6Lj1In-.js → editor-Be6UrMeV.js} +384 -36
- package/dist/{editor-DKQOIKuU.mjs → editor-BkCbYCz2.mjs} +385 -36
- package/dist/{editor-D2eQe8lB.d.mts → editor-KqpIW1qm.d.mts} +246 -4
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{model-D0nU_EkL.js → model-BLhMJZKJ.js} +373 -27
- package/dist/{model-L3t9ixT_.mjs → model-DU0GOMwM.mjs} +362 -28
- package/dist/presets.d.mts +2 -2
- package/dist/presets.d.ts +2 -2
- package/dist/presets.js +2 -2
- package/dist/presets.mjs +1 -1
- package/dist/react.d.mts +10 -3
- package/dist/react.d.ts +10 -3
- package/dist/react.js +6 -4
- package/dist/react.mjs +6 -4
- package/package.json +5 -5
package/dist/react.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_editor = require("./editor-
|
|
4
|
-
const require_dom = require("./dom-
|
|
3
|
+
const require_editor = require("./editor-Be6UrMeV.js");
|
|
4
|
+
const require_dom = require("./dom-DKQ4Vt3z.js");
|
|
5
5
|
let react = require("react");
|
|
6
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
7
|
//#region src/react.tsx
|
|
@@ -40,7 +40,7 @@ function SvgEditorProvider({ initialSvg, providers, style, children }) {
|
|
|
40
40
|
* context for them, because a host may mount multiple canvases in the
|
|
41
41
|
* same editor session.
|
|
42
42
|
*/
|
|
43
|
-
function SvgEditorCanvas({ className, style, gestures, fit, initial_camera, onAttach }) {
|
|
43
|
+
function SvgEditorCanvas({ className, style, gestures, fit, clipboard, initial_camera, onAttach }) {
|
|
44
44
|
const editor = useSvgEditor();
|
|
45
45
|
const ref = (0, react.useRef)(null);
|
|
46
46
|
const on_attach_ref = (0, react.useRef)(onAttach);
|
|
@@ -54,6 +54,7 @@ function SvgEditorCanvas({ className, style, gestures, fit, initial_camera, onAt
|
|
|
54
54
|
container,
|
|
55
55
|
gestures,
|
|
56
56
|
fit,
|
|
57
|
+
clipboard,
|
|
57
58
|
initial_camera: initial_camera_ref.current
|
|
58
59
|
});
|
|
59
60
|
on_attach_ref.current?.(handle);
|
|
@@ -64,7 +65,8 @@ function SvgEditorCanvas({ className, style, gestures, fit, initial_camera, onAt
|
|
|
64
65
|
}, [
|
|
65
66
|
editor,
|
|
66
67
|
gestures,
|
|
67
|
-
fit
|
|
68
|
+
fit,
|
|
69
|
+
clipboard
|
|
68
70
|
]);
|
|
69
71
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
70
72
|
ref,
|
package/dist/react.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as createSvgEditor } from "./editor-
|
|
3
|
-
import { t as attach_dom_surface } from "./dom-
|
|
2
|
+
import { t as createSvgEditor } from "./editor-BkCbYCz2.mjs";
|
|
3
|
+
import { t as attach_dom_surface } from "./dom-OP-kmK8k.mjs";
|
|
4
4
|
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useSyncExternalStore } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region src/react.tsx
|
|
@@ -39,7 +39,7 @@ function SvgEditorProvider({ initialSvg, providers, style, children }) {
|
|
|
39
39
|
* context for them, because a host may mount multiple canvases in the
|
|
40
40
|
* same editor session.
|
|
41
41
|
*/
|
|
42
|
-
function SvgEditorCanvas({ className, style, gestures, fit, initial_camera, onAttach }) {
|
|
42
|
+
function SvgEditorCanvas({ className, style, gestures, fit, clipboard, initial_camera, onAttach }) {
|
|
43
43
|
const editor = useSvgEditor();
|
|
44
44
|
const ref = useRef(null);
|
|
45
45
|
const on_attach_ref = useRef(onAttach);
|
|
@@ -53,6 +53,7 @@ function SvgEditorCanvas({ className, style, gestures, fit, initial_camera, onAt
|
|
|
53
53
|
container,
|
|
54
54
|
gestures,
|
|
55
55
|
fit,
|
|
56
|
+
clipboard,
|
|
56
57
|
initial_camera: initial_camera_ref.current
|
|
57
58
|
});
|
|
58
59
|
on_attach_ref.current?.(handle);
|
|
@@ -63,7 +64,8 @@ function SvgEditorCanvas({ className, style, gestures, fit, initial_camera, onAt
|
|
|
63
64
|
}, [
|
|
64
65
|
editor,
|
|
65
66
|
gestures,
|
|
66
|
-
fit
|
|
67
|
+
fit,
|
|
68
|
+
clipboard
|
|
67
69
|
]);
|
|
68
70
|
return /* @__PURE__ */ jsx("div", {
|
|
69
71
|
ref,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grida/svg-editor",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.18",
|
|
4
4
|
"description": "Headless SVG editor (experimental).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bezier",
|
|
@@ -58,13 +58,13 @@
|
|
|
58
58
|
"tag": "alpha"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@grida/cmath": "0.2.3",
|
|
62
61
|
"@grida/history": "0.1.1",
|
|
63
62
|
"@grida/keybinding": "0.2.1",
|
|
64
|
-
"@grida/
|
|
63
|
+
"@grida/hud": "0.2.2",
|
|
64
|
+
"@grida/svg": "0.2.0",
|
|
65
65
|
"@grida/text-editor": "0.1.2",
|
|
66
|
-
"@grida/
|
|
67
|
-
"@grida/
|
|
66
|
+
"@grida/cmath": "0.2.3",
|
|
67
|
+
"@grida/vn": "0.1.0"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@types/react": "^19",
|