@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
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AppMainBaseProps, AppMainFramerProps } from "../AppMain";
|
|
2
|
+
export type AppMainProps = AppMainBaseProps & AppMainFramerProps;
|
|
3
|
+
/**
|
|
4
|
+
* App main
|
|
5
|
+
*
|
|
6
|
+
* It implies a setup for `styled-components` and `framer-motion` libraries.
|
|
7
|
+
*
|
|
8
|
+
* About the page transition [wallis' blog post](https://wallis.dev/blog/nextjs-page-transitions-with-framer-motion)
|
|
9
|
+
*/
|
|
10
|
+
export declare const AppMain: ({ Component, pageProps, Layout, ProgressOverlay, seo, motion, transition, pre, post, }: AppMainProps) => JSX.Element;
|
|
11
|
+
export default AppMain;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppMain = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var react_1 = require("react");
|
|
6
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
var router_1 = require("next/router");
|
|
8
|
+
var framer_motion_1 = require("framer-motion");
|
|
9
|
+
var m_1 = require("@koine/react/m");
|
|
10
|
+
var SeoDefaults_1 = require("../../SeoDefaults");
|
|
11
|
+
var NextProgress_1 = require("../../NextProgress");
|
|
12
|
+
/**
|
|
13
|
+
* App main
|
|
14
|
+
*
|
|
15
|
+
* It implies a setup for `styled-components` and `framer-motion` libraries.
|
|
16
|
+
*
|
|
17
|
+
* About the page transition [wallis' blog post](https://wallis.dev/blog/nextjs-page-transitions-with-framer-motion)
|
|
18
|
+
*/
|
|
19
|
+
var AppMain = function (_a) {
|
|
20
|
+
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 ? {
|
|
21
|
+
initial: { opacity: 0 },
|
|
22
|
+
animate: { opacity: 1 },
|
|
23
|
+
exit: { opacity: 0 },
|
|
24
|
+
} : _b, pre = _a.pre, post = _a.post;
|
|
25
|
+
var pathname = (0, router_1.useRouter)().pathname;
|
|
26
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SeoDefaults_1.SeoDefaults, tslib_1.__assign({}, seo)), pre, (0, jsx_runtime_1.jsxs)(m_1.MotionProvider, tslib_1.__assign({ features: motion }, { children: [ProgressOverlay && (0, jsx_runtime_1.jsx)(NextProgress_1.NextProgress, { Overlay: ProgressOverlay }), (0, jsx_runtime_1.jsx)(Layout, { children: (0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, tslib_1.__assign({ exitBeforeEnter: true, initial: false }, { children: (0, jsx_runtime_1.jsx)(framer_motion_1.m.div, tslib_1.__assign({}, transition, { children: (0, react_1.createElement)(Component, tslib_1.__assign({}, pageProps, { key: pathname })) }), pathname) })) })] })), post] }));
|
|
27
|
+
};
|
|
28
|
+
exports.AppMain = AppMain;
|
|
29
|
+
exports.default = exports.AppMain;
|
|
@@ -0,0 +1,25 @@
|
|
|
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 { useRouter } from "next/router";
|
|
5
|
+
import { AnimatePresence, m } from "framer-motion";
|
|
6
|
+
import { MotionProvider } from "@koine/react/m";
|
|
7
|
+
import { SeoDefaults } from "../../SeoDefaults";
|
|
8
|
+
import { NextProgress } from "../../NextProgress";
|
|
9
|
+
/**
|
|
10
|
+
* App main
|
|
11
|
+
*
|
|
12
|
+
* It implies a setup for `styled-components` and `framer-motion` libraries.
|
|
13
|
+
*
|
|
14
|
+
* About the page transition [wallis' blog post](https://wallis.dev/blog/nextjs-page-transitions-with-framer-motion)
|
|
15
|
+
*/
|
|
16
|
+
export var AppMain = function (_a) {
|
|
17
|
+
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 ? {
|
|
18
|
+
initial: { opacity: 0 },
|
|
19
|
+
animate: { opacity: 1 },
|
|
20
|
+
exit: { opacity: 0 },
|
|
21
|
+
} : _b, pre = _a.pre, post = _a.post;
|
|
22
|
+
var pathname = useRouter().pathname;
|
|
23
|
+
return (_jsxs(_Fragment, { children: [_jsx(SeoDefaults, __assign({}, seo)), pre, _jsxs(MotionProvider, __assign({ features: motion }, { children: [ProgressOverlay && _jsx(NextProgress, { Overlay: ProgressOverlay }), _jsx(Layout, { children: _jsx(AnimatePresence, __assign({ exitBeforeEnter: true, initial: false }, { children: _jsx(m.div, __assign({}, transition, { children: _createElement(Component, __assign({}, pageProps, { key: pathname })) }), pathname) })) })] })), post] }));
|
|
24
|
+
};
|
|
25
|
+
export default AppMain;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type AppProps as NextAppProps } from "next/app";
|
|
3
|
+
import { Theme } from "@koine/react/sc";
|
|
4
|
+
export type AppThemeProps = React.PropsWithChildren<NextAppProps & {
|
|
5
|
+
/**
|
|
6
|
+
* A theme object
|
|
7
|
+
*/
|
|
8
|
+
theme: Theme;
|
|
9
|
+
}>;
|
|
10
|
+
/**
|
|
11
|
+
* App theme with `styled-components`
|
|
12
|
+
*/
|
|
13
|
+
export declare const AppTheme: ({ theme, children }: AppThemeProps) => JSX.Element;
|
|
14
|
+
export default AppTheme;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppTheme = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
var styled_components_1 = require("styled-components");
|
|
7
|
+
var sc_1 = require("@koine/react/sc");
|
|
8
|
+
/**
|
|
9
|
+
* App theme with `styled-components`
|
|
10
|
+
*/
|
|
11
|
+
var AppTheme = function (_a) {
|
|
12
|
+
var theme = _a.theme, children = _a.children;
|
|
13
|
+
return ((0, jsx_runtime_1.jsxs)(styled_components_1.ThemeProvider, tslib_1.__assign({ theme: theme }, { children: [(0, jsx_runtime_1.jsx)(sc_1.StylesGlobal, {}), children] })));
|
|
14
|
+
};
|
|
15
|
+
exports.AppTheme = AppTheme;
|
|
16
|
+
exports.default = exports.AppTheme;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ThemeProvider } from "styled-components";
|
|
4
|
+
import { StylesGlobal } from "@koine/react/sc";
|
|
5
|
+
/**
|
|
6
|
+
* App theme with `styled-components`
|
|
7
|
+
*/
|
|
8
|
+
export var AppTheme = function (_a) {
|
|
9
|
+
var theme = _a.theme, children = _a.children;
|
|
10
|
+
return (_jsxs(ThemeProvider, __assign({ theme: theme }, { children: [_jsx(StylesGlobal, {}), children] })));
|
|
11
|
+
};
|
|
12
|
+
export default AppTheme;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AppProps } from "next/app";
|
|
2
|
+
import { type AppThemeProps } from "../AppTheme";
|
|
3
|
+
import { type AppMainProps } from "../AppMain";
|
|
4
|
+
export type NextAppProps = AppProps<{
|
|
5
|
+
session: any;
|
|
6
|
+
}> & AppThemeProps & AppMainProps;
|
|
7
|
+
/**
|
|
8
|
+
* App with authentication provided by `next-auth`
|
|
9
|
+
*/
|
|
10
|
+
export declare const NextApp: (props: NextAppProps) => JSX.Element;
|
|
11
|
+
export default NextApp;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NextApp = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
var react_1 = require("next-auth/react");
|
|
7
|
+
var AppHead_1 = require("../../AppHead");
|
|
8
|
+
var AppTheme_1 = require("../AppTheme");
|
|
9
|
+
var AppMain_1 = require("../AppMain");
|
|
10
|
+
/**
|
|
11
|
+
* App with authentication provided by `next-auth`
|
|
12
|
+
*/
|
|
13
|
+
var NextApp = function (props) {
|
|
14
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(AppHead_1.AppHead, {}), (0, jsx_runtime_1.jsx)(react_1.SessionProvider, tslib_1.__assign({ session: props.pageProps.session }, { children: (0, jsx_runtime_1.jsx)(AppTheme_1.AppTheme, tslib_1.__assign({}, props, { children: (0, jsx_runtime_1.jsx)(AppMain_1.AppMain, tslib_1.__assign({}, props)) })) }))] }));
|
|
15
|
+
};
|
|
16
|
+
exports.NextApp = NextApp;
|
|
17
|
+
exports.default = exports.NextApp;
|
|
@@ -0,0 +1,13 @@
|
|
|
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";
|
|
5
|
+
import { AppTheme } from "../AppTheme";
|
|
6
|
+
import { AppMain } from "../AppMain";
|
|
7
|
+
/**
|
|
8
|
+
* App with authentication provided by `next-auth`
|
|
9
|
+
*/
|
|
10
|
+
export var NextApp = function (props) {
|
|
11
|
+
return (_jsxs(_Fragment, { children: [_jsx(AppHead, {}), _jsx(SessionProvider, __assign({ session: props.pageProps.session }, { children: _jsx(AppTheme, __assign({}, props, { children: _jsx(AppMain, __assign({}, props)) })) }))] }));
|
|
12
|
+
};
|
|
13
|
+
export default NextApp;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { AppProps } from "next/app";
|
|
2
|
+
import { type AppThemeProps } from "./AppTheme";
|
|
3
|
+
import { type AppMainProps } from "./AppMain";
|
|
4
|
+
export type NextAppProps = AppProps & AppThemeProps & AppMainProps;
|
|
5
|
+
/**
|
|
6
|
+
* App
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
*
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import { NextApp, NextAppProps } from "@koine/next/app/sc/auth";
|
|
12
|
+
* import { Favicon, AnalyticsGoogle } from "@koine/next";
|
|
13
|
+
* import { theme } from "src/helpers/theme";
|
|
14
|
+
* import { Layout, ProgressOverlay } from "src/components/Layout";
|
|
15
|
+
* // import "@fontsource/myfont/800.css";
|
|
16
|
+
* // import "src/helpers/theme.css";
|
|
17
|
+
*
|
|
18
|
+
* const motion = () => import("@koine/react/m/max").then((m) => m.default);
|
|
19
|
+
*
|
|
20
|
+
* export default function App(props: NextAppProps) {
|
|
21
|
+
* return (
|
|
22
|
+
* <NextApp
|
|
23
|
+
* {...props}
|
|
24
|
+
* Layout={Layout}
|
|
25
|
+
* ProgressOverlay={ProgressOverlay}
|
|
26
|
+
* theme={theme}
|
|
27
|
+
* motion={motion}
|
|
28
|
+
* seo={{
|
|
29
|
+
* titleTemplate: "%s | MyApp",
|
|
30
|
+
* defaultTitle: "MyApp",
|
|
31
|
+
* openGraph: {
|
|
32
|
+
* type: "website",
|
|
33
|
+
* locale: "en_US",
|
|
34
|
+
* url: "https://myapp.com/",
|
|
35
|
+
* site_name: "MyApp",
|
|
36
|
+
* },
|
|
37
|
+
* twitter: {
|
|
38
|
+
* handle: "@MklrNl",
|
|
39
|
+
* site: "@MyApp",
|
|
40
|
+
* cardType: "summary_large_image",
|
|
41
|
+
* },
|
|
42
|
+
* }}
|
|
43
|
+
* pre={
|
|
44
|
+
* <>
|
|
45
|
+
* <AnalyticsGoogle id="UA-xxxxxxxx-x" />
|
|
46
|
+
* <Favicon name="MyApp" color="#000000" />
|
|
47
|
+
* </>
|
|
48
|
+
* }
|
|
49
|
+
* />
|
|
50
|
+
* );
|
|
51
|
+
* }
|
|
52
|
+
*
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare const NextApp: (props: NextAppProps) => JSX.Element;
|
|
56
|
+
export default NextApp;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NextApp = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
var AppHead_1 = require("../AppHead");
|
|
7
|
+
var AppTheme_1 = require("./AppTheme");
|
|
8
|
+
var AppMain_1 = require("./AppMain");
|
|
9
|
+
/**
|
|
10
|
+
* App
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
*
|
|
14
|
+
* ```tsx
|
|
15
|
+
* import { NextApp, NextAppProps } from "@koine/next/app/sc/auth";
|
|
16
|
+
* import { Favicon, AnalyticsGoogle } from "@koine/next";
|
|
17
|
+
* import { theme } from "src/helpers/theme";
|
|
18
|
+
* import { Layout, ProgressOverlay } from "src/components/Layout";
|
|
19
|
+
* // import "@fontsource/myfont/800.css";
|
|
20
|
+
* // import "src/helpers/theme.css";
|
|
21
|
+
*
|
|
22
|
+
* const motion = () => import("@koine/react/m/max").then((m) => m.default);
|
|
23
|
+
*
|
|
24
|
+
* export default function App(props: NextAppProps) {
|
|
25
|
+
* return (
|
|
26
|
+
* <NextApp
|
|
27
|
+
* {...props}
|
|
28
|
+
* Layout={Layout}
|
|
29
|
+
* ProgressOverlay={ProgressOverlay}
|
|
30
|
+
* theme={theme}
|
|
31
|
+
* motion={motion}
|
|
32
|
+
* seo={{
|
|
33
|
+
* titleTemplate: "%s | MyApp",
|
|
34
|
+
* defaultTitle: "MyApp",
|
|
35
|
+
* openGraph: {
|
|
36
|
+
* type: "website",
|
|
37
|
+
* locale: "en_US",
|
|
38
|
+
* url: "https://myapp.com/",
|
|
39
|
+
* site_name: "MyApp",
|
|
40
|
+
* },
|
|
41
|
+
* twitter: {
|
|
42
|
+
* handle: "@MklrNl",
|
|
43
|
+
* site: "@MyApp",
|
|
44
|
+
* cardType: "summary_large_image",
|
|
45
|
+
* },
|
|
46
|
+
* }}
|
|
47
|
+
* pre={
|
|
48
|
+
* <>
|
|
49
|
+
* <AnalyticsGoogle id="UA-xxxxxxxx-x" />
|
|
50
|
+
* <Favicon name="MyApp" color="#000000" />
|
|
51
|
+
* </>
|
|
52
|
+
* }
|
|
53
|
+
* />
|
|
54
|
+
* );
|
|
55
|
+
* }
|
|
56
|
+
*
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
var NextApp = function (props) {
|
|
60
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(AppHead_1.AppHead, {}), (0, jsx_runtime_1.jsx)(AppTheme_1.AppTheme, tslib_1.__assign({}, props, { children: (0, jsx_runtime_1.jsx)(AppMain_1.AppMain, tslib_1.__assign({}, props)) }))] }));
|
|
61
|
+
};
|
|
62
|
+
exports.NextApp = NextApp;
|
|
63
|
+
exports.default = exports.NextApp;
|
|
@@ -0,0 +1,59 @@
|
|
|
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";
|
|
4
|
+
import { AppTheme } from "./AppTheme";
|
|
5
|
+
import { AppMain } from "./AppMain";
|
|
6
|
+
/**
|
|
7
|
+
* App
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
*
|
|
11
|
+
* ```tsx
|
|
12
|
+
* import { NextApp, NextAppProps } from "@koine/next/app/sc/auth";
|
|
13
|
+
* import { Favicon, AnalyticsGoogle } from "@koine/next";
|
|
14
|
+
* import { theme } from "src/helpers/theme";
|
|
15
|
+
* import { Layout, ProgressOverlay } from "src/components/Layout";
|
|
16
|
+
* // import "@fontsource/myfont/800.css";
|
|
17
|
+
* // import "src/helpers/theme.css";
|
|
18
|
+
*
|
|
19
|
+
* const motion = () => import("@koine/react/m/max").then((m) => m.default);
|
|
20
|
+
*
|
|
21
|
+
* export default function App(props: NextAppProps) {
|
|
22
|
+
* return (
|
|
23
|
+
* <NextApp
|
|
24
|
+
* {...props}
|
|
25
|
+
* Layout={Layout}
|
|
26
|
+
* ProgressOverlay={ProgressOverlay}
|
|
27
|
+
* theme={theme}
|
|
28
|
+
* motion={motion}
|
|
29
|
+
* seo={{
|
|
30
|
+
* titleTemplate: "%s | MyApp",
|
|
31
|
+
* defaultTitle: "MyApp",
|
|
32
|
+
* openGraph: {
|
|
33
|
+
* type: "website",
|
|
34
|
+
* locale: "en_US",
|
|
35
|
+
* url: "https://myapp.com/",
|
|
36
|
+
* site_name: "MyApp",
|
|
37
|
+
* },
|
|
38
|
+
* twitter: {
|
|
39
|
+
* handle: "@MklrNl",
|
|
40
|
+
* site: "@MyApp",
|
|
41
|
+
* cardType: "summary_large_image",
|
|
42
|
+
* },
|
|
43
|
+
* }}
|
|
44
|
+
* pre={
|
|
45
|
+
* <>
|
|
46
|
+
* <AnalyticsGoogle id="UA-xxxxxxxx-x" />
|
|
47
|
+
* <Favicon name="MyApp" color="#000000" />
|
|
48
|
+
* </>
|
|
49
|
+
* }
|
|
50
|
+
* />
|
|
51
|
+
* );
|
|
52
|
+
* }
|
|
53
|
+
*
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export var NextApp = function (props) {
|
|
57
|
+
return (_jsxs(_Fragment, { children: [_jsx(AppHead, {}), _jsx(AppTheme, __assign({}, props, { children: _jsx(AppMain, __assign({}, props)) }))] }));
|
|
58
|
+
};
|
|
59
|
+
export default NextApp;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import NextDocument from "next/document";
|
|
3
|
+
/**
|
|
4
|
+
* Next Document wrapper for bare projects
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
*
|
|
8
|
+
* in your `myapp/pages/_document.tsx`:
|
|
9
|
+
* ```tsx
|
|
10
|
+
* export { Document as default } from "@koine/next/document";
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export declare class Document extends NextDocument {
|
|
14
|
+
render(): JSX.Element;
|
|
15
|
+
}
|
|
16
|
+
export default Document;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Document = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
var document_1 = tslib_1.__importStar(require("next/document"));
|
|
7
|
+
var Meta_1 = tslib_1.__importDefault(require("@koine/react/Meta"));
|
|
8
|
+
var NoJs_1 = tslib_1.__importDefault(require("@koine/react/NoJs"));
|
|
9
|
+
/**
|
|
10
|
+
* Next Document wrapper for bare projects
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
*
|
|
14
|
+
* in your `myapp/pages/_document.tsx`:
|
|
15
|
+
* ```tsx
|
|
16
|
+
* export { Document as default } from "@koine/next/document";
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
var Document = /** @class */ (function (_super) {
|
|
20
|
+
tslib_1.__extends(Document, _super);
|
|
21
|
+
function Document() {
|
|
22
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
23
|
+
}
|
|
24
|
+
Document.prototype.render = function () {
|
|
25
|
+
var _a = this.props.__NEXT_DATA__, locale = _a.locale, defaultLocale = _a.defaultLocale;
|
|
26
|
+
return ((0, jsx_runtime_1.jsxs)(document_1.Html, tslib_1.__assign({ lang: locale || defaultLocale, className: "no-js" }, { children: [(0, jsx_runtime_1.jsxs)(document_1.Head, { children: [(0, jsx_runtime_1.jsx)(Meta_1.default, {}), (0, jsx_runtime_1.jsx)(NoJs_1.default, {})] }), (0, jsx_runtime_1.jsxs)("body", { children: [(0, jsx_runtime_1.jsx)(document_1.Main, {}), (0, jsx_runtime_1.jsx)(document_1.NextScript, {})] })] })));
|
|
27
|
+
};
|
|
28
|
+
return Document;
|
|
29
|
+
}(document_1.default));
|
|
30
|
+
exports.Document = Document;
|
|
31
|
+
exports.default = Document;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { __assign, __extends } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import NextDocument, { Html, Head, Main, NextScript } from "next/document";
|
|
4
|
+
import Meta from "@koine/react/Meta";
|
|
5
|
+
import NoJs from "@koine/react/NoJs";
|
|
6
|
+
/**
|
|
7
|
+
* Next Document wrapper for bare projects
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
*
|
|
11
|
+
* in your `myapp/pages/_document.tsx`:
|
|
12
|
+
* ```tsx
|
|
13
|
+
* export { Document as default } from "@koine/next/document";
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
var Document = /** @class */ (function (_super) {
|
|
17
|
+
__extends(Document, _super);
|
|
18
|
+
function Document() {
|
|
19
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
20
|
+
}
|
|
21
|
+
Document.prototype.render = function () {
|
|
22
|
+
var _a = this.props.__NEXT_DATA__, locale = _a.locale, defaultLocale = _a.defaultLocale;
|
|
23
|
+
return (_jsxs(Html, __assign({ lang: locale || defaultLocale, className: "no-js" }, { children: [_jsxs(Head, { children: [_jsx(Meta, {}), _jsx(NoJs, {})] }), _jsxs("body", { children: [_jsx(Main, {}), _jsx(NextScript, {})] })] })));
|
|
24
|
+
};
|
|
25
|
+
return Document;
|
|
26
|
+
}(NextDocument));
|
|
27
|
+
export { Document };
|
|
28
|
+
export default Document;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import NextDocument from "next/document";
|
|
3
|
+
/**
|
|
4
|
+
* Next Document wrapper for `css/tailwind` based projects
|
|
5
|
+
*
|
|
6
|
+
* Uses cookie to manage the current theme
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
*
|
|
10
|
+
* in your `myapp/pages/_document.tsx`:
|
|
11
|
+
* ```tsx
|
|
12
|
+
* export { Document as default } from "@koine/next/document/css";
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare class Document extends NextDocument {
|
|
16
|
+
render(): JSX.Element;
|
|
17
|
+
}
|
|
18
|
+
export default Document;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Document = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
var document_1 = tslib_1.__importStar(require("next/document"));
|
|
7
|
+
var Meta_1 = tslib_1.__importDefault(require("@koine/react/Meta"));
|
|
8
|
+
var NoJs_1 = tslib_1.__importDefault(require("@koine/react/NoJs"));
|
|
9
|
+
// import { getInitialThemeFromRequest, ThemeVanillaValue } from "@koine/react/sc"; // FIXME: this should be imported from another entrypoint
|
|
10
|
+
/**
|
|
11
|
+
* Next Document wrapper for `css/tailwind` based projects
|
|
12
|
+
*
|
|
13
|
+
* Uses cookie to manage the current theme
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
*
|
|
17
|
+
* in your `myapp/pages/_document.tsx`:
|
|
18
|
+
* ```tsx
|
|
19
|
+
* export { Document as default } from "@koine/next/document/css";
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
var Document = /** @class */ (function (_super) {
|
|
23
|
+
tslib_1.__extends(Document, _super);
|
|
24
|
+
function Document() {
|
|
25
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
26
|
+
}
|
|
27
|
+
// static override async getInitialProps(
|
|
28
|
+
// ctx: DocumentContext
|
|
29
|
+
// ): Promise<DocumentInitialProps & { theme: ThemeVanillaValue }> {
|
|
30
|
+
// const initialProps = await NextDocument.getInitialProps(ctx);
|
|
31
|
+
// return {
|
|
32
|
+
// ...initialProps,
|
|
33
|
+
// theme: getInitialThemeFromRequest(
|
|
34
|
+
// ctx.req?.headers.cookie /* || document?.cookie */ || ""
|
|
35
|
+
// ),
|
|
36
|
+
// };
|
|
37
|
+
// }
|
|
38
|
+
Document.prototype.render = function () {
|
|
39
|
+
var _a = this.props.__NEXT_DATA__, locale = _a.locale, defaultLocale = _a.defaultLocale;
|
|
40
|
+
return ((0, jsx_runtime_1.jsxs)(document_1.Html, tslib_1.__assign({ lang: locale || defaultLocale, className: "no-js" }, { children: [(0, jsx_runtime_1.jsxs)(document_1.Head, { children: [(0, jsx_runtime_1.jsx)(Meta_1.default, {}), (0, jsx_runtime_1.jsx)(NoJs_1.default, {})] }), (0, jsx_runtime_1.jsxs)("body", { children: [(0, jsx_runtime_1.jsx)(document_1.Main, {}), (0, jsx_runtime_1.jsx)(document_1.NextScript, {})] })] })));
|
|
41
|
+
};
|
|
42
|
+
return Document;
|
|
43
|
+
}(document_1.default));
|
|
44
|
+
exports.Document = Document;
|
|
45
|
+
exports.default = Document;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { __assign, __extends } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import NextDocument, {
|
|
4
|
+
// DocumentContext,
|
|
5
|
+
// type DocumentInitialProps,
|
|
6
|
+
Html, Head, Main, NextScript, } from "next/document";
|
|
7
|
+
import Meta from "@koine/react/Meta";
|
|
8
|
+
import NoJs from "@koine/react/NoJs";
|
|
9
|
+
// import { getInitialThemeFromRequest, ThemeVanillaValue } from "@koine/react/sc"; // FIXME: this should be imported from another entrypoint
|
|
10
|
+
/**
|
|
11
|
+
* Next Document wrapper for `css/tailwind` based projects
|
|
12
|
+
*
|
|
13
|
+
* Uses cookie to manage the current theme
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
*
|
|
17
|
+
* in your `myapp/pages/_document.tsx`:
|
|
18
|
+
* ```tsx
|
|
19
|
+
* export { Document as default } from "@koine/next/document/css";
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
var Document = /** @class */ (function (_super) {
|
|
23
|
+
__extends(Document, _super);
|
|
24
|
+
function Document() {
|
|
25
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
26
|
+
}
|
|
27
|
+
// static override async getInitialProps(
|
|
28
|
+
// ctx: DocumentContext
|
|
29
|
+
// ): Promise<DocumentInitialProps & { theme: ThemeVanillaValue }> {
|
|
30
|
+
// const initialProps = await NextDocument.getInitialProps(ctx);
|
|
31
|
+
// return {
|
|
32
|
+
// ...initialProps,
|
|
33
|
+
// theme: getInitialThemeFromRequest(
|
|
34
|
+
// ctx.req?.headers.cookie /* || document?.cookie */ || ""
|
|
35
|
+
// ),
|
|
36
|
+
// };
|
|
37
|
+
// }
|
|
38
|
+
Document.prototype.render = function () {
|
|
39
|
+
var _a = this.props.__NEXT_DATA__, locale = _a.locale, defaultLocale = _a.defaultLocale;
|
|
40
|
+
return (_jsxs(Html, __assign({ lang: locale || defaultLocale, className: "no-js" }, { children: [_jsxs(Head, { children: [_jsx(Meta, {}), _jsx(NoJs, {})] }), _jsxs("body", { children: [_jsx(Main, {}), _jsx(NextScript, {})] })] })));
|
|
41
|
+
};
|
|
42
|
+
return Document;
|
|
43
|
+
}(NextDocument));
|
|
44
|
+
export { Document };
|
|
45
|
+
export default Document;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = exports.Document = void 0;
|
|
4
|
+
var Document_1 = require("./Document");
|
|
5
|
+
Object.defineProperty(exports, "Document", { enumerable: true, get: function () { return Document_1.Document; } });
|
|
6
|
+
var Document_2 = require("./Document");
|
|
7
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return Document_2.Document; } });
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import NextDocument, { DocumentContext, type DocumentInitialProps } from "next/document";
|
|
3
|
+
/**
|
|
4
|
+
* Next Document wrapper for `styled-components` based projects
|
|
5
|
+
*
|
|
6
|
+
* For typescript safety of this component
|
|
7
|
+
* @see https://bit.ly/3ceuF8m
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
*
|
|
11
|
+
* in your `myapp/pages/_document.tsx`:
|
|
12
|
+
* ```tsx
|
|
13
|
+
* export { Document as default } from "@koine/next/document/sc";
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare class Document extends NextDocument {
|
|
17
|
+
static getInitialProps(ctx: DocumentContext): Promise<DocumentInitialProps>;
|
|
18
|
+
render(): JSX.Element;
|
|
19
|
+
}
|
|
20
|
+
export default Document;
|