@snowcone-app/ui 0.11.17 → 0.12.0

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.d.cts CHANGED
@@ -4733,64 +4733,6 @@ declare const searchClient: _meilisearch_instant_meilisearch.InstantMeiliSearchI
4733
4733
 
4734
4734
  declare const FACET_SECTIONS: FacetSection[];
4735
4735
 
4736
- /**
4737
- * Image interface for zoom components
4738
- */
4739
- interface ZoomImage {
4740
- src: string;
4741
- alt?: string;
4742
- naturalWidth?: number;
4743
- naturalHeight?: number;
4744
- isRealMockup?: boolean;
4745
- placement?: string;
4746
- mockupId?: string;
4747
- /** `whole`: open the picture whole (contain), not cropped to the screen: the gallery's size picture (a diagram). */
4748
- fit?: "cover" | "whole";
4749
- }
4750
-
4751
- interface ResponsiveZoomProps {
4752
- imageIndex: number;
4753
- children: React__default.ReactNode;
4754
- className?: string;
4755
- style?: React__default.CSSProperties;
4756
- images?: ZoomImage[];
4757
- imageUrl?: string;
4758
- alt?: string;
4759
- }
4760
- /**
4761
- * ResponsiveZoom - Adaptive zoom component that provides the best experience for each device type
4762
- *
4763
- * - Desktop (non-touch): Inline 2x zoom with custom cursor (ZoomOverlay)
4764
- * - Touch devices (phones & tablets): Full-screen pinch-to-zoom viewer (EnhancedImageViewer)
4765
- *
4766
- * @example
4767
- * <ResponsiveZoom imageIndex={0}>
4768
- * <ProductImage className="w-full" />
4769
- * </ResponsiveZoom>
4770
- */
4771
- declare function ResponsiveZoom({ imageIndex, children, className, style, images, imageUrl, alt, }: ResponsiveZoomProps): react_jsx_runtime.JSX.Element;
4772
-
4773
- interface ZoomOverlayProps {
4774
- imageIndex: number;
4775
- isLargeTouchDevice: boolean;
4776
- isTouchDevice: boolean;
4777
- onEnhancedViewer?: (index: number) => void;
4778
- children: React__default.ReactNode;
4779
- className?: string;
4780
- style?: React__default.CSSProperties;
4781
- }
4782
- declare function ZoomOverlay({ imageIndex, isLargeTouchDevice, isTouchDevice, onEnhancedViewer, children, className, style, }: ZoomOverlayProps): react_jsx_runtime.JSX.Element;
4783
-
4784
- interface EnhancedImageViewerProps {
4785
- imageUrl: string;
4786
- alt: string;
4787
- onClose: () => void;
4788
- images: ZoomImage[];
4789
- onIndexChange?: (index: number) => void;
4790
- currentIndex?: number;
4791
- }
4792
- declare const EnhancedImageViewer: ({ imageUrl, alt, onClose, images, onIndexChange, currentIndex: propCurrentIndex, }: EnhancedImageViewerProps) => React__default.ReactPortal;
4793
-
4794
4736
  /**
4795
4737
  * Carousel Types
4796
4738
  *
@@ -4886,6 +4828,71 @@ interface CarouselImage {
4886
4828
  */
4887
4829
  type HeroImage = CarouselImage;
4888
4830
 
4831
+ /**
4832
+ * Image interface for zoom components
4833
+ */
4834
+ interface ZoomImage {
4835
+ src: string;
4836
+ alt?: string;
4837
+ naturalWidth?: number;
4838
+ naturalHeight?: number;
4839
+ isRealMockup?: boolean;
4840
+ placement?: string;
4841
+ mockupId?: string;
4842
+ /** `whole`: open the picture whole (contain), not cropped to the screen: the gallery's size picture (a diagram). */
4843
+ fit?: "cover" | "whole";
4844
+ /**
4845
+ * Where the product and the mockup's phone window are in this (16:9) picture, as the phone carousel's slide carries
4846
+ * them (carousels/firstView.ts). The viewer opens on them by the hero's first-view rule, so the product is on screen.
4847
+ * Absent = the picture's middle (as before).
4848
+ */
4849
+ productBox?: CarouselImage["productBox"];
4850
+ phoneWindow?: CarouselImage["phoneWindow"];
4851
+ }
4852
+
4853
+ interface ResponsiveZoomProps {
4854
+ imageIndex: number;
4855
+ children: React__default.ReactNode;
4856
+ className?: string;
4857
+ style?: React__default.CSSProperties;
4858
+ images?: ZoomImage[];
4859
+ imageUrl?: string;
4860
+ alt?: string;
4861
+ }
4862
+ /**
4863
+ * ResponsiveZoom - Adaptive zoom component that provides the best experience for each device type
4864
+ *
4865
+ * - Desktop (non-touch): Inline 2x zoom with custom cursor (ZoomOverlay)
4866
+ * - Touch devices (phones & tablets): Full-screen pinch-to-zoom viewer (EnhancedImageViewer)
4867
+ *
4868
+ * @example
4869
+ * <ResponsiveZoom imageIndex={0}>
4870
+ * <ProductImage className="w-full" />
4871
+ * </ResponsiveZoom>
4872
+ */
4873
+ declare function ResponsiveZoom({ imageIndex, children, className, style, images, imageUrl, alt, }: ResponsiveZoomProps): react_jsx_runtime.JSX.Element;
4874
+
4875
+ interface ZoomOverlayProps {
4876
+ imageIndex: number;
4877
+ isLargeTouchDevice: boolean;
4878
+ isTouchDevice: boolean;
4879
+ onEnhancedViewer?: (index: number) => void;
4880
+ children: React__default.ReactNode;
4881
+ className?: string;
4882
+ style?: React__default.CSSProperties;
4883
+ }
4884
+ declare function ZoomOverlay({ imageIndex, isLargeTouchDevice, isTouchDevice, onEnhancedViewer, children, className, style, }: ZoomOverlayProps): react_jsx_runtime.JSX.Element;
4885
+
4886
+ interface EnhancedImageViewerProps {
4887
+ imageUrl: string;
4888
+ alt: string;
4889
+ onClose: () => void;
4890
+ images: ZoomImage[];
4891
+ onIndexChange?: (index: number) => void;
4892
+ currentIndex?: number;
4893
+ }
4894
+ declare const EnhancedImageViewer: ({ imageUrl, alt, onClose, images, onIndexChange, currentIndex: propCurrentIndex, }: EnhancedImageViewerProps) => React__default.ReactPortal;
4895
+
4889
4896
  /**
4890
4897
  * What a phone carousel slide says about its picture, for a host that shows only PART of the picture.
4891
4898
  *
@@ -4916,6 +4923,64 @@ interface SlideFirstViewProps {
4916
4923
  [SLIDE_PHONE_WINDOW_ATTR]?: string;
4917
4924
  style?: CSSProperties;
4918
4925
  }
4926
+ /** The phone hero's default picture is 16:9 (a plate's `frames['16:9']` window; rendercenter shared/shapes.ts). */
4927
+ declare const FIRST_VIEW_PICTURE_ASPECT: number;
4928
+ /** The share of the view's width kept clear on each side of the product (the frame gate's product-on-a-surface margin). */
4929
+ declare const FIRST_VIEW_MARGIN = 0.03;
4930
+ /** The product's box in a mockup's default 16:9 picture, as fractions of that picture (`mockups[].productBox`). */
4931
+ type FirstViewProductBox = NonNullable<CarouselImage["productBox"]>;
4932
+ /** The mockup's own phone window (its 2:3 frame) along the default picture's width (`mockups[].phoneWindow`). */
4933
+ type FirstViewPhoneWindow = NonNullable<CarouselImage["phoneWindow"]>;
4934
+ /** What a first view is centred on, and the product it then holds. */
4935
+ type FirstViewAnchor =
4936
+ /** The mockup's own phone window (a plate). `product` null: its record has no product box, so nothing is held or judged. */
4937
+ {
4938
+ by: "phone-window";
4939
+ window: FirstViewPhoneWindow;
4940
+ product: FirstViewProductBox | null;
4941
+ }
4942
+ /** A product box but no phone window. */
4943
+ | {
4944
+ by: "product";
4945
+ product: FirstViewProductBox;
4946
+ }
4947
+ /** Neither (a mockup from before plates): its phone window is the centred one its 2:3 gate judged. */
4948
+ | {
4949
+ by: "picture-middle";
4950
+ why: "no-phone-window-no-product-box";
4951
+ };
4952
+ interface FirstView {
4953
+ /** The slice of the picture's width the box shows, as fractions of the picture (0 = its left edge, 1 = its right). */
4954
+ x0: number;
4955
+ x1: number;
4956
+ /** The picture's drawn width and its left edge relative to the box's left edge, px (left <= 0). */
4957
+ pictureWidth: number;
4958
+ left: number;
4959
+ /** `held`: the whole product is in view. `cut`: part of it is outside. `unjudged`: no product box to judge by. */
4960
+ product: "held" | "cut" | "unjudged";
4961
+ /** The share of the product's width that is in view (1 = all of it); null when unjudged. */
4962
+ inView: number | null;
4963
+ /** The part of the product in view as a share of the view's width; null when unjudged. */
4964
+ share: number | null;
4965
+ }
4966
+ /** The anchor of a slide's (already parsed) fields: its phone window, else its product, else the picture's middle. */
4967
+ declare function firstViewAnchorOfSlide(image: Pick<CarouselImage, "productBox" | "phoneWindow">): FirstViewAnchor;
4968
+ /**
4969
+ * THE first-view rule (one copy: the www phone hero's CSS, heroFirstView.ts, and the tap-to-enlarge viewer,
4970
+ * EnhancedImageViewer, both draw by it). What a box of `width` x `height` CSS px shows of a picture drawn
4971
+ * `object-fit: cover`: the picture is the box's height (or its width, when the box is wider than the picture), centred
4972
+ * on the anchor, slid as little as it must to hold the whole product with FIRST_VIEW_MARGIN of the view clear on each
4973
+ * side (a product too wide for that is centred in the view, reported `cut`), and never past its own edges.
4974
+ */
4975
+ declare function firstView(box: {
4976
+ width: number;
4977
+ height: number;
4978
+ }, anchor: FirstViewAnchor, pictureAspect?: number): FirstView;
4979
+ /**
4980
+ * The fields a phone carousel slide hands the tap-to-enlarge viewer: a real mockup's product box and phone window (the
4981
+ * same pictures the slide stamps, `image.isRealMockup ? image : {}`), nothing for any other picture.
4982
+ */
4983
+ declare function slideFirstViewFields(image: Pick<CarouselImage, "isRealMockup" | "productBox" | "phoneWindow">): Pick<CarouselImage, "productBox" | "phoneWindow">;
4919
4984
  /** The attributes and CSS variables for one slide; `{}` when the picture has neither a phone window nor a product box. */
4920
4985
  declare function slideFirstViewProps(image: Pick<CarouselImage, "productBox" | "phoneWindow">): SlideFirstViewProps;
4921
4986
 
@@ -5880,4 +5945,4 @@ declare function normalizeHex(color: string): string;
5880
5945
  */
5881
5946
  declare function scrollInputAboveKeyboard(input: HTMLElement): void;
5882
5947
 
5883
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AddToCart, type AddToCartProps, type AddToCartStatus, ArtAlignment, type ArtAlignmentProps, ArtSelector, type ArtSelectorProps, type Artwork, ArtworkCustomizer, type ArtworkCustomizerProps, Badge, type BadgeProps, BrandLogo, type BrandLogoProps, BrandName, type BrandNameProps, Button, type ButtonProps, CanvasEditor, type CanvasExportServiceConfig, CanvasIsolationBoundary, CanvasIsolationConfigurator, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CarouselImage, type CarouselRenderProps, Checkbox, Chip, type ClipShape, Collapsible, CollapsibleContent, CollapsibleRoot, CollapsibleTrigger, ColorPalette, ColorPicker, type ColorPickerProps, ColorRow, ColorSwatch, type ColorSwatchChoice, type ColorSwatchProps, ColorTokenSwatch, type ContentRenderProps, CurrentRefinements, CurrentSelectionDisplay, type CurrentSelectionDisplayProps, DEFAULT_HERO_ZOOM_CONFIG, DEFAULT_IMAGE_CONFIG, DEFAULT_VISIBILITY_OPTIONS, DesignSystemPage, type DeviceDetectionResult, Disclosure, DisclosureContent, DisclosureTrigger, DragHintAnimation, type DragHintAnimationProps, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EdgeBlurBox, type EdgeBlurBoxProps, EdgeSwipeGuards, type EdgeSwipeGuardsProps, EnhancedImageViewer, FACET_SECTIONS, type FacetSection, type FacetType, Fieldset, type FieldsetProps, Filters, FiltersButton, type FiltersButtonProps, FiltersDrawer, type FiltersProps, FloatingActionGroup, type FloatingActionGroupProps, type FloatingActionItem, type FormatCurrencyOptions, HeroCarousel, type HeroCarouselProps, type HeroImage, type HeroImageRenderProps, HeroProductImage, type HeroProductImageProps, type HeroShrinkConfig, HeroShrinkLayout, type HeroShrinkLayoutProps, type HeroZoomConfig, HeroZoomLayout, type HeroZoomLayoutProps, type HeroZoomScales, HorizontalProgressiveBlur, type HorizontalProgressiveBlurProps, Drawer as IOSDrawer, DrawerClose as IOSDrawerClose, DrawerContent as IOSDrawerContent, DrawerDescription as IOSDrawerDescription, DrawerFooter as IOSDrawerFooter, DrawerHeader as IOSDrawerHeader, DrawerTitle as IOSDrawerTitle, DrawerTrigger as IOSDrawerTrigger, ImageBlurExtension, type ImageBlurExtensionProps, ImageEdgeBlur, type ImageEdgeBlurProps, type ImageLayer, type ImageUpdateRequest, Input, type InputProps, Kbd, type KbdProps, Label, Legend, type LegendProps, Lightbox, type LightboxProps, Link, LinkIcon, type LinkProps, LoadingOverlayPrism, LoadingOverlayPrismCandy, LoadingOverlayPrismCandyInline, type LoadingOverlayPrismCandyProps, type LoadingOverlayPrismProps, MasonryGrid, type MasonryGridProps, MobileProductCarousel, type MobileProductCarouselProps, MockupBackground, type MockupBackgroundProps, type MockupPriorityContextValue, MockupPriorityProvider, type MockupPriorityProviderProps, type MockupResult, PDPLayout, type PDPLayoutProps, PersonalizationField, PersonalizationInputs, PersonalizationProvider, PersonalizationValues, PlacementArt, type PlacementArtMap, type PlacementArtProps, PlacementClipShapeSelector, type PlacementConfig, type PlacementDesign, PlacementTabs, type PlacementTabsProps, Popover, PopoverAnchor, PopoverContent, PopoverRoot, PopoverTrigger, type PriorityLevel, Product, ProductCard, type ProductCardProps, ProductContext, type ProductDataMode, ProductGallery, type ProductGalleryProps, ProductGrid, type ProductGridProps, type ProductHit, ProductHitComponent, ProductImage, type Artwork$1 as ProductImageArtwork, type ProductImageProps, ProductList, type ProductListProps, ProductOptions, type ProductPageContext, ProductPageProvider, ProductPageProviderMinimal, type ProductPageProviderMinimalProps, type ProductPageProviderProps, ProductPrice, type ProductPriceProps, type ProductProviderProps, ProgressiveBlur, type ProgressiveBlurProps, type ProviderStatus, Radio, RadioGroup, RadioGroupItem, RadiusScale, type ReactProductContext, type RealtimeContextValue, RealtimeMockup, type RealtimeMockupProps, RealtimeProvider, type RealtimeProviderProps, type RealtimeState, type RegularArtwork$1 as RegularArtwork, type ResponsiveColumns, type ResponsiveImageCapInfo, type ResponsiveImageCapOptions, ResponsiveZoom, RightToLeftProgressiveBlur, type RightToLeftProgressiveBlurProps, SLIDE_FIRST_VIEW_ATTR, SLIDE_FIRST_VIEW_X_VAR, SLIDE_PHONE_WINDOW_ATTR, SLIDE_PRODUCT_BOX_ATTR, SLIDE_PRODUCT_X0_VAR, SLIDE_PRODUCT_X1_VAR, SafeImg, type SafeImgProps, type ScrollDirection, ScrollFade, type ScrollFadeProps, type ScrollState, type SeamlessPattern$1 as SeamlessPattern, SearchBox, SearchProvider, type SearchProviderProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Shop, ShopContext, type ShopContextValue, type ShopProps, SimpleImageBlur, type SimpleImageBlurProps, type SlideFirstViewProps, Slider, SliderFill, SliderOutput, SliderThumb, SliderTrack, Spinner, type SpinnerProps, Surface, SurfaceContext, type SurfaceProps, Switch, Tabs, TabsContent, TabsList, TabsRoot, TabsTrigger, TextArea, TextField, type TextFieldProps, Textarea, type TextareaProps, ThemeSwitcher, ThemeToggle, type ThemeToggleProps, TileCount, Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger, TypographyScale, type UiRouter, UiRouterProvider, type UseBrandResult, type UseImagePreloaderOptions, type UseImagePreloaderReturn, type UseImageTransitionOptions, type UseImageTransitionReturn, type UsePersonalizationShimmerReturn, type UseProductGalleryOptions, type UseProductGalleryReturn, VISIBILITY_THRESHOLDS, type ViewportDimensions, type ZoomImage, ZoomOverlay, badgeVariants, blockingSessionError, brandAssets, buttonVariants, canvasExportService, checkComponentStyles, checkTailwindConfig, checkThemeTokens, createScrollDirectionTracker, formatCurrency, formatDate, formatDateTime, getBrand, getObservedElementCount, getObserverCount, hasEdgeBlur, isObserved, isWideMonitor, kbdVariants, linkVariants, linkedPlacementsLabel, normalizeHex, observe, pictureRenderState, placementArtFor, runConfigChecks, scrollInputAboveKeyboard, searchClient, slideFirstViewProps, spinnerVariants, surfaceVariants, useArtworkAlignment, useBrand, useCanvasContext, useCanvasContextStatic, useCurrentPlacements, useDesign, useDesignOptional, useDeviceDetection, useFocusTrap, useHeroZoomScales, useImagePreloader, useImageTransition, useIsolatedCanvas, useLoadingOverlay, useMediaQuery, useMockupBackgroundOptional, useMockupPriority, useMockupPriorityOptional, usePersonalization, usePersonalizationOptional, usePersonalizationShimmer, usePlacementArtOptional, usePlacementClipShape, usePlacementsProcessor, useProduct, useProductGallery, useProductOptional, useProductPage, useProductPageOptional, useProductSelection, useProviderStatus, useRealtime, useRealtimeOptional, useRenderCount, useRenderGuard, useResponsiveImageCap, useScrollDirection, useSelectedArtwork, useSetArtworkAlignment, useShop, useShopOptional, useSurface, useViewportDimensions, useWideMonitorMode };
5948
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AddToCart, type AddToCartProps, type AddToCartStatus, ArtAlignment, type ArtAlignmentProps, ArtSelector, type ArtSelectorProps, type Artwork, ArtworkCustomizer, type ArtworkCustomizerProps, Badge, type BadgeProps, BrandLogo, type BrandLogoProps, BrandName, type BrandNameProps, Button, type ButtonProps, CanvasEditor, type CanvasExportServiceConfig, CanvasIsolationBoundary, CanvasIsolationConfigurator, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CarouselImage, type CarouselRenderProps, Checkbox, Chip, type ClipShape, Collapsible, CollapsibleContent, CollapsibleRoot, CollapsibleTrigger, ColorPalette, ColorPicker, type ColorPickerProps, ColorRow, ColorSwatch, type ColorSwatchChoice, type ColorSwatchProps, ColorTokenSwatch, type ContentRenderProps, CurrentRefinements, CurrentSelectionDisplay, type CurrentSelectionDisplayProps, DEFAULT_HERO_ZOOM_CONFIG, DEFAULT_IMAGE_CONFIG, DEFAULT_VISIBILITY_OPTIONS, DesignSystemPage, type DeviceDetectionResult, Disclosure, DisclosureContent, DisclosureTrigger, DragHintAnimation, type DragHintAnimationProps, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EdgeBlurBox, type EdgeBlurBoxProps, EdgeSwipeGuards, type EdgeSwipeGuardsProps, EnhancedImageViewer, FACET_SECTIONS, FIRST_VIEW_MARGIN, FIRST_VIEW_PICTURE_ASPECT, type FacetSection, type FacetType, Fieldset, type FieldsetProps, Filters, FiltersButton, type FiltersButtonProps, FiltersDrawer, type FiltersProps, type FirstView, type FirstViewAnchor, type FirstViewPhoneWindow, type FirstViewProductBox, FloatingActionGroup, type FloatingActionGroupProps, type FloatingActionItem, type FormatCurrencyOptions, HeroCarousel, type HeroCarouselProps, type HeroImage, type HeroImageRenderProps, HeroProductImage, type HeroProductImageProps, type HeroShrinkConfig, HeroShrinkLayout, type HeroShrinkLayoutProps, type HeroZoomConfig, HeroZoomLayout, type HeroZoomLayoutProps, type HeroZoomScales, HorizontalProgressiveBlur, type HorizontalProgressiveBlurProps, Drawer as IOSDrawer, DrawerClose as IOSDrawerClose, DrawerContent as IOSDrawerContent, DrawerDescription as IOSDrawerDescription, DrawerFooter as IOSDrawerFooter, DrawerHeader as IOSDrawerHeader, DrawerTitle as IOSDrawerTitle, DrawerTrigger as IOSDrawerTrigger, ImageBlurExtension, type ImageBlurExtensionProps, ImageEdgeBlur, type ImageEdgeBlurProps, type ImageLayer, type ImageUpdateRequest, Input, type InputProps, Kbd, type KbdProps, Label, Legend, type LegendProps, Lightbox, type LightboxProps, Link, LinkIcon, type LinkProps, LoadingOverlayPrism, LoadingOverlayPrismCandy, LoadingOverlayPrismCandyInline, type LoadingOverlayPrismCandyProps, type LoadingOverlayPrismProps, MasonryGrid, type MasonryGridProps, MobileProductCarousel, type MobileProductCarouselProps, MockupBackground, type MockupBackgroundProps, type MockupPriorityContextValue, MockupPriorityProvider, type MockupPriorityProviderProps, type MockupResult, PDPLayout, type PDPLayoutProps, PersonalizationField, PersonalizationInputs, PersonalizationProvider, PersonalizationValues, PlacementArt, type PlacementArtMap, type PlacementArtProps, PlacementClipShapeSelector, type PlacementConfig, type PlacementDesign, PlacementTabs, type PlacementTabsProps, Popover, PopoverAnchor, PopoverContent, PopoverRoot, PopoverTrigger, type PriorityLevel, Product, ProductCard, type ProductCardProps, ProductContext, type ProductDataMode, ProductGallery, type ProductGalleryProps, ProductGrid, type ProductGridProps, type ProductHit, ProductHitComponent, ProductImage, type Artwork$1 as ProductImageArtwork, type ProductImageProps, ProductList, type ProductListProps, ProductOptions, type ProductPageContext, ProductPageProvider, ProductPageProviderMinimal, type ProductPageProviderMinimalProps, type ProductPageProviderProps, ProductPrice, type ProductPriceProps, type ProductProviderProps, ProgressiveBlur, type ProgressiveBlurProps, type ProviderStatus, Radio, RadioGroup, RadioGroupItem, RadiusScale, type ReactProductContext, type RealtimeContextValue, RealtimeMockup, type RealtimeMockupProps, RealtimeProvider, type RealtimeProviderProps, type RealtimeState, type RegularArtwork$1 as RegularArtwork, type ResponsiveColumns, type ResponsiveImageCapInfo, type ResponsiveImageCapOptions, ResponsiveZoom, RightToLeftProgressiveBlur, type RightToLeftProgressiveBlurProps, SLIDE_FIRST_VIEW_ATTR, SLIDE_FIRST_VIEW_X_VAR, SLIDE_PHONE_WINDOW_ATTR, SLIDE_PRODUCT_BOX_ATTR, SLIDE_PRODUCT_X0_VAR, SLIDE_PRODUCT_X1_VAR, SafeImg, type SafeImgProps, type ScrollDirection, ScrollFade, type ScrollFadeProps, type ScrollState, type SeamlessPattern$1 as SeamlessPattern, SearchBox, SearchProvider, type SearchProviderProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Shop, ShopContext, type ShopContextValue, type ShopProps, SimpleImageBlur, type SimpleImageBlurProps, type SlideFirstViewProps, Slider, SliderFill, SliderOutput, SliderThumb, SliderTrack, Spinner, type SpinnerProps, Surface, SurfaceContext, type SurfaceProps, Switch, Tabs, TabsContent, TabsList, TabsRoot, TabsTrigger, TextArea, TextField, type TextFieldProps, Textarea, type TextareaProps, ThemeSwitcher, ThemeToggle, type ThemeToggleProps, TileCount, Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger, TypographyScale, type UiRouter, UiRouterProvider, type UseBrandResult, type UseImagePreloaderOptions, type UseImagePreloaderReturn, type UseImageTransitionOptions, type UseImageTransitionReturn, type UsePersonalizationShimmerReturn, type UseProductGalleryOptions, type UseProductGalleryReturn, VISIBILITY_THRESHOLDS, type ViewportDimensions, type ZoomImage, ZoomOverlay, badgeVariants, blockingSessionError, brandAssets, buttonVariants, canvasExportService, checkComponentStyles, checkTailwindConfig, checkThemeTokens, createScrollDirectionTracker, firstView, firstViewAnchorOfSlide, formatCurrency, formatDate, formatDateTime, getBrand, getObservedElementCount, getObserverCount, hasEdgeBlur, isObserved, isWideMonitor, kbdVariants, linkVariants, linkedPlacementsLabel, normalizeHex, observe, pictureRenderState, placementArtFor, runConfigChecks, scrollInputAboveKeyboard, searchClient, slideFirstViewFields, slideFirstViewProps, spinnerVariants, surfaceVariants, useArtworkAlignment, useBrand, useCanvasContext, useCanvasContextStatic, useCurrentPlacements, useDesign, useDesignOptional, useDeviceDetection, useFocusTrap, useHeroZoomScales, useImagePreloader, useImageTransition, useIsolatedCanvas, useLoadingOverlay, useMediaQuery, useMockupBackgroundOptional, useMockupPriority, useMockupPriorityOptional, usePersonalization, usePersonalizationOptional, usePersonalizationShimmer, usePlacementArtOptional, usePlacementClipShape, usePlacementsProcessor, useProduct, useProductGallery, useProductOptional, useProductPage, useProductPageOptional, useProductSelection, useProviderStatus, useRealtime, useRealtimeOptional, useRenderCount, useRenderGuard, useResponsiveImageCap, useScrollDirection, useSelectedArtwork, useSetArtworkAlignment, useShop, useShopOptional, useSurface, useViewportDimensions, useWideMonitorMode };
package/dist/index.d.ts CHANGED
@@ -4733,64 +4733,6 @@ declare const searchClient: _meilisearch_instant_meilisearch.InstantMeiliSearchI
4733
4733
 
4734
4734
  declare const FACET_SECTIONS: FacetSection[];
4735
4735
 
4736
- /**
4737
- * Image interface for zoom components
4738
- */
4739
- interface ZoomImage {
4740
- src: string;
4741
- alt?: string;
4742
- naturalWidth?: number;
4743
- naturalHeight?: number;
4744
- isRealMockup?: boolean;
4745
- placement?: string;
4746
- mockupId?: string;
4747
- /** `whole`: open the picture whole (contain), not cropped to the screen: the gallery's size picture (a diagram). */
4748
- fit?: "cover" | "whole";
4749
- }
4750
-
4751
- interface ResponsiveZoomProps {
4752
- imageIndex: number;
4753
- children: React__default.ReactNode;
4754
- className?: string;
4755
- style?: React__default.CSSProperties;
4756
- images?: ZoomImage[];
4757
- imageUrl?: string;
4758
- alt?: string;
4759
- }
4760
- /**
4761
- * ResponsiveZoom - Adaptive zoom component that provides the best experience for each device type
4762
- *
4763
- * - Desktop (non-touch): Inline 2x zoom with custom cursor (ZoomOverlay)
4764
- * - Touch devices (phones & tablets): Full-screen pinch-to-zoom viewer (EnhancedImageViewer)
4765
- *
4766
- * @example
4767
- * <ResponsiveZoom imageIndex={0}>
4768
- * <ProductImage className="w-full" />
4769
- * </ResponsiveZoom>
4770
- */
4771
- declare function ResponsiveZoom({ imageIndex, children, className, style, images, imageUrl, alt, }: ResponsiveZoomProps): react_jsx_runtime.JSX.Element;
4772
-
4773
- interface ZoomOverlayProps {
4774
- imageIndex: number;
4775
- isLargeTouchDevice: boolean;
4776
- isTouchDevice: boolean;
4777
- onEnhancedViewer?: (index: number) => void;
4778
- children: React__default.ReactNode;
4779
- className?: string;
4780
- style?: React__default.CSSProperties;
4781
- }
4782
- declare function ZoomOverlay({ imageIndex, isLargeTouchDevice, isTouchDevice, onEnhancedViewer, children, className, style, }: ZoomOverlayProps): react_jsx_runtime.JSX.Element;
4783
-
4784
- interface EnhancedImageViewerProps {
4785
- imageUrl: string;
4786
- alt: string;
4787
- onClose: () => void;
4788
- images: ZoomImage[];
4789
- onIndexChange?: (index: number) => void;
4790
- currentIndex?: number;
4791
- }
4792
- declare const EnhancedImageViewer: ({ imageUrl, alt, onClose, images, onIndexChange, currentIndex: propCurrentIndex, }: EnhancedImageViewerProps) => React__default.ReactPortal;
4793
-
4794
4736
  /**
4795
4737
  * Carousel Types
4796
4738
  *
@@ -4886,6 +4828,71 @@ interface CarouselImage {
4886
4828
  */
4887
4829
  type HeroImage = CarouselImage;
4888
4830
 
4831
+ /**
4832
+ * Image interface for zoom components
4833
+ */
4834
+ interface ZoomImage {
4835
+ src: string;
4836
+ alt?: string;
4837
+ naturalWidth?: number;
4838
+ naturalHeight?: number;
4839
+ isRealMockup?: boolean;
4840
+ placement?: string;
4841
+ mockupId?: string;
4842
+ /** `whole`: open the picture whole (contain), not cropped to the screen: the gallery's size picture (a diagram). */
4843
+ fit?: "cover" | "whole";
4844
+ /**
4845
+ * Where the product and the mockup's phone window are in this (16:9) picture, as the phone carousel's slide carries
4846
+ * them (carousels/firstView.ts). The viewer opens on them by the hero's first-view rule, so the product is on screen.
4847
+ * Absent = the picture's middle (as before).
4848
+ */
4849
+ productBox?: CarouselImage["productBox"];
4850
+ phoneWindow?: CarouselImage["phoneWindow"];
4851
+ }
4852
+
4853
+ interface ResponsiveZoomProps {
4854
+ imageIndex: number;
4855
+ children: React__default.ReactNode;
4856
+ className?: string;
4857
+ style?: React__default.CSSProperties;
4858
+ images?: ZoomImage[];
4859
+ imageUrl?: string;
4860
+ alt?: string;
4861
+ }
4862
+ /**
4863
+ * ResponsiveZoom - Adaptive zoom component that provides the best experience for each device type
4864
+ *
4865
+ * - Desktop (non-touch): Inline 2x zoom with custom cursor (ZoomOverlay)
4866
+ * - Touch devices (phones & tablets): Full-screen pinch-to-zoom viewer (EnhancedImageViewer)
4867
+ *
4868
+ * @example
4869
+ * <ResponsiveZoom imageIndex={0}>
4870
+ * <ProductImage className="w-full" />
4871
+ * </ResponsiveZoom>
4872
+ */
4873
+ declare function ResponsiveZoom({ imageIndex, children, className, style, images, imageUrl, alt, }: ResponsiveZoomProps): react_jsx_runtime.JSX.Element;
4874
+
4875
+ interface ZoomOverlayProps {
4876
+ imageIndex: number;
4877
+ isLargeTouchDevice: boolean;
4878
+ isTouchDevice: boolean;
4879
+ onEnhancedViewer?: (index: number) => void;
4880
+ children: React__default.ReactNode;
4881
+ className?: string;
4882
+ style?: React__default.CSSProperties;
4883
+ }
4884
+ declare function ZoomOverlay({ imageIndex, isLargeTouchDevice, isTouchDevice, onEnhancedViewer, children, className, style, }: ZoomOverlayProps): react_jsx_runtime.JSX.Element;
4885
+
4886
+ interface EnhancedImageViewerProps {
4887
+ imageUrl: string;
4888
+ alt: string;
4889
+ onClose: () => void;
4890
+ images: ZoomImage[];
4891
+ onIndexChange?: (index: number) => void;
4892
+ currentIndex?: number;
4893
+ }
4894
+ declare const EnhancedImageViewer: ({ imageUrl, alt, onClose, images, onIndexChange, currentIndex: propCurrentIndex, }: EnhancedImageViewerProps) => React__default.ReactPortal;
4895
+
4889
4896
  /**
4890
4897
  * What a phone carousel slide says about its picture, for a host that shows only PART of the picture.
4891
4898
  *
@@ -4916,6 +4923,64 @@ interface SlideFirstViewProps {
4916
4923
  [SLIDE_PHONE_WINDOW_ATTR]?: string;
4917
4924
  style?: CSSProperties;
4918
4925
  }
4926
+ /** The phone hero's default picture is 16:9 (a plate's `frames['16:9']` window; rendercenter shared/shapes.ts). */
4927
+ declare const FIRST_VIEW_PICTURE_ASPECT: number;
4928
+ /** The share of the view's width kept clear on each side of the product (the frame gate's product-on-a-surface margin). */
4929
+ declare const FIRST_VIEW_MARGIN = 0.03;
4930
+ /** The product's box in a mockup's default 16:9 picture, as fractions of that picture (`mockups[].productBox`). */
4931
+ type FirstViewProductBox = NonNullable<CarouselImage["productBox"]>;
4932
+ /** The mockup's own phone window (its 2:3 frame) along the default picture's width (`mockups[].phoneWindow`). */
4933
+ type FirstViewPhoneWindow = NonNullable<CarouselImage["phoneWindow"]>;
4934
+ /** What a first view is centred on, and the product it then holds. */
4935
+ type FirstViewAnchor =
4936
+ /** The mockup's own phone window (a plate). `product` null: its record has no product box, so nothing is held or judged. */
4937
+ {
4938
+ by: "phone-window";
4939
+ window: FirstViewPhoneWindow;
4940
+ product: FirstViewProductBox | null;
4941
+ }
4942
+ /** A product box but no phone window. */
4943
+ | {
4944
+ by: "product";
4945
+ product: FirstViewProductBox;
4946
+ }
4947
+ /** Neither (a mockup from before plates): its phone window is the centred one its 2:3 gate judged. */
4948
+ | {
4949
+ by: "picture-middle";
4950
+ why: "no-phone-window-no-product-box";
4951
+ };
4952
+ interface FirstView {
4953
+ /** The slice of the picture's width the box shows, as fractions of the picture (0 = its left edge, 1 = its right). */
4954
+ x0: number;
4955
+ x1: number;
4956
+ /** The picture's drawn width and its left edge relative to the box's left edge, px (left <= 0). */
4957
+ pictureWidth: number;
4958
+ left: number;
4959
+ /** `held`: the whole product is in view. `cut`: part of it is outside. `unjudged`: no product box to judge by. */
4960
+ product: "held" | "cut" | "unjudged";
4961
+ /** The share of the product's width that is in view (1 = all of it); null when unjudged. */
4962
+ inView: number | null;
4963
+ /** The part of the product in view as a share of the view's width; null when unjudged. */
4964
+ share: number | null;
4965
+ }
4966
+ /** The anchor of a slide's (already parsed) fields: its phone window, else its product, else the picture's middle. */
4967
+ declare function firstViewAnchorOfSlide(image: Pick<CarouselImage, "productBox" | "phoneWindow">): FirstViewAnchor;
4968
+ /**
4969
+ * THE first-view rule (one copy: the www phone hero's CSS, heroFirstView.ts, and the tap-to-enlarge viewer,
4970
+ * EnhancedImageViewer, both draw by it). What a box of `width` x `height` CSS px shows of a picture drawn
4971
+ * `object-fit: cover`: the picture is the box's height (or its width, when the box is wider than the picture), centred
4972
+ * on the anchor, slid as little as it must to hold the whole product with FIRST_VIEW_MARGIN of the view clear on each
4973
+ * side (a product too wide for that is centred in the view, reported `cut`), and never past its own edges.
4974
+ */
4975
+ declare function firstView(box: {
4976
+ width: number;
4977
+ height: number;
4978
+ }, anchor: FirstViewAnchor, pictureAspect?: number): FirstView;
4979
+ /**
4980
+ * The fields a phone carousel slide hands the tap-to-enlarge viewer: a real mockup's product box and phone window (the
4981
+ * same pictures the slide stamps, `image.isRealMockup ? image : {}`), nothing for any other picture.
4982
+ */
4983
+ declare function slideFirstViewFields(image: Pick<CarouselImage, "isRealMockup" | "productBox" | "phoneWindow">): Pick<CarouselImage, "productBox" | "phoneWindow">;
4919
4984
  /** The attributes and CSS variables for one slide; `{}` when the picture has neither a phone window nor a product box. */
4920
4985
  declare function slideFirstViewProps(image: Pick<CarouselImage, "productBox" | "phoneWindow">): SlideFirstViewProps;
4921
4986
 
@@ -5880,4 +5945,4 @@ declare function normalizeHex(color: string): string;
5880
5945
  */
5881
5946
  declare function scrollInputAboveKeyboard(input: HTMLElement): void;
5882
5947
 
5883
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AddToCart, type AddToCartProps, type AddToCartStatus, ArtAlignment, type ArtAlignmentProps, ArtSelector, type ArtSelectorProps, type Artwork, ArtworkCustomizer, type ArtworkCustomizerProps, Badge, type BadgeProps, BrandLogo, type BrandLogoProps, BrandName, type BrandNameProps, Button, type ButtonProps, CanvasEditor, type CanvasExportServiceConfig, CanvasIsolationBoundary, CanvasIsolationConfigurator, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CarouselImage, type CarouselRenderProps, Checkbox, Chip, type ClipShape, Collapsible, CollapsibleContent, CollapsibleRoot, CollapsibleTrigger, ColorPalette, ColorPicker, type ColorPickerProps, ColorRow, ColorSwatch, type ColorSwatchChoice, type ColorSwatchProps, ColorTokenSwatch, type ContentRenderProps, CurrentRefinements, CurrentSelectionDisplay, type CurrentSelectionDisplayProps, DEFAULT_HERO_ZOOM_CONFIG, DEFAULT_IMAGE_CONFIG, DEFAULT_VISIBILITY_OPTIONS, DesignSystemPage, type DeviceDetectionResult, Disclosure, DisclosureContent, DisclosureTrigger, DragHintAnimation, type DragHintAnimationProps, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EdgeBlurBox, type EdgeBlurBoxProps, EdgeSwipeGuards, type EdgeSwipeGuardsProps, EnhancedImageViewer, FACET_SECTIONS, type FacetSection, type FacetType, Fieldset, type FieldsetProps, Filters, FiltersButton, type FiltersButtonProps, FiltersDrawer, type FiltersProps, FloatingActionGroup, type FloatingActionGroupProps, type FloatingActionItem, type FormatCurrencyOptions, HeroCarousel, type HeroCarouselProps, type HeroImage, type HeroImageRenderProps, HeroProductImage, type HeroProductImageProps, type HeroShrinkConfig, HeroShrinkLayout, type HeroShrinkLayoutProps, type HeroZoomConfig, HeroZoomLayout, type HeroZoomLayoutProps, type HeroZoomScales, HorizontalProgressiveBlur, type HorizontalProgressiveBlurProps, Drawer as IOSDrawer, DrawerClose as IOSDrawerClose, DrawerContent as IOSDrawerContent, DrawerDescription as IOSDrawerDescription, DrawerFooter as IOSDrawerFooter, DrawerHeader as IOSDrawerHeader, DrawerTitle as IOSDrawerTitle, DrawerTrigger as IOSDrawerTrigger, ImageBlurExtension, type ImageBlurExtensionProps, ImageEdgeBlur, type ImageEdgeBlurProps, type ImageLayer, type ImageUpdateRequest, Input, type InputProps, Kbd, type KbdProps, Label, Legend, type LegendProps, Lightbox, type LightboxProps, Link, LinkIcon, type LinkProps, LoadingOverlayPrism, LoadingOverlayPrismCandy, LoadingOverlayPrismCandyInline, type LoadingOverlayPrismCandyProps, type LoadingOverlayPrismProps, MasonryGrid, type MasonryGridProps, MobileProductCarousel, type MobileProductCarouselProps, MockupBackground, type MockupBackgroundProps, type MockupPriorityContextValue, MockupPriorityProvider, type MockupPriorityProviderProps, type MockupResult, PDPLayout, type PDPLayoutProps, PersonalizationField, PersonalizationInputs, PersonalizationProvider, PersonalizationValues, PlacementArt, type PlacementArtMap, type PlacementArtProps, PlacementClipShapeSelector, type PlacementConfig, type PlacementDesign, PlacementTabs, type PlacementTabsProps, Popover, PopoverAnchor, PopoverContent, PopoverRoot, PopoverTrigger, type PriorityLevel, Product, ProductCard, type ProductCardProps, ProductContext, type ProductDataMode, ProductGallery, type ProductGalleryProps, ProductGrid, type ProductGridProps, type ProductHit, ProductHitComponent, ProductImage, type Artwork$1 as ProductImageArtwork, type ProductImageProps, ProductList, type ProductListProps, ProductOptions, type ProductPageContext, ProductPageProvider, ProductPageProviderMinimal, type ProductPageProviderMinimalProps, type ProductPageProviderProps, ProductPrice, type ProductPriceProps, type ProductProviderProps, ProgressiveBlur, type ProgressiveBlurProps, type ProviderStatus, Radio, RadioGroup, RadioGroupItem, RadiusScale, type ReactProductContext, type RealtimeContextValue, RealtimeMockup, type RealtimeMockupProps, RealtimeProvider, type RealtimeProviderProps, type RealtimeState, type RegularArtwork$1 as RegularArtwork, type ResponsiveColumns, type ResponsiveImageCapInfo, type ResponsiveImageCapOptions, ResponsiveZoom, RightToLeftProgressiveBlur, type RightToLeftProgressiveBlurProps, SLIDE_FIRST_VIEW_ATTR, SLIDE_FIRST_VIEW_X_VAR, SLIDE_PHONE_WINDOW_ATTR, SLIDE_PRODUCT_BOX_ATTR, SLIDE_PRODUCT_X0_VAR, SLIDE_PRODUCT_X1_VAR, SafeImg, type SafeImgProps, type ScrollDirection, ScrollFade, type ScrollFadeProps, type ScrollState, type SeamlessPattern$1 as SeamlessPattern, SearchBox, SearchProvider, type SearchProviderProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Shop, ShopContext, type ShopContextValue, type ShopProps, SimpleImageBlur, type SimpleImageBlurProps, type SlideFirstViewProps, Slider, SliderFill, SliderOutput, SliderThumb, SliderTrack, Spinner, type SpinnerProps, Surface, SurfaceContext, type SurfaceProps, Switch, Tabs, TabsContent, TabsList, TabsRoot, TabsTrigger, TextArea, TextField, type TextFieldProps, Textarea, type TextareaProps, ThemeSwitcher, ThemeToggle, type ThemeToggleProps, TileCount, Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger, TypographyScale, type UiRouter, UiRouterProvider, type UseBrandResult, type UseImagePreloaderOptions, type UseImagePreloaderReturn, type UseImageTransitionOptions, type UseImageTransitionReturn, type UsePersonalizationShimmerReturn, type UseProductGalleryOptions, type UseProductGalleryReturn, VISIBILITY_THRESHOLDS, type ViewportDimensions, type ZoomImage, ZoomOverlay, badgeVariants, blockingSessionError, brandAssets, buttonVariants, canvasExportService, checkComponentStyles, checkTailwindConfig, checkThemeTokens, createScrollDirectionTracker, formatCurrency, formatDate, formatDateTime, getBrand, getObservedElementCount, getObserverCount, hasEdgeBlur, isObserved, isWideMonitor, kbdVariants, linkVariants, linkedPlacementsLabel, normalizeHex, observe, pictureRenderState, placementArtFor, runConfigChecks, scrollInputAboveKeyboard, searchClient, slideFirstViewProps, spinnerVariants, surfaceVariants, useArtworkAlignment, useBrand, useCanvasContext, useCanvasContextStatic, useCurrentPlacements, useDesign, useDesignOptional, useDeviceDetection, useFocusTrap, useHeroZoomScales, useImagePreloader, useImageTransition, useIsolatedCanvas, useLoadingOverlay, useMediaQuery, useMockupBackgroundOptional, useMockupPriority, useMockupPriorityOptional, usePersonalization, usePersonalizationOptional, usePersonalizationShimmer, usePlacementArtOptional, usePlacementClipShape, usePlacementsProcessor, useProduct, useProductGallery, useProductOptional, useProductPage, useProductPageOptional, useProductSelection, useProviderStatus, useRealtime, useRealtimeOptional, useRenderCount, useRenderGuard, useResponsiveImageCap, useScrollDirection, useSelectedArtwork, useSetArtworkAlignment, useShop, useShopOptional, useSurface, useViewportDimensions, useWideMonitorMode };
5948
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AddToCart, type AddToCartProps, type AddToCartStatus, ArtAlignment, type ArtAlignmentProps, ArtSelector, type ArtSelectorProps, type Artwork, ArtworkCustomizer, type ArtworkCustomizerProps, Badge, type BadgeProps, BrandLogo, type BrandLogoProps, BrandName, type BrandNameProps, Button, type ButtonProps, CanvasEditor, type CanvasExportServiceConfig, CanvasIsolationBoundary, CanvasIsolationConfigurator, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CarouselImage, type CarouselRenderProps, Checkbox, Chip, type ClipShape, Collapsible, CollapsibleContent, CollapsibleRoot, CollapsibleTrigger, ColorPalette, ColorPicker, type ColorPickerProps, ColorRow, ColorSwatch, type ColorSwatchChoice, type ColorSwatchProps, ColorTokenSwatch, type ContentRenderProps, CurrentRefinements, CurrentSelectionDisplay, type CurrentSelectionDisplayProps, DEFAULT_HERO_ZOOM_CONFIG, DEFAULT_IMAGE_CONFIG, DEFAULT_VISIBILITY_OPTIONS, DesignSystemPage, type DeviceDetectionResult, Disclosure, DisclosureContent, DisclosureTrigger, DragHintAnimation, type DragHintAnimationProps, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EdgeBlurBox, type EdgeBlurBoxProps, EdgeSwipeGuards, type EdgeSwipeGuardsProps, EnhancedImageViewer, FACET_SECTIONS, FIRST_VIEW_MARGIN, FIRST_VIEW_PICTURE_ASPECT, type FacetSection, type FacetType, Fieldset, type FieldsetProps, Filters, FiltersButton, type FiltersButtonProps, FiltersDrawer, type FiltersProps, type FirstView, type FirstViewAnchor, type FirstViewPhoneWindow, type FirstViewProductBox, FloatingActionGroup, type FloatingActionGroupProps, type FloatingActionItem, type FormatCurrencyOptions, HeroCarousel, type HeroCarouselProps, type HeroImage, type HeroImageRenderProps, HeroProductImage, type HeroProductImageProps, type HeroShrinkConfig, HeroShrinkLayout, type HeroShrinkLayoutProps, type HeroZoomConfig, HeroZoomLayout, type HeroZoomLayoutProps, type HeroZoomScales, HorizontalProgressiveBlur, type HorizontalProgressiveBlurProps, Drawer as IOSDrawer, DrawerClose as IOSDrawerClose, DrawerContent as IOSDrawerContent, DrawerDescription as IOSDrawerDescription, DrawerFooter as IOSDrawerFooter, DrawerHeader as IOSDrawerHeader, DrawerTitle as IOSDrawerTitle, DrawerTrigger as IOSDrawerTrigger, ImageBlurExtension, type ImageBlurExtensionProps, ImageEdgeBlur, type ImageEdgeBlurProps, type ImageLayer, type ImageUpdateRequest, Input, type InputProps, Kbd, type KbdProps, Label, Legend, type LegendProps, Lightbox, type LightboxProps, Link, LinkIcon, type LinkProps, LoadingOverlayPrism, LoadingOverlayPrismCandy, LoadingOverlayPrismCandyInline, type LoadingOverlayPrismCandyProps, type LoadingOverlayPrismProps, MasonryGrid, type MasonryGridProps, MobileProductCarousel, type MobileProductCarouselProps, MockupBackground, type MockupBackgroundProps, type MockupPriorityContextValue, MockupPriorityProvider, type MockupPriorityProviderProps, type MockupResult, PDPLayout, type PDPLayoutProps, PersonalizationField, PersonalizationInputs, PersonalizationProvider, PersonalizationValues, PlacementArt, type PlacementArtMap, type PlacementArtProps, PlacementClipShapeSelector, type PlacementConfig, type PlacementDesign, PlacementTabs, type PlacementTabsProps, Popover, PopoverAnchor, PopoverContent, PopoverRoot, PopoverTrigger, type PriorityLevel, Product, ProductCard, type ProductCardProps, ProductContext, type ProductDataMode, ProductGallery, type ProductGalleryProps, ProductGrid, type ProductGridProps, type ProductHit, ProductHitComponent, ProductImage, type Artwork$1 as ProductImageArtwork, type ProductImageProps, ProductList, type ProductListProps, ProductOptions, type ProductPageContext, ProductPageProvider, ProductPageProviderMinimal, type ProductPageProviderMinimalProps, type ProductPageProviderProps, ProductPrice, type ProductPriceProps, type ProductProviderProps, ProgressiveBlur, type ProgressiveBlurProps, type ProviderStatus, Radio, RadioGroup, RadioGroupItem, RadiusScale, type ReactProductContext, type RealtimeContextValue, RealtimeMockup, type RealtimeMockupProps, RealtimeProvider, type RealtimeProviderProps, type RealtimeState, type RegularArtwork$1 as RegularArtwork, type ResponsiveColumns, type ResponsiveImageCapInfo, type ResponsiveImageCapOptions, ResponsiveZoom, RightToLeftProgressiveBlur, type RightToLeftProgressiveBlurProps, SLIDE_FIRST_VIEW_ATTR, SLIDE_FIRST_VIEW_X_VAR, SLIDE_PHONE_WINDOW_ATTR, SLIDE_PRODUCT_BOX_ATTR, SLIDE_PRODUCT_X0_VAR, SLIDE_PRODUCT_X1_VAR, SafeImg, type SafeImgProps, type ScrollDirection, ScrollFade, type ScrollFadeProps, type ScrollState, type SeamlessPattern$1 as SeamlessPattern, SearchBox, SearchProvider, type SearchProviderProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Shop, ShopContext, type ShopContextValue, type ShopProps, SimpleImageBlur, type SimpleImageBlurProps, type SlideFirstViewProps, Slider, SliderFill, SliderOutput, SliderThumb, SliderTrack, Spinner, type SpinnerProps, Surface, SurfaceContext, type SurfaceProps, Switch, Tabs, TabsContent, TabsList, TabsRoot, TabsTrigger, TextArea, TextField, type TextFieldProps, Textarea, type TextareaProps, ThemeSwitcher, ThemeToggle, type ThemeToggleProps, TileCount, Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger, TypographyScale, type UiRouter, UiRouterProvider, type UseBrandResult, type UseImagePreloaderOptions, type UseImagePreloaderReturn, type UseImageTransitionOptions, type UseImageTransitionReturn, type UsePersonalizationShimmerReturn, type UseProductGalleryOptions, type UseProductGalleryReturn, VISIBILITY_THRESHOLDS, type ViewportDimensions, type ZoomImage, ZoomOverlay, badgeVariants, blockingSessionError, brandAssets, buttonVariants, canvasExportService, checkComponentStyles, checkTailwindConfig, checkThemeTokens, createScrollDirectionTracker, firstView, firstViewAnchorOfSlide, formatCurrency, formatDate, formatDateTime, getBrand, getObservedElementCount, getObserverCount, hasEdgeBlur, isObserved, isWideMonitor, kbdVariants, linkVariants, linkedPlacementsLabel, normalizeHex, observe, pictureRenderState, placementArtFor, runConfigChecks, scrollInputAboveKeyboard, searchClient, slideFirstViewFields, slideFirstViewProps, spinnerVariants, surfaceVariants, useArtworkAlignment, useBrand, useCanvasContext, useCanvasContextStatic, useCurrentPlacements, useDesign, useDesignOptional, useDeviceDetection, useFocusTrap, useHeroZoomScales, useImagePreloader, useImageTransition, useIsolatedCanvas, useLoadingOverlay, useMediaQuery, useMockupBackgroundOptional, useMockupPriority, useMockupPriorityOptional, usePersonalization, usePersonalizationOptional, usePersonalizationShimmer, usePlacementArtOptional, usePlacementClipShape, usePlacementsProcessor, useProduct, useProductGallery, useProductOptional, useProductPage, useProductPageOptional, useProductSelection, useProviderStatus, useRealtime, useRealtimeOptional, useRenderCount, useRenderGuard, useResponsiveImageCap, useScrollDirection, useSelectedArtwork, useSetArtworkAlignment, useShop, useShopOptional, useSurface, useViewportDimensions, useWideMonitorMode };
package/dist/index.js CHANGED
@@ -12295,9 +12295,73 @@ import {
12295
12295
  TransformComponent as OriginalTransformComponent
12296
12296
  } from "react-zoom-pan-pinch";
12297
12297
  import { X as X2 } from "lucide-react";
12298
+
12299
+ // src/composed/carousels/firstView.ts
12300
+ var SLIDE_FIRST_VIEW_ATTR = "data-first-view";
12301
+ var SLIDE_PRODUCT_BOX_ATTR = "data-product-box";
12302
+ var SLIDE_PHONE_WINDOW_ATTR = "data-phone-window";
12303
+ var SLIDE_FIRST_VIEW_X_VAR = "--first-view-x";
12304
+ var SLIDE_PRODUCT_X0_VAR = "--product-x0";
12305
+ var SLIDE_PRODUCT_X1_VAR = "--product-x1";
12306
+ var r4 = (n) => Math.round(n * 1e4) / 1e4;
12307
+ var FIRST_VIEW_PICTURE_ASPECT = 16 / 9;
12308
+ var FIRST_VIEW_MARGIN = 0.03;
12309
+ function firstViewAnchorOfSlide(image) {
12310
+ const { productBox: product, phoneWindow: window2 } = image;
12311
+ if (window2) return { by: "phone-window", window: window2, product: product ?? null };
12312
+ if (product) return { by: "product", product };
12313
+ return { by: "picture-middle", why: "no-phone-window-no-product-box" };
12314
+ }
12315
+ function firstView(box, anchor, pictureAspect = FIRST_VIEW_PICTURE_ASPECT) {
12316
+ const { width: W, height: H } = box;
12317
+ const pictureWidth = Math.max(W, H * pictureAspect);
12318
+ const product = anchor.by === "picture-middle" ? null : anchor.product;
12319
+ const wanted = anchor.by === "phone-window" ? anchor.window.x + anchor.window.w / 2 : anchor.by === "product" ? anchor.product.x + anchor.product.w / 2 : 0.5;
12320
+ let centrePx = wanted * pictureWidth;
12321
+ if (product) {
12322
+ const mid = (product.x + product.w / 2) * pictureWidth;
12323
+ const lo = (product.x + product.w) * pictureWidth + FIRST_VIEW_MARGIN * W - W / 2;
12324
+ const hi = product.x * pictureWidth - FIRST_VIEW_MARGIN * W + W / 2;
12325
+ centrePx = Math.max(Math.min(lo, mid), Math.min(centrePx, Math.max(hi, mid)));
12326
+ }
12327
+ const left = Math.max(Math.min(0, W - pictureWidth), Math.min(W / 2 - centrePx, 0));
12328
+ const x0 = -left / pictureWidth, x1 = (W - left) / pictureWidth;
12329
+ if (!product) return { x0, x1, pictureWidth, left, product: "unjudged", inView: null, share: null };
12330
+ const seen = Math.max(0, Math.min(product.x + product.w, x1) - Math.max(product.x, x0));
12331
+ const inView = seen / product.w;
12332
+ return { x0, x1, pictureWidth, left, product: inView > 1 - 1e-6 ? "held" : "cut", inView, share: seen / (x1 - x0) };
12333
+ }
12334
+ function slideFirstViewFields(image) {
12335
+ if (!image.isRealMockup) return {};
12336
+ return { ...image.productBox ? { productBox: image.productBox } : {}, ...image.phoneWindow ? { phoneWindow: image.phoneWindow } : {} };
12337
+ }
12338
+ function slideFirstViewProps(image) {
12339
+ const { productBox: box, phoneWindow: phone } = image;
12340
+ if (!box && !phone) return {};
12341
+ const centre = phone ? r4(phone.x + phone.w / 2) : r4(box.x + box.w / 2);
12342
+ const x0 = box ? r4(box.x) : centre, x1 = box ? r4(box.x + box.w) : centre;
12343
+ return {
12344
+ [SLIDE_FIRST_VIEW_ATTR]: phone ? "phone-window" : "product",
12345
+ ...box ? { [SLIDE_PRODUCT_BOX_ATTR]: [box.x, box.y, box.w, box.h].map(r4).join(",") } : {},
12346
+ ...phone ? { [SLIDE_PHONE_WINDOW_ATTR]: [phone.x, phone.w].map(r4).join(",") } : {},
12347
+ style: { [SLIDE_FIRST_VIEW_X_VAR]: String(centre), [SLIDE_PRODUCT_X0_VAR]: String(x0), [SLIDE_PRODUCT_X1_VAR]: String(x1) }
12348
+ };
12349
+ }
12350
+
12351
+ // src/composed/zoom/EnhancedImageViewer.tsx
12298
12352
  import { Fragment as Fragment17, jsx as jsx73, jsxs as jsxs48 } from "react/jsx-runtime";
12299
12353
  var TransformWrapper = OriginalTransformWrapper;
12300
12354
  var TransformComponent = OriginalTransformComponent;
12355
+ function viewerFirstView(image, screen, pictureAspect) {
12356
+ if (image?.fit === "whole") return { by: "whole" };
12357
+ const anchor = firstViewAnchorOfSlide(image ?? {});
12358
+ if (anchor.by === "picture-middle") return anchor;
12359
+ if (pictureAspect !== void 0 && Math.abs(pictureAspect / FIRST_VIEW_PICTURE_ASPECT - 1) > 0.01) {
12360
+ return { by: "picture-middle", why: "picture-not-16:9" };
12361
+ }
12362
+ return { by: anchor.by, view: firstView(screen, anchor) };
12363
+ }
12364
+ var r42 = (n) => Math.round(n * 1e4) / 1e4;
12301
12365
  var EnhancedImageViewer = ({
12302
12366
  imageUrl,
12303
12367
  alt,
@@ -12312,6 +12376,7 @@ var EnhancedImageViewer = ({
12312
12376
  const [cropDimensions, setCropDimensions] = useState38({ width: 0, height: 0 });
12313
12377
  const [currentZoomScale, setCurrentZoomScale] = useState38(1);
12314
12378
  const imgRef = useRef25(null);
12379
+ const [loadedAspect, setLoadedAspect] = useState38(null);
12315
12380
  const touchStartRef = useRef25(
12316
12381
  null
12317
12382
  );
@@ -12330,6 +12395,10 @@ var EnhancedImageViewer = ({
12330
12395
  }, []);
12331
12396
  const handleImageLoad = useCallback21(() => {
12332
12397
  calculateScale();
12398
+ const img = imgRef.current;
12399
+ if (img && img.naturalWidth > 0 && img.naturalHeight > 0) {
12400
+ setLoadedAspect({ src: img.currentSrc || img.src, aspect: img.naturalWidth / img.naturalHeight });
12401
+ }
12333
12402
  }, [calculateScale]);
12334
12403
  useLayoutEffect6(() => {
12335
12404
  setIsClient(true);
@@ -12433,6 +12502,17 @@ var EnhancedImageViewer = ({
12433
12502
  },
12434
12503
  [handleSwipeNavigation]
12435
12504
  );
12505
+ const shownIndex = propCurrentIndex ?? images.findIndex((img) => img.src === imageUrl);
12506
+ const shown = images[shownIndex];
12507
+ const shownAspect = loadedAspect && (loadedAspect.src === imageUrl || loadedAspect.src.endsWith(imageUrl)) ? loadedAspect.aspect : shown?.naturalWidth && shown?.naturalHeight ? shown.naturalWidth / shown.naturalHeight : void 0;
12508
+ const opening = viewerFirstView(
12509
+ shown,
12510
+ {
12511
+ width: cropDimensions.width || (typeof window === "undefined" ? 0 : window.innerWidth),
12512
+ height: cropDimensions.height || (typeof window === "undefined" ? 0 : window.innerHeight)
12513
+ },
12514
+ shownAspect
12515
+ );
12436
12516
  if (!isMounted || !isClient) {
12437
12517
  return createPortal3(
12438
12518
  /* @__PURE__ */ jsx73(
@@ -12567,11 +12647,17 @@ var EnhancedImageViewer = ({
12567
12647
  alt,
12568
12648
  crossOrigin: "anonymous",
12569
12649
  onLoad: handleImageLoad,
12650
+ "data-first-view": opening.by,
12651
+ "data-first-view-why": opening.by === "picture-middle" ? opening.why : void 0,
12652
+ "data-first-view-product": "view" in opening ? opening.view.product : void 0,
12653
+ "data-first-view-slice": "view" in opening ? `${r42(opening.view.x0)},${r42(opening.view.x1)}` : void 0,
12570
12654
  style: {
12571
12655
  width: "100%",
12572
12656
  height: "100%",
12573
12657
  // Crop 16:9 to fill the screen (a hero), or the whole picture for a size picture (a diagram).
12574
- objectFit: images[propCurrentIndex ?? -1]?.fit === "whole" ? "contain" : "cover"
12658
+ objectFit: opening.by === "whole" ? "contain" : "cover",
12659
+ // Opened on the product by the hero's first-view rule; a picture without the fields keeps the middle.
12660
+ ..."view" in opening ? { objectPosition: `${Math.round(opening.view.left * 100) / 100}px 50%` } : {}
12575
12661
  }
12576
12662
  },
12577
12663
  `${imageUrl}-${propCurrentIndex}`
@@ -12808,27 +12894,6 @@ function ResponsiveZoom({
12808
12894
  ] });
12809
12895
  }
12810
12896
 
12811
- // src/composed/carousels/firstView.ts
12812
- var SLIDE_FIRST_VIEW_ATTR = "data-first-view";
12813
- var SLIDE_PRODUCT_BOX_ATTR = "data-product-box";
12814
- var SLIDE_PHONE_WINDOW_ATTR = "data-phone-window";
12815
- var SLIDE_FIRST_VIEW_X_VAR = "--first-view-x";
12816
- var SLIDE_PRODUCT_X0_VAR = "--product-x0";
12817
- var SLIDE_PRODUCT_X1_VAR = "--product-x1";
12818
- var r4 = (n) => Math.round(n * 1e4) / 1e4;
12819
- function slideFirstViewProps(image) {
12820
- const { productBox: box, phoneWindow: phone } = image;
12821
- if (!box && !phone) return {};
12822
- const centre = phone ? r4(phone.x + phone.w / 2) : r4(box.x + box.w / 2);
12823
- const x0 = box ? r4(box.x) : centre, x1 = box ? r4(box.x + box.w) : centre;
12824
- return {
12825
- [SLIDE_FIRST_VIEW_ATTR]: phone ? "phone-window" : "product",
12826
- ...box ? { [SLIDE_PRODUCT_BOX_ATTR]: [box.x, box.y, box.w, box.h].map(r4).join(",") } : {},
12827
- ...phone ? { [SLIDE_PHONE_WINDOW_ATTR]: [phone.x, phone.w].map(r4).join(",") } : {},
12828
- style: { [SLIDE_FIRST_VIEW_X_VAR]: String(centre), [SLIDE_PRODUCT_X0_VAR]: String(x0), [SLIDE_PRODUCT_X1_VAR]: String(x1) }
12829
- };
12830
- }
12831
-
12832
12897
  // src/composed/carousels/MobileProductCarousel.tsx
12833
12898
  import {
12834
12899
  useState as useState40,
@@ -13535,7 +13600,9 @@ var MobileProductCarousel = memo4(function MobileProductCarousel2({
13535
13600
  alt: img.label,
13536
13601
  naturalWidth: img.naturalWidth,
13537
13602
  naturalHeight: img.naturalHeight,
13538
- ...zoomFit(img.galleryRole) === "whole" ? { fit: "whole" } : {}
13603
+ ...zoomFit(img.galleryRole) === "whole" ? { fit: "whole" } : {},
13604
+ // the viewer opens on the product by the hero's first-view rule (EnhancedImageViewer viewerFirstView)
13605
+ ...slideFirstViewFields(img)
13539
13606
  } : null;
13540
13607
  }).filter((img) => img !== null);
13541
13608
  return /* @__PURE__ */ jsx75(
@@ -15682,6 +15749,8 @@ export {
15682
15749
  EdgeSwipeGuards,
15683
15750
  EnhancedImageViewer,
15684
15751
  FACET_SECTIONS,
15752
+ FIRST_VIEW_MARGIN,
15753
+ FIRST_VIEW_PICTURE_ASPECT,
15685
15754
  Fieldset,
15686
15755
  Filters,
15687
15756
  FiltersButton,
@@ -15811,6 +15880,8 @@ export {
15811
15880
  checkThemeTokens,
15812
15881
  createScrollDirectionTracker,
15813
15882
  describeProductArtAlignment2 as describeProductArtAlignment,
15883
+ firstView,
15884
+ firstViewAnchorOfSlide,
15814
15885
  formatCurrency,
15815
15886
  formatDate,
15816
15887
  formatDateTime,
@@ -15834,6 +15905,7 @@ export {
15834
15905
  runConfigChecks,
15835
15906
  scrollInputAboveKeyboard,
15836
15907
  searchClient,
15908
+ slideFirstViewFields,
15837
15909
  slideFirstViewProps,
15838
15910
  spinnerVariants,
15839
15911
  surfaceVariants,