@open-tender/cloud 0.1.113 → 0.1.114
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppTheme, ConfigApp, ConfigBrand, ConfigContent,
|
|
1
|
+
import { AppTheme, ConfigApp, ConfigBrand, ConfigContent, ConfigPage, ConfigPageType, ConfigPages, ConfigSettings, RequestError, RequestStatus, Theme } from '@open-tender/types';
|
|
2
2
|
import { AppState } from '../app';
|
|
3
3
|
export interface ConfigState {
|
|
4
4
|
api: any;
|
|
@@ -10,7 +10,7 @@ export interface ConfigState {
|
|
|
10
10
|
isApp: boolean | undefined;
|
|
11
11
|
isBackgroundFetch: boolean;
|
|
12
12
|
loading: RequestStatus;
|
|
13
|
-
pages:
|
|
13
|
+
pages: ConfigPages | null;
|
|
14
14
|
retries: number;
|
|
15
15
|
settings: ConfigSettings | null;
|
|
16
16
|
stylesheet: string | null;
|
|
@@ -37,14 +37,13 @@ export declare const fetchConfig: import("@reduxjs/toolkit").AsyncThunk<ConfigSt
|
|
|
37
37
|
rejectedMeta?: unknown;
|
|
38
38
|
}>;
|
|
39
39
|
export declare const resetConfig: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetConfig">, resetRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetRetries">, incrementRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/incrementRetries">;
|
|
40
|
-
export declare const selectCateringOnly: (state: AppState) => boolean;
|
|
41
40
|
export declare const selectConfig: (state: AppState) => ConfigState;
|
|
42
41
|
export declare const selectBrand: (state: AppState) => ConfigBrand | null;
|
|
43
42
|
export declare const selectTheme: (state: AppState) => Theme | null;
|
|
44
43
|
export declare const selectContent: (state: AppState) => ConfigContent | null;
|
|
45
44
|
export declare const selectSettings: (state: AppState) => ConfigSettings | null;
|
|
46
45
|
export declare const selectStylesheet: (state: AppState) => string | null;
|
|
47
|
-
export declare const selectPages: (state: AppState) =>
|
|
46
|
+
export declare const selectPages: (state: AppState) => ConfigPages | null;
|
|
48
47
|
export declare const selectApi: (state: AppState) => any;
|
|
49
48
|
export declare const selectAccountConfig: (state: AppState) => {
|
|
50
49
|
addresses: import("@open-tender/types").ConfigContentField;
|
|
@@ -84,6 +83,7 @@ export declare const selectAccountConfig: (state: AppState) => {
|
|
|
84
83
|
videoUrl: string;
|
|
85
84
|
videoUrlMobile: string;
|
|
86
85
|
} | undefined;
|
|
86
|
+
export declare const selectCateringOnly: (state: AppState) => boolean;
|
|
87
87
|
export declare const selectDisplaySettings: (state: AppState) => import("@open-tender/types").ConfigDisplaySetting | undefined;
|
|
88
88
|
export declare const selectConfigRetries: (state: AppState) => number;
|
|
89
89
|
export declare const selectLightColor: (state: AppState) => string;
|
|
@@ -164,6 +164,7 @@ export declare const selectOptIns: ((state: import("redux").EmptyObject & {
|
|
|
164
164
|
export declare const selectFulfillment: (state: AppState) => import("@open-tender/types").ConfigFulfillment | undefined;
|
|
165
165
|
export declare const selectRecaptcha: (state: AppState) => import("@open-tender/types").ConfigRecaptcha | undefined;
|
|
166
166
|
export declare const selectContentSection: <T extends keyof ConfigContent>(page: T) => (state: AppState) => ConfigContent[T] | undefined;
|
|
167
|
+
export declare const selectPage: (page: ConfigPageType) => (state: AppState) => ConfigPage | undefined;
|
|
167
168
|
export declare const selectSoldOutMsg: (state: AppState) => string;
|
|
168
169
|
export declare const selectHeaderHeight: (state: AppState) => (isBrowser: boolean) => number;
|
|
169
170
|
export declare const selectOutpostName: (state: AppState) => string | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.configReducer = exports.selectCategoryType = exports.selectHasCatering = exports.selectOutpostName = exports.selectHeaderHeight = exports.selectSoldOutMsg = exports.selectContentSection = exports.selectRecaptcha = exports.selectFulfillment = exports.selectOptIns = exports.selectLightColor = exports.selectConfigRetries = exports.selectDisplaySettings = exports.selectAccountConfig = exports.selectApi = exports.selectPages = exports.selectStylesheet = exports.selectSettings = exports.selectContent = exports.selectTheme = exports.selectBrand = exports.selectConfig = exports.
|
|
4
|
+
exports.configReducer = exports.selectCategoryType = exports.selectHasCatering = exports.selectOutpostName = exports.selectHeaderHeight = exports.selectSoldOutMsg = exports.selectPage = exports.selectContentSection = exports.selectRecaptcha = exports.selectFulfillment = exports.selectOptIns = exports.selectLightColor = exports.selectConfigRetries = exports.selectDisplaySettings = exports.selectCateringOnly = exports.selectAccountConfig = exports.selectApi = exports.selectPages = exports.selectStylesheet = exports.selectSettings = exports.selectContent = exports.selectTheme = exports.selectBrand = exports.selectConfig = exports.incrementRetries = exports.resetRetries = exports.resetConfig = exports.fetchConfig = exports.ConfigActionType = void 0;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
7
7
|
const utils_1 = require("@open-tender/utils");
|
|
@@ -86,11 +86,6 @@ const configSlice = (0, toolkit_1.createSlice)({
|
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
88
|
_a = configSlice.actions, exports.resetConfig = _a.resetConfig, exports.resetRetries = _a.resetRetries, exports.incrementRetries = _a.incrementRetries;
|
|
89
|
-
const selectCateringOnly = (state) => {
|
|
90
|
-
const { orderTypes } = state.config.settings || {};
|
|
91
|
-
return !!((orderTypes === null || orderTypes === void 0 ? void 0 : orderTypes.includes('CATERING')) && orderTypes.length === 1);
|
|
92
|
-
};
|
|
93
|
-
exports.selectCateringOnly = selectCateringOnly;
|
|
94
89
|
const selectConfig = (state) => state.config;
|
|
95
90
|
exports.selectConfig = selectConfig;
|
|
96
91
|
const selectBrand = (state) => state.config.brand;
|
|
@@ -109,6 +104,11 @@ const selectApi = (state) => state.config.api;
|
|
|
109
104
|
exports.selectApi = selectApi;
|
|
110
105
|
const selectAccountConfig = (state) => { var _a; return (_a = state.config.content) === null || _a === void 0 ? void 0 : _a.account; };
|
|
111
106
|
exports.selectAccountConfig = selectAccountConfig;
|
|
107
|
+
const selectCateringOnly = (state) => {
|
|
108
|
+
const { orderTypes } = state.config.settings || {};
|
|
109
|
+
return !!((orderTypes === null || orderTypes === void 0 ? void 0 : orderTypes.includes('CATERING')) && orderTypes.length === 1);
|
|
110
|
+
};
|
|
111
|
+
exports.selectCateringOnly = selectCateringOnly;
|
|
112
112
|
const selectDisplaySettings = (state) => {
|
|
113
113
|
var _a;
|
|
114
114
|
const orderType = state.order.orderType || 'OLO';
|
|
@@ -131,6 +131,8 @@ const selectRecaptcha = (state) => { var _a; return (_a = state.config.settings)
|
|
|
131
131
|
exports.selectRecaptcha = selectRecaptcha;
|
|
132
132
|
const selectContentSection = (page) => (state) => state.config.content ? state.config.content[page] : undefined;
|
|
133
133
|
exports.selectContentSection = selectContentSection;
|
|
134
|
+
const selectPage = (page) => (state) => state.config.pages ? state.config.pages[page] : undefined;
|
|
135
|
+
exports.selectPage = selectPage;
|
|
134
136
|
const selectSoldOutMsg = (state) => {
|
|
135
137
|
var _a;
|
|
136
138
|
const { soldOutMessage } = ((_a = state.config.content) === null || _a === void 0 ? void 0 : _a.menu) || {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppTheme, ConfigApp, ConfigBrand, ConfigContent,
|
|
1
|
+
import { AppTheme, ConfigApp, ConfigBrand, ConfigContent, ConfigPage, ConfigPageType, ConfigPages, ConfigSettings, RequestError, RequestStatus, Theme } from '@open-tender/types';
|
|
2
2
|
import { AppState } from '../app';
|
|
3
3
|
export interface ConfigState {
|
|
4
4
|
api: any;
|
|
@@ -10,7 +10,7 @@ export interface ConfigState {
|
|
|
10
10
|
isApp: boolean | undefined;
|
|
11
11
|
isBackgroundFetch: boolean;
|
|
12
12
|
loading: RequestStatus;
|
|
13
|
-
pages:
|
|
13
|
+
pages: ConfigPages | null;
|
|
14
14
|
retries: number;
|
|
15
15
|
settings: ConfigSettings | null;
|
|
16
16
|
stylesheet: string | null;
|
|
@@ -37,14 +37,13 @@ export declare const fetchConfig: import("@reduxjs/toolkit").AsyncThunk<ConfigSt
|
|
|
37
37
|
rejectedMeta?: unknown;
|
|
38
38
|
}>;
|
|
39
39
|
export declare const resetConfig: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetConfig">, resetRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetRetries">, incrementRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/incrementRetries">;
|
|
40
|
-
export declare const selectCateringOnly: (state: AppState) => boolean;
|
|
41
40
|
export declare const selectConfig: (state: AppState) => ConfigState;
|
|
42
41
|
export declare const selectBrand: (state: AppState) => ConfigBrand | null;
|
|
43
42
|
export declare const selectTheme: (state: AppState) => Theme | null;
|
|
44
43
|
export declare const selectContent: (state: AppState) => ConfigContent | null;
|
|
45
44
|
export declare const selectSettings: (state: AppState) => ConfigSettings | null;
|
|
46
45
|
export declare const selectStylesheet: (state: AppState) => string | null;
|
|
47
|
-
export declare const selectPages: (state: AppState) =>
|
|
46
|
+
export declare const selectPages: (state: AppState) => ConfigPages | null;
|
|
48
47
|
export declare const selectApi: (state: AppState) => any;
|
|
49
48
|
export declare const selectAccountConfig: (state: AppState) => {
|
|
50
49
|
addresses: import("@open-tender/types").ConfigContentField;
|
|
@@ -84,6 +83,7 @@ export declare const selectAccountConfig: (state: AppState) => {
|
|
|
84
83
|
videoUrl: string;
|
|
85
84
|
videoUrlMobile: string;
|
|
86
85
|
} | undefined;
|
|
86
|
+
export declare const selectCateringOnly: (state: AppState) => boolean;
|
|
87
87
|
export declare const selectDisplaySettings: (state: AppState) => import("@open-tender/types").ConfigDisplaySetting | undefined;
|
|
88
88
|
export declare const selectConfigRetries: (state: AppState) => number;
|
|
89
89
|
export declare const selectLightColor: (state: AppState) => string;
|
|
@@ -164,6 +164,7 @@ export declare const selectOptIns: ((state: import("redux").EmptyObject & {
|
|
|
164
164
|
export declare const selectFulfillment: (state: AppState) => import("@open-tender/types").ConfigFulfillment | undefined;
|
|
165
165
|
export declare const selectRecaptcha: (state: AppState) => import("@open-tender/types").ConfigRecaptcha | undefined;
|
|
166
166
|
export declare const selectContentSection: <T extends keyof ConfigContent>(page: T) => (state: AppState) => ConfigContent[T] | undefined;
|
|
167
|
+
export declare const selectPage: (page: ConfigPageType) => (state: AppState) => ConfigPage | undefined;
|
|
167
168
|
export declare const selectSoldOutMsg: (state: AppState) => string;
|
|
168
169
|
export declare const selectHeaderHeight: (state: AppState) => (isBrowser: boolean) => number;
|
|
169
170
|
export declare const selectOutpostName: (state: AppState) => string | undefined;
|
|
@@ -82,10 +82,6 @@ const configSlice = createSlice({
|
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
84
|
export const { resetConfig, resetRetries, incrementRetries } = configSlice.actions;
|
|
85
|
-
export const selectCateringOnly = (state) => {
|
|
86
|
-
const { orderTypes } = state.config.settings || {};
|
|
87
|
-
return !!((orderTypes === null || orderTypes === void 0 ? void 0 : orderTypes.includes('CATERING')) && orderTypes.length === 1);
|
|
88
|
-
};
|
|
89
85
|
export const selectConfig = (state) => state.config;
|
|
90
86
|
export const selectBrand = (state) => state.config.brand;
|
|
91
87
|
export const selectTheme = (state) => state.config.theme;
|
|
@@ -95,6 +91,10 @@ export const selectStylesheet = (state) => state.config.stylesheet;
|
|
|
95
91
|
export const selectPages = (state) => state.config.pages;
|
|
96
92
|
export const selectApi = (state) => state.config.api;
|
|
97
93
|
export const selectAccountConfig = (state) => { var _a; return (_a = state.config.content) === null || _a === void 0 ? void 0 : _a.account; };
|
|
94
|
+
export const selectCateringOnly = (state) => {
|
|
95
|
+
const { orderTypes } = state.config.settings || {};
|
|
96
|
+
return !!((orderTypes === null || orderTypes === void 0 ? void 0 : orderTypes.includes('CATERING')) && orderTypes.length === 1);
|
|
97
|
+
};
|
|
98
98
|
export const selectDisplaySettings = (state) => {
|
|
99
99
|
var _a;
|
|
100
100
|
const orderType = state.order.orderType || 'OLO';
|
|
@@ -111,6 +111,7 @@ export const selectOptIns = createSelector((state) => {
|
|
|
111
111
|
export const selectFulfillment = (state) => { var _a; return (_a = state.config.brand) === null || _a === void 0 ? void 0 : _a.fulfillment; };
|
|
112
112
|
export const selectRecaptcha = (state) => { var _a; return (_a = state.config.settings) === null || _a === void 0 ? void 0 : _a.recaptcha; };
|
|
113
113
|
export const selectContentSection = (page) => (state) => state.config.content ? state.config.content[page] : undefined;
|
|
114
|
+
export const selectPage = (page) => (state) => state.config.pages ? state.config.pages[page] : undefined;
|
|
114
115
|
export const selectSoldOutMsg = (state) => {
|
|
115
116
|
var _a;
|
|
116
117
|
const { soldOutMessage } = ((_a = state.config.content) === null || _a === void 0 ? void 0 : _a.menu) || {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/cloud",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.114",
|
|
4
4
|
"description": "A library of hooks, reducers, utility functions, and types 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",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"typescript": "^4.8.2"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@open-tender/types": "^0.2.
|
|
52
|
+
"@open-tender/types": "^0.2.105",
|
|
53
53
|
"@open-tender/utils": "^0.1.173",
|
|
54
54
|
"@reduxjs/toolkit": "^1.8.5",
|
|
55
55
|
"react": "^18.2.0"
|