@blaze-cms/react-page-builder 0.146.0-node18-core-styles.1 → 0.146.0-node18-core-styles.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.
Files changed (90) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/lib/application/query/index.js +18 -15
  3. package/lib/application/query/index.js.map +1 -1
  4. package/lib/components/Card/Card.js +3 -1
  5. package/lib/components/Card/Card.js.map +1 -1
  6. package/lib/components/ContentGroup/ContentGroupTabs.js +0 -1
  7. package/lib/components/ContentGroup/ContentGroupTabs.js.map +1 -1
  8. package/lib/components/ItemList/ItemListButton/ItemListButton.js +9 -7
  9. package/lib/components/ItemList/ItemListButton/ItemListButton.js.map +1 -1
  10. package/lib/components/ItemList/ItemListCounter/ItemListCounter.js +2 -2
  11. package/lib/components/ItemList/ItemListCounter/ItemListCounter.js.map +1 -1
  12. package/lib/components/ItemList/icons/AddedBookmark.js +41 -0
  13. package/lib/components/ItemList/icons/AddedBookmark.js.map +1 -0
  14. package/lib/components/ItemList/icons/BaseBookmark.js +45 -0
  15. package/lib/components/ItemList/icons/BaseBookmark.js.map +1 -0
  16. package/lib/components/ItemList/icons/HoverBookmark.js +43 -0
  17. package/lib/components/ItemList/icons/HoverBookmark.js.map +1 -0
  18. package/lib/components/ItemList/icons/RemoveBookmark.js +41 -0
  19. package/lib/components/ItemList/icons/RemoveBookmark.js.map +1 -0
  20. package/lib/components/ItemList/icons/index.js +36 -0
  21. package/lib/components/ItemList/icons/index.js.map +1 -0
  22. package/lib/components/List/ListFactory.js +11 -5
  23. package/lib/components/List/ListFactory.js.map +1 -1
  24. package/lib/components/List/components/Full/FullRenderItem.js +32 -29
  25. package/lib/components/List/components/Full/FullRenderItem.js.map +1 -1
  26. package/lib/helpers/build-props-query.js +4 -2
  27. package/lib/helpers/build-props-query.js.map +1 -1
  28. package/lib/index.js +6 -0
  29. package/lib/index.js.map +1 -1
  30. package/lib/variants/LiveBlogList/LiveBlogList.js +116 -0
  31. package/lib/variants/LiveBlogList/LiveBlogList.js.map +1 -0
  32. package/lib/variants/LiveBlogList/index.js +43 -0
  33. package/lib/variants/LiveBlogList/index.js.map +1 -0
  34. package/lib/variants/index.js +3 -1
  35. package/lib/variants/index.js.map +1 -1
  36. package/lib-es/application/query/index.js +9 -1
  37. package/lib-es/application/query/index.js.map +1 -1
  38. package/lib-es/components/Card/Card.js +3 -1
  39. package/lib-es/components/Card/Card.js.map +1 -1
  40. package/lib-es/components/ContentGroup/ContentGroupTabs.js +0 -1
  41. package/lib-es/components/ContentGroup/ContentGroupTabs.js.map +1 -1
  42. package/lib-es/components/ItemList/ItemListButton/ItemListButton.js +9 -7
  43. package/lib-es/components/ItemList/ItemListButton/ItemListButton.js.map +1 -1
  44. package/lib-es/components/ItemList/ItemListCounter/ItemListCounter.js +2 -2
  45. package/lib-es/components/ItemList/ItemListCounter/ItemListCounter.js.map +1 -1
  46. package/lib-es/components/ItemList/icons/AddedBookmark.js +33 -0
  47. package/lib-es/components/ItemList/icons/AddedBookmark.js.map +1 -0
  48. package/lib-es/components/ItemList/icons/BaseBookmark.js +37 -0
  49. package/lib-es/components/ItemList/icons/BaseBookmark.js.map +1 -0
  50. package/lib-es/components/ItemList/icons/HoverBookmark.js +35 -0
  51. package/lib-es/components/ItemList/icons/HoverBookmark.js.map +1 -0
  52. package/lib-es/components/ItemList/icons/RemoveBookmark.js +33 -0
  53. package/lib-es/components/ItemList/icons/RemoveBookmark.js.map +1 -0
  54. package/lib-es/components/ItemList/icons/index.js +5 -0
  55. package/lib-es/components/ItemList/icons/index.js.map +1 -0
  56. package/lib-es/components/List/ListFactory.js +10 -4
  57. package/lib-es/components/List/ListFactory.js.map +1 -1
  58. package/lib-es/components/List/components/Full/FullRenderItem.js +34 -30
  59. package/lib-es/components/List/components/Full/FullRenderItem.js.map +1 -1
  60. package/lib-es/helpers/build-props-query.js +4 -2
  61. package/lib-es/helpers/build-props-query.js.map +1 -1
  62. package/lib-es/index.js +1 -1
  63. package/lib-es/index.js.map +1 -1
  64. package/lib-es/variants/LiveBlogList/LiveBlogList.js +90 -0
  65. package/lib-es/variants/LiveBlogList/LiveBlogList.js.map +1 -0
  66. package/lib-es/variants/LiveBlogList/index.js +12 -0
  67. package/lib-es/variants/LiveBlogList/index.js.map +1 -0
  68. package/lib-es/variants/index.js +3 -1
  69. package/lib-es/variants/index.js.map +1 -1
  70. package/package.json +6 -6
  71. package/src/application/query/index.js +11 -1
  72. package/src/components/Card/Card.js +2 -1
  73. package/src/components/ContentGroup/ContentGroupTabs.js +0 -1
  74. package/src/components/ItemList/ItemListButton/ItemListButton.js +11 -13
  75. package/src/components/ItemList/ItemListCounter/ItemListCounter.js +2 -2
  76. package/src/components/ItemList/icons/AddedBookmark.js +33 -0
  77. package/src/components/ItemList/icons/BaseBookmark.js +33 -0
  78. package/src/components/ItemList/icons/HoverBookmark.js +33 -0
  79. package/src/components/ItemList/icons/RemoveBookmark.js +33 -0
  80. package/src/components/ItemList/icons/index.js +4 -0
  81. package/src/components/List/ListFactory.js +13 -4
  82. package/src/components/List/components/Full/FullRenderItem.js +45 -28
  83. package/src/helpers/build-props-query.js +3 -2
  84. package/src/index.js +2 -1
  85. package/src/variants/LiveBlogList/LiveBlogList.js +109 -0
  86. package/src/variants/LiveBlogList/index.js +13 -0
  87. package/src/variants/index.js +3 -1
  88. package/tests/unit/src/components/ItemList/__snapshots__/ItemListButton.test.js.snap +143 -35
  89. package/tests/unit/src/components/ItemList/__snapshots__/ItemListCounter.test.js.snap +37 -7
  90. package/tests/unit/src/helpers/build-props-query.test.js +13 -11
@@ -0,0 +1,90 @@
1
+ import React, { useRef, useState, useEffect } from 'react';
2
+ import dayjs from 'dayjs';
3
+ import relativeTime from 'dayjs/plugin/relativeTime';
4
+ import Button from '@blaze-react/button';
5
+ import { FaPlus, FaMinus } from 'react-icons/fa';
6
+ import { BsPinAngleFill } from 'react-icons/bs';
7
+ dayjs.extend(relativeTime);
8
+ const LiveBlogList = props => {
9
+ const {
10
+ children,
11
+ date,
12
+ published,
13
+ featured
14
+ } = props;
15
+ const [isExpanded, setIsExpanded] = useState(false);
16
+ const [shouldShowButton, setShouldShowButton] = useState(false);
17
+ const [{
18
+ displayedDate,
19
+ displayedTime
20
+ }, setDisplayedDate] = useState({
21
+ displayedDate: ' ',
22
+ displayTime: ''
23
+ });
24
+ const usedDate = date || published;
25
+ const contentRef = useRef(null);
26
+ useEffect(() => {
27
+ const timeout = setTimeout(() => {
28
+ if (contentRef.current) {
29
+ const contentHeight = contentRef.current.scrollHeight;
30
+ if (contentHeight > 380) {
31
+ setShouldShowButton(true);
32
+ }
33
+ }
34
+ }, 500); // delay to wait for content load
35
+ // todo: change to use mutation observer
36
+
37
+ return () => {
38
+ clearTimeout(timeout);
39
+ };
40
+ }, [children]);
41
+ useEffect(() => {
42
+ // delay setting time so no SSR issues based on timezone
43
+ let newDate = '';
44
+ if (usedDate) {
45
+ const diffInDays = dayjs().diff(dayjs(usedDate), 'day');
46
+ if (diffInDays < 1) {
47
+ newDate = dayjs(usedDate).fromNow();
48
+ } else if (diffInDays < 365) {
49
+ newDate = dayjs(usedDate).format('DD MMM');
50
+ } else {
51
+ newDate = dayjs(usedDate).format('DD MMM YYYY');
52
+ }
53
+ setDisplayedDate({
54
+ displayedDate: newDate,
55
+ displayedTime: dayjs(usedDate).format('HH:mm')
56
+ });
57
+ }
58
+ }, [date, published, usedDate]);
59
+ const toggleExpanded = () => {
60
+ setIsExpanded(!isExpanded);
61
+ };
62
+ const isCollapsed = !isExpanded;
63
+ const baseClass = 'live-blog-container';
64
+ const modifier = featured ? ` ${baseClass}--featured` : '';
65
+ const className = `${baseClass}${modifier}`;
66
+ return /*#__PURE__*/React.createElement("div", {
67
+ className: className
68
+ }, usedDate && /*#__PURE__*/React.createElement("div", {
69
+ className: "live-blog-date"
70
+ }, featured && /*#__PURE__*/React.createElement(BsPinAngleFill, null), /*#__PURE__*/React.createElement("span", {
71
+ className: "live-blog-date--date"
72
+ }, displayedDate), /*#__PURE__*/React.createElement("span", {
73
+ className: "live-blog-date--time"
74
+ }, displayedTime)), /*#__PURE__*/React.createElement("div", {
75
+ ref: contentRef,
76
+ className: `live-blog-content ${isCollapsed ? 'live-blog-content--collapsed' : 'live-blog-content--opened'}`
77
+ }, children), shouldShowButton && /*#__PURE__*/React.createElement("div", {
78
+ className: "live-blog-button-wrapper"
79
+ }, /*#__PURE__*/React.createElement(Button, {
80
+ className: "live-blog-toggle",
81
+ onClick: toggleExpanded,
82
+ type: "button"
83
+ }, isExpanded ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FaMinus, {
84
+ className: "toggle-icon"
85
+ }), " Show Less") : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FaPlus, {
86
+ className: "toggle-icon"
87
+ }), " Show More"))));
88
+ };
89
+ export default LiveBlogList;
90
+ //# sourceMappingURL=LiveBlogList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LiveBlogList.js","names":["React","useRef","useState","useEffect","dayjs","relativeTime","Button","FaPlus","FaMinus","BsPinAngleFill","extend","LiveBlogList","props","children","date","published","featured","isExpanded","setIsExpanded","shouldShowButton","setShouldShowButton","displayedDate","displayedTime","setDisplayedDate","displayTime","usedDate","contentRef","timeout","setTimeout","current","contentHeight","scrollHeight","clearTimeout","newDate","diffInDays","diff","fromNow","format","toggleExpanded","isCollapsed","baseClass","modifier","className","createElement","ref","onClick","type","Fragment"],"sources":["../../../src/variants/LiveBlogList/LiveBlogList.js"],"sourcesContent":["import React, { useRef, useState, useEffect } from 'react';\nimport dayjs from 'dayjs';\nimport relativeTime from 'dayjs/plugin/relativeTime';\nimport Button from '@blaze-react/button';\nimport { FaPlus, FaMinus } from 'react-icons/fa';\nimport { BsPinAngleFill } from 'react-icons/bs';\n\ndayjs.extend(relativeTime);\n\nconst LiveBlogList = props => {\n const { children, date, published, featured } = props;\n const [isExpanded, setIsExpanded] = useState(false);\n const [shouldShowButton, setShouldShowButton] = useState(false);\n const [{ displayedDate, displayedTime }, setDisplayedDate] = useState({\n displayedDate: '&nbsp;',\n displayTime: ''\n });\n const usedDate = date || published;\n\n const contentRef = useRef(null);\n\n useEffect(\n () => {\n const timeout = setTimeout(() => {\n if (contentRef.current) {\n const contentHeight = contentRef.current.scrollHeight;\n if (contentHeight > 380) {\n setShouldShowButton(true);\n }\n }\n }, 500); // delay to wait for content load\n // todo: change to use mutation observer\n\n return () => {\n clearTimeout(timeout);\n };\n },\n [children]\n );\n\n useEffect(\n () => {\n // delay setting time so no SSR issues based on timezone\n let newDate = '';\n if (usedDate) {\n const diffInDays = dayjs().diff(dayjs(usedDate), 'day');\n if (diffInDays < 1) {\n newDate = dayjs(usedDate).fromNow();\n } else if (diffInDays < 365) {\n newDate = dayjs(usedDate).format('DD MMM');\n } else {\n newDate = dayjs(usedDate).format('DD MMM YYYY');\n }\n setDisplayedDate({\n displayedDate: newDate,\n displayedTime: dayjs(usedDate).format('HH:mm')\n });\n }\n },\n [date, published, usedDate]\n );\n\n const toggleExpanded = () => {\n setIsExpanded(!isExpanded);\n };\n\n const isCollapsed = !isExpanded;\n const baseClass = 'live-blog-container';\n const modifier = featured ? ` ${baseClass}--featured` : '';\n const className = `${baseClass}${modifier}`;\n\n return (\n <div className={className}>\n {usedDate && (\n <div className=\"live-blog-date\">\n {featured && <BsPinAngleFill />}\n <span className=\"live-blog-date--date\">{displayedDate}</span>\n <span className=\"live-blog-date--time\">{displayedTime}</span>\n </div>\n )}\n\n <div\n ref={contentRef}\n className={`live-blog-content ${\n isCollapsed ? 'live-blog-content--collapsed' : 'live-blog-content--opened'\n }`}>\n {children}\n </div>\n\n {shouldShowButton && (\n <div className=\"live-blog-button-wrapper\">\n <Button className=\"live-blog-toggle\" onClick={toggleExpanded} type=\"button\">\n {isExpanded ? (\n <>\n <FaMinus className=\"toggle-icon\" /> Show Less\n </>\n ) : (\n <>\n <FaPlus className=\"toggle-icon\" /> Show More\n </>\n )}\n </Button>\n </div>\n )}\n </div>\n );\n};\n\nexport default LiveBlogList;\n"],"mappings":"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","ignoreList":[]}
@@ -0,0 +1,12 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ import dynamic from 'next/dynamic';
5
+ const liveBlogList = {
6
+ VariantComponent: dynamic(() => import(/* webpackChunkName: "blazePbliveBlogList" */'./LiveBlogList')),
7
+ getSettings: componentSettings => _objectSpread(_objectSpread({}, componentSettings), {}, {
8
+ modifier: 'liveBlogList'
9
+ })
10
+ };
11
+ export default liveBlogList;
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["dynamic","liveBlogList","VariantComponent","getSettings","componentSettings","_objectSpread","modifier"],"sources":["../../../src/variants/LiveBlogList/index.js"],"sourcesContent":["import dynamic from 'next/dynamic';\n\nconst liveBlogList = {\n VariantComponent: dynamic(() =>\n import(/* webpackChunkName: \"blazePbliveBlogList\" */ './LiveBlogList')\n ),\n getSettings: componentSettings => ({\n ...componentSettings,\n modifier: 'liveBlogList'\n })\n};\n\nexport default liveBlogList;\n"],"mappings":";;;AAAA,OAAOA,OAAO,MAAM,cAAc;AAElC,MAAMC,YAAY,GAAG;EACnBC,gBAAgB,EAAEF,OAAO,CAAC,MACxB,MAAM,CAAC,6CAA8C,gBAAgB,CACvE,CAAC;EACDG,WAAW,EAAEC,iBAAiB,IAAAC,aAAA,CAAAA,aAAA,KACzBD,iBAAiB;IACpBE,QAAQ,EAAE;EAAc;AAE5B,CAAC;AAED,eAAeL,YAAY","ignoreList":[]}
@@ -6,6 +6,7 @@ import parallaxImageTextRight from './ParallaxImageTextRight';
6
6
  import thumbnailCarousel from './ThumbnailCarousel';
7
7
  import slideSummary from './SlideSummary';
8
8
  import floatingSideButton from './FloatingSideButton';
9
+ import liveBlogList from './LiveBlogList';
9
10
  export default {
10
11
  heroImage,
11
12
  infographic,
@@ -14,6 +15,7 @@ export default {
14
15
  parallaxImageTextRight,
15
16
  thumbnailCarousel,
16
17
  slideSummary,
17
- floatingSideButton
18
+ floatingSideButton,
19
+ liveBlogList
18
20
  };
19
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["heroImage","infographic","longformGallery","longformRow","parallaxImageTextRight","thumbnailCarousel","slideSummary","floatingSideButton"],"sources":["../../src/variants/index.js"],"sourcesContent":["import heroImage from './HeroImage';\nimport infographic from './Infographic';\nimport longformGallery from './LongformGallery';\nimport longformRow from './LongformRow';\nimport parallaxImageTextRight from './ParallaxImageTextRight';\nimport thumbnailCarousel from './ThumbnailCarousel';\nimport slideSummary from './SlideSummary';\nimport floatingSideButton from './FloatingSideButton';\n\nexport default {\n heroImage,\n infographic,\n longformGallery,\n longformRow,\n parallaxImageTextRight,\n thumbnailCarousel,\n slideSummary,\n floatingSideButton\n};\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,aAAa;AACnC,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,eAAe,MAAM,mBAAmB;AAC/C,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,sBAAsB,MAAM,0BAA0B;AAC7D,OAAOC,iBAAiB,MAAM,qBAAqB;AACnD,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,kBAAkB,MAAM,sBAAsB;AAErD,eAAe;EACbP,SAAS;EACTC,WAAW;EACXC,eAAe;EACfC,WAAW;EACXC,sBAAsB;EACtBC,iBAAiB;EACjBC,YAAY;EACZC;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["heroImage","infographic","longformGallery","longformRow","parallaxImageTextRight","thumbnailCarousel","slideSummary","floatingSideButton","liveBlogList"],"sources":["../../src/variants/index.js"],"sourcesContent":["import heroImage from './HeroImage';\nimport infographic from './Infographic';\nimport longformGallery from './LongformGallery';\nimport longformRow from './LongformRow';\nimport parallaxImageTextRight from './ParallaxImageTextRight';\nimport thumbnailCarousel from './ThumbnailCarousel';\nimport slideSummary from './SlideSummary';\nimport floatingSideButton from './FloatingSideButton';\nimport liveBlogList from './LiveBlogList';\n\nexport default {\n heroImage,\n infographic,\n longformGallery,\n longformRow,\n parallaxImageTextRight,\n thumbnailCarousel,\n slideSummary,\n floatingSideButton,\n liveBlogList\n};\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,aAAa;AACnC,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,eAAe,MAAM,mBAAmB;AAC/C,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,sBAAsB,MAAM,0BAA0B;AAC7D,OAAOC,iBAAiB,MAAM,qBAAqB;AACnD,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,kBAAkB,MAAM,sBAAsB;AACrD,OAAOC,YAAY,MAAM,gBAAgB;AAEzC,eAAe;EACbR,SAAS;EACTC,WAAW;EACXC,eAAe;EACfC,WAAW;EACXC,sBAAsB;EACtBC,iBAAiB;EACjBC,YAAY;EACZC,kBAAkB;EAClBC;AACF,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaze-cms/react-page-builder",
3
- "version": "0.146.0-node18-core-styles.1",
3
+ "version": "0.146.0-node18-core-styles.2",
4
4
  "description": "Blaze react page builder",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-es/index.js",
@@ -27,14 +27,14 @@
27
27
  },
28
28
  "license": "GPL-3.0",
29
29
  "dependencies": {
30
- "@blaze-cms/core-auth-ui": "0.146.0-node18-core-styles.0",
31
- "@blaze-cms/core-errors": "0.146.0-node18-core-styles.0",
30
+ "@blaze-cms/core-auth-ui": "0.146.0-node18-core-styles.2",
31
+ "@blaze-cms/core-errors": "0.146.0-node18-core-styles.2",
32
32
  "@blaze-cms/core-errors-ui": "0.146.0-node18-core-styles.0",
33
33
  "@blaze-cms/image-cdn-react": "0.3.0-alpha.7",
34
34
  "@blaze-cms/nextjs-components": "0.146.0-node18-core-styles.0",
35
- "@blaze-cms/plugin-search-ui": "0.146.0-node18-core-styles.0",
35
+ "@blaze-cms/plugin-search-ui": "0.146.0-node18-core-styles.2",
36
36
  "@blaze-cms/setup-ui": "0.146.0-node18-core-styles.0",
37
- "@blaze-cms/utils": "0.146.0-node18-core-styles.0",
37
+ "@blaze-cms/utils": "0.146.0-node18-core-styles.2",
38
38
  "@blaze-cms/utils-handlebars": "0.146.0-node18-core-styles.0",
39
39
  "@blaze-react/badge": "^0.7.0",
40
40
  "@blaze-react/breadcrumb": "0.8.0-alpha.60",
@@ -91,5 +91,5 @@
91
91
  "lib/*",
92
92
  "lib-es/*"
93
93
  ],
94
- "gitHead": "be6b9b2765051031e33510cebab1d01605c26ef1"
94
+ "gitHead": "c124596c6b8d92f08f58c4dc004a4ea7d1703f23"
95
95
  }
@@ -29,6 +29,15 @@ const getUser = userProps => gql`
29
29
  }
30
30
  `;
31
31
 
32
+ const getCurrentUser = userProps => gql`
33
+ query {
34
+ getUser: getCurrentUser {
35
+ id
36
+ ${userProps}
37
+ }
38
+ }
39
+ `;
40
+
32
41
  const getEntitySchema = gql`
33
42
  query getEntitySchemas($identifier: String!) {
34
43
  getEntitySchemas(identifier: $identifier) {
@@ -201,5 +210,6 @@ export {
201
210
  getRecordParents,
202
211
  getItemList,
203
212
  addItemsToList,
204
- removeItemsFromList
213
+ removeItemsFromList,
214
+ getCurrentUser
205
215
  };
@@ -284,9 +284,10 @@ const getImageDefinedProps = ({ image, displayThumbnail, name }) => {
284
284
 
285
285
  const getInitialModifiers = ({ modifier, style, otherProps }) => {
286
286
  const modifiers = [modifier, style];
287
- const { sponsored, featured } = otherProps;
287
+ const { sponsored, featured, live } = otherProps;
288
288
  if (sponsored) modifiers.push('sponsored');
289
289
  if (featured) modifiers.push('featured');
290
+ if (live) modifiers.push('live');
290
291
 
291
292
  return modifiers;
292
293
  };
@@ -44,7 +44,6 @@ const ContentGroupTabs = ({ name, contentType, groupSections, sectionsData, Vari
44
44
  const newUrl = `${baseUrl}#${sectionName}`;
45
45
  if (asPath === newUrl) return;
46
46
  router.push(`/Resolver`, newUrl, { shallow: true });
47
- setSelectedTab(tabId);
48
47
  }}>
49
48
  {sectioLabel}
50
49
  </button>
@@ -1,12 +1,7 @@
1
1
  import React, { useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import {
4
- BsBookmarkStarFill,
5
- BsBookmarkCheckFill,
6
- BsBookmarkStar,
7
- BsBookmarkXFill
8
- } from 'react-icons/bs';
9
3
  import { useQuery, useMutation } from '@apollo/client';
4
+ import { AddedBookmark, BaseBookmark, HoverBookmark, RemoveBookmark } from '../icons';
10
5
  import { getItemList, addItemsToList, removeItemsFromList } from '../../../application/query';
11
6
  import { getItemListData, setItemListId } from '../helpers';
12
7
  import { useItemListId } from '../hooks';
@@ -16,11 +11,6 @@ const ItemListButton = ({ listName, parent, modifier }) => {
16
11
  const [isHover, setIsHover] = useState(false);
17
12
  const { listId } = useItemListId({ listName });
18
13
 
19
- const getIcon = () => {
20
- if (isInList) return isHover ? BsBookmarkXFill : BsBookmarkCheckFill;
21
- return isHover ? BsBookmarkStarFill : BsBookmarkStar;
22
- };
23
-
24
14
  const { data, error, loading } = useQuery(getItemList, {
25
15
  variables: { id: listId },
26
16
  skip: !listId
@@ -61,6 +51,14 @@ const ItemListButton = ({ listName, parent, modifier }) => {
61
51
  ({ itemId: idToCheck, itemEntity: entityToCheck }) =>
62
52
  idToCheck === itemId && entityToCheck === itemEntity
63
53
  );
54
+
55
+ const getIcon = () => {
56
+ if (isInList) {
57
+ return isHover ? RemoveBookmark : AddedBookmark;
58
+ }
59
+ return isHover ? HoverBookmark : BaseBookmark;
60
+ };
61
+
64
62
  const Icon = getIcon();
65
63
  const stateClassName = isInList ? 'item-list-button--selected' : '';
66
64
  const className = ['item-list-button', stateClassName, modifier].filter(Boolean).join(' ');
@@ -69,10 +67,10 @@ const ItemListButton = ({ listName, parent, modifier }) => {
69
67
  <div
70
68
  className={className}
71
69
  role="button"
70
+ tabIndex="0"
72
71
  onClick={clickHandler}
73
72
  onMouseEnter={() => setIsHover(true)}
74
- onMouseLeave={() => setIsHover(false)}
75
- aria-label={`Add to ${listName}`}>
73
+ onMouseLeave={() => setIsHover(false)}>
76
74
  <i>
77
75
  <Icon />
78
76
  </i>
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { useRouter } from 'next/router';
4
4
  import { useQuery } from '@apollo/client';
5
- import { BsBookmarkStarFill, BsBookmarkStar } from 'react-icons/bs';
5
+ import { HoverBookmark, BaseBookmark } from '../icons';
6
6
  import { getItemList } from '../../../application/query';
7
7
  import { useItemListId } from '../hooks';
8
8
  import { getItemListData } from '../helpers';
@@ -21,7 +21,7 @@ const ItemListCounter = ({ listName, modifier, url }) => {
21
21
 
22
22
  const listItems = getItemListData(data);
23
23
  const listLength = listItems.length;
24
- const CounterIcon = listLength ? BsBookmarkStarFill : BsBookmarkStar;
24
+ const CounterIcon = listLength ? HoverBookmark : BaseBookmark;
25
25
 
26
26
  const handleClick = () => router.push('/Resolver', `${url}?itemListId=${listId}`);
27
27
 
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+
3
+ function AddedBookmark() {
4
+ return (
5
+ <svg
6
+ width="1em"
7
+ height="1em"
8
+ viewBox="0 0 24 29"
9
+ version="1.1"
10
+ xmlns="http://www.w3.org/2000/svg">
11
+ <title>wishlist-button/added</title>
12
+ <g id="Wishlist" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
13
+ <g id="components" transform="translate(-417, -433)">
14
+ <g id="wishlist-button/added" transform="translate(417, 433.0588)">
15
+ <path
16
+ d="M1.33333333,5.68434189e-14 L22.6666667,5.68434189e-14 C23.4030667,5.68434189e-14 24,0.59696 24,1.33333333 L24,27.0350667 C24,27.4033333 23.7014667,27.7019336 23.3333333,27.7019336 C23.2397333,27.7019336 23.1472,27.682 23.0617333,27.6438667 L12,22.7084 L0.938306667,27.6438667 C0.602066667,27.794 0.20788,27.6429333 0.0578533333,27.3068 C0.0197066667,27.2212 0,27.1286667 0,27.0350667 L0,1.33333333 C0,0.59696 0.59696,5.68434189e-14 1.33333333,5.68434189e-14 Z"
17
+ id="Shape"
18
+ fill="currentColor"
19
+ fillRule="nonzero"
20
+ />
21
+ <path
22
+ d="M18.6268424,8.17492183 C19.1243859,7.67737836 19.1243859,6.87070105 18.6268424,6.3731576 C18.129299,5.87561415 17.3226216,5.87561413 16.8250782,6.37315756 L10.0913659,13.1094147 L7.1749509,10.1904547 C6.85309671,9.86860055 6.38398401,9.74290217 5.94432301,9.86070898 C5.50466201,9.97851579 5.16124768,10.3219301 5.04344087,10.7615911 C4.92563406,11.2012521 5.05133243,11.6703648 5.37318663,11.992219 L9.19048381,15.8095162 C9.42920298,16.0488396 9.75333852,16.183341 10.0913659,16.183341 C10.4293934,16.183341 10.7535289,16.0488396 10.9922481,15.8095162 L18.6268424,8.17492183 Z"
23
+ id="Path"
24
+ fill="#FFFFFF"
25
+ />
26
+ </g>
27
+ </g>
28
+ </g>
29
+ </svg>
30
+ );
31
+ }
32
+
33
+ export default AddedBookmark;
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+
3
+ function BaseBookmark() {
4
+ return (
5
+ <svg
6
+ width="1em"
7
+ height="1em"
8
+ viewBox="0 0 26 30"
9
+ version="1.1"
10
+ xmlns="http://www.w3.org/2000/svg">
11
+ <title>wishlist-button/base</title>
12
+ <g id="Wishlist" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
13
+ <g id="components" transform="translate(-416, -236)" fillRule="nonzero">
14
+ <g id="wishlist-button/base" transform="translate(417, 237)">
15
+ <g id="Group" fill="#FFFFFF" stroke="currentColor" strokeWidth="2">
16
+ <path
17
+ d="M1.33333333,0 L22.6666667,0 C23.4030667,0 24,0.59696 24,1.33333333 L24,27.0350667 C24,27.4033333 23.7014667,27.7019336 23.3333333,27.7019336 C23.2397333,27.7019336 23.1472,27.682 23.0617333,27.6438667 L12,22.7084 L0.938306667,27.6438667 C0.602066667,27.794 0.20788,27.6429333 0.0578533333,27.3068 C0.0197066667,27.2212 0,27.1286667 0,27.0350667 L0,1.33333333 C0,0.59696 0.59696,0 1.33333333,0 Z"
18
+ id="Shape"
19
+ />
20
+ </g>
21
+ <path
22
+ d="M18.5475051,9.70770608 L14.3505774,9.09775478 L12.4744399,5.29423737 C12.4231974,5.19009934 12.3388952,5.10579713 12.2347571,5.05455461 C11.9735856,4.92562182 11.6562126,5.03306581 11.5256268,5.29423737 L9.64948934,9.09775478 L5.4525616,9.70770608 C5.33685268,9.72423592 5.23106167,9.77878441 5.15006543,9.86143364 C4.94616811,10.0710041 4.95060698,10.406139 5.15998334,10.6102356 L8.19651593,13.5707309 L7.47912064,17.7511288 C7.44480011,17.9495157 7.52626118,18.150158 7.68916287,18.2684724 C7.85206456,18.3867868 8.06806465,18.4021884 8.24610546,18.3081846 L12.0000333,16.3345211 L15.7539612,18.3081846 C15.8564463,18.3627331 15.9754612,18.3809159 16.0895171,18.3610801 C16.3771364,18.3114906 16.5705356,18.0387481 16.5209461,17.7511288 L15.8035508,13.5707309 L18.8400834,10.6102356 C18.9227326,10.5292394 18.9772811,10.4234484 18.9938109,10.3077395 C19.0384415,10.0184672 18.8367774,9.75068367 18.5475051,9.70770608 Z"
23
+ id="Path"
24
+ fill="currentColor"
25
+ />
26
+ </g>
27
+ </g>
28
+ </g>
29
+ </svg>
30
+ );
31
+ }
32
+
33
+ export default BaseBookmark;
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+
3
+ function HoverBookmark() {
4
+ return (
5
+ <svg
6
+ width="1em"
7
+ height="1em"
8
+ viewBox="0 0 24 29"
9
+ version="1.1"
10
+ xmlns="http://www.w3.org/2000/svg">
11
+ <title>wishlist-button/hover</title>
12
+ <g id="Wishlist" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
13
+ <g id="components" transform="translate(-566, -237)" fillRule="nonzero">
14
+ <g id="wishlist-button/hover" transform="translate(566, 237.3529)">
15
+ <g id="Group" fill="currentColor">
16
+ <path
17
+ d="M1.33333333,0 L22.6666667,0 C23.4030667,0 24,0.59696 24,1.33333333 L24,27.0350667 C24,27.4033333 23.7014667,27.7019336 23.3333333,27.7019336 C23.2397333,27.7019336 23.1472,27.682 23.0617333,27.6438667 L12,22.7084 L0.938306667,27.6438667 C0.602066667,27.794 0.20788,27.6429333 0.0578533333,27.3068 C0.0197066667,27.2212 0,27.1286667 0,27.0350667 L0,1.33333333 C0,0.59696 0.59696,0 1.33333333,0 Z"
18
+ id="Shape"
19
+ />
20
+ </g>
21
+ <path
22
+ d="M18.5475051,9.70770608 L14.3505774,9.09775478 L12.4744399,5.29423737 C12.4231974,5.19009934 12.3388952,5.10579713 12.2347571,5.05455461 C11.9735856,4.92562182 11.6562126,5.03306581 11.5256268,5.29423737 L9.64948934,9.09775478 L5.4525616,9.70770608 C5.33685268,9.72423592 5.23106167,9.77878441 5.15006543,9.86143364 C4.94616811,10.0710041 4.95060698,10.406139 5.15998334,10.6102356 L8.19651593,13.5707309 L7.47912064,17.7511288 C7.44480011,17.9495157 7.52626118,18.150158 7.68916287,18.2684724 C7.85206456,18.3867868 8.06806465,18.4021884 8.24610546,18.3081846 L12.0000333,16.3345211 L15.7539612,18.3081846 C15.8564463,18.3627331 15.9754612,18.3809159 16.0895171,18.3610801 C16.3771364,18.3114906 16.5705356,18.0387481 16.5209461,17.7511288 L15.8035508,13.5707309 L18.8400834,10.6102356 C18.9227326,10.5292394 18.9772811,10.4234484 18.9938109,10.3077395 C19.0384415,10.0184672 18.8367774,9.75068367 18.5475051,9.70770608 Z"
23
+ id="Path"
24
+ fill="#FFFFFF"
25
+ />
26
+ </g>
27
+ </g>
28
+ </g>
29
+ </svg>
30
+ );
31
+ }
32
+
33
+ export default HoverBookmark;
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+
3
+ function RemoveBookmark() {
4
+ return (
5
+ <svg
6
+ width="1em"
7
+ height="1em"
8
+ viewBox="0 0 24 29"
9
+ version="1.1"
10
+ xmlns="http://www.w3.org/2000/svg">
11
+ <title>wishlist-button/remove</title>
12
+ <g id="Wishlist" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
13
+ <g id="components" transform="translate(-566, -433)">
14
+ <g id="Group" transform="translate(566, 433.4118)">
15
+ <path
16
+ d="M1.33333333,0 L22.6666667,0 C23.4030667,0 24,0.59696 24,1.33333333 L24,27.0350667 C24,27.4033333 23.7014667,27.7019336 23.3333333,27.7019336 C23.2397333,27.7019336 23.1472,27.682 23.0617333,27.6438667 L12,22.7084 L0.938306667,27.6438667 C0.602066667,27.794 0.20788,27.6429333 0.0578533333,27.3068 C0.0197066667,27.2212 0,27.1286667 0,27.0350667 L0,1.33333333 C0,0.59696 0.59696,0 1.33333333,0 Z"
17
+ id="Shape"
18
+ fill="currentColor"
19
+ fillRule="nonzero"
20
+ />
21
+ <path
22
+ d="M8.56311228,6.43978889 C8.18381709,6.06049368 7.6309823,5.91236204 7.11285543,6.05119372 C6.59472855,6.19002539 6.19002539,6.59472855 6.05119372,7.11285543 C5.91236204,7.6309823 6.06049368,8.18381709 6.43978889,8.56311228 L9.87969275,12.0000171 L6.43978889,15.4369219 C6.06049368,15.8162171 5.91236204,16.3690519 6.05119372,16.8871788 C6.19002539,17.4053057 6.59472855,17.8100088 7.11285543,17.9488405 C7.6309823,18.0876722 8.18381709,17.9395405 8.56311228,17.5602453 L12.0000171,14.1203415 L15.4369219,17.5602453 C16.0232615,18.1465849 16.9739058,18.1465849 17.5602453,17.5602453 C18.1465849,16.9739058 18.1465849,16.0232615 17.5602453,15.4369219 L14.1203415,12.0000171 L17.5602453,8.56311228 C18.1465849,7.97677272 18.1465849,7.02612845 17.5602453,6.43978889 C16.9739058,5.85344932 16.0232615,5.85344932 15.4369219,6.43978889 L12.0000171,9.87969275 L8.56311228,6.43978889 Z"
23
+ id="Path"
24
+ fill="#FFFFFF"
25
+ />
26
+ </g>
27
+ </g>
28
+ </g>
29
+ </svg>
30
+ );
31
+ }
32
+
33
+ export default RemoveBookmark;
@@ -0,0 +1,4 @@
1
+ export { default as AddedBookmark } from './AddedBookmark';
2
+ export { default as BaseBookmark } from './BaseBookmark';
3
+ export { default as HoverBookmark } from './HoverBookmark';
4
+ export { default as RemoveBookmark } from './RemoveBookmark';
@@ -31,6 +31,8 @@ import { getItemListId, getItemListIds } from '../ItemList/helpers';
31
31
  import { useGetEntitySchemasAsObj } from '../../hooks';
32
32
  import { AND_OPERATOR, TEXT_SEARCH, ID, AND, FULL } from '../../constants';
33
33
 
34
+ export const VariantContext = React.createContext(null);
35
+
34
36
  const ListFactory = props => {
35
37
  const {
36
38
  entity: legacyEntity,
@@ -46,7 +48,8 @@ const ListFactory = props => {
46
48
  allSearchFilters,
47
49
  operator: filterOperator,
48
50
  sortProperties,
49
- itemListName
51
+ itemListName,
52
+ VariantComponent // extracted from props
50
53
  } = props;
51
54
  const { isPreview } = useContext(MainContext);
52
55
  const router = useRouter();
@@ -175,7 +178,11 @@ const ListFactory = props => {
175
178
  mainSchemas
176
179
  };
177
180
 
178
- return <ListBuilder {...listProps} />;
181
+ return (
182
+ <VariantContext.Provider value={VariantComponent}>
183
+ <ListBuilder {...listProps} />
184
+ </VariantContext.Provider>
185
+ );
179
186
  };
180
187
 
181
188
  ListFactory.propTypes = {
@@ -192,7 +199,8 @@ ListFactory.propTypes = {
192
199
  sort: PropTypes.string,
193
200
  allSearchFilters: PropTypes.array,
194
201
  sortProperties: PropTypes.array,
195
- itemListName: PropTypes.string
202
+ itemListName: PropTypes.string,
203
+ VariantComponent: PropTypes.func
196
204
  };
197
205
 
198
206
  ListFactory.defaultProps = {
@@ -207,7 +215,8 @@ ListFactory.defaultProps = {
207
215
  sort: '',
208
216
  operator: AND,
209
217
  allSearchFilters: [],
210
- itemListName: ''
218
+ itemListName: '',
219
+ VariantComponent: null
211
220
  };
212
221
 
213
222
  export default ListFactory;
@@ -2,35 +2,56 @@ import React, { useContext } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { Waypoint } from 'react-waypoint';
4
4
  import { MainContext } from '@blaze-cms/nextjs-components';
5
+ import { VariantContext } from '../../ListFactory';
5
6
  import BuildPBComponents from '../../../../hooks/helpers/buildPBComponents';
6
7
  import Banner from '../../../Banner';
7
8
  import { parsePropsToDisplay, shouldRenderWaypoint } from '../../../../helpers';
8
9
 
9
- const FullRenderItem = ({
10
- isInfinite,
11
- pageBuilderComponents,
12
- entityProps,
13
- propsToDisplay,
14
- entity,
15
- index,
16
- itemId,
17
- listTotal,
18
- initialOffset,
19
- currentListLength,
20
- triggerInfiniteScroll,
21
- parent,
22
- pageBuilderID,
23
- displayCount,
24
- shouldRenderBanner,
25
- bannerProps,
26
- bannerIndex
27
- }) => {
10
+ const FullRenderItem = props => {
11
+ const {
12
+ isInfinite,
13
+ pageBuilderComponents,
14
+ entityProps,
15
+ propsToDisplay,
16
+ entity,
17
+ index,
18
+ itemId,
19
+ listTotal,
20
+ initialOffset,
21
+ currentListLength,
22
+ triggerInfiniteScroll,
23
+ parent,
24
+ pageBuilderID,
25
+ displayCount,
26
+ shouldRenderBanner,
27
+ bannerProps,
28
+ bannerIndex
29
+ } = props;
28
30
  const { hasGTM } = useContext(MainContext);
31
+ const VariantComponent = useContext(VariantContext);
32
+
29
33
  if (!pageBuilderComponents) return null;
30
34
  const parsedPropsToDisplay = parsePropsToDisplay(entityProps, propsToDisplay);
31
35
  const currentItemIndex = initialOffset + index;
32
36
  const renderWaypoint =
33
37
  isInfinite && shouldRenderWaypoint(index, currentListLength, currentItemIndex, listTotal);
38
+
39
+ const defaultContent = (
40
+ <>
41
+ <div className="list__item list__item--full">
42
+ {BuildPBComponents(pageBuilderComponents, {
43
+ parent: { ...parent, itemId, itemEntity: entity },
44
+ hasGTM,
45
+ pageBuilderID
46
+ })}
47
+ </div>
48
+ {!VariantComponent &&
49
+ !!parsedPropsToDisplay.length && (
50
+ <>{parsedPropsToDisplay.map(prop => (prop ? <span key={prop}>{prop}</span> : null))}</>
51
+ )}
52
+ </>
53
+ );
54
+
34
55
  return (
35
56
  <>
36
57
  {renderWaypoint && <Waypoint onEnter={triggerInfiniteScroll} />}
@@ -40,16 +61,12 @@ const FullRenderItem = ({
40
61
  <span className="section-total">/{listTotal}</span>
41
62
  </div>
42
63
  )}
43
- <div className="list__item list__item--full">
44
- {BuildPBComponents(pageBuilderComponents, {
45
- parent: { ...parent, itemId, itemEntity: entity },
46
- hasGTM,
47
- pageBuilderID
48
- })}
49
- </div>
50
- {!!parsedPropsToDisplay.length && (
51
- <>{parsedPropsToDisplay.map(prop => (prop ? <span key={prop}>{prop}</span> : null))}</>
64
+ {VariantComponent ? (
65
+ <VariantComponent {...props}>{defaultContent}</VariantComponent>
66
+ ) : (
67
+ defaultContent
52
68
  )}
69
+
53
70
  {shouldRenderBanner && <Banner {...bannerProps} renderCounter={bannerIndex} />}
54
71
  </>
55
72
  );
@@ -79,7 +79,7 @@ const getTypeBaseProps = (entitySchema, cardOptions, extraPropsHaveCategory) =>
79
79
 
80
80
  const { interfaces, properties, dynamicProperties, relations } = entitySchema;
81
81
 
82
- const isContent = !!interfaces.includes('content/content');
82
+ const isContent = !!interfaces.includes('content/content-base');
83
83
  const hasCategory = checkProps(properties) || checkProps(dynamicProperties);
84
84
  const hasPreheader = properties[PREHEADER_PROP];
85
85
 
@@ -97,7 +97,8 @@ const getTypeBaseProps = (entitySchema, cardOptions, extraPropsHaveCategory) =>
97
97
  return { typeBasedProps, shouldAddCategoryProps };
98
98
  };
99
99
 
100
- const getContentProps = isContent => (isContent ? ['url', 'sponsored', 'featured'] : []);
100
+ // make sure all props are supported by content/content-base interface
101
+ const getContentProps = isContent => (isContent ? ['url', 'sponsored', 'featured', 'live'] : []);
101
102
 
102
103
  const getCategoyProps = (shouldAddCategoryProps, hasCategory, hasPreheader) => {
103
104
  if (!shouldAddCategoryProps) return [];
package/src/index.js CHANGED
@@ -13,7 +13,8 @@ export {
13
13
  generateMultiItemQuery,
14
14
  getEntitySchema,
15
15
  getSingleEntitySchema,
16
- getUser
16
+ getUser,
17
+ getCurrentUser
17
18
  } from './application/query';
18
19
  export {
19
20
  getInheritedFilters,