@officexapp/catalogs-cli 0.4.5 → 0.4.7

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.
Files changed (2) hide show
  1. package/dist/index.js +37 -5
  2. 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(CartCheckoutButton, { items, themeColor })
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
@@ -3076,6 +3085,19 @@ function buildPreviewHtml(schema, port, validation, devConfig) {
3076
3085
  },
3077
3086
  // Top bar
3078
3087
  topBarEnabled ? h('div', { className: 'cf-topbar fixed top-[28px] left-0 right-0 z-50 border-b border-gray-200/60' },
3088
+ // Announcement strip
3089
+ topBar?.announcement && (topBar.announcement.text || topBar.announcement.html)
3090
+ ? h('div', {
3091
+ className: 'cf-topbar-announcement text-center text-sm py-2 px-4 ' + (topBar.announcement.className || ''),
3092
+ style: {
3093
+ backgroundColor: topBar.announcement.bg_color || themeColor,
3094
+ color: topBar.announcement.text_color || '#ffffff',
3095
+ ...(topBar.announcement.style || {}),
3096
+ },
3097
+ ...(topBar.announcement.html ? { dangerouslySetInnerHTML: { __html: topBar.announcement.html } } : {}),
3098
+ }, topBar.announcement.html ? undefined : topBar.announcement.text)
3099
+ : null,
3100
+ // Nav row
3079
3101
  h('div', { className: 'relative flex items-center justify-center px-4 py-3 min-h-[48px]' },
3080
3102
  history.length > 0 ? h('button', {
3081
3103
  className: 'absolute left-3 top-1/2 -translate-y-1/2 w-9 h-9 flex items-center justify-center rounded-xl text-gray-400 hover:text-gray-700 hover:bg-gray-100/80 transition-all',
@@ -3085,8 +3107,18 @@ function buildPreviewHtml(schema, port, validation, devConfig) {
3085
3107
  h('path', { strokeLinecap: 'round', strokeLinejoin: 'round', d: 'M15.75 19.5L8.25 12l7.5-7.5' })
3086
3108
  )
3087
3109
  ) : null,
3088
- topBar?.title ? h('span', { className: 'text-sm font-medium text-gray-700' }, topBar.title) : null,
3089
- progressSteps ? h(Stepper, { steps: progressSteps, currentPageId, themeColor }) : null,
3110
+ topBar?.custom_html
3111
+ ? h('div', { dangerouslySetInnerHTML: { __html: topBar.custom_html } })
3112
+ : h(React.Fragment, null,
3113
+ topBar?.title ? h('span', { className: 'text-sm text-gray-700 ' + (
3114
+ topBar.title_weight === 'light' ? 'font-light' :
3115
+ topBar.title_weight === 'normal' ? 'font-normal' :
3116
+ topBar.title_weight === 'semibold' ? 'font-semibold' :
3117
+ topBar.title_weight === 'bold' ? 'font-bold' :
3118
+ 'font-medium'
3119
+ ) }, topBar.title) : null,
3120
+ progressSteps ? h(Stepper, { steps: progressSteps, currentPageId, themeColor }) : null,
3121
+ ),
3090
3122
  )
3091
3123
  ) : null,
3092
3124
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@officexapp/catalogs-cli",
3
- "version": "0.4.5",
3
+ "version": "0.4.7",
4
4
  "description": "CLI for Catalog Kit — upload videos, push catalogs, manage assets",
5
5
  "type": "module",
6
6
  "bin": {