@amon-analytics/next 0.0.1
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/index.d.mts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +78 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +44 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +86 -0
package/dist/index.d.mts
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
|
|
31
|
+
// src/index.tsx
|
|
32
|
+
var index_exports = {};
|
|
33
|
+
__export(index_exports, {
|
|
34
|
+
Amon: () => Amon
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(index_exports);
|
|
37
|
+
var import_script = __toESM(require("next/script"));
|
|
38
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
|
+
function Amon({ publicApiKey }) {
|
|
40
|
+
const gtmloader = `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
|
41
|
+
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
|
42
|
+
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|
43
|
+
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
|
44
|
+
})(window,document,'script','dataLayer','GTM-K4SQR86R');`;
|
|
45
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
46
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
47
|
+
import_script.default,
|
|
48
|
+
{
|
|
49
|
+
id: "amon",
|
|
50
|
+
strategy: "afterInteractive",
|
|
51
|
+
dangerouslySetInnerHTML: {
|
|
52
|
+
__html: gtmloader
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
57
|
+
"script",
|
|
58
|
+
{
|
|
59
|
+
src: "https://ai-analytics-7tka.onrender.com/gtmtracker.js",
|
|
60
|
+
"public-api-key": publicApiKey
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("noscript", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
64
|
+
"iframe",
|
|
65
|
+
{
|
|
66
|
+
src: "https://www.googletagmanager.com/ns.html?id=GTM-K4SQR86R",
|
|
67
|
+
height: "0",
|
|
68
|
+
width: "0",
|
|
69
|
+
style: { display: "none", visibility: "hidden" }
|
|
70
|
+
}
|
|
71
|
+
) })
|
|
72
|
+
] });
|
|
73
|
+
}
|
|
74
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
75
|
+
0 && (module.exports = {
|
|
76
|
+
Amon
|
|
77
|
+
});
|
|
78
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.tsx"],"sourcesContent":["// Official SDK file for Amon. Published to npm, and will be used by client apps. Not meant for public use.\r\n\r\n\"use client\";\r\n\r\nimport Script from \"next/script\";\r\n\r\ntype Props = {\r\n publicApiKey: string;\r\n}\r\n\r\nexport function Amon({ publicApiKey }: Props) {\r\n const gtmloader = `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\r\n new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\r\n j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\r\n 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\r\n })(window,document,'script','dataLayer','GTM-K4SQR86R');`\r\n\r\n return (\r\n <>\r\n {/* Load GTM Script */}\r\n <Script\r\n id=\"amon\"\r\n strategy=\"afterInteractive\"\r\n dangerouslySetInnerHTML={{\r\n __html: gtmloader,\r\n }}\r\n />\r\n\r\n {/* Send api key to backend */}\r\n <script src=\"https://ai-analytics-7tka.onrender.com/gtmtracker.js\"\r\n public-api-key={publicApiKey}>\r\n </script>\r\n\r\n {/* Fallback when no script is allowed */}\r\n <noscript>\r\n <iframe\r\n src=\"https://www.googletagmanager.com/ns.html?id=GTM-K4SQR86R\"\r\n height=\"0\"\r\n width=\"0\"\r\n style={{ display: \"none\", visibility: \"hidden\" }}\r\n ></iframe>\r\n </noscript>\r\n </>\r\n );\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,oBAAmB;AAcX;AARD,SAAS,KAAK,EAAE,aAAa,GAAU;AAC1C,QAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAMlB,SACI,4EAEI;AAAA;AAAA,MAAC,cAAAA;AAAA,MAAA;AAAA,QACG,IAAG;AAAA,QACH,UAAS;AAAA,QACT,yBAAyB;AAAA,UACrB,QAAQ;AAAA,QACZ;AAAA;AAAA,IACJ;AAAA,IAGA;AAAA,MAAC;AAAA;AAAA,QAAO,KAAI;AAAA,QACJ,kBAAgB;AAAA;AAAA,IACxB;AAAA,IAGA,4CAAC,cACG;AAAA,MAAC;AAAA;AAAA,QACG,KAAI;AAAA,QACJ,QAAO;AAAA,QACP,OAAM;AAAA,QACN,OAAO,EAAE,SAAS,QAAQ,YAAY,SAAS;AAAA;AAAA,IAClD,GACL;AAAA,KACJ;AAER;","names":["Script"]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/index.tsx
|
|
4
|
+
import Script from "next/script";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
function Amon({ publicApiKey }) {
|
|
7
|
+
const gtmloader = `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
|
8
|
+
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
|
9
|
+
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|
10
|
+
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
|
11
|
+
})(window,document,'script','dataLayer','GTM-K4SQR86R');`;
|
|
12
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
13
|
+
/* @__PURE__ */ jsx(
|
|
14
|
+
Script,
|
|
15
|
+
{
|
|
16
|
+
id: "amon",
|
|
17
|
+
strategy: "afterInteractive",
|
|
18
|
+
dangerouslySetInnerHTML: {
|
|
19
|
+
__html: gtmloader
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
),
|
|
23
|
+
/* @__PURE__ */ jsx(
|
|
24
|
+
"script",
|
|
25
|
+
{
|
|
26
|
+
src: "https://ai-analytics-7tka.onrender.com/gtmtracker.js",
|
|
27
|
+
"public-api-key": publicApiKey
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
/* @__PURE__ */ jsx("noscript", { children: /* @__PURE__ */ jsx(
|
|
31
|
+
"iframe",
|
|
32
|
+
{
|
|
33
|
+
src: "https://www.googletagmanager.com/ns.html?id=GTM-K4SQR86R",
|
|
34
|
+
height: "0",
|
|
35
|
+
width: "0",
|
|
36
|
+
style: { display: "none", visibility: "hidden" }
|
|
37
|
+
}
|
|
38
|
+
) })
|
|
39
|
+
] });
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
Amon
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.tsx"],"sourcesContent":["// Official SDK file for Amon. Published to npm, and will be used by client apps. Not meant for public use.\r\n\r\n\"use client\";\r\n\r\nimport Script from \"next/script\";\r\n\r\ntype Props = {\r\n publicApiKey: string;\r\n}\r\n\r\nexport function Amon({ publicApiKey }: Props) {\r\n const gtmloader = `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\r\n new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\r\n j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\r\n 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\r\n })(window,document,'script','dataLayer','GTM-K4SQR86R');`\r\n\r\n return (\r\n <>\r\n {/* Load GTM Script */}\r\n <Script\r\n id=\"amon\"\r\n strategy=\"afterInteractive\"\r\n dangerouslySetInnerHTML={{\r\n __html: gtmloader,\r\n }}\r\n />\r\n\r\n {/* Send api key to backend */}\r\n <script src=\"https://ai-analytics-7tka.onrender.com/gtmtracker.js\"\r\n public-api-key={publicApiKey}>\r\n </script>\r\n\r\n {/* Fallback when no script is allowed */}\r\n <noscript>\r\n <iframe\r\n src=\"https://www.googletagmanager.com/ns.html?id=GTM-K4SQR86R\"\r\n height=\"0\"\r\n width=\"0\"\r\n style={{ display: \"none\", visibility: \"hidden\" }}\r\n ></iframe>\r\n </noscript>\r\n </>\r\n );\r\n}\r\n"],"mappings":";;;AAIA,OAAO,YAAY;AAcX,mBAEI,KAFJ;AARD,SAAS,KAAK,EAAE,aAAa,GAAU;AAC1C,QAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAMlB,SACI,iCAEI;AAAA;AAAA,MAAC;AAAA;AAAA,QACG,IAAG;AAAA,QACH,UAAS;AAAA,QACT,yBAAyB;AAAA,UACrB,QAAQ;AAAA,QACZ;AAAA;AAAA,IACJ;AAAA,IAGA;AAAA,MAAC;AAAA;AAAA,QAAO,KAAI;AAAA,QACJ,kBAAgB;AAAA;AAAA,IACxB;AAAA,IAGA,oBAAC,cACG;AAAA,MAAC;AAAA;AAAA,QACG,KAAI;AAAA,QACJ,QAAO;AAAA,QACP,OAAM;AAAA,QACN,OAAO,EAAE,SAAS,QAAQ,YAAY,SAAS;AAAA;AAAA,IAClD,GACL;AAAA,KACJ;AAER;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@amon-analytics/next",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"types": "dist/index.d.ts",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsup src/index.tsx --format esm,cjs --dts"
|
|
11
|
+
},
|
|
12
|
+
"peerDependencies": {
|
|
13
|
+
"next": ">=13",
|
|
14
|
+
"react": ">=18"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@types/node": "^25.2.1",
|
|
18
|
+
"@types/react": "^19.2.13",
|
|
19
|
+
"@types/react-dom": "^19.2.3",
|
|
20
|
+
"next": "^16.1.6",
|
|
21
|
+
"react": "^19.2.4",
|
|
22
|
+
"react-dom": "^19.2.4",
|
|
23
|
+
"tsup": "^8.5.1",
|
|
24
|
+
"typescript": "^5.9.3"
|
|
25
|
+
},
|
|
26
|
+
"description": "",
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"acorn": "^8.15.0",
|
|
29
|
+
"any-promise": "^1.3.0",
|
|
30
|
+
"baseline-browser-mapping": "^2.9.19",
|
|
31
|
+
"bundle-require": "^5.1.0",
|
|
32
|
+
"cac": "^6.7.14",
|
|
33
|
+
"caniuse-lite": "^1.0.30001768",
|
|
34
|
+
"chokidar": "^4.0.3",
|
|
35
|
+
"client-only": "^0.0.1",
|
|
36
|
+
"commander": "^4.1.1",
|
|
37
|
+
"confbox": "^0.1.8",
|
|
38
|
+
"consola": "^3.4.2",
|
|
39
|
+
"csstype": "^3.2.3",
|
|
40
|
+
"debug": "^4.4.3",
|
|
41
|
+
"detect-libc": "^2.1.2",
|
|
42
|
+
"esbuild": "^0.27.2",
|
|
43
|
+
"fdir": "^6.5.0",
|
|
44
|
+
"fix-dts-default-cjs-exports": "^1.0.1",
|
|
45
|
+
"joycon": "^3.1.1",
|
|
46
|
+
"lilconfig": "^3.1.3",
|
|
47
|
+
"lines-and-columns": "^1.2.4",
|
|
48
|
+
"load-tsconfig": "^0.2.5",
|
|
49
|
+
"magic-string": "^0.30.21",
|
|
50
|
+
"mlly": "^1.8.0",
|
|
51
|
+
"ms": "^2.1.3",
|
|
52
|
+
"mz": "^2.7.0",
|
|
53
|
+
"nanoid": "^3.3.11",
|
|
54
|
+
"object-assign": "^4.1.1",
|
|
55
|
+
"pathe": "^2.0.3",
|
|
56
|
+
"picocolors": "^1.1.1",
|
|
57
|
+
"picomatch": "^4.0.3",
|
|
58
|
+
"pirates": "^4.0.7",
|
|
59
|
+
"pkg-types": "^1.3.1",
|
|
60
|
+
"postcss": "^8.4.31",
|
|
61
|
+
"postcss-load-config": "^6.0.1",
|
|
62
|
+
"readdirp": "^4.1.2",
|
|
63
|
+
"resolve-from": "^5.0.0",
|
|
64
|
+
"rollup": "^4.57.1",
|
|
65
|
+
"scheduler": "^0.27.0",
|
|
66
|
+
"semver": "^7.7.4",
|
|
67
|
+
"sharp": "^0.34.5",
|
|
68
|
+
"source-map": "^0.7.6",
|
|
69
|
+
"source-map-js": "^1.2.1",
|
|
70
|
+
"styled-jsx": "^5.1.6",
|
|
71
|
+
"sucrase": "^3.35.1",
|
|
72
|
+
"thenify": "^3.3.1",
|
|
73
|
+
"thenify-all": "^1.6.0",
|
|
74
|
+
"tinyexec": "^0.3.2",
|
|
75
|
+
"tinyglobby": "^0.2.15",
|
|
76
|
+
"tree-kill": "^1.2.2",
|
|
77
|
+
"ts-interface-checker": "^0.1.13",
|
|
78
|
+
"tslib": "^2.8.1",
|
|
79
|
+
"ufo": "^1.6.3",
|
|
80
|
+
"undici-types": "^7.16.0"
|
|
81
|
+
},
|
|
82
|
+
"keywords": [],
|
|
83
|
+
"author": "",
|
|
84
|
+
"license": "ISC",
|
|
85
|
+
"type": "commonjs"
|
|
86
|
+
}
|