@flowgram.ai/fixed-layout-core 0.2.14 → 0.2.16
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/esm/index.js +31 -30
- package/dist/esm/index.js.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/esm/index.js
CHANGED
|
@@ -320,7 +320,7 @@ var InlineBlocksRegistry = {
|
|
|
320
320
|
const leftSpacing = preTransform.size.width + preTransform.originDeltaX;
|
|
321
321
|
const delta = Math.max(
|
|
322
322
|
child.parent.minInlineBlockSpacing - leftSpacing,
|
|
323
|
-
|
|
323
|
+
getDefaultSpacing2(child.entity, ConstantKeys2.BRANCH_SPACING) - child.originDeltaX
|
|
324
324
|
);
|
|
325
325
|
return {
|
|
326
326
|
// 这里需要加上原点的偏移量,并加上水平间距
|
|
@@ -331,7 +331,7 @@ var InlineBlocksRegistry = {
|
|
|
331
331
|
const bottomSpacing = preTransform.size.height + preTransform.originDeltaY;
|
|
332
332
|
const delta = Math.max(
|
|
333
333
|
child.parent.minInlineBlockSpacing - bottomSpacing,
|
|
334
|
-
|
|
334
|
+
getDefaultSpacing2(child.entity, ConstantKeys2.BRANCH_SPACING) - child.originDeltaY
|
|
335
335
|
);
|
|
336
336
|
return {
|
|
337
337
|
x: 0,
|
|
@@ -721,12 +721,13 @@ var CatchInlineBlocksRegistry = {
|
|
|
721
721
|
// src/activities/try-catch-extends/main-inline-blocks.ts
|
|
722
722
|
import { FlowRendererKey as FlowRendererKey3, FlowTextKey } from "@flowgram.ai/renderer";
|
|
723
723
|
import {
|
|
724
|
-
DEFAULT_SPACING as DEFAULT_SPACING5,
|
|
725
724
|
FlowNodeBaseType as FlowNodeBaseType10,
|
|
726
725
|
FlowNodeTransformData as FlowNodeTransformData2,
|
|
727
726
|
FlowTransitionLabelEnum as FlowTransitionLabelEnum7,
|
|
728
727
|
FlowTransitionLineEnum as FlowTransitionLineEnum4,
|
|
729
|
-
FlowLayoutDefault as FlowLayoutDefault5
|
|
728
|
+
FlowLayoutDefault as FlowLayoutDefault5,
|
|
729
|
+
getDefaultSpacing as getDefaultSpacing5,
|
|
730
|
+
ConstantKeys as ConstantKeys3
|
|
730
731
|
} from "@flowgram.ai/document";
|
|
731
732
|
var MainInlineBlocksRegistry = {
|
|
732
733
|
extend: FlowNodeBaseType10.INLINE_BLOCKS,
|
|
@@ -816,12 +817,12 @@ var MainInlineBlocksRegistry = {
|
|
|
816
817
|
if (isVertical) {
|
|
817
818
|
delta = Math.max(
|
|
818
819
|
child.parent.minInlineBlockSpacing,
|
|
819
|
-
-child.originDeltaX +
|
|
820
|
+
-child.originDeltaX + getDefaultSpacing5(child.entity, ConstantKeys3.BRANCH_SPACING)
|
|
820
821
|
);
|
|
821
822
|
} else {
|
|
822
823
|
delta = Math.max(
|
|
823
824
|
child.parent.minInlineBlockSpacing,
|
|
824
|
-
-child.originDeltaY +
|
|
825
|
+
-child.originDeltaY + getDefaultSpacing5(child.entity, ConstantKeys3.BRANCH_SPACING)
|
|
825
826
|
);
|
|
826
827
|
}
|
|
827
828
|
return {
|
|
@@ -838,13 +839,13 @@ var MainInlineBlocksRegistry = {
|
|
|
838
839
|
};
|
|
839
840
|
|
|
840
841
|
// src/activities/try-catch-extends/try-block.ts
|
|
841
|
-
import { DEFAULT_SPACING as
|
|
842
|
+
import { DEFAULT_SPACING as DEFAULT_SPACING5, FlowNodeBaseType as FlowNodeBaseType11 } from "@flowgram.ai/document";
|
|
842
843
|
var TryBlockRegistry = {
|
|
843
844
|
extend: FlowNodeBaseType11.BLOCK,
|
|
844
845
|
type: "tryBlock" /* TRY_BLOCK */,
|
|
845
846
|
meta: {
|
|
846
847
|
hidden: true,
|
|
847
|
-
spacing:
|
|
848
|
+
spacing: DEFAULT_SPACING5.NULL
|
|
848
849
|
},
|
|
849
850
|
getLines() {
|
|
850
851
|
return [];
|
|
@@ -1049,18 +1050,18 @@ import { FlowTextKey as FlowTextKey3 } from "@flowgram.ai/renderer";
|
|
|
1049
1050
|
import {
|
|
1050
1051
|
FlowNodeBaseType as FlowNodeBaseType14,
|
|
1051
1052
|
FlowTransitionLabelEnum as FlowTransitionLabelEnum11,
|
|
1052
|
-
getDefaultSpacing as
|
|
1053
|
-
ConstantKeys as
|
|
1053
|
+
getDefaultSpacing as getDefaultSpacing7,
|
|
1054
|
+
ConstantKeys as ConstantKeys6
|
|
1054
1055
|
} from "@flowgram.ai/document";
|
|
1055
1056
|
|
|
1056
1057
|
// src/activities/loop-extends/constants.ts
|
|
1057
|
-
import { ConstantKeys as
|
|
1058
|
+
import { ConstantKeys as ConstantKeys4 } from "@flowgram.ai/document";
|
|
1058
1059
|
var LoopSpacings = {
|
|
1059
1060
|
SPACING: 16,
|
|
1060
1061
|
// 距离下面节点距离
|
|
1061
1062
|
COLLAPSE_INLINE_SPACING_BOTTOM: 60,
|
|
1062
1063
|
// 距离下面节点距离
|
|
1063
|
-
[
|
|
1064
|
+
[ConstantKeys4.INLINE_SPACING_BOTTOM]: 48,
|
|
1064
1065
|
// 下边空白
|
|
1065
1066
|
MIN_INLINE_BLOCK_SPACING: 280,
|
|
1066
1067
|
// 最小循环圈宽度
|
|
@@ -1072,7 +1073,7 @@ var LoopSpacings = {
|
|
|
1072
1073
|
// 左边空分支宽度
|
|
1073
1074
|
LOOP_BLOCK_ICON_SPACING: 13,
|
|
1074
1075
|
// inlineBlocks 的 inlineBottom
|
|
1075
|
-
[
|
|
1076
|
+
[ConstantKeys4.INLINE_BLOCKS_INLINE_SPACING_BOTTOM]: 23,
|
|
1076
1077
|
// inlineBlocks 的 inlineBottom
|
|
1077
1078
|
INLINE_BLOCKS_INLINE_SPACING_TOP: 30
|
|
1078
1079
|
// inlineBlocks 的 inlineTop
|
|
@@ -1185,24 +1186,24 @@ import {
|
|
|
1185
1186
|
FlowNodeBaseType as FlowNodeBaseType13,
|
|
1186
1187
|
FlowTransitionLabelEnum as FlowTransitionLabelEnum10,
|
|
1187
1188
|
FlowTransitionLineEnum as FlowTransitionLineEnum5,
|
|
1188
|
-
getDefaultSpacing as
|
|
1189
|
-
ConstantKeys as
|
|
1189
|
+
getDefaultSpacing as getDefaultSpacing6,
|
|
1190
|
+
ConstantKeys as ConstantKeys5
|
|
1190
1191
|
} from "@flowgram.ai/document";
|
|
1191
1192
|
var LoopInlineBlocksNodeRegistry = {
|
|
1192
1193
|
type: FlowNodeBaseType13.INLINE_BLOCKS,
|
|
1193
1194
|
meta: {
|
|
1194
1195
|
inlineSpacingPre: (node) => {
|
|
1195
|
-
const inlineBlocksInlineSpacingTop =
|
|
1196
|
+
const inlineBlocksInlineSpacingTop = getDefaultSpacing6(
|
|
1196
1197
|
node.entity,
|
|
1197
|
-
|
|
1198
|
+
ConstantKeys5.INLINE_BLOCKS_INLINE_SPACING_TOP,
|
|
1198
1199
|
LoopSpacings.INLINE_BLOCKS_INLINE_SPACING_TOP
|
|
1199
1200
|
);
|
|
1200
1201
|
return inlineBlocksInlineSpacingTop;
|
|
1201
1202
|
},
|
|
1202
1203
|
inlineSpacingAfter: (node) => {
|
|
1203
|
-
const inlineBlocksInlineSpacingBottom =
|
|
1204
|
+
const inlineBlocksInlineSpacingBottom = getDefaultSpacing6(
|
|
1204
1205
|
node.entity,
|
|
1205
|
-
|
|
1206
|
+
ConstantKeys5.INLINE_BLOCKS_INLINE_SPACING_BOTTOM,
|
|
1206
1207
|
LoopSpacings.INLINE_BLOCKS_INLINE_SPACING_BOTTOM
|
|
1207
1208
|
);
|
|
1208
1209
|
return inlineBlocksInlineSpacingBottom;
|
|
@@ -1294,9 +1295,9 @@ var LoopRegistry = {
|
|
|
1294
1295
|
if (node.collapsed) {
|
|
1295
1296
|
return LoopSpacings.COLLAPSE_INLINE_SPACING_BOTTOM;
|
|
1296
1297
|
}
|
|
1297
|
-
const inlineSpacingBottom =
|
|
1298
|
+
const inlineSpacingBottom = getDefaultSpacing7(
|
|
1298
1299
|
node.entity,
|
|
1299
|
-
|
|
1300
|
+
ConstantKeys6.INLINE_SPACING_BOTTOM,
|
|
1300
1301
|
LoopSpacings.INLINE_SPACING_BOTTOM
|
|
1301
1302
|
);
|
|
1302
1303
|
return inlineSpacingBottom;
|
|
@@ -1451,11 +1452,11 @@ var LoopRegistry = {
|
|
|
1451
1452
|
};
|
|
1452
1453
|
|
|
1453
1454
|
// src/activities/root.ts
|
|
1454
|
-
import { DEFAULT_SPACING as
|
|
1455
|
+
import { DEFAULT_SPACING as DEFAULT_SPACING6, FlowNodeBaseType as FlowNodeBaseType15 } from "@flowgram.ai/document";
|
|
1455
1456
|
var RootRegistry = {
|
|
1456
1457
|
type: FlowNodeBaseType15.ROOT,
|
|
1457
1458
|
meta: {
|
|
1458
|
-
spacing:
|
|
1459
|
+
spacing: DEFAULT_SPACING6.NULL,
|
|
1459
1460
|
hidden: true
|
|
1460
1461
|
},
|
|
1461
1462
|
getInputPoint(transform) {
|
|
@@ -1470,14 +1471,14 @@ var RootRegistry = {
|
|
|
1470
1471
|
import {
|
|
1471
1472
|
FlowNodeBaseType as FlowNodeBaseType16,
|
|
1472
1473
|
FlowTransitionLabelEnum as FlowTransitionLabelEnum12,
|
|
1473
|
-
ConstantKeys as
|
|
1474
|
-
getDefaultSpacing as
|
|
1474
|
+
ConstantKeys as ConstantKeys7,
|
|
1475
|
+
getDefaultSpacing as getDefaultSpacing8
|
|
1475
1476
|
} from "@flowgram.ai/document";
|
|
1476
1477
|
var EmptyRegistry = {
|
|
1477
1478
|
type: FlowNodeBaseType16.EMPTY,
|
|
1478
1479
|
meta: {
|
|
1479
1480
|
spacing: (node) => {
|
|
1480
|
-
const spacing =
|
|
1481
|
+
const spacing = getDefaultSpacing8(node.entity, ConstantKeys7.NODE_SPACING);
|
|
1481
1482
|
return spacing / 2;
|
|
1482
1483
|
},
|
|
1483
1484
|
size: { width: 0, height: 0 },
|
|
@@ -1703,8 +1704,8 @@ import {
|
|
|
1703
1704
|
FlowNodeRenderData as FlowNodeRenderData3,
|
|
1704
1705
|
FlowTransitionLabelEnum as FlowTransitionLabelEnum14,
|
|
1705
1706
|
FlowNodeSplitType as FlowNodeSplitType5,
|
|
1706
|
-
getDefaultSpacing as
|
|
1707
|
-
ConstantKeys as
|
|
1707
|
+
getDefaultSpacing as getDefaultSpacing9,
|
|
1708
|
+
ConstantKeys as ConstantKeys8
|
|
1708
1709
|
} from "@flowgram.ai/document";
|
|
1709
1710
|
var MultiInputsRegistry = {
|
|
1710
1711
|
type: FlowNodeBaseType22.MULTI_INPUTS,
|
|
@@ -1731,9 +1732,9 @@ var MultiInputsRegistry = {
|
|
|
1731
1732
|
getLabels(transition) {
|
|
1732
1733
|
const isVertical = transition.entity.isVertical;
|
|
1733
1734
|
const currentTransform = transition.transform;
|
|
1734
|
-
const spacing =
|
|
1735
|
+
const spacing = getDefaultSpacing9(
|
|
1735
1736
|
transition.entity,
|
|
1736
|
-
|
|
1737
|
+
ConstantKeys8.INLINE_BLOCKS_PADDING_BOTTOM
|
|
1737
1738
|
);
|
|
1738
1739
|
if (currentTransform.collapsed || transition.entity.childrenLength === 0) {
|
|
1739
1740
|
return [
|