@lystech/core 3.0.132 → 3.0.137
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/bin/update-lystech-package.yml +1 -1
- package/dist/index.d.ts +50 -3
- package/dist/lystech-core-provider.es.js +16532 -15629
- package/dist/lystech-core-provider.umd.js +193 -192
- package/dist/lystech-core-styles.css +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -234,6 +234,23 @@ export declare type CartProduct = ShopProduct & {
|
|
|
234
234
|
quantity: number;
|
|
235
235
|
};
|
|
236
236
|
|
|
237
|
+
export declare function CheckoutPanel({ products, promoCodes, onPaid, returnUrl, customerEmail, className }: CheckoutPanelProps): JSX.Element | null;
|
|
238
|
+
|
|
239
|
+
export declare type CheckoutPanelProps = {
|
|
240
|
+
products: Line[];
|
|
241
|
+
promoCodes?: string[];
|
|
242
|
+
/** Paiement confirmé (PayPal tout de suite ; carte au retour, voir useCheckoutReturn). */
|
|
243
|
+
onPaid?: (info: {
|
|
244
|
+
provider: "paypal" | "stripe";
|
|
245
|
+
orderId?: string;
|
|
246
|
+
}) => void;
|
|
247
|
+
/** Adresse de retour après un paiement par carte (défaut : la page actuelle). */
|
|
248
|
+
returnUrl?: string;
|
|
249
|
+
/** Courriel connu du client, pré-rempli chez Stripe. */
|
|
250
|
+
customerEmail?: string;
|
|
251
|
+
className?: string;
|
|
252
|
+
};
|
|
253
|
+
|
|
237
254
|
export declare function ClientOrderBill({ bill, hideInvoiceLink }: {
|
|
238
255
|
bill: CustomerBill;
|
|
239
256
|
hideInvoiceLink?: boolean;
|
|
@@ -510,6 +527,11 @@ export declare type ImageType = {
|
|
|
510
527
|
|
|
511
528
|
export declare function InstallPwaButton({ size, visible, forceVisible, text, knowMoreUrl, knowMoreText, onAction, onPopupClose }: Props_8): JSX.Element | null;
|
|
512
529
|
|
|
530
|
+
declare type Line = {
|
|
531
|
+
UID: string;
|
|
532
|
+
quantity: number;
|
|
533
|
+
};
|
|
534
|
+
|
|
513
535
|
/**
|
|
514
536
|
* Loader partagé de toutes les apps Lystech — animation « Mirage » (ldrs),
|
|
515
537
|
* pivotée à la VERTICALE : le filet qui descend évoque un café qui coule,
|
|
@@ -585,6 +607,15 @@ declare type OrderBreakdown = {
|
|
|
585
607
|
finalShippingPrice?: number;
|
|
586
608
|
handlingFee?: number;
|
|
587
609
|
discount?: number;
|
|
610
|
+
/** Taxes déclarées par la boutique (vides si aucune). */
|
|
611
|
+
taxes?: {
|
|
612
|
+
name: string;
|
|
613
|
+
rate: number;
|
|
614
|
+
amount: number;
|
|
615
|
+
}[];
|
|
616
|
+
taxTotal?: number;
|
|
617
|
+
/** true : les prix affichés contiennent déjà la taxe. */
|
|
618
|
+
taxesIncluded?: boolean;
|
|
588
619
|
appliedPromoCodes?: {
|
|
589
620
|
code: string;
|
|
590
621
|
promo: string;
|
|
@@ -695,7 +726,7 @@ export declare type PackageUpdateEvent = {
|
|
|
695
726
|
|
|
696
727
|
export declare function PastOrdersPage({ billUID, onCollectionInvitationClick }: Props_3): JSX.Element;
|
|
697
728
|
|
|
698
|
-
export declare function PaypalCheckout({ products, promoCodes, onOrderCreated, onOrderComplete, onShipppingOptionsChange: onShippingOptionsChangeEvent, onInstrumentDeclined, onError, }: Props_6): JSX.Element;
|
|
729
|
+
export declare function PaypalCheckout({ products, promoCodes, shippingOptionId, onOrderCreated, onOrderComplete, onShipppingOptionsChange: onShippingOptionsChangeEvent, onInstrumentDeclined, onError, }: Props_6): JSX.Element;
|
|
699
730
|
|
|
700
731
|
export declare type PaypalInfoType = {
|
|
701
732
|
clientId: string;
|
|
@@ -921,6 +952,8 @@ declare type Props_6 = {
|
|
|
921
952
|
quantity: number;
|
|
922
953
|
}[];
|
|
923
954
|
promoCodes?: string[];
|
|
955
|
+
/** Option de livraison choisie dans le panier (devient celle de l'ordre PayPal). */
|
|
956
|
+
shippingOptionId?: number | string | null;
|
|
924
957
|
onOrderCreated?: (orderId: string) => void;
|
|
925
958
|
onOrderComplete?: (orderId: string) => void;
|
|
926
959
|
onShipppingOptionsChange?: (orderId: string, selectedShippingOption: {
|
|
@@ -949,6 +982,8 @@ declare type Props_7 = {
|
|
|
949
982
|
successUrl?: string;
|
|
950
983
|
cancelUrl?: string;
|
|
951
984
|
customerEmail?: string;
|
|
985
|
+
promoCodes?: string[];
|
|
986
|
+
shippingOptionId?: number | string | null;
|
|
952
987
|
label?: string;
|
|
953
988
|
block?: boolean;
|
|
954
989
|
disabled?: boolean;
|
|
@@ -1148,7 +1183,7 @@ declare interface SquareImageProps {
|
|
|
1148
1183
|
* crée la session côté backend (POST /stripe/checkout) puis redirige vers la
|
|
1149
1184
|
* page de paiement Stripe. Aucun formulaire de carte côté client.
|
|
1150
1185
|
*/
|
|
1151
|
-
export declare function StripeCheckout({ products, priceId, quantity, successUrl, cancelUrl, customerEmail, label, block, disabled, onError, onRedirect, }: Props_7): JSX.Element;
|
|
1186
|
+
export declare function StripeCheckout({ products, priceId, quantity, successUrl, cancelUrl, customerEmail, promoCodes, shippingOptionId, label, block, disabled, onError, onRedirect, }: Props_7): JSX.Element;
|
|
1152
1187
|
|
|
1153
1188
|
export declare interface StripeCheckoutInput {
|
|
1154
1189
|
/** Un seul prix Stripe (ex. depuis le catalogue). */
|
|
@@ -1162,6 +1197,10 @@ export declare interface StripeCheckoutInput {
|
|
|
1162
1197
|
successUrl: string;
|
|
1163
1198
|
cancelUrl: string;
|
|
1164
1199
|
customerEmail?: string;
|
|
1200
|
+
/** Codes promo du panier (appliqués par le serveur). */
|
|
1201
|
+
promoCodes?: string[];
|
|
1202
|
+
/** Option de livraison choisie dans le panier. */
|
|
1203
|
+
shippingOptionId?: number | string | null;
|
|
1165
1204
|
}
|
|
1166
1205
|
|
|
1167
1206
|
export declare function SubscribeToPushNotification({ size, visible, forceVisible, text, knowMoreUrl, knowMoreText, onAction, onPopupClose }: Props_9): JSX.Element;
|
|
@@ -1291,6 +1330,12 @@ export declare const useAuthPromoCodes: (userEmail: string) => UseQueryResult<Pr
|
|
|
1291
1330
|
|
|
1292
1331
|
export declare const useAxiosMiddleware: () => ProviderType_2;
|
|
1293
1332
|
|
|
1333
|
+
/**
|
|
1334
|
+
* Au retour d'un paiement par carte : « reussi », « annule » ou null.
|
|
1335
|
+
* Retire le paramètre de l'adresse pour qu'un rechargement ne rejoue rien.
|
|
1336
|
+
*/
|
|
1337
|
+
export declare function useCheckoutReturn(): "reussi" | "annule" | null;
|
|
1338
|
+
|
|
1294
1339
|
export declare const useContextMenu: () => ContextMenuContextType;
|
|
1295
1340
|
|
|
1296
1341
|
export declare const useContextMenuHandler: () => {
|
|
@@ -1416,7 +1461,9 @@ export declare const useOptionalNavigate: () => NavigateFunction | ((to: string
|
|
|
1416
1461
|
export declare const useOrderDetailsBreakdown: (organizationUID: string, products: {
|
|
1417
1462
|
UID: string;
|
|
1418
1463
|
quantity: number;
|
|
1419
|
-
}[], promoCodes: string[]
|
|
1464
|
+
}[], promoCodes: string[],
|
|
1465
|
+
/** Option de livraison choisie : le récapitulatif compte son prix (lu en base). */
|
|
1466
|
+
shippingOptionId?: number | string | null) => UseQueryResult<OrderBreakdown, unknown>;
|
|
1420
1467
|
|
|
1421
1468
|
export declare function useOrganization(): OrganizationContext;
|
|
1422
1469
|
|