@webstudio-is/sdk-components-react 0.191.4 → 0.192.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/__generated__/blockquote.props.js +514 -0
- package/lib/__generated__/body.props.js +508 -0
- package/lib/__generated__/bold.props.js +508 -0
- package/lib/__generated__/box.props.js +527 -0
- package/lib/__generated__/button.props.js +570 -0
- package/lib/__generated__/checkbox.props.js +672 -0
- package/lib/__generated__/code-text.props.js +509 -0
- package/lib/__generated__/form.props.js +556 -0
- package/lib/__generated__/heading.props.js +516 -0
- package/lib/__generated__/html-embed.props.js +13 -0
- package/lib/__generated__/image.props.js +592 -0
- package/lib/__generated__/input.props.js +696 -0
- package/lib/__generated__/italic.props.js +508 -0
- package/lib/__generated__/label.props.js +520 -0
- package/lib/__generated__/link.props.js +568 -0
- package/lib/__generated__/list-item.props.js +514 -0
- package/lib/__generated__/list.props.js +534 -0
- package/lib/__generated__/markdown-embed.props.js +7 -0
- package/lib/__generated__/option.props.js +532 -0
- package/lib/__generated__/paragraph.props.js +508 -0
- package/lib/__generated__/radio-button.props.js +672 -0
- package/lib/__generated__/select.props.js +556 -0
- package/lib/__generated__/separator.props.js +508 -0
- package/lib/__generated__/span.props.js +508 -0
- package/lib/__generated__/subscript.props.js +508 -0
- package/lib/__generated__/superscript.props.js +508 -0
- package/lib/__generated__/text.props.js +516 -0
- package/lib/__generated__/textarea.props.js +587 -0
- package/lib/__generated__/time.props.js +312 -0
- package/lib/__generated__/vimeo-play-button.props.js +569 -0
- package/lib/__generated__/vimeo-preview-image.props.js +586 -0
- package/lib/__generated__/vimeo-spinner.props.js +508 -0
- package/lib/__generated__/vimeo.props.js +674 -0
- package/lib/__generated__/xml-node.props.js +7 -0
- package/lib/__generated__/xml-time.props.js +18 -0
- package/lib/blockquote.js +9 -0
- package/lib/blockquote.ws.js +79 -0
- package/lib/body.js +7 -0
- package/lib/body.ws.js +30 -0
- package/lib/bold.js +7 -0
- package/lib/bold.ws.js +20 -0
- package/lib/box.js +9 -0
- package/lib/box.ws.js +31 -0
- package/lib/button.js +9 -0
- package/lib/button.ws.js +43 -0
- package/lib/checkbox.js +15 -0
- package/lib/checkbox.ws.js +58 -0
- package/lib/code-text.js +10 -0
- package/lib/code-text.ws.js +59 -0
- package/lib/components.js +79 -0
- package/lib/content-embed.ws.js +77 -0
- package/lib/form.js +7 -0
- package/lib/form.ws.js +30 -0
- package/lib/fragment.js +7 -0
- package/lib/fragment.ws.js +11 -0
- package/lib/heading.js +9 -0
- package/lib/heading.ws.js +44 -0
- package/lib/home_wsKvRSqvkajPPBeycZ-C8.svg +3 -0
- package/lib/hooks.js +5 -0
- package/lib/html-embed-patchers.js +29 -0
- package/lib/html-embed.js +112 -0
- package/lib/html-embed.ws.js +46 -0
- package/lib/image.js +40 -0
- package/lib/image.ws.js +65 -0
- package/lib/input.js +17 -0
- package/lib/input.ws.js +54 -0
- package/lib/italic.js +7 -0
- package/lib/italic.ws.js +26 -0
- package/lib/label.js +7 -0
- package/lib/label.ws.js +42 -0
- package/lib/link.js +15 -0
- package/lib/link.ws.js +67 -0
- package/lib/list-item.js +9 -0
- package/lib/list-item.ws.js +39 -0
- package/lib/list.js +6 -0
- package/lib/list.ws.js +92 -0
- package/lib/markdown-embed.js +14 -0
- package/lib/markdown-embed.ws.js +111 -0
- package/lib/metas.js +81 -0
- package/lib/option.js +7 -0
- package/lib/option.ws.js +45 -0
- package/lib/paragraph.js +7 -0
- package/lib/paragraph.ws.js +39 -0
- package/lib/props.js +79 -0
- package/lib/radio-button.js +15 -0
- package/lib/radio-button.ws.js +60 -0
- package/lib/rich-text-link.js +8 -0
- package/lib/rich-text-link.ws.js +11 -0
- package/lib/select.js +19 -0
- package/lib/select.ws.js +96 -0
- package/lib/separator.js +9 -0
- package/lib/separator.ws.js +48 -0
- package/lib/slot.js +14 -0
- package/lib/slot.ws.js +15 -0
- package/lib/span.js +7 -0
- package/lib/span.ws.js +20 -0
- package/lib/subscript.js +7 -0
- package/lib/subscript.ws.js +20 -0
- package/lib/superscript.js +7 -0
- package/lib/superscript.ws.js +20 -0
- package/lib/text.js +10 -0
- package/lib/text.ws.js +41 -0
- package/lib/textarea.js +7 -0
- package/lib/textarea.ws.js +55 -0
- package/lib/time.js +319 -0
- package/lib/time.ws.js +22 -0
- package/lib/types/__generated__/blockquote.props.d.ts +2 -0
- package/lib/types/__generated__/body.props.d.ts +2 -0
- package/lib/types/__generated__/bold.props.d.ts +2 -0
- package/lib/types/__generated__/box.props.d.ts +2 -0
- package/lib/types/__generated__/button.props.d.ts +2 -0
- package/lib/types/__generated__/checkbox.props.d.ts +2 -0
- package/lib/types/__generated__/code-text.props.d.ts +2 -0
- package/lib/types/__generated__/form.props.d.ts +2 -0
- package/lib/types/__generated__/fragment.props.d.ts +2 -0
- package/lib/types/__generated__/heading.props.d.ts +2 -0
- package/lib/types/__generated__/html-embed.props.d.ts +2 -0
- package/lib/types/__generated__/image.props.d.ts +2 -0
- package/lib/types/__generated__/input.props.d.ts +2 -0
- package/lib/types/__generated__/italic.props.d.ts +2 -0
- package/lib/types/__generated__/label.props.d.ts +2 -0
- package/lib/types/__generated__/link.props.d.ts +2 -0
- package/lib/types/__generated__/list-item.props.d.ts +2 -0
- package/lib/types/__generated__/list.props.d.ts +2 -0
- package/lib/types/__generated__/local-date.props.d.ts +2 -0
- package/lib/types/__generated__/markdown-embed.props.d.ts +2 -0
- package/lib/types/__generated__/option.props.d.ts +2 -0
- package/lib/types/__generated__/paragraph.props.d.ts +2 -0
- package/lib/types/__generated__/radio-button.props.d.ts +2 -0
- package/lib/types/__generated__/rich-text-link.props.d.ts +2 -0
- package/lib/types/__generated__/select.props.d.ts +2 -0
- package/lib/types/__generated__/separator.props.d.ts +2 -0
- package/lib/types/__generated__/slot.props.d.ts +2 -0
- package/lib/types/__generated__/span.props.d.ts +2 -0
- package/lib/types/__generated__/subscript.props.d.ts +2 -0
- package/lib/types/__generated__/superscript.props.d.ts +2 -0
- package/lib/types/__generated__/text.props.d.ts +2 -0
- package/lib/types/__generated__/textarea.props.d.ts +2 -0
- package/lib/types/__generated__/time.props.d.ts +2 -0
- package/lib/types/__generated__/vimeo-play-button.props.d.ts +2 -0
- package/lib/types/__generated__/vimeo-preview-image.props.d.ts +2 -0
- package/lib/types/__generated__/vimeo-spinner.props.d.ts +2 -0
- package/lib/types/__generated__/vimeo.props.d.ts +2 -0
- package/lib/types/__generated__/xml-node.props.d.ts +2 -0
- package/lib/types/__generated__/xml-time.props.d.ts +2 -0
- package/lib/types/blockquote.d.ts +2 -0
- package/lib/types/blockquote.ws.d.ts +3 -0
- package/lib/types/body.d.ts +2 -0
- package/lib/types/body.ws.d.ts +3 -0
- package/lib/types/bold.d.ts +2 -0
- package/lib/types/bold.ws.d.ts +3 -0
- package/lib/types/box.d.ts +8 -0
- package/lib/types/box.ws.d.ts +3 -0
- package/lib/types/button.d.ts +2 -0
- package/lib/types/button.ws.d.ts +3 -0
- package/lib/types/checkbox.d.ts +4 -0
- package/lib/types/checkbox.ws.d.ts +3 -0
- package/lib/types/code-text.d.ts +4 -0
- package/lib/types/code-text.ws.d.ts +3 -0
- package/lib/types/components.d.ts +39 -0
- package/lib/types/content-embed.ws.d.ts +2 -0
- package/lib/types/form.d.ts +2 -0
- package/lib/types/form.ws.d.ts +3 -0
- package/lib/types/fragment.d.ts +6 -0
- package/lib/types/fragment.ws.d.ts +3 -0
- package/lib/types/heading.d.ts +8 -0
- package/lib/types/heading.ws.d.ts +3 -0
- package/lib/types/hooks.d.ts +2 -0
- package/lib/types/html-embed-patchers.d.ts +2 -0
- package/lib/types/html-embed.d.ts +12 -0
- package/lib/types/html-embed.test.d.ts +1 -0
- package/lib/types/html-embed.ws.d.ts +3 -0
- package/lib/types/image.d.ts +8 -0
- package/lib/types/image.ws.d.ts +11 -0
- package/lib/types/input.d.ts +4 -0
- package/lib/types/input.ws.d.ts +3 -0
- package/lib/types/italic.d.ts +2 -0
- package/lib/types/italic.ws.d.ts +3 -0
- package/lib/types/label.d.ts +2 -0
- package/lib/types/label.ws.d.ts +3 -0
- package/lib/types/link.d.ts +7 -0
- package/lib/types/link.ws.d.ts +3 -0
- package/lib/types/list-item.d.ts +2 -0
- package/lib/types/list-item.ws.d.ts +3 -0
- package/lib/types/list.d.ts +10 -0
- package/lib/types/list.ws.d.ts +3 -0
- package/lib/types/markdown-embed.d.ts +7 -0
- package/lib/types/markdown-embed.ws.d.ts +3 -0
- package/lib/types/metas.d.ts +40 -0
- package/lib/types/option.d.ts +2 -0
- package/lib/types/option.ws.d.ts +3 -0
- package/lib/types/paragraph.d.ts +2 -0
- package/lib/types/paragraph.ws.d.ts +3 -0
- package/lib/types/props.d.ts +39 -0
- package/lib/types/radio-button.d.ts +4 -0
- package/lib/types/radio-button.ws.d.ts +3 -0
- package/lib/types/rich-text-link.d.ts +2 -0
- package/lib/types/rich-text-link.ws.d.ts +3 -0
- package/lib/types/select.d.ts +4 -0
- package/lib/types/select.ws.d.ts +3 -0
- package/lib/types/separator.d.ts +2 -0
- package/lib/types/separator.ws.d.ts +3 -0
- package/lib/types/slot.d.ts +6 -0
- package/lib/types/slot.ws.d.ts +3 -0
- package/lib/types/span.d.ts +2 -0
- package/lib/types/span.ws.d.ts +3 -0
- package/lib/types/subscript.d.ts +2 -0
- package/lib/types/subscript.ws.d.ts +3 -0
- package/lib/types/superscript.d.ts +2 -0
- package/lib/types/superscript.ws.d.ts +3 -0
- package/lib/types/test-utils/cartesian.d.ts +2 -0
- package/lib/types/text.d.ts +8 -0
- package/lib/types/text.ws.d.ts +3 -0
- package/lib/types/textarea.d.ts +2 -0
- package/lib/types/textarea.ws.d.ts +3 -0
- package/lib/types/time.d.ts +18 -0
- package/lib/types/time.test.d.ts +1 -0
- package/lib/types/time.ws.d.ts +3 -0
- package/lib/types/vimeo-play-button.d.ts +3 -0
- package/lib/types/vimeo-play-button.ws.d.ts +3 -0
- package/lib/types/vimeo-preview-image.d.ts +284 -0
- package/lib/types/vimeo-preview-image.ws.d.ts +3 -0
- package/lib/types/vimeo-spinner.d.ts +1 -0
- package/lib/types/vimeo-spinner.ws.d.ts +3 -0
- package/lib/types/vimeo.d.ts +75 -0
- package/lib/types/vimeo.ws.d.ts +3 -0
- package/lib/types/xml-node.d.ts +13 -0
- package/lib/types/xml-node.ws.d.ts +3 -0
- package/lib/types/xml-time.d.ts +6 -0
- package/lib/types/xml-time.ws.d.ts +3 -0
- package/lib/vimeo-play-button.js +15 -0
- package/lib/vimeo-play-button.ws.js +31 -0
- package/lib/vimeo-preview-image.js +19 -0
- package/lib/vimeo-preview-image.ws.js +19 -0
- package/lib/vimeo-spinner.js +13 -0
- package/lib/vimeo-spinner.ws.js +25 -0
- package/lib/vimeo.js +215 -0
- package/lib/vimeo.ws.js +329 -0
- package/lib/xml-node.js +44 -0
- package/lib/xml-node.ws.js +18 -0
- package/lib/xml-time.js +25 -0
- package/lib/xml-time.ws.js +18 -0
- package/package.json +5 -5
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.6559 0.907089C7.88124 0.846075 8.11876 0.846075 8.34411 0.907089C8.60553 0.97787 8.82581 1.15075 9.00433 1.29086C9.02124 1.30414 9.03777 1.31712 9.05393 1.32968L13.5755 4.84644C13.5927 4.85983 13.6098 4.87308 13.6267 4.88623C13.8784 5.08159 14.0978 5.25187 14.2612 5.47281C14.4047 5.66677 14.5116 5.88528 14.5766 6.11759C14.6507 6.38223 14.6504 6.65995 14.65 6.9786C14.65 7.00004 14.65 7.02165 14.65 7.04347V11.8919C14.65 12.2438 14.65 12.5464 14.6297 12.7954C14.6082 13.0579 14.561 13.3177 14.4338 13.5672C14.2437 13.9404 13.9403 14.2438 13.5671 14.4339C13.3176 14.561 13.0579 14.6083 12.7953 14.6298C12.5463 14.6501 12.2437 14.6501 11.8918 14.6501H4.10816C3.75628 14.6501 3.4537 14.6501 3.20467 14.6298C2.94214 14.6083 2.68243 14.561 2.43292 14.4339C2.05973 14.2438 1.75632 13.9404 1.56617 13.5672C1.43904 13.3177 1.39178 13.0579 1.37033 12.7954C1.34998 12.5464 1.34999 12.2438 1.35 11.8919L1.35 7.04347C1.35 7.02165 1.34998 7.00003 1.34996 6.9786C1.34963 6.65995 1.34934 6.38222 1.42341 6.11759C1.48844 5.88527 1.59531 5.66677 1.73876 5.47281C1.90218 5.25187 2.12158 5.08159 2.3733 4.88623C2.39024 4.87308 2.40732 4.85983 2.42453 4.84644L6.94607 1.32968C6.96223 1.31711 6.97877 1.30414 6.99568 1.29086C7.1742 1.15075 7.39448 0.97787 7.6559 0.907089ZM6.65 13.3501H9.35V9.06675C9.35 8.86934 9.3495 8.76038 9.34308 8.68182C9.34236 8.67303 9.34162 8.66552 9.34091 8.65918C9.33457 8.65847 9.32706 8.65773 9.31827 8.65701C9.23971 8.65059 9.13075 8.65009 8.93334 8.65009H7.06667C6.86926 8.65009 6.76029 8.65059 6.68174 8.65701C6.67294 8.65773 6.66544 8.65847 6.6591 8.65918C6.65839 8.66552 6.65765 8.67303 6.65693 8.68182C6.65051 8.76038 6.65 8.86934 6.65 9.06675V13.3501ZM10.65 13.3501L10.65 9.04584C10.65 8.87727 10.65 8.71403 10.6388 8.57596C10.6264 8.42459 10.5973 8.24721 10.5065 8.069C10.3803 7.82125 10.1788 7.61983 9.93109 7.49359C9.75288 7.40279 9.5755 7.37369 9.42413 7.36133C9.28606 7.35005 9.12282 7.35007 8.95425 7.35008H7.04575C6.87718 7.35007 6.71395 7.35005 6.57587 7.36133C6.42451 7.37369 6.24712 7.40279 6.06892 7.49359C5.82117 7.61983 5.61974 7.82125 5.49351 8.069C5.40271 8.24721 5.37361 8.42459 5.36124 8.57596C5.34996 8.71403 5.34998 8.87727 5.35 9.04584L5.35 13.3501H4.13334C3.74924 13.3501 3.50026 13.3496 3.31054 13.3341C3.1284 13.3192 3.05881 13.2938 3.02311 13.2756C2.89453 13.2101 2.79 13.1056 2.72448 12.977C2.70629 12.9413 2.68089 12.8717 2.66601 12.6896C2.65051 12.4998 2.65 12.2508 2.65 11.8668V7.04347C2.65 6.62375 2.65565 6.53819 2.6753 6.46801C2.6977 6.38796 2.73452 6.31268 2.78395 6.24586C2.82729 6.18726 2.89135 6.13027 3.22266 5.87259L7.74419 2.35584C7.86861 2.25907 7.93516 2.20781 7.98588 2.17392C7.99132 2.17029 7.99601 2.16725 8 2.16473C8.00399 2.16725 8.00869 2.17029 8.01413 2.17392C8.06485 2.20781 8.13139 2.25907 8.25581 2.35584L12.7773 5.87259C13.1087 6.13027 13.1727 6.18726 13.2161 6.24586C13.2655 6.31268 13.3023 6.38796 13.3247 6.46801C13.3444 6.53819 13.35 6.62375 13.35 7.04347V11.8668C13.35 12.2508 13.3495 12.4998 13.334 12.6896C13.3191 12.8717 13.2937 12.9413 13.2755 12.977C13.21 13.1056 13.1055 13.2101 12.9769 13.2756C12.9412 13.2938 12.8716 13.3192 12.6895 13.3341C12.4997 13.3496 12.2508 13.3501 11.8667 13.3501H10.65Z" fill="#11181C"/>
|
|
3
|
+
</svg>
|
package/lib/hooks.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const l = () => document.readyState === "complete" || document.readyState === "interactive", t = [];
|
|
2
|
+
let s = !1;
|
|
3
|
+
const r = () => {
|
|
4
|
+
if (l() === !1) {
|
|
5
|
+
console.error("DOMContentLoaded event has not been fired yet");
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
if (s)
|
|
9
|
+
return;
|
|
10
|
+
s = !0;
|
|
11
|
+
const d = document.addEventListener, a = window.addEventListener, c = new Event("DOMContentLoaded"), i = new Event("load");
|
|
12
|
+
window.addEventListener = (e, n, o) => {
|
|
13
|
+
e === "DOMContentLoaded" ? t.push(
|
|
14
|
+
() => n.call(window, c)
|
|
15
|
+
) : (e === "load" && t.push(() => n.call(window, i)), a.call(window, e, n, o));
|
|
16
|
+
}, document.addEventListener = (e, n, o) => {
|
|
17
|
+
e === "DOMContentLoaded" ? t.push(
|
|
18
|
+
() => n.call(document, c)
|
|
19
|
+
) : d.call(document, e, n, o);
|
|
20
|
+
};
|
|
21
|
+
}, w = () => {
|
|
22
|
+
for (const d of t)
|
|
23
|
+
d();
|
|
24
|
+
t.length = 0;
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
w as executeDomEvents,
|
|
28
|
+
r as patchDomEvents
|
|
29
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as R, useContext as S, useState as b, useSyncExternalStore as x, useRef as f, useMemo as E, useEffect as k } from "react";
|
|
3
|
+
import { mergeRefs as T } from "@react-aria/utils";
|
|
4
|
+
import { ReactSdkContext as g } from "@webstudio-is/react-sdk/runtime";
|
|
5
|
+
import { patchDomEvents as L, executeDomEvents as _ } from "./html-embed-patchers.js";
|
|
6
|
+
const C = {
|
|
7
|
+
scriptTestIdPrefix: "client-"
|
|
8
|
+
}, w = (e) => new Promise((t, n) => {
|
|
9
|
+
const r = document.createElement("script"), s = e.hasAttribute("src"), a = e.type === "module";
|
|
10
|
+
for (const { name: c, value: o } of e.attributes)
|
|
11
|
+
r.setAttribute(c, o);
|
|
12
|
+
if (r.dataset.testid !== void 0 && (r.dataset.testid = `${C.scriptTestIdPrefix}${r.dataset.testid}`), s)
|
|
13
|
+
r.addEventListener("load", () => {
|
|
14
|
+
t();
|
|
15
|
+
}), r.addEventListener("error", n);
|
|
16
|
+
else {
|
|
17
|
+
if (a) {
|
|
18
|
+
const c = new Blob([e.innerText], {
|
|
19
|
+
type: "text/javascript"
|
|
20
|
+
}), o = URL.createObjectURL(c);
|
|
21
|
+
import(
|
|
22
|
+
/* @vite-ignore */
|
|
23
|
+
o
|
|
24
|
+
).then(t).catch(n).finally(() => {
|
|
25
|
+
URL.revokeObjectURL(o);
|
|
26
|
+
});
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
r.textContent = e.innerText;
|
|
30
|
+
}
|
|
31
|
+
e.replaceWith(r), s === !1 && t();
|
|
32
|
+
}), l = [];
|
|
33
|
+
let d = !1;
|
|
34
|
+
const O = async (e) => {
|
|
35
|
+
if (l.push(...e), await Promise.resolve(), !d) {
|
|
36
|
+
for (L(), d = !0; l.length > 0; )
|
|
37
|
+
await l.shift()();
|
|
38
|
+
_(), d = !1;
|
|
39
|
+
}
|
|
40
|
+
}, H = (e) => {
|
|
41
|
+
const t = e.querySelectorAll("script"), n = [], r = [];
|
|
42
|
+
t.forEach((s) => {
|
|
43
|
+
(s.hasAttribute("async") ? r : n).push(() => w(s));
|
|
44
|
+
});
|
|
45
|
+
for (const s of r)
|
|
46
|
+
s();
|
|
47
|
+
O(n);
|
|
48
|
+
}, I = (e) => {
|
|
49
|
+
const { code: t, innerRef: n, ...r } = e;
|
|
50
|
+
return /* @__PURE__ */ i("div", { ref: n, ...r, style: { display: "block", padding: 20 }, children: 'Open the "Settings" panel to insert HTML code.' });
|
|
51
|
+
}, h = () => x(
|
|
52
|
+
() => () => {
|
|
53
|
+
},
|
|
54
|
+
() => !1,
|
|
55
|
+
() => !0
|
|
56
|
+
), u = (e) => {
|
|
57
|
+
if (!h())
|
|
58
|
+
return e.children;
|
|
59
|
+
}, m = (e) => {
|
|
60
|
+
const { code: t, innerRef: n, ...r } = e, s = f(null), a = f(!0), c = E(
|
|
61
|
+
() => ({
|
|
62
|
+
__html: t ?? ""
|
|
63
|
+
}),
|
|
64
|
+
[t]
|
|
65
|
+
);
|
|
66
|
+
return k(() => {
|
|
67
|
+
const o = s.current;
|
|
68
|
+
o && a.current && (a.current = !1, H(o));
|
|
69
|
+
}, []), /* @__PURE__ */ i(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
...r,
|
|
73
|
+
ref: T(n, s),
|
|
74
|
+
dangerouslySetInnerHTML: c
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}, p = (e) => {
|
|
78
|
+
const { code: t, innerRef: n, ...r } = e;
|
|
79
|
+
return /* @__PURE__ */ i(
|
|
80
|
+
"div",
|
|
81
|
+
{
|
|
82
|
+
...r,
|
|
83
|
+
ref: n,
|
|
84
|
+
dangerouslySetInnerHTML: { __html: t ?? "" }
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
}, M = p, P = R(
|
|
88
|
+
(e, t) => {
|
|
89
|
+
const { code: n, executeScriptOnCanvas: r, clientOnly: s, children: a, ...c } = e, { renderer: o } = S(g), v = h(), [y] = b(v);
|
|
90
|
+
return n === void 0 || String(n).trim().length === 0 ? /* @__PURE__ */ i(I, { innerRef: t, ...c }) : y ? s !== !0 ? /* @__PURE__ */ i(p, { innerRef: t, code: n, ...c }) : /* @__PURE__ */ i(u, { children: /* @__PURE__ */ i(m, { innerRef: t, code: n, ...c }) }) : o === "canvas" && r !== !0 ? /* @__PURE__ */ i(u, { children: /* @__PURE__ */ i(
|
|
91
|
+
M,
|
|
92
|
+
{
|
|
93
|
+
innerRef: t,
|
|
94
|
+
code: n,
|
|
95
|
+
...c
|
|
96
|
+
}
|
|
97
|
+
) }) : /* @__PURE__ */ i(u, { children: /* @__PURE__ */ i(
|
|
98
|
+
m,
|
|
99
|
+
{
|
|
100
|
+
innerRef: t,
|
|
101
|
+
code: n,
|
|
102
|
+
...c
|
|
103
|
+
},
|
|
104
|
+
n
|
|
105
|
+
) });
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
P.displayName = "HtmlEmbed";
|
|
109
|
+
export {
|
|
110
|
+
P as HtmlEmbed,
|
|
111
|
+
C as __testing__
|
|
112
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { EmbedIcon as t } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { props as e } from "./__generated__/html-embed.props.js";
|
|
3
|
+
const i = {
|
|
4
|
+
div: [
|
|
5
|
+
{
|
|
6
|
+
property: "display",
|
|
7
|
+
value: { type: "keyword", value: "contents" }
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
property: "whiteSpaceCollapse",
|
|
11
|
+
value: { type: "keyword", value: "collapse" }
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}, a = {
|
|
15
|
+
category: "general",
|
|
16
|
+
type: "embed",
|
|
17
|
+
label: "HTML Embed",
|
|
18
|
+
description: "Used to add HTML code to the page, such as an SVG or script.",
|
|
19
|
+
icon: t,
|
|
20
|
+
presetStyle: i,
|
|
21
|
+
order: 8
|
|
22
|
+
}, r = {
|
|
23
|
+
props: {
|
|
24
|
+
...e,
|
|
25
|
+
clientOnly: {
|
|
26
|
+
...e.clientOnly,
|
|
27
|
+
description: "Activate it for any scripts that can mutate the DOM or introduce interactivity. This only affects the published site."
|
|
28
|
+
},
|
|
29
|
+
executeScriptOnCanvas: {
|
|
30
|
+
...e.executeScriptOnCanvas,
|
|
31
|
+
label: "Run scripts on canvas",
|
|
32
|
+
description: "Dangerously allow script execution on canvas without switching to preview mode. This only affects build mode, but may result in unwanted side effects inside builder!"
|
|
33
|
+
},
|
|
34
|
+
code: {
|
|
35
|
+
required: !0,
|
|
36
|
+
control: "code",
|
|
37
|
+
language: "html",
|
|
38
|
+
type: "string"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
initialProps: ["className", "clientOnly", "executeScriptOnCanvas"]
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
a as meta,
|
|
45
|
+
r as propsMeta
|
|
46
|
+
};
|
package/lib/image.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as v, useContext as x } from "react";
|
|
3
|
+
import { Image as y } from "@webstudio-is/image";
|
|
4
|
+
import { ReactSdkContext as I } from "@webstudio-is/react-sdk/runtime";
|
|
5
|
+
const p = v(
|
|
6
|
+
({
|
|
7
|
+
loading: s = "lazy",
|
|
8
|
+
width: r,
|
|
9
|
+
height: a,
|
|
10
|
+
optimize: o = !0,
|
|
11
|
+
decoding: d,
|
|
12
|
+
// @todo: it's a hack made for the builder and should't be in the runtime at all.
|
|
13
|
+
$webstudio$canvasOnly$assetId: f,
|
|
14
|
+
...t
|
|
15
|
+
}, l) => {
|
|
16
|
+
const e = String(t.src ?? ""), { imageLoader: N, renderer: g, assetBaseUrl: m } = x(I);
|
|
17
|
+
let c = d, n = e;
|
|
18
|
+
g === "canvas" && (s = "eager", c = "sync", n = f ?? e, r !== void 0 && a !== void 0 && Number.isNaN(r) && Number.isNaN(a) && (o = !1, r = void 0, a = void 0));
|
|
19
|
+
let i = e;
|
|
20
|
+
return e.startsWith(m) && (i = e.slice(m.length)), /* @__PURE__ */ u(
|
|
21
|
+
y,
|
|
22
|
+
{
|
|
23
|
+
loading: s,
|
|
24
|
+
decoding: c,
|
|
25
|
+
optimize: o,
|
|
26
|
+
width: r,
|
|
27
|
+
height: a,
|
|
28
|
+
...t,
|
|
29
|
+
loader: N,
|
|
30
|
+
src: i,
|
|
31
|
+
ref: l
|
|
32
|
+
},
|
|
33
|
+
n
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
p.displayName = "Image";
|
|
38
|
+
export {
|
|
39
|
+
p as Image
|
|
40
|
+
};
|
package/lib/image.ws.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ImageIcon as o } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { defaultStates as r } from "@webstudio-is/react-sdk";
|
|
3
|
+
import { img as i } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
+
import { props as e } from "./__generated__/image.props.js";
|
|
5
|
+
const a = {
|
|
6
|
+
img: [
|
|
7
|
+
...i,
|
|
8
|
+
// Otherwise on new image insert onto canvas it can overfit screen size multiple times
|
|
9
|
+
{
|
|
10
|
+
property: "maxWidth",
|
|
11
|
+
value: { type: "unit", unit: "%", value: 100 }
|
|
12
|
+
},
|
|
13
|
+
// inline | inline-block is not suitable because without line-height: 0 on the parent you get unsuitable spaces/margins
|
|
14
|
+
// see https://stackoverflow.com/questions/24771194/is-the-margin-of-inline-block-4px-is-static-for-all-browsers
|
|
15
|
+
{
|
|
16
|
+
property: "display",
|
|
17
|
+
value: { type: "keyword", value: "block" }
|
|
18
|
+
},
|
|
19
|
+
// Set image height to "auto" to reduce layout shift, improving compatibility across browsers like Safari.
|
|
20
|
+
// Unlike "fit-content," "auto" preserves the aspect ratio when the width exceeds max-width. (in Safari)
|
|
21
|
+
// See https://web.dev/articles/optimize-cls#best_practice_for_setting_image_dimensions
|
|
22
|
+
{
|
|
23
|
+
property: "height",
|
|
24
|
+
value: { type: "keyword", value: "auto" }
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}, l = {
|
|
28
|
+
category: "media",
|
|
29
|
+
type: "embed",
|
|
30
|
+
description: "Add an image asset to the page. Webstudio automatically converts images to WebP or AVIF format and makes them responsive for best performance.",
|
|
31
|
+
icon: o,
|
|
32
|
+
states: r,
|
|
33
|
+
presetStyle: a,
|
|
34
|
+
order: 0
|
|
35
|
+
}, p = {
|
|
36
|
+
src: {
|
|
37
|
+
type: "string",
|
|
38
|
+
control: "file",
|
|
39
|
+
label: "Source",
|
|
40
|
+
required: !1
|
|
41
|
+
}
|
|
42
|
+
}, t = e.optimize;
|
|
43
|
+
t.description = "Optimize the image for enhanced performance.";
|
|
44
|
+
const d = {
|
|
45
|
+
props: {
|
|
46
|
+
...e,
|
|
47
|
+
...p,
|
|
48
|
+
optimize: t
|
|
49
|
+
},
|
|
50
|
+
initialProps: [
|
|
51
|
+
"id",
|
|
52
|
+
"className",
|
|
53
|
+
"src",
|
|
54
|
+
"width",
|
|
55
|
+
"height",
|
|
56
|
+
"alt",
|
|
57
|
+
"loading",
|
|
58
|
+
"optimize"
|
|
59
|
+
]
|
|
60
|
+
};
|
|
61
|
+
export {
|
|
62
|
+
l as meta,
|
|
63
|
+
d as propsMeta,
|
|
64
|
+
p as propsOverrides
|
|
65
|
+
};
|
package/lib/input.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as n } from "react";
|
|
3
|
+
const a = n(
|
|
4
|
+
({ children: d, type: t = "text", value: r, defaultValue: e, ...o }, p) => /* @__PURE__ */ i(
|
|
5
|
+
"input",
|
|
6
|
+
{
|
|
7
|
+
...o,
|
|
8
|
+
defaultValue: r ?? e,
|
|
9
|
+
type: t,
|
|
10
|
+
ref: p
|
|
11
|
+
}
|
|
12
|
+
)
|
|
13
|
+
);
|
|
14
|
+
a.displayName = "Input";
|
|
15
|
+
export {
|
|
16
|
+
a as Input
|
|
17
|
+
};
|
package/lib/input.ws.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { FormTextFieldIcon as e } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { defaultStates as t } from "@webstudio-is/react-sdk";
|
|
3
|
+
import { input as o } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
+
import { props as l } from "./__generated__/input.props.js";
|
|
5
|
+
const r = {
|
|
6
|
+
input: [
|
|
7
|
+
...o,
|
|
8
|
+
{
|
|
9
|
+
property: "display",
|
|
10
|
+
value: { type: "keyword", value: "block" }
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}, p = {
|
|
14
|
+
category: "forms",
|
|
15
|
+
constraints: {
|
|
16
|
+
relation: "ancestor",
|
|
17
|
+
component: { $nin: ["Button", "Link"] }
|
|
18
|
+
},
|
|
19
|
+
type: "control",
|
|
20
|
+
label: "Text Input",
|
|
21
|
+
description: "A single-line text input for collecting string data from your users.",
|
|
22
|
+
icon: e,
|
|
23
|
+
presetStyle: r,
|
|
24
|
+
order: 3,
|
|
25
|
+
states: [
|
|
26
|
+
...t,
|
|
27
|
+
{ selector: "::placeholder", label: "Placeholder" },
|
|
28
|
+
{ selector: ":valid", label: "Valid" },
|
|
29
|
+
{ selector: ":invalid", label: "Invalid" },
|
|
30
|
+
{ selector: ":required", label: "Required" },
|
|
31
|
+
{ selector: ":optional", label: "Optional" }
|
|
32
|
+
// Additional states will go into submenu
|
|
33
|
+
//{ selector: ":disabled", label: "Disabled" },
|
|
34
|
+
//{ selector: ":enabled", label: "Enabled" },
|
|
35
|
+
//{ selector: ":read-only", label: "Read Only" },
|
|
36
|
+
//{ selector: ":read-write", label: "Read Write" },
|
|
37
|
+
]
|
|
38
|
+
}, c = {
|
|
39
|
+
props: l,
|
|
40
|
+
initialProps: [
|
|
41
|
+
"id",
|
|
42
|
+
"className",
|
|
43
|
+
"name",
|
|
44
|
+
"value",
|
|
45
|
+
"type",
|
|
46
|
+
"placeholder",
|
|
47
|
+
"required",
|
|
48
|
+
"autoFocus"
|
|
49
|
+
]
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
p as meta,
|
|
53
|
+
c as propsMeta
|
|
54
|
+
};
|
package/lib/italic.js
ADDED
package/lib/italic.ws.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { TextItalicIcon as t } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { defaultStates as e } from "@webstudio-is/react-sdk";
|
|
3
|
+
import { i as o } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
+
import { props as i } from "./__generated__/italic.props.js";
|
|
5
|
+
const r = {
|
|
6
|
+
i: [
|
|
7
|
+
...o,
|
|
8
|
+
{
|
|
9
|
+
property: "fontStyle",
|
|
10
|
+
value: { type: "keyword", value: "italic" }
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}, c = {
|
|
14
|
+
type: "rich-text-child",
|
|
15
|
+
label: "Italic Text",
|
|
16
|
+
icon: t,
|
|
17
|
+
states: e,
|
|
18
|
+
presetStyle: r
|
|
19
|
+
}, m = {
|
|
20
|
+
props: i,
|
|
21
|
+
initialProps: ["id", "className"]
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
c as meta,
|
|
25
|
+
m as propsMeta
|
|
26
|
+
};
|
package/lib/label.js
ADDED
package/lib/label.ws.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { LabelIcon as e } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { defaultStates as o } from "@webstudio-is/react-sdk";
|
|
3
|
+
import { label as r } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
+
import { props as t } from "./__generated__/label.props.js";
|
|
5
|
+
const l = {
|
|
6
|
+
label: [
|
|
7
|
+
...r,
|
|
8
|
+
{ property: "display", value: { type: "keyword", value: "block" } }
|
|
9
|
+
]
|
|
10
|
+
}, m = {
|
|
11
|
+
category: "forms",
|
|
12
|
+
constraints: {
|
|
13
|
+
relation: "ancestor",
|
|
14
|
+
component: { $nin: ["Button", "Link"] }
|
|
15
|
+
},
|
|
16
|
+
type: "container",
|
|
17
|
+
label: "Input Label",
|
|
18
|
+
icon: e,
|
|
19
|
+
states: o,
|
|
20
|
+
presetStyle: l,
|
|
21
|
+
order: 2,
|
|
22
|
+
template: [
|
|
23
|
+
{
|
|
24
|
+
type: "instance",
|
|
25
|
+
component: "Label",
|
|
26
|
+
children: [{ type: "text", value: "Form Label", placeholder: !0 }]
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}, i = {
|
|
30
|
+
props: {
|
|
31
|
+
...t,
|
|
32
|
+
htmlFor: {
|
|
33
|
+
...t.htmlFor,
|
|
34
|
+
label: "For"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
initialProps: ["id", "className", "htmlFor"]
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
m as meta,
|
|
41
|
+
i as propsMeta
|
|
42
|
+
};
|
package/lib/link.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as n } from "react";
|
|
3
|
+
const a = n((e, o) => {
|
|
4
|
+
const {
|
|
5
|
+
children: s,
|
|
6
|
+
// @todo: it's a hack made for Image component for the builder and should't be in the runtime at all.
|
|
7
|
+
$webstudio$canvasOnly$assetId: i,
|
|
8
|
+
...r
|
|
9
|
+
} = e;
|
|
10
|
+
return /* @__PURE__ */ t("a", { ...r, href: r.href ?? "#", ref: o, children: s });
|
|
11
|
+
});
|
|
12
|
+
a.displayName = "Link";
|
|
13
|
+
export {
|
|
14
|
+
a as Link
|
|
15
|
+
};
|
package/lib/link.ws.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { LinkIcon as e } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { defaultStates as t } from "@webstudio-is/react-sdk";
|
|
3
|
+
import { a as r } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
+
import { props as o } from "./__generated__/link.props.js";
|
|
5
|
+
const n = {
|
|
6
|
+
a: [
|
|
7
|
+
...r,
|
|
8
|
+
{
|
|
9
|
+
property: "minHeight",
|
|
10
|
+
value: { type: "unit", unit: "em", value: 1 }
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
property: "display",
|
|
14
|
+
value: { type: "keyword", value: "inline-block" }
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}, l = {
|
|
18
|
+
category: "general",
|
|
19
|
+
type: "container",
|
|
20
|
+
description: "Use a link to send your users to another page, section, or resource. Configure links in the Settings panel.",
|
|
21
|
+
icon: e,
|
|
22
|
+
constraints: {
|
|
23
|
+
relation: "ancestor",
|
|
24
|
+
component: { $nin: ["Button", "Link"] }
|
|
25
|
+
},
|
|
26
|
+
presetStyle: n,
|
|
27
|
+
order: 1,
|
|
28
|
+
states: [
|
|
29
|
+
...t,
|
|
30
|
+
{
|
|
31
|
+
selector: ":visited",
|
|
32
|
+
label: "Visited"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
category: "component-states",
|
|
36
|
+
selector: "[aria-current=page]",
|
|
37
|
+
label: "Current page"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
template: [
|
|
41
|
+
{
|
|
42
|
+
type: "instance",
|
|
43
|
+
component: "Link",
|
|
44
|
+
children: [
|
|
45
|
+
{
|
|
46
|
+
type: "text",
|
|
47
|
+
value: "Link text you can edit",
|
|
48
|
+
placeholder: !0
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}, c = {
|
|
54
|
+
props: {
|
|
55
|
+
...o,
|
|
56
|
+
href: {
|
|
57
|
+
type: "string",
|
|
58
|
+
control: "url",
|
|
59
|
+
required: !1
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
initialProps: ["id", "className", "href", "target", "download"]
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
l as meta,
|
|
66
|
+
c as propsMeta
|
|
67
|
+
};
|
package/lib/list-item.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ListItemIcon as t } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { defaultStates as e } from "@webstudio-is/react-sdk";
|
|
3
|
+
import { li as o } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
+
import { props as i } from "./__generated__/list-item.props.js";
|
|
5
|
+
const n = {
|
|
6
|
+
li: o
|
|
7
|
+
}, m = {
|
|
8
|
+
category: "general",
|
|
9
|
+
type: "container",
|
|
10
|
+
constraints: {
|
|
11
|
+
relation: "parent",
|
|
12
|
+
component: { $eq: "List" }
|
|
13
|
+
},
|
|
14
|
+
description: "Adds a new item to an existing list.",
|
|
15
|
+
icon: t,
|
|
16
|
+
states: e,
|
|
17
|
+
presetStyle: n,
|
|
18
|
+
order: 4,
|
|
19
|
+
template: [
|
|
20
|
+
{
|
|
21
|
+
type: "instance",
|
|
22
|
+
component: "ListItem",
|
|
23
|
+
children: [
|
|
24
|
+
{
|
|
25
|
+
type: "text",
|
|
26
|
+
value: "List Item text you can edit",
|
|
27
|
+
placeholder: !0
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}, c = {
|
|
33
|
+
props: i,
|
|
34
|
+
initialProps: ["id", "className"]
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
m as meta,
|
|
38
|
+
c as propsMeta
|
|
39
|
+
};
|