@koine/next 1.2.2 → 2.0.0-alpha.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/AnalyticsGoogle.js +1 -0
- package/AnalyticsGoogle.mjs +1 -0
- package/DynamicNamespaces.js +1 -0
- package/DynamicNamespaces.mjs +1 -0
- package/NextProgress.js +1 -0
- package/NextProgress.mjs +1 -0
- package/T.js +1 -0
- package/T.mjs +1 -0
- package/ThemeProvider.js +1 -0
- package/ThemeProvider.mjs +1 -0
- package/TransText.js +1 -0
- package/TransText.mjs +1 -0
- package/auth/useLoginUrl.js +1 -0
- package/auth/useLoginUrl.mjs +1 -0
- package/auth/useLogout.js +1 -0
- package/auth/useLogout.mjs +1 -0
- package/getT.js +2 -1
- package/getT.mjs +1 -0
- package/index.d.ts +2 -28
- package/index.js +5 -31
- package/index.mjs +2 -30
- package/legacy/AnalyticsGoogle.d.ts +6 -0
- package/legacy/AnalyticsGoogle.js +39 -0
- package/legacy/AnalyticsGoogle.mjs +35 -0
- package/legacy/DisableErrorOverlay.d.ts +7 -0
- package/legacy/DisableErrorOverlay.js +18 -0
- package/legacy/DisableErrorOverlay.mjs +13 -0
- package/legacy/DynamicNamespaces.d.ts +13 -0
- package/legacy/DynamicNamespaces.js +13 -0
- package/legacy/DynamicNamespaces.mjs +9 -0
- package/legacy/Favicon.d.ts +4 -0
- package/legacy/Favicon.js +10 -0
- package/legacy/Favicon.mjs +6 -0
- package/legacy/Link.d.ts +10 -0
- package/legacy/Link.js +15 -0
- package/legacy/Link.mjs +12 -0
- package/legacy/NextProgress.d.ts +25 -0
- package/legacy/NextProgress.js +46 -0
- package/legacy/NextProgress.mjs +42 -0
- package/legacy/Seo.d.ts +41 -0
- package/legacy/Seo.js +34 -0
- package/legacy/Seo.mjs +29 -0
- package/legacy/SeoDefaults.d.ts +11 -0
- package/legacy/SeoDefaults.js +17 -0
- package/legacy/SeoDefaults.mjs +12 -0
- package/legacy/T.d.ts +15 -0
- package/legacy/T.js +17 -0
- package/legacy/T.mjs +13 -0
- package/legacy/ThemeContext.d.ts +17 -0
- package/legacy/ThemeContext.js +10 -0
- package/legacy/ThemeContext.mjs +7 -0
- package/legacy/ThemeProvider.d.ts +35 -0
- package/legacy/ThemeProvider.js +251 -0
- package/legacy/ThemeProvider.mjs +247 -0
- package/legacy/TransText.d.ts +3 -0
- package/legacy/TransText.js +8 -0
- package/legacy/TransText.mjs +4 -0
- package/legacy/app/AppHead.d.ts +3 -0
- package/legacy/app/AppHead.js +11 -0
- package/legacy/app/AppHead.mjs +6 -0
- package/legacy/app/AppMain.d.ts +35 -0
- package/legacy/app/AppMain.js +2 -0
- package/legacy/app/AppMain.mjs +1 -0
- package/legacy/app/css/AppMain.d.ts +9 -0
- package/legacy/app/css/AppMain.js +18 -0
- package/legacy/app/css/AppMain.mjs +14 -0
- package/legacy/app/css/AppTheme.d.ts +11 -0
- package/legacy/app/css/AppTheme.js +19 -0
- package/legacy/app/css/AppTheme.mjs +15 -0
- package/legacy/app/css/auth/index.d.ts +11 -0
- package/legacy/app/css/auth/index.js +17 -0
- package/legacy/app/css/auth/index.mjs +13 -0
- package/legacy/app/css/auth/package.json +6 -0
- package/legacy/app/css/index.d.ts +54 -0
- package/legacy/app/css/index.js +61 -0
- package/legacy/app/css/index.mjs +57 -0
- package/legacy/app/css/package.json +6 -0
- package/legacy/app/index.d.ts +2 -0
- package/legacy/app/index.js +5 -0
- package/legacy/app/index.mjs +2 -0
- package/legacy/app/package.json +6 -0
- package/legacy/app/sc/AppMain.d.ts +11 -0
- package/legacy/app/sc/AppMain.js +29 -0
- package/legacy/app/sc/AppMain.mjs +25 -0
- package/legacy/app/sc/AppTheme.d.ts +14 -0
- package/legacy/app/sc/AppTheme.js +16 -0
- package/legacy/app/sc/AppTheme.mjs +12 -0
- package/legacy/app/sc/auth/index.d.ts +11 -0
- package/legacy/app/sc/auth/index.js +17 -0
- package/legacy/app/sc/auth/index.mjs +13 -0
- package/legacy/app/sc/auth/package.json +6 -0
- package/legacy/app/sc/index.d.ts +56 -0
- package/legacy/app/sc/index.js +63 -0
- package/legacy/app/sc/index.mjs +59 -0
- package/legacy/app/sc/package.json +6 -0
- package/legacy/document/Document.d.ts +16 -0
- package/legacy/document/Document.js +31 -0
- package/legacy/document/Document.mjs +28 -0
- package/legacy/document/css/index.d.ts +18 -0
- package/legacy/document/css/index.js +45 -0
- package/legacy/document/css/index.mjs +45 -0
- package/legacy/document/css/package.json +6 -0
- package/legacy/document/index.d.ts +2 -0
- package/legacy/document/index.js +7 -0
- package/legacy/document/index.mjs +2 -0
- package/legacy/document/package.json +6 -0
- package/legacy/document/sc/index.d.ts +20 -0
- package/legacy/document/sc/index.js +67 -0
- package/legacy/document/sc/index.mjs +64 -0
- package/legacy/document/sc/package.json +6 -0
- package/legacy/getT.d.ts +9 -0
- package/legacy/getT.js +14 -0
- package/legacy/getT.mjs +10 -0
- package/legacy/index.d.ts +24 -0
- package/legacy/index.js +52 -0
- package/legacy/index.mjs +27 -0
- package/legacy/package.json +6 -0
- package/legacy/seoBuildTags.d.ts +23 -0
- package/legacy/seoBuildTags.js +121 -0
- package/legacy/seoBuildTags.mjs +117 -0
- package/legacy/to.d.ts +24 -0
- package/legacy/to.js +29 -0
- package/legacy/to.mjs +25 -0
- package/legacy/translationAsOptions.d.ts +3 -0
- package/legacy/translationAsOptions.js +13 -0
- package/legacy/translationAsOptions.mjs +9 -0
- package/legacy/types-i18n.d.ts +118 -0
- package/legacy/types-i18n.js +14 -0
- package/legacy/types-i18n.mjs +13 -0
- package/legacy/types-seo.d.ts +7 -0
- package/legacy/types-seo.js +2 -0
- package/legacy/types-seo.mjs +1 -0
- package/legacy/useBackUrl.d.ts +2 -0
- package/legacy/useBackUrl.js +33 -0
- package/legacy/useBackUrl.mjs +28 -0
- package/legacy/useDateFormat.d.ts +7 -0
- package/legacy/useDateFormat.js +43 -0
- package/legacy/useDateFormat.mjs +39 -0
- package/legacy/useForm.d.ts +27 -0
- package/legacy/useForm.js +39 -0
- package/legacy/useForm.mjs +35 -0
- package/legacy/useLocale.d.ts +2 -0
- package/legacy/useLocale.js +11 -0
- package/legacy/useLocale.mjs +6 -0
- package/legacy/useT.d.ts +17 -0
- package/legacy/useT.js +40 -0
- package/legacy/useT.mjs +19 -0
- package/legacy/useTheme.d.ts +7 -0
- package/legacy/useTheme.js +12 -0
- package/legacy/useTheme.mjs +8 -0
- package/legacy/useTo.d.ts +3 -0
- package/legacy/useTo.js +19 -0
- package/legacy/useTo.mjs +15 -0
- package/package.json +4 -10
- package/typings.d.ts +0 -87
- package/useBackUrl.js +1 -0
- package/useBackUrl.mjs +1 -0
- package/useDateFormat.js +1 -0
- package/useDateFormat.mjs +1 -0
- package/useForm.js +1 -0
- package/useForm.mjs +1 -0
- package/useLocale.js +1 -0
- package/useLocale.mjs +1 -0
- package/useT.js +1 -0
- package/useT.mjs +1 -16
- package/useTheme.js +1 -0
- package/useTheme.mjs +1 -0
- package/useTo.js +1 -0
- package/useTo.mjs +1 -0
package/AnalyticsGoogle.js
CHANGED
package/AnalyticsGoogle.mjs
CHANGED
package/DynamicNamespaces.js
CHANGED
package/DynamicNamespaces.mjs
CHANGED
package/NextProgress.js
CHANGED
package/NextProgress.mjs
CHANGED
package/T.js
CHANGED
package/T.mjs
CHANGED
package/ThemeProvider.js
CHANGED
package/ThemeProvider.mjs
CHANGED
package/TransText.js
CHANGED
package/TransText.mjs
CHANGED
package/auth/useLoginUrl.js
CHANGED
package/auth/useLoginUrl.mjs
CHANGED
package/auth/useLogout.js
CHANGED
package/auth/useLogout.mjs
CHANGED
package/getT.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
"use client";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.getT = void 0;
|
|
5
5
|
var tslib_1 = require("tslib");
|
|
6
|
+
/* eslint-disable @typescript-eslint/no-unnecessary-type-constraint */
|
|
6
7
|
var getT_1 = tslib_1.__importDefault(require("next-translate/getT"));
|
|
7
8
|
/**
|
|
8
9
|
* **NOTE**: To make typescript work nicely here make sure to enable
|
package/getT.mjs
CHANGED
package/index.d.ts
CHANGED
|
@@ -1,28 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export * from "./DynamicNamespaces";
|
|
4
|
-
export * from "./Favicon";
|
|
5
|
-
export * from "./getSiteUrl";
|
|
6
|
-
export * from "./getT";
|
|
7
|
-
export * from "./Head";
|
|
8
|
-
export * from "./Link";
|
|
9
|
-
export * from "./load";
|
|
10
|
-
export * from "./NextProgress";
|
|
11
|
-
export * from "./revalidate";
|
|
12
|
-
export * from "./Seo";
|
|
13
|
-
export * from "./SeoDefaults";
|
|
14
|
-
export * from "./T";
|
|
15
|
-
export * from "./ThemeContext";
|
|
16
|
-
export * from "./ThemeProvider";
|
|
17
|
-
export * from "./to";
|
|
18
|
-
export * from "./translationAsOptions";
|
|
19
|
-
export * from "./TransText";
|
|
20
|
-
export * from "./types-i18n";
|
|
21
|
-
export * from "./types-seo";
|
|
22
|
-
export * from "./useBackUrl";
|
|
23
|
-
export * from "./useDateFormat";
|
|
24
|
-
export * from "./useForm";
|
|
25
|
-
export * from "./useLocale";
|
|
26
|
-
export * from "./useT";
|
|
27
|
-
export * from "./useTheme";
|
|
28
|
-
export * from "./useTo";
|
|
1
|
+
export { getSiteUrl } from "./getSiteUrl";
|
|
2
|
+
export { load } from "./load";
|
package/index.js
CHANGED
|
@@ -1,33 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
tslib_1.__exportStar(require("./Favicon"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./getSiteUrl"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./getT"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./Head"), exports);
|
|
12
|
-
tslib_1.__exportStar(require("./Link"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("./load"), exports);
|
|
14
|
-
tslib_1.__exportStar(require("./NextProgress"), exports);
|
|
15
|
-
tslib_1.__exportStar(require("./revalidate"), exports);
|
|
16
|
-
tslib_1.__exportStar(require("./Seo"), exports);
|
|
17
|
-
// export * from "./seoBuildTags";
|
|
18
|
-
tslib_1.__exportStar(require("./SeoDefaults"), exports);
|
|
19
|
-
tslib_1.__exportStar(require("./T"), exports);
|
|
20
|
-
tslib_1.__exportStar(require("./ThemeContext"), exports);
|
|
21
|
-
tslib_1.__exportStar(require("./ThemeProvider"), exports);
|
|
22
|
-
tslib_1.__exportStar(require("./to"), exports);
|
|
23
|
-
tslib_1.__exportStar(require("./translationAsOptions"), exports);
|
|
24
|
-
tslib_1.__exportStar(require("./TransText"), exports);
|
|
25
|
-
tslib_1.__exportStar(require("./types-i18n"), exports);
|
|
26
|
-
tslib_1.__exportStar(require("./types-seo"), exports);
|
|
27
|
-
tslib_1.__exportStar(require("./useBackUrl"), exports);
|
|
28
|
-
tslib_1.__exportStar(require("./useDateFormat"), exports);
|
|
29
|
-
tslib_1.__exportStar(require("./useForm"), exports);
|
|
30
|
-
tslib_1.__exportStar(require("./useLocale"), exports);
|
|
31
|
-
tslib_1.__exportStar(require("./useT"), exports);
|
|
32
|
-
tslib_1.__exportStar(require("./useTheme"), exports);
|
|
33
|
-
tslib_1.__exportStar(require("./useTo"), exports);
|
|
3
|
+
exports.load = exports.getSiteUrl = void 0;
|
|
4
|
+
var getSiteUrl_1 = require("./getSiteUrl");
|
|
5
|
+
Object.defineProperty(exports, "getSiteUrl", { enumerable: true, get: function () { return getSiteUrl_1.getSiteUrl; } });
|
|
6
|
+
var load_1 = require("./load");
|
|
7
|
+
Object.defineProperty(exports, "load", { enumerable: true, get: function () { return load_1.load; } });
|
package/index.mjs
CHANGED
|
@@ -1,30 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
export * from "./DisableErrorOverlay";
|
|
4
|
-
export * from "./DynamicNamespaces";
|
|
5
|
-
export * from "./Favicon";
|
|
6
|
-
export * from "./getSiteUrl";
|
|
7
|
-
export * from "./getT";
|
|
8
|
-
export * from "./Head";
|
|
9
|
-
export * from "./Link";
|
|
10
|
-
export * from "./load";
|
|
11
|
-
export * from "./NextProgress";
|
|
12
|
-
export * from "./revalidate";
|
|
13
|
-
export * from "./Seo";
|
|
14
|
-
// export * from "./seoBuildTags";
|
|
15
|
-
export * from "./SeoDefaults";
|
|
16
|
-
export * from "./T";
|
|
17
|
-
export * from "./ThemeContext";
|
|
18
|
-
export * from "./ThemeProvider";
|
|
19
|
-
export * from "./to";
|
|
20
|
-
export * from "./translationAsOptions";
|
|
21
|
-
export * from "./TransText";
|
|
22
|
-
export * from "./types-i18n";
|
|
23
|
-
export * from "./types-seo";
|
|
24
|
-
export * from "./useBackUrl";
|
|
25
|
-
export * from "./useDateFormat";
|
|
26
|
-
export * from "./useForm";
|
|
27
|
-
export * from "./useLocale";
|
|
28
|
-
export * from "./useT";
|
|
29
|
-
export * from "./useTheme";
|
|
30
|
-
export * from "./useTo";
|
|
1
|
+
export { getSiteUrl } from "./getSiteUrl";
|
|
2
|
+
export { load } from "./load";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.AnalyticsGoogle = void 0;
|
|
5
|
+
var tslib_1 = require("tslib");
|
|
6
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
var react_1 = require("react");
|
|
8
|
+
var router_1 = require("next/router");
|
|
9
|
+
var script_1 = tslib_1.__importDefault(require("next/script"));
|
|
10
|
+
var gtagPageview_1 = tslib_1.__importDefault(require("@koine/browser/gtagPageview"));
|
|
11
|
+
var AnalyticsGoogle = function (_a) {
|
|
12
|
+
var id = _a.id;
|
|
13
|
+
var uid = id || process.env["NEXT_PUBLIC_GTM_ID"];
|
|
14
|
+
var _b = (0, router_1.useRouter)(), events = _b.events, asPath = _b.asPath, query = _b.query;
|
|
15
|
+
var _c = (0, react_1.useState)(false), ready = _c[0], setReady = _c[1];
|
|
16
|
+
var _d = (0, react_1.useState)(false), routed = _d[0], setRouted = _d[1];
|
|
17
|
+
// const [url, setUrl] = useState("");
|
|
18
|
+
(0, react_1.useEffect)(function () {
|
|
19
|
+
var handleRouteChange = function () {
|
|
20
|
+
setRouted(true);
|
|
21
|
+
};
|
|
22
|
+
events.on("routeChangeComplete", handleRouteChange);
|
|
23
|
+
return function () {
|
|
24
|
+
events.off("routeChangeComplete", handleRouteChange);
|
|
25
|
+
};
|
|
26
|
+
}, [events]);
|
|
27
|
+
(0, react_1.useEffect)(function () {
|
|
28
|
+
if (routed && ready && asPath) {
|
|
29
|
+
// const search = query;
|
|
30
|
+
(0, gtagPageview_1.default)(asPath);
|
|
31
|
+
}
|
|
32
|
+
}, [asPath, query, routed, ready]);
|
|
33
|
+
if (!uid) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(script_1.default, { id: "google-tagmanager", src: "https://www.googletagmanager.com/gtag/js?id=".concat(id), strategy: "afterInteractive", onLoad: function () { return setReady(true); } }), (0, jsx_runtime_1.jsx)(script_1.default, tslib_1.__assign({ id: "google-analytics", strategy: "afterInteractive" }, { children: "\n window.dataLayer = window.dataLayer || [];\n function gtag(){window.dataLayer.push(arguments);}\n gtag('js', new Date());\n\n gtag('config', '".concat(id, "', { 'send_page_view': false });\n ") }))] }));
|
|
37
|
+
};
|
|
38
|
+
exports.AnalyticsGoogle = AnalyticsGoogle;
|
|
39
|
+
exports.default = exports.AnalyticsGoogle;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __assign } from "tslib";
|
|
3
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { useState, useEffect } from "react";
|
|
5
|
+
import { useRouter } from "next/router";
|
|
6
|
+
import Script from "next/script";
|
|
7
|
+
import gtagPageview from "@koine/browser/gtagPageview";
|
|
8
|
+
export var AnalyticsGoogle = function (_a) {
|
|
9
|
+
var id = _a.id;
|
|
10
|
+
var uid = id || process.env["NEXT_PUBLIC_GTM_ID"];
|
|
11
|
+
var _b = useRouter(), events = _b.events, asPath = _b.asPath, query = _b.query;
|
|
12
|
+
var _c = useState(false), ready = _c[0], setReady = _c[1];
|
|
13
|
+
var _d = useState(false), routed = _d[0], setRouted = _d[1];
|
|
14
|
+
// const [url, setUrl] = useState("");
|
|
15
|
+
useEffect(function () {
|
|
16
|
+
var handleRouteChange = function () {
|
|
17
|
+
setRouted(true);
|
|
18
|
+
};
|
|
19
|
+
events.on("routeChangeComplete", handleRouteChange);
|
|
20
|
+
return function () {
|
|
21
|
+
events.off("routeChangeComplete", handleRouteChange);
|
|
22
|
+
};
|
|
23
|
+
}, [events]);
|
|
24
|
+
useEffect(function () {
|
|
25
|
+
if (routed && ready && asPath) {
|
|
26
|
+
// const search = query;
|
|
27
|
+
gtagPageview(asPath);
|
|
28
|
+
}
|
|
29
|
+
}, [asPath, query, routed, ready]);
|
|
30
|
+
if (!uid) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
return (_jsxs(_Fragment, { children: [_jsx(Script, { id: "google-tagmanager", src: "https://www.googletagmanager.com/gtag/js?id=".concat(id), strategy: "afterInteractive", onLoad: function () { return setReady(true); } }), _jsx(Script, __assign({ id: "google-analytics", strategy: "afterInteractive" }, { children: "\n window.dataLayer = window.dataLayer || [];\n function gtag(){window.dataLayer.push(arguments);}\n gtag('js', new Date());\n\n gtag('config', '".concat(id, "', { 'send_page_view': false });\n ") }))] }));
|
|
34
|
+
};
|
|
35
|
+
export default AnalyticsGoogle;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DisableErrorOverlay = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
var head_1 = tslib_1.__importDefault(require("next/head"));
|
|
7
|
+
/**
|
|
8
|
+
* Disable error overlay during `dev`
|
|
9
|
+
*
|
|
10
|
+
* @see https://github.com/vercel/next.js/discussions/13387#discussioncomment-101564
|
|
11
|
+
*/
|
|
12
|
+
var DisableErrorOverlay = function () {
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)(head_1.default, { children: process.env["NODE_ENV"] !== "production" && ((0, jsx_runtime_1.jsx)("script", { dangerouslySetInnerHTML: {
|
|
14
|
+
__html: "window.addEventListener('error',event =>{event.stopImmediatePropagation()});window.addEventListener('unhandledrejection',event =>{event.stopImmediatePropagation()});",
|
|
15
|
+
} })) }));
|
|
16
|
+
};
|
|
17
|
+
exports.DisableErrorOverlay = DisableErrorOverlay;
|
|
18
|
+
exports.default = exports.DisableErrorOverlay;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import Head from "next/head";
|
|
3
|
+
/**
|
|
4
|
+
* Disable error overlay during `dev`
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/vercel/next.js/discussions/13387#discussioncomment-101564
|
|
7
|
+
*/
|
|
8
|
+
export var DisableErrorOverlay = function () {
|
|
9
|
+
return (_jsx(Head, { children: process.env["NODE_ENV"] !== "production" && (_jsx("script", { dangerouslySetInnerHTML: {
|
|
10
|
+
__html: "window.addEventListener('error',event =>{event.stopImmediatePropagation()});window.addEventListener('unhandledrejection',event =>{event.stopImmediatePropagation()});",
|
|
11
|
+
} })) }));
|
|
12
|
+
};
|
|
13
|
+
export default DisableErrorOverlay;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import BaseDynamicNamespaces from "next-translate/DynamicNamespaces";
|
|
2
|
+
import type { DynamicNamespacesProps as BaseDynamicNamespacesProps } from "next-translate";
|
|
3
|
+
import type { TranslateNamespace } from "./types-i18n";
|
|
4
|
+
export type DynamicNamespacesProps = Omit<BaseDynamicNamespacesProps, "namespaces"> & {
|
|
5
|
+
namespaces: TranslateNamespace[];
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* **NOTE**: To make typescript work nicely here make sure to enable
|
|
9
|
+
* [`resolveJsonModule`](https://www.typescriptlang.org/tsconfig#resolveJsonModule)
|
|
10
|
+
* in your `tsconfig.json` file.
|
|
11
|
+
*/
|
|
12
|
+
export declare const DynamicNamespaces: (props: DynamicNamespacesProps) => ReturnType<typeof BaseDynamicNamespaces>;
|
|
13
|
+
export default DynamicNamespaces;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.DynamicNamespaces = void 0;
|
|
5
|
+
var tslib_1 = require("tslib");
|
|
6
|
+
var DynamicNamespaces_1 = tslib_1.__importDefault(require("next-translate/DynamicNamespaces"));
|
|
7
|
+
/**
|
|
8
|
+
* **NOTE**: To make typescript work nicely here make sure to enable
|
|
9
|
+
* [`resolveJsonModule`](https://www.typescriptlang.org/tsconfig#resolveJsonModule)
|
|
10
|
+
* in your `tsconfig.json` file.
|
|
11
|
+
*/
|
|
12
|
+
exports.DynamicNamespaces = DynamicNamespaces_1.default;
|
|
13
|
+
exports.default = exports.DynamicNamespaces;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import BaseDynamicNamespaces from "next-translate/DynamicNamespaces";
|
|
3
|
+
/**
|
|
4
|
+
* **NOTE**: To make typescript work nicely here make sure to enable
|
|
5
|
+
* [`resolveJsonModule`](https://www.typescriptlang.org/tsconfig#resolveJsonModule)
|
|
6
|
+
* in your `tsconfig.json` file.
|
|
7
|
+
*/
|
|
8
|
+
export var DynamicNamespaces = BaseDynamicNamespaces;
|
|
9
|
+
export default DynamicNamespaces;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Favicon = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
var head_1 = tslib_1.__importDefault(require("next/head"));
|
|
7
|
+
var FaviconTags_1 = tslib_1.__importDefault(require("@koine/react/FaviconTags"));
|
|
8
|
+
var Favicon = function (props) { return ((0, jsx_runtime_1.jsx)(head_1.default, { children: (0, jsx_runtime_1.jsx)(FaviconTags_1.default, tslib_1.__assign({}, props)) })); };
|
|
9
|
+
exports.Favicon = Favicon;
|
|
10
|
+
exports.default = exports.Favicon;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import Head from "next/head";
|
|
4
|
+
import FaviconTags from "@koine/react/FaviconTags";
|
|
5
|
+
export var Favicon = function (props) { return (_jsx(Head, { children: _jsx(FaviconTags, __assign({}, props)) })); };
|
|
6
|
+
export default Favicon;
|
package/legacy/Link.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { LinkProps as NextLinkProps } from "next/link";
|
|
3
|
+
export type LinkProps = Omit<React.ComponentPropsWithRef<"a">, "href"> & Omit<NextLinkProps, "as" | "passHref" | "children"> & {
|
|
4
|
+
Link?: React.ComponentType<any>;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* @see https://next.js.org/docs/api-reference/next/link
|
|
8
|
+
*/
|
|
9
|
+
export declare const Link: React.ForwardRefExoticComponent<Omit<LinkProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
10
|
+
export default Link;
|
package/legacy/Link.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Link = void 0;
|
|
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, tslib_1.__assign({ 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)) })));
|
|
14
|
+
});
|
|
15
|
+
exports.default = exports.Link;
|
package/legacy/Link.mjs
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { __assign, __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import NextLink from "next/link";
|
|
5
|
+
/**
|
|
6
|
+
* @see https://next.js.org/docs/api-reference/next/link
|
|
7
|
+
*/
|
|
8
|
+
export var Link = forwardRef(function Link(_a, ref) {
|
|
9
|
+
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 = __rest(_a, ["href", "prefetch", "replace", "scroll", "shallow", "locale", "Link"]);
|
|
10
|
+
return (_jsx(NextLink, __assign({ href: href, replace: replace, scroll: scroll, shallow: shallow, locale: locale, passHref: true }, { children: _jsx(Link, __assign({ ref: ref }, props)) })));
|
|
11
|
+
});
|
|
12
|
+
export default Link;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Simplify } from "@koine/utils";
|
|
2
|
+
import type { WithComponents } from "@koine/react/helpers";
|
|
3
|
+
type OwnProps = {
|
|
4
|
+
/** @default 0.3 */
|
|
5
|
+
startAt?: number;
|
|
6
|
+
/** @default true */
|
|
7
|
+
showOnShallow?: boolean;
|
|
8
|
+
/** @default 200 */
|
|
9
|
+
stopDelayMs?: number;
|
|
10
|
+
};
|
|
11
|
+
export type Components = {
|
|
12
|
+
Overlay: {
|
|
13
|
+
type: "div";
|
|
14
|
+
props: {
|
|
15
|
+
running?: boolean;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export type ComponentsProps = {
|
|
20
|
+
[Name in keyof Components]: Components[Name]["props"];
|
|
21
|
+
};
|
|
22
|
+
type Props = Simplify<WithComponents<OwnProps, Components>>;
|
|
23
|
+
export type NextProgressProps = Props;
|
|
24
|
+
export declare const NextProgress: ({ startAt, showOnShallow, stopDelayMs, Overlay, }: NextProgressProps) => JSX.Element;
|
|
25
|
+
export default NextProgress;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.NextProgress = void 0;
|
|
5
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
var react_1 = require("react");
|
|
7
|
+
var router_1 = require("next/router");
|
|
8
|
+
var NextProgress = function (_a) {
|
|
9
|
+
var _b = _a.startAt, startAt = _b === void 0 ? 0.3 : _b, _c = _a.showOnShallow, showOnShallow = _c === void 0 ? true : _c, _d = _a.stopDelayMs, stopDelayMs = _d === void 0 ? 200 : _d, _e = _a.Overlay, Overlay = _e === void 0 ? "div" : _e;
|
|
10
|
+
var events = (0, router_1.useRouter)().events;
|
|
11
|
+
// const [progress, setProgress] = useState(0);
|
|
12
|
+
var _f = (0, react_1.useState)(false), running = _f[0], setRunning = _f[1];
|
|
13
|
+
var timer = (0, react_1.useRef)(null);
|
|
14
|
+
var routeChangeStart = (0, react_1.useCallback)(function (_, _a) {
|
|
15
|
+
var shallow = _a.shallow;
|
|
16
|
+
if (!shallow || showOnShallow) {
|
|
17
|
+
// setProgress(startAt);
|
|
18
|
+
setRunning(true);
|
|
19
|
+
}
|
|
20
|
+
}, [showOnShallow]);
|
|
21
|
+
var routeChangeEnd = (0, react_1.useCallback)(function (_, _a) {
|
|
22
|
+
var shallow = _a.shallow;
|
|
23
|
+
if (!shallow || showOnShallow) {
|
|
24
|
+
if (timer.current) {
|
|
25
|
+
clearTimeout(timer.current);
|
|
26
|
+
}
|
|
27
|
+
timer.current = setTimeout(function () {
|
|
28
|
+
// setProgress(100);
|
|
29
|
+
setRunning(false);
|
|
30
|
+
}, stopDelayMs);
|
|
31
|
+
}
|
|
32
|
+
}, [showOnShallow, stopDelayMs, timer]);
|
|
33
|
+
(0, react_1.useEffect)(function () {
|
|
34
|
+
events.on("routeChangeStart", routeChangeStart);
|
|
35
|
+
events.on("routeChangeComplete", routeChangeEnd);
|
|
36
|
+
events.on("routeChangeError", routeChangeEnd);
|
|
37
|
+
return function () {
|
|
38
|
+
events.off("routeChangeStart", routeChangeStart);
|
|
39
|
+
events.off("routeChangeComplete", routeChangeEnd);
|
|
40
|
+
events.off("routeChangeError", routeChangeEnd);
|
|
41
|
+
};
|
|
42
|
+
}, [events, routeChangeStart, routeChangeEnd]);
|
|
43
|
+
return (0, jsx_runtime_1.jsx)(Overlay, { running: running });
|
|
44
|
+
};
|
|
45
|
+
exports.NextProgress = NextProgress;
|
|
46
|
+
exports.default = exports.NextProgress;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
|
+
import { useRouter } from "next/router";
|
|
5
|
+
export var NextProgress = function (_a) {
|
|
6
|
+
var _b = _a.startAt, startAt = _b === void 0 ? 0.3 : _b, _c = _a.showOnShallow, showOnShallow = _c === void 0 ? true : _c, _d = _a.stopDelayMs, stopDelayMs = _d === void 0 ? 200 : _d, _e = _a.Overlay, Overlay = _e === void 0 ? "div" : _e;
|
|
7
|
+
var events = useRouter().events;
|
|
8
|
+
// const [progress, setProgress] = useState(0);
|
|
9
|
+
var _f = useState(false), running = _f[0], setRunning = _f[1];
|
|
10
|
+
var timer = useRef(null);
|
|
11
|
+
var routeChangeStart = useCallback(function (_, _a) {
|
|
12
|
+
var shallow = _a.shallow;
|
|
13
|
+
if (!shallow || showOnShallow) {
|
|
14
|
+
// setProgress(startAt);
|
|
15
|
+
setRunning(true);
|
|
16
|
+
}
|
|
17
|
+
}, [showOnShallow]);
|
|
18
|
+
var routeChangeEnd = useCallback(function (_, _a) {
|
|
19
|
+
var shallow = _a.shallow;
|
|
20
|
+
if (!shallow || showOnShallow) {
|
|
21
|
+
if (timer.current) {
|
|
22
|
+
clearTimeout(timer.current);
|
|
23
|
+
}
|
|
24
|
+
timer.current = setTimeout(function () {
|
|
25
|
+
// setProgress(100);
|
|
26
|
+
setRunning(false);
|
|
27
|
+
}, stopDelayMs);
|
|
28
|
+
}
|
|
29
|
+
}, [showOnShallow, stopDelayMs, timer]);
|
|
30
|
+
useEffect(function () {
|
|
31
|
+
events.on("routeChangeStart", routeChangeStart);
|
|
32
|
+
events.on("routeChangeComplete", routeChangeEnd);
|
|
33
|
+
events.on("routeChangeError", routeChangeEnd);
|
|
34
|
+
return function () {
|
|
35
|
+
events.off("routeChangeStart", routeChangeStart);
|
|
36
|
+
events.off("routeChangeComplete", routeChangeEnd);
|
|
37
|
+
events.off("routeChangeError", routeChangeEnd);
|
|
38
|
+
};
|
|
39
|
+
}, [events, routeChangeStart, routeChangeEnd]);
|
|
40
|
+
return _jsx(Overlay, { running: running });
|
|
41
|
+
};
|
|
42
|
+
export default NextProgress;
|
package/legacy/Seo.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { NextSeoProps } from "next-seo/lib/types";
|
|
2
|
+
import type { SeoData } from "./types-seo";
|
|
3
|
+
import { type MetaTag, type LinkTag } from "./seoBuildTags";
|
|
4
|
+
type SeoPropsOpenGraph = NextSeoProps["openGraph"] & {
|
|
5
|
+
image?: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* @see https://github.com/garmeeh/next-seo/blob/master/src/types.ts#L395
|
|
9
|
+
*/
|
|
10
|
+
export type SeoProps = Omit<NextSeoProps, "additionalMetaTags" | "additionalLinkTags" | "mobileAlternate" | "robotsProps"> & {
|
|
11
|
+
metaTags?: ReadonlyArray<MetaTag>;
|
|
12
|
+
linkTags?: ReadonlyArray<LinkTag>;
|
|
13
|
+
seo?: SeoData;
|
|
14
|
+
hidden?: SeoData["hidden"];
|
|
15
|
+
keywords?: SeoData["keywords"];
|
|
16
|
+
openGraph?: SeoPropsOpenGraph;
|
|
17
|
+
og?: SeoPropsOpenGraph;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Adapted from [garmeeh/next-seo](https://github.com/garmeeh/next-seo)
|
|
21
|
+
*
|
|
22
|
+
* See also:
|
|
23
|
+
* - https://github.com/catnose99/next-head-seo
|
|
24
|
+
* - https://nextjs.org/docs/api-reference/next/head
|
|
25
|
+
*
|
|
26
|
+
* NB: on the homepage you usually want to customize the `titleTemplate` to avoid
|
|
27
|
+
* doubled app name. Assuming your default seo configuration is something like:
|
|
28
|
+
*
|
|
29
|
+
* ```js
|
|
30
|
+
* {
|
|
31
|
+
* titleTemplate: "%s | MyApp"
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* On the homepage you migh want to override it, e.g.:
|
|
36
|
+
* ```js
|
|
37
|
+
* <Seo title="MyApp | Some description" titleTemplate="%s" />
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare const Seo: (props: SeoProps) => JSX.Element;
|
|
41
|
+
export default Seo;
|