@salla.sa/twilight 2.10.6 → 2.11.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.
- package/dist/@salla.sa/twilight.min.js +2 -2
- package/dist/@salla.sa/twilight.min.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +4 -4
- package/types/api/cart/index.d.ts +2 -2
- package/types/api/cart/request.d.ts +1 -1
- package/types/api/cart/response.d.ts +3 -3
- package/types/api/index.d.ts +1 -1
- package/types/api/product/index.d.ts +5 -3
- package/types/api/product/response.d.ts +106 -106
- package/types/event/cart.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salla.sa/twilight",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.0",
|
|
4
4
|
"description": "Salla Theme Toolkit, Webcomponents, Events, Requests, Utils",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
],
|
|
32
32
|
"homepage": "https://salla.dev",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@salla.sa/base": "^2.10.
|
|
35
|
-
"@salla.sa/twilight-tailwind-theme": "^2.
|
|
34
|
+
"@salla.sa/base": "^2.10.7",
|
|
35
|
+
"@salla.sa/twilight-tailwind-theme": "^2.11.0",
|
|
36
36
|
"axios": "^0.27.2",
|
|
37
37
|
"infinite-scroll": "^4.0.1",
|
|
38
38
|
"jwt-decode": "^3.1.2",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"webpack": "^4 || ^5"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "23da548117b1830c2845655b32358765245ed4f9"
|
|
65
65
|
}
|
|
@@ -18,8 +18,8 @@ export default interface CartApi {
|
|
|
18
18
|
|
|
19
19
|
getUploadImageEndpoint: (cartId?: number) => string;
|
|
20
20
|
|
|
21
|
-
getQuickOrderSettings: () => Promise<CartResponse.
|
|
22
|
-
createQuickOrder: (payload: CartRequest.
|
|
21
|
+
getQuickOrderSettings: () => Promise<CartResponse.quickOrderSettingResponse>;
|
|
22
|
+
createQuickOrder: (payload: CartRequest.quickOrderPayload) => Promise<SuccessResponse>;
|
|
23
23
|
|
|
24
24
|
//coupons
|
|
25
25
|
addCoupon: (coupon: string) => Promise<CartResponse.update>;
|
|
@@ -14,8 +14,8 @@ export namespace CartResponse {
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
export interface
|
|
18
|
-
data:
|
|
17
|
+
export interface quickOrderSettingResponse extends SuccessResponse {
|
|
18
|
+
data: QuickOrderSetting
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export interface PriceQuote extends SuccessResponse {
|
|
@@ -73,7 +73,7 @@ export interface OfferSummary {
|
|
|
73
73
|
product_id: number;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
export interface
|
|
76
|
+
export interface QuickOrderSetting {
|
|
77
77
|
title: string;
|
|
78
78
|
sub_title: string;
|
|
79
79
|
thanks_message: string;
|
package/types/api/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import {SuccessResponse} from "../../common";
|
|
2
|
+
import {ProductResponse} from "./response";
|
|
3
|
+
import {ProductRequest} from "./request";
|
|
4
4
|
|
|
5
5
|
export * from "./request";
|
|
6
6
|
export * from "./response";
|
|
7
7
|
|
|
8
|
+
|
|
8
9
|
export default interface ProductApi {
|
|
9
10
|
getPrice: (data: /*product_id*/number | ProductRequest.addItem) => Promise<ProductResponse.getPrice>;
|
|
10
11
|
availabilitySubscribe: (product_id: number | ProductRequest.availability) => Promise<SuccessResponse>;
|
|
@@ -14,4 +15,5 @@ export default interface ProductApi {
|
|
|
14
15
|
getGiftDetails: (product_id: number) => Promise<ProductResponse.giftResponse>;
|
|
15
16
|
addGiftToCart: (product_id: number, payload: Object, withRedirect: boolean) => Promise<ProductResponse.giftToCart>;
|
|
16
17
|
uploadGiftImage: (multiPartData: FormData) => Promise<ProductResponse.giftImageUpload>;
|
|
18
|
+
getDetails: (product_id: number, advancedItems: Array<'images' | 'brand' | 'tags' | 'notify_availability' | 'rating' | 'donation' | 'options' | 'sold_quantity' | 'category'>) => Promise<ProductResponse.detail>;
|
|
17
19
|
}
|
|
@@ -59,98 +59,98 @@ export interface GiftText {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
export interface ProductDetail {
|
|
62
|
-
id:
|
|
63
|
-
promotion:
|
|
64
|
-
sku:
|
|
65
|
-
mpn:
|
|
66
|
-
gtin:
|
|
67
|
-
type:
|
|
68
|
-
name:
|
|
69
|
-
short_link_code:
|
|
70
|
-
urls:
|
|
71
|
-
price:
|
|
72
|
-
taxed_price:
|
|
73
|
-
pre_tax_price:
|
|
74
|
-
tax:
|
|
75
|
-
description:
|
|
76
|
-
quantity:
|
|
77
|
-
status:
|
|
78
|
-
is_available:
|
|
79
|
-
views:
|
|
80
|
-
sale_price:
|
|
81
|
-
sale_end:
|
|
82
|
-
require_shipping:
|
|
83
|
-
cost_price:
|
|
84
|
-
weight:
|
|
85
|
-
weight_type:
|
|
86
|
-
weight_label:
|
|
87
|
-
with_tax:
|
|
88
|
-
included_tax:
|
|
89
|
-
url:
|
|
90
|
-
main_image:
|
|
91
|
-
images:
|
|
92
|
-
show_purchase_count:
|
|
93
|
-
sold_quantity:
|
|
94
|
-
sold_quantity_desc:
|
|
95
|
-
rating:
|
|
96
|
-
favorite:
|
|
97
|
-
has_special_price:
|
|
98
|
-
regular_price:
|
|
99
|
-
features:
|
|
100
|
-
max_items_per_user:
|
|
62
|
+
id: number;
|
|
63
|
+
promotion: Promotion;
|
|
64
|
+
sku: string;
|
|
65
|
+
mpn: null;
|
|
66
|
+
gtin: null;
|
|
67
|
+
type: string;
|
|
68
|
+
name: string;
|
|
69
|
+
short_link_code: string;
|
|
70
|
+
urls: Urls;
|
|
71
|
+
price: PreTaxPrice;
|
|
72
|
+
taxed_price: PreTaxPrice;
|
|
73
|
+
pre_tax_price: PreTaxPrice;
|
|
74
|
+
tax: PreTaxPrice;
|
|
75
|
+
description: string;
|
|
76
|
+
quantity: null;
|
|
77
|
+
status: string;
|
|
78
|
+
is_available: boolean;
|
|
79
|
+
views: null;
|
|
80
|
+
sale_price: PreTaxPrice;
|
|
81
|
+
sale_end: null;
|
|
82
|
+
require_shipping: boolean;
|
|
83
|
+
cost_price: string;
|
|
84
|
+
weight: number;
|
|
85
|
+
weight_type: string;
|
|
86
|
+
weight_label: null;
|
|
87
|
+
with_tax: boolean;
|
|
88
|
+
included_tax: boolean;
|
|
89
|
+
url: string;
|
|
90
|
+
main_image: string;
|
|
91
|
+
images: Image[];
|
|
92
|
+
show_purchase_count: boolean;
|
|
93
|
+
sold_quantity: number;
|
|
94
|
+
sold_quantity_desc: string;
|
|
95
|
+
rating: Rating;
|
|
96
|
+
favorite: null;
|
|
97
|
+
has_special_price: boolean;
|
|
98
|
+
regular_price: PreTaxPrice;
|
|
99
|
+
features: Features;
|
|
100
|
+
max_items_per_user: number;
|
|
101
101
|
maximum_quantity_per_order: null;
|
|
102
|
-
show_in_app:
|
|
103
|
-
has_size_guide:
|
|
104
|
-
notify_quantity:
|
|
105
|
-
hide_quantity:
|
|
106
|
-
unlimited_quantity:
|
|
107
|
-
managed_by_branches:
|
|
108
|
-
services_blocks:
|
|
109
|
-
calories:
|
|
110
|
-
customized_sku_quantity:
|
|
111
|
-
options:
|
|
112
|
-
skus:
|
|
113
|
-
tags:
|
|
102
|
+
show_in_app: boolean;
|
|
103
|
+
has_size_guide: boolean;
|
|
104
|
+
notify_quantity: null;
|
|
105
|
+
hide_quantity: boolean;
|
|
106
|
+
unlimited_quantity: boolean;
|
|
107
|
+
managed_by_branches: boolean;
|
|
108
|
+
services_blocks: ServicesBlocks;
|
|
109
|
+
calories: null;
|
|
110
|
+
customized_sku_quantity: boolean;
|
|
111
|
+
options: Option[];
|
|
112
|
+
skus: Skus[];
|
|
113
|
+
tags: any[];
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
export interface Features {
|
|
117
|
-
show_you_may_like:
|
|
118
|
-
show_rating:
|
|
119
|
-
availability_notify:
|
|
117
|
+
show_you_may_like: boolean;
|
|
118
|
+
show_rating: boolean;
|
|
119
|
+
availability_notify: null;
|
|
120
120
|
show_remaining_quantity: boolean;
|
|
121
|
-
"quick-buy":
|
|
122
|
-
buy_as_gift:
|
|
121
|
+
"quick-buy": boolean;
|
|
122
|
+
buy_as_gift: boolean;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
export interface Image {
|
|
126
|
-
id:
|
|
127
|
-
url:
|
|
128
|
-
main:
|
|
126
|
+
id: number;
|
|
127
|
+
url: string;
|
|
128
|
+
main: boolean;
|
|
129
129
|
three_d_image_url: string;
|
|
130
|
-
alt:
|
|
131
|
-
video_url:
|
|
132
|
-
type:
|
|
133
|
-
sort:
|
|
130
|
+
alt: string;
|
|
131
|
+
video_url: string;
|
|
132
|
+
type: string;
|
|
133
|
+
sort: number;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
export interface Option {
|
|
137
|
-
id:
|
|
138
|
-
name:
|
|
139
|
-
description:
|
|
140
|
-
type:
|
|
141
|
-
required:
|
|
137
|
+
id: number;
|
|
138
|
+
name: string;
|
|
139
|
+
description: null;
|
|
140
|
+
type: string;
|
|
141
|
+
required: boolean;
|
|
142
142
|
associated_with_order_time: number;
|
|
143
|
-
availability_range:
|
|
144
|
-
not_same_day_order:
|
|
145
|
-
choose_date_time:
|
|
146
|
-
from_date_time:
|
|
147
|
-
to_date_time:
|
|
148
|
-
sort:
|
|
149
|
-
advance:
|
|
150
|
-
display_type:
|
|
151
|
-
visibility:
|
|
152
|
-
translations:
|
|
153
|
-
values:
|
|
143
|
+
availability_range: boolean;
|
|
144
|
+
not_same_day_order: boolean;
|
|
145
|
+
choose_date_time: null;
|
|
146
|
+
from_date_time: null;
|
|
147
|
+
to_date_time: null;
|
|
148
|
+
sort: null;
|
|
149
|
+
advance: boolean;
|
|
150
|
+
display_type: string;
|
|
151
|
+
visibility: string;
|
|
152
|
+
translations: OptionTranslations;
|
|
153
|
+
values: Value[];
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
export interface OptionTranslations {
|
|
@@ -163,19 +163,19 @@ export interface PurpleAr {
|
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
export interface Value {
|
|
166
|
-
id:
|
|
167
|
-
name:
|
|
168
|
-
price:
|
|
169
|
-
display_value:
|
|
170
|
-
advance:
|
|
171
|
-
option_id:
|
|
172
|
-
image_url:
|
|
166
|
+
id: number;
|
|
167
|
+
name: string;
|
|
168
|
+
price: PreTaxPrice;
|
|
169
|
+
display_value: null;
|
|
170
|
+
advance: boolean;
|
|
171
|
+
option_id: number;
|
|
172
|
+
image_url: null;
|
|
173
173
|
hashed_display_value: null;
|
|
174
|
-
translations:
|
|
174
|
+
translations: ValueTranslations;
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
export interface PreTaxPrice {
|
|
178
|
-
amount:
|
|
178
|
+
amount: number;
|
|
179
179
|
currency: Currency;
|
|
180
180
|
}
|
|
181
181
|
|
|
@@ -192,14 +192,14 @@ export interface FluffyAr {
|
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
export interface Promotion {
|
|
195
|
-
title:
|
|
195
|
+
title: null;
|
|
196
196
|
sub_title: null;
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
export interface Rating {
|
|
200
200
|
total: number;
|
|
201
201
|
count: number;
|
|
202
|
-
rate:
|
|
202
|
+
rate: number;
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
export interface ServicesBlocks {
|
|
@@ -207,25 +207,25 @@ export interface ServicesBlocks {
|
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
export interface Skus {
|
|
210
|
-
id:
|
|
211
|
-
price:
|
|
212
|
-
regular_price:
|
|
213
|
-
sale_price:
|
|
214
|
-
stock_quantity:
|
|
215
|
-
barcode:
|
|
216
|
-
sku:
|
|
217
|
-
mpn:
|
|
218
|
-
gtin:
|
|
219
|
-
related_options:
|
|
210
|
+
id: number;
|
|
211
|
+
price: PreTaxPrice;
|
|
212
|
+
regular_price: PreTaxPrice;
|
|
213
|
+
sale_price: PreTaxPrice;
|
|
214
|
+
stock_quantity: null;
|
|
215
|
+
barcode: null;
|
|
216
|
+
sku: string;
|
|
217
|
+
mpn: null;
|
|
218
|
+
gtin: null;
|
|
219
|
+
related_options: number[];
|
|
220
220
|
related_option_values: number[];
|
|
221
|
-
weight:
|
|
222
|
-
weight_type:
|
|
223
|
-
weight_label:
|
|
221
|
+
weight: null;
|
|
222
|
+
weight_type: null;
|
|
223
|
+
weight_label: null;
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
export interface Urls {
|
|
227
227
|
customer: string;
|
|
228
|
-
admin:
|
|
228
|
+
admin: string;
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
|
|
@@ -265,11 +265,11 @@ export namespace ProductResponse {
|
|
|
265
265
|
}
|
|
266
266
|
|
|
267
267
|
export interface giftToCart extends SuccessResponse {
|
|
268
|
-
data:
|
|
268
|
+
data: { redirect: string }
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
export interface giftImageUpload extends SuccessResponse {
|
|
272
|
-
data:
|
|
272
|
+
data: { url: string }
|
|
273
273
|
}
|
|
274
274
|
|
|
275
275
|
export interface detail extends SuccessResponse {
|
package/types/event/cart.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export default interface CartEvent {
|
|
|
29
29
|
onCouponDeletionFailed: (callback: (error: RequestError, cart_id?: number) => void) => void;
|
|
30
30
|
|
|
31
31
|
// Checkout
|
|
32
|
-
onQuickOrderSettingFetched: (callback: (response: CartResponse.
|
|
32
|
+
onQuickOrderSettingFetched: (callback: (response: CartResponse.quickOrderSettingResponse) => void) => void;
|
|
33
33
|
onQuickOrderSettingFailed: (callback: (error: ErrorResponse) => void) => void;
|
|
34
34
|
|
|
35
35
|
onQuickOrderSucceeded: (callback: () => void) => void;
|