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
experimental: Add Webflow image paste support (#3583)
Ivan Starkovb7a663c975cc
diff --git a/apps/builder/app/shared/copy-paste/plugin-webflow/plugin-webflow.ts b/apps/builder/app/shared/copy-paste/plugin-webflow/plugin-webflow.tsindex 190c24013b..c4bb7cb668 100644--- a/apps/builder/app/shared/copy-paste/plugin-webflow/plugin-webflow.ts+++ b/apps/builder/app/shared/copy-paste/plugin-webflow/plugin-webflow.ts@@ -15,6 +15,7 @@ import { WfData, WfNode, WfStyle, wfNodeTypes } from "./schema";import { addInstanceAndProperties } from "./instances-properties";import { addStyles } from "./styles";import { toast } from "@webstudio-is/design-system";+import { denormalizeSrcProps } from "../asset-upload";export const mimeType = "application/json";@@ -109,11 +110,14 @@ export const onPaste = async (clipboardData: string) => {if (wfData === undefined) {return false;}- const fragment = await toWebstudioFragment(wfData);+ let fragment = await toWebstudioFragment(wfData);const selectedPage = $selectedPage.get();if (fragment.instances.length === 0 || selectedPage === undefined) {return false;}++ fragment = await denormalizeSrcProps(fragment);+const metas = $registeredComponentMetas.get();const newInstances = new Map(fragment.instances.map((instance) => [instance.id, instance])