@officexapp/catalogs-cli 0.4.4 → 0.4.6
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/index.js +12 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2272,7 +2272,7 @@ function buildPreviewHtml(schema, port, validation, devConfig) {
|
|
|
2272
2272
|
);
|
|
2273
2273
|
}
|
|
2274
2274
|
|
|
2275
|
-
function CartDrawer({ items, isOpen, onToggle, onRemove }) {
|
|
2275
|
+
function CartDrawer({ items, isOpen, onToggle, onRemove, onCheckout }) {
|
|
2276
2276
|
React.useEffect(() => {
|
|
2277
2277
|
if (!isOpen) return;
|
|
2278
2278
|
const handleKey = (e) => { if (e.key === 'Escape') onToggle(); };
|
|
@@ -2349,7 +2349,16 @@ function buildPreviewHtml(schema, port, validation, devConfig) {
|
|
|
2349
2349
|
'Added to order'
|
|
2350
2350
|
)
|
|
2351
2351
|
),
|
|
2352
|
-
h(
|
|
2352
|
+
onCheckout ? h('button', {
|
|
2353
|
+
className: 'cf-btn-primary w-full text-white flex items-center justify-center gap-2',
|
|
2354
|
+
style: { backgroundColor: themeColor },
|
|
2355
|
+
onClick: onCheckout,
|
|
2356
|
+
},
|
|
2357
|
+
h('svg', { className: 'w-4 h-4', fill: 'none', viewBox: '0 0 24 24', stroke: 'currentColor', strokeWidth: 2 },
|
|
2358
|
+
h('path', { strokeLinecap: 'round', strokeLinejoin: 'round', d: 'M16.5 10.5V6.75a4.5 4.5 0 10-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H6.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z' })
|
|
2359
|
+
),
|
|
2360
|
+
schema.settings?.cart?.checkout_button_text || 'Proceed to Checkout'
|
|
2361
|
+
) : null
|
|
2353
2362
|
) : null
|
|
2354
2363
|
)
|
|
2355
2364
|
);
|
|
@@ -3014,7 +3023,7 @@ function buildPreviewHtml(schema, port, validation, devConfig) {
|
|
|
3014
3023
|
const cartSettings = catalog.settings?.cart || {};
|
|
3015
3024
|
const cartUI = h(React.Fragment, null,
|
|
3016
3025
|
!cartSettings.hide_button ? h(CartButton, { itemCount: cartItems.length, onClick: toggleCart }) : null,
|
|
3017
|
-
h(CartDrawer, { items: cartItems, isOpen: cartOpen, onToggle: toggleCart, onRemove: removeFromCart })
|
|
3026
|
+
h(CartDrawer, { items: cartItems, isOpen: cartOpen, onToggle: toggleCart, onRemove: removeFromCart, onCheckout: catalog.settings?.checkout ? () => { setCartOpen(false); setShowCheckout(true); devEvents.emit('checkout_start', { item_count: cartItems.length }); } : undefined })
|
|
3018
3027
|
);
|
|
3019
3028
|
|
|
3020
3029
|
// Cover page layout
|