@webstudio-is/react-sdk 0.56.0 → 0.58.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/app/custom-components/image.js +6 -6
- package/lib/app/custom-components/shared/remix-link.js +7 -3
- package/lib/app/params.js +4 -2
- package/lib/cjs/app/custom-components/image.js +6 -6
- package/lib/cjs/app/custom-components/shared/remix-link.js +7 -3
- package/lib/cjs/app/params.js +4 -2
- package/lib/cjs/components/link.js +17 -8
- package/lib/cjs/css/css.js +8 -5
- package/lib/cjs/css/global-rules.js +3 -3
- package/lib/cjs/css/style-rules.js +10 -3
- package/lib/cjs/props.js +35 -12
- package/lib/cjs/pubsub/raf-queue.js +3 -6
- package/lib/cjs/tree/root.js +1 -1
- package/lib/components/link.js +17 -8
- package/lib/css/css.js +8 -5
- package/lib/css/global-rules.js +4 -7
- package/lib/css/style-rules.js +10 -3
- package/lib/props.js +35 -12
- package/lib/pubsub/raf-queue.js +3 -6
- package/lib/tree/root.js +1 -1
- package/lib/types/app/custom-components/image.d.ts +2 -2
- package/lib/types/app/custom-components/index.d.ts +8 -8
- package/lib/types/app/custom-components/link-block.d.ts +2 -2
- package/lib/types/app/custom-components/link.d.ts +2 -2
- package/lib/types/app/custom-components/rich-text-link.d.ts +2 -2
- package/lib/types/app/custom-components/shared/remix-link.d.ts +3 -3
- package/lib/types/app/params.d.ts +2 -2
- package/lib/types/components/blockquote.d.ts +1 -1
- package/lib/types/components/blockquote.stories.d.ts +2 -2
- package/lib/types/components/body.d.ts +1 -1
- package/lib/types/components/body.stories.d.ts +1 -1
- package/lib/types/components/bold.d.ts +1 -1
- package/lib/types/components/bold.stories.d.ts +2 -2
- package/lib/types/components/box.d.ts +1 -1
- package/lib/types/components/box.stories.d.ts +4 -4
- package/lib/types/components/button.d.ts +1 -1
- package/lib/types/components/button.stories.d.ts +4 -4
- package/lib/types/components/code.d.ts +1 -1
- package/lib/types/components/code.stories.d.ts +4 -4
- package/lib/types/components/components-utils.d.ts +7 -7
- package/lib/types/components/form.d.ts +1 -1
- package/lib/types/components/form.stories.d.ts +2 -2
- package/lib/types/components/heading.d.ts +1 -1
- package/lib/types/components/heading.stories.d.ts +4 -4
- package/lib/types/components/image.d.ts +1 -1
- package/lib/types/components/image.stories.d.ts +2 -2
- package/lib/types/components/input.d.ts +1 -1
- package/lib/types/components/input.stories.d.ts +2 -2
- package/lib/types/components/italic.d.ts +1 -1
- package/lib/types/components/italic.stories.d.ts +2 -2
- package/lib/types/components/link-block.stories.d.ts +4 -4
- package/lib/types/components/link.d.ts +1 -1
- package/lib/types/components/link.stories.d.ts +4 -4
- package/lib/types/components/list-item.d.ts +1 -1
- package/lib/types/components/list-item.stories.d.ts +2 -2
- package/lib/types/components/list.d.ts +1 -1
- package/lib/types/components/list.stories.d.ts +4 -4
- package/lib/types/components/paragraph.d.ts +1 -1
- package/lib/types/components/paragraph.stories.d.ts +2 -2
- package/lib/types/components/rich-text-link.stories.d.ts +4 -4
- package/lib/types/components/separator.d.ts +1 -1
- package/lib/types/components/separator.stories.d.ts +2 -2
- package/lib/types/components/span.d.ts +1 -1
- package/lib/types/components/span.stories.d.ts +2 -2
- package/lib/types/components/subscript.d.ts +1 -1
- package/lib/types/components/subscript.stories.d.ts +2 -2
- package/lib/types/components/superscript.d.ts +1 -1
- package/lib/types/components/superscript.stories.d.ts +2 -2
- package/lib/types/components/text-block.d.ts +1 -1
- package/lib/types/components/text-block.stories.d.ts +2 -2
- package/lib/types/css/css.d.ts +1 -3
- package/lib/types/css/global-rules.d.ts +2 -3
- package/lib/types/css/style-rules.d.ts +1 -0
- package/lib/types/props.d.ts +73 -12
- package/lib/types/tree/webstudio-component.d.ts +2 -2
- package/package.json +21 -21
- package/src/app/custom-components/image.tsx +6 -7
- package/src/app/custom-components/shared/remix-link.tsx +7 -3
- package/src/app/params.ts +6 -4
- package/src/components/link.tsx +21 -7
- package/src/css/css.ts +9 -7
- package/src/css/global-rules.ts +6 -10
- package/src/css/style-rules.test.ts +22 -0
- package/src/css/style-rules.ts +15 -4
- package/src/props.test.ts +85 -20
- package/src/props.ts +57 -15
- package/src/pubsub/raf-queue.ts +3 -9
- package/src/tree/create-elements-tree.tsx +3 -7
- package/src/tree/root.ts +1 -1
- package/src/tree/webstudio-component.tsx +2 -2
|
@@ -2,11 +2,7 @@ import { type ComponentProps, Fragment } from "react";
|
|
|
2
2
|
import type { ReadableAtom } from "nanostores";
|
|
3
3
|
import { Scripts, ScrollRestoration } from "@remix-run/react";
|
|
4
4
|
import type { Assets } from "@webstudio-is/asset-uploader";
|
|
5
|
-
import type {
|
|
6
|
-
Instance,
|
|
7
|
-
Instances,
|
|
8
|
-
InstancesItem,
|
|
9
|
-
} from "@webstudio-is/project-build";
|
|
5
|
+
import type { Instance, Instances } from "@webstudio-is/project-build";
|
|
10
6
|
import type { GetComponent } from "../components/components-utils";
|
|
11
7
|
import { ReactSdkContext } from "../context";
|
|
12
8
|
import type { Pages, PropsByInstanceId } from "../props";
|
|
@@ -79,7 +75,7 @@ const createInstanceChildrenElements = ({
|
|
|
79
75
|
}: {
|
|
80
76
|
instances: Instances;
|
|
81
77
|
instanceSelector: InstanceSelector;
|
|
82
|
-
children:
|
|
78
|
+
children: Instance["children"];
|
|
83
79
|
Component: (props: ComponentProps<typeof WebstudioComponent>) => JSX.Element;
|
|
84
80
|
getComponent: GetComponent;
|
|
85
81
|
}) => {
|
|
@@ -120,7 +116,7 @@ const createInstanceElement = ({
|
|
|
120
116
|
children = [],
|
|
121
117
|
getComponent,
|
|
122
118
|
}: {
|
|
123
|
-
instance:
|
|
119
|
+
instance: Instance;
|
|
124
120
|
instanceSelector: InstanceSelector;
|
|
125
121
|
Component: (props: ComponentProps<typeof WebstudioComponent>) => JSX.Element;
|
|
126
122
|
children?: Array<JSX.Element | string>;
|
package/src/tree/root.ts
CHANGED
|
@@ -35,7 +35,7 @@ export const InstanceRoot = ({
|
|
|
35
35
|
customComponents = defaultCustomComponents,
|
|
36
36
|
getComponent,
|
|
37
37
|
}: RootProps): JSX.Element | null => {
|
|
38
|
-
setParams(data.params
|
|
38
|
+
setParams(data.params);
|
|
39
39
|
registerComponents(customComponents);
|
|
40
40
|
return createElementsTree({
|
|
41
41
|
instances: new Map(data.build.instances),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment } from "react";
|
|
2
|
-
import type { Instance
|
|
2
|
+
import type { Instance } from "@webstudio-is/project-build";
|
|
3
3
|
import type { GetComponent } from "../components/components-utils";
|
|
4
4
|
import { useInstanceProps } from "../props";
|
|
5
5
|
|
|
@@ -27,7 +27,7 @@ export const renderWebstudioComponentChildren = (
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
type WebstudioComponentProps = {
|
|
30
|
-
instance:
|
|
30
|
+
instance: Instance;
|
|
31
31
|
instanceSelector: Instance["id"][];
|
|
32
32
|
children: Array<JSX.Element | string>;
|
|
33
33
|
getComponent: GetComponent;
|