@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.
Files changed (169) hide show
  1. package/AnalyticsGoogle.js +1 -0
  2. package/AnalyticsGoogle.mjs +1 -0
  3. package/DynamicNamespaces.js +1 -0
  4. package/DynamicNamespaces.mjs +1 -0
  5. package/NextProgress.js +1 -0
  6. package/NextProgress.mjs +1 -0
  7. package/T.js +1 -0
  8. package/T.mjs +1 -0
  9. package/ThemeProvider.js +1 -0
  10. package/ThemeProvider.mjs +1 -0
  11. package/TransText.js +1 -0
  12. package/TransText.mjs +1 -0
  13. package/auth/useLoginUrl.js +1 -0
  14. package/auth/useLoginUrl.mjs +1 -0
  15. package/auth/useLogout.js +1 -0
  16. package/auth/useLogout.mjs +1 -0
  17. package/getT.js +2 -1
  18. package/getT.mjs +1 -0
  19. package/index.d.ts +2 -28
  20. package/index.js +5 -31
  21. package/index.mjs +2 -30
  22. package/legacy/AnalyticsGoogle.d.ts +6 -0
  23. package/legacy/AnalyticsGoogle.js +39 -0
  24. package/legacy/AnalyticsGoogle.mjs +35 -0
  25. package/legacy/DisableErrorOverlay.d.ts +7 -0
  26. package/legacy/DisableErrorOverlay.js +18 -0
  27. package/legacy/DisableErrorOverlay.mjs +13 -0
  28. package/legacy/DynamicNamespaces.d.ts +13 -0
  29. package/legacy/DynamicNamespaces.js +13 -0
  30. package/legacy/DynamicNamespaces.mjs +9 -0
  31. package/legacy/Favicon.d.ts +4 -0
  32. package/legacy/Favicon.js +10 -0
  33. package/legacy/Favicon.mjs +6 -0
  34. package/legacy/Link.d.ts +10 -0
  35. package/legacy/Link.js +15 -0
  36. package/legacy/Link.mjs +12 -0
  37. package/legacy/NextProgress.d.ts +25 -0
  38. package/legacy/NextProgress.js +46 -0
  39. package/legacy/NextProgress.mjs +42 -0
  40. package/legacy/Seo.d.ts +41 -0
  41. package/legacy/Seo.js +34 -0
  42. package/legacy/Seo.mjs +29 -0
  43. package/legacy/SeoDefaults.d.ts +11 -0
  44. package/legacy/SeoDefaults.js +17 -0
  45. package/legacy/SeoDefaults.mjs +12 -0
  46. package/legacy/T.d.ts +15 -0
  47. package/legacy/T.js +17 -0
  48. package/legacy/T.mjs +13 -0
  49. package/legacy/ThemeContext.d.ts +17 -0
  50. package/legacy/ThemeContext.js +10 -0
  51. package/legacy/ThemeContext.mjs +7 -0
  52. package/legacy/ThemeProvider.d.ts +35 -0
  53. package/legacy/ThemeProvider.js +251 -0
  54. package/legacy/ThemeProvider.mjs +247 -0
  55. package/legacy/TransText.d.ts +3 -0
  56. package/legacy/TransText.js +8 -0
  57. package/legacy/TransText.mjs +4 -0
  58. package/legacy/app/AppHead.d.ts +3 -0
  59. package/legacy/app/AppHead.js +11 -0
  60. package/legacy/app/AppHead.mjs +6 -0
  61. package/legacy/app/AppMain.d.ts +35 -0
  62. package/legacy/app/AppMain.js +2 -0
  63. package/legacy/app/AppMain.mjs +1 -0
  64. package/legacy/app/css/AppMain.d.ts +9 -0
  65. package/legacy/app/css/AppMain.js +18 -0
  66. package/legacy/app/css/AppMain.mjs +14 -0
  67. package/legacy/app/css/AppTheme.d.ts +11 -0
  68. package/legacy/app/css/AppTheme.js +19 -0
  69. package/legacy/app/css/AppTheme.mjs +15 -0
  70. package/legacy/app/css/auth/index.d.ts +11 -0
  71. package/legacy/app/css/auth/index.js +17 -0
  72. package/legacy/app/css/auth/index.mjs +13 -0
  73. package/legacy/app/css/auth/package.json +6 -0
  74. package/legacy/app/css/index.d.ts +54 -0
  75. package/legacy/app/css/index.js +61 -0
  76. package/legacy/app/css/index.mjs +57 -0
  77. package/legacy/app/css/package.json +6 -0
  78. package/legacy/app/index.d.ts +2 -0
  79. package/legacy/app/index.js +5 -0
  80. package/legacy/app/index.mjs +2 -0
  81. package/legacy/app/package.json +6 -0
  82. package/legacy/app/sc/AppMain.d.ts +11 -0
  83. package/legacy/app/sc/AppMain.js +29 -0
  84. package/legacy/app/sc/AppMain.mjs +25 -0
  85. package/legacy/app/sc/AppTheme.d.ts +14 -0
  86. package/legacy/app/sc/AppTheme.js +16 -0
  87. package/legacy/app/sc/AppTheme.mjs +12 -0
  88. package/legacy/app/sc/auth/index.d.ts +11 -0
  89. package/legacy/app/sc/auth/index.js +17 -0
  90. package/legacy/app/sc/auth/index.mjs +13 -0
  91. package/legacy/app/sc/auth/package.json +6 -0
  92. package/legacy/app/sc/index.d.ts +56 -0
  93. package/legacy/app/sc/index.js +63 -0
  94. package/legacy/app/sc/index.mjs +59 -0
  95. package/legacy/app/sc/package.json +6 -0
  96. package/legacy/document/Document.d.ts +16 -0
  97. package/legacy/document/Document.js +31 -0
  98. package/legacy/document/Document.mjs +28 -0
  99. package/legacy/document/css/index.d.ts +18 -0
  100. package/legacy/document/css/index.js +45 -0
  101. package/legacy/document/css/index.mjs +45 -0
  102. package/legacy/document/css/package.json +6 -0
  103. package/legacy/document/index.d.ts +2 -0
  104. package/legacy/document/index.js +7 -0
  105. package/legacy/document/index.mjs +2 -0
  106. package/legacy/document/package.json +6 -0
  107. package/legacy/document/sc/index.d.ts +20 -0
  108. package/legacy/document/sc/index.js +67 -0
  109. package/legacy/document/sc/index.mjs +64 -0
  110. package/legacy/document/sc/package.json +6 -0
  111. package/legacy/getT.d.ts +9 -0
  112. package/legacy/getT.js +14 -0
  113. package/legacy/getT.mjs +10 -0
  114. package/legacy/index.d.ts +24 -0
  115. package/legacy/index.js +52 -0
  116. package/legacy/index.mjs +27 -0
  117. package/legacy/package.json +6 -0
  118. package/legacy/seoBuildTags.d.ts +23 -0
  119. package/legacy/seoBuildTags.js +121 -0
  120. package/legacy/seoBuildTags.mjs +117 -0
  121. package/legacy/to.d.ts +24 -0
  122. package/legacy/to.js +29 -0
  123. package/legacy/to.mjs +25 -0
  124. package/legacy/translationAsOptions.d.ts +3 -0
  125. package/legacy/translationAsOptions.js +13 -0
  126. package/legacy/translationAsOptions.mjs +9 -0
  127. package/legacy/types-i18n.d.ts +118 -0
  128. package/legacy/types-i18n.js +14 -0
  129. package/legacy/types-i18n.mjs +13 -0
  130. package/legacy/types-seo.d.ts +7 -0
  131. package/legacy/types-seo.js +2 -0
  132. package/legacy/types-seo.mjs +1 -0
  133. package/legacy/useBackUrl.d.ts +2 -0
  134. package/legacy/useBackUrl.js +33 -0
  135. package/legacy/useBackUrl.mjs +28 -0
  136. package/legacy/useDateFormat.d.ts +7 -0
  137. package/legacy/useDateFormat.js +43 -0
  138. package/legacy/useDateFormat.mjs +39 -0
  139. package/legacy/useForm.d.ts +27 -0
  140. package/legacy/useForm.js +39 -0
  141. package/legacy/useForm.mjs +35 -0
  142. package/legacy/useLocale.d.ts +2 -0
  143. package/legacy/useLocale.js +11 -0
  144. package/legacy/useLocale.mjs +6 -0
  145. package/legacy/useT.d.ts +17 -0
  146. package/legacy/useT.js +40 -0
  147. package/legacy/useT.mjs +19 -0
  148. package/legacy/useTheme.d.ts +7 -0
  149. package/legacy/useTheme.js +12 -0
  150. package/legacy/useTheme.mjs +8 -0
  151. package/legacy/useTo.d.ts +3 -0
  152. package/legacy/useTo.js +19 -0
  153. package/legacy/useTo.mjs +15 -0
  154. package/package.json +4 -10
  155. package/typings.d.ts +0 -87
  156. package/useBackUrl.js +1 -0
  157. package/useBackUrl.mjs +1 -0
  158. package/useDateFormat.js +1 -0
  159. package/useDateFormat.mjs +1 -0
  160. package/useForm.js +1 -0
  161. package/useForm.mjs +1 -0
  162. package/useLocale.js +1 -0
  163. package/useLocale.mjs +1 -0
  164. package/useT.js +1 -0
  165. package/useT.mjs +1 -16
  166. package/useTheme.js +1 -0
  167. package/useTheme.mjs +1 -0
  168. package/useTo.js +1 -0
  169. package/useTo.mjs +1 -0
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useTo = void 0;
5
+ var tslib_1 = require("tslib");
6
+ var useT_1 = require("./useT");
7
+ var to_1 = require("./to");
8
+ function useTo() {
9
+ var t = (0, useT_1.useT)("~");
10
+ return function () {
11
+ var args = [];
12
+ for (var _i = 0; _i < arguments.length; _i++) {
13
+ args[_i] = arguments[_i];
14
+ }
15
+ return to_1.to.apply(void 0, tslib_1.__spreadArray([t], args, false));
16
+ };
17
+ }
18
+ exports.useTo = useTo;
19
+ exports.default = useTo;
@@ -0,0 +1,15 @@
1
+ "use client";
2
+ import { __spreadArray } from "tslib";
3
+ import { useT } from "./useT";
4
+ import { to } from "./to";
5
+ export function useTo() {
6
+ var t = useT("~");
7
+ return function () {
8
+ var args = [];
9
+ for (var _i = 0; _i < arguments.length; _i++) {
10
+ args[_i] = arguments[_i];
11
+ }
12
+ return to.apply(void 0, __spreadArray([t], args, false));
13
+ };
14
+ }
15
+ export default useTo;
package/package.json CHANGED
@@ -67,14 +67,9 @@
67
67
  }
68
68
  },
69
69
  "dependencies": {
70
- "@emotion/cache": "11.10.5",
71
- "@emotion/react": "^11.10.6",
72
- "@emotion/server": "^11.10.0",
73
- "@emotion/styled": "^11.10.6",
74
70
  "@hookform/resolvers": "^2.9.11",
75
71
  "@kuus/yup": "1.0.0-beta.7",
76
72
  "@mui/base": "5.0.0-alpha.118",
77
- "@mui/material": "^5.11.10",
78
73
  "@mui/utils": "5.11.9",
79
74
  "@tiptap/react": "2.0.0-beta.218",
80
75
  "@tiptap/starter-kit": "2.0.0-beta.218",
@@ -98,13 +93,12 @@
98
93
  "type-fest": "^3.6.0"
99
94
  },
100
95
  "peerDependencies": {
101
- "@koine/browser": "1.2.2",
102
- "@koine/dom": "1.2.2",
103
- "@koine/react": "1.2.2",
104
- "@koine/utils": "1.2.2"
96
+ "@koine/browser": "2.0.0-alpha.1",
97
+ "@koine/dom": "2.0.0-alpha.1",
98
+ "@koine/utils": "2.0.0-alpha.1"
105
99
  },
106
100
  "main": "./index.js",
107
101
  "types": "./index.d.ts",
108
- "version": "1.2.2",
102
+ "version": "2.0.0-alpha.1",
109
103
  "module": "./index.mjs"
110
104
  }
package/typings.d.ts CHANGED
@@ -1,13 +1,3 @@
1
- /**
2
- * Next utility types
3
- */
4
- declare type PageServer<P> = import("next").InferGetServerSidePropsType<P>;
5
- declare type PageStatic<P> = import("next").InferGetStaticPropsType<P>;
6
- declare type DataServer<P, Q, T> = import("next").GetServerSideProps<P, Q, T>;
7
- declare type DataStatic<P, T> = import("next").GetStaticProps<P, T>;
8
- declare type DataStaticPaths<P> = import("next").GetStaticPaths<P>;
9
- declare type DataStaticPathsResult<P> = import("next").GetStaticPathsResult<P>;
10
-
11
1
  /**
12
2
  * Nx types
13
3
  *
@@ -20,80 +10,3 @@ declare module "*.svg" {
20
10
  >;
21
11
  export default content;
22
12
  }
23
-
24
- /**
25
- * Extend NodeJS `process.env` with variables used by @koine
26
- */
27
- declare namespace NodeJS {
28
- interface ProcessEnv {
29
- NEXT_PUBLIC_APP_URL: string;
30
- AUTH_ROUTE_LOGIN: string;
31
- AUTH_ROUTE_PROFILE: string;
32
- AUTH_ROUTE_REGISTER: string;
33
- AUTH_ROUTES_SECURED: string;
34
- }
35
- }
36
-
37
- /**
38
- * Types specifically related to `@koine/next` exposed on the global unique
39
- * namespace `Koine`. Most of the types here should be prefixed by `Next`, e.g.
40
- * `NextSomeFeature` accessible anywhere from `Koine.NextSomeFeature`
41
- */
42
- declare namespace Koine {
43
- /**
44
- * Default SEO data structure expected by the `<Seo>` component's prop `seo`
45
- */
46
- type NextSeo = import("./Seo").SeoData;
47
-
48
- /**
49
- * Next auth routes configurable map
50
- *
51
- * @see next/auth `pages` mapping: https://next-auth.js.org/configuration/pages`
52
- */
53
- type NextAuthRoutesMap = {
54
- login: string;
55
- profile: string;
56
- register: string;
57
- /** Array of regexes to match pathnames of protected routes */
58
- secured: RegExp[];
59
- };
60
-
61
- /**
62
- * Translations dictionary extracted from JSON files.
63
- * You need to augment this type with something like:
64
- *
65
- * ```ts
66
- * declare namespace Koine {
67
- * interface Translations {
68
- * "~": typeof import("./locales/en/~.json");
69
- * "_": typeof import("./locales/en/_.json");
70
- * "$team": typeof import("./locales/en/$team.json");
71
- * "home": typeof import("./locales/en/home.json");
72
- * "Header": typeof import("./locales/en/Header.json");
73
- * }
74
- * }
75
- * ```
76
- *
77
- * Best to follow a convention to name the files which become the namespaces:
78
- *
79
- * - `~`: for app wide **urls** translated definitions
80
- * - `_`: for app wide **common** translations
81
- * - `${data}`: dollar prefix for static **data** like arrays, objects, .etc
82
- * - `{route-name}`: lower cased for **route** specific data
83
- * - `{ComponentName}`: pascal cased for **components** specific data
84
- *
85
- * This works through using [type augmentation](https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation)
86
- * and [merging interfaces](https://www.typescriptlang.org/docs/handbook/declaration-merging.html#merging-interfaces).
87
- */
88
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
89
- interface Translations {}
90
- }
91
-
92
- /**
93
- * List here the global variables used by third party scripts supported within
94
- * the `koine` ecosystem. For instance Google Analytics globally available
95
- * variables.
96
- */
97
- declare interface Window {
98
- gtag: (...args: Record<string, unknown>[]) => Record<string, unknown>;
99
- }
package/useBackUrl.js CHANGED
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ "use client";
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  exports.useBackUrl = void 0;
4
5
  var tslib_1 = require("tslib");
package/useBackUrl.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useEffect, useRef, useState } from "react";
2
3
  import { useRouter } from "next/router";
3
4
  import createStorage from "@koine/browser/createStorage";
package/useDateFormat.js CHANGED
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ "use client";
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  exports.useDateFormat = void 0;
4
5
  var tslib_1 = require("tslib");
package/useDateFormat.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { __assign } from "tslib";
2
3
  import { useEffect, useState } from "react";
3
4
  import { useRouter } from "next/router";
package/useForm.js CHANGED
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ "use client";
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  exports.useForm = void 0;
4
5
  var tslib_1 = require("tslib");
package/useForm.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { __assign } from "tslib";
2
3
  import { useMemo } from "react";
3
4
  import { useForm as _useForm } from "react-hook-form";
package/useLocale.js CHANGED
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ "use client";
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  exports.useLocale = void 0;
4
5
  var tslib_1 = require("tslib");
package/useLocale.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import useTranslation from "next-translate/useTranslation";
2
3
  export function useLocale() {
3
4
  return useTranslation().lang;
package/useT.js CHANGED
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ "use client";
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  exports.useT = void 0;
4
5
  var tslib_1 = require("tslib");
package/useT.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useMemo } from "react";
2
3
  import useTranslation from "next-translate/useTranslation";
3
4
  export function useT(namespace) {
@@ -16,19 +17,3 @@ export function useT(namespace) {
16
17
  return tMemoized;
17
18
  }
18
19
  export default useT;
19
- // Instead of wrapping the `useTranslation` hook from [`next-translate`](https://github.com/vinissimus/next-translate/blob/master/src/useTranslation.tsx)
20
- // we might just rewrite it with our custom implementation but the `_context`
21
- // to use is not exposed by the library...
22
- // import { useContext, useMemo } from "react"
23
- // import wrapTWithDefaultNs from "next-translate/lib/cjs/wrapTWithDefaultNs";
24
- // import I18nContext from "next-translate/lib/cjs/_context";
25
- // export default function useTranslation(defaultNS?: string): I18n {
26
- // const ctx = useContext(I18nContext)
27
- // return useMemo(
28
- // () => ({
29
- // ...ctx,
30
- // t: wrapTWithDefaultNs(ctx.t, defaultNS),
31
- // }),
32
- // [ctx.lang, defaultNS]
33
- // )
34
- // }
package/useTheme.js CHANGED
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ "use client";
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  exports.useTheme = void 0;
4
5
  var react_1 = require("react");
package/useTheme.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useContext } from "react";
2
3
  import { ThemeContext } from "./ThemeContext";
3
4
  /**
package/useTo.js CHANGED
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ "use client";
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  exports.useTo = void 0;
4
5
  var tslib_1 = require("tslib");
package/useTo.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { __spreadArray } from "tslib";
2
3
  import { useT } from "./useT";
3
4
  import { to } from "./to";