@open-tender/utils 0.4.77 → 0.4.79
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/cjs/hooks/useMenuItem.d.ts +2 -0
- package/dist/cjs/hooks/useOrderItem.d.ts +2 -0
- package/dist/cjs/utils/cart.d.ts +4 -0
- package/dist/cjs/utils/cart.js +7 -2
- package/dist/cjs/utils/menu.d.ts +4 -0
- package/dist/esm/hooks/useMenuItem.d.ts +2 -0
- package/dist/esm/hooks/useOrderItem.d.ts +2 -0
- package/dist/esm/utils/cart.d.ts +4 -0
- package/dist/esm/utils/cart.js +7 -2
- package/dist/esm/utils/menu.d.ts +4 -0
- package/package.json +2 -2
|
@@ -32,6 +32,8 @@ export declare const useMenuItem: (builtItem: CartItem, auth: Auth | null, looku
|
|
|
32
32
|
signature?: string | undefined;
|
|
33
33
|
similarItems: number[];
|
|
34
34
|
upsellItems: number[];
|
|
35
|
+
list_name: string | null;
|
|
36
|
+
list_id: string | null;
|
|
35
37
|
allergens_list?: import("@open-tender/types").MenuItemAllergens | undefined;
|
|
36
38
|
cals: number | null;
|
|
37
39
|
groups: import("@open-tender/types").CartItemGroups;
|
|
@@ -20,6 +20,8 @@ export declare const useOrderItem: (orderItem: CartItem, favorite?: MenuItemFavo
|
|
|
20
20
|
signature?: string | undefined;
|
|
21
21
|
similarItems: number[];
|
|
22
22
|
upsellItems: number[];
|
|
23
|
+
list_name: string | null;
|
|
24
|
+
list_id: string | null;
|
|
23
25
|
allergens: string[];
|
|
24
26
|
allergens_list?: import("@open-tender/types").MenuItemAllergens | undefined;
|
|
25
27
|
cals: number | null;
|
package/dist/cjs/utils/cart.d.ts
CHANGED
|
@@ -24,6 +24,8 @@ export declare const rehydrateCart: (menuItems: MenuItems, simpleCartItems: Simp
|
|
|
24
24
|
signature?: string | undefined;
|
|
25
25
|
similarItems: number[];
|
|
26
26
|
upsellItems: number[];
|
|
27
|
+
list_name: string | null;
|
|
28
|
+
list_id: string | null;
|
|
27
29
|
allergens: string[];
|
|
28
30
|
allergens_list?: import("@open-tender/types").MenuItemAllergens | undefined;
|
|
29
31
|
cals: number | null;
|
|
@@ -116,6 +118,8 @@ export declare const combineCarts: (cart: Cart, guestCart: Cart, cartOwner: Cart
|
|
|
116
118
|
signature?: string | undefined;
|
|
117
119
|
similarItems: number[];
|
|
118
120
|
upsellItems: number[];
|
|
121
|
+
list_name: string | null;
|
|
122
|
+
list_id: string | null;
|
|
119
123
|
allergens: string[];
|
|
120
124
|
allergens_list?: import("@open-tender/types").MenuItemAllergens | undefined;
|
|
121
125
|
cals: number | null;
|
package/dist/cjs/utils/cart.js
CHANGED
|
@@ -308,7 +308,9 @@ const makeOrderItem = (item, isEdit, soldOut = [], simpleItem, hasPoints = false
|
|
|
308
308
|
totalPrice: null,
|
|
309
309
|
upsellItems: item.upsell_items,
|
|
310
310
|
itemShape: (_b = item.item_shape) !== null && _b !== void 0 ? _b : null,
|
|
311
|
-
excludeFromBuilder: (_c = item.exclude_from_builder) !== null && _c !== void 0 ? _c : false
|
|
311
|
+
excludeFromBuilder: (_c = item.exclude_from_builder) !== null && _c !== void 0 ? _c : false,
|
|
312
|
+
list_id: item.list_id,
|
|
313
|
+
list_name: item.list_name
|
|
312
314
|
};
|
|
313
315
|
const pricedItem = (0, exports.calcPrices)(orderItem);
|
|
314
316
|
return pricedItem;
|
|
@@ -906,7 +908,10 @@ exports.checkAmountRemaining = checkAmountRemaining;
|
|
|
906
908
|
const makeDeviceType = (deviceType, deviceId) => {
|
|
907
909
|
// when app is only built in phone mode (not Universal) react-native-device-info shows device type as "Handset"
|
|
908
910
|
// so override it to "Tablet" if the deviceId has "iPad" in the name
|
|
909
|
-
deviceType =
|
|
911
|
+
deviceType =
|
|
912
|
+
deviceType === 'Handset' && !!deviceId && /iPad/.test(deviceId)
|
|
913
|
+
? 'Tablet'
|
|
914
|
+
: deviceType;
|
|
910
915
|
switch (deviceType === null || deviceType === void 0 ? void 0 : deviceType.toLowerCase()) {
|
|
911
916
|
case 'tablet':
|
|
912
917
|
return 'TABLET';
|
package/dist/cjs/utils/menu.d.ts
CHANGED
|
@@ -51,6 +51,8 @@ export declare const makeOtherMenuSections: (displayedSections: MenuDisplayedSec
|
|
|
51
51
|
upsell_items: number[];
|
|
52
52
|
item_shape: import("@open-tender/types").PizzaShape | null;
|
|
53
53
|
exclude_from_builder: boolean;
|
|
54
|
+
list_name: string | null;
|
|
55
|
+
list_id: string | null;
|
|
54
56
|
}[];
|
|
55
57
|
}[];
|
|
56
58
|
export declare const makeFlatCategories: (categories: MenuCategories) => {
|
|
@@ -96,6 +98,8 @@ export declare const makeFlatCategories: (categories: MenuCategories) => {
|
|
|
96
98
|
upsell_items: number[];
|
|
97
99
|
item_shape: import("@open-tender/types").PizzaShape | null;
|
|
98
100
|
exclude_from_builder: boolean;
|
|
101
|
+
list_name: string | null;
|
|
102
|
+
list_id: string | null;
|
|
99
103
|
}[];
|
|
100
104
|
app_image_url: string | null;
|
|
101
105
|
appearance: import("@open-tender/types").MenuCategoryAppearance;
|
|
@@ -32,6 +32,8 @@ export declare const useMenuItem: (builtItem: CartItem, auth: Auth | null, looku
|
|
|
32
32
|
signature?: string | undefined;
|
|
33
33
|
similarItems: number[];
|
|
34
34
|
upsellItems: number[];
|
|
35
|
+
list_name: string | null;
|
|
36
|
+
list_id: string | null;
|
|
35
37
|
allergens_list?: import("@open-tender/types").MenuItemAllergens | undefined;
|
|
36
38
|
cals: number | null;
|
|
37
39
|
groups: import("@open-tender/types").CartItemGroups;
|
|
@@ -20,6 +20,8 @@ export declare const useOrderItem: (orderItem: CartItem, favorite?: MenuItemFavo
|
|
|
20
20
|
signature?: string | undefined;
|
|
21
21
|
similarItems: number[];
|
|
22
22
|
upsellItems: number[];
|
|
23
|
+
list_name: string | null;
|
|
24
|
+
list_id: string | null;
|
|
23
25
|
allergens: string[];
|
|
24
26
|
allergens_list?: import("@open-tender/types").MenuItemAllergens | undefined;
|
|
25
27
|
cals: number | null;
|
package/dist/esm/utils/cart.d.ts
CHANGED
|
@@ -24,6 +24,8 @@ export declare const rehydrateCart: (menuItems: MenuItems, simpleCartItems: Simp
|
|
|
24
24
|
signature?: string | undefined;
|
|
25
25
|
similarItems: number[];
|
|
26
26
|
upsellItems: number[];
|
|
27
|
+
list_name: string | null;
|
|
28
|
+
list_id: string | null;
|
|
27
29
|
allergens: string[];
|
|
28
30
|
allergens_list?: import("@open-tender/types").MenuItemAllergens | undefined;
|
|
29
31
|
cals: number | null;
|
|
@@ -116,6 +118,8 @@ export declare const combineCarts: (cart: Cart, guestCart: Cart, cartOwner: Cart
|
|
|
116
118
|
signature?: string | undefined;
|
|
117
119
|
similarItems: number[];
|
|
118
120
|
upsellItems: number[];
|
|
121
|
+
list_name: string | null;
|
|
122
|
+
list_id: string | null;
|
|
119
123
|
allergens: string[];
|
|
120
124
|
allergens_list?: import("@open-tender/types").MenuItemAllergens | undefined;
|
|
121
125
|
cals: number | null;
|
package/dist/esm/utils/cart.js
CHANGED
|
@@ -293,7 +293,9 @@ export const makeOrderItem = (item, isEdit, soldOut = [], simpleItem, hasPoints
|
|
|
293
293
|
totalPrice: null,
|
|
294
294
|
upsellItems: item.upsell_items,
|
|
295
295
|
itemShape: (_b = item.item_shape) !== null && _b !== void 0 ? _b : null,
|
|
296
|
-
excludeFromBuilder: (_c = item.exclude_from_builder) !== null && _c !== void 0 ? _c : false
|
|
296
|
+
excludeFromBuilder: (_c = item.exclude_from_builder) !== null && _c !== void 0 ? _c : false,
|
|
297
|
+
list_id: item.list_id,
|
|
298
|
+
list_name: item.list_name
|
|
297
299
|
};
|
|
298
300
|
const pricedItem = calcPrices(orderItem);
|
|
299
301
|
return pricedItem;
|
|
@@ -866,7 +868,10 @@ export const checkAmountRemaining = (total, tenders) => {
|
|
|
866
868
|
export const makeDeviceType = (deviceType, deviceId) => {
|
|
867
869
|
// when app is only built in phone mode (not Universal) react-native-device-info shows device type as "Handset"
|
|
868
870
|
// so override it to "Tablet" if the deviceId has "iPad" in the name
|
|
869
|
-
deviceType =
|
|
871
|
+
deviceType =
|
|
872
|
+
deviceType === 'Handset' && !!deviceId && /iPad/.test(deviceId)
|
|
873
|
+
? 'Tablet'
|
|
874
|
+
: deviceType;
|
|
870
875
|
switch (deviceType === null || deviceType === void 0 ? void 0 : deviceType.toLowerCase()) {
|
|
871
876
|
case 'tablet':
|
|
872
877
|
return 'TABLET';
|
package/dist/esm/utils/menu.d.ts
CHANGED
|
@@ -51,6 +51,8 @@ export declare const makeOtherMenuSections: (displayedSections: MenuDisplayedSec
|
|
|
51
51
|
upsell_items: number[];
|
|
52
52
|
item_shape: import("@open-tender/types").PizzaShape | null;
|
|
53
53
|
exclude_from_builder: boolean;
|
|
54
|
+
list_name: string | null;
|
|
55
|
+
list_id: string | null;
|
|
54
56
|
}[];
|
|
55
57
|
}[];
|
|
56
58
|
export declare const makeFlatCategories: (categories: MenuCategories) => {
|
|
@@ -96,6 +98,8 @@ export declare const makeFlatCategories: (categories: MenuCategories) => {
|
|
|
96
98
|
upsell_items: number[];
|
|
97
99
|
item_shape: import("@open-tender/types").PizzaShape | null;
|
|
98
100
|
exclude_from_builder: boolean;
|
|
101
|
+
list_name: string | null;
|
|
102
|
+
list_id: string | null;
|
|
99
103
|
}[];
|
|
100
104
|
app_image_url: string | null;
|
|
101
105
|
appearance: import("@open-tender/types").MenuCategoryAppearance;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/utils",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.79",
|
|
4
4
|
"description": "A library of utils for use with Open Tender applications that utilize our cloud-based Order API.",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"private": false,
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@emotion/react": "^11.10.4",
|
|
39
|
-
"@open-tender/types": "^0.4.
|
|
39
|
+
"@open-tender/types": "^0.4.109",
|
|
40
40
|
"@reduxjs/toolkit": "^1.8.5",
|
|
41
41
|
"@types/google.maps": "^3.53.5",
|
|
42
42
|
"@types/jest": "^29.5.11",
|