@deneb-ui/ui 2.0.120 → 2.0.122
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DenebImage.d.ts +24 -0
- package/dist/DenebImage.js +60 -0
- package/dist/EditableCartDrawer.d.ts +3 -1
- package/dist/EditableCartDrawer.js +18 -7
- package/dist/EditableProductCard.d.ts +3 -1
- package/dist/EditableProductCard.js +12 -4
- package/dist/SiteDataProvider.d.ts +6 -0
- package/dist/SiteDataProvider.js +12 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -2
- package/dist/utils/urls.d.ts +5 -0
- package/dist/utils/urls.js +6 -0
- package/package.json +2 -2
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type DenebImageAspectRatio = 'square' | '1/1' | 'video' | '16/9' | 'portrait' | '3/4' | '4/3' | '2/3' | '21/9' | (string & {});
|
|
3
|
+
export type DenebImageRadius = 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full' | (string & {});
|
|
4
|
+
export declare const DEFAULT_IMAGE_FALLBACK_SVG = "data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"600\" height=\"400\" viewBox=\"0 0 600 400\" fill=\"none\"><rect width=\"600\" height=\"400\" fill=\"%23f1f5f9\"/><path d=\"M250 180a30 30 0 100-60 30 30 0 000 60zM170 300l80-90 60 70 70-100 90 120H170z\" fill=\"%23cbd5e1\"/></svg>";
|
|
5
|
+
export interface DenebImageProps extends Omit<React.ImgHTMLAttributes<HTMLImageElement>, 'src'> {
|
|
6
|
+
id?: string;
|
|
7
|
+
'data-preview-field-path'?: string;
|
|
8
|
+
src?: string | null;
|
|
9
|
+
fallbackSrc?: string;
|
|
10
|
+
aspectRatio?: DenebImageAspectRatio;
|
|
11
|
+
radius?: DenebImageRadius;
|
|
12
|
+
fit?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
|
|
13
|
+
hoverZoom?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Universal auto-resolving image component for DENEB & Fivora templates.
|
|
17
|
+
*
|
|
18
|
+
* - Automatically prepends NEXT_PUBLIC_SITE_BASE_PATH to local assets
|
|
19
|
+
* - Preserves remote URLs (https://..., http://..., data:...)
|
|
20
|
+
* - Safely guards against empty string ("") triggers
|
|
21
|
+
* - Gracefully falls back to fallbackSrc or placeholder on error or missing src
|
|
22
|
+
*/
|
|
23
|
+
export declare function DenebImage({ id, 'data-preview-field-path': previewFieldPath, src, fallbackSrc, alt, aspectRatio, radius, fit, hoverZoom, style, className, onError, ...props }: DenebImageProps): React.JSX.Element;
|
|
24
|
+
export { DenebImage as SafeImage };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_IMAGE_FALLBACK_SVG = void 0;
|
|
4
|
+
exports.DenebImage = DenebImage;
|
|
5
|
+
exports.SafeImage = DenebImage;
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const utils_1 = require("./utils");
|
|
9
|
+
const ASPECT_MAP = {
|
|
10
|
+
square: '1 / 1',
|
|
11
|
+
'1/1': '1 / 1',
|
|
12
|
+
video: '16 / 9',
|
|
13
|
+
'16/9': '16 / 9',
|
|
14
|
+
portrait: '3 / 4',
|
|
15
|
+
'3/4': '3 / 4',
|
|
16
|
+
'4/3': '4 / 3',
|
|
17
|
+
'2/3': '2 / 3',
|
|
18
|
+
'21/9': '21 / 9',
|
|
19
|
+
};
|
|
20
|
+
const RADIUS_MAP = {
|
|
21
|
+
none: '0px',
|
|
22
|
+
sm: '4px',
|
|
23
|
+
md: '8px',
|
|
24
|
+
lg: '12px',
|
|
25
|
+
xl: '16px',
|
|
26
|
+
'2xl': '24px',
|
|
27
|
+
full: '9999px',
|
|
28
|
+
};
|
|
29
|
+
exports.DEFAULT_IMAGE_FALLBACK_SVG = 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="600" height="400" viewBox="0 0 600 400" fill="none"><rect width="600" height="400" fill="%23f1f5f9"/><path d="M250 180a30 30 0 100-60 30 30 0 000 60zM170 300l80-90 60 70 70-100 90 120H170z" fill="%23cbd5e1"/></svg>';
|
|
30
|
+
/**
|
|
31
|
+
* Universal auto-resolving image component for DENEB & Fivora templates.
|
|
32
|
+
*
|
|
33
|
+
* - Automatically prepends NEXT_PUBLIC_SITE_BASE_PATH to local assets
|
|
34
|
+
* - Preserves remote URLs (https://..., http://..., data:...)
|
|
35
|
+
* - Safely guards against empty string ("") triggers
|
|
36
|
+
* - Gracefully falls back to fallbackSrc or placeholder on error or missing src
|
|
37
|
+
*/
|
|
38
|
+
function DenebImage({ id, 'data-preview-field-path': previewFieldPath, src, fallbackSrc = exports.DEFAULT_IMAGE_FALLBACK_SVG, alt = '', aspectRatio, radius, fit = 'cover', hoverZoom = false, style, className = '', onError, ...props }) {
|
|
39
|
+
const [hasError, setHasError] = (0, react_1.useState)(false);
|
|
40
|
+
const path = previewFieldPath || id;
|
|
41
|
+
const resolvedAspect = aspectRatio ? (ASPECT_MAP[aspectRatio] || aspectRatio) : undefined;
|
|
42
|
+
const resolvedRadius = radius ? (RADIUS_MAP[radius] || radius) : undefined;
|
|
43
|
+
const combinedStyle = {
|
|
44
|
+
...(resolvedAspect ? { aspectRatio: resolvedAspect } : {}),
|
|
45
|
+
...(resolvedRadius ? { borderRadius: resolvedRadius } : {}),
|
|
46
|
+
...(fit ? { objectFit: fit } : {}),
|
|
47
|
+
...(hoverZoom ? { transition: 'transform 0.3s cubic-bezier(0.4, 0, 0.2, 1)' } : {}),
|
|
48
|
+
...style,
|
|
49
|
+
};
|
|
50
|
+
const rawSrc = hasError || !src || (typeof src === 'string' && src.trim() === '')
|
|
51
|
+
? fallbackSrc
|
|
52
|
+
: src;
|
|
53
|
+
const finalSrc = typeof rawSrc === 'string' ? (0, utils_1.withBasePath)(rawSrc) : rawSrc;
|
|
54
|
+
return ((0, jsx_runtime_1.jsx)("img", { "data-preview-field-path": path, src: finalSrc, alt: alt, style: combinedStyle, className: `deneb-image ${hoverZoom ? 'hover:scale-105' : ''} ${className}`.trim(), onError: (e) => {
|
|
55
|
+
if (!hasError && fallbackSrc && finalSrc !== (0, utils_1.withBasePath)(fallbackSrc)) {
|
|
56
|
+
setHasError(true);
|
|
57
|
+
}
|
|
58
|
+
onError?.(e);
|
|
59
|
+
}, ...props }));
|
|
60
|
+
}
|
|
@@ -9,6 +9,8 @@ export interface EditableCartDrawerProps {
|
|
|
9
9
|
freeShippingThreshold?: number;
|
|
10
10
|
onCheckout?: (items: CartItem[], total: number) => void;
|
|
11
11
|
className?: string;
|
|
12
|
+
checkoutMode?: "WHATSAPP_ONLY" | "FULL_ECOMMERCE";
|
|
13
|
+
ecommerceEnabled?: boolean;
|
|
12
14
|
}
|
|
13
|
-
export declare function EditableCartDrawer({ basePath, whatsappNumber, storeName, currency, checkoutUrl, freeShippingThreshold, onCheckout, className, }: EditableCartDrawerProps): React.JSX.Element | null;
|
|
15
|
+
export declare function EditableCartDrawer({ basePath, whatsappNumber, storeName, currency, checkoutUrl, freeShippingThreshold, onCheckout, className, checkoutMode, ecommerceEnabled, }: EditableCartDrawerProps): React.JSX.Element | null;
|
|
14
16
|
export declare const CartDrawer: typeof EditableCartDrawer;
|
|
@@ -8,9 +8,15 @@ const react_1 = require("react");
|
|
|
8
8
|
const useCart_1 = require("./cart/useCart");
|
|
9
9
|
const SiteDataProvider_1 = require("./SiteDataProvider");
|
|
10
10
|
const urls_1 = require("./utils/urls");
|
|
11
|
-
function EditableCartDrawer({ basePath = 'cart', whatsappNumber = '94770000000', storeName, currency = 'LKR', checkoutUrl, freeShippingThreshold, onCheckout, className = '', }) {
|
|
11
|
+
function EditableCartDrawer({ basePath = 'cart', whatsappNumber = '94770000000', storeName, currency = 'LKR', checkoutUrl, freeShippingThreshold, onCheckout, className = '', checkoutMode, ecommerceEnabled, }) {
|
|
12
12
|
const { items, isOpen, closeCart, removeItem, updateQuantity, clearCart, totalCount, subtotal, getWhatsAppOrderUrl, } = (0, useCart_1.useCart)();
|
|
13
13
|
const { siteData } = (0, SiteDataProvider_1.useSiteData)();
|
|
14
|
+
const resolvedCheckoutMode = checkoutMode ||
|
|
15
|
+
siteData?.checkoutMode ||
|
|
16
|
+
(siteData?.ecommerceEnabled ? "FULL_ECOMMERCE" : undefined) ||
|
|
17
|
+
(ecommerceEnabled ? "FULL_ECOMMERCE" : "WHATSAPP_ONLY");
|
|
18
|
+
const isFullEcommerce = resolvedCheckoutMode === "FULL_ECOMMERCE";
|
|
19
|
+
const resolvedCheckoutUrl = checkoutUrl || (isFullEcommerce ? "/checkout" : undefined);
|
|
14
20
|
// Helper to read content from siteData
|
|
15
21
|
const getContent = (key, fallback) => {
|
|
16
22
|
const section = siteData?.content?.[basePath];
|
|
@@ -53,11 +59,16 @@ function EditableCartDrawer({ basePath = 'cart', whatsappNumber = '94770000000',
|
|
|
53
59
|
: 100;
|
|
54
60
|
return ((0, jsx_runtime_1.jsxs)("div", { className: `deneb-cart-drawer-root fixed inset-0 z-50 flex justify-end ${className}`, children: [(0, jsx_runtime_1.jsx)("div", { className: "fixed inset-0 bg-black/60 backdrop-blur-sm transition-opacity", onClick: closeCart, "data-preview-static": "cart-backdrop", "aria-hidden": "true" }), (0, jsx_runtime_1.jsxs)("aside", { className: "relative z-10 flex h-full w-full max-w-md flex-col bg-neutral-900 text-white shadow-2xl transition-transform duration-300 ease-out border-l border-neutral-800", "aria-label": "Shopping Cart Drawer", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between border-b border-neutral-800 px-6 py-5", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h2", { className: "text-xl font-bold tracking-tight text-white", "data-preview-field-path": fieldPath('title'), children: title }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs text-neutral-400 mt-0.5", "data-preview-field-path": fieldPath('subtitle'), children: subtitle })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [items.length > 0 && ((0, jsx_runtime_1.jsx)("button", { type: "button", onClick: clearCart, className: "text-xs text-neutral-400 hover:text-red-400 transition-colors px-2 py-1 rounded", "data-preview-static": "cart-clear-btn", children: (0, jsx_runtime_1.jsx)("span", { "data-preview-field-path": fieldPath('clearCartText'), children: clearCartText }) })), (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: closeCart, className: "rounded-full p-2 text-neutral-400 hover:bg-neutral-800 hover:text-white transition-colors", "data-preview-static": "cart-close-btn", "aria-label": "Close cart", children: (0, jsx_runtime_1.jsx)("svg", { className: "h-5 w-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })] })] }), freeShippingThreshold && ((0, jsx_runtime_1.jsxs)("div", { className: "border-b border-neutral-800 bg-neutral-950/50 px-6 py-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between text-xs text-neutral-400 mb-1.5", children: [(0, jsx_runtime_1.jsx)("span", { children: subtotal >= freeShippingThreshold ? ((0, jsx_runtime_1.jsx)("span", { className: "font-semibold text-emerald-400", children: "\uD83C\uDF89 You unlocked free shipping!" })) : ((0, jsx_runtime_1.jsxs)("span", { children: ["Add ", (0, jsx_runtime_1.jsxs)("strong", { className: "text-white", children: [currency, (freeShippingThreshold - subtotal).toFixed(2)] }), " more for free shipping"] })) }), (0, jsx_runtime_1.jsxs)("span", { children: [progressPercent, "%"] })] }), (0, jsx_runtime_1.jsx)("div", { className: "h-1.5 w-full overflow-hidden rounded-full bg-neutral-800", children: (0, jsx_runtime_1.jsx)("div", { className: "h-full bg-emerald-500 transition-all duration-300", style: { width: `${progressPercent}%` } }) })] })), (0, jsx_runtime_1.jsx)("div", { className: "flex-1 overflow-y-auto px-6 py-4", children: items.length === 0 ? ((0, jsx_runtime_1.jsxs)("div", { className: "flex h-full flex-col items-center justify-center text-center py-12", children: [(0, jsx_runtime_1.jsx)("div", { className: "mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-neutral-800 text-neutral-400", children: (0, jsx_runtime_1.jsx)("svg", { className: "h-8 w-8", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z" }) }) }), (0, jsx_runtime_1.jsx)("h3", { className: "text-base font-semibold text-white", "data-preview-field-path": fieldPath('emptyTitle'), children: emptyTitle }), (0, jsx_runtime_1.jsx)("p", { className: "mt-1 text-sm text-neutral-400 max-w-xs", "data-preview-field-path": fieldPath('emptyMessage'), children: emptyMessage })] })) : ((0, jsx_runtime_1.jsx)("ul", { className: "divide-y divide-neutral-800", "data-preview-list-path": fieldPath('items'), children: items.map((item, idx) => ((0, jsx_runtime_1.jsxs)("li", { className: "flex gap-4 py-4", "data-preview-item-path": `${fieldPath('items')}[${idx}]`, children: [item.image ? ((0, jsx_runtime_1.jsx)("img", { src: (0, urls_1.withBasePath)(item.image), alt: item.name, className: "h-20 w-20 flex-shrink-0 rounded-lg object-cover bg-neutral-800 border border-neutral-700", "data-preview-static": "cart-item-image" })) : ((0, jsx_runtime_1.jsx)("div", { className: "flex h-20 w-20 flex-shrink-0 items-center justify-center rounded-lg bg-neutral-800 text-neutral-500 border border-neutral-700", "data-preview-static": "cart-item-placeholder", children: (0, jsx_runtime_1.jsx)("svg", { className: "h-8 w-8", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" }) }) })), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-1 flex-col justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between", children: [(0, jsx_runtime_1.jsx)("h4", { className: "text-sm font-medium text-white line-clamp-1", children: item.name }), (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: () => removeItem(item.id, item.size, item.color), className: "text-neutral-500 hover:text-red-400 transition-colors p-1", "data-preview-static": "cart-item-remove", "aria-label": `Remove ${item.name}`, children: (0, jsx_runtime_1.jsx)("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" }) }) })] }), (item.brand || item.size || item.color) && ((0, jsx_runtime_1.jsxs)("p", { className: "mt-0.5 text-xs text-neutral-400", children: [item.brand && (0, jsx_runtime_1.jsx)("span", { className: "text-emerald-400 font-semibold", children: item.brand }), item.brand && (item.size || item.color) && ' · ', item.size && `Size: ${item.size}`, item.size && item.color && ' · ', item.color && `Color: ${item.color}`] })), item.showPrice === false ? ((0, jsx_runtime_1.jsx)("p", { className: "mt-1 text-xs font-semibold text-neutral-400", children: "Price on Request" })) : ((0, jsx_runtime_1.jsx)("p", { className: "mt-1 text-sm font-semibold text-emerald-400", children: (0, useCart_1.formatCurrency)(item.price * item.quantity, currency) }))] }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2 mt-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "inline-flex items-center rounded-lg border border-neutral-700 bg-neutral-800", children: [(0, jsx_runtime_1.jsx)("button", { type: "button", onClick: () => updateQuantity(item.id, item.quantity - 1, item.size, item.color), className: "h-7 w-7 flex items-center justify-center text-neutral-300 hover:text-white transition-colors", "data-preview-static": "cart-item-decrement", "aria-label": "Decrease quantity", children: "-" }), (0, jsx_runtime_1.jsx)("span", { className: "w-8 text-center text-xs font-semibold text-white", children: item.quantity }), (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: () => updateQuantity(item.id, item.quantity + 1, item.size, item.color), className: "h-7 w-7 flex items-center justify-center text-neutral-300 hover:text-white transition-colors", "data-preview-static": "cart-item-increment", "aria-label": "Increase quantity", children: "+" })] }) })] })] }, `${item.id}-${item.size || ''}-${item.color || ''}`))) })) }), items.length > 0 && ((0, jsx_runtime_1.jsxs)("div", { className: "border-t border-neutral-800 bg-neutral-950 px-6 py-5", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-baseline mb-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-sm text-neutral-400", "data-preview-field-path": fieldPath('subtotalLabel'), children: subtotalLabel }), (0, jsx_runtime_1.jsx)("span", { className: "text-xl font-bold text-white", children: items.length > 0 && items.every((i) => i.showPrice === false)
|
|
55
61
|
? "Price on Request"
|
|
56
|
-
: (0, useCart_1.formatCurrency)(subtotal, currency) })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs text-neutral-500 mb-4", "data-preview-field-path": fieldPath('shippingNote'), children: shippingNote }), (0, jsx_runtime_1.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
: (0, useCart_1.formatCurrency)(subtotal, currency) })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs text-neutral-500 mb-4", "data-preview-field-path": fieldPath('shippingNote'), children: shippingNote }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-2.5", children: isFullEcommerce ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("button", { type: "button", onClick: () => {
|
|
63
|
+
if (onCheckout)
|
|
64
|
+
onCheckout(items, subtotal);
|
|
65
|
+
if (resolvedCheckoutUrl)
|
|
66
|
+
window.location.href = resolvedCheckoutUrl;
|
|
67
|
+
}, "data-preview-static": "cart-checkout-btn", className: "flex w-full items-center justify-center gap-2 rounded-xl bg-emerald-600 px-5 py-3.5 text-sm font-semibold text-white shadow-lg shadow-emerald-900/30 hover:bg-emerald-500 transition-all active:scale-[0.98]", children: [(0, jsx_runtime_1.jsx)("svg", { className: "h-4 w-4 fill-none stroke-current", strokeWidth: 2, viewBox: "0 0 24 24", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z" }) }), (0, jsx_runtime_1.jsx)("span", { "data-preview-field-path": fieldPath('checkoutButtonText'), children: checkoutButtonText })] }), (0, jsx_runtime_1.jsxs)("a", { href: whatsappHref, target: "_blank", rel: "noopener noreferrer", "data-preview-static": "cart-whatsapp-cta", className: "flex w-full items-center justify-center gap-2 rounded-xl bg-neutral-800 px-5 py-3 text-sm font-semibold text-neutral-300 hover:text-white hover:bg-neutral-700 transition-colors", children: [(0, jsx_runtime_1.jsx)("svg", { className: "h-4 w-4 fill-emerald-500", viewBox: "0 0 24 24", children: (0, jsx_runtime_1.jsx)("path", { d: "M12.031 6.172c-3.181 0-5.767 2.586-5.768 5.766-.001 1.298.38 2.27 1.019 3.287l-.711 2.598 2.664-.699c.971.531 1.769.813 2.796.813h.001c3.182 0 5.768-2.586 5.768-5.766 0-3.18-2.586-5.766-5.769-5.766zm9.969 5.766c0 5.518-4.482 10-10 10-1.745 0-3.415-.453-4.887-1.258l-5.113 1.341 1.365-4.989c-.931-1.537-1.465-3.327-1.465-5.094 0-5.518 4.482-10 10-10 5.518 0 10 4.482 10 10z" }) }), (0, jsx_runtime_1.jsx)("span", { "data-preview-field-path": fieldPath('whatsappButtonText'), children: whatsappButtonText })] })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("a", { href: whatsappHref, target: "_blank", rel: "noopener noreferrer", "data-preview-static": "cart-whatsapp-cta", className: "flex w-full items-center justify-center gap-2 rounded-xl bg-emerald-600 px-5 py-3.5 text-sm font-semibold text-white shadow-lg shadow-emerald-900/30 hover:bg-emerald-500 transition-all active:scale-[0.98]", children: [(0, jsx_runtime_1.jsx)("svg", { className: "h-4 w-4 fill-current", viewBox: "0 0 24 24", children: (0, jsx_runtime_1.jsx)("path", { d: "M12.031 6.172c-3.181 0-5.767 2.586-5.768 5.766-.001 1.298.38 2.27 1.019 3.287l-.711 2.598 2.664-.699c.971.531 1.769.813 2.796.813h.001c3.182 0 5.768-2.586 5.768-5.766 0-3.18-2.586-5.766-5.769-5.766zm9.969 5.766c0 5.518-4.482 10-10 10-1.745 0-3.415-.453-4.887-1.258l-5.113 1.341 1.365-4.989c-.931-1.537-1.465-3.327-1.465-5.094 0-5.518 4.482-10 10-10 5.518 0 10 4.482 10 10z" }) }), (0, jsx_runtime_1.jsx)("span", { "data-preview-field-path": fieldPath('whatsappButtonText'), children: whatsappButtonText })] }), (resolvedCheckoutUrl || onCheckout) && ((0, jsx_runtime_1.jsx)("button", { type: "button", onClick: () => {
|
|
68
|
+
if (onCheckout)
|
|
69
|
+
onCheckout(items, subtotal);
|
|
70
|
+
if (resolvedCheckoutUrl)
|
|
71
|
+
window.location.href = resolvedCheckoutUrl;
|
|
72
|
+
}, "data-preview-static": "cart-checkout-btn", className: "flex w-full items-center justify-center rounded-xl bg-neutral-800 px-5 py-3 text-sm font-semibold text-white hover:bg-neutral-700 transition-colors", children: (0, jsx_runtime_1.jsx)("span", { "data-preview-field-path": fieldPath('checkoutButtonText'), children: checkoutButtonText }) }))] })) })] }))] })] }));
|
|
62
73
|
}
|
|
63
74
|
exports.CartDrawer = EditableCartDrawer;
|
|
@@ -97,5 +97,7 @@ export interface EditableProductCardProps extends React.HTMLAttributes<HTMLEleme
|
|
|
97
97
|
onDetailClick?: (product: ProductItem, url: string) => void;
|
|
98
98
|
onAddToCart?: (product: ProductItem) => void;
|
|
99
99
|
onWhatsAppClick?: (product: ProductItem, url: string) => void;
|
|
100
|
+
checkoutMode?: "WHATSAPP_ONLY" | "FULL_ECOMMERCE";
|
|
101
|
+
ecommerceEnabled?: boolean;
|
|
100
102
|
}
|
|
101
|
-
export declare function EditableProductCard({ itemPath, product: productProp, item: itemProp, cardVariant, imageFallback, as: Component, currency, showBrand, showPrice, showDescription, showCategory, whatsappNumber: whatsappNumberProp, whatsappPhone: whatsappPhoneProp, storeName, showWhatsAppButton, showAddToCartButton, whatsappActionLabel, addToCartLabel, actionSlot, actionLabel, actionLabelPath, onAddToCart, onWhatsAppClick, href, detailHref, showDetailLink, showDetailButton, detailButtonText, onDetailClick, className, style, ...props }: EditableProductCardProps): React.JSX.Element;
|
|
103
|
+
export declare function EditableProductCard({ itemPath, product: productProp, item: itemProp, cardVariant, imageFallback, as: Component, currency, showBrand, showPrice, showDescription, showCategory, whatsappNumber: whatsappNumberProp, whatsappPhone: whatsappPhoneProp, storeName, showWhatsAppButton, showAddToCartButton, whatsappActionLabel, addToCartLabel, actionSlot, actionLabel, actionLabelPath, onAddToCart, onWhatsAppClick, checkoutMode: propCheckoutMode, ecommerceEnabled: propEcommerceEnabled, href, detailHref, showDetailLink, showDetailButton, detailButtonText, onDetailClick, className, style, ...props }: EditableProductCardProps): React.JSX.Element;
|
|
@@ -46,7 +46,7 @@ function WhatsAppIcon({ className = '', style = {} }) {
|
|
|
46
46
|
function CartIcon({ className = '', style = {} }) {
|
|
47
47
|
return ((0, jsx_runtime_1.jsxs)("svg", { viewBox: "0 0 24 24", width: "16", height: "16", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: className, style: { display: 'inline-block', verticalAlign: 'middle', flexShrink: 0, ...style }, "aria-hidden": "true", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "9", cy: "21", r: "1" }), (0, jsx_runtime_1.jsx)("circle", { cx: "20", cy: "21", r: "1" }), (0, jsx_runtime_1.jsx)("path", { d: "M1 1h4l2.68 13.39a2 2 0 002 1.61h9.72a2 2 0 002-1.61L23 6H6" })] }));
|
|
48
48
|
}
|
|
49
|
-
function EditableProductCard({ itemPath, product: productProp, item: itemProp, cardVariant = 'modern-glass', imageFallback, as: Component = 'article', currency = 'LKR', showBrand = true, showPrice = true, showDescription = true, showCategory = true, whatsappNumber: whatsappNumberProp, whatsappPhone: whatsappPhoneProp, storeName, showWhatsAppButton = true, showAddToCartButton = true, whatsappActionLabel = 'Inquire on WhatsApp', addToCartLabel = 'Add to Cart', actionSlot, actionLabel, actionLabelPath, onAddToCart, onWhatsAppClick, href, detailHref, showDetailLink = true, showDetailButton, detailButtonText, onDetailClick, className = '', style, ...props }) {
|
|
49
|
+
function EditableProductCard({ itemPath, product: productProp, item: itemProp, cardVariant = 'modern-glass', imageFallback, as: Component = 'article', currency = 'LKR', showBrand = true, showPrice = true, showDescription = true, showCategory = true, whatsappNumber: whatsappNumberProp, whatsappPhone: whatsappPhoneProp, storeName, showWhatsAppButton = true, showAddToCartButton = true, whatsappActionLabel = 'Inquire on WhatsApp', addToCartLabel = 'Add to Cart', actionSlot, actionLabel, actionLabelPath, onAddToCart, onWhatsAppClick, checkoutMode: propCheckoutMode, ecommerceEnabled: propEcommerceEnabled, href, detailHref, showDetailLink = true, showDetailButton, detailButtonText, onDetailClick, className = '', style, ...props }) {
|
|
50
50
|
const anyProps = props;
|
|
51
51
|
const product = (0, react_1.useMemo)(() => {
|
|
52
52
|
const base = (productProp || itemProp || {});
|
|
@@ -182,6 +182,14 @@ function EditableProductCard({ itemPath, product: productProp, item: itemProp, c
|
|
|
182
182
|
? 'photo'
|
|
183
183
|
: 'imageUrl');
|
|
184
184
|
const siteDataCard = (0, SiteDataProvider_1.useSiteData)();
|
|
185
|
+
const resolvedCheckoutMode = propCheckoutMode ||
|
|
186
|
+
siteDataCard?.siteData?.checkoutMode ||
|
|
187
|
+
siteDataCard?.checkoutMode ||
|
|
188
|
+
(siteDataCard?.siteData?.ecommerceEnabled || siteDataCard?.ecommerceEnabled ? "FULL_ECOMMERCE" : undefined) ||
|
|
189
|
+
(propEcommerceEnabled ? "FULL_ECOMMERCE" : undefined);
|
|
190
|
+
const effectiveShowAddToCart = resolvedCheckoutMode === "WHATSAPP_ONLY"
|
|
191
|
+
? props.showAddToCartButton === true
|
|
192
|
+
: showAddToCartButton;
|
|
185
193
|
const liveShopCard = siteDataCard?.shop;
|
|
186
194
|
const liveWaCard = liveShopCard?.contact?.whatsapp ||
|
|
187
195
|
liveShopCard?.businessWhatsapp ||
|
|
@@ -460,9 +468,9 @@ function EditableProductCard({ itemPath, product: productProp, item: itemProp, c
|
|
|
460
468
|
color: 'var(--muted-text, #94a3b8)',
|
|
461
469
|
border: '1px solid rgba(255, 255, 255, 0.12)',
|
|
462
470
|
letterSpacing: '0.01em',
|
|
463
|
-
}, children: "Price on Request" }) })) : null, actionSlot ? ((0, jsx_runtime_1.jsx)("div", { children: actionSlot })) : ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'column', gap: '0.5rem', width: '100%' }, children: [(showWhatsAppButton ||
|
|
471
|
+
}, children: "Price on Request" }) })) : null, actionSlot ? ((0, jsx_runtime_1.jsx)("div", { children: actionSlot })) : ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'column', gap: '0.5rem', width: '100%' }, children: [(showWhatsAppButton || effectiveShowAddToCart) && ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
464
472
|
display: 'grid',
|
|
465
|
-
gridTemplateColumns: showWhatsAppButton &&
|
|
473
|
+
gridTemplateColumns: showWhatsAppButton && effectiveShowAddToCart ? '1fr 1fr' : '1fr',
|
|
466
474
|
gap: '0.5rem',
|
|
467
475
|
width: '100%',
|
|
468
476
|
}, children: [showWhatsAppButton && ((0, jsx_runtime_1.jsxs)("button", { type: "button", onClick: handleWhatsAppClick, title: "Chat directly on WhatsApp about this product", style: {
|
|
@@ -480,7 +488,7 @@ function EditableProductCard({ itemPath, product: productProp, item: itemProp, c
|
|
|
480
488
|
gap: '0.375rem',
|
|
481
489
|
transition: 'all 0.2s ease',
|
|
482
490
|
boxShadow: '0 2px 8px rgba(37, 211, 102, 0.25)',
|
|
483
|
-
}, className: "hover:brightness-105 active:scale-95", children: [(0, jsx_runtime_1.jsx)(WhatsAppIcon, {}), (0, jsx_runtime_1.jsx)(EditableText_1.EditableText, { as: "span", id: `${itemPath}.whatsappButtonText`, "data-preview-field-path": `${itemPath}.whatsappButtonText`, defaultValue: resolvedWhatsAppText, style: { color: '#ffffff', fontWeight: 600, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' } })] })),
|
|
491
|
+
}, className: "hover:brightness-105 active:scale-95", children: [(0, jsx_runtime_1.jsx)(WhatsAppIcon, {}), (0, jsx_runtime_1.jsx)(EditableText_1.EditableText, { as: "span", id: `${itemPath}.whatsappButtonText`, "data-preview-field-path": `${itemPath}.whatsappButtonText`, defaultValue: resolvedWhatsAppText, style: { color: '#ffffff', fontWeight: 600, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' } })] })), effectiveShowAddToCart && ((0, jsx_runtime_1.jsxs)("button", { type: "button", onClick: handleAddToCartClick, title: "Add this product to shopping cart", style: {
|
|
484
492
|
backgroundColor: 'var(--button-bg, var(--brand-color, #2563eb))',
|
|
485
493
|
color: 'var(--button-text, #ffffff)',
|
|
486
494
|
border: 'none',
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { type ReactNode } from 'react';
|
|
2
2
|
import type { ProductItem } from './EditableProductCard';
|
|
3
3
|
import type { ServiceItem } from './EditableServiceCard';
|
|
4
|
+
import { withBasePath, resolveAsset } from './utils';
|
|
4
5
|
export declare const DENEB_PREVIEW_DATA_MESSAGE = "DENEB_PREVIEW_SITE_DATA";
|
|
5
6
|
export declare const PREVIEW_DATA_MESSAGE = "FIVORA_PREVIEW_SITE_DATA";
|
|
6
7
|
export declare const LEGACY_PREVIEW_DATA_MESSAGE: string;
|
|
@@ -90,6 +91,11 @@ export declare function useSiteData<T = SiteData>(): T;
|
|
|
90
91
|
export declare function contentObject(value: unknown): GenericRecord;
|
|
91
92
|
export declare function contentText(value: unknown): string;
|
|
92
93
|
export declare function contentList<Item = unknown>(value: unknown): Item[];
|
|
94
|
+
/**
|
|
95
|
+
* Safely extracts an image URL from siteData and ensures subpath base path is applied.
|
|
96
|
+
*/
|
|
97
|
+
export declare function contentImage(value: unknown, fallback?: string): string;
|
|
98
|
+
export { withBasePath, resolveAsset };
|
|
93
99
|
export declare function contentNumber(value: unknown, fallback?: number): number;
|
|
94
100
|
export declare function parseFieldPath(path: string): Array<string | number>;
|
|
95
101
|
export declare function getFieldStyle(content: unknown, path?: string): GenericRecord | null;
|
package/dist/SiteDataProvider.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
'use client';
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.DUMMY_PREVIEW_SHOP_NAME = exports.DUMMY_PREVIEW_ADDRESS = exports.DUMMY_PREVIEW_EMAIL = exports.DUMMY_PREVIEW_WHATSAPP = exports.DUMMY_PREVIEW_PHONE = exports.DenebDataContext = exports.useDenebData = exports.DenebDataProvider = exports.SiteDataContext = exports.DENEB_STYLE_PATCH_MESSAGE = exports.STYLE_PATCH_MESSAGE = exports.PREVIEW_FIELD_ATTRIBUTE = exports.LEGACY_PREVIEW_FOCUS_MESSAGE = exports.PREVIEW_FOCUS_MESSAGE = exports.DENEB_PREVIEW_FOCUS_MESSAGE = exports.LEGACY_PREVIEW_READY_MESSAGE = exports.PREVIEW_READY_MESSAGE = exports.DENEB_PREVIEW_READY_MESSAGE = exports.LEGACY_PREVIEW_DATA_MESSAGE = exports.PREVIEW_DATA_MESSAGE = exports.DENEB_PREVIEW_DATA_MESSAGE = void 0;
|
|
4
|
+
exports.DUMMY_PREVIEW_SHOP_NAME = exports.DUMMY_PREVIEW_ADDRESS = exports.DUMMY_PREVIEW_EMAIL = exports.DUMMY_PREVIEW_WHATSAPP = exports.DUMMY_PREVIEW_PHONE = exports.DenebDataContext = exports.useDenebData = exports.DenebDataProvider = exports.resolveAsset = exports.withBasePath = exports.SiteDataContext = exports.DENEB_STYLE_PATCH_MESSAGE = exports.STYLE_PATCH_MESSAGE = exports.PREVIEW_FIELD_ATTRIBUTE = exports.LEGACY_PREVIEW_FOCUS_MESSAGE = exports.PREVIEW_FOCUS_MESSAGE = exports.DENEB_PREVIEW_FOCUS_MESSAGE = exports.LEGACY_PREVIEW_READY_MESSAGE = exports.PREVIEW_READY_MESSAGE = exports.DENEB_PREVIEW_READY_MESSAGE = exports.LEGACY_PREVIEW_DATA_MESSAGE = exports.PREVIEW_DATA_MESSAGE = exports.DENEB_PREVIEW_DATA_MESSAGE = void 0;
|
|
5
5
|
exports.isRecord = isRecord;
|
|
6
6
|
exports.isDarkColor = isDarkColor;
|
|
7
7
|
exports.syncThemeToDocument = syncThemeToDocument;
|
|
@@ -14,6 +14,7 @@ exports.useSiteData = useSiteData;
|
|
|
14
14
|
exports.contentObject = contentObject;
|
|
15
15
|
exports.contentText = contentText;
|
|
16
16
|
exports.contentList = contentList;
|
|
17
|
+
exports.contentImage = contentImage;
|
|
17
18
|
exports.contentNumber = contentNumber;
|
|
18
19
|
exports.parseFieldPath = parseFieldPath;
|
|
19
20
|
exports.getFieldStyle = getFieldStyle;
|
|
@@ -38,6 +39,9 @@ const DenebComponentStyles_1 = require("./DenebComponentStyles");
|
|
|
38
39
|
const FontLoader_1 = require("./fonts/FontLoader");
|
|
39
40
|
const ResponsiveBaseStyles_1 = require("./ResponsiveBaseStyles");
|
|
40
41
|
const ThemeStyles_1 = require("./ThemeStyles");
|
|
42
|
+
const utils_1 = require("./utils");
|
|
43
|
+
Object.defineProperty(exports, "withBasePath", { enumerable: true, get: function () { return utils_1.withBasePath; } });
|
|
44
|
+
Object.defineProperty(exports, "resolveAsset", { enumerable: true, get: function () { return utils_1.resolveAsset; } });
|
|
41
45
|
exports.DENEB_PREVIEW_DATA_MESSAGE = 'DENEB_PREVIEW_SITE_DATA';
|
|
42
46
|
exports.PREVIEW_DATA_MESSAGE = 'FIVORA_PREVIEW_SITE_DATA';
|
|
43
47
|
const PREVIOUS_PREVIEW_PREFIX = `${['MARKET', 'PLACE'].join('')}_PREVIEW_`;
|
|
@@ -649,6 +653,13 @@ function contentText(value) {
|
|
|
649
653
|
function contentList(value) {
|
|
650
654
|
return Array.isArray(value) ? value : [];
|
|
651
655
|
}
|
|
656
|
+
/**
|
|
657
|
+
* Safely extracts an image URL from siteData and ensures subpath base path is applied.
|
|
658
|
+
*/
|
|
659
|
+
function contentImage(value, fallback = '') {
|
|
660
|
+
const val = typeof value === 'string' && value.trim() ? value.trim() : fallback;
|
|
661
|
+
return (0, utils_1.withBasePath)(val);
|
|
662
|
+
}
|
|
652
663
|
function contentNumber(value, fallback = 0) {
|
|
653
664
|
return typeof value === 'number' && !Number.isNaN(value) ? value : fallback;
|
|
654
665
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
export * from './PreviewField';
|
|
6
6
|
export * from './EditableText';
|
|
7
7
|
export * from './EditableImage';
|
|
8
|
+
export * from './DenebImage';
|
|
8
9
|
export * from './EditableIcon';
|
|
9
10
|
export * from './EditableMap';
|
|
10
11
|
export * from './EditableList';
|
|
@@ -69,6 +70,7 @@ export { EditableParagraph as Paragraph } from './EditableText';
|
|
|
69
70
|
export { EditableBadge as Badge } from './EditableText';
|
|
70
71
|
export { EditableQuote as Quote } from './EditableText';
|
|
71
72
|
export { EditableImage as Image } from './EditableImage';
|
|
73
|
+
export { DenebImage, DenebImage as SafeImage } from './DenebImage';
|
|
72
74
|
export { EditableMap as Map } from './EditableMap';
|
|
73
75
|
export { EditableGrid as Grid } from './EditableGrid';
|
|
74
76
|
export { EditableSection as Section } from './EditableSection';
|
package/dist/index.js
CHANGED
|
@@ -18,11 +18,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
18
18
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.
|
|
22
|
-
exports.generateThemeVariables = exports.mergeVisualCustomizationIntoTheme = exports.customizationToTheme = exports.parseVisualCustomization = exports.normalizeHexColor = exports.toHexColor = exports.getAutoContrastTextColor = exports.isDarkColor = exports.FONT_PAIRINGS = exports.GLOBAL_FONT_OPTIONS = exports.THEME_PALETTES = exports.DENEB_AUTHOR = exports.DENEB_FRAMEWORK_VERSION = exports.DENEB_FRAMEWORK_NAME = exports.AdditionalPagesNav = exports.PlatformAdditionalPages = exports.TestimonialCarousel = exports.BookingModal = exports.BeforeAfterSlider = exports.FilterSidebar = exports.CartDrawer = exports.CategoryPills = exports.AnnouncementBar = exports.HeroSplit = exports.Hero = exports.Footer = exports.Header = exports.Navbar = exports.ContactForm = exports.FAQ = exports.Accordion = exports.Testimonials = exports.TestimonialSection = void 0;
|
|
21
|
+
exports.ServiceCard = exports.GoogleFeedback = exports.CustomerReviews = exports.ProductDetail = exports.ProductShowcase = exports.ProductGrid = exports.EntityCard = exports.ListingCard = exports.UniversalCard = exports.VehicleCard = exports.ProductCard = exports.List = exports.Box = exports.Section = exports.Grid = exports.Map = exports.SafeImage = exports.DenebImage = exports.Image = exports.Quote = exports.Badge = exports.Paragraph = exports.Heading = exports.Text = exports.Dialog = exports.Card = exports.Button = exports.collectStyleTargetsFromHtml = exports.validateStyleTree = exports.styleToCssVariables = exports.patchStyleByPath = exports.patchElementStyle = exports.STYLE_TYPE_ATTRIBUTE = exports.STYLE_TARGET_ATTRIBUTE = exports.DENEB_STYLE_PATCH_MESSAGE = exports.STYLE_PATCH_MESSAGE = exports.formatResponsiveFontSize = exports.resolveInstallableFont = exports.normalizeFontId = exports.lookupFontDefinition = exports.listFontsByCategory = exports.collectFontIdsFromSiteData = exports.buildGoogleFontsStylesheetUrl = exports.DENEB_GOOGLE_FONT_COUNT = exports.DENEB_FONT_REGISTRY = exports.useDenebFonts = exports.DENEB_FONTS_LINK_ID = exports.FontLoader = exports.DenebComponentStyles = exports.ResponsiveBaseStyles = void 0;
|
|
22
|
+
exports.generateThemeVariables = exports.mergeVisualCustomizationIntoTheme = exports.customizationToTheme = exports.parseVisualCustomization = exports.normalizeHexColor = exports.toHexColor = exports.getAutoContrastTextColor = exports.isDarkColor = exports.FONT_PAIRINGS = exports.GLOBAL_FONT_OPTIONS = exports.THEME_PALETTES = exports.DENEB_AUTHOR = exports.DENEB_FRAMEWORK_VERSION = exports.DENEB_FRAMEWORK_NAME = exports.AdditionalPagesNav = exports.PlatformAdditionalPages = exports.TestimonialCarousel = exports.BookingModal = exports.BeforeAfterSlider = exports.FilterSidebar = exports.CartDrawer = exports.CategoryPills = exports.AnnouncementBar = exports.HeroSplit = exports.Hero = exports.Footer = exports.Header = exports.Navbar = exports.ContactForm = exports.FAQ = exports.Accordion = exports.Testimonials = exports.TestimonialSection = exports.TestimonialCard = exports.PricingCard = void 0;
|
|
23
23
|
__exportStar(require("./PreviewField"), exports);
|
|
24
24
|
__exportStar(require("./EditableText"), exports);
|
|
25
25
|
__exportStar(require("./EditableImage"), exports);
|
|
26
|
+
__exportStar(require("./DenebImage"), exports);
|
|
26
27
|
__exportStar(require("./EditableIcon"), exports);
|
|
27
28
|
__exportStar(require("./EditableMap"), exports);
|
|
28
29
|
__exportStar(require("./EditableList"), exports);
|
|
@@ -121,6 +122,9 @@ var EditableText_6 = require("./EditableText");
|
|
|
121
122
|
Object.defineProperty(exports, "Quote", { enumerable: true, get: function () { return EditableText_6.EditableQuote; } });
|
|
122
123
|
var EditableImage_1 = require("./EditableImage");
|
|
123
124
|
Object.defineProperty(exports, "Image", { enumerable: true, get: function () { return EditableImage_1.EditableImage; } });
|
|
125
|
+
var DenebImage_1 = require("./DenebImage");
|
|
126
|
+
Object.defineProperty(exports, "DenebImage", { enumerable: true, get: function () { return DenebImage_1.DenebImage; } });
|
|
127
|
+
Object.defineProperty(exports, "SafeImage", { enumerable: true, get: function () { return DenebImage_1.DenebImage; } });
|
|
124
128
|
var EditableMap_1 = require("./EditableMap");
|
|
125
129
|
Object.defineProperty(exports, "Map", { enumerable: true, get: function () { return EditableMap_1.EditableMap; } });
|
|
126
130
|
var EditableGrid_1 = require("./EditableGrid");
|
package/dist/utils/urls.d.ts
CHANGED
|
@@ -69,3 +69,8 @@ export declare function resolvePageRoute(pageKey: string, pages?: Array<{
|
|
|
69
69
|
id: string;
|
|
70
70
|
route: string;
|
|
71
71
|
}>): string;
|
|
72
|
+
/**
|
|
73
|
+
* Resolves static assets with subpath prefix support.
|
|
74
|
+
* Canonical alias for `withBasePath`.
|
|
75
|
+
*/
|
|
76
|
+
export declare const resolveAsset: typeof withBasePath;
|
package/dist/utils/urls.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Created by Chamika Gayashan & Induranga Kawishwara
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.resolveAsset = void 0;
|
|
7
8
|
exports.createWhatsAppUrl = createWhatsAppUrl;
|
|
8
9
|
exports.createPhoneUrl = createPhoneUrl;
|
|
9
10
|
exports.createEmailUrl = createEmailUrl;
|
|
@@ -162,3 +163,8 @@ function resolvePageRoute(pageKey, pages) {
|
|
|
162
163
|
const match = pages?.find((page) => page.id === pageKey);
|
|
163
164
|
return match?.route ?? `/${pageKey.replace(/_/g, '/')}`;
|
|
164
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* Resolves static assets with subpath prefix support.
|
|
168
|
+
* Canonical alias for `withBasePath`.
|
|
169
|
+
*/
|
|
170
|
+
exports.resolveAsset = withBasePath;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deneb-ui/ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.122",
|
|
4
4
|
"description": "Visual-first React component library for editable commerce storefronts. Built for Next.js and Fivora.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
],
|
|
51
51
|
"license": "MIT",
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@deneb-ui/core": "^2.0.
|
|
53
|
+
"@deneb-ui/core": "^2.0.122"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"react": "^18.0.0 || ^19.0.0",
|