@weasel-js/core 1.5.0 → 1.5.1

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +363 -0
  2. package/dist/autoPoseDescriptor-Dr6CwNZK.d.ts +26 -0
  3. package/dist/{chunk-UCPV7JXC.js → chunk-3LPQ2XZG.js} +4 -159
  4. package/dist/chunk-3LPQ2XZG.js.map +1 -0
  5. package/dist/{chunk-MG7OXCAI.js → chunk-GREL4MVO.js} +2276 -1485
  6. package/dist/chunk-GREL4MVO.js.map +1 -0
  7. package/dist/chunk-HAGOFNP5.js +162 -0
  8. package/dist/chunk-HAGOFNP5.js.map +1 -0
  9. package/dist/chunk-LXJDWBEL.js +318 -0
  10. package/dist/chunk-LXJDWBEL.js.map +1 -0
  11. package/dist/{chunk-BDWAA634.js → chunk-P6MGECVO.js} +3 -3
  12. package/dist/{chunk-BDWAA634.js.map → chunk-P6MGECVO.js.map} +1 -1
  13. package/dist/{chunk-MQI4PIX3.js → chunk-XXQ6FLCJ.js} +3 -3
  14. package/dist/{chunk-MQI4PIX3.js.map → chunk-XXQ6FLCJ.js.map} +1 -1
  15. package/dist/clipboard.d.ts +1 -1
  16. package/dist/clone.d.ts +2 -2
  17. package/dist/{depSchema-nMqj_qTM.d.ts → depSchema-BubKMv-2.d.ts} +67 -78
  18. package/dist/{grid-BrIa38gG.d.ts → grid-Z_Af3vTl.d.ts} +1 -1
  19. package/dist/index.d.ts +647 -382
  20. package/dist/index.js +6 -4
  21. package/dist/insert.d.ts +3 -3
  22. package/dist/insert.js +2 -1
  23. package/dist/insert.js.map +1 -1
  24. package/dist/math-E3rZn4bR.d.ts +282 -0
  25. package/dist/math.d.ts +5 -0
  26. package/dist/math.js +4 -0
  27. package/dist/math.js.map +1 -0
  28. package/dist/move.d.ts +4 -4
  29. package/dist/move.js +3 -2
  30. package/dist/move.js.map +1 -1
  31. package/dist/{options-BDyCnrp8.d.ts → options-BPcmwYk7.d.ts} +1 -1
  32. package/dist/{autoPoseDescriptor-CvjflWJK.d.ts → pointSnapToGrid-CgcK2R_I.d.ts} +2 -26
  33. package/dist/{poseDescriptor-CGOgIgf8.d.ts → poseDescriptor-PgfVKfa0.d.ts} +1 -1
  34. package/dist/renderer.d.ts +5 -6
  35. package/dist/renderer.js +6 -4
  36. package/dist/resize.d.ts +5 -4
  37. package/dist/resize.js +3 -2
  38. package/dist/{types-DMyo7dnM.d.ts → types-BHGdrOcu.d.ts} +1 -1
  39. package/dist/{types-DtjCJA5r.d.ts → types-BdaK9PcP.d.ts} +1 -1
  40. package/package.json +14 -10
  41. package/dist/chunk-MG7OXCAI.js.map +0 -1
  42. package/dist/chunk-UCPV7JXC.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/ops/transform.ts","../src/core/ops/reparent.ts","../src/interactions/gestures/shared/snap.ts"],"names":[],"mappings":";;;;AAoBO,SAAS,kBAAyB,IAAA,EAAgC;AACvE,EAAA,MAAM,EAAE,IAAI,IAAA,EAAM,EAAA,EAAI,OAAO,WAAA,GAAc,CAAA,UAAA,EAAa,EAAE,CAAA,CAAA,EAAG,GAAI,IAAA;AACjE,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,WAAA;AAAA,IACN,MAAM,EAAE,EAAA,EAAI,IAAA,EAAM,EAAA,EAAI,OAAO,WAAA,EAAY;AAAA,IACzC,KAAA;AAAA,IACA,WAAA;AAAA,IACA,MAAM,OAAA,EAAS;AAOb,MAAC,OAAA,CAAoC,OAAA,CAAQ,EAAA,EAAI,EAAE,CAAA;AACnD,MAAA,IAAI,gBAAA,CAAiB,IAAA,EAAM,EAAE,CAAA,EAAG,OAAO,KAAA;AACvC,MAAA,OAAO,MAAA;AAAA,IACT,CAAA;AAAA,IACA,MAAA,GAAS;AACP,MAAA,OAAO,iBAAA,CAAyB,EAAE,EAAA,EAAI,IAAA,EAAM,IAAI,EAAA,EAAI,IAAA,EAAM,KAAA,EAAO,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W;AAC9B,MAAA,MAAM,WAAW,IAAA,CAAK,SAAA,CAAU,YAAY,SAAA,CAAU,EAAA,EAAI,UAAU,EAAE,CAAA;AACtE,MAAA,MAAM,OAAA,GAAU,QAAA,CAAS,IAAA,CAAK,QAAA,EAAU,GAAG,CAAA;AAC3C,MAAA,IAAI,YAAY,IAAA,EAAM;AACtB,MAAA,MAAM,EAAA,GAAK,IAAA,CAAK,SAAA,CAAU,UAAU,CAAA;AACpC,MAAA,MAAM,EAAA,GAAK,IAAA,CAAK,SAAA,CAAU,OAAO,CAAA;AACjC,MAAA,OAAO;AAAA,QACL,SAAA,EAAW,EAAE,IAAA,EAAM,WAAA,EAAa,EAAA,EAAI,EAAA,CAAG,CAAA,GAAI,EAAA,CAAG,CAAA,EAAG,EAAA,EAAI,EAAA,CAAG,CAAA,GAAI,GAAG,CAAA;AAAE,OACnE;AAAA,IACF;AAAA,GACF;AACF","file":"chunk-BDWAA634.js","sourcesContent":["import type { Op } from './types';\nimport { registerOpFactory } from './registry';\n\ninterface TransformAdapter<TPose> {\n setPose(id: string, pose: TPose): void;\n}\n\n/** @internal */\ninterface TransformArgs<TPose> {\n id: string;\n from: TPose;\n to: TPose;\n label?: string;\n coalesceKey?: string;\n}\n\n/** Op: set an object's pose, inverting back to `from`. `coalesceKey` defaults to\n * `transform:${id}` so successive pose writes to the same node (drag-move,\n * resize, repeated nudges) merge into one undo entry within the history's\n * coalesce window. Pass an explicit key (or a unique one) to opt out. */\nexport function createTransformOp<TPose>(args: TransformArgs<TPose>): Op {\n const { id, from, to, label, coalesceKey = `transform:${id}` } = args;\n return {\n name: 'transform',\n args: { id, from, to, label, coalesceKey },\n label,\n coalesceKey,\n apply(adapter) {\n // Always call setPose so consumers that inspect op behavior (tests,\n // overlays) see a consistent \"this op writes (id, to)\" signal. When\n // from and to are structurally identical, additionally report a\n // no-op to history so the entry can be skipped from the undo stack.\n // setPose(id, to) is idempotent in this branch — adapters write the\n // same pose they already had.\n (adapter as TransformAdapter<TPose>).setPose(id, to);\n if (poseShallowEqual(from, to)) return false;\n return undefined;\n },\n invert() {\n return createTransformOp<TPose>({ id, from: to, to: from, label, coalesceKey });\n },\n };\n}\n\nregisterOpFactory<TransformArgs<unknown>>('transform', (args) => createTransformOp(args));\n\nfunction poseShallowEqual<TPose>(a: TPose, b: TPose): boolean {\n if (a === b) return true;\n if (a === null || b === null || typeof a !== 'object' || typeof b !== 'object') return false;\n const ka = Object.keys(a as object);\n const kb = Object.keys(b as object);\n if (ka.length !== kb.length) return false;\n for (const k of ka) {\n if ((a as Record<string, unknown>)[k] !== (b as Record<string, unknown>)[k]) return false;\n }\n return true;\n}\n","import type { Op } from './types';\nimport { registerOpFactory } from './registry';\nimport { captureSlot, resolveSlot, slotFromIndex, type OrderedReader, type Slot } from './slot';\n\ninterface ReparentAdapter extends OrderedReader {\n setParent(id: string, parentId: string | null): void;\n /** Sibling-order write, paired with `getChildren`. Optional: an adapter\n * without both silently ignores slots and appends. */\n setChildOrder?(parentId: string | null, ids: string[]): void;\n}\n\n/** @internal */\ninterface ReparentArgs {\n id: string;\n fromParentId: string | null;\n toParentId: string | null;\n /** Sibling ordinal under the old parent. Sugar for `fromSlot: { index }`,\n * and only a seed: `apply` re-observes the node's full slot through the\n * adapter and that observation supersedes this. */\n fromIndex?: number;\n /** Sibling ordinal under the new parent. Sugar for `toSlot: { index }`.\n * Omit to append. */\n toIndex?: number;\n /** Slot under the old parent, anchor included. `invert()` forwards it as\n * the destination slot; without it undo re-parents with no position and\n * the node lands last, quietly changing paint order. */\n fromSlot?: Slot;\n /** Slot under the new parent, anchor included. Omit to append. */\n toSlot?: Slot;\n label?: string;\n coalesceKey?: string;\n}\n\n/** Move `id` to `slot` among `parentId`'s children. No-op when the adapter\n * has no ordering seam, when `id` isn't there, or when it's already in\n * place. */\nfunction placeAt(\n a: ReparentAdapter,\n parentId: string | null,\n id: string,\n slot: Slot,\n): void {\n if (!a.getChildren || !a.setChildOrder) return;\n const current = a.getChildren(parentId);\n const from = current.indexOf(id);\n if (from < 0) return;\n const next = current.slice();\n next.splice(from, 1);\n const resolved = resolveSlot(next, slot);\n const to = resolved === undefined ? next.length : Math.max(0, Math.min(resolved, next.length));\n if (from === to) return;\n next.splice(to, 0, id);\n a.setChildOrder(parentId, next);\n}\n\n/** Present when the caller named a destination at all; `undefined` leaves\n * placement to the adapter. */\nfunction optionalSlot(slot: Slot | undefined, index: number | undefined): Slot | undefined {\n if (slot) return slot;\n return index === undefined ? undefined : slotFromIndex(index);\n}\n\n/**\n * Op: change `id`'s parent and sibling slot, inverting back to the prior\n * parent and slot.\n *\n * `coalesceKey` defaults to `reparent:${id}` so successive reparents of the\n * same id batch-merge cleanly.\n */\nexport function createReparentOp(args: ReparentArgs): Op {\n const {\n id, fromParentId, toParentId,\n label = 'Reparent', coalesceKey = `reparent:${id}`,\n } = args;\n let fromSlot = optionalSlot(args.fromSlot, args.fromIndex);\n const toSlot = optionalSlot(args.toSlot, args.toIndex);\n const argsForSerial: ReparentArgs = {\n id, fromParentId, toParentId, fromSlot, toSlot, label, coalesceKey,\n };\n return {\n name: 'reparent',\n args: argsForSerial,\n label,\n coalesceKey,\n apply(adapter) {\n const a = adapter as ReparentAdapter;\n const observed = captureSlot(a, fromParentId, id);\n if (observed) {\n fromSlot = observed;\n argsForSerial.fromSlot = observed;\n }\n a.setParent(id, toParentId);\n if (toSlot) placeAt(a, toParentId, id, toSlot);\n },\n invert() {\n return createReparentOp({\n id,\n fromParentId: toParentId,\n toParentId: fromParentId,\n fromSlot: toSlot,\n toSlot: fromSlot,\n label,\n coalesceKey,\n });\n },\n };\n}\n\nregisterOpFactory<ReparentArgs>('reparent', (args) => createReparentOp(args));\n","import type { MoveBehavior, ModifierState, SnapStrategy } from '../types';\nimport {\n RECT_ORIGIN_PROJECTION,\n type OriginProjection,\n} from './strategies/grid';\n\ntype ModKey = keyof ModifierState;\n\n/**\n * Generic snap behavior factory: wraps a `SnapStrategy` and returns a\n * `MoveBehavior` whose `onMove` returns a uniform `GroupTransform`.\n *\n * Implementation:\n * 1. Compute the primary's proposed pose by applying the gesture's\n * `transform` (translate) to `origin.get(primaryId)`.\n * 2. Call `strategy.snap(proposed)`. If null, no-op.\n * 3. Derive the snapped delta via the `OriginProjection`:\n * dx = origin(snapped).x - origin(originPose).x\n * ...so the gesture applies the same delta to every dragged id.\n *\n * The pose-shape-aware delta extraction lives here — gestures stay pose-shape\n * agnostic. Default projection is `{x, y}`-bearing (rect / path / polygon).\n * Pass `origin` for exotic poses.\n */\nexport function snap<TPose>(\n strategy: SnapStrategy<TPose>,\n opts: { bypassKey?: ModKey; origin?: OriginProjection<TPose> } = {},\n): MoveBehavior<TPose> {\n const { bypassKey } = opts;\n const proj: OriginProjection<TPose> = opts.origin\n ?? (RECT_ORIGIN_PROJECTION as unknown as OriginProjection<TPose>);\n return {\n onMove(ctx, transform) {\n if (bypassKey && ctx.modifiers[bypassKey]) return;\n // The new contract: behaviors see a GroupTransform, not a pose. But\n // strategies still operate on poses. Reconstruct the proposed pose\n // by applying the (translate) transform to the primary's origin.\n if (transform.kind !== 'translate') return;\n const primaryId = ctx.draggedIds[0];\n if (primaryId === undefined) return;\n const originPose = ctx.origin.get(primaryId);\n if (originPose === undefined) return;\n const proposed = proj.translate(originPose, transform.dx, transform.dy);\n const snapped = strategy.snap(proposed, ctx);\n if (snapped === null) return;\n const o0 = proj.getOrigin(originPose);\n const o1 = proj.getOrigin(snapped);\n return {\n transform: { kind: 'translate', dx: o1.x - o0.x, dy: o1.y - o0.y },\n };\n },\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/core/ops/transform.ts","../src/core/ops/reparent.ts","../src/interactions/gestures/shared/snap.ts"],"names":[],"mappings":";;;;AAoBO,SAAS,kBAAyB,IAAA,EAAgC;AACvE,EAAA,MAAM,EAAE,IAAI,IAAA,EAAM,EAAA,EAAI,OAAO,WAAA,GAAc,CAAA,UAAA,EAAa,EAAE,CAAA,CAAA,EAAG,GAAI,IAAA;AACjE,EAAA,OAAO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AAE,WAAU,GAAI,IAAA;AACtB,EAAA,MAAM,IAAA,GAAgC,KAAK,MAAA,IACrC,sBAAA;AACN,EAAA,OAAO;AAAA,IACL,MAAA,CAAO,KAAK,SAAA,EAAW;AACrB,MAAA,IAAI,SAAA,IAAa,GAAA,CAAI,SAAA,CAAU,SAAS,CAAA,EAAG;AAI3C,MAAA,IAAI,SAAA,CAAU,SAAS,WAAA,EAAa;AACpC,MAAA,MAAM,SAAA,GAAY,GAAA,CAAI,UAAA,CAAW,CAAC,CAAA;AAClC,MAAA,IAAI,cAAc,MAAA,EAAW;AAC7B,MAAA,MAAM,UAAA,GAAa,GAAA,CAAI,MAAA,CAAO,GAAA,CAAI,SAAS,CAAA;AAC3C,MAAA,IAAI,eAAe,MAAA,EAAW;AAC9B,MAAA,MAAM,WAAW,IAAA,CAAK,SAAA,CAAU,YAAY,SAAA,CAAU,EAAA,EAAI,UAAU,EAAE,CAAA;AACtE,MAAA,MAAM,OAAA,GAAU,QAAA,CAAS,IAAA,CAAK,QAAA,EAAU,GAAG,CAAA;AAC3C,MAAA,IAAI,YAAY,IAAA,EAAM;AACtB,MAAA,MAAM,EAAA,GAAK,IAAA,CAAK,SAAA,CAAU,UAAU,CAAA;AACpC,MAAA,MAAM,EAAA,GAAK,IAAA,CAAK,SAAA,CAAU,OAAO,CAAA;AACjC,MAAA,OAAO;AAAA,QACL,SAAA,EAAW,EAAE,IAAA,EAAM,WAAA,EAAa,EAAA,EAAI,EAAA,CAAG,CAAA,GAAI,EAAA,CAAG,CAAA,EAAG,EAAA,EAAI,EAAA,CAAG,CAAA,GAAI,GAAG,CAAA;AAAE,OACnE;AAAA,IACF;AAAA,GACF;AACF","file":"chunk-P6MGECVO.js","sourcesContent":["import type { Op } from './types';\nimport { registerOpFactory } from './registry';\n\ninterface TransformAdapter<TPose> {\n setPose(id: string, pose: TPose): void;\n}\n\n/** @internal */\ninterface TransformArgs<TPose> {\n id: string;\n from: TPose;\n to: TPose;\n label?: string;\n coalesceKey?: string;\n}\n\n/** Op: set an object's pose, inverting back to `from`. `coalesceKey` defaults to\n * `transform:${id}` so successive pose writes to the same node (drag-move,\n * resize, repeated nudges) merge into one undo entry within the history's\n * coalesce window. Pass an explicit key (or a unique one) to opt out. */\nexport function createTransformOp<TPose>(args: TransformArgs<TPose>): Op {\n const { id, from, to, label, coalesceKey = `transform:${id}` } = args;\n return {\n name: 'transform',\n args: { id, from, to, label, coalesceKey },\n label,\n coalesceKey,\n apply(adapter) {\n // Always call setPose so consumers that inspect op behavior (tests,\n // overlays) see a consistent \"this op writes (id, to)\" signal. When\n // from and to are structurally identical, additionally report a\n // no-op to history so the entry can be skipped from the undo stack.\n // setPose(id, to) is idempotent in this branch — adapters write the\n // same pose they already had.\n (adapter as TransformAdapter<TPose>).setPose(id, to);\n if (poseShallowEqual(from, to)) return false;\n return undefined;\n },\n invert() {\n return createTransformOp<TPose>({ id, from: to, to: from, label, coalesceKey });\n },\n };\n}\n\nregisterOpFactory<TransformArgs<unknown>>('transform', (args) => createTransformOp(args));\n\nfunction poseShallowEqual<TPose>(a: TPose, b: TPose): boolean {\n if (a === b) return true;\n if (a === null || b === null || typeof a !== 'object' || typeof b !== 'object') return false;\n const ka = Object.keys(a as object);\n const kb = Object.keys(b as object);\n if (ka.length !== kb.length) return false;\n for (const k of ka) {\n if ((a as Record<string, unknown>)[k] !== (b as Record<string, unknown>)[k]) return false;\n }\n return true;\n}\n","import type { Op } from './types';\nimport { registerOpFactory } from './registry';\nimport { captureSlot, resolveSlot, slotFromIndex, type OrderedReader, type Slot } from './slot';\n\ninterface ReparentAdapter extends OrderedReader {\n setParent(id: string, parentId: string | null): void;\n /** Sibling-order write, paired with `getChildren`. Optional: an adapter\n * without both silently ignores slots and appends. */\n setChildOrder?(parentId: string | null, ids: string[]): void;\n}\n\n/** @internal */\ninterface ReparentArgs {\n id: string;\n fromParentId: string | null;\n toParentId: string | null;\n /** Sibling ordinal under the old parent. Sugar for `fromSlot: { index }`,\n * and only a seed: `apply` re-observes the node's full slot through the\n * adapter and that observation supersedes this. */\n fromIndex?: number;\n /** Sibling ordinal under the new parent. Sugar for `toSlot: { index }`.\n * Omit to append. */\n toIndex?: number;\n /** Slot under the old parent, anchor included. `invert()` forwards it as\n * the destination slot; without it undo re-parents with no position and\n * the node lands last, quietly changing paint order. */\n fromSlot?: Slot;\n /** Slot under the new parent, anchor included. Omit to append. */\n toSlot?: Slot;\n label?: string;\n coalesceKey?: string;\n}\n\n/** Move `id` to `slot` among `parentId`'s children. No-op when the adapter\n * has no ordering seam, when `id` isn't there, or when it's already in\n * place. */\nfunction placeAt(\n a: ReparentAdapter,\n parentId: string | null,\n id: string,\n slot: Slot,\n): void {\n if (!a.getChildren || !a.setChildOrder) return;\n const current = a.getChildren(parentId);\n const from = current.indexOf(id);\n if (from < 0) return;\n const next = current.slice();\n next.splice(from, 1);\n const resolved = resolveSlot(next, slot);\n const to = resolved === undefined ? next.length : Math.max(0, Math.min(resolved, next.length));\n if (from === to) return;\n next.splice(to, 0, id);\n a.setChildOrder(parentId, next);\n}\n\n/** Present when the caller named a destination at all; `undefined` leaves\n * placement to the adapter. */\nfunction optionalSlot(slot: Slot | undefined, index: number | undefined): Slot | undefined {\n if (slot) return slot;\n return index === undefined ? undefined : slotFromIndex(index);\n}\n\n/**\n * Op: change `id`'s parent and sibling slot, inverting back to the prior\n * parent and slot.\n *\n * `coalesceKey` defaults to `reparent:${id}` so successive reparents of the\n * same id batch-merge cleanly.\n */\nexport function createReparentOp(args: ReparentArgs): Op {\n const {\n id, fromParentId, toParentId,\n label = 'Reparent', coalesceKey = `reparent:${id}`,\n } = args;\n let fromSlot = optionalSlot(args.fromSlot, args.fromIndex);\n const toSlot = optionalSlot(args.toSlot, args.toIndex);\n const argsForSerial: ReparentArgs = {\n id, fromParentId, toParentId, fromSlot, toSlot, label, coalesceKey,\n };\n return {\n name: 'reparent',\n args: argsForSerial,\n label,\n coalesceKey,\n apply(adapter) {\n const a = adapter as ReparentAdapter;\n const observed = captureSlot(a, fromParentId, id);\n if (observed) {\n fromSlot = observed;\n argsForSerial.fromSlot = observed;\n }\n a.setParent(id, toParentId);\n if (toSlot) placeAt(a, toParentId, id, toSlot);\n },\n invert() {\n return createReparentOp({\n id,\n fromParentId: toParentId,\n toParentId: fromParentId,\n fromSlot: toSlot,\n toSlot: fromSlot,\n label,\n coalesceKey,\n });\n },\n };\n}\n\nregisterOpFactory<ReparentArgs>('reparent', (args) => createReparentOp(args));\n","import type { MoveBehavior, ModifierState, SnapStrategy } from '../types';\nimport {\n RECT_ORIGIN_PROJECTION,\n type OriginProjection,\n} from './strategies/grid';\n\ntype ModKey = keyof ModifierState;\n\n/**\n * Generic snap behavior factory: wraps a `SnapStrategy` and returns a\n * `MoveBehavior` whose `onMove` returns a uniform `GroupTransform`.\n *\n * Implementation:\n * 1. Compute the primary's proposed pose by applying the gesture's\n * `transform` (translate) to `origin.get(primaryId)`.\n * 2. Call `strategy.snap(proposed)`. If null, no-op.\n * 3. Derive the snapped delta via the `OriginProjection`:\n * dx = origin(snapped).x - origin(originPose).x\n * ...so the gesture applies the same delta to every dragged id.\n *\n * The pose-shape-aware delta extraction lives here — gestures stay pose-shape\n * agnostic. Default projection is `{x, y}`-bearing (rect / path / polygon).\n * Pass `origin` for exotic poses.\n */\nexport function snap<TPose>(\n strategy: SnapStrategy<TPose>,\n opts: { bypassKey?: ModKey; origin?: OriginProjection<TPose> } = {},\n): MoveBehavior<TPose> {\n const { bypassKey } = opts;\n const proj: OriginProjection<TPose> = opts.origin\n ?? (RECT_ORIGIN_PROJECTION as unknown as OriginProjection<TPose>);\n return {\n onMove(ctx, transform) {\n if (bypassKey && ctx.modifiers[bypassKey]) return;\n // The new contract: behaviors see a GroupTransform, not a pose. But\n // strategies still operate on poses. Reconstruct the proposed pose\n // by applying the (translate) transform to the primary's origin.\n if (transform.kind !== 'translate') return;\n const primaryId = ctx.draggedIds[0];\n if (primaryId === undefined) return;\n const originPose = ctx.origin.get(primaryId);\n if (originPose === undefined) return;\n const proposed = proj.translate(originPose, transform.dx, transform.dy);\n const snapped = strategy.snap(proposed, ctx);\n if (snapped === null) return;\n const o0 = proj.getOrigin(originPose);\n const o1 = proj.getOrigin(snapped);\n return {\n transform: { kind: 'translate', dx: o1.x - o0.x, dy: o1.y - o0.y },\n };\n },\n };\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { DEFAULT_GUIDE_TOLERANCE_PX, pxExtent } from './chunk-UCPV7JXC.js';
1
+ import { DEFAULT_GUIDE_TOLERANCE_PX, pxExtent } from './chunk-HAGOFNP5.js';
2
2
 
3
3
  // src/interactions/actions/resize/behaviors/clampMinSize.ts
4
4
  function clampMinSize(args) {
@@ -244,5 +244,5 @@ function fixedCornerOf(bounds, anchor) {
244
244
  }
245
245
 
246
246
  export { CORNER_ANCHORS, DEFAULT_RESIZE_BEHAVIORS, clampMinSize, cornerPoint, cornerResizeHandles, fixedCornerOf, hitCornerHandle, lockAspectWithModifier, pointSnapToGrid, snapToGrid, snapToGuides };
247
- //# sourceMappingURL=chunk-MQI4PIX3.js.map
248
- //# sourceMappingURL=chunk-MQI4PIX3.js.map
247
+ //# sourceMappingURL=chunk-XXQ6FLCJ.js.map
248
+ //# sourceMappingURL=chunk-XXQ6FLCJ.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interactions/actions/resize/behaviors/clampMinSize.ts","../src/interactions/actions/resize/behaviors/lockAspect.ts","../src/interactions/actions/resize/behaviors/snapToGrid.ts","../src/interactions/actions/resize/behaviors/snapToGuides.ts","../src/interactions/actions/resize/behaviors/pointSnapToGrid.ts","../src/interactions/actions/resize/behaviors/index.ts","../src/interactions/actions/resize/cornerHandles.ts"],"names":[],"mappings":";;;AAMO,SAAS,aAAmC,IAAA,EAGvB;AAC1B,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,IAAA;AAChC,EAAA,OAAO;AAAA,IACL,MAAA,CAAO,IAAA,EAAM,EAAE,IAAA,EAAM,QAAO,EAAG;AAC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AA,CAAO;AAAA,GAC5D;AACF","file":"chunk-MQI4PIX3.js","sourcesContent":["import type { BoundsConstraint } from '../../../gestures/types';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\n\n/** Resize constraint that stops a node shrinking past a minimum. The anchored\n * edge stays put, so clamping pushes the dragged edge back rather than moving\n * the node. */\nexport function clampMinSize<TPose extends Bounds>(args: {\n minWidth: number;\n minHeight: number;\n}): BoundsConstraint<TPose> {\n const { minWidth, minHeight } = args;\n return {\n onMove(_ctx, { pose, anchor }) {\n let { x, y, width, height } = pose;\n let changed = false;\n if (anchor.x !== 'free' && width < minWidth) {\n if (anchor.x === 'min') {\n // West edge is anchor; east edge was dragged. Hold x; widen to min.\n width = minWidth;\n } else {\n // East edge is anchor at originalRight = x + width. Hold the right;\n // shift x left so width = minWidth.\n const right = x + width;\n x = right - minWidth;\n width = minWidth;\n }\n changed = true;\n }\n if (anchor.y !== 'free' && height < minHeight) {\n if (anchor.y === 'min') {\n height = minHeight;\n } else {\n const bottom = y + height;\n y = bottom - minHeight;\n height = minHeight;\n }\n changed = true;\n }\n if (!changed) return;\n return { pose: { ...pose, x, y, width, height } };\n },\n };\n}\n","import type {\n ModifierState,\n BoundsConstraint,\n} from '../../../gestures/types';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\n\ntype ModKey = keyof ModifierState;\n\n/** Aspect-ratio lock: drag a corner/edge with `key` (default `'shift'`) held\n * to keep the resized bounds at the start-pose's `width / height` ratio.\n *\n * Strategy:\n * - Compute the proposed deltas in width and height (signed, relative to\n * origin). Whichever axis has the larger absolute delta \"wins\"; the other\n * is recomputed from `(originW / originH) * winnerDelta`.\n * - The opposite corner/edge stays anchored — for the corner case we infer\n * the anchor from the proposed bounds; for an edge handle we resize the\n * orthogonal axis symmetrically around the dragged edge's anchor (the\n * handle's own line stays put, the orthogonal axis grows/shrinks centered\n * on the un-dragged edge — see notes below).\n * - No-op when the modifier is not held, when the origin has zero width or\n * height (no defined ratio), or when the proposed pose hasn't moved.\n *\n * Edge-handle handling: with `anchor.x !== 'free' && anchor.y === 'free'`\n * (an `e` or `w` handle), only the width was driven by the pointer. We pick\n * the new height as `width / ratio` and pin it to the un-dragged y axis by\n * anchoring at the origin's top edge (`y` stays at `origin.y`). Symmetric\n * for `n` / `s`.\n */\nexport function lockAspectWithModifier<TPose extends Bounds>(opts: {\n key?: ModKey;\n} = {}): BoundsConstraint<TPose> {\n const { key = 'shift' } = opts;\n\n return {\n onMove(ctx, { pose, anchor }) {\n if (!ctx.modifiers[key]) return;\n const origin = ctx.origin.get(ctx.draggedIds[0]) as Bounds | undefined;\n if (!origin) return;\n if (origin.width === 0 || origin.height === 0) return;\n const ratio = origin.width / origin.height; // w / h\n\n // Signed deltas relative to origin. Negative deltas mean the user has\n // dragged through the anchor and flipped the rect; we preserve sign on\n // the recomputed axis so the flipped quadrant stays consistent.\n const dw = pose.width - origin.width;\n const dh = pose.height - origin.height;\n\n let nw: number;\n let nh: number;\n\n if (anchor.x === 'free' && anchor.y === 'free') {\n // No driven axis — nothing to lock against.\n return;\n } else if (anchor.x === 'free') {\n // Edge handle: n or s. height is driven; width follows.\n nh = pose.height;\n nw = nh * ratio;\n // sign-preserve width if the original height delta caused a flip.\n // (height-driven only; width direction follows ratio absolutely.)\n if (nw < 0) nw = -nw;\n } else if (anchor.y === 'free') {\n // Edge handle: e or w. width is driven; height follows.\n nw = pose.width;\n nh = nw / ratio;\n if (nh < 0) nh = -nh;\n } else {\n // Corner handle. Pick the dominant axis by absolute delta.\n if (Math.abs(dw) >= Math.abs(dh)) {\n nw = pose.width;\n // Match height sign to width sign so the rect stays in the same\n // quadrant the pointer chose.\n nh = (Math.abs(nw) / ratio) * Math.sign(pose.height || 1);\n } else {\n nh = pose.height;\n nw = (Math.abs(nh) * ratio) * Math.sign(pose.width || 1);\n }\n }\n\n // Recompute x/y from the anchor (the un-dragged edge stays pinned).\n let nx = pose.x;\n let ny = pose.y;\n if (anchor.x === 'min') {\n // West edge anchored at origin.x.\n nx = origin.x;\n } else if (anchor.x === 'max') {\n // East edge anchored at origin.x + origin.width.\n nx = origin.x + origin.width - nw;\n } else {\n // Edge handle (n/s): width grew/shrunk via ratio. Center horizontally\n // about the origin's center so the rect stays visually centered on\n // the dragged edge's midline.\n nx = origin.x + origin.width / 2 - nw / 2;\n }\n if (anchor.y === 'min') {\n ny = origin.y;\n } else if (anchor.y === 'max') {\n ny = origin.y + origin.height - nh;\n } else {\n ny = origin.y + origin.height / 2 - nh / 2;\n }\n\n return {\n pose: { ...pose, x: nx, y: ny, width: nw, height: nh },\n };\n },\n };\n}\n","import type {\n ModifierState,\n BoundsConstraint,\n} from '../../../gestures/types';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\n\ntype ModKey = keyof ModifierState;\n\n/** Resize constraint that snaps the moving edges to a grid, leaving the\n * anchored ones where they are. By default a node already smaller than one\n * grid cell on an axis is left unsnapped on that axis, so it stays resizable\n * at sub-grid sizes. */\nexport function snapToGrid<TPose extends Bounds>(args: {\n spacing: number;\n bypassKey?: ModKey;\n suspendBelowDim?: boolean;\n}): BoundsConstraint<TPose> {\n const { spacing, bypassKey, suspendBelowDim = true } = args;\n const round = (v: number) => Math.round(v / spacing) * spacing;\n\n return {\n onMove(ctx, { pose, anchor }) {\n if (bypassKey && ctx.modifiers[bypassKey]) return;\n const origin = ctx.origin.get(ctx.draggedIds[0])!;\n const subX = suspendBelowDim && origin.width < spacing;\n const subY = suspendBelowDim && origin.height < spacing;\n\n let { x, y, width, height } = pose;\n let changed = false;\n\n if (anchor.x !== 'free' && !subX) {\n if (anchor.x === 'min') {\n // East edge moves; west (x) stays.\n const east = round(x + width);\n width = east - x;\n } else {\n // West edge moves; east (x+width) stays.\n const right = origin.x + origin.width;\n const newX = round(x);\n width = right - newX;\n x = newX;\n }\n changed = true;\n }\n if (anchor.y !== 'free' && !subY) {\n if (anchor.y === 'min') {\n const south = round(y + height);\n height = south - y;\n } else {\n const bottom = origin.y + origin.height;\n const newY = round(y);\n height = bottom - newY;\n y = newY;\n }\n changed = true;\n }\n if (!changed) return;\n return { pose: { ...pose, x, y, width, height } };\n },\n };\n}\n","import type {\n ModifierState,\n BoundsConstraint,\n} from '../../../gestures/types';\nimport type { Guide } from 'features/guides/types';\nimport type { View } from 'core/viewport/view';\nimport { pxExtent } from 'core/viewport/pxExtent';\nimport { DEFAULT_GUIDE_TOLERANCE_PX } from '../../../gestures/shared/strategies/guides';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\n\ntype ModKey = keyof ModifierState;\n\n/** Options for the resize-flavored `snapToGuides`. */\nexport interface SnapToGuidesResizeArgs {\n /** Stable getter into the live guide list (typically from `useGuides`). */\n getGuides: () => readonly Guide[];\n /** Snap tolerance (screen px when `getView` is set, world units otherwise). */\n tolerance?: number;\n /** Read the active view; required for screen-pixel tolerance. */\n getView?: () => View;\n /** Modifier key that bypasses snapping while held. */\n bypassKey?: ModKey;\n}\n\n/**\n * Resize behavior that snaps the active edge of the dragged rect to the\n * nearest guide on the corresponding axis when within `tolerance`. The\n * \"free\" axis is left untouched. The fixed (anchor) edge stays pinned;\n * only the moving edge snaps.\n *\n * On the X axis, vertical guides (`axis: 'x'`) constrain the moving vertical\n * edge — east when `anchor.x === 'min'` (west pinned), west when `'max'`.\n * Likewise on Y for horizontal guides.\n */\nexport function snapToGuides<TPose extends Bounds>(\n args: SnapToGuidesResizeArgs,\n): BoundsConstraint<TPose> {\n const tolerance = args.tolerance ?? DEFAULT_GUIDE_TOLERANCE_PX;\n const getView = args.getView;\n const bypassKey = args.bypassKey;\n\n return {\n onMove(ctx, { pose, anchor }) {\n if (bypassKey && ctx.modifiers[bypassKey]) return;\n const guides = args.getGuides();\n if (guides.length === 0) return;\n\n // Per axis: a vertical guide is matched by a horizontal distance, so it\n // answers to `scale.x` alone.\n const tol = getView ? pxExtent(tolerance, getView().scale) : { x: tolerance, y: tolerance };\n\n let { x, y, width, height } = pose;\n let changed = false;\n\n // X-axis: snap the moving vertical edge to the nearest 'x' guide.\n if (anchor.x !== 'free') {\n const movingX = anchor.x === 'min' ? x + width : x;\n let bestD = 0;\n let bestAbs = Infinity;\n for (const g of guides) {\n if (g.axis !== 'x') continue;\n const d = g.offset - movingX;\n const ad = Math.abs(d);\n if (ad <= tol.x && ad < bestAbs) {\n bestAbs = ad;\n bestD = d;\n }\n }\n if (bestAbs !== Infinity && bestD !== 0) {\n if (anchor.x === 'min') {\n // East edge moves; west (x) stays.\n width = width + bestD;\n } else {\n // West edge moves; east (x+width) stays.\n x = x + bestD;\n width = width - bestD;\n }\n changed = true;\n }\n }\n\n // Y-axis: snap the moving horizontal edge to the nearest 'y' guide.\n if (anchor.y !== 'free') {\n const movingY = anchor.y === 'min' ? y + height : y;\n let bestD = 0;\n let bestAbs = Infinity;\n for (const g of guides) {\n if (g.axis !== 'y') continue;\n const d = g.offset - movingY;\n const ad = Math.abs(d);\n if (ad <= tol.y && ad < bestAbs) {\n bestAbs = ad;\n bestD = d;\n }\n }\n if (bestAbs !== Infinity && bestD !== 0) {\n if (anchor.y === 'min') {\n height = height + bestD;\n } else {\n y = y + bestD;\n height = height - bestD;\n }\n changed = true;\n }\n }\n\n if (!changed) return;\n return { pose: { ...pose, x, y, width, height } };\n },\n };\n}\n","import type {\n ModifierState,\n PointSnapBehavior,\n PointSnapContext,\n PointSnapFrame,\n PointSnapResult,\n} from '../../../gestures/types';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\n\n/** Resize behavior that snaps one reference point of the resize — the dragged\n * corner, the fixed corner, or the center, per `frame` — to a grid, moving\n * the whole pose by the same delta. Unlike the bounds-level `snapToGrid`,\n * this preserves the node's dimensions. */\nexport function pointSnapToGrid<TPose extends Bounds>(args: {\n spacing: number;\n frame?: PointSnapFrame;\n bypassKey?: keyof ModifierState;\n}): PointSnapBehavior<TPose> {\n const { spacing, frame = 'dragged-corner', bypassKey } = args;\n const round = (v: number) => Math.round(v / spacing) * spacing;\n\n return {\n id: `pointSnapToGrid:${frame}`,\n onMove(ctx: PointSnapContext<TPose>): PointSnapResult | null {\n if (bypassKey && ctx.modifiers[bypassKey]) return null;\n const src =\n frame === 'dragged-corner' ? ctx.draggedCorner :\n frame === 'fixed-corner' ? ctx.fixedCorner :\n frame === 'center' ? ctx.center :\n ctx.origin;\n if (!src) return null;\n return { frame, worldX: round(src.worldX), worldY: round(src.worldY) };\n },\n };\n}\n","export { clampMinSize } from './clampMinSize';\nexport { lockAspectWithModifier } from './lockAspect';\nexport { snapToGrid } from './snapToGrid';\n\nimport type { BoundsConstraint } from '../../../gestures/types';\nimport { lockAspectWithModifier } from './lockAspect';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\n\n/** The kit's standard resize behaviors, applied when a consumer doesn't\n * supply its own list: shift-drag locks the start pose's aspect ratio.\n * Pass an explicit `behaviors: []` to opt out. Stateless, so one shared\n * frozen instance is safe across every gesture. */\nexport const DEFAULT_RESIZE_BEHAVIORS: readonly BoundsConstraint<Bounds>[] =\n Object.freeze([lockAspectWithModifier()]);\nexport { snapToGuides } from './snapToGuides';\nexport { pointSnapToGrid } from './pointSnapToGrid';\n","import type { ResizeAnchor } from '../../gestures/types';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\n\n/** Corner resize-handle: world-space center plus the anchor that pins the opposite corner during resize. */\nexport interface CornerHandle {\n cx: number;\n cy: number;\n anchor: ResizeAnchor;\n}\n\n/** Which AABB edge a corner sits on, per axis. `'min'` = the x/y origin\n * edge; `'max'` = the origin + extent edge. */\nexport type CornerEdge = 'min' | 'max';\n\n/** One entry of the canonical 4-corner resize layout. The single source of\n * truth for \"which corner maps to which anchor / handle-kind\". */\nexport interface CornerAnchor {\n /** Which x-edge the corner sits on (`'min'` = left, `'max'` = right). */\n xEdge: CornerEdge;\n /** Which y-edge the corner sits on (`'min'` = top, `'max'` = bottom). */\n yEdge: CornerEdge;\n /** Anchor that pins the diagonally-opposite (fixed) corner. Always the\n * axis-wise opposite of `{xEdge, yEdge}`. */\n anchor: ResizeAnchor;\n /** Affordance/handle discriminator string for this corner. */\n kind: string;\n /** Short positional tag (`'<xEdge>-<yEdge>'`), e.g. `'min-max'`. */\n tag: string;\n}\n\n/**\n * The single ordered corner→anchor table. Order is **load-bearing**: every\n * consumer iterates it in this sequence (TL, TR, BL, BR) so positional\n * meaning (the i-th handle / `kind` / `tag`) stays consistent across the\n * resize-handle affordance, the affordance-hit classifier, and\n * `cornerResizeHandles`. Each corner's `anchor` names the diagonally\n * opposite corner, so dragging the corner scales the box from that fixed\n * point.\n */\nexport const CORNER_ANCHORS: readonly CornerAnchor[] = [\n { xEdge: 'min', yEdge: 'min', anchor: { x: 'max', y: 'max' }, kind: 'handle:top-left', tag: 'min-min' },\n { xEdge: 'max', yEdge: 'min', anchor: { x: 'min', y: 'max' }, kind: 'handle:top-right', tag: 'max-min' },\n { xEdge: 'min', yEdge: 'max', anchor: { x: 'max', y: 'min' }, kind: 'handle:bottom-left', tag: 'min-max' },\n { xEdge: 'max', yEdge: 'max', anchor: { x: 'min', y: 'min' }, kind: 'handle:bottom-right', tag: 'max-max' },\n];\n\n/** Resolve a corner's world-space position for the given bounds. `xEdge`\n * `'max'` → `x + width`; `yEdge` `'max'` → `y + height`. */\nexport function cornerPoint(\n bounds: Bounds,\n entry: Pick<CornerAnchor, 'xEdge' | 'yEdge'>,\n): { x: number; y: number } {\n return {\n x: entry.xEdge === 'max' ? bounds.x + bounds.width : bounds.x,\n y: entry.yEdge === 'max' ? bounds.y + bounds.height : bounds.y,\n };\n}\n\n/** Standard 4-corner resize-handle layout: each corner pins the opposite\n * corner via an anchor of `{x: 'min'|'max', y: 'min'|'max'}` so dragging it\n * scales the box from the fixed opposite corner. Decodes {@link CORNER_ANCHORS}\n * against `bounds`. */\nexport function cornerResizeHandles(bounds: Bounds): CornerHandle[] {\n return CORNER_ANCHORS.map((c) => {\n const p = cornerPoint(bounds, c);\n return { cx: p.x, cy: p.y, anchor: c.anchor };\n });\n}\n\n/** Square hit-test for a handle: returns true if `(px, py)` is within\n * `radius` of the handle center on both axes. */\nexport function hitCornerHandle(\n handle: CornerHandle,\n px: number,\n py: number,\n radius: number,\n): boolean {\n return Math.abs(px - handle.cx) <= radius\n && Math.abs(py - handle.cy) <= radius;\n}\n\n/** The corner that does NOT move under a resize gesture with the given\n * anchor. Used by the rotated-resize math to pin a world-space invariant.\n *\n * Convention: `anchor.x === 'min'` means the min-x (left) edge is the\n * fixed anchor, so the fixed corner sits at `x = bounds.x` (min-x).\n * `anchor.x === 'max'` means the max-x (right) edge is fixed, so the\n * fixed corner sits at `x = bounds.x + bounds.width`. `'free'` on an\n * axis means that axis doesn't move; the fixed coord is the bounds\n * origin on that axis. */\nexport function fixedCornerOf(\n bounds: Bounds,\n anchor: ResizeAnchor,\n): { x: number; y: number } {\n return {\n x: anchor.x === 'max' ? bounds.x + bounds.width : bounds.x,\n y: anchor.y === 'max' ? bounds.y + bounds.height : bounds.y,\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/interactions/actions/resize/behaviors/clampMinSize.ts","../src/interactions/actions/resize/behaviors/lockAspect.ts","../src/interactions/actions/resize/behaviors/snapToGrid.ts","../src/interactions/actions/resize/behaviors/snapToGuides.ts","../src/interactions/actions/resize/behaviors/pointSnapToGrid.ts","../src/interactions/actions/resize/behaviors/index.ts","../src/interactions/actions/resize/cornerHandles.ts"],"names":[],"mappings":";;;AAMO,SAAS,aAAmC,IAAA,EAGvB;AAC1B,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,IAAA;AAChC,EAAA,OAAO;AAAA,IACL,MAAA,CAAO,IAAA,EAAM,EAAE,IAAA,EAAM,QAAO,EAAG;AAC7B,MAAA,IAAI,EAAE,CAAA,EAAG,CAAA,EAAG,KAAA,EAAO,QAAO,GAAI,IAAA;AAC9B,MAAA,IAAI,OAAA,GAAU,KAAA;AACd,MAAA,IAAI,MAAA,CAAO,CAAA,KAAM,MAAA,IAAU,KAAA,GAAQ,QAAA,EAAU;AAC3C,QAAA,IAAI,MAAA,CAAO,MAAM,KA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Q,OAAO,CAAA,GAAI,MAAA,CAAO,QAAQ,MAAA,CAAO,CAAA;AAAA,IAC5D,CAAA,EAAG,MAAM,KAAA,KAAU,KAAA,GAAQ,OAAO,CAAA,GAAI,MAAA,CAAO,SAAS,MAAA,CAAO;AAAA,GAC/D;AACF;AAMO,SAAS,oBAAoB,MAAA,EAAgC;AAClE,EAAA,OAAO,cAAA,CAAe,GAAA,CAAI,CAAC,CAAA,KAAM;AAC/B,IAAA,MAAM,CAAA,GAAI,WAAA,CAAY,MAAA,EAAQ,CAAC,CAAA;AAC/B,IAAA,OAAO,EAAE,IAAI,CAAA,CAAE,CAAA,EAAG,IAAI,CAAA,CAAE,CAAA,EAAG,MAAA,EAAQ,CAAA,CAAE,MAAA,EAAO;AAAA,EAC9C,CAAC,CAAA;AACH;AAIO,SAAS,eAAA,CACd,MAAA,EACA,EAAA,EACA,EAAA,EACA,MAAA,EACS;AACT,EAAA,OAAO,IAAA,CAAK,GAAA,CAAI,EAAA,GAAK,MAAA,CAAO,EAAE,CAAA,IAAK,MAAA,IAC9B,IAAA,CAAK,GAAA,CAAI,EAAA,GAAK,MAAA,CAAO,EAAE,CAAA,IAAK,MAAA;AACnC;AAWO,SAAS,aAAA,CACd,QACA,MAAA,EAC0B;AAC1B,EAAA,OAAO;AAAA,IACL,CAAA,EAAG,OAAO,CAAA,KAAM,KAAA,GAAQ,OAAO,CAAA,GAAI,MAAA,CAAO,QAAQ,MAAA,CAAO,CAAA;AAAA,IACzD,CAAA,EAAG,OAAO,CAAA,KAAM,KAAA,GAAQ,OAAO,CAAA,GAAI,MAAA,CAAO,SAAS,MAAA,CAAO;AAAA,GAC5D;AACF","file":"chunk-XXQ6FLCJ.js","sourcesContent":["import type { BoundsConstraint } from '../../../gestures/types';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\n\n/** Resize constraint that stops a node shrinking past a minimum. The anchored\n * edge stays put, so clamping pushes the dragged edge back rather than moving\n * the node. */\nexport function clampMinSize<TPose extends Bounds>(args: {\n minWidth: number;\n minHeight: number;\n}): BoundsConstraint<TPose> {\n const { minWidth, minHeight } = args;\n return {\n onMove(_ctx, { pose, anchor }) {\n let { x, y, width, height } = pose;\n let changed = false;\n if (anchor.x !== 'free' && width < minWidth) {\n if (anchor.x === 'min') {\n // West edge is anchor; east edge was dragged. Hold x; widen to min.\n width = minWidth;\n } else {\n // East edge is anchor at originalRight = x + width. Hold the right;\n // shift x left so width = minWidth.\n const right = x + width;\n x = right - minWidth;\n width = minWidth;\n }\n changed = true;\n }\n if (anchor.y !== 'free' && height < minHeight) {\n if (anchor.y === 'min') {\n height = minHeight;\n } else {\n const bottom = y + height;\n y = bottom - minHeight;\n height = minHeight;\n }\n changed = true;\n }\n if (!changed) return;\n return { pose: { ...pose, x, y, width, height } };\n },\n };\n}\n","import type {\n ModifierState,\n BoundsConstraint,\n} from '../../../gestures/types';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\n\ntype ModKey = keyof ModifierState;\n\n/** Aspect-ratio lock: drag a corner/edge with `key` (default `'shift'`) held\n * to keep the resized bounds at the start-pose's `width / height` ratio.\n *\n * Strategy:\n * - Compute the proposed deltas in width and height (signed, relative to\n * origin). Whichever axis has the larger absolute delta \"wins\"; the other\n * is recomputed from `(originW / originH) * winnerDelta`.\n * - The opposite corner/edge stays anchored — for the corner case we infer\n * the anchor from the proposed bounds; for an edge handle we resize the\n * orthogonal axis symmetrically around the dragged edge's anchor (the\n * handle's own line stays put, the orthogonal axis grows/shrinks centered\n * on the un-dragged edge — see notes below).\n * - No-op when the modifier is not held, when the origin has zero width or\n * height (no defined ratio), or when the proposed pose hasn't moved.\n *\n * Edge-handle handling: with `anchor.x !== 'free' && anchor.y === 'free'`\n * (an `e` or `w` handle), only the width was driven by the pointer. We pick\n * the new height as `width / ratio` and pin it to the un-dragged y axis by\n * anchoring at the origin's top edge (`y` stays at `origin.y`). Symmetric\n * for `n` / `s`.\n */\nexport function lockAspectWithModifier<TPose extends Bounds>(opts: {\n key?: ModKey;\n} = {}): BoundsConstraint<TPose> {\n const { key = 'shift' } = opts;\n\n return {\n onMove(ctx, { pose, anchor }) {\n if (!ctx.modifiers[key]) return;\n const origin = ctx.origin.get(ctx.draggedIds[0]) as Bounds | undefined;\n if (!origin) return;\n if (origin.width === 0 || origin.height === 0) return;\n const ratio = origin.width / origin.height; // w / h\n\n // Signed deltas relative to origin. Negative deltas mean the user has\n // dragged through the anchor and flipped the rect; we preserve sign on\n // the recomputed axis so the flipped quadrant stays consistent.\n const dw = pose.width - origin.width;\n const dh = pose.height - origin.height;\n\n let nw: number;\n let nh: number;\n\n if (anchor.x === 'free' && anchor.y === 'free') {\n // No driven axis — nothing to lock against.\n return;\n } else if (anchor.x === 'free') {\n // Edge handle: n or s. height is driven; width follows.\n nh = pose.height;\n nw = nh * ratio;\n // sign-preserve width if the original height delta caused a flip.\n // (height-driven only; width direction follows ratio absolutely.)\n if (nw < 0) nw = -nw;\n } else if (anchor.y === 'free') {\n // Edge handle: e or w. width is driven; height follows.\n nw = pose.width;\n nh = nw / ratio;\n if (nh < 0) nh = -nh;\n } else {\n // Corner handle. Pick the dominant axis by absolute delta.\n if (Math.abs(dw) >= Math.abs(dh)) {\n nw = pose.width;\n // Match height sign to width sign so the rect stays in the same\n // quadrant the pointer chose.\n nh = (Math.abs(nw) / ratio) * Math.sign(pose.height || 1);\n } else {\n nh = pose.height;\n nw = (Math.abs(nh) * ratio) * Math.sign(pose.width || 1);\n }\n }\n\n // Recompute x/y from the anchor (the un-dragged edge stays pinned).\n let nx = pose.x;\n let ny = pose.y;\n if (anchor.x === 'min') {\n // West edge anchored at origin.x.\n nx = origin.x;\n } else if (anchor.x === 'max') {\n // East edge anchored at origin.x + origin.width.\n nx = origin.x + origin.width - nw;\n } else {\n // Edge handle (n/s): width grew/shrunk via ratio. Center horizontally\n // about the origin's center so the rect stays visually centered on\n // the dragged edge's midline.\n nx = origin.x + origin.width / 2 - nw / 2;\n }\n if (anchor.y === 'min') {\n ny = origin.y;\n } else if (anchor.y === 'max') {\n ny = origin.y + origin.height - nh;\n } else {\n ny = origin.y + origin.height / 2 - nh / 2;\n }\n\n return {\n pose: { ...pose, x: nx, y: ny, width: nw, height: nh },\n };\n },\n };\n}\n","import type {\n ModifierState,\n BoundsConstraint,\n} from '../../../gestures/types';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\n\ntype ModKey = keyof ModifierState;\n\n/** Resize constraint that snaps the moving edges to a grid, leaving the\n * anchored ones where they are. By default a node already smaller than one\n * grid cell on an axis is left unsnapped on that axis, so it stays resizable\n * at sub-grid sizes. */\nexport function snapToGrid<TPose extends Bounds>(args: {\n spacing: number;\n bypassKey?: ModKey;\n suspendBelowDim?: boolean;\n}): BoundsConstraint<TPose> {\n const { spacing, bypassKey, suspendBelowDim = true } = args;\n const round = (v: number) => Math.round(v / spacing) * spacing;\n\n return {\n onMove(ctx, { pose, anchor }) {\n if (bypassKey && ctx.modifiers[bypassKey]) return;\n const origin = ctx.origin.get(ctx.draggedIds[0])!;\n const subX = suspendBelowDim && origin.width < spacing;\n const subY = suspendBelowDim && origin.height < spacing;\n\n let { x, y, width, height } = pose;\n let changed = false;\n\n if (anchor.x !== 'free' && !subX) {\n if (anchor.x === 'min') {\n // East edge moves; west (x) stays.\n const east = round(x + width);\n width = east - x;\n } else {\n // West edge moves; east (x+width) stays.\n const right = origin.x + origin.width;\n const newX = round(x);\n width = right - newX;\n x = newX;\n }\n changed = true;\n }\n if (anchor.y !== 'free' && !subY) {\n if (anchor.y === 'min') {\n const south = round(y + height);\n height = south - y;\n } else {\n const bottom = origin.y + origin.height;\n const newY = round(y);\n height = bottom - newY;\n y = newY;\n }\n changed = true;\n }\n if (!changed) return;\n return { pose: { ...pose, x, y, width, height } };\n },\n };\n}\n","import type {\n ModifierState,\n BoundsConstraint,\n} from '../../../gestures/types';\nimport type { Guide } from 'features/guides/types';\nimport type { View } from 'core/viewport/view';\nimport { pxExtent } from 'core/viewport/pxExtent';\nimport { DEFAULT_GUIDE_TOLERANCE_PX } from '../../../gestures/shared/strategies/guides';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\n\ntype ModKey = keyof ModifierState;\n\n/** Options for the resize-flavored `snapToGuides`. */\nexport interface SnapToGuidesResizeArgs {\n /** Stable getter into the live guide list (typically from `useGuides`). */\n getGuides: () => readonly Guide[];\n /** Snap tolerance (screen px when `getView` is set, world units otherwise). */\n tolerance?: number;\n /** Read the active view; required for screen-pixel tolerance. */\n getView?: () => View;\n /** Modifier key that bypasses snapping while held. */\n bypassKey?: ModKey;\n}\n\n/**\n * Resize behavior that snaps the active edge of the dragged rect to the\n * nearest guide on the corresponding axis when within `tolerance`. The\n * \"free\" axis is left untouched. The fixed (anchor) edge stays pinned;\n * only the moving edge snaps.\n *\n * On the X axis, vertical guides (`axis: 'x'`) constrain the moving vertical\n * edge — east when `anchor.x === 'min'` (west pinned), west when `'max'`.\n * Likewise on Y for horizontal guides.\n */\nexport function snapToGuides<TPose extends Bounds>(\n args: SnapToGuidesResizeArgs,\n): BoundsConstraint<TPose> {\n const tolerance = args.tolerance ?? DEFAULT_GUIDE_TOLERANCE_PX;\n const getView = args.getView;\n const bypassKey = args.bypassKey;\n\n return {\n onMove(ctx, { pose, anchor }) {\n if (bypassKey && ctx.modifiers[bypassKey]) return;\n const guides = args.getGuides();\n if (guides.length === 0) return;\n\n // Per axis: a vertical guide is matched by a horizontal distance, so it\n // answers to `scale.x` alone.\n const tol = getView ? pxExtent(tolerance, getView().scale) : { x: tolerance, y: tolerance };\n\n let { x, y, width, height } = pose;\n let changed = false;\n\n // X-axis: snap the moving vertical edge to the nearest 'x' guide.\n if (anchor.x !== 'free') {\n const movingX = anchor.x === 'min' ? x + width : x;\n let bestD = 0;\n let bestAbs = Infinity;\n for (const g of guides) {\n if (g.axis !== 'x') continue;\n const d = g.offset - movingX;\n const ad = Math.abs(d);\n if (ad <= tol.x && ad < bestAbs) {\n bestAbs = ad;\n bestD = d;\n }\n }\n if (bestAbs !== Infinity && bestD !== 0) {\n if (anchor.x === 'min') {\n // East edge moves; west (x) stays.\n width = width + bestD;\n } else {\n // West edge moves; east (x+width) stays.\n x = x + bestD;\n width = width - bestD;\n }\n changed = true;\n }\n }\n\n // Y-axis: snap the moving horizontal edge to the nearest 'y' guide.\n if (anchor.y !== 'free') {\n const movingY = anchor.y === 'min' ? y + height : y;\n let bestD = 0;\n let bestAbs = Infinity;\n for (const g of guides) {\n if (g.axis !== 'y') continue;\n const d = g.offset - movingY;\n const ad = Math.abs(d);\n if (ad <= tol.y && ad < bestAbs) {\n bestAbs = ad;\n bestD = d;\n }\n }\n if (bestAbs !== Infinity && bestD !== 0) {\n if (anchor.y === 'min') {\n height = height + bestD;\n } else {\n y = y + bestD;\n height = height - bestD;\n }\n changed = true;\n }\n }\n\n if (!changed) return;\n return { pose: { ...pose, x, y, width, height } };\n },\n };\n}\n","import type {\n ModifierState,\n PointSnapBehavior,\n PointSnapContext,\n PointSnapFrame,\n PointSnapResult,\n} from '../../../gestures/types';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\n\n/** Resize behavior that snaps one reference point of the resize — the dragged\n * corner, the fixed corner, or the center, per `frame` — to a grid, moving\n * the whole pose by the same delta. Unlike the bounds-level `snapToGrid`,\n * this preserves the node's dimensions. */\nexport function pointSnapToGrid<TPose extends Bounds>(args: {\n spacing: number;\n frame?: PointSnapFrame;\n bypassKey?: keyof ModifierState;\n}): PointSnapBehavior<TPose> {\n const { spacing, frame = 'dragged-corner', bypassKey } = args;\n const round = (v: number) => Math.round(v / spacing) * spacing;\n\n return {\n id: `pointSnapToGrid:${frame}`,\n onMove(ctx: PointSnapContext<TPose>): PointSnapResult | null {\n if (bypassKey && ctx.modifiers[bypassKey]) return null;\n const src =\n frame === 'dragged-corner' ? ctx.draggedCorner :\n frame === 'fixed-corner' ? ctx.fixedCorner :\n frame === 'center' ? ctx.center :\n ctx.origin;\n if (!src) return null;\n return { frame, worldX: round(src.worldX), worldY: round(src.worldY) };\n },\n };\n}\n","export { clampMinSize } from './clampMinSize';\nexport { lockAspectWithModifier } from './lockAspect';\nexport { snapToGrid } from './snapToGrid';\n\nimport type { BoundsConstraint } from '../../../gestures/types';\nimport { lockAspectWithModifier } from './lockAspect';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\n\n/** The kit's standard resize behaviors, applied when a consumer doesn't\n * supply its own list: shift-drag locks the start pose's aspect ratio.\n * Pass an explicit `behaviors: []` to opt out. Stateless, so one shared\n * frozen instance is safe across every gesture. */\nexport const DEFAULT_RESIZE_BEHAVIORS: readonly BoundsConstraint<Bounds>[] =\n Object.freeze([lockAspectWithModifier()]);\nexport { snapToGuides } from './snapToGuides';\nexport { pointSnapToGrid } from './pointSnapToGrid';\n","import type { ResizeAnchor } from '../../gestures/types';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\n\n/** Corner resize-handle: world-space center plus the anchor that pins the opposite corner during resize. */\nexport interface CornerHandle {\n cx: number;\n cy: number;\n anchor: ResizeAnchor;\n}\n\n/** Which AABB edge a corner sits on, per axis. `'min'` = the x/y origin\n * edge; `'max'` = the origin + extent edge. */\nexport type CornerEdge = 'min' | 'max';\n\n/** One entry of the canonical 4-corner resize layout. The single source of\n * truth for \"which corner maps to which anchor / handle-kind\". */\nexport interface CornerAnchor {\n /** Which x-edge the corner sits on (`'min'` = left, `'max'` = right). */\n xEdge: CornerEdge;\n /** Which y-edge the corner sits on (`'min'` = top, `'max'` = bottom). */\n yEdge: CornerEdge;\n /** Anchor that pins the diagonally-opposite (fixed) corner. Always the\n * axis-wise opposite of `{xEdge, yEdge}`. */\n anchor: ResizeAnchor;\n /** Affordance/handle discriminator string for this corner. */\n kind: string;\n /** Short positional tag (`'<xEdge>-<yEdge>'`), e.g. `'min-max'`. */\n tag: string;\n}\n\n/**\n * The single ordered corner→anchor table. Order is **load-bearing**: every\n * consumer iterates it in this sequence (TL, TR, BL, BR) so positional\n * meaning (the i-th handle / `kind` / `tag`) stays consistent across the\n * resize-handle affordance, the affordance-hit classifier, and\n * `cornerResizeHandles`. Each corner's `anchor` names the diagonally\n * opposite corner, so dragging the corner scales the box from that fixed\n * point.\n */\nexport const CORNER_ANCHORS: readonly CornerAnchor[] = [\n { xEdge: 'min', yEdge: 'min', anchor: { x: 'max', y: 'max' }, kind: 'handle:top-left', tag: 'min-min' },\n { xEdge: 'max', yEdge: 'min', anchor: { x: 'min', y: 'max' }, kind: 'handle:top-right', tag: 'max-min' },\n { xEdge: 'min', yEdge: 'max', anchor: { x: 'max', y: 'min' }, kind: 'handle:bottom-left', tag: 'min-max' },\n { xEdge: 'max', yEdge: 'max', anchor: { x: 'min', y: 'min' }, kind: 'handle:bottom-right', tag: 'max-max' },\n];\n\n/** Resolve a corner's world-space position for the given bounds. `xEdge`\n * `'max'` → `x + width`; `yEdge` `'max'` → `y + height`. */\nexport function cornerPoint(\n bounds: Bounds,\n entry: Pick<CornerAnchor, 'xEdge' | 'yEdge'>,\n): { x: number; y: number } {\n return {\n x: entry.xEdge === 'max' ? bounds.x + bounds.width : bounds.x,\n y: entry.yEdge === 'max' ? bounds.y + bounds.height : bounds.y,\n };\n}\n\n/** Standard 4-corner resize-handle layout: each corner pins the opposite\n * corner via an anchor of `{x: 'min'|'max', y: 'min'|'max'}` so dragging it\n * scales the box from the fixed opposite corner. Decodes {@link CORNER_ANCHORS}\n * against `bounds`. */\nexport function cornerResizeHandles(bounds: Bounds): CornerHandle[] {\n return CORNER_ANCHORS.map((c) => {\n const p = cornerPoint(bounds, c);\n return { cx: p.x, cy: p.y, anchor: c.anchor };\n });\n}\n\n/** Square hit-test for a handle: returns true if `(px, py)` is within\n * `radius` of the handle center on both axes. */\nexport function hitCornerHandle(\n handle: CornerHandle,\n px: number,\n py: number,\n radius: number,\n): boolean {\n return Math.abs(px - handle.cx) <= radius\n && Math.abs(py - handle.cy) <= radius;\n}\n\n/** The corner that does NOT move under a resize gesture with the given\n * anchor. Used by the rotated-resize math to pin a world-space invariant.\n *\n * Convention: `anchor.x === 'min'` means the min-x (left) edge is the\n * fixed anchor, so the fixed corner sits at `x = bounds.x` (min-x).\n * `anchor.x === 'max'` means the max-x (right) edge is fixed, so the\n * fixed corner sits at `x = bounds.x + bounds.width`. `'free'` on an\n * axis means that axis doesn't move; the fixed coord is the bounds\n * origin on that axis. */\nexport function fixedCornerOf(\n bounds: Bounds,\n anchor: ResizeAnchor,\n): { x: number; y: number } {\n return {\n x: anchor.x === 'max' ? bounds.x + bounds.width : bounds.x,\n y: anchor.y === 'max' ? bounds.y + bounds.height : bounds.y,\n };\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { NodeId } from '@weasel-js/routing';
2
- import { C as ClipboardSnapshot, I as InsertAdapter } from './types-DtjCJA5r.js';
2
+ import { C as ClipboardSnapshot, I as InsertAdapter } from './types-BdaK9PcP.js';
3
3
  import '@weasel-js/history';
4
4
 
5
5
  type Replacer$1 = (key: string, value: unknown) => unknown;
package/dist/clone.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { C as CloneBehavior } from './types-DMyo7dnM.js';
1
+ import { C as CloneBehavior } from './types-BHGdrOcu.js';
2
2
  import '@weasel-js/history';
3
- import './types-DtjCJA5r.js';
3
+ import './types-BdaK9PcP.js';
4
4
  import '@weasel-js/routing';
5
5
 
6
6
  /** Clone-on-alt-drag behavior for `useClone`; activates when Alt/Option is held at drag start. */
@@ -1,13 +1,12 @@
1
- import { GradStop, TextureHandle, FillStyle, Stroke } from '@weasel-js/paint';
2
- import { a as Path, P as PoseDescriptor } from './poseDescriptor-CGOgIgf8.js';
1
+ import { GradStop, ColorSpace, TextureHandle, FillStyle, Stroke, ScreenLength } from '@weasel-js/paint';
2
+ import { a as Path, P as PoseDescriptor } from './poseDescriptor-PgfVKfa0.js';
3
3
  import { ResolvedRun, TextStyle, TextVerticalAlign } from '@weasel-js/text';
4
4
  import * as _weasel_js_history from '@weasel-js/history';
5
5
  import { Op, History, SerializedHistory } from '@weasel-js/history';
6
6
  import { NodeId, Bounds, View as View$1, SelectionApi, ActionDeps, IngestItem, DragSample, Point2 } from '@weasel-js/routing';
7
- import { a as SceneAdapter, L as LayoutStrategy, I as InsertAdapter } from './types-DtjCJA5r.js';
8
- import { MutableRefObject, ReactNode } from 'react';
7
+ import { a as SceneAdapter, L as LayoutStrategy, I as InsertAdapter } from './types-BdaK9PcP.js';
9
8
  import { ActiveToolContextValue } from '@weasel-js/routing/react';
10
- import { B as BoundsConstraint, P as PointSnapBehavior } from './types-DMyo7dnM.js';
9
+ import { B as BoundsConstraint, P as PointSnapBehavior } from './types-BHGdrOcu.js';
11
10
  import { Mat3 as Mat3$1 } from '@weasel-js/geom';
12
11
 
13
12
  /**
@@ -366,6 +365,12 @@ interface Scene<TData, TLayer extends string, TPose = RectPose> {
366
365
  * structural edit, so repeat calls hand back the same array — a snapshot,
367
366
  * not a live view, and not yours to mutate. */
368
367
  renderOrderNodes(): readonly Node<TData, TLayer, TPose>[];
368
+ /** The nodes on one layer, in render order. Cached alongside
369
+ * {@link Scene.renderOrderNodes} until a structural edit, so a caller that
370
+ * only cares about one layer pays the tree walk once rather than once per
371
+ * call. A snapshot, not a live view, and not yours to mutate. An unknown
372
+ * layer id yields an empty array. */
373
+ nodesOnLayer(layer: TLayer): readonly Node<TData, TLayer, TPose>[];
369
374
  add(spec: AddNodeSpec<TData, TLayer, TPose>): NodeId;
370
375
  /** Delete `id`, its **entire subtree**, and **everything that derives from**
371
376
  * any of those nodes — a node listing one of them in `dependsOn` goes too,
@@ -510,6 +515,15 @@ interface Scene<TData, TLayer extends string, TPose = RectPose> {
510
515
  canUndo(): boolean;
511
516
  canRedo(): boolean;
512
517
  batch<T>(label: string, fn: () => T): T;
518
+ /** Run `fn` with every mutation applied but none recorded — for writes
519
+ * that are not edits, such as a simulation stepping poses each frame.
520
+ * Undo and redo move between recorded states and never restore an
521
+ * untracked write; the next recorded change starts from whatever the
522
+ * untracked writes left, so undoing it lands there. A `batch` inside
523
+ * records nothing; inside a `batch`, these writes stay out of its entry.
524
+ * Notifies once, reverts `fn`'s writes if it throws, and throws on
525
+ * `applyBatch` and `history.apply` / `applyOps`, which exist to record. */
526
+ untracked<T>(fn: () => T): T;
513
527
  /** Read-only snapshot of every history entry currently reachable from
514
528
  * the present state. Oldest applied first, then redoable entries in
515
529
  * the order they'd be re-applied. Each entry id is stable. */
@@ -878,8 +892,9 @@ declare class GLImageCache {
878
892
  */
879
893
 
880
894
  /** Bake gradient stops into a 256-entry RGBA lookup strip, which the shader
881
- * samples instead of evaluating stops per fragment. */
882
- declare function buildGradientRamp(stops: GradStop[]): Uint8ClampedArray;
895
+ * samples instead of evaluating stops per fragment. `space` is the gradient's
896
+ * `interpolate` — the ramp is where a non-sRGB blend is paid for, once. */
897
+ declare function buildGradientRamp(stops: GradStop[], space?: ColorSpace): Uint8ClampedArray;
883
898
  declare class GradientRampAtlas {
884
899
  private readonly gl;
885
900
  /** Row per stop list, in least-recently-used order: a hit re-inserts, so the
@@ -905,7 +920,7 @@ declare class GradientRampAtlas {
905
920
  * its draw past this call may hold a row across another `upload` without
906
921
  * arranging to be flushed first.
907
922
  */
908
- upload(stops: GradStop[]): number;
923
+ upload(stops: GradStop[], space?: ColorSpace): number;
909
924
  /**
910
925
  * Whether uploading `stops` would move where existing rows sit — by growing
911
926
  * the atlas, which changes every row's `v`, or by recycling one, which
@@ -914,7 +929,7 @@ declare class GradientRampAtlas {
914
929
  * Anything holding a row past this call asks first and gets itself out of
915
930
  * the way, because neither can be undone once it has happened.
916
931
  */
917
- wouldReshape(stops: GradStop[]): boolean;
932
+ wouldReshape(stops: GradStop[], space?: ColorSpace): boolean;
918
933
  /**
919
934
  * The `v` a row is sampled at — its center.
920
935
  *
@@ -958,8 +973,11 @@ declare class GradientRampAtlas {
958
973
  type Mat3 = Float32Array;
959
974
  declare function identity(): Mat3;
960
975
  declare function multiply(out: Mat3, m: Mat3): Mat3;
961
- declare function translate(m: Mat3, tx: number, ty: number): Mat3;
962
- declare function scale(m: Mat3, sx: number, sy: number): Mat3;
976
+ /** `m · T(tx, ty)`: composes onto `m`, where `@weasel-js/geom`'s `translate`
977
+ * constructs a fresh matrix. */
978
+ declare function translated(m: Mat3, tx: number, ty: number): Mat3;
979
+ /** `m · S(sx, sy)`: composes onto `m`, where geom's `scale` constructs one. */
980
+ declare function scaled(m: Mat3, sx: number, sy: number): Mat3;
963
981
  /** Inverse of an affine matrix, or `null` when `@weasel-js/geom`'s `invert`
964
982
  * finds it singular — the same rule, read through this layout. */
965
983
  declare function invert(m: Mat3): Mat3 | null;
@@ -984,8 +1002,8 @@ declare function meanScaleOf(m: Mat3): number;
984
1002
  declare const mat3: {
985
1003
  identity: typeof identity;
986
1004
  multiply: typeof multiply;
987
- translate: typeof translate;
988
- scale: typeof scale;
1005
+ translated: typeof translated;
1006
+ scaled: typeof scaled;
989
1007
  invert: typeof invert;
990
1008
  apply: typeof apply;
991
1009
  screenToClip: typeof screenToClip;
@@ -1554,7 +1572,7 @@ declare class WeaselRenderer {
1554
1572
  * with effects asks, so a canvas without them pays no memory. */
1555
1573
  private readonly effectTargets;
1556
1574
  private readonly imageMinification;
1557
- private readonly flattenTolerance?;
1575
+ private flattenTolerance?;
1558
1576
  private readonly bakeBudget;
1559
1577
  private readonly textOutlineMinScreenSize;
1560
1578
  private contextLost;
@@ -1631,6 +1649,9 @@ declare class WeaselRenderer {
1631
1649
  * callers with no view concept can keep calling `render(commands)`.
1632
1650
  */
1633
1651
  render(commands: DrawCommand[], viewMatrix?: Mat3): void;
1652
+ /** Change the curve-flattening tolerance after construction. `undefined`
1653
+ * restores the cached `DEFAULT_FLATTEN_TOLERANCE` route. */
1654
+ setFlattenTolerance(tolerance: number | undefined): void;
1634
1655
  resize(dims: {
1635
1656
  width: number;
1636
1657
  height: number;
@@ -1716,6 +1737,31 @@ interface View {
1716
1737
  */
1717
1738
  declare function viewToMat3(view: View): Mat3;
1718
1739
 
1740
+ /** A screen-space rectangle, CSS pixels. */
1741
+ interface CullRect {
1742
+ x: number;
1743
+ y: number;
1744
+ width: number;
1745
+ height: number;
1746
+ }
1747
+ /**
1748
+ * `cmds` without the commands that cannot put a pixel inside `rect`, where
1749
+ * `transform` maps the commands' space to screen space — `viewToMat3(view)`
1750
+ * for a world-space layer.
1751
+ *
1752
+ * Conservative by construction: a command is dropped only when a bound that
1753
+ * encloses everything it can paint misses `rect`. Paths are bounded by their
1754
+ * control hull plus the farthest a stroke can reach (miter spikes and square
1755
+ * caps included), images and sprites by their quads, and every bound is taken
1756
+ * through the accumulated transform as the AABB of its corners, so rotation
1757
+ * only enlarges it. Text and shader commands are always kept, and so is a
1758
+ * group with `effects` — an effect may move pixels. Clips are ignored, which
1759
+ * can only keep more. A group whose children all go is dropped.
1760
+ *
1761
+ * Returns `cmds` itself when nothing was dropped.
1762
+ */
1763
+ declare function cullDrawCommands(cmds: DrawCommand[], transform: Mat3, rect: CullRect): DrawCommand[];
1764
+
1719
1765
  /** Options for stroke tessellation. */
1720
1766
  interface StrokeOptions {
1721
1767
  flattenTolerance?: number;
@@ -1731,9 +1777,7 @@ interface StrokeOptions {
1731
1777
  /** Resolve a stroke width to world units. A number is already world units;
1732
1778
  * `{ px }` is screen pixels divided by the accumulated scale, so it holds its
1733
1779
  * on-screen thickness as the view zooms. */
1734
- declare function resolveStrokeWidth(width: number | {
1735
- px: number;
1736
- }, scale: number): number;
1780
+ declare function resolveStrokeWidth(width: ScreenLength, scale: number): number;
1737
1781
  /**
1738
1782
  * Build a triangle-mesh ribbon from a stroked Path.
1739
1783
  *
@@ -2505,7 +2549,8 @@ interface ViewAnimationApi {
2505
2549
  }
2506
2550
  /**
2507
2551
  * Animate the viewport `View`. Runs on the kit's {@link Animator} — pass one to
2508
- * share a canvas's animator, or omit it and the hook makes its own.
2552
+ * share a canvas's animator, or omit it and the hook makes its own. A caller
2553
+ * that always has one should use {@link useViewAnimationOn}, which builds none.
2509
2554
  *
2510
2555
  * Every animation from one instance registers under that instance's cancel key,
2511
2556
  * so starting one cancels whatever *it* had in flight, and each starts from the
@@ -2513,6 +2558,9 @@ interface ViewAnimationApi {
2513
2558
  * Two instances on one animator are independent.
2514
2559
  */
2515
2560
  declare function useViewAnimation(view: ViewChannel, animator?: Animator): ViewAnimationApi;
2561
+ /** {@link useViewAnimation} on an animator the caller owns. Constructs no
2562
+ * animator of its own, so the camera runs on exactly the one passed. */
2563
+ declare function useViewAnimationOn(view: ViewChannel, animator: Animator): ViewAnimationApi;
2516
2564
 
2517
2565
  /**
2518
2566
  * Pose composition for hierarchical scene graphs.
@@ -2779,58 +2827,6 @@ interface ContentHandlerEntry {
2779
2827
  /** Register a content handler. Returns a disposer that removes it. */
2780
2828
  declare function registerContentHandler(entry: ContentHandlerEntry): () => void;
2781
2829
 
2782
- /**
2783
- * @experimental
2784
- * PointerContext — a tiny ambient context that publishes the world-space
2785
- * position of the canvas pointer, refreshed on every `pointermove` over
2786
- * the canvas. Cleared (set to `null`) on `pointerleave`.
2787
- *
2788
- * Why ref-based and not state-based: cursor moves fire dozens of times per
2789
- * second; routing those through React state would re-render every consumer
2790
- * in the tree. The context exposes a stable `pointerRef` whose `.current`
2791
- * is mutated directly by the publisher, plus a thunk `getDropPoint()` that
2792
- * reads it on demand. Consumers (e.g. `useClipboard`) pull via the thunk
2793
- * inside their callbacks — no subscription, no re-render.
2794
- *
2795
- * `<SceneCanvas>` publishes automatically. `useClipboardOps` consumes when
2796
- * the caller didn't pass an explicit `getDropPoint` option. Other future
2797
- * hit-on-cursor consumers (drop-zone hover, context-menu anchor) can reuse
2798
- * the same context.
2799
- */
2800
-
2801
- /** @experimental World-space pointer position, or `null` when the pointer
2802
- * isn't over the publishing canvas. */
2803
- type PointerWorldPos = {
2804
- worldX: number;
2805
- worldY: number;
2806
- } | null;
2807
- /** @experimental */
2808
- interface PointerContextValue {
2809
- /** Live ref — mutate to publish, read for the latest snapshot. The
2810
- * identity is stable for the lifetime of the provider. */
2811
- readonly pointerRef: MutableRefObject<PointerWorldPos>;
2812
- /** Convenience thunk equivalent to `() => pointerRef.current`. Stable
2813
- * identity for the lifetime of the provider; safe to pass to hooks. */
2814
- readonly getDropPoint: () => PointerWorldPos;
2815
- }
2816
- /**
2817
- * @experimental
2818
- * Wrap the part of the React tree that should share a pointer-position
2819
- * context. Usually placed at the demo / app root, alongside
2820
- * `<ActionsProvider>` and `<SelectionContextProvider>`.
2821
- *
2822
- * Most consumers don't need to mount this directly — `<SceneCanvas>` mounts
2823
- * an internal provider when no parent provider is in scope, so child hooks
2824
- * (`useClipboard` without an explicit `getDropPoint`) read the canvas's
2825
- * tracked pointer for free.
2826
- */
2827
- declare function PointerContextProvider({ children }: {
2828
- children: ReactNode;
2829
- }): ReactNode;
2830
- /** @experimental Read the surrounding pointer-context value, or `null` when
2831
- * no provider is in scope. */
2832
- declare function usePointerContext(): PointerContextValue | null;
2833
-
2834
2830
  /** Optional consumer seam: given a node and the affine `m` that a pose-transform
2835
2831
  * action applied to the node's POSE, return updated `data` with the node's
2836
2832
  * data-held geometry transformed by `m`, or `null` if this node has no
@@ -3318,13 +3314,6 @@ declare module '@weasel-js/routing' {
3318
3314
  scene: Scene<unknown, string, unknown>;
3319
3315
  /** Undo/redo history bound to the current scene. */
3320
3316
  history: History;
3321
- /**
3322
- * Canvas pointer position in world space.
3323
- *
3324
- * Exposes `pointerRef` (mutable live ref) and `getDropPoint()` thunk.
3325
- * Marked `@experimental` in the source.
3326
- */
3327
- pointer: PointerContextValue;
3328
3317
  /** Currently active tool id + hotkey-hold stack. */
3329
3318
  activeTool: ActiveToolContextValue;
3330
3319
  /**
@@ -3487,4 +3476,4 @@ declare module '@weasel-js/routing' {
3487
3476
  }
3488
3477
  }
3489
3478
 
3490
- export { type ViewportDims as $, type SliceDep as A, type VertexColorChannel as B, type InsertExtras as C, type DrawCommand as D, type Effect as E, type SerializedScene as F, type GroupDrawCommand as G, type GeometryProjection as H, IDENTITY_COLOR_MATRIX as I, type ContentHandlerEntry as J, type SvgIngestOptions as K, type PanBounds as L, type Mesh as M, type Node as N, type Animator as O, type PathDrawCommand as P, ColorOverrideRegistry as Q, type RenderTarget as R, SPRITE_STRIDE as S, type TextDrawCommand as T, type UseSceneOptions as U, type View as V, WeaselRenderer as W, type SceneRegistry as X, type RegisteredOp as Y, type PoseOverrides as Z, type DerivedDep as _, type ImageDrawCommand as a, type StaggerOptions as a$, ShaderProgram as a0, type BooleansAdapter as a1, type UseAnimatorOptions as a2, type SpringPresetName as a3, type EasingSpec as a4, type AnimationHandle as a5, type SampledTrack as a6, type AddLayerSpec as a7, type AddNodeSpec as a8, type AnimateToBoundsOptions as a9, type LassoSelectDep as aA, type LayerRecord as aB, type LayoutDep as aC, type LeafNode as aD, type LoopFactory as aE, type LoopOptions as aF, type NestedTimeline as aG, type NodeAtPointDep as aH, type PhysicsHandle as aI, type PhysicsOptions as aJ, PointerContextProvider as aK, type PointerContextValue as aL, type PointerWorldPos as aM, type PoseAdapter as aN, type PoseClosure as aO, type PoseOverride as aP, RECT_POSE_COMPOSITION as aQ, RIGID_POSE_COMPOSITION as aR, type ResizePolicy as aS, SPRING_PRESETS as aT, type SerializedNode as aU, type SnapDep as aV, type SpringOptions as aW, type SpringPreset as aX, type StaggerBuilder as aY, type StaggerDelay as aZ, type StaggerFactory as a_, type AreaSelectDep as aa, type BezierEasing as ab, type BooleanOp as ac, type BooleanOpResult as ad, type ClipboardDep as ae, type ClipboardIngestCtx as af, type ColorOverride as ag, type ColorOverrideFn as ah, type ContainerNode as ai, type DecayLoopConfig as aj, type DecayOptions as ak, EASINGS as al, type EasingFn as am, type EasingName as an, type EditAnchorsDep as ao, type EventBooking as ap, type EventBookingHandle as aq, type EventTrack as ar, type FitViewToBoundsOptions as as, IDENTITY_POSE_COMPOSITION as at, type IngestCtx as au, type IngestionDep as av, type InsertDep as aw, type Interpolate as ax, type InterpolatorFactory as ay, type Keyframe as az, type ImageMinification as b, rebaseLocalPose as b$, type StaggerPerItem as b0, type StaggerSpringPoseOptions as b1, type StaggerTweenOptions as b2, type SvgUnpacker as b3, type SystemLayerRecord as b4, type SystemLayerSpec as b5, type TextEditDep as b6, type TimelineClock as b7, type TimelineEvent as b8, type TimelineHandle as b9, easeInOutBack as bA, easeInOutBounce as bB, easeInOutCirc as bC, easeInOutCubic as bD, easeInOutElastic as bE, easeInOutExpo as bF, easeInOutQuad as bG, easeInOutQuart as bH, easeInOutQuint as bI, easeInOutSine as bJ, easeInQuad as bK, easeInQuart as bL, easeInQuint as bM, easeInSine as bN, easeOut as bO, easeOutBack as bP, easeOutBounce as bQ, easeOutCirc as bR, easeOutCubic as bS, easeOutElastic as bT, easeOutExpo as bU, easeOutQuad as bV, easeOutQuart as bW, easeOutQuint as bX, easeOutSine as bY, fitViewToBounds as bZ, linear as b_, type TimelineOptions as ba, type TimelineTrack as bb, type Track as bc, type TweenLoopOptions as bd, type TweenOptions as be, type UserLayerRecord as bf, VIEW_ANIMATION_KEY as bg, type ViewAnimationApi as bh, type ViewApi as bi, type ViewChannel as bj, applyBooleanOp as bk, asNodeId as bl, composeRectPose as bm, composeRigidPose as bn, composeWorldPose as bo, cubicBezierEasing as bp, decomposeRectPose as bq, decomposeRigidPose as br, easeIn as bs, easeInBack as bt, easeInBounce as bu, easeInCirc as bv, easeInCubic as bw, easeInElastic as bx, easeInExpo as by, easeInOut as bz, type Mat3 as c, registerContentHandler as c0, resolveEasing as c1, resolveStrokeWidth as c2, translateRectPose as c3, useDecayLoop as c4, usePointerContext as c5, useViewAnimation as c6, worldPoseLookup as c7, ShaderCompileError as d, type ShaderDrawCommand as e, type ShaderProgramHandle as f, type ShaderUniform as g, type SolidPaint as h, type SpriteSheet as i, type SpritesDrawCommand as j, type StrokeOptions as k, type WeaselRendererOptions as l, blur as m, buildGradientRamp as n, frameRect as o, mat3 as p, registerProgram as q, registerEffect as r, vignette as s, tessellateStroke as t, type Scene as u, viewToMat3 as v, type RectPose as w, type InertiaConfig as x, type ViewAnimationOptions as y, type PoseComposition as z };
3479
+ export { type PoseOverrides as $, type PoseComposition as A, type SliceDep as B, type CullRect as C, type DrawCommand as D, type Effect as E, type VertexColorChannel as F, type GroupDrawCommand as G, type InsertExtras as H, IDENTITY_COLOR_MATRIX as I, type SerializedScene as J, type GeometryProjection as K, type ContentHandlerEntry as L, type Mesh as M, type Node as N, type SvgIngestOptions as O, type PathDrawCommand as P, type PanBounds as Q, type RenderTarget as R, SPRITE_STRIDE as S, type TextDrawCommand as T, type Animator as U, type View as V, WeaselRenderer as W, ColorOverrideRegistry as X, type UseSceneOptions as Y, type SceneRegistry as Z, type RegisteredOp as _, type ImageDrawCommand as a, type StaggerPerItem as a$, type DerivedDep as a0, type ViewportDims as a1, ShaderProgram as a2, type BooleansAdapter as a3, type UseAnimatorOptions as a4, type SpringPresetName as a5, type EasingSpec as a6, type AnimationHandle as a7, type SampledTrack as a8, type AddLayerSpec as a9, type InterpolatorFactory as aA, type Keyframe as aB, type LassoSelectDep as aC, type LayerRecord as aD, type LayoutDep as aE, type LeafNode as aF, type LoopFactory as aG, type LoopOptions as aH, type NestedTimeline as aI, type NodeAtPointDep as aJ, type PhysicsHandle as aK, type PhysicsOptions as aL, type PoseAdapter as aM, type PoseClosure as aN, type PoseOverride as aO, RECT_POSE_COMPOSITION as aP, RIGID_POSE_COMPOSITION as aQ, type ResizePolicy as aR, SPRING_PRESETS as aS, type SerializedNode as aT, type SnapDep as aU, type SpringOptions as aV, type SpringPreset as aW, type StaggerBuilder as aX, type StaggerDelay as aY, type StaggerFactory as aZ, type StaggerOptions as a_, type AddNodeSpec as aa, type AnimateToBoundsOptions as ab, type AreaSelectDep as ac, type BezierEasing as ad, type BooleanOp as ae, type BooleanOpResult as af, type ClipboardDep as ag, type ClipboardIngestCtx as ah, type ColorOverride as ai, type ColorOverrideFn as aj, type ContainerNode as ak, type DecayLoopConfig as al, type DecayOptions as am, EASINGS as an, type EasingFn as ao, type EasingName as ap, type EditAnchorsDep as aq, type EventBooking as ar, type EventBookingHandle as as, type EventTrack as at, type FitViewToBoundsOptions as au, IDENTITY_POSE_COMPOSITION as av, type IngestCtx as aw, type IngestionDep as ax, type InsertDep as ay, type Interpolate as az, type ImageMinification as b, registerContentHandler as b$, type StaggerSpringPoseOptions as b0, type StaggerTweenOptions as b1, type SvgUnpacker as b2, type SystemLayerRecord as b3, type SystemLayerSpec as b4, type TextEditDep as b5, type TimelineClock as b6, type TimelineEvent as b7, type TimelineHandle as b8, type TimelineOptions as b9, easeInOutBounce as bA, easeInOutCirc as bB, easeInOutCubic as bC, easeInOutElastic as bD, easeInOutExpo as bE, easeInOutQuad as bF, easeInOutQuart as bG, easeInOutQuint as bH, easeInOutSine as bI, easeInQuad as bJ, easeInQuart as bK, easeInQuint as bL, easeInSine as bM, easeOut as bN, easeOutBack as bO, easeOutBounce as bP, easeOutCirc as bQ, easeOutCubic as bR, easeOutElastic as bS, easeOutExpo as bT, easeOutQuad as bU, easeOutQuart as bV, easeOutQuint as bW, easeOutSine as bX, fitViewToBounds as bY, linear as bZ, rebaseLocalPose as b_, type TimelineTrack as ba, type Track as bb, type TweenLoopOptions as bc, type TweenOptions as bd, type UserLayerRecord as be, VIEW_ANIMATION_KEY as bf, type ViewAnimationApi as bg, type ViewApi as bh, type ViewChannel as bi, applyBooleanOp as bj, asNodeId as bk, composeRectPose as bl, composeRigidPose as bm, composeWorldPose as bn, cubicBezierEasing as bo, decomposeRectPose as bp, decomposeRigidPose as bq, easeIn as br, easeInBack as bs, easeInBounce as bt, easeInCirc as bu, easeInCubic as bv, easeInElastic as bw, easeInExpo as bx, easeInOut as by, easeInOutBack as bz, type Mat3 as c, resolveEasing as c0, resolveStrokeWidth as c1, translateRectPose as c2, useDecayLoop as c3, useViewAnimation as c4, useViewAnimationOn as c5, worldPoseLookup as c6, ShaderCompileError as d, type ShaderDrawCommand as e, type ShaderProgramHandle as f, type ShaderUniform as g, type SolidPaint as h, type SpriteSheet as i, type SpritesDrawCommand as j, type StrokeOptions as k, type WeaselRendererOptions as l, blur as m, buildGradientRamp as n, cullDrawCommands as o, frameRect as p, mat3 as q, registerEffect as r, registerProgram as s, tessellateStroke as t, vignette as u, viewToMat3 as v, type Scene as w, type RectPose as x, type InertiaConfig as y, type ViewAnimationOptions as z };
@@ -1,4 +1,4 @@
1
- import { M as MoveBehavior, S as SnapStrategy } from './types-DMyo7dnM.js';
1
+ import { M as MoveBehavior, S as SnapStrategy } from './types-BHGdrOcu.js';
2
2
  import { DebugSink } from '@weasel-js/routing';
3
3
 
4
4
  /**