@shopgate/engage 7.27.5-alpha.1 → 7.27.5-alpha.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopgate/engage",
3
- "version": "7.27.5-alpha.1",
3
+ "version": "7.27.5-alpha.2",
4
4
  "description": "Shopgate's ENGAGE library.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Shopgate <support@shopgate.com>",
@@ -17,12 +17,12 @@
17
17
  "dependencies": {
18
18
  "@emotion/react": "^11.14.0",
19
19
  "@shopgate/native-modules": "1.0.0-beta.25",
20
- "@shopgate/pwa-common": "7.27.5-alpha.1",
21
- "@shopgate/pwa-common-commerce": "7.27.5-alpha.1",
22
- "@shopgate/pwa-core": "7.27.5-alpha.1",
23
- "@shopgate/pwa-ui-ios": "7.27.5-alpha.1",
24
- "@shopgate/pwa-ui-material": "7.27.5-alpha.1",
25
- "@shopgate/pwa-ui-shared": "7.27.5-alpha.1",
20
+ "@shopgate/pwa-common": "7.27.5-alpha.2",
21
+ "@shopgate/pwa-common-commerce": "7.27.5-alpha.2",
22
+ "@shopgate/pwa-core": "7.27.5-alpha.2",
23
+ "@shopgate/pwa-ui-ios": "7.27.5-alpha.2",
24
+ "@shopgate/pwa-ui-material": "7.27.5-alpha.2",
25
+ "@shopgate/pwa-ui-shared": "7.27.5-alpha.2",
26
26
  "@stripe/react-stripe-js": "^1.16.5",
27
27
  "@stripe/stripe-js": "^1.3.1",
28
28
  "@virtuous/conductor": "~2.5.0",
@@ -1,4 +1,4 @@
1
- import _camelCase from"lodash/camelCase";import{useWidget}from'@shopgate/engage/page/hooks';import{useSelector,useDispatch}from'react-redux';import{getCategory}from'@shopgate/pwa-common-commerce/category/selectors';import{fetchCategoryOrRootCategories}from'@shopgate/engage/category/actions';import{useEffect,useMemo}from'react';import{getCategoriesById}from'@shopgate/theme-ios11/widgets/selectors';/**
1
+ import _camelCase from"lodash/camelCase";import{useEffect,useMemo}from'react';import{useSelector,useDispatch}from'react-redux';import{getCategory}from'@shopgate/pwa-common-commerce/category/selectors';import{fetchCategoryOrRootCategories}from'@shopgate/engage/category/actions';import{useWidget}from'@shopgate/engage/page/hooks';import{getCategoriesById}from"./selectors";/**
2
2
  * @typedef {Object} CategoryListWidgetConfig
3
3
  * @property {string} category The parent category ID to display categories for.
4
4
  * @property {string} [sort] The sort order for categories
@@ -0,0 +1,8 @@
1
+ import{createSelector}from'reselect';import{getCategoryChildren,getRootCategories}from'@shopgate/engage/category/selectors';/**
2
+ * Retrieves categories from the state.
3
+ * If no category id is passed, root-categories will be returned.
4
+ * @param {Object} state The application state.
5
+ * @param {Object} props The component props.
6
+ * @returns {Object[]} The categories collection.
7
+ */export var getCategoriesById=createSelector(getCategoryChildren,getRootCategories,function(state,props){return props.categoryId;},function(childCategories,rootCategories,categoryId){// Check if we have to handle the root-category
8
+ if(!categoryId&&rootCategories){return rootCategories;}return childCategories;});