@deneb-ui/ui 2.0.108 → 2.0.110
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/EditableCategoryPills.d.ts +1 -1
- package/dist/EditableCategoryPills.js +36 -13
- package/dist/EditableFilterSidebar.js +110 -18
- package/dist/EditableProductCard.d.ts +9 -1
- package/dist/EditableProductCard.js +108 -33
- package/dist/EditableProductGrid.d.ts +32 -9
- package/dist/EditableProductGrid.js +285 -71
- package/dist/EditableProductShowcase.d.ts +2 -0
- package/dist/EditableProductShowcase.js +4 -3
- package/dist/ProductQuickView.d.ts +5 -1
- package/dist/ProductQuickView.js +3 -2
- package/dist/SiteDataProvider.js +5 -1
- package/package.json +2 -2
package/dist/ProductQuickView.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.ProductQuickView = ProductQuickView;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const utils_1 = require("./utils");
|
|
7
|
+
const PlatformProductDetail_1 = require("./PlatformProductDetail");
|
|
7
8
|
/**
|
|
8
9
|
* DENEB UI — Product Quick View Modal
|
|
9
10
|
*
|
|
@@ -13,7 +14,7 @@ const utils_1 = require("./utils");
|
|
|
13
14
|
*
|
|
14
15
|
* Created by Chamika Gayashan & Induranga Kawishwara
|
|
15
16
|
*/
|
|
16
|
-
function ProductQuickView({ product, isOpen, onClose, onAddToCart, className = '', itemPath, addToCartLabel = 'Add to Selection', }) {
|
|
17
|
+
function ProductQuickView({ product, isOpen, onClose, onAddToCart, className = '', itemPath, addToCartLabel = 'Add to Selection', showDetailLink = true, detailLinkText = 'View full product details', }) {
|
|
17
18
|
const [quantity, setQuantity] = (0, react_1.useState)(1);
|
|
18
19
|
const [selectedImage, setSelectedImage] = (0, react_1.useState)('');
|
|
19
20
|
(0, react_1.useEffect)(() => {
|
|
@@ -58,5 +59,5 @@ function ProductQuickView({ product, isOpen, onClose, onAddToCart, className = '
|
|
|
58
59
|
}, children: (0, jsx_runtime_1.jsxs)("div", { className: "relative w-full max-w-2xl overflow-hidden rounded-3xl bg-white shadow-2xl border border-slate-100 flex flex-col md:flex-row max-h-[90vh]", children: [(0, jsx_runtime_1.jsx)("button", { type: "button", onClick: onClose, className: "absolute top-4 right-4 z-10 p-2 text-slate-400 hover:text-slate-700 bg-white/80 hover:bg-white rounded-full shadow-sm backdrop-blur transition-colors", "aria-label": "Close modal", children: (0, jsx_runtime_1.jsx)("svg", { className: "w-5 h-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" }) }) }), (0, jsx_runtime_1.jsxs)("div", { className: "md:w-1/2 p-6 flex flex-col items-center justify-center bg-slate-50 border-b md:border-b-0 md:border-r border-slate-100", children: [(0, jsx_runtime_1.jsxs)("div", { className: "relative w-full aspect-square rounded-2xl overflow-hidden bg-white shadow-sm flex items-center justify-center", children: [product.badge && ((0, jsx_runtime_1.jsx)("span", { ...(itemPath ? { 'data-preview-field-path': `${itemPath}.badge` } : {}), className: "absolute top-3 left-3 px-2.5 py-1 text-xs font-bold text-white bg-red-500 rounded-lg shadow-sm", children: product.badge })), selectedImage ? ((0, jsx_runtime_1.jsx)("img", { ...(itemPath ? { 'data-preview-field-path': `${itemPath}.image` } : {}), src: (0, utils_1.withBasePath)(selectedImage), alt: product.title, className: "w-full h-full object-cover" })) : ((0, jsx_runtime_1.jsx)("div", { className: "text-slate-300 text-sm", children: "No image available" }))] }), images.length > 1 && ((0, jsx_runtime_1.jsx)("div", { className: "flex gap-2 mt-4 overflow-x-auto max-w-full pb-1", children: images.map((img, idx) => ((0, jsx_runtime_1.jsx)("button", { type: "button", onClick: () => setSelectedImage(img), className: `w-12 h-12 rounded-lg overflow-hidden border-2 transition-all flex-shrink-0 ${selectedImage === img ? 'border-primary shadow-sm' : 'border-slate-200 opacity-60 hover:opacity-100'}`, children: (0, jsx_runtime_1.jsx)("img", { src: (0, utils_1.withBasePath)(img), alt: "", className: "w-full h-full object-cover" }) }, idx))) }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "md:w-1/2 p-6 flex flex-col justify-between overflow-y-auto", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [(0, jsx_runtime_1.jsx)("span", { className: `inline-flex items-center px-2 py-0.5 rounded text-xs font-semibold ${isAvailable ? 'bg-emerald-50 text-emerald-700' : 'bg-rose-50 text-rose-700'}`, children: isAvailable ? 'In Stock' : 'Out of Stock' }), product.rating && ((0, jsx_runtime_1.jsxs)("span", { className: "text-xs text-amber-500 flex items-center gap-1 font-medium", children: ["\u2605 ", product.rating, " ", product.reviewCount ? `(${product.reviewCount})` : ''] }))] }), (0, jsx_runtime_1.jsx)("h3", { ...(itemPath ? { 'data-preview-field-path': `${itemPath}.name` } : {}), className: "text-xl font-bold text-slate-900 leading-tight", children: product.title }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-3 flex items-baseline gap-2", children: [(0, jsx_runtime_1.jsxs)("span", { ...(itemPath ? { 'data-preview-field-path': `${itemPath}.price` } : {}), className: "text-2xl font-black text-slate-900", children: [currency, product.price] }), product.originalPrice && ((0, jsx_runtime_1.jsxs)("span", { className: "text-sm font-semibold text-slate-400 line-through", children: [currency, product.originalPrice] }))] }), product.description && ((0, jsx_runtime_1.jsx)("p", { ...(itemPath ? { 'data-preview-field-path': `${itemPath}.description` } : {}), className: "mt-4 text-sm text-slate-600 leading-relaxed", children: product.description }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-6 pt-6 border-t border-slate-100", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-sm font-medium text-slate-700", children: "Quantity" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center rounded-xl border border-slate-200 bg-slate-50 p-1", children: [(0, jsx_runtime_1.jsx)("button", { type: "button", onClick: () => setQuantity((q) => Math.max(1, q - 1)), className: "w-8 h-8 flex items-center justify-center rounded-lg hover:bg-white text-slate-600 font-bold transition-colors", children: "-" }), (0, jsx_runtime_1.jsx)("span", { className: "w-10 text-center font-bold text-sm text-slate-800", children: quantity }), (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: () => setQuantity((q) => q + 1), className: "w-8 h-8 flex items-center justify-center rounded-lg hover:bg-white text-slate-600 font-bold transition-colors", children: "+" })] })] }), (0, jsx_runtime_1.jsxs)("button", { type: "button", disabled: !isAvailable, onClick: handleAddToCart, className: "w-full py-3.5 px-4 rounded-xl font-bold text-sm text-white shadow-lg transition-all duration-200 active:scale-98 disabled:opacity-50 disabled:cursor-not-allowed hover:brightness-110 flex items-center justify-center gap-2", style: {
|
|
59
60
|
backgroundColor: 'var(--color-primary, #0f172a)',
|
|
60
61
|
boxShadow: '0 4px 14px rgba(15, 23, 42, 0.25)',
|
|
61
|
-
}, children: [(0, jsx_runtime_1.jsx)("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z" }) }), (0, jsx_runtime_1.jsx)("span", { ...(itemPath ? { 'data-preview-field-path': `${itemPath}.addToSelectionLabel` } : {}), children: isAvailable ? addToCartLabel : 'Out of Stock' })] })] })] })] }) }));
|
|
62
|
+
}, children: [(0, jsx_runtime_1.jsx)("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z" }) }), (0, jsx_runtime_1.jsx)("span", { ...(itemPath ? { 'data-preview-field-path': `${itemPath}.addToSelectionLabel` } : {}), children: isAvailable ? addToCartLabel : 'Out of Stock' })] }), showDetailLink && ((0, jsx_runtime_1.jsx)("div", { className: "mt-3 text-center", children: (0, jsx_runtime_1.jsxs)("a", { href: product.href || product.detailHref || (0, PlatformProductDetail_1.platformProductDetailHref)(product.id), "data-preview-static": "Open the stable live product detail page", className: "text-xs font-semibold text-slate-500 hover:text-slate-900 transition-colors inline-flex items-center gap-1", children: [(0, jsx_runtime_1.jsx)("span", { children: detailLinkText }), (0, jsx_runtime_1.jsx)("span", { "aria-hidden": "true", children: "\u2192" })] }) }))] })] })] }) }));
|
|
62
63
|
}
|
package/dist/SiteDataProvider.js
CHANGED
|
@@ -995,8 +995,12 @@ function isPreviewValidation(siteData) {
|
|
|
995
995
|
return true;
|
|
996
996
|
}
|
|
997
997
|
if (typeof window !== 'undefined') {
|
|
998
|
+
// If running in an iframe (Visual Editor preview in Shop Owner / Website Agent panel)
|
|
999
|
+
if (window.parent !== window) {
|
|
1000
|
+
return true;
|
|
1001
|
+
}
|
|
998
1002
|
const path = window.location.pathname || '';
|
|
999
|
-
if (path.includes('/template-validation') || path.includes('/template-preview') || path.includes('/preview/')) {
|
|
1003
|
+
if (path.includes('/template-validation') || path.includes('/template-preview') || path.includes('/preview/') || path.includes('/preview')) {
|
|
1000
1004
|
return true;
|
|
1001
1005
|
}
|
|
1002
1006
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deneb-ui/ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.110",
|
|
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.110"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"react": "^18.0.0 || ^19.0.0",
|