@kotao/storefront 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/chunk-4OQYNUGM.js +29 -0
  2. package/dist/chunk-4OQYNUGM.js.map +1 -0
  3. package/dist/{chunk-7XYWHWT4.js → chunk-4TEFGD42.js} +331 -38
  4. package/dist/chunk-4TEFGD42.js.map +1 -0
  5. package/dist/chunk-7MTCGXIG.js +144 -0
  6. package/dist/chunk-7MTCGXIG.js.map +1 -0
  7. package/dist/chunk-IIOHENCG.js +239 -0
  8. package/dist/chunk-IIOHENCG.js.map +1 -0
  9. package/dist/chunk-VV653S52.js +246 -0
  10. package/dist/chunk-VV653S52.js.map +1 -0
  11. package/dist/chunk-WG7HYVHJ.js +38 -0
  12. package/dist/chunk-WG7HYVHJ.js.map +1 -0
  13. package/dist/{client-DiPdlvPu.d.ts → client-D51WdvYR.d.ts} +55 -8
  14. package/dist/client-bsiNPHBi.d.ts +159 -0
  15. package/dist/createCartHandler-C4RrPwSG.d.ts +58 -0
  16. package/dist/editor.d.ts +1 -1
  17. package/dist/events-react.d.ts +68 -0
  18. package/dist/events-react.js +557 -0
  19. package/dist/events-react.js.map +1 -0
  20. package/dist/events.d.ts +18 -0
  21. package/dist/events.js +5 -0
  22. package/dist/events.js.map +1 -0
  23. package/dist/{fetch-B6TIc6lI.d.ts → fetch-M3Y-fQrW.d.ts} +1 -1
  24. package/dist/forms.d.ts +58 -0
  25. package/dist/forms.js +3 -0
  26. package/dist/forms.js.map +1 -0
  27. package/dist/http-types-CGh8WGHB.d.ts +11 -0
  28. package/dist/index.d.ts +74 -12
  29. package/dist/index.js +55 -9
  30. package/dist/index.js.map +1 -1
  31. package/dist/offer-token-C-nk_nj8.d.ts +16 -0
  32. package/dist/{pagination-CPgH3fAa.d.ts → pagination-DCrQk02Q.d.ts} +1 -1
  33. package/dist/product.d.ts +1 -1
  34. package/dist/react-router.d.ts +11 -7
  35. package/dist/react-router.js +4 -3
  36. package/dist/react-router.js.map +1 -1
  37. package/dist/react.d.ts +30 -7
  38. package/dist/react.js +4 -2
  39. package/dist/react.js.map +1 -1
  40. package/dist/{routing-BxRlep_-.d.ts → routing-sEonP93J.d.ts} +17 -60
  41. package/dist/seo.d.ts +2 -1
  42. package/dist/settings.d.ts +5 -4
  43. package/dist/{shop-DkQmro-Y.d.ts → shop-BJSvtmnV.d.ts} +2 -2
  44. package/dist/{store-DQK1nhob.d.ts → store-CtCWHI8H.d.ts} +1 -1
  45. package/dist/types-CSNXbGFW.d.ts +108 -0
  46. package/dist/{types-Df3bGbKU.d.ts → types-bcbQzx87.d.ts} +1 -1
  47. package/package.json +14 -2
  48. package/dist/chunk-7XYWHWT4.js.map +0 -1
package/dist/react.d.ts CHANGED
@@ -1,15 +1,16 @@
1
- import { ReactNode, ReactElement, ImgHTMLAttributes, VideoHTMLAttributes, ElementType, AnchorHTMLAttributes, CSSProperties } from 'react';
1
+ import react__default, { ReactNode, ReactElement, ImgHTMLAttributes, VideoHTMLAttributes, ElementType, AnchorHTMLAttributes, CSSProperties, ComponentPropsWithoutRef } from 'react';
2
2
  import { FetcherWithComponents } from 'react-router';
3
- import { C as CartFormAction, b as CartLineInput } from './types-Df3bGbKU.js';
4
- import { M as getCartFormInput, v as ShopAnalytics, d as AnalyticsContext, a as ConsentState, e as AnalyticsEmitter, b as AnalyticsBus } from './shop-DkQmro-Y.js';
5
- export { N as useNonce } from './shop-DkQmro-Y.js';
3
+ import { j as CartFormAction, a as CartLineInput } from './types-bcbQzx87.js';
4
+ import { g as getCartFormInput, S as ShopAnalytics, A as AnalyticsContext, C as ConsentState, a as AnalyticsEmitter, b as AnalyticsBus } from './shop-BJSvtmnV.js';
5
+ export { u as useNonce } from './shop-BJSvtmnV.js';
6
6
  import { Cart } from './storefront-api-types.js';
7
7
  import { ImageAttrsOptions, ImageData, ImageCrop, ImageFormat } from './image.js';
8
- import { C as Connection, b as PaginationInfo } from './pagination-CPgH3fAa.js';
8
+ import { C as Connection, P as PaginationInfo } from './pagination-DCrQk02Q.js';
9
9
  import { S as SeoConfig } from './types-BDhHWZsP.js';
10
- import { c as ThemeSettingsStore, b as ResolvedSettings, T as ThemeSettingsSnapshot } from './store-DQK1nhob.js';
10
+ import { T as ThemeSettingsStore, R as ResolvedSettings, a as ThemeSettingsSnapshot } from './store-CtCWHI8H.js';
11
11
  import { SmartCartMountConfig, CartAdapter } from '@kotao/smart-cart';
12
12
  export { R as REACT_SEAM_CART_DOCUMENTS, c as createStorefrontApiCartAdapter } from './cart-documents-CwwRTvm8.js';
13
+ import { P as PublicForm, a as FormAnswers, b as FormFieldErrors } from './types-CSNXbGFW.js';
13
14
 
14
15
  type CartFormInputValue = unknown;
15
16
  type CartFormFetcher = FetcherWithComponents<unknown>;
@@ -296,4 +297,26 @@ interface CartDrawerOverlayProps {
296
297
  */
297
298
  declare function CartDrawerOverlay({ config, adapter }: CartDrawerOverlayProps): null;
298
299
 
299
- export { Analytics, AnalyticsCartView, type AnalyticsCartViewProps, AnalyticsCollectionView, type AnalyticsCollectionViewProps, AnalyticsProductView, type AnalyticsProductViewProps, AnalyticsProvider, type AnalyticsProviderProps, AnalyticsSearchView, type AnalyticsSearchViewProps, CartDrawerOverlay, type CartDrawerOverlayProps, CartForm, type CartFormFetcher, type CartFormProps, type CartQueryDataReturn, type CartReturn, ConsentBanner, type ConsentBannerProps, type ConsentBannerRenderProps, Image, type ImageProps, MediaFile, type MediaFileImageOptions, type MediaFileProps, type MediaFileVideoOptions, Money, type MoneyData, type MoneyProps, type OptimisticCartLineInput, OptimisticInput, type OptimisticInputData, type OptimisticInputProps, Pagination, type PaginationProps, Seo, type SeoProps, ShopPayButton, type ShopPayButtonProps, ThemeSettingsProvider, type ThemeSettingsProviderProps, type UseMoneyValue, openSmartCart, useAnalytics, useGlobalThemeTokens, useMoney, useOptimisticData, useSectionSettings, useThemeSettings };
300
+ interface StorefrontFormProps extends Omit<ComponentPropsWithoutRef<'form'>, 'children' | 'defaultValue'> {
301
+ form: PublicForm;
302
+ locale: string;
303
+ fallbackLocale?: string;
304
+ answers?: FormAnswers;
305
+ errors?: FormFieldErrors;
306
+ submitted?: boolean;
307
+ submitLabel?: ReactNode;
308
+ onAnswersChange?: (answers: FormAnswers) => void;
309
+ }
310
+ interface StorefrontFormFieldsProps {
311
+ readonly form: PublicForm;
312
+ readonly locale: string;
313
+ readonly fallbackLocale?: string;
314
+ readonly answers?: FormAnswers;
315
+ readonly errors?: FormFieldErrors;
316
+ readonly onAnswersChange?: (answers: FormAnswers) => void;
317
+ readonly idPrefix?: string;
318
+ }
319
+ declare function StorefrontFormFields({ form, locale, fallbackLocale, answers: initialAnswers, errors, onAnswersChange, idPrefix, }: StorefrontFormFieldsProps): react__default.JSX.Element;
320
+ declare function StorefrontForm({ form, locale, fallbackLocale, answers, errors, submitted, submitLabel, onAnswersChange, action, method, ...props }: StorefrontFormProps): react__default.JSX.Element;
321
+
322
+ export { Analytics, AnalyticsCartView, type AnalyticsCartViewProps, AnalyticsCollectionView, type AnalyticsCollectionViewProps, AnalyticsProductView, type AnalyticsProductViewProps, AnalyticsProvider, type AnalyticsProviderProps, AnalyticsSearchView, type AnalyticsSearchViewProps, CartDrawerOverlay, type CartDrawerOverlayProps, CartForm, type CartFormFetcher, type CartFormProps, type CartQueryDataReturn, type CartReturn, ConsentBanner, type ConsentBannerProps, type ConsentBannerRenderProps, Image, type ImageProps, MediaFile, type MediaFileImageOptions, type MediaFileProps, type MediaFileVideoOptions, Money, type MoneyData, type MoneyProps, type OptimisticCartLineInput, OptimisticInput, type OptimisticInputData, type OptimisticInputProps, Pagination, type PaginationProps, Seo, type SeoProps, ShopPayButton, type ShopPayButtonProps, StorefrontForm, StorefrontFormFields, type StorefrontFormFieldsProps, type StorefrontFormProps, ThemeSettingsProvider, type ThemeSettingsProviderProps, type UseMoneyValue, openSmartCart, useAnalytics, useGlobalThemeTokens, useMoney, useOptimisticData, useSectionSettings, useThemeSettings };
package/dist/react.js CHANGED
@@ -1,10 +1,12 @@
1
1
  import { getCartFormInput, createAnalyticsBus, createPixelTransport } from './chunk-XMTWFJCZ.js';
2
2
  export { useNonce } from './chunk-XMTWFJCZ.js';
3
+ import { getPaginationInfo } from './chunk-5QOFKGKD.js';
4
+ import { CART_FORM_ACTIONS, GRANTED_CONSENT, CONSENT_COOKIE, readConsentCookie, mergeConsent, buildConsentCookie } from './chunk-OGWYTYYS.js';
3
5
  import { getSeoMeta, serializeJsonLd } from './chunk-MYDKIJRH.js';
4
6
  export { REACT_SEAM_CART_DOCUMENTS, createStorefrontApiCartAdapter } from './chunk-2IWNUDSZ.js';
7
+ export { StorefrontForm, StorefrontFormFields } from './chunk-VV653S52.js';
8
+ import './chunk-IIOHENCG.js';
5
9
  import { buildImageAttrs } from './chunk-3YQXJNR7.js';
6
- import { getPaginationInfo } from './chunk-5QOFKGKD.js';
7
- import { CART_FORM_ACTIONS, GRANTED_CONSENT, CONSENT_COOKIE, readConsentCookie, mergeConsent, buildConsentCookie } from './chunk-OGWYTYYS.js';
8
10
  import { createContext, useState, useRef, useMemo, useEffect, useCallback, useContext, useSyncExternalStore } from 'react';
9
11
  import { useFetcher } from 'react-router';
10
12
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';