@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":"FullRenderItem.js","names":["React","useContext","PropTypes","Waypoint","MainContext","BuildPBComponents","Banner","parsePropsToDisplay","shouldRenderWaypoint","FullRenderItem","isInfinite","pageBuilderComponents","entityProps","propsToDisplay","entity","index","itemId","listTotal","initialOffset","currentListLength","triggerInfiniteScroll","parent","pageBuilderID","displayCount","shouldRenderBanner","bannerProps","bannerIndex","hasGTM","parsedPropsToDisplay","currentItemIndex","renderWaypoint","
|
|
1
|
+
{"version":3,"file":"FullRenderItem.js","names":["React","useContext","PropTypes","Waypoint","MainContext","VariantContext","BuildPBComponents","Banner","parsePropsToDisplay","shouldRenderWaypoint","FullRenderItem","props","isInfinite","pageBuilderComponents","entityProps","propsToDisplay","entity","index","itemId","listTotal","initialOffset","currentListLength","triggerInfiniteScroll","parent","pageBuilderID","displayCount","shouldRenderBanner","bannerProps","bannerIndex","hasGTM","VariantComponent","parsedPropsToDisplay","currentItemIndex","renderWaypoint","defaultContent","createElement","Fragment","className","_objectSpread","itemEntity","length","map","prop","key","onEnter","_extends","renderCounter","propTypes","array","object","isRequired","number","bool","func","string","data","itemsToDisplay","defaultProps"],"sources":["../../../../../src/components/List/components/Full/FullRenderItem.js"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport { Waypoint } from 'react-waypoint';\nimport { MainContext } from '@blaze-cms/nextjs-components';\nimport { VariantContext } from '../../ListFactory';\nimport BuildPBComponents from '../../../../hooks/helpers/buildPBComponents';\nimport Banner from '../../../Banner';\nimport { parsePropsToDisplay, shouldRenderWaypoint } from '../../../../helpers';\n\nconst FullRenderItem = props => {\n const {\n isInfinite,\n pageBuilderComponents,\n entityProps,\n propsToDisplay,\n entity,\n index,\n itemId,\n listTotal,\n initialOffset,\n currentListLength,\n triggerInfiniteScroll,\n parent,\n pageBuilderID,\n displayCount,\n shouldRenderBanner,\n bannerProps,\n bannerIndex\n } = props;\n const { hasGTM } = useContext(MainContext);\n const VariantComponent = useContext(VariantContext);\n\n if (!pageBuilderComponents) return null;\n const parsedPropsToDisplay = parsePropsToDisplay(entityProps, propsToDisplay);\n const currentItemIndex = initialOffset + index;\n const renderWaypoint =\n isInfinite && shouldRenderWaypoint(index, currentListLength, currentItemIndex, listTotal);\n\n const defaultContent = (\n <>\n <div className=\"list__item list__item--full\">\n {BuildPBComponents(pageBuilderComponents, {\n parent: { ...parent, itemId, itemEntity: entity },\n hasGTM,\n pageBuilderID\n })}\n </div>\n {!VariantComponent &&\n !!parsedPropsToDisplay.length && (\n <>{parsedPropsToDisplay.map(prop => (prop ? <span key={prop}>{prop}</span> : null))}</>\n )}\n </>\n );\n\n return (\n <>\n {renderWaypoint && <Waypoint onEnter={triggerInfiniteScroll} />}\n {displayCount && (\n <div className=\"heading heading--section heading--section--count\">\n <span className=\"section-number\">{currentItemIndex + 1}</span>\n <span className=\"section-total\">/{listTotal}</span>\n </div>\n )}\n {VariantComponent ? (\n <VariantComponent {...props}>{defaultContent}</VariantComponent>\n ) : (\n defaultContent\n )}\n\n {shouldRenderBanner && <Banner {...bannerProps} renderCounter={bannerIndex} />}\n </>\n );\n};\n\nFullRenderItem.propTypes = {\n pageBuilderComponents: PropTypes.array,\n entityProps: PropTypes.object.isRequired,\n parent: PropTypes.object.isRequired,\n currentListLength: PropTypes.number.isRequired,\n listTotal: PropTypes.number.isRequired,\n initialOffset: PropTypes.number.isRequired,\n displayCount: PropTypes.bool.isRequired,\n triggerInfiniteScroll: PropTypes.func,\n entity: PropTypes.string.isRequired,\n pageBuilderID: PropTypes.string.isRequired,\n itemId: PropTypes.string.isRequired,\n index: PropTypes.number.isRequired,\n isInfinite: PropTypes.bool.isRequired,\n shouldRenderBanner: PropTypes.bool.isRequired,\n bannerIndex: PropTypes.number.isRequired,\n propsToDisplay: PropTypes.array,\n data: PropTypes.array,\n itemsToDisplay: PropTypes.array,\n bannerProps: PropTypes.object\n};\n\nFullRenderItem.defaultProps = {\n pageBuilderComponents: null,\n data: [],\n propsToDisplay: [],\n itemsToDisplay: [],\n triggerInfiniteScroll: null,\n bannerProps: null\n};\n\nexport default FullRenderItem;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,WAAW,QAAQ,8BAA8B;AAC1D,SAASC,cAAc,QAAQ,mBAAmB;AAClD,OAAOC,iBAAiB,MAAM,6CAA6C;AA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EAAEpB,SAAS,CAACmD,IAAI;EACrCrC,MAAM,EAAEd,SAAS,CAACoD,MAAM,CAACJ,UAAU;EACnC1B,aAAa,EAAEtB,SAAS,CAACoD,MAAM,CAACJ,UAAU;EAC1ChC,MAAM,EAAEhB,SAAS,CAACoD,MAAM,CAACJ,UAAU;EACnCjC,KAAK,EAAEf,SAAS,CAACiD,MAAM,CAACD,UAAU;EAClCtC,UAAU,EAAEV,SAAS,CAACkD,IAAI,CAACF,UAAU;EACrCxB,kBAAkB,EAAExB,SAAS,CAACkD,IAAI,CAACF,UAAU;EAC7CtB,WAAW,EAAE1B,SAAS,CAACiD,MAAM,CAACD,UAAU;EACxCnC,cAAc,EAAEb,SAAS,CAAC8C,KAAK;EAC/BO,IAAI,EAAErD,SAAS,CAAC8C,KAAK;EACrBQ,cAAc,EAAEtD,SAAS,CAAC8C,KAAK;EAC/BrB,WAAW,EAAEzB,SAAS,CAAC+C;AACzB,CAAC;AAEDvC,cAAc,CAAC+C,YAAY,GAAG;EAC5B5C,qBAAqB,EAAE,IAAI;EAC3B0C,IAAI,EAAE,EAAE;EACRxC,cAAc,EAAE,EAAE;EAClByC,cAAc,EAAE,EAAE;EAClBlC,qBAAqB,EAAE,IAAI;EAC3BK,WAAW,EAAE;AACf,CAAC;AAED,eAAejB,cAAc","ignoreList":[]}
|
|
@@ -64,7 +64,7 @@ const getTypeBaseProps = (entitySchema, cardOptions, extraPropsHaveCategory) =>
|
|
|
64
64
|
dynamicProperties,
|
|
65
65
|
relations
|
|
66
66
|
} = entitySchema;
|
|
67
|
-
const isContent = !!interfaces.includes('content/content');
|
|
67
|
+
const isContent = !!interfaces.includes('content/content-base');
|
|
68
68
|
const hasCategory = checkProps(properties) || checkProps(dynamicProperties);
|
|
69
69
|
const hasPreheader = properties[PREHEADER_PROP];
|
|
70
70
|
const typeBasedProps = [...defaultProps];
|
|
@@ -81,7 +81,9 @@ const getTypeBaseProps = (entitySchema, cardOptions, extraPropsHaveCategory) =>
|
|
|
81
81
|
shouldAddCategoryProps
|
|
82
82
|
};
|
|
83
83
|
};
|
|
84
|
-
|
|
84
|
+
|
|
85
|
+
// make sure all props are supported by content/content-base interface
|
|
86
|
+
const getContentProps = isContent => isContent ? ['url', 'sponsored', 'featured', 'live'] : [];
|
|
85
87
|
const getCategoyProps = (shouldAddCategoryProps, hasCategory, hasPreheader) => {
|
|
86
88
|
if (!shouldAddCategoryProps) return [];
|
|
87
89
|
const props = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-props-query.js","names":["CATEGORY_ID","ID","PREHEADER_PROP","HEADLINE_PROP","defaultProps","categoryProps","checkProps","props","Object","keys","filter","prop","length","buildPropsQuery","entitySchema","extraProps","cardOptions","linkProps","parsedSchema","getEntitySchema","extraPropsHaveCategory","includes","typeBasedProps","shouldAddCategoryProps","getTypeBaseProps","allProps","uniqueProps","Set","basicProps","nestedProps","forEach","push","base","nested","split","complexProps","buildComplexProps","join","relations","dynamicProperties","properties","map","hasLink","find","linkProp","matchingProperty","matchingRelation","localField","matchingDynamicProp","dynamicKey","jointNestedProps","isCard","displayCategory","displayThumbnail","interfaces","isContent","hasCategory","hasPreheader","getCategoyProps","getContentProps","url"],"sources":["../../src/helpers/build-props-query.js"],"sourcesContent":["import { CATEGORY_ID, ID, PREHEADER_PROP, HEADLINE_PROP } from '../constants';\n\nconst defaultProps = [ID, 'name'];\nconst categoryProps = 'id publishedListingPage{id, url}';\n\nconst checkProps = props =>\n !!(props && Object.keys(props).filter(prop => prop === CATEGORY_ID).length);\n\nconst buildPropsQuery = (entitySchema, extraProps = [], cardOptions = null, linkProps = []) => {\n const parsedSchema = entitySchema.getEntitySchema ? entitySchema.getEntitySchema : entitySchema;\n const extraPropsHaveCategory = !!extraProps.filter(prop => prop.includes('category.')).length;\n const { typeBasedProps, shouldAddCategoryProps } = getTypeBaseProps(\n parsedSchema,\n cardOptions,\n extraPropsHaveCategory\n );\n\n const allProps = [...typeBasedProps, ...extraProps];\n const uniqueProps = [...new Set([...allProps])];\n const basicProps = [];\n const nestedProps = {};\n uniqueProps.forEach(prop => {\n if (prop) {\n if (!prop.includes('.')) {\n basicProps.push(prop);\n return;\n }\n const [base, nested] = prop.split('.');\n if (!nestedProps[base]) nestedProps[base] = [nested];\n else nestedProps[base].push(nested);\n }\n });\n\n const complexProps = buildComplexProps(\n shouldAddCategoryProps,\n nestedProps,\n parsedSchema,\n linkProps\n );\n\n return [...basicProps, ...complexProps].join(',');\n};\n\nconst buildComplexProps = (\n shouldAddCategoryProps,\n props,\n { relations = [], dynamicProperties = {}, properties = {} },\n linkProps\n) =>\n Object.keys(props).map(base => {\n const nestedProps = props[base];\n const hasLink = !!linkProps.find(linkProp => linkProp.includes(base));\n const matchingProperty = !!properties[base];\n const matchingRelation = relations.find(({ localField }) => localField === base);\n const matchingDynamicProp = Object.keys(dynamicProperties).find(\n dynamicKey => dynamicKey === base\n );\n\n if (matchingRelation && !nestedProps.includes('id')) nestedProps.push('id');\n if (hasLink && (!!matchingProperty || !!matchingRelation || !!matchingDynamicProp))\n nestedProps.push('url');\n const jointNestedProps = nestedProps.join(',');\n if (base === 'category' && shouldAddCategoryProps)\n return `${base}{${jointNestedProps}, ${categoryProps}}`;\n if (base.includes('published')) {\n return `${base}{${jointNestedProps},url}`;\n }\n return `${base}{${jointNestedProps}}`;\n });\n\nconst getTypeBaseProps = (entitySchema, cardOptions, extraPropsHaveCategory) => {\n const isCard = !!cardOptions;\n const { displayCategory = true, displayThumbnail = true } = cardOptions || {};\n\n const shouldAddCategoryProps =\n (isCard && displayCategory) || (!isCard && !extraPropsHaveCategory);\n\n if (!isCard) return { typeBasedProps: [ID], shouldAddCategoryProps };\n\n const { interfaces, properties, dynamicProperties, relations } = entitySchema;\n\n const isContent = !!interfaces.includes('content/content');\n const hasCategory = checkProps(properties) || checkProps(dynamicProperties);\n const hasPreheader = properties[PREHEADER_PROP];\n\n const typeBasedProps = [...defaultProps];\n\n typeBasedProps.push(...getCategoyProps(shouldAddCategoryProps, hasCategory, hasPreheader));\n typeBasedProps.push(...getContentProps(isContent));\n\n if (properties.url || dynamicProperties.url) typeBasedProps.push('url');\n\n if (displayThumbnail && relations.find(({ localField }) => localField === 'image')) {\n typeBasedProps.push('image.id', 'image.url', 'image.data');\n }\n\n return { typeBasedProps, shouldAddCategoryProps };\n};\n\nconst getContentProps = isContent => (isContent ? ['url', 'sponsored', 'featured'] : []);\n\nconst getCategoyProps = (shouldAddCategoryProps, hasCategory, hasPreheader) => {\n if (!shouldAddCategoryProps) return [];\n const props = [];\n if (hasCategory)\n props.push('category.name', 'category.listingPageId', 'category.listingPageEntity');\n\n if (hasPreheader) {\n props.push(`${PREHEADER_PROP}{name}`);\n props.push(HEADLINE_PROP);\n }\n\n return props;\n};\n\nexport default buildPropsQuery;\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,EAAE,EAAEC,cAAc,EAAEC,aAAa,QAAQ,cAAc;AAE7E,MAAMC,YAAY,GAAG,CAACH,EAAE,EAAE,MAAM,CAAC;AACjC,MAAMI,aAAa,GAAG,kCAAkC;AAExD,MAAMC,UAAU,GAAGC,KAAK,IACtB,CAAC,EAAEA,KAAK,IAAIC,MAAM,CAACC,IAAI,CAACF,KAAK,CAAC,CAACG,MAAM,CAACC,IAAI,IAAIA,IAAI,KAAKX,WAAW,CAAC,CAACY,MAAM,CAAC;AAE7E,MAAMC,eAAe,GAAGA,CAACC,YAAY,EAAEC,UAAU,GAAG,EAAE,EAAEC,WAAW,GAAG,IAAI,EAAEC,SAAS,GAAG,EAAE,KAAK;EAC7F,MAAMC,YAAY,GAAGJ,YAAY,CAACK,eAAe,GAAGL,YAAY,CAACK,eAAe,GAAGL,YAAY;EAC/F,MAAMM,sBAAsB,GAAG,CAAC,CAACL,UAAU,CAACL,MAAM,CAACC,IAAI,IAAIA,IAAI,CAACU,QAAQ,CAAC,WAAW,CAAC,CAAC,CAACT,MAAM;EAC7F,MAAM;IAAEU,cAAc;IAAEC;EAAuB,CAAC,GAAGC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,IAAI;IAAEC,gBAAgB,GAAG;EAAK,CAAC,GAAGrC,WAAW,IAAI,CAAC,CAAC;EAE7E,MAAMO,sBAAsB,GACzB4B,MAAM,IAAIC,eAAe,IAAM,CAACD,MAAM,IAAI,CAAC/B,sBAAuB;EAErE,IAAI,CAAC+B,MAAM,EAAE,OAAO;IAAE7B,cAAc,EAAE,CAACrB,EAAE,CAAC;IAAEsB;EAAuB,CAAC;EAEpE,MAAM;IAAE+B,UAAU;IAAEd,UAAU;IAAED,iBAAiB;IAAED;EAAU,CAAC,GAAGxB,YAAY;EAE7E,MAAMyC,SAAS,GAAG,CAAC,CAACD,UAAU,CAACjC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"build-props-query.js","names":["CATEGORY_ID","ID","PREHEADER_PROP","HEADLINE_PROP","defaultProps","categoryProps","checkProps","props","Object","keys","filter","prop","length","buildPropsQuery","entitySchema","extraProps","cardOptions","linkProps","parsedSchema","getEntitySchema","extraPropsHaveCategory","includes","typeBasedProps","shouldAddCategoryProps","getTypeBaseProps","allProps","uniqueProps","Set","basicProps","nestedProps","forEach","push","base","nested","split","complexProps","buildComplexProps","join","relations","dynamicProperties","properties","map","hasLink","find","linkProp","matchingProperty","matchingRelation","localField","matchingDynamicProp","dynamicKey","jointNestedProps","isCard","displayCategory","displayThumbnail","interfaces","isContent","hasCategory","hasPreheader","getCategoyProps","getContentProps","url"],"sources":["../../src/helpers/build-props-query.js"],"sourcesContent":["import { CATEGORY_ID, ID, PREHEADER_PROP, HEADLINE_PROP } from '../constants';\n\nconst defaultProps = [ID, 'name'];\nconst categoryProps = 'id publishedListingPage{id, url}';\n\nconst checkProps = props =>\n !!(props && Object.keys(props).filter(prop => prop === CATEGORY_ID).length);\n\nconst buildPropsQuery = (entitySchema, extraProps = [], cardOptions = null, linkProps = []) => {\n const parsedSchema = entitySchema.getEntitySchema ? entitySchema.getEntitySchema : entitySchema;\n const extraPropsHaveCategory = !!extraProps.filter(prop => prop.includes('category.')).length;\n const { typeBasedProps, shouldAddCategoryProps } = getTypeBaseProps(\n parsedSchema,\n cardOptions,\n extraPropsHaveCategory\n );\n\n const allProps = [...typeBasedProps, ...extraProps];\n const uniqueProps = [...new Set([...allProps])];\n const basicProps = [];\n const nestedProps = {};\n uniqueProps.forEach(prop => {\n if (prop) {\n if (!prop.includes('.')) {\n basicProps.push(prop);\n return;\n }\n const [base, nested] = prop.split('.');\n if (!nestedProps[base]) nestedProps[base] = [nested];\n else nestedProps[base].push(nested);\n }\n });\n\n const complexProps = buildComplexProps(\n shouldAddCategoryProps,\n nestedProps,\n parsedSchema,\n linkProps\n );\n\n return [...basicProps, ...complexProps].join(',');\n};\n\nconst buildComplexProps = (\n shouldAddCategoryProps,\n props,\n { relations = [], dynamicProperties = {}, properties = {} },\n linkProps\n) =>\n Object.keys(props).map(base => {\n const nestedProps = props[base];\n const hasLink = !!linkProps.find(linkProp => linkProp.includes(base));\n const matchingProperty = !!properties[base];\n const matchingRelation = relations.find(({ localField }) => localField === base);\n const matchingDynamicProp = Object.keys(dynamicProperties).find(\n dynamicKey => dynamicKey === base\n );\n\n if (matchingRelation && !nestedProps.includes('id')) nestedProps.push('id');\n if (hasLink && (!!matchingProperty || !!matchingRelation || !!matchingDynamicProp))\n nestedProps.push('url');\n const jointNestedProps = nestedProps.join(',');\n if (base === 'category' && shouldAddCategoryProps)\n return `${base}{${jointNestedProps}, ${categoryProps}}`;\n if (base.includes('published')) {\n return `${base}{${jointNestedProps},url}`;\n }\n return `${base}{${jointNestedProps}}`;\n });\n\nconst getTypeBaseProps = (entitySchema, cardOptions, extraPropsHaveCategory) => {\n const isCard = !!cardOptions;\n const { displayCategory = true, displayThumbnail = true } = cardOptions || {};\n\n const shouldAddCategoryProps =\n (isCard && displayCategory) || (!isCard && !extraPropsHaveCategory);\n\n if (!isCard) return { typeBasedProps: [ID], shouldAddCategoryProps };\n\n const { interfaces, properties, dynamicProperties, relations } = entitySchema;\n\n const isContent = !!interfaces.includes('content/content-base');\n const hasCategory = checkProps(properties) || checkProps(dynamicProperties);\n const hasPreheader = properties[PREHEADER_PROP];\n\n const typeBasedProps = [...defaultProps];\n\n typeBasedProps.push(...getCategoyProps(shouldAddCategoryProps, hasCategory, hasPreheader));\n typeBasedProps.push(...getContentProps(isContent));\n\n if (properties.url || dynamicProperties.url) typeBasedProps.push('url');\n\n if (displayThumbnail && relations.find(({ localField }) => localField === 'image')) {\n typeBasedProps.push('image.id', 'image.url', 'image.data');\n }\n\n return { typeBasedProps, shouldAddCategoryProps };\n};\n\n// make sure all props are supported by content/content-base interface\nconst getContentProps = isContent => (isContent ? ['url', 'sponsored', 'featured', 'live'] : []);\n\nconst getCategoyProps = (shouldAddCategoryProps, hasCategory, hasPreheader) => {\n if (!shouldAddCategoryProps) return [];\n const props = [];\n if (hasCategory)\n props.push('category.name', 'category.listingPageId', 'category.listingPageEntity');\n\n if (hasPreheader) {\n props.push(`${PREHEADER_PROP}{name}`);\n props.push(HEADLINE_PROP);\n }\n\n return props;\n};\n\nexport default buildPropsQuery;\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,EAAE,EAAEC,cAAc,EAAEC,aAAa,QAAQ,cAAc;AAE7E,MAAMC,YAAY,GAAG,CAACH,EAAE,EAAE,MAAM,CAAC;AACjC,MAAMI,aAAa,GAAG,kCAAkC;AAExD,MAAMC,UAAU,GAAGC,KAAK,IACtB,CAAC,EAAEA,KAAK,IAAIC,MAAM,CAACC,IAAI,CAACF,KAAK,CAAC,CAACG,MAAM,CAACC,IAAI,IAAIA,IAAI,KAAKX,WAAW,CAAC,CAACY,MAAM,CAAC;AAE7E,MAAMC,eAAe,GAAGA,CAACC,YAAY,EAAEC,UAAU,GAAG,EAAE,EAAEC,WAAW,GAAG,IAAI,EAAEC,SAAS,GAAG,EAAE,KAAK;EAC7F,MAAMC,YAAY,GAAGJ,YAAY,CAACK,eAAe,GAAGL,YAAY,CAACK,eAAe,GAAGL,YAAY;EAC/F,MAAMM,sBAAsB,GAAG,CAAC,CAAC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,EAAE,YAAY,CAAC;EAC5D;EAEA,OAAO;IAAET,cAAc;IAAEC;EAAuB,CAAC;AACnD,CAAC;;AAED;AACA,MAAMoC,eAAe,GAAGJ,SAAS,IAAKA,SAAS,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,CAAC,GAAG,EAAG;AAEhG,MAAMG,eAAe,GAAGA,CAACnC,sBAAsB,EAAEiC,WAAW,EAAEC,YAAY,KAAK;EAC7E,IAAI,CAAClC,sBAAsB,EAAE,OAAO,EAAE;EACtC,MAAMhB,KAAK,GAAG,EAAE;EAChB,IAAIiD,WAAW,EACbjD,KAAK,CAACwB,IAAI,CAAC,eAAe,EAAE,wBAAwB,EAAE,4BAA4B,CAAC;EAErF,IAAI0B,YAAY,EAAE;IAChBlD,KAAK,CAACwB,IAAI,CAAC,GAAG7B,cAAc,QAAQ,CAAC;IACrCK,KAAK,CAACwB,IAAI,CAAC5B,aAAa,CAAC;EAC3B;EAEA,OAAOI,KAAK;AACd,CAAC;AAED,eAAeM,eAAe","ignoreList":[]}
|
package/lib-es/index.js
CHANGED
|
@@ -7,7 +7,7 @@ export { default as variants } from './variants';
|
|
|
7
7
|
export { default as LoadingComponent } from './components/Loading';
|
|
8
8
|
export { default as Modal } from './components/ModalAdapter';
|
|
9
9
|
export { default as ErrorMessage } from './components/ErrorMessage';
|
|
10
|
-
export { getAction, generateSingleItemQuery, generateMultiItemQuery, getEntitySchema, getSingleEntitySchema, getUser } from './application/query';
|
|
10
|
+
export { getAction, generateSingleItemQuery, generateMultiItemQuery, getEntitySchema, getSingleEntitySchema, getUser, getCurrentUser } from './application/query';
|
|
11
11
|
export { getInheritedFilters, getQueryProps, buildRawQuery, buildPropsQuery, buildRawQueryStringified, buildFiltersQuery, getUnpublishedEntityName, renderChildren, hasChildren } from './helpers';
|
|
12
12
|
export { withTitle } from './HOC';
|
|
13
13
|
export { useGetEntitySchema, useGetEntitySchemasAsObj, useGetSingleEntitySchema } from './hooks';
|
package/lib-es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","buildPBComponents","getLightboxImages","getComponent","componentMap","variantHandler","getClassModifiers","components","variants","LoadingComponent","Modal","ErrorMessage","getAction","generateSingleItemQuery","generateMultiItemQuery","getEntitySchema","getSingleEntitySchema","getUser","getInheritedFilters","getQueryProps","buildRawQuery","buildPropsQuery","buildRawQueryStringified","buildFiltersQuery","getUnpublishedEntityName","renderChildren","hasChildren","withTitle","useGetEntitySchema","useGetEntitySchemasAsObj","useGetSingleEntitySchema","summaryComponents","buildPropsToDisplayWithContent"],"sources":["../src/index.js"],"sourcesContent":["export { default as buildPBComponents } from './hooks/helpers/buildPBComponents';\nexport { default as getLightboxImages } from './hooks/helpers/get-lightbox-images';\nexport { default as getComponent } from './hooks/helpers/getComponent';\nexport { componentMap, variantHandler, getClassModifiers } from './utils';\nexport { default as components } from './components';\nexport { default as variants } from './variants';\nexport { default as LoadingComponent } from './components/Loading';\nexport { default as Modal } from './components/ModalAdapter';\nexport { default as ErrorMessage } from './components/ErrorMessage';\nexport {\n getAction,\n generateSingleItemQuery,\n generateMultiItemQuery,\n getEntitySchema,\n getSingleEntitySchema,\n getUser\n} from './application/query';\nexport {\n getInheritedFilters,\n getQueryProps,\n buildRawQuery,\n buildPropsQuery,\n buildRawQueryStringified,\n buildFiltersQuery,\n getUnpublishedEntityName,\n renderChildren,\n hasChildren\n} from './helpers';\nexport { withTitle } from './HOC';\nexport { useGetEntitySchema, useGetEntitySchemasAsObj, useGetSingleEntitySchema } from './hooks';\nexport { summaryComponents } from './components/DataSummary/DataSummaryTypes';\nexport { buildPropsToDisplayWithContent } from './components/DataSummary/helpers';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,iBAAiB,QAAQ,mCAAmC;AAChF,SAASD,OAAO,IAAIE,iBAAiB,QAAQ,qCAAqC;AAClF,SAASF,OAAO,IAAIG,YAAY,QAAQ,8BAA8B;AACtE,SAASC,YAAY,EAAEC,cAAc,EAAEC,iBAAiB,QAAQ,SAAS;AACzE,SAASN,OAAO,IAAIO,UAAU,QAAQ,cAAc;AACpD,SAASP,OAAO,IAAIQ,QAAQ,QAAQ,YAAY;AAChD,SAASR,OAAO,IAAIS,gBAAgB,QAAQ,sBAAsB;AAClE,SAAST,OAAO,IAAIU,KAAK,QAAQ,2BAA2B;AAC5D,SAASV,OAAO,IAAIW,YAAY,QAAQ,2BAA2B;AACnE,SACEC,SAAS,EACTC,uBAAuB,EACvBC,sBAAsB,EACtBC,eAAe,EACfC,qBAAqB,EACrBC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","buildPBComponents","getLightboxImages","getComponent","componentMap","variantHandler","getClassModifiers","components","variants","LoadingComponent","Modal","ErrorMessage","getAction","generateSingleItemQuery","generateMultiItemQuery","getEntitySchema","getSingleEntitySchema","getUser","getCurrentUser","getInheritedFilters","getQueryProps","buildRawQuery","buildPropsQuery","buildRawQueryStringified","buildFiltersQuery","getUnpublishedEntityName","renderChildren","hasChildren","withTitle","useGetEntitySchema","useGetEntitySchemasAsObj","useGetSingleEntitySchema","summaryComponents","buildPropsToDisplayWithContent"],"sources":["../src/index.js"],"sourcesContent":["export { default as buildPBComponents } from './hooks/helpers/buildPBComponents';\nexport { default as getLightboxImages } from './hooks/helpers/get-lightbox-images';\nexport { default as getComponent } from './hooks/helpers/getComponent';\nexport { componentMap, variantHandler, getClassModifiers } from './utils';\nexport { default as components } from './components';\nexport { default as variants } from './variants';\nexport { default as LoadingComponent } from './components/Loading';\nexport { default as Modal } from './components/ModalAdapter';\nexport { default as ErrorMessage } from './components/ErrorMessage';\nexport {\n getAction,\n generateSingleItemQuery,\n generateMultiItemQuery,\n getEntitySchema,\n getSingleEntitySchema,\n getUser,\n getCurrentUser\n} from './application/query';\nexport {\n getInheritedFilters,\n getQueryProps,\n buildRawQuery,\n buildPropsQuery,\n buildRawQueryStringified,\n buildFiltersQuery,\n getUnpublishedEntityName,\n renderChildren,\n hasChildren\n} from './helpers';\nexport { withTitle } from './HOC';\nexport { useGetEntitySchema, useGetEntitySchemasAsObj, useGetSingleEntitySchema } from './hooks';\nexport { summaryComponents } from './components/DataSummary/DataSummaryTypes';\nexport { buildPropsToDisplayWithContent } from './components/DataSummary/helpers';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,iBAAiB,QAAQ,mCAAmC;AAChF,SAASD,OAAO,IAAIE,iBAAiB,QAAQ,qCAAqC;AAClF,SAASF,OAAO,IAAIG,YAAY,QAAQ,8BAA8B;AACtE,SAASC,YAAY,EAAEC,cAAc,EAAEC,iBAAiB,QAAQ,SAAS;AACzE,SAASN,OAAO,IAAIO,UAAU,QAAQ,cAAc;AACpD,SAASP,OAAO,IAAIQ,QAAQ,QAAQ,YAAY;AAChD,SAASR,OAAO,IAAIS,gBAAgB,QAAQ,sBAAsB;AAClE,SAAST,OAAO,IAAIU,KAAK,QAAQ,2BAA2B;AAC5D,SAASV,OAAO,IAAIW,YAAY,QAAQ,2BAA2B;AACnE,SACEC,SAAS,EACTC,uBAAuB,EACvBC,sBAAsB,EACtBC,eAAe,EACfC,qBAAqB,EACrBC,OAAO,EACPC,cAAc,QACT,qBAAqB;AAC5B,SACEC,mBAAmB,EACnBC,aAAa,EACbC,aAAa,EACbC,eAAe,EACfC,wBAAwB,EACxBC,iBAAiB,EACjBC,wBAAwB,EACxBC,cAAc,EACdC,WAAW,QACN,WAAW;AAClB,SAASC,SAAS,QAAQ,OAAO;AACjC,SAASC,kBAAkB,EAAEC,wBAAwB,EAAEC,wBAAwB,QAAQ,SAAS;AAChG,SAASC,iBAAiB,QAAQ,2CAA2C;AAC7E,SAASC,8BAA8B,QAAQ,kCAAkC","ignoreList":[]}
|
|
@@ -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: ' ',\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":"AAAA,OAAOA,KAAK,IAAIC,MAAM,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAC1D,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,YAAY,MAAM,2BAA2B;AACpD,OAAOC,MAAM,MAAM,qBAAqB;AACxC,SAASC,MAAM,EAAEC,OAAO,QAAQ,gBAAgB;AAChD,SAASC,cAAc,QAAQ,gBAAgB;AAE/CL,KAAK,CAACM,MAAM,CAACL,YAAY,CAAC;AAE1B,MAAMM,YAAY,GAAGC,KAAK,IAAI;EAC5B,MAAM;IAAEC,QAAQ;IAAEC,IAAI;IAAEC,SAAS;IAAEC;EAAS,CAAC,GAAGJ,KAAK;EACrD,MAAM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ACrC,MAAM;IAACoC,SAAS,EAAC,kBAAkB;IAACG,OAAO,EAAEP,cAAe;IAACQ,IAAI,EAAC;EAAQ,GACxE7B,UAAU,gBACTjB,KAAA,CAAA2C,aAAA,CAAA3C,KAAA,CAAA+C,QAAA,qBACE/C,KAAA,CAAA2C,aAAA,CAACnC,OAAO;IAACkC,SAAS,EAAC;EAAa,CAAE,CAAC,cACnC,CAAC,gBAEH1C,KAAA,CAAA2C,aAAA,CAAA3C,KAAA,CAAA+C,QAAA,qBACE/C,KAAA,CAAA2C,aAAA,CAACpC,MAAM;IAACmC,SAAS,EAAC;EAAa,CAAE,CAAC,cAClC,CAEE,CACL,CAEJ,CAAC;AAEV,CAAC;AAED,eAAe/B,YAAY","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":[]}
|
package/lib-es/variants/index.js
CHANGED
|
@@ -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;
|
|
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.
|
|
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.
|
|
31
|
-
"@blaze-cms/core-errors": "0.146.0-node18-core-styles.
|
|
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.
|
|
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.
|
|
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": "
|
|
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 {
|
|
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 ?
|
|
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;
|
|
@@ -65,7 +65,7 @@ const ListBuilder = props => {
|
|
|
65
65
|
const limitToUse = limit || itemsToDisplayToUse.length;
|
|
66
66
|
const shouldApplyDefaultSort = !sortProperties || !sortProperties.length;
|
|
67
67
|
const itemsPerPageToUse = getItemsPerPageToUse(itemsPerPage, limitToUse);
|
|
68
|
-
const initialOffset = getCurrentOffset(offset, itemsPerPageToUse, paginationIndex
|
|
68
|
+
const initialOffset = getCurrentOffset(limitToUse, offset, itemsPerPageToUse, paginationIndex);
|
|
69
69
|
const fields = buildQueryFields(entityFields, entityTypes, !isCard);
|
|
70
70
|
const action = getSearchPublishedContent(fields);
|
|
71
71
|
const actionKey = SEARCH_PUBLISHED_CONTENT;
|