@webstudio-is/react-sdk 0.71.0 → 0.72.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/components/component-meta.js +2 -1
- package/lib/cjs/embed-template.js +1 -0
- package/lib/components/component-meta.js +2 -1
- package/lib/embed-template.js +1 -0
- package/lib/types/components/component-meta.d.ts +4 -4
- package/lib/types/context.d.ts +1 -1
- package/lib/types/tree/create-elements-tree.d.ts +1 -1
- package/package.json +8 -8
- package/src/components/component-meta.ts +1 -0
- package/src/context.tsx +1 -1
- package/src/embed-template.ts +1 -0
- package/src/tree/create-elements-tree.tsx +1 -1
|
@@ -54,6 +54,7 @@ const EmbedTemplateProp = import_zod.z.union([
|
|
|
54
54
|
})
|
|
55
55
|
]);
|
|
56
56
|
const EmbedTemplateStyleDeclRaw = import_zod.z.object({
|
|
57
|
+
// State selector, e.g. :hover
|
|
57
58
|
state: import_zod.z.optional(import_zod.z.string()),
|
|
58
59
|
property: import_zod.z.string(),
|
|
59
60
|
value: import_css_data.StyleValue
|
package/lib/embed-template.js
CHANGED
|
@@ -618,7 +618,7 @@ declare const WsComponentPropsMeta: z.ZodObject<{
|
|
|
618
618
|
initialProps?: string[] | undefined;
|
|
619
619
|
}>;
|
|
620
620
|
export type WsComponentPropsMeta = z.infer<typeof WsComponentPropsMeta>;
|
|
621
|
-
export declare const componentCategories: readonly ["general", "text", "media", "forms"];
|
|
621
|
+
export declare const componentCategories: readonly ["general", "text", "media", "forms", "hidden"];
|
|
622
622
|
export declare const stateCategories: readonly ["states", "component-states"];
|
|
623
623
|
export declare const ComponentState: z.ZodObject<{
|
|
624
624
|
category: z.ZodOptional<z.ZodEnum<["states", "component-states"]>>;
|
|
@@ -636,7 +636,7 @@ export declare const ComponentState: z.ZodObject<{
|
|
|
636
636
|
export type ComponentState = z.infer<typeof ComponentState>;
|
|
637
637
|
export declare const defaultStates: ComponentState[];
|
|
638
638
|
declare const WsComponentMeta: z.ZodObject<{
|
|
639
|
-
category: z.ZodOptional<z.ZodEnum<["general", "text", "media", "forms"]>>;
|
|
639
|
+
category: z.ZodOptional<z.ZodEnum<["general", "text", "media", "forms", "hidden"]>>;
|
|
640
640
|
type: z.ZodEnum<["container", "control", "embed", "rich-text", "rich-text-child"]>;
|
|
641
641
|
requiredAncestors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
642
642
|
invalidAncestors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -1040,7 +1040,7 @@ declare const WsComponentMeta: z.ZodObject<{
|
|
|
1040
1040
|
type: "embed" | "control" | "container" | "rich-text" | "rich-text-child";
|
|
1041
1041
|
label: string;
|
|
1042
1042
|
icon: string;
|
|
1043
|
-
category?: "text" | "media" | "general" | "forms" | undefined;
|
|
1043
|
+
category?: "text" | "hidden" | "media" | "general" | "forms" | undefined;
|
|
1044
1044
|
requiredAncestors?: string[] | undefined;
|
|
1045
1045
|
invalidAncestors?: string[] | undefined;
|
|
1046
1046
|
stylable?: boolean | undefined;
|
|
@@ -1243,7 +1243,7 @@ declare const WsComponentMeta: z.ZodObject<{
|
|
|
1243
1243
|
type: "embed" | "control" | "container" | "rich-text" | "rich-text-child";
|
|
1244
1244
|
label: string;
|
|
1245
1245
|
icon: string;
|
|
1246
|
-
category?: "text" | "media" | "general" | "forms" | undefined;
|
|
1246
|
+
category?: "text" | "hidden" | "media" | "general" | "forms" | undefined;
|
|
1247
1247
|
requiredAncestors?: string[] | undefined;
|
|
1248
1248
|
invalidAncestors?: string[] | undefined;
|
|
1249
1249
|
stylable?: boolean | undefined;
|
package/lib/types/context.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { type ReadableAtom } from "nanostores";
|
|
|
3
3
|
import type { Assets } from "@webstudio-is/asset-uploader";
|
|
4
4
|
import type { Pages, PropsByInstanceId } from "./props";
|
|
5
5
|
export declare const ReactSdkContext: import("react").Context<{
|
|
6
|
-
renderer?: "canvas" | undefined;
|
|
6
|
+
renderer?: "canvas" | "preview" | undefined;
|
|
7
7
|
propsByInstanceIdStore: ReadableAtom<PropsByInstanceId>;
|
|
8
8
|
assetsStore: ReadableAtom<Assets>;
|
|
9
9
|
pagesStore: ReadableAtom<Pages>;
|
|
@@ -6,7 +6,7 @@ import type { Components } from "../components/components-utils";
|
|
|
6
6
|
import type { Pages, PropsByInstanceId } from "../props";
|
|
7
7
|
import type { WebstudioComponent } from "./webstudio-component";
|
|
8
8
|
export declare const createElementsTree: ({ renderer, instances, rootInstanceId, propsByInstanceIdStore, assetsStore, pagesStore, Component, components, }: {
|
|
9
|
-
renderer?: "canvas" | undefined;
|
|
9
|
+
renderer?: "canvas" | "preview" | undefined;
|
|
10
10
|
instances: Map<string, {
|
|
11
11
|
type: "instance";
|
|
12
12
|
id: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/react-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.72.0",
|
|
4
4
|
"description": "Webstudio JavaScript / TypeScript API",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"jest": "^29.3.1",
|
|
14
14
|
"react": "^18.2.0",
|
|
15
15
|
"react-dom": "^18.2.0",
|
|
16
|
-
"typescript": "5.0.3",
|
|
17
16
|
"type-fest": "^3.7.1",
|
|
17
|
+
"typescript": "5.0.3",
|
|
18
18
|
"zod": "^3.21.4",
|
|
19
19
|
"@webstudio-is/jest-config": "^1.0.6",
|
|
20
20
|
"@webstudio-is/scripts": "^0.0.0",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"nanoevents": "^7.0.1",
|
|
34
34
|
"nanoid": "^3.2.0",
|
|
35
35
|
"nanostores": "^0.7.1",
|
|
36
|
-
"@webstudio-is/asset-uploader": "^0.
|
|
37
|
-
"@webstudio-is/css-data": "^0.
|
|
38
|
-
"@webstudio-is/css-engine": "^0.
|
|
39
|
-
"@webstudio-is/fonts": "^0.
|
|
40
|
-
"@webstudio-is/generate-arg-types": "^0.
|
|
41
|
-
"@webstudio-is/project-build": "^0.
|
|
36
|
+
"@webstudio-is/asset-uploader": "^0.72.0",
|
|
37
|
+
"@webstudio-is/css-data": "^0.72.0",
|
|
38
|
+
"@webstudio-is/css-engine": "^0.72.0",
|
|
39
|
+
"@webstudio-is/fonts": "^0.72.0",
|
|
40
|
+
"@webstudio-is/generate-arg-types": "^0.72.0",
|
|
41
|
+
"@webstudio-is/project-build": "^0.72.0"
|
|
42
42
|
},
|
|
43
43
|
"exports": {
|
|
44
44
|
".": {
|
package/src/context.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import type { Assets } from "@webstudio-is/asset-uploader";
|
|
|
4
4
|
import type { Pages, PropsByInstanceId } from "./props";
|
|
5
5
|
|
|
6
6
|
export const ReactSdkContext = createContext<{
|
|
7
|
-
renderer?: "canvas";
|
|
7
|
+
renderer?: "canvas" | "preview";
|
|
8
8
|
propsByInstanceIdStore: ReadableAtom<PropsByInstanceId>;
|
|
9
9
|
assetsStore: ReadableAtom<Assets>;
|
|
10
10
|
pagesStore: ReadableAtom<Pages>;
|
package/src/embed-template.ts
CHANGED
|
@@ -45,6 +45,7 @@ const EmbedTemplateProp = z.union([
|
|
|
45
45
|
type EmbedTemplateProp = z.infer<typeof EmbedTemplateProp>;
|
|
46
46
|
|
|
47
47
|
const EmbedTemplateStyleDeclRaw = z.object({
|
|
48
|
+
// State selector, e.g. :hover
|
|
48
49
|
state: z.optional(z.string()),
|
|
49
50
|
property: z.string(),
|
|
50
51
|
value: StyleValue,
|