@koine/next 2.0.0-beta.21 → 2.0.0-beta.210

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.
Files changed (122) hide show
  1. package/README.md +1 -0
  2. package/ThemeContext.cjs.default.js +1 -0
  3. package/ThemeContext.cjs.js +10 -0
  4. package/ThemeContext.cjs.mjs +2 -0
  5. package/ThemeContext.d.ts +6 -1
  6. package/ThemeContext.esm.js +5 -0
  7. package/ThemeProvider.cjs.default.js +1 -0
  8. package/ThemeProvider.cjs.js +14 -0
  9. package/ThemeProvider.cjs.mjs +2 -0
  10. package/ThemeProvider.d.ts +18 -1
  11. package/ThemeProvider.esm.js +9 -0
  12. package/config.cjs.default.js +1 -0
  13. package/config.cjs.js +9 -0
  14. package/config.cjs.mjs +2 -0
  15. package/config.d.ts +42 -107
  16. package/config.esm.js +7 -0
  17. package/index.cjs.default.js +1 -0
  18. package/index.cjs.js +13 -0
  19. package/index.cjs.mjs +2 -0
  20. package/index.d.ts +4 -5
  21. package/index.esm.js +4 -0
  22. package/load.cjs.default.js +1 -0
  23. package/load.cjs.js +8 -0
  24. package/load.cjs.mjs +2 -0
  25. package/load.d.ts +8 -0
  26. package/load.esm.js +3 -0
  27. package/package.json +43 -206
  28. package/typings.d.ts +39 -50
  29. package/useTheme.cjs.default.js +1 -0
  30. package/useTheme.cjs.js +11 -0
  31. package/useTheme.cjs.mjs +2 -0
  32. package/useTheme.d.ts +4 -1
  33. package/useTheme.esm.js +6 -0
  34. package/vite.config.d.ts +2 -0
  35. package/12/AnalyticsGoogle.d.ts +0 -5
  36. package/12/AnalyticsGoogle.js +0 -33
  37. package/12/DisableErrorOverlay.d.ts +0 -2
  38. package/12/DisableErrorOverlay.js +0 -8
  39. package/12/DynamicNamespaces.d.ts +0 -8
  40. package/12/DynamicNamespaces.js +0 -4
  41. package/12/Favicon.d.ts +0 -4
  42. package/12/Favicon.js +0 -6
  43. package/12/Link.d.ts +0 -7
  44. package/12/Link.js +0 -9
  45. package/12/NextProgress.d.ts +0 -22
  46. package/12/NextProgress.js +0 -40
  47. package/12/Seo.d.ts +0 -17
  48. package/12/Seo.js +0 -7
  49. package/12/SeoDefaults.d.ts +0 -8
  50. package/12/SeoDefaults.js +0 -7
  51. package/12/T.d.ts +0 -10
  52. package/12/T.js +0 -8
  53. package/12/TransText.d.ts +0 -3
  54. package/12/TransText.js +0 -4
  55. package/12/app/AppHead.d.ts +0 -3
  56. package/12/app/AppHead.js +0 -6
  57. package/12/app/AppMain.d.ts +0 -17
  58. package/12/app/AppMain.js +0 -1
  59. package/12/app/css/AppMain.d.ts +0 -4
  60. package/12/app/css/AppMain.js +0 -9
  61. package/12/app/css/AppTheme.d.ts +0 -8
  62. package/12/app/css/AppTheme.js +0 -7
  63. package/12/app/css/auth/index.d.ts +0 -8
  64. package/12/app/css/auth/index.js +0 -10
  65. package/12/app/css/index.d.ts +0 -6
  66. package/12/app/css/index.js +0 -9
  67. package/12/app/index.d.ts +0 -2
  68. package/12/app/index.js +0 -2
  69. package/12/app/sc/AppMain.d.ts +0 -4
  70. package/12/app/sc/AppMain.js +0 -18
  71. package/12/app/sc/AppTheme.d.ts +0 -8
  72. package/12/app/sc/AppTheme.js +0 -8
  73. package/12/app/sc/auth/index.d.ts +0 -8
  74. package/12/app/sc/auth/index.js +0 -10
  75. package/12/app/sc/index.d.ts +0 -6
  76. package/12/app/sc/index.js +0 -9
  77. package/12/document/Document.d.ts +0 -5
  78. package/12/document/Document.js +0 -18
  79. package/12/document/css/index.d.ts +0 -5
  80. package/12/document/css/index.js +0 -18
  81. package/12/document/index.d.ts +0 -2
  82. package/12/document/index.js +0 -2
  83. package/12/document/sc/index.d.ts +0 -6
  84. package/12/document/sc/index.js +0 -50
  85. package/12/getT.d.ts +0 -4
  86. package/12/getT.js +0 -4
  87. package/12/index.d.ts +0 -3
  88. package/12/index.js +0 -3
  89. package/12/seoBuildTags.d.ts +0 -8
  90. package/12/seoBuildTags.js +0 -93
  91. package/12/to.d.ts +0 -14
  92. package/12/to.js +0 -19
  93. package/12/translationAsOptions.d.ts +0 -4
  94. package/12/translationAsOptions.js +0 -10
  95. package/12/types-i18n.d.ts +0 -31
  96. package/12/types-i18n.js +0 -1
  97. package/12/types-seo.d.ts +0 -7
  98. package/12/types-seo.js +0 -1
  99. package/12/types.d.ts +0 -7
  100. package/12/types.js +0 -2
  101. package/12/useBackUrl.d.ts +0 -2
  102. package/12/useBackUrl.js +0 -24
  103. package/12/useDateFormat.d.ts +0 -3
  104. package/12/useDateFormat.js +0 -35
  105. package/12/useForm.d.ts +0 -27
  106. package/12/useForm.js +0 -15
  107. package/12/useLocale.d.ts +0 -2
  108. package/12/useLocale.js +0 -6
  109. package/12/useT.d.ts +0 -4
  110. package/12/useT.js +0 -17
  111. package/12/useTo.d.ts +0 -3
  112. package/12/useTo.js +0 -15
  113. package/ThemeContext.js +0 -6
  114. package/ThemeProvider.js +0 -204
  115. package/config-i18n.d.ts +0 -52
  116. package/config-i18n.js +0 -251
  117. package/config.js +0 -118
  118. package/getSiteUrl.d.ts +0 -2
  119. package/getSiteUrl.js +0 -6
  120. package/index.js +0 -5
  121. package/load.js +0 -6
  122. package/useTheme.js +0 -5
@@ -1,3 +0,0 @@
1
- export type AppHeadProps = unknown;
2
- export declare const AppHead: () => import("react/jsx-runtime").JSX.Element;
3
- export default AppHead;
package/12/app/AppHead.js DELETED
@@ -1,6 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import Head from "next/head";
3
- export var AppHead = function () {
4
- return (_jsx(Head, { children: _jsx("meta", { name: "viewport", content: "width=device-width" }) }));
5
- };
6
- export default AppHead;
@@ -1,17 +0,0 @@
1
- import type { HTMLMotionProps } from "framer-motion";
2
- import type { AppProps as NextAppProps } from "next/app";
3
- import React from "react";
4
- import type { MotionProviderFeatures } from "@koine/react/m";
5
- import type { NextProgressProps } from "../NextProgress.js";
6
- import type { SeoDefaultsProps } from "../SeoDefaults.js";
7
- export type AppMainBaseProps = NextAppProps & {
8
- Layout: React.FC<Record<string, unknown>>;
9
- ProgressOverlay?: NextProgressProps["Overlay"];
10
- seo?: SeoDefaultsProps;
11
- pre?: React.ReactNode;
12
- post?: React.ReactNode;
13
- };
14
- export type AppMainFramerProps = {
15
- motion: MotionProviderFeatures;
16
- transition?: Omit<HTMLMotionProps<"div">, "key">;
17
- };
package/12/app/AppMain.js DELETED
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- import type { AppMainBaseProps } from "../AppMain.js";
2
- export type AppMainProps = Omit<AppMainBaseProps, "ProgressOverlay">;
3
- export declare const AppMain: ({ Component, pageProps, Layout, seo, pre, post, }: AppMainProps) => import("react/jsx-runtime").JSX.Element;
4
- export default AppMain;
@@ -1,9 +0,0 @@
1
- import { __assign } from "tslib";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import React from "react";
4
- import { SeoDefaults } from "../../SeoDefaults.js";
5
- export var AppMain = function (_a) {
6
- var Component = _a.Component, pageProps = _a.pageProps, Layout = _a.Layout, seo = _a.seo, pre = _a.pre, post = _a.post;
7
- return (_jsxs(React.Fragment, { children: [_jsx(SeoDefaults, __assign({}, seo)), pre, _jsx(Layout, { children: _jsx(Component, __assign({}, pageProps)) }), post] }));
8
- };
9
- export default AppMain;
@@ -1,8 +0,0 @@
1
- import { type AppProps as NextAppProps } from "next/app";
2
- import React from "react";
3
- import { type ThemeProviderProps } from "../../../ThemeProvider.js";
4
- export type AppThemeProps = React.PropsWithChildren<NextAppProps & {
5
- theme: ThemeProviderProps["defaultTheme"];
6
- }>;
7
- export declare const AppTheme: ({ theme, children }: AppThemeProps) => import("react/jsx-runtime").JSX.Element;
8
- export default AppTheme;
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { ThemeProvider } from "../../../ThemeProvider.js";
3
- export var AppTheme = function (_a) {
4
- var theme = _a.theme, children = _a.children;
5
- return (_jsx(ThemeProvider, { defaultTheme: theme, attribute: "class", children: children }));
6
- };
7
- export default AppTheme;
@@ -1,8 +0,0 @@
1
- import type { AppProps } from "next/app";
2
- import { type AppMainProps } from "../AppMain.js";
3
- import { type AppThemeProps } from "../AppTheme.js";
4
- export type NextAppProps = AppProps<{
5
- session: any;
6
- }> & AppThemeProps & AppMainProps;
7
- export declare const NextApp: (props: NextAppProps) => import("react/jsx-runtime").JSX.Element;
8
- export default NextApp;
@@ -1,10 +0,0 @@
1
- import { __assign } from "tslib";
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { SessionProvider } from "next-auth/react";
4
- import { AppHead } from "../../AppHead.js";
5
- import { AppMain } from "../AppMain.js";
6
- import { AppTheme } from "../AppTheme.js";
7
- export var NextApp = function (props) {
8
- return (_jsxs(_Fragment, { children: [_jsx(AppHead, {}), _jsx(SessionProvider, { session: props.pageProps.session, children: _jsx(AppTheme, __assign({}, props, { children: _jsx(AppMain, __assign({}, props)) })) })] }));
9
- };
10
- export default NextApp;
@@ -1,6 +0,0 @@
1
- import { AppProps } from "next/app";
2
- import { type AppMainProps } from "./AppMain.js";
3
- import { type AppThemeProps } from "./AppTheme.js";
4
- export type NextAppProps = AppProps & AppThemeProps & AppMainProps;
5
- export declare const NextApp: (props: NextAppProps) => import("react/jsx-runtime").JSX.Element;
6
- export default NextApp;
@@ -1,9 +0,0 @@
1
- import { __assign } from "tslib";
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { AppHead } from "../AppHead.js";
4
- import { AppMain } from "./AppMain.js";
5
- import { AppTheme } from "./AppTheme.js";
6
- export var NextApp = function (props) {
7
- return (_jsxs(_Fragment, { children: [_jsx(AppHead, {}), _jsx(AppTheme, __assign({}, props, { children: _jsx(AppMain, __assign({}, props)) }))] }));
8
- };
9
- export default NextApp;
package/12/app/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from "./AppHead.js";
2
- export * from "./AppMain.js";
package/12/app/index.js DELETED
@@ -1,2 +0,0 @@
1
- export * from "./AppHead.js";
2
- export * from "./AppMain.js";
@@ -1,4 +0,0 @@
1
- import type { AppMainBaseProps, AppMainFramerProps } from "../AppMain.js";
2
- export type AppMainProps = AppMainBaseProps & AppMainFramerProps;
3
- export declare const AppMain: ({ Component, pageProps, Layout, ProgressOverlay, seo, motion, transition, pre, post, }: AppMainProps) => import("react/jsx-runtime").JSX.Element;
4
- export default AppMain;
@@ -1,18 +0,0 @@
1
- import { __assign } from "tslib";
2
- import { createElement as _createElement } from "react";
3
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
4
- import { AnimatePresence, m } from "framer-motion";
5
- import { useRouter } from "next/router";
6
- import { MotionProvider } from "@koine/react/m";
7
- import { NextProgress } from "../../NextProgress.js";
8
- import { SeoDefaults } from "../../SeoDefaults.js";
9
- export var AppMain = function (_a) {
10
- var Component = _a.Component, pageProps = _a.pageProps, Layout = _a.Layout, ProgressOverlay = _a.ProgressOverlay, seo = _a.seo, motion = _a.motion, _b = _a.transition, transition = _b === void 0 ? {
11
- initial: { opacity: 0 },
12
- animate: { opacity: 1 },
13
- exit: { opacity: 0 },
14
- } : _b, pre = _a.pre, post = _a.post;
15
- var pathname = useRouter().pathname;
16
- return (_jsxs(_Fragment, { children: [_jsx(SeoDefaults, __assign({}, seo)), pre, _jsxs(MotionProvider, { features: motion, children: [ProgressOverlay && _jsx(NextProgress, { Overlay: ProgressOverlay }), _jsx(Layout, { children: _jsx(AnimatePresence, { exitBeforeEnter: true, initial: false, children: _jsx(m.div, __assign({}, transition, { children: _createElement(Component, __assign({}, pageProps, { key: pathname })) }), pathname) }) })] }), post] }));
17
- };
18
- export default AppMain;
@@ -1,8 +0,0 @@
1
- import { type AppProps as NextAppProps } from "next/app";
2
- import React from "react";
3
- import { Theme } from "@koine/react/sc";
4
- export type AppThemeProps = React.PropsWithChildren<NextAppProps & {
5
- theme: Theme;
6
- }>;
7
- export declare const AppTheme: ({ theme, children }: AppThemeProps) => import("react/jsx-runtime").JSX.Element;
8
- export default AppTheme;
@@ -1,8 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { ThemeProvider } from "styled-components";
3
- import { StylesGlobal } from "@koine/react/sc";
4
- export var AppTheme = function (_a) {
5
- var theme = _a.theme, children = _a.children;
6
- return (_jsxs(ThemeProvider, { theme: theme, children: [_jsx(StylesGlobal, {}), children] }));
7
- };
8
- export default AppTheme;
@@ -1,8 +0,0 @@
1
- import type { AppProps } from "next/app";
2
- import { type AppMainProps } from "../AppMain.js";
3
- import { type AppThemeProps } from "../AppTheme.js";
4
- export type NextAppProps = AppProps<{
5
- session: any;
6
- }> & AppThemeProps & AppMainProps;
7
- export declare const NextApp: (props: NextAppProps) => import("react/jsx-runtime").JSX.Element;
8
- export default NextApp;
@@ -1,10 +0,0 @@
1
- import { __assign } from "tslib";
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { SessionProvider } from "next-auth/react";
4
- import { AppHead } from "../../AppHead.js";
5
- import { AppMain } from "../AppMain.js";
6
- import { AppTheme } from "../AppTheme.js";
7
- export var NextApp = function (props) {
8
- return (_jsxs(_Fragment, { children: [_jsx(AppHead, {}), _jsx(SessionProvider, { session: props.pageProps.session, children: _jsx(AppTheme, __assign({}, props, { children: _jsx(AppMain, __assign({}, props)) })) })] }));
9
- };
10
- export default NextApp;
@@ -1,6 +0,0 @@
1
- import type { AppProps } from "next/app";
2
- import { type AppMainProps } from "./AppMain.js";
3
- import { type AppThemeProps } from "./AppTheme.js";
4
- export type NextAppProps = AppProps & AppThemeProps & AppMainProps;
5
- export declare const NextApp: (props: NextAppProps) => import("react/jsx-runtime").JSX.Element;
6
- export default NextApp;
@@ -1,9 +0,0 @@
1
- import { __assign } from "tslib";
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { AppHead } from "../AppHead.js";
4
- import { AppMain } from "./AppMain.js";
5
- import { AppTheme } from "./AppTheme.js";
6
- export var NextApp = function (props) {
7
- return (_jsxs(_Fragment, { children: [_jsx(AppHead, {}), _jsx(AppTheme, __assign({}, props, { children: _jsx(AppMain, __assign({}, props)) }))] }));
8
- };
9
- export default NextApp;
@@ -1,5 +0,0 @@
1
- import NextDocument from "next/document";
2
- export declare class Document extends NextDocument {
3
- render(): import("react/jsx-runtime").JSX.Element;
4
- }
5
- export default Document;
@@ -1,18 +0,0 @@
1
- import { __extends } from "tslib";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import NextDocument, { Head, Html, Main, NextScript } from "next/document";
4
- import Meta from "@koine/react/Meta";
5
- import NoJs from "@koine/react/NoJs";
6
- var Document = (function (_super) {
7
- __extends(Document, _super);
8
- function Document() {
9
- return _super !== null && _super.apply(this, arguments) || this;
10
- }
11
- Document.prototype.render = function () {
12
- var _a = this.props.__NEXT_DATA__, locale = _a.locale, defaultLocale = _a.defaultLocale;
13
- return (_jsxs(Html, { lang: locale || defaultLocale, className: "no-js", children: [_jsxs(Head, { children: [_jsx(Meta, {}), _jsx(NoJs, {})] }), _jsxs("body", { children: [_jsx(Main, {}), _jsx(NextScript, {})] })] }));
14
- };
15
- return Document;
16
- }(NextDocument));
17
- export { Document };
18
- export default Document;
@@ -1,5 +0,0 @@
1
- import NextDocument from "next/document";
2
- export declare class Document extends NextDocument {
3
- render(): import("react/jsx-runtime").JSX.Element;
4
- }
5
- export default Document;
@@ -1,18 +0,0 @@
1
- import { __extends } from "tslib";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import NextDocument, { Head, Html, Main, NextScript, } from "next/document";
4
- import Meta from "@koine/react/Meta";
5
- import NoJs from "@koine/react/NoJs";
6
- var Document = (function (_super) {
7
- __extends(Document, _super);
8
- function Document() {
9
- return _super !== null && _super.apply(this, arguments) || this;
10
- }
11
- Document.prototype.render = function () {
12
- var _a = this.props.__NEXT_DATA__, locale = _a.locale, defaultLocale = _a.defaultLocale;
13
- return (_jsxs(Html, { lang: locale || defaultLocale, className: "no-js", children: [_jsxs(Head, { children: [_jsx(Meta, {}), _jsx(NoJs, {})] }), _jsxs("body", { children: [_jsx(Main, {}), _jsx(NextScript, {})] })] }));
14
- };
15
- return Document;
16
- }(NextDocument));
17
- export { Document };
18
- export default Document;
@@ -1,2 +0,0 @@
1
- export { Document } from "./Document.js";
2
- export { Document as default } from "./Document.js";
@@ -1,2 +0,0 @@
1
- export { Document } from "./Document.js";
2
- export { Document as default } from "./Document.js";
@@ -1,6 +0,0 @@
1
- import NextDocument, { DocumentContext, type DocumentInitialProps } from "next/document";
2
- export declare class Document extends NextDocument {
3
- static getInitialProps(ctx: DocumentContext): Promise<DocumentInitialProps>;
4
- render(): import("react/jsx-runtime").JSX.Element;
5
- }
6
- export default Document;
@@ -1,50 +0,0 @@
1
- import { __assign, __awaiter, __extends, __generator } from "tslib";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import NextDocument, { Head, Html, Main, NextScript, } from "next/document";
4
- import React from "react";
5
- import { ServerStyleSheet } from "styled-components";
6
- import Meta from "@koine/react/Meta";
7
- import NoJs from "@koine/react/NoJs";
8
- var Document = (function (_super) {
9
- __extends(Document, _super);
10
- function Document() {
11
- return _super !== null && _super.apply(this, arguments) || this;
12
- }
13
- Document.getInitialProps = function (ctx) {
14
- return __awaiter(this, void 0, void 0, function () {
15
- var sheet, originalRenderPage, initialProps;
16
- return __generator(this, function (_a) {
17
- switch (_a.label) {
18
- case 0:
19
- sheet = new ServerStyleSheet();
20
- originalRenderPage = ctx.renderPage;
21
- _a.label = 1;
22
- case 1:
23
- _a.trys.push([1, , 3, 4]);
24
- ctx.renderPage = function () {
25
- return originalRenderPage({
26
- enhanceApp: function (App) { return function (props) {
27
- return sheet.collectStyles(_jsx(App, __assign({}, props)));
28
- }; },
29
- });
30
- };
31
- return [4, NextDocument.getInitialProps(ctx)];
32
- case 2:
33
- initialProps = _a.sent();
34
- return [2, __assign(__assign({}, initialProps), { styles: (_jsxs(React.Fragment, { children: [initialProps.styles, sheet.getStyleElement()] })) })];
35
- case 3:
36
- sheet.seal();
37
- return [7];
38
- case 4: return [2];
39
- }
40
- });
41
- });
42
- };
43
- Document.prototype.render = function () {
44
- var _a = this.props.__NEXT_DATA__, locale = _a.locale, defaultLocale = _a.defaultLocale;
45
- return (_jsxs(Html, { lang: locale || defaultLocale, className: "no-js", children: [_jsxs(Head, { children: [_jsx(Meta, {}), _jsx(NoJs, {})] }), _jsxs("body", { children: [_jsx(Main, {}), _jsx(NextScript, {})] })] }));
46
- };
47
- return Document;
48
- }(NextDocument));
49
- export { Document };
50
- export default Document;
package/12/getT.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import type { Translate, TranslateNamespace } from "./types-i18n.js";
2
- export type GetT = <TNamespace extends TranslateNamespace | undefined = undefined>(locale?: string, namespace?: TNamespace) => Promise<Translate<TNamespace>>;
3
- export declare const getT: GetT;
4
- export default getT;
package/12/getT.js DELETED
@@ -1,4 +0,0 @@
1
- "use client";
2
- import getTranslation from "next-translate/getT";
3
- export var getT = getTranslation;
4
- export default getT;
package/12/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export { AnalyticsGoogle, type AnalyticsGoogleProps } from "./AnalyticsGoogle.js";
2
- export { DisableErrorOverlay } from "./DisableErrorOverlay.js";
3
- export * from "./types.js";
package/12/index.js DELETED
@@ -1,3 +0,0 @@
1
- export { AnalyticsGoogle } from "./AnalyticsGoogle.js";
2
- export { DisableErrorOverlay } from "./DisableErrorOverlay.js";
3
- export * from "./types.js";
@@ -1,8 +0,0 @@
1
- import React from "react";
2
- import type { SeoProps } from "./Seo.js";
3
- import type { SeoDefaultsProps } from "./SeoDefaults.js";
4
- export type MetaTag = React.DetailedHTMLProps<React.MetaHTMLAttributes<HTMLMetaElement>, HTMLMetaElement>;
5
- export type LinkTag = React.DetailedHTMLProps<React.LinkHTMLAttributes<HTMLLinkElement>, HTMLLinkElement>;
6
- type BuildTagsParams = SeoProps & SeoDefaultsProps;
7
- 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[];
8
- export default seoBuildTags;
@@ -1,93 +0,0 @@
1
- import { __assign } from "tslib";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { isArray } from "@koine/utils";
4
- var defaults = {
5
- tplTitle: "",
6
- };
7
- export var seoBuildTags = function (_a) {
8
- 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;
9
- var id = "seo-";
10
- var render = [];
11
- var $names = {};
12
- var $properties = {};
13
- if (titleTemplate) {
14
- defaults.tplTitle = titleTemplate;
15
- }
16
- title = title || (seo === null || seo === void 0 ? void 0 : seo.title) || "";
17
- if (title) {
18
- if (defaults.tplTitle && defaults.tplTitle !== title) {
19
- title = defaults.tplTitle.replace(/%s/g, title);
20
- }
21
- }
22
- else if (defaultTitle) {
23
- title = defaultTitle;
24
- }
25
- if (title) {
26
- render.push(_jsx("title", { children: title }, id + "title"));
27
- $properties["og:title"] = title;
28
- }
29
- $names["robots"] = "".concat(noindex || hidden ? "noindex" : "index", ",").concat(nofollow || hidden ? "nofollow" : "follow");
30
- description = description || (seo === null || seo === void 0 ? void 0 : seo.description);
31
- if (description) {
32
- $names["description"] = description;
33
- $properties["og:description"] = description;
34
- }
35
- keywords = keywords || (seo === null || seo === void 0 ? void 0 : seo.keywords);
36
- if (keywords) {
37
- $names["keywords"] = isArray(keywords) ? keywords.join(", ") : keywords;
38
- }
39
- if ((languageAlternates === null || languageAlternates === void 0 ? void 0 : languageAlternates.length) > 0) {
40
- languageAlternates.forEach(function (_a) {
41
- var href = _a.href, hrefLang = _a.hrefLang;
42
- render.push(_jsx("link", { rel: "alternate", hrefLang: hrefLang, href: href }, id + "languageAlternate-" + hrefLang));
43
- });
44
- }
45
- if (canonical) {
46
- render.push(_jsx("link", { rel: "canonical", href: canonical }, id + "canonical"));
47
- $properties["og:url"] = canonical;
48
- }
49
- if (facebook === null || facebook === void 0 ? void 0 : facebook.appId)
50
- $properties["fb:app_id"] = facebook.appId;
51
- if (twitter) {
52
- if (twitter.cardType)
53
- $names["twitter:card"] = twitter.cardType;
54
- if (twitter.site)
55
- $names["twitter:site"] = twitter.site;
56
- if (twitter.handle)
57
- $names["twitter:creator"] = twitter.handle;
58
- }
59
- var og = ogAlias || openGraph;
60
- if (og === null || og === void 0 ? void 0 : og.title)
61
- $properties["og:title"] = og === null || og === void 0 ? void 0 : og.title;
62
- if (og === null || og === void 0 ? void 0 : og.description)
63
- $properties["og:description"] = og === null || og === void 0 ? void 0 : og.description;
64
- if (og === null || og === void 0 ? void 0 : og.url)
65
- $properties["og:url"] = og.url;
66
- if (og === null || og === void 0 ? void 0 : og.type)
67
- $properties["og:type"] = og.type.toLowerCase();
68
- if (og === null || og === void 0 ? void 0 : og.locale)
69
- $properties["og:locale"] = og.locale;
70
- if (og === null || og === void 0 ? void 0 : og.siteName)
71
- $properties["og:siteName"] = og.siteName;
72
- var ogimage = (og === null || og === void 0 ? void 0 : og.image) || (seo === null || seo === void 0 ? void 0 : seo.ogimage);
73
- if (ogimage)
74
- $properties["og:image"] = ogimage;
75
- Object.keys($names).forEach(function (key) {
76
- render.push(_jsx("meta", { name: key, content: $names[key] }, id + "name-" + key));
77
- });
78
- Object.keys($properties).forEach(function (key) {
79
- render.push(_jsx("meta", { property: key, content: $properties[key] }, id + "prop-" + +key));
80
- });
81
- if (metaTags && metaTags.length > 0) {
82
- metaTags.forEach(function (tag) {
83
- render.push(_jsx("meta", __assign({}, tag), id + "meta-" + (tag.name || tag.property || tag.httpEquiv)));
84
- });
85
- }
86
- if (linkTags === null || linkTags === void 0 ? void 0 : linkTags.length) {
87
- linkTags.forEach(function (tag) {
88
- render.push(_jsx("link", __assign({}, tag), id + "link-" + (tag.href || tag.rel)));
89
- });
90
- }
91
- return render;
92
- };
93
- export default seoBuildTags;
package/12/to.d.ts DELETED
@@ -1,14 +0,0 @@
1
- import type { TranslateNamespaced, TranslatedRoute } from "./types-i18n.js";
2
- type OnlyStatic<T extends string> = T extends `${string}.[${string}].${string}` | `${string}.[${string}]` | `[${string}].${string}` | `[${string}]` ? never : T;
3
- type OnlyDynamic<T extends string> = T extends `${string}.[${string}].${string}` | `${string}.[${string}]` | `[${string}].${string}` | `[${string}]` ? T : never;
4
- type ExtractRouteParams<T extends string> = string extends T ? Record<string, string> : T extends `${infer _Start}[${infer Param}].${infer Rest}` ? {
5
- [k in Param | keyof ExtractRouteParams<Rest>]: string | number;
6
- } : T extends `${infer _Start}[${infer Param}]` ? {
7
- [k in Param]: string | number;
8
- } : {};
9
- export type ToTranslate = TranslateNamespaced<"~">;
10
- export type ToStaticRoute = OnlyStatic<TranslatedRoute>;
11
- export type ToDynamicRoute = OnlyDynamic<TranslatedRoute>;
12
- export type ToArgs = [ToStaticRoute] | [ToDynamicRoute, ExtractRouteParams<ToDynamicRoute>];
13
- export declare function to(...args: [ToTranslate, ...ToArgs]): string;
14
- export default to;
package/12/to.js DELETED
@@ -1,19 +0,0 @@
1
- import { __read } from "tslib";
2
- export function to() {
3
- var args = [];
4
- for (var _i = 0; _i < arguments.length; _i++) {
5
- args[_i] = arguments[_i];
6
- }
7
- var relative = "";
8
- var _a = __read(args, 1), t = _a[0];
9
- if (args.length === 3) {
10
- if (args[2]) {
11
- relative = t(args[1], args[2]).replace("*", "");
12
- }
13
- }
14
- else if (args.length === 2) {
15
- relative = t(args[1]);
16
- }
17
- return relative;
18
- }
19
- export default to;
@@ -1,4 +0,0 @@
1
- import type { Option } from "@koine/react/types";
2
- import type { TranslateLoose } from "./types-i18n.js";
3
- export declare function translationAsOptions(t: TranslateLoose, i18nKey: string): Option[];
4
- export default translationAsOptions;
@@ -1,10 +0,0 @@
1
- export function translationAsOptions(t, i18nKey) {
2
- var dictionary = t(i18nKey, undefined, {
3
- returnObjects: true,
4
- });
5
- return Object.keys(dictionary).map(function (key) { return ({
6
- value: key,
7
- label: dictionary[key],
8
- }); });
9
- }
10
- export default translationAsOptions;
@@ -1,31 +0,0 @@
1
- type Merge<T, K> = Omit<T, keyof K> & K;
2
- type Join<S1, S2> = S1 extends string ? S2 extends string ? `${S1}.${S2}` : S1 : never;
3
- export type TranslationsDictionaryDefault = {
4
- "~": any;
5
- };
6
- export type TranslationsDictionary = Merge<TranslationsDictionaryDefault, Koine.Translations>;
7
- export type TranslateNamespace = Extract<keyof TranslationsDictionary, string>;
8
- export type TranslationsPaths<T> = {
9
- [K in Extract<keyof T, string>]: T[K] extends Record<string, never> | never[] | "" ? never : T[K] extends Record<string, unknown> ? `${K}` | Join<K, TranslationsPaths<T[K]>> : T[K] extends string | number | boolean | Array<string | number | boolean | object> ? `${K}` : never;
10
- }[Extract<keyof T, string>] extends infer O ? O : never;
11
- export type TranslationsAllPaths = {
12
- [N in Extract<keyof TranslationsDictionary, string>]: {
13
- [K in Extract<keyof TranslationsDictionary[N], string>]: TranslationsDictionary[N][K] extends Record<string, never> | never[] | "" ? never : TranslationsDictionary[N][K] extends Record<string, unknown> ? `${N}:${K}` | Join<K extends string ? `${N}:${K}` : `${N}:`, TranslationsPaths<TranslationsDictionary[N][K]>> : TranslationsDictionary[N][K] extends string | number | boolean | Array<string | number | boolean | object> ? `${N}:${K}` : never;
14
- }[Extract<keyof TranslationsDictionary[N], string>];
15
- }[Extract<keyof TranslationsDictionary, string>] extends infer O ? O : never;
16
- export type TranslationShortcut = "obj" | "";
17
- export type TranslationQuery = undefined | null | TranslationShortcut | {
18
- [key: string]: string | number | boolean;
19
- };
20
- export type TranslationOptions = undefined | TranslationShortcut | {
21
- returnObjects?: boolean;
22
- fallback?: string | string[];
23
- default?: string;
24
- };
25
- export type Translate<TNamespace extends TranslateNamespace | undefined = TranslateNamespace> = TNamespace extends TranslateNamespace ? TranslateNamespaced<TNamespace> : TranslateDefault;
26
- export type TranslateDefault = <TReturn = string>(s: TranslationsAllPaths, q?: TranslationQuery, o?: TranslationOptions) => TReturn;
27
- export type TranslateNamespaced<TNamespace extends TranslateNamespace> = <TReturn = string>(s: TranslationsPaths<TranslationsDictionary[TNamespace]>, q?: TranslationQuery, o?: TranslationOptions) => TReturn;
28
- export type TranslateLoose = (s?: any, q?: TranslationQuery, o?: TranslationOptions) => string;
29
- export type TranslatedRoute = TranslationsPaths<TranslationsDictionary["~"]>;
30
- export type TranslatedRoutesChildrenOf<TStarts extends string, T extends string = TranslatedRoute> = T extends `${TStarts}.${infer First}.${infer Second}` ? First | `${First}.${Second}` : T extends `${TStarts}.${infer First}` ? First : never;
31
- export {};
package/12/types-i18n.js DELETED
@@ -1 +0,0 @@
1
- export {};
package/12/types-seo.d.ts DELETED
@@ -1,7 +0,0 @@
1
- export type SeoData = {
2
- hidden?: boolean;
3
- title?: string;
4
- description?: string;
5
- keywords?: string | string[];
6
- ogimage?: string;
7
- };
package/12/types-seo.js DELETED
@@ -1 +0,0 @@
1
- export {};
package/12/types.d.ts DELETED
@@ -1,7 +0,0 @@
1
- export * from "./types-i18n.js";
2
- export * from "./types-seo.js";
3
- export type { TProps } from "./T.js";
4
- export type { GetT } from "./getT.js";
5
- export type { DynamicNamespacesProps } from "./DynamicNamespaces.js";
6
- export type { SeoDefaultsProps } from "./SeoDefaults.js";
7
- export type { ToTranslate, ToStaticRoute, ToDynamicRoute, ToArgs } from "./to.js";
package/12/types.js DELETED
@@ -1,2 +0,0 @@
1
- export * from "./types-i18n.js";
2
- export * from "./types-seo.js";
@@ -1,2 +0,0 @@
1
- export declare function useBackUrl(): string | undefined;
2
- export default useBackUrl;
package/12/useBackUrl.js DELETED
@@ -1,24 +0,0 @@
1
- "use client";
2
- import { __read } from "tslib";
3
- import { useRouter } from "next/router";
4
- import { useEffect, useRef, useState } from "react";
5
- import { createStorage } from "@koine/browser";
6
- var back = createStorage({
7
- lastUrl: "",
8
- });
9
- export function useBackUrl() {
10
- var asPath = useRouter().asPath;
11
- var calledOnce = useRef(false);
12
- var _a = __read(useState(), 2), backUrl = _a[0], setBackUrl = _a[1];
13
- useEffect(function () {
14
- if (calledOnce.current) {
15
- return;
16
- }
17
- var prevLastUrl = back.get("lastUrl");
18
- setBackUrl(asPath === prevLastUrl || !prevLastUrl ? undefined : prevLastUrl);
19
- back.set("lastUrl", asPath);
20
- calledOnce.current = true;
21
- });
22
- return backUrl;
23
- }
24
- export default useBackUrl;
@@ -1,3 +0,0 @@
1
- import format from "date-fns/format";
2
- export declare const useDateFormat: () => typeof format;
3
- export default useDateFormat;