@webstudio-is/react-sdk 0.151.0 → 0.163.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.
@@ -60,6 +60,7 @@ var nav = baseStyle;
60
60
  var section = baseStyle;
61
61
  var form = baseStyle;
62
62
  var label = baseStyle;
63
+ var time = baseStyle;
63
64
  var h1 = baseStyle;
64
65
  var h2 = baseStyle;
65
66
  var h3 = baseStyle;
@@ -375,5 +376,6 @@ export {
375
376
  sup,
376
377
  table,
377
378
  textarea,
379
+ time,
378
380
  ul
379
381
  };
package/lib/index.js CHANGED
@@ -216,6 +216,106 @@ import {
216
216
  createRegularStyleSheet,
217
217
  generateAtomic
218
218
  } from "@webstudio-is/css-engine";
219
+
220
+ // src/core-components.ts
221
+ import { ListViewIcon, PaintBrushIcon } from "@webstudio-is/icons/svg";
222
+ var portalComponent = "Slot";
223
+ var collectionComponent = "ws:collection";
224
+ var collectionMeta = {
225
+ category: "data",
226
+ order: 2,
227
+ type: "container",
228
+ label: "Collection",
229
+ icon: ListViewIcon,
230
+ stylable: false,
231
+ template: [
232
+ {
233
+ type: "instance",
234
+ component: collectionComponent,
235
+ props: [
236
+ {
237
+ name: "data",
238
+ type: "json",
239
+ value: [
240
+ "Collection Item 1",
241
+ "Collection Item 2",
242
+ "Collection Item 3"
243
+ ]
244
+ },
245
+ {
246
+ name: "item",
247
+ type: "parameter",
248
+ variableName: "collectionItem",
249
+ variableAlias: "Collection Item"
250
+ }
251
+ ],
252
+ children: [
253
+ {
254
+ type: "instance",
255
+ component: "Box",
256
+ children: [{ type: "expression", value: "collectionItem" }]
257
+ }
258
+ ]
259
+ }
260
+ ]
261
+ };
262
+ var collectionPropsMeta = {
263
+ props: {
264
+ data: {
265
+ required: true,
266
+ control: "json",
267
+ type: "json"
268
+ }
269
+ },
270
+ initialProps: ["data"]
271
+ };
272
+ var descendantComponent = "ws:descendant";
273
+ var descendantMeta = {
274
+ category: "internal",
275
+ type: "control",
276
+ label: "Descendant",
277
+ icon: PaintBrushIcon,
278
+ detachable: false
279
+ };
280
+ var descendantPropsMeta = {
281
+ props: {
282
+ selector: {
283
+ required: true,
284
+ type: "string",
285
+ control: "select",
286
+ options: [
287
+ " p",
288
+ " h1",
289
+ " h2",
290
+ " h3",
291
+ " h4",
292
+ " h5",
293
+ " h6",
294
+ " :where(strong, b)",
295
+ " :where(em, i)",
296
+ " a",
297
+ " img",
298
+ " blockquote",
299
+ " code",
300
+ " :where(ul, ol)",
301
+ " li",
302
+ " hr"
303
+ ]
304
+ }
305
+ },
306
+ initialProps: ["selector"]
307
+ };
308
+ var coreMetas = {
309
+ [collectionComponent]: collectionMeta,
310
+ [descendantComponent]: descendantMeta
311
+ };
312
+ var corePropsMetas = {
313
+ [collectionComponent]: collectionPropsMeta,
314
+ [descendantComponent]: descendantPropsMeta
315
+ };
316
+ var isCoreComponent = (component) => component === collectionComponent || component === descendantComponent;
317
+
318
+ // src/css/css.ts
219
319
  var createImageValueTransformer = (assets, { assetBaseUrl }) => (styleValue) => {
220
320
  if (styleValue.type === "image" && styleValue.value.type === "asset") {
221
321
  const asset = assets.get(styleValue.value.value);
@@ -235,6 +335,8 @@ var createImageValueTransformer = (assets, { assetBaseUrl }) => (styleValue) =>
235
335
  };
236
336
  var generateCss = ({
237
337
  assets,
338
+ instances,
339
+ props,
238
340
  breakpoints,
239
341
  styles,
240
342
  styleSourceSelections,
@@ -243,6 +345,20 @@ var generateCss = ({
243
345
  atomic
244
346
  }) => {
245
347
  const sheet = createRegularStyleSheet({ name: "ssr" });
348
+ const parentIdByInstanceId = /* @__PURE__ */ new Map();
349
+ for (const instance of instances.values()) {
350
+ for (const child of instance.children) {
351
+ if (child.type === "id") {
352
+ parentIdByInstanceId.set(child.value, instance.id);
353
+ }
354
+ }
355
+ }
356
+ const descendantSelectorByInstanceId = /* @__PURE__ */ new Map();
357
+ for (const prop of props.values()) {
358
+ if (prop.name === "selector" && prop.type === "string") {
359
+ descendantSelectorByInstanceId.set(prop.instanceId, prop.value);
360
+ }
361
+ }
246
362
  addGlobalRules(sheet, { assets, assetBaseUrl });
247
363
  for (const breakpoint of breakpoints.values()) {
248
364
  sheet.addMediaRule(breakpoint.id, breakpoint);
@@ -271,8 +387,23 @@ var generateCss = ({
271
387
  });
272
388
  }
273
389
  const instanceByRule = /* @__PURE__ */ new Map();
274
- for (const { instanceId, values } of styleSourceSelections.values()) {
275
- const rule = sheet.addNestingRule(`[${idAttribute}="${instanceId}"]`);
390
+ for (const selection of styleSourceSelections.values()) {
391
+ let { instanceId } = selection;
392
+ const { values } = selection;
393
+ let descendantSuffix = "";
394
+ const instance = instances.get(instanceId);
395
+ if (instance?.component === descendantComponent) {
396
+ const parentId = parentIdByInstanceId.get(instanceId);
397
+ const descendantSelector = descendantSelectorByInstanceId.get(instanceId);
398
+ if (parentId && descendantSelector) {
399
+ descendantSuffix = descendantSelector;
400
+ instanceId = parentId;
401
+ }
402
+ }
403
+ const rule = sheet.addNestingRule(
404
+ `[${idAttribute}="${instanceId}"]`,
405
+ descendantSuffix
406
+ );
276
407
  rule.applyMixins(values);
277
408
  instanceByRule.set(rule, instanceId);
278
409
  }
@@ -405,65 +536,6 @@ var createInstanceElement = ({
405
536
  );
406
537
  };
407
538
 
408
- // src/core-components.ts
409
- import { ListViewIcon } from "@webstudio-is/icons/svg";
410
- var portalComponent = "Slot";
411
- var collectionComponent = "ws:collection";
412
- var collectionMeta = {
413
- category: "data",
414
- order: 7,
415
- type: "container",
416
- label: "Collection",
417
- icon: ListViewIcon,
418
- stylable: false,
419
- template: [
420
- {
421
- type: "instance",
422
- component: collectionComponent,
423
- props: [
424
- {
425
- name: "data",
426
- type: "json",
427
- value: [
428
- "Collection Item 1",
429
- "Collection Item 2",
430
- "Collection Item 3"
431
- ]
432
- },
433
- {
434
- name: "item",
435
- type: "parameter",
436
- variableName: "collectionItem",
437
- variableAlias: "Collection Item"
438
- }
439
- ],
440
- children: [
441
- {
442
- type: "instance",
443
- component: "Box",
444
- children: [{ type: "expression", value: "collectionItem" }]
445
- }
446
- ]
447
- }
448
- ]
449
- };
450
- var collectionPropsMeta = {
451
- props: {
452
- data: {
453
- required: true,
454
- control: "json",
455
- type: "json"
456
- }
457
- },
458
- initialProps: ["data"]
459
- };
460
- var coreMetas = {
461
- [collectionComponent]: collectionMeta
462
- };
463
- var corePropsMetas = {
464
- [collectionComponent]: collectionPropsMeta
465
- };
466
-
467
539
  // src/prop-meta.ts
468
540
  import { z } from "zod";
469
541
  var common = {
@@ -1011,7 +1083,8 @@ var componentCategories = [
1011
1083
  "forms",
1012
1084
  "radix",
1013
1085
  "xml",
1014
- "hidden"
1086
+ "hidden",
1087
+ "internal"
1015
1088
  ];
1016
1089
  var stateCategories = ["states", "component-states"];
1017
1090
  var ComponentState = z3.object({
@@ -1314,6 +1387,9 @@ className=${JSON.stringify(classes.join(" "))}`;
1314
1387
  `;
1315
1388
  }
1316
1389
  }
1390
+ if (instance.component === descendantComponent) {
1391
+ return "";
1392
+ }
1317
1393
  if (conditionValue) {
1318
1394
  generatedElement += `}
1319
1395
  `;
@@ -1483,6 +1559,7 @@ export {
1483
1559
  createImageValueTransformer,
1484
1560
  createInstanceChildrenElements,
1485
1561
  defaultStates,
1562
+ descendantComponent,
1486
1563
  generateCss,
1487
1564
  generateDataFromEmbedTemplate,
1488
1565
  generateJsxChildren,
@@ -1498,6 +1575,7 @@ export {
1498
1575
  getStyleRules,
1499
1576
  idAttribute,
1500
1577
  indexAttribute,
1578
+ isCoreComponent,
1501
1579
  namespaceMeta,
1502
1580
  normalizeProps,
1503
1581
  portalComponent,
@@ -718,7 +718,7 @@ declare const WsComponentPropsMeta: z.ZodObject<{
718
718
  initialProps?: string[] | undefined;
719
719
  }>;
720
720
  export type WsComponentPropsMeta = z.infer<typeof WsComponentPropsMeta>;
721
- export declare const componentCategories: readonly ["general", "text", "data", "media", "forms", "radix", "xml", "hidden"];
721
+ export declare const componentCategories: readonly ["general", "text", "data", "media", "forms", "radix", "xml", "hidden", "internal"];
722
722
  export declare const stateCategories: readonly ["states", "component-states"];
723
723
  export declare const ComponentState: z.ZodObject<{
724
724
  category: z.ZodOptional<z.ZodEnum<["states", "component-states"]>>;
@@ -736,7 +736,7 @@ export declare const ComponentState: z.ZodObject<{
736
736
  export type ComponentState = z.infer<typeof ComponentState>;
737
737
  export declare const defaultStates: ComponentState[];
738
738
  export declare const WsComponentMeta: z.ZodObject<{
739
- category: z.ZodOptional<z.ZodEnum<["general", "text", "data", "media", "forms", "radix", "xml", "hidden"]>>;
739
+ category: z.ZodOptional<z.ZodEnum<["general", "text", "data", "media", "forms", "radix", "xml", "hidden", "internal"]>>;
740
740
  type: z.ZodEnum<["container", "control", "embed", "rich-text-child"]>;
741
741
  requiredAncestors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
742
742
  invalidAncestors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -3383,9 +3383,9 @@ export declare const WsComponentMeta: z.ZodObject<{
3383
3383
  }>]>, "many">>>;
3384
3384
  order: z.ZodOptional<z.ZodNumber>;
3385
3385
  }, "strip", z.ZodTypeAny, {
3386
- type: "embed" | "control" | "container" | "rich-text-child";
3386
+ type: "control" | "embed" | "container" | "rich-text-child";
3387
3387
  icon: string;
3388
- category?: "data" | "text" | "hidden" | "media" | "general" | "forms" | "radix" | "xml" | undefined;
3388
+ category?: "data" | "xml" | "text" | "hidden" | "media" | "general" | "forms" | "radix" | "internal" | undefined;
3389
3389
  requiredAncestors?: string[] | undefined;
3390
3390
  invalidAncestors?: string[] | undefined;
3391
3391
  indexWithinAncestor?: string | undefined;
@@ -4276,9 +4276,9 @@ export declare const WsComponentMeta: z.ZodObject<{
4276
4276
  } | import("../embed-template").EmbedTemplateInstance)[] | undefined;
4277
4277
  order?: number | undefined;
4278
4278
  }, {
4279
- type: "embed" | "control" | "container" | "rich-text-child";
4279
+ type: "control" | "embed" | "container" | "rich-text-child";
4280
4280
  icon: string;
4281
- category?: "data" | "text" | "hidden" | "media" | "general" | "forms" | "radix" | "xml" | undefined;
4281
+ category?: "data" | "xml" | "text" | "hidden" | "media" | "general" | "forms" | "radix" | "internal" | undefined;
4282
4282
  requiredAncestors?: string[] | undefined;
4283
4283
  invalidAncestors?: string[] | undefined;
4284
4284
  indexWithinAncestor?: string | undefined;
@@ -1,8 +1,10 @@
1
1
  import type { WsComponentMeta } from "./components/component-meta";
2
2
  export declare const portalComponent = "Slot";
3
3
  export declare const collectionComponent = "ws:collection";
4
+ export declare const descendantComponent = "ws:descendant";
4
5
  export declare const coreMetas: {
5
6
  "ws:collection": WsComponentMeta;
7
+ "ws:descendant": WsComponentMeta;
6
8
  };
7
9
  export declare const corePropsMetas: {
8
10
  "ws:collection": {
@@ -150,4 +152,150 @@ export declare const corePropsMetas: {
150
152
  }>;
151
153
  initialProps?: string[] | undefined;
152
154
  };
155
+ "ws:descendant": {
156
+ props: Record<string, {
157
+ type: "number";
158
+ required: boolean;
159
+ control: "number";
160
+ defaultValue?: number | undefined;
161
+ label?: string | undefined;
162
+ description?: string | undefined;
163
+ } | {
164
+ type: "number";
165
+ required: boolean;
166
+ control: "range";
167
+ defaultValue?: number | undefined;
168
+ label?: string | undefined;
169
+ description?: string | undefined;
170
+ } | {
171
+ type: "string";
172
+ required: boolean;
173
+ control: "text";
174
+ defaultValue?: string | undefined;
175
+ rows?: number | undefined;
176
+ label?: string | undefined;
177
+ description?: string | undefined;
178
+ } | {
179
+ type: "string";
180
+ required: boolean;
181
+ control: "code";
182
+ defaultValue?: string | undefined;
183
+ label?: string | undefined;
184
+ description?: string | undefined;
185
+ } | {
186
+ type: "string";
187
+ required: boolean;
188
+ control: "codetext";
189
+ description?: string | undefined;
190
+ label?: string | undefined;
191
+ defaultValue?: string | undefined;
192
+ } | {
193
+ type: "string";
194
+ required: boolean;
195
+ control: "color";
196
+ defaultValue?: string | undefined;
197
+ label?: string | undefined;
198
+ description?: string | undefined;
199
+ } | {
200
+ type: "boolean";
201
+ required: boolean;
202
+ control: "boolean";
203
+ defaultValue?: boolean | undefined;
204
+ label?: string | undefined;
205
+ description?: string | undefined;
206
+ } | {
207
+ options: string[];
208
+ type: "string";
209
+ required: boolean;
210
+ control: "radio";
211
+ defaultValue?: string | undefined;
212
+ label?: string | undefined;
213
+ description?: string | undefined;
214
+ } | {
215
+ options: string[];
216
+ type: "string";
217
+ required: boolean;
218
+ control: "inline-radio";
219
+ defaultValue?: string | undefined;
220
+ label?: string | undefined;
221
+ description?: string | undefined;
222
+ } | {
223
+ options: string[];
224
+ type: "string";
225
+ required: boolean;
226
+ control: "select";
227
+ defaultValue?: string | undefined;
228
+ label?: string | undefined;
229
+ description?: string | undefined;
230
+ } | {
231
+ options: string[];
232
+ type: "string[]";
233
+ required: boolean;
234
+ control: "check";
235
+ defaultValue?: string[] | undefined;
236
+ label?: string | undefined;
237
+ description?: string | undefined;
238
+ } | {
239
+ options: string[];
240
+ type: "string[]";
241
+ required: boolean;
242
+ control: "inline-check";
243
+ defaultValue?: string[] | undefined;
244
+ label?: string | undefined;
245
+ description?: string | undefined;
246
+ } | {
247
+ options: string[];
248
+ type: "string[]";
249
+ required: boolean;
250
+ control: "multi-select";
251
+ defaultValue?: string[] | undefined;
252
+ label?: string | undefined;
253
+ description?: string | undefined;
254
+ } | {
255
+ type: "string";
256
+ required: boolean;
257
+ control: "file";
258
+ defaultValue?: string | undefined;
259
+ accept?: string | undefined;
260
+ label?: string | undefined;
261
+ description?: string | undefined;
262
+ } | {
263
+ type: "string";
264
+ required: boolean;
265
+ control: "url";
266
+ defaultValue?: string | undefined;
267
+ label?: string | undefined;
268
+ description?: string | undefined;
269
+ } | {
270
+ type: "json";
271
+ required: boolean;
272
+ control: "json";
273
+ defaultValue?: unknown;
274
+ label?: string | undefined;
275
+ description?: string | undefined;
276
+ } | {
277
+ type: "string";
278
+ required: boolean;
279
+ control: "date";
280
+ defaultValue?: string | undefined;
281
+ label?: string | undefined;
282
+ description?: string | undefined;
283
+ } | {
284
+ type: "action";
285
+ required: boolean;
286
+ control: "action";
287
+ defaultValue?: undefined;
288
+ label?: string | undefined;
289
+ description?: string | undefined;
290
+ } | {
291
+ type: "string";
292
+ required: boolean;
293
+ control: "textContent";
294
+ defaultValue?: string | undefined;
295
+ label?: string | undefined;
296
+ description?: string | undefined;
297
+ }>;
298
+ initialProps?: string[] | undefined;
299
+ };
153
300
  };
301
+ export declare const isCoreComponent: (component: string) => boolean;
@@ -1,8 +1,10 @@
1
1
  import { type TransformValue } from "@webstudio-is/css-engine";
2
- import type { Assets, Breakpoints, StyleSourceSelections, Styles } from "@webstudio-is/sdk";
2
+ import type { Assets, Breakpoints, Instances, Props, StyleSourceSelections, Styles } from "@webstudio-is/sdk";
3
3
  import type { WsComponentMeta } from "../components/component-meta";
4
4
  export type CssConfig = {
5
5
  assets: Assets;
6
+ instances: Instances;
7
+ props: Props;
6
8
  breakpoints: Breakpoints;
7
9
  styles: Styles;
8
10
  styleSourceSelections: StyleSourceSelections;
@@ -13,7 +15,7 @@ export type CssConfig = {
13
15
  export declare const createImageValueTransformer: (assets: Map<string, {
14
16
  type: "font";
15
17
  name: string;
16
- format: "ttf" | "woff" | "woff2" | "otf";
18
+ format: "ttf" | "woff" | "woff2";
17
19
  meta: ({
18
20
  family: string;
19
21
  style: "normal" | "italic" | "oblique";
@@ -60,7 +62,7 @@ export declare const createImageValueTransformer: (assets: Map<string, {
60
62
  }>, { assetBaseUrl }: {
61
63
  assetBaseUrl: string;
62
64
  }) => TransformValue;
63
- export declare const generateCss: ({ assets, breakpoints, styles, styleSourceSelections, componentMetas, assetBaseUrl, atomic, }: CssConfig) => {
65
+ export declare const generateCss: ({ assets, instances, props, breakpoints, styles, styleSourceSelections, componentMetas, assetBaseUrl, atomic, }: CssConfig) => {
64
66
  cssText: string;
65
67
  classesMap: Map<string, string[]>;
66
68
  };
@@ -5284,6 +5284,445 @@ export declare const label: ({
5284
5284
  value: string;
5285
5285
  };
5286
5286
  })[];
5287
+ export declare const time: ({
5288
+ value: {
5289
+ value: number;
5290
+ type: "unit";
5291
+ 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";
5292
+ } | {
5293
+ value: string;
5294
+ type: "keyword";
5295
+ } | {
5296
+ value: string;
5297
+ type: "unparsed";
5298
+ hidden?: boolean | undefined;
5299
+ } | {
5300
+ value: string[];
5301
+ type: "fontFamily";
5302
+ } | {
5303
+ type: "rgb";
5304
+ r: number;
5305
+ g: number;
5306
+ b: number;
5307
+ alpha: number;
5308
+ } | {
5309
+ type: "function";
5310
+ name: string;
5311
+ args: {
5312
+ value: number;
5313
+ type: "unit";
5314
+ 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";
5315
+ } | {
5316
+ value: string;
5317
+ type: "keyword";
5318
+ } | {
5319
+ value: string;
5320
+ type: "unparsed";
5321
+ hidden?: boolean | undefined;
5322
+ } | {
5323
+ value: string[];
5324
+ type: "fontFamily";
5325
+ } | {
5326
+ type: "rgb";
5327
+ r: number;
5328
+ g: number;
5329
+ b: number;
5330
+ alpha: number;
5331
+ } | any | {
5332
+ value: {
5333
+ value: string;
5334
+ type: "asset";
5335
+ } | {
5336
+ type: "url";
5337
+ url: string;
5338
+ };
5339
+ type: "image";
5340
+ hidden?: boolean | undefined;
5341
+ } | {
5342
+ value: ({
5343
+ value: number;
5344
+ type: "unit";
5345
+ 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";
5346
+ } | {
5347
+ value: string;
5348
+ type: "keyword";
5349
+ } | {
5350
+ value: string;
5351
+ type: "unparsed";
5352
+ hidden?: boolean | undefined;
5353
+ } | {
5354
+ type: "rgb";
5355
+ r: number;
5356
+ g: number;
5357
+ b: number;
5358
+ alpha: number;
5359
+ } | any)[];
5360
+ type: "tuple";
5361
+ hidden?: boolean | undefined;
5362
+ } | {
5363
+ value: string;
5364
+ type: "invalid";
5365
+ } | {
5366
+ value: ({
5367
+ value: number;
5368
+ type: "unit";
5369
+ 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";
5370
+ } | {
5371
+ value: string;
5372
+ type: "keyword";
5373
+ } | {
5374
+ value: string;
5375
+ type: "unparsed";
5376
+ hidden?: boolean | undefined;
5377
+ } | any | {
5378
+ value: {
5379
+ value: string;
5380
+ type: "asset";
5381
+ } | {
5382
+ type: "url";
5383
+ url: string;
5384
+ };
5385
+ type: "image";
5386
+ hidden?: boolean | undefined;
5387
+ } | {
5388
+ value: ({
5389
+ value: number;
5390
+ type: "unit";
5391
+ 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";
5392
+ } | {
5393
+ value: string;
5394
+ type: "keyword";
5395
+ } | {
5396
+ value: string;
5397
+ type: "unparsed";
5398
+ hidden?: boolean | undefined;
5399
+ } | {
5400
+ type: "rgb";
5401
+ r: number;
5402
+ g: number;
5403
+ b: number;
5404
+ alpha: number;
5405
+ } | any)[];
5406
+ type: "tuple";
5407
+ hidden?: boolean | undefined;
5408
+ } | {
5409
+ value: string;
5410
+ type: "invalid";
5411
+ })[];
5412
+ type: "layers";
5413
+ } | {
5414
+ type: "guaranteedInvalid";
5415
+ } | {
5416
+ value: "";
5417
+ type: "unset";
5418
+ } | {
5419
+ value: string;
5420
+ type: "var";
5421
+ fallbacks: ({
5422
+ value: number;
5423
+ type: "unit";
5424
+ 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";
5425
+ } | {
5426
+ value: string;
5427
+ type: "keyword";
5428
+ } | {
5429
+ value: string;
5430
+ type: "unparsed";
5431
+ hidden?: boolean | undefined;
5432
+ } | {
5433
+ value: string[];
5434
+ type: "fontFamily";
5435
+ } | {
5436
+ type: "rgb";
5437
+ r: number;
5438
+ g: number;
5439
+ b: number;
5440
+ alpha: number;
5441
+ } | any | {
5442
+ value: {
5443
+ value: string;
5444
+ type: "asset";
5445
+ } | {
5446
+ type: "url";
5447
+ url: string;
5448
+ };
5449
+ type: "image";
5450
+ hidden?: boolean | undefined;
5451
+ } | {
5452
+ value: ({
5453
+ value: number;
5454
+ type: "unit";
5455
+ 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";
5456
+ } | {
5457
+ value: string;
5458
+ type: "keyword";
5459
+ } | {
5460
+ value: string;
5461
+ type: "unparsed";
5462
+ hidden?: boolean | undefined;
5463
+ } | {
5464
+ type: "rgb";
5465
+ r: number;
5466
+ g: number;
5467
+ b: number;
5468
+ alpha: number;
5469
+ } | any)[];
5470
+ type: "tuple";
5471
+ hidden?: boolean | undefined;
5472
+ } | {
5473
+ value: ({
5474
+ value: number;
5475
+ type: "unit";
5476
+ 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";
5477
+ } | {
5478
+ value: string;
5479
+ type: "keyword";
5480
+ } | {
5481
+ value: string;
5482
+ type: "unparsed";
5483
+ hidden?: boolean | undefined;
5484
+ } | any | {
5485
+ value: {
5486
+ value: string;
5487
+ type: "asset";
5488
+ } | {
5489
+ type: "url";
5490
+ url: string;
5491
+ };
5492
+ type: "image";
5493
+ hidden?: boolean | undefined;
5494
+ } | {
5495
+ value: ({
5496
+ value: number;
5497
+ type: "unit";
5498
+ 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";
5499
+ } | {
5500
+ value: string;
5501
+ type: "keyword";
5502
+ } | {
5503
+ value: string;
5504
+ type: "unparsed";
5505
+ hidden?: boolean | undefined;
5506
+ } | {
5507
+ type: "rgb";
5508
+ r: number;
5509
+ g: number;
5510
+ b: number;
5511
+ alpha: number;
5512
+ } | any)[];
5513
+ type: "tuple";
5514
+ hidden?: boolean | undefined;
5515
+ } | {
5516
+ value: string;
5517
+ type: "invalid";
5518
+ })[];
5519
+ type: "layers";
5520
+ } | {
5521
+ type: "guaranteedInvalid";
5522
+ })[];
5523
+ };
5524
+ } | {
5525
+ value: {
5526
+ value: string;
5527
+ type: "asset";
5528
+ } | {
5529
+ type: "url";
5530
+ url: string;
5531
+ };
5532
+ type: "image";
5533
+ hidden?: boolean | undefined;
5534
+ } | {
5535
+ value: ({
5536
+ value: number;
5537
+ type: "unit";
5538
+ 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";
5539
+ } | {
5540
+ value: string;
5541
+ type: "keyword";
5542
+ } | {
5543
+ value: string;
5544
+ type: "unparsed";
5545
+ hidden?: boolean | undefined;
5546
+ } | {
5547
+ type: "rgb";
5548
+ r: number;
5549
+ g: number;
5550
+ b: number;
5551
+ alpha: number;
5552
+ } | any)[];
5553
+ type: "tuple";
5554
+ hidden?: boolean | undefined;
5555
+ } | {
5556
+ value: string;
5557
+ type: "invalid";
5558
+ } | {
5559
+ value: ({
5560
+ value: number;
5561
+ type: "unit";
5562
+ 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";
5563
+ } | {
5564
+ value: string;
5565
+ type: "keyword";
5566
+ } | {
5567
+ value: string;
5568
+ type: "unparsed";
5569
+ hidden?: boolean | undefined;
5570
+ } | any | {
5571
+ value: {
5572
+ value: string;
5573
+ type: "asset";
5574
+ } | {
5575
+ type: "url";
5576
+ url: string;
5577
+ };
5578
+ type: "image";
5579
+ hidden?: boolean | undefined;
5580
+ } | {
5581
+ value: ({
5582
+ value: number;
5583
+ type: "unit";
5584
+ 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";
5585
+ } | {
5586
+ value: string;
5587
+ type: "keyword";
5588
+ } | {
5589
+ value: string;
5590
+ type: "unparsed";
5591
+ hidden?: boolean | undefined;
5592
+ } | {
5593
+ type: "rgb";
5594
+ r: number;
5595
+ g: number;
5596
+ b: number;
5597
+ alpha: number;
5598
+ } | any)[];
5599
+ type: "tuple";
5600
+ hidden?: boolean | undefined;
5601
+ } | {
5602
+ value: string;
5603
+ type: "invalid";
5604
+ })[];
5605
+ type: "layers";
5606
+ } | {
5607
+ type: "guaranteedInvalid";
5608
+ } | {
5609
+ value: "";
5610
+ type: "unset";
5611
+ } | {
5612
+ value: string;
5613
+ type: "var";
5614
+ fallbacks: ({
5615
+ value: number;
5616
+ type: "unit";
5617
+ 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";
5618
+ } | {
5619
+ value: string;
5620
+ type: "keyword";
5621
+ } | {
5622
+ value: string;
5623
+ type: "unparsed";
5624
+ hidden?: boolean | undefined;
5625
+ } | {
5626
+ value: string[];
5627
+ type: "fontFamily";
5628
+ } | {
5629
+ type: "rgb";
5630
+ r: number;
5631
+ g: number;
5632
+ b: number;
5633
+ alpha: number;
5634
+ } | any | {
5635
+ value: {
5636
+ value: string;
5637
+ type: "asset";
5638
+ } | {
5639
+ type: "url";
5640
+ url: string;
5641
+ };
5642
+ type: "image";
5643
+ hidden?: boolean | undefined;
5644
+ } | {
5645
+ value: ({
5646
+ value: number;
5647
+ type: "unit";
5648
+ 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";
5649
+ } | {
5650
+ value: string;
5651
+ type: "keyword";
5652
+ } | {
5653
+ value: string;
5654
+ type: "unparsed";
5655
+ hidden?: boolean | undefined;
5656
+ } | {
5657
+ type: "rgb";
5658
+ r: number;
5659
+ g: number;
5660
+ b: number;
5661
+ alpha: number;
5662
+ } | any)[];
5663
+ type: "tuple";
5664
+ hidden?: boolean | undefined;
5665
+ } | {
5666
+ value: ({
5667
+ value: number;
5668
+ type: "unit";
5669
+ 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";
5670
+ } | {
5671
+ value: string;
5672
+ type: "keyword";
5673
+ } | {
5674
+ value: string;
5675
+ type: "unparsed";
5676
+ hidden?: boolean | undefined;
5677
+ } | any | {
5678
+ value: {
5679
+ value: string;
5680
+ type: "asset";
5681
+ } | {
5682
+ type: "url";
5683
+ url: string;
5684
+ };
5685
+ type: "image";
5686
+ hidden?: boolean | undefined;
5687
+ } | {
5688
+ value: ({
5689
+ value: number;
5690
+ type: "unit";
5691
+ 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";
5692
+ } | {
5693
+ value: string;
5694
+ type: "keyword";
5695
+ } | {
5696
+ value: string;
5697
+ type: "unparsed";
5698
+ hidden?: boolean | undefined;
5699
+ } | {
5700
+ type: "rgb";
5701
+ r: number;
5702
+ g: number;
5703
+ b: number;
5704
+ alpha: number;
5705
+ } | any)[];
5706
+ type: "tuple";
5707
+ hidden?: boolean | undefined;
5708
+ } | {
5709
+ value: string;
5710
+ type: "invalid";
5711
+ })[];
5712
+ type: "layers";
5713
+ } | {
5714
+ type: "guaranteedInvalid";
5715
+ })[];
5716
+ };
5717
+ state?: string | undefined;
5718
+ property: import("@webstudio-is/css-engine").StyleProperty;
5719
+ } | {
5720
+ property: "boxSizing";
5721
+ value: {
5722
+ type: "keyword";
5723
+ value: string;
5724
+ };
5725
+ })[];
5287
5726
  export declare const h1: ({
5288
5727
  value: {
5289
5728
  value: number;
@@ -10695,7 +10695,7 @@ export declare const generateDataFromEmbedTemplate: (treeTemplate: ({
10695
10695
  type: "expression";
10696
10696
  } | EmbedTemplateInstance)[], metas: Map<Instance["component"], WsComponentMeta>, defaultBreakpointId: Breakpoint["id"], generateId?: () => string) => WebstudioFragment;
10697
10697
  export declare const namespaceMeta: (meta: WsComponentMeta, namespace: string, components: Set<EmbedTemplateInstance["component"]>) => {
10698
- type: "embed" | "control" | "container" | "rich-text-child";
10698
+ type: "control" | "embed" | "container" | "rich-text-child";
10699
10699
  description?: string | undefined;
10700
10700
  label?: string | undefined;
10701
10701
  order?: number | undefined;
@@ -10706,7 +10706,7 @@ export declare const namespaceMeta: (meta: WsComponentMeta, namespace: string, c
10706
10706
  value: string;
10707
10707
  type: "expression";
10708
10708
  } | EmbedTemplateInstance)[] | undefined;
10709
- category?: "data" | "text" | "hidden" | "media" | "general" | "forms" | "radix" | "xml" | undefined;
10709
+ category?: "data" | "xml" | "text" | "hidden" | "media" | "general" | "forms" | "radix" | "internal" | undefined;
10710
10710
  requiredAncestors?: string[] | undefined;
10711
10711
  invalidAncestors?: string[] | undefined;
10712
10712
  indexWithinAncestor?: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/react-sdk",
3
- "version": "0.151.0",
3
+ "version": "0.163.0",
4
4
  "description": "Webstudio JavaScript / TypeScript API",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -28,24 +28,22 @@
28
28
  "html-tags": "^3.3.1",
29
29
  "nanoid": "^5.0.1",
30
30
  "title-case": "^4.1.0",
31
- "@webstudio-is/css-engine": "0.151.0",
32
- "@webstudio-is/icons": "^0.151.0",
33
- "@webstudio-is/image": "0.151.0",
34
- "@webstudio-is/fonts": "0.151.0",
35
- "@webstudio-is/sdk": "0.151.0"
31
+ "@webstudio-is/css-engine": "0.163.0",
32
+ "@webstudio-is/fonts": "0.163.0",
33
+ "@webstudio-is/image": "0.163.0",
34
+ "@webstudio-is/icons": "^0.163.0",
35
+ "@webstudio-is/sdk": "0.163.0"
36
36
  },
37
37
  "exports": {
38
38
  ".": {
39
39
  "webstudio": "./src/index.ts",
40
40
  "types": "./lib/types/index.d.ts",
41
- "import": "./lib/index.js",
42
- "require": "./lib/index.js"
41
+ "import": "./lib/index.js"
43
42
  },
44
43
  "./css-normalize": {
45
44
  "webstudio": "./src/css/normalize.ts",
46
45
  "types": "./lib/types/css/normalize.d.ts",
47
- "import": "./lib/css/normalize.js",
48
- "require": "./lib/css/normalize.js"
46
+ "import": "./lib/css/normalize.js"
49
47
  }
50
48
  },
51
49
  "files": [