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
feat: Add head component (#4751)
Ivan Starkov42af9210934f
diff --git a/.github/workflows/main.yml b/.github/workflows/main.ymlindex 05db16fee8..3cbe0e7ad5 100644--- a/.github/workflows/main.yml+++ b/.github/workflows/main.yml@@ -85,7 +85,7 @@ jobs:const results = [await assertSize('./fixtures/ssg/dist/client', 352),await assertSize('./fixtures/webstudio-remix-netlify-functions/build/client', 440),- await assertSize('./fixtures/webstudio-remix-vercel/build/client', 908),+ await assertSize('./fixtures/webstudio-remix-vercel/build/client', 926),]for (const result of results) {if (result.passed) {diff --git a/apps/builder/app/builder/features/components/components.tsx b/apps/builder/app/builder/features/components/components.tsxindex 2aae750aaf..96221709be 100644--- a/apps/builder/app/builder/features/components/components.tsx+++ b/apps/builder/app/builder/features/components/components.tsx@@ -61,6 +61,14 @@ const $metas = computed(for (const [name, componentMeta] of componentMetas) {// only set available components from component metaavailableComponents.add(name);++ if (+ isFeatureEnabled("headSlotComponent") === false &&+ name === "HeadSlot"+ ) {+ continue;+ }+metas.push({name,category: componentMeta.category ?? "hidden",diff --git a/fixtures/webstudio-cloudflare-template/app/routes/[another-page]._index.tsx b/fixtures/webstudio-cloudflare-template/app/routes/[another-page]._index.tsxindex c4fca377af..5cbf8d8ab9 100644--- a/fixtures/webstudio-cloudflare-template/app/routes/[another-page]._index.tsx+++ b/fixtures/webstudio-cloudflare-template/app/routes/[another-page]._index.tsx@@ -16,7 +16,10 @@ import {formIdFieldName,formBotFieldName,} from "@webstudio-is/sdk/runtime";-import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";+import {+ ReactSdkContext,+ PageSettingsMeta,+} from "@webstudio-is/react-sdk/runtime";import {Page,siteName,@@ -117,33 +120,15 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {if (data === undefined) {return metas;}- const { pageMeta } = data;- if (data.url) {- metas.push({- property: "og:url",- content: data.url,- });- }+ const { pageMeta } = data;+ const origin = `https://${data.host}`;if (pageMeta.title) {metas.push({ title: pageMeta.title });-- metas.push({- property: "og:title",- content: pageMeta.title,- });}- metas.push({ property: "og:type", content: "website" });-- const origin = `https://${data.host}`;-if (siteName) {- metas.push({- property: "og:site_name",- content: siteName,- });metas.push({"script:ld+json": {"@context": "https://schema.org",@@ -154,42 +139,6 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (pageMeta.excludePageFromSearch) {- metas.push({- name: "robots",- content: "noindex, nofollow",- });- }-- if (pageMeta.description) {- metas.push({- name: "description",- content: pageMeta.description,- });- metas.push({- property: "og:description",- content: pageMeta.description,- });- }-- if (pageMeta.socialImageAssetName) {- metas.push({- property: "og:image",- content: `https://${data.host}${imageLoader({- src: pageMeta.socialImageAssetName,- // Do not transform social image (not enough information do we need to do this)- format: "raw",- })}`,- });- } else if (pageMeta.socialImageUrl) {- metas.push({- property: "og:image",- content: pageMeta.socialImageUrl,- });- }-- metas.push(...pageMeta.custom);-return metas;};@@ -323,7 +272,8 @@ export const action = async ({};const Outlet = () => {- const { system, resources, url } = useLoaderData<typeof loader>();+ const { system, resources, url, pageMeta, host } =+ useLoaderData<typeof loader>();return (<ReactSdkContext.Providervalue={{@@ -334,6 +284,13 @@ const Outlet = () => {>{/* Use the URL as the key to force scripts in HTML Embed to reload on dynamic pages */}<Page key={url} system={system} />+ <PageSettingsMeta+ url={url}+ pageMeta={pageMeta}+ host={host}+ siteName={siteName}+ imageLoader={imageLoader}+ /></ReactSdkContext.Provider>);};diff --git a/fixtures/webstudio-cloudflare-template/app/routes/_index.tsx b/fixtures/webstudio-cloudflare-template/app/routes/_index.tsxindex 66ad6094c1..7a204fa27b 100644--- a/fixtures/webstudio-cloudflare-template/app/routes/_index.tsx+++ b/fixtures/webstudio-cloudflare-template/app/routes/_index.tsx@@ -16,7 +16,10 @@ import {formIdFieldName,formBotFieldName,} from "@webstudio-is/sdk/runtime";-import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";+import {+ ReactSdkContext,+ PageSettingsMeta,+} from "@webstudio-is/react-sdk/runtime";import {Page,siteName,@@ -117,33 +120,15 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {if (data === undefined) {return metas;}- const { pageMeta } = data;- if (data.url) {- metas.push({- property: "og:url",- content: data.url,- });- }+ const { pageMeta } = data;+ const origin = `https://${data.host}`;if (pageMeta.title) {metas.push({ title: pageMeta.title });-- metas.push({- property: "og:title",- content: pageMeta.title,- });}- metas.push({ property: "og:type", content: "website" });-- const origin = `https://${data.host}`;-if (siteName) {- metas.push({- property: "og:site_name",- content: siteName,- });metas.push({"script:ld+json": {"@context": "https://schema.org",@@ -154,42 +139,6 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (pageMeta.excludePageFromSearch) {- metas.push({- name: "robots",- content: "noindex, nofollow",- });- }-- if (pageMeta.description) {- metas.push({- name: "description",- content: pageMeta.description,- });- metas.push({- property: "og:description",- content: pageMeta.description,- });- }-- if (pageMeta.socialImageAssetName) {- metas.push({- property: "og:image",- content: `https://${data.host}${imageLoader({- src: pageMeta.socialImageAssetName,- // Do not transform social image (not enough information do we need to do this)- format: "raw",- })}`,- });- } else if (pageMeta.socialImageUrl) {- metas.push({- property: "og:image",- content: pageMeta.socialImageUrl,- });- }-- metas.push(...pageMeta.custom);-return metas;};@@ -323,7 +272,8 @@ export const action = async ({};const Outlet = () => {- const { system, resources, url } = useLoaderData<typeof loader>();+ const { system, resources, url, pageMeta, host } =+ useLoaderData<typeof loader>();return (<ReactSdkContext.Providervalue={{@@ -334,6 +284,13 @@ const Outlet = () => {>{/* Use the URL as the key to force scripts in HTML Embed to reload on dynamic pages */}<Page key={url} system={system} />+ <PageSettingsMeta+ url={url}+ pageMeta={pageMeta}+ host={host}+ siteName={siteName}+ imageLoader={imageLoader}+ /></ReactSdkContext.Provider>);};diff --git a/fixtures/webstudio-custom-template/app/routes/[script-test]._index.tsx b/fixtures/webstudio-custom-template/app/routes/[script-test]._index.tsxindex 4f9802a306..79c59d4627 100644--- a/fixtures/webstudio-custom-template/app/routes/[script-test]._index.tsx+++ b/fixtures/webstudio-custom-template/app/routes/[script-test]._index.tsx@@ -16,7 +16,10 @@ import {formIdFieldName,formBotFieldName,} from "@webstudio-is/sdk/runtime";-import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";+import {+ ReactSdkContext,+ PageSettingsMeta,+} from "@webstudio-is/react-sdk/runtime";import {Page,siteName,@@ -117,33 +120,15 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {if (data === undefined) {return metas;}- const { pageMeta } = data;- if (data.url) {- metas.push({- property: "og:url",- content: data.url,- });- }+ const { pageMeta } = data;+ const origin = `https://${data.host}`;if (pageMeta.title) {metas.push({ title: pageMeta.title });-- metas.push({- property: "og:title",- content: pageMeta.title,- });}- metas.push({ property: "og:type", content: "website" });-- const origin = `https://${data.host}`;-if (siteName) {- metas.push({- property: "og:site_name",- content: siteName,- });metas.push({"script:ld+json": {"@context": "https://schema.org",@@ -154,42 +139,6 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (pageMeta.excludePageFromSearch) {- metas.push({- name: "robots",- content: "noindex, nofollow",- });- }-- if (pageMeta.description) {- metas.push({- name: "description",- content: pageMeta.description,- });- metas.push({- property: "og:description",- content: pageMeta.description,- });- }-- if (pageMeta.socialImageAssetName) {- metas.push({- property: "og:image",- content: `https://${data.host}${imageLoader({- src: pageMeta.socialImageAssetName,- // Do not transform social image (not enough information do we need to do this)- format: "raw",- })}`,- });- } else if (pageMeta.socialImageUrl) {- metas.push({- property: "og:image",- content: pageMeta.socialImageUrl,- });- }-- metas.push(...pageMeta.custom);-return metas;};@@ -323,7 +272,8 @@ export const action = async ({};const Outlet = () => {- const { system, resources, url } = useLoaderData<typeof loader>();+ const { system, resources, url, pageMeta, host } =+ useLoaderData<typeof loader>();return (<ReactSdkContext.Providervalue={{@@ -334,6 +284,13 @@ const Outlet = () => {>{/* Use the URL as the key to force scripts in HTML Embed to reload on dynamic pages */}<Page key={url} system={system} />+ <PageSettingsMeta+ url={url}+ pageMeta={pageMeta}+ host={host}+ siteName={siteName}+ imageLoader={imageLoader}+ /></ReactSdkContext.Provider>);};diff --git a/fixtures/webstudio-custom-template/app/routes/[world]._index.tsx b/fixtures/webstudio-custom-template/app/routes/[world]._index.tsxindex 7327e076c7..982d22ada9 100644--- a/fixtures/webstudio-custom-template/app/routes/[world]._index.tsx+++ b/fixtures/webstudio-custom-template/app/routes/[world]._index.tsx@@ -16,7 +16,10 @@ import {formIdFieldName,formBotFieldName,} from "@webstudio-is/sdk/runtime";-import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";+import {+ ReactSdkContext,+ PageSettingsMeta,+} from "@webstudio-is/react-sdk/runtime";import {Page,siteName,@@ -117,33 +120,15 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {if (data === undefined) {return metas;}- const { pageMeta } = data;- if (data.url) {- metas.push({- property: "og:url",- content: data.url,- });- }+ const { pageMeta } = data;+ const origin = `https://${data.host}`;if (pageMeta.title) {metas.push({ title: pageMeta.title });-- metas.push({- property: "og:title",- content: pageMeta.title,- });}- metas.push({ property: "og:type", content: "website" });-- const origin = `https://${data.host}`;-if (siteName) {- metas.push({- property: "og:site_name",- content: siteName,- });metas.push({"script:ld+json": {"@context": "https://schema.org",@@ -154,42 +139,6 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (pageMeta.excludePageFromSearch) {- metas.push({- name: "robots",- content: "noindex, nofollow",- });- }-- if (pageMeta.description) {- metas.push({- name: "description",- content: pageMeta.description,- });- metas.push({- property: "og:description",- content: pageMeta.description,- });- }-- if (pageMeta.socialImageAssetName) {- metas.push({- property: "og:image",- content: `https://${data.host}${imageLoader({- src: pageMeta.socialImageAssetName,- // Do not transform social image (not enough information do we need to do this)- format: "raw",- })}`,- });- } else if (pageMeta.socialImageUrl) {- metas.push({- property: "og:image",- content: pageMeta.socialImageUrl,- });- }-- metas.push(...pageMeta.custom);-return metas;};@@ -323,7 +272,8 @@ export const action = async ({};const Outlet = () => {- const { system, resources, url } = useLoaderData<typeof loader>();+ const { system, resources, url, pageMeta, host } =+ useLoaderData<typeof loader>();return (<ReactSdkContext.Providervalue={{@@ -334,6 +284,13 @@ const Outlet = () => {>{/* Use the URL as the key to force scripts in HTML Embed to reload on dynamic pages */}<Page key={url} system={system} />+ <PageSettingsMeta+ url={url}+ pageMeta={pageMeta}+ host={host}+ siteName={siteName}+ imageLoader={imageLoader}+ /></ReactSdkContext.Provider>);};diff --git a/fixtures/webstudio-custom-template/app/routes/_index.tsx b/fixtures/webstudio-custom-template/app/routes/_index.tsxindex 66ad6094c1..7a204fa27b 100644--- a/fixtures/webstudio-custom-template/app/routes/_index.tsx+++ b/fixtures/webstudio-custom-template/app/routes/_index.tsx@@ -16,7 +16,10 @@ import {formIdFieldName,formBotFieldName,} from "@webstudio-is/sdk/runtime";-import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";+import {+ ReactSdkContext,+ PageSettingsMeta,+} from "@webstudio-is/react-sdk/runtime";import {Page,siteName,@@ -117,33 +120,15 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {if (data === undefined) {return metas;}- const { pageMeta } = data;- if (data.url) {- metas.push({- property: "og:url",- content: data.url,- });- }+ const { pageMeta } = data;+ const origin = `https://${data.host}`;if (pageMeta.title) {metas.push({ title: pageMeta.title });-- metas.push({- property: "og:title",- content: pageMeta.title,- });}- metas.push({ property: "og:type", content: "website" });-- const origin = `https://${data.host}`;-if (siteName) {- metas.push({- property: "og:site_name",- content: siteName,- });metas.push({"script:ld+json": {"@context": "https://schema.org",@@ -154,42 +139,6 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (pageMeta.excludePageFromSearch) {- metas.push({- name: "robots",- content: "noindex, nofollow",- });- }-- if (pageMeta.description) {- metas.push({- name: "description",- content: pageMeta.description,- });- metas.push({- property: "og:description",- content: pageMeta.description,- });- }-- if (pageMeta.socialImageAssetName) {- metas.push({- property: "og:image",- content: `https://${data.host}${imageLoader({- src: pageMeta.socialImageAssetName,- // Do not transform social image (not enough information do we need to do this)- format: "raw",- })}`,- });- } else if (pageMeta.socialImageUrl) {- metas.push({- property: "og:image",- content: pageMeta.socialImageUrl,- });- }-- metas.push(...pageMeta.custom);-return metas;};@@ -323,7 +272,8 @@ export const action = async ({};const Outlet = () => {- const { system, resources, url } = useLoaderData<typeof loader>();+ const { system, resources, url, pageMeta, host } =+ useLoaderData<typeof loader>();return (<ReactSdkContext.Providervalue={{@@ -334,6 +284,13 @@ const Outlet = () => {>{/* Use the URL as the key to force scripts in HTML Embed to reload on dynamic pages */}<Page key={url} system={system} />+ <PageSettingsMeta+ url={url}+ pageMeta={pageMeta}+ host={host}+ siteName={siteName}+ imageLoader={imageLoader}+ /></ReactSdkContext.Provider>);};diff --git a/fixtures/webstudio-remix-netlify-edge-functions/app/routes/[another-page]._index.tsx b/fixtures/webstudio-remix-netlify-edge-functions/app/routes/[another-page]._index.tsxindex c4fca377af..5cbf8d8ab9 100644--- a/fixtures/webstudio-remix-netlify-edge-functions/app/routes/[another-page]._index.tsx+++ b/fixtures/webstudio-remix-netlify-edge-functions/app/routes/[another-page]._index.tsx@@ -16,7 +16,10 @@ import {formIdFieldName,formBotFieldName,} from "@webstudio-is/sdk/runtime";-import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";+import {+ ReactSdkContext,+ PageSettingsMeta,+} from "@webstudio-is/react-sdk/runtime";import {Page,siteName,@@ -117,33 +120,15 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {if (data === undefined) {return metas;}- const { pageMeta } = data;- if (data.url) {- metas.push({- property: "og:url",- content: data.url,- });- }+ const { pageMeta } = data;+ const origin = `https://${data.host}`;if (pageMeta.title) {metas.push({ title: pageMeta.title });-- metas.push({- property: "og:title",- content: pageMeta.title,- });}- metas.push({ property: "og:type", content: "website" });-- const origin = `https://${data.host}`;-if (siteName) {- metas.push({- property: "og:site_name",- content: siteName,- });metas.push({"script:ld+json": {"@context": "https://schema.org",@@ -154,42 +139,6 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (pageMeta.excludePageFromSearch) {- metas.push({- name: "robots",- content: "noindex, nofollow",- });- }-- if (pageMeta.description) {- metas.push({- name: "description",- content: pageMeta.description,- });- metas.push({- property: "og:description",- content: pageMeta.description,- });- }-- if (pageMeta.socialImageAssetName) {- metas.push({- property: "og:image",- content: `https://${data.host}${imageLoader({- src: pageMeta.socialImageAssetName,- // Do not transform social image (not enough information do we need to do this)- format: "raw",- })}`,- });- } else if (pageMeta.socialImageUrl) {- metas.push({- property: "og:image",- content: pageMeta.socialImageUrl,- });- }-- metas.push(...pageMeta.custom);-return metas;};@@ -323,7 +272,8 @@ export const action = async ({};const Outlet = () => {- const { system, resources, url } = useLoaderData<typeof loader>();+ const { system, resources, url, pageMeta, host } =+ useLoaderData<typeof loader>();return (<ReactSdkContext.Providervalue={{@@ -334,6 +284,13 @@ const Outlet = () => {>{/* Use the URL as the key to force scripts in HTML Embed to reload on dynamic pages */}<Page key={url} system={system} />+ <PageSettingsMeta+ url={url}+ pageMeta={pageMeta}+ host={host}+ siteName={siteName}+ imageLoader={imageLoader}+ /></ReactSdkContext.Provider>);};diff --git a/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx b/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsxindex 66ad6094c1..7a204fa27b 100644--- a/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx+++ b/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx@@ -16,7 +16,10 @@ import {formIdFieldName,formBotFieldName,} from "@webstudio-is/sdk/runtime";-import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";+import {+ ReactSdkContext,+ PageSettingsMeta,+} from "@webstudio-is/react-sdk/runtime";import {Page,siteName,@@ -117,33 +120,15 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {if (data === undefined) {return metas;}- const { pageMeta } = data;- if (data.url) {- metas.push({- property: "og:url",- content: data.url,- });- }+ const { pageMeta } = data;+ const origin = `https://${data.host}`;if (pageMeta.title) {metas.push({ title: pageMeta.title });-- metas.push({- property: "og:title",- content: pageMeta.title,- });}- metas.push({ property: "og:type", content: "website" });-- const origin = `https://${data.host}`;-if (siteName) {- metas.push({- property: "og:site_name",- content: siteName,- });metas.push({"script:ld+json": {"@context": "https://schema.org",@@ -154,42 +139,6 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (pageMeta.excludePageFromSearch) {- metas.push({- name: "robots",- content: "noindex, nofollow",- });- }-- if (pageMeta.description) {- metas.push({- name: "description",- content: pageMeta.description,- });- metas.push({- property: "og:description",- content: pageMeta.description,- });- }-- if (pageMeta.socialImageAssetName) {- metas.push({- property: "og:image",- content: `https://${data.host}${imageLoader({- src: pageMeta.socialImageAssetName,- // Do not transform social image (not enough information do we need to do this)- format: "raw",- })}`,- });- } else if (pageMeta.socialImageUrl) {- metas.push({- property: "og:image",- content: pageMeta.socialImageUrl,- });- }-- metas.push(...pageMeta.custom);-return metas;};@@ -323,7 +272,8 @@ export const action = async ({};const Outlet = () => {- const { system, resources, url } = useLoaderData<typeof loader>();+ const { system, resources, url, pageMeta, host } =+ useLoaderData<typeof loader>();return (<ReactSdkContext.Providervalue={{@@ -334,6 +284,13 @@ const Outlet = () => {>{/* Use the URL as the key to force scripts in HTML Embed to reload on dynamic pages */}<Page key={url} system={system} />+ <PageSettingsMeta+ url={url}+ pageMeta={pageMeta}+ host={host}+ siteName={siteName}+ imageLoader={imageLoader}+ /></ReactSdkContext.Provider>);};diff --git a/fixtures/webstudio-remix-netlify-functions/app/routes/[another-page]._index.tsx b/fixtures/webstudio-remix-netlify-functions/app/routes/[another-page]._index.tsxindex c4fca377af..5cbf8d8ab9 100644--- a/fixtures/webstudio-remix-netlify-functions/app/routes/[another-page]._index.tsx+++ b/fixtures/webstudio-remix-netlify-functions/app/routes/[another-page]._index.tsx@@ -16,7 +16,10 @@ import {formIdFieldName,formBotFieldName,} from "@webstudio-is/sdk/runtime";-import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";+import {+ ReactSdkContext,+ PageSettingsMeta,+} from "@webstudio-is/react-sdk/runtime";import {Page,siteName,@@ -117,33 +120,15 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {if (data === undefined) {return metas;}- const { pageMeta } = data;- if (data.url) {- metas.push({- property: "og:url",- content: data.url,- });- }+ const { pageMeta } = data;+ const origin = `https://${data.host}`;if (pageMeta.title) {metas.push({ title: pageMeta.title });-- metas.push({- property: "og:title",- content: pageMeta.title,- });}- metas.push({ property: "og:type", content: "website" });-- const origin = `https://${data.host}`;-if (siteName) {- metas.push({- property: "og:site_name",- content: siteName,- });metas.push({"script:ld+json": {"@context": "https://schema.org",@@ -154,42 +139,6 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (pageMeta.excludePageFromSearch) {- metas.push({- name: "robots",- content: "noindex, nofollow",- });- }-- if (pageMeta.description) {- metas.push({- name: "description",- content: pageMeta.description,- });- metas.push({- property: "og:description",- content: pageMeta.description,- });- }-- if (pageMeta.socialImageAssetName) {- metas.push({- property: "og:image",- content: `https://${data.host}${imageLoader({- src: pageMeta.socialImageAssetName,- // Do not transform social image (not enough information do we need to do this)- format: "raw",- })}`,- });- } else if (pageMeta.socialImageUrl) {- metas.push({- property: "og:image",- content: pageMeta.socialImageUrl,- });- }-- metas.push(...pageMeta.custom);-return metas;};@@ -323,7 +272,8 @@ export const action = async ({};const Outlet = () => {- const { system, resources, url } = useLoaderData<typeof loader>();+ const { system, resources, url, pageMeta, host } =+ useLoaderData<typeof loader>();return (<ReactSdkContext.Providervalue={{@@ -334,6 +284,13 @@ const Outlet = () => {>{/* Use the URL as the key to force scripts in HTML Embed to reload on dynamic pages */}<Page key={url} system={system} />+ <PageSettingsMeta+ url={url}+ pageMeta={pageMeta}+ host={host}+ siteName={siteName}+ imageLoader={imageLoader}+ /></ReactSdkContext.Provider>);};diff --git a/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx b/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsxindex 66ad6094c1..7a204fa27b 100644--- a/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx+++ b/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx@@ -16,7 +16,10 @@ import {formIdFieldName,formBotFieldName,} from "@webstudio-is/sdk/runtime";-import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";+import {+ ReactSdkContext,+ PageSettingsMeta,+} from "@webstudio-is/react-sdk/runtime";import {Page,siteName,@@ -117,33 +120,15 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {if (data === undefined) {return metas;}- const { pageMeta } = data;- if (data.url) {- metas.push({- property: "og:url",- content: data.url,- });- }+ const { pageMeta } = data;+ const origin = `https://${data.host}`;if (pageMeta.title) {metas.push({ title: pageMeta.title });-- metas.push({- property: "og:title",- content: pageMeta.title,- });}- metas.push({ property: "og:type", content: "website" });-- const origin = `https://${data.host}`;-if (siteName) {- metas.push({- property: "og:site_name",- content: siteName,- });metas.push({"script:ld+json": {"@context": "https://schema.org",@@ -154,42 +139,6 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (pageMeta.excludePageFromSearch) {- metas.push({- name: "robots",- content: "noindex, nofollow",- });- }-- if (pageMeta.description) {- metas.push({- name: "description",- content: pageMeta.description,- });- metas.push({- property: "og:description",- content: pageMeta.description,- });- }-- if (pageMeta.socialImageAssetName) {- metas.push({- property: "og:image",- content: `https://${data.host}${imageLoader({- src: pageMeta.socialImageAssetName,- // Do not transform social image (not enough information do we need to do this)- format: "raw",- })}`,- });- } else if (pageMeta.socialImageUrl) {- metas.push({- property: "og:image",- content: pageMeta.socialImageUrl,- });- }-- metas.push(...pageMeta.custom);-return metas;};@@ -323,7 +272,8 @@ export const action = async ({};const Outlet = () => {- const { system, resources, url } = useLoaderData<typeof loader>();+ const { system, resources, url, pageMeta, host } =+ useLoaderData<typeof loader>();return (<ReactSdkContext.Providervalue={{@@ -334,6 +284,13 @@ const Outlet = () => {>{/* Use the URL as the key to force scripts in HTML Embed to reload on dynamic pages */}<Page key={url} system={system} />+ <PageSettingsMeta+ url={url}+ pageMeta={pageMeta}+ host={host}+ siteName={siteName}+ imageLoader={imageLoader}+ /></ReactSdkContext.Provider>);};diff --git a/fixtures/webstudio-remix-vercel/.template/vite.config.ts b/fixtures/webstudio-remix-vercel/.template/vite.config.tsnew file mode 100644index 0000000000..e057ea698c--- /dev/null+++ b/fixtures/webstudio-remix-vercel/.template/vite.config.ts@@ -0,0 +1,19 @@+import { defineConfig } from "vite";+import { vitePlugin as remix } from "@remix-run/dev";+// @ts-ignore+import { dedupeMeta } from "./proxy-emulator/dedupe-meta";++export default defineConfig({+ plugins: [+ remix({+ future: {+ v3_lazyRouteDiscovery: false,+ v3_relativeSplatPath: false,+ v3_singleFetch: false,+ v3_fetcherPersist: false,+ v3_throwAbortReason: false,+ },+ }),+ dedupeMeta,+ ],+});diff --git a/fixtures/webstudio-remix-vercel/.webstudio/data.json b/fixtures/webstudio-remix-vercel/.webstudio/data.jsonindex fb7fb366ec..b04938cbee 100644--- a/fixtures/webstudio-remix-vercel/.webstudio/data.json+++ b/fixtures/webstudio-remix-vercel/.webstudio/data.json@@ -1,10 +1,10 @@{"build": {- "id": "63389378-e2a2-4e25-8c98-3e408bcfc4c4",+ "id": "39af85c6-952a-42a5-953b-67718e2b95d7","projectId": "cddc1d44-af37-4cb6-a430-d300cf6f932d",- "version": 401,- "createdAt": "2025-01-04T10:58:00.47+00:00",- "updatedAt": "2025-01-04T10:58:00.47+00:00",+ "version": 455,+ "createdAt": "2025-01-18T13:58:20.219+00:00",+ "updatedAt": "2025-01-18T13:58:20.219+00:00","pages": {"meta": {"siteName": "KittyGuardedZone",@@ -202,6 +202,27 @@"include": false},"path": "/content-block"+ },+ {+ "id": "8fF_9MQOwOqsLM9BhULUG",+ "name": "head-tag",+ "title": "\"Untitled\"",+ "rootInstanceId": "1NipO5NmaHukA_dxzfVRF",+ "systemDataSourceId": "XYfrcSJVN66CpmamKON1m",+ "meta": {+ "description": "\"\"",+ "excludePageFromSearch": "true",+ "language": "\"\"",+ "socialImageUrl": "\"\"",+ "status": "200",+ "redirect": "\"\"",+ "documentType": "html",+ "custom": []+ },+ "marketplace": {+ "include": false+ },+ "path": "/head-tag"}],"folders": [@@ -220,7 +241,8 @@"9xlwLSHxuk8HmS3-EEGcf","lTS5DKrDEC_mXSAc5ZDDA","FsnS9ui6btzM4W3YELE3Q",- "Q1D-6G1cl0SfXyM9Xj4_O"+ "Q1D-6G1cl0SfXyM9Xj4_O",+ "8fF_9MQOwOqsLM9BhULUG"]},{@@ -2877,6 +2899,86 @@"type": "string","value": "link"}+ ],+ [+ "mrHOFAJDwzKZZA5oGONt1",+ {+ "id": "mrHOFAJDwzKZZA5oGONt1",+ "instanceId": "GFN6suio87WybEb7dc8IM",+ "name": "rel",+ "type": "string",+ "value": "help"+ }+ ],+ [+ "TdOgnu7UkI5hG6eGZhAdL",+ {+ "id": "TdOgnu7UkI5hG6eGZhAdL",+ "instanceId": "GFN6suio87WybEb7dc8IM",+ "name": "href",+ "type": "string",+ "value": "/help-head-slot"+ }+ ],+ [+ "jyAJft6LnEDjCPoS38vLN",+ {+ "id": "jyAJft6LnEDjCPoS38vLN",+ "instanceId": "Py53B3dAV0BD8QAHaWV-K",+ "name": "name",+ "type": "string",+ "value": "keywords"+ }+ ],+ [+ "dxwgbOjQGh_vDHcuSdJf8",+ {+ "id": "dxwgbOjQGh_vDHcuSdJf8",+ "instanceId": "Py53B3dAV0BD8QAHaWV-K",+ "name": "content",+ "type": "string",+ "value": "Head Slot Content"+ }+ ],+ [+ "IIwy20wFuPHblBiV5yOa8",+ {+ "id": "IIwy20wFuPHblBiV5yOa8",+ "instanceId": "69Q0-F165KT33psqFcq6M",+ "name": "href",+ "type": "page",+ "value": "7Db64ZXgYiRqKSQNR-qTQ"+ }+ ],+ [+ "oCeOjUq5kg_g-0dq5iApN",+ {+ "id": "oCeOjUq5kg_g-0dq5iApN",+ "instanceId": "EveN4Skg9xb8Lj1QJcW52",+ "name": "name",+ "type": "string",+ "value": ""+ }+ ],+ [+ "9axbHjZtX8BX6vXEai1xq",+ {+ "id": "9axbHjZtX8BX6vXEai1xq",+ "instanceId": "EveN4Skg9xb8Lj1QJcW52",+ "name": "content",+ "type": "string",+ "value": "Head Slot Content"+ }+ ],+ [+ "B3AKQ4tazCkXwEKfNr2E7",+ {+ "id": "B3AKQ4tazCkXwEKfNr2E7",+ "instanceId": "EveN4Skg9xb8Lj1QJcW52",+ "name": "property",+ "type": "string",+ "value": "og:title"+ }]],"dataSources": [@@ -3083,6 +3185,15 @@"scopeInstanceId": "-BW4QOi3PJTZ1sDCY8LW6","name": "system"}+ ],+ [+ "XYfrcSJVN66CpmamKON1m",+ {+ "type": "parameter",+ "id": "XYfrcSJVN66CpmamKON1m",+ "scopeInstanceId": "1NipO5NmaHukA_dxzfVRF",+ "name": "system"+ }]],"resources": [@@ -4870,6 +4981,108 @@}]}+ ],+ [+ "1NipO5NmaHukA_dxzfVRF",+ {+ "type": "instance",+ "id": "1NipO5NmaHukA_dxzfVRF",+ "component": "Body",+ "children": [+ {+ "type": "id",+ "value": "Jdxu-0HI2f6Lq-LJwIOyY"+ },+ {+ "type": "id",+ "value": "McxYFTe8LB_iEqEL6DHFc"+ },+ {+ "type": "id",+ "value": "69Q0-F165KT33psqFcq6M"+ }+ ]+ }+ ],+ [+ "Jdxu-0HI2f6Lq-LJwIOyY",+ {+ "type": "instance",+ "id": "Jdxu-0HI2f6Lq-LJwIOyY",+ "component": "HeadSlot",+ "children": [+ {+ "type": "id",+ "value": "GFN6suio87WybEb7dc8IM"+ },+ {+ "type": "id",+ "value": "Py53B3dAV0BD8QAHaWV-K"+ },+ {+ "type": "id",+ "value": "EveN4Skg9xb8Lj1QJcW52"+ }+ ]+ }+ ],+ [+ "GFN6suio87WybEb7dc8IM",+ {+ "type": "instance",+ "id": "GFN6suio87WybEb7dc8IM",+ "component": "HeadLink",+ "label": "Link",+ "children": []+ }+ ],+ [+ "Py53B3dAV0BD8QAHaWV-K",+ {+ "type": "instance",+ "id": "Py53B3dAV0BD8QAHaWV-K",+ "component": "HeadMeta",+ "label": "Meta",+ "children": []+ }+ ],+ [+ "McxYFTe8LB_iEqEL6DHFc",+ {+ "type": "instance",+ "id": "McxYFTe8LB_iEqEL6DHFc",+ "component": "Heading",+ "children": [+ {+ "type": "text",+ "value": "Test Head Slot"+ }+ ]+ }+ ],+ [+ "69Q0-F165KT33psqFcq6M",+ {+ "type": "instance",+ "id": "69Q0-F165KT33psqFcq6M",+ "component": "Link",+ "children": [+ {+ "type": "text",+ "value": "Go Home"+ }+ ]+ }+ ],+ [+ "EveN4Skg9xb8Lj1QJcW52",+ {+ "type": "instance",+ "id": "EveN4Skg9xb8Lj1QJcW52",+ "component": "HeadMeta",+ "label": "Meta",+ "children": []+ }]],"deployment": {@@ -5088,6 +5301,27 @@"include": false},"path": "/content-block"+ },+ {+ "id": "8fF_9MQOwOqsLM9BhULUG",+ "name": "head-tag",+ "title": "\"Untitled\"",+ "rootInstanceId": "1NipO5NmaHukA_dxzfVRF",+ "systemDataSourceId": "XYfrcSJVN66CpmamKON1m",+ "meta": {+ "description": "\"\"",+ "excludePageFromSearch": "true",+ "language": "\"\"",+ "socialImageUrl": "\"\"",+ "status": "200",+ "redirect": "\"\"",+ "documentType": "html",+ "custom": []+ },+ "marketplace": {+ "include": false+ },+ "path": "/head-tag"}],"assets": [diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/$resources.sitemap.xml.ts b/fixtures/webstudio-remix-vercel/app/__generated__/$resources.sitemap.xml.tsindex 90943a491e..db46e9acc1 100644--- a/fixtures/webstudio-remix-vercel/app/__generated__/$resources.sitemap.xml.ts+++ b/fixtures/webstudio-remix-vercel/app/__generated__/$resources.sitemap.xml.ts@@ -1,26 +1,26 @@export const sitemap = [{path: "/",- lastModified: "2025-01-04",+ lastModified: "2025-01-18",},{path: "/_route_with_symbols_",- lastModified: "2025-01-04",+ lastModified: "2025-01-18",},{path: "/form",- lastModified: "2025-01-04",+ lastModified: "2025-01-18",},{path: "/heading-with-id",- lastModified: "2025-01-04",+ lastModified: "2025-01-18",},{path: "/resources",- lastModified: "2025-01-04",+ lastModified: "2025-01-18",},{path: "/nested/nested-page",- lastModified: "2025-01-04",+ lastModified: "2025-01-18",},];diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[head-tag]._index.server.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[head-tag]._index.server.tsxnew file mode 100644index 0000000000..6c968b385b--- /dev/null+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[head-tag]._index.server.tsx@@ -0,0 +1,39 @@+/* eslint-disable */+/* This is a auto generated file for building the project */++import type { PageMeta } from "@webstudio-is/sdk";+import type { System, ResourceRequest } from "@webstudio-is/sdk";+export const getResources = (_props: { system: System }) => {+ const _data = new Map<string, ResourceRequest>([]);+ const _action = new Map<string, ResourceRequest>([]);+ return { data: _data, action: _action };+};++export const getPageMeta = ({+ system,+ resources,+}: {+ system: System;+ resources: Record<string, any>;+}): PageMeta => {+ return {+ title: "Untitled",+ description: "",+ excludePageFromSearch: true,+ language: "",+ socialImageAssetName: undefined,+ socialImageUrl: "",+ status: 200,+ redirect: "",+ custom: [],+ };+};++type Params = Record<string, string | undefined>;+export const getRemixParams = ({ ...params }: Params): Params => {+ return params;+};++export const projectId = "cddc1d44-af37-4cb6-a430-d300cf6f932d";++export const contactEmail = "[email protected]";diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[head-tag]._index.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[head-tag]._index.tsxnew file mode 100644index 0000000000..e2e7157ea3--- /dev/null+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[head-tag]._index.tsx@@ -0,0 +1,57 @@+/* eslint-disable */+/* This is a auto generated file for building the project */++import { Fragment, useState } from "react";+import type { FontAsset, ImageAsset } from "@webstudio-is/sdk";+import { useResource, useVariableState } from "@webstudio-is/react-sdk/runtime";+import {+ Body as Body,+ Link as Link,+} from "@webstudio-is/sdk-components-react-remix";+import {+ HeadSlot as HeadSlot,+ HeadLink as HeadLink,+ HeadMeta as HeadMeta,+ Heading as Heading,+} from "@webstudio-is/sdk-components-react";++export const siteName = "KittyGuardedZone";++export const favIconAsset: ImageAsset | undefined = {+ id: "88d5e2ff-b8f2-4899-aaf8-dde4ade6da10",+ name: "DALL_E_2023-10-30_12.39.46_-_Photo_logo_with_a_bold_cat_silhouette_centered_on_a_contrasting_background_designed_for_clarity_at_small_32x32_favicon_resolution_00h6cEA8u2pJRvVJv7hRe.png",+ description: null,+ projectId: "cddc1d44-af37-4cb6-a430-d300cf6f932d",+ size: 268326,+ type: "image",+ format: "png",+ createdAt: "2023-10-30T13:51:08.416+00:00",+ meta: { width: 790, height: 786 },+};++// Font assets on current page (can be preloaded)+export const pageFontAssets: FontAsset[] = [];++export const pageBackgroundImageAssets: ImageAsset[] = [];++const Page = ({}: { system: any }) => {+ return (+ <Body className={"w-body"}>+ <HeadSlot>+ <HeadLink rel={"help"} href={"/help-head-slot"} />+ <HeadMeta name={"keywords"} content={"Head Slot Content"} />+ <HeadMeta+ name={""}+ content={"Head Slot Content"}+ property={"og:title"}+ />+ </HeadSlot>+ <Heading className={"w-heading"}>{"Test Head Slot"}</Heading>+ <Link href={"/"} className={"w-link"}>+ {"Go Home"}+ </Link>+ </Body>+ );+};++export { Page };diff --git a/fixtures/webstudio-remix-vercel/app/routes/[_route_with_symbols_]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[_route_with_symbols_]._index.tsxindex 635a9f5d5e..4c00fa5ad5 100644--- a/fixtures/webstudio-remix-vercel/app/routes/[_route_with_symbols_]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/routes/[_route_with_symbols_]._index.tsx@@ -16,7 +16,10 @@ import {formIdFieldName,formBotFieldName,} from "@webstudio-is/sdk/runtime";-import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";+import {+ ReactSdkContext,+ PageSettingsMeta,+} from "@webstudio-is/react-sdk/runtime";import {Page,siteName,@@ -117,33 +120,15 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {if (data === undefined) {return metas;}- const { pageMeta } = data;- if (data.url) {- metas.push({- property: "og:url",- content: data.url,- });- }+ const { pageMeta } = data;+ const origin = `https://${data.host}`;if (pageMeta.title) {metas.push({ title: pageMeta.title });-- metas.push({- property: "og:title",- content: pageMeta.title,- });}- metas.push({ property: "og:type", content: "website" });-- const origin = `https://${data.host}`;-if (siteName) {- metas.push({- property: "og:site_name",- content: siteName,- });metas.push({"script:ld+json": {"@context": "https://schema.org",@@ -154,42 +139,6 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (pageMeta.excludePageFromSearch) {- metas.push({- name: "robots",- content: "noindex, nofollow",- });- }-- if (pageMeta.description) {- metas.push({- name: "description",- content: pageMeta.description,- });- metas.push({- property: "og:description",- content: pageMeta.description,- });- }-- if (pageMeta.socialImageAssetName) {- metas.push({- property: "og:image",- content: `https://${data.host}${imageLoader({- src: pageMeta.socialImageAssetName,- // Do not transform social image (not enough information do we need to do this)- format: "raw",- })}`,- });- } else if (pageMeta.socialImageUrl) {- metas.push({- property: "og:image",- content: pageMeta.socialImageUrl,- });- }-- metas.push(...pageMeta.custom);-return metas;};@@ -323,7 +272,8 @@ export const action = async ({};const Outlet = () => {- const { system, resources, url } = useLoaderData<typeof loader>();+ const { system, resources, url, pageMeta, host } =+ useLoaderData<typeof loader>();return (<ReactSdkContext.Providervalue={{@@ -334,6 +284,13 @@ const Outlet = () => {>{/* Use the URL as the key to force scripts in HTML Embed to reload on dynamic pages */}<Page key={url} system={system} />+ <PageSettingsMeta+ url={url}+ pageMeta={pageMeta}+ host={host}+ siteName={siteName}+ imageLoader={imageLoader}+ /></ReactSdkContext.Provider>);};diff --git a/fixtures/webstudio-remix-vercel/app/routes/[class-names]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[class-names]._index.tsxindex 6aa9522fdd..10877776f8 100644--- a/fixtures/webstudio-remix-vercel/app/routes/[class-names]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/routes/[class-names]._index.tsx@@ -16,7 +16,10 @@ import {formIdFieldName,formBotFieldName,} from "@webstudio-is/sdk/runtime";-import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";+import {+ ReactSdkContext,+ PageSettingsMeta,+} from "@webstudio-is/react-sdk/runtime";import {Page,siteName,@@ -117,33 +120,15 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {if (data === undefined) {return metas;}- const { pageMeta } = data;- if (data.url) {- metas.push({- property: "og:url",- content: data.url,- });- }+ const { pageMeta } = data;+ const origin = `https://${data.host}`;if (pageMeta.title) {metas.push({ title: pageMeta.title });-- metas.push({- property: "og:title",- content: pageMeta.title,- });}- metas.push({ property: "og:type", content: "website" });-- const origin = `https://${data.host}`;-if (siteName) {- metas.push({- property: "og:site_name",- content: siteName,- });metas.push({"script:ld+json": {"@context": "https://schema.org",@@ -154,42 +139,6 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (pageMeta.excludePageFromSearch) {- metas.push({- name: "robots",- content: "noindex, nofollow",- });- }-- if (pageMeta.description) {- metas.push({- name: "description",- content: pageMeta.description,- });- metas.push({- property: "og:description",- content: pageMeta.description,- });- }-- if (pageMeta.socialImageAssetName) {- metas.push({- property: "og:image",- content: `https://${data.host}${imageLoader({- src: pageMeta.socialImageAssetName,- // Do not transform social image (not enough information do we need to do this)- format: "raw",- })}`,- });- } else if (pageMeta.socialImageUrl) {- metas.push({- property: "og:image",- content: pageMeta.socialImageUrl,- });- }-- metas.push(...pageMeta.custom);-return metas;};@@ -323,7 +272,8 @@ export const action = async ({};const Outlet = () => {- const { system, resources, url } = useLoaderData<typeof loader>();+ const { system, resources, url, pageMeta, host } =+ useLoaderData<typeof loader>();return (<ReactSdkContext.Providervalue={{@@ -334,6 +284,13 @@ const Outlet = () => {>{/* Use the URL as the key to force scripts in HTML Embed to reload on dynamic pages */}<Page key={url} system={system} />+ <PageSettingsMeta+ url={url}+ pageMeta={pageMeta}+ host={host}+ siteName={siteName}+ imageLoader={imageLoader}+ /></ReactSdkContext.Provider>);};diff --git a/fixtures/webstudio-remix-vercel/app/routes/[content-block]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[content-block]._index.tsxindex ccca776d7e..c54dee3181 100644--- a/fixtures/webstudio-remix-vercel/app/routes/[content-block]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/routes/[content-block]._index.tsx@@ -16,7 +16,10 @@ import {formIdFieldName,formBotFieldName,} from "@webstudio-is/sdk/runtime";-import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";+import {+ ReactSdkContext,+ PageSettingsMeta,+} from "@webstudio-is/react-sdk/runtime";import {Page,siteName,@@ -117,33 +120,15 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {if (data === undefined) {return metas;}- const { pageMeta } = data;- if (data.url) {- metas.push({- property: "og:url",- content: data.url,- });- }+ const { pageMeta } = data;+ const origin = `https://${data.host}`;if (pageMeta.title) {metas.push({ title: pageMeta.title });-- metas.push({- property: "og:title",- content: pageMeta.title,- });}- metas.push({ property: "og:type", content: "website" });-- const origin = `https://${data.host}`;-if (siteName) {- metas.push({- property: "og:site_name",- content: siteName,- });metas.push({"script:ld+json": {"@context": "https://schema.org",@@ -154,42 +139,6 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (pageMeta.excludePageFromSearch) {- metas.push({- name: "robots",- content: "noindex, nofollow",- });- }-- if (pageMeta.description) {- metas.push({- name: "description",- content: pageMeta.description,- });- metas.push({- property: "og:description",- content: pageMeta.description,- });- }-- if (pageMeta.socialImageAssetName) {- metas.push({- property: "og:image",- content: `https://${data.host}${imageLoader({- src: pageMeta.socialImageAssetName,- // Do not transform social image (not enough information do we need to do this)- format: "raw",- })}`,- });- } else if (pageMeta.socialImageUrl) {- metas.push({- property: "og:image",- content: pageMeta.socialImageUrl,- });- }-- metas.push(...pageMeta.custom);-return metas;};@@ -323,7 +272,8 @@ export const action = async ({};const Outlet = () => {- const { system, resources, url } = useLoaderData<typeof loader>();+ const { system, resources, url, pageMeta, host } =+ useLoaderData<typeof loader>();return (<ReactSdkContext.Providervalue={{@@ -334,6 +284,13 @@ const Outlet = () => {>{/* Use the URL as the key to force scripts in HTML Embed to reload on dynamic pages */}<Page key={url} system={system} />+ <PageSettingsMeta+ url={url}+ pageMeta={pageMeta}+ host={host}+ siteName={siteName}+ imageLoader={imageLoader}+ /></ReactSdkContext.Provider>);};diff --git a/fixtures/webstudio-remix-vercel/app/routes/[expressions]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[expressions]._index.tsxindex 6f39a6cff5..60e5dbd29f 100644--- a/fixtures/webstudio-remix-vercel/app/routes/[expressions]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/routes/[expressions]._index.tsx@@ -16,7 +16,10 @@ import {formIdFieldName,formBotFieldName,} from "@webstudio-is/sdk/runtime";-import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";+import {+ ReactSdkContext,+ PageSettingsMeta,+} from "@webstudio-is/react-sdk/runtime";import {Page,siteName,@@ -117,33 +120,15 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {if (data === undefined) {return metas;}- const { pageMeta } = data;- if (data.url) {- metas.push({- property: "og:url",- content: data.url,- });- }+ const { pageMeta } = data;+ const origin = `https://${data.host}`;if (pageMeta.title) {metas.push({ title: pageMeta.title });-- metas.push({- property: "og:title",- content: pageMeta.title,- });}- metas.push({ property: "og:type", content: "website" });-- const origin = `https://${data.host}`;-if (siteName) {- metas.push({- property: "og:site_name",- content: siteName,- });metas.push({"script:ld+json": {"@context": "https://schema.org",@@ -154,42 +139,6 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (pageMeta.excludePageFromSearch) {- metas.push({- name: "robots",- content: "noindex, nofollow",- });- }-- if (pageMeta.description) {- metas.push({- name: "description",- content: pageMeta.description,- });- metas.push({- property: "og:description",- content: pageMeta.description,- });- }-- if (pageMeta.socialImageAssetName) {- metas.push({- property: "og:image",- content: `https://${data.host}${imageLoader({- src: pageMeta.socialImageAssetName,- // Do not transform social image (not enough information do we need to do this)- format: "raw",- })}`,- });- } else if (pageMeta.socialImageUrl) {- metas.push({- property: "og:image",- content: pageMeta.socialImageUrl,- });- }-- metas.push(...pageMeta.custom);-return metas;};@@ -323,7 +272,8 @@ export const action = async ({};const Outlet = () => {- const { system, resources, url } = useLoaderData<typeof loader>();+ const { system, resources, url, pageMeta, host } =+ useLoaderData<typeof loader>();return (<ReactSdkContext.Providervalue={{@@ -334,6 +284,13 @@ const Outlet = () => {>{/* Use the URL as the key to force scripts in HTML Embed to reload on dynamic pages */}<Page key={url} system={system} />+ <PageSettingsMeta+ url={url}+ pageMeta={pageMeta}+ host={host}+ siteName={siteName}+ imageLoader={imageLoader}+ /></ReactSdkContext.Provider>);};diff --git a/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsxindex 5044ea9b9f..8372680d8d 100644--- a/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx@@ -16,7 +16,10 @@ import {formIdFieldName,formBotFieldName,} from "@webstudio-is/sdk/runtime";-import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";+import {+ ReactSdkContext,+ PageSettingsMeta,+} from "@webstudio-is/react-sdk/runtime";import {Page,siteName,@@ -117,33 +120,15 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {if (data === undefined) {return metas;}- const { pageMeta } = data;- if (data.url) {- metas.push({- property: "og:url",- content: data.url,- });- }+ const { pageMeta } = data;+ const origin = `https://${data.host}`;if (pageMeta.title) {metas.push({ title: pageMeta.title });-- metas.push({- property: "og:title",- content: pageMeta.title,- });}- metas.push({ property: "og:type", content: "website" });-- const origin = `https://${data.host}`;-if (siteName) {- metas.push({- property: "og:site_name",- content: siteName,- });metas.push({"script:ld+json": {"@context": "https://schema.org",@@ -154,42 +139,6 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (pageMeta.excludePageFromSearch) {- metas.push({- name: "robots",- content: "noindex, nofollow",- });- }-- if (pageMeta.description) {- metas.push({- name: "description",- content: pageMeta.description,- });- metas.push({- property: "og:description",- content: pageMeta.description,- });- }-- if (pageMeta.socialImageAssetName) {- metas.push({- property: "og:image",- content: `https://${data.host}${imageLoader({- src: pageMeta.socialImageAssetName,- // Do not transform social image (not enough information do we need to do this)- format: "raw",- })}`,- });- } else if (pageMeta.socialImageUrl) {- metas.push({- property: "og:image",- content: pageMeta.socialImageUrl,- });- }-- metas.push(...pageMeta.custom);-return metas;};@@ -323,7 +272,8 @@ export const action = async ({};const Outlet = () => {- const { system, resources, url } = useLoaderData<typeof loader>();+ const { system, resources, url, pageMeta, host } =+ useLoaderData<typeof loader>();return (<ReactSdkContext.Providervalue={{@@ -334,6 +284,13 @@ const Outlet = () => {>{/* Use the URL as the key to force scripts in HTML Embed to reload on dynamic pages */}<Page key={url} system={system} />+ <PageSettingsMeta+ url={url}+ pageMeta={pageMeta}+ host={host}+ siteName={siteName}+ imageLoader={imageLoader}+ /></ReactSdkContext.Provider>);};diff --git a/fixtures/webstudio-remix-vercel/app/routes/[head-tag]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[head-tag]._index.tsxnew file mode 100644index 0000000000..47c854a5ac--- /dev/null+++ b/fixtures/webstudio-remix-vercel/app/routes/[head-tag]._index.tsx@@ -0,0 +1,298 @@+import {+ type ServerRuntimeMetaFunction as MetaFunction,+ type LinksFunction,+ type LinkDescriptor,+ type ActionFunctionArgs,+ type LoaderFunctionArgs,+ type HeadersFunction,+ json,+ redirect,+} from "@remix-run/server-runtime";+import { useLoaderData } from "@remix-run/react";+import {+ isLocalResource,+ loadResource,+ loadResources,+ formIdFieldName,+ formBotFieldName,+} from "@webstudio-is/sdk/runtime";+import {+ ReactSdkContext,+ PageSettingsMeta,+} from "@webstudio-is/react-sdk/runtime";+import {+ Page,+ siteName,+ favIconAsset,+ pageFontAssets,+ pageBackgroundImageAssets,+} from "../__generated__/[head-tag]._index";+import {+ getResources,+ getPageMeta,+ getRemixParams,+ projectId,+ contactEmail,+} from "../__generated__/[head-tag]._index.server";+import { assetBaseUrl, imageLoader } from "../constants.mjs";+import css from "../__generated__/index.css?url";+import { sitemap } from "../__generated__/$resources.sitemap.xml";++const customFetch: typeof fetch = (input, init) => {+ if (typeof input !== "string") {+ return fetch(input, init);+ }++ if (isLocalResource(input, "sitemap.xml")) {+ // @todo: dynamic import sitemap ???+ const response = new Response(JSON.stringify(sitemap));+ response.headers.set("content-type", "application/json; charset=utf-8");+ return Promise.resolve(response);+ }++ return fetch(input, init);+};++export const loader = async (arg: LoaderFunctionArgs) => {+ const url = new URL(arg.request.url);+ const host =+ arg.request.headers.get("x-forwarded-host") ||+ arg.request.headers.get("host") ||+ "";+ url.host = host;+ url.protocol = "https";++ const params = getRemixParams(arg.params);+ const system = {+ params,+ search: Object.fromEntries(url.searchParams),+ origin: url.origin,+ };++ const resources = await loadResources(+ customFetch,+ getResources({ system }).data+ );+ const pageMeta = getPageMeta({ system, resources });++ if (pageMeta.redirect) {+ const status =+ pageMeta.status === 301 || pageMeta.status === 302+ ? pageMeta.status+ : 302;+ return redirect(pageMeta.redirect, status);+ }++ // typecheck+ arg.context.EXCLUDE_FROM_SEARCH satisfies boolean;++ if (arg.context.EXCLUDE_FROM_SEARCH) {+ pageMeta.excludePageFromSearch = arg.context.EXCLUDE_FROM_SEARCH;+ }++ return json(+ {+ host,+ url: url.href,+ system,+ resources,+ pageMeta,+ },+ // No way for current information to change, so add cache for 10 minutes+ // In case of CRM Data, this should be set to 0+ {+ status: pageMeta.status,+ headers: {+ "Cache-Control": "public, max-age=600",+ },+ }+ );+};++export const headers: HeadersFunction = () => {+ return {+ "Cache-Control": "public, max-age=0, must-revalidate",+ };+};++export const meta: MetaFunction<typeof loader> = ({ data }) => {+ const metas: ReturnType<MetaFunction> = [];+ if (data === undefined) {+ return metas;+ }++ const { pageMeta } = data;+ const origin = `https://${data.host}`;++ if (pageMeta.title) {+ metas.push({ title: pageMeta.title });+ }++ if (siteName) {+ metas.push({+ "script:ld+json": {+ "@context": "https://schema.org",+ "@type": "WebSite",+ name: siteName,+ url: origin,+ },+ });+ }++ return metas;+};++export const links: LinksFunction = () => {+ const result: LinkDescriptor[] = [];++ result.push({+ rel: "stylesheet",+ href: css,+ });++ if (favIconAsset) {+ result.push({+ rel: "icon",+ href: imageLoader({+ src: `${assetBaseUrl}${favIconAsset.name}`,+ // width,height must be multiple of 48 https://developers.google.com/search/docs/appearance/favicon-in-search+ width: 144,+ height: 144,+ fit: "pad",+ quality: 100,+ format: "auto",+ }),+ type: undefined,+ });+ }++ for (const asset of pageFontAssets) {+ result.push({+ rel: "preload",+ href: `${assetBaseUrl}${asset.name}`,+ as: "font",+ crossOrigin: "anonymous",+ });+ }++ for (const backgroundImageAsset of pageBackgroundImageAssets) {+ result.push({+ rel: "preload",+ href: `${assetBaseUrl}${backgroundImageAsset.name}`,+ as: "image",+ });+ }++ return result;+};++const getRequestHost = (request: Request): string =>+ request.headers.get("x-forwarded-host") || request.headers.get("host") || "";++export const action = async ({+ request,+ context,+}: ActionFunctionArgs): Promise<+ { success: true } | { success: false; errors: string[] }+> => {+ try {+ const url = new URL(request.url);+ url.host = getRequestHost(request);++ const formData = await request.formData();++ const system = {+ params: {},+ search: {},+ origin: url.origin,+ };++ const resourceName = formData.get(formIdFieldName);+ let resource =+ typeof resourceName === "string"+ ? getResources({ system }).action.get(resourceName)+ : undefined;++ const formBotValue = formData.get(formBotFieldName);++ if (formBotValue == null || typeof formBotValue !== "string") {+ throw new Error("Form bot field not found");+ }++ const submitTime = parseInt(formBotValue, 16);+ // Assumes that the difference between the server time and the form submission time,+ // including any client-server time drift, is within a 5-minute range.+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`+ if (+ Number.isNaN(submitTime) ||+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5+ ) {+ throw new Error(`Form bot value invalid ${formBotValue}`);+ }++ formData.delete(formIdFieldName);+ formData.delete(formBotFieldName);++ if (resource) {+ resource.headers.push({+ name: "Content-Type",+ value: "application/json",+ });+ resource.body = Object.fromEntries(formData);+ } else {+ if (contactEmail === undefined) {+ throw new Error("Contact email not found");+ }++ resource = context.getDefaultActionResource?.({+ url,+ projectId,+ contactEmail,+ formData,+ });+ }++ if (resource === undefined) {+ throw Error("Resource not found");+ }+ const { ok, statusText } = await loadResource(fetch, resource);+ if (ok) {+ return { success: true };+ }+ return { success: false, errors: [statusText] };+ } catch (error) {+ console.error(error);++ return {+ success: false,+ errors: [error instanceof Error ? error.message : "Unknown error"],+ };+ }+};++const Outlet = () => {+ const { system, resources, url, pageMeta, host } =+ useLoaderData<typeof loader>();+ return (+ <ReactSdkContext.Provider+ value={{+ imageLoader,+ assetBaseUrl,+ resources,+ }}+ >+ {/* Use the URL as the key to force scripts in HTML Embed to reload on dynamic pages */}+ <Page key={url} system={system} />+ <PageSettingsMeta+ url={url}+ pageMeta={pageMeta}+ host={host}+ siteName={siteName}+ imageLoader={imageLoader}+ />+ </ReactSdkContext.Provider>+ );+};++export default Outlet;diff --git a/fixtures/webstudio-remix-vercel/app/routes/[heading-with-id]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[heading-with-id]._index.tsxindex 9267491354..e861209120 100644--- a/fixtures/webstudio-remix-vercel/app/routes/[heading-with-id]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/routes/[heading-with-id]._index.tsx@@ -16,7 +16,10 @@ import {formIdFieldName,formBotFieldName,} from "@webstudio-is/sdk/runtime";-import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";+import {+ ReactSdkContext,+ PageSettingsMeta,+} from "@webstudio-is/react-sdk/runtime";import {Page,siteName,@@ -117,33 +120,15 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {if (data === undefined) {return metas;}- const { pageMeta } = data;- if (data.url) {- metas.push({- property: "og:url",- content: data.url,- });- }+ const { pageMeta } = data;+ const origin = `https://${data.host}`;if (pageMeta.title) {metas.push({ title: pageMeta.title });-- metas.push({- property: "og:title",- content: pageMeta.title,- });}- metas.push({ property: "og:type", content: "website" });-- const origin = `https://${data.host}`;-if (siteName) {- metas.push({- property: "og:site_name",- content: siteName,- });metas.push({"script:ld+json": {"@context": "https://schema.org",@@ -154,42 +139,6 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (pageMeta.excludePageFromSearch) {- metas.push({- name: "robots",- content: "noindex, nofollow",- });- }-- if (pageMeta.description) {- metas.push({- name: "description",- content: pageMeta.description,- });- metas.push({- property: "og:description",- content: pageMeta.description,- });- }-- if (pageMeta.socialImageAssetName) {- metas.push({- property: "og:image",- content: `https://${data.host}${imageLoader({- src: pageMeta.socialImageAssetName,- // Do not transform social image (not enough information do we need to do this)- format: "raw",- })}`,- });- } else if (pageMeta.socialImageUrl) {- metas.push({- property: "og:image",- content: pageMeta.socialImageUrl,- });- }-- metas.push(...pageMeta.custom);-return metas;};@@ -323,7 +272,8 @@ export const action = async ({};const Outlet = () => {- const { system, resources, url } = useLoaderData<typeof loader>();+ const { system, resources, url, pageMeta, host } =+ useLoaderData<typeof loader>();return (<ReactSdkContext.Providervalue={{@@ -334,6 +284,13 @@ const Outlet = () => {>{/* Use the URL as the key to force scripts in HTML Embed to reload on dynamic pages */}<Page key={url} system={system} />+ <PageSettingsMeta+ url={url}+ pageMeta={pageMeta}+ host={host}+ siteName={siteName}+ imageLoader={imageLoader}+ /></ReactSdkContext.Provider>);};diff --git a/fixtures/webstudio-remix-vercel/app/routes/[nested].[nested-page]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[nested].[nested-page]._index.tsxindex 794b17c562..1295311a6f 100644--- a/fixtures/webstudio-remix-vercel/app/routes/[nested].[nested-page]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/routes/[nested].[nested-page]._index.tsx@@ -16,7 +16,10 @@ import {formIdFieldName,formBotFieldName,} from "@webstudio-is/sdk/runtime";-import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";+import {+ ReactSdkContext,+ PageSettingsMeta,+} from "@webstudio-is/react-sdk/runtime";import {Page,siteName,@@ -117,33 +120,15 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {if (data === undefined) {return metas;}- const { pageMeta } = data;- if (data.url) {- metas.push({- property: "og:url",- content: data.url,- });- }+ const { pageMeta } = data;+ const origin = `https://${data.host}`;if (pageMeta.title) {metas.push({ title: pageMeta.title });-- metas.push({- property: "og:title",- content: pageMeta.title,- });}- metas.push({ property: "og:type", content: "website" });-- const origin = `https://${data.host}`;-if (siteName) {- metas.push({- property: "og:site_name",- content: siteName,- });metas.push({"script:ld+json": {"@context": "https://schema.org",@@ -154,42 +139,6 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (pageMeta.excludePageFromSearch) {- metas.push({- name: "robots",- content: "noindex, nofollow",- });- }-- if (pageMeta.description) {- metas.push({- name: "description",- content: pageMeta.description,- });- metas.push({- property: "og:description",- content: pageMeta.description,- });- }-- if (pageMeta.socialImageAssetName) {- metas.push({- property: "og:image",- content: `https://${data.host}${imageLoader({- src: pageMeta.socialImageAssetName,- // Do not transform social image (not enough information do we need to do this)- format: "raw",- })}`,- });- } else if (pageMeta.socialImageUrl) {- metas.push({- property: "og:image",- content: pageMeta.socialImageUrl,- });- }-- metas.push(...pageMeta.custom);-return metas;};@@ -323,7 +272,8 @@ export const action = async ({};const Outlet = () => {- const { system, resources, url } = useLoaderData<typeof loader>();+ const { system, resources, url, pageMeta, host } =+ useLoaderData<typeof loader>();return (<ReactSdkContext.Providervalue={{@@ -334,6 +284,13 @@ const Outlet = () => {>{/* Use the URL as the key to force scripts in HTML Embed to reload on dynamic pages */}<Page key={url} system={system} />+ <PageSettingsMeta+ url={url}+ pageMeta={pageMeta}+ host={host}+ siteName={siteName}+ imageLoader={imageLoader}+ /></ReactSdkContext.Provider>);};diff --git a/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsxindex 91c2fb8ea0..b5921ec842 100644--- a/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx@@ -16,7 +16,10 @@ import {formIdFieldName,formBotFieldName,} from "@webstudio-is/sdk/runtime";-import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";+import {+ ReactSdkContext,+ PageSettingsMeta,+} from "@webstudio-is/react-sdk/runtime";import {Page,siteName,@@ -117,33 +120,15 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {if (data === undefined) {return metas;}- const { pageMeta } = data;- if (data.url) {- metas.push({- property: "og:url",- content: data.url,- });- }+ const { pageMeta } = data;+ const origin = `https://${data.host}`;if (pageMeta.title) {metas.push({ title: pageMeta.title });-- metas.push({- property: "og:title",- content: pageMeta.title,- });}- metas.push({ property: "og:type", content: "website" });-- const origin = `https://${data.host}`;-if (siteName) {- metas.push({- property: "og:site_name",- content: siteName,- });metas.push({"script:ld+json": {"@context": "https://schema.org",@@ -154,42 +139,6 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (pageMeta.excludePageFromSearch) {- metas.push({- name: "robots",- content: "noindex, nofollow",- });- }-- if (pageMeta.description) {- metas.push({- name: "description",- content: pageMeta.description,- });- metas.push({- property: "og:description",- content: pageMeta.description,- });- }-- if (pageMeta.socialImageAssetName) {- metas.push({- property: "og:image",- content: `https://${data.host}${imageLoader({- src: pageMeta.socialImageAssetName,- // Do not transform social image (not enough information do we need to do this)- format: "raw",- })}`,- });- } else if (pageMeta.socialImageUrl) {- metas.push({- property: "og:image",- content: pageMeta.socialImageUrl,- });- }-- metas.push(...pageMeta.custom);-return metas;};@@ -323,7 +272,8 @@ export const action = async ({};const Outlet = () => {- const { system, resources, url } = useLoaderData<typeof loader>();+ const { system, resources, url, pageMeta, host } =+ useLoaderData<typeof loader>();return (<ReactSdkContext.Providervalue={{@@ -334,6 +284,13 @@ const Outlet = () => {>{/* Use the URL as the key to force scripts in HTML Embed to reload on dynamic pages */}<Page key={url} system={system} />+ <PageSettingsMeta+ url={url}+ pageMeta={pageMeta}+ host={host}+ siteName={siteName}+ imageLoader={imageLoader}+ /></ReactSdkContext.Provider>);};diff --git a/fixtures/webstudio-remix-vercel/app/routes/[resources]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[resources]._index.tsxindex e4c5605967..98275731d3 100644--- a/fixtures/webstudio-remix-vercel/app/routes/[resources]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/routes/[resources]._index.tsx@@ -16,7 +16,10 @@ import {formIdFieldName,formBotFieldName,} from "@webstudio-is/sdk/runtime";-import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";+import {+ ReactSdkContext,+ PageSettingsMeta,+} from "@webstudio-is/react-sdk/runtime";import {Page,siteName,@@ -117,33 +120,15 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {if (data === undefined) {return metas;}- const { pageMeta } = data;- if (data.url) {- metas.push({- property: "og:url",- content: data.url,- });- }+ const { pageMeta } = data;+ const origin = `https://${data.host}`;if (pageMeta.title) {metas.push({ title: pageMeta.title });-- metas.push({- property: "og:title",- content: pageMeta.title,- });}- metas.push({ property: "og:type", content: "website" });-- const origin = `https://${data.host}`;-if (siteName) {- metas.push({- property: "og:site_name",- content: siteName,- });metas.push({"script:ld+json": {"@context": "https://schema.org",@@ -154,42 +139,6 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (pageMeta.excludePageFromSearch) {- metas.push({- name: "robots",- content: "noindex, nofollow",- });- }-- if (pageMeta.description) {- metas.push({- name: "description",- content: pageMeta.description,- });- metas.push({- property: "og:description",- content: pageMeta.description,- });- }-- if (pageMeta.socialImageAssetName) {- metas.push({- property: "og:image",- content: `https://${data.host}${imageLoader({- src: pageMeta.socialImageAssetName,- // Do not transform social image (not enough information do we need to do this)- format: "raw",- })}`,- });- } else if (pageMeta.socialImageUrl) {- metas.push({- property: "og:image",- content: pageMeta.socialImageUrl,- });- }-- metas.push(...pageMeta.custom);-return metas;};@@ -323,7 +272,8 @@ export const action = async ({};const Outlet = () => {- const { system, resources, url } = useLoaderData<typeof loader>();+ const { system, resources, url, pageMeta, host } =+ useLoaderData<typeof loader>();return (<ReactSdkContext.Providervalue={{@@ -334,6 +284,13 @@ const Outlet = () => {>{/* Use the URL as the key to force scripts in HTML Embed to reload on dynamic pages */}<Page key={url} system={system} />+ <PageSettingsMeta+ url={url}+ pageMeta={pageMeta}+ host={host}+ siteName={siteName}+ imageLoader={imageLoader}+ /></ReactSdkContext.Provider>);};diff --git a/fixtures/webstudio-remix-vercel/app/routes/_index.tsx b/fixtures/webstudio-remix-vercel/app/routes/_index.tsxindex 66ad6094c1..7a204fa27b 100644--- a/fixtures/webstudio-remix-vercel/app/routes/_index.tsx+++ b/fixtures/webstudio-remix-vercel/app/routes/_index.tsx@@ -16,7 +16,10 @@ import {formIdFieldName,formBotFieldName,} from "@webstudio-is/sdk/runtime";-import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";+import {+ ReactSdkContext,+ PageSettingsMeta,+} from "@webstudio-is/react-sdk/runtime";import {Page,siteName,@@ -117,33 +120,15 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {if (data === undefined) {return metas;}- const { pageMeta } = data;- if (data.url) {- metas.push({- property: "og:url",- content: data.url,- });- }+ const { pageMeta } = data;+ const origin = `https://${data.host}`;if (pageMeta.title) {metas.push({ title: pageMeta.title });-- metas.push({- property: "og:title",- content: pageMeta.title,- });}- metas.push({ property: "og:type", content: "website" });-- const origin = `https://${data.host}`;-if (siteName) {- metas.push({- property: "og:site_name",- content: siteName,- });metas.push({"script:ld+json": {"@context": "https://schema.org",@@ -154,42 +139,6 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (pageMeta.excludePageFromSearch) {- metas.push({- name: "robots",- content: "noindex, nofollow",- });- }-- if (pageMeta.description) {- metas.push({- name: "description",- content: pageMeta.description,- });- metas.push({- property: "og:description",- content: pageMeta.description,- });- }-- if (pageMeta.socialImageAssetName) {- metas.push({- property: "og:image",- content: `https://${data.host}${imageLoader({- src: pageMeta.socialImageAssetName,- // Do not transform social image (not enough information do we need to do this)- format: "raw",- })}`,- });- } else if (pageMeta.socialImageUrl) {- metas.push({- property: "og:image",- content: pageMeta.socialImageUrl,- });- }-- metas.push(...pageMeta.custom);-return metas;};@@ -323,7 +272,8 @@ export const action = async ({};const Outlet = () => {- const { system, resources, url } = useLoaderData<typeof loader>();+ const { system, resources, url, pageMeta, host } =+ useLoaderData<typeof loader>();return (<ReactSdkContext.Providervalue={{@@ -334,6 +284,13 @@ const Outlet = () => {>{/* Use the URL as the key to force scripts in HTML Embed to reload on dynamic pages */}<Page key={url} system={system} />+ <PageSettingsMeta+ url={url}+ pageMeta={pageMeta}+ host={host}+ siteName={siteName}+ imageLoader={imageLoader}+ /></ReactSdkContext.Provider>);};diff --git a/fixtures/webstudio-remix-vercel/package.json b/fixtures/webstudio-remix-vercel/package.jsonindex c1a513033d..cfb75b14c5 100644--- a/fixtures/webstudio-remix-vercel/package.json+++ b/fixtures/webstudio-remix-vercel/package.json@@ -6,8 +6,8 @@"typecheck": "tsc","cli": "NODE_OPTIONS='--conditions=webstudio --import=tsx' webstudio","fixtures:link": "pnpm cli link --link https://p-cddc1d44-af37-4cb6-a430-d300cf6f932d-dot-${BUILDER_HOST:-main.development.webstudio.is}'?authToken=1cdc6026-dd5b-4624-b89b-9bd45e9bcc3d'",- "fixtures:sync": "pnpm cli sync --buildId 63389378-e2a2-4e25-8c98-3e408bcfc4c4 && pnpm prettier --write ./.webstudio/",- "fixtures:build": "pnpm cli build --template vercel --template internal && pnpm prettier --write ./app/ ./package.json ./tsconfig.json"+ "fixtures:sync": "pnpm cli sync --buildId 39af85c6-952a-42a5-953b-67718e2b95d7 && pnpm prettier --write ./.webstudio/",+ "fixtures:build": "pnpm cli build --template vercel --template internal --template ./.template && pnpm prettier --write ./app/ ./package.json ./tsconfig.json"},"private": true,"sideEffects": false,@@ -18,15 +18,16 @@"@webstudio-is/image": "workspace:*","@webstudio-is/react-sdk": "workspace:*","@webstudio-is/sdk": "workspace:*",+ "@webstudio-is/sdk-components-animation": "workspace:*","@webstudio-is/sdk-components-react": "workspace:*","@webstudio-is/sdk-components-react-radix": "workspace:*","@webstudio-is/sdk-components-react-remix": "workspace:*","isbot": "^5.1.19","react": "18.3.0-canary-14898b6a9-20240318",- "react-dom": "18.3.0-canary-14898b6a9-20240318",- "@webstudio-is/sdk-components-animation": "workspace:*"+ "react-dom": "18.3.0-canary-14898b6a9-20240318"},"devDependencies": {+ "@miniflare/html-rewriter": "^2.14.4","@remix-run/dev": "2.15.2","@types/react": "^18.2.70","@types/react-dom": "^18.2.25",diff --git a/fixtures/webstudio-remix-vercel/proxy-emulator/dedupe-meta.ts b/fixtures/webstudio-remix-vercel/proxy-emulator/dedupe-meta.tsnew file mode 100644index 0000000000..3da113d734--- /dev/null+++ b/fixtures/webstudio-remix-vercel/proxy-emulator/dedupe-meta.ts@@ -0,0 +1,85 @@+import { HTMLRewriter } from "@miniflare/html-rewriter";+import { Plugin } from "vite";++export const dedupeMeta: Plugin = {+ name: "html-rewriter-middleware",+ configureServer(server) {+ server.middlewares.use(async (req, res, next) => {+ if (+ req.headers["sec-fetch-dest"] !== "document" ||+ req.headers["sec-fetch-mode"] !== "navigate"+ ) {+ next();+ return;+ }++ console.log("req.url", req.url);++ if (req.url?.endsWith("/head-tag")) {+ // Capture the original response+ const originalWrite = res.write;+ const originalEnd = res.end;++ let body = "";++ res.write = (chunk) => {+ body += chunk.toString();+ return true;+ };++ res.end = (chunk) => {+ if (chunk) {+ body += chunk.toString();+ }++ const response = new Response(body);++ const metasSet = new Set<string>();++ const rewriter = new HTMLRewriter().on("meta", {+ element(element) {+ const propertyOrName =+ element.getAttribute("property") ||+ element.getAttribute("name");++ if (propertyOrName === null) {+ return;+ }++ if (propertyOrName === "viewport") {+ // Allow "viewport" property deduplication+ return;+ }++ if (metasSet.has(propertyOrName)) {+ console.info(+ `Duplicate meta with name|property = ${propertyOrName} removed`+ );+ element.remove();+ return;+ }++ metasSet.add(propertyOrName);+ },+ });+ rewriter+ // @ts-ignore+ .transform(response)+ .text()+ .then((cleanedHtml) => {+ // Send the modified response+ res.setHeader("Content-Length", Buffer.byteLength(cleanedHtml));+ originalWrite.call(res, cleanedHtml, "utf-8");+ originalEnd.call(res, "", "utf-8");+ });++ return res;+ };++ next();+ } else {+ next();+ }+ });+ },+};diff --git a/fixtures/webstudio-remix-vercel/vite.config.ts b/fixtures/webstudio-remix-vercel/vite.config.tsindex cdd2d81108..e057ea698c 100644--- a/fixtures/webstudio-remix-vercel/vite.config.ts+++ b/fixtures/webstudio-remix-vercel/vite.config.ts@@ -1,5 +1,7 @@import { defineConfig } from "vite";import { vitePlugin as remix } from "@remix-run/dev";+// @ts-ignore+import { dedupeMeta } from "./proxy-emulator/dedupe-meta";export default defineConfig({plugins: [@@ -12,5 +14,6 @@ export default defineConfig({v3_throwAbortReason: false,},}),+ dedupeMeta,],});diff --git a/packages/cli/templates/defaults/app/route-templates/html.tsx b/packages/cli/templates/defaults/app/route-templates/html.tsxindex d05f3b9bce..d5ea8061eb 100644--- a/packages/cli/templates/defaults/app/route-templates/html.tsx+++ b/packages/cli/templates/defaults/app/route-templates/html.tsx@@ -16,7 +16,10 @@ import {formIdFieldName,formBotFieldName,} from "@webstudio-is/sdk/runtime";-import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";+import {+ ReactSdkContext,+ PageSettingsMeta,+} from "@webstudio-is/react-sdk/runtime";import {Page,siteName,@@ -117,33 +120,15 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {if (data === undefined) {return metas;}- const { pageMeta } = data;- if (data.url) {- metas.push({- property: "og:url",- content: data.url,- });- }+ const { pageMeta } = data;+ const origin = `https://${data.host}`;if (pageMeta.title) {metas.push({ title: pageMeta.title });-- metas.push({- property: "og:title",- content: pageMeta.title,- });}- metas.push({ property: "og:type", content: "website" });-- const origin = `https://${data.host}`;-if (siteName) {- metas.push({- property: "og:site_name",- content: siteName,- });metas.push({"script:ld+json": {"@context": "https://schema.org",@@ -154,42 +139,6 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (pageMeta.excludePageFromSearch) {- metas.push({- name: "robots",- content: "noindex, nofollow",- });- }-- if (pageMeta.description) {- metas.push({- name: "description",- content: pageMeta.description,- });- metas.push({- property: "og:description",- content: pageMeta.description,- });- }-- if (pageMeta.socialImageAssetName) {- metas.push({- property: "og:image",- content: `https://${data.host}${imageLoader({- src: pageMeta.socialImageAssetName,- // Do not transform social image (not enough information do we need to do this)- format: "raw",- })}`,- });- } else if (pageMeta.socialImageUrl) {- metas.push({- property: "og:image",- content: pageMeta.socialImageUrl,- });- }-- metas.push(...pageMeta.custom);-return metas;};@@ -323,7 +272,8 @@ export const action = async ({};const Outlet = () => {- const { system, resources, url } = useLoaderData<typeof loader>();+ const { system, resources, url, pageMeta, host } =+ useLoaderData<typeof loader>();return (<ReactSdkContext.Providervalue={{@@ -334,6 +284,13 @@ const Outlet = () => {>{/* Use the URL as the key to force scripts in HTML Embed to reload on dynamic pages */}<Page key={url} system={system} />+ <PageSettingsMeta+ url={url}+ pageMeta={pageMeta}+ host={host}+ siteName={siteName}+ imageLoader={imageLoader}+ /></ReactSdkContext.Provider>);};diff --git a/packages/feature-flags/src/flags.ts b/packages/feature-flags/src/flags.tsindex 7e32615d75..aa21810002 100644--- a/packages/feature-flags/src/flags.ts+++ b/packages/feature-flags/src/flags.ts@@ -8,3 +8,4 @@ export const xmlElement = false;export const staticExport = false;export const contentEditableMode = false;export const command = false;+export const headSlotComponent = false;diff --git a/packages/react-sdk/src/page-settings-meta.tsx b/packages/react-sdk/src/page-settings-meta.tsxnew file mode 100644index 0000000000..c71514ac4e--- /dev/null+++ b/packages/react-sdk/src/page-settings-meta.tsx@@ -0,0 +1,139 @@+import type { ImageLoader } from "@webstudio-is/image";+import type { PageMeta } from "@webstudio-is/sdk";+import { useEffect, useState } from "react";++type MetaProps = {+ property?: string;+ name?: string;+ content: string;+};++// Not documented+const isElementRenderedWithReact = (element: Element) => {+ return Object.keys(element).some((key) => key.startsWith("__react"));+};++const isServer = typeof window === "undefined";++/**+ * Meta tags are deduplicated on the server using the HTMLRewriter interface.+ * This is not full deduplication. We simply skip rendering Page Setting meta+ * if it has already been rendered using HeadSlot/HeadMeta.+ * To prevent React on the client from re-adding the removed meta tags, we skip rendering them client-side.+ * This approach works because React retains server-rendered meta tags as long as they are not re-rendered by the client.+ *+ * The following component behavior ensures this:+ * 1. On the server: Render meta tags as usual.+ * 2. On the client: Before rendering, remove any meta tags with the same `name` or `property` that were not rendered by Client React,+ * and then proceed with rendering as usual.+ */+const Meta = (props: MetaProps) => {+ const [localProps, setLocalProps] = useState<MetaProps | undefined>();++ useEffect(() => {+ const selector = `meta[${props.name ? `name="${props.name}"` : `property="${props.property}"`}]`;+ let allMetas = document.querySelectorAll(selector);++ for (const meta of allMetas) {+ if (!isElementRenderedWithReact(meta)) {+ meta.remove();+ }+ }++ allMetas = document.querySelectorAll(selector);++ if (allMetas.length === 0) {+ setLocalProps(props);+ }+ }, [props]);++ if (isServer) {+ return <meta {...props} />;+ }++ if (localProps === undefined) {+ // This method also works during hydration because React retains server-rendered tags+ // as long as they are not re-rendered by the client.+ return;+ }++ return <meta {...localProps} />;+};++export const PageSettingsMeta = ({+ url,+ host,+ siteName,+ pageMeta,+ imageLoader,+}: {+ url?: string;+ host: string;+ siteName: string;+ pageMeta: PageMeta;+ imageLoader: ImageLoader;+}) => {+ const metas: // | { title: string }+ { property?: string; name?: string; content: string }[] = [];++ if (url !== undefined) {+ metas.push({+ property: "og:url",+ content: url,+ });+ }++ if (pageMeta.title) {+ metas.push({+ property: "og:title",+ content: pageMeta.title,+ });+ }++ metas.push({ property: "og:type", content: "website" });++ if (siteName) {+ metas.push({+ property: "og:site_name",+ content: siteName,+ });+ }++ if (pageMeta.excludePageFromSearch) {+ metas.push({+ name: "robots",+ content: "noindex, nofollow",+ });+ }++ if (pageMeta.description) {+ metas.push({+ name: "description",+ content: pageMeta.description,+ });+ metas.push({+ property: "og:description",+ content: pageMeta.description,+ });+ }++ if (pageMeta.socialImageAssetName) {+ metas.push({+ property: "og:image",+ content: `https://${host}${imageLoader({+ src: pageMeta.socialImageAssetName,+ // Do not transform social image (not enough information do we need to do this)+ format: "raw",+ })}`,+ });+ } else if (pageMeta.socialImageUrl) {+ metas.push({+ property: "og:image",+ content: pageMeta.socialImageUrl,+ });+ }++ metas.push(...pageMeta.custom);++ return metas.map((meta, index) => <Meta key={index} {...meta} />);+};diff --git a/packages/react-sdk/src/runtime.ts b/packages/react-sdk/src/runtime.tsindex c294ca4970..a56b0c81fd 100644--- a/packages/react-sdk/src/runtime.ts+++ b/packages/react-sdk/src/runtime.ts@@ -1,6 +1,7 @@export * from "./context";export * from "./hook";export * from "./variable-state";+export * from "./page-settings-meta";/*** React has issues rendering certain elements, such as errors when a <link> element has children.diff --git a/packages/sdk-components-react-router/src/templates.ts b/packages/sdk-components-react-router/src/templates.tsnew file mode 100644index 0000000000..e69de29bb2diff --git a/packages/sdk-components-react/src/__generated__/head-link.props.ts b/packages/sdk-components-react/src/__generated__/head-link.props.tsnew file mode 100644index 0000000000..3382779eb6--- /dev/null+++ b/packages/sdk-components-react/src/__generated__/head-link.props.ts@@ -0,0 +1,676 @@+import type { PropMeta } from "@webstudio-is/sdk";++export const props: Record<string, PropMeta> = {+ about: { required: false, control: "text", type: "string" },+ accessKey: {+ required: false,+ control: "text",+ type: "string",+ description: "Keyboard shortcut to activate or add focus to the element.",+ },+ "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-braillelabel": {+ description:+ "Defines a string value that labels the current element, which is intended to be converted into Braille.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-brailleroledescription": {+ description:+ "Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-busy": { required: false, control: "boolean", type: "boolean" },+ "aria-checked": {+ description:+ 'Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.',+ required: false,+ control: "text",+ type: "string",+ },+ "aria-colcount": {+ description:+ "Defines the total number of columns in a table, grid, or treegrid.",+ 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.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-colindextext": {+ description: "Defines a human readable text alternative of aria-colindex.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-colspan": {+ description:+ "Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-controls": {+ description:+ "Identifies the element (or elements) whose contents or presence are controlled by the current element.",+ 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.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-description": {+ description:+ "Defines a string value that describes or annotates the current element.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-details": {+ description:+ "Identifies the element that provides a detailed, extended description for the object.",+ 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.",+ 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.",+ 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.",+ 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.',+ 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.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-invalid": {+ description:+ "Indicates the entered value does not conform to the format expected by the application.",+ 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:+ "Provides the accessible name that describes an interactive element if no other accessible name exists, for example in a button that contains an image with no text.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-labelledby": {+ description:+ "Identifies the element (or elements) that labels the current element.",+ 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.",+ 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.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-pressed": {+ description: 'Indicates the current "pressed" state of toggle buttons.',+ required: false,+ control: "text",+ type: "string",+ },+ "aria-readonly": {+ description:+ "Indicates that the element is not editable, but is otherwise operable.",+ 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.",+ 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.",+ 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.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-rowindextext": {+ description: "Defines a human readable text alternative of aria-rowindex.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-rowspan": {+ description:+ "Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-selected": {+ description: 'Indicates the current "selected" state of various widgets.',+ 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.",+ 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.",+ 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",+ },+ as: {+ required: false,+ control: "select",+ type: "string",+ options: [+ "object",+ "audio",+ "embed",+ "script",+ "style",+ "track",+ "video",+ "image",+ "document",+ "fetch",+ "font",+ "worker",+ ],+ },+ autoCapitalize: {+ required: false,+ control: "text",+ type: "string",+ description:+ "Sets whether input is automatically capitalized when entered by user.",+ },+ autoCorrect: { required: false, control: "text", type: "string" },+ autoFocus: {+ required: false,+ control: "boolean",+ type: "boolean",+ description:+ "Indicates that an element should be focused on page load, or when its parent dialog is displayed.",+ },+ autoSave: { required: false, control: "text", type: "string" },+ charSet: {+ required: false,+ control: "text",+ type: "string",+ description: "Declares the character encoding of the page or script.",+ },+ className: { required: false, control: "text", type: "string" },+ color: {+ required: false,+ control: "color",+ type: "string",+ description:+ "This attribute sets the text color using either a named color or a color specified in the hexadecimal #RRGGBB format. Note: This is a legacy attribute. Please use the CSS color property instead.",+ },+ content: {+ required: false,+ control: "text",+ type: "string",+ description:+ "A value associated with http-equiv orname depending on the context.",+ },+ contextMenu: {+ required: false,+ control: "text",+ type: "string",+ description:+ "Defines the ID of a menu element which willserve as the element's context menu.",+ },+ crossOrigin: {+ required: false,+ control: "radio",+ type: "string",+ options: ["", "anonymous", "use-credentials"],+ description: "How the element handles cross-origin requests",+ },+ datatype: { required: false, control: "text", type: "string" },+ defaultChecked: { required: false, control: "boolean", type: "boolean" },+ defaultValue: { required: false, control: "text", type: "string" },+ dir: {+ required: false,+ control: "text",+ type: "string",+ description:+ "Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)",+ },+ draggable: {+ required: false,+ control: "boolean",+ type: "boolean",+ description: "Defines whether the element can be dragged.",+ },+ fetchPriority: {+ required: false,+ control: "radio",+ type: "string",+ options: ["high", "low", "auto"],+ },+ hidden: {+ required: false,+ control: "boolean",+ type: "boolean",+ description:+ "Prevents rendering of given element, while keeping child elements, e.g. script elements, active.",+ },+ href: {+ required: false,+ control: "text",+ type: "string",+ description: "The URL of a linked resource.",+ },+ hrefLang: {+ required: false,+ control: "text",+ type: "string",+ description: "Specifies the language of the linked resource.",+ },+ id: {+ required: false,+ control: "text",+ type: "string",+ description:+ "Often used with CSS to style a specific element. The value of this attribute must be unique.",+ },+ imageSizes: { required: false, control: "text", type: "string" },+ imageSrcSet: { required: false, control: "text", type: "string" },+ inputMode: {+ description:+ "Hints at the type of data that might be entered by the user while editing the element or its contents",+ required: false,+ control: "select",+ type: "string",+ options: [+ "search",+ "text",+ "none",+ "tel",+ "url",+ "email",+ "numeric",+ "decimal",+ ],+ },+ integrity: {+ required: false,+ control: "text",+ type: "string",+ description:+ "Specifies a Subresource Integrity value that allows browsers to verify what they fetch.",+ },+ is: {+ description:+ "Specify that a standard HTML element should behave like a defined custom built-in element",+ required: false,+ control: "text",+ type: "string",+ },+ itemID: { required: false, control: "text", type: "string" },+ itemProp: { required: false, control: "text", type: "string" },+ itemRef: { required: false, control: "text", type: "string" },+ itemScope: { required: false, control: "boolean", type: "boolean" },+ itemType: { required: false, control: "text", type: "string" },+ lang: {+ required: false,+ control: "text",+ type: "string",+ description: "Defines the language used in the element.",+ },+ media: {+ required: false,+ control: "text",+ type: "string",+ description:+ "Specifies a hint of the media for which the linked resource was designed.",+ },+ nonce: { required: false, control: "text", type: "string" },+ prefix: { required: false, control: "text", type: "string" },+ property: { required: false, control: "text", type: "string" },+ radioGroup: { required: false, control: "text", type: "string" },+ referrerPolicy: {+ required: false,+ control: "select",+ type: "string",+ options: [+ "",+ "origin",+ "no-referrer",+ "no-referrer-when-downgrade",+ "origin-when-cross-origin",+ "same-origin",+ "strict-origin",+ "strict-origin-when-cross-origin",+ "unsafe-url",+ ],+ description: "Specifies which referrer is sent when fetching the resource.",+ },+ rel: {+ required: false,+ control: "select",+ type: "string",+ options: [+ "search",+ "preload",+ "manifest",+ "alternate",+ "author",+ "canonical",+ "dns-prefetch",+ "help",+ "icon",+ "license",+ "modulepreload",+ "next",+ "nofollow",+ "noopener",+ "noreferrer",+ "opener",+ "pingback",+ "preconnect",+ "prefetch",+ "prev",+ "stylesheet",+ "tag",+ ],+ description:+ "Specifies the relationship of the target object to the link object.",+ },+ resource: { required: false, control: "text", type: "string" },+ results: { required: false, control: "number", type: "number" },+ rev: { required: false, control: "text", type: "string" },+ role: {+ required: false,+ control: "text",+ type: "string",+ description:+ "Defines an explicit role for an element for use by assistive technologies.",+ },+ security: { required: false, control: "text", type: "string" },+ sizes: { required: false, control: "text", type: "string" },+ slot: {+ required: false,+ control: "text",+ type: "string",+ description: "Assigns a slot in a shadow DOM shadow tree to an element.",+ },+ spellCheck: {+ required: false,+ control: "boolean",+ type: "boolean",+ description: "Indicates whether spell checking is allowed for the element.",+ },+ suppressContentEditableWarning: {+ required: false,+ control: "boolean",+ type: "boolean",+ },+ suppressHydrationWarning: {+ required: false,+ control: "boolean",+ type: "boolean",+ },+ tabIndex: {+ required: false,+ control: "number",+ type: "number",+ description:+ "Overrides the browser's default tab order and follows the one specified instead.",+ },+ title: {+ required: false,+ control: "text",+ type: "string",+ description:+ "Text to be displayed in a tooltip when hovering over the element.",+ },+ translate: {+ required: false,+ control: "radio",+ type: "string",+ options: ["yes", "no"],+ description:+ "Specify whether an element's attribute values and the values of its text node children are to be translated when the page is localized, or whether to leave them unchanged.",+ },+ type: {+ required: false,+ control: "text",+ type: "string",+ description: "Defines the type of the element.",+ },+ typeof: { required: false, control: "text", type: "string" },+ unselectable: {+ required: false,+ control: "radio",+ type: "string",+ options: ["on", "off"],+ },+ vocab: { required: false, control: "text", type: "string" },+};diff --git a/packages/sdk-components-react/src/__generated__/head-meta.props.ts b/packages/sdk-components-react/src/__generated__/head-meta.props.tsnew file mode 100644index 0000000000..deb84637e1--- /dev/null+++ b/packages/sdk-components-react/src/__generated__/head-meta.props.ts@@ -0,0 +1,588 @@+import type { PropMeta } from "@webstudio-is/sdk";++export const props: Record<string, PropMeta> = {+ about: { required: false, control: "text", type: "string" },+ accessKey: {+ required: false,+ control: "text",+ type: "string",+ description: "Keyboard shortcut to activate or add focus to the element.",+ },+ "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-braillelabel": {+ description:+ "Defines a string value that labels the current element, which is intended to be converted into Braille.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-brailleroledescription": {+ description:+ "Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-busy": { required: false, control: "boolean", type: "boolean" },+ "aria-checked": {+ description:+ 'Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.',+ required: false,+ control: "text",+ type: "string",+ },+ "aria-colcount": {+ description:+ "Defines the total number of columns in a table, grid, or treegrid.",+ 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.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-colindextext": {+ description: "Defines a human readable text alternative of aria-colindex.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-colspan": {+ description:+ "Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-controls": {+ description:+ "Identifies the element (or elements) whose contents or presence are controlled by the current element.",+ 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.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-description": {+ description:+ "Defines a string value that describes or annotates the current element.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-details": {+ description:+ "Identifies the element that provides a detailed, extended description for the object.",+ 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.",+ 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.",+ 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.",+ 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.',+ 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.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-invalid": {+ description:+ "Indicates the entered value does not conform to the format expected by the application.",+ 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:+ "Provides the accessible name that describes an interactive element if no other accessible name exists, for example in a button that contains an image with no text.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-labelledby": {+ description:+ "Identifies the element (or elements) that labels the current element.",+ 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.",+ 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.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-pressed": {+ description: 'Indicates the current "pressed" state of toggle buttons.',+ required: false,+ control: "text",+ type: "string",+ },+ "aria-readonly": {+ description:+ "Indicates that the element is not editable, but is otherwise operable.",+ 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.",+ 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.",+ 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.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-rowindextext": {+ description: "Defines a human readable text alternative of aria-rowindex.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-rowspan": {+ description:+ "Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-selected": {+ description: 'Indicates the current "selected" state of various widgets.',+ 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.",+ 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.",+ 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",+ },+ autoCapitalize: {+ required: false,+ control: "text",+ type: "string",+ description:+ "Sets whether input is automatically capitalized when entered by user.",+ },+ autoCorrect: { required: false, control: "text", type: "string" },+ autoFocus: {+ required: false,+ control: "boolean",+ type: "boolean",+ description:+ "Indicates that an element should be focused on page load, or when its parent dialog is displayed.",+ },+ autoSave: { required: false, control: "text", type: "string" },+ charSet: {+ required: false,+ control: "text",+ type: "string",+ description: "Declares the character encoding of the page or script.",+ },+ className: { required: false, control: "text", type: "string" },+ color: {+ required: false,+ control: "color",+ type: "string",+ description:+ "This attribute sets the text color using either a named color or a color specified in the hexadecimal #RRGGBB format. Note: This is a legacy attribute. Please use the CSS color property instead.",+ },+ content: {+ required: false,+ control: "text",+ type: "string",+ description:+ "A value associated with http-equiv orname depending on the context.",+ },+ contextMenu: {+ required: false,+ control: "text",+ type: "string",+ description:+ "Defines the ID of a menu element which willserve as the element's context menu.",+ },+ datatype: { required: false, control: "text", type: "string" },+ defaultChecked: { required: false, control: "boolean", type: "boolean" },+ defaultValue: { required: false, control: "text", type: "string" },+ dir: {+ required: false,+ control: "text",+ type: "string",+ description:+ "Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)",+ },+ draggable: {+ required: false,+ control: "boolean",+ type: "boolean",+ description: "Defines whether the element can be dragged.",+ },+ hidden: {+ required: false,+ control: "boolean",+ type: "boolean",+ description:+ "Prevents rendering of given element, while keeping child elements, e.g. script elements, active.",+ },+ httpEquiv: {+ required: false,+ control: "text",+ type: "string",+ description: "Defines a pragma directive.",+ },+ id: {+ required: false,+ control: "text",+ type: "string",+ description:+ "Often used with CSS to style a specific element. The value of this attribute must be unique.",+ },+ inputMode: {+ description:+ "Hints at the type of data that might be entered by the user while editing the element or its contents",+ required: false,+ control: "select",+ type: "string",+ options: [+ "search",+ "text",+ "none",+ "tel",+ "url",+ "email",+ "numeric",+ "decimal",+ ],+ },+ is: {+ description:+ "Specify that a standard HTML element should behave like a defined custom built-in element",+ required: false,+ control: "text",+ type: "string",+ },+ itemID: { required: false, control: "text", type: "string" },+ itemProp: { required: false, control: "text", type: "string" },+ itemRef: { required: false, control: "text", type: "string" },+ itemScope: { required: false, control: "boolean", type: "boolean" },+ itemType: { required: false, control: "text", type: "string" },+ lang: {+ required: false,+ control: "text",+ type: "string",+ description: "Defines the language used in the element.",+ },+ media: {+ required: false,+ control: "text",+ type: "string",+ description:+ "Specifies a hint of the media for which the linked resource was designed.",+ },+ name: {+ required: false,+ control: "text",+ type: "string",+ description:+ "This name is important when submitting form data to the server, as it identifies the data associated with the input. When multiple inputs share the same name attribute, they are treated as part of the same group (e.g., radio buttons or checkboxes).",+ },+ nonce: { required: false, control: "text", type: "string" },+ prefix: { required: false, control: "text", type: "string" },+ property: { required: false, control: "text", type: "string" },+ radioGroup: { required: false, control: "text", type: "string" },+ rel: {+ required: false,+ control: "text",+ type: "string",+ description:+ "Specifies the relationship of the target object to the link object.",+ },+ resource: { required: false, control: "text", type: "string" },+ results: { required: false, control: "number", type: "number" },+ rev: { required: false, control: "text", type: "string" },+ role: {+ required: false,+ control: "text",+ type: "string",+ description:+ "Defines an explicit role for an element for use by assistive technologies.",+ },+ security: { required: false, control: "text", type: "string" },+ slot: {+ required: false,+ control: "text",+ type: "string",+ description: "Assigns a slot in a shadow DOM shadow tree to an element.",+ },+ spellCheck: {+ required: false,+ control: "boolean",+ type: "boolean",+ description: "Indicates whether spell checking is allowed for the element.",+ },+ suppressContentEditableWarning: {+ required: false,+ control: "boolean",+ type: "boolean",+ },+ suppressHydrationWarning: {+ required: false,+ control: "boolean",+ type: "boolean",+ },+ tabIndex: {+ required: false,+ control: "number",+ type: "number",+ description:+ "Overrides the browser's default tab order and follows the one specified instead.",+ },+ title: {+ required: false,+ control: "text",+ type: "string",+ description:+ "Text to be displayed in a tooltip when hovering over the element.",+ },+ translate: {+ required: false,+ control: "radio",+ type: "string",+ options: ["yes", "no"],+ description:+ "Specify whether an element's attribute values and the values of its text node children are to be translated when the page is localized, or whether to leave them unchanged.",+ },+ typeof: { required: false, control: "text", type: "string" },+ unselectable: {+ required: false,+ control: "radio",+ type: "string",+ options: ["on", "off"],+ },+ vocab: { required: false, control: "text", type: "string" },+};diff --git a/packages/sdk-components-react/src/__generated__/head-slot.props.ts b/packages/sdk-components-react/src/__generated__/head-slot.props.tsnew file mode 100644index 0000000000..6898f60c0e--- /dev/null+++ b/packages/sdk-components-react/src/__generated__/head-slot.props.ts@@ -0,0 +1,3 @@+import type { PropMeta } from "@webstudio-is/sdk";++export const props: Record<string, PropMeta> = {};diff --git a/packages/sdk-components-react/src/__generated__/head.props.ts b/packages/sdk-components-react/src/__generated__/head.props.tsnew file mode 100644index 0000000000..36d0f94ab0--- /dev/null+++ b/packages/sdk-components-react/src/__generated__/head.props.ts@@ -0,0 +1,562 @@+import type { PropMeta } from "@webstudio-is/sdk";++export const props: Record<string, PropMeta> = {+ about: { required: false, control: "text", type: "string" },+ accessKey: {+ required: false,+ control: "text",+ type: "string",+ description: "Keyboard shortcut to activate or add focus to the element.",+ },+ "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-braillelabel": {+ description:+ "Defines a string value that labels the current element, which is intended to be converted into Braille.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-brailleroledescription": {+ description:+ "Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-busy": { required: false, control: "boolean", type: "boolean" },+ "aria-checked": {+ description:+ 'Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.',+ required: false,+ control: "text",+ type: "string",+ },+ "aria-colcount": {+ description:+ "Defines the total number of columns in a table, grid, or treegrid.",+ 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.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-colindextext": {+ description: "Defines a human readable text alternative of aria-colindex.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-colspan": {+ description:+ "Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-controls": {+ description:+ "Identifies the element (or elements) whose contents or presence are controlled by the current element.",+ 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.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-description": {+ description:+ "Defines a string value that describes or annotates the current element.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-details": {+ description:+ "Identifies the element that provides a detailed, extended description for the object.",+ 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.",+ 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.",+ 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.",+ 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.',+ 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.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-invalid": {+ description:+ "Indicates the entered value does not conform to the format expected by the application.",+ 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:+ "Provides the accessible name that describes an interactive element if no other accessible name exists, for example in a button that contains an image with no text.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-labelledby": {+ description:+ "Identifies the element (or elements) that labels the current element.",+ 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.",+ 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.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-pressed": {+ description: 'Indicates the current "pressed" state of toggle buttons.',+ required: false,+ control: "text",+ type: "string",+ },+ "aria-readonly": {+ description:+ "Indicates that the element is not editable, but is otherwise operable.",+ 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.",+ 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.",+ 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.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-rowindextext": {+ description: "Defines a human readable text alternative of aria-rowindex.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-rowspan": {+ description:+ "Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-selected": {+ description: 'Indicates the current "selected" state of various widgets.',+ 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.",+ 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.",+ 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",+ },+ autoCapitalize: {+ required: false,+ control: "text",+ type: "string",+ description:+ "Sets whether input is automatically capitalized when entered by user.",+ },+ autoCorrect: { required: false, control: "text", type: "string" },+ autoFocus: {+ required: false,+ control: "boolean",+ type: "boolean",+ description:+ "Indicates that an element should be focused on page load, or when its parent dialog is displayed.",+ },+ autoSave: { required: false, control: "text", type: "string" },+ className: { required: false, control: "text", type: "string" },+ color: {+ required: false,+ control: "color",+ type: "string",+ description:+ "This attribute sets the text color using either a named color or a color specified in the hexadecimal #RRGGBB format. Note: This is a legacy attribute. Please use the CSS color property instead.",+ },+ content: {+ required: false,+ control: "text",+ type: "string",+ description:+ "A value associated with http-equiv orname depending on the context.",+ },+ contextMenu: {+ required: false,+ control: "text",+ type: "string",+ description:+ "Defines the ID of a menu element which willserve as the element's context menu.",+ },+ datatype: { required: false, control: "text", type: "string" },+ defaultChecked: { required: false, control: "boolean", type: "boolean" },+ defaultValue: { required: false, control: "text", type: "string" },+ dir: {+ required: false,+ control: "text",+ type: "string",+ description:+ "Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)",+ },+ draggable: {+ required: false,+ control: "boolean",+ type: "boolean",+ description: "Defines whether the element can be dragged.",+ },+ hidden: {+ required: false,+ control: "boolean",+ type: "boolean",+ description:+ "Prevents rendering of given element, while keeping child elements, e.g. script elements, active.",+ },+ id: {+ required: false,+ control: "text",+ type: "string",+ description:+ "Often used with CSS to style a specific element. The value of this attribute must be unique.",+ },+ inputMode: {+ description:+ "Hints at the type of data that might be entered by the user while editing the element or its contents",+ required: false,+ control: "select",+ type: "string",+ options: [+ "search",+ "text",+ "none",+ "tel",+ "url",+ "email",+ "numeric",+ "decimal",+ ],+ },+ is: {+ description:+ "Specify that a standard HTML element should behave like a defined custom built-in element",+ required: false,+ control: "text",+ type: "string",+ },+ itemID: { required: false, control: "text", type: "string" },+ itemProp: { required: false, control: "text", type: "string" },+ itemRef: { required: false, control: "text", type: "string" },+ itemScope: { required: false, control: "boolean", type: "boolean" },+ itemType: { required: false, control: "text", type: "string" },+ lang: {+ required: false,+ control: "text",+ type: "string",+ description: "Defines the language used in the element.",+ },+ nonce: { required: false, control: "text", type: "string" },+ prefix: { required: false, control: "text", type: "string" },+ property: { required: false, control: "text", type: "string" },+ radioGroup: { required: false, control: "text", type: "string" },+ rel: {+ required: false,+ control: "text",+ type: "string",+ description:+ "Specifies the relationship of the target object to the link object.",+ },+ resource: { required: false, control: "text", type: "string" },+ results: { required: false, control: "number", type: "number" },+ rev: { required: false, control: "text", type: "string" },+ role: {+ required: false,+ control: "text",+ type: "string",+ description:+ "Defines an explicit role for an element for use by assistive technologies.",+ },+ security: { required: false, control: "text", type: "string" },+ slot: {+ required: false,+ control: "text",+ type: "string",+ description: "Assigns a slot in a shadow DOM shadow tree to an element.",+ },+ spellCheck: {+ required: false,+ control: "boolean",+ type: "boolean",+ description: "Indicates whether spell checking is allowed for the element.",+ },+ suppressContentEditableWarning: {+ required: false,+ control: "boolean",+ type: "boolean",+ },+ suppressHydrationWarning: {+ required: false,+ control: "boolean",+ type: "boolean",+ },+ tabIndex: {+ required: false,+ control: "number",+ type: "number",+ description:+ "Overrides the browser's default tab order and follows the one specified instead.",+ },+ title: {+ required: false,+ control: "text",+ type: "string",+ description:+ "Text to be displayed in a tooltip when hovering over the element.",+ },+ translate: {+ required: false,+ control: "radio",+ type: "string",+ options: ["yes", "no"],+ description:+ "Specify whether an element's attribute values and the values of its text node children are to be translated when the page is localized, or whether to leave them unchanged.",+ },+ typeof: { required: false, control: "text", type: "string" },+ unselectable: {+ required: false,+ control: "radio",+ type: "string",+ options: ["on", "off"],+ },+ vocab: { required: false, control: "text", type: "string" },+};diff --git a/packages/sdk-components-react/src/components.ts b/packages/sdk-components-react/src/components.tsindex 44a45a0d78..aa396b3e4e 100644--- a/packages/sdk-components-react/src/components.ts+++ b/packages/sdk-components-react/src/components.ts@@ -38,3 +38,6 @@ export { XmlTime } from "./xml-time";export { Time } from "./time";export { Select } from "./select";export { Option } from "./option";+export { HeadSlot } from "./head-slot";+export { HeadLink } from "./head-link";+export { HeadMeta } from "./head-meta";diff --git a/packages/sdk-components-react/src/head-link.tsx b/packages/sdk-components-react/src/head-link.tsxnew file mode 100644index 0000000000..d5e8bb2614--- /dev/null+++ b/packages/sdk-components-react/src/head-link.tsx@@ -0,0 +1,87 @@+import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";+import {+ forwardRef,+ type ElementRef,+ type ComponentProps,+ useContext,+} from "react";+import { XmlNode } from "./xml-node";++export const defaultTag = "link";++type LinkRel =+ | "alternate"+ | "author"+ | "canonical"+ | "dns-prefetch"+ | "help"+ | "icon"+ | "license"+ | "manifest"+ | "modulepreload"+ | "next"+ | "nofollow"+ | "noopener"+ | "noreferrer"+ | "opener"+ | "pingback"+ | "preconnect"+ | "prefetch"+ | "preload"+ | "prev"+ | "search"+ | "stylesheet"+ | "tag";++type LinkAs =+ | "audio"+ | "document"+ | "embed"+ | "fetch"+ | "font"+ | "image"+ | "object"+ | "script"+ | "style"+ | "track"+ | "video"+ | "worker";++const PROPS_ORDER = ["rel", "hrefLang", "href", "type", "as"] as const;++export const HeadLink = forwardRef<+ ElementRef<"div">,+ { rel?: LinkRel; as?: LinkAs } & ComponentProps<typeof defaultTag>+>(({ ...props }, ref) => {+ const { renderer } = useContext(ReactSdkContext);++ const propsSet = new Set([...PROPS_ORDER, ...Object.keys(props)]) as Set<+ keyof typeof props+ >;++ const cleanOrderedProps: Record<string, unknown> = {};++ for (const prop of propsSet) {+ // Boolean check is not a mistake; it excludes empty values.+ // Empty properties must be excluded because there is no UI to reset them to undefined.+ if (prop in props && Boolean(props[prop])) {+ cleanOrderedProps[prop] = props[prop];+ }+ }++ if (renderer === undefined) {+ return <link {...cleanOrderedProps} />;+ }++ // HTML attributes are case-insensitive, but the convention is to use lowercase+ const htmlAttributes = Object.fromEntries(+ Object.entries(cleanOrderedProps).map(([key, value]) => [+ key?.toLowerCase(),+ value,+ ])+ );++ return <XmlNode tag={defaultTag} {...htmlAttributes} ref={ref} />;+});++HeadLink.displayName = "HeadLink";diff --git a/packages/sdk-components-react/src/head-link.ws.ts b/packages/sdk-components-react/src/head-link.ws.tsnew file mode 100644index 0000000000..abdf5d56af--- /dev/null+++ b/packages/sdk-components-react/src/head-link.ws.ts@@ -0,0 +1,23 @@+import { Link2Icon } from "@webstudio-is/icons/svg";+import {+ type WsComponentMeta,+ type WsComponentPropsMeta,+} from "@webstudio-is/sdk";++import { props } from "./__generated__/head-link.props";++export const meta: WsComponentMeta = {+ category: "hidden",+ icon: Link2Icon,+ type: "container",+ stylable: false,+ constraints: {+ relation: "parent",+ component: { $eq: "HeadSlot" },+ },+};++export const propsMeta: WsComponentPropsMeta = {+ props,+ initialProps: ["rel", "hrefLang", "href", "type", "as"],+};diff --git a/packages/sdk-components-react/src/head-meta.tsx b/packages/sdk-components-react/src/head-meta.tsxnew file mode 100644index 0000000000..2a9e9be7b4--- /dev/null+++ b/packages/sdk-components-react/src/head-meta.tsx@@ -0,0 +1,50 @@+import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";+import {+ forwardRef,+ type ElementRef,+ type ComponentProps,+ useContext,+} from "react";+import { XmlNode } from "./xml-node";++export const defaultTag = "meta";++const PROPS_ORDER = ["property", "name", "content"] as const;++export const HeadMeta = forwardRef<+ ElementRef<"div">,+ ComponentProps<typeof defaultTag>+>(({ ...props }, ref) => {+ const { renderer } = useContext(ReactSdkContext);++ const propsSet = new Set([...PROPS_ORDER, ...Object.keys(props)]) as Set<+ keyof typeof props+ >;++ const cleanOrderedProps: Record<string, unknown> = {};++ for (const prop of propsSet) {+ // Boolean check is not a mistake; it excludes empty values.+ // Empty properties must be excluded because there is no UI to reset them to undefined.+ // Additionally, <meta property="" name="someName" content="someContent" /> is invalid.+ if (prop in props && Boolean(props[prop])) {+ cleanOrderedProps[prop] = props[prop];+ }+ }++ if (renderer === undefined) {+ return <meta {...cleanOrderedProps} />;+ }++ // HTML attributes are case-insensitive, but the convention is to use lowercase+ const htmlAttributes = Object.fromEntries(+ Object.entries(cleanOrderedProps).map(([key, value]) => [+ key?.toLowerCase(),+ value,+ ])+ );++ return <XmlNode tag={defaultTag} {...htmlAttributes} ref={ref} />;+});++HeadMeta.displayName = "HeadMeta";diff --git a/packages/sdk-components-react/src/head-meta.ws.ts b/packages/sdk-components-react/src/head-meta.ws.tsnew file mode 100644index 0000000000..80ad828409--- /dev/null+++ b/packages/sdk-components-react/src/head-meta.ws.ts@@ -0,0 +1,23 @@+import { Link2Icon } from "@webstudio-is/icons/svg";+import {+ type WsComponentMeta,+ type WsComponentPropsMeta,+} from "@webstudio-is/sdk";++import { props } from "./__generated__/head-meta.props";++export const meta: WsComponentMeta = {+ category: "hidden",+ icon: Link2Icon,+ type: "container",+ stylable: false,+ constraints: {+ relation: "parent",+ component: { $eq: "HeadSlot" },+ },+};++export const propsMeta: WsComponentPropsMeta = {+ props,+ initialProps: ["name", "property", "content"],+};diff --git a/packages/sdk-components-react/src/head-slot.template.tsx b/packages/sdk-components-react/src/head-slot.template.tsxnew file mode 100644index 0000000000..b6fc69fefa--- /dev/null+++ b/packages/sdk-components-react/src/head-slot.template.tsx@@ -0,0 +1,13 @@+import { type TemplateMeta, $ } from "@webstudio-is/template";++export const meta: TemplateMeta = {+ category: "general",+ description: "Head",+ order: 4,+ template: (+ <$.HeadSlot>+ <$.HeadLink ws:label="Link" rel="help" href="/help"></$.HeadLink>+ <$.HeadMeta ws:label="Meta" name="keywords" content="SEO"></$.HeadMeta>+ </$.HeadSlot>+ ),+};diff --git a/packages/sdk-components-react/src/head-slot.tsx b/packages/sdk-components-react/src/head-slot.tsxnew file mode 100644index 0000000000..c081096302--- /dev/null+++ b/packages/sdk-components-react/src/head-slot.tsx@@ -0,0 +1,75 @@+import {+ getClosestInstance,+ ReactSdkContext,+ type Hook,+} from "@webstudio-is/react-sdk/runtime";+import { forwardRef, type ElementRef, useContext, type ReactNode } from "react";+import { XmlNode } from "./xml-node";++export const defaultTag = "head";++export const HeadSlot = forwardRef<+ ElementRef<"div">,+ { "data-ws-expand"?: boolean } & { children: ReactNode }+>(({ children, ...props }, ref) => {+ const { renderer } = useContext(ReactSdkContext);++ if (renderer === undefined) {+ return children;+ }++ if (props["data-ws-expand"] !== true) {+ return null;+ }++ return (+ <div+ ref={ref}+ style={{+ backgroundColor: "rgba(255,255,255,1)",+ padding: "8px",+ position: "fixed",+ top: 0,+ left: 0,+ right: 0,+ zIndex: 1000,+ }}+ {...props}+ >+ <XmlNode tag={defaultTag}>{children}</XmlNode>+ </div>+ );+});++HeadSlot.displayName = "HeadSlot";++export const hooksHeadSlot: Hook = {+ onNavigatorUnselect: (context, event) => {+ for (const instance of event.instancePath) {+ if (instance.component === `HeadSlot`) {+ const popover = getClosestInstance(+ event.instancePath,+ instance,+ `HeadSlot`+ );+ if (popover) {+ context.setMemoryProp(popover, "data-ws-expand", undefined);+ }+ }+ }+ },+ onNavigatorSelect: (context, event) => {+ for (const instance of event.instancePath) {+ if (instance.component === `HeadSlot`) {+ const popover = getClosestInstance(+ event.instancePath,+ instance,+ `HeadSlot`+ );+ if (popover) {+ context.setMemoryProp(popover, "data-ws-expand", true);+ }+ }+ }+ },+};diff --git a/packages/sdk-components-react/src/head-slot.ws.ts b/packages/sdk-components-react/src/head-slot.ws.tsnew file mode 100644index 0000000000..bbb476b1b8--- /dev/null+++ b/packages/sdk-components-react/src/head-slot.ws.ts@@ -0,0 +1,29 @@+import { HeaderIcon } from "@webstudio-is/icons/svg";+import {+ type WsComponentMeta,+ type WsComponentPropsMeta,+} from "@webstudio-is/sdk";++import { props } from "./__generated__/head.props";++export const meta: WsComponentMeta = {+ icon: HeaderIcon,+ type: "container",+ stylable: false,+ description: "Inserts children into the head of the document",+ constraints: [+ {+ relation: "ancestor",+ component: { $nin: ["HeadSlot"] },+ },+ {+ relation: "child",+ component: { $in: ["HeadLink", "HeadMeta"] },+ },+ ],+};++export const propsMeta: WsComponentPropsMeta = {+ props,+ initialProps: [],+};diff --git a/packages/sdk-components-react/src/hooks.ts b/packages/sdk-components-react/src/hooks.tsindex a724726ed1..e674ef4fa1 100644--- a/packages/sdk-components-react/src/hooks.ts+++ b/packages/sdk-components-react/src/hooks.ts@@ -1,4 +1,5 @@import type { Hook } from "@webstudio-is/react-sdk";import { hooksSelect } from "./select";+import { hooksHeadSlot } from "./head-slot";-export const hooks: Hook[] = [hooksSelect];+export const hooks: Hook[] = [hooksSelect, hooksHeadSlot];diff --git a/packages/sdk-components-react/src/metas.ts b/packages/sdk-components-react/src/metas.tsindex 2156ed2f00..961ff4c4c8 100644--- a/packages/sdk-components-react/src/metas.ts+++ b/packages/sdk-components-react/src/metas.ts@@ -38,3 +38,6 @@ export { meta as XmlTime } from "./xml-time.ws";export { meta as Time } from "./time.ws";export { meta as Select } from "./select.ws";export { meta as Option } from "./option.ws";+export { meta as HeadSlot } from "./head-slot.ws";+export { meta as HeadLink } from "./head-link.ws";+export { meta as HeadMeta } from "./head-meta.ws";diff --git a/packages/sdk-components-react/src/props.ts b/packages/sdk-components-react/src/props.tsindex 27c2238375..4e08850784 100644--- a/packages/sdk-components-react/src/props.ts+++ b/packages/sdk-components-react/src/props.ts@@ -38,3 +38,6 @@ export { propsMeta as XmlTime } from "./xml-time.ws";export { propsMeta as Time } from "./time.ws";export { propsMeta as Select } from "./select.ws";export { propsMeta as Option } from "./option.ws";+export { propsMeta as HeadSlot } from "./head-slot.ws";+export { propsMeta as HeadLink } from "./head-link.ws";+export { propsMeta as HeadMeta } from "./head-meta.ws";diff --git a/packages/sdk-components-react/src/templates.ts b/packages/sdk-components-react/src/templates.tsindex 05584079e9..2b59e2396f 100644--- a/packages/sdk-components-react/src/templates.ts+++ b/packages/sdk-components-react/src/templates.ts@@ -15,3 +15,4 @@ export { meta as Checkbox } from "./checkbox.template";export { meta as Vimeo } from "./vimeo.template";export { meta as YouTube } from "./youtube.template";export { meta as Select } from "./select.template";+export { meta as HeadSlot } from "./head-slot.template";diff --git a/packages/sdk-components-react/src/xml-node.stories.tsx b/packages/sdk-components-react/src/xml-node.stories.tsxnew file mode 100644index 0000000000..75bc0e256a--- /dev/null+++ b/packages/sdk-components-react/src/xml-node.stories.tsx@@ -0,0 +1,38 @@+import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";+import { XmlNode } from "./xml-node";++const Component = () => {+ return (+ <ReactSdkContext.Provider+ value={{+ renderer: "canvas",+ assetBaseUrl: "/",+ imageLoader: ({ src }) => src,+ resources: {},+ }}+ >+ <XmlNode tag="root">+ <XmlNode tag="hello" rel="hihi" hreflang="joajoajoaja aokaoja aojaoj">+ Hi All Hi All Hi All Hi AllHi AllHi All Hi AllHi AllHi All+ </XmlNode>+ <XmlNode tag="hello" rel="hihi"></XmlNode>+ </XmlNode>+ </ReactSdkContext.Provider>+ );+};++export default {+ title: "Components/XmlNode",+};++const Story = {+ render() {+ return (+ <>+ <Component />+ </>+ );+ },+};++export { Story as XmlNode };diff --git a/packages/sdk-components-react/src/xml-node.tsx b/packages/sdk-components-react/src/xml-node.tsxindex 8619c0ecf0..8e9e781d61 100644--- a/packages/sdk-components-react/src/xml-node.tsx+++ b/packages/sdk-components-react/src/xml-node.tsx@@ -57,29 +57,44 @@ export const XmlNode = forwardRef<ElementRef<"div">, Props>(childrenArray.length > 0 &&childrenArray.every((child) => typeof child === "string");- const attributes = attributeEntries.map(- ([key, value]) => `${key}=${JSON.stringify(value)}`- );+ const renderAttributes = (attrs: [string, string][]) => {+ return attrs.map(([name, value], index) => {+ return (+ <span key={index}>+ {" "}+ <span style={{ color: "#FF0000" }}>{name}</span>+ <span style={{ color: "#000000" }}>=</span>+ <span style={{ color: "#0000FF" }}>"{value}"</span>+ </span>+ );+ });+ };return (<div {...props}>- <span style={{ color: "rgb(16, 23, 233)" }}>- <{[elementName, ...attributes].join(" ")}>+ <span>+ <span style={{ color: "#800000" }}><{elementName}</span>+ {attributeEntries.length > 0 && renderAttributes(attributeEntries)}+ {childrenArray.length === 0 ? (+ <span style={{ color: "#800000" }}>/></span>+ ) : (+ <span style={{ color: "#800000" }}>></span>+ )}</span>{childrenArray.length > 0 && (- <div- ref={ref}- style={{- display: isTextChild ? "inline" : "block",- marginLeft: isTextChild ? 0 : "1rem",- }}- >- {children}- </div>+ <>+ <div+ ref={ref}+ style={{+ display: isTextChild ? "inline" : "block",+ marginLeft: isTextChild ? 0 : "1rem",+ }}+ >+ {children}+ </div>+ <span style={{ color: "#800000" }}></{elementName}></span>+ </>)}- <span style={{ color: "rgb(16, 23, 233)" }}>- </{elementName}>- </span></div>);}diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex e613de6b2d..2c0c6f2311 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -900,6 +900,9 @@ importers:specifier: 18.3.0-canary-14898b6a9-20240318version: 18.3.0-canary-14898b6a9-20240318([email protected])devDependencies:+ '@miniflare/html-rewriter':+ specifier: ^2.14.4+ version: 2.14.4'@remix-run/dev':specifier: 2.15.2version: 2.15.2(patch_hash=yortwzoeu3uj2blmdikhhw5byy)(@remix-run/[email protected]([email protected]([email protected]))([email protected])([email protected]))(@remix-run/[email protected]([email protected]))(@types/[email protected])([email protected])([email protected](@types/[email protected]))([email protected](@cloudflare/[email protected]))@@ -3376,6 +3379,9 @@ packages:resolution: {integrity: sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==}engines: {node: '>=18.18'}+ '@iarna/[email protected]':+ resolution: {integrity: sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==}+'@isaacs/[email protected]':resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==}engines: {node: '>=12'}@@ -3531,6 +3537,26 @@ packages:'@mdx-js/[email protected]':resolution: {integrity: sha512-jLuwRlz8DQfQNiUCJR50Y09CGPq3fLtmtUQfVrj79E0JWu3dvsVcxVIcfhR5h0iXu+/z++zDrYeiJqifRynJkA==}+ '@miniflare/[email protected]':+ resolution: {integrity: sha512-FMmZcC1f54YpF4pDWPtdQPIO8NXfgUxCoR9uyrhxKJdZu7M6n8QKopPVNuaxR40jcsdxb7yKoQoFWnHfzJD9GQ==}+ engines: {node: '>=16.13'}++ '@miniflare/[email protected]':+ resolution: {integrity: sha512-GB/vZn7oLbnhw+815SGF+HU5EZqSxbhIa3mu2L5MzZ2q5VOD5NHC833qG8c2GzDPhIaZ99ITY+ZJmbR4d+4aNQ==}+ engines: {node: '>=16.13'}++ '@miniflare/[email protected]':+ resolution: {integrity: sha512-aXQ5Ik8Iq1KGMBzGenmd6Js/jJgqyYvjom95/N9GptCGpiVWE5F0XqC1SL5rCwURbHN+aWY191o8XOFyY2nCUA==}+ engines: {node: '>=16.7'}++ '@miniflare/[email protected]':+ resolution: {integrity: sha512-upl4RSB3hyCnITOFmRZjJj4A72GmkVrtfZTilkdq5Qe5TTlzsjVeDJp7AuNUM9bM8vswRo+N5jOiot6O4PVwwQ==}+ engines: {node: '>=16.13'}++ '@miniflare/[email protected]':+ resolution: {integrity: sha512-PYn05ET2USfBAeXF6NZfWl0O32KVyE8ncQ/ngysrh3hoIV7l3qGGH7ubeFx+D8VWQ682qYhwGygUzQv2j1tGGg==}+ engines: {node: '>=16.13'}+'@nanostores/[email protected]':resolution: {integrity: sha512-MhbVB7NQLboq/Z9fRTDen9zib/YCffe6mn+3Xg5MOYByMX5Xx98SOZjk/Nd3yvOd/g7GjlQqwXj0KF2lPb6CEQ==}engines: {node: ^18.0.0 || >=20.0.0}@@ -4737,6 +4763,9 @@ packages:'@types/[email protected]':resolution: {integrity: sha512-FcFaxOr2V5KZCviw1TnutEMVUVsGt4D2hP1TAfXZAMKuHYW3xQhe3jTxNPWutgCJ3/X1c5yX8ZoGVEItxKbwBg==}+ '@types/[email protected]':+ resolution: {integrity: sha512-fnQmj8lELIj7BSrZQAdBMHEHX8OZLYIHXqAKT1O7tDfLxaINzf00PMjw22r3N/xXh0w/sGHlO6SVaCQ2mj78lg==}+'@types/[email protected]':resolution: {integrity: sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==}@@ -5238,6 +5267,10 @@ packages:resolution: {integrity: sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==}+ resolution: {integrity: sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==}+ engines: {node: '>=10.16.0'}+resolution: {integrity: sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==}engines: {node: '>= 0.8'}@@ -5648,6 +5681,10 @@ packages:resolution: {integrity: sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q==}+ resolution: {integrity: sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==}+ engines: {node: '>=10'}+resolution: {integrity: sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==}engines: {node: '>=12'}@@ -5904,6 +5941,10 @@ packages:resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==}engines: {node: '>=10'}+ resolution: {integrity: sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==}+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}+resolution: {integrity: sha512-eNTPlAD67BmP31LDINZ3U7HSF8l57TxOY2PmBJ1shpCvpnxBF93mWCE8YHBnXs8qiUZJc9WDcWIeC3a2HIAMfw==}engines: {node: '>=6'}@@ -6195,6 +6236,9 @@ packages:resolution: {integrity: sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==}engines: {node: '>=12'}+ resolution: {integrity: sha512-lNovG8CMCCmcVB1Q7xggMSf7tqPCijZXaH4gL6iE8BFghdQCbaY5Met9i1x2Ex8m/cZHDUtXK9H6/znKamRP8Q==}+resolution: {integrity: sha512-KM1SNmemQtsD+OTInZTYKZNbyPzzVrjMR2Iz1Np+Y+bcxUh0dgKF4NtylJVkGZRLe3NklHizJ5k1Vd3ug1uTPA==}engines: {node: '>=18.20'}@@ -6215,6 +6259,10 @@ packages:resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==}engines: {node: '>=10.17.0'}+ resolution: {integrity: sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==}+ engines: {node: '>=12.20.0'}+resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==}@@ -6413,6 +6461,10 @@ packages:resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==}engines: {node: '>=8'}+ resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==}+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}+resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==}engines: {node: '>= 0.4'}@@ -6949,6 +7001,10 @@ packages:resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==}engines: {node: '>=6'}+ resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==}+ engines: {node: '>=12'}+resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==}engines: {node: '>=18'}@@ -7136,6 +7192,13 @@ packages:resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==}engines: {node: '>=8'}+ resolution: {integrity: sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==}+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}++ resolution: {integrity: sha512-3ShymTWOgqGyNlh5lMJAejLuIv3W1K3fbI5Ewc6YErZU3Sp0PqsNs8UIU1O8z5+KVl/Du5ag56Gza9vdorGEoA==}+resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==}@@ -7184,6 +7247,10 @@ packages:resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==}engines: {node: '>=6'}+ resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==}+ engines: {node: '>=12'}+resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==}engines: {node: '>=12'}@@ -7260,6 +7327,9 @@ packages:resolution: {integrity: sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA==}engines: {node: '>=6'}+ resolution: {integrity: sha512-kBeTUtcj+SkyfaW4+KBe0HtsloBJ/mKTPoxpVdA57GZiPerREsUWJOhVj9anXweFiJkm5y8FG1sxFZkZ0SN6wg==}+resolution: {integrity: sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ==}@@ -7282,6 +7352,10 @@ packages:resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}engines: {node: '>=8'}+ resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==}+ engines: {node: '>=12'}+resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}@@ -8041,6 +8115,10 @@ packages:resolution: {integrity: sha512-QzQxpoacatkreL6jsxnVb7X5R/pGw9OUv2qWTYWnmLpg4NdN31snPy/f3TdQE1ZUXaThRvj1Zw4/OGg0ZkaLMA==}+ resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==}+ engines: {node: '>=10.0.0'}+resolution: {integrity: sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==}engines: {node: '>=0.6.19'}@@ -8081,6 +8159,10 @@ packages:resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==}engines: {node: '>=6'}+ resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==}+ engines: {node: '>=12'}+resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==}engines: {node: '>=8'}@@ -8411,6 +8493,9 @@ packages:resolution: {integrity: sha512-H/A06tKD7sS1O1X2SshBVeA5FLycRpjqiBeqGKmBwBDBy28EnRjORxTNe269KSSr5un5qyWi1iL61wLxpd+ZOg==}+ resolution: {integrity: sha512-DOE84vZT2fEcl9gqCUTcnAw5ZY5Id55ikUcziSUntuEFL3pRvavg5kwDmTEUJkeCHInTlV/HexFomgYnzO5kdQ==}+resolution: {integrity: sha512-Qp95D4TPJl1kC9SKigDcqgyM2VDVO4RiJc2d4qe5GrYm+zbIQCWWKAFaJNQ4BhdFeDGwBmAxqJBwWSJDb9T3BQ==}@@ -8484,6 +8569,10 @@ packages:resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==}+ resolution: {integrity: sha512-mzR0L8ZDktZjpX4OB46KT+56MAhl4EIazWP/+G/HPGuvfdaqg4YsCdtOm6U9+LOFyYDoh4dpnpxZRB9MQQns5Q==}+ engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}+resolution: {integrity: sha512-YuKoXDAhBYxY7SfOKxHBDoSyENFeW5VvIIQp2TGQuit8gpK6MnWaQelBKxso72DoxTZfZdcP3W90LqpSkgPzLQ==}engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}@@ -9702,6 +9791,8 @@ snapshots:'@humanwhocodes/[email protected]': {}+ '@iarna/[email protected]': {}+'@isaacs/[email protected]':dependencies:string-width: 5.1.2@@ -9968,6 +10059,41 @@ snapshots:transitivePeerDependencies:- supports-color+ '@miniflare/[email protected]':+ dependencies:+ '@iarna/toml': 2.2.5+ '@miniflare/queues': 2.14.4+ '@miniflare/shared': 2.14.4+ '@miniflare/watcher': 2.14.4+ busboy: 1.6.0+ dotenv: 10.0.0+ kleur: 4.1.5+ set-cookie-parser: 2.6.0+ undici: 5.28.4+ urlpattern-polyfill: 4.0.3++ '@miniflare/[email protected]':+ dependencies:+ '@miniflare/core': 2.14.4+ '@miniflare/shared': 2.14.4+ html-rewriter-wasm: 0.4.1+ undici: 5.28.4++ '@miniflare/[email protected]':+ dependencies:+ '@miniflare/shared': 2.14.4++ '@miniflare/[email protected]':+ dependencies:+ '@types/better-sqlite3': 7.6.12+ kleur: 4.1.5+ npx-import: 1.1.4+ picomatch: 2.3.1++ '@miniflare/[email protected]':+ dependencies:+ '@miniflare/shared': 2.14.4+dependencies:nanostores: 0.11.3@@ -11338,6 +11464,10 @@ snapshots:dependencies:'@babel/types': 7.25.7+ '@types/[email protected]':+ dependencies:+ '@types/node': 22.10.2+'@types/[email protected]': {}'@types/[email protected](patch_hash=ac22lciodhaj6xmoeignv36gyq)': {}@@ -11986,6 +12116,10 @@ snapshots:dependencies:semver: 7.6.3+ dependencies:+ streamsearch: 1.1.0+@@ -12389,6 +12523,8 @@ snapshots:domelementtype: 2.3.0domhandler: 5.0.3+ [email protected]: {}+@@ -12805,6 +12941,18 @@ snapshots:signal-exit: 3.0.7strip-final-newline: 2.0.0+ dependencies:+ cross-spawn: 7.0.6+ get-stream: 6.0.1+ human-signals: 3.0.1+ is-stream: 3.0.0+ merge-stream: 2.0.0+ npm-run-path: 5.3.0+ onetime: 6.0.0+ signal-exit: 3.0.7+ strip-final-newline: 3.0.0+@@ -13153,6 +13301,8 @@ snapshots:whatwg-encoding: 2.0.0optional: true+ [email protected]: {}+@@ -13182,6 +13332,8 @@ snapshots:+ [email protected]: {}+dependencies:ms: 2.1.3@@ -13353,6 +13505,8 @@ snapshots:+ [email protected]: {}+dependencies:has-tostringtag: 1.0.0@@ -14236,6 +14390,8 @@ snapshots:+ [email protected]: {}+@@ -14405,6 +14561,17 @@ snapshots:dependencies:path-key: 3.1.1+ dependencies:+ path-key: 4.0.0++ dependencies:+ execa: 6.1.0+ parse-package-name: 1.0.0+ semver: 7.6.3+ validate-npm-package-name: 4.0.0+dependencies:boolbase: 1.0.0@@ -14450,6 +14617,10 @@ snapshots:dependencies:mimic-fn: 2.1.0+ dependencies:+ mimic-fn: 4.0.0+dependencies:define-lazy-prop: 2.0.0@@ -14570,6 +14741,8 @@ snapshots:+ [email protected]: {}+dependencies:entities: 4.5.0@@ -14584,6 +14757,8 @@ snapshots:+ [email protected]: {}+@@ -15359,6 +15534,8 @@ snapshots:+ [email protected]: {}+@@ -15400,6 +15577,8 @@ snapshots:+ [email protected]: {}+dependencies:min-indent: 1.0.1@@ -15763,6 +15942,8 @@ snapshots:+ [email protected]: {}+@@ -15824,6 +16005,10 @@ snapshots:spdx-correct: 3.1.1spdx-expression-parse: 3.0.1+ dependencies:+ builtins: 5.0.1+dependencies:builtins: 5.0.1