@blaze-cms/plugin-gtm-fe 0.146.0-core-styles.43 → 0.146.0-node18.0
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 +10 -160
- package/lib/GoogleTagManager/GTMFactory.js +3 -3
- package/lib/GoogleTagManager/GTMFactory.js.map +1 -1
- package/lib/GoogleTagManager/GTMRender.js +5 -5
- package/lib/GoogleTagManager/GTMRender.js.map +1 -1
- package/lib/GoogleTagManager/index.js.map +1 -1
- package/lib/GoogleTagManagerEvent/GTMClickEvent.js +5 -5
- package/lib/GoogleTagManagerEvent/GTMClickEvent.js.map +1 -1
- package/lib/GoogleTagManagerEvent/GTMClickEvents.js +2 -1
- package/lib/GoogleTagManagerEvent/GTMClickEvents.js.map +1 -1
- package/lib/GoogleTagManagerEvent/GTMEvent.js +3 -3
- package/lib/GoogleTagManagerEvent/GTMEvent.js.map +1 -1
- package/lib/GoogleTagManagerEvent/GTMEventFactory.js +6 -6
- package/lib/GoogleTagManagerEvent/GTMEventFactory.js.map +1 -1
- package/lib/GoogleTagManagerEvent/GTMEventRender.js +7 -7
- package/lib/GoogleTagManagerEvent/GTMEventRender.js.map +1 -1
- package/lib/GoogleTagManagerEvent/GTMEventSwitch.js.map +1 -1
- package/lib/GoogleTagManagerEvent/index.js.map +1 -1
- package/lib/constants.js.map +1 -1
- package/lib/helpers/build-and-push-web-vitals.js.map +1 -1
- package/lib/helpers/build-data-layer.js +7 -7
- package/lib/helpers/build-data-layer.js.map +1 -1
- package/lib/helpers/build-nested-event.js +5 -5
- package/lib/helpers/build-nested-event.js.map +1 -1
- package/lib/helpers/build-props-to-display-array.js +1 -1
- package/lib/helpers/build-props-to-display-array.js.map +1 -1
- package/lib/helpers/build-user-layer.js +1 -1
- package/lib/helpers/build-user-layer.js.map +1 -1
- package/lib/helpers/build-user-query-props.js +3 -3
- package/lib/helpers/build-user-query-props.js.map +1 -1
- package/lib/helpers/filter-gtm-events.js.map +1 -1
- package/lib/helpers/get-ids-to-use.js +1 -0
- package/lib/helpers/get-ids-to-use.js.map +1 -1
- package/lib/helpers/get-render-props.js.map +1 -1
- package/lib/helpers/index.js.map +1 -1
- package/lib/helpers/push-to-data-layer.js.map +1 -1
- package/lib/helpers/reset-data-layer.js +3 -3
- package/lib/helpers/reset-data-layer.js.map +1 -1
- package/lib/index.js +7 -7
- package/lib/index.js.map +1 -1
- package/lib-es/GoogleTagManager/GTMFactory.js.map +1 -1
- package/lib-es/GoogleTagManager/GTMRender.js.map +1 -1
- package/lib-es/GoogleTagManager/index.js.map +1 -1
- package/lib-es/GoogleTagManagerEvent/GTMClickEvent.js.map +1 -1
- package/lib-es/GoogleTagManagerEvent/GTMClickEvents.js.map +1 -1
- package/lib-es/GoogleTagManagerEvent/GTMEvent.js.map +1 -1
- package/lib-es/GoogleTagManagerEvent/GTMEventFactory.js.map +1 -1
- package/lib-es/GoogleTagManagerEvent/GTMEventRender.js.map +1 -1
- package/lib-es/GoogleTagManagerEvent/GTMEventSwitch.js.map +1 -1
- package/lib-es/GoogleTagManagerEvent/index.js.map +1 -1
- package/lib-es/constants.js.map +1 -1
- package/lib-es/helpers/build-and-push-web-vitals.js.map +1 -1
- package/lib-es/helpers/build-data-layer.js.map +1 -1
- package/lib-es/helpers/build-nested-event.js.map +1 -1
- package/lib-es/helpers/build-props-to-display-array.js.map +1 -1
- package/lib-es/helpers/build-user-layer.js.map +1 -1
- package/lib-es/helpers/build-user-query-props.js.map +1 -1
- package/lib-es/helpers/filter-gtm-events.js.map +1 -1
- package/lib-es/helpers/get-ids-to-use.js.map +1 -1
- package/lib-es/helpers/get-render-props.js.map +1 -1
- package/lib-es/helpers/index.js.map +1 -1
- package/lib-es/helpers/push-to-data-layer.js.map +1 -1
- package/lib-es/helpers/reset-data-layer.js.map +1 -1
- package/lib-es/index.js +2 -2
- package/lib-es/index.js.map +1 -1
- package/package.json +13 -13
- package/src/GoogleTagManagerEvent/GTMEvent.js +3 -6
- package/src/index.js +5 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GTMEventRender.js","names":["React","useState","PropTypes","useQuery","checkIfLoggedIn","getUser","withRouter","GTMEvent","buildDataLayer","buildNestedEvent","buildUserQueryProps","buildUserLayer","GTMEventRender","_ref","router","action","actionKey","queryVariables","parentComponent","userPropsToDisplay","handleOnSuccess","eventProps","_objectWithoutProperties","_excluded","asPath","currentLocation","setCurrentLocation","data","error","loading","id","userId","hasUserProps","length","userProps","userData","userLoading","variables","skip","gtmData","entityData","eventTrigger","propsToDisplay","eventEcommerce","dataLayerProps","dataLayerObject","userLayerObject","extendedDataLayer","_objectSpread","createElement","propTypes","array","object","isRequired","string","func","defaultProps"],"sources":["../../src/GoogleTagManagerEvent/GTMEventRender.js"],"sourcesContent":["import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { useQuery } from '@apollo/client';\nimport { checkIfLoggedIn } from '@blaze-cms/core-auth-ui';\nimport { getUser } from '@blaze-cms/react-page-builder';\nimport { withRouter } from 'next/router';\nimport GTMEvent from './GTMEvent';\nimport { buildDataLayer, buildNestedEvent, buildUserQueryProps, buildUserLayer } from '../helpers';\n\nconst GTMEventRender = ({\n router,\n action,\n actionKey,\n queryVariables,\n parentComponent,\n userPropsToDisplay,\n handleOnSuccess,\n ...eventProps\n}) => {\n const { asPath } = router;\n const [currentLocation, setCurrentLocation] = useState('');\n const { data = {}, error, loading } = useQuery(action, queryVariables);\n const { id: userId } = checkIfLoggedIn();\n const hasUserProps = userId && userPropsToDisplay && userPropsToDisplay.length;\n const userProps = hasUserProps ? buildUserQueryProps(userPropsToDisplay) : '';\n const { data: userData, loading: userLoading } = useQuery(getUser(userProps), {\n variables: { id: userId },\n skip: !hasUserProps\n });\n\n if (loading || userLoading || error) return null;\n const gtmData = data.entityData || data[actionKey];\n\n if (currentLocation !== asPath) {\n setCurrentLocation(asPath);\n return null;\n }\n\n const { eventTrigger, propsToDisplay, eventEcommerce } = eventProps;\n const dataLayerProps = buildDataLayer(gtmData, propsToDisplay);\n\n const dataLayerObject = buildNestedEvent(\n eventEcommerce,\n eventProps,\n dataLayerProps,\n parentComponent\n );\n const userLayerObject = buildUserLayer(userData, userPropsToDisplay);\n const extendedDataLayer = { ...dataLayerObject, ...userLayerObject };\n\n return (\n <GTMEvent\n dataLayerObject={extendedDataLayer}\n eventTrigger={eventTrigger}\n currentLocation={currentLocation}\n handleOnSuccess={handleOnSuccess}\n />\n );\n};\n\nGTMEventRender.propTypes = {\n userPropsToDisplay: PropTypes.array,\n router: PropTypes.object.isRequired,\n action: PropTypes.object.isRequired,\n actionKey: PropTypes.string.isRequired,\n queryVariables: PropTypes.object.isRequired,\n parentComponent: PropTypes.object.isRequired,\n handleOnSuccess: PropTypes.func\n};\n\nGTMEventRender.defaultProps = {\n userPropsToDisplay: [],\n handleOnSuccess: () => {}\n};\n\nGTMEventRender.defaultProps = {\n userPropsToDisplay: []\n};\n\nexport default withRouter(GTMEventRender);\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"GTMEventRender.js","names":["React","useState","PropTypes","useQuery","checkIfLoggedIn","getUser","withRouter","GTMEvent","buildDataLayer","buildNestedEvent","buildUserQueryProps","buildUserLayer","GTMEventRender","_ref","router","action","actionKey","queryVariables","parentComponent","userPropsToDisplay","handleOnSuccess","eventProps","_objectWithoutProperties","_excluded","asPath","currentLocation","setCurrentLocation","data","error","loading","id","userId","hasUserProps","length","userProps","userData","userLoading","variables","skip","gtmData","entityData","eventTrigger","propsToDisplay","eventEcommerce","dataLayerProps","dataLayerObject","userLayerObject","extendedDataLayer","_objectSpread","createElement","propTypes","array","object","isRequired","string","func","defaultProps"],"sources":["../../src/GoogleTagManagerEvent/GTMEventRender.js"],"sourcesContent":["import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { useQuery } from '@apollo/client';\nimport { checkIfLoggedIn } from '@blaze-cms/core-auth-ui';\nimport { getUser } from '@blaze-cms/react-page-builder';\nimport { withRouter } from 'next/router';\nimport GTMEvent from './GTMEvent';\nimport { buildDataLayer, buildNestedEvent, buildUserQueryProps, buildUserLayer } from '../helpers';\n\nconst GTMEventRender = ({\n router,\n action,\n actionKey,\n queryVariables,\n parentComponent,\n userPropsToDisplay,\n handleOnSuccess,\n ...eventProps\n}) => {\n const { asPath } = router;\n const [currentLocation, setCurrentLocation] = useState('');\n const { data = {}, error, loading } = useQuery(action, queryVariables);\n const { id: userId } = checkIfLoggedIn();\n const hasUserProps = userId && userPropsToDisplay && userPropsToDisplay.length;\n const userProps = hasUserProps ? buildUserQueryProps(userPropsToDisplay) : '';\n const { data: userData, loading: userLoading } = useQuery(getUser(userProps), {\n variables: { id: userId },\n skip: !hasUserProps\n });\n\n if (loading || userLoading || error) return null;\n const gtmData = data.entityData || data[actionKey];\n\n if (currentLocation !== asPath) {\n setCurrentLocation(asPath);\n return null;\n }\n\n const { eventTrigger, propsToDisplay, eventEcommerce } = eventProps;\n const dataLayerProps = buildDataLayer(gtmData, propsToDisplay);\n\n const dataLayerObject = buildNestedEvent(\n eventEcommerce,\n eventProps,\n dataLayerProps,\n parentComponent\n );\n const userLayerObject = buildUserLayer(userData, userPropsToDisplay);\n const extendedDataLayer = { ...dataLayerObject, ...userLayerObject };\n\n return (\n <GTMEvent\n dataLayerObject={extendedDataLayer}\n eventTrigger={eventTrigger}\n currentLocation={currentLocation}\n handleOnSuccess={handleOnSuccess}\n />\n );\n};\n\nGTMEventRender.propTypes = {\n userPropsToDisplay: PropTypes.array,\n router: PropTypes.object.isRequired,\n action: PropTypes.object.isRequired,\n actionKey: PropTypes.string.isRequired,\n queryVariables: PropTypes.object.isRequired,\n parentComponent: PropTypes.object.isRequired,\n handleOnSuccess: PropTypes.func\n};\n\nGTMEventRender.defaultProps = {\n userPropsToDisplay: [],\n handleOnSuccess: () => {}\n};\n\nGTMEventRender.defaultProps = {\n userPropsToDisplay: []\n};\n\nexport default withRouter(GTMEventRender);\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GTMEventSwitch.js","names":["React","PropTypes","GTMClickEvents","GTMEventFactory","filterGtmEvents","GTMEventSwitch","_ref","gtmEvents","clickState","clickId","props","_objectWithoutProperties","_excluded","window","length","clickEvents","regularEvents","GTMClickFactory","createElement","_extends","propTypes","string","array","bool","defaultProps"],"sources":["../../src/GoogleTagManagerEvent/GTMEventSwitch.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport GTMClickEvents from './GTMClickEvents';\nimport GTMEventFactory from './GTMEventFactory';\nimport { filterGtmEvents } from '../helpers';\n\nconst GTMEventSwitch = ({ gtmEvents, clickState, clickId, ...props }) => {\n if (typeof window === 'undefined' || !gtmEvents.length) return null;\n const { clickEvents, regularEvents } = filterGtmEvents(gtmEvents);\n const GTMClickFactory = clickId ? GTMEventFactory : GTMClickEvents;\n\n return clickState ? (\n <GTMClickFactory gtmEvents={clickEvents} clickId={clickId} {...props} />\n ) : (\n <GTMEventFactory gtmEvents={regularEvents} {...props} />\n );\n};\n\nGTMEventSwitch.propTypes = {\n clickId: PropTypes.string,\n gtmEvents: PropTypes.array,\n clickState: PropTypes.bool\n};\n\nGTMEventSwitch.defaultProps = {\n clickId: null,\n gtmEvents: [],\n clickState: false\n};\n\nexport default GTMEventSwitch;\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,eAAe,MAAM,mBAAmB;AAC/C,SAASC,eAAe,QAAQ,YAAY;AAE5C,MAAMC,cAAc,GAAGC,IAAA,IAAkD;EAAA,IAAjD;MAAEC,SAAS;MAAEC,UAAU;MAAEC;IAAkB,CAAC,GAAAH,IAAA;IAAPI,KAAK,GAAAC,wBAAA,CAAAL,IAAA,EAAAM,SAAA;EAChE,IAAI,OAAOC,MAAM,KAAK,WAAW,IAAI,CAACN,SAAS,CAACO,MAAM,EAAE,OAAO,IAAI;EACnE,MAAM;IAAEC,WAAW;IAAEC;EAAc,CAAC,GAAGZ,eAAe,CAACG,SAAS,CAAC;EACjE,MAAMU,eAAe,GAAGR,OAAO,GAAGN,eAAe,GAAGD,cAAc;EAElE,OAAOM,UAAU,gBACfR,KAAA,CAAAkB,aAAA,CAACD,eAAe,EAAAE,QAAA;IAACZ,SAAS,EAAEQ,WAAY;IAACN,OAAO,EAAEA;EAAQ,GAAKC,KAAK,CAAG,CAAC,gBAExEV,KAAA,CAAAkB,aAAA,CAACf,eAAe,EAAAgB,QAAA;IAACZ,SAAS,EAAES;EAAc,GAAKN,KAAK,CAAG,CACxD;AACH,CAAC;AAEDL,cAAc,CAACe,SAAS,GAAG;EACzBX,OAAO,EAAER,SAAS,CAACoB,MAAM;EACzBd,SAAS,EAAEN,SAAS,CAACqB,KAAK;EAC1Bd,UAAU,EAAEP,SAAS,CAACsB;AACxB,CAAC;AAEDlB,cAAc,CAACmB,YAAY,GAAG;EAC5Bf,OAAO,EAAE,IAAI;EACbF,SAAS,EAAE,EAAE;EACbC,UAAU,EAAE;AACd,CAAC;AAED,eAAeH,cAAc"}
|
|
1
|
+
{"version":3,"file":"GTMEventSwitch.js","names":["React","PropTypes","GTMClickEvents","GTMEventFactory","filterGtmEvents","GTMEventSwitch","_ref","gtmEvents","clickState","clickId","props","_objectWithoutProperties","_excluded","window","length","clickEvents","regularEvents","GTMClickFactory","createElement","_extends","propTypes","string","array","bool","defaultProps"],"sources":["../../src/GoogleTagManagerEvent/GTMEventSwitch.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport GTMClickEvents from './GTMClickEvents';\nimport GTMEventFactory from './GTMEventFactory';\nimport { filterGtmEvents } from '../helpers';\n\nconst GTMEventSwitch = ({ gtmEvents, clickState, clickId, ...props }) => {\n if (typeof window === 'undefined' || !gtmEvents.length) return null;\n const { clickEvents, regularEvents } = filterGtmEvents(gtmEvents);\n const GTMClickFactory = clickId ? GTMEventFactory : GTMClickEvents;\n\n return clickState ? (\n <GTMClickFactory gtmEvents={clickEvents} clickId={clickId} {...props} />\n ) : (\n <GTMEventFactory gtmEvents={regularEvents} {...props} />\n );\n};\n\nGTMEventSwitch.propTypes = {\n clickId: PropTypes.string,\n gtmEvents: PropTypes.array,\n clickState: PropTypes.bool\n};\n\nGTMEventSwitch.defaultProps = {\n clickId: null,\n gtmEvents: [],\n clickState: false\n};\n\nexport default GTMEventSwitch;\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,eAAe,MAAM,mBAAmB;AAC/C,SAASC,eAAe,QAAQ,YAAY;AAE5C,MAAMC,cAAc,GAAGC,IAAA,IAAkD;EAAA,IAAjD;MAAEC,SAAS;MAAEC,UAAU;MAAEC;IAAkB,CAAC,GAAAH,IAAA;IAAPI,KAAK,GAAAC,wBAAA,CAAAL,IAAA,EAAAM,SAAA;EAChE,IAAI,OAAOC,MAAM,KAAK,WAAW,IAAI,CAACN,SAAS,CAACO,MAAM,EAAE,OAAO,IAAI;EACnE,MAAM;IAAEC,WAAW;IAAEC;EAAc,CAAC,GAAGZ,eAAe,CAACG,SAAS,CAAC;EACjE,MAAMU,eAAe,GAAGR,OAAO,GAAGN,eAAe,GAAGD,cAAc;EAElE,OAAOM,UAAU,gBACfR,KAAA,CAAAkB,aAAA,CAACD,eAAe,EAAAE,QAAA;IAACZ,SAAS,EAAEQ,WAAY;IAACN,OAAO,EAAEA;EAAQ,GAAKC,KAAK,CAAG,CAAC,gBAExEV,KAAA,CAAAkB,aAAA,CAACf,eAAe,EAAAgB,QAAA;IAACZ,SAAS,EAAES;EAAc,GAAKN,KAAK,CAAG,CACxD;AACH,CAAC;AAEDL,cAAc,CAACe,SAAS,GAAG;EACzBX,OAAO,EAAER,SAAS,CAACoB,MAAM;EACzBd,SAAS,EAAEN,SAAS,CAACqB,KAAK;EAC1Bd,UAAU,EAAEP,SAAS,CAACsB;AACxB,CAAC;AAEDlB,cAAc,CAACmB,YAAY,GAAG;EAC5Bf,OAAO,EAAE,IAAI;EACbF,SAAS,EAAE,EAAE;EACbC,UAAU,EAAE;AACd,CAAC;AAED,eAAeH,cAAc","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["GTMEventSwitch"],"sources":["../../src/GoogleTagManagerEvent/index.js"],"sourcesContent":["import GTMEventSwitch from './GTMEventSwitch';\n\nexport default GTMEventSwitch;\n"],"mappings":"AAAA,OAAOA,cAAc,MAAM,kBAAkB;AAE7C,eAAeA,cAAc"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["GTMEventSwitch"],"sources":["../../src/GoogleTagManagerEvent/index.js"],"sourcesContent":["import GTMEventSwitch from './GTMEventSwitch';\n\nexport default GTMEventSwitch;\n"],"mappings":"AAAA,OAAOA,cAAc,MAAM,kBAAkB;AAE7C,eAAeA,cAAc","ignoreList":[]}
|
package/lib-es/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":["EVENT","ON_LOAD","ON_CLICK","IN_VIEW","ON_SUCCESS","PAGE_VIEW","ECOMMERCE","GTM_PROPS","key","label","GTM_EVENT_NAMES","productImpresion","productDetailImpression","productClick","promotionClick","GTM_EVENT_FACTORY","PLUGIN_NAME","PRODUCTS"],"sources":["../src/constants.js"],"sourcesContent":["const EVENT = 'event';\nconst ON_LOAD = 'onLoad';\nconst ON_CLICK = 'onClick';\nconst IN_VIEW = 'inView';\nconst ON_SUCCESS = 'onSuccess';\nconst PAGE_VIEW = 'pageView';\nconst ECOMMERCE = 'ecommerce';\nconst GTM_PROPS = [\n { key: 'eventAction' },\n { key: 'eventLabel' },\n { key: 'eventCategory' },\n { key: 'eventName', label: 'event' }\n];\nconst GTM_EVENT_NAMES = {\n productImpresion: 'impressions',\n productDetailImpression: 'detail',\n productClick: 'click',\n promotionClick: 'promotionClick'\n};\n\nconst GTM_EVENT_FACTORY = 'GtmEventFactory';\nconst PLUGIN_NAME = 'gtm-fe';\nconst PRODUCTS = 'products';\n\nexport {\n PLUGIN_NAME,\n EVENT,\n ECOMMERCE,\n GTM_PROPS,\n GTM_EVENT_NAMES,\n GTM_EVENT_FACTORY,\n ON_CLICK,\n IN_VIEW,\n ON_SUCCESS,\n ON_LOAD,\n PRODUCTS,\n PAGE_VIEW\n};\n"],"mappings":"AAAA,MAAMA,KAAK,GAAG,OAAO;AACrB,MAAMC,OAAO,GAAG,QAAQ;AACxB,MAAMC,QAAQ,GAAG,SAAS;AAC1B,MAAMC,OAAO,GAAG,QAAQ;AACxB,MAAMC,UAAU,GAAG,WAAW;AAC9B,MAAMC,SAAS,GAAG,UAAU;AAC5B,MAAMC,SAAS,GAAG,WAAW;AAC7B,MAAMC,SAAS,GAAG,CAChB;EAAEC,GAAG,EAAE;AAAc,CAAC,EACtB;EAAEA,GAAG,EAAE;AAAa,CAAC,EACrB;EAAEA,GAAG,EAAE;AAAgB,CAAC,EACxB;EAAEA,GAAG,EAAE,WAAW;EAAEC,KAAK,EAAE;AAAQ,CAAC,CACrC;AACD,MAAMC,eAAe,GAAG;EACtBC,gBAAgB,EAAE,aAAa;EAC/BC,uBAAuB,EAAE,QAAQ;EACjCC,YAAY,EAAE,OAAO;EACrBC,cAAc,EAAE;AAClB,CAAC;AAED,MAAMC,iBAAiB,GAAG,iBAAiB;AAC3C,MAAMC,WAAW,GAAG,QAAQ;AAC5B,MAAMC,QAAQ,GAAG,UAAU;AAE3B,SACED,WAAW,EACXhB,KAAK,EACLM,SAAS,EACTC,SAAS,EACTG,eAAe,EACfK,iBAAiB,EACjBb,QAAQ,EACRC,OAAO,EACPC,UAAU,EACVH,OAAO,EACPgB,QAAQ,EACRZ,SAAS"}
|
|
1
|
+
{"version":3,"file":"constants.js","names":["EVENT","ON_LOAD","ON_CLICK","IN_VIEW","ON_SUCCESS","PAGE_VIEW","ECOMMERCE","GTM_PROPS","key","label","GTM_EVENT_NAMES","productImpresion","productDetailImpression","productClick","promotionClick","GTM_EVENT_FACTORY","PLUGIN_NAME","PRODUCTS"],"sources":["../src/constants.js"],"sourcesContent":["const EVENT = 'event';\nconst ON_LOAD = 'onLoad';\nconst ON_CLICK = 'onClick';\nconst IN_VIEW = 'inView';\nconst ON_SUCCESS = 'onSuccess';\nconst PAGE_VIEW = 'pageView';\nconst ECOMMERCE = 'ecommerce';\nconst GTM_PROPS = [\n { key: 'eventAction' },\n { key: 'eventLabel' },\n { key: 'eventCategory' },\n { key: 'eventName', label: 'event' }\n];\nconst GTM_EVENT_NAMES = {\n productImpresion: 'impressions',\n productDetailImpression: 'detail',\n productClick: 'click',\n promotionClick: 'promotionClick'\n};\n\nconst GTM_EVENT_FACTORY = 'GtmEventFactory';\nconst PLUGIN_NAME = 'gtm-fe';\nconst PRODUCTS = 'products';\n\nexport {\n PLUGIN_NAME,\n EVENT,\n ECOMMERCE,\n GTM_PROPS,\n GTM_EVENT_NAMES,\n GTM_EVENT_FACTORY,\n ON_CLICK,\n IN_VIEW,\n ON_SUCCESS,\n ON_LOAD,\n PRODUCTS,\n PAGE_VIEW\n};\n"],"mappings":"AAAA,MAAMA,KAAK,GAAG,OAAO;AACrB,MAAMC,OAAO,GAAG,QAAQ;AACxB,MAAMC,QAAQ,GAAG,SAAS;AAC1B,MAAMC,OAAO,GAAG,QAAQ;AACxB,MAAMC,UAAU,GAAG,WAAW;AAC9B,MAAMC,SAAS,GAAG,UAAU;AAC5B,MAAMC,SAAS,GAAG,WAAW;AAC7B,MAAMC,SAAS,GAAG,CAChB;EAAEC,GAAG,EAAE;AAAc,CAAC,EACtB;EAAEA,GAAG,EAAE;AAAa,CAAC,EACrB;EAAEA,GAAG,EAAE;AAAgB,CAAC,EACxB;EAAEA,GAAG,EAAE,WAAW;EAAEC,KAAK,EAAE;AAAQ,CAAC,CACrC;AACD,MAAMC,eAAe,GAAG;EACtBC,gBAAgB,EAAE,aAAa;EAC/BC,uBAAuB,EAAE,QAAQ;EACjCC,YAAY,EAAE,OAAO;EACrBC,cAAc,EAAE;AAClB,CAAC;AAED,MAAMC,iBAAiB,GAAG,iBAAiB;AAC3C,MAAMC,WAAW,GAAG,QAAQ;AAC5B,MAAMC,QAAQ,GAAG,UAAU;AAE3B,SACED,WAAW,EACXhB,KAAK,EACLM,SAAS,EACTC,SAAS,EACTG,eAAe,EACfK,iBAAiB,EACjBb,QAAQ,EACRC,OAAO,EACPC,UAAU,EACVH,OAAO,EACPgB,QAAQ,EACRZ,SAAS","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-and-push-web-vitals.js","names":["getCLS","getFID","getLCP","pushToDataLayer","buildAndPushWebVitals","reportHandler","name","delta","id","metrics","event","event_category","event_action","event_value","Math","round","event_label","nonInteraction"],"sources":["../../src/helpers/build-and-push-web-vitals.js"],"sourcesContent":["import { getCLS, getFID, getLCP } from 'web-vitals';\nimport pushToDataLayer from './push-to-data-layer';\n\nconst buildAndPushWebVitals = () => {\n getCLS(reportHandler);\n getFID(reportHandler);\n getLCP(reportHandler);\n};\n\nconst reportHandler = ({ name, delta, id }) => {\n const metrics = {\n event: 'web-vitals',\n event_category: 'Web Vitals',\n event_action: name,\n event_value: Math.round(name === 'CLS' ? delta * 1000 : delta),\n event_label: id,\n nonInteraction: true\n };\n\n pushToDataLayer(metrics);\n};\n\nexport default buildAndPushWebVitals;\n"],"mappings":"AAAA,SAASA,MAAM,EAAEC,MAAM,EAAEC,MAAM,QAAQ,YAAY;AACnD,OAAOC,eAAe,MAAM,sBAAsB;AAElD,MAAMC,qBAAqB,GAAGA,CAAA,KAAM;EAClCJ,MAAM,CAACK,aAAa,CAAC;EACrBJ,MAAM,CAACI,aAAa,CAAC;EACrBH,MAAM,CAACG,aAAa,CAAC;AACvB,CAAC;AAED,MAAMA,aAAa,GAAGA,CAAC;EAAEC,IAAI;EAAEC,KAAK;EAAEC;AAAG,CAAC,KAAK;EAC7C,MAAMC,OAAO,GAAG;IACdC,KAAK,EAAE,YAAY;IACnBC,cAAc,EAAE,YAAY;IAC5BC,YAAY,EAAEN,IAAI;IAClBO,WAAW,EAAEC,IAAI,CAACC,KAAK,CAACT,IAAI,KAAK,KAAK,GAAGC,KAAK,GAAG,IAAI,GAAGA,KAAK,CAAC;IAC9DS,WAAW,EAAER,EAAE;IACfS,cAAc,EAAE;EAClB,CAAC;EAEDd,eAAe,CAACM,OAAO,CAAC;AAC1B,CAAC;AAED,eAAeL,qBAAqB"}
|
|
1
|
+
{"version":3,"file":"build-and-push-web-vitals.js","names":["getCLS","getFID","getLCP","pushToDataLayer","buildAndPushWebVitals","reportHandler","name","delta","id","metrics","event","event_category","event_action","event_value","Math","round","event_label","nonInteraction"],"sources":["../../src/helpers/build-and-push-web-vitals.js"],"sourcesContent":["import { getCLS, getFID, getLCP } from 'web-vitals';\nimport pushToDataLayer from './push-to-data-layer';\n\nconst buildAndPushWebVitals = () => {\n getCLS(reportHandler);\n getFID(reportHandler);\n getLCP(reportHandler);\n};\n\nconst reportHandler = ({ name, delta, id }) => {\n const metrics = {\n event: 'web-vitals',\n event_category: 'Web Vitals',\n event_action: name,\n event_value: Math.round(name === 'CLS' ? delta * 1000 : delta),\n event_label: id,\n nonInteraction: true\n };\n\n pushToDataLayer(metrics);\n};\n\nexport default buildAndPushWebVitals;\n"],"mappings":"AAAA,SAASA,MAAM,EAAEC,MAAM,EAAEC,MAAM,QAAQ,YAAY;AACnD,OAAOC,eAAe,MAAM,sBAAsB;AAElD,MAAMC,qBAAqB,GAAGA,CAAA,KAAM;EAClCJ,MAAM,CAACK,aAAa,CAAC;EACrBJ,MAAM,CAACI,aAAa,CAAC;EACrBH,MAAM,CAACG,aAAa,CAAC;AACvB,CAAC;AAED,MAAMA,aAAa,GAAGA,CAAC;EAAEC,IAAI;EAAEC,KAAK;EAAEC;AAAG,CAAC,KAAK;EAC7C,MAAMC,OAAO,GAAG;IACdC,KAAK,EAAE,YAAY;IACnBC,cAAc,EAAE,YAAY;IAC5BC,YAAY,EAAEN,IAAI;IAClBO,WAAW,EAAEC,IAAI,CAACC,KAAK,CAACT,IAAI,KAAK,KAAK,GAAGC,KAAK,GAAG,IAAI,GAAGA,KAAK,CAAC;IAC9DS,WAAW,EAAER,EAAE;IACfS,cAAc,EAAE;EAClB,CAAC;EAEDd,eAAe,CAACM,OAAO,CAAC;AAC1B,CAAC;AAED,eAAeL,qBAAqB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-data-layer.js","names":["getFinalValue","data","name","includes","relationName","fieldName","split","Array","isArray","reduce","str","element","index","buildProps","props","acc","label","key","propertiesToDisplay","staticMetric","buildDataLayerProps","map","currentData","buildDataLayer","propsToDisplay","url","length","propsToDisplayValues","_objectSpread","event"],"sources":["../../src/helpers/build-data-layer.js"],"sourcesContent":["const getFinalValue = (data, name) => {\n if (name.includes('.')) {\n const [relationName, fieldName] = name.split('.');\n if (Array.isArray(data[relationName])) {\n return data[relationName].reduce(\n (str, element, index) => `${str}${index ? ',' : ''}${element[fieldName]}`,\n ''\n );\n }\n\n return data[relationName] ? data[relationName][fieldName] : data[fieldName] || '';\n }\n return data[name];\n};\n\nconst buildProps = (props, data) =>\n props.reduce((acc, { label: key, propertiesToDisplay: [name], staticMetric }) => {\n if (key && (staticMetric || name)) {\n acc[key] = staticMetric || getFinalValue(data, name);\n }\n\n return acc;\n }, {});\n\nconst buildDataLayerProps = (props, data) =>\n Array.isArray(data)\n ? data.map(currentData => buildProps(props, currentData))\n : buildProps(props, data);\n\nconst buildDataLayer = (data, propsToDisplay, url) => {\n if (!propsToDisplay || !propsToDisplay.length) return null;\n const propsToDisplayValues = buildDataLayerProps(propsToDisplay, data);\n\n return url\n ? {\n event: 'pageView',\n url,\n ...propsToDisplayValues\n }\n : propsToDisplayValues;\n};\n\nexport default buildDataLayer;\n"],"mappings":";;;AAAA,MAAMA,aAAa,GAAGA,CAACC,IAAI,EAAEC,IAAI,KAAK;EACpC,IAAIA,IAAI,CAACC,QAAQ,CAAC,GAAG,CAAC,EAAE;IACtB,MAAM,CAACC,YAAY,EAAEC,SAAS,CAAC,GAAGH,IAAI,CAACI,KAAK,CAAC,GAAG,CAAC;IACjD,IAAIC,KAAK,CAACC,OAAO,CAACP,IAAI,CAACG,YAAY,CAAC,CAAC,EAAE;MACrC,OAAOH,IAAI,CAACG,YAAY,CAAC,CAACK,MAAM,CAC9B,CAACC,GAAG,EAAEC,OAAO,EAAEC,KAAK,
|
|
1
|
+
{"version":3,"file":"build-data-layer.js","names":["getFinalValue","data","name","includes","relationName","fieldName","split","Array","isArray","reduce","str","element","index","buildProps","props","acc","label","key","propertiesToDisplay","staticMetric","buildDataLayerProps","map","currentData","buildDataLayer","propsToDisplay","url","length","propsToDisplayValues","_objectSpread","event"],"sources":["../../src/helpers/build-data-layer.js"],"sourcesContent":["const getFinalValue = (data, name) => {\n if (name.includes('.')) {\n const [relationName, fieldName] = name.split('.');\n if (Array.isArray(data[relationName])) {\n return data[relationName].reduce(\n (str, element, index) => `${str}${index ? ',' : ''}${element[fieldName]}`,\n ''\n );\n }\n\n return data[relationName] ? data[relationName][fieldName] : data[fieldName] || '';\n }\n return data[name];\n};\n\nconst buildProps = (props, data) =>\n props.reduce((acc, { label: key, propertiesToDisplay: [name], staticMetric }) => {\n if (key && (staticMetric || name)) {\n acc[key] = staticMetric || getFinalValue(data, name);\n }\n\n return acc;\n }, {});\n\nconst buildDataLayerProps = (props, data) =>\n Array.isArray(data)\n ? data.map(currentData => buildProps(props, currentData))\n : buildProps(props, data);\n\nconst buildDataLayer = (data, propsToDisplay, url) => {\n if (!propsToDisplay || !propsToDisplay.length) return null;\n const propsToDisplayValues = buildDataLayerProps(propsToDisplay, data);\n\n return url\n ? {\n event: 'pageView',\n url,\n ...propsToDisplayValues\n }\n : propsToDisplayValues;\n};\n\nexport default buildDataLayer;\n"],"mappings":";;;AAAA,MAAMA,aAAa,GAAGA,CAACC,IAAI,EAAEC,IAAI,KAAK;EACpC,IAAIA,IAAI,CAACC,QAAQ,CAAC,GAAG,CAAC,EAAE;IACtB,MAAM,CAACC,YAAY,EAAEC,SAAS,CAAC,GAAGH,IAAI,CAACI,KAAK,CAAC,GAAG,CAAC;IACjD,IAAIC,KAAK,CAACC,OAAO,CAACP,IAAI,CAACG,YAAY,CAAC,CAAC,EAAE;MACrC,OAAOH,IAAI,CAACG,YAAY,CAAC,CAACK,MAAM,CAC9B,CAACC,GAAG,EAAEC,OAAO,EAAEC,KAAK,KAAK,GAAGF,GAAG,GAAGE,KAAK,GAAG,GAAG,GAAG,EAAE,GAAGD,OAAO,CAACN,SAAS,CAAC,EAAE,EACzE,EACF,CAAC;IACH;IAEA,OAAOJ,IAAI,CAACG,YAAY,CAAC,GAAGH,IAAI,CAACG,YAAY,CAAC,CAACC,SAAS,CAAC,GAAGJ,IAAI,CAACI,SAAS,CAAC,IAAI,EAAE;EACnF;EACA,OAAOJ,IAAI,CAACC,IAAI,CAAC;AACnB,CAAC;AAED,MAAMW,UAAU,GAAGA,CAACC,KAAK,EAAEb,IAAI,KAC7Ba,KAAK,CAACL,MAAM,CAAC,CAACM,GAAG,EAAE;EAAEC,KAAK,EAAEC,GAAG;EAAEC,mBAAmB,EAAE,CAAChB,IAAI,CAAC;EAAEiB;AAAa,CAAC,KAAK;EAC/E,IAAIF,GAAG,KAAKE,YAAY,IAAIjB,IAAI,CAAC,EAAE;IACjCa,GAAG,CAACE,GAAG,CAAC,GAAGE,YAAY,IAAInB,aAAa,CAACC,IAAI,EAAEC,IAAI,CAAC;EACtD;EAEA,OAAOa,GAAG;AACZ,CAAC,EAAE,CAAC,CAAC,CAAC;AAER,MAAMK,mBAAmB,GAAGA,CAACN,KAAK,EAAEb,IAAI,KACtCM,KAAK,CAACC,OAAO,CAACP,IAAI,CAAC,GACfA,IAAI,CAACoB,GAAG,CAACC,WAAW,IAAIT,UAAU,CAACC,KAAK,EAAEQ,WAAW,CAAC,CAAC,GACvDT,UAAU,CAACC,KAAK,EAAEb,IAAI,CAAC;AAE7B,MAAMsB,cAAc,GAAGA,CAACtB,IAAI,EAAEuB,cAAc,EAAEC,GAAG,KAAK;EACpD,IAAI,CAACD,cAAc,IAAI,CAACA,cAAc,CAACE,MAAM,EAAE,OAAO,IAAI;EAC1D,MAAMC,oBAAoB,GAAGP,mBAAmB,CAACI,cAAc,EAAEvB,IAAI,CAAC;EAEtE,OAAOwB,GAAG,GAAAG,aAAA;IAEJC,KAAK,EAAE,UAAU;IACjBJ;EAAG,GACAE,oBAAoB,IAEzBA,oBAAoB;AAC1B,CAAC;AAED,eAAeJ,cAAc","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-nested-event.js","names":["GTM_EVENT_NAMES","GTM_PROPS","EVENT","ECOMMERCE","PRODUCTS","ON_CLICK","buildNestedEvent","ecommerce","propsObject","props","parentComponent","productDetailImpression","productClick","eventAction","eventTrigger","name","gtmActionLabel","isClickEvent","actionField","list","hasMultipleItems","Array","isArray","basicEventObject","forEach","key","label","gtmValue","gtmKey","parsedProps","items","_objectSpread","parsedProducts","eventObject","ecommerceObject"],"sources":["../../src/helpers/build-nested-event.js"],"sourcesContent":["import { GTM_EVENT_NAMES, GTM_PROPS, EVENT, ECOMMERCE, PRODUCTS, ON_CLICK } from '../constants';\n\nconst buildNestedEvent = (ecommerce, propsObject, props, parentComponent) => {\n const { productDetailImpression, productClick } = GTM_EVENT_NAMES;\n const { eventAction, eventTrigger } = propsObject;\n const { name } = parentComponent;\n const gtmActionLabel = GTM_EVENT_NAMES[eventAction];\n const isClickEvent = eventTrigger === ON_CLICK || gtmActionLabel === productClick;\n const actionField = { list: name };\n const hasMultipleItems = Array.isArray(props);\n\n if (!ecommerce) {\n const basicEventObject = {};\n GTM_PROPS.forEach(({ key, label }) => {\n const gtmValue = propsObject[key];\n const gtmKey = label || key;\n if (gtmValue) basicEventObject[gtmKey] = gtmValue;\n });\n const parsedProps = hasMultipleItems ? { items: props } : props;\n\n return { ...basicEventObject, ...parsedProps };\n }\n\n if (!gtmActionLabel) return { [EVENT]: eventAction, [ECOMMERCE]: props };\n if (gtmActionLabel === productDetailImpression || gtmActionLabel === productClick) {\n const parsedProducts = hasMultipleItems ? props : [props];\n const eventObject = isClickEvent\n ? { [PRODUCTS]: parsedProducts, actionField }\n : { [PRODUCTS]: parsedProducts };\n return {\n [EVENT]: eventAction,\n [ECOMMERCE]: { [gtmActionLabel]: eventObject }\n };\n }\n\n const ecommerceObject = isClickEvent\n ? { [gtmActionLabel]: props, actionField }\n : { [gtmActionLabel]: props };\n return { [EVENT]: eventAction, [ECOMMERCE]: ecommerceObject };\n};\n\nexport default buildNestedEvent;\n"],"mappings":";;;AAAA,SAASA,eAAe,EAAEC,SAAS,EAAEC,KAAK,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,QAAQ,QAAQ,cAAc;AAE/F,MAAMC,gBAAgB,GAAGA,CAACC,SAAS,EAAEC,WAAW,EAAEC,KAAK,EAAEC,eAAe,KAAK;EAC3E,MAAM;IAAEC,uBAAuB;IAAEC;EAAa,CAAC,GAAGZ,eAAe;EACjE,MAAM;IAAEa,WAAW;IAAEC;EAAa,CAAC,GAAGN,WAAW;EACjD,MAAM;IAAEO;EAAK,CAAC,GAAGL,eAAe;EAChC,MAAMM,cAAc,GAAGhB,eAAe,CAACa,WAAW,CAAC;EACnD,MAAMI,YAAY,GAAGH,YAAY,KAAKT,QAAQ,IAAIW,cAAc,KAAKJ,YAAY;EACjF,MAAMM,WAAW,GAAG;IAAEC,IAAI,EAAEJ;EAAK,CAAC;EAClC,MAAMK,gBAAgB,GAAGC,KAAK,CAACC,OAAO,CAACb,KAAK,CAAC;EAE7C,IAAI,CAACF,SAAS,EAAE;IACd,MAAMgB,gBAAgB,GAAG,CAAC,CAAC;IAC3BtB,SAAS,CAACuB,OAAO,CAAC,CAAC;MAAEC,GAAG;MAAEC;IAAM,CAAC,KAAK;MACpC,MAAMC,QAAQ,GAAGnB,WAAW,CAACiB,GAAG,CAAC;MACjC,MAAMG,MAAM,GAAGF,KAAK,IAAID,GAAG;MAC3B,IAAIE,QAAQ,EAAEJ,gBAAgB,CAACK,MAAM,CAAC,GAAGD,QAAQ;IACnD,CAAC,CAAC;IACF,MAAME,WAAW,GAAGT,gBAAgB,GAAG;MAAEU,KAAK,EAAErB;IAAM,CAAC,GAAGA,KAAK;IAE/D,OAAAsB,aAAA,CAAAA,aAAA,KAAYR,gBAAgB,GAAKM,WAAW;EAC9C;EAEA,IAAI,CAACb,cAAc,EAAE,OAAO;IAAE,CAACd,KAAK,GAAGW,WAAW;IAAE,CAACV,SAAS,GAAGM;EAAM,CAAC;EACxE,IAAIO,cAAc,KAAKL,uBAAuB,IAAIK,cAAc,KAAKJ,YAAY,EAAE;IACjF,MAAMoB,cAAc,GAAGZ,gBAAgB,GAAGX,KAAK,GAAG,CAACA,KAAK,CAAC;IACzD,MAAMwB,WAAW,GAAGhB,YAAY,GAC5B;MAAE,CAACb,QAAQ,GAAG4B,cAAc;MAAEd;IAAY,CAAC,GAC3C;MAAE,CAACd,QAAQ,GAAG4B;IAAe,CAAC;IAClC,OAAO;MACL,CAAC9B,KAAK,GAAGW,WAAW;MACpB,CAACV,SAAS,GAAG;QAAE,CAACa,cAAc,GAAGiB;MAAY;IAC/C,CAAC;EACH;EAEA,MAAMC,eAAe,GAAGjB,YAAY,GAChC;IAAE,CAACD,cAAc,GAAGP,KAAK;IAAES;EAAY,CAAC,GACxC;IAAE,CAACF,cAAc,GAAGP;EAAM,CAAC;EAC/B,OAAO;IAAE,CAACP,KAAK,GAAGW,WAAW;IAAE,CAACV,SAAS,GAAG+B;EAAgB,CAAC;AAC/D,CAAC;AAED,eAAe5B,gBAAgB"}
|
|
1
|
+
{"version":3,"file":"build-nested-event.js","names":["GTM_EVENT_NAMES","GTM_PROPS","EVENT","ECOMMERCE","PRODUCTS","ON_CLICK","buildNestedEvent","ecommerce","propsObject","props","parentComponent","productDetailImpression","productClick","eventAction","eventTrigger","name","gtmActionLabel","isClickEvent","actionField","list","hasMultipleItems","Array","isArray","basicEventObject","forEach","key","label","gtmValue","gtmKey","parsedProps","items","_objectSpread","parsedProducts","eventObject","ecommerceObject"],"sources":["../../src/helpers/build-nested-event.js"],"sourcesContent":["import { GTM_EVENT_NAMES, GTM_PROPS, EVENT, ECOMMERCE, PRODUCTS, ON_CLICK } from '../constants';\n\nconst buildNestedEvent = (ecommerce, propsObject, props, parentComponent) => {\n const { productDetailImpression, productClick } = GTM_EVENT_NAMES;\n const { eventAction, eventTrigger } = propsObject;\n const { name } = parentComponent;\n const gtmActionLabel = GTM_EVENT_NAMES[eventAction];\n const isClickEvent = eventTrigger === ON_CLICK || gtmActionLabel === productClick;\n const actionField = { list: name };\n const hasMultipleItems = Array.isArray(props);\n\n if (!ecommerce) {\n const basicEventObject = {};\n GTM_PROPS.forEach(({ key, label }) => {\n const gtmValue = propsObject[key];\n const gtmKey = label || key;\n if (gtmValue) basicEventObject[gtmKey] = gtmValue;\n });\n const parsedProps = hasMultipleItems ? { items: props } : props;\n\n return { ...basicEventObject, ...parsedProps };\n }\n\n if (!gtmActionLabel) return { [EVENT]: eventAction, [ECOMMERCE]: props };\n if (gtmActionLabel === productDetailImpression || gtmActionLabel === productClick) {\n const parsedProducts = hasMultipleItems ? props : [props];\n const eventObject = isClickEvent\n ? { [PRODUCTS]: parsedProducts, actionField }\n : { [PRODUCTS]: parsedProducts };\n return {\n [EVENT]: eventAction,\n [ECOMMERCE]: { [gtmActionLabel]: eventObject }\n };\n }\n\n const ecommerceObject = isClickEvent\n ? { [gtmActionLabel]: props, actionField }\n : { [gtmActionLabel]: props };\n return { [EVENT]: eventAction, [ECOMMERCE]: ecommerceObject };\n};\n\nexport default buildNestedEvent;\n"],"mappings":";;;AAAA,SAASA,eAAe,EAAEC,SAAS,EAAEC,KAAK,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,QAAQ,QAAQ,cAAc;AAE/F,MAAMC,gBAAgB,GAAGA,CAACC,SAAS,EAAEC,WAAW,EAAEC,KAAK,EAAEC,eAAe,KAAK;EAC3E,MAAM;IAAEC,uBAAuB;IAAEC;EAAa,CAAC,GAAGZ,eAAe;EACjE,MAAM;IAAEa,WAAW;IAAEC;EAAa,CAAC,GAAGN,WAAW;EACjD,MAAM;IAAEO;EAAK,CAAC,GAAGL,eAAe;EAChC,MAAMM,cAAc,GAAGhB,eAAe,CAACa,WAAW,CAAC;EACnD,MAAMI,YAAY,GAAGH,YAAY,KAAKT,QAAQ,IAAIW,cAAc,KAAKJ,YAAY;EACjF,MAAMM,WAAW,GAAG;IAAEC,IAAI,EAAEJ;EAAK,CAAC;EAClC,MAAMK,gBAAgB,GAAGC,KAAK,CAACC,OAAO,CAACb,KAAK,CAAC;EAE7C,IAAI,CAACF,SAAS,EAAE;IACd,MAAMgB,gBAAgB,GAAG,CAAC,CAAC;IAC3BtB,SAAS,CAACuB,OAAO,CAAC,CAAC;MAAEC,GAAG;MAAEC;IAAM,CAAC,KAAK;MACpC,MAAMC,QAAQ,GAAGnB,WAAW,CAACiB,GAAG,CAAC;MACjC,MAAMG,MAAM,GAAGF,KAAK,IAAID,GAAG;MAC3B,IAAIE,QAAQ,EAAEJ,gBAAgB,CAACK,MAAM,CAAC,GAAGD,QAAQ;IACnD,CAAC,CAAC;IACF,MAAME,WAAW,GAAGT,gBAAgB,GAAG;MAAEU,KAAK,EAAErB;IAAM,CAAC,GAAGA,KAAK;IAE/D,OAAAsB,aAAA,CAAAA,aAAA,KAAYR,gBAAgB,GAAKM,WAAW;EAC9C;EAEA,IAAI,CAACb,cAAc,EAAE,OAAO;IAAE,CAACd,KAAK,GAAGW,WAAW;IAAE,CAACV,SAAS,GAAGM;EAAM,CAAC;EACxE,IAAIO,cAAc,KAAKL,uBAAuB,IAAIK,cAAc,KAAKJ,YAAY,EAAE;IACjF,MAAMoB,cAAc,GAAGZ,gBAAgB,GAAGX,KAAK,GAAG,CAACA,KAAK,CAAC;IACzD,MAAMwB,WAAW,GAAGhB,YAAY,GAC5B;MAAE,CAACb,QAAQ,GAAG4B,cAAc;MAAEd;IAAY,CAAC,GAC3C;MAAE,CAACd,QAAQ,GAAG4B;IAAe,CAAC;IAClC,OAAO;MACL,CAAC9B,KAAK,GAAGW,WAAW;MACpB,CAACV,SAAS,GAAG;QAAE,CAACa,cAAc,GAAGiB;MAAY;IAC/C,CAAC;EACH;EAEA,MAAMC,eAAe,GAAGjB,YAAY,GAChC;IAAE,CAACD,cAAc,GAAGP,KAAK;IAAES;EAAY,CAAC,GACxC;IAAE,CAACF,cAAc,GAAGP;EAAM,CAAC;EAC/B,OAAO;IAAE,CAACP,KAAK,GAAGW,WAAW;IAAE,CAACV,SAAS,GAAG+B;EAAgB,CAAC;AAC/D,CAAC;AAED,eAAe5B,gBAAgB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-props-to-display-array.js","names":["buildPropsToDisplayArray","propsToDisplay","map","prop","propertiesToDisplay","filter","Boolean"],"sources":["../../src/helpers/build-props-to-display-array.js"],"sourcesContent":["function buildPropsToDisplayArray(propsToDisplay = []) {\n return propsToDisplay\n .map(prop => !!prop && !!prop.propertiesToDisplay && prop.propertiesToDisplay[0])\n .filter(Boolean);\n}\n\nexport default buildPropsToDisplayArray;\n"],"mappings":"AAAA,SAASA,wBAAwBA,CAACC,cAAc,GAAG,EAAE,EAAE;EACrD,OAAOA,cAAc,CAClBC,GAAG,CAACC,IAAI,IAAI,CAAC,CAACA,IAAI,IAAI,CAAC,CAACA,IAAI,CAACC,mBAAmB,IAAID,IAAI,CAACC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAChFC,MAAM,CAACC,OAAO,CAAC;AACpB;AAEA,eAAeN,wBAAwB"}
|
|
1
|
+
{"version":3,"file":"build-props-to-display-array.js","names":["buildPropsToDisplayArray","propsToDisplay","map","prop","propertiesToDisplay","filter","Boolean"],"sources":["../../src/helpers/build-props-to-display-array.js"],"sourcesContent":["function buildPropsToDisplayArray(propsToDisplay = []) {\n return propsToDisplay\n .map(prop => !!prop && !!prop.propertiesToDisplay && prop.propertiesToDisplay[0])\n .filter(Boolean);\n}\n\nexport default buildPropsToDisplayArray;\n"],"mappings":"AAAA,SAASA,wBAAwBA,CAACC,cAAc,GAAG,EAAE,EAAE;EACrD,OAAOA,cAAc,CAClBC,GAAG,CAACC,IAAI,IAAI,CAAC,CAACA,IAAI,IAAI,CAAC,CAACA,IAAI,CAACC,mBAAmB,IAAID,IAAI,CAACC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAChFC,MAAM,CAACC,OAAO,CAAC;AACpB;AAEA,eAAeN,wBAAwB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-user-layer.js","names":["getValue","propertiesToDisplay","getUser","baseProp","nestedProp","split","baseValue","isArray","Array","nestedValue","length","map","nested","join","checkAndSetProps","userPropsToDisplay","userDataLayer","forEach","prop","label","staticMetric","value","buildUserLayer","userData","user"],"sources":["../../src/helpers/build-user-layer.js"],"sourcesContent":["const getValue = (propertiesToDisplay, getUser) => {\n const [baseProp, nestedProp] = propertiesToDisplay[0].split('.');\n const baseValue = getUser[baseProp];\n const isArray = Array.isArray(baseValue);\n if (nestedProp && baseValue) {\n let nestedValue;\n if (isArray) {\n nestedValue = baseValue.length\n ? baseValue.map(nested => (nested ? nested[nestedProp] : '')).join(', ')\n : '';\n } else {\n nestedValue = baseValue[nestedProp];\n }\n return nestedValue || '';\n }\n return baseValue || '';\n};\n\nconst checkAndSetProps = (userPropsToDisplay, getUser) => {\n const userDataLayer = {};\n userPropsToDisplay.forEach(prop => {\n const { propertiesToDisplay, label, staticMetric } = prop;\n if (staticMetric) {\n userDataLayer[label] = staticMetric;\n return;\n }\n if (!propertiesToDisplay[0]) return;\n const value = getValue(propertiesToDisplay, getUser);\n userDataLayer[label] = value;\n });\n\n return userDataLayer;\n};\n\nconst buildUserLayer = (userData, userPropsToDisplay) => {\n if (!userData || !userData.getUser) return {};\n const { getUser } = userData;\n\n const userDataLayer = checkAndSetProps(userPropsToDisplay, getUser);\n\n return { user: userDataLayer };\n};\n\nexport default buildUserLayer;\n"],"mappings":"AAAA,MAAMA,QAAQ,GAAGA,CAACC,mBAAmB,EAAEC,OAAO,KAAK;EACjD,MAAM,CAACC,QAAQ,EAAEC,UAAU,CAAC,GAAGH,mBAAmB,CAAC,CAAC,CAAC,CAACI,KAAK,CAAC,GAAG,CAAC;EAChE,MAAMC,SAAS,GAAGJ,OAAO,CAACC,QAAQ,CAAC;EACnC,MAAMI,OAAO,GAAGC,KAAK,CAACD,OAAO,CAACD,SAAS,CAAC;EACxC,IAAIF,UAAU,IAAIE,SAAS,EAAE;IAC3B,IAAIG,WAAW;IACf,IAAIF,OAAO,EAAE;MACXE,WAAW,GAAGH,SAAS,CAACI,MAAM,GAC1BJ,SAAS,CAACK,GAAG,CAACC,MAAM,IAAKA,MAAM,GAAGA,MAAM,CAACR,UAAU,CAAC,GAAG,EAAG,CAAC,CAACS,IAAI,CAAC,IAAI,CAAC,GACtE,EAAE;IACR,CAAC,MAAM;MACLJ,WAAW,GAAGH,SAAS,CAACF,UAAU,CAAC;IACrC;IACA,OAAOK,WAAW,IAAI,EAAE;EAC1B;EACA,OAAOH,SAAS,IAAI,EAAE;AACxB,CAAC;AAED,MAAMQ,gBAAgB,GAAGA,CAACC,kBAAkB,EAAEb,OAAO,KAAK;EACxD,MAAMc,aAAa,GAAG,CAAC,CAAC;EACxBD,kBAAkB,CAACE,OAAO,CAACC,IAAI,IAAI;IACjC,MAAM;MAAEjB,mBAAmB;MAAEkB,KAAK;MAAEC;IAAa,CAAC,GAAGF,IAAI;IACzD,IAAIE,YAAY,EAAE;MAChBJ,aAAa,CAACG,KAAK,CAAC,GAAGC,YAAY;MACnC;IACF;IACA,IAAI,CAACnB,mBAAmB,CAAC,CAAC,CAAC,EAAE;IAC7B,MAAMoB,KAAK,GAAGrB,QAAQ,CAACC,mBAAmB,EAAEC,OAAO,CAAC;IACpDc,aAAa,CAACG,KAAK,CAAC,GAAGE,KAAK;EAC9B,CAAC,CAAC;EAEF,OAAOL,aAAa;AACtB,CAAC;AAED,MAAMM,cAAc,GAAGA,CAACC,QAAQ,EAAER,kBAAkB,KAAK;EACvD,IAAI,CAACQ,QAAQ,IAAI,CAACA,QAAQ,CAACrB,OAAO,EAAE,OAAO,CAAC,CAAC;EAC7C,MAAM;IAAEA;EAAQ,CAAC,GAAGqB,QAAQ;EAE5B,MAAMP,aAAa,GAAGF,gBAAgB,CAACC,kBAAkB,EAAEb,OAAO,CAAC;EAEnE,OAAO;IAAEsB,IAAI,EAAER;EAAc,CAAC;AAChC,CAAC;AAED,eAAeM,cAAc"}
|
|
1
|
+
{"version":3,"file":"build-user-layer.js","names":["getValue","propertiesToDisplay","getUser","baseProp","nestedProp","split","baseValue","isArray","Array","nestedValue","length","map","nested","join","checkAndSetProps","userPropsToDisplay","userDataLayer","forEach","prop","label","staticMetric","value","buildUserLayer","userData","user"],"sources":["../../src/helpers/build-user-layer.js"],"sourcesContent":["const getValue = (propertiesToDisplay, getUser) => {\n const [baseProp, nestedProp] = propertiesToDisplay[0].split('.');\n const baseValue = getUser[baseProp];\n const isArray = Array.isArray(baseValue);\n if (nestedProp && baseValue) {\n let nestedValue;\n if (isArray) {\n nestedValue = baseValue.length\n ? baseValue.map(nested => (nested ? nested[nestedProp] : '')).join(', ')\n : '';\n } else {\n nestedValue = baseValue[nestedProp];\n }\n return nestedValue || '';\n }\n return baseValue || '';\n};\n\nconst checkAndSetProps = (userPropsToDisplay, getUser) => {\n const userDataLayer = {};\n userPropsToDisplay.forEach(prop => {\n const { propertiesToDisplay, label, staticMetric } = prop;\n if (staticMetric) {\n userDataLayer[label] = staticMetric;\n return;\n }\n if (!propertiesToDisplay[0]) return;\n const value = getValue(propertiesToDisplay, getUser);\n userDataLayer[label] = value;\n });\n\n return userDataLayer;\n};\n\nconst buildUserLayer = (userData, userPropsToDisplay) => {\n if (!userData || !userData.getUser) return {};\n const { getUser } = userData;\n\n const userDataLayer = checkAndSetProps(userPropsToDisplay, getUser);\n\n return { user: userDataLayer };\n};\n\nexport default buildUserLayer;\n"],"mappings":"AAAA,MAAMA,QAAQ,GAAGA,CAACC,mBAAmB,EAAEC,OAAO,KAAK;EACjD,MAAM,CAACC,QAAQ,EAAEC,UAAU,CAAC,GAAGH,mBAAmB,CAAC,CAAC,CAAC,CAACI,KAAK,CAAC,GAAG,CAAC;EAChE,MAAMC,SAAS,GAAGJ,OAAO,CAACC,QAAQ,CAAC;EACnC,MAAMI,OAAO,GAAGC,KAAK,CAACD,OAAO,CAACD,SAAS,CAAC;EACxC,IAAIF,UAAU,IAAIE,SAAS,EAAE;IAC3B,IAAIG,WAAW;IACf,IAAIF,OAAO,EAAE;MACXE,WAAW,GAAGH,SAAS,CAACI,MAAM,GAC1BJ,SAAS,CAACK,GAAG,CAACC,MAAM,IAAKA,MAAM,GAAGA,MAAM,CAACR,UAAU,CAAC,GAAG,EAAG,CAAC,CAACS,IAAI,CAAC,IAAI,CAAC,GACtE,EAAE;IACR,CAAC,MAAM;MACLJ,WAAW,GAAGH,SAAS,CAACF,UAAU,CAAC;IACrC;IACA,OAAOK,WAAW,IAAI,EAAE;EAC1B;EACA,OAAOH,SAAS,IAAI,EAAE;AACxB,CAAC;AAED,MAAMQ,gBAAgB,GAAGA,CAACC,kBAAkB,EAAEb,OAAO,KAAK;EACxD,MAAMc,aAAa,GAAG,CAAC,CAAC;EACxBD,kBAAkB,CAACE,OAAO,CAACC,IAAI,IAAI;IACjC,MAAM;MAAEjB,mBAAmB;MAAEkB,KAAK;MAAEC;IAAa,CAAC,GAAGF,IAAI;IACzD,IAAIE,YAAY,EAAE;MAChBJ,aAAa,CAACG,KAAK,CAAC,GAAGC,YAAY;MACnC;IACF;IACA,IAAI,CAACnB,mBAAmB,CAAC,CAAC,CAAC,EAAE;IAC7B,MAAMoB,KAAK,GAAGrB,QAAQ,CAACC,mBAAmB,EAAEC,OAAO,CAAC;IACpDc,aAAa,CAACG,KAAK,CAAC,GAAGE,KAAK;EAC9B,CAAC,CAAC;EAEF,OAAOL,aAAa;AACtB,CAAC;AAED,MAAMM,cAAc,GAAGA,CAACC,QAAQ,EAAER,kBAAkB,KAAK;EACvD,IAAI,CAACQ,QAAQ,IAAI,CAACA,QAAQ,CAACrB,OAAO,EAAE,OAAO,CAAC,CAAC;EAC7C,MAAM;IAAEA;EAAQ,CAAC,GAAGqB,QAAQ;EAE5B,MAAMP,aAAa,GAAGF,gBAAgB,CAACC,kBAAkB,EAAEb,OAAO,CAAC;EAEnE,OAAO;IAAEsB,IAAI,EAAER;EAAc,CAAC;AAChC,CAAC;AAED,eAAeM,cAAc","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-user-query-props.js","names":["buildUserQueryProps","userProps","length","basicProps","nestedProps","forEach","propertiesToDisplay","propKey","indexOf","baseProp","nestedProp","split","push","Object","keys","nestedKey","nested","prop","join"],"sources":["../../src/helpers/build-user-query-props.js"],"sourcesContent":["const buildUserQueryProps = userProps => {\n if (!userProps || !userProps.length) return '';\n const basicProps = [];\n const nestedProps = {};\n userProps.forEach(({ propertiesToDisplay }) => {\n const [propKey] = propertiesToDisplay;\n if (!propKey || propKey === 'id') return;\n if (propKey.indexOf('.') !== -1) {\n const [baseProp, nestedProp] = propKey.split('.');\n if (nestedProps[baseProp]) nestedProps[baseProp].push(nestedProp);\n else nestedProps[baseProp] = [nestedProp];\n } else basicProps.push(propKey);\n });\n\n Object.keys(nestedProps).forEach(nestedKey => {\n const nested = nestedProps[nestedKey];\n basicProps.push(nestedKey);\n basicProps.push('{');\n nested.forEach(prop => basicProps.push(prop));\n basicProps.push('}');\n });\n\n return basicProps.join(' ');\n};\n\nexport default buildUserQueryProps;\n"],"mappings":"AAAA,MAAMA,mBAAmB,GAAGC,SAAS,IAAI;EACvC,IAAI,CAACA,SAAS,IAAI,CAACA,SAAS,CAACC,MAAM,EAAE,OAAO,EAAE;EAC9C,MAAMC,UAAU,GAAG,EAAE;EACrB,MAAMC,WAAW,GAAG,CAAC,CAAC;EACtBH,SAAS,CAACI,OAAO,CAAC,CAAC;IAAEC;EAAoB,CAAC,KAAK;IAC7C,MAAM,CAACC,OAAO,CAAC,GAAGD,mBAAmB;IACrC,IAAI,CAACC,OAAO,IAAIA,OAAO,KAAK,IAAI,EAAE;IAClC,IAAIA,OAAO,CAACC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE;MAC/B,MAAM,CAACC,QAAQ,EAAEC,UAAU,CAAC,GAAGH,OAAO,CAACI,KAAK,CAAC,GAAG,CAAC;MACjD,IAAIP,WAAW,CAACK,QAAQ,CAAC,EAAEL,WAAW,CAACK,QAAQ,CAAC,CAACG,IAAI,CAACF,UAAU,CAAC,CAAC,KAC7DN,WAAW,CAACK,QAAQ,CAAC,GAAG,CAACC,UAAU,CAAC;IAC3C,CAAC,MAAMP,UAAU,CAACS,IAAI,CAACL,OAAO,CAAC;EACjC,CAAC,CAAC;EAEFM,MAAM,CAACC,IAAI,CAACV,WAAW,CAAC,CAACC,OAAO,CAACU,SAAS,IAAI;IAC5C,MAAMC,MAAM,GAAGZ,WAAW,CAACW,SAAS,CAAC;IACrCZ,UAAU,CAACS,IAAI,CAACG,SAAS,CAAC;IAC1BZ,UAAU,CAACS,IAAI,CAAC,GAAG,CAAC;IACpBI,MAAM,CAACX,OAAO,CAACY,IAAI,IAAId,UAAU,CAACS,IAAI,CAACK,IAAI,CAAC,CAAC;IAC7Cd,UAAU,CAACS,IAAI,CAAC,GAAG,CAAC;EACtB,CAAC,CAAC;EAEF,OAAOT,UAAU,CAACe,IAAI,CAAC,GAAG,CAAC;AAC7B,CAAC;AAED,eAAelB,mBAAmB"}
|
|
1
|
+
{"version":3,"file":"build-user-query-props.js","names":["buildUserQueryProps","userProps","length","basicProps","nestedProps","forEach","propertiesToDisplay","propKey","indexOf","baseProp","nestedProp","split","push","Object","keys","nestedKey","nested","prop","join"],"sources":["../../src/helpers/build-user-query-props.js"],"sourcesContent":["const buildUserQueryProps = userProps => {\n if (!userProps || !userProps.length) return '';\n const basicProps = [];\n const nestedProps = {};\n userProps.forEach(({ propertiesToDisplay }) => {\n const [propKey] = propertiesToDisplay;\n if (!propKey || propKey === 'id') return;\n if (propKey.indexOf('.') !== -1) {\n const [baseProp, nestedProp] = propKey.split('.');\n if (nestedProps[baseProp]) nestedProps[baseProp].push(nestedProp);\n else nestedProps[baseProp] = [nestedProp];\n } else basicProps.push(propKey);\n });\n\n Object.keys(nestedProps).forEach(nestedKey => {\n const nested = nestedProps[nestedKey];\n basicProps.push(nestedKey);\n basicProps.push('{');\n nested.forEach(prop => basicProps.push(prop));\n basicProps.push('}');\n });\n\n return basicProps.join(' ');\n};\n\nexport default buildUserQueryProps;\n"],"mappings":"AAAA,MAAMA,mBAAmB,GAAGC,SAAS,IAAI;EACvC,IAAI,CAACA,SAAS,IAAI,CAACA,SAAS,CAACC,MAAM,EAAE,OAAO,EAAE;EAC9C,MAAMC,UAAU,GAAG,EAAE;EACrB,MAAMC,WAAW,GAAG,CAAC,CAAC;EACtBH,SAAS,CAACI,OAAO,CAAC,CAAC;IAAEC;EAAoB,CAAC,KAAK;IAC7C,MAAM,CAACC,OAAO,CAAC,GAAGD,mBAAmB;IACrC,IAAI,CAACC,OAAO,IAAIA,OAAO,KAAK,IAAI,EAAE;IAClC,IAAIA,OAAO,CAACC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE;MAC/B,MAAM,CAACC,QAAQ,EAAEC,UAAU,CAAC,GAAGH,OAAO,CAACI,KAAK,CAAC,GAAG,CAAC;MACjD,IAAIP,WAAW,CAACK,QAAQ,CAAC,EAAEL,WAAW,CAACK,QAAQ,CAAC,CAACG,IAAI,CAACF,UAAU,CAAC,CAAC,KAC7DN,WAAW,CAACK,QAAQ,CAAC,GAAG,CAACC,UAAU,CAAC;IAC3C,CAAC,MAAMP,UAAU,CAACS,IAAI,CAACL,OAAO,CAAC;EACjC,CAAC,CAAC;EAEFM,MAAM,CAACC,IAAI,CAACV,WAAW,CAAC,CAACC,OAAO,CAACU,SAAS,IAAI;IAC5C,MAAMC,MAAM,GAAGZ,WAAW,CAACW,SAAS,CAAC;IACrCZ,UAAU,CAACS,IAAI,CAACG,SAAS,CAAC;IAC1BZ,UAAU,CAACS,IAAI,CAAC,GAAG,CAAC;IACpBI,MAAM,CAACX,OAAO,CAACY,IAAI,IAAId,UAAU,CAACS,IAAI,CAACK,IAAI,CAAC,CAAC;IAC7Cd,UAAU,CAACS,IAAI,CAAC,GAAG,CAAC;EACtB,CAAC,CAAC;EAEF,OAAOT,UAAU,CAACe,IAAI,CAAC,GAAG,CAAC;AAC7B,CAAC;AAED,eAAelB,mBAAmB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-gtm-events.js","names":["ON_CLICK","filterGtmEvents","gtmEvents","clickEvents","regularEvents","forEach","event","eventTrigger","push"],"sources":["../../src/helpers/filter-gtm-events.js"],"sourcesContent":["import { ON_CLICK } from '../constants';\n\nconst filterGtmEvents = gtmEvents => {\n const clickEvents = [];\n const regularEvents = [];\n gtmEvents.forEach(event => {\n event.eventTrigger && event.eventTrigger === ON_CLICK\n ? clickEvents.push(event)\n : regularEvents.push(event);\n });\n\n return { clickEvents, regularEvents };\n};\n\nexport default filterGtmEvents;\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,MAAMC,eAAe,GAAGC,SAAS,IAAI;EACnC,MAAMC,WAAW,GAAG,EAAE;EACtB,MAAMC,aAAa,GAAG,EAAE;EACxBF,SAAS,CAACG,OAAO,CAACC,KAAK,IAAI;IACzBA,KAAK,CAACC,YAAY,IAAID,KAAK,CAACC,YAAY,KAAKP,QAAQ,GACjDG,WAAW,CAACK,IAAI,CAACF,KAAK,CAAC,GACvBF,aAAa,CAACI,IAAI,CAACF,KAAK,CAAC;EAC/B,CAAC,CAAC;EAEF,OAAO;IAAEH,WAAW;IAAEC;EAAc,CAAC;AACvC,CAAC;AAED,eAAeH,eAAe"}
|
|
1
|
+
{"version":3,"file":"filter-gtm-events.js","names":["ON_CLICK","filterGtmEvents","gtmEvents","clickEvents","regularEvents","forEach","event","eventTrigger","push"],"sources":["../../src/helpers/filter-gtm-events.js"],"sourcesContent":["import { ON_CLICK } from '../constants';\n\nconst filterGtmEvents = gtmEvents => {\n const clickEvents = [];\n const regularEvents = [];\n gtmEvents.forEach(event => {\n event.eventTrigger && event.eventTrigger === ON_CLICK\n ? clickEvents.push(event)\n : regularEvents.push(event);\n });\n\n return { clickEvents, regularEvents };\n};\n\nexport default filterGtmEvents;\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,MAAMC,eAAe,GAAGC,SAAS,IAAI;EACnC,MAAMC,WAAW,GAAG,EAAE;EACtB,MAAMC,aAAa,GAAG,EAAE;EACxBF,SAAS,CAACG,OAAO,CAACC,KAAK,IAAI;IACzBA,KAAK,CAACC,YAAY,IAAID,KAAK,CAACC,YAAY,KAAKP,QAAQ,GACjDG,WAAW,CAACK,IAAI,CAACF,KAAK,CAAC,GACvBF,aAAa,CAACI,IAAI,CAACF,KAAK,CAAC;EAC/B,CAAC,CAAC;EAEF,OAAO;IAAEH,WAAW;IAAEC;EAAc,CAAC;AACvC,CAAC;AAED,eAAeH,eAAe","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-ids-to-use.js","names":["getIdsToUse","parentData","length","map","id"],"sources":["../../src/helpers/get-ids-to-use.js"],"sourcesContent":["const getIdsToUse = parentData => {\n if (!parentData || !parentData.length) return [];\n\n return parentData.map(({ id }) => id);\n};\n\nexport default getIdsToUse;\n"],"mappings":"AAAA,MAAMA,WAAW,GAAGC,UAAU,IAAI;EAChC,IAAI,CAACA,UAAU,IAAI,CAACA,UAAU,CAACC,MAAM,EAAE,OAAO,EAAE;EAEhD,OAAOD,UAAU,CAACE,GAAG,CAAC,CAAC;IAAEC;EAAG,CAAC,KAAKA,EAAE,CAAC;AACvC,CAAC;AAED,eAAeJ,WAAW"}
|
|
1
|
+
{"version":3,"file":"get-ids-to-use.js","names":["getIdsToUse","parentData","length","map","id"],"sources":["../../src/helpers/get-ids-to-use.js"],"sourcesContent":["const getIdsToUse = parentData => {\n if (!parentData || !parentData.length) return [];\n\n return parentData.map(({ id }) => id);\n};\n\nexport default getIdsToUse;\n"],"mappings":"AAAA,MAAMA,WAAW,GAAGC,UAAU,IAAI;EAChC,IAAI,CAACA,UAAU,IAAI,CAACA,UAAU,CAACC,MAAM,EAAE,OAAO,EAAE;EAEhD,OAAOD,UAAU,CAACE,GAAG,CAAC,CAAC;IAAEC;EAAG,CAAC,KAAKA,EAAE,CAAC;AACvC,CAAC;AAED,eAAeJ,WAAW","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-render-props.js","names":["generateSingleItemQuery","generateMultiItemQuery","getRenderProps","extraProps","isPreview","data","useMultiQuery","getEntitySchema","actions","get","getPublished","getAll","getAllPublished","queryToUse","singleActionKey","multiActionKey","actionKey","action"],"sources":["../../src/helpers/get-render-props.js"],"sourcesContent":["import { generateSingleItemQuery, generateMultiItemQuery } from '@blaze-cms/react-page-builder';\n\nconst getRenderProps = (extraProps, isPreview, data, useMultiQuery) => {\n const { getEntitySchema } = data;\n const {\n actions: { get, getPublished, getAll, getAllPublished }\n } = getEntitySchema;\n const queryToUse = useMultiQuery ? generateMultiItemQuery : generateSingleItemQuery;\n const singleActionKey = isPreview ? get : getPublished || get;\n const multiActionKey = isPreview ? getAll : getAllPublished || getAll;\n const actionKey = useMultiQuery ? multiActionKey : singleActionKey;\n const action = queryToUse(actionKey, extraProps);\n\n return { action, actionKey };\n};\n\nexport default getRenderProps;\n"],"mappings":"AAAA,SAASA,uBAAuB,EAAEC,sBAAsB,QAAQ,+BAA+B;AAE/F,MAAMC,cAAc,GAAGA,CAACC,UAAU,EAAEC,SAAS,EAAEC,IAAI,EAAEC,aAAa,KAAK;EACrE,MAAM;IAAEC;EAAgB,CAAC,GAAGF,IAAI;EAChC,MAAM;IACJG,OAAO,EAAE;MAAEC,GAAG;MAAEC,YAAY;MAAEC,MAAM;MAAEC;IAAgB;EACxD,CAAC,GAAGL,eAAe;EACnB,MAAMM,UAAU,GAAGP,aAAa,GAAGL,sBAAsB,GAAGD,uBAAuB;EACnF,MAAMc,eAAe,GAAGV,SAAS,GAAGK,GAAG,GAAGC,YAAY,IAAID,GAAG;EAC7D,MAAMM,cAAc,GAAGX,SAAS,GAAGO,MAAM,GAAGC,eAAe,IAAID,MAAM;EACrE,MAAMK,SAAS,GAAGV,aAAa,GAAGS,cAAc,GAAGD,eAAe;EAClE,MAAMG,MAAM,GAAGJ,UAAU,CAACG,SAAS,EAAEb,UAAU,CAAC;EAEhD,OAAO;IAAEc,MAAM;IAAED;EAAU,CAAC;AAC9B,CAAC;AAED,eAAed,cAAc"}
|
|
1
|
+
{"version":3,"file":"get-render-props.js","names":["generateSingleItemQuery","generateMultiItemQuery","getRenderProps","extraProps","isPreview","data","useMultiQuery","getEntitySchema","actions","get","getPublished","getAll","getAllPublished","queryToUse","singleActionKey","multiActionKey","actionKey","action"],"sources":["../../src/helpers/get-render-props.js"],"sourcesContent":["import { generateSingleItemQuery, generateMultiItemQuery } from '@blaze-cms/react-page-builder';\n\nconst getRenderProps = (extraProps, isPreview, data, useMultiQuery) => {\n const { getEntitySchema } = data;\n const {\n actions: { get, getPublished, getAll, getAllPublished }\n } = getEntitySchema;\n const queryToUse = useMultiQuery ? generateMultiItemQuery : generateSingleItemQuery;\n const singleActionKey = isPreview ? get : getPublished || get;\n const multiActionKey = isPreview ? getAll : getAllPublished || getAll;\n const actionKey = useMultiQuery ? multiActionKey : singleActionKey;\n const action = queryToUse(actionKey, extraProps);\n\n return { action, actionKey };\n};\n\nexport default getRenderProps;\n"],"mappings":"AAAA,SAASA,uBAAuB,EAAEC,sBAAsB,QAAQ,+BAA+B;AAE/F,MAAMC,cAAc,GAAGA,CAACC,UAAU,EAAEC,SAAS,EAAEC,IAAI,EAAEC,aAAa,KAAK;EACrE,MAAM;IAAEC;EAAgB,CAAC,GAAGF,IAAI;EAChC,MAAM;IACJG,OAAO,EAAE;MAAEC,GAAG;MAAEC,YAAY;MAAEC,MAAM;MAAEC;IAAgB;EACxD,CAAC,GAAGL,eAAe;EACnB,MAAMM,UAAU,GAAGP,aAAa,GAAGL,sBAAsB,GAAGD,uBAAuB;EACnF,MAAMc,eAAe,GAAGV,SAAS,GAAGK,GAAG,GAAGC,YAAY,IAAID,GAAG;EAC7D,MAAMM,cAAc,GAAGX,SAAS,GAAGO,MAAM,GAAGC,eAAe,IAAID,MAAM;EACrE,MAAMK,SAAS,GAAGV,aAAa,GAAGS,cAAc,GAAGD,eAAe;EAClE,MAAMG,MAAM,GAAGJ,UAAU,CAACG,SAAS,EAAEb,UAAU,CAAC;EAEhD,OAAO;IAAEc,MAAM;IAAED;EAAU,CAAC;AAC9B,CAAC;AAED,eAAed,cAAc","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","buildDataLayer","pushToDataLayer","buildNestedEvent","getRenderProps","getIdsToUse","buildPropsToDisplayArray","buildAndPushWebVitals","filterGtmEvents","buildUserQueryProps","buildUserLayer"],"sources":["../../src/helpers/index.js"],"sourcesContent":["export { default as buildDataLayer } from './build-data-layer';\nexport { default as pushToDataLayer } from './push-to-data-layer';\nexport { default as buildNestedEvent } from './build-nested-event';\nexport { default as getRenderProps } from './get-render-props';\nexport { default as getIdsToUse } from './get-ids-to-use';\nexport { default as buildPropsToDisplayArray } from './build-props-to-display-array';\nexport { default as buildAndPushWebVitals } from './build-and-push-web-vitals';\nexport { default as filterGtmEvents } from './filter-gtm-events';\nexport { default as buildUserQueryProps } from './build-user-query-props';\nexport { default as buildUserLayer } from './build-user-layer';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,cAAc,QAAQ,oBAAoB;AAC9D,SAASD,OAAO,IAAIE,eAAe,QAAQ,sBAAsB;AACjE,SAASF,OAAO,IAAIG,gBAAgB,QAAQ,sBAAsB;AAClE,SAASH,OAAO,IAAII,cAAc,QAAQ,oBAAoB;AAC9D,SAASJ,OAAO,IAAIK,WAAW,QAAQ,kBAAkB;AACzD,SAASL,OAAO,IAAIM,wBAAwB,QAAQ,gCAAgC;AACpF,SAASN,OAAO,IAAIO,qBAAqB,QAAQ,6BAA6B;AAC9E,SAASP,OAAO,IAAIQ,eAAe,QAAQ,qBAAqB;AAChE,SAASR,OAAO,IAAIS,mBAAmB,QAAQ,0BAA0B;AACzE,SAAST,OAAO,IAAIU,cAAc,QAAQ,oBAAoB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","buildDataLayer","pushToDataLayer","buildNestedEvent","getRenderProps","getIdsToUse","buildPropsToDisplayArray","buildAndPushWebVitals","filterGtmEvents","buildUserQueryProps","buildUserLayer"],"sources":["../../src/helpers/index.js"],"sourcesContent":["export { default as buildDataLayer } from './build-data-layer';\nexport { default as pushToDataLayer } from './push-to-data-layer';\nexport { default as buildNestedEvent } from './build-nested-event';\nexport { default as getRenderProps } from './get-render-props';\nexport { default as getIdsToUse } from './get-ids-to-use';\nexport { default as buildPropsToDisplayArray } from './build-props-to-display-array';\nexport { default as buildAndPushWebVitals } from './build-and-push-web-vitals';\nexport { default as filterGtmEvents } from './filter-gtm-events';\nexport { default as buildUserQueryProps } from './build-user-query-props';\nexport { default as buildUserLayer } from './build-user-layer';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,cAAc,QAAQ,oBAAoB;AAC9D,SAASD,OAAO,IAAIE,eAAe,QAAQ,sBAAsB;AACjE,SAASF,OAAO,IAAIG,gBAAgB,QAAQ,sBAAsB;AAClE,SAASH,OAAO,IAAII,cAAc,QAAQ,oBAAoB;AAC9D,SAASJ,OAAO,IAAIK,WAAW,QAAQ,kBAAkB;AACzD,SAASL,OAAO,IAAIM,wBAAwB,QAAQ,gCAAgC;AACpF,SAASN,OAAO,IAAIO,qBAAqB,QAAQ,6BAA6B;AAC9E,SAASP,OAAO,IAAIQ,eAAe,QAAQ,qBAAqB;AAChE,SAASR,OAAO,IAAIS,mBAAmB,QAAQ,0BAA0B;AACzE,SAAST,OAAO,IAAIU,cAAc,QAAQ,oBAAoB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push-to-data-layer.js","names":["resetDataLayer","pushToDataLayer","dataLayer","isPageView","window","push"],"sources":["../../src/helpers/push-to-data-layer.js"],"sourcesContent":["import resetDataLayer from './reset-data-layer';\n\nconst pushToDataLayer = (dataLayer, isPageView) => {\n if (dataLayer && window.dataLayer) {\n if (isPageView) resetDataLayer();\n window.dataLayer.push(dataLayer);\n }\n};\n\nexport default pushToDataLayer;\n"],"mappings":"AAAA,OAAOA,cAAc,MAAM,oBAAoB;AAE/C,MAAMC,eAAe,GAAGA,CAACC,SAAS,EAAEC,UAAU,KAAK;EACjD,IAAID,SAAS,IAAIE,MAAM,CAACF,SAAS,EAAE;IACjC,IAAIC,UAAU,EAAEH,cAAc,CAAC,CAAC;IAChCI,MAAM,CAACF,SAAS,CAACG,IAAI,CAACH,SAAS,CAAC;EAClC;AACF,CAAC;AAED,eAAeD,eAAe"}
|
|
1
|
+
{"version":3,"file":"push-to-data-layer.js","names":["resetDataLayer","pushToDataLayer","dataLayer","isPageView","window","push"],"sources":["../../src/helpers/push-to-data-layer.js"],"sourcesContent":["import resetDataLayer from './reset-data-layer';\n\nconst pushToDataLayer = (dataLayer, isPageView) => {\n if (dataLayer && window.dataLayer) {\n if (isPageView) resetDataLayer();\n window.dataLayer.push(dataLayer);\n }\n};\n\nexport default pushToDataLayer;\n"],"mappings":"AAAA,OAAOA,cAAc,MAAM,oBAAoB;AAE/C,MAAMC,eAAe,GAAGA,CAACC,SAAS,EAAEC,UAAU,KAAK;EACjD,IAAID,SAAS,IAAIE,MAAM,CAACF,SAAS,EAAE;IACjC,IAAIC,UAAU,EAAEH,cAAc,CAAC,CAAC;IAChCI,MAAM,CAACF,SAAS,CAACG,IAAI,CAACH,SAAS,CAAC;EAClC;AACF,CAAC;AAED,eAAeD,eAAe","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reset-data-layer.js","names":["PAGE_VIEW","resetDataLayer","shouldReset","window","dataLayer","length","gtmIdRegex","keys","Object","google_tag_manager","GTMkeys","filter","key","test","forEach","GTMkey","reset","find","event"],"sources":["../../src/helpers/reset-data-layer.js"],"sourcesContent":["import { PAGE_VIEW } from '../constants';\n\nconst resetDataLayer = () => {\n if (!shouldReset()) return false;\n\n window.dataLayer.length = 0;\n const gtmIdRegex = /GTM-/i;\n const keys = Object.keys(window.google_tag_manager);\n const GTMkeys = keys.filter(\n key => gtmIdRegex.test(key) && window.google_tag_manager[key].dataLayer\n );\n GTMkeys.forEach(GTMkey => window.google_tag_manager[GTMkey].dataLayer.reset());\n\n return true;\n};\n\nfunction shouldReset() {\n return (\n window.google_tag_manager &&\n window.dataLayer &&\n window.dataLayer.find(({ event }) => event === PAGE_VIEW)\n );\n}\n\nexport default resetDataLayer;\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,cAAc;AAExC,MAAMC,cAAc,GAAGA,CAAA,KAAM;EAC3B,IAAI,CAACC,WAAW,CAAC,CAAC,EAAE,OAAO,KAAK;EAEhCC,MAAM,CAACC,SAAS,CAACC,MAAM,GAAG,CAAC;EAC3B,MAAMC,UAAU,GAAG,OAAO;EAC1B,MAAMC,IAAI,GAAGC,MAAM,CAACD,IAAI,CAACJ,MAAM,CAACM,kBAAkB,CAAC;EACnD,MAAMC,OAAO,GAAGH,IAAI,CAACI,MAAM,CACzBC,GAAG,IAAIN,UAAU,CAACO,IAAI,CAACD,GAAG,CAAC,IAAIT,MAAM,CAACM,kBAAkB,CAACG,GAAG,CAAC,CAACR,SAChE,CAAC;EACDM,OAAO,CAACI,OAAO,CAACC,MAAM,IAAIZ,MAAM,CAACM,kBAAkB,CAACM,MAAM,CAAC,CAACX,SAAS,CAACY,KAAK,CAAC,CAAC,CAAC;EAE9E,OAAO,IAAI;AACb,CAAC;AAED,SAASd,WAAWA,CAAA,EAAG;EACrB,OACEC,MAAM,CAACM,kBAAkB,IACzBN,MAAM,CAACC,SAAS,IAChBD,MAAM,CAACC,SAAS,CAACa,IAAI,CAAC,CAAC;IAAEC;EAAM,CAAC,KAAKA,KAAK,KAAKlB,SAAS,CAAC;AAE7D;AAEA,eAAeC,cAAc"}
|
|
1
|
+
{"version":3,"file":"reset-data-layer.js","names":["PAGE_VIEW","resetDataLayer","shouldReset","window","dataLayer","length","gtmIdRegex","keys","Object","google_tag_manager","GTMkeys","filter","key","test","forEach","GTMkey","reset","find","event"],"sources":["../../src/helpers/reset-data-layer.js"],"sourcesContent":["import { PAGE_VIEW } from '../constants';\n\nconst resetDataLayer = () => {\n if (!shouldReset()) return false;\n\n window.dataLayer.length = 0;\n const gtmIdRegex = /GTM-/i;\n const keys = Object.keys(window.google_tag_manager);\n const GTMkeys = keys.filter(\n key => gtmIdRegex.test(key) && window.google_tag_manager[key].dataLayer\n );\n GTMkeys.forEach(GTMkey => window.google_tag_manager[GTMkey].dataLayer.reset());\n\n return true;\n};\n\nfunction shouldReset() {\n return (\n window.google_tag_manager &&\n window.dataLayer &&\n window.dataLayer.find(({ event }) => event === PAGE_VIEW)\n );\n}\n\nexport default resetDataLayer;\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,cAAc;AAExC,MAAMC,cAAc,GAAGA,CAAA,KAAM;EAC3B,IAAI,CAACC,WAAW,CAAC,CAAC,EAAE,OAAO,KAAK;EAEhCC,MAAM,CAACC,SAAS,CAACC,MAAM,GAAG,CAAC;EAC3B,MAAMC,UAAU,GAAG,OAAO;EAC1B,MAAMC,IAAI,GAAGC,MAAM,CAACD,IAAI,CAACJ,MAAM,CAACM,kBAAkB,CAAC;EACnD,MAAMC,OAAO,GAAGH,IAAI,CAACI,MAAM,CACzBC,GAAG,IAAIN,UAAU,CAACO,IAAI,CAACD,GAAG,CAAC,IAAIT,MAAM,CAACM,kBAAkB,CAACG,GAAG,CAAC,CAACR,SAChE,CAAC;EACDM,OAAO,CAACI,OAAO,CAACC,MAAM,IAAIZ,MAAM,CAACM,kBAAkB,CAACM,MAAM,CAAC,CAACX,SAAS,CAACY,KAAK,CAAC,CAAC,CAAC;EAE9E,OAAO,IAAI;AACb,CAAC;AAED,SAASd,WAAWA,CAAA,EAAG;EACrB,OACEC,MAAM,CAACM,kBAAkB,IACzBN,MAAM,CAACC,SAAS,IAChBD,MAAM,CAACC,SAAS,CAACa,IAAI,CAAC,CAAC;IAAEC;EAAM,CAAC,KAAKA,KAAK,KAAKlB,SAAS,CAAC;AAE7D;AAEA,eAAeC,cAAc","ignoreList":[]}
|
package/lib-es/index.js
CHANGED
|
@@ -5,11 +5,11 @@ export default async function load(app) {
|
|
|
5
5
|
app.events.once('load:custom:page-builder:component', addComponent => {
|
|
6
6
|
addComponent({
|
|
7
7
|
key: 'gtm',
|
|
8
|
-
component: dynamic(() => import(
|
|
8
|
+
component: dynamic(() => import(/* webpackChunkName: "blazePbGoogleTagManager" */'./GoogleTagManager'))
|
|
9
9
|
});
|
|
10
10
|
addComponent({
|
|
11
11
|
key: 'gtm-events',
|
|
12
|
-
component: dynamic(() => import(
|
|
12
|
+
component: dynamic(() => import(/* webpackChunkName: "blazePbGoogleTagManagerEvent" */'./GoogleTagManagerEvent'))
|
|
13
13
|
});
|
|
14
14
|
});
|
|
15
15
|
return {
|
package/lib-es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["dynamic","pkg","PLUGIN_NAME","load","app","events","once","addComponent","key","component","name","version","pluginName"],"sources":["../src/index.js"],"sourcesContent":["import dynamic from 'next/dynamic';\n\nimport pkg from '../package.json';\nimport { PLUGIN_NAME } from './constants';\n\nexport default async function load(app) {\n app.events.once('load:custom:page-builder:component', addComponent => {\n addComponent({\n key: 'gtm',\n component: dynamic(()
|
|
1
|
+
{"version":3,"file":"index.js","names":["dynamic","pkg","PLUGIN_NAME","load","app","events","once","addComponent","key","component","name","version","pluginName"],"sources":["../src/index.js"],"sourcesContent":["import dynamic from 'next/dynamic';\n\nimport pkg from '../package.json';\nimport { PLUGIN_NAME } from './constants';\n\nexport default async function load(app) {\n app.events.once('load:custom:page-builder:component', addComponent => {\n addComponent({\n key: 'gtm',\n component: dynamic(\n () => import(/* webpackChunkName: \"blazePbGoogleTagManager\" */ './GoogleTagManager')\n )\n });\n addComponent({\n key: 'gtm-events',\n component: dynamic(\n () =>\n import(/* webpackChunkName: \"blazePbGoogleTagManagerEvent\" */ './GoogleTagManagerEvent')\n )\n });\n });\n\n return {\n name: PLUGIN_NAME,\n version: pkg.version\n };\n}\n\nload.pluginName = PLUGIN_NAME;\n"],"mappings":"AAAA,OAAOA,OAAO,MAAM,cAAc;AAElC,OAAOC,GAAG,MAAM,iBAAiB;AACjC,SAASC,WAAW,QAAQ,aAAa;AAEzC,eAAe,eAAeC,IAAIA,CAACC,GAAG,EAAE;EACtCA,GAAG,CAACC,MAAM,CAACC,IAAI,CAAC,oCAAoC,EAAEC,YAAY,IAAI;IACpEA,YAAY,CAAC;MACXC,GAAG,EAAE,KAAK;MACVC,SAAS,EAAET,OAAO,CAChB,MAAM,MAAM,CAAC,iDAAkD,oBAAoB,CACrF;IACF,CAAC,CAAC;IACFO,YAAY,CAAC;MACXC,GAAG,EAAE,YAAY;MACjBC,SAAS,EAAET,OAAO,CAChB,MACE,MAAM,CAAC,sDAAuD,yBAAyB,CAC3F;IACF,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAO;IACLU,IAAI,EAAER,WAAW;IACjBS,OAAO,EAAEV,GAAG,CAACU;EACf,CAAC;AACH;AAEAR,IAAI,CAACS,UAAU,GAAGV,WAAW","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaze-cms/plugin-gtm-fe",
|
|
3
|
-
"version": "0.146.0-
|
|
3
|
+
"version": "0.146.0-node18.0",
|
|
4
4
|
"description": "Blaze GTM plugin fe",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-es/index.js",
|
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
12
|
"test": "jest",
|
|
13
|
-
"lint": "
|
|
13
|
+
"lint": "npm run lint:js",
|
|
14
14
|
"lint:js": "eslint .",
|
|
15
15
|
"clean": "rm -Rf ./lib/ && rm -Rf ./lib-es/",
|
|
16
16
|
"build:cjs": "BABEL_ENV=cjs ../../node_modules/.bin/babel ./src --out-dir ./lib --source-maps --root-mode upward",
|
|
17
17
|
"build:esm": "BABEL_ENV=esm ../../node_modules/.bin/babel ./src --out-dir ./lib-es --source-maps --root-mode upward",
|
|
18
|
-
"build": "
|
|
19
|
-
"build:clean": "
|
|
20
|
-
"prepublishOnly": "
|
|
21
|
-
"postpublish": "
|
|
18
|
+
"build": "npm run build:cjs && npm run build:esm",
|
|
19
|
+
"build:clean": "npm run clean && npm run build",
|
|
20
|
+
"prepublishOnly": "npm run build:clean",
|
|
21
|
+
"postpublish": "npm run clean"
|
|
22
22
|
},
|
|
23
23
|
"author": {
|
|
24
24
|
"email": "hello@thebyte9.com",
|
|
@@ -27,23 +27,23 @@
|
|
|
27
27
|
},
|
|
28
28
|
"license": "GPL-3.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@blaze-cms/core-auth-ui": "0.146.0-
|
|
31
|
-
"@blaze-cms/nextjs-components": "0.146.0-
|
|
32
|
-
"@blaze-cms/react-page-builder": "0.146.0-
|
|
33
|
-
"@blaze-cms/setup-ui": "0.
|
|
30
|
+
"@blaze-cms/core-auth-ui": "0.146.0-node18.0",
|
|
31
|
+
"@blaze-cms/nextjs-components": "0.146.0-node18.0",
|
|
32
|
+
"@blaze-cms/react-page-builder": "0.146.0-node18.0",
|
|
33
|
+
"@blaze-cms/setup-ui": "0.146.0-node18.0",
|
|
34
34
|
"core-js": "^3.2.1",
|
|
35
35
|
"regenerator-runtime": "^0.13.3",
|
|
36
36
|
"web-vitals": "^0.2.2"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@blaze-cms/core-ui": "0.146.0-
|
|
39
|
+
"@blaze-cms/core-ui": "0.146.0-node18.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"next": "
|
|
42
|
+
"next": "14.1.0"
|
|
43
43
|
},
|
|
44
44
|
"eslintIgnore": [
|
|
45
45
|
"lib/*",
|
|
46
46
|
"lib-es/*"
|
|
47
47
|
],
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "c60370714e89e0c96f2169d61e4c56bc542f7686"
|
|
49
49
|
}
|
|
@@ -9,12 +9,9 @@ const GTMEvent = ({ dataLayerObject, eventTrigger, currentLocation, handleOnSucc
|
|
|
9
9
|
const isViewEvent = eventTrigger === IN_VIEW;
|
|
10
10
|
const isOnSuccess = eventTrigger === ON_SUCCESS && !!handleOnSuccess;
|
|
11
11
|
|
|
12
|
-
useEffect(
|
|
13
|
-
()
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
[currentLocation]
|
|
17
|
-
);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
setShouldPushLayer(true);
|
|
14
|
+
}, [currentLocation]);
|
|
18
15
|
const pushDataLayer = () => {
|
|
19
16
|
pushToDataLayer(dataLayerObject);
|
|
20
17
|
setShouldPushLayer(false);
|
package/src/index.js
CHANGED
|
@@ -7,14 +7,15 @@ export default async function load(app) {
|
|
|
7
7
|
app.events.once('load:custom:page-builder:component', addComponent => {
|
|
8
8
|
addComponent({
|
|
9
9
|
key: 'gtm',
|
|
10
|
-
component: dynamic(
|
|
11
|
-
import(/* webpackChunkName: "blazePbGoogleTagManager" */ './GoogleTagManager')
|
|
10
|
+
component: dynamic(
|
|
11
|
+
() => import(/* webpackChunkName: "blazePbGoogleTagManager" */ './GoogleTagManager')
|
|
12
12
|
)
|
|
13
13
|
});
|
|
14
14
|
addComponent({
|
|
15
15
|
key: 'gtm-events',
|
|
16
|
-
component: dynamic(
|
|
17
|
-
|
|
16
|
+
component: dynamic(
|
|
17
|
+
() =>
|
|
18
|
+
import(/* webpackChunkName: "blazePbGoogleTagManagerEvent" */ './GoogleTagManagerEvent')
|
|
18
19
|
)
|
|
19
20
|
});
|
|
20
21
|
});
|