@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/legacy/useTo.js
ADDED
|
@@ -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;
|
package/legacy/useTo.mjs
ADDED
|
@@ -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": "
|
|
102
|
-
"@koine/dom": "
|
|
103
|
-
"@koine/
|
|
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": "
|
|
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
package/useBackUrl.mjs
CHANGED
package/useDateFormat.js
CHANGED
package/useDateFormat.mjs
CHANGED
package/useForm.js
CHANGED
package/useForm.mjs
CHANGED
package/useLocale.js
CHANGED
package/useLocale.mjs
CHANGED
package/useT.js
CHANGED
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
package/useTheme.mjs
CHANGED
package/useTo.js
CHANGED
package/useTo.mjs
CHANGED