@ninetailed/experience.js-gatsby 3.0.0-beta.32 → 3.0.0-beta.34
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/gatsby-browser.js +2 -2
- package/gatsby-ssr.js +2 -2
- package/loaders/ninetailed-plugins.js +35 -8
- package/package.json +2 -2
package/gatsby-browser.js
CHANGED
|
@@ -47,9 +47,9 @@ const WrapRootElement = _a => {
|
|
|
47
47
|
} = _a,
|
|
48
48
|
options = __rest(_a, ["children"]);
|
|
49
49
|
const resolvedPlugins = loaders_ninetailedPlugins.plugins.map(({
|
|
50
|
-
|
|
50
|
+
PluginCtor,
|
|
51
51
|
options
|
|
52
|
-
}) =>
|
|
52
|
+
}) => new PluginCtor(options));
|
|
53
53
|
return /*#__PURE__*/React__default["default"].createElement(experience_jsReact.NinetailedProvider, Object.assign({}, options, {
|
|
54
54
|
plugins: resolvedPlugins
|
|
55
55
|
}), /*#__PURE__*/React__default["default"].createElement(Tracker.Tracker, null), children);
|
package/gatsby-ssr.js
CHANGED
|
@@ -14,9 +14,9 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
14
14
|
|
|
15
15
|
const wrapRootElement = (args, options) => {
|
|
16
16
|
const resolvedPlugins = loaders_ninetailedPlugins.plugins.map(({
|
|
17
|
-
|
|
17
|
+
PluginCtor,
|
|
18
18
|
options
|
|
19
|
-
}) =>
|
|
19
|
+
}) => new PluginCtor(options));
|
|
20
20
|
const {
|
|
21
21
|
element
|
|
22
22
|
} = args;
|
|
@@ -112,12 +112,34 @@ var parse$1 = function parse (text, reviver) {
|
|
|
112
112
|
function internalize (holder, name, reviver) {
|
|
113
113
|
const value = holder[name];
|
|
114
114
|
if (value != null && typeof value === 'object') {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
115
|
+
if (Array.isArray(value)) {
|
|
116
|
+
for (let i = 0; i < value.length; i++) {
|
|
117
|
+
const key = String(i);
|
|
118
|
+
const replacement = internalize(value, key, reviver);
|
|
119
|
+
if (replacement === undefined) {
|
|
120
|
+
delete value[key];
|
|
121
|
+
} else {
|
|
122
|
+
Object.defineProperty(value, key, {
|
|
123
|
+
value: replacement,
|
|
124
|
+
writable: true,
|
|
125
|
+
enumerable: true,
|
|
126
|
+
configurable: true,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
} else {
|
|
131
|
+
for (const key in value) {
|
|
132
|
+
const replacement = internalize(value, key, reviver);
|
|
133
|
+
if (replacement === undefined) {
|
|
134
|
+
delete value[key];
|
|
135
|
+
} else {
|
|
136
|
+
Object.defineProperty(value, key, {
|
|
137
|
+
value: replacement,
|
|
138
|
+
writable: true,
|
|
139
|
+
enumerable: true,
|
|
140
|
+
configurable: true,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
121
143
|
}
|
|
122
144
|
}
|
|
123
145
|
}
|
|
@@ -1043,7 +1065,12 @@ function push () {
|
|
|
1043
1065
|
if (Array.isArray(parent)) {
|
|
1044
1066
|
parent.push(value);
|
|
1045
1067
|
} else {
|
|
1046
|
-
parent
|
|
1068
|
+
Object.defineProperty(parent, key, {
|
|
1069
|
+
value,
|
|
1070
|
+
writable: true,
|
|
1071
|
+
enumerable: true,
|
|
1072
|
+
configurable: true,
|
|
1073
|
+
});
|
|
1047
1074
|
}
|
|
1048
1075
|
}
|
|
1049
1076
|
|
|
@@ -6289,7 +6316,7 @@ const loaderUtils = lib$1;
|
|
|
6289
6316
|
*/
|
|
6290
6317
|
var ninetailedPlugins = function () {
|
|
6291
6318
|
const options = loaderUtils.getOptions(this);
|
|
6292
|
-
const pluginRequires = !options.plugins ? `[]` : `[` + options.plugins.map(plugin => `{
|
|
6319
|
+
const pluginRequires = !options.plugins ? `[]` : `[` + options.plugins.map(plugin => `{PluginCtor: require("${plugin.resolve ? plugin.resolve : plugin}").default, options: ${JSON.stringify(plugin.options)}}`).join(`,`) + `]`;
|
|
6293
6320
|
return `module.exports = {plugins: ${pluginRequires}}`;
|
|
6294
6321
|
};
|
|
6295
6322
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ninetailed/experience.js-gatsby",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.34",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"gatsby",
|
|
6
6
|
"gatsby-plugin",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"type": "commonjs",
|
|
19
19
|
"types": "./index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@ninetailed/experience.js-react": "3.0.0-beta.
|
|
21
|
+
"@ninetailed/experience.js-react": "3.0.0-beta.34",
|
|
22
22
|
"gatsby-plugin-utils": "3.19.0"
|
|
23
23
|
}
|
|
24
24
|
}
|