From f7f329852a29d92997d73e3f2dace6bd8d9cac45 Mon Sep 17 00:00:00 2001 From: istarkov Date: Tue, 16 Jul 2024 16:46:34 +0000 Subject: [PATCH] fix: Lightbox paste partial support --- .../copy-paste/plugin-webflow/instances-properties.ts | 7 ++++++- .../builder/app/shared/copy-paste/plugin-webflow/schema.ts | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/builder/app/shared/copy-paste/plugin-webflow/instances-properties.ts b/apps/builder/app/shared/copy-paste/plugin-webflow/instances-properties.ts index 6138b4afcb24..7b3e1489ff0a 100644 --- a/apps/builder/app/shared/copy-paste/plugin-webflow/instances-properties.ts +++ b/apps/builder/app/shared/copy-paste/plugin-webflow/instances-properties.ts @@ -345,7 +345,12 @@ const toFragment = ( addInstance(component); return fragment; } - + case "LightboxWrapper": { + addProp("tag", wfNode.tag); + addProp("href", wfNode.data?.attr?.href); + addInstance("Box", [], component); + return fragment; + } case "NavbarMenu": { addProp("tag", wfNode.tag); addProp("role", wfNode.data?.attr?.role); diff --git a/apps/builder/app/shared/copy-paste/plugin-webflow/schema.ts b/apps/builder/app/shared/copy-paste/plugin-webflow/schema.ts index 2797aacb9e1f..b6b00f8f7e61 100644 --- a/apps/builder/app/shared/copy-paste/plugin-webflow/schema.ts +++ b/apps/builder/app/shared/copy-paste/plugin-webflow/schema.ts @@ -1,6 +1,8 @@ import { z } from "zod"; -const Attr = z.object({ id: z.string(), role: z.string() }).partial(); +const Attr = z + .object({ id: z.string(), role: z.string(), href: z.string() }) + .partial(); const styleBase = z.string(); @@ -124,6 +126,7 @@ export const wfNodeTypes = [ "NavbarButton", "NavbarContainer", "Icon", + "LightboxWrapper", ] as const; const WfElementNode = z.union([ @@ -139,6 +142,7 @@ const WfElementNode = z.union([ }), }), + WfBaseNode.extend({ type: z.enum(["LightboxWrapper"]) }), WfBaseNode.extend({ type: z.enum(["NavbarMenu"]) }), WfBaseNode.extend({ type: z.enum(["NavbarContainer"]) }),