@webstudio-is/react-sdk 0.78.0 → 0.80.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/cjs/context.js +8 -2
- package/lib/cjs/css/normalize.js +23 -43
- package/lib/cjs/css/presets.js +1 -111
- package/lib/cjs/embed-template.js +45 -16
- package/lib/cjs/expression.js +137 -22
- package/lib/cjs/index.js +6 -2
- package/lib/cjs/props.js +32 -2
- package/lib/cjs/tree/create-elements-tree.js +7 -2
- package/lib/cjs/tree/root.js +15 -7
- package/lib/context.js +8 -2
- package/lib/css/normalize.js +23 -33
- package/lib/css/presets.js +1 -111
- package/lib/embed-template.js +45 -16
- package/lib/expression.js +137 -22
- package/lib/index.js +13 -5
- package/lib/props.js +32 -2
- package/lib/tree/create-elements-tree.js +10 -3
- package/lib/tree/root.js +16 -8
- package/lib/types/components/component-meta.d.ts +30 -0
- package/lib/types/context.d.ts +5 -2
- package/lib/types/css/normalize.d.ts +0 -520
- package/lib/types/css/presets.d.ts +0 -282
- package/lib/types/embed-template.d.ts +38 -0
- package/lib/types/expression.d.ts +12 -4
- package/lib/types/index.d.ts +1 -1
- package/lib/types/props.d.ts +10 -0
- package/lib/types/tree/create-elements-tree.d.ts +6 -5
- package/lib/types/tree/root.d.ts +5 -5
- package/package.json +17 -16
- package/src/context.tsx +17 -4
- package/src/css/normalize.ts +23 -32
- package/src/css/presets.ts +0 -110
- package/src/embed-template.test.ts +84 -4
- package/src/embed-template.ts +51 -18
- package/src/expression.test.ts +106 -12
- package/src/expression.ts +157 -26
- package/src/index.ts +6 -2
- package/src/props.ts +33 -3
- package/src/tree/create-elements-tree.tsx +19 -10
- package/src/tree/root.ts +24 -13
|
@@ -366,6 +366,24 @@ declare const WsComponentPropsMeta: z.ZodObject<{
|
|
|
366
366
|
defaultValue?: string | undefined;
|
|
367
367
|
label?: string | undefined;
|
|
368
368
|
description?: string | undefined;
|
|
369
|
+
}>, z.ZodObject<{
|
|
370
|
+
control: z.ZodLiteral<"action">;
|
|
371
|
+
type: z.ZodLiteral<"action">;
|
|
372
|
+
label: z.ZodOptional<z.ZodString>;
|
|
373
|
+
description: z.ZodOptional<z.ZodString>;
|
|
374
|
+
required: z.ZodBoolean;
|
|
375
|
+
}, "strip", z.ZodTypeAny, {
|
|
376
|
+
type: "action";
|
|
377
|
+
required: boolean;
|
|
378
|
+
control: "action";
|
|
379
|
+
label?: string | undefined;
|
|
380
|
+
description?: string | undefined;
|
|
381
|
+
}, {
|
|
382
|
+
type: "action";
|
|
383
|
+
required: boolean;
|
|
384
|
+
control: "action";
|
|
385
|
+
label?: string | undefined;
|
|
386
|
+
description?: string | undefined;
|
|
369
387
|
}>]>>;
|
|
370
388
|
initialProps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
371
389
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -490,6 +508,12 @@ declare const WsComponentPropsMeta: z.ZodObject<{
|
|
|
490
508
|
defaultValue?: string | undefined;
|
|
491
509
|
label?: string | undefined;
|
|
492
510
|
description?: string | undefined;
|
|
511
|
+
} | {
|
|
512
|
+
type: "action";
|
|
513
|
+
required: boolean;
|
|
514
|
+
control: "action";
|
|
515
|
+
label?: string | undefined;
|
|
516
|
+
description?: string | undefined;
|
|
493
517
|
}>;
|
|
494
518
|
initialProps?: string[] | undefined;
|
|
495
519
|
}, {
|
|
@@ -614,6 +638,12 @@ declare const WsComponentPropsMeta: z.ZodObject<{
|
|
|
614
638
|
defaultValue?: string | undefined;
|
|
615
639
|
label?: string | undefined;
|
|
616
640
|
description?: string | undefined;
|
|
641
|
+
} | {
|
|
642
|
+
type: "action";
|
|
643
|
+
required: boolean;
|
|
644
|
+
control: "action";
|
|
645
|
+
label?: string | undefined;
|
|
646
|
+
description?: string | undefined;
|
|
617
647
|
}>;
|
|
618
648
|
initialProps?: string[] | undefined;
|
|
619
649
|
}>;
|
package/lib/types/context.d.ts
CHANGED
|
@@ -29,10 +29,13 @@ export type Params = {
|
|
|
29
29
|
*/
|
|
30
30
|
assetBaseUrl: string;
|
|
31
31
|
};
|
|
32
|
+
export type DataSourceValues = Map<DataSource["id"], unknown>;
|
|
32
33
|
export declare const ReactSdkContext: import("react").Context<Params & {
|
|
33
34
|
propsByInstanceIdStore: ReadableAtom<PropsByInstanceId>;
|
|
34
35
|
assetsStore: ReadableAtom<Assets>;
|
|
35
36
|
pagesStore: ReadableAtom<Pages>;
|
|
36
|
-
dataSourceValuesStore: ReadableAtom<
|
|
37
|
-
|
|
37
|
+
dataSourceValuesStore: ReadableAtom<DataSourceValues>;
|
|
38
|
+
executeEffectfulExpression: (expression: string, values: DataSourceValues) => DataSourceValues;
|
|
39
|
+
setDataSourceValues: (newValues: DataSourceValues) => void;
|
|
40
|
+
setBoundDataSourceValue: (instanceId: Instance["id"], prop: Prop["name"], value: unknown) => void;
|
|
38
41
|
}>;
|