@snowcone-app/ui 0.13.0 → 0.13.2

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
@@ -4469,6 +4469,19 @@ declare function CanvasEditor({ artworkSrc, onOpenImageGallery, onOpenTypography
4469
4469
  children?: ReactNode;
4470
4470
  }): react_jsx_runtime.JSX.Element;
4471
4471
 
4472
+ /**
4473
+ * How a hero picture changes from the one on screen to the next (both already decoded, so never through a blank):
4474
+ * - `instant`: a LIVE frame (a realtime render, a `blob:` URL) replacing a picture. Frames arrive several a second while
4475
+ * a shopper types into a personalization box; a 400 ms crossfade per frame smeared each frame over the last and,
4476
+ * restarted mid-fade, faded the older frame back in (snowcone.app engraved tumbler, 2026-12-01: "flash like crazy").
4477
+ * - `crossfade`: any other change (another design, another size): the old picture fades out over the new.
4478
+ */
4479
+ declare function pictureSwapOf(shownUrl: string | null, nextUrl: string): "instant" | "crossfade";
4480
+ /**
4481
+ * Resolves once `img` is loaded AND decoded (HTMLImageElement.decode), so the swap that follows paints the new picture
4482
+ * in the same frame; rejects when it cannot be shown. Without decode() (old browsers, jsdom) the load event stands in.
4483
+ */
4484
+ declare function decodedPicture(img: HTMLImageElement): Promise<void>;
4472
4485
  interface HeroProductImageProps {
4473
4486
  productId?: string;
4474
4487
  mockupId?: string;
@@ -6034,4 +6047,4 @@ declare function measureTextLine(text: string, style: TextLineStyle, fontSize?:
6034
6047
  */
6035
6048
  declare function scrollInputAboveKeyboard(input: HTMLElement): void;
6036
6049
 
6037
- 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, FIT_MARGIN, 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, GallerySkipProvider, type GallerySkipValue, type GallerySkipVerdict, type GallerySkips, 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, NO_GALLERY_SKIPS, PDPLayout, type PDPLayoutProps, PersonalizationField, PersonalizationInputs, PersonalizationProvider, PersonalizationTextField, 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, type TextLineStyle, 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, anyTyped, badgeVariants, blockingSessionError, brandAssets, buttonVariants, canvasExportService, canvasFontString, checkComponentStyles, checkTailwindConfig, checkThemeTokens, createScrollDirectionTracker, firstView, firstViewAnchorOfSlide, formatCurrency, formatDate, formatDateTime, gallerySkipVerdict, gallerySkippedStamp, galleryWithoutSkipped, getBrand, getObservedElementCount, getObserverCount, hasEdgeBlur, isObserved, isWideMonitor, kbdVariants, linkVariants, linkedPlacementsLabel, measureTextLine, normalizeHex, observe, pictureRenderState, placementArtFor, runConfigChecks, scrollInputAboveKeyboard, searchClient, shrinkFontSizeToFit, slideFirstViewFields, slideFirstViewProps, spinnerVariants, surfaceVariants, textValueFor, useArtworkAlignment, useBrand, useCanvasContext, useCanvasContextStatic, useCurrentPlacements, useDesign, useDesignOptional, useDeviceDetection, useFocusTrap, useGallerySkipOptional, useGallerySkipState, 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 };
6050
+ 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, FIT_MARGIN, 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, GallerySkipProvider, type GallerySkipValue, type GallerySkipVerdict, type GallerySkips, 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, NO_GALLERY_SKIPS, PDPLayout, type PDPLayoutProps, PersonalizationField, PersonalizationInputs, PersonalizationProvider, PersonalizationTextField, 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, type TextLineStyle, 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, anyTyped, badgeVariants, blockingSessionError, brandAssets, buttonVariants, canvasExportService, canvasFontString, checkComponentStyles, checkTailwindConfig, checkThemeTokens, createScrollDirectionTracker, decodedPicture, firstView, firstViewAnchorOfSlide, formatCurrency, formatDate, formatDateTime, gallerySkipVerdict, gallerySkippedStamp, galleryWithoutSkipped, getBrand, getObservedElementCount, getObserverCount, hasEdgeBlur, isObserved, isWideMonitor, kbdVariants, linkVariants, linkedPlacementsLabel, measureTextLine, normalizeHex, observe, pictureRenderState, pictureSwapOf, placementArtFor, runConfigChecks, scrollInputAboveKeyboard, searchClient, shrinkFontSizeToFit, slideFirstViewFields, slideFirstViewProps, spinnerVariants, surfaceVariants, textValueFor, useArtworkAlignment, useBrand, useCanvasContext, useCanvasContextStatic, useCurrentPlacements, useDesign, useDesignOptional, useDeviceDetection, useFocusTrap, useGallerySkipOptional, useGallerySkipState, 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
@@ -4469,6 +4469,19 @@ declare function CanvasEditor({ artworkSrc, onOpenImageGallery, onOpenTypography
4469
4469
  children?: ReactNode;
4470
4470
  }): react_jsx_runtime.JSX.Element;
4471
4471
 
4472
+ /**
4473
+ * How a hero picture changes from the one on screen to the next (both already decoded, so never through a blank):
4474
+ * - `instant`: a LIVE frame (a realtime render, a `blob:` URL) replacing a picture. Frames arrive several a second while
4475
+ * a shopper types into a personalization box; a 400 ms crossfade per frame smeared each frame over the last and,
4476
+ * restarted mid-fade, faded the older frame back in (snowcone.app engraved tumbler, 2026-12-01: "flash like crazy").
4477
+ * - `crossfade`: any other change (another design, another size): the old picture fades out over the new.
4478
+ */
4479
+ declare function pictureSwapOf(shownUrl: string | null, nextUrl: string): "instant" | "crossfade";
4480
+ /**
4481
+ * Resolves once `img` is loaded AND decoded (HTMLImageElement.decode), so the swap that follows paints the new picture
4482
+ * in the same frame; rejects when it cannot be shown. Without decode() (old browsers, jsdom) the load event stands in.
4483
+ */
4484
+ declare function decodedPicture(img: HTMLImageElement): Promise<void>;
4472
4485
  interface HeroProductImageProps {
4473
4486
  productId?: string;
4474
4487
  mockupId?: string;
@@ -6034,4 +6047,4 @@ declare function measureTextLine(text: string, style: TextLineStyle, fontSize?:
6034
6047
  */
6035
6048
  declare function scrollInputAboveKeyboard(input: HTMLElement): void;
6036
6049
 
6037
- 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, FIT_MARGIN, 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, GallerySkipProvider, type GallerySkipValue, type GallerySkipVerdict, type GallerySkips, 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, NO_GALLERY_SKIPS, PDPLayout, type PDPLayoutProps, PersonalizationField, PersonalizationInputs, PersonalizationProvider, PersonalizationTextField, 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, type TextLineStyle, 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, anyTyped, badgeVariants, blockingSessionError, brandAssets, buttonVariants, canvasExportService, canvasFontString, checkComponentStyles, checkTailwindConfig, checkThemeTokens, createScrollDirectionTracker, firstView, firstViewAnchorOfSlide, formatCurrency, formatDate, formatDateTime, gallerySkipVerdict, gallerySkippedStamp, galleryWithoutSkipped, getBrand, getObservedElementCount, getObserverCount, hasEdgeBlur, isObserved, isWideMonitor, kbdVariants, linkVariants, linkedPlacementsLabel, measureTextLine, normalizeHex, observe, pictureRenderState, placementArtFor, runConfigChecks, scrollInputAboveKeyboard, searchClient, shrinkFontSizeToFit, slideFirstViewFields, slideFirstViewProps, spinnerVariants, surfaceVariants, textValueFor, useArtworkAlignment, useBrand, useCanvasContext, useCanvasContextStatic, useCurrentPlacements, useDesign, useDesignOptional, useDeviceDetection, useFocusTrap, useGallerySkipOptional, useGallerySkipState, 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 };
6050
+ 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, FIT_MARGIN, 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, GallerySkipProvider, type GallerySkipValue, type GallerySkipVerdict, type GallerySkips, 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, NO_GALLERY_SKIPS, PDPLayout, type PDPLayoutProps, PersonalizationField, PersonalizationInputs, PersonalizationProvider, PersonalizationTextField, 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, type TextLineStyle, 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, anyTyped, badgeVariants, blockingSessionError, brandAssets, buttonVariants, canvasExportService, canvasFontString, checkComponentStyles, checkTailwindConfig, checkThemeTokens, createScrollDirectionTracker, decodedPicture, firstView, firstViewAnchorOfSlide, formatCurrency, formatDate, formatDateTime, gallerySkipVerdict, gallerySkippedStamp, galleryWithoutSkipped, getBrand, getObservedElementCount, getObserverCount, hasEdgeBlur, isObserved, isWideMonitor, kbdVariants, linkVariants, linkedPlacementsLabel, measureTextLine, normalizeHex, observe, pictureRenderState, pictureSwapOf, placementArtFor, runConfigChecks, scrollInputAboveKeyboard, searchClient, shrinkFontSizeToFit, slideFirstViewFields, slideFirstViewProps, spinnerVariants, surfaceVariants, textValueFor, useArtworkAlignment, useBrand, useCanvasContext, useCanvasContextStatic, useCurrentPlacements, useDesign, useDesignOptional, useDeviceDetection, useFocusTrap, useGallerySkipOptional, useGallerySkipState, 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
@@ -6009,6 +6009,8 @@ function RealtimeProvider({
6009
6009
  const rerenderTimerRef = useRef12(null);
6010
6010
  const fullFrameRerenderIdsRef = useRef12(/* @__PURE__ */ new Set());
6011
6011
  const fullFrameRerenderTimerRef = useRef12(null);
6012
+ const rerenderFullFrameRef = useRef12(null);
6013
+ const lostFrameAskedRef = useRef12(/* @__PURE__ */ new Set());
6012
6014
  useEffect17(
6013
6015
  () => () => {
6014
6016
  if (fullFrameRerenderTimerRef.current) clearTimeout(fullFrameRerenderTimerRef.current);
@@ -6060,6 +6062,7 @@ function RealtimeProvider({
6060
6062
  }, [revokeBlobUrl]);
6061
6063
  const markBlobShown = useCallback10((owner, url, consumer = "default") => {
6062
6064
  ackUrl(url);
6065
+ lostFrameAskedRef.current.delete(owner);
6063
6066
  const list = blobsByOwnerRef.current.get(owner);
6064
6067
  if (!list || list.indexOf(url) < 0) return;
6065
6068
  const shown = shownBlobByOwnerRef.current.get(owner) ?? /* @__PURE__ */ new Map();
@@ -6069,6 +6072,22 @@ function RealtimeProvider({
6069
6072
  }, [releaseOlderFrames, ackUrl]);
6070
6073
  const frameFailed = useCallback10((url) => {
6071
6074
  ackUrl(url);
6075
+ if (!url.startsWith("blob:")) return;
6076
+ let mockupId;
6077
+ mockupUrlCacheRef.current.forEach((entry, id) => {
6078
+ if (entry.url === url) mockupId = id;
6079
+ });
6080
+ if (!mockupId) return;
6081
+ if (pendingMockupIdsRef.current.has(mockupId)) return;
6082
+ if (compositeQueueRef.current.has(mockupId) || compositeBusyRef.current.has(mockupId)) return;
6083
+ if (lostFrameAskedRef.current.has(mockupId)) return;
6084
+ lostFrameAskedRef.current.add(mockupId);
6085
+ console.error(
6086
+ `[RealtimeProvider] E_FRAME_LOST: ${mockupId}'s newest frame could not be loaded (gone before any element drew it); re-rendering that picture.`
6087
+ );
6088
+ mockupUrlCacheRef.current.delete(mockupId);
6089
+ mockupResultsRef.current = mockupResultsRef.current.filter((r) => r.imageUrl !== url);
6090
+ rerenderFullFrameRef.current?.(mockupId);
6072
6091
  }, [ackUrl]);
6073
6092
  const releaseBlobConsumer = useCallback10((owner, consumer) => {
6074
6093
  const shown = shownBlobByOwnerRef.current.get(owner);
@@ -6175,6 +6194,7 @@ function RealtimeProvider({
6175
6194
  },
6176
6195
  [sendFullFrameConfig, forceRerenderByConfig, sendRerenderPaced]
6177
6196
  );
6197
+ rerenderFullFrameRef.current = rerenderFullFrame;
6178
6198
  const maybeFlipCrop = useCallback10(() => {
6179
6199
  if (!croppedDeliveryEnabled || !cropCapableRef.current) return;
6180
6200
  if (croppedActiveRef.current) return;
@@ -10747,6 +10767,23 @@ function heroSize(stripView, cropWidth, width) {
10747
10767
  if (isCrop(stripView)) return cropWidth !== void 0 ? { stripView, width: cropWidth } : { stripView };
10748
10768
  return { width };
10749
10769
  }
10770
+ function pictureSwapOf(shownUrl, nextUrl) {
10771
+ if (!shownUrl) return "instant";
10772
+ return nextUrl.startsWith("blob:") || shownUrl.startsWith("blob:") ? "instant" : "crossfade";
10773
+ }
10774
+ function decodedPicture(img) {
10775
+ if (typeof img.decode === "function") {
10776
+ return img.decode().catch((e) => {
10777
+ if (img.complete && img.naturalWidth > 0) return;
10778
+ throw e;
10779
+ });
10780
+ }
10781
+ return new Promise((resolve, reject) => {
10782
+ if (img.complete) return resolve();
10783
+ img.onload = () => resolve();
10784
+ img.onerror = () => reject(new Error("E_FRAME_UNAVAILABLE"));
10785
+ });
10786
+ }
10750
10787
  var EMPTY_IMAGES = [];
10751
10788
  var DESIGN_BUSY_RETRY_MS = 1500;
10752
10789
  function blockingSessionError(error) {
@@ -10911,7 +10948,13 @@ var HeroProductImage = memo3(function HeroProductImage2({
10911
10948
  const priorityRegisteredRef = useRef24(false);
10912
10949
  const onLoadCalledRef = useRef24(false);
10913
10950
  const prevArtworkSrcRef = useRef24(void 0);
10914
- const realtimeArtworkSrcRef = useRef24(void 0);
10951
+ const artIdentityRef = useRef24(void 0);
10952
+ artIdentityRef.current = artIdentity(artworkSrc || selectedArtworkSrc, placementArtKey);
10953
+ const mountedOnLiveFrame = !!realtimeUrl && (realtimeUrl.startsWith("blob:") || !!actualMockupId && realtimeUrl === realtimeContext?.getMockupUrl?.(actualMockupId));
10954
+ const realtimeArtworkSrcRef = useRef24(
10955
+ mountedOnLiveFrame ? artIdentity(artworkSrc || selectedArtworkSrc, placementArtKey) : void 0
10956
+ );
10957
+ const artSeenRef = useRef24(false);
10915
10958
  const hasReceivedRealtimeRef = useRef24(false);
10916
10959
  const isPendingExportRef = useRef24(false);
10917
10960
  const onUrlGeneratedRef = useRef24(onUrlGenerated);
@@ -10970,6 +11013,7 @@ var HeroProductImage = memo3(function HeroProductImage2({
10970
11013
  const handleMockupResult = (result) => {
10971
11014
  if (!result?.imageUrl) return;
10972
11015
  hasReceivedRealtimeRef.current = true;
11016
+ realtimeArtworkSrcRef.current = artIdentityRef.current;
10973
11017
  isPendingExportRef.current = false;
10974
11018
  const cachedUrl = realtimeContext.getMockupUrl(result.mockupId);
10975
11019
  if (!cachedUrl) return;
@@ -11021,7 +11065,11 @@ var HeroProductImage = memo3(function HeroProductImage2({
11021
11065
  const frameErrorRef = useRef24(null);
11022
11066
  const showVersionOf = useCallback19((url) => {
11023
11067
  const e = versionByUrlRef.current.get(url);
11024
- if (!e || e.v < renderVersionRef.current) return;
11068
+ if (!e) {
11069
+ renderVersionRef.current = 0;
11070
+ renderVersionsRef.current = null;
11071
+ return;
11072
+ }
11025
11073
  renderVersionRef.current = e.v;
11026
11074
  renderVersionsRef.current = e.versions;
11027
11075
  frameErrorRef.current = null;
@@ -11165,8 +11213,11 @@ var HeroProductImage = memo3(function HeroProductImage2({
11165
11213
  lastUrlRef.current = null;
11166
11214
  prevArtworkSrcRef.current = currentSrc;
11167
11215
  onLoadCalledRef.current = false;
11168
- hasReceivedRealtimeRef.current = false;
11169
- realtimeArtworkSrcRef.current = void 0;
11216
+ if (artSeenRef.current) {
11217
+ hasReceivedRealtimeRef.current = false;
11218
+ realtimeArtworkSrcRef.current = void 0;
11219
+ }
11220
+ artSeenRef.current = true;
11170
11221
  }
11171
11222
  }, [artworkSrc, selectedArtworkSrc, placementArtKey]);
11172
11223
  const contextSelectionRef = useRef24(context?.selection);
@@ -11321,8 +11372,9 @@ var HeroProductImage = memo3(function HeroProductImage2({
11321
11372
  const topLayer = layers[layers.length - 1];
11322
11373
  const displayUrl = topLayer?.url || realtimeUrl || initialStaticUrl;
11323
11374
  const CROSSFADE_MS = 400;
11324
- const [prevUrl, setPrevUrl] = useState32(null);
11325
- const [showNew, setShowNew] = useState32(false);
11375
+ const [incoming, setIncoming] = useState32(null);
11376
+ const incomingRef = useRef24(incoming);
11377
+ incomingRef.current = incoming;
11326
11378
  const [renderedUrl, setRenderedUrl] = useState32(displayUrl);
11327
11379
  const renderedUrlRef = useRef24(renderedUrl);
11328
11380
  renderedUrlRef.current = renderedUrl;
@@ -11354,32 +11406,35 @@ var HeroProductImage = memo3(function HeroProductImage2({
11354
11406
  setRenderedUrl(displayUrl);
11355
11407
  return;
11356
11408
  }
11357
- const preload = new Image();
11358
- preload.crossOrigin = "anonymous";
11359
- preload.src = displayUrl;
11360
- const startCrossfade = () => {
11361
- setPrevUrl(oldUrl);
11362
- setRenderedUrl(displayUrl);
11363
- setShowNew(false);
11364
- requestAnimationFrame(() => {
11365
- requestAnimationFrame(() => setShowNew(true));
11366
- });
11367
- };
11368
- if (preload.complete) startCrossfade();
11369
- else preload.onload = startCrossfade;
11370
- preload.onerror = () => {
11371
- frameErrorRef.current = "E_FRAME_UNAVAILABLE";
11372
- frameFailedRef.current?.(displayUrl);
11373
- applyRenderStampRef.current?.();
11374
- };
11375
- return () => {
11376
- preload.onload = null;
11377
- preload.onerror = null;
11378
- };
11409
+ const skipped = incomingRef.current;
11410
+ if (displayUrl === renderedUrlRef.current) {
11411
+ if (skipped && !skipped.ready) frameFailedRef.current?.(skipped.url);
11412
+ setIncoming(null);
11413
+ return;
11414
+ }
11415
+ if (skipped && !skipped.ready && skipped.url !== displayUrl) frameFailedRef.current?.(skipped.url);
11416
+ setIncoming({ url: displayUrl, kind: pictureSwapOf(renderedUrlRef.current, displayUrl), ready: false });
11379
11417
  }, [displayUrl]);
11380
- const handleCrossfadeEnd = useCallback19(() => {
11381
- setPrevUrl(null);
11382
- setShowNew(false);
11418
+ const onIncomingError = useCallback19((url) => {
11419
+ if (incomingRef.current?.url !== url) return;
11420
+ frameErrorRef.current = "E_FRAME_UNAVAILABLE";
11421
+ frameFailedRef.current?.(url);
11422
+ applyRenderStampRef.current?.();
11423
+ setIncoming(null);
11424
+ }, []);
11425
+ const onIncomingLoad = useCallback19((el, url) => {
11426
+ (typeof el.decode === "function" ? decodedPicture(el) : Promise.resolve()).then(
11427
+ () => {
11428
+ const cur = incomingRef.current;
11429
+ if (!cur || cur.url !== url) return;
11430
+ setIncoming({ ...cur, ready: true });
11431
+ if (cur.kind === "instant") setRenderedUrl(url);
11432
+ },
11433
+ () => onIncomingError(url)
11434
+ );
11435
+ }, [onIncomingError]);
11436
+ const onIncomingShown = useCallback19((url) => {
11437
+ if (incomingRef.current?.url === url) setRenderedUrl(url);
11383
11438
  }, []);
11384
11439
  const handleLoaderExited = useCallback19(() => setLoaderMounted(false), []);
11385
11440
  if (!hasArtwork) {
@@ -11438,6 +11493,7 @@ var HeroProductImage = memo3(function HeroProductImage2({
11438
11493
  "data-picture-failed-src": failedSrc,
11439
11494
  "data-mockup-unavailable": unavailable ? unavailable.code : void 0,
11440
11495
  "data-design-refused": designRefused ?? void 0,
11496
+ "data-hero-incoming": incoming ? incoming.ready ? "showing" : "loading" : void 0,
11441
11497
  children: [
11442
11498
  unavailable && /* @__PURE__ */ jsx63(
11443
11499
  "div",
@@ -11474,6 +11530,7 @@ var HeroProductImage = memo3(function HeroProductImage2({
11474
11530
  }
11475
11531
  onUrlGeneratedRef.current?.(renderedUrl);
11476
11532
  if (renderedUrl) onShownRef.current?.(renderedUrl);
11533
+ if (renderedUrl && incomingRef.current?.url === renderedUrl) setIncoming(null);
11477
11534
  },
11478
11535
  onError: () => {
11479
11536
  if (renderedUrl && retriedUrlRef.current !== renderedUrl) {
@@ -11518,7 +11575,7 @@ var HeroProductImage = memo3(function HeroProductImage2({
11518
11575
  },
11519
11576
  retryNonce
11520
11577
  ),
11521
- imgFailed && !prevUrl && /* @__PURE__ */ jsx63("div", { className: "absolute inset-0 flex items-center justify-center bg-muted", children: /* @__PURE__ */ jsx63("p", { className: "text-muted-foreground text-xs", children: unavailableText }) }),
11578
+ imgFailed && !incoming?.ready && /* @__PURE__ */ jsx63("div", { className: "absolute inset-0 flex items-center justify-center bg-muted", children: /* @__PURE__ */ jsx63("p", { className: "text-muted-foreground text-xs", children: unavailableText }) }),
11522
11579
  realtimeContext?.renderError && /* @__PURE__ */ jsx63(
11523
11580
  "div",
11524
11581
  {
@@ -11529,20 +11586,26 @@ var HeroProductImage = memo3(function HeroProductImage2({
11529
11586
  children: realtimeContext.renderError.retryable ? realtimeContext.renderError.message : `Render blocked: ${realtimeContext.renderError.code} \u2014 ${realtimeContext.renderError.message}`
11530
11587
  }
11531
11588
  ),
11532
- prevUrl && /* @__PURE__ */ jsx63(
11589
+ incoming && /* @__PURE__ */ jsx63(
11533
11590
  "img",
11534
11591
  {
11535
11592
  alt: "",
11593
+ "aria-hidden": true,
11536
11594
  crossOrigin: "anonymous",
11537
11595
  className: `absolute inset-0 w-full h-full ${fit === "whole" ? "object-contain" : "object-cover"}`,
11538
- src: prevUrl,
11596
+ src: incoming.url,
11597
+ loading: "eager",
11598
+ decoding: "async",
11539
11599
  style: {
11540
- opacity: showNew ? 0 : 1,
11541
- transition: `opacity ${CROSSFADE_MS}ms ease-in-out`,
11600
+ opacity: incoming.ready ? 1 : 0,
11601
+ transition: incoming.kind === "crossfade" ? `opacity ${CROSSFADE_MS}ms ease-in-out` : void 0,
11542
11602
  pointerEvents: "none"
11543
11603
  },
11544
- onTransitionEnd: handleCrossfadeEnd
11545
- }
11604
+ onLoad: (e) => onIncomingLoad(e.currentTarget, incoming.url),
11605
+ onError: () => onIncomingError(incoming.url),
11606
+ onTransitionEnd: () => onIncomingShown(incoming.url)
11607
+ },
11608
+ incoming.url
11546
11609
  ),
11547
11610
  loaderMounted && /* @__PURE__ */ jsx63(
11548
11611
  LoadingOverlayPrismCandyInline,
@@ -15556,6 +15619,7 @@ function createBridgeFromCanvas(canvasModule) {
15556
15619
  }) });
15557
15620
  };
15558
15621
  }
15622
+ var PERSONALIZATION_EXPORT_DEBOUNCE_MS = 250;
15559
15623
  var cachedCanvasComponent = null;
15560
15624
  var cachedBridgeComponent = null;
15561
15625
  var cachedSerialize = null;
@@ -15614,10 +15678,30 @@ function PersonalizationProvider({
15614
15678
  }
15615
15679
  };
15616
15680
  }, []);
15681
+ const canvasRef = useRef31(null);
15682
+ const lastChangeAtRef = useRef31(0);
15683
+ const lastExportAtRef = useRef31(0);
15617
15684
  const updateField = useCallback27((key, value) => {
15618
15685
  setIsActive(true);
15686
+ lastChangeAtRef.current = Date.now();
15619
15687
  setPersonValues((prev) => ({ ...prev, [key]: value }));
15620
15688
  }, []);
15689
+ const settleMs = (exportConfig?.debounceMs ?? PERSONALIZATION_EXPORT_DEBOUNCE_MS) + (exportConfig?.maxWaitMs ?? 1e3) + 300;
15690
+ useEffect48(() => {
15691
+ if (!isActive || lastChangeAtRef.current === 0) return;
15692
+ const changedAt = lastChangeAtRef.current;
15693
+ const timer = setTimeout(() => {
15694
+ if (lastExportAtRef.current >= changedAt) return;
15695
+ const exportArtboards = canvasRef.current?.exportArtboards;
15696
+ if (!exportArtboards) return;
15697
+ void exportArtboards({ format: "blob", scale: exportConfig?.scale ?? 1, all: false }).then((exports) => {
15698
+ if (lastChangeAtRef.current !== changedAt || lastExportAtRef.current >= changedAt) return;
15699
+ if (exports && Object.keys(exports).length > 0) handleExportRef.current?.(exports);
15700
+ }).catch(() => {
15701
+ });
15702
+ }, settleMs);
15703
+ return () => clearTimeout(timer);
15704
+ }, [personValues, isActive, settleMs, exportConfig?.scale]);
15621
15705
  const reset = useCallback27(() => {
15622
15706
  setPersonValues({});
15623
15707
  setIsActive(false);
@@ -15625,6 +15709,7 @@ function PersonalizationProvider({
15625
15709
  }, []);
15626
15710
  const handleExport = useCallback27(
15627
15711
  (exports) => {
15712
+ lastExportAtRef.current = Date.now();
15628
15713
  const newUrls = {};
15629
15714
  for (const [name, data] of Object.entries(exports)) {
15630
15715
  if (blobUrlsRef.current[name]) {
@@ -15657,6 +15742,10 @@ function PersonalizationProvider({
15657
15742
  },
15658
15743
  [realtime, placementOverride]
15659
15744
  );
15745
+ const handleExportRef = useRef31(null);
15746
+ useEffect48(() => {
15747
+ handleExportRef.current = handleExport;
15748
+ }, [handleExport]);
15660
15749
  const handleExportScheduled = useCallback27(() => {
15661
15750
  setIsExporting(true);
15662
15751
  }, []);
@@ -15691,13 +15780,16 @@ function PersonalizationProvider({
15691
15780
  children: /* @__PURE__ */ jsx91(
15692
15781
  CanvasComponent,
15693
15782
  {
15783
+ ref: canvasRef,
15694
15784
  initialElements: canvasState?.elements,
15695
15785
  artboards: canvasState?.artboards,
15696
15786
  kit: "embed-only",
15697
15787
  inheritTheme: true,
15698
15788
  autoExportConfig: {
15699
15789
  enabled: true,
15700
- debounceMs: exportConfig?.debounceMs ?? 100,
15790
+ // Typing cadence (~100-200 ms a key): one render per pause, not one per key (each render is a new picture
15791
+ // on every mockup); maxWaitMs still shows progress during a long burst.
15792
+ debounceMs: exportConfig?.debounceMs ?? PERSONALIZATION_EXPORT_DEBOUNCE_MS,
15701
15793
  maxWaitMs: exportConfig?.maxWaitMs ?? 1e3
15702
15794
  },
15703
15795
  autoExportFormat: "blob",
@@ -16097,6 +16189,7 @@ export {
16097
16189
  checkTailwindConfig,
16098
16190
  checkThemeTokens,
16099
16191
  createScrollDirectionTracker,
16192
+ decodedPicture,
16100
16193
  describeProductArtAlignment2 as describeProductArtAlignment,
16101
16194
  firstView,
16102
16195
  firstViewAnchorOfSlide,
@@ -16123,6 +16216,7 @@ export {
16123
16216
  normalizeHex,
16124
16217
  observe,
16125
16218
  pictureRenderState,
16219
+ pictureSwapOf,
16126
16220
  placementArtFor,
16127
16221
  runConfigChecks,
16128
16222
  scrollInputAboveKeyboard,