@flowgram-vue/fixed-layout-core 0.2.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.
Files changed (54) hide show
  1. package/LICENSE +22 -0
  2. package/dist/index.cjs +2327 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.ts +61 -0
  5. package/dist/index.js +2323 -0
  6. package/dist/index.js.map +1 -0
  7. package/package.json +56 -0
  8. package/src/activities/block-icon.ts +55 -0
  9. package/src/activities/block-order-icon.ts +64 -0
  10. package/src/activities/block.ts +192 -0
  11. package/src/activities/break.ts +14 -0
  12. package/src/activities/dynamic-split.ts +94 -0
  13. package/src/activities/empty.ts +35 -0
  14. package/src/activities/end.ts +26 -0
  15. package/src/activities/index.ts +24 -0
  16. package/src/activities/inline-blocks.ts +197 -0
  17. package/src/activities/input.ts +152 -0
  18. package/src/activities/loop-extends/constants.ts +25 -0
  19. package/src/activities/loop-extends/index.ts +10 -0
  20. package/src/activities/loop-extends/loop-empty-branch.ts +60 -0
  21. package/src/activities/loop-extends/loop-inline-blocks.ts +140 -0
  22. package/src/activities/loop-extends/loop-left-empty-block.ts +43 -0
  23. package/src/activities/loop-extends/loop-right-empty-block.ts +18 -0
  24. package/src/activities/loop.ts +198 -0
  25. package/src/activities/multi-inputs.ts +98 -0
  26. package/src/activities/multi-outputs.ts +65 -0
  27. package/src/activities/output.ts +18 -0
  28. package/src/activities/root.ts +23 -0
  29. package/src/activities/simple-split.ts +47 -0
  30. package/src/activities/slot/constants.ts +56 -0
  31. package/src/activities/slot/extends/index.ts +8 -0
  32. package/src/activities/slot/extends/slot-block.ts +229 -0
  33. package/src/activities/slot/extends/slot-icon.ts +32 -0
  34. package/src/activities/slot/extends/slot-inline-blocks.ts +102 -0
  35. package/src/activities/slot/index.ts +8 -0
  36. package/src/activities/slot/slot.ts +108 -0
  37. package/src/activities/slot/typings.ts +13 -0
  38. package/src/activities/slot/utils/create.ts +105 -0
  39. package/src/activities/slot/utils/layout.ts +49 -0
  40. package/src/activities/slot/utils/node.ts +38 -0
  41. package/src/activities/slot/utils/transition.ts +222 -0
  42. package/src/activities/start.ts +21 -0
  43. package/src/activities/static-split.ts +29 -0
  44. package/src/activities/try-catch-extends/catch-block.ts +78 -0
  45. package/src/activities/try-catch-extends/catch-inline-blocks.ts +122 -0
  46. package/src/activities/try-catch-extends/constants.ts +27 -0
  47. package/src/activities/try-catch-extends/index.ts +11 -0
  48. package/src/activities/try-catch-extends/main-inline-blocks.ts +147 -0
  49. package/src/activities/try-catch-extends/try-block.ts +26 -0
  50. package/src/activities/try-catch-extends/try-slot.ts +48 -0
  51. package/src/activities/try-catch.ts +176 -0
  52. package/src/fixed-layout-container-module.ts +20 -0
  53. package/src/flow-registers.ts +117 -0
  54. package/src/index.ts +45 -0
package/dist/index.cjs ADDED
@@ -0,0 +1,2327 @@
1
+ 'use strict';
2
+
3
+ var inversify = require('inversify');
4
+ var renderer = require('@flowgram-vue/renderer');
5
+ var document = require('@flowgram-vue/document');
6
+ var core = require('@flowgram-vue/core');
7
+ var utils = require('@flowgram-vue/utils');
8
+ var lodashEs = require('lodash-es');
9
+
10
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
11
+ var __decorateClass = (decorators, target, key, kind) => {
12
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
13
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
14
+ if (decorator = decorators[i])
15
+ result = (decorator(result)) || result;
16
+ return result;
17
+ };
18
+ var EndRegistry = {
19
+ type: document.FlowNodeBaseType.END,
20
+ meta: {
21
+ draggable: false,
22
+ isNodeEnd: true,
23
+ selectable: false,
24
+ copyDisable: true
25
+ },
26
+ // 结束节点没有出边和 label
27
+ getLines() {
28
+ return [];
29
+ },
30
+ getLabels() {
31
+ return [];
32
+ }
33
+ };
34
+ var DynamicSplitRegistry = {
35
+ type: document.FlowNodeSplitType.DYNAMIC_SPLIT,
36
+ meta: {
37
+ hidden: true,
38
+ inlineSpacingAfter: (node) => node.collapsed && node.entity.collapsedChildren.length > 1 ? 21 : 0,
39
+ // 判断是否有分支节点
40
+ spacing: (node) => {
41
+ const spacing = document.getDefaultSpacing(node.entity, document.ConstantKeys.NODE_SPACING);
42
+ return node.children.length === 1 ? spacing : spacing / 2;
43
+ }
44
+ },
45
+ getLabels(transition) {
46
+ if (transition.isNodeEnd) {
47
+ return [];
48
+ }
49
+ return [
50
+ {
51
+ type: document.FlowTransitionLabelEnum.ADDER_LABEL,
52
+ offset: transition.transform.outputPoint
53
+ }
54
+ ];
55
+ },
56
+ onCreate(node, json) {
57
+ return node.document.addInlineBlocks(node, json.blocks || []);
58
+ },
59
+ getInputPoint(transform) {
60
+ return transform.firstChild?.inputPoint || transform.defaultInputPoint;
61
+ },
62
+ getOutputPoint(transform, layout) {
63
+ const isVertical = document.FlowLayoutDefault.isVertical(layout);
64
+ const noInlineBlocks = transform.children.length === 1;
65
+ const lastChildOutput = transform.lastChild?.outputPoint;
66
+ const spacing = document.getDefaultSpacing(transform.entity, document.ConstantKeys.NODE_SPACING);
67
+ if (isVertical) {
68
+ return {
69
+ x: lastChildOutput ? lastChildOutput.x : transform.bounds.center.x,
70
+ y: transform.bounds.bottom + (noInlineBlocks ? spacing / 2 : 0)
71
+ };
72
+ }
73
+ return {
74
+ x: transform.bounds.right + (noInlineBlocks ? spacing / 2 : 0),
75
+ y: lastChildOutput ? lastChildOutput.y : transform.bounds.center.y
76
+ };
77
+ },
78
+ /**
79
+ * @depreacted
80
+ */
81
+ addChild(node, json, options = {}) {
82
+ const { index } = options;
83
+ const document = node.document;
84
+ const parentId = `$inlineBlocks$${node.id}`;
85
+ let parent = document.getNode(parentId);
86
+ if (!parent) {
87
+ parent = document.addNode({
88
+ id: parentId,
89
+ type: "inlineBlocks",
90
+ originParent: node,
91
+ parent: node
92
+ });
93
+ }
94
+ return document.addBlock(node, json, void 0, void 0, index);
95
+ }
96
+ };
97
+ var StaticSplitRegistry = {
98
+ extend: document.FlowNodeSplitType.DYNAMIC_SPLIT,
99
+ type: document.FlowNodeSplitType.STATIC_SPLIT,
100
+ extendChildRegistries: [
101
+ {
102
+ type: document.FlowNodeBaseType.INLINE_BLOCKS,
103
+ getLabels() {
104
+ return [];
105
+ }
106
+ }
107
+ ]
108
+ };
109
+ var BlockRegistry = {
110
+ type: document.FlowNodeBaseType.BLOCK,
111
+ meta: {
112
+ spacing: document.DEFAULT_SPACING.NULL,
113
+ inlineSpacingAfter: document.DEFAULT_SPACING.INLINE_BLOCK_PADDING_BOTTOM,
114
+ hidden: true
115
+ },
116
+ getLines(transition) {
117
+ const currentTransform = transition.transform;
118
+ const { isVertical } = transition.entity;
119
+ const lines = [
120
+ {
121
+ type: document.FlowTransitionLineEnum.DIVERGE_LINE,
122
+ from: currentTransform.parent.inputPoint,
123
+ to: currentTransform.inputPoint,
124
+ side: document.LABEL_SIDE_TYPE.NORMAL_BRANCH
125
+ }
126
+ ];
127
+ const hasBranchDraggingAdder = currentTransform && currentTransform.entity.isInlineBlock && transition.renderData.draggable;
128
+ if (hasBranchDraggingAdder) {
129
+ if (isVertical) {
130
+ const currentOffsetRightX = currentTransform.firstChild ? currentTransform.firstChild.bounds.right : currentTransform.bounds.right;
131
+ const nextOffsetLeftX = (currentTransform.next?.firstChild ? currentTransform.next?.firstChild.bounds?.left : currentTransform.next?.bounds?.left) || 0;
132
+ const currentInputPointY = currentTransform.inputPoint.y;
133
+ if (currentTransform?.next) {
134
+ lines.push({
135
+ type: document.FlowTransitionLineEnum.DRAGGING_LINE,
136
+ from: currentTransform.parent.inputPoint,
137
+ to: {
138
+ x: (currentOffsetRightX + nextOffsetLeftX) / 2,
139
+ y: currentInputPointY
140
+ },
141
+ side: document.LABEL_SIDE_TYPE.NORMAL_BRANCH
142
+ });
143
+ }
144
+ } else {
145
+ const currentOffsetBottomX = currentTransform.firstChild ? currentTransform.firstChild.bounds.bottom : currentTransform.bounds.bottom;
146
+ const nextOffsetTopX = (currentTransform.next?.firstChild ? currentTransform.next?.firstChild.bounds?.top : currentTransform.next?.bounds?.top) || 0;
147
+ const currentInputPointX = currentTransform.inputPoint.x;
148
+ if (currentTransform?.next) {
149
+ lines.push({
150
+ type: document.FlowTransitionLineEnum.DRAGGING_LINE,
151
+ from: currentTransform.parent.inputPoint,
152
+ to: {
153
+ x: currentInputPointX,
154
+ y: (currentOffsetBottomX + nextOffsetTopX) / 2
155
+ },
156
+ side: document.LABEL_SIDE_TYPE.NORMAL_BRANCH
157
+ });
158
+ }
159
+ }
160
+ }
161
+ if (!transition.isNodeEnd) {
162
+ lines.push({
163
+ type: document.FlowTransitionLineEnum.MERGE_LINE,
164
+ from: currentTransform.outputPoint,
165
+ to: currentTransform.parent.outputPoint,
166
+ side: document.LABEL_SIDE_TYPE.NORMAL_BRANCH
167
+ });
168
+ }
169
+ return lines;
170
+ },
171
+ getInputPoint(trans) {
172
+ const child = trans.firstChild;
173
+ return child ? child.inputPoint : trans.defaultInputPoint;
174
+ },
175
+ getOutputPoint(trans, layout) {
176
+ const isVertical = document.FlowLayoutDefault.isVertical(layout);
177
+ const child = trans.lastChild;
178
+ if (isVertical) {
179
+ return {
180
+ x: child ? child.outputPoint.x : trans.bounds.bottomCenter.x,
181
+ y: trans.bounds.bottom
182
+ };
183
+ }
184
+ return {
185
+ x: trans.bounds.right,
186
+ y: child ? child.outputPoint.y : trans.bounds.rightCenter.y
187
+ };
188
+ },
189
+ getLabels(transition) {
190
+ const currentTransform = transition.transform;
191
+ const { isVertical } = transition.entity;
192
+ const draggingLabel = [];
193
+ const hasBranchDraggingAdder = currentTransform && currentTransform.entity.isInlineBlock && transition.renderData.draggable;
194
+ if (hasBranchDraggingAdder) {
195
+ if (isVertical) {
196
+ const currentOffsetRightX = currentTransform.firstChild ? currentTransform.firstChild.bounds.right : currentTransform.bounds.right;
197
+ const nextOffsetLeftX = (currentTransform.next?.firstChild ? currentTransform.next.firstChild.bounds?.left : currentTransform.next?.bounds?.left) || 0;
198
+ const currentInputPointY = currentTransform.inputPoint.y;
199
+ if (currentTransform?.next) {
200
+ draggingLabel.push({
201
+ offset: {
202
+ x: (currentOffsetRightX + nextOffsetLeftX) / 2,
203
+ y: currentInputPointY
204
+ },
205
+ type: document.FlowTransitionLabelEnum.BRANCH_DRAGGING_LABEL,
206
+ width: nextOffsetLeftX - currentOffsetRightX,
207
+ props: {
208
+ side: document.LABEL_SIDE_TYPE.NORMAL_BRANCH
209
+ }
210
+ });
211
+ }
212
+ } else {
213
+ const currentOffsetBottomX = currentTransform.firstChild ? currentTransform.firstChild.bounds.bottom : currentTransform.bounds.bottom;
214
+ const nextOffsetTopX = (currentTransform.next?.firstChild ? currentTransform.next.firstChild.bounds?.top : currentTransform.next?.bounds?.top) || 0;
215
+ const currentInputPointX = currentTransform.inputPoint.x;
216
+ if (currentTransform?.next) {
217
+ draggingLabel.push({
218
+ offset: {
219
+ x: currentInputPointX,
220
+ y: (currentOffsetBottomX + nextOffsetTopX) / 2
221
+ },
222
+ type: document.FlowTransitionLabelEnum.BRANCH_DRAGGING_LABEL,
223
+ width: nextOffsetTopX - currentOffsetBottomX,
224
+ props: {
225
+ side: document.LABEL_SIDE_TYPE.NORMAL_BRANCH
226
+ }
227
+ });
228
+ }
229
+ }
230
+ }
231
+ return [...draggingLabel];
232
+ },
233
+ /**
234
+ * @depreacted
235
+ */
236
+ addChild(node, json, options = {}) {
237
+ const { index } = options;
238
+ const document = node.document;
239
+ return document.addNode({
240
+ ...json,
241
+ ...options,
242
+ parent: node,
243
+ index: typeof index === "number" ? index + 1 : void 0
244
+ });
245
+ }
246
+ };
247
+ var InlineBlocksRegistry = {
248
+ type: document.FlowNodeBaseType.INLINE_BLOCKS,
249
+ meta: {
250
+ hidden: true,
251
+ spacing: (node) => document.getDefaultSpacing(node.entity, document.ConstantKeys.NODE_SPACING),
252
+ isInlineBlocks: true,
253
+ inlineSpacingPre: (transform) => {
254
+ if (transform.entity.blocks.length === 0) {
255
+ return 0;
256
+ }
257
+ return document.getDefaultSpacing(transform.entity, document.ConstantKeys.INLINE_BLOCKS_PADDING_TOP) || document.DEFAULT_SPACING.INLINE_BLOCKS_PADDING_TOP;
258
+ },
259
+ inlineSpacingAfter: (transform) => {
260
+ if (transform.entity.blocks.length === 0) {
261
+ return 0;
262
+ }
263
+ return document.getDefaultSpacing(transform.entity, document.ConstantKeys.INLINE_BLOCKS_PADDING_BOTTOM);
264
+ }
265
+ },
266
+ /**
267
+ * 控制子分支的间距
268
+ * @param child
269
+ */
270
+ getChildDelta(child, layout) {
271
+ const isVertical = document.FlowLayoutDefault.isVertical(layout);
272
+ const preTransform = child.entity.pre?.getData(document.FlowNodeTransformData);
273
+ if (preTransform) {
274
+ const { localBounds: preBounds } = preTransform;
275
+ if (isVertical) {
276
+ const leftSpacing = preTransform.size.width + preTransform.originDeltaX;
277
+ const delta = Math.max(
278
+ child.parent.minInlineBlockSpacing - leftSpacing,
279
+ document.getDefaultSpacing(child.entity, document.ConstantKeys.BRANCH_SPACING) - child.originDeltaX
280
+ );
281
+ return {
282
+ // 这里需要加上原点的偏移量,并加上水平间距
283
+ x: preBounds.right + delta,
284
+ y: 0
285
+ };
286
+ } else {
287
+ const bottomSpacing = preTransform.size.height + preTransform.originDeltaY;
288
+ const delta = Math.max(
289
+ child.parent.minInlineBlockSpacing - bottomSpacing,
290
+ document.getDefaultSpacing(child.entity, document.ConstantKeys.BRANCH_SPACING) - child.originDeltaY
291
+ );
292
+ return {
293
+ x: 0,
294
+ // 这里需要加上原点的偏移量,并加上垂直间距
295
+ y: preBounds.bottom + delta
296
+ };
297
+ }
298
+ }
299
+ return {
300
+ x: 0,
301
+ y: 0
302
+ };
303
+ },
304
+ /**
305
+ * 控制条件分支居中布局
306
+ * @param trans
307
+ */
308
+ getDelta(trans, layout) {
309
+ const isVertical = document.FlowLayoutDefault.isVertical(layout);
310
+ const { pre, collapsed } = trans;
311
+ if (collapsed) {
312
+ return { x: 0, y: 0 };
313
+ }
314
+ if (isVertical) {
315
+ const preCenter2 = pre.localBounds.center.x;
316
+ const firstBlockX = trans.firstChild?.transform.position.x || 0;
317
+ const lastBlockX = trans.lastChild?.transform.position.x || 0;
318
+ const currentCenter2 = (lastBlockX - firstBlockX) / 2;
319
+ return {
320
+ x: preCenter2 - currentCenter2,
321
+ y: 0
322
+ };
323
+ }
324
+ const preCenter = pre.localBounds.center.y;
325
+ const firstBlockY = trans.firstChild?.transform.position.y || 0;
326
+ const lastBlockY = trans.lastChild?.transform.position.y || 0;
327
+ const currentCenter = (lastBlockY - firstBlockY) / 2;
328
+ return {
329
+ x: 0,
330
+ y: preCenter - currentCenter
331
+ };
332
+ },
333
+ getLabels(transition) {
334
+ return getBranchAdderLabel(transition);
335
+ },
336
+ getLines() {
337
+ return [];
338
+ },
339
+ // 和前序节点对齐
340
+ getInputPoint(transform, layout) {
341
+ const isVertical = document.FlowLayoutDefault.isVertical(layout);
342
+ if (isVertical) {
343
+ return {
344
+ x: transform.pre?.outputPoint.x || 0,
345
+ y: transform.bounds.top
346
+ };
347
+ }
348
+ return {
349
+ x: transform.bounds.left,
350
+ y: transform.pre?.outputPoint.y || 0
351
+ };
352
+ },
353
+ getOutputPoint(transform, layout) {
354
+ const isVertical = document.FlowLayoutDefault.isVertical(layout);
355
+ if (transform.collapsed) {
356
+ return transform.inputPoint;
357
+ }
358
+ if (isVertical) {
359
+ return {
360
+ x: transform.pre?.outputPoint.x || 0,
361
+ y: transform.bounds.bottom
362
+ };
363
+ }
364
+ return {
365
+ x: transform.bounds.right,
366
+ y: transform.pre?.outputPoint.y || 0
367
+ };
368
+ }
369
+ };
370
+ function getBranchAdderLabel(transition) {
371
+ const { isVertical } = transition.entity;
372
+ const currentTransform = transition.transform;
373
+ if (currentTransform.collapsed) {
374
+ return [
375
+ {
376
+ type: document.FlowTransitionLabelEnum.COLLAPSE_LABEL,
377
+ offset: utils.Point.move(currentTransform.inputPoint, isVertical ? { y: 10 } : { x: 10 }),
378
+ props: {
379
+ activateNode: transition.entity.pre
380
+ }
381
+ }
382
+ ];
383
+ }
384
+ return [
385
+ {
386
+ type: document.FlowTransitionLabelEnum.CUSTOM_LABEL,
387
+ renderKey: renderer.FlowRendererKey.BRANCH_ADDER,
388
+ offset: utils.Point.move(currentTransform.inputPoint, isVertical ? { y: 10 } : { x: 10 }),
389
+ props: {
390
+ // 激活状态
391
+ activated: transition.entity.getData(document.FlowNodeRenderData).activated,
392
+ transform: currentTransform,
393
+ // 传给外部使用的 node 信息
394
+ node: currentTransform.originParent?.entity
395
+ }
396
+ }
397
+ ];
398
+ }
399
+ var BlockIconRegistry = {
400
+ type: document.FlowNodeBaseType.BLOCK_ICON,
401
+ meta: {
402
+ spacing: 20,
403
+ // 占位节点下边偏小
404
+ // 条件分支 icon 默认的高度比较高,在流程里下边有文字
405
+ size: { width: 250, height: 84 }
406
+ },
407
+ /**
408
+ * 是一个占位节点,后续要加上 label 展开收起的图标
409
+ */
410
+ getLabels(transition) {
411
+ const currentTransform = transition.transform;
412
+ const { isVertical } = transition.entity;
413
+ if (transition.entity.parent.collapsedChildren.length <= 1) {
414
+ return [];
415
+ }
416
+ const collapsedSpacing = document.getDefaultSpacing(
417
+ transition.entity,
418
+ document.DefaultSpacingKey.COLLAPSED_SPACING
419
+ );
420
+ return [
421
+ {
422
+ type: document.FlowTransitionLabelEnum.COLLAPSE_LABEL,
423
+ offset: utils.Point.move(
424
+ currentTransform.outputPoint,
425
+ isVertical ? { y: collapsedSpacing } : { x: collapsedSpacing }
426
+ ),
427
+ props: {
428
+ collapseNode: transition.entity.parent,
429
+ activateNode: transition.entity
430
+ }
431
+ }
432
+ ];
433
+ }
434
+ };
435
+ var BlockOrderIconRegistry = {
436
+ type: document.FlowNodeBaseType.BLOCK_ORDER_ICON,
437
+ meta: {
438
+ spacing: 40
439
+ },
440
+ getLabels(transition) {
441
+ const currentTransform = transition.transform;
442
+ const { isVertical } = transition.entity;
443
+ const currentOutput = currentTransform.outputPoint;
444
+ const nextTransform = currentTransform.next;
445
+ const parentTransform = currentTransform.parent;
446
+ if (transition.entity.parent.collapsedChildren.length <= 1) {
447
+ const parentOutput = parentTransform?.outputPoint;
448
+ return [
449
+ {
450
+ offset: parentOutput,
451
+ type: document.FlowTransitionLabelEnum.ADDER_LABEL
452
+ }
453
+ ];
454
+ }
455
+ const collapsedSpacing = document.getDefaultSpacing(
456
+ transition.entity,
457
+ document.DefaultSpacingKey.COLLAPSED_SPACING
458
+ );
459
+ return [
460
+ {
461
+ offset: nextTransform ? utils.Point.getMiddlePoint(currentOutput, nextTransform.inputPoint) : utils.Point.move(
462
+ currentOutput,
463
+ isVertical ? { y: collapsedSpacing } : { x: collapsedSpacing }
464
+ ),
465
+ // 收起展开复合按钮
466
+ type: document.FlowTransitionLabelEnum.COLLAPSE_ADDER_LABEL,
467
+ props: {
468
+ activateNode: transition.entity,
469
+ collapseNode: transition.entity.parent
470
+ }
471
+ }
472
+ ];
473
+ }
474
+ };
475
+ var StartRegistry = {
476
+ type: document.FlowNodeBaseType.START,
477
+ meta: {
478
+ isStart: true,
479
+ draggable: false,
480
+ selectable: false,
481
+ // 触发器等开始节点不能被框选
482
+ deleteDisable: true,
483
+ // 禁止删除
484
+ copyDisable: true,
485
+ // 禁止copy
486
+ addDisable: true
487
+ // 禁止添加
488
+ }
489
+ };
490
+ var CatchBlockRegistry = {
491
+ extend: document.FlowNodeBaseType.BLOCK,
492
+ type: "catchBlock" /* CATCH_BLOCK */,
493
+ meta: {
494
+ hidden: true,
495
+ spacing: document.DEFAULT_SPACING.NULL
496
+ },
497
+ getLines(transition) {
498
+ const { transform } = transition;
499
+ const { isVertical } = transition.entity;
500
+ const parentPoint = transform.parent;
501
+ const { inputPoint, outputPoint } = transform;
502
+ let parentInputPoint;
503
+ if (isVertical) {
504
+ parentInputPoint = {
505
+ x: parentPoint.inputPoint.x,
506
+ y: parentPoint.inputPoint.y - 20 /* CATCH_INLINE_SPACING */
507
+ };
508
+ } else {
509
+ parentInputPoint = {
510
+ x: parentPoint.inputPoint.x - 20 /* CATCH_INLINE_SPACING */,
511
+ y: parentPoint.inputPoint.y
512
+ };
513
+ }
514
+ const lines = [
515
+ {
516
+ type: document.FlowTransitionLineEnum.DIVERGE_LINE,
517
+ from: parentInputPoint,
518
+ to: inputPoint
519
+ }
520
+ ];
521
+ if (!transition.isNodeEnd) {
522
+ let mergePoint;
523
+ if (isVertical) {
524
+ mergePoint = {
525
+ x: parentPoint.outputPoint.x,
526
+ y: parentPoint.bounds.bottom
527
+ };
528
+ } else {
529
+ mergePoint = {
530
+ x: parentPoint.bounds.right,
531
+ y: parentPoint.outputPoint.y
532
+ };
533
+ }
534
+ lines.push({
535
+ type: document.FlowTransitionLineEnum.MERGE_LINE,
536
+ from: outputPoint,
537
+ to: mergePoint
538
+ });
539
+ }
540
+ return lines;
541
+ },
542
+ getLabels() {
543
+ return [];
544
+ }
545
+ };
546
+ var CatchInlineBlocksRegistry = {
547
+ extend: document.FlowNodeBaseType.INLINE_BLOCKS,
548
+ type: "catchInlineBlocks" /* CATCH_INLINE_BLOCKS */,
549
+ meta: {
550
+ spacing: document.DEFAULT_SPACING.NULL,
551
+ inlineSpacingPre: document.DEFAULT_SPACING.NULL
552
+ // inlineSpacingAfter: DEFAULT_SPACING.NULL,
553
+ },
554
+ getDelta() {
555
+ return void 0;
556
+ },
557
+ getLines(transition) {
558
+ const { transform } = transition;
559
+ const mainInlineBlocks = transform.parent;
560
+ const lines = [
561
+ {
562
+ type: document.FlowTransitionLineEnum.DIVERGE_LINE,
563
+ from: mainInlineBlocks.pre.outputPoint,
564
+ to: transform.inputPoint
565
+ }
566
+ ];
567
+ if (!transform.entity.isNodeEnd) {
568
+ lines.push({
569
+ type: document.FlowTransitionLineEnum.MERGE_LINE,
570
+ from: transform.outputPoint,
571
+ to: mainInlineBlocks.outputPoint
572
+ });
573
+ }
574
+ return lines;
575
+ },
576
+ getOriginDeltaX(transform) {
577
+ const { firstChild } = transform;
578
+ if (!firstChild) return 0;
579
+ return firstChild.originDeltaX;
580
+ },
581
+ getLabels(transition) {
582
+ const { inputPoint } = transition.transform;
583
+ const { isVertical } = transition.entity;
584
+ const currentTransform = transition.transform;
585
+ const actualInputPoint = {
586
+ x: isVertical ? inputPoint.x : inputPoint.x - 20 /* CATCH_INLINE_SPACING */,
587
+ y: isVertical ? inputPoint.y - 20 /* CATCH_INLINE_SPACING */ : inputPoint.y
588
+ };
589
+ if (currentTransform.collapsed) {
590
+ return [];
591
+ }
592
+ return [
593
+ {
594
+ type: document.FlowTransitionLabelEnum.CUSTOM_LABEL,
595
+ renderKey: renderer.FlowRendererKey.BRANCH_ADDER,
596
+ offset: actualInputPoint,
597
+ props: {
598
+ // 激活状态
599
+ activated: transition.entity.getData(document.FlowNodeRenderData).activated,
600
+ transform: currentTransform,
601
+ // 传给外部使用的 node 信息
602
+ node: currentTransform.originParent?.entity
603
+ }
604
+ }
605
+ ];
606
+ },
607
+ getInputPoint(transform, layout) {
608
+ const isVertical = document.FlowLayoutDefault.isVertical(layout);
609
+ const firstCatchBlock = transform.firstChild;
610
+ if (firstCatchBlock) {
611
+ return firstCatchBlock.inputPoint;
612
+ }
613
+ return isVertical ? transform.bounds.topCenter : transform.bounds.rightCenter;
614
+ },
615
+ getOutputPoint(transform, layout) {
616
+ const isVertical = document.FlowLayoutDefault.isVertical(layout);
617
+ if (transform.collapsed) {
618
+ return transform.inputPoint;
619
+ }
620
+ const firstCatchBlock = transform.firstChild;
621
+ if (firstCatchBlock) {
622
+ return isVertical ? {
623
+ x: firstCatchBlock.outputPoint?.x,
624
+ y: transform.bounds.bottom
625
+ } : {
626
+ x: transform.bounds.right,
627
+ y: firstCatchBlock.outputPoint?.y
628
+ };
629
+ }
630
+ return isVertical ? transform.bounds.bottomCenter : transform.bounds.rightCenter;
631
+ }
632
+ };
633
+ var MainInlineBlocksRegistry = {
634
+ extend: document.FlowNodeBaseType.INLINE_BLOCKS,
635
+ type: "mainInlineBlocks" /* MAIN_INLINE_BLOCKS */,
636
+ meta: {
637
+ inlineSpacingPre: 20 /* MAIN_INLINE_SPACING_TOP */,
638
+ inlineSpacingAfter: 40 /* MAIN_INLINE_SPACING_BOTTOM */
639
+ },
640
+ getLines(transition) {
641
+ const { transform } = transition;
642
+ const tryBranch = transform.firstChild;
643
+ const lines = [
644
+ {
645
+ type: document.FlowTransitionLineEnum.STRAIGHT_LINE,
646
+ from: tryBranch.outputPoint,
647
+ to: transform.originParent.outputPoint
648
+ }
649
+ ];
650
+ return lines;
651
+ },
652
+ getLabels(transition) {
653
+ const { transform } = transition;
654
+ const { isVertical } = transition.entity;
655
+ const catchInlineBlocks = transform.children[1];
656
+ const errLabelX = isVertical ? (transform.parent.outputPoint.x + catchInlineBlocks.inputPoint.x) / 2 : transform.inputPoint.x - 54 /* INLINE_SPACING_TOP */;
657
+ const errLabelY = isVertical ? transform.inputPoint.y - 54 /* INLINE_SPACING_TOP */ : (transform.parent.outputPoint.y + catchInlineBlocks.inputPoint.y) / 2;
658
+ const errorLabelX = errLabelX;
659
+ const errorLabelY = errLabelY;
660
+ return [
661
+ {
662
+ type: document.FlowTransitionLabelEnum.TEXT_LABEL,
663
+ renderKey: renderer.FlowTextKey.TRY_START_TEXT,
664
+ offset: {
665
+ x: isVertical ? transform.inputPoint.x : transform.inputPoint.x + -20 /* TRY_START_LABEL_DELTA */,
666
+ y: isVertical ? transform.inputPoint.y + -20 /* TRY_START_LABEL_DELTA */ : transform.inputPoint.y
667
+ }
668
+ },
669
+ {
670
+ type: document.FlowTransitionLabelEnum.TEXT_LABEL,
671
+ renderKey: renderer.FlowTextKey.TRY_END_TEXT,
672
+ offset: {
673
+ x: isVertical ? transform.inputPoint.x : transform.originParent.outputPoint.x + -20 /* TRY_END_LABEL_DELTA */,
674
+ y: isVertical ? transform.originParent.outputPoint.y + -20 /* TRY_END_LABEL_DELTA */ : transform.inputPoint.y
675
+ }
676
+ },
677
+ // 错误分支收起
678
+ {
679
+ type: document.FlowTransitionLabelEnum.CUSTOM_LABEL,
680
+ renderKey: renderer.FlowRendererKey.TRY_CATCH_COLLAPSE,
681
+ offset: {
682
+ x: errorLabelX,
683
+ y: errorLabelY
684
+ },
685
+ props: {
686
+ node: transform.lastChild?.entity
687
+ }
688
+ }
689
+ ];
690
+ },
691
+ getInputPoint(transform) {
692
+ const tryBlock = transform.firstChild;
693
+ return tryBlock.inputPoint;
694
+ },
695
+ getOutputPoint(transform, layout) {
696
+ const tryBlock = transform.firstChild;
697
+ const isVertical = document.FlowLayoutDefault.isVertical(layout);
698
+ if (isVertical) {
699
+ return {
700
+ x: tryBlock.outputPoint.x,
701
+ y: transform.bounds.bottom + 20 /* CATCH_INLINE_SPACING */
702
+ };
703
+ }
704
+ return {
705
+ x: transform.bounds.right + 20 /* CATCH_INLINE_SPACING */,
706
+ y: tryBlock.outputPoint.y
707
+ };
708
+ },
709
+ getDelta() {
710
+ return void 0;
711
+ },
712
+ getChildDelta(child, layout) {
713
+ const preTransform = child.entity.pre?.getData(document.FlowNodeTransformData);
714
+ const isVertical = document.FlowLayoutDefault.isVertical(layout);
715
+ if (preTransform) {
716
+ const { localBounds: preBounds } = preTransform;
717
+ let delta = 0;
718
+ if (isVertical) {
719
+ delta = Math.max(
720
+ child.parent.minInlineBlockSpacing,
721
+ -child.originDeltaX + document.getDefaultSpacing(child.entity, document.ConstantKeys.BRANCH_SPACING)
722
+ );
723
+ } else {
724
+ delta = Math.max(
725
+ child.parent.minInlineBlockSpacing,
726
+ -child.originDeltaY + document.getDefaultSpacing(child.entity, document.ConstantKeys.BRANCH_SPACING)
727
+ );
728
+ }
729
+ return {
730
+ // 分支只有两个所以这里可以写死间隔宽度
731
+ x: isVertical ? preBounds.right + delta : 0,
732
+ y: isVertical ? 0 : preBounds.bottom + delta
733
+ };
734
+ }
735
+ return {
736
+ x: 0,
737
+ y: 0
738
+ };
739
+ }
740
+ };
741
+ var TryBlockRegistry = {
742
+ extend: document.FlowNodeBaseType.BLOCK,
743
+ type: "tryBlock" /* TRY_BLOCK */,
744
+ meta: {
745
+ hidden: true,
746
+ spacing: document.DEFAULT_SPACING.NULL
747
+ },
748
+ getLines() {
749
+ return [];
750
+ },
751
+ getLabels() {
752
+ return [];
753
+ }
754
+ };
755
+ var TrySlotRegistry = {
756
+ type: "trySlot" /* TRY_SLOT */,
757
+ meta: {
758
+ inlineSpacingAfter: 16,
759
+ spacing: 0,
760
+ size: {
761
+ width: 16,
762
+ height: 0
763
+ }
764
+ },
765
+ onAfterUpdateLocalTransform(transform) {
766
+ if (transform.entity.isVertical) {
767
+ transform.data.size = {
768
+ width: 16,
769
+ height: 0
770
+ };
771
+ } else {
772
+ transform.data.size = {
773
+ width: 0,
774
+ height: 16
775
+ };
776
+ }
777
+ transform.transform.update({
778
+ size: transform.data.size
779
+ });
780
+ },
781
+ getLabels(transition) {
782
+ return [
783
+ {
784
+ offset: transition.transform.bounds.center,
785
+ type: document.FlowTransitionLabelEnum.ADDER_LABEL
786
+ }
787
+ ];
788
+ }
789
+ };
790
+
791
+ // src/activities/try-catch.ts
792
+ var TryCatchRegistry = {
793
+ type: "tryCatch",
794
+ meta: {
795
+ hidden: true,
796
+ inlineSpacingAfter: 0 /* INLINE_SPACING_BOTTOM */
797
+ },
798
+ /**
799
+ * 结构
800
+ * tryCatch
801
+ * - tryCatchIcon
802
+ * - mainInlineBlocks
803
+ * - tryBlock // try 分支
804
+ * - trySlot // 空节点用来占位,try 分支一开始没有节点
805
+ * - catchInlineBlocks
806
+ * - catchBlock // catch 分支 1
807
+ * - blockOrderIcon
808
+ * - node1
809
+ * - catchBlock // catch 分支 2
810
+ * - blockOrderIcon
811
+ * - node 2
812
+ * @param node
813
+ * @param json
814
+ */
815
+ onCreate(node, json) {
816
+ const { document: document$1 } = node;
817
+ const [tryBlock, ...catchBlocks] = json.blocks || [];
818
+ const addedNodes = [];
819
+ const tryCatchIconNode = document$1.addNode({
820
+ id: `$tryCatchIcon$${node.id}`,
821
+ type: document.FlowNodeBaseType.BLOCK_ICON,
822
+ originParent: node,
823
+ parent: node
824
+ });
825
+ const mainBlockNode = document$1.addNode({
826
+ id: `$mainInlineBlocks$${node.id}`,
827
+ type: "mainInlineBlocks" /* MAIN_INLINE_BLOCKS */,
828
+ originParent: node,
829
+ parent: node
830
+ });
831
+ const tryBlockNode = document$1.addNode({
832
+ id: tryBlock.id,
833
+ type: tryBlock.type || "tryBlock" /* TRY_BLOCK */,
834
+ originParent: node,
835
+ parent: mainBlockNode,
836
+ data: tryBlock.data
837
+ });
838
+ const trySlotNode = document$1.addNode({
839
+ id: `$trySlot$${tryBlock.id}`,
840
+ hidden: true,
841
+ type: "trySlot" /* TRY_SLOT */,
842
+ // 占位节点
843
+ originParent: node,
844
+ parent: tryBlockNode
845
+ });
846
+ const catchInlineBlocksNode = document$1.addNode({
847
+ id: `$catchInlineBlocks$${node.id}`,
848
+ type: "catchInlineBlocks" /* CATCH_INLINE_BLOCKS */,
849
+ originParent: node,
850
+ parent: mainBlockNode
851
+ });
852
+ addedNodes.push(
853
+ tryCatchIconNode,
854
+ mainBlockNode,
855
+ tryBlockNode,
856
+ trySlotNode,
857
+ catchInlineBlocksNode
858
+ );
859
+ (tryBlock.blocks || []).forEach((blockData) => {
860
+ document$1.addNode(
861
+ {
862
+ ...blockData,
863
+ parent: tryBlockNode
864
+ },
865
+ addedNodes
866
+ );
867
+ });
868
+ catchBlocks.forEach((blockData) => {
869
+ document$1.addBlock(node, blockData, addedNodes);
870
+ });
871
+ return addedNodes;
872
+ },
873
+ /**
874
+ * 添加 catch 分支
875
+ * @param node
876
+ * @param blockData
877
+ * @param addedNodes
878
+ */
879
+ onBlockChildCreate(node, blockData, addedNodes) {
880
+ const parent = node.document.getNode(`$catchInlineBlocks$${node.id}`);
881
+ const block = node.document.addNode({
882
+ id: blockData.id,
883
+ type: blockData.type || "catchBlock" /* CATCH_BLOCK */,
884
+ originParent: node,
885
+ parent,
886
+ data: blockData.data
887
+ });
888
+ const blockOrderIcon = node.document.addNode({
889
+ id: `$blockOrderIcon$${blockData.id}`,
890
+ type: document.FlowNodeBaseType.BLOCK_ORDER_ICON,
891
+ originParent: node,
892
+ parent: block
893
+ });
894
+ if (blockData.blocks) {
895
+ node.document.addBlocksAsChildren(block, blockData.blocks || [], addedNodes);
896
+ }
897
+ addedNodes?.push(block, blockOrderIcon);
898
+ return block;
899
+ },
900
+ getInputPoint(transform) {
901
+ const tryCatchIcon = transform.firstChild;
902
+ return tryCatchIcon.inputPoint;
903
+ },
904
+ getOutputPoint(transform, layout) {
905
+ const isVertical = document.FlowLayoutDefault.isVertical(layout);
906
+ const tryCatchIcon = transform.firstChild;
907
+ if (isVertical) {
908
+ return {
909
+ x: tryCatchIcon.inputPoint.x,
910
+ y: transform.bounds.bottom
911
+ };
912
+ }
913
+ return {
914
+ x: transform.bounds.right,
915
+ y: tryCatchIcon.inputPoint.y
916
+ };
917
+ },
918
+ /**
919
+ * tryCatch 子节点配置
920
+ */
921
+ extendChildRegistries: [
922
+ /**
923
+ * icon 节点
924
+ */
925
+ {
926
+ type: document.FlowNodeBaseType.BLOCK_ICON,
927
+ meta: {
928
+ spacing: 54 /* INLINE_SPACING_TOP */
929
+ },
930
+ getLabels() {
931
+ return [];
932
+ }
933
+ },
934
+ MainInlineBlocksRegistry,
935
+ CatchInlineBlocksRegistry,
936
+ TryBlockRegistry,
937
+ CatchBlockRegistry,
938
+ TrySlotRegistry
939
+ ]
940
+ };
941
+ var LoopSpacings = {
942
+ SPACING: 16,
943
+ // 距离下面节点距离
944
+ COLLAPSE_INLINE_SPACING_BOTTOM: 60,
945
+ // 距离下面节点距离
946
+ [document.ConstantKeys.INLINE_SPACING_BOTTOM]: 48,
947
+ // 下边空白
948
+ MIN_INLINE_BLOCK_SPACING: 280,
949
+ // 最小循环圈宽度
950
+ HORIZONTAL_MIN_INLINE_BLOCK_SPACING: 180,
951
+ // 水平布局下的最小循环圈高度
952
+ LEFT_EMPTY_BLOCK_WIDTH: 80,
953
+ // 左边空分支宽度
954
+ EMPTY_BRANCH_SPACING: 20,
955
+ // 左边空分支宽度
956
+ LOOP_BLOCK_ICON_SPACING: 13,
957
+ // inlineBlocks 的 inlineBottom
958
+ [document.ConstantKeys.INLINE_BLOCKS_INLINE_SPACING_BOTTOM]: 23,
959
+ // inlineBlocks 的 inlineBottom
960
+ INLINE_BLOCKS_INLINE_SPACING_TOP: 30
961
+ // inlineBlocks 的 inlineTop
962
+ };
963
+
964
+ // src/activities/loop-extends/loop-left-empty-block.ts
965
+ var LoopLeftEmptyBlockRegistry = {
966
+ type: "loopLeftEmptyBlock" /* LOOP_LEFT_EMPTY_BLOCK */,
967
+ meta: {
968
+ inlineSpacingAfter: 0,
969
+ spacing: 0,
970
+ size: {
971
+ width: LoopSpacings.LEFT_EMPTY_BLOCK_WIDTH,
972
+ height: 0
973
+ }
974
+ },
975
+ onAfterUpdateLocalTransform(transform) {
976
+ if (transform.entity.isVertical) {
977
+ transform.data.size = {
978
+ width: LoopSpacings.LEFT_EMPTY_BLOCK_WIDTH,
979
+ height: 0
980
+ };
981
+ } else {
982
+ transform.data.size = {
983
+ width: 0,
984
+ height: LoopSpacings.LEFT_EMPTY_BLOCK_WIDTH
985
+ };
986
+ }
987
+ transform.transform.update({
988
+ size: transform.data.size
989
+ });
990
+ },
991
+ getLines() {
992
+ return [];
993
+ },
994
+ getLabels() {
995
+ return [];
996
+ }
997
+ };
998
+
999
+ // src/activities/loop-extends/loop-right-empty-block.ts
1000
+ var LoopRightEmptyBlockRegistry = {
1001
+ ...BlockRegistry,
1002
+ type: "loopRightEmptyBlock" /* LOOP_RIGHT_EMPTY_BLOCK */,
1003
+ meta: {
1004
+ ...BlockRegistry.meta,
1005
+ inlineSpacingAfter: 0
1006
+ }
1007
+ };
1008
+ var LoopEmptyBranchRegistry = {
1009
+ type: "loopEmptyBranch" /* LOOP_EMPTY_BRANCH */,
1010
+ meta: {
1011
+ inlineSpacingAfter: 0,
1012
+ spacing: LoopSpacings.EMPTY_BRANCH_SPACING,
1013
+ size: {
1014
+ width: 100,
1015
+ height: 0
1016
+ }
1017
+ },
1018
+ getLabels(transition) {
1019
+ const { isVertical } = transition.entity;
1020
+ const currentTransform = transition.transform;
1021
+ if (isVertical) {
1022
+ return [
1023
+ {
1024
+ type: document.FlowTransitionLabelEnum.ADDER_LABEL,
1025
+ offset: {
1026
+ x: currentTransform.inputPoint.x,
1027
+ y: currentTransform.bounds.center.y + 8
1028
+ // 右边空节点
1029
+ }
1030
+ }
1031
+ ];
1032
+ }
1033
+ return [
1034
+ {
1035
+ type: document.FlowTransitionLabelEnum.ADDER_LABEL,
1036
+ offset: {
1037
+ x: currentTransform.bounds.center.x + 8,
1038
+ y: currentTransform.inputPoint.y
1039
+ }
1040
+ }
1041
+ ];
1042
+ },
1043
+ onAfterUpdateLocalTransform(transform) {
1044
+ if (transform.entity.isVertical) {
1045
+ transform.data.size = {
1046
+ width: 100,
1047
+ height: 0
1048
+ };
1049
+ } else {
1050
+ transform.data.size = {
1051
+ width: 0,
1052
+ height: 100
1053
+ };
1054
+ }
1055
+ transform.transform.update({
1056
+ size: transform.data.size
1057
+ });
1058
+ }
1059
+ };
1060
+ var LoopInlineBlocksNodeRegistry = {
1061
+ type: document.FlowNodeBaseType.INLINE_BLOCKS,
1062
+ meta: {
1063
+ inlineSpacingPre: (node) => {
1064
+ const inlineBlocksInlineSpacingTop = document.getDefaultSpacing(
1065
+ node.entity,
1066
+ document.ConstantKeys.INLINE_BLOCKS_INLINE_SPACING_TOP,
1067
+ LoopSpacings.INLINE_BLOCKS_INLINE_SPACING_TOP
1068
+ );
1069
+ return inlineBlocksInlineSpacingTop;
1070
+ },
1071
+ inlineSpacingAfter: (node) => {
1072
+ const inlineBlocksInlineSpacingBottom = document.getDefaultSpacing(
1073
+ node.entity,
1074
+ document.ConstantKeys.INLINE_BLOCKS_INLINE_SPACING_BOTTOM,
1075
+ LoopSpacings.INLINE_BLOCKS_INLINE_SPACING_BOTTOM
1076
+ );
1077
+ return inlineBlocksInlineSpacingBottom;
1078
+ },
1079
+ minInlineBlockSpacing: (node) => node.entity.isVertical ? LoopSpacings.MIN_INLINE_BLOCK_SPACING : LoopSpacings.HORIZONTAL_MIN_INLINE_BLOCK_SPACING
1080
+ },
1081
+ getLines(transition) {
1082
+ const currentTransform = transition.transform;
1083
+ const parentTransform = currentTransform.parent;
1084
+ const { isVertical } = transition.entity;
1085
+ const lines = [
1086
+ // 循环结束线
1087
+ {
1088
+ type: document.FlowTransitionLineEnum.STRAIGHT_LINE,
1089
+ from: currentTransform.outputPoint,
1090
+ to: parentTransform.outputPoint
1091
+ }
1092
+ ];
1093
+ if (currentTransform.collapsed) {
1094
+ return lines;
1095
+ }
1096
+ const [leftBlockTransform] = currentTransform.children;
1097
+ return [
1098
+ ...lines,
1099
+ // 循环回撤线 - 1 分成两段可以被 viewport 识别出矩阵区域
1100
+ {
1101
+ type: document.FlowTransitionLineEnum.ROUNDED_LINE,
1102
+ from: currentTransform.outputPoint,
1103
+ to: leftBlockTransform.outputPoint,
1104
+ vertices: [
1105
+ isVertical ? { x: leftBlockTransform.inputPoint.x, y: currentTransform.bounds.bottom } : { x: currentTransform.bounds.right, y: leftBlockTransform.inputPoint.y }
1106
+ ]
1107
+ },
1108
+ // 循环回撤线 - 2
1109
+ {
1110
+ type: document.FlowTransitionLineEnum.ROUNDED_LINE,
1111
+ from: leftBlockTransform.outputPoint,
1112
+ to: utils.Point.move(
1113
+ currentTransform.inputPoint,
1114
+ isVertical ? { x: -12, y: 10 } : { x: 10, y: -12 }
1115
+ ),
1116
+ vertices: [
1117
+ isVertical ? { x: leftBlockTransform.inputPoint.x, y: currentTransform.bounds.top + 10 } : { x: currentTransform.bounds.left + 10, y: leftBlockTransform.inputPoint.y }
1118
+ ],
1119
+ arrow: true
1120
+ }
1121
+ ];
1122
+ },
1123
+ getLabels(transition) {
1124
+ const currentTransform = transition.transform;
1125
+ const { isVertical } = transition.entity;
1126
+ const labels = [];
1127
+ if (currentTransform.collapsed) {
1128
+ return labels;
1129
+ }
1130
+ const leftBlockTransform = currentTransform.children[0];
1131
+ const rightBlockTransform = currentTransform.children[1];
1132
+ if (transition.entity.originParent?.id.startsWith("while_")) {
1133
+ labels.push({
1134
+ type: document.FlowTransitionLabelEnum.TEXT_LABEL,
1135
+ renderKey: renderer.FlowTextKey.LOOP_WHILE_TEXT,
1136
+ rotate: isVertical ? "" : "-90deg",
1137
+ offset: isVertical ? {
1138
+ x: (currentTransform.inputPoint.x + rightBlockTransform.inputPoint.x) / 2,
1139
+ y: currentTransform.inputPoint.y + 10
1140
+ } : {
1141
+ x: currentTransform.inputPoint.x + 10,
1142
+ y: (currentTransform.inputPoint.y + rightBlockTransform.inputPoint.y) / 2
1143
+ }
1144
+ });
1145
+ } else {
1146
+ labels.push({
1147
+ type: document.FlowTransitionLabelEnum.TEXT_LABEL,
1148
+ renderKey: renderer.FlowTextKey.LOOP_TRAVERSE_TEXT,
1149
+ // rotate: isVertical ? '' : '-90deg',
1150
+ offset: isVertical ? { x: leftBlockTransform.inputPoint.x, y: currentTransform.bounds.center.y + 5 } : { x: currentTransform.bounds.center.x + 5, y: leftBlockTransform.inputPoint.y }
1151
+ });
1152
+ }
1153
+ return labels;
1154
+ }
1155
+ };
1156
+
1157
+ // src/activities/loop.ts
1158
+ var LoopRegistry = {
1159
+ type: "loop",
1160
+ meta: {
1161
+ hidden: true,
1162
+ inlineSpacingAfter: (node) => {
1163
+ if (node.collapsed) {
1164
+ return LoopSpacings.COLLAPSE_INLINE_SPACING_BOTTOM;
1165
+ }
1166
+ const inlineSpacingBottom = document.getDefaultSpacing(
1167
+ node.entity,
1168
+ document.ConstantKeys.INLINE_SPACING_BOTTOM,
1169
+ LoopSpacings.INLINE_SPACING_BOTTOM
1170
+ );
1171
+ return inlineSpacingBottom;
1172
+ },
1173
+ spacing: LoopSpacings.SPACING
1174
+ },
1175
+ /**
1176
+ * - loopNode
1177
+ * - loopBlockIcon
1178
+ * - loopInlineBlocks
1179
+ * - loopEmptyBlock 左侧占位区域
1180
+ * - loopBlock
1181
+ * - xxx
1182
+ * - xxx
1183
+ * @param node
1184
+ * @param json
1185
+ */
1186
+ onCreate(node, json) {
1187
+ const { document: document$1 } = node;
1188
+ const loopBlocks = json.blocks || [];
1189
+ const loopIconNode = document$1.addNode({
1190
+ id: `$blockIcon$${node.id}`,
1191
+ type: document.FlowNodeBaseType.BLOCK_ICON,
1192
+ originParent: node,
1193
+ parent: node
1194
+ });
1195
+ const loopInlineBlocks = document$1.addNode({
1196
+ id: `$inlineBlocks$${node.id}`,
1197
+ hidden: true,
1198
+ type: document.FlowNodeBaseType.INLINE_BLOCKS,
1199
+ originParent: node,
1200
+ parent: node
1201
+ });
1202
+ const loopEmptyBlockNode = document$1.addNode({
1203
+ id: `$loopLeftEmpty$${node.id}`,
1204
+ hidden: true,
1205
+ type: "loopLeftEmptyBlock" /* LOOP_LEFT_EMPTY_BLOCK */,
1206
+ originParent: node,
1207
+ parent: loopInlineBlocks
1208
+ });
1209
+ const loopBlockNode = document$1.addNode({
1210
+ id: `$block$${node.id}`,
1211
+ hidden: true,
1212
+ type: document.FlowNodeBaseType.BLOCK,
1213
+ // : LoopTypeEnum.LOOP_RIGHT_EMPTY_BLOCK,
1214
+ originParent: node,
1215
+ parent: loopInlineBlocks
1216
+ });
1217
+ const loopBranch = document$1.addNode({
1218
+ id: `$loopRightEmpty$${node.id}`,
1219
+ hidden: true,
1220
+ type: "loopEmptyBranch" /* LOOP_EMPTY_BRANCH */,
1221
+ originParent: node,
1222
+ parent: loopBlockNode
1223
+ });
1224
+ const otherNodes = [];
1225
+ loopBlocks.forEach(
1226
+ (b) => document$1.addNode(
1227
+ {
1228
+ ...b,
1229
+ type: b.type,
1230
+ parent: loopBlockNode
1231
+ },
1232
+ otherNodes
1233
+ )
1234
+ );
1235
+ return [
1236
+ loopIconNode,
1237
+ loopEmptyBlockNode,
1238
+ loopInlineBlocks,
1239
+ loopBlockNode,
1240
+ loopBranch,
1241
+ ...otherNodes
1242
+ ];
1243
+ },
1244
+ getLabels(transition) {
1245
+ const currentTransform = transition.transform;
1246
+ const { isVertical } = transition.entity;
1247
+ return [
1248
+ // 循环结束
1249
+ {
1250
+ type: document.FlowTransitionLabelEnum.TEXT_LABEL,
1251
+ renderKey: renderer.FlowTextKey.LOOP_END_TEXT,
1252
+ // 循环 label 垂直样式展示,而非 rotate 旋转文案
1253
+ props: isVertical ? void 0 : {
1254
+ style: {
1255
+ maxWidth: "20px",
1256
+ lineHeight: "12px",
1257
+ whiteSpace: "pre-wrap"
1258
+ }
1259
+ },
1260
+ offset: utils.Point.move(currentTransform.outputPoint, isVertical ? { y: -26 } : { x: -26 })
1261
+ },
1262
+ {
1263
+ type: document.FlowTransitionLabelEnum.ADDER_LABEL,
1264
+ offset: currentTransform.outputPoint
1265
+ }
1266
+ ];
1267
+ },
1268
+ // 和前序节点对齐
1269
+ getInputPoint(transform) {
1270
+ const { isVertical } = transform.entity;
1271
+ if (isVertical) {
1272
+ return {
1273
+ x: transform.pre?.outputPoint.x || transform.firstChild?.outputPoint.x || 0,
1274
+ y: transform.bounds.top
1275
+ };
1276
+ }
1277
+ return {
1278
+ x: transform.bounds.left,
1279
+ y: transform.pre?.outputPoint.y || transform.firstChild?.outputPoint.y || 0
1280
+ };
1281
+ },
1282
+ getOutputPoint(transform) {
1283
+ const { isVertical } = transform.entity;
1284
+ if (isVertical) {
1285
+ return {
1286
+ x: transform.pre?.outputPoint.x || transform.firstChild?.outputPoint.x || 0,
1287
+ y: transform.bounds.bottom
1288
+ };
1289
+ }
1290
+ return {
1291
+ x: transform.bounds.right,
1292
+ y: transform.pre?.outputPoint.y || transform.firstChild?.outputPoint.y || 0
1293
+ };
1294
+ },
1295
+ extendChildRegistries: [
1296
+ {
1297
+ type: document.FlowNodeBaseType.BLOCK_ICON,
1298
+ meta: {
1299
+ spacing: LoopSpacings.LOOP_BLOCK_ICON_SPACING
1300
+ }
1301
+ },
1302
+ LoopLeftEmptyBlockRegistry,
1303
+ LoopEmptyBranchRegistry,
1304
+ LoopRightEmptyBlockRegistry,
1305
+ LoopInlineBlocksNodeRegistry
1306
+ ],
1307
+ /**
1308
+ * @depreacted
1309
+ */
1310
+ addChild(node, json, options = {}) {
1311
+ const { index } = options;
1312
+ const document = node.document;
1313
+ return document.addNode({
1314
+ ...json,
1315
+ ...options,
1316
+ parent: document.getNode(`$block$${node.id}`),
1317
+ index: typeof index === "number" ? index + 1 : void 0
1318
+ });
1319
+ }
1320
+ };
1321
+ var RootRegistry = {
1322
+ type: document.FlowNodeBaseType.ROOT,
1323
+ meta: {
1324
+ spacing: document.DEFAULT_SPACING.NULL,
1325
+ hidden: true
1326
+ },
1327
+ getInputPoint(transform) {
1328
+ return transform.firstChild?.inputPoint || transform.bounds.topCenter;
1329
+ },
1330
+ getOutputPoint(transform) {
1331
+ return transform.lastChild?.outputPoint || transform.bounds.bottomCenter;
1332
+ }
1333
+ };
1334
+ var EmptyRegistry = {
1335
+ type: document.FlowNodeBaseType.EMPTY,
1336
+ meta: {
1337
+ spacing: (node) => {
1338
+ const spacing = document.getDefaultSpacing(node.entity, document.ConstantKeys.NODE_SPACING);
1339
+ return spacing / 2;
1340
+ },
1341
+ size: { width: 0, height: 0 },
1342
+ hidden: true
1343
+ },
1344
+ getLabels(transition) {
1345
+ return [
1346
+ {
1347
+ offset: transition.transform.bounds,
1348
+ type: document.FlowTransitionLabelEnum.ADDER_LABEL
1349
+ }
1350
+ ];
1351
+ }
1352
+ };
1353
+ var SimpleSplitRegistry = {
1354
+ type: document.FlowNodeSplitType.SIMPLE_SPLIT,
1355
+ extend: document.FlowNodeSplitType.DYNAMIC_SPLIT,
1356
+ onBlockChildCreate(originParent, blockData, addedNodes = []) {
1357
+ const { document: document$1 } = originParent;
1358
+ const parent = document$1.getNode(`$inlineBlocks$${originParent.id}`);
1359
+ const realBlock = document$1.addNode(
1360
+ {
1361
+ ...blockData,
1362
+ type: blockData.type || document.FlowNodeBaseType.BLOCK,
1363
+ parent
1364
+ },
1365
+ addedNodes
1366
+ );
1367
+ addedNodes.push(realBlock);
1368
+ return realBlock;
1369
+ }
1370
+ // addChild(node, json, options = {}) {
1371
+ // const { index } = options;
1372
+ // const document = node.document;
1373
+ // return document.addBlock(node, json, undefined, undefined, index);
1374
+ // }
1375
+ };
1376
+ var BreakRegistry = {
1377
+ type: document.FlowNodeBaseType.BREAK,
1378
+ extend: document.FlowNodeBaseType.END
1379
+ };
1380
+ var InputRegistry = {
1381
+ type: document.FlowNodeBaseType.INPUT,
1382
+ extend: document.FlowNodeBaseType.BLOCK,
1383
+ meta: {
1384
+ hidden: false
1385
+ },
1386
+ getLines(transition, layout) {
1387
+ const currentTransform = transition.transform;
1388
+ const { isVertical } = transition.entity;
1389
+ const lines = [];
1390
+ const hasBranchDraggingAdder = currentTransform && currentTransform.entity.isInlineBlock && transition.renderData.draggable;
1391
+ if (hasBranchDraggingAdder) {
1392
+ if (isVertical) {
1393
+ const currentOffsetRightX = currentTransform.firstChild ? currentTransform.firstChild.bounds.right : currentTransform.bounds.right;
1394
+ const nextOffsetLeftX = (currentTransform.next?.firstChild ? currentTransform.next?.firstChild.bounds?.left : currentTransform.next?.bounds?.left) || 0;
1395
+ const currentInputPointY = currentTransform.outputPoint.y;
1396
+ if (currentTransform?.next) {
1397
+ lines.push({
1398
+ type: document.FlowTransitionLineEnum.MERGE_LINE,
1399
+ isDraggingLine: true,
1400
+ from: {
1401
+ x: (currentOffsetRightX + nextOffsetLeftX) / 2,
1402
+ y: currentInputPointY
1403
+ },
1404
+ to: currentTransform.parent.outputPoint,
1405
+ side: document.LABEL_SIDE_TYPE.NORMAL_BRANCH
1406
+ });
1407
+ }
1408
+ } else {
1409
+ const currentOffsetBottomX = currentTransform.firstChild ? currentTransform.firstChild.bounds.bottom : currentTransform.bounds.bottom;
1410
+ const nextOffsetTopX = (currentTransform.next?.firstChild ? currentTransform.next?.firstChild.bounds?.top : currentTransform.next?.bounds?.top) || 0;
1411
+ const currentInputPointX = currentTransform.outputPoint.x;
1412
+ if (currentTransform?.next) {
1413
+ lines.push({
1414
+ type: document.FlowTransitionLineEnum.MERGE_LINE,
1415
+ isDraggingLine: true,
1416
+ from: {
1417
+ x: currentInputPointX,
1418
+ y: (currentOffsetBottomX + nextOffsetTopX) / 2
1419
+ },
1420
+ to: currentTransform.parent.outputPoint,
1421
+ side: document.LABEL_SIDE_TYPE.NORMAL_BRANCH
1422
+ });
1423
+ }
1424
+ }
1425
+ }
1426
+ if (!transition.isNodeEnd) {
1427
+ lines.push({
1428
+ type: document.FlowTransitionLineEnum.MERGE_LINE,
1429
+ from: currentTransform.outputPoint,
1430
+ to: currentTransform.parent.outputPoint,
1431
+ side: document.LABEL_SIDE_TYPE.NORMAL_BRANCH
1432
+ });
1433
+ }
1434
+ return lines;
1435
+ },
1436
+ getLabels(transition) {
1437
+ const currentTransform = transition.transform;
1438
+ const { isVertical } = transition.entity;
1439
+ const draggingLabel = [];
1440
+ const hasBranchDraggingAdder = currentTransform && currentTransform.entity.isInlineBlock && transition.renderData.draggable;
1441
+ if (hasBranchDraggingAdder) {
1442
+ if (isVertical) {
1443
+ const currentOffsetRightX = currentTransform.firstChild ? currentTransform.firstChild.bounds.right : currentTransform.bounds.right;
1444
+ const nextOffsetLeftX = (currentTransform.next?.firstChild ? currentTransform.next.firstChild.bounds?.left : currentTransform.next?.bounds?.left) || 0;
1445
+ const currentInputPointY = currentTransform.outputPoint.y;
1446
+ if (currentTransform?.next) {
1447
+ draggingLabel.push({
1448
+ offset: {
1449
+ x: (currentOffsetRightX + nextOffsetLeftX) / 2,
1450
+ y: currentInputPointY
1451
+ },
1452
+ type: document.FlowTransitionLabelEnum.BRANCH_DRAGGING_LABEL,
1453
+ width: nextOffsetLeftX - currentOffsetRightX,
1454
+ props: {
1455
+ side: document.LABEL_SIDE_TYPE.NORMAL_BRANCH
1456
+ }
1457
+ });
1458
+ }
1459
+ } else {
1460
+ const currentOffsetBottomX = currentTransform.firstChild ? currentTransform.firstChild.bounds.bottom : currentTransform.bounds.bottom;
1461
+ const nextOffsetTopX = (currentTransform.next?.firstChild ? currentTransform.next.firstChild.bounds?.top : currentTransform.next?.bounds?.top) || 0;
1462
+ const currentInputPointX = currentTransform.outputPoint.x;
1463
+ if (currentTransform?.next) {
1464
+ draggingLabel.push({
1465
+ offset: {
1466
+ x: currentInputPointX,
1467
+ y: (currentOffsetBottomX + nextOffsetTopX) / 2
1468
+ },
1469
+ type: document.FlowTransitionLabelEnum.BRANCH_DRAGGING_LABEL,
1470
+ width: nextOffsetTopX - currentOffsetBottomX,
1471
+ props: {
1472
+ side: document.LABEL_SIDE_TYPE.NORMAL_BRANCH
1473
+ }
1474
+ });
1475
+ }
1476
+ }
1477
+ }
1478
+ return [...draggingLabel];
1479
+ }
1480
+ };
1481
+ var OuputRegistry = {
1482
+ type: document.FlowNodeBaseType.OUTPUT,
1483
+ extend: document.FlowNodeBaseType.BLOCK,
1484
+ meta: {
1485
+ hidden: false,
1486
+ isNodeEnd: true
1487
+ }
1488
+ };
1489
+ var MultiOuputsRegistry = {
1490
+ type: document.FlowNodeBaseType.MULTI_OUTPUTS,
1491
+ extend: document.FlowNodeSplitType.SIMPLE_SPLIT,
1492
+ meta: {
1493
+ isNodeEnd: true
1494
+ },
1495
+ getLines: (transition, layout) => {
1496
+ if (transition.entity.parent?.flowNodeType === document.FlowNodeBaseType.INLINE_BLOCKS) {
1497
+ return BlockRegistry.getLines(transition, layout);
1498
+ }
1499
+ return [];
1500
+ },
1501
+ getLabels: (transition, layout) => [
1502
+ ...DynamicSplitRegistry.getLabels(transition, layout),
1503
+ ...BlockRegistry.getLabels(transition, layout)
1504
+ ],
1505
+ getOutputPoint(transform, layout) {
1506
+ const isVertical = document.FlowLayoutDefault.isVertical(layout);
1507
+ const lastChildOutput = transform.lastChild?.outputPoint;
1508
+ if (isVertical) {
1509
+ return {
1510
+ x: lastChildOutput ? lastChildOutput.x : transform.bounds.center.x,
1511
+ y: transform.bounds.bottom
1512
+ };
1513
+ }
1514
+ return {
1515
+ x: transform.bounds.right,
1516
+ y: lastChildOutput ? lastChildOutput.y : transform.bounds.center.y
1517
+ };
1518
+ },
1519
+ extendChildRegistries: [
1520
+ {
1521
+ type: document.FlowNodeBaseType.BLOCK_ICON,
1522
+ meta: {
1523
+ // isNodeEnd: true
1524
+ }
1525
+ }
1526
+ ]
1527
+ };
1528
+ var MultiInputsRegistry = {
1529
+ type: document.FlowNodeBaseType.MULTI_INPUTS,
1530
+ extend: document.FlowNodeSplitType.SIMPLE_SPLIT,
1531
+ extendChildRegistries: [
1532
+ {
1533
+ type: document.FlowNodeBaseType.BLOCK_ICON,
1534
+ meta: {
1535
+ hidden: true,
1536
+ spacing: 0
1537
+ },
1538
+ getLines() {
1539
+ return [];
1540
+ },
1541
+ getLabels() {
1542
+ return [];
1543
+ }
1544
+ },
1545
+ {
1546
+ type: document.FlowNodeBaseType.INLINE_BLOCKS,
1547
+ meta: {
1548
+ inlineSpacingPre: 0
1549
+ },
1550
+ getLabels(transition) {
1551
+ const isVertical = transition.entity.isVertical;
1552
+ const currentTransform = transition.transform;
1553
+ const spacing = document.getDefaultSpacing(
1554
+ transition.entity,
1555
+ document.ConstantKeys.INLINE_BLOCKS_PADDING_BOTTOM
1556
+ );
1557
+ if (currentTransform.collapsed || transition.entity.childrenLength === 0) {
1558
+ return [
1559
+ {
1560
+ type: document.FlowTransitionLabelEnum.CUSTOM_LABEL,
1561
+ renderKey: renderer.FlowRendererKey.BRANCH_ADDER,
1562
+ offset: utils.Point.move(
1563
+ currentTransform.outputPoint,
1564
+ isVertical ? { y: spacing } : { x: spacing }
1565
+ ),
1566
+ props: {
1567
+ // 激活状态
1568
+ activated: transition.entity.getData(document.FlowNodeRenderData).activated,
1569
+ transform: currentTransform,
1570
+ // 传给外部使用的 node 信息
1571
+ node: currentTransform.originParent?.entity
1572
+ }
1573
+ }
1574
+ ];
1575
+ }
1576
+ return [
1577
+ {
1578
+ type: document.FlowTransitionLabelEnum.CUSTOM_LABEL,
1579
+ renderKey: renderer.FlowRendererKey.BRANCH_ADDER,
1580
+ offset: utils.Point.move(
1581
+ currentTransform.outputPoint,
1582
+ isVertical ? { y: -spacing / 2 } : { x: -spacing / 2 }
1583
+ ),
1584
+ props: {
1585
+ // 激活状态
1586
+ activated: transition.entity.getData(document.FlowNodeRenderData).activated,
1587
+ transform: currentTransform,
1588
+ // 传给外部使用的 node 信息
1589
+ node: currentTransform.originParent?.entity
1590
+ }
1591
+ }
1592
+ ];
1593
+ }
1594
+ }
1595
+ ],
1596
+ getLabels() {
1597
+ return [];
1598
+ }
1599
+ };
1600
+ var RENDER_SLOT_ADDER_KEY = renderer.FlowRendererKey.SLOT_ADDER;
1601
+ var RENDER_SLOT_LABEL_KEY = renderer.FlowRendererKey.SLOT_LABEL;
1602
+ var RENDER_SLOT_COLLAPSE_KEY = renderer.FlowRendererKey.SLOT_COLLAPSE;
1603
+ var SlotSpacingKey = {
1604
+ /**
1605
+ * = Next Node - Slot END
1606
+ */
1607
+ SLOT_SPACING: "SLOT_SPACING",
1608
+ /**
1609
+ * = Slot Start Line - Slot Icon Right
1610
+ */
1611
+ SLOT_START_DISTANCE: "SLOT_START_DISTANCE",
1612
+ /**
1613
+ * = Slot Radius
1614
+ */
1615
+ SLOT_RADIUS: "SLOT_RADIUS",
1616
+ /**
1617
+ * = Slot Port - Slot Start
1618
+ */
1619
+ SLOT_PORT_DISTANCE: "SLOT_PORT_DISTANCE",
1620
+ /**
1621
+ * = Slot Label - Slot Start
1622
+ */
1623
+ SLOT_LABEL_DISTANCE: "SLOT_LABEL_DISTANCE",
1624
+ /**
1625
+ * = Slot Block - Slot Port
1626
+ */
1627
+ SLOT_BLOCK_PORT_DISTANCE: "SLOT_BLOCK_PORT_DISTANCE",
1628
+ /**
1629
+ * Vertical Layout: Slot Block - Slot Block
1630
+ */
1631
+ SLOT_BLOCK_VERTICAL_SPACING: "SLOT_BLOCK_VERTICAL_SPACING"
1632
+ };
1633
+ var SLOT_START_DISTANCE = 16;
1634
+ var SLOT_PORT_DISTANCE = 100;
1635
+ var SLOT_LABEL_DISTANCE = 32;
1636
+ var SLOT_BLOCK_PORT_DISTANCE = 32.5;
1637
+ var SLOT_RADIUS = 16;
1638
+ var SLOT_SPACING = 32;
1639
+ var SLOT_BLOCK_VERTICAL_SPACING = 32.5;
1640
+ var SLOT_NODE_LAST_SPACING = 10;
1641
+ var SlotNodeType = ((SlotNodeType2) => {
1642
+ SlotNodeType2[SlotNodeType2["Slot"] = document.FlowNodeBaseType.SLOT] = "Slot";
1643
+ SlotNodeType2[SlotNodeType2["SlotBlock"] = document.FlowNodeBaseType.SLOT_BLOCK] = "SlotBlock";
1644
+ SlotNodeType2["SlotInlineBlocks"] = "slotInlineBlocks";
1645
+ SlotNodeType2["SlotBlockInlineBlocks"] = "slotBlockInlineBlocks";
1646
+ return SlotNodeType2;
1647
+ })(SlotNodeType || {});
1648
+
1649
+ // src/activities/slot/utils/node.ts
1650
+ var canSlotDrilldown = (Slot) => !!Slot?.lastCollapsedChild?.blocks.length;
1651
+ var insideSlot = (entity) => !!entity?.parent?.isTypeOrExtendType(SlotNodeType.SlotBlock);
1652
+ var getDisplayFirstChildTransform = (transform) => {
1653
+ if (transform.firstChild) {
1654
+ return getDisplayFirstChildTransform(transform.firstChild);
1655
+ }
1656
+ return transform;
1657
+ };
1658
+
1659
+ // src/activities/slot/utils/transition.ts
1660
+ var getSlotChildLineStartPoint = (iconTransform) => {
1661
+ if (!iconTransform) {
1662
+ return { x: 0, y: 0 };
1663
+ }
1664
+ const startDistance = document.getDefaultSpacing(
1665
+ iconTransform.entity,
1666
+ SlotSpacingKey.SLOT_START_DISTANCE,
1667
+ SLOT_START_DISTANCE
1668
+ );
1669
+ if (!iconTransform.entity.isVertical) {
1670
+ return {
1671
+ x: iconTransform?.bounds.center.x,
1672
+ y: iconTransform?.bounds.bottom + startDistance
1673
+ };
1674
+ }
1675
+ return {
1676
+ x: iconTransform?.bounds.right + startDistance,
1677
+ y: iconTransform?.bounds.center.y
1678
+ };
1679
+ };
1680
+ var getOutputPoint = (transform) => {
1681
+ const icon = transform.firstChild;
1682
+ if (!icon) {
1683
+ return { x: 0, y: 0 };
1684
+ }
1685
+ if (!transform.entity.isVertical) {
1686
+ return {
1687
+ x: transform.bounds.right,
1688
+ y: icon.outputPoint.y
1689
+ };
1690
+ }
1691
+ return {
1692
+ x: icon.outputPoint.x,
1693
+ y: transform.bounds.bottom
1694
+ };
1695
+ };
1696
+ var getInputPoint = (transform) => {
1697
+ const icon = transform.firstChild;
1698
+ if (!icon) {
1699
+ return { x: 0, y: 0 };
1700
+ }
1701
+ if (!transform.entity.isVertical) {
1702
+ return {
1703
+ x: transform.bounds.left,
1704
+ y: icon.outputPoint.y
1705
+ };
1706
+ }
1707
+ return icon.inputPoint;
1708
+ };
1709
+ var getTransitionToPoint = (transition) => {
1710
+ let toPoint = transition.transform.next?.inputPoint;
1711
+ const icon = transition.transform.firstChild;
1712
+ const parent = transition.transform.parent;
1713
+ if (!icon || !parent) {
1714
+ return { x: 0, y: 0 };
1715
+ }
1716
+ if (!transition.transform.next) {
1717
+ if (!transition.entity.isVertical) {
1718
+ toPoint = {
1719
+ x: parent.outputPoint.x,
1720
+ y: icon.outputPoint.y
1721
+ };
1722
+ } else {
1723
+ toPoint = {
1724
+ x: icon.outputPoint.x,
1725
+ y: parent.outputPoint.y
1726
+ };
1727
+ }
1728
+ }
1729
+ return toPoint || { x: 0, y: 0 };
1730
+ };
1731
+ var drawStraightLine = (transition) => {
1732
+ const icon = transition.transform.firstChild;
1733
+ const toPoint = getTransitionToPoint(transition);
1734
+ if (!icon) {
1735
+ return [];
1736
+ }
1737
+ return [
1738
+ {
1739
+ type: document.FlowTransitionLineEnum.STRAIGHT_LINE,
1740
+ from: icon.outputPoint,
1741
+ to: toPoint
1742
+ },
1743
+ {
1744
+ type: document.FlowTransitionLineEnum.STRAIGHT_LINE,
1745
+ from: icon.inputPoint,
1746
+ to: transition.transform.inputPoint
1747
+ }
1748
+ ];
1749
+ };
1750
+ var drawCollapseLabel = (transition) => {
1751
+ const icon = transition.transform;
1752
+ return [
1753
+ {
1754
+ type: document.FlowTransitionLabelEnum.CUSTOM_LABEL,
1755
+ renderKey: RENDER_SLOT_COLLAPSE_KEY,
1756
+ offset: getSlotChildLineStartPoint(icon),
1757
+ props: {
1758
+ node: transition.entity.parent
1759
+ }
1760
+ }
1761
+ ];
1762
+ };
1763
+ var drawCollapseLine = (transition) => {
1764
+ const startDistance = document.getDefaultSpacing(
1765
+ transition.transform.entity,
1766
+ SlotSpacingKey.SLOT_START_DISTANCE,
1767
+ SLOT_START_DISTANCE
1768
+ );
1769
+ return [
1770
+ {
1771
+ type: document.FlowTransitionLineEnum.STRAIGHT_LINE,
1772
+ from: getSlotChildLineStartPoint(transition.transform),
1773
+ to: utils.Point.move(
1774
+ getSlotChildLineStartPoint(transition.transform),
1775
+ transition.entity.isVertical ? { x: -startDistance, y: 0 } : { x: 0, y: -startDistance }
1776
+ ),
1777
+ style: {
1778
+ strokeDasharray: "5 5"
1779
+ }
1780
+ }
1781
+ ];
1782
+ };
1783
+ var drawStraightAdder = (transition) => {
1784
+ const toPoint = getTransitionToPoint(transition);
1785
+ const fromPoint = transition.transform.firstChild.outputPoint;
1786
+ const hoverProps = transition.entity.isVertical ? {
1787
+ hoverHeight: toPoint.y - fromPoint.y,
1788
+ hoverWidth: transition.transform.firstChild?.bounds.width
1789
+ } : {
1790
+ hoverHeight: transition.transform.firstChild?.bounds.height,
1791
+ hoverWidth: toPoint.x - fromPoint.x
1792
+ };
1793
+ return [
1794
+ {
1795
+ offset: utils.Point.getMiddlePoint(fromPoint, toPoint),
1796
+ type: document.FlowTransitionLabelEnum.ADDER_LABEL,
1797
+ props: hoverProps
1798
+ }
1799
+ ];
1800
+ };
1801
+ var getPortChildInput = (_child) => {
1802
+ if (!_child) {
1803
+ return { x: 0, y: 0 };
1804
+ }
1805
+ const firstChild = getDisplayFirstChildTransform(_child);
1806
+ return { x: _child.bounds.left, y: firstChild.bounds.center.y };
1807
+ };
1808
+ var getDisplayFirstChildTop = (transform) => {
1809
+ if (transform.firstChild) {
1810
+ return transform.localBounds.top + getDisplayFirstChildTop(transform.firstChild);
1811
+ }
1812
+ return transform.localBounds.center.y;
1813
+ };
1814
+ var getPortMiddle = (_port) => {
1815
+ if (!_port.children.length) {
1816
+ return _port.localBounds.top;
1817
+ }
1818
+ const portChildInputs = [_port.firstChild, _port.lastChild].map(
1819
+ (_portChild) => getDisplayFirstChildTop(_portChild)
1820
+ );
1821
+ return _port.localBounds.top + lodashEs.mean(portChildInputs);
1822
+ };
1823
+ var getAllPortsMiddle = (inlineBlocks) => {
1824
+ if (!inlineBlocks.children.length) {
1825
+ return inlineBlocks.localBounds.height / 2;
1826
+ }
1827
+ const portInputs = [inlineBlocks.firstChild, inlineBlocks.lastChild].map(
1828
+ (_port) => getPortMiddle(_port)
1829
+ );
1830
+ return lodashEs.mean(portInputs);
1831
+ };
1832
+ var createSlotFromJSON = (node, json) => {
1833
+ const { document: document$1 } = node;
1834
+ const addedNodes = [];
1835
+ const blockIconNode = document$1.addNode({
1836
+ id: `$slotIcon$${node.id}`,
1837
+ type: document.FlowNodeBaseType.BLOCK_ICON,
1838
+ originParent: node,
1839
+ parent: node
1840
+ });
1841
+ const inlineBlocksNode = document$1.addNode({
1842
+ id: `$slotInlineBlocks$${node.id}`,
1843
+ type: "slotInlineBlocks" /* SlotInlineBlocks */,
1844
+ originParent: node,
1845
+ parent: node
1846
+ });
1847
+ addedNodes.push(blockIconNode);
1848
+ addedNodes.push(inlineBlocksNode);
1849
+ const portJSONList = json.blocks || [];
1850
+ portJSONList.forEach((_portJSON) => {
1851
+ const port = document$1.addNode({
1852
+ type: SlotNodeType.SlotBlock,
1853
+ ..._portJSON,
1854
+ originParent: node,
1855
+ parent: inlineBlocksNode
1856
+ });
1857
+ addedNodes.push(port);
1858
+ (_portJSON.blocks || []).forEach((_portChild) => {
1859
+ document$1.addNode(
1860
+ {
1861
+ type: SlotNodeType.Slot,
1862
+ ..._portChild,
1863
+ parent: port
1864
+ },
1865
+ addedNodes
1866
+ );
1867
+ });
1868
+ });
1869
+ return addedNodes;
1870
+ };
1871
+ var SlotIconRegistry = {
1872
+ type: document.FlowNodeBaseType.BLOCK_ICON,
1873
+ meta: {
1874
+ defaultExpanded: false,
1875
+ spacing: 0
1876
+ },
1877
+ getLines: (transition) => [
1878
+ ...canSlotDrilldown(transition.entity.parent) ? drawCollapseLine(transition) : []
1879
+ ],
1880
+ getLabels: (transition) => [
1881
+ ...canSlotDrilldown(transition.entity.parent) ? drawCollapseLabel(transition) : []
1882
+ ],
1883
+ getDelta: (transform) => {
1884
+ if (insideSlot(transform.entity.parent)) {
1885
+ return transform.entity.isVertical ? { x: -transform.originDeltaX, y: 0 } : { x: 0, y: -transform.originDeltaY };
1886
+ }
1887
+ return { x: 0, y: 0 };
1888
+ }
1889
+ };
1890
+ var SlotInlineBlocksRegistry = {
1891
+ type: "slotInlineBlocks" /* SlotInlineBlocks */,
1892
+ extend: document.FlowNodeBaseType.BLOCK,
1893
+ meta: {
1894
+ spacing: 0,
1895
+ inlineSpacingPre: 0,
1896
+ inlineSpacingAfter: 0,
1897
+ isInlineBlocks: (node) => !node.isVertical
1898
+ },
1899
+ getLines() {
1900
+ return [];
1901
+ },
1902
+ getLabels() {
1903
+ return [];
1904
+ },
1905
+ getChildDelta(child, layout) {
1906
+ if (child.entity.isVertical) {
1907
+ return { x: 0, y: 0 };
1908
+ }
1909
+ const preTransform = child.entity.pre?.getData(document.FlowNodeTransformData);
1910
+ if (preTransform) {
1911
+ const { localBounds: preBounds } = preTransform;
1912
+ return {
1913
+ x: 0,
1914
+ y: preBounds.bottom + 30
1915
+ };
1916
+ }
1917
+ return { x: 0, y: 0 };
1918
+ },
1919
+ /**
1920
+ * 控制条件分支居右布局
1921
+ */
1922
+ getDelta(transform) {
1923
+ if (!transform.children.length) {
1924
+ return { x: 0, y: 0 };
1925
+ }
1926
+ const icon = transform.pre;
1927
+ if (!icon) {
1928
+ return { x: 0, y: 0 };
1929
+ }
1930
+ const startDistance = document.getDefaultSpacing(
1931
+ transform.entity,
1932
+ SlotSpacingKey.SLOT_START_DISTANCE,
1933
+ SLOT_START_DISTANCE
1934
+ );
1935
+ const portDistance = document.getDefaultSpacing(
1936
+ transform.entity,
1937
+ SlotSpacingKey.SLOT_PORT_DISTANCE,
1938
+ SLOT_PORT_DISTANCE
1939
+ );
1940
+ const portBlockDistance = document.getDefaultSpacing(
1941
+ transform.entity,
1942
+ SlotSpacingKey.SLOT_BLOCK_PORT_DISTANCE,
1943
+ SLOT_BLOCK_PORT_DISTANCE
1944
+ );
1945
+ if (!transform.entity.isVertical) {
1946
+ const noChildren = transform?.children?.every?.((_port) => !_port.children.length);
1947
+ if (noChildren) {
1948
+ return {
1949
+ x: portDistance - icon.localBounds.width / 2,
1950
+ y: icon.localBounds.bottom + startDistance
1951
+ };
1952
+ }
1953
+ return {
1954
+ x: portDistance + portBlockDistance - icon.localBounds.width / 2,
1955
+ y: icon.localBounds.bottom + startDistance
1956
+ };
1957
+ }
1958
+ const slotInlineBlockDelta = startDistance + portDistance + portBlockDistance;
1959
+ return {
1960
+ x: icon.localBounds.right + slotInlineBlockDelta,
1961
+ y: -icon.localBounds.height
1962
+ };
1963
+ }
1964
+ };
1965
+ var SlotBlockRegistry = {
1966
+ type: SlotNodeType.SlotBlock,
1967
+ extend: document.FlowNodeBaseType.BLOCK,
1968
+ meta: {
1969
+ inlineSpacingAfter: 0,
1970
+ inlineSpacingPre: 0,
1971
+ spacing: (transform) => {
1972
+ if (!transform.entity.isVertical && transform.size.width === 0) {
1973
+ return 90;
1974
+ }
1975
+ return document.getDefaultSpacing(
1976
+ transform.entity,
1977
+ SlotSpacingKey.SLOT_BLOCK_VERTICAL_SPACING,
1978
+ SLOT_BLOCK_VERTICAL_SPACING
1979
+ );
1980
+ },
1981
+ isInlineBlocks: (node) => !node.isVertical
1982
+ },
1983
+ getLines(transition) {
1984
+ const icon = transition.transform.parent?.pre;
1985
+ const start = getSlotChildLineStartPoint(icon);
1986
+ const portPoint = transition.transform.inputPoint;
1987
+ const radius = document.getDefaultSpacing(
1988
+ transition.transform.entity,
1989
+ SlotSpacingKey.SLOT_RADIUS,
1990
+ SLOT_RADIUS
1991
+ );
1992
+ let startPortVertices = [{ x: start.x, y: portPoint.y }];
1993
+ if (transition.entity.isVertical) {
1994
+ const deltaY = Math.abs(portPoint.y - start.y);
1995
+ let deltaX = radius;
1996
+ let isTruncated = false;
1997
+ if (deltaY < radius * 2) {
1998
+ isTruncated = true;
1999
+ if (deltaY < radius) {
2000
+ deltaX = Math.sqrt(radius ** 2 - (radius - deltaY) ** 2);
2001
+ }
2002
+ }
2003
+ startPortVertices = [
2004
+ {
2005
+ x: start.x + deltaX,
2006
+ y: start.y,
2007
+ radiusX: radius,
2008
+ radiusY: radius,
2009
+ radiusOverflow: "truncate"
2010
+ },
2011
+ {
2012
+ x: start.x + deltaX,
2013
+ y: portPoint.y,
2014
+ ...isTruncated ? { radiusX: 0, radiusY: 0 } : {}
2015
+ }
2016
+ ];
2017
+ }
2018
+ if (transition.transform.children.length === 1) {
2019
+ return [
2020
+ {
2021
+ type: document.FlowTransitionLineEnum.ROUNDED_LINE,
2022
+ from: start,
2023
+ to: getPortChildInput(transition.transform.children[0]),
2024
+ vertices: startPortVertices,
2025
+ style: {
2026
+ strokeDasharray: "5 5"
2027
+ },
2028
+ radius
2029
+ }
2030
+ ];
2031
+ }
2032
+ return [
2033
+ {
2034
+ type: document.FlowTransitionLineEnum.ROUNDED_LINE,
2035
+ from: start,
2036
+ to: portPoint,
2037
+ vertices: startPortVertices,
2038
+ style: {
2039
+ strokeDasharray: "5 5"
2040
+ },
2041
+ radius
2042
+ },
2043
+ ...transition.transform.children.map((_child) => {
2044
+ const childInput = getPortChildInput(_child);
2045
+ return {
2046
+ type: document.FlowTransitionLineEnum.ROUNDED_LINE,
2047
+ radius,
2048
+ from: portPoint,
2049
+ to: childInput,
2050
+ vertices: [{ x: portPoint.x, y: childInput.y }],
2051
+ style: {
2052
+ strokeDasharray: "5 5"
2053
+ }
2054
+ };
2055
+ })
2056
+ ];
2057
+ },
2058
+ getLabels(transition) {
2059
+ const icon = transition.transform.parent?.pre;
2060
+ const start = getSlotChildLineStartPoint(icon);
2061
+ const portPoint = transition.transform.inputPoint;
2062
+ return [
2063
+ {
2064
+ type: document.FlowTransitionLabelEnum.CUSTOM_LABEL,
2065
+ renderKey: RENDER_SLOT_ADDER_KEY,
2066
+ props: {
2067
+ node: transition.entity
2068
+ },
2069
+ offset: portPoint
2070
+ },
2071
+ {
2072
+ type: document.FlowTransitionLabelEnum.CUSTOM_LABEL,
2073
+ renderKey: RENDER_SLOT_LABEL_KEY,
2074
+ props: {
2075
+ node: transition.entity
2076
+ },
2077
+ offset: {
2078
+ x: start.x + document.getDefaultSpacing(
2079
+ transition.entity,
2080
+ SlotSpacingKey.SLOT_LABEL_DISTANCE,
2081
+ SLOT_LABEL_DISTANCE
2082
+ ),
2083
+ y: portPoint.y
2084
+ },
2085
+ origin: [0, 0.5]
2086
+ }
2087
+ ];
2088
+ },
2089
+ getInputPoint(transform) {
2090
+ const icon = transform.parent?.pre;
2091
+ const start = getSlotChildLineStartPoint(icon);
2092
+ let inputY = transform.bounds.center.y;
2093
+ if (transform.children.length) {
2094
+ inputY = lodashEs.mean([
2095
+ getPortChildInput(transform.firstChild).y,
2096
+ getPortChildInput(transform.lastChild).y
2097
+ ]);
2098
+ }
2099
+ return {
2100
+ x: start.x + document.getDefaultSpacing(transform.entity, SlotSpacingKey.SLOT_PORT_DISTANCE, SLOT_PORT_DISTANCE),
2101
+ y: inputY
2102
+ };
2103
+ },
2104
+ getChildDelta(child, layout) {
2105
+ const hasChild = !!child.firstChild;
2106
+ if (child.entity.isVertical) {
2107
+ let deltaX = hasChild ? 0 : -child.originDeltaX;
2108
+ return { x: deltaX, y: 0 };
2109
+ }
2110
+ let deltaY = hasChild ? 0 : -child.originDeltaY;
2111
+ const preTransform = child.entity.pre?.getData(document.FlowNodeTransformData);
2112
+ if (preTransform) {
2113
+ const { localBounds: preBounds } = preTransform;
2114
+ return {
2115
+ x: 0,
2116
+ y: preBounds.bottom + 30 + deltaY
2117
+ };
2118
+ }
2119
+ return { x: 0, y: deltaY };
2120
+ },
2121
+ getChildLabels() {
2122
+ return [];
2123
+ },
2124
+ getChildLines() {
2125
+ return [];
2126
+ },
2127
+ getDelta(transform) {
2128
+ return {
2129
+ x: 0,
2130
+ y: 0
2131
+ };
2132
+ }
2133
+ };
2134
+
2135
+ // src/activities/slot/slot.ts
2136
+ var SlotRegistry = {
2137
+ type: document.FlowNodeBaseType.SLOT,
2138
+ extend: "block",
2139
+ meta: {
2140
+ // Slot 节点内部暂时不允许拖拽
2141
+ draggable: (node) => !insideSlot(node),
2142
+ hidden: true,
2143
+ spacing: (node) => document.getDefaultSpacing(node.entity, SlotSpacingKey.SLOT_SPACING, SLOT_SPACING),
2144
+ padding: (node) => ({
2145
+ left: 0,
2146
+ right: node.collapsed ? document.getDefaultSpacing(node.entity, SlotSpacingKey.SLOT_START_DISTANCE, SLOT_START_DISTANCE) : 0,
2147
+ bottom: !insideSlot(node.entity) && node.isLast ? SLOT_NODE_LAST_SPACING : 0,
2148
+ top: 0
2149
+ }),
2150
+ copyDisable: false,
2151
+ defaultExpanded: false
2152
+ },
2153
+ /**
2154
+ * 业务通常需要重载方法
2155
+ */
2156
+ onCreate: createSlotFromJSON,
2157
+ getLines: (transition) => [
2158
+ ...!insideSlot(transition.entity) ? drawStraightLine(transition) : []
2159
+ ],
2160
+ getLabels: (transition) => [
2161
+ ...!insideSlot(transition.entity) ? drawStraightAdder(transition) : []
2162
+ ],
2163
+ getInputPoint,
2164
+ getOutputPoint,
2165
+ onAfterUpdateLocalTransform(transform) {
2166
+ const { isVertical } = transform.entity;
2167
+ if (!isVertical) {
2168
+ return;
2169
+ }
2170
+ const icon = transform.firstChild;
2171
+ const inlineBlocks = transform.lastChild;
2172
+ if (!icon || !inlineBlocks) {
2173
+ return;
2174
+ }
2175
+ const iconSize = icon.localBounds.height;
2176
+ const inlineBlocksSize = inlineBlocks.localBounds.height;
2177
+ if (transform.collapsed || !inlineBlocks) {
2178
+ return;
2179
+ }
2180
+ const portsMiddle = getAllPortsMiddle(inlineBlocks);
2181
+ icon.entity.clearMemoLocal();
2182
+ inlineBlocks.entity.clearMemoLocal();
2183
+ if (iconSize / 2 + portsMiddle > inlineBlocksSize || !inlineBlocks.children.length) {
2184
+ icon.transform.update({
2185
+ position: { x: icon.transform.position.x, y: 0 }
2186
+ });
2187
+ inlineBlocks.transform.update({
2188
+ position: {
2189
+ x: inlineBlocks.transform.position.x,
2190
+ y: Math.max(iconSize / 2 - inlineBlocksSize / 2, 0)
2191
+ }
2192
+ });
2193
+ return;
2194
+ }
2195
+ inlineBlocks.transform.update({
2196
+ position: { x: inlineBlocks.transform.position.x, y: 0 }
2197
+ });
2198
+ icon?.transform.update({
2199
+ position: {
2200
+ x: icon.transform.position.x,
2201
+ y: Math.max(portsMiddle - iconSize / 2, 0)
2202
+ // 所有 port 的中间点
2203
+ }
2204
+ });
2205
+ },
2206
+ extendChildRegistries: [SlotIconRegistry, SlotInlineBlocksRegistry]
2207
+ };
2208
+
2209
+ // src/flow-registers.ts
2210
+ var FlowRegisters = class {
2211
+ /**
2212
+ * 注册数据层
2213
+ * @param document
2214
+ */
2215
+ registerDocument(document$1) {
2216
+ document$1.registerFlowNodes(
2217
+ RootRegistry,
2218
+ // 根节点
2219
+ StartRegistry,
2220
+ // 开始节点
2221
+ DynamicSplitRegistry,
2222
+ // 动态分支(并行、排他)
2223
+ StaticSplitRegistry,
2224
+ // 静态分支(审批)
2225
+ SimpleSplitRegistry,
2226
+ // 简单分支 (不带 orderIcon 节点)
2227
+ BlockRegistry,
2228
+ // 单条 block 注册
2229
+ InlineBlocksRegistry,
2230
+ // 多个 block 组成的 block 列表
2231
+ BlockIconRegistry,
2232
+ // icon 节点,如条件分支的菱形图标
2233
+ BlockOrderIconRegistry,
2234
+ // 带顺序的图标节点,一般为 block 第一个分支节点
2235
+ TryCatchRegistry,
2236
+ // TryCatch
2237
+ EndRegistry,
2238
+ // 结束节点
2239
+ LoopRegistry,
2240
+ // 循环节点
2241
+ EmptyRegistry,
2242
+ // 占位节点
2243
+ BreakRegistry,
2244
+ // 分支断开
2245
+ MultiOuputsRegistry,
2246
+ MultiInputsRegistry,
2247
+ InputRegistry,
2248
+ OuputRegistry,
2249
+ SlotRegistry,
2250
+ SlotBlockRegistry
2251
+ );
2252
+ document$1.registerNodeDatas(
2253
+ document.FlowNodeRenderData,
2254
+ // 渲染节点相关数据
2255
+ document.FlowNodeTransitionData,
2256
+ // 线条绘制数据
2257
+ document.FlowNodeTransformData
2258
+ // 坐标计算数据
2259
+ );
2260
+ }
2261
+ /**
2262
+ * 注册渲染层
2263
+ * @param renderer
2264
+ */
2265
+ registerRenderer(renderer$1) {
2266
+ renderer$1.registerLayers(
2267
+ renderer.FlowNodesTransformLayer,
2268
+ // 节点位置渲染
2269
+ renderer.FlowNodesContentLayer,
2270
+ // 节点内容渲染
2271
+ renderer.FlowLinesLayer,
2272
+ // 线条渲染
2273
+ renderer.FlowLabelsLayer,
2274
+ // Label 渲染
2275
+ core.PlaygroundLayer
2276
+ // 画布基础层,提供缩放、手势等能力
2277
+ );
2278
+ }
2279
+ /**
2280
+ * 画布开始渲染 (hook)
2281
+ */
2282
+ onReady() {
2283
+ }
2284
+ /**
2285
+ * 画布销毁 (hook)
2286
+ */
2287
+ onDispose() {
2288
+ }
2289
+ };
2290
+ FlowRegisters = __decorateClass([
2291
+ inversify.injectable()
2292
+ ], FlowRegisters);
2293
+
2294
+ // src/fixed-layout-container-module.ts
2295
+ var FixedLayoutContainerModule = new inversify.ContainerModule((bind) => {
2296
+ utils.bindContributions(bind, FlowRegisters, [
2297
+ document.FlowDocumentContribution,
2298
+ renderer.FlowRendererContribution,
2299
+ core.PlaygroundContribution
2300
+ ]);
2301
+ });
2302
+
2303
+ // src/index.ts
2304
+ var FixedLayoutRegistries = {
2305
+ BlockIconRegistry,
2306
+ BlockOrderIconRegistry,
2307
+ BlockRegistry,
2308
+ DynamicSplitRegistry,
2309
+ EmptyRegistry,
2310
+ LoopRegistry,
2311
+ StaticSplitRegistry,
2312
+ TryCatchRegistry,
2313
+ StartRegistry,
2314
+ RootRegistry,
2315
+ InlineBlocksRegistry,
2316
+ EndRegistry,
2317
+ SlotRegistry,
2318
+ SlotBlockRegistry,
2319
+ SlotIconRegistry,
2320
+ SlotInlineBlocksRegistry
2321
+ };
2322
+
2323
+ exports.FixedLayoutContainerModule = FixedLayoutContainerModule;
2324
+ exports.FixedLayoutRegistries = FixedLayoutRegistries;
2325
+ exports.SlotSpacingKey = SlotSpacingKey;
2326
+ //# sourceMappingURL=index.cjs.map
2327
+ //# sourceMappingURL=index.cjs.map