@pixerate/editor 0.162.1 → 0.164.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/README.md +1 -1
- package/dist/agent/index.cjs +34 -34
- package/dist/agent/index.js +5 -5
- package/dist/canvas/displacement.d.cts +34 -2
- package/dist/canvas/displacement.d.ts +34 -2
- package/dist/canvas/explosion-tools.d.cts +43 -0
- package/dist/canvas/explosion-tools.d.ts +43 -0
- package/dist/canvas/explosionLayout.d.cts +50 -0
- package/dist/canvas/explosionLayout.d.ts +50 -0
- package/dist/canvas/explosionState.d.cts +52 -0
- package/dist/canvas/explosionState.d.ts +52 -0
- package/dist/canvas/index.cjs +430 -88
- package/dist/canvas/index.d.cts +3 -0
- package/dist/canvas/index.d.ts +3 -0
- package/dist/canvas/index.js +425 -83
- package/dist/canvas/types.d.cts +27 -2
- package/dist/canvas/types.d.ts +27 -2
- package/dist/chart/commands.d.cts +2 -1
- package/dist/chart/commands.d.ts +2 -1
- package/dist/chart/controller.d.cts +109 -1
- package/dist/chart/controller.d.ts +109 -1
- package/dist/chart/index.cjs +605 -130
- package/dist/chart/index.d.cts +1 -0
- package/dist/chart/index.d.ts +1 -0
- package/dist/chart/index.js +490 -15
- package/dist/chart/layout-annotations.d.cts +29 -0
- package/dist/chart/layout-annotations.d.ts +29 -0
- package/dist/chart/layout-families.d.cts +23 -0
- package/dist/chart/layout-families.d.ts +23 -0
- package/dist/chart/mermaid.d.cts +2 -1
- package/dist/chart/mermaid.d.ts +2 -1
- package/dist/chart/schemas.d.cts +13 -0
- package/dist/chart/schemas.d.ts +13 -0
- package/dist/chart/spec.d.cts +30 -5
- package/dist/chart/spec.d.ts +30 -5
- package/dist/chart/stats.d.cts +9 -1
- package/dist/chart/stats.d.ts +9 -1
- package/dist/chart/tools.d.cts +1 -1
- package/dist/chart/tools.d.ts +1 -1
- package/dist/chart/tree.d.cts +62 -0
- package/dist/chart/tree.d.ts +62 -0
- package/dist/chart/types.d.cts +77 -3
- package/dist/chart/types.d.ts +77 -3
- package/dist/{chunk-7YBDRJXT.cjs → chunk-22KLZZGH.cjs} +8 -8
- package/dist/{chunk-HLOKB7WW.js → chunk-3NEZJCBY.js} +366 -6
- package/dist/{chunk-EVPZ5IKN.js → chunk-5FNGLV2D.js} +65 -3
- package/dist/{chunk-EQ46F75O.cjs → chunk-D54JHQK2.cjs} +51 -51
- package/dist/{chunk-NO5QQDHZ.js → chunk-DAPQGA55.js} +2 -2
- package/dist/{chunk-3IHNXRUV.cjs → chunk-GKNEJ6EN.cjs} +399 -67
- package/dist/{chunk-4NGVHHJB.cjs → chunk-NZD2MZJC.cjs} +80 -18
- package/dist/{chunk-CX6JLDFC.js → chunk-OXERWBKE.js} +3 -3
- package/dist/{chunk-7CKPUUN4.js → chunk-POR54B55.js} +61 -10
- package/dist/{chunk-LL3H5XUH.cjs → chunk-R3P2M7HU.cjs} +367 -7
- package/dist/{chunk-HDGBM7EA.cjs → chunk-SBQVEBSU.cjs} +580 -53
- package/dist/{chunk-XDCFJEU7.js → chunk-SZA42R4N.js} +346 -14
- package/dist/{chunk-GLMP22FT.js → chunk-TALQONZ5.js} +3 -3
- package/dist/{chunk-NA4UVVJ4.cjs → chunk-YGG7WDWT.cjs} +76 -25
- package/dist/{chunk-EY22AY6R.cjs → chunk-YSAGBIRW.cjs} +16 -16
- package/dist/{chunk-DTSTNRPH.js → chunk-Z4P2RBMJ.js} +536 -9
- package/dist/export/index.cjs +4 -4
- package/dist/export/index.js +3 -3
- package/dist/extensions/index.cjs +7 -7
- package/dist/extensions/index.js +6 -6
- package/dist/index.cjs +13 -13
- package/dist/index.js +7 -7
- package/dist/paint-editor/index.cjs +0 -20
- package/dist/paint-editor/index.js +0 -20
- package/package.json +1 -1
- package/skills/README.md +12 -0
- package/skills/pixerate-agent-tools/SKILL.md +34 -1
- package/skills/pixerate-canvas/SKILL.md +16 -0
- package/skills/pixerate-chart/SKILL.md +41 -9
- package/skills/pixerate-image-editor/SKILL.md +2 -0
- package/skills/pixerate-paint-editor/SKILL.md +2 -0
- package/skills/pixerate-tokens/SKILL.md +5 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Headless, framework-free state machine for canvas node explosion: which node is exploded,
|
|
3
|
+
* which is collapsing (children still mounted while a collapse animation plays), and the timer
|
|
4
|
+
* that ends the collapse. It never touches a graph or the DOM, so a declarative canvas can derive
|
|
5
|
+
* its nodes from it. The Svelte rune `createCanvasExplosionState` and the React hook
|
|
6
|
+
* `useCanvasExplosionState` wrap it.
|
|
7
|
+
*/
|
|
8
|
+
export interface CanvasExplosionStateOptions {
|
|
9
|
+
/** How long children stay rendered after a collapse starts, in ms. Default 380. `0` ends the collapse at once. */
|
|
10
|
+
collapseDurationMs?: number;
|
|
11
|
+
/** The node exploded at creation. Default none. */
|
|
12
|
+
initialActiveId?: string | null;
|
|
13
|
+
/** Called after a node explodes. */
|
|
14
|
+
onExplode?: (nodeId: string) => void;
|
|
15
|
+
/** Called when a node starts collapsing (including when exploding another node replaces it). */
|
|
16
|
+
onCollapse?: (nodeId: string) => void;
|
|
17
|
+
}
|
|
18
|
+
/** The state at one moment. A new object each time it changes, so it can be compared by identity. */
|
|
19
|
+
export interface CanvasExplosionStateSnapshot {
|
|
20
|
+
/** The exploded node, or null. */
|
|
21
|
+
readonly activeId: string | null;
|
|
22
|
+
/** The node whose collapse animation is playing, or null. */
|
|
23
|
+
readonly collapsingId: string | null;
|
|
24
|
+
}
|
|
25
|
+
export interface CanvasExplosionState extends CanvasExplosionStateSnapshot {
|
|
26
|
+
/** True while a node is exploded or collapsing (children are on screen). */
|
|
27
|
+
readonly isExplodingOrCollapsing: boolean;
|
|
28
|
+
isExploded: (nodeId: string) => boolean;
|
|
29
|
+
isCollapsing: (nodeId: string) => boolean;
|
|
30
|
+
/** True when the node's children should be rendered: it is exploded or still collapsing. */
|
|
31
|
+
shouldRenderChildren: (nodeId: string) => boolean;
|
|
32
|
+
/** Explodes a node, replacing (collapsing) any other exploded node. Returns false when it already was. */
|
|
33
|
+
explode: (nodeId: string) => boolean;
|
|
34
|
+
/** Collapses the exploded node (only if it is `nodeId`, when given). Returns false when nothing collapsed. */
|
|
35
|
+
collapse: (nodeId?: string) => boolean;
|
|
36
|
+
/** Collapses the node when it is exploded, otherwise explodes it. Returns true when it is now exploded. */
|
|
37
|
+
toggle: (nodeId: string) => boolean;
|
|
38
|
+
/** Ends a running collapse now (e.g. from an `animationend` handler) instead of waiting for the timer. */
|
|
39
|
+
finishCollapse: () => void;
|
|
40
|
+
/** Clears the collapse timer and listeners; later calls do nothing. */
|
|
41
|
+
destroy: () => void;
|
|
42
|
+
}
|
|
43
|
+
export interface CanvasExplosionStateController extends CanvasExplosionState {
|
|
44
|
+
/** The current state; the same object until something changes. */
|
|
45
|
+
getSnapshot: () => CanvasExplosionStateSnapshot;
|
|
46
|
+
/** Calls `listener` after every change; returns an unsubscribe function. */
|
|
47
|
+
subscribe: (listener: () => void) => () => void;
|
|
48
|
+
/** True after `destroy()`. */
|
|
49
|
+
readonly destroyed: boolean;
|
|
50
|
+
}
|
|
51
|
+
/** Creates the headless explosion state machine (see the module comment). */
|
|
52
|
+
export declare function createCanvasExplosionStateController(options?: CanvasExplosionStateOptions): CanvasExplosionStateController;
|