@webstudio-is/sdk-components-react 0.85.0 → 0.87.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/html-embed.js +1 -1
- package/lib/cjs/html-embed.ws.js +4 -0
- package/lib/html-embed.js +1 -1
- package/lib/html-embed.ws.js +4 -0
- package/package.json +8 -8
- package/src/html-embed.tsx +4 -1
- package/src/html-embed.ws.ts +5 -0
package/lib/cjs/html-embed.js
CHANGED
|
@@ -72,7 +72,7 @@ const HtmlEmbed = (0, import_react.forwardRef)((props, ref) => {
|
|
|
72
72
|
if (code === void 0 || code.trim().length === 0) {
|
|
73
73
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Placeholder, { innerRef: ref, ...rest });
|
|
74
74
|
}
|
|
75
|
-
if (renderer === "canvas" && executeScriptOnCanvas === true) {
|
|
75
|
+
if (renderer === "canvas" && executeScriptOnCanvas === true || renderer === "preview") {
|
|
76
76
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ExecutableHtml, { innerRef: ref, code, ...rest });
|
|
77
77
|
}
|
|
78
78
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InnerHtml, { innerRef: ref, code, ...rest });
|
package/lib/cjs/html-embed.ws.js
CHANGED
package/lib/html-embed.js
CHANGED
|
@@ -54,7 +54,7 @@ const HtmlEmbed = forwardRef((props, ref) => {
|
|
|
54
54
|
if (code === void 0 || code.trim().length === 0) {
|
|
55
55
|
return /* @__PURE__ */ jsx(Placeholder, { innerRef: ref, ...rest });
|
|
56
56
|
}
|
|
57
|
-
if (renderer === "canvas" && executeScriptOnCanvas === true) {
|
|
57
|
+
if (renderer === "canvas" && executeScriptOnCanvas === true || renderer === "preview") {
|
|
58
58
|
return /* @__PURE__ */ jsx(ExecutableHtml, { innerRef: ref, code, ...rest });
|
|
59
59
|
}
|
|
60
60
|
return /* @__PURE__ */ jsx(InnerHtml, { innerRef: ref, code, ...rest });
|
package/lib/html-embed.ws.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/sdk-components-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.87.0",
|
|
4
4
|
"description": "Webstudio default library for react",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -37,18 +37,18 @@
|
|
|
37
37
|
"react-dom": "^18.2.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@react-aria/utils": "^3.
|
|
40
|
+
"@react-aria/utils": "^3.19.0",
|
|
41
41
|
"colord": "^2.9.3",
|
|
42
42
|
"shallow-equal": "^3.1.0",
|
|
43
|
-
"@webstudio-is/css-vars": "^0.
|
|
44
|
-
"@webstudio-is/generate-arg-types": "^0.
|
|
45
|
-
"@webstudio-is/icons": "^0.
|
|
46
|
-
"@webstudio-is/image": "^0.
|
|
47
|
-
"@webstudio-is/react-sdk": "^0.
|
|
43
|
+
"@webstudio-is/css-vars": "^0.87.0",
|
|
44
|
+
"@webstudio-is/generate-arg-types": "^0.87.0",
|
|
45
|
+
"@webstudio-is/icons": "^0.87.0",
|
|
46
|
+
"@webstudio-is/image": "^0.87.0",
|
|
47
|
+
"@webstudio-is/react-sdk": "^0.87.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@storybook/react": "^7.2.1",
|
|
51
|
-
"@types/react": "^18.2.
|
|
51
|
+
"@types/react": "^18.2.20",
|
|
52
52
|
"@types/react-dom": "^18.2.7",
|
|
53
53
|
"react": "^18.2.0",
|
|
54
54
|
"react-dom": "^18.2.0",
|
package/src/html-embed.tsx
CHANGED
|
@@ -86,7 +86,10 @@ export const HtmlEmbed = forwardRef<HTMLDivElement, Props>((props, ref) => {
|
|
|
86
86
|
return <Placeholder innerRef={ref} {...rest} />;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
if (
|
|
89
|
+
if (
|
|
90
|
+
(renderer === "canvas" && executeScriptOnCanvas === true) ||
|
|
91
|
+
renderer === "preview"
|
|
92
|
+
) {
|
|
90
93
|
return <ExecutableHtml innerRef={ref} code={code} {...rest} />;
|
|
91
94
|
}
|
|
92
95
|
|
package/src/html-embed.ws.ts
CHANGED
|
@@ -17,6 +17,11 @@ export const meta: WsComponentMeta = {
|
|
|
17
17
|
export const propsMeta: WsComponentPropsMeta = {
|
|
18
18
|
props: {
|
|
19
19
|
...props,
|
|
20
|
+
|
|
21
|
+
executeScriptOnCanvas: {
|
|
22
|
+
...props.executeScriptOnCanvas,
|
|
23
|
+
label: "Run script on canvas",
|
|
24
|
+
},
|
|
20
25
|
code: {
|
|
21
26
|
required: true,
|
|
22
27
|
control: "code",
|