@koine/next 1.0.45 → 1.0.46
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 → AnalyticsGoogle.d.ts} +1 -0
- package/{Analytics/AnalyticsGoogle.js → AnalyticsGoogle.js} +1 -0
- package/DynamicNamespaces.d.ts +13 -0
- package/DynamicNamespaces.js +8 -0
- package/{Favicon/Favicon.d.ts → Favicon.d.ts} +1 -0
- package/{Favicon/Favicon.js → Favicon.js} +1 -0
- package/Head.d.ts +3 -0
- package/Head.js +3 -0
- package/Link.d.ts +10 -0
- package/{Link/Link.js → Link.js} +1 -0
- package/{Img/Img.d.ts → NextImg.d.ts} +2 -6
- package/{Img/Img.js → NextImg.js} +2 -10
- package/NextImgSmart.d.ts +6 -0
- package/NextImgSmart.js +13 -0
- package/{NextProgress/NextProgress.d.ts → NextProgress.d.ts} +1 -1
- package/{NextProgress/NextProgress.js → NextProgress.js} +1 -0
- package/Seo.d.ts +27 -0
- package/Seo.js +16 -0
- package/SeoDefaults.d.ts +11 -0
- package/{Seo/SeoDefaults.js → SeoDefaults.js} +3 -2
- package/{i18n/T/index.d.ts → T.d.ts} +1 -1
- package/{i18n/T/index.js → T.js} +0 -0
- package/app/AppMain.d.ts +1 -1
- package/app/css/AppMain.js +1 -1
- package/app/css/AppTheme.d.ts +1 -1
- package/app/css/AppTheme.js +1 -1
- package/app/em/AppMain.js +1 -1
- package/app/em/AppTheme.js +1 -1
- package/app/sc/AppMain.js +1 -1
- package/{Auth → auth}/helpers.d.ts +1 -1
- package/{Auth → auth}/helpers.js +0 -0
- package/{Auth → auth}/index.d.ts +0 -0
- package/{Auth → auth}/index.js +0 -0
- package/{Head → auth}/package.json +1 -1
- package/{Auth → auth}/useLogin.d.ts +1 -0
- package/{Auth → auth}/useLogin.js +2 -1
- package/{Auth → auth}/useLoginUrl.d.ts +1 -0
- package/{Auth → auth}/useLoginUrl.js +2 -1
- package/{Auth → auth}/useLogout.d.ts +1 -0
- package/{Auth → auth}/useLogout.js +2 -1
- package/config/index.js +1 -7
- package/{utils/emotion-cache.d.ts → createEmotionCache.d.ts} +1 -0
- package/{utils/emotion-cache.js → createEmotionCache.js} +1 -0
- package/document/em/index.js +1 -1
- package/getSiteUrl.d.ts +8 -0
- package/getSiteUrl.js +12 -0
- package/{i18n/getT/index.d.ts → getT.d.ts} +2 -1
- package/{i18n/getT/index.js → getT.js} +1 -0
- package/index.d.ts +21 -7
- package/index.js +23 -7
- package/{utils/index.d.ts → load.d.ts} +1 -9
- package/{utils/index.js → load.js} +1 -13
- package/node/{Analytics/AnalyticsGoogle.js → AnalyticsGoogle.js} +1 -0
- package/node/DynamicNamespaces.js +12 -0
- package/node/{Favicon/Favicon.js → Favicon.js} +1 -0
- package/node/Head.js +7 -0
- package/node/{Link/Link.js → Link.js} +1 -0
- package/node/{Img/Img.js → NextImg.js} +2 -11
- package/node/NextImgSmart.js +17 -0
- package/node/{NextProgress/NextProgress.js → NextProgress.js} +1 -0
- package/node/{Seo/Seo.js → Seo.js} +10 -2
- package/node/{Seo/SeoDefaults.js → SeoDefaults.js} +3 -2
- package/node/{i18n/T/index.js → T.js} +0 -0
- package/node/app/css/AppMain.js +2 -2
- package/node/app/css/AppTheme.js +2 -2
- package/node/app/em/AppMain.js +2 -2
- package/node/app/em/AppTheme.js +2 -2
- package/node/app/sc/AppMain.js +2 -2
- package/node/{Auth → auth}/helpers.js +0 -0
- package/node/{Auth → auth}/index.js +0 -0
- package/node/{Auth → auth}/useLogin.js +3 -2
- package/node/{Auth → auth}/useLoginUrl.js +3 -2
- package/node/{Auth → auth}/useLogout.js +3 -2
- package/node/config/index.js +1 -7
- package/node/{utils/emotion-cache.js → createEmotionCache.js} +1 -0
- package/node/document/em/index.js +2 -2
- package/node/getSiteUrl.js +16 -0
- package/node/{i18n/getT/index.js → getT.js} +1 -0
- package/node/index.js +23 -7
- package/node/{utils/index.js → load.js} +2 -15
- package/node/revalidate.js +8 -0
- package/node/{Seo/helpers.js → seoBuildTags.js} +7 -5
- package/node/to.js +29 -0
- package/node/{i18n/translationAsOptions/index.js → translationAsOptions.js} +0 -0
- package/node/{i18n/types.js → types-i18n.js} +0 -0
- package/node/types-seo.js +2 -0
- package/node/useBackUrl.js +31 -0
- package/node/{i18n/useDateFormat/index.js → useDateFormat.js} +0 -0
- package/node/{Forms/useForm.js → useForm.js} +0 -0
- package/node/{i18n/useLocale/index.js → useLocale.js} +0 -0
- package/node/{i18n/useT/index.js → useT.js} +0 -0
- package/node/{Theme/Theme.js → useTheme.js} +1 -0
- package/node/useTo.js +18 -0
- package/package.json +5 -5
- package/revalidate.d.ts +5 -0
- package/revalidate.js +5 -0
- package/seoBuildTags.d.ts +21 -0
- package/{Seo/helpers.js → seoBuildTags.js} +5 -3
- package/to.d.ts +24 -0
- package/to.js +25 -0
- package/{i18n/translationAsOptions/index.d.ts → translationAsOptions.d.ts} +1 -1
- package/{i18n/translationAsOptions/index.js → translationAsOptions.js} +0 -0
- package/{i18n/types.d.ts → types-i18n.d.ts} +6 -0
- package/{i18n/types.js → types-i18n.js} +0 -0
- package/types-seo.d.ts +7 -0
- package/types-seo.js +1 -0
- package/useBackUrl.d.ts +2 -0
- package/useBackUrl.js +27 -0
- package/{i18n/useDateFormat/index.d.ts → useDateFormat.d.ts} +0 -0
- package/{i18n/useDateFormat/index.js → useDateFormat.js} +0 -0
- package/{Forms/useForm.d.ts → useForm.d.ts} +1 -1
- package/{Forms/useForm.js → useForm.js} +0 -0
- package/{i18n/useLocale/index.d.ts → useLocale.d.ts} +0 -0
- package/{i18n/useLocale/index.js → useLocale.js} +0 -0
- package/{i18n/useT/index.d.ts → useT.d.ts} +1 -1
- package/{i18n/useT/index.js → useT.js} +0 -0
- package/{Theme/Theme.d.ts → useTheme.d.ts} +2 -13
- package/{Theme/Theme.js → useTheme.js} +1 -0
- package/useTo.d.ts +3 -0
- package/useTo.js +14 -0
- package/Analytics/index.d.ts +0 -1
- package/Analytics/index.js +0 -1
- package/Analytics/package.json +0 -6
- package/Auth/package.json +0 -6
- package/Favicon/index.d.ts +0 -1
- package/Favicon/index.js +0 -1
- package/Favicon/package.json +0 -6
- package/Forms/index.d.ts +0 -1
- package/Forms/index.js +0 -1
- package/Forms/package.json +0 -6
- package/Head/Head.d.ts +0 -1
- package/Head/Head.js +0 -1
- package/Head/index.d.ts +0 -1
- package/Head/index.js +0 -1
- package/Img/index.d.ts +0 -1
- package/Img/index.js +0 -1
- package/Img/package.json +0 -6
- package/Link/Link.d.ts +0 -9
- package/Link/index.d.ts +0 -1
- package/Link/index.js +0 -1
- package/Link/package.json +0 -6
- package/NextProgress/index.d.ts +0 -2
- package/NextProgress/index.js +0 -1
- package/NextProgress/package.json +0 -6
- package/Seo/Seo.d.ts +0 -3
- package/Seo/Seo.js +0 -8
- package/Seo/SeoDefaults.d.ts +0 -3
- package/Seo/helpers.d.ts +0 -48
- package/Seo/index.d.ts +0 -12
- package/Seo/index.js +0 -12
- package/Seo/package.json +0 -6
- package/Theme/index.d.ts +0 -1
- package/Theme/index.js +0 -1
- package/Theme/package.json +0 -6
- package/i18n/T/package.json +0 -6
- package/i18n/getT/package.json +0 -6
- package/i18n/index.d.ts +0 -7
- package/i18n/index.js +0 -7
- package/i18n/package.json +0 -6
- package/i18n/translationAsOptions/package.json +0 -6
- package/i18n/useDateFormat/package.json +0 -6
- package/i18n/useLocale/package.json +0 -6
- package/i18n/useT/package.json +0 -6
- package/node/Analytics/index.js +0 -4
- package/node/Favicon/index.js +0 -4
- package/node/Forms/index.js +0 -4
- package/node/Head/Head.js +0 -5
- package/node/Head/index.js +0 -4
- package/node/Img/index.js +0 -4
- package/node/Link/index.js +0 -4
- package/node/NextProgress/index.js +0 -5
- package/node/Seo/index.js +0 -15
- package/node/Theme/index.js +0 -4
- package/node/i18n/index.js +0 -10
- package/utils/package.json +0 -6
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DynamicNamespaces = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var DynamicNamespaces_1 = tslib_1.__importDefault(require("next-translate/DynamicNamespaces"));
|
|
6
|
+
/**
|
|
7
|
+
* **NOTE**: To make typescript work nicely here make sure to enable
|
|
8
|
+
* [`resolveJsonModule`](https://www.typescriptlang.org/tsconfig#resolveJsonModule)
|
|
9
|
+
* in your `tsconfig.json` file.
|
|
10
|
+
*/
|
|
11
|
+
exports.DynamicNamespaces = DynamicNamespaces_1.default;
|
|
12
|
+
exports.default = exports.DynamicNamespaces;
|
|
@@ -7,3 +7,4 @@ var head_1 = tslib_1.__importDefault(require("next/head"));
|
|
|
7
7
|
var react_1 = require("@koine/react");
|
|
8
8
|
var Favicon = function (props) { return ((0, jsx_runtime_1.jsx)(head_1.default, { children: (0, jsx_runtime_1.jsx)(react_1.FaviconTags, tslib_1.__assign({}, props)) })); };
|
|
9
9
|
exports.Favicon = Favicon;
|
|
10
|
+
exports.default = exports.Favicon;
|
package/node/Head.js
ADDED
|
@@ -12,3 +12,4 @@ exports.Link = (0, react_1.forwardRef)(function Link(_a, ref) {
|
|
|
12
12
|
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 = tslib_1.__rest(_a, ["href", "prefetch", "replace", "scroll", "shallow", "locale", "Link"]);
|
|
13
13
|
return ((0, jsx_runtime_1.jsx)(link_1.default, tslib_1.__assign({ href: href, replace: replace, scroll: scroll, shallow: shallow, locale: locale, passHref: true }, { children: (0, jsx_runtime_1.jsx)(Link, tslib_1.__assign({ ref: ref }, props)) })));
|
|
14
14
|
});
|
|
15
|
+
exports.default = exports.Link;
|
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getNextImgProps = exports.
|
|
3
|
+
exports.getNextImgProps = exports.NextImg = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
var react_1 = require("react");
|
|
7
5
|
var image_1 = tslib_1.__importDefault(require("next/image"));
|
|
8
6
|
exports.NextImg = image_1.default;
|
|
9
|
-
var NextImgSmart = function (props) {
|
|
10
|
-
var _a = (0, react_1.useState)(false), $loaded = _a[0], setLoaded = _a[1];
|
|
11
|
-
var _b = (0, react_1.useState)(false), $error = _b[0], setError = _b[1];
|
|
12
|
-
var _c = getNextImgProps(props), nextImgProps = _c.nextImgProps, restProps = _c.restProps;
|
|
13
|
-
var Wrap = restProps.Wrap;
|
|
14
|
-
return nextImgProps.priority ? ((0, jsx_runtime_1.jsx)(image_1.default, tslib_1.__assign({}, nextImgProps))) : ((0, jsx_runtime_1.jsx)(Wrap, tslib_1.__assign({}, restProps, { "$loaded": $loaded, "$error": $error }, { children: (0, jsx_runtime_1.jsx)(image_1.default, tslib_1.__assign({}, nextImgProps, { onLoadingComplete: function () { return setLoaded(true); }, onError: function () { return setError(true); } })) })));
|
|
15
|
-
};
|
|
16
|
-
exports.NextImgSmart = NextImgSmart;
|
|
17
7
|
function getNextImgProps(_a) {
|
|
18
8
|
var src = _a.src, alt = _a.alt, layout = _a.layout, blurDataURL = _a.blurDataURL, width = _a.width, height = _a.height, priority = _a.priority, objectFit = _a.objectFit, objectPosition = _a.objectPosition, restProps = tslib_1.__rest(_a, ["src", "alt", "layout", "blurDataURL", "width", "height", "priority", "objectFit", "objectPosition"]);
|
|
19
9
|
var nextImgProps = {
|
|
@@ -33,3 +23,4 @@ function getNextImgProps(_a) {
|
|
|
33
23
|
};
|
|
34
24
|
}
|
|
35
25
|
exports.getNextImgProps = getNextImgProps;
|
|
26
|
+
exports.default = exports.NextImg;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NextImgSmart = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
var react_1 = require("react");
|
|
7
|
+
var image_1 = tslib_1.__importDefault(require("next/image"));
|
|
8
|
+
var NextImg_1 = require("./NextImg");
|
|
9
|
+
var NextImgSmart = function (props) {
|
|
10
|
+
var _a = (0, react_1.useState)(false), $loaded = _a[0], setLoaded = _a[1];
|
|
11
|
+
var _b = (0, react_1.useState)(false), $error = _b[0], setError = _b[1];
|
|
12
|
+
var _c = (0, NextImg_1.getNextImgProps)(props), nextImgProps = _c.nextImgProps, restProps = _c.restProps;
|
|
13
|
+
var Wrap = restProps.Wrap;
|
|
14
|
+
return nextImgProps.priority ? ((0, jsx_runtime_1.jsx)(image_1.default, tslib_1.__assign({}, nextImgProps))) : ((0, jsx_runtime_1.jsx)(Wrap, tslib_1.__assign({}, restProps, { "$loaded": $loaded, "$error": $error }, { children: (0, jsx_runtime_1.jsx)(image_1.default, tslib_1.__assign({}, nextImgProps, { onLoadingComplete: function () { return setLoaded(true); }, onError: function () { return setError(true); } })) })));
|
|
15
|
+
};
|
|
16
|
+
exports.NextImgSmart = NextImgSmart;
|
|
17
|
+
exports.default = exports.NextImgSmart;
|
|
@@ -5,8 +5,16 @@ var tslib_1 = require("tslib");
|
|
|
5
5
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
var react_1 = require("react");
|
|
7
7
|
var head_1 = tslib_1.__importDefault(require("next/head"));
|
|
8
|
-
var
|
|
8
|
+
var seoBuildTags_1 = require("./seoBuildTags");
|
|
9
9
|
var _Seo = function (props) {
|
|
10
|
-
return (0, jsx_runtime_1.jsx)(head_1.default, { children: (0,
|
|
10
|
+
return (0, jsx_runtime_1.jsx)(head_1.default, { children: (0, seoBuildTags_1.seoBuildTags)(props) });
|
|
11
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* Adapted from [garmeeh/next-seo](https://github.com/garmeeh/next-seo)
|
|
14
|
+
*
|
|
15
|
+
* See also:
|
|
16
|
+
* - https://github.com/catnose99/next-head-seo
|
|
17
|
+
* - https://nextjs.org/docs/api-reference/next/head
|
|
18
|
+
*/
|
|
12
19
|
exports.Seo = (0, react_1.memo)(_Seo);
|
|
20
|
+
exports.default = exports.Seo;
|
|
@@ -7,10 +7,11 @@ var react_1 = require("react");
|
|
|
7
7
|
var head_1 = tslib_1.__importDefault(require("next/head"));
|
|
8
8
|
// import { useRouter } from "next/router";
|
|
9
9
|
// import { getSiteUrl } from "../utils";
|
|
10
|
-
var
|
|
10
|
+
var seoBuildTags_1 = require("./seoBuildTags");
|
|
11
11
|
var _SeoDefaults = function (props) {
|
|
12
12
|
// const router = useRouter();
|
|
13
13
|
// props.openGraph.url = getSiteUrl(router.asPath);
|
|
14
|
-
return (0, jsx_runtime_1.jsx)(head_1.default, { children: (0,
|
|
14
|
+
return (0, jsx_runtime_1.jsx)(head_1.default, { children: (0, seoBuildTags_1.seoBuildTags)(props) });
|
|
15
15
|
};
|
|
16
16
|
exports.SeoDefaults = (0, react_1.memo)(_SeoDefaults);
|
|
17
|
+
exports.default = exports.SeoDefaults;
|
|
File without changes
|
package/node/app/css/AppMain.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.AppMain = void 0;
|
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
var react_1 = tslib_1.__importDefault(require("react"));
|
|
7
|
-
var
|
|
7
|
+
var SeoDefaults_1 = require("../../SeoDefaults");
|
|
8
8
|
/**
|
|
9
9
|
* App main
|
|
10
10
|
*
|
|
@@ -12,6 +12,6 @@ var Seo_1 = require("../../Seo");
|
|
|
12
12
|
*/
|
|
13
13
|
var AppMain = function (_a) {
|
|
14
14
|
var Component = _a.Component, pageProps = _a.pageProps, Layout = _a.Layout, seo = _a.seo, pre = _a.pre, post = _a.post;
|
|
15
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(
|
|
15
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(SeoDefaults_1.SeoDefaults, tslib_1.__assign({}, seo)), pre, (0, jsx_runtime_1.jsx)(Layout, { children: (0, jsx_runtime_1.jsx)(Component, tslib_1.__assign({}, pageProps)) }), post] }));
|
|
16
16
|
};
|
|
17
17
|
exports.AppMain = AppMain;
|
package/node/app/css/AppTheme.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.AppTheme = void 0;
|
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
// import { ThemeVanillaProvider, ThemeVanillaValue } from "@koine/react";
|
|
7
|
-
var
|
|
7
|
+
var useTheme_1 = require("../../useTheme");
|
|
8
8
|
/**
|
|
9
9
|
* App theme with vanilla class based theme (good for `tailwindcss`)
|
|
10
10
|
*/
|
|
@@ -13,6 +13,6 @@ var AppTheme = function (_a) {
|
|
|
13
13
|
// return (
|
|
14
14
|
// <ThemeVanillaProvider initialTheme={theme}>{children}</ThemeVanillaProvider>
|
|
15
15
|
// );
|
|
16
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)(useTheme_1.ThemeProvider, tslib_1.__assign({ defaultTheme: theme, attribute: "class" }, { children: children })));
|
|
17
17
|
};
|
|
18
18
|
exports.AppTheme = AppTheme;
|
package/node/app/em/AppMain.js
CHANGED
|
@@ -7,7 +7,7 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
7
7
|
var router_1 = require("next/router");
|
|
8
8
|
var framer_motion_1 = require("framer-motion");
|
|
9
9
|
var m_1 = require("@koine/react/m");
|
|
10
|
-
var
|
|
10
|
+
var SeoDefaults_1 = require("../../SeoDefaults");
|
|
11
11
|
var NextProgress_1 = require("../../NextProgress");
|
|
12
12
|
/**
|
|
13
13
|
* App main
|
|
@@ -23,6 +23,6 @@ var AppMain = function (_a) {
|
|
|
23
23
|
exit: { opacity: 0 },
|
|
24
24
|
} : _b, pre = _a.pre, post = _a.post;
|
|
25
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)(
|
|
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
27
|
};
|
|
28
28
|
exports.AppMain = AppMain;
|
package/node/app/em/AppTheme.js
CHANGED
|
@@ -8,9 +8,9 @@ var react_1 = require("@emotion/react");
|
|
|
8
8
|
var CssBaseline_1 = tslib_1.__importDefault(require("@mui/material/CssBaseline"));
|
|
9
9
|
var react_2 = require("@emotion/react");
|
|
10
10
|
var sc_1 = require("@koine/react/sc");
|
|
11
|
-
var
|
|
11
|
+
var createEmotionCache_1 = require("../../createEmotionCache");
|
|
12
12
|
// client-side cache, shared for the whole session of the user in the browser.
|
|
13
|
-
var clientSideEmotionCache = (0,
|
|
13
|
+
var clientSideEmotionCache = (0, createEmotionCache_1.createEmotionCache)();
|
|
14
14
|
/**
|
|
15
15
|
* App theme with `emotion` (good for `@mui`)s
|
|
16
16
|
*/
|
package/node/app/sc/AppMain.js
CHANGED
|
@@ -7,7 +7,7 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
7
7
|
var router_1 = require("next/router");
|
|
8
8
|
var framer_motion_1 = require("framer-motion");
|
|
9
9
|
var m_1 = require("@koine/react/m");
|
|
10
|
-
var
|
|
10
|
+
var SeoDefaults_1 = require("../../SeoDefaults");
|
|
11
11
|
var NextProgress_1 = require("../../NextProgress");
|
|
12
12
|
/**
|
|
13
13
|
* App main
|
|
@@ -23,6 +23,6 @@ var AppMain = function (_a) {
|
|
|
23
23
|
exit: { opacity: 0 },
|
|
24
24
|
} : _b, pre = _a.pre, post = _a.post;
|
|
25
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)(
|
|
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
27
|
};
|
|
28
28
|
exports.AppMain = AppMain;
|
|
File without changes
|
|
File without changes
|
|
@@ -6,10 +6,10 @@ var react_1 = require("react");
|
|
|
6
6
|
var router_1 = require("next/router");
|
|
7
7
|
var react_2 = require("next-auth/react");
|
|
8
8
|
var utils_1 = require("@koine/utils");
|
|
9
|
-
var
|
|
9
|
+
var useT_1 = require("../useT");
|
|
10
10
|
var helpers_1 = require("./helpers");
|
|
11
11
|
function useLogin() {
|
|
12
|
-
var t = (0,
|
|
12
|
+
var t = (0, useT_1.useT)();
|
|
13
13
|
var push = (0, router_1.useRouter)().push;
|
|
14
14
|
var _a = (0, react_1.useState)(false), loading = _a[0], setLoading = _a[1];
|
|
15
15
|
var _b = (0, react_1.useState)(false), ok = _b[0], setOk = _b[1];
|
|
@@ -51,3 +51,4 @@ function useLogin() {
|
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
exports.useLogin = useLogin;
|
|
54
|
+
exports.default = useLogin;
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useLoginUrl = void 0;
|
|
4
4
|
var react_1 = require("react");
|
|
5
|
-
var
|
|
5
|
+
var useT_1 = require("../useT");
|
|
6
6
|
var helpers_1 = require("./helpers");
|
|
7
7
|
function useLoginUrl() {
|
|
8
8
|
var _a = (0, react_1.useState)(""), currentUrl = _a[0], setCurrentUrl = _a[1];
|
|
9
|
-
var t = (0,
|
|
9
|
+
var t = (0, useT_1.useT)();
|
|
10
10
|
(0, react_1.useEffect)(function () {
|
|
11
11
|
setCurrentUrl("?callbackUrl=".concat(window.location.href));
|
|
12
12
|
}, []);
|
|
13
13
|
return "".concat((0, helpers_1.getAuthRoutes)(t).login).concat(currentUrl);
|
|
14
14
|
}
|
|
15
15
|
exports.useLoginUrl = useLoginUrl;
|
|
16
|
+
exports.default = useLoginUrl;
|
|
@@ -5,10 +5,10 @@ var react_1 = require("react");
|
|
|
5
5
|
var router_1 = require("next/router");
|
|
6
6
|
var react_2 = require("next-auth/react");
|
|
7
7
|
var utils_1 = require("@koine/utils");
|
|
8
|
-
var
|
|
8
|
+
var useT_1 = require("../useT");
|
|
9
9
|
var helpers_1 = require("./helpers");
|
|
10
10
|
function useLogout() {
|
|
11
|
-
var t = (0,
|
|
11
|
+
var t = (0, useT_1.useT)();
|
|
12
12
|
var push = (0, router_1.useRouter)().push;
|
|
13
13
|
var _a = (0, react_1.useState)(false), loading = _a[0], setLoading = _a[1];
|
|
14
14
|
var _b = (0, react_1.useState)(false), ok = _b[0], setOk = _b[1];
|
|
@@ -54,3 +54,4 @@ function useLogout() {
|
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
exports.useLogout = useLogout;
|
|
57
|
+
exports.default = useLogout;
|
package/node/config/index.js
CHANGED
|
@@ -216,16 +216,10 @@ function withKoine(_a) {
|
|
|
216
216
|
// @see https://nextjs.org/docs/advanced-features/compiler#modularize-imports
|
|
217
217
|
modularizeImports: tslib_1.__assign(tslib_1.__assign({}, (((_b = custom === null || custom === void 0 ? void 0 : custom["experimental"]) === null || _b === void 0 ? void 0 : _b.modularizeImports) || {})), {
|
|
218
218
|
// FIXME: make these work with the right file/folder structure?
|
|
219
|
-
// "@koine/next/?(((\\w*)?/?)*)": {
|
|
220
|
-
// transform: "@koine/next/{{ matches.[1] }}/{{member}}",
|
|
221
|
-
// },
|
|
222
219
|
// "@koine/react/?(((\\w*)?/?)*)": {
|
|
223
220
|
// transform: "@koine/react/{{ matches.[1] }}/{{member}}",
|
|
224
221
|
// },
|
|
225
|
-
|
|
226
|
-
// transform: "@koine/utils/{{ matches.[1] }}/{{member}}",
|
|
227
|
-
// },
|
|
228
|
-
"@koine/utils": { transform: "@koine/utils/{{member}}" } }) }),
|
|
222
|
+
"@koine/next": { transform: "@koine/next/{{member}}" }, "@koine/utils": { transform: "@koine/utils/{{member}}" } }) }),
|
|
229
223
|
// @see https://github.com/vercel/next.js/issues/7322#issuecomment-887330111
|
|
230
224
|
reactStrictMode: true }, custom);
|
|
231
225
|
if (svg) {
|
|
@@ -6,7 +6,7 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
6
6
|
var document_1 = tslib_1.__importStar(require("next/document"));
|
|
7
7
|
var react_1 = require("@koine/react");
|
|
8
8
|
var create_instance_1 = tslib_1.__importDefault(require("@emotion/server/create-instance"));
|
|
9
|
-
var
|
|
9
|
+
var createEmotionCache_1 = require("../../createEmotionCache");
|
|
10
10
|
/**
|
|
11
11
|
* Next Document wrapper for `emotion` based projects
|
|
12
12
|
*
|
|
@@ -37,7 +37,7 @@ Document.getInitialProps = function (ctx) { return tslib_1.__awaiter(void 0, voi
|
|
|
37
37
|
switch (_a.label) {
|
|
38
38
|
case 0:
|
|
39
39
|
originalRenderPage = ctx.renderPage;
|
|
40
|
-
cache = (0,
|
|
40
|
+
cache = (0, createEmotionCache_1.createEmotionCache)();
|
|
41
41
|
extractCriticalToChunks = (0, create_instance_1.default)(cache).extractCriticalToChunks;
|
|
42
42
|
ctx.renderPage = function () {
|
|
43
43
|
return originalRenderPage({
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSiteUrl = void 0;
|
|
4
|
+
var utils_1 = require("@koine/utils");
|
|
5
|
+
/**
|
|
6
|
+
* Get site absolute url with the given path
|
|
7
|
+
*
|
|
8
|
+
* - It uses the `NEXT_PUBLIC_APP_URL` env variable
|
|
9
|
+
* - It removes the trailing slashes
|
|
10
|
+
*/
|
|
11
|
+
function getSiteUrl(path) {
|
|
12
|
+
if (path === void 0) { path = ""; }
|
|
13
|
+
return (0, utils_1.normaliseUrl)("".concat(process.env["NEXT_PUBLIC_APP_URL"], "/").concat(path));
|
|
14
|
+
}
|
|
15
|
+
exports.getSiteUrl = getSiteUrl;
|
|
16
|
+
exports.default = getSiteUrl;
|
package/node/index.js
CHANGED
|
@@ -1,15 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./
|
|
5
|
-
|
|
4
|
+
tslib_1.__exportStar(require("./AnalyticsGoogle"), exports);
|
|
5
|
+
// export * from "./createEmotionCache";
|
|
6
|
+
tslib_1.__exportStar(require("./DynamicNamespaces"), exports);
|
|
6
7
|
tslib_1.__exportStar(require("./Favicon"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./
|
|
8
|
+
tslib_1.__exportStar(require("./getSiteUrl"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./getT"), exports);
|
|
8
10
|
tslib_1.__exportStar(require("./Head"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./i18n"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./Img"), exports);
|
|
11
11
|
tslib_1.__exportStar(require("./Link"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./load"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./NextImg"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./NextImgSmart"), exports);
|
|
12
15
|
tslib_1.__exportStar(require("./NextProgress"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./revalidate"), exports);
|
|
13
17
|
tslib_1.__exportStar(require("./Seo"), exports);
|
|
14
|
-
|
|
15
|
-
tslib_1.__exportStar(require("./
|
|
18
|
+
// export * from "./seoBuildTags";
|
|
19
|
+
tslib_1.__exportStar(require("./SeoDefaults"), exports);
|
|
20
|
+
tslib_1.__exportStar(require("./T"), exports);
|
|
21
|
+
tslib_1.__exportStar(require("./to"), exports);
|
|
22
|
+
tslib_1.__exportStar(require("./translationAsOptions"), exports);
|
|
23
|
+
tslib_1.__exportStar(require("./types-i18n"), exports);
|
|
24
|
+
tslib_1.__exportStar(require("./types-seo"), exports);
|
|
25
|
+
tslib_1.__exportStar(require("./useBackUrl"), exports);
|
|
26
|
+
tslib_1.__exportStar(require("./useDateFormat"), exports);
|
|
27
|
+
tslib_1.__exportStar(require("./useForm"), exports);
|
|
28
|
+
tslib_1.__exportStar(require("./useLocale"), exports);
|
|
29
|
+
tslib_1.__exportStar(require("./useT"), exports);
|
|
30
|
+
tslib_1.__exportStar(require("./useTheme"), exports);
|
|
31
|
+
tslib_1.__exportStar(require("./useTo"), exports);
|
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.load =
|
|
4
|
-
var utils_1 = require("@koine/utils");
|
|
5
|
-
exports.ONE_HOUR = 3600;
|
|
6
|
-
exports.ONE_DAY = 84000;
|
|
7
|
-
/**
|
|
8
|
-
* Get site absolute url with the given path
|
|
9
|
-
*
|
|
10
|
-
* - It uses the `NEXT_PUBLIC_APP_URL` env variable
|
|
11
|
-
* - It removes the trailing slashes
|
|
12
|
-
*/
|
|
13
|
-
function getSiteUrl(path) {
|
|
14
|
-
if (path === void 0) { path = ""; }
|
|
15
|
-
return (0, utils_1.normaliseUrl)("".concat(process.env["NEXT_PUBLIC_APP_URL"], "/").concat(path));
|
|
16
|
-
}
|
|
17
|
-
exports.getSiteUrl = getSiteUrl;
|
|
3
|
+
exports.load = void 0;
|
|
18
4
|
/**
|
|
19
5
|
* Utility to load a component with an optional pre-determined delay.
|
|
20
6
|
*
|
|
@@ -29,3 +15,4 @@ function load(component, milliseconds) {
|
|
|
29
15
|
});
|
|
30
16
|
}
|
|
31
17
|
exports.load = load;
|
|
18
|
+
exports.default = load;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.seoBuildTags = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
var utils_1 = require("@koine/utils");
|
|
@@ -8,12 +8,13 @@ var defaults = {
|
|
|
8
8
|
tplTitle: "",
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Comparing to `next-seo` we do a couple of things in addition while many
|
|
12
|
+
* others are removed.
|
|
12
13
|
*
|
|
13
14
|
* - Add `seo` meta object coming from a CMS probably
|
|
14
15
|
* - Add `ogimage` and `openGraph.image` as single image source
|
|
15
16
|
* - Add `og` alias to define `openGraph`
|
|
16
|
-
* - Add check for `title`
|
|
17
|
+
* - Add check for `title` equal to `templateTitle` to avoid meta titles like
|
|
17
18
|
* "My site | My site" often happening in homepages
|
|
18
19
|
* - Remove the open graph videos and images
|
|
19
20
|
*
|
|
@@ -21,7 +22,7 @@ var defaults = {
|
|
|
21
22
|
*
|
|
22
23
|
* @returns
|
|
23
24
|
*/
|
|
24
|
-
var
|
|
25
|
+
var seoBuildTags = function (_a) {
|
|
25
26
|
var _b = _a === void 0 ? {} : _a, seo = _b.seo, hidden = _b.hidden, keywords = _b.keywords, _c = _b.title, title = _c === void 0 ? "" : _c, titleTemplate = _b.titleTemplate, defaultTitle = _b.defaultTitle, noindex = _b.noindex, nofollow = _b.nofollow, description = _b.description, _d = _b.languageAlternates, languageAlternates = _d === void 0 ? [] : _d, twitter = _b.twitter, facebook = _b.facebook, openGraph = _b.openGraph, ogAlias = _b.og, canonical = _b.canonical, metaTags = _b.metaTags, linkTags = _b.linkTags;
|
|
26
27
|
var render = [];
|
|
27
28
|
var $names = {};
|
|
@@ -116,4 +117,5 @@ var buildTags = function (_a) {
|
|
|
116
117
|
// <link rel="alternate" hreflang="en" href="https://www.domain.com/en/">
|
|
117
118
|
return render;
|
|
118
119
|
};
|
|
119
|
-
exports.
|
|
120
|
+
exports.seoBuildTags = seoBuildTags;
|
|
121
|
+
exports.default = exports.seoBuildTags;
|
package/node/to.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.to = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* `To` named route utility. It accept either a single argument if that is a static
|
|
6
|
+
* route name or a second argument that interpolates the dynamic portions of
|
|
7
|
+
* the route name. The types of these portions are automatically inferred.
|
|
8
|
+
*
|
|
9
|
+
* @borrows [awesome-template-literal-types](https://github.com/ghoullier/awesome-template-literal-types)
|
|
10
|
+
*/
|
|
11
|
+
function to() {
|
|
12
|
+
var args = [];
|
|
13
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
14
|
+
args[_i] = arguments[_i];
|
|
15
|
+
}
|
|
16
|
+
var relative = "";
|
|
17
|
+
var t = args[0];
|
|
18
|
+
if (args.length === 3) {
|
|
19
|
+
if (args[2]) {
|
|
20
|
+
relative = t(args[1], args[2]);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
else if (args.length === 2) {
|
|
24
|
+
relative = t(args[1]);
|
|
25
|
+
}
|
|
26
|
+
return relative;
|
|
27
|
+
}
|
|
28
|
+
exports.to = to;
|
|
29
|
+
exports.default = to;
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useBackUrl = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var router_1 = require("next/router");
|
|
6
|
+
var utils_1 = require("@koine/utils");
|
|
7
|
+
var back = (0, utils_1.createStorage)({
|
|
8
|
+
lastUrl: "",
|
|
9
|
+
});
|
|
10
|
+
function useBackUrl() {
|
|
11
|
+
var asPath = (0, router_1.useRouter)().asPath;
|
|
12
|
+
var calledOnce = (0, react_1.useRef)(false);
|
|
13
|
+
var _a = (0, react_1.useState)(), backUrl = _a[0], setBackUrl = _a[1];
|
|
14
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
15
|
+
(0, react_1.useEffect)(function () {
|
|
16
|
+
if (calledOnce.current) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
var prevLastUrl = back.get("lastUrl");
|
|
20
|
+
// console.log("useBackUrl: prevLastUrl", prevLastUrl);
|
|
21
|
+
// first set it to use on a link, set to undefined if the previous URL
|
|
22
|
+
// is the same as the current one
|
|
23
|
+
setBackUrl(asPath === prevLastUrl || !prevLastUrl ? undefined : prevLastUrl);
|
|
24
|
+
// then update the local storage
|
|
25
|
+
back.set("lastUrl", asPath);
|
|
26
|
+
calledOnce.current = true;
|
|
27
|
+
});
|
|
28
|
+
return backUrl;
|
|
29
|
+
}
|
|
30
|
+
exports.useBackUrl = useBackUrl;
|
|
31
|
+
exports.default = useBackUrl;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/node/useTo.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useTo = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var useT_1 = require("./useT");
|
|
6
|
+
var to_1 = require("./to");
|
|
7
|
+
function useTo() {
|
|
8
|
+
var t = (0, useT_1.useT)("~");
|
|
9
|
+
return function () {
|
|
10
|
+
var args = [];
|
|
11
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
12
|
+
args[_i] = arguments[_i];
|
|
13
|
+
}
|
|
14
|
+
return to_1.to.apply(void 0, tslib_1.__spreadArray([t], args, false));
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
exports.useTo = useTo;
|
|
18
|
+
exports.default = useTo;
|
package/package.json
CHANGED
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"react": "^16.8 || ^17 || ^18",
|
|
20
20
|
"next": "^12.2.0",
|
|
21
|
-
"@koine/utils": "1.0.
|
|
21
|
+
"@koine/utils": "1.0.46",
|
|
22
22
|
"framer-motion": "^6.3.16",
|
|
23
|
-
"@koine/react": "1.0.
|
|
23
|
+
"@koine/react": "1.0.46",
|
|
24
24
|
"styled-components": "^5.3.5",
|
|
25
25
|
"@mui/base": "^5.0.0-alpha.87",
|
|
26
26
|
"react-icons": "^4.4.0",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"@mui/material": "^5.8.6",
|
|
38
38
|
"@emotion/react": "^11.9.3",
|
|
39
39
|
"@emotion/server": "^11.4.0",
|
|
40
|
-
"@hookform/resolvers": "^2.9.3",
|
|
41
40
|
"next-translate": "^1.4.0",
|
|
42
|
-
"next-seo": "^5.4.0"
|
|
41
|
+
"next-seo": "^5.4.0",
|
|
42
|
+
"@hookform/resolvers": "^2.9.3"
|
|
43
43
|
},
|
|
44
|
-
"version": "1.0.
|
|
44
|
+
"version": "1.0.46",
|
|
45
45
|
"module": "./index.js",
|
|
46
46
|
"types": "./index.d.ts"
|
|
47
47
|
}
|
package/revalidate.d.ts
ADDED
package/revalidate.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { SeoProps } from "./Seo";
|
|
3
|
+
import type { SeoDefaultsProps } from "./SeoDefaults";
|
|
4
|
+
declare type BuildTagsParams = SeoProps & SeoDefaultsProps;
|
|
5
|
+
/**
|
|
6
|
+
* Comparing to `next-seo` we do a couple of things in addition while many
|
|
7
|
+
* others are removed.
|
|
8
|
+
*
|
|
9
|
+
* - Add `seo` meta object coming from a CMS probably
|
|
10
|
+
* - Add `ogimage` and `openGraph.image` as single image source
|
|
11
|
+
* - Add `og` alias to define `openGraph`
|
|
12
|
+
* - Add check for `title` equal to `templateTitle` to avoid meta titles like
|
|
13
|
+
* "My site | My site" often happening in homepages
|
|
14
|
+
* - Remove the open graph videos and images
|
|
15
|
+
*
|
|
16
|
+
* - Shorter code
|
|
17
|
+
*
|
|
18
|
+
* @returns
|
|
19
|
+
*/
|
|
20
|
+
export declare const seoBuildTags: ({ seo, hidden, keywords, title, titleTemplate, defaultTitle, noindex, nofollow, description, languageAlternates, twitter, facebook, openGraph, og: ogAlias, canonical, metaTags, linkTags, }?: BuildTagsParams) => React.ReactNode[];
|
|
21
|
+
export default seoBuildTags;
|