@soma-vertical-web/multi-lib 0.0.14 → 0.0.16
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/contexts/contexts/pdp/PDPDataContext.d.ts +2 -8
- package/contexts/index.d.ts +1 -5
- package/data/helpers/cart/index.d.ts +1 -1
- package/data/helpers/product/generalInfo.d.ts +2 -2
- package/data/helpers/product/skuInfos.d.ts +2 -2
- package/index.js +3 -3
- package/index.mjs +1241 -1237
- package/package.json +1 -1
- package/types/constants.d.ts +10 -0
- package/types/contexts/contexts/pdp.d.ts +7 -0
- package/types/data/events/index.d.ts +4 -7
- package/types/data/helpers/index.d.ts +6 -178
- package/types/layout/team-components/AddToCart/index.d.ts +3 -1
package/package.json
CHANGED
package/types/constants.d.ts
CHANGED
|
@@ -23,4 +23,14 @@ export declare const PLP_FILTERS_SORT: {
|
|
|
23
23
|
export type Z_INDEX_WARType = Record<string, number>;
|
|
24
24
|
export type ADD_TO_CARTType = Record<string, Record<string, string>>;
|
|
25
25
|
export type TEXTURE_IMAGEType = string;
|
|
26
|
+
export type TOGGLE_STYLE_MODIFIERType = React.CSSProperties;
|
|
27
|
+
export type NAME_SPLIT_SYMBOLType = string;
|
|
28
|
+
export type PLP_FILTERSType = {
|
|
29
|
+
key: string;
|
|
30
|
+
label: string;
|
|
31
|
+
eventLabel: string;
|
|
32
|
+
order: number;
|
|
33
|
+
}[];
|
|
34
|
+
export type MAIN_IMAGEType = string;
|
|
35
|
+
export type PDP_INFOType = Record<string, Record<string, string>>;
|
|
26
36
|
export declare const ObjectFitsDefault: readonly ["contain", "cover", "fill", "none"];
|
|
@@ -4,6 +4,7 @@ import { Sizes as BtnSizes } from '@soma-vertical-web/core-components/src/lib/Bu
|
|
|
4
4
|
import { ImageType, ProductType_PDP } from '../../global/product';
|
|
5
5
|
import { TagCommercialConsumer } from '../../cms/ContentTypes/FlagsAndTags';
|
|
6
6
|
import { UseBackPDCProps } from '../hooks';
|
|
7
|
+
import { PDP_INFOType, NAME_SPLIT_SYMBOLType } from '../../constants';
|
|
7
8
|
|
|
8
9
|
export type SimilarsType = {
|
|
9
10
|
currentSimilarInfo: {
|
|
@@ -106,3 +107,9 @@ export interface BottomNavigationProps {
|
|
|
106
107
|
};
|
|
107
108
|
}
|
|
108
109
|
export type BottomNavigationActionsProps = BottomNavigationProps;
|
|
110
|
+
export interface PDPDataProviderProps extends PropsWithChildren {
|
|
111
|
+
productData: ProductType_PDP;
|
|
112
|
+
isKit: boolean;
|
|
113
|
+
PDP_INFO: PDP_INFOType;
|
|
114
|
+
NAME_SPLIT_SYMBOL: NAME_SPLIT_SYMBOLType;
|
|
115
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { MutableRefObject, PropsWithChildren } from 'react';
|
|
2
2
|
import { CartItemStore } from '../../contexts/store/cart';
|
|
3
|
+
import { MAIN_IMAGEType, NAME_SPLIT_SYMBOLType, PLP_FILTERSType } from '../../constants';
|
|
3
4
|
|
|
4
5
|
export interface ItemListType {
|
|
5
6
|
item_list_name?: string | null;
|
|
@@ -49,16 +50,12 @@ export interface EventsFunctionType {
|
|
|
49
50
|
viewCartEvent: (props: EventsDataProps) => void;
|
|
50
51
|
readyEvents: (props: EventsDataProps) => void;
|
|
51
52
|
configs: {
|
|
52
|
-
PLP_FILTERS:
|
|
53
|
-
key: string;
|
|
54
|
-
label: string;
|
|
55
|
-
eventLabel: string;
|
|
56
|
-
order: number;
|
|
57
|
-
}[];
|
|
53
|
+
PLP_FILTERS: PLP_FILTERSType;
|
|
58
54
|
currency: string;
|
|
59
55
|
categoryOff: string;
|
|
60
56
|
storeUrl: string;
|
|
61
|
-
MAIN_IMAGE:
|
|
57
|
+
MAIN_IMAGE: MAIN_IMAGEType;
|
|
58
|
+
NAME_SPLIT_SYMBOL: NAME_SPLIT_SYMBOLType;
|
|
62
59
|
};
|
|
63
60
|
}
|
|
64
61
|
export type SendDatalayerEventType = {
|
|
@@ -1,181 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
sellerName: string;
|
|
8
|
-
isSellerDefault?: boolean;
|
|
9
|
-
};
|
|
10
|
-
export type InstallmentType = {
|
|
11
|
-
Value: number;
|
|
12
|
-
InterestRate: number;
|
|
13
|
-
TotalValuePlusInterestRate: number;
|
|
14
|
-
NumberOfInstallments: number;
|
|
15
|
-
PaymentSystemName: string;
|
|
16
|
-
PaymentSystemGroupName: string;
|
|
17
|
-
Name: string;
|
|
18
|
-
};
|
|
19
|
-
export type DeliverySlaSampleType = {
|
|
20
|
-
DeliverySlaPerTypes: any[];
|
|
21
|
-
Region: any;
|
|
22
|
-
};
|
|
23
|
-
export type PaymentOptionInstallmentType = {
|
|
24
|
-
count: number;
|
|
25
|
-
hasInterestRate: boolean;
|
|
26
|
-
interestRate: number;
|
|
27
|
-
value: number;
|
|
28
|
-
total: number;
|
|
29
|
-
sellerMerchantInstallments: {
|
|
30
|
-
id: string;
|
|
31
|
-
count: number;
|
|
32
|
-
hasInterestRate: boolean;
|
|
33
|
-
interestRate: number;
|
|
34
|
-
value: number;
|
|
35
|
-
total: number;
|
|
36
|
-
}[];
|
|
37
|
-
};
|
|
38
|
-
export type PaymentOptionType = {
|
|
39
|
-
paymentSystem: string;
|
|
40
|
-
bin: any;
|
|
41
|
-
paymentName: string;
|
|
42
|
-
paymentGroupName: string;
|
|
43
|
-
value: number;
|
|
44
|
-
installments: PaymentOptionInstallmentType[];
|
|
45
|
-
};
|
|
46
|
-
export type PaymentSystemType = {
|
|
47
|
-
id: number;
|
|
48
|
-
name: string;
|
|
49
|
-
groupName: string;
|
|
50
|
-
validator: any;
|
|
51
|
-
stringId: string;
|
|
52
|
-
template: string;
|
|
53
|
-
requiresDocument: boolean;
|
|
54
|
-
isCustom: boolean;
|
|
55
|
-
description: any;
|
|
56
|
-
requiresAuthentication: boolean;
|
|
57
|
-
dueDate: string;
|
|
58
|
-
availablePayments: any;
|
|
59
|
-
};
|
|
60
|
-
export type PaymentOptionsType = {
|
|
61
|
-
installmentOptions: PaymentOptionType[];
|
|
62
|
-
paymentSystems: PaymentSystemType[];
|
|
63
|
-
payments: any[];
|
|
64
|
-
giftCards: any[];
|
|
65
|
-
giftCardMessages: any[];
|
|
66
|
-
availableAccounts: any[];
|
|
67
|
-
availableTokens: any[];
|
|
68
|
-
};
|
|
69
|
-
export type CommertialOfferType = {
|
|
70
|
-
DeliverySlaSamplesPerRegion: {
|
|
71
|
-
[key: string]: DeliverySlaSampleType;
|
|
72
|
-
};
|
|
73
|
-
Installments: InstallmentType[];
|
|
74
|
-
DiscountHighLight: any[];
|
|
75
|
-
GiftSkuIds: any[];
|
|
76
|
-
Teasers: any[];
|
|
77
|
-
PromotionTeasers: any[];
|
|
78
|
-
BuyTogether: any[];
|
|
79
|
-
ItemMetadataAttachment: any[];
|
|
80
|
-
Price: number;
|
|
81
|
-
ListPrice: number;
|
|
82
|
-
PriceWithoutDiscount: number;
|
|
83
|
-
FullSellingPrice: number;
|
|
84
|
-
RewardValue: number;
|
|
85
|
-
PriceValidUntil: string;
|
|
86
|
-
AvailableQuantity: number;
|
|
87
|
-
IsAvailable: boolean;
|
|
88
|
-
Tax: number;
|
|
89
|
-
DeliverySlaSamples: DeliverySlaSampleType[];
|
|
90
|
-
GetInfoErrorMessage: any;
|
|
91
|
-
CacheVersionUsedToCallCheckout: string;
|
|
92
|
-
PaymentOptions: PaymentOptionsType;
|
|
93
|
-
};
|
|
94
|
-
export type SellerType = {
|
|
95
|
-
sellerId: string;
|
|
96
|
-
sellerName: string;
|
|
97
|
-
addToCartLink: string;
|
|
98
|
-
sellerDefault: boolean;
|
|
99
|
-
commertialOffer: CommertialOfferType;
|
|
100
|
-
};
|
|
101
|
-
export type ImageType = {
|
|
102
|
-
imageId: string;
|
|
103
|
-
imageLabel: string;
|
|
104
|
-
imageTag: string;
|
|
105
|
-
imageUrl: string;
|
|
106
|
-
imageText: string;
|
|
107
|
-
imageLastModified: string;
|
|
108
|
-
};
|
|
109
|
-
export type ReferenceIdType = {
|
|
110
|
-
Key: string;
|
|
111
|
-
Value: string;
|
|
112
|
-
};
|
|
113
|
-
export type ItemType = {
|
|
114
|
-
itemId: string;
|
|
115
|
-
name: string;
|
|
116
|
-
nameComplete: string;
|
|
117
|
-
complementName: string;
|
|
118
|
-
ean: string;
|
|
119
|
-
referenceId: ReferenceIdType[];
|
|
120
|
-
measurementUnit: string;
|
|
121
|
-
unitMultiplier: number;
|
|
122
|
-
modalType: string | null;
|
|
123
|
-
isKit: boolean;
|
|
124
|
-
images: ImageType[];
|
|
125
|
-
Tamanho: string[];
|
|
126
|
-
variations: string[];
|
|
127
|
-
Videos: any[];
|
|
128
|
-
estimatedDateArrival: string | null;
|
|
129
|
-
sellers: SellerType[];
|
|
130
|
-
};
|
|
131
|
-
export type ProductType = {
|
|
132
|
-
productId: string;
|
|
133
|
-
productName: string;
|
|
134
|
-
brand: string;
|
|
135
|
-
brandId: number;
|
|
136
|
-
brandImageUrl: string | null;
|
|
137
|
-
linkText: string;
|
|
138
|
-
productReference: string;
|
|
139
|
-
productReferenceCode: string;
|
|
140
|
-
categoryId: string;
|
|
141
|
-
productTitle: string;
|
|
142
|
-
metaTagDescription: string;
|
|
143
|
-
releaseDate: string;
|
|
144
|
-
clusterHighlights: Record<string, string>;
|
|
145
|
-
productClusters: Record<string, string>;
|
|
146
|
-
searchableClusters: Record<string, string>;
|
|
147
|
-
categories: string[];
|
|
148
|
-
categoriesIds: string[];
|
|
149
|
-
link: string;
|
|
150
|
-
Informação: string[];
|
|
151
|
-
'Tipo de Cor': string[];
|
|
152
|
-
Composição: string[];
|
|
153
|
-
'Tipo de Produto': string[];
|
|
154
|
-
SALE: string[];
|
|
155
|
-
Coleção: string[];
|
|
156
|
-
'Coleção Atual': string[];
|
|
157
|
-
'ID Coleção': string[];
|
|
158
|
-
'Tabela de Medidas': string[];
|
|
159
|
-
'Cores Filtráveis': string[];
|
|
160
|
-
Especificação: string[];
|
|
161
|
-
allSpecifications: string[];
|
|
162
|
-
allSpecificationsGroups: string[];
|
|
163
|
-
description: string;
|
|
164
|
-
items: ItemType[];
|
|
165
|
-
skuSpecifications: {
|
|
166
|
-
field: {
|
|
167
|
-
id: number;
|
|
168
|
-
name: string;
|
|
169
|
-
isActive: boolean;
|
|
170
|
-
position: number;
|
|
171
|
-
type: string;
|
|
172
|
-
};
|
|
173
|
-
values: {
|
|
174
|
-
id: string;
|
|
175
|
-
name: string;
|
|
176
|
-
position: number;
|
|
177
|
-
}[];
|
|
178
|
-
}[];
|
|
1
|
+
import { ItemType_PDP } from '../../global/product';
|
|
2
|
+
import { NAME_SPLIT_SYMBOLType } from '../../constants';
|
|
3
|
+
|
|
4
|
+
export type GetSkuInfosProps = {
|
|
5
|
+
items: ItemType_PDP[];
|
|
6
|
+
NAME_SPLIT_SYMBOL: NAME_SPLIT_SYMBOLType;
|
|
179
7
|
};
|
|
180
8
|
export interface ParsePriceProps {
|
|
181
9
|
valueInCents: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ADD_TO_CARTType, ObjectFitsDefault, TEXTURE_IMAGEType, Z_INDEX_WARType } from '../../../constants';
|
|
1
|
+
import { ADD_TO_CARTType, ObjectFitsDefault, TEXTURE_IMAGEType, TOGGLE_STYLE_MODIFIERType, Z_INDEX_WARType, NAME_SPLIT_SYMBOLType } from '../../../constants';
|
|
2
2
|
import { CartItemStore } from '../../../contexts/store/cart';
|
|
3
3
|
import { Dispatch, HTMLAttributes, MutableRefObject, ReactNode, SetStateAction, VideoHTMLAttributes } from 'react';
|
|
4
4
|
|
|
@@ -13,6 +13,8 @@ type CONSTANTS_TYPE = {
|
|
|
13
13
|
Z_INDEX_WAR: Z_INDEX_WARType;
|
|
14
14
|
ADD_TO_CART: ADD_TO_CARTType;
|
|
15
15
|
TEXTURE_IMAGE: TEXTURE_IMAGEType;
|
|
16
|
+
TOGGLE_STYLE_MODIFIER: TOGGLE_STYLE_MODIFIERType;
|
|
17
|
+
NAME_SPLIT_SYMBOL: NAME_SPLIT_SYMBOLType;
|
|
16
18
|
};
|
|
17
19
|
export interface RootProps extends HTMLAttributes<HTMLDivElement> {
|
|
18
20
|
component?: ReactNode;
|