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.
- package/dist/components/auth/LoginForm.js +1 -1
- package/dist/components/auth/LoginSheet.js +1 -1
- package/dist/components/auth/login-form-core.js +2 -2
- package/dist/components/auth/login-sheet-registry.js +2 -2
- package/dist/components/auth/login-sheet-themes/booking-agenda.theme.js +1 -1
- package/dist/components/auth/login-sheet-themes/booking.theme.js +1 -1
- package/dist/components/auth/login-sheet-themes/clothing-minimal.theme.js +1 -1
- package/dist/components/auth/login-sheet-themes/clothing.theme.js +1 -1
- package/dist/components/auth/login-sheet-themes/electronics-grid.theme.js +1 -1
- package/dist/components/auth/login-sheet-themes/electronics.theme.js +1 -1
- package/dist/components/auth/login-sheet-themes/food-modern.theme.js +1 -1
- package/dist/components/auth/login-sheet-themes/food.theme.js +1 -1
- package/dist/components/auth/login-sheet-themes/index.js +9 -9
- package/dist/components/auth/login-sheet-themes/motivational-speaker.theme.js +1 -1
- package/dist/components/auth/login-sheets/StoreLoginSheetShell.js +3 -3
- package/dist/components/categories/category-masonry-grid.js +3 -3
- package/dist/components/learning/CertificateViewer.js +1 -1
- package/dist/components/rich-text/CategoryDescription.js +2 -2
- package/dist/components/rich-text/ProductDescription.js +2 -2
- package/dist/components/rich-text/RichTextExcerpt.js +1 -1
- package/dist/components/rich-text/SafeRichHtml.js +1 -1
- package/dist/components/shipping/ProductDeliveryInfoSection.js +2 -2
- package/dist/components/ui/alert-modal.js +1 -1
- package/dist/components/ui/guest-checkout-modal.js +2 -2
- package/dist/components/ui/image-skeleton.js +1 -1
- package/dist/components/ui/image-with-fallback.js +1 -1
- package/dist/components/ui/loading-skeleton-wrapper.js +1 -1
- package/dist/components/ui/modal.js +1 -1
- package/dist/components/ui/page-content-loader.js +1 -1
- package/dist/components/ui/product-card.d.ts.map +1 -1
- package/dist/components/ui/product-card.js +3 -2
- package/dist/components/ui/route-skeleton-loader.js +5 -5
- package/dist/components/ui/sheet.js +1 -1
- package/dist/components/ui/skeletons/index.js +5 -5
- package/dist/components/ui/skeletons/product-grid-skeleton.js +1 -1
- package/dist/editor/alignment-schemas/booking.js +1 -1
- package/dist/editor/alignment-schemas/clothing-minimal.js +1 -1
- package/dist/editor/alignment-schemas/index.js +20 -20
- package/dist/editor/alignment-schemas/lazy-loader.js +1 -1
- package/dist/editor/alignment-schemas/metadata.js +1 -1
- package/dist/editor/alignment-schemas/resolve-canvas-inspector-leaf.js +3 -3
- package/dist/editor/blocks/index.js +3 -3
- package/dist/editor/blocks/migrate-clothing-minimal.js +3 -3
- package/dist/editor/blocks/nav-outline-utils.js +2 -2
- package/dist/editor/blocks/registry.js +1 -1
- package/dist/editor/document/adapter.js +4 -4
- package/dist/editor/document/block-tree.js +1 -1
- package/dist/editor/document/index.js +6 -6
- package/dist/editor/document/validate.js +1 -1
- package/dist/editor/index.js +12 -12
- package/dist/editor/layout-content-loader.js +3 -3
- package/dist/editor/payaza-form/ArrayItemManager.js +2 -2
- package/dist/editor/payaza-form/EditorCanvasPreview.js +4 -4
- package/dist/editor/payaza-form/FieldRenderer.js +17 -17
- package/dist/editor/payaza-form/IframePreviewMessageBridge.js +3 -3
- package/dist/editor/payaza-form/PayazaFormEditor.js +29 -29
- package/dist/editor/payaza-form/PayazaFormEditorFullPage.js +2 -2
- package/dist/editor/payaza-form/SliderArrayEditor.js +2 -2
- package/dist/editor/payaza-form/components/ArrayField.js +1 -1
- package/dist/editor/payaza-form/components/BlockStylesInspector.js +1 -1
- package/dist/editor/payaza-form/components/BlocksField.js +8 -8
- package/dist/editor/payaza-form/components/ButtonField.js +3 -3
- package/dist/editor/payaza-form/components/CanvasGranularInspector.js +11 -11
- package/dist/editor/payaza-form/components/IconField.js +2 -2
- package/dist/editor/payaza-form/components/ImageField.js +1 -1
- package/dist/editor/payaza-form/components/NumberField.js +1 -1
- package/dist/editor/payaza-form/components/RichTextField.js +2 -2
- package/dist/editor/payaza-form/components/SectionSchemaInspector.js +3 -3
- package/dist/editor/payaza-form/components/StarRatingField.js +1 -1
- package/dist/editor/payaza-form/components/TextField.js +1 -1
- package/dist/editor/payaza-form/data-merger.js +6 -6
- package/dist/editor/payaza-form/data-transformer.js +3 -3
- package/dist/editor/payaza-form/engine.js +1 -1
- package/dist/editor/payaza-form/examples/custom-widgets.example.js +1 -1
- package/dist/editor/payaza-form/index.js +8 -8
- package/dist/editor/payaza-form/layout-loader.js +2 -2
- package/dist/editor/payaza-form/preview-message-handler.js +3 -3
- package/dist/editor/payaza-form/schema-bridge.js +3 -3
- package/dist/editor/payaza-form/widget-registry.js +1 -1
- package/dist/editor/shared/BlockOutlineTree.js +1 -1
- package/dist/editor/shared/EditorHeader.js +1 -1
- package/dist/editor/shared/EditorNavigator.js +1 -1
- package/dist/editor/shared/IframePreview.js +6 -6
- package/dist/editor/shared/InlineCanvasPreview.js +7 -7
- package/dist/editor/shared/LayoutRenderer.js +1 -1
- package/dist/editor/shared/ResizableSidebar.js +1 -1
- package/dist/editor/shared/index.js +7 -7
- package/dist/hooks/use-product-reviews.js +1 -1
- package/dist/hooks/usePreviewSlideSync.js +1 -1
- package/dist/index.js +143 -143
- package/dist/layouts/booking/components/BookingHomePage.js +1 -1
- package/dist/layouts/booking/components/BookingMultilineHeading.js +1 -1
- package/dist/layouts/booking/components/BookingTestimonialCard.js +1 -1
- package/dist/layouts/booking/components/booking-footer-defaults.js +2 -2
- package/dist/layouts/booking/index.js +8 -8
- package/dist/layouts/booking/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/booking/pages/AboutPage.js +16 -7
- package/dist/layouts/booking/pages/BookPage.js +1 -1
- package/dist/layouts/booking/pages/CategoriesPage.js +2 -2
- package/dist/layouts/booking/pages/ProductDetailPage.js +3 -3
- package/dist/layouts/booking-agenda/components/BookingHomePageAgenda.js +3 -3
- package/dist/layouts/booking-agenda/index.js +8 -8
- package/dist/layouts/booking-agenda/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/booking-agenda/pages/AboutPage.js +16 -7
- package/dist/layouts/booking-agenda/pages/CategoriesPage.js +1 -1
- package/dist/layouts/booking-agenda/pages/ProductDetailPage.js +3 -3
- package/dist/layouts/clothing/components/ClothingHomePage.d.ts.map +1 -1
- package/dist/layouts/clothing/components/ClothingHomePage.js +13 -12
- package/dist/layouts/clothing/index.js +7 -7
- package/dist/layouts/clothing/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/clothing/pages/AboutPage.js +11 -5
- package/dist/layouts/clothing/pages/CategoriesPage.js +9 -9
- package/dist/layouts/clothing/pages/CategoryPage.js +7 -7
- package/dist/layouts/clothing/pages/ContactPage.js +3 -3
- package/dist/layouts/clothing/pages/ProductDetailPage.js +24 -24
- package/dist/layouts/clothing/pages/ProductsPage.js +17 -17
- package/dist/layouts/clothing/payaza-bindings.js +2 -2
- package/dist/layouts/clothing-minimal/components/ClothingHomePageMinimal.d.ts.map +1 -1
- package/dist/layouts/clothing-minimal/components/ClothingHomePageMinimal.js +11 -10
- package/dist/layouts/clothing-minimal/components/clothing-minimal-block-render.js +7 -7
- package/dist/layouts/clothing-minimal/index.js +7 -7
- package/dist/layouts/clothing-minimal/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/clothing-minimal/pages/AboutPage.js +12 -5
- package/dist/layouts/clothing-minimal/pages/CategoriesPage.js +8 -8
- package/dist/layouts/clothing-minimal/pages/CategoryPage.js +7 -7
- package/dist/layouts/clothing-minimal/pages/ContactPage.js +3 -3
- package/dist/layouts/clothing-minimal/pages/ProductDetailPage.js +24 -24
- package/dist/layouts/clothing-minimal/pages/ProductsPage.js +18 -18
- package/dist/layouts/electronics/components/ElectronicsCategoriesPage.js +3 -3
- package/dist/layouts/electronics/components/ElectronicsGridProductCard.d.ts.map +1 -1
- package/dist/layouts/electronics/components/ElectronicsGridProductCard.js +4 -3
- package/dist/layouts/electronics/components/ElectronicsHomePage.d.ts.map +1 -1
- package/dist/layouts/electronics/components/ElectronicsHomePage.js +5 -4
- package/dist/layouts/electronics/components/ElectronicsPageWrapper.js +2 -2
- package/dist/layouts/electronics/components/ElectronicsProductsPage.js +4 -4
- package/dist/layouts/electronics/components/ElectronicsStoreHeader.js +1 -1
- package/dist/layouts/electronics/index.js +18 -18
- package/dist/layouts/electronics/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/electronics/pages/AboutPage.js +7 -2
- package/dist/layouts/electronics/pages/CategoriesPage.js +1 -1
- package/dist/layouts/electronics/pages/ProductDetailPage.js +3 -3
- package/dist/layouts/electronics/pages/ProductsPage.js +2 -2
- package/dist/layouts/electronics-grid/components/ElectronicsGridProductCard.d.ts.map +1 -1
- package/dist/layouts/electronics-grid/components/ElectronicsGridProductCard.js +4 -3
- package/dist/layouts/electronics-grid/components/ElectronicsHomePageGrid.js +2 -2
- package/dist/layouts/electronics-grid/index.js +14 -14
- package/dist/layouts/electronics-grid/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/electronics-grid/pages/AboutPage.js +7 -2
- package/dist/layouts/electronics-grid/pages/CategoriesPage.js +1 -1
- package/dist/layouts/electronics-grid/pages/ProductDetailPage.js +3 -3
- package/dist/layouts/electronics-grid/pages/ProductsPage.js +2 -2
- package/dist/layouts/food/components/FoodHomePage.js +1 -1
- package/dist/layouts/food/index.js +8 -8
- package/dist/layouts/food/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/food/pages/AboutPage.js +5 -1
- package/dist/layouts/food/pages/CategoriesPage.js +2 -2
- package/dist/layouts/food/pages/CategoryPage.js +2 -2
- package/dist/layouts/food/pages/ProductDetailPage.js +4 -4
- package/dist/layouts/food/pages/ProductsPage.js +2 -2
- package/dist/layouts/food-modern/components/FoodHomePageModern.js +3 -3
- package/dist/layouts/food-modern/index.js +8 -8
- package/dist/layouts/food-modern/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/food-modern/pages/AboutPage.js +10 -3
- package/dist/layouts/food-modern/pages/CategoriesPage.js +1 -1
- package/dist/layouts/food-modern/pages/CategoryPage.js +2 -2
- package/dist/layouts/food-modern/pages/ProductDetailPage.js +3 -3
- package/dist/layouts/food-modern/pages/ProductsPage.js +2 -2
- package/dist/layouts/motivational-speaker/components/MotivationalSpeakerPageWrapper.js +1 -1
- package/dist/layouts/motivational-speaker/index.js +9 -9
- package/dist/layouts/motivational-speaker/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/motivational-speaker/pages/AboutPage.js +9 -2
- package/dist/layouts/motivational-speaker/pages/ProductsPage.js +2 -2
- package/dist/layouts/shared/about-story-media.d.ts +27 -0
- package/dist/layouts/shared/about-story-media.d.ts.map +1 -0
- package/dist/layouts/shared/about-story-media.js +46 -0
- package/dist/layouts/shared/components/BaseStoreLayout.js +9 -9
- package/dist/layouts/shared/components/GenericPageWrapper.js +3 -3
- package/dist/layouts/shared/components/PdpVariationSelectors.js +2 -2
- package/dist/layouts/shared/components/PromoBanner.js +4 -4
- package/dist/layouts/shared/components/StoreCartSheet.js +9 -9
- package/dist/layouts/shared/components/StoreFooter.js +9 -9
- package/dist/layouts/shared/components/StoreHeader.js +8 -8
- package/dist/layouts/shared/components/headers/BookingAgendaSidebar.js +2 -2
- package/dist/layouts/shared/components/headers/ClothingMinimalHeader.js +9 -9
- package/dist/layouts/shared/components/headers/FoodModernHeader.js +7 -7
- package/dist/layouts/shared/index.js +22 -22
- package/dist/layouts/shared/pages/StoreMaintenanceScreen.js +2 -2
- package/dist/layouts/shared/wrappers/BookingAgendaLayout.js +16 -16
- package/dist/layouts/shared/wrappers/ClothingLayout.js +8 -8
- package/dist/layouts/shared/wrappers/ClothingMinimalLayout.js +7 -7
- package/dist/layouts/shared/wrappers/ElectronicsLayout.js +5 -5
- package/dist/layouts/shared/wrappers/FoodModernLayout.js +6 -6
- package/dist/layouts/shared/wrappers/MotivationalLayout.js +9 -9
- package/dist/layouts/shared/wrappers/StandardLayout.js +8 -8
- package/dist/lib/auth-context.js +2 -2
- package/dist/lib/layout-config-hydration.js +2 -2
- package/dist/lib/product-variation-utils.js +1 -1
- package/dist/lib/services/analytics.service.js +1 -1
- package/dist/lib/services/auth.service.js +1 -1
- package/dist/lib/services/booking.service.js +1 -1
- package/dist/lib/services/category.service.js +1 -1
- package/dist/lib/services/checkout.service.js +1 -1
- package/dist/lib/services/contact.service.js +1 -1
- package/dist/lib/services/customer.service.js +1 -1
- package/dist/lib/services/fees.service.js +1 -1
- package/dist/lib/services/index.js +13 -13
- package/dist/lib/services/location.service.js +1 -1
- package/dist/lib/services/order.service.js +1 -1
- package/dist/lib/services/payment.service.js +1 -1
- package/dist/lib/services/product.service.js +1 -1
- package/dist/lib/services/promo.service.js +1 -1
- package/dist/lib/services/review.service.js +1 -1
- package/dist/lib/services/service.service.js +1 -1
- package/dist/lib/services/shipping.service.js +1 -1
- package/dist/lib/services/store.service.js +1 -1
- package/dist/lib/store-config-utils.js +7 -7
- package/dist/lib/store-config.js +1 -1
- package/dist/lib/store-context.js +12 -12
- package/dist/lib/utils/asset-helpers.js +2 -2
- package/dist/lib/utils/editor-preview.js +3 -3
- package/dist/lib/utils/index.js +3 -3
- package/dist/lib/utils/product-images.js +1 -1
- package/dist/lib/utils/product-share.js +1 -1
- package/dist/lib/utils/url-helpers.js +1 -1
- package/dist/preview/LayoutPreview.js +5 -5
- package/dist/preview/PreviewRouter.js +2 -2
- package/dist/preview/canvas/PreviewCanvasEnhancer.js +8 -8
- package/dist/preview/canvas/preview-flush-await.js +1 -1
- package/dist/preview/canvas/preview-isolation.js +1 -1
- package/dist/preview/canvas/preview-route.js +2 -2
- package/dist/preview/index.js +4 -4
- 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();
|
package/dist/lib/auth-context.js
CHANGED
|
@@ -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) {
|
|
@@ -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,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) {
|
package/dist/lib/store-config.js
CHANGED
|
@@ -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) {
|
package/dist/lib/utils/index.js
CHANGED
|
@@ -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
|
*/
|
package/dist/preview/index.js
CHANGED
|
@@ -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.
|
|
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 &&
|
|
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
|
-
"
|
|
80
|
-
"watch": "npm run clean && npm run
|
|
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": "
|
|
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.
|
|
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.
|
|
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": "
|
|
183
|
+
"url": ""
|
|
185
184
|
},
|
|
186
185
|
"author": "",
|
|
187
186
|
"license": "ISC",
|