From dd0bdeef2129ad746283a1f46441adfb8779cb52 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 07:48:33 +0000 Subject: [PATCH 01/38] Update registry/components/FooterBase.json --- registry/components/FooterBase.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/registry/components/FooterBase.json b/registry/components/FooterBase.json index 95e6640..25e7371 100644 --- a/registry/components/FooterBase.json +++ b/registry/components/FooterBase.json @@ -6,14 +6,14 @@ "textRules": { "logoText": { "required": false, - "default": "Webild", + "default": "ShopHub ", "example": "Company Name", "minChars": 2, "maxChars": 30 }, "copyrightText": { "required": false, - "default": "© 2025 | Webild", + "default": "© 2025 | ShopHub ", "example": "© 2025 Company Name", "minChars": 5, "maxChars": 50 @@ -51,8 +51,8 @@ }, "propsSchema": { "columns": "Array<{ title: string, items: Array<{ label: string, href: string }> }> - Footer navigation columns (required)", - "logoText?": "string (default: 'Webild')", - "copyrightText?": "string (default: '© 2025 | Webild')", + "logoText?": "string (default: 'ShopHub ')", + "copyrightText?": "string (default: '© 2025 | ShopHub ')", "onPrivacyClick?": "() => void", "ariaLabel?": "string (default: 'Site footer')", "className?": "string", -- 2.49.1 From 2d0700eebeaad0755ab4e172ee2274c8cb9e0f3c Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 07:48:33 +0000 Subject: [PATCH 02/38] Update registry/components/FooterBaseCard.json --- registry/components/FooterBaseCard.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/registry/components/FooterBaseCard.json b/registry/components/FooterBaseCard.json index 016539d..7f1c15a 100644 --- a/registry/components/FooterBaseCard.json +++ b/registry/components/FooterBaseCard.json @@ -6,14 +6,14 @@ "textRules": { "copyrightText": { "required": false, - "example": "© 2025 | Webild", + "example": "© 2025 | ShopHub ", "minChars": 5, "maxChars": 100, "note": "Copyright text displayed at bottom left" }, "logoText": { "required": false, - "example": "Webild", + "example": "ShopHub ", "minChars": 2, "maxChars": 30, "note": "Text used for h2 heading" @@ -34,9 +34,9 @@ } }, "propsSchema": { - "logoText?": "string (default: 'Webild')", + "logoText?": "string (default: 'ShopHub ')", "columns": "Array<{ title: string, items: Array<{ label: string, href: string }> }> - Footer navigation columns (required)", - "copyrightText?": "string (default: '© 2025 | Webild')", + "copyrightText?": "string (default: '© 2025 | ShopHub ')", "onPrivacyClick?": "() => void", "ariaLabel?": "string (default: 'Site footer')", "className?": "string", @@ -51,7 +51,7 @@ "copyrightTextClassName?": "string", "privacyButtonClassName?": "string" }, - "usageExample": " console.log('Privacy clicked')} />", + "usageExample": " console.log('Privacy clicked')} />", "do": [ "Use for general use", "Requires columns[]" -- 2.49.1 From 6a47d35f7d8ae40f9f94ee4c63bcd5c6b5e418fd Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 07:48:33 +0000 Subject: [PATCH 03/38] Update registry/components/FooterBaseReveal.json --- registry/components/FooterBaseReveal.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/components/FooterBaseReveal.json b/registry/components/FooterBaseReveal.json index f85d5f1..f12012b 100644 --- a/registry/components/FooterBaseReveal.json +++ b/registry/components/FooterBaseReveal.json @@ -6,7 +6,7 @@ "textRules": { "copyrightText": { "required": false, - "default": "© 2025 | Webild", + "default": "© 2025 | ShopHub ", "example": "© 2025 Company Name", "minChars": 5, "maxChars": 50 -- 2.49.1 From 0f198856ecd0e86ca642b36dd106af807c00cc84 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 07:48:34 +0000 Subject: [PATCH 04/38] Update registry/components/FooterCard.json --- registry/components/FooterCard.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/registry/components/FooterCard.json b/registry/components/FooterCard.json index 006c455..c4bf746 100644 --- a/registry/components/FooterCard.json +++ b/registry/components/FooterCard.json @@ -6,14 +6,14 @@ "textRules": { "copyrightText": { "required": false, - "example": "© 2025 | Webild", + "example": "© 2025 | ShopHub ", "minChars": 5, "maxChars": 100, "note": "Copyright text displayed at bottom left" }, "logoText": { "required": false, - "example": "Webild", + "example": "ShopHub ", "minChars": 2, "maxChars": 30, "note": "Text used for SVG logo" @@ -33,8 +33,8 @@ } }, "propsSchema": { - "logoText?": "string (default: 'Webild')", - "copyrightText?": "string (default: '© 2025 | Webild')", + "logoText?": "string (default: 'ShopHub ')", + "copyrightText?": "string (default: '© 2025 | ShopHub ')", "socialLinks?": "Array<{ icon: LucideIcon, href: string, ariaLabel: string }> - Social media links", "ariaLabel?": "string (default: 'Site footer')", "className?": "string", @@ -47,7 +47,7 @@ "socialContainerClassName?": "string", "socialIconClassName?": "string" }, - "usageExample": "", + "usageExample": "", "do": [ "Use for general use", "Requires socialLinks?[]" -- 2.49.1 From 1276443ec187807257f4572b86aa131d86696173 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 07:48:34 +0000 Subject: [PATCH 05/38] Update registry/components/FooterLogoEmphasis.json --- registry/components/FooterLogoEmphasis.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/components/FooterLogoEmphasis.json b/registry/components/FooterLogoEmphasis.json index d8f4a00..6ca9c2b 100644 --- a/registry/components/FooterLogoEmphasis.json +++ b/registry/components/FooterLogoEmphasis.json @@ -6,7 +6,7 @@ "textRules": { "logoText": { "required": false, - "default": "Webild", + "default": "ShopHub ", "example": "Company Name", "minChars": 2, "maxChars": 30 -- 2.49.1 From 3669b8813ce9d7f580db464587c15e77631ed6e6 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 07:48:35 +0000 Subject: [PATCH 06/38] Update registry/components/FooterLogoReveal.json --- registry/components/FooterLogoReveal.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/registry/components/FooterLogoReveal.json b/registry/components/FooterLogoReveal.json index dcdf190..aae2400 100644 --- a/registry/components/FooterLogoReveal.json +++ b/registry/components/FooterLogoReveal.json @@ -6,7 +6,7 @@ "textRules": { "logoText": { "required": false, - "example": "Webild", + "example": "ShopHub ", "minChars": 2, "maxChars": 30, "note": "Text used for SVG logo" @@ -20,7 +20,7 @@ } }, "propsSchema": { - "logoText?": "string (default: 'Webild')", + "logoText?": "string (default: 'ShopHub ')", "leftLink": "{ text: string, onClick?: () => void, href?: string } (required)", "rightLink": "{ text: string, onClick?: () => void, href?: string } (required)", "ariaLabel?": "string (default: 'Site footer')", @@ -30,7 +30,7 @@ "logoClassName?": "string", "linkClassName?": "string" }, - "usageExample": "", + "usageExample": "", "do": [ "Use for general use" ], -- 2.49.1 From d424140100fff5437a0628045f695c0756df0cbb Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 07:48:35 +0000 Subject: [PATCH 07/38] Update registry/components/FooterMedia.json --- registry/components/FooterMedia.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/registry/components/FooterMedia.json b/registry/components/FooterMedia.json index 307f217..2ff9d39 100644 --- a/registry/components/FooterMedia.json +++ b/registry/components/FooterMedia.json @@ -6,14 +6,14 @@ "textRules": { "logoText": { "required": false, - "default": "Webild", + "default": "ShopHub ", "example": "Company Name", "minChars": 2, "maxChars": 30 }, "copyrightText": { "required": false, - "default": "© 2025 | Webild", + "default": "© 2025 | ShopHub ", "example": "© 2025 Company Name", "minChars": 5, "maxChars": 50 @@ -66,8 +66,8 @@ "videoSrc": "string (required if no imageSrc)", "videoAriaLabel?": "string (default: 'Footer video')", "columns": "Array<{ title: string, items: Array<{ label: string, href: string }> }> - Footer navigation columns (required)", - "logoText?": "string (default: 'Webild')", - "copyrightText?": "string (default: '© 2025 | Webild')", + "logoText?": "string (default: 'ShopHub ')", + "copyrightText?": "string (default: '© 2025 | ShopHub ')", "onPrivacyClick?": "() => void", "ariaLabel?": "string (default: 'Site footer')", "className?": "string", -- 2.49.1 From d2fbd35a1e83a59b5b5993b0eee65abdddee442c Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 07:48:36 +0000 Subject: [PATCH 08/38] Update registry/components/FooterSimple.json --- registry/components/FooterSimple.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/registry/components/FooterSimple.json b/registry/components/FooterSimple.json index 3b08eb4..3d220c0 100644 --- a/registry/components/FooterSimple.json +++ b/registry/components/FooterSimple.json @@ -12,7 +12,7 @@ }, "bottomRightText": { "required": true, - "example": "Made with Webild", + "example": "Made with ShopHub ", "minChars": 2, "maxChars": 50 }, @@ -63,7 +63,7 @@ "bottomLeftTextClassName?": "string", "bottomRightTextClassName?": "string" }, - "usageExample": "", + "usageExample": "", "do": [ "Use for feature showcases", "Use for capability displays", -- 2.49.1 From dd081d08c3669255b79ccc800810c1c7fa4b9b8b Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 07:48:36 +0000 Subject: [PATCH 09/38] Update registry/components/HeroLogo.json --- registry/components/HeroLogo.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/registry/components/HeroLogo.json b/registry/components/HeroLogo.json index 17fb120..b6827c4 100644 --- a/registry/components/HeroLogo.json +++ b/registry/components/HeroLogo.json @@ -6,7 +6,7 @@ "textRules": { "logoText": { "required": true, - "example": "Webild", + "example": "ShopHub ", "minChars": 2, "maxChars": 20 }, @@ -79,7 +79,7 @@ "blurClassName?": "string", "dimOverlayClassName?": "string" }, - "usageExample": "\n \n", + "usageExample": "\n \n", "do": [ "Use for landing pages", "Use for feature showcases", -- 2.49.1 From d4264611eb8e7efa0520d7762eb339aa6a3d6a84 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 07:48:37 +0000 Subject: [PATCH 10/38] Update registry/components/NavbarLayoutFloatingInline.json --- registry/components/NavbarLayoutFloatingInline.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/registry/components/NavbarLayoutFloatingInline.json b/registry/components/NavbarLayoutFloatingInline.json index b193b69..0d0ca63 100644 --- a/registry/components/NavbarLayoutFloatingInline.json +++ b/registry/components/NavbarLayoutFloatingInline.json @@ -10,7 +10,7 @@ "required": false, "minChars": 2, "maxChars": 20, - "example": "Webild", + "example": "ShopHub ", "fallbackBehavior": "Shows brandName text" }, "buttonRules": { @@ -52,7 +52,7 @@ }, "propsSchema": { "navItems": "Array<{name: string, id: string}>", - "brandName?": "string (default: 'Webild')", + "brandName?": "string (default: 'ShopHub ')", "button": "{text: string, onClick?: () => void, href?: string}", "animateOnLoad?": "boolean (default: true)", "className?": "string (default: '')", -- 2.49.1 From 7f4d4951e92e49ec7c6feddb26481450085ac532 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 07:48:37 +0000 Subject: [PATCH 11/38] Update registry/components/NavbarLayoutFloatingOverlay.json --- registry/components/NavbarLayoutFloatingOverlay.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/registry/components/NavbarLayoutFloatingOverlay.json b/registry/components/NavbarLayoutFloatingOverlay.json index d90177c..667513c 100644 --- a/registry/components/NavbarLayoutFloatingOverlay.json +++ b/registry/components/NavbarLayoutFloatingOverlay.json @@ -10,7 +10,7 @@ "required": false, "minChars": 2, "maxChars": 20, - "example": "Webild", + "example": "ShopHub ", "fallbackBehavior": "Shows brandName text" }, "buttonRules": { @@ -53,7 +53,7 @@ "propsSchema": { "navItems": "Array<{name: string, id: string}>", "className?": "string", - "brandName?": "string (default: 'Webild')", + "brandName?": "string (default: 'ShopHub ')", "button": "{text: string, onClick?: () => void, href?: string}", "buttonClassName?": "string (default: '')", "buttonTextClassName?": "string (default: '')" -- 2.49.1 From 7a2e74bb33b57b7f9476a6204afb175b75d82224 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 07:48:37 +0000 Subject: [PATCH 12/38] Update registry/components/NavbarStyleApple.json --- registry/components/NavbarStyleApple.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/registry/components/NavbarStyleApple.json b/registry/components/NavbarStyleApple.json index 0128167..994eb4e 100644 --- a/registry/components/NavbarStyleApple.json +++ b/registry/components/NavbarStyleApple.json @@ -10,7 +10,7 @@ "required": false, "minChars": 2, "maxChars": 20, - "example": "Webild", + "example": "ShopHub ", "fallbackBehavior": "Shows brandName text" }, "linkRules": { @@ -35,7 +35,7 @@ }, "propsSchema": { "navItems": "Array<{name: string, id: string}>", - "brandName?": "string (default: 'Webild')" + "brandName?": "string (default: 'ShopHub ')" }, "usageExample": "", "do": [ -- 2.49.1 From 1270f2fd247058ae4574230225638e635beb3e2e Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 07:48:38 +0000 Subject: [PATCH 13/38] Update registry/components/NavbarStyleCentered.json --- registry/components/NavbarStyleCentered.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/registry/components/NavbarStyleCentered.json b/registry/components/NavbarStyleCentered.json index 703c97e..f221691 100644 --- a/registry/components/NavbarStyleCentered.json +++ b/registry/components/NavbarStyleCentered.json @@ -10,7 +10,7 @@ "required": false, "minChars": 2, "maxChars": 20, - "example": "Webild", + "example": "ShopHub ", "fallbackBehavior": "Shows brandName text" }, "buttonRules": { @@ -53,7 +53,7 @@ "propsSchema": { "navItems": "Array<{name: string, id: string}>", "button": "{text: string, onClick?: () => void, href?: string}", - "brandName?": "string (default: 'Webild')", + "brandName?": "string (default: 'ShopHub ')", "className?": "string (default: '')" }, "usageExample": "", -- 2.49.1 From cf393a3eabbd7f12bd503c7f5e2e963e3511010b Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 07:48:38 +0000 Subject: [PATCH 14/38] Update registry/components/NavbarStyleFullscreen.json --- registry/components/NavbarStyleFullscreen.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/registry/components/NavbarStyleFullscreen.json b/registry/components/NavbarStyleFullscreen.json index 5bcc0a3..a0a702b 100644 --- a/registry/components/NavbarStyleFullscreen.json +++ b/registry/components/NavbarStyleFullscreen.json @@ -10,7 +10,7 @@ "required": false, "minChars": 2, "maxChars": 20, - "example": "Webild", + "example": "ShopHub ", "fallbackBehavior": "Shows brandName text" }, "linkRules": { @@ -49,7 +49,7 @@ }, "propsSchema": { "navItems": "Array<{name: string, id: string}>", - "brandName?": "string (default: 'Webild')", + "brandName?": "string (default: 'ShopHub ')", "bottomLeftText?": "string (default: 'Global Community')", "bottomRightText?": "string (default: 'hello@example.com')", "topBarClassName?": "string (default: '')" -- 2.49.1 From 3e3b51bc6f5f1f6cd9f2f35b47c4a0f8fff5e2da Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 07:48:39 +0000 Subject: [PATCH 15/38] Update registry/schemas/FooterBase.schema.json --- registry/schemas/FooterBase.schema.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/registry/schemas/FooterBase.schema.json b/registry/schemas/FooterBase.schema.json index f7a6a9c..84e488a 100644 --- a/registry/schemas/FooterBase.schema.json +++ b/registry/schemas/FooterBase.schema.json @@ -2,8 +2,8 @@ "name": "FooterBase", "propsSchema": { "columns": "Array<{ title: string, items: Array<{ label: string, href: string }> }> - Footer navigation columns", - "logoText?": "string (default: 'Webild')", - "copyrightText?": "string (default: '© 2025 | Webild')", + "logoText?": "string (default: 'ShopHub ')", + "copyrightText?": "string (default: '© 2025 | ShopHub ')", "onPrivacyClick?": "() => void", "ariaLabel?": "string (default: 'Site footer')", "className?": "string", -- 2.49.1 From 781edae513e115d24631eac7cf36faa95c578bbd Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 07:48:39 +0000 Subject: [PATCH 16/38] Update registry/schemas/FooterBaseCard.schema.json --- registry/schemas/FooterBaseCard.schema.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/registry/schemas/FooterBaseCard.schema.json b/registry/schemas/FooterBaseCard.schema.json index ef8a4fb..38459e7 100644 --- a/registry/schemas/FooterBaseCard.schema.json +++ b/registry/schemas/FooterBaseCard.schema.json @@ -1,9 +1,9 @@ { "name": "FooterBaseCard", "propsSchema": { - "logoText?": "string (default: 'Webild')", + "logoText?": "string (default: 'ShopHub ')", "columns": "Array<{ title: string, items: Array<{ label: string, href: string }> }> - Footer navigation columns", - "copyrightText?": "string (default: '© 2025 | Webild')", + "copyrightText?": "string (default: '© 2025 | ShopHub ')", "onPrivacyClick?": "() => void", "ariaLabel?": "string (default: 'Site footer')", "className?": "string", -- 2.49.1 From 5bfdb74ef4a3cd70381d80a584d4310c0d8eece3 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 07:48:39 +0000 Subject: [PATCH 17/38] Update registry/schemas/FooterCard.schema.json --- registry/schemas/FooterCard.schema.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/registry/schemas/FooterCard.schema.json b/registry/schemas/FooterCard.schema.json index 5ffd445..1037fc5 100644 --- a/registry/schemas/FooterCard.schema.json +++ b/registry/schemas/FooterCard.schema.json @@ -1,8 +1,8 @@ { "name": "FooterCard", "propsSchema": { - "logoText?": "string (default: 'Webild')", - "copyrightText?": "string (default: '© 2025 | Webild')", + "logoText?": "string (default: 'ShopHub ')", + "copyrightText?": "string (default: '© 2025 | ShopHub ')", "socialLinks?": "Array<{ icon: LucideIcon, href: string, ariaLabel: string }> - Social media links", "ariaLabel?": "string (default: 'Site footer')", "className?": "string", -- 2.49.1 From a0ec2b993fac6fd52516e612274730246c40948f Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 07:48:40 +0000 Subject: [PATCH 18/38] Update registry/schemas/FooterLogoEmphasis.schema.json --- registry/schemas/FooterLogoEmphasis.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/schemas/FooterLogoEmphasis.schema.json b/registry/schemas/FooterLogoEmphasis.schema.json index 718e52d..5875add 100644 --- a/registry/schemas/FooterLogoEmphasis.schema.json +++ b/registry/schemas/FooterLogoEmphasis.schema.json @@ -2,7 +2,7 @@ "name": "FooterLogoEmphasis", "propsSchema": { "columns": "Array<{ items: Array<{ label: string, href?: string, onClick?: () => void }> }> - Footer navigation columns (required, max 5)", - "logoText?": "string (default: 'Webild')", + "logoText?": "string (default: 'ShopHub ')", "ariaLabel?": "string (default: 'Site footer')", "className?": "string", "containerClassName?": "string", -- 2.49.1 From 88d148ba5928ddd5ba5260f10a1c6a934ea32b87 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 07:48:40 +0000 Subject: [PATCH 19/38] Update registry/schemas/FooterLogoReveal.schema.json --- registry/schemas/FooterLogoReveal.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/schemas/FooterLogoReveal.schema.json b/registry/schemas/FooterLogoReveal.schema.json index 8646684..43f6816 100644 --- a/registry/schemas/FooterLogoReveal.schema.json +++ b/registry/schemas/FooterLogoReveal.schema.json @@ -1,7 +1,7 @@ { "name": "FooterLogoReveal", "propsSchema": { - "logoText?": "string (default: 'Webild')", + "logoText?": "string (default: 'ShopHub ')", "logoLineHeight?": "number (default: 1.1)", "ariaLabel?": "string (default: 'Site footer')", "className?": "string", -- 2.49.1 From c2882975cbc682012db9f89586a24282fdab5c45 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 07:48:41 +0000 Subject: [PATCH 20/38] Update registry/schemas/FooterMedia.schema.json --- registry/schemas/FooterMedia.schema.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/registry/schemas/FooterMedia.schema.json b/registry/schemas/FooterMedia.schema.json index ca8489d..2c1256a 100644 --- a/registry/schemas/FooterMedia.schema.json +++ b/registry/schemas/FooterMedia.schema.json @@ -6,8 +6,8 @@ "videoSrc": "string (required if no imageSrc)", "videoAriaLabel?": "string (default: 'Footer video')", "columns": "Array<{ title: string, items: Array<{ label: string, href: string }> }> - Footer navigation columns", - "logoText?": "string (default: 'Webild')", - "copyrightText?": "string (default: '© 2025 | Webild')", + "logoText?": "string (default: 'ShopHub ')", + "copyrightText?": "string (default: '© 2025 | ShopHub ')", "onPrivacyClick?": "() => void", "ariaLabel?": "string (default: 'Site footer')", "className?": "string", -- 2.49.1 From 67f4d8d5fd0ba3b7cfcee804c85af08b2a3673cc Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 07:48:41 +0000 Subject: [PATCH 21/38] Update registry/schemas/NavbarLayoutFloatingInline.schema.json --- registry/schemas/NavbarLayoutFloatingInline.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/schemas/NavbarLayoutFloatingInline.schema.json b/registry/schemas/NavbarLayoutFloatingInline.schema.json index e1b5716..5e87d13 100644 --- a/registry/schemas/NavbarLayoutFloatingInline.schema.json +++ b/registry/schemas/NavbarLayoutFloatingInline.schema.json @@ -2,7 +2,7 @@ "name": "NavbarLayoutFloatingInline", "propsSchema": { "navItems": "Array<{name: string, id: string}>", - "brandName?": "string (default: 'Webild')", + "brandName?": "string (default: 'ShopHub ')", "button": "{text: string, onClick?: () => void, href?: string}", "animateOnLoad?": "boolean (default: true)", "className?": "string (default: '')", -- 2.49.1 From 3c4bafdd4ff4e86a22480b41b7fabbf5035ce918 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 07:48:41 +0000 Subject: [PATCH 22/38] Update registry/schemas/NavbarLayoutFloatingOverlay.schema.json --- registry/schemas/NavbarLayoutFloatingOverlay.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/schemas/NavbarLayoutFloatingOverlay.schema.json b/registry/schemas/NavbarLayoutFloatingOverlay.schema.json index 1f8b917..b604da3 100644 --- a/registry/schemas/NavbarLayoutFloatingOverlay.schema.json +++ b/registry/schemas/NavbarLayoutFloatingOverlay.schema.json @@ -3,7 +3,7 @@ "propsSchema": { "navItems": "Array<{name: string, id: string}>", "className?": "string", - "brandName?": "string (default: 'Webild')", + "brandName?": "string (default: 'ShopHub ')", "button": "{text: string, onClick?: () => void, href?: string}", "buttonClassName?": "string (default: '')", "buttonTextClassName?": "string (default: '')" -- 2.49.1 From 3ceaaf8b2448d2d99b905982a27a2a057098e92f Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 07:48:42 +0000 Subject: [PATCH 23/38] Update registry/schemas/NavbarStyleApple.schema.json --- registry/schemas/NavbarStyleApple.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/schemas/NavbarStyleApple.schema.json b/registry/schemas/NavbarStyleApple.schema.json index 70ac82d..1c73e16 100644 --- a/registry/schemas/NavbarStyleApple.schema.json +++ b/registry/schemas/NavbarStyleApple.schema.json @@ -2,6 +2,6 @@ "name": "NavbarStyleApple", "propsSchema": { "navItems": "Array<{name: string, id: string}>", - "brandName?": "string (default: 'Webild')" + "brandName?": "string (default: 'ShopHub ')" } } \ No newline at end of file -- 2.49.1 From ebb37458a3dc9f0c6633404cb8d8b8a6005a7d3a Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 07:48:42 +0000 Subject: [PATCH 24/38] Update registry/schemas/NavbarStyleCentered.schema.json --- registry/schemas/NavbarStyleCentered.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/schemas/NavbarStyleCentered.schema.json b/registry/schemas/NavbarStyleCentered.schema.json index 4e3e892..988889c 100644 --- a/registry/schemas/NavbarStyleCentered.schema.json +++ b/registry/schemas/NavbarStyleCentered.schema.json @@ -4,7 +4,7 @@ "navItems": "Array<{name: string, id: string}>", "button": "{text: string, onClick?: () => void, href?: string}", "topBarButton?": "{text: string, onClick?: () => void, href?: string}", - "brandName?": "string (default: 'Webild')", + "brandName?": "string (default: 'ShopHub ')", "className?": "string (default: '')" } } \ No newline at end of file -- 2.49.1 From 50e1cb7e9a96265b8425482a80d44710469a34a1 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 07:48:43 +0000 Subject: [PATCH 25/38] Update registry/schemas/NavbarStyleFullscreen.schema.json --- registry/schemas/NavbarStyleFullscreen.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/schemas/NavbarStyleFullscreen.schema.json b/registry/schemas/NavbarStyleFullscreen.schema.json index 107e582..25e28cb 100644 --- a/registry/schemas/NavbarStyleFullscreen.schema.json +++ b/registry/schemas/NavbarStyleFullscreen.schema.json @@ -2,7 +2,7 @@ "name": "NavbarStyleFullscreen", "propsSchema": { "navItems": "Array<{name: string, id: string}>", - "brandName?": "string (default: 'Webild')", + "brandName?": "string (default: 'ShopHub ')", "bottomLeftText?": "string (default: 'Global Community')", "bottomRightText?": "string (default: 'hello@example.com')", "topBarClassName?": "string (default: '')" -- 2.49.1 From f22b6aa5707c72b78fa097814c454ba45eeeafe3 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 07:48:43 +0000 Subject: [PATCH 26/38] Update src/app/layout.tsx --- src/app/layout.tsx | 1367 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1367 insertions(+) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 523750f..576b1dd 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -580,6 +580,1373 @@ export default function RootLayout({ element.dataset.inputHandler = 'true'; element.dataset.beforeInputHandler = 'true'; + if (clickEvent && element.childNodes.length > 0) { + try { + let range = null; + + if (document.caretRangeFromPoint) { + range = document.caretRangeFromPoint(clickEvent.clientX, clickEvent.clientY); + } else if (document.caretPositionFromPoint) { + const position = document.caretPositionFromPoint(clickEvent.clientX, clickEvent.clientY); + if (position) { + range = document.createRange(); + range.setStart(position.offsetNode, position.offset); + range.collapse(true); + } + } + + if (range) { + const selection = window.getSelection(); + selection.removeAllRanges(); + selection.addRange(range); + } + } catch (e) { + console.warn('[ShopHub ] Could not set caret position:', e); + } + } + }; + + const makeUneditable = (element, save = false) => { + if (!element || element.contentEditable !== 'true') return; + + element.contentEditable = 'false'; + isEditing = false; + + if (element.dataset.webildOriginalWhiteSpace) { + element.style.whiteSpace = element.dataset.webildOriginalWhiteSpace === 'normal' ? '' : element.dataset.webildOriginalWhiteSpace; + delete element.dataset.webildOriginalWhiteSpace; + } + if (element.dataset.webildOriginalWordWrap) { + element.style.wordWrap = element.dataset.webildOriginalWordWrap === 'normal' ? '' : element.dataset.webildOriginalWordWrap; + delete element.dataset.webildOriginalWordWrap; + } + if (element.dataset.webildOriginalOverflowWrap) { + element.style.overflowWrap = element.dataset.webildOriginalOverflowWrap === 'normal' ? '' : element.dataset.webildOriginalOverflowWrap; + delete element.dataset.webildOriginalOverflowWrap; + } + if (element.dataset.webildOriginalOverflow) { + element.style.overflow = element.dataset.webildOriginalOverflow === 'visible' ? '' : element.dataset.webildOriginalOverflow; + delete element.dataset.webildOriginalOverflow; + } + + if (element.dataset.beforeInputHandler === 'true') { + element.removeEventListener('beforeinput', () => {}); + delete element.dataset.beforeInputHandler; + } + + if (element.dataset.inputHandler === 'true') { + element.removeEventListener('input', () => {}); + delete element.dataset.inputHandler; + } + + window.parent.postMessage({ + type: 'webild-text-editing-ended', + data: { selector: getElementInfo(element).selector } + }, '*'); + + if (save && originalContent !== element.textContent) { + const elementInfo = getElementInfo(element); + let finalText = element.textContent; + + // Trim the final text and convert space-only to empty string for saving + if (finalText === ' ' || finalText.trim() === '') { + finalText = ''; + // Update the actual element text to empty for display + element.textContent = ''; + } + + const change = { + type: 'updateText', + selector: elementInfo.selector, + oldValue: originalContent, + newValue: finalText, + elementType: elementInfo.elementType, + sectionId: elementInfo.sectionId, + timestamp: Date.now() + }; + + saveChangeToStorage(change); + + window.parent.postMessage({ + type: 'webild-element-changed', + data: change + }, '*'); + } else if (!save && originalContent !== null) { + element.textContent = originalContent; + } + + originalContent = null; + }; + + const createHoverOverlay = (element) => { + const rect = element.getBoundingClientRect(); + const overlay = document.createElement('div'); + overlay.className = 'webild-hover-overlay'; + overlay.style.cssText = \` + position: fixed !important; + top: \${rect.top - 2}px !important; + left: \${rect.left - 2}px !important; + width: \${rect.width + 4}px !important; + height: \${rect.height + 4}px !important; + background-color: rgba(90, 113, 230, 0.15) !important; + pointer-events: none !important; + z-index: 999998 !important; + transition: all 0.15s ease !important; + \`; + document.body.appendChild(overlay); + return overlay; + }; + + const removeHoverOverlay = () => { + if (hoverOverlay) { + hoverOverlay.remove(); + hoverOverlay = null; + } + }; + + const showElementTypeLabel = (element, elementType) => { + if (!elementType) return; + + removeElementTypeLabel(); + + const rect = element.getBoundingClientRect(); + elementTypeLabel = document.createElement('div'); + elementTypeLabel.className = 'webild-element-type-label'; + const ariaLabel = element.getAttribute('aria-label'); + let labelText; + + if (elementType === 'Div') { + labelText = 'Div'; + } else if (elementType === 'Article') { + labelText = 'Article'; + } else if (elementType === 'Section') { + labelText = ariaLabel || 'Section'; + } else { + labelText = elementType; + } + + elementTypeLabel.textContent = labelText; + document.body.appendChild(elementTypeLabel); + const labelRect = elementTypeLabel.getBoundingClientRect(); + let labelTop = rect.top - labelRect.height - 2; + let labelLeft = rect.left - 3; + let isLabelOnTop = true; + if (labelTop < 0) { + labelTop = rect.bottom + 1; + isLabelOnTop = false; + } + if (labelTop + labelRect.height > window.innerHeight) { + labelTop = rect.bottom - labelRect.height; + isLabelOnTop = false; + if (labelTop < 0) { + labelTop = rect.top; + isLabelOnTop = true; + } + } + if (labelLeft + labelRect.width > window.innerWidth) { + labelLeft = window.innerWidth - labelRect.width; + } + if (labelLeft < 0) { + labelLeft = 0; + } + if (isLabelOnTop) { + elementTypeLabel.classList.add('label-top'); + } else { + elementTypeLabel.classList.add('label-bottom'); + } + + elementTypeLabel.style.cssText = \` + left: \${labelLeft}px !important; + top: \${labelTop}px !important; + transform: none !important; + \`; + }; + + const removeElementTypeLabel = () => { + if (elementTypeLabel) { + elementTypeLabel.remove(); + elementTypeLabel = null; + } + }; + + const handleMouseOver = (e) => { + if (!isActive) return; + + lastMouseX = e.clientX; + lastMouseY = e.clientY; + + const target = getMostSpecificElement(e.clientX, e.clientY) || e.target; + + if (!isValidElement(target) || target === hoveredElement || target === selectedElement) { + return; + } + + if (hoveredElement && hoveredElement !== selectedElement) { + hoveredElement.classList.remove(hoverClass); + if (hoveredElement.dataset.webildOriginalPosition) { + hoveredElement.style.position = hoveredElement.dataset.webildOriginalPosition === 'none' ? '' : hoveredElement.dataset.webildOriginalPosition; + delete hoveredElement.dataset.webildOriginalPosition; + } + removeHoverOverlay(); + removeElementTypeLabel(); + } + + hoveredElement = target; + + const computedStyle = window.getComputedStyle(target); + const currentPosition = computedStyle.position; + + if (currentPosition === 'static' || currentPosition === '') { + hoveredElement.dataset.webildOriginalPosition = currentPosition || 'none'; + hoveredElement.style.position = 'relative'; + } + + hoveredElement.classList.add(hoverClass); + + if ((!selectedElement || selectedElement !== target) && !isScrolling) { + hoverOverlay = createHoverOverlay(target); + } + + const elementType = getElementType(target); + showElementTypeLabel(target, elementType); + + window.parent.postMessage({ + type: 'webild-element-hover', + data: getElementInfo(target, false) + }, '*'); + }; + + const handleMouseOut = (e) => { + if (!isActive) return; + + if (hoveredElement && hoveredElement !== selectedElement) { + hoveredElement.classList.remove(hoverClass); + + if (hoveredElement.dataset.webildOriginalPosition) { + hoveredElement.style.position = hoveredElement.dataset.webildOriginalPosition === 'none' ? '' : hoveredElement.dataset.webildOriginalPosition; + delete hoveredElement.dataset.webildOriginalPosition; + } + + removeHoverOverlay(); + removeElementTypeLabel(); + + hoveredElement = null; + + window.parent.postMessage({ + type: 'webild-element-hover', + data: null + }, '*'); + } + }; + + const handleClick = (e) => { + if (!isActive) return; + + if (isEditing) { + e.stopPropagation(); + return; + } + + e.preventDefault(); + e.stopPropagation(); + + const target = getMostSpecificElement(e.clientX, e.clientY) || e.target; + if (!isValidElement(target)) return; + + if (selectedElement && selectedElement !== target) { + makeUneditable(selectedElement, false); + selectedElement.classList.remove(selectedClass); + selectedElement.classList.remove(hoverClass); + + if (selectedElement.dataset.webildOriginalPosition) { + selectedElement.style.position = selectedElement.dataset.webildOriginalPosition === 'none' ? '' : selectedElement.dataset.webildOriginalPosition; + delete selectedElement.dataset.webildOriginalPosition; + } + + removeHoverOverlay(); + removeElementTypeLabel(); + } + + if (selectedElement === target) { + if (target.dataset.webildOriginalPosition) { + target.style.position = target.dataset.webildOriginalPosition === 'none' ? '' : target.dataset.webildOriginalPosition; + delete target.dataset.webildOriginalPosition; + } + + removeHoverOverlay(); + removeElementTypeLabel(); + + selectedElement = null; + window.parent.postMessage({ + type: 'webild-element-selected', + data: null + }, '*'); + return; + } + + selectedElement = target; + selectedElement.classList.add(selectedClass); + + removeHoverOverlay(); + removeElementTypeLabel(); + + if (hoveredElement === target) { + hoveredElement.classList.remove(hoverClass); + hoveredElement = null; + } + + const elementInfo = getElementInfo(target, true); + selectedElement.dataset.webildSelector = elementInfo.selector; + showElementTypeLabel(target, elementInfo.elementType); + + window.parent.postMessage({ + type: 'webild-element-selected', + data: elementInfo + }, '*'); + + if (isTextElement(target)) { + setTimeout(() => makeEditable(target, e), 50); + } + }; + + const handleKeyDown = (e) => { + if (!isActive) return; + if (!isEditing || !selectedElement) return; + + if (e.key === 'Enter' && !e.shiftKey) { + e.preventDefault(); + makeUneditable(selectedElement, true); + } else if (e.key === 'Escape') { + e.preventDefault(); + makeUneditable(selectedElement, false); + } + }; + + const handleBlur = (e) => { + if (!isActive) return; + if (isEditing && selectedElement && e.target === selectedElement) { + makeUneditable(selectedElement, true); + } + }; + + let lastMouseX = 0; + let lastMouseY = 0; + + const handleScroll = () => { + if (!isActive) return; + + if (isEditing) return; + + if (selectedElement) { + makeUneditable(selectedElement, false); + selectedElement.classList.remove(selectedClass); + if (selectedElement.dataset.webildOriginalPosition) { + selectedElement.style.position = selectedElement.dataset.webildOriginalPosition === 'none' ? '' : selectedElement.dataset.webildOriginalPosition; + delete selectedElement.dataset.webildOriginalPosition; + } + selectedElement = null; + + window.parent.postMessage({ + type: 'webild-element-selected', + data: null + }, '*'); + } + + if (hoveredElement) { + hoveredElement.classList.remove(hoverClass); + if (hoveredElement.dataset.webildOriginalPosition) { + hoveredElement.style.position = hoveredElement.dataset.webildOriginalPosition === 'none' ? '' : hoveredElement.dataset.webildOriginalPosition; + delete hoveredElement.dataset.webildOriginalPosition; + } + hoveredElement = null; + + window.parent.postMessage({ + type: 'webild-element-hover', + data: null + }, '*'); + } + + removeHoverOverlay(); + removeElementTypeLabel(); + + isScrolling = true; + + if (scrollTimeout) { + clearTimeout(scrollTimeout); + } + + scrollTimeout = setTimeout(() => { + isScrolling = false; + + if (lastMouseX > 0 && lastMouseY > 0) { + const target = getMostSpecificElement(lastMouseX, lastMouseY); + if (target && isValidElement(target) && target !== selectedElement) { + hoveredElement = target; + + const computedStyle = window.getComputedStyle(target); + const currentPosition = computedStyle.position; + + if (currentPosition === 'static' || currentPosition === '') { + hoveredElement.dataset.webildOriginalPosition = currentPosition || 'none'; + hoveredElement.style.position = 'relative'; + } + + hoveredElement.classList.add(hoverClass); + hoverOverlay = createHoverOverlay(target); + + const elementType = getElementType(target); + showElementTypeLabel(target, elementType); + + window.parent.postMessage({ + type: 'webild-element-hover', + data: getElementInfo(target, false) + }, '*'); + } + } + }, 150); + + window.parent.postMessage({ + type: 'webild-iframe-scroll' + }, '*'); + }; + + const getStorageKey = () => { + const url = new URL(window.location.href); + const pathParts = url.pathname.split('/').filter(Boolean); + return \`webild-changes-\${pathParts.join('-')}\`; + }; + + const saveChangeToStorage = (change) => { + try { + const storageKey = getStorageKey(); + const existingChanges = JSON.parse(localStorage.getItem(storageKey) || '[]'); + + const filteredChanges = existingChanges.filter(c => { + return !(c.oldValue === change.oldValue && c.sectionId === change.sectionId); + }); + filteredChanges.push(change); + + localStorage.setItem(storageKey, JSON.stringify(filteredChanges)); + + window.parent.postMessage({ + type: 'webild-change-saved-locally', + data: { change, allChanges: filteredChanges } + }, '*'); + } catch (error) { + console.error('Failed to save change to localStorage:', error); + } + }; + + const clearLocalChanges = () => { + try { + const storageKey = getStorageKey(); + localStorage.removeItem(storageKey); + window.parent.postMessage({ + type: 'webild-local-changes-cleared', + data: {} + }, '*'); + } catch (error) { + console.error('Failed to clear local changes:', error); + } + }; + + const handleMessage = (e) => { + if (!e.data || !e.data.type) return; + + if (e.data.type === 'webild-activate-editor') { + if (!isActive) { + isActive = true; + window.parent.postMessage({ type: 'webild-editor-activated' }, '*'); + } + return; + } + + if (e.data.type === 'webild-deactivate-editor') { + if (isActive) { + isActive = false; + + if (selectedElement) { + makeUneditable(selectedElement, false); + selectedElement.classList.remove(selectedClass); + selectedElement = null; + } + if (hoveredElement) { + hoveredElement.classList.remove(hoverClass); + hoveredElement = null; + } + + removeHoverOverlay(); + removeElementTypeLabel(); + window.parent.postMessage({ type: 'webild-editor-deactivated' }, '*'); + } + return; + } + + if (e.data.type === 'webild-clear-local-changes') { + clearLocalChanges(); + return; + } + + if (e.data.type === 'webild-cancel-changes') { + try { + const storageKey = getStorageKey(); + const savedChanges = localStorage.getItem(storageKey); + if (savedChanges) { + const changes = JSON.parse(savedChanges); + changes.forEach(change => { + try { + const element = document.querySelector(change.selector); + if (!element) return; + + if (change.type === 'updateText') { + if (isTextElement(element)) { + element.textContent = change.oldValue; + } + } else if (change.type === 'updateButton') { + if (isButtonElement(element)) { + updateButtonText(element, change.oldValue); + } + } else if (change.type === 'replaceImage') { + const revertTag = element.tagName.toLowerCase(); + const isBackground = revertTag !== 'img' && revertTag !== 'video'; + if (isBackground) { + element.style.backgroundImage = change.oldValue ? 'url(' + change.oldValue + ')' : ''; + } else { + const oldMediaType = getMediaTypeFromUrl(change.oldValue); + if (revertTag === 'video' && oldMediaType === 'image') { + swapMediaElement(element, 'img', change.oldValue); + } else if (revertTag === 'img' && oldMediaType === 'video') { + swapMediaElement(element, 'video', change.oldValue); + } else if (revertTag === 'video') { + element.src = change.oldValue; + element.load(); + } else { + element.src = change.oldValue; + } + } + } + } catch (err) { + console.warn('[ShopHub ] Failed to revert change:', err); + } + }); + } + clearLocalChanges(); + } catch (error) { + console.error('[ShopHub ] Failed to cancel changes:', error); + } + return; + } + + if (e.data.type === 'webild-update-text') { + const { selector, newValue, oldValue, sectionId } = e.data.data; + try { + let element = null; + + if (selectedElement && isTextElement(selectedElement)) { + element = selectedElement; + } + else if (selector) { + try { + element = document.querySelector(selector); + } catch (err) { + console.warn('[ShopHub ] Invalid selector:', selector); + } + } + + if (!element && sectionId) { + const sectionElement = document.querySelector('[data-section="' + sectionId + '"]'); + if (sectionElement) { + const textElements = sectionElement.querySelectorAll('h1, h2, h3, h4, h5, h6, p, span, a, button, div'); + for (let i = 0; i < textElements.length; i++) { + const el = textElements[i]; + if (isTextElement(el) && el.textContent.trim() === (oldValue || '').trim()) { + element = el; + const newSelector = getUniqueSelector(element, true); + if (newSelector) { + element.dataset.webildSelector = newSelector; + } + break; + } + } + } + } + + if (element && isTextElement(element)) { + element.textContent = newValue; + const finalSelector = element.dataset.webildSelector || getUniqueSelector(element, true); + + window.parent.postMessage({ + type: 'webild-text-update-success', + data: { + selector: finalSelector, + newValue: newValue + } + }, '*'); + } else { + window.parent.postMessage({ + type: 'webild-text-update-failed', + data: { selector, newValue } + }, '*'); + } + } catch (error) { + window.parent.postMessage({ + type: 'webild-text-update-failed', + data: { selector, newValue, error: error.message } + }, '*'); + } + return; + } + + if (e.data.type === 'webild-update-button') { + const { selector, text, href } = e.data.data; + try { + const element = document.querySelector(selector); + if (element && isButtonElement(element)) { + if (text !== undefined) { + updateButtonText(element, text); + } + if (href !== undefined) { + if (element.tagName.toLowerCase() === 'a') { + element.href = href; + } else { + element.setAttribute('data-href', href); + } + } + } + } catch (error) { + console.error('[ShopHub ] Invalid selector for button update:', selector, error); + } + return; + } + + if (!isActive) return; + + if (e.data.type === 'webild-replace-image') { + const { selector, newSrc, isBackground, allowMediaTypeSwap } = e.data.data; + let element = null; + + try { + element = document.querySelector(selector); + } catch { + window.parent.postMessage({ + type: 'webild-image-replacement-error', + data: { selector, message: 'Invalid selector: ' + error.message, success: false } + }, '*'); + return; + } + + if (!element) { + window.parent.postMessage({ + type: 'webild-image-replacement-error', + data: { selector, message: 'Element not found', success: false } + }, '*'); + return; + } + + try { + let replaced = false; + let oldValue = ''; + + if (isBackground) { + oldValue = window.getComputedStyle(element).backgroundImage; + element.style.backgroundImage = \`url('\${newSrc}')\`; + replaced = true; + } else if (element.tagName.toLowerCase() === 'img') { + oldValue = element.src; + const newMediaType = getMediaTypeFromUrl(newSrc); + if (newMediaType === 'video' && allowMediaTypeSwap) { + const swapped = swapMediaElement(element, 'video', newSrc); + if (selectedElement === element) selectedElement = swapped; + element = swapped; + } else { + element.src = newSrc; + } + replaced = true; + } else if (element.tagName.toLowerCase() === 'video') { + oldValue = element.src || element.currentSrc || ''; + const newMediaType = getMediaTypeFromUrl(newSrc); + const sources = element.querySelectorAll('source'); + if (newMediaType === 'image' && allowMediaTypeSwap) { + const swapped = swapMediaElement(element, 'img', newSrc); + if (selectedElement === element) selectedElement = swapped; + element = swapped; + } else { + if (sources.length > 0) { + sources.forEach(function(source) { source.src = newSrc; }); + element.load(); + } else { + element.src = newSrc; + element.load(); + } + } + replaced = true; + } else { + const hasBackgroundImage = window.getComputedStyle(element).backgroundImage !== 'none'; + if (hasBackgroundImage) { + oldValue = window.getComputedStyle(element).backgroundImage; + element.style.backgroundImage = \`url('\${newSrc}')\`; + replaced = true; + } + } + + if (replaced) { + const elementInfo = getElementInfo(element); + + let cleanOldValue = oldValue; + if (oldValue.includes('url(')) { + const urlMatch = oldValue.match(/url(['"]?([^'")]+)['"]?)/); + if (urlMatch) { + cleanOldValue = urlMatch[1]; + } + } + + cleanOldValue = extractOriginalUrl(cleanOldValue); + + const change = { + type: 'replaceImage', + selector: selector, + oldValue: cleanOldValue, + newValue: newSrc, + elementType: elementInfo.elementType, + sectionId: elementInfo.sectionId, + timestamp: Date.now() + }; + + saveChangeToStorage(change); + + window.parent.postMessage({ + type: 'webild-element-changed', + data: change + }, '*'); + + window.parent.postMessage({ + type: 'webild-image-replaced', + data: { selector, newSrc, success: true } + }, '*'); + } else { + window.parent.postMessage({ + type: 'webild-image-replacement-error', + data: { selector, message: 'Could not determine how to replace image', success: false } + }, '*'); + } + } catch (error) { + window.parent.postMessage({ + type: 'webild-image-replacement-error', + data: { selector, message: error.message || 'Failed to replace image', success: false } + }, '*'); + } + } + }; + + document.addEventListener('mouseover', handleMouseOver, true); + document.addEventListener('mouseout', handleMouseOut, true); + document.addEventListener('click', handleClick, true); + document.addEventListener('keydown', handleKeyDown, true); + document.addEventListener('blur', handleBlur, true); + window.addEventListener('scroll', handleScroll, true); + window.addEventListener('message', handleMessage, true); + + let lastPathname = window.location.pathname; + + const notifyPageChange = () => { + window.parent.postMessage({ + type: 'webild-page-changed', + data: { pathname: window.location.pathname } + }, '*'); + }; + + window.addEventListener('popstate', () => { + if (lastPathname !== window.location.pathname) { + lastPathname = window.location.pathname; + notifyPageChange(); + } + }, true); + + const urlCheckInterval = setInterval(() => { + if (lastPathname !== window.location.pathname) { + lastPathname = window.location.pathname; + notifyPageChange(); + } + }, 500); + + notifyPageChange(); + + window.webildCleanup = () => { + isActive = false; + + if (selectedElement) { + makeUneditable(selectedElement, false); + } + + removeHoverOverlay(); + removeElementTypeLabel(); + + if (urlCheckInterval) { + clearInterval(urlCheckInterval); + } + + document.removeEventListener('mouseover', handleMouseOver, true); + document.removeEventListener('mouseout', handleMouseOut, true); + document.removeEventListener('click', handleClick, true); + document.removeEventListener('keydown', handleKeyDown, true); + document.removeEventListener('blur', handleBlur, true); + window.removeEventListener('scroll', handleScroll, true); + window.removeEventListener('message', handleMessage, true); + + document.querySelectorAll('.' + hoverClass).forEach(el => { + el.classList.remove(hoverClass); + }); + document.querySelectorAll('.' + selectedClass).forEach(el => { + el.classList.remove(selectedClass); + }); + + const styleEl = document.getElementById('webild-inspector-styles'); + if (styleEl) styleEl.remove(); + + hoveredElement = null; + selectedElement = null; + }; + + window.parent.postMessage({ type: 'webild-editor-ready' }, '*'); +})(); +` + }} + /> + +