@webstudio-is/react-sdk 0.82.0 → 0.84.0
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/LICENSE +661 -21
- package/lib/cjs/component-renderer.js +125 -0
- package/lib/cjs/components/component-meta.js +10 -0
- package/lib/cjs/components/components-utils.js +1 -0
- package/lib/cjs/context.js +2 -1
- package/lib/cjs/css/index.js +0 -1
- package/lib/cjs/css/style-rules.js +1 -1
- package/lib/cjs/embed-template.js +130 -55
- package/lib/cjs/expression.js +47 -4
- package/lib/cjs/hook.js +34 -0
- package/lib/cjs/index.js +7 -0
- package/lib/cjs/instance-utils.js +65 -0
- package/lib/cjs/props.js +18 -3
- package/lib/cjs/tree/create-elements-tree.js +5 -4
- package/lib/cjs/tree/root.js +7 -2
- package/lib/cjs/tree/webstudio-component.js +26 -10
- package/lib/component-renderer.js +111 -0
- package/lib/components/component-meta.js +10 -0
- package/lib/components/components-utils.js +1 -0
- package/lib/context.js +2 -1
- package/lib/css/index.js +0 -1
- package/lib/css/style-rules.js +1 -1
- package/lib/embed-template.js +138 -55
- package/lib/expression.js +47 -4
- package/lib/hook.js +14 -0
- package/lib/index.js +10 -1
- package/lib/instance-utils.js +45 -0
- package/lib/props.js +19 -4
- package/lib/tree/create-elements-tree.js +8 -5
- package/lib/tree/root.js +14 -4
- package/lib/tree/webstudio-component.js +27 -11
- package/lib/types/app/root.d.ts +1 -2
- package/lib/types/component-renderer.d.ts +8 -0
- package/lib/types/components/component-meta.d.ts +14 -8
- package/lib/types/context.d.ts +3 -1
- package/lib/types/css/css.d.ts +19 -19
- package/lib/types/css/global-rules.d.ts +19 -19
- package/lib/types/css/index.d.ts +0 -1
- package/lib/types/css/normalize.d.ts +47 -47
- package/lib/types/embed-template.d.ts +297 -174
- package/lib/types/expression.d.ts +3 -2
- package/lib/types/hook.d.ts +31 -0
- package/lib/types/index.d.ts +5 -2
- package/lib/types/instance-utils.d.ts +16 -0
- package/lib/types/instance-utils.test.d.ts +1 -0
- package/lib/types/props.d.ts +48 -46
- package/lib/types/tree/create-elements-tree.d.ts +9 -6
- package/lib/types/tree/root.d.ts +8 -5
- package/lib/types/tree/webstudio-component.d.ts +16 -7
- package/package.json +18 -19
- package/src/component-renderer.tsx +117 -0
- package/src/components/component-meta.ts +10 -0
- package/src/context.tsx +4 -0
- package/src/css/index.ts +0 -1
- package/src/css/style-rules.ts +1 -1
- package/src/embed-template.test.ts +113 -26
- package/src/embed-template.ts +149 -56
- package/src/expression.test.ts +74 -6
- package/src/expression.ts +55 -2
- package/src/hook.ts +42 -0
- package/src/index.ts +5 -0
- package/src/instance-utils.test.ts +89 -0
- package/src/instance-utils.ts +65 -0
- package/src/props.ts +19 -2
- package/src/tree/create-elements-tree.tsx +25 -8
- package/src/tree/root.ts +22 -3
- package/src/tree/webstudio-component.tsx +42 -14
- package/lib/cjs/css/get-browser-style.js +0 -83
- package/lib/css/get-browser-style.js +0 -65
- package/lib/types/css/get-browser-style.d.ts +0 -2
- package/src/css/get-browser-style.ts +0 -81
|
@@ -2,6 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import { Breakpoint } from "@webstudio-is/project-build";
|
|
3
3
|
import { type StyleProperty } from "@webstudio-is/css-data";
|
|
4
4
|
import type { Simplify } from "type-fest";
|
|
5
|
+
import type { WsComponentMeta } from "./components/component-meta";
|
|
5
6
|
declare const EmbedTemplateText: z.ZodObject<{
|
|
6
7
|
type: z.ZodLiteral<"text">;
|
|
7
8
|
value: z.ZodString;
|
|
@@ -13,233 +14,118 @@ declare const EmbedTemplateText: z.ZodObject<{
|
|
|
13
14
|
value: string;
|
|
14
15
|
}>;
|
|
15
16
|
type EmbedTemplateText = z.infer<typeof EmbedTemplateText>;
|
|
17
|
+
declare const EmbedTemplateDataSource: z.ZodUnion<[z.ZodObject<{
|
|
18
|
+
type: z.ZodLiteral<"variable">;
|
|
19
|
+
initialValue: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString, "many">]>;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
type: "variable";
|
|
22
|
+
initialValue: (string | number | boolean | string[]) & (string | number | boolean | string[] | undefined);
|
|
23
|
+
}, {
|
|
24
|
+
type: "variable";
|
|
25
|
+
initialValue: (string | number | boolean | string[]) & (string | number | boolean | string[] | undefined);
|
|
26
|
+
}>, z.ZodObject<{
|
|
27
|
+
type: z.ZodLiteral<"expression">;
|
|
28
|
+
code: z.ZodString;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
code: string;
|
|
31
|
+
type: "expression";
|
|
32
|
+
}, {
|
|
33
|
+
code: string;
|
|
34
|
+
type: "expression";
|
|
35
|
+
}>]>;
|
|
36
|
+
type EmbedTemplateDataSource = z.infer<typeof EmbedTemplateDataSource>;
|
|
16
37
|
declare const EmbedTemplateProp: z.ZodUnion<[z.ZodObject<{
|
|
38
|
+
type: z.ZodLiteral<"dataSource">;
|
|
39
|
+
name: z.ZodString;
|
|
40
|
+
dataSourceName: z.ZodString;
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
type: "dataSource";
|
|
43
|
+
name: string;
|
|
44
|
+
dataSourceName: string;
|
|
45
|
+
}, {
|
|
46
|
+
type: "dataSource";
|
|
47
|
+
name: string;
|
|
48
|
+
dataSourceName: string;
|
|
49
|
+
}>, z.ZodObject<{
|
|
17
50
|
type: z.ZodLiteral<"number">;
|
|
18
51
|
name: z.ZodString;
|
|
19
|
-
dataSourceRef: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
20
|
-
type: z.ZodLiteral<"variable">;
|
|
21
|
-
name: z.ZodString;
|
|
22
|
-
}, "strip", z.ZodTypeAny, {
|
|
23
|
-
name: string;
|
|
24
|
-
type: "variable";
|
|
25
|
-
}, {
|
|
26
|
-
name: string;
|
|
27
|
-
type: "variable";
|
|
28
|
-
}>, z.ZodObject<{
|
|
29
|
-
type: z.ZodLiteral<"expression">;
|
|
30
|
-
name: z.ZodString;
|
|
31
|
-
code: z.ZodString;
|
|
32
|
-
}, "strip", z.ZodTypeAny, {
|
|
33
|
-
name: string;
|
|
34
|
-
code: string;
|
|
35
|
-
type: "expression";
|
|
36
|
-
}, {
|
|
37
|
-
name: string;
|
|
38
|
-
code: string;
|
|
39
|
-
type: "expression";
|
|
40
|
-
}>]>>;
|
|
41
52
|
value: z.ZodNumber;
|
|
42
53
|
}, "strip", z.ZodTypeAny, {
|
|
43
|
-
name: string;
|
|
44
54
|
type: "number";
|
|
45
55
|
value: number;
|
|
46
|
-
dataSourceRef?: {
|
|
47
|
-
name: string;
|
|
48
|
-
type: "variable";
|
|
49
|
-
} | {
|
|
50
|
-
name: string;
|
|
51
|
-
code: string;
|
|
52
|
-
type: "expression";
|
|
53
|
-
} | undefined;
|
|
54
|
-
}, {
|
|
55
56
|
name: string;
|
|
57
|
+
}, {
|
|
56
58
|
type: "number";
|
|
57
59
|
value: number;
|
|
58
|
-
|
|
59
|
-
name: string;
|
|
60
|
-
type: "variable";
|
|
61
|
-
} | {
|
|
62
|
-
name: string;
|
|
63
|
-
code: string;
|
|
64
|
-
type: "expression";
|
|
65
|
-
} | undefined;
|
|
60
|
+
name: string;
|
|
66
61
|
}>, z.ZodObject<{
|
|
67
62
|
type: z.ZodLiteral<"string">;
|
|
68
63
|
name: z.ZodString;
|
|
69
|
-
dataSourceRef: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
70
|
-
type: z.ZodLiteral<"variable">;
|
|
71
|
-
name: z.ZodString;
|
|
72
|
-
}, "strip", z.ZodTypeAny, {
|
|
73
|
-
name: string;
|
|
74
|
-
type: "variable";
|
|
75
|
-
}, {
|
|
76
|
-
name: string;
|
|
77
|
-
type: "variable";
|
|
78
|
-
}>, z.ZodObject<{
|
|
79
|
-
type: z.ZodLiteral<"expression">;
|
|
80
|
-
name: z.ZodString;
|
|
81
|
-
code: z.ZodString;
|
|
82
|
-
}, "strip", z.ZodTypeAny, {
|
|
83
|
-
name: string;
|
|
84
|
-
code: string;
|
|
85
|
-
type: "expression";
|
|
86
|
-
}, {
|
|
87
|
-
name: string;
|
|
88
|
-
code: string;
|
|
89
|
-
type: "expression";
|
|
90
|
-
}>]>>;
|
|
91
64
|
value: z.ZodString;
|
|
92
65
|
}, "strip", z.ZodTypeAny, {
|
|
93
|
-
name: string;
|
|
94
66
|
type: "string";
|
|
95
67
|
value: string;
|
|
96
|
-
dataSourceRef?: {
|
|
97
|
-
name: string;
|
|
98
|
-
type: "variable";
|
|
99
|
-
} | {
|
|
100
|
-
name: string;
|
|
101
|
-
code: string;
|
|
102
|
-
type: "expression";
|
|
103
|
-
} | undefined;
|
|
104
|
-
}, {
|
|
105
68
|
name: string;
|
|
69
|
+
}, {
|
|
106
70
|
type: "string";
|
|
107
71
|
value: string;
|
|
108
|
-
|
|
109
|
-
name: string;
|
|
110
|
-
type: "variable";
|
|
111
|
-
} | {
|
|
112
|
-
name: string;
|
|
113
|
-
code: string;
|
|
114
|
-
type: "expression";
|
|
115
|
-
} | undefined;
|
|
72
|
+
name: string;
|
|
116
73
|
}>, z.ZodObject<{
|
|
117
74
|
type: z.ZodLiteral<"boolean">;
|
|
118
75
|
name: z.ZodString;
|
|
119
|
-
dataSourceRef: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
120
|
-
type: z.ZodLiteral<"variable">;
|
|
121
|
-
name: z.ZodString;
|
|
122
|
-
}, "strip", z.ZodTypeAny, {
|
|
123
|
-
name: string;
|
|
124
|
-
type: "variable";
|
|
125
|
-
}, {
|
|
126
|
-
name: string;
|
|
127
|
-
type: "variable";
|
|
128
|
-
}>, z.ZodObject<{
|
|
129
|
-
type: z.ZodLiteral<"expression">;
|
|
130
|
-
name: z.ZodString;
|
|
131
|
-
code: z.ZodString;
|
|
132
|
-
}, "strip", z.ZodTypeAny, {
|
|
133
|
-
name: string;
|
|
134
|
-
code: string;
|
|
135
|
-
type: "expression";
|
|
136
|
-
}, {
|
|
137
|
-
name: string;
|
|
138
|
-
code: string;
|
|
139
|
-
type: "expression";
|
|
140
|
-
}>]>>;
|
|
141
76
|
value: z.ZodBoolean;
|
|
142
77
|
}, "strip", z.ZodTypeAny, {
|
|
143
|
-
name: string;
|
|
144
78
|
type: "boolean";
|
|
145
79
|
value: boolean;
|
|
146
|
-
dataSourceRef?: {
|
|
147
|
-
name: string;
|
|
148
|
-
type: "variable";
|
|
149
|
-
} | {
|
|
150
|
-
name: string;
|
|
151
|
-
code: string;
|
|
152
|
-
type: "expression";
|
|
153
|
-
} | undefined;
|
|
154
|
-
}, {
|
|
155
80
|
name: string;
|
|
81
|
+
}, {
|
|
156
82
|
type: "boolean";
|
|
157
83
|
value: boolean;
|
|
158
|
-
|
|
159
|
-
name: string;
|
|
160
|
-
type: "variable";
|
|
161
|
-
} | {
|
|
162
|
-
name: string;
|
|
163
|
-
code: string;
|
|
164
|
-
type: "expression";
|
|
165
|
-
} | undefined;
|
|
84
|
+
name: string;
|
|
166
85
|
}>, z.ZodObject<{
|
|
167
86
|
type: z.ZodLiteral<"string[]">;
|
|
168
87
|
name: z.ZodString;
|
|
169
|
-
dataSourceRef: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
170
|
-
type: z.ZodLiteral<"variable">;
|
|
171
|
-
name: z.ZodString;
|
|
172
|
-
}, "strip", z.ZodTypeAny, {
|
|
173
|
-
name: string;
|
|
174
|
-
type: "variable";
|
|
175
|
-
}, {
|
|
176
|
-
name: string;
|
|
177
|
-
type: "variable";
|
|
178
|
-
}>, z.ZodObject<{
|
|
179
|
-
type: z.ZodLiteral<"expression">;
|
|
180
|
-
name: z.ZodString;
|
|
181
|
-
code: z.ZodString;
|
|
182
|
-
}, "strip", z.ZodTypeAny, {
|
|
183
|
-
name: string;
|
|
184
|
-
code: string;
|
|
185
|
-
type: "expression";
|
|
186
|
-
}, {
|
|
187
|
-
name: string;
|
|
188
|
-
code: string;
|
|
189
|
-
type: "expression";
|
|
190
|
-
}>]>>;
|
|
191
88
|
value: z.ZodArray<z.ZodString, "many">;
|
|
192
89
|
}, "strip", z.ZodTypeAny, {
|
|
193
|
-
name: string;
|
|
194
90
|
type: "string[]";
|
|
195
91
|
value: string[];
|
|
196
|
-
dataSourceRef?: {
|
|
197
|
-
name: string;
|
|
198
|
-
type: "variable";
|
|
199
|
-
} | {
|
|
200
|
-
name: string;
|
|
201
|
-
code: string;
|
|
202
|
-
type: "expression";
|
|
203
|
-
} | undefined;
|
|
204
|
-
}, {
|
|
205
92
|
name: string;
|
|
93
|
+
}, {
|
|
206
94
|
type: "string[]";
|
|
207
95
|
value: string[];
|
|
208
|
-
|
|
209
|
-
name: string;
|
|
210
|
-
type: "variable";
|
|
211
|
-
} | {
|
|
212
|
-
name: string;
|
|
213
|
-
code: string;
|
|
214
|
-
type: "expression";
|
|
215
|
-
} | undefined;
|
|
96
|
+
name: string;
|
|
216
97
|
}>, z.ZodObject<{
|
|
217
98
|
type: z.ZodLiteral<"action">;
|
|
218
99
|
name: z.ZodString;
|
|
219
100
|
value: z.ZodArray<z.ZodObject<{
|
|
220
101
|
type: z.ZodLiteral<"execute">;
|
|
102
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
221
103
|
code: z.ZodString;
|
|
222
104
|
}, "strip", z.ZodTypeAny, {
|
|
223
105
|
code: string;
|
|
224
106
|
type: "execute";
|
|
107
|
+
args?: string[] | undefined;
|
|
225
108
|
}, {
|
|
226
109
|
code: string;
|
|
227
110
|
type: "execute";
|
|
111
|
+
args?: string[] | undefined;
|
|
228
112
|
}>, "many">;
|
|
229
113
|
}, "strip", z.ZodTypeAny, {
|
|
230
|
-
name: string;
|
|
231
114
|
type: "action";
|
|
232
115
|
value: {
|
|
233
116
|
code: string;
|
|
234
117
|
type: "execute";
|
|
118
|
+
args?: string[] | undefined;
|
|
235
119
|
}[];
|
|
236
|
-
}, {
|
|
237
120
|
name: string;
|
|
121
|
+
}, {
|
|
238
122
|
type: "action";
|
|
239
123
|
value: {
|
|
240
124
|
code: string;
|
|
241
125
|
type: "execute";
|
|
126
|
+
args?: string[] | undefined;
|
|
242
127
|
}[];
|
|
128
|
+
name: string;
|
|
243
129
|
}>]>;
|
|
244
130
|
type EmbedTemplateProp = z.infer<typeof EmbedTemplateProp>;
|
|
245
131
|
declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
|
|
@@ -2289,6 +2175,7 @@ export type EmbedTemplateInstance = {
|
|
|
2289
2175
|
type: "instance";
|
|
2290
2176
|
component: string;
|
|
2291
2177
|
label?: string;
|
|
2178
|
+
dataSources?: Record<string, EmbedTemplateDataSource>;
|
|
2292
2179
|
props?: EmbedTemplateProp[];
|
|
2293
2180
|
styles?: EmbedTemplateStyleDecl[];
|
|
2294
2181
|
children: Array<EmbedTemplateInstance | EmbedTemplateText>;
|
|
@@ -2330,35 +2217,34 @@ export declare const generateDataFromEmbedTemplate: (treeTemplate: ({
|
|
|
2330
2217
|
label?: string | undefined;
|
|
2331
2218
|
}[];
|
|
2332
2219
|
props: ({
|
|
2333
|
-
name: string;
|
|
2334
2220
|
type: "number";
|
|
2335
2221
|
value: number;
|
|
2336
2222
|
id: string;
|
|
2223
|
+
name: string;
|
|
2337
2224
|
instanceId: string;
|
|
2338
2225
|
required?: boolean | undefined;
|
|
2339
2226
|
} | {
|
|
2340
|
-
name: string;
|
|
2341
2227
|
type: "string";
|
|
2342
2228
|
value: string;
|
|
2343
2229
|
id: string;
|
|
2230
|
+
name: string;
|
|
2344
2231
|
instanceId: string;
|
|
2345
2232
|
required?: boolean | undefined;
|
|
2346
2233
|
} | {
|
|
2347
|
-
name: string;
|
|
2348
2234
|
type: "boolean";
|
|
2349
2235
|
value: boolean;
|
|
2350
2236
|
id: string;
|
|
2237
|
+
name: string;
|
|
2351
2238
|
instanceId: string;
|
|
2352
2239
|
required?: boolean | undefined;
|
|
2353
2240
|
} | {
|
|
2354
|
-
name: string;
|
|
2355
2241
|
type: "asset";
|
|
2356
2242
|
value: string;
|
|
2357
2243
|
id: string;
|
|
2244
|
+
name: string;
|
|
2358
2245
|
instanceId: string;
|
|
2359
2246
|
required?: boolean | undefined;
|
|
2360
2247
|
} | {
|
|
2361
|
-
name: string;
|
|
2362
2248
|
type: "page";
|
|
2363
2249
|
value: (string | {
|
|
2364
2250
|
instanceId: string;
|
|
@@ -2368,35 +2254,36 @@ export declare const generateDataFromEmbedTemplate: (treeTemplate: ({
|
|
|
2368
2254
|
pageId: string;
|
|
2369
2255
|
} | undefined);
|
|
2370
2256
|
id: string;
|
|
2257
|
+
name: string;
|
|
2371
2258
|
instanceId: string;
|
|
2372
2259
|
required?: boolean | undefined;
|
|
2373
2260
|
} | {
|
|
2374
|
-
name: string;
|
|
2375
2261
|
type: "string[]";
|
|
2376
2262
|
value: string[];
|
|
2377
2263
|
id: string;
|
|
2264
|
+
name: string;
|
|
2378
2265
|
instanceId: string;
|
|
2379
2266
|
required?: boolean | undefined;
|
|
2380
2267
|
} | {
|
|
2381
|
-
name: string;
|
|
2382
2268
|
type: "dataSource";
|
|
2383
2269
|
value: string;
|
|
2384
2270
|
id: string;
|
|
2271
|
+
name: string;
|
|
2385
2272
|
instanceId: string;
|
|
2386
2273
|
required?: boolean | undefined;
|
|
2387
2274
|
} | {
|
|
2388
|
-
name: string;
|
|
2389
2275
|
type: "action";
|
|
2390
2276
|
value: {
|
|
2391
2277
|
code: string;
|
|
2392
2278
|
type: "execute";
|
|
2279
|
+
args: string[];
|
|
2393
2280
|
}[];
|
|
2394
2281
|
id: string;
|
|
2282
|
+
name: string;
|
|
2395
2283
|
instanceId: string;
|
|
2396
2284
|
required?: boolean | undefined;
|
|
2397
2285
|
})[];
|
|
2398
2286
|
dataSources: ({
|
|
2399
|
-
name: string;
|
|
2400
2287
|
type: "variable";
|
|
2401
2288
|
value: {
|
|
2402
2289
|
type: "number";
|
|
@@ -2412,12 +2299,13 @@ export declare const generateDataFromEmbedTemplate: (treeTemplate: ({
|
|
|
2412
2299
|
value: string[];
|
|
2413
2300
|
};
|
|
2414
2301
|
id: string;
|
|
2302
|
+
name: string;
|
|
2415
2303
|
scopeInstanceId?: string | undefined;
|
|
2416
2304
|
} | {
|
|
2417
|
-
name: string;
|
|
2418
2305
|
code: string;
|
|
2419
2306
|
type: "expression";
|
|
2420
2307
|
id: string;
|
|
2308
|
+
name: string;
|
|
2421
2309
|
scopeInstanceId?: string | undefined;
|
|
2422
2310
|
})[];
|
|
2423
2311
|
styleSourceSelections: {
|
|
@@ -2425,9 +2313,9 @@ export declare const generateDataFromEmbedTemplate: (treeTemplate: ({
|
|
|
2425
2313
|
instanceId: string;
|
|
2426
2314
|
}[];
|
|
2427
2315
|
styleSources: ({
|
|
2428
|
-
name: string;
|
|
2429
2316
|
type: "token";
|
|
2430
2317
|
id: string;
|
|
2318
|
+
name: string;
|
|
2431
2319
|
} | {
|
|
2432
2320
|
type: "local";
|
|
2433
2321
|
id: string;
|
|
@@ -2645,8 +2533,243 @@ export declare const generateDataFromEmbedTemplate: (treeTemplate: ({
|
|
|
2645
2533
|
styleSourceId: string;
|
|
2646
2534
|
breakpointId: string;
|
|
2647
2535
|
state?: string | undefined;
|
|
2648
|
-
property: "filter" | "float" | "
|
|
2536
|
+
property: "filter" | "float" | "page" | "clip" | "top" | "right" | `--${string}` | "WebkitFontSmoothing" | "MozOsxFontSmoothing" | "accentColor" | "alignContent" | "alignItems" | "alignSelf" | "alignTracks" | "animationComposition" | "animationDelay" | "animationDirection" | "animationDuration" | "animationFillMode" | "animationIterationCount" | "animationName" | "animationPlayState" | "animationTimingFunction" | "animationTimeline" | "appearance" | "aspectRatio" | "backdropFilter" | "backfaceVisibility" | "backgroundAttachment" | "backgroundBlendMode" | "backgroundClip" | "backgroundColor" | "backgroundImage" | "backgroundOrigin" | "backgroundPosition" | "backgroundPositionX" | "backgroundPositionY" | "backgroundRepeat" | "backgroundSize" | "blockOverflow" | "blockSize" | "borderBlockColor" | "borderBlockStyle" | "borderBlockWidth" | "borderBlockEndColor" | "borderBlockEndStyle" | "borderBlockEndWidth" | "borderBlockStartColor" | "borderBlockStartStyle" | "borderBlockStartWidth" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderCollapse" | "borderEndEndRadius" | "borderEndStartRadius" | "borderImageOutset" | "borderImageRepeat" | "borderImageSlice" | "borderImageSource" | "borderImageWidth" | "borderInlineColor" | "borderInlineStyle" | "borderInlineWidth" | "borderInlineEndColor" | "borderInlineEndStyle" | "borderInlineEndWidth" | "borderInlineStartColor" | "borderInlineStartStyle" | "borderInlineStartWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderSpacing" | "borderStartEndRadius" | "borderStartStartRadius" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "bottom" | "boxDecorationBreak" | "boxShadow" | "boxSizing" | "breakAfter" | "breakBefore" | "breakInside" | "captionSide" | "caretColor" | "caretShape" | "clear" | "clipPath" | "color" | "colorScheme" | "columnCount" | "columnFill" | "columnGap" | "columnRuleColor" | "columnRuleStyle" | "columnRuleWidth" | "columnSpan" | "columnWidth" | "contain" | "containIntrinsicBlockSize" | "containIntrinsicHeight" | "containIntrinsicInlineSize" | "containIntrinsicWidth" | "containerName" | "containerType" | "content" | "contentVisibility" | "counterIncrement" | "counterReset" | "counterSet" | "cursor" | "direction" | "display" | "emptyCells" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontFeatureSettings" | "fontKerning" | "fontLanguageOverride" | "fontOpticalSizing" | "fontPalette" | "fontVariationSettings" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontSynthesis" | "fontVariant" | "fontVariantAlternates" | "fontVariantCaps" | "fontVariantEastAsian" | "fontVariantEmoji" | "fontVariantLigatures" | "fontVariantNumeric" | "fontVariantPosition" | "fontWeight" | "forcedColorAdjust" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridColumnEnd" | "gridColumnStart" | "gridRowEnd" | "gridRowStart" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "hangingPunctuation" | "height" | "hyphenateCharacter" | "hyphenateLimitChars" | "hyphens" | "imageOrientation" | "imageRendering" | "imageResolution" | "initialLetter" | "initialLetterAlign" | "inlineSize" | "inputSecurity" | "insetBlockEnd" | "insetBlockStart" | "insetInlineEnd" | "insetInlineStart" | "isolation" | "justifyContent" | "justifyItems" | "justifySelf" | "justifyTracks" | "left" | "letterSpacing" | "lineBreak" | "lineClamp" | "lineHeight" | "lineHeightStep" | "listStyleImage" | "listStylePosition" | "listStyleType" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "marginTrim" | "maskBorderMode" | "maskBorderOutset" | "maskBorderRepeat" | "maskBorderSlice" | "maskBorderSource" | "maskBorderWidth" | "maskClip" | "maskComposite" | "maskImage" | "maskMode" | "maskOrigin" | "maskPosition" | "maskRepeat" | "maskSize" | "maskType" | "masonryAutoFlow" | "mathDepth" | "mathShift" | "mathStyle" | "maxBlockSize" | "maxHeight" | "maxInlineSize" | "maxLines" | "maxWidth" | "minBlockSize" | "minHeight" | "minInlineSize" | "minWidth" | "mixBlendMode" | "objectFit" | "objectPosition" | "offsetAnchor" | "offsetDistance" | "offsetPath" | "offsetPosition" | "offsetRotate" | "opacity" | "order" | "orphans" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "overflow" | "overflowAnchor" | "overflowBlock" | "overflowClipMargin" | "overflowInline" | "overflowWrap" | "overflowX" | "overflowY" | "overscrollBehavior" | "overscrollBehaviorBlock" | "overscrollBehaviorInline" | "overscrollBehaviorX" | "overscrollBehaviorY" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "pageBreakAfter" | "pageBreakBefore" | "pageBreakInside" | "paintOrder" | "perspective" | "perspectiveOrigin" | "pointerEvents" | "position" | "printColorAdjust" | "quotes" | "resize" | "rotate" | "rowGap" | "rubyAlign" | "rubyMerge" | "rubyPosition" | "scale" | "scrollbarColor" | "scrollbarGutter" | "scrollbarWidth" | "scrollBehavior" | "scrollMarginBlockStart" | "scrollMarginBlockEnd" | "scrollMarginBottom" | "scrollMarginInlineStart" | "scrollMarginInlineEnd" | "scrollMarginLeft" | "scrollMarginRight" | "scrollMarginTop" | "scrollPaddingBlockStart" | "scrollPaddingBlockEnd" | "scrollPaddingBottom" | "scrollPaddingInlineStart" | "scrollPaddingInlineEnd" | "scrollPaddingLeft" | "scrollPaddingRight" | "scrollPaddingTop" | "scrollSnapAlign" | "scrollSnapStop" | "scrollSnapType" | "scrollTimelineAxis" | "scrollTimelineName" | "shapeImageThreshold" | "shapeMargin" | "shapeOutside" | "tabSize" | "tableLayout" | "textAlign" | "textAlignLast" | "textCombineUpright" | "textDecorationColor" | "textDecorationLine" | "textDecorationSkip" | "textDecorationSkipInk" | "textDecorationStyle" | "textDecorationThickness" | "textEmphasisColor" | "textEmphasisPosition" | "textEmphasisStyle" | "textIndent" | "textJustify" | "textOrientation" | "textOverflow" | "textRendering" | "textShadow" | "textSizeAdjust" | "textTransform" | "textUnderlineOffset" | "textUnderlinePosition" | "touchAction" | "transform" | "transformBox" | "transformOrigin" | "transformStyle" | "transitionDelay" | "transitionDuration" | "transitionProperty" | "transitionTimingFunction" | "translate" | "unicodeBidi" | "userSelect" | "verticalAlign" | "viewTransitionName" | "visibility" | "whiteSpace" | "widows" | "width" | "willChange" | "wordBreak" | "wordSpacing" | "wordWrap" | "writingMode" | "zIndex";
|
|
2649
2537
|
}[];
|
|
2650
2538
|
};
|
|
2651
2539
|
export type EmbedTemplateData = ReturnType<typeof generateDataFromEmbedTemplate>;
|
|
2540
|
+
export declare const namespaceMeta: (meta: WsComponentMeta, namespace: string, components: Set<EmbedTemplateInstance["component"]>) => {
|
|
2541
|
+
type: "embed" | "control" | "container" | "rich-text-child";
|
|
2542
|
+
label: string;
|
|
2543
|
+
order?: number | undefined;
|
|
2544
|
+
template?: ({
|
|
2545
|
+
type: "text";
|
|
2546
|
+
value: string;
|
|
2547
|
+
} | EmbedTemplateInstance)[] | undefined;
|
|
2548
|
+
description?: string | undefined;
|
|
2549
|
+
category?: "text" | "hidden" | "general" | "media" | "forms" | "radix" | undefined;
|
|
2550
|
+
requiredAncestors?: string[] | undefined;
|
|
2551
|
+
invalidAncestors?: string[] | undefined;
|
|
2552
|
+
indexWithinAncestor?: string | undefined;
|
|
2553
|
+
stylable?: boolean | undefined;
|
|
2554
|
+
detachable?: boolean | undefined;
|
|
2555
|
+
icon: string;
|
|
2556
|
+
states?: {
|
|
2557
|
+
label: string;
|
|
2558
|
+
selector: string;
|
|
2559
|
+
category?: "states" | "component-states" | undefined;
|
|
2560
|
+
}[] | undefined;
|
|
2561
|
+
presetStyle?: Partial<Record<import("html-tags").htmlTags, {
|
|
2562
|
+
value: {
|
|
2563
|
+
type: "unit";
|
|
2564
|
+
value: number;
|
|
2565
|
+
unit: "number" | "%" | "deg" | "grad" | "rad" | "turn" | "db" | "fr" | "hz" | "khz" | "cm" | "mm" | "q" | "in" | "pt" | "pc" | "px" | "em" | "rem" | "ex" | "rex" | "cap" | "rcap" | "ch" | "rch" | "ic" | "ric" | "lh" | "rlh" | "vw" | "svw" | "lvw" | "dvw" | "vh" | "svh" | "lvh" | "dvh" | "vi" | "svi" | "lvi" | "dvi" | "vb" | "svb" | "lvb" | "dvb" | "vmin" | "svmin" | "lvmin" | "dvmin" | "vmax" | "svmax" | "lvmax" | "dvmax" | "cqw" | "cqh" | "cqi" | "cqb" | "cqmin" | "cqmax" | "dpi" | "dpcm" | "dppx" | "x" | "st" | "s" | "ms";
|
|
2566
|
+
} | {
|
|
2567
|
+
type: "keyword";
|
|
2568
|
+
value: string;
|
|
2569
|
+
} | {
|
|
2570
|
+
type: "unparsed";
|
|
2571
|
+
value: string;
|
|
2572
|
+
hidden?: boolean | undefined;
|
|
2573
|
+
} | {
|
|
2574
|
+
type: "fontFamily";
|
|
2575
|
+
value: string[];
|
|
2576
|
+
} | {
|
|
2577
|
+
type: "rgb";
|
|
2578
|
+
alpha: number;
|
|
2579
|
+
r: number;
|
|
2580
|
+
g: number;
|
|
2581
|
+
b: number;
|
|
2582
|
+
} | {
|
|
2583
|
+
type: "image";
|
|
2584
|
+
value: {
|
|
2585
|
+
type: "asset";
|
|
2586
|
+
value: string;
|
|
2587
|
+
} | {
|
|
2588
|
+
type: "url";
|
|
2589
|
+
url: string;
|
|
2590
|
+
};
|
|
2591
|
+
hidden?: boolean | undefined;
|
|
2592
|
+
} | {
|
|
2593
|
+
type: "invalid";
|
|
2594
|
+
value: string;
|
|
2595
|
+
} | {
|
|
2596
|
+
type: "unset";
|
|
2597
|
+
value: "";
|
|
2598
|
+
} | {
|
|
2599
|
+
type: "tuple";
|
|
2600
|
+
value: ({
|
|
2601
|
+
type: "unit";
|
|
2602
|
+
value: number;
|
|
2603
|
+
unit: "number" | "%" | "deg" | "grad" | "rad" | "turn" | "db" | "fr" | "hz" | "khz" | "cm" | "mm" | "q" | "in" | "pt" | "pc" | "px" | "em" | "rem" | "ex" | "rex" | "cap" | "rcap" | "ch" | "rch" | "ic" | "ric" | "lh" | "rlh" | "vw" | "svw" | "lvw" | "dvw" | "vh" | "svh" | "lvh" | "dvh" | "vi" | "svi" | "lvi" | "dvi" | "vb" | "svb" | "lvb" | "dvb" | "vmin" | "svmin" | "lvmin" | "dvmin" | "vmax" | "svmax" | "lvmax" | "dvmax" | "cqw" | "cqh" | "cqi" | "cqb" | "cqmin" | "cqmax" | "dpi" | "dpcm" | "dppx" | "x" | "st" | "s" | "ms";
|
|
2604
|
+
} | {
|
|
2605
|
+
type: "keyword";
|
|
2606
|
+
value: string;
|
|
2607
|
+
} | {
|
|
2608
|
+
type: "unparsed";
|
|
2609
|
+
value: string;
|
|
2610
|
+
hidden?: boolean | undefined;
|
|
2611
|
+
} | {
|
|
2612
|
+
type: "rgb";
|
|
2613
|
+
alpha: number;
|
|
2614
|
+
r: number;
|
|
2615
|
+
g: number;
|
|
2616
|
+
b: number;
|
|
2617
|
+
})[];
|
|
2618
|
+
hidden?: boolean | undefined;
|
|
2619
|
+
} | {
|
|
2620
|
+
type: "layers";
|
|
2621
|
+
value: ({
|
|
2622
|
+
type: "unit";
|
|
2623
|
+
value: number;
|
|
2624
|
+
unit: "number" | "%" | "deg" | "grad" | "rad" | "turn" | "db" | "fr" | "hz" | "khz" | "cm" | "mm" | "q" | "in" | "pt" | "pc" | "px" | "em" | "rem" | "ex" | "rex" | "cap" | "rcap" | "ch" | "rch" | "ic" | "ric" | "lh" | "rlh" | "vw" | "svw" | "lvw" | "dvw" | "vh" | "svh" | "lvh" | "dvh" | "vi" | "svi" | "lvi" | "dvi" | "vb" | "svb" | "lvb" | "dvb" | "vmin" | "svmin" | "lvmin" | "dvmin" | "vmax" | "svmax" | "lvmax" | "dvmax" | "cqw" | "cqh" | "cqi" | "cqb" | "cqmin" | "cqmax" | "dpi" | "dpcm" | "dppx" | "x" | "st" | "s" | "ms";
|
|
2625
|
+
} | {
|
|
2626
|
+
type: "keyword";
|
|
2627
|
+
value: string;
|
|
2628
|
+
} | {
|
|
2629
|
+
type: "unparsed";
|
|
2630
|
+
value: string;
|
|
2631
|
+
hidden?: boolean | undefined;
|
|
2632
|
+
} | {
|
|
2633
|
+
type: "image";
|
|
2634
|
+
value: {
|
|
2635
|
+
type: "asset";
|
|
2636
|
+
value: string;
|
|
2637
|
+
} | {
|
|
2638
|
+
type: "url";
|
|
2639
|
+
url: string;
|
|
2640
|
+
};
|
|
2641
|
+
hidden?: boolean | undefined;
|
|
2642
|
+
} | {
|
|
2643
|
+
type: "invalid";
|
|
2644
|
+
value: string;
|
|
2645
|
+
} | {
|
|
2646
|
+
type: "tuple";
|
|
2647
|
+
value: ({
|
|
2648
|
+
type: "unit";
|
|
2649
|
+
value: number;
|
|
2650
|
+
unit: "number" | "%" | "deg" | "grad" | "rad" | "turn" | "db" | "fr" | "hz" | "khz" | "cm" | "mm" | "q" | "in" | "pt" | "pc" | "px" | "em" | "rem" | "ex" | "rex" | "cap" | "rcap" | "ch" | "rch" | "ic" | "ric" | "lh" | "rlh" | "vw" | "svw" | "lvw" | "dvw" | "vh" | "svh" | "lvh" | "dvh" | "vi" | "svi" | "lvi" | "dvi" | "vb" | "svb" | "lvb" | "dvb" | "vmin" | "svmin" | "lvmin" | "dvmin" | "vmax" | "svmax" | "lvmax" | "dvmax" | "cqw" | "cqh" | "cqi" | "cqb" | "cqmin" | "cqmax" | "dpi" | "dpcm" | "dppx" | "x" | "st" | "s" | "ms";
|
|
2651
|
+
} | {
|
|
2652
|
+
type: "keyword";
|
|
2653
|
+
value: string;
|
|
2654
|
+
} | {
|
|
2655
|
+
type: "unparsed";
|
|
2656
|
+
value: string;
|
|
2657
|
+
hidden?: boolean | undefined;
|
|
2658
|
+
} | {
|
|
2659
|
+
type: "rgb";
|
|
2660
|
+
alpha: number;
|
|
2661
|
+
r: number;
|
|
2662
|
+
g: number;
|
|
2663
|
+
b: number;
|
|
2664
|
+
})[];
|
|
2665
|
+
hidden?: boolean | undefined;
|
|
2666
|
+
})[];
|
|
2667
|
+
} | {
|
|
2668
|
+
type: "var";
|
|
2669
|
+
value: string;
|
|
2670
|
+
fallbacks: ({
|
|
2671
|
+
type: "unit";
|
|
2672
|
+
value: number;
|
|
2673
|
+
unit: "number" | "%" | "deg" | "grad" | "rad" | "turn" | "db" | "fr" | "hz" | "khz" | "cm" | "mm" | "q" | "in" | "pt" | "pc" | "px" | "em" | "rem" | "ex" | "rex" | "cap" | "rcap" | "ch" | "rch" | "ic" | "ric" | "lh" | "rlh" | "vw" | "svw" | "lvw" | "dvw" | "vh" | "svh" | "lvh" | "dvh" | "vi" | "svi" | "lvi" | "dvi" | "vb" | "svb" | "lvb" | "dvb" | "vmin" | "svmin" | "lvmin" | "dvmin" | "vmax" | "svmax" | "lvmax" | "dvmax" | "cqw" | "cqh" | "cqi" | "cqb" | "cqmin" | "cqmax" | "dpi" | "dpcm" | "dppx" | "x" | "st" | "s" | "ms";
|
|
2674
|
+
} | {
|
|
2675
|
+
type: "keyword";
|
|
2676
|
+
value: string;
|
|
2677
|
+
} | {
|
|
2678
|
+
type: "unparsed";
|
|
2679
|
+
value: string;
|
|
2680
|
+
hidden?: boolean | undefined;
|
|
2681
|
+
} | {
|
|
2682
|
+
type: "fontFamily";
|
|
2683
|
+
value: string[];
|
|
2684
|
+
} | {
|
|
2685
|
+
type: "rgb";
|
|
2686
|
+
alpha: number;
|
|
2687
|
+
r: number;
|
|
2688
|
+
g: number;
|
|
2689
|
+
b: number;
|
|
2690
|
+
} | {
|
|
2691
|
+
type: "image";
|
|
2692
|
+
value: {
|
|
2693
|
+
type: "asset";
|
|
2694
|
+
value: string;
|
|
2695
|
+
} | {
|
|
2696
|
+
type: "url";
|
|
2697
|
+
url: string;
|
|
2698
|
+
};
|
|
2699
|
+
hidden?: boolean | undefined;
|
|
2700
|
+
} | {
|
|
2701
|
+
type: "tuple";
|
|
2702
|
+
value: ({
|
|
2703
|
+
type: "unit";
|
|
2704
|
+
value: number;
|
|
2705
|
+
unit: "number" | "%" | "deg" | "grad" | "rad" | "turn" | "db" | "fr" | "hz" | "khz" | "cm" | "mm" | "q" | "in" | "pt" | "pc" | "px" | "em" | "rem" | "ex" | "rex" | "cap" | "rcap" | "ch" | "rch" | "ic" | "ric" | "lh" | "rlh" | "vw" | "svw" | "lvw" | "dvw" | "vh" | "svh" | "lvh" | "dvh" | "vi" | "svi" | "lvi" | "dvi" | "vb" | "svb" | "lvb" | "dvb" | "vmin" | "svmin" | "lvmin" | "dvmin" | "vmax" | "svmax" | "lvmax" | "dvmax" | "cqw" | "cqh" | "cqi" | "cqb" | "cqmin" | "cqmax" | "dpi" | "dpcm" | "dppx" | "x" | "st" | "s" | "ms";
|
|
2706
|
+
} | {
|
|
2707
|
+
type: "keyword";
|
|
2708
|
+
value: string;
|
|
2709
|
+
} | {
|
|
2710
|
+
type: "unparsed";
|
|
2711
|
+
value: string;
|
|
2712
|
+
hidden?: boolean | undefined;
|
|
2713
|
+
} | {
|
|
2714
|
+
type: "rgb";
|
|
2715
|
+
alpha: number;
|
|
2716
|
+
r: number;
|
|
2717
|
+
g: number;
|
|
2718
|
+
b: number;
|
|
2719
|
+
})[];
|
|
2720
|
+
hidden?: boolean | undefined;
|
|
2721
|
+
} | {
|
|
2722
|
+
type: "layers";
|
|
2723
|
+
value: ({
|
|
2724
|
+
type: "unit";
|
|
2725
|
+
value: number;
|
|
2726
|
+
unit: "number" | "%" | "deg" | "grad" | "rad" | "turn" | "db" | "fr" | "hz" | "khz" | "cm" | "mm" | "q" | "in" | "pt" | "pc" | "px" | "em" | "rem" | "ex" | "rex" | "cap" | "rcap" | "ch" | "rch" | "ic" | "ric" | "lh" | "rlh" | "vw" | "svw" | "lvw" | "dvw" | "vh" | "svh" | "lvh" | "dvh" | "vi" | "svi" | "lvi" | "dvi" | "vb" | "svb" | "lvb" | "dvb" | "vmin" | "svmin" | "lvmin" | "dvmin" | "vmax" | "svmax" | "lvmax" | "dvmax" | "cqw" | "cqh" | "cqi" | "cqb" | "cqmin" | "cqmax" | "dpi" | "dpcm" | "dppx" | "x" | "st" | "s" | "ms";
|
|
2727
|
+
} | {
|
|
2728
|
+
type: "keyword";
|
|
2729
|
+
value: string;
|
|
2730
|
+
} | {
|
|
2731
|
+
type: "unparsed";
|
|
2732
|
+
value: string;
|
|
2733
|
+
hidden?: boolean | undefined;
|
|
2734
|
+
} | {
|
|
2735
|
+
type: "image";
|
|
2736
|
+
value: {
|
|
2737
|
+
type: "asset";
|
|
2738
|
+
value: string;
|
|
2739
|
+
} | {
|
|
2740
|
+
type: "url";
|
|
2741
|
+
url: string;
|
|
2742
|
+
};
|
|
2743
|
+
hidden?: boolean | undefined;
|
|
2744
|
+
} | {
|
|
2745
|
+
type: "invalid";
|
|
2746
|
+
value: string;
|
|
2747
|
+
} | {
|
|
2748
|
+
type: "tuple";
|
|
2749
|
+
value: ({
|
|
2750
|
+
type: "unit";
|
|
2751
|
+
value: number;
|
|
2752
|
+
unit: "number" | "%" | "deg" | "grad" | "rad" | "turn" | "db" | "fr" | "hz" | "khz" | "cm" | "mm" | "q" | "in" | "pt" | "pc" | "px" | "em" | "rem" | "ex" | "rex" | "cap" | "rcap" | "ch" | "rch" | "ic" | "ric" | "lh" | "rlh" | "vw" | "svw" | "lvw" | "dvw" | "vh" | "svh" | "lvh" | "dvh" | "vi" | "svi" | "lvi" | "dvi" | "vb" | "svb" | "lvb" | "dvb" | "vmin" | "svmin" | "lvmin" | "dvmin" | "vmax" | "svmax" | "lvmax" | "dvmax" | "cqw" | "cqh" | "cqi" | "cqb" | "cqmin" | "cqmax" | "dpi" | "dpcm" | "dppx" | "x" | "st" | "s" | "ms";
|
|
2753
|
+
} | {
|
|
2754
|
+
type: "keyword";
|
|
2755
|
+
value: string;
|
|
2756
|
+
} | {
|
|
2757
|
+
type: "unparsed";
|
|
2758
|
+
value: string;
|
|
2759
|
+
hidden?: boolean | undefined;
|
|
2760
|
+
} | {
|
|
2761
|
+
type: "rgb";
|
|
2762
|
+
alpha: number;
|
|
2763
|
+
r: number;
|
|
2764
|
+
g: number;
|
|
2765
|
+
b: number;
|
|
2766
|
+
})[];
|
|
2767
|
+
hidden?: boolean | undefined;
|
|
2768
|
+
})[];
|
|
2769
|
+
})[];
|
|
2770
|
+
};
|
|
2771
|
+
state?: string | undefined;
|
|
2772
|
+
property: StyleProperty;
|
|
2773
|
+
}[]>> | undefined;
|
|
2774
|
+
};
|
|
2652
2775
|
export {};
|