webstudio 0.207.0 → 0.209.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/lib/cli.js CHANGED
@@ -837,6 +837,22 @@ var toValue = (styleValue, transformValue) => {
837
837
  }
838
838
  return value.value.filter((value2) => value2.hidden !== true).map((value2) => toValue(value2, transformValue)).join(" ");
839
839
  }
840
+ if (value.type === "shadow") {
841
+ let shadow = `${toValue(value.offsetX)} ${toValue(value.offsetY)}`;
842
+ if (value.blur) {
843
+ shadow += ` ${toValue(value.blur)}`;
844
+ }
845
+ if (value.spread) {
846
+ shadow += ` ${toValue(value.spread)}`;
847
+ }
848
+ if (value.color) {
849
+ shadow += ` ${toValue(value.color)}`;
850
+ }
851
+ if (value.position === "inset") {
852
+ shadow += ` inset`;
853
+ }
854
+ return shadow;
855
+ }
840
856
  if (value.type === "function") {
841
857
  if (value.hidden === true) {
842
858
  return "";
@@ -937,12 +953,23 @@ var TupleValue = z.object({
937
953
  value: z.array(TupleValueItem),
938
954
  hidden: z.boolean().optional()
939
955
  });
956
+ var ShadowValue = z.object({
957
+ type: z.literal("shadow"),
958
+ hidden: z.boolean().optional(),
959
+ position: z.union([z.literal("inset"), z.literal("outset")]),
960
+ offsetX: z.union([UnitValue, VarValue]),
961
+ offsetY: z.union([UnitValue, VarValue]),
962
+ blur: z.union([UnitValue, VarValue]).optional(),
963
+ spread: z.union([UnitValue, VarValue]).optional(),
964
+ color: z.union([RgbValue, KeywordValue, VarValue]).optional()
965
+ });
940
966
  var LayerValueItem = z.union([
941
967
  UnitValue,
942
968
  KeywordValue,
943
969
  UnparsedValue,
944
970
  ImageValue,
945
971
  TupleValue,
972
+ ShadowValue,
946
973
  RgbValue,
947
974
  InvalidValue,
948
975
  FunctionValue,
@@ -966,7 +993,8 @@ var StyleValue = z.union([
966
993
  GuaranteedInvalidValue,
967
994
  InvalidValue,
968
995
  UnsetValue,
969
- VarValue
996
+ VarValue,
997
+ ShadowValue
970
998
  ]);
971
999
  var cssWideKeywords = /* @__PURE__ */ new Set([
972
1000
  "initial",
@@ -1843,7 +1871,13 @@ var MatcherOperation = z.object({
1843
1871
  var Matcher = z.object({
1844
1872
  relation: MatcherRelation,
1845
1873
  component: MatcherOperation.optional(),
1846
- tag: MatcherOperation.optional()
1874
+ tag: MatcherOperation.optional(),
1875
+ text: z.literal(false).describe(
1876
+ `
1877
+ To disallow text editing on a container instance,
1878
+ use: { relation: 'child', text: false }
1879
+ `
1880
+ ).optional()
1847
1881
  });
1848
1882
  var Matchers = z.union([Matcher, z.array(Matcher)]);
1849
1883
  var DataSourceId = z.string();
@@ -2567,7 +2601,6 @@ z.object({
2567
2601
  icon: z.string(),
2568
2602
  presetStyle: z.optional(z.record(z.string(), z.array(PresetStyleDecl))),
2569
2603
  states: z.optional(z.array(ComponentState)),
2570
- template: z.optional(WsEmbedTemplate),
2571
2604
  order: z.number().optional()
2572
2605
  });
2573
2606
  var html = [
@@ -3561,29 +3594,6 @@ var isAttributeNameSafe = (attributeName) => {
3561
3594
  illegalAttributeNameCache.set(attributeName, true);
3562
3595
  return false;
3563
3596
  };
3564
- var namespaceEmbedTemplateComponents = (template, namespace, components) => {
3565
- return template.map((item) => {
3566
- if (item.type === "text") {
3567
- return item;
3568
- }
3569
- if (item.type === "expression") {
3570
- return item;
3571
- }
3572
- if (item.type === "instance") {
3573
- const prefix = components.has(item.component) ? `${namespace}:` : "";
3574
- return {
3575
- ...item,
3576
- component: `${prefix}${item.component}`,
3577
- children: namespaceEmbedTemplateComponents(
3578
- item.children,
3579
- namespace,
3580
- components
3581
- )
3582
- };
3583
- }
3584
- throw Error("Impossible case");
3585
- });
3586
- };
3587
3597
  var namespaceMatcher = (namespace, matcher) => {
3588
3598
  var _a2, _b2, _c2, _d2;
3589
3599
  const newMatcher = structuredClone(matcher);
@@ -3619,13 +3629,6 @@ var namespaceMeta = (meta, namespace, components) => {
3619
3629
  if (newMeta.indexWithinAncestor) {
3620
3630
  newMeta.indexWithinAncestor = components.has(newMeta.indexWithinAncestor) ? `${namespace}:${newMeta.indexWithinAncestor}` : newMeta.indexWithinAncestor;
3621
3631
  }
3622
- if (newMeta.template) {
3623
- newMeta.template = namespaceEmbedTemplateComponents(
3624
- newMeta.template,
3625
- namespace,
3626
- components
3627
- );
3628
- }
3629
3632
  return newMeta;
3630
3633
  };
3631
3634
  var generateAction = ({
@@ -4125,7 +4128,7 @@ const e$5 = {
4125
4128
  icon: SlotComponentIcon,
4126
4129
  order: 5
4127
4130
  };
4128
- const o$3 = {
4131
+ const o$5 = {
4129
4132
  type: "container",
4130
4133
  icon: ""
4131
4134
  };
@@ -4139,7 +4142,7 @@ const e$4 = {
4139
4142
  type: "boolean"
4140
4143
  }
4141
4144
  };
4142
- const i$9 = {
4145
+ const i$7 = {
4143
4146
  div: [
4144
4147
  {
4145
4148
  property: "display",
@@ -4156,7 +4159,7 @@ const i$9 = {
4156
4159
  label: "HTML Embed",
4157
4160
  description: "Used to add HTML code to the page, such as an SVG or script.",
4158
4161
  icon: EmbedIcon,
4159
- presetStyle: i$9,
4162
+ presetStyle: i$7,
4160
4163
  order: 2
4161
4164
  };
4162
4165
  ({
@@ -4234,7 +4237,7 @@ var h3 = div;
4234
4237
  var h4 = div;
4235
4238
  var h5 = div;
4236
4239
  var h6 = div;
4237
- var i$8 = div;
4240
+ var i$6 = div;
4238
4241
  var img = div;
4239
4242
  var a$b = div;
4240
4243
  var li = div;
@@ -4688,7 +4691,7 @@ const p$c = {
4688
4691
  };
4689
4692
  const r$9 = {
4690
4693
  i: [
4691
- ...i$8,
4694
+ ...i$6,
4692
4695
  {
4693
4696
  property: "font-style",
4694
4697
  value: { type: "keyword", value: "italic" }
@@ -4882,7 +4885,7 @@ const r$7 = {
4882
4885
  value: { type: "rgb", r: 226, g: 226, b: 226, alpha: 1 }
4883
4886
  }
4884
4887
  ]
4885
- }, i$7 = {
4888
+ }, i$5 = {
4886
4889
  type: "container",
4887
4890
  placeholder: "Blockquote",
4888
4891
  icon: BlockquoteIcon,
@@ -5007,7 +5010,7 @@ const p$7 = {
5007
5010
  value: { type: "rgb", r: 238, g: 238, b: 238, alpha: 1 }
5008
5011
  }
5009
5012
  ]
5010
- }, i$6 = {
5013
+ }, i$4 = {
5011
5014
  category: "general",
5012
5015
  type: "embed",
5013
5016
  description: "Use this component when you want to display code as text on the page.",
@@ -5025,7 +5028,7 @@ const a$1 = {
5025
5028
  ...label,
5026
5029
  { property: "display", value: { type: "keyword", value: "block" } }
5027
5030
  ]
5028
- }, i$5 = {
5031
+ }, i$3 = {
5029
5032
  constraints: {
5030
5033
  relation: "ancestor",
5031
5034
  component: { $nin: ["Button", "Link"] }
@@ -5072,7 +5075,7 @@ const l$3 = {
5072
5075
  //{ selector: ":read-write", label: "Read Write" },
5073
5076
  ]
5074
5077
  };
5075
- const i$4 = {
5078
+ const i$2 = {
5076
5079
  input: [
5077
5080
  ...radio,
5078
5081
  {
@@ -5088,7 +5091,7 @@ const i$4 = {
5088
5091
  type: "control",
5089
5092
  label: "Radio",
5090
5093
  icon: RadioCheckedIcon,
5091
- presetStyle: i$4,
5094
+ presetStyle: i$2,
5092
5095
  states: [
5093
5096
  ...defaultStates,
5094
5097
  { selector: ":checked", label: "Checked" },
@@ -5140,19 +5143,19 @@ const r$5 = {
5140
5143
  component: { $nin: ["Button", "Link", "Heading"] }
5141
5144
  }
5142
5145
  };
5143
- const i$3 = {
5146
+ const i$1 = {
5144
5147
  div
5145
5148
  }, c$2 = {
5146
5149
  type: "container",
5147
5150
  icon: YoutubeIcon,
5148
5151
  states: defaultStates,
5149
- presetStyle: i$3,
5152
+ presetStyle: i$1,
5150
5153
  constraints: {
5151
5154
  relation: "ancestor",
5152
5155
  component: { $nin: ["Button", "Link", "Heading"] }
5153
5156
  }
5154
5157
  };
5155
- const i$2 = {
5158
+ const i = {
5156
5159
  ...l$4,
5157
5160
  category: "hidden",
5158
5161
  label: "Preview Image",
@@ -5244,7 +5247,7 @@ const r$2 = {
5244
5247
  { selector: ":optional", label: "Optional" }
5245
5248
  ]
5246
5249
  };
5247
- const o$2 = {
5250
+ const o$4 = {
5248
5251
  option: [
5249
5252
  {
5250
5253
  property: "background-color",
@@ -5267,7 +5270,7 @@ const o$2 = {
5267
5270
  type: "control",
5268
5271
  description: "An item within a drop-down menu that users can select as their chosen value.",
5269
5272
  icon: ItemIcon,
5270
- presetStyle: o$2,
5273
+ presetStyle: o$4,
5271
5274
  states: [
5272
5275
  // Applies when option is being activated (clicked)
5273
5276
  { selector: ":active", label: "Active" },
@@ -5323,15 +5326,15 @@ const p$1 = {
5323
5326
  };
5324
5327
  const baseComponentMetas = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5325
5328
  __proto__: null,
5326
- Blockquote: i$7,
5329
+ Blockquote: i$5,
5327
5330
  Body: n$5,
5328
5331
  Bold: l$5,
5329
5332
  Box: v$3,
5330
5333
  Button: p$b,
5331
5334
  Checkbox: s$1,
5332
- CodeText: i$6,
5335
+ CodeText: i$4,
5333
5336
  Form: n$3,
5334
- Fragment: o$3,
5337
+ Fragment: o$5,
5335
5338
  HeadLink: p$3,
5336
5339
  HeadMeta: p$2,
5337
5340
  HeadSlot: r,
@@ -5341,7 +5344,7 @@ const baseComponentMetas = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.
5341
5344
  Image: l$4,
5342
5345
  Input: p$a,
5343
5346
  Italic: c$4,
5344
- Label: i$5,
5347
+ Label: i$3,
5345
5348
  Link: l$6,
5346
5349
  List: d$3,
5347
5350
  ListItem: m$3,
@@ -5362,32 +5365,43 @@ const baseComponentMetas = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.
5362
5365
  Time: s,
5363
5366
  Vimeo: c$3,
5364
5367
  VimeoPlayButton: p$4,
5365
- VimeoPreviewImage: i$2,
5368
+ VimeoPreviewImage: i,
5366
5369
  VimeoSpinner: m$2,
5367
5370
  XmlNode: e$1,
5368
5371
  XmlTime: a,
5369
5372
  YouTube: c$2
5370
5373
  }, Symbol.toStringTag, { value: "Module" }));
5371
- const i$1 = {
5374
+ const o$3 = {
5372
5375
  category: "general",
5373
5376
  type: "container",
5374
5377
  description: "Animate Children",
5375
5378
  icon: SlotComponentIcon,
5376
5379
  order: 5,
5377
- label: "Animate Children"
5380
+ label: "Animate Children",
5381
+ constraints: {
5382
+ relation: "child",
5383
+ text: false
5384
+ }
5378
5385
  };
5379
- const i = {
5386
+ const o$2 = {
5380
5387
  category: "general",
5381
5388
  type: "container",
5382
5389
  description: "Animate Text",
5383
5390
  icon: TextIcon,
5384
5391
  order: 6,
5385
- label: "Animate Text"
5392
+ label: "Animate Text",
5393
+ constraints: [
5394
+ { relation: "parent", component: { $eq: "AnimateChildren" } },
5395
+ {
5396
+ relation: "child",
5397
+ text: false
5398
+ }
5399
+ ]
5386
5400
  };
5387
5401
  const animationComponentMetas = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5388
5402
  __proto__: null,
5389
- AnimateChildren: i$1,
5390
- AnimateText: i
5403
+ AnimateChildren: o$3,
5404
+ AnimateText: o$2
5391
5405
  }, Symbol.toStringTag, { value: "Module" }));
5392
5406
  const remixComponentMetas = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5393
5407
  __proto__: null,
@@ -7105,7 +7119,7 @@ const getDeploymentInstructions = (deployTarget) => {
7105
7119
  }
7106
7120
  };
7107
7121
  const name = "webstudio";
7108
- const version = "0.207.0";
7122
+ const version = "0.209.0";
7109
7123
  const description = "Webstudio CLI";
7110
7124
  const author = "Webstudio <github@webstudio.is>";
7111
7125
  const homepage = "https://webstudio.is";
@@ -7150,7 +7164,7 @@ const dependencies = {
7150
7164
  "reserved-identifiers": "^1.0.0",
7151
7165
  tinyexec: "^0.3.2",
7152
7166
  yargs: "^17.7.2",
7153
- zod: "^3.22.4"
7167
+ zod: "^3.24.2"
7154
7168
  };
7155
7169
  const devDependencies = {
7156
7170
  "@netlify/vite-plugin-react-router": "^1.0.0",
@@ -7167,11 +7181,11 @@ const devDependencies = {
7167
7181
  "@types/yargs": "^17.0.33",
7168
7182
  "@vercel/react-router": "^1.1.0",
7169
7183
  "@vitejs/plugin-react": "^4.3.4",
7184
+ "@webstudio-is/css-engine": "workspace:*",
7170
7185
  "@webstudio-is/http-client": "workspace:*",
7171
7186
  "@webstudio-is/image": "workspace:*",
7172
7187
  "@webstudio-is/react-sdk": "workspace:*",
7173
7188
  "@webstudio-is/sdk": "workspace:*",
7174
- "@webstudio-is/css-engine": "workspace:*",
7175
7189
  "@webstudio-is/sdk-components-animation": "workspace:*",
7176
7190
  "@webstudio-is/sdk-components-react": "workspace:*",
7177
7191
  "@webstudio-is/sdk-components-react-radix": "workspace:*",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webstudio",
3
- "version": "0.207.0",
3
+ "version": "0.209.0",
4
4
  "description": "Webstudio CLI",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -40,7 +40,7 @@
40
40
  "reserved-identifiers": "^1.0.0",
41
41
  "tinyexec": "^0.3.2",
42
42
  "yargs": "^17.7.2",
43
- "zod": "^3.22.4"
43
+ "zod": "^3.24.2"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@netlify/vite-plugin-react-router": "^1.0.0",
@@ -68,16 +68,16 @@
68
68
  "vite": "^5.4.11",
69
69
  "vitest": "^3.0.8",
70
70
  "wrangler": "^3.63.2",
71
- "@webstudio-is/http-client": "0.207.0",
72
- "@webstudio-is/image": "0.207.0",
73
- "@webstudio-is/react-sdk": "0.207.0",
74
- "@webstudio-is/sdk": "0.207.0",
75
- "@webstudio-is/css-engine": "0.207.0",
76
- "@webstudio-is/sdk-components-react": "0.207.0",
77
- "@webstudio-is/sdk-components-react-radix": "0.207.0",
78
- "@webstudio-is/sdk-components-react-remix": "0.207.0",
79
- "@webstudio-is/sdk-components-react-router": "0.207.0",
80
- "@webstudio-is/sdk-components-animation": "0.207.0",
71
+ "@webstudio-is/css-engine": "0.209.0",
72
+ "@webstudio-is/http-client": "0.209.0",
73
+ "@webstudio-is/image": "0.209.0",
74
+ "@webstudio-is/react-sdk": "0.209.0",
75
+ "@webstudio-is/sdk-components-animation": "0.209.0",
76
+ "@webstudio-is/sdk": "0.209.0",
77
+ "@webstudio-is/sdk-components-react": "0.209.0",
78
+ "@webstudio-is/sdk-components-react-radix": "0.209.0",
79
+ "@webstudio-is/sdk-components-react-remix": "0.209.0",
80
+ "@webstudio-is/sdk-components-react-router": "0.209.0",
81
81
  "@webstudio-is/tsconfig": "1.0.7"
82
82
  },
83
83
  "scripts": {
@@ -11,13 +11,13 @@
11
11
  "@remix-run/node": "2.16.0",
12
12
  "@remix-run/react": "2.16.0",
13
13
  "@remix-run/server-runtime": "2.16.0",
14
- "@webstudio-is/image": "0.207.0",
15
- "@webstudio-is/react-sdk": "0.207.0",
16
- "@webstudio-is/sdk": "0.207.0",
17
- "@webstudio-is/sdk-components-react": "0.207.0",
18
- "@webstudio-is/sdk-components-animation": "0.207.0",
19
- "@webstudio-is/sdk-components-react-radix": "0.207.0",
20
- "@webstudio-is/sdk-components-react-remix": "0.207.0",
14
+ "@webstudio-is/image": "0.209.0",
15
+ "@webstudio-is/react-sdk": "0.209.0",
16
+ "@webstudio-is/sdk": "0.209.0",
17
+ "@webstudio-is/sdk-components-react": "0.209.0",
18
+ "@webstudio-is/sdk-components-animation": "0.209.0",
19
+ "@webstudio-is/sdk-components-react-radix": "0.209.0",
20
+ "@webstudio-is/sdk-components-react-remix": "0.209.0",
21
21
  "isbot": "^5.1.23",
22
22
  "react": "18.3.0-canary-14898b6a9-20240318",
23
23
  "react-dom": "18.3.0-canary-14898b6a9-20240318"
@@ -10,13 +10,13 @@
10
10
  "dependencies": {
11
11
  "@react-router/dev": "^7.3.0",
12
12
  "@react-router/fs-routes": "^7.3.0",
13
- "@webstudio-is/image": "0.207.0",
14
- "@webstudio-is/react-sdk": "0.207.0",
15
- "@webstudio-is/sdk": "0.207.0",
16
- "@webstudio-is/sdk-components-animation": "0.207.0",
17
- "@webstudio-is/sdk-components-react-radix": "0.207.0",
18
- "@webstudio-is/sdk-components-react-router": "0.207.0",
19
- "@webstudio-is/sdk-components-react": "0.207.0",
13
+ "@webstudio-is/image": "0.209.0",
14
+ "@webstudio-is/react-sdk": "0.209.0",
15
+ "@webstudio-is/sdk": "0.209.0",
16
+ "@webstudio-is/sdk-components-animation": "0.209.0",
17
+ "@webstudio-is/sdk-components-react-radix": "0.209.0",
18
+ "@webstudio-is/sdk-components-react-router": "0.209.0",
19
+ "@webstudio-is/sdk-components-react": "0.209.0",
20
20
  "isbot": "^5.1.23",
21
21
  "react": "18.3.0-canary-14898b6a9-20240318",
22
22
  "react-dom": "18.3.0-canary-14898b6a9-20240318",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "dependencies": {
3
3
  "worktop": "0.8.0-next.18",
4
- "zod": "^3.22.4"
4
+ "zod": "^3.24.2"
5
5
  },
6
6
  "devDependencies": {
7
7
  "fast-glob": "^3.3.2"
@@ -8,12 +8,12 @@
8
8
  "typecheck": "tsc"
9
9
  },
10
10
  "dependencies": {
11
- "@webstudio-is/image": "0.207.0",
12
- "@webstudio-is/react-sdk": "0.207.0",
13
- "@webstudio-is/sdk": "0.207.0",
14
- "@webstudio-is/sdk-components-react": "0.207.0",
15
- "@webstudio-is/sdk-components-animation": "0.207.0",
16
- "@webstudio-is/sdk-components-react-radix": "0.207.0",
11
+ "@webstudio-is/image": "0.209.0",
12
+ "@webstudio-is/react-sdk": "0.209.0",
13
+ "@webstudio-is/sdk": "0.209.0",
14
+ "@webstudio-is/sdk-components-react": "0.209.0",
15
+ "@webstudio-is/sdk-components-animation": "0.209.0",
16
+ "@webstudio-is/sdk-components-react-radix": "0.209.0",
17
17
  "react": "18.3.0-canary-14898b6a9-20240318",
18
18
  "react-dom": "18.3.0-canary-14898b6a9-20240318",
19
19
  "vike": "^0.4.224"