@flowgram.ai/renderer 0.1.26 → 0.1.28
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 +131 -65
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +192 -126
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -1069,34 +1069,48 @@ var import_lodash4 = require("lodash");
|
|
|
1069
1069
|
var import_inversify5 = require("inversify");
|
|
1070
1070
|
var import_utils12 = require("@flowgram.ai/utils");
|
|
1071
1071
|
var import_document9 = require("@flowgram.ai/document");
|
|
1072
|
-
var
|
|
1072
|
+
var import_core9 = require("@flowgram.ai/core");
|
|
1073
1073
|
|
|
1074
|
-
// src/components/
|
|
1074
|
+
// src/components/LinesRenderer.tsx
|
|
1075
|
+
var import_react7 = __toESM(require("react"));
|
|
1076
|
+
var import_utils11 = require("@flowgram.ai/utils");
|
|
1077
|
+
var import_document7 = require("@flowgram.ai/document");
|
|
1078
|
+
var import_document8 = require("@flowgram.ai/document");
|
|
1079
|
+
|
|
1080
|
+
// src/components/StraightLine.tsx
|
|
1075
1081
|
var import_react2 = __toESM(require("react"));
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
return /* @__PURE__ */ import_react2.default.createElement("marker", { id: MARK_ARROW_ID, markerWidth: "11", markerHeight: "14", refX: "10", refY: "7", orient: "auto" }, /* @__PURE__ */ import_react2.default.createElement(
|
|
1082
|
+
function StraightLine(props) {
|
|
1083
|
+
const { from, to, activated, style } = props;
|
|
1084
|
+
const { baseColor, baseActivatedColor } = useBaseColor();
|
|
1085
|
+
return /* @__PURE__ */ import_react2.default.createElement(
|
|
1081
1086
|
"path",
|
|
1082
1087
|
{
|
|
1083
|
-
|
|
1084
|
-
|
|
1088
|
+
"data-line-id": props.lineId,
|
|
1089
|
+
d: `M ${from.x} ${from.y} L ${to.x} ${to.y}`,
|
|
1090
|
+
...DEFAULT_LINE_ATTRS,
|
|
1091
|
+
stroke: activated ? baseActivatedColor : baseColor,
|
|
1092
|
+
style
|
|
1085
1093
|
}
|
|
1086
|
-
)
|
|
1094
|
+
);
|
|
1087
1095
|
}
|
|
1088
|
-
var
|
|
1096
|
+
var StraightLine_default = StraightLine;
|
|
1089
1097
|
|
|
1090
|
-
// src/components/
|
|
1098
|
+
// src/components/RoundedTurningLine.tsx
|
|
1099
|
+
var import_react5 = __toESM(require("react"));
|
|
1100
|
+
var import_lodash3 = require("lodash");
|
|
1101
|
+
var import_utils9 = require("@flowgram.ai/utils");
|
|
1102
|
+
var import_core8 = require("@flowgram.ai/core");
|
|
1103
|
+
|
|
1104
|
+
// src/components/MarkerArrow.tsx
|
|
1091
1105
|
var import_react3 = __toESM(require("react"));
|
|
1092
|
-
var
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
const { baseActivatedColor } = useBaseColor();
|
|
1106
|
+
var MARK_ARROW_ID = "$marker_arrow$";
|
|
1107
|
+
function MarkerArrow(props) {
|
|
1108
|
+
const { baseColor } = useBaseColor();
|
|
1096
1109
|
return /* @__PURE__ */ import_react3.default.createElement(
|
|
1097
1110
|
"marker",
|
|
1098
1111
|
{
|
|
1099
|
-
id:
|
|
1112
|
+
"data-line-id": props.id,
|
|
1113
|
+
id: props.id || MARK_ARROW_ID,
|
|
1100
1114
|
markerWidth: "11",
|
|
1101
1115
|
markerHeight: "14",
|
|
1102
1116
|
refX: "10",
|
|
@@ -1107,40 +1121,54 @@ function MarkerActivatedArrow() {
|
|
|
1107
1121
|
"path",
|
|
1108
1122
|
{
|
|
1109
1123
|
d: "M9.6 5.2C10.8 6.1 10.8 7.9 9.6 8.8L3.6 13.3C2.11672 14.4125 0 13.3541 0 11.5L0 2.5C0 0.645898 2.11672 -0.412461 3.6 0.7L9.6 5.2Z",
|
|
1110
|
-
fill:
|
|
1124
|
+
fill: baseColor
|
|
1111
1125
|
}
|
|
1112
1126
|
)
|
|
1113
1127
|
);
|
|
1114
1128
|
}
|
|
1115
|
-
var
|
|
1116
|
-
|
|
1117
|
-
// src/components/LinesRenderer.tsx
|
|
1118
|
-
var import_react7 = __toESM(require("react"));
|
|
1119
|
-
var import_utils11 = require("@flowgram.ai/utils");
|
|
1120
|
-
var import_document7 = require("@flowgram.ai/document");
|
|
1121
|
-
var import_document8 = require("@flowgram.ai/document");
|
|
1129
|
+
var MarkerArrow_default = MarkerArrow;
|
|
1122
1130
|
|
|
1123
|
-
// src/components/
|
|
1131
|
+
// src/components/MarkerActivatedArrow.tsx
|
|
1124
1132
|
var import_react4 = __toESM(require("react"));
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
const {
|
|
1133
|
+
var MARK_ACTIVATED_ARROW_ID = "$marker_arrow_activated$";
|
|
1134
|
+
function MarkerActivatedArrow(props) {
|
|
1135
|
+
const { baseActivatedColor } = useBaseColor();
|
|
1128
1136
|
return /* @__PURE__ */ import_react4.default.createElement(
|
|
1129
|
-
"
|
|
1137
|
+
"marker",
|
|
1130
1138
|
{
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1139
|
+
"data-line-id": props.id,
|
|
1140
|
+
id: props.id || MARK_ACTIVATED_ARROW_ID,
|
|
1141
|
+
markerWidth: "11",
|
|
1142
|
+
markerHeight: "14",
|
|
1143
|
+
refX: "10",
|
|
1144
|
+
refY: "7",
|
|
1145
|
+
orient: "auto"
|
|
1146
|
+
},
|
|
1147
|
+
/* @__PURE__ */ import_react4.default.createElement(
|
|
1148
|
+
"path",
|
|
1149
|
+
{
|
|
1150
|
+
d: "M9.6 5.2C10.8 6.1 10.8 7.9 9.6 8.8L3.6 13.3C2.11672 14.4125 0 13.3541 0 11.5L0 2.5C0 0.645898 2.11672 -0.412461 3.6 0.7L9.6 5.2Z",
|
|
1151
|
+
fill: baseActivatedColor
|
|
1152
|
+
}
|
|
1153
|
+
)
|
|
1136
1154
|
);
|
|
1137
1155
|
}
|
|
1138
|
-
var
|
|
1156
|
+
var MarkerActivatedArrow_default = MarkerActivatedArrow;
|
|
1139
1157
|
|
|
1140
1158
|
// src/components/RoundedTurningLine.tsx
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1159
|
+
function MarkerDefs(props) {
|
|
1160
|
+
const renderRegistry = (0, import_core8.useService)(FlowRendererRegistry);
|
|
1161
|
+
const ArrowRenderer = renderRegistry?.tryToGetRendererComponent(
|
|
1162
|
+
props.activated ? "marker-active-arrow" /* MARKER_ACTIVATE_ARROW */ : "marker-arrow" /* MARKER_ARROW */
|
|
1163
|
+
);
|
|
1164
|
+
if (ArrowRenderer) {
|
|
1165
|
+
return /* @__PURE__ */ import_react5.default.createElement(ArrowRenderer.renderer, { ...props });
|
|
1166
|
+
}
|
|
1167
|
+
if (props.activated) {
|
|
1168
|
+
return /* @__PURE__ */ import_react5.default.createElement("defs", null, /* @__PURE__ */ import_react5.default.createElement(MarkerActivatedArrow_default, { id: props.id }));
|
|
1169
|
+
}
|
|
1170
|
+
return /* @__PURE__ */ import_react5.default.createElement("defs", null, /* @__PURE__ */ import_react5.default.createElement(MarkerArrow_default, { id: props.id }));
|
|
1171
|
+
}
|
|
1144
1172
|
function RoundedTurningLine(props) {
|
|
1145
1173
|
const { vertices, radius = DEFAULT_RADIUS, hide, xRadius, yRadius, ...line } = props;
|
|
1146
1174
|
const { from, to, arrow, activated, style } = line || {};
|
|
@@ -1190,18 +1218,20 @@ function RoundedTurningLine(props) {
|
|
|
1190
1218
|
return null;
|
|
1191
1219
|
}
|
|
1192
1220
|
const pathStr = `M ${from.x} ${from.y} ${middleStr} L ${to.x} ${to.y}`;
|
|
1193
|
-
|
|
1221
|
+
const markerId = activated ? `${MARK_ACTIVATED_ARROW_ID}${props.lineId}` : `${MARK_ARROW_ID}${props.lineId}`;
|
|
1222
|
+
return /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, arrow ? /* @__PURE__ */ import_react5.default.createElement(MarkerDefs, { id: markerId, activated }) : null, /* @__PURE__ */ import_react5.default.createElement(
|
|
1194
1223
|
"path",
|
|
1195
1224
|
{
|
|
1225
|
+
"data-line-id": props.lineId,
|
|
1196
1226
|
d: pathStr,
|
|
1197
1227
|
...DEFAULT_LINE_ATTRS,
|
|
1198
1228
|
stroke: activated ? baseActivatedColor : baseColor,
|
|
1199
1229
|
...arrow ? {
|
|
1200
|
-
markerEnd:
|
|
1230
|
+
markerEnd: `url(#${markerId})`
|
|
1201
1231
|
} : {},
|
|
1202
1232
|
style
|
|
1203
1233
|
}
|
|
1204
|
-
);
|
|
1234
|
+
));
|
|
1205
1235
|
}
|
|
1206
1236
|
var RoundedTurningLine_default = RoundedTurningLine;
|
|
1207
1237
|
|
|
@@ -1217,7 +1247,7 @@ function CustomLine(props) {
|
|
|
1217
1247
|
return /* @__PURE__ */ import_react6.default.createElement(import_react6.default.Fragment, null);
|
|
1218
1248
|
}
|
|
1219
1249
|
const Component = renderer.renderer;
|
|
1220
|
-
return /* @__PURE__ */ import_react6.default.createElement(Component, { ...line });
|
|
1250
|
+
return /* @__PURE__ */ import_react6.default.createElement(Component, { lineId: props.lineId, ...line });
|
|
1221
1251
|
}
|
|
1222
1252
|
var CustomLine_default = CustomLine;
|
|
1223
1253
|
|
|
@@ -1235,7 +1265,15 @@ function createLines(props) {
|
|
|
1235
1265
|
const draggingLineActivated = line.type === import_document7.FlowTransitionLineEnum.DRAGGING_LINE && data.entity?.id === dragService.dropNodeId && line.side === dragService.labelSide;
|
|
1236
1266
|
switch (line.type) {
|
|
1237
1267
|
case import_document7.FlowTransitionLineEnum.STRAIGHT_LINE:
|
|
1238
|
-
return /* @__PURE__ */ import_react7.default.createElement(
|
|
1268
|
+
return /* @__PURE__ */ import_react7.default.createElement(
|
|
1269
|
+
StraightLine_default,
|
|
1270
|
+
{
|
|
1271
|
+
key: `${data.entity.id}_${index}`,
|
|
1272
|
+
lineId: data.entity.id,
|
|
1273
|
+
activated: lineActivated,
|
|
1274
|
+
...line
|
|
1275
|
+
}
|
|
1276
|
+
);
|
|
1239
1277
|
case import_document7.FlowTransitionLineEnum.DIVERGE_LINE:
|
|
1240
1278
|
case import_document7.FlowTransitionLineEnum.DRAGGING_LINE:
|
|
1241
1279
|
case import_document7.FlowTransitionLineEnum.MERGE_LINE:
|
|
@@ -1243,7 +1281,8 @@ function createLines(props) {
|
|
|
1243
1281
|
return /* @__PURE__ */ import_react7.default.createElement(
|
|
1244
1282
|
RoundedTurningLine_default,
|
|
1245
1283
|
{
|
|
1246
|
-
key: `${data.entity.id}${index}`,
|
|
1284
|
+
key: `${data.entity.id}_${index}`,
|
|
1285
|
+
lineId: data.entity.id,
|
|
1247
1286
|
isHorizontal: !isVertical,
|
|
1248
1287
|
activated: lineActivated || draggingLineActivated,
|
|
1249
1288
|
...line,
|
|
@@ -1256,7 +1295,8 @@ function createLines(props) {
|
|
|
1256
1295
|
return /* @__PURE__ */ import_react7.default.createElement(
|
|
1257
1296
|
CustomLine_default,
|
|
1258
1297
|
{
|
|
1259
|
-
key: `${data.entity.id}${index}`,
|
|
1298
|
+
key: `${data.entity.id}_${index}`,
|
|
1299
|
+
lineId: data.entity.id,
|
|
1260
1300
|
...line,
|
|
1261
1301
|
rendererRegistry
|
|
1262
1302
|
}
|
|
@@ -1276,7 +1316,7 @@ function createLines(props) {
|
|
|
1276
1316
|
}
|
|
1277
1317
|
|
|
1278
1318
|
// src/layers/flow-lines-layer.tsx
|
|
1279
|
-
var FlowLinesLayer = class extends
|
|
1319
|
+
var FlowLinesLayer = class extends import_core9.Layer {
|
|
1280
1320
|
constructor() {
|
|
1281
1321
|
super(...arguments);
|
|
1282
1322
|
this.node = import_utils12.domUtils.createDivWithClass("gedit-flow-lines-layer");
|
|
@@ -1320,14 +1360,6 @@ var FlowLinesLayer = class extends import_core8.Layer {
|
|
|
1320
1360
|
(line) => line.props.activated ? "activateLines" : "normalLines"
|
|
1321
1361
|
);
|
|
1322
1362
|
const resultLines = [...normalLines, ...activateLines];
|
|
1323
|
-
const arrowRenderer = this.rendererRegistry.tryToGetRendererComponent(
|
|
1324
|
-
"marker-arrow" /* MARKER_ARROW */
|
|
1325
|
-
);
|
|
1326
|
-
const activateArrowRenderer = this.rendererRegistry.tryToGetRendererComponent(
|
|
1327
|
-
"marker-active-arrow" /* MARKER_ACTIVATE_ARROW */
|
|
1328
|
-
);
|
|
1329
|
-
const arrow = arrowRenderer ? import_react8.default.createElement(arrowRenderer.renderer) : null;
|
|
1330
|
-
const activateArrow = activateArrowRenderer ? import_react8.default.createElement(activateArrowRenderer.renderer) : null;
|
|
1331
1363
|
return /* @__PURE__ */ import_react8.default.createElement(
|
|
1332
1364
|
"svg",
|
|
1333
1365
|
{
|
|
@@ -1338,7 +1370,6 @@ var FlowLinesLayer = class extends import_core8.Layer {
|
|
|
1338
1370
|
viewBox: this.viewBox,
|
|
1339
1371
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1340
1372
|
},
|
|
1341
|
-
/* @__PURE__ */ import_react8.default.createElement("defs", null, arrowRenderer ? arrow : /* @__PURE__ */ import_react8.default.createElement(MarkerArrow_default, null), activateArrow ? activateArrow : /* @__PURE__ */ import_react8.default.createElement(MarkerActivatedArrow_default, null)),
|
|
1342
1373
|
resultLines
|
|
1343
1374
|
);
|
|
1344
1375
|
}
|
|
@@ -1353,13 +1384,13 @@ __decorateClass([
|
|
|
1353
1384
|
(0, import_inversify5.inject)(FlowRendererRegistry)
|
|
1354
1385
|
], FlowLinesLayer.prototype, "rendererRegistry", 2);
|
|
1355
1386
|
__decorateClass([
|
|
1356
|
-
(0,
|
|
1387
|
+
(0, import_core9.observeEntity)(import_document9.FlowDocumentTransformerEntity)
|
|
1357
1388
|
], FlowLinesLayer.prototype, "documentTransformer", 2);
|
|
1358
1389
|
__decorateClass([
|
|
1359
|
-
(0,
|
|
1390
|
+
(0, import_core9.observeEntity)(import_document9.FlowRendererStateEntity)
|
|
1360
1391
|
], FlowLinesLayer.prototype, "flowRenderState", 2);
|
|
1361
1392
|
__decorateClass([
|
|
1362
|
-
(0,
|
|
1393
|
+
(0, import_core9.observeEntityDatas)(import_document9.FlowNodeEntity, import_document9.FlowNodeTransitionData)
|
|
1363
1394
|
], FlowLinesLayer.prototype, "_transitions", 2);
|
|
1364
1395
|
FlowLinesLayer = __decorateClass([
|
|
1365
1396
|
(0, import_inversify5.injectable)()
|
|
@@ -1371,7 +1402,7 @@ var import_lodash5 = require("lodash");
|
|
|
1371
1402
|
var import_inversify6 = require("inversify");
|
|
1372
1403
|
var import_utils16 = require("@flowgram.ai/utils");
|
|
1373
1404
|
var import_document15 = require("@flowgram.ai/document");
|
|
1374
|
-
var
|
|
1405
|
+
var import_core12 = require("@flowgram.ai/core");
|
|
1375
1406
|
|
|
1376
1407
|
// src/components/LabelsRenderer.tsx
|
|
1377
1408
|
var import_react13 = __toESM(require("react"));
|
|
@@ -1440,7 +1471,7 @@ function Collapse(props) {
|
|
|
1440
1471
|
// src/components/Adder.tsx
|
|
1441
1472
|
var import_react10 = __toESM(require("react"));
|
|
1442
1473
|
var import_document11 = require("@flowgram.ai/document");
|
|
1443
|
-
var
|
|
1474
|
+
var import_core10 = require("@flowgram.ai/core");
|
|
1444
1475
|
var getFlowRenderKey = (node, { dragService }) => {
|
|
1445
1476
|
if (dragService && dragService.dragging && dragService.isDroppableNode(node)) {
|
|
1446
1477
|
if (dragService.dropNodeId === node.id) {
|
|
@@ -1462,7 +1493,7 @@ function Adder(props) {
|
|
|
1462
1493
|
const handleMouseEnter = (0, import_react10.useCallback)(() => setHoverActivated(true), []);
|
|
1463
1494
|
const handleMouseLeave = (0, import_react10.useCallback)(() => setHoverActivated(false), []);
|
|
1464
1495
|
const node = data.entity;
|
|
1465
|
-
const dragService = (0,
|
|
1496
|
+
const dragService = (0, import_core10.useService)(import_document11.FlowDragService);
|
|
1466
1497
|
const flowRenderKey = getFlowRenderKey(node, { dragService });
|
|
1467
1498
|
const adder = rendererRegistry.getRendererComponent(flowRenderKey);
|
|
1468
1499
|
const from = node;
|
|
@@ -1570,7 +1601,7 @@ function CollapseAdder(props) {
|
|
|
1570
1601
|
// src/components/BranchDraggableRenderer.tsx
|
|
1571
1602
|
var import_react12 = __toESM(require("react"));
|
|
1572
1603
|
var import_document13 = require("@flowgram.ai/document");
|
|
1573
|
-
var
|
|
1604
|
+
var import_core11 = require("@flowgram.ai/core");
|
|
1574
1605
|
var getFlowRenderKey2 = (node, { dragService, side }) => {
|
|
1575
1606
|
if (dragService.isDragBranch && side && dragService.labelSide === side && dragService.isDroppableBranch(node, side)) {
|
|
1576
1607
|
if (dragService.dropNodeId === node.id) {
|
|
@@ -1583,7 +1614,7 @@ var getFlowRenderKey2 = (node, { dragService, side }) => {
|
|
|
1583
1614
|
function BranchDraggableRenderer(props) {
|
|
1584
1615
|
const { data, rendererRegistry, side, ...restProps } = props;
|
|
1585
1616
|
const node = data.entity;
|
|
1586
|
-
const dragService = (0,
|
|
1617
|
+
const dragService = (0, import_core11.useService)(import_document13.FlowDragService);
|
|
1587
1618
|
const flowRenderKey = getFlowRenderKey2(node, { side, dragService });
|
|
1588
1619
|
if (!flowRenderKey) {
|
|
1589
1620
|
return null;
|
|
@@ -1635,16 +1666,48 @@ function createLabels(labelProps) {
|
|
|
1635
1666
|
let child = null;
|
|
1636
1667
|
switch (type) {
|
|
1637
1668
|
case import_document14.FlowTransitionLabelEnum.BRANCH_DRAGGING_LABEL:
|
|
1638
|
-
child = /* @__PURE__ */ import_react13.default.createElement(
|
|
1669
|
+
child = /* @__PURE__ */ import_react13.default.createElement(
|
|
1670
|
+
BranchDraggableRenderer,
|
|
1671
|
+
{
|
|
1672
|
+
labelId: label.labelId || labelProps.data.entity.id,
|
|
1673
|
+
rendererRegistry,
|
|
1674
|
+
data,
|
|
1675
|
+
...props
|
|
1676
|
+
}
|
|
1677
|
+
);
|
|
1639
1678
|
break;
|
|
1640
1679
|
case import_document14.FlowTransitionLabelEnum.ADDER_LABEL:
|
|
1641
|
-
child = /* @__PURE__ */ import_react13.default.createElement(
|
|
1680
|
+
child = /* @__PURE__ */ import_react13.default.createElement(
|
|
1681
|
+
Adder,
|
|
1682
|
+
{
|
|
1683
|
+
labelId: label.labelId || labelProps.data.entity.id,
|
|
1684
|
+
rendererRegistry,
|
|
1685
|
+
data,
|
|
1686
|
+
...props
|
|
1687
|
+
}
|
|
1688
|
+
);
|
|
1642
1689
|
break;
|
|
1643
1690
|
case import_document14.FlowTransitionLabelEnum.COLLAPSE_LABEL:
|
|
1644
|
-
child = /* @__PURE__ */ import_react13.default.createElement(
|
|
1691
|
+
child = /* @__PURE__ */ import_react13.default.createElement(
|
|
1692
|
+
Collapse,
|
|
1693
|
+
{
|
|
1694
|
+
labelId: label.labelId || labelProps.data.entity.id,
|
|
1695
|
+
rendererRegistry,
|
|
1696
|
+
data,
|
|
1697
|
+
...props
|
|
1698
|
+
}
|
|
1699
|
+
);
|
|
1645
1700
|
break;
|
|
1646
1701
|
case import_document14.FlowTransitionLabelEnum.COLLAPSE_ADDER_LABEL:
|
|
1647
|
-
child = /* @__PURE__ */ import_react13.default.createElement(
|
|
1702
|
+
child = /* @__PURE__ */ import_react13.default.createElement(
|
|
1703
|
+
CollapseAdder,
|
|
1704
|
+
{
|
|
1705
|
+
labelId: label.labelId || labelProps.data.entity.id,
|
|
1706
|
+
rendererRegistry,
|
|
1707
|
+
data,
|
|
1708
|
+
...props
|
|
1709
|
+
}
|
|
1710
|
+
);
|
|
1648
1711
|
break;
|
|
1649
1712
|
case import_document14.FlowTransitionLabelEnum.TEXT_LABEL:
|
|
1650
1713
|
if (!renderKey) {
|
|
@@ -1654,6 +1717,7 @@ function createLabels(labelProps) {
|
|
|
1654
1717
|
child = /* @__PURE__ */ import_react13.default.createElement(
|
|
1655
1718
|
"div",
|
|
1656
1719
|
{
|
|
1720
|
+
"data-label-id": label.labelId || labelProps.data.entity.id,
|
|
1657
1721
|
style: {
|
|
1658
1722
|
...TEXT_LABEL_STYLE,
|
|
1659
1723
|
...props?.style,
|
|
@@ -1674,6 +1738,7 @@ function createLabels(labelProps) {
|
|
|
1674
1738
|
renderer.renderer,
|
|
1675
1739
|
{
|
|
1676
1740
|
node: data.entity,
|
|
1741
|
+
labelId: label.labelId || labelProps.data.entity.id,
|
|
1677
1742
|
...props
|
|
1678
1743
|
}
|
|
1679
1744
|
);
|
|
@@ -1689,6 +1754,7 @@ function createLabels(labelProps) {
|
|
|
1689
1754
|
"div",
|
|
1690
1755
|
{
|
|
1691
1756
|
key: `${data.entity.id}${index}`,
|
|
1757
|
+
"data-label-id": label.labelId || labelProps.data.entity.id,
|
|
1692
1758
|
style: {
|
|
1693
1759
|
position: "absolute",
|
|
1694
1760
|
left: offsetX,
|
|
@@ -1707,7 +1773,7 @@ function createLabels(labelProps) {
|
|
|
1707
1773
|
}
|
|
1708
1774
|
|
|
1709
1775
|
// src/layers/flow-labels-layer.tsx
|
|
1710
|
-
var FlowLabelsLayer = class extends
|
|
1776
|
+
var FlowLabelsLayer = class extends import_core12.Layer {
|
|
1711
1777
|
constructor() {
|
|
1712
1778
|
super(...arguments);
|
|
1713
1779
|
this.node = import_utils16.domUtils.createDivWithClass("gedit-flow-labels-layer");
|
|
@@ -1762,13 +1828,13 @@ __decorateClass([
|
|
|
1762
1828
|
(0, import_inversify6.inject)(FlowRendererRegistry)
|
|
1763
1829
|
], FlowLabelsLayer.prototype, "rendererRegistry", 2);
|
|
1764
1830
|
__decorateClass([
|
|
1765
|
-
(0,
|
|
1831
|
+
(0, import_core12.observeEntity)(import_document15.FlowDocumentTransformerEntity)
|
|
1766
1832
|
], FlowLabelsLayer.prototype, "documentTransformer", 2);
|
|
1767
1833
|
__decorateClass([
|
|
1768
|
-
(0,
|
|
1834
|
+
(0, import_core12.observeEntity)(import_document15.FlowRendererStateEntity)
|
|
1769
1835
|
], FlowLabelsLayer.prototype, "flowRenderState", 2);
|
|
1770
1836
|
__decorateClass([
|
|
1771
|
-
(0,
|
|
1837
|
+
(0, import_core12.observeEntityDatas)(import_document15.FlowNodeEntity, import_document15.FlowNodeTransitionData)
|
|
1772
1838
|
], FlowLabelsLayer.prototype, "_transitions", 2);
|
|
1773
1839
|
FlowLabelsLayer = __decorateClass([
|
|
1774
1840
|
(0, import_inversify6.injectable)()
|
|
@@ -1778,7 +1844,7 @@ FlowLabelsLayer = __decorateClass([
|
|
|
1778
1844
|
var import_inversify7 = require("inversify");
|
|
1779
1845
|
var import_utils18 = require("@flowgram.ai/utils");
|
|
1780
1846
|
var import_document16 = require("@flowgram.ai/document");
|
|
1781
|
-
var
|
|
1847
|
+
var import_core13 = require("@flowgram.ai/core");
|
|
1782
1848
|
|
|
1783
1849
|
// src/utils/scroll-limit.ts
|
|
1784
1850
|
var import_utils17 = require("@flowgram.ai/utils");
|
|
@@ -1824,7 +1890,7 @@ function randomColor(percent) {
|
|
|
1824
1890
|
const random = () => Math.floor(Math.random() * max);
|
|
1825
1891
|
return `rgb(${rgb === 0 ? random() : 0}, ${rgb === 1 ? random() : 0}, ${rgb === 2 ? random() : 0})`;
|
|
1826
1892
|
}
|
|
1827
|
-
var FlowDebugLayer = class extends
|
|
1893
|
+
var FlowDebugLayer = class extends import_core13.Layer {
|
|
1828
1894
|
constructor() {
|
|
1829
1895
|
super(...arguments);
|
|
1830
1896
|
this.node = document.createElement("div");
|
|
@@ -1987,10 +2053,10 @@ __decorateClass([
|
|
|
1987
2053
|
(0, import_inversify7.inject)(import_document16.FlowDocument)
|
|
1988
2054
|
], FlowDebugLayer.prototype, "document", 2);
|
|
1989
2055
|
__decorateClass([
|
|
1990
|
-
(0,
|
|
2056
|
+
(0, import_core13.observeEntity)(import_document16.FlowDocumentTransformerEntity)
|
|
1991
2057
|
], FlowDebugLayer.prototype, "documentTransformer", 2);
|
|
1992
2058
|
__decorateClass([
|
|
1993
|
-
(0,
|
|
2059
|
+
(0, import_core13.observeEntityDatas)(import_document16.FlowNodeEntity, import_document16.FlowNodeTransformData)
|
|
1994
2060
|
], FlowDebugLayer.prototype, "_transforms", 2);
|
|
1995
2061
|
FlowDebugLayer = __decorateClass([
|
|
1996
2062
|
(0, import_inversify7.injectable)()
|
|
@@ -1999,12 +2065,12 @@ FlowDebugLayer = __decorateClass([
|
|
|
1999
2065
|
// src/layers/flow-scroll-bar-layer.tsx
|
|
2000
2066
|
var import_inversify8 = require("inversify");
|
|
2001
2067
|
var import_document17 = require("@flowgram.ai/document");
|
|
2002
|
-
var
|
|
2068
|
+
var import_core14 = require("@flowgram.ai/core");
|
|
2003
2069
|
var import_utils20 = require("@flowgram.ai/utils");
|
|
2004
2070
|
var BORDER_WIDTH = 2;
|
|
2005
2071
|
var BLOCK_OFFSET = 11;
|
|
2006
2072
|
var SCROLL_BAR_WIDTH = "7px";
|
|
2007
|
-
var FlowScrollBarLayer = class extends
|
|
2073
|
+
var FlowScrollBarLayer = class extends import_core14.Layer {
|
|
2008
2074
|
constructor() {
|
|
2009
2075
|
super(...arguments);
|
|
2010
2076
|
// @observeEntity(FlowDocumentTransformerEntity) readonly documentTransformer: FlowDocumentTransformerEntity
|
|
@@ -2024,7 +2090,7 @@ var FlowScrollBarLayer = class extends import_core13.Layer {
|
|
|
2024
2090
|
this.initialScrollX = 0;
|
|
2025
2091
|
// 初始 y 轴滚动距离
|
|
2026
2092
|
this.initialScrollY = 0;
|
|
2027
|
-
this.bottomGrabDragger = new
|
|
2093
|
+
this.bottomGrabDragger = new import_core14.PlaygroundDrag({
|
|
2028
2094
|
onDragStart: (e) => {
|
|
2029
2095
|
this.config.updateCursor("grabbing");
|
|
2030
2096
|
this.sum = 0;
|
|
@@ -2044,7 +2110,7 @@ var FlowScrollBarLayer = class extends import_core13.Layer {
|
|
|
2044
2110
|
this.config.updateCursor("default");
|
|
2045
2111
|
}
|
|
2046
2112
|
});
|
|
2047
|
-
this.rightGrabDragger = new
|
|
2113
|
+
this.rightGrabDragger = new import_core14.PlaygroundDrag({
|
|
2048
2114
|
onDragStart: (e) => {
|
|
2049
2115
|
this.config.updateCursor("grabbing");
|
|
2050
2116
|
this.sum = 0;
|
|
@@ -2239,7 +2305,7 @@ __decorateClass([
|
|
|
2239
2305
|
(0, import_inversify8.optional)()
|
|
2240
2306
|
], FlowScrollBarLayer.prototype, "flowDocument", 2);
|
|
2241
2307
|
__decorateClass([
|
|
2242
|
-
(0,
|
|
2308
|
+
(0, import_core14.observeEntity)(import_core14.PlaygroundConfigEntity)
|
|
2243
2309
|
], FlowScrollBarLayer.prototype, "playgroundConfigEntity", 2);
|
|
2244
2310
|
FlowScrollBarLayer = __decorateClass([
|
|
2245
2311
|
(0, import_inversify8.injectable)()
|
|
@@ -2250,12 +2316,12 @@ var import_react15 = __toESM(require("react"));
|
|
|
2250
2316
|
var import_inversify9 = require("inversify");
|
|
2251
2317
|
var import_utils22 = require("@flowgram.ai/utils");
|
|
2252
2318
|
var import_document18 = require("@flowgram.ai/document");
|
|
2253
|
-
var import_core14 = require("@flowgram.ai/core");
|
|
2254
2319
|
var import_core15 = require("@flowgram.ai/core");
|
|
2320
|
+
var import_core16 = require("@flowgram.ai/core");
|
|
2255
2321
|
var DRAG_OFFSET = 10;
|
|
2256
2322
|
var DEFAULT_DRAG_OFFSET_X = 8;
|
|
2257
2323
|
var DEFAULT_DRAG_OFFSET_Y = 8;
|
|
2258
|
-
var FlowDragLayer = class extends
|
|
2324
|
+
var FlowDragLayer = class extends import_core15.Layer {
|
|
2259
2325
|
constructor() {
|
|
2260
2326
|
super(...arguments);
|
|
2261
2327
|
this.dragOffset = {
|
|
@@ -2264,7 +2330,7 @@ var FlowDragLayer = class extends import_core14.Layer {
|
|
|
2264
2330
|
};
|
|
2265
2331
|
this.containerRef = import_react15.default.createRef();
|
|
2266
2332
|
this.draggingNodeMask = document.createElement("div");
|
|
2267
|
-
this._dragger = new
|
|
2333
|
+
this._dragger = new import_core16.PlaygroundDrag({
|
|
2268
2334
|
onDrag: (e) => {
|
|
2269
2335
|
this.handleMouseMove(e);
|
|
2270
2336
|
},
|
|
@@ -2295,7 +2361,7 @@ var FlowDragLayer = class extends import_core14.Layer {
|
|
|
2295
2361
|
}
|
|
2296
2362
|
isGrab() {
|
|
2297
2363
|
const currentState = this.editorStateConfig.getCurrentState();
|
|
2298
|
-
return currentState ===
|
|
2364
|
+
return currentState === import_core15.EditorState.STATE_GRAB;
|
|
2299
2365
|
}
|
|
2300
2366
|
setDraggingStatus(status) {
|
|
2301
2367
|
if (this.service.nodeDragIdsWithChildren.length) {
|
|
@@ -2446,22 +2512,22 @@ __decorateClass([
|
|
|
2446
2512
|
(0, import_inversify9.inject)(import_document18.FlowDragService)
|
|
2447
2513
|
], FlowDragLayer.prototype, "service", 2);
|
|
2448
2514
|
__decorateClass([
|
|
2449
|
-
(0,
|
|
2515
|
+
(0, import_core15.observeEntityDatas)(import_document18.FlowNodeEntity, import_document18.FlowNodeTransformData)
|
|
2450
2516
|
], FlowDragLayer.prototype, "transforms", 2);
|
|
2451
2517
|
__decorateClass([
|
|
2452
|
-
(0,
|
|
2518
|
+
(0, import_core15.observeEntity)(import_core15.EditorStateConfigEntity)
|
|
2453
2519
|
], FlowDragLayer.prototype, "editorStateConfig", 2);
|
|
2454
2520
|
__decorateClass([
|
|
2455
|
-
(0,
|
|
2521
|
+
(0, import_core15.observeEntity)(import_core15.PlaygroundConfigEntity)
|
|
2456
2522
|
], FlowDragLayer.prototype, "playgroundConfigEntity", 2);
|
|
2457
2523
|
__decorateClass([
|
|
2458
|
-
(0,
|
|
2524
|
+
(0, import_core15.observeEntity)(FlowDragEntity)
|
|
2459
2525
|
], FlowDragLayer.prototype, "flowDragConfigEntity", 2);
|
|
2460
2526
|
__decorateClass([
|
|
2461
|
-
(0,
|
|
2527
|
+
(0, import_core15.observeEntity)(import_document18.FlowRendererStateEntity)
|
|
2462
2528
|
], FlowDragLayer.prototype, "flowRenderStateEntity", 2);
|
|
2463
2529
|
__decorateClass([
|
|
2464
|
-
(0,
|
|
2530
|
+
(0, import_core15.observeEntity)(FlowSelectConfigEntity)
|
|
2465
2531
|
], FlowDragLayer.prototype, "selectConfigEntity", 2);
|
|
2466
2532
|
__decorateClass([
|
|
2467
2533
|
(0, import_inversify9.inject)(FlowRendererRegistry)
|
|
@@ -2474,8 +2540,8 @@ FlowDragLayer = __decorateClass([
|
|
|
2474
2540
|
var import_inversify10 = require("inversify");
|
|
2475
2541
|
var import_utils23 = require("@flowgram.ai/utils");
|
|
2476
2542
|
var import_document19 = require("@flowgram.ai/document");
|
|
2477
|
-
var
|
|
2478
|
-
var FlowSelectorBoxLayer = class extends
|
|
2543
|
+
var import_core17 = require("@flowgram.ai/core");
|
|
2544
|
+
var FlowSelectorBoxLayer = class extends import_core17.Layer {
|
|
2479
2545
|
constructor() {
|
|
2480
2546
|
super(...arguments);
|
|
2481
2547
|
this.node = import_utils23.domUtils.createDivWithClass("gedit-selector-box-layer");
|
|
@@ -2490,7 +2556,7 @@ var FlowSelectorBoxLayer = class extends import_core16.Layer {
|
|
|
2490
2556
|
/**
|
|
2491
2557
|
* 拖动选择框
|
|
2492
2558
|
*/
|
|
2493
|
-
this.selectboxDragger = new
|
|
2559
|
+
this.selectboxDragger = new import_core17.PlaygroundDrag({
|
|
2494
2560
|
onDragStart: (e) => {
|
|
2495
2561
|
this.selectConfigEntity.clearSelectedNodes();
|
|
2496
2562
|
const mousePos = this.playgroundConfigEntity.getPosFromMouseEvent(e);
|
|
@@ -2545,20 +2611,20 @@ var FlowSelectorBoxLayer = class extends import_core16.Layer {
|
|
|
2545
2611
|
return;
|
|
2546
2612
|
}
|
|
2547
2613
|
const currentState = this.editorStateConfig.getCurrentState();
|
|
2548
|
-
if (currentState ===
|
|
2614
|
+
if (currentState === import_core17.EditorState.STATE_MOUSE_FRIENDLY_SELECT) {
|
|
2549
2615
|
this.selectConfigEntity.clearSelectedNodes();
|
|
2550
2616
|
}
|
|
2551
2617
|
this.selectboxDragger.start(e.clientX, e.clientY, this.config);
|
|
2552
2618
|
return true;
|
|
2553
2619
|
},
|
|
2554
|
-
|
|
2620
|
+
import_core17.PipelineLayerPriority.BASE_LAYER
|
|
2555
2621
|
);
|
|
2556
2622
|
}
|
|
2557
2623
|
isEnabled() {
|
|
2558
2624
|
const currentState = this.editorStateConfig.getCurrentState();
|
|
2559
|
-
const isMouseFriendly = currentState ===
|
|
2625
|
+
const isMouseFriendly = currentState === import_core17.EditorState.STATE_MOUSE_FRIENDLY_SELECT;
|
|
2560
2626
|
return !this.config.disabled && !this.config.readonly && // 鼠标友好模式下,需要按下 shift 启动框选
|
|
2561
|
-
(isMouseFriendly && this.editorStateConfig.isPressingShift || currentState ===
|
|
2627
|
+
(isMouseFriendly && this.editorStateConfig.isPressingShift || currentState === import_core17.EditorState.STATE_SELECT) && !this.selectorBoxConfigEntity.disabled;
|
|
2562
2628
|
}
|
|
2563
2629
|
/**
|
|
2564
2630
|
* Destroy
|
|
@@ -2614,22 +2680,22 @@ __decorateClass([
|
|
|
2614
2680
|
(0, import_inversify10.inject)(import_document19.FlowDocument)
|
|
2615
2681
|
], FlowSelectorBoxLayer.prototype, "flowDocument", 2);
|
|
2616
2682
|
__decorateClass([
|
|
2617
|
-
(0, import_inversify10.inject)(
|
|
2683
|
+
(0, import_inversify10.inject)(import_core17.ContextMenuService)
|
|
2618
2684
|
], FlowSelectorBoxLayer.prototype, "contextMenuService", 2);
|
|
2619
2685
|
__decorateClass([
|
|
2620
|
-
(0,
|
|
2686
|
+
(0, import_core17.observeEntity)(import_core17.PlaygroundConfigEntity)
|
|
2621
2687
|
], FlowSelectorBoxLayer.prototype, "playgroundConfigEntity", 2);
|
|
2622
2688
|
__decorateClass([
|
|
2623
|
-
(0, import_inversify10.inject)(
|
|
2689
|
+
(0, import_inversify10.inject)(import_core17.SelectionService)
|
|
2624
2690
|
], FlowSelectorBoxLayer.prototype, "selectionService", 2);
|
|
2625
2691
|
__decorateClass([
|
|
2626
|
-
(0,
|
|
2692
|
+
(0, import_core17.observeEntity)(SelectorBoxConfigEntity)
|
|
2627
2693
|
], FlowSelectorBoxLayer.prototype, "selectorBoxConfigEntity", 2);
|
|
2628
2694
|
__decorateClass([
|
|
2629
|
-
(0,
|
|
2695
|
+
(0, import_core17.observeEntity)(FlowSelectConfigEntity)
|
|
2630
2696
|
], FlowSelectorBoxLayer.prototype, "selectConfigEntity", 2);
|
|
2631
2697
|
__decorateClass([
|
|
2632
|
-
(0,
|
|
2698
|
+
(0, import_core17.observeEntity)(import_core17.EditorStateConfigEntity)
|
|
2633
2699
|
], FlowSelectorBoxLayer.prototype, "editorStateConfig", 2);
|
|
2634
2700
|
FlowSelectorBoxLayer = __decorateClass([
|
|
2635
2701
|
(0, import_inversify10.injectable)()
|
|
@@ -2640,8 +2706,8 @@ var import_react16 = __toESM(require("react"));
|
|
|
2640
2706
|
var import_inversify11 = require("inversify");
|
|
2641
2707
|
var import_utils24 = require("@flowgram.ai/utils");
|
|
2642
2708
|
var import_document20 = require("@flowgram.ai/document");
|
|
2643
|
-
var
|
|
2644
|
-
var FlowSelectorBoundsLayer = class extends
|
|
2709
|
+
var import_core18 = require("@flowgram.ai/core");
|
|
2710
|
+
var FlowSelectorBoundsLayer = class extends import_core18.Layer {
|
|
2645
2711
|
constructor() {
|
|
2646
2712
|
super(...arguments);
|
|
2647
2713
|
this.node = import_utils24.domUtils.createDivWithClass("gedit-selector-bounds-layer");
|
|
@@ -2669,7 +2735,7 @@ var FlowSelectorBoundsLayer = class extends import_core17.Layer {
|
|
|
2669
2735
|
}
|
|
2670
2736
|
isEnabled() {
|
|
2671
2737
|
const currentState = this.editorStateConfig.getCurrentState();
|
|
2672
|
-
return currentState ===
|
|
2738
|
+
return currentState === import_core18.EditorState.STATE_SELECT;
|
|
2673
2739
|
}
|
|
2674
2740
|
// /**
|
|
2675
2741
|
// * 渲染工具栏
|
|
@@ -2758,22 +2824,22 @@ __decorateClass([
|
|
|
2758
2824
|
(0, import_inversify11.inject)(FlowRendererRegistry)
|
|
2759
2825
|
], FlowSelectorBoundsLayer.prototype, "rendererRegistry", 2);
|
|
2760
2826
|
__decorateClass([
|
|
2761
|
-
(0, import_inversify11.inject)(
|
|
2827
|
+
(0, import_inversify11.inject)(import_core18.CommandRegistry)
|
|
2762
2828
|
], FlowSelectorBoundsLayer.prototype, "commandRegistry", 2);
|
|
2763
2829
|
__decorateClass([
|
|
2764
|
-
(0,
|
|
2830
|
+
(0, import_core18.observeEntity)(FlowSelectConfigEntity)
|
|
2765
2831
|
], FlowSelectorBoundsLayer.prototype, "flowSelectConfigEntity", 2);
|
|
2766
2832
|
__decorateClass([
|
|
2767
|
-
(0,
|
|
2833
|
+
(0, import_core18.observeEntity)(import_core18.EditorStateConfigEntity)
|
|
2768
2834
|
], FlowSelectorBoundsLayer.prototype, "editorStateConfig", 2);
|
|
2769
2835
|
__decorateClass([
|
|
2770
|
-
(0,
|
|
2836
|
+
(0, import_core18.observeEntity)(SelectorBoxConfigEntity)
|
|
2771
2837
|
], FlowSelectorBoundsLayer.prototype, "selectorBoxConfigEntity", 2);
|
|
2772
2838
|
__decorateClass([
|
|
2773
|
-
(0,
|
|
2839
|
+
(0, import_core18.observeEntityDatas)(import_document20.FlowNodeEntity, import_document20.FlowNodeRenderData)
|
|
2774
2840
|
], FlowSelectorBoundsLayer.prototype, "renderStates", 2);
|
|
2775
2841
|
__decorateClass([
|
|
2776
|
-
(0,
|
|
2842
|
+
(0, import_core18.observeEntityDatas)(import_document20.FlowNodeEntity, import_document20.FlowNodeTransformData)
|
|
2777
2843
|
], FlowSelectorBoundsLayer.prototype, "_transforms", 2);
|
|
2778
2844
|
FlowSelectorBoundsLayer = __decorateClass([
|
|
2779
2845
|
(0, import_inversify11.injectable)()
|
|
@@ -2782,9 +2848,9 @@ FlowSelectorBoundsLayer = __decorateClass([
|
|
|
2782
2848
|
// src/layers/flow-context-menu-layer.tsx
|
|
2783
2849
|
var import_react17 = __toESM(require("react"));
|
|
2784
2850
|
var import_inversify12 = require("inversify");
|
|
2785
|
-
var
|
|
2851
|
+
var import_core19 = require("@flowgram.ai/core");
|
|
2786
2852
|
var import_utils25 = require("@flowgram.ai/utils");
|
|
2787
|
-
var FlowContextMenuLayer = class extends
|
|
2853
|
+
var FlowContextMenuLayer = class extends import_core19.Layer {
|
|
2788
2854
|
constructor() {
|
|
2789
2855
|
super(...arguments);
|
|
2790
2856
|
this.node = import_utils25.domUtils.createDivWithClass("gedit-context-menu-layer");
|
|
@@ -2792,7 +2858,7 @@ var FlowContextMenuLayer = class extends import_core18.Layer {
|
|
|
2792
2858
|
}
|
|
2793
2859
|
isEnabled() {
|
|
2794
2860
|
const currentState = this.editorStateConfig.getCurrentState();
|
|
2795
|
-
return !this.config.disabled && !this.config.readonly && currentState ===
|
|
2861
|
+
return !this.config.disabled && !this.config.readonly && currentState === import_core19.EditorState.STATE_SELECT && !this.selectorBoxConfigEntity.disabled;
|
|
2796
2862
|
}
|
|
2797
2863
|
onReady() {
|
|
2798
2864
|
this.node.style.zIndex = "30";
|
|
@@ -2815,7 +2881,7 @@ var FlowContextMenuLayer = class extends import_core18.Layer {
|
|
|
2815
2881
|
this.node.style.left = `${dragBlockX}px`;
|
|
2816
2882
|
this.node.style.top = `${dragBlockY}px`;
|
|
2817
2883
|
},
|
|
2818
|
-
|
|
2884
|
+
import_core19.PipelineLayerPriority.BASE_LAYER
|
|
2819
2885
|
),
|
|
2820
2886
|
this.listenPlaygroundEvent("mousedown", () => {
|
|
2821
2887
|
this.nodeRef.current?.setVisible(false);
|
|
@@ -2863,28 +2929,28 @@ var FlowContextMenuLayer = class extends import_core18.Layer {
|
|
|
2863
2929
|
}
|
|
2864
2930
|
};
|
|
2865
2931
|
__decorateClass([
|
|
2866
|
-
(0, import_inversify12.inject)(
|
|
2932
|
+
(0, import_inversify12.inject)(import_core19.CommandRegistry)
|
|
2867
2933
|
], FlowContextMenuLayer.prototype, "commandRegistry", 2);
|
|
2868
2934
|
__decorateClass([
|
|
2869
2935
|
(0, import_inversify12.inject)(FlowRendererRegistry)
|
|
2870
2936
|
], FlowContextMenuLayer.prototype, "rendererRegistry", 2);
|
|
2871
2937
|
__decorateClass([
|
|
2872
|
-
(0, import_inversify12.inject)(
|
|
2938
|
+
(0, import_inversify12.inject)(import_core19.ContextMenuService)
|
|
2873
2939
|
], FlowContextMenuLayer.prototype, "contextMenuService", 2);
|
|
2874
2940
|
__decorateClass([
|
|
2875
|
-
(0,
|
|
2941
|
+
(0, import_core19.observeEntity)(FlowSelectConfigEntity)
|
|
2876
2942
|
], FlowContextMenuLayer.prototype, "flowSelectConfigEntity", 2);
|
|
2877
2943
|
__decorateClass([
|
|
2878
|
-
(0, import_inversify12.inject)(
|
|
2944
|
+
(0, import_inversify12.inject)(import_core19.SelectionService)
|
|
2879
2945
|
], FlowContextMenuLayer.prototype, "selectionService", 2);
|
|
2880
2946
|
__decorateClass([
|
|
2881
|
-
(0,
|
|
2947
|
+
(0, import_core19.observeEntity)(import_core19.PlaygroundConfigEntity)
|
|
2882
2948
|
], FlowContextMenuLayer.prototype, "playgroundConfigEntity", 2);
|
|
2883
2949
|
__decorateClass([
|
|
2884
|
-
(0,
|
|
2950
|
+
(0, import_core19.observeEntity)(import_core19.EditorStateConfigEntity)
|
|
2885
2951
|
], FlowContextMenuLayer.prototype, "editorStateConfig", 2);
|
|
2886
2952
|
__decorateClass([
|
|
2887
|
-
(0,
|
|
2953
|
+
(0, import_core19.observeEntity)(SelectorBoxConfigEntity)
|
|
2888
2954
|
], FlowContextMenuLayer.prototype, "selectorBoxConfigEntity", 2);
|
|
2889
2955
|
FlowContextMenuLayer = __decorateClass([
|
|
2890
2956
|
(0, import_inversify12.injectable)()
|
|
@@ -2893,8 +2959,8 @@ FlowContextMenuLayer = __decorateClass([
|
|
|
2893
2959
|
// src/layers/flow-scroll-limit-layer.tsx
|
|
2894
2960
|
var import_inversify13 = require("inversify");
|
|
2895
2961
|
var import_document21 = require("@flowgram.ai/document");
|
|
2896
|
-
var
|
|
2897
|
-
var FlowScrollLimitLayer = class extends
|
|
2962
|
+
var import_core20 = require("@flowgram.ai/core");
|
|
2963
|
+
var FlowScrollLimitLayer = class extends import_core20.Layer {
|
|
2898
2964
|
getInitScroll() {
|
|
2899
2965
|
return this.document.layout.getInitScroll(this.pipelineNode.getBoundingClientRect());
|
|
2900
2966
|
}
|