@lystech/core 3.0.43 → 3.0.45
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/index.d.ts +252 -0
- package/dist/lystech-core-provider.es.js +13254 -12410
- package/dist/lystech-core-provider.umd.js +163 -163
- package/dist/lystech-core-styles.css +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,24 @@ import { QueryClient } from '@tanstack/react-query';
|
|
|
8
8
|
import { ReactNode } from 'react';
|
|
9
9
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
10
10
|
|
|
11
|
+
export declare type AppliedPromoCodeType = {
|
|
12
|
+
promoCodeObject: PromoCodeType;
|
|
13
|
+
finalTotalPrice: number;
|
|
14
|
+
shippingAfterDiscount?: number;
|
|
15
|
+
messages?: string[];
|
|
16
|
+
discounts?: {
|
|
17
|
+
shippingDiscount?: number;
|
|
18
|
+
billDiscount?: number;
|
|
19
|
+
productsDiscounts?: {
|
|
20
|
+
UID: string;
|
|
21
|
+
discount: number;
|
|
22
|
+
newPrice: number;
|
|
23
|
+
}[];
|
|
24
|
+
};
|
|
25
|
+
success: boolean;
|
|
26
|
+
error: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
11
29
|
export declare function AskPermissionsFloatingButtons({ enableInstallAppButton, enablePushNotificationButton }: Props_9): JSX.Element;
|
|
12
30
|
|
|
13
31
|
declare type AuthContextType = {
|
|
@@ -188,6 +206,15 @@ declare type BillProduct = {
|
|
|
188
206
|
lastOrderedOn: string;
|
|
189
207
|
};
|
|
190
208
|
|
|
209
|
+
declare interface CardItem {
|
|
210
|
+
label: default_2.ReactNode;
|
|
211
|
+
labelIcon?: default_2.ReactNode;
|
|
212
|
+
value: default_2.ReactNode;
|
|
213
|
+
valueIcon?: default_2.ReactNode;
|
|
214
|
+
tooltip?: string;
|
|
215
|
+
className?: string;
|
|
216
|
+
}
|
|
217
|
+
|
|
191
218
|
export declare type CartProduct = ShopProduct & {
|
|
192
219
|
quantity: number;
|
|
193
220
|
};
|
|
@@ -258,6 +285,30 @@ declare interface ContextMenuState {
|
|
|
258
285
|
title?: string;
|
|
259
286
|
}
|
|
260
287
|
|
|
288
|
+
export declare function Countdown({ countdown, useLabels, lang, showControls, loading, showYears, onClick, onDelete, onTriggerUpdate, onToggleFeatured, }: Props_10): JSX.Element;
|
|
289
|
+
|
|
290
|
+
export declare type CountdownType = {
|
|
291
|
+
id?: number;
|
|
292
|
+
name: string;
|
|
293
|
+
description: string;
|
|
294
|
+
url: string;
|
|
295
|
+
targetTime: Date | string;
|
|
296
|
+
isReached?: boolean;
|
|
297
|
+
featured?: number;
|
|
298
|
+
createdOn?: string;
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
declare type CountdownType_2 = {
|
|
302
|
+
id?: number;
|
|
303
|
+
name: string;
|
|
304
|
+
description: string;
|
|
305
|
+
url: string;
|
|
306
|
+
targetTime: Date | string;
|
|
307
|
+
isReached?: boolean;
|
|
308
|
+
featured?: number;
|
|
309
|
+
createdOn?: string;
|
|
310
|
+
};
|
|
311
|
+
|
|
261
312
|
export declare function CurrentlyInvitedToOrdersSection({ onCollectionInvitationClick }: Props_4): JSX.Element;
|
|
262
313
|
|
|
263
314
|
export declare type CustomerBill = {
|
|
@@ -372,8 +423,66 @@ declare interface DataGridRow {
|
|
|
372
423
|
[key: string]: any;
|
|
373
424
|
}
|
|
374
425
|
|
|
426
|
+
export declare function fetchAvailableCollections(): Promise<any>;
|
|
427
|
+
|
|
428
|
+
export declare function formatDateToReadable(date: string | Date | number, showHours?: boolean): string;
|
|
429
|
+
|
|
430
|
+
export declare function formatTime(date: string | Date | number): string;
|
|
431
|
+
|
|
432
|
+
export declare function GenericCard({ imageSrc, imageSrc2, blurImage, title, extra, footerItems, footerItems2, tags, className, isSelected, onClick, onDoubleClick, onContextMenu, bottomContent, controls, contextMenuOptions, danger, success, warning, pending, }: GenericCardProps): JSX.Element;
|
|
433
|
+
|
|
434
|
+
declare interface GenericCardProps {
|
|
435
|
+
imageSrc?: string | null;
|
|
436
|
+
imageSrc2?: string | null;
|
|
437
|
+
blurImage?: boolean;
|
|
438
|
+
title: default_2.ReactNode;
|
|
439
|
+
extra?: default_2.ReactNode;
|
|
440
|
+
footerItems?: CardItem[];
|
|
441
|
+
footerItems2?: CardItem[];
|
|
442
|
+
tags?: ImageTag[];
|
|
443
|
+
className?: string;
|
|
444
|
+
isSelected?: boolean;
|
|
445
|
+
onClick?: (event: default_2.MouseEvent) => void;
|
|
446
|
+
onDoubleClick?: (event: default_2.MouseEvent) => void;
|
|
447
|
+
onContextMenu?: (event: default_2.MouseEvent) => void;
|
|
448
|
+
bottomContent?: default_2.ReactNode;
|
|
449
|
+
controls?: default_2.ReactNode[];
|
|
450
|
+
contextMenuOptions?: ContextMenuOption[];
|
|
451
|
+
danger?: boolean;
|
|
452
|
+
success?: boolean;
|
|
453
|
+
warning?: boolean;
|
|
454
|
+
pending?: boolean;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
export declare function getFeaturedImages(): Promise<ImageType[]>;
|
|
458
|
+
|
|
375
459
|
export declare function getImpersonatingUser(authKey: string): Promise<any>;
|
|
376
460
|
|
|
461
|
+
export declare function getSinglePostBySlug(slug: string): Promise<PostType>;
|
|
462
|
+
|
|
463
|
+
export declare function getUserPromoCodes(): Promise<PromoCodeType[]>;
|
|
464
|
+
|
|
465
|
+
declare interface ImageTag {
|
|
466
|
+
content?: default_2.ReactNode;
|
|
467
|
+
className?: string;
|
|
468
|
+
color?: string;
|
|
469
|
+
icon?: default_2.ReactNode;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
declare interface ImageTag_2 {
|
|
473
|
+
content?: default_2.ReactNode;
|
|
474
|
+
className?: string;
|
|
475
|
+
color?: string;
|
|
476
|
+
icon?: default_2.ReactNode;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
export declare type ImageType = {
|
|
480
|
+
UID: string;
|
|
481
|
+
name: string;
|
|
482
|
+
description: string;
|
|
483
|
+
src: string;
|
|
484
|
+
};
|
|
485
|
+
|
|
377
486
|
export declare function InstallPwaButton({ size, visible, forceVisible, text, knowMoreUrl, knowMoreText, onAction, onPopupClose }: Props_7): JSX.Element | null;
|
|
378
487
|
|
|
379
488
|
export declare function LoadingCircle(): JSX.Element;
|
|
@@ -417,6 +526,37 @@ declare type ModalPopupProps = {
|
|
|
417
526
|
onFinishOpen?: () => void;
|
|
418
527
|
};
|
|
419
528
|
|
|
529
|
+
declare type OrderBreakdown = {
|
|
530
|
+
products: {
|
|
531
|
+
UID: string;
|
|
532
|
+
name: string;
|
|
533
|
+
productType: string;
|
|
534
|
+
quantity: number;
|
|
535
|
+
itemPrice: number;
|
|
536
|
+
stackPrice: number;
|
|
537
|
+
}[];
|
|
538
|
+
totalPrice: number;
|
|
539
|
+
totalItems: number;
|
|
540
|
+
finalPriceWithoutShipping?: number;
|
|
541
|
+
finalPriceIncludingShippingAndFees?: number;
|
|
542
|
+
finalShippingPrice?: number;
|
|
543
|
+
handlingFee?: number;
|
|
544
|
+
discount?: number;
|
|
545
|
+
appliedPromoCodes?: {
|
|
546
|
+
code: string;
|
|
547
|
+
promo: string;
|
|
548
|
+
freeShipping?: boolean;
|
|
549
|
+
billDiscount?: number;
|
|
550
|
+
}[];
|
|
551
|
+
appliedSubscription?: {
|
|
552
|
+
UID: string;
|
|
553
|
+
name: string;
|
|
554
|
+
subscriptionName: string;
|
|
555
|
+
freeShipping?: boolean;
|
|
556
|
+
billDiscount?: number;
|
|
557
|
+
}[];
|
|
558
|
+
};
|
|
559
|
+
|
|
420
560
|
declare type OrganizationContext = {
|
|
421
561
|
organization: string;
|
|
422
562
|
organizationImage: string;
|
|
@@ -553,6 +693,20 @@ declare interface PopButtonProps {
|
|
|
553
693
|
|
|
554
694
|
declare type PopButtonTheme = 'pwa' | 'unsubscribed' | 'subscribed';
|
|
555
695
|
|
|
696
|
+
export declare type PostType = {
|
|
697
|
+
UID?: string;
|
|
698
|
+
id?: number;
|
|
699
|
+
title: string;
|
|
700
|
+
content_html: string;
|
|
701
|
+
postName: string;
|
|
702
|
+
src?: string;
|
|
703
|
+
imageSize?: string;
|
|
704
|
+
createdOn?: Date;
|
|
705
|
+
updatedOn?: Date;
|
|
706
|
+
fk_organization?: string;
|
|
707
|
+
fk_createdByAuthKey?: string;
|
|
708
|
+
};
|
|
709
|
+
|
|
556
710
|
declare interface ProductPopupProps {
|
|
557
711
|
product: CartProduct;
|
|
558
712
|
onAdd: (product: any) => void;
|
|
@@ -570,6 +724,8 @@ declare type ProductProp = {
|
|
|
570
724
|
fk_organization: string;
|
|
571
725
|
};
|
|
572
726
|
|
|
727
|
+
export declare function Progress({ percentage, color, showPercentage, text, }: Props_11): JSX.Element;
|
|
728
|
+
|
|
573
729
|
declare type ProgressiveWebAppContextType = {
|
|
574
730
|
useProgressiveWebAppFeatures?: boolean | 'mobile';
|
|
575
731
|
isProgressiveWebAppInstalled: boolean;
|
|
@@ -579,6 +735,22 @@ declare type ProgressiveWebAppContextType = {
|
|
|
579
735
|
installProgressiveWebApp: () => Promise<void>;
|
|
580
736
|
};
|
|
581
737
|
|
|
738
|
+
export declare function PromoCodeTag({ promoCode, showExpireInfo, onClick, isApplied, onRemove, }: Props_12): JSX.Element;
|
|
739
|
+
|
|
740
|
+
export declare type PromoCodeType = {
|
|
741
|
+
id: number;
|
|
742
|
+
code: string;
|
|
743
|
+
createdByAuthKey: string;
|
|
744
|
+
createdOn: string;
|
|
745
|
+
expireOn: string;
|
|
746
|
+
maxUse: number;
|
|
747
|
+
description: string;
|
|
748
|
+
organization: string;
|
|
749
|
+
expireIn: number;
|
|
750
|
+
promo: string;
|
|
751
|
+
target: string;
|
|
752
|
+
};
|
|
753
|
+
|
|
582
754
|
declare type Props = {
|
|
583
755
|
children: default_2.ReactNode;
|
|
584
756
|
organization?: string;
|
|
@@ -602,6 +774,34 @@ declare type Props = {
|
|
|
602
774
|
packageVersionStorageKey?: string;
|
|
603
775
|
};
|
|
604
776
|
|
|
777
|
+
declare type Props_10 = {
|
|
778
|
+
countdown: CountdownType_2;
|
|
779
|
+
useLabels?: boolean;
|
|
780
|
+
lang?: "fr" | "en";
|
|
781
|
+
showControls?: boolean;
|
|
782
|
+
loading?: boolean;
|
|
783
|
+
showYears?: boolean;
|
|
784
|
+
onClick?: () => void;
|
|
785
|
+
onDelete?: () => void;
|
|
786
|
+
onTriggerUpdate?: () => void;
|
|
787
|
+
onToggleFeatured?: () => void;
|
|
788
|
+
};
|
|
789
|
+
|
|
790
|
+
declare type Props_11 = {
|
|
791
|
+
percentage?: number;
|
|
792
|
+
color?: string;
|
|
793
|
+
showPercentage?: boolean;
|
|
794
|
+
text?: string;
|
|
795
|
+
};
|
|
796
|
+
|
|
797
|
+
declare type Props_12 = {
|
|
798
|
+
promoCode: PromoCodeType;
|
|
799
|
+
showExpireInfo?: boolean;
|
|
800
|
+
onClick?: () => void;
|
|
801
|
+
isApplied?: boolean;
|
|
802
|
+
onRemove?: () => void;
|
|
803
|
+
};
|
|
804
|
+
|
|
605
805
|
declare type Props_2 = {
|
|
606
806
|
currentCollectionUID?: string;
|
|
607
807
|
pleaseSelectACollectionToStartText?: string;
|
|
@@ -779,6 +979,45 @@ export declare type SimplifiedUser = {
|
|
|
779
979
|
lastLogin?: string;
|
|
780
980
|
} | undefined;
|
|
781
981
|
|
|
982
|
+
export declare function SquareImage({ src, src2, altImage, alt, size, mobileSize, minSize, minMobileSize, containerStyle, containerClassName, imageStyle, imageClassName, overlay, circle, rounded, shadow, invertColors, border, borderColor, borderWidth, blurImage, onClick, onContextMenu, onImageLoad, placeholderSrc, blurAmount, allowZoom, zoomFactor, previewImageSrc, previewPosition, contain, previewText, tags, }: SquareImageProps): JSX.Element;
|
|
983
|
+
|
|
984
|
+
declare interface SquareImageProps {
|
|
985
|
+
src: string;
|
|
986
|
+
src2?: string;
|
|
987
|
+
altImage?: string;
|
|
988
|
+
alt?: string;
|
|
989
|
+
size?: string;
|
|
990
|
+
mobileSize?: string;
|
|
991
|
+
minSize?: string;
|
|
992
|
+
minMobileSize?: string;
|
|
993
|
+
containerStyle?: default_2.CSSProperties;
|
|
994
|
+
containerClassName?: string;
|
|
995
|
+
imageStyle?: default_2.CSSProperties;
|
|
996
|
+
imageClassName?: string;
|
|
997
|
+
overlay?: boolean;
|
|
998
|
+
circle?: boolean;
|
|
999
|
+
rounded?: boolean;
|
|
1000
|
+
shadow?: boolean;
|
|
1001
|
+
invertColors?: boolean;
|
|
1002
|
+
border?: boolean;
|
|
1003
|
+
borderColor?: string;
|
|
1004
|
+
borderWidth?: string;
|
|
1005
|
+
blurImage?: boolean;
|
|
1006
|
+
onClick?: (e: default_2.MouseEvent<HTMLDivElement>) => void;
|
|
1007
|
+
onContextMenu?: (e: default_2.MouseEvent<HTMLDivElement>) => void;
|
|
1008
|
+
onImageLoad?: (loadedCorrectly: boolean) => void;
|
|
1009
|
+
lazyLoad?: boolean;
|
|
1010
|
+
placeholderSrc?: string;
|
|
1011
|
+
blurAmount?: string;
|
|
1012
|
+
allowZoom?: boolean;
|
|
1013
|
+
zoomFactor?: number;
|
|
1014
|
+
previewImageSrc?: string;
|
|
1015
|
+
previewPosition?: "topRight" | "topLeft" | "bottomRight" | "bottomLeft";
|
|
1016
|
+
contain?: boolean;
|
|
1017
|
+
previewText?: string;
|
|
1018
|
+
tags?: ImageTag_2[];
|
|
1019
|
+
}
|
|
1020
|
+
|
|
782
1021
|
export declare function SubscribeToPushNotification({ size, visible, forceVisible, text, knowMoreUrl, knowMoreText, onAction, onPopupClose }: Props_8): JSX.Element;
|
|
783
1022
|
|
|
784
1023
|
export declare type Subscription = {
|
|
@@ -886,6 +1125,8 @@ export declare function updateUserImageUrlFunction(authKey: string, imageUrl: st
|
|
|
886
1125
|
|
|
887
1126
|
export declare function useAuth(): AuthContextType;
|
|
888
1127
|
|
|
1128
|
+
export declare const useAuthPromoCodes: (userEmail: string) => UseQueryResult<PromoCodeType[], unknown>;
|
|
1129
|
+
|
|
889
1130
|
export declare const useAxiosMiddleware: () => ProviderType_2;
|
|
890
1131
|
|
|
891
1132
|
export declare const useContextMenu: () => ContextMenuContextType;
|
|
@@ -894,6 +1135,8 @@ export declare const useContextMenuHandler: () => {
|
|
|
894
1135
|
handleContextMenu: (event: default_2.MouseEvent, options: ContextMenuOption[], title?: string) => void;
|
|
895
1136
|
};
|
|
896
1137
|
|
|
1138
|
+
export declare const useFeaturedImages: () => UseQueryResult<ImageType[], unknown>;
|
|
1139
|
+
|
|
897
1140
|
export declare const useImpersonatingUser: (authKey: string) => UseQueryResult<any, unknown>;
|
|
898
1141
|
|
|
899
1142
|
export declare const useInvitedToOrders: (email: string, organization?: string) => UseQueryResult<CollectionInvitationType[], unknown>;
|
|
@@ -906,6 +1149,11 @@ export declare const useOptionalNavigate: () => NavigateFunction | ((to: string
|
|
|
906
1149
|
replace?: boolean;
|
|
907
1150
|
}) => void);
|
|
908
1151
|
|
|
1152
|
+
export declare const useOrderDetailsBreakdown: (organizationUID: string, products: {
|
|
1153
|
+
UID: string;
|
|
1154
|
+
quantity: number;
|
|
1155
|
+
}[], promoCodes: string[]) => UseQueryResult<OrderBreakdown, unknown>;
|
|
1156
|
+
|
|
909
1157
|
export declare function useOrganization(): OrganizationContext;
|
|
910
1158
|
|
|
911
1159
|
export declare const useOrganizationDetails: (organizationSubdomain: string) => UseQueryResult<OrganizationType | null, unknown>;
|
|
@@ -971,8 +1219,12 @@ export declare type UserSubscription = {
|
|
|
971
1219
|
rewards?: SubscriptionReward[];
|
|
972
1220
|
};
|
|
973
1221
|
|
|
1222
|
+
export declare const useSinglePost: (slug: string, organization: string) => UseQueryResult<PostType, unknown>;
|
|
1223
|
+
|
|
974
1224
|
export declare const useTheme: () => ThemeContextType;
|
|
975
1225
|
|
|
976
1226
|
export declare const useUserRoleDetails: (authKey: string, organizationSubdomain: string) => UseQueryResult<UserRoleDetails, unknown>;
|
|
977
1227
|
|
|
1228
|
+
export declare function validatePromoCode(code: string, products: any[]): Promise<AppliedPromoCodeType>;
|
|
1229
|
+
|
|
978
1230
|
export { }
|