@koine/next 1.0.4 → 1.0.9
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/Analytics/AnalyticsGoogle.d.ts +5 -6
- package/Analytics/AnalyticsGoogle.js +37 -0
- package/Analytics/index.d.ts +1 -1
- package/Analytics/index.js +1 -0
- package/Analytics/package.json +6 -0
- package/Auth/helpers.d.ts +17 -17
- package/Auth/helpers.js +21 -0
- package/Auth/index.d.ts +4 -4
- package/Auth/index.js +4 -0
- package/Auth/package.json +6 -0
- package/Auth/useLogin.d.ts +7 -7
- package/Auth/useLogin.js +50 -0
- package/Auth/useLoginUrl.d.ts +1 -1
- package/Auth/useLoginUrl.js +11 -0
- package/Auth/useLogout.d.ts +6 -6
- package/Auth/useLogout.js +52 -0
- package/Favicon/Favicon.d.ts +3 -4
- package/Favicon/Favicon.js +4 -0
- package/Favicon/index.d.ts +1 -1
- package/Favicon/index.js +1 -0
- package/Favicon/package.json +6 -0
- package/Forms/index.d.ts +2 -2
- package/Forms/index.js +2 -0
- package/Forms/package.json +6 -0
- package/Forms/useForm.d.ts +32 -32
- package/Forms/useForm.js +37 -0
- package/Forms/useSubmit.d.ts +24 -24
- package/Forms/useSubmit.js +23 -0
- package/Head/Head.d.ts +1 -1
- package/Head/Head.js +1 -0
- package/Head/index.d.ts +1 -1
- package/Head/index.js +1 -0
- package/Head/package.json +6 -0
- package/I18n/I18n.d.ts +44 -48
- package/I18n/I18n.js +74 -0
- package/I18n/index.d.ts +1 -1
- package/I18n/index.js +1 -0
- package/I18n/package.json +6 -0
- package/Img/Img.d.ts +21 -21
- package/Img/Img.js +28 -0
- package/Img/index.d.ts +1 -1
- package/Img/index.js +1 -0
- package/Img/package.json +6 -0
- package/Link/Link.d.ts +9 -8
- package/Link/Link.js +9 -0
- package/Link/index.d.ts +1 -1
- package/Link/index.js +1 -0
- package/Link/package.json +6 -0
- package/NextProgress/NextProgress.d.ts +24 -14
- package/NextProgress/NextProgress.js +37 -0
- package/NextProgress/index.d.ts +2 -1
- package/NextProgress/index.js +1 -0
- package/NextProgress/package.json +6 -0
- package/README.md +0 -0
- package/Seo/Seo.d.ts +3 -3
- package/Seo/Seo.js +8 -0
- package/Seo/SeoDefaults.d.ts +3 -3
- package/Seo/SeoDefaults.js +12 -0
- package/Seo/helpers.d.ts +48 -48
- package/Seo/helpers.js +111 -0
- package/Seo/index.d.ts +12 -12
- package/Seo/index.js +12 -0
- package/Seo/package.json +6 -0
- package/Theme/Theme.d.ts +46 -46
- package/Theme/Theme.js +235 -0
- package/Theme/index.d.ts +1 -1
- package/Theme/index.js +1 -0
- package/Theme/package.json +6 -0
- package/app/AppHead.d.ts +2 -3
- package/app/AppHead.js +5 -0
- package/app/AppMain.d.ts +35 -34
- package/app/AppMain.js +1 -0
- package/app/css/AppMain.d.ts +8 -0
- package/app/css/AppMain.js +11 -0
- package/app/css/AppTheme.d.ts +10 -0
- package/app/css/AppTheme.js +12 -0
- package/app/css/auth/index.d.ts +9 -0
- package/app/css/auth/index.js +13 -0
- package/app/css/auth/package.json +6 -0
- package/app/css/index.d.ts +54 -0
- package/app/css/index.js +57 -0
- package/app/css/package.json +6 -0
- package/app/em/AppMain.d.ts +10 -0
- package/app/em/AppMain.js +22 -0
- package/app/{AppTheme--emotion.d.ts → em/AppTheme.d.ts} +15 -15
- package/app/em/AppTheme.js +17 -0
- package/app/em/auth/index.d.ts +9 -0
- package/app/em/auth/index.js +13 -0
- package/app/em/auth/package.json +6 -0
- package/app/em/index.d.ts +9 -0
- package/app/em/index.js +12 -0
- package/app/em/package.json +6 -0
- package/app/index.d.ts +2 -11
- package/app/index.js +2 -0
- package/app/package.json +6 -0
- package/app/sc/AppMain.d.ts +10 -0
- package/app/sc/AppMain.js +22 -0
- package/app/sc/AppTheme.d.ts +13 -0
- package/app/sc/AppTheme.js +9 -0
- package/app/sc/auth/index.d.ts +9 -0
- package/app/sc/auth/index.js +13 -0
- package/app/sc/auth/package.json +6 -0
- package/app/sc/index.d.ts +56 -0
- package/app/sc/index.js +59 -0
- package/app/sc/package.json +6 -0
- package/config/index.d.ts +71 -58
- package/config/index.js +174 -0
- package/config/package.json +6 -0
- package/document/Document.d.ts +15 -10
- package/document/Document.js +19 -0
- package/document/css/index.d.ts +22 -0
- package/document/css/index.js +30 -0
- package/document/css/package.json +6 -0
- package/document/em/index.d.ts +16 -0
- package/document/em/index.js +68 -0
- package/document/em/package.json +6 -0
- package/document/index.d.ts +2 -4
- package/document/index.js +2 -0
- package/document/package.json +6 -0
- package/document/{Document--sc.d.ts → sc/index.d.ts} +20 -11
- package/document/sc/index.js +44 -0
- package/document/sc/package.json +6 -0
- package/index.d.ts +12 -12
- package/index.js +12 -743
- package/node/Analytics/AnalyticsGoogle.js +42 -0
- package/node/Analytics/index.js +4 -0
- package/node/Auth/helpers.js +26 -0
- package/node/Auth/index.js +7 -0
- package/node/Auth/useLogin.js +54 -0
- package/node/Auth/useLoginUrl.js +15 -0
- package/node/Auth/useLogout.js +56 -0
- package/node/Favicon/Favicon.js +9 -0
- package/node/Favicon/index.js +4 -0
- package/node/Forms/index.js +5 -0
- package/node/Forms/useForm.js +41 -0
- package/node/Forms/useSubmit.js +27 -0
- package/node/Head/Head.js +8 -0
- package/node/Head/index.js +4 -0
- package/node/I18n/I18n.js +82 -0
- package/node/I18n/index.js +4 -0
- package/node/Img/Img.js +34 -0
- package/node/Img/index.js +4 -0
- package/node/Link/Link.js +13 -0
- package/node/Link/index.js +4 -0
- package/node/NextProgress/NextProgress.js +41 -0
- package/node/NextProgress/index.js +5 -0
- package/node/Seo/Seo.js +12 -0
- package/node/Seo/SeoDefaults.js +16 -0
- package/node/Seo/helpers.js +115 -0
- package/node/Seo/index.js +15 -0
- package/node/Theme/Theme.js +241 -0
- package/node/Theme/index.js +4 -0
- package/node/app/AppHead.js +10 -0
- package/node/app/AppMain.js +2 -0
- package/node/app/css/AppMain.js +16 -0
- package/node/app/css/AppTheme.js +16 -0
- package/node/app/css/auth/index.js +18 -0
- package/node/app/css/index.js +62 -0
- package/node/app/em/AppMain.js +26 -0
- package/node/app/em/AppTheme.js +22 -0
- package/node/app/em/auth/index.js +18 -0
- package/node/app/em/index.js +17 -0
- package/node/app/index.js +5 -0
- package/node/app/sc/AppMain.js +26 -0
- package/node/app/sc/AppTheme.js +13 -0
- package/node/app/sc/auth/index.js +18 -0
- package/node/app/sc/index.js +64 -0
- package/node/config/index.js +184 -0
- package/node/document/Document.js +24 -0
- package/node/document/css/index.js +35 -0
- package/node/document/em/index.js +73 -0
- package/node/document/index.js +7 -0
- package/node/document/sc/index.js +49 -0
- package/node/index.js +15 -0
- package/node/utils/api.js +38 -0
- package/node/utils/emotion-cache.js +13 -0
- package/node/utils/index.js +32 -0
- package/package.json +3 -30
- package/{types.d.ts → typings.d.ts} +10 -7
- package/utils/api.d.ts +55 -55
- package/utils/api.js +35 -0
- package/{document/emotion.d.ts → utils/emotion-cache.d.ts} +5 -5
- package/utils/emotion-cache.js +8 -0
- package/utils/index.d.ts +19 -19
- package/utils/index.js +26 -0
- package/utils/package.json +6 -0
- package/Theme.js +0 -1905
- package/_tslib.js +0 -41
- package/app/App--emotion.d.ts +0 -10
- package/app/App--sc.d.ts +0 -10
- package/app/App--vanilla.d.ts +0 -10
- package/app/AppAuth--emotion.d.ts +0 -10
- package/app/AppAuth--sc.d.ts +0 -10
- package/app/AppMain--vanilla.d.ts +0 -27
- package/app/AppTheme--sc.d.ts +0 -13
- package/app/AppTheme--vanilla.d.ts +0 -10
- package/app/motion-features.d.ts +0 -2
- package/app.js +0 -250
- package/config.js +0 -183
- package/document/Document--emotion.d.ts +0 -5
- package/document/Document--vanilla.d.ts +0 -11
- package/document.js +0 -207
- package/emotion.js +0 -1329
- package/es.object.assign.js +0 -1074
- package/es.string.replace.js +0 -785
- package/es.string.split.js +0 -201
- package/index.esm.js +0 -4600
- package/index.umd.js +0 -4638
- package/motion-features.js +0 -10
package/_tslib.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/*! *****************************************************************************
|
|
4
|
-
Copyright (c) Microsoft Corporation.
|
|
5
|
-
|
|
6
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
7
|
-
purpose with or without fee is hereby granted.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
-
***************************************************************************** */
|
|
17
|
-
|
|
18
|
-
function __rest(s, e) {
|
|
19
|
-
var t = {};
|
|
20
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
21
|
-
t[p] = s[p];
|
|
22
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
23
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
24
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
25
|
-
t[p[i]] = s[p[i]];
|
|
26
|
-
}
|
|
27
|
-
return t;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
31
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
32
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
33
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
34
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
35
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
36
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
exports.__awaiter = __awaiter;
|
|
41
|
-
exports.__rest = __rest;
|
package/app/App--emotion.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { AppProps as NextAppProps } from "next/app";
|
|
3
|
-
import { AppThemeEmotionProps } from "./AppTheme--emotion";
|
|
4
|
-
import { AppMainProps } from "./AppMain";
|
|
5
|
-
export declare type AppEmotionProps = NextAppProps & AppThemeEmotionProps & AppMainProps;
|
|
6
|
-
/**
|
|
7
|
-
* App
|
|
8
|
-
*/
|
|
9
|
-
export declare const AppEmotion: React.FC<AppEmotionProps>;
|
|
10
|
-
export default AppEmotion;
|
package/app/App--sc.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { AppProps as NextAppProps } from "next/app";
|
|
3
|
-
import { AppThemeScProps } from "./AppTheme--sc";
|
|
4
|
-
import { AppMainProps } from "./AppMain";
|
|
5
|
-
export declare type AppBaseProps = NextAppProps & AppThemeScProps & AppMainProps;
|
|
6
|
-
/**
|
|
7
|
-
* App
|
|
8
|
-
*/
|
|
9
|
-
export declare const AppBase: React.FC<AppBaseProps>;
|
|
10
|
-
export default AppBase;
|
package/app/App--vanilla.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { AppProps as NextAppProps } from "next/app";
|
|
3
|
-
import { AppThemeVanillaProps } from "./AppTheme--vanilla";
|
|
4
|
-
import { AppMainVanillaProps } from "./AppMain--vanilla";
|
|
5
|
-
export declare type AppVanillaProps = NextAppProps & AppThemeVanillaProps & AppMainVanillaProps;
|
|
6
|
-
/**
|
|
7
|
-
* App
|
|
8
|
-
*/
|
|
9
|
-
export declare const AppVanilla: React.FC<AppVanillaProps>;
|
|
10
|
-
export default AppVanilla;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { AppProps as NextAppProps } from "next/app";
|
|
3
|
-
import { AppThemeEmotionProps } from "./AppTheme--emotion";
|
|
4
|
-
import { AppMainProps } from "./AppMain";
|
|
5
|
-
export declare type AppAuthEmotionProps = NextAppProps & AppThemeEmotionProps & AppMainProps;
|
|
6
|
-
/**
|
|
7
|
-
* App with authentication provided by `next-auth`
|
|
8
|
-
*/
|
|
9
|
-
export declare const AppAuthEmotion: React.FC<AppAuthEmotionProps>;
|
|
10
|
-
export default AppAuthEmotion;
|
package/app/AppAuth--sc.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { AppProps as NextAppProps } from "next/app";
|
|
3
|
-
import { AppThemeScProps } from "./AppTheme--sc";
|
|
4
|
-
import { AppMainProps } from "./AppMain";
|
|
5
|
-
export declare type AppAuthScProps = NextAppProps & AppThemeScProps & AppMainProps;
|
|
6
|
-
/**
|
|
7
|
-
* App with authentication provided by `next-auth`
|
|
8
|
-
*/
|
|
9
|
-
export declare const AppAuthSc: React.FC<AppAuthScProps>;
|
|
10
|
-
export default AppAuthSc;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { AppProps as NextAppProps } from "next/app";
|
|
3
|
-
import { SeoDefaultsProps } from "../Seo";
|
|
4
|
-
export declare type AppMainVanillaProps = NextAppProps & {
|
|
5
|
-
/**
|
|
6
|
-
* A wrapping layout component
|
|
7
|
-
*/
|
|
8
|
-
Layout: React.FC<Record<string, unknown>>;
|
|
9
|
-
/**
|
|
10
|
-
* Seo site wide default configuration
|
|
11
|
-
*/
|
|
12
|
-
seo?: SeoDefaultsProps;
|
|
13
|
-
/**
|
|
14
|
-
* JSX to render just after SEO
|
|
15
|
-
*/
|
|
16
|
-
pre?: React.ReactNode;
|
|
17
|
-
/**
|
|
18
|
-
* JSX to render just at the end of the markup
|
|
19
|
-
*/
|
|
20
|
-
post?: React.ReactNode;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* App main
|
|
24
|
-
*
|
|
25
|
-
* It does not imply any specific styling or animation solution
|
|
26
|
-
*/
|
|
27
|
-
export declare const AppMainVanilla: React.FC<AppMainVanillaProps>;
|
package/app/AppTheme--sc.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { AppProps as NextAppProps } from "next/app";
|
|
3
|
-
import { Theme } from "@koine/react";
|
|
4
|
-
export declare type AppThemeScProps = NextAppProps & {
|
|
5
|
-
/**
|
|
6
|
-
* A theme object
|
|
7
|
-
*/
|
|
8
|
-
theme: Theme;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* App theme with `styled-components`
|
|
12
|
-
*/
|
|
13
|
-
export declare const AppThemeSc: React.FC<AppThemeScProps>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { AppProps as NextAppProps } from "next/app";
|
|
3
|
-
import { ThemeProviderProps } from "../Theme";
|
|
4
|
-
export declare type AppThemeVanillaProps = NextAppProps & {
|
|
5
|
-
theme: ThemeProviderProps["defaultTheme"];
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* App theme with vanilla class based theme (good for `tailwindcss`)
|
|
9
|
-
*/
|
|
10
|
-
export declare const AppThemeVanilla: React.FC<AppThemeVanillaProps>;
|
package/app/motion-features.d.ts
DELETED
package/app.js
DELETED
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
require('./es.object.assign.js');
|
|
6
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
-
var React = require('react');
|
|
8
|
-
var Head = require('next/head');
|
|
9
|
-
var styles = require('@mui/material/styles');
|
|
10
|
-
var react = require('@emotion/react');
|
|
11
|
-
var CssBaseline = require('@mui/material/CssBaseline');
|
|
12
|
-
var react$1 = require('@koine/react');
|
|
13
|
-
var emotion = require('./emotion.js');
|
|
14
|
-
var Theme = require('./Theme.js');
|
|
15
|
-
var router = require('next/router');
|
|
16
|
-
var framerMotion = require('framer-motion');
|
|
17
|
-
require('./es.string.replace.js');
|
|
18
|
-
require('@koine/utils');
|
|
19
|
-
var styledComponents = require('styled-components');
|
|
20
|
-
var react$2 = require('next-auth/react');
|
|
21
|
-
require('next/script');
|
|
22
|
-
|
|
23
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
24
|
-
|
|
25
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
26
|
-
var Head__default = /*#__PURE__*/_interopDefaultLegacy(Head);
|
|
27
|
-
var CssBaseline__default = /*#__PURE__*/_interopDefaultLegacy(CssBaseline);
|
|
28
|
-
|
|
29
|
-
const AppHead = props => {
|
|
30
|
-
return jsxRuntime.jsx(Head__default["default"], Object.assign({}, props, {
|
|
31
|
-
children: jsxRuntime.jsx("meta", {
|
|
32
|
-
name: "viewport",
|
|
33
|
-
content: "width=device-width"
|
|
34
|
-
})
|
|
35
|
-
}));
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
let _ = t => t,
|
|
39
|
-
_t;
|
|
40
|
-
|
|
41
|
-
const clientSideEmotionCache = emotion.createEmotionCache();
|
|
42
|
-
/**
|
|
43
|
-
* App theme with `emotion` (good for `@mui`)s
|
|
44
|
-
*/
|
|
45
|
-
|
|
46
|
-
const AppThemeEmotion = ({
|
|
47
|
-
emotionCache: _emotionCache = clientSideEmotionCache,
|
|
48
|
-
theme,
|
|
49
|
-
children
|
|
50
|
-
}) => {
|
|
51
|
-
return jsxRuntime.jsx(react.CacheProvider, Object.assign({
|
|
52
|
-
value: _emotionCache
|
|
53
|
-
}, {
|
|
54
|
-
children: jsxRuntime.jsxs(styles.ThemeProvider, Object.assign({
|
|
55
|
-
theme: theme
|
|
56
|
-
}, {
|
|
57
|
-
children: [jsxRuntime.jsx(CssBaseline__default["default"], {}), jsxRuntime.jsx(react.Global, {
|
|
58
|
-
styles: react.css(_t || (_t = _`
|
|
59
|
-
${0}
|
|
60
|
-
`), react$1.stylesGlobal)
|
|
61
|
-
}), children]
|
|
62
|
-
}))
|
|
63
|
-
}));
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* @see https://www.framer.com/docs/guide-reduce-bundle-size/
|
|
68
|
-
*/
|
|
69
|
-
|
|
70
|
-
const loadMotionFeatures = () => Promise.resolve().then(function () { return require('./motion-features.js'); }).then(m => m.default);
|
|
71
|
-
/**
|
|
72
|
-
* App main
|
|
73
|
-
*
|
|
74
|
-
* It implies a setup for `styled-components` and `framer-motion` libraries.
|
|
75
|
-
*
|
|
76
|
-
* About the page transition [wallis' blog post](https://wallis.dev/blog/nextjs-page-transitions-with-framer-motion)
|
|
77
|
-
*/
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const AppMain = ({
|
|
81
|
-
Component,
|
|
82
|
-
pageProps,
|
|
83
|
-
Layout,
|
|
84
|
-
// theme,
|
|
85
|
-
seo,
|
|
86
|
-
transition: _transition = {
|
|
87
|
-
initial: {
|
|
88
|
-
opacity: 0
|
|
89
|
-
},
|
|
90
|
-
animate: {
|
|
91
|
-
opacity: 1
|
|
92
|
-
},
|
|
93
|
-
exit: {
|
|
94
|
-
opacity: 0
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
pre,
|
|
98
|
-
post
|
|
99
|
-
}) => {
|
|
100
|
-
const {
|
|
101
|
-
pathname
|
|
102
|
-
} = router.useRouter();
|
|
103
|
-
return jsxRuntime.jsxs(framerMotion.LazyMotion, Object.assign({
|
|
104
|
-
features: loadMotionFeatures
|
|
105
|
-
}, {
|
|
106
|
-
children: [jsxRuntime.jsx(Theme.SeoDefaults, Object.assign({}, seo)), pre, jsxRuntime.jsx(Theme.NextProgress, {}), jsxRuntime.jsx(Layout, {
|
|
107
|
-
children: jsxRuntime.jsx(framerMotion.AnimatePresence, Object.assign({
|
|
108
|
-
exitBeforeEnter: true,
|
|
109
|
-
initial: false
|
|
110
|
-
}, {
|
|
111
|
-
children: jsxRuntime.jsx(framerMotion.m.div, Object.assign({}, _transition, {
|
|
112
|
-
children: /*#__PURE__*/React.createElement(Component, Object.assign({}, pageProps, {
|
|
113
|
-
key: pathname
|
|
114
|
-
}))
|
|
115
|
-
}), pathname)
|
|
116
|
-
}))
|
|
117
|
-
}), post]
|
|
118
|
-
}));
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* App
|
|
123
|
-
*/
|
|
124
|
-
|
|
125
|
-
const AppEmotion = props => {
|
|
126
|
-
return jsxRuntime.jsxs(React__default["default"].Fragment, {
|
|
127
|
-
children: [jsxRuntime.jsx(AppHead, {}), jsxRuntime.jsx(AppThemeEmotion, Object.assign({}, props, {
|
|
128
|
-
children: jsxRuntime.jsx(AppMain, Object.assign({}, props))
|
|
129
|
-
}))]
|
|
130
|
-
});
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* App theme with `styled-components`
|
|
135
|
-
*/
|
|
136
|
-
|
|
137
|
-
const AppThemeSc = ({
|
|
138
|
-
theme,
|
|
139
|
-
children
|
|
140
|
-
}) => {
|
|
141
|
-
return jsxRuntime.jsxs(styledComponents.ThemeProvider, Object.assign({
|
|
142
|
-
theme: theme
|
|
143
|
-
}, {
|
|
144
|
-
children: [jsxRuntime.jsx(react$1.StylesGlobal, {}), children]
|
|
145
|
-
}));
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* App
|
|
150
|
-
*/
|
|
151
|
-
|
|
152
|
-
const AppBase = props => {
|
|
153
|
-
return jsxRuntime.jsxs(React__default["default"].Fragment, {
|
|
154
|
-
children: [jsxRuntime.jsx(AppHead, {}), jsxRuntime.jsx(AppThemeSc, Object.assign({}, props, {
|
|
155
|
-
children: jsxRuntime.jsx(AppMain, Object.assign({}, props))
|
|
156
|
-
}))]
|
|
157
|
-
});
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* App theme with vanilla class based theme (good for `tailwindcss`)
|
|
162
|
-
*/
|
|
163
|
-
|
|
164
|
-
const AppThemeVanilla = ({
|
|
165
|
-
theme,
|
|
166
|
-
children
|
|
167
|
-
}) => {
|
|
168
|
-
// return (
|
|
169
|
-
// <ThemeVanillaProvider initialTheme={theme}>{children}</ThemeVanillaProvider>
|
|
170
|
-
// );
|
|
171
|
-
return jsxRuntime.jsx(Theme.ThemeProvider, Object.assign({
|
|
172
|
-
defaultTheme: theme,
|
|
173
|
-
attribute: "class"
|
|
174
|
-
}, {
|
|
175
|
-
children: children
|
|
176
|
-
}));
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* App main
|
|
181
|
-
*
|
|
182
|
-
* It does not imply any specific styling or animation solution
|
|
183
|
-
*/
|
|
184
|
-
|
|
185
|
-
const AppMainVanilla = ({
|
|
186
|
-
Component,
|
|
187
|
-
pageProps,
|
|
188
|
-
Layout,
|
|
189
|
-
seo,
|
|
190
|
-
pre,
|
|
191
|
-
post
|
|
192
|
-
}) => {
|
|
193
|
-
return jsxRuntime.jsxs(React__default["default"].Fragment, {
|
|
194
|
-
children: [jsxRuntime.jsx(Theme.SeoDefaults, Object.assign({}, seo)), pre, jsxRuntime.jsx(Layout, {
|
|
195
|
-
children: jsxRuntime.jsx(Component, Object.assign({}, pageProps))
|
|
196
|
-
}), post]
|
|
197
|
-
});
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* App
|
|
202
|
-
*/
|
|
203
|
-
|
|
204
|
-
const AppVanilla = props => {
|
|
205
|
-
return jsxRuntime.jsxs(React__default["default"].Fragment, {
|
|
206
|
-
children: [jsxRuntime.jsx(AppHead, {}), jsxRuntime.jsx(AppThemeVanilla, Object.assign({}, props, {
|
|
207
|
-
children: jsxRuntime.jsx(AppMainVanilla, Object.assign({}, props))
|
|
208
|
-
}))]
|
|
209
|
-
});
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
* App with authentication provided by `next-auth`
|
|
214
|
-
*/
|
|
215
|
-
|
|
216
|
-
const AppAuthEmotion = props => {
|
|
217
|
-
return jsxRuntime.jsxs(react$2.SessionProvider, Object.assign({
|
|
218
|
-
session: props.pageProps.session
|
|
219
|
-
}, {
|
|
220
|
-
children: [jsxRuntime.jsx(AppHead, {}), jsxRuntime.jsx(AppThemeEmotion, Object.assign({}, props, {
|
|
221
|
-
children: jsxRuntime.jsx(AppMain, Object.assign({}, props))
|
|
222
|
-
}))]
|
|
223
|
-
}));
|
|
224
|
-
};
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* App with authentication provided by `next-auth`
|
|
228
|
-
*/
|
|
229
|
-
|
|
230
|
-
const AppAuthSc = props => {
|
|
231
|
-
return jsxRuntime.jsxs(react$2.SessionProvider, Object.assign({
|
|
232
|
-
session: props.pageProps.session
|
|
233
|
-
}, {
|
|
234
|
-
children: [jsxRuntime.jsx(AppHead, {}), jsxRuntime.jsx(AppThemeSc, Object.assign({}, props, {
|
|
235
|
-
children: jsxRuntime.jsx(AppMain, Object.assign({}, props))
|
|
236
|
-
}))]
|
|
237
|
-
}));
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
exports.AppAuthEmotion = AppAuthEmotion;
|
|
241
|
-
exports.AppAuthSc = AppAuthSc;
|
|
242
|
-
exports.AppBase = AppBase;
|
|
243
|
-
exports.AppEmotion = AppEmotion;
|
|
244
|
-
exports.AppHead = AppHead;
|
|
245
|
-
exports.AppMain = AppMain;
|
|
246
|
-
exports.AppMainVanilla = AppMainVanilla;
|
|
247
|
-
exports.AppThemeEmotion = AppThemeEmotion;
|
|
248
|
-
exports.AppThemeSc = AppThemeSc;
|
|
249
|
-
exports.AppThemeVanilla = AppThemeVanilla;
|
|
250
|
-
exports.AppVanilla = AppVanilla;
|
package/config.js
DELETED
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
require('./es.string.replace.js');
|
|
6
|
-
require('./es.string.split.js');
|
|
7
|
-
require('./es.object.assign.js');
|
|
8
|
-
var _tslib = require('./_tslib.js');
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Normalise pathname
|
|
12
|
-
*
|
|
13
|
-
* From a path like `/some//malformed/path///` it returns `some/malformed/path`
|
|
14
|
-
*
|
|
15
|
-
* - Removes subsequent slashes
|
|
16
|
-
* - Removing initial and ending slashes
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
function normaliseUrlPathname(pathname) {
|
|
20
|
-
return pathname.replace(/\/+\//g, "/").replace(/^\/+(.*?)\/+$/, "$1");
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Clean a pathname and encode each part
|
|
24
|
-
*
|
|
25
|
-
* @see {@link normaliseUrlPathname}
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
function encodePathname(pathname) {
|
|
29
|
-
const parts = normaliseUrlPathname(pathname).split("/");
|
|
30
|
-
return parts.filter(part => !!part).map(part => encodeURIComponent(part)).join("/");
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
*/
|
|
34
|
-
|
|
35
|
-
function getPathRedirect(locale, localisedPathname, templateName, dynamic, permanent) {
|
|
36
|
-
const suffix = dynamic ? `/:slug*` : "";
|
|
37
|
-
return {
|
|
38
|
-
source: `/${locale}/${encodePathname(localisedPathname)}${suffix}`,
|
|
39
|
-
destination: `/${encodePathname(templateName)}${suffix}`,
|
|
40
|
-
permanent: Boolean(permanent),
|
|
41
|
-
locale: false
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
*/
|
|
46
|
-
|
|
47
|
-
function getPathRewrite(source, destination, dynamic) {
|
|
48
|
-
const suffix = dynamic ? `/:path*` : "";
|
|
49
|
-
return {
|
|
50
|
-
source: `/${encodePathname(source)}${suffix}`,
|
|
51
|
-
destination: `/${encodePathname(destination)}${suffix}`
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
*/
|
|
56
|
-
|
|
57
|
-
function getRedirects({
|
|
58
|
-
defaultLocale,
|
|
59
|
-
routes,
|
|
60
|
-
dynamicRoutes,
|
|
61
|
-
permanent
|
|
62
|
-
}) {
|
|
63
|
-
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
64
|
-
const redirects = [];
|
|
65
|
-
Object.keys(routes).forEach(page => {
|
|
66
|
-
const dynamic = dynamicRoutes[page];
|
|
67
|
-
|
|
68
|
-
if (routes[page] !== page) {
|
|
69
|
-
if (dynamic) {
|
|
70
|
-
redirects.push(getPathRedirect(defaultLocale, page, routes[page], true, permanent));
|
|
71
|
-
} else {
|
|
72
|
-
redirects.push(getPathRedirect(defaultLocale, page, routes[page], false, permanent));
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}); // console.log("redirects", redirects);
|
|
76
|
-
|
|
77
|
-
return redirects;
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
*/
|
|
82
|
-
|
|
83
|
-
function getRewrites({
|
|
84
|
-
routes,
|
|
85
|
-
dynamicRoutes
|
|
86
|
-
}) {
|
|
87
|
-
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
88
|
-
const rewrites = [];
|
|
89
|
-
Object.keys(routes).forEach(page => {
|
|
90
|
-
const dynamic = dynamicRoutes[page];
|
|
91
|
-
|
|
92
|
-
if (routes[page] !== page) {
|
|
93
|
-
if (dynamic) {
|
|
94
|
-
rewrites.push(getPathRewrite(routes[page], page, true));
|
|
95
|
-
} else {
|
|
96
|
-
rewrites.push(getPathRewrite(routes[page], page));
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}); // console.log("rewrites", rewrites);
|
|
100
|
-
|
|
101
|
-
return rewrites;
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Get Next.js config with some basic opinionated defaults
|
|
106
|
-
*/
|
|
107
|
-
|
|
108
|
-
function withKoine(_a = {}) {
|
|
109
|
-
var {
|
|
110
|
-
nx = true,
|
|
111
|
-
svg = true,
|
|
112
|
-
sc = true
|
|
113
|
-
} = _a,
|
|
114
|
-
nextConfig = _tslib.__rest(_a, ["nx", "svg", "sc"]);
|
|
115
|
-
|
|
116
|
-
nextConfig = Object.assign({
|
|
117
|
-
// @see https://nextjs.org/docs/api-reference/next.config.js/custom-page-extensions#including-non-page-files-in-the-pages-directory
|
|
118
|
-
pageExtensions: ["page.tsx", "page.ts"],
|
|
119
|
-
eslint: {
|
|
120
|
-
ignoreDuringBuilds: true // we have this strict check on each commit
|
|
121
|
-
|
|
122
|
-
},
|
|
123
|
-
typescript: {
|
|
124
|
-
ignoreBuildErrors: true // we have this strict check on each commit
|
|
125
|
-
|
|
126
|
-
},
|
|
127
|
-
poweredByHeader: false,
|
|
128
|
-
swcMinify: true,
|
|
129
|
-
experimental: Object.assign({
|
|
130
|
-
// @see https://github.com/vercel/vercel/discussions/5973#discussioncomment-472618
|
|
131
|
-
// @see critters error https://github.com/vercel/next.js/issues/20742
|
|
132
|
-
// optimizeCss: true,
|
|
133
|
-
// @see https://github.com/vercel/next.js/discussions/30174#discussion-3643870
|
|
134
|
-
scrollRestoration: true
|
|
135
|
-
}, nextConfig.experimental || {})
|
|
136
|
-
}, nextConfig);
|
|
137
|
-
|
|
138
|
-
if (svg) {
|
|
139
|
-
if (nx) {
|
|
140
|
-
// @see https://github.com/gregberge/svgr
|
|
141
|
-
nextConfig["nx"] = {
|
|
142
|
-
svgr: true
|
|
143
|
-
};
|
|
144
|
-
} else {
|
|
145
|
-
nextConfig.webpack = (_config, options) => {
|
|
146
|
-
const webpackConfig = typeof nextConfig.webpack === "function" ? nextConfig.webpack(_config, options) : _config; // @see https://dev.to/dolearning/importing-svgs-to-next-js-nna#svgr
|
|
147
|
-
|
|
148
|
-
webpackConfig.module.rules.push({
|
|
149
|
-
test: /\.svg$/,
|
|
150
|
-
use: [{
|
|
151
|
-
loader: "@svgr/webpack",
|
|
152
|
-
options: {
|
|
153
|
-
svgoConfig: {
|
|
154
|
-
plugins: [{
|
|
155
|
-
name: "removeViewBox",
|
|
156
|
-
active: false
|
|
157
|
-
}]
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}]
|
|
161
|
-
});
|
|
162
|
-
return webpackConfig;
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
if (sc) {
|
|
168
|
-
nextConfig.compiler = {
|
|
169
|
-
styledComponents: true
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
return nextConfig;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
exports["default"] = withKoine;
|
|
177
|
-
exports.encodePathname = encodePathname;
|
|
178
|
-
exports.getPathRedirect = getPathRedirect;
|
|
179
|
-
exports.getPathRewrite = getPathRewrite;
|
|
180
|
-
exports.getRedirects = getRedirects;
|
|
181
|
-
exports.getRewrites = getRewrites;
|
|
182
|
-
exports.normaliseUrlPathname = normaliseUrlPathname;
|
|
183
|
-
exports.withKoine = withKoine;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import NextDocument, { DocumentContext, DocumentInitialProps } from "next/document";
|
|
3
|
-
import { ThemeVanillaValue } from "@koine/react";
|
|
4
|
-
/**
|
|
5
|
-
*/
|
|
6
|
-
export declare class DocumentVanilla extends NextDocument {
|
|
7
|
-
static getInitialProps(ctx: DocumentContext): Promise<DocumentInitialProps & {
|
|
8
|
-
theme: ThemeVanillaValue;
|
|
9
|
-
}>;
|
|
10
|
-
render(): JSX.Element;
|
|
11
|
-
}
|