@next/third-parties 14.0.5-canary.3 → 14.0.5-canary.4
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/dist/ThirdPartyScriptEmbed.d.ts +1 -1
- package/dist/ThirdPartyScriptEmbed.js +6 -30
- package/dist/google/google-maps-embed.d.ts +1 -2
- package/dist/google/google-maps-embed.js +2 -2
- package/dist/google/gtm.d.ts +1 -2
- package/dist/google/gtm.js +5 -29
- package/dist/google/youtube-embed.d.ts +1 -2
- package/dist/google/youtube-embed.js +2 -2
- package/package.json +2 -2
|
@@ -6,4 +6,4 @@ export type ScriptEmbed = {
|
|
|
6
6
|
children?: React.ReactElement | React.ReactElement[];
|
|
7
7
|
dataNtpc?: string;
|
|
8
8
|
};
|
|
9
|
-
export default function ThirdPartyScriptEmbed({ html, height, width, children, dataNtpc, }: ScriptEmbed):
|
|
9
|
+
export default function ThirdPartyScriptEmbed({ html, height, width, children, dataNtpc, }: ScriptEmbed): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,30 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
'use client';
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
-
if (mod && mod.__esModule) return mod;
|
|
21
|
-
var result = {};
|
|
22
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
-
__setModuleDefault(result, mod);
|
|
24
|
-
return result;
|
|
25
|
-
};
|
|
26
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
const
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
28
6
|
function ThirdPartyScriptEmbed({ html, height = null, width = null, children, dataNtpc = '', }) {
|
|
29
7
|
(0, react_1.useEffect)(() => {
|
|
30
8
|
if (dataNtpc) {
|
|
@@ -38,11 +16,9 @@ function ThirdPartyScriptEmbed({ html, height = null, width = null, children, da
|
|
|
38
16
|
});
|
|
39
17
|
}
|
|
40
18
|
}, [dataNtpc]);
|
|
41
|
-
return (
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
width: width != null ? `${width}px` : 'auto',
|
|
46
|
-
}, "data-ntpc": dataNtpc, dangerouslySetInnerHTML: { __html: html } })) : null));
|
|
19
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [children, html ? ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
20
|
+
height: height != null ? `${height}px` : 'auto',
|
|
21
|
+
width: width != null ? `${width}px` : 'auto',
|
|
22
|
+
}, "data-ntpc": dataNtpc, dangerouslySetInnerHTML: { __html: html } })) : null] }));
|
|
47
23
|
}
|
|
48
24
|
exports.default = ThirdPartyScriptEmbed;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { GoogleMapsEmbed as GoogleMapsEmbedTypes } from '../types/google';
|
|
3
|
-
export default function GoogleMapsEmbed(props: GoogleMapsEmbedTypes):
|
|
2
|
+
export default function GoogleMapsEmbed(props: GoogleMapsEmbedTypes): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,13 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const third_party_capital_1 = require("third-party-capital");
|
|
8
8
|
const ThirdPartyScriptEmbed_1 = __importDefault(require("../ThirdPartyScriptEmbed"));
|
|
9
9
|
function GoogleMapsEmbed(props) {
|
|
10
10
|
const { apiKey, ...restProps } = props;
|
|
11
11
|
const formattedProps = { ...restProps, key: apiKey };
|
|
12
12
|
const { html } = (0, third_party_capital_1.GoogleMapsEmbed)(formattedProps);
|
|
13
|
-
return (
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)(ThirdPartyScriptEmbed_1.default, { height: formattedProps.height || null, width: formattedProps.width || null, html: html, dataNtpc: "GoogleMapsEmbed" }));
|
|
14
14
|
}
|
|
15
15
|
exports.default = GoogleMapsEmbed;
|
package/dist/google/gtm.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { GTMParams } from '../types/google';
|
|
3
|
-
export declare function GoogleTagManager(props: GTMParams):
|
|
2
|
+
export declare function GoogleTagManager(props: GTMParams): import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export declare const sendGTMEvent: (data: Object) => void;
|
package/dist/google/gtm.js
CHANGED
|
@@ -1,35 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
'use client';
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
-
if (mod && mod.__esModule) return mod;
|
|
21
|
-
var result = {};
|
|
22
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
-
__setModuleDefault(result, mod);
|
|
24
|
-
return result;
|
|
25
|
-
};
|
|
26
3
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
27
4
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
5
|
};
|
|
29
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
7
|
exports.sendGTMEvent = exports.GoogleTagManager = void 0;
|
|
8
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
31
9
|
// TODO: Evaluate import 'client only'
|
|
32
|
-
const react_1 =
|
|
10
|
+
const react_1 = require("react");
|
|
33
11
|
const script_1 = __importDefault(require("next/script"));
|
|
34
12
|
let currDataLayerName = undefined;
|
|
35
13
|
function GoogleTagManager(props) {
|
|
@@ -50,16 +28,14 @@ function GoogleTagManager(props) {
|
|
|
50
28
|
},
|
|
51
29
|
});
|
|
52
30
|
}, []);
|
|
53
|
-
return (
|
|
54
|
-
|
|
55
|
-
__html: `
|
|
31
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(script_1.default, { id: "_next-gtm-init", dangerouslySetInnerHTML: {
|
|
32
|
+
__html: `
|
|
56
33
|
(function(w,l){
|
|
57
34
|
w[l]=w[l]||[];
|
|
58
35
|
w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});
|
|
59
36
|
${dataLayer ? `w[l].push(${JSON.stringify(dataLayer)})` : ''}
|
|
60
37
|
})(window,'${dataLayerName}');`,
|
|
61
|
-
|
|
62
|
-
react_1.default.createElement(script_1.default, { id: "_next-gtm", "data-ntpc": "GTM", src: `https://www.googletagmanager.com/gtm.js?id=${gtmId}${gtmLayer}${gtmAuth}${gtmPreview}` })));
|
|
38
|
+
} }), (0, jsx_runtime_1.jsx)(script_1.default, { id: "_next-gtm", "data-ntpc": "GTM", src: `https://www.googletagmanager.com/gtm.js?id=${gtmId}${gtmLayer}${gtmAuth}${gtmPreview}` })] }));
|
|
63
39
|
}
|
|
64
40
|
exports.GoogleTagManager = GoogleTagManager;
|
|
65
41
|
const sendGTMEvent = (data) => {
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { YouTubeEmbed as YouTubeEmbedTypes } from '../types/google';
|
|
3
|
-
export default function YouTubeEmbed(props: YouTubeEmbedTypes):
|
|
2
|
+
export default function YouTubeEmbed(props: YouTubeEmbedTypes): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const script_1 = __importDefault(require("next/script"));
|
|
8
8
|
const third_party_capital_1 = require("third-party-capital");
|
|
9
9
|
const ThirdPartyScriptEmbed_1 = __importDefault(require("../ThirdPartyScriptEmbed"));
|
|
@@ -15,6 +15,6 @@ const scriptStrategy = {
|
|
|
15
15
|
};
|
|
16
16
|
function YouTubeEmbed(props) {
|
|
17
17
|
const { html, scripts, stylesheets } = (0, third_party_capital_1.YouTubeEmbed)(props);
|
|
18
|
-
return (
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)(ThirdPartyScriptEmbed_1.default, { height: props.height || null, width: props.width || null, html: html, dataNtpc: "YouTubeEmbed", children: scripts === null || scripts === void 0 ? void 0 : scripts.map((script) => ((0, jsx_runtime_1.jsx)(script_1.default, { src: script.url, strategy: scriptStrategy[script.strategy], stylesheets: stylesheets }, script.url))) }));
|
|
19
19
|
}
|
|
20
20
|
exports.default = YouTubeEmbed;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next/third-parties",
|
|
3
|
-
"version": "14.0.5-canary.
|
|
3
|
+
"version": "14.0.5-canary.4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"url": "vercel/next.js",
|
|
6
6
|
"directory": "packages/third-parties"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"third-party-capital": "1.0.20"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"next": "14.0.5-canary.
|
|
28
|
+
"next": "14.0.5-canary.4",
|
|
29
29
|
"outdent": "0.8.0",
|
|
30
30
|
"prettier": "2.5.1"
|
|
31
31
|
},
|