@ninetailed/experience.js-gatsby 3.0.0-beta.21 → 3.0.0-beta.24

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/Tracker.js CHANGED
@@ -1,10 +1,16 @@
1
- import React, { useEffect, useRef } from 'react';
2
- import { Location } from '@reach/router';
3
- import { useNinetailed } from '@ninetailed/experience.js-react';
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var router = require('@reach/router');
5
+ var experience_jsReact = require('@ninetailed/experience.js-react');
6
+
7
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
+
9
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
4
10
 
5
11
  const usePrevious = value => {
6
- const ref = useRef();
7
- useEffect(() => {
12
+ const ref = React.useRef();
13
+ React.useEffect(() => {
8
14
  ref.current = value;
9
15
  });
10
16
  return ref.current;
@@ -14,10 +20,10 @@ const Executor = ({
14
20
  }) => {
15
21
  const {
16
22
  page
17
- } = useNinetailed();
23
+ } = experience_jsReact.useNinetailed();
18
24
  const previousPathname = usePrevious(location);
19
25
  const pathname = location.pathname;
20
- useEffect(() => {
26
+ React.useEffect(() => {
21
27
  if (pathname !== previousPathname) {
22
28
  page();
23
29
  }
@@ -25,7 +31,7 @@ const Executor = ({
25
31
  return null;
26
32
  };
27
33
  const Tracker = () => {
28
- return /*#__PURE__*/React.createElement(Location, null, location => /*#__PURE__*/React.createElement(Executor, Object.assign({}, location)));
34
+ return /*#__PURE__*/React__default["default"].createElement(router.Location, null, location => /*#__PURE__*/React__default["default"].createElement(Executor, Object.assign({}, location)));
29
35
  };
30
36
 
31
- export { Tracker as T };
37
+ exports.Tracker = Tracker;
package/gatsby-browser.js CHANGED
@@ -1,10 +1,18 @@
1
- import React from 'react';
2
- import { NinetailedProvider } from '@ninetailed/experience.js-react';
3
- import { T as Tracker } from './Tracker.js';
4
- import { n as ninetailedPlugins } from './ninetailed-plugins.js';
5
- import '@reach/router';
6
- import 'path';
7
- import 'crypto';
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var experience_jsReact = require('@ninetailed/experience.js-react');
7
+ var Tracker = require('./Tracker.js');
8
+ var loaders_ninetailedPlugins = require('./loaders/ninetailed-plugins.js');
9
+ require('@reach/router');
10
+ require('path');
11
+ require('crypto');
12
+
13
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
14
+
15
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
8
16
 
9
17
  /******************************************************************************
10
18
  Copyright (c) Microsoft Corporation.
@@ -38,19 +46,19 @@ const WrapRootElement = _a => {
38
46
  children
39
47
  } = _a,
40
48
  options = __rest(_a, ["children"]);
41
- const resolvedPlugins = ninetailedPlugins.plugins.map(({
49
+ const resolvedPlugins = loaders_ninetailedPlugins.plugins.map(({
42
50
  plugin,
43
51
  options
44
52
  }) => plugin(options));
45
- return /*#__PURE__*/React.createElement(NinetailedProvider, Object.assign({}, options, {
53
+ return /*#__PURE__*/React__default["default"].createElement(experience_jsReact.NinetailedProvider, Object.assign({}, options, {
46
54
  plugins: resolvedPlugins
47
- }), /*#__PURE__*/React.createElement(Tracker, null), children);
55
+ }), /*#__PURE__*/React__default["default"].createElement(Tracker.Tracker, null), children);
48
56
  };
49
57
  const wrapRootElement = (args, options) => {
50
58
  const {
51
59
  element
52
60
  } = args;
53
- return /*#__PURE__*/React.createElement(WrapRootElement, Object.assign({}, options), element);
61
+ return /*#__PURE__*/React__default["default"].createElement(WrapRootElement, Object.assign({}, options), element);
54
62
  };
55
63
 
56
- export { wrapRootElement };
64
+ exports.wrapRootElement = wrapRootElement;
package/gatsby-node.js CHANGED
@@ -1,4 +1,12 @@
1
- import require$$0 from 'path';
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var require$$0 = require('path');
6
+
7
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
+
9
+ var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
2
10
 
3
11
  const pluginOptionsSchema = ({
4
12
  Joi
@@ -30,7 +38,7 @@ const onCreateWebpackConfig = ({
30
38
  test: /ninetailed-plugins\.js$/,
31
39
  include: __dirname,
32
40
  use: [loaders.js(), {
33
- loader: require$$0.join(__dirname, `loaders`, `ninetailed-plugins`),
41
+ loader: require$$0__default["default"].join(__dirname, `loaders`, `ninetailed-plugins`),
34
42
  options: {
35
43
  plugins: pluginOptions.ninetailedPlugins
36
44
  }
@@ -40,4 +48,5 @@ const onCreateWebpackConfig = ({
40
48
  });
41
49
  };
42
50
 
43
- export { onCreateWebpackConfig, pluginOptionsSchema };
51
+ exports.onCreateWebpackConfig = onCreateWebpackConfig;
52
+ exports.pluginOptionsSchema = pluginOptionsSchema;
package/gatsby-ssr.js CHANGED
@@ -1,20 +1,28 @@
1
- import React from 'react';
2
- import { NinetailedProvider } from '@ninetailed/experience.js-react';
3
- import { n as ninetailedPlugins } from './ninetailed-plugins.js';
4
- import 'path';
5
- import 'crypto';
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var experience_jsReact = require('@ninetailed/experience.js-react');
7
+ var loaders_ninetailedPlugins = require('./loaders/ninetailed-plugins.js');
8
+ require('path');
9
+ require('crypto');
10
+
11
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
+
13
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
6
14
 
7
15
  const wrapRootElement = (args, options) => {
8
- const resolvedPlugins = ninetailedPlugins.plugins.map(({
16
+ const resolvedPlugins = loaders_ninetailedPlugins.plugins.map(({
9
17
  plugin,
10
18
  options
11
19
  }) => plugin(options));
12
20
  const {
13
21
  element
14
22
  } = args;
15
- return /*#__PURE__*/React.createElement(NinetailedProvider, Object.assign({}, options, {
23
+ return /*#__PURE__*/React__default["default"].createElement(experience_jsReact.NinetailedProvider, Object.assign({}, options, {
16
24
  plugins: resolvedPlugins
17
25
  }), element);
18
26
  };
19
27
 
20
- export { wrapRootElement };
28
+ exports.wrapRootElement = wrapRootElement;
package/index.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var Tracker = require('./Tracker.cjs');
5
+ var Tracker = require('./Tracker.js');
6
6
  var experience_jsReact = require('@ninetailed/experience.js-react');
7
7
  require('react');
8
8
  require('@reach/router');
@@ -6293,4 +6293,4 @@ var ninetailedPlugins = function () {
6293
6293
  return `module.exports = {plugins: ${pluginRequires}}`;
6294
6294
  };
6295
6295
 
6296
- exports.ninetailedPlugins = ninetailedPlugins;
6296
+ module.exports = ninetailedPlugins;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ninetailed/experience.js-gatsby",
3
- "version": "3.0.0-beta.21",
3
+ "version": "3.0.0-beta.24",
4
4
  "keywords": [
5
5
  "gatsby",
6
6
  "gatsby-plugin",
@@ -13,11 +13,11 @@
13
13
  "peerDependencies": {
14
14
  "react": ">=16.8.0",
15
15
  "gatsby": ">=2.27.4",
16
- "@ninetailed/experience.js-react": "3.0.0-beta.21"
16
+ "@ninetailed/experience.js-react": "3.0.0-beta.24",
17
+ "gatsby-plugin-utils": "3.18.0"
17
18
  },
18
- "module": "./index.js",
19
19
  "main": "./index.cjs",
20
- "type": "module",
20
+ "type": "commonjs",
21
21
  "types": "./index.d.ts",
22
22
  "dependencies": {}
23
23
  }
package/Tracker.cjs DELETED
@@ -1,37 +0,0 @@
1
- 'use strict';
2
-
3
- var React = require('react');
4
- var router = require('@reach/router');
5
- var experience_jsReact = require('@ninetailed/experience.js-react');
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
10
-
11
- const usePrevious = value => {
12
- const ref = React.useRef();
13
- React.useEffect(() => {
14
- ref.current = value;
15
- });
16
- return ref.current;
17
- };
18
- const Executor = ({
19
- location
20
- }) => {
21
- const {
22
- page
23
- } = experience_jsReact.useNinetailed();
24
- const previousPathname = usePrevious(location);
25
- const pathname = location.pathname;
26
- React.useEffect(() => {
27
- if (pathname !== previousPathname) {
28
- page();
29
- }
30
- }, [pathname, previousPathname, page]);
31
- return null;
32
- };
33
- const Tracker = () => {
34
- return /*#__PURE__*/React__default["default"].createElement(router.Location, null, location => /*#__PURE__*/React__default["default"].createElement(Executor, Object.assign({}, location)));
35
- };
36
-
37
- exports.Tracker = Tracker;
@@ -1,64 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var React = require('react');
6
- var experience_jsReact = require('@ninetailed/experience.js-react');
7
- var Tracker = require('./Tracker.cjs');
8
- var ninetailedPlugins = require('./ninetailed-plugins.cjs');
9
- require('@reach/router');
10
- require('path');
11
- require('crypto');
12
-
13
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
14
-
15
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
16
-
17
- /******************************************************************************
18
- Copyright (c) Microsoft Corporation.
19
-
20
- Permission to use, copy, modify, and/or distribute this software for any
21
- purpose with or without fee is hereby granted.
22
-
23
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
24
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
25
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
26
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
27
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
28
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
29
- PERFORMANCE OF THIS SOFTWARE.
30
- ***************************************************************************** */
31
-
32
- function __rest(s, e) {
33
- var t = {};
34
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
35
- t[p] = s[p];
36
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
37
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
38
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
39
- t[p[i]] = s[p[i]];
40
- }
41
- return t;
42
- }
43
-
44
- const WrapRootElement = _a => {
45
- var {
46
- children
47
- } = _a,
48
- options = __rest(_a, ["children"]);
49
- const resolvedPlugins = ninetailedPlugins.ninetailedPlugins.plugins.map(({
50
- plugin,
51
- options
52
- }) => plugin(options));
53
- return /*#__PURE__*/React__default["default"].createElement(experience_jsReact.NinetailedProvider, Object.assign({}, options, {
54
- plugins: resolvedPlugins
55
- }), /*#__PURE__*/React__default["default"].createElement(Tracker.Tracker, null), children);
56
- };
57
- const wrapRootElement = (args, options) => {
58
- const {
59
- element
60
- } = args;
61
- return /*#__PURE__*/React__default["default"].createElement(WrapRootElement, Object.assign({}, options), element);
62
- };
63
-
64
- exports.wrapRootElement = wrapRootElement;
package/gatsby-node.cjs DELETED
@@ -1,52 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var require$$0 = require('path');
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
10
-
11
- const pluginOptionsSchema = ({
12
- Joi
13
- }) => {
14
- return Joi.object({
15
- clientId: Joi.string().required().description("Your organizations' client id.").messages({
16
- 'any.required': '"clientId" needs to be specified. Get your clientId from the dashboard.'
17
- }),
18
- environment: Joi.string(),
19
- ninetailedPlugins: Joi.array()
20
- });
21
- };
22
- /**
23
- * Add the webpack config for loading MDX files
24
- */
25
- const onCreateWebpackConfig = ({
26
- loaders,
27
- actions
28
- }, pluginOptions) => {
29
- actions.setWebpackConfig({
30
- resolve: {
31
- fallback: {
32
- path: false,
33
- crypto: false
34
- }
35
- },
36
- module: {
37
- rules: [{
38
- test: /ninetailed-plugins\.js$/,
39
- include: __dirname,
40
- use: [loaders.js(), {
41
- loader: require$$0__default["default"].join(__dirname, `loaders`, `ninetailed-plugins`),
42
- options: {
43
- plugins: pluginOptions.ninetailedPlugins
44
- }
45
- }]
46
- }]
47
- }
48
- });
49
- };
50
-
51
- exports.onCreateWebpackConfig = onCreateWebpackConfig;
52
- exports.pluginOptionsSchema = pluginOptionsSchema;
package/gatsby-ssr.cjs DELETED
@@ -1,28 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var React = require('react');
6
- var experience_jsReact = require('@ninetailed/experience.js-react');
7
- var ninetailedPlugins = require('./ninetailed-plugins.cjs');
8
- require('path');
9
- require('crypto');
10
-
11
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
-
13
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
14
-
15
- const wrapRootElement = (args, options) => {
16
- const resolvedPlugins = ninetailedPlugins.ninetailedPlugins.plugins.map(({
17
- plugin,
18
- options
19
- }) => plugin(options));
20
- const {
21
- element
22
- } = args;
23
- return /*#__PURE__*/React__default["default"].createElement(experience_jsReact.NinetailedProvider, Object.assign({}, options, {
24
- plugins: resolvedPlugins
25
- }), element);
26
- };
27
-
28
- exports.wrapRootElement = wrapRootElement;
package/index.js DELETED
@@ -1,4 +0,0 @@
1
- export { T as Tracker } from './Tracker.js';
2
- export * from '@ninetailed/experience.js-react';
3
- import 'react';
4
- import '@reach/router';