Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
Vimeo (#1702)
Oleg Isonenb71dc7518488
diff --git a/apps/builder/app/builder/features/sidebar-left/panels/components/components.tsx b/apps/builder/app/builder/features/sidebar-left/panels/components/components.tsxindex 5ea900568d..9a14b6609c 100644--- a/apps/builder/app/builder/features/sidebar-left/panels/components/components.tsx+++ b/apps/builder/app/builder/features/sidebar-left/panels/components/components.tsx@@ -65,41 +65,43 @@ export const TabContent = ({ publish, onSetActiveTab }: TabContentProps) => {suffix={<CloseButton onClick={() => onSetActiveTab("none")} />}/><ScrollArea>- {Array.from(componentCategories).map((category) => (- <CollapsibleSection label={category} key={category} fullWidth>- <ArrowFocus- render={({ handleKeyDown }) => (- <Flex- onKeyDown={handleKeyDown}- gap="2"- wrap="wrap"- css={{ px: theme.spacing[9], overflow: "auto" }}- >- {(metaByCategory.get(category) ?? []).map(- (meta: WsComponentMeta, index) => {- const component = componentNamesByMeta.get(meta);- if (component === undefined) {- return null;+ {componentCategories+ .filter((category) => category !== "hidden")+ .map((category) => (+ <CollapsibleSection label={category} key={category} fullWidth>+ <ArrowFocus+ render={({ handleKeyDown }) => (+ <Flex+ onKeyDown={handleKeyDown}+ gap="2"+ wrap="wrap"+ css={{ px: theme.spacing[9], overflow: "auto" }}+ >+ {(metaByCategory.get(category) ?? []).map(+ (meta: WsComponentMeta, index) => {+ const component = componentNamesByMeta.get(meta);+ if (component === undefined) {+ return null;+ }+ return (+ <Tooltip content={meta.label} key={component}>+ <ComponentCard+ {...pressProps}+ {...{ [dragItemAttribute]: component }}+ label={meta.label}+ icon={<MetaIcon size="auto" icon={meta.icon} />}+ tabIndex={index === 0 ? 0 : -1}+ />+ </Tooltip>+ );}- return (- <Tooltip content={meta.label} key={component}>- <ComponentCard- {...pressProps}- {...{ [dragItemAttribute]: component }}- label={meta.label}- icon={<MetaIcon size="auto" icon={meta.icon} />}- tabIndex={index === 0 ? 0 : -1}- />- </Tooltip>- );- }- )}- {dragCard}- </Flex>- )}- />- </CollapsibleSection>- ))}+ )}+ {dragCard}+ </Flex>+ )}+ />+ </CollapsibleSection>+ ))}</ScrollArea></Flex>);diff --git a/apps/builder/app/builder/features/sidebar-left/panels/components/get-meta-maps.ts b/apps/builder/app/builder/features/sidebar-left/panels/components/get-meta-maps.tsindex 8cab1a6747..124f017adf 100644--- a/apps/builder/app/builder/features/sidebar-left/panels/components/get-meta-maps.ts+++ b/apps/builder/app/builder/features/sidebar-left/panels/components/get-meta-maps.ts@@ -10,7 +10,7 @@ export const getMetaMaps = (const componentNamesByMeta: Map<WsComponentMeta, string> = new Map();for (const [name, meta] of metaByComponentName) {- if (meta.category === undefined) {+ if (meta.category === undefined || meta.category === "hidden") {continue;}let categoryMetas = metaByCategory.get(meta.category);diff --git a/apps/builder/app/canvas/canvas.tsx b/apps/builder/app/canvas/canvas.tsxindex 0433425ffe..074a0509ea 100644--- a/apps/builder/app/canvas/canvas.tsx+++ b/apps/builder/app/canvas/canvas.tsx@@ -65,6 +65,7 @@ const temporaryInstances: Instances = new Map([const useElementsTree = (components: Components) => {const instances = useStore(instancesStore);const page = useStore(selectedPageStore);+ const [isPreviewMode] = useIsPreviewMode();const rootInstanceId = page?.rootInstanceId;if (typeof window === "undefined") {@@ -92,7 +93,7 @@ const useElementsTree = (components: Components) => {return useMemo(() => {return createElementsTree({- renderer: "canvas",+ renderer: isPreviewMode ? "preview" : "canvas",instances: instances.size === 0 ? temporaryInstances : instances,// fallback to temporary root instance to render scripts// and receive real data from builder@@ -103,7 +104,7 @@ const useElementsTree = (components: Components) => {Component: WebstudioComponentDev,components,});- }, [instances, rootInstanceId, components, pagesMapStore]);+ }, [instances, rootInstanceId, components, pagesMapStore, isPreviewMode]);};const DesignMode = () => {diff --git a/packages/icons/icons/vimeo.svg b/packages/icons/icons/vimeo.svgnew file mode 100644index 0000000000..9ba57fe825--- /dev/null+++ b/packages/icons/icons/vimeo.svg@@ -0,0 +1,10 @@+<svg+ width="22"+ height="22"+ viewBox="0 0 22 22"+ xmlns="http://www.w3.org/2000/svg"+>+ <path+ d="M20.1578 6.738C20.0764 8.52283 18.8292 10.9678 16.4184 14.0706C13.9262 17.3114 11.8172 18.9324 10.0913 18.9324C9.02325 18.9324 8.11905 17.9456 7.37989 15.971C6.88712 14.1614 6.39317 12.353 5.90039 10.5434C5.35221 8.56999 4.76395 7.58208 4.13443 7.58208C3.99768 7.58208 3.51669 7.87091 2.69501 8.4462L1.83325 7.33452C2.73745 6.53995 3.62987 5.74421 4.50813 4.94728C5.71531 3.90515 6.62069 3.35579 7.22546 3.30039C8.6519 3.16363 9.53017 4.13975 9.86026 6.22755C10.2163 8.48157 10.4627 9.88326 10.6006 10.4314C11.012 12.3011 11.4647 13.2348 11.9587 13.2348C12.343 13.2348 12.9195 12.6277 13.6881 11.4158C14.4555 10.2027 14.867 9.27967 14.9224 8.64661C15.032 7.59977 14.6206 7.07516 13.6881 7.07516C13.2484 7.07516 12.7957 7.17537 12.3312 7.37578C13.2319 4.42386 14.953 2.98916 17.4947 3.0705C19.3785 3.12591 20.2662 4.34841 20.1578 6.738Z"+ />+</svg>diff --git a/packages/icons/src/__generated__/index.ts b/packages/icons/src/__generated__/index.tsindex 38809414a5..0ca5240d5b 100644--- a/packages/icons/src/__generated__/index.ts+++ b/packages/icons/src/__generated__/index.ts@@ -120,5 +120,6 @@ export * from "./text-align-left";export * from "./text-block";export * from "./text-italic";export * from "./video";+export * from "./vimeo";export * from "./webstudio";export * from "./wrap";diff --git a/packages/icons/src/__generated__/svg/check-circle.ts b/packages/icons/src/__generated__/svg/check-circle.tsnew file mode 100644index 0000000000..5f1d0e2cee--- /dev/null+++ b/packages/icons/src/__generated__/svg/check-circle.ts@@ -0,0 +1 @@+export const CheckCircleIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" width="100%" height="100%" style="display: block;"><path fill-rule="evenodd" d="M8 1.983a6.017 6.017 0 1 0 0 12.033A6.017 6.017 0 0 0 8 1.983ZM.683 8a7.317 7.317 0 1 1 14.634 0A7.317 7.317 0 0 1 .683 8Z" clip-rule="evenodd"/><path fill-rule="evenodd" d="M11.566 5.357a.8.8 0 0 1 0 1.132l-4.154 4.153a.8.8 0 0 1-1.132 0L4.434 8.796a.8.8 0 1 1 1.132-1.131l1.28 1.28 3.588-3.588a.8.8 0 0 1 1.132 0Z" clip-rule="evenodd"/></svg>`;diff --git a/packages/icons/src/__generated__/svg/copy.ts b/packages/icons/src/__generated__/svg/copy.tsnew file mode 100644index 0000000000..541375fa40--- /dev/null+++ b/packages/icons/src/__generated__/svg/copy.ts@@ -0,0 +1 @@+export const CopyIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" width="100%" height="100%" style="display: block;"><path fill-rule="evenodd" d="M7.495 1.35h4.61c.315 0 .59 0 .816.019.24.02.484.063.719.183.348.177.631.46.808.808.12.235.164.479.184.719.018.227.018.501.018.816v4.61c0 .315 0 .59-.018.816-.02.24-.064.484-.184.719a1.85 1.85 0 0 1-.808.809c-.235.12-.479.163-.719.183-.227.018-.501.018-.816.018H11.05v1.055c0 .315 0 .59-.019.816-.02.24-.063.484-.183.719a1.85 1.85 0 0 1-.808.808c-.235.12-.479.164-.719.184-.227.018-.501.018-.816.018h-4.61c-.315 0-.59 0-.816-.018a1.883 1.883 0 0 1-.719-.184 1.85 1.85 0 0 1-.808-.808 1.882 1.882 0 0 1-.184-.719 10.757 10.757 0 0 1-.018-.816v-4.61c0-.315 0-.59.018-.816.02-.24.064-.484.184-.719a1.85 1.85 0 0 1 .808-.808c.235-.12.479-.164.719-.183.227-.019.501-.019.816-.019H4.95V3.895c0-.315 0-.59.018-.816.02-.24.064-.484.184-.719a1.85 1.85 0 0 1 .808-.808c.235-.12.479-.164.719-.183.227-.019.501-.019.816-.019ZM3.92 6.25c-.347 0-.568 0-.735.014a.643.643 0 0 0-.235.046.55.55 0 0 0-.24.24.643.643 0 0 0-.046.235c-.014.167-.014.388-.014.735v4.56c0 .347 0 .568.014.735.013.16.035.213.046.235a.55.55 0 0 0 .24.24c.022.011.075.033.235.046.167.014.388.014.735.014h4.56c.347 0 .568 0 .735-.014a.645.645 0 0 0 .235-.046.55.55 0 0 0 .24-.24.643.643 0 0 0 .046-.235c.013-.167.014-.388.014-.735V7.52c0-.347 0-.568-.014-.735a.643.643 0 0 0-.046-.235.55.55 0 0 0-.24-.24.643.643 0 0 0-.235-.046 10.166 10.166 0 0 0-.735-.014H3.92Zm7.13 3.5V7.495c0-.315 0-.59-.019-.816a1.883 1.883 0 0 0-.183-.719 1.85 1.85 0 0 0-.808-.808 1.882 1.882 0 0 0-.719-.183c-.227-.019-.501-.019-.816-.019H6.25V3.92c0-.347 0-.568.014-.735a.643.643 0 0 1 .046-.235.55.55 0 0 1 .24-.24.643.643 0 0 1 .235-.046c.167-.013.388-.014.735-.014h4.56c.347 0 .568 0 .735.014.16.013.213.035.235.046a.55.55 0 0 1 .24.24c.011.022.033.075.046.235.014.167.014.388.014.735v4.56c0 .347 0 .568-.014.735-.013.16-.035.213-.046.235a.55.55 0 0 1-.24.24.644.644 0 0 1-.235.046c-.167.014-.388.014-.735.014h-1.03Z" clip-rule="evenodd"/></svg>`;diff --git a/packages/icons/src/__generated__/svg/index.ts b/packages/icons/src/__generated__/svg/index.tsindex 21c9c1b31a..b0bdc34dd2 100644--- a/packages/icons/src/__generated__/svg/index.ts+++ b/packages/icons/src/__generated__/svg/index.ts@@ -38,6 +38,7 @@ export { BpStarOffIcon } from "./bp-star-off";export { BpStarOnIcon } from "./bp-star-on";export { BugIcon } from "./bug";export { ButtonElementIcon } from "./button-element";+export { CheckCircleIcon } from "./check-circle";export { CheckboxCheckedFilledIcon } from "./checkbox-checked-filled";export { CheckboxCheckedIcon } from "./checkbox-checked";export { CheckboxEmptyIcon } from "./checkbox-empty";@@ -52,6 +53,7 @@ export { ChevronFilledRightIcon } from "./chevron-filled-right";export { ChevronFilledUpIcon } from "./chevron-filled-up";export { CodeTextIcon } from "./code-text";export { CommitIcon } from "./commit";+export { CopyIcon } from "./copy";export { DashBorderIcon } from "./dash-border";export { DashIcon } from "./dash";export { DashedBorderIcon } from "./dashed-border";@@ -101,6 +103,7 @@ export { PlayIcon } from "./play";export { PlusIcon } from "./plus";export { RadioCheckedIcon } from "./radio-checked";export { RadioUncheckedIcon } from "./radio-unchecked";+export { RefreshIcon } from "./refresh";export { RepeatColumnIcon } from "./repeat-column";export { RepeatGridIcon } from "./repeat-grid";export { RepeatRowIcon } from "./repeat-row";@@ -117,5 +120,6 @@ export { TextAlignLeftIcon } from "./text-align-left";export { TextBlockIcon } from "./text-block";export { TextItalicIcon } from "./text-italic";export { VideoIcon } from "./video";+export { VimeoIcon } from "./vimeo";export { WebstudioIcon } from "./webstudio";export { WrapIcon } from "./wrap";diff --git a/packages/icons/src/__generated__/svg/refresh.ts b/packages/icons/src/__generated__/svg/refresh.tsnew file mode 100644index 0000000000..574a8b6851--- /dev/null+++ b/packages/icons/src/__generated__/svg/refresh.ts@@ -0,0 +1 @@+export const RefreshIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" width="100%" height="100%" style="display: block;"><path fill-rule="evenodd" d="M11.812 4.737A5.018 5.018 0 0 0 3.01 7.473a.65.65 0 1 1-1.293-.137A6.318 6.318 0 0 1 12.962 4.09l.081-.302a.65.65 0 0 1 1.256.336l-.488 1.822a.65.65 0 0 1-.796.46l-1.822-.489a.65.65 0 1 1 .337-1.256l.282.076Zm1.892 3.212a.65.65 0 0 1 .578.715A6.318 6.318 0 0 1 3.038 11.91l-.081.302a.65.65 0 1 1-1.256-.336l.488-1.822a.65.65 0 0 1 .796-.46l1.822.489a.65.65 0 1 1-.337 1.255l-.282-.075a5.018 5.018 0 0 0 8.801-2.736.65.65 0 0 1 .715-.578Z" clip-rule="evenodd"/></svg>`;diff --git a/packages/icons/src/__generated__/svg/vimeo.ts b/packages/icons/src/__generated__/svg/vimeo.tsnew file mode 100644index 0000000000..26722bdc8b--- /dev/null+++ b/packages/icons/src/__generated__/svg/vimeo.ts@@ -0,0 +1 @@+export const VimeoIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22" fill="currentColor" width="100%" height="100%" style="display: block;"><path d="M20.158 6.738c-.082 1.785-1.329 4.23-3.74 7.333-2.492 3.24-4.6 4.861-6.327 4.861-1.068 0-1.972-.986-2.711-2.961L5.9 10.543c-.548-1.973-1.136-2.96-1.766-2.96-.136 0-.617.288-1.439.863l-.862-1.111c.904-.795 1.797-1.59 2.675-2.388C5.715 3.905 6.621 3.356 7.225 3.3c1.427-.136 2.305.84 2.635 2.928.356 2.254.603 3.655.74 4.203.412 1.87.865 2.804 1.359 2.804.384 0 .96-.607 1.73-1.82.767-1.212 1.178-2.135 1.233-2.768.11-1.047-.301-1.572-1.234-1.572-.44 0-.892.1-1.357.3.9-2.951 2.622-4.386 5.164-4.304 1.883.055 2.771 1.277 2.663 3.667Z"/></svg>`;diff --git a/packages/icons/src/__generated__/vimeo.tsx b/packages/icons/src/__generated__/vimeo.tsxnew file mode 100644index 0000000000..2800a96bfe--- /dev/null+++ b/packages/icons/src/__generated__/vimeo.tsx@@ -0,0 +1,15 @@+// Generated from icons/vimeo.svg++import { forwardRef } from "react";+import type { IconProps } from "../types";++// prettier-ignore+export const VimeoIcon = forwardRef<SVGSVGElement, IconProps>(+ ({ color = "currentColor", size = 16, ...props }, forwardedRef) => {+ return (+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22" width={size} height={size} fill={color} {...props} ref={forwardedRef}><path d="M20.158 6.738c-.082 1.785-1.329 4.23-3.74 7.333-2.492 3.24-4.6 4.861-6.327 4.861-1.068 0-1.972-.986-2.711-2.961L5.9 10.543c-.548-1.973-1.136-2.96-1.766-2.96-.136 0-.617.288-1.439.863l-.862-1.111c.904-.795 1.797-1.59 2.675-2.388C5.715 3.905 6.621 3.356 7.225 3.3c1.427-.136 2.305.84 2.635 2.928.356 2.254.603 3.655.74 4.203.412 1.87.865 2.804 1.359 2.804.384 0 .96-.607 1.73-1.82.767-1.212 1.178-2.135 1.233-2.768.11-1.047-.301-1.572-1.234-1.572-.44 0-.892.1-1.357.3.9-2.951 2.622-4.386 5.164-4.304 1.883.055 2.771 1.277 2.663 3.667Z" /></svg>+ );+ }+);++VimeoIcon.displayName = "VimeoIcon";diff --git a/packages/react-sdk/package.json b/packages/react-sdk/package.jsonindex 5fd3571506..c631f82f9d 100644--- a/packages/react-sdk/package.json+++ b/packages/react-sdk/package.json@@ -26,8 +26,8 @@"jest": "^29.3.1","react": "^18.2.0","react-dom": "^18.2.0",- "typescript": "5.0.3","type-fest": "^3.7.1",+ "typescript": "5.0.3","zod": "^3.21.4"},"peerDependencies": {diff --git a/packages/react-sdk/src/components/component-meta.ts b/packages/react-sdk/src/components/component-meta.tsindex 4cb87c6eca..a0e0218f01 100644--- a/packages/react-sdk/src/components/component-meta.ts+++ b/packages/react-sdk/src/components/component-meta.ts@@ -21,6 +21,7 @@ export const componentCategories = ["text","media","forms",+ "hidden",] as const;export const stateCategories = ["states", "component-states"] as const;diff --git a/packages/react-sdk/src/context.tsx b/packages/react-sdk/src/context.tsxindex 72930710e6..35206acce9 100644--- a/packages/react-sdk/src/context.tsx+++ b/packages/react-sdk/src/context.tsx@@ -4,7 +4,7 @@ import type { Assets } from "@webstudio-is/asset-uploader";import type { Pages, PropsByInstanceId } from "./props";export const ReactSdkContext = createContext<{- renderer?: "canvas";+ renderer?: "canvas" | "preview";propsByInstanceIdStore: ReadableAtom<PropsByInstanceId>;assetsStore: ReadableAtom<Assets>;pagesStore: ReadableAtom<Pages>;diff --git a/packages/react-sdk/src/embed-template.ts b/packages/react-sdk/src/embed-template.tsindex 85eaebd3d6..4757905031 100644--- a/packages/react-sdk/src/embed-template.ts+++ b/packages/react-sdk/src/embed-template.ts@@ -45,6 +45,7 @@ const EmbedTemplateProp = z.union([type EmbedTemplateProp = z.infer<typeof EmbedTemplateProp>;const EmbedTemplateStyleDeclRaw = z.object({+ // State selector, e.g. :hoverstate: z.optional(z.string()),property: z.string(),value: StyleValue,diff --git a/packages/react-sdk/src/tree/create-elements-tree.tsx b/packages/react-sdk/src/tree/create-elements-tree.tsxindex 17b6d7d548..4525c8c2d6 100644--- a/packages/react-sdk/src/tree/create-elements-tree.tsx+++ b/packages/react-sdk/src/tree/create-elements-tree.tsx@@ -20,7 +20,7 @@ export const createElementsTree = ({Component,components,}: {- renderer?: "canvas";+ renderer?: "canvas" | "preview";instances: Instances;rootInstanceId: Instance["id"];propsByInstanceIdStore: ReadableAtom<PropsByInstanceId>;diff --git a/packages/sdk-components-react/package.json b/packages/sdk-components-react/package.jsonindex 730f71d483..779407d699 100644--- a/packages/sdk-components-react/package.json+++ b/packages/sdk-components-react/package.json@@ -53,7 +53,9 @@"@webstudio-is/generate-arg-types": "workspace:^","@webstudio-is/icons": "workspace:^","@webstudio-is/image": "workspace:^",- "@webstudio-is/react-sdk": "workspace:^"+ "@webstudio-is/react-sdk": "workspace:^",+ "colord": "^2.9.3",+ "shallow-equal": "^3.1.0"},"devDependencies": {"@storybook/react": "^6.5.16",diff --git a/packages/sdk-components-react/src/LICENSE b/packages/sdk-components-react/src/LICENSEnew file mode 100644index 0000000000..1f6edad9a7--- /dev/null+++ b/packages/sdk-components-react/src/LICENSE@@ -0,0 +1,21 @@+MIT License++Copyright (c) 2022 Webstudio++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.diff --git a/packages/sdk-components-react/src/__generated__/vimeo-play-button.props.ts b/packages/sdk-components-react/src/__generated__/vimeo-play-button.props.tsnew file mode 100644index 0000000000..34983b6ff7--- /dev/null+++ b/packages/sdk-components-react/src/__generated__/vimeo-play-button.props.ts@@ -0,0 +1,459 @@+import type { PropMeta } from "@webstudio-is/generate-arg-types";++export const props: Record<string, PropMeta> = {+ form: { required: false, control: "text", type: "string" },+ slot: { required: false, control: "text", type: "string" },+ style: { required: false, control: "text", type: "string" },+ title: { required: false, control: "text", type: "string" },+ disabled: { required: false, control: "boolean", type: "boolean" },+ formAction: { required: false, control: "text", type: "string" },+ formEncType: { required: false, control: "text", type: "string" },+ formMethod: { required: false, control: "text", type: "string" },+ formNoValidate: { required: false, control: "boolean", type: "boolean" },+ formTarget: { required: false, control: "text", type: "string" },+ name: { required: false, control: "text", type: "string" },+ type: {+ required: false,+ control: "radio",+ type: "string",+ options: ["button", "submit", "reset"],+ },+ value: { required: false, control: "text", type: "string" },+ defaultChecked: { required: false, control: "boolean", type: "boolean" },+ defaultValue: { required: false, control: "text", type: "string" },+ suppressContentEditableWarning: {+ required: false,+ control: "boolean",+ type: "boolean",+ },+ suppressHydrationWarning: {+ required: false,+ control: "boolean",+ type: "boolean",+ },+ accessKey: { required: false, control: "text", type: "string" },+ autoFocus: { required: false, control: "boolean", type: "boolean" },+ className: { required: false, control: "text", type: "string" },+ contentEditable: { required: false, control: "text", type: "string" },+ contextMenu: { required: false, control: "text", type: "string" },+ dir: { required: false, control: "text", type: "string" },+ draggable: { required: false, control: "boolean", type: "boolean" },+ hidden: { required: false, control: "boolean", type: "boolean" },+ id: { required: false, control: "text", type: "string" },+ lang: { required: false, control: "text", type: "string" },+ nonce: { required: false, control: "text", type: "string" },+ placeholder: { required: false, control: "text", type: "string" },+ spellCheck: { required: false, control: "boolean", type: "boolean" },+ tabIndex: { required: false, control: "number", type: "number" },+ translate: {+ required: false,+ control: "radio",+ type: "string",+ options: ["yes", "no"],+ },+ radioGroup: { required: false, control: "text", type: "string" },+ role: { required: false, control: "text", type: "string" },+ about: { required: false, control: "text", type: "string" },+ content: { required: false, control: "text", type: "string" },+ datatype: { required: false, control: "text", type: "string" },+ inlist: { required: false, control: "text", type: "string" },+ prefix: { required: false, control: "text", type: "string" },+ property: { required: false, control: "text", type: "string" },+ rel: { required: false, control: "text", type: "string" },+ resource: { required: false, control: "text", type: "string" },+ rev: { required: false, control: "text", type: "string" },+ typeof: { required: false, control: "text", type: "string" },+ vocab: { required: false, control: "text", type: "string" },+ autoCapitalize: { required: false, control: "text", type: "string" },+ autoCorrect: { required: false, control: "text", type: "string" },+ autoSave: { required: false, control: "text", type: "string" },+ color: { required: false, control: "color", type: "string" },+ itemProp: { required: false, control: "text", type: "string" },+ itemScope: { required: false, control: "boolean", type: "boolean" },+ itemType: { required: false, control: "text", type: "string" },+ itemID: { required: false, control: "text", type: "string" },+ itemRef: { required: false, control: "text", type: "string" },+ results: { required: false, control: "number", type: "number" },+ security: { required: false, control: "text", type: "string" },+ unselectable: {+ required: false,+ control: "radio",+ type: "string",+ options: ["on", "off"],+ },+ inputMode: {+ description:+ "Hints at the type of data that might be entered by the user while editing the element or its contents\n@see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute",+ required: false,+ control: "select",+ type: "string",+ options: [+ "text",+ "none",+ "search",+ "tel",+ "url",+ "email",+ "numeric",+ "decimal",+ ],+ },+ is: {+ description:+ "Specify that a standard HTML element should behave like a defined custom built-in element\n@see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-activedescendant": {+ description:+ "Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-atomic": {+ description:+ "Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-autocomplete": {+ description:+ "Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be\npresented if they are made.",+ required: false,+ control: "select",+ type: "string",+ options: ["list", "none", "inline", "both"],+ },+ "aria-busy": {+ description:+ "Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are complete before exposing them to the user.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-checked": {+ description:+ 'Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.\n@see aria-pressed\n@see aria-selected.',+ required: false,+ control: "text",+ type: "string",+ },+ "aria-colcount": {+ description:+ "Defines the total number of columns in a table, grid, or treegrid.\n@see aria-colindex.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-colindex": {+ description:+ "Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.\n@see aria-colcount\n@see aria-colspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-colspan": {+ description:+ "Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.\n@see aria-colindex\n@see aria-rowspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-controls": {+ description:+ "Identifies the element (or elements) whose contents or presence are controlled by the current element.\n@see aria-owns.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-current": {+ description:+ "Indicates the element that represents the current item within a container or set of related elements.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-describedby": {+ description:+ "Identifies the element (or elements) that describes the object.\n@see aria-labelledby",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-details": {+ description:+ "Identifies the element that provides a detailed, extended description for the object.\n@see aria-describedby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-disabled": {+ description:+ "Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.\n@see aria-hidden\n@see aria-readonly.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-dropeffect": {+ description:+ "Indicates what functions can be performed when a dragged object is released on the drop target.\n@deprecated in ARIA 1.1",+ required: false,+ control: "select",+ type: "string",+ options: ["link", "none", "copy", "execute", "move", "popup"],+ },+ "aria-errormessage": {+ description:+ "Identifies the element that provides an error message for the object.\n@see aria-invalid\n@see aria-describedby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-expanded": {+ description:+ "Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-flowto": {+ description:+ "Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion,\nallows assistive technology to override the general default of reading in document source order.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-grabbed": {+ description:+ 'Indicates an element\'s "grabbed" state in a drag-and-drop operation.\n@deprecated in ARIA 1.1',+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-haspopup": {+ description:+ "Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-hidden": {+ description:+ "Indicates whether the element is exposed to an accessibility API.\n@see aria-disabled.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-invalid": {+ description:+ "Indicates the entered value does not conform to the format expected by the application.\n@see aria-errormessage.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-keyshortcuts": {+ description:+ "Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-label": {+ description:+ "Defines a string value that labels the current element.\n@see aria-labelledby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-labelledby": {+ description:+ "Identifies the element (or elements) that labels the current element.\n@see aria-describedby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-level": {+ description:+ "Defines the hierarchical level of an element within a structure.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-live": {+ description:+ "Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.",+ required: false,+ control: "radio",+ type: "string",+ options: ["off", "assertive", "polite"],+ },+ "aria-modal": {+ description: "Indicates whether an element is modal when displayed.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-multiline": {+ description:+ "Indicates whether a text box accepts multiple lines of input or only a single line.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-multiselectable": {+ description:+ "Indicates that the user may select more than one item from the current selectable descendants.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-orientation": {+ description:+ "Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous.",+ required: false,+ control: "radio",+ type: "string",+ options: ["horizontal", "vertical"],+ },+ "aria-owns": {+ description:+ "Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship\nbetween DOM elements where the DOM hierarchy cannot be used to represent the relationship.\n@see aria-controls.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-placeholder": {+ description:+ "Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value.\nA hint could be a sample value or a brief description of the expected format.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-posinset": {+ description:+ "Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.\n@see aria-setsize.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-pressed": {+ description:+ 'Indicates the current "pressed" state of toggle buttons.\n@see aria-checked\n@see aria-selected.',+ required: false,+ control: "text",+ type: "string",+ },+ "aria-readonly": {+ description:+ "Indicates that the element is not editable, but is otherwise operable.\n@see aria-disabled.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-relevant": {+ description:+ "Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.\n@see aria-atomic.",+ required: false,+ control: "select",+ type: "string",+ options: [+ "text",+ "additions",+ "additions removals",+ "additions text",+ "all",+ "removals",+ "removals additions",+ "removals text",+ "text additions",+ "text removals",+ ],+ },+ "aria-required": {+ description:+ "Indicates that user input is required on the element before a form may be submitted.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-roledescription": {+ description:+ "Defines a human-readable, author-localized description for the role of an element.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-rowcount": {+ description:+ "Defines the total number of rows in a table, grid, or treegrid.\n@see aria-rowindex.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-rowindex": {+ description:+ "Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.\n@see aria-rowcount\n@see aria-rowspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-rowspan": {+ description:+ "Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.\n@see aria-rowindex\n@see aria-colspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-selected": {+ description:+ 'Indicates the current "selected" state of various widgets.\n@see aria-checked\n@see aria-pressed.',+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-setsize": {+ description:+ "Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.\n@see aria-posinset.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-sort": {+ description:+ "Indicates if items in a table or grid are sorted in ascending or descending order.",+ required: false,+ control: "select",+ type: "string",+ options: ["none", "ascending", "descending", "other"],+ },+ "aria-valuemax": {+ description: "Defines the maximum allowed value for a range widget.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-valuemin": {+ description: "Defines the minimum allowed value for a range widget.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-valuenow": {+ description:+ "Defines the current value for a range widget.\n@see aria-valuetext.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-valuetext": {+ description:+ "Defines the human readable text alternative of aria-valuenow for a range widget.",+ required: false,+ control: "text",+ type: "string",+ },+ innerText: { required: false, control: "text", type: "string" },+};diff --git a/packages/sdk-components-react/src/__generated__/vimeo-preview-image.props.ts b/packages/sdk-components-react/src/__generated__/vimeo-preview-image.props.tsnew file mode 100644index 0000000000..1c9a859383--- /dev/null+++ b/packages/sdk-components-react/src/__generated__/vimeo-preview-image.props.ts@@ -0,0 +1,487 @@+import type { PropMeta } from "@webstudio-is/generate-arg-types";++export const props: Record<string, PropMeta> = {+ slot: { required: false, control: "text", type: "string" },+ style: { required: false, control: "text", type: "string" },+ title: { required: false, control: "text", type: "string" },+ alt: { required: false, control: "text", type: "string" },+ crossOrigin: {+ required: false,+ control: "radio",+ type: "string",+ options: ["", "anonymous", "use-credentials"],+ },+ decoding: {+ required: false,+ control: "radio",+ type: "string",+ options: ["async", "auto", "sync"],+ },+ height: { required: false, control: "number", type: "number" },+ loading: {+ required: false,+ control: "radio",+ type: "string",+ options: ["eager", "lazy"],+ },+ referrerPolicy: {+ required: false,+ control: "select",+ type: "string",+ options: [+ "",+ "no-referrer",+ "no-referrer-when-downgrade",+ "origin",+ "origin-when-cross-origin",+ "same-origin",+ "strict-origin",+ "strict-origin-when-cross-origin",+ "unsafe-url",+ ],+ },+ sizes: { required: false, control: "text", type: "string" },+ src: { required: false, control: "text", type: "string" },+ srcSet: { required: false, control: "text", type: "string" },+ useMap: { required: false, control: "text", type: "string" },+ width: { required: false, control: "number", type: "number" },+ defaultChecked: { required: false, control: "boolean", type: "boolean" },+ defaultValue: { required: false, control: "text", type: "string" },+ suppressContentEditableWarning: {+ required: false,+ control: "boolean",+ type: "boolean",+ },+ suppressHydrationWarning: {+ required: false,+ control: "boolean",+ type: "boolean",+ },+ accessKey: { required: false, control: "text", type: "string" },+ autoFocus: { required: false, control: "boolean", type: "boolean" },+ className: { required: false, control: "text", type: "string" },+ contentEditable: { required: false, control: "text", type: "string" },+ contextMenu: { required: false, control: "text", type: "string" },+ dir: { required: false, control: "text", type: "string" },+ draggable: { required: false, control: "boolean", type: "boolean" },+ hidden: { required: false, control: "boolean", type: "boolean" },+ id: { required: false, control: "text", type: "string" },+ lang: { required: false, control: "text", type: "string" },+ nonce: { required: false, control: "text", type: "string" },+ placeholder: { required: false, control: "text", type: "string" },+ spellCheck: { required: false, control: "boolean", type: "boolean" },+ tabIndex: { required: false, control: "number", type: "number" },+ translate: {+ required: false,+ control: "radio",+ type: "string",+ options: ["yes", "no"],+ },+ radioGroup: { required: false, control: "text", type: "string" },+ role: { required: false, control: "text", type: "string" },+ about: { required: false, control: "text", type: "string" },+ content: { required: false, control: "text", type: "string" },+ datatype: { required: false, control: "text", type: "string" },+ inlist: { required: false, control: "text", type: "string" },+ prefix: { required: false, control: "text", type: "string" },+ property: { required: false, control: "text", type: "string" },+ rel: { required: false, control: "text", type: "string" },+ resource: { required: false, control: "text", type: "string" },+ rev: { required: false, control: "text", type: "string" },+ typeof: { required: false, control: "text", type: "string" },+ vocab: { required: false, control: "text", type: "string" },+ autoCapitalize: { required: false, control: "text", type: "string" },+ autoCorrect: { required: false, control: "text", type: "string" },+ autoSave: { required: false, control: "text", type: "string" },+ color: { required: false, control: "color", type: "string" },+ itemProp: { required: false, control: "text", type: "string" },+ itemScope: { required: false, control: "boolean", type: "boolean" },+ itemType: { required: false, control: "text", type: "string" },+ itemID: { required: false, control: "text", type: "string" },+ itemRef: { required: false, control: "text", type: "string" },+ results: { required: false, control: "number", type: "number" },+ security: { required: false, control: "text", type: "string" },+ unselectable: {+ required: false,+ control: "radio",+ type: "string",+ options: ["on", "off"],+ },+ inputMode: {+ description:+ "Hints at the type of data that might be entered by the user while editing the element or its contents\n@see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute",+ required: false,+ control: "select",+ type: "string",+ options: [+ "text",+ "none",+ "search",+ "tel",+ "url",+ "email",+ "numeric",+ "decimal",+ ],+ },+ is: {+ description:+ "Specify that a standard HTML element should behave like a defined custom built-in element\n@see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-activedescendant": {+ description:+ "Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-atomic": {+ description:+ "Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-autocomplete": {+ description:+ "Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be\npresented if they are made.",+ required: false,+ control: "select",+ type: "string",+ options: ["list", "none", "inline", "both"],+ },+ "aria-busy": {+ description:+ "Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are complete before exposing them to the user.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-checked": {+ description:+ 'Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.\n@see aria-pressed\n@see aria-selected.',+ required: false,+ control: "text",+ type: "string",+ },+ "aria-colcount": {+ description:+ "Defines the total number of columns in a table, grid, or treegrid.\n@see aria-colindex.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-colindex": {+ description:+ "Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.\n@see aria-colcount\n@see aria-colspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-colspan": {+ description:+ "Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.\n@see aria-colindex\n@see aria-rowspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-controls": {+ description:+ "Identifies the element (or elements) whose contents or presence are controlled by the current element.\n@see aria-owns.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-current": {+ description:+ "Indicates the element that represents the current item within a container or set of related elements.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-describedby": {+ description:+ "Identifies the element (or elements) that describes the object.\n@see aria-labelledby",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-details": {+ description:+ "Identifies the element that provides a detailed, extended description for the object.\n@see aria-describedby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-disabled": {+ description:+ "Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.\n@see aria-hidden\n@see aria-readonly.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-dropeffect": {+ description:+ "Indicates what functions can be performed when a dragged object is released on the drop target.\n@deprecated in ARIA 1.1",+ required: false,+ control: "select",+ type: "string",+ options: ["link", "none", "copy", "execute", "move", "popup"],+ },+ "aria-errormessage": {+ description:+ "Identifies the element that provides an error message for the object.\n@see aria-invalid\n@see aria-describedby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-expanded": {+ description:+ "Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-flowto": {+ description:+ "Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion,\nallows assistive technology to override the general default of reading in document source order.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-grabbed": {+ description:+ 'Indicates an element\'s "grabbed" state in a drag-and-drop operation.\n@deprecated in ARIA 1.1',+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-haspopup": {+ description:+ "Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-hidden": {+ description:+ "Indicates whether the element is exposed to an accessibility API.\n@see aria-disabled.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-invalid": {+ description:+ "Indicates the entered value does not conform to the format expected by the application.\n@see aria-errormessage.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-keyshortcuts": {+ description:+ "Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-label": {+ description:+ "Defines a string value that labels the current element.\n@see aria-labelledby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-labelledby": {+ description:+ "Identifies the element (or elements) that labels the current element.\n@see aria-describedby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-level": {+ description:+ "Defines the hierarchical level of an element within a structure.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-live": {+ description:+ "Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.",+ required: false,+ control: "radio",+ type: "string",+ options: ["off", "assertive", "polite"],+ },+ "aria-modal": {+ description: "Indicates whether an element is modal when displayed.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-multiline": {+ description:+ "Indicates whether a text box accepts multiple lines of input or only a single line.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-multiselectable": {+ description:+ "Indicates that the user may select more than one item from the current selectable descendants.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-orientation": {+ description:+ "Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous.",+ required: false,+ control: "radio",+ type: "string",+ options: ["horizontal", "vertical"],+ },+ "aria-owns": {+ description:+ "Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship\nbetween DOM elements where the DOM hierarchy cannot be used to represent the relationship.\n@see aria-controls.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-placeholder": {+ description:+ "Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value.\nA hint could be a sample value or a brief description of the expected format.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-posinset": {+ description:+ "Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.\n@see aria-setsize.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-pressed": {+ description:+ 'Indicates the current "pressed" state of toggle buttons.\n@see aria-checked\n@see aria-selected.',+ required: false,+ control: "text",+ type: "string",+ },+ "aria-readonly": {+ description:+ "Indicates that the element is not editable, but is otherwise operable.\n@see aria-disabled.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-relevant": {+ description:+ "Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.\n@see aria-atomic.",+ required: false,+ control: "select",+ type: "string",+ options: [+ "text",+ "additions",+ "additions removals",+ "additions text",+ "all",+ "removals",+ "removals additions",+ "removals text",+ "text additions",+ "text removals",+ ],+ },+ "aria-required": {+ description:+ "Indicates that user input is required on the element before a form may be submitted.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-roledescription": {+ description:+ "Defines a human-readable, author-localized description for the role of an element.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-rowcount": {+ description:+ "Defines the total number of rows in a table, grid, or treegrid.\n@see aria-rowindex.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-rowindex": {+ description:+ "Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.\n@see aria-rowcount\n@see aria-rowspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-rowspan": {+ description:+ "Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.\n@see aria-rowindex\n@see aria-colspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-selected": {+ description:+ 'Indicates the current "selected" state of various widgets.\n@see aria-checked\n@see aria-pressed.',+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-setsize": {+ description:+ "Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.\n@see aria-posinset.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-sort": {+ description:+ "Indicates if items in a table or grid are sorted in ascending or descending order.",+ required: false,+ control: "select",+ type: "string",+ options: ["none", "ascending", "descending", "other"],+ },+ "aria-valuemax": {+ description: "Defines the maximum allowed value for a range widget.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-valuemin": {+ description: "Defines the minimum allowed value for a range widget.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-valuenow": {+ description:+ "Defines the current value for a range widget.\n@see aria-valuetext.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-valuetext": {+ description:+ "Defines the human readable text alternative of aria-valuenow for a range widget.",+ required: false,+ control: "text",+ type: "string",+ },+ quality: { required: false, control: "number", type: "number" },+ loader: { required: true, control: "text", type: "string" },+ optimize: { required: false, control: "boolean", type: "boolean" },+};diff --git a/packages/sdk-components-react/src/__generated__/vimeo-spinner.props.ts b/packages/sdk-components-react/src/__generated__/vimeo-spinner.props.tsnew file mode 100644index 0000000000..e314ec6e6f--- /dev/null+++ b/packages/sdk-components-react/src/__generated__/vimeo-spinner.props.ts@@ -0,0 +1,443 @@+import type { PropMeta } from "@webstudio-is/generate-arg-types";++export const props: Record<string, PropMeta> = {+ slot: { required: false, control: "text", type: "string" },+ style: { required: false, control: "text", type: "string" },+ title: { required: false, control: "text", type: "string" },+ defaultChecked: { required: false, control: "boolean", type: "boolean" },+ defaultValue: { required: false, control: "text", type: "string" },+ suppressContentEditableWarning: {+ required: false,+ control: "boolean",+ type: "boolean",+ },+ suppressHydrationWarning: {+ required: false,+ control: "boolean",+ type: "boolean",+ },+ accessKey: { required: false, control: "text", type: "string" },+ autoFocus: { required: false, control: "boolean", type: "boolean" },+ className: { required: false, control: "text", type: "string" },+ contentEditable: { required: false, control: "text", type: "string" },+ contextMenu: { required: false, control: "text", type: "string" },+ dir: { required: false, control: "text", type: "string" },+ draggable: { required: false, control: "boolean", type: "boolean" },+ hidden: { required: false, control: "boolean", type: "boolean" },+ id: { required: false, control: "text", type: "string" },+ lang: { required: false, control: "text", type: "string" },+ nonce: { required: false, control: "text", type: "string" },+ placeholder: { required: false, control: "text", type: "string" },+ spellCheck: { required: false, control: "boolean", type: "boolean" },+ tabIndex: { required: false, control: "number", type: "number" },+ translate: {+ required: false,+ control: "radio",+ type: "string",+ options: ["yes", "no"],+ },+ radioGroup: { required: false, control: "text", type: "string" },+ role: { required: false, control: "text", type: "string" },+ about: { required: false, control: "text", type: "string" },+ content: { required: false, control: "text", type: "string" },+ datatype: { required: false, control: "text", type: "string" },+ inlist: { required: false, control: "text", type: "string" },+ prefix: { required: false, control: "text", type: "string" },+ property: { required: false, control: "text", type: "string" },+ rel: { required: false, control: "text", type: "string" },+ resource: { required: false, control: "text", type: "string" },+ rev: { required: false, control: "text", type: "string" },+ typeof: { required: false, control: "text", type: "string" },+ vocab: { required: false, control: "text", type: "string" },+ autoCapitalize: { required: false, control: "text", type: "string" },+ autoCorrect: { required: false, control: "text", type: "string" },+ autoSave: { required: false, control: "text", type: "string" },+ color: { required: false, control: "color", type: "string" },+ itemProp: { required: false, control: "text", type: "string" },+ itemScope: { required: false, control: "boolean", type: "boolean" },+ itemType: { required: false, control: "text", type: "string" },+ itemID: { required: false, control: "text", type: "string" },+ itemRef: { required: false, control: "text", type: "string" },+ results: { required: false, control: "number", type: "number" },+ security: { required: false, control: "text", type: "string" },+ unselectable: {+ required: false,+ control: "radio",+ type: "string",+ options: ["on", "off"],+ },+ inputMode: {+ description:+ "Hints at the type of data that might be entered by the user while editing the element or its contents\n@see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute",+ required: false,+ control: "select",+ type: "string",+ options: [+ "text",+ "none",+ "search",+ "tel",+ "url",+ "email",+ "numeric",+ "decimal",+ ],+ },+ is: {+ description:+ "Specify that a standard HTML element should behave like a defined custom built-in element\n@see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-activedescendant": {+ description:+ "Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-atomic": {+ description:+ "Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-autocomplete": {+ description:+ "Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be\npresented if they are made.",+ required: false,+ control: "select",+ type: "string",+ options: ["list", "none", "inline", "both"],+ },+ "aria-busy": {+ description:+ "Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are complete before exposing them to the user.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-checked": {+ description:+ 'Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.\n@see aria-pressed\n@see aria-selected.',+ required: false,+ control: "text",+ type: "string",+ },+ "aria-colcount": {+ description:+ "Defines the total number of columns in a table, grid, or treegrid.\n@see aria-colindex.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-colindex": {+ description:+ "Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.\n@see aria-colcount\n@see aria-colspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-colspan": {+ description:+ "Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.\n@see aria-colindex\n@see aria-rowspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-controls": {+ description:+ "Identifies the element (or elements) whose contents or presence are controlled by the current element.\n@see aria-owns.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-current": {+ description:+ "Indicates the element that represents the current item within a container or set of related elements.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-describedby": {+ description:+ "Identifies the element (or elements) that describes the object.\n@see aria-labelledby",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-details": {+ description:+ "Identifies the element that provides a detailed, extended description for the object.\n@see aria-describedby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-disabled": {+ description:+ "Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.\n@see aria-hidden\n@see aria-readonly.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-dropeffect": {+ description:+ "Indicates what functions can be performed when a dragged object is released on the drop target.\n@deprecated in ARIA 1.1",+ required: false,+ control: "select",+ type: "string",+ options: ["link", "none", "copy", "execute", "move", "popup"],+ },+ "aria-errormessage": {+ description:+ "Identifies the element that provides an error message for the object.\n@see aria-invalid\n@see aria-describedby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-expanded": {+ description:+ "Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-flowto": {+ description:+ "Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion,\nallows assistive technology to override the general default of reading in document source order.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-grabbed": {+ description:+ 'Indicates an element\'s "grabbed" state in a drag-and-drop operation.\n@deprecated in ARIA 1.1',+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-haspopup": {+ description:+ "Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-hidden": {+ description:+ "Indicates whether the element is exposed to an accessibility API.\n@see aria-disabled.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-invalid": {+ description:+ "Indicates the entered value does not conform to the format expected by the application.\n@see aria-errormessage.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-keyshortcuts": {+ description:+ "Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-label": {+ description:+ "Defines a string value that labels the current element.\n@see aria-labelledby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-labelledby": {+ description:+ "Identifies the element (or elements) that labels the current element.\n@see aria-describedby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-level": {+ description:+ "Defines the hierarchical level of an element within a structure.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-live": {+ description:+ "Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.",+ required: false,+ control: "radio",+ type: "string",+ options: ["off", "assertive", "polite"],+ },+ "aria-modal": {+ description: "Indicates whether an element is modal when displayed.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-multiline": {+ description:+ "Indicates whether a text box accepts multiple lines of input or only a single line.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-multiselectable": {+ description:+ "Indicates that the user may select more than one item from the current selectable descendants.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-orientation": {+ description:+ "Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous.",+ required: false,+ control: "radio",+ type: "string",+ options: ["horizontal", "vertical"],+ },+ "aria-owns": {+ description:+ "Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship\nbetween DOM elements where the DOM hierarchy cannot be used to represent the relationship.\n@see aria-controls.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-placeholder": {+ description:+ "Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value.\nA hint could be a sample value or a brief description of the expected format.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-posinset": {+ description:+ "Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.\n@see aria-setsize.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-pressed": {+ description:+ 'Indicates the current "pressed" state of toggle buttons.\n@see aria-checked\n@see aria-selected.',+ required: false,+ control: "text",+ type: "string",+ },+ "aria-readonly": {+ description:+ "Indicates that the element is not editable, but is otherwise operable.\n@see aria-disabled.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-relevant": {+ description:+ "Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.\n@see aria-atomic.",+ required: false,+ control: "select",+ type: "string",+ options: [+ "text",+ "additions",+ "additions removals",+ "additions text",+ "all",+ "removals",+ "removals additions",+ "removals text",+ "text additions",+ "text removals",+ ],+ },+ "aria-required": {+ description:+ "Indicates that user input is required on the element before a form may be submitted.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-roledescription": {+ description:+ "Defines a human-readable, author-localized description for the role of an element.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-rowcount": {+ description:+ "Defines the total number of rows in a table, grid, or treegrid.\n@see aria-rowindex.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-rowindex": {+ description:+ "Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.\n@see aria-rowcount\n@see aria-rowspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-rowspan": {+ description:+ "Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.\n@see aria-rowindex\n@see aria-colspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-selected": {+ description:+ 'Indicates the current "selected" state of various widgets.\n@see aria-checked\n@see aria-pressed.',+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-setsize": {+ description:+ "Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.\n@see aria-posinset.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-sort": {+ description:+ "Indicates if items in a table or grid are sorted in ascending or descending order.",+ required: false,+ control: "select",+ type: "string",+ options: ["none", "ascending", "descending", "other"],+ },+ "aria-valuemax": {+ description: "Defines the maximum allowed value for a range widget.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-valuemin": {+ description: "Defines the minimum allowed value for a range widget.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-valuenow": {+ description:+ "Defines the current value for a range widget.\n@see aria-valuetext.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-valuetext": {+ description:+ "Defines the human readable text alternative of aria-valuenow for a range widget.",+ required: false,+ control: "text",+ type: "string",+ },+};diff --git a/packages/sdk-components-react/src/__generated__/vimeo.props.ts b/packages/sdk-components-react/src/__generated__/vimeo.props.tsnew file mode 100644index 0000000000..4f03fbee3c--- /dev/null+++ b/packages/sdk-components-react/src/__generated__/vimeo.props.ts@@ -0,0 +1,621 @@+import type { PropMeta } from "@webstudio-is/generate-arg-types";++export const props: Record<string, PropMeta> = {+ slot: { required: false, control: "text", type: "string" },+ style: { required: false, control: "text", type: "string" },+ title: { required: false, control: "text", type: "string" },+ defaultChecked: { required: false, control: "boolean", type: "boolean" },+ defaultValue: { required: false, control: "text", type: "string" },+ suppressContentEditableWarning: {+ required: false,+ control: "boolean",+ type: "boolean",+ },+ suppressHydrationWarning: {+ required: false,+ control: "boolean",+ type: "boolean",+ },+ accessKey: { required: false, control: "text", type: "string" },+ autoFocus: { required: false, control: "boolean", type: "boolean" },+ className: { required: false, control: "text", type: "string" },+ contentEditable: { required: false, control: "text", type: "string" },+ contextMenu: { required: false, control: "text", type: "string" },+ dir: { required: false, control: "text", type: "string" },+ draggable: { required: false, control: "boolean", type: "boolean" },+ hidden: { required: false, control: "boolean", type: "boolean" },+ id: { required: false, control: "text", type: "string" },+ lang: { required: false, control: "text", type: "string" },+ nonce: { required: false, control: "text", type: "string" },+ placeholder: { required: false, control: "text", type: "string" },+ spellCheck: { required: false, control: "boolean", type: "boolean" },+ tabIndex: { required: false, control: "number", type: "number" },+ translate: {+ required: false,+ control: "radio",+ type: "string",+ options: ["yes", "no"],+ },+ radioGroup: { required: false, control: "text", type: "string" },+ role: { required: false, control: "text", type: "string" },+ about: { required: false, control: "text", type: "string" },+ content: { required: false, control: "text", type: "string" },+ datatype: { required: false, control: "text", type: "string" },+ inlist: { required: false, control: "text", type: "string" },+ prefix: { required: false, control: "text", type: "string" },+ property: { required: false, control: "text", type: "string" },+ rel: { required: false, control: "text", type: "string" },+ resource: { required: false, control: "text", type: "string" },+ rev: { required: false, control: "text", type: "string" },+ typeof: { required: false, control: "text", type: "string" },+ vocab: { required: false, control: "text", type: "string" },+ autoCapitalize: { required: false, control: "text", type: "string" },+ autoCorrect: { required: false, control: "text", type: "string" },+ autoSave: { required: false, control: "text", type: "string" },+ color: { required: false, control: "color", type: "string" },+ itemProp: { required: false, control: "text", type: "string" },+ itemScope: { required: false, control: "boolean", type: "boolean" },+ itemType: { required: false, control: "text", type: "string" },+ itemID: { required: false, control: "text", type: "string" },+ itemRef: { required: false, control: "text", type: "string" },+ results: { required: false, control: "number", type: "number" },+ security: { required: false, control: "text", type: "string" },+ unselectable: {+ required: false,+ control: "radio",+ type: "string",+ options: ["on", "off"],+ },+ inputMode: {+ description:+ "Hints at the type of data that might be entered by the user while editing the element or its contents\n@see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute",+ required: false,+ control: "select",+ type: "string",+ options: [+ "text",+ "url",+ "none",+ "search",+ "tel",+ "email",+ "numeric",+ "decimal",+ ],+ },+ is: {+ description:+ "Specify that a standard HTML element should behave like a defined custom built-in element\n@see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-activedescendant": {+ description:+ "Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-atomic": {+ description:+ "Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-autocomplete": {+ description:+ "Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be\npresented if they are made.",+ required: false,+ control: "select",+ type: "string",+ options: ["list", "none", "inline", "both"],+ },+ "aria-busy": {+ description:+ "Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are complete before exposing them to the user.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-checked": {+ description:+ 'Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.\n@see aria-pressed\n@see aria-selected.',+ required: false,+ control: "text",+ type: "string",+ },+ "aria-colcount": {+ description:+ "Defines the total number of columns in a table, grid, or treegrid.\n@see aria-colindex.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-colindex": {+ description:+ "Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.\n@see aria-colcount\n@see aria-colspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-colspan": {+ description:+ "Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.\n@see aria-colindex\n@see aria-rowspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-controls": {+ description:+ "Identifies the element (or elements) whose contents or presence are controlled by the current element.\n@see aria-owns.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-current": {+ description:+ "Indicates the element that represents the current item within a container or set of related elements.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-describedby": {+ description:+ "Identifies the element (or elements) that describes the object.\n@see aria-labelledby",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-details": {+ description:+ "Identifies the element that provides a detailed, extended description for the object.\n@see aria-describedby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-disabled": {+ description:+ "Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.\n@see aria-hidden\n@see aria-readonly.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-dropeffect": {+ description:+ "Indicates what functions can be performed when a dragged object is released on the drop target.\n@deprecated in ARIA 1.1",+ required: false,+ control: "select",+ type: "string",+ options: ["link", "none", "copy", "execute", "move", "popup"],+ },+ "aria-errormessage": {+ description:+ "Identifies the element that provides an error message for the object.\n@see aria-invalid\n@see aria-describedby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-expanded": {+ description:+ "Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-flowto": {+ description:+ "Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion,\nallows assistive technology to override the general default of reading in document source order.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-grabbed": {+ description:+ 'Indicates an element\'s "grabbed" state in a drag-and-drop operation.\n@deprecated in ARIA 1.1',+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-haspopup": {+ description:+ "Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-hidden": {+ description:+ "Indicates whether the element is exposed to an accessibility API.\n@see aria-disabled.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-invalid": {+ description:+ "Indicates the entered value does not conform to the format expected by the application.\n@see aria-errormessage.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-keyshortcuts": {+ description:+ "Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-label": {+ description:+ "Defines a string value that labels the current element.\n@see aria-labelledby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-labelledby": {+ description:+ "Identifies the element (or elements) that labels the current element.\n@see aria-describedby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-level": {+ description:+ "Defines the hierarchical level of an element within a structure.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-live": {+ description:+ "Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.",+ required: false,+ control: "radio",+ type: "string",+ options: ["off", "assertive", "polite"],+ },+ "aria-modal": {+ description: "Indicates whether an element is modal when displayed.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-multiline": {+ description:+ "Indicates whether a text box accepts multiple lines of input or only a single line.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-multiselectable": {+ description:+ "Indicates that the user may select more than one item from the current selectable descendants.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-orientation": {+ description:+ "Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous.",+ required: false,+ control: "radio",+ type: "string",+ options: ["horizontal", "vertical"],+ },+ "aria-owns": {+ description:+ "Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship\nbetween DOM elements where the DOM hierarchy cannot be used to represent the relationship.\n@see aria-controls.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-placeholder": {+ description:+ "Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value.\nA hint could be a sample value or a brief description of the expected format.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-posinset": {+ description:+ "Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.\n@see aria-setsize.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-pressed": {+ description:+ 'Indicates the current "pressed" state of toggle buttons.\n@see aria-checked\n@see aria-selected.',+ required: false,+ control: "text",+ type: "string",+ },+ "aria-readonly": {+ description:+ "Indicates that the element is not editable, but is otherwise operable.\n@see aria-disabled.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-relevant": {+ description:+ "Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.\n@see aria-atomic.",+ required: false,+ control: "select",+ type: "string",+ options: [+ "text",+ "additions",+ "additions removals",+ "additions text",+ "all",+ "removals",+ "removals additions",+ "removals text",+ "text additions",+ "text removals",+ ],+ },+ "aria-required": {+ description:+ "Indicates that user input is required on the element before a form may be submitted.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-roledescription": {+ description:+ "Defines a human-readable, author-localized description for the role of an element.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-rowcount": {+ description:+ "Defines the total number of rows in a table, grid, or treegrid.\n@see aria-rowindex.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-rowindex": {+ description:+ "Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.\n@see aria-rowcount\n@see aria-rowspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-rowspan": {+ description:+ "Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.\n@see aria-rowindex\n@see aria-colspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-selected": {+ description:+ 'Indicates the current "selected" state of various widgets.\n@see aria-checked\n@see aria-pressed.',+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-setsize": {+ description:+ "Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.\n@see aria-posinset.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-sort": {+ description:+ "Indicates if items in a table or grid are sorted in ascending or descending order.",+ required: false,+ control: "select",+ type: "string",+ options: ["none", "ascending", "descending", "other"],+ },+ "aria-valuemax": {+ description: "Defines the maximum allowed value for a range widget.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-valuemin": {+ description: "Defines the minimum allowed value for a range widget.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-valuenow": {+ description:+ "Defines the current value for a range widget.\n@see aria-valuetext.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-valuetext": {+ description:+ "Defines the human readable text alternative of aria-valuenow for a range widget.",+ required: false,+ control: "text",+ type: "string",+ },+ url: {+ description:+ "The ID or the URL of the video on Vimeo. You must supply one of these values to identify the video. When the video's privacy setting is Private, you must use the URL, and the URL must include the h parameter. For more information, see our introductory guide.",+ required: false,+ control: "text",+ type: "string",+ },+ autopause: {+ description:+ "Whether to pause the current video when another Vimeo video on the same page starts to play. Set this value to false to permit simultaneous playback of all the videos on the page. This option has no effect if you've disabled cookies in your browser, either through browser settings or with an extension or plugin.",+ required: false,+ control: "boolean",+ type: "boolean",+ defaultValue: true,+ },+ autopip: {+ description:+ "Whether to enable the browser to enter picture-in-picture mode automatically when switching tabs or windows, where supported.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ autoplay: {+ description:+ "Whether to start playback of the video automatically. This feature might not work on all devices.",+ required: false,+ control: "boolean",+ type: "boolean",+ defaultValue: false,+ },+ keyboard: {+ description:+ "Whether to enable keyboard input to trigger player events. This setting doesn't affect tab control.",+ required: false,+ control: "boolean",+ type: "boolean",+ defaultValue: true,+ },+ loop: {+ description:+ "Whether to restart the video automatically after reaching the end.",+ required: false,+ control: "boolean",+ type: "boolean",+ defaultValue: false,+ },+ muted: {+ description:+ "Whether the video is muted upon loading. The true value is required for the autoplay behavior in some browsers.",+ required: false,+ control: "boolean",+ type: "boolean",+ defaultValue: false,+ },+ pip: {+ description:+ "Whether to include the picture-in-picture button among the player controls and enable the picture-in-picture API.",+ required: false,+ control: "boolean",+ type: "boolean",+ defaultValue: false,+ },+ playsinline: {+ description:+ "Whether the video plays inline on supported mobile devices. To force the device to play the video in fullscreen mode instead, set this value to false.",+ required: false,+ control: "boolean",+ type: "boolean",+ defaultValue: true,+ },+ quality: {+ description:+ "For videos on a Vimeo Plus account or higher: the playback quality of the video. Use auto for the best possible quality given available bandwidth and other factors. You can also specify 360p, 540p, 720p, 1080p, 2k, and 4k.",+ required: false,+ control: "select",+ type: "string",+ defaultValue: "auto",+ options: ["auto", "360p", "540p", "720p", "1080p", "2k", "4k"],+ },+ responsive: {+ description:+ "Whether to return a responsive embed code, or one that provides intelligent adjustments based on viewing conditions. We recommend this option for mobile-optimized sites.",+ required: false,+ control: "boolean",+ type: "boolean",+ defaultValue: true,+ },+ speed: {+ description:+ "Whether the player displays speed controls in the preferences menu and enables the playback rate API.",+ required: false,+ control: "boolean",+ type: "boolean",+ defaultValue: false,+ },+ texttrack: {+ description:+ "The text track to display with the video. Specify the text track by its language code (en), the language code and locale (en-US), or the language code and kind (en.captions). For this argument to work, the video must already have a text track of the given type; see our Help Center or Working with Text Track Uploads for more information.\nTo enable automatically generated closed captions instead, provide the value en-x-autogen. Please note that, at the present time, automatic captions are always in English.",+ required: false,+ control: "text",+ type: "string",+ },+ transparent: {+ description:+ "Whether the responsive player and transparent background are enabled.",+ required: false,+ control: "boolean",+ type: "boolean",+ defaultValue: true,+ },+ showPreview: {+ description:+ "Whether the preview image should be loaded from Vimeo API. Ideally don't use it, because it will show up with some delay and will make your site feel slower.",+ required: false,+ control: "boolean",+ type: "boolean",+ defaultValue: false,+ },+ doNotTrack: {+ description:+ "Whether to prevent the player from tracking session data, including cookies. Keep in mind that setting this argument to true also blocks video stats.",+ required: false,+ control: "boolean",+ type: "boolean",+ defaultValue: false,+ },+ interactiveParams: {+ description:+ "Key-value pairs representing dynamic parameters that are utilized on interactive videos with live elements, such as title=my-video,subtitle=interactive.",+ required: false,+ control: "text",+ type: "string",+ },+ backgroundMode: {+ description:+ "Whether the player is in background mode, which hides the playback controls, enables autoplay, and loops the video.",+ required: false,+ control: "boolean",+ type: "boolean",+ defaultValue: false,+ },+ showControls: {+ description:+ "Whether to display the player's interactive elements, including the play bar and sharing buttons. Set this option to false for a chromeless experience. To control playback when the play/pause button is hidden, set autoplay to true, use keyboard controls (which remain active), or implement our player SDK.",+ required: false,+ control: "boolean",+ type: "boolean",+ defaultValue: true,+ },+ controlsColor: {+ description:+ "A color value of the playback controls, which is normally #00ADEF. The embed settings of the video might override this value.",+ required: false,+ control: "color",+ type: "string",+ },+ showByline: {+ description: "Whether to display the video owner's name.",+ required: false,+ control: "boolean",+ type: "boolean",+ defaultValue: false,+ },+ showTitle: {+ description: "Whether the player displays the title overlay.",+ required: false,+ control: "boolean",+ type: "boolean",+ defaultValue: false,+ },+ showPortrait: {+ description:+ "Whether to display the video owner's portrait. Only works if either title or byline are also enabled",+ required: false,+ control: "boolean",+ type: "boolean",+ defaultValue: true,+ },+};diff --git a/packages/sdk-components-react/src/box.tsx b/packages/sdk-components-react/src/box.tsxindex 87396dde14..fb72dab463 100644--- a/packages/sdk-components-react/src/box.tsx+++ b/packages/sdk-components-react/src/box.tsx@@ -5,7 +5,7 @@ import {type ComponentProps,} from "react";-const defaultTag = "div";+export const defaultTag = "div";// We don't want to enable all tags because Box is usually a container and we have specific components for many tags.type Props = ComponentProps<typeof defaultTag> & {diff --git a/packages/sdk-components-react/src/components.ts b/packages/sdk-components-react/src/components.tsindex 5c8b27497b..968d92a3f0 100644--- a/packages/sdk-components-react/src/components.ts+++ b/packages/sdk-components-react/src/components.ts@@ -31,3 +31,7 @@ export { RadioButtonField } from "./radio-button-field";export { RadioButton } from "./radio-button";export { CheckboxField } from "./checkbox-field";export { Checkbox } from "./checkbox";+export { Vimeo } from "./vimeo";+export { VimeoPreviewImage } from "./vimeo-preview-image";+export { VimeoPlayButton } from "./vimeo-play-button";+export { VimeoSpinner } from "./vimeo-spinner";diff --git a/packages/sdk-components-react/src/image.ws.tsx b/packages/sdk-components-react/src/image.ws.tsxindex 799e992368..83e3c8573b 100644--- a/packages/sdk-components-react/src/image.ws.tsx+++ b/packages/sdk-components-react/src/image.ws.tsx@@ -40,15 +40,20 @@ export const meta: WsComponentMeta = {// "loader" is our internal prop not intended to show up in the props panelconst { loader, ...publicProps } = props;+// Automatically generated props don't have the right control.+export const propsOverrides = {+ src: {+ type: "string",+ control: "file",+ label: "Source",+ required: false,+ },+} as const;+export const propsMeta: WsComponentPropsMeta = {props: {...publicProps,- src: {- type: "string",- control: "file",- label: "Source",- required: false,- },+ ...propsOverrides,},initialProps: ["src", "width", "height", "alt", "loading"],};diff --git a/packages/sdk-components-react/src/metas.ts b/packages/sdk-components-react/src/metas.tsindex c298689dbd..f749d9d531 100644--- a/packages/sdk-components-react/src/metas.ts+++ b/packages/sdk-components-react/src/metas.ts@@ -31,3 +31,7 @@ export { meta as RadioButtonField } from "./radio-button-field.ws";export { meta as RadioButton } from "./radio-button.ws";export { meta as CheckboxField } from "./checkbox-field.ws";export { meta as Checkbox } from "./checkbox.ws";+export { meta as Vimeo } from "./vimeo.ws";+export { meta as VimeoPreviewImage } from "./vimeo-preview-image.ws";+export { meta as VimeoPlayButton } from "./vimeo-play-button.ws";+export { meta as VimeoSpinner } from "./vimeo-spinner.ws";diff --git a/packages/sdk-components-react/src/props.ts b/packages/sdk-components-react/src/props.tsindex 94b74f5abd..88e8b849bd 100644--- a/packages/sdk-components-react/src/props.ts+++ b/packages/sdk-components-react/src/props.ts@@ -31,3 +31,7 @@ export { propsMeta as RadioButtonField } from "./radio-button-field.ws";export { propsMeta as RadioButton } from "./radio-button.ws";export { propsMeta as CheckboxField } from "./checkbox-field.ws";export { propsMeta as Checkbox } from "./checkbox.ws";+export { propsMeta as Vimeo } from "./vimeo.ws";+export { propsMeta as VimeoPreviewImage } from "./vimeo-preview-image.ws";+export { propsMeta as VimeoPlayButton } from "./vimeo-play-button.ws";+export { propsMeta as VimeoSpinner } from "./vimeo-spinner.ws";diff --git a/packages/sdk-components-react/src/rich-text-link.ws.tsx b/packages/sdk-components-react/src/rich-text-link.ws.tsxindex b9cfa575a5..466ad07323 100644--- a/packages/sdk-components-react/src/rich-text-link.ws.tsx+++ b/packages/sdk-components-react/src/rich-text-link.ws.tsx@@ -4,10 +4,9 @@ import type {} from "@webstudio-is/react-sdk";import { meta as linkMeta, propsMeta as linkPropsMeta } from "./link.ws";-const { category, ...linkMetaRest } = linkMeta;-export const meta: WsComponentMeta = {- ...linkMetaRest,+ ...linkMeta,+ category: "hidden",type: "rich-text-child",template: [],};diff --git a/packages/sdk-components-react/src/vimeo-play-button.stories.tsx b/packages/sdk-components-react/src/vimeo-play-button.stories.tsxnew file mode 100644index 0000000000..f9f0df595c--- /dev/null+++ b/packages/sdk-components-react/src/vimeo-play-button.stories.tsx@@ -0,0 +1,17 @@+import type { ComponentStory, ComponentMeta } from "@storybook/react";+import { VimeoPlayButton as VimeoPlayButtonPrimitive } from "./vimeo-play-button";++export default {+ title: "Components/Vimeo Preview Image",+ component: VimeoPlayButtonPrimitive,+} as ComponentMeta<typeof VimeoPlayButtonPrimitive>;++const Template: ComponentStory<typeof VimeoPlayButtonPrimitive> = (args) => (+ <VimeoPlayButtonPrimitive+ {...args}+ style={{ minHeight: 20, outline: "1px solid black" }}+ />+);++export const VimeoPlayButton = Template.bind({});+VimeoPlayButton.args = {};diff --git a/packages/sdk-components-react/src/vimeo-play-button.tsx b/packages/sdk-components-react/src/vimeo-play-button.tsxnew file mode 100644index 0000000000..76a226a5c7--- /dev/null+++ b/packages/sdk-components-react/src/vimeo-play-button.tsx@@ -0,0 +1,24 @@+import {+ forwardRef,+ type ElementRef,+ type ComponentProps,+ useContext,+} from "react";+import { VimeoContext } from "./vimeo";+import { Button, defaultTag } from "./button";++export { defaultTag };++type Props = ComponentProps<typeof Button>;++export const VimeoPlayButton = forwardRef<ElementRef<typeof defaultTag>, Props>(+ (props, ref) => {+ const vimeoContext = useContext(VimeoContext);+ if (vimeoContext.status !== "initial") {+ return null;+ }+ return <Button {...props} onClick={vimeoContext.onInitPlayer} ref={ref} />;+ }+);++VimeoPlayButton.displayName = "VimeoPlayButton";diff --git a/packages/sdk-components-react/src/vimeo-play-button.ws.ts b/packages/sdk-components-react/src/vimeo-play-button.ws.tsnew file mode 100644index 0000000000..ce4b4937a3--- /dev/null+++ b/packages/sdk-components-react/src/vimeo-play-button.ws.ts@@ -0,0 +1,29 @@+import {+ defaultStates,+ type PresetStyle,+ type WsComponentMeta,+ type WsComponentPropsMeta,+} from "@webstudio-is/react-sdk";+import { props } from "./__generated__/vimeo-play-button.props";+import { ButtonElementIcon } from "@webstudio-is/icons/svg";+import { button } from "@webstudio-is/react-sdk/css-normalize";+import { defaultTag } from "./vimeo-play-button";++const presetStyle = {+ button,+} satisfies PresetStyle<typeof defaultTag>;++export const meta: WsComponentMeta = {+ category: "hidden",+ type: "container",+ invalidAncestors: ["Button"],+ requiredAncestors: ["Vimeo"],+ label: "Play Button",+ icon: ButtonElementIcon,+ presetStyle,+ states: defaultStates,+};++export const propsMeta: WsComponentPropsMeta = {+ props,+};diff --git a/packages/sdk-components-react/src/vimeo-preview-image.stories.tsx b/packages/sdk-components-react/src/vimeo-preview-image.stories.tsxnew file mode 100644index 0000000000..5f889820c0--- /dev/null+++ b/packages/sdk-components-react/src/vimeo-preview-image.stories.tsx@@ -0,0 +1,17 @@+import type { ComponentStory, ComponentMeta } from "@storybook/react";+import { VimeoPreviewImage as VimeoPreviewImagePrimitive } from "./vimeo-preview-image";++export default {+ title: "Components/Vimeo Preview Image",+ component: VimeoPreviewImagePrimitive,+} as ComponentMeta<typeof VimeoPreviewImagePrimitive>;++const Template: ComponentStory<typeof VimeoPreviewImagePrimitive> = (args) => (+ <VimeoPreviewImagePrimitive+ {...args}+ style={{ minHeight: 20, outline: "1px solid black" }}+ />+);++export const VimeoPreviewImage = Template.bind({});+VimeoPreviewImage.args = {};diff --git a/packages/sdk-components-react/src/vimeo-preview-image.tsx b/packages/sdk-components-react/src/vimeo-preview-image.tsxnew file mode 100644index 0000000000..22bf5c60e6--- /dev/null+++ b/packages/sdk-components-react/src/vimeo-preview-image.tsx@@ -0,0 +1,30 @@+import {+ forwardRef,+ type ElementRef,+ type ComponentProps,+ useContext,+} from "react";+import { Image, defaultTag } from "./image";+import { VimeoContext } from "./vimeo";++// Generated using https://png-pixel.com/+const base64Preview = `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkOAMAANIAzr59FiYAAAAASUVORK5CYII=`;++type Props = ComponentProps<typeof Image>;++export const VimeoPreviewImage = forwardRef<+ ElementRef<typeof defaultTag>,+ Props+>(({ src, ...rest }, ref) => {+ const vimeoContext = useContext(VimeoContext);++ return (+ <Image+ {...rest}+ src={String(vimeoContext.previewImageUrl ?? src ?? base64Preview)}+ ref={ref}+ />+ );+});++VimeoPreviewImage.displayName = "VimeoPreviewImage";diff --git a/packages/sdk-components-react/src/vimeo-preview-image.ws.ts b/packages/sdk-components-react/src/vimeo-preview-image.ws.tsnew file mode 100644index 0000000000..bb4524bd0b--- /dev/null+++ b/packages/sdk-components-react/src/vimeo-preview-image.ws.ts@@ -0,0 +1,22 @@+import {+ type WsComponentMeta,+ type WsComponentPropsMeta,+} from "@webstudio-is/react-sdk";+import {+ propsOverrides as imagePropsOverrides,+ propsMeta as imagePropsMeta,+ meta as imageMeta,+} from "./image.ws";+import { props } from "./__generated__/vimeo-preview-image.props";++export const meta: WsComponentMeta = {+ ...imageMeta,+ category: "hidden",+ label: "Preview Image",+ requiredAncestors: ["Vimeo"],+};++export const propsMeta: WsComponentPropsMeta = {+ props: { ...props, ...imagePropsOverrides },+ initialProps: imagePropsMeta.initialProps,+};diff --git a/packages/sdk-components-react/src/vimeo-spinner.stories.tsx b/packages/sdk-components-react/src/vimeo-spinner.stories.tsxnew file mode 100644index 0000000000..e290ad0c2f--- /dev/null+++ b/packages/sdk-components-react/src/vimeo-spinner.stories.tsx@@ -0,0 +1,17 @@+import type { ComponentStory, ComponentMeta } from "@storybook/react";+import { VimeoSpinner as VimeoSpinnerPrimitive } from "./vimeo-spinner";++export default {+ title: "Components/Vimeo Preview Image",+ component: VimeoSpinnerPrimitive,+} as ComponentMeta<typeof VimeoSpinnerPrimitive>;++const Template: ComponentStory<typeof VimeoSpinnerPrimitive> = (args) => (+ <VimeoSpinnerPrimitive+ {...args}+ style={{ minHeight: 20, outline: "1px solid black" }}+ />+);++export const VimeoSpinner = Template.bind({});+VimeoSpinner.args = {};diff --git a/packages/sdk-components-react/src/vimeo-spinner.tsx b/packages/sdk-components-react/src/vimeo-spinner.tsxnew file mode 100644index 0000000000..3385cc8ad0--- /dev/null+++ b/packages/sdk-components-react/src/vimeo-spinner.tsx@@ -0,0 +1,25 @@+import {+ forwardRef,+ type ElementRef,+ type ComponentProps,+ useContext,+} from "react";+import { VimeoContext } from "./vimeo";++const defaultTag = "div";++type Props = ComponentProps<typeof defaultTag>;++export const VimeoSpinner = forwardRef<ElementRef<typeof defaultTag>, Props>(+ (props, ref) => {+ const vimeoContext = useContext(VimeoContext);++ if (vimeoContext.status !== "initialized") {+ return null;+ }++ return <div {...props} ref={ref} />;+ }+);++VimeoSpinner.displayName = "VimeoSpinner";diff --git a/packages/sdk-components-react/src/vimeo-spinner.ws.ts b/packages/sdk-components-react/src/vimeo-spinner.ws.tsnew file mode 100644index 0000000000..40764f96a3--- /dev/null+++ b/packages/sdk-components-react/src/vimeo-spinner.ws.ts@@ -0,0 +1,27 @@+import {+ defaultStates,+ type PresetStyle,+ type WsComponentMeta,+ type WsComponentPropsMeta,+} from "@webstudio-is/react-sdk";+import { props } from "./__generated__/vimeo-spinner.props";+import { div } from "@webstudio-is/react-sdk/css-normalize";+import { BoxIcon } from "@webstudio-is/icons/svg";++const presetStyle = {+ div,+} satisfies PresetStyle<"div">;++export const meta: WsComponentMeta = {+ type: "container",+ icon: BoxIcon,+ states: defaultStates,+ presetStyle,+ category: "hidden",+ label: "Spinner",+ requiredAncestors: ["Vimeo"],+};++export const propsMeta: WsComponentPropsMeta = {+ props,+};diff --git a/packages/sdk-components-react/src/vimeo.stories.tsx b/packages/sdk-components-react/src/vimeo.stories.tsxnew file mode 100644index 0000000000..bc3fb4c7f1--- /dev/null+++ b/packages/sdk-components-react/src/vimeo.stories.tsx@@ -0,0 +1,17 @@+import type { ComponentStory, ComponentMeta } from "@storybook/react";+import { Vimeo as VimeoPrimitive } from "./vimeo";++export default {+ title: "Components/Vimeo",+ component: VimeoPrimitive,+} as ComponentMeta<typeof VimeoPrimitive>;++const Template: ComponentStory<typeof VimeoPrimitive> = (args) => (+ <VimeoPrimitive+ {...args}+ style={{ minHeight: 20, outline: "1px solid black" }}+ />+);++export const Vimeo = Template.bind({});+Vimeo.args = {};diff --git a/packages/sdk-components-react/src/vimeo.tsx b/packages/sdk-components-react/src/vimeo.tsxnew file mode 100644index 0000000000..ff56b1f236--- /dev/null+++ b/packages/sdk-components-react/src/vimeo.tsx@@ -0,0 +1,430 @@+// Many implementation ideas came from+// https://github.com/slightlyoff/lite-vimeo+// Main reasons to not use it as is:+// - we don't want to render player by default+// - we want to expose Webstudio components to the user for customization++import { colord } from "colord";+import {+ forwardRef,+ useState,+ useRef,+ useEffect,+ type ElementRef,+ type ComponentProps,+ useContext,+ createContext,+ type ContextType,+ useMemo,+} from "react";+import { ReactSdkContext } from "@webstudio-is/react-sdk";+import { shallowEqual } from "shallow-equal";++const defaultTag = "div";++// https://developer.vimeo.com/player/sdk/embed+type VimeoPlayerOptions = {+ background?: boolean;+ color?: string;+ controls?: boolean;+ dnt?: boolean;+ interactive_params?: string;+ title?: boolean;+ portrait?: boolean;+ // @todo url type to validate url on the input+ /** The ID or the URL of the video on Vimeo. You must supply one of these values to identify the video. When the video's privacy setting is Private, you must use the URL, and the URL must include the h parameter. For more information, see our introductory guide. */+ url?: string;+ /** Whether to pause the current video when another Vimeo video on the same page starts to play. Set this value to false to permit simultaneous playback of all the videos on the page. This option has no effect if you've disabled cookies in your browser, either through browser settings or with an extension or plugin. */+ autopause?: boolean;+ /** Whether to enable the browser to enter picture-in-picture mode automatically when switching tabs or windows, where supported. */+ autopip?: boolean;+ /** Whether to start playback of the video automatically. This feature might not work on all devices. */+ autoplay?: boolean;+ /** Whether to display the video owner's name. */+ byline?: boolean;+ /** Whether to enable keyboard input to trigger player events. This setting doesn't affect tab control. */+ keyboard?: boolean;+ /** Whether to restart the video automatically after reaching the end. */+ loop?: boolean;+ /** Whether the video is muted upon loading. The true value is required for the autoplay behavior in some browsers. */+ muted?: boolean;+ /** Whether to include the picture-in-picture button among the player controls and enable the picture-in-picture API. */+ pip?: boolean;+ /** Whether the video plays inline on supported mobile devices. To force the device to play the video in fullscreen mode instead, set this value to false. */+ playsinline?: boolean;+ /** For videos on a Vimeo Plus account or higher: the playback quality of the video. Use auto for the best possible quality given available bandwidth and other factors. You can also specify 360p, 540p, 720p, 1080p, 2k, and 4k. */+ quality?: "auto" | "360p" | "540p" | "720p" | "1080p" | "2k" | "4k";+ /** Whether to return a responsive embed code, or one that provides intelligent adjustments based on viewing conditions. We recommend this option for mobile-optimized sites. */+ responsive?: boolean;+ /** Whether the player displays speed controls in the preferences menu and enables the playback rate API. */+ speed?: boolean;+ /**+ * The text track to display with the video. Specify the text track by its language code (en), the language code and locale (en-US), or the language code and kind (en.captions). For this argument to work, the video must already have a text track of the given type; see our Help Center or Working with Text Track Uploads for more information.+ * To enable automatically generated closed captions instead, provide the value en-x-autogen. Please note that, at the present time, automatic captions are always in English.+ */+ texttrack?: string;+ /** Whether the responsive player and transparent background are enabled. */+ transparent?: boolean;+};++const getUrl = (options: VimeoPlayerOptions) => {+ if (options.url === undefined) {+ return;+ }+ let url;+ try {+ const userUrl = new URL(options.url);+ url = new URL(IFRAME_CDN);+ url.pathname = `/video${userUrl.pathname}`;+ // eslint-disable-next-line no-empty+ } catch {}++ if (url === undefined) {+ return;+ }++ let option: keyof VimeoPlayerOptions;+ for (option in options) {+ const value = options[option];+ if (option === "url" || value === undefined) {+ continue;+ }+ url.searchParams.append(option, value.toString());+ }++ // We always set autoplay to true because we have a button that starts the video+ url.searchParams.set("autoplay", "true");++ // Vimeo needs a hex color value without the hash+ if (typeof options.color === "string") {+ const color = colord(options.color).toHex().replace("#", "");+ url.searchParams.set("color", color);+ }++ // Portrait option won't work if at title is not set to true+ if (options.portrait) {+ url.searchParams.set("title", "true");+ }+ // Byline won't show up if portrait and title is not set to true+ if (options.byline) {+ url.searchParams.set("portrait", "true");+ url.searchParams.set("title", "true");+ }++ return url.toString();+};++const preconnect = (url: string) => {+ const link = document.createElement("link");+ link.rel = "preconnect";+ link.href = url;+ link.crossOrigin = "true";+ document.head.append(link);+};++let warmed = false;++// Host that Vimeo uses to serve JS needed by player+const PLAYER_CDN = "https://f.vimeocdn.com";+// The iframe document comes from player.vimeo.com+const IFRAME_CDN = "https://player.vimeo.com";+// Image for placeholder comes from i.vimeocdn.com+const IMAGE_CDN = "https://i.vimeocdn.com";++const warmConnections = () => {+ if (warmed) {+ return;+ }+ preconnect(PLAYER_CDN);+ preconnect(IFRAME_CDN);+ preconnect(IMAGE_CDN);+ warmed = true;+};++const createPlayer = (+ parent: Element,+ options: VimeoPlayerOptions,+ callback: () => void+) => {+ const url = getUrl(options);+ if (url === undefined) {+ return;+ }+ const iframe = document.createElement("iframe");+ iframe.setAttribute(+ "allow",+ "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture;"+ );+ iframe.setAttribute("frameborder", "0");+ iframe.setAttribute("allowfullscreen", "true");+ iframe.setAttribute("src", url);+ iframe.setAttribute(+ "style",+ "position: absolute; width: 100%; height: 100%; opacity: 0; transition: opacity 1s;"+ );++ // Show iframe only once it's loaded to avoid weird flashes.+ iframe.addEventListener(+ "load",+ () => {+ iframe.style.opacity = "1";+ callback();+ },+ { once: true }+ );+ parent.appendChild(iframe);++ return () => {+ iframe.parentElement?.removeChild(iframe);+ };+};++const getVideoId = (url: string) => {+ try {+ const parsedUrl = new URL(url);+ const id = parsedUrl.pathname.split("/")[1];+ if (id === "" || id == null) {+ return;+ }+ return id;+ // eslint-disable-next-line no-empty+ } catch {}+};++const loadPreviewImage = async (element: HTMLElement, videoUrl: string) => {+ const videoId = getVideoId(videoUrl);+ // API is the video-id based+ // http://vimeo.com/api/v2/video/364402896.json+ const apiUrl = `https://vimeo.com/api/v2/video/${videoId}.json`;++ // Now fetch the JSON that locates our placeholder from vimeo's JSON API+ const response = (await (await fetch(apiUrl)).json())[0];++ // Extract the image id, e.g. 819916979, from a URL like:+ // thumbnail_large: "https://i.vimeocdn.com/video/819916979_640.jpg"+ const thumbnail = response.thumbnail_large;+ const imgId = thumbnail.substr(thumbnail.lastIndexOf("/") + 1).split("_")[0];++ const imageUrl = new URL(IMAGE_CDN);+ imageUrl.pathname = `/video/${imgId}.webp`;+ imageUrl.searchParams.append("mw", "1100");+ imageUrl.searchParams.append("mh", "619");+ imageUrl.searchParams.append("q", "70");+ return imageUrl;+};++type PlayerStatus = "initial" | "initialized" | "ready";++const useVimeo = ({+ options,+ renderer,+ showPreview,+}: {+ options: VimeoPlayerOptions;+ showPreview?: boolean;+ renderer: ContextType<typeof ReactSdkContext>["renderer"];+}) => {+ const [playerStatus, setPlayerStatus] = useState<PlayerStatus>("initial");+ const elementRef = useRef<ElementRef<typeof defaultTag> | null>(null);+ const [previewImageUrl, setPreviewImageUrl] = useState<URL>();++ useEffect(() => {+ setPlayerStatus(+ options.autoplay && renderer !== "canvas" ? "initialized" : "initial"+ );+ }, [options.autoplay, renderer]);++ useEffect(() => {+ if (+ elementRef.current === null ||+ playerStatus === "ready" ||+ options.url === undefined+ ) {+ return;+ }+ if (showPreview) {+ loadPreviewImage(elementRef.current, options.url).then(+ setPreviewImageUrl+ );+ return;+ }+ setPreviewImageUrl(undefined);+ }, [renderer, showPreview, options.url, playerStatus]);++ const optionsRef = useRef(options);+ const stableOptions = useMemo(() => {+ if (shallowEqual(options, optionsRef.current) === false) {+ optionsRef.current = options;+ }+ return optionsRef.current;+ }, [options]);++ useEffect(() => {+ if (elementRef.current === null || playerStatus === "initial") {+ return;+ }+ return createPlayer(elementRef.current, stableOptions, () => {+ setPlayerStatus("ready");+ });+ }, [stableOptions, playerStatus]);+ return { previewImageUrl, playerStatus, setPlayerStatus, elementRef };+};++export type VimeoOptions = Omit<+ VimeoPlayerOptions,+ | "dnt"+ | "interactive_params"+ | "background"+ | "controls"+ | "color"+ | "byline"+ | "title"+ | "portrait"+> & {+ /** Whether the preview image should be loaded from Vimeo API. Ideally don't use it, because it will show up with some delay and will make your site feel slower. */+ showPreview?: boolean;+ /** Whether to prevent the player from tracking session data, including cookies. Keep in mind that setting this argument to true also blocks video stats. */+ doNotTrack?: VimeoPlayerOptions["dnt"];+ /** Key-value pairs representing dynamic parameters that are utilized on interactive videos with live elements, such as title=my-video,subtitle=interactive. */+ interactiveParams?: VimeoPlayerOptions["interactive_params"];+ /** Whether the player is in background mode, which hides the playback controls, enables autoplay, and loops the video. */+ backgroundMode?: VimeoPlayerOptions["background"];+ /** Whether to display the player's interactive elements, including the play bar and sharing buttons. Set this option to false for a chromeless experience. To control playback when the play/pause button is hidden, set autoplay to true, use keyboard controls (which remain active), or implement our player SDK. */+ showControls?: VimeoPlayerOptions["controls"];+ // @todo use color type to use color control+ /** A color value of the playback controls, which is normally #00ADEF. The embed settings of the video might override this value. */+ controlsColor?: VimeoPlayerOptions["color"];+ /** Whether to display the video owner's name. */+ showByline?: VimeoPlayerOptions["byline"];+ /** Whether the player displays the title overlay. */+ showTitle?: VimeoPlayerOptions["title"];+ /** Whether to display the video owner's portrait. Only works if either title or byline are also enabled */+ showPortrait?: VimeoPlayerOptions["portrait"];+};++type Props = Omit<ComponentProps<typeof defaultTag>, keyof VimeoOptions> &+ VimeoOptions;+type Ref = ElementRef<typeof defaultTag>;++export const Vimeo = forwardRef<Ref, Props>(+ (+ {+ url,+ autoplay = false,+ autopause = true,+ backgroundMode = false,+ showByline = false,+ showControls = true,+ doNotTrack = false,+ keyboard = true,+ loop = false,+ muted = false,+ pip = false,+ playsinline = true,+ showPortrait = true,+ quality = "auto",+ responsive = true,+ speed = false,+ showTitle = false,+ transparent = true,+ showPreview = false,+ autopip,+ controlsColor,+ interactiveParams,+ texttrack,+ children,+ ...rest+ },+ ref+ ) => {+ const { renderer } = useContext(ReactSdkContext);+ const { previewImageUrl, playerStatus, setPlayerStatus, elementRef } =+ useVimeo({+ renderer,+ showPreview,+ options: {+ url,+ autoplay,+ autopause,+ keyboard,+ loop,+ muted,+ pip,+ playsinline,+ quality,+ responsive,+ speed,+ transparent,+ portrait: showPortrait,+ byline: showByline,+ title: showTitle,+ color: controlsColor,+ controls: showControls,+ interactive_params: interactiveParams,+ background: backgroundMode,+ dnt: doNotTrack,+ },+ });++ return (+ <VimeoContext.Provider+ value={{+ status: playerStatus,+ previewImageUrl,+ onInitPlayer() {+ if (renderer !== "canvas") {+ setPlayerStatus("initialized");+ }+ },+ }}+ >+ <div+ {...rest}+ ref={(value: Ref) => {+ elementRef.current = value;+ if (ref !== null) {+ typeof ref === "function" ? ref(value) : (ref.current = value);+ }+ }}+ onPointerOver={() => {+ if (renderer !== "canvas") {+ warmConnections();+ }+ }}+ >+ {url === undefined ? <EmptyState /> : children}+ </div>+ </VimeoContext.Provider>+ );+ }+);++Vimeo.displayName = "Vimeo";++const EmptyState = () => {+ return (+ <div+ style={{+ display: "flex",+ width: "100%",+ height: "100%",+ alignItems: "center",+ justifyContent: "center",+ fontSize: "1.2em",+ }}+ >+ Open the Properties panel and paste a video URL, e.g.+ https://vimeo.com/831343124.+ </div>+ );+};++export const VimeoContext = createContext<{+ previewImageUrl?: URL;+ onInitPlayer: () => void;+ status: PlayerStatus;+}>({+ // eslint-disable-next-line @typescript-eslint/no-empty-function+ onInitPlayer: () => {},+ status: "initial",+});diff --git a/packages/sdk-components-react/src/vimeo.ws.ts b/packages/sdk-components-react/src/vimeo.ws.tsnew file mode 100644index 0000000000..24cb98e92d--- /dev/null+++ b/packages/sdk-components-react/src/vimeo.ws.ts@@ -0,0 +1,326 @@+import { PlayIcon, SpinnerIcon, VimeoIcon } from "@webstudio-is/icons/svg";+import {+ defaultStates,+ type PresetStyle,+ type WsComponentMeta,+ type WsComponentPropsMeta,+} from "@webstudio-is/react-sdk";+import { div } from "@webstudio-is/react-sdk/css-normalize";+import { props } from "./__generated__/vimeo.props";+import { type VimeoOptions } from "./vimeo";++const presetStyle = {+ div,+} satisfies PresetStyle<"div">;++export const meta: WsComponentMeta = {+ category: "media",+ type: "container",+ label: "Vimeo",+ order: 1,+ icon: VimeoIcon,+ states: defaultStates,+ presetStyle,+ template: [+ {+ type: "instance",+ component: "Vimeo",+ styles: [+ {+ property: "position",+ value: { type: "keyword", value: "relative" },+ },+ {+ property: "aspectRatio",+ value: { type: "keyword", value: "640/360" },+ },+ {+ property: "width",+ value: { type: "unit", value: 100, unit: "%" },+ },+ ],+ children: [+ {+ type: "instance",+ component: "VimeoPreviewImage",+ styles: [+ {+ property: "position",+ value: { type: "keyword", value: "absolute" },+ },+ {+ property: "objectPosition",+ value: { type: "keyword", value: "cover" },+ },+ {+ property: "width",+ value: { type: "unit", value: 100, unit: "%" },+ },+ {+ property: "height",+ value: { type: "unit", value: 100, unit: "%" },+ },+ {+ property: "borderTopLeftRadius",+ value: { type: "unit", value: 20, unit: "px" },+ },+ {+ property: "borderTopRightRadius",+ value: { type: "unit", value: 20, unit: "px" },+ },+ {+ property: "borderBottomLeftRadius",+ value: { type: "unit", value: 20, unit: "px" },+ },+ {+ property: "borderBottomRightRadius",+ value: { type: "unit", value: 20, unit: "px" },+ },+ {+ property: "objectPosition",+ value: { type: "keyword", value: "cover" },+ },+ ],+ children: [],+ props: [+ {+ type: "string",+ name: "alt",+ value: "Vimeo video preview image",+ },+ ],+ },+ {+ type: "instance",+ component: "Box",+ label: "Spinner",+ styles: [+ {+ property: "position",+ value: { type: "keyword", value: "absolute" },+ },+ {+ property: "top",+ value: { type: "unit", value: 50, unit: "%" },+ },+ {+ property: "left",+ value: { type: "unit", value: 50, unit: "%" },+ },+ {+ property: "width",+ value: { type: "unit", value: 70, unit: "px" },+ },+ {+ property: "height",+ value: { type: "unit", value: 70, unit: "px" },+ },+ {+ property: "marginTop",+ value: { type: "unit", value: -35, unit: "px" },+ },+ {+ property: "marginLeft",+ value: { type: "unit", value: -35, unit: "px" },+ },+ ],+ children: [+ {+ type: "instance",+ component: "HtmlEmbed",+ label: "Spinner SVG",+ props: [+ {+ type: "string",+ name: "code",+ value: SpinnerIcon,+ },+ ],+ children: [],+ },+ ],+ },+ {+ type: "instance",+ component: "VimeoPlayButton",+ props: [+ {+ type: "string",+ name: "aria-label",+ value: "Play button",+ },+ ],+ styles: [+ {+ property: "position",+ value: { type: "keyword", value: "absolute" },+ },+ {+ property: "width",+ value: { type: "unit", value: 140, unit: "px" },+ },+ {+ property: "height",+ value: { type: "unit", value: 80, unit: "px" },+ },+ {+ property: "top",+ value: { type: "unit", value: 50, unit: "%" },+ },+ {+ property: "left",+ value: { type: "unit", value: 50, unit: "%" },+ },+ {+ property: "marginTop",+ value: { type: "unit", value: -40, unit: "px" },+ },+ {+ property: "marginLeft",+ value: { type: "unit", value: -70, unit: "px" },+ },+ {+ property: "display",+ value: { type: "keyword", value: "flex" },+ },+ {+ property: "alignItems",+ value: { type: "keyword", value: "center" },+ },+ {+ property: "justifyContent",+ value: { type: "keyword", value: "center" },+ },+ {+ property: "borderTopStyle",+ value: { type: "keyword", value: "none" },+ },+ {+ property: "borderRightStyle",+ value: { type: "keyword", value: "none" },+ },+ {+ property: "borderBottomStyle",+ value: { type: "keyword", value: "none" },+ },+ {+ property: "borderLeftStyle",+ value: { type: "keyword", value: "none" },+ },+ {+ property: "borderTopLeftRadius",+ value: { type: "unit", value: 5, unit: "px" },+ },+ {+ property: "borderTopRightRadius",+ value: { type: "unit", value: 5, unit: "px" },+ },+ {+ property: "borderBottomLeftRadius",+ value: { type: "unit", value: 5, unit: "px" },+ },+ {+ property: "borderBottomRightRadius",+ value: { type: "unit", value: 5, unit: "px" },+ },+ {+ property: "cursor",+ value: { type: "keyword", value: "pointer" },+ },+ {+ property: "backgroundColor",+ value: {+ type: "rgb",+ r: 18,+ g: 18,+ b: 18,+ alpha: 1,+ },+ },+ {+ property: "color",+ value: {+ type: "rgb",+ r: 255,+ g: 255,+ b: 255,+ alpha: 1,+ },+ },+ {+ state: ":hover",+ property: "backgroundColor",+ value: {+ type: "rgb",+ r: 0,+ g: 173,+ b: 239,+ alpha: 1,+ },+ },+ ],+ children: [+ {+ type: "instance",+ component: "Box",+ label: "Play Icon",+ styles: [+ {+ property: "width",+ value: { type: "unit", value: 60, unit: "px" },+ },+ {+ property: "height",+ value: { type: "unit", value: 60, unit: "px" },+ },+ ],+ props: [+ {+ type: "string",+ name: "aria-hidden",+ value: "true",+ },+ ],+ children: [+ {+ type: "instance",+ component: "HtmlEmbed",+ label: "Play SVG",+ props: [+ {+ type: "string",+ name: "code",+ value: PlayIcon,+ },+ ],+ children: [],+ },+ ],+ },+ ],+ },+ ],+ },+ ],+};++const initialProps: Array<keyof VimeoOptions> = [+ "url",+ "quality",+ "showPreview",+ "autoplay",+ "backgroundMode",+ "doNotTrack",+ "loop",+ "muted",+ "showPortrait",+ "showByline",+ "showTitle",+ "showControls",+ "controlsColor",+];++export const propsMeta: WsComponentPropsMeta = {+ props,+ initialProps,+};diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 331ccac686..6e44f04c04 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -1333,6 +1333,12 @@ importers:'@webstudio-is/react-sdk':specifier: workspace:^version: link:../react-sdk+ colord:+ specifier: ^2.9.3+ version: 2.9.3+ shallow-equal:+ specifier: ^3.1.0+ version: 3.1.0devDependencies:'@storybook/react':specifier: ^6.5.16