@webstudio-is/react-sdk 0.57.0 → 0.58.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.
Files changed (141) hide show
  1. package/lib/app/custom-components/shared/remix-link.js +5 -1
  2. package/lib/cjs/app/custom-components/shared/remix-link.js +5 -1
  3. package/lib/cjs/components/link.js +4 -1
  4. package/lib/cjs/props.js +19 -5
  5. package/lib/components/link.js +4 -1
  6. package/lib/props.js +19 -5
  7. package/lib/types/app/custom-components/image.d.ts +6 -0
  8. package/lib/types/app/custom-components/index.d.ts +26 -0
  9. package/lib/types/app/custom-components/link-block.d.ts +6 -0
  10. package/lib/types/app/custom-components/link.d.ts +6 -0
  11. package/lib/types/app/custom-components/rich-text-link.d.ts +6 -0
  12. package/lib/types/app/custom-components/shared/remix-link.d.ts +10 -0
  13. package/lib/types/app/handle-request.server.d.ts +2 -0
  14. package/lib/types/app/index.d.ts +3 -0
  15. package/lib/types/app/params.d.ts +6 -0
  16. package/lib/types/app/root.d.ts +8 -0
  17. package/lib/types/components/__generated__/blockquote.props.d.ts +2 -0
  18. package/lib/types/components/__generated__/body.props.d.ts +2 -0
  19. package/lib/types/components/__generated__/bold.props.d.ts +2 -0
  20. package/lib/types/components/__generated__/box.props.d.ts +2 -0
  21. package/lib/types/components/__generated__/button.props.d.ts +2 -0
  22. package/lib/types/components/__generated__/code.props.d.ts +2 -0
  23. package/lib/types/components/__generated__/form.props.d.ts +2 -0
  24. package/lib/types/components/__generated__/fragment.props.d.ts +2 -0
  25. package/lib/types/components/__generated__/heading.props.d.ts +2 -0
  26. package/lib/types/components/__generated__/image.props.d.ts +2 -0
  27. package/lib/types/components/__generated__/input.props.d.ts +2 -0
  28. package/lib/types/components/__generated__/italic.props.d.ts +2 -0
  29. package/lib/types/components/__generated__/link-block.props.d.ts +2 -0
  30. package/lib/types/components/__generated__/link.props.d.ts +2 -0
  31. package/lib/types/components/__generated__/list-item.props.d.ts +2 -0
  32. package/lib/types/components/__generated__/list.props.d.ts +2 -0
  33. package/lib/types/components/__generated__/paragraph.props.d.ts +2 -0
  34. package/lib/types/components/__generated__/rich-text-link.props.d.ts +2 -0
  35. package/lib/types/components/__generated__/separator.props.d.ts +2 -0
  36. package/lib/types/components/__generated__/slot.props.d.ts +2 -0
  37. package/lib/types/components/__generated__/span.props.d.ts +2 -0
  38. package/lib/types/components/__generated__/subscript.props.d.ts +2 -0
  39. package/lib/types/components/__generated__/superscript.props.d.ts +2 -0
  40. package/lib/types/components/__generated__/text-block.props.d.ts +2 -0
  41. package/lib/types/components/blockquote.d.ts +3 -0
  42. package/lib/types/components/blockquote.stories.d.ts +5 -0
  43. package/lib/types/components/blockquote.ws.d.ts +3 -0
  44. package/lib/types/components/body.d.ts +3 -0
  45. package/lib/types/components/body.stories.d.ts +6 -0
  46. package/lib/types/components/body.ws.d.ts +3 -0
  47. package/lib/types/components/bold.d.ts +3 -0
  48. package/lib/types/components/bold.stories.d.ts +5 -0
  49. package/lib/types/components/bold.ws.d.ts +3 -0
  50. package/lib/types/components/box.d.ts +7 -0
  51. package/lib/types/components/box.stories.d.ts +9 -0
  52. package/lib/types/components/box.ws.d.ts +3 -0
  53. package/lib/types/components/button.d.ts +7 -0
  54. package/lib/types/components/button.stories.d.ts +9 -0
  55. package/lib/types/components/button.ws.d.ts +3 -0
  56. package/lib/types/components/code.d.ts +9 -0
  57. package/lib/types/components/code.stories.d.ts +11 -0
  58. package/lib/types/components/code.ws.d.ts +3 -0
  59. package/lib/types/components/component-meta.d.ts +610 -0
  60. package/lib/types/components/components-utils.d.ts +34 -0
  61. package/lib/types/components/components.d.ts +31 -0
  62. package/lib/types/components/form.d.ts +3 -0
  63. package/lib/types/components/form.stories.d.ts +5 -0
  64. package/lib/types/components/form.ws.d.ts +3 -0
  65. package/lib/types/components/fragment.d.ts +6 -0
  66. package/lib/types/components/fragment.ws.d.ts +3 -0
  67. package/lib/types/components/heading.d.ts +7 -0
  68. package/lib/types/components/heading.stories.d.ts +9 -0
  69. package/lib/types/components/heading.ws.d.ts +3 -0
  70. package/lib/types/components/image.d.ts +3 -0
  71. package/lib/types/components/image.stories.d.ts +5 -0
  72. package/lib/types/components/image.ws.d.ts +3 -0
  73. package/lib/types/components/index.d.ts +17 -0
  74. package/lib/types/components/input.d.ts +3 -0
  75. package/lib/types/components/input.stories.d.ts +5 -0
  76. package/lib/types/components/input.ws.d.ts +3 -0
  77. package/lib/types/components/italic.d.ts +3 -0
  78. package/lib/types/components/italic.stories.d.ts +5 -0
  79. package/lib/types/components/italic.ws.d.ts +3 -0
  80. package/lib/types/components/link-block.d.ts +3 -0
  81. package/lib/types/components/link-block.stories.d.ts +13 -0
  82. package/lib/types/components/link-block.ws.d.ts +3 -0
  83. package/lib/types/components/link.d.ts +9 -0
  84. package/lib/types/components/link.stories.d.ts +13 -0
  85. package/lib/types/components/link.ws.d.ts +3 -0
  86. package/lib/types/components/list-item.d.ts +3 -0
  87. package/lib/types/components/list-item.stories.d.ts +5 -0
  88. package/lib/types/components/list-item.ws.d.ts +3 -0
  89. package/lib/types/components/list.d.ts +9 -0
  90. package/lib/types/components/list.stories.d.ts +9 -0
  91. package/lib/types/components/list.ws.d.ts +3 -0
  92. package/lib/types/components/paragraph.d.ts +3 -0
  93. package/lib/types/components/paragraph.stories.d.ts +5 -0
  94. package/lib/types/components/paragraph.ws.d.ts +3 -0
  95. package/lib/types/components/rich-text-link.d.ts +2 -0
  96. package/lib/types/components/rich-text-link.stories.d.ts +13 -0
  97. package/lib/types/components/rich-text-link.ws.d.ts +3 -0
  98. package/lib/types/components/separator.d.ts +3 -0
  99. package/lib/types/components/separator.stories.d.ts +5 -0
  100. package/lib/types/components/separator.ws.d.ts +3 -0
  101. package/lib/types/components/slot.d.ts +6 -0
  102. package/lib/types/components/slot.stories.d.ts +9 -0
  103. package/lib/types/components/slot.ws.d.ts +3 -0
  104. package/lib/types/components/span.d.ts +3 -0
  105. package/lib/types/components/span.stories.d.ts +5 -0
  106. package/lib/types/components/span.ws.d.ts +3 -0
  107. package/lib/types/components/subscript.d.ts +3 -0
  108. package/lib/types/components/subscript.stories.d.ts +5 -0
  109. package/lib/types/components/subscript.ws.d.ts +3 -0
  110. package/lib/types/components/superscript.d.ts +3 -0
  111. package/lib/types/components/superscript.stories.d.ts +5 -0
  112. package/lib/types/components/superscript.ws.d.ts +3 -0
  113. package/lib/types/components/text-block.d.ts +3 -0
  114. package/lib/types/components/text-block.stories.d.ts +5 -0
  115. package/lib/types/components/text-block.ws.d.ts +3 -0
  116. package/lib/types/context.d.ts +9 -0
  117. package/lib/types/css/css.d.ts +52 -0
  118. package/lib/types/css/get-browser-style.d.ts +2 -0
  119. package/lib/types/css/global-rules.d.ts +43 -0
  120. package/lib/types/css/index.d.ts +4 -0
  121. package/lib/types/css/normalize-type-check.d.ts +1 -0
  122. package/lib/types/css/normalize.d.ts +2429 -0
  123. package/lib/types/css/presets.d.ts +38 -0
  124. package/lib/types/css/style-rules.d.ts +202 -0
  125. package/lib/types/css/style-rules.test.d.ts +1 -0
  126. package/lib/types/index.d.ts +9 -0
  127. package/lib/types/props.d.ts +158 -0
  128. package/lib/types/props.test.d.ts +1 -0
  129. package/lib/types/pubsub/create.d.ts +28 -0
  130. package/lib/types/pubsub/index.d.ts +1 -0
  131. package/lib/types/pubsub/raf-queue.d.ts +1 -0
  132. package/lib/types/tree/create-elements-tree.d.ts +29 -0
  133. package/lib/types/tree/index.d.ts +3 -0
  134. package/lib/types/tree/root.d.ts +25 -0
  135. package/lib/types/tree/session-storage-polyfill.d.ts +2 -0
  136. package/lib/types/tree/webstudio-component.d.ts +15 -0
  137. package/package.json +14 -14
  138. package/src/app/custom-components/shared/remix-link.tsx +5 -1
  139. package/src/components/link.tsx +5 -1
  140. package/src/props.test.ts +36 -1
  141. package/src/props.ts +33 -6
@@ -0,0 +1,610 @@
1
+ import { z } from "zod";
2
+ import type { FunctionComponent } from "react";
3
+ import type { IconProps } from "@webstudio-is/icons";
4
+ import type { Style } from "@webstudio-is/css-data";
5
+ import type { htmlTags as HtmlTags } from "html-tags";
6
+ type PresetStyle = Partial<Record<HtmlTags, Style>>;
7
+ declare const WsComponentPropsMeta: z.ZodObject<{
8
+ props: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
9
+ control: z.ZodLiteral<"number">;
10
+ type: z.ZodLiteral<"number">;
11
+ defaultValue: z.ZodOptional<z.ZodNumber>;
12
+ label: z.ZodOptional<z.ZodString>;
13
+ description: z.ZodOptional<z.ZodString>;
14
+ required: z.ZodBoolean;
15
+ }, "strip", z.ZodTypeAny, {
16
+ description?: string | undefined;
17
+ label?: string | undefined;
18
+ defaultValue?: number | undefined;
19
+ type: "number";
20
+ required: boolean;
21
+ control: "number";
22
+ }, {
23
+ description?: string | undefined;
24
+ label?: string | undefined;
25
+ defaultValue?: number | undefined;
26
+ type: "number";
27
+ required: boolean;
28
+ control: "number";
29
+ }>, z.ZodObject<{
30
+ control: z.ZodLiteral<"range">;
31
+ type: z.ZodLiteral<"number">;
32
+ defaultValue: z.ZodOptional<z.ZodNumber>;
33
+ label: z.ZodOptional<z.ZodString>;
34
+ description: z.ZodOptional<z.ZodString>;
35
+ required: z.ZodBoolean;
36
+ }, "strip", z.ZodTypeAny, {
37
+ description?: string | undefined;
38
+ label?: string | undefined;
39
+ defaultValue?: number | undefined;
40
+ type: "number";
41
+ required: boolean;
42
+ control: "range";
43
+ }, {
44
+ description?: string | undefined;
45
+ label?: string | undefined;
46
+ defaultValue?: number | undefined;
47
+ type: "number";
48
+ required: boolean;
49
+ control: "range";
50
+ }>, z.ZodObject<{
51
+ control: z.ZodLiteral<"text">;
52
+ type: z.ZodLiteral<"string">;
53
+ defaultValue: z.ZodOptional<z.ZodString>;
54
+ rows: z.ZodOptional<z.ZodNumber>;
55
+ label: z.ZodOptional<z.ZodString>;
56
+ description: z.ZodOptional<z.ZodString>;
57
+ required: z.ZodBoolean;
58
+ }, "strip", z.ZodTypeAny, {
59
+ description?: string | undefined;
60
+ label?: string | undefined;
61
+ defaultValue?: string | undefined;
62
+ rows?: number | undefined;
63
+ type: "string";
64
+ required: boolean;
65
+ control: "text";
66
+ }, {
67
+ description?: string | undefined;
68
+ label?: string | undefined;
69
+ defaultValue?: string | undefined;
70
+ rows?: number | undefined;
71
+ type: "string";
72
+ required: boolean;
73
+ control: "text";
74
+ }>, z.ZodObject<{
75
+ control: z.ZodLiteral<"color">;
76
+ type: z.ZodLiteral<"string">;
77
+ defaultValue: z.ZodOptional<z.ZodString>;
78
+ label: z.ZodOptional<z.ZodString>;
79
+ description: z.ZodOptional<z.ZodString>;
80
+ required: z.ZodBoolean;
81
+ }, "strip", z.ZodTypeAny, {
82
+ description?: string | undefined;
83
+ label?: string | undefined;
84
+ defaultValue?: string | undefined;
85
+ type: "string";
86
+ required: boolean;
87
+ control: "color";
88
+ }, {
89
+ description?: string | undefined;
90
+ label?: string | undefined;
91
+ defaultValue?: string | undefined;
92
+ type: "string";
93
+ required: boolean;
94
+ control: "color";
95
+ }>, z.ZodObject<{
96
+ control: z.ZodLiteral<"boolean">;
97
+ type: z.ZodLiteral<"boolean">;
98
+ defaultValue: z.ZodOptional<z.ZodBoolean>;
99
+ label: z.ZodOptional<z.ZodString>;
100
+ description: z.ZodOptional<z.ZodString>;
101
+ required: z.ZodBoolean;
102
+ }, "strip", z.ZodTypeAny, {
103
+ description?: string | undefined;
104
+ label?: string | undefined;
105
+ defaultValue?: boolean | undefined;
106
+ type: "boolean";
107
+ required: boolean;
108
+ control: "boolean";
109
+ }, {
110
+ description?: string | undefined;
111
+ label?: string | undefined;
112
+ defaultValue?: boolean | undefined;
113
+ type: "boolean";
114
+ required: boolean;
115
+ control: "boolean";
116
+ }>, z.ZodObject<{
117
+ control: z.ZodLiteral<"radio">;
118
+ type: z.ZodLiteral<"string">;
119
+ defaultValue: z.ZodOptional<z.ZodString>;
120
+ options: z.ZodArray<z.ZodString, "many">;
121
+ label: z.ZodOptional<z.ZodString>;
122
+ description: z.ZodOptional<z.ZodString>;
123
+ required: z.ZodBoolean;
124
+ }, "strip", z.ZodTypeAny, {
125
+ description?: string | undefined;
126
+ label?: string | undefined;
127
+ defaultValue?: string | undefined;
128
+ options: string[];
129
+ type: "string";
130
+ required: boolean;
131
+ control: "radio";
132
+ }, {
133
+ description?: string | undefined;
134
+ label?: string | undefined;
135
+ defaultValue?: string | undefined;
136
+ options: string[];
137
+ type: "string";
138
+ required: boolean;
139
+ control: "radio";
140
+ }>, z.ZodObject<{
141
+ control: z.ZodLiteral<"inline-radio">;
142
+ type: z.ZodLiteral<"string">;
143
+ defaultValue: z.ZodOptional<z.ZodString>;
144
+ options: z.ZodArray<z.ZodString, "many">;
145
+ label: z.ZodOptional<z.ZodString>;
146
+ description: z.ZodOptional<z.ZodString>;
147
+ required: z.ZodBoolean;
148
+ }, "strip", z.ZodTypeAny, {
149
+ description?: string | undefined;
150
+ label?: string | undefined;
151
+ defaultValue?: string | undefined;
152
+ options: string[];
153
+ type: "string";
154
+ required: boolean;
155
+ control: "inline-radio";
156
+ }, {
157
+ description?: string | undefined;
158
+ label?: string | undefined;
159
+ defaultValue?: string | undefined;
160
+ options: string[];
161
+ type: "string";
162
+ required: boolean;
163
+ control: "inline-radio";
164
+ }>, z.ZodObject<{
165
+ control: z.ZodLiteral<"select">;
166
+ type: z.ZodLiteral<"string">;
167
+ defaultValue: z.ZodOptional<z.ZodString>;
168
+ options: z.ZodArray<z.ZodString, "many">;
169
+ label: z.ZodOptional<z.ZodString>;
170
+ description: z.ZodOptional<z.ZodString>;
171
+ required: z.ZodBoolean;
172
+ }, "strip", z.ZodTypeAny, {
173
+ description?: string | undefined;
174
+ label?: string | undefined;
175
+ defaultValue?: string | undefined;
176
+ options: string[];
177
+ type: "string";
178
+ required: boolean;
179
+ control: "select";
180
+ }, {
181
+ description?: string | undefined;
182
+ label?: string | undefined;
183
+ defaultValue?: string | undefined;
184
+ options: string[];
185
+ type: "string";
186
+ required: boolean;
187
+ control: "select";
188
+ }>, z.ZodObject<{
189
+ control: z.ZodLiteral<"multi-select">;
190
+ type: z.ZodLiteral<"string[]">;
191
+ defaultValue: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
192
+ options: z.ZodArray<z.ZodString, "many">;
193
+ label: z.ZodOptional<z.ZodString>;
194
+ description: z.ZodOptional<z.ZodString>;
195
+ required: z.ZodBoolean;
196
+ }, "strip", z.ZodTypeAny, {
197
+ description?: string | undefined;
198
+ label?: string | undefined;
199
+ defaultValue?: string[] | undefined;
200
+ options: string[];
201
+ type: "string[]";
202
+ required: boolean;
203
+ control: "multi-select";
204
+ }, {
205
+ description?: string | undefined;
206
+ label?: string | undefined;
207
+ defaultValue?: string[] | undefined;
208
+ options: string[];
209
+ type: "string[]";
210
+ required: boolean;
211
+ control: "multi-select";
212
+ }>, z.ZodObject<{
213
+ control: z.ZodLiteral<"check">;
214
+ type: z.ZodLiteral<"string[]">;
215
+ defaultValue: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
216
+ options: z.ZodArray<z.ZodString, "many">;
217
+ label: z.ZodOptional<z.ZodString>;
218
+ description: z.ZodOptional<z.ZodString>;
219
+ required: z.ZodBoolean;
220
+ }, "strip", z.ZodTypeAny, {
221
+ description?: string | undefined;
222
+ label?: string | undefined;
223
+ defaultValue?: string[] | undefined;
224
+ options: string[];
225
+ type: "string[]";
226
+ required: boolean;
227
+ control: "check";
228
+ }, {
229
+ description?: string | undefined;
230
+ label?: string | undefined;
231
+ defaultValue?: string[] | undefined;
232
+ options: string[];
233
+ type: "string[]";
234
+ required: boolean;
235
+ control: "check";
236
+ }>, z.ZodObject<{
237
+ control: z.ZodLiteral<"inline-check">;
238
+ type: z.ZodLiteral<"string[]">;
239
+ defaultValue: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
240
+ options: z.ZodArray<z.ZodString, "many">;
241
+ label: z.ZodOptional<z.ZodString>;
242
+ description: z.ZodOptional<z.ZodString>;
243
+ required: z.ZodBoolean;
244
+ }, "strip", z.ZodTypeAny, {
245
+ description?: string | undefined;
246
+ label?: string | undefined;
247
+ defaultValue?: string[] | undefined;
248
+ options: string[];
249
+ type: "string[]";
250
+ required: boolean;
251
+ control: "inline-check";
252
+ }, {
253
+ description?: string | undefined;
254
+ label?: string | undefined;
255
+ defaultValue?: string[] | undefined;
256
+ options: string[];
257
+ type: "string[]";
258
+ required: boolean;
259
+ control: "inline-check";
260
+ }>, z.ZodObject<{
261
+ control: z.ZodLiteral<"file">;
262
+ type: z.ZodLiteral<"string">;
263
+ defaultValue: z.ZodOptional<z.ZodString>;
264
+ accept: z.ZodOptional<z.ZodString>;
265
+ label: z.ZodOptional<z.ZodString>;
266
+ description: z.ZodOptional<z.ZodString>;
267
+ required: z.ZodBoolean;
268
+ }, "strip", z.ZodTypeAny, {
269
+ description?: string | undefined;
270
+ label?: string | undefined;
271
+ defaultValue?: string | undefined;
272
+ accept?: string | undefined;
273
+ type: "string";
274
+ required: boolean;
275
+ control: "file";
276
+ }, {
277
+ description?: string | undefined;
278
+ label?: string | undefined;
279
+ defaultValue?: string | undefined;
280
+ accept?: string | undefined;
281
+ type: "string";
282
+ required: boolean;
283
+ control: "file";
284
+ }>, z.ZodObject<{
285
+ control: z.ZodLiteral<"url">;
286
+ type: z.ZodLiteral<"string">;
287
+ defaultValue: z.ZodOptional<z.ZodString>;
288
+ label: z.ZodOptional<z.ZodString>;
289
+ description: z.ZodOptional<z.ZodString>;
290
+ required: z.ZodBoolean;
291
+ }, "strip", z.ZodTypeAny, {
292
+ description?: string | undefined;
293
+ label?: string | undefined;
294
+ defaultValue?: string | undefined;
295
+ type: "string";
296
+ required: boolean;
297
+ control: "url";
298
+ }, {
299
+ description?: string | undefined;
300
+ label?: string | undefined;
301
+ defaultValue?: string | undefined;
302
+ type: "string";
303
+ required: boolean;
304
+ control: "url";
305
+ }>, z.ZodObject<{
306
+ control: z.ZodLiteral<"object">;
307
+ type: z.ZodLiteral<"Record<string, string>">;
308
+ defaultValue: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
309
+ label: z.ZodOptional<z.ZodString>;
310
+ description: z.ZodOptional<z.ZodString>;
311
+ required: z.ZodBoolean;
312
+ }, "strip", z.ZodTypeAny, {
313
+ description?: string | undefined;
314
+ label?: string | undefined;
315
+ defaultValue?: Record<string, string> | undefined;
316
+ type: "Record<string, string>";
317
+ required: boolean;
318
+ control: "object";
319
+ }, {
320
+ description?: string | undefined;
321
+ label?: string | undefined;
322
+ defaultValue?: Record<string, string> | undefined;
323
+ type: "Record<string, string>";
324
+ required: boolean;
325
+ control: "object";
326
+ }>, z.ZodObject<{
327
+ control: z.ZodLiteral<"date">;
328
+ type: z.ZodLiteral<"string">;
329
+ defaultValue: z.ZodOptional<z.ZodString>;
330
+ label: z.ZodOptional<z.ZodString>;
331
+ description: z.ZodOptional<z.ZodString>;
332
+ required: z.ZodBoolean;
333
+ }, "strip", z.ZodTypeAny, {
334
+ description?: string | undefined;
335
+ label?: string | undefined;
336
+ defaultValue?: string | undefined;
337
+ type: "string";
338
+ required: boolean;
339
+ control: "date";
340
+ }, {
341
+ description?: string | undefined;
342
+ label?: string | undefined;
343
+ defaultValue?: string | undefined;
344
+ type: "string";
345
+ required: boolean;
346
+ control: "date";
347
+ }>]>>;
348
+ initialProps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
349
+ }, "strip", z.ZodTypeAny, {
350
+ initialProps?: string[] | undefined;
351
+ props: Record<string, {
352
+ description?: string | undefined;
353
+ label?: string | undefined;
354
+ defaultValue?: number | undefined;
355
+ type: "number";
356
+ required: boolean;
357
+ control: "number";
358
+ } | {
359
+ description?: string | undefined;
360
+ label?: string | undefined;
361
+ defaultValue?: number | undefined;
362
+ type: "number";
363
+ required: boolean;
364
+ control: "range";
365
+ } | {
366
+ description?: string | undefined;
367
+ label?: string | undefined;
368
+ defaultValue?: string | undefined;
369
+ rows?: number | undefined;
370
+ type: "string";
371
+ required: boolean;
372
+ control: "text";
373
+ } | {
374
+ description?: string | undefined;
375
+ label?: string | undefined;
376
+ defaultValue?: string | undefined;
377
+ type: "string";
378
+ required: boolean;
379
+ control: "color";
380
+ } | {
381
+ description?: string | undefined;
382
+ label?: string | undefined;
383
+ defaultValue?: boolean | undefined;
384
+ type: "boolean";
385
+ required: boolean;
386
+ control: "boolean";
387
+ } | {
388
+ description?: string | undefined;
389
+ label?: string | undefined;
390
+ defaultValue?: string | undefined;
391
+ options: string[];
392
+ type: "string";
393
+ required: boolean;
394
+ control: "radio";
395
+ } | {
396
+ description?: string | undefined;
397
+ label?: string | undefined;
398
+ defaultValue?: string | undefined;
399
+ options: string[];
400
+ type: "string";
401
+ required: boolean;
402
+ control: "inline-radio";
403
+ } | {
404
+ description?: string | undefined;
405
+ label?: string | undefined;
406
+ defaultValue?: string | undefined;
407
+ options: string[];
408
+ type: "string";
409
+ required: boolean;
410
+ control: "select";
411
+ } | {
412
+ description?: string | undefined;
413
+ label?: string | undefined;
414
+ defaultValue?: string[] | undefined;
415
+ options: string[];
416
+ type: "string[]";
417
+ required: boolean;
418
+ control: "check";
419
+ } | {
420
+ description?: string | undefined;
421
+ label?: string | undefined;
422
+ defaultValue?: string[] | undefined;
423
+ options: string[];
424
+ type: "string[]";
425
+ required: boolean;
426
+ control: "inline-check";
427
+ } | {
428
+ description?: string | undefined;
429
+ label?: string | undefined;
430
+ defaultValue?: string[] | undefined;
431
+ options: string[];
432
+ type: "string[]";
433
+ required: boolean;
434
+ control: "multi-select";
435
+ } | {
436
+ description?: string | undefined;
437
+ label?: string | undefined;
438
+ defaultValue?: string | undefined;
439
+ accept?: string | undefined;
440
+ type: "string";
441
+ required: boolean;
442
+ control: "file";
443
+ } | {
444
+ description?: string | undefined;
445
+ label?: string | undefined;
446
+ defaultValue?: string | undefined;
447
+ type: "string";
448
+ required: boolean;
449
+ control: "url";
450
+ } | {
451
+ description?: string | undefined;
452
+ label?: string | undefined;
453
+ defaultValue?: Record<string, string> | undefined;
454
+ type: "Record<string, string>";
455
+ required: boolean;
456
+ control: "object";
457
+ } | {
458
+ description?: string | undefined;
459
+ label?: string | undefined;
460
+ defaultValue?: string | undefined;
461
+ type: "string";
462
+ required: boolean;
463
+ control: "date";
464
+ }>;
465
+ }, {
466
+ initialProps?: string[] | undefined;
467
+ props: Record<string, {
468
+ description?: string | undefined;
469
+ label?: string | undefined;
470
+ defaultValue?: number | undefined;
471
+ type: "number";
472
+ required: boolean;
473
+ control: "number";
474
+ } | {
475
+ description?: string | undefined;
476
+ label?: string | undefined;
477
+ defaultValue?: number | undefined;
478
+ type: "number";
479
+ required: boolean;
480
+ control: "range";
481
+ } | {
482
+ description?: string | undefined;
483
+ label?: string | undefined;
484
+ defaultValue?: string | undefined;
485
+ rows?: number | undefined;
486
+ type: "string";
487
+ required: boolean;
488
+ control: "text";
489
+ } | {
490
+ description?: string | undefined;
491
+ label?: string | undefined;
492
+ defaultValue?: string | undefined;
493
+ type: "string";
494
+ required: boolean;
495
+ control: "color";
496
+ } | {
497
+ description?: string | undefined;
498
+ label?: string | undefined;
499
+ defaultValue?: boolean | undefined;
500
+ type: "boolean";
501
+ required: boolean;
502
+ control: "boolean";
503
+ } | {
504
+ description?: string | undefined;
505
+ label?: string | undefined;
506
+ defaultValue?: string | undefined;
507
+ options: string[];
508
+ type: "string";
509
+ required: boolean;
510
+ control: "radio";
511
+ } | {
512
+ description?: string | undefined;
513
+ label?: string | undefined;
514
+ defaultValue?: string | undefined;
515
+ options: string[];
516
+ type: "string";
517
+ required: boolean;
518
+ control: "inline-radio";
519
+ } | {
520
+ description?: string | undefined;
521
+ label?: string | undefined;
522
+ defaultValue?: string | undefined;
523
+ options: string[];
524
+ type: "string";
525
+ required: boolean;
526
+ control: "select";
527
+ } | {
528
+ description?: string | undefined;
529
+ label?: string | undefined;
530
+ defaultValue?: string[] | undefined;
531
+ options: string[];
532
+ type: "string[]";
533
+ required: boolean;
534
+ control: "check";
535
+ } | {
536
+ description?: string | undefined;
537
+ label?: string | undefined;
538
+ defaultValue?: string[] | undefined;
539
+ options: string[];
540
+ type: "string[]";
541
+ required: boolean;
542
+ control: "inline-check";
543
+ } | {
544
+ description?: string | undefined;
545
+ label?: string | undefined;
546
+ defaultValue?: string[] | undefined;
547
+ options: string[];
548
+ type: "string[]";
549
+ required: boolean;
550
+ control: "multi-select";
551
+ } | {
552
+ description?: string | undefined;
553
+ label?: string | undefined;
554
+ defaultValue?: string | undefined;
555
+ accept?: string | undefined;
556
+ type: "string";
557
+ required: boolean;
558
+ control: "file";
559
+ } | {
560
+ description?: string | undefined;
561
+ label?: string | undefined;
562
+ defaultValue?: string | undefined;
563
+ type: "string";
564
+ required: boolean;
565
+ control: "url";
566
+ } | {
567
+ description?: string | undefined;
568
+ label?: string | undefined;
569
+ defaultValue?: Record<string, string> | undefined;
570
+ type: "Record<string, string>";
571
+ required: boolean;
572
+ control: "object";
573
+ } | {
574
+ description?: string | undefined;
575
+ label?: string | undefined;
576
+ defaultValue?: string | undefined;
577
+ type: "string";
578
+ required: boolean;
579
+ control: "date";
580
+ }>;
581
+ }>;
582
+ export type WsComponentPropsMeta = z.infer<typeof WsComponentPropsMeta>;
583
+ export declare const componentCategories: readonly ["general", "typography", "media", "forms"];
584
+ declare const WsComponentMeta: z.ZodObject<{
585
+ category: z.ZodOptional<z.ZodEnum<["general", "typography", "media", "forms"]>>;
586
+ type: z.ZodEnum<["container", "control", "embed", "rich-text", "rich-text-child"]>;
587
+ label: z.ZodString;
588
+ Icon: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
589
+ presetStyle: z.ZodOptional<z.ZodAny>;
590
+ children: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
591
+ }, "strip", z.ZodTypeAny, {
592
+ children?: string[] | undefined;
593
+ category?: "media" | "general" | "typography" | "forms" | undefined;
594
+ presetStyle?: any;
595
+ type: "embed" | "control" | "container" | "rich-text" | "rich-text-child";
596
+ label: string;
597
+ Icon: (...args: unknown[]) => unknown;
598
+ }, {
599
+ children?: string[] | undefined;
600
+ category?: "media" | "general" | "typography" | "forms" | undefined;
601
+ presetStyle?: any;
602
+ type: "embed" | "control" | "container" | "rich-text" | "rich-text-child";
603
+ label: string;
604
+ Icon: (...args: unknown[]) => unknown;
605
+ }>;
606
+ export type WsComponentMeta = Omit<z.infer<typeof WsComponentMeta>, "presetStyle" | "Icon"> & {
607
+ presetStyle?: PresetStyle;
608
+ Icon: FunctionComponent<IconProps>;
609
+ };
610
+ export {};
@@ -0,0 +1,34 @@
1
+ /// <reference types="react" />
2
+ import * as components from "./components";
3
+ export type ComponentName = keyof typeof components;
4
+ export declare const getComponentNames: () => ComponentName[];
5
+ /**
6
+ * Now used only in builder app
7
+ * @todo Consider using the same approach in the builder app as in the published apps . A dynamic import is needed
8
+ */
9
+ export declare const getComponent: (name: string) => undefined | (typeof components)[ComponentName];
10
+ /**
11
+ * The application imports only the components it uses, then pass them to createGetComponent i.e.
12
+ * getComponent = createGetComponent({ Box, BlaBla })
13
+ * <RootInstance data={data} getComponent={getComponent} />
14
+ * see example /packages/sdk-size-test/app/routes/$.tsx
15
+ **/
16
+ export declare const createGetComponent: (comps: Partial<typeof components>) => (name: string) => import("react").ForwardRefExoticComponent<{
17
+ children?: import("react").ReactNode;
18
+ } & import("react").RefAttributes<HTMLDivElement>> | import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLBodyElement>, HTMLBodyElement>, "ref"> & import("react").RefAttributes<HTMLBodyElement>> | import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
19
+ tag?: "div" | "address" | "article" | "aside" | "figure" | "footer" | "header" | "main" | "nav" | "section" | undefined;
20
+ }, "ref"> & import("react").RefAttributes<HTMLDivElement>> | import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>> | import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLHeadingElement> & import("react").HTMLAttributes<HTMLHeadingElement> & {
21
+ tag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | undefined;
22
+ }, "ref"> & import("react").RefAttributes<HTMLHeadingElement>> | import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "href" | "target"> & {
23
+ href?: string | undefined;
24
+ target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
25
+ prefetch?: "none" | "intent" | "render" | undefined;
26
+ }, "ref"> & import("react").RefAttributes<HTMLAnchorElement>> | import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>> | import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
27
+ innerText?: string | undefined;
28
+ }, "ref"> & import("react").RefAttributes<HTMLButtonElement>> | import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>> | import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "ref"> & import("react").RefAttributes<HTMLFormElement>> | import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "ref"> & import("react").RefAttributes<HTMLImageElement>> | import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").BlockquoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>, "ref"> & import("react").RefAttributes<HTMLQuoteElement>> | import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLUListElement> & import("react").HTMLAttributes<HTMLUListElement> & import("react").ClassAttributes<HTMLOListElement> & import("react").OlHTMLAttributes<HTMLOListElement> & {
29
+ ordered?: boolean | undefined;
30
+ }, "ref"> & import("react").RefAttributes<HTMLUListElement>> | import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & import("react").RefAttributes<HTMLLIElement>> | import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHRElement>, HTMLHRElement>, "ref"> & import("react").RefAttributes<HTMLHRElement>> | import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "inline"> & {
31
+ inline?: boolean | undefined;
32
+ meta?: string | undefined;
33
+ }, "ref"> & import("react").RefAttributes<HTMLElement>> | undefined;
34
+ export type GetComponent = typeof getComponent;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * This file should contain all the components that we use in the builder/production app
3
+ *
4
+ * The application imports only the components it uses and uses
5
+ * getComponent = createGetComponent({ Box, BlaBla })to pass them to RootInstance
6
+ * see example /packages/sdk-size-test/app/routes/$.tsx
7
+ */
8
+ export { Slot } from "./slot";
9
+ export { Fragment } from "./fragment";
10
+ export { Body } from "./body";
11
+ export { Box } from "./box";
12
+ export { TextBlock } from "./text-block";
13
+ export { Heading } from "./heading";
14
+ export { Paragraph } from "./paragraph";
15
+ export { Link } from "./link";
16
+ export { LinkBlock } from "./link-block";
17
+ export { RichTextLink } from "./rich-text-link";
18
+ export { Span } from "./span";
19
+ export { Bold } from "./bold";
20
+ export { Italic } from "./italic";
21
+ export { Superscript } from "./superscript";
22
+ export { Subscript } from "./subscript";
23
+ export { Button } from "./button";
24
+ export { Input } from "./input";
25
+ export { Form } from "./form";
26
+ export { Image } from "./image";
27
+ export { Blockquote } from "./blockquote";
28
+ export { List } from "./list";
29
+ export { ListItem } from "./list-item";
30
+ export { Separator } from "./separator";
31
+ export { Code } from "./code";
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ export declare const defaultTag = "form";
3
+ export declare const Form: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "ref"> & import("react").RefAttributes<HTMLFormElement>>;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import type { ComponentStory, ComponentMeta } from "@storybook/react";
3
+ declare const _default: ComponentMeta<import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "ref"> & import("react").RefAttributes<HTMLFormElement>>>;
4
+ export default _default;
5
+ export declare const Form: ComponentStory<import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "ref"> & import("react").RefAttributes<HTMLFormElement>>>;