@open-tender/utils 0.5.15 → 0.5.17
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 +1 -0
- package/dist/cjs/hooks/useModifier.d.ts +1 -0
- package/dist/cjs/hooks/useModifierGroup.d.ts +1 -0
- package/dist/cjs/hooks/useOrderItem.d.ts +1 -0
- package/dist/cjs/utils/cart.d.ts +2 -0
- package/dist/cjs/utils/cart.js +1 -0
- package/dist/cjs/utils/menu.d.ts +1 -1
- package/dist/cjs/utils/menu.js +1 -1
- package/dist/esm/hooks/useMenuItem.d.ts +1 -0
- package/dist/esm/hooks/useModifier.d.ts +1 -0
- package/dist/esm/hooks/useModifierGroup.d.ts +1 -0
- package/dist/esm/hooks/useOrderItem.d.ts +1 -0
- package/dist/esm/utils/cart.d.ts +2 -0
- package/dist/esm/utils/cart.js +1 -0
- package/dist/esm/utils/menu.d.ts +1 -1
- package/dist/esm/utils/menu.js +1 -1
- package/package.json +2 -2
|
@@ -41,6 +41,7 @@ export declare const useMenuItem: (builtItem: CartItem, auth: Auth | null, looku
|
|
|
41
41
|
groups: import("@open-tender/types").CartItemGroups;
|
|
42
42
|
id: number;
|
|
43
43
|
imageUrl: string | null;
|
|
44
|
+
appImageUrl?: string | null | undefined;
|
|
44
45
|
increment: number;
|
|
45
46
|
ingredients: string | null;
|
|
46
47
|
isSoldOut: boolean;
|
|
@@ -32,6 +32,7 @@ export declare const useModifier: (group: CartItemGroup, option: CartItemOption,
|
|
|
32
32
|
groups: import("@open-tender/types").CartItemGroups;
|
|
33
33
|
id: number;
|
|
34
34
|
imageUrl: string | null;
|
|
35
|
+
appImageUrl?: string | null | undefined;
|
|
35
36
|
ingredients: string | null;
|
|
36
37
|
isDefault: boolean;
|
|
37
38
|
isSoldOut: boolean;
|
|
@@ -30,6 +30,7 @@ export declare const useOrderItem: (orderItem: CartItem, favorite?: MenuItemFavo
|
|
|
30
30
|
groups: import("@open-tender/types").CartItemGroups;
|
|
31
31
|
id: number;
|
|
32
32
|
imageUrl: string | null;
|
|
33
|
+
appImageUrl?: string | null | undefined;
|
|
33
34
|
increment: number;
|
|
34
35
|
ingredients: string | null;
|
|
35
36
|
max: number;
|
package/dist/cjs/utils/cart.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export declare const rehydrateCart: (menuItems: MenuItems, simpleCartItems: Simp
|
|
|
34
34
|
groups: CartItemGroups;
|
|
35
35
|
id: number;
|
|
36
36
|
imageUrl: string | null;
|
|
37
|
+
appImageUrl?: string | null | undefined;
|
|
37
38
|
increment: number;
|
|
38
39
|
ingredients: string | null;
|
|
39
40
|
isSoldOut: boolean;
|
|
@@ -130,6 +131,7 @@ export declare const combineCarts: (cart: Cart, guestCart: Cart, cartOwner: Cart
|
|
|
130
131
|
groups: CartItemGroups;
|
|
131
132
|
id: number;
|
|
132
133
|
imageUrl: string | null;
|
|
134
|
+
appImageUrl?: string | null | undefined;
|
|
133
135
|
increment: number;
|
|
134
136
|
ingredients: string | null;
|
|
135
137
|
isSoldOut: boolean;
|
package/dist/cjs/utils/cart.js
CHANGED
|
@@ -232,6 +232,7 @@ const makeOrderItemGroups = (optionGroups, isEdit, soldOut = [], requestedAt = n
|
|
|
232
232
|
groups: groups,
|
|
233
233
|
id: o.id,
|
|
234
234
|
imageUrl: o.small_image_url,
|
|
235
|
+
appImageUrl: o.app_image_url,
|
|
235
236
|
increment: o.increment,
|
|
236
237
|
ingredients: o.ingredients,
|
|
237
238
|
isDefault: o.opt_is_default,
|
package/dist/cjs/utils/menu.d.ts
CHANGED
|
@@ -127,4 +127,4 @@ export declare const makeMenuItemLayout: (position: ThemeImagePosition) => {
|
|
|
127
127
|
flexDirection: string;
|
|
128
128
|
alignItems: string;
|
|
129
129
|
};
|
|
130
|
-
export declare const makeSuspendUnitlMsg: (suspendedUntil: number, tz: Timezone, soldOutMessage: string | undefined, withTime?: boolean) => string;
|
|
130
|
+
export declare const makeSuspendUnitlMsg: (suspendedUntil: number | null | undefined, tz: Timezone, soldOutMessage: string | undefined, withTime?: boolean) => string;
|
package/dist/cjs/utils/menu.js
CHANGED
|
@@ -88,7 +88,7 @@ const makeSuspendUnitlMsg = (suspendedUntil, tz, soldOutMessage, withTime = true
|
|
|
88
88
|
const soldOutDynamicMsg = soldOutMessage === null || soldOutMessage === void 0 ? void 0 : soldOutMessage.replace('{{suspended_until}}', suspendedUntilDate
|
|
89
89
|
? (0, datetimes_1.makeReadableDateStrFromIso)(suspendedUntilDate.toISOString(), tz, false, withTime)
|
|
90
90
|
: '');
|
|
91
|
-
const soldOutMsg = soldOutDynamicMsg || 'Sold out';
|
|
91
|
+
const soldOutMsg = soldOutDynamicMsg || 'Sold out for the day';
|
|
92
92
|
return soldOutMsg;
|
|
93
93
|
};
|
|
94
94
|
exports.makeSuspendUnitlMsg = makeSuspendUnitlMsg;
|
|
@@ -41,6 +41,7 @@ export declare const useMenuItem: (builtItem: CartItem, auth: Auth | null, looku
|
|
|
41
41
|
groups: import("@open-tender/types").CartItemGroups;
|
|
42
42
|
id: number;
|
|
43
43
|
imageUrl: string | null;
|
|
44
|
+
appImageUrl?: string | null | undefined;
|
|
44
45
|
increment: number;
|
|
45
46
|
ingredients: string | null;
|
|
46
47
|
isSoldOut: boolean;
|
|
@@ -32,6 +32,7 @@ export declare const useModifier: (group: CartItemGroup, option: CartItemOption,
|
|
|
32
32
|
groups: import("@open-tender/types").CartItemGroups;
|
|
33
33
|
id: number;
|
|
34
34
|
imageUrl: string | null;
|
|
35
|
+
appImageUrl?: string | null | undefined;
|
|
35
36
|
ingredients: string | null;
|
|
36
37
|
isDefault: boolean;
|
|
37
38
|
isSoldOut: boolean;
|
|
@@ -30,6 +30,7 @@ export declare const useOrderItem: (orderItem: CartItem, favorite?: MenuItemFavo
|
|
|
30
30
|
groups: import("@open-tender/types").CartItemGroups;
|
|
31
31
|
id: number;
|
|
32
32
|
imageUrl: string | null;
|
|
33
|
+
appImageUrl?: string | null | undefined;
|
|
33
34
|
increment: number;
|
|
34
35
|
ingredients: string | null;
|
|
35
36
|
max: number;
|
package/dist/esm/utils/cart.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export declare const rehydrateCart: (menuItems: MenuItems, simpleCartItems: Simp
|
|
|
34
34
|
groups: CartItemGroups;
|
|
35
35
|
id: number;
|
|
36
36
|
imageUrl: string | null;
|
|
37
|
+
appImageUrl?: string | null | undefined;
|
|
37
38
|
increment: number;
|
|
38
39
|
ingredients: string | null;
|
|
39
40
|
isSoldOut: boolean;
|
|
@@ -130,6 +131,7 @@ export declare const combineCarts: (cart: Cart, guestCart: Cart, cartOwner: Cart
|
|
|
130
131
|
groups: CartItemGroups;
|
|
131
132
|
id: number;
|
|
132
133
|
imageUrl: string | null;
|
|
134
|
+
appImageUrl?: string | null | undefined;
|
|
133
135
|
increment: number;
|
|
134
136
|
ingredients: string | null;
|
|
135
137
|
isSoldOut: boolean;
|
package/dist/esm/utils/cart.js
CHANGED
|
@@ -217,6 +217,7 @@ const makeOrderItemGroups = (optionGroups, isEdit, soldOut = [], requestedAt = n
|
|
|
217
217
|
groups: groups,
|
|
218
218
|
id: o.id,
|
|
219
219
|
imageUrl: o.small_image_url,
|
|
220
|
+
appImageUrl: o.app_image_url,
|
|
220
221
|
increment: o.increment,
|
|
221
222
|
ingredients: o.ingredients,
|
|
222
223
|
isDefault: o.opt_is_default,
|
package/dist/esm/utils/menu.d.ts
CHANGED
|
@@ -127,4 +127,4 @@ export declare const makeMenuItemLayout: (position: ThemeImagePosition) => {
|
|
|
127
127
|
flexDirection: string;
|
|
128
128
|
alignItems: string;
|
|
129
129
|
};
|
|
130
|
-
export declare const makeSuspendUnitlMsg: (suspendedUntil: number, tz: Timezone, soldOutMessage: string | undefined, withTime?: boolean) => string;
|
|
130
|
+
export declare const makeSuspendUnitlMsg: (suspendedUntil: number | null | undefined, tz: Timezone, soldOutMessage: string | undefined, withTime?: boolean) => string;
|
package/dist/esm/utils/menu.js
CHANGED
|
@@ -80,6 +80,6 @@ export const makeSuspendUnitlMsg = (suspendedUntil, tz, soldOutMessage, withTime
|
|
|
80
80
|
const soldOutDynamicMsg = soldOutMessage === null || soldOutMessage === void 0 ? void 0 : soldOutMessage.replace('{{suspended_until}}', suspendedUntilDate
|
|
81
81
|
? makeReadableDateStrFromIso(suspendedUntilDate.toISOString(), tz, false, withTime)
|
|
82
82
|
: '');
|
|
83
|
-
const soldOutMsg = soldOutDynamicMsg || 'Sold out';
|
|
83
|
+
const soldOutMsg = soldOutDynamicMsg || 'Sold out for the day';
|
|
84
84
|
return soldOutMsg;
|
|
85
85
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/utils",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.17",
|
|
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",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"@open-tender/cloud": "^0.5.15",
|
|
61
|
-
"@open-tender/types": "^0.4.
|
|
61
|
+
"@open-tender/types": "^0.4.139",
|
|
62
62
|
"@reduxjs/toolkit": "^1.8.5",
|
|
63
63
|
"react": "^18.2.0"
|
|
64
64
|
},
|