@koine/next 2.0.0-beta.2 → 2.0.0-beta.200

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.
Files changed (184) hide show
  1. package/12/AnalyticsGoogle.cjs.js +20 -0
  2. package/12/AnalyticsGoogle.d.ts +1 -1
  3. package/12/AnalyticsGoogle.esm.js +15 -0
  4. package/12/DisableErrorOverlay.cjs.js +11 -0
  5. package/12/DisableErrorOverlay.d.ts +1 -1
  6. package/12/DisableErrorOverlay.esm.js +6 -0
  7. package/12/Seo.d.ts +11 -3
  8. package/12/SeoDefaults.d.ts +7 -2
  9. package/12/seoBuildTags.d.ts +1 -2
  10. package/12/types.d.ts +5 -0
  11. package/12.cjs.default.js +1 -0
  12. package/12.cjs.js +9 -0
  13. package/12.cjs.mjs +2 -0
  14. package/12.d.ts +3 -0
  15. package/12.esm.js +2 -0
  16. package/README.md +0 -12
  17. package/ThemeContext.cjs.default.js +1 -0
  18. package/ThemeContext.cjs.js +10 -0
  19. package/ThemeContext.cjs.mjs +2 -0
  20. package/{12/ThemeContext.d.ts → ThemeContext.d.ts} +0 -1
  21. package/ThemeContext.esm.js +5 -0
  22. package/ThemeProvider.cjs.default.js +1 -0
  23. package/ThemeProvider.cjs.js +14 -0
  24. package/ThemeProvider.cjs.mjs +2 -0
  25. package/{12/ThemeProvider.d.ts → ThemeProvider.d.ts} +0 -1
  26. package/ThemeProvider.esm.js +9 -0
  27. package/config.cjs.default.js +1 -0
  28. package/config.cjs.js +8 -0
  29. package/config.cjs.mjs +2 -0
  30. package/config.d.ts +33 -0
  31. package/config.esm.js +6 -0
  32. package/index.cjs.default.js +1 -0
  33. package/index.cjs.js +13 -0
  34. package/index.cjs.mjs +2 -0
  35. package/index.d.ts +3 -1
  36. package/index.esm.js +4 -0
  37. package/load.cjs.default.js +1 -0
  38. package/load.cjs.js +8 -0
  39. package/load.cjs.mjs +2 -0
  40. package/load.d.ts +0 -0
  41. package/load.esm.js +3 -0
  42. package/package.json +61 -91
  43. package/typings.d.ts +39 -50
  44. package/useTheme.cjs.default.js +1 -0
  45. package/useTheme.cjs.js +11 -0
  46. package/useTheme.cjs.mjs +2 -0
  47. package/{12/useTheme.d.ts → useTheme.d.ts} +1 -1
  48. package/useTheme.esm.js +6 -0
  49. package/vite.config.d.ts +2 -0
  50. package/12/AnalyticsGoogle.js +0 -39
  51. package/12/AnalyticsGoogle.mjs +0 -34
  52. package/12/DisableErrorOverlay.js +0 -18
  53. package/12/DisableErrorOverlay.mjs +0 -13
  54. package/12/DynamicNamespaces.d.ts +0 -13
  55. package/12/DynamicNamespaces.js +0 -13
  56. package/12/DynamicNamespaces.mjs +0 -9
  57. package/12/Favicon.d.ts +0 -4
  58. package/12/Favicon.js +0 -10
  59. package/12/Favicon.mjs +0 -6
  60. package/12/Link.d.ts +0 -10
  61. package/12/Link.js +0 -15
  62. package/12/Link.mjs +0 -12
  63. package/12/NextProgress.d.ts +0 -25
  64. package/12/NextProgress.js +0 -46
  65. package/12/NextProgress.mjs +0 -42
  66. package/12/Seo.js +0 -34
  67. package/12/Seo.mjs +0 -29
  68. package/12/SeoDefaults.js +0 -17
  69. package/12/SeoDefaults.mjs +0 -12
  70. package/12/T.d.ts +0 -16
  71. package/12/T.js +0 -17
  72. package/12/T.mjs +0 -13
  73. package/12/ThemeContext.js +0 -10
  74. package/12/ThemeContext.mjs +0 -7
  75. package/12/ThemeProvider.js +0 -239
  76. package/12/ThemeProvider.mjs +0 -235
  77. package/12/TransText.d.ts +0 -3
  78. package/12/TransText.js +0 -8
  79. package/12/TransText.mjs +0 -4
  80. package/12/app/AppHead.d.ts +0 -3
  81. package/12/app/AppHead.js +0 -11
  82. package/12/app/AppHead.mjs +0 -6
  83. package/12/app/AppMain.d.ts +0 -35
  84. package/12/app/AppMain.js +0 -2
  85. package/12/app/AppMain.mjs +0 -1
  86. package/12/app/css/AppMain.d.ts +0 -9
  87. package/12/app/css/AppMain.js +0 -18
  88. package/12/app/css/AppMain.mjs +0 -14
  89. package/12/app/css/AppTheme.d.ts +0 -11
  90. package/12/app/css/AppTheme.js +0 -18
  91. package/12/app/css/AppTheme.mjs +0 -14
  92. package/12/app/css/auth/index.d.ts +0 -11
  93. package/12/app/css/auth/index.js +0 -17
  94. package/12/app/css/auth/index.mjs +0 -13
  95. package/12/app/css/auth/package.json +0 -6
  96. package/12/app/css/index.d.ts +0 -54
  97. package/12/app/css/index.js +0 -61
  98. package/12/app/css/index.mjs +0 -57
  99. package/12/app/css/package.json +0 -6
  100. package/12/app/index.d.ts +0 -2
  101. package/12/app/index.js +0 -5
  102. package/12/app/index.mjs +0 -2
  103. package/12/app/package.json +0 -6
  104. package/12/app/sc/AppMain.d.ts +0 -11
  105. package/12/app/sc/AppMain.js +0 -29
  106. package/12/app/sc/AppMain.mjs +0 -25
  107. package/12/app/sc/AppTheme.d.ts +0 -14
  108. package/12/app/sc/AppTheme.js +0 -15
  109. package/12/app/sc/AppTheme.mjs +0 -11
  110. package/12/app/sc/auth/index.d.ts +0 -11
  111. package/12/app/sc/auth/index.js +0 -17
  112. package/12/app/sc/auth/index.mjs +0 -13
  113. package/12/app/sc/auth/package.json +0 -6
  114. package/12/app/sc/index.d.ts +0 -56
  115. package/12/app/sc/index.js +0 -63
  116. package/12/app/sc/index.mjs +0 -59
  117. package/12/app/sc/package.json +0 -6
  118. package/12/document/Document.d.ts +0 -15
  119. package/12/document/Document.js +0 -31
  120. package/12/document/Document.mjs +0 -28
  121. package/12/document/css/index.d.ts +0 -17
  122. package/12/document/css/index.js +0 -45
  123. package/12/document/css/index.mjs +0 -45
  124. package/12/document/css/package.json +0 -6
  125. package/12/document/index.d.ts +0 -2
  126. package/12/document/index.js +0 -7
  127. package/12/document/index.mjs +0 -2
  128. package/12/document/package.json +0 -6
  129. package/12/document/sc/index.d.ts +0 -19
  130. package/12/document/sc/index.js +0 -67
  131. package/12/document/sc/index.mjs +0 -64
  132. package/12/document/sc/package.json +0 -6
  133. package/12/getT.d.ts +0 -9
  134. package/12/getT.js +0 -14
  135. package/12/getT.mjs +0 -10
  136. package/12/index.d.ts +0 -24
  137. package/12/index.js +0 -52
  138. package/12/index.mjs +0 -27
  139. package/12/package.json +0 -6
  140. package/12/seoBuildTags.js +0 -121
  141. package/12/seoBuildTags.mjs +0 -117
  142. package/12/to.d.ts +0 -24
  143. package/12/to.js +0 -29
  144. package/12/to.mjs +0 -25
  145. package/12/translationAsOptions.d.ts +0 -3
  146. package/12/translationAsOptions.js +0 -13
  147. package/12/translationAsOptions.mjs +0 -9
  148. package/12/types-i18n.d.ts +0 -118
  149. package/12/types-i18n.js +0 -14
  150. package/12/types-i18n.mjs +0 -13
  151. package/12/types-seo.d.ts +0 -7
  152. package/12/types-seo.js +0 -2
  153. package/12/types-seo.mjs +0 -1
  154. package/12/useBackUrl.d.ts +0 -2
  155. package/12/useBackUrl.js +0 -33
  156. package/12/useBackUrl.mjs +0 -28
  157. package/12/useDateFormat.d.ts +0 -7
  158. package/12/useDateFormat.js +0 -43
  159. package/12/useDateFormat.mjs +0 -39
  160. package/12/useForm.d.ts +0 -27
  161. package/12/useForm.js +0 -39
  162. package/12/useForm.mjs +0 -35
  163. package/12/useLocale.d.ts +0 -2
  164. package/12/useLocale.js +0 -11
  165. package/12/useLocale.mjs +0 -6
  166. package/12/useT.d.ts +0 -4
  167. package/12/useT.js +0 -44
  168. package/12/useT.mjs +0 -21
  169. package/12/useTheme.js +0 -12
  170. package/12/useTheme.mjs +0 -8
  171. package/12/useTo.d.ts +0 -3
  172. package/12/useTo.js +0 -19
  173. package/12/useTo.mjs +0 -15
  174. package/config/index.d.ts +0 -160
  175. package/config/index.js +0 -343
  176. package/config/index.mjs +0 -332
  177. package/config/package.json +0 -6
  178. package/getSiteUrl.d.ts +0 -8
  179. package/getSiteUrl.js +0 -17
  180. package/getSiteUrl.mjs +0 -12
  181. package/index.js +0 -7
  182. package/index.mjs +0 -2
  183. package/load.js +0 -18
  184. package/load.mjs +0 -14
package/typings.d.ts CHANGED
@@ -12,61 +12,50 @@ declare module "*.svg" {
12
12
  }
13
13
 
14
14
  /**
15
- * Extend NodeJS `process.env` with variables used by @koine
15
+ * [`next.js` pages router](https://nextjs.org/docs/pages) utility type
16
16
  */
17
- declare namespace NodeJS {
18
- interface ProcessEnv {
19
- NEXT_PUBLIC_APP_URL: string;
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
- * Types specifically related to `@koine/next` exposed on the global unique
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 namespace Koine {
29
- /**
30
- * Default SEO data structure expected by the `<Seo>` component's prop `seo`
31
- */
32
- type NextSeo = import("./12/types-seo").SeoData;
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
- * Translations dictionary extracted from JSON files.
36
- * You need to augment this type with something like:
37
- *
38
- * ```ts
39
- * declare namespace Koine {
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
- * List here the global variables used by third party scripts supported within
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
- declare interface Window {
71
- gtag: (...args: Record<string, unknown>[]) => Record<string, unknown>;
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;
@@ -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;
@@ -0,0 +1,2 @@
1
+ export * from './useTheme.cjs.js';
2
+ export { _default as default } from './useTheme.cjs.default.js';
@@ -1,4 +1,4 @@
1
- import { ThemeContextProps } from "./ThemeContext";
1
+ import { type ThemeContextProps } from "./ThemeContext";
2
2
  export type UseThemeProps = ThemeContextProps;
3
3
  /**
4
4
  * @borrows [next-themes](https://github.com/pacocoursey/next-themes)
@@ -0,0 +1,6 @@
1
+ import { useContext } from 'react';
2
+ import { ThemeContext } from './ThemeContext.esm.js';
3
+
4
+ const useTheme=()=>useContext(ThemeContext);
5
+
6
+ export { useTheme as default, useTheme };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vite").UserConfig;
2
+ export default _default;
@@ -1,39 +0,0 @@
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, { 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;
@@ -1,34 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useState, useEffect } from "react";
4
- import { useRouter } from "next/router";
5
- import Script from "next/script";
6
- import gtagPageview from "@koine/browser/gtagPageview";
7
- export var AnalyticsGoogle = function (_a) {
8
- var id = _a.id;
9
- var uid = id || process.env["NEXT_PUBLIC_GTM_ID"];
10
- var _b = useRouter(), events = _b.events, asPath = _b.asPath, query = _b.query;
11
- var _c = useState(false), ready = _c[0], setReady = _c[1];
12
- var _d = useState(false), routed = _d[0], setRouted = _d[1];
13
- // const [url, setUrl] = useState("");
14
- useEffect(function () {
15
- var handleRouteChange = function () {
16
- setRouted(true);
17
- };
18
- events.on("routeChangeComplete", handleRouteChange);
19
- return function () {
20
- events.off("routeChangeComplete", handleRouteChange);
21
- };
22
- }, [events]);
23
- useEffect(function () {
24
- if (routed && ready && asPath) {
25
- // const search = query;
26
- gtagPageview(asPath);
27
- }
28
- }, [asPath, query, routed, ready]);
29
- if (!uid) {
30
- return null;
31
- }
32
- 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, { 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 ") })] }));
33
- };
34
- export default AnalyticsGoogle;
@@ -1,18 +0,0 @@
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;
@@ -1,13 +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
- */
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;
@@ -1,13 +0,0 @@
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;
@@ -1,13 +0,0 @@
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;
@@ -1,9 +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
- */
8
- export var DynamicNamespaces = BaseDynamicNamespaces;
9
- export default DynamicNamespaces;
package/12/Favicon.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import { type FaviconTagsProps } from "@koine/react/FaviconTags";
2
- export type FaviconProps = FaviconTagsProps;
3
- export declare const Favicon: (props: FaviconTagsProps) => import("react/jsx-runtime").JSX.Element;
4
- export default Favicon;
package/12/Favicon.js DELETED
@@ -1,10 +0,0 @@
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;
package/12/Favicon.mjs DELETED
@@ -1,6 +0,0 @@
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/12/Link.d.ts DELETED
@@ -1,10 +0,0 @@
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/12/Link.js DELETED
@@ -1,15 +0,0 @@
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, { 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/12/Link.mjs DELETED
@@ -1,12 +0,0 @@
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, { href: href, replace: replace, scroll: scroll, shallow: shallow, locale: locale, passHref: true, children: _jsx(Link, __assign({ ref: ref }, props)) }));
11
- });
12
- export default Link;
@@ -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;
@@ -1,46 +0,0 @@
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;
@@ -1,42 +0,0 @@
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/12/Seo.js DELETED
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Seo = void 0;
4
- var tslib_1 = require("tslib");
5
- var jsx_runtime_1 = require("react/jsx-runtime");
6
- // import { memo } from "react";
7
- var head_1 = tslib_1.__importDefault(require("next/head"));
8
- var seoBuildTags_1 = require("./seoBuildTags");
9
- /**
10
- * Adapted from [garmeeh/next-seo](https://github.com/garmeeh/next-seo)
11
- *
12
- * See also:
13
- * - https://github.com/catnose99/next-head-seo
14
- * - https://nextjs.org/docs/api-reference/next/head
15
- *
16
- * NB: on the homepage you usually want to customize the `titleTemplate` to avoid
17
- * doubled app name. Assuming your default seo configuration is something like:
18
- *
19
- * ```js
20
- * {
21
- * titleTemplate: "%s | MyApp"
22
- * }
23
- * ```
24
- *
25
- * On the homepage you migh want to override it, e.g.:
26
- * ```js
27
- * <Seo title="MyApp | Some description" titleTemplate="%s" />
28
- * ```
29
- */
30
- var Seo = function (props) {
31
- return (0, jsx_runtime_1.jsx)(head_1.default, { children: (0, seoBuildTags_1.seoBuildTags)(props) });
32
- };
33
- exports.Seo = Seo;
34
- exports.default = exports.Seo;
package/12/Seo.mjs DELETED
@@ -1,29 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- // import { memo } from "react";
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
- */
26
- export var Seo = function (props) {
27
- return _jsx(Head, { children: seoBuildTags(props) });
28
- };
29
- export default Seo;
package/12/SeoDefaults.js DELETED
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SeoDefaults = void 0;
4
- var tslib_1 = require("tslib");
5
- var jsx_runtime_1 = require("react/jsx-runtime");
6
- // import { memo } from "react";
7
- var head_1 = tslib_1.__importDefault(require("next/head"));
8
- // import { useRouter } from "next/router";
9
- // import { getSiteUrl } from "../utils";
10
- var seoBuildTags_1 = require("./seoBuildTags");
11
- var SeoDefaults = function (props) {
12
- // const router = useRouter();
13
- // props.openGraph.url = getSiteUrl(router.asPath);
14
- return (0, jsx_runtime_1.jsx)(head_1.default, { children: (0, seoBuildTags_1.seoBuildTags)(props) });
15
- };
16
- exports.SeoDefaults = SeoDefaults;
17
- exports.default = exports.SeoDefaults;
@@ -1,12 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- // import { memo } from "react";
3
- import Head from "next/head";
4
- // import { useRouter } from "next/router";
5
- // import { getSiteUrl } from "../utils";
6
- import { seoBuildTags } from "./seoBuildTags";
7
- export var SeoDefaults = function (props) {
8
- // const router = useRouter();
9
- // props.openGraph.url = getSiteUrl(router.asPath);
10
- return _jsx(Head, { children: seoBuildTags(props) });
11
- };
12
- 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, TranslationsPaths, TranslationsAllPaths } 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.js DELETED
@@ -1,17 +0,0 @@
1
- "use strict";
2
- "use client";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.T = void 0;
5
- var tslib_1 = require("tslib");
6
- var jsx_runtime_1 = require("react/jsx-runtime");
7
- var Trans_1 = tslib_1.__importDefault(require("next-translate/Trans"));
8
- /**
9
- * **NOTE**: To make typescript work nicely here make sure to enable
10
- * [`resolveJsonModule`](https://www.typescriptlang.org/tsconfig#resolveJsonModule)
11
- * in your `tsconfig.json` file.
12
- */
13
- var T = function (props) {
14
- return ((0, jsx_runtime_1.jsx)(Trans_1.default, tslib_1.__assign({}, props)));
15
- };
16
- exports.T = T;
17
- exports.default = exports.T;
package/12/T.mjs DELETED
@@ -1,13 +0,0 @@
1
- "use client";
2
- import { __assign } from "tslib";
3
- import { jsx as _jsx } from "react/jsx-runtime";
4
- import Trans from "next-translate/Trans";
5
- /**
6
- * **NOTE**: To make typescript work nicely here make sure to enable
7
- * [`resolveJsonModule`](https://www.typescriptlang.org/tsconfig#resolveJsonModule)
8
- * in your `tsconfig.json` file.
9
- */
10
- export var T = function (props) {
11
- return (_jsx(Trans, __assign({}, props)));
12
- };
13
- export default T;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ThemeContext = void 0;
4
- var react_1 = require("react");
5
- exports.ThemeContext = (0, react_1.createContext)({
6
- // eslint-disable-next-line @typescript-eslint/no-empty-function
7
- setTheme: function (_) { },
8
- themes: [],
9
- });
10
- exports.default = exports.ThemeContext;
@@ -1,7 +0,0 @@
1
- import { createContext } from "react";
2
- export var ThemeContext = createContext({
3
- // eslint-disable-next-line @typescript-eslint/no-empty-function
4
- setTheme: function (_) { },
5
- themes: [],
6
- });
7
- export default ThemeContext;