@logicflow/vue-node-registry 1.2.0-alpha.1 → 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.
- package/.turbo/turbo-build$colon$dev.log +2 -2
- package/.turbo/turbo-build.log +3 -3
- package/CHANGELOG.md +15 -0
- package/dist/index.css +122 -0
- package/es/components/container.d.ts +19 -0
- package/es/components/container.js +27 -0
- package/es/components/container.js.map +1 -0
- package/es/components/titleBar.d.ts +24 -0
- package/es/components/titleBar.js +160 -0
- package/es/components/titleBar.js.map +1 -0
- package/es/index.css +122 -0
- package/es/index.less +1 -0
- package/es/model.d.ts +18 -1
- package/es/model.js +45 -5
- package/es/model.js.map +1 -1
- package/es/style/index.css +122 -0
- package/es/style/index.less +140 -0
- package/es/style/raw.d.ts +4 -0
- package/es/style/raw.js +6 -0
- package/es/style/raw.js.map +1 -0
- package/es/utils/size.d.ts +2 -0
- package/es/utils/size.js +14 -0
- package/es/utils/size.js.map +1 -0
- package/es/view.d.ts +9 -0
- package/es/view.js +137 -12
- package/es/view.js.map +1 -1
- package/lib/components/container.d.ts +19 -0
- package/lib/components/container.js +30 -0
- package/lib/components/container.js.map +1 -0
- package/lib/components/titleBar.d.ts +24 -0
- package/lib/components/titleBar.js +163 -0
- package/lib/components/titleBar.js.map +1 -0
- package/lib/index.css +122 -0
- package/lib/index.less +1 -0
- package/lib/model.d.ts +18 -1
- package/lib/model.js +43 -3
- package/lib/model.js.map +1 -1
- package/lib/style/index.css +122 -0
- package/lib/style/index.less +140 -0
- package/lib/style/raw.d.ts +4 -0
- package/lib/style/raw.js +9 -0
- package/lib/style/raw.js.map +1 -0
- package/lib/utils/size.d.ts +2 -0
- package/lib/utils/size.js +19 -0
- package/lib/utils/size.js.map +1 -0
- package/lib/view.d.ts +9 -0
- package/lib/view.js +136 -11
- package/lib/view.js.map +1 -1
- package/package.json +3 -3
- package/rollup.config.js +52 -0
- package/src/assets/arrow.svg +10 -0
- package/src/components/container.ts +36 -0
- package/src/components/titleBar.ts +189 -0
- package/src/index.less +1 -0
- package/src/model.ts +81 -3
- package/src/style/index.less +140 -0
- package/src/style/raw.ts +129 -0
- package/src/utils/size.ts +22 -0
- package/src/view.ts +138 -10
|
@@ -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";
|
package/es/style/raw.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Auto generated file, do not modify it!
|
|
4
|
+
*/
|
|
5
|
+
export var 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";
|
|
6
|
+
//# 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;AAEH,MAAM,CAAC,IAAM,OAAO,GAAG,unFA0HtB,CAAA"}
|
package/es/utils/size.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function computeBaseHeight(measuredHeight, _showTitle, _titleHeight) {
|
|
2
|
+
var extra = _showTitle
|
|
3
|
+
? typeof _titleHeight === 'number'
|
|
4
|
+
? _titleHeight
|
|
5
|
+
: 28
|
|
6
|
+
: 0;
|
|
7
|
+
return Math.max(1, Math.round(measuredHeight) - extra);
|
|
8
|
+
}
|
|
9
|
+
export function shouldUpdateSize(prevW, prevH, w, h) {
|
|
10
|
+
if (!w || !h)
|
|
11
|
+
return false;
|
|
12
|
+
return !(prevW === Math.round(w) && prevH === Math.round(h));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=size.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"size.js","sourceRoot":"","sources":["../../src/utils/size.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,iBAAiB,CAC/B,cAAsB,EACtB,UAAoB,EACpB,YAAqB;IAErB,IAAM,KAAK,GAAG,UAAU;QACtB,CAAC,CAAC,OAAO,YAAY,KAAK,QAAQ;YAChC,CAAC,CAAC,YAAY;YACd,CAAC,CAAC,EAAE;QACN,CAAC,CAAC,CAAC,CAAA;IACL,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,KAAK,CAAC,CAAA;AACxD,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,KAAc,EACd,KAAc,EACd,CAAU,EACV,CAAU;IAEV,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;QAAE,OAAO,KAAK,CAAA;IAC1B,OAAO,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;AAC9D,CAAC"}
|
package/es/view.d.ts
CHANGED
|
@@ -2,12 +2,21 @@ import { HtmlNode } from '@logicflow/core';
|
|
|
2
2
|
export declare class VueNodeView extends HtmlNode {
|
|
3
3
|
root?: any;
|
|
4
4
|
private vm;
|
|
5
|
+
private __resizeObserver?;
|
|
6
|
+
private __resizeRafId?;
|
|
7
|
+
private __lastWidth?;
|
|
8
|
+
private __lastHeight?;
|
|
9
|
+
private __fallbackUnlisten?;
|
|
10
|
+
private __throttledUpdate;
|
|
5
11
|
getComponentContainer(): any;
|
|
6
12
|
protected targetId(): string;
|
|
7
13
|
componentWillUnmount(): void;
|
|
8
14
|
setHtml(rootEl: SVGForeignObjectElement): void;
|
|
9
15
|
confirmUpdate(_rootEl: SVGForeignObjectElement): void;
|
|
10
16
|
protected renderVueComponent(): void;
|
|
17
|
+
private measureAndUpdate;
|
|
18
|
+
private startResizeObserver;
|
|
19
|
+
private stopResizeObserver;
|
|
11
20
|
protected unmountVueComponent(): any;
|
|
12
21
|
unmount(): void;
|
|
13
22
|
}
|
package/es/view.js
CHANGED
|
@@ -13,15 +13,51 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
13
13
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
14
|
};
|
|
15
15
|
})();
|
|
16
|
-
import { isVue2, isVue3, createApp, h, Vue2 } from 'vue-demi';
|
|
16
|
+
import { isVue2, isVue3, createApp, h, Vue2, defineComponent } from 'vue-demi';
|
|
17
|
+
// Vue2/3 兼容 API;使用 vue-demi 保持两端一致
|
|
18
|
+
import { throttle, round, get, isFunction, isArray, clamp, isNumber, } from 'lodash-es';
|
|
17
19
|
import { HtmlNode } from '@logicflow/core';
|
|
18
20
|
import { vueNodesMap } from './registry';
|
|
19
21
|
import { isActive, connect, disconnect } from './teleport';
|
|
22
|
+
import { Container } from './components/container';
|
|
20
23
|
var VueNodeView = /** @class */ (function (_super) {
|
|
21
24
|
__extends(VueNodeView, _super);
|
|
22
25
|
function VueNodeView() {
|
|
23
|
-
|
|
26
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
27
|
+
_this.__throttledUpdate = throttle(function () { return _this.measureAndUpdate(); }, 80);
|
|
28
|
+
_this.measureAndUpdate = function () {
|
|
29
|
+
try {
|
|
30
|
+
// 读取子组件(或容器本身)的实际尺寸并更新模型属性
|
|
31
|
+
var root = _this.getComponentContainer();
|
|
32
|
+
if (!root)
|
|
33
|
+
return;
|
|
34
|
+
var target = root.firstElementChild || root;
|
|
35
|
+
var rect = target.getBoundingClientRect();
|
|
36
|
+
var width = round(rect.width);
|
|
37
|
+
var height = round(rect.height);
|
|
38
|
+
if (width <= 0 || height <= 0)
|
|
39
|
+
return;
|
|
40
|
+
if (width === _this.__lastWidth && height === _this.__lastHeight)
|
|
41
|
+
return;
|
|
42
|
+
_this.__lastWidth = width;
|
|
43
|
+
_this.__lastHeight = height;
|
|
44
|
+
var props = _this.props.model.properties;
|
|
45
|
+
var extra = get(props, '_showTitle')
|
|
46
|
+
? isNumber(get(props, '_titleHeight'))
|
|
47
|
+
? get(props, '_titleHeight')
|
|
48
|
+
: 28
|
|
49
|
+
: 0;
|
|
50
|
+
// 去掉标题占用的高度,保证内容区域与模型高度一致
|
|
51
|
+
var baseHeight = clamp(height - extra, 1, Number.MAX_SAFE_INTEGER);
|
|
52
|
+
_this.props.model.setProperties({ width: width, height: baseHeight });
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
// swallow error
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
return _this;
|
|
24
59
|
}
|
|
60
|
+
// private isMounted: boolean = false
|
|
25
61
|
VueNodeView.prototype.getComponentContainer = function () {
|
|
26
62
|
return this.root;
|
|
27
63
|
};
|
|
@@ -33,31 +69,61 @@ var VueNodeView = /** @class */ (function (_super) {
|
|
|
33
69
|
this.unmount();
|
|
34
70
|
};
|
|
35
71
|
VueNodeView.prototype.setHtml = function (rootEl) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
72
|
+
// 创建节点内容容器并注入到 foreignObject(若已存在则复用)
|
|
73
|
+
var existed = rootEl.querySelector('.custom-vue-node-content');
|
|
74
|
+
if (!existed) {
|
|
75
|
+
var el = document.createElement('div');
|
|
76
|
+
el.className = 'custom-vue-node-content';
|
|
77
|
+
this.root = el;
|
|
78
|
+
rootEl.appendChild(el);
|
|
79
|
+
}
|
|
80
|
+
// 渲染 Vue 组件并启用尺寸监听
|
|
40
81
|
this.renderVueComponent();
|
|
82
|
+
this.startResizeObserver();
|
|
41
83
|
};
|
|
42
84
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
43
85
|
VueNodeView.prototype.confirmUpdate = function (_rootEl) {
|
|
44
86
|
// TODO: 如有需要,可以先通过继承的方式,自定义该节点的更新逻辑;我们后续会根据实际需求,丰富该功能
|
|
45
|
-
|
|
87
|
+
var model = this.props.model;
|
|
88
|
+
var _a = (model.properties || {})._showTitle, _showTitle = _a === void 0 ? false : _a;
|
|
89
|
+
if (_showTitle) {
|
|
90
|
+
this.setHtml(_rootEl);
|
|
91
|
+
}
|
|
46
92
|
};
|
|
47
93
|
VueNodeView.prototype.renderVueComponent = function () {
|
|
48
94
|
var _a;
|
|
49
95
|
this.unmountVueComponent();
|
|
50
96
|
var root = this.getComponentContainer();
|
|
51
97
|
var _b = this.props, model = _b.model, graphModel = _b.graphModel;
|
|
98
|
+
var _c = (model.properties || {})._showTitle, _showTitle = _c === void 0 ? false : _c;
|
|
99
|
+
var wrapWithContainer = function (child) {
|
|
100
|
+
return defineComponent({
|
|
101
|
+
name: 'LFVueNodeContainerWrapper',
|
|
102
|
+
props: {
|
|
103
|
+
node: { type: Object, required: true },
|
|
104
|
+
graph: { type: Object, required: true },
|
|
105
|
+
},
|
|
106
|
+
render: function () {
|
|
107
|
+
// 根据 _showTitle 决定是否用 Container 包裹,避免无标题时额外结构
|
|
108
|
+
if (!_showTitle) {
|
|
109
|
+
return h(child, { node: this.node, graph: this.graph });
|
|
110
|
+
}
|
|
111
|
+
return h(Container, { node: this.node, graph: this.graph }, [
|
|
112
|
+
h(child, { node: this.node, graph: this.graph }),
|
|
113
|
+
]);
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
};
|
|
52
117
|
if (root) {
|
|
53
|
-
var
|
|
54
|
-
if (
|
|
118
|
+
var component = vueNodesMap[model.type].component;
|
|
119
|
+
if (component) {
|
|
55
120
|
if (isVue2) {
|
|
56
121
|
var Vue = Vue2;
|
|
122
|
+
var Composed_1 = wrapWithContainer(component);
|
|
57
123
|
this.vm = new Vue({
|
|
58
124
|
el: root,
|
|
59
125
|
render: function (h) {
|
|
60
|
-
return h(
|
|
126
|
+
return h(Composed_1, {
|
|
61
127
|
node: model,
|
|
62
128
|
graph: graphModel,
|
|
63
129
|
});
|
|
@@ -71,13 +137,16 @@ var VueNodeView = /** @class */ (function (_super) {
|
|
|
71
137
|
});
|
|
72
138
|
}
|
|
73
139
|
else if (isVue3) {
|
|
140
|
+
console.log('isActive', isActive());
|
|
74
141
|
if (isActive()) {
|
|
75
|
-
|
|
142
|
+
var Composed = wrapWithContainer(component);
|
|
143
|
+
connect(this.targetId(), Composed, root, model, graphModel);
|
|
76
144
|
}
|
|
77
145
|
else {
|
|
146
|
+
var Composed_2 = wrapWithContainer(component);
|
|
78
147
|
this.vm = createApp({
|
|
79
148
|
render: function () {
|
|
80
|
-
return h(
|
|
149
|
+
return h(Composed_2, {
|
|
81
150
|
node: model,
|
|
82
151
|
graph: graphModel,
|
|
83
152
|
});
|
|
@@ -90,13 +159,68 @@ var VueNodeView = /** @class */ (function (_super) {
|
|
|
90
159
|
},
|
|
91
160
|
});
|
|
92
161
|
(_a = this.vm) === null || _a === void 0 ? void 0 : _a.mount(root);
|
|
162
|
+
// this.isMounted = true
|
|
93
163
|
}
|
|
94
164
|
}
|
|
95
165
|
}
|
|
96
166
|
}
|
|
97
167
|
};
|
|
168
|
+
VueNodeView.prototype.startResizeObserver = function () {
|
|
169
|
+
var _this = this;
|
|
170
|
+
var _a;
|
|
171
|
+
// 启动尺寸监听:优先使用 ResizeObserver,退化到 window.resize
|
|
172
|
+
var root = this.getComponentContainer();
|
|
173
|
+
if (!root)
|
|
174
|
+
return;
|
|
175
|
+
try {
|
|
176
|
+
if (isFunction(window.ResizeObserver)) {
|
|
177
|
+
this.__resizeObserver = new window.ResizeObserver(function (entries) {
|
|
178
|
+
if (!isArray(entries) || !entries.length)
|
|
179
|
+
return;
|
|
180
|
+
if (_this.__resizeRafId)
|
|
181
|
+
cancelAnimationFrame(_this.__resizeRafId);
|
|
182
|
+
// 使用 RAF 对齐绘制帧,再用节流函数合并频繁变更
|
|
183
|
+
_this.__resizeRafId = requestAnimationFrame(_this.__throttledUpdate);
|
|
184
|
+
});
|
|
185
|
+
var target = root.firstElementChild || root;
|
|
186
|
+
(_a = this.__resizeObserver) === null || _a === void 0 ? void 0 : _a.observe(target);
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
// 退化监听:在窗口尺寸变化时尝试更新
|
|
190
|
+
window.addEventListener('resize', function () { return _this.__throttledUpdate(); });
|
|
191
|
+
this.__fallbackUnlisten = function () {
|
|
192
|
+
return window.removeEventListener('resize', function () { return _this.__throttledUpdate(); });
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
catch (err) {
|
|
197
|
+
// swallow error
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
VueNodeView.prototype.stopResizeObserver = function () {
|
|
201
|
+
try {
|
|
202
|
+
// 停止所有监听与异步回调,避免内存泄漏
|
|
203
|
+
if (this.__resizeObserver) {
|
|
204
|
+
this.__resizeObserver.disconnect();
|
|
205
|
+
this.__resizeObserver = undefined;
|
|
206
|
+
}
|
|
207
|
+
if (this.__resizeRafId) {
|
|
208
|
+
cancelAnimationFrame(this.__resizeRafId);
|
|
209
|
+
this.__resizeRafId = undefined;
|
|
210
|
+
}
|
|
211
|
+
if (this.__fallbackUnlisten) {
|
|
212
|
+
this.__fallbackUnlisten();
|
|
213
|
+
this.__fallbackUnlisten = undefined;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
catch (err) {
|
|
217
|
+
// swallow error
|
|
218
|
+
}
|
|
219
|
+
};
|
|
98
220
|
VueNodeView.prototype.unmountVueComponent = function () {
|
|
99
221
|
var root = this.getComponentContainer();
|
|
222
|
+
// 在卸载 Vue 实例前先停止尺寸监听
|
|
223
|
+
this.stopResizeObserver();
|
|
100
224
|
if (this.vm) {
|
|
101
225
|
isVue2 && this.vm.$destroy();
|
|
102
226
|
isVue3 && this.vm.unmount();
|
|
@@ -108,6 +232,7 @@ var VueNodeView = /** @class */ (function (_super) {
|
|
|
108
232
|
return root;
|
|
109
233
|
};
|
|
110
234
|
VueNodeView.prototype.unmount = function () {
|
|
235
|
+
// Teleport 模式下断开连接,并清理视图与监听
|
|
111
236
|
if (isActive()) {
|
|
112
237
|
disconnect(this.targetId(), this.props.graphModel.flowId);
|
|
113
238
|
}
|
package/es/view.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.js","sourceRoot":"","sources":["../src/view.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"view.js","sourceRoot":"","sources":["../src/view.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC9E,mCAAmC;AACnC,OAAO,EACL,QAAQ,EACR,KAAK,EACL,GAAG,EACH,UAAU,EACV,OAAO,EACP,KAAK,EACL,QAAQ,GACT,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,OAA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I,CAAC,SAAS,GAAG,EAAE,CAAA;QACrB,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,6BAAO,GAAP;QACE,4BAA4B;QAC5B,IAAI,QAAQ,EAAE,EAAE,CAAC;YACf,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,MAAgB,CAAC,CAAA;QACrE,CAAC;QACD,IAAI,CAAC,mBAAmB,EAAE,CAAA;IAC5B,CAAC;IACH,kBAAC;AAAD,CAAC,AA1ND,CAAiC,QAAQ,GA0NxC;;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const Container: import("vue-demi").DefineComponent<{
|
|
2
|
+
node: {
|
|
3
|
+
type: ObjectConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
graph: {
|
|
7
|
+
type: ObjectConstructor;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
}, unknown, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, {}, string, import("vue-demi").PublicProps, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
11
|
+
node: {
|
|
12
|
+
type: ObjectConstructor;
|
|
13
|
+
required: true;
|
|
14
|
+
};
|
|
15
|
+
graph: {
|
|
16
|
+
type: ObjectConstructor;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
}>>, {}, {}>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Container = void 0;
|
|
4
|
+
var vue_demi_1 = require("vue-demi");
|
|
5
|
+
var titleBar_1 = require("./titleBar");
|
|
6
|
+
exports.Container = (0, vue_demi_1.defineComponent)({
|
|
7
|
+
name: 'LFVueNodeContainer',
|
|
8
|
+
props: {
|
|
9
|
+
node: { type: Object, required: true },
|
|
10
|
+
graph: { type: Object, required: true },
|
|
11
|
+
},
|
|
12
|
+
render: function () {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
var props = ((_a = this.node) === null || _a === void 0 ? void 0 : _a.properties) || {};
|
|
15
|
+
var children = [];
|
|
16
|
+
var titleColor = props.style.titleColor || '#E5EEFC';
|
|
17
|
+
if (props._showTitle) {
|
|
18
|
+
children.push((0, vue_demi_1.h)(titleBar_1.TitleBar, { node: this.node, graph: this.graph }));
|
|
19
|
+
}
|
|
20
|
+
console.log('props._expanded', props._expanded);
|
|
21
|
+
if (props._expanded === true) {
|
|
22
|
+
children.push((0, vue_demi_1.h)('div', { class: 'lf-vue-node-content-wrap' }, ((_b = this.$slots) === null || _b === void 0 ? void 0 : _b.default) ? this.$slots.default() : []));
|
|
23
|
+
}
|
|
24
|
+
return (0, vue_demi_1.h)('div', {
|
|
25
|
+
class: 'lf-vue-node-container',
|
|
26
|
+
style: " background: linear-gradient(180deg, ".concat(titleColor, " 0%, #FFFFFF 24px)"),
|
|
27
|
+
}, children);
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=container.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container.js","sourceRoot":"","sources":["../../src/components/container.ts"],"names":[],"mappings":";;;AAAA,qCAA6C;AAC7C,uCAAqC;AAExB,QAAA,SAAS,GAAG,IAAA,0BAAe,EAAC;IACvC,IAAI,EAAE,oBAAoB;IAC1B,KAAK,EAAE;QACL,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;QACtC,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;KACxC;IACD,MAAM;;QACJ,IAAM,KAAK,GAAG,CAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,UAAU,KAAI,EAAE,CAAA;QACzC,IAAM,QAAQ,GAAU,EAAE,CAAA;QAC1B,IAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,UAAU,IAAI,SAAS,CAAA;QACtD,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;YACrB,QAAQ,CAAC,IAAI,CAAC,IAAA,YAAC,EAAC,mBAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;QACpE,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,KAAK,CAAC,SAAS,CAAC,CAAA;QAC/C,IAAI,KAAK,CAAC,SAAS,KAAK,IAAI,EAAE,CAAC;YAC7B,QAAQ,CAAC,IAAI,CACX,IAAA,YAAC,EACC,KAAK,EACL,EAAE,KAAK,EAAE,0BAA0B,EAAE,EACrC,CAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,OAAO,EAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAClD,CACF,CAAA;QACH,CAAC;QACD,OAAO,IAAA,YAAC,EACN,KAAK,EACL;YACE,KAAK,EAAE,uBAAuB;YAC9B,KAAK,EAAE,+CAAwC,UAAU,uBAAoB;SAC9E,EACD,QAAQ,CACT,CAAA;IACH,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const TitleBar: import("vue-demi").DefineComponent<{
|
|
2
|
+
node: {
|
|
3
|
+
type: ObjectConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
graph: {
|
|
7
|
+
type: ObjectConstructor;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
}, unknown, {
|
|
11
|
+
showTooltip: boolean;
|
|
12
|
+
}, {}, {
|
|
13
|
+
toggleExpand(): void;
|
|
14
|
+
runAction(act: any): void;
|
|
15
|
+
}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, {}, string, import("vue-demi").PublicProps, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
16
|
+
node: {
|
|
17
|
+
type: ObjectConstructor;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
graph: {
|
|
21
|
+
type: ObjectConstructor;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
}>>, {}, {}>;
|