@koine/next 2.0.0-beta.2 → 2.0.0-beta.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/12/AnalyticsGoogle.js +65 -25
- package/12/AnalyticsGoogle.mjs +41 -15
- package/12/DisableErrorOverlay.js +29 -16
- package/12/DisableErrorOverlay.mjs +8 -5
- package/12/DynamicNamespaces.d.ts +1 -1
- package/12/DynamicNamespaces.js +22 -12
- package/12/DynamicNamespaces.mjs +1 -2
- package/12/Favicon.js +28 -9
- package/12/Favicon.mjs +6 -2
- package/12/Link.d.ts +1 -1
- package/12/Link.js +36 -13
- package/12/Link.mjs +14 -6
- package/12/NextProgress.js +47 -24
- package/12/NextProgress.mjs +26 -17
- package/12/Seo.d.ts +1 -1
- package/12/Seo.js +27 -32
- package/12/Seo.mjs +5 -4
- package/12/SeoDefaults.d.ts +1 -1
- package/12/SeoDefaults.js +27 -13
- package/12/SeoDefaults.mjs +5 -3
- package/12/T.d.ts +1 -1
- package/12/T.js +42 -16
- package/12/T.mjs +20 -6
- package/12/ThemeContext.js +22 -7
- package/12/ThemeContext.mjs +3 -3
- package/12/ThemeProvider.js +164 -147
- package/12/ThemeProvider.mjs +139 -129
- package/12/TransText.js +22 -7
- package/12/TransText.mjs +1 -1
- package/12/app/AppHead.js +29 -9
- package/12/app/AppHead.mjs +8 -2
- package/12/app/AppMain.d.ts +4 -4
- package/12/app/AppMain.js +5 -1
- package/12/app/AppMain.mjs +1 -1
- package/12/app/css/AppMain.js +37 -16
- package/12/app/css/AppMain.mjs +15 -5
- package/12/app/css/AppTheme.d.ts +1 -1
- package/12/app/css/AppTheme.js +28 -13
- package/12/app/css/AppTheme.mjs +7 -4
- package/12/app/css/auth/index.d.ts +1 -1
- package/12/app/css/auth/index.js +38 -15
- package/12/app/css/auth/index.mjs +17 -6
- package/12/app/css/index.d.ts +1 -1
- package/12/app/css/index.js +34 -59
- package/12/app/css/index.mjs +14 -6
- package/12/app/index.js +6 -4
- package/12/app/sc/AppMain.js +68 -27
- package/12/app/sc/AppMain.mjs +46 -13
- package/12/app/sc/AppTheme.d.ts +1 -1
- package/12/app/sc/AppTheme.js +31 -13
- package/12/app/sc/AppTheme.mjs +9 -4
- package/12/app/sc/auth/index.d.ts +1 -1
- package/12/app/sc/auth/index.js +38 -15
- package/12/app/sc/auth/index.mjs +17 -6
- package/12/app/sc/index.d.ts +1 -1
- package/12/app/sc/index.js +34 -61
- package/12/app/sc/index.mjs +14 -6
- package/12/document/Document.js +47 -29
- package/12/document/Document.mjs +24 -14
- package/12/document/css/index.js +47 -32
- package/12/document/css/index.mjs +26 -18
- package/12/document/index.js +18 -6
- package/12/document/sc/index.js +71 -65
- package/12/document/sc/index.mjs +46 -45
- package/12/getT.js +22 -13
- package/12/getT.mjs +2 -4
- package/12/index.js +99 -51
- package/12/index.mjs +2 -2
- package/12/seoBuildTags.js +81 -76
- package/12/seoBuildTags.mjs +59 -55
- package/12/to.js +21 -19
- package/12/to.mjs +4 -10
- package/12/translationAsOptions.js +15 -9
- package/12/translationAsOptions.mjs +6 -6
- package/12/types-i18n.js +4 -3
- package/12/types-i18n.mjs +1 -2
- package/12/types-seo.js +3 -1
- package/12/types-seo.mjs +1 -1
- package/12/useBackUrl.js +30 -16
- package/12/useBackUrl.mjs +8 -8
- package/12/useDateFormat.js +37 -38
- package/12/useDateFormat.mjs +15 -28
- package/12/useForm.d.ts +1 -1
- package/12/useForm.js +46 -20
- package/12/useForm.mjs +25 -13
- package/12/useLocale.js +22 -8
- package/12/useT.d.ts +1 -1
- package/12/useT.js +53 -39
- package/12/useT.mjs +32 -14
- package/12/useTheme.js +22 -11
- package/12/useTheme.mjs +1 -2
- package/12/useTo.js +23 -16
- package/12/useTo.mjs +3 -10
- package/README.md +1 -1
- package/config/index.js +225 -251
- package/config/index.mjs +187 -204
- package/getSiteUrl.js +22 -15
- package/getSiteUrl.mjs +2 -4
- package/index.js +19 -6
- package/load.js +21 -8
- package/load.mjs +3 -4
- package/package.json +19 -17
- package/12/app/css/auth/package.json +0 -6
- package/12/app/css/package.json +0 -6
- package/12/app/package.json +0 -6
- package/12/app/sc/auth/package.json +0 -6
- package/12/app/sc/package.json +0 -6
- package/12/document/css/package.json +0 -6
- package/12/document/package.json +0 -6
- package/12/document/sc/package.json +0 -6
- package/12/package.json +0 -6
- package/config/package.json +0 -6
package/12/AnalyticsGoogle.js
CHANGED
|
@@ -1,39 +1,79 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
"use client";
|
|
3
|
-
|
|
4
|
-
exports
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
function _export(target, all) {
|
|
7
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: all[name]
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
_export(exports, {
|
|
13
|
+
AnalyticsGoogle: function() {
|
|
14
|
+
return AnalyticsGoogle;
|
|
15
|
+
},
|
|
16
|
+
default: function() {
|
|
17
|
+
return _default;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
21
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
22
|
+
const _router = require("next/router");
|
|
23
|
+
const _script = /*#__PURE__*/ _interop_require_default._(require("next/script"));
|
|
24
|
+
const _react = require("react");
|
|
25
|
+
const _gtagPageview = /*#__PURE__*/ _interop_require_default._(require("@koine/browser/gtagPageview"));
|
|
26
|
+
const AnalyticsGoogle = ({ id })=>{
|
|
27
|
+
const uid = id || process.env["NEXT_PUBLIC_GTM_ID"];
|
|
28
|
+
const { events, asPath, query } = (0, _router.useRouter)();
|
|
29
|
+
const [ready, setReady] = (0, _react.useState)(false);
|
|
30
|
+
const [routed, setRouted] = (0, _react.useState)(false);
|
|
17
31
|
// const [url, setUrl] = useState("");
|
|
18
|
-
(0,
|
|
19
|
-
|
|
32
|
+
(0, _react.useEffect)(()=>{
|
|
33
|
+
const handleRouteChange = ()=>{
|
|
20
34
|
setRouted(true);
|
|
21
35
|
};
|
|
22
36
|
events.on("routeChangeComplete", handleRouteChange);
|
|
23
|
-
return
|
|
37
|
+
return ()=>{
|
|
24
38
|
events.off("routeChangeComplete", handleRouteChange);
|
|
25
39
|
};
|
|
26
|
-
}, [
|
|
27
|
-
|
|
40
|
+
}, [
|
|
41
|
+
events
|
|
42
|
+
]);
|
|
43
|
+
(0, _react.useEffect)(()=>{
|
|
28
44
|
if (routed && ready && asPath) {
|
|
29
45
|
// const search = query;
|
|
30
|
-
(0,
|
|
46
|
+
(0, _gtagPageview.default)(asPath);
|
|
31
47
|
}
|
|
32
|
-
}, [
|
|
48
|
+
}, [
|
|
49
|
+
asPath,
|
|
50
|
+
query,
|
|
51
|
+
routed,
|
|
52
|
+
ready
|
|
53
|
+
]);
|
|
33
54
|
if (!uid) {
|
|
34
55
|
return null;
|
|
35
56
|
}
|
|
36
|
-
return (
|
|
57
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
58
|
+
children: [
|
|
59
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_script.default, {
|
|
60
|
+
id: "google-tagmanager",
|
|
61
|
+
src: `https://www.googletagmanager.com/gtag/js?id=${id}`,
|
|
62
|
+
strategy: "afterInteractive",
|
|
63
|
+
onLoad: ()=>setReady(true)
|
|
64
|
+
}),
|
|
65
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_script.default, {
|
|
66
|
+
id: "google-analytics",
|
|
67
|
+
strategy: "afterInteractive",
|
|
68
|
+
children: `
|
|
69
|
+
window.dataLayer = window.dataLayer || [];
|
|
70
|
+
function gtag(){window.dataLayer.push(arguments);}
|
|
71
|
+
gtag('js', new Date());
|
|
72
|
+
|
|
73
|
+
gtag('config', '${id}', { 'send_page_view': false });
|
|
74
|
+
`
|
|
75
|
+
})
|
|
76
|
+
]
|
|
77
|
+
});
|
|
37
78
|
};
|
|
38
|
-
|
|
39
|
-
exports.default = exports.AnalyticsGoogle;
|
|
79
|
+
const _default = AnalyticsGoogle;
|
package/12/AnalyticsGoogle.mjs
CHANGED
|
@@ -1,34 +1,60 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx,
|
|
3
|
-
import { useState, useEffect } from "react";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
4
3
|
import { useRouter } from "next/router";
|
|
5
4
|
import Script from "next/script";
|
|
5
|
+
import { useEffect, useState } from "react";
|
|
6
6
|
import gtagPageview from "@koine/browser/gtagPageview";
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _d = useState(false), routed = _d[0], setRouted = _d[1];
|
|
7
|
+
export const AnalyticsGoogle = ({ id })=>{
|
|
8
|
+
const uid = id || process.env["NEXT_PUBLIC_GTM_ID"];
|
|
9
|
+
const { events, asPath, query } = useRouter();
|
|
10
|
+
const [ready, setReady] = useState(false);
|
|
11
|
+
const [routed, setRouted] = useState(false);
|
|
13
12
|
// const [url, setUrl] = useState("");
|
|
14
|
-
useEffect(
|
|
15
|
-
|
|
13
|
+
useEffect(()=>{
|
|
14
|
+
const handleRouteChange = ()=>{
|
|
16
15
|
setRouted(true);
|
|
17
16
|
};
|
|
18
17
|
events.on("routeChangeComplete", handleRouteChange);
|
|
19
|
-
return
|
|
18
|
+
return ()=>{
|
|
20
19
|
events.off("routeChangeComplete", handleRouteChange);
|
|
21
20
|
};
|
|
22
|
-
}, [
|
|
23
|
-
|
|
21
|
+
}, [
|
|
22
|
+
events
|
|
23
|
+
]);
|
|
24
|
+
useEffect(()=>{
|
|
24
25
|
if (routed && ready && asPath) {
|
|
25
26
|
// const search = query;
|
|
26
27
|
gtagPageview(asPath);
|
|
27
28
|
}
|
|
28
|
-
}, [
|
|
29
|
+
}, [
|
|
30
|
+
asPath,
|
|
31
|
+
query,
|
|
32
|
+
routed,
|
|
33
|
+
ready
|
|
34
|
+
]);
|
|
29
35
|
if (!uid) {
|
|
30
36
|
return null;
|
|
31
37
|
}
|
|
32
|
-
return
|
|
38
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
39
|
+
children: [
|
|
40
|
+
/*#__PURE__*/ _jsx(Script, {
|
|
41
|
+
id: "google-tagmanager",
|
|
42
|
+
src: `https://www.googletagmanager.com/gtag/js?id=${id}`,
|
|
43
|
+
strategy: "afterInteractive",
|
|
44
|
+
onLoad: ()=>setReady(true)
|
|
45
|
+
}),
|
|
46
|
+
/*#__PURE__*/ _jsx(Script, {
|
|
47
|
+
id: "google-analytics",
|
|
48
|
+
strategy: "afterInteractive",
|
|
49
|
+
children: `
|
|
50
|
+
window.dataLayer = window.dataLayer || [];
|
|
51
|
+
function gtag(){window.dataLayer.push(arguments);}
|
|
52
|
+
gtag('js', new Date());
|
|
53
|
+
|
|
54
|
+
gtag('config', '${id}', { 'send_page_view': false });
|
|
55
|
+
`
|
|
56
|
+
})
|
|
57
|
+
]
|
|
58
|
+
});
|
|
33
59
|
};
|
|
34
60
|
export default AnalyticsGoogle;
|
|
@@ -1,18 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
DisableErrorOverlay: function() {
|
|
13
|
+
return DisableErrorOverlay;
|
|
14
|
+
},
|
|
15
|
+
default: function() {
|
|
16
|
+
return _default;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
21
|
+
const _head = /*#__PURE__*/ _interop_require_default._(require("next/head"));
|
|
22
|
+
const DisableErrorOverlay = ()=>{
|
|
23
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_head.default, {
|
|
24
|
+
children: process.env["NODE_ENV"] !== "production" && /*#__PURE__*/ (0, _jsxruntime.jsx)("script", {
|
|
25
|
+
dangerouslySetInnerHTML: {
|
|
26
|
+
__html: `window.addEventListener('error',event =>{event.stopImmediatePropagation()});window.addEventListener('unhandledrejection',event =>{event.stopImmediatePropagation()});`
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
});
|
|
16
30
|
};
|
|
17
|
-
|
|
18
|
-
exports.default = exports.DisableErrorOverlay;
|
|
31
|
+
const _default = DisableErrorOverlay;
|
|
@@ -4,10 +4,13 @@ import Head from "next/head";
|
|
|
4
4
|
* Disable error overlay during `dev`
|
|
5
5
|
*
|
|
6
6
|
* @see https://github.com/vercel/next.js/discussions/13387#discussioncomment-101564
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
*/ export const DisableErrorOverlay = ()=>{
|
|
8
|
+
return /*#__PURE__*/ _jsx(Head, {
|
|
9
|
+
children: process.env["NODE_ENV"] !== "production" && /*#__PURE__*/ _jsx("script", {
|
|
10
|
+
dangerouslySetInnerHTML: {
|
|
11
|
+
__html: `window.addEventListener('error',event =>{event.stopImmediatePropagation()});window.addEventListener('unhandledrejection',event =>{event.stopImmediatePropagation()});`
|
|
12
|
+
}
|
|
13
|
+
})
|
|
14
|
+
});
|
|
12
15
|
};
|
|
13
16
|
export default DisableErrorOverlay;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import BaseDynamicNamespaces from "next-translate/DynamicNamespaces";
|
|
2
1
|
import type { DynamicNamespacesProps as BaseDynamicNamespacesProps } from "next-translate";
|
|
2
|
+
import BaseDynamicNamespaces from "next-translate/DynamicNamespaces";
|
|
3
3
|
import type { TranslateNamespace } from "./types-i18n";
|
|
4
4
|
export type DynamicNamespacesProps = Omit<BaseDynamicNamespacesProps, "namespaces"> & {
|
|
5
5
|
namespaces: TranslateNamespace[];
|
package/12/DynamicNamespaces.js
CHANGED
|
@@ -1,13 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
"use client";
|
|
3
|
-
|
|
4
|
-
exports
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
exports
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
function _export(target, all) {
|
|
7
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: all[name]
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
_export(exports, {
|
|
13
|
+
DynamicNamespaces: function() {
|
|
14
|
+
return DynamicNamespaces;
|
|
15
|
+
},
|
|
16
|
+
default: function() {
|
|
17
|
+
return _default;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
21
|
+
const _DynamicNamespaces = /*#__PURE__*/ _interop_require_default._(require("next-translate/DynamicNamespaces"));
|
|
22
|
+
const DynamicNamespaces = _DynamicNamespaces.default;
|
|
23
|
+
const _default = DynamicNamespaces;
|
package/12/DynamicNamespaces.mjs
CHANGED
|
@@ -4,6 +4,5 @@ import BaseDynamicNamespaces from "next-translate/DynamicNamespaces";
|
|
|
4
4
|
* **NOTE**: To make typescript work nicely here make sure to enable
|
|
5
5
|
* [`resolveJsonModule`](https://www.typescriptlang.org/tsconfig#resolveJsonModule)
|
|
6
6
|
* in your `tsconfig.json` file.
|
|
7
|
-
*/
|
|
8
|
-
export var DynamicNamespaces = BaseDynamicNamespaces;
|
|
7
|
+
*/ export const DynamicNamespaces = BaseDynamicNamespaces;
|
|
9
8
|
export default DynamicNamespaces;
|
package/12/Favicon.js
CHANGED
|
@@ -1,10 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
Favicon: function() {
|
|
13
|
+
return Favicon;
|
|
14
|
+
},
|
|
15
|
+
default: function() {
|
|
16
|
+
return _default;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
21
|
+
const _head = /*#__PURE__*/ _interop_require_default._(require("next/head"));
|
|
22
|
+
const _react = /*#__PURE__*/ _interop_require_default._(require("react"));
|
|
23
|
+
const _FaviconTags = /*#__PURE__*/ _interop_require_default._(require("@koine/react/FaviconTags"));
|
|
24
|
+
const Favicon = (props)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_head.default, {
|
|
25
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_FaviconTags.default, {
|
|
26
|
+
...props
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
const _default = Favicon;
|
package/12/Favicon.mjs
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
2
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import Head from "next/head";
|
|
3
|
+
import React from "react";
|
|
4
4
|
import FaviconTags from "@koine/react/FaviconTags";
|
|
5
|
-
export
|
|
5
|
+
export const Favicon = (props)=>/*#__PURE__*/ _jsx(Head, {
|
|
6
|
+
children: /*#__PURE__*/ _jsx(FaviconTags, {
|
|
7
|
+
...props
|
|
8
|
+
})
|
|
9
|
+
});
|
|
6
10
|
export default Favicon;
|
package/12/Link.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { LinkProps as NextLinkProps } from "next/link";
|
|
2
|
+
import React from "react";
|
|
3
3
|
export type LinkProps = Omit<React.ComponentPropsWithRef<"a">, "href"> & Omit<NextLinkProps, "as" | "passHref" | "children"> & {
|
|
4
4
|
Link?: React.ComponentType<any>;
|
|
5
5
|
};
|
package/12/Link.js
CHANGED
|
@@ -1,15 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
var react_1 = require("react");
|
|
7
|
-
var link_1 = tslib_1.__importDefault(require("next/link"));
|
|
8
|
-
/**
|
|
9
|
-
* @see https://next.js.org/docs/api-reference/next/link
|
|
10
|
-
*/
|
|
11
|
-
exports.Link = (0, react_1.forwardRef)(function Link(_a, ref) {
|
|
12
|
-
var href = _a.href, prefetch = _a.prefetch, replace = _a.replace, scroll = _a.scroll, shallow = _a.shallow, locale = _a.locale, _b = _a.Link, Link = _b === void 0 ? "span" : _b, props = tslib_1.__rest(_a, ["href", "prefetch", "replace", "scroll", "shallow", "locale", "Link"]);
|
|
13
|
-
return ((0, jsx_runtime_1.jsx)(link_1.default, { href: href, replace: replace, scroll: scroll, shallow: shallow, locale: locale, passHref: true, children: (0, jsx_runtime_1.jsx)(Link, tslib_1.__assign({ ref: ref }, props)) }));
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
14
4
|
});
|
|
15
|
-
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
Link: function() {
|
|
13
|
+
return Link;
|
|
14
|
+
},
|
|
15
|
+
default: function() {
|
|
16
|
+
return _default;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
21
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
22
|
+
const _link = /*#__PURE__*/ _interop_require_default._(require("next/link"));
|
|
23
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
24
|
+
const Link = /*#__PURE__*/ (0, _react.forwardRef)(function Link({ href, prefetch, replace, scroll, shallow, locale, Link = "span", ...props }, ref) {
|
|
25
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_link.default, {
|
|
26
|
+
href: href,
|
|
27
|
+
replace: replace,
|
|
28
|
+
scroll: scroll,
|
|
29
|
+
shallow: shallow,
|
|
30
|
+
locale: locale,
|
|
31
|
+
passHref: true,
|
|
32
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(Link, {
|
|
33
|
+
ref: ref,
|
|
34
|
+
...props
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
const _default = Link;
|
package/12/Link.mjs
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import { __assign, __rest } from "tslib";
|
|
2
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
2
|
import NextLink from "next/link";
|
|
3
|
+
import React, { forwardRef } from "react";
|
|
5
4
|
/**
|
|
6
5
|
* @see https://next.js.org/docs/api-reference/next/link
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
*/ export const Link = /*#__PURE__*/ forwardRef(function Link({ href, prefetch, replace, scroll, shallow, locale, Link = "span", ...props }, ref) {
|
|
7
|
+
return /*#__PURE__*/ _jsx(NextLink, {
|
|
8
|
+
href: href,
|
|
9
|
+
replace: replace,
|
|
10
|
+
scroll: scroll,
|
|
11
|
+
shallow: shallow,
|
|
12
|
+
locale: locale,
|
|
13
|
+
passHref: true,
|
|
14
|
+
children: /*#__PURE__*/ _jsx(Link, {
|
|
15
|
+
ref: ref,
|
|
16
|
+
...props
|
|
17
|
+
})
|
|
18
|
+
});
|
|
11
19
|
});
|
|
12
20
|
export default Link;
|
package/12/NextProgress.js
CHANGED
|
@@ -1,46 +1,69 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
"use client";
|
|
3
|
-
|
|
4
|
-
exports
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
function _export(target, all) {
|
|
7
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: all[name]
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
_export(exports, {
|
|
13
|
+
NextProgress: function() {
|
|
14
|
+
return NextProgress;
|
|
15
|
+
},
|
|
16
|
+
default: function() {
|
|
17
|
+
return _default;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
21
|
+
const _router = require("next/router");
|
|
22
|
+
const _react = require("react");
|
|
23
|
+
const NextProgress = ({ startAt = 0.3, showOnShallow = true, stopDelayMs = 200, Overlay = "div" })=>{
|
|
24
|
+
const { events } = (0, _router.useRouter)();
|
|
11
25
|
// const [progress, setProgress] = useState(0);
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var shallow = _a.shallow;
|
|
26
|
+
const [running, setRunning] = (0, _react.useState)(false);
|
|
27
|
+
const timer = (0, _react.useRef)(null);
|
|
28
|
+
const routeChangeStart = (0, _react.useCallback)((_, { shallow })=>{
|
|
16
29
|
if (!shallow || showOnShallow) {
|
|
17
30
|
// setProgress(startAt);
|
|
18
31
|
setRunning(true);
|
|
19
32
|
}
|
|
20
|
-
}, [
|
|
21
|
-
|
|
22
|
-
|
|
33
|
+
}, [
|
|
34
|
+
showOnShallow
|
|
35
|
+
]);
|
|
36
|
+
const routeChangeEnd = (0, _react.useCallback)((_, { shallow })=>{
|
|
23
37
|
if (!shallow || showOnShallow) {
|
|
24
38
|
if (timer.current) {
|
|
25
39
|
clearTimeout(timer.current);
|
|
26
40
|
}
|
|
27
|
-
timer.current = setTimeout(
|
|
41
|
+
timer.current = setTimeout(()=>{
|
|
28
42
|
// setProgress(100);
|
|
29
43
|
setRunning(false);
|
|
30
44
|
}, stopDelayMs);
|
|
31
45
|
}
|
|
32
|
-
}, [
|
|
33
|
-
|
|
46
|
+
}, [
|
|
47
|
+
showOnShallow,
|
|
48
|
+
stopDelayMs,
|
|
49
|
+
timer
|
|
50
|
+
]);
|
|
51
|
+
(0, _react.useEffect)(()=>{
|
|
34
52
|
events.on("routeChangeStart", routeChangeStart);
|
|
35
53
|
events.on("routeChangeComplete", routeChangeEnd);
|
|
36
54
|
events.on("routeChangeError", routeChangeEnd);
|
|
37
|
-
return
|
|
55
|
+
return ()=>{
|
|
38
56
|
events.off("routeChangeStart", routeChangeStart);
|
|
39
57
|
events.off("routeChangeComplete", routeChangeEnd);
|
|
40
58
|
events.off("routeChangeError", routeChangeEnd);
|
|
41
59
|
};
|
|
42
|
-
}, [
|
|
43
|
-
|
|
60
|
+
}, [
|
|
61
|
+
events,
|
|
62
|
+
routeChangeStart,
|
|
63
|
+
routeChangeEnd
|
|
64
|
+
]);
|
|
65
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(Overlay, {
|
|
66
|
+
running: running
|
|
67
|
+
});
|
|
44
68
|
};
|
|
45
|
-
|
|
46
|
-
exports.default = exports.NextProgress;
|
|
69
|
+
const _default = NextProgress;
|
package/12/NextProgress.mjs
CHANGED
|
@@ -1,42 +1,51 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
3
|
import { useRouter } from "next/router";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
5
|
+
export const NextProgress = ({ startAt = 0.3, showOnShallow = true, stopDelayMs = 200, Overlay = "div" })=>{
|
|
6
|
+
const { events } = useRouter();
|
|
8
7
|
// const [progress, setProgress] = useState(0);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var shallow = _a.shallow;
|
|
8
|
+
const [running, setRunning] = useState(false);
|
|
9
|
+
const timer = useRef(null);
|
|
10
|
+
const routeChangeStart = useCallback((_, { shallow })=>{
|
|
13
11
|
if (!shallow || showOnShallow) {
|
|
14
12
|
// setProgress(startAt);
|
|
15
13
|
setRunning(true);
|
|
16
14
|
}
|
|
17
|
-
}, [
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
}, [
|
|
16
|
+
showOnShallow
|
|
17
|
+
]);
|
|
18
|
+
const routeChangeEnd = useCallback((_, { shallow })=>{
|
|
20
19
|
if (!shallow || showOnShallow) {
|
|
21
20
|
if (timer.current) {
|
|
22
21
|
clearTimeout(timer.current);
|
|
23
22
|
}
|
|
24
|
-
timer.current = setTimeout(
|
|
23
|
+
timer.current = setTimeout(()=>{
|
|
25
24
|
// setProgress(100);
|
|
26
25
|
setRunning(false);
|
|
27
26
|
}, stopDelayMs);
|
|
28
27
|
}
|
|
29
|
-
}, [
|
|
30
|
-
|
|
28
|
+
}, [
|
|
29
|
+
showOnShallow,
|
|
30
|
+
stopDelayMs,
|
|
31
|
+
timer
|
|
32
|
+
]);
|
|
33
|
+
useEffect(()=>{
|
|
31
34
|
events.on("routeChangeStart", routeChangeStart);
|
|
32
35
|
events.on("routeChangeComplete", routeChangeEnd);
|
|
33
36
|
events.on("routeChangeError", routeChangeEnd);
|
|
34
|
-
return
|
|
37
|
+
return ()=>{
|
|
35
38
|
events.off("routeChangeStart", routeChangeStart);
|
|
36
39
|
events.off("routeChangeComplete", routeChangeEnd);
|
|
37
40
|
events.off("routeChangeError", routeChangeEnd);
|
|
38
41
|
};
|
|
39
|
-
}, [
|
|
40
|
-
|
|
42
|
+
}, [
|
|
43
|
+
events,
|
|
44
|
+
routeChangeStart,
|
|
45
|
+
routeChangeEnd
|
|
46
|
+
]);
|
|
47
|
+
return /*#__PURE__*/ _jsx(Overlay, {
|
|
48
|
+
running: running
|
|
49
|
+
});
|
|
41
50
|
};
|
|
42
51
|
export default NextProgress;
|
package/12/Seo.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { NextSeoProps } from "next-seo/lib/types";
|
|
2
|
+
import { type LinkTag, type MetaTag } from "./seoBuildTags";
|
|
2
3
|
import type { SeoData } from "./types-seo";
|
|
3
|
-
import { type MetaTag, type LinkTag } from "./seoBuildTags";
|
|
4
4
|
type SeoPropsOpenGraph = NextSeoProps["openGraph"] & {
|
|
5
5
|
image?: string;
|
|
6
6
|
};
|