@weasel-js/ui-canvas 1.19.1 → 2.0.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/dist/chunks/{CharacterOptions-BcT_lWjg.js → CharacterOptions-CSqKZvwS.js} +23 -12
- package/dist/chunks/CharacterOptions-CSqKZvwS.js.map +1 -0
- package/dist/chunks/{PlotDataPanel-DUNod3NJ.js → PlotDataPanel-uHdh4X0l.js} +12 -6
- package/dist/chunks/PlotDataPanel-uHdh4X0l.js.map +1 -0
- package/dist/chunks/Rulers-hkPFdPkH.js.map +1 -1
- package/dist/chunks/{SceneGradientHandles-CHNSWx7U.js → SceneGradientHandles-CcXyTVav.js} +11 -8
- package/dist/chunks/SceneGradientHandles-CcXyTVav.js.map +1 -0
- package/dist/chunks/{SceneLayerList-DCYwqZkF.js → SceneLayerList-D2yc3eIk.js} +16 -13
- package/dist/chunks/SceneLayerList-D2yc3eIk.js.map +1 -0
- package/dist/chunks/{SelectionPanel-n-dIMvQ2.js → SelectionPanel-Dz6_c0rd.js} +12 -15
- package/dist/chunks/SelectionPanel-Dz6_c0rd.js.map +1 -0
- package/dist/components/PlotDataPanel/PlotDataPanel.d.ts +19 -0
- package/dist/components/PlotDataPanel/PlotDataPanel.d.ts.map +1 -0
- package/dist/components/PlotDataPanel/PlotTableView.d.ts +14 -0
- package/dist/components/PlotDataPanel/PlotTableView.d.ts.map +1 -0
- package/dist/components/PlotDataPanel/index.d.ts +5 -0
- package/dist/components/PlotDataPanel/index.d.ts.map +1 -0
- package/dist/components/PlotDataPanel/index.js +1 -1
- package/dist/components/PlotDataPanel/rowIds.d.ts +17 -0
- package/dist/components/PlotDataPanel/rowIds.d.ts.map +1 -0
- package/dist/components/PlotDataPanel/valueControl.d.ts +13 -0
- package/dist/components/PlotDataPanel/valueControl.d.ts.map +1 -0
- package/dist/components/Rulers/Rulers.d.ts +18 -0
- package/dist/components/Rulers/Rulers.d.ts.map +1 -0
- package/dist/components/Rulers/index.d.ts +3 -0
- package/dist/components/Rulers/index.d.ts.map +1 -0
- package/dist/components/SceneGradientHandles/SceneGradientHandles.d.ts +41 -0
- package/dist/components/SceneGradientHandles/SceneGradientHandles.d.ts.map +1 -0
- package/dist/components/SceneGradientHandles/index.d.ts +2 -0
- package/dist/components/SceneGradientHandles/index.d.ts.map +1 -0
- package/dist/components/SceneGradientHandles/index.js +1 -1
- package/dist/components/SceneLayerList/index.d.ts +2 -0
- package/dist/components/SceneLayerList/index.d.ts.map +1 -0
- package/dist/components/SceneLayerList/index.js +1 -1
- package/dist/components/SceneLayerList/useSceneLayerList.d.ts +47 -0
- package/dist/components/SceneLayerList/useSceneLayerList.d.ts.map +1 -0
- package/dist/components/inspector/AnchorFields/AnchorFields.d.ts +34 -0
- package/dist/components/inspector/AnchorFields/AnchorFields.d.ts.map +1 -0
- package/dist/components/inspector/AnchorFields/index.d.ts +2 -0
- package/dist/components/inspector/AnchorFields/index.d.ts.map +1 -0
- package/dist/components/inspector/CharacterOptions/CharacterOptions.d.ts +27 -0
- package/dist/components/inspector/CharacterOptions/CharacterOptions.d.ts.map +1 -0
- package/dist/components/inspector/CharacterOptions/characterSchema.d.ts +169 -0
- package/dist/components/inspector/CharacterOptions/characterSchema.d.ts.map +1 -0
- package/dist/components/inspector/CharacterOptions/index.d.ts +4 -0
- package/dist/components/inspector/CharacterOptions/index.d.ts.map +1 -0
- package/dist/components/inspector/CharacterOptions/index.js +1 -1
- package/dist/components/inspector/SelectionPanel/SelectionPanel.d.ts +80 -0
- package/dist/components/inspector/SelectionPanel/SelectionPanel.d.ts.map +1 -0
- package/dist/components/inspector/SelectionPanel/commitLeaf.d.ts +23 -0
- package/dist/components/inspector/SelectionPanel/commitLeaf.d.ts.map +1 -0
- package/dist/components/inspector/SelectionPanel/declaredFields.d.ts +19 -0
- package/dist/components/inspector/SelectionPanel/declaredFields.d.ts.map +1 -0
- package/dist/components/inspector/SelectionPanel/index.d.ts +3 -0
- package/dist/components/inspector/SelectionPanel/index.d.ts.map +1 -0
- package/dist/components/inspector/SelectionPanel/index.js +2 -2
- package/dist/components/inspector/SelectionPanel/nodeModel.d.ts +14 -0
- package/dist/components/inspector/SelectionPanel/nodeModel.d.ts.map +1 -0
- package/dist/components/inspector/SelectionPanel/scopes.d.ts +7 -0
- package/dist/components/inspector/SelectionPanel/scopes.d.ts.map +1 -0
- package/dist/icons.gen.d.ts +3 -0
- package/dist/icons.gen.d.ts.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -6
- package/dist/kitIcons.d.ts +4 -0
- package/dist/kitIcons.d.ts.map +1 -0
- package/package.json +20 -18
- package/dist/chunks/CharacterOptions-BcT_lWjg.js.map +0 -1
- package/dist/chunks/PlotDataPanel-DUNod3NJ.js.map +0 -1
- package/dist/chunks/SceneGradientHandles-CHNSWx7U.js.map +0 -1
- package/dist/chunks/SceneLayerList-DCYwqZkF.js.map +0 -1
- package/dist/chunks/SelectionPanel-n-dIMvQ2.js.map +0 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { SelectionApi } from '@weasel-js/routing';
|
|
3
|
+
import type { UnitScope } from '@weasel-js/quantity';
|
|
4
|
+
import { type FeaturePreset, type NodePropertiesEntry, type NodeRoutingEntry, type Scene } from '@weasel-js/core';
|
|
5
|
+
import type { LeafRenderer } from '@weasel-js/ui/components/PanelCells';
|
|
6
|
+
import type { PrefGroup, PrefSection } from '@weasel-js/prefs';
|
|
7
|
+
import type { MarkHiddenProps } from '@weasel-js/ui/components/Prefs';
|
|
8
|
+
import { type PrefSelectHow } from '@weasel-js/ui/components/Prefs';
|
|
9
|
+
import { type HoldProps } from '@weasel-js/ui/components/Disabled';
|
|
10
|
+
/** Props for {@link SelectionPanel}. */
|
|
11
|
+
export interface SelectionPanelProps<TData, TLayer extends string, TPose> extends MarkHiddenProps, HoldProps {
|
|
12
|
+
/** The scene handle (`useScene`). The panel subscribes itself, so it
|
|
13
|
+
* re-renders on scene mutations regardless of parent renders. */
|
|
14
|
+
scene: Scene<TData, TLayer, TPose>;
|
|
15
|
+
/** Selection handle (`useSelection`): the nodes the panel edits. Only `current` is read. */
|
|
16
|
+
selection: Pick<SelectionApi, 'current'>;
|
|
17
|
+
/** The presets the canvas runs (`<SceneCanvas features>`): the routing and
|
|
18
|
+
* properties their node kinds bring are read from them, ahead of
|
|
19
|
+
* `routing` and `properties`, as `nodeTraitsOf` merges them. */
|
|
20
|
+
features?: readonly FeaturePreset[];
|
|
21
|
+
/** Properties-trait entries, e.g. core's `defaultNodeProperties` /
|
|
22
|
+
* `inferredNodeProperties` (+ consumer extras). A later entry of a name
|
|
23
|
+
* replaces an earlier one. Default `inferredNodeProperties`. Memoize or hoist. */
|
|
24
|
+
properties?: readonly NodePropertiesEntry[];
|
|
25
|
+
/** Routing-trait classifiers used to derive each node's kind — pass
|
|
26
|
+
* the same list the canvas's `routing` prop takes. Default
|
|
27
|
+
* `inferredNodeRouting`, as on the canvas. Memoize or hoist. */
|
|
28
|
+
routing?: readonly NodeRoutingEntry[];
|
|
29
|
+
/** Control overrides / app-defined kinds (PrefsForm-style). Keys are
|
|
30
|
+
* leaf paths (`data.fill`, checked first) or leaf kinds (`color`).
|
|
31
|
+
* A renderer returning `null` collapses its leaf (and the row, when
|
|
32
|
+
* every leaf in it collapses). */
|
|
33
|
+
renderers?: Record<string, LeafRenderer>;
|
|
34
|
+
/**
|
|
35
|
+
* The schema the properties schemas' `alias` leaves point into. Default:
|
|
36
|
+
* each kind's own. A panel drawn from layouts of aliases into another
|
|
37
|
+
* schema passes that other: each alias row is drawn as the leaf of it at
|
|
38
|
+
* the alias's path, reads that path of every selected node and writes
|
|
39
|
+
* there, and is hidden and disabled by that leaf's conditions as well as
|
|
40
|
+
* its own. A `PrefGroup`'s keys are steps of the node path (`data`, then
|
|
41
|
+
* `fill`); a `PrefSection`'s leaf keys are whole node paths. A condition
|
|
42
|
+
* of a kind's own schema may read a setting of that one too: a path no
|
|
43
|
+
* leaf of the kind holds is read there, as the panel reads a leaf of its
|
|
44
|
+
* own: a node holding nothing at the path reads as the leaf's default
|
|
45
|
+
* only where the leaf is `absentIsDefault`.
|
|
46
|
+
*/
|
|
47
|
+
over?: PrefGroup | PrefSection;
|
|
48
|
+
/** The scene's outermost unit scope. Given, a field whose leaf measures a
|
|
49
|
+
* length shows it in the unit scopes the selected nodes share, through
|
|
50
|
+
* `prefLeafInUnitScopes`; what is typed is still stored in world units. */
|
|
51
|
+
units?: UnitScope;
|
|
52
|
+
/** Kind → header label. Default: capitalized kind name. */
|
|
53
|
+
kindLabel?: (kind: string) => string;
|
|
54
|
+
/** Rendered when the selection is empty. */
|
|
55
|
+
emptyState?: ReactNode;
|
|
56
|
+
/**
|
|
57
|
+
* What to mark: a leaf by its key in the schema (`data.fill`), a field of
|
|
58
|
+
* an object leaf under its leaf's (`data.stroke.width`), and a top-level
|
|
59
|
+
* section drawn under a heading, as a tab, or as a panel by its own key.
|
|
60
|
+
* Leaves a `pair` draws in one row share its mark.
|
|
61
|
+
* Each time the last one changes the panel brings it into view, opening
|
|
62
|
+
* the tab that holds it. A path the panel draws no row for marks the row
|
|
63
|
+
* it lies inside, or nothing.
|
|
64
|
+
*/
|
|
65
|
+
marked?: readonly string[];
|
|
66
|
+
/** The reader pressed or focused into a row, reported as `marked` names
|
|
67
|
+
* it: a paired row as its first leaf, and a section's heading, tab, or
|
|
68
|
+
* panel as the section's key. `how.toggle` is true when Cmd or Ctrl was
|
|
69
|
+
* held. A press on one of several marked rows is reported on its click. */
|
|
70
|
+
onMark?: (path: string, how: PrefSelectHow) => void;
|
|
71
|
+
className?: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Pre-baked selection properties panel. Shows the selected nodes' kind
|
|
75
|
+
* and the properties-trait schema for that kind; multi-selections show
|
|
76
|
+
* the intersection of the kinds' schemas with per-field Mixed state.
|
|
77
|
+
* Edits commit as one labeled `scene.batch` fan-out per gesture.
|
|
78
|
+
*/
|
|
79
|
+
export declare function SelectionPanel<TData, TLayer extends string, TPose>(props: SelectionPanelProps<TData, TLayer, TPose>): import("react").JSX.Element;
|
|
80
|
+
//# sourceMappingURL=SelectionPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectionPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/inspector/SelectionPanel/SelectionPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAKL,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,KAAK,EACX,MAAM,iBAAiB,CAAC;AAIzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAGxE,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEtE,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAOpF,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAK9E,wCAAwC;AACxC,MAAM,WAAW,mBAAmB,CAAC,KAAK,EAAE,MAAM,SAAS,MAAM,EAAE,KAAK,CAAE,SAAQ,eAAe,EAAE,SAAS;IAC1G;sEACkE;IAClE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IACnC,4FAA4F;IAC5F,SAAS,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IACzC;;qEAEiE;IACjE,QAAQ,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IACpC;;uFAEmF;IACnF,UAAU,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAC5C;;qEAEiE;IACjE,OAAO,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACtC;;;uCAGmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACzC;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAC/B;;gFAE4E;IAC5E,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACrC,4CAA4C;IAC5C,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B;;;gFAG4E;IAC5E,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,KAAK,IAAI,CAAC;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAOD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,SAAS,MAAM,EAAE,KAAK,EAChE,KAAK,EAAE,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,+BA0FjD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { SelectionApi } from '@weasel-js/routing';
|
|
2
|
+
import { type NodePropertiesEntry, type Scene } from '@weasel-js/core';
|
|
3
|
+
import { type PanelLeaf, type PanelPaintAbove, type PanelRecord } from '@weasel-js/ui/components/PanelCells';
|
|
4
|
+
import { type AnyNode } from './nodeModel.js';
|
|
5
|
+
import type { LeafWrites } from '@weasel-js/ui/components/PanelCells';
|
|
6
|
+
type Next = (prev: unknown) => unknown;
|
|
7
|
+
/** The `settle` of the properties entry a node is edited under, if it has one. */
|
|
8
|
+
export type SettleOf = (node: AnyNode) => NodePropertiesEntry['settle'];
|
|
9
|
+
/** `node` as a panel reads it, with what an `'inherit'` paint on it takes when `paintAbove` is given and it has a
|
|
10
|
+
* parent. */
|
|
11
|
+
export declare function nodeRecord(node: AnyNode, paintAbove?: (node: AnyNode) => PanelPaintAbove): PanelRecord;
|
|
12
|
+
/** Warn once per kind and path, in dev, of a value leaf that `kinds`' schemas key where no edit can land. */
|
|
13
|
+
export declare function warnUnwritable(kinds: readonly string[], leaves: readonly PanelLeaf[]): void;
|
|
14
|
+
/**
|
|
15
|
+
* Writes, into every selected node, what `next` derives from the value that
|
|
16
|
+
* node holds at the leaf's path, as one labeled batch. A node whose properties
|
|
17
|
+
* entry has a `settle` stores what that returns.
|
|
18
|
+
*/
|
|
19
|
+
export declare function commitLeaf<TData, TLayer extends string, TPose>(scene: Scene<TData, TLayer, TPose>, selection: Pick<SelectionApi, 'current'>, leaf: PanelLeaf, next: Next, settleOf?: SettleOf): void;
|
|
20
|
+
/** The writes of one panel over `scene`. Keep one per panel: it holds what the drafts in flight wrote over. */
|
|
21
|
+
export declare function leafWrites<TData, TLayer extends string, TPose>(scene: Scene<TData, TLayer, TPose>, settleOf?: SettleOf): LeafWrites;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=commitLeaf.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commitLeaf.d.ts","sourceRoot":"","sources":["../../../../src/components/inspector/SelectionPanel/commitLeaf.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAY,KAAK,mBAAmB,EAAE,KAAK,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAKjF,OAAO,EAA4B,KAAK,SAAS,EAAE,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,MAAM,qCAAqC,CAAC;AACvI,OAAO,EAAe,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAEtE,KAAK,IAAI,GAAG,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC;AAEvC,kFAAkF;AAClF,MAAM,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,OAAO,KAAK,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AAIxE;cACc;AACd,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,eAAe,GAAG,WAAW,CAGtG;AA8CD,6GAA6G;AAC7G,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,SAAS,SAAS,EAAE,GAAG,IAAI,CAW3F;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,SAAS,MAAM,EAAE,KAAK,EAC5D,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAClC,SAAS,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,EACxC,IAAI,EAAE,SAAS,EACf,IAAI,EAAE,IAAI,EACV,QAAQ,GAAE,QAAoB,GAC7B,IAAI,CAIN;AAQD,+GAA+G;AAC/G,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,SAAS,MAAM,EAAE,KAAK,EAC5D,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAClC,QAAQ,GAAE,QAAoB,GAC7B,UAAU,CA8DZ"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { NodeId } from '@weasel-js/routing';
|
|
2
|
+
import type { NodeClip, SceneNode } from '@weasel-js/core';
|
|
3
|
+
import type { UnitScope } from '@weasel-js/quantity';
|
|
4
|
+
/** The scene methods that record a declared field. */
|
|
5
|
+
interface DeclaredWrites {
|
|
6
|
+
setClip(id: NodeId, clip: NodeClip | null): void;
|
|
7
|
+
setUnits(id: NodeId, units: UnitScope | null): void;
|
|
8
|
+
}
|
|
9
|
+
/** A node's field that a schema key can name outright: what the node declares for its children, stored
|
|
10
|
+
* beside `pose` and `data` and written through the scene method that records it. */
|
|
11
|
+
interface DeclaredField {
|
|
12
|
+
write(scene: DeclaredWrites, id: NodeId, value: unknown): void;
|
|
13
|
+
}
|
|
14
|
+
/** The declared field a path's first segment names, if it names one. */
|
|
15
|
+
export declare const declaredField: (head: string | undefined) => DeclaredField | undefined;
|
|
16
|
+
/** What `node` holds in the field a path's first segment names: `pose`, `data`, or a declared field. */
|
|
17
|
+
export declare function nodeRoot(node: SceneNode<unknown, string, unknown>, head: string | undefined): unknown;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=declaredFields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declaredFields.d.ts","sourceRoot":"","sources":["../../../../src/components/inspector/SelectionPanel/declaredFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,sDAAsD;AACtD,UAAU,cAAc;IACtB,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC;IACjD,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,CAAC;CACrD;AAED;qFACqF;AACrF,UAAU,aAAa;IACrB,KAAK,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CAChE;AASD,wEAAwE;AACxE,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,GAAG,SAAS,KAAG,aAAa,GAAG,SAC1B,CAAC;AAEhD,wGAAwG;AACxG,wBAAgB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAIrG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/inspector/SelectionPanel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as nodeValueAt, r as sharedNodeValue, t as SelectionPanel } from "../../../chunks/SelectionPanel-Dz6_c0rd.js";
|
|
2
2
|
|
|
3
|
-
export { SelectionPanel,
|
|
3
|
+
export { SelectionPanel, nodeValueAt, sharedNodeValue };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AnyNode } from '@weasel-js/core';
|
|
2
|
+
import { type Mixed } from '@weasel-js/ui/components/PanelCells';
|
|
3
|
+
/** A scene node of any data, layer, and pose. */
|
|
4
|
+
export type { AnyNode };
|
|
5
|
+
/** Read a node value at a dotted path of any depth (`pose.x`,
|
|
6
|
+
* `data.style.fontSize`, `data.style.fill.paint.color`), or at a field the
|
|
7
|
+
* node declares for its children (`clip`, `units.unit`). Returns `undefined`
|
|
8
|
+
* for a bare `pose` or `data` (mirrors `commit`'s no-op on a malformed schema
|
|
9
|
+
* key) or if any intermediate segment is missing or not an object. */
|
|
10
|
+
export declare function nodeValueAt(node: AnyNode, path: string): unknown;
|
|
11
|
+
/** A path's value shared across nodes, or `MIXED`. A node
|
|
12
|
+
* holding nothing there reads as `absent`. */
|
|
13
|
+
export declare function sharedNodeValue(nodes: readonly AnyNode[], path: string, absent?: unknown): unknown | Mixed;
|
|
14
|
+
//# sourceMappingURL=nodeModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodeModel.d.ts","sourceRoot":"","sources":["../../../../src/components/inspector/SelectionPanel/nodeModel.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAG9E,iDAAiD;AACjD,YAAY,EAAE,OAAO,EAAE,CAAC;AAExB;;;;uEAIuE;AACvE,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAUhE;AAED;+CAC+C;AAC/C,wBAAgB,eAAe,CAC7B,KAAK,EAAE,SAAS,OAAO,EAAE,EACzB,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,GAAG,KAAK,CAOjB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { UnitScope } from '@weasel-js/quantity';
|
|
2
|
+
import { type ScopedScene } from '@weasel-js/core';
|
|
3
|
+
import { type PanelSection } from '@weasel-js/ui/components/PanelCells';
|
|
4
|
+
import type { AnyNode } from './nodeModel.js';
|
|
5
|
+
/** `sections` with every leaf read where `nodes` sit under `root`: the scopes they share. */
|
|
6
|
+
export declare function sectionsInScopes(sections: PanelSection[], scene: ScopedScene, nodes: readonly AnyNode[], root: UnitScope | undefined): PanelSection[];
|
|
7
|
+
//# sourceMappingURL=scopes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scopes.d.ts","sourceRoot":"","sources":["../../../../src/components/inspector/SelectionPanel/scopes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAmC,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEpF,OAAO,EAAkC,KAAK,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACxG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,6FAA6F;AAC7F,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,GAAG,SAAS,GACnG,YAAY,EAAE,CAQhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.gen.d.ts","sourceRoot":"","sources":["../src/icons.gen.ts"],"names":[],"mappings":"AAIA,yGAAyG;AACzG,eAAO,MAAM,IAAI,4FAAiC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './components/inspector/AnchorFields/index.js';
|
|
2
|
+
export * from './components/inspector/CharacterOptions/index.js';
|
|
3
|
+
export * from './components/inspector/SelectionPanel/index.js';
|
|
4
|
+
export * from './components/PlotDataPanel/index.js';
|
|
5
|
+
export * from './components/Rulers/index.js';
|
|
6
|
+
export * from './components/SceneGradientHandles/index.js';
|
|
7
|
+
export * from './components/SceneLayerList/index.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,qCAAqC,CAAC;AACpD,cAAc,yCAAyC,CAAC;AACxD,cAAc,uCAAuC,CAAC;AACtD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as AnchorFields } from "./chunks/AnchorFields-Cam1xwpt.js";
|
|
2
|
-
import { n as isCharacterChrome, r as CHARACTER_OPTIONS, t as CharacterOptions } from "./chunks/CharacterOptions-
|
|
3
|
-
import {
|
|
4
|
-
import { n as PlotTableView, t as PlotDataPanel } from "./chunks/PlotDataPanel-
|
|
2
|
+
import { n as isCharacterChrome, r as CHARACTER_OPTIONS, t as CharacterOptions } from "./chunks/CharacterOptions-CSqKZvwS.js";
|
|
3
|
+
import { n as nodeValueAt, r as sharedNodeValue, t as SelectionPanel } from "./chunks/SelectionPanel-Dz6_c0rd.js";
|
|
4
|
+
import { n as PlotTableView, t as PlotDataPanel } from "./chunks/PlotDataPanel-uHdh4X0l.js";
|
|
5
5
|
import { t as Rulers } from "./chunks/Rulers-hkPFdPkH.js";
|
|
6
|
-
import { t as SceneGradientHandles } from "./chunks/SceneGradientHandles-
|
|
7
|
-
import { n as useSceneLayerList, t as ANNOTATION_LAYER_ROW } from "./chunks/SceneLayerList-
|
|
6
|
+
import { t as SceneGradientHandles } from "./chunks/SceneGradientHandles-CcXyTVav.js";
|
|
7
|
+
import { n as useSceneLayerList, t as ANNOTATION_LAYER_ROW } from "./chunks/SceneLayerList-D2yc3eIk.js";
|
|
8
8
|
|
|
9
|
-
export { ANNOTATION_LAYER_ROW, AnchorFields, CHARACTER_OPTIONS, CharacterOptions, PlotDataPanel, PlotTableView, Rulers, SceneGradientHandles, SelectionPanel,
|
|
9
|
+
export { ANNOTATION_LAYER_ROW, AnchorFields, CHARACTER_OPTIONS, CharacterOptions, PlotDataPanel, PlotTableView, Rulers, SceneGradientHandles, SelectionPanel, isCharacterChrome, nodeValueAt, sharedNodeValue, useSceneLayerList };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IconTable } from '@weasel-js/icons';
|
|
2
|
+
/** Core's, editing's, the shapes', the paint kinds' and ui's icon tables, whole: for a registry that should hold every kit glyph, such as a workshop's or a test's. */
|
|
3
|
+
export declare const kitIcons: readonly IconTable[];
|
|
4
|
+
//# sourceMappingURL=kitIcons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kitIcons.d.ts","sourceRoot":"","sources":["../src/kitIcons.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAKlD,uKAAuK;AACvK,eAAO,MAAM,QAAQ,EAAE,SAAS,SAAS,EAAmE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weasel-js/ui-canvas",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "The ui components bound to a weasel canvas: the selection inspector and its anchor and character fields, scene-bound layer lists and gradient handles, rulers, the plot data panel, and every kit icon table at once.",
|
|
5
5
|
"weasel": {
|
|
6
6
|
"tier": "plugin"
|
|
@@ -34,25 +34,24 @@
|
|
|
34
34
|
"./package.json": "./package.json"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@weasel-js/geom": "
|
|
38
|
-
"@weasel-js/
|
|
39
|
-
"@weasel-js/
|
|
40
|
-
"@weasel-js/
|
|
41
|
-
"@weasel-js/
|
|
42
|
-
"@weasel-js/
|
|
43
|
-
"@weasel-js/
|
|
44
|
-
"@weasel-js/
|
|
45
|
-
"@weasel-js/
|
|
46
|
-
"@weasel-js/
|
|
47
|
-
"@weasel-js/
|
|
48
|
-
"@weasel-js/
|
|
49
|
-
"@weasel-js/
|
|
50
|
-
"@weasel-js/text": "1.19.1",
|
|
51
|
-
"@weasel-js/ui": "1.19.1"
|
|
37
|
+
"@weasel-js/geom": "2.0.0",
|
|
38
|
+
"@weasel-js/icons": "2.0.0",
|
|
39
|
+
"@weasel-js/paint": "2.0.0",
|
|
40
|
+
"@weasel-js/paint-kinds": "2.0.0",
|
|
41
|
+
"@weasel-js/plot": "2.0.0",
|
|
42
|
+
"@weasel-js/prefs": "2.0.0",
|
|
43
|
+
"@weasel-js/quantity": "2.0.0",
|
|
44
|
+
"@weasel-js/react": "2.0.0",
|
|
45
|
+
"@weasel-js/registry": "2.0.0",
|
|
46
|
+
"@weasel-js/renderer": "2.0.0",
|
|
47
|
+
"@weasel-js/routing": "2.0.0",
|
|
48
|
+
"@weasel-js/text": "2.0.0",
|
|
49
|
+
"@weasel-js/ui": "2.0.0"
|
|
52
50
|
},
|
|
53
51
|
"peerDependencies": {
|
|
54
|
-
"@weasel-js/core": "
|
|
55
|
-
"@weasel-js/editing": "
|
|
52
|
+
"@weasel-js/core": "2.0.0",
|
|
53
|
+
"@weasel-js/editing": "2.0.0",
|
|
54
|
+
"@weasel-js/guides": "2.0.0",
|
|
56
55
|
"react": ">=18",
|
|
57
56
|
"react-dom": ">=18"
|
|
58
57
|
},
|
|
@@ -81,5 +80,8 @@
|
|
|
81
80
|
"publishConfig": {
|
|
82
81
|
"access": "public",
|
|
83
82
|
"provenance": true
|
|
83
|
+
},
|
|
84
|
+
"devDependencies": {
|
|
85
|
+
"@weasel-js/history": "2.0.0"
|
|
84
86
|
}
|
|
85
87
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CharacterOptions-BcT_lWjg.js","names":[],"sources":["../../src/components/inspector/CharacterOptions/characterSchema.ts","../../src/components/inspector/CharacterOptions/CharacterOptions.tsx"],"sourcesContent":["/** The schema {@link CharacterOptions} draws: one control per `StyledRun` field a range takes. */\nimport type { IconRef } from '@weasel-js/icons';\nimport type { PrefGroup } from '@weasel-js/prefs';\nimport { icon } from '../../../icons.gen';\n\n/** Both script primitives are fractions of the inherited size, so both read\n * as percentages. A tenth of a point shows because the field snaps the\n * *displayed* value to its step, and a coarser one would render a\n * superscript's 58.3% as 60% and commit that on the next edit. */\nconst PERCENT = { scale: 0.01, precision: 1, suffix: '%' };\n\n/** A run flag: on or off per character, drawn as one segment of a bar. */\nconst flag = (name: string, glyph: IconRef) =>\n ({\n kind: 'boolean',\n name,\n description: `${name} for the characters in the range.`,\n icon: glyph,\n control: 'toggle',\n default: false,\n }) as const;\n\n/**\n * The character controls for a caret range — the character half of text\n * styling, against the node-level Character group a selection shows.\n *\n * Keyed by {@link StyledRun} field, so a host reads values out of a\n * `RangeStyle` and writes a `RunStylePatch` back with no name mapping of its\n * own. `script` is a preset over `baselineShift` and `fontScale`, so all three\n * are here and naming either primitive overrides that half. `noFill` is the one\n * key that is not a field: on, it is `fill: null`.\n */\nexport const CHARACTER_OPTIONS = {\n name: 'Text',\n description: 'Character styling for the selected range.',\n children: {\n bold: {\n ...flag('Bold', icon('core:bold')),\n pair: { with: ['italic', 'underline', 'strikethrough', 'overline'], label: 'Character style' },\n },\n italic: flag('Italic', icon('core:italic')),\n underline: flag('Underline', icon('core:underline')),\n strikethrough: flag('Strikethrough', icon('core:strikethrough')),\n overline: flag('Overline', icon('core:overline')),\n // Clearable: the two values are exclusive *and* absent is a third state,\n // so clicking the lit segment turns the script off.\n script: {\n kind: 'enum',\n name: 'Script',\n description: 'Raise or lower the range off the baseline, at a smaller size.',\n control: 'toggle',\n clearable: true,\n default: undefined,\n options: [\n { value: 'super', label: 'Superscript', icon: icon('core:superscript') },\n { value: 'sub', label: 'Subscript', icon: icon('core:subscript') },\n ],\n },\n textTransform: {\n kind: 'enum',\n name: 'Case',\n description: 'Draw the range in capitals, lowercase or title case. The text itself is unchanged.',\n control: 'toggle',\n default: 'none',\n options: [{ value: 'none', label: 'None', short: ['–'] }, { value: 'uppercase', label: 'Uppercase', short: ['AA'] }, { value: 'lowercase', label: 'Lowercase', short: ['aa'] }, { value: 'capitalize', label: 'Capitalize', short: ['Aa'] }],\n },\n fontVariantCaps: {\n kind: 'enum',\n name: 'Small caps',\n description: 'Draw lowercase letters in the range as smaller capitals. The text itself is unchanged.',\n control: 'toggle',\n default: 'normal',\n options: [{ value: 'normal', label: 'Normal', short: ['–'] }, { value: 'small-caps', label: 'Small caps', short: ['Sc'] }],\n },\n fontFamily: {\n kind: 'font-family',\n name: 'Font',\n description: 'Typeface for the range.',\n default: undefined,\n },\n // Listed from the weights the range's family has registered. Bold is a\n // preset over it: toggling Bold clears it, picking one clears Bold.\n fontWeight: {\n kind: 'font-weight',\n name: 'Weight',\n description: 'Weight of the range, from the faces its family has.',\n default: undefined,\n },\n fontSize: { kind: 'number', name: 'Size', description: 'Type size.', min: 1, step: 1, default: 16 },\n letterSpacing: {\n kind: 'number',\n name: 'Tracking',\n // The typographic term, short enough for a strip; `name` stays the\n // accessible one.\n short: ['VA'],\n description: 'Space added between characters.',\n step: 0.1,\n default: 0,\n },\n baselineShift: {\n kind: 'number',\n name: 'Baseline shift',\n short: ['Shift'],\n description: 'Raise or lower the range, in ems of the inherited size.',\n step: 0.001,\n unit: PERCENT,\n default: 0,\n },\n fontScale: {\n kind: 'number',\n name: 'Scale',\n description: 'Size of the range against the inherited size.',\n min: 0.01,\n step: 0.001,\n unit: PERCENT,\n default: 1,\n },\n fill: {\n kind: 'color',\n name: 'Color',\n description: 'Ink for the range.',\n alpha: true,\n default: '#000000',\n },\n noFill: {\n kind: 'boolean',\n name: 'No fill',\n description: 'Draw the range with no fill.',\n icon: icon('paint-kinds:none'),\n control: 'toggle',\n default: false,\n },\n },\n} satisfies PrefGroup;\n","/**\n * Character controls for a text edit in progress: the adapter between the\n * `CHARACTER_OPTIONS` schema and a range — a `RangeStyle` in, a\n * `RunStylePatch` out. Whether the patch lands on the runs under a selection\n * or is armed for the next character typed at a collapsed caret is the caller's.\n *\n * `MIXED` becomes a path in the bar's `mixed` set, so each control shows its\n * own indeterminate presentation.\n */\nimport { isSolidPaint, resolveFill, resolveScreenLength, type ScreenLength } from '@weasel-js/paint';\nimport { MIXED } from '@weasel-js/registry';\nimport { numericWeight, SCRIPT_METRICS, scriptMetricsFor } from '@weasel-js/text';\nimport { CHARACTER_OPTIONS } from './characterSchema';\nimport type { RangeStyle, RunStylePatch, StyledRun } from '@weasel-js/text';\nimport { ToolOptionsBar } from '@weasel-js/ui/components/ToolOptionsBar';\nimport type { ReactNode } from 'react';\n\n/** Props for {@link CharacterOptions}. */\nexport interface CharacterOptionsProps {\n /** Styling to display. `MIXED` at a key means the sources disagree there.\n * Absent or `null` renders no bar, unless `children` gives it a tenant. */\n style?: RangeStyle | null;\n /** Apply a styling change. One call per completed edit. */\n onPatch: (patch: RunStylePatch) => void;\n /** Tenants of the bar that are not character styling, e.g. loupe controls. */\n children?: ReactNode;\n className?: string;\n}\n\nconst CHROME_CLASS = 'wzl-character-options';\n\n/**\n * Is `el` part of a `CharacterOptions` bar, or of a kit popover one of its\n * controls opened? Pass it as `useTextEdit`'s `isEditorChrome`, so using the\n * bar does not end the edit it styles.\n */\nexport function isCharacterChrome(el: Element): boolean {\n // A popover renders in a portal under <body>, outside the bar's subtree.\n return el.closest(`.${CHROME_CLASS}, [data-weasel-overlay]`) !== null;\n}\n\n/** The keys the schema draws, in the order it declares them. */\ntype StyleKey = keyof typeof CHARACTER_OPTIONS.children;\n\n/**\n * The strip of character controls for a text edit in progress. Wire it to\n * `useTextEdit`: `style` takes `effectiveStyle`, `onPatch` takes\n * `applyStyleToSelection`, and {@link isCharacterChrome} goes in as\n * `isEditorChrome`.\n */\nexport function CharacterOptions({ style, onPatch, children, className }: CharacterOptionsProps) {\n const editing = style != null;\n return (\n <ToolOptionsBar\n className={className ? `${CHROME_CLASS} ${className}` : CHROME_CLASS}\n label={editing ? 'Text' : undefined}\n schema={editing ? CHARACTER_OPTIONS : undefined}\n values={editing ? characterValues(style) : undefined}\n mixed={editing ? characterMixed(style) : undefined}\n onChange={(path, value) => onPatch(characterPatch(path, value))}\n >\n {children}\n </ToolOptionsBar>\n );\n}\n\n/** One control's edit as a run patch. Only `fill` needs shaping: the schema\n * draws a color and a chip for none, and a run's fill is a record holding\n * a `Paint`, or `null`. Turning the chip off fills with the color the field shows beside it. */\nfunction characterPatch(path: string, value: unknown): RunStylePatch {\n if (path === 'fill') return { fill: { paint: { color: value as string } } satisfies StyledRun['fill'] };\n if (path === 'noFill') {\n return { fill: value === true ? null : { paint: { color: CHARACTER_OPTIONS.children.fill.default } } };\n }\n return { [path]: value } as RunStylePatch;\n}\n\n/**\n * A range's styling as the bar's value map.\n *\n * Sizes are `ScreenLength`, and the strip edits world units, so a `{ px }`\n * size shows its pixel count and commits back as a plain number — editing one\n * converts it. `script` is a preset over `baselineShift` / `fontScale`, so a\n * range that names it and not them shows the preset's shift and scale, as\n * `resolveRuns` does.\n */\nfunction characterValues(style: RangeStyle): Record<string, unknown> {\n const script = style.script;\n const preset = script === 'super' || script === 'sub' ? scriptPresets(style)[script] : undefined;\n return {\n ...pick(style),\n fontSize: worldSize(style.fontSize),\n letterSpacing: worldSize(style.letterSpacing),\n baselineShift: style.baselineShift ?? preset?.shift,\n fontScale: style.fontScale ?? preset?.size,\n fill: solidFill(style.fill),\n noFill: style.fill !== MIXED && resolveFill(style.fill) === null,\n };\n}\n\n/** The presets the range's face gives `script` — the kit defaults when the\n * range spans more than one family, since no single face then applies. */\nfunction scriptPresets(style: RangeStyle): typeof SCRIPT_METRICS {\n if (typeof style.fontFamily !== 'string') return SCRIPT_METRICS;\n const weight = style.fontWeight !== undefined && style.fontWeight !== MIXED\n ? numericWeight(style.fontWeight)\n : style.bold === true ? 700 : 400;\n return scriptMetricsFor(style.fontFamily, weight, style.italic === true ? 'italic' : 'normal');\n}\n\n/** The paths whose sources disagree — every `MIXED` key, plus a fill with no\n * single color to show. */\nfunction characterMixed(style: RangeStyle): Set<string> {\n const out = new Set<string>();\n for (const key of Object.keys(CHARACTER_OPTIONS.children) as StyleKey[]) {\n if (style[key as keyof RangeStyle] === MIXED) out.add(key);\n }\n // A gradient or pattern fill gets the same indeterminate treatment as a\n // mixed range, rather than a swatch claiming the text is some solid color.\n // The tag is checked as well as the key: a tile paint carries a `color` too.\n const fill = style.fill;\n if (fill !== MIXED && resolveFill(fill) !== null && solidFill(fill) === undefined) out.add('fill');\n return out;\n}\n\n/** Every key the schema draws that the range carries as-is. */\nfunction pick(style: RangeStyle): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const key of Object.keys(CHARACTER_OPTIONS.children) as StyleKey[]) {\n const v = style[key as keyof RangeStyle];\n if (v !== undefined && v !== MIXED) out[key] = v;\n }\n return out;\n}\n\nfunction solidFill(fill: RangeStyle['fill']): string | undefined {\n if (fill === MIXED) return undefined;\n const paint = resolveFill(fill)?.paint;\n return isSolidPaint(paint) ? paint.color : undefined;\n}\n\nfunction worldSize(v: ScreenLength | typeof MIXED | undefined): number | undefined {\n return v === undefined || v === MIXED ? undefined : resolveScreenLength(v, 1);\n}\n"],"mappings":";;;;;;;;;;;AASA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU;AAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAA;AAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,CAAA;AAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA;AAAI,CAAA;;AAGzD,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CACzB;AACC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACN,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CA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AAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAoB,CAAA,CAAA,CAAG,CAAC,CAAA;AAC9E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlotDataPanel-DUNod3NJ.js","names":["s"],"sources":["../../src/components/PlotDataPanel/PlotDataPanel.module.css","../../src/components/PlotDataPanel/valueControl.ts","../../src/components/PlotDataPanel/rowIds.ts","../../src/components/PlotDataPanel/PlotTableView.tsx","../../src/components/PlotDataPanel/PlotDataPanel.tsx"],"sourcesContent":[".table {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: var(--wzl-space-2);\n /* A grid wider than its sidebar scrolls inside it rather than stretching the panel. */\n max-inline-size: 100%;\n overflow-x: auto;\n}\n\n.cell {\n min-inline-size: 4rem;\n inline-size: 100%;\n}\n\n.heading {\n font-size: var(--wzl-font-size-sm);\n font-weight: var(--wzl-font-weight-bold);\n color: var(--wzl-fg-muted);\n}\n\n.nested {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-3);\n padding-inline-start: var(--wzl-space-4);\n}\n\n.rowActions {\n display: inline-flex;\n align-items: center;\n gap: var(--wzl-space-1);\n}\n\n.add {\n align-self: flex-start;\n}\n","/** A plot schema field or cell as the props of the params control that edits it. */\nimport type { PlotValue, PlotValueType } from '@weasel-js/plot';\nimport type { PropertyControlProps } from '@weasel-js/ui/components/Properties';\n\n/** What a field or cell is, for its control: its type, whether it can be unset or only read, and its value. */\nexport interface ValueSpec {\n type: PlotValueType;\n value: PlotValue;\n optional?: boolean;\n readOnly?: boolean;\n}\n\n/** The props of the control for `spec`, reporting each committed value through `set`. */\nexport function valueControl(spec: ValueSpec, name: string, set: (value: PlotValue) => void): PropertyControlProps {\n const { type, value, optional, readOnly } = spec;\n const clear = optional ? () => set(undefined) : undefined;\n switch (type.kind) {\n case 'number':\n return {\n kind: 'number', name, readOnly, value: typeof value === 'number' ? value : undefined,\n min: type.min, max: type.max, step: type.step, onChange: set, onClear: clear,\n };\n case 'boolean':\n return { kind: 'boolean', name, readOnly, value: value === true, onChange: set };\n case 'enum':\n return {\n kind: 'enum', name, readOnly, value: typeof value === 'string' ? value : undefined,\n options: type.options.map((o) => ({ value: o, label: o })), onChange: set, onClear: clear,\n };\n case 'color':\n return { kind: 'color', name, readOnly, value: typeof value === 'string' ? value : undefined, onChange: set };\n case 'string':\n return {\n kind: 'string', name, readOnly, value: typeof value === 'string' ? value : undefined, placeholder: type.placeholder,\n onChange: (next) => set(next === '' && optional ? undefined : next),\n };\n }\n}\n","import type { PlotData } from '@weasel-js/plot';\nimport { useRef } from 'react';\n\n/** What an edit does to the rows' order: the ids before it, to the ids after. */\nexport type RowShift = (ids: readonly string[], fresh: () => string) => string[];\n\nexport const insertedAt = (at: number): RowShift => (ids, fresh) => [...ids.slice(0, at), fresh(), ...ids.slice(at)];\nexport const removedAt = (at: number): RowShift => (ids) => ids.filter((_, i) => i !== at);\nexport const movedTo = (from: number, to: number): RowShift => (ids) => {\n const next = ids.filter((_, i) => i !== from);\n next.splice(to, 0, ids[from]!);\n return next;\n};\n\n/**\n * An id for each of a table's `count` rows that stays with its item through the panel's own inserts, removals and\n * moves, so what a row holds open follows the item rather than its slot. `track` wraps an edit with what it does to\n * the order; the order shifts only once `data` comes back as that edit made it, so an edit the host drops shifts\n * nothing. A change from elsewhere keeps the ids by position.\n */\nexport function useRowIds(data: PlotData, count: number): {\n ids: readonly string[];\n track: (change: (d: PlotData) => PlotData, shift: RowShift) => (d: PlotData) => PlotData;\n} {\n const state = useRef({ ids: [] as string[], made: 0, seen: undefined as PlotData | undefined, pending: [] as { made: PlotData; shift: RowShift }[] });\n const s = state.current;\n const fresh = (): string => `row-${s.made++}`;\n if (s.seen !== data) {\n const mine = s.pending.find((p) => p.made === data);\n if (mine) s.ids = mine.shift(s.ids, fresh);\n s.pending = [];\n s.seen = data;\n }\n if (s.ids.length !== count) s.ids = Array.from({ length: count }, (_, i) => s.ids[i] ?? fresh());\n return {\n ids: s.ids,\n track: (change, shift) => (d) => {\n const made = change(d);\n s.pending.push({ made, shift });\n return made;\n },\n };\n}\n","import type { PlotData, PlotScope, PlotTable, PlotValue } from '@weasel-js/plot';\nimport type { ReactElement } from 'react';\nimport { Button, CLOSE_BUTTON_PROPS } from '@weasel-js/ui/components/Button';\nimport { DataGrid, type DataGridColumn } from '@weasel-js/ui/components/DataGrid';\nimport { PropertyControl } from '@weasel-js/ui/components/Properties';\nimport s from './PlotDataPanel.module.css';\nimport { valueControl } from './valueControl';\nimport { insertedAt, movedTo, removedAt, useRowIds } from './rowIds';\n\n/** Props for {@link PlotTableView}. */\nexport interface PlotTableViewProps {\n data: PlotData;\n table: PlotTable;\n scope: PlotScope;\n /** Proposes `next` as the chart's data, an edit named `label`. */\n edit: (next: (data: PlotData) => PlotData, label: string) => void;\n}\n\ninterface Row { id: string; index: number }\n\n/** One table of a plot schema as a grid of controls: a row per item, which can be added, removed, dragged into\n * another order, and opened onto the tables it holds. */\nexport function PlotTableView({ data, table, scope, edit }: PlotTableViewProps): ReactElement {\n const count = table.count(data, scope);\n const { ids, track } = useRowIds(data, count);\n const rows: Row[] = ids.map((id, index) => ({ id, index }));\n const rowName = (r: number) => table.rowLabel?.(data, scope, r) || `${table.item} ${r + 1}`;\n const columns: DataGridColumn<Row>[] = table.columns(data, scope).map((column) => ({\n id: column.key,\n header: column.label,\n sortable: false,\n numeric: column.type.kind === 'number',\n render: ({ index }) => {\n if (column.applies?.(data, scope, index) === false) return null;\n const spec = { ...column, value: column.get(data, scope, index) };\n const set = (value: PlotValue) => edit((d) => column.set(d, scope, index, value), `Edit ${column.label.toLowerCase()}`);\n return <PropertyControl {...valueControl(spec, `${column.label} of ${rowName(index)}`, set)} className={s.cell} />;\n },\n }));\n const { insert, remove } = table;\n if (insert || remove) {\n columns.push({\n id: '__row', header: '', sortable: false,\n render: ({ index }) => (\n <span className={s.rowActions}>\n {insert && (\n <Button\n size=\"sm\" variant=\"ghost\" aria-label={`Insert ${table.item} after ${rowName(index)}`}\n onClick={() => edit(track((d) => insert(d, scope, index + 1), insertedAt(index + 1)), `Add ${table.item}`)}\n >\n +\n </Button>\n )}\n {remove && (\n <Button {...CLOSE_BUTTON_PROPS} aria-label={`Remove ${rowName(index)}`} onClick={() => edit(track((d) => remove(d, scope, index), removedAt(index)), `Remove ${table.item}`)} />\n )}\n </span>\n ),\n });\n }\n const move = table.move;\n const children = table.children;\n return (\n <div className={s.table}>\n {scope.length > 0 && <div className={s.heading}>{table.label}</div>}\n <DataGrid<Row>\n rows={rows}\n columns={columns}\n rowLabel={(r) => rowName(r.index)}\n empty={`No ${table.label.toLowerCase()}`}\n onReorder={move && ((moved, target) => {\n const from = rows.findIndex((r) => r.id === moved[0]);\n const to = target > from ? target - 1 : target;\n if (from >= 0 && to !== from) edit(track((d) => move(d, scope, from, to), movedTo(from, to)), `Reorder ${table.label.toLowerCase()}`);\n })}\n renderDetail={children && (({ index }) => (\n <div className={s.nested}>\n {children.map((child) => (\n <PlotTableView key={child.key} data={data} table={child} scope={[...scope, index]} edit={edit} />\n ))}\n </div>\n ))}\n />\n {insert && (\n <Button size=\"sm\" variant=\"ghost\" className={s.add} onClick={() => edit(track((d) => insert(d, scope, table.count(d, scope)), insertedAt(count)), `Add ${table.item}`)}>\n {`Add ${table.item}`}\n </Button>\n )}\n </div>\n );\n}\n","import { plotSchemaOf, type PlotData, type PlotValue } from '@weasel-js/plot';\nimport { useState, type ReactElement } from 'react';\nimport { PropertyField, PropertyList, PropertyNote, PropertyPanel, Subpanel } from '@weasel-js/ui/components/Properties';\nimport { PlotTableView } from './PlotTableView';\nimport { valueControl } from './valueControl';\n\n/** Props for {@link PlotDataPanel}. */\nexport interface PlotDataPanelProps {\n /** The chart, any kind. */\n data: PlotData;\n /** The chart as an edit leaves it, and a name for the edit, for an undo entry. The panel holds no copy: show the\n * change by passing it back as `data`. */\n onChange: (next: PlotData, label: string) => void;\n /** Default `'Data'`. */\n title?: string;\n className?: string;\n}\n\n/**\n * Authors a chart's data, whatever its kind, from the kind's schema (`plotSchemaOf`): a row per field, and a grid\n * per table whose rows can be added, removed, reordered, and opened onto the tables they hold.\n */\nexport function PlotDataPanel({ data, onChange, title = 'Data', className }: PlotDataPanelProps): ReactElement {\n const [error, setError] = useState<string | null>(null);\n const schema = plotSchemaOf(data);\n const edit = (change: (d: PlotData) => PlotData, label: string) => {\n try {\n const next = change(data);\n setError(null);\n if (next !== data) onChange(next, label);\n } catch (e) {\n setError(e instanceof Error ? e.message : String(e));\n }\n };\n const fields = schema.fields.filter((f) => f.applies?.(data) !== false);\n return (\n <PropertyPanel title={title} className={className}>\n <PropertyList>\n {fields.map((field) => {\n const set = (value: PlotValue) => edit((d) => field.set(d, value), `Edit ${field.label.toLowerCase()}`);\n const control = valueControl({ ...field, value: field.get(data) }, field.label, set);\n return <PropertyField key={field.key} label={field.label} {...control} />;\n })}\n {error !== null && <PropertyNote>{error}</PropertyNote>}\n </PropertyList>\n {schema.tables.map((table) => (\n <Subpanel key={table.key} title={table.label}>\n <PlotTableView data={data} table={table} scope={[]} edit={edit} />\n </Subpanel>\n ))}\n </PropertyPanel>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;ACaA,SAAgB,aAAa,MAAiB,MAAc,KAAuD;CACjH,MAAM,EAAE,MAAM,OAAO,UAAU,aAAa;CAC5C,MAAM,QAAQ,iBAAiB,IAAI,MAAS,IAAI;CAChD,QAAQ,KAAK,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G,MAAM,UAAU,aAAa;IAAE,GAAG;IAAO,OAAO,MAAM,IAAI,IAAI;GAAE,GAAG,MAAM,OAAO,GAAG;GACnF,OAAO,oBAAC,eAAD;IAA+B,OAAO,MAAM;IAAO,GAAI;GAAU,GAA7C,MAAM,GAAuC;EAC1E,CAAC,GACA,UAAU,QAAQ,oBAAC,cAAD,EAAA,UAAe,MAAoB,CAAA,CAC1C,EAAA,CAAA,GACb,OAAO,OAAO,KAAK,UAClB,oBAAC,UAAD;GAA0B,OAAO,MAAM;GACrC,UAAA,oBAAC,eAAD;IAAqB;IAAa;IAAO,OAAO,CAAC;IAAS;GAAO,CAAA;EACzD,GAFK,MAAM,GAEX,CACX,CACY;;AAEnB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SceneGradientHandles-CHNSWx7U.js","names":[],"sources":["../../src/components/SceneGradientHandles/SceneGradientHandles.tsx"],"sourcesContent":["import { useLayoutEffect, useRef, type ReactElement, type RefObject } from 'react';\nimport { fillInPoseFrame, fillToBoundsFrame } from '@weasel-js/renderer';\nimport { isGradientPaint, resolveFill, resolveStroke, type Paint, type GradientPaint, type Stroke, type Fill, type Inherit } from '@weasel-js/paint';\nimport { useOngoingAction } from '@weasel-js/routing/react';\nimport type { View } from '@weasel-js/geom';\nimport { isMeshGradientPaint, type MeshGradientPaint } from '@weasel-js/renderer/mesh';\nimport {\n useNodeOverlayFrame,\n type RectPose,\n type Scene,\n} from '@weasel-js/core';\nimport { MeshHandles } from '@weasel-js/ui/components/MeshEditor';\nimport { GradientHandles } from '@weasel-js/ui/components/GradientEditor';\nimport type { PaintSlot } from '@weasel-js/paint';\nimport '@weasel-js/paint-kinds/mesh';\n\n/** What `SceneGradientHandles` reads off a node. Every field is optional, so\n * any richer app data shape satisfies it. */\nexport interface PaintedNodeData {\n fill?: Fill | Inherit | null;\n stroke?: Stroke | Inherit | null;\n}\n\n/** Props for {@link SceneGradientHandles}. */\nexport interface SceneGradientHandlesProps<\n TData extends PaintedNodeData,\n TLayer extends string,\n TPose extends RectPose,\n> {\n scene: Scene<TData, TLayer, TPose>;\n /** The element the overlay is positioned in. Must be the canvas's own box,\n * or the handles land somewhere other than the paint. */\n containerRef: RefObject<HTMLElement | null>;\n /** The node whose paint is being edited — usually the lone selected id. */\n nodeId: string | null | undefined;\n /** Which of the node's two paints these handles move. */\n slot: PaintSlot;\n /** Current viewport; a thunk is re-read per projection. See\n * `useNodeOverlayFrame`. */\n view?: View | (() => View);\n className?: string;\n}\n\n/**\n * Scene-aware paint handles: on-canvas geometry handles for the gradient in\n * one node's `fill` or `stroke` — `GradientHandles` for the three ramps,\n * `MeshHandles` for a mesh — committed through the `setFill` / `setStroke`\n * actions as a single undo entry per drag. A canceled drag cancels the action,\n * and so does unmounting the overlay while a handle is held.\n *\n * Renders nothing unless the targeted slot holds a gradient or a mesh. The\n * node stores its gradient in `units: 'bounds'`, fractions of its own box; the\n * handles get it resolved onto the box and every edit is normalized back on\n * the way out.\n */\nexport function SceneGradientHandles<\n TData extends PaintedNodeData,\n TLayer extends string,\n TPose extends RectPose,\n>(props: SceneGradientHandlesProps<TData, TLayer, TPose>): ReactElement | null {\n const { scene, containerRef, nodeId, slot, view, className } = props;\n const frame = useNodeOverlayFrame(scene, containerRef, nodeId, { view });\n const edit = useOngoingAction(slot === 'fill' ? 'setFill' : 'setStroke');\n // An edit is open here only while a handle is held, so one still open at unmount is a drag cut short, and\n // that is a cancel. `useOngoingAction` would commit it in its own cleanup, which this layout cleanup runs\n // ahead of; the handle's unmount cancel comes after both and must not open a second edit to cancel.\n const gone = useRef(false);\n useLayoutEffect(() => {\n gone.current = false;\n return () => {\n gone.current = true;\n edit.cancel();\n };\n }, [edit]);\n\n const paint = frame ? paintOf(scene, nodeId, slot) : null;\n if (!frame || !paint) return null;\n\n const dispatch = (next: Paint, phase: 'input' | 'commit'): void => {\n if (gone.current) return;\n const normalized = fillToBoundsFrame(next, frame.box);\n if (phase === 'commit') edit.commit({ paint: normalized });\n else edit.input({ paint: normalized });\n };\n const common = {\n toScreen: frame.toScreen,\n toLocal: frame.toLocal,\n width: frame.width,\n height: frame.height,\n className,\n onInput: (next: Paint) => dispatch(next, 'input'),\n onChange: (next: Paint) => dispatch(next, 'commit'),\n onCancel: () => edit.cancel(),\n };\n\n if (isGradientPaint(paint)) {\n return <GradientHandles value={fillInPoseFrame(paint, frame.box) as GradientPaint} {...common} />;\n }\n if (isMeshGradientPaint(paint)) {\n const resolved = fillInPoseFrame(paint, frame.box) as unknown as MeshGradientPaint;\n // Still in the bounds frame means the mesh kind has not loaded, and\n // handles drawn now would sit in fractions of the box.\n if (resolved.units === 'bounds') return null;\n return <MeshHandles value={resolved} {...common} />;\n }\n return null;\n}\n\nfunction paintOf<TData extends PaintedNodeData, TLayer extends string, TPose extends RectPose>(\n scene: Scene<TData, TLayer, TPose>,\n nodeId: string | null | undefined,\n slot: PaintSlot,\n): Paint | null | undefined {\n if (nodeId == null) return undefined;\n const data = (scene.nodes as ReadonlyMap<string, { data: TData }>).get(nodeId)?.data;\n if (!data) return undefined;\n // An inherited paint is its container's, and is edited there.\n return slot === 'fill' ? resolveFill(data.fill)?.paint : resolveStroke(data.stroke)?.paint;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAuDA,SAAgB,qBAId,OAA6E;CAC7E,MAAM,EAAE,OAAO,cAAc,QAAQ,MAAM,MAAM,cAAc;CAC/D,MAAM,QAAQ,oBAAoB,OAAO,cAAc,QAAQ,EAAE,KAAK,CAAC;CACvE,MAAM,OAAO,iBAAiB,SAAS,SAAS,YAAY,WAAW;CAIvE,MAAM,OAAO,OAAO,KAAK;CACzB,sBAAsB;EACpB,KAAK,UAAU;EACf,aAAa;GACX,KAAK,UAAU;GACf,KAAK,OAAO;EACd;CACF,GAAG,CAAC,IAAI,CAAC;CAET,MAAM,QAAQ,QAAQ,QAAQ,OAAO,QAAQ,IAAI,IAAI;CACrD,IAAI,CAAC,SAAS,CAAC,OAAO,OAAO;CAE7B,MAAM,YAAY,MAAa,UAAoC;EACjE,IAAI,KAAK,SAAS;EAClB,MAAM,aAAa,kBAAkB,MAAM,MAAM,GAAG;EACpD,IAAI,UAAU,UAAU,KAAK,OAAO,EAAE,OAAO,WAAW,CAAC;OACpD,KAAK,MAAM,EAAE,OAAO,WAAW,CAAC;CACvC;CACA,MAAM,SAAS;EACb,UAAU,MAAM;EAChB,SAAS,MAAM;EACf,OAAO,MAAM;EACb,QAAQ,MAAM;EACd;EACA,UAAU,SAAgB,SAAS,MAAM,OAAO;EAChD,WAAW,SAAgB,SAAS,MAAM,QAAQ;EAClD,gBAAgB,KAAK,OAAO;CAC9B;CAEA,IAAI,gBAAgB,KAAK,GACvB,OAAO,oBAAC,iBAAD;EAAiB,OAAO,gBAAgB,OAAO,MAAM,GAAG;EAAoB,GAAI;CAAS,CAAA;CAElG,IAAI,oBAAoB,KAAK,GAAG;EAC9B,MAAM,WAAW,gBAAgB,OAAO,MAAM,GAAG;EAGjD,IAAI,SAAS,UAAU,UAAU,OAAO;EACxC,OAAO,oBAAC,aAAD;GAAa,OAAO;GAAU,GAAI;EAAS,CAAA;CACpD;CACA,OAAO;AACT;AAEA,SAAS,QACP,OACA,QACA,MAC0B;CAC1B,IAAI,UAAU,MAAM,OAAO;CAC3B,MAAM,OAAQ,MAAM,MAA+C,IAAI,MAAM,CAAC,EAAE;CAChF,IAAI,CAAC,MAAM,OAAO;CAElB,OAAO,SAAS,SAAS,YAAY,KAAK,IAAI,CAAC,EAAE,QAAQ,cAAc,KAAK,MAAM,CAAC,EAAE;AACvF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SceneLayerList-DCYwqZkF.js","names":[],"sources":["../../src/components/SceneLayerList/useSceneLayerList.ts"],"sourcesContent":["import {\n asNodeId, createDeleteOp, createMoveToIndexOp, createReparentOp, createSetDataOp, createSetHiddenOp, createSetLockedOp,\n defaultCommitAdapter, dispatchApplyBatch, isAnnotationLayer, pageName, pageOfNode, pageRunOf, placedPagesOf,\n withoutPageStructure,\n} from '@weasel-js/core';\nimport type { NodeId, SelectionApi } from '@weasel-js/routing';\nimport type { Op } from '@weasel-js/history';\nimport type { Scene, SceneNode } from '@weasel-js/core';\nimport type { LayerListItem, LayerListProps } from '@weasel-js/ui/components/LayerList';\n\n/** The id prefix of an annotation layer's own row, which holds its nodes. */\nexport const ANNOTATION_LAYER_ROW = 'annotation-layer:';\n\n/** The annotation layer whose row `row` is, if it is one. */\nconst annotationLayerOf = (row: string | null): string | null =>\n row?.startsWith(ANNOTATION_LAYER_ROW) ? row.slice(ANNOTATION_LAYER_ROW.length) : null;\n\n/** How a {@link useSceneLayerList} list shows annotation layers. */\nexport interface SceneLayerListAnnotations {\n /** The picked annotation node, which reads as a selected row. */\n picked: string | null;\n /** Selecting an annotation row picks it; the content selection stays. */\n pick(id: string | null): void;\n /** The row label for annotation layer `layer`. Default: its id. */\n labelOf?(layer: string): string;\n}\n\n/** Arguments for {@link useSceneLayerList}. */\nexport interface UseSceneLayerListOptions<TData, TLayer extends string, TPose> {\n scene: Scene<TData, TLayer, TPose>;\n selection: SelectionApi;\n /** What the reorder op is dispatched against. Default: the scene itself, as one history entry. */\n adapter?: object;\n /** A row's content for a node: its label, a leading swatch or icon. Its\n * `visible` and `locked` come from the node's own flags. */\n itemFor: (node: SceneNode<TData, TLayer, TPose>) => Omit<LayerListItem, 'id' | 'children'>;\n /** The data a rename to `label` writes, which makes rows renamable. The\n * scene has no name of its own, so where one lives is the consumer's call. */\n rename?: (node: SceneNode<TData, TLayer, TPose>, label: string) => TData;\n /** Label of the reorder's history entry. Default `'Reorder'`. */\n label?: string;\n /** Given, each annotation layer (`isAnnotationLayer`) gets a row holding its\n * nodes, marked not printed: the layer can be hidden and locked, its nodes\n * picked and removed. Absent, annotations are left out of the list — the canvas still\n * draws them. */\n annotations?: SceneLayerListAnnotations;\n}\n\n/** Commits a toggle's `changes` as one history entry. An annotation layer's row toggles the layer through\n * `layerTo`, since a layer is no node and has no op. */\nfunction commitToggle<TLayer extends string>(\n commit: (ops: Op[], entry: string) => void,\n changes: Readonly<Record<string, boolean>>,\n layerTo: (layer: TLayer, on: boolean) => void,\n opOf: (id: string, on: boolean) => Op,\n [on, off, mixed]: readonly [string, string, string],\n): void {\n const ops = Object.entries(changes).flatMap(([id, to]) => {\n if (!id.startsWith(ANNOTATION_LAYER_ROW)) return [opOf(id, to)];\n layerTo(id.slice(ANNOTATION_LAYER_ROW.length) as TLayer, to);\n return [];\n });\n if (ops.length === 0) return;\n // The entry names the direction every row went, or `mixed` for an Alt-click that went both ways.\n const values = Object.values(changes);\n commit(ops, values.every(Boolean) ? on : values.some(Boolean) ? mixed : off);\n}\n\n/**\n * How many of `shown`, the siblings under `parent` a drag left behind, lie behind a drop at gap `at` of the list's\n * top level, where the page run's children are listed beside the other roots. A sibling is behind when its front-most\n * row there is at or past the gap; the run, whose rows are its children's, counts by the first of them.\n */\nfunction behindTopGap(\n childrenOf: (id: NodeId) => readonly NodeId[],\n roots: readonly NodeId[],\n run: NodeId | null,\n moved: ReadonlySet<string>,\n parent: string | null,\n shown: readonly NodeId[],\n at: number,\n): number {\n const owners: (NodeId | undefined)[] = [];\n for (const root of [...roots].reverse()) {\n if (root !== run) {\n if (!moved.has(root)) owners.push(parent === null ? root : undefined);\n continue;\n }\n for (const kid of [...childrenOf(root)].reverse()) {\n if (!moved.has(kid)) owners.push(parent === null ? root : parent === run ? kid : undefined);\n }\n }\n return shown.filter((id) => {\n const first = owners.indexOf(id);\n return first < 0 || first >= at;\n }).length;\n}\n\n/** The `<LayerList>` props `useSceneLayerList` answers. */\nexport type SceneLayerListProps = Required<Pick<LayerListProps, 'items' | 'selectedIds' | 'onSelectionChange' | 'onReorder' | 'canMove' | 'onVisibilityChange' | 'onLockChange'>>\n & Pick<LayerListProps, 'onRemove' | 'onRename'>;\n\n/**\n * The props that put a scene in a `<LayerList>`: a row per node, a container's\n * children nested under it, the front-most at the top, selection read from and\n * written to `selection`, a drag — among siblings or into another container —\n * dispatched as a `MoveToIndexOp`, and each row's visibility and lock toggling\n * the node's own (`setHidden` / `setLocked` ops), each click one undo step, an Alt-click's batch included.\n * Annotation layers are left out unless `annotations` says how to show them;\n * shown, an annotation moves only within its own layer's row.\n */\nexport function useSceneLayerList<TData, TLayer extends string, TPose>(\n args: UseSceneLayerListOptions<TData, TLayer, TPose>,\n): SceneLayerListProps {\n const { scene, selection, adapter, itemFor, rename, label = 'Reorder', annotations } = args;\n const annotationLayers = scene.layers.filter(isAnnotationLayer);\n const onAnnotation = new Set<string>(annotationLayers.map((l) => l.id));\n const isAnnotation = (id: string) => {\n const layer = scene.get(asNodeId(id))?.layer;\n return layer !== undefined && onAnnotation.has(layer);\n };\n const commit = (ops: Op[], entry: string) => {\n if (adapter) dispatchApplyBatch(adapter, ops, entry);\n else scene.applyBatch(ops, entry, defaultCommitAdapter(scene, selection.adapterMethods));\n };\n\n // A scene orders children back to front and the list front to back. Rebuilt\n // every render: the scene keeps its identity across a reorder, so a memo keyed\n // on it would serve the order from before. The page run lists as what it holds,\n // and a page as a fixed row of what is on it: pages are edited through the page API.\n const run = pageRunOf(scene);\n const pages = new Map(placedPagesOf(scene).map((page) => [page.id, page]));\n const build = (ids: readonly NodeId[], extra: Partial<LayerListItem>): LayerListItem[] =>\n [...ids].reverse().flatMap((id) => {\n const node = scene.get(id);\n if (!node) return [];\n const kids = scene.childrenOf(id);\n if (id === run) return build(kids, extra);\n const children = kids.length > 0 ? { children: build(kids, extra) } : {};\n const page = node.page === undefined ? undefined : pages.get(pageOfNode(scene, id)!);\n if (page !== undefined) return [{ id, label: pageName(page, page.index), fixed: true, ...children }];\n return [{\n ...itemFor(node), ...extra, id, visible: node.hidden !== true, locked: node.locked === true, ...children,\n }];\n });\n\n // The list's top level holds the run's children and the scene's own roots alike. A drag that stays there\n // keeps its parent; one brought up from inside a container goes to the run, or with the pasteboard on, the root.\n const topParent = (ids: readonly string[]): NodeId | null => {\n const from = scene.get(asNodeId(ids[0]!))?.parent ?? null;\n if (from === null || from === run) return from;\n if (run === null) return null;\n return scene.get(run)!.pageRun!.pasteboard === true ? null : run;\n };\n\n const content = build(scene.roots.filter((id) => !isAnnotation(id)), annotations ? { removable: false } : {});\n const annotationRows: LayerListItem[] = annotations\n ? [...annotationLayers].reverse().map((layer) => ({\n id: `${ANNOTATION_LAYER_ROW}${layer.id}`,\n label: annotations.labelOf?.(layer.id) ?? layer.id,\n nonPrinting: true,\n visible: layer.visible,\n locked: layer.locked,\n removable: false,\n renamable: false,\n children: build(scene.roots.filter((id) => scene.get(id)?.layer === layer.id), { nonPrinting: true }),\n }))\n : [];\n const picked = annotations?.picked ?? null;\n\n return {\n items: [...annotationRows, ...content],\n selectedIds: [...selection.current.map(String), ...(picked !== null ? [picked] : [])],\n onSelectionChange: (ids) => {\n const notes = ids.filter(isAnnotation);\n if (notes.length > 0) {\n annotations?.pick(notes.at(-1)!);\n return;\n }\n selection.set([...withoutPageStructure(scene, ids.filter((id) => !id.startsWith(ANNOTATION_LAYER_ROW)).map(asNodeId))]);\n },\n canMove: ({ ids, parentId }) => {\n if (ids.some((id) => id.startsWith(ANNOTATION_LAYER_ROW))) return false;\n const into = annotationLayerOf(parentId);\n return ids.every((id) => (isAnnotation(id) ? scene.get(asNodeId(id))?.layer === into : into === null));\n },\n onReorder: ({ ids, parentId, index }) => {\n // An annotation layer's row holds roots on that layer; it is no node of the scene.\n const layer = annotationLayerOf(parentId);\n const parent = layer !== null ? null : (parentId ?? topParent(ids));\n const moved = new Set(ids);\n const left = (parent === null ? scene.roots : scene.childrenOf(asNodeId(parent))).filter((id) => !moved.has(id));\n // `index` counts from the front among the rows the drag left behind, the annotation rows heading the top\n // level among them; the rows shown stand for the siblings of the list's own level.\n const shown = left.filter((id) => (layer !== null ? scene.get(id)?.layer === layer : !isAnnotation(id)));\n const at = parentId === null ? Math.max(0, index - annotationRows.length) : index;\n const back = parentId === null && layer === null\n ? behindTopGap((id) => scene.childrenOf(id), scene.roots.filter((id) => !isAnnotation(id)), run, moved, parent, shown, at)\n : Math.max(0, shown.length - at);\n const to = back < shown.length ? left.indexOf(shown[back]!) : shown.length > 0 ? left.indexOf(shown.at(-1)!) + 1 : left.length;\n // A node from another container joins this one first, back to front as the scene orders children.\n const joining = [...ids].reverse().flatMap((id) => {\n const from = scene.get(asNodeId(id))?.parent ?? null;\n return from === parent ? [] : [createReparentOp({ id, fromParentId: from, toParentId: parent })];\n });\n commit([...joining, createMoveToIndexOp({ ids, parentId: parent, index: to })], label);\n },\n onVisibilityChange: (changes) => commitToggle(commit, changes, (layer: TLayer, on) => scene.setLayerVisible(layer, on),\n (id, on) => createSetHiddenOp({ id, from: scene.get(asNodeId(id))?.hidden === true, to: !on }), ['Show', 'Hide', 'Show Only']),\n onLockChange: (changes) => commitToggle(commit, changes, (layer: TLayer, on) => scene.setLayerLocked(layer, on),\n (id, on) => createSetLockedOp({ id, from: scene.get(asNodeId(id))?.locked === true, to: on }), ['Lock', 'Unlock', 'Lock Only']),\n ...(rename ? {\n onRename: (id: string, to: string) => {\n const node = scene.get(asNodeId(id));\n if (node) commit([createSetDataOp({ id, from: node.data, to: rename(node, to) })], 'Rename');\n },\n } : {}),\n ...(annotations ? {\n onRemove: (id: string) => {\n const node = scene.get(asNodeId(id));\n if (!node || !isAnnotation(id)) return;\n const siblings = node.parent === null ? scene.roots : scene.childrenOf(node.parent);\n commit([createDeleteOp({ node, index: siblings.indexOf(node.id), label: 'Delete' })], 'Delete');\n if (annotations.picked === id) annotations.pick(null);\n },\n } : {}),\n };\n}\n"],"mappings":";;;;AAWA,IAAa,uBAAuB;;AAGpC,IAAM,qBAAqB,QACzB,KAAK,8BAA+B,IAAI,IAAI,MAAM,EAA2B,IAAI;;;AAmCnF,SAAS,aACP,QACA,SACA,SACA,MACA,CAAC,IAAI,KAAK,QACJ;CACN,MAAM,MAAM,OAAO,QAAQ,OAAO,CAAC,CAAC,SAAS,CAAC,IAAI,QAAQ;EACxD,IAAI,CAAC,GAAG,8BAA+B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AAO,kBAAkB;GAAE;GAAI,MAAM,MAAM,IAAI,SAAS,EAAE,CAAC,CAAC,EAAE,WAAW;GAAM,IAAI,CAAC;EAAG,CAAC,GAAG;GAAC;GAAQ;GAAQ;EAAW,CAAC;EAC/H,eAAe,YAAY,aAAa,QAAQ,UAAU,OAAe,OAAO,MAAM,eAAe,OAAO,EAAE,IAC3G,IAAI,OAAO,kBAAkB;GAAE;GAAI,MAAM,MAAM,IAAI,SAAS,EAAE,CAAC,CAAC,EAAE,WAAW;GAAM,IAAI;EAAG,CAAC,GAAG;GAAC;GAAQ;GAAU;EAAW,CAAC;EAChI,GAAI,SAAS,EACX,WAAW,IAAY,OAAe;GACpC,MAAM,OAAO,MAAM,IAAI,SAAS,EAAE,CAAC;GACnC,IAAI,MAAM,OAAO,CAAC,gBAAgB;IAAE;IAAI,MAAM,KAAK;IAAM,IAAI,OAAO,MAAM,EAAE;GAAE,CAAC,CAAC,GAAG,QAAQ;EAC7F,EACF,IAAI,CAAC;EACL,GAAI,cAAc,EAChB,WAAW,OAAe;GACxB,MAAM,OAAO,MAAM,IAAI,SAAS,EAAE,CAAC;GACnC,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,GAAG;GAChC,MAAM,WAAW,KAAK,WAAW,OAAO,MAAM,QAAQ,MAAM,WAAW,KAAK,MAAM;GAClF,OAAO,CAAC,eAAe;IAAE;IAAM,OAAO,SAAS,QAAQ,KAAK,EAAE;IAAG,OAAO;GAAS,CAAC,CAAC,GAAG,QAAQ;GAC9F,IAAI,YAAY,WAAW,IAAI,YAAY,KAAK,IAAI;EACtD,EACF,IAAI,CAAC;CACP;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectionPanel-n-dIMvQ2.js","names":["s","_Fragment"],"sources":["../../src/components/inspector/SelectionPanel/declaredFields.ts","../../src/components/inspector/SelectionPanel/nodeModel.ts","../../src/components/inspector/SelectionPanel/commitLeaf.ts","../../src/components/inspector/SelectionPanel/scopes.ts","../../src/components/inspector/SelectionPanel/SelectionPanel.module.css","../../src/components/inspector/SelectionPanel/SelectionPanel.tsx"],"sourcesContent":["import type { NodeId } from '@weasel-js/routing';\nimport type { NodeClip, SceneNode } from '@weasel-js/core';\nimport type { UnitScope } from '@weasel-js/quantity';\n\n/** The scene methods that record a declared field. */\ninterface DeclaredWrites {\n setClip(id: NodeId, clip: NodeClip | null): void;\n setUnits(id: NodeId, units: UnitScope | null): void;\n}\n\n/** A node's field that a schema key can name outright: what the node declares for its children, stored\n * beside `pose` and `data` and written through the scene method that records it. */\ninterface DeclaredField {\n write(scene: DeclaredWrites, id: NodeId, value: unknown): void;\n}\n\nconst DECLARED = {\n clip: { write: (scene, id, value) => scene.setClip(id, (value ?? null) as NodeClip | null) },\n units: { write: (scene, id, value) => scene.setUnits(id, (value ?? null) as UnitScope | null) },\n} as const satisfies Readonly<Record<string, DeclaredField>>;\n\nconst isDeclared = (head: string | undefined): head is keyof typeof DECLARED => head !== undefined && Object.hasOwn(DECLARED, head);\n\n/** The declared field a path's first segment names, if it names one. */\nexport const declaredField = (head: string | undefined): DeclaredField | undefined =>\n isDeclared(head) ? DECLARED[head] : undefined;\n\n/** What `node` holds in the field a path's first segment names: `pose`, `data`, or a declared field. */\nexport function nodeRoot(node: SceneNode<unknown, string, unknown>, head: string | undefined): unknown {\n if (head === 'pose') return node.pose;\n if (head === 'data') return node.data;\n return isDeclared(head) ? (node as unknown as Record<keyof typeof DECLARED, unknown>)[head] : undefined;\n}\n","// Scene nodes as panel records: a node's kind, and its value at a leaf's path.\n\nimport { routeKind, type AnyNode, type NodeRoutingEntry } from '@weasel-js/core';\nimport { sharedValue, type Mixed } from '@weasel-js/ui/components/PanelCells';\nimport { declaredField, nodeRoot } from './declaredFields';\n\n/** A scene node of any data, layer, and pose. */\nexport type { AnyNode };\n\n/** A node's routing kind under `routing`, as a canvas given the same table names it. A\n * container is `'group'` only when the table carries `groupNodeRouting`. */\nexport function classifyKind(\n node: AnyNode,\n routing: readonly NodeRoutingEntry[],\n): string {\n return routeKind(routing, node.data, node);\n}\n\n/** Read a node value at a dotted path of any depth (`pose.x`,\n * `data.style.fontSize`, `data.style.fill.paint.color`), or at a field the\n * node declares for its children (`clip`, `units.unit`). Returns `undefined`\n * for a bare `pose` or `data` (mirrors `commit`'s no-op on a malformed schema\n * key) or if any intermediate segment is missing or not an object. */\nexport function nodeValueAt(node: AnyNode, path: string): unknown {\n const segments = path.split('.');\n const head = segments[0];\n if (segments.length < 2 && !declaredField(head)) return undefined;\n let cursor: unknown = nodeRoot(node, head);\n for (let i = 1; i < segments.length; i++) {\n if (cursor == null || typeof cursor !== 'object' || !Object.hasOwn(cursor, segments[i]!)) return undefined;\n cursor = (cursor as Record<string, unknown>)[segments[i]!];\n }\n return cursor;\n}\n\n/** Aggregate a path across nodes: the shared value, or `MIXED`. A node\n * holding nothing there reads as `absent`. */\nexport function aggregateValue(\n nodes: readonly AnyNode[],\n path: string,\n absent?: unknown,\n): unknown | Mixed {\n return sharedValue(\n nodes.map((node) => {\n const held = nodeValueAt(node, path);\n return held === undefined ? absent : held;\n }),\n );\n}\n","import type { NodeId, SelectionApi } from '@weasel-js/routing';\nimport { asNodeId, type NodePropertiesEntry, type Scene } from '@weasel-js/core';\nimport { prefHoldsValue, prefStoredReset } from '@weasel-js/prefs';\nimport { isDev } from '@weasel-js/registry';\nimport { boundAt } from '@weasel-js/ui/components/PanelCells';\nimport { declaredField, nodeRoot } from './declaredFields';\nimport { nodeLeafValue, setAtPath, type PanelLeaf, type PanelPaintAbove, type PanelRecord } from '@weasel-js/ui/components/PanelCells';\nimport { nodeValueAt, type AnyNode } from './nodeModel';\nimport type { LeafWrites } from '@weasel-js/ui/components/PanelCells';\n\ntype Next = (prev: unknown) => unknown;\n\n/** The `settle` of the properties entry a node is edited under, if it has one. */\nexport type SettleOf = (node: AnyNode) => NodePropertiesEntry['settle'];\n\nconst NO_SETTLE: SettleOf = () => undefined;\n\n/** `node` as a panel reads it, with what an `'inherit'` paint on it takes when `paintAbove` is given and it has a\n * parent. */\nexport function nodeRecord(node: AnyNode, paintAbove?: (node: AnyNode) => PanelPaintAbove): PanelRecord {\n const valueAt = (path: string): unknown => nodeValueAt(node, path);\n return paintAbove && node.parent != null ? { valueAt, paintAbove: () => paintAbove(node) } : { valueAt };\n}\n\n/** Writes, into every node of `ids`, what `next` derives from the value that node holds at the leaf's path. */\nfunction writeLeaf<TData, TLayer extends string, TPose>(\n scene: Scene<TData, TLayer, TPose>,\n ids: readonly NodeId[],\n leaf: PanelLeaf,\n next: Next,\n settleOf: SettleOf,\n): void {\n const [head, ...rest] = leaf.path.split('.');\n for (const id of ids) {\n const node = scene.get(id);\n if (!node) continue;\n const held = nodeValueAt(node as AnyNode, leaf.path);\n const value = boundAt(leaf.leaf, nodeRecord(node as AnyNode), next(nodeLeafValue(leaf.leaf, held)), held);\n const declared = declaredField(head);\n if (declared) {\n const field = nodeRoot(node as AnyNode, head);\n const to = rest.length === 0 ? value : setAtPath((field ?? {}) as object, rest, value);\n if (to !== field) declared.write(scene, id, to);\n continue;\n }\n // `setAtPath` spreads plain objects/arrays down the schema path;\n // consumer `pose`/`data` are assumed plain-object-shaped along\n // that path (a class instance's prototype would be dropped by\n // the spread) — the `as TPose`/`as TData` casts below rely on it.\n const prev = { pose: node.pose as unknown, data: node.data as unknown };\n let written = head === 'pose'\n ? { pose: setAtPath(node.pose as object, rest, value) as unknown, data: prev.data }\n : head === 'data'\n ? { pose: prev.pose, data: setAtPath(node.data as object, rest, value) as unknown }\n : null;\n if (written === null) continue;\n const settle = settleOf(node as AnyNode);\n if (settle) written = settle(written, prev);\n if (written.pose !== prev.pose) scene.setPose(id, written.pose as TPose);\n if (written.data !== prev.data) scene.update(id, { data: written.data as TData });\n }\n}\n\nconst writable = (leaf: PanelLeaf): boolean =>\n /^(pose|data)\\../.test(leaf.path) || declaredField(leaf.path.split('.')[0]) !== undefined;\n\nconst warnedUnwritable = new Set<string>();\n\n/** Warn once per kind and path, in dev, of a value leaf that `kinds`' schemas key where no edit can land. */\nexport function warnUnwritable(kinds: readonly string[], leaves: readonly PanelLeaf[]): void {\n if (!isDev()) return;\n for (const leaf of leaves) {\n if (writable(leaf) || !prefHoldsValue(leaf.leaf)) continue;\n for (const kind of new Set(kinds)) {\n const key = `${kind}\\0${leaf.path}`;\n if (warnedUnwritable.has(key)) continue;\n warnedUnwritable.add(key);\n console.warn(`weasel: the properties schema of kind \"${kind}\" keys a field at \"${leaf.path}\", which SelectionPanel draws but cannot save. Key it under \"pose.\" or \"data.\" (such as \"data.${leaf.path}\"), or as a field a node declares (\"clip\", \"units\").`);\n }\n }\n}\n\n/**\n * Writes, into every selected node, what `next` derives from the value that\n * node holds at the leaf's path, as one labeled batch. A node whose properties\n * entry has a `settle` stores what that returns.\n */\nexport function commitLeaf<TData, TLayer extends string, TPose>(\n scene: Scene<TData, TLayer, TPose>,\n selection: Pick<SelectionApi, 'current'>,\n leaf: PanelLeaf,\n next: Next,\n settleOf: SettleOf = NO_SETTLE,\n): void {\n if (!writable(leaf)) return;\n const ids = selection.current.map(asNodeId);\n scene.batch(`Edit ${leaf.leaf.name}`, () => writeLeaf(scene, ids, leaf, next, settleOf));\n}\n\n/** What a node held before a draft wrote over it, and what the last draft left it holding. */\ninterface Held { pose: unknown; data: unknown; field: unknown; left?: Omit<Held, 'left'> }\n\nconst sameHeld = (a: Omit<Held, 'left'> | undefined, b: Omit<Held, 'left'>): boolean =>\n a !== undefined && a.pose === b.pose && a.data === b.data && a.field === b.field;\n\n/** The writes of one panel over `scene`. Keep one per panel: it holds what the drafts in flight wrote over. */\nexport function leafWrites<TData, TLayer extends string, TPose>(\n scene: Scene<TData, TLayer, TPose>,\n settleOf: SettleOf = NO_SETTLE,\n): LeafWrites {\n // By leaf path: the pose, data and declared field each node held before the first draft of the edit in flight.\n const drafted = new Map<string, Map<NodeId, Held>>();\n\n const restore = (leaf: PanelLeaf): void => {\n const before = drafted.get(leaf.path);\n if (!before) return;\n drafted.delete(leaf.path);\n scene.untracked(() => {\n for (const [id, held] of before) {\n const node = scene.get(id);\n const head = leaf.path.split('.')[0];\n // Only a draft still in flight is put back: a node changed since the last draft left it keeps that change.\n if (!node || !sameHeld(held.left, { pose: node.pose, data: node.data, field: nodeRoot(node as AnyNode, head) })) continue;\n if (node.pose !== held.pose) scene.setPose(id, held.pose as TPose);\n if (node.data !== held.data) scene.update(id, { data: held.data as TData });\n const field = declaredField(head);\n if (field && nodeRoot(node as AnyNode, head) !== held.field) field.write(scene, id, held.field);\n }\n });\n };\n\n return {\n reset: (selection, leaves, label) => {\n const ids = selection.current.map(asNodeId);\n const due = leaves.filter(writable);\n for (const leaf of due) restore(leaf);\n scene.batch(`Reset ${label}`, () => {\n for (const leaf of due) writeLeaf(scene, ids, leaf, () => prefStoredReset(leaf.leaf), settleOf);\n });\n },\n commit: (selection, leaf, next) => {\n // A batch records a write from what the document holds, so the drafts come out first.\n restore(leaf);\n commitLeaf(scene, selection, leaf, next, settleOf);\n },\n draft: (selection, leaf, next) => {\n if (!writable(leaf)) return;\n const ids = selection.current.map(asNodeId);\n const head = leaf.path.split('.')[0];\n const before = drafted.get(leaf.path) ?? new Map<NodeId, Held>();\n drafted.set(leaf.path, before);\n const now = (id: NodeId): Omit<Held, 'left'> | null => {\n const node = scene.get(id);\n return node ? { pose: node.pose, data: node.data, field: nodeRoot(node as AnyNode, head) } : null;\n };\n for (const id of ids) {\n const at = now(id);\n const held = before.get(id);\n // A node changed since the last draft left it starts an edit of its own: an edit that never committed\n // (a slider dragged back where it began fires no change) must not put back what it held before that.\n if (at && (!held || !sameHeld(held.left, at))) before.set(id, at);\n }\n scene.untracked(() => writeLeaf(scene, ids, leaf, next, settleOf));\n for (const id of ids) {\n const held = before.get(id);\n const at = now(id);\n if (held && at) held.left = at;\n }\n },\n };\n}\n","import type { UnitScope } from '@weasel-js/quantity';\nimport { asNodeId, sceneSharedUnitScopes, type ScopedScene } from '@weasel-js/core';\nimport { prefLeafInScopes } from '@weasel-js/prefs';\nimport { isPanelSection, type PanelItem, type PanelSection } from '@weasel-js/ui/components/PanelCells';\nimport type { AnyNode } from './nodeModel';\n\n/** `sections` with every leaf read where `nodes` sit under `root`: the scopes they share. */\nexport function sectionsInScopes(\n sections: PanelSection[], scene: ScopedScene, nodes: readonly AnyNode[], root: UnitScope | undefined,\n): PanelSection[] {\n if (!root || nodes.length === 0) return sections;\n const chain = sceneSharedUnitScopes(scene, nodes.map((n) => asNodeId(n.id)), root);\n const within = (item: PanelItem): PanelItem =>\n isPanelSection(item)\n ? { ...item, items: item.items.map(within) }\n : { ...item, leaves: item.leaves.map((l) => ({ ...l, leaf: prefLeafInScopes(l.leaf, chain) })) };\n return sections.map((section) => within(section) as PanelSection);\n}\n","/* A field's text is set at its row label's size. */\n.root {\n display: flex;\n flex-direction: column;\n font-size: var(--wzl-params-text-size, var(--wzl-font-size-sm));\n color: var(--wzl-fg);\n --wzl-field-font-size: var(--wzl-params-text-size, var(--wzl-font-size-sm));\n}\n\n.header {\n display: flex;\n align-items: baseline;\n gap: var(--wzl-space-4);\n padding: var(--wzl-space-4) 0;\n border-block-end: 1px solid var(--wzl-border);\n}\n\n.kind {\n font-weight: var(--wzl-font-weight-bold);\n font-size: var(--wzl-font-size);\n}\n\n.breakdown {\n font-size: var(--wzl-font-size-sm);\n opacity: 0.6;\n}\n","import { useMemo, useSyncExternalStore, type ReactNode } from 'react';\nimport type { SelectionApi } from '@weasel-js/routing';\nimport type { UnitScope } from '@weasel-js/quantity';\nimport { useLatest } from '@weasel-js/react';\nimport {\n asNodeId,\n nodeTraitsOf,\n paintAbove,\n type FeaturePreset,\n type NodePropertiesEntry,\n type NodeRoutingEntry,\n type Scene,\n} from '@weasel-js/core';\nimport { leafWrites, nodeRecord, warnUnwritable } from './commitLeaf';\nimport { panelSource } from '@weasel-js/ui/components/PanelCells';\nimport { PrefsSource } from '@weasel-js/ui/components/PrefsSource';\nimport type { LeafRenderer } from '@weasel-js/ui/components/PanelCells';\nimport { kindBreakdown, panelEntryOf, panelRowsOf } from '@weasel-js/ui/components/PanelCells';\nimport { classifyKind, type AnyNode } from './nodeModel';\nimport type { PrefGroup, PrefSection } from '@weasel-js/prefs';\nimport { conditionedSections } from '@weasel-js/ui/components/PanelCells';\nimport type { MarkHiddenProps } from '@weasel-js/ui/components/Prefs';\nimport { prefFieldChoices } from '@weasel-js/ui/components/Prefs';\nimport { useSelectedRow, type PrefSelectHow } from '@weasel-js/ui/components/Prefs';\nimport { useParamsPolicy } from '@weasel-js/ui/components/Prefs';\nimport type { PanelCellScope } from '@weasel-js/ui/components/PanelCells';\nimport { panelSections } from '@weasel-js/ui/components/PanelCells';\nimport { sectionsInScopes } from './scopes';\nimport { PanelMarksContext, panelMarkedPaths, type PanelMarks } from '@weasel-js/ui/components/PanelCells';\nimport s from './SelectionPanel.module.css';\nimport { holdScope, type HoldProps } from '@weasel-js/ui/components/Disabled';\nimport { compositeKey } from '@weasel-js/registry';\n\n\n\n/** Props for {@link SelectionPanel}. */\nexport interface SelectionPanelProps<TData, TLayer extends string, TPose> extends MarkHiddenProps, HoldProps {\n /** The scene handle (`useScene`). The panel subscribes itself, so it\n * re-renders on scene mutations regardless of parent renders. */\n scene: Scene<TData, TLayer, TPose>;\n /** Selection handle (`useSelection`): the nodes the panel edits. Only `current` is read. */\n selection: Pick<SelectionApi, 'current'>;\n /** The presets the canvas runs (`<SceneCanvas features>`): the routing and\n * properties their node kinds bring are read from them, ahead of\n * `routing` and `properties`, as `nodeTraitsOf` merges them. */\n features?: readonly FeaturePreset[];\n /** Properties-trait entries, e.g. core's `defaultNodeProperties` /\n * `inferredNodeProperties` (+ consumer extras). A later entry of a name\n * replaces an earlier one. Default `inferredNodeProperties`. Memoize or hoist. */\n properties?: readonly NodePropertiesEntry[];\n /** Routing-trait classifiers used to derive each node's kind — pass\n * the same list the canvas's `routing` prop takes. Default\n * `inferredNodeRouting`, as on the canvas. Memoize or hoist. */\n routing?: readonly NodeRoutingEntry[];\n /** Control overrides / app-defined kinds (PrefsForm-style). Keys are\n * leaf paths (`data.fill`, checked first) or leaf kinds (`color`).\n * A renderer returning `null` collapses its leaf (and the row, when\n * every leaf in it collapses). */\n renderers?: Record<string, LeafRenderer>;\n /**\n * The schema the properties schemas' `alias` leaves point into. Default:\n * each kind's own. A panel drawn from layouts of aliases into another\n * schema passes that other: each alias row is drawn as the leaf of it at\n * the alias's path, reads that path of every selected node and writes\n * there, and is hidden and disabled by that leaf's conditions as well as\n * its own. A `PrefGroup`'s keys are steps of the node path (`data`, then\n * `fill`); a `PrefSection`'s leaf keys are whole node paths. A condition\n * of a kind's own schema may read a setting of that one too: a path no\n * leaf of the kind holds is read there, as the panel reads a leaf of its\n * own: a node holding nothing at the path reads as the leaf's default\n * only where the leaf is `absentIsDefault`.\n */\n over?: PrefGroup | PrefSection;\n /** The scene's outermost unit scope. Given, a field whose leaf measures a\n * length shows it in the unit scopes the selected nodes share, through\n * `prefLeafInScopes`; what is typed is still stored in world units. */\n units?: UnitScope;\n /** Kind → header label. Default: capitalized kind name. */\n kindLabel?: (kind: string) => string;\n /** Rendered when the selection is empty. */\n emptyState?: ReactNode;\n /**\n * What to mark: a leaf by its key in the schema (`data.fill`), a field of\n * an object leaf under its leaf's (`data.stroke.width`), and a top-level\n * section drawn under a heading, as a tab, or as a panel by its own key.\n * Leaves a `pair` draws in one row share its mark.\n * Each time the last one changes the panel brings it into view, opening\n * the tab that holds it. A path the panel draws no row for marks the row\n * it lies inside, or nothing.\n */\n selected?: readonly string[];\n /** The reader pressed or focused into a row, reported as `selected` names\n * it: a paired row as its first leaf, and a section's heading, tab, or\n * panel as the section's key. `how.toggle` is true when Cmd or Ctrl was\n * held. A press on one of several marked rows is reported on its click. */\n onSelect?: (path: string, how: PrefSelectHow) => void;\n className?: string;\n}\n\nconst NO_MARKS: readonly string[] = [];\n\nconst defaultKindLabel = (kind: string): string =>\n kind.length === 0 ? kind : kind[0].toUpperCase() + kind.slice(1);\n\n/**\n * Pre-baked selection properties panel. Shows the selected nodes' kind\n * and the properties-trait schema for that kind; multi-selections show\n * the intersection of the kinds' schemas with per-field Mixed state.\n * Edits commit as one labeled `scene.batch` fan-out per gesture.\n */\nexport function SelectionPanel<TData, TLayer extends string, TPose>(\n props: SelectionPanelProps<TData, TLayer, TPose>,\n) {\n const {\n scene,\n selection,\n renderers,\n kindLabel = defaultKindLabel,\n emptyState = null,\n className,\n } = props;\n\n useSyncExternalStore(scene.subscribe, scene.getVersion, scene.getVersion);\n const { properties, routing } = useMemo(\n () => nodeTraitsOf(props.features, { routing: props.routing, properties: props.properties }),\n [props.features, props.routing, props.properties],\n );\n const traits = useLatest({ properties, routing });\n const writes = useMemo(\n () => leafWrites(scene, (node) =>\n panelEntryOf(traits.current.properties, classifyKind(node, traits.current.routing))?.settle),\n [scene, traits],\n );\n\n const nodes = selection.current\n .map((id) => scene.get(asNodeId(id)))\n .filter((n): n is NonNullable<typeof n> => n != null) as readonly AnyNode[];\n\n const kinds = nodes.map((n) => classifyKind(n, routing));\n const records = nodes.map((n) => nodeRecord(n, (node) => paintAbove(scene, node as never)));\n const selectionKey = compositeKey(nodes.map((n) => n.id));\n const scope = conditionedSections(kinds, properties, records, renderers?.alias !== undefined, props.markHidden === true, props.over);\n const sections = sectionsInScopes(scope.sections, scene, nodes, props.units);\n const panelLeaves = sections.flatMap(panelRowsOf).flatMap((row) => row.leaves);\n warnUnwritable(kinds, panelLeaves);\n const leaves = new Map(panelLeaves.map(({ path, leaf }) => [path, leaf] as const));\n const fields = prefFieldChoices({ name: '', members: Object.fromEntries(leaves) });\n const shown = panelMarkedPaths(sections, props.selected ?? NO_MARKS, renderers);\n const marks: PanelMarks = { selected: shown, lead: shown.at(-1) ?? null, ...(props.markHidden ? { hidden: scope.hidden } : {}) };\n const rowSelection = useSelectedRow(props.selected ?? NO_MARKS, marks.lead ?? null, props.onSelect);\n const { settles, textWaitMs } = useParamsPolicy('panel');\n\n if (nodes.length === 0) {\n return <div className={[s.root, className].filter(Boolean).join(' ')}>{emptyState}</div>;\n }\n\n const cells: PanelCellScope = {\n records,\n renderers,\n commit: (leaf, next) => writes.commit(selection, leaf, next),\n draft: (leaf, next) => writes.draft(selection, leaf, next),\n source: panelSource({\n records,\n leaves: panelLeaves,\n selection,\n writes,\n disabled: scope.disabled,\n hidden: scope.hidden,\n active: scope.active,\n }),\n selectionKey,\n fields,\n disabled: scope.disabled,\n active: scope.active,\n hidden: scope.hidden,\n entryAt: scope.entryAt,\n targets: scope.targets,\n settles,\n textWaitMs,\n };\n\n return (\n <PrefsSource source={cells.source}>\n <PanelMarksContext.Provider value={marks}>\n <div className={[s.root, className].filter(Boolean).join(' ')} {...rowSelection}>\n <header className={s.header}>\n {nodes.length === 1 ? (\n <span className={s.kind}>{kindLabel(kinds[0])}</span>\n ) : (\n <>\n <span className={s.kind}>{nodes.length} selected</span>\n <span className={s.breakdown}>{kindBreakdown(kinds)}</span>\n </>\n )}\n </header>\n {holdScope(props, panelSections(sections, cells, marks))}\n </div>\n </PanelMarksContext.Provider>\n </PrefsSource>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAgBA,IAAM,WAAW;CACf,MAAM,EAAE,QAAQ,OAAO,IAAI,UAAU,MAAM,QAAQ,IAAK,SAAS,IAAwB,EAAE;CAC3F,OAAO,EAAE,QAAQ,OAAO,IAAI,UAAU,MAAM,SAAS,IAAK,SAAS,IAAyB,EAAE;AAChG;AAEA,IAAM,cAAc,SAA4D,SAAS,UAAa,OAAO,OAAO,UAAU,IAAI;;AAGlI,IAAa,iBAAiB,SAC5B,WAAW,IAAI,IAAI,SAAS,QAAQ;;AAGtC,SAAgB,SAAS,MAA2C,MAAmC;CACrG,IAAI,SAAS,QAAQ,OAAO,KAAK;CACjC,IAAI,SAAS,QAAQ,OAAO,KAAK;CACjC,OAAO,WAAW,IAAI,IAAK,KAA2D,QAAQ;AAChG;;;;;ACrBA,SAAgB,aACd,MACA,SACQ;CACR,OAAO,UAAU,SAAS,KAAK,MAAM,IAAI;AAC3C;;;;;;A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