@koine/next 2.0.0-beta.8 → 2.0.0-beta.80

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 (179) hide show
  1. package/12/AnalyticsGoogle.d.ts +1 -2
  2. package/12/DisableErrorOverlay.d.ts +1 -6
  3. package/12/Seo.d.ts +8 -26
  4. package/12/SeoDefaults.d.ts +3 -4
  5. package/12/seoBuildTags.d.ts +2 -17
  6. package/12/types.d.ts +2 -0
  7. package/12.cjs.d.ts +1 -0
  8. package/12.cjs.default.js +1 -0
  9. package/12.cjs.js +53 -0
  10. package/12.cjs.mjs +2 -0
  11. package/12.d.ts +3 -0
  12. package/12.esm.js +43 -0
  13. package/README.md +0 -12
  14. package/ThemeContext.cjs.d.ts +2 -0
  15. package/ThemeContext.cjs.default.js +1 -0
  16. package/ThemeContext.cjs.js +13 -0
  17. package/ThemeContext.cjs.mjs +2 -0
  18. package/ThemeContext.d.ts +11 -0
  19. package/ThemeContext.esm.js +8 -0
  20. package/ThemeProvider.cjs.d.ts +2 -0
  21. package/ThemeProvider.cjs.default.js +1 -0
  22. package/ThemeProvider.cjs.js +214 -0
  23. package/ThemeProvider.cjs.mjs +2 -0
  24. package/ThemeProvider.d.ts +17 -0
  25. package/ThemeProvider.esm.js +205 -0
  26. package/config.cjs.d.ts +1 -0
  27. package/config.cjs.default.js +1 -0
  28. package/config.cjs.js +84 -0
  29. package/config.cjs.mjs +2 -0
  30. package/config.d.ts +7 -0
  31. package/config.esm.js +80 -0
  32. package/index.cjs.d.ts +1 -0
  33. package/index.cjs.default.js +1 -0
  34. package/index.cjs.js +19 -0
  35. package/index.cjs.mjs +2 -0
  36. package/index.d.ts +3 -1
  37. package/index.esm.js +8 -0
  38. package/load.cjs.d.ts +2 -0
  39. package/load.cjs.default.js +1 -0
  40. package/load.cjs.js +12 -0
  41. package/load.cjs.mjs +2 -0
  42. package/load.d.ts +0 -8
  43. package/load.esm.js +7 -0
  44. package/package.json +49 -89
  45. package/typings.d.ts +39 -50
  46. package/useTheme.cjs.d.ts +2 -0
  47. package/useTheme.cjs.default.js +1 -0
  48. package/useTheme.cjs.js +11 -0
  49. package/useTheme.cjs.mjs +2 -0
  50. package/useTheme.d.ts +4 -0
  51. package/useTheme.esm.js +6 -0
  52. package/12/AnalyticsGoogle.js +0 -79
  53. package/12/AnalyticsGoogle.mjs +0 -60
  54. package/12/DisableErrorOverlay.js +0 -31
  55. package/12/DisableErrorOverlay.mjs +0 -16
  56. package/12/DynamicNamespaces.d.ts +0 -13
  57. package/12/DynamicNamespaces.js +0 -23
  58. package/12/DynamicNamespaces.mjs +0 -8
  59. package/12/Favicon.d.ts +0 -4
  60. package/12/Favicon.js +0 -29
  61. package/12/Favicon.mjs +0 -10
  62. package/12/Link.d.ts +0 -10
  63. package/12/Link.js +0 -38
  64. package/12/Link.mjs +0 -20
  65. package/12/NextProgress.d.ts +0 -25
  66. package/12/NextProgress.js +0 -69
  67. package/12/NextProgress.mjs +0 -51
  68. package/12/Seo.js +0 -29
  69. package/12/Seo.mjs +0 -30
  70. package/12/SeoDefaults.js +0 -31
  71. package/12/SeoDefaults.mjs +0 -14
  72. package/12/T.d.ts +0 -16
  73. package/12/T.js +0 -43
  74. package/12/T.mjs +0 -27
  75. package/12/ThemeContext.d.ts +0 -17
  76. package/12/ThemeContext.js +0 -25
  77. package/12/ThemeContext.mjs +0 -7
  78. package/12/ThemeProvider.d.ts +0 -35
  79. package/12/ThemeProvider.js +0 -256
  80. package/12/ThemeProvider.mjs +0 -245
  81. package/12/TransText.d.ts +0 -3
  82. package/12/TransText.js +0 -23
  83. package/12/TransText.mjs +0 -4
  84. package/12/app/AppHead.d.ts +0 -3
  85. package/12/app/AppHead.js +0 -31
  86. package/12/app/AppHead.mjs +0 -12
  87. package/12/app/AppMain.d.ts +0 -35
  88. package/12/app/AppMain.js +0 -6
  89. package/12/app/AppMain.mjs +0 -1
  90. package/12/app/css/AppMain.d.ts +0 -9
  91. package/12/app/css/AppMain.js +0 -39
  92. package/12/app/css/AppMain.mjs +0 -24
  93. package/12/app/css/AppTheme.d.ts +0 -11
  94. package/12/app/css/AppTheme.js +0 -33
  95. package/12/app/css/AppTheme.mjs +0 -17
  96. package/12/app/css/auth/index.d.ts +0 -11
  97. package/12/app/css/auth/index.js +0 -40
  98. package/12/app/css/auth/index.mjs +0 -24
  99. package/12/app/css/index.d.ts +0 -54
  100. package/12/app/css/index.js +0 -36
  101. package/12/app/css/index.mjs +0 -65
  102. package/12/app/index.d.ts +0 -2
  103. package/12/app/index.js +0 -7
  104. package/12/app/index.mjs +0 -2
  105. package/12/app/sc/AppMain.d.ts +0 -11
  106. package/12/app/sc/AppMain.js +0 -70
  107. package/12/app/sc/AppMain.mjs +0 -58
  108. package/12/app/sc/AppTheme.d.ts +0 -14
  109. package/12/app/sc/AppTheme.js +0 -33
  110. package/12/app/sc/AppTheme.mjs +0 -16
  111. package/12/app/sc/auth/index.d.ts +0 -11
  112. package/12/app/sc/auth/index.js +0 -40
  113. package/12/app/sc/auth/index.mjs +0 -24
  114. package/12/app/sc/index.d.ts +0 -56
  115. package/12/app/sc/index.js +0 -36
  116. package/12/app/sc/index.mjs +0 -67
  117. package/12/document/Document.d.ts +0 -15
  118. package/12/document/Document.js +0 -49
  119. package/12/document/Document.mjs +0 -38
  120. package/12/document/css/index.d.ts +0 -17
  121. package/12/document/css/index.js +0 -60
  122. package/12/document/css/index.mjs +0 -53
  123. package/12/document/index.d.ts +0 -2
  124. package/12/document/index.js +0 -19
  125. package/12/document/index.mjs +0 -2
  126. package/12/document/sc/index.d.ts +0 -19
  127. package/12/document/sc/index.js +0 -73
  128. package/12/document/sc/index.mjs +0 -65
  129. package/12/getT.d.ts +0 -9
  130. package/12/getT.js +0 -23
  131. package/12/getT.mjs +0 -8
  132. package/12/index.d.ts +0 -24
  133. package/12/index.js +0 -100
  134. package/12/index.mjs +0 -27
  135. package/12/seoBuildTags.js +0 -126
  136. package/12/seoBuildTags.mjs +0 -121
  137. package/12/to.d.ts +0 -24
  138. package/12/to.js +0 -31
  139. package/12/to.mjs +0 -19
  140. package/12/translationAsOptions.d.ts +0 -3
  141. package/12/translationAsOptions.js +0 -19
  142. package/12/translationAsOptions.mjs +0 -9
  143. package/12/types-i18n.d.ts +0 -118
  144. package/12/types-i18n.js +0 -15
  145. package/12/types-i18n.mjs +0 -12
  146. package/12/types-seo.d.ts +0 -7
  147. package/12/types-seo.js +0 -4
  148. package/12/types-seo.mjs +0 -1
  149. package/12/useBackUrl.d.ts +0 -2
  150. package/12/useBackUrl.js +0 -47
  151. package/12/useBackUrl.mjs +0 -28
  152. package/12/useDateFormat.d.ts +0 -7
  153. package/12/useDateFormat.js +0 -42
  154. package/12/useDateFormat.mjs +0 -26
  155. package/12/useForm.d.ts +0 -27
  156. package/12/useForm.js +0 -65
  157. package/12/useForm.mjs +0 -47
  158. package/12/useLocale.d.ts +0 -2
  159. package/12/useLocale.js +0 -25
  160. package/12/useLocale.mjs +0 -6
  161. package/12/useT.d.ts +0 -4
  162. package/12/useT.js +0 -58
  163. package/12/useT.mjs +0 -39
  164. package/12/useTheme.d.ts +0 -7
  165. package/12/useTheme.js +0 -23
  166. package/12/useTheme.mjs +0 -7
  167. package/12/useTo.d.ts +0 -3
  168. package/12/useTo.js +0 -26
  169. package/12/useTo.mjs +0 -8
  170. package/config/index.d.ts +0 -160
  171. package/config/index.js +0 -317
  172. package/config/index.mjs +0 -315
  173. package/getSiteUrl.d.ts +0 -8
  174. package/getSiteUrl.js +0 -24
  175. package/getSiteUrl.mjs +0 -10
  176. package/index.js +0 -20
  177. package/index.mjs +0 -2
  178. package/load.js +0 -31
  179. package/load.mjs +0 -13
@@ -1,17 +0,0 @@
1
- import NextDocument from "next/document";
2
- /**
3
- * Next Document wrapper for `css/tailwind` based projects
4
- *
5
- * Uses cookie to manage the current theme
6
- *
7
- * @example
8
- *
9
- * in your `myapp/pages/_document.tsx`:
10
- * ```tsx
11
- * export { Document as default } from "@koine/next/document/css";
12
- * ```
13
- */
14
- export declare class Document extends NextDocument {
15
- render(): import("react/jsx-runtime").JSX.Element;
16
- }
17
- export default Document;
@@ -1,60 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- Document: function() {
13
- return Document;
14
- },
15
- default: function() {
16
- return _default;
17
- }
18
- });
19
- const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
20
- const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
21
- const _jsxruntime = require("react/jsx-runtime");
22
- const _document = /*#__PURE__*/ _interop_require_wildcard._(require("next/document"));
23
- const _react = /*#__PURE__*/ _interop_require_default._(require("react"));
24
- const _Meta = /*#__PURE__*/ _interop_require_default._(require("@koine/react/Meta"));
25
- const _NoJs = /*#__PURE__*/ _interop_require_default._(require("@koine/react/NoJs"));
26
- let Document = class Document extends _document.default {
27
- // static override async getInitialProps(
28
- // ctx: DocumentContext
29
- // ): Promise<DocumentInitialProps & { theme: ThemeVanillaValue }> {
30
- // const initialProps = await NextDocument.getInitialProps(ctx);
31
- // return {
32
- // ...initialProps,
33
- // theme: getInitialThemeFromRequest(
34
- // ctx.req?.headers.cookie /* || document?.cookie */ || ""
35
- // ),
36
- // };
37
- // }
38
- render() {
39
- const { locale, defaultLocale } = this.props.__NEXT_DATA__;
40
- return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_document.Html, {
41
- lang: locale || defaultLocale,
42
- className: "no-js",
43
- children: [
44
- /*#__PURE__*/ (0, _jsxruntime.jsxs)(_document.Head, {
45
- children: [
46
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_Meta.default, {}),
47
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_NoJs.default, {})
48
- ]
49
- }),
50
- /*#__PURE__*/ (0, _jsxruntime.jsxs)("body", {
51
- children: [
52
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_document.Main, {}),
53
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_document.NextScript, {})
54
- ]
55
- })
56
- ]
57
- });
58
- }
59
- };
60
- const _default = Document;
@@ -1,53 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import NextDocument, { Head, // type DocumentInitialProps,
3
- Html, Main, NextScript } from "next/document";
4
- import React from "react";
5
- import Meta from "@koine/react/Meta";
6
- import NoJs from "@koine/react/NoJs";
7
- // import { getInitialThemeFromRequest, ThemeVanillaValue } from "@koine/react/sc"; // FIXME: this should be imported from another entrypoint
8
- /**
9
- * Next Document wrapper for `css/tailwind` based projects
10
- *
11
- * Uses cookie to manage the current theme
12
- *
13
- * @example
14
- *
15
- * in your `myapp/pages/_document.tsx`:
16
- * ```tsx
17
- * export { Document as default } from "@koine/next/document/css";
18
- * ```
19
- */ export class Document extends NextDocument {
20
- // static override async getInitialProps(
21
- // ctx: DocumentContext
22
- // ): Promise<DocumentInitialProps & { theme: ThemeVanillaValue }> {
23
- // const initialProps = await NextDocument.getInitialProps(ctx);
24
- // return {
25
- // ...initialProps,
26
- // theme: getInitialThemeFromRequest(
27
- // ctx.req?.headers.cookie /* || document?.cookie */ || ""
28
- // ),
29
- // };
30
- // }
31
- render() {
32
- const { locale, defaultLocale } = this.props.__NEXT_DATA__;
33
- return /*#__PURE__*/ _jsxs(Html, {
34
- lang: locale || defaultLocale,
35
- className: "no-js",
36
- children: [
37
- /*#__PURE__*/ _jsxs(Head, {
38
- children: [
39
- /*#__PURE__*/ _jsx(Meta, {}),
40
- /*#__PURE__*/ _jsx(NoJs, {})
41
- ]
42
- }),
43
- /*#__PURE__*/ _jsxs("body", {
44
- children: [
45
- /*#__PURE__*/ _jsx(Main, {}),
46
- /*#__PURE__*/ _jsx(NextScript, {})
47
- ]
48
- })
49
- ]
50
- });
51
- }
52
- }
53
- export default Document;
@@ -1,2 +0,0 @@
1
- export { Document } from "./Document";
2
- export { Document as default } from "./Document";
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- Document: function() {
13
- return _Document.Document;
14
- },
15
- default: function() {
16
- return _Document.Document;
17
- }
18
- });
19
- const _Document = require("./Document");
@@ -1,2 +0,0 @@
1
- export { Document } from "./Document";
2
- export { Document as default } from "./Document";
@@ -1,19 +0,0 @@
1
- import NextDocument, { DocumentContext, type DocumentInitialProps } from "next/document";
2
- /**
3
- * Next Document wrapper for `styled-components` based projects
4
- *
5
- * For typescript safety of this component
6
- * @see https://bit.ly/3ceuF8m
7
- *
8
- * @example
9
- *
10
- * in your `myapp/pages/_document.tsx`:
11
- * ```tsx
12
- * export { Document as default } from "@koine/next/document/sc";
13
- * ```
14
- */
15
- export declare class Document extends NextDocument {
16
- static getInitialProps(ctx: DocumentContext): Promise<DocumentInitialProps>;
17
- render(): import("react/jsx-runtime").JSX.Element;
18
- }
19
- export default Document;
@@ -1,73 +0,0 @@
1
- /* ? eslint-disable @next/next/no-document-import-in-page */ "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- Document: function() {
13
- return Document;
14
- },
15
- default: function() {
16
- return _default;
17
- }
18
- });
19
- const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
20
- const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
21
- const _jsxruntime = require("react/jsx-runtime");
22
- const _document = /*#__PURE__*/ _interop_require_wildcard._(require("next/document"));
23
- const _react = /*#__PURE__*/ _interop_require_default._(require("react"));
24
- const _styledcomponents = require("styled-components");
25
- const _Meta = /*#__PURE__*/ _interop_require_default._(require("@koine/react/Meta"));
26
- const _NoJs = /*#__PURE__*/ _interop_require_default._(require("@koine/react/NoJs"));
27
- let Document = class Document extends _document.default {
28
- static async getInitialProps(ctx) {
29
- const sheet = new _styledcomponents.ServerStyleSheet();
30
- const originalRenderPage = ctx.renderPage;
31
- try {
32
- ctx.renderPage = ()=>originalRenderPage({
33
- enhanceApp: (App)=>(props)=>sheet.collectStyles(/*#__PURE__*/ (0, _jsxruntime.jsx)(App, {
34
- ...props
35
- }))
36
- });
37
- const initialProps = await _document.default.getInitialProps(ctx);
38
- return {
39
- ...initialProps,
40
- styles: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_react.default.Fragment, {
41
- children: [
42
- initialProps.styles,
43
- sheet.getStyleElement()
44
- ]
45
- })
46
- };
47
- } finally{
48
- sheet.seal();
49
- }
50
- }
51
- render() {
52
- const { locale, defaultLocale } = this.props.__NEXT_DATA__;
53
- return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_document.Html, {
54
- lang: locale || defaultLocale,
55
- className: "no-js",
56
- children: [
57
- /*#__PURE__*/ (0, _jsxruntime.jsxs)(_document.Head, {
58
- children: [
59
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_Meta.default, {}),
60
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_NoJs.default, {})
61
- ]
62
- }),
63
- /*#__PURE__*/ (0, _jsxruntime.jsxs)("body", {
64
- children: [
65
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_document.Main, {}),
66
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_document.NextScript, {})
67
- ]
68
- })
69
- ]
70
- });
71
- }
72
- };
73
- const _default = Document;
@@ -1,65 +0,0 @@
1
- /* ? eslint-disable @next/next/no-document-import-in-page */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import NextDocument, { Head, Html, Main, NextScript } from "next/document";
3
- import React from "react";
4
- import { ServerStyleSheet } from "styled-components";
5
- import Meta from "@koine/react/Meta";
6
- import NoJs from "@koine/react/NoJs";
7
- /**
8
- * Next Document wrapper for `styled-components` based projects
9
- *
10
- * For typescript safety of this component
11
- * @see https://bit.ly/3ceuF8m
12
- *
13
- * @example
14
- *
15
- * in your `myapp/pages/_document.tsx`:
16
- * ```tsx
17
- * export { Document as default } from "@koine/next/document/sc";
18
- * ```
19
- */ export class Document extends NextDocument {
20
- static async getInitialProps(ctx) {
21
- const sheet = new ServerStyleSheet();
22
- const originalRenderPage = ctx.renderPage;
23
- try {
24
- ctx.renderPage = ()=>originalRenderPage({
25
- enhanceApp: (App)=>(props)=>sheet.collectStyles(/*#__PURE__*/ _jsx(App, {
26
- ...props
27
- }))
28
- });
29
- const initialProps = await NextDocument.getInitialProps(ctx);
30
- return {
31
- ...initialProps,
32
- styles: /*#__PURE__*/ _jsxs(React.Fragment, {
33
- children: [
34
- initialProps.styles,
35
- sheet.getStyleElement()
36
- ]
37
- })
38
- };
39
- } finally{
40
- sheet.seal();
41
- }
42
- }
43
- render() {
44
- const { locale, defaultLocale } = this.props.__NEXT_DATA__;
45
- return /*#__PURE__*/ _jsxs(Html, {
46
- lang: locale || defaultLocale,
47
- className: "no-js",
48
- children: [
49
- /*#__PURE__*/ _jsxs(Head, {
50
- children: [
51
- /*#__PURE__*/ _jsx(Meta, {}),
52
- /*#__PURE__*/ _jsx(NoJs, {})
53
- ]
54
- }),
55
- /*#__PURE__*/ _jsxs("body", {
56
- children: [
57
- /*#__PURE__*/ _jsx(Main, {}),
58
- /*#__PURE__*/ _jsx(NextScript, {})
59
- ]
60
- })
61
- ]
62
- });
63
- }
64
- }
65
- export default Document;
package/12/getT.d.ts DELETED
@@ -1,9 +0,0 @@
1
- import type { Translate, TranslateNamespace } from "./types-i18n";
2
- export type GetT = <TNamespace extends TranslateNamespace | undefined = undefined>(locale?: string, namespace?: TNamespace) => Promise<Translate<TNamespace>>;
3
- /**
4
- * **NOTE**: To make typescript work nicely here make sure to enable
5
- * [`resolveJsonModule`](https://www.typescriptlang.org/tsconfig#resolveJsonModule)
6
- * in your `tsconfig.json` file.
7
- */
8
- export declare const getT: GetT;
9
- export default getT;
package/12/getT.js DELETED
@@ -1,23 +0,0 @@
1
- "use client";
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- function _export(target, all) {
7
- for(var name in all)Object.defineProperty(target, name, {
8
- enumerable: true,
9
- get: all[name]
10
- });
11
- }
12
- _export(exports, {
13
- getT: function() {
14
- return getT;
15
- },
16
- default: function() {
17
- return _default;
18
- }
19
- });
20
- const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
21
- const _getT = /*#__PURE__*/ _interop_require_default._(require("next-translate/getT"));
22
- const getT = _getT.default;
23
- const _default = getT;
package/12/getT.mjs DELETED
@@ -1,8 +0,0 @@
1
- "use client";
2
- /* eslint-disable @typescript-eslint/no-unnecessary-type-constraint */ import getTranslation from "next-translate/getT";
3
- /**
4
- * **NOTE**: To make typescript work nicely here make sure to enable
5
- * [`resolveJsonModule`](https://www.typescriptlang.org/tsconfig#resolveJsonModule)
6
- * in your `tsconfig.json` file.
7
- */ export const getT = getTranslation;
8
- export default getT;
package/12/index.d.ts DELETED
@@ -1,24 +0,0 @@
1
- export { AnalyticsGoogle, type AnalyticsGoogleProps } from "./AnalyticsGoogle";
2
- export { DisableErrorOverlay } from "./DisableErrorOverlay";
3
- export { DynamicNamespaces, type DynamicNamespacesProps, } from "./DynamicNamespaces";
4
- export { Favicon, type FaviconProps } from "./Favicon";
5
- export { getT, type GetT } from "./getT";
6
- export { Link, type LinkProps } from "./Link";
7
- export { NextProgress, type NextProgressProps } from "./NextProgress";
8
- export { Seo, type SeoProps } from "./Seo";
9
- export { SeoDefaults, type SeoDefaultsProps } from "./SeoDefaults";
10
- export { T, type TProps } from "./T";
11
- export { ThemeContext, type ThemeContextProps } from "./ThemeContext";
12
- export { ThemeProvider, type ThemeProviderProps } from "./ThemeProvider";
13
- export { to, type ToArgs, type ToTranslate, type ToDynamicRoute, type ToStaticRoute, } from "./to";
14
- export { translationAsOptions } from "./translationAsOptions";
15
- export { TransText } from "./TransText";
16
- export type { Translate, TranslateDefault, TranslateLoose, TranslateNamespace, TranslateNamespaced, TranslatedRoute, TranslatedRoutesChildrenOf, TranslationOptions, TranslationQuery, TranslationShortcut, TranslationsAllPaths, TranslationsDictionary, TranslationsDictionaryDefault, TranslationsPaths, } from "./types-i18n";
17
- export type { SeoData } from "./types-seo";
18
- export { useBackUrl } from "./useBackUrl";
19
- export { useDateFormat } from "./useDateFormat";
20
- export { useForm } from "./useForm";
21
- export { useLocale } from "./useLocale";
22
- export { useT } from "./useT";
23
- export { useTheme, type UseThemeProps } from "./useTheme";
24
- export { useTo } from "./useTo";
package/12/index.js DELETED
@@ -1,100 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- AnalyticsGoogle: function() {
13
- return _AnalyticsGoogle.AnalyticsGoogle;
14
- },
15
- DisableErrorOverlay: function() {
16
- return _DisableErrorOverlay.DisableErrorOverlay;
17
- },
18
- DynamicNamespaces: function() {
19
- return _DynamicNamespaces.DynamicNamespaces;
20
- },
21
- Favicon: function() {
22
- return _Favicon.Favicon;
23
- },
24
- getT: function() {
25
- return _getT.getT;
26
- },
27
- Link: function() {
28
- return _Link.Link;
29
- },
30
- NextProgress: function() {
31
- return _NextProgress.NextProgress;
32
- },
33
- Seo: function() {
34
- return _Seo.Seo;
35
- },
36
- SeoDefaults: function() {
37
- return _SeoDefaults.SeoDefaults;
38
- },
39
- T: function() {
40
- return _T.T;
41
- },
42
- ThemeContext: function() {
43
- return _ThemeContext.ThemeContext;
44
- },
45
- ThemeProvider: function() {
46
- return _ThemeProvider.ThemeProvider;
47
- },
48
- to: function() {
49
- return _to.to;
50
- },
51
- translationAsOptions: function() {
52
- return _translationAsOptions.translationAsOptions;
53
- },
54
- TransText: function() {
55
- return _TransText.TransText;
56
- },
57
- useBackUrl: function() {
58
- return _useBackUrl.useBackUrl;
59
- },
60
- useDateFormat: function() {
61
- return _useDateFormat.useDateFormat;
62
- },
63
- useForm: function() {
64
- return _useForm.useForm;
65
- },
66
- useLocale: function() {
67
- return _useLocale.useLocale;
68
- },
69
- useT: function() {
70
- return _useT.useT;
71
- },
72
- useTheme: function() {
73
- return _useTheme.useTheme;
74
- },
75
- useTo: function() {
76
- return _useTo.useTo;
77
- }
78
- });
79
- const _AnalyticsGoogle = require("./AnalyticsGoogle");
80
- const _DisableErrorOverlay = require("./DisableErrorOverlay");
81
- const _DynamicNamespaces = require("./DynamicNamespaces");
82
- const _Favicon = require("./Favicon");
83
- const _getT = require("./getT");
84
- const _Link = require("./Link");
85
- const _NextProgress = require("./NextProgress");
86
- const _Seo = require("./Seo");
87
- const _SeoDefaults = require("./SeoDefaults");
88
- const _T = require("./T");
89
- const _ThemeContext = require("./ThemeContext");
90
- const _ThemeProvider = require("./ThemeProvider");
91
- const _to = require("./to");
92
- const _translationAsOptions = require("./translationAsOptions");
93
- const _TransText = require("./TransText");
94
- const _useBackUrl = require("./useBackUrl");
95
- const _useDateFormat = require("./useDateFormat");
96
- const _useForm = require("./useForm");
97
- const _useLocale = require("./useLocale");
98
- const _useT = require("./useT");
99
- const _useTheme = require("./useTheme");
100
- const _useTo = require("./useTo");
package/12/index.mjs DELETED
@@ -1,27 +0,0 @@
1
- export { AnalyticsGoogle } from "./AnalyticsGoogle";
2
- export { DisableErrorOverlay } from "./DisableErrorOverlay";
3
- export { DynamicNamespaces } from "./DynamicNamespaces";
4
- export { Favicon } from "./Favicon";
5
- export { getT } from "./getT";
6
- export { Link } from "./Link";
7
- export { NextProgress } from "./NextProgress";
8
- export { Seo } from "./Seo";
9
- // export {
10
- // seoBuildTags,
11
- // type LinkTag,
12
- // type MetaTag
13
- // } from "./seoBuildTags";
14
- export { SeoDefaults } from "./SeoDefaults";
15
- export { T } from "./T";
16
- export { ThemeContext } from "./ThemeContext";
17
- export { ThemeProvider } from "./ThemeProvider";
18
- export { to } from "./to";
19
- export { translationAsOptions } from "./translationAsOptions";
20
- export { TransText } from "./TransText";
21
- export { useBackUrl } from "./useBackUrl";
22
- export { useDateFormat } from "./useDateFormat";
23
- export { useForm } from "./useForm";
24
- export { useLocale } from "./useLocale";
25
- export { useT } from "./useT";
26
- export { useTheme } from "./useTheme";
27
- export { useTo } from "./useTo";
@@ -1,126 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- seoBuildTags: function() {
13
- return seoBuildTags;
14
- },
15
- default: function() {
16
- return _default;
17
- }
18
- });
19
- const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
20
- const _jsxruntime = require("react/jsx-runtime");
21
- const _react = /*#__PURE__*/ _interop_require_default._(require("react"));
22
- const _isArray = /*#__PURE__*/ _interop_require_default._(require("@koine/utils/isArray"));
23
- const defaults = {
24
- tplTitle: ""
25
- };
26
- const seoBuildTags = ({ seo, hidden, keywords, title = "", titleTemplate, defaultTitle, noindex, nofollow, description, languageAlternates = [], twitter, facebook, openGraph, og: ogAlias, canonical, metaTags, linkTags } = {})=>{
27
- const id = "seo-";
28
- const render = [];
29
- const $names = {};
30
- const $properties = {};
31
- if (titleTemplate) {
32
- defaults.tplTitle = titleTemplate;
33
- }
34
- title = title || seo?.title || "";
35
- if (title) {
36
- if (defaults.tplTitle && defaults.tplTitle !== title) {
37
- title = defaults.tplTitle.replace(/%s/g, title);
38
- }
39
- } else if (defaultTitle) {
40
- title = defaultTitle;
41
- }
42
- if (title) {
43
- render.push(/*#__PURE__*/ (0, _jsxruntime.jsx)("title", {
44
- children: title
45
- }, id + "title"));
46
- $properties["og:title"] = title; // overridden later...
47
- }
48
- $names["robots"] = `${noindex || hidden ? "noindex" : "index"},${nofollow || hidden ? "nofollow" : "follow"}`;
49
- description = description || seo?.description;
50
- if (description) {
51
- $names["description"] = description;
52
- $properties["og:description"] = description; // overridden later...
53
- }
54
- keywords = keywords || seo?.keywords;
55
- if (keywords) {
56
- $names["keywords"] = (0, _isArray.default)(keywords) ? keywords.join(", ") : keywords;
57
- }
58
- if (languageAlternates?.length > 0) {
59
- languageAlternates.forEach(({ href, hrefLang })=>{
60
- render.push(/*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
61
- rel: "alternate",
62
- hrefLang: hrefLang,
63
- href: href
64
- }, id + "languageAlternate-" + hrefLang));
65
- });
66
- }
67
- if (canonical) {
68
- render.push(/*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
69
- rel: "canonical",
70
- href: canonical
71
- }, id + "canonical"));
72
- $properties["og:url"] = canonical;
73
- }
74
- if (facebook?.appId) $properties["fb:app_id"] = facebook.appId;
75
- if (twitter) {
76
- if (twitter.cardType) $names["twitter:card"] = twitter.cardType;
77
- if (twitter.site) $names["twitter:site"] = twitter.site;
78
- if (twitter.handle) $names["twitter:creator"] = twitter.handle;
79
- }
80
- const og = ogAlias || openGraph;
81
- if (og?.title) $properties["og:title"] = og?.title;
82
- if (og?.description) $properties["og:description"] = og?.description;
83
- if (og?.url) $properties["og:url"] = og.url;
84
- if (og?.type) $properties["og:type"] = og.type.toLowerCase();
85
- if (og?.locale) $properties["og:locale"] = og.locale;
86
- if (og?.siteName) $properties["og:siteName"] = og.siteName;
87
- const ogimage = og?.image || seo?.ogimage;
88
- if (ogimage) $properties["og:image"] = ogimage;
89
- Object.keys($names).forEach((key)=>{
90
- render.push(/*#__PURE__*/ (0, _jsxruntime.jsx)("meta", {
91
- name: key,
92
- content: $names[key]
93
- }, id + "name-" + key));
94
- });
95
- Object.keys($properties).forEach((key)=>{
96
- render.push(/*#__PURE__*/ (0, _jsxruntime.jsx)("meta", {
97
- property: key,
98
- content: $properties[key]
99
- }, id + "prop-" + +key));
100
- });
101
- if (metaTags && metaTags.length > 0) {
102
- metaTags.forEach((tag)=>{
103
- render.push(/*#__PURE__*/ (0, _jsxruntime.jsx)("meta", {
104
- ...tag
105
- }, id + "meta-" + (tag.name || tag.property || tag.httpEquiv)));
106
- });
107
- }
108
- if (linkTags?.length) {
109
- linkTags.forEach((tag)=>{
110
- render.push(/*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
111
- ...tag
112
- }, id + "link-" + (tag.href || tag.rel)));
113
- });
114
- }
115
- // TODO: alternates and canonical
116
- // canonical = 'https://www.domain.com/';
117
- // languageAlternates={[{
118
- // hrefLang: 'en',
119
- // href: 'https://www.domain.com/en',
120
- // }]}
121
- // <link rel="alternate" hreflang="x-default" href="https://www.domain.com/nl/">
122
- // <link rel="alternate" hreflang="nl" href="https://www.domain.com/nl/">
123
- // <link rel="alternate" hreflang="en" href="https://www.domain.com/en/">
124
- return render;
125
- };
126
- const _default = seoBuildTags;