@lark-apaas/miaoda-inspector 0.1.0-alpha.1 → 0.1.0-alpha.2
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/es/Inspector/{Inspector.js → Inspector.mjs} +50 -55
- package/dist/es/Inspector/{Overlay.js → Overlay.mjs} +157 -125
- package/dist/es/Inspector/hooks/use-effect-event.mjs +17 -0
- package/dist/es/Inspector/hooks/use-layout-effect.mjs +9 -0
- package/dist/es/Inspector/hooks/{use-mouse.js → use-mouse.mjs} +8 -4
- package/dist/es/Inspector/index.mjs +5 -0
- package/dist/es/Inspector/utils/fiber.mjs +70 -0
- package/dist/es/Inspector/utils/highlight.mjs +78 -0
- package/dist/es/Inspector/utils/inspect.mjs +131 -0
- package/dist/es/Inspector/utils/{overlay.js → overlay.mjs} +7 -2
- package/dist/es/MiaodaInspector/MiaodaInspector.mjs +427 -0
- package/dist/es/MiaodaInspector/index.mjs +5 -0
- package/dist/es/chunk-I4E63NIC.mjs +24 -0
- package/dist/es/config/{ui-config.js → ui-config.mjs} +66 -286
- package/dist/es/global.d.mjs +0 -0
- package/dist/es/index.mjs +7 -0
- package/dist/es/types/iframe-events.mjs +0 -0
- package/dist/es/types/index.mjs +27 -0
- package/dist/es/utils/{config-mapper.js → config-mapper.mjs} +14 -56
- package/dist/es/utils/{css.js → css.mjs} +5 -1
- package/dist/es/utils/index.mjs +37 -0
- package/dist/es/utils/origin.mjs +26 -0
- package/dist/es/utils/style-calculator.mjs +177 -0
- package/dist/lib/Inspector/Inspector.js +99 -104
- package/dist/lib/Inspector/Overlay.js +172 -143
- package/dist/lib/Inspector/hooks/index.js +19 -19
- package/dist/lib/Inspector/hooks/use-effect-event.js +26 -15
- package/dist/lib/Inspector/hooks/use-layout-effect.js +25 -10
- package/dist/lib/Inspector/hooks/use-mouse.js +27 -14
- package/dist/lib/Inspector/index.js +21 -8
- package/dist/lib/Inspector/utils/fiber.js +49 -55
- package/dist/lib/Inspector/utils/highlight.js +44 -31
- package/dist/lib/Inspector/utils/index.js +19 -19
- package/dist/lib/Inspector/utils/inspect.js +62 -72
- package/dist/lib/Inspector/utils/overlay.js +20 -15
- package/dist/lib/MiaodaInspector/MiaodaInspector.js +265 -266
- package/dist/lib/MiaodaInspector/index.js +21 -8
- package/dist/lib/config/ui-config.js +81 -292
- package/dist/lib/global.d.js +1 -0
- package/dist/lib/index.js +22 -17
- package/dist/lib/types/iframe-events.js +15 -3
- package/dist/lib/types/index.js +30 -43
- package/dist/lib/utils/config-mapper.js +41 -69
- package/dist/lib/utils/css.js +33 -15
- package/dist/lib/utils/index.js +36 -57
- package/dist/lib/utils/origin.js +23 -22
- package/dist/lib/utils/style-calculator.js +113 -110
- package/dist/types/Inspector/Inspector.d.ts +95 -92
- package/dist/types/Inspector/Overlay.d.ts +61 -58
- package/dist/types/Inspector/hooks/index.d.ts +4 -3
- package/dist/types/Inspector/hooks/use-effect-event.d.ts +3 -1
- package/dist/types/Inspector/hooks/use-layout-effect.d.ts +5 -2
- package/dist/types/Inspector/hooks/use-mouse.d.ts +9 -8
- package/dist/types/Inspector/index.d.ts +4 -1
- package/dist/types/Inspector/utils/fiber.d.ts +12 -10
- package/dist/types/Inspector/utils/highlight.d.ts +7 -5
- package/dist/types/Inspector/utils/index.d.ts +4 -3
- package/dist/types/Inspector/utils/inspect.d.ts +45 -42
- package/dist/types/Inspector/utils/overlay.d.ts +24 -22
- package/dist/types/MiaodaInspector/MiaodaInspector.d.ts +42 -41
- package/dist/types/MiaodaInspector/index.d.ts +3 -1
- package/dist/types/config/ui-config.d.ts +42 -41
- package/dist/types/global.d.d.ts +17 -0
- package/dist/types/index.d.ts +5 -4
- package/dist/types/types/iframe-events.d.ts +133 -130
- package/dist/types/types/index.d.ts +2 -1
- package/dist/types/utils/config-mapper.d.ts +14 -11
- package/dist/types/utils/css.d.ts +5 -2
- package/dist/types/utils/index.d.ts +7 -3
- package/dist/types/utils/origin.d.ts +12 -8
- package/dist/types/utils/style-calculator.d.ts +20 -17
- package/package.json +13 -13
- package/dist/es/Inspector/hooks/use-effect-event.js +0 -15
- package/dist/es/Inspector/hooks/use-layout-effect.js +0 -3
- package/dist/es/Inspector/index.js +0 -1
- package/dist/es/Inspector/utils/fiber.js +0 -61
- package/dist/es/Inspector/utils/highlight.js +0 -74
- package/dist/es/Inspector/utils/inspect.js +0 -119
- package/dist/es/MiaodaInspector/MiaodaInspector.js +0 -397
- package/dist/es/MiaodaInspector/index.js +0 -1
- package/dist/es/index.js +0 -2
- package/dist/es/types/iframe-events.js +0 -1
- package/dist/es/types/index.js +0 -1
- package/dist/es/utils/index.js +0 -3
- package/dist/es/utils/origin.js +0 -19
- package/dist/es/utils/style-calculator.js +0 -158
- /package/dist/es/Inspector/hooks/{index.js → index.mjs} +0 -0
- /package/dist/es/Inspector/utils/{index.js → index.mjs} +0 -0
|
@@ -1,339 +1,116 @@
|
|
|
1
|
-
|
|
1
|
+
import "../chunk-I4E63NIC.mjs";
|
|
2
|
+
const defaultUIConfig = {
|
|
2
3
|
version: "1.0.0",
|
|
3
4
|
common: {
|
|
4
5
|
fontSize: {
|
|
5
6
|
type: "select",
|
|
6
7
|
options: [
|
|
7
|
-
{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
rawValue: "16"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
value: "text-lg",
|
|
24
|
-
label: "lg(18px)",
|
|
25
|
-
rawValue: "18"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
value: "text-xl",
|
|
29
|
-
label: "xl(20px)",
|
|
30
|
-
rawValue: "20"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
value: "text-2xl",
|
|
34
|
-
label: "2xl(24px)",
|
|
35
|
-
rawValue: "24"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
value: "text-3xl",
|
|
39
|
-
label: "3xl(30px)",
|
|
40
|
-
rawValue: "30"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
value: "text-4xl",
|
|
44
|
-
label: "4xl(36px)",
|
|
45
|
-
rawValue: "36"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
value: "text-5xl",
|
|
49
|
-
label: "5xl(48px)",
|
|
50
|
-
rawValue: "48"
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
value: "text-6xl",
|
|
54
|
-
label: "6xl(60px)",
|
|
55
|
-
rawValue: "60"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
value: "text-7xl",
|
|
59
|
-
label: "7xl(72px)",
|
|
60
|
-
rawValue: "72"
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
value: "text-8xl",
|
|
64
|
-
label: "8xl(96px)",
|
|
65
|
-
rawValue: "96"
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
value: "text-9xl",
|
|
69
|
-
label: "9xl(128px)",
|
|
70
|
-
rawValue: "128"
|
|
71
|
-
}
|
|
8
|
+
{ value: "text-xs", label: "xs(12px)", rawValue: "12" },
|
|
9
|
+
{ value: "text-sm", label: "sm(14px)", rawValue: "14" },
|
|
10
|
+
{ value: "text-base", label: "base(16px)", rawValue: "16" },
|
|
11
|
+
{ value: "text-lg", label: "lg(18px)", rawValue: "18" },
|
|
12
|
+
{ value: "text-xl", label: "xl(20px)", rawValue: "20" },
|
|
13
|
+
{ value: "text-2xl", label: "2xl(24px)", rawValue: "24" },
|
|
14
|
+
{ value: "text-3xl", label: "3xl(30px)", rawValue: "30" },
|
|
15
|
+
{ value: "text-4xl", label: "4xl(36px)", rawValue: "36" },
|
|
16
|
+
{ value: "text-5xl", label: "5xl(48px)", rawValue: "48" },
|
|
17
|
+
{ value: "text-6xl", label: "6xl(60px)", rawValue: "60" },
|
|
18
|
+
{ value: "text-7xl", label: "7xl(72px)", rawValue: "72" },
|
|
19
|
+
{ value: "text-8xl", label: "8xl(96px)", rawValue: "96" },
|
|
20
|
+
{ value: "text-9xl", label: "9xl(128px)", rawValue: "128" }
|
|
72
21
|
]
|
|
73
22
|
},
|
|
74
23
|
fontWeight: {
|
|
75
24
|
type: "select",
|
|
76
25
|
options: [
|
|
77
|
-
{
|
|
78
|
-
value: "font-thin",
|
|
79
|
-
label: "极细(Thin)",
|
|
80
|
-
rawValue: "100"
|
|
81
|
-
},
|
|
26
|
+
{ value: "font-thin", label: "\u6781\u7EC6\uFF08Thin\uFF09", rawValue: "100" },
|
|
82
27
|
{
|
|
83
28
|
value: "font-extralight",
|
|
84
|
-
label: "
|
|
29
|
+
label: "\u6781\u8F7B\uFF08Extra Light\uFF09",
|
|
85
30
|
rawValue: "200"
|
|
86
31
|
},
|
|
87
|
-
{
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
value: "font-normal",
|
|
94
|
-
label: "常规(Normal)",
|
|
95
|
-
rawValue: "400"
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
value: "font-medium",
|
|
99
|
-
label: "中粗(Medium)",
|
|
100
|
-
rawValue: "500"
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
value: "font-semibold",
|
|
104
|
-
label: "半粗(Semi Bold)",
|
|
105
|
-
rawValue: "600"
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
value: "font-bold",
|
|
109
|
-
label: "粗(Bold)",
|
|
110
|
-
rawValue: "700"
|
|
111
|
-
},
|
|
32
|
+
{ value: "font-light", label: "\u8F7B\uFF08Light\uFF09", rawValue: "300" },
|
|
33
|
+
{ value: "font-normal", label: "\u5E38\u89C4\uFF08Normal\uFF09", rawValue: "400" },
|
|
34
|
+
{ value: "font-medium", label: "\u4E2D\u7C97\uFF08Medium\uFF09", rawValue: "500" },
|
|
35
|
+
{ value: "font-semibold", label: "\u534A\u7C97\uFF08Semi Bold\uFF09", rawValue: "600" },
|
|
36
|
+
{ value: "font-bold", label: "\u7C97\uFF08Bold\uFF09", rawValue: "700" },
|
|
112
37
|
{
|
|
113
38
|
value: "font-extrabold",
|
|
114
|
-
label: "
|
|
39
|
+
label: "\u6781\u7C97\uFF08Extra Bold\uFF09",
|
|
115
40
|
rawValue: "800"
|
|
116
41
|
},
|
|
117
|
-
{
|
|
118
|
-
value: "font-black",
|
|
119
|
-
label: "黑体(Black)",
|
|
120
|
-
rawValue: "900"
|
|
121
|
-
}
|
|
42
|
+
{ value: "font-black", label: "\u9ED1\u4F53\uFF08Black\uFF09", rawValue: "900" }
|
|
122
43
|
]
|
|
123
44
|
},
|
|
124
45
|
borderRadius: {
|
|
125
46
|
type: "select",
|
|
126
47
|
options: [
|
|
127
|
-
{
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
value: "rounded-sm",
|
|
134
|
-
label: "sm (2px)",
|
|
135
|
-
rawValue: "2"
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
value: "rounded",
|
|
139
|
-
label: "s (4px)",
|
|
140
|
-
rawValue: "4"
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
value: "rounded-md",
|
|
144
|
-
label: "m (6px)",
|
|
145
|
-
rawValue: "6"
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
value: "rounded-lg",
|
|
149
|
-
label: "l (8px)",
|
|
150
|
-
rawValue: "8"
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
value: "rounded-xl",
|
|
154
|
-
label: "xl (12px)",
|
|
155
|
-
rawValue: "12"
|
|
156
|
-
},
|
|
48
|
+
{ value: "rounded-none", label: "none\uFF080px\uFF09", rawValue: "0" },
|
|
49
|
+
{ value: "rounded-sm", label: "sm (2px)", rawValue: "2" },
|
|
50
|
+
{ value: "rounded", label: "s (4px)", rawValue: "4" },
|
|
51
|
+
{ value: "rounded-md", label: "m (6px)", rawValue: "6" },
|
|
52
|
+
{ value: "rounded-lg", label: "l (8px)", rawValue: "8" },
|
|
53
|
+
{ value: "rounded-xl", label: "xl (12px)", rawValue: "12" },
|
|
157
54
|
// TODO:为啥都没了?
|
|
158
55
|
// { value: 'rounded-2xl', label: translate('2xl (16px)') },
|
|
159
56
|
// { value: 'rounded-3xl', label: translate('3xl (24px)') },
|
|
160
|
-
{
|
|
161
|
-
value: "rounded-full",
|
|
162
|
-
label: "Full",
|
|
163
|
-
rawValue: "9999"
|
|
164
|
-
}
|
|
57
|
+
{ value: "rounded-full", label: "Full", rawValue: "9999" }
|
|
165
58
|
]
|
|
166
59
|
},
|
|
167
60
|
borderWidth: {
|
|
168
61
|
type: "select",
|
|
169
62
|
options: [
|
|
170
|
-
{
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
{
|
|
176
|
-
value: "border",
|
|
177
|
-
label: "1px",
|
|
178
|
-
rawValue: "1"
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
value: "border-2",
|
|
182
|
-
label: "2px",
|
|
183
|
-
rawValue: "2"
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
value: "border-4",
|
|
187
|
-
label: "4px",
|
|
188
|
-
rawValue: "4"
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
value: "border-8",
|
|
192
|
-
label: "8px",
|
|
193
|
-
rawValue: "8"
|
|
194
|
-
}
|
|
63
|
+
{ value: "border-0", label: "0px", rawValue: "0" },
|
|
64
|
+
{ value: "border", label: "1px", rawValue: "1" },
|
|
65
|
+
{ value: "border-2", label: "2px", rawValue: "2" },
|
|
66
|
+
{ value: "border-4", label: "4px", rawValue: "4" },
|
|
67
|
+
{ value: "border-8", label: "8px", rawValue: "8" }
|
|
195
68
|
]
|
|
196
69
|
},
|
|
197
70
|
textAlign: {
|
|
198
71
|
type: "select",
|
|
199
72
|
options: [
|
|
200
|
-
{
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
value: "text-center",
|
|
207
|
-
label: "Center",
|
|
208
|
-
rawValue: "center"
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
value: "text-right",
|
|
212
|
-
label: "Right",
|
|
213
|
-
rawValue: "right"
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
value: "text-justify",
|
|
217
|
-
label: "Justify",
|
|
218
|
-
rawValue: "justify"
|
|
219
|
-
}
|
|
73
|
+
{ value: "text-left", label: "Left", rawValue: "left" },
|
|
74
|
+
{ value: "text-center", label: "Center", rawValue: "center" },
|
|
75
|
+
{ value: "text-right", label: "Right", rawValue: "right" },
|
|
76
|
+
{ value: "text-justify", label: "Justify", rawValue: "justify" }
|
|
220
77
|
]
|
|
221
78
|
},
|
|
222
79
|
padding: {
|
|
223
80
|
type: "spacing",
|
|
224
81
|
options: [
|
|
225
|
-
{
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
}
|
|
235
|
-
{
|
|
236
|
-
label: "8",
|
|
237
|
-
value: "8",
|
|
238
|
-
rawValue: "8"
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
label: "12",
|
|
242
|
-
value: "12",
|
|
243
|
-
rawValue: "12"
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
label: "16",
|
|
247
|
-
value: "16",
|
|
248
|
-
rawValue: "16"
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
label: "20",
|
|
252
|
-
value: "20",
|
|
253
|
-
rawValue: "20"
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
label: "24",
|
|
257
|
-
value: "24",
|
|
258
|
-
rawValue: "24"
|
|
259
|
-
},
|
|
260
|
-
{
|
|
261
|
-
label: "32",
|
|
262
|
-
value: "32",
|
|
263
|
-
rawValue: "32"
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
label: "36",
|
|
267
|
-
value: "36",
|
|
268
|
-
rawValue: "36"
|
|
269
|
-
},
|
|
270
|
-
{
|
|
271
|
-
label: "40",
|
|
272
|
-
value: "40",
|
|
273
|
-
rawValue: "40"
|
|
274
|
-
}
|
|
82
|
+
{ label: "0", value: "0", rawValue: "0" },
|
|
83
|
+
{ label: "4", value: "4", rawValue: "4" },
|
|
84
|
+
{ label: "8", value: "8", rawValue: "8" },
|
|
85
|
+
{ label: "12", value: "12", rawValue: "12" },
|
|
86
|
+
{ label: "16", value: "16", rawValue: "16" },
|
|
87
|
+
{ label: "20", value: "20", rawValue: "20" },
|
|
88
|
+
{ label: "24", value: "24", rawValue: "24" },
|
|
89
|
+
{ label: "32", value: "32", rawValue: "32" },
|
|
90
|
+
{ label: "36", value: "36", rawValue: "36" },
|
|
91
|
+
{ label: "40", value: "40", rawValue: "40" }
|
|
275
92
|
]
|
|
276
93
|
},
|
|
277
94
|
margin: {
|
|
278
95
|
type: "spacing",
|
|
279
96
|
options: [
|
|
280
|
-
{
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
},
|
|
285
|
-
{
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
}
|
|
290
|
-
{
|
|
291
|
-
label: "8",
|
|
292
|
-
value: "8",
|
|
293
|
-
rawValue: "8"
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
label: "12",
|
|
297
|
-
value: "12",
|
|
298
|
-
rawValue: "12"
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
label: "16",
|
|
302
|
-
value: "16",
|
|
303
|
-
rawValue: "16"
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
label: "20",
|
|
307
|
-
value: "20",
|
|
308
|
-
rawValue: "20"
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
label: "24",
|
|
312
|
-
value: "24",
|
|
313
|
-
rawValue: "24"
|
|
314
|
-
},
|
|
315
|
-
{
|
|
316
|
-
label: "32",
|
|
317
|
-
value: "32",
|
|
318
|
-
rawValue: "32"
|
|
319
|
-
},
|
|
320
|
-
{
|
|
321
|
-
label: "36",
|
|
322
|
-
value: "36",
|
|
323
|
-
rawValue: "36"
|
|
324
|
-
},
|
|
325
|
-
{
|
|
326
|
-
label: "40",
|
|
327
|
-
value: "40",
|
|
328
|
-
rawValue: "40"
|
|
329
|
-
}
|
|
97
|
+
{ label: "0", value: "0", rawValue: "0" },
|
|
98
|
+
{ label: "4", value: "4", rawValue: "4" },
|
|
99
|
+
{ label: "8", value: "8", rawValue: "8" },
|
|
100
|
+
{ label: "12", value: "12", rawValue: "12" },
|
|
101
|
+
{ label: "16", value: "16", rawValue: "16" },
|
|
102
|
+
{ label: "20", value: "20", rawValue: "20" },
|
|
103
|
+
{ label: "24", value: "24", rawValue: "24" },
|
|
104
|
+
{ label: "32", value: "32", rawValue: "32" },
|
|
105
|
+
{ label: "36", value: "36", rawValue: "36" },
|
|
106
|
+
{ label: "40", value: "40", rawValue: "40" }
|
|
330
107
|
]
|
|
331
108
|
},
|
|
332
109
|
color: {
|
|
333
110
|
type: "color-picker",
|
|
334
111
|
recommendColors: [
|
|
335
112
|
{
|
|
336
|
-
title: "
|
|
113
|
+
title: "\u4E2D\u6027\u8272",
|
|
337
114
|
options: [
|
|
338
115
|
{
|
|
339
116
|
value: "text-neutral-00",
|
|
@@ -427,7 +204,7 @@ export const defaultUIConfig = {
|
|
|
427
204
|
type: "color-picker",
|
|
428
205
|
recommendColors: [
|
|
429
206
|
{
|
|
430
|
-
title: "
|
|
207
|
+
title: "\u4E2D\u6027\u8272",
|
|
431
208
|
options: [
|
|
432
209
|
{
|
|
433
210
|
value: "bg-neutral-00",
|
|
@@ -521,7 +298,7 @@ export const defaultUIConfig = {
|
|
|
521
298
|
type: "color-picker",
|
|
522
299
|
recommendColors: [
|
|
523
300
|
{
|
|
524
|
-
title: "
|
|
301
|
+
title: "\u4E2D\u6027\u8272",
|
|
525
302
|
options: [
|
|
526
303
|
{
|
|
527
304
|
value: "border-neutral-00",
|
|
@@ -785,3 +562,6 @@ export const defaultUIConfig = {
|
|
|
785
562
|
"cyan-950": "#072b3d"
|
|
786
563
|
}
|
|
787
564
|
};
|
|
565
|
+
export {
|
|
566
|
+
defaultUIConfig
|
|
567
|
+
};
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import "../chunk-I4E63NIC.mjs";
|
|
2
|
+
import {
|
|
3
|
+
InitConfigMessage,
|
|
4
|
+
ClearSelectedMessage,
|
|
5
|
+
EditTextMessage,
|
|
6
|
+
EditStyleMessage,
|
|
7
|
+
EditClassNameMessage,
|
|
8
|
+
OutgoingMessage,
|
|
9
|
+
PageMountedMessage,
|
|
10
|
+
TextUpdateMessage,
|
|
11
|
+
SelectInspectorElementMessage,
|
|
12
|
+
IncomingMessage,
|
|
13
|
+
InspectorInfo
|
|
14
|
+
} from "./iframe-events";
|
|
15
|
+
export {
|
|
16
|
+
ClearSelectedMessage,
|
|
17
|
+
EditClassNameMessage,
|
|
18
|
+
EditStyleMessage,
|
|
19
|
+
EditTextMessage,
|
|
20
|
+
IncomingMessage,
|
|
21
|
+
InitConfigMessage,
|
|
22
|
+
InspectorInfo,
|
|
23
|
+
OutgoingMessage,
|
|
24
|
+
PageMountedMessage,
|
|
25
|
+
SelectInspectorElementMessage,
|
|
26
|
+
TextUpdateMessage
|
|
27
|
+
};
|
|
@@ -1,55 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
enumerable: true,
|
|
6
|
-
configurable: true,
|
|
7
|
-
writable: true
|
|
8
|
-
});
|
|
9
|
-
} else {
|
|
10
|
-
obj[key] = value;
|
|
11
|
-
}
|
|
12
|
-
return obj;
|
|
13
|
-
}
|
|
14
|
-
function _object_spread(target) {
|
|
15
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
16
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
-
var ownKeys2 = Object.keys(source);
|
|
18
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
-
ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
-
}));
|
|
22
|
-
}
|
|
23
|
-
ownKeys2.forEach(function(key) {
|
|
24
|
-
_define_property(target, key, source[key]);
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
return target;
|
|
28
|
-
}
|
|
29
|
-
function ownKeys(object, enumerableOnly) {
|
|
30
|
-
var keys = Object.keys(object);
|
|
31
|
-
if (Object.getOwnPropertySymbols) {
|
|
32
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
-
if (enumerableOnly) {
|
|
34
|
-
symbols = symbols.filter(function(sym) {
|
|
35
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
keys.push.apply(keys, symbols);
|
|
39
|
-
}
|
|
40
|
-
return keys;
|
|
41
|
-
}
|
|
42
|
-
function _object_spread_props(target, source) {
|
|
43
|
-
source = source != null ? source : {};
|
|
44
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
-
} else {
|
|
47
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
return target;
|
|
52
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
__spreadProps,
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "../chunk-I4E63NIC.mjs";
|
|
53
5
|
function getColorStyleCalculationConfig(config, propertyName) {
|
|
54
6
|
const prefixMap = {
|
|
55
7
|
color: "text",
|
|
@@ -93,13 +45,15 @@ function getColorStyleCalculationConfig(config, propertyName) {
|
|
|
93
45
|
transformValue: (value) => value.toLowerCase()
|
|
94
46
|
};
|
|
95
47
|
}
|
|
96
|
-
|
|
48
|
+
function getStyleCalculationConfig(config, propertyName) {
|
|
97
49
|
const uiComponent = config.common[propertyName];
|
|
98
50
|
if (uiComponent.type === "color-picker") {
|
|
99
51
|
return getColorStyleCalculationConfig(config, propertyName);
|
|
100
52
|
}
|
|
101
53
|
if (uiComponent.type !== "select" && uiComponent.type !== "spacing") {
|
|
102
|
-
throw new Error(
|
|
54
|
+
throw new Error(
|
|
55
|
+
`Unsupported UI component type: ${uiComponent.type} for property: ${propertyName}`
|
|
56
|
+
);
|
|
103
57
|
}
|
|
104
58
|
const map = {};
|
|
105
59
|
for (const option of uiComponent.options) {
|
|
@@ -149,11 +103,11 @@ export function getStyleCalculationConfig(config, propertyName) {
|
|
|
149
103
|
if (!baseConfig) {
|
|
150
104
|
throw new Error(`Unknown property: ${propertyName}`);
|
|
151
105
|
}
|
|
152
|
-
return
|
|
106
|
+
return __spreadProps(__spreadValues({}, baseConfig), {
|
|
153
107
|
map
|
|
154
108
|
});
|
|
155
109
|
}
|
|
156
|
-
|
|
110
|
+
function getAllStyleConfigs(config) {
|
|
157
111
|
const result = {};
|
|
158
112
|
const keys = Object.keys(config.common);
|
|
159
113
|
for (const key of keys) {
|
|
@@ -161,3 +115,7 @@ export function getAllStyleConfigs(config) {
|
|
|
161
115
|
}
|
|
162
116
|
return result;
|
|
163
117
|
}
|
|
118
|
+
export {
|
|
119
|
+
getAllStyleConfigs,
|
|
120
|
+
getStyleCalculationConfig
|
|
121
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import "../chunk-I4E63NIC.mjs";
|
|
2
|
+
import {
|
|
3
|
+
getPreviewParentOrigin,
|
|
4
|
+
postMessage,
|
|
5
|
+
isIncomingMessage,
|
|
6
|
+
isOutgoingMessage
|
|
7
|
+
} from "./origin";
|
|
8
|
+
import { cx } from "./css";
|
|
9
|
+
import {
|
|
10
|
+
calculateFontSizeInfo,
|
|
11
|
+
calculateFontWeightInfo,
|
|
12
|
+
calculateBorderRadiusInfo,
|
|
13
|
+
calculateBorderWidthInfo,
|
|
14
|
+
calculateTextAlignInfo,
|
|
15
|
+
calculatePaddingInfo,
|
|
16
|
+
calculateMarginInfo,
|
|
17
|
+
calculateColorInfo,
|
|
18
|
+
calculateBackgroundColorInfo,
|
|
19
|
+
calculateBorderColorInfo
|
|
20
|
+
} from "./style-calculator";
|
|
21
|
+
export {
|
|
22
|
+
calculateBackgroundColorInfo,
|
|
23
|
+
calculateBorderColorInfo,
|
|
24
|
+
calculateBorderRadiusInfo,
|
|
25
|
+
calculateBorderWidthInfo,
|
|
26
|
+
calculateColorInfo,
|
|
27
|
+
calculateFontSizeInfo,
|
|
28
|
+
calculateFontWeightInfo,
|
|
29
|
+
calculateMarginInfo,
|
|
30
|
+
calculatePaddingInfo,
|
|
31
|
+
calculateTextAlignInfo,
|
|
32
|
+
cx,
|
|
33
|
+
getPreviewParentOrigin,
|
|
34
|
+
isIncomingMessage,
|
|
35
|
+
isOutgoingMessage,
|
|
36
|
+
postMessage
|
|
37
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import "../chunk-I4E63NIC.mjs";
|
|
2
|
+
function getPreviewParentOrigin() {
|
|
3
|
+
const { origin } = window.location;
|
|
4
|
+
if (origin.includes("feishuapp.cn")) {
|
|
5
|
+
return "https://miaoda.feishu.cn";
|
|
6
|
+
}
|
|
7
|
+
if (origin.includes("fsapp.kundou.cn")) {
|
|
8
|
+
return "https://miaoda.feishu-pre.cn";
|
|
9
|
+
}
|
|
10
|
+
return "https://miaoda.feishu-boe.cn";
|
|
11
|
+
}
|
|
12
|
+
function postMessage(message, targetOrigin) {
|
|
13
|
+
window.parent.postMessage(message, targetOrigin != null ? targetOrigin : getPreviewParentOrigin());
|
|
14
|
+
}
|
|
15
|
+
function isOutgoingMessage(msg, type) {
|
|
16
|
+
return msg.type === type;
|
|
17
|
+
}
|
|
18
|
+
function isIncomingMessage(msg, type) {
|
|
19
|
+
return msg.type === type;
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
getPreviewParentOrigin,
|
|
23
|
+
isIncomingMessage,
|
|
24
|
+
isOutgoingMessage,
|
|
25
|
+
postMessage
|
|
26
|
+
};
|