@koine/next 2.0.0-beta.31 → 2.0.0-beta.32

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/package.json CHANGED
@@ -2,10 +2,10 @@
2
2
  "name": "@koine/next",
3
3
  "sideEffects": false,
4
4
  "dependencies": {
5
- "@koine/browser": "2.0.0-beta.31",
6
- "@koine/react": "2.0.0-beta.31",
7
- "@koine/utils": "2.0.0-beta.31",
8
- "@koine/i18n": "2.0.0-beta.31"
5
+ "@koine/browser": "2.0.0-beta.32",
6
+ "@koine/react": "2.0.0-beta.32",
7
+ "@koine/utils": "2.0.0-beta.32",
8
+ "@koine/i18n": "2.0.0-beta.32"
9
9
  },
10
10
  "peerDependenciesMeta": {
11
11
  "@kuus/yup": {
@@ -45,9 +45,6 @@
45
45
  "./12/Favicon": {
46
46
  "import": "./12/Favicon.js"
47
47
  },
48
- "./12/Link": {
49
- "import": "./12/Link.js"
50
- },
51
48
  "./12/NextProgress": {
52
49
  "import": "./12/NextProgress.js"
53
50
  },
@@ -75,27 +72,12 @@
75
72
  "./12/app/css/AppTheme": {
76
73
  "import": "./12/app/css/AppTheme.js"
77
74
  },
78
- "./12/app/css/auth": {
79
- "import": "./12/app/css/auth/index.js"
80
- },
81
75
  "./12/app/css": {
82
76
  "import": "./12/app/css/index.js"
83
77
  },
84
78
  "./12/app": {
85
79
  "import": "./12/app/index.js"
86
80
  },
87
- "./12/app/sc/AppMain": {
88
- "import": "./12/app/sc/AppMain.js"
89
- },
90
- "./12/app/sc/AppTheme": {
91
- "import": "./12/app/sc/AppTheme.js"
92
- },
93
- "./12/app/sc/auth": {
94
- "import": "./12/app/sc/auth/index.js"
95
- },
96
- "./12/app/sc": {
97
- "import": "./12/app/sc/index.js"
98
- },
99
81
  "./12/createUseLocale": {
100
82
  "import": "./12/createUseLocale.js"
101
83
  },
@@ -111,9 +93,6 @@
111
93
  "./12/document": {
112
94
  "import": "./12/document/index.js"
113
95
  },
114
- "./12/document/sc": {
115
- "import": "./12/document/sc/index.js"
116
- },
117
96
  "./12/getT": {
118
97
  "import": "./12/getT.js"
119
98
  },
@@ -123,15 +102,9 @@
123
102
  "./12/seoBuildTags": {
124
103
  "import": "./12/seoBuildTags.js"
125
104
  },
126
- "./12/to": {
127
- "import": "./12/to.js"
128
- },
129
105
  "./12/translationAsOptions": {
130
106
  "import": "./12/translationAsOptions.js"
131
107
  },
132
- "./12/types-i18n": {
133
- "import": "./12/types-i18n.js"
134
- },
135
108
  "./12/types-seo": {
136
109
  "import": "./12/types-seo.js"
137
110
  },
@@ -144,18 +117,12 @@
144
117
  "./12/useDateFormat": {
145
118
  "import": "./12/useDateFormat.js"
146
119
  },
147
- "./12/useForm": {
148
- "import": "./12/useForm.js"
149
- },
150
120
  "./12/useLocale": {
151
121
  "import": "./12/useLocale.js"
152
122
  },
153
123
  "./12/useT": {
154
124
  "import": "./12/useT.js"
155
125
  },
156
- "./12/useTo": {
157
- "import": "./12/useTo.js"
158
- },
159
126
  "./ThemeContext": {
160
127
  "import": "./ThemeContext.js"
161
128
  },
@@ -168,9 +135,6 @@
168
135
  "./config": {
169
136
  "import": "./config.js"
170
137
  },
171
- "./getSiteUrl": {
172
- "import": "./getSiteUrl.js"
173
- },
174
138
  "./load": {
175
139
  "import": "./load.js"
176
140
  },
@@ -185,5 +149,5 @@
185
149
  "next-seo": "^6.4.0",
186
150
  "date-fns": "^3.2.0"
187
151
  },
188
- "version": "2.0.0-beta.31"
152
+ "version": "2.0.0-beta.32"
189
153
  }
package/12/Link.d.ts DELETED
@@ -1,7 +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
- export declare const Link: React.ForwardRefExoticComponent<Omit<LinkProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
7
- export default Link;
package/12/Link.js DELETED
@@ -1,9 +0,0 @@
1
- import { __assign, __rest } from "tslib";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import NextLink from "next/link";
4
- import { forwardRef } from "react";
5
- export var Link = forwardRef(function Link(_a, ref) {
6
- 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"]);
7
- return (_jsx(NextLink, { href: href, replace: replace, scroll: scroll, shallow: shallow, locale: locale, passHref: true, children: _jsx(Link, __assign({ ref: ref }, props)) }));
8
- });
9
- export default Link;
@@ -1,8 +0,0 @@
1
- import type { AppProps } from "next/app";
2
- import { type AppMainProps } from "../AppMain.js";
3
- import { type AppThemeProps } from "../AppTheme.js";
4
- export type NextAppProps = AppProps<{
5
- session: any;
6
- }> & AppThemeProps & AppMainProps;
7
- export declare const NextApp: (props: NextAppProps) => import("react/jsx-runtime").JSX.Element;
8
- export default NextApp;
@@ -1,10 +0,0 @@
1
- import { __assign } from "tslib";
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { SessionProvider } from "next-auth/react";
4
- import { AppHead } from "../../AppHead.js";
5
- import { AppMain } from "../AppMain.js";
6
- import { AppTheme } from "../AppTheme.js";
7
- export var NextApp = function (props) {
8
- return (_jsxs(_Fragment, { children: [_jsx(AppHead, {}), _jsx(SessionProvider, { session: props.pageProps.session, children: _jsx(AppTheme, __assign({}, props, { children: _jsx(AppMain, __assign({}, props)) })) })] }));
9
- };
10
- export default NextApp;
@@ -1,4 +0,0 @@
1
- import type { AppMainBaseProps, AppMainFramerProps } from "../AppMain.js";
2
- export type AppMainProps = AppMainBaseProps & AppMainFramerProps;
3
- export declare const AppMain: ({ Component, pageProps, Layout, ProgressOverlay, seo, motion, transition, pre, post, }: AppMainProps) => import("react/jsx-runtime").JSX.Element;
4
- export default AppMain;
@@ -1,18 +0,0 @@
1
- import { __assign } from "tslib";
2
- import { createElement as _createElement } from "react";
3
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
4
- import { AnimatePresence, m } from "framer-motion";
5
- import { useRouter } from "next/router";
6
- import { MotionProvider } from "@koine/react/m";
7
- import { NextProgress } from "../../NextProgress.js";
8
- import { SeoDefaults } from "../../SeoDefaults.js";
9
- export var AppMain = function (_a) {
10
- var Component = _a.Component, pageProps = _a.pageProps, Layout = _a.Layout, ProgressOverlay = _a.ProgressOverlay, seo = _a.seo, motion = _a.motion, _b = _a.transition, transition = _b === void 0 ? {
11
- initial: { opacity: 0 },
12
- animate: { opacity: 1 },
13
- exit: { opacity: 0 },
14
- } : _b, pre = _a.pre, post = _a.post;
15
- var pathname = useRouter().pathname;
16
- return (_jsxs(_Fragment, { children: [_jsx(SeoDefaults, __assign({}, seo)), pre, _jsxs(MotionProvider, { features: motion, children: [ProgressOverlay && _jsx(NextProgress, { Overlay: ProgressOverlay }), _jsx(Layout, { children: _jsx(AnimatePresence, { exitBeforeEnter: true, initial: false, children: _jsx(m.div, __assign({}, transition, { children: _createElement(Component, __assign({}, pageProps, { key: pathname })) }), pathname) }) })] }), post] }));
17
- };
18
- export default AppMain;
@@ -1,8 +0,0 @@
1
- import { type AppProps as NextAppProps } from "next/app";
2
- import React from "react";
3
- import { Theme } from "@koine/react/sc";
4
- export type AppThemeProps = React.PropsWithChildren<NextAppProps & {
5
- theme: Theme;
6
- }>;
7
- export declare const AppTheme: ({ theme, children }: AppThemeProps) => import("react/jsx-runtime").JSX.Element;
8
- export default AppTheme;
@@ -1,8 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { ThemeProvider } from "styled-components";
3
- import { StylesGlobal } from "@koine/react/sc";
4
- export var AppTheme = function (_a) {
5
- var theme = _a.theme, children = _a.children;
6
- return (_jsxs(ThemeProvider, { theme: theme, children: [_jsx(StylesGlobal, {}), children] }));
7
- };
8
- export default AppTheme;
@@ -1,8 +0,0 @@
1
- import type { AppProps } from "next/app";
2
- import { type AppMainProps } from "../AppMain.js";
3
- import { type AppThemeProps } from "../AppTheme.js";
4
- export type NextAppProps = AppProps<{
5
- session: any;
6
- }> & AppThemeProps & AppMainProps;
7
- export declare const NextApp: (props: NextAppProps) => import("react/jsx-runtime").JSX.Element;
8
- export default NextApp;
@@ -1,10 +0,0 @@
1
- import { __assign } from "tslib";
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { SessionProvider } from "next-auth/react";
4
- import { AppHead } from "../../AppHead.js";
5
- import { AppMain } from "../AppMain.js";
6
- import { AppTheme } from "../AppTheme.js";
7
- export var NextApp = function (props) {
8
- return (_jsxs(_Fragment, { children: [_jsx(AppHead, {}), _jsx(SessionProvider, { session: props.pageProps.session, children: _jsx(AppTheme, __assign({}, props, { children: _jsx(AppMain, __assign({}, props)) })) })] }));
9
- };
10
- export default NextApp;
@@ -1,6 +0,0 @@
1
- import type { AppProps } from "next/app";
2
- import { type AppMainProps } from "./AppMain.js";
3
- import { type AppThemeProps } from "./AppTheme.js";
4
- export type NextAppProps = AppProps & AppThemeProps & AppMainProps;
5
- export declare const NextApp: (props: NextAppProps) => import("react/jsx-runtime").JSX.Element;
6
- export default NextApp;
@@ -1,9 +0,0 @@
1
- import { __assign } from "tslib";
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { AppHead } from "../AppHead.js";
4
- import { AppMain } from "./AppMain.js";
5
- import { AppTheme } from "./AppTheme.js";
6
- export var NextApp = function (props) {
7
- return (_jsxs(_Fragment, { children: [_jsx(AppHead, {}), _jsx(AppTheme, __assign({}, props, { children: _jsx(AppMain, __assign({}, props)) }))] }));
8
- };
9
- export default NextApp;
@@ -1,6 +0,0 @@
1
- import NextDocument, { DocumentContext, type DocumentInitialProps } from "next/document";
2
- export declare class Document extends NextDocument {
3
- static getInitialProps(ctx: DocumentContext): Promise<DocumentInitialProps>;
4
- render(): import("react/jsx-runtime").JSX.Element;
5
- }
6
- export default Document;
@@ -1,50 +0,0 @@
1
- import { __assign, __awaiter, __extends, __generator } from "tslib";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import NextDocument, { Head, Html, Main, NextScript, } from "next/document";
4
- import React from "react";
5
- import { ServerStyleSheet } from "styled-components";
6
- import Meta from "@koine/react/Meta";
7
- import NoJs from "@koine/react/NoJs";
8
- var Document = (function (_super) {
9
- __extends(Document, _super);
10
- function Document() {
11
- return _super !== null && _super.apply(this, arguments) || this;
12
- }
13
- Document.getInitialProps = function (ctx) {
14
- return __awaiter(this, void 0, void 0, function () {
15
- var sheet, originalRenderPage, initialProps;
16
- return __generator(this, function (_a) {
17
- switch (_a.label) {
18
- case 0:
19
- sheet = new ServerStyleSheet();
20
- originalRenderPage = ctx.renderPage;
21
- _a.label = 1;
22
- case 1:
23
- _a.trys.push([1, , 3, 4]);
24
- ctx.renderPage = function () {
25
- return originalRenderPage({
26
- enhanceApp: function (App) { return function (props) {
27
- return sheet.collectStyles(_jsx(App, __assign({}, props)));
28
- }; },
29
- });
30
- };
31
- return [4, NextDocument.getInitialProps(ctx)];
32
- case 2:
33
- initialProps = _a.sent();
34
- return [2, __assign(__assign({}, initialProps), { styles: (_jsxs(React.Fragment, { children: [initialProps.styles, sheet.getStyleElement()] })) })];
35
- case 3:
36
- sheet.seal();
37
- return [7];
38
- case 4: return [2];
39
- }
40
- });
41
- });
42
- };
43
- Document.prototype.render = function () {
44
- var _a = this.props.__NEXT_DATA__, locale = _a.locale, defaultLocale = _a.defaultLocale;
45
- return (_jsxs(Html, { lang: locale || defaultLocale, className: "no-js", children: [_jsxs(Head, { children: [_jsx(Meta, {}), _jsx(NoJs, {})] }), _jsxs("body", { children: [_jsx(Main, {}), _jsx(NextScript, {})] })] }));
46
- };
47
- return Document;
48
- }(NextDocument));
49
- export { Document };
50
- export default Document;
package/12/to.d.ts DELETED
@@ -1,14 +0,0 @@
1
- import type { TranslateNamespaced, TranslatedRoute } from "./types-i18n.js";
2
- type OnlyStatic<T extends string> = T extends `${string}.[${string}].${string}` | `${string}.[${string}]` | `[${string}].${string}` | `[${string}]` ? never : T;
3
- type OnlyDynamic<T extends string> = T extends `${string}.[${string}].${string}` | `${string}.[${string}]` | `[${string}].${string}` | `[${string}]` ? T : never;
4
- type ExtractRouteParams<T extends string> = string extends T ? Record<string, string> : T extends `${infer _Start}[${infer Param}].${infer Rest}` ? {
5
- [k in Param | keyof ExtractRouteParams<Rest>]: string | number;
6
- } : T extends `${infer _Start}[${infer Param}]` ? {
7
- [k in Param]: string | number;
8
- } : {};
9
- export type ToTranslate = TranslateNamespaced<"~">;
10
- export type ToStaticRoute = OnlyStatic<TranslatedRoute>;
11
- export type ToDynamicRoute = OnlyDynamic<TranslatedRoute>;
12
- export type ToArgs = [ToStaticRoute] | [ToDynamicRoute, ExtractRouteParams<ToDynamicRoute>];
13
- export declare function to(...args: [ToTranslate, ...ToArgs]): string;
14
- export default to;
package/12/to.js DELETED
@@ -1,19 +0,0 @@
1
- import { __read } from "tslib";
2
- export function to() {
3
- var args = [];
4
- for (var _i = 0; _i < arguments.length; _i++) {
5
- args[_i] = arguments[_i];
6
- }
7
- var relative = "";
8
- var _a = __read(args, 1), t = _a[0];
9
- if (args.length === 3) {
10
- if (args[2]) {
11
- relative = t(args[1], args[2]).replace("*", "");
12
- }
13
- }
14
- else if (args.length === 2) {
15
- relative = t(args[1]);
16
- }
17
- return relative;
18
- }
19
- export default to;
@@ -1,31 +0,0 @@
1
- type Merge<T, K> = Omit<T, keyof K> & K;
2
- type Join<S1, S2> = S1 extends string ? S2 extends string ? `${S1}.${S2}` : S1 : never;
3
- export type TranslationsDictionaryDefault = {
4
- "~": any;
5
- };
6
- export type TranslationsDictionary = Merge<TranslationsDictionaryDefault, Koine.Translations>;
7
- export type TranslateNamespace = Extract<keyof TranslationsDictionary, string>;
8
- export type TranslationsPaths<T> = {
9
- [K in Extract<keyof T, string>]: T[K] extends Record<string, never> | never[] | "" ? never : T[K] extends Record<string, unknown> ? `${K}` | Join<K, TranslationsPaths<T[K]>> : T[K] extends string | number | boolean | Array<string | number | boolean | object> ? `${K}` : never;
10
- }[Extract<keyof T, string>] extends infer O ? O : never;
11
- export type TranslationsAllPaths = {
12
- [N in Extract<keyof TranslationsDictionary, string>]: {
13
- [K in Extract<keyof TranslationsDictionary[N], string>]: TranslationsDictionary[N][K] extends Record<string, never> | never[] | "" ? never : TranslationsDictionary[N][K] extends Record<string, unknown> ? `${N}:${K}` | Join<K extends string ? `${N}:${K}` : `${N}:`, TranslationsPaths<TranslationsDictionary[N][K]>> : TranslationsDictionary[N][K] extends string | number | boolean | Array<string | number | boolean | object> ? `${N}:${K}` : never;
14
- }[Extract<keyof TranslationsDictionary[N], string>];
15
- }[Extract<keyof TranslationsDictionary, string>] extends infer O ? O : never;
16
- export type TranslationShortcut = "obj" | "";
17
- export type TranslationQuery = undefined | null | TranslationShortcut | {
18
- [key: string]: string | number | boolean;
19
- };
20
- export type TranslationOptions = undefined | TranslationShortcut | {
21
- returnObjects?: boolean;
22
- fallback?: string | string[];
23
- default?: string;
24
- };
25
- export type Translate<TNamespace extends TranslateNamespace | undefined = TranslateNamespace> = TNamespace extends TranslateNamespace ? TranslateNamespaced<TNamespace> : TranslateDefault;
26
- export type TranslateDefault = <TReturn = string>(s: TranslationsAllPaths, q?: TranslationQuery, o?: TranslationOptions) => TReturn;
27
- export type TranslateNamespaced<TNamespace extends TranslateNamespace> = <TReturn = string>(s: TranslationsPaths<TranslationsDictionary[TNamespace]>, q?: TranslationQuery, o?: TranslationOptions) => TReturn;
28
- export type TranslateLoose = (s?: any, q?: TranslationQuery, o?: TranslationOptions) => string;
29
- export type TranslatedRoute = TranslationsPaths<TranslationsDictionary["~"]>;
30
- export type TranslatedRoutesChildrenOf<TStarts extends string, T extends string = TranslatedRoute> = T extends `${TStarts}.${infer First}.${infer Second}` ? First | `${First}.${Second}` : T extends `${TStarts}.${infer First}` ? First : never;
31
- export {};
package/12/types-i18n.js DELETED
@@ -1 +0,0 @@
1
- export {};
package/12/useForm.d.ts DELETED
@@ -1,27 +0,0 @@
1
- import type { ObjectSchema } from "@kuus/yup";
2
- import type { FieldValues, UseFormProps } from "react-hook-form";
3
- import { type TranslateLoose } from "./types-i18n.js";
4
- export declare function useForm<T extends FieldValues>(schema: ObjectSchema<any>, t: TranslateLoose, formProps?: UseFormProps, debug?: boolean): {
5
- watch: import("react-hook-form").UseFormWatch<T>;
6
- getValues: import("react-hook-form").UseFormGetValues<T>;
7
- getFieldState: import("react-hook-form").UseFormGetFieldState<T>;
8
- setError: import("react-hook-form").UseFormSetError<T>;
9
- clearErrors: import("react-hook-form").UseFormClearErrors<T>;
10
- setValue: import("react-hook-form").UseFormSetValue<T>;
11
- trigger: import("react-hook-form").UseFormTrigger<T>;
12
- formState: import("react-hook-form").FormState<T>;
13
- resetField: import("react-hook-form").UseFormResetField<T>;
14
- reset: import("react-hook-form").UseFormReset<T>;
15
- handleSubmit: import("react-hook-form").UseFormHandleSubmit<T, undefined>;
16
- unregister: import("react-hook-form").UseFormUnregister<T>;
17
- control: import("react-hook-form").Control<T, any>;
18
- register: import("react-hook-form").UseFormRegister<T>;
19
- setFocus: import("react-hook-form").UseFormSetFocus<T>;
20
- field: {
21
- control: import("react-hook-form").Control<T, any>;
22
- register: import("react-hook-form").UseFormRegister<T>;
23
- setValue: import("react-hook-form").UseFormSetValue<T>;
24
- t: TranslateLoose;
25
- };
26
- };
27
- export default useForm;
package/12/useForm.js DELETED
@@ -1,15 +0,0 @@
1
- "use client";
2
- import { __assign } from "tslib";
3
- import { yupResolver as resolver } from "@hookform/resolvers/yup";
4
- import { useMemo } from "react";
5
- import { useForm as _useForm } from "react-hook-form";
6
- export function useForm(schema, t, formProps, debug) {
7
- if (formProps === void 0) { formProps = {}; }
8
- var form = _useForm(__assign({ resolver: resolver(schema) }, formProps));
9
- return useMemo(function () {
10
- var control = form.control, register = form.register, setValue = form.setValue;
11
- var field = { control: control, register: register, setValue: setValue, t: t };
12
- return __assign({ field: field }, form);
13
- }, [t, form]);
14
- }
15
- export default useForm;
package/12/useTo.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import { type ToArgs } from "./to.js";
2
- export declare function useTo(): (...args: ToArgs) => string;
3
- export default useTo;
package/12/useTo.js DELETED
@@ -1,15 +0,0 @@
1
- "use client";
2
- import { __read, __spreadArray } from "tslib";
3
- import { to } from "./to.js";
4
- import { useT } from "./useT.js";
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], __read(args), false));
13
- };
14
- }
15
- export default useTo;
package/getSiteUrl.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare function getSiteUrl(path?: string): string;
2
- export default getSiteUrl;
package/getSiteUrl.js DELETED
@@ -1,6 +0,0 @@
1
- import { normaliseUrl } from "@koine/utils";
2
- export function getSiteUrl(path) {
3
- if (path === void 0) { path = ""; }
4
- return normaliseUrl("".concat(process.env["NEXT_PUBLIC_APP_URL"], "/").concat(path));
5
- }
6
- export default getSiteUrl;