@webstudio-is/sdk 0.167.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
@@ -487,8 +487,9 @@ var lintExpression = ({
487
487
  const addError = (message) => {
488
488
  return (node) => {
489
489
  diagnostics.push({
490
- from: node.start,
491
- to: node.end,
490
+ // tune error position after wrapping expression with parentheses
491
+ from: node.start - 1,
492
+ to: node.end - 1,
492
493
  severity: "error",
493
494
  message
494
495
  });
@@ -504,7 +505,7 @@ var lintExpression = ({
504
505
  return diagnostics;
505
506
  }
506
507
  try {
507
- const root = parseExpressionAt(expression, 0, {
508
+ const root = parseExpressionAt(`(${expression})`, 0, {
508
509
  ecmaVersion: "latest",
509
510
  // support parsing import to forbid explicitly
510
511
  sourceType: "module"
@@ -569,10 +570,13 @@ var lintExpression = ({
569
570
  } catch (error) {
570
571
  const castedError = error;
571
572
  diagnostics.push({
572
- from: castedError.pos,
573
- to: castedError.pos,
573
+ // tune error position after wrapping expression with parentheses
574
+ from: castedError.pos - 1,
575
+ to: castedError.pos - 1,
574
576
  severity: "error",
575
- message: castedError.message
577
+ // trim auto generated error location
578
+ // to not conflict with tuned position
579
+ message: castedError.message.replaceAll(/\s+\(\d+:\d+\)$/g, "")
576
580
  });
577
581
  }
578
582
  return diagnostics;
@@ -394,6 +394,7 @@ declare const StyleDeclRaw: z.ZodObject<{
394
394
  type: "guaranteedInvalid";
395
395
  })[];
396
396
  };
397
+ hidden?: boolean | undefined;
397
398
  }, z.ZodTypeDef, {
398
399
  type: "function";
399
400
  name: string;
@@ -610,6 +611,7 @@ declare const StyleDeclRaw: z.ZodObject<{
610
611
  type: "guaranteedInvalid";
611
612
  })[];
612
613
  };
614
+ hidden?: boolean | undefined;
613
615
  }>]>, "many">;
614
616
  hidden: z.ZodOptional<z.ZodBoolean>;
615
617
  }, "strip", z.ZodTypeAny, {
@@ -867,6 +869,7 @@ declare const StyleDeclRaw: z.ZodObject<{
867
869
  type: "guaranteedInvalid";
868
870
  })[];
869
871
  };
872
+ hidden?: boolean | undefined;
870
873
  })[];
871
874
  type: "tuple";
872
875
  hidden?: boolean | undefined;
@@ -1095,6 +1098,7 @@ declare const StyleDeclRaw: z.ZodObject<{
1095
1098
  type: "guaranteedInvalid";
1096
1099
  })[];
1097
1100
  };
1101
+ hidden?: boolean | undefined;
1098
1102
  }, z.ZodTypeDef, {
1099
1103
  type: "function";
1100
1104
  name: string;
@@ -1311,6 +1315,7 @@ declare const StyleDeclRaw: z.ZodObject<{
1311
1315
  type: "guaranteedInvalid";
1312
1316
  })[];
1313
1317
  };
1318
+ hidden?: boolean | undefined;
1314
1319
  }>]>, "many">;
1315
1320
  }, "strip", z.ZodTypeAny, {
1316
1321
  value: ({
@@ -1588,6 +1593,7 @@ declare const StyleDeclRaw: z.ZodObject<{
1588
1593
  type: "guaranteedInvalid";
1589
1594
  })[];
1590
1595
  };
1596
+ hidden?: boolean | undefined;
1591
1597
  } | {
1592
1598
  value: {
1593
1599
  value: string;
@@ -1832,6 +1838,7 @@ declare const StyleDeclRaw: z.ZodObject<{
1832
1838
  type: "guaranteedInvalid";
1833
1839
  })[];
1834
1840
  };
1841
+ hidden?: boolean | undefined;
1835
1842
  })[];
1836
1843
  type: "tuple";
1837
1844
  hidden?: boolean | undefined;
@@ -2169,6 +2176,7 @@ declare const StyleDeclRaw: z.ZodObject<{
2169
2176
  type: "guaranteedInvalid";
2170
2177
  })[];
2171
2178
  };
2179
+ hidden?: boolean | undefined;
2172
2180
  }, z.ZodTypeDef, {
2173
2181
  type: "function";
2174
2182
  name: string;
@@ -2385,6 +2393,7 @@ declare const StyleDeclRaw: z.ZodObject<{
2385
2393
  type: "guaranteedInvalid";
2386
2394
  })[];
2387
2395
  };
2396
+ hidden?: boolean | undefined;
2388
2397
  }>]>, "many">;
2389
2398
  hidden: z.ZodOptional<z.ZodBoolean>;
2390
2399
  }, "strip", z.ZodTypeAny, {
@@ -2642,6 +2651,7 @@ declare const StyleDeclRaw: z.ZodObject<{
2642
2651
  type: "guaranteedInvalid";
2643
2652
  })[];
2644
2653
  };
2654
+ hidden?: boolean | undefined;
2645
2655
  })[];
2646
2656
  type: "tuple";
2647
2657
  hidden?: boolean | undefined;
@@ -2861,6 +2871,7 @@ declare const StyleDeclRaw: z.ZodObject<{
2861
2871
  type: "guaranteedInvalid";
2862
2872
  })[];
2863
2873
  };
2874
+ hidden?: boolean | undefined;
2864
2875
  }, z.ZodTypeDef, {
2865
2876
  type: "function";
2866
2877
  name: string;
@@ -3077,6 +3088,7 @@ declare const StyleDeclRaw: z.ZodObject<{
3077
3088
  type: "guaranteedInvalid";
3078
3089
  })[];
3079
3090
  };
3091
+ hidden?: boolean | undefined;
3080
3092
  }>, z.ZodObject<{
3081
3093
  type: z.ZodLiteral<"guaranteedInvalid">;
3082
3094
  }, "strip", z.ZodTypeAny, {
@@ -3492,6 +3504,7 @@ declare const StyleDeclRaw: z.ZodObject<{
3492
3504
  type: "guaranteedInvalid";
3493
3505
  })[];
3494
3506
  };
3507
+ hidden?: boolean | undefined;
3495
3508
  }, z.ZodTypeDef, {
3496
3509
  type: "function";
3497
3510
  name: string;
@@ -3708,6 +3721,7 @@ declare const StyleDeclRaw: z.ZodObject<{
3708
3721
  type: "guaranteedInvalid";
3709
3722
  })[];
3710
3723
  };
3724
+ hidden?: boolean | undefined;
3711
3725
  }>]>, "many">;
3712
3726
  hidden: z.ZodOptional<z.ZodBoolean>;
3713
3727
  }, "strip", z.ZodTypeAny, {
@@ -3965,6 +3979,7 @@ declare const StyleDeclRaw: z.ZodObject<{
3965
3979
  type: "guaranteedInvalid";
3966
3980
  })[];
3967
3981
  };
3982
+ hidden?: boolean | undefined;
3968
3983
  })[];
3969
3984
  type: "tuple";
3970
3985
  hidden?: boolean | undefined;
@@ -4193,6 +4208,7 @@ declare const StyleDeclRaw: z.ZodObject<{
4193
4208
  type: "guaranteedInvalid";
4194
4209
  })[];
4195
4210
  };
4211
+ hidden?: boolean | undefined;
4196
4212
  }, z.ZodTypeDef, {
4197
4213
  type: "function";
4198
4214
  name: string;
@@ -4409,6 +4425,7 @@ declare const StyleDeclRaw: z.ZodObject<{
4409
4425
  type: "guaranteedInvalid";
4410
4426
  })[];
4411
4427
  };
4428
+ hidden?: boolean | undefined;
4412
4429
  }>]>, "many">;
4413
4430
  }, "strip", z.ZodTypeAny, {
4414
4431
  value: ({
@@ -4686,6 +4703,7 @@ declare const StyleDeclRaw: z.ZodObject<{
4686
4703
  type: "guaranteedInvalid";
4687
4704
  })[];
4688
4705
  };
4706
+ hidden?: boolean | undefined;
4689
4707
  } | {
4690
4708
  value: {
4691
4709
  value: string;
@@ -4930,6 +4948,7 @@ declare const StyleDeclRaw: z.ZodObject<{
4930
4948
  type: "guaranteedInvalid";
4931
4949
  })[];
4932
4950
  };
4951
+ hidden?: boolean | undefined;
4933
4952
  })[];
4934
4953
  type: "tuple";
4935
4954
  hidden?: boolean | undefined;
@@ -5267,6 +5286,7 @@ declare const StyleDeclRaw: z.ZodObject<{
5267
5286
  type: "guaranteedInvalid";
5268
5287
  })[];
5269
5288
  };
5289
+ hidden?: boolean | undefined;
5270
5290
  }, z.ZodTypeDef, {
5271
5291
  type: "function";
5272
5292
  name: string;
@@ -5483,6 +5503,7 @@ declare const StyleDeclRaw: z.ZodObject<{
5483
5503
  type: "guaranteedInvalid";
5484
5504
  })[];
5485
5505
  };
5506
+ hidden?: boolean | undefined;
5486
5507
  }>]>, "many">;
5487
5508
  hidden: z.ZodOptional<z.ZodBoolean>;
5488
5509
  }, "strip", z.ZodTypeAny, {
@@ -5740,6 +5761,7 @@ declare const StyleDeclRaw: z.ZodObject<{
5740
5761
  type: "guaranteedInvalid";
5741
5762
  })[];
5742
5763
  };
5764
+ hidden?: boolean | undefined;
5743
5765
  })[];
5744
5766
  type: "tuple";
5745
5767
  hidden?: boolean | undefined;
@@ -5959,6 +5981,7 @@ declare const StyleDeclRaw: z.ZodObject<{
5959
5981
  type: "guaranteedInvalid";
5960
5982
  })[];
5961
5983
  };
5984
+ hidden?: boolean | undefined;
5962
5985
  }, z.ZodTypeDef, {
5963
5986
  type: "function";
5964
5987
  name: string;
@@ -6175,6 +6198,7 @@ declare const StyleDeclRaw: z.ZodObject<{
6175
6198
  type: "guaranteedInvalid";
6176
6199
  })[];
6177
6200
  };
6201
+ hidden?: boolean | undefined;
6178
6202
  }>, z.ZodObject<{
6179
6203
  type: z.ZodLiteral<"guaranteedInvalid">;
6180
6204
  }, "strip", z.ZodTypeAny, {
@@ -6526,6 +6550,7 @@ declare const StyleDeclRaw: z.ZodObject<{
6526
6550
  type: "guaranteedInvalid";
6527
6551
  })[];
6528
6552
  };
6553
+ hidden?: boolean | undefined;
6529
6554
  } | {
6530
6555
  value: {
6531
6556
  value: string;
@@ -6770,6 +6795,7 @@ declare const StyleDeclRaw: z.ZodObject<{
6770
6795
  type: "guaranteedInvalid";
6771
6796
  })[];
6772
6797
  };
6798
+ hidden?: boolean | undefined;
6773
6799
  })[];
6774
6800
  type: "tuple";
6775
6801
  hidden?: boolean | undefined;
@@ -7001,6 +7027,7 @@ declare const StyleDeclRaw: z.ZodObject<{
7001
7027
  type: "guaranteedInvalid";
7002
7028
  })[];
7003
7029
  };
7030
+ hidden?: boolean | undefined;
7004
7031
  } | {
7005
7032
  value: {
7006
7033
  value: string;
@@ -7245,6 +7272,7 @@ declare const StyleDeclRaw: z.ZodObject<{
7245
7272
  type: "guaranteedInvalid";
7246
7273
  })[];
7247
7274
  };
7275
+ hidden?: boolean | undefined;
7248
7276
  })[];
7249
7277
  type: "tuple";
7250
7278
  hidden?: boolean | undefined;
@@ -7495,6 +7523,7 @@ declare const StyleDeclRaw: z.ZodObject<{
7495
7523
  type: "guaranteedInvalid";
7496
7524
  })[];
7497
7525
  };
7526
+ hidden?: boolean | undefined;
7498
7527
  } | {
7499
7528
  value: {
7500
7529
  value: string;
@@ -7930,6 +7959,7 @@ declare const StyleDeclRaw: z.ZodObject<{
7930
7959
  type: "guaranteedInvalid";
7931
7960
  })[];
7932
7961
  };
7962
+ hidden?: boolean | undefined;
7933
7963
  } | {
7934
7964
  value: {
7935
7965
  value: string;
@@ -8174,6 +8204,7 @@ declare const StyleDeclRaw: z.ZodObject<{
8174
8204
  type: "guaranteedInvalid";
8175
8205
  })[];
8176
8206
  };
8207
+ hidden?: boolean | undefined;
8177
8208
  })[];
8178
8209
  type: "tuple";
8179
8210
  hidden?: boolean | undefined;
@@ -8408,6 +8439,7 @@ declare const StyleDeclRaw: z.ZodObject<{
8408
8439
  type: "guaranteedInvalid";
8409
8440
  })[];
8410
8441
  };
8442
+ hidden?: boolean | undefined;
8411
8443
  } | {
8412
8444
  value: {
8413
8445
  value: string;
@@ -8652,6 +8684,7 @@ declare const StyleDeclRaw: z.ZodObject<{
8652
8684
  type: "guaranteedInvalid";
8653
8685
  })[];
8654
8686
  };
8687
+ hidden?: boolean | undefined;
8655
8688
  })[];
8656
8689
  type: "tuple";
8657
8690
  hidden?: boolean | undefined;
@@ -8904,6 +8937,7 @@ declare const StyleDeclRaw: z.ZodObject<{
8904
8937
  type: "guaranteedInvalid";
8905
8938
  })[];
8906
8939
  };
8940
+ hidden?: boolean | undefined;
8907
8941
  } | {
8908
8942
  value: {
8909
8943
  value: string;
@@ -9148,6 +9182,7 @@ declare const StyleDeclRaw: z.ZodObject<{
9148
9182
  type: "guaranteedInvalid";
9149
9183
  })[];
9150
9184
  };
9185
+ hidden?: boolean | undefined;
9151
9186
  })[];
9152
9187
  type: "tuple";
9153
9188
  hidden?: boolean | undefined;
@@ -9379,6 +9414,7 @@ declare const StyleDeclRaw: z.ZodObject<{
9379
9414
  type: "guaranteedInvalid";
9380
9415
  })[];
9381
9416
  };
9417
+ hidden?: boolean | undefined;
9382
9418
  } | {
9383
9419
  value: {
9384
9420
  value: string;
@@ -9623,6 +9659,7 @@ declare const StyleDeclRaw: z.ZodObject<{
9623
9659
  type: "guaranteedInvalid";
9624
9660
  })[];
9625
9661
  };
9662
+ hidden?: boolean | undefined;
9626
9663
  })[];
9627
9664
  type: "tuple";
9628
9665
  hidden?: boolean | undefined;
@@ -9881,6 +9918,7 @@ export declare const StyleDecl: z.ZodType<{
9881
9918
  type: "guaranteedInvalid";
9882
9919
  })[];
9883
9920
  };
9921
+ hidden?: boolean | undefined;
9884
9922
  } | {
9885
9923
  value: {
9886
9924
  value: string;
@@ -10316,6 +10354,7 @@ export declare const StyleDecl: z.ZodType<{
10316
10354
  type: "guaranteedInvalid";
10317
10355
  })[];
10318
10356
  };
10357
+ hidden?: boolean | undefined;
10319
10358
  } | {
10320
10359
  value: {
10321
10360
  value: string;
@@ -10754,6 +10793,7 @@ export declare const Styles: z.ZodMap<z.ZodString, z.ZodType<{
10754
10793
  type: "guaranteedInvalid";
10755
10794
  })[];
10756
10795
  };
10796
+ hidden?: boolean | undefined;
10757
10797
  } | {
10758
10798
  value: {
10759
10799
  value: string;
@@ -11189,6 +11229,7 @@ export declare const Styles: z.ZodMap<z.ZodString, z.ZodType<{
11189
11229
  type: "guaranteedInvalid";
11190
11230
  })[];
11191
11231
  };
11232
+ hidden?: boolean | undefined;
11192
11233
  } | {
11193
11234
  value: {
11194
11235
  value: string;
@@ -998,6 +998,7 @@ export declare const WebstudioFragment: z.ZodObject<{
998
998
  type: "guaranteedInvalid";
999
999
  })[];
1000
1000
  };
1001
+ hidden?: boolean | undefined;
1001
1002
  } | {
1002
1003
  value: {
1003
1004
  value: string;
@@ -1433,6 +1434,7 @@ export declare const WebstudioFragment: z.ZodObject<{
1433
1434
  type: "guaranteedInvalid";
1434
1435
  })[];
1435
1436
  };
1437
+ hidden?: boolean | undefined;
1436
1438
  } | {
1437
1439
  value: {
1438
1440
  value: string;
@@ -2090,6 +2092,7 @@ export declare const WebstudioFragment: z.ZodObject<{
2090
2092
  type: "guaranteedInvalid";
2091
2093
  })[];
2092
2094
  };
2095
+ hidden?: boolean | undefined;
2093
2096
  } | {
2094
2097
  value: {
2095
2098
  value: string;
@@ -2747,6 +2750,7 @@ export declare const WebstudioFragment: z.ZodObject<{
2747
2750
  type: "guaranteedInvalid";
2748
2751
  })[];
2749
2752
  };
2753
+ hidden?: boolean | undefined;
2750
2754
  } | {
2751
2755
  value: {
2752
2756
  value: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/sdk",
3
- "version": "0.167.0",
3
+ "version": "0.168.0",
4
4
  "description": "Webstudio project data schema",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -21,8 +21,8 @@
21
21
  "acorn-walk": "^8.3.2",
22
22
  "type-fest": "^4.3.1",
23
23
  "zod": "^3.22.4",
24
- "@webstudio-is/css-engine": "0.167.0",
25
- "@webstudio-is/fonts": "0.167.0"
24
+ "@webstudio-is/css-engine": "0.168.0",
25
+ "@webstudio-is/fonts": "0.168.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@jest/globals": "^29.7.0",