@blaze-cms/react-page-builder 0.146.0-node18-core-styles.0 → 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.
- package/CHANGELOG.md +28 -0
- package/lib/application/query/index.js +18 -15
- package/lib/application/query/index.js.map +1 -1
- package/lib/components/Card/Card.js +3 -1
- package/lib/components/Card/Card.js.map +1 -1
- package/lib/components/ContentGroup/ContentGroupTabs.js +0 -1
- package/lib/components/ContentGroup/ContentGroupTabs.js.map +1 -1
- package/lib/components/ItemList/ItemListButton/ItemListButton.js +9 -7
- package/lib/components/ItemList/ItemListButton/ItemListButton.js.map +1 -1
- package/lib/components/ItemList/ItemListCounter/ItemListCounter.js +2 -2
- package/lib/components/ItemList/ItemListCounter/ItemListCounter.js.map +1 -1
- package/lib/components/ItemList/icons/AddedBookmark.js +41 -0
- package/lib/components/ItemList/icons/AddedBookmark.js.map +1 -0
- package/lib/components/ItemList/icons/BaseBookmark.js +45 -0
- package/lib/components/ItemList/icons/BaseBookmark.js.map +1 -0
- package/lib/components/ItemList/icons/HoverBookmark.js +43 -0
- package/lib/components/ItemList/icons/HoverBookmark.js.map +1 -0
- package/lib/components/ItemList/icons/RemoveBookmark.js +41 -0
- package/lib/components/ItemList/icons/RemoveBookmark.js.map +1 -0
- package/lib/components/ItemList/icons/index.js +36 -0
- package/lib/components/ItemList/icons/index.js.map +1 -0
- package/lib/components/List/ListBuilder.js +1 -1
- package/lib/components/List/ListBuilder.js.map +1 -1
- package/lib/components/List/ListFactory.js +11 -5
- package/lib/components/List/ListFactory.js.map +1 -1
- package/lib/components/List/components/Full/FullRenderItem.js +32 -29
- package/lib/components/List/components/Full/FullRenderItem.js.map +1 -1
- package/lib/helpers/build-props-query.js +4 -2
- package/lib/helpers/build-props-query.js.map +1 -1
- package/lib/index.js +6 -0
- package/lib/index.js.map +1 -1
- package/lib/variants/LiveBlogList/LiveBlogList.js +116 -0
- package/lib/variants/LiveBlogList/LiveBlogList.js.map +1 -0
- package/lib/variants/LiveBlogList/index.js +43 -0
- package/lib/variants/LiveBlogList/index.js.map +1 -0
- package/lib/variants/index.js +3 -1
- package/lib/variants/index.js.map +1 -1
- package/lib-es/application/query/index.js +9 -1
- package/lib-es/application/query/index.js.map +1 -1
- package/lib-es/components/Card/Card.js +3 -1
- package/lib-es/components/Card/Card.js.map +1 -1
- package/lib-es/components/ContentGroup/ContentGroupTabs.js +0 -1
- package/lib-es/components/ContentGroup/ContentGroupTabs.js.map +1 -1
- package/lib-es/components/ItemList/ItemListButton/ItemListButton.js +9 -7
- package/lib-es/components/ItemList/ItemListButton/ItemListButton.js.map +1 -1
- package/lib-es/components/ItemList/ItemListCounter/ItemListCounter.js +2 -2
- package/lib-es/components/ItemList/ItemListCounter/ItemListCounter.js.map +1 -1
- package/lib-es/components/ItemList/icons/AddedBookmark.js +33 -0
- package/lib-es/components/ItemList/icons/AddedBookmark.js.map +1 -0
- package/lib-es/components/ItemList/icons/BaseBookmark.js +37 -0
- package/lib-es/components/ItemList/icons/BaseBookmark.js.map +1 -0
- package/lib-es/components/ItemList/icons/HoverBookmark.js +35 -0
- package/lib-es/components/ItemList/icons/HoverBookmark.js.map +1 -0
- package/lib-es/components/ItemList/icons/RemoveBookmark.js +33 -0
- package/lib-es/components/ItemList/icons/RemoveBookmark.js.map +1 -0
- package/lib-es/components/ItemList/icons/index.js +5 -0
- package/lib-es/components/ItemList/icons/index.js.map +1 -0
- package/lib-es/components/List/ListBuilder.js +1 -1
- package/lib-es/components/List/ListBuilder.js.map +1 -1
- package/lib-es/components/List/ListFactory.js +10 -4
- package/lib-es/components/List/ListFactory.js.map +1 -1
- package/lib-es/components/List/components/Full/FullRenderItem.js +34 -30
- package/lib-es/components/List/components/Full/FullRenderItem.js.map +1 -1
- package/lib-es/helpers/build-props-query.js +4 -2
- package/lib-es/helpers/build-props-query.js.map +1 -1
- package/lib-es/index.js +1 -1
- package/lib-es/index.js.map +1 -1
- package/lib-es/variants/LiveBlogList/LiveBlogList.js +90 -0
- package/lib-es/variants/LiveBlogList/LiveBlogList.js.map +1 -0
- package/lib-es/variants/LiveBlogList/index.js +12 -0
- package/lib-es/variants/LiveBlogList/index.js.map +1 -0
- package/lib-es/variants/index.js +3 -1
- package/lib-es/variants/index.js.map +1 -1
- package/package.json +6 -6
- package/src/application/query/index.js +11 -1
- package/src/components/Card/Card.js +2 -1
- package/src/components/ContentGroup/ContentGroupTabs.js +0 -1
- package/src/components/ItemList/ItemListButton/ItemListButton.js +11 -13
- package/src/components/ItemList/ItemListCounter/ItemListCounter.js +2 -2
- package/src/components/ItemList/icons/AddedBookmark.js +33 -0
- package/src/components/ItemList/icons/BaseBookmark.js +33 -0
- package/src/components/ItemList/icons/HoverBookmark.js +33 -0
- package/src/components/ItemList/icons/RemoveBookmark.js +33 -0
- package/src/components/ItemList/icons/index.js +4 -0
- package/src/components/List/ListBuilder.js +1 -1
- package/src/components/List/ListFactory.js +13 -4
- package/src/components/List/components/Full/FullRenderItem.js +45 -28
- package/src/helpers/build-props-query.js +3 -2
- package/src/index.js +2 -1
- package/src/variants/LiveBlogList/LiveBlogList.js +109 -0
- package/src/variants/LiveBlogList/index.js +13 -0
- package/src/variants/index.js +3 -1
- package/tests/unit/src/components/ItemList/__snapshots__/ItemListButton.test.js.snap +143 -35
- package/tests/unit/src/components/ItemList/__snapshots__/ItemListCounter.test.js.snap +37 -7
- package/tests/unit/src/helpers/build-props-query.test.js +13 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemListButton.js","names":["React","useState","PropTypes","
|
|
1
|
+
{"version":3,"file":"ItemListButton.js","names":["React","useState","PropTypes","useQuery","useMutation","AddedBookmark","BaseBookmark","HoverBookmark","RemoveBookmark","getItemList","addItemsToList","removeItemsFromList","getItemListData","setItemListId","useItemListId","ItemListButton","listName","parent","modifier","itemId","itemEntity","isHover","setIsHover","listId","data","error","loading","variables","id","skip","addListItem","onCompleted","listAddResult","result","removeListItem","clickHandler","isInList","listItems","name","message","find","idToCheck","entityToCheck","getIcon","Icon","stateClassName","className","filter","Boolean","join","createElement","role","tabIndex","onClick","onMouseEnter","onMouseLeave","propTypes","object","string","defaultProps"],"sources":["../../../../src/components/ItemList/ItemListButton/ItemListButton.js"],"sourcesContent":["import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { useQuery, useMutation } from '@apollo/client';\nimport { AddedBookmark, BaseBookmark, HoverBookmark, RemoveBookmark } from '../icons';\nimport { getItemList, addItemsToList, removeItemsFromList } from '../../../application/query';\nimport { getItemListData, setItemListId } from '../helpers';\nimport { useItemListId } from '../hooks';\n\nconst ItemListButton = ({ listName, parent, modifier }) => {\n const { itemId, itemEntity } = parent;\n const [isHover, setIsHover] = useState(false);\n const { listId } = useItemListId({ listName });\n\n const { data, error, loading } = useQuery(getItemList, {\n variables: { id: listId },\n skip: !listId\n });\n\n const [addListItem] = useMutation(addItemsToList, {\n onCompleted: ({ addItemsToList: listAddResult }) => {\n const {\n result: { id }\n } = listAddResult;\n\n if (!listId) {\n setItemListId(listName, id);\n }\n }\n });\n\n const [removeListItem] = useMutation(removeItemsFromList);\n\n const clickHandler = () => {\n setIsHover(false);\n isInList\n ? removeListItem({\n variables: { listId, listItems: [{ itemId, itemEntity }] },\n skip: !listId\n })\n : addListItem({\n variables: { name: listName, id: listId, listItems: [{ itemId, itemEntity }] },\n skip: !listId\n });\n };\n\n if (loading) return '';\n if (error) return error.message;\n\n const listItems = getItemListData(data);\n const isInList = !!listItems.find(\n ({ itemId: idToCheck, itemEntity: entityToCheck }) =>\n idToCheck === itemId && entityToCheck === itemEntity\n );\n\n const getIcon = () => {\n if (isInList) {\n return isHover ? RemoveBookmark : AddedBookmark;\n }\n return isHover ? HoverBookmark : BaseBookmark;\n };\n\n const Icon = getIcon();\n const stateClassName = isInList ? 'item-list-button--selected' : '';\n const className = ['item-list-button', stateClassName, modifier].filter(Boolean).join(' ');\n\n return (\n <div\n className={className}\n role=\"button\"\n tabIndex=\"0\"\n onClick={clickHandler}\n onMouseEnter={() => setIsHover(true)}\n onMouseLeave={() => setIsHover(false)}>\n <i>\n <Icon />\n </i>\n </div>\n );\n};\n\nItemListButton.propTypes = {\n parent: PropTypes.object,\n listName: PropTypes.string,\n modifier: PropTypes.string\n};\n\nItemListButton.defaultProps = {\n parent: {},\n listName: '',\n modifier: ''\n};\n\nexport default ItemListButton;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,QAAQ,EAAEC,WAAW,QAAQ,gBAAgB;AACtD,SAASC,aAAa,EAAEC,YAAY,EAAEC,aAAa,EAAEC,cAAc,QAAQ,UAAU;AACrF,SAASC,WAAW,EAAEC,cAAc,EAAEC,mBAAmB,QAAQ,4BAA4B;AAC7F,SAASC,eAAe,EAAEC,aAAa,QAAQ,YAAY;AAC3D,SAASC,aAAa,QAAQ,UAAU;AAExC,MAAMC,cAAc,GAAGA,CAAC;EAAEC,QAAQ;EAAEC,MAAM;EAAEC;AAAS,CAAC,KAAK;EACzD,MAAM;IAAEC,MAAM;IAAEC;EAAW,CAAC,GAAGH,MAAM;EACrC,MAAM,CAACI,OAAO,EAAEC,UAAU,CAAC,GAAGrB,QAAQ,CAAC,KAAK,CAAC;EAC7C,MAAM;IAAEsB;EAAO,CAAC,GAAGT,aAAa,CAAC;IAAEE;EAAS,CAAC,CAAC;EAE9C,MAAM;IAAEQ,IAAI;IAAEC,KAAK;IAAEC;EAAQ,CAAC,GAAGvB,QAAQ,CAACM,WAAW,EAAE;IACrDkB,SAAS,EAAE;MAAEC,EAAE,EAAEL;IAAO,CAAC;IACzBM,IAAI,EAAE,CAACN;EACT,CAAC,CAAC;EAEF,MAAM,CAACO,WAAW,CAAC,GAAG1B,WAAW,CAACM,cAAc,EAAE;IAChDqB,WAAW,EAAEA,CAAC;MAAErB,cAAc,EAAEsB;IAAc,CAAC,KAAK;MAClD,MAAM;QACJ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AC,CAAC;EACtB,MAAME,cAAc,GAAGT,QAAQ,GAAG,4BAA4B,GAAG,EAAE;EACnE,MAAMU,SAAS,GAAG,CAAC,kBAAkB,EAAED,cAAc,EAAE3B,QAAQ,CAAC,CAAC6B,MAAM,CAACC,OAAO,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;EAE1F,oBACEjD,KAAA,CAAAkD,aAAA;IACEJ,SAAS,EAAEA,SAAU;IACrBK,IAAI,EAAC,QAAQ;IACbC,QAAQ,EAAC,GAAG;IACZC,OAAO,EAAElB,YAAa;IACtBmB,YAAY,EAAEA,CAAA,KAAMhC,UAAU,CAAC,IAAI,CAAE;IACrCiC,YAAY,EAAEA,CAAA,KAAMjC,UAAU,CAAC,KAAK;EAAE,gBACtCtB,KAAA,CAAAkD,aAAA,yBACElD,KAAA,CAAAkD,aAAA,CAACN,IAAI,MAAE,CACN,CACA,CAAC;AAEV,CAAC;AAED7B,cAAc,CAACyC,SAAS,GAAG;EACzBvC,MAAM,EAAEf,SAAS,CAACuD,MAAM;EACxBzC,QAAQ,EAAEd,SAAS,CAACwD,MAAM;EAC1BxC,QAAQ,EAAEhB,SAAS,CAACwD;AACtB,CAAC;AAED3C,cAAc,CAAC4C,YAAY,GAAG;EAC5B1C,MAAM,EAAE,CAAC,CAAC;EACVD,QAAQ,EAAE,EAAE;EACZE,QAAQ,EAAE;AACZ,CAAC;AAED,eAAeH,cAAc","ignoreList":[]}
|
|
@@ -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 {
|
|
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';
|
|
@@ -31,7 +31,7 @@ const ItemListCounter = ({
|
|
|
31
31
|
if (error) return error.message;
|
|
32
32
|
const listItems = getItemListData(data);
|
|
33
33
|
const listLength = listItems.length;
|
|
34
|
-
const CounterIcon = listLength ?
|
|
34
|
+
const CounterIcon = listLength ? HoverBookmark : BaseBookmark;
|
|
35
35
|
const handleClick = () => router.push('/Resolver', `${url}?itemListId=${listId}`);
|
|
36
36
|
return /*#__PURE__*/React.createElement("div", {
|
|
37
37
|
role: "button",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemListCounter.js","names":["React","PropTypes","useRouter","useQuery","
|
|
1
|
+
{"version":3,"file":"ItemListCounter.js","names":["React","PropTypes","useRouter","useQuery","HoverBookmark","BaseBookmark","getItemList","useItemListId","getItemListData","ItemListCounter","listName","modifier","url","router","listId","data","error","loading","variables","id","skip","message","listItems","listLength","length","CounterIcon","handleClick","push","createElement","role","type","className","onClick","propTypes","string","defaultProps"],"sources":["../../../../src/components/ItemList/ItemListCounter/ItemListCounter.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { useRouter } from 'next/router';\nimport { useQuery } from '@apollo/client';\nimport { HoverBookmark, BaseBookmark } from '../icons';\nimport { getItemList } from '../../../application/query';\nimport { useItemListId } from '../hooks';\nimport { getItemListData } from '../helpers';\n\nconst ItemListCounter = ({ listName, modifier, url }) => {\n const router = useRouter();\n const { listId } = useItemListId({ listName });\n\n const { data, error, loading } = useQuery(getItemList, {\n variables: { id: listId },\n skip: !listId\n });\n\n if (loading) return '';\n if (error) return error.message;\n\n const listItems = getItemListData(data);\n const listLength = listItems.length;\n const CounterIcon = listLength ? HoverBookmark : BaseBookmark;\n\n const handleClick = () => router.push('/Resolver', `${url}?itemListId=${listId}`);\n\n return (\n <div\n role=\"button\"\n type=\"button\"\n className={`item-list-counter ${modifier}`}\n aria-label={`View ${listName}`}\n onClick={handleClick}>\n <CounterIcon />\n <span className=\"item-list-counter__badge\">{listLength}</span>\n </div>\n );\n};\n\nItemListCounter.propTypes = {\n url: PropTypes.string,\n listName: PropTypes.string,\n modifier: PropTypes.string\n};\n\nItemListCounter.defaultProps = {\n url: '',\n listName: '',\n modifier: ''\n};\n\nexport default ItemListCounter;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,aAAa,EAAEC,YAAY,QAAQ,UAAU;AACtD,SAASC,WAAW,QAAQ,4BAA4B;AACxD,SAASC,aAAa,QAAQ,UAAU;AACxC,SAASC,eAAe,QAAQ,YAAY;AAE5C,MAAMC,eAAe,GAAGA,CAAC;EAAEC,QAAQ;EAAEC,QAAQ;EAAEC;AAAI,CAAC,KAAK;EACvD,MAAMC,MAAM,GAAGX,SAAS,CAAC,CAAC;EAC1B,MAAM;IAAEY;EAAO,CAAC,GAAGP,aAAa,CAAC;IAAEG;EAAS,CAAC,CAAC;EAE9C,MAAM;IAAEK,IAAI;IAAEC,KAAK;IAAEC;EAAQ,CAAC,GAAGd,QAAQ,CAACG,WAAW,EAAE;IACrDY,SAAS,EAAE;MAAEC,EAAE,EAAEL;IAAO,CAAC;IACzBM,IAAI,EAAE,CAACN;EACT,CAAC,CAAC;EAEF,IAAIG,OAAO,EAAE,OAAO,EAAE;EACtB,IAAID,KAAK,EAAE,OAAOA,KAAK,CAACK,OAAO;EAE/B,MAAMC,SAAS,GAAGd,eAAe,CAACO,IAAI,CAAC;EACvC,MAAMQ,UAAU,GAAGD,SAAS,CAACE,MAAM;EACnC,MAAMC,WAAW,GAAGF,UAAU,GAAGnB,aAAa,GAAGC,YAAY;EAE7D,MAAMqB,WAAW,GAAGA,CAAA,KAAMb,MAAM,CAACc,IAAI,CAAC,WAAW,EAAE,GAAGf,GAAG,eAAeE,MAAM,EAAE,CAAC;EAEjF,oBACEd,KAAA,CAAA4B,aAAA;IACEC,IAAI,EAAC,QAAQ;IACbC,IAAI,EAAC,QAAQ;IACbC,SAAS,EAAE,qBAAqBpB,QAAQ,EAAG;IAC3C,cAAY,QAAQD,QAAQ,EAAG;IAC/BsB,OAAO,EAAEN;EAAY,gBACrB1B,KAAA,CAAA4B,aAAA,CAACH,WAAW,MAAE,CAAC,eACfzB,KAAA,CAAA4B,aAAA;IAAMG,SAAS,EAAC;EAA0B,GAAER,UAAiB,CAC1D,CAAC;AAEV,CAAC;AAEDd,eAAe,CAACwB,SAAS,GAAG;EAC1BrB,GAAG,EAAEX,SAAS,CAACiC,MAAM;EACrBxB,QAAQ,EAAET,SAAS,CAACiC,MAAM;EAC1BvB,QAAQ,EAAEV,SAAS,CAACiC;AACtB,CAAC;AAEDzB,eAAe,CAAC0B,YAAY,GAAG;EAC7BvB,GAAG,EAAE,EAAE;EACPF,QAAQ,EAAE,EAAE;EACZC,QAAQ,EAAE;AACZ,CAAC;AAED,eAAeF,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
function AddedBookmark() {
|
|
3
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
4
|
+
width: "1em",
|
|
5
|
+
height: "1em",
|
|
6
|
+
viewBox: "0 0 24 29",
|
|
7
|
+
version: "1.1",
|
|
8
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
9
|
+
}, /*#__PURE__*/React.createElement("title", null, "wishlist-button/added"), /*#__PURE__*/React.createElement("g", {
|
|
10
|
+
id: "Wishlist",
|
|
11
|
+
stroke: "none",
|
|
12
|
+
strokeWidth: "1",
|
|
13
|
+
fill: "none",
|
|
14
|
+
fillRule: "evenodd"
|
|
15
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
16
|
+
id: "components",
|
|
17
|
+
transform: "translate(-417, -433)"
|
|
18
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
19
|
+
id: "wishlist-button/added",
|
|
20
|
+
transform: "translate(417, 433.0588)"
|
|
21
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
22
|
+
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",
|
|
23
|
+
id: "Shape",
|
|
24
|
+
fill: "currentColor",
|
|
25
|
+
fillRule: "nonzero"
|
|
26
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
27
|
+
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",
|
|
28
|
+
id: "Path",
|
|
29
|
+
fill: "#FFFFFF"
|
|
30
|
+
})))));
|
|
31
|
+
}
|
|
32
|
+
export default AddedBookmark;
|
|
33
|
+
//# sourceMappingURL=AddedBookmark.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AddedBookmark.js","names":["React","AddedBookmark","createElement","width","height","viewBox","version","xmlns","id","stroke","strokeWidth","fill","fillRule","transform","d"],"sources":["../../../../src/components/ItemList/icons/AddedBookmark.js"],"sourcesContent":["import React from 'react';\n\nfunction AddedBookmark() {\n return (\n <svg\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 29\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <title>wishlist-button/added</title>\n <g id=\"Wishlist\" stroke=\"none\" strokeWidth=\"1\" fill=\"none\" fillRule=\"evenodd\">\n <g id=\"components\" transform=\"translate(-417, -433)\">\n <g id=\"wishlist-button/added\" transform=\"translate(417, 433.0588)\">\n <path\n 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\"\n id=\"Shape\"\n fill=\"currentColor\"\n fillRule=\"nonzero\"\n />\n <path\n 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\"\n id=\"Path\"\n fill=\"#FFFFFF\"\n />\n </g>\n </g>\n </g>\n </svg>\n );\n}\n\nexport default AddedBookmark;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,aAAaA,CAAA,EAAG;EACvB,oBACED,KAAA,CAAAE,aAAA;IACEC,KAAK,EAAC,KAAK;IACXC,MAAM,EAAC,KAAK;IACZC,OAAO,EAAC,WAAW;IACnBC,OAAO,EAAC,KAAK;IACbC,KAAK,EAAC;EAA4B,gBAClCP,KAAA,CAAAE,aAAA,gBAAO,uBAA4B,CAAC,eACpCF,KAAA,CAAAE,aAAA;IAAGM,EAAE,EAAC,UAAU;IAACC,MAAM,EAAC,MAAM;IAACC,WAAW,EAAC,GAAG;IAACC,IAAI,EAAC,MAAM;IAACC,QAAQ,EAAC;EAAS,gBAC3EZ,KAAA,CAAAE,aAAA;IAAGM,EAAE,EAAC,YAAY;IAACK,SAAS,EAAC;EAAuB,gBAClDb,KAAA,CAAAE,aAAA;IAAGM,EAAE,EAAC,uBAAuB;IAACK,SAAS,EAAC;EAA0B,gBAChEb,KAAA,CAAAE,aAAA;IACEY,CAAC,EAAC,6cAA6c;IAC/cN,EAAE,EAAC,OAAO;IACVG,IAAI,EAAC,cAAc;IACnBC,QAAQ,EAAC;EAAS,CACnB,CAAC,eACFZ,KAAA,CAAAE,aAAA;IACEY,CAAC,EAAC,okBAAokB;IACtkBN,EAAE,EAAC,MAAM;IACTG,IAAI,EAAC;EAAS,CACf,CACA,CACF,CACF,CACA,CAAC;AAEV;AAEA,eAAeV,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
function BaseBookmark() {
|
|
3
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
4
|
+
width: "1em",
|
|
5
|
+
height: "1em",
|
|
6
|
+
viewBox: "0 0 26 30",
|
|
7
|
+
version: "1.1",
|
|
8
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
9
|
+
}, /*#__PURE__*/React.createElement("title", null, "wishlist-button/base"), /*#__PURE__*/React.createElement("g", {
|
|
10
|
+
id: "Wishlist",
|
|
11
|
+
stroke: "none",
|
|
12
|
+
strokeWidth: "1",
|
|
13
|
+
fill: "none",
|
|
14
|
+
fillRule: "evenodd"
|
|
15
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
16
|
+
id: "components",
|
|
17
|
+
transform: "translate(-416, -236)",
|
|
18
|
+
fillRule: "nonzero"
|
|
19
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
20
|
+
id: "wishlist-button/base",
|
|
21
|
+
transform: "translate(417, 237)"
|
|
22
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
23
|
+
id: "Group",
|
|
24
|
+
fill: "#FFFFFF",
|
|
25
|
+
stroke: "currentColor",
|
|
26
|
+
strokeWidth: "2"
|
|
27
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
28
|
+
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",
|
|
29
|
+
id: "Shape"
|
|
30
|
+
})), /*#__PURE__*/React.createElement("path", {
|
|
31
|
+
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",
|
|
32
|
+
id: "Path",
|
|
33
|
+
fill: "currentColor"
|
|
34
|
+
})))));
|
|
35
|
+
}
|
|
36
|
+
export default BaseBookmark;
|
|
37
|
+
//# sourceMappingURL=BaseBookmark.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseBookmark.js","names":["React","BaseBookmark","createElement","width","height","viewBox","version","xmlns","id","stroke","strokeWidth","fill","fillRule","transform","d"],"sources":["../../../../src/components/ItemList/icons/BaseBookmark.js"],"sourcesContent":["import React from 'react';\n\nfunction BaseBookmark() {\n return (\n <svg\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 26 30\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <title>wishlist-button/base</title>\n <g id=\"Wishlist\" stroke=\"none\" strokeWidth=\"1\" fill=\"none\" fillRule=\"evenodd\">\n <g id=\"components\" transform=\"translate(-416, -236)\" fillRule=\"nonzero\">\n <g id=\"wishlist-button/base\" transform=\"translate(417, 237)\">\n <g id=\"Group\" fill=\"#FFFFFF\" stroke=\"currentColor\" strokeWidth=\"2\">\n <path\n 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\"\n id=\"Shape\"\n />\n </g>\n <path\n 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\"\n id=\"Path\"\n fill=\"currentColor\"\n />\n </g>\n </g>\n </g>\n </svg>\n );\n}\n\nexport default BaseBookmark;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,YAAYA,CAAA,EAAG;EACtB,oBACED,KAAA,CAAAE,aAAA;IACEC,KAAK,EAAC,KAAK;IACXC,MAAM,EAAC,KAAK;IACZC,OAAO,EAAC,WAAW;IACnBC,OAAO,EAAC,KAAK;IACbC,KAAK,EAAC;EAA4B,gBAClCP,KAAA,CAAAE,aAAA,gBAAO,sBAA2B,CAAC,eACnCF,KAAA,CAAAE,aAAA;IAAGM,EAAE,EAAC,UAAU;IAACC,MAAM,EAAC,MAAM;IAACC,WAAW,EAAC,GAAG;IAACC,IAAI,EAAC,MAAM;IAACC,QAAQ,EAAC;EAAS,gBAC3EZ,KAAA,CAAAE,aAAA;IAAGM,EAAE,EAAC,YAAY;IAACK,SAAS,EAAC,uBAAuB;IAACD,QAAQ,EAAC;EAAS,gBACrEZ,KAAA,CAAAE,aAAA;IAAGM,EAAE,EAAC,sBAAsB;IAACK,SAAS,EAAC;EAAqB,gBAC1Db,KAAA,CAAAE,aAAA;IAAGM,EAAE,EAAC,OAAO;IAACG,IAAI,EAAC,SAAS;IAACF,MAAM,EAAC,cAAc;IAACC,WAAW,EAAC;EAAG,gBAChEV,KAAA,CAAAE,aAAA;IACEY,CAAC,EAAC,4YAA4Y;IAC9YN,EAAE,EAAC;EAAO,CACX,CACA,CAAC,eACJR,KAAA,CAAAE,aAAA;IACEY,CAAC,EAAC,25BAA25B;IAC75BN,EAAE,EAAC,MAAM;IACTG,IAAI,EAAC;EAAc,CACpB,CACA,CACF,CACF,CACA,CAAC;AAEV;AAEA,eAAeV,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
function HoverBookmark() {
|
|
3
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
4
|
+
width: "1em",
|
|
5
|
+
height: "1em",
|
|
6
|
+
viewBox: "0 0 24 29",
|
|
7
|
+
version: "1.1",
|
|
8
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
9
|
+
}, /*#__PURE__*/React.createElement("title", null, "wishlist-button/hover"), /*#__PURE__*/React.createElement("g", {
|
|
10
|
+
id: "Wishlist",
|
|
11
|
+
stroke: "none",
|
|
12
|
+
strokeWidth: "1",
|
|
13
|
+
fill: "none",
|
|
14
|
+
fillRule: "evenodd"
|
|
15
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
16
|
+
id: "components",
|
|
17
|
+
transform: "translate(-566, -237)",
|
|
18
|
+
fillRule: "nonzero"
|
|
19
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
20
|
+
id: "wishlist-button/hover",
|
|
21
|
+
transform: "translate(566, 237.3529)"
|
|
22
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
23
|
+
id: "Group",
|
|
24
|
+
fill: "currentColor"
|
|
25
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
26
|
+
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",
|
|
27
|
+
id: "Shape"
|
|
28
|
+
})), /*#__PURE__*/React.createElement("path", {
|
|
29
|
+
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",
|
|
30
|
+
id: "Path",
|
|
31
|
+
fill: "#FFFFFF"
|
|
32
|
+
})))));
|
|
33
|
+
}
|
|
34
|
+
export default HoverBookmark;
|
|
35
|
+
//# sourceMappingURL=HoverBookmark.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HoverBookmark.js","names":["React","HoverBookmark","createElement","width","height","viewBox","version","xmlns","id","stroke","strokeWidth","fill","fillRule","transform","d"],"sources":["../../../../src/components/ItemList/icons/HoverBookmark.js"],"sourcesContent":["import React from 'react';\n\nfunction HoverBookmark() {\n return (\n <svg\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 29\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <title>wishlist-button/hover</title>\n <g id=\"Wishlist\" stroke=\"none\" strokeWidth=\"1\" fill=\"none\" fillRule=\"evenodd\">\n <g id=\"components\" transform=\"translate(-566, -237)\" fillRule=\"nonzero\">\n <g id=\"wishlist-button/hover\" transform=\"translate(566, 237.3529)\">\n <g id=\"Group\" fill=\"currentColor\">\n <path\n 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\"\n id=\"Shape\"\n />\n </g>\n <path\n 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\"\n id=\"Path\"\n fill=\"#FFFFFF\"\n />\n </g>\n </g>\n </g>\n </svg>\n );\n}\n\nexport default HoverBookmark;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,aAAaA,CAAA,EAAG;EACvB,oBACED,KAAA,CAAAE,aAAA;IACEC,KAAK,EAAC,KAAK;IACXC,MAAM,EAAC,KAAK;IACZC,OAAO,EAAC,WAAW;IACnBC,OAAO,EAAC,KAAK;IACbC,KAAK,EAAC;EAA4B,gBAClCP,KAAA,CAAAE,aAAA,gBAAO,uBAA4B,CAAC,eACpCF,KAAA,CAAAE,aAAA;IAAGM,EAAE,EAAC,UAAU;IAACC,MAAM,EAAC,MAAM;IAACC,WAAW,EAAC,GAAG;IAACC,IAAI,EAAC,MAAM;IAACC,QAAQ,EAAC;EAAS,gBAC3EZ,KAAA,CAAAE,aAAA;IAAGM,EAAE,EAAC,YAAY;IAACK,SAAS,EAAC,uBAAuB;IAACD,QAAQ,EAAC;EAAS,gBACrEZ,KAAA,CAAAE,aAAA;IAAGM,EAAE,EAAC,uBAAuB;IAACK,SAAS,EAAC;EAA0B,gBAChEb,KAAA,CAAAE,aAAA;IAAGM,EAAE,EAAC,OAAO;IAACG,IAAI,EAAC;EAAc,gBAC/BX,KAAA,CAAAE,aAAA;IACEY,CAAC,EAAC,4YAA4Y;IAC9YN,EAAE,EAAC;EAAO,CACX,CACA,CAAC,eACJR,KAAA,CAAAE,aAAA;IACEY,CAAC,EAAC,25BAA25B;IAC75BN,EAAE,EAAC,MAAM;IACTG,IAAI,EAAC;EAAS,CACf,CACA,CACF,CACF,CACA,CAAC;AAEV;AAEA,eAAeV,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
function RemoveBookmark() {
|
|
3
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
4
|
+
width: "1em",
|
|
5
|
+
height: "1em",
|
|
6
|
+
viewBox: "0 0 24 29",
|
|
7
|
+
version: "1.1",
|
|
8
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
9
|
+
}, /*#__PURE__*/React.createElement("title", null, "wishlist-button/remove"), /*#__PURE__*/React.createElement("g", {
|
|
10
|
+
id: "Wishlist",
|
|
11
|
+
stroke: "none",
|
|
12
|
+
strokeWidth: "1",
|
|
13
|
+
fill: "none",
|
|
14
|
+
fillRule: "evenodd"
|
|
15
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
16
|
+
id: "components",
|
|
17
|
+
transform: "translate(-566, -433)"
|
|
18
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
19
|
+
id: "Group",
|
|
20
|
+
transform: "translate(566, 433.4118)"
|
|
21
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
22
|
+
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",
|
|
23
|
+
id: "Shape",
|
|
24
|
+
fill: "currentColor",
|
|
25
|
+
fillRule: "nonzero"
|
|
26
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
27
|
+
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",
|
|
28
|
+
id: "Path",
|
|
29
|
+
fill: "#FFFFFF"
|
|
30
|
+
})))));
|
|
31
|
+
}
|
|
32
|
+
export default RemoveBookmark;
|
|
33
|
+
//# sourceMappingURL=RemoveBookmark.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RemoveBookmark.js","names":["React","RemoveBookmark","createElement","width","height","viewBox","version","xmlns","id","stroke","strokeWidth","fill","fillRule","transform","d"],"sources":["../../../../src/components/ItemList/icons/RemoveBookmark.js"],"sourcesContent":["import React from 'react';\n\nfunction RemoveBookmark() {\n return (\n <svg\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 29\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <title>wishlist-button/remove</title>\n <g id=\"Wishlist\" stroke=\"none\" strokeWidth=\"1\" fill=\"none\" fillRule=\"evenodd\">\n <g id=\"components\" transform=\"translate(-566, -433)\">\n <g id=\"Group\" transform=\"translate(566, 433.4118)\">\n <path\n 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\"\n id=\"Shape\"\n fill=\"currentColor\"\n fillRule=\"nonzero\"\n />\n <path\n 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\"\n id=\"Path\"\n fill=\"#FFFFFF\"\n />\n </g>\n </g>\n </g>\n </svg>\n );\n}\n\nexport default RemoveBookmark;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,cAAcA,CAAA,EAAG;EACxB,oBACED,KAAA,CAAAE,aAAA;IACEC,KAAK,EAAC,KAAK;IACXC,MAAM,EAAC,KAAK;IACZC,OAAO,EAAC,WAAW;IACnBC,OAAO,EAAC,KAAK;IACbC,KAAK,EAAC;EAA4B,gBAClCP,KAAA,CAAAE,aAAA,gBAAO,wBAA6B,CAAC,eACrCF,KAAA,CAAAE,aAAA;IAAGM,EAAE,EAAC,UAAU;IAACC,MAAM,EAAC,MAAM;IAACC,WAAW,EAAC,GAAG;IAACC,IAAI,EAAC,MAAM;IAACC,QAAQ,EAAC;EAAS,gBAC3EZ,KAAA,CAAAE,aAAA;IAAGM,EAAE,EAAC,YAAY;IAACK,SAAS,EAAC;EAAuB,gBAClDb,KAAA,CAAAE,aAAA;IAAGM,EAAE,EAAC,OAAO;IAACK,SAAS,EAAC;EAA0B,gBAChDb,KAAA,CAAAE,aAAA;IACEY,CAAC,EAAC,4YAA4Y;IAC9YN,EAAE,EAAC,OAAO;IACVG,IAAI,EAAC,cAAc;IACnBC,QAAQ,EAAC;EAAS,CACnB,CAAC,eACFZ,KAAA,CAAAE,aAAA;IACEY,CAAC,EAAC,62BAA62B;IAC/2BN,EAAE,EAAC,MAAM;IACTG,IAAI,EAAC;EAAS,CACf,CACA,CACF,CACF,CACA,CAAC;AAEV;AAEA,eAAeV,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,5 @@
|
|
|
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';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","AddedBookmark","BaseBookmark","HoverBookmark","RemoveBookmark"],"sources":["../../../../src/components/ItemList/icons/index.js"],"sourcesContent":["export { default as AddedBookmark } from './AddedBookmark';\nexport { default as BaseBookmark } from './BaseBookmark';\nexport { default as HoverBookmark } from './HoverBookmark';\nexport { default as RemoveBookmark } from './RemoveBookmark';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,aAAa,QAAQ,iBAAiB;AAC1D,SAASD,OAAO,IAAIE,YAAY,QAAQ,gBAAgB;AACxD,SAASF,OAAO,IAAIG,aAAa,QAAQ,iBAAiB;AAC1D,SAASH,OAAO,IAAII,cAAc,QAAQ,kBAAkB","ignoreList":[]}
|
|
@@ -62,7 +62,7 @@ const ListBuilder = props => {
|
|
|
62
62
|
const limitToUse = limit || itemsToDisplayToUse.length;
|
|
63
63
|
const shouldApplyDefaultSort = !sortProperties || !sortProperties.length;
|
|
64
64
|
const itemsPerPageToUse = getItemsPerPageToUse(itemsPerPage, limitToUse);
|
|
65
|
-
const initialOffset = getCurrentOffset(offset, itemsPerPageToUse, paginationIndex
|
|
65
|
+
const initialOffset = getCurrentOffset(limitToUse, offset, itemsPerPageToUse, paginationIndex);
|
|
66
66
|
const fields = buildQueryFields(entityFields, entityTypes, !isCard);
|
|
67
67
|
const action = getSearchPublishedContent(fields);
|
|
68
68
|
const actionKey = SEARCH_PUBLISHED_CONTENT;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListBuilder.js","names":["React","PropTypes","useQuery","getStringTypeProps","ListRender","getSearchPublishedContent","buildRawQuery","buildQueryFields","buildSetFilters","getGenericRenderVariables","getEntityData","getCurrentOffset","getUpdatedFilterBy","checkPropsToUse","buildPropsQuery","sortAggs","getItemsPerPageToUse","buildAzAggregations","getListComponent","SEARCH_PUBLISHED_CONTENT","INFINITE","RAW_RESULTS","ListBuilder","props","mainSchemas","isCard","isAZ","inheritedFilters","paginationType","entities","parent","itemId","itemsPerPage","itemsToDisplay","limit","propsToDisplay","offset","entityData","sortby","sort","paginationIndex","omitWrappers","operator","filterOperator","currentSchema","filterEntitySchema","requiredSchema","searchValues","azFilter","sortProperties","itemListIds","entity","isInfinite","listComponent","propsToDisplayValues","entitiesTypes","map","ent","graphqlEntityMap","reduce","acc","entityType","_objectSpread","docTypes","docType","type","entityTypes","eType","entityFields","itemsToDisplayToUse","limitToUse","length","shouldApplyDefaultSort","itemsPerPageToUse","initialOffset","fields","action","actionKey","updatedFilterBy","filterValues","filterBy","relations","stringProps","Object","values","filterData","azRawQuery","id","shouldApplySort","azOptions","shouldReturnAggs","filterProps","propsForVariables","azVariables","rawQuery","azAction","data","error","loading","variables","skip","message","listAggregations","updatedAggregations","createElement","_extends","propTypes","array","isRequired","object","bool","number","string","defaultProps"],"sources":["../../../src/components/List/ListBuilder.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { useQuery } from '@apollo/client';\nimport { getStringTypeProps } from '@blaze-cms/utils/src/helpers';\nimport ListRender from './ListRender';\nimport { getSearchPublishedContent } from '../../application/query';\nimport {\n buildRawQuery,\n buildQueryFields,\n buildSetFilters,\n getGenericRenderVariables,\n getEntityData,\n getCurrentOffset,\n getUpdatedFilterBy,\n checkPropsToUse,\n buildPropsQuery\n} from '../../helpers';\nimport { sortAggs, getItemsPerPageToUse, buildAzAggregations, getListComponent } from './helpers';\nimport { SEARCH_PUBLISHED_CONTENT, INFINITE } from '../../constants';\nimport { RAW_RESULTS } from './constants';\n\nconst ListBuilder = props => {\n const {\n mainSchemas,\n isCard,\n isAZ,\n inheritedFilters,\n paginationType,\n entities,\n parent: { itemId },\n itemsPerPage,\n itemsToDisplay,\n limit,\n propsToDisplay,\n offset,\n entityData,\n sortby,\n sort,\n paginationIndex,\n omitWrappers,\n operator,\n filterOperator,\n currentSchema,\n filterEntitySchema,\n requiredSchema,\n searchValues,\n azFilter,\n sortProperties,\n itemListIds\n } = props;\n\n const [entity] = entities;\n const isInfinite = paginationType === INFINITE;\n const listComponent = getListComponent(isCard, paginationType);\n const propsToDisplayValues = checkPropsToUse(propsToDisplay);\n const entitiesTypes = entities.map(ent => getEntityData(ent, mainSchemas[ent]));\n const graphqlEntityMap = entitiesTypes.reduce(\n (acc, entityType) => ({ ...acc, [entityType.entityType]: entityType.entity }),\n {}\n );\n const docTypes = entitiesTypes.map(({ docType: type }) => type);\n const entityTypes = entitiesTypes.map(({ entityType: eType }) => eType);\n const entityFields = buildPropsQuery(filterEntitySchema, propsToDisplayValues, props) || '';\n const itemsToDisplayToUse = itemListIds || itemsToDisplay;\n const limitToUse = limit || itemsToDisplayToUse.length;\n const shouldApplyDefaultSort = !sortProperties || !sortProperties.length;\n const itemsPerPageToUse = getItemsPerPageToUse(itemsPerPage, limitToUse);\n const initialOffset = getCurrentOffset(offset, itemsPerPageToUse, paginationIndex, limitToUse);\n const fields = buildQueryFields(entityFields, entityTypes, !isCard);\n const action = getSearchPublishedContent(fields);\n const actionKey = SEARCH_PUBLISHED_CONTENT;\n const updatedFilterBy = getUpdatedFilterBy(\n inheritedFilters,\n entityData,\n currentSchema,\n filterEntitySchema,\n itemId,\n props\n );\n\n const filterValues =\n updatedFilterBy && updatedFilterBy.length\n ? buildSetFilters({ ...props, filterBy: updatedFilterBy })\n : buildSetFilters({ ...props });\n\n const { relations = [] } = filterEntitySchema;\n const stringProps = getStringTypeProps(entity, relations, Object.values(requiredSchema));\n const filterData = {\n filterValues,\n filterOperator,\n relations,\n stringProps\n };\n const azRawQuery = buildRawQuery({\n docType: docTypes,\n operator,\n searchValues,\n filterData,\n id: itemId,\n itemsToDisplay: itemsToDisplayToUse,\n shouldApplySort: shouldApplyDefaultSort,\n azOptions: { shouldReturnAggs: true, isAZ, sortProperties }\n });\n\n const filterProps = {\n ...props,\n limit: itemsPerPageToUse,\n offset: initialOffset,\n sort,\n sortby,\n sortProperties\n };\n\n const propsForVariables = {\n relations,\n filterProps,\n stringProps\n };\n\n const azVariables = getGenericRenderVariables({\n ...propsForVariables,\n rawQuery: azRawQuery\n });\n\n const azAction = getSearchPublishedContent(RAW_RESULTS);\n const { data, error, loading } = useQuery(azAction, {\n variables: azVariables,\n skip: !isAZ\n });\n if (loading) return '';\n if (error) return error.message;\n\n const listAggregations = isAZ ? sortAggs(data) : [];\n const updatedAggregations = buildAzAggregations(listAggregations);\n\n const rawQuery = buildRawQuery({\n docType: docTypes,\n operator,\n searchValues,\n filterData: {\n ...filterData,\n azFilter\n },\n id: itemId,\n itemsToDisplay: itemsToDisplayToUse,\n shouldApplySort: shouldApplyDefaultSort,\n azOptions: { shouldReturnAggs: false, isAZ, sortProperties },\n sortProperties\n });\n\n const variables = getGenericRenderVariables({\n ...propsForVariables,\n rawQuery\n });\n\n return (\n <ListRender\n variables={variables}\n isInfinite={isInfinite}\n initialOffset={initialOffset}\n actionKey={actionKey}\n limitToUse={limitToUse}\n itemsPerPageToUse={itemsPerPageToUse}\n action={action}\n omitWrappers={omitWrappers}\n listComponent={listComponent}\n listAggregations={updatedAggregations}\n isAZ={isAZ}\n azFilter={azFilter}\n graphqlEntityMap={graphqlEntityMap}\n {...props}\n itemsToDisplay={itemsToDisplayToUse}\n />\n );\n};\n\nListBuilder.propTypes = {\n entities: PropTypes.array.isRequired,\n mainSchemas: PropTypes.object.isRequired,\n isCard: PropTypes.bool.isRequired,\n isAZ: PropTypes.bool.isRequired,\n parent: PropTypes.object.isRequired,\n itemsPerPage: PropTypes.number.isRequired,\n paginationIndex: PropTypes.number.isRequired,\n propsToDisplay: PropTypes.array.isRequired,\n currentSchema: PropTypes.object.isRequired,\n filterEntitySchema: PropTypes.object.isRequired,\n requiredSchema: PropTypes.object.isRequired,\n searchValues: PropTypes.object.isRequired,\n inheritedFilters: PropTypes.array,\n entityData: PropTypes.object,\n itemsToDisplay: PropTypes.array,\n limit: PropTypes.number,\n omitWrappers: PropTypes.bool,\n offset: PropTypes.number,\n sortby: PropTypes.array,\n sort: PropTypes.string,\n operator: PropTypes.string.isRequired,\n filterOperator: PropTypes.string.isRequired,\n paginationType: PropTypes.string,\n azFilter: PropTypes.string,\n sortProperties: PropTypes.array,\n itemListIds: PropTypes.array\n};\n\nListBuilder.defaultProps = {\n sort: '',\n sortby: [],\n entityData: {},\n itemsToDisplay: [],\n itemListIds: null,\n limit: 0,\n omitWrappers: false,\n offset: 0,\n paginationType: 'infinite',\n inheritedFilters: [],\n azFilter: '',\n sortProperties: []\n};\n\nexport default ListBuilder;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,kBAAkB,QAAQ,8BAA8B;AACjE,OAAOC,UAAU,MAAM,cAAc;AACrC,SAASC,yBAAyB,QAAQ,yBAAyB;AACnE,SACEC,aAAa,EACbC,gBAAgB,EAChBC,eAAe,E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AI,EAAE,EAAE;EACRD,MAAM,EAAE,EAAE;EACVD,UAAU,EAAE,CAAC,CAAC;EACdJ,cAAc,EAAE,EAAE;EAClBiB,WAAW,EAAE,IAAI;EACjBhB,KAAK,EAAE,CAAC;EACRO,YAAY,EAAE,KAAK;EACnBL,MAAM,EAAE,CAAC;EACTR,cAAc,EAAE,UAAU;EAC1BD,gBAAgB,EAAE,EAAE;EACpBqB,QAAQ,EAAE,EAAE;EACZC,cAAc,EAAE;AAClB,CAAC;AAED,eAAe3B,WAAW","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ListBuilder.js","names":["React","PropTypes","useQuery","getStringTypeProps","ListRender","getSearchPublishedContent","buildRawQuery","buildQueryFields","buildSetFilters","getGenericRenderVariables","getEntityData","getCurrentOffset","getUpdatedFilterBy","checkPropsToUse","buildPropsQuery","sortAggs","getItemsPerPageToUse","buildAzAggregations","getListComponent","SEARCH_PUBLISHED_CONTENT","INFINITE","RAW_RESULTS","ListBuilder","props","mainSchemas","isCard","isAZ","inheritedFilters","paginationType","entities","parent","itemId","itemsPerPage","itemsToDisplay","limit","propsToDisplay","offset","entityData","sortby","sort","paginationIndex","omitWrappers","operator","filterOperator","currentSchema","filterEntitySchema","requiredSchema","searchValues","azFilter","sortProperties","itemListIds","entity","isInfinite","listComponent","propsToDisplayValues","entitiesTypes","map","ent","graphqlEntityMap","reduce","acc","entityType","_objectSpread","docTypes","docType","type","entityTypes","eType","entityFields","itemsToDisplayToUse","limitToUse","length","shouldApplyDefaultSort","itemsPerPageToUse","initialOffset","fields","action","actionKey","updatedFilterBy","filterValues","filterBy","relations","stringProps","Object","values","filterData","azRawQuery","id","shouldApplySort","azOptions","shouldReturnAggs","filterProps","propsForVariables","azVariables","rawQuery","azAction","data","error","loading","variables","skip","message","listAggregations","updatedAggregations","createElement","_extends","propTypes","array","isRequired","object","bool","number","string","defaultProps"],"sources":["../../../src/components/List/ListBuilder.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { useQuery } from '@apollo/client';\nimport { getStringTypeProps } from '@blaze-cms/utils/src/helpers';\nimport ListRender from './ListRender';\nimport { getSearchPublishedContent } from '../../application/query';\nimport {\n buildRawQuery,\n buildQueryFields,\n buildSetFilters,\n getGenericRenderVariables,\n getEntityData,\n getCurrentOffset,\n getUpdatedFilterBy,\n checkPropsToUse,\n buildPropsQuery\n} from '../../helpers';\nimport { sortAggs, getItemsPerPageToUse, buildAzAggregations, getListComponent } from './helpers';\nimport { SEARCH_PUBLISHED_CONTENT, INFINITE } from '../../constants';\nimport { RAW_RESULTS } from './constants';\n\nconst ListBuilder = props => {\n const {\n mainSchemas,\n isCard,\n isAZ,\n inheritedFilters,\n paginationType,\n entities,\n parent: { itemId },\n itemsPerPage,\n itemsToDisplay,\n limit,\n propsToDisplay,\n offset,\n entityData,\n sortby,\n sort,\n paginationIndex,\n omitWrappers,\n operator,\n filterOperator,\n currentSchema,\n filterEntitySchema,\n requiredSchema,\n searchValues,\n azFilter,\n sortProperties,\n itemListIds\n } = props;\n\n const [entity] = entities;\n const isInfinite = paginationType === INFINITE;\n const listComponent = getListComponent(isCard, paginationType);\n const propsToDisplayValues = checkPropsToUse(propsToDisplay);\n const entitiesTypes = entities.map(ent => getEntityData(ent, mainSchemas[ent]));\n const graphqlEntityMap = entitiesTypes.reduce(\n (acc, entityType) => ({ ...acc, [entityType.entityType]: entityType.entity }),\n {}\n );\n const docTypes = entitiesTypes.map(({ docType: type }) => type);\n const entityTypes = entitiesTypes.map(({ entityType: eType }) => eType);\n const entityFields = buildPropsQuery(filterEntitySchema, propsToDisplayValues, props) || '';\n const itemsToDisplayToUse = itemListIds || itemsToDisplay;\n const limitToUse = limit || itemsToDisplayToUse.length;\n const shouldApplyDefaultSort = !sortProperties || !sortProperties.length;\n const itemsPerPageToUse = getItemsPerPageToUse(itemsPerPage, limitToUse);\n const initialOffset = getCurrentOffset(limitToUse, offset, itemsPerPageToUse, paginationIndex);\n const fields = buildQueryFields(entityFields, entityTypes, !isCard);\n const action = getSearchPublishedContent(fields);\n const actionKey = SEARCH_PUBLISHED_CONTENT;\n const updatedFilterBy = getUpdatedFilterBy(\n inheritedFilters,\n entityData,\n currentSchema,\n filterEntitySchema,\n itemId,\n props\n );\n\n const filterValues =\n updatedFilterBy && updatedFilterBy.length\n ? buildSetFilters({ ...props, filterBy: updatedFilterBy })\n : buildSetFilters({ ...props });\n\n const { relations = [] } = filterEntitySchema;\n const stringProps = getStringTypeProps(entity, relations, Object.values(requiredSchema));\n const filterData = {\n filterValues,\n filterOperator,\n relations,\n stringProps\n };\n const azRawQuery = buildRawQuery({\n docType: docTypes,\n operator,\n searchValues,\n filterData,\n id: itemId,\n itemsToDisplay: itemsToDisplayToUse,\n shouldApplySort: shouldApplyDefaultSort,\n azOptions: { shouldReturnAggs: true, isAZ, sortProperties }\n });\n\n const filterProps = {\n ...props,\n limit: itemsPerPageToUse,\n offset: initialOffset,\n sort,\n sortby,\n sortProperties\n };\n\n const propsForVariables = {\n relations,\n filterProps,\n stringProps\n };\n\n const azVariables = getGenericRenderVariables({\n ...propsForVariables,\n rawQuery: azRawQuery\n });\n\n const azAction = getSearchPublishedContent(RAW_RESULTS);\n const { data, error, loading } = useQuery(azAction, {\n variables: azVariables,\n skip: !isAZ\n });\n if (loading) return '';\n if (error) return error.message;\n\n const listAggregations = isAZ ? sortAggs(data) : [];\n const updatedAggregations = buildAzAggregations(listAggregations);\n\n const rawQuery = buildRawQuery({\n docType: docTypes,\n operator,\n searchValues,\n filterData: {\n ...filterData,\n azFilter\n },\n id: itemId,\n itemsToDisplay: itemsToDisplayToUse,\n shouldApplySort: shouldApplyDefaultSort,\n azOptions: { shouldReturnAggs: false, isAZ, sortProperties },\n sortProperties\n });\n\n const variables = getGenericRenderVariables({\n ...propsForVariables,\n rawQuery\n });\n\n return (\n <ListRender\n variables={variables}\n isInfinite={isInfinite}\n initialOffset={initialOffset}\n actionKey={actionKey}\n limitToUse={limitToUse}\n itemsPerPageToUse={itemsPerPageToUse}\n action={action}\n omitWrappers={omitWrappers}\n listComponent={listComponent}\n listAggregations={updatedAggregations}\n isAZ={isAZ}\n azFilter={azFilter}\n graphqlEntityMap={graphqlEntityMap}\n {...props}\n itemsToDisplay={itemsToDisplayToUse}\n />\n );\n};\n\nListBuilder.propTypes = {\n entities: PropTypes.array.isRequired,\n mainSchemas: PropTypes.object.isRequired,\n isCard: PropTypes.bool.isRequired,\n isAZ: PropTypes.bool.isRequired,\n parent: PropTypes.object.isRequired,\n itemsPerPage: PropTypes.number.isRequired,\n paginationIndex: PropTypes.number.isRequired,\n propsToDisplay: PropTypes.array.isRequired,\n currentSchema: PropTypes.object.isRequired,\n filterEntitySchema: PropTypes.object.isRequired,\n requiredSchema: PropTypes.object.isRequired,\n searchValues: PropTypes.object.isRequired,\n inheritedFilters: PropTypes.array,\n entityData: PropTypes.object,\n itemsToDisplay: PropTypes.array,\n limit: PropTypes.number,\n omitWrappers: PropTypes.bool,\n offset: PropTypes.number,\n sortby: PropTypes.array,\n sort: PropTypes.string,\n operator: PropTypes.string.isRequired,\n filterOperator: PropTypes.string.isRequired,\n paginationType: PropTypes.string,\n azFilter: PropTypes.string,\n sortProperties: PropTypes.array,\n itemListIds: PropTypes.array\n};\n\nListBuilder.defaultProps = {\n sort: '',\n sortby: [],\n entityData: {},\n itemsToDisplay: [],\n itemListIds: null,\n limit: 0,\n omitWrappers: false,\n offset: 0,\n paginationType: 'infinite',\n inheritedFilters: [],\n azFilter: '',\n sortProperties: []\n};\n\nexport default ListBuilder;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,kBAAkB,QAAQ,8BAA8B;AACjE,OAAOC,UAAU,MAAM,cAAc;AACrC,SAASC,yBAAyB,QAAQ,yBAAyB;AACnE,SACEC,aAAa,EACbC,gBAAgB,EAChBC,eAAe,EACfC,yBAAyB,EACzBC,aAAa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AM,EAAE,EAAE;EACVD,UAAU,EAAE,CAAC,CAAC;EACdJ,cAAc,EAAE,EAAE;EAClBiB,WAAW,EAAE,IAAI;EACjBhB,KAAK,EAAE,CAAC;EACRO,YAAY,EAAE,KAAK;EACnBL,MAAM,EAAE,CAAC;EACTR,cAAc,EAAE,UAAU;EAC1BD,gBAAgB,EAAE,EAAE;EACpBqB,QAAQ,EAAE,EAAE;EACZC,cAAc,EAAE;AAClB,CAAC;AAED,eAAe3B,WAAW","ignoreList":[]}
|
|
@@ -15,6 +15,7 @@ import { getGenericProps, getRequiredSchemas, checkForError, getUnpublishedEntit
|
|
|
15
15
|
import { getItemListId, getItemListIds } from '../ItemList/helpers';
|
|
16
16
|
import { useGetEntitySchemasAsObj } from '../../hooks';
|
|
17
17
|
import { AND_OPERATOR, TEXT_SEARCH, ID, AND, FULL } from '../../constants';
|
|
18
|
+
export const VariantContext = React.createContext(null);
|
|
18
19
|
const ListFactory = props => {
|
|
19
20
|
const {
|
|
20
21
|
entity: legacyEntity,
|
|
@@ -30,7 +31,8 @@ const ListFactory = props => {
|
|
|
30
31
|
allSearchFilters,
|
|
31
32
|
operator: filterOperator,
|
|
32
33
|
sortProperties,
|
|
33
|
-
itemListName
|
|
34
|
+
itemListName,
|
|
35
|
+
VariantComponent // extracted from props
|
|
34
36
|
} = props;
|
|
35
37
|
const {
|
|
36
38
|
isPreview
|
|
@@ -171,7 +173,9 @@ const ListFactory = props => {
|
|
|
171
173
|
entities: entitiesToUse,
|
|
172
174
|
mainSchemas
|
|
173
175
|
});
|
|
174
|
-
return /*#__PURE__*/React.createElement(
|
|
176
|
+
return /*#__PURE__*/React.createElement(VariantContext.Provider, {
|
|
177
|
+
value: VariantComponent
|
|
178
|
+
}, /*#__PURE__*/React.createElement(ListBuilder, listProps));
|
|
175
179
|
};
|
|
176
180
|
ListFactory.propTypes = {
|
|
177
181
|
parent: PropTypes.object.isRequired,
|
|
@@ -187,7 +191,8 @@ ListFactory.propTypes = {
|
|
|
187
191
|
sort: PropTypes.string,
|
|
188
192
|
allSearchFilters: PropTypes.array,
|
|
189
193
|
sortProperties: PropTypes.array,
|
|
190
|
-
itemListName: PropTypes.string
|
|
194
|
+
itemListName: PropTypes.string,
|
|
195
|
+
VariantComponent: PropTypes.func
|
|
191
196
|
};
|
|
192
197
|
ListFactory.defaultProps = {
|
|
193
198
|
entity: '',
|
|
@@ -201,7 +206,8 @@ ListFactory.defaultProps = {
|
|
|
201
206
|
sort: '',
|
|
202
207
|
operator: AND,
|
|
203
208
|
allSearchFilters: [],
|
|
204
|
-
itemListName: ''
|
|
209
|
+
itemListName: '',
|
|
210
|
+
VariantComponent: null
|
|
205
211
|
};
|
|
206
212
|
export default ListFactory;
|
|
207
213
|
//# sourceMappingURL=ListFactory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListFactory.js","names":["React","useContext","useQuery","parseUrl","PropTypes","useRouter","MainContext","generateSingleItemQuery","getItemList","ListBuilder","AZ_LIST_TYPE","getAzQueryFilter","getSortProps","hasRequiredItemListDetails","getListSpecificSearchFilter","getListQuery","getGenericProps","getRequiredSchemas","checkForError","getUnpublishedEntityName","getPaginationIndex","getSearchFilterType","getElasticsearchOperator","buildSearchValuesText","getQueryFilters","getInheritedFilters","getQueryProps","getItemListId","getItemListIds","useGetEntitySchemasAsObj","AND_OPERATOR","TEXT_SEARCH","ID","AND","FULL","ListFactory","props","entity","legacyEntity","entities","parent","name","filterByProperty","filterBy","omitWrappers","type","sortby","defaultSortBy","sort","defaultSort","allSearchFilters","operator","filterOperator","sortProperties","itemListName","isPreview","router","asPath","parsedQuery","replace","searchFilter","hasListSpecificFilters","query","url","itemListId","queryItemListId","updatedQuery","isTextSearchFilterApplied","search_term","length","querySort","querySortBy","sortbyFilters","updatedSortProperties","itemEntity","parentEntity","itemId","parentId","updatedParentEntity","paginationIndex","azFilter","entitiesToUse","filterEntity","data","mainSchemas","loading","schemasLoading","error","schemasError","currentSchema","filterEntitySchema","requiredSchema","requiredSchemaLoading","requiredSchemaError","inheritedFilters","queryProps","actions","getAction","get","getPublished","entityData","itemQueryError","itemQueryLoading","variables","id","skip","itemListData","itemListError","itemListLoading","errorsToCheck","hasErr","errMsg","itemListIds","isCard","includes","isAZ","genericProps","textFilter","shouldApplyTextFilter","propsToDisplay","valuesText","valuesAnd","valuesOr","searchValues","searchValuesText","searchValuesCheckboxSelectRange","searchValuesCheckboxOr","listProps","_objectSpread","createElement","propTypes","object","isRequired","string","array","bool","defaultProps"],"sources":["../../../src/components/List/ListFactory.js"],"sourcesContent":["import React, { useContext } from 'react';\nimport { useQuery } from '@apollo/client';\nimport { parseUrl } from 'query-string';\nimport PropTypes from 'prop-types';\nimport { useRouter } from 'next/router';\nimport { MainContext } from '@blaze-cms/nextjs-components';\nimport { generateSingleItemQuery, getItemList } from '../../application/query';\nimport ListBuilder from './ListBuilder';\nimport { AZ_LIST_TYPE } from './constants';\nimport {\n getAzQueryFilter,\n getSortProps,\n hasRequiredItemListDetails,\n getListSpecificSearchFilter,\n getListQuery\n} from './helpers';\nimport {\n getGenericProps,\n getRequiredSchemas,\n checkForError,\n getUnpublishedEntityName,\n getPaginationIndex,\n getSearchFilterType,\n getElasticsearchOperator,\n buildSearchValuesText,\n getQueryFilters,\n getInheritedFilters,\n getQueryProps\n} from '../../helpers';\nimport { getItemListId, getItemListIds } from '../ItemList/helpers';\nimport { useGetEntitySchemasAsObj } from '../../hooks';\nimport { AND_OPERATOR, TEXT_SEARCH, ID, AND, FULL } from '../../constants';\n\nconst ListFactory = props => {\n const {\n entity: legacyEntity,\n entities,\n parent,\n name,\n filterByProperty,\n filterBy,\n omitWrappers,\n type,\n sortby: defaultSortBy,\n sort: defaultSort,\n allSearchFilters,\n operator: filterOperator,\n sortProperties,\n itemListName\n } = props;\n const { isPreview } = useContext(MainContext);\n const router = useRouter();\n const { asPath } = router;\n const parsedQuery = asPath.replace(/%5D/g, ']').replace(/%5B/g, '[');\n const [searchFilter, hasListSpecificFilters] = getListSpecificSearchFilter(\n allSearchFilters,\n name\n );\n const { query, url, query: { itemListId: queryItemListId } = {} } = parseUrl(parsedQuery);\n const updatedQuery = getListQuery(query, hasListSpecificFilters, name);\n const isTextSearchFilterApplied = !!(\n updatedQuery.search_term &&\n searchFilter &&\n getSearchFilterType(searchFilter, TEXT_SEARCH).length\n );\n\n const { sort: querySort, sortby: querySortBy } = updatedQuery;\n\n const { sortbyFilters, updatedSortProperties } = getSortProps({\n querySort,\n sortProperties,\n defaultSort,\n querySortBy,\n defaultSortBy,\n isTextSearchFilterApplied\n });\n\n const itemListId = getItemListId(itemListName, queryItemListId);\n const { itemEntity: parentEntity, itemId: parentId } = parent;\n const updatedParentEntity = getUnpublishedEntityName(parentEntity);\n const paginationIndex = getPaginationIndex(updatedQuery, name);\n const azFilter = getAzQueryFilter(updatedQuery, name);\n\n const entitiesToUse = entities && entities.length ? entities : [legacyEntity];\n const [filterEntity] = entitiesToUse;\n const {\n data: mainSchemas = {},\n loading: schemasLoading,\n error: schemasError\n } = useGetEntitySchemasAsObj([updatedParentEntity, ...entitiesToUse]);\n\n const { [updatedParentEntity]: currentSchema = {}, [filterEntity]: filterEntitySchema = {} } =\n mainSchemas;\n\n const {\n data: requiredSchema = {},\n loading: requiredSchemaLoading,\n error: requiredSchemaError\n } = useGetEntitySchemasAsObj(\n getRequiredSchemas([...filterByProperty, ...sortbyFilters], filterEntitySchema),\n schemasLoading\n );\n const inheritedFilters = getInheritedFilters(filterBy, filterByProperty);\n const queryProps = getQueryProps(inheritedFilters, currentSchema, filterEntitySchema);\n const { actions = {} } = currentSchema || {};\n const getAction = isPreview ? actions.get : actions.getPublished;\n\n const {\n data: { entityData = {} } = {},\n error: itemQueryError,\n loading: itemQueryLoading\n } = useQuery(generateSingleItemQuery(getAction, queryProps), {\n variables: { id: parentId },\n skip: schemasLoading || (!inheritedFilters.length && queryProps === ID)\n });\n\n const {\n data: itemListData = {},\n error: itemListError,\n loading: itemListLoading\n } = useQuery(getItemList, {\n variables: { id: itemListId },\n skip: !itemListId\n });\n\n if (!hasRequiredItemListDetails({ itemListName, router, itemListId, queryItemListId })) return '';\n\n const errorsToCheck = [schemasError, requiredSchemaError, itemQueryError, itemListError];\n const { hasErr, errMsg } = checkForError(errorsToCheck);\n\n if (requiredSchemaLoading || schemasLoading || itemQueryLoading || itemListLoading) return '';\n if (hasErr) return errMsg;\n\n const itemListIds = getItemListIds(itemListData);\n const isCard = !type.includes(FULL);\n const isAZ = type.includes(AZ_LIST_TYPE);\n const genericProps = getGenericProps(props);\n const [textFilter] = getSearchFilterType(searchFilter, TEXT_SEARCH);\n const shouldApplyTextFilter = textFilter && textFilter.propsToDisplay.length;\n const operator = shouldApplyTextFilter ? getElasticsearchOperator(textFilter) : AND_OPERATOR;\n const valuesText = shouldApplyTextFilter\n ? buildSearchValuesText(textFilter, updatedQuery, name)\n : [];\n const { valuesAnd, valuesOr } = getQueryFilters(searchFilter, updatedQuery, name);\n\n const searchValues = {\n searchValuesText: valuesText,\n searchValuesCheckboxSelectRange: valuesAnd,\n searchValuesCheckboxOr: valuesOr\n };\n const listProps = {\n ...props,\n ...genericProps,\n query: updatedQuery,\n url,\n isCard,\n isAZ,\n router,\n sort: null,\n sortby: null,\n sortProperties: updatedSortProperties,\n azFilter,\n searchValues,\n filterEntitySchema,\n requiredSchema,\n currentSchema,\n omitWrappers,\n operator,\n paginationIndex,\n entityData,\n inheritedFilters,\n filterOperator,\n itemListIds,\n entities: entitiesToUse,\n mainSchemas\n };\n\n return <ListBuilder {...listProps} />;\n};\n\nListFactory.propTypes = {\n parent: PropTypes.object.isRequired,\n type: PropTypes.string.isRequired,\n entity: PropTypes.string,\n entities: PropTypes.array,\n filterBy: PropTypes.array,\n filterByProperty: PropTypes.array,\n omitWrappers: PropTypes.bool,\n operator: PropTypes.string,\n name: PropTypes.string,\n sortby: PropTypes.array,\n sort: PropTypes.string,\n allSearchFilters: PropTypes.array,\n sortProperties: PropTypes.array,\n itemListName: PropTypes.string\n};\n\nListFactory.defaultProps = {\n entity: '',\n entities: [],\n filterBy: [],\n filterByProperty: [],\n omitWrappers: false,\n name: '',\n sortby: [],\n sortProperties: [],\n sort: '',\n operator: AND,\n allSearchFilters: [],\n itemListName: ''\n};\n\nexport default ListFactory;\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,QAAQ,QAAQ,cAAc;AACvC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,WAAW,QAAQ,8BAA8B;AAC1D,SAASC,uBAAuB,EAAEC,WAAW,QAAQ,yBAAyB;AAC9E,OAAOC,WAAW,MAAM,eAAe;AACvC,SAASC,YAAY,QAAQ,aAAa;AAC1C,SACEC,gBAAgB,EAChBC,YAAY,EACZC,0BAA0B,EAC1BC,2BAA2B,EAC3BC,YAAY,QACP,WAAW;AAClB,SACEC,eAAe,EACfC,kBAAkB,EAClBC,aAAa,EACbC,wBAAwB,EACxBC,kBAAkB,EAClBC,mBAAmB,EACnBC,wBAAwB,EACxBC,qBAAqB,EACrBC,eAAe,EACfC,mBAAmB,EACnBC,aAAa,QACR,eAAe;AACtB,SAASC,aAAa,EAAEC,cAAc,QAAQ,qBAAqB;AACnE,SAASC,wBAAwB,QAAQ,aAAa;AACtD,SAASC,YAAY,EAAEC,WAAW,EAAEC,EAAE,EAAEC,GAAG,EAAEC,IAAI,QAAQ,iBAAiB;AAE1E,MAAMC,WAAW,GAAGC,KAAK,IAAI;EAC3B,MAAM;IACJC,MAAM,EAAEC,YAAY;IACpBC,QAAQ;IACRC,MAAM;IACNC,IAAI;IACJC,gBAAgB;IAChBC,QAAQ;IACRC,YAAY;IACZC,IAAI;IACJC,MAAM,EAAEC,aAAa;IACrBC,IAAI,EAAEC,WAAW;IACjBC,gBAAgB;IAChBC,QAAQ,EAAEC,cAAc;IACxBC,cAAc;IACdC;EACF,CAAC,GAAG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EACnCvF,IAAI,EAAEzC,SAAS,CAACiI,MAAM,CAACD,UAAU;EACjC/F,MAAM,EAAEjC,SAAS,CAACiI,MAAM;EACxB9F,QAAQ,EAAEnC,SAAS,CAACkI,KAAK;EACzB3F,QAAQ,EAAEvC,SAAS,CAACkI,KAAK;EACzB5F,gBAAgB,EAAEtC,SAAS,CAACkI,KAAK;EACjC1F,YAAY,EAAExC,SAAS,CAACmI,IAAI;EAC5BpF,QAAQ,EAAE/C,SAAS,CAACiI,MAAM;EAC1B5F,IAAI,EAAErC,SAAS,CAACiI,MAAM;EACtBvF,MAAM,EAAE1C,SAAS,CAACkI,KAAK;EACvBtF,IAAI,EAAE5C,SAAS,CAACiI,MAAM;EACtBnF,gBAAgB,EAAE9C,SAAS,CAACkI,KAAK;EACjCjF,cAAc,EAAEjD,SAAS,CAACkI,KAAK;EAC/BhF,YAAY,EAAElD,SAAS,CAACiI;AAC1B,CAAC;AAEDlG,WAAW,CAACqG,YAAY,GAAG;EACzBnG,MAAM,EAAE,EAAE;EACVE,QAAQ,EAAE,EAAE;EACZI,QAAQ,EAAE,EAAE;EACZD,gBAAgB,EAAE,EAAE;EACpBE,YAAY,EAAE,KAAK;EACnBH,IAAI,EAAE,EAAE;EACRK,MAAM,EAAE,EAAE;EACVO,cAAc,EAAE,EAAE;EAClBL,IAAI,EAAE,EAAE;EACRG,QAAQ,EAAElB,GAAG;EACbiB,gBAAgB,EAAE,EAAE;EACpBI,YAAY,EAAE;AAChB,CAAC;AAED,eAAenB,WAAW","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ListFactory.js","names":["React","useContext","useQuery","parseUrl","PropTypes","useRouter","MainContext","generateSingleItemQuery","getItemList","ListBuilder","AZ_LIST_TYPE","getAzQueryFilter","getSortProps","hasRequiredItemListDetails","getListSpecificSearchFilter","getListQuery","getGenericProps","getRequiredSchemas","checkForError","getUnpublishedEntityName","getPaginationIndex","getSearchFilterType","getElasticsearchOperator","buildSearchValuesText","getQueryFilters","getInheritedFilters","getQueryProps","getItemListId","getItemListIds","useGetEntitySchemasAsObj","AND_OPERATOR","TEXT_SEARCH","ID","AND","FULL","VariantContext","createContext","ListFactory","props","entity","legacyEntity","entities","parent","name","filterByProperty","filterBy","omitWrappers","type","sortby","defaultSortBy","sort","defaultSort","allSearchFilters","operator","filterOperator","sortProperties","itemListName","VariantComponent","isPreview","router","asPath","parsedQuery","replace","searchFilter","hasListSpecificFilters","query","url","itemListId","queryItemListId","updatedQuery","isTextSearchFilterApplied","search_term","length","querySort","querySortBy","sortbyFilters","updatedSortProperties","itemEntity","parentEntity","itemId","parentId","updatedParentEntity","paginationIndex","azFilter","entitiesToUse","filterEntity","data","mainSchemas","loading","schemasLoading","error","schemasError","currentSchema","filterEntitySchema","requiredSchema","requiredSchemaLoading","requiredSchemaError","inheritedFilters","queryProps","actions","getAction","get","getPublished","entityData","itemQueryError","itemQueryLoading","variables","id","skip","itemListData","itemListError","itemListLoading","errorsToCheck","hasErr","errMsg","itemListIds","isCard","includes","isAZ","genericProps","textFilter","shouldApplyTextFilter","propsToDisplay","valuesText","valuesAnd","valuesOr","searchValues","searchValuesText","searchValuesCheckboxSelectRange","searchValuesCheckboxOr","listProps","_objectSpread","createElement","Provider","value","propTypes","object","isRequired","string","array","bool","func","defaultProps"],"sources":["../../../src/components/List/ListFactory.js"],"sourcesContent":["import React, { useContext } from 'react';\nimport { useQuery } from '@apollo/client';\nimport { parseUrl } from 'query-string';\nimport PropTypes from 'prop-types';\nimport { useRouter } from 'next/router';\nimport { MainContext } from '@blaze-cms/nextjs-components';\nimport { generateSingleItemQuery, getItemList } from '../../application/query';\nimport ListBuilder from './ListBuilder';\nimport { AZ_LIST_TYPE } from './constants';\nimport {\n getAzQueryFilter,\n getSortProps,\n hasRequiredItemListDetails,\n getListSpecificSearchFilter,\n getListQuery\n} from './helpers';\nimport {\n getGenericProps,\n getRequiredSchemas,\n checkForError,\n getUnpublishedEntityName,\n getPaginationIndex,\n getSearchFilterType,\n getElasticsearchOperator,\n buildSearchValuesText,\n getQueryFilters,\n getInheritedFilters,\n getQueryProps\n} from '../../helpers';\nimport { getItemListId, getItemListIds } from '../ItemList/helpers';\nimport { useGetEntitySchemasAsObj } from '../../hooks';\nimport { AND_OPERATOR, TEXT_SEARCH, ID, AND, FULL } from '../../constants';\n\nexport const VariantContext = React.createContext(null);\n\nconst ListFactory = props => {\n const {\n entity: legacyEntity,\n entities,\n parent,\n name,\n filterByProperty,\n filterBy,\n omitWrappers,\n type,\n sortby: defaultSortBy,\n sort: defaultSort,\n allSearchFilters,\n operator: filterOperator,\n sortProperties,\n itemListName,\n VariantComponent // extracted from props\n } = props;\n const { isPreview } = useContext(MainContext);\n const router = useRouter();\n const { asPath } = router;\n const parsedQuery = asPath.replace(/%5D/g, ']').replace(/%5B/g, '[');\n const [searchFilter, hasListSpecificFilters] = getListSpecificSearchFilter(\n allSearchFilters,\n name\n );\n const { query, url, query: { itemListId: queryItemListId } = {} } = parseUrl(parsedQuery);\n const updatedQuery = getListQuery(query, hasListSpecificFilters, name);\n const isTextSearchFilterApplied = !!(\n updatedQuery.search_term &&\n searchFilter &&\n getSearchFilterType(searchFilter, TEXT_SEARCH).length\n );\n\n const { sort: querySort, sortby: querySortBy } = updatedQuery;\n\n const { sortbyFilters, updatedSortProperties } = getSortProps({\n querySort,\n sortProperties,\n defaultSort,\n querySortBy,\n defaultSortBy,\n isTextSearchFilterApplied\n });\n\n const itemListId = getItemListId(itemListName, queryItemListId);\n const { itemEntity: parentEntity, itemId: parentId } = parent;\n const updatedParentEntity = getUnpublishedEntityName(parentEntity);\n const paginationIndex = getPaginationIndex(updatedQuery, name);\n const azFilter = getAzQueryFilter(updatedQuery, name);\n\n const entitiesToUse = entities && entities.length ? entities : [legacyEntity];\n const [filterEntity] = entitiesToUse;\n const {\n data: mainSchemas = {},\n loading: schemasLoading,\n error: schemasError\n } = useGetEntitySchemasAsObj([updatedParentEntity, ...entitiesToUse]);\n\n const { [updatedParentEntity]: currentSchema = {}, [filterEntity]: filterEntitySchema = {} } =\n mainSchemas;\n\n const {\n data: requiredSchema = {},\n loading: requiredSchemaLoading,\n error: requiredSchemaError\n } = useGetEntitySchemasAsObj(\n getRequiredSchemas([...filterByProperty, ...sortbyFilters], filterEntitySchema),\n schemasLoading\n );\n const inheritedFilters = getInheritedFilters(filterBy, filterByProperty);\n const queryProps = getQueryProps(inheritedFilters, currentSchema, filterEntitySchema);\n const { actions = {} } = currentSchema || {};\n const getAction = isPreview ? actions.get : actions.getPublished;\n\n const {\n data: { entityData = {} } = {},\n error: itemQueryError,\n loading: itemQueryLoading\n } = useQuery(generateSingleItemQuery(getAction, queryProps), {\n variables: { id: parentId },\n skip: schemasLoading || (!inheritedFilters.length && queryProps === ID)\n });\n\n const {\n data: itemListData = {},\n error: itemListError,\n loading: itemListLoading\n } = useQuery(getItemList, {\n variables: { id: itemListId },\n skip: !itemListId\n });\n\n if (!hasRequiredItemListDetails({ itemListName, router, itemListId, queryItemListId })) return '';\n\n const errorsToCheck = [schemasError, requiredSchemaError, itemQueryError, itemListError];\n const { hasErr, errMsg } = checkForError(errorsToCheck);\n\n if (requiredSchemaLoading || schemasLoading || itemQueryLoading || itemListLoading) return '';\n if (hasErr) return errMsg;\n\n const itemListIds = getItemListIds(itemListData);\n const isCard = !type.includes(FULL);\n const isAZ = type.includes(AZ_LIST_TYPE);\n const genericProps = getGenericProps(props);\n const [textFilter] = getSearchFilterType(searchFilter, TEXT_SEARCH);\n const shouldApplyTextFilter = textFilter && textFilter.propsToDisplay.length;\n const operator = shouldApplyTextFilter ? getElasticsearchOperator(textFilter) : AND_OPERATOR;\n const valuesText = shouldApplyTextFilter\n ? buildSearchValuesText(textFilter, updatedQuery, name)\n : [];\n const { valuesAnd, valuesOr } = getQueryFilters(searchFilter, updatedQuery, name);\n\n const searchValues = {\n searchValuesText: valuesText,\n searchValuesCheckboxSelectRange: valuesAnd,\n searchValuesCheckboxOr: valuesOr\n };\n const listProps = {\n ...props,\n ...genericProps,\n query: updatedQuery,\n url,\n isCard,\n isAZ,\n router,\n sort: null,\n sortby: null,\n sortProperties: updatedSortProperties,\n azFilter,\n searchValues,\n filterEntitySchema,\n requiredSchema,\n currentSchema,\n omitWrappers,\n operator,\n paginationIndex,\n entityData,\n inheritedFilters,\n filterOperator,\n itemListIds,\n entities: entitiesToUse,\n mainSchemas\n };\n\n return (\n <VariantContext.Provider value={VariantComponent}>\n <ListBuilder {...listProps} />\n </VariantContext.Provider>\n );\n};\n\nListFactory.propTypes = {\n parent: PropTypes.object.isRequired,\n type: PropTypes.string.isRequired,\n entity: PropTypes.string,\n entities: PropTypes.array,\n filterBy: PropTypes.array,\n filterByProperty: PropTypes.array,\n omitWrappers: PropTypes.bool,\n operator: PropTypes.string,\n name: PropTypes.string,\n sortby: PropTypes.array,\n sort: PropTypes.string,\n allSearchFilters: PropTypes.array,\n sortProperties: PropTypes.array,\n itemListName: PropTypes.string,\n VariantComponent: PropTypes.func\n};\n\nListFactory.defaultProps = {\n entity: '',\n entities: [],\n filterBy: [],\n filterByProperty: [],\n omitWrappers: false,\n name: '',\n sortby: [],\n sortProperties: [],\n sort: '',\n operator: AND,\n allSearchFilters: [],\n itemListName: '',\n VariantComponent: null\n};\n\nexport default ListFactory;\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,QAAQ,QAAQ,cAAc;AACvC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,WAAW,QAAQ,8BAA8B;AAC1D,SAASC,uBAAuB,EAAEC,WAAW,QAAQ,yBAAyB;AAC9E,OAAOC,WAAW,MAAM,eAAe;AACvC,SAASC,YAAY,QAAQ,aAAa;AAC1C,SACEC,gBAAgB,EAChBC,YAAY,EACZC,0BAA0B,EAC1BC,2BAA2B,EAC3BC,YAAY,QACP,WAAW;AAClB,SACEC,eAAe,EACfC,kBAAkB,EAClBC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M;EACtBtF,gBAAgB,EAAEhD,SAAS,CAACuI,KAAK;EACjCpF,cAAc,EAAEnD,SAAS,CAACuI,KAAK;EAC/BnF,YAAY,EAAEpD,SAAS,CAACsI,MAAM;EAC9BjF,gBAAgB,EAAErD,SAAS,CAACyI;AAC9B,CAAC;AAEDxG,WAAW,CAACyG,YAAY,GAAG;EACzBvG,MAAM,EAAE,EAAE;EACVE,QAAQ,EAAE,EAAE;EACZI,QAAQ,EAAE,EAAE;EACZD,gBAAgB,EAAE,EAAE;EACpBE,YAAY,EAAE,KAAK;EACnBH,IAAI,EAAE,EAAE;EACRK,MAAM,EAAE,EAAE;EACVO,cAAc,EAAE,EAAE;EAClBL,IAAI,EAAE,EAAE;EACRG,QAAQ,EAAEpB,GAAG;EACbmB,gBAAgB,EAAE,EAAE;EACpBI,YAAY,EAAE,EAAE;EAChBC,gBAAgB,EAAE;AACpB,CAAC;AAED,eAAepB,WAAW","ignoreList":[]}
|
|
@@ -6,44 +6,39 @@ import React, { useContext } from 'react';
|
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import { Waypoint } from 'react-waypoint';
|
|
8
8
|
import { MainContext } from '@blaze-cms/nextjs-components';
|
|
9
|
+
import { VariantContext } from '../../ListFactory';
|
|
9
10
|
import BuildPBComponents from '../../../../hooks/helpers/buildPBComponents';
|
|
10
11
|
import Banner from '../../../Banner';
|
|
11
12
|
import { parsePropsToDisplay, shouldRenderWaypoint } from '../../../../helpers';
|
|
12
|
-
const FullRenderItem =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
13
|
+
const FullRenderItem = props => {
|
|
14
|
+
const {
|
|
15
|
+
isInfinite,
|
|
16
|
+
pageBuilderComponents,
|
|
17
|
+
entityProps,
|
|
18
|
+
propsToDisplay,
|
|
19
|
+
entity,
|
|
20
|
+
index,
|
|
21
|
+
itemId,
|
|
22
|
+
listTotal,
|
|
23
|
+
initialOffset,
|
|
24
|
+
currentListLength,
|
|
25
|
+
triggerInfiniteScroll,
|
|
26
|
+
parent,
|
|
27
|
+
pageBuilderID,
|
|
28
|
+
displayCount,
|
|
29
|
+
shouldRenderBanner,
|
|
30
|
+
bannerProps,
|
|
31
|
+
bannerIndex
|
|
32
|
+
} = props;
|
|
31
33
|
const {
|
|
32
34
|
hasGTM
|
|
33
35
|
} = useContext(MainContext);
|
|
36
|
+
const VariantComponent = useContext(VariantContext);
|
|
34
37
|
if (!pageBuilderComponents) return null;
|
|
35
38
|
const parsedPropsToDisplay = parsePropsToDisplay(entityProps, propsToDisplay);
|
|
36
39
|
const currentItemIndex = initialOffset + index;
|
|
37
40
|
const renderWaypoint = isInfinite && shouldRenderWaypoint(index, currentListLength, currentItemIndex, listTotal);
|
|
38
|
-
|
|
39
|
-
onEnter: triggerInfiniteScroll
|
|
40
|
-
}), displayCount && /*#__PURE__*/React.createElement("div", {
|
|
41
|
-
className: "heading heading--section heading--section--count"
|
|
42
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
43
|
-
className: "section-number"
|
|
44
|
-
}, currentItemIndex + 1), /*#__PURE__*/React.createElement("span", {
|
|
45
|
-
className: "section-total"
|
|
46
|
-
}, "/", listTotal)), /*#__PURE__*/React.createElement("div", {
|
|
41
|
+
const defaultContent = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
47
42
|
className: "list__item list__item--full"
|
|
48
43
|
}, BuildPBComponents(pageBuilderComponents, {
|
|
49
44
|
parent: _objectSpread(_objectSpread({}, parent), {}, {
|
|
@@ -52,9 +47,18 @@ const FullRenderItem = ({
|
|
|
52
47
|
}),
|
|
53
48
|
hasGTM,
|
|
54
49
|
pageBuilderID
|
|
55
|
-
})), !!parsedPropsToDisplay.length && /*#__PURE__*/React.createElement(React.Fragment, null, parsedPropsToDisplay.map(prop => prop ? /*#__PURE__*/React.createElement("span", {
|
|
50
|
+
})), !VariantComponent && !!parsedPropsToDisplay.length && /*#__PURE__*/React.createElement(React.Fragment, null, parsedPropsToDisplay.map(prop => prop ? /*#__PURE__*/React.createElement("span", {
|
|
56
51
|
key: prop
|
|
57
|
-
}, prop) : null))
|
|
52
|
+
}, prop) : null)));
|
|
53
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, renderWaypoint && /*#__PURE__*/React.createElement(Waypoint, {
|
|
54
|
+
onEnter: triggerInfiniteScroll
|
|
55
|
+
}), displayCount && /*#__PURE__*/React.createElement("div", {
|
|
56
|
+
className: "heading heading--section heading--section--count"
|
|
57
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
58
|
+
className: "section-number"
|
|
59
|
+
}, currentItemIndex + 1), /*#__PURE__*/React.createElement("span", {
|
|
60
|
+
className: "section-total"
|
|
61
|
+
}, "/", listTotal)), VariantComponent ? /*#__PURE__*/React.createElement(VariantComponent, props, defaultContent) : defaultContent, shouldRenderBanner && /*#__PURE__*/React.createElement(Banner, _extends({}, bannerProps, {
|
|
58
62
|
renderCounter: bannerIndex
|
|
59
63
|
})));
|
|
60
64
|
};
|