@cimplify/sdk 0.110.2 → 0.111.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/README.md +18 -0
  3. package/dist/advanced.d.mts +4 -4
  4. package/dist/advanced.d.ts +4 -4
  5. package/dist/advanced.js +22 -22
  6. package/dist/advanced.mjs +3 -3
  7. package/dist/{catalogue-OTuS5zp-.d.ts → catalogue-1QcoGDO6.d.ts} +2 -2
  8. package/dist/{catalogue-CPTMyBUz.d.mts → catalogue-FdFQiWrU.d.mts} +2 -2
  9. package/dist/{chunk-SYEO2WV4.mjs → chunk-42JTCWIE.mjs} +3 -3
  10. package/dist/{chunk-OMTVH334.js → chunk-6QANXRUM.js} +203 -186
  11. package/dist/{chunk-6ETDAU62.mjs → chunk-B45X3HPO.mjs} +98 -39
  12. package/dist/{chunk-MKIJQL5Q.js → chunk-CJVEJPIG.js} +69 -69
  13. package/dist/{chunk-Q2Y3VMKH.js → chunk-ETZDIISN.js} +151 -151
  14. package/dist/{chunk-GCKWKLZF.mjs → chunk-FT6GFYJL.mjs} +17 -3
  15. package/dist/{chunk-A36JRXXH.mjs → chunk-KWZHIPRN.mjs} +26 -9
  16. package/dist/{chunk-SNNEOS5Z.js → chunk-MHDUUSG6.js} +75 -75
  17. package/dist/{chunk-UCR5HRYM.js → chunk-NFXCKTE2.js} +17 -3
  18. package/dist/{chunk-DFZWHNRG.js → chunk-QOCHWR4V.js} +105 -42
  19. package/dist/{chunk-IZDWAL53.mjs → chunk-UJDQQTBS.mjs} +8 -8
  20. package/dist/{chunk-BTUSVHIE.mjs → chunk-WLSU5QJT.mjs} +2 -2
  21. package/dist/{client-dqOhP9Nc.d.ts → client-CChON4-x.d.ts} +2 -2
  22. package/dist/{client-CX_WR0-J.d.mts → client-EeuGm5gj.d.mts} +2 -2
  23. package/dist/{elements-DdsRig-2.d.mts → elements-ss9xZgRg.d.mts} +27 -1
  24. package/dist/{elements-DdsRig-2.d.ts → elements-ss9xZgRg.d.ts} +27 -1
  25. package/dist/index-BB2gjVvA.d.mts +153 -0
  26. package/dist/index-BEfmBDAH.d.ts +153 -0
  27. package/dist/{index-B98Xac8e.d.ts → index-DQK8sTfu.d.ts} +2 -2
  28. package/dist/{index-DbAN_VQE.d.mts → index-DSVkhRmW.d.mts} +2 -2
  29. package/dist/index.d.mts +8 -8
  30. package/dist/index.d.ts +8 -8
  31. package/dist/index.js +189 -177
  32. package/dist/index.mjs +8 -8
  33. package/dist/mock/cli.mjs +25 -10
  34. package/dist/mock/library.js +25 -10
  35. package/dist/mock/library.mjs +25 -10
  36. package/dist/mock/msw.js +25 -10
  37. package/dist/mock/msw.mjs +25 -10
  38. package/dist/{price-BOzexBww.d.mts → price-B-w4PwHm.d.mts} +1 -1
  39. package/dist/{price-C1h9sPxE.d.ts → price-BEvQFNJv.d.ts} +1 -1
  40. package/dist/react.d.mts +23 -15
  41. package/dist/react.d.ts +23 -15
  42. package/dist/react.js +254 -237
  43. package/dist/react.mjs +128 -111
  44. package/dist/{scheduling-D2ajXpMC.d.ts → scheduling-D9WwOxbo.d.ts} +1 -1
  45. package/dist/{scheduling-DSRbbaZb.d.mts → scheduling-DDmrYCr-.d.mts} +1 -1
  46. package/dist/{server-D29IIuDV.d.ts → server-BiKwxvnf.d.ts} +2 -2
  47. package/dist/{server-DQMWPnc8.d.mts → server-DPdtl2dd.d.mts} +2 -2
  48. package/dist/server.d.mts +4 -4
  49. package/dist/server.d.ts +4 -4
  50. package/dist/server.js +10 -10
  51. package/dist/server.mjs +4 -4
  52. package/dist/styles.css +1 -1
  53. package/dist/testing/msw.d.mts +3 -3
  54. package/dist/testing/msw.d.ts +3 -3
  55. package/dist/testing/msw.js +3 -3
  56. package/dist/testing/msw.mjs +2 -2
  57. package/dist/testing/suite.d.mts +6 -6
  58. package/dist/testing/suite.d.ts +6 -6
  59. package/dist/testing/suite.js +25 -25
  60. package/dist/testing/suite.mjs +6 -6
  61. package/dist/testing.d.mts +5 -5
  62. package/dist/testing.d.ts +5 -5
  63. package/dist/testing.js +117 -117
  64. package/dist/testing.mjs +7 -7
  65. package/dist/utils.d.mts +3 -3
  66. package/dist/utils.d.ts +3 -3
  67. package/dist/utils.js +44 -32
  68. package/dist/utils.mjs +2 -2
  69. package/package.json +5 -3
  70. package/registry/cart-summary.json +1 -1
  71. package/registry/chat-widget.json +1 -1
  72. package/registry/price.json +1 -1
  73. package/registry/product-customizer.json +1 -1
  74. package/registry/search-input.json +1 -1
  75. package/dist/index-6gkHMGAq.d.mts +0 -86
  76. package/dist/index-B_ByTtIT.d.ts +0 -86
package/dist/react.d.ts CHANGED
@@ -2,11 +2,11 @@ import * as React$1 from 'react';
2
2
  import React__default, { ReactNode, PointerEvent, MouseEvent } from 'react';
3
3
  import { d as AdSlot, c as AdPosition, a as AdContextValue, S as SignInOptions, f as AssetTransform } from './url-52ndUruG.js';
4
4
  export { A as AdConfig, i as getVariantDisplayName } from './url-52ndUruG.js';
5
- import { C as CimplifyClient, aa as EnrichedOrderItem, a9 as EnrichedOrder, p as Business, aD as Location, bG as ReorderResult, b4 as OrderStatus, aL as Order, bs as QuoteBundleSelectionInput, bt as QuoteCompositeSelectionInput, bi as PriceQuote, bw as QuoteUiMessage, h as ActivityStateResponse, c2 as SessionMessage, A as ActivityRecommendation, a0 as DeliveryFeeResponse, a4 as DeliveryOptionsResponse, an as FxRateResponse, c9 as StoreCreditBalance, cb as StorefrontBootstrap, O as ChatWidgetStarter, L as ChatMessage, N as ChatUploadAttachment, V as CimplifyElements, I as ChatAttachment, aw as LineItem, bR as Room, M as ChatReplyContext } from './catalogue-OTuS5zp-.js';
6
- import { i as CheckoutTermsView, cW as OrderType, dP as ProcessCheckoutResult, b1 as CheckoutStatus, b2 as CheckoutStatusContext, C as CurrencyCode, P as Product, di as Pagination, d as CimplifyError, f as ProductWithDetails, c as Category, M as Money, a as ChosenPrice, a9 as BundleSelectionInput, bd as ComponentSelectionInput, a8 as BundleSelectionData, bm as CompositeSelectionData, e as Collection, dY as ProductTaxonomy, eT as TaxonomyWithChildren, dZ as ProductTimeProfile, bH as Deal, dU as ProductDealInfo, bR as DiscountValidation, ab as BundleSummary, bk as CompositePriceResult, eO as SubscriptionWithDetails, eN as SubscriptionStatus, eK as Subscription, bv as CustomAttributeDefinition, e1 as PropertyFacet, dT as ProductBillingPlan, fa as VariantView, f4 as VariantAxisWithValues, G as AddressInfo, V as AuthenticatedData, ce as ElementsOptions, dt as PaymentMethodInfo, cc as ElementsCheckoutResult, dO as ProcessCheckoutOptions, z as AddOnWithOptions, a5 as BundleComponentView, a6 as BundlePriceType, bi as CompositeGroupView, bU as DisplayCart, dV as ProductInputField, H as AddressValue, b as SaleInfo, U as UpcomingSale, D as DurationUnit, a0 as BoundaryKind, S as SchedulingMode, bJ as DepositType, bw as CustomAttributeValue, dW as ProductProperty, el as QuantityPricingTier } from './elements-DdsRig-2.js';
5
+ import { C as CimplifyClient, aa as EnrichedOrderItem, a9 as EnrichedOrder, p as Business, aD as Location, bG as ReorderResult, b4 as OrderStatus, aL as Order, bs as QuoteBundleSelectionInput, bt as QuoteCompositeSelectionInput, bi as PriceQuote, bw as QuoteUiMessage, h as ActivityStateResponse, c2 as SessionMessage, A as ActivityRecommendation, a0 as DeliveryFeeResponse, a4 as DeliveryOptionsResponse, an as FxRateResponse, c9 as StoreCreditBalance, cb as StorefrontBootstrap, O as ChatWidgetStarter, L as ChatMessage, N as ChatUploadAttachment, V as CimplifyElements, I as ChatAttachment, aw as LineItem, bR as Room, M as ChatReplyContext } from './catalogue-1QcoGDO6.js';
6
+ import { i as CheckoutTermsView, cW as OrderType, dP as ProcessCheckoutResult, b1 as CheckoutStatus, b2 as CheckoutStatusContext, C as CurrencyCode, P as Product, di as Pagination, d as CimplifyError, f as ProductWithDetails, c as Category, M as Money, a as ChosenPrice, a9 as BundleSelectionInput, bd as ComponentSelectionInput, a8 as BundleSelectionData, bm as CompositeSelectionData, e as Collection, dY as ProductTaxonomy, eT as TaxonomyWithChildren, dZ as ProductTimeProfile, bH as Deal, dU as ProductDealInfo, bR as DiscountValidation, ab as BundleSummary, bk as CompositePriceResult, eO as SubscriptionWithDetails, eN as SubscriptionStatus, eK as Subscription, bv as CustomAttributeDefinition, e1 as PropertyFacet, dT as ProductBillingPlan, fa as VariantView, f4 as VariantAxisWithValues, G as AddressInfo, V as AuthenticatedData, ce as ElementsOptions, dt as PaymentMethodInfo, cc as ElementsCheckoutResult, dO as ProcessCheckoutOptions, z as AddOnWithOptions, a5 as BundleComponentView, a6 as BundlePriceType, bi as CompositeGroupView, bU as DisplayCart, dV as ProductInputField, H as AddressValue, b as SaleInfo, U as UpcomingSale, D as DurationUnit, a0 as BoundaryKind, S as SchedulingMode, bJ as DepositType, bw as CustomAttributeValue, dW as ProductProperty, el as QuantityPricingTier } from './elements-ss9xZgRg.js';
7
7
  import * as react_jsx_runtime from 'react/jsx-runtime';
8
- import { k as Service, A as AvailableSlot, D as DayAvailability, g as CustomerBooking, d as CancelBookingResult, p as Staff } from './scheduling-D2ajXpMC.js';
9
- import { P as ProductWithPrice } from './price-C1h9sPxE.js';
8
+ import { k as Service, A as AvailableSlot, D as DayAvailability, g as CustomerBooking, d as CancelBookingResult, p as Staff } from './scheduling-D9WwOxbo.js';
9
+ import { P as ProductWithPrice } from './price-BEvQFNJv.js';
10
10
  import { ClassValue } from 'clsx';
11
11
  import { Matcher } from 'react-day-picker';
12
12
  import { b4 as WebHost, av as HostChromeController, ae as ConsentStore, R as RegistryClient } from './web-Dss74a7v.js';
@@ -792,11 +792,12 @@ interface PriceProps {
792
792
  amount: number | string;
793
793
  /**
794
794
  * Currency the `amount` is denominated in. Pass the product/order currency
795
- * so the value renders correctly during SSR — before the provider has
795
+ * so the value renders correctly during SSR, before the provider has
796
796
  * loaded the business client-side. Falls back to the provider's base
797
- * currency, then USD.
797
+ * currency. When neither is known the component renders nothing rather
798
+ * than guessing a currency.
798
799
  */
799
- currency?: CurrencyCode;
800
+ currency?: CurrencyCode | null;
800
801
  /** Optional CSS class name for the wrapping span. */
801
802
  className?: string;
802
803
  /** Optional prefix rendered before the formatted price (e.g. "+"). */
@@ -813,7 +814,8 @@ interface PriceProps {
813
814
  * Price — renders a formatted price value.
814
815
  *
815
816
  * Currency is resolved from the `currency` prop (the amount's source currency),
816
- * falling back to the provider's base currency, then USD. Because the source
817
+ * falling back to the provider's base currency. With neither known it renders
818
+ * null, a loading state, and never a guessed currency. Because the source
817
819
  * currency comes from data rather than the client-only provider bootstrap, an
818
820
  * explicit `currency` renders correctly during SSR.
819
821
  *
@@ -822,7 +824,7 @@ interface PriceProps {
822
824
  * base currency the FX rate is computed from. It never affects the server or
823
825
  * first-paint render, so there is no hydration mismatch.
824
826
  */
825
- declare function Price({ amount, currency, className, prefix, convert, }: PriceProps): React__default.ReactElement;
827
+ declare function Price({ amount, currency, className, prefix, convert, }: PriceProps): React__default.ReactElement | null;
826
828
 
827
829
  type PrefetchMode = "aggressive" | "hover" | "off";
828
830
  interface PrefetchOptions {
@@ -846,14 +848,19 @@ type CimplifyLinkComponent = React__default.ComponentType<CimplifyLinkProps>;
846
848
  interface CimplifyClientContextValue {
847
849
  client: CimplifyClient;
848
850
  business: Business | null;
849
- currency: string;
851
+ /**
852
+ * The business's currency, from `business.default_currency`. Null until the
853
+ * business has loaded (or when it failed to load): render a loading or
854
+ * unavailable state, never a guessed currency.
855
+ */
856
+ currency: CurrencyCode | null;
850
857
  country: string;
851
858
  locations: Location[];
852
859
  isReady: boolean;
853
860
  prefetch: ResolvedPrefetchOptions;
854
861
  linkComponent: CimplifyLinkComponent | null;
855
- /** The business's pricing currency (always the base, for API calls). */
856
- baseCurrency: string;
862
+ /** The business's pricing currency (always the base, for API calls). Null until the business loads. */
863
+ baseCurrency: CurrencyCode | null;
857
864
  /**
858
865
  * When false, collection-backed hooks (`useCart`, etc.) skip optimistic
859
866
  * updates and fall back to fire-and-refetch. Default true. Mainly useful
@@ -865,8 +872,8 @@ interface CimplifyClientContextValue {
865
872
  interface CimplifyStateContextValue {
866
873
  currentLocation: Location | null;
867
874
  setCurrentLocation: (location: Location) => void;
868
- /** The currency prices are displayed in. Equals baseCurrency when no FX override is set. */
869
- displayCurrency: string;
875
+ /** The currency prices are displayed in. Equals baseCurrency when no FX override is set; null until the business loads. */
876
+ displayCurrency: CurrencyCode | null;
870
877
  /** Set a display currency override for FX conversion. Pass null to reset to base currency. */
871
878
  setDisplayCurrency: (currency: string | null) => void;
872
879
  /** Convert a base-currency amount to the display currency. No-op when currencies match. */
@@ -1038,7 +1045,8 @@ interface UseCartResult {
1038
1045
  displayGross: boolean;
1039
1046
  taxJurisdictionLabel: string | null;
1040
1047
  total: number;
1041
- currency: string;
1048
+ /** The cart's currency from the server, or the business currency. Null until either is known. */
1049
+ currency: string | null;
1042
1050
  isEmpty: boolean;
1043
1051
  isLoading: boolean;
1044
1052
  /** Any pending optimistic op is in flight. */