@shopgate/pwa-common 7.30.0-alpha.6 → 7.30.0-alpha.8
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/App.js +48 -6
- package/action-creators/app/index.js +75 -12
- package/action-creators/app/spec.js +96 -1
- package/action-creators/client/index.js +27 -5
- package/action-creators/client/spec.js +44 -1
- package/action-creators/error/index.js +15 -3
- package/action-creators/index.js +9 -1
- package/action-creators/menu/index.js +23 -4
- package/action-creators/menu/spec.js +37 -1
- package/action-creators/modal/index.js +15 -3
- package/action-creators/modal/spec.js +26 -1
- package/action-creators/page/index.js +24 -4
- package/action-creators/page/spec.js +38 -1
- package/action-creators/router/index.js +48 -7
- package/action-creators/url/index.js +24 -4
- package/action-creators/url/spec.js +45 -1
- package/action-creators/user/index.js +90 -13
- package/action-creators/user/spec.js +186 -2
- package/actions/app/handleDeepLink.js +11 -2
- package/actions/app/handleLink.js +62 -6
- package/actions/app/handlePushNotification.js +32 -4
- package/actions/app/handleUniversalLink.js +11 -2
- package/actions/app/registerLinkEvents.js +24 -3
- package/actions/client/fetchClientInformation.js +26 -2
- package/actions/menu/fetchMenu.js +23 -2
- package/actions/modal/closeModal.js +18 -2
- package/actions/modal/promiseMap.js +3 -1
- package/actions/modal/showModal.js +54 -8
- package/actions/page/fetchPageConfig.js +69 -2
- package/actions/page/getPageConfig.js +6 -2
- package/actions/page/index.js +1 -1
- package/actions/router/historyPop.js +12 -2
- package/actions/router/historyPopToRoute.js +27 -2
- package/actions/router/historyPush.js +12 -2
- package/actions/router/historyRedirect.js +21 -2
- package/actions/router/historyReplace.js +20 -3
- package/actions/router/historyReset.js +11 -2
- package/actions/router/historyResetTo.js +12 -2
- package/actions/router/index.js +17 -1
- package/actions/router/routeDidPop.js +11 -2
- package/actions/router/routeDidPush.js +13 -2
- package/actions/router/routeDidReplace.js +11 -2
- package/actions/router/routeDidReset.js +11 -2
- package/actions/router/routeDidUpdate.js +10 -2
- package/actions/router/routeWillPop.js +11 -2
- package/actions/router/routeWillPush.js +13 -2
- package/actions/router/routeWillReplace.js +11 -2
- package/actions/router/routeWillReset.js +11 -2
- package/actions/router/windowOpenOverride.js +10 -2
- package/actions/user/fetchRegisterUrl.js +36 -2
- package/actions/user/fetchUser.js +29 -3
- package/actions/user/getUser.js +6 -2
- package/actions/user/index.js +1 -1
- package/actions/user/login.js +76 -9
- package/actions/user/logout.js +30 -2
- package/collections/AuthRoutes.js +73 -14
- package/collections/Configuration.js +54 -7
- package/collections/EmbeddedMedia.js +84 -11
- package/collections/PersistedReducers.js +41 -6
- package/collections/Redirects.js +103 -17
- package/collections/index.js +5 -1
- package/collections/media-providers/MediaProvider.js +151 -26
- package/collections/media-providers/Vimeo.js +113 -19
- package/collections/media-providers/YouTube.js +74 -14
- package/collections/media-providers/index.js +3 -1
- package/collections/media-providers/style.js +52 -2
- package/components/Backdrop/index.js +95 -6
- package/components/Backdrop/spec.js +23 -1
- package/components/Backdrop/style.js +11 -2
- package/components/Button/index.js +47 -5
- package/components/Button/spec.js +36 -1
- package/components/Button/style.js +6 -1
- package/components/Checkbox/index.js +126 -32
- package/components/Checkbox/spec.js +94 -3
- package/components/Consume/helpers/buildParams.js +13 -2
- package/components/Consume/index.js +14 -2
- package/components/CountdownTimer/index.js +115 -17
- package/components/CountdownTimer/spec.js +126 -12
- package/components/Drawer/index.js +131 -16
- package/components/Drawer/spec.js +76 -1
- package/components/Drawer/style.js +37 -1
- package/components/Dropdown/index.js +65 -6
- package/components/Dropdown/style.js +4 -1
- package/components/Dropdown/transitions.js +34 -1
- package/components/Ellipsis/index.js +16 -2
- package/components/Ellipsis/spec.js +13 -1
- package/components/EmbeddedMedia/index.js +56 -6
- package/components/EmbeddedMedia/spec.js +52 -3
- package/components/ErrorBoundary/connector.js +9 -2
- package/components/ErrorBoundary/index.js +43 -7
- package/components/Grid/components/Item/index.js +40 -4
- package/components/Grid/components/Item/spec.js +23 -1
- package/components/Grid/components/Item/style.js +17 -3
- package/components/Grid/index.js +36 -4
- package/components/Grid/spec.js +23 -1
- package/components/Grid/style.js +11 -2
- package/components/HtmlSanitizer/connector.js +24 -3
- package/components/HtmlSanitizer/index.js +104 -12
- package/components/HtmlSanitizer/spec.js +207 -6
- package/components/I18n/components/FormatDate/index.js +26 -2
- package/components/I18n/components/FormatDate/spec.js +46 -1
- package/components/I18n/components/FormatNumber/index.js +34 -2
- package/components/I18n/components/FormatNumber/spec.js +41 -2
- package/components/I18n/components/FormatPrice/index.js +32 -2
- package/components/I18n/components/FormatPrice/spec.js +46 -1
- package/components/I18n/components/FormatTime/index.js +26 -2
- package/components/I18n/components/FormatTime/spec.js +43 -2
- package/components/I18n/components/I18nProvider/index.js +52 -9
- package/components/I18n/components/I18nProvider/spec.js +39 -1
- package/components/I18n/components/Placeholder/index.js +8 -2
- package/components/I18n/components/Placeholder/spec.js +30 -1
- package/components/I18n/components/Translate/index.js +68 -7
- package/components/I18n/components/Translate/spec.js +30 -1
- package/components/I18n/index.js +16 -1
- package/components/Icon/index.js +25 -2
- package/components/Icon/style.js +6 -1
- package/components/Image/Image.js +176 -19
- package/components/Image/ImageInner.js +48 -2
- package/components/Image/index.js +1 -1
- package/components/Image/style.js +29 -2
- package/components/InfiniteContainer/index.js +381 -49
- package/components/InfiniteContainer/spec.js +199 -10
- package/components/Input/components/DateInput.js +262 -6
- package/components/Input/components/MultiLineInput.js +98 -12
- package/components/Input/components/SimpleInput.js +207 -31
- package/components/Input/index.js +32 -3
- package/components/Input/spec.js +122 -1
- package/components/KeyboardConsumer/index.js +48 -7
- package/components/Link/connector.js +7 -1
- package/components/Link/index.js +96 -11
- package/components/Link/spec.js +56 -1
- package/components/Link/style.js +10 -1
- package/components/List/components/Item/index.js +35 -3
- package/components/List/components/Item/style.js +16 -1
- package/components/List/index.js +20 -2
- package/components/List/spec.js +31 -1
- package/components/Loading/index.js +6 -2
- package/components/Modal/index.js +38 -3
- package/components/Modal/style.js +36 -1
- package/components/ModalContainer/connector.js +17 -3
- package/components/ModalContainer/index.js +36 -3
- package/components/ModalContainer/spec.js +105 -5
- package/components/Picker/components/Button/index.js +34 -2
- package/components/Picker/components/Button/style.js +19 -1
- package/components/Picker/components/List/index.js +33 -2
- package/components/Picker/components/List/style.js +17 -1
- package/components/Picker/components/Modal/index.js +60 -7
- package/components/Picker/components/Modal/style.js +78 -1
- package/components/Picker/index.js +167 -21
- package/components/Picker/spec.js +83 -2
- package/components/Portal/index.js +130 -19
- package/components/ProductCharacteristics/connector.js +33 -4
- package/components/ProductCharacteristics/context.js +2 -1
- package/components/ProductCharacteristics/helpers/index.js +135 -21
- package/components/ProductCharacteristics/index.js +266 -31
- package/components/RangeSlider/components/Handle/index.js +25 -2
- package/components/RangeSlider/components/Handle/style.js +14 -1
- package/components/RangeSlider/helper.js +43 -8
- package/components/RangeSlider/index.js +228 -38
- package/components/RangeSlider/style.js +14 -1
- package/components/Route/RouteNotFound.js +46 -3
- package/components/Route/index.js +78 -10
- package/components/Router/connector.js +9 -2
- package/components/Router/index.js +237 -31
- package/components/ScannerContainer/connector.js +9 -2
- package/components/ScannerContainer/index.js +42 -6
- package/components/Select/components/Item/index.js +20 -4
- package/components/Select/components/Item/style.js +4 -1
- package/components/Select/index.js +149 -28
- package/components/Select/spec.js +86 -2
- package/components/Select/style.js +17 -1
- package/components/SelectBox/components/Item/index.js +47 -5
- package/components/SelectBox/components/Item/style.js +7 -1
- package/components/SelectBox/index.js +173 -17
- package/components/SelectBox/spec.js +59 -3
- package/components/SelectBox/style.js +18 -1
- package/components/Slider/index.js +6 -2
- package/components/SurroundPortals/index.js +26 -2
- package/components/Swiper/components/SwiperItem/index.js +28 -4
- package/components/Swiper/components/SwiperItem/spec.js +17 -1
- package/components/Swiper/components/SwiperItem/styles.js +5 -1
- package/components/Swiper/index.js +210 -18
- package/components/Swiper/styles.js +75 -7
- package/components/Toaster/index.js +10 -2
- package/components/Transition/index.js +89 -13
- package/components/Widgets/components/Widget/index.js +52 -4
- package/components/Widgets/components/Widget/spec.js +68 -3
- package/components/Widgets/components/Widget/style.js +21 -3
- package/components/Widgets/components/WidgetGrid/index.js +52 -7
- package/components/Widgets/components/WidgetGrid/spec.js +46 -2
- package/components/Widgets/components/WidgetGrid/style.js +8 -1
- package/components/Widgets/helpers/shouldShowWidget.js +44 -7
- package/components/Widgets/index.js +127 -15
- package/components/Widgets/spec.js +213 -6
- package/components/index.js +9 -1
- package/constants/ActionTypes.js +97 -19
- package/constants/Configuration.js +12 -2
- package/constants/Device.js +29 -2
- package/constants/DisplayOptions.js +8 -1
- package/constants/MenuIDs.js +2 -1
- package/constants/ModalTypes.js +1 -1
- package/constants/PageIDs.js +1 -1
- package/constants/Pipelines.js +7 -1
- package/constants/Portals.js +136 -3
- package/constants/Registration.js +3 -1
- package/constants/RoutePaths.js +13 -2
- package/constants/Tracking.js +3 -1
- package/constants/client.js +6 -1
- package/constants/ui.js +2 -1
- package/constants/user.js +6 -2
- package/context/index.js +33 -3
- package/helpers/config/index.js +139 -21
- package/helpers/config/mock.js +200 -8
- package/helpers/config/theme.js +50 -4
- package/helpers/data/index.js +204 -29
- package/helpers/data/spec.js +187 -7
- package/helpers/date/index.js +58 -6
- package/helpers/date/spec.js +92 -1
- package/helpers/dom/index.js +48 -11
- package/helpers/environment/index.js +14 -2
- package/helpers/html/decodeHTML.js +7 -1
- package/helpers/html/handleDOM.js +172 -21
- package/helpers/html/parseHTML.js +67 -12
- package/helpers/i18n/getDateFormatter.js +23 -4
- package/helpers/i18n/getNumberFormatter.js +32 -4
- package/helpers/i18n/getPriceFormatter.js +38 -4
- package/helpers/i18n/getTimeFormatter.js +23 -4
- package/helpers/i18n/getTranslator.js +62 -8
- package/helpers/i18n/index.js +5 -1
- package/helpers/i18n/mergeTranslations.js +36 -9
- package/helpers/i18n/messageCache.js +3 -1
- package/helpers/legacy/index.js +47 -9
- package/helpers/modal/withShowModal.js +13 -2
- package/helpers/portals/portalCollection.js +28 -6
- package/helpers/portals/routePortals.js +12 -1
- package/helpers/redux/compareObjects.js +7 -2
- package/helpers/redux/generateResultHash.js +36 -3
- package/helpers/redux/generateSortedHash.js +7 -2
- package/helpers/redux/hasExpired.js +10 -2
- package/helpers/redux/index.js +7 -1
- package/helpers/redux/mutable.js +143 -24
- package/helpers/redux/shouldFetchData.js +46 -10
- package/helpers/redux/shouldFetchFilters.js +17 -4
- package/helpers/router/index.js +49 -5
- package/helpers/style/index.js +43 -4
- package/helpers/style/spec.js +108 -2
- package/helpers/tracking/index.js +52 -9
- package/helpers/validation/index.js +39 -12
- package/helpers/validation/spec.js +10 -1
- package/package.json +3 -3
- package/providers/index.js +4 -1
- package/providers/loading/context.js +2 -1
- package/providers/loading/index.js +137 -22
- package/providers/toast/context.js +2 -1
- package/providers/toast/index.js +105 -11
- package/reducers/client/connectivity.js +22 -2
- package/reducers/client/index.js +7 -1
- package/reducers/client/info.js +27 -2
- package/reducers/index.js +23 -4
- package/reducers/menu/index.js +5 -1
- package/reducers/menu/menusById.js +41 -2
- package/reducers/modal/index.js +14 -2
- package/reducers/page/index.js +68 -5
- package/reducers/router/index.js +48 -2
- package/reducers/url/index.js +42 -3
- package/reducers/user/data.js +27 -2
- package/reducers/user/index.js +7 -1
- package/reducers/user/login.js +65 -2
- package/selectors/client.js +138 -21
- package/selectors/history.js +49 -11
- package/selectors/menu.js +34 -6
- package/selectors/modal.js +15 -4
- package/selectors/page.js +25 -4
- package/selectors/router.js +154 -30
- package/selectors/url.js +25 -4
- package/selectors/user.js +90 -13
- package/store/index.js +60 -6
- package/store/middelwares/logger.js +7 -1
- package/store/middelwares/streams.js +19 -2
- package/streams/app.js +60 -8
- package/streams/client.js +8 -2
- package/streams/error.js +14 -3
- package/streams/index.js +6 -1
- package/streams/interval.js +6 -2
- package/streams/main.js +27 -2
- package/streams/router.js +45 -8
- package/streams/user.js +89 -15
- package/streams/view.js +97 -25
- package/styles/reset/form.js +57 -5
- package/styles/reset/index.js +6 -1
- package/styles/reset/media.js +22 -1
- package/styles/reset/root.js +33 -1
- package/styles/reset/table.js +10 -1
- package/styles/reset/typography.js +26 -1
- package/subscriptions/app.js +148 -17
- package/subscriptions/error.js +292 -13
- package/subscriptions/helpers/buildRegisterUrl.js +25 -6
- package/subscriptions/helpers/clearUpInAppBrowser.js +14 -3
- package/subscriptions/helpers/handleLinks.js +267 -25
- package/subscriptions/helpers/pipeline.js +12 -1
- package/subscriptions/history.js +34 -6
- package/subscriptions/index.js +25 -4
- package/subscriptions/menu.js +22 -5
- package/subscriptions/mock.js +39 -7
- package/subscriptions/router.js +336 -23
- package/subscriptions/user.js +93 -3
package/helpers/config/index.js
CHANGED
|
@@ -1,26 +1,109 @@
|
|
|
1
|
-
|
|
1
|
+
import "core-js/modules/es.string.replace.js";
|
|
2
|
+
import pck from "../../package.json";
|
|
3
|
+
import { buildThemeConfig } from "./theme";
|
|
4
|
+
import { assignObjectDeep } from "../data";
|
|
5
|
+
import { isObject } from "../validation";
|
|
6
|
+
|
|
7
|
+
/**
|
|
2
8
|
* Provides a default app config as a fallback.
|
|
3
9
|
* @mixin AppConfig
|
|
4
|
-
*/
|
|
10
|
+
*/
|
|
11
|
+
const defaultAppConfig = {
|
|
12
|
+
appId: 'shop_30177',
|
|
13
|
+
browserConnector: false,
|
|
14
|
+
colors: {},
|
|
15
|
+
forgotPasswordUrl: null,
|
|
16
|
+
hasFavorites: false,
|
|
17
|
+
hasReviews: true,
|
|
18
|
+
showWriteReview: true,
|
|
19
|
+
language: 'en-us',
|
|
20
|
+
logo: 'https://example.com/logo',
|
|
21
|
+
marketId: 'US',
|
|
22
|
+
publicPath: 'https://example.com/public',
|
|
23
|
+
shopName: 'Shopgate Connect',
|
|
24
|
+
webCheckoutShopify: null,
|
|
25
|
+
hasNoScanner: false,
|
|
26
|
+
apiUrl: 'https://shop_30177.dev.connect.shopgate.com/',
|
|
27
|
+
shopCNAME: null,
|
|
28
|
+
currency: 'USD',
|
|
29
|
+
showGmdMenuSubHeaders: false,
|
|
30
|
+
benchmark: false,
|
|
31
|
+
sentry: {},
|
|
32
|
+
theme: {},
|
|
33
|
+
cartShippingHideAnonymousLegacy: null,
|
|
34
|
+
cartShippingTextAnonymousLegacy: null,
|
|
35
|
+
variantSelectionMode: null,
|
|
36
|
+
product: {
|
|
37
|
+
variantPreselect: false
|
|
38
|
+
},
|
|
39
|
+
cart: {},
|
|
40
|
+
scanner: {},
|
|
41
|
+
favorites: {},
|
|
42
|
+
tracking: {
|
|
43
|
+
hasWebTrackingEngage: false,
|
|
44
|
+
useSkuAsProductId: false
|
|
45
|
+
},
|
|
46
|
+
webTrackingEngage: {
|
|
47
|
+
android: '',
|
|
48
|
+
ios: ''
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
5
53
|
* @type {string} package version from package.json
|
|
6
|
-
*/
|
|
54
|
+
*/
|
|
55
|
+
export const pckVersion = pck.version;
|
|
56
|
+
|
|
57
|
+
/**
|
|
7
58
|
* Provides a default components config as a fallback.
|
|
8
59
|
* @type {{portals: {}, widgets: {}}}
|
|
9
|
-
*/
|
|
60
|
+
*/
|
|
61
|
+
const defaultComponentsConfig = {
|
|
62
|
+
portals: {},
|
|
63
|
+
widgets: {}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/**
|
|
10
67
|
* The components.json config from the theme.
|
|
11
68
|
* @type {Object}
|
|
12
|
-
*/
|
|
69
|
+
*/
|
|
70
|
+
export const componentsConfig = {
|
|
71
|
+
...defaultComponentsConfig,
|
|
72
|
+
...process.env.COMPONENTS_CONFIG
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/**
|
|
13
76
|
* The app.json config from the theme which will automatically be resolved.
|
|
14
77
|
* Be careful when changing existing properties on the fly, reassignments should never be done!
|
|
15
78
|
* @mixes AppConfig
|
|
16
|
-
*/
|
|
79
|
+
*/
|
|
80
|
+
const appConfig = process.env.NODE_ENV !== 'test' ? process.env.APP_CONFIG : defaultAppConfig;
|
|
81
|
+
|
|
82
|
+
/**
|
|
17
83
|
* The theme name.
|
|
18
84
|
* @type {string}
|
|
19
|
-
*/
|
|
85
|
+
*/
|
|
86
|
+
export const themeName = process.env.THEME || 'theme';
|
|
87
|
+
|
|
88
|
+
/**
|
|
20
89
|
* The resolved theme configuration.
|
|
21
90
|
* @type {ThemeConfig}
|
|
22
|
-
*/
|
|
23
|
-
appConfig
|
|
91
|
+
*/
|
|
92
|
+
export const themeConfig = buildThemeConfig(appConfig);
|
|
93
|
+
|
|
94
|
+
/** @mixes ThemeColors */
|
|
95
|
+
export const themeColors = themeConfig.colors;
|
|
96
|
+
/** @mixes ThemeShadows */
|
|
97
|
+
export const themeShadows = themeConfig.shadows;
|
|
98
|
+
/** @mixes ThemeVariables */
|
|
99
|
+
export const themeVariables = themeConfig.variables;
|
|
100
|
+
/** @mixes ThemeIcons */
|
|
101
|
+
export const themeIcons = themeConfig.icons;
|
|
102
|
+
|
|
103
|
+
// Fix theme config reference
|
|
104
|
+
appConfig.theme = themeConfig;
|
|
105
|
+
|
|
106
|
+
/**
|
|
24
107
|
* A comparator for array items as they occur on different levels within the default app config.
|
|
25
108
|
* It identifies items uniquely to avoid duplicates when merging configs.
|
|
26
109
|
* Items identified as equal are merged together by the caller. Non-equals are added to the result.
|
|
@@ -30,15 +113,34 @@ appConfig.theme=themeConfig;/**
|
|
|
30
113
|
* @param {*} prev Item that already exists in the config.
|
|
31
114
|
* @param {*} next Item to be compared against.
|
|
32
115
|
* @returns {boolean} Returns true if the items are considered equal and false if not
|
|
33
|
-
*/
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
//
|
|
40
|
-
|
|
41
|
-
return
|
|
116
|
+
*/
|
|
117
|
+
export const appConfigArrayItemComparator = (path, prev, next) => {
|
|
118
|
+
// Replaces object paths with array indices to a structure with easy comparisons
|
|
119
|
+
// E.g. converts "prop.subprop.15.arrayitem.3" to "prop.subprop.N.arrayitem.N"
|
|
120
|
+
const simplePath = path.replace(/\.[0-9]+/g, '.N');
|
|
121
|
+
|
|
122
|
+
// Simple types
|
|
123
|
+
if (!isObject(prev) || !isObject(next)) {
|
|
124
|
+
return prev === next;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Identity of pages is defined by the page pattern
|
|
128
|
+
if (simplePath === '$.theme.pages.N') {
|
|
129
|
+
return prev.pattern === next.pattern;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Identity of widgets is defined by the widget id
|
|
133
|
+
if (simplePath === '$.theme.pages.N.widgets.N') {
|
|
134
|
+
return prev.id === next.id;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Assume everything else to be of different values (including sub-arrays)
|
|
138
|
+
// => Arrays within arrays not defined in the default config => never equal.
|
|
139
|
+
// => Custom defined array items must be handled using the given arrayComparator!
|
|
140
|
+
return false;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
/**
|
|
42
144
|
* Comparator which treats items to be equal arrays by the position of the item in the array.
|
|
43
145
|
* @param {string} [path] Unused param
|
|
44
146
|
* @param {*} [prev] Unused param
|
|
@@ -46,11 +148,27 @@ return false;};/**
|
|
|
46
148
|
* @param {number} prevIndex Position of the prev item in the array which is currently compared
|
|
47
149
|
* @param {number} nextIndex Position of the next item in the array which is currently compared
|
|
48
150
|
* @returns {boolean} Returns true if the items are considered equal and false if not
|
|
49
|
-
*/
|
|
151
|
+
*/
|
|
152
|
+
export const equalStructureComparator = (path, prev, next, prevIndex, nextIndex) => prevIndex === nextIndex;
|
|
153
|
+
|
|
154
|
+
/**
|
|
50
155
|
* Takes an object with app config values and safely injects it into the current app config.
|
|
51
156
|
* @param {Object} newConfig Contains new config fields to inject into the existing destination.
|
|
52
157
|
* @param {ArrayItemComparator|null} [arrayComparator] Defines how to compare array items.
|
|
53
|
-
*/
|
|
158
|
+
*/
|
|
159
|
+
export function writeToConfig(newConfig, arrayComparator = null) {
|
|
160
|
+
const comparator = arrayComparator || appConfigArrayItemComparator;
|
|
161
|
+
assignObjectDeep(appConfig, newConfig, true, comparator, '$');
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
54
165
|
* The shop number.
|
|
55
166
|
* @type {string}
|
|
56
|
-
*/
|
|
167
|
+
*/
|
|
168
|
+
const {
|
|
169
|
+
appId
|
|
170
|
+
} = appConfig;
|
|
171
|
+
export const shopNumber = appId ? appId.replace('shop_', '') : '';
|
|
172
|
+
|
|
173
|
+
/** @mixes AppConfig */
|
|
174
|
+
export default appConfig;
|
package/helpers/config/mock.js
CHANGED
|
@@ -1,19 +1,211 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @mixin ThemeColors
|
|
3
|
-
*/
|
|
3
|
+
*/
|
|
4
|
+
const colors = {
|
|
5
|
+
background: '#f8f8f8',
|
|
6
|
+
light: '#fff',
|
|
7
|
+
lightTransparent: 'rgba(255, 255, 255, 0.82)',
|
|
8
|
+
dark: '#000',
|
|
9
|
+
darkTransparent: 'rgba(0,0,0, 0.4)',
|
|
10
|
+
lightDark: '#323232',
|
|
11
|
+
accent: '#5ccee3',
|
|
12
|
+
placeholder: '#f2f2f2',
|
|
13
|
+
lightOverlay: '#fafafa',
|
|
14
|
+
overlay: '#f7f7f7',
|
|
15
|
+
darkOverlay: '#f0f0f0',
|
|
16
|
+
primary: '#fa5400',
|
|
17
|
+
primaryContrast: '#fff',
|
|
18
|
+
accentContrast: '#fff',
|
|
19
|
+
cta: '#fa5400',
|
|
20
|
+
ctaContrast: '#fff',
|
|
21
|
+
focus: '#fa5400',
|
|
22
|
+
gray: '#747474',
|
|
23
|
+
darkGray: '#eaeaea',
|
|
24
|
+
shade3: '#9a9a9a',
|
|
25
|
+
shade4: '#b5b5b5',
|
|
26
|
+
shade5: '#ccc',
|
|
27
|
+
shade6: '#656565',
|
|
28
|
+
shade7: '#eaeaea',
|
|
29
|
+
shade8: '#f7f7f7',
|
|
30
|
+
shade9: '#8d8d8d',
|
|
31
|
+
shade10: '#f4f4f4',
|
|
32
|
+
shade11: '#747474',
|
|
33
|
+
shade12: '#939393',
|
|
34
|
+
success: '#35cc29',
|
|
35
|
+
warning: '#ff9300',
|
|
36
|
+
error: '#ff0000'
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**
|
|
4
40
|
* @mixin ThemeShadows
|
|
5
|
-
*/
|
|
41
|
+
*/
|
|
42
|
+
const shadows = {
|
|
43
|
+
material: '0 1px 6px rgba(0, 0, 0, .117647), 0 1px 4px rgba(0, 0, 0, .117647)',
|
|
44
|
+
navDrawer: '0 0 15px rgba(0, 0, 0, .24)',
|
|
45
|
+
widget: '0 4px 8px rgba(0, 0, 0, 0.16)',
|
|
46
|
+
productCard: '0 4px 8px rgba(0, 0, 0, 0.16)',
|
|
47
|
+
productImage: 'inset 0 0 20px rgba(0, 0, 0, .05)',
|
|
48
|
+
tabBar: '0 -1px 0 0 rgba(0, 0, 0, 0.1)',
|
|
49
|
+
filter: {
|
|
50
|
+
sort: 'rgba(0, 0, 0, 0.16) 0 2px 2px',
|
|
51
|
+
priceSlider: '0 0 8px rgba(0, 0, 0, .16)'
|
|
52
|
+
},
|
|
53
|
+
cart: {
|
|
54
|
+
paymentBar: '0 -4px 5px -2px rgba(0, 0, 0, 0.1)'
|
|
55
|
+
},
|
|
56
|
+
dialog: '0 0.75em 3em 0 rgba(0, 0, 0, 0.5)',
|
|
57
|
+
toast: '0 3px 1px -2px rgba(0, 0, 0, .2), 0 2px 2px 0 rgba(0, 0, 0, .14), 0 1px 5px 0 rgba(0, 0, 0, .12)',
|
|
58
|
+
contextMenu: '0 2px 6px rgba(0, 0, 0, .4)',
|
|
59
|
+
buttons: {
|
|
60
|
+
disabled: '0 3px 4px rgba(0, 0, 0, 0.13)',
|
|
61
|
+
elevated: '0 8px 13px rgba(0, 0, 0, 0.25)'
|
|
62
|
+
},
|
|
63
|
+
scannerBar: '0 0 0 1px rgba(0, 0, 0, 0.1)',
|
|
64
|
+
sheet: '0 -2px 4px rgba(0, 0, 0, 0.1)'
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/**
|
|
6
68
|
*
|
|
7
69
|
* @mixin ThemeVariables
|
|
8
|
-
*/
|
|
70
|
+
*/
|
|
71
|
+
const variables = {
|
|
72
|
+
materialShadow: shadows.material,
|
|
73
|
+
gap: {
|
|
74
|
+
xsmall: 4,
|
|
75
|
+
small: 8,
|
|
76
|
+
big: 16,
|
|
77
|
+
bigger: 20,
|
|
78
|
+
xbig: 32,
|
|
79
|
+
xxbig: 64
|
|
80
|
+
},
|
|
81
|
+
emptyPage: {
|
|
82
|
+
icon: 216,
|
|
83
|
+
titleTopGap: 36,
|
|
84
|
+
buttonVerticalGap: 24
|
|
85
|
+
},
|
|
86
|
+
navbar: {
|
|
87
|
+
height: 56
|
|
88
|
+
},
|
|
89
|
+
toast: {
|
|
90
|
+
duration: 5000
|
|
91
|
+
},
|
|
92
|
+
navigator: {
|
|
93
|
+
height: 56,
|
|
94
|
+
shadow: shadows.material
|
|
95
|
+
},
|
|
96
|
+
filterbar: {
|
|
97
|
+
height: 48
|
|
98
|
+
},
|
|
99
|
+
loadingIndicator: {
|
|
100
|
+
size: 32,
|
|
101
|
+
strokeWidth: 3,
|
|
102
|
+
imgSrc: null
|
|
103
|
+
},
|
|
104
|
+
paymentBar: {
|
|
105
|
+
height: 78
|
|
106
|
+
},
|
|
107
|
+
buttonBase: {
|
|
108
|
+
borderRadius: 2,
|
|
109
|
+
fontWeight: 500,
|
|
110
|
+
fontSize: 17,
|
|
111
|
+
padding: 0,
|
|
112
|
+
textTransform: 'uppercase'
|
|
113
|
+
},
|
|
114
|
+
discountBadgeBase: {
|
|
115
|
+
borderRadius: 2,
|
|
116
|
+
fontSize: '0.75rem'
|
|
117
|
+
},
|
|
118
|
+
productSliderWidget: {
|
|
119
|
+
borderRadius: 11,
|
|
120
|
+
boxShadow: shadows.widget
|
|
121
|
+
},
|
|
122
|
+
liveshoppingWidget: {
|
|
123
|
+
borderRadius: 11,
|
|
124
|
+
boxShadow: shadows.widget
|
|
125
|
+
},
|
|
126
|
+
tabBar: {
|
|
127
|
+
height: 0
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
/**
|
|
9
132
|
* @mixin ThemeIcons
|
|
10
|
-
*/
|
|
11
|
-
accountBox:'<path d="M3 5v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2H5c-1.11 0-2 .9-2 2zm12 4c0 1.66-1.34 3-3 3s-3-1.34-3-3 1.34-3 3-3 3 1.34 3 3zm-9 8c0-2 4-3.1 6-3.1s6 1.1 6 3.1v1H6v-1z"/><path d="M0 0h24v24H0z" fill="none"/>',addMore:'<g fill="#000" fill-rule="nonzero"><path d="M11.326 20.682a1.193 1.193 0 1 0 2.385-.004 1.193 1.193 0 0 0-2.385.004zm-4.4 0a1.193 1.193 0 1 0 1.192-1.192 1.193 1.193 0 0 0-1.198 1.192h.006zm-2.4-14.8a.906.906 0 0 0-.843-.587h-1.98a.903.903 0 1 0 0 1.806h1.355l2.772 7.217a.906.906 0 0 0 .843.588h6.266a.875.875 0 1 1 0 1.75H6.187a.903.903 0 1 0 0 1.806h6.758a2.677 2.677 0 0 0 1.87-4.596l2.221-4.005a.902.902 0 0 0-.654-1.33H5.537L4.526 5.882zM20.897 6.682H23.8V4.87h-2.903V2h-1.794v2.869h-2.897v1.813h2.897v2.88h1.794z"/></g>',arrowDrop:'<path d="M7 10l5 5 5-5z"/>',arrow:'<path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/>',arrowShadowed:'<defs><filter id="shadow"><feGaussianBlur in="SourceAlpha" stdDeviation="1" result="blur" /> <feOffset in="blur" dx="0" dy="1" result="offsetBlur" /> <feMerge> <feMergeNode in="offsetBlur" /> <feMergeNode in="SourceGraphic" /> </feMerge></filter> </defs> <path filter="url(#shadow)" d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" />',barcodeScanner:'<path d="M4.3 6.226h1.926V17.77H4.3V6.226zm2.89 0h.965V17.77H7.19V6.226zm1.925 0H12V17.77H9.115V6.226zm3.85 0h.965V17.77h-.97l.005-11.544zm2.885 0h1.924V17.77H15.85V6.226zm2.884 0h.965V17.77h-.965V6.226zM2.376 4.3v3.85H.451V4.3a1.922 1.922 0 011.92-1.92h3.85v1.925H2.376zm19.248-1.925a1.922 1.922 0 011.92 1.92v3.85h-1.925V4.3h-3.85V2.376h3.855zM2.376 15.85v3.85h3.85v1.924h-3.85c-.254 0-.504-.048-.74-.149a1.9 1.9 0 01-.623-.417 1.952 1.952 0 01-.418-.624 1.95 1.95 0 01-.144-.74V15.85h1.925zm19.248 3.85v-3.85h1.925v3.85a1.922 1.922 0 01-1.92 1.92h-3.85v-1.926l3.845.005z"/>',box:'<path d="M 13.900391,1.4433594 1.5996094,4.171875 l 0,0.025391 8.5390626,4.2089844 c 4.073387,-0.9018528 8.163817,-1.7958087 12.24414,-2.69141 z m 8.490221,4.8261718 -11.986328,2.6152344 0.111328,13.4472654 11.875,-2.658203 z M 9.9003906,22.25 c -6.600261,1.166667 -3.3001305,0.583333 0,0 z m 0,0 0,-13.4316406 -8.3007812,-4.0957032 0,13.4589848 z M 4.4238281,9.2304688 c 1.01719,0.50398 2.0367375,1.0052022 3.0546875,1.5078122 0.32345,0.12833 0.4898582,0.544909 0.3300782,0.855469 C 6.7949938,11.0955 5.7712662,10.587588 4.7539062,10.085938 4.4304763,9.9572575 4.2659081,9.5411387 4.4238281,9.2304688 Z" />',browse:'<path fill="currentColor" d="M14.999 20.205l-4.454-4.531a6.48 6.48 0 01-3.764 1.228 6.682 6.682 0 116.605-6.681 6.77 6.77 0 01-1.69 4.454l4.382 4.455a.742.742 0 010 1.075.696.696 0 01-.541.23.81.81 0 01-.538-.23zM1.713 10.22a5.182 5.182 0 005.068 5.145 5.146 5.146 0 10-5.068-5.145zm15.36 1.766a.768.768 0 010-1.536h6.144a.768.768 0 010 1.536zm-.768-3.072a.768.768 0 110-1.536h6.912a.768.768 0 110 1.536zm-.768-3.072a.768.768 0 010-1.536h7.68a.768.768 0 010 1.536z"/>',burger:'<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/>',cart:'<path d="M7.9,18c-1.1,0-2,0.9-2,2s0.9,2,2,2s2-0.9,2-2S9,18,7.9,18z M17.9,18c-1.1,0-2,0.9-2,2s0.9,2,2,2c1.1,0,2-0.9,2-2S19,18,17.9,18z M8.1,14.8l0-0.1L9,13h7.5c0.7,0,1.4-0.4,1.7-1l3.9-7l-1.7-1h0l-1.1,2l-2.8,5h-7l-0.1-0.3L7.1,6L6.1,4L5.2,2H1.9v2h2l3.6,7.6L6.2,14c-0.2,0.3-0.2,0.6-0.2,1c0,1.1,0.9,2,2,2h12v-2H8.3C8.2,15,8.1,14.9,8.1,14.8z"/>',cartPlus:'<path d="M0 0h24v24H0zm18.31 6l-2.76 5z" fill="none"/><path d="M11 9h2V6h3V4h-3V1h-2v3H8v2h3v3zm-4 9c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2zm-9.83-3.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.86-7.01L19.42 4h-.01l-1.1 2-2.76 5H8.53l-.13-.27L6.16 6l-.95-2-.94-2H1v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.13 0-.25-.11-.25-.25z"/>',checked:'<path d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>',check:'<path d="M1 11.248L8.84 19 23 5" stroke="#000" stroke-width="2" fill="none" fill-rule="evenodd"/>',chevron:'<path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/><path d="M0 0h24v24H0z" fill="none" />',creditCard:'<path d="M0 0h24v24H0z" fill="none"/><path d="M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"/>',cross:'<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/>',description:'<path d="M0 0h24v24H0z" fill="none"/><path d="M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"/>',filter:'<path d="M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"/>',flashDisabled:'<path d="M15.22,3.1,12,9.51l-.8,1.59h3.86l-4,6.83v-6h-3V3.1h7.12M17,2h0Zm0,0H7V13h3v9l7-12H13l4-8Z" />',flashEnabled:'<path d="M0 0h24v24H0z" fill="none"/><path d="M7 2v11h3v9l7-12h-4l4-8z"/>',grid:' <rect width="8" height="8" rx="1" transform="translate(3 3)"/> <rect width="8" height="8" rx="1" transform="translate(3 13)"/> <rect width="8" height="8" rx="1" transform="translate(13 3)"/> <rect width="8" height="8" rx="1" transform="translate(13 13)"/>',heart:'<path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/>',heartOutline:'<path d="M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3zm-4.4 15.55l-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05z"/>',home:'<path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/><path d="M0 0h24v24H0z" fill="none"/>',info:'<path d="M0 0h24v24H0z" fill="none"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/>',infoOutline:'<path d="M0 0h24v24H0z" fill="none"/><path d="M11 17h2v-6h-2v6zm1-15C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zM11 9h2V7h-2v2z"/>',list:'<path d="M3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7z"/>',localShipping:'<path d="M0 0h24v24H0z" fill="none"/><path d="M20 8h-3V4H3c-1.1 0-2 .9-2 2v11h2c0 1.66 1.34 3 3 3s3-1.34 3-3h6c0 1.66 1.34 3 3 3s3-1.34 3-3h2v-5l-3-4zM6 18.5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm13.5-9l1.96 2.5H17V9.5h2.5zm-1.5 9c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"/>',lock:'<path d="M0 0h24v24H0z" fill="none"/><path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"/>',logout:'<path d="M0 0h24v24H0z" fill="none"/><path d="M13 3h-2v10h2V3zm4.83 2.17l-1.42 1.42C17.99 7.86 19 9.81 19 12c0 3.87-3.13 7-7 7s-7-3.13-7-7c0-2.19 1.01-4.14 2.58-5.42L6.17 5.17C4.23 6.82 3 9.26 3 12c0 4.97 4.03 9 9 9s9-4.03 9-9c0-2.74-1.23-5.18-3.17-6.83z"/>',magnifier:'<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/>',more:'<path fill="currentColor" d="M18.115 11.693a2.943 2.943 0 112.943 2.943 2.942 2.942 0 01-2.943-2.943zm-9.056 0a2.945 2.945 0 112.943 2.943 2.946 2.946 0 01-2.947-2.943zm-9.056 0a2.943 2.943 0 112.942 2.943A2.945 2.945 0 010 11.693z"/>',moreVert:'<path d="M0 0h24v24H0z" fill="none"/><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/>',placeholder:'<circle cx="12" cy="12" r="3.2"/><path d="M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"/><path d="M0 0h24v24H0z" fill="none"/>',radioChecked:'<path d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"/>',radioUnchecked:'<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"/>',security:'<path d="M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11v8.8z"/><path d="M0 0h24v24H0z" fill="none"/>',shoppingCart:'<path d="M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zM1 2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.08-.14.12-.31.12-.48 0-.55-.45-1-1-1H5.21l-.94-2H1zm16 16c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"/><path d="M0 0h24v24H0z" fill="none"/>',sort:'<path d="M5.5,6C5.2,6,4.9,6.3,4.9,6.7c0,0,0,0,0,0v9l-1.3-1.1c-0.3-0.2-0.7-0.2-0.9,0.1 c-0.2,0.3-0.2,0.7,0.1,0.9l0,0l1,0.9l0,0l0.7,0.6L5,17.6l0,0L5.5,18l0,0L6,17.6l0.3-0.2l1-0.9l0,0l1-0.9c0.3-0.2,0.3-0.7,0.1-0.9 c-0.2-0.3-0.7-0.3-0.9-0.1l0,0l-1.3,1.1v-9C6.2,6.3,5.9,6,5.5,6C5.5,6,5.5,6,5.5,6L5.5,6z M10.4,6.1c-0.4,0-0.7,0.3-0.7,0.7 c0,0.4,0.3,0.7,0.7,0.7l0,0h10.3c0.4,0,0.7-0.3,0.7-0.7c0-0.4-0.3-0.7-0.7-0.7H10.4z M10.4,9.5c-0.4,0-0.7,0.3-0.7,0.7 c0,0.4,0.3,0.7,0.7,0.7l0,0h8.1c0.4,0,0.7-0.3,0.7-0.7c0-0.4-0.3-0.7-0.7-0.7H10.4z M10.4,12.9c-0.4,0-0.7,0.3-0.7,0.7 c0,0.4,0.3,0.7,0.7,0.7l0,0h5.8c0.4,0,0.7-0.3,0.7-0.7c0-0.4-0.3-0.7-0.7-0.7H10.4z M10.4,16.3c-0.4,0-0.7,0.3-0.7,0.7 s0.3,0.7,0.7,0.7H14c0.4,0,0.7-0.3,0.7-0.7s-0.3-0.7-0.7-0.7l0,0H10.4z"/>',starHalf:'<defs><path id="a" d="M0 0h24v24H0z"/></defs> <clipPath id="b"><use xlink:href="#a" overflow="visible"/></clipPath> <path clip-path="ul(#b)" d="M12 2L9.2 8.6 2 9.2 7.5 14l-1.6 7 6.2-3.7m-.1-1.9V6.1m2.8 7.3"/>',star:'<path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/>',starOutline:'<path d="M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"/>',tick:'<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>',trash:'<path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/>',unchecked:'<path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/>',viewList:'<path d="M4 14h4v-4H4v4zm0 5h4v-4H4v4zM4 9h4V5H4v4zm5 5h12v-4H9v4zm0 5h12v-4H9v4zM9 5v4h12V5H9z"/><path d="M0 0h24v24H0z" fill="none"/>',visibility:'<path d="M0 0h24v24H0z" fill="none"/><path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/>',visibilityOff:'<path d="M0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0z" fill="none"/><path d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"/>',// ui-material icons
|
|
12
|
-
|
|
133
|
+
*/
|
|
134
|
+
const icons = {
|
|
135
|
+
// ui-shared icons
|
|
136
|
+
accountBox: '<path d="M3 5v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2H5c-1.11 0-2 .9-2 2zm12 4c0 1.66-1.34 3-3 3s-3-1.34-3-3 1.34-3 3-3 3 1.34 3 3zm-9 8c0-2 4-3.1 6-3.1s6 1.1 6 3.1v1H6v-1z"/><path d="M0 0h24v24H0z" fill="none"/>',
|
|
137
|
+
addMore: '<g fill="#000" fill-rule="nonzero"><path d="M11.326 20.682a1.193 1.193 0 1 0 2.385-.004 1.193 1.193 0 0 0-2.385.004zm-4.4 0a1.193 1.193 0 1 0 1.192-1.192 1.193 1.193 0 0 0-1.198 1.192h.006zm-2.4-14.8a.906.906 0 0 0-.843-.587h-1.98a.903.903 0 1 0 0 1.806h1.355l2.772 7.217a.906.906 0 0 0 .843.588h6.266a.875.875 0 1 1 0 1.75H6.187a.903.903 0 1 0 0 1.806h6.758a2.677 2.677 0 0 0 1.87-4.596l2.221-4.005a.902.902 0 0 0-.654-1.33H5.537L4.526 5.882zM20.897 6.682H23.8V4.87h-2.903V2h-1.794v2.869h-2.897v1.813h2.897v2.88h1.794z"/></g>',
|
|
138
|
+
arrowDrop: '<path d="M7 10l5 5 5-5z"/>',
|
|
139
|
+
arrow: '<path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/>',
|
|
140
|
+
arrowShadowed: '<defs><filter id="shadow"><feGaussianBlur in="SourceAlpha" stdDeviation="1" result="blur" /> <feOffset in="blur" dx="0" dy="1" result="offsetBlur" /> <feMerge> <feMergeNode in="offsetBlur" /> <feMergeNode in="SourceGraphic" /> </feMerge></filter> </defs> <path filter="url(#shadow)" d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" />',
|
|
141
|
+
barcodeScanner: '<path d="M4.3 6.226h1.926V17.77H4.3V6.226zm2.89 0h.965V17.77H7.19V6.226zm1.925 0H12V17.77H9.115V6.226zm3.85 0h.965V17.77h-.97l.005-11.544zm2.885 0h1.924V17.77H15.85V6.226zm2.884 0h.965V17.77h-.965V6.226zM2.376 4.3v3.85H.451V4.3a1.922 1.922 0 011.92-1.92h3.85v1.925H2.376zm19.248-1.925a1.922 1.922 0 011.92 1.92v3.85h-1.925V4.3h-3.85V2.376h3.855zM2.376 15.85v3.85h3.85v1.924h-3.85c-.254 0-.504-.048-.74-.149a1.9 1.9 0 01-.623-.417 1.952 1.952 0 01-.418-.624 1.95 1.95 0 01-.144-.74V15.85h1.925zm19.248 3.85v-3.85h1.925v3.85a1.922 1.922 0 01-1.92 1.92h-3.85v-1.926l3.845.005z"/>',
|
|
142
|
+
box: '<path d="M 13.900391,1.4433594 1.5996094,4.171875 l 0,0.025391 8.5390626,4.2089844 c 4.073387,-0.9018528 8.163817,-1.7958087 12.24414,-2.69141 z m 8.490221,4.8261718 -11.986328,2.6152344 0.111328,13.4472654 11.875,-2.658203 z M 9.9003906,22.25 c -6.600261,1.166667 -3.3001305,0.583333 0,0 z m 0,0 0,-13.4316406 -8.3007812,-4.0957032 0,13.4589848 z M 4.4238281,9.2304688 c 1.01719,0.50398 2.0367375,1.0052022 3.0546875,1.5078122 0.32345,0.12833 0.4898582,0.544909 0.3300782,0.855469 C 6.7949938,11.0955 5.7712662,10.587588 4.7539062,10.085938 4.4304763,9.9572575 4.2659081,9.5411387 4.4238281,9.2304688 Z" />',
|
|
143
|
+
browse: '<path fill="currentColor" d="M14.999 20.205l-4.454-4.531a6.48 6.48 0 01-3.764 1.228 6.682 6.682 0 116.605-6.681 6.77 6.77 0 01-1.69 4.454l4.382 4.455a.742.742 0 010 1.075.696.696 0 01-.541.23.81.81 0 01-.538-.23zM1.713 10.22a5.182 5.182 0 005.068 5.145 5.146 5.146 0 10-5.068-5.145zm15.36 1.766a.768.768 0 010-1.536h6.144a.768.768 0 010 1.536zm-.768-3.072a.768.768 0 110-1.536h6.912a.768.768 0 110 1.536zm-.768-3.072a.768.768 0 010-1.536h7.68a.768.768 0 010 1.536z"/>',
|
|
144
|
+
burger: '<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/>',
|
|
145
|
+
cart: '<path d="M7.9,18c-1.1,0-2,0.9-2,2s0.9,2,2,2s2-0.9,2-2S9,18,7.9,18z M17.9,18c-1.1,0-2,0.9-2,2s0.9,2,2,2c1.1,0,2-0.9,2-2S19,18,17.9,18z M8.1,14.8l0-0.1L9,13h7.5c0.7,0,1.4-0.4,1.7-1l3.9-7l-1.7-1h0l-1.1,2l-2.8,5h-7l-0.1-0.3L7.1,6L6.1,4L5.2,2H1.9v2h2l3.6,7.6L6.2,14c-0.2,0.3-0.2,0.6-0.2,1c0,1.1,0.9,2,2,2h12v-2H8.3C8.2,15,8.1,14.9,8.1,14.8z"/>',
|
|
146
|
+
cartPlus: '<path d="M0 0h24v24H0zm18.31 6l-2.76 5z" fill="none"/><path d="M11 9h2V6h3V4h-3V1h-2v3H8v2h3v3zm-4 9c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2zm-9.83-3.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.86-7.01L19.42 4h-.01l-1.1 2-2.76 5H8.53l-.13-.27L6.16 6l-.95-2-.94-2H1v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.13 0-.25-.11-.25-.25z"/>',
|
|
147
|
+
checked: '<path d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>',
|
|
148
|
+
check: '<path d="M1 11.248L8.84 19 23 5" stroke="#000" stroke-width="2" fill="none" fill-rule="evenodd"/>',
|
|
149
|
+
chevron: '<path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/><path d="M0 0h24v24H0z" fill="none" />',
|
|
150
|
+
creditCard: '<path d="M0 0h24v24H0z" fill="none"/><path d="M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"/>',
|
|
151
|
+
cross: '<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/>',
|
|
152
|
+
description: '<path d="M0 0h24v24H0z" fill="none"/><path d="M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"/>',
|
|
153
|
+
filter: '<path d="M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"/>',
|
|
154
|
+
flashDisabled: '<path d="M15.22,3.1,12,9.51l-.8,1.59h3.86l-4,6.83v-6h-3V3.1h7.12M17,2h0Zm0,0H7V13h3v9l7-12H13l4-8Z" />',
|
|
155
|
+
flashEnabled: '<path d="M0 0h24v24H0z" fill="none"/><path d="M7 2v11h3v9l7-12h-4l4-8z"/>',
|
|
156
|
+
grid: ' <rect width="8" height="8" rx="1" transform="translate(3 3)"/> <rect width="8" height="8" rx="1" transform="translate(3 13)"/> <rect width="8" height="8" rx="1" transform="translate(13 3)"/> <rect width="8" height="8" rx="1" transform="translate(13 13)"/>',
|
|
157
|
+
heart: '<path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/>',
|
|
158
|
+
heartOutline: '<path d="M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3zm-4.4 15.55l-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05z"/>',
|
|
159
|
+
home: '<path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/><path d="M0 0h24v24H0z" fill="none"/>',
|
|
160
|
+
info: '<path d="M0 0h24v24H0z" fill="none"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/>',
|
|
161
|
+
infoOutline: '<path d="M0 0h24v24H0z" fill="none"/><path d="M11 17h2v-6h-2v6zm1-15C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zM11 9h2V7h-2v2z"/>',
|
|
162
|
+
list: '<path d="M3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7z"/>',
|
|
163
|
+
localShipping: '<path d="M0 0h24v24H0z" fill="none"/><path d="M20 8h-3V4H3c-1.1 0-2 .9-2 2v11h2c0 1.66 1.34 3 3 3s3-1.34 3-3h6c0 1.66 1.34 3 3 3s3-1.34 3-3h2v-5l-3-4zM6 18.5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm13.5-9l1.96 2.5H17V9.5h2.5zm-1.5 9c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"/>',
|
|
164
|
+
lock: '<path d="M0 0h24v24H0z" fill="none"/><path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"/>',
|
|
165
|
+
logout: '<path d="M0 0h24v24H0z" fill="none"/><path d="M13 3h-2v10h2V3zm4.83 2.17l-1.42 1.42C17.99 7.86 19 9.81 19 12c0 3.87-3.13 7-7 7s-7-3.13-7-7c0-2.19 1.01-4.14 2.58-5.42L6.17 5.17C4.23 6.82 3 9.26 3 12c0 4.97 4.03 9 9 9s9-4.03 9-9c0-2.74-1.23-5.18-3.17-6.83z"/>',
|
|
166
|
+
magnifier: '<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/>',
|
|
167
|
+
more: '<path fill="currentColor" d="M18.115 11.693a2.943 2.943 0 112.943 2.943 2.942 2.942 0 01-2.943-2.943zm-9.056 0a2.945 2.945 0 112.943 2.943 2.946 2.946 0 01-2.947-2.943zm-9.056 0a2.943 2.943 0 112.942 2.943A2.945 2.945 0 010 11.693z"/>',
|
|
168
|
+
moreVert: '<path d="M0 0h24v24H0z" fill="none"/><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/>',
|
|
169
|
+
placeholder: '<circle cx="12" cy="12" r="3.2"/><path d="M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"/><path d="M0 0h24v24H0z" fill="none"/>',
|
|
170
|
+
radioChecked: '<path d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"/>',
|
|
171
|
+
radioUnchecked: '<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"/>',
|
|
172
|
+
security: '<path d="M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11v8.8z"/><path d="M0 0h24v24H0z" fill="none"/>',
|
|
173
|
+
shoppingCart: '<path d="M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zM1 2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.08-.14.12-.31.12-.48 0-.55-.45-1-1-1H5.21l-.94-2H1zm16 16c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"/><path d="M0 0h24v24H0z" fill="none"/>',
|
|
174
|
+
sort: '<path d="M5.5,6C5.2,6,4.9,6.3,4.9,6.7c0,0,0,0,0,0v9l-1.3-1.1c-0.3-0.2-0.7-0.2-0.9,0.1 c-0.2,0.3-0.2,0.7,0.1,0.9l0,0l1,0.9l0,0l0.7,0.6L5,17.6l0,0L5.5,18l0,0L6,17.6l0.3-0.2l1-0.9l0,0l1-0.9c0.3-0.2,0.3-0.7,0.1-0.9 c-0.2-0.3-0.7-0.3-0.9-0.1l0,0l-1.3,1.1v-9C6.2,6.3,5.9,6,5.5,6C5.5,6,5.5,6,5.5,6L5.5,6z M10.4,6.1c-0.4,0-0.7,0.3-0.7,0.7 c0,0.4,0.3,0.7,0.7,0.7l0,0h10.3c0.4,0,0.7-0.3,0.7-0.7c0-0.4-0.3-0.7-0.7-0.7H10.4z M10.4,9.5c-0.4,0-0.7,0.3-0.7,0.7 c0,0.4,0.3,0.7,0.7,0.7l0,0h8.1c0.4,0,0.7-0.3,0.7-0.7c0-0.4-0.3-0.7-0.7-0.7H10.4z M10.4,12.9c-0.4,0-0.7,0.3-0.7,0.7 c0,0.4,0.3,0.7,0.7,0.7l0,0h5.8c0.4,0,0.7-0.3,0.7-0.7c0-0.4-0.3-0.7-0.7-0.7H10.4z M10.4,16.3c-0.4,0-0.7,0.3-0.7,0.7 s0.3,0.7,0.7,0.7H14c0.4,0,0.7-0.3,0.7-0.7s-0.3-0.7-0.7-0.7l0,0H10.4z"/>',
|
|
175
|
+
starHalf: '<defs><path id="a" d="M0 0h24v24H0z"/></defs> <clipPath id="b"><use xlink:href="#a" overflow="visible"/></clipPath> <path clip-path="ul(#b)" d="M12 2L9.2 8.6 2 9.2 7.5 14l-1.6 7 6.2-3.7m-.1-1.9V6.1m2.8 7.3"/>',
|
|
176
|
+
star: '<path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/>',
|
|
177
|
+
starOutline: '<path d="M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"/>',
|
|
178
|
+
tick: '<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>',
|
|
179
|
+
trash: '<path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/>',
|
|
180
|
+
unchecked: '<path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/>',
|
|
181
|
+
viewList: '<path d="M4 14h4v-4H4v4zm0 5h4v-4H4v4zM4 9h4V5H4v4zm5 5h12v-4H9v4zm0 5h12v-4H9v4zM9 5v4h12V5H9z"/><path d="M0 0h24v24H0z" fill="none"/>',
|
|
182
|
+
visibility: '<path d="M0 0h24v24H0z" fill="none"/><path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/>',
|
|
183
|
+
visibilityOff: '<path d="M0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0z" fill="none"/><path d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"/>',
|
|
184
|
+
// ui-material icons
|
|
185
|
+
share: '<path d="M18 16.1364C17.24 16.1364 16.56 16.4376 16.04 16.9095L8.91 12.7428C8.96 12.5119 9 12.281 9 12.04C9 11.7991 8.96 11.5682 8.91 11.3372L15.96 7.21072C16.5 7.71273 17.21 8.02397 18 8.02397C19.66 8.02397 21 6.67859 21 5.01193C21 3.34526 19.66 1.99988 18 1.99988C16.34 1.99988 15 3.34526 15 5.01193C15 5.25289 15.04 5.48381 15.09 5.71474L8.04 9.84124C7.5 9.33924 6.79 9.02799 6 9.02799C4.34 9.02799 3 10.3734 3 12.04C3 13.7067 4.34 15.0521 6 15.0521C6.79 15.0521 7.5 14.7408 8.04 14.2388L15.16 18.4155C15.11 18.6264 15.08 18.8473 15.08 19.0682C15.08 20.6846 16.39 21.9999 18 21.9999C19.61 21.9999 20.92 20.6846 20.92 19.0682C20.92 17.4517 19.61 16.1364 18 16.1364Z"/>'
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
/**
|
|
13
189
|
* @typedef {Object} ThemeConfig
|
|
14
190
|
* @property {ThemeColors} colors
|
|
15
191
|
* @property {ThemeShadows} shadows
|
|
16
192
|
* @property {ThemeVariables} variables
|
|
17
193
|
* @property {ThemeIcons} icons
|
|
18
|
-
*/
|
|
19
|
-
|
|
194
|
+
*/
|
|
195
|
+
|
|
196
|
+
/** @type {ThemeConfig} */
|
|
197
|
+
export const themeConfig = {
|
|
198
|
+
typography: {
|
|
199
|
+
family: 'Roboto, Arial, sans-serif',
|
|
200
|
+
rootSize: 16,
|
|
201
|
+
lineHeight: 1.5
|
|
202
|
+
},
|
|
203
|
+
colors,
|
|
204
|
+
shadows,
|
|
205
|
+
variables,
|
|
206
|
+
icons
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
// Alias for jest hoisting
|
|
210
|
+
export const mockThemeConfig = themeConfig;
|
|
211
|
+
export const themeName = 'theme';
|
package/helpers/config/theme.js
CHANGED
|
@@ -1,9 +1,55 @@
|
|
|
1
|
-
|
|
1
|
+
import { themeConfig as mockConfig } from "./mock";
|
|
2
|
+
import { assignObjectDeep } from "../data";
|
|
3
|
+
|
|
4
|
+
/**
|
|
2
5
|
* Provides a default theme config as a fallback.
|
|
3
6
|
* @type {Object}
|
|
4
|
-
*/
|
|
7
|
+
*/
|
|
8
|
+
const defaultConfig = {
|
|
9
|
+
typography: {},
|
|
10
|
+
colors: {},
|
|
11
|
+
variables: {},
|
|
12
|
+
shadows: {}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
5
16
|
* Builds and returns a new theme config object.
|
|
6
17
|
* @param {Object} appConfig The app config.
|
|
7
18
|
* @returns {Object}
|
|
8
|
-
*/
|
|
9
|
-
|
|
19
|
+
*/
|
|
20
|
+
export function buildThemeConfig(appConfig) {
|
|
21
|
+
if (process.env.NODE_ENV === 'test') {
|
|
22
|
+
return mockConfig;
|
|
23
|
+
}
|
|
24
|
+
const {
|
|
25
|
+
colors = {},
|
|
26
|
+
theme = {}
|
|
27
|
+
} = appConfig;
|
|
28
|
+
const oldTheme = process.env.THEME_CONFIG || defaultConfig;
|
|
29
|
+
const themeConfig = {
|
|
30
|
+
...theme
|
|
31
|
+
};
|
|
32
|
+
assignObjectDeep(themeConfig, {
|
|
33
|
+
colors: {
|
|
34
|
+
...colors,
|
|
35
|
+
/**
|
|
36
|
+
* The SDK creates some colors dynamically and populates them via the THEME_CONFIG.
|
|
37
|
+
* To avoid breaking changes, those colors also needs to be added for now.
|
|
38
|
+
*/
|
|
39
|
+
...oldTheme.colors
|
|
40
|
+
},
|
|
41
|
+
variables: {
|
|
42
|
+
...(oldTheme.variables || {}),
|
|
43
|
+
materialShadow: theme.shadows.material
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// Force cta colors
|
|
48
|
+
if (!themeConfig.colors.cta && themeConfig.colors.primary) {
|
|
49
|
+
themeConfig.colors.cta = themeConfig.colors.primary;
|
|
50
|
+
}
|
|
51
|
+
if (!themeConfig.colors.ctaContrast && themeConfig.colors.primaryContrast) {
|
|
52
|
+
themeConfig.colors.ctaContrast = themeConfig.colors.primaryContrast;
|
|
53
|
+
}
|
|
54
|
+
return themeConfig;
|
|
55
|
+
}
|