@koine/next 2.0.0-beta.14 → 2.0.0-beta.140
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 +20 -0
- package/12/AnalyticsGoogle.d.ts +1 -1
- package/12/AnalyticsGoogle.esm.js +15 -0
- package/12/DisableErrorOverlay.cjs.js +11 -0
- package/12/DisableErrorOverlay.d.ts +1 -1
- package/12/DisableErrorOverlay.esm.js +6 -0
- package/12/Seo.d.ts +10 -2
- package/12/SeoDefaults.d.ts +6 -1
- package/12/seoBuildTags.d.ts +1 -2
- package/12/types.d.ts +5 -0
- package/12.cjs.d.ts +1 -0
- package/12.cjs.default.js +1 -0
- package/12.cjs.js +9 -0
- package/12.cjs.mjs +2 -0
- package/12.d.ts +3 -0
- package/12.esm.d.ts +1 -0
- package/12.esm.js +2 -0
- package/README.md +0 -12
- package/ThemeContext.cjs.d.ts +2 -0
- package/ThemeContext.cjs.default.js +1 -0
- package/ThemeContext.cjs.js +10 -0
- package/ThemeContext.cjs.mjs +2 -0
- package/{12/ThemeContext.d.ts → ThemeContext.d.ts} +0 -1
- package/ThemeContext.esm.d.ts +2 -0
- package/ThemeContext.esm.js +5 -0
- package/ThemeProvider.cjs.d.ts +2 -0
- package/ThemeProvider.cjs.default.js +1 -0
- package/ThemeProvider.cjs.js +14 -0
- package/ThemeProvider.cjs.mjs +2 -0
- package/{12/ThemeProvider.d.ts → ThemeProvider.d.ts} +0 -1
- package/ThemeProvider.esm.d.ts +2 -0
- package/ThemeProvider.esm.js +9 -0
- package/config.cjs.d.ts +1 -0
- package/config.cjs.default.js +1 -0
- package/config.cjs.js +8 -0
- package/config.cjs.mjs +2 -0
- package/config.d.ts +38 -0
- package/config.esm.d.ts +1 -0
- package/config.esm.js +6 -0
- package/index.cjs.d.ts +1 -0
- package/index.cjs.default.js +1 -0
- package/index.cjs.js +13 -0
- package/index.cjs.mjs +2 -0
- package/index.d.ts +3 -1
- package/index.esm.d.ts +1 -0
- package/index.esm.js +4 -0
- package/load.cjs.d.ts +2 -0
- package/load.cjs.default.js +1 -0
- package/load.cjs.js +8 -0
- package/load.cjs.mjs +2 -0
- package/load.d.ts +0 -0
- package/load.esm.d.ts +2 -0
- package/load.esm.js +3 -0
- package/package.json +58 -89
- package/typings.d.ts +39 -50
- package/useTheme.cjs.d.ts +2 -0
- package/useTheme.cjs.default.js +1 -0
- package/useTheme.cjs.js +11 -0
- package/useTheme.cjs.mjs +2 -0
- package/{12/useTheme.d.ts → useTheme.d.ts} +1 -1
- package/useTheme.esm.d.ts +2 -0
- package/useTheme.esm.js +6 -0
- package/12/AnalyticsGoogle.mjs +0 -60
- package/12/DisableErrorOverlay.mjs +0 -16
- package/12/DynamicNamespaces.d.ts +0 -13
- package/12/DynamicNamespaces.mjs +0 -8
- package/12/Favicon.d.ts +0 -4
- package/12/Favicon.mjs +0 -10
- package/12/Link.d.ts +0 -10
- package/12/Link.mjs +0 -20
- package/12/NextProgress.d.ts +0 -25
- package/12/NextProgress.mjs +0 -51
- package/12/Seo.mjs +0 -30
- package/12/SeoDefaults.mjs +0 -14
- package/12/T.d.ts +0 -16
- package/12/T.mjs +0 -27
- package/12/ThemeContext.mjs +0 -7
- package/12/ThemeProvider.mjs +0 -245
- package/12/TransText.d.ts +0 -3
- package/12/TransText.mjs +0 -4
- package/12/app/AppHead.d.ts +0 -3
- package/12/app/AppHead.mjs +0 -12
- package/12/app/AppMain.d.ts +0 -35
- package/12/app/AppMain.mjs +0 -1
- package/12/app/css/AppMain.d.ts +0 -9
- package/12/app/css/AppMain.mjs +0 -24
- package/12/app/css/AppTheme.d.ts +0 -11
- package/12/app/css/AppTheme.mjs +0 -17
- package/12/app/css/auth/index.d.ts +0 -11
- package/12/app/css/auth/index.mjs +0 -24
- package/12/app/css/index.d.ts +0 -54
- package/12/app/css/index.mjs +0 -65
- package/12/app/index.d.ts +0 -2
- package/12/app/index.mjs +0 -2
- package/12/app/sc/AppMain.d.ts +0 -11
- package/12/app/sc/AppMain.mjs +0 -58
- package/12/app/sc/AppTheme.d.ts +0 -14
- package/12/app/sc/AppTheme.mjs +0 -16
- package/12/app/sc/auth/index.d.ts +0 -11
- package/12/app/sc/auth/index.mjs +0 -24
- package/12/app/sc/index.d.ts +0 -56
- package/12/app/sc/index.mjs +0 -67
- package/12/document/Document.d.ts +0 -15
- package/12/document/Document.mjs +0 -38
- package/12/document/css/index.d.ts +0 -17
- package/12/document/css/index.mjs +0 -53
- package/12/document/index.d.ts +0 -2
- package/12/document/index.mjs +0 -2
- package/12/document/sc/index.d.ts +0 -19
- package/12/document/sc/index.mjs +0 -65
- package/12/getT.d.ts +0 -9
- package/12/getT.mjs +0 -8
- package/12/index.d.ts +0 -24
- package/12/index.mjs +0 -27
- package/12/seoBuildTags.mjs +0 -121
- package/12/to.d.ts +0 -24
- package/12/to.mjs +0 -19
- package/12/translationAsOptions.d.ts +0 -3
- package/12/translationAsOptions.mjs +0 -9
- package/12/types-i18n.d.ts +0 -118
- package/12/types-i18n.mjs +0 -12
- package/12/types-seo.d.ts +0 -7
- package/12/types-seo.mjs +0 -1
- package/12/useBackUrl.d.ts +0 -2
- package/12/useBackUrl.mjs +0 -28
- package/12/useDateFormat.d.ts +0 -7
- package/12/useDateFormat.mjs +0 -26
- package/12/useForm.d.ts +0 -27
- package/12/useForm.mjs +0 -47
- package/12/useLocale.d.ts +0 -2
- package/12/useLocale.mjs +0 -6
- package/12/useT.d.ts +0 -4
- package/12/useT.mjs +0 -39
- package/12/useTheme.mjs +0 -7
- package/12/useTo.d.ts +0 -3
- package/12/useTo.mjs +0 -8
- package/config/index.d.ts +0 -160
- package/config/index.mjs +0 -315
- package/getSiteUrl.d.ts +0 -8
- package/getSiteUrl.mjs +0 -10
- package/index.mjs +0 -2
- package/load.mjs +0 -13
package/typings.d.ts
CHANGED
|
@@ -12,61 +12,50 @@ declare module "*.svg" {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* [`next.js` pages router](https://nextjs.org/docs/pages) utility type
|
|
16
16
|
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
17
|
+
type NextGetStaticPathsResult<Params extends { [key: string]: any }> = Omit<
|
|
18
|
+
import("next").GetStaticPathsResult,
|
|
19
|
+
"paths"
|
|
20
|
+
> & {
|
|
21
|
+
paths: Array<string | { params: Params; locale?: string }>;
|
|
22
|
+
};
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
|
-
*
|
|
25
|
-
* namespace `Koine`. Most of the types here should be prefixed by `Next`, e.g.
|
|
26
|
-
* `NextSomeFeature` accessible anywhere from `Koine.NextSomeFeature`
|
|
25
|
+
* [`next.js` pages router](https://nextjs.org/docs/pages) utility type
|
|
27
26
|
*/
|
|
28
|
-
declare
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
declare type NextPageDataStaticPaths<Params extends { [key: string]: any }> = (
|
|
28
|
+
context: import("next").GetStaticPathsContext,
|
|
29
|
+
) =>
|
|
30
|
+
| Promise<NextGetStaticPathsResult<Params>>
|
|
31
|
+
| NextGetStaticPathsResult<Params>;
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
* interface Translations {
|
|
41
|
-
* "~": typeof import("./locales/en/~.json");
|
|
42
|
-
* "_": typeof import("./locales/en/_.json");
|
|
43
|
-
* "$team": typeof import("./locales/en/$team.json");
|
|
44
|
-
* "home": typeof import("./locales/en/home.json");
|
|
45
|
-
* "Header": typeof import("./locales/en/Header.json");
|
|
46
|
-
* }
|
|
47
|
-
* }
|
|
48
|
-
* ```
|
|
49
|
-
*
|
|
50
|
-
* Best to follow a convention to name the files which become the namespaces:
|
|
51
|
-
*
|
|
52
|
-
* - `~`: for app wide **urls** translated definitions
|
|
53
|
-
* - `_`: for app wide **common** translations
|
|
54
|
-
* - `${data}`: dollar prefix for static **data** like arrays, objects, .etc
|
|
55
|
-
* - `{route-name}`: lower cased for **route** specific data
|
|
56
|
-
* - `{ComponentName}`: pascal cased for **components** specific data
|
|
57
|
-
*
|
|
58
|
-
* This works through using [type augmentation](https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation)
|
|
59
|
-
* and [merging interfaces](https://www.typescriptlang.org/docs/handbook/declaration-merging.html#merging-interfaces).
|
|
60
|
-
*/
|
|
61
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
62
|
-
interface Translations {}
|
|
63
|
-
}
|
|
33
|
+
/**
|
|
34
|
+
* [`next.js` pages router](https://nextjs.org/docs/pages) utility type
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
declare type NextPageDataStatic<P extends { [key: string]: any }> =
|
|
38
|
+
import("next").GetStaticProps<P, import("querystring").ParsedUrlQuery>;
|
|
64
39
|
|
|
65
40
|
/**
|
|
66
|
-
*
|
|
67
|
-
* the `koine` ecosystem. For instance Google Analytics globally available
|
|
68
|
-
* variables.
|
|
41
|
+
* [`next.js` pages router](https://nextjs.org/docs/pages) utility type
|
|
69
42
|
*/
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
43
|
+
|
|
44
|
+
declare type NextPageDataServer<P extends { [key: string]: any }> =
|
|
45
|
+
import("next").GetServerSideProps<P, import("querystring").ParsedUrlQuery>;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Workaround to re-create the type `RouteProperties` that is not exported by
|
|
49
|
+
* `next.js`
|
|
50
|
+
*/
|
|
51
|
+
declare type NextRouteProperties = Parameters<
|
|
52
|
+
import("next/router").Router["getRouteInfo"]
|
|
53
|
+
>[0]["routeProps"];
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Extend NodeJS `process.env` with variables used by @koine
|
|
57
|
+
*/
|
|
58
|
+
// declare namespace NodeJS {
|
|
59
|
+
// interface ProcessEnv {
|
|
60
|
+
// }
|
|
61
|
+
// }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
exports._default = require('./useTheme.cjs.js').default;
|
package/useTheme.cjs.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var react = require('react');
|
|
6
|
+
var ThemeContext = require('./ThemeContext.cjs.js');
|
|
7
|
+
|
|
8
|
+
const useTheme=()=>react.useContext(ThemeContext.ThemeContext);
|
|
9
|
+
|
|
10
|
+
exports.default = useTheme;
|
|
11
|
+
exports.useTheme = useTheme;
|
package/useTheme.cjs.mjs
ADDED
package/useTheme.esm.js
ADDED
package/12/AnalyticsGoogle.mjs
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { useRouter } from "next/router";
|
|
4
|
-
import Script from "next/script";
|
|
5
|
-
import { useEffect, useState } from "react";
|
|
6
|
-
import gtagPageview from "@koine/browser/gtagPageview";
|
|
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);
|
|
12
|
-
// const [url, setUrl] = useState("");
|
|
13
|
-
useEffect(()=>{
|
|
14
|
-
const handleRouteChange = ()=>{
|
|
15
|
-
setRouted(true);
|
|
16
|
-
};
|
|
17
|
-
events.on("routeChangeComplete", handleRouteChange);
|
|
18
|
-
return ()=>{
|
|
19
|
-
events.off("routeChangeComplete", handleRouteChange);
|
|
20
|
-
};
|
|
21
|
-
}, [
|
|
22
|
-
events
|
|
23
|
-
]);
|
|
24
|
-
useEffect(()=>{
|
|
25
|
-
if (routed && ready && asPath) {
|
|
26
|
-
// const search = query;
|
|
27
|
-
gtagPageview(asPath);
|
|
28
|
-
}
|
|
29
|
-
}, [
|
|
30
|
-
asPath,
|
|
31
|
-
query,
|
|
32
|
-
routed,
|
|
33
|
-
ready
|
|
34
|
-
]);
|
|
35
|
-
if (!uid) {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
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
|
-
});
|
|
59
|
-
};
|
|
60
|
-
export default AnalyticsGoogle;
|
|
@@ -1,16 +0,0 @@
|
|
|
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
|
-
*/ 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
|
-
});
|
|
15
|
-
};
|
|
16
|
-
export default DisableErrorOverlay;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { DynamicNamespacesProps as BaseDynamicNamespacesProps } from "next-translate";
|
|
2
|
-
import BaseDynamicNamespaces from "next-translate/DynamicNamespaces";
|
|
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;
|
package/12/DynamicNamespaces.mjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
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
|
-
*/ export const DynamicNamespaces = BaseDynamicNamespaces;
|
|
8
|
-
export default DynamicNamespaces;
|
package/12/Favicon.d.ts
DELETED
package/12/Favicon.mjs
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import Head from "next/head";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import FaviconTags from "@koine/react/FaviconTags";
|
|
5
|
-
export const Favicon = (props)=>/*#__PURE__*/ _jsx(Head, {
|
|
6
|
-
children: /*#__PURE__*/ _jsx(FaviconTags, {
|
|
7
|
-
...props
|
|
8
|
-
})
|
|
9
|
-
});
|
|
10
|
-
export default Favicon;
|
package/12/Link.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { LinkProps as NextLinkProps } from "next/link";
|
|
2
|
-
import React from "react";
|
|
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/12/Link.mjs
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import NextLink from "next/link";
|
|
3
|
-
import React, { forwardRef } from "react";
|
|
4
|
-
/**
|
|
5
|
-
* @see https://next.js.org/docs/api-reference/next/link
|
|
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
|
-
});
|
|
19
|
-
});
|
|
20
|
-
export default Link;
|
package/12/NextProgress.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
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) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
export default NextProgress;
|
package/12/NextProgress.mjs
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { useRouter } from "next/router";
|
|
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();
|
|
7
|
-
// const [progress, setProgress] = useState(0);
|
|
8
|
-
const [running, setRunning] = useState(false);
|
|
9
|
-
const timer = useRef(null);
|
|
10
|
-
const routeChangeStart = useCallback((_, { shallow })=>{
|
|
11
|
-
if (!shallow || showOnShallow) {
|
|
12
|
-
// setProgress(startAt);
|
|
13
|
-
setRunning(true);
|
|
14
|
-
}
|
|
15
|
-
}, [
|
|
16
|
-
showOnShallow
|
|
17
|
-
]);
|
|
18
|
-
const routeChangeEnd = useCallback((_, { shallow })=>{
|
|
19
|
-
if (!shallow || showOnShallow) {
|
|
20
|
-
if (timer.current) {
|
|
21
|
-
clearTimeout(timer.current);
|
|
22
|
-
}
|
|
23
|
-
timer.current = setTimeout(()=>{
|
|
24
|
-
// setProgress(100);
|
|
25
|
-
setRunning(false);
|
|
26
|
-
}, stopDelayMs);
|
|
27
|
-
}
|
|
28
|
-
}, [
|
|
29
|
-
showOnShallow,
|
|
30
|
-
stopDelayMs,
|
|
31
|
-
timer
|
|
32
|
-
]);
|
|
33
|
-
useEffect(()=>{
|
|
34
|
-
events.on("routeChangeStart", routeChangeStart);
|
|
35
|
-
events.on("routeChangeComplete", routeChangeEnd);
|
|
36
|
-
events.on("routeChangeError", routeChangeEnd);
|
|
37
|
-
return ()=>{
|
|
38
|
-
events.off("routeChangeStart", routeChangeStart);
|
|
39
|
-
events.off("routeChangeComplete", routeChangeEnd);
|
|
40
|
-
events.off("routeChangeError", routeChangeEnd);
|
|
41
|
-
};
|
|
42
|
-
}, [
|
|
43
|
-
events,
|
|
44
|
-
routeChangeStart,
|
|
45
|
-
routeChangeEnd
|
|
46
|
-
]);
|
|
47
|
-
return /*#__PURE__*/ _jsx(Overlay, {
|
|
48
|
-
running: running
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
export default NextProgress;
|
package/12/Seo.mjs
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// import { memo } from "react";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import Head from "next/head";
|
|
4
|
-
import { seoBuildTags } from "./seoBuildTags";
|
|
5
|
-
/**
|
|
6
|
-
* Adapted from [garmeeh/next-seo](https://github.com/garmeeh/next-seo)
|
|
7
|
-
*
|
|
8
|
-
* See also:
|
|
9
|
-
* - https://github.com/catnose99/next-head-seo
|
|
10
|
-
* - https://nextjs.org/docs/api-reference/next/head
|
|
11
|
-
*
|
|
12
|
-
* NB: on the homepage you usually want to customize the `titleTemplate` to avoid
|
|
13
|
-
* doubled app name. Assuming your default seo configuration is something like:
|
|
14
|
-
*
|
|
15
|
-
* ```js
|
|
16
|
-
* {
|
|
17
|
-
* titleTemplate: "%s | MyApp"
|
|
18
|
-
* }
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
* On the homepage you migh want to override it, e.g.:
|
|
22
|
-
* ```js
|
|
23
|
-
* <Seo title="MyApp | Some description" titleTemplate="%s" />
|
|
24
|
-
* ```
|
|
25
|
-
*/ export const Seo = (props)=>{
|
|
26
|
-
return /*#__PURE__*/ _jsx(Head, {
|
|
27
|
-
children: seoBuildTags(props)
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
export default Seo;
|
package/12/SeoDefaults.mjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// import { memo } from "react";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import Head from "next/head";
|
|
4
|
-
// import { useRouter } from "next/router";
|
|
5
|
-
// import { getSiteUrl } from "../utils";
|
|
6
|
-
import { seoBuildTags } from "./seoBuildTags";
|
|
7
|
-
export const SeoDefaults = (props)=>{
|
|
8
|
-
// const router = useRouter();
|
|
9
|
-
// props.openGraph.url = getSiteUrl(router.asPath);
|
|
10
|
-
return /*#__PURE__*/ _jsx(Head, {
|
|
11
|
-
children: seoBuildTags(props)
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
export default SeoDefaults;
|
package/12/T.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { TransProps } from "next-translate";
|
|
3
|
-
import type { TranslateNamespace, TranslationsAllPaths, TranslationsPaths } from "./types-i18n";
|
|
4
|
-
export type TProps<TNamespace extends TranslateNamespace | undefined = undefined> = (Omit<TransProps, "i18nKey" | "ns"> & {
|
|
5
|
-
i18nKey: TranslationsAllPaths;
|
|
6
|
-
}) | (Omit<TransProps, "i18nKey" | "ns"> & {
|
|
7
|
-
ns: TNamespace;
|
|
8
|
-
i18nKey: TranslationsPaths<TNamespace>;
|
|
9
|
-
});
|
|
10
|
-
/**
|
|
11
|
-
* **NOTE**: To make typescript work nicely here make sure to enable
|
|
12
|
-
* [`resolveJsonModule`](https://www.typescriptlang.org/tsconfig#resolveJsonModule)
|
|
13
|
-
* in your `tsconfig.json` file.
|
|
14
|
-
*/
|
|
15
|
-
export declare const T: <TNamespace extends "~" | undefined = undefined>(props: TProps<TNamespace>) => import("react").ReactElement<TProps<TNamespace>, string | import("react").JSXElementConstructor<any>>;
|
|
16
|
-
export default T;
|
package/12/T.mjs
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import Trans from "next-translate/Trans";
|
|
4
|
-
/**
|
|
5
|
-
* **NOTE**: To make typescript work nicely here make sure to enable
|
|
6
|
-
* [`resolveJsonModule`](https://www.typescriptlang.org/tsconfig#resolveJsonModule)
|
|
7
|
-
* in your `tsconfig.json` file.
|
|
8
|
-
*/ export const T = (props)=>/*#__PURE__*/ _jsx(Trans, {
|
|
9
|
-
...props
|
|
10
|
-
});
|
|
11
|
-
export default T; // export type TProps = Omit<TransProps, "i18nKey" | "ns"> & {
|
|
12
|
-
// i18nKey: TranslationsAllPaths;
|
|
13
|
-
// };
|
|
14
|
-
// export type TPropsNamespaced<
|
|
15
|
-
// TNamespace extends TranslateNamespace
|
|
16
|
-
// > = Omit<TransProps, "i18nKey" | "ns"> & {
|
|
17
|
-
// i18nKey: TranslationsPaths<Translations[TNamespace]>;
|
|
18
|
-
// ns?: TNamespace;
|
|
19
|
-
// };
|
|
20
|
-
// export function T(props: TProps): JSX.Element;
|
|
21
|
-
// export function T<TNamespace extends TranslateNamespace>(props: TPropsNamespaced<TNamespace>): JSX.Element;
|
|
22
|
-
// export function T<TNamespace extends TranslateNamespace>(
|
|
23
|
-
// props: TProps<TNamespace>
|
|
24
|
-
// ) {
|
|
25
|
-
// return <Trans {...props} />;
|
|
26
|
-
// }
|
|
27
|
-
// export { default as T } from "next-translate/Trans";
|
package/12/ThemeContext.mjs
DELETED