@pixerate/editor-react 0.42.0 → 0.43.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas/index.cjs +499 -358
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +43 -3
- package/dist/canvas/index.d.ts +43 -3
- package/dist/canvas/index.js +161 -18
- package/dist/canvas/index.js.map +1 -1
- package/dist/chart/index.cjs +2 -1
- package/dist/chart/index.cjs.map +1 -1
- package/dist/chart/index.js +2 -1
- package/dist/chart/index.js.map +1 -1
- package/package.json +3 -3
package/dist/canvas/index.cjs
CHANGED
|
@@ -20,318 +20,319 @@ 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_canvas30.ANIMATABLE_PROPERTIES,
|
|
24
|
+
ANIMATION_DATA_KEY: () => import_canvas30.ANIMATION_DATA_KEY,
|
|
25
|
+
ANIMATION_EASING_LABELS: () => import_canvas30.ANIMATION_EASING_LABELS,
|
|
26
|
+
ANIMATION_EASING_PRESETS: () => import_canvas30.ANIMATION_EASING_PRESETS,
|
|
27
|
+
ANIMATION_TIME_EPSILON: () => import_canvas30.ANIMATION_TIME_EPSILON,
|
|
28
|
+
AUTO_LAYOUT_DATA_KEY: () => import_canvas28.AUTO_LAYOUT_DATA_KEY,
|
|
29
29
|
AgentPresenceLayer: () => AgentPresenceLayer,
|
|
30
|
-
AnimationEditError: () =>
|
|
31
|
-
AnimationPlayer: () =>
|
|
30
|
+
AnimationEditError: () => import_canvas30.AnimationEditError,
|
|
31
|
+
AnimationPlayer: () => import_canvas30.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_canvas31.CANVAS_COMPONENT_DRAG_TYPE,
|
|
34
|
+
CANVAS_GRADIENT_PRESETS: () => import_canvas31.CANVAS_GRADIENT_PRESETS,
|
|
35
|
+
CANVAS_TOKEN_PROPERTIES: () => import_canvas29.CANVAS_TOKEN_PROPERTIES,
|
|
36
|
+
CHILD_LAYOUT_DATA_KEY: () => import_canvas28.CHILD_LAYOUT_DATA_KEY,
|
|
37
|
+
CONNECTION_LINE_TYPES: () => import_canvas24.CONNECTION_LINE_TYPES,
|
|
38
|
+
CSS_ANIMATION_PROPERTIES: () => import_canvas30.CSS_ANIMATION_PROPERTIES,
|
|
39
|
+
CUBIC_BEZIER_PRESETS: () => import_canvas30.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_canvas24.CanvasScenesStore,
|
|
45
|
+
DEFAULT_ARRANGE_SHORTCUTS: () => import_canvas24.DEFAULT_ARRANGE_SHORTCUTS,
|
|
46
46
|
DiagramPresenceLayer: () => DiagramPresenceLayer,
|
|
47
|
-
MAX_KEYFRAME_REFS: () =>
|
|
48
|
-
ManualClock: () =>
|
|
47
|
+
MAX_KEYFRAME_REFS: () => import_canvas30.MAX_KEYFRAME_REFS,
|
|
48
|
+
ManualClock: () => import_canvas27.ManualClock,
|
|
49
49
|
MermaidDiagramGroup: () => MermaidDiagramGroup,
|
|
50
50
|
MermaidDiagramNode: () => MermaidDiagramNode,
|
|
51
|
+
MermaidFamilyScene: () => MermaidFamilyScene,
|
|
51
52
|
MermaidThumbnail: () => MermaidThumbnail,
|
|
52
|
-
RESIZE_HANDLES: () =>
|
|
53
|
-
SHAPE_DATA_KEY: () =>
|
|
54
|
-
SHAPE_KINDS: () =>
|
|
55
|
-
SHAPE_NODE_TYPE: () =>
|
|
56
|
-
SHAPE_OPERATIONS: () =>
|
|
53
|
+
RESIZE_HANDLES: () => import_canvas23.RESIZE_HANDLES,
|
|
54
|
+
SHAPE_DATA_KEY: () => import_canvas25.SHAPE_DATA_KEY,
|
|
55
|
+
SHAPE_KINDS: () => import_canvas25.SHAPE_KINDS,
|
|
56
|
+
SHAPE_NODE_TYPE: () => import_canvas25.SHAPE_NODE_TYPE,
|
|
57
|
+
SHAPE_OPERATIONS: () => import_canvas25.SHAPE_OPERATIONS,
|
|
57
58
|
ShapeNode: () => ShapeNode,
|
|
58
|
-
TOKEN_BINDINGS_DATA_KEY: () =>
|
|
59
|
-
TOKEN_MODES_DATA_KEY: () =>
|
|
59
|
+
TOKEN_BINDINGS_DATA_KEY: () => import_canvas29.TOKEN_BINDINGS_DATA_KEY,
|
|
60
|
+
TOKEN_MODES_DATA_KEY: () => import_canvas29.TOKEN_MODES_DATA_KEY,
|
|
60
61
|
TokenBindingPicker: () => TokenBindingPicker,
|
|
61
62
|
TokenModeSwitcher: () => TokenModeSwitcher,
|
|
62
|
-
addCanvasVariant: () =>
|
|
63
|
-
addKeyframesAtTime: () =>
|
|
64
|
-
alignNodes: () =>
|
|
65
|
-
angleToSvgLinearCoords: () =>
|
|
66
|
-
animateNode: () =>
|
|
67
|
-
applyAnimation: () =>
|
|
68
|
-
applyAnimationOverrides: () =>
|
|
69
|
-
applyConstraints: () =>
|
|
70
|
-
applyNodeUpdates: () =>
|
|
71
|
-
applyShapeCombination: () =>
|
|
72
|
-
applyShapeReplacement: () =>
|
|
73
|
-
bezierPathArea: () =>
|
|
74
|
-
bezierPathBounds: () =>
|
|
75
|
-
bezierPathLength: () =>
|
|
76
|
-
bezierPathPointAtLength: () =>
|
|
77
|
-
bezierPathSignedArea: () =>
|
|
78
|
-
bezierPathToSvg: () =>
|
|
79
|
-
bindCanvasComponentProperty: () =>
|
|
80
|
-
bindCanvasToken: () =>
|
|
81
|
-
blendLayout: () =>
|
|
82
|
-
boundsOf: () =>
|
|
83
|
-
calculateDagreReflowDisplacement: () =>
|
|
84
|
-
calculateDirectionalDisplacement: () =>
|
|
85
|
-
canCombineShapeNodes: () =>
|
|
86
|
-
canOffsetShapeNodes: () =>
|
|
87
|
-
canOutlineShapeNodeStrokes: () =>
|
|
88
|
-
canvasHeight: () =>
|
|
89
|
-
centerNodes: () =>
|
|
90
|
-
centre: () =>
|
|
91
|
-
clampAnimationValue: () =>
|
|
92
|
-
clampLayoutSize: () =>
|
|
93
|
-
combineCanvasComponentsAsVariants: () =>
|
|
94
|
-
combineShapeNodes: () =>
|
|
95
|
-
computeNodesBoundingBox: () =>
|
|
96
|
-
computeSnapGuides: () =>
|
|
97
|
-
connectedOnly: () =>
|
|
98
|
-
copyKeyframes: () =>
|
|
99
|
-
countPathSegments: () =>
|
|
100
|
-
createAnimationPlayer: () =>
|
|
101
|
-
createBezierTrajectory: () =>
|
|
102
|
-
createCanvasAnimationController: () =>
|
|
103
|
-
createCanvasAutoLayoutController: () =>
|
|
104
|
-
createCanvasComponent: () =>
|
|
105
|
-
createCanvasComponentsController: () =>
|
|
106
|
-
createCanvasDrawController: () =>
|
|
107
|
-
createCanvasInstance: () =>
|
|
108
|
-
createCanvasScenesStore: () =>
|
|
109
|
-
createDefaultStrokeStyle: () =>
|
|
110
|
-
createFanOutTrajectory: () =>
|
|
111
|
-
createGuideIndex: () =>
|
|
112
|
-
createNodeGuideIndex: () =>
|
|
113
|
-
cubicBezierAt: () =>
|
|
114
|
-
cubicPointAt: () =>
|
|
115
|
-
cubicsToPathData: () =>
|
|
116
|
-
dashContours: () =>
|
|
117
|
-
defaultEasing: () =>
|
|
118
|
-
deleteKeyframes: () =>
|
|
119
|
-
detachCanvasInstance: () =>
|
|
120
|
-
detachTokenBindings: () =>
|
|
121
|
-
distanceToBezierPath: () =>
|
|
122
|
-
distributeNodes: () =>
|
|
123
|
-
dividePaths: () =>
|
|
124
|
-
dividePolygons: () =>
|
|
125
|
-
easingFromInfluence: () =>
|
|
126
|
-
easingLabel: () =>
|
|
127
|
-
easingToCss: () =>
|
|
128
|
-
ensureLayout: () =>
|
|
129
|
-
estimateCanvasHeight: () =>
|
|
130
|
-
estimateNodeSize: () =>
|
|
131
|
-
evaluateAnimation: () =>
|
|
132
|
-
evaluateEasing: () =>
|
|
133
|
-
evaluateTrack: () =>
|
|
134
|
-
excludePaths: () =>
|
|
135
|
-
exportCssAnimation: () =>
|
|
136
|
-
findConnectorSnap: () =>
|
|
137
|
-
findStrokesAtPoint: () =>
|
|
138
|
-
fitCubicRun: () =>
|
|
139
|
-
fitCubics: () =>
|
|
140
|
-
fitFreehandPath: () =>
|
|
141
|
-
fitPathData: () =>
|
|
142
|
-
fitViewportToNodes: () =>
|
|
143
|
-
fitViewportToRect: () =>
|
|
144
|
-
flattenSvgPath: () =>
|
|
145
|
-
flowSide: () =>
|
|
146
|
-
formatAnimationTime: () =>
|
|
147
|
-
formatOklab: () =>
|
|
148
|
-
getAbsolutePosition: () =>
|
|
149
|
-
getAnimatableProperty: () =>
|
|
150
|
-
getAnimatedProperties: () =>
|
|
151
|
-
getAnimatedValue: () =>
|
|
152
|
-
getAnimationDuration: () =>
|
|
153
|
-
getAnimationTrack: () =>
|
|
154
|
-
getAutoLayout: () =>
|
|
155
|
-
getAutoLayoutGrid: () =>
|
|
156
|
-
getAutoLayoutInsertTarget: () =>
|
|
157
|
-
getBindableTokenProperties: () =>
|
|
158
|
-
getCanvasComponentDragId: () =>
|
|
159
|
-
getCanvasTokenProperty: () =>
|
|
160
|
-
getCenteredNodePosition: () =>
|
|
161
|
-
getChildLayout: () =>
|
|
162
|
-
getComponentSourceId: () =>
|
|
163
|
-
getCssPropertyAnimations: () =>
|
|
164
|
-
getEffectiveTokenModes: () =>
|
|
165
|
-
getFlowChildren: () =>
|
|
166
|
-
getInstanceData: () =>
|
|
167
|
-
getInstanceStatus: () =>
|
|
168
|
-
getKeyframeTimes: () =>
|
|
169
|
-
getLayoutParent: () =>
|
|
170
|
-
getLayoutSizing: () =>
|
|
171
|
-
getLayoutedNodes: () =>
|
|
172
|
-
getNextVariantValues: () =>
|
|
173
|
-
getNodeAnimation: () =>
|
|
174
|
-
getNodeOverrides: () =>
|
|
175
|
-
getNodeRect: () =>
|
|
176
|
-
getNodeShape: () =>
|
|
177
|
-
getNodeSize: () =>
|
|
178
|
-
getNodeTokenBindings: () =>
|
|
179
|
-
getNodeTokenModes: () =>
|
|
180
|
-
getResizingNodeRect: () =>
|
|
181
|
-
getShapeRenderData: () =>
|
|
182
|
-
getShapeSvg: () =>
|
|
183
|
-
getTimelineRows: () =>
|
|
184
|
-
getTimelineTicks: () =>
|
|
185
|
-
getTokenPropertyScope: () =>
|
|
186
|
-
getTokensForProperty: () =>
|
|
187
|
-
gradientToSvgDef: () =>
|
|
188
|
-
handlePoint: () =>
|
|
189
|
-
hasVisibleStroke: () =>
|
|
190
|
-
inferResizeHandle: () =>
|
|
191
|
-
inspectCanvasInstance: () =>
|
|
192
|
-
inspectNodeTokens: () =>
|
|
193
|
-
interpolateAnimationValue: () =>
|
|
194
|
-
intersectPaths: () =>
|
|
195
|
-
intersectPolygons: () =>
|
|
196
|
-
invertNodeUpdates: () =>
|
|
197
|
-
isAnimationEasing: () =>
|
|
198
|
-
isAnimationKeyframe: () =>
|
|
199
|
-
isAutoLayoutFrame: () =>
|
|
200
|
-
isCanvasComponent: () =>
|
|
201
|
-
isCanvasComponentSet: () =>
|
|
202
|
-
isCanvasGradient: () =>
|
|
203
|
-
isCanvasInstance: () =>
|
|
204
|
-
isCssExportExact: () =>
|
|
205
|
-
isEventFromTextInput: () =>
|
|
206
|
-
isKeyframeSelected: () =>
|
|
207
|
-
isLocked: () =>
|
|
208
|
-
isMeasureModifierHeld: () =>
|
|
209
|
-
isNodeAnimated: () =>
|
|
210
|
-
isShapeDescription: () =>
|
|
211
|
-
isShapeNode: () =>
|
|
212
|
-
isStraightCubic: () =>
|
|
213
|
-
isValidCanvasNode: () =>
|
|
214
|
-
isValidUrl: () =>
|
|
215
|
-
layoutAll: () =>
|
|
216
|
-
layoutBounds: () =>
|
|
217
|
-
layoutFrame: () =>
|
|
218
|
-
layoutUp: () =>
|
|
219
|
-
layoutUpMany: () =>
|
|
220
|
-
linearPositionTrajectory: () =>
|
|
221
|
-
linearTrajectory: () =>
|
|
222
|
-
listCanvasComponents: () =>
|
|
223
|
-
lockNodes: () =>
|
|
224
|
-
makeSizingCoherent: () =>
|
|
225
|
-
matchArrangeShortcut: () =>
|
|
226
|
-
matchSize: () =>
|
|
227
|
-
measureBetween: () =>
|
|
228
|
-
measureLabel: () =>
|
|
229
|
-
measureSelection: () =>
|
|
230
|
-
measureToLine: () =>
|
|
231
|
-
mergeNodeUpdates: () =>
|
|
63
|
+
addCanvasVariant: () => import_canvas31.addCanvasVariant,
|
|
64
|
+
addKeyframesAtTime: () => import_canvas30.addKeyframesAtTime,
|
|
65
|
+
alignNodes: () => import_canvas24.alignNodes,
|
|
66
|
+
angleToSvgLinearCoords: () => import_canvas31.angleToSvgLinearCoords,
|
|
67
|
+
animateNode: () => import_canvas30.animateNode,
|
|
68
|
+
applyAnimation: () => import_canvas30.applyAnimation,
|
|
69
|
+
applyAnimationOverrides: () => import_canvas30.applyAnimationOverrides,
|
|
70
|
+
applyConstraints: () => import_canvas28.applyConstraints,
|
|
71
|
+
applyNodeUpdates: () => import_canvas24.applyNodeUpdates,
|
|
72
|
+
applyShapeCombination: () => import_canvas25.applyShapeCombination,
|
|
73
|
+
applyShapeReplacement: () => import_canvas26.applyShapeReplacement,
|
|
74
|
+
bezierPathArea: () => import_canvas26.bezierPathArea,
|
|
75
|
+
bezierPathBounds: () => import_canvas26.bezierPathBounds,
|
|
76
|
+
bezierPathLength: () => import_canvas26.bezierPathLength,
|
|
77
|
+
bezierPathPointAtLength: () => import_canvas26.bezierPathPointAtLength,
|
|
78
|
+
bezierPathSignedArea: () => import_canvas26.bezierPathSignedArea,
|
|
79
|
+
bezierPathToSvg: () => import_canvas26.bezierPathToSvg,
|
|
80
|
+
bindCanvasComponentProperty: () => import_canvas31.bindCanvasComponentProperty,
|
|
81
|
+
bindCanvasToken: () => import_canvas29.bindCanvasToken,
|
|
82
|
+
blendLayout: () => import_canvas27.blendLayout,
|
|
83
|
+
boundsOf: () => import_canvas27.boundsOf,
|
|
84
|
+
calculateDagreReflowDisplacement: () => import_canvas27.calculateDagreReflowDisplacement,
|
|
85
|
+
calculateDirectionalDisplacement: () => import_canvas27.calculateDirectionalDisplacement,
|
|
86
|
+
canCombineShapeNodes: () => import_canvas25.canCombineShapeNodes,
|
|
87
|
+
canOffsetShapeNodes: () => import_canvas26.canOffsetShapeNodes,
|
|
88
|
+
canOutlineShapeNodeStrokes: () => import_canvas26.canOutlineShapeNodeStrokes,
|
|
89
|
+
canvasHeight: () => import_canvas27.canvasHeight,
|
|
90
|
+
centerNodes: () => import_canvas27.centerNodes,
|
|
91
|
+
centre: () => import_canvas27.centre,
|
|
92
|
+
clampAnimationValue: () => import_canvas30.clampAnimationValue,
|
|
93
|
+
clampLayoutSize: () => import_canvas28.clampLayoutSize,
|
|
94
|
+
combineCanvasComponentsAsVariants: () => import_canvas31.combineCanvasComponentsAsVariants,
|
|
95
|
+
combineShapeNodes: () => import_canvas25.combineShapeNodes,
|
|
96
|
+
computeNodesBoundingBox: () => import_canvas27.computeNodesBoundingBox,
|
|
97
|
+
computeSnapGuides: () => import_canvas24.computeSnapGuides,
|
|
98
|
+
connectedOnly: () => import_canvas27.connectedOnly,
|
|
99
|
+
copyKeyframes: () => import_canvas30.copyKeyframes,
|
|
100
|
+
countPathSegments: () => import_canvas26.countPathSegments,
|
|
101
|
+
createAnimationPlayer: () => import_canvas30.createAnimationPlayer,
|
|
102
|
+
createBezierTrajectory: () => import_canvas27.createBezierTrajectory,
|
|
103
|
+
createCanvasAnimationController: () => import_canvas30.createCanvasAnimationController,
|
|
104
|
+
createCanvasAutoLayoutController: () => import_canvas28.createCanvasAutoLayoutController,
|
|
105
|
+
createCanvasComponent: () => import_canvas31.createCanvasComponent,
|
|
106
|
+
createCanvasComponentsController: () => import_canvas31.createCanvasComponentsController,
|
|
107
|
+
createCanvasDrawController: () => import_canvas31.createCanvasDrawController,
|
|
108
|
+
createCanvasInstance: () => import_canvas31.createCanvasInstance,
|
|
109
|
+
createCanvasScenesStore: () => import_canvas24.createCanvasScenesStore,
|
|
110
|
+
createDefaultStrokeStyle: () => import_canvas31.createDefaultStrokeStyle,
|
|
111
|
+
createFanOutTrajectory: () => import_canvas27.createFanOutTrajectory,
|
|
112
|
+
createGuideIndex: () => import_canvas24.createGuideIndex,
|
|
113
|
+
createNodeGuideIndex: () => import_canvas24.createNodeGuideIndex,
|
|
114
|
+
cubicBezierAt: () => import_canvas30.cubicBezierAt,
|
|
115
|
+
cubicPointAt: () => import_canvas23.cubicPointAt,
|
|
116
|
+
cubicsToPathData: () => import_canvas23.cubicsToPathData,
|
|
117
|
+
dashContours: () => import_canvas26.dashContours,
|
|
118
|
+
defaultEasing: () => import_canvas27.defaultEasing,
|
|
119
|
+
deleteKeyframes: () => import_canvas30.deleteKeyframes,
|
|
120
|
+
detachCanvasInstance: () => import_canvas31.detachCanvasInstance,
|
|
121
|
+
detachTokenBindings: () => import_canvas29.detachTokenBindings,
|
|
122
|
+
distanceToBezierPath: () => import_canvas26.distanceToBezierPath,
|
|
123
|
+
distributeNodes: () => import_canvas24.distributeNodes,
|
|
124
|
+
dividePaths: () => import_canvas26.dividePaths,
|
|
125
|
+
dividePolygons: () => import_canvas25.dividePolygons,
|
|
126
|
+
easingFromInfluence: () => import_canvas30.easingFromInfluence,
|
|
127
|
+
easingLabel: () => import_canvas30.easingLabel,
|
|
128
|
+
easingToCss: () => import_canvas30.easingToCss,
|
|
129
|
+
ensureLayout: () => import_canvas27.ensureLayout,
|
|
130
|
+
estimateCanvasHeight: () => import_canvas27.estimateCanvasHeight,
|
|
131
|
+
estimateNodeSize: () => import_canvas27.estimateNodeSize,
|
|
132
|
+
evaluateAnimation: () => import_canvas30.evaluateAnimation,
|
|
133
|
+
evaluateEasing: () => import_canvas30.evaluateEasing,
|
|
134
|
+
evaluateTrack: () => import_canvas30.evaluateTrack,
|
|
135
|
+
excludePaths: () => import_canvas26.excludePaths,
|
|
136
|
+
exportCssAnimation: () => import_canvas30.exportCssAnimation,
|
|
137
|
+
findConnectorSnap: () => import_canvas24.findConnectorSnap,
|
|
138
|
+
findStrokesAtPoint: () => import_canvas31.findStrokesAtPoint,
|
|
139
|
+
fitCubicRun: () => import_canvas23.fitCubicRun,
|
|
140
|
+
fitCubics: () => import_canvas23.fitCubics,
|
|
141
|
+
fitFreehandPath: () => import_canvas23.fitFreehandPath,
|
|
142
|
+
fitPathData: () => import_canvas23.fitPathData,
|
|
143
|
+
fitViewportToNodes: () => import_canvas24.fitViewportToNodes,
|
|
144
|
+
fitViewportToRect: () => import_canvas24.fitViewportToRect,
|
|
145
|
+
flattenSvgPath: () => import_canvas25.flattenSvgPath,
|
|
146
|
+
flowSide: () => import_canvas27.flowSide,
|
|
147
|
+
formatAnimationTime: () => import_canvas30.formatAnimationTime,
|
|
148
|
+
formatOklab: () => import_canvas30.formatOklab,
|
|
149
|
+
getAbsolutePosition: () => import_canvas24.getAbsolutePosition,
|
|
150
|
+
getAnimatableProperty: () => import_canvas30.getAnimatableProperty,
|
|
151
|
+
getAnimatedProperties: () => import_canvas30.getAnimatedProperties,
|
|
152
|
+
getAnimatedValue: () => import_canvas30.getAnimatedValue,
|
|
153
|
+
getAnimationDuration: () => import_canvas30.getAnimationDuration,
|
|
154
|
+
getAnimationTrack: () => import_canvas30.getAnimationTrack,
|
|
155
|
+
getAutoLayout: () => import_canvas28.getAutoLayout,
|
|
156
|
+
getAutoLayoutGrid: () => import_canvas28.getAutoLayoutGrid,
|
|
157
|
+
getAutoLayoutInsertTarget: () => import_canvas28.getAutoLayoutInsertTarget,
|
|
158
|
+
getBindableTokenProperties: () => import_canvas29.getBindableTokenProperties,
|
|
159
|
+
getCanvasComponentDragId: () => import_canvas31.getCanvasComponentDragId,
|
|
160
|
+
getCanvasTokenProperty: () => import_canvas29.getCanvasTokenProperty,
|
|
161
|
+
getCenteredNodePosition: () => import_canvas27.getCenteredNodePosition,
|
|
162
|
+
getChildLayout: () => import_canvas28.getChildLayout,
|
|
163
|
+
getComponentSourceId: () => import_canvas31.getComponentSourceId,
|
|
164
|
+
getCssPropertyAnimations: () => import_canvas30.getCssPropertyAnimations,
|
|
165
|
+
getEffectiveTokenModes: () => import_canvas29.getEffectiveTokenModes,
|
|
166
|
+
getFlowChildren: () => import_canvas28.getFlowChildren,
|
|
167
|
+
getInstanceData: () => import_canvas31.getInstanceData,
|
|
168
|
+
getInstanceStatus: () => import_canvas31.getInstanceStatus,
|
|
169
|
+
getKeyframeTimes: () => import_canvas30.getKeyframeTimes,
|
|
170
|
+
getLayoutParent: () => import_canvas28.getLayoutParent,
|
|
171
|
+
getLayoutSizing: () => import_canvas28.getLayoutSizing,
|
|
172
|
+
getLayoutedNodes: () => import_canvas27.getLayoutedNodes,
|
|
173
|
+
getNextVariantValues: () => import_canvas31.getNextVariantValues,
|
|
174
|
+
getNodeAnimation: () => import_canvas30.getNodeAnimation,
|
|
175
|
+
getNodeOverrides: () => import_canvas31.getNodeOverrides,
|
|
176
|
+
getNodeRect: () => import_canvas24.getNodeRect,
|
|
177
|
+
getNodeShape: () => import_canvas25.getNodeShape,
|
|
178
|
+
getNodeSize: () => import_canvas24.getNodeSize,
|
|
179
|
+
getNodeTokenBindings: () => import_canvas29.getNodeTokenBindings,
|
|
180
|
+
getNodeTokenModes: () => import_canvas29.getNodeTokenModes,
|
|
181
|
+
getResizingNodeRect: () => import_canvas23.getResizingNodeRect,
|
|
182
|
+
getShapeRenderData: () => import_canvas25.getShapeRenderData,
|
|
183
|
+
getShapeSvg: () => import_canvas25.getShapeSvg,
|
|
184
|
+
getTimelineRows: () => import_canvas30.getTimelineRows,
|
|
185
|
+
getTimelineTicks: () => import_canvas30.getTimelineTicks,
|
|
186
|
+
getTokenPropertyScope: () => import_canvas29.getTokenPropertyScope,
|
|
187
|
+
getTokensForProperty: () => import_canvas29.getTokensForProperty,
|
|
188
|
+
gradientToSvgDef: () => import_canvas31.gradientToSvgDef,
|
|
189
|
+
handlePoint: () => import_canvas24.handlePoint,
|
|
190
|
+
hasVisibleStroke: () => import_canvas26.hasVisibleStroke,
|
|
191
|
+
inferResizeHandle: () => import_canvas23.inferResizeHandle,
|
|
192
|
+
inspectCanvasInstance: () => import_canvas31.inspectCanvasInstance,
|
|
193
|
+
inspectNodeTokens: () => import_canvas29.inspectNodeTokens,
|
|
194
|
+
interpolateAnimationValue: () => import_canvas30.interpolateAnimationValue,
|
|
195
|
+
intersectPaths: () => import_canvas26.intersectPaths,
|
|
196
|
+
intersectPolygons: () => import_canvas25.intersectPolygons,
|
|
197
|
+
invertNodeUpdates: () => import_canvas24.invertNodeUpdates,
|
|
198
|
+
isAnimationEasing: () => import_canvas30.isAnimationEasing,
|
|
199
|
+
isAnimationKeyframe: () => import_canvas30.isAnimationKeyframe,
|
|
200
|
+
isAutoLayoutFrame: () => import_canvas28.isAutoLayoutFrame,
|
|
201
|
+
isCanvasComponent: () => import_canvas31.isCanvasComponent,
|
|
202
|
+
isCanvasComponentSet: () => import_canvas31.isCanvasComponentSet,
|
|
203
|
+
isCanvasGradient: () => import_canvas31.isCanvasGradient,
|
|
204
|
+
isCanvasInstance: () => import_canvas31.isCanvasInstance,
|
|
205
|
+
isCssExportExact: () => import_canvas30.isCssExportExact,
|
|
206
|
+
isEventFromTextInput: () => import_canvas27.isEventFromTextInput,
|
|
207
|
+
isKeyframeSelected: () => import_canvas30.isKeyframeSelected,
|
|
208
|
+
isLocked: () => import_canvas24.isLocked,
|
|
209
|
+
isMeasureModifierHeld: () => import_canvas23.isMeasureModifierHeld,
|
|
210
|
+
isNodeAnimated: () => import_canvas30.isNodeAnimated,
|
|
211
|
+
isShapeDescription: () => import_canvas25.isShapeDescription,
|
|
212
|
+
isShapeNode: () => import_canvas25.isShapeNode,
|
|
213
|
+
isStraightCubic: () => import_canvas23.isStraightCubic,
|
|
214
|
+
isValidCanvasNode: () => import_canvas27.isValidCanvasNode,
|
|
215
|
+
isValidUrl: () => import_canvas27.isValidUrl,
|
|
216
|
+
layoutAll: () => import_canvas28.layoutAll,
|
|
217
|
+
layoutBounds: () => import_canvas27.layoutBounds,
|
|
218
|
+
layoutFrame: () => import_canvas28.layoutFrame,
|
|
219
|
+
layoutUp: () => import_canvas28.layoutUp,
|
|
220
|
+
layoutUpMany: () => import_canvas28.layoutUpMany,
|
|
221
|
+
linearPositionTrajectory: () => import_canvas27.linearPositionTrajectory,
|
|
222
|
+
linearTrajectory: () => import_canvas27.linearTrajectory,
|
|
223
|
+
listCanvasComponents: () => import_canvas31.listCanvasComponents,
|
|
224
|
+
lockNodes: () => import_canvas24.lockNodes,
|
|
225
|
+
makeSizingCoherent: () => import_canvas28.makeSizingCoherent,
|
|
226
|
+
matchArrangeShortcut: () => import_canvas24.matchArrangeShortcut,
|
|
227
|
+
matchSize: () => import_canvas24.matchSize,
|
|
228
|
+
measureBetween: () => import_canvas23.measureBetween,
|
|
229
|
+
measureLabel: () => import_canvas23.measureLabel,
|
|
230
|
+
measureSelection: () => import_canvas23.measureSelection,
|
|
231
|
+
measureToLine: () => import_canvas23.measureToLine,
|
|
232
|
+
mergeNodeUpdates: () => import_canvas28.mergeNodeUpdates,
|
|
232
233
|
mermaidNodeStyle: () => mermaidNodeStyle,
|
|
233
|
-
mixColorsOklab: () =>
|
|
234
|
-
moveKeyframes: () =>
|
|
235
|
-
moveLayoutChild: () =>
|
|
236
|
-
multiPolygonArea: () =>
|
|
237
|
-
multiPolygonBounds: () =>
|
|
238
|
-
nearestHandlePositions: () =>
|
|
239
|
-
normalizeBezierPath: () =>
|
|
240
|
-
normalizeKeyframes: () =>
|
|
241
|
-
offsetPath: () =>
|
|
242
|
-
offsetShapeNodes: () =>
|
|
243
|
-
oklabToRgb: () =>
|
|
244
|
-
oppositePosition: () =>
|
|
245
|
-
outlineShapeNodeStrokes: () =>
|
|
246
|
-
outlineStroke: () =>
|
|
247
|
-
overlaps: () =>
|
|
248
|
-
parseCanvasClipboardData: () =>
|
|
249
|
-
parseCanvasScenes: () =>
|
|
250
|
-
parseCssEasing: () =>
|
|
251
|
-
parseCssGradient: () =>
|
|
252
|
-
parseKeyframeClipboard: () =>
|
|
253
|
-
parseOklab: () =>
|
|
254
|
-
parseSvgPath: () =>
|
|
255
|
-
pasteKeyframes: () =>
|
|
256
|
-
pathBoolean: () =>
|
|
257
|
-
placeBeside: () =>
|
|
258
|
-
playWebAnimations: () =>
|
|
259
|
-
pointInBezierPath: () =>
|
|
260
|
-
pointInMultiPolygon: () =>
|
|
261
|
-
pointInRings: () =>
|
|
262
|
-
polygonArea: () =>
|
|
263
|
-
polygonBoolean: () =>
|
|
264
|
-
polygonToSvgPath: () =>
|
|
265
|
-
positionToSide: () =>
|
|
266
|
-
pruneCanvasTokenModes: () =>
|
|
267
|
-
pushCanvasInstanceOverrides: () =>
|
|
268
|
-
readAnimatableValue: () =>
|
|
269
|
-
readNodeStyleProperty: () =>
|
|
270
|
-
readStyleSize: () =>
|
|
271
|
-
realClock: () =>
|
|
272
|
-
recordAnimationChanges: () =>
|
|
273
|
-
relayoutUpdates: () =>
|
|
274
|
-
remapPastedNodes: () =>
|
|
275
|
-
removeCanvasVariant: () =>
|
|
276
|
-
removeTrack: () =>
|
|
277
|
-
renameCanvasVariantProperty: () =>
|
|
278
|
-
renameCanvasVariantValue: () =>
|
|
279
|
-
reorderNodes: () =>
|
|
280
|
-
repositionNodesTo: () =>
|
|
281
|
-
resetCanvasInstanceOverrides: () =>
|
|
282
|
-
resizeHandleAxes: () =>
|
|
283
|
-
resolveCanvasGradient: () =>
|
|
284
|
-
resolveCanvasTokens: () =>
|
|
285
|
-
resolveEasing: () =>
|
|
286
|
-
resolvePadding: () =>
|
|
287
|
-
restoreCanvasMainComponent: () =>
|
|
288
|
-
revertShapeCombination: () =>
|
|
289
|
-
rgbToOklab: () =>
|
|
290
|
-
ringSignedArea: () =>
|
|
291
|
-
runMultiNodeTransition: () =>
|
|
292
|
-
sampleAnimationFrames: () =>
|
|
293
|
-
scaleKeyframes: () =>
|
|
294
|
-
serializeCanvasNodes: () =>
|
|
295
|
-
setCanvasComponentProperty: () =>
|
|
296
|
-
setCanvasInstanceProperties: () =>
|
|
297
|
-
setCanvasTokenMode: () =>
|
|
298
|
-
setCanvasVariantProperties: () =>
|
|
299
|
-
setKeyframe: () =>
|
|
300
|
-
setKeyframeEasing: () =>
|
|
301
|
-
setMotionPath: () =>
|
|
302
|
-
setTrackEnabled: () =>
|
|
303
|
-
shapeNodeToBezierPath: () =>
|
|
304
|
-
shapeNodeToPolygon: () =>
|
|
305
|
-
shapeToBezierPath: () =>
|
|
306
|
-
shapeToPolygon: () =>
|
|
307
|
-
sideToPosition: () =>
|
|
308
|
-
simplifyRing: () =>
|
|
309
|
-
snapKeyframeDelta: () =>
|
|
310
|
-
snapNodeDrag: () =>
|
|
311
|
-
snapNodeResize: () =>
|
|
312
|
-
snapResize: () =>
|
|
313
|
-
snapTimeToFrame: () =>
|
|
314
|
-
snapToGrid: () =>
|
|
315
|
-
springAt: () =>
|
|
316
|
-
streamlinePoints: () =>
|
|
317
|
-
strokeOutlineRings: () =>
|
|
318
|
-
strokePointsToPathData: () =>
|
|
319
|
-
strokeToShapeNode: () =>
|
|
320
|
-
subtractPaths: () =>
|
|
321
|
-
subtractPolygons: () =>
|
|
322
|
-
swapCanvasInstance: () =>
|
|
323
|
-
syncAllCanvasInstances: () =>
|
|
324
|
-
syncCanvasComponents: () =>
|
|
325
|
-
syncCanvasInstance: () =>
|
|
326
|
-
timeToX: () =>
|
|
327
|
-
toBezierPath: () =>
|
|
328
|
-
toWebAnimations: () =>
|
|
329
|
-
toggleLockNodes: () =>
|
|
330
|
-
transformBezierPath: () =>
|
|
331
|
-
unionPolygons: () =>
|
|
332
|
-
unitePaths: () =>
|
|
333
|
-
unlockNodes: () =>
|
|
334
|
-
updateKeyframe: () =>
|
|
234
|
+
mixColorsOklab: () => import_canvas30.mixColorsOklab,
|
|
235
|
+
moveKeyframes: () => import_canvas30.moveKeyframes,
|
|
236
|
+
moveLayoutChild: () => import_canvas28.moveLayoutChild,
|
|
237
|
+
multiPolygonArea: () => import_canvas25.multiPolygonArea,
|
|
238
|
+
multiPolygonBounds: () => import_canvas25.multiPolygonBounds,
|
|
239
|
+
nearestHandlePositions: () => import_canvas24.nearestHandlePositions,
|
|
240
|
+
normalizeBezierPath: () => import_canvas26.normalizeBezierPath,
|
|
241
|
+
normalizeKeyframes: () => import_canvas30.normalizeKeyframes,
|
|
242
|
+
offsetPath: () => import_canvas26.offsetPath,
|
|
243
|
+
offsetShapeNodes: () => import_canvas26.offsetShapeNodes,
|
|
244
|
+
oklabToRgb: () => import_canvas30.oklabToRgb,
|
|
245
|
+
oppositePosition: () => import_canvas24.oppositePosition,
|
|
246
|
+
outlineShapeNodeStrokes: () => import_canvas26.outlineShapeNodeStrokes,
|
|
247
|
+
outlineStroke: () => import_canvas26.outlineStroke,
|
|
248
|
+
overlaps: () => import_canvas27.overlaps,
|
|
249
|
+
parseCanvasClipboardData: () => import_canvas27.parseCanvasClipboardData,
|
|
250
|
+
parseCanvasScenes: () => import_canvas24.parseCanvasScenes,
|
|
251
|
+
parseCssEasing: () => import_canvas30.parseCssEasing,
|
|
252
|
+
parseCssGradient: () => import_canvas31.parseCssGradient,
|
|
253
|
+
parseKeyframeClipboard: () => import_canvas30.parseKeyframeClipboard,
|
|
254
|
+
parseOklab: () => import_canvas30.parseOklab,
|
|
255
|
+
parseSvgPath: () => import_canvas25.parseSvgPath,
|
|
256
|
+
pasteKeyframes: () => import_canvas30.pasteKeyframes,
|
|
257
|
+
pathBoolean: () => import_canvas26.pathBoolean,
|
|
258
|
+
placeBeside: () => import_canvas27.placeBeside,
|
|
259
|
+
playWebAnimations: () => import_canvas30.playWebAnimations,
|
|
260
|
+
pointInBezierPath: () => import_canvas26.pointInBezierPath,
|
|
261
|
+
pointInMultiPolygon: () => import_canvas25.pointInMultiPolygon,
|
|
262
|
+
pointInRings: () => import_canvas25.pointInRings,
|
|
263
|
+
polygonArea: () => import_canvas25.polygonArea,
|
|
264
|
+
polygonBoolean: () => import_canvas25.polygonBoolean,
|
|
265
|
+
polygonToSvgPath: () => import_canvas25.polygonToSvgPath,
|
|
266
|
+
positionToSide: () => import_canvas24.positionToSide,
|
|
267
|
+
pruneCanvasTokenModes: () => import_canvas29.pruneCanvasTokenModes,
|
|
268
|
+
pushCanvasInstanceOverrides: () => import_canvas31.pushCanvasInstanceOverrides,
|
|
269
|
+
readAnimatableValue: () => import_canvas30.readAnimatableValue,
|
|
270
|
+
readNodeStyleProperty: () => import_canvas29.readNodeStyleProperty,
|
|
271
|
+
readStyleSize: () => import_canvas24.readStyleSize,
|
|
272
|
+
realClock: () => import_canvas27.realClock,
|
|
273
|
+
recordAnimationChanges: () => import_canvas30.recordAnimationChanges,
|
|
274
|
+
relayoutUpdates: () => import_canvas28.relayoutUpdates,
|
|
275
|
+
remapPastedNodes: () => import_canvas27.remapPastedNodes,
|
|
276
|
+
removeCanvasVariant: () => import_canvas31.removeCanvasVariant,
|
|
277
|
+
removeTrack: () => import_canvas30.removeTrack,
|
|
278
|
+
renameCanvasVariantProperty: () => import_canvas31.renameCanvasVariantProperty,
|
|
279
|
+
renameCanvasVariantValue: () => import_canvas31.renameCanvasVariantValue,
|
|
280
|
+
reorderNodes: () => import_canvas24.reorderNodes,
|
|
281
|
+
repositionNodesTo: () => import_canvas27.repositionNodesTo,
|
|
282
|
+
resetCanvasInstanceOverrides: () => import_canvas31.resetCanvasInstanceOverrides,
|
|
283
|
+
resizeHandleAxes: () => import_canvas23.resizeHandleAxes,
|
|
284
|
+
resolveCanvasGradient: () => import_canvas31.resolveCanvasGradient,
|
|
285
|
+
resolveCanvasTokens: () => import_canvas29.resolveCanvasTokens,
|
|
286
|
+
resolveEasing: () => import_canvas30.resolveEasing,
|
|
287
|
+
resolvePadding: () => import_canvas28.resolvePadding,
|
|
288
|
+
restoreCanvasMainComponent: () => import_canvas31.restoreCanvasMainComponent,
|
|
289
|
+
revertShapeCombination: () => import_canvas25.revertShapeCombination,
|
|
290
|
+
rgbToOklab: () => import_canvas30.rgbToOklab,
|
|
291
|
+
ringSignedArea: () => import_canvas25.ringSignedArea,
|
|
292
|
+
runMultiNodeTransition: () => import_canvas27.runMultiNodeTransition,
|
|
293
|
+
sampleAnimationFrames: () => import_canvas30.sampleAnimationFrames,
|
|
294
|
+
scaleKeyframes: () => import_canvas30.scaleKeyframes,
|
|
295
|
+
serializeCanvasNodes: () => import_canvas27.serializeCanvasNodes,
|
|
296
|
+
setCanvasComponentProperty: () => import_canvas31.setCanvasComponentProperty,
|
|
297
|
+
setCanvasInstanceProperties: () => import_canvas31.setCanvasInstanceProperties,
|
|
298
|
+
setCanvasTokenMode: () => import_canvas29.setCanvasTokenMode,
|
|
299
|
+
setCanvasVariantProperties: () => import_canvas31.setCanvasVariantProperties,
|
|
300
|
+
setKeyframe: () => import_canvas30.setKeyframe,
|
|
301
|
+
setKeyframeEasing: () => import_canvas30.setKeyframeEasing,
|
|
302
|
+
setMotionPath: () => import_canvas30.setMotionPath,
|
|
303
|
+
setTrackEnabled: () => import_canvas30.setTrackEnabled,
|
|
304
|
+
shapeNodeToBezierPath: () => import_canvas26.shapeNodeToBezierPath,
|
|
305
|
+
shapeNodeToPolygon: () => import_canvas25.shapeNodeToPolygon,
|
|
306
|
+
shapeToBezierPath: () => import_canvas26.shapeToBezierPath,
|
|
307
|
+
shapeToPolygon: () => import_canvas25.shapeToPolygon,
|
|
308
|
+
sideToPosition: () => import_canvas24.sideToPosition,
|
|
309
|
+
simplifyRing: () => import_canvas25.simplifyRing,
|
|
310
|
+
snapKeyframeDelta: () => import_canvas30.snapKeyframeDelta,
|
|
311
|
+
snapNodeDrag: () => import_canvas24.snapNodeDrag,
|
|
312
|
+
snapNodeResize: () => import_canvas23.snapNodeResize,
|
|
313
|
+
snapResize: () => import_canvas23.snapResize,
|
|
314
|
+
snapTimeToFrame: () => import_canvas30.snapTimeToFrame,
|
|
315
|
+
snapToGrid: () => import_canvas23.snapToGrid,
|
|
316
|
+
springAt: () => import_canvas30.springAt,
|
|
317
|
+
streamlinePoints: () => import_canvas31.streamlinePoints,
|
|
318
|
+
strokeOutlineRings: () => import_canvas26.strokeOutlineRings,
|
|
319
|
+
strokePointsToPathData: () => import_canvas31.strokePointsToPathData,
|
|
320
|
+
strokeToShapeNode: () => import_canvas31.strokeToShapeNode,
|
|
321
|
+
subtractPaths: () => import_canvas26.subtractPaths,
|
|
322
|
+
subtractPolygons: () => import_canvas25.subtractPolygons,
|
|
323
|
+
swapCanvasInstance: () => import_canvas31.swapCanvasInstance,
|
|
324
|
+
syncAllCanvasInstances: () => import_canvas31.syncAllCanvasInstances,
|
|
325
|
+
syncCanvasComponents: () => import_canvas31.syncCanvasComponents,
|
|
326
|
+
syncCanvasInstance: () => import_canvas31.syncCanvasInstance,
|
|
327
|
+
timeToX: () => import_canvas30.timeToX,
|
|
328
|
+
toBezierPath: () => import_canvas26.toBezierPath,
|
|
329
|
+
toWebAnimations: () => import_canvas30.toWebAnimations,
|
|
330
|
+
toggleLockNodes: () => import_canvas24.toggleLockNodes,
|
|
331
|
+
transformBezierPath: () => import_canvas26.transformBezierPath,
|
|
332
|
+
unionPolygons: () => import_canvas25.unionPolygons,
|
|
333
|
+
unitePaths: () => import_canvas26.unitePaths,
|
|
334
|
+
unlockNodes: () => import_canvas24.unlockNodes,
|
|
335
|
+
updateKeyframe: () => import_canvas30.updateKeyframe,
|
|
335
336
|
useCanvasAnimation: () => useCanvasAnimation,
|
|
336
337
|
useCanvasArrange: () => useCanvasArrange,
|
|
337
338
|
useCanvasArrangeShortcuts: () => useCanvasArrangeShortcuts,
|
|
@@ -353,13 +354,13 @@ __export(canvas_exports, {
|
|
|
353
354
|
useMermaidStream: () => useMermaidStream,
|
|
354
355
|
usePresenceState: () => usePresenceState,
|
|
355
356
|
useStreamingCanvas: () => useStreamingCanvas,
|
|
356
|
-
withNodeAnimation: () =>
|
|
357
|
-
withStyleSize: () =>
|
|
358
|
-
wouldCreateComponentCycle: () =>
|
|
359
|
-
wrapAnimationTime: () =>
|
|
360
|
-
writeNodeStyleProperty: () =>
|
|
361
|
-
xToTime: () =>
|
|
362
|
-
xorPolygons: () =>
|
|
357
|
+
withNodeAnimation: () => import_canvas30.withNodeAnimation,
|
|
358
|
+
withStyleSize: () => import_canvas24.withStyleSize,
|
|
359
|
+
wouldCreateComponentCycle: () => import_canvas31.wouldCreateComponentCycle,
|
|
360
|
+
wrapAnimationTime: () => import_canvas30.wrapAnimationTime,
|
|
361
|
+
writeNodeStyleProperty: () => import_canvas29.writeNodeStyleProperty,
|
|
362
|
+
xToTime: () => import_canvas30.xToTime,
|
|
363
|
+
xorPolygons: () => import_canvas25.xorPolygons
|
|
363
364
|
});
|
|
364
365
|
module.exports = __toCommonJS(canvas_exports);
|
|
365
366
|
|
|
@@ -1578,8 +1579,8 @@ function useCanvasMeasure(options) {
|
|
|
1578
1579
|
}
|
|
1579
1580
|
|
|
1580
1581
|
// src/canvas/index.ts
|
|
1581
|
-
var import_canvas22 = require("@pixerate/editor/canvas");
|
|
1582
1582
|
var import_canvas23 = require("@pixerate/editor/canvas");
|
|
1583
|
+
var import_canvas24 = require("@pixerate/editor/canvas");
|
|
1583
1584
|
|
|
1584
1585
|
// src/canvas/ShapeNode.tsx
|
|
1585
1586
|
var import_canvas11 = require("@pixerate/editor/canvas");
|
|
@@ -1637,10 +1638,10 @@ function ShapeNode({ id, data, width, height, selected, className = "", children
|
|
|
1637
1638
|
}
|
|
1638
1639
|
|
|
1639
1640
|
// src/canvas/index.ts
|
|
1640
|
-
var import_canvas24 = require("@pixerate/editor/canvas");
|
|
1641
1641
|
var import_canvas25 = require("@pixerate/editor/canvas");
|
|
1642
1642
|
var import_canvas26 = require("@pixerate/editor/canvas");
|
|
1643
1643
|
var import_canvas27 = require("@pixerate/editor/canvas");
|
|
1644
|
+
var import_canvas28 = require("@pixerate/editor/canvas");
|
|
1644
1645
|
|
|
1645
1646
|
// src/canvas/useCanvasAutoLayout.ts
|
|
1646
1647
|
var import_react13 = require("react");
|
|
@@ -1852,7 +1853,7 @@ function TokenModeSwitcher({
|
|
|
1852
1853
|
}
|
|
1853
1854
|
|
|
1854
1855
|
// src/canvas/index.ts
|
|
1855
|
-
var
|
|
1856
|
+
var import_canvas29 = require("@pixerate/editor/canvas");
|
|
1856
1857
|
|
|
1857
1858
|
// src/canvas/useCanvasAnimation.ts
|
|
1858
1859
|
var import_react15 = require("react");
|
|
@@ -2106,7 +2107,7 @@ function AnimationTimeline({ animation, nodeIds, width = 360, snapThreshold = 8,
|
|
|
2106
2107
|
}
|
|
2107
2108
|
|
|
2108
2109
|
// src/canvas/index.ts
|
|
2109
|
-
var
|
|
2110
|
+
var import_canvas30 = require("@pixerate/editor/canvas");
|
|
2110
2111
|
|
|
2111
2112
|
// src/canvas/useCanvasComponents.ts
|
|
2112
2113
|
var import_react17 = require("react");
|
|
@@ -2517,38 +2518,173 @@ function CanvasInstanceInspector({
|
|
|
2517
2518
|
}
|
|
2518
2519
|
|
|
2519
2520
|
// src/canvas/index.ts
|
|
2520
|
-
var
|
|
2521
|
+
var import_canvas31 = require("@pixerate/editor/canvas");
|
|
2521
2522
|
|
|
2522
|
-
// src/canvas/
|
|
2523
|
+
// src/canvas/MermaidFamilyScene.tsx
|
|
2523
2524
|
var import_react19 = require("react");
|
|
2524
|
-
var import_diagram = require("@pixerate/editor/diagram");
|
|
2525
2525
|
var import_canvas19 = require("@pixerate/editor/canvas");
|
|
2526
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
2527
|
+
function MermaidFamilyScene({
|
|
2528
|
+
scene,
|
|
2529
|
+
padding = 16,
|
|
2530
|
+
interactive = true,
|
|
2531
|
+
onSelect,
|
|
2532
|
+
onOpen,
|
|
2533
|
+
selectionColor = "var(--primary, #2563eb)",
|
|
2534
|
+
markerColor = "var(--muted-foreground, #64748b)",
|
|
2535
|
+
className = "",
|
|
2536
|
+
style,
|
|
2537
|
+
title
|
|
2538
|
+
}) {
|
|
2539
|
+
const uid = (0, import_react19.useId)().replace(/:/g, "");
|
|
2540
|
+
const marker = (kind) => kind ? `url(#${uid}-${kind})` : void 0;
|
|
2541
|
+
const x = scene.x - padding;
|
|
2542
|
+
const y = scene.y - padding;
|
|
2543
|
+
const width = Math.max(1, scene.width + padding * 2);
|
|
2544
|
+
const height = Math.max(1, scene.height + padding * 2);
|
|
2545
|
+
const handlers = (mark) => interactive && mark.target ? {
|
|
2546
|
+
onClick: (event) => {
|
|
2547
|
+
event.stopPropagation();
|
|
2548
|
+
onSelect?.(mark.target, event);
|
|
2549
|
+
},
|
|
2550
|
+
onDoubleClick: (event) => {
|
|
2551
|
+
event.stopPropagation();
|
|
2552
|
+
onOpen?.(mark.target, event);
|
|
2553
|
+
},
|
|
2554
|
+
cursor: "pointer"
|
|
2555
|
+
} : { pointerEvents: "none" };
|
|
2556
|
+
const stroke = (mark) => mark.selected ? { stroke: selectionColor, strokeWidth: Math.max(2, mark.strokeWidth ?? 0) } : { stroke: mark.stroke, strokeWidth: mark.strokeWidth };
|
|
2557
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2558
|
+
"svg",
|
|
2559
|
+
{
|
|
2560
|
+
className: `pixerate-diagram-scene ${className}`.trim(),
|
|
2561
|
+
"data-family": scene.family,
|
|
2562
|
+
role: "img",
|
|
2563
|
+
"aria-label": title ?? `${scene.family} diagram`,
|
|
2564
|
+
viewBox: `${x} ${y} ${width} ${height}`,
|
|
2565
|
+
width,
|
|
2566
|
+
height,
|
|
2567
|
+
style: { display: "block", maxWidth: "100%", height: "auto", overflow: "visible", ...style },
|
|
2568
|
+
onClick: interactive ? (event) => onSelect?.(null, event) : void 0,
|
|
2569
|
+
children: [
|
|
2570
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("defs", { children: [
|
|
2571
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("marker", { id: `${uid}-arrowclosed`, viewBox: "0 0 10 10", refX: "9", refY: "5", markerWidth: "8", markerHeight: "8", orient: "auto-start-reverse", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M0,0 L10,5 L0,10 Z", style: { fill: markerColor } }) }),
|
|
2572
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("marker", { id: `${uid}-arrow`, viewBox: "0 0 10 10", refX: "9", refY: "5", markerWidth: "8", markerHeight: "8", orient: "auto-start-reverse", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M0,0 L10,5 L0,10", style: { fill: "none", stroke: markerColor, strokeWidth: 1.5 } }) })
|
|
2573
|
+
] }),
|
|
2574
|
+
scene.marks.map((mark) => {
|
|
2575
|
+
const common = { "data-role": mark.role, "data-target": mark.target, "data-selected": mark.selected ? "" : void 0, opacity: mark.opacity, ...handlers(mark) };
|
|
2576
|
+
switch (mark.kind) {
|
|
2577
|
+
case "rect":
|
|
2578
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2579
|
+
"rect",
|
|
2580
|
+
{
|
|
2581
|
+
...common,
|
|
2582
|
+
x: mark.x,
|
|
2583
|
+
y: mark.y,
|
|
2584
|
+
width: Math.max(0, mark.width),
|
|
2585
|
+
height: Math.max(0, mark.height),
|
|
2586
|
+
rx: mark.radius,
|
|
2587
|
+
strokeDasharray: mark.dash,
|
|
2588
|
+
style: { fill: mark.fill, ...stroke(mark) }
|
|
2589
|
+
},
|
|
2590
|
+
mark.key
|
|
2591
|
+
);
|
|
2592
|
+
case "circle":
|
|
2593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("circle", { ...common, cx: mark.cx, cy: mark.cy, r: mark.r, style: { fill: mark.fill, ...stroke(mark) } }, mark.key);
|
|
2594
|
+
case "line":
|
|
2595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2596
|
+
"line",
|
|
2597
|
+
{
|
|
2598
|
+
...common,
|
|
2599
|
+
x1: mark.x1,
|
|
2600
|
+
y1: mark.y1,
|
|
2601
|
+
x2: mark.x2,
|
|
2602
|
+
y2: mark.y2,
|
|
2603
|
+
strokeDasharray: mark.dash,
|
|
2604
|
+
markerEnd: marker(mark.markerEnd),
|
|
2605
|
+
markerStart: marker(mark.markerStart),
|
|
2606
|
+
style: { stroke: mark.selected ? selectionColor : mark.stroke, strokeWidth: mark.strokeWidth ?? 1 }
|
|
2607
|
+
},
|
|
2608
|
+
mark.key
|
|
2609
|
+
);
|
|
2610
|
+
case "path":
|
|
2611
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2612
|
+
"path",
|
|
2613
|
+
{
|
|
2614
|
+
...common,
|
|
2615
|
+
d: mark.d,
|
|
2616
|
+
strokeDasharray: mark.dash,
|
|
2617
|
+
strokeLinejoin: "round",
|
|
2618
|
+
markerEnd: marker(mark.markerEnd),
|
|
2619
|
+
markerStart: marker(mark.markerStart),
|
|
2620
|
+
style: { fill: mark.fill ?? "none", ...stroke(mark) }
|
|
2621
|
+
},
|
|
2622
|
+
mark.key
|
|
2623
|
+
);
|
|
2624
|
+
case "text":
|
|
2625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2626
|
+
"text",
|
|
2627
|
+
{
|
|
2628
|
+
...common,
|
|
2629
|
+
x: mark.x,
|
|
2630
|
+
y: mark.y,
|
|
2631
|
+
textAnchor: mark.anchor,
|
|
2632
|
+
dominantBaseline: (0, import_canvas19.diagramTextBaseline)(mark.baseline),
|
|
2633
|
+
transform: mark.rotate ? `rotate(${mark.rotate} ${mark.x} ${mark.y})` : void 0,
|
|
2634
|
+
style: {
|
|
2635
|
+
fill: mark.selected ? selectionColor : mark.fill,
|
|
2636
|
+
fontSize: mark.size,
|
|
2637
|
+
fontWeight: mark.weight,
|
|
2638
|
+
fontStyle: mark.italic ? "italic" : void 0,
|
|
2639
|
+
userSelect: "none"
|
|
2640
|
+
},
|
|
2641
|
+
children: mark.text
|
|
2642
|
+
},
|
|
2643
|
+
mark.key
|
|
2644
|
+
);
|
|
2645
|
+
}
|
|
2646
|
+
})
|
|
2647
|
+
]
|
|
2648
|
+
}
|
|
2649
|
+
);
|
|
2650
|
+
}
|
|
2651
|
+
|
|
2652
|
+
// src/canvas/useMermaidDiagram.ts
|
|
2653
|
+
var import_react20 = require("react");
|
|
2654
|
+
var import_diagram = require("@pixerate/editor/diagram");
|
|
2655
|
+
var import_canvas20 = require("@pixerate/editor/canvas");
|
|
2526
2656
|
function useDiagramState(controller) {
|
|
2527
|
-
return (0,
|
|
2657
|
+
return (0, import_react20.useSyncExternalStore)(controller.subscribe, controller.getState, controller.getState);
|
|
2528
2658
|
}
|
|
2529
|
-
function useMermaidDiagram(controllerOrOptions = {}) {
|
|
2530
|
-
const own = (0,
|
|
2659
|
+
function useMermaidDiagram(controllerOrOptions = {}, view = {}) {
|
|
2660
|
+
const own = (0, import_react20.useRef)(null);
|
|
2531
2661
|
let controller;
|
|
2532
2662
|
if (controllerOrOptions instanceof import_diagram.DiagramController) controller = controllerOrOptions;
|
|
2533
2663
|
else {
|
|
2534
2664
|
if (!own.current) own.current = new import_diagram.DiagramController(controllerOrOptions);
|
|
2535
2665
|
controller = own.current;
|
|
2536
2666
|
}
|
|
2537
|
-
const layoutOptions = controllerOrOptions instanceof import_diagram.DiagramController ? void 0 : controllerOrOptions.layoutOptions;
|
|
2667
|
+
const layoutOptions = (controllerOrOptions instanceof import_diagram.DiagramController ? void 0 : controllerOrOptions.layoutOptions) ?? view.layoutOptions;
|
|
2668
|
+
const sceneTheme = (controllerOrOptions instanceof import_diagram.DiagramController ? void 0 : controllerOrOptions.sceneTheme) ?? view.sceneTheme;
|
|
2538
2669
|
const state = useDiagramState(controller);
|
|
2539
|
-
const canvas = (0,
|
|
2540
|
-
() => (0,
|
|
2670
|
+
const canvas = (0, import_react20.useMemo)(
|
|
2671
|
+
() => (0, import_canvas20.mermaidToCanvas)(state.document, { ...layoutOptions, editable: state.editable }),
|
|
2541
2672
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2542
2673
|
[state.document, state.editable]
|
|
2543
2674
|
);
|
|
2544
|
-
const
|
|
2675
|
+
const scene = (0, import_react20.useMemo)(
|
|
2676
|
+
() => state.document.tier === "editable" ? (0, import_canvas20.familySceneFromLayout)(state.document.family, state.document.graph, canvas.layout, { theme: { ...import_canvas20.CSS_VARIABLE_DIAGRAM_SCENE_THEME, ...sceneTheme }, selection: state.selection }) : null,
|
|
2677
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2678
|
+
[state.document, canvas.layout, state.selection]
|
|
2679
|
+
);
|
|
2680
|
+
const layoutRef = (0, import_react20.useRef)(canvas.layout);
|
|
2545
2681
|
layoutRef.current = canvas.layout;
|
|
2546
|
-
const actions = (0,
|
|
2682
|
+
const actions = (0, import_react20.useMemo)(
|
|
2547
2683
|
() => ({
|
|
2548
2684
|
apply: (ops, label) => controller.apply(ops, label),
|
|
2549
2685
|
load: (source, options) => controller.load(source, options),
|
|
2550
2686
|
moveNodes: (moved, all = moved) => {
|
|
2551
|
-
const op = (0,
|
|
2687
|
+
const op = (0, import_canvas20.mermaidMovesFromCanvas)(layoutRef.current, moved, all, { stored: controller.getDocument().meta.layout ?? {} });
|
|
2552
2688
|
return op ? controller.apply(op, "Move") : null;
|
|
2553
2689
|
},
|
|
2554
2690
|
connect: (source, target, label) => controller.apply({ type: "addEdge", edge: { source, target, ...label ? { label } : {} } }, "Connect"),
|
|
@@ -2566,23 +2702,27 @@ function useMermaidDiagram(controllerOrOptions = {}) {
|
|
|
2566
2702
|
controller.getDocument().graph.groups.some((g) => g.id === id) ? { type: "renameGroup", id, label } : { type: "renameNode", id, label },
|
|
2567
2703
|
"Rename"
|
|
2568
2704
|
),
|
|
2705
|
+
renameTarget: (target, label) => {
|
|
2706
|
+
const op = (0, import_canvas20.diagramRenameOp)(controller.getDocument(), target, label);
|
|
2707
|
+
return op ? controller.apply(op, "Rename") : null;
|
|
2708
|
+
},
|
|
2569
2709
|
select: (ids) => controller.select(ids),
|
|
2570
2710
|
undo: () => void controller.undo(),
|
|
2571
2711
|
redo: () => void controller.redo()
|
|
2572
2712
|
}),
|
|
2573
2713
|
[controller]
|
|
2574
2714
|
);
|
|
2575
|
-
return { controller, state, document: state.document, source: state.source, ...canvas, ...actions };
|
|
2715
|
+
return { controller, state, document: state.document, source: state.source, ...canvas, scene, ...actions };
|
|
2576
2716
|
}
|
|
2577
2717
|
function useMermaidStream(source, options = {}) {
|
|
2578
2718
|
const { complete = false, duration = 300, ...layoutOptions } = options;
|
|
2579
|
-
const stream = (0,
|
|
2580
|
-
if (!stream.current) stream.current = new
|
|
2581
|
-
const result = (0,
|
|
2582
|
-
const [shown, setShown] = (0,
|
|
2583
|
-
const shownRef = (0,
|
|
2719
|
+
const stream = (0, import_react20.useRef)(null);
|
|
2720
|
+
if (!stream.current) stream.current = new import_canvas20.DiagramStream(layoutOptions);
|
|
2721
|
+
const result = (0, import_react20.useMemo)(() => stream.current.update(source, complete), [source, complete]);
|
|
2722
|
+
const [shown, setShown] = (0, import_react20.useState)({ layout: result.layout, settled: true });
|
|
2723
|
+
const shownRef = (0, import_react20.useRef)(shown.layout);
|
|
2584
2724
|
shownRef.current = shown.layout;
|
|
2585
|
-
(0,
|
|
2725
|
+
(0, import_react20.useEffect)(() => {
|
|
2586
2726
|
const target = result.layout;
|
|
2587
2727
|
if (!target) return setShown({ layout: null, settled: true });
|
|
2588
2728
|
const from = shownRef.current;
|
|
@@ -2592,14 +2732,14 @@ function useMermaidStream(source, options = {}) {
|
|
|
2592
2732
|
const start = performance.now();
|
|
2593
2733
|
const step = () => {
|
|
2594
2734
|
const t = Math.min(1, (performance.now() - start) / duration);
|
|
2595
|
-
setShown({ layout: (0,
|
|
2735
|
+
setShown({ layout: (0, import_canvas20.blendDiagramLayout)(from, target, (0, import_canvas20.easeDiagramTween)(t)), settled: t >= 1 });
|
|
2596
2736
|
if (t < 1) frame = requestAnimationFrame(step);
|
|
2597
2737
|
};
|
|
2598
2738
|
frame = requestAnimationFrame(step);
|
|
2599
2739
|
return () => cancelAnimationFrame(frame);
|
|
2600
2740
|
}, [result.layout, duration]);
|
|
2601
2741
|
const doc = result.document.tier === "editable" ? result.document : null;
|
|
2602
|
-
const canvas = (0,
|
|
2742
|
+
const canvas = (0, import_react20.useMemo)(() => {
|
|
2603
2743
|
if (!doc || !shown.layout) return { nodes: [], edges: [] };
|
|
2604
2744
|
const placed = new Set(Object.keys(shown.layout.positions));
|
|
2605
2745
|
const graph = {
|
|
@@ -2608,24 +2748,24 @@ function useMermaidStream(source, options = {}) {
|
|
|
2608
2748
|
groups: doc.graph.groups.filter((g) => placed.has(g.id)),
|
|
2609
2749
|
edges: doc.graph.edges.filter((e) => placed.has(e.source) && placed.has(e.target))
|
|
2610
2750
|
};
|
|
2611
|
-
return (0,
|
|
2751
|
+
return (0, import_canvas20.mermaidToCanvas)({ ...doc, graph }, { layout: shown.layout });
|
|
2612
2752
|
}, [doc, shown.layout]);
|
|
2613
2753
|
return { document: doc, ...canvas, layout: shown.layout, settled: shown.settled };
|
|
2614
2754
|
}
|
|
2615
2755
|
|
|
2616
2756
|
// src/canvas/MermaidDiagramNode.tsx
|
|
2617
|
-
var
|
|
2618
|
-
var
|
|
2757
|
+
var import_canvas21 = require("@pixerate/editor/canvas");
|
|
2758
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2619
2759
|
function mermaidNodeStyle(styles = {}, selected = false) {
|
|
2620
|
-
const paint = (0,
|
|
2760
|
+
const paint = (0, import_canvas21.mermaidNodePaint)(styles, selected);
|
|
2621
2761
|
const { color, "stroke-width": strokeWidth, "stroke-dasharray": strokeDasharray, ...vars } = paint;
|
|
2622
2762
|
return { ...vars, color, strokeWidth, strokeDasharray };
|
|
2623
2763
|
}
|
|
2624
2764
|
function MermaidDiagramNode({ data, width = 160, height = 56, selected, className = "", children }) {
|
|
2625
2765
|
const node = data.node;
|
|
2626
2766
|
if (!node) return null;
|
|
2627
|
-
const members = (0,
|
|
2628
|
-
return /* @__PURE__ */ (0,
|
|
2767
|
+
const members = (0, import_canvas21.mermaidNodeMembers)(node.data);
|
|
2768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2629
2769
|
"div",
|
|
2630
2770
|
{
|
|
2631
2771
|
className: `pixerate-diagram-node ${className}`.trim(),
|
|
@@ -2633,14 +2773,14 @@ function MermaidDiagramNode({ data, width = 160, height = 56, selected, classNam
|
|
|
2633
2773
|
"data-selected": selected ? "true" : void 0,
|
|
2634
2774
|
style: { position: "relative", width: "100%", height: "100%", ...mermaidNodeStyle(data.resolvedStyles, selected) },
|
|
2635
2775
|
children: [
|
|
2636
|
-
/* @__PURE__ */ (0,
|
|
2637
|
-
/* @__PURE__ */ (0,
|
|
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, import_canvas21.mermaidShapePaths)(node.shape, width, height).map((path, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: path.d, style: { ...import_canvas21.MERMAID_SHAPE_PAINT[path.paint], vectorEffect: "non-scaling-stroke" } }, i)) }),
|
|
2777
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2638
2778
|
"div",
|
|
2639
2779
|
{
|
|
2640
2780
|
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" },
|
|
2641
2781
|
children: [
|
|
2642
|
-
(0,
|
|
2643
|
-
members.length > 0 && /* @__PURE__ */ (0,
|
|
2782
|
+
(0, import_canvas21.mermaidLabelLines)(node.label).map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: { fontWeight: members.length ? 600 : void 0 }, children: line }, i)),
|
|
2783
|
+
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)) })
|
|
2644
2784
|
]
|
|
2645
2785
|
}
|
|
2646
2786
|
),
|
|
@@ -2652,7 +2792,7 @@ function MermaidDiagramNode({ data, width = 160, height = 56, selected, classNam
|
|
|
2652
2792
|
function MermaidDiagramGroup({ data, selected, className = "", children }) {
|
|
2653
2793
|
const group = data.group;
|
|
2654
2794
|
if (!group) return null;
|
|
2655
|
-
return /* @__PURE__ */ (0,
|
|
2795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2656
2796
|
"div",
|
|
2657
2797
|
{
|
|
2658
2798
|
className: `pixerate-diagram-group ${className}`.trim(),
|
|
@@ -2667,7 +2807,7 @@ function MermaidDiagramGroup({ data, selected, className = "", children }) {
|
|
|
2667
2807
|
color: data.resolvedStyles?.color ?? "var(--muted-foreground, #475569)"
|
|
2668
2808
|
},
|
|
2669
2809
|
children: [
|
|
2670
|
-
/* @__PURE__ */ (0,
|
|
2810
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { padding: "6px 10px", fontSize: 12, fontWeight: 600 }, children: (0, import_canvas21.mermaidLabelLines)(group.label).join(" ") }),
|
|
2671
2811
|
children
|
|
2672
2812
|
]
|
|
2673
2813
|
}
|
|
@@ -2675,29 +2815,29 @@ function MermaidDiagramGroup({ data, selected, className = "", children }) {
|
|
|
2675
2815
|
}
|
|
2676
2816
|
|
|
2677
2817
|
// src/canvas/MermaidThumbnail.tsx
|
|
2678
|
-
var
|
|
2818
|
+
var import_react21 = require("react");
|
|
2679
2819
|
var import_diagram2 = require("@pixerate/editor/diagram");
|
|
2680
|
-
var
|
|
2681
|
-
var
|
|
2820
|
+
var import_canvas22 = require("@pixerate/editor/canvas");
|
|
2821
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
2682
2822
|
function MermaidThumbnail({ source, className = "", fallback = null, ...options }) {
|
|
2683
|
-
const doc = (0,
|
|
2823
|
+
const doc = (0, import_react21.useMemo)(() => typeof source === "string" ? (0, import_diagram2.parseMermaid)(source) : source, [source]);
|
|
2684
2824
|
const key = JSON.stringify(options);
|
|
2685
|
-
const drawn = (0,
|
|
2686
|
-
() => doc.tier === "editable" && doc.graph.nodes.length ? (0,
|
|
2825
|
+
const drawn = (0, import_react21.useMemo)(
|
|
2826
|
+
() => doc.tier === "editable" && doc.graph.nodes.length ? (0, import_canvas22.mermaidThumbnailSvg)(doc, options) : null,
|
|
2687
2827
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2688
2828
|
[doc, key]
|
|
2689
2829
|
);
|
|
2690
|
-
if (!drawn) return /* @__PURE__ */ (0,
|
|
2691
|
-
return /* @__PURE__ */ (0,
|
|
2830
|
+
if (!drawn) return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: fallback });
|
|
2831
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: `pixerate-diagram-thumbnail ${className}`.trim(), style: { display: "inline-block", lineHeight: 0 }, dangerouslySetInnerHTML: { __html: drawn.svg } });
|
|
2692
2832
|
}
|
|
2693
2833
|
|
|
2694
2834
|
// src/canvas/useDiagramDirector.ts
|
|
2695
|
-
var
|
|
2835
|
+
var import_react22 = require("react");
|
|
2696
2836
|
var import_diagram3 = require("@pixerate/editor/diagram");
|
|
2697
2837
|
function useDiagramDirector(controller, options) {
|
|
2698
|
-
const placement = (0,
|
|
2838
|
+
const placement = (0, import_react22.useRef)(options.placement);
|
|
2699
2839
|
placement.current = options.placement;
|
|
2700
|
-
const ref = (0,
|
|
2840
|
+
const ref = (0, import_react22.useRef)(null);
|
|
2701
2841
|
if (!ref.current) {
|
|
2702
2842
|
const presence = new import_diagram3.PresenceStore();
|
|
2703
2843
|
ref.current = {
|
|
@@ -2708,17 +2848,17 @@ function useDiagramDirector(controller, options) {
|
|
|
2708
2848
|
return ref.current;
|
|
2709
2849
|
}
|
|
2710
2850
|
function usePresenceState(presence) {
|
|
2711
|
-
return (0,
|
|
2851
|
+
return (0, import_react22.useSyncExternalStore)(presence.subscribe, presence.getState, presence.getState);
|
|
2712
2852
|
}
|
|
2713
2853
|
|
|
2714
2854
|
// src/canvas/DiagramPresenceLayer.tsx
|
|
2715
|
-
var
|
|
2855
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2716
2856
|
function DiagramPresenceLayer({ presence, viewport, className = "" }) {
|
|
2717
2857
|
const { actors } = usePresenceState(presence);
|
|
2718
2858
|
if (!actors.length) return null;
|
|
2719
|
-
return /* @__PURE__ */ (0,
|
|
2720
|
-
/* @__PURE__ */ (0,
|
|
2721
|
-
/* @__PURE__ */ (0,
|
|
2859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.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_runtime11.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: [
|
|
2860
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.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_runtime11.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 } }) }),
|
|
2861
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.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 })
|
|
2722
2862
|
] }, a.id)) });
|
|
2723
2863
|
}
|
|
2724
2864
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -2751,6 +2891,7 @@ function DiagramPresenceLayer({ presence, viewport, className = "" }) {
|
|
|
2751
2891
|
ManualClock,
|
|
2752
2892
|
MermaidDiagramGroup,
|
|
2753
2893
|
MermaidDiagramNode,
|
|
2894
|
+
MermaidFamilyScene,
|
|
2754
2895
|
MermaidThumbnail,
|
|
2755
2896
|
RESIZE_HANDLES,
|
|
2756
2897
|
SHAPE_DATA_KEY,
|