@weasel-js/core 1.1.0 → 1.3.0-pre.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 +1988 -0
- package/dist/{DrawCommand-BbPrSTra.d.ts → DrawCommand-BnZyQaDc.d.ts} +29 -189
- package/dist/chunk-2KKYDDDD.js +121 -0
- package/dist/chunk-2KKYDDDD.js.map +1 -0
- package/dist/{chunk-J7LUY47N.js → chunk-3FB44DBC.js} +3 -3
- package/dist/{chunk-J7LUY47N.js.map → chunk-3FB44DBC.js.map} +1 -1
- package/dist/{chunk-J3YC3GVF.js → chunk-3ZV53ZW2.js} +51 -14
- package/dist/chunk-3ZV53ZW2.js.map +1 -0
- package/dist/{chunk-JOSUVS6C.js → chunk-67KE7SDP.js} +4 -4
- package/dist/chunk-67KE7SDP.js.map +1 -0
- package/dist/{chunk-CSMF654J.js → chunk-AQS4JGRA.js} +50 -7
- package/dist/chunk-AQS4JGRA.js.map +1 -0
- package/dist/{chunk-HGF5X6MZ.js → chunk-BJN5ZRIJ.js} +2 -2
- package/dist/chunk-BJN5ZRIJ.js.map +1 -0
- package/dist/{chunk-4Z6J4IVH.js → chunk-F74NVEHT.js} +14 -46
- package/dist/chunk-F74NVEHT.js.map +1 -0
- package/dist/{chunk-3B4QEB2G.js → chunk-IFOVTYAK.js} +26291 -24809
- package/dist/chunk-IFOVTYAK.js.map +1 -0
- package/dist/{chunk-UGFFCMQP.js → chunk-MXFSHJOM.js} +4 -4
- package/dist/{chunk-UGFFCMQP.js.map → chunk-MXFSHJOM.js.map} +1 -1
- package/dist/{chunk-BHVYVFGV.js → chunk-ZB7UYJVG.js} +3 -3
- package/dist/{chunk-BHVYVFGV.js.map → chunk-ZB7UYJVG.js.map} +1 -1
- package/dist/clipboard.d.ts +3 -3
- package/dist/clipboard.js +3 -3
- package/dist/clone.d.ts +2 -2
- package/dist/clone.js +3 -3
- package/dist/{geometry-C56YbnfD.d.ts → geometry-Dtt_k6Dq.d.ts} +1 -1
- package/dist/{grid-DqOi0Vgi.d.ts → grid-nnXU4VjN.d.ts} +1 -1
- package/dist/index.d.ts +1929 -1342
- package/dist/index.js +10 -10
- package/dist/insert.d.ts +3 -3
- package/dist/insert.js +1 -1
- package/dist/move.d.ts +4 -4
- package/dist/move.js +3 -3
- package/dist/{options-C6HYCKP7.d.ts → options-CdFl510T.d.ts} +1 -1
- package/dist/{path-B6MMiodD.d.ts → path-JEV2c5If.d.ts} +2 -13
- package/dist/patterns-builtin.d.ts +1 -1
- package/dist/patterns-builtin.js +1 -1
- package/dist/{pointSnapToGrid-BBtn5bus.d.ts → pointSnapToGrid-Dmthv94u.d.ts} +2 -2
- package/dist/{registry-DGBrjGbB.d.ts → registry-BU1_3L_C.d.ts} +691 -38
- package/dist/renderer.d.ts +38 -83
- package/dist/renderer.js +10 -10
- package/dist/resize.d.ts +4 -4
- package/dist/resize.js +2 -2
- package/dist/routing.d.ts +35 -9
- package/dist/routing.js +1 -1
- package/dist/stroke-5pBwOm9s.d.ts +190 -0
- package/dist/{types-vqxpCFVp.d.ts → types-DIQAisSG.d.ts} +107 -5
- package/dist/{types-DbysOO-2.d.ts → types-XBcDEp3Y.d.ts} +14 -9
- package/dist/{types-BhrifbZ1.d.ts → types-miXHGrZM.d.ts} +1 -1
- package/package.json +8 -6
- package/dist/chunk-3B4QEB2G.js.map +0 -1
- package/dist/chunk-4Z6J4IVH.js.map +0 -1
- package/dist/chunk-CSMF654J.js.map +0 -1
- package/dist/chunk-GVCNT7UH.js +0 -47
- package/dist/chunk-GVCNT7UH.js.map +0 -1
- package/dist/chunk-HGF5X6MZ.js.map +0 -1
- package/dist/chunk-J3YC3GVF.js.map +0 -1
- package/dist/chunk-JOSUVS6C.js.map +0 -1
- package/dist/paint-types-CnLIzqq1.d.ts +0 -261
- package/dist/viewToMat3-CQW_YqDw.d.ts +0 -67
|
@@ -178,13 +178,17 @@ interface MoveAdapter<TNode extends {
|
|
|
178
178
|
/** Optional: see SceneAdapter.applyOps. */
|
|
179
179
|
applyOps?(ops: Op[], label: string): void;
|
|
180
180
|
findSnapTarget?(draggedId: string, worldX: number, worldY: number): SnapTarget<TPose> | null;
|
|
181
|
-
/** Optional:
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
|
|
181
|
+
/** Optional: ordered children of `parentId`, `null` for the root siblings.
|
|
182
|
+
* One contract with {@link OrderedAdapter.getChildren} — the two land on
|
|
183
|
+
* the same adapter object, and an implementation that answers only node
|
|
184
|
+
* ids returns `[]` for the root, which the ops read as "no siblings".
|
|
185
|
+
*
|
|
186
|
+
* When present (alongside the `cascadeWorldPose` option on `useMove`),
|
|
187
|
+
* dragging a node auto-cascades its descendants in the live overlay so
|
|
188
|
+
* structurally-grouped children visually follow the parent during the
|
|
189
|
+
* drag. No additional ops are generated — children's local poses don't
|
|
190
|
+
* change when the parent's local pose moves. */
|
|
191
|
+
getChildren?(parentId: string | null): string[];
|
|
188
192
|
/** Optional: layout strategy attached to a container, or null if the
|
|
189
193
|
* container uses absolute positioning (default behavior). When present,
|
|
190
194
|
* `useMove` uses the strategy to compute drop targets, sibling reflow,
|
|
@@ -360,11 +364,12 @@ interface LayerEnumerableAdapter<TLayer extends string = string> {
|
|
|
360
364
|
*/
|
|
361
365
|
interface OrderedAdapter {
|
|
362
366
|
/** Ordered children of `parentId` (or root siblings if null), in z-order:
|
|
363
|
-
* index 0 is bottom, last index is top.
|
|
367
|
+
* index 0 is bottom, last index is top. The same contract
|
|
368
|
+
* {@link MoveAdapter.getChildren} declares — one method, two readers. */
|
|
364
369
|
getChildren?(parentId: string | null): string[];
|
|
365
370
|
/** Rewrite the order of `parentId`'s children. Length and contents must
|
|
366
371
|
* match the existing children — reorder only, no add/remove. */
|
|
367
372
|
setChildOrder?(parentId: string | null, ids: string[]): void;
|
|
368
373
|
}
|
|
369
374
|
|
|
370
|
-
export type { AreaSelectAdapter as A, ClipboardSnapshot as C, DropTarget as D, InsertAdapter as I, LayoutStrategy as L, MoveAdapter as M, OrderedAdapter as O, RotateAdapter as R, SnapTarget as S,
|
|
375
|
+
export type { AreaSelectAdapter as A, ClipboardSnapshot as C, DropTarget as D, InsertAdapter as I, LayoutStrategy as L, MoveAdapter as M, OrderedAdapter as O, RotateAdapter as R, SnapTarget as S, SceneAdapter as a, LassoHitMode as b, LassoSelectAdapter as c, ResizeAdapter as d, LayerEnumerableAdapter as e, LayoutSnap as f, ContainerBounds as g, LayoutChild as h, LayoutContainer as i, LayoutDragged as j };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Op } from '@weasel-js/history';
|
|
2
|
-
import { S as SnapTarget, M as MoveAdapter, I as InsertAdapter } from './types-
|
|
2
|
+
import { S as SnapTarget, M as MoveAdapter, I as InsertAdapter } from './types-XBcDEp3Y.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Snapshot of modifier-key state at gesture dispatch.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weasel-js/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0-pre.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,13 @@
|
|
|
74
74
|
"react": ">=18"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@weasel-js/font": "1.
|
|
78
|
-
"@weasel-js/geom": "1.
|
|
79
|
-
"@weasel-js/gestures": "1.
|
|
80
|
-
"@weasel-js/history": "1.
|
|
81
|
-
"@weasel-js/modes": "1.
|
|
77
|
+
"@weasel-js/font": "1.3.0-pre.0",
|
|
78
|
+
"@weasel-js/geom": "1.3.0-pre.0",
|
|
79
|
+
"@weasel-js/gestures": "1.3.0-pre.0",
|
|
80
|
+
"@weasel-js/history": "1.3.0-pre.0",
|
|
81
|
+
"@weasel-js/modes": "1.3.0-pre.0",
|
|
82
|
+
"@weasel-js/paint": "1.3.0-pre.0",
|
|
83
|
+
"@weasel-js/text": "1.3.0-pre.0",
|
|
82
84
|
"earcut": "2.2.4",
|
|
83
85
|
"polygon-clipping": "^0.15.7"
|
|
84
86
|
},
|