storefront-layouts 1.0.16 → 1.0.18

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 (232) hide show
  1. package/dist/components/auth/LoginForm.js +1 -1
  2. package/dist/components/auth/LoginSheet.js +1 -1
  3. package/dist/components/auth/login-form-core.js +2 -2
  4. package/dist/components/auth/login-sheet-registry.js +2 -2
  5. package/dist/components/auth/login-sheet-themes/booking-agenda.theme.js +1 -1
  6. package/dist/components/auth/login-sheet-themes/booking.theme.js +1 -1
  7. package/dist/components/auth/login-sheet-themes/clothing-minimal.theme.js +1 -1
  8. package/dist/components/auth/login-sheet-themes/clothing.theme.js +1 -1
  9. package/dist/components/auth/login-sheet-themes/electronics-grid.theme.js +1 -1
  10. package/dist/components/auth/login-sheet-themes/electronics.theme.js +1 -1
  11. package/dist/components/auth/login-sheet-themes/food-modern.theme.js +1 -1
  12. package/dist/components/auth/login-sheet-themes/food.theme.js +1 -1
  13. package/dist/components/auth/login-sheet-themes/index.js +9 -9
  14. package/dist/components/auth/login-sheet-themes/motivational-speaker.theme.js +1 -1
  15. package/dist/components/auth/login-sheets/StoreLoginSheetShell.js +3 -3
  16. package/dist/components/categories/category-masonry-grid.js +3 -3
  17. package/dist/components/learning/CertificateViewer.js +1 -1
  18. package/dist/components/rich-text/CategoryDescription.js +2 -2
  19. package/dist/components/rich-text/ProductDescription.js +2 -2
  20. package/dist/components/rich-text/RichTextExcerpt.js +1 -1
  21. package/dist/components/rich-text/SafeRichHtml.js +1 -1
  22. package/dist/components/shipping/ProductDeliveryInfoSection.js +2 -2
  23. package/dist/components/ui/alert-modal.js +1 -1
  24. package/dist/components/ui/guest-checkout-modal.js +2 -2
  25. package/dist/components/ui/image-skeleton.js +1 -1
  26. package/dist/components/ui/image-with-fallback.js +1 -1
  27. package/dist/components/ui/loading-skeleton-wrapper.js +1 -1
  28. package/dist/components/ui/modal.js +1 -1
  29. package/dist/components/ui/page-content-loader.js +1 -1
  30. package/dist/components/ui/product-card.d.ts.map +1 -1
  31. package/dist/components/ui/product-card.js +3 -2
  32. package/dist/components/ui/route-skeleton-loader.js +5 -5
  33. package/dist/components/ui/sheet.js +1 -1
  34. package/dist/components/ui/skeletons/index.js +5 -5
  35. package/dist/components/ui/skeletons/product-grid-skeleton.js +1 -1
  36. package/dist/editor/alignment-schemas/booking.js +1 -1
  37. package/dist/editor/alignment-schemas/clothing-minimal.js +1 -1
  38. package/dist/editor/alignment-schemas/index.js +20 -20
  39. package/dist/editor/alignment-schemas/lazy-loader.js +1 -1
  40. package/dist/editor/alignment-schemas/metadata.js +1 -1
  41. package/dist/editor/alignment-schemas/resolve-canvas-inspector-leaf.js +3 -3
  42. package/dist/editor/blocks/index.js +3 -3
  43. package/dist/editor/blocks/migrate-clothing-minimal.js +3 -3
  44. package/dist/editor/blocks/nav-outline-utils.js +2 -2
  45. package/dist/editor/blocks/registry.js +1 -1
  46. package/dist/editor/document/adapter.js +4 -4
  47. package/dist/editor/document/block-tree.js +1 -1
  48. package/dist/editor/document/index.js +6 -6
  49. package/dist/editor/document/validate.js +1 -1
  50. package/dist/editor/index.js +12 -12
  51. package/dist/editor/layout-content-loader.js +3 -3
  52. package/dist/editor/payaza-form/ArrayItemManager.js +2 -2
  53. package/dist/editor/payaza-form/EditorCanvasPreview.js +4 -4
  54. package/dist/editor/payaza-form/FieldRenderer.js +17 -17
  55. package/dist/editor/payaza-form/IframePreviewMessageBridge.js +3 -3
  56. package/dist/editor/payaza-form/PayazaFormEditor.js +29 -29
  57. package/dist/editor/payaza-form/PayazaFormEditorFullPage.js +2 -2
  58. package/dist/editor/payaza-form/SliderArrayEditor.js +2 -2
  59. package/dist/editor/payaza-form/components/ArrayField.js +1 -1
  60. package/dist/editor/payaza-form/components/BlockStylesInspector.js +1 -1
  61. package/dist/editor/payaza-form/components/BlocksField.js +8 -8
  62. package/dist/editor/payaza-form/components/ButtonField.js +3 -3
  63. package/dist/editor/payaza-form/components/CanvasGranularInspector.js +11 -11
  64. package/dist/editor/payaza-form/components/IconField.js +2 -2
  65. package/dist/editor/payaza-form/components/ImageField.js +1 -1
  66. package/dist/editor/payaza-form/components/NumberField.js +1 -1
  67. package/dist/editor/payaza-form/components/RichTextField.js +2 -2
  68. package/dist/editor/payaza-form/components/SectionSchemaInspector.js +3 -3
  69. package/dist/editor/payaza-form/components/StarRatingField.js +1 -1
  70. package/dist/editor/payaza-form/components/TextField.js +1 -1
  71. package/dist/editor/payaza-form/data-merger.js +6 -6
  72. package/dist/editor/payaza-form/data-transformer.js +3 -3
  73. package/dist/editor/payaza-form/engine.js +1 -1
  74. package/dist/editor/payaza-form/examples/custom-widgets.example.js +1 -1
  75. package/dist/editor/payaza-form/index.js +8 -8
  76. package/dist/editor/payaza-form/layout-loader.js +2 -2
  77. package/dist/editor/payaza-form/preview-message-handler.js +3 -3
  78. package/dist/editor/payaza-form/schema-bridge.js +3 -3
  79. package/dist/editor/payaza-form/widget-registry.js +1 -1
  80. package/dist/editor/shared/BlockOutlineTree.js +1 -1
  81. package/dist/editor/shared/EditorHeader.js +1 -1
  82. package/dist/editor/shared/EditorNavigator.js +1 -1
  83. package/dist/editor/shared/IframePreview.js +6 -6
  84. package/dist/editor/shared/InlineCanvasPreview.js +7 -7
  85. package/dist/editor/shared/LayoutRenderer.js +1 -1
  86. package/dist/editor/shared/ResizableSidebar.js +1 -1
  87. package/dist/editor/shared/index.js +7 -7
  88. package/dist/hooks/use-product-reviews.js +1 -1
  89. package/dist/hooks/usePreviewSlideSync.js +1 -1
  90. package/dist/index.js +143 -143
  91. package/dist/layouts/booking/components/BookingHomePage.js +1 -1
  92. package/dist/layouts/booking/components/BookingMultilineHeading.js +1 -1
  93. package/dist/layouts/booking/components/BookingTestimonialCard.js +1 -1
  94. package/dist/layouts/booking/components/booking-footer-defaults.js +2 -2
  95. package/dist/layouts/booking/index.js +8 -8
  96. package/dist/layouts/booking/pages/AboutPage.d.ts.map +1 -1
  97. package/dist/layouts/booking/pages/AboutPage.js +16 -7
  98. package/dist/layouts/booking/pages/BookPage.js +1 -1
  99. package/dist/layouts/booking/pages/CategoriesPage.js +2 -2
  100. package/dist/layouts/booking/pages/ProductDetailPage.js +3 -3
  101. package/dist/layouts/booking-agenda/components/BookingHomePageAgenda.js +3 -3
  102. package/dist/layouts/booking-agenda/index.js +8 -8
  103. package/dist/layouts/booking-agenda/pages/AboutPage.d.ts.map +1 -1
  104. package/dist/layouts/booking-agenda/pages/AboutPage.js +16 -7
  105. package/dist/layouts/booking-agenda/pages/CategoriesPage.js +1 -1
  106. package/dist/layouts/booking-agenda/pages/ProductDetailPage.js +3 -3
  107. package/dist/layouts/clothing/components/ClothingHomePage.d.ts.map +1 -1
  108. package/dist/layouts/clothing/components/ClothingHomePage.js +13 -12
  109. package/dist/layouts/clothing/index.js +7 -7
  110. package/dist/layouts/clothing/pages/AboutPage.d.ts.map +1 -1
  111. package/dist/layouts/clothing/pages/AboutPage.js +11 -5
  112. package/dist/layouts/clothing/pages/CategoriesPage.js +9 -9
  113. package/dist/layouts/clothing/pages/CategoryPage.js +7 -7
  114. package/dist/layouts/clothing/pages/ContactPage.js +3 -3
  115. package/dist/layouts/clothing/pages/ProductDetailPage.js +24 -24
  116. package/dist/layouts/clothing/pages/ProductsPage.js +17 -17
  117. package/dist/layouts/clothing/payaza-bindings.js +2 -2
  118. package/dist/layouts/clothing-minimal/components/ClothingHomePageMinimal.d.ts.map +1 -1
  119. package/dist/layouts/clothing-minimal/components/ClothingHomePageMinimal.js +11 -10
  120. package/dist/layouts/clothing-minimal/components/clothing-minimal-block-render.js +7 -7
  121. package/dist/layouts/clothing-minimal/index.js +7 -7
  122. package/dist/layouts/clothing-minimal/pages/AboutPage.d.ts.map +1 -1
  123. package/dist/layouts/clothing-minimal/pages/AboutPage.js +12 -5
  124. package/dist/layouts/clothing-minimal/pages/CategoriesPage.js +8 -8
  125. package/dist/layouts/clothing-minimal/pages/CategoryPage.js +7 -7
  126. package/dist/layouts/clothing-minimal/pages/ContactPage.js +3 -3
  127. package/dist/layouts/clothing-minimal/pages/ProductDetailPage.js +24 -24
  128. package/dist/layouts/clothing-minimal/pages/ProductsPage.js +18 -18
  129. package/dist/layouts/electronics/components/ElectronicsCategoriesPage.js +3 -3
  130. package/dist/layouts/electronics/components/ElectronicsGridProductCard.d.ts.map +1 -1
  131. package/dist/layouts/electronics/components/ElectronicsGridProductCard.js +4 -3
  132. package/dist/layouts/electronics/components/ElectronicsHomePage.d.ts.map +1 -1
  133. package/dist/layouts/electronics/components/ElectronicsHomePage.js +5 -4
  134. package/dist/layouts/electronics/components/ElectronicsPageWrapper.js +2 -2
  135. package/dist/layouts/electronics/components/ElectronicsProductsPage.js +4 -4
  136. package/dist/layouts/electronics/components/ElectronicsStoreHeader.js +1 -1
  137. package/dist/layouts/electronics/index.js +18 -18
  138. package/dist/layouts/electronics/pages/AboutPage.d.ts.map +1 -1
  139. package/dist/layouts/electronics/pages/AboutPage.js +7 -2
  140. package/dist/layouts/electronics/pages/CategoriesPage.js +1 -1
  141. package/dist/layouts/electronics/pages/ProductDetailPage.js +3 -3
  142. package/dist/layouts/electronics/pages/ProductsPage.js +2 -2
  143. package/dist/layouts/electronics-grid/components/ElectronicsGridProductCard.d.ts.map +1 -1
  144. package/dist/layouts/electronics-grid/components/ElectronicsGridProductCard.js +4 -3
  145. package/dist/layouts/electronics-grid/components/ElectronicsHomePageGrid.js +2 -2
  146. package/dist/layouts/electronics-grid/index.js +14 -14
  147. package/dist/layouts/electronics-grid/pages/AboutPage.d.ts.map +1 -1
  148. package/dist/layouts/electronics-grid/pages/AboutPage.js +7 -2
  149. package/dist/layouts/electronics-grid/pages/CategoriesPage.js +1 -1
  150. package/dist/layouts/electronics-grid/pages/ProductDetailPage.js +3 -3
  151. package/dist/layouts/electronics-grid/pages/ProductsPage.js +2 -2
  152. package/dist/layouts/food/components/FoodHomePage.js +1 -1
  153. package/dist/layouts/food/index.js +8 -8
  154. package/dist/layouts/food/pages/AboutPage.d.ts.map +1 -1
  155. package/dist/layouts/food/pages/AboutPage.js +5 -1
  156. package/dist/layouts/food/pages/CategoriesPage.js +2 -2
  157. package/dist/layouts/food/pages/CategoryPage.js +2 -2
  158. package/dist/layouts/food/pages/ProductDetailPage.js +4 -4
  159. package/dist/layouts/food/pages/ProductsPage.js +2 -2
  160. package/dist/layouts/food-modern/components/FoodHomePageModern.js +3 -3
  161. package/dist/layouts/food-modern/index.js +8 -8
  162. package/dist/layouts/food-modern/pages/AboutPage.d.ts.map +1 -1
  163. package/dist/layouts/food-modern/pages/AboutPage.js +10 -3
  164. package/dist/layouts/food-modern/pages/CategoriesPage.js +1 -1
  165. package/dist/layouts/food-modern/pages/CategoryPage.js +2 -2
  166. package/dist/layouts/food-modern/pages/ProductDetailPage.js +3 -3
  167. package/dist/layouts/food-modern/pages/ProductsPage.js +2 -2
  168. package/dist/layouts/motivational-speaker/components/MotivationalSpeakerPageWrapper.js +1 -1
  169. package/dist/layouts/motivational-speaker/index.js +9 -9
  170. package/dist/layouts/motivational-speaker/pages/AboutPage.d.ts.map +1 -1
  171. package/dist/layouts/motivational-speaker/pages/AboutPage.js +9 -2
  172. package/dist/layouts/motivational-speaker/pages/ProductsPage.js +2 -2
  173. package/dist/layouts/shared/about-story-media.d.ts +27 -0
  174. package/dist/layouts/shared/about-story-media.d.ts.map +1 -0
  175. package/dist/layouts/shared/about-story-media.js +46 -0
  176. package/dist/layouts/shared/components/BaseStoreLayout.js +9 -9
  177. package/dist/layouts/shared/components/GenericPageWrapper.js +3 -3
  178. package/dist/layouts/shared/components/PdpVariationSelectors.js +2 -2
  179. package/dist/layouts/shared/components/PromoBanner.js +4 -4
  180. package/dist/layouts/shared/components/StoreCartSheet.js +9 -9
  181. package/dist/layouts/shared/components/StoreFooter.js +9 -9
  182. package/dist/layouts/shared/components/StoreHeader.js +8 -8
  183. package/dist/layouts/shared/components/headers/BookingAgendaSidebar.js +2 -2
  184. package/dist/layouts/shared/components/headers/ClothingMinimalHeader.js +9 -9
  185. package/dist/layouts/shared/components/headers/FoodModernHeader.js +7 -7
  186. package/dist/layouts/shared/index.js +22 -22
  187. package/dist/layouts/shared/pages/StoreMaintenanceScreen.js +2 -2
  188. package/dist/layouts/shared/wrappers/BookingAgendaLayout.js +16 -16
  189. package/dist/layouts/shared/wrappers/ClothingLayout.js +8 -8
  190. package/dist/layouts/shared/wrappers/ClothingMinimalLayout.js +7 -7
  191. package/dist/layouts/shared/wrappers/ElectronicsLayout.js +5 -5
  192. package/dist/layouts/shared/wrappers/FoodModernLayout.js +6 -6
  193. package/dist/layouts/shared/wrappers/MotivationalLayout.js +9 -9
  194. package/dist/layouts/shared/wrappers/StandardLayout.js +8 -8
  195. package/dist/lib/auth-context.js +2 -2
  196. package/dist/lib/layout-config-hydration.js +2 -2
  197. package/dist/lib/product-variation-utils.js +1 -1
  198. package/dist/lib/services/analytics.service.js +1 -1
  199. package/dist/lib/services/auth.service.js +1 -1
  200. package/dist/lib/services/booking.service.js +1 -1
  201. package/dist/lib/services/category.service.js +1 -1
  202. package/dist/lib/services/checkout.service.js +1 -1
  203. package/dist/lib/services/contact.service.js +1 -1
  204. package/dist/lib/services/customer.service.js +1 -1
  205. package/dist/lib/services/fees.service.js +1 -1
  206. package/dist/lib/services/index.js +13 -13
  207. package/dist/lib/services/location.service.js +1 -1
  208. package/dist/lib/services/order.service.js +1 -1
  209. package/dist/lib/services/payment.service.js +1 -1
  210. package/dist/lib/services/product.service.js +1 -1
  211. package/dist/lib/services/promo.service.js +1 -1
  212. package/dist/lib/services/review.service.js +1 -1
  213. package/dist/lib/services/service.service.js +1 -1
  214. package/dist/lib/services/shipping.service.js +1 -1
  215. package/dist/lib/services/store.service.js +1 -1
  216. package/dist/lib/store-config-utils.js +7 -7
  217. package/dist/lib/store-config.js +1 -1
  218. package/dist/lib/store-context.js +12 -12
  219. package/dist/lib/utils/asset-helpers.js +2 -2
  220. package/dist/lib/utils/editor-preview.js +3 -3
  221. package/dist/lib/utils/index.js +3 -3
  222. package/dist/lib/utils/product-images.js +1 -1
  223. package/dist/lib/utils/product-share.js +1 -1
  224. package/dist/lib/utils/url-helpers.js +1 -1
  225. package/dist/preview/LayoutPreview.js +5 -5
  226. package/dist/preview/PreviewRouter.js +2 -2
  227. package/dist/preview/canvas/PreviewCanvasEnhancer.js +8 -8
  228. package/dist/preview/canvas/preview-flush-await.js +1 -1
  229. package/dist/preview/canvas/preview-isolation.js +1 -1
  230. package/dist/preview/canvas/preview-route.js +2 -2
  231. package/dist/preview/index.js +4 -4
  232. package/package.json +30 -31
@@ -1,13 +1,13 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { StoreHeader } from '../components/StoreHeader';
4
- import { StoreFooter } from '../components/StoreFooter';
5
- import { PageAnimateWrapper } from '../../../components/ui/page-animate-wrapper';
6
- import { PageContentLoader } from '../../../components/ui/page-content-loader';
7
- import { useStore } from '../../../lib/store-context';
8
- import { useLoading } from '../../../lib/loading-context';
9
- import { getThemeColor } from '../../../lib/utils/asset-helpers';
10
- import { AlertModalProvider } from '../../../components/ui/alert-modal';
3
+ import { StoreHeader } from '../components/StoreHeader.js';
4
+ import { StoreFooter } from '../components/StoreFooter.js';
5
+ import { PageAnimateWrapper } from '../../../components/ui/page-animate-wrapper.js';
6
+ import { PageContentLoader } from '../../../components/ui/page-content-loader.js';
7
+ import { useStore } from '../../../lib/store-context.js';
8
+ import { useLoading } from '../../../lib/loading-context.js';
9
+ import { getThemeColor } from '../../../lib/utils/asset-helpers.js';
10
+ import { AlertModalProvider } from '../../../components/ui/alert-modal.js';
11
11
  export function StandardLayout({ children, storeConfig }) {
12
12
  const { cartCount } = useStore();
13
13
  const { isBackendLoading } = useLoading();
@@ -2,8 +2,8 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { createContext, useContext, useState, useEffect, useCallback, useMemo, useRef } from 'react';
4
4
  import { useRouter } from 'next/navigation';
5
- import { authService } from './services/auth.service';
6
- import { customerService } from './services/customer.service';
5
+ import { authService } from './services/auth.service.js';
6
+ import { customerService } from './services/customer.service.js';
7
7
  export const AuthContext = createContext({
8
8
  user: null,
9
9
  isAuthenticated: false,
@@ -2,8 +2,8 @@
2
2
  * Server-safe hydration of published layout config from DB/API payloads.
3
3
  * Merges compiledLegacyConfigJson, editorDocument section entries, and layoutConfig.sections.
4
4
  */
5
- import { validateEditorEnvelope } from '../editor/document/validate';
6
- import { envelopeToStoreConfig } from '../editor/document/adapter';
5
+ import { validateEditorEnvelope } from '../editor/document/validate.js';
6
+ import { envelopeToStoreConfig } from '../editor/document/adapter.js';
7
7
  function isPlainObject(value) {
8
8
  return value !== null && typeof value === 'object' && !Array.isArray(value);
9
9
  }
@@ -1,4 +1,4 @@
1
- import { extractImageUrls } from './store-config-utils';
1
+ import { extractImageUrls } from './store-config-utils.js';
2
2
  const ATTRIBUTE_ORDER = ['color', 'size', 'material', 'style'];
3
3
  /** Collapse display labels (e.g. from legacy mapping) onto attribute keys used in admin. */
4
4
  export function canonicalVariationOptionGroupKey(rawKey) {
@@ -1,4 +1,4 @@
1
- import { api } from '../api';
1
+ import { api } from '../api.js';
2
2
  function getCurrentApiBaseUrl() {
3
3
  return api.defaults.baseURL || `${process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4002'}/api`;
4
4
  }
@@ -1,4 +1,4 @@
1
- import { api } from '../api';
1
+ import { api } from '../api.js';
2
2
  export const authService = {
3
3
  /**
4
4
  * Register a new user
@@ -1,4 +1,4 @@
1
- import { api } from '../api';
1
+ import { api } from '../api.js';
2
2
  export const bookingService = {
3
3
  /**
4
4
  * Create a booking (guest or authenticated)
@@ -1,4 +1,4 @@
1
- import { api } from '../api';
1
+ import { api } from '../api.js';
2
2
  export const categoryService = {
3
3
  /**
4
4
  * Get all categories for a store
@@ -1,4 +1,4 @@
1
- import { api } from '../api';
1
+ import { api } from '../api.js';
2
2
  export const checkoutService = {
3
3
  /**
4
4
  * Process checkout
@@ -1,4 +1,4 @@
1
- import { api } from '../api';
1
+ import { api } from '../api.js';
2
2
  /**
3
3
  * Submit contact form for a store.
4
4
  * Store is identified by slug (from store config).
@@ -1,4 +1,4 @@
1
- import { api } from '../api';
1
+ import { api } from '../api.js';
2
2
  export const customerService = {
3
3
  /**
4
4
  * Get customer profile (requires authentication)
@@ -1,4 +1,4 @@
1
- import { api } from '../api';
1
+ import { api } from '../api.js';
2
2
  export const EMPTY_CHECKOUT_FEE_BREAKDOWN = {
3
3
  subtotal: 0,
4
4
  shipping: 0,
@@ -3,16 +3,16 @@
3
3
  * Note: cart, wishlist, and order services removed - they're not needed for editor preview
4
4
  * These services are only used in shared pages (cart, wishlist, account, orders) which aren't editable
5
5
  */
6
- export * from './store.service';
7
- export * from './product.service';
8
- export * from './category.service';
9
- export * from './auth.service';
10
- export * from './checkout.service';
11
- export * from './service.service';
12
- export * from './booking.service';
13
- export * from './customer.service';
14
- export * from './review.service';
15
- export * from './promo.service';
16
- export * from './shipping.service';
17
- export * from './fees.service';
18
- export * from './location.service';
6
+ export * from './store.service.js';
7
+ export * from './product.service.js';
8
+ export * from './category.service.js';
9
+ export * from './auth.service.js';
10
+ export * from './checkout.service.js';
11
+ export * from './service.service.js';
12
+ export * from './booking.service.js';
13
+ export * from './customer.service.js';
14
+ export * from './review.service.js';
15
+ export * from './promo.service.js';
16
+ export * from './shipping.service.js';
17
+ export * from './fees.service.js';
18
+ export * from './location.service.js';
@@ -1,4 +1,4 @@
1
- import { api } from '../api';
1
+ import { api } from '../api.js';
2
2
  export const locationService = {
3
3
  /**
4
4
  * Get all active locations for a store
@@ -1,4 +1,4 @@
1
- import { api } from '../api';
1
+ import { api } from '../api.js';
2
2
  export const orderService = {
3
3
  async markPaymentInitiated(orderId) {
4
4
  await api.post(`/orders/${orderId}/mark-payment-initiated`, {}, { _suppressToast: true });
@@ -1,4 +1,4 @@
1
- import { api, ApiError } from '../api';
1
+ import { api, ApiError } from '../api.js';
2
2
  /** Canonical success is `completed`; `paid` is a legacy read alias. */
3
3
  export function isPaymentConfirmed(status) {
4
4
  const normalized = (status || '').toLowerCase();
@@ -1,4 +1,4 @@
1
- import { api } from '../api';
1
+ import { api } from '../api.js';
2
2
  export const productService = {
3
3
  /**
4
4
  * Get products with filtering, sorting, and pagination
@@ -1,4 +1,4 @@
1
- import { api } from '../api';
1
+ import { api } from '../api.js';
2
2
  export const promoService = {
3
3
  /**
4
4
  * Validate a promo code
@@ -1,4 +1,4 @@
1
- import { api } from '../api';
1
+ import { api } from '../api.js';
2
2
  export const reviewService = {
3
3
  /**
4
4
  * Get product reviews
@@ -1,4 +1,4 @@
1
- import { api } from '../api';
1
+ import { api } from '../api.js';
2
2
  export const serviceService = {
3
3
  /**
4
4
  * Get services for a store
@@ -1,4 +1,4 @@
1
- import { api } from '../api';
1
+ import { api } from '../api.js';
2
2
  export const shippingService = {
3
3
  /**
4
4
  * Calculate shipping costs
@@ -1,4 +1,4 @@
1
- import { api } from '../api';
1
+ import { api } from '../api.js';
2
2
  export const storeService = {
3
3
  /**
4
4
  * Get store by slug
@@ -1,10 +1,10 @@
1
- import { getStoreConfig } from './store-config';
2
- import { shouldUseAPI, getBaseStoreSlug } from './utils/demo-detection';
3
- import { storeService } from './services/store.service';
4
- import { categoryService } from './services/category.service';
5
- import { productService } from './services/product.service';
6
- import { serviceService } from './services/service.service';
7
- import { normalizePrice } from './utils';
1
+ import { getStoreConfig } from './store-config.js';
2
+ import { shouldUseAPI, getBaseStoreSlug } from './utils/demo-detection.js';
3
+ import { storeService } from './services/store.service.js';
4
+ import { categoryService } from './services/category.service.js';
5
+ import { productService } from './services/product.service.js';
6
+ import { serviceService } from './services/service.service.js';
7
+ import { normalizePrice } from './utils/index.js';
8
8
  // Simple ID generator fallback (doesn't require uuid package)
9
9
  function generateId() {
10
10
  if (typeof crypto !== 'undefined' && crypto.randomUUID) {
@@ -1,4 +1,4 @@
1
1
  // Re-export functions from mock-stores for convenience
2
2
  // Import first, then export to ensure webpack can resolve properly
3
- import { getStoreConfig, getAllStores, isValidStoreSlug, getTemplateLayoutConfigForLayoutType } from './mock-stores';
3
+ import { getStoreConfig, getAllStores, isValidStoreSlug, getTemplateLayoutConfigForLayoutType } from './mock-stores.js';
4
4
  export { getStoreConfig, getAllStores, isValidStoreSlug, getTemplateLayoutConfigForLayoutType };
@@ -2,20 +2,20 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { createContext, useContext, useEffect, useState, useMemo, useCallback } from 'react';
4
4
  import { usePathname } from 'next/navigation';
5
- import { getStoreConfig } from './store-config';
6
- import { shouldUseAPI, getBaseStoreSlug } from './utils/demo-detection';
7
- import { storeService } from './services/store.service';
5
+ import { getStoreConfig } from './store-config.js';
6
+ import { shouldUseAPI, getBaseStoreSlug } from './utils/demo-detection.js';
7
+ import { storeService } from './services/store.service.js';
8
8
  // Note: cartService and wishlistService removed - using localStorage only for cart/wishlist
9
9
  // These services are only needed for shared pages (cart, wishlist, account) which aren't editable in the editor
10
- import { categoryService } from './services/category.service';
11
- import { productService } from './services/product.service';
12
- import { serviceService } from './services/service.service';
13
- import { transformCategoryToStoreCategory, transformProductToStoreProduct, transformServiceToStoreService } from './store-config-utils';
14
- import { useLoading } from './loading-context';
15
- import { normalizePrice } from './utils';
16
- import { assertVariationSelected, buildCartLineProduct, formatVariationLabel, } from './product-variation-utils';
17
- import { useAuth } from './auth-context';
18
- import { analyticsService } from './services/analytics.service';
10
+ import { categoryService } from './services/category.service.js';
11
+ import { productService } from './services/product.service.js';
12
+ import { serviceService } from './services/service.service.js';
13
+ import { transformCategoryToStoreCategory, transformProductToStoreProduct, transformServiceToStoreService } from './store-config-utils.js';
14
+ import { useLoading } from './loading-context.js';
15
+ import { normalizePrice } from './utils/index.js';
16
+ import { assertVariationSelected, buildCartLineProduct, formatVariationLabel, } from './product-variation-utils.js';
17
+ import { useAuth } from './auth-context.js';
18
+ import { analyticsService } from './services/analytics.service.js';
19
19
  export const StoreContext = createContext({
20
20
  store: null,
21
21
  isLoading: true,
@@ -1,5 +1,5 @@
1
- import { richFieldHasContent, richFieldPlainTextForDisplay } from '../rich-html';
2
- import { shouldUseAPI } from './demo-detection';
1
+ import { richFieldHasContent, richFieldPlainTextForDisplay } from '../rich-html.js';
2
+ import { shouldUseAPI } from './demo-detection.js';
3
3
  export { shouldUseAPI };
4
4
  const TEMPLATE_HERO_BADGE_PLACEHOLDERS = new Set(['new collection 2024', 'new collection']);
5
5
  /** Hero badge for clothing-minimal: no template placeholder on live stores. */
@@ -1,6 +1,6 @@
1
- import { filterActiveProducts, filterActiveServices } from './product-catalog';
2
- import { richFieldPlainTextForDisplay } from '../rich-html';
3
- import { normalizeStoreProductsForDisplay, resolveProductImageUrls } from './product-images';
1
+ import { filterActiveProducts, filterActiveServices } from './product-catalog.js';
2
+ import { richFieldPlainTextForDisplay } from '../rich-html.js';
3
+ import { normalizeStoreProductsForDisplay, resolveProductImageUrls } from './product-images.js';
4
4
  /** Prefer the first non-empty catalog list; empty persisted `[]` must not block API data. */
5
5
  export function coalesceCatalog(...sources) {
6
6
  for (const list of sources) {
@@ -136,9 +136,9 @@ export function getUserFriendlyErrorMessage(error, defaultMessage = 'Something w
136
136
  return errorData?.message || error.message || defaultMessage;
137
137
  }
138
138
  }
139
- export { filterActiveProducts, filterActiveServices, filterCategoriesForServices, } from './product-catalog';
140
- export { isEditorPreviewMode, resolveStoreProductsForDisplay, resolveProductBySlugForDisplay, resolvePdpProduct, resolveStoreCategoriesForDisplay, resolveCategoryBySlugForDisplay, resolveStoreServicesForDisplay, resolveServiceBySlugForDisplay, resolveCategoryProductsForDisplay, resolveCategoryServicesForDisplay, resolveMenuItemsForDisplay, productsToMenuItems, coalesceCatalog, applyEditorCatalogOverlay, applyStoreCatalogFromApi, syncFoodMenuItemsFromProducts, } from './editor-preview';
141
- export { resolveProductImageUrls, getPrimaryProductImageUrl, normalizeStoreProductForDisplay, normalizeStoreProductsForDisplay, EDITOR_PRODUCT_IMAGE_PLACEHOLDER, } from './product-images';
139
+ export { filterActiveProducts, filterActiveServices, filterCategoriesForServices, } from './product-catalog.js';
140
+ export { isEditorPreviewMode, resolveStoreProductsForDisplay, resolveProductBySlugForDisplay, resolvePdpProduct, resolveStoreCategoriesForDisplay, resolveCategoryBySlugForDisplay, resolveStoreServicesForDisplay, resolveServiceBySlugForDisplay, resolveCategoryProductsForDisplay, resolveCategoryServicesForDisplay, resolveMenuItemsForDisplay, productsToMenuItems, coalesceCatalog, applyEditorCatalogOverlay, applyStoreCatalogFromApi, syncFoodMenuItemsFromProducts, } from './editor-preview.js';
141
+ export { resolveProductImageUrls, getPrimaryProductImageUrl, normalizeStoreProductForDisplay, normalizeStoreProductsForDisplay, EDITOR_PRODUCT_IMAGE_PLACEHOLDER, } from './product-images.js';
142
142
  /**
143
143
  * Deep clones an object using structuredClone if available, or a fallback recursive clone.
144
144
  * This is more efficient and handles more types than JSON.parse(JSON.stringify).
@@ -1,4 +1,4 @@
1
- import { extractImageUrls } from '../store-config-utils';
1
+ import { extractImageUrls } from '../store-config-utils.js';
2
2
  /** Neutral product placeholder for editor preview when catalog rows have no image yet. */
3
3
  export const EDITOR_PRODUCT_IMAGE_PLACEHOLDER = 'https://images.unsplash.com/photo-1523381210434-271e8be1f52b?q=80&w=800&auto=format&fit=crop';
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { getStoreUrl } from './url-helpers';
1
+ import { getStoreUrl } from './url-helpers.js';
2
2
  /** Keep only the first URL path segment of a product slug (no trailing description text). */
3
3
  export function sanitizeProductSlug(slug) {
4
4
  const trimmed = (slug || '').trim();
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * URL helper utilities for handling both custom domain and platform domain URLs
3
3
  */
4
- import { isPlatformHostname } from '../layout-route-utils';
4
+ import { isPlatformHostname } from '../layout-route-utils.js';
5
5
  /**
6
6
  * Get the store URL prefix based on whether we're on a custom domain
7
7
  * For custom domains: returns empty string (no slug in URL)
@@ -2,11 +2,11 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import React, { useEffect, useState, useCallback, useMemo } from 'react';
4
4
  import { getPreviewDataByLayout } from '../lib/preview-data.js';
5
- import { ToastProvider } from '../components/ui/toast';
6
- import { AlertModalProvider } from '../components/ui/alert-modal';
7
- import { StoreProvider } from '../lib/store-context';
8
- import { LoadingProvider } from '../lib/loading-context';
9
- import { PreviewRouter } from './PreviewRouter';
5
+ import { ToastProvider } from '../components/ui/toast.js';
6
+ import { AlertModalProvider } from '../components/ui/alert-modal.js';
7
+ import { StoreProvider } from '../lib/store-context.js';
8
+ import { LoadingProvider } from '../lib/loading-context.js';
9
+ import { PreviewRouter } from './PreviewRouter.js';
10
10
  /**
11
11
  * LayoutPreview Component
12
12
  *
@@ -4,8 +4,8 @@ import { useMemo, Suspense } from 'react';
4
4
  import { isBookingAgendaStoreRoot } from '../lib/layout-route-utils.js';
5
5
  import { useStore } from '../lib/store-context.js';
6
6
  import dynamic from 'next/dynamic';
7
- import { BaseStoreLayout } from '../layouts/shared/components/BaseStoreLayout';
8
- import { normalizePreviewSegment } from './route-audit';
7
+ import { BaseStoreLayout } from '../layouts/shared/components/BaseStoreLayout.js';
8
+ import { normalizePreviewSegment } from './route-audit.js';
9
9
  const dynamicPage = (importFn) => dynamic(importFn, {
10
10
  loading: () => (_jsx("div", { className: "min-h-screen flex items-center justify-center bg-gray-50/50 backdrop-blur-sm", children: _jsxs("div", { className: "flex flex-col items-center gap-4", children: [_jsx("div", { className: "w-10 h-10 border-4 border-blue-600/20 border-t-blue-600 rounded-full animate-spin" }), _jsx("p", { className: "text-sm font-medium text-gray-500 animate-pulse", children: "Loading experience..." })] }) })),
11
11
  ssr: false,
@@ -1,14 +1,14 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useCallback, useEffect, useRef, useState } from 'react';
4
- import { PreviewBlockToolbar } from './PreviewBlockToolbar';
5
- import { parsePayazaFieldKey } from './field-key';
6
- import { PREVIEW_MSG } from './preview-messages';
7
- import { buildPayazaRichCommitFromEditorHtml, coercePayazaRichLinkHref, sanitizePayazaRichHtml, wrapPlainTextAsParagraph, } from '../../lib/rich-html';
8
- import { extractEditablePlainText, flattenMultilineEditableElement } from './extract-editable-plain-text';
9
- import { shouldDeferEditableFocusOutCommit } from './preview-editable-commit.util';
10
- import { prefersInlineCanvasTextEdit } from '../../lib/utils/mobile-editor';
11
- import { PREVIEW_ACTIVE_EDITABLE_SELECTOR, } from './preview-flush-handle';
4
+ import { PreviewBlockToolbar } from './PreviewBlockToolbar.js';
5
+ import { parsePayazaFieldKey } from './field-key.js';
6
+ import { PREVIEW_MSG } from './preview-messages.js';
7
+ import { buildPayazaRichCommitFromEditorHtml, coercePayazaRichLinkHref, sanitizePayazaRichHtml, wrapPlainTextAsParagraph, } from '../../lib/rich-html.js';
8
+ import { extractEditablePlainText, flattenMultilineEditableElement } from './extract-editable-plain-text.js';
9
+ import { shouldDeferEditableFocusOutCommit } from './preview-editable-commit.util.js';
10
+ import { prefersInlineCanvasTextEdit } from '../../lib/utils/mobile-editor.js';
11
+ import { PREVIEW_ACTIVE_EDITABLE_SELECTOR, } from './preview-flush-handle.js';
12
12
  function schemaSectionKeyFromElement(el) {
13
13
  const root = el?.closest('[data-section]');
14
14
  if (!root)
@@ -1,5 +1,5 @@
1
1
  /** Resolves when preview canvas acknowledges PREVIEW_FLUSH_EDITS (save/publish gate). */
2
- import { PREVIEW_FLUSH_ACK_TIMEOUT_MS } from './preview-flush-handle';
2
+ import { PREVIEW_FLUSH_ACK_TIMEOUT_MS } from './preview-flush-handle.js';
3
3
  let pendingAckResolve = null;
4
4
  export { PREVIEW_FLUSH_ACK_TIMEOUT_MS };
5
5
  export function awaitPreviewFlushAck(timeoutMs = PREVIEW_FLUSH_ACK_TIMEOUT_MS) {
@@ -1,4 +1,4 @@
1
- import { normalizeEditorLayoutId } from '../../editor/document/layout-id';
1
+ import { normalizeEditorLayoutId } from '../../editor/document/layout-id.js';
2
2
  export function previewCommitsMatchEditorContext(commit, editor) {
3
3
  const ca = normalizeEditorLayoutId(commit.layoutId ?? '');
4
4
  const eb = normalizeEditorLayoutId(editor.layoutId ?? '');
@@ -1,5 +1,5 @@
1
- import { getLayoutMetadata } from '../../editor/alignment-schemas/metadata';
2
- import { normalizeEditorLayoutId } from '../../editor/document/layout-id';
1
+ import { getLayoutMetadata } from '../../editor/alignment-schemas/metadata.js';
2
+ import { normalizeEditorLayoutId } from '../../editor/document/layout-id.js';
3
3
  /**
4
4
  * Maps preview router path to overlay page id (`home`, `products`, …).
5
5
  */
@@ -5,8 +5,8 @@
5
5
  * These components demonstrate that layouts are self-sustaining
6
6
  * and can work independently with embedded preview data.
7
7
  */
8
- export { LayoutPreview } from './LayoutPreview';
9
- export { ShadowDOMWrapper } from './ShadowDOMWrapper';
10
- export { PreviewRouter } from './PreviewRouter';
11
- export * from './route-audit';
8
+ export { LayoutPreview } from './LayoutPreview.js';
9
+ export { ShadowDOMWrapper } from './ShadowDOMWrapper.js';
10
+ export { PreviewRouter } from './PreviewRouter.js';
11
+ export * from './route-audit.js';
12
12
  export * from '../lib/preview-data.js';
package/package.json CHANGED
@@ -1,15 +1,12 @@
1
1
  {
2
2
  "name": "storefront-layouts",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "lts": true,
5
5
  "type": "module",
6
6
  "description": "Shared layout components for Storefront applications",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.js",
9
9
  "types": "dist/index.d.ts",
10
- "sideEffects": [
11
- "**/*.css"
12
- ],
13
10
  "exports": {
14
11
  ".": {
15
12
  "types": "./dist/index.d.ts",
@@ -35,6 +32,24 @@
35
32
  "require": "./dist/editor/index.js",
36
33
  "default": "./dist/editor/index.js"
37
34
  },
35
+ "./editor/layout-content-loader": {
36
+ "types": "./dist/editor/layout-content-loader.d.ts",
37
+ "import": "./dist/editor/layout-content-loader.js",
38
+ "require": "./dist/editor/layout-content-loader.js",
39
+ "default": "./dist/editor/layout-content-loader.js"
40
+ },
41
+ "./lib/layout-config-hydration": {
42
+ "types": "./dist/lib/layout-config-hydration.d.ts",
43
+ "import": "./dist/lib/layout-config-hydration.js",
44
+ "require": "./dist/lib/layout-config-hydration.js",
45
+ "default": "./dist/lib/layout-config-hydration.js"
46
+ },
47
+ "./editor/document": {
48
+ "types": "./dist/editor/document/index.d.ts",
49
+ "import": "./dist/editor/document/index.js",
50
+ "require": "./dist/editor/document/index.js",
51
+ "default": "./dist/editor/document/index.js"
52
+ },
38
53
  "./editor/puck": {
39
54
  "types": "./dist/editor/puck/index.d.ts",
40
55
  "import": "./dist/editor/puck/index.js",
@@ -48,24 +63,6 @@
48
63
  "default": "./dist/editor/rjsf/index.js"
49
64
  },
50
65
  "./styles": "./dist/styles/index.css",
51
- "./lib/rich-html": {
52
- "types": "./dist/lib/rich-html.d.ts",
53
- "import": "./dist/lib/rich-html.js",
54
- "require": "./dist/lib/rich-html.js",
55
- "default": "./dist/lib/rich-html.js"
56
- },
57
- "./lib/layout-config-hydration": {
58
- "types": "./dist/lib/layout-config-hydration.d.ts",
59
- "import": "./dist/lib/layout-config-hydration.js",
60
- "require": "./dist/lib/layout-config-hydration.js",
61
- "default": "./dist/lib/layout-config-hydration.js"
62
- },
63
- "./lib/utils": {
64
- "types": "./dist/lib/utils/index.d.ts",
65
- "import": "./dist/lib/utils/index.js",
66
- "require": "./dist/lib/utils/index.js",
67
- "default": "./dist/lib/utils/index.js"
68
- },
69
66
  "./package.json": "./package.json"
70
67
  },
71
68
  "files": [
@@ -73,11 +70,11 @@
73
70
  "README.md"
74
71
  ],
75
72
  "scripts": {
76
- "build": "npm run clean && (tsc --noEmitOnError false || true) && tsc-alias && npm run copy-json && npm run copy-layout-css && npm run build-css",
77
- "build-css": "mkdir -p dist/styles && postcss src/styles/index.css -o dist/styles/index.css",
73
+ "build": "npm run clean && (tsc --noEmitOnError false || true) && tsc-alias && node scripts/add-js-extensions.mjs && npm run copy-json && npm run build-css",
74
+ "build-css": "mkdir -p dist/styles dist/layouts/clothing/styles && postcss src/styles/index.css -o dist/styles/index.css && postcss src/layouts/clothing/styles/clothing.css -o dist/layouts/clothing/styles/clothing.css",
78
75
  "copy-json": "mkdir -p dist/json && cp -r src/json/*.json dist/json/ 2>/dev/null || true",
79
- "copy-layout-css": "mkdir -p dist/layouts/clothing/styles && cp src/layouts/clothing/styles/clothing.css dist/layouts/clothing/styles/clothing.css",
80
- "watch": "npm run clean && npm run copy-json && npm run copy-layout-css && npm run build-css && npm run watch:all",
76
+ "watch": "node scripts/ensure-dist.cjs && npm run copy-json && npm run build-css && npm run watch:all",
77
+ "watch:clean": "npm run clean && npm run build && npm run watch:all",
81
78
  "watch:all": "npm-run-all --parallel watch:ts watch:css watch:json",
82
79
  "watch:ts": "node scripts/watch-ts.cjs",
83
80
  "watch:css": "postcss src/styles/index.css -o dist/styles/index.css --watch",
@@ -85,7 +82,7 @@
85
82
  "prepublishOnly": "npm run build",
86
83
  "prepack": "npm run build",
87
84
  "clean": "rm -rf dist",
88
- "test": "echo \"No tests specified\" && exit 0",
85
+ "test": "vitest run",
89
86
  "prepare": "git config core.hooksPath .githooks 2>/dev/null || true",
90
87
  "version:staging": "npm version prerelease --preid=staging",
91
88
  "release:staging": "node scripts/release-guard.mjs staging",
@@ -99,7 +96,7 @@
99
96
  "@rjsf/validator-ajv8": "^6.1.2",
100
97
  "@tailwindcss/postcss": "^4.0.0",
101
98
  "framer-motion": "^12.0.0",
102
- "next": "^16.0.3",
99
+ "next": "^16.2.2",
103
100
  "postcss": "^8.0.0",
104
101
  "react": "^19.2.0",
105
102
  "react-dom": "^19.2.0",
@@ -158,18 +155,20 @@
158
155
  "@rjsf/validator-ajv8": "^6.1.2",
159
156
  "@tailwindcss/postcss": "^4.0.0",
160
157
  "@types/node": "^20",
158
+ "@types/mixpanel-browser": "^2.60.0",
161
159
  "@types/nprogress": "^0.2.3",
162
160
  "@types/react": "^19",
163
161
  "@types/react-dom": "^19",
164
162
  "@types/styled-jsx": "^2.2.9",
165
163
  "framer-motion": "^12.25.0",
166
- "next": "^16.0.3",
164
+ "next": "^16.2.2",
167
165
  "npm-run-all": "^4.1.5",
168
166
  "postcss": "^8.0.0",
169
167
  "postcss-cli": "^11.0.0",
170
168
  "tailwindcss": "^4.0.0",
171
169
  "tsc-alias": "^1.8.16",
172
- "typescript": "^5"
170
+ "typescript": "^5",
171
+ "vitest": "^3.2.4"
173
172
  },
174
173
  "keywords": [
175
174
  "storefront",
@@ -181,7 +180,7 @@
181
180
  ],
182
181
  "repository": {
183
182
  "type": "git",
184
- "url": "https://github.com/78-Financials/storefront-layouts.git"
183
+ "url": ""
185
184
  },
186
185
  "author": "",
187
186
  "license": "ISC",