@logicflow/core 1.2.0-next.5 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/logic-flow.js
CHANGED
|
@@ -28396,17 +28396,18 @@ var ToolOverlay_ToolOverlay = src_observer(ToolOverlay_class = /*#__PURE__*/func
|
|
|
28396
28396
|
}
|
|
28397
28397
|
|
|
28398
28398
|
ToolOverlay_createClass(ToolOverlay, [{
|
|
28399
|
+
key: "componentDidMount",
|
|
28400
|
+
value: // 在react严格模式下,useEffect会执行两次,但是在LogicFlow内部,则只会触发一次componentDidMount和componentDidUpdate。
|
|
28401
|
+
// 其中第一次componentDidMount对应的graphModel为被丢弃的graphModel, 所以不应该生效。
|
|
28402
|
+
// 在非react环境下,只会触发一次componentDidMount,不会触发componentDidUpdate。
|
|
28403
|
+
// 所以这里采用componentDidUpdate和componentDidMount都去触发插件的render方法。
|
|
28404
|
+
function componentDidMount() {
|
|
28405
|
+
this.triggerToolRender();
|
|
28406
|
+
}
|
|
28407
|
+
}, {
|
|
28399
28408
|
key: "componentDidUpdate",
|
|
28400
28409
|
value: function componentDidUpdate() {
|
|
28401
|
-
|
|
28402
|
-
tool = _this$props.tool,
|
|
28403
|
-
graphModel = _this$props.graphModel;
|
|
28404
|
-
var ToolOverlayElement = document.querySelector("#ToolOverlay_".concat(graphModel.flowId));
|
|
28405
|
-
var lf = tool.getInstance();
|
|
28406
|
-
lf.components.forEach(function (render) {
|
|
28407
|
-
return render(lf, ToolOverlayElement);
|
|
28408
|
-
});
|
|
28409
|
-
lf.components = []; // 保证extension组件的render只执行一次
|
|
28410
|
+
this.triggerToolRender();
|
|
28410
28411
|
}
|
|
28411
28412
|
/**
|
|
28412
28413
|
* 外部传入的一般是HTMLElement
|
|
@@ -28415,9 +28416,9 @@ var ToolOverlay_ToolOverlay = src_observer(ToolOverlay_class = /*#__PURE__*/func
|
|
|
28415
28416
|
}, {
|
|
28416
28417
|
key: "getTools",
|
|
28417
28418
|
value: function getTools() {
|
|
28418
|
-
var _this$
|
|
28419
|
-
tool = _this$
|
|
28420
|
-
graphModel = _this$
|
|
28419
|
+
var _this$props = this.props,
|
|
28420
|
+
tool = _this$props.tool,
|
|
28421
|
+
graphModel = _this$props.graphModel;
|
|
28421
28422
|
var tools = tool.getTools();
|
|
28422
28423
|
var components = tools.map(function (item) {
|
|
28423
28424
|
return Object(preact_module["g" /* h */])(item, {
|
|
@@ -28428,6 +28429,19 @@ var ToolOverlay_ToolOverlay = src_observer(ToolOverlay_class = /*#__PURE__*/func
|
|
|
28428
28429
|
tool.components = components;
|
|
28429
28430
|
return components;
|
|
28430
28431
|
}
|
|
28432
|
+
}, {
|
|
28433
|
+
key: "triggerToolRender",
|
|
28434
|
+
value: function triggerToolRender() {
|
|
28435
|
+
var _this$props2 = this.props,
|
|
28436
|
+
tool = _this$props2.tool,
|
|
28437
|
+
graphModel = _this$props2.graphModel;
|
|
28438
|
+
var ToolOverlayElement = document.querySelector("#ToolOverlay_".concat(graphModel.flowId));
|
|
28439
|
+
var lf = tool.getInstance();
|
|
28440
|
+
lf.components.forEach(function (render) {
|
|
28441
|
+
return render(lf, ToolOverlayElement);
|
|
28442
|
+
});
|
|
28443
|
+
lf.components = []; // 保证extension组件的render只执行一次
|
|
28444
|
+
}
|
|
28431
28445
|
}, {
|
|
28432
28446
|
key: "render",
|
|
28433
28447
|
value: function render() {
|