@lark-apaas/miaoda-inspector 0.1.0-alpha.1 → 0.1.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 (88) hide show
  1. package/dist/es/Inspector/{Inspector.js → Inspector.mjs} +50 -55
  2. package/dist/es/Inspector/{Overlay.js → Overlay.mjs} +157 -125
  3. package/dist/es/Inspector/hooks/use-effect-event.mjs +17 -0
  4. package/dist/es/Inspector/hooks/use-layout-effect.mjs +9 -0
  5. package/dist/es/Inspector/hooks/{use-mouse.js → use-mouse.mjs} +8 -4
  6. package/dist/es/Inspector/index.mjs +5 -0
  7. package/dist/es/Inspector/utils/fiber.mjs +70 -0
  8. package/dist/es/Inspector/utils/highlight.mjs +78 -0
  9. package/dist/es/Inspector/utils/inspect.mjs +131 -0
  10. package/dist/es/Inspector/utils/{overlay.js → overlay.mjs} +7 -2
  11. package/dist/es/MiaodaInspector/MiaodaInspector.mjs +427 -0
  12. package/dist/es/MiaodaInspector/index.mjs +5 -0
  13. package/dist/es/chunk-I4E63NIC.mjs +24 -0
  14. package/dist/es/config/{ui-config.js → ui-config.mjs} +66 -286
  15. package/dist/es/global.d.mjs +0 -0
  16. package/dist/es/index.mjs +7 -0
  17. package/dist/es/types/iframe-events.mjs +0 -0
  18. package/dist/es/types/index.mjs +27 -0
  19. package/dist/es/utils/{config-mapper.js → config-mapper.mjs} +14 -56
  20. package/dist/es/utils/{css.js → css.mjs} +5 -1
  21. package/dist/es/utils/index.mjs +37 -0
  22. package/dist/es/utils/origin.mjs +26 -0
  23. package/dist/es/utils/style-calculator.mjs +177 -0
  24. package/dist/lib/Inspector/Inspector.js +99 -104
  25. package/dist/lib/Inspector/Overlay.js +172 -143
  26. package/dist/lib/Inspector/hooks/index.js +19 -19
  27. package/dist/lib/Inspector/hooks/use-effect-event.js +26 -15
  28. package/dist/lib/Inspector/hooks/use-layout-effect.js +25 -10
  29. package/dist/lib/Inspector/hooks/use-mouse.js +27 -14
  30. package/dist/lib/Inspector/index.js +21 -8
  31. package/dist/lib/Inspector/utils/fiber.js +49 -55
  32. package/dist/lib/Inspector/utils/highlight.js +44 -31
  33. package/dist/lib/Inspector/utils/index.js +19 -19
  34. package/dist/lib/Inspector/utils/inspect.js +62 -72
  35. package/dist/lib/Inspector/utils/overlay.js +20 -15
  36. package/dist/lib/MiaodaInspector/MiaodaInspector.js +265 -266
  37. package/dist/lib/MiaodaInspector/index.js +21 -8
  38. package/dist/lib/config/ui-config.js +81 -292
  39. package/dist/lib/global.d.js +1 -0
  40. package/dist/lib/index.js +22 -17
  41. package/dist/lib/types/iframe-events.js +15 -3
  42. package/dist/lib/types/index.js +30 -43
  43. package/dist/lib/utils/config-mapper.js +41 -69
  44. package/dist/lib/utils/css.js +33 -15
  45. package/dist/lib/utils/index.js +36 -57
  46. package/dist/lib/utils/origin.js +23 -22
  47. package/dist/lib/utils/style-calculator.js +113 -110
  48. package/dist/types/Inspector/Inspector.d.ts +95 -92
  49. package/dist/types/Inspector/Overlay.d.ts +61 -58
  50. package/dist/types/Inspector/hooks/index.d.ts +4 -3
  51. package/dist/types/Inspector/hooks/use-effect-event.d.ts +3 -1
  52. package/dist/types/Inspector/hooks/use-layout-effect.d.ts +5 -2
  53. package/dist/types/Inspector/hooks/use-mouse.d.ts +9 -8
  54. package/dist/types/Inspector/index.d.ts +4 -1
  55. package/dist/types/Inspector/utils/fiber.d.ts +12 -10
  56. package/dist/types/Inspector/utils/highlight.d.ts +7 -5
  57. package/dist/types/Inspector/utils/index.d.ts +4 -3
  58. package/dist/types/Inspector/utils/inspect.d.ts +45 -42
  59. package/dist/types/Inspector/utils/overlay.d.ts +24 -22
  60. package/dist/types/MiaodaInspector/MiaodaInspector.d.ts +42 -41
  61. package/dist/types/MiaodaInspector/index.d.ts +3 -1
  62. package/dist/types/config/ui-config.d.ts +42 -41
  63. package/dist/types/global.d.d.ts +17 -0
  64. package/dist/types/index.d.ts +5 -4
  65. package/dist/types/types/iframe-events.d.ts +133 -130
  66. package/dist/types/types/index.d.ts +2 -1
  67. package/dist/types/utils/config-mapper.d.ts +14 -11
  68. package/dist/types/utils/css.d.ts +5 -2
  69. package/dist/types/utils/index.d.ts +7 -3
  70. package/dist/types/utils/origin.d.ts +12 -8
  71. package/dist/types/utils/style-calculator.d.ts +20 -17
  72. package/package.json +13 -13
  73. package/dist/es/Inspector/hooks/use-effect-event.js +0 -15
  74. package/dist/es/Inspector/hooks/use-layout-effect.js +0 -3
  75. package/dist/es/Inspector/index.js +0 -1
  76. package/dist/es/Inspector/utils/fiber.js +0 -61
  77. package/dist/es/Inspector/utils/highlight.js +0 -74
  78. package/dist/es/Inspector/utils/inspect.js +0 -119
  79. package/dist/es/MiaodaInspector/MiaodaInspector.js +0 -397
  80. package/dist/es/MiaodaInspector/index.js +0 -1
  81. package/dist/es/index.js +0 -2
  82. package/dist/es/types/iframe-events.js +0 -1
  83. package/dist/es/types/index.js +0 -1
  84. package/dist/es/utils/index.js +0 -3
  85. package/dist/es/utils/origin.js +0 -19
  86. package/dist/es/utils/style-calculator.js +0 -158
  87. /package/dist/es/Inspector/hooks/{index.js → index.mjs} +0 -0
  88. /package/dist/es/Inspector/utils/{index.js → index.mjs} +0 -0
@@ -1,339 +1,116 @@
1
- export const defaultUIConfig = {
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
- value: "text-xs",
9
- label: "xs(12px)",
10
- rawValue: "12"
11
- },
12
- {
13
- value: "text-sm",
14
- label: "sm(14px)",
15
- rawValue: "14"
16
- },
17
- {
18
- value: "text-base",
19
- label: "base(16px)",
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: "极轻(Extra Light",
29
+ label: "\u6781\u8F7B\uFF08Extra Light\uFF09",
85
30
  rawValue: "200"
86
31
  },
87
- {
88
- value: "font-light",
89
- label: "轻(Light)",
90
- rawValue: "300"
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: "极粗(Extra Bold",
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
- value: "rounded-none",
129
- label: "none(0px)",
130
- rawValue: "0"
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
- value: "border-0",
172
- label: "0px",
173
- rawValue: "0"
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
- value: "text-left",
202
- label: "Left",
203
- rawValue: "left"
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
- label: "0",
227
- value: "0",
228
- rawValue: "0"
229
- },
230
- {
231
- label: "4",
232
- value: "4",
233
- rawValue: "4"
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
- label: "0",
282
- value: "0",
283
- rawValue: "0"
284
- },
285
- {
286
- label: "4",
287
- value: "4",
288
- rawValue: "4"
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
@@ -0,0 +1,7 @@
1
+ import "./chunk-I4E63NIC.mjs";
2
+ import { MiaodaInspector } from "./MiaodaInspector";
3
+ import { isOutgoingMessage } from "./utils";
4
+ export {
5
+ MiaodaInspector,
6
+ isOutgoingMessage
7
+ };
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
- function _define_property(obj, key, value) {
2
- if (key in obj) {
3
- Object.defineProperty(obj, key, {
4
- value,
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
- export function getStyleCalculationConfig(config, propertyName) {
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(`Unsupported UI component type: ${uiComponent.type} for property: ${propertyName}`);
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 _object_spread_props(_object_spread({}, baseConfig), {
106
+ return __spreadProps(__spreadValues({}, baseConfig), {
153
107
  map
154
108
  });
155
109
  }
156
- export function getAllStyleConfigs(config) {
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
+ };
@@ -1,5 +1,9 @@
1
+ import "../chunk-I4E63NIC.mjs";
1
2
  import clsx from "clsx";
2
3
  import { twMerge } from "tailwind-merge";
3
- export function cx(...args) {
4
+ function cx(...args) {
4
5
  return twMerge(clsx(...args));
5
6
  }
7
+ export {
8
+ cx
9
+ };
@@ -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
+ };