@koine/next 2.0.0-beta.125 → 2.0.0-beta.127
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/12/AnalyticsGoogle.cjs.js +22 -0
- package/12/AnalyticsGoogle.esm.js +17 -0
- package/12/DisableErrorOverlay.cjs.js +15 -0
- package/12/DisableErrorOverlay.esm.js +10 -0
- package/12/seoBuildTags.d.ts +0 -1
- package/12.cjs.js +4 -22
- package/12.esm.js +2 -24
- package/ThemeContext.d.ts +0 -1
- package/ThemeProvider.d.ts +0 -1
- package/config.cjs.js +9 -1
- package/config.d.ts +6 -7
- package/config.esm.js +9 -1
- package/index.cjs.js +0 -4
- package/index.esm.js +0 -4
- package/package.json +12 -4
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var router = require('next/router');
|
|
7
|
+
var o = require('next/script');
|
|
8
|
+
var react = require('react');
|
|
9
|
+
var browser = require('@koine/browser');
|
|
10
|
+
|
|
11
|
+
/** Falls back to `.env` variable `NEXT_PUBLIC_GTM_ID` */let AnalyticsGoogle=({id:s})=>{let l=s||process.env.NEXT_PUBLIC_GTM_ID,{events:m,asPath:c,query:d}=router.useRouter(),[p,f]=react.useState(!1),[w,u]=react.useState(!1);return (// const [url, setUrl] = useState("");
|
|
12
|
+
react.useEffect(()=>{let e=()=>{u(!0);};return m.on("routeChangeComplete",e),()=>{m.off("routeChangeComplete",e);}},[m]),react.useEffect(()=>{w&&p&&c&&// const search = query;
|
|
13
|
+
browser.gtagPageview(c);},[c,d,w,p]),l)?/*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[/*#__PURE__*/jsxRuntime.jsx(o,{id:"google-tagmanager",src:`https://www.googletagmanager.com/gtag/js?id=${s}`,strategy:"afterInteractive",onLoad:()=>f(!0)}),/*#__PURE__*/jsxRuntime.jsx(o,{id:"google-analytics",strategy:"afterInteractive",children:`
|
|
14
|
+
window.dataLayer = window.dataLayer || [];
|
|
15
|
+
function gtag(){window.dataLayer.push(arguments);}
|
|
16
|
+
gtag('js', new Date());
|
|
17
|
+
|
|
18
|
+
gtag('config', '${s}', { 'send_page_view': false });
|
|
19
|
+
`})]}):null};
|
|
20
|
+
|
|
21
|
+
exports.AnalyticsGoogle = AnalyticsGoogle;
|
|
22
|
+
exports.default = AnalyticsGoogle;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useRouter } from 'next/router';
|
|
3
|
+
import o from 'next/script';
|
|
4
|
+
import { useState, useEffect } from 'react';
|
|
5
|
+
import { gtagPageview } from '@koine/browser';
|
|
6
|
+
|
|
7
|
+
/** Falls back to `.env` variable `NEXT_PUBLIC_GTM_ID` */let AnalyticsGoogle=({id:s})=>{let l=s||process.env.NEXT_PUBLIC_GTM_ID,{events:m,asPath:c,query:d}=useRouter(),[p,f]=useState(!1),[w,u]=useState(!1);return (// const [url, setUrl] = useState("");
|
|
8
|
+
useEffect(()=>{let e=()=>{u(!0);};return m.on("routeChangeComplete",e),()=>{m.off("routeChangeComplete",e);}},[m]),useEffect(()=>{w&&p&&c&&// const search = query;
|
|
9
|
+
gtagPageview(c);},[c,d,w,p]),l)?/*#__PURE__*/jsxs(Fragment,{children:[/*#__PURE__*/jsx(o,{id:"google-tagmanager",src:`https://www.googletagmanager.com/gtag/js?id=${s}`,strategy:"afterInteractive",onLoad:()=>f(!0)}),/*#__PURE__*/jsx(o,{id:"google-analytics",strategy:"afterInteractive",children:`
|
|
10
|
+
window.dataLayer = window.dataLayer || [];
|
|
11
|
+
function gtag(){window.dataLayer.push(arguments);}
|
|
12
|
+
gtag('js', new Date());
|
|
13
|
+
|
|
14
|
+
gtag('config', '${s}', { 'send_page_view': false });
|
|
15
|
+
`})]}):null};
|
|
16
|
+
|
|
17
|
+
export { AnalyticsGoogle, AnalyticsGoogle as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var r = require('next/head');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Disable error overlay during `dev`
|
|
10
|
+
*
|
|
11
|
+
* @see https://github.com/vercel/next.js/discussions/13387#discussioncomment-101564
|
|
12
|
+
*/let DisableErrorOverlay=()=>/*#__PURE__*/jsxRuntime.jsx(r,{children:"development"===process.env.NODE_ENV&&/*#__PURE__*/jsxRuntime.jsx("script",{dangerouslySetInnerHTML:{__html:"window.addEventListener('error',event =>{event.stopImmediatePropagation()});window.addEventListener('unhandledrejection',event =>{event.stopImmediatePropagation()});"}})});
|
|
13
|
+
|
|
14
|
+
exports.DisableErrorOverlay = DisableErrorOverlay;
|
|
15
|
+
exports.default = DisableErrorOverlay;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import r from 'next/head';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Disable error overlay during `dev`
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/vercel/next.js/discussions/13387#discussioncomment-101564
|
|
8
|
+
*/let DisableErrorOverlay=()=>/*#__PURE__*/jsx(r,{children:"development"===process.env.NODE_ENV&&/*#__PURE__*/jsx("script",{dangerouslySetInnerHTML:{__html:"window.addEventListener('error',event =>{event.stopImmediatePropagation()});window.addEventListener('unhandledrejection',event =>{event.stopImmediatePropagation()});"}})});
|
|
9
|
+
|
|
10
|
+
export { DisableErrorOverlay, DisableErrorOverlay as default };
|
package/12/seoBuildTags.d.ts
CHANGED
package/12.cjs.js
CHANGED
|
@@ -1,27 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var o = require('next/script');
|
|
6
|
-
var react = require('react');
|
|
7
|
-
var browser = require('@koine/browser');
|
|
8
|
-
var r = require('next/head');
|
|
3
|
+
var AnalyticsGoogle = require('./12/AnalyticsGoogle.cjs.js');
|
|
4
|
+
var DisableErrorOverlay = require('./12/DisableErrorOverlay.cjs.js');
|
|
9
5
|
|
|
10
|
-
/** Falls back to `.env` variable `NEXT_PUBLIC_GTM_ID` */let AnalyticsGoogle=({id:s})=>{let l=s||process.env.NEXT_PUBLIC_GTM_ID,{events:m,asPath:c,query:d}=router.useRouter(),[p,f]=react.useState(!1),[w,u]=react.useState(!1);return (// const [url, setUrl] = useState("");
|
|
11
|
-
react.useEffect(()=>{let e=()=>{u(!0);};return m.on("routeChangeComplete",e),()=>{m.off("routeChangeComplete",e);}},[m]),react.useEffect(()=>{w&&p&&c&&// const search = query;
|
|
12
|
-
browser.gtagPageview(c);},[c,d,w,p]),l)?/*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[/*#__PURE__*/jsxRuntime.jsx(o,{id:"google-tagmanager",src:`https://www.googletagmanager.com/gtag/js?id=${s}`,strategy:"afterInteractive",onLoad:()=>f(!0)}),/*#__PURE__*/jsxRuntime.jsx(o,{id:"google-analytics",strategy:"afterInteractive",children:`
|
|
13
|
-
window.dataLayer = window.dataLayer || [];
|
|
14
|
-
function gtag(){window.dataLayer.push(arguments);}
|
|
15
|
-
gtag('js', new Date());
|
|
16
6
|
|
|
17
|
-
gtag('config', '${s}', { 'send_page_view': false });
|
|
18
|
-
`})]}):null};
|
|
19
7
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*
|
|
23
|
-
* @see https://github.com/vercel/next.js/discussions/13387#discussioncomment-101564
|
|
24
|
-
*/let DisableErrorOverlay=()=>/*#__PURE__*/jsxRuntime.jsx(r,{children:"development"===process.env.NODE_ENV&&/*#__PURE__*/jsxRuntime.jsx("script",{dangerouslySetInnerHTML:{__html:"window.addEventListener('error',event =>{event.stopImmediatePropagation()});window.addEventListener('unhandledrejection',event =>{event.stopImmediatePropagation()});"}})});
|
|
25
|
-
|
|
26
|
-
exports.AnalyticsGoogle = AnalyticsGoogle;
|
|
27
|
-
exports.DisableErrorOverlay = DisableErrorOverlay;
|
|
8
|
+
exports.AnalyticsGoogle = AnalyticsGoogle.AnalyticsGoogle;
|
|
9
|
+
exports.DisableErrorOverlay = DisableErrorOverlay.DisableErrorOverlay;
|
package/12.esm.js
CHANGED
|
@@ -1,24 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import o from 'next/script';
|
|
4
|
-
import { useState, useEffect } from 'react';
|
|
5
|
-
import { gtagPageview } from '@koine/browser';
|
|
6
|
-
import r from 'next/head';
|
|
7
|
-
|
|
8
|
-
/** Falls back to `.env` variable `NEXT_PUBLIC_GTM_ID` */let AnalyticsGoogle=({id:s})=>{let l=s||process.env.NEXT_PUBLIC_GTM_ID,{events:m,asPath:c,query:d}=useRouter(),[p,f]=useState(!1),[w,u]=useState(!1);return (// const [url, setUrl] = useState("");
|
|
9
|
-
useEffect(()=>{let e=()=>{u(!0);};return m.on("routeChangeComplete",e),()=>{m.off("routeChangeComplete",e);}},[m]),useEffect(()=>{w&&p&&c&&// const search = query;
|
|
10
|
-
gtagPageview(c);},[c,d,w,p]),l)?/*#__PURE__*/jsxs(Fragment,{children:[/*#__PURE__*/jsx(o,{id:"google-tagmanager",src:`https://www.googletagmanager.com/gtag/js?id=${s}`,strategy:"afterInteractive",onLoad:()=>f(!0)}),/*#__PURE__*/jsx(o,{id:"google-analytics",strategy:"afterInteractive",children:`
|
|
11
|
-
window.dataLayer = window.dataLayer || [];
|
|
12
|
-
function gtag(){window.dataLayer.push(arguments);}
|
|
13
|
-
gtag('js', new Date());
|
|
14
|
-
|
|
15
|
-
gtag('config', '${s}', { 'send_page_view': false });
|
|
16
|
-
`})]}):null};
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Disable error overlay during `dev`
|
|
20
|
-
*
|
|
21
|
-
* @see https://github.com/vercel/next.js/discussions/13387#discussioncomment-101564
|
|
22
|
-
*/let DisableErrorOverlay=()=>/*#__PURE__*/jsx(r,{children:"development"===process.env.NODE_ENV&&/*#__PURE__*/jsx("script",{dangerouslySetInnerHTML:{__html:"window.addEventListener('error',event =>{event.stopImmediatePropagation()});window.addEventListener('unhandledrejection',event =>{event.stopImmediatePropagation()});"}})});
|
|
23
|
-
|
|
24
|
-
export { AnalyticsGoogle, DisableErrorOverlay };
|
|
1
|
+
export { AnalyticsGoogle } from './12/AnalyticsGoogle.esm.js';
|
|
2
|
+
export { DisableErrorOverlay } from './12/DisableErrorOverlay.esm.js';
|
package/ThemeContext.d.ts
CHANGED
package/ThemeProvider.d.ts
CHANGED
package/config.cjs.js
CHANGED
|
@@ -6,8 +6,16 @@ var next = require('@koine/i18n/next');
|
|
|
6
6
|
/**
|
|
7
7
|
* @legacy
|
|
8
8
|
*//**
|
|
9
|
+
* A list of the packages to modularize, if a `scope` is given that will be
|
|
10
|
+
* automatically prepended before a slash e.g. `{scope}/@{lib}`.
|
|
11
|
+
* @example ["components", "utils"]
|
|
12
|
+
*//**
|
|
13
|
+
* The scope of the packages to modularize, if given a slash is automatically
|
|
14
|
+
* appended between the scope and the lib name
|
|
15
|
+
* @example "@"
|
|
16
|
+
*//**
|
|
9
17
|
* Shortcut option to automatically create swc transforms to feed into
|
|
10
|
-
*
|
|
18
|
+
* _Next.js_' `modularizeImports`
|
|
11
19
|
*//**
|
|
12
20
|
* Get Next.js config with some basic opinionated defaults
|
|
13
21
|
*
|
package/config.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import type { NextConfig } from "next";
|
|
2
2
|
import { type WithI18nAsyncOptions, type WithI18nLegacyOptions } from "@koine/i18n/next";
|
|
3
3
|
export type Routes = NonNullable<WithI18nLegacyOptions["i18nRoutes"]>["routes"];
|
|
4
|
+
type ModularizeShortcut = {
|
|
5
|
+
libs: string[];
|
|
6
|
+
scope?: string;
|
|
7
|
+
};
|
|
4
8
|
export type WithKoineOptions = NextConfig & {
|
|
5
9
|
nx?: boolean;
|
|
6
10
|
svg?: boolean;
|
|
7
|
-
modularize?:
|
|
8
|
-
scope: string;
|
|
9
|
-
libs: string[];
|
|
10
|
-
}[] | {
|
|
11
|
-
scope: string;
|
|
12
|
-
libs: string[];
|
|
13
|
-
};
|
|
11
|
+
modularize?: ModularizeShortcut[] | ModularizeShortcut;
|
|
14
12
|
} & WithI18nLegacyOptions & WithI18nAsyncOptions;
|
|
15
13
|
export declare let withKoine: (options?: WithKoineOptions) => NextConfig;
|
|
14
|
+
export {};
|
package/config.esm.js
CHANGED
|
@@ -4,8 +4,16 @@ import { withI18nLegacy, withI18nAsync, withI18n } from '@koine/i18n/next';
|
|
|
4
4
|
/**
|
|
5
5
|
* @legacy
|
|
6
6
|
*//**
|
|
7
|
+
* A list of the packages to modularize, if a `scope` is given that will be
|
|
8
|
+
* automatically prepended before a slash e.g. `{scope}/@{lib}`.
|
|
9
|
+
* @example ["components", "utils"]
|
|
10
|
+
*//**
|
|
11
|
+
* The scope of the packages to modularize, if given a slash is automatically
|
|
12
|
+
* appended between the scope and the lib name
|
|
13
|
+
* @example "@"
|
|
14
|
+
*//**
|
|
7
15
|
* Shortcut option to automatically create swc transforms to feed into
|
|
8
|
-
*
|
|
16
|
+
* _Next.js_' `modularizeImports`
|
|
9
17
|
*//**
|
|
10
18
|
* Get Next.js config with some basic opinionated defaults
|
|
11
19
|
*
|
package/index.cjs.js
CHANGED
|
@@ -4,10 +4,6 @@ var load = require('./load.cjs.js');
|
|
|
4
4
|
var ThemeContext = require('./ThemeContext.cjs.js');
|
|
5
5
|
var ThemeProvider = require('./ThemeProvider.cjs.js');
|
|
6
6
|
var useTheme = require('./useTheme.cjs.js');
|
|
7
|
-
require('react');
|
|
8
|
-
require('react/jsx-runtime');
|
|
9
|
-
require('next/script');
|
|
10
|
-
require('@koine/utils');
|
|
11
7
|
|
|
12
8
|
|
|
13
9
|
|
package/index.esm.js
CHANGED
|
@@ -2,7 +2,3 @@ export { load } from './load.esm.js';
|
|
|
2
2
|
export { ThemeContext } from './ThemeContext.esm.js';
|
|
3
3
|
export { ThemeProvider } from './ThemeProvider.esm.js';
|
|
4
4
|
export { useTheme } from './useTheme.esm.js';
|
|
5
|
-
import 'react';
|
|
6
|
-
import 'react/jsx-runtime';
|
|
7
|
-
import 'next/script';
|
|
8
|
-
import '@koine/utils';
|
package/package.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"name": "@koine/next",
|
|
3
3
|
"sideEffects": false,
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@koine/browser": "2.0.0-beta.
|
|
6
|
-
"@koine/utils": "2.0.0-beta.
|
|
7
|
-
"@koine/i18n": "2.0.0-beta.
|
|
5
|
+
"@koine/browser": "2.0.0-beta.127",
|
|
6
|
+
"@koine/utils": "2.0.0-beta.127",
|
|
7
|
+
"@koine/i18n": "2.0.0-beta.127"
|
|
8
8
|
},
|
|
9
9
|
"peerDependencies": {
|
|
10
10
|
"next": "^14.0.4",
|
|
@@ -20,41 +20,49 @@
|
|
|
20
20
|
"./package.json": "./package.json",
|
|
21
21
|
".": {
|
|
22
22
|
"module": "./index.esm.js",
|
|
23
|
+
"types": "./index.esm.d.ts",
|
|
23
24
|
"import": "./index.cjs.mjs",
|
|
24
25
|
"default": "./index.cjs.js"
|
|
25
26
|
},
|
|
26
27
|
"./12": {
|
|
27
28
|
"module": "./12.esm.js",
|
|
29
|
+
"types": "./12.esm.d.ts",
|
|
28
30
|
"import": "./12.cjs.mjs",
|
|
29
31
|
"default": "./12.cjs.js"
|
|
30
32
|
},
|
|
31
33
|
"./config": {
|
|
32
34
|
"module": "./config.esm.js",
|
|
35
|
+
"types": "./config.esm.d.ts",
|
|
33
36
|
"import": "./config.cjs.mjs",
|
|
34
37
|
"default": "./config.cjs.js"
|
|
35
38
|
},
|
|
36
39
|
"./load": {
|
|
37
40
|
"module": "./load.esm.js",
|
|
41
|
+
"types": "./load.esm.d.ts",
|
|
38
42
|
"import": "./load.cjs.mjs",
|
|
39
43
|
"default": "./load.cjs.js"
|
|
40
44
|
},
|
|
41
45
|
"./ThemeContext": {
|
|
42
46
|
"module": "./ThemeContext.esm.js",
|
|
47
|
+
"types": "./ThemeContext.esm.d.ts",
|
|
43
48
|
"import": "./ThemeContext.cjs.mjs",
|
|
44
49
|
"default": "./ThemeContext.cjs.js"
|
|
45
50
|
},
|
|
46
51
|
"./ThemeProvider": {
|
|
47
52
|
"module": "./ThemeProvider.esm.js",
|
|
53
|
+
"types": "./ThemeProvider.esm.d.ts",
|
|
48
54
|
"import": "./ThemeProvider.cjs.mjs",
|
|
49
55
|
"default": "./ThemeProvider.cjs.js"
|
|
50
56
|
},
|
|
51
57
|
"./useTheme": {
|
|
52
58
|
"module": "./useTheme.esm.js",
|
|
59
|
+
"types": "./useTheme.esm.d.ts",
|
|
53
60
|
"import": "./useTheme.cjs.mjs",
|
|
54
61
|
"default": "./useTheme.cjs.js"
|
|
55
62
|
}
|
|
56
63
|
},
|
|
57
64
|
"module": "./index.esm.js",
|
|
58
65
|
"main": "./index.cjs.js",
|
|
59
|
-
"
|
|
66
|
+
"types": "./index.esm.d.ts",
|
|
67
|
+
"version": "2.0.0-beta.127"
|
|
60
68
|
}
|