@webstudio-is/react-sdk 0.142.0 → 0.144.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 +36 -526
- package/lib/types/components/component-meta.d.ts +80 -0
- package/lib/types/context.d.ts +5 -0
- package/lib/types/css/css.d.ts +7 -10
- package/lib/types/css/normalize.d.ts +392 -0
- package/lib/types/embed-template.d.ts +205 -1
- package/lib/types/index.d.ts +0 -5
- package/package.json +6 -11
- package/lib/types/app/index.d.ts +0 -1
- package/lib/types/app/root.d.ts +0 -7
- package/lib/types/expression.d.ts +0 -94
- package/lib/types/generator.d.ts +0 -9
- package/lib/types/generator.test.d.ts +0 -1
- package/lib/types/page-meta-generator.d.ts +0 -52
- package/lib/types/page-meta-generator.test.d.ts +0 -1
- package/lib/types/resources-generator.d.ts +0 -49
- package/lib/types/resources-generator.test.d.ts +0 -1
- /package/lib/types/{expression.test.d.ts → css/css.test.d.ts} +0 -0
|
@@ -842,6 +842,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
842
842
|
type: "invalid";
|
|
843
843
|
})[];
|
|
844
844
|
type: "layers";
|
|
845
|
+
} | {
|
|
846
|
+
type: "guaranteedInvalid";
|
|
845
847
|
} | {
|
|
846
848
|
value: "";
|
|
847
849
|
type: "unset";
|
|
@@ -947,6 +949,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
947
949
|
type: "invalid";
|
|
948
950
|
})[];
|
|
949
951
|
type: "layers";
|
|
952
|
+
} | {
|
|
953
|
+
type: "guaranteedInvalid";
|
|
950
954
|
})[];
|
|
951
955
|
};
|
|
952
956
|
} | {
|
|
@@ -1031,6 +1035,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
1031
1035
|
type: "invalid";
|
|
1032
1036
|
})[];
|
|
1033
1037
|
type: "layers";
|
|
1038
|
+
} | {
|
|
1039
|
+
type: "guaranteedInvalid";
|
|
1034
1040
|
} | {
|
|
1035
1041
|
value: "";
|
|
1036
1042
|
type: "unset";
|
|
@@ -1136,6 +1142,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
1136
1142
|
type: "invalid";
|
|
1137
1143
|
})[];
|
|
1138
1144
|
type: "layers";
|
|
1145
|
+
} | {
|
|
1146
|
+
type: "guaranteedInvalid";
|
|
1139
1147
|
})[];
|
|
1140
1148
|
};
|
|
1141
1149
|
state?: string | undefined;
|
|
@@ -1266,6 +1274,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
1266
1274
|
type: "invalid";
|
|
1267
1275
|
})[];
|
|
1268
1276
|
type: "layers";
|
|
1277
|
+
} | {
|
|
1278
|
+
type: "guaranteedInvalid";
|
|
1269
1279
|
} | {
|
|
1270
1280
|
value: "";
|
|
1271
1281
|
type: "unset";
|
|
@@ -1371,6 +1381,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
1371
1381
|
type: "invalid";
|
|
1372
1382
|
})[];
|
|
1373
1383
|
type: "layers";
|
|
1384
|
+
} | {
|
|
1385
|
+
type: "guaranteedInvalid";
|
|
1374
1386
|
})[];
|
|
1375
1387
|
};
|
|
1376
1388
|
} | {
|
|
@@ -1455,6 +1467,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
1455
1467
|
type: "invalid";
|
|
1456
1468
|
})[];
|
|
1457
1469
|
type: "layers";
|
|
1470
|
+
} | {
|
|
1471
|
+
type: "guaranteedInvalid";
|
|
1458
1472
|
} | {
|
|
1459
1473
|
value: "";
|
|
1460
1474
|
type: "unset";
|
|
@@ -1560,6 +1574,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
1560
1574
|
type: "invalid";
|
|
1561
1575
|
})[];
|
|
1562
1576
|
type: "layers";
|
|
1577
|
+
} | {
|
|
1578
|
+
type: "guaranteedInvalid";
|
|
1563
1579
|
})[];
|
|
1564
1580
|
};
|
|
1565
1581
|
state?: string | undefined;
|
|
@@ -1693,6 +1709,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
1693
1709
|
type: "invalid";
|
|
1694
1710
|
})[];
|
|
1695
1711
|
type: "layers";
|
|
1712
|
+
} | {
|
|
1713
|
+
type: "guaranteedInvalid";
|
|
1696
1714
|
} | {
|
|
1697
1715
|
value: "";
|
|
1698
1716
|
type: "unset";
|
|
@@ -1798,6 +1816,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
1798
1816
|
type: "invalid";
|
|
1799
1817
|
})[];
|
|
1800
1818
|
type: "layers";
|
|
1819
|
+
} | {
|
|
1820
|
+
type: "guaranteedInvalid";
|
|
1801
1821
|
})[];
|
|
1802
1822
|
};
|
|
1803
1823
|
} | {
|
|
@@ -1882,6 +1902,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
1882
1902
|
type: "invalid";
|
|
1883
1903
|
})[];
|
|
1884
1904
|
type: "layers";
|
|
1905
|
+
} | {
|
|
1906
|
+
type: "guaranteedInvalid";
|
|
1885
1907
|
} | {
|
|
1886
1908
|
value: "";
|
|
1887
1909
|
type: "unset";
|
|
@@ -1987,6 +2009,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
1987
2009
|
type: "invalid";
|
|
1988
2010
|
})[];
|
|
1989
2011
|
type: "layers";
|
|
2012
|
+
} | {
|
|
2013
|
+
type: "guaranteedInvalid";
|
|
1990
2014
|
})[];
|
|
1991
2015
|
};
|
|
1992
2016
|
state?: string | undefined;
|
|
@@ -2117,6 +2141,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
2117
2141
|
type: "invalid";
|
|
2118
2142
|
})[];
|
|
2119
2143
|
type: "layers";
|
|
2144
|
+
} | {
|
|
2145
|
+
type: "guaranteedInvalid";
|
|
2120
2146
|
} | {
|
|
2121
2147
|
value: "";
|
|
2122
2148
|
type: "unset";
|
|
@@ -2222,6 +2248,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
2222
2248
|
type: "invalid";
|
|
2223
2249
|
})[];
|
|
2224
2250
|
type: "layers";
|
|
2251
|
+
} | {
|
|
2252
|
+
type: "guaranteedInvalid";
|
|
2225
2253
|
})[];
|
|
2226
2254
|
};
|
|
2227
2255
|
} | {
|
|
@@ -2306,6 +2334,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
2306
2334
|
type: "invalid";
|
|
2307
2335
|
})[];
|
|
2308
2336
|
type: "layers";
|
|
2337
|
+
} | {
|
|
2338
|
+
type: "guaranteedInvalid";
|
|
2309
2339
|
} | {
|
|
2310
2340
|
value: "";
|
|
2311
2341
|
type: "unset";
|
|
@@ -2411,6 +2441,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
2411
2441
|
type: "invalid";
|
|
2412
2442
|
})[];
|
|
2413
2443
|
type: "layers";
|
|
2444
|
+
} | {
|
|
2445
|
+
type: "guaranteedInvalid";
|
|
2414
2446
|
})[];
|
|
2415
2447
|
};
|
|
2416
2448
|
state?: string | undefined;
|
|
@@ -2543,6 +2575,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
2543
2575
|
type: "invalid";
|
|
2544
2576
|
})[];
|
|
2545
2577
|
type: "layers";
|
|
2578
|
+
} | {
|
|
2579
|
+
type: "guaranteedInvalid";
|
|
2546
2580
|
} | {
|
|
2547
2581
|
value: "";
|
|
2548
2582
|
type: "unset";
|
|
@@ -2648,6 +2682,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
2648
2682
|
type: "invalid";
|
|
2649
2683
|
})[];
|
|
2650
2684
|
type: "layers";
|
|
2685
|
+
} | {
|
|
2686
|
+
type: "guaranteedInvalid";
|
|
2651
2687
|
})[];
|
|
2652
2688
|
};
|
|
2653
2689
|
} | {
|
|
@@ -2732,6 +2768,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
2732
2768
|
type: "invalid";
|
|
2733
2769
|
})[];
|
|
2734
2770
|
type: "layers";
|
|
2771
|
+
} | {
|
|
2772
|
+
type: "guaranteedInvalid";
|
|
2735
2773
|
} | {
|
|
2736
2774
|
value: "";
|
|
2737
2775
|
type: "unset";
|
|
@@ -2837,6 +2875,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
2837
2875
|
type: "invalid";
|
|
2838
2876
|
})[];
|
|
2839
2877
|
type: "layers";
|
|
2878
|
+
} | {
|
|
2879
|
+
type: "guaranteedInvalid";
|
|
2840
2880
|
})[];
|
|
2841
2881
|
};
|
|
2842
2882
|
state?: string | undefined;
|
|
@@ -2970,6 +3010,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
2970
3010
|
type: "invalid";
|
|
2971
3011
|
})[];
|
|
2972
3012
|
type: "layers";
|
|
3013
|
+
} | {
|
|
3014
|
+
type: "guaranteedInvalid";
|
|
2973
3015
|
} | {
|
|
2974
3016
|
value: "";
|
|
2975
3017
|
type: "unset";
|
|
@@ -3075,6 +3117,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
3075
3117
|
type: "invalid";
|
|
3076
3118
|
})[];
|
|
3077
3119
|
type: "layers";
|
|
3120
|
+
} | {
|
|
3121
|
+
type: "guaranteedInvalid";
|
|
3078
3122
|
})[];
|
|
3079
3123
|
};
|
|
3080
3124
|
} | {
|
|
@@ -3159,6 +3203,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
3159
3203
|
type: "invalid";
|
|
3160
3204
|
})[];
|
|
3161
3205
|
type: "layers";
|
|
3206
|
+
} | {
|
|
3207
|
+
type: "guaranteedInvalid";
|
|
3162
3208
|
} | {
|
|
3163
3209
|
value: "";
|
|
3164
3210
|
type: "unset";
|
|
@@ -3264,6 +3310,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
3264
3310
|
type: "invalid";
|
|
3265
3311
|
})[];
|
|
3266
3312
|
type: "layers";
|
|
3313
|
+
} | {
|
|
3314
|
+
type: "guaranteedInvalid";
|
|
3267
3315
|
})[];
|
|
3268
3316
|
};
|
|
3269
3317
|
state?: string | undefined;
|
|
@@ -3441,6 +3489,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
3441
3489
|
type: "invalid";
|
|
3442
3490
|
})[];
|
|
3443
3491
|
type: "layers";
|
|
3492
|
+
} | {
|
|
3493
|
+
type: "guaranteedInvalid";
|
|
3444
3494
|
} | {
|
|
3445
3495
|
value: "";
|
|
3446
3496
|
type: "unset";
|
|
@@ -3546,6 +3596,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
3546
3596
|
type: "invalid";
|
|
3547
3597
|
})[];
|
|
3548
3598
|
type: "layers";
|
|
3599
|
+
} | {
|
|
3600
|
+
type: "guaranteedInvalid";
|
|
3549
3601
|
})[];
|
|
3550
3602
|
};
|
|
3551
3603
|
} | {
|
|
@@ -3630,6 +3682,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
3630
3682
|
type: "invalid";
|
|
3631
3683
|
})[];
|
|
3632
3684
|
type: "layers";
|
|
3685
|
+
} | {
|
|
3686
|
+
type: "guaranteedInvalid";
|
|
3633
3687
|
} | {
|
|
3634
3688
|
value: "";
|
|
3635
3689
|
type: "unset";
|
|
@@ -3735,6 +3789,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
3735
3789
|
type: "invalid";
|
|
3736
3790
|
})[];
|
|
3737
3791
|
type: "layers";
|
|
3792
|
+
} | {
|
|
3793
|
+
type: "guaranteedInvalid";
|
|
3738
3794
|
})[];
|
|
3739
3795
|
};
|
|
3740
3796
|
state?: string | undefined;
|
|
@@ -3867,6 +3923,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
3867
3923
|
type: "invalid";
|
|
3868
3924
|
})[];
|
|
3869
3925
|
type: "layers";
|
|
3926
|
+
} | {
|
|
3927
|
+
type: "guaranteedInvalid";
|
|
3870
3928
|
} | {
|
|
3871
3929
|
value: "";
|
|
3872
3930
|
type: "unset";
|
|
@@ -3972,6 +4030,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
3972
4030
|
type: "invalid";
|
|
3973
4031
|
})[];
|
|
3974
4032
|
type: "layers";
|
|
4033
|
+
} | {
|
|
4034
|
+
type: "guaranteedInvalid";
|
|
3975
4035
|
})[];
|
|
3976
4036
|
};
|
|
3977
4037
|
} | {
|
|
@@ -4056,6 +4116,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
4056
4116
|
type: "invalid";
|
|
4057
4117
|
})[];
|
|
4058
4118
|
type: "layers";
|
|
4119
|
+
} | {
|
|
4120
|
+
type: "guaranteedInvalid";
|
|
4059
4121
|
} | {
|
|
4060
4122
|
value: "";
|
|
4061
4123
|
type: "unset";
|
|
@@ -4161,6 +4223,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
4161
4223
|
type: "invalid";
|
|
4162
4224
|
})[];
|
|
4163
4225
|
type: "layers";
|
|
4226
|
+
} | {
|
|
4227
|
+
type: "guaranteedInvalid";
|
|
4164
4228
|
})[];
|
|
4165
4229
|
};
|
|
4166
4230
|
state?: string | undefined;
|
|
@@ -4318,6 +4382,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
4318
4382
|
type: "invalid";
|
|
4319
4383
|
})[];
|
|
4320
4384
|
type: "layers";
|
|
4385
|
+
} | {
|
|
4386
|
+
type: "guaranteedInvalid";
|
|
4321
4387
|
} | {
|
|
4322
4388
|
value: "";
|
|
4323
4389
|
type: "unset";
|
|
@@ -4423,6 +4489,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
4423
4489
|
type: "invalid";
|
|
4424
4490
|
})[];
|
|
4425
4491
|
type: "layers";
|
|
4492
|
+
} | {
|
|
4493
|
+
type: "guaranteedInvalid";
|
|
4426
4494
|
})[];
|
|
4427
4495
|
};
|
|
4428
4496
|
} | {
|
|
@@ -4507,6 +4575,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
4507
4575
|
type: "invalid";
|
|
4508
4576
|
})[];
|
|
4509
4577
|
type: "layers";
|
|
4578
|
+
} | {
|
|
4579
|
+
type: "guaranteedInvalid";
|
|
4510
4580
|
} | {
|
|
4511
4581
|
value: "";
|
|
4512
4582
|
type: "unset";
|
|
@@ -4612,6 +4682,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
4612
4682
|
type: "invalid";
|
|
4613
4683
|
})[];
|
|
4614
4684
|
type: "layers";
|
|
4685
|
+
} | {
|
|
4686
|
+
type: "guaranteedInvalid";
|
|
4615
4687
|
})[];
|
|
4616
4688
|
};
|
|
4617
4689
|
state?: string | undefined;
|
|
@@ -4744,6 +4816,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
4744
4816
|
type: "invalid";
|
|
4745
4817
|
})[];
|
|
4746
4818
|
type: "layers";
|
|
4819
|
+
} | {
|
|
4820
|
+
type: "guaranteedInvalid";
|
|
4747
4821
|
} | {
|
|
4748
4822
|
value: "";
|
|
4749
4823
|
type: "unset";
|
|
@@ -4849,6 +4923,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
4849
4923
|
type: "invalid";
|
|
4850
4924
|
})[];
|
|
4851
4925
|
type: "layers";
|
|
4926
|
+
} | {
|
|
4927
|
+
type: "guaranteedInvalid";
|
|
4852
4928
|
})[];
|
|
4853
4929
|
};
|
|
4854
4930
|
} | {
|
|
@@ -4933,6 +5009,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
4933
5009
|
type: "invalid";
|
|
4934
5010
|
})[];
|
|
4935
5011
|
type: "layers";
|
|
5012
|
+
} | {
|
|
5013
|
+
type: "guaranteedInvalid";
|
|
4936
5014
|
} | {
|
|
4937
5015
|
value: "";
|
|
4938
5016
|
type: "unset";
|
|
@@ -5038,6 +5116,8 @@ export declare const WsComponentMeta: z.ZodObject<{
|
|
|
5038
5116
|
type: "invalid";
|
|
5039
5117
|
})[];
|
|
5040
5118
|
type: "layers";
|
|
5119
|
+
} | {
|
|
5120
|
+
type: "guaranteedInvalid";
|
|
5041
5121
|
})[];
|
|
5042
5122
|
};
|
|
5043
5123
|
state?: string | undefined;
|
package/lib/types/context.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ImageLoader } from "@webstudio-is/image";
|
|
3
3
|
export type Params = {
|
|
4
|
+
/**
|
|
5
|
+
* When rendering a published version, there is no renderer defined.
|
|
6
|
+
* - canvas is the builder canvas in dev mode
|
|
7
|
+
* - preview is the preview mode in builder
|
|
8
|
+
*/
|
|
4
9
|
renderer?: "canvas" | "preview";
|
|
5
10
|
/**
|
|
6
11
|
* Base url ir base path for images with ending slash.
|
package/lib/types/css/css.d.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { type TransformValue } from "@webstudio-is/css-engine";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Assets, Breakpoints, StyleSourceSelections, Styles } from "@webstudio-is/sdk";
|
|
3
3
|
import type { WsComponentMeta } from "../components/component-meta";
|
|
4
|
-
type
|
|
5
|
-
assets:
|
|
6
|
-
breakpoints:
|
|
7
|
-
styles:
|
|
8
|
-
styleSourceSelections:
|
|
4
|
+
export type CssConfig = {
|
|
5
|
+
assets: Assets;
|
|
6
|
+
breakpoints: Breakpoints;
|
|
7
|
+
styles: Styles;
|
|
8
|
+
styleSourceSelections: StyleSourceSelections;
|
|
9
9
|
componentMetas: Map<string, WsComponentMeta>;
|
|
10
|
-
};
|
|
11
|
-
type CssOptions = {
|
|
12
10
|
assetBaseUrl: string;
|
|
13
11
|
atomic: boolean;
|
|
14
12
|
};
|
|
@@ -62,8 +60,7 @@ export declare const createImageValueTransformer: (assets: Map<string, {
|
|
|
62
60
|
}>, { assetBaseUrl }: {
|
|
63
61
|
assetBaseUrl: string;
|
|
64
62
|
}) => TransformValue;
|
|
65
|
-
export declare const generateCss: (
|
|
63
|
+
export declare const generateCss: ({ assets, breakpoints, styles, styleSourceSelections, componentMetas, assetBaseUrl, atomic, }: CssConfig) => {
|
|
66
64
|
cssText: string;
|
|
67
65
|
classesMap: Map<string, string[]>;
|
|
68
66
|
};
|
|
69
|
-
export {};
|