@enadhq/enad-react-sdk 1.0.0 → 1.0.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/README.md +288 -0
- package/dist/client/cart/adapters/brink.d.ts +29 -0
- package/dist/client/cart/adapters/brink.d.ts.map +1 -0
- package/dist/client/cart/adapters/brink.mjs +154 -0
- package/dist/client/cart/adapters/brink.mjs.map +1 -0
- package/dist/client/cart/adapters/index.d.ts +3 -0
- package/dist/client/cart/adapters/index.d.ts.map +1 -0
- package/dist/client/cart/adapters/index.mjs +5 -0
- package/dist/client/cart/adapters/index.mjs.map +1 -0
- package/dist/client/cart/adapters/mock.d.ts +20 -0
- package/dist/client/cart/adapters/mock.d.ts.map +1 -0
- package/dist/client/cart/adapters/mock.mjs +76 -0
- package/dist/client/cart/adapters/mock.mjs.map +1 -0
- package/dist/client/cart/components/cart-drawer.d.ts +17 -0
- package/dist/client/cart/components/cart-drawer.d.ts.map +1 -0
- package/dist/client/cart/components/cart-drawer.mjs +311 -0
- package/dist/client/cart/components/cart-drawer.mjs.map +1 -0
- package/dist/client/cart/components/cart-trigger.d.ts +10 -0
- package/dist/client/cart/components/cart-trigger.d.ts.map +1 -0
- package/dist/client/cart/components/cart-trigger.mjs +34 -0
- package/dist/client/cart/components/cart-trigger.mjs.map +1 -0
- package/dist/client/cart/components/promo-code-input.d.ts +16 -0
- package/dist/client/cart/components/promo-code-input.d.ts.map +1 -0
- package/dist/client/cart/components/promo-code-input.mjs +92 -0
- package/dist/client/cart/components/promo-code-input.mjs.map +1 -0
- package/dist/client/cart/constants/session.d.ts +2 -0
- package/dist/client/cart/constants/session.d.ts.map +1 -0
- package/dist/client/cart/constants/session.mjs +5 -0
- package/dist/client/cart/constants/session.mjs.map +1 -0
- package/dist/client/cart/contexts/cart.d.ts +36 -0
- package/dist/client/cart/contexts/cart.d.ts.map +1 -0
- package/dist/client/cart/contexts/cart.mjs +20 -0
- package/dist/client/cart/contexts/cart.mjs.map +1 -0
- package/dist/client/cart/hooks/useCart.d.ts +26 -0
- package/dist/client/cart/hooks/useCart.d.ts.map +1 -0
- package/dist/client/cart/hooks/useCart.mjs +25 -0
- package/dist/client/cart/hooks/useCart.mjs.map +1 -0
- package/dist/client/cart/hooks/useCartActions.d.ts +25 -0
- package/dist/client/cart/hooks/useCartActions.d.ts.map +1 -0
- package/dist/client/cart/hooks/useCartActions.mjs +49 -0
- package/dist/client/cart/hooks/useCartActions.mjs.map +1 -0
- package/dist/client/cart/index.d.ts +12 -0
- package/dist/client/cart/index.d.ts.map +1 -0
- package/dist/client/cart/index.mjs +16 -0
- package/dist/client/cart/index.mjs.map +1 -0
- package/dist/client/cart/queries/addToCartQueryFn.d.ts +7 -0
- package/dist/client/cart/queries/addToCartQueryFn.d.ts.map +1 -0
- package/dist/client/cart/queries/addToCartQueryFn.mjs +27 -0
- package/dist/client/cart/queries/addToCartQueryFn.mjs.map +1 -0
- package/dist/client/cart/queries/getCartQueryFn.d.ts +4 -0
- package/dist/client/cart/queries/getCartQueryFn.d.ts.map +1 -0
- package/dist/client/cart/queries/getCartQueryFn.mjs +34 -0
- package/dist/client/cart/queries/getCartQueryFn.mjs.map +1 -0
- package/dist/client/cart/queries/removeCartItemQueryFn.d.ts +6 -0
- package/dist/client/cart/queries/removeCartItemQueryFn.d.ts.map +1 -0
- package/dist/client/cart/queries/removeCartItemQueryFn.mjs +24 -0
- package/dist/client/cart/queries/removeCartItemQueryFn.mjs.map +1 -0
- package/dist/client/cart/queries/updateCartItemQueryFn.d.ts +7 -0
- package/dist/client/cart/queries/updateCartItemQueryFn.d.ts.map +1 -0
- package/dist/client/cart/queries/updateCartItemQueryFn.mjs +27 -0
- package/dist/client/cart/queries/updateCartItemQueryFn.mjs.map +1 -0
- package/dist/client/cart/types/adapter.d.ts +110 -0
- package/dist/client/cart/types/adapter.d.ts.map +1 -0
- package/dist/client/cart/types/adapter.mjs +12 -0
- package/dist/client/cart/types/adapter.mjs.map +1 -0
- package/dist/client/cart/types/cart.d.ts +52 -0
- package/dist/client/cart/types/cart.d.ts.map +1 -0
- package/dist/client/cart/types/cart.mjs +1 -0
- package/dist/client/cart/types/cart.mjs.map +1 -0
- package/dist/client/cart/utils/session.d.ts +5 -0
- package/dist/client/cart/utils/session.d.ts.map +1 -0
- package/dist/client/cart/utils/session.mjs +21 -0
- package/dist/client/cart/utils/session.mjs.map +1 -0
- package/dist/client/cms/storyblok/preview/registerStoryblokBridge.d.ts +7 -0
- package/dist/client/cms/storyblok/preview/registerStoryblokBridge.d.ts.map +1 -0
- package/dist/client/cms/storyblok/preview/registerStoryblokBridge.mjs +25 -0
- package/dist/client/cms/storyblok/preview/registerStoryblokBridge.mjs.map +1 -0
- package/dist/client/cms/storyblok/preview/storyblok-preview-syncer.d.ts +20 -0
- package/dist/client/cms/storyblok/preview/storyblok-preview-syncer.d.ts.map +1 -0
- package/dist/client/cms/storyblok/preview/storyblok-preview-syncer.mjs +79 -0
- package/dist/client/cms/storyblok/preview/storyblok-preview-syncer.mjs.map +1 -0
- package/dist/client/global/auth/withAuth.d.ts +5 -0
- package/dist/client/global/auth/withAuth.d.ts.map +1 -0
- package/dist/client/global/auth/withAuth.mjs +25 -0
- package/dist/client/global/auth/withAuth.mjs.map +1 -0
- package/dist/client/global/components/error-boundary.d.ts +18 -0
- package/dist/client/global/components/error-boundary.d.ts.map +1 -0
- package/dist/client/global/components/error-boundary.mjs +41 -0
- package/dist/client/global/components/error-boundary.mjs.map +1 -0
- package/dist/client/global/config/index.d.ts +17 -0
- package/dist/client/global/config/index.d.ts.map +1 -0
- package/dist/client/global/config/index.mjs +34 -0
- package/dist/client/global/config/index.mjs.map +1 -0
- package/dist/client/global/constants/tags.d.ts +15 -0
- package/dist/client/global/constants/tags.d.ts.map +1 -0
- package/dist/client/global/constants/tags.mjs +18 -0
- package/dist/client/global/constants/tags.mjs.map +1 -0
- package/dist/client/global/index.d.ts +6 -0
- package/dist/client/global/index.d.ts.map +1 -0
- package/dist/client/global/index.mjs +7 -0
- package/dist/client/global/index.mjs.map +1 -0
- package/dist/client/global/providers/enad-provider.d.ts +48 -0
- package/dist/client/global/providers/enad-provider.d.ts.map +1 -0
- package/dist/client/global/providers/enad-provider.mjs +40 -0
- package/dist/client/global/providers/enad-provider.mjs.map +1 -0
- package/dist/client/icons/adapters/hugeicons.d.ts +9 -0
- package/dist/client/icons/adapters/hugeicons.d.ts.map +1 -0
- package/dist/client/icons/adapters/hugeicons.mjs +117 -0
- package/dist/client/icons/adapters/hugeicons.mjs.map +1 -0
- package/dist/client/icons/adapters/lucide.d.ts +8 -0
- package/dist/client/icons/adapters/lucide.d.ts.map +1 -0
- package/dist/client/icons/adapters/lucide.mjs +108 -0
- package/dist/client/icons/adapters/lucide.mjs.map +1 -0
- package/dist/client/icons/adapters/phosphor.d.ts +11 -0
- package/dist/client/icons/adapters/phosphor.d.ts.map +1 -0
- package/dist/client/icons/adapters/phosphor.mjs +108 -0
- package/dist/client/icons/adapters/phosphor.mjs.map +1 -0
- package/dist/client/icons/icon-context.d.ts +13 -0
- package/dist/client/icons/icon-context.d.ts.map +1 -0
- package/dist/client/icons/icon-context.mjs +27 -0
- package/dist/client/icons/icon-context.mjs.map +1 -0
- package/dist/client/icons/index.d.ts +9 -0
- package/dist/client/icons/index.d.ts.map +1 -0
- package/dist/client/icons/index.mjs +16 -0
- package/dist/client/icons/index.mjs.map +1 -0
- package/dist/client/icons/types.d.ts +60 -0
- package/dist/client/icons/types.d.ts.map +1 -0
- package/dist/client/icons/types.mjs +1 -0
- package/dist/client/icons/types.mjs.map +1 -0
- package/dist/client/motion/config.d.ts +42 -0
- package/dist/client/motion/config.d.ts.map +1 -0
- package/dist/client/motion/config.mjs +44 -0
- package/dist/client/motion/config.mjs.map +1 -0
- package/dist/client/motion/hover.d.ts +36 -0
- package/dist/client/motion/hover.d.ts.map +1 -0
- package/dist/client/motion/hover.mjs +19 -0
- package/dist/client/motion/hover.mjs.map +1 -0
- package/dist/client/motion/index.d.ts +4 -0
- package/dist/client/motion/index.d.ts.map +1 -0
- package/dist/client/motion/index.mjs +13 -0
- package/dist/client/motion/index.mjs.map +1 -0
- package/dist/client/motion/stagger.d.ts +36 -0
- package/dist/client/motion/stagger.d.ts.map +1 -0
- package/dist/client/motion/stagger.mjs +17 -0
- package/dist/client/motion/stagger.mjs.map +1 -0
- package/dist/client/search/actions/searchAction.d.ts +2 -0
- package/dist/client/search/actions/searchAction.d.ts.map +1 -0
- package/dist/client/search/actions/searchAction.mjs +18 -0
- package/dist/client/search/actions/searchAction.mjs.map +1 -0
- package/dist/client/search/components/search-bar.d.ts +8 -0
- package/dist/client/search/components/search-bar.d.ts.map +1 -0
- package/dist/client/search/components/search-bar.mjs +34 -0
- package/dist/client/search/components/search-bar.mjs.map +1 -0
- package/dist/client/search/hooks/useSearch.d.ts +14 -0
- package/dist/client/search/hooks/useSearch.d.ts.map +1 -0
- package/dist/client/search/hooks/useSearch.mjs +37 -0
- package/dist/client/search/hooks/useSearch.mjs.map +1 -0
- package/dist/client/search/index.d.ts +2 -0
- package/dist/client/search/index.d.ts.map +1 -0
- package/dist/client/search/index.mjs +5 -0
- package/dist/client/search/index.mjs.map +1 -0
- package/dist/client/storefront/blocks/accordion-block.d.ts +4 -0
- package/dist/client/storefront/blocks/accordion-block.d.ts.map +1 -0
- package/dist/client/storefront/blocks/accordion-block.mjs +43 -0
- package/dist/client/storefront/blocks/accordion-block.mjs.map +1 -0
- package/dist/client/storefront/blocks/card-image-with-caption.d.ts +4 -0
- package/dist/client/storefront/blocks/card-image-with-caption.d.ts.map +1 -0
- package/dist/client/storefront/blocks/card-image-with-caption.mjs +27 -0
- package/dist/client/storefront/blocks/card-image-with-caption.mjs.map +1 -0
- package/dist/client/storefront/blocks/card-video.d.ts +4 -0
- package/dist/client/storefront/blocks/card-video.d.ts.map +1 -0
- package/dist/client/storefront/blocks/card-video.mjs +43 -0
- package/dist/client/storefront/blocks/card-video.mjs.map +1 -0
- package/dist/client/storefront/blocks/content-with-gallery.d.ts +4 -0
- package/dist/client/storefront/blocks/content-with-gallery.d.ts.map +1 -0
- package/dist/client/storefront/blocks/content-with-gallery.mjs +48 -0
- package/dist/client/storefront/blocks/content-with-gallery.mjs.map +1 -0
- package/dist/client/storefront/blocks/content-with-image-product-data.d.ts +4 -0
- package/dist/client/storefront/blocks/content-with-image-product-data.d.ts.map +1 -0
- package/dist/client/storefront/blocks/content-with-image-product-data.mjs +45 -0
- package/dist/client/storefront/blocks/content-with-image-product-data.mjs.map +1 -0
- package/dist/client/storefront/blocks/gallery-with-caption.d.ts +4 -0
- package/dist/client/storefront/blocks/gallery-with-caption.d.ts.map +1 -0
- package/dist/client/storefront/blocks/gallery-with-caption.mjs +36 -0
- package/dist/client/storefront/blocks/gallery-with-caption.mjs.map +1 -0
- package/dist/client/storefront/blocks/gallery-with-link-blocks.d.ts +4 -0
- package/dist/client/storefront/blocks/gallery-with-link-blocks.d.ts.map +1 -0
- package/dist/client/storefront/blocks/gallery-with-link-blocks.mjs +24 -0
- package/dist/client/storefront/blocks/gallery-with-link-blocks.mjs.map +1 -0
- package/dist/client/storefront/blocks/gallery.d.ts +4 -0
- package/dist/client/storefront/blocks/gallery.d.ts.map +1 -0
- package/dist/client/storefront/blocks/gallery.mjs +47 -0
- package/dist/client/storefront/blocks/gallery.mjs.map +1 -0
- package/dist/client/storefront/blocks/hero.d.ts +4 -0
- package/dist/client/storefront/blocks/hero.d.ts.map +1 -0
- package/dist/client/storefront/blocks/hero.mjs +357 -0
- package/dist/client/storefront/blocks/hero.mjs.map +1 -0
- package/dist/client/storefront/blocks/image-block.d.ts +4 -0
- package/dist/client/storefront/blocks/image-block.d.ts.map +1 -0
- package/dist/client/storefront/blocks/image-block.mjs +29 -0
- package/dist/client/storefront/blocks/image-block.mjs.map +1 -0
- package/dist/client/storefront/blocks/index.d.ts +20 -0
- package/dist/client/storefront/blocks/index.d.ts.map +1 -0
- package/dist/client/storefront/blocks/index.mjs +41 -0
- package/dist/client/storefront/blocks/index.mjs.map +1 -0
- package/dist/client/storefront/blocks/link-block-small.d.ts +4 -0
- package/dist/client/storefront/blocks/link-block-small.d.ts.map +1 -0
- package/dist/client/storefront/blocks/link-block-small.mjs +35 -0
- package/dist/client/storefront/blocks/link-block-small.mjs.map +1 -0
- package/dist/client/storefront/blocks/link-block.d.ts +4 -0
- package/dist/client/storefront/blocks/link-block.d.ts.map +1 -0
- package/dist/client/storefront/blocks/link-block.mjs +150 -0
- package/dist/client/storefront/blocks/link-block.mjs.map +1 -0
- package/dist/client/storefront/blocks/product-card.d.ts +4 -0
- package/dist/client/storefront/blocks/product-card.d.ts.map +1 -0
- package/dist/client/storefront/blocks/product-card.mjs +228 -0
- package/dist/client/storefront/blocks/product-card.mjs.map +1 -0
- package/dist/client/storefront/blocks/product-image.d.ts +4 -0
- package/dist/client/storefront/blocks/product-image.d.ts.map +1 -0
- package/dist/client/storefront/blocks/product-image.mjs +109 -0
- package/dist/client/storefront/blocks/product-image.mjs.map +1 -0
- package/dist/client/storefront/blocks/spacer.d.ts +4 -0
- package/dist/client/storefront/blocks/spacer.d.ts.map +1 -0
- package/dist/client/storefront/blocks/spacer.mjs +14 -0
- package/dist/client/storefront/blocks/spacer.mjs.map +1 -0
- package/dist/client/storefront/blocks/text-content-with-image.d.ts +4 -0
- package/dist/client/storefront/blocks/text-content-with-image.d.ts.map +1 -0
- package/dist/client/storefront/blocks/text-content-with-image.mjs +225 -0
- package/dist/client/storefront/blocks/text-content-with-image.mjs.map +1 -0
- package/dist/client/storefront/blocks/text-content.d.ts +4 -0
- package/dist/client/storefront/blocks/text-content.d.ts.map +1 -0
- package/dist/client/storefront/blocks/text-content.mjs +150 -0
- package/dist/client/storefront/blocks/text-content.mjs.map +1 -0
- package/dist/client/storefront/blocks/truncated-text.d.ts +4 -0
- package/dist/client/storefront/blocks/truncated-text.d.ts.map +1 -0
- package/dist/client/storefront/blocks/truncated-text.mjs +36 -0
- package/dist/client/storefront/blocks/truncated-text.mjs.map +1 -0
- package/dist/client/storefront/blocks/variable-text-content.d.ts +4 -0
- package/dist/client/storefront/blocks/variable-text-content.d.ts.map +1 -0
- package/dist/client/storefront/blocks/variable-text-content.mjs +15 -0
- package/dist/client/storefront/blocks/variable-text-content.mjs.map +1 -0
- package/dist/client/storefront/carousel/index.d.ts +2 -0
- package/dist/client/storefront/carousel/index.d.ts.map +1 -0
- package/dist/client/storefront/carousel/index.mjs +5 -0
- package/dist/client/storefront/carousel/index.mjs.map +1 -0
- package/dist/client/storefront/carousel/swipeable-carousel.d.ts +14 -0
- package/dist/client/storefront/carousel/swipeable-carousel.d.ts.map +1 -0
- package/dist/client/storefront/carousel/swipeable-carousel.mjs +80 -0
- package/dist/client/storefront/carousel/swipeable-carousel.mjs.map +1 -0
- package/dist/client/storefront/checkout/address-form.d.ts +31 -0
- package/dist/client/storefront/checkout/address-form.d.ts.map +1 -0
- package/dist/client/storefront/checkout/address-form.mjs +124 -0
- package/dist/client/storefront/checkout/address-form.mjs.map +1 -0
- package/dist/client/storefront/checkout/cart-summary.d.ts +40 -0
- package/dist/client/storefront/checkout/cart-summary.d.ts.map +1 -0
- package/dist/client/storefront/checkout/cart-summary.mjs +150 -0
- package/dist/client/storefront/checkout/cart-summary.mjs.map +1 -0
- package/dist/client/storefront/checkout/checkout-stepper.d.ts +13 -0
- package/dist/client/storefront/checkout/checkout-stepper.d.ts.map +1 -0
- package/dist/client/storefront/checkout/checkout-stepper.mjs +58 -0
- package/dist/client/storefront/checkout/checkout-stepper.mjs.map +1 -0
- package/dist/client/storefront/checkout/index.d.ts +15 -0
- package/dist/client/storefront/checkout/index.d.ts.map +1 -0
- package/dist/client/storefront/checkout/index.mjs +17 -0
- package/dist/client/storefront/checkout/index.mjs.map +1 -0
- package/dist/client/storefront/checkout/order-confirmation.d.ts +10 -0
- package/dist/client/storefront/checkout/order-confirmation.d.ts.map +1 -0
- package/dist/client/storefront/checkout/order-confirmation.mjs +27 -0
- package/dist/client/storefront/checkout/order-confirmation.mjs.map +1 -0
- package/dist/client/storefront/checkout/order-summary.d.ts +29 -0
- package/dist/client/storefront/checkout/order-summary.d.ts.map +1 -0
- package/dist/client/storefront/checkout/order-summary.mjs +106 -0
- package/dist/client/storefront/checkout/order-summary.mjs.map +1 -0
- package/dist/client/storefront/checkout/payment-method-selector.d.ts +18 -0
- package/dist/client/storefront/checkout/payment-method-selector.d.ts.map +1 -0
- package/dist/client/storefront/checkout/payment-method-selector.mjs +61 -0
- package/dist/client/storefront/checkout/payment-method-selector.mjs.map +1 -0
- package/dist/client/storefront/checkout/shipping-method-selector.d.ts +23 -0
- package/dist/client/storefront/checkout/shipping-method-selector.d.ts.map +1 -0
- package/dist/client/storefront/checkout/shipping-method-selector.mjs +77 -0
- package/dist/client/storefront/checkout/shipping-method-selector.mjs.map +1 -0
- package/dist/client/storefront/components/badge.d.ts +8 -0
- package/dist/client/storefront/components/badge.d.ts.map +1 -0
- package/dist/client/storefront/components/badge.mjs +28 -0
- package/dist/client/storefront/components/badge.mjs.map +1 -0
- package/dist/client/storefront/components/country-redirect.d.ts +30 -0
- package/dist/client/storefront/components/country-redirect.d.ts.map +1 -0
- package/dist/client/storefront/components/country-redirect.mjs +121 -0
- package/dist/client/storefront/components/country-redirect.mjs.map +1 -0
- package/dist/client/storefront/components/empty-state.d.ts +38 -0
- package/dist/client/storefront/components/empty-state.d.ts.map +1 -0
- package/dist/client/storefront/components/empty-state.mjs +55 -0
- package/dist/client/storefront/components/empty-state.mjs.map +1 -0
- package/dist/client/storefront/components/image-lightbox.d.ts +13 -0
- package/dist/client/storefront/components/image-lightbox.d.ts.map +1 -0
- package/dist/client/storefront/components/image-lightbox.mjs +275 -0
- package/dist/client/storefront/components/image-lightbox.mjs.map +1 -0
- package/dist/client/storefront/components/infinite-scroll.d.ts +37 -0
- package/dist/client/storefront/components/infinite-scroll.d.ts.map +1 -0
- package/dist/client/storefront/components/infinite-scroll.mjs +83 -0
- package/dist/client/storefront/components/infinite-scroll.mjs.map +1 -0
- package/dist/client/storefront/components/language-selector.d.ts +5 -0
- package/dist/client/storefront/components/language-selector.d.ts.map +1 -0
- package/dist/client/storefront/components/language-selector.mjs +58 -0
- package/dist/client/storefront/components/language-selector.mjs.map +1 -0
- package/dist/client/storefront/components/newsletter-signup.d.ts +14 -0
- package/dist/client/storefront/components/newsletter-signup.d.ts.map +1 -0
- package/dist/client/storefront/components/newsletter-signup.mjs +81 -0
- package/dist/client/storefront/components/newsletter-signup.mjs.map +1 -0
- package/dist/client/storefront/components/price.d.ts +14 -0
- package/dist/client/storefront/components/price.d.ts.map +1 -0
- package/dist/client/storefront/components/price.mjs +46 -0
- package/dist/client/storefront/components/price.mjs.map +1 -0
- package/dist/client/storefront/components/product-recommendations.d.ts +18 -0
- package/dist/client/storefront/components/product-recommendations.d.ts.map +1 -0
- package/dist/client/storefront/components/product-recommendations.mjs +108 -0
- package/dist/client/storefront/components/product-recommendations.mjs.map +1 -0
- package/dist/client/storefront/components/product-tabs.d.ts +12 -0
- package/dist/client/storefront/components/product-tabs.d.ts.map +1 -0
- package/dist/client/storefront/components/product-tabs.mjs +64 -0
- package/dist/client/storefront/components/product-tabs.mjs.map +1 -0
- package/dist/client/storefront/components/quick-view.d.ts +25 -0
- package/dist/client/storefront/components/quick-view.d.ts.map +1 -0
- package/dist/client/storefront/components/quick-view.mjs +149 -0
- package/dist/client/storefront/components/quick-view.mjs.map +1 -0
- package/dist/client/storefront/components/review-summary.d.ts +17 -0
- package/dist/client/storefront/components/review-summary.d.ts.map +1 -0
- package/dist/client/storefront/components/review-summary.mjs +66 -0
- package/dist/client/storefront/components/review-summary.mjs.map +1 -0
- package/dist/client/storefront/components/search-autocomplete.d.ts +25 -0
- package/dist/client/storefront/components/search-autocomplete.d.ts.map +1 -0
- package/dist/client/storefront/components/search-autocomplete.mjs +183 -0
- package/dist/client/storefront/components/search-autocomplete.mjs.map +1 -0
- package/dist/client/storefront/components/section-nav.d.ts +20 -0
- package/dist/client/storefront/components/section-nav.d.ts.map +1 -0
- package/dist/client/storefront/components/section-nav.mjs +175 -0
- package/dist/client/storefront/components/section-nav.mjs.map +1 -0
- package/dist/client/storefront/components/share-button.d.ts +19 -0
- package/dist/client/storefront/components/share-button.d.ts.map +1 -0
- package/dist/client/storefront/components/share-button.mjs +95 -0
- package/dist/client/storefront/components/share-button.mjs.map +1 -0
- package/dist/client/storefront/components/skeleton.d.ts +12 -0
- package/dist/client/storefront/components/skeleton.d.ts.map +1 -0
- package/dist/client/storefront/components/skeleton.mjs +70 -0
- package/dist/client/storefront/components/skeleton.mjs.map +1 -0
- package/dist/client/storefront/components/star-rating.d.ts +13 -0
- package/dist/client/storefront/components/star-rating.d.ts.map +1 -0
- package/dist/client/storefront/components/star-rating.mjs +240 -0
- package/dist/client/storefront/components/star-rating.mjs.map +1 -0
- package/dist/client/storefront/components/testimonial.d.ts +20 -0
- package/dist/client/storefront/components/testimonial.d.ts.map +1 -0
- package/dist/client/storefront/components/testimonial.mjs +53 -0
- package/dist/client/storefront/components/testimonial.mjs.map +1 -0
- package/dist/client/storefront/components/trust-badges.d.ts +14 -0
- package/dist/client/storefront/components/trust-badges.d.ts.map +1 -0
- package/dist/client/storefront/components/trust-badges.mjs +25 -0
- package/dist/client/storefront/components/trust-badges.mjs.map +1 -0
- package/dist/client/storefront/components/variant-selector.d.ts +21 -0
- package/dist/client/storefront/components/variant-selector.d.ts.map +1 -0
- package/dist/client/storefront/components/variant-selector.mjs +41 -0
- package/dist/client/storefront/components/variant-selector.mjs.map +1 -0
- package/dist/client/storefront/components/wishlist-toggle.d.ts +12 -0
- package/dist/client/storefront/components/wishlist-toggle.d.ts.map +1 -0
- package/dist/client/storefront/components/wishlist-toggle.mjs +58 -0
- package/dist/client/storefront/components/wishlist-toggle.mjs.map +1 -0
- package/dist/client/storefront/filters/filter-chip.d.ts +10 -0
- package/dist/client/storefront/filters/filter-chip.d.ts.map +1 -0
- package/dist/client/storefront/filters/filter-chip.mjs +30 -0
- package/dist/client/storefront/filters/filter-chip.mjs.map +1 -0
- package/dist/client/storefront/filters/filter-group.d.ts +22 -0
- package/dist/client/storefront/filters/filter-group.d.ts.map +1 -0
- package/dist/client/storefront/filters/filter-group.mjs +102 -0
- package/dist/client/storefront/filters/filter-group.mjs.map +1 -0
- package/dist/client/storefront/filters/filter-panel.d.ts +25 -0
- package/dist/client/storefront/filters/filter-panel.d.ts.map +1 -0
- package/dist/client/storefront/filters/filter-panel.mjs +110 -0
- package/dist/client/storefront/filters/filter-panel.mjs.map +1 -0
- package/dist/client/storefront/filters/index.d.ts +6 -0
- package/dist/client/storefront/filters/index.d.ts.map +1 -0
- package/dist/client/storefront/filters/index.mjs +13 -0
- package/dist/client/storefront/filters/index.mjs.map +1 -0
- package/dist/client/storefront/filters/sort-select.d.ts +12 -0
- package/dist/client/storefront/filters/sort-select.d.ts.map +1 -0
- package/dist/client/storefront/filters/sort-select.mjs +34 -0
- package/dist/client/storefront/filters/sort-select.mjs.map +1 -0
- package/dist/client/storefront/filters/toggle-list-view.d.ts +8 -0
- package/dist/client/storefront/filters/toggle-list-view.d.ts.map +1 -0
- package/dist/client/storefront/filters/toggle-list-view.mjs +30 -0
- package/dist/client/storefront/filters/toggle-list-view.mjs.map +1 -0
- package/dist/client/storefront/hooks/use-section-observer.d.ts +12 -0
- package/dist/client/storefront/hooks/use-section-observer.d.ts.map +1 -0
- package/dist/client/storefront/hooks/use-section-observer.mjs +46 -0
- package/dist/client/storefront/hooks/use-section-observer.mjs.map +1 -0
- package/dist/client/storefront/index.d.ts +24 -0
- package/dist/client/storefront/index.d.ts.map +1 -0
- package/dist/client/storefront/index.mjs +26 -0
- package/dist/client/storefront/index.mjs.map +1 -0
- package/dist/client/storefront/layout/footer.d.ts +4 -0
- package/dist/client/storefront/layout/footer.d.ts.map +1 -0
- package/dist/client/storefront/layout/footer.mjs +56 -0
- package/dist/client/storefront/layout/footer.mjs.map +1 -0
- package/dist/client/storefront/layout/header.d.ts +4 -0
- package/dist/client/storefront/layout/header.d.ts.map +1 -0
- package/dist/client/storefront/layout/header.mjs +367 -0
- package/dist/client/storefront/layout/header.mjs.map +1 -0
- package/dist/client/storefront/layout/index.d.ts +5 -0
- package/dist/client/storefront/layout/index.d.ts.map +1 -0
- package/dist/client/storefront/layout/index.mjs +11 -0
- package/dist/client/storefront/layout/index.mjs.map +1 -0
- package/dist/client/storefront/layout/mobile-menu-drawer.d.ts +4 -0
- package/dist/client/storefront/layout/mobile-menu-drawer.d.ts.map +1 -0
- package/dist/client/storefront/layout/mobile-menu-drawer.mjs +93 -0
- package/dist/client/storefront/layout/mobile-menu-drawer.mjs.map +1 -0
- package/dist/client/storefront/layout/promotion-bar.d.ts +4 -0
- package/dist/client/storefront/layout/promotion-bar.d.ts.map +1 -0
- package/dist/client/storefront/layout/promotion-bar.mjs +79 -0
- package/dist/client/storefront/layout/promotion-bar.mjs.map +1 -0
- package/dist/client/storefront/primitives/breadcrumbs.d.ts +12 -0
- package/dist/client/storefront/primitives/breadcrumbs.d.ts.map +1 -0
- package/dist/client/storefront/primitives/breadcrumbs.mjs +37 -0
- package/dist/client/storefront/primitives/breadcrumbs.mjs.map +1 -0
- package/dist/client/storefront/primitives/button.d.ts +12 -0
- package/dist/client/storefront/primitives/button.d.ts.map +1 -0
- package/dist/client/storefront/primitives/button.mjs +51 -0
- package/dist/client/storefront/primitives/button.mjs.map +1 -0
- package/dist/client/storefront/primitives/checkbox.d.ts +10 -0
- package/dist/client/storefront/primitives/checkbox.d.ts.map +1 -0
- package/dist/client/storefront/primitives/checkbox.mjs +23 -0
- package/dist/client/storefront/primitives/checkbox.mjs.map +1 -0
- package/dist/client/storefront/primitives/download-item.d.ts +9 -0
- package/dist/client/storefront/primitives/download-item.d.ts.map +1 -0
- package/dist/client/storefront/primitives/download-item.mjs +28 -0
- package/dist/client/storefront/primitives/download-item.mjs.map +1 -0
- package/dist/client/storefront/primitives/index.d.ts +10 -0
- package/dist/client/storefront/primitives/index.d.ts.map +1 -0
- package/dist/client/storefront/primitives/index.mjs +21 -0
- package/dist/client/storefront/primitives/index.mjs.map +1 -0
- package/dist/client/storefront/primitives/input.d.ts +18 -0
- package/dist/client/storefront/primitives/input.d.ts.map +1 -0
- package/dist/client/storefront/primitives/input.mjs +118 -0
- package/dist/client/storefront/primitives/input.mjs.map +1 -0
- package/dist/client/storefront/primitives/pagination.d.ts +9 -0
- package/dist/client/storefront/primitives/pagination.d.ts.map +1 -0
- package/dist/client/storefront/primitives/pagination.mjs +86 -0
- package/dist/client/storefront/primitives/pagination.mjs.map +1 -0
- package/dist/client/storefront/primitives/quick-links.d.ts +11 -0
- package/dist/client/storefront/primitives/quick-links.d.ts.map +1 -0
- package/dist/client/storefront/primitives/quick-links.mjs +17 -0
- package/dist/client/storefront/primitives/quick-links.mjs.map +1 -0
- package/dist/client/storefront/primitives/select.d.ts +16 -0
- package/dist/client/storefront/primitives/select.d.ts.map +1 -0
- package/dist/client/storefront/primitives/select.mjs +35 -0
- package/dist/client/storefront/primitives/select.mjs.map +1 -0
- package/dist/client/storefront/primitives/text-link.d.ts +7 -0
- package/dist/client/storefront/primitives/text-link.d.ts.map +1 -0
- package/dist/client/storefront/primitives/text-link.mjs +10 -0
- package/dist/client/storefront/primitives/text-link.mjs.map +1 -0
- package/dist/client/storefront/product/color-swatch.d.ts +10 -0
- package/dist/client/storefront/product/color-swatch.d.ts.map +1 -0
- package/dist/client/storefront/product/color-swatch.mjs +32 -0
- package/dist/client/storefront/product/color-swatch.mjs.map +1 -0
- package/dist/client/storefront/product/index.d.ts +5 -0
- package/dist/client/storefront/product/index.d.ts.map +1 -0
- package/dist/client/storefront/product/index.mjs +11 -0
- package/dist/client/storefront/product/index.mjs.map +1 -0
- package/dist/client/storefront/product/material-selector.d.ts +15 -0
- package/dist/client/storefront/product/material-selector.d.ts.map +1 -0
- package/dist/client/storefront/product/material-selector.mjs +35 -0
- package/dist/client/storefront/product/material-selector.mjs.map +1 -0
- package/dist/client/storefront/product/product-usp.d.ts +7 -0
- package/dist/client/storefront/product/product-usp.d.ts.map +1 -0
- package/dist/client/storefront/product/product-usp.mjs +14 -0
- package/dist/client/storefront/product/product-usp.mjs.map +1 -0
- package/dist/client/storefront/product/quantity-picker.d.ts +10 -0
- package/dist/client/storefront/product/quantity-picker.d.ts.map +1 -0
- package/dist/client/storefront/product/quantity-picker.mjs +56 -0
- package/dist/client/storefront/product/quantity-picker.mjs.map +1 -0
- package/dist/client/storefront/types.d.ts +284 -0
- package/dist/client/storefront/types.d.ts.map +1 -0
- package/dist/client/storefront/types.mjs +20 -0
- package/dist/client/storefront/types.mjs.map +1 -0
- package/dist/client/theme/apply.d.ts +17 -0
- package/dist/client/theme/apply.d.ts.map +1 -0
- package/dist/client/theme/apply.mjs +133 -0
- package/dist/client/theme/apply.mjs.map +1 -0
- package/dist/client/theme/cli.d.ts +2 -0
- package/dist/client/theme/cli.d.ts.map +1 -0
- package/dist/client/theme/cli.mjs +453 -0
- package/dist/client/theme/cli.mjs.map +1 -0
- package/dist/client/theme/codec.d.ts +28 -0
- package/dist/client/theme/codec.d.ts.map +1 -0
- package/dist/client/theme/codec.mjs +88 -0
- package/dist/client/theme/codec.mjs.map +1 -0
- package/dist/client/theme/defaults.d.ts +64 -0
- package/dist/client/theme/defaults.d.ts.map +1 -0
- package/dist/client/theme/defaults.mjs +158 -0
- package/dist/client/theme/defaults.mjs.map +1 -0
- package/dist/client/theme/index.d.ts +8 -0
- package/dist/client/theme/index.d.ts.map +1 -0
- package/dist/client/theme/index.mjs +20 -0
- package/dist/client/theme/index.mjs.map +1 -0
- package/dist/client/theme/scan.d.ts +16 -0
- package/dist/client/theme/scan.d.ts.map +1 -0
- package/dist/client/theme/scan.mjs +25 -0
- package/dist/client/theme/scan.mjs.map +1 -0
- package/dist/client/ui/accordion.d.ts +8 -0
- package/dist/client/ui/accordion.d.ts.map +1 -0
- package/dist/client/ui/accordion.mjs +66 -0
- package/dist/client/ui/accordion.mjs.map +1 -0
- package/dist/client/ui/breadcrumb.d.ts +12 -0
- package/dist/client/ui/breadcrumb.d.ts.map +1 -0
- package/dist/client/ui/breadcrumb.mjs +104 -0
- package/dist/client/ui/breadcrumb.mjs.map +1 -0
- package/dist/client/ui/button.d.ts +11 -0
- package/dist/client/ui/button.d.ts.map +1 -0
- package/dist/client/ui/button.mjs +57 -0
- package/dist/client/ui/button.mjs.map +1 -0
- package/dist/client/ui/card.d.ts +10 -0
- package/dist/client/ui/card.d.ts.map +1 -0
- package/dist/client/ui/card.mjs +91 -0
- package/dist/client/ui/card.mjs.map +1 -0
- package/dist/client/ui/carousel.d.ts +20 -0
- package/dist/client/ui/carousel.d.ts.map +1 -0
- package/dist/client/ui/carousel.mjs +202 -0
- package/dist/client/ui/carousel.mjs.map +1 -0
- package/dist/client/ui/checkbox.d.ts +5 -0
- package/dist/client/ui/checkbox.d.ts.map +1 -0
- package/dist/client/ui/checkbox.mjs +34 -0
- package/dist/client/ui/checkbox.mjs.map +1 -0
- package/dist/client/ui/collapsible.d.ts +6 -0
- package/dist/client/ui/collapsible.d.ts.map +1 -0
- package/dist/client/ui/collapsible.mjs +36 -0
- package/dist/client/ui/collapsible.mjs.map +1 -0
- package/dist/client/ui/input.d.ts +4 -0
- package/dist/client/ui/input.d.ts.map +1 -0
- package/dist/client/ui/input.mjs +22 -0
- package/dist/client/ui/input.mjs.map +1 -0
- package/dist/client/ui/label.d.ts +5 -0
- package/dist/client/ui/label.d.ts.map +1 -0
- package/dist/client/ui/label.mjs +23 -0
- package/dist/client/ui/label.mjs.map +1 -0
- package/dist/client/ui/mid-truncate.d.ts +27 -0
- package/dist/client/ui/mid-truncate.d.ts.map +1 -0
- package/dist/client/ui/mid-truncate.mjs +25 -0
- package/dist/client/ui/mid-truncate.mjs.map +1 -0
- package/dist/client/ui/navigation-menu.d.ts +15 -0
- package/dist/client/ui/navigation-menu.d.ts.map +1 -0
- package/dist/client/ui/navigation-menu.mjs +172 -0
- package/dist/client/ui/navigation-menu.mjs.map +1 -0
- package/dist/client/ui/pagination.d.ts +14 -0
- package/dist/client/ui/pagination.d.ts.map +1 -0
- package/dist/client/ui/pagination.mjs +124 -0
- package/dist/client/ui/pagination.mjs.map +1 -0
- package/dist/client/ui/popover.d.ts +11 -0
- package/dist/client/ui/popover.d.ts.map +1 -0
- package/dist/client/ui/popover.mjs +82 -0
- package/dist/client/ui/popover.mjs.map +1 -0
- package/dist/client/ui/select.d.ts +16 -0
- package/dist/client/ui/select.d.ts.map +1 -0
- package/dist/client/ui/select.mjs +183 -0
- package/dist/client/ui/select.mjs.map +1 -0
- package/dist/client/ui/separator.d.ts +5 -0
- package/dist/client/ui/separator.d.ts.map +1 -0
- package/dist/client/ui/separator.mjs +27 -0
- package/dist/client/ui/separator.mjs.map +1 -0
- package/dist/client/ui/sheet.d.ts +15 -0
- package/dist/client/ui/sheet.d.ts.map +1 -0
- package/dist/client/ui/sheet.mjs +130 -0
- package/dist/client/ui/sheet.mjs.map +1 -0
- package/dist/client/ui/toggle-group.d.ts +10 -0
- package/dist/client/ui/toggle-group.d.ts.map +1 -0
- package/dist/client/ui/toggle-group.mjs +69 -0
- package/dist/client/ui/toggle-group.mjs.map +1 -0
- package/dist/client/ui/toggle.d.ts +10 -0
- package/dist/client/ui/toggle.d.ts.map +1 -0
- package/dist/client/ui/toggle.mjs +44 -0
- package/dist/client/ui/toggle.mjs.map +1 -0
- package/dist/client/ui/utils.d.ts +3 -0
- package/dist/client/ui/utils.d.ts.map +1 -0
- package/dist/client/ui/utils.mjs +9 -0
- package/dist/client/ui/utils.mjs.map +1 -0
- package/dist/client/ui-interfaces/accordion.d.ts +8 -0
- package/dist/client/ui-interfaces/accordion.d.ts.map +1 -0
- package/dist/client/ui-interfaces/accordion.mjs +72 -0
- package/dist/client/ui-interfaces/accordion.mjs.map +1 -0
- package/dist/client/ui-interfaces/breadcrumb.d.ts +12 -0
- package/dist/client/ui-interfaces/breadcrumb.d.ts.map +1 -0
- package/dist/client/ui-interfaces/breadcrumb.mjs +97 -0
- package/dist/client/ui-interfaces/breadcrumb.mjs.map +1 -0
- package/dist/client/ui-interfaces/button.d.ts +11 -0
- package/dist/client/ui-interfaces/button.d.ts.map +1 -0
- package/dist/client/ui-interfaces/button.mjs +57 -0
- package/dist/client/ui-interfaces/button.mjs.map +1 -0
- package/dist/client/ui-interfaces/card.d.ts +10 -0
- package/dist/client/ui-interfaces/card.d.ts.map +1 -0
- package/dist/client/ui-interfaces/card.mjs +78 -0
- package/dist/client/ui-interfaces/card.mjs.map +1 -0
- package/dist/client/ui-interfaces/carousel.d.ts +20 -0
- package/dist/client/ui-interfaces/carousel.d.ts.map +1 -0
- package/dist/client/ui-interfaces/carousel.mjs +188 -0
- package/dist/client/ui-interfaces/carousel.mjs.map +1 -0
- package/dist/client/ui-interfaces/checkbox.d.ts +5 -0
- package/dist/client/ui-interfaces/checkbox.d.ts.map +1 -0
- package/dist/client/ui-interfaces/checkbox.mjs +30 -0
- package/dist/client/ui-interfaces/checkbox.mjs.map +1 -0
- package/dist/client/ui-interfaces/collapsible.d.ts +7 -0
- package/dist/client/ui-interfaces/collapsible.d.ts.map +1 -0
- package/dist/client/ui-interfaces/collapsible.mjs +42 -0
- package/dist/client/ui-interfaces/collapsible.mjs.map +1 -0
- package/dist/client/ui-interfaces/index.d.ts +18 -0
- package/dist/client/ui-interfaces/index.d.ts.map +1 -0
- package/dist/client/ui-interfaces/index.mjs +18 -0
- package/dist/client/ui-interfaces/index.mjs.map +1 -0
- package/dist/client/ui-interfaces/input.d.ts +7 -0
- package/dist/client/ui-interfaces/input.d.ts.map +1 -0
- package/dist/client/ui-interfaces/input.mjs +39 -0
- package/dist/client/ui-interfaces/input.mjs.map +1 -0
- package/dist/client/ui-interfaces/label.d.ts +5 -0
- package/dist/client/ui-interfaces/label.d.ts.map +1 -0
- package/dist/client/ui-interfaces/label.mjs +23 -0
- package/dist/client/ui-interfaces/label.mjs.map +1 -0
- package/dist/client/ui-interfaces/navigation-menu.d.ts +15 -0
- package/dist/client/ui-interfaces/navigation-menu.d.ts.map +1 -0
- package/dist/client/ui-interfaces/navigation-menu.mjs +163 -0
- package/dist/client/ui-interfaces/navigation-menu.mjs.map +1 -0
- package/dist/client/ui-interfaces/pagination.d.ts +14 -0
- package/dist/client/ui-interfaces/pagination.d.ts.map +1 -0
- package/dist/client/ui-interfaces/pagination.mjs +103 -0
- package/dist/client/ui-interfaces/pagination.mjs.map +1 -0
- package/dist/client/ui-interfaces/popover.d.ts +8 -0
- package/dist/client/ui-interfaces/popover.d.ts.map +1 -0
- package/dist/client/ui-interfaces/popover.mjs +50 -0
- package/dist/client/ui-interfaces/popover.mjs.map +1 -0
- package/dist/client/ui-interfaces/select.d.ts +16 -0
- package/dist/client/ui-interfaces/select.d.ts.map +1 -0
- package/dist/client/ui-interfaces/select.mjs +159 -0
- package/dist/client/ui-interfaces/select.mjs.map +1 -0
- package/dist/client/ui-interfaces/separator.d.ts +5 -0
- package/dist/client/ui-interfaces/separator.d.ts.map +1 -0
- package/dist/client/ui-interfaces/separator.mjs +28 -0
- package/dist/client/ui-interfaces/separator.mjs.map +1 -0
- package/dist/client/ui-interfaces/sheet.d.ts +14 -0
- package/dist/client/ui-interfaces/sheet.d.ts.map +1 -0
- package/dist/client/ui-interfaces/sheet.mjs +140 -0
- package/dist/client/ui-interfaces/sheet.mjs.map +1 -0
- package/dist/client/ui-interfaces/toggle-group.d.ts +10 -0
- package/dist/client/ui-interfaces/toggle-group.d.ts.map +1 -0
- package/dist/client/ui-interfaces/toggle-group.mjs +67 -0
- package/dist/client/ui-interfaces/toggle-group.mjs.map +1 -0
- package/dist/client/ui-interfaces/toggle.d.ts +10 -0
- package/dist/client/ui-interfaces/toggle.d.ts.map +1 -0
- package/dist/client/ui-interfaces/toggle.mjs +45 -0
- package/dist/client/ui-interfaces/toggle.mjs.map +1 -0
- package/dist/client/ui-resolver/accordion.d.ts +11 -0
- package/dist/client/ui-resolver/accordion.d.ts.map +1 -0
- package/dist/client/ui-resolver/accordion.mjs +35 -0
- package/dist/client/ui-resolver/accordion.mjs.map +1 -0
- package/dist/client/ui-resolver/breadcrumb.d.ts +14 -0
- package/dist/client/ui-resolver/breadcrumb.d.ts.map +1 -0
- package/dist/client/ui-resolver/breadcrumb.mjs +53 -0
- package/dist/client/ui-resolver/breadcrumb.mjs.map +1 -0
- package/dist/client/ui-resolver/button.d.ts +12 -0
- package/dist/client/ui-resolver/button.d.ts.map +1 -0
- package/dist/client/ui-resolver/button.mjs +25 -0
- package/dist/client/ui-resolver/button.mjs.map +1 -0
- package/dist/client/ui-resolver/card.d.ts +14 -0
- package/dist/client/ui-resolver/card.d.ts.map +1 -0
- package/dist/client/ui-resolver/card.mjs +53 -0
- package/dist/client/ui-resolver/card.mjs.map +1 -0
- package/dist/client/ui-resolver/carousel.d.ts +13 -0
- package/dist/client/ui-resolver/carousel.d.ts.map +1 -0
- package/dist/client/ui-resolver/carousel.mjs +41 -0
- package/dist/client/ui-resolver/carousel.mjs.map +1 -0
- package/dist/client/ui-resolver/checkbox.d.ts +8 -0
- package/dist/client/ui-resolver/checkbox.d.ts.map +1 -0
- package/dist/client/ui-resolver/checkbox.mjs +17 -0
- package/dist/client/ui-resolver/checkbox.mjs.map +1 -0
- package/dist/client/ui-resolver/collapsible.d.ts +10 -0
- package/dist/client/ui-resolver/collapsible.d.ts.map +1 -0
- package/dist/client/ui-resolver/collapsible.mjs +29 -0
- package/dist/client/ui-resolver/collapsible.mjs.map +1 -0
- package/dist/client/ui-resolver/context.d.ts +10 -0
- package/dist/client/ui-resolver/context.d.ts.map +1 -0
- package/dist/client/ui-resolver/context.mjs +28 -0
- package/dist/client/ui-resolver/context.mjs.map +1 -0
- package/dist/client/ui-resolver/index.d.ts +19 -0
- package/dist/client/ui-resolver/index.d.ts.map +1 -0
- package/dist/client/ui-resolver/index.mjs +156 -0
- package/dist/client/ui-resolver/index.mjs.map +1 -0
- package/dist/client/ui-resolver/input.d.ts +8 -0
- package/dist/client/ui-resolver/input.d.ts.map +1 -0
- package/dist/client/ui-resolver/input.mjs +17 -0
- package/dist/client/ui-resolver/input.mjs.map +1 -0
- package/dist/client/ui-resolver/label.d.ts +8 -0
- package/dist/client/ui-resolver/label.d.ts.map +1 -0
- package/dist/client/ui-resolver/label.mjs +17 -0
- package/dist/client/ui-resolver/label.mjs.map +1 -0
- package/dist/client/ui-resolver/navigation-menu.d.ts +16 -0
- package/dist/client/ui-resolver/navigation-menu.d.ts.map +1 -0
- package/dist/client/ui-resolver/navigation-menu.mjs +64 -0
- package/dist/client/ui-resolver/navigation-menu.mjs.map +1 -0
- package/dist/client/ui-resolver/pagination.d.ts +14 -0
- package/dist/client/ui-resolver/pagination.d.ts.map +1 -0
- package/dist/client/ui-resolver/pagination.mjs +53 -0
- package/dist/client/ui-resolver/pagination.mjs.map +1 -0
- package/dist/client/ui-resolver/popover.d.ts +11 -0
- package/dist/client/ui-resolver/popover.d.ts.map +1 -0
- package/dist/client/ui-resolver/popover.mjs +35 -0
- package/dist/client/ui-resolver/popover.mjs.map +1 -0
- package/dist/client/ui-resolver/select.d.ts +15 -0
- package/dist/client/ui-resolver/select.d.ts.map +1 -0
- package/dist/client/ui-resolver/select.mjs +59 -0
- package/dist/client/ui-resolver/select.mjs.map +1 -0
- package/dist/client/ui-resolver/separator.d.ts +8 -0
- package/dist/client/ui-resolver/separator.d.ts.map +1 -0
- package/dist/client/ui-resolver/separator.mjs +17 -0
- package/dist/client/ui-resolver/separator.mjs.map +1 -0
- package/dist/client/ui-resolver/sheet.d.ts +15 -0
- package/dist/client/ui-resolver/sheet.d.ts.map +1 -0
- package/dist/client/ui-resolver/sheet.mjs +59 -0
- package/dist/client/ui-resolver/sheet.mjs.map +1 -0
- package/dist/client/ui-resolver/toggle-group.d.ts +9 -0
- package/dist/client/ui-resolver/toggle-group.d.ts.map +1 -0
- package/dist/client/ui-resolver/toggle-group.mjs +23 -0
- package/dist/client/ui-resolver/toggle-group.mjs.map +1 -0
- package/dist/client/ui-resolver/toggle.d.ts +12 -0
- package/dist/client/ui-resolver/toggle.d.ts.map +1 -0
- package/dist/client/ui-resolver/toggle.mjs +25 -0
- package/dist/client/ui-resolver/toggle.mjs.map +1 -0
- package/dist/client/user/actions/createResetPasswordLinkAction.d.ts +14 -0
- package/dist/client/user/actions/createResetPasswordLinkAction.d.ts.map +1 -0
- package/dist/client/user/actions/createResetPasswordLinkAction.mjs +30 -0
- package/dist/client/user/actions/createResetPasswordLinkAction.mjs.map +1 -0
- package/dist/client/user/actions/getUserAction.d.ts +3 -0
- package/dist/client/user/actions/getUserAction.d.ts.map +1 -0
- package/dist/client/user/actions/getUserAction.mjs +19 -0
- package/dist/client/user/actions/getUserAction.mjs.map +1 -0
- package/dist/client/user/actions/logInUserAction.d.ts +15 -0
- package/dist/client/user/actions/logInUserAction.d.ts.map +1 -0
- package/dist/client/user/actions/logInUserAction.mjs +34 -0
- package/dist/client/user/actions/logInUserAction.mjs.map +1 -0
- package/dist/client/user/actions/logoutUserAction.d.ts +2 -0
- package/dist/client/user/actions/logoutUserAction.d.ts.map +1 -0
- package/dist/client/user/actions/logoutUserAction.mjs +10 -0
- package/dist/client/user/actions/logoutUserAction.mjs.map +1 -0
- package/dist/client/user/actions/registerOrganisationAction.d.ts +9 -0
- package/dist/client/user/actions/registerOrganisationAction.d.ts.map +1 -0
- package/dist/client/user/actions/registerOrganisationAction.mjs +18 -0
- package/dist/client/user/actions/registerOrganisationAction.mjs.map +1 -0
- package/dist/client/user/actions/registerUserAction.d.ts +18 -0
- package/dist/client/user/actions/registerUserAction.d.ts.map +1 -0
- package/dist/client/user/actions/registerUserAction.mjs +42 -0
- package/dist/client/user/actions/registerUserAction.mjs.map +1 -0
- package/dist/client/user/actions/registerUserWithoutRedirectAction.d.ts +41 -0
- package/dist/client/user/actions/registerUserWithoutRedirectAction.d.ts.map +1 -0
- package/dist/client/user/actions/registerUserWithoutRedirectAction.mjs +58 -0
- package/dist/client/user/actions/registerUserWithoutRedirectAction.mjs.map +1 -0
- package/dist/client/user/actions/updatePasswordAction.d.ts +21 -0
- package/dist/client/user/actions/updatePasswordAction.d.ts.map +1 -0
- package/dist/client/user/actions/updatePasswordAction.mjs +37 -0
- package/dist/client/user/actions/updatePasswordAction.mjs.map +1 -0
- package/dist/client/user/api/userRoute.d.ts +7 -0
- package/dist/client/user/api/userRoute.d.ts.map +1 -0
- package/dist/client/user/api/userRoute.mjs +65 -0
- package/dist/client/user/api/userRoute.mjs.map +1 -0
- package/dist/client/user/clients/enad.d.ts +4 -0
- package/dist/client/user/clients/enad.d.ts.map +1 -0
- package/dist/client/user/clients/enad.mjs +19 -0
- package/dist/client/user/clients/enad.mjs.map +1 -0
- package/dist/client/user/components/login-form.d.ts +23 -0
- package/dist/client/user/components/login-form.d.ts.map +1 -0
- package/dist/client/user/components/login-form.mjs +117 -0
- package/dist/client/user/components/login-form.mjs.map +1 -0
- package/dist/client/user/components/reset-password-form.d.ts +20 -0
- package/dist/client/user/components/reset-password-form.d.ts.map +1 -0
- package/dist/client/user/components/reset-password-form.mjs +93 -0
- package/dist/client/user/components/reset-password-form.mjs.map +1 -0
- package/dist/client/user/components/sign-out.d.ts +8 -0
- package/dist/client/user/components/sign-out.d.ts.map +1 -0
- package/dist/client/user/components/sign-out.mjs +26 -0
- package/dist/client/user/components/sign-out.mjs.map +1 -0
- package/dist/client/user/components/signup-form.d.ts +27 -0
- package/dist/client/user/components/signup-form.d.ts.map +1 -0
- package/dist/client/user/components/signup-form.mjs +188 -0
- package/dist/client/user/components/signup-form.mjs.map +1 -0
- package/dist/client/user/components/signup-organisation-form.d.ts +55 -0
- package/dist/client/user/components/signup-organisation-form.d.ts.map +1 -0
- package/dist/client/user/components/signup-organisation-form.mjs +864 -0
- package/dist/client/user/components/signup-organisation-form.mjs.map +1 -0
- package/dist/client/user/components/update-password-form.d.ts +17 -0
- package/dist/client/user/components/update-password-form.d.ts.map +1 -0
- package/dist/client/user/components/update-password-form.mjs +60 -0
- package/dist/client/user/components/update-password-form.mjs.map +1 -0
- package/dist/client/user/hooks/index.d.ts +2 -0
- package/dist/client/user/hooks/index.d.ts.map +1 -0
- package/dist/client/user/hooks/index.mjs +2 -0
- package/dist/client/user/hooks/index.mjs.map +1 -0
- package/dist/client/user/hooks/useUser.d.ts +12 -0
- package/dist/client/user/hooks/useUser.d.ts.map +1 -0
- package/dist/client/user/hooks/useUser.mjs +32 -0
- package/dist/client/user/hooks/useUser.mjs.map +1 -0
- package/dist/client/user/index.d.ts +9 -0
- package/dist/client/user/index.d.ts.map +1 -0
- package/dist/client/user/index.mjs +17 -0
- package/dist/client/user/index.mjs.map +1 -0
- package/dist/client/user/types/user.d.ts +201 -0
- package/dist/client/user/types/user.d.ts.map +1 -0
- package/dist/client/user/types/user.mjs +1 -0
- package/dist/client/user/types/user.mjs.map +1 -0
- package/dist/client/user/utils/userCookieService.d.ts +19 -0
- package/dist/client/user/utils/userCookieService.d.ts.map +1 -0
- package/dist/client/user/utils/userCookieService.mjs +51 -0
- package/dist/client/user/utils/userCookieService.mjs.map +1 -0
- package/dist/client/wishlist/actions/addItemsToWishlistAction.d.ts +5 -0
- package/dist/client/wishlist/actions/addItemsToWishlistAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/addItemsToWishlistAction.mjs +20 -0
- package/dist/client/wishlist/actions/addItemsToWishlistAction.mjs.map +1 -0
- package/dist/client/wishlist/actions/createOrGetShareTokenAction.d.ts +3 -0
- package/dist/client/wishlist/actions/createOrGetShareTokenAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/createOrGetShareTokenAction.mjs +20 -0
- package/dist/client/wishlist/actions/createOrGetShareTokenAction.mjs.map +1 -0
- package/dist/client/wishlist/actions/createWishlistAction.d.ts +3 -0
- package/dist/client/wishlist/actions/createWishlistAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/createWishlistAction.mjs +16 -0
- package/dist/client/wishlist/actions/createWishlistAction.mjs.map +1 -0
- package/dist/client/wishlist/actions/deleteItemsFromWishlistAction.d.ts +5 -0
- package/dist/client/wishlist/actions/deleteItemsFromWishlistAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/deleteItemsFromWishlistAction.mjs +20 -0
- package/dist/client/wishlist/actions/deleteItemsFromWishlistAction.mjs.map +1 -0
- package/dist/client/wishlist/actions/deleteWishlistAction.d.ts +4 -0
- package/dist/client/wishlist/actions/deleteWishlistAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/deleteWishlistAction.mjs +16 -0
- package/dist/client/wishlist/actions/deleteWishlistAction.mjs.map +1 -0
- package/dist/client/wishlist/actions/getSharedWishlistAction.d.ts +3 -0
- package/dist/client/wishlist/actions/getSharedWishlistAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/getSharedWishlistAction.mjs +20 -0
- package/dist/client/wishlist/actions/getSharedWishlistAction.mjs.map +1 -0
- package/dist/client/wishlist/actions/getSpecificWishlistAction.d.ts +3 -0
- package/dist/client/wishlist/actions/getSpecificWishlistAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/getSpecificWishlistAction.mjs +20 -0
- package/dist/client/wishlist/actions/getSpecificWishlistAction.mjs.map +1 -0
- package/dist/client/wishlist/actions/getUserWishlists.d.ts +4 -0
- package/dist/client/wishlist/actions/getUserWishlists.d.ts.map +1 -0
- package/dist/client/wishlist/actions/getUserWishlists.mjs +25 -0
- package/dist/client/wishlist/actions/getUserWishlists.mjs.map +1 -0
- package/dist/client/wishlist/actions/revokeShareTokenAction.d.ts +4 -0
- package/dist/client/wishlist/actions/revokeShareTokenAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/revokeShareTokenAction.mjs +20 -0
- package/dist/client/wishlist/actions/revokeShareTokenAction.mjs.map +1 -0
- package/dist/client/wishlist/actions/updateWishlistAction.d.ts +3 -0
- package/dist/client/wishlist/actions/updateWishlistAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/updateWishlistAction.mjs +20 -0
- package/dist/client/wishlist/actions/updateWishlistAction.mjs.map +1 -0
- package/dist/client/wishlist/hooks/index.d.ts +2 -0
- package/dist/client/wishlist/hooks/index.d.ts.map +1 -0
- package/dist/client/wishlist/hooks/index.mjs +2 -0
- package/dist/client/wishlist/hooks/index.mjs.map +1 -0
- package/dist/client/wishlist/hooks/useWishlist.d.ts +95 -0
- package/dist/client/wishlist/hooks/useWishlist.d.ts.map +1 -0
- package/dist/client/wishlist/hooks/useWishlist.mjs +76 -0
- package/dist/client/wishlist/hooks/useWishlist.mjs.map +1 -0
- package/dist/client/wishlist/hooks/useWishlistActions.d.ts +44 -0
- package/dist/client/wishlist/hooks/useWishlistActions.d.ts.map +1 -0
- package/dist/client/wishlist/hooks/useWishlistActions.mjs +101 -0
- package/dist/client/wishlist/hooks/useWishlistActions.mjs.map +1 -0
- package/dist/client/wishlist/index.d.ts +5 -0
- package/dist/client/wishlist/index.d.ts.map +1 -0
- package/dist/client/wishlist/index.mjs +9 -0
- package/dist/client/wishlist/index.mjs.map +1 -0
- package/dist/client/wishlist/wishlist-drawer.d.ts +17 -0
- package/dist/client/wishlist/wishlist-drawer.d.ts.map +1 -0
- package/dist/client/wishlist/wishlist-drawer.mjs +199 -0
- package/dist/client/wishlist/wishlist-drawer.mjs.map +1 -0
- package/dist/styles.css +2 -0
- package/package.json +54 -32
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/client/theme/cli.ts
|
|
4
|
+
import { readFileSync, writeFileSync, readdirSync, statSync } from "fs";
|
|
5
|
+
import { resolve, join } from "path";
|
|
6
|
+
import { argv, exit, stderr, stdout } from "process";
|
|
7
|
+
|
|
8
|
+
// src/client/theme/codec.ts
|
|
9
|
+
import { decode as msgpackDecode, encode as msgpackEncode } from "@msgpack/msgpack";
|
|
10
|
+
var FORMAT_VERSION = "1";
|
|
11
|
+
var KEY_MAP = {
|
|
12
|
+
c: "colorize",
|
|
13
|
+
i: "intensity",
|
|
14
|
+
d: "delight",
|
|
15
|
+
r: "radius",
|
|
16
|
+
bf: "fontBody",
|
|
17
|
+
hf: "fontHeading",
|
|
18
|
+
ic: "iconSet",
|
|
19
|
+
cs: "colorSpace",
|
|
20
|
+
dm: "darkMode",
|
|
21
|
+
lc: "lightColors",
|
|
22
|
+
dc: "darkColors",
|
|
23
|
+
br: "buttonRadius",
|
|
24
|
+
cr: "cardRadius",
|
|
25
|
+
ir: "inputRadius",
|
|
26
|
+
mr: "imageRadius",
|
|
27
|
+
sp: "shadowPreset",
|
|
28
|
+
sc: "shadowColor",
|
|
29
|
+
hw: "headingWeight",
|
|
30
|
+
ht: "headingTracking",
|
|
31
|
+
bw: "bodyWeight",
|
|
32
|
+
hx: "headingTransform",
|
|
33
|
+
bdr: "borderWidth",
|
|
34
|
+
oc: "overlayColor",
|
|
35
|
+
of: "overlayFromOpacity",
|
|
36
|
+
ot: "overlayToOpacity",
|
|
37
|
+
hs: "imageHoverScale",
|
|
38
|
+
hd: "imageHoverDuration",
|
|
39
|
+
v: "variants",
|
|
40
|
+
xs: "componentSet"
|
|
41
|
+
};
|
|
42
|
+
var KEY_MAP_REVERSE = Object.fromEntries(
|
|
43
|
+
Object.entries(KEY_MAP).map(([short, full]) => [full, short])
|
|
44
|
+
);
|
|
45
|
+
function fromBase64url(str) {
|
|
46
|
+
const base64 = str.replace(/-/g, "+").replace(/_/g, "/");
|
|
47
|
+
const padded = base64 + "=".repeat((4 - base64.length % 4) % 4);
|
|
48
|
+
const binary = atob(padded);
|
|
49
|
+
const bytes = new Uint8Array(binary.length);
|
|
50
|
+
for (let i = 0; i < binary.length; i++) {
|
|
51
|
+
bytes[i] = binary.charCodeAt(i);
|
|
52
|
+
}
|
|
53
|
+
return bytes;
|
|
54
|
+
}
|
|
55
|
+
function decodeThemeHash(hash) {
|
|
56
|
+
try {
|
|
57
|
+
if (!hash || hash.length < 2) return {};
|
|
58
|
+
const version = hash[0];
|
|
59
|
+
if (version !== FORMAT_VERSION) return {};
|
|
60
|
+
const payload = hash.slice(1);
|
|
61
|
+
const bytes = fromBase64url(payload);
|
|
62
|
+
const compact = msgpackDecode(bytes);
|
|
63
|
+
if (typeof compact !== "object" || compact === null) return {};
|
|
64
|
+
const result = {};
|
|
65
|
+
for (const [key, value] of Object.entries(compact)) {
|
|
66
|
+
const fullKey = KEY_MAP[key] ?? key;
|
|
67
|
+
result[fullKey] = value;
|
|
68
|
+
}
|
|
69
|
+
return result;
|
|
70
|
+
} catch {
|
|
71
|
+
return {};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// src/client/theme/defaults.ts
|
|
76
|
+
var SDK_DEFAULTS = {
|
|
77
|
+
light: {
|
|
78
|
+
"--background": "#ffffff",
|
|
79
|
+
"--foreground": "#111827",
|
|
80
|
+
"--card": "#ffffff",
|
|
81
|
+
"--card-foreground": "#111827",
|
|
82
|
+
"--popover": "#ffffff",
|
|
83
|
+
"--popover-foreground": "#111827",
|
|
84
|
+
"--primary": "#2563eb",
|
|
85
|
+
"--primary-foreground": "#ffffff",
|
|
86
|
+
"--secondary": "#f1f5f9",
|
|
87
|
+
"--secondary-foreground": "#0f172a",
|
|
88
|
+
"--muted": "#f3f4f6",
|
|
89
|
+
"--muted-foreground": "#636b78",
|
|
90
|
+
"--accent": "#dbeafe",
|
|
91
|
+
"--accent-foreground": "#1e3a8a",
|
|
92
|
+
"--accent-muted": "#eff6ff",
|
|
93
|
+
"--accent-muted-foreground": "#1e40af",
|
|
94
|
+
"--destructive": "#dc2626",
|
|
95
|
+
"--destructive-foreground": "#ffffff",
|
|
96
|
+
"--border": "#e5e7eb",
|
|
97
|
+
"--input": "#e5e7eb",
|
|
98
|
+
"--ring": "#2563eb"
|
|
99
|
+
},
|
|
100
|
+
dark: {
|
|
101
|
+
"--background": "#111827",
|
|
102
|
+
"--foreground": "#f9fafb",
|
|
103
|
+
"--card": "#1f2937",
|
|
104
|
+
"--card-foreground": "#f9fafb",
|
|
105
|
+
"--popover": "#1f2937",
|
|
106
|
+
"--popover-foreground": "#f9fafb",
|
|
107
|
+
"--primary": "#2563eb",
|
|
108
|
+
"--primary-foreground": "#ffffff",
|
|
109
|
+
"--secondary": "#1e293b",
|
|
110
|
+
"--secondary-foreground": "#e2e8f0",
|
|
111
|
+
"--muted": "#374151",
|
|
112
|
+
"--muted-foreground": "#b0b8c4",
|
|
113
|
+
"--accent": "#1e3a5f",
|
|
114
|
+
"--accent-foreground": "#bfdbfe",
|
|
115
|
+
"--accent-muted": "#172554",
|
|
116
|
+
"--accent-muted-foreground": "#93c5fd",
|
|
117
|
+
"--destructive": "#dc2626",
|
|
118
|
+
"--destructive-foreground": "#ffffff",
|
|
119
|
+
"--border": "#374151",
|
|
120
|
+
"--input": "#374151",
|
|
121
|
+
"--ring": "#2563eb"
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
var TOKEN_DEFAULTS = {
|
|
125
|
+
colorize: 50,
|
|
126
|
+
intensity: 50,
|
|
127
|
+
delight: 50,
|
|
128
|
+
radius: 0.75,
|
|
129
|
+
fontBody: "Inter",
|
|
130
|
+
fontHeading: "Inter",
|
|
131
|
+
iconSet: "Phosphor",
|
|
132
|
+
colorSpace: "hsl",
|
|
133
|
+
darkMode: false,
|
|
134
|
+
componentSet: "default",
|
|
135
|
+
// Shape
|
|
136
|
+
buttonRadius: "9999px",
|
|
137
|
+
cardRadius: "var(--radius)",
|
|
138
|
+
inputRadius: "var(--radius)",
|
|
139
|
+
imageRadius: "0px",
|
|
140
|
+
// Depth
|
|
141
|
+
shadowPreset: "none",
|
|
142
|
+
shadowColor: "oklch(0 0 0 / 0.1)",
|
|
143
|
+
// Typography
|
|
144
|
+
headingWeight: "600",
|
|
145
|
+
headingTracking: "0em",
|
|
146
|
+
bodyWeight: "400",
|
|
147
|
+
headingTransform: "none",
|
|
148
|
+
// Border
|
|
149
|
+
borderWidth: "1px",
|
|
150
|
+
// Overlay
|
|
151
|
+
overlayColor: "black",
|
|
152
|
+
overlayFromOpacity: "0.5",
|
|
153
|
+
overlayToOpacity: "0",
|
|
154
|
+
// Motion
|
|
155
|
+
imageHoverScale: "1.05",
|
|
156
|
+
imageHoverDuration: "300ms",
|
|
157
|
+
// Variants
|
|
158
|
+
variants: {
|
|
159
|
+
hero: "overlay",
|
|
160
|
+
linkBlock: "overlay",
|
|
161
|
+
productCard: "gallery",
|
|
162
|
+
contentWithImage: "side-by-side",
|
|
163
|
+
gallery: "grid",
|
|
164
|
+
textContent: "default"
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
// src/client/theme/apply.ts
|
|
169
|
+
function buildLightColorDiffs(hash) {
|
|
170
|
+
const lightOverrides = hash.lightColors ?? {};
|
|
171
|
+
const diffs = [];
|
|
172
|
+
for (const [token, value] of Object.entries(lightOverrides)) {
|
|
173
|
+
if (value !== SDK_DEFAULTS.light[token]) {
|
|
174
|
+
diffs.push(` ${token}: ${value};`);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return diffs;
|
|
178
|
+
}
|
|
179
|
+
function buildBaseTokenDiffs(hash) {
|
|
180
|
+
const diffs = [];
|
|
181
|
+
const radius = hash.radius;
|
|
182
|
+
if (radius != null && radius !== 0.75) {
|
|
183
|
+
diffs.push(` --radius: ${radius}rem;`);
|
|
184
|
+
}
|
|
185
|
+
const fontBody = hash.fontBody;
|
|
186
|
+
if (fontBody && fontBody !== "Inter") {
|
|
187
|
+
diffs.push(` --font-sans: "${fontBody}", sans-serif;`);
|
|
188
|
+
}
|
|
189
|
+
const fontHeading = hash.fontHeading;
|
|
190
|
+
if (fontHeading && fontHeading !== fontBody && fontHeading !== "Inter") {
|
|
191
|
+
diffs.push(` --font-heading: "${fontHeading}", sans-serif;`);
|
|
192
|
+
}
|
|
193
|
+
return diffs;
|
|
194
|
+
}
|
|
195
|
+
function buildDarkColorDiffs(hash) {
|
|
196
|
+
const darkOverrides = hash.darkColors ?? {};
|
|
197
|
+
const diffs = [];
|
|
198
|
+
for (const [token, value] of Object.entries(darkOverrides)) {
|
|
199
|
+
if (value !== SDK_DEFAULTS.dark[token]) {
|
|
200
|
+
diffs.push(` ${token}: ${value};`);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
return diffs;
|
|
204
|
+
}
|
|
205
|
+
function buildTokenSections(hash) {
|
|
206
|
+
const lines = [];
|
|
207
|
+
const tokenSections = [
|
|
208
|
+
{
|
|
209
|
+
comment: "Shape",
|
|
210
|
+
entries: [
|
|
211
|
+
["--enad-button-radius", hash.buttonRadius, TOKEN_DEFAULTS.buttonRadius],
|
|
212
|
+
["--enad-card-radius", hash.cardRadius, TOKEN_DEFAULTS.cardRadius],
|
|
213
|
+
["--enad-input-radius", hash.inputRadius, TOKEN_DEFAULTS.inputRadius],
|
|
214
|
+
["--enad-image-radius", hash.imageRadius, TOKEN_DEFAULTS.imageRadius]
|
|
215
|
+
]
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
comment: "Depth",
|
|
219
|
+
entries: [
|
|
220
|
+
["--enad-shadow-color", hash.shadowColor, TOKEN_DEFAULTS.shadowColor]
|
|
221
|
+
]
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
comment: "Typography",
|
|
225
|
+
entries: [
|
|
226
|
+
["--enad-heading-weight", hash.headingWeight, TOKEN_DEFAULTS.headingWeight],
|
|
227
|
+
["--enad-heading-tracking", hash.headingTracking, TOKEN_DEFAULTS.headingTracking],
|
|
228
|
+
["--enad-body-weight", hash.bodyWeight, TOKEN_DEFAULTS.bodyWeight],
|
|
229
|
+
["--enad-heading-transform", hash.headingTransform, TOKEN_DEFAULTS.headingTransform]
|
|
230
|
+
]
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
comment: "Borders",
|
|
234
|
+
entries: [
|
|
235
|
+
["--enad-border-width", hash.borderWidth, TOKEN_DEFAULTS.borderWidth]
|
|
236
|
+
]
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
comment: "Overlay",
|
|
240
|
+
entries: [
|
|
241
|
+
["--enad-overlay-color", hash.overlayColor, TOKEN_DEFAULTS.overlayColor],
|
|
242
|
+
["--enad-overlay-from-opacity", hash.overlayFromOpacity, TOKEN_DEFAULTS.overlayFromOpacity],
|
|
243
|
+
["--enad-overlay-to-opacity", hash.overlayToOpacity, TOKEN_DEFAULTS.overlayToOpacity]
|
|
244
|
+
]
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
comment: "Motion",
|
|
248
|
+
entries: [
|
|
249
|
+
["--enad-image-hover-scale", hash.imageHoverScale, TOKEN_DEFAULTS.imageHoverScale],
|
|
250
|
+
["--enad-image-hover-duration", hash.imageHoverDuration, TOKEN_DEFAULTS.imageHoverDuration]
|
|
251
|
+
]
|
|
252
|
+
}
|
|
253
|
+
];
|
|
254
|
+
for (const section of tokenSections) {
|
|
255
|
+
const sectionLines = [];
|
|
256
|
+
for (const [varName, value, defaultValue] of section.entries) {
|
|
257
|
+
if (value != null && value !== defaultValue) {
|
|
258
|
+
sectionLines.push(` ${varName}: ${value};`);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
if (sectionLines.length > 0) {
|
|
262
|
+
lines.push("", `/* ${section.comment} */`, ":root {", ...sectionLines, "}");
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
return lines;
|
|
266
|
+
}
|
|
267
|
+
function generateThemeCSS(hash, _options = {}) {
|
|
268
|
+
const lines = ["/* Generated by enad-theme */"];
|
|
269
|
+
const lightDiffs = [...buildLightColorDiffs(hash), ...buildBaseTokenDiffs(hash)];
|
|
270
|
+
if (lightDiffs.length > 0) {
|
|
271
|
+
lines.push("", ":root {", ...lightDiffs, "}");
|
|
272
|
+
}
|
|
273
|
+
const darkDiffs = buildDarkColorDiffs(hash);
|
|
274
|
+
if (darkDiffs.length > 0) {
|
|
275
|
+
lines.push("", ".dark {", ...darkDiffs, "}");
|
|
276
|
+
}
|
|
277
|
+
lines.push(...buildTokenSections(hash));
|
|
278
|
+
return lines.join("\n");
|
|
279
|
+
}
|
|
280
|
+
var MARKER_START = "/* === enad-theme:start === */";
|
|
281
|
+
var MARKER_END = "/* === enad-theme:end === */";
|
|
282
|
+
function applyThemeBlock(fileContent, cssBlock) {
|
|
283
|
+
const startIdx = fileContent.indexOf(MARKER_START);
|
|
284
|
+
const endIdx = fileContent.indexOf(MARKER_END);
|
|
285
|
+
const block = `${MARKER_START}
|
|
286
|
+
${cssBlock}
|
|
287
|
+
${MARKER_END}`;
|
|
288
|
+
if (startIdx !== -1 && endIdx !== -1) {
|
|
289
|
+
return fileContent.slice(0, startIdx) + block + fileContent.slice(endIdx + MARKER_END.length);
|
|
290
|
+
}
|
|
291
|
+
const separator = fileContent.length > 0 && !fileContent.endsWith("\n") ? "\n" : "";
|
|
292
|
+
return fileContent + separator + "\n" + block + "\n";
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// src/client/theme/scan.ts
|
|
296
|
+
function scanConflicts(files, variables) {
|
|
297
|
+
if (variables.length === 0) return [];
|
|
298
|
+
const warnings = [];
|
|
299
|
+
const varSet = new Set(variables);
|
|
300
|
+
for (const file of files) {
|
|
301
|
+
const lines = file.content.split("\n");
|
|
302
|
+
for (let i = 0; i < lines.length; i++) {
|
|
303
|
+
const line = lines[i];
|
|
304
|
+
const match = line.match(/^\s*(--[\w-]+)\s*:\s*(.+?)\s*;?\s*$/);
|
|
305
|
+
if (match && varSet.has(match[1])) {
|
|
306
|
+
warnings.push({
|
|
307
|
+
file: file.path,
|
|
308
|
+
line: i + 1,
|
|
309
|
+
variable: match[1],
|
|
310
|
+
existingValue: match[2]
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
return warnings;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
// src/client/theme/cli.ts
|
|
319
|
+
function printUsage() {
|
|
320
|
+
stderr.write(`
|
|
321
|
+
Usage: enad-theme apply <hash> [options]
|
|
322
|
+
|
|
323
|
+
Options:
|
|
324
|
+
--target <file> Target CSS file (default: src/globals.css)
|
|
325
|
+
--color-space <cs> Color space: hsl | oklch (default: hsl)
|
|
326
|
+
--scan <dir> Directory to scan for conflicts (default: src)
|
|
327
|
+
--dry-run Print CSS to stdout without writing
|
|
328
|
+
--help Show this help message
|
|
329
|
+
|
|
330
|
+
Examples:
|
|
331
|
+
enad-theme apply 1k5YWJj...
|
|
332
|
+
enad-theme apply 1k5YWJj... --target app/globals.css --color-space oklch
|
|
333
|
+
enad-theme apply 1k5YWJj... --dry-run
|
|
334
|
+
`);
|
|
335
|
+
}
|
|
336
|
+
function parseArgs(args) {
|
|
337
|
+
if (args.length === 0 || args.includes("--help")) {
|
|
338
|
+
printUsage();
|
|
339
|
+
exit(0);
|
|
340
|
+
}
|
|
341
|
+
const command = args[0];
|
|
342
|
+
if (command !== "apply") {
|
|
343
|
+
stderr.write(`Unknown command: ${command}
|
|
344
|
+
Run enad-theme --help for usage.
|
|
345
|
+
`);
|
|
346
|
+
exit(1);
|
|
347
|
+
}
|
|
348
|
+
const hash = args[1];
|
|
349
|
+
if (!hash) {
|
|
350
|
+
stderr.write("Error: missing theme hash argument.\n");
|
|
351
|
+
exit(1);
|
|
352
|
+
}
|
|
353
|
+
let target = "src/globals.css";
|
|
354
|
+
let colorSpace = "hsl";
|
|
355
|
+
let scanDir = "src";
|
|
356
|
+
let dryRun = false;
|
|
357
|
+
for (let i = 2; i < args.length; i++) {
|
|
358
|
+
switch (args[i]) {
|
|
359
|
+
case "--target":
|
|
360
|
+
target = args[++i] ?? target;
|
|
361
|
+
break;
|
|
362
|
+
case "--color-space":
|
|
363
|
+
colorSpace = args[++i] ?? colorSpace;
|
|
364
|
+
break;
|
|
365
|
+
case "--scan":
|
|
366
|
+
scanDir = args[++i] ?? scanDir;
|
|
367
|
+
break;
|
|
368
|
+
case "--dry-run":
|
|
369
|
+
dryRun = true;
|
|
370
|
+
break;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
return { command, hash, target, colorSpace, scanDir, dryRun };
|
|
374
|
+
}
|
|
375
|
+
function readExistingFile(targetPath) {
|
|
376
|
+
try {
|
|
377
|
+
return readFileSync(targetPath, "utf-8");
|
|
378
|
+
} catch {
|
|
379
|
+
return "";
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
function writeOutput(targetPath, target, existing, css) {
|
|
383
|
+
const updated = applyThemeBlock(existing, css);
|
|
384
|
+
writeFileSync(targetPath, updated, "utf-8");
|
|
385
|
+
const isUpdate = existing.includes(MARKER_START);
|
|
386
|
+
stderr.write(
|
|
387
|
+
isUpdate ? `Updated theme block in ${target}
|
|
388
|
+
` : `Wrote theme block to ${target}
|
|
389
|
+
`
|
|
390
|
+
);
|
|
391
|
+
}
|
|
392
|
+
function scanForConflicts(scanDir, targetPath, css) {
|
|
393
|
+
const varPattern = /^\s*(--[\w-]+)\s*:/gm;
|
|
394
|
+
const variables = [];
|
|
395
|
+
let match;
|
|
396
|
+
while ((match = varPattern.exec(css)) !== null) {
|
|
397
|
+
variables.push(match[1]);
|
|
398
|
+
}
|
|
399
|
+
if (variables.length === 0) return;
|
|
400
|
+
const cssFiles = [];
|
|
401
|
+
function walk(dir) {
|
|
402
|
+
try {
|
|
403
|
+
for (const entry of readdirSync(dir)) {
|
|
404
|
+
const full = join(dir, entry);
|
|
405
|
+
try {
|
|
406
|
+
const stat = statSync(full);
|
|
407
|
+
if (stat.isDirectory() && !entry.startsWith(".") && entry !== "node_modules") {
|
|
408
|
+
walk(full);
|
|
409
|
+
} else if (stat.isFile() && full.endsWith(".css") && resolve(full) !== targetPath) {
|
|
410
|
+
cssFiles.push({ path: full, content: readFileSync(full, "utf-8") });
|
|
411
|
+
}
|
|
412
|
+
} catch {
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
} catch {
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
walk(resolve(scanDir));
|
|
419
|
+
const warnings = scanConflicts(cssFiles, variables);
|
|
420
|
+
if (warnings.length > 0) {
|
|
421
|
+
stderr.write(`
|
|
422
|
+
Conflicting declarations found:
|
|
423
|
+
`);
|
|
424
|
+
for (const w of warnings) {
|
|
425
|
+
stderr.write(` ${w.file}:${w.line} ${w.variable}: ${w.existingValue}
|
|
426
|
+
`);
|
|
427
|
+
}
|
|
428
|
+
stderr.write(`
|
|
429
|
+
These existing declarations may override or conflict with the theme.
|
|
430
|
+
`);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
function main() {
|
|
434
|
+
const parsed = parseArgs(argv.slice(2));
|
|
435
|
+
if (!parsed) return;
|
|
436
|
+
const { hash, target, colorSpace, scanDir, dryRun } = parsed;
|
|
437
|
+
const decoded = decodeThemeHash(hash);
|
|
438
|
+
if (Object.keys(decoded).length === 0) {
|
|
439
|
+
stderr.write("Error: failed to decode theme hash. Check that the hash is valid.\n");
|
|
440
|
+
exit(1);
|
|
441
|
+
}
|
|
442
|
+
const css = generateThemeCSS(decoded, { colorSpace });
|
|
443
|
+
if (dryRun) {
|
|
444
|
+
stdout.write(css + "\n");
|
|
445
|
+
exit(0);
|
|
446
|
+
}
|
|
447
|
+
const targetPath = resolve(target);
|
|
448
|
+
const existing = readExistingFile(targetPath);
|
|
449
|
+
writeOutput(targetPath, target, existing, css);
|
|
450
|
+
scanForConflicts(scanDir, targetPath, css);
|
|
451
|
+
}
|
|
452
|
+
main();
|
|
453
|
+
//# sourceMappingURL=cli.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/client/theme/cli.ts","../../../src/client/theme/codec.ts","../../../src/client/theme/defaults.ts","../../../src/client/theme/apply.ts","../../../src/client/theme/scan.ts"],"sourcesContent":["import { readFileSync, writeFileSync, readdirSync, statSync } from 'node:fs';\nimport { resolve, join } from 'node:path';\nimport { argv, exit, stderr, stdout } from 'node:process';\n\nimport { decodeThemeHash } from './codec';\nimport { applyThemeBlock, generateThemeCSS, MARKER_START } from './apply';\nimport { scanConflicts } from './scan';\n\ninterface ParsedArgs {\n command: string;\n hash: string;\n target: string;\n colorSpace: 'hsl' | 'oklch';\n scanDir: string;\n dryRun: boolean;\n}\n\nfunction printUsage() {\n stderr.write(`\nUsage: enad-theme apply <hash> [options]\n\nOptions:\n --target <file> Target CSS file (default: src/globals.css)\n --color-space <cs> Color space: hsl | oklch (default: hsl)\n --scan <dir> Directory to scan for conflicts (default: src)\n --dry-run Print CSS to stdout without writing\n --help Show this help message\n\nExamples:\n enad-theme apply 1k5YWJj...\n enad-theme apply 1k5YWJj... --target app/globals.css --color-space oklch\n enad-theme apply 1k5YWJj... --dry-run\n`);\n}\n\nfunction parseArgs(args: string[]): ParsedArgs | null {\n if (args.length === 0 || args.includes('--help')) {\n printUsage();\n exit(0);\n }\n\n const command = args[0]!;\n if (command !== 'apply') {\n stderr.write(`Unknown command: ${command}\\nRun enad-theme --help for usage.\\n`);\n exit(1);\n }\n\n const hash = args[1];\n if (!hash) {\n stderr.write('Error: missing theme hash argument.\\n');\n exit(1);\n }\n\n let target = 'src/globals.css';\n let colorSpace: 'hsl' | 'oklch' = 'hsl';\n let scanDir = 'src';\n let dryRun = false;\n\n for (let i = 2; i < args.length; i++) {\n switch (args[i]) {\n case '--target':\n target = args[++i] ?? target;\n break;\n case '--color-space':\n colorSpace = (args[++i] as 'hsl' | 'oklch') ?? colorSpace;\n break;\n case '--scan':\n scanDir = args[++i] ?? scanDir;\n break;\n case '--dry-run':\n dryRun = true;\n break;\n }\n }\n\n return { command, hash, target, colorSpace, scanDir, dryRun };\n}\n\nfunction readExistingFile(targetPath: string): string {\n try {\n return readFileSync(targetPath, 'utf-8');\n } catch {\n // File doesn't exist yet, we'll create it\n return '';\n }\n}\n\nfunction writeOutput(targetPath: string, target: string, existing: string, css: string) {\n const updated = applyThemeBlock(existing, css);\n writeFileSync(targetPath, updated, 'utf-8');\n\n const isUpdate = existing.includes(MARKER_START);\n stderr.write(\n isUpdate\n ? `Updated theme block in ${target}\\n`\n : `Wrote theme block to ${target}\\n`,\n );\n}\n\nfunction scanForConflicts(scanDir: string, targetPath: string, css: string) {\n // Extract variable names from the generated CSS\n const varPattern = /^\\s*(--[\\w-]+)\\s*:/gm;\n const variables: string[] = [];\n let match: RegExpExecArray | null;\n while ((match = varPattern.exec(css)) !== null) {\n variables.push(match[1]!);\n }\n\n if (variables.length === 0) return;\n\n // Simple recursive CSS file scan\n const cssFiles: Array<{ path: string; content: string }> = [];\n\n function walk(dir: string) {\n try {\n for (const entry of readdirSync(dir)) {\n const full = join(dir, entry);\n try {\n const stat = statSync(full);\n if (stat.isDirectory() && !entry.startsWith('.') && entry !== 'node_modules') {\n walk(full);\n } else if (stat.isFile() && full.endsWith('.css') && resolve(full) !== targetPath) {\n cssFiles.push({ path: full, content: readFileSync(full, 'utf-8') });\n }\n } catch {\n // Skip inaccessible files\n }\n }\n } catch {\n // Skip inaccessible directories\n }\n }\n\n walk(resolve(scanDir));\n\n const warnings = scanConflicts(cssFiles, variables);\n if (warnings.length > 0) {\n stderr.write(`\\nConflicting declarations found:\\n`);\n for (const w of warnings) {\n stderr.write(` ${w.file}:${w.line} ${w.variable}: ${w.existingValue}\\n`);\n }\n stderr.write(`\\nThese existing declarations may override or conflict with the theme.\\n`);\n }\n}\n\nfunction main() {\n const parsed = parseArgs(argv.slice(2));\n if (!parsed) return;\n\n const { hash, target, colorSpace, scanDir, dryRun } = parsed;\n\n // Decode\n const decoded = decodeThemeHash(hash);\n if (Object.keys(decoded).length === 0) {\n stderr.write('Error: failed to decode theme hash. Check that the hash is valid.\\n');\n exit(1);\n }\n\n // Generate CSS\n const css = generateThemeCSS(decoded, { colorSpace });\n\n if (dryRun) {\n stdout.write(css + '\\n');\n exit(0);\n }\n\n // Write to target file\n const targetPath = resolve(target);\n const existing = readExistingFile(targetPath);\n writeOutput(targetPath, target, existing, css);\n\n scanForConflicts(scanDir, targetPath, css);\n}\n\nmain();\n","import { decode as msgpackDecode, encode as msgpackEncode } from \"@msgpack/msgpack\";\n\n/**\n * Loose bag of theme values. The decoder returns whatever keys are present;\n * the consumer merges onto its own defaults. This keeps the format\n * forward/backward compatible: new keys are silently ignored by old decoders,\n * and removed keys are filled from defaults by the consumer.\n */\nexport type ThemeHash = Record<string, unknown>;\n\n// Current format version. Prepended as a single ASCII char before the base64url payload.\nconst FORMAT_VERSION = \"1\";\n\n// ---------------------------------------------------------------------------\n// Short key mapping\n// ---------------------------------------------------------------------------\n\n/** Short key -> full key */\nexport const KEY_MAP: Record<string, string> = {\n c: \"colorize\",\n i: \"intensity\",\n d: \"delight\",\n r: \"radius\",\n bf: \"fontBody\",\n hf: \"fontHeading\",\n ic: \"iconSet\",\n cs: \"colorSpace\",\n dm: \"darkMode\",\n lc: \"lightColors\",\n dc: \"darkColors\",\n br: \"buttonRadius\",\n cr: \"cardRadius\",\n ir: \"inputRadius\",\n mr: \"imageRadius\",\n sp: \"shadowPreset\",\n sc: \"shadowColor\",\n hw: \"headingWeight\",\n ht: \"headingTracking\",\n bw: \"bodyWeight\",\n hx: \"headingTransform\",\n bdr: \"borderWidth\",\n oc: \"overlayColor\",\n of: \"overlayFromOpacity\",\n ot: \"overlayToOpacity\",\n hs: \"imageHoverScale\",\n hd: \"imageHoverDuration\",\n v: \"variants\",\n xs: \"componentSet\",\n};\n\n/** Full key -> short key (inverse of KEY_MAP) */\nexport const KEY_MAP_REVERSE: Record<string, string> = Object.fromEntries(\n Object.entries(KEY_MAP).map(([short, full]) => [full, short]),\n);\n\n// ---------------------------------------------------------------------------\n// Base64url helpers (RFC 4648 §5, no padding)\n// ---------------------------------------------------------------------------\n\nfunction toBase64url(buf: Uint8Array): string {\n let binary = \"\";\n for (let i = 0; i < buf.length; i++) {\n binary += String.fromCharCode(buf[i]!);\n }\n return btoa(binary).replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=+$/, \"\");\n}\n\nfunction fromBase64url(str: string): Uint8Array {\n const base64 = str.replace(/-/g, \"+\").replace(/_/g, \"/\");\n const padded = base64 + \"=\".repeat((4 - (base64.length % 4)) % 4);\n const binary = atob(padded);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes;\n}\n\n// ---------------------------------------------------------------------------\n// Encode / Decode\n// ---------------------------------------------------------------------------\n\n/**\n * Encode a theme state diff into a portable hash string.\n *\n * The input should only contain non-default values. The encoder maps\n * full keys to short keys, packs with MessagePack, and encodes as\n * `<version><base64url>`.\n */\nexport function encodeThemeHash(diff: ThemeHash): string {\n const compact: Record<string, unknown> = {};\n for (const [fullKey, value] of Object.entries(diff)) {\n const shortKey = KEY_MAP_REVERSE[fullKey] ?? fullKey;\n compact[shortKey] = value;\n }\n const packed = msgpackEncode(compact);\n return FORMAT_VERSION + toBase64url(packed);\n}\n\n/**\n * Decode a hash string back into a key-value bag with full key names.\n *\n * Returns partial data -- the consumer is responsible for merging onto\n * its own defaults. Unknown keys are preserved for forward compatibility.\n * Returns an empty object on invalid input (never throws).\n */\nexport function decodeThemeHash(hash: string): ThemeHash {\n try {\n if (!hash || hash.length < 2) return {};\n\n const version = hash[0];\n if (version !== FORMAT_VERSION) return {};\n\n const payload = hash.slice(1);\n const bytes = fromBase64url(payload);\n const compact = msgpackDecode(bytes) as Record<string, unknown>;\n\n if (typeof compact !== \"object\" || compact === null) return {};\n\n const result: ThemeHash = {};\n for (const [key, value] of Object.entries(compact)) {\n const fullKey = KEY_MAP[key] ?? key;\n result[fullKey] = value;\n }\n return result;\n } catch {\n return {};\n }\n}\n","/**\n * SDK default color tokens. These are the canonical defaults used by\n * the theme codec to compute diffs (only non-default values are encoded).\n */\nexport const SDK_DEFAULTS = {\n light: {\n \"--background\": \"#ffffff\",\n \"--foreground\": \"#111827\",\n \"--card\": \"#ffffff\",\n \"--card-foreground\": \"#111827\",\n \"--popover\": \"#ffffff\",\n \"--popover-foreground\": \"#111827\",\n \"--primary\": \"#2563eb\",\n \"--primary-foreground\": \"#ffffff\",\n \"--secondary\": \"#f1f5f9\",\n \"--secondary-foreground\": \"#0f172a\",\n \"--muted\": \"#f3f4f6\",\n \"--muted-foreground\": \"#636b78\",\n \"--accent\": \"#dbeafe\",\n \"--accent-foreground\": \"#1e3a8a\",\n \"--accent-muted\": \"#eff6ff\",\n \"--accent-muted-foreground\": \"#1e40af\",\n \"--destructive\": \"#dc2626\",\n \"--destructive-foreground\": \"#ffffff\",\n \"--border\": \"#e5e7eb\",\n \"--input\": \"#e5e7eb\",\n \"--ring\": \"#2563eb\",\n } as Record<string, string>,\n dark: {\n \"--background\": \"#111827\",\n \"--foreground\": \"#f9fafb\",\n \"--card\": \"#1f2937\",\n \"--card-foreground\": \"#f9fafb\",\n \"--popover\": \"#1f2937\",\n \"--popover-foreground\": \"#f9fafb\",\n \"--primary\": \"#2563eb\",\n \"--primary-foreground\": \"#ffffff\",\n \"--secondary\": \"#1e293b\",\n \"--secondary-foreground\": \"#e2e8f0\",\n \"--muted\": \"#374151\",\n \"--muted-foreground\": \"#b0b8c4\",\n \"--accent\": \"#1e3a5f\",\n \"--accent-foreground\": \"#bfdbfe\",\n \"--accent-muted\": \"#172554\",\n \"--accent-muted-foreground\": \"#93c5fd\",\n \"--destructive\": \"#dc2626\",\n \"--destructive-foreground\": \"#ffffff\",\n \"--border\": \"#374151\",\n \"--input\": \"#374151\",\n \"--ring\": \"#2563eb\",\n } as Record<string, string>,\n};\n\n/** Default values for design tokens (non-color). */\nexport const TOKEN_DEFAULTS = {\n colorize: 50,\n intensity: 50,\n delight: 50,\n radius: 0.75,\n fontBody: \"Inter\",\n fontHeading: \"Inter\",\n iconSet: \"Phosphor\",\n colorSpace: \"hsl\",\n darkMode: false,\n componentSet: \"default\" as \"default\" | \"mono\",\n\n // Shape\n buttonRadius: \"9999px\",\n cardRadius: \"var(--radius)\",\n inputRadius: \"var(--radius)\",\n imageRadius: \"0px\",\n\n // Depth\n shadowPreset: \"none\",\n shadowColor: \"oklch(0 0 0 / 0.1)\",\n\n // Typography\n headingWeight: \"600\",\n headingTracking: \"0em\",\n bodyWeight: \"400\",\n headingTransform: \"none\",\n\n // Border\n borderWidth: \"1px\",\n\n // Overlay\n overlayColor: \"black\",\n overlayFromOpacity: \"0.5\",\n overlayToOpacity: \"0\",\n\n // Motion\n imageHoverScale: \"1.05\",\n imageHoverDuration: \"300ms\",\n\n // Variants\n variants: {\n hero: \"overlay\",\n linkBlock: \"overlay\",\n productCard: \"gallery\",\n contentWithImage: \"side-by-side\",\n gallery: \"grid\",\n textContent: \"default\",\n },\n} as const;\n\n/** Mono preset overrides. Merge onto TOKEN_DEFAULTS when componentSet is \"mono\". */\nexport const MONO_TOKEN_OVERRIDES = {\n componentSet: \"mono\" as const,\n radius: 0.5,\n fontBody: \"Lexend\",\n fontHeading: \"Lexend\",\n colorSpace: \"oklch\",\n buttonRadius: \"8px\",\n cardRadius: \"12px\",\n inputRadius: \"8px\",\n shadowPreset: \"subtle\",\n shadowColor: \"rgba(0, 0, 0, 0.1)\",\n} as const;\n\n/** Mono color defaults (oklch, zero-chroma monochromatic palette). */\nexport const MONO_SDK_DEFAULTS = {\n light: {\n \"--background\": \"oklch(0.99 0 0)\",\n \"--foreground\": \"oklch(0.145 0 0)\",\n \"--card\": \"oklch(1 0 0)\",\n \"--card-foreground\": \"oklch(0.145 0 0)\",\n \"--popover\": \"oklch(1 0 0)\",\n \"--popover-foreground\": \"oklch(0.145 0 0)\",\n \"--primary\": \"oklch(0.205 0 0)\",\n \"--primary-foreground\": \"oklch(0.985 0 0)\",\n \"--secondary\": \"oklch(0.92 0 0)\",\n \"--secondary-foreground\": \"oklch(0.205 0 0)\",\n \"--muted\": \"oklch(0.97 0 0)\",\n \"--muted-foreground\": \"oklch(0.556 0 0)\",\n \"--accent\": \"oklch(0.95 0 0)\",\n \"--accent-foreground\": \"oklch(0.205 0 0)\",\n \"--accent-muted\": \"oklch(0.97 0 0)\",\n \"--accent-muted-foreground\": \"oklch(0.205 0 0)\",\n \"--destructive\": \"oklch(0.5 0.25 30)\",\n \"--destructive-foreground\": \"oklch(0.985 0 0)\",\n \"--border\": \"oklch(0.922 0 0)\",\n \"--input\": \"oklch(0.922 0 0)\",\n \"--ring\": \"oklch(0.708 0 0)\",\n } as Record<string, string>,\n dark: {\n \"--background\": \"oklch(0.17 0 0)\",\n \"--foreground\": \"oklch(0.985 0 0)\",\n \"--card\": \"oklch(0.145 0 0)\",\n \"--card-foreground\": \"oklch(0.985 0 0)\",\n \"--popover\": \"oklch(0.145 0 0)\",\n \"--popover-foreground\": \"oklch(0.985 0 0)\",\n \"--primary\": \"oklch(0.922 0 0)\",\n \"--primary-foreground\": \"oklch(0.205 0 0)\",\n \"--secondary\": \"oklch(0.25 0 0)\",\n \"--secondary-foreground\": \"oklch(0.985 0 0)\",\n \"--muted\": \"oklch(0.19 0 0)\",\n \"--muted-foreground\": \"oklch(0.65 0 0)\",\n \"--accent\": \"oklch(0.22 0 0)\",\n \"--accent-foreground\": \"oklch(0.98 0 0)\",\n \"--accent-muted\": \"oklch(0.22 0 0)\",\n \"--accent-muted-foreground\": \"oklch(0.98 0 0)\",\n \"--destructive\": \"oklch(0.35 0.25 30)\",\n \"--destructive-foreground\": \"oklch(0.985 0 0)\",\n \"--border\": \"oklch(1 0 0 / 10%)\",\n \"--input\": \"oklch(1 0 0 / 15%)\",\n \"--ring\": \"oklch(0.556 0 0)\",\n } as Record<string, string>,\n};\n","import type { ThemeHash } from './codec';\nimport { SDK_DEFAULTS, TOKEN_DEFAULTS } from './defaults';\n\nexport interface GenerateOptions {\n colorSpace?: 'hsl' | 'oklch';\n}\n\nfunction buildLightColorDiffs(hash: ThemeHash): string[] {\n const lightOverrides = (hash.lightColors ?? {}) as Record<string, string>;\n const diffs: string[] = [];\n for (const [token, value] of Object.entries(lightOverrides)) {\n if (value !== SDK_DEFAULTS.light[token]) {\n diffs.push(` ${token}: ${value};`);\n }\n }\n return diffs;\n}\n\nfunction buildBaseTokenDiffs(hash: ThemeHash): string[] {\n const diffs: string[] = [];\n\n const radius = hash.radius as number | undefined;\n if (radius != null && radius !== 0.75) {\n diffs.push(` --radius: ${radius}rem;`);\n }\n\n const fontBody = hash.fontBody as string | undefined;\n if (fontBody && fontBody !== 'Inter') {\n diffs.push(` --font-sans: \"${fontBody}\", sans-serif;`);\n }\n\n const fontHeading = hash.fontHeading as string | undefined;\n if (fontHeading && fontHeading !== fontBody && fontHeading !== 'Inter') {\n diffs.push(` --font-heading: \"${fontHeading}\", sans-serif;`);\n }\n\n return diffs;\n}\n\nfunction buildDarkColorDiffs(hash: ThemeHash): string[] {\n const darkOverrides = (hash.darkColors ?? {}) as Record<string, string>;\n const diffs: string[] = [];\n for (const [token, value] of Object.entries(darkOverrides)) {\n if (value !== SDK_DEFAULTS.dark[token]) {\n diffs.push(` ${token}: ${value};`);\n }\n }\n return diffs;\n}\n\nfunction buildTokenSections(hash: ThemeHash): string[] {\n const lines: string[] = [];\n\n const tokenSections: Array<{ comment: string; entries: Array<[string, string, string]> }> = [\n {\n comment: 'Shape',\n entries: [\n ['--enad-button-radius', hash.buttonRadius as string, TOKEN_DEFAULTS.buttonRadius],\n ['--enad-card-radius', hash.cardRadius as string, TOKEN_DEFAULTS.cardRadius],\n ['--enad-input-radius', hash.inputRadius as string, TOKEN_DEFAULTS.inputRadius],\n ['--enad-image-radius', hash.imageRadius as string, TOKEN_DEFAULTS.imageRadius],\n ],\n },\n {\n comment: 'Depth',\n entries: [\n ['--enad-shadow-color', hash.shadowColor as string, TOKEN_DEFAULTS.shadowColor],\n ],\n },\n {\n comment: 'Typography',\n entries: [\n ['--enad-heading-weight', hash.headingWeight as string, TOKEN_DEFAULTS.headingWeight],\n ['--enad-heading-tracking', hash.headingTracking as string, TOKEN_DEFAULTS.headingTracking],\n ['--enad-body-weight', hash.bodyWeight as string, TOKEN_DEFAULTS.bodyWeight],\n ['--enad-heading-transform', hash.headingTransform as string, TOKEN_DEFAULTS.headingTransform],\n ],\n },\n {\n comment: 'Borders',\n entries: [\n ['--enad-border-width', hash.borderWidth as string, TOKEN_DEFAULTS.borderWidth],\n ],\n },\n {\n comment: 'Overlay',\n entries: [\n ['--enad-overlay-color', hash.overlayColor as string, TOKEN_DEFAULTS.overlayColor],\n ['--enad-overlay-from-opacity', hash.overlayFromOpacity as string, TOKEN_DEFAULTS.overlayFromOpacity],\n ['--enad-overlay-to-opacity', hash.overlayToOpacity as string, TOKEN_DEFAULTS.overlayToOpacity],\n ],\n },\n {\n comment: 'Motion',\n entries: [\n ['--enad-image-hover-scale', hash.imageHoverScale as string, TOKEN_DEFAULTS.imageHoverScale],\n ['--enad-image-hover-duration', hash.imageHoverDuration as string, TOKEN_DEFAULTS.imageHoverDuration],\n ],\n },\n ];\n\n for (const section of tokenSections) {\n const sectionLines: string[] = [];\n for (const [varName, value, defaultValue] of section.entries) {\n if (value != null && value !== defaultValue) {\n sectionLines.push(` ${varName}: ${value};`);\n }\n }\n if (sectionLines.length > 0) {\n lines.push('', `/* ${section.comment} */`, ':root {', ...sectionLines, '}');\n }\n }\n\n return lines;\n}\n\n/**\n * Generate CSS variable declarations from a decoded theme hash.\n * Merges the hash onto SDK defaults and only emits values that differ.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function generateThemeCSS(hash: ThemeHash, _options: GenerateOptions = {}): string {\n const lines: string[] = ['/* Generated by enad-theme */'];\n\n // --- Light color diffs + base tokens ---\n const lightDiffs = [...buildLightColorDiffs(hash), ...buildBaseTokenDiffs(hash)];\n if (lightDiffs.length > 0) {\n lines.push('', ':root {', ...lightDiffs, '}');\n }\n\n // --- Dark color diffs ---\n const darkDiffs = buildDarkColorDiffs(hash);\n if (darkDiffs.length > 0) {\n lines.push('', '.dark {', ...darkDiffs, '}');\n }\n\n // --- Token sections ---\n lines.push(...buildTokenSections(hash));\n\n return lines.join('\\n');\n}\n\n// Sentinel markers for idempotent file writes\nexport const MARKER_START = '/* === enad-theme:start === */';\nexport const MARKER_END = '/* === enad-theme:end === */';\n\n/**\n * Insert or replace a theme block in a CSS file's content.\n * Returns the updated file content.\n */\nexport function applyThemeBlock(fileContent: string, cssBlock: string): string {\n const startIdx = fileContent.indexOf(MARKER_START);\n const endIdx = fileContent.indexOf(MARKER_END);\n\n const block = `${MARKER_START}\\n${cssBlock}\\n${MARKER_END}`;\n\n if (startIdx !== -1 && endIdx !== -1) {\n return fileContent.slice(0, startIdx) + block + fileContent.slice(endIdx + MARKER_END.length);\n }\n\n // Append with a blank line separator\n const separator = fileContent.length > 0 && !fileContent.endsWith('\\n') ? '\\n' : '';\n return fileContent + separator + '\\n' + block + '\\n';\n}\n","export interface ConflictWarning {\n file: string;\n line: number;\n variable: string;\n existingValue: string;\n}\n\n/**\n * Scan CSS file contents for existing declarations of the given custom properties.\n * Uses simple regex matching -- no CSS parser needed since custom property\n * declarations have unambiguous syntax.\n */\nexport function scanConflicts(\n files: Array<{ path: string; content: string }>,\n variables: string[],\n): ConflictWarning[] {\n if (variables.length === 0) return [];\n\n const warnings: ConflictWarning[] = [];\n // Match lines like ` --variable-name: value;` or `--variable-name: value`\n const varSet = new Set(variables);\n\n for (const file of files) {\n const lines = file.content.split('\\n');\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i]!;\n const match = line.match(/^\\s*(--[\\w-]+)\\s*:\\s*(.+?)\\s*;?\\s*$/);\n if (match && varSet.has(match[1]!)) {\n warnings.push({\n file: file.path,\n line: i + 1,\n variable: match[1]!,\n existingValue: match[2]!,\n });\n }\n }\n }\n\n return warnings;\n}\n"],"mappings":";;;AAAA,SAAS,cAAc,eAAe,aAAa,gBAAgB;AACnE,SAAS,SAAS,YAAY;AAC9B,SAAS,MAAM,MAAM,QAAQ,cAAc;;;ACF3C,SAAS,UAAU,eAAe,UAAU,qBAAqB;AAWjE,IAAM,iBAAiB;AAOhB,IAAM,UAAkC;AAAA,EAC7C,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAA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;AAE7C,mBAAiB,SAAS,YAAY,GAAG;AAC3C;AAEA,KAAK;","names":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loose bag of theme values. The decoder returns whatever keys are present;
|
|
3
|
+
* the consumer merges onto its own defaults. This keeps the format
|
|
4
|
+
* forward/backward compatible: new keys are silently ignored by old decoders,
|
|
5
|
+
* and removed keys are filled from defaults by the consumer.
|
|
6
|
+
*/
|
|
7
|
+
export type ThemeHash = Record<string, unknown>;
|
|
8
|
+
/** Short key -> full key */
|
|
9
|
+
export declare const KEY_MAP: Record<string, string>;
|
|
10
|
+
/** Full key -> short key (inverse of KEY_MAP) */
|
|
11
|
+
export declare const KEY_MAP_REVERSE: Record<string, string>;
|
|
12
|
+
/**
|
|
13
|
+
* Encode a theme state diff into a portable hash string.
|
|
14
|
+
*
|
|
15
|
+
* The input should only contain non-default values. The encoder maps
|
|
16
|
+
* full keys to short keys, packs with MessagePack, and encodes as
|
|
17
|
+
* `<version><base64url>`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function encodeThemeHash(diff: ThemeHash): string;
|
|
20
|
+
/**
|
|
21
|
+
* Decode a hash string back into a key-value bag with full key names.
|
|
22
|
+
*
|
|
23
|
+
* Returns partial data -- the consumer is responsible for merging onto
|
|
24
|
+
* its own defaults. Unknown keys are preserved for forward compatibility.
|
|
25
|
+
* Returns an empty object on invalid input (never throws).
|
|
26
|
+
*/
|
|
27
|
+
export declare function decodeThemeHash(hash: string): ThemeHash;
|
|
28
|
+
//# sourceMappingURL=codec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../src/client/theme/codec.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAShD,4BAA4B;AAC5B,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA8B1C,CAAC;AAEF,iDAAiD;AACjD,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAElD,CAAC;AA6BF;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAQvD;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAsBvD"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { decode as msgpackDecode, encode as msgpackEncode } from "@msgpack/msgpack";
|
|
2
|
+
const FORMAT_VERSION = "1";
|
|
3
|
+
const KEY_MAP = {
|
|
4
|
+
c: "colorize",
|
|
5
|
+
i: "intensity",
|
|
6
|
+
d: "delight",
|
|
7
|
+
r: "radius",
|
|
8
|
+
bf: "fontBody",
|
|
9
|
+
hf: "fontHeading",
|
|
10
|
+
ic: "iconSet",
|
|
11
|
+
cs: "colorSpace",
|
|
12
|
+
dm: "darkMode",
|
|
13
|
+
lc: "lightColors",
|
|
14
|
+
dc: "darkColors",
|
|
15
|
+
br: "buttonRadius",
|
|
16
|
+
cr: "cardRadius",
|
|
17
|
+
ir: "inputRadius",
|
|
18
|
+
mr: "imageRadius",
|
|
19
|
+
sp: "shadowPreset",
|
|
20
|
+
sc: "shadowColor",
|
|
21
|
+
hw: "headingWeight",
|
|
22
|
+
ht: "headingTracking",
|
|
23
|
+
bw: "bodyWeight",
|
|
24
|
+
hx: "headingTransform",
|
|
25
|
+
bdr: "borderWidth",
|
|
26
|
+
oc: "overlayColor",
|
|
27
|
+
of: "overlayFromOpacity",
|
|
28
|
+
ot: "overlayToOpacity",
|
|
29
|
+
hs: "imageHoverScale",
|
|
30
|
+
hd: "imageHoverDuration",
|
|
31
|
+
v: "variants",
|
|
32
|
+
xs: "componentSet"
|
|
33
|
+
};
|
|
34
|
+
const KEY_MAP_REVERSE = Object.fromEntries(
|
|
35
|
+
Object.entries(KEY_MAP).map(([short, full]) => [full, short])
|
|
36
|
+
);
|
|
37
|
+
function toBase64url(buf) {
|
|
38
|
+
let binary = "";
|
|
39
|
+
for (let i = 0; i < buf.length; i++) {
|
|
40
|
+
binary += String.fromCharCode(buf[i]);
|
|
41
|
+
}
|
|
42
|
+
return btoa(binary).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
43
|
+
}
|
|
44
|
+
function fromBase64url(str) {
|
|
45
|
+
const base64 = str.replace(/-/g, "+").replace(/_/g, "/");
|
|
46
|
+
const padded = base64 + "=".repeat((4 - base64.length % 4) % 4);
|
|
47
|
+
const binary = atob(padded);
|
|
48
|
+
const bytes = new Uint8Array(binary.length);
|
|
49
|
+
for (let i = 0; i < binary.length; i++) {
|
|
50
|
+
bytes[i] = binary.charCodeAt(i);
|
|
51
|
+
}
|
|
52
|
+
return bytes;
|
|
53
|
+
}
|
|
54
|
+
function encodeThemeHash(diff) {
|
|
55
|
+
const compact = {};
|
|
56
|
+
for (const [fullKey, value] of Object.entries(diff)) {
|
|
57
|
+
const shortKey = KEY_MAP_REVERSE[fullKey] ?? fullKey;
|
|
58
|
+
compact[shortKey] = value;
|
|
59
|
+
}
|
|
60
|
+
const packed = msgpackEncode(compact);
|
|
61
|
+
return FORMAT_VERSION + toBase64url(packed);
|
|
62
|
+
}
|
|
63
|
+
function decodeThemeHash(hash) {
|
|
64
|
+
try {
|
|
65
|
+
if (!hash || hash.length < 2) return {};
|
|
66
|
+
const version = hash[0];
|
|
67
|
+
if (version !== FORMAT_VERSION) return {};
|
|
68
|
+
const payload = hash.slice(1);
|
|
69
|
+
const bytes = fromBase64url(payload);
|
|
70
|
+
const compact = msgpackDecode(bytes);
|
|
71
|
+
if (typeof compact !== "object" || compact === null) return {};
|
|
72
|
+
const result = {};
|
|
73
|
+
for (const [key, value] of Object.entries(compact)) {
|
|
74
|
+
const fullKey = KEY_MAP[key] ?? key;
|
|
75
|
+
result[fullKey] = value;
|
|
76
|
+
}
|
|
77
|
+
return result;
|
|
78
|
+
} catch {
|
|
79
|
+
return {};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
export {
|
|
83
|
+
KEY_MAP,
|
|
84
|
+
KEY_MAP_REVERSE,
|
|
85
|
+
decodeThemeHash,
|
|
86
|
+
encodeThemeHash
|
|
87
|
+
};
|
|
88
|
+
//# sourceMappingURL=codec.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/client/theme/codec.ts"],"sourcesContent":["import { decode as msgpackDecode, encode as msgpackEncode } from \"@msgpack/msgpack\";\n\n/**\n * Loose bag of theme values. The decoder returns whatever keys are present;\n * the consumer merges onto its own defaults. This keeps the format\n * forward/backward compatible: new keys are silently ignored by old decoders,\n * and removed keys are filled from defaults by the consumer.\n */\nexport type ThemeHash = Record<string, unknown>;\n\n// Current format version. Prepended as a single ASCII char before the base64url payload.\nconst FORMAT_VERSION = \"1\";\n\n// ---------------------------------------------------------------------------\n// Short key mapping\n// ---------------------------------------------------------------------------\n\n/** Short key -> full key */\nexport const KEY_MAP: Record<string, string> = {\n c: \"colorize\",\n i: \"intensity\",\n d: \"delight\",\n r: \"radius\",\n bf: \"fontBody\",\n hf: \"fontHeading\",\n ic: \"iconSet\",\n cs: \"colorSpace\",\n dm: \"darkMode\",\n lc: \"lightColors\",\n dc: \"darkColors\",\n br: \"buttonRadius\",\n cr: \"cardRadius\",\n ir: \"inputRadius\",\n mr: \"imageRadius\",\n sp: \"shadowPreset\",\n sc: \"shadowColor\",\n hw: \"headingWeight\",\n ht: \"headingTracking\",\n bw: \"bodyWeight\",\n hx: \"headingTransform\",\n bdr: \"borderWidth\",\n oc: \"overlayColor\",\n of: \"overlayFromOpacity\",\n ot: \"overlayToOpacity\",\n hs: \"imageHoverScale\",\n hd: \"imageHoverDuration\",\n v: \"variants\",\n xs: \"componentSet\",\n};\n\n/** Full key -> short key (inverse of KEY_MAP) */\nexport const KEY_MAP_REVERSE: Record<string, string> = Object.fromEntries(\n Object.entries(KEY_MAP).map(([short, full]) => [full, short]),\n);\n\n// ---------------------------------------------------------------------------\n// Base64url helpers (RFC 4648 §5, no padding)\n// ---------------------------------------------------------------------------\n\nfunction toBase64url(buf: Uint8Array): string {\n let binary = \"\";\n for (let i = 0; i < buf.length; i++) {\n binary += String.fromCharCode(buf[i]!);\n }\n return btoa(binary).replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=+$/, \"\");\n}\n\nfunction fromBase64url(str: string): Uint8Array {\n const base64 = str.replace(/-/g, \"+\").replace(/_/g, \"/\");\n const padded = base64 + \"=\".repeat((4 - (base64.length % 4)) % 4);\n const binary = atob(padded);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes;\n}\n\n// ---------------------------------------------------------------------------\n// Encode / Decode\n// ---------------------------------------------------------------------------\n\n/**\n * Encode a theme state diff into a portable hash string.\n *\n * The input should only contain non-default values. The encoder maps\n * full keys to short keys, packs with MessagePack, and encodes as\n * `<version><base64url>`.\n */\nexport function encodeThemeHash(diff: ThemeHash): string {\n const compact: Record<string, unknown> = {};\n for (const [fullKey, value] of Object.entries(diff)) {\n const shortKey = KEY_MAP_REVERSE[fullKey] ?? fullKey;\n compact[shortKey] = value;\n }\n const packed = msgpackEncode(compact);\n return FORMAT_VERSION + toBase64url(packed);\n}\n\n/**\n * Decode a hash string back into a key-value bag with full key names.\n *\n * Returns partial data -- the consumer is responsible for merging onto\n * its own defaults. Unknown keys are preserved for forward compatibility.\n * Returns an empty object on invalid input (never throws).\n */\nexport function decodeThemeHash(hash: string): ThemeHash {\n try {\n if (!hash || hash.length < 2) return {};\n\n const version = hash[0];\n if (version !== FORMAT_VERSION) return {};\n\n const payload = hash.slice(1);\n const bytes = fromBase64url(payload);\n const compact = msgpackDecode(bytes) as Record<string, unknown>;\n\n if (typeof compact !== \"object\" || compact === null) return {};\n\n const result: ThemeHash = {};\n for (const [key, value] of Object.entries(compact)) {\n const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