@webstudio-is/react-sdk 0.163.0 → 0.168.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/index.js CHANGED
@@ -706,7 +706,8 @@ import {
706
706
  import { StyleValue } from "@webstudio-is/css-engine";
707
707
  var EmbedTemplateText = z2.object({
708
708
  type: z2.literal("text"),
709
- value: z2.string()
709
+ value: z2.string(),
710
+ placeholder: z2.boolean().optional()
710
711
  });
711
712
  var EmbedTemplateExpression = z2.object({
712
713
  type: z2.literal("expression"),
@@ -969,7 +970,8 @@ var createInstancesFromTemplate = (treeTemplate, instances, props, dataSourceByR
969
970
  if (item.type === "text") {
970
971
  parentChildren.push({
971
972
  type: "text",
972
- value: item.value
973
+ value: item.value,
974
+ placeholder: item.placeholder
973
975
  });
974
976
  }
975
977
  if (item.type === "expression") {
@@ -1294,6 +1296,9 @@ var generateJsxElement = ({
1294
1296
  children,
1295
1297
  classesMap
1296
1298
  }) => {
1299
+ if (instance.component === descendantComponent) {
1300
+ return "";
1301
+ }
1297
1302
  let generatedProps = "";
1298
1303
  generatedProps += `
1299
1304
  ${idAttribute}=${JSON.stringify(instance.id)}`;
@@ -1355,10 +1360,6 @@ ${prop.name}={${propValue}}`;
1355
1360
  className=${JSON.stringify(classes.join(" "))}`;
1356
1361
  }
1357
1362
  let generatedElement = "";
1358
- if (conditionValue) {
1359
- generatedElement += `{(${conditionValue}) &&
1360
- `;
1361
- }
1362
1363
  if (instance.component === collectionComponent) {
1363
1364
  if (collectionDataValue === void 0 || collectionItemValue === void 0) {
1364
1365
  return "";
@@ -1387,12 +1388,20 @@ className=${JSON.stringify(classes.join(" "))}`;
1387
1388
  `;
1388
1389
  }
1389
1390
  }
1390
- if (instance.component === descendantComponent) {
1391
- return "";
1392
- }
1393
1391
  if (conditionValue) {
1394
- generatedElement += `}
1392
+ let conditionalElement = "";
1393
+ conditionalElement += `{(${conditionValue}) &&
1394
+ `;
1395
+ if (instance.component === collectionComponent) {
1396
+ conditionalElement += "<>\n";
1397
+ conditionalElement += generatedElement;
1398
+ conditionalElement += "</>\n";
1399
+ } else {
1400
+ conditionalElement += generatedElement;
1401
+ }
1402
+ conditionalElement += `}
1395
1403
  `;
1404
+ return conditionalElement;
1396
1405
  }
1397
1406
  return generatedElement;
1398
1407
  };
@@ -1404,11 +1413,15 @@ var generateJsxChildren = ({
1404
1413
  dataSources,
1405
1414
  usedDataSources,
1406
1415
  indexesWithinAncestors,
1407
- classesMap
1416
+ classesMap,
1417
+ excludePlaceholders
1408
1418
  }) => {
1409
1419
  let generatedChildren = "";
1410
1420
  for (const child of children) {
1411
1421
  if (child.type === "text") {
1422
+ if (excludePlaceholders && child.placeholder === true) {
1423
+ continue;
1424
+ }
1412
1425
  generatedChildren += child.value.split("\n").map((line) => `{${JSON.stringify(line)}}
1413
1426
  `).join(`<br />
1414
1427
  `);
@@ -1447,7 +1460,8 @@ var generateJsxChildren = ({
1447
1460
  props,
1448
1461
  dataSources,
1449
1462
  usedDataSources,
1450
- indexesWithinAncestors
1463
+ indexesWithinAncestors,
1464
+ excludePlaceholders
1451
1465
  })
1452
1466
  });
1453
1467
  continue;
@@ -10,7 +10,7 @@ export declare const generateJsxElement: ({ scope, instance, props, dataSources,
10
10
  children: string;
11
11
  classesMap?: Map<string, Array<string>>;
12
12
  }) => string;
13
- export declare const generateJsxChildren: ({ scope, children, instances, props, dataSources, usedDataSources, indexesWithinAncestors, classesMap, }: {
13
+ export declare const generateJsxChildren: ({ scope, children, instances, props, dataSources, usedDataSources, indexesWithinAncestors, classesMap, excludePlaceholders, }: {
14
14
  scope: Scope;
15
15
  children: Instance["children"];
16
16
  instances: Instances;
@@ -19,6 +19,7 @@ export declare const generateJsxChildren: ({ scope, children, instances, props,
19
19
  usedDataSources: DataSources;
20
20
  indexesWithinAncestors: IndexesWithinAncestors;
21
21
  classesMap?: Map<string, Array<string>>;
22
+ excludePlaceholders?: boolean;
22
23
  }) => string;
23
24
  export declare const generateWebstudioComponent: ({ scope, name, rootInstanceId, parameters, instances, props, dataSources, indexesWithinAncestors, classesMap, }: {
24
25
  scope: Scope;
@@ -983,6 +983,7 @@ export declare const WsComponentMeta: z.ZodObject<{
983
983
  type: "guaranteedInvalid";
984
984
  })[];
985
985
  };
986
+ hidden?: boolean | undefined;
986
987
  } | {
987
988
  value: {
988
989
  value: string;
@@ -1415,6 +1416,7 @@ export declare const WsComponentMeta: z.ZodObject<{
1415
1416
  type: "guaranteedInvalid";
1416
1417
  })[];
1417
1418
  };
1419
+ hidden?: boolean | undefined;
1418
1420
  } | {
1419
1421
  value: {
1420
1422
  value: string;
@@ -1850,6 +1852,7 @@ export declare const WsComponentMeta: z.ZodObject<{
1850
1852
  type: "guaranteedInvalid";
1851
1853
  })[];
1852
1854
  };
1855
+ hidden?: boolean | undefined;
1853
1856
  } | {
1854
1857
  value: {
1855
1858
  value: string;
@@ -2282,6 +2285,7 @@ export declare const WsComponentMeta: z.ZodObject<{
2282
2285
  type: "guaranteedInvalid";
2283
2286
  })[];
2284
2287
  };
2288
+ hidden?: boolean | undefined;
2285
2289
  } | {
2286
2290
  value: {
2287
2291
  value: string;
@@ -2716,6 +2720,7 @@ export declare const WsComponentMeta: z.ZodObject<{
2716
2720
  type: "guaranteedInvalid";
2717
2721
  })[];
2718
2722
  };
2723
+ hidden?: boolean | undefined;
2719
2724
  } | {
2720
2725
  value: {
2721
2726
  value: string;
@@ -3151,6 +3156,7 @@ export declare const WsComponentMeta: z.ZodObject<{
3151
3156
  type: "guaranteedInvalid";
3152
3157
  })[];
3153
3158
  };
3159
+ hidden?: boolean | undefined;
3154
3160
  } | {
3155
3161
  value: {
3156
3162
  value: string;
@@ -3365,12 +3371,15 @@ export declare const WsComponentMeta: z.ZodObject<{
3365
3371
  template: z.ZodOptional<z.ZodLazy<z.ZodArray<z.ZodUnion<[z.ZodType<import("../embed-template").EmbedTemplateInstance, z.ZodTypeDef, import("../embed-template").EmbedTemplateInstance>, z.ZodObject<{
3366
3372
  type: z.ZodLiteral<"text">;
3367
3373
  value: z.ZodString;
3374
+ placeholder: z.ZodOptional<z.ZodBoolean>;
3368
3375
  }, "strip", z.ZodTypeAny, {
3369
3376
  value: string;
3370
3377
  type: "text";
3378
+ placeholder?: boolean | undefined;
3371
3379
  }, {
3372
3380
  value: string;
3373
3381
  type: "text";
3382
+ placeholder?: boolean | undefined;
3374
3383
  }>, z.ZodObject<{
3375
3384
  type: z.ZodLiteral<"expression">;
3376
3385
  value: z.ZodString;
@@ -3630,6 +3639,7 @@ export declare const WsComponentMeta: z.ZodObject<{
3630
3639
  type: "guaranteedInvalid";
3631
3640
  })[];
3632
3641
  };
3642
+ hidden?: boolean | undefined;
3633
3643
  } | {
3634
3644
  value: {
3635
3645
  value: string;
@@ -4064,6 +4074,7 @@ export declare const WsComponentMeta: z.ZodObject<{
4064
4074
  type: "guaranteedInvalid";
4065
4075
  })[];
4066
4076
  };
4077
+ hidden?: boolean | undefined;
4067
4078
  } | {
4068
4079
  value: {
4069
4080
  value: string;
@@ -4270,6 +4281,7 @@ export declare const WsComponentMeta: z.ZodObject<{
4270
4281
  template?: ({
4271
4282
  value: string;
4272
4283
  type: "text";
4284
+ placeholder?: boolean | undefined;
4273
4285
  } | {
4274
4286
  value: string;
4275
4287
  type: "expression";
@@ -4523,6 +4535,7 @@ export declare const WsComponentMeta: z.ZodObject<{
4523
4535
  type: "guaranteedInvalid";
4524
4536
  })[];
4525
4537
  };
4538
+ hidden?: boolean | undefined;
4526
4539
  } | {
4527
4540
  value: {
4528
4541
  value: string;
@@ -4957,6 +4970,7 @@ export declare const WsComponentMeta: z.ZodObject<{
4957
4970
  type: "guaranteedInvalid";
4958
4971
  })[];
4959
4972
  };
4973
+ hidden?: boolean | undefined;
4960
4974
  } | {
4961
4975
  value: {
4962
4976
  value: string;
@@ -5163,6 +5177,7 @@ export declare const WsComponentMeta: z.ZodObject<{
5163
5177
  template?: ({
5164
5178
  value: string;
5165
5179
  type: "text";
5180
+ placeholder?: boolean | undefined;
5166
5181
  } | {
5167
5182
  value: string;
5168
5183
  type: "expression";
@@ -253,6 +253,7 @@ export declare const div: ({
253
253
  type: "guaranteedInvalid";
254
254
  })[];
255
255
  };
256
+ hidden?: boolean | undefined;
256
257
  } | {
257
258
  value: {
258
259
  value: string;
@@ -692,6 +693,7 @@ export declare const address: ({
692
693
  type: "guaranteedInvalid";
693
694
  })[];
694
695
  };
696
+ hidden?: boolean | undefined;
695
697
  } | {
696
698
  value: {
697
699
  value: string;
@@ -1131,6 +1133,7 @@ export declare const article: ({
1131
1133
  type: "guaranteedInvalid";
1132
1134
  })[];
1133
1135
  };
1136
+ hidden?: boolean | undefined;
1134
1137
  } | {
1135
1138
  value: {
1136
1139
  value: string;
@@ -1570,6 +1573,7 @@ export declare const aside: ({
1570
1573
  type: "guaranteedInvalid";
1571
1574
  })[];
1572
1575
  };
1576
+ hidden?: boolean | undefined;
1573
1577
  } | {
1574
1578
  value: {
1575
1579
  value: string;
@@ -2009,6 +2013,7 @@ export declare const figure: ({
2009
2013
  type: "guaranteedInvalid";
2010
2014
  })[];
2011
2015
  };
2016
+ hidden?: boolean | undefined;
2012
2017
  } | {
2013
2018
  value: {
2014
2019
  value: string;
@@ -2448,6 +2453,7 @@ export declare const footer: ({
2448
2453
  type: "guaranteedInvalid";
2449
2454
  })[];
2450
2455
  };
2456
+ hidden?: boolean | undefined;
2451
2457
  } | {
2452
2458
  value: {
2453
2459
  value: string;
@@ -2887,6 +2893,7 @@ export declare const header: ({
2887
2893
  type: "guaranteedInvalid";
2888
2894
  })[];
2889
2895
  };
2896
+ hidden?: boolean | undefined;
2890
2897
  } | {
2891
2898
  value: {
2892
2899
  value: string;
@@ -3326,6 +3333,7 @@ export declare const main: ({
3326
3333
  type: "guaranteedInvalid";
3327
3334
  })[];
3328
3335
  };
3336
+ hidden?: boolean | undefined;
3329
3337
  } | {
3330
3338
  value: {
3331
3339
  value: string;
@@ -3765,6 +3773,7 @@ export declare const nav: ({
3765
3773
  type: "guaranteedInvalid";
3766
3774
  })[];
3767
3775
  };
3776
+ hidden?: boolean | undefined;
3768
3777
  } | {
3769
3778
  value: {
3770
3779
  value: string;
@@ -4204,6 +4213,7 @@ export declare const section: ({
4204
4213
  type: "guaranteedInvalid";
4205
4214
  })[];
4206
4215
  };
4216
+ hidden?: boolean | undefined;
4207
4217
  } | {
4208
4218
  value: {
4209
4219
  value: string;
@@ -4643,6 +4653,7 @@ export declare const form: ({
4643
4653
  type: "guaranteedInvalid";
4644
4654
  })[];
4645
4655
  };
4656
+ hidden?: boolean | undefined;
4646
4657
  } | {
4647
4658
  value: {
4648
4659
  value: string;
@@ -5082,6 +5093,7 @@ export declare const label: ({
5082
5093
  type: "guaranteedInvalid";
5083
5094
  })[];
5084
5095
  };
5096
+ hidden?: boolean | undefined;
5085
5097
  } | {
5086
5098
  value: {
5087
5099
  value: string;
@@ -5521,6 +5533,7 @@ export declare const time: ({
5521
5533
  type: "guaranteedInvalid";
5522
5534
  })[];
5523
5535
  };
5536
+ hidden?: boolean | undefined;
5524
5537
  } | {
5525
5538
  value: {
5526
5539
  value: string;
@@ -5960,6 +5973,7 @@ export declare const h1: ({
5960
5973
  type: "guaranteedInvalid";
5961
5974
  })[];
5962
5975
  };
5976
+ hidden?: boolean | undefined;
5963
5977
  } | {
5964
5978
  value: {
5965
5979
  value: string;
@@ -6399,6 +6413,7 @@ export declare const h2: ({
6399
6413
  type: "guaranteedInvalid";
6400
6414
  })[];
6401
6415
  };
6416
+ hidden?: boolean | undefined;
6402
6417
  } | {
6403
6418
  value: {
6404
6419
  value: string;
@@ -6838,6 +6853,7 @@ export declare const h3: ({
6838
6853
  type: "guaranteedInvalid";
6839
6854
  })[];
6840
6855
  };
6856
+ hidden?: boolean | undefined;
6841
6857
  } | {
6842
6858
  value: {
6843
6859
  value: string;
@@ -7277,6 +7293,7 @@ export declare const h4: ({
7277
7293
  type: "guaranteedInvalid";
7278
7294
  })[];
7279
7295
  };
7296
+ hidden?: boolean | undefined;
7280
7297
  } | {
7281
7298
  value: {
7282
7299
  value: string;
@@ -7716,6 +7733,7 @@ export declare const h5: ({
7716
7733
  type: "guaranteedInvalid";
7717
7734
  })[];
7718
7735
  };
7736
+ hidden?: boolean | undefined;
7719
7737
  } | {
7720
7738
  value: {
7721
7739
  value: string;
@@ -8155,6 +8173,7 @@ export declare const h6: ({
8155
8173
  type: "guaranteedInvalid";
8156
8174
  })[];
8157
8175
  };
8176
+ hidden?: boolean | undefined;
8158
8177
  } | {
8159
8178
  value: {
8160
8179
  value: string;
@@ -8594,6 +8613,7 @@ export declare const i: ({
8594
8613
  type: "guaranteedInvalid";
8595
8614
  })[];
8596
8615
  };
8616
+ hidden?: boolean | undefined;
8597
8617
  } | {
8598
8618
  value: {
8599
8619
  value: string;
@@ -9033,6 +9053,7 @@ export declare const img: ({
9033
9053
  type: "guaranteedInvalid";
9034
9054
  })[];
9035
9055
  };
9056
+ hidden?: boolean | undefined;
9036
9057
  } | {
9037
9058
  value: {
9038
9059
  value: string;
@@ -9472,6 +9493,7 @@ export declare const a: ({
9472
9493
  type: "guaranteedInvalid";
9473
9494
  })[];
9474
9495
  };
9496
+ hidden?: boolean | undefined;
9475
9497
  } | {
9476
9498
  value: {
9477
9499
  value: string;
@@ -9911,6 +9933,7 @@ export declare const li: ({
9911
9933
  type: "guaranteedInvalid";
9912
9934
  })[];
9913
9935
  };
9936
+ hidden?: boolean | undefined;
9914
9937
  } | {
9915
9938
  value: {
9916
9939
  value: string;
@@ -10350,6 +10373,7 @@ export declare const ul: ({
10350
10373
  type: "guaranteedInvalid";
10351
10374
  })[];
10352
10375
  };
10376
+ hidden?: boolean | undefined;
10353
10377
  } | {
10354
10378
  value: {
10355
10379
  value: string;
@@ -10789,6 +10813,7 @@ export declare const ol: ({
10789
10813
  type: "guaranteedInvalid";
10790
10814
  })[];
10791
10815
  };
10816
+ hidden?: boolean | undefined;
10792
10817
  } | {
10793
10818
  value: {
10794
10819
  value: string;
@@ -11228,6 +11253,7 @@ export declare const p: ({
11228
11253
  type: "guaranteedInvalid";
11229
11254
  })[];
11230
11255
  };
11256
+ hidden?: boolean | undefined;
11231
11257
  } | {
11232
11258
  value: {
11233
11259
  value: string;
@@ -11667,6 +11693,7 @@ export declare const span: ({
11667
11693
  type: "guaranteedInvalid";
11668
11694
  })[];
11669
11695
  };
11696
+ hidden?: boolean | undefined;
11670
11697
  } | {
11671
11698
  value: {
11672
11699
  value: string;
@@ -12111,6 +12138,7 @@ export declare const html: ({
12111
12138
  type: "guaranteedInvalid";
12112
12139
  })[];
12113
12140
  };
12141
+ hidden?: boolean | undefined;
12114
12142
  } | {
12115
12143
  value: {
12116
12144
  value: string;
@@ -12554,6 +12582,7 @@ export declare const body: ({
12554
12582
  type: "guaranteedInvalid";
12555
12583
  })[];
12556
12584
  };
12585
+ hidden?: boolean | undefined;
12557
12586
  } | {
12558
12587
  value: {
12559
12588
  value: string;
@@ -12997,6 +13026,7 @@ export declare const hr: ({
12997
13026
  type: "guaranteedInvalid";
12998
13027
  })[];
12999
13028
  };
13029
+ hidden?: boolean | undefined;
13000
13030
  } | {
13001
13031
  value: {
13002
13032
  value: string;
@@ -13448,6 +13478,7 @@ export declare const b: ({
13448
13478
  type: "guaranteedInvalid";
13449
13479
  })[];
13450
13480
  };
13481
+ hidden?: boolean | undefined;
13451
13482
  } | {
13452
13483
  value: {
13453
13484
  value: string;
@@ -13887,6 +13918,7 @@ export declare const strong: ({
13887
13918
  type: "guaranteedInvalid";
13888
13919
  })[];
13889
13920
  };
13921
+ hidden?: boolean | undefined;
13890
13922
  } | {
13891
13923
  value: {
13892
13924
  value: string;
@@ -14330,6 +14362,7 @@ export declare const code: ({
14330
14362
  type: "guaranteedInvalid";
14331
14363
  })[];
14332
14364
  };
14365
+ hidden?: boolean | undefined;
14333
14366
  } | {
14334
14367
  value: {
14335
14368
  value: string;
@@ -14769,6 +14802,7 @@ export declare const kbd: ({
14769
14802
  type: "guaranteedInvalid";
14770
14803
  })[];
14771
14804
  };
14805
+ hidden?: boolean | undefined;
14772
14806
  } | {
14773
14807
  value: {
14774
14808
  value: string;
@@ -15208,6 +15242,7 @@ export declare const samp: ({
15208
15242
  type: "guaranteedInvalid";
15209
15243
  })[];
15210
15244
  };
15245
+ hidden?: boolean | undefined;
15211
15246
  } | {
15212
15247
  value: {
15213
15248
  value: string;
@@ -15647,6 +15682,7 @@ export declare const pre: ({
15647
15682
  type: "guaranteedInvalid";
15648
15683
  })[];
15649
15684
  };
15685
+ hidden?: boolean | undefined;
15650
15686
  } | {
15651
15687
  value: {
15652
15688
  value: string;
@@ -16089,6 +16125,7 @@ export declare const small: ({
16089
16125
  type: "guaranteedInvalid";
16090
16126
  })[];
16091
16127
  };
16128
+ hidden?: boolean | undefined;
16092
16129
  } | {
16093
16130
  value: {
16094
16131
  value: string;
@@ -16528,6 +16565,7 @@ export declare const sub: ({
16528
16565
  type: "guaranteedInvalid";
16529
16566
  })[];
16530
16567
  };
16568
+ hidden?: boolean | undefined;
16531
16569
  } | {
16532
16570
  value: {
16533
16571
  value: string;
@@ -16967,6 +17005,7 @@ export declare const sup: ({
16967
17005
  type: "guaranteedInvalid";
16968
17006
  })[];
16969
17007
  };
17008
+ hidden?: boolean | undefined;
16970
17009
  } | {
16971
17010
  value: {
16972
17011
  value: string;
@@ -17410,6 +17449,7 @@ export declare const table: ({
17410
17449
  type: "guaranteedInvalid";
17411
17450
  })[];
17412
17451
  };
17452
+ hidden?: boolean | undefined;
17413
17453
  } | {
17414
17454
  value: {
17415
17455
  value: string;
@@ -17849,6 +17889,7 @@ export declare const input: ({
17849
17889
  type: "guaranteedInvalid";
17850
17890
  })[];
17851
17891
  };
17892
+ hidden?: boolean | undefined;
17852
17893
  } | {
17853
17894
  value: {
17854
17895
  value: string;
@@ -18288,6 +18329,7 @@ export declare const textarea: ({
18288
18329
  type: "guaranteedInvalid";
18289
18330
  })[];
18290
18331
  };
18332
+ hidden?: boolean | undefined;
18291
18333
  } | {
18292
18334
  value: {
18293
18335
  value: string;
@@ -18727,6 +18769,7 @@ export declare const optgroup: ({
18727
18769
  type: "guaranteedInvalid";
18728
18770
  })[];
18729
18771
  };
18772
+ hidden?: boolean | undefined;
18730
18773
  } | {
18731
18774
  value: {
18732
18775
  value: string;
@@ -19166,6 +19209,7 @@ export declare const radio: ({
19166
19209
  type: "guaranteedInvalid";
19167
19210
  })[];
19168
19211
  };
19212
+ hidden?: boolean | undefined;
19169
19213
  } | {
19170
19214
  value: {
19171
19215
  value: string;
@@ -19605,6 +19649,7 @@ export declare const checkbox: ({
19605
19649
  type: "guaranteedInvalid";
19606
19650
  })[];
19607
19651
  };
19652
+ hidden?: boolean | undefined;
19608
19653
  } | {
19609
19654
  value: {
19610
19655
  value: string;
@@ -20047,6 +20092,7 @@ export declare const button: ({
20047
20092
  type: "guaranteedInvalid";
20048
20093
  })[];
20049
20094
  };
20095
+ hidden?: boolean | undefined;
20050
20096
  } | {
20051
20097
  value: {
20052
20098
  value: string;
@@ -20486,6 +20532,7 @@ export declare const select: ({
20486
20532
  type: "guaranteedInvalid";
20487
20533
  })[];
20488
20534
  };
20535
+ hidden?: boolean | undefined;
20489
20536
  } | {
20490
20537
  value: {
20491
20538
  value: string;
@@ -20969,6 +21016,7 @@ export declare const legend: ({
20969
21016
  type: "guaranteedInvalid";
20970
21017
  })[];
20971
21018
  };
21019
+ hidden?: boolean | undefined;
20972
21020
  } | {
20973
21021
  value: {
20974
21022
  value: string;
@@ -21411,6 +21459,7 @@ export declare const progress: ({
21411
21459
  type: "guaranteedInvalid";
21412
21460
  })[];
21413
21461
  };
21462
+ hidden?: boolean | undefined;
21414
21463
  } | {
21415
21464
  value: {
21416
21465
  value: string;
@@ -21894,6 +21943,7 @@ export declare const summary: ({
21894
21943
  type: "guaranteedInvalid";
21895
21944
  })[];
21896
21945
  };
21946
+ hidden?: boolean | undefined;
21897
21947
  } | {
21898
21948
  value: {
21899
21949
  value: string;
@@ -6,12 +6,15 @@ import type { WsComponentMeta } from "./components/component-meta";
6
6
  declare const EmbedTemplateText: z.ZodObject<{
7
7
  type: z.ZodLiteral<"text">;
8
8
  value: z.ZodString;
9
+ placeholder: z.ZodOptional<z.ZodBoolean>;
9
10
  }, "strip", z.ZodTypeAny, {
10
11
  value: string;
11
12
  type: "text";
13
+ placeholder?: boolean | undefined;
12
14
  }, {
13
15
  value: string;
14
16
  type: "text";
17
+ placeholder?: boolean | undefined;
15
18
  }>;
16
19
  type EmbedTemplateText = z.infer<typeof EmbedTemplateText>;
17
20
  declare const EmbedTemplateExpression: z.ZodObject<{
@@ -548,6 +551,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
548
551
  type: "guaranteedInvalid";
549
552
  })[];
550
553
  };
554
+ hidden?: boolean | undefined;
551
555
  }, z.ZodTypeDef, {
552
556
  type: "function";
553
557
  name: string;
@@ -764,6 +768,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
764
768
  type: "guaranteedInvalid";
765
769
  })[];
766
770
  };
771
+ hidden?: boolean | undefined;
767
772
  }>]>, "many">;
768
773
  hidden: z.ZodOptional<z.ZodBoolean>;
769
774
  }, "strip", z.ZodTypeAny, {
@@ -1021,6 +1026,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
1021
1026
  type: "guaranteedInvalid";
1022
1027
  })[];
1023
1028
  };
1029
+ hidden?: boolean | undefined;
1024
1030
  })[];
1025
1031
  type: "tuple";
1026
1032
  hidden?: boolean | undefined;
@@ -1249,6 +1255,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
1249
1255
  type: "guaranteedInvalid";
1250
1256
  })[];
1251
1257
  };
1258
+ hidden?: boolean | undefined;
1252
1259
  }, z.ZodTypeDef, {
1253
1260
  type: "function";
1254
1261
  name: string;
@@ -1465,6 +1472,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
1465
1472
  type: "guaranteedInvalid";
1466
1473
  })[];
1467
1474
  };
1475
+ hidden?: boolean | undefined;
1468
1476
  }>]>, "many">;
1469
1477
  }, "strip", z.ZodTypeAny, {
1470
1478
  value: ({
@@ -1742,6 +1750,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
1742
1750
  type: "guaranteedInvalid";
1743
1751
  })[];
1744
1752
  };
1753
+ hidden?: boolean | undefined;
1745
1754
  } | {
1746
1755
  value: {
1747
1756
  value: string;
@@ -1986,6 +1995,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
1986
1995
  type: "guaranteedInvalid";
1987
1996
  })[];
1988
1997
  };
1998
+ hidden?: boolean | undefined;
1989
1999
  })[];
1990
2000
  type: "tuple";
1991
2001
  hidden?: boolean | undefined;
@@ -2323,6 +2333,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
2323
2333
  type: "guaranteedInvalid";
2324
2334
  })[];
2325
2335
  };
2336
+ hidden?: boolean | undefined;
2326
2337
  }, z.ZodTypeDef, {
2327
2338
  type: "function";
2328
2339
  name: string;
@@ -2539,6 +2550,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
2539
2550
  type: "guaranteedInvalid";
2540
2551
  })[];
2541
2552
  };
2553
+ hidden?: boolean | undefined;
2542
2554
  }>]>, "many">;
2543
2555
  hidden: z.ZodOptional<z.ZodBoolean>;
2544
2556
  }, "strip", z.ZodTypeAny, {
@@ -2796,6 +2808,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
2796
2808
  type: "guaranteedInvalid";
2797
2809
  })[];
2798
2810
  };
2811
+ hidden?: boolean | undefined;
2799
2812
  })[];
2800
2813
  type: "tuple";
2801
2814
  hidden?: boolean | undefined;
@@ -3015,6 +3028,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
3015
3028
  type: "guaranteedInvalid";
3016
3029
  })[];
3017
3030
  };
3031
+ hidden?: boolean | undefined;
3018
3032
  }, z.ZodTypeDef, {
3019
3033
  type: "function";
3020
3034
  name: string;
@@ -3231,6 +3245,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
3231
3245
  type: "guaranteedInvalid";
3232
3246
  })[];
3233
3247
  };
3248
+ hidden?: boolean | undefined;
3234
3249
  }>, z.ZodObject<{
3235
3250
  type: z.ZodLiteral<"guaranteedInvalid">;
3236
3251
  }, "strip", z.ZodTypeAny, {
@@ -3646,6 +3661,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
3646
3661
  type: "guaranteedInvalid";
3647
3662
  })[];
3648
3663
  };
3664
+ hidden?: boolean | undefined;
3649
3665
  }, z.ZodTypeDef, {
3650
3666
  type: "function";
3651
3667
  name: string;
@@ -3862,6 +3878,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
3862
3878
  type: "guaranteedInvalid";
3863
3879
  })[];
3864
3880
  };
3881
+ hidden?: boolean | undefined;
3865
3882
  }>]>, "many">;
3866
3883
  hidden: z.ZodOptional<z.ZodBoolean>;
3867
3884
  }, "strip", z.ZodTypeAny, {
@@ -4119,6 +4136,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
4119
4136
  type: "guaranteedInvalid";
4120
4137
  })[];
4121
4138
  };
4139
+ hidden?: boolean | undefined;
4122
4140
  })[];
4123
4141
  type: "tuple";
4124
4142
  hidden?: boolean | undefined;
@@ -4347,6 +4365,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
4347
4365
  type: "guaranteedInvalid";
4348
4366
  })[];
4349
4367
  };
4368
+ hidden?: boolean | undefined;
4350
4369
  }, z.ZodTypeDef, {
4351
4370
  type: "function";
4352
4371
  name: string;
@@ -4563,6 +4582,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
4563
4582
  type: "guaranteedInvalid";
4564
4583
  })[];
4565
4584
  };
4585
+ hidden?: boolean | undefined;
4566
4586
  }>]>, "many">;
4567
4587
  }, "strip", z.ZodTypeAny, {
4568
4588
  value: ({
@@ -4840,6 +4860,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
4840
4860
  type: "guaranteedInvalid";
4841
4861
  })[];
4842
4862
  };
4863
+ hidden?: boolean | undefined;
4843
4864
  } | {
4844
4865
  value: {
4845
4866
  value: string;
@@ -5084,6 +5105,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
5084
5105
  type: "guaranteedInvalid";
5085
5106
  })[];
5086
5107
  };
5108
+ hidden?: boolean | undefined;
5087
5109
  })[];
5088
5110
  type: "tuple";
5089
5111
  hidden?: boolean | undefined;
@@ -5421,6 +5443,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
5421
5443
  type: "guaranteedInvalid";
5422
5444
  })[];
5423
5445
  };
5446
+ hidden?: boolean | undefined;
5424
5447
  }, z.ZodTypeDef, {
5425
5448
  type: "function";
5426
5449
  name: string;
@@ -5637,6 +5660,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
5637
5660
  type: "guaranteedInvalid";
5638
5661
  })[];
5639
5662
  };
5663
+ hidden?: boolean | undefined;
5640
5664
  }>]>, "many">;
5641
5665
  hidden: z.ZodOptional<z.ZodBoolean>;
5642
5666
  }, "strip", z.ZodTypeAny, {
@@ -5894,6 +5918,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
5894
5918
  type: "guaranteedInvalid";
5895
5919
  })[];
5896
5920
  };
5921
+ hidden?: boolean | undefined;
5897
5922
  })[];
5898
5923
  type: "tuple";
5899
5924
  hidden?: boolean | undefined;
@@ -6113,6 +6138,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
6113
6138
  type: "guaranteedInvalid";
6114
6139
  })[];
6115
6140
  };
6141
+ hidden?: boolean | undefined;
6116
6142
  }, z.ZodTypeDef, {
6117
6143
  type: "function";
6118
6144
  name: string;
@@ -6329,6 +6355,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
6329
6355
  type: "guaranteedInvalid";
6330
6356
  })[];
6331
6357
  };
6358
+ hidden?: boolean | undefined;
6332
6359
  }>, z.ZodObject<{
6333
6360
  type: z.ZodLiteral<"guaranteedInvalid">;
6334
6361
  }, "strip", z.ZodTypeAny, {
@@ -6680,6 +6707,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
6680
6707
  type: "guaranteedInvalid";
6681
6708
  })[];
6682
6709
  };
6710
+ hidden?: boolean | undefined;
6683
6711
  } | {
6684
6712
  value: {
6685
6713
  value: string;
@@ -6924,6 +6952,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
6924
6952
  type: "guaranteedInvalid";
6925
6953
  })[];
6926
6954
  };
6955
+ hidden?: boolean | undefined;
6927
6956
  })[];
6928
6957
  type: "tuple";
6929
6958
  hidden?: boolean | undefined;
@@ -7155,6 +7184,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
7155
7184
  type: "guaranteedInvalid";
7156
7185
  })[];
7157
7186
  };
7187
+ hidden?: boolean | undefined;
7158
7188
  } | {
7159
7189
  value: {
7160
7190
  value: string;
@@ -7399,6 +7429,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
7399
7429
  type: "guaranteedInvalid";
7400
7430
  })[];
7401
7431
  };
7432
+ hidden?: boolean | undefined;
7402
7433
  })[];
7403
7434
  type: "tuple";
7404
7435
  hidden?: boolean | undefined;
@@ -7648,6 +7679,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
7648
7679
  type: "guaranteedInvalid";
7649
7680
  })[];
7650
7681
  };
7682
+ hidden?: boolean | undefined;
7651
7683
  } | {
7652
7684
  value: {
7653
7685
  value: string;
@@ -8080,6 +8112,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
8080
8112
  type: "guaranteedInvalid";
8081
8113
  })[];
8082
8114
  };
8115
+ hidden?: boolean | undefined;
8083
8116
  } | {
8084
8117
  value: {
8085
8118
  value: string;
@@ -8324,6 +8357,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
8324
8357
  type: "guaranteedInvalid";
8325
8358
  })[];
8326
8359
  };
8360
+ hidden?: boolean | undefined;
8327
8361
  })[];
8328
8362
  type: "tuple";
8329
8363
  hidden?: boolean | undefined;
@@ -8558,6 +8592,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
8558
8592
  type: "guaranteedInvalid";
8559
8593
  })[];
8560
8594
  };
8595
+ hidden?: boolean | undefined;
8561
8596
  } | {
8562
8597
  value: {
8563
8598
  value: string;
@@ -8802,6 +8837,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
8802
8837
  type: "guaranteedInvalid";
8803
8838
  })[];
8804
8839
  };
8840
+ hidden?: boolean | undefined;
8805
8841
  })[];
8806
8842
  type: "tuple";
8807
8843
  hidden?: boolean | undefined;
@@ -9054,6 +9090,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
9054
9090
  type: "guaranteedInvalid";
9055
9091
  })[];
9056
9092
  };
9093
+ hidden?: boolean | undefined;
9057
9094
  } | {
9058
9095
  value: {
9059
9096
  value: string;
@@ -9298,6 +9335,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
9298
9335
  type: "guaranteedInvalid";
9299
9336
  })[];
9300
9337
  };
9338
+ hidden?: boolean | undefined;
9301
9339
  })[];
9302
9340
  type: "tuple";
9303
9341
  hidden?: boolean | undefined;
@@ -9529,6 +9567,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
9529
9567
  type: "guaranteedInvalid";
9530
9568
  })[];
9531
9569
  };
9570
+ hidden?: boolean | undefined;
9532
9571
  } | {
9533
9572
  value: {
9534
9573
  value: string;
@@ -9773,6 +9812,7 @@ declare const EmbedTemplateStyleDeclRaw: z.ZodObject<{
9773
9812
  type: "guaranteedInvalid";
9774
9813
  })[];
9775
9814
  };
9815
+ hidden?: boolean | undefined;
9776
9816
  })[];
9777
9817
  type: "tuple";
9778
9818
  hidden?: boolean | undefined;
@@ -10028,6 +10068,7 @@ export declare const EmbedTemplateStyleDecl: z.ZodType<{
10028
10068
  type: "guaranteedInvalid";
10029
10069
  })[];
10030
10070
  };
10071
+ hidden?: boolean | undefined;
10031
10072
  } | {
10032
10073
  value: {
10033
10074
  value: string;
@@ -10460,6 +10501,7 @@ export declare const EmbedTemplateStyleDecl: z.ZodType<{
10460
10501
  type: "guaranteedInvalid";
10461
10502
  })[];
10462
10503
  };
10504
+ hidden?: boolean | undefined;
10463
10505
  } | {
10464
10506
  value: {
10465
10507
  value: string;
@@ -10670,12 +10712,15 @@ export declare const EmbedTemplateInstance: z.ZodType<EmbedTemplateInstance>;
10670
10712
  export declare const WsEmbedTemplate: z.ZodLazy<z.ZodArray<z.ZodUnion<[z.ZodType<EmbedTemplateInstance, z.ZodTypeDef, EmbedTemplateInstance>, z.ZodObject<{
10671
10713
  type: z.ZodLiteral<"text">;
10672
10714
  value: z.ZodString;
10715
+ placeholder: z.ZodOptional<z.ZodBoolean>;
10673
10716
  }, "strip", z.ZodTypeAny, {
10674
10717
  value: string;
10675
10718
  type: "text";
10719
+ placeholder?: boolean | undefined;
10676
10720
  }, {
10677
10721
  value: string;
10678
10722
  type: "text";
10723
+ placeholder?: boolean | undefined;
10679
10724
  }>, z.ZodObject<{
10680
10725
  type: z.ZodLiteral<"expression">;
10681
10726
  value: z.ZodString;
@@ -10690,6 +10735,7 @@ export type WsEmbedTemplate = z.infer<typeof WsEmbedTemplate>;
10690
10735
  export declare const generateDataFromEmbedTemplate: (treeTemplate: ({
10691
10736
  value: string;
10692
10737
  type: "text";
10738
+ placeholder?: boolean | undefined;
10693
10739
  } | {
10694
10740
  value: string;
10695
10741
  type: "expression";
@@ -10697,16 +10743,17 @@ export declare const generateDataFromEmbedTemplate: (treeTemplate: ({
10697
10743
  export declare const namespaceMeta: (meta: WsComponentMeta, namespace: string, components: Set<EmbedTemplateInstance["component"]>) => {
10698
10744
  type: "control" | "embed" | "container" | "rich-text-child";
10699
10745
  description?: string | undefined;
10746
+ category?: "data" | "xml" | "text" | "hidden" | "media" | "general" | "forms" | "radix" | "internal" | undefined;
10700
10747
  label?: string | undefined;
10701
10748
  order?: number | undefined;
10702
10749
  template?: ({
10703
10750
  value: string;
10704
10751
  type: "text";
10752
+ placeholder?: boolean | undefined;
10705
10753
  } | {
10706
10754
  value: string;
10707
10755
  type: "expression";
10708
10756
  } | EmbedTemplateInstance)[] | undefined;
10709
- category?: "data" | "xml" | "text" | "hidden" | "media" | "general" | "forms" | "radix" | "internal" | undefined;
10710
10757
  requiredAncestors?: string[] | undefined;
10711
10758
  invalidAncestors?: string[] | undefined;
10712
10759
  indexWithinAncestor?: string | undefined;
@@ -10951,6 +10998,7 @@ export declare const namespaceMeta: (meta: WsComponentMeta, namespace: string, c
10951
10998
  type: "guaranteedInvalid";
10952
10999
  })[];
10953
11000
  };
11001
+ hidden?: boolean | undefined;
10954
11002
  } | {
10955
11003
  value: {
10956
11004
  value: string;
@@ -11391,6 +11439,7 @@ export declare const namespaceMeta: (meta: WsComponentMeta, namespace: string, c
11391
11439
  type: "guaranteedInvalid";
11392
11440
  })[];
11393
11441
  };
11442
+ hidden?: boolean | undefined;
11394
11443
  } | {
11395
11444
  value: {
11396
11445
  value: string;
@@ -31,6 +31,7 @@ export declare const getClosestInstance: (instancePath: InstancePath, currentIns
31
31
  children: ({
32
32
  value: string;
33
33
  type: "text";
34
+ placeholder?: boolean | undefined;
34
35
  } | {
35
36
  value: string;
36
37
  type: "id";
@@ -7,6 +7,7 @@ export declare const getIndexesWithinAncestors: (metas: Map<Instance["component"
7
7
  children: ({
8
8
  value: string;
9
9
  type: "text";
10
+ placeholder?: boolean | undefined;
10
11
  } | {
11
12
  value: string;
12
13
  type: "id";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/react-sdk",
3
- "version": "0.163.0",
3
+ "version": "0.168.0",
4
4
  "description": "Webstudio JavaScript / TypeScript API",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -24,15 +24,15 @@
24
24
  "zod": "^3.19.1"
25
25
  },
26
26
  "dependencies": {
27
- "change-case": "^5.0.2",
27
+ "change-case": "^5.4.4",
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.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"
31
+ "@webstudio-is/css-engine": "0.168.0",
32
+ "@webstudio-is/sdk": "0.168.0",
33
+ "@webstudio-is/icons": "^0.168.0",
34
+ "@webstudio-is/image": "0.168.0",
35
+ "@webstudio-is/fonts": "0.168.0"
36
36
  },
37
37
  "exports": {
38
38
  ".": {