@webstudio-is/react-sdk 0.189.0 → 0.191.4

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.
@@ -1,7 +0,0 @@
1
- import { componentAttribute, idAttribute } from "../props";
2
- export type AnyComponent = React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & WebstudioComponentSystemProps & React.RefAttributes<HTMLElement>>;
3
- export type Components = Map<string, AnyComponent>;
4
- export type WebstudioComponentSystemProps = {
5
- [componentAttribute]: string;
6
- [idAttribute]: string;
7
- };
@@ -1,37 +0,0 @@
1
- import type { ImageLoader } from "@webstudio-is/image";
2
- export type Params = {
3
- /**
4
- * When rendering a published version, there is no renderer defined.
5
- * - canvas is the builder canvas in dev mode
6
- * - preview is the preview mode in builder
7
- */
8
- renderer?: "canvas" | "preview";
9
- /**
10
- * Base url ir base path for images with ending slash.
11
- * Used for configuring image with different sizes.
12
- * Concatinated with "name?width=&quality=&format=".
13
- *
14
- * For example
15
- * /asset/image/ used by default in builder
16
- * https://image-transform.wstd.io/cdn-cgi/image/
17
- * https://webstudio.is/cdn-cgi/image/
18
- */
19
- imageBaseUrl: string;
20
- /**
21
- * Base url or base path for any asset with ending slash.
22
- * Used to load assets like fonts or images in styles
23
- * Concatinated with "name".
24
- *
25
- * For example
26
- * /s/uploads/
27
- * /asset/file/
28
- * https://assets-dev.webstudio.is/
29
- * https://assets.webstudio.is/
30
- */
31
- assetBaseUrl: string;
32
- };
33
- export declare const ReactSdkContext: import("react").Context<Params & {
34
- imageLoader: ImageLoader;
35
- resources: Record<string, any>;
36
- }>;
37
- export declare const useResource: (name: string) => any;
@@ -1,451 +0,0 @@
1
- import type { WsComponentMeta } from "./components/component-meta";
2
- export declare const rootComponent = "ws:root";
3
- export declare const portalComponent = "Slot";
4
- export declare const collectionComponent = "ws:collection";
5
- export declare const descendantComponent = "ws:descendant";
6
- export declare const coreMetas: {
7
- "ws:root": WsComponentMeta;
8
- "ws:collection": WsComponentMeta;
9
- "ws:descendant": WsComponentMeta;
10
- };
11
- export declare const corePropsMetas: {
12
- "ws:root": {
13
- props: Record<string, {
14
- type: "number";
15
- required: boolean;
16
- control: "number";
17
- defaultValue?: number | undefined;
18
- label?: string | undefined;
19
- description?: string | undefined;
20
- } | {
21
- type: "number";
22
- required: boolean;
23
- control: "range";
24
- defaultValue?: number | undefined;
25
- label?: string | undefined;
26
- description?: string | undefined;
27
- } | {
28
- type: "string";
29
- required: boolean;
30
- control: "text";
31
- defaultValue?: string | undefined;
32
- rows?: number | undefined;
33
- label?: string | undefined;
34
- description?: string | undefined;
35
- } | {
36
- type: "string";
37
- required: boolean;
38
- language: "html" | "markdown";
39
- control: "code";
40
- defaultValue?: string | undefined;
41
- label?: string | undefined;
42
- description?: string | undefined;
43
- } | {
44
- type: "string";
45
- required: boolean;
46
- control: "codetext";
47
- defaultValue?: string | undefined;
48
- label?: string | undefined;
49
- description?: string | undefined;
50
- } | {
51
- type: "string";
52
- required: boolean;
53
- control: "color";
54
- defaultValue?: string | undefined;
55
- label?: string | undefined;
56
- description?: string | undefined;
57
- } | {
58
- type: "boolean";
59
- required: boolean;
60
- control: "boolean";
61
- defaultValue?: boolean | undefined;
62
- label?: string | undefined;
63
- description?: string | undefined;
64
- } | {
65
- options: string[];
66
- type: "string";
67
- required: boolean;
68
- control: "radio";
69
- defaultValue?: string | undefined;
70
- label?: string | undefined;
71
- description?: string | undefined;
72
- } | {
73
- options: string[];
74
- type: "string";
75
- required: boolean;
76
- control: "inline-radio";
77
- defaultValue?: string | undefined;
78
- label?: string | undefined;
79
- description?: string | undefined;
80
- } | {
81
- options: string[];
82
- type: "string";
83
- required: boolean;
84
- control: "select";
85
- defaultValue?: string | undefined;
86
- label?: string | undefined;
87
- description?: string | undefined;
88
- } | {
89
- options: string[];
90
- type: "string[]";
91
- required: boolean;
92
- control: "check";
93
- defaultValue?: string[] | undefined;
94
- label?: string | undefined;
95
- description?: string | undefined;
96
- } | {
97
- options: string[];
98
- type: "string[]";
99
- required: boolean;
100
- control: "inline-check";
101
- defaultValue?: string[] | undefined;
102
- label?: string | undefined;
103
- description?: string | undefined;
104
- } | {
105
- options: string[];
106
- type: "string[]";
107
- required: boolean;
108
- control: "multi-select";
109
- defaultValue?: string[] | undefined;
110
- label?: string | undefined;
111
- description?: string | undefined;
112
- } | {
113
- type: "string";
114
- required: boolean;
115
- control: "file";
116
- defaultValue?: string | undefined;
117
- accept?: string | undefined;
118
- label?: string | undefined;
119
- description?: string | undefined;
120
- } | {
121
- type: "string";
122
- required: boolean;
123
- control: "url";
124
- defaultValue?: string | undefined;
125
- label?: string | undefined;
126
- description?: string | undefined;
127
- } | {
128
- type: "json";
129
- required: boolean;
130
- control: "json";
131
- defaultValue?: unknown;
132
- label?: string | undefined;
133
- description?: string | undefined;
134
- } | {
135
- type: "string";
136
- required: boolean;
137
- control: "date";
138
- defaultValue?: string | undefined;
139
- label?: string | undefined;
140
- description?: string | undefined;
141
- } | {
142
- type: "action";
143
- required: boolean;
144
- control: "action";
145
- defaultValue?: undefined;
146
- label?: string | undefined;
147
- description?: string | undefined;
148
- } | {
149
- type: "string";
150
- required: boolean;
151
- control: "textContent";
152
- defaultValue?: string | undefined;
153
- label?: string | undefined;
154
- description?: string | undefined;
155
- }>;
156
- initialProps?: string[] | undefined;
157
- };
158
- "ws:collection": {
159
- props: Record<string, {
160
- type: "number";
161
- required: boolean;
162
- control: "number";
163
- defaultValue?: number | undefined;
164
- label?: string | undefined;
165
- description?: string | undefined;
166
- } | {
167
- type: "number";
168
- required: boolean;
169
- control: "range";
170
- defaultValue?: number | undefined;
171
- label?: string | undefined;
172
- description?: string | undefined;
173
- } | {
174
- type: "string";
175
- required: boolean;
176
- control: "text";
177
- defaultValue?: string | undefined;
178
- rows?: number | undefined;
179
- label?: string | undefined;
180
- description?: string | undefined;
181
- } | {
182
- type: "string";
183
- required: boolean;
184
- language: "html" | "markdown";
185
- control: "code";
186
- defaultValue?: string | undefined;
187
- label?: string | undefined;
188
- description?: string | undefined;
189
- } | {
190
- type: "string";
191
- required: boolean;
192
- control: "codetext";
193
- defaultValue?: string | undefined;
194
- label?: string | undefined;
195
- description?: string | undefined;
196
- } | {
197
- type: "string";
198
- required: boolean;
199
- control: "color";
200
- defaultValue?: string | undefined;
201
- label?: string | undefined;
202
- description?: string | undefined;
203
- } | {
204
- type: "boolean";
205
- required: boolean;
206
- control: "boolean";
207
- defaultValue?: boolean | undefined;
208
- label?: string | undefined;
209
- description?: string | undefined;
210
- } | {
211
- options: string[];
212
- type: "string";
213
- required: boolean;
214
- control: "radio";
215
- defaultValue?: string | undefined;
216
- label?: string | undefined;
217
- description?: string | undefined;
218
- } | {
219
- options: string[];
220
- type: "string";
221
- required: boolean;
222
- control: "inline-radio";
223
- defaultValue?: string | undefined;
224
- label?: string | undefined;
225
- description?: string | undefined;
226
- } | {
227
- options: string[];
228
- type: "string";
229
- required: boolean;
230
- control: "select";
231
- defaultValue?: string | undefined;
232
- label?: string | undefined;
233
- description?: string | undefined;
234
- } | {
235
- options: string[];
236
- type: "string[]";
237
- required: boolean;
238
- control: "check";
239
- defaultValue?: string[] | undefined;
240
- label?: string | undefined;
241
- description?: string | undefined;
242
- } | {
243
- options: string[];
244
- type: "string[]";
245
- required: boolean;
246
- control: "inline-check";
247
- defaultValue?: string[] | undefined;
248
- label?: string | undefined;
249
- description?: string | undefined;
250
- } | {
251
- options: string[];
252
- type: "string[]";
253
- required: boolean;
254
- control: "multi-select";
255
- defaultValue?: string[] | undefined;
256
- label?: string | undefined;
257
- description?: string | undefined;
258
- } | {
259
- type: "string";
260
- required: boolean;
261
- control: "file";
262
- defaultValue?: string | undefined;
263
- accept?: string | undefined;
264
- label?: string | undefined;
265
- description?: string | undefined;
266
- } | {
267
- type: "string";
268
- required: boolean;
269
- control: "url";
270
- defaultValue?: string | undefined;
271
- label?: string | undefined;
272
- description?: string | undefined;
273
- } | {
274
- type: "json";
275
- required: boolean;
276
- control: "json";
277
- defaultValue?: unknown;
278
- label?: string | undefined;
279
- description?: string | undefined;
280
- } | {
281
- type: "string";
282
- required: boolean;
283
- control: "date";
284
- defaultValue?: string | undefined;
285
- label?: string | undefined;
286
- description?: string | undefined;
287
- } | {
288
- type: "action";
289
- required: boolean;
290
- control: "action";
291
- defaultValue?: undefined;
292
- label?: string | undefined;
293
- description?: string | undefined;
294
- } | {
295
- type: "string";
296
- required: boolean;
297
- control: "textContent";
298
- defaultValue?: string | undefined;
299
- label?: string | undefined;
300
- description?: string | undefined;
301
- }>;
302
- initialProps?: string[] | undefined;
303
- };
304
- "ws:descendant": {
305
- props: Record<string, {
306
- type: "number";
307
- required: boolean;
308
- control: "number";
309
- defaultValue?: number | undefined;
310
- label?: string | undefined;
311
- description?: string | undefined;
312
- } | {
313
- type: "number";
314
- required: boolean;
315
- control: "range";
316
- defaultValue?: number | undefined;
317
- label?: string | undefined;
318
- description?: string | undefined;
319
- } | {
320
- type: "string";
321
- required: boolean;
322
- control: "text";
323
- defaultValue?: string | undefined;
324
- rows?: number | undefined;
325
- label?: string | undefined;
326
- description?: string | undefined;
327
- } | {
328
- type: "string";
329
- required: boolean;
330
- language: "html" | "markdown";
331
- control: "code";
332
- defaultValue?: string | undefined;
333
- label?: string | undefined;
334
- description?: string | undefined;
335
- } | {
336
- type: "string";
337
- required: boolean;
338
- control: "codetext";
339
- defaultValue?: string | undefined;
340
- label?: string | undefined;
341
- description?: string | undefined;
342
- } | {
343
- type: "string";
344
- required: boolean;
345
- control: "color";
346
- defaultValue?: string | undefined;
347
- label?: string | undefined;
348
- description?: string | undefined;
349
- } | {
350
- type: "boolean";
351
- required: boolean;
352
- control: "boolean";
353
- defaultValue?: boolean | undefined;
354
- label?: string | undefined;
355
- description?: string | undefined;
356
- } | {
357
- options: string[];
358
- type: "string";
359
- required: boolean;
360
- control: "radio";
361
- defaultValue?: string | undefined;
362
- label?: string | undefined;
363
- description?: string | undefined;
364
- } | {
365
- options: string[];
366
- type: "string";
367
- required: boolean;
368
- control: "inline-radio";
369
- defaultValue?: string | undefined;
370
- label?: string | undefined;
371
- description?: string | undefined;
372
- } | {
373
- options: string[];
374
- type: "string";
375
- required: boolean;
376
- control: "select";
377
- defaultValue?: string | undefined;
378
- label?: string | undefined;
379
- description?: string | undefined;
380
- } | {
381
- options: string[];
382
- type: "string[]";
383
- required: boolean;
384
- control: "check";
385
- defaultValue?: string[] | undefined;
386
- label?: string | undefined;
387
- description?: string | undefined;
388
- } | {
389
- options: string[];
390
- type: "string[]";
391
- required: boolean;
392
- control: "inline-check";
393
- defaultValue?: string[] | undefined;
394
- label?: string | undefined;
395
- description?: string | undefined;
396
- } | {
397
- options: string[];
398
- type: "string[]";
399
- required: boolean;
400
- control: "multi-select";
401
- defaultValue?: string[] | undefined;
402
- label?: string | undefined;
403
- description?: string | undefined;
404
- } | {
405
- type: "string";
406
- required: boolean;
407
- control: "file";
408
- defaultValue?: string | undefined;
409
- accept?: string | undefined;
410
- label?: string | undefined;
411
- description?: string | undefined;
412
- } | {
413
- type: "string";
414
- required: boolean;
415
- control: "url";
416
- defaultValue?: string | undefined;
417
- label?: string | undefined;
418
- description?: string | undefined;
419
- } | {
420
- type: "json";
421
- required: boolean;
422
- control: "json";
423
- defaultValue?: unknown;
424
- label?: string | undefined;
425
- description?: string | undefined;
426
- } | {
427
- type: "string";
428
- required: boolean;
429
- control: "date";
430
- defaultValue?: string | undefined;
431
- label?: string | undefined;
432
- description?: string | undefined;
433
- } | {
434
- type: "action";
435
- required: boolean;
436
- control: "action";
437
- defaultValue?: undefined;
438
- label?: string | undefined;
439
- description?: string | undefined;
440
- } | {
441
- type: "string";
442
- required: boolean;
443
- control: "textContent";
444
- defaultValue?: string | undefined;
445
- label?: string | undefined;
446
- description?: string | undefined;
447
- }>;
448
- initialProps?: string[] | undefined;
449
- };
450
- };
451
- export declare const isCoreComponent: (component: string) => component is "ws:root" | "ws:collection" | "ws:descendant";
@@ -1,21 +0,0 @@
1
- import { type TransformValue } from "@webstudio-is/css-engine";
2
- import { type Assets, type Breakpoints, type Instances, type Props, type StyleSourceSelections, type Styles } from "@webstudio-is/sdk";
3
- import type { WsComponentMeta } from "../components/component-meta";
4
- export type CssConfig = {
5
- assets: Assets;
6
- instances: Instances;
7
- props: Props;
8
- breakpoints: Breakpoints;
9
- styles: Styles;
10
- styleSourceSelections: StyleSourceSelections;
11
- componentMetas: Map<string, WsComponentMeta>;
12
- assetBaseUrl: string;
13
- atomic: boolean;
14
- };
15
- export declare const createImageValueTransformer: (assets: Assets, { assetBaseUrl }: {
16
- assetBaseUrl: string;
17
- }) => TransformValue;
18
- export declare const generateCss: ({ assets, instances, props, breakpoints, styles, styleSourceSelections, componentMetas, assetBaseUrl, atomic, }: CssConfig) => {
19
- cssText: string;
20
- classes: Map<string, string[]>;
21
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- import type { StyleSheetRegular } from "@webstudio-is/css-engine";
2
- import type { Assets } from "@webstudio-is/sdk";
3
- export declare const addGlobalRules: (sheet: StyleSheetRegular, { assets, assetBaseUrl }: {
4
- assets: Assets;
5
- assetBaseUrl: string;
6
- }) => void;
@@ -1,2 +0,0 @@
1
- export * from "./global-rules";
2
- export * from "./css";