@blaze-cms/plugin-gtm-fe 0.127.0 → 0.128.0-admin-updates.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
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [0.128.0-admin-updates.0](https://github.com/thebyte9/blaze/compare/v0.127.1...v0.128.0-admin-updates.0) (2023-02-16)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @blaze-cms/plugin-gtm-fe
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [0.127.0](https://github.com/thebyte9/blaze/compare/v0.126.1...v0.127.0) (2023-02-10)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @blaze-cms/plugin-gtm-fe
|
|
@@ -40,10 +40,10 @@ var GTMEventFactory = function GTMEventFactory(_ref) {
|
|
|
40
40
|
isPreview = _useContext.isPreview;
|
|
41
41
|
var _ref2 = parentData || [],
|
|
42
42
|
_ref3 = (0, _slicedToArray2["default"])(_ref2, 1),
|
|
43
|
-
_ref3$ = _ref3[0]
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
itemEntity = _ref3
|
|
43
|
+
_ref3$ = _ref3[0],
|
|
44
|
+
_ref3$2 = _ref3$ === void 0 ? {} : _ref3$,
|
|
45
|
+
_ref3$2$itemEntity = _ref3$2.itemEntity,
|
|
46
|
+
itemEntity = _ref3$2$itemEntity === void 0 ? parent.itemEntity : _ref3$2$itemEntity;
|
|
47
47
|
var _useQuery = (0, _client.useQuery)(_reactPageBuilder.getSingleEntitySchema, {
|
|
48
48
|
variables: {
|
|
49
49
|
id: itemEntity
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GTMEventFactory.js","names":["GTMEventFactory","parent","gtmEvents","parentData","clickId","parentComponent","useContext","MainContext","isPreview","itemEntity","useQuery","getSingleEntitySchema","variables","id","data","error","loading","map","i","propsToDisplay","eventProps","hasNoPropsToDisplay","length","propsToDisplayArr","buildPropsToDisplayArray","extraProps","buildPropsQuery","shouldUseParentData","itemIdToUse","itemId","getIdsToUse","shouldUseMultiQuery","Array","isArray","getRenderProps","action","actionKey","dynamicKey","GTM_EVENT_FACTORY","queryVariables","where","_in","skip","propTypes","PropTypes","object","isRequired","string","array","oneOfType","defaultProps"],"sources":["../../src/GoogleTagManagerEvent/GTMEventFactory.js"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport { useQuery } from '@apollo/client';\nimport { getSingleEntitySchema, buildPropsQuery } from '@blaze-cms/react-page-builder';\nimport { MainContext } from '@blaze-cms/nextjs-components';\nimport GTMEventRender from './GTMEventRender';\nimport { getRenderProps, getIdsToUse, buildPropsToDisplayArray } from '../helpers';\nimport { GTM_EVENT_FACTORY } from '../constants';\n\nconst GTMEventFactory = ({ parent, gtmEvents, parentData, clickId, parentComponent }) => {\n const { isPreview } = useContext(MainContext);\n const [{ itemEntity = parent.itemEntity } = {}] = parentData || [];\n const { data, error, loading } = useQuery(getSingleEntitySchema, {\n variables: { id: itemEntity }\n });\n\n if (loading || error || !data) return null;\n\n return gtmEvents.map(({ propsToDisplay, ...eventProps }, i) => {\n const hasNoPropsToDisplay = !propsToDisplay || !propsToDisplay.length;\n const propsToDisplayArr = buildPropsToDisplayArray(propsToDisplay);\n const extraProps = hasNoPropsToDisplay ? '' : buildPropsQuery(data, propsToDisplayArr);\n const shouldUseParentData = !clickId && parentData && parentData.length;\n const itemIdToUse = clickId || parent.itemId;\n const itemId = shouldUseParentData ? getIdsToUse(parentData) : itemIdToUse;\n const shouldUseMultiQuery = Array.isArray(itemId);\n const { action, actionKey } = getRenderProps(extraProps, isPreview, data, shouldUseMultiQuery);\n const dynamicKey = `${GTM_EVENT_FACTORY}${i}`;\n const queryVariables = shouldUseMultiQuery\n ? {\n variables: { where: { id: { _in: itemId } } },\n skip: hasNoPropsToDisplay\n }\n : {\n variables: { id: itemId },\n skip: hasNoPropsToDisplay\n };\n\n return (\n <GTMEventRender\n key={dynamicKey}\n action={action}\n actionKey={actionKey}\n propsToDisplay={propsToDisplay}\n id={itemId}\n queryVariables={queryVariables}\n parentComponent={parentComponent}\n {...eventProps}\n />\n );\n });\n};\n\nGTMEventFactory.propTypes = {\n parent: PropTypes.object.isRequired,\n clickId: PropTypes.string,\n gtmEvents: PropTypes.array,\n parentData: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),\n parentComponent: PropTypes.object\n};\n\nGTMEventFactory.defaultProps = {\n clickId: null,\n gtmEvents: [],\n parentData: null,\n parentComponent: {}\n};\n\nexport default GTMEventFactory;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAiD;AAAA;AAAA;AAEjD,IAAMA,eAAe,GAAG,SAAlBA,eAAe,OAAoE;EAAA,IAA9DC,MAAM,QAANA,MAAM;IAAEC,SAAS,QAATA,SAAS;IAAEC,UAAU,QAAVA,UAAU;IAAEC,OAAO,QAAPA,OAAO;IAAEC,eAAe,QAAfA,eAAe;EAChF,kBAAsB,IAAAC,iBAAU,EAACC,6BAAW,CAAC;IAArCC,SAAS,eAATA,SAAS;EACjB,YAAkDL,UAAU,IAAI,EAAE;IAAA;IAAA;
|
|
1
|
+
{"version":3,"file":"GTMEventFactory.js","names":["GTMEventFactory","parent","gtmEvents","parentData","clickId","parentComponent","useContext","MainContext","isPreview","itemEntity","useQuery","getSingleEntitySchema","variables","id","data","error","loading","map","i","propsToDisplay","eventProps","hasNoPropsToDisplay","length","propsToDisplayArr","buildPropsToDisplayArray","extraProps","buildPropsQuery","shouldUseParentData","itemIdToUse","itemId","getIdsToUse","shouldUseMultiQuery","Array","isArray","getRenderProps","action","actionKey","dynamicKey","GTM_EVENT_FACTORY","queryVariables","where","_in","skip","propTypes","PropTypes","object","isRequired","string","array","oneOfType","defaultProps"],"sources":["../../src/GoogleTagManagerEvent/GTMEventFactory.js"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport { useQuery } from '@apollo/client';\nimport { getSingleEntitySchema, buildPropsQuery } from '@blaze-cms/react-page-builder';\nimport { MainContext } from '@blaze-cms/nextjs-components';\nimport GTMEventRender from './GTMEventRender';\nimport { getRenderProps, getIdsToUse, buildPropsToDisplayArray } from '../helpers';\nimport { GTM_EVENT_FACTORY } from '../constants';\n\nconst GTMEventFactory = ({ parent, gtmEvents, parentData, clickId, parentComponent }) => {\n const { isPreview } = useContext(MainContext);\n const [{ itemEntity = parent.itemEntity } = {}] = parentData || [];\n const { data, error, loading } = useQuery(getSingleEntitySchema, {\n variables: { id: itemEntity }\n });\n\n if (loading || error || !data) return null;\n\n return gtmEvents.map(({ propsToDisplay, ...eventProps }, i) => {\n const hasNoPropsToDisplay = !propsToDisplay || !propsToDisplay.length;\n const propsToDisplayArr = buildPropsToDisplayArray(propsToDisplay);\n const extraProps = hasNoPropsToDisplay ? '' : buildPropsQuery(data, propsToDisplayArr);\n const shouldUseParentData = !clickId && parentData && parentData.length;\n const itemIdToUse = clickId || parent.itemId;\n const itemId = shouldUseParentData ? getIdsToUse(parentData) : itemIdToUse;\n const shouldUseMultiQuery = Array.isArray(itemId);\n const { action, actionKey } = getRenderProps(extraProps, isPreview, data, shouldUseMultiQuery);\n const dynamicKey = `${GTM_EVENT_FACTORY}${i}`;\n const queryVariables = shouldUseMultiQuery\n ? {\n variables: { where: { id: { _in: itemId } } },\n skip: hasNoPropsToDisplay\n }\n : {\n variables: { id: itemId },\n skip: hasNoPropsToDisplay\n };\n\n return (\n <GTMEventRender\n key={dynamicKey}\n action={action}\n actionKey={actionKey}\n propsToDisplay={propsToDisplay}\n id={itemId}\n queryVariables={queryVariables}\n parentComponent={parentComponent}\n {...eventProps}\n />\n );\n });\n};\n\nGTMEventFactory.propTypes = {\n parent: PropTypes.object.isRequired,\n clickId: PropTypes.string,\n gtmEvents: PropTypes.array,\n parentData: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),\n parentComponent: PropTypes.object\n};\n\nGTMEventFactory.defaultProps = {\n clickId: null,\n gtmEvents: [],\n parentData: null,\n parentComponent: {}\n};\n\nexport default GTMEventFactory;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAiD;AAAA;AAAA;AAEjD,IAAMA,eAAe,GAAG,SAAlBA,eAAe,OAAoE;EAAA,IAA9DC,MAAM,QAANA,MAAM;IAAEC,SAAS,QAATA,SAAS;IAAEC,UAAU,QAAVA,UAAU;IAAEC,OAAO,QAAPA,OAAO;IAAEC,eAAe,QAAfA,eAAe;EAChF,kBAAsB,IAAAC,iBAAU,EAACC,6BAAW,CAAC;IAArCC,SAAS,eAATA,SAAS;EACjB,YAAkDL,UAAU,IAAI,EAAE;IAAA;IAAA;IAAA,8BAAtB,CAAC,CAAC;IAAA,6BAArCM,UAAU;IAAVA,UAAU,mCAAGR,MAAM,CAACQ,UAAU;EACvC,gBAAiC,IAAAC,gBAAQ,EAACC,uCAAqB,EAAE;MAC/DC,SAAS,EAAE;QAAEC,EAAE,EAAEJ;MAAW;IAC9B,CAAC,CAAC;IAFMK,IAAI,aAAJA,IAAI;IAAEC,KAAK,aAALA,KAAK;IAAEC,OAAO,aAAPA,OAAO;EAI5B,IAAIA,OAAO,IAAID,KAAK,IAAI,CAACD,IAAI,EAAE,OAAO,IAAI;EAE1C,OAAOZ,SAAS,CAACe,GAAG,CAAC,iBAAoCC,CAAC,EAAK;IAAA,IAAvCC,cAAc,SAAdA,cAAc;MAAKC,UAAU;IACnD,IAAMC,mBAAmB,GAAG,CAACF,cAAc,IAAI,CAACA,cAAc,CAACG,MAAM;IACrE,IAAMC,iBAAiB,GAAG,IAAAC,iCAAwB,EAACL,cAAc,CAAC;IAClE,IAAMM,UAAU,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ACG,MAAM;EACzB7C,SAAS,EAAE0C,qBAAS,CAACI,KAAK;EAC1B7C,UAAU,EAAEyC,qBAAS,CAACK,SAAS,CAAC,CAACL,qBAAS,CAACC,MAAM,EAAED,qBAAS,CAACI,KAAK,CAAC,CAAC;EACpE3C,eAAe,EAAEuC,qBAAS,CAACC;AAC7B,CAAC;AAED7C,eAAe,CAACkD,YAAY,GAAG;EAC7B9C,OAAO,EAAE,IAAI;EACbF,SAAS,EAAE,EAAE;EACbC,UAAU,EAAE,IAAI;EAChBE,eAAe,EAAE,CAAC;AACpB,CAAC;AAAC,eAEaL,eAAe;AAAA"}
|
package/lib/index.js
CHANGED
|
@@ -27,35 +27,33 @@ function load(_x) {
|
|
|
27
27
|
function _load() {
|
|
28
28
|
_load = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(app) {
|
|
29
29
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
30
|
-
while (1) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
})
|
|
41
|
-
});
|
|
42
|
-
addComponent({
|
|
43
|
-
key: 'gtm-events',
|
|
44
|
-
component: (0, _dynamic["default"])(function () {
|
|
45
|
-
return Promise.resolve().then(function () {
|
|
46
|
-
return _interopRequireWildcard(require( /* webpackChunkName: "blazePbGoogleTagManagerEvent" */'./GoogleTagManagerEvent'));
|
|
47
|
-
});
|
|
48
|
-
})
|
|
49
|
-
});
|
|
30
|
+
while (1) switch (_context.prev = _context.next) {
|
|
31
|
+
case 0:
|
|
32
|
+
app.events.once('load:custom:page-builder:component', function (addComponent) {
|
|
33
|
+
addComponent({
|
|
34
|
+
key: 'gtm',
|
|
35
|
+
component: (0, _dynamic["default"])(function () {
|
|
36
|
+
return Promise.resolve().then(function () {
|
|
37
|
+
return _interopRequireWildcard(require( /* webpackChunkName: "blazePbGoogleTagManager" */'./GoogleTagManager'));
|
|
38
|
+
});
|
|
39
|
+
})
|
|
50
40
|
});
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
41
|
+
addComponent({
|
|
42
|
+
key: 'gtm-events',
|
|
43
|
+
component: (0, _dynamic["default"])(function () {
|
|
44
|
+
return Promise.resolve().then(function () {
|
|
45
|
+
return _interopRequireWildcard(require( /* webpackChunkName: "blazePbGoogleTagManagerEvent" */'./GoogleTagManagerEvent'));
|
|
46
|
+
});
|
|
47
|
+
})
|
|
54
48
|
});
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
49
|
+
});
|
|
50
|
+
return _context.abrupt("return", {
|
|
51
|
+
name: _constants.PLUGIN_NAME,
|
|
52
|
+
version: _package["default"].version
|
|
53
|
+
});
|
|
54
|
+
case 2:
|
|
55
|
+
case "end":
|
|
56
|
+
return _context.stop();
|
|
59
57
|
}
|
|
60
58
|
}, _callee);
|
|
61
59
|
}));
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["load","app","events","once","addComponent","key","component","dynamic","name","PLUGIN_NAME","version","pkg","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 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;AAEA;AACA;AAA0C;AAAA;AAAA,SAEZA,IAAI;EAAA;AAAA;AAAA;EAAA,sFAAnB,iBAAoBC,GAAG;IAAA;MAAA;QAAA;
|
|
1
|
+
{"version":3,"file":"index.js","names":["load","app","events","once","addComponent","key","component","dynamic","name","PLUGIN_NAME","version","pkg","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 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;AAEA;AACA;AAA0C;AAAA;AAAA,SAEZA,IAAI;EAAA;AAAA;AAAA;EAAA,sFAAnB,iBAAoBC,GAAG;IAAA;MAAA;QAAA;UACpCA,GAAG,CAACC,MAAM,CAACC,IAAI,CAAC,oCAAoC,EAAE,UAAAC,YAAY,EAAI;YACpEA,YAAY,CAAC;cACXC,GAAG,EAAE,KAAK;cACVC,SAAS,EAAE,IAAAC,mBAAO,EAAC;gBAAA;kBAAA,wCACV,iDAAkD,oBAAoB;gBAAA;cAAA,CAAC;YAElF,CAAC,CAAC;YACFH,YAAY,CAAC;cACXC,GAAG,EAAE,YAAY;cACjBC,SAAS,EAAE,IAAAC,mBAAO,EAAC;gBAAA;kBAAA,wCACV,sDAAuD,yBAAyB;gBAAA;cAAA,CAAC;YAE5F,CAAC,CAAC;UACJ,CAAC,CAAC;UAAC,iCAEI;YACLC,IAAI,EAAEC,sBAAW;YACjBC,OAAO,EAAEC,mBAAG,CAACD;UACf,CAAC;QAAA;QAAA;UAAA;MAAA;IAAA;EAAA,CACF;EAAA;AAAA;AAEDV,IAAI,CAACY,UAAU,GAAGH,sBAAW"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaze-cms/plugin-gtm-fe",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.128.0-admin-updates.0",
|
|
4
4
|
"description": "Blaze GTM plugin fe",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-es/index.js",
|
|
@@ -27,16 +27,16 @@
|
|
|
27
27
|
},
|
|
28
28
|
"license": "GPL-3.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@blaze-cms/core-auth-ui": "
|
|
31
|
-
"@blaze-cms/nextjs-components": "
|
|
32
|
-
"@blaze-cms/react-page-builder": "
|
|
33
|
-
"@blaze-cms/setup-ui": "
|
|
30
|
+
"@blaze-cms/core-auth-ui": "0.128.0-admin-updates.0",
|
|
31
|
+
"@blaze-cms/nextjs-components": "0.128.0-admin-updates.0",
|
|
32
|
+
"@blaze-cms/react-page-builder": "0.128.0-admin-updates.0",
|
|
33
|
+
"@blaze-cms/setup-ui": "0.128.0-admin-updates.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": "
|
|
39
|
+
"@blaze-cms/core-ui": "0.128.0-admin-updates.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"next": "12.x"
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"lib/*",
|
|
46
46
|
"lib-es/*"
|
|
47
47
|
],
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "ad3389e954fe463366655311efb1198191dbb625"
|
|
49
49
|
}
|