@logicflow/react-node-registry 1.2.0-alpha.2 → 1.2.0-alpha.3

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 (57) hide show
  1. package/.turbo/turbo-build.log +4 -4
  2. package/CHANGELOG.md +8 -0
  3. package/dist/index.css +122 -0
  4. package/es/components/Container.d.ts +9 -0
  5. package/es/components/Container.js +16 -0
  6. package/es/components/Container.js.map +1 -0
  7. package/es/components/TitleBar.d.ts +8 -0
  8. package/es/components/TitleBar.js +87 -0
  9. package/es/components/TitleBar.js.map +1 -0
  10. package/es/index.css +122 -0
  11. package/es/index.less +1 -0
  12. package/es/model.d.ts +18 -1
  13. package/es/model.js +46 -8
  14. package/es/model.js.map +1 -1
  15. package/es/style/index.css +122 -0
  16. package/es/style/index.less +140 -0
  17. package/es/style/raw.d.ts +4 -0
  18. package/es/style/raw.js +6 -0
  19. package/es/style/raw.js.map +1 -0
  20. package/es/view.d.ts +10 -1
  21. package/es/view.js +123 -9
  22. package/es/view.js.map +1 -1
  23. package/es/wrapper.d.ts +1 -1
  24. package/es/wrapper.js +4 -2
  25. package/es/wrapper.js.map +1 -1
  26. package/lib/components/Container.d.ts +9 -0
  27. package/lib/components/Container.js +23 -0
  28. package/lib/components/Container.js.map +1 -0
  29. package/lib/components/TitleBar.d.ts +8 -0
  30. package/lib/components/TitleBar.js +114 -0
  31. package/lib/components/TitleBar.js.map +1 -0
  32. package/lib/index.css +122 -0
  33. package/lib/index.less +1 -0
  34. package/lib/model.d.ts +18 -1
  35. package/lib/model.js +44 -6
  36. package/lib/model.js.map +1 -1
  37. package/lib/style/index.css +122 -0
  38. package/lib/style/index.less +140 -0
  39. package/lib/style/raw.d.ts +4 -0
  40. package/lib/style/raw.js +9 -0
  41. package/lib/style/raw.js.map +1 -0
  42. package/lib/view.d.ts +10 -1
  43. package/lib/view.js +123 -9
  44. package/lib/view.js.map +1 -1
  45. package/lib/wrapper.d.ts +1 -1
  46. package/lib/wrapper.js +7 -2
  47. package/lib/wrapper.js.map +1 -1
  48. package/package.json +3 -3
  49. package/rollup.config.js +52 -0
  50. package/src/components/Container.tsx +33 -0
  51. package/src/components/TitleBar.tsx +149 -0
  52. package/src/index.less +1 -0
  53. package/src/model.ts +82 -6
  54. package/src/style/index.less +140 -0
  55. package/src/style/raw.ts +129 -0
  56. package/src/view.ts +102 -9
  57. package/src/wrapper.tsx +17 -2
package/lib/index.css ADDED
@@ -0,0 +1,122 @@
1
+ .lf-vue-node-container {
2
+ position: relative;
3
+ display: flex;
4
+ flex-direction: column;
5
+ box-sizing: border-box;
6
+ padding: 6px;
7
+ color: #474747;
8
+ border-radius: 12px;
9
+ box-shadow: 0 0 10px #cad2e15f;
10
+ }
11
+ .lf-vue-node-content-wrap {
12
+ display: flex;
13
+ flex: 1 1 auto;
14
+ justify-content: center;
15
+ }
16
+ .lf-vue-node-title {
17
+ display: flex;
18
+ align-items: flex-start;
19
+ justify-content: space-between;
20
+ box-sizing: border-box;
21
+ margin-bottom: 4px;
22
+ padding: 0 8px;
23
+ backdrop-filter: saturate(180%) blur(4px);
24
+ }
25
+ .lf-vue-node-title-expanded {
26
+ margin-bottom: 6px;
27
+ padding-bottom: 8px;
28
+ border-bottom: 1px solid #eaeaea;
29
+ }
30
+ @supports not (backdrop-filter: blur(1px)) {
31
+ .lf-vue-node-title {
32
+ backdrop-filter: none;
33
+ }
34
+ }
35
+ .lf-vue-node-title-left {
36
+ display: flex;
37
+ gap: 6px;
38
+ align-items: center;
39
+ min-width: 0;
40
+ }
41
+ .lf-vue-node-title-icon {
42
+ display: inline-block;
43
+ width: 16px;
44
+ height: 16px;
45
+ color: #666;
46
+ font-style: normal;
47
+ line-height: 16px;
48
+ text-align: center;
49
+ }
50
+ .lf-vue-node-title-text {
51
+ overflow: hidden;
52
+ color: #333;
53
+ font-weight: 500;
54
+ font-size: 14px;
55
+ white-space: nowrap;
56
+ text-overflow: ellipsis;
57
+ }
58
+ .lf-vue-node-title-actions {
59
+ display: flex;
60
+ gap: 6px;
61
+ align-items: center;
62
+ }
63
+ .lf-vue-node-title-expand,
64
+ .lf-vue-node-title-more {
65
+ display: inline-flex;
66
+ align-items: center;
67
+ justify-content: center;
68
+ width: 20px;
69
+ height: 20px;
70
+ padding: 2px;
71
+ background: transparent;
72
+ border: none;
73
+ border-radius: 4px;
74
+ cursor: pointer;
75
+ transition: background 0.15s ease;
76
+ appearance: none;
77
+ }
78
+ .lf-vue-node-title-expand:hover,
79
+ .lf-vue-node-title-more:hover {
80
+ background: rgba(0, 0, 0, 0.06);
81
+ }
82
+ .lf-vue-node-title-expand-icon {
83
+ color: #666;
84
+ font-style: normal;
85
+ transition: transform 0.3s ease;
86
+ }
87
+ .lf-vue-node-title-more-icon {
88
+ color: #666;
89
+ font-style: normal;
90
+ }
91
+ .lf-vue-node-title-tooltip {
92
+ position: absolute;
93
+ top: -50px;
94
+ right: -135px;
95
+ min-width: 120px;
96
+ max-width: 240px;
97
+ padding: 6px 8px;
98
+ background: #fff;
99
+ border: 1px solid rgba(0, 0, 0, 0.1);
100
+ border-radius: 6px;
101
+ box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
102
+ transform: translateY(calc(100% + 4px));
103
+ transition: opacity 0.15s ease, transform 0.15s ease;
104
+ }
105
+ .lf-vue-node-title-tooltip-list {
106
+ display: flex;
107
+ flex-direction: column;
108
+ gap: 4px;
109
+ }
110
+ .lf-vue-node-title-tooltip-item {
111
+ display: flex;
112
+ align-items: center;
113
+ justify-content: flex-start;
114
+ padding: 6px;
115
+ color: #333;
116
+ font-size: 12px;
117
+ border-radius: 4px;
118
+ cursor: pointer;
119
+ }
120
+ .lf-vue-node-title-tooltip-item:hover {
121
+ background: rgba(0, 0, 0, 0.05);
122
+ }
package/lib/index.less ADDED
@@ -0,0 +1 @@
1
+ @import url('./style/index.less');
package/lib/model.d.ts CHANGED
@@ -1,4 +1,9 @@
1
- import LogicFlow, { HtmlNodeModel, IHtmlNodeProperties } from '@logicflow/core';
1
+ import LogicFlow, { HtmlNodeModel, IHtmlNodeProperties, BaseNodeModel, GraphModel } from '@logicflow/core';
2
+ import NodeConfig = LogicFlow.NodeConfig;
3
+ export type NodeAction = {
4
+ name: string;
5
+ callback?: (node: BaseNodeModel, graph: GraphModel) => void;
6
+ };
2
7
  export interface ReactCustomProperties extends IHtmlNodeProperties {
3
8
  width?: number;
4
9
  height?: number;
@@ -7,10 +12,22 @@ export interface ReactCustomProperties extends IHtmlNodeProperties {
7
12
  refY?: number;
8
13
  style?: LogicFlow.CommonTheme;
9
14
  textStyle?: LogicFlow.TextNodeTheme;
15
+ _showTitle?: boolean;
16
+ _title?: string;
17
+ _icon?: string;
18
+ _titleHeight?: number;
19
+ _expanded?: boolean;
10
20
  }
11
21
  export declare class ReactNodeModel<P extends ReactCustomProperties = ReactCustomProperties> extends HtmlNodeModel<P> {
22
+ private __baseHeight?;
23
+ __actions?: {
24
+ name: string;
25
+ callback?: (node: BaseNodeModel, graph: GraphModel) => void;
26
+ }[];
27
+ constructor(data: NodeConfig<P>, graphModel: GraphModel);
12
28
  setAttributes(): void;
13
29
  getTextStyle(): LogicFlow.TextNodeTheme;
14
30
  getNodeStyle(): LogicFlow.CommonTheme;
31
+ setNodeActions(actions: NodeAction[]): void;
15
32
  }
16
33
  export default ReactNodeModel;
package/lib/model.js CHANGED
@@ -31,20 +31,54 @@ var core_1 = require("@logicflow/core");
31
31
  var lodash_es_1 = require("lodash-es");
32
32
  var ReactNodeModel = /** @class */ (function (_super) {
33
33
  __extends(ReactNodeModel, _super);
34
- function ReactNodeModel() {
35
- return _super !== null && _super.apply(this, arguments) || this;
34
+ function ReactNodeModel(data, graphModel) {
35
+ var _this = _super.call(this, data, graphModel) || this;
36
+ var properties = data.properties;
37
+ if (properties) {
38
+ var _a = properties._showTitle, _showTitle = _a === void 0 ? false : _a, _b = properties.style, style = _b === void 0 ? {} : _b;
39
+ if (_showTitle) {
40
+ _this.minWidth = 160;
41
+ _this.minHeight = 80;
42
+ _this.text.editable = false;
43
+ // 判断当前节点宽高是否小于最小宽高,如果是,强制设置为最小宽高
44
+ var newWidth = _this.width < _this.minWidth ? _this.minWidth : _this.width;
45
+ var newHeight = _this.height < _this.minHeight ? _this.minHeight : _this.height;
46
+ _this.setProperties(__assign(__assign({ _expanded: false }, properties), { style: __assign({ overflow: 'visible' }, (0, lodash_es_1.cloneDeep)(style)), width: newWidth, height: newHeight }));
47
+ _this.setNodeActions([
48
+ {
49
+ name: '复制',
50
+ callback: function (nodeModel, graphModel) {
51
+ graphModel.cloneNode(nodeModel.id);
52
+ },
53
+ },
54
+ {
55
+ name: '删除',
56
+ callback: function (nodeModel, graphModel) {
57
+ graphModel.deleteNode(nodeModel.id);
58
+ },
59
+ },
60
+ ]);
61
+ }
62
+ }
63
+ return _this;
36
64
  }
37
65
  ReactNodeModel.prototype.setAttributes = function () {
38
- var _a = this.properties, width = _a.width, height = _a.height, radius = _a.radius;
39
- if (width) {
66
+ var _a = this.properties, width = _a.width, height = _a.height, radius = _a.radius, _showTitle = _a._showTitle, _titleHeight = _a._titleHeight;
67
+ if (!(0, lodash_es_1.isNil)(width)) {
40
68
  this.width = width;
41
69
  }
42
- if (height) {
70
+ if (!(0, lodash_es_1.isNil)(height)) {
43
71
  this.height = height;
44
72
  }
45
- if (radius) {
73
+ if (!(0, lodash_es_1.isNil)(radius)) {
46
74
  this.radius = radius;
47
75
  }
76
+ if (this.__baseHeight === undefined) {
77
+ this.__baseHeight = (0, lodash_es_1.isNil)(height) ? this.height : height;
78
+ }
79
+ var extra = _showTitle ? (_titleHeight !== null && _titleHeight !== void 0 ? _titleHeight : 28) : 0;
80
+ var base = (0, lodash_es_1.isNil)(height) ? this.__baseHeight : height;
81
+ this.height = base + extra;
48
82
  };
49
83
  ReactNodeModel.prototype.getTextStyle = function () {
50
84
  // const { x, y, width, height } = this
@@ -58,6 +92,10 @@ var ReactNodeModel = /** @class */ (function (_super) {
58
92
  var customNodeStyle = this.properties.style;
59
93
  return __assign(__assign({}, style), ((0, lodash_es_1.cloneDeep)(customNodeStyle) || {}));
60
94
  };
95
+ ReactNodeModel.prototype.setNodeActions = function (actions) {
96
+ this.__actions =
97
+ (0, lodash_es_1.isArray)(actions) && !(0, lodash_es_1.isEmpty)(actions) ? (0, lodash_es_1.cloneDeep)(actions) : [];
98
+ };
61
99
  return ReactNodeModel;
62
100
  }(core_1.HtmlNodeModel));
63
101
  exports.ReactNodeModel = ReactNodeModel;
package/lib/model.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAA+E;AAC/E,uCAAqC;AAiBrC;IAEU,kCAAgB;IAF1B;;IA2CA,CAAC;IAxCC,sCAAa,GAAb;QACQ,IAAA,KAA4B,IAAI,CAAC,UAAU,EAAzC,KAAK,WAAA,EAAE,MAAM,YAAA,EAAE,MAAM,YAAoB,CAAA;QACjD,IAAI,KAAK,EAAE,CAAC;YACV,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QACpB,CAAC;QACD,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACtB,CAAC;QACD,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACtB,CAAC;IACH,CAAC;IAED,qCAAY,GAAZ;QACE,uCAAuC;QACjC,IAAA,KAAoC,IAAI,CAAC,UAAU,EAAjD,YAAQ,EAAR,IAAI,mBAAG,CAAC,KAAA,EAAE,YAAQ,EAAR,IAAI,mBAAG,CAAC,KAAA,EAAE,SAAS,eAAoB,CAAA;QACzD,IAAM,KAAK,GAAG,gBAAK,CAAC,YAAY,WAAE,CAAA;QAElC,6BAA6B;QAC7B,sCACK,KAAK,GACL,CAAC,IAAA,qBAAS,EAAC,SAAS,CAAC,IAAI,EAAE,CAAC,KAC/B,SAAS,EAAE,yBAAkB,IA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OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IACnE,CAAC;IACH,qBAAC;AAAD,CAAC,AArGD,CAEU,oBAAa,GAmGtB;AArGY,wCAAc;AAuG3B,kBAAe,cAAc,CAAA"}
@@ -0,0 +1,122 @@
1
+ .lf-vue-node-container {
2
+ position: relative;
3
+ display: flex;
4
+ flex-direction: column;
5
+ box-sizing: border-box;
6
+ padding: 6px;
7
+ color: #474747;
8
+ border-radius: 12px;
9
+ box-shadow: 0 0 10px #cad2e15f;
10
+ }
11
+ .lf-vue-node-content-wrap {
12
+ display: flex;
13
+ flex: 1 1 auto;
14
+ justify-content: center;
15
+ }
16
+ .lf-vue-node-title {
17
+ display: flex;
18
+ align-items: flex-start;
19
+ justify-content: space-between;
20
+ box-sizing: border-box;
21
+ margin-bottom: 4px;
22
+ padding: 0 8px;
23
+ backdrop-filter: saturate(180%) blur(4px);
24
+ }
25
+ .lf-vue-node-title-expanded {
26
+ margin-bottom: 6px;
27
+ padding-bottom: 8px;
28
+ border-bottom: 1px solid #eaeaea;
29
+ }
30
+ @supports not (backdrop-filter: blur(1px)) {
31
+ .lf-vue-node-title {
32
+ backdrop-filter: none;
33
+ }
34
+ }
35
+ .lf-vue-node-title-left {
36
+ display: flex;
37
+ gap: 6px;
38
+ align-items: center;
39
+ min-width: 0;
40
+ }
41
+ .lf-vue-node-title-icon {
42
+ display: inline-block;
43
+ width: 16px;
44
+ height: 16px;
45
+ color: #666;
46
+ font-style: normal;
47
+ line-height: 16px;
48
+ text-align: center;
49
+ }
50
+ .lf-vue-node-title-text {
51
+ overflow: hidden;
52
+ color: #333;
53
+ font-weight: 500;
54
+ font-size: 14px;
55
+ white-space: nowrap;
56
+ text-overflow: ellipsis;
57
+ }
58
+ .lf-vue-node-title-actions {
59
+ display: flex;
60
+ gap: 6px;
61
+ align-items: center;
62
+ }
63
+ .lf-vue-node-title-expand,
64
+ .lf-vue-node-title-more {
65
+ display: inline-flex;
66
+ align-items: center;
67
+ justify-content: center;
68
+ width: 20px;
69
+ height: 20px;
70
+ padding: 2px;
71
+ background: transparent;
72
+ border: none;
73
+ border-radius: 4px;
74
+ cursor: pointer;
75
+ transition: background 0.15s ease;
76
+ appearance: none;
77
+ }
78
+ .lf-vue-node-title-expand:hover,
79
+ .lf-vue-node-title-more:hover {
80
+ background: rgba(0, 0, 0, 0.06);
81
+ }
82
+ .lf-vue-node-title-expand-icon {
83
+ color: #666;
84
+ font-style: normal;
85
+ transition: transform 0.3s ease;
86
+ }
87
+ .lf-vue-node-title-more-icon {
88
+ color: #666;
89
+ font-style: normal;
90
+ }
91
+ .lf-vue-node-title-tooltip {
92
+ position: absolute;
93
+ top: -50px;
94
+ right: -135px;
95
+ min-width: 120px;
96
+ max-width: 240px;
97
+ padding: 6px 8px;
98
+ background: #fff;
99
+ border: 1px solid rgba(0, 0, 0, 0.1);
100
+ border-radius: 6px;
101
+ box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
102
+ transform: translateY(calc(100% + 4px));
103
+ transition: opacity 0.15s ease, transform 0.15s ease;
104
+ }
105
+ .lf-vue-node-title-tooltip-list {
106
+ display: flex;
107
+ flex-direction: column;
108
+ gap: 4px;
109
+ }
110
+ .lf-vue-node-title-tooltip-item {
111
+ display: flex;
112
+ align-items: center;
113
+ justify-content: flex-start;
114
+ padding: 6px;
115
+ color: #333;
116
+ font-size: 12px;
117
+ border-radius: 4px;
118
+ cursor: pointer;
119
+ }
120
+ .lf-vue-node-title-tooltip-item:hover {
121
+ background: rgba(0, 0, 0, 0.05);
122
+ }
@@ -0,0 +1,140 @@
1
+ .lf-vue-node-container {
2
+ position: relative;
3
+ display: flex;
4
+ flex-direction: column;
5
+ box-sizing: border-box;
6
+ padding: 6px;
7
+ color: #474747;
8
+ border-radius: 12px;
9
+ box-shadow: 0 0 10px #cad2e15f;
10
+ }
11
+
12
+ .lf-vue-node-content-wrap {
13
+ display: flex;
14
+ flex: 1 1 auto;
15
+ justify-content: center;
16
+ }
17
+
18
+ .lf-vue-node-title {
19
+ display: flex;
20
+ align-items: flex-start;
21
+ justify-content: space-between;
22
+ box-sizing: border-box;
23
+ margin-bottom: 4px;
24
+ padding: 0 8px;
25
+ backdrop-filter: saturate(180%) blur(4px);
26
+
27
+ &-expanded {
28
+ margin-bottom: 6px;
29
+ padding-bottom: 8px;
30
+ border-bottom: 1px solid #eaeaea;
31
+ }
32
+ }
33
+
34
+ @supports not (backdrop-filter: blur(1px)) {
35
+ .lf-vue-node-title {
36
+ backdrop-filter: none;
37
+ }
38
+ }
39
+
40
+ .lf-vue-node-title-left {
41
+ display: flex;
42
+ gap: 6px;
43
+ align-items: center;
44
+ min-width: 0;
45
+ }
46
+
47
+ .lf-vue-node-title-icon {
48
+ display: inline-block;
49
+ width: 16px;
50
+ height: 16px;
51
+ color: #666;
52
+ font-style: normal;
53
+ line-height: 16px;
54
+ text-align: center;
55
+ }
56
+
57
+ .lf-vue-node-title-text {
58
+ overflow: hidden;
59
+ color: #333;
60
+ font-weight: 500;
61
+ font-size: 14px;
62
+ white-space: nowrap;
63
+ text-overflow: ellipsis;
64
+ }
65
+
66
+ .lf-vue-node-title-actions {
67
+ display: flex;
68
+ gap: 6px;
69
+ align-items: center;
70
+ }
71
+
72
+ .lf-vue-node-title-expand,
73
+ .lf-vue-node-title-more {
74
+ display: inline-flex;
75
+ align-items: center;
76
+ justify-content: center;
77
+ width: 20px;
78
+ height: 20px;
79
+ padding: 2px;
80
+ background: transparent;
81
+ border: none;
82
+ border-radius: 4px;
83
+ cursor: pointer;
84
+ transition: background 0.15s ease;
85
+ appearance: none;
86
+ }
87
+
88
+ .lf-vue-node-title-expand:hover,
89
+ .lf-vue-node-title-more:hover {
90
+ background: rgb(0 0 0 / 6%);
91
+ }
92
+
93
+ .lf-vue-node-title-expand-icon {
94
+ color: #666;
95
+ font-style: normal;
96
+ transition: transform 0.3s ease;
97
+ }
98
+
99
+ .lf-vue-node-title-more-icon {
100
+ color: #666;
101
+ font-style: normal;
102
+ }
103
+
104
+ .lf-vue-node-title-tooltip {
105
+ position: absolute;
106
+ top: -50px;
107
+ right: -135px;
108
+ min-width: 120px;
109
+ max-width: 240px;
110
+ padding: 6px 8px;
111
+ background: #fff;
112
+ border: 1px solid rgb(0 0 0 / 10%);
113
+ border-radius: 6px;
114
+ box-shadow: 0 6px 20px rgb(0 0 0 / 12%);
115
+ transform: translateY(calc(100% + 4px));
116
+ transition:
117
+ opacity 0.15s ease,
118
+ transform 0.15s ease;
119
+ }
120
+
121
+ .lf-vue-node-title-tooltip-list {
122
+ display: flex;
123
+ flex-direction: column;
124
+ gap: 4px;
125
+ }
126
+
127
+ .lf-vue-node-title-tooltip-item {
128
+ display: flex;
129
+ align-items: center;
130
+ justify-content: flex-start;
131
+ padding: 6px;
132
+ color: #333;
133
+ font-size: 12px;
134
+ border-radius: 4px;
135
+ cursor: pointer;
136
+ }
137
+
138
+ .lf-vue-node-title-tooltip-item:hover {
139
+ background: rgb(0 0 0 / 5%);
140
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Auto generated file, do not modify it!
3
+ */
4
+ export declare const content = ".lf-vue-node-container {\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n padding: 6px;\n color: #474747;\n border-radius: 12px;\n box-shadow: 0 0 10px #cad2e15f;\n}\n.lf-vue-node-content-wrap {\n display: flex;\n flex: 1 1 auto;\n justify-content: center;\n}\n.lf-vue-node-title {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n box-sizing: border-box;\n margin-bottom: 4px;\n padding: 0 8px;\n backdrop-filter: saturate(180%) blur(4px);\n}\n.lf-vue-node-title-expanded {\n margin-bottom: 6px;\n padding-bottom: 8px;\n border-bottom: 1px solid #eaeaea;\n}\n@supports not (backdrop-filter: blur(1px)) {\n .lf-vue-node-title {\n backdrop-filter: none;\n }\n}\n.lf-vue-node-title-left {\n display: flex;\n gap: 6px;\n align-items: center;\n min-width: 0;\n}\n.lf-vue-node-title-icon {\n display: inline-block;\n width: 16px;\n height: 16px;\n color: #666;\n font-style: normal;\n line-height: 16px;\n text-align: center;\n}\n.lf-vue-node-title-text {\n overflow: hidden;\n color: #333;\n font-weight: 500;\n font-size: 14px;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.lf-vue-node-title-actions {\n display: flex;\n gap: 6px;\n align-items: center;\n}\n.lf-vue-node-title-expand,\n.lf-vue-node-title-more {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n padding: 2px;\n background: transparent;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n transition: background 0.15s ease;\n appearance: none;\n}\n.lf-vue-node-title-expand:hover,\n.lf-vue-node-title-more:hover {\n background: rgba(0, 0, 0, 0.06);\n}\n.lf-vue-node-title-expand-icon {\n color: #666;\n font-style: normal;\n transition: transform 0.3s ease;\n}\n.lf-vue-node-title-more-icon {\n color: #666;\n font-style: normal;\n}\n.lf-vue-node-title-tooltip {\n position: absolute;\n top: -50px;\n right: -135px;\n min-width: 120px;\n max-width: 240px;\n padding: 6px 8px;\n background: #fff;\n border: 1px solid rgba(0, 0, 0, 0.1);\n border-radius: 6px;\n box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);\n transform: translateY(calc(100% + 4px));\n transition: opacity 0.15s ease, transform 0.15s ease;\n}\n.lf-vue-node-title-tooltip-list {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n.lf-vue-node-title-tooltip-item {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n padding: 6px;\n color: #333;\n font-size: 12px;\n border-radius: 4px;\n cursor: pointer;\n}\n.lf-vue-node-title-tooltip-item:hover {\n background: rgba(0, 0, 0, 0.05);\n}\n";
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ /* eslint-disable */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.content = void 0;
5
+ /**
6
+ * Auto generated file, do not modify it!
7
+ */
8
+ exports.content = ".lf-vue-node-container {\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n padding: 6px;\n color: #474747;\n border-radius: 12px;\n box-shadow: 0 0 10px #cad2e15f;\n}\n.lf-vue-node-content-wrap {\n display: flex;\n flex: 1 1 auto;\n justify-content: center;\n}\n.lf-vue-node-title {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n box-sizing: border-box;\n margin-bottom: 4px;\n padding: 0 8px;\n backdrop-filter: saturate(180%) blur(4px);\n}\n.lf-vue-node-title-expanded {\n margin-bottom: 6px;\n padding-bottom: 8px;\n border-bottom: 1px solid #eaeaea;\n}\n@supports not (backdrop-filter: blur(1px)) {\n .lf-vue-node-title {\n backdrop-filter: none;\n }\n}\n.lf-vue-node-title-left {\n display: flex;\n gap: 6px;\n align-items: center;\n min-width: 0;\n}\n.lf-vue-node-title-icon {\n display: inline-block;\n width: 16px;\n height: 16px;\n color: #666;\n font-style: normal;\n line-height: 16px;\n text-align: center;\n}\n.lf-vue-node-title-text {\n overflow: hidden;\n color: #333;\n font-weight: 500;\n font-size: 14px;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.lf-vue-node-title-actions {\n display: flex;\n gap: 6px;\n align-items: center;\n}\n.lf-vue-node-title-expand,\n.lf-vue-node-title-more {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n padding: 2px;\n background: transparent;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n transition: background 0.15s ease;\n appearance: none;\n}\n.lf-vue-node-title-expand:hover,\n.lf-vue-node-title-more:hover {\n background: rgba(0, 0, 0, 0.06);\n}\n.lf-vue-node-title-expand-icon {\n color: #666;\n font-style: normal;\n transition: transform 0.3s ease;\n}\n.lf-vue-node-title-more-icon {\n color: #666;\n font-style: normal;\n}\n.lf-vue-node-title-tooltip {\n position: absolute;\n top: -50px;\n right: -135px;\n min-width: 120px;\n max-width: 240px;\n padding: 6px 8px;\n background: #fff;\n border: 1px solid rgba(0, 0, 0, 0.1);\n border-radius: 6px;\n box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);\n transform: translateY(calc(100% + 4px));\n transition: opacity 0.15s ease, transform 0.15s ease;\n}\n.lf-vue-node-title-tooltip-list {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n.lf-vue-node-title-tooltip-item {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n padding: 6px;\n color: #333;\n font-size: 12px;\n border-radius: 4px;\n cursor: pointer;\n}\n.lf-vue-node-title-tooltip-item:hover {\n background: rgba(0, 0, 0, 0.05);\n}\n";
9
+ //# sourceMappingURL=raw.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"raw.js","sourceRoot":"","sources":["../../src/style/raw.ts"],"names":[],"mappings":";AAAA,oBAAoB;;;AAEpB;;GAEG;AAEU,QAAA,OAAO,GAAG,unFA0HtB,CAAA"}
package/lib/view.d.ts CHANGED
@@ -2,12 +2,21 @@ import { Root } from 'react-dom/client';
2
2
  import { HtmlNode } from '@logicflow/core';
3
3
  export declare class ReactNodeView extends HtmlNode {
4
4
  root?: Root;
5
+ private containerEl?;
6
+ private __resizeObserver?;
7
+ private __resizeRafId?;
8
+ private __lastWidth?;
9
+ private __lastHeight?;
10
+ private __fallbackUnlisten?;
11
+ private __throttledUpdate;
5
12
  protected targetId(): string;
6
13
  componentWillUnmount(): void;
7
14
  setHtml(rootEl: SVGForeignObjectElement): void;
8
- confirmUpdate(_rootEl: SVGForeignObjectElement): void;
9
15
  protected renderReactComponent(container: HTMLElement): void;
10
16
  protected unmountReactComponent(): void;
11
17
  unmount(): void;
18
+ private measureAndUpdate;
19
+ private startResizeObserver;
20
+ private stopResizeObserver;
12
21
  }
13
22
  export default ReactNodeView;