@pixerate/editor-react 0.50.0 → 0.52.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/canvas/index.cjs +490 -463
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +22 -3
- package/dist/canvas/index.d.ts +22 -3
- package/dist/canvas/index.js +74 -45
- package/dist/canvas/index.js.map +1 -1
- package/dist/video-editor/index.cjs +2 -1
- package/dist/video-editor/index.cjs.map +1 -1
- package/dist/video-editor/index.d.cts +2 -1
- package/dist/video-editor/index.d.ts +2 -1
- package/dist/video-editor/index.js +3 -1
- package/dist/video-editor/index.js.map +1 -1
- package/package.json +3 -3
package/dist/canvas/index.cjs
CHANGED
|
@@ -20,323 +20,324 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/canvas/index.ts
|
|
21
21
|
var canvas_exports = {};
|
|
22
22
|
__export(canvas_exports, {
|
|
23
|
-
ANIMATABLE_PROPERTIES: () =>
|
|
24
|
-
ANIMATION_DATA_KEY: () =>
|
|
25
|
-
ANIMATION_EASING_LABELS: () =>
|
|
26
|
-
ANIMATION_EASING_PRESETS: () =>
|
|
27
|
-
ANIMATION_TIME_EPSILON: () =>
|
|
28
|
-
AUTO_LAYOUT_DATA_KEY: () =>
|
|
23
|
+
ANIMATABLE_PROPERTIES: () => import_canvas31.ANIMATABLE_PROPERTIES,
|
|
24
|
+
ANIMATION_DATA_KEY: () => import_canvas31.ANIMATION_DATA_KEY,
|
|
25
|
+
ANIMATION_EASING_LABELS: () => import_canvas31.ANIMATION_EASING_LABELS,
|
|
26
|
+
ANIMATION_EASING_PRESETS: () => import_canvas31.ANIMATION_EASING_PRESETS,
|
|
27
|
+
ANIMATION_TIME_EPSILON: () => import_canvas31.ANIMATION_TIME_EPSILON,
|
|
28
|
+
AUTO_LAYOUT_DATA_KEY: () => import_canvas29.AUTO_LAYOUT_DATA_KEY,
|
|
29
29
|
AgentPresenceLayer: () => AgentPresenceLayer,
|
|
30
|
-
AnimationEditError: () =>
|
|
31
|
-
AnimationPlayer: () =>
|
|
30
|
+
AnimationEditError: () => import_canvas31.AnimationEditError,
|
|
31
|
+
AnimationPlayer: () => import_canvas31.AnimationPlayer,
|
|
32
32
|
AnimationTimeline: () => AnimationTimeline,
|
|
33
|
-
CANVAS_COMPONENT_DRAG_TYPE: () =>
|
|
34
|
-
CANVAS_GRADIENT_PRESETS: () =>
|
|
35
|
-
CANVAS_TOKEN_PROPERTIES: () =>
|
|
36
|
-
CHILD_LAYOUT_DATA_KEY: () =>
|
|
37
|
-
CONNECTION_LINE_TYPES: () =>
|
|
38
|
-
CSS_ANIMATION_PROPERTIES: () =>
|
|
39
|
-
CUBIC_BEZIER_PRESETS: () =>
|
|
33
|
+
CANVAS_COMPONENT_DRAG_TYPE: () => import_canvas32.CANVAS_COMPONENT_DRAG_TYPE,
|
|
34
|
+
CANVAS_GRADIENT_PRESETS: () => import_canvas32.CANVAS_GRADIENT_PRESETS,
|
|
35
|
+
CANVAS_TOKEN_PROPERTIES: () => import_canvas30.CANVAS_TOKEN_PROPERTIES,
|
|
36
|
+
CHILD_LAYOUT_DATA_KEY: () => import_canvas29.CHILD_LAYOUT_DATA_KEY,
|
|
37
|
+
CONNECTION_LINE_TYPES: () => import_canvas25.CONNECTION_LINE_TYPES,
|
|
38
|
+
CSS_ANIMATION_PROPERTIES: () => import_canvas31.CSS_ANIMATION_PROPERTIES,
|
|
39
|
+
CUBIC_BEZIER_PRESETS: () => import_canvas31.CUBIC_BEZIER_PRESETS,
|
|
40
40
|
CanvasComponentsPanel: () => CanvasComponentsPanel,
|
|
41
41
|
CanvasDrawLayer: () => CanvasDrawLayer,
|
|
42
42
|
CanvasGuidesLayer: () => CanvasGuidesLayer,
|
|
43
43
|
CanvasInstanceInspector: () => CanvasInstanceInspector,
|
|
44
|
-
CanvasScenesStore: () =>
|
|
45
|
-
DEFAULT_ARRANGE_SHORTCUTS: () =>
|
|
44
|
+
CanvasScenesStore: () => import_canvas25.CanvasScenesStore,
|
|
45
|
+
DEFAULT_ARRANGE_SHORTCUTS: () => import_canvas25.DEFAULT_ARRANGE_SHORTCUTS,
|
|
46
46
|
DiagramPresenceLayer: () => DiagramPresenceLayer,
|
|
47
|
-
MAX_KEYFRAME_REFS: () =>
|
|
48
|
-
ManualClock: () =>
|
|
47
|
+
MAX_KEYFRAME_REFS: () => import_canvas31.MAX_KEYFRAME_REFS,
|
|
48
|
+
ManualClock: () => import_canvas28.ManualClock,
|
|
49
49
|
MermaidDiagramGroup: () => MermaidDiagramGroup,
|
|
50
50
|
MermaidDiagramNode: () => MermaidDiagramNode,
|
|
51
51
|
MermaidFamilyScene: () => MermaidFamilyScene,
|
|
52
52
|
MermaidThumbnail: () => MermaidThumbnail,
|
|
53
|
-
RESIZE_HANDLES: () =>
|
|
54
|
-
SHAPE_DATA_KEY: () =>
|
|
55
|
-
SHAPE_KINDS: () =>
|
|
56
|
-
SHAPE_NODE_TYPE: () =>
|
|
57
|
-
SHAPE_OPERATIONS: () =>
|
|
53
|
+
RESIZE_HANDLES: () => import_canvas24.RESIZE_HANDLES,
|
|
54
|
+
SHAPE_DATA_KEY: () => import_canvas26.SHAPE_DATA_KEY,
|
|
55
|
+
SHAPE_KINDS: () => import_canvas26.SHAPE_KINDS,
|
|
56
|
+
SHAPE_NODE_TYPE: () => import_canvas26.SHAPE_NODE_TYPE,
|
|
57
|
+
SHAPE_OPERATIONS: () => import_canvas26.SHAPE_OPERATIONS,
|
|
58
58
|
ShapeNode: () => ShapeNode,
|
|
59
|
-
TOKEN_BINDINGS_DATA_KEY: () =>
|
|
60
|
-
TOKEN_MODES_DATA_KEY: () =>
|
|
59
|
+
TOKEN_BINDINGS_DATA_KEY: () => import_canvas30.TOKEN_BINDINGS_DATA_KEY,
|
|
60
|
+
TOKEN_MODES_DATA_KEY: () => import_canvas30.TOKEN_MODES_DATA_KEY,
|
|
61
61
|
TokenBindingPicker: () => TokenBindingPicker,
|
|
62
62
|
TokenModeSwitcher: () => TokenModeSwitcher,
|
|
63
|
-
addCanvasVariant: () =>
|
|
64
|
-
addKeyframesAtTime: () =>
|
|
65
|
-
alignNodes: () =>
|
|
66
|
-
angleToSvgLinearCoords: () =>
|
|
67
|
-
animateNode: () =>
|
|
68
|
-
applyAnimation: () =>
|
|
69
|
-
applyAnimationOverrides: () =>
|
|
70
|
-
applyConstraints: () =>
|
|
71
|
-
applyNodeUpdates: () =>
|
|
72
|
-
applyShapeCombination: () =>
|
|
73
|
-
applyShapeReplacement: () =>
|
|
74
|
-
bezierPathArea: () =>
|
|
75
|
-
bezierPathBounds: () =>
|
|
76
|
-
bezierPathLength: () =>
|
|
77
|
-
bezierPathPointAtLength: () =>
|
|
78
|
-
bezierPathSignedArea: () =>
|
|
79
|
-
bezierPathToSvg: () =>
|
|
80
|
-
bindCanvasComponentProperty: () =>
|
|
81
|
-
bindCanvasToken: () =>
|
|
82
|
-
blendLayout: () =>
|
|
83
|
-
boundsOf: () =>
|
|
84
|
-
calculateDagreReflowDisplacement: () =>
|
|
85
|
-
calculateDirectionalDisplacement: () =>
|
|
86
|
-
canCombineShapeNodes: () =>
|
|
87
|
-
canOffsetShapeNodes: () =>
|
|
88
|
-
canOutlineShapeNodeStrokes: () =>
|
|
89
|
-
canvasHeight: () =>
|
|
90
|
-
centerNodes: () =>
|
|
91
|
-
centre: () =>
|
|
92
|
-
clampAnimationValue: () =>
|
|
93
|
-
clampLayoutSize: () =>
|
|
94
|
-
combineCanvasComponentsAsVariants: () =>
|
|
95
|
-
combineShapeNodes: () =>
|
|
96
|
-
computeNodesBoundingBox: () =>
|
|
97
|
-
computeSnapGuides: () =>
|
|
98
|
-
connectedOnly: () =>
|
|
99
|
-
copyKeyframes: () =>
|
|
100
|
-
countPathSegments: () =>
|
|
101
|
-
createAnimationPlayer: () =>
|
|
102
|
-
createBezierTrajectory: () =>
|
|
103
|
-
createCanvasAnimationController: () =>
|
|
104
|
-
createCanvasAutoLayoutController: () =>
|
|
105
|
-
createCanvasComponent: () =>
|
|
106
|
-
createCanvasComponentsController: () =>
|
|
107
|
-
createCanvasDrawController: () =>
|
|
108
|
-
createCanvasInstance: () =>
|
|
109
|
-
createCanvasScenesStore: () =>
|
|
110
|
-
createDefaultStrokeStyle: () =>
|
|
111
|
-
createFanOutTrajectory: () =>
|
|
112
|
-
createGuideIndex: () =>
|
|
113
|
-
createNodeGuideIndex: () =>
|
|
114
|
-
cubicBezierAt: () =>
|
|
115
|
-
cubicPointAt: () =>
|
|
116
|
-
cubicsToPathData: () =>
|
|
117
|
-
dashContours: () =>
|
|
118
|
-
defaultEasing: () =>
|
|
119
|
-
deleteKeyframes: () =>
|
|
120
|
-
detachCanvasInstance: () =>
|
|
121
|
-
detachTokenBindings: () =>
|
|
122
|
-
distanceToBezierPath: () =>
|
|
123
|
-
distributeNodes: () =>
|
|
124
|
-
dividePaths: () =>
|
|
125
|
-
dividePolygons: () =>
|
|
126
|
-
easingFromInfluence: () =>
|
|
127
|
-
easingLabel: () =>
|
|
128
|
-
easingToCss: () =>
|
|
129
|
-
ensureLayout: () =>
|
|
130
|
-
estimateCanvasHeight: () =>
|
|
131
|
-
estimateNodeSize: () =>
|
|
132
|
-
evaluateAnimation: () =>
|
|
133
|
-
evaluateEasing: () =>
|
|
134
|
-
evaluateTrack: () =>
|
|
135
|
-
excludePaths: () =>
|
|
136
|
-
exportCssAnimation: () =>
|
|
137
|
-
findConnectorSnap: () =>
|
|
138
|
-
findStrokesAtPoint: () =>
|
|
139
|
-
fitCubicRun: () =>
|
|
140
|
-
fitCubics: () =>
|
|
141
|
-
fitFreehandPath: () =>
|
|
142
|
-
fitPathData: () =>
|
|
143
|
-
fitViewportToNodes: () =>
|
|
144
|
-
fitViewportToRect: () =>
|
|
145
|
-
flattenSvgPath: () =>
|
|
146
|
-
flowSide: () =>
|
|
147
|
-
formatAnimationTime: () =>
|
|
148
|
-
formatOklab: () =>
|
|
149
|
-
getAbsolutePosition: () =>
|
|
150
|
-
getAnimatableProperty: () =>
|
|
151
|
-
getAnimatedProperties: () =>
|
|
152
|
-
getAnimatedValue: () =>
|
|
153
|
-
getAnimationDuration: () =>
|
|
154
|
-
getAnimationTrack: () =>
|
|
155
|
-
getAutoLayout: () =>
|
|
156
|
-
getAutoLayoutGrid: () =>
|
|
157
|
-
getAutoLayoutInsertTarget: () =>
|
|
158
|
-
getBindableTokenProperties: () =>
|
|
159
|
-
getCanvasComponentDragId: () =>
|
|
160
|
-
getCanvasTokenProperty: () =>
|
|
161
|
-
getCenteredNodePosition: () =>
|
|
162
|
-
getChildLayout: () =>
|
|
163
|
-
getComponentSourceId: () =>
|
|
164
|
-
getCssPropertyAnimations: () =>
|
|
165
|
-
getEffectiveTokenModes: () =>
|
|
166
|
-
getFlowChildren: () =>
|
|
167
|
-
getInstanceData: () =>
|
|
168
|
-
getInstanceStatus: () =>
|
|
169
|
-
getKeyframeTimes: () =>
|
|
170
|
-
getLayoutParent: () =>
|
|
171
|
-
getLayoutSizing: () =>
|
|
172
|
-
getLayoutedNodes: () =>
|
|
173
|
-
getNextVariantValues: () =>
|
|
174
|
-
getNodeAnimation: () =>
|
|
175
|
-
getNodeOverrides: () =>
|
|
176
|
-
getNodeRect: () =>
|
|
177
|
-
getNodeShape: () =>
|
|
178
|
-
getNodeSize: () =>
|
|
179
|
-
getNodeTokenBindings: () =>
|
|
180
|
-
getNodeTokenModes: () =>
|
|
181
|
-
getResizingNodeRect: () =>
|
|
182
|
-
getShapeRenderData: () =>
|
|
183
|
-
getShapeSvg: () =>
|
|
184
|
-
getTimelineRows: () =>
|
|
185
|
-
getTimelineTicks: () =>
|
|
186
|
-
getTokenPropertyScope: () =>
|
|
187
|
-
getTokensForProperty: () =>
|
|
188
|
-
gradientToSvgDef: () =>
|
|
189
|
-
handlePoint: () =>
|
|
190
|
-
hasVisibleStroke: () =>
|
|
191
|
-
inferResizeHandle: () =>
|
|
192
|
-
inspectCanvasInstance: () =>
|
|
193
|
-
inspectNodeTokens: () =>
|
|
194
|
-
interpolateAnimationValue: () =>
|
|
195
|
-
intersectPaths: () =>
|
|
196
|
-
intersectPolygons: () =>
|
|
197
|
-
invertNodeUpdates: () =>
|
|
198
|
-
isAnimationEasing: () =>
|
|
199
|
-
isAnimationKeyframe: () =>
|
|
200
|
-
isAutoLayoutFrame: () =>
|
|
201
|
-
isCanvasComponent: () =>
|
|
202
|
-
isCanvasComponentSet: () =>
|
|
203
|
-
isCanvasGradient: () =>
|
|
204
|
-
isCanvasInstance: () =>
|
|
205
|
-
isCssExportExact: () =>
|
|
206
|
-
isEventFromTextInput: () =>
|
|
207
|
-
isKeyframeSelected: () =>
|
|
208
|
-
isLocked: () =>
|
|
209
|
-
isMeasureModifierHeld: () =>
|
|
210
|
-
isNodeAnimated: () =>
|
|
211
|
-
isShapeDescription: () =>
|
|
212
|
-
isShapeNode: () =>
|
|
213
|
-
isStraightCubic: () =>
|
|
214
|
-
isValidCanvasNode: () =>
|
|
215
|
-
isValidUrl: () =>
|
|
216
|
-
layoutAll: () =>
|
|
217
|
-
layoutBounds: () =>
|
|
218
|
-
layoutFrame: () =>
|
|
219
|
-
layoutUp: () =>
|
|
220
|
-
layoutUpMany: () =>
|
|
221
|
-
linearPositionTrajectory: () =>
|
|
222
|
-
linearTrajectory: () =>
|
|
223
|
-
listCanvasComponents: () =>
|
|
224
|
-
lockNodes: () =>
|
|
225
|
-
makeSizingCoherent: () =>
|
|
226
|
-
matchArrangeShortcut: () =>
|
|
227
|
-
matchSize: () =>
|
|
228
|
-
measureBetween: () =>
|
|
229
|
-
measureLabel: () =>
|
|
230
|
-
measureSelection: () =>
|
|
231
|
-
measureToLine: () =>
|
|
232
|
-
mergeNodeUpdates: () =>
|
|
63
|
+
addCanvasVariant: () => import_canvas32.addCanvasVariant,
|
|
64
|
+
addKeyframesAtTime: () => import_canvas31.addKeyframesAtTime,
|
|
65
|
+
alignNodes: () => import_canvas25.alignNodes,
|
|
66
|
+
angleToSvgLinearCoords: () => import_canvas32.angleToSvgLinearCoords,
|
|
67
|
+
animateNode: () => import_canvas31.animateNode,
|
|
68
|
+
applyAnimation: () => import_canvas31.applyAnimation,
|
|
69
|
+
applyAnimationOverrides: () => import_canvas31.applyAnimationOverrides,
|
|
70
|
+
applyConstraints: () => import_canvas29.applyConstraints,
|
|
71
|
+
applyNodeUpdates: () => import_canvas25.applyNodeUpdates,
|
|
72
|
+
applyShapeCombination: () => import_canvas26.applyShapeCombination,
|
|
73
|
+
applyShapeReplacement: () => import_canvas27.applyShapeReplacement,
|
|
74
|
+
bezierPathArea: () => import_canvas27.bezierPathArea,
|
|
75
|
+
bezierPathBounds: () => import_canvas27.bezierPathBounds,
|
|
76
|
+
bezierPathLength: () => import_canvas27.bezierPathLength,
|
|
77
|
+
bezierPathPointAtLength: () => import_canvas27.bezierPathPointAtLength,
|
|
78
|
+
bezierPathSignedArea: () => import_canvas27.bezierPathSignedArea,
|
|
79
|
+
bezierPathToSvg: () => import_canvas27.bezierPathToSvg,
|
|
80
|
+
bindCanvasComponentProperty: () => import_canvas32.bindCanvasComponentProperty,
|
|
81
|
+
bindCanvasToken: () => import_canvas30.bindCanvasToken,
|
|
82
|
+
blendLayout: () => import_canvas28.blendLayout,
|
|
83
|
+
boundsOf: () => import_canvas28.boundsOf,
|
|
84
|
+
calculateDagreReflowDisplacement: () => import_canvas28.calculateDagreReflowDisplacement,
|
|
85
|
+
calculateDirectionalDisplacement: () => import_canvas28.calculateDirectionalDisplacement,
|
|
86
|
+
canCombineShapeNodes: () => import_canvas26.canCombineShapeNodes,
|
|
87
|
+
canOffsetShapeNodes: () => import_canvas27.canOffsetShapeNodes,
|
|
88
|
+
canOutlineShapeNodeStrokes: () => import_canvas27.canOutlineShapeNodeStrokes,
|
|
89
|
+
canvasHeight: () => import_canvas28.canvasHeight,
|
|
90
|
+
centerNodes: () => import_canvas28.centerNodes,
|
|
91
|
+
centre: () => import_canvas28.centre,
|
|
92
|
+
clampAnimationValue: () => import_canvas31.clampAnimationValue,
|
|
93
|
+
clampLayoutSize: () => import_canvas29.clampLayoutSize,
|
|
94
|
+
combineCanvasComponentsAsVariants: () => import_canvas32.combineCanvasComponentsAsVariants,
|
|
95
|
+
combineShapeNodes: () => import_canvas26.combineShapeNodes,
|
|
96
|
+
computeNodesBoundingBox: () => import_canvas28.computeNodesBoundingBox,
|
|
97
|
+
computeSnapGuides: () => import_canvas25.computeSnapGuides,
|
|
98
|
+
connectedOnly: () => import_canvas28.connectedOnly,
|
|
99
|
+
copyKeyframes: () => import_canvas31.copyKeyframes,
|
|
100
|
+
countPathSegments: () => import_canvas27.countPathSegments,
|
|
101
|
+
createAnimationPlayer: () => import_canvas31.createAnimationPlayer,
|
|
102
|
+
createBezierTrajectory: () => import_canvas28.createBezierTrajectory,
|
|
103
|
+
createCanvasAnimationController: () => import_canvas31.createCanvasAnimationController,
|
|
104
|
+
createCanvasAutoLayoutController: () => import_canvas29.createCanvasAutoLayoutController,
|
|
105
|
+
createCanvasComponent: () => import_canvas32.createCanvasComponent,
|
|
106
|
+
createCanvasComponentsController: () => import_canvas32.createCanvasComponentsController,
|
|
107
|
+
createCanvasDrawController: () => import_canvas32.createCanvasDrawController,
|
|
108
|
+
createCanvasInstance: () => import_canvas32.createCanvasInstance,
|
|
109
|
+
createCanvasScenesStore: () => import_canvas25.createCanvasScenesStore,
|
|
110
|
+
createDefaultStrokeStyle: () => import_canvas32.createDefaultStrokeStyle,
|
|
111
|
+
createFanOutTrajectory: () => import_canvas28.createFanOutTrajectory,
|
|
112
|
+
createGuideIndex: () => import_canvas25.createGuideIndex,
|
|
113
|
+
createNodeGuideIndex: () => import_canvas25.createNodeGuideIndex,
|
|
114
|
+
cubicBezierAt: () => import_canvas31.cubicBezierAt,
|
|
115
|
+
cubicPointAt: () => import_canvas24.cubicPointAt,
|
|
116
|
+
cubicsToPathData: () => import_canvas24.cubicsToPathData,
|
|
117
|
+
dashContours: () => import_canvas27.dashContours,
|
|
118
|
+
defaultEasing: () => import_canvas28.defaultEasing,
|
|
119
|
+
deleteKeyframes: () => import_canvas31.deleteKeyframes,
|
|
120
|
+
detachCanvasInstance: () => import_canvas32.detachCanvasInstance,
|
|
121
|
+
detachTokenBindings: () => import_canvas30.detachTokenBindings,
|
|
122
|
+
distanceToBezierPath: () => import_canvas27.distanceToBezierPath,
|
|
123
|
+
distributeNodes: () => import_canvas25.distributeNodes,
|
|
124
|
+
dividePaths: () => import_canvas27.dividePaths,
|
|
125
|
+
dividePolygons: () => import_canvas26.dividePolygons,
|
|
126
|
+
easingFromInfluence: () => import_canvas31.easingFromInfluence,
|
|
127
|
+
easingLabel: () => import_canvas31.easingLabel,
|
|
128
|
+
easingToCss: () => import_canvas31.easingToCss,
|
|
129
|
+
ensureLayout: () => import_canvas28.ensureLayout,
|
|
130
|
+
estimateCanvasHeight: () => import_canvas28.estimateCanvasHeight,
|
|
131
|
+
estimateNodeSize: () => import_canvas28.estimateNodeSize,
|
|
132
|
+
evaluateAnimation: () => import_canvas31.evaluateAnimation,
|
|
133
|
+
evaluateEasing: () => import_canvas31.evaluateEasing,
|
|
134
|
+
evaluateTrack: () => import_canvas31.evaluateTrack,
|
|
135
|
+
excludePaths: () => import_canvas27.excludePaths,
|
|
136
|
+
exportCssAnimation: () => import_canvas31.exportCssAnimation,
|
|
137
|
+
findConnectorSnap: () => import_canvas25.findConnectorSnap,
|
|
138
|
+
findStrokesAtPoint: () => import_canvas32.findStrokesAtPoint,
|
|
139
|
+
fitCubicRun: () => import_canvas24.fitCubicRun,
|
|
140
|
+
fitCubics: () => import_canvas24.fitCubics,
|
|
141
|
+
fitFreehandPath: () => import_canvas24.fitFreehandPath,
|
|
142
|
+
fitPathData: () => import_canvas24.fitPathData,
|
|
143
|
+
fitViewportToNodes: () => import_canvas25.fitViewportToNodes,
|
|
144
|
+
fitViewportToRect: () => import_canvas25.fitViewportToRect,
|
|
145
|
+
flattenSvgPath: () => import_canvas26.flattenSvgPath,
|
|
146
|
+
flowSide: () => import_canvas28.flowSide,
|
|
147
|
+
formatAnimationTime: () => import_canvas31.formatAnimationTime,
|
|
148
|
+
formatOklab: () => import_canvas31.formatOklab,
|
|
149
|
+
getAbsolutePosition: () => import_canvas25.getAbsolutePosition,
|
|
150
|
+
getAnimatableProperty: () => import_canvas31.getAnimatableProperty,
|
|
151
|
+
getAnimatedProperties: () => import_canvas31.getAnimatedProperties,
|
|
152
|
+
getAnimatedValue: () => import_canvas31.getAnimatedValue,
|
|
153
|
+
getAnimationDuration: () => import_canvas31.getAnimationDuration,
|
|
154
|
+
getAnimationTrack: () => import_canvas31.getAnimationTrack,
|
|
155
|
+
getAutoLayout: () => import_canvas29.getAutoLayout,
|
|
156
|
+
getAutoLayoutGrid: () => import_canvas29.getAutoLayoutGrid,
|
|
157
|
+
getAutoLayoutInsertTarget: () => import_canvas29.getAutoLayoutInsertTarget,
|
|
158
|
+
getBindableTokenProperties: () => import_canvas30.getBindableTokenProperties,
|
|
159
|
+
getCanvasComponentDragId: () => import_canvas32.getCanvasComponentDragId,
|
|
160
|
+
getCanvasTokenProperty: () => import_canvas30.getCanvasTokenProperty,
|
|
161
|
+
getCenteredNodePosition: () => import_canvas28.getCenteredNodePosition,
|
|
162
|
+
getChildLayout: () => import_canvas29.getChildLayout,
|
|
163
|
+
getComponentSourceId: () => import_canvas32.getComponentSourceId,
|
|
164
|
+
getCssPropertyAnimations: () => import_canvas31.getCssPropertyAnimations,
|
|
165
|
+
getEffectiveTokenModes: () => import_canvas30.getEffectiveTokenModes,
|
|
166
|
+
getFlowChildren: () => import_canvas29.getFlowChildren,
|
|
167
|
+
getInstanceData: () => import_canvas32.getInstanceData,
|
|
168
|
+
getInstanceStatus: () => import_canvas32.getInstanceStatus,
|
|
169
|
+
getKeyframeTimes: () => import_canvas31.getKeyframeTimes,
|
|
170
|
+
getLayoutParent: () => import_canvas29.getLayoutParent,
|
|
171
|
+
getLayoutSizing: () => import_canvas29.getLayoutSizing,
|
|
172
|
+
getLayoutedNodes: () => import_canvas28.getLayoutedNodes,
|
|
173
|
+
getNextVariantValues: () => import_canvas32.getNextVariantValues,
|
|
174
|
+
getNodeAnimation: () => import_canvas31.getNodeAnimation,
|
|
175
|
+
getNodeOverrides: () => import_canvas32.getNodeOverrides,
|
|
176
|
+
getNodeRect: () => import_canvas25.getNodeRect,
|
|
177
|
+
getNodeShape: () => import_canvas26.getNodeShape,
|
|
178
|
+
getNodeSize: () => import_canvas25.getNodeSize,
|
|
179
|
+
getNodeTokenBindings: () => import_canvas30.getNodeTokenBindings,
|
|
180
|
+
getNodeTokenModes: () => import_canvas30.getNodeTokenModes,
|
|
181
|
+
getResizingNodeRect: () => import_canvas24.getResizingNodeRect,
|
|
182
|
+
getShapeRenderData: () => import_canvas26.getShapeRenderData,
|
|
183
|
+
getShapeSvg: () => import_canvas26.getShapeSvg,
|
|
184
|
+
getTimelineRows: () => import_canvas31.getTimelineRows,
|
|
185
|
+
getTimelineTicks: () => import_canvas31.getTimelineTicks,
|
|
186
|
+
getTokenPropertyScope: () => import_canvas30.getTokenPropertyScope,
|
|
187
|
+
getTokensForProperty: () => import_canvas30.getTokensForProperty,
|
|
188
|
+
gradientToSvgDef: () => import_canvas32.gradientToSvgDef,
|
|
189
|
+
handlePoint: () => import_canvas25.handlePoint,
|
|
190
|
+
hasVisibleStroke: () => import_canvas27.hasVisibleStroke,
|
|
191
|
+
inferResizeHandle: () => import_canvas24.inferResizeHandle,
|
|
192
|
+
inspectCanvasInstance: () => import_canvas32.inspectCanvasInstance,
|
|
193
|
+
inspectNodeTokens: () => import_canvas30.inspectNodeTokens,
|
|
194
|
+
interpolateAnimationValue: () => import_canvas31.interpolateAnimationValue,
|
|
195
|
+
intersectPaths: () => import_canvas27.intersectPaths,
|
|
196
|
+
intersectPolygons: () => import_canvas26.intersectPolygons,
|
|
197
|
+
invertNodeUpdates: () => import_canvas25.invertNodeUpdates,
|
|
198
|
+
isAnimationEasing: () => import_canvas31.isAnimationEasing,
|
|
199
|
+
isAnimationKeyframe: () => import_canvas31.isAnimationKeyframe,
|
|
200
|
+
isAutoLayoutFrame: () => import_canvas29.isAutoLayoutFrame,
|
|
201
|
+
isCanvasComponent: () => import_canvas32.isCanvasComponent,
|
|
202
|
+
isCanvasComponentSet: () => import_canvas32.isCanvasComponentSet,
|
|
203
|
+
isCanvasGradient: () => import_canvas32.isCanvasGradient,
|
|
204
|
+
isCanvasInstance: () => import_canvas32.isCanvasInstance,
|
|
205
|
+
isCssExportExact: () => import_canvas31.isCssExportExact,
|
|
206
|
+
isEventFromTextInput: () => import_canvas28.isEventFromTextInput,
|
|
207
|
+
isKeyframeSelected: () => import_canvas31.isKeyframeSelected,
|
|
208
|
+
isLocked: () => import_canvas25.isLocked,
|
|
209
|
+
isMeasureModifierHeld: () => import_canvas24.isMeasureModifierHeld,
|
|
210
|
+
isNodeAnimated: () => import_canvas31.isNodeAnimated,
|
|
211
|
+
isShapeDescription: () => import_canvas26.isShapeDescription,
|
|
212
|
+
isShapeNode: () => import_canvas26.isShapeNode,
|
|
213
|
+
isStraightCubic: () => import_canvas24.isStraightCubic,
|
|
214
|
+
isValidCanvasNode: () => import_canvas28.isValidCanvasNode,
|
|
215
|
+
isValidUrl: () => import_canvas28.isValidUrl,
|
|
216
|
+
layoutAll: () => import_canvas29.layoutAll,
|
|
217
|
+
layoutBounds: () => import_canvas28.layoutBounds,
|
|
218
|
+
layoutFrame: () => import_canvas29.layoutFrame,
|
|
219
|
+
layoutUp: () => import_canvas29.layoutUp,
|
|
220
|
+
layoutUpMany: () => import_canvas29.layoutUpMany,
|
|
221
|
+
linearPositionTrajectory: () => import_canvas28.linearPositionTrajectory,
|
|
222
|
+
linearTrajectory: () => import_canvas28.linearTrajectory,
|
|
223
|
+
listCanvasComponents: () => import_canvas32.listCanvasComponents,
|
|
224
|
+
lockNodes: () => import_canvas25.lockNodes,
|
|
225
|
+
makeSizingCoherent: () => import_canvas29.makeSizingCoherent,
|
|
226
|
+
matchArrangeShortcut: () => import_canvas25.matchArrangeShortcut,
|
|
227
|
+
matchSize: () => import_canvas25.matchSize,
|
|
228
|
+
measureBetween: () => import_canvas24.measureBetween,
|
|
229
|
+
measureLabel: () => import_canvas24.measureLabel,
|
|
230
|
+
measureSelection: () => import_canvas24.measureSelection,
|
|
231
|
+
measureToLine: () => import_canvas24.measureToLine,
|
|
232
|
+
mergeNodeUpdates: () => import_canvas29.mergeNodeUpdates,
|
|
233
233
|
mermaidNodeStyle: () => mermaidNodeStyle,
|
|
234
|
-
mixColorsOklab: () =>
|
|
235
|
-
moveKeyframes: () =>
|
|
236
|
-
moveLayoutChild: () =>
|
|
237
|
-
multiPolygonArea: () =>
|
|
238
|
-
multiPolygonBounds: () =>
|
|
239
|
-
nearestHandlePositions: () =>
|
|
240
|
-
normalizeBezierPath: () =>
|
|
241
|
-
normalizeKeyframes: () =>
|
|
242
|
-
offsetPath: () =>
|
|
243
|
-
offsetShapeNodes: () =>
|
|
244
|
-
oklabToRgb: () =>
|
|
245
|
-
oppositePosition: () =>
|
|
246
|
-
outlineShapeNodeStrokes: () =>
|
|
247
|
-
outlineStroke: () =>
|
|
248
|
-
overlaps: () =>
|
|
249
|
-
parseCanvasClipboardData: () =>
|
|
250
|
-
parseCanvasScenes: () =>
|
|
251
|
-
parseCssEasing: () =>
|
|
252
|
-
parseCssGradient: () =>
|
|
253
|
-
parseKeyframeClipboard: () =>
|
|
254
|
-
parseOklab: () =>
|
|
255
|
-
parseSvgPath: () =>
|
|
256
|
-
pasteKeyframes: () =>
|
|
257
|
-
pathBoolean: () =>
|
|
258
|
-
placeBeside: () =>
|
|
259
|
-
playWebAnimations: () =>
|
|
260
|
-
pointInBezierPath: () =>
|
|
261
|
-
pointInMultiPolygon: () =>
|
|
262
|
-
pointInRings: () =>
|
|
263
|
-
polygonArea: () =>
|
|
264
|
-
polygonBoolean: () =>
|
|
265
|
-
polygonToSvgPath: () =>
|
|
266
|
-
positionToSide: () =>
|
|
267
|
-
pruneCanvasTokenModes: () =>
|
|
268
|
-
pushCanvasInstanceOverrides: () =>
|
|
269
|
-
readAnimatableValue: () =>
|
|
270
|
-
readNodeStyleProperty: () =>
|
|
271
|
-
readStyleSize: () =>
|
|
272
|
-
realClock: () =>
|
|
273
|
-
recordAnimationChanges: () =>
|
|
274
|
-
relayoutUpdates: () =>
|
|
275
|
-
remapPastedNodes: () =>
|
|
276
|
-
removeCanvasVariant: () =>
|
|
277
|
-
removeTrack: () =>
|
|
278
|
-
renameCanvasVariantProperty: () =>
|
|
279
|
-
renameCanvasVariantValue: () =>
|
|
280
|
-
reorderNodes: () =>
|
|
281
|
-
repositionNodesTo: () =>
|
|
282
|
-
resetCanvasInstanceOverrides: () =>
|
|
283
|
-
resizeHandleAxes: () =>
|
|
284
|
-
resolveCanvasGradient: () =>
|
|
285
|
-
resolveCanvasTokens: () =>
|
|
286
|
-
resolveEasing: () =>
|
|
287
|
-
resolvePadding: () =>
|
|
288
|
-
restoreCanvasMainComponent: () =>
|
|
289
|
-
revertShapeCombination: () =>
|
|
290
|
-
rgbToOklab: () =>
|
|
291
|
-
ringSignedArea: () =>
|
|
292
|
-
runMultiNodeTransition: () =>
|
|
293
|
-
sampleAnimationFrames: () =>
|
|
294
|
-
scaleKeyframes: () =>
|
|
295
|
-
serializeCanvasNodes: () =>
|
|
296
|
-
setCanvasComponentProperty: () =>
|
|
297
|
-
setCanvasInstanceProperties: () =>
|
|
298
|
-
setCanvasTokenMode: () =>
|
|
299
|
-
setCanvasVariantProperties: () =>
|
|
300
|
-
setKeyframe: () =>
|
|
301
|
-
setKeyframeEasing: () =>
|
|
302
|
-
setMotionPath: () =>
|
|
303
|
-
setTrackEnabled: () =>
|
|
304
|
-
shapeNodeToBezierPath: () =>
|
|
305
|
-
shapeNodeToPolygon: () =>
|
|
306
|
-
shapeToBezierPath: () =>
|
|
307
|
-
shapeToPolygon: () =>
|
|
308
|
-
sideToPosition: () =>
|
|
309
|
-
simplifyRing: () =>
|
|
310
|
-
snapKeyframeDelta: () =>
|
|
311
|
-
snapNodeDrag: () =>
|
|
312
|
-
snapNodeResize: () =>
|
|
313
|
-
snapResize: () =>
|
|
314
|
-
snapTimeToFrame: () =>
|
|
315
|
-
snapToGrid: () =>
|
|
316
|
-
springAt: () =>
|
|
317
|
-
streamlinePoints: () =>
|
|
318
|
-
strokeOutlineRings: () =>
|
|
319
|
-
strokePointsToPathData: () =>
|
|
320
|
-
strokeToShapeNode: () =>
|
|
321
|
-
subtractPaths: () =>
|
|
322
|
-
subtractPolygons: () =>
|
|
323
|
-
swapCanvasInstance: () =>
|
|
324
|
-
syncAllCanvasInstances: () =>
|
|
325
|
-
syncCanvasComponents: () =>
|
|
326
|
-
syncCanvasInstance: () =>
|
|
327
|
-
timeToX: () =>
|
|
328
|
-
toBezierPath: () =>
|
|
329
|
-
toWebAnimations: () =>
|
|
330
|
-
toggleLockNodes: () =>
|
|
331
|
-
transformBezierPath: () =>
|
|
332
|
-
unionPolygons: () =>
|
|
333
|
-
unitePaths: () =>
|
|
334
|
-
unlockNodes: () =>
|
|
335
|
-
updateKeyframe: () =>
|
|
234
|
+
mixColorsOklab: () => import_canvas31.mixColorsOklab,
|
|
235
|
+
moveKeyframes: () => import_canvas31.moveKeyframes,
|
|
236
|
+
moveLayoutChild: () => import_canvas29.moveLayoutChild,
|
|
237
|
+
multiPolygonArea: () => import_canvas26.multiPolygonArea,
|
|
238
|
+
multiPolygonBounds: () => import_canvas26.multiPolygonBounds,
|
|
239
|
+
nearestHandlePositions: () => import_canvas25.nearestHandlePositions,
|
|
240
|
+
normalizeBezierPath: () => import_canvas27.normalizeBezierPath,
|
|
241
|
+
normalizeKeyframes: () => import_canvas31.normalizeKeyframes,
|
|
242
|
+
offsetPath: () => import_canvas27.offsetPath,
|
|
243
|
+
offsetShapeNodes: () => import_canvas27.offsetShapeNodes,
|
|
244
|
+
oklabToRgb: () => import_canvas31.oklabToRgb,
|
|
245
|
+
oppositePosition: () => import_canvas25.oppositePosition,
|
|
246
|
+
outlineShapeNodeStrokes: () => import_canvas27.outlineShapeNodeStrokes,
|
|
247
|
+
outlineStroke: () => import_canvas27.outlineStroke,
|
|
248
|
+
overlaps: () => import_canvas28.overlaps,
|
|
249
|
+
parseCanvasClipboardData: () => import_canvas28.parseCanvasClipboardData,
|
|
250
|
+
parseCanvasScenes: () => import_canvas25.parseCanvasScenes,
|
|
251
|
+
parseCssEasing: () => import_canvas31.parseCssEasing,
|
|
252
|
+
parseCssGradient: () => import_canvas32.parseCssGradient,
|
|
253
|
+
parseKeyframeClipboard: () => import_canvas31.parseKeyframeClipboard,
|
|
254
|
+
parseOklab: () => import_canvas31.parseOklab,
|
|
255
|
+
parseSvgPath: () => import_canvas26.parseSvgPath,
|
|
256
|
+
pasteKeyframes: () => import_canvas31.pasteKeyframes,
|
|
257
|
+
pathBoolean: () => import_canvas27.pathBoolean,
|
|
258
|
+
placeBeside: () => import_canvas28.placeBeside,
|
|
259
|
+
playWebAnimations: () => import_canvas31.playWebAnimations,
|
|
260
|
+
pointInBezierPath: () => import_canvas27.pointInBezierPath,
|
|
261
|
+
pointInMultiPolygon: () => import_canvas26.pointInMultiPolygon,
|
|
262
|
+
pointInRings: () => import_canvas26.pointInRings,
|
|
263
|
+
polygonArea: () => import_canvas26.polygonArea,
|
|
264
|
+
polygonBoolean: () => import_canvas26.polygonBoolean,
|
|
265
|
+
polygonToSvgPath: () => import_canvas26.polygonToSvgPath,
|
|
266
|
+
positionToSide: () => import_canvas25.positionToSide,
|
|
267
|
+
pruneCanvasTokenModes: () => import_canvas30.pruneCanvasTokenModes,
|
|
268
|
+
pushCanvasInstanceOverrides: () => import_canvas32.pushCanvasInstanceOverrides,
|
|
269
|
+
readAnimatableValue: () => import_canvas31.readAnimatableValue,
|
|
270
|
+
readNodeStyleProperty: () => import_canvas30.readNodeStyleProperty,
|
|
271
|
+
readStyleSize: () => import_canvas25.readStyleSize,
|
|
272
|
+
realClock: () => import_canvas28.realClock,
|
|
273
|
+
recordAnimationChanges: () => import_canvas31.recordAnimationChanges,
|
|
274
|
+
relayoutUpdates: () => import_canvas29.relayoutUpdates,
|
|
275
|
+
remapPastedNodes: () => import_canvas28.remapPastedNodes,
|
|
276
|
+
removeCanvasVariant: () => import_canvas32.removeCanvasVariant,
|
|
277
|
+
removeTrack: () => import_canvas31.removeTrack,
|
|
278
|
+
renameCanvasVariantProperty: () => import_canvas32.renameCanvasVariantProperty,
|
|
279
|
+
renameCanvasVariantValue: () => import_canvas32.renameCanvasVariantValue,
|
|
280
|
+
reorderNodes: () => import_canvas25.reorderNodes,
|
|
281
|
+
repositionNodesTo: () => import_canvas28.repositionNodesTo,
|
|
282
|
+
resetCanvasInstanceOverrides: () => import_canvas32.resetCanvasInstanceOverrides,
|
|
283
|
+
resizeHandleAxes: () => import_canvas24.resizeHandleAxes,
|
|
284
|
+
resolveCanvasGradient: () => import_canvas32.resolveCanvasGradient,
|
|
285
|
+
resolveCanvasTokens: () => import_canvas30.resolveCanvasTokens,
|
|
286
|
+
resolveEasing: () => import_canvas31.resolveEasing,
|
|
287
|
+
resolvePadding: () => import_canvas29.resolvePadding,
|
|
288
|
+
restoreCanvasMainComponent: () => import_canvas32.restoreCanvasMainComponent,
|
|
289
|
+
revertShapeCombination: () => import_canvas26.revertShapeCombination,
|
|
290
|
+
rgbToOklab: () => import_canvas31.rgbToOklab,
|
|
291
|
+
ringSignedArea: () => import_canvas26.ringSignedArea,
|
|
292
|
+
runMultiNodeTransition: () => import_canvas28.runMultiNodeTransition,
|
|
293
|
+
sampleAnimationFrames: () => import_canvas31.sampleAnimationFrames,
|
|
294
|
+
scaleKeyframes: () => import_canvas31.scaleKeyframes,
|
|
295
|
+
serializeCanvasNodes: () => import_canvas28.serializeCanvasNodes,
|
|
296
|
+
setCanvasComponentProperty: () => import_canvas32.setCanvasComponentProperty,
|
|
297
|
+
setCanvasInstanceProperties: () => import_canvas32.setCanvasInstanceProperties,
|
|
298
|
+
setCanvasTokenMode: () => import_canvas30.setCanvasTokenMode,
|
|
299
|
+
setCanvasVariantProperties: () => import_canvas32.setCanvasVariantProperties,
|
|
300
|
+
setKeyframe: () => import_canvas31.setKeyframe,
|
|
301
|
+
setKeyframeEasing: () => import_canvas31.setKeyframeEasing,
|
|
302
|
+
setMotionPath: () => import_canvas31.setMotionPath,
|
|
303
|
+
setTrackEnabled: () => import_canvas31.setTrackEnabled,
|
|
304
|
+
shapeNodeToBezierPath: () => import_canvas27.shapeNodeToBezierPath,
|
|
305
|
+
shapeNodeToPolygon: () => import_canvas26.shapeNodeToPolygon,
|
|
306
|
+
shapeToBezierPath: () => import_canvas27.shapeToBezierPath,
|
|
307
|
+
shapeToPolygon: () => import_canvas26.shapeToPolygon,
|
|
308
|
+
sideToPosition: () => import_canvas25.sideToPosition,
|
|
309
|
+
simplifyRing: () => import_canvas26.simplifyRing,
|
|
310
|
+
snapKeyframeDelta: () => import_canvas31.snapKeyframeDelta,
|
|
311
|
+
snapNodeDrag: () => import_canvas25.snapNodeDrag,
|
|
312
|
+
snapNodeResize: () => import_canvas24.snapNodeResize,
|
|
313
|
+
snapResize: () => import_canvas24.snapResize,
|
|
314
|
+
snapTimeToFrame: () => import_canvas31.snapTimeToFrame,
|
|
315
|
+
snapToGrid: () => import_canvas24.snapToGrid,
|
|
316
|
+
springAt: () => import_canvas31.springAt,
|
|
317
|
+
streamlinePoints: () => import_canvas32.streamlinePoints,
|
|
318
|
+
strokeOutlineRings: () => import_canvas27.strokeOutlineRings,
|
|
319
|
+
strokePointsToPathData: () => import_canvas32.strokePointsToPathData,
|
|
320
|
+
strokeToShapeNode: () => import_canvas32.strokeToShapeNode,
|
|
321
|
+
subtractPaths: () => import_canvas27.subtractPaths,
|
|
322
|
+
subtractPolygons: () => import_canvas26.subtractPolygons,
|
|
323
|
+
swapCanvasInstance: () => import_canvas32.swapCanvasInstance,
|
|
324
|
+
syncAllCanvasInstances: () => import_canvas32.syncAllCanvasInstances,
|
|
325
|
+
syncCanvasComponents: () => import_canvas32.syncCanvasComponents,
|
|
326
|
+
syncCanvasInstance: () => import_canvas32.syncCanvasInstance,
|
|
327
|
+
timeToX: () => import_canvas31.timeToX,
|
|
328
|
+
toBezierPath: () => import_canvas27.toBezierPath,
|
|
329
|
+
toWebAnimations: () => import_canvas31.toWebAnimations,
|
|
330
|
+
toggleLockNodes: () => import_canvas25.toggleLockNodes,
|
|
331
|
+
transformBezierPath: () => import_canvas27.transformBezierPath,
|
|
332
|
+
unionPolygons: () => import_canvas26.unionPolygons,
|
|
333
|
+
unitePaths: () => import_canvas27.unitePaths,
|
|
334
|
+
unlockNodes: () => import_canvas25.unlockNodes,
|
|
335
|
+
updateKeyframe: () => import_canvas31.updateKeyframe,
|
|
336
336
|
useCanvasAnimation: () => useCanvasAnimation,
|
|
337
337
|
useCanvasArrange: () => useCanvasArrange,
|
|
338
338
|
useCanvasArrangeShortcuts: () => useCanvasArrangeShortcuts,
|
|
339
339
|
useCanvasAutoLayout: () => useCanvasAutoLayout,
|
|
340
|
+
useCanvasCapture: () => useCanvasCapture,
|
|
340
341
|
useCanvasClipboard: () => useCanvasClipboard,
|
|
341
342
|
useCanvasComponents: () => useCanvasComponents,
|
|
342
343
|
useCanvasDocking: () => useCanvasDocking,
|
|
@@ -354,13 +355,13 @@ __export(canvas_exports, {
|
|
|
354
355
|
useMermaidStream: () => useMermaidStream,
|
|
355
356
|
usePresenceState: () => usePresenceState,
|
|
356
357
|
useStreamingCanvas: () => useStreamingCanvas,
|
|
357
|
-
withNodeAnimation: () =>
|
|
358
|
-
withStyleSize: () =>
|
|
359
|
-
wouldCreateComponentCycle: () =>
|
|
360
|
-
wrapAnimationTime: () =>
|
|
361
|
-
writeNodeStyleProperty: () =>
|
|
362
|
-
xToTime: () =>
|
|
363
|
-
xorPolygons: () =>
|
|
358
|
+
withNodeAnimation: () => import_canvas31.withNodeAnimation,
|
|
359
|
+
withStyleSize: () => import_canvas25.withStyleSize,
|
|
360
|
+
wouldCreateComponentCycle: () => import_canvas32.wouldCreateComponentCycle,
|
|
361
|
+
wrapAnimationTime: () => import_canvas31.wrapAnimationTime,
|
|
362
|
+
writeNodeStyleProperty: () => import_canvas30.writeNodeStyleProperty,
|
|
363
|
+
xToTime: () => import_canvas31.xToTime,
|
|
364
|
+
xorPolygons: () => import_canvas26.xorPolygons
|
|
364
365
|
});
|
|
365
366
|
module.exports = __toCommonJS(canvas_exports);
|
|
366
367
|
|
|
@@ -1234,6 +1235,31 @@ function useCanvasScenes(options = {}) {
|
|
|
1234
1235
|
};
|
|
1235
1236
|
}
|
|
1236
1237
|
|
|
1238
|
+
// src/canvas/useCanvasCapture.ts
|
|
1239
|
+
var import_react10 = require("react");
|
|
1240
|
+
var import_canvas8 = require("@pixerate/editor/canvas");
|
|
1241
|
+
var import_tools = require("@pixerate/editor/tools");
|
|
1242
|
+
function useCanvasCapture(options) {
|
|
1243
|
+
const optionsRef = (0, import_react10.useRef)(options);
|
|
1244
|
+
optionsRef.current = options;
|
|
1245
|
+
return (0, import_react10.useMemo)(() => {
|
|
1246
|
+
const latest = () => optionsRef.current;
|
|
1247
|
+
return (0, import_canvas8.createCanvasCaptureToolProvider)({
|
|
1248
|
+
...options,
|
|
1249
|
+
element: () => {
|
|
1250
|
+
const el = latest().element;
|
|
1251
|
+
if (typeof el === "function") return el();
|
|
1252
|
+
if (el && "current" in el) return el.current;
|
|
1253
|
+
return el;
|
|
1254
|
+
},
|
|
1255
|
+
getViewport: () => latest().getViewport(),
|
|
1256
|
+
getNodes: () => latest().getNodes(),
|
|
1257
|
+
getNodeRect: (node, nodes) => (latest().getNodeRect ?? import_canvas8.canvasNodeCaptureRect)(node, nodes),
|
|
1258
|
+
rasterize: (element, raster) => (latest().rasterize ?? import_tools.rasterizeElement)(element, raster)
|
|
1259
|
+
});
|
|
1260
|
+
}, [options.id, options.namespace]);
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1237
1263
|
// src/canvas/CanvasGuidesLayer.tsx
|
|
1238
1264
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
1239
1265
|
var DEFAULT_VIEWPORT = { x: 0, y: 0, zoom: 1 };
|
|
@@ -1318,17 +1344,17 @@ function CanvasGuidesLayer({
|
|
|
1318
1344
|
}
|
|
1319
1345
|
|
|
1320
1346
|
// src/canvas/useCanvasDraw.ts
|
|
1321
|
-
var
|
|
1322
|
-
var
|
|
1347
|
+
var import_react11 = require("react");
|
|
1348
|
+
var import_canvas9 = require("@pixerate/editor/canvas");
|
|
1323
1349
|
function useCanvasDraw(options) {
|
|
1324
|
-
const nodesRef = (0,
|
|
1350
|
+
const nodesRef = (0, import_react11.useRef)(options.nodes);
|
|
1325
1351
|
nodesRef.current = options.nodes;
|
|
1326
|
-
const optionsRef = (0,
|
|
1352
|
+
const optionsRef = (0, import_react11.useRef)(options);
|
|
1327
1353
|
optionsRef.current = options;
|
|
1328
|
-
const [tool, setToolState] = (0,
|
|
1329
|
-
const [activeStroke, setActiveStroke] = (0,
|
|
1330
|
-
const controller = (0,
|
|
1331
|
-
() => (0,
|
|
1354
|
+
const [tool, setToolState] = (0, import_react11.useState)(options.initialTool ?? "select");
|
|
1355
|
+
const [activeStroke, setActiveStroke] = (0, import_react11.useState)(null);
|
|
1356
|
+
const controller = (0, import_react11.useMemo)(
|
|
1357
|
+
() => (0, import_canvas9.createCanvasDrawController)({
|
|
1332
1358
|
getNodes: () => nodesRef.current,
|
|
1333
1359
|
setNodes: (next) => {
|
|
1334
1360
|
nodesRef.current = next;
|
|
@@ -1349,13 +1375,13 @@ function useCanvasDraw(options) {
|
|
|
1349
1375
|
}),
|
|
1350
1376
|
[]
|
|
1351
1377
|
);
|
|
1352
|
-
const [style, setStyleState] = (0,
|
|
1353
|
-
(0,
|
|
1378
|
+
const [style, setStyleState] = (0, import_react11.useState)(controller.style);
|
|
1379
|
+
(0, import_react11.useEffect)(() => {
|
|
1354
1380
|
if (options.initialTool && options.initialTool !== controller.tool) {
|
|
1355
1381
|
controller.setTool(options.initialTool);
|
|
1356
1382
|
}
|
|
1357
1383
|
}, [options.initialTool, controller]);
|
|
1358
|
-
return (0,
|
|
1384
|
+
return (0, import_react11.useMemo)(
|
|
1359
1385
|
() => ({
|
|
1360
1386
|
tool,
|
|
1361
1387
|
style,
|
|
@@ -1374,8 +1400,8 @@ function useCanvasDraw(options) {
|
|
|
1374
1400
|
}
|
|
1375
1401
|
|
|
1376
1402
|
// src/canvas/CanvasDrawLayer.tsx
|
|
1377
|
-
var
|
|
1378
|
-
var
|
|
1403
|
+
var import_react12 = require("react");
|
|
1404
|
+
var import_canvas10 = require("@pixerate/editor/canvas");
|
|
1379
1405
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
1380
1406
|
var DEFAULT_VIEWPORT2 = { x: 0, y: 0, zoom: 1 };
|
|
1381
1407
|
function CanvasDrawLayer({
|
|
@@ -1386,10 +1412,10 @@ function CanvasDrawLayer({
|
|
|
1386
1412
|
cursor,
|
|
1387
1413
|
eraserRadius = 12
|
|
1388
1414
|
}) {
|
|
1389
|
-
const svgRef = (0,
|
|
1390
|
-
const [spaceHeld, setSpaceHeld] = (0,
|
|
1391
|
-
const [eraserPos, setEraserPos] = (0,
|
|
1392
|
-
(0,
|
|
1415
|
+
const svgRef = (0, import_react12.useRef)(null);
|
|
1416
|
+
const [spaceHeld, setSpaceHeld] = (0, import_react12.useState)(false);
|
|
1417
|
+
const [eraserPos, setEraserPos] = (0, import_react12.useState)(null);
|
|
1418
|
+
(0, import_react12.useEffect)(() => {
|
|
1393
1419
|
function onKeyDown(e) {
|
|
1394
1420
|
if (e.code === "Space" && !e.repeat) {
|
|
1395
1421
|
const tag = e.target?.tagName;
|
|
@@ -1411,7 +1437,7 @@ function CanvasDrawLayer({
|
|
|
1411
1437
|
window.removeEventListener("keyup", onKeyUp);
|
|
1412
1438
|
};
|
|
1413
1439
|
}, []);
|
|
1414
|
-
const clientToFlow = (0,
|
|
1440
|
+
const clientToFlow = (0, import_react12.useCallback)(
|
|
1415
1441
|
(clientX, clientY) => {
|
|
1416
1442
|
if (!svgRef.current) return [0, 0];
|
|
1417
1443
|
const rect = svgRef.current.getBoundingClientRect();
|
|
@@ -1462,9 +1488,9 @@ function CanvasDrawLayer({
|
|
|
1462
1488
|
setEraserPos(null);
|
|
1463
1489
|
};
|
|
1464
1490
|
const resolvedCursor = cursor ? cursor : spaceHeld ? "grab" : draw.tool === "eraser" ? "crosshair" : draw.tool === "pen" || draw.tool === "highlighter" ? "crosshair" : "default";
|
|
1465
|
-
const strokePath = draw.activeStroke ? (0,
|
|
1466
|
-
const activeGradient = draw.activeStroke ? (0,
|
|
1467
|
-
const resolvedGradientDef = activeGradient ? (0,
|
|
1491
|
+
const strokePath = draw.activeStroke ? (0, import_canvas10.strokePointsToPathData)(draw.activeStroke.points) : null;
|
|
1492
|
+
const activeGradient = draw.activeStroke ? (0, import_canvas10.resolveCanvasGradient)(draw.activeStroke.style.gradient ?? draw.activeStroke.style.color) : null;
|
|
1493
|
+
const resolvedGradientDef = activeGradient ? (0, import_canvas10.gradientToSvgDef)(activeGradient, "active-draw-stroke-gradient") : null;
|
|
1468
1494
|
const strokePaint = resolvedGradientDef ? `url(#${resolvedGradientDef.id})` : draw.activeStroke ? draw.activeStroke.style.color : "currentColor";
|
|
1469
1495
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
1470
1496
|
"svg",
|
|
@@ -1524,20 +1550,20 @@ function CanvasDrawLayer({
|
|
|
1524
1550
|
}
|
|
1525
1551
|
|
|
1526
1552
|
// src/canvas/useCanvasMeasure.ts
|
|
1527
|
-
var
|
|
1528
|
-
var
|
|
1553
|
+
var import_react13 = require("react");
|
|
1554
|
+
var import_canvas11 = require("@pixerate/editor/canvas");
|
|
1529
1555
|
var EMPTY = { guides: [], target: null, selection: null };
|
|
1530
1556
|
function useCanvasMeasure(options) {
|
|
1531
1557
|
const { nodes, enabled = true, requireModifier = true, targetElement, rectOptions } = options;
|
|
1532
|
-
const [hoveredId, setHoveredId] = (0,
|
|
1533
|
-
const [modifier, setModifier] = (0,
|
|
1534
|
-
const optionsRef = (0,
|
|
1558
|
+
const [hoveredId, setHoveredId] = (0, import_react13.useState)(null);
|
|
1559
|
+
const [modifier, setModifier] = (0, import_react13.useState)(false);
|
|
1560
|
+
const optionsRef = (0, import_react13.useRef)(options);
|
|
1535
1561
|
optionsRef.current = options;
|
|
1536
|
-
(0,
|
|
1562
|
+
(0, import_react13.useEffect)(() => {
|
|
1537
1563
|
if (!enabled) return;
|
|
1538
1564
|
const target = targetElement ?? (typeof window !== "undefined" ? window : null);
|
|
1539
1565
|
if (!target) return;
|
|
1540
|
-
const onKey = (event) => setModifier((0,
|
|
1566
|
+
const onKey = (event) => setModifier((0, import_canvas11.isMeasureModifierHeld)(event));
|
|
1541
1567
|
const onBlur = () => setModifier(false);
|
|
1542
1568
|
target.addEventListener("keydown", onKey);
|
|
1543
1569
|
target.addEventListener("keyup", onKey);
|
|
@@ -1550,16 +1576,16 @@ function useCanvasMeasure(options) {
|
|
|
1550
1576
|
};
|
|
1551
1577
|
}, [enabled, targetElement]);
|
|
1552
1578
|
const active = enabled && (!requireModifier || modifier);
|
|
1553
|
-
const result = (0,
|
|
1579
|
+
const result = (0, import_react13.useMemo)(() => {
|
|
1554
1580
|
if (!active) return EMPTY;
|
|
1555
1581
|
const ids = optionsRef.current.getSelectedIds?.() ?? nodes.filter((n) => n.selected).map((n) => n.id);
|
|
1556
|
-
return (0,
|
|
1582
|
+
return (0, import_canvas11.measureSelection)(nodes, ids, hoveredId, rectOptions);
|
|
1557
1583
|
}, [active, nodes, hoveredId, rectOptions]);
|
|
1558
|
-
const onNodeMouseEnter = (0,
|
|
1584
|
+
const onNodeMouseEnter = (0, import_react13.useCallback)((event, node) => {
|
|
1559
1585
|
setHoveredId(node.id);
|
|
1560
1586
|
if (event && typeof event.altKey === "boolean") setModifier(event.altKey);
|
|
1561
1587
|
}, []);
|
|
1562
|
-
const onNodeMouseLeave = (0,
|
|
1588
|
+
const onNodeMouseLeave = (0, import_react13.useCallback)((_event, node) => {
|
|
1563
1589
|
setHoveredId((current) => current === node.id ? null : current);
|
|
1564
1590
|
}, []);
|
|
1565
1591
|
return {
|
|
@@ -1579,16 +1605,16 @@ function useCanvasMeasure(options) {
|
|
|
1579
1605
|
}
|
|
1580
1606
|
|
|
1581
1607
|
// src/canvas/index.ts
|
|
1582
|
-
var import_canvas23 = require("@pixerate/editor/canvas");
|
|
1583
1608
|
var import_canvas24 = require("@pixerate/editor/canvas");
|
|
1609
|
+
var import_canvas25 = require("@pixerate/editor/canvas");
|
|
1584
1610
|
|
|
1585
1611
|
// src/canvas/ShapeNode.tsx
|
|
1586
|
-
var
|
|
1612
|
+
var import_canvas12 = require("@pixerate/editor/canvas");
|
|
1587
1613
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
1588
1614
|
function ShapeNode({ id, data, width, height, selected, className = "", children }) {
|
|
1589
1615
|
const shape = data?.shape;
|
|
1590
|
-
if (!(0,
|
|
1591
|
-
const render = (0,
|
|
1616
|
+
if (!(0, import_canvas12.isShapeDescription)(shape)) return null;
|
|
1617
|
+
const render = (0, import_canvas12.getShapeRenderData)(shape, { width, height }, { id: id || data?.id });
|
|
1592
1618
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
1593
1619
|
"div",
|
|
1594
1620
|
{
|
|
@@ -1638,22 +1664,22 @@ function ShapeNode({ id, data, width, height, selected, className = "", children
|
|
|
1638
1664
|
}
|
|
1639
1665
|
|
|
1640
1666
|
// src/canvas/index.ts
|
|
1641
|
-
var import_canvas25 = require("@pixerate/editor/canvas");
|
|
1642
1667
|
var import_canvas26 = require("@pixerate/editor/canvas");
|
|
1643
1668
|
var import_canvas27 = require("@pixerate/editor/canvas");
|
|
1644
1669
|
var import_canvas28 = require("@pixerate/editor/canvas");
|
|
1670
|
+
var import_canvas29 = require("@pixerate/editor/canvas");
|
|
1645
1671
|
|
|
1646
1672
|
// src/canvas/useCanvasAutoLayout.ts
|
|
1647
|
-
var
|
|
1648
|
-
var
|
|
1673
|
+
var import_react14 = require("react");
|
|
1674
|
+
var import_canvas13 = require("@pixerate/editor/canvas");
|
|
1649
1675
|
function useCanvasAutoLayout(options) {
|
|
1650
|
-
const [guides, setGuides] = (0,
|
|
1651
|
-
const nodesRef = (0,
|
|
1676
|
+
const [guides, setGuides] = (0, import_react14.useState)([]);
|
|
1677
|
+
const nodesRef = (0, import_react14.useRef)(options.nodes);
|
|
1652
1678
|
nodesRef.current = options.nodes;
|
|
1653
|
-
const optionsRef = (0,
|
|
1679
|
+
const optionsRef = (0, import_react14.useRef)(options);
|
|
1654
1680
|
optionsRef.current = options;
|
|
1655
|
-
const controller = (0,
|
|
1656
|
-
() => (0,
|
|
1681
|
+
const controller = (0, import_react14.useMemo)(
|
|
1682
|
+
() => (0, import_canvas13.createCanvasAutoLayoutController)({
|
|
1657
1683
|
getNodes: () => nodesRef.current,
|
|
1658
1684
|
setNodes: (next) => {
|
|
1659
1685
|
nodesRef.current = next;
|
|
@@ -1678,10 +1704,10 @@ function useCanvasAutoLayout(options) {
|
|
|
1678
1704
|
}),
|
|
1679
1705
|
[]
|
|
1680
1706
|
);
|
|
1681
|
-
(0,
|
|
1707
|
+
(0, import_react14.useLayoutEffect)(() => {
|
|
1682
1708
|
if (controller.hasPending) controller.flush();
|
|
1683
1709
|
}, [options.nodes, controller]);
|
|
1684
|
-
return (0,
|
|
1710
|
+
return (0, import_react14.useMemo)(
|
|
1685
1711
|
() => ({
|
|
1686
1712
|
...controller,
|
|
1687
1713
|
/** Drop marker of the active reorder drag (flow coordinates). */
|
|
@@ -1695,47 +1721,47 @@ function useCanvasAutoLayout(options) {
|
|
|
1695
1721
|
}
|
|
1696
1722
|
|
|
1697
1723
|
// src/canvas/useCanvasTokens.ts
|
|
1698
|
-
var
|
|
1699
|
-
var
|
|
1724
|
+
var import_react15 = require("react");
|
|
1725
|
+
var import_canvas14 = require("@pixerate/editor/canvas");
|
|
1700
1726
|
function useCanvasTokens(options) {
|
|
1701
1727
|
const { store, nodes, setNodes, modes, properties } = options;
|
|
1702
|
-
const state = (0,
|
|
1703
|
-
const latest = (0,
|
|
1728
|
+
const state = (0, import_react15.useSyncExternalStore)(store.subscribe, store.getState, store.getState);
|
|
1729
|
+
const latest = (0, import_react15.useRef)({ nodes, setNodes, modes, properties });
|
|
1704
1730
|
latest.current = { nodes, setNodes, modes, properties };
|
|
1705
1731
|
const opts = () => ({ modes: latest.current.modes, properties: latest.current.properties });
|
|
1706
|
-
(0,
|
|
1732
|
+
(0, import_react15.useEffect)(
|
|
1707
1733
|
() => store.subscribe((event) => {
|
|
1708
1734
|
if (event.deletedVariableIds.length === 0) return;
|
|
1709
|
-
latest.current.setNodes((prev) => (0,
|
|
1735
|
+
latest.current.setNodes((prev) => (0, import_canvas14.detachTokenBindings)(prev, event.previous, event.deletedVariableIds, opts()));
|
|
1710
1736
|
}),
|
|
1711
1737
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1712
1738
|
[store]
|
|
1713
1739
|
);
|
|
1714
1740
|
const modesKey = JSON.stringify(modes ?? {});
|
|
1715
|
-
(0,
|
|
1716
|
-
const next = (0,
|
|
1741
|
+
(0, import_react15.useEffect)(() => {
|
|
1742
|
+
const next = (0, import_canvas14.resolveCanvasTokens)(nodes, state, opts());
|
|
1717
1743
|
if (next !== nodes) setNodes(next);
|
|
1718
1744
|
}, [nodes, state, modesKey, properties]);
|
|
1719
|
-
const bind = (0,
|
|
1745
|
+
const bind = (0, import_react15.useCallback)(
|
|
1720
1746
|
(ids, propertyKey, variableId) => {
|
|
1721
|
-
const next = (0,
|
|
1747
|
+
const next = (0, import_canvas14.bindCanvasToken)(latest.current.nodes, ids, propertyKey, variableId, store.getState(), opts());
|
|
1722
1748
|
if (next !== latest.current.nodes) latest.current.setNodes(next);
|
|
1723
1749
|
},
|
|
1724
1750
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1725
1751
|
[store]
|
|
1726
1752
|
);
|
|
1727
|
-
const setMode = (0,
|
|
1753
|
+
const setMode = (0, import_react15.useCallback)(
|
|
1728
1754
|
(ids, collectionId, modeId) => {
|
|
1729
|
-
const next = (0,
|
|
1755
|
+
const next = (0, import_canvas14.setCanvasTokenMode)(latest.current.nodes, ids, collectionId, modeId, store.getState(), opts());
|
|
1730
1756
|
if (next !== latest.current.nodes) latest.current.setNodes(next);
|
|
1731
1757
|
},
|
|
1732
1758
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1733
1759
|
[store]
|
|
1734
1760
|
);
|
|
1735
|
-
const modesOf = (0,
|
|
1761
|
+
const modesOf = (0, import_react15.useCallback)(
|
|
1736
1762
|
(nodeId) => {
|
|
1737
1763
|
const node = latest.current.nodes.find((n) => n.id === nodeId);
|
|
1738
|
-
return node ? (0,
|
|
1764
|
+
return node ? (0, import_canvas14.getEffectiveTokenModes)(node, latest.current.nodes, store.getState(), opts()) : {};
|
|
1739
1765
|
},
|
|
1740
1766
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1741
1767
|
[store]
|
|
@@ -1744,7 +1770,7 @@ function useCanvasTokens(options) {
|
|
|
1744
1770
|
}
|
|
1745
1771
|
|
|
1746
1772
|
// src/canvas/TokenBindingPicker.tsx
|
|
1747
|
-
var
|
|
1773
|
+
var import_canvas15 = require("@pixerate/editor/canvas");
|
|
1748
1774
|
var import_tokens = require("@pixerate/editor/tokens");
|
|
1749
1775
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1750
1776
|
function TokenBindingPicker({
|
|
@@ -1760,14 +1786,14 @@ function TokenBindingPicker({
|
|
|
1760
1786
|
const selected = nodes.filter((n) => selectedIds.includes(n.id));
|
|
1761
1787
|
const first = selected[0];
|
|
1762
1788
|
if (!first) return null;
|
|
1763
|
-
let rows = (0,
|
|
1789
|
+
let rows = (0, import_canvas15.getBindableTokenProperties)(first, options);
|
|
1764
1790
|
if (properties) rows = properties.map((key) => rows.find((p) => p.key === key)).filter((p) => !!p);
|
|
1765
|
-
const modes = (0,
|
|
1791
|
+
const modes = (0, import_canvas15.getEffectiveTokenModes)(first, nodes, state, options);
|
|
1766
1792
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { "data-token-binding-picker": "", className: `flex flex-col gap-1 text-xs text-foreground ${className}`, children: [
|
|
1767
1793
|
rows.map((property) => {
|
|
1768
|
-
const ids = new Set(selected.map((n) => (0,
|
|
1794
|
+
const ids = new Set(selected.map((n) => (0, import_canvas15.getNodeTokenBindings)(n)[property.key] ?? ""));
|
|
1769
1795
|
const value = ids.size === 1 ? [...ids][0] : "__mixed";
|
|
1770
|
-
const candidates = (0,
|
|
1796
|
+
const candidates = (0, import_canvas15.getTokensForProperty)(state, property, first);
|
|
1771
1797
|
const resolved = value && value !== "__mixed" ? (0, import_tokens.resolveToken)(state, value, modes) : null;
|
|
1772
1798
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { className: "flex items-center gap-2", "data-token-property": property.key, children: [
|
|
1773
1799
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "w-28 shrink-0 text-muted-foreground", children: property.label }),
|
|
@@ -1780,7 +1806,7 @@ function TokenBindingPicker({
|
|
|
1780
1806
|
onChange: (e) => {
|
|
1781
1807
|
const id = e.currentTarget.value || null;
|
|
1782
1808
|
try {
|
|
1783
|
-
onChange((0,
|
|
1809
|
+
onChange((0, import_canvas15.bindCanvasToken)(nodes, selectedIds, property.key, id, state, options));
|
|
1784
1810
|
} catch (error) {
|
|
1785
1811
|
onError?.(error);
|
|
1786
1812
|
}
|
|
@@ -1822,9 +1848,9 @@ function TokenModeSwitcher({
|
|
|
1822
1848
|
}) {
|
|
1823
1849
|
const first = nodes.find((n) => nodeIds.includes(n.id));
|
|
1824
1850
|
if (!first) return null;
|
|
1825
|
-
const own = (0,
|
|
1851
|
+
const own = (0, import_canvas15.getNodeTokenModes)(first);
|
|
1826
1852
|
const parent = first.parentId ? nodes.find((n) => n.id === first.parentId) : void 0;
|
|
1827
|
-
const inherited = parent ? (0,
|
|
1853
|
+
const inherited = parent ? (0, import_canvas15.getEffectiveTokenModes)(parent, nodes, state, options) : { ...options.modes };
|
|
1828
1854
|
const collections = state.collections.filter((c) => showSingleMode || c.modes.length > 1);
|
|
1829
1855
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { "data-token-mode-switcher": "", className: `flex flex-col gap-1 text-xs text-foreground ${className}`, children: collections.map((collection) => {
|
|
1830
1856
|
const auto = (0, import_tokens.getCurrentMode)(collection, inherited);
|
|
@@ -1837,7 +1863,7 @@ function TokenModeSwitcher({
|
|
|
1837
1863
|
"aria-label": `${collection.name} mode`,
|
|
1838
1864
|
className: "min-w-0 flex-1 rounded border border-border bg-background px-1 py-0.5 text-xs",
|
|
1839
1865
|
value: explicit,
|
|
1840
|
-
onChange: (e) => onChange((0,
|
|
1866
|
+
onChange: (e) => onChange((0, import_canvas15.setCanvasTokenMode)(nodes, nodeIds, collection.id, e.currentTarget.value || null, state, options)),
|
|
1841
1867
|
children: [
|
|
1842
1868
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("option", { value: "", children: [
|
|
1843
1869
|
"Auto (",
|
|
@@ -1853,18 +1879,18 @@ function TokenModeSwitcher({
|
|
|
1853
1879
|
}
|
|
1854
1880
|
|
|
1855
1881
|
// src/canvas/index.ts
|
|
1856
|
-
var
|
|
1882
|
+
var import_canvas30 = require("@pixerate/editor/canvas");
|
|
1857
1883
|
|
|
1858
1884
|
// src/canvas/useCanvasAnimation.ts
|
|
1859
|
-
var
|
|
1860
|
-
var
|
|
1885
|
+
var import_react16 = require("react");
|
|
1886
|
+
var import_canvas16 = require("@pixerate/editor/canvas");
|
|
1861
1887
|
function useCanvasAnimation(options) {
|
|
1862
|
-
const nodesRef = (0,
|
|
1888
|
+
const nodesRef = (0, import_react16.useRef)(options.nodes);
|
|
1863
1889
|
nodesRef.current = options.nodes;
|
|
1864
|
-
const optionsRef = (0,
|
|
1890
|
+
const optionsRef = (0, import_react16.useRef)(options);
|
|
1865
1891
|
optionsRef.current = options;
|
|
1866
|
-
const controller = (0,
|
|
1867
|
-
() => (0,
|
|
1892
|
+
const controller = (0, import_react16.useMemo)(
|
|
1893
|
+
() => (0, import_canvas16.createCanvasAnimationController)({
|
|
1868
1894
|
getNodes: () => nodesRef.current,
|
|
1869
1895
|
setNodes: (next) => {
|
|
1870
1896
|
nodesRef.current = next;
|
|
@@ -1890,26 +1916,26 @@ function useCanvasAnimation(options) {
|
|
|
1890
1916
|
}),
|
|
1891
1917
|
[]
|
|
1892
1918
|
);
|
|
1893
|
-
(0,
|
|
1894
|
-
(0,
|
|
1919
|
+
(0, import_react16.useEffect)(() => () => controller.destroy(), [controller]);
|
|
1920
|
+
(0, import_react16.useEffect)(() => {
|
|
1895
1921
|
if (options.loop !== void 0) controller.setLoop(options.loop);
|
|
1896
1922
|
}, [controller, options.loop]);
|
|
1897
|
-
(0,
|
|
1923
|
+
(0, import_react16.useEffect)(() => {
|
|
1898
1924
|
if (options.playbackRate !== void 0) controller.setPlaybackRate(options.playbackRate);
|
|
1899
1925
|
}, [controller, options.playbackRate]);
|
|
1900
|
-
(0,
|
|
1926
|
+
(0, import_react16.useEffect)(() => {
|
|
1901
1927
|
if (options.recording !== void 0) controller.setRecording(options.recording);
|
|
1902
1928
|
}, [controller, options.recording]);
|
|
1903
|
-
const state = (0,
|
|
1929
|
+
const state = (0, import_react16.useSyncExternalStore)(
|
|
1904
1930
|
(listener) => controller.subscribe(listener),
|
|
1905
1931
|
() => controller.getState(),
|
|
1906
1932
|
() => controller.getState()
|
|
1907
1933
|
);
|
|
1908
|
-
(0,
|
|
1934
|
+
(0, import_react16.useEffect)(() => {
|
|
1909
1935
|
controller.refresh();
|
|
1910
1936
|
}, [controller, options.nodes]);
|
|
1911
|
-
const displayNodes = (0,
|
|
1912
|
-
return (0,
|
|
1937
|
+
const displayNodes = (0, import_react16.useMemo)(() => controller.display(options.nodes), [controller, options.nodes, state.time]);
|
|
1938
|
+
return (0, import_react16.useMemo)(
|
|
1913
1939
|
() => ({
|
|
1914
1940
|
...controller,
|
|
1915
1941
|
state,
|
|
@@ -1930,8 +1956,8 @@ function useCanvasAnimation(options) {
|
|
|
1930
1956
|
}
|
|
1931
1957
|
|
|
1932
1958
|
// src/canvas/AnimationTimeline.tsx
|
|
1933
|
-
var
|
|
1934
|
-
var
|
|
1959
|
+
var import_react17 = require("react");
|
|
1960
|
+
var import_canvas17 = require("@pixerate/editor/canvas");
|
|
1935
1961
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1936
1962
|
var LOOP_LABELS = { none: "Once", loop: "Loop", "ping-pong": "Ping-pong" };
|
|
1937
1963
|
var easingValue = (easing) => typeof easing === "string" ? easing : easing ? "custom" : "linear";
|
|
@@ -1939,15 +1965,15 @@ function AnimationTimeline({ animation, nodeIds, width = 360, snapThreshold = 8,
|
|
|
1939
1965
|
const { state } = animation;
|
|
1940
1966
|
const duration = state.duration;
|
|
1941
1967
|
const rows = animation.timelineRows(nodeIds ?? void 0, labelOf ? { labelOf } : {});
|
|
1942
|
-
const ticks = (0,
|
|
1968
|
+
const ticks = (0, import_canvas17.getTimelineTicks)(duration, width);
|
|
1943
1969
|
const selectedEasing = (() => {
|
|
1944
1970
|
const first = state.selection[0];
|
|
1945
1971
|
if (!first) return "";
|
|
1946
1972
|
for (const row of rows) for (const k of row.keyframes) if (k.selected && k.ref.property === first.property && k.ref.nodeId === first.nodeId) return easingValue(k.easing);
|
|
1947
1973
|
return "";
|
|
1948
1974
|
})();
|
|
1949
|
-
const dragRef = (0,
|
|
1950
|
-
(0,
|
|
1975
|
+
const dragRef = (0, import_react17.useRef)(null);
|
|
1976
|
+
(0, import_react17.useEffect)(() => {
|
|
1951
1977
|
const onKey = (event) => {
|
|
1952
1978
|
if (event.key === "Escape" && dragRef.current) {
|
|
1953
1979
|
dragRef.current = null;
|
|
@@ -1960,8 +1986,8 @@ function AnimationTimeline({ animation, nodeIds, width = 360, snapThreshold = 8,
|
|
|
1960
1986
|
const onRulerDown = (event) => {
|
|
1961
1987
|
const lane = event.currentTarget;
|
|
1962
1988
|
const left = lane.getBoundingClientRect().left;
|
|
1963
|
-
animation.scrub((0,
|
|
1964
|
-
const move = (e) => animation.scrub((0,
|
|
1989
|
+
animation.scrub((0, import_canvas17.xToTime)(event.clientX - left, duration, width));
|
|
1990
|
+
const move = (e) => animation.scrub((0, import_canvas17.xToTime)(e.clientX - left, duration, width));
|
|
1965
1991
|
const up = () => {
|
|
1966
1992
|
window.removeEventListener("pointermove", move);
|
|
1967
1993
|
window.removeEventListener("pointerup", up);
|
|
@@ -2001,7 +2027,7 @@ function AnimationTimeline({ animation, nodeIds, width = 360, snapThreshold = 8,
|
|
|
2001
2027
|
}
|
|
2002
2028
|
};
|
|
2003
2029
|
const btn = "rounded border border-border px-2 py-0.5 text-xs hover:bg-muted disabled:opacity-50";
|
|
2004
|
-
const playheadX = (0,
|
|
2030
|
+
const playheadX = (0, import_canvas17.timeToX)(state.time, duration, width);
|
|
2005
2031
|
const labelWidth = 120;
|
|
2006
2032
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { "data-animation-timeline": "", className: `flex flex-col gap-1 text-xs text-foreground ${className}`, tabIndex: 0, onKeyDown: onTimelineKey, children: [
|
|
2007
2033
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex flex-wrap items-center gap-2", role: "toolbar", "aria-label": "Animation", children: [
|
|
@@ -2020,9 +2046,9 @@ function AnimationTimeline({ animation, nodeIds, width = 360, snapThreshold = 8,
|
|
|
2020
2046
|
),
|
|
2021
2047
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: btn, "data-action": "add-keyframe", onClick: () => animation.addKeyframe(), children: "\u25C6 Key" }),
|
|
2022
2048
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { "data-time": "", className: "tabular-nums text-muted-foreground", children: [
|
|
2023
|
-
(0,
|
|
2049
|
+
(0, import_canvas17.formatAnimationTime)(state.time),
|
|
2024
2050
|
" / ",
|
|
2025
|
-
(0,
|
|
2051
|
+
(0, import_canvas17.formatAnimationTime)(duration)
|
|
2026
2052
|
] }),
|
|
2027
2053
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
2028
2054
|
"select",
|
|
@@ -2035,7 +2061,7 @@ function AnimationTimeline({ animation, nodeIds, width = 360, snapThreshold = 8,
|
|
|
2035
2061
|
onChange: (e) => e.target.value && e.target.value !== "custom" && animation.setEasing(e.target.value),
|
|
2036
2062
|
children: [
|
|
2037
2063
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "", children: "Easing\u2026" }),
|
|
2038
|
-
|
|
2064
|
+
import_canvas17.ANIMATION_EASING_PRESETS.map((preset) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: preset, children: import_canvas17.ANIMATION_EASING_LABELS[preset] }, preset)),
|
|
2039
2065
|
selectedEasing === "custom" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "custom", children: "Custom" }) : null
|
|
2040
2066
|
]
|
|
2041
2067
|
}
|
|
@@ -2086,17 +2112,17 @@ function AnimationTimeline({ animation, nodeIds, width = 360, snapThreshold = 8,
|
|
|
2086
2112
|
] }),
|
|
2087
2113
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { "data-lane": "", className: `relative h-5 rounded bg-muted/40 ${row.enabled ? "" : "opacity-50"}`, style: { width }, children: [
|
|
2088
2114
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "pointer-events-none absolute top-0 h-5 w-px bg-red-500/60", style: { left: playheadX } }),
|
|
2089
|
-
state.drag?.target != null ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { "data-snap-target": "", className: "pointer-events-none absolute top-0 h-5 w-px bg-sky-400", style: { left: (0,
|
|
2115
|
+
state.drag?.target != null ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { "data-snap-target": "", className: "pointer-events-none absolute top-0 h-5 w-px bg-sky-400", style: { left: (0, import_canvas17.timeToX)(state.drag.target, duration, width) } }) : null,
|
|
2090
2116
|
row.keyframes.map((k) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
2091
2117
|
"button",
|
|
2092
2118
|
{
|
|
2093
2119
|
type: "button",
|
|
2094
2120
|
"data-keyframe": k.ref.time,
|
|
2095
2121
|
"aria-pressed": k.selected,
|
|
2096
|
-
"aria-label": `${row.label} keyframe at ${(0,
|
|
2097
|
-
title: `${(0,
|
|
2122
|
+
"aria-label": `${row.label} keyframe at ${(0, import_canvas17.formatAnimationTime)(k.ref.time)}`,
|
|
2123
|
+
title: `${(0, import_canvas17.formatAnimationTime)(k.time)} \xB7 ${String(k.value)}`,
|
|
2098
2124
|
className: `absolute top-1/2 h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rotate-45 border ${k.selected ? "border-sky-300 bg-sky-500" : "border-foreground/60 bg-background"} ${k.easing === "hold" ? "rounded-none" : "rounded-[1px]"}`,
|
|
2099
|
-
style: { left: (0,
|
|
2125
|
+
style: { left: (0, import_canvas17.timeToX)(k.time, duration, width) },
|
|
2100
2126
|
onPointerDown: onKeyDown(k.ref)
|
|
2101
2127
|
},
|
|
2102
2128
|
k.ref.time
|
|
@@ -2107,18 +2133,18 @@ function AnimationTimeline({ animation, nodeIds, width = 360, snapThreshold = 8,
|
|
|
2107
2133
|
}
|
|
2108
2134
|
|
|
2109
2135
|
// src/canvas/index.ts
|
|
2110
|
-
var
|
|
2136
|
+
var import_canvas31 = require("@pixerate/editor/canvas");
|
|
2111
2137
|
|
|
2112
2138
|
// src/canvas/useCanvasComponents.ts
|
|
2113
|
-
var
|
|
2114
|
-
var
|
|
2139
|
+
var import_react18 = require("react");
|
|
2140
|
+
var import_canvas18 = require("@pixerate/editor/canvas");
|
|
2115
2141
|
function useCanvasComponents(options) {
|
|
2116
|
-
const nodesRef = (0,
|
|
2142
|
+
const nodesRef = (0, import_react18.useRef)(options.nodes);
|
|
2117
2143
|
nodesRef.current = options.nodes;
|
|
2118
|
-
const optionsRef = (0,
|
|
2144
|
+
const optionsRef = (0, import_react18.useRef)(options);
|
|
2119
2145
|
optionsRef.current = options;
|
|
2120
|
-
const controller = (0,
|
|
2121
|
-
() => (0,
|
|
2146
|
+
const controller = (0, import_react18.useMemo)(
|
|
2147
|
+
() => (0, import_canvas18.createCanvasComponentsController)({
|
|
2122
2148
|
getNodes: () => nodesRef.current,
|
|
2123
2149
|
setNodes: (next) => {
|
|
2124
2150
|
nodesRef.current = next;
|
|
@@ -2146,15 +2172,15 @@ function useCanvasComponents(options) {
|
|
|
2146
2172
|
}),
|
|
2147
2173
|
[]
|
|
2148
2174
|
);
|
|
2149
|
-
(0,
|
|
2175
|
+
(0, import_react18.useLayoutEffect)(() => {
|
|
2150
2176
|
if (optionsRef.current.autoSync !== false) controller.sync();
|
|
2151
2177
|
}, [options.nodes, controller]);
|
|
2152
2178
|
return controller;
|
|
2153
2179
|
}
|
|
2154
2180
|
|
|
2155
2181
|
// src/canvas/CanvasComponentsPanel.tsx
|
|
2156
|
-
var
|
|
2157
|
-
var
|
|
2182
|
+
var import_react19 = require("react");
|
|
2183
|
+
var import_canvas19 = require("@pixerate/editor/canvas");
|
|
2158
2184
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
2159
2185
|
function InlineField({ value, label, onCommit }) {
|
|
2160
2186
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
@@ -2188,11 +2214,11 @@ function CanvasComponentsPanel({
|
|
|
2188
2214
|
search = true,
|
|
2189
2215
|
className = ""
|
|
2190
2216
|
}) {
|
|
2191
|
-
const [query, setQuery] = (0,
|
|
2192
|
-
const [propsOpen, setPropsOpen] = (0,
|
|
2193
|
-
const [menuFor, setMenuFor] = (0,
|
|
2194
|
-
const [editing, setEditing] = (0,
|
|
2195
|
-
const { components: all, sets } = (0,
|
|
2217
|
+
const [query, setQuery] = (0, import_react19.useState)("");
|
|
2218
|
+
const [propsOpen, setPropsOpen] = (0, import_react19.useState)(null);
|
|
2219
|
+
const [menuFor, setMenuFor] = (0, import_react19.useState)(null);
|
|
2220
|
+
const [editing, setEditing] = (0, import_react19.useState)(null);
|
|
2221
|
+
const { components: all, sets } = (0, import_canvas19.listCanvasComponents)(nodes);
|
|
2196
2222
|
const q = query.trim().toLowerCase();
|
|
2197
2223
|
const match = (name) => !q || name.toLowerCase().includes(q);
|
|
2198
2224
|
const lone = all.filter((c) => !c.setId && match(c.name));
|
|
@@ -2215,7 +2241,7 @@ function CanvasComponentsPanel({
|
|
|
2215
2241
|
onClick: () => onInsert(id),
|
|
2216
2242
|
onContextMenu,
|
|
2217
2243
|
onDragStart: (e) => {
|
|
2218
|
-
e.dataTransfer.setData(
|
|
2244
|
+
e.dataTransfer.setData(import_canvas19.CANVAS_COMPONENT_DRAG_TYPE, id);
|
|
2219
2245
|
e.dataTransfer.setData("text/plain", name);
|
|
2220
2246
|
e.dataTransfer.effectAllowed = "copy";
|
|
2221
2247
|
},
|
|
@@ -2409,13 +2435,13 @@ function CanvasInstanceInspector({
|
|
|
2409
2435
|
onError,
|
|
2410
2436
|
className = ""
|
|
2411
2437
|
}) {
|
|
2412
|
-
const info = nodeId ? (0,
|
|
2438
|
+
const info = nodeId ? (0, import_canvas19.inspectCanvasInstance)(nodes, nodeId) : void 0;
|
|
2413
2439
|
if (!info) return null;
|
|
2414
2440
|
const report = (result) => {
|
|
2415
2441
|
if (result && !result.ok && result.reason) onError?.(result.reason);
|
|
2416
2442
|
};
|
|
2417
2443
|
const setProp = (name, value) => report(components.setInstanceProperties({ [name]: value }, [info.id]));
|
|
2418
|
-
const allComponents = (0,
|
|
2444
|
+
const allComponents = (0, import_canvas19.listCanvasComponents)(nodes).components;
|
|
2419
2445
|
const linked = info.status === "linked";
|
|
2420
2446
|
const btn = "rounded border border-border px-2 py-0.5 text-xs hover:bg-muted disabled:opacity-40";
|
|
2421
2447
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { "data-instance-inspector": "", "data-instance-id": info.id, className: `flex flex-col gap-2 text-xs text-foreground ${className}`, children: [
|
|
@@ -2518,11 +2544,11 @@ function CanvasInstanceInspector({
|
|
|
2518
2544
|
}
|
|
2519
2545
|
|
|
2520
2546
|
// src/canvas/index.ts
|
|
2521
|
-
var
|
|
2547
|
+
var import_canvas32 = require("@pixerate/editor/canvas");
|
|
2522
2548
|
|
|
2523
2549
|
// src/canvas/MermaidFamilyScene.tsx
|
|
2524
|
-
var
|
|
2525
|
-
var
|
|
2550
|
+
var import_react20 = require("react");
|
|
2551
|
+
var import_canvas20 = require("@pixerate/editor/canvas");
|
|
2526
2552
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
2527
2553
|
function MermaidFamilyScene({
|
|
2528
2554
|
scene,
|
|
@@ -2536,7 +2562,7 @@ function MermaidFamilyScene({
|
|
|
2536
2562
|
style,
|
|
2537
2563
|
title
|
|
2538
2564
|
}) {
|
|
2539
|
-
const uid = (0,
|
|
2565
|
+
const uid = (0, import_react20.useId)().replace(/:/g, "");
|
|
2540
2566
|
const marker = (kind) => kind ? `url(#${uid}-${kind})` : void 0;
|
|
2541
2567
|
const x = scene.x - padding;
|
|
2542
2568
|
const y = scene.y - padding;
|
|
@@ -2629,7 +2655,7 @@ function MermaidFamilyScene({
|
|
|
2629
2655
|
x: mark.x,
|
|
2630
2656
|
y: mark.y,
|
|
2631
2657
|
textAnchor: mark.anchor,
|
|
2632
|
-
dominantBaseline: (0,
|
|
2658
|
+
dominantBaseline: (0, import_canvas20.diagramTextBaseline)(mark.baseline),
|
|
2633
2659
|
transform: mark.rotate ? `rotate(${mark.rotate} ${mark.x} ${mark.y})` : void 0,
|
|
2634
2660
|
style: {
|
|
2635
2661
|
fill: mark.selected ? selectionColor : mark.fill,
|
|
@@ -2650,14 +2676,14 @@ function MermaidFamilyScene({
|
|
|
2650
2676
|
}
|
|
2651
2677
|
|
|
2652
2678
|
// src/canvas/useMermaidDiagram.ts
|
|
2653
|
-
var
|
|
2679
|
+
var import_react21 = require("react");
|
|
2654
2680
|
var import_diagram = require("@pixerate/editor/diagram");
|
|
2655
|
-
var
|
|
2681
|
+
var import_canvas21 = require("@pixerate/editor/canvas");
|
|
2656
2682
|
function useDiagramState(controller) {
|
|
2657
|
-
return (0,
|
|
2683
|
+
return (0, import_react21.useSyncExternalStore)(controller.subscribe, controller.getState, controller.getState);
|
|
2658
2684
|
}
|
|
2659
2685
|
function useMermaidDiagram(controllerOrOptions = {}, view = {}) {
|
|
2660
|
-
const own = (0,
|
|
2686
|
+
const own = (0, import_react21.useRef)(null);
|
|
2661
2687
|
let controller;
|
|
2662
2688
|
if (controllerOrOptions instanceof import_diagram.DiagramController) controller = controllerOrOptions;
|
|
2663
2689
|
else {
|
|
@@ -2667,24 +2693,24 @@ function useMermaidDiagram(controllerOrOptions = {}, view = {}) {
|
|
|
2667
2693
|
const layoutOptions = (controllerOrOptions instanceof import_diagram.DiagramController ? void 0 : controllerOrOptions.layoutOptions) ?? view.layoutOptions;
|
|
2668
2694
|
const sceneTheme = (controllerOrOptions instanceof import_diagram.DiagramController ? void 0 : controllerOrOptions.sceneTheme) ?? view.sceneTheme;
|
|
2669
2695
|
const state = useDiagramState(controller);
|
|
2670
|
-
const canvas = (0,
|
|
2671
|
-
() => (0,
|
|
2696
|
+
const canvas = (0, import_react21.useMemo)(
|
|
2697
|
+
() => (0, import_canvas21.mermaidToCanvas)(state.document, { ...layoutOptions, editable: state.editable }),
|
|
2672
2698
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2673
2699
|
[state.document, state.editable]
|
|
2674
2700
|
);
|
|
2675
|
-
const scene = (0,
|
|
2676
|
-
() => state.document.tier === "editable" ? (0,
|
|
2701
|
+
const scene = (0, import_react21.useMemo)(
|
|
2702
|
+
() => state.document.tier === "editable" ? (0, import_canvas21.familySceneFromLayout)(state.document.family, state.document.graph, canvas.layout, { theme: { ...import_canvas21.CSS_VARIABLE_DIAGRAM_SCENE_THEME, ...sceneTheme }, selection: state.selection }) : null,
|
|
2677
2703
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2678
2704
|
[state.document, canvas.layout, state.selection]
|
|
2679
2705
|
);
|
|
2680
|
-
const layoutRef = (0,
|
|
2706
|
+
const layoutRef = (0, import_react21.useRef)(canvas.layout);
|
|
2681
2707
|
layoutRef.current = canvas.layout;
|
|
2682
|
-
const actions = (0,
|
|
2708
|
+
const actions = (0, import_react21.useMemo)(
|
|
2683
2709
|
() => ({
|
|
2684
2710
|
apply: (ops, label) => controller.apply(ops, label),
|
|
2685
2711
|
load: (source, options) => controller.load(source, options),
|
|
2686
2712
|
moveNodes: (moved, all = moved) => {
|
|
2687
|
-
const op = (0,
|
|
2713
|
+
const op = (0, import_canvas21.mermaidMovesFromCanvas)(layoutRef.current, moved, all, { stored: controller.getDocument().meta.layout ?? {} });
|
|
2688
2714
|
return op ? controller.apply(op, "Move") : null;
|
|
2689
2715
|
},
|
|
2690
2716
|
connect: (source, target, label) => controller.apply({ type: "addEdge", edge: { source, target, ...label ? { label } : {} } }, "Connect"),
|
|
@@ -2703,7 +2729,7 @@ function useMermaidDiagram(controllerOrOptions = {}, view = {}) {
|
|
|
2703
2729
|
"Rename"
|
|
2704
2730
|
),
|
|
2705
2731
|
renameTarget: (target, label) => {
|
|
2706
|
-
const op = (0,
|
|
2732
|
+
const op = (0, import_canvas21.diagramRenameOp)(controller.getDocument(), target, label);
|
|
2707
2733
|
return op ? controller.apply(op, "Rename") : null;
|
|
2708
2734
|
},
|
|
2709
2735
|
select: (ids) => controller.select(ids),
|
|
@@ -2716,13 +2742,13 @@ function useMermaidDiagram(controllerOrOptions = {}, view = {}) {
|
|
|
2716
2742
|
}
|
|
2717
2743
|
function useMermaidStream(source, options = {}) {
|
|
2718
2744
|
const { complete = false, duration = 300, ...layoutOptions } = options;
|
|
2719
|
-
const stream = (0,
|
|
2720
|
-
if (!stream.current) stream.current = new
|
|
2721
|
-
const result = (0,
|
|
2722
|
-
const [shown, setShown] = (0,
|
|
2723
|
-
const shownRef = (0,
|
|
2745
|
+
const stream = (0, import_react21.useRef)(null);
|
|
2746
|
+
if (!stream.current) stream.current = new import_canvas21.DiagramStream(layoutOptions);
|
|
2747
|
+
const result = (0, import_react21.useMemo)(() => stream.current.update(source, complete), [source, complete]);
|
|
2748
|
+
const [shown, setShown] = (0, import_react21.useState)({ layout: result.layout, settled: true });
|
|
2749
|
+
const shownRef = (0, import_react21.useRef)(shown.layout);
|
|
2724
2750
|
shownRef.current = shown.layout;
|
|
2725
|
-
(0,
|
|
2751
|
+
(0, import_react21.useEffect)(() => {
|
|
2726
2752
|
const target = result.layout;
|
|
2727
2753
|
if (!target) return setShown({ layout: null, settled: true });
|
|
2728
2754
|
const from = shownRef.current;
|
|
@@ -2732,14 +2758,14 @@ function useMermaidStream(source, options = {}) {
|
|
|
2732
2758
|
const start = performance.now();
|
|
2733
2759
|
const step = () => {
|
|
2734
2760
|
const t = Math.min(1, (performance.now() - start) / duration);
|
|
2735
|
-
setShown({ layout: (0,
|
|
2761
|
+
setShown({ layout: (0, import_canvas21.blendDiagramLayout)(from, target, (0, import_canvas21.easeDiagramTween)(t)), settled: t >= 1 });
|
|
2736
2762
|
if (t < 1) frame = requestAnimationFrame(step);
|
|
2737
2763
|
};
|
|
2738
2764
|
frame = requestAnimationFrame(step);
|
|
2739
2765
|
return () => cancelAnimationFrame(frame);
|
|
2740
2766
|
}, [result.layout, duration]);
|
|
2741
2767
|
const doc = result.document.tier === "editable" ? result.document : null;
|
|
2742
|
-
const canvas = (0,
|
|
2768
|
+
const canvas = (0, import_react21.useMemo)(() => {
|
|
2743
2769
|
if (!doc || !shown.layout) return { nodes: [], edges: [] };
|
|
2744
2770
|
const placed = new Set(Object.keys(shown.layout.positions));
|
|
2745
2771
|
const graph = {
|
|
@@ -2748,23 +2774,23 @@ function useMermaidStream(source, options = {}) {
|
|
|
2748
2774
|
groups: doc.graph.groups.filter((g) => placed.has(g.id)),
|
|
2749
2775
|
edges: doc.graph.edges.filter((e) => placed.has(e.source) && placed.has(e.target))
|
|
2750
2776
|
};
|
|
2751
|
-
return (0,
|
|
2777
|
+
return (0, import_canvas21.mermaidToCanvas)({ ...doc, graph }, { layout: shown.layout });
|
|
2752
2778
|
}, [doc, shown.layout]);
|
|
2753
2779
|
return { document: doc, ...canvas, layout: shown.layout, settled: shown.settled };
|
|
2754
2780
|
}
|
|
2755
2781
|
|
|
2756
2782
|
// src/canvas/MermaidDiagramNode.tsx
|
|
2757
|
-
var
|
|
2783
|
+
var import_canvas22 = require("@pixerate/editor/canvas");
|
|
2758
2784
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2759
2785
|
function mermaidNodeStyle(styles = {}, selected = false) {
|
|
2760
|
-
const paint = (0,
|
|
2786
|
+
const paint = (0, import_canvas22.mermaidNodePaint)(styles, selected);
|
|
2761
2787
|
const { color, "stroke-width": strokeWidth, "stroke-dasharray": strokeDasharray, ...vars } = paint;
|
|
2762
2788
|
return { ...vars, color, strokeWidth, strokeDasharray };
|
|
2763
2789
|
}
|
|
2764
2790
|
function MermaidDiagramNode({ data, width = 160, height = 56, selected, className = "", children }) {
|
|
2765
2791
|
const node = data.node;
|
|
2766
2792
|
if (!node) return null;
|
|
2767
|
-
const members = (0,
|
|
2793
|
+
const members = (0, import_canvas22.mermaidNodeMembers)(node.data);
|
|
2768
2794
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2769
2795
|
"div",
|
|
2770
2796
|
{
|
|
@@ -2773,13 +2799,13 @@ function MermaidDiagramNode({ data, width = 160, height = 56, selected, classNam
|
|
|
2773
2799
|
"data-selected": selected ? "true" : void 0,
|
|
2774
2800
|
style: { position: "relative", width: "100%", height: "100%", ...mermaidNodeStyle(data.resolvedStyles, selected) },
|
|
2775
2801
|
children: [
|
|
2776
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { viewBox: `0 0 ${width} ${height}`, preserveAspectRatio: "none", width: "100%", height: "100%", style: { position: "absolute", inset: 0, overflow: "visible" }, "aria-hidden": "true", children: (0,
|
|
2802
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { viewBox: `0 0 ${width} ${height}`, preserveAspectRatio: "none", width: "100%", height: "100%", style: { position: "absolute", inset: 0, overflow: "visible" }, "aria-hidden": "true", children: (0, import_canvas22.mermaidShapePaths)(node.shape, width, height).map((path, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: path.d, style: { ...import_canvas22.MERMAID_SHAPE_PAINT[path.paint], vectorEffect: "non-scaling-stroke" } }, i)) }),
|
|
2777
2803
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2778
2804
|
"div",
|
|
2779
2805
|
{
|
|
2780
2806
|
style: { position: "relative", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: members.length ? "flex-start" : "center", height: "100%", padding: "6px 10px", boxSizing: "border-box", fontSize: 13, lineHeight: 1.3, textAlign: "center", pointerEvents: "none" },
|
|
2781
2807
|
children: [
|
|
2782
|
-
(0,
|
|
2808
|
+
(0, import_canvas22.mermaidLabelLines)(node.label).map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: { fontWeight: members.length ? 600 : void 0 }, children: line }, i)),
|
|
2783
2809
|
members.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { alignSelf: "stretch", marginTop: 4, paddingTop: 4, borderTop: "1px solid var(--pixerate-diagram-node-border)", textAlign: "left", fontSize: 12 }, children: members.map((m, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { children: m }, i)) })
|
|
2784
2810
|
]
|
|
2785
2811
|
}
|
|
@@ -2807,7 +2833,7 @@ function MermaidDiagramGroup({ data, selected, className = "", children }) {
|
|
|
2807
2833
|
color: data.resolvedStyles?.color ?? "var(--muted-foreground, #475569)"
|
|
2808
2834
|
},
|
|
2809
2835
|
children: [
|
|
2810
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { padding: "6px 10px", fontSize: 12, fontWeight: 600 }, children: (0,
|
|
2836
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { padding: "6px 10px", fontSize: 12, fontWeight: 600 }, children: (0, import_canvas22.mermaidLabelLines)(group.label).join(" ") }),
|
|
2811
2837
|
children
|
|
2812
2838
|
]
|
|
2813
2839
|
}
|
|
@@ -2815,15 +2841,15 @@ function MermaidDiagramGroup({ data, selected, className = "", children }) {
|
|
|
2815
2841
|
}
|
|
2816
2842
|
|
|
2817
2843
|
// src/canvas/MermaidThumbnail.tsx
|
|
2818
|
-
var
|
|
2844
|
+
var import_react22 = require("react");
|
|
2819
2845
|
var import_diagram2 = require("@pixerate/editor/diagram");
|
|
2820
|
-
var
|
|
2846
|
+
var import_canvas23 = require("@pixerate/editor/canvas");
|
|
2821
2847
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
2822
2848
|
function MermaidThumbnail({ source, className = "", fallback = null, ...options }) {
|
|
2823
|
-
const doc = (0,
|
|
2849
|
+
const doc = (0, import_react22.useMemo)(() => typeof source === "string" ? (0, import_diagram2.parseMermaid)(source) : source, [source]);
|
|
2824
2850
|
const key = JSON.stringify(options);
|
|
2825
|
-
const drawn = (0,
|
|
2826
|
-
() => doc.tier === "editable" && doc.graph.nodes.length ? (0,
|
|
2851
|
+
const drawn = (0, import_react22.useMemo)(
|
|
2852
|
+
() => doc.tier === "editable" && doc.graph.nodes.length ? (0, import_canvas23.mermaidThumbnailSvg)(doc, options) : null,
|
|
2827
2853
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2828
2854
|
[doc, key]
|
|
2829
2855
|
);
|
|
@@ -2832,12 +2858,12 @@ function MermaidThumbnail({ source, className = "", fallback = null, ...options
|
|
|
2832
2858
|
}
|
|
2833
2859
|
|
|
2834
2860
|
// src/canvas/useDiagramDirector.ts
|
|
2835
|
-
var
|
|
2861
|
+
var import_react23 = require("react");
|
|
2836
2862
|
var import_diagram3 = require("@pixerate/editor/diagram");
|
|
2837
2863
|
function useDiagramDirector(controller, options) {
|
|
2838
|
-
const placement = (0,
|
|
2864
|
+
const placement = (0, import_react23.useRef)(options.placement);
|
|
2839
2865
|
placement.current = options.placement;
|
|
2840
|
-
const ref = (0,
|
|
2866
|
+
const ref = (0, import_react23.useRef)(null);
|
|
2841
2867
|
if (!ref.current) {
|
|
2842
2868
|
const presence = new import_diagram3.PresenceStore();
|
|
2843
2869
|
ref.current = {
|
|
@@ -2848,7 +2874,7 @@ function useDiagramDirector(controller, options) {
|
|
|
2848
2874
|
return ref.current;
|
|
2849
2875
|
}
|
|
2850
2876
|
function usePresenceState(presence) {
|
|
2851
|
-
return (0,
|
|
2877
|
+
return (0, import_react23.useSyncExternalStore)(presence.subscribe, presence.getState, presence.getState);
|
|
2852
2878
|
}
|
|
2853
2879
|
|
|
2854
2880
|
// src/canvas/DiagramPresenceLayer.tsx
|
|
@@ -3180,6 +3206,7 @@ function DiagramPresenceLayer({ presence, viewport, className = "" }) {
|
|
|
3180
3206
|
useCanvasArrange,
|
|
3181
3207
|
useCanvasArrangeShortcuts,
|
|
3182
3208
|
useCanvasAutoLayout,
|
|
3209
|
+
useCanvasCapture,
|
|
3183
3210
|
useCanvasClipboard,
|
|
3184
3211
|
useCanvasComponents,
|
|
3185
3212
|
useCanvasDocking,
|