@cimplify/sdk 0.8.14 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ads-DeL3PGzf.d.mts +33 -0
- package/dist/ads-DeL3PGzf.d.ts +33 -0
- package/dist/advanced.d.mts +2 -2
- package/dist/advanced.d.ts +2 -2
- package/dist/advanced.js +1 -15
- package/dist/advanced.mjs +1 -15
- package/dist/{client-BYpHOPXm.d.mts → client-CmnVngkm.d.mts} +1 -1
- package/dist/{client-9gpFQIeG.d.ts → client-vi6GsbUP.d.ts} +1 -1
- package/dist/{index-DKLWJwJd.d.mts → index-DWl8VbnB.d.mts} +1 -1
- package/dist/{index-DQp1xkcl.d.ts → index-UNwoWldH.d.ts} +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +11 -15
- package/dist/index.mjs +11 -16
- package/dist/{payment-BKjX2fAs.d.mts → payment-BNlyzm_Q.d.mts} +1 -1
- package/dist/{payment-BKjX2fAs.d.ts → payment-BNlyzm_Q.d.ts} +1 -1
- package/dist/react.d.mts +120 -5
- package/dist/react.d.ts +120 -5
- package/dist/react.js +925 -15
- package/dist/react.mjs +917 -16
- package/dist/utils.d.mts +2 -2
- package/dist/utils.d.ts +2 -2
- package/package.json +9 -8
- package/dist/ads-t3FBTU8p.d.mts +0 -20
- package/dist/ads-t3FBTU8p.d.ts +0 -20
package/dist/react.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
import { A as AdSlot, a as AdPosition, e as AdContextValue } from './ads-
|
|
3
|
-
export { c as AdConfig } from './ads-
|
|
4
|
-
import { C as CimplifyClient, Y as ProcessCheckoutResult, _ as CheckoutStatus, $ as CheckoutStatusContext, bq as Location, bn as Business, aS as Order, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, P as PriceQuote, g as QuoteUiMessage, w as ElementsOptions, cK as AuthenticatedData, cG as AddressInfo, cH as PaymentMethodInfo, s as CimplifyElements, cM as ElementsCheckoutResult, X as ProcessCheckoutOptions } from './client-
|
|
5
|
-
import { r as Product, d as Pagination, h as CimplifyError, s as ProductWithDetails, L as Category, ax as BundleSelectionInput, a8 as ComponentSelectionInput, O as Collection, Y as BundleWithDetails, a4 as CompositeWithDetails, a9 as CompositePriceResult, C as CurrencyCode } from './payment-
|
|
2
|
+
import { A as AdSlot, a as AdPosition, e as AdContextValue } from './ads-DeL3PGzf.js';
|
|
3
|
+
export { c as AdConfig, g as getVariantDisplayName } from './ads-DeL3PGzf.js';
|
|
4
|
+
import { C as CimplifyClient, Y as ProcessCheckoutResult, _ as CheckoutStatus, $ as CheckoutStatusContext, bq as Location, bn as Business, aS as Order, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, P as PriceQuote, g as QuoteUiMessage, w as ElementsOptions, cK as AuthenticatedData, cG as AddressInfo, cH as PaymentMethodInfo, s as CimplifyElements, cM as ElementsCheckoutResult, X as ProcessCheckoutOptions } from './client-vi6GsbUP.js';
|
|
5
|
+
import { r as Product, d as Pagination, h as CimplifyError, s as ProductWithDetails, L as Category, ax as BundleSelectionInput, a8 as ComponentSelectionInput, O as Collection, Y as BundleWithDetails, a4 as CompositeWithDetails, a9 as CompositePriceResult, C as CurrencyCode, t as ProductVariant, w as VariantAxisWithValues, M as Money, G as AddOnWithOptions } from './payment-BNlyzm_Q.js';
|
|
6
6
|
|
|
7
7
|
interface UserIdentity {
|
|
8
8
|
uid: string;
|
|
@@ -404,4 +404,119 @@ declare function useCheckout(): {
|
|
|
404
404
|
isLoading: boolean;
|
|
405
405
|
};
|
|
406
406
|
|
|
407
|
-
|
|
407
|
+
interface QuantitySelectorProps {
|
|
408
|
+
value: number;
|
|
409
|
+
onChange: (value: number) => void;
|
|
410
|
+
min?: number;
|
|
411
|
+
max?: number;
|
|
412
|
+
className?: string;
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* QuantitySelector — controlled increment/decrement input.
|
|
416
|
+
*
|
|
417
|
+
* Pure presentation. Pass `value` and `onChange` to drive it.
|
|
418
|
+
*/
|
|
419
|
+
declare function QuantitySelector({ value, onChange, min, max, className, }: QuantitySelectorProps): React.ReactElement;
|
|
420
|
+
|
|
421
|
+
interface VariantSelectorProps {
|
|
422
|
+
variants: ProductVariant[];
|
|
423
|
+
variantAxes?: VariantAxisWithValues[];
|
|
424
|
+
basePrice?: Money;
|
|
425
|
+
selectedVariantId?: string;
|
|
426
|
+
onVariantChange: (variantId: string | undefined, variant: ProductVariant | undefined) => void;
|
|
427
|
+
className?: string;
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* VariantSelector — select product variants via axis chips or direct list.
|
|
431
|
+
*
|
|
432
|
+
* Axis mode: one row of chips per axis (e.g. Size, Temperature).
|
|
433
|
+
* Direct mode: a vertical list showing variant name + full effective price.
|
|
434
|
+
*/
|
|
435
|
+
declare function VariantSelector({ variants, variantAxes, basePrice, selectedVariantId, onVariantChange, className, }: VariantSelectorProps): React.ReactElement | null;
|
|
436
|
+
|
|
437
|
+
interface AddOnSelectorProps {
|
|
438
|
+
addOns: AddOnWithOptions[];
|
|
439
|
+
selectedOptions: string[];
|
|
440
|
+
onOptionsChange: (optionIds: string[]) => void;
|
|
441
|
+
className?: string;
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* AddOnSelector — modifier groups with single-select (radio) or multi-select (checkbox).
|
|
445
|
+
*
|
|
446
|
+
* Respects min/max constraints, required flags, and mutual exclusivity.
|
|
447
|
+
*/
|
|
448
|
+
declare function AddOnSelector({ addOns, selectedOptions, onOptionsChange, className, }: AddOnSelectorProps): React.ReactElement | null;
|
|
449
|
+
|
|
450
|
+
interface CompositeSelectorProps {
|
|
451
|
+
productId: string;
|
|
452
|
+
onSelectionsChange: (selections: ComponentSelectionInput[]) => void;
|
|
453
|
+
onPriceChange?: (price: CompositePriceResult | null) => void;
|
|
454
|
+
onReady?: (ready: boolean) => void;
|
|
455
|
+
className?: string;
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* CompositeSelector — "build your own" product configurator.
|
|
459
|
+
*
|
|
460
|
+
* Renders component groups (e.g. "Choose your base", "Pick toppings") with
|
|
461
|
+
* min/max selection constraints. Calculates real-time pricing via the SDK.
|
|
462
|
+
*/
|
|
463
|
+
declare function CompositeSelector({ productId, onSelectionsChange, onPriceChange, onReady, className, }: CompositeSelectorProps): React.ReactElement | null;
|
|
464
|
+
|
|
465
|
+
interface BundleSelectorProps {
|
|
466
|
+
bundleIdOrSlug: string;
|
|
467
|
+
onSelectionsChange: (selections: BundleSelectionInput[]) => void;
|
|
468
|
+
onReady?: (ready: boolean) => void;
|
|
469
|
+
className?: string;
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* BundleSelector — curated product set with optional variant choices.
|
|
473
|
+
*
|
|
474
|
+
* Each bundle component shows the included product. If `allow_variant_choice`
|
|
475
|
+
* is true, the customer can pick which variant they want for that slot.
|
|
476
|
+
*/
|
|
477
|
+
declare function BundleSelector({ bundleIdOrSlug, onSelectionsChange, onReady, className, }: BundleSelectorProps): React.ReactElement | null;
|
|
478
|
+
|
|
479
|
+
interface ProductCustomizerProps {
|
|
480
|
+
product: ProductWithDetails;
|
|
481
|
+
onAddToCart?: (product: ProductWithDetails, quantity: number, options: AddToCartOptions) => void | Promise<void>;
|
|
482
|
+
className?: string;
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* ProductCustomizer — full product customization + add-to-cart flow.
|
|
486
|
+
*
|
|
487
|
+
* Auto-detects product_type and routes to CompositeSelector / BundleSelector /
|
|
488
|
+
* VariantSelector + AddOnSelector. Ships a built-in "Add to Cart" button with
|
|
489
|
+
* QuantitySelector. When `onAddToCart` is provided it calls that instead of
|
|
490
|
+
* using the SDK cart (escape hatch for custom logic like toasts).
|
|
491
|
+
*/
|
|
492
|
+
declare function ProductCustomizer({ product, onAddToCart, className, }: ProductCustomizerProps): React.ReactElement;
|
|
493
|
+
|
|
494
|
+
interface ProductImageGalleryProps {
|
|
495
|
+
images: string[];
|
|
496
|
+
productName: string;
|
|
497
|
+
aspectRatio?: "square" | "4/3" | "16/10" | "3/4";
|
|
498
|
+
className?: string;
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* ProductImageGallery — main image + thumbnail strip.
|
|
502
|
+
*
|
|
503
|
+
* Uses plain `<img>` for framework-agnostic rendering (not Next.js Image).
|
|
504
|
+
*/
|
|
505
|
+
declare function ProductImageGallery({ images, productName, aspectRatio, className, }: ProductImageGalleryProps): React.ReactElement | null;
|
|
506
|
+
|
|
507
|
+
interface CartSummaryProps {
|
|
508
|
+
onCheckout?: () => void;
|
|
509
|
+
onItemRemove?: (itemId: string) => void;
|
|
510
|
+
onQuantityChange?: (itemId: string, quantity: number) => void;
|
|
511
|
+
emptyMessage?: string;
|
|
512
|
+
className?: string;
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* CartSummary — renders cart line items + totals.
|
|
516
|
+
*
|
|
517
|
+
* NOT a drawer or modal — just the cart content. Templates wrap this in
|
|
518
|
+
* their own drawer/modal shell with animations.
|
|
519
|
+
*/
|
|
520
|
+
declare function CartSummary({ onCheckout, onItemRemove, onQuantityChange, emptyMessage, className, }: CartSummaryProps): React.ReactElement;
|
|
521
|
+
|
|
522
|
+
export { Ad, AdPosition, type AdProps, AdProvider, AdSlot, AddOnSelector, type AddOnSelectorProps, type AddToCartOptions, AddressElement, AuthElement, BundleSelector, type BundleSelectorProps, CartSummary, type CartSummaryProps, CimplifyCheckout, type CimplifyCheckoutProps, type CimplifyContextValue, CimplifyProvider, type CimplifyProviderProps, CompositeSelector, type CompositeSelectorProps, ElementsProvider, PaymentElement, Price, type PriceProps, ProductCustomizer, type ProductCustomizerProps, ProductImageGallery, type ProductImageGalleryProps, QuantitySelector, type QuantitySelectorProps, type UseBundleOptions, type UseBundleResult, type UseCartItem, type UseCartOptions, type UseCartResult, type UseCategoriesOptions, type UseCategoriesResult, type UseCollectionOptions, type UseCollectionResult, type UseCollectionsOptions, type UseCollectionsResult, type UseCompositeOptions, type UseCompositeResult, type UseLocationsOptions, type UseLocationsResult, type UseOrderOptions, type UseOrderResult, type UseProductOptions, type UseProductResult, type UseProductsOptions, type UseProductsResult, type UseQuoteInput, type UseQuoteOptions, type UseQuoteResult, type UseSearchOptions, type UseSearchResult, VariantSelector, type VariantSelectorProps, useAds, useBundle, useCart, useCategories, useCheckout, useCimplify, useCollection, useCollections, useComposite, useElements, useElementsReady, useLocations, useOptionalCimplify, useOrder, useProduct, useProducts, useQuote, useSearch };
|