@open-tender/store 0.5.22 → 0.5.24
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/.DS_Store +0 -0
- package/dist/cjs/slices/kiosk.d.ts +4 -2
- package/dist/cjs/slices/kiosk.js +10 -4
- package/dist/cjs/types/api/kiosk.d.ts +5 -0
- package/dist/cjs/utils/order.d.ts +1 -1
- package/dist/esm/slices/kiosk.d.ts +4 -2
- package/dist/esm/slices/kiosk.js +8 -3
- package/dist/esm/types/api/kiosk.d.ts +5 -0
- package/dist/esm/utils/order.d.ts +1 -1
- package/package.json +1 -1
package/dist/.DS_Store
CHANGED
|
Binary file
|
|
@@ -11,7 +11,8 @@ export interface KioskState {
|
|
|
11
11
|
brand: KioskBrand | null;
|
|
12
12
|
content: KioskContent | null;
|
|
13
13
|
theme: ThemeCloud | null;
|
|
14
|
-
ratio:
|
|
14
|
+
ratio: number;
|
|
15
|
+
displaySettings: any;
|
|
15
16
|
loading: RequestStatus;
|
|
16
17
|
error: RequestError | null;
|
|
17
18
|
retries: number;
|
|
@@ -33,6 +34,7 @@ export declare const selectKioskRcId: (state: AppState) => number | null;
|
|
|
33
34
|
export declare const selectKioskBrand: (state: AppState) => KioskBrand | null;
|
|
34
35
|
export declare const selectKioskContent: (state: AppState) => KioskContent | null;
|
|
35
36
|
export declare const selectKioskTheme: (state: AppState) => ThemeCloud | null;
|
|
36
|
-
export declare const selectKioskRatio: (state: AppState) =>
|
|
37
|
+
export declare const selectKioskRatio: (state: AppState) => number;
|
|
38
|
+
export declare const selectKioskDisplay: (state: AppState) => any;
|
|
37
39
|
export declare const selectKioskContentSection: (page: string) => (state: AppState) => unknown;
|
|
38
40
|
export declare const kioskReducer: import("redux").Reducer<KioskState, import("redux").AnyAction>;
|
package/dist/cjs/slices/kiosk.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.kioskReducer = exports.selectKioskContentSection = exports.selectKioskRatio = exports.selectKioskTheme = exports.selectKioskContent = exports.selectKioskBrand = exports.selectKioskRcId = exports.selectKioskStore = exports.selectKioskVersion = exports.selectKiosk = exports.setKioskRatio = exports.setKioskVersion = exports.incrementKioskRetries = exports.resetKioskRetries = exports.resetKiosk = exports.fetchKioskConfig = exports.KioskActionType = void 0;
|
|
4
|
+
exports.kioskReducer = exports.selectKioskContentSection = exports.selectKioskDisplay = exports.selectKioskRatio = exports.selectKioskTheme = exports.selectKioskContent = exports.selectKioskBrand = exports.selectKioskRcId = exports.selectKioskStore = exports.selectKioskVersion = exports.selectKiosk = exports.setKioskRatio = exports.setKioskVersion = exports.incrementKioskRetries = exports.resetKioskRetries = exports.resetKiosk = exports.fetchKioskConfig = exports.KioskActionType = void 0;
|
|
5
5
|
var tslib_1 = require("tslib");
|
|
6
6
|
var toolkit_1 = require("@reduxjs/toolkit");
|
|
7
7
|
var services_1 = require("../services");
|
|
@@ -18,6 +18,7 @@ var initialState = {
|
|
|
18
18
|
content: null,
|
|
19
19
|
theme: null,
|
|
20
20
|
ratio: 2,
|
|
21
|
+
displaySettings: null,
|
|
21
22
|
loading: 'idle',
|
|
22
23
|
error: null,
|
|
23
24
|
retries: 0
|
|
@@ -38,7 +39,7 @@ exports.fetchKioskConfig = (0, toolkit_1.createAsyncThunk)(KioskActionType.Fetch
|
|
|
38
39
|
var apiUrl = _a.apiUrl;
|
|
39
40
|
var dispatch = _b.dispatch, rejectWithValue = _b.rejectWithValue;
|
|
40
41
|
return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
41
|
-
var app, api, _c, kioskConfig, store, err, brand, content, theme,
|
|
42
|
+
var app, api, _c, kioskConfig, store, err, brand, content, theme, settings, ratio, displaySettings, revenueCenterId, themeEnhanced, themeDevice, err_1;
|
|
42
43
|
return tslib_1.__generator(this, function (_d) {
|
|
43
44
|
switch (_d.label) {
|
|
44
45
|
case 0:
|
|
@@ -56,9 +57,9 @@ exports.fetchKioskConfig = (0, toolkit_1.createAsyncThunk)(KioskActionType.Fetch
|
|
|
56
57
|
return [2 /*return*/, rejectWithValue(err)];
|
|
57
58
|
}
|
|
58
59
|
dispatch((0, config_1.setApi)(api));
|
|
59
|
-
brand = kioskConfig.brand, content = kioskConfig.content, theme = kioskConfig.theme;
|
|
60
|
+
brand = kioskConfig.brand, content = kioskConfig.content, theme = kioskConfig.theme, settings = kioskConfig.settings;
|
|
61
|
+
ratio = settings.ratio, displaySettings = settings.displaySettings;
|
|
60
62
|
revenueCenterId = store.revenue_center_id;
|
|
61
|
-
ratio = 2;
|
|
62
63
|
themeEnhanced = enhanceTheme(theme);
|
|
63
64
|
themeDevice = (0, utils_1.decorateTheme)(themeEnhanced, ratio);
|
|
64
65
|
return [2 /*return*/, {
|
|
@@ -69,6 +70,7 @@ exports.fetchKioskConfig = (0, toolkit_1.createAsyncThunk)(KioskActionType.Fetch
|
|
|
69
70
|
content: content,
|
|
70
71
|
theme: themeDevice,
|
|
71
72
|
ratio: ratio,
|
|
73
|
+
displaySettings: displaySettings,
|
|
72
74
|
error: null,
|
|
73
75
|
loading: 'idle',
|
|
74
76
|
retries: 0
|
|
@@ -139,6 +141,10 @@ var selectKioskTheme = function (state) { return state.kiosk.theme; };
|
|
|
139
141
|
exports.selectKioskTheme = selectKioskTheme;
|
|
140
142
|
var selectKioskRatio = function (state) { return state.kiosk.ratio; };
|
|
141
143
|
exports.selectKioskRatio = selectKioskRatio;
|
|
144
|
+
var selectKioskDisplay = function (state) {
|
|
145
|
+
return state.kiosk.displaySettings;
|
|
146
|
+
};
|
|
147
|
+
exports.selectKioskDisplay = selectKioskDisplay;
|
|
142
148
|
var selectKioskContentSection = function (page) { return function (state) {
|
|
143
149
|
var _a;
|
|
144
150
|
return (_a = state.kiosk.content) === null || _a === void 0 ? void 0 : _a[page];
|
|
@@ -5,8 +5,13 @@ export interface Dimensions {
|
|
|
5
5
|
}
|
|
6
6
|
export declare type KioskBrand = Record<string, unknown>;
|
|
7
7
|
export declare type KioskContent = Record<string, unknown>;
|
|
8
|
+
export interface KioskSettings {
|
|
9
|
+
ratio: number;
|
|
10
|
+
displaySettings: any;
|
|
11
|
+
}
|
|
8
12
|
export interface KioskConfig {
|
|
9
13
|
brand: KioskBrand;
|
|
10
14
|
content: KioskContent;
|
|
11
15
|
theme: ThemeCloud;
|
|
16
|
+
settings: KioskSettings;
|
|
12
17
|
}
|
|
@@ -73,7 +73,7 @@ export declare const calcPrices: (item: CartItem) => {
|
|
|
73
73
|
similarItems: number[];
|
|
74
74
|
};
|
|
75
75
|
export declare const calcNutrition: (item: CartItem) => NutritionalInfo | null;
|
|
76
|
-
export declare const makeCartItem: (item: MenuItem, isEdit?: boolean, soldOut?: SoldOut, simpleItem?: SimpleCartItem, hasPoints?: boolean) => {
|
|
76
|
+
export declare const makeCartItem: (item: MenuItem, isEdit?: boolean, soldOut?: SoldOut, simpleItem?: SimpleCartItem | null, hasPoints?: boolean) => {
|
|
77
77
|
groups: {
|
|
78
78
|
quantity: number;
|
|
79
79
|
options: {
|
|
@@ -11,7 +11,8 @@ export interface KioskState {
|
|
|
11
11
|
brand: KioskBrand | null;
|
|
12
12
|
content: KioskContent | null;
|
|
13
13
|
theme: ThemeCloud | null;
|
|
14
|
-
ratio:
|
|
14
|
+
ratio: number;
|
|
15
|
+
displaySettings: any;
|
|
15
16
|
loading: RequestStatus;
|
|
16
17
|
error: RequestError | null;
|
|
17
18
|
retries: number;
|
|
@@ -33,6 +34,7 @@ export declare const selectKioskRcId: (state: AppState) => number | null;
|
|
|
33
34
|
export declare const selectKioskBrand: (state: AppState) => KioskBrand | null;
|
|
34
35
|
export declare const selectKioskContent: (state: AppState) => KioskContent | null;
|
|
35
36
|
export declare const selectKioskTheme: (state: AppState) => ThemeCloud | null;
|
|
36
|
-
export declare const selectKioskRatio: (state: AppState) =>
|
|
37
|
+
export declare const selectKioskRatio: (state: AppState) => number;
|
|
38
|
+
export declare const selectKioskDisplay: (state: AppState) => any;
|
|
37
39
|
export declare const selectKioskContentSection: (page: string) => (state: AppState) => unknown;
|
|
38
40
|
export declare const kioskReducer: import("redux").Reducer<KioskState, import("redux").AnyAction>;
|
package/dist/esm/slices/kiosk.js
CHANGED
|
@@ -15,6 +15,7 @@ var initialState = {
|
|
|
15
15
|
content: null,
|
|
16
16
|
theme: null,
|
|
17
17
|
ratio: 2,
|
|
18
|
+
displaySettings: null,
|
|
18
19
|
loading: 'idle',
|
|
19
20
|
error: null,
|
|
20
21
|
retries: 0
|
|
@@ -35,7 +36,7 @@ export var fetchKioskConfig = createAsyncThunk(KioskActionType.FetchKiosk, funct
|
|
|
35
36
|
var apiUrl = _a.apiUrl;
|
|
36
37
|
var dispatch = _b.dispatch, rejectWithValue = _b.rejectWithValue;
|
|
37
38
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
38
|
-
var app, api, _c, kioskConfig, store, err, brand, content, theme,
|
|
39
|
+
var app, api, _c, kioskConfig, store, err, brand, content, theme, settings, ratio, displaySettings, revenueCenterId, themeEnhanced, themeDevice, err_1;
|
|
39
40
|
return __generator(this, function (_d) {
|
|
40
41
|
switch (_d.label) {
|
|
41
42
|
case 0:
|
|
@@ -53,9 +54,9 @@ export var fetchKioskConfig = createAsyncThunk(KioskActionType.FetchKiosk, funct
|
|
|
53
54
|
return [2 /*return*/, rejectWithValue(err)];
|
|
54
55
|
}
|
|
55
56
|
dispatch(setApi(api));
|
|
56
|
-
brand = kioskConfig.brand, content = kioskConfig.content, theme = kioskConfig.theme;
|
|
57
|
+
brand = kioskConfig.brand, content = kioskConfig.content, theme = kioskConfig.theme, settings = kioskConfig.settings;
|
|
58
|
+
ratio = settings.ratio, displaySettings = settings.displaySettings;
|
|
57
59
|
revenueCenterId = store.revenue_center_id;
|
|
58
|
-
ratio = 2;
|
|
59
60
|
themeEnhanced = enhanceTheme(theme);
|
|
60
61
|
themeDevice = decorateTheme(themeEnhanced, ratio);
|
|
61
62
|
return [2 /*return*/, {
|
|
@@ -66,6 +67,7 @@ export var fetchKioskConfig = createAsyncThunk(KioskActionType.FetchKiosk, funct
|
|
|
66
67
|
content: content,
|
|
67
68
|
theme: themeDevice,
|
|
68
69
|
ratio: ratio,
|
|
70
|
+
displaySettings: displaySettings,
|
|
69
71
|
error: null,
|
|
70
72
|
loading: 'idle',
|
|
71
73
|
retries: 0
|
|
@@ -128,6 +130,9 @@ export var selectKioskBrand = function (state) { return state.kiosk.brand; };
|
|
|
128
130
|
export var selectKioskContent = function (state) { return state.kiosk.content; };
|
|
129
131
|
export var selectKioskTheme = function (state) { return state.kiosk.theme; };
|
|
130
132
|
export var selectKioskRatio = function (state) { return state.kiosk.ratio; };
|
|
133
|
+
export var selectKioskDisplay = function (state) {
|
|
134
|
+
return state.kiosk.displaySettings;
|
|
135
|
+
};
|
|
131
136
|
export var selectKioskContentSection = function (page) { return function (state) {
|
|
132
137
|
var _a;
|
|
133
138
|
return (_a = state.kiosk.content) === null || _a === void 0 ? void 0 : _a[page];
|
|
@@ -5,8 +5,13 @@ export interface Dimensions {
|
|
|
5
5
|
}
|
|
6
6
|
export declare type KioskBrand = Record<string, unknown>;
|
|
7
7
|
export declare type KioskContent = Record<string, unknown>;
|
|
8
|
+
export interface KioskSettings {
|
|
9
|
+
ratio: number;
|
|
10
|
+
displaySettings: any;
|
|
11
|
+
}
|
|
8
12
|
export interface KioskConfig {
|
|
9
13
|
brand: KioskBrand;
|
|
10
14
|
content: KioskContent;
|
|
11
15
|
theme: ThemeCloud;
|
|
16
|
+
settings: KioskSettings;
|
|
12
17
|
}
|
|
@@ -73,7 +73,7 @@ export declare const calcPrices: (item: CartItem) => {
|
|
|
73
73
|
similarItems: number[];
|
|
74
74
|
};
|
|
75
75
|
export declare const calcNutrition: (item: CartItem) => NutritionalInfo | null;
|
|
76
|
-
export declare const makeCartItem: (item: MenuItem, isEdit?: boolean, soldOut?: SoldOut, simpleItem?: SimpleCartItem, hasPoints?: boolean) => {
|
|
76
|
+
export declare const makeCartItem: (item: MenuItem, isEdit?: boolean, soldOut?: SoldOut, simpleItem?: SimpleCartItem | null, hasPoints?: boolean) => {
|
|
77
77
|
groups: {
|
|
78
78
|
quantity: number;
|
|
79
79
|
options: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/store",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.24",
|
|
4
4
|
"description": "A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our in-store POS API",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|