@pixerate/editor-react 0.39.0 → 0.41.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 +516 -312
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +142 -6
- package/dist/canvas/index.d.ts +142 -6
- package/dist/canvas/index.js +203 -0
- package/dist/canvas/index.js.map +1 -1
- package/dist/chart/index.cjs +60 -6
- package/dist/chart/index.cjs.map +1 -1
- package/dist/chart/index.js +1 -1
- package/dist/{chunk-IYHD5Q65.js → chunk-SIEOYRHX.js} +68 -7
- package/dist/chunk-SIEOYRHX.js.map +1 -0
- package/dist/index.cjs +499 -418
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -2
- package/dist/index.d.ts +16 -2
- package/dist/index.js +53 -27
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-IYHD5Q65.js.map +0 -1
package/dist/canvas/index.cjs
CHANGED
|
@@ -20,313 +20,317 @@ 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_canvas28.ANIMATABLE_PROPERTIES,
|
|
24
|
+
ANIMATION_DATA_KEY: () => import_canvas28.ANIMATION_DATA_KEY,
|
|
25
|
+
ANIMATION_EASING_LABELS: () => import_canvas28.ANIMATION_EASING_LABELS,
|
|
26
|
+
ANIMATION_EASING_PRESETS: () => import_canvas28.ANIMATION_EASING_PRESETS,
|
|
27
|
+
ANIMATION_TIME_EPSILON: () => import_canvas28.ANIMATION_TIME_EPSILON,
|
|
28
|
+
AUTO_LAYOUT_DATA_KEY: () => import_canvas26.AUTO_LAYOUT_DATA_KEY,
|
|
29
29
|
AgentPresenceLayer: () => AgentPresenceLayer,
|
|
30
|
-
AnimationEditError: () =>
|
|
31
|
-
AnimationPlayer: () =>
|
|
30
|
+
AnimationEditError: () => import_canvas28.AnimationEditError,
|
|
31
|
+
AnimationPlayer: () => import_canvas28.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_canvas29.CANVAS_COMPONENT_DRAG_TYPE,
|
|
34
|
+
CANVAS_GRADIENT_PRESETS: () => import_canvas29.CANVAS_GRADIENT_PRESETS,
|
|
35
|
+
CANVAS_TOKEN_PROPERTIES: () => import_canvas27.CANVAS_TOKEN_PROPERTIES,
|
|
36
|
+
CHILD_LAYOUT_DATA_KEY: () => import_canvas26.CHILD_LAYOUT_DATA_KEY,
|
|
37
|
+
CONNECTION_LINE_TYPES: () => import_canvas22.CONNECTION_LINE_TYPES,
|
|
38
|
+
CSS_ANIMATION_PROPERTIES: () => import_canvas28.CSS_ANIMATION_PROPERTIES,
|
|
39
|
+
CUBIC_BEZIER_PRESETS: () => import_canvas28.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: () =>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
CanvasScenesStore: () => import_canvas22.CanvasScenesStore,
|
|
45
|
+
DEFAULT_ARRANGE_SHORTCUTS: () => import_canvas22.DEFAULT_ARRANGE_SHORTCUTS,
|
|
46
|
+
DiagramPresenceLayer: () => DiagramPresenceLayer,
|
|
47
|
+
MAX_KEYFRAME_REFS: () => import_canvas28.MAX_KEYFRAME_REFS,
|
|
48
|
+
ManualClock: () => import_canvas25.ManualClock,
|
|
49
|
+
MermaidDiagramGroup: () => MermaidDiagramGroup,
|
|
50
|
+
MermaidDiagramNode: () => MermaidDiagramNode,
|
|
51
|
+
RESIZE_HANDLES: () => import_canvas21.RESIZE_HANDLES,
|
|
52
|
+
SHAPE_DATA_KEY: () => import_canvas23.SHAPE_DATA_KEY,
|
|
53
|
+
SHAPE_KINDS: () => import_canvas23.SHAPE_KINDS,
|
|
54
|
+
SHAPE_NODE_TYPE: () => import_canvas23.SHAPE_NODE_TYPE,
|
|
55
|
+
SHAPE_OPERATIONS: () => import_canvas23.SHAPE_OPERATIONS,
|
|
53
56
|
ShapeNode: () => ShapeNode,
|
|
54
|
-
TOKEN_BINDINGS_DATA_KEY: () =>
|
|
55
|
-
TOKEN_MODES_DATA_KEY: () =>
|
|
57
|
+
TOKEN_BINDINGS_DATA_KEY: () => import_canvas27.TOKEN_BINDINGS_DATA_KEY,
|
|
58
|
+
TOKEN_MODES_DATA_KEY: () => import_canvas27.TOKEN_MODES_DATA_KEY,
|
|
56
59
|
TokenBindingPicker: () => TokenBindingPicker,
|
|
57
60
|
TokenModeSwitcher: () => TokenModeSwitcher,
|
|
58
|
-
addCanvasVariant: () =>
|
|
59
|
-
addKeyframesAtTime: () =>
|
|
60
|
-
alignNodes: () =>
|
|
61
|
-
angleToSvgLinearCoords: () =>
|
|
62
|
-
animateNode: () =>
|
|
63
|
-
applyAnimation: () =>
|
|
64
|
-
applyAnimationOverrides: () =>
|
|
65
|
-
applyConstraints: () =>
|
|
66
|
-
applyNodeUpdates: () =>
|
|
67
|
-
applyShapeCombination: () =>
|
|
68
|
-
applyShapeReplacement: () =>
|
|
69
|
-
bezierPathArea: () =>
|
|
70
|
-
bezierPathBounds: () =>
|
|
71
|
-
bezierPathLength: () =>
|
|
72
|
-
bezierPathPointAtLength: () =>
|
|
73
|
-
bezierPathSignedArea: () =>
|
|
74
|
-
bezierPathToSvg: () =>
|
|
75
|
-
bindCanvasComponentProperty: () =>
|
|
76
|
-
bindCanvasToken: () =>
|
|
77
|
-
blendLayout: () =>
|
|
78
|
-
boundsOf: () =>
|
|
79
|
-
calculateDagreReflowDisplacement: () =>
|
|
80
|
-
calculateDirectionalDisplacement: () =>
|
|
81
|
-
canCombineShapeNodes: () =>
|
|
82
|
-
canOffsetShapeNodes: () =>
|
|
83
|
-
canOutlineShapeNodeStrokes: () =>
|
|
84
|
-
canvasHeight: () =>
|
|
85
|
-
centerNodes: () =>
|
|
86
|
-
centre: () =>
|
|
87
|
-
clampAnimationValue: () =>
|
|
88
|
-
clampLayoutSize: () =>
|
|
89
|
-
combineCanvasComponentsAsVariants: () =>
|
|
90
|
-
combineShapeNodes: () =>
|
|
91
|
-
computeNodesBoundingBox: () =>
|
|
92
|
-
computeSnapGuides: () =>
|
|
93
|
-
connectedOnly: () =>
|
|
94
|
-
copyKeyframes: () =>
|
|
95
|
-
countPathSegments: () =>
|
|
96
|
-
createAnimationPlayer: () =>
|
|
97
|
-
createBezierTrajectory: () =>
|
|
98
|
-
createCanvasAnimationController: () =>
|
|
99
|
-
createCanvasAutoLayoutController: () =>
|
|
100
|
-
createCanvasComponent: () =>
|
|
101
|
-
createCanvasComponentsController: () =>
|
|
102
|
-
createCanvasDrawController: () =>
|
|
103
|
-
createCanvasInstance: () =>
|
|
104
|
-
createCanvasScenesStore: () =>
|
|
105
|
-
createDefaultStrokeStyle: () =>
|
|
106
|
-
createFanOutTrajectory: () =>
|
|
107
|
-
createGuideIndex: () =>
|
|
108
|
-
createNodeGuideIndex: () =>
|
|
109
|
-
cubicBezierAt: () =>
|
|
110
|
-
cubicPointAt: () =>
|
|
111
|
-
cubicsToPathData: () =>
|
|
112
|
-
dashContours: () =>
|
|
113
|
-
defaultEasing: () =>
|
|
114
|
-
deleteKeyframes: () =>
|
|
115
|
-
detachCanvasInstance: () =>
|
|
116
|
-
detachTokenBindings: () =>
|
|
117
|
-
distanceToBezierPath: () =>
|
|
118
|
-
distributeNodes: () =>
|
|
119
|
-
dividePaths: () =>
|
|
120
|
-
dividePolygons: () =>
|
|
121
|
-
easingFromInfluence: () =>
|
|
122
|
-
easingLabel: () =>
|
|
123
|
-
easingToCss: () =>
|
|
124
|
-
ensureLayout: () =>
|
|
125
|
-
estimateCanvasHeight: () =>
|
|
126
|
-
estimateNodeSize: () =>
|
|
127
|
-
evaluateAnimation: () =>
|
|
128
|
-
evaluateEasing: () =>
|
|
129
|
-
evaluateTrack: () =>
|
|
130
|
-
excludePaths: () =>
|
|
131
|
-
exportCssAnimation: () =>
|
|
132
|
-
findConnectorSnap: () =>
|
|
133
|
-
findStrokesAtPoint: () =>
|
|
134
|
-
fitCubicRun: () =>
|
|
135
|
-
fitCubics: () =>
|
|
136
|
-
fitFreehandPath: () =>
|
|
137
|
-
fitPathData: () =>
|
|
138
|
-
fitViewportToNodes: () =>
|
|
139
|
-
fitViewportToRect: () =>
|
|
140
|
-
flattenSvgPath: () =>
|
|
141
|
-
flowSide: () =>
|
|
142
|
-
formatAnimationTime: () =>
|
|
143
|
-
formatOklab: () =>
|
|
144
|
-
getAbsolutePosition: () =>
|
|
145
|
-
getAnimatableProperty: () =>
|
|
146
|
-
getAnimatedProperties: () =>
|
|
147
|
-
getAnimatedValue: () =>
|
|
148
|
-
getAnimationDuration: () =>
|
|
149
|
-
getAnimationTrack: () =>
|
|
150
|
-
getAutoLayout: () =>
|
|
151
|
-
getAutoLayoutGrid: () =>
|
|
152
|
-
getAutoLayoutInsertTarget: () =>
|
|
153
|
-
getBindableTokenProperties: () =>
|
|
154
|
-
getCanvasComponentDragId: () =>
|
|
155
|
-
getCanvasTokenProperty: () =>
|
|
156
|
-
getCenteredNodePosition: () =>
|
|
157
|
-
getChildLayout: () =>
|
|
158
|
-
getComponentSourceId: () =>
|
|
159
|
-
getCssPropertyAnimations: () =>
|
|
160
|
-
getEffectiveTokenModes: () =>
|
|
161
|
-
getFlowChildren: () =>
|
|
162
|
-
getInstanceData: () =>
|
|
163
|
-
getInstanceStatus: () =>
|
|
164
|
-
getKeyframeTimes: () =>
|
|
165
|
-
getLayoutParent: () =>
|
|
166
|
-
getLayoutSizing: () =>
|
|
167
|
-
getLayoutedNodes: () =>
|
|
168
|
-
getNextVariantValues: () =>
|
|
169
|
-
getNodeAnimation: () =>
|
|
170
|
-
getNodeOverrides: () =>
|
|
171
|
-
getNodeRect: () =>
|
|
172
|
-
getNodeShape: () =>
|
|
173
|
-
getNodeSize: () =>
|
|
174
|
-
getNodeTokenBindings: () =>
|
|
175
|
-
getNodeTokenModes: () =>
|
|
176
|
-
getResizingNodeRect: () =>
|
|
177
|
-
getShapeRenderData: () =>
|
|
178
|
-
getShapeSvg: () =>
|
|
179
|
-
getTimelineRows: () =>
|
|
180
|
-
getTimelineTicks: () =>
|
|
181
|
-
getTokenPropertyScope: () =>
|
|
182
|
-
getTokensForProperty: () =>
|
|
183
|
-
gradientToSvgDef: () =>
|
|
184
|
-
handlePoint: () =>
|
|
185
|
-
hasVisibleStroke: () =>
|
|
186
|
-
inferResizeHandle: () =>
|
|
187
|
-
inspectCanvasInstance: () =>
|
|
188
|
-
inspectNodeTokens: () =>
|
|
189
|
-
interpolateAnimationValue: () =>
|
|
190
|
-
intersectPaths: () =>
|
|
191
|
-
intersectPolygons: () =>
|
|
192
|
-
invertNodeUpdates: () =>
|
|
193
|
-
isAnimationEasing: () =>
|
|
194
|
-
isAnimationKeyframe: () =>
|
|
195
|
-
isAutoLayoutFrame: () =>
|
|
196
|
-
isCanvasComponent: () =>
|
|
197
|
-
isCanvasComponentSet: () =>
|
|
198
|
-
isCanvasGradient: () =>
|
|
199
|
-
isCanvasInstance: () =>
|
|
200
|
-
isCssExportExact: () =>
|
|
201
|
-
isEventFromTextInput: () =>
|
|
202
|
-
isKeyframeSelected: () =>
|
|
203
|
-
isLocked: () =>
|
|
204
|
-
isMeasureModifierHeld: () =>
|
|
205
|
-
isNodeAnimated: () =>
|
|
206
|
-
isShapeDescription: () =>
|
|
207
|
-
isShapeNode: () =>
|
|
208
|
-
isStraightCubic: () =>
|
|
209
|
-
isValidCanvasNode: () =>
|
|
210
|
-
isValidUrl: () =>
|
|
211
|
-
layoutAll: () =>
|
|
212
|
-
layoutBounds: () =>
|
|
213
|
-
layoutFrame: () =>
|
|
214
|
-
layoutUp: () =>
|
|
215
|
-
layoutUpMany: () =>
|
|
216
|
-
linearPositionTrajectory: () =>
|
|
217
|
-
linearTrajectory: () =>
|
|
218
|
-
listCanvasComponents: () =>
|
|
219
|
-
lockNodes: () =>
|
|
220
|
-
makeSizingCoherent: () =>
|
|
221
|
-
matchArrangeShortcut: () =>
|
|
222
|
-
matchSize: () =>
|
|
223
|
-
measureBetween: () =>
|
|
224
|
-
measureLabel: () =>
|
|
225
|
-
measureSelection: () =>
|
|
226
|
-
measureToLine: () =>
|
|
227
|
-
mergeNodeUpdates: () =>
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
61
|
+
addCanvasVariant: () => import_canvas29.addCanvasVariant,
|
|
62
|
+
addKeyframesAtTime: () => import_canvas28.addKeyframesAtTime,
|
|
63
|
+
alignNodes: () => import_canvas22.alignNodes,
|
|
64
|
+
angleToSvgLinearCoords: () => import_canvas29.angleToSvgLinearCoords,
|
|
65
|
+
animateNode: () => import_canvas28.animateNode,
|
|
66
|
+
applyAnimation: () => import_canvas28.applyAnimation,
|
|
67
|
+
applyAnimationOverrides: () => import_canvas28.applyAnimationOverrides,
|
|
68
|
+
applyConstraints: () => import_canvas26.applyConstraints,
|
|
69
|
+
applyNodeUpdates: () => import_canvas22.applyNodeUpdates,
|
|
70
|
+
applyShapeCombination: () => import_canvas23.applyShapeCombination,
|
|
71
|
+
applyShapeReplacement: () => import_canvas24.applyShapeReplacement,
|
|
72
|
+
bezierPathArea: () => import_canvas24.bezierPathArea,
|
|
73
|
+
bezierPathBounds: () => import_canvas24.bezierPathBounds,
|
|
74
|
+
bezierPathLength: () => import_canvas24.bezierPathLength,
|
|
75
|
+
bezierPathPointAtLength: () => import_canvas24.bezierPathPointAtLength,
|
|
76
|
+
bezierPathSignedArea: () => import_canvas24.bezierPathSignedArea,
|
|
77
|
+
bezierPathToSvg: () => import_canvas24.bezierPathToSvg,
|
|
78
|
+
bindCanvasComponentProperty: () => import_canvas29.bindCanvasComponentProperty,
|
|
79
|
+
bindCanvasToken: () => import_canvas27.bindCanvasToken,
|
|
80
|
+
blendLayout: () => import_canvas25.blendLayout,
|
|
81
|
+
boundsOf: () => import_canvas25.boundsOf,
|
|
82
|
+
calculateDagreReflowDisplacement: () => import_canvas25.calculateDagreReflowDisplacement,
|
|
83
|
+
calculateDirectionalDisplacement: () => import_canvas25.calculateDirectionalDisplacement,
|
|
84
|
+
canCombineShapeNodes: () => import_canvas23.canCombineShapeNodes,
|
|
85
|
+
canOffsetShapeNodes: () => import_canvas24.canOffsetShapeNodes,
|
|
86
|
+
canOutlineShapeNodeStrokes: () => import_canvas24.canOutlineShapeNodeStrokes,
|
|
87
|
+
canvasHeight: () => import_canvas25.canvasHeight,
|
|
88
|
+
centerNodes: () => import_canvas25.centerNodes,
|
|
89
|
+
centre: () => import_canvas25.centre,
|
|
90
|
+
clampAnimationValue: () => import_canvas28.clampAnimationValue,
|
|
91
|
+
clampLayoutSize: () => import_canvas26.clampLayoutSize,
|
|
92
|
+
combineCanvasComponentsAsVariants: () => import_canvas29.combineCanvasComponentsAsVariants,
|
|
93
|
+
combineShapeNodes: () => import_canvas23.combineShapeNodes,
|
|
94
|
+
computeNodesBoundingBox: () => import_canvas25.computeNodesBoundingBox,
|
|
95
|
+
computeSnapGuides: () => import_canvas22.computeSnapGuides,
|
|
96
|
+
connectedOnly: () => import_canvas25.connectedOnly,
|
|
97
|
+
copyKeyframes: () => import_canvas28.copyKeyframes,
|
|
98
|
+
countPathSegments: () => import_canvas24.countPathSegments,
|
|
99
|
+
createAnimationPlayer: () => import_canvas28.createAnimationPlayer,
|
|
100
|
+
createBezierTrajectory: () => import_canvas25.createBezierTrajectory,
|
|
101
|
+
createCanvasAnimationController: () => import_canvas28.createCanvasAnimationController,
|
|
102
|
+
createCanvasAutoLayoutController: () => import_canvas26.createCanvasAutoLayoutController,
|
|
103
|
+
createCanvasComponent: () => import_canvas29.createCanvasComponent,
|
|
104
|
+
createCanvasComponentsController: () => import_canvas29.createCanvasComponentsController,
|
|
105
|
+
createCanvasDrawController: () => import_canvas29.createCanvasDrawController,
|
|
106
|
+
createCanvasInstance: () => import_canvas29.createCanvasInstance,
|
|
107
|
+
createCanvasScenesStore: () => import_canvas22.createCanvasScenesStore,
|
|
108
|
+
createDefaultStrokeStyle: () => import_canvas29.createDefaultStrokeStyle,
|
|
109
|
+
createFanOutTrajectory: () => import_canvas25.createFanOutTrajectory,
|
|
110
|
+
createGuideIndex: () => import_canvas22.createGuideIndex,
|
|
111
|
+
createNodeGuideIndex: () => import_canvas22.createNodeGuideIndex,
|
|
112
|
+
cubicBezierAt: () => import_canvas28.cubicBezierAt,
|
|
113
|
+
cubicPointAt: () => import_canvas21.cubicPointAt,
|
|
114
|
+
cubicsToPathData: () => import_canvas21.cubicsToPathData,
|
|
115
|
+
dashContours: () => import_canvas24.dashContours,
|
|
116
|
+
defaultEasing: () => import_canvas25.defaultEasing,
|
|
117
|
+
deleteKeyframes: () => import_canvas28.deleteKeyframes,
|
|
118
|
+
detachCanvasInstance: () => import_canvas29.detachCanvasInstance,
|
|
119
|
+
detachTokenBindings: () => import_canvas27.detachTokenBindings,
|
|
120
|
+
distanceToBezierPath: () => import_canvas24.distanceToBezierPath,
|
|
121
|
+
distributeNodes: () => import_canvas22.distributeNodes,
|
|
122
|
+
dividePaths: () => import_canvas24.dividePaths,
|
|
123
|
+
dividePolygons: () => import_canvas23.dividePolygons,
|
|
124
|
+
easingFromInfluence: () => import_canvas28.easingFromInfluence,
|
|
125
|
+
easingLabel: () => import_canvas28.easingLabel,
|
|
126
|
+
easingToCss: () => import_canvas28.easingToCss,
|
|
127
|
+
ensureLayout: () => import_canvas25.ensureLayout,
|
|
128
|
+
estimateCanvasHeight: () => import_canvas25.estimateCanvasHeight,
|
|
129
|
+
estimateNodeSize: () => import_canvas25.estimateNodeSize,
|
|
130
|
+
evaluateAnimation: () => import_canvas28.evaluateAnimation,
|
|
131
|
+
evaluateEasing: () => import_canvas28.evaluateEasing,
|
|
132
|
+
evaluateTrack: () => import_canvas28.evaluateTrack,
|
|
133
|
+
excludePaths: () => import_canvas24.excludePaths,
|
|
134
|
+
exportCssAnimation: () => import_canvas28.exportCssAnimation,
|
|
135
|
+
findConnectorSnap: () => import_canvas22.findConnectorSnap,
|
|
136
|
+
findStrokesAtPoint: () => import_canvas29.findStrokesAtPoint,
|
|
137
|
+
fitCubicRun: () => import_canvas21.fitCubicRun,
|
|
138
|
+
fitCubics: () => import_canvas21.fitCubics,
|
|
139
|
+
fitFreehandPath: () => import_canvas21.fitFreehandPath,
|
|
140
|
+
fitPathData: () => import_canvas21.fitPathData,
|
|
141
|
+
fitViewportToNodes: () => import_canvas22.fitViewportToNodes,
|
|
142
|
+
fitViewportToRect: () => import_canvas22.fitViewportToRect,
|
|
143
|
+
flattenSvgPath: () => import_canvas23.flattenSvgPath,
|
|
144
|
+
flowSide: () => import_canvas25.flowSide,
|
|
145
|
+
formatAnimationTime: () => import_canvas28.formatAnimationTime,
|
|
146
|
+
formatOklab: () => import_canvas28.formatOklab,
|
|
147
|
+
getAbsolutePosition: () => import_canvas22.getAbsolutePosition,
|
|
148
|
+
getAnimatableProperty: () => import_canvas28.getAnimatableProperty,
|
|
149
|
+
getAnimatedProperties: () => import_canvas28.getAnimatedProperties,
|
|
150
|
+
getAnimatedValue: () => import_canvas28.getAnimatedValue,
|
|
151
|
+
getAnimationDuration: () => import_canvas28.getAnimationDuration,
|
|
152
|
+
getAnimationTrack: () => import_canvas28.getAnimationTrack,
|
|
153
|
+
getAutoLayout: () => import_canvas26.getAutoLayout,
|
|
154
|
+
getAutoLayoutGrid: () => import_canvas26.getAutoLayoutGrid,
|
|
155
|
+
getAutoLayoutInsertTarget: () => import_canvas26.getAutoLayoutInsertTarget,
|
|
156
|
+
getBindableTokenProperties: () => import_canvas27.getBindableTokenProperties,
|
|
157
|
+
getCanvasComponentDragId: () => import_canvas29.getCanvasComponentDragId,
|
|
158
|
+
getCanvasTokenProperty: () => import_canvas27.getCanvasTokenProperty,
|
|
159
|
+
getCenteredNodePosition: () => import_canvas25.getCenteredNodePosition,
|
|
160
|
+
getChildLayout: () => import_canvas26.getChildLayout,
|
|
161
|
+
getComponentSourceId: () => import_canvas29.getComponentSourceId,
|
|
162
|
+
getCssPropertyAnimations: () => import_canvas28.getCssPropertyAnimations,
|
|
163
|
+
getEffectiveTokenModes: () => import_canvas27.getEffectiveTokenModes,
|
|
164
|
+
getFlowChildren: () => import_canvas26.getFlowChildren,
|
|
165
|
+
getInstanceData: () => import_canvas29.getInstanceData,
|
|
166
|
+
getInstanceStatus: () => import_canvas29.getInstanceStatus,
|
|
167
|
+
getKeyframeTimes: () => import_canvas28.getKeyframeTimes,
|
|
168
|
+
getLayoutParent: () => import_canvas26.getLayoutParent,
|
|
169
|
+
getLayoutSizing: () => import_canvas26.getLayoutSizing,
|
|
170
|
+
getLayoutedNodes: () => import_canvas25.getLayoutedNodes,
|
|
171
|
+
getNextVariantValues: () => import_canvas29.getNextVariantValues,
|
|
172
|
+
getNodeAnimation: () => import_canvas28.getNodeAnimation,
|
|
173
|
+
getNodeOverrides: () => import_canvas29.getNodeOverrides,
|
|
174
|
+
getNodeRect: () => import_canvas22.getNodeRect,
|
|
175
|
+
getNodeShape: () => import_canvas23.getNodeShape,
|
|
176
|
+
getNodeSize: () => import_canvas22.getNodeSize,
|
|
177
|
+
getNodeTokenBindings: () => import_canvas27.getNodeTokenBindings,
|
|
178
|
+
getNodeTokenModes: () => import_canvas27.getNodeTokenModes,
|
|
179
|
+
getResizingNodeRect: () => import_canvas21.getResizingNodeRect,
|
|
180
|
+
getShapeRenderData: () => import_canvas23.getShapeRenderData,
|
|
181
|
+
getShapeSvg: () => import_canvas23.getShapeSvg,
|
|
182
|
+
getTimelineRows: () => import_canvas28.getTimelineRows,
|
|
183
|
+
getTimelineTicks: () => import_canvas28.getTimelineTicks,
|
|
184
|
+
getTokenPropertyScope: () => import_canvas27.getTokenPropertyScope,
|
|
185
|
+
getTokensForProperty: () => import_canvas27.getTokensForProperty,
|
|
186
|
+
gradientToSvgDef: () => import_canvas29.gradientToSvgDef,
|
|
187
|
+
handlePoint: () => import_canvas22.handlePoint,
|
|
188
|
+
hasVisibleStroke: () => import_canvas24.hasVisibleStroke,
|
|
189
|
+
inferResizeHandle: () => import_canvas21.inferResizeHandle,
|
|
190
|
+
inspectCanvasInstance: () => import_canvas29.inspectCanvasInstance,
|
|
191
|
+
inspectNodeTokens: () => import_canvas27.inspectNodeTokens,
|
|
192
|
+
interpolateAnimationValue: () => import_canvas28.interpolateAnimationValue,
|
|
193
|
+
intersectPaths: () => import_canvas24.intersectPaths,
|
|
194
|
+
intersectPolygons: () => import_canvas23.intersectPolygons,
|
|
195
|
+
invertNodeUpdates: () => import_canvas22.invertNodeUpdates,
|
|
196
|
+
isAnimationEasing: () => import_canvas28.isAnimationEasing,
|
|
197
|
+
isAnimationKeyframe: () => import_canvas28.isAnimationKeyframe,
|
|
198
|
+
isAutoLayoutFrame: () => import_canvas26.isAutoLayoutFrame,
|
|
199
|
+
isCanvasComponent: () => import_canvas29.isCanvasComponent,
|
|
200
|
+
isCanvasComponentSet: () => import_canvas29.isCanvasComponentSet,
|
|
201
|
+
isCanvasGradient: () => import_canvas29.isCanvasGradient,
|
|
202
|
+
isCanvasInstance: () => import_canvas29.isCanvasInstance,
|
|
203
|
+
isCssExportExact: () => import_canvas28.isCssExportExact,
|
|
204
|
+
isEventFromTextInput: () => import_canvas25.isEventFromTextInput,
|
|
205
|
+
isKeyframeSelected: () => import_canvas28.isKeyframeSelected,
|
|
206
|
+
isLocked: () => import_canvas22.isLocked,
|
|
207
|
+
isMeasureModifierHeld: () => import_canvas21.isMeasureModifierHeld,
|
|
208
|
+
isNodeAnimated: () => import_canvas28.isNodeAnimated,
|
|
209
|
+
isShapeDescription: () => import_canvas23.isShapeDescription,
|
|
210
|
+
isShapeNode: () => import_canvas23.isShapeNode,
|
|
211
|
+
isStraightCubic: () => import_canvas21.isStraightCubic,
|
|
212
|
+
isValidCanvasNode: () => import_canvas25.isValidCanvasNode,
|
|
213
|
+
isValidUrl: () => import_canvas25.isValidUrl,
|
|
214
|
+
layoutAll: () => import_canvas26.layoutAll,
|
|
215
|
+
layoutBounds: () => import_canvas25.layoutBounds,
|
|
216
|
+
layoutFrame: () => import_canvas26.layoutFrame,
|
|
217
|
+
layoutUp: () => import_canvas26.layoutUp,
|
|
218
|
+
layoutUpMany: () => import_canvas26.layoutUpMany,
|
|
219
|
+
linearPositionTrajectory: () => import_canvas25.linearPositionTrajectory,
|
|
220
|
+
linearTrajectory: () => import_canvas25.linearTrajectory,
|
|
221
|
+
listCanvasComponents: () => import_canvas29.listCanvasComponents,
|
|
222
|
+
lockNodes: () => import_canvas22.lockNodes,
|
|
223
|
+
makeSizingCoherent: () => import_canvas26.makeSizingCoherent,
|
|
224
|
+
matchArrangeShortcut: () => import_canvas22.matchArrangeShortcut,
|
|
225
|
+
matchSize: () => import_canvas22.matchSize,
|
|
226
|
+
measureBetween: () => import_canvas21.measureBetween,
|
|
227
|
+
measureLabel: () => import_canvas21.measureLabel,
|
|
228
|
+
measureSelection: () => import_canvas21.measureSelection,
|
|
229
|
+
measureToLine: () => import_canvas21.measureToLine,
|
|
230
|
+
mergeNodeUpdates: () => import_canvas26.mergeNodeUpdates,
|
|
231
|
+
mermaidNodeStyle: () => mermaidNodeStyle,
|
|
232
|
+
mixColorsOklab: () => import_canvas28.mixColorsOklab,
|
|
233
|
+
moveKeyframes: () => import_canvas28.moveKeyframes,
|
|
234
|
+
moveLayoutChild: () => import_canvas26.moveLayoutChild,
|
|
235
|
+
multiPolygonArea: () => import_canvas23.multiPolygonArea,
|
|
236
|
+
multiPolygonBounds: () => import_canvas23.multiPolygonBounds,
|
|
237
|
+
nearestHandlePositions: () => import_canvas22.nearestHandlePositions,
|
|
238
|
+
normalizeBezierPath: () => import_canvas24.normalizeBezierPath,
|
|
239
|
+
normalizeKeyframes: () => import_canvas28.normalizeKeyframes,
|
|
240
|
+
offsetPath: () => import_canvas24.offsetPath,
|
|
241
|
+
offsetShapeNodes: () => import_canvas24.offsetShapeNodes,
|
|
242
|
+
oklabToRgb: () => import_canvas28.oklabToRgb,
|
|
243
|
+
oppositePosition: () => import_canvas22.oppositePosition,
|
|
244
|
+
outlineShapeNodeStrokes: () => import_canvas24.outlineShapeNodeStrokes,
|
|
245
|
+
outlineStroke: () => import_canvas24.outlineStroke,
|
|
246
|
+
overlaps: () => import_canvas25.overlaps,
|
|
247
|
+
parseCanvasClipboardData: () => import_canvas25.parseCanvasClipboardData,
|
|
248
|
+
parseCanvasScenes: () => import_canvas22.parseCanvasScenes,
|
|
249
|
+
parseCssEasing: () => import_canvas28.parseCssEasing,
|
|
250
|
+
parseCssGradient: () => import_canvas29.parseCssGradient,
|
|
251
|
+
parseKeyframeClipboard: () => import_canvas28.parseKeyframeClipboard,
|
|
252
|
+
parseOklab: () => import_canvas28.parseOklab,
|
|
253
|
+
parseSvgPath: () => import_canvas23.parseSvgPath,
|
|
254
|
+
pasteKeyframes: () => import_canvas28.pasteKeyframes,
|
|
255
|
+
pathBoolean: () => import_canvas24.pathBoolean,
|
|
256
|
+
placeBeside: () => import_canvas25.placeBeside,
|
|
257
|
+
playWebAnimations: () => import_canvas28.playWebAnimations,
|
|
258
|
+
pointInBezierPath: () => import_canvas24.pointInBezierPath,
|
|
259
|
+
pointInMultiPolygon: () => import_canvas23.pointInMultiPolygon,
|
|
260
|
+
pointInRings: () => import_canvas23.pointInRings,
|
|
261
|
+
polygonArea: () => import_canvas23.polygonArea,
|
|
262
|
+
polygonBoolean: () => import_canvas23.polygonBoolean,
|
|
263
|
+
polygonToSvgPath: () => import_canvas23.polygonToSvgPath,
|
|
264
|
+
positionToSide: () => import_canvas22.positionToSide,
|
|
265
|
+
pruneCanvasTokenModes: () => import_canvas27.pruneCanvasTokenModes,
|
|
266
|
+
pushCanvasInstanceOverrides: () => import_canvas29.pushCanvasInstanceOverrides,
|
|
267
|
+
readAnimatableValue: () => import_canvas28.readAnimatableValue,
|
|
268
|
+
readNodeStyleProperty: () => import_canvas27.readNodeStyleProperty,
|
|
269
|
+
readStyleSize: () => import_canvas22.readStyleSize,
|
|
270
|
+
realClock: () => import_canvas25.realClock,
|
|
271
|
+
recordAnimationChanges: () => import_canvas28.recordAnimationChanges,
|
|
272
|
+
relayoutUpdates: () => import_canvas26.relayoutUpdates,
|
|
273
|
+
remapPastedNodes: () => import_canvas25.remapPastedNodes,
|
|
274
|
+
removeCanvasVariant: () => import_canvas29.removeCanvasVariant,
|
|
275
|
+
removeTrack: () => import_canvas28.removeTrack,
|
|
276
|
+
renameCanvasVariantProperty: () => import_canvas29.renameCanvasVariantProperty,
|
|
277
|
+
renameCanvasVariantValue: () => import_canvas29.renameCanvasVariantValue,
|
|
278
|
+
reorderNodes: () => import_canvas22.reorderNodes,
|
|
279
|
+
repositionNodesTo: () => import_canvas25.repositionNodesTo,
|
|
280
|
+
resetCanvasInstanceOverrides: () => import_canvas29.resetCanvasInstanceOverrides,
|
|
281
|
+
resizeHandleAxes: () => import_canvas21.resizeHandleAxes,
|
|
282
|
+
resolveCanvasGradient: () => import_canvas29.resolveCanvasGradient,
|
|
283
|
+
resolveCanvasTokens: () => import_canvas27.resolveCanvasTokens,
|
|
284
|
+
resolveEasing: () => import_canvas28.resolveEasing,
|
|
285
|
+
resolvePadding: () => import_canvas26.resolvePadding,
|
|
286
|
+
restoreCanvasMainComponent: () => import_canvas29.restoreCanvasMainComponent,
|
|
287
|
+
revertShapeCombination: () => import_canvas23.revertShapeCombination,
|
|
288
|
+
rgbToOklab: () => import_canvas28.rgbToOklab,
|
|
289
|
+
ringSignedArea: () => import_canvas23.ringSignedArea,
|
|
290
|
+
runMultiNodeTransition: () => import_canvas25.runMultiNodeTransition,
|
|
291
|
+
sampleAnimationFrames: () => import_canvas28.sampleAnimationFrames,
|
|
292
|
+
scaleKeyframes: () => import_canvas28.scaleKeyframes,
|
|
293
|
+
serializeCanvasNodes: () => import_canvas25.serializeCanvasNodes,
|
|
294
|
+
setCanvasComponentProperty: () => import_canvas29.setCanvasComponentProperty,
|
|
295
|
+
setCanvasInstanceProperties: () => import_canvas29.setCanvasInstanceProperties,
|
|
296
|
+
setCanvasTokenMode: () => import_canvas27.setCanvasTokenMode,
|
|
297
|
+
setCanvasVariantProperties: () => import_canvas29.setCanvasVariantProperties,
|
|
298
|
+
setKeyframe: () => import_canvas28.setKeyframe,
|
|
299
|
+
setKeyframeEasing: () => import_canvas28.setKeyframeEasing,
|
|
300
|
+
setMotionPath: () => import_canvas28.setMotionPath,
|
|
301
|
+
setTrackEnabled: () => import_canvas28.setTrackEnabled,
|
|
302
|
+
shapeNodeToBezierPath: () => import_canvas24.shapeNodeToBezierPath,
|
|
303
|
+
shapeNodeToPolygon: () => import_canvas23.shapeNodeToPolygon,
|
|
304
|
+
shapeToBezierPath: () => import_canvas24.shapeToBezierPath,
|
|
305
|
+
shapeToPolygon: () => import_canvas23.shapeToPolygon,
|
|
306
|
+
sideToPosition: () => import_canvas22.sideToPosition,
|
|
307
|
+
simplifyRing: () => import_canvas23.simplifyRing,
|
|
308
|
+
snapKeyframeDelta: () => import_canvas28.snapKeyframeDelta,
|
|
309
|
+
snapNodeDrag: () => import_canvas22.snapNodeDrag,
|
|
310
|
+
snapNodeResize: () => import_canvas21.snapNodeResize,
|
|
311
|
+
snapResize: () => import_canvas21.snapResize,
|
|
312
|
+
snapTimeToFrame: () => import_canvas28.snapTimeToFrame,
|
|
313
|
+
snapToGrid: () => import_canvas21.snapToGrid,
|
|
314
|
+
springAt: () => import_canvas28.springAt,
|
|
315
|
+
streamlinePoints: () => import_canvas29.streamlinePoints,
|
|
316
|
+
strokeOutlineRings: () => import_canvas24.strokeOutlineRings,
|
|
317
|
+
strokePointsToPathData: () => import_canvas29.strokePointsToPathData,
|
|
318
|
+
strokeToShapeNode: () => import_canvas29.strokeToShapeNode,
|
|
319
|
+
subtractPaths: () => import_canvas24.subtractPaths,
|
|
320
|
+
subtractPolygons: () => import_canvas23.subtractPolygons,
|
|
321
|
+
swapCanvasInstance: () => import_canvas29.swapCanvasInstance,
|
|
322
|
+
syncAllCanvasInstances: () => import_canvas29.syncAllCanvasInstances,
|
|
323
|
+
syncCanvasComponents: () => import_canvas29.syncCanvasComponents,
|
|
324
|
+
syncCanvasInstance: () => import_canvas29.syncCanvasInstance,
|
|
325
|
+
timeToX: () => import_canvas28.timeToX,
|
|
326
|
+
toBezierPath: () => import_canvas24.toBezierPath,
|
|
327
|
+
toWebAnimations: () => import_canvas28.toWebAnimations,
|
|
328
|
+
toggleLockNodes: () => import_canvas22.toggleLockNodes,
|
|
329
|
+
transformBezierPath: () => import_canvas24.transformBezierPath,
|
|
330
|
+
unionPolygons: () => import_canvas23.unionPolygons,
|
|
331
|
+
unitePaths: () => import_canvas24.unitePaths,
|
|
332
|
+
unlockNodes: () => import_canvas22.unlockNodes,
|
|
333
|
+
updateKeyframe: () => import_canvas28.updateKeyframe,
|
|
330
334
|
useCanvasAnimation: () => useCanvasAnimation,
|
|
331
335
|
useCanvasArrange: () => useCanvasArrange,
|
|
332
336
|
useCanvasArrangeShortcuts: () => useCanvasArrangeShortcuts,
|
|
@@ -342,14 +346,19 @@ __export(canvas_exports, {
|
|
|
342
346
|
useCanvasScenes: () => useCanvasScenes,
|
|
343
347
|
useCanvasShortcuts: () => useCanvasShortcuts,
|
|
344
348
|
useCanvasTokens: () => useCanvasTokens,
|
|
349
|
+
useDiagramDirector: () => useDiagramDirector,
|
|
350
|
+
useDiagramState: () => useDiagramState,
|
|
351
|
+
useMermaidDiagram: () => useMermaidDiagram,
|
|
352
|
+
useMermaidStream: () => useMermaidStream,
|
|
353
|
+
usePresenceState: () => usePresenceState,
|
|
345
354
|
useStreamingCanvas: () => useStreamingCanvas,
|
|
346
|
-
withNodeAnimation: () =>
|
|
347
|
-
withStyleSize: () =>
|
|
348
|
-
wouldCreateComponentCycle: () =>
|
|
349
|
-
wrapAnimationTime: () =>
|
|
350
|
-
writeNodeStyleProperty: () =>
|
|
351
|
-
xToTime: () =>
|
|
352
|
-
xorPolygons: () =>
|
|
355
|
+
withNodeAnimation: () => import_canvas28.withNodeAnimation,
|
|
356
|
+
withStyleSize: () => import_canvas22.withStyleSize,
|
|
357
|
+
wouldCreateComponentCycle: () => import_canvas29.wouldCreateComponentCycle,
|
|
358
|
+
wrapAnimationTime: () => import_canvas28.wrapAnimationTime,
|
|
359
|
+
writeNodeStyleProperty: () => import_canvas27.writeNodeStyleProperty,
|
|
360
|
+
xToTime: () => import_canvas28.xToTime,
|
|
361
|
+
xorPolygons: () => import_canvas23.xorPolygons
|
|
353
362
|
});
|
|
354
363
|
module.exports = __toCommonJS(canvas_exports);
|
|
355
364
|
|
|
@@ -1568,8 +1577,8 @@ function useCanvasMeasure(options) {
|
|
|
1568
1577
|
}
|
|
1569
1578
|
|
|
1570
1579
|
// src/canvas/index.ts
|
|
1571
|
-
var
|
|
1572
|
-
var
|
|
1580
|
+
var import_canvas21 = require("@pixerate/editor/canvas");
|
|
1581
|
+
var import_canvas22 = require("@pixerate/editor/canvas");
|
|
1573
1582
|
|
|
1574
1583
|
// src/canvas/ShapeNode.tsx
|
|
1575
1584
|
var import_canvas11 = require("@pixerate/editor/canvas");
|
|
@@ -1627,10 +1636,10 @@ function ShapeNode({ id, data, width, height, selected, className = "", children
|
|
|
1627
1636
|
}
|
|
1628
1637
|
|
|
1629
1638
|
// src/canvas/index.ts
|
|
1630
|
-
var import_canvas21 = require("@pixerate/editor/canvas");
|
|
1631
|
-
var import_canvas22 = require("@pixerate/editor/canvas");
|
|
1632
1639
|
var import_canvas23 = require("@pixerate/editor/canvas");
|
|
1633
1640
|
var import_canvas24 = require("@pixerate/editor/canvas");
|
|
1641
|
+
var import_canvas25 = require("@pixerate/editor/canvas");
|
|
1642
|
+
var import_canvas26 = require("@pixerate/editor/canvas");
|
|
1634
1643
|
|
|
1635
1644
|
// src/canvas/useCanvasAutoLayout.ts
|
|
1636
1645
|
var import_react13 = require("react");
|
|
@@ -1842,7 +1851,7 @@ function TokenModeSwitcher({
|
|
|
1842
1851
|
}
|
|
1843
1852
|
|
|
1844
1853
|
// src/canvas/index.ts
|
|
1845
|
-
var
|
|
1854
|
+
var import_canvas27 = require("@pixerate/editor/canvas");
|
|
1846
1855
|
|
|
1847
1856
|
// src/canvas/useCanvasAnimation.ts
|
|
1848
1857
|
var import_react15 = require("react");
|
|
@@ -2096,7 +2105,7 @@ function AnimationTimeline({ animation, nodeIds, width = 360, snapThreshold = 8,
|
|
|
2096
2105
|
}
|
|
2097
2106
|
|
|
2098
2107
|
// src/canvas/index.ts
|
|
2099
|
-
var
|
|
2108
|
+
var import_canvas28 = require("@pixerate/editor/canvas");
|
|
2100
2109
|
|
|
2101
2110
|
// src/canvas/useCanvasComponents.ts
|
|
2102
2111
|
var import_react17 = require("react");
|
|
@@ -2507,7 +2516,193 @@ function CanvasInstanceInspector({
|
|
|
2507
2516
|
}
|
|
2508
2517
|
|
|
2509
2518
|
// src/canvas/index.ts
|
|
2510
|
-
var
|
|
2519
|
+
var import_canvas29 = require("@pixerate/editor/canvas");
|
|
2520
|
+
|
|
2521
|
+
// src/canvas/useMermaidDiagram.ts
|
|
2522
|
+
var import_react19 = require("react");
|
|
2523
|
+
var import_diagram = require("@pixerate/editor/diagram");
|
|
2524
|
+
var import_canvas19 = require("@pixerate/editor/canvas");
|
|
2525
|
+
function useDiagramState(controller) {
|
|
2526
|
+
return (0, import_react19.useSyncExternalStore)(controller.subscribe, controller.getState, controller.getState);
|
|
2527
|
+
}
|
|
2528
|
+
function useMermaidDiagram(controllerOrOptions = {}) {
|
|
2529
|
+
const own = (0, import_react19.useRef)(null);
|
|
2530
|
+
let controller;
|
|
2531
|
+
if (controllerOrOptions instanceof import_diagram.DiagramController) controller = controllerOrOptions;
|
|
2532
|
+
else {
|
|
2533
|
+
if (!own.current) own.current = new import_diagram.DiagramController(controllerOrOptions);
|
|
2534
|
+
controller = own.current;
|
|
2535
|
+
}
|
|
2536
|
+
const layoutOptions = controllerOrOptions instanceof import_diagram.DiagramController ? void 0 : controllerOrOptions.layoutOptions;
|
|
2537
|
+
const state = useDiagramState(controller);
|
|
2538
|
+
const canvas = (0, import_react19.useMemo)(
|
|
2539
|
+
() => (0, import_canvas19.mermaidToCanvas)(state.document, { ...layoutOptions, editable: state.editable }),
|
|
2540
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2541
|
+
[state.document, state.editable]
|
|
2542
|
+
);
|
|
2543
|
+
const layoutRef = (0, import_react19.useRef)(canvas.layout);
|
|
2544
|
+
layoutRef.current = canvas.layout;
|
|
2545
|
+
const actions = (0, import_react19.useMemo)(
|
|
2546
|
+
() => ({
|
|
2547
|
+
apply: (ops, label) => controller.apply(ops, label),
|
|
2548
|
+
load: (source, options) => controller.load(source, options),
|
|
2549
|
+
moveNodes: (moved, all = moved) => {
|
|
2550
|
+
const op = (0, import_canvas19.mermaidMovesFromCanvas)(layoutRef.current, moved, all, { stored: controller.getDocument().meta.layout ?? {} });
|
|
2551
|
+
return op ? controller.apply(op, "Move") : null;
|
|
2552
|
+
},
|
|
2553
|
+
connect: (source, target, label) => controller.apply({ type: "addEdge", edge: { source, target, ...label ? { label } : {} } }, "Connect"),
|
|
2554
|
+
remove: (ids) => {
|
|
2555
|
+
const graph = controller.getDocument().graph;
|
|
2556
|
+
const edgeIds = new Set(graph.edges.map((e) => e.id));
|
|
2557
|
+
const edges = ids.filter((id) => edgeIds.has(id));
|
|
2558
|
+
const nodes = ids.filter((id) => !edgeIds.has(id));
|
|
2559
|
+
const ops = [];
|
|
2560
|
+
if (edges.length) ops.push({ type: "removeEdges", ids: edges });
|
|
2561
|
+
if (nodes.length) ops.push({ type: "removeNodes", ids: nodes });
|
|
2562
|
+
return controller.apply(ops, "Delete");
|
|
2563
|
+
},
|
|
2564
|
+
rename: (id, label) => controller.apply(
|
|
2565
|
+
controller.getDocument().graph.groups.some((g) => g.id === id) ? { type: "renameGroup", id, label } : { type: "renameNode", id, label },
|
|
2566
|
+
"Rename"
|
|
2567
|
+
),
|
|
2568
|
+
select: (ids) => controller.select(ids),
|
|
2569
|
+
undo: () => void controller.undo(),
|
|
2570
|
+
redo: () => void controller.redo()
|
|
2571
|
+
}),
|
|
2572
|
+
[controller]
|
|
2573
|
+
);
|
|
2574
|
+
return { controller, state, document: state.document, source: state.source, ...canvas, ...actions };
|
|
2575
|
+
}
|
|
2576
|
+
function useMermaidStream(source, options = {}) {
|
|
2577
|
+
const { complete = false, duration = 300, ...layoutOptions } = options;
|
|
2578
|
+
const stream = (0, import_react19.useRef)(null);
|
|
2579
|
+
if (!stream.current) stream.current = new import_canvas19.DiagramStream(layoutOptions);
|
|
2580
|
+
const result = (0, import_react19.useMemo)(() => stream.current.update(source, complete), [source, complete]);
|
|
2581
|
+
const [shown, setShown] = (0, import_react19.useState)({ layout: result.layout, settled: true });
|
|
2582
|
+
const shownRef = (0, import_react19.useRef)(shown.layout);
|
|
2583
|
+
shownRef.current = shown.layout;
|
|
2584
|
+
(0, import_react19.useEffect)(() => {
|
|
2585
|
+
const target = result.layout;
|
|
2586
|
+
if (!target) return setShown({ layout: null, settled: true });
|
|
2587
|
+
const from = shownRef.current;
|
|
2588
|
+
if (!from || duration <= 0 || typeof requestAnimationFrame !== "function") return setShown({ layout: target, settled: true });
|
|
2589
|
+
if (from === target) return;
|
|
2590
|
+
let frame = 0;
|
|
2591
|
+
const start = performance.now();
|
|
2592
|
+
const step = () => {
|
|
2593
|
+
const t = Math.min(1, (performance.now() - start) / duration);
|
|
2594
|
+
setShown({ layout: (0, import_canvas19.blendDiagramLayout)(from, target, (0, import_canvas19.easeDiagramTween)(t)), settled: t >= 1 });
|
|
2595
|
+
if (t < 1) frame = requestAnimationFrame(step);
|
|
2596
|
+
};
|
|
2597
|
+
frame = requestAnimationFrame(step);
|
|
2598
|
+
return () => cancelAnimationFrame(frame);
|
|
2599
|
+
}, [result.layout, duration]);
|
|
2600
|
+
const doc = result.document.tier === "editable" ? result.document : null;
|
|
2601
|
+
const canvas = (0, import_react19.useMemo)(() => {
|
|
2602
|
+
if (!doc || !shown.layout) return { nodes: [], edges: [] };
|
|
2603
|
+
const placed = new Set(Object.keys(shown.layout.positions));
|
|
2604
|
+
const graph = {
|
|
2605
|
+
...doc.graph,
|
|
2606
|
+
nodes: doc.graph.nodes.filter((n) => placed.has(n.id)),
|
|
2607
|
+
groups: doc.graph.groups.filter((g) => placed.has(g.id)),
|
|
2608
|
+
edges: doc.graph.edges.filter((e) => placed.has(e.source) && placed.has(e.target))
|
|
2609
|
+
};
|
|
2610
|
+
return (0, import_canvas19.mermaidToCanvas)({ ...doc, graph }, { layout: shown.layout });
|
|
2611
|
+
}, [doc, shown.layout]);
|
|
2612
|
+
return { document: doc, ...canvas, layout: shown.layout, settled: shown.settled };
|
|
2613
|
+
}
|
|
2614
|
+
|
|
2615
|
+
// src/canvas/MermaidDiagramNode.tsx
|
|
2616
|
+
var import_canvas20 = require("@pixerate/editor/canvas");
|
|
2617
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
2618
|
+
function mermaidNodeStyle(styles = {}, selected = false) {
|
|
2619
|
+
const paint = (0, import_canvas20.mermaidNodePaint)(styles, selected);
|
|
2620
|
+
const { color, "stroke-width": strokeWidth, "stroke-dasharray": strokeDasharray, ...vars } = paint;
|
|
2621
|
+
return { ...vars, color, strokeWidth, strokeDasharray };
|
|
2622
|
+
}
|
|
2623
|
+
function MermaidDiagramNode({ data, width = 160, height = 56, selected, className = "", children }) {
|
|
2624
|
+
const node = data.node;
|
|
2625
|
+
if (!node) return null;
|
|
2626
|
+
const members = (0, import_canvas20.mermaidNodeMembers)(node.data);
|
|
2627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2628
|
+
"div",
|
|
2629
|
+
{
|
|
2630
|
+
className: `pixerate-diagram-node ${className}`.trim(),
|
|
2631
|
+
"data-shape": node.shape,
|
|
2632
|
+
"data-selected": selected ? "true" : void 0,
|
|
2633
|
+
style: { position: "relative", width: "100%", height: "100%", ...mermaidNodeStyle(data.resolvedStyles, selected) },
|
|
2634
|
+
children: [
|
|
2635
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.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_canvas20.mermaidShapePaths)(node.shape, width, height).map((path, i) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: path.d, style: { ...import_canvas20.MERMAID_SHAPE_PAINT[path.paint], vectorEffect: "non-scaling-stroke" } }, i)) }),
|
|
2636
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2637
|
+
"div",
|
|
2638
|
+
{
|
|
2639
|
+
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" },
|
|
2640
|
+
children: [
|
|
2641
|
+
(0, import_canvas20.mermaidLabelLines)(node.label).map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: { fontWeight: members.length ? 600 : void 0 }, children: line }, i)),
|
|
2642
|
+
members.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.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_runtime8.jsx)("div", { children: m }, i)) })
|
|
2643
|
+
]
|
|
2644
|
+
}
|
|
2645
|
+
),
|
|
2646
|
+
children
|
|
2647
|
+
]
|
|
2648
|
+
}
|
|
2649
|
+
);
|
|
2650
|
+
}
|
|
2651
|
+
function MermaidDiagramGroup({ data, selected, className = "", children }) {
|
|
2652
|
+
const group = data.group;
|
|
2653
|
+
if (!group) return null;
|
|
2654
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2655
|
+
"div",
|
|
2656
|
+
{
|
|
2657
|
+
className: `pixerate-diagram-group ${className}`.trim(),
|
|
2658
|
+
"data-selected": selected ? "true" : void 0,
|
|
2659
|
+
style: {
|
|
2660
|
+
width: "100%",
|
|
2661
|
+
height: "100%",
|
|
2662
|
+
boxSizing: "border-box",
|
|
2663
|
+
borderRadius: 8,
|
|
2664
|
+
border: `1px ${selected ? "solid" : "dashed"} ${selected ? "var(--primary, #2563eb)" : data.resolvedStyles?.stroke ?? "var(--border, #cbd5e1)"}`,
|
|
2665
|
+
background: data.resolvedStyles?.fill ?? "var(--muted, rgba(148, 163, 184, 0.08))",
|
|
2666
|
+
color: data.resolvedStyles?.color ?? "var(--muted-foreground, #475569)"
|
|
2667
|
+
},
|
|
2668
|
+
children: [
|
|
2669
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { padding: "6px 10px", fontSize: 12, fontWeight: 600 }, children: (0, import_canvas20.mermaidLabelLines)(group.label).join(" ") }),
|
|
2670
|
+
children
|
|
2671
|
+
]
|
|
2672
|
+
}
|
|
2673
|
+
);
|
|
2674
|
+
}
|
|
2675
|
+
|
|
2676
|
+
// src/canvas/useDiagramDirector.ts
|
|
2677
|
+
var import_react20 = require("react");
|
|
2678
|
+
var import_diagram2 = require("@pixerate/editor/diagram");
|
|
2679
|
+
function useDiagramDirector(controller, options) {
|
|
2680
|
+
const placement = (0, import_react20.useRef)(options.placement);
|
|
2681
|
+
placement.current = options.placement;
|
|
2682
|
+
const ref = (0, import_react20.useRef)(null);
|
|
2683
|
+
if (!ref.current) {
|
|
2684
|
+
const presence = new import_diagram2.PresenceStore();
|
|
2685
|
+
ref.current = {
|
|
2686
|
+
presence,
|
|
2687
|
+
director: new import_diagram2.DiagramDirector(controller, presence, { placement: () => placement.current(), speed: options.speed, clock: options.clock, linger: options.linger })
|
|
2688
|
+
};
|
|
2689
|
+
}
|
|
2690
|
+
return ref.current;
|
|
2691
|
+
}
|
|
2692
|
+
function usePresenceState(presence) {
|
|
2693
|
+
return (0, import_react20.useSyncExternalStore)(presence.subscribe, presence.getState, presence.getState);
|
|
2694
|
+
}
|
|
2695
|
+
|
|
2696
|
+
// src/canvas/DiagramPresenceLayer.tsx
|
|
2697
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2698
|
+
function DiagramPresenceLayer({ presence, viewport, className = "" }) {
|
|
2699
|
+
const { actors } = usePresenceState(presence);
|
|
2700
|
+
if (!actors.length) return null;
|
|
2701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `pixerate-diagram-presence ${className}`.trim(), "aria-hidden": "true", style: { position: "absolute", inset: 0, pointerEvents: "none", overflow: "hidden", zIndex: 50 }, children: actors.map((a) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { "data-actor": a.id, style: { position: "absolute", left: 0, top: 0, transform: `translate(${a.x * viewport.zoom + viewport.x}px, ${a.y * viewport.zoom + viewport.y}px)` }, children: [
|
|
2702
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { width: "18", height: "20", viewBox: "0 0 12 18", style: { display: "block", transform: a.pressed ? "scale(0.85)" : void 0, transformOrigin: "0 0" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M0,0 L0,14 L4,10.5 L7,17 L9.5,16 L6.5,9.5 L11.5,9.5 Z", style: { fill: a.color, stroke: "#ffffff", strokeWidth: 1 } }) }),
|
|
2703
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: { position: "absolute", left: 14, top: 16, whiteSpace: "nowrap", borderRadius: 4, padding: "1px 6px", fontSize: 11, fontWeight: 600, color: "#ffffff", background: a.color }, children: a.message ?? a.name })
|
|
2704
|
+
] }, a.id)) });
|
|
2705
|
+
}
|
|
2511
2706
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2512
2707
|
0 && (module.exports = {
|
|
2513
2708
|
ANIMATABLE_PROPERTIES,
|
|
@@ -2533,8 +2728,11 @@ var import_canvas27 = require("@pixerate/editor/canvas");
|
|
|
2533
2728
|
CanvasInstanceInspector,
|
|
2534
2729
|
CanvasScenesStore,
|
|
2535
2730
|
DEFAULT_ARRANGE_SHORTCUTS,
|
|
2731
|
+
DiagramPresenceLayer,
|
|
2536
2732
|
MAX_KEYFRAME_REFS,
|
|
2537
2733
|
ManualClock,
|
|
2734
|
+
MermaidDiagramGroup,
|
|
2735
|
+
MermaidDiagramNode,
|
|
2538
2736
|
RESIZE_HANDLES,
|
|
2539
2737
|
SHAPE_DATA_KEY,
|
|
2540
2738
|
SHAPE_KINDS,
|
|
@@ -2715,6 +2913,7 @@ var import_canvas27 = require("@pixerate/editor/canvas");
|
|
|
2715
2913
|
measureSelection,
|
|
2716
2914
|
measureToLine,
|
|
2717
2915
|
mergeNodeUpdates,
|
|
2916
|
+
mermaidNodeStyle,
|
|
2718
2917
|
mixColorsOklab,
|
|
2719
2918
|
moveKeyframes,
|
|
2720
2919
|
moveLayoutChild,
|
|
@@ -2832,6 +3031,11 @@ var import_canvas27 = require("@pixerate/editor/canvas");
|
|
|
2832
3031
|
useCanvasScenes,
|
|
2833
3032
|
useCanvasShortcuts,
|
|
2834
3033
|
useCanvasTokens,
|
|
3034
|
+
useDiagramDirector,
|
|
3035
|
+
useDiagramState,
|
|
3036
|
+
useMermaidDiagram,
|
|
3037
|
+
useMermaidStream,
|
|
3038
|
+
usePresenceState,
|
|
2835
3039
|
useStreamingCanvas,
|
|
2836
3040
|
withNodeAnimation,
|
|
2837
3041
|
withStyleSize,
|