@weasel-js/core 1.0.4 → 1.2.0
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/CHANGELOG.md +584 -0
- package/dist/{DrawCommand-BbPrSTra.d.ts → DrawCommand-uNkv5TjO.d.ts} +24 -1
- package/dist/{chunk-AYGSXNY3.js → chunk-7KYLIC3E.js} +3199 -2245
- package/dist/chunk-7KYLIC3E.js.map +1 -0
- package/dist/{chunk-JOSUVS6C.js → chunk-ADWOB5K2.js} +2 -2
- package/dist/chunk-ADWOB5K2.js.map +1 -0
- package/dist/{chunk-J3YC3GVF.js → chunk-CKADTCHK.js} +2 -2
- package/dist/chunk-CKADTCHK.js.map +1 -0
- package/dist/clipboard.d.ts +2 -2
- package/dist/clipboard.js +1 -1
- package/dist/clone.d.ts +2 -2
- package/dist/{geometry-5X6TrAkX.d.ts → geometry-C56YbnfD.d.ts} +1 -1
- package/dist/{grid-sfilv5HP.d.ts → grid-DqOi0Vgi.d.ts} +1 -1
- package/dist/index.d.ts +656 -137
- package/dist/index.js +3 -3
- package/dist/insert.d.ts +3 -3
- package/dist/move.d.ts +4 -4
- package/dist/{options-CbsIgQci.d.ts → options-C6HYCKP7.d.ts} +1 -1
- package/dist/{paint-types-CnLIzqq1.d.ts → paint-types-1fUdZUaH.d.ts} +10 -5
- package/dist/patterns-builtin.d.ts +1 -1
- package/dist/{pointSnapToGrid-C3wowsQy.d.ts → pointSnapToGrid-BBtn5bus.d.ts} +2 -2
- package/dist/{registry-QRg8KiNM.d.ts → registry-l3JX0Z6b.d.ts} +72 -14
- package/dist/renderer.d.ts +7 -53
- package/dist/renderer.js +3 -3
- package/dist/resize.d.ts +4 -4
- package/dist/routing.d.ts +7 -7
- package/dist/routing.js +1 -1
- package/dist/stroke-DaxnQ-u7.d.ts +153 -0
- package/dist/{types-ByZxoD6P.d.ts → types-BhrifbZ1.d.ts} +1 -1
- package/dist/{types-vqxpCFVp.d.ts → types-C2R2bjxf.d.ts} +8 -0
- package/dist/{types-DpQ0cWYC.d.ts → types-DbysOO-2.d.ts} +10 -3
- package/package.json +6 -6
- package/dist/chunk-AYGSXNY3.js.map +0 -1
- package/dist/chunk-J3YC3GVF.js.map +0 -1
- package/dist/chunk-JOSUVS6C.js.map +0 -1
- package/dist/viewToMat3-CQW_YqDw.d.ts +0 -67
|
@@ -139,7 +139,12 @@ interface SceneAdapter<TNode extends {
|
|
|
139
139
|
getParent(id: string): string | null;
|
|
140
140
|
setPose(id: string, pose: TPose): void;
|
|
141
141
|
setParent(id: string, parentId: string | null): void;
|
|
142
|
-
|
|
142
|
+
/** `index` is the node's z-position among its siblings. `createDeleteOp`
|
|
143
|
+
* captures it and `invert()` forwards it, so an implementation that drops
|
|
144
|
+
* it makes undo of a delete restore the node at the top instead of where
|
|
145
|
+
* it was. Treat it as required-if-you-have-order; omit only for an
|
|
146
|
+
* unordered store. */
|
|
147
|
+
insertNode(node: TNode, index?: number): void;
|
|
143
148
|
removeNode(id: string): void;
|
|
144
149
|
setSelection(ids: string[]): void;
|
|
145
150
|
applyOps?(ops: Op[], label?: string): void;
|
|
@@ -316,8 +321,10 @@ interface InsertAdapter<TNode extends {
|
|
|
316
321
|
dx: number;
|
|
317
322
|
dy: number;
|
|
318
323
|
};
|
|
319
|
-
/** Mutator wired by `insertNode`-using ops (kit-side InsertOp).
|
|
320
|
-
|
|
324
|
+
/** Mutator wired by `insertNode`-using ops (kit-side InsertOp). `index`
|
|
325
|
+
* carries the z-position a delete captured, so undo restores paint order;
|
|
326
|
+
* see `SceneAdapter.insertNode`. */
|
|
327
|
+
insertNode(node: TNode, index?: number): void;
|
|
321
328
|
/** Mutator wired by `setSelection` ops batched alongside paste. */
|
|
322
329
|
setSelection(ids: string[]): void;
|
|
323
330
|
/** Optional: see SceneAdapter.applyOps. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weasel-js/core",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Domain-agnostic 2D scene graph primitives for React: viewport math, drag/resize/insert/clone interactions, layered canvas rendering.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "orochi235",
|
|
@@ -74,11 +74,11 @@
|
|
|
74
74
|
"react": ">=18"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@weasel-js/font": "1.0
|
|
78
|
-
"@weasel-js/geom": "1.0
|
|
79
|
-
"@weasel-js/gestures": "1.0
|
|
80
|
-
"@weasel-js/history": "1.0
|
|
81
|
-
"@weasel-js/modes": "1.0
|
|
77
|
+
"@weasel-js/font": "1.2.0",
|
|
78
|
+
"@weasel-js/geom": "1.2.0",
|
|
79
|
+
"@weasel-js/gestures": "1.2.0",
|
|
80
|
+
"@weasel-js/history": "1.2.0",
|
|
81
|
+
"@weasel-js/modes": "1.2.0",
|
|
82
82
|
"earcut": "2.2.4",
|
|
83
83
|
"polygon-clipping": "^0.15.7"
|
|
84
84
|
},
|