@koine/next 2.0.0-beta.7 → 2.0.0-beta.70

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 (160) 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 +1 -16
  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 +28 -0
  10. package/12.cjs.mjs +2 -0
  11. package/12.d.ts +3 -0
  12. package/12.esm.js +18 -0
  13. package/README.md +0 -12
  14. package/config.cjs.d.ts +1 -0
  15. package/config.cjs.default.js +1 -0
  16. package/config.cjs.js +9 -0
  17. package/config.cjs.mjs +2 -0
  18. package/config.d.ts +7 -0
  19. package/config.esm.js +5 -0
  20. package/index.cjs.d.ts +1 -0
  21. package/index.cjs.default.js +1 -0
  22. package/index.cjs.js +25 -0
  23. package/index.cjs.mjs +2 -0
  24. package/index.d.ts +4 -2
  25. package/index.esm.js +14 -0
  26. package/package.json +30 -69
  27. package/theme/ThemeContext.d.ts +11 -0
  28. package/theme/ThemeProvider.d.ts +17 -0
  29. package/theme/useTheme.d.ts +4 -0
  30. package/typings.d.ts +39 -50
  31. package/utils/load.d.ts +1 -0
  32. package/12/AnalyticsGoogle.js +0 -79
  33. package/12/AnalyticsGoogle.mjs +0 -60
  34. package/12/DisableErrorOverlay.js +0 -31
  35. package/12/DisableErrorOverlay.mjs +0 -16
  36. package/12/DynamicNamespaces.d.ts +0 -13
  37. package/12/DynamicNamespaces.js +0 -23
  38. package/12/DynamicNamespaces.mjs +0 -8
  39. package/12/Favicon.d.ts +0 -4
  40. package/12/Favicon.js +0 -29
  41. package/12/Favicon.mjs +0 -10
  42. package/12/Link.d.ts +0 -10
  43. package/12/Link.js +0 -38
  44. package/12/Link.mjs +0 -20
  45. package/12/NextProgress.d.ts +0 -25
  46. package/12/NextProgress.js +0 -69
  47. package/12/NextProgress.mjs +0 -51
  48. package/12/Seo.js +0 -29
  49. package/12/Seo.mjs +0 -30
  50. package/12/SeoDefaults.js +0 -31
  51. package/12/SeoDefaults.mjs +0 -14
  52. package/12/T.d.ts +0 -16
  53. package/12/T.js +0 -43
  54. package/12/T.mjs +0 -27
  55. package/12/ThemeContext.d.ts +0 -17
  56. package/12/ThemeContext.js +0 -25
  57. package/12/ThemeContext.mjs +0 -7
  58. package/12/ThemeProvider.d.ts +0 -35
  59. package/12/ThemeProvider.js +0 -256
  60. package/12/ThemeProvider.mjs +0 -245
  61. package/12/TransText.d.ts +0 -3
  62. package/12/TransText.js +0 -23
  63. package/12/TransText.mjs +0 -4
  64. package/12/app/AppHead.d.ts +0 -3
  65. package/12/app/AppHead.js +0 -31
  66. package/12/app/AppHead.mjs +0 -12
  67. package/12/app/AppMain.d.ts +0 -35
  68. package/12/app/AppMain.js +0 -6
  69. package/12/app/AppMain.mjs +0 -1
  70. package/12/app/css/AppMain.d.ts +0 -9
  71. package/12/app/css/AppMain.js +0 -39
  72. package/12/app/css/AppMain.mjs +0 -24
  73. package/12/app/css/AppTheme.d.ts +0 -11
  74. package/12/app/css/AppTheme.js +0 -33
  75. package/12/app/css/AppTheme.mjs +0 -17
  76. package/12/app/css/auth/index.d.ts +0 -11
  77. package/12/app/css/auth/index.js +0 -40
  78. package/12/app/css/auth/index.mjs +0 -24
  79. package/12/app/css/index.d.ts +0 -54
  80. package/12/app/css/index.js +0 -36
  81. package/12/app/css/index.mjs +0 -65
  82. package/12/app/index.d.ts +0 -2
  83. package/12/app/index.js +0 -7
  84. package/12/app/index.mjs +0 -2
  85. package/12/app/sc/AppMain.d.ts +0 -11
  86. package/12/app/sc/AppMain.js +0 -70
  87. package/12/app/sc/AppMain.mjs +0 -58
  88. package/12/app/sc/AppTheme.d.ts +0 -14
  89. package/12/app/sc/AppTheme.js +0 -33
  90. package/12/app/sc/AppTheme.mjs +0 -16
  91. package/12/app/sc/auth/index.d.ts +0 -11
  92. package/12/app/sc/auth/index.js +0 -40
  93. package/12/app/sc/auth/index.mjs +0 -24
  94. package/12/app/sc/index.d.ts +0 -56
  95. package/12/app/sc/index.js +0 -36
  96. package/12/app/sc/index.mjs +0 -67
  97. package/12/document/Document.d.ts +0 -15
  98. package/12/document/Document.js +0 -49
  99. package/12/document/Document.mjs +0 -38
  100. package/12/document/css/index.d.ts +0 -17
  101. package/12/document/css/index.js +0 -60
  102. package/12/document/css/index.mjs +0 -53
  103. package/12/document/index.d.ts +0 -2
  104. package/12/document/index.js +0 -19
  105. package/12/document/index.mjs +0 -2
  106. package/12/document/sc/index.d.ts +0 -19
  107. package/12/document/sc/index.js +0 -73
  108. package/12/document/sc/index.mjs +0 -65
  109. package/12/getT.d.ts +0 -9
  110. package/12/getT.js +0 -23
  111. package/12/getT.mjs +0 -8
  112. package/12/index.d.ts +0 -24
  113. package/12/index.js +0 -100
  114. package/12/index.mjs +0 -27
  115. package/12/seoBuildTags.js +0 -126
  116. package/12/seoBuildTags.mjs +0 -121
  117. package/12/to.d.ts +0 -24
  118. package/12/to.js +0 -31
  119. package/12/to.mjs +0 -19
  120. package/12/translationAsOptions.d.ts +0 -3
  121. package/12/translationAsOptions.js +0 -19
  122. package/12/translationAsOptions.mjs +0 -9
  123. package/12/types-i18n.d.ts +0 -118
  124. package/12/types-i18n.js +0 -15
  125. package/12/types-i18n.mjs +0 -12
  126. package/12/types-seo.d.ts +0 -7
  127. package/12/types-seo.js +0 -4
  128. package/12/types-seo.mjs +0 -1
  129. package/12/useBackUrl.d.ts +0 -2
  130. package/12/useBackUrl.js +0 -47
  131. package/12/useBackUrl.mjs +0 -28
  132. package/12/useDateFormat.d.ts +0 -7
  133. package/12/useDateFormat.js +0 -42
  134. package/12/useDateFormat.mjs +0 -26
  135. package/12/useForm.d.ts +0 -27
  136. package/12/useForm.js +0 -65
  137. package/12/useForm.mjs +0 -47
  138. package/12/useLocale.d.ts +0 -2
  139. package/12/useLocale.js +0 -25
  140. package/12/useLocale.mjs +0 -6
  141. package/12/useT.d.ts +0 -4
  142. package/12/useT.js +0 -58
  143. package/12/useT.mjs +0 -39
  144. package/12/useTheme.d.ts +0 -7
  145. package/12/useTheme.js +0 -23
  146. package/12/useTheme.mjs +0 -7
  147. package/12/useTo.d.ts +0 -3
  148. package/12/useTo.js +0 -26
  149. package/12/useTo.mjs +0 -8
  150. package/config/index.d.ts +0 -160
  151. package/config/index.js +0 -317
  152. package/config/index.mjs +0 -315
  153. package/getSiteUrl.d.ts +0 -8
  154. package/getSiteUrl.js +0 -24
  155. package/getSiteUrl.mjs +0 -10
  156. package/index.js +0 -20
  157. package/index.mjs +0 -2
  158. package/load.d.ts +0 -10
  159. package/load.js +0 -31
  160. package/load.mjs +0 -13
@@ -1,24 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { SessionProvider } from "next-auth/react";
3
- import { AppHead } from "../../AppHead";
4
- import { AppMain } from "../AppMain";
5
- import { AppTheme } from "../AppTheme";
6
- /**
7
- * App with authentication provided by `next-auth`
8
- */ export const NextApp = (props)=>{
9
- return /*#__PURE__*/ _jsxs(_Fragment, {
10
- children: [
11
- /*#__PURE__*/ _jsx(AppHead, {}),
12
- /*#__PURE__*/ _jsx(SessionProvider, {
13
- session: props.pageProps.session,
14
- children: /*#__PURE__*/ _jsx(AppTheme, {
15
- ...props,
16
- children: /*#__PURE__*/ _jsx(AppMain, {
17
- ...props
18
- })
19
- })
20
- })
21
- ]
22
- });
23
- };
24
- export default NextApp;
@@ -1,56 +0,0 @@
1
- import type { AppProps } from "next/app";
2
- import { type AppMainProps } from "./AppMain";
3
- import { type AppThemeProps } from "./AppTheme";
4
- export type NextAppProps = AppProps & AppThemeProps & AppMainProps;
5
- /**
6
- * App
7
- *
8
- * @example
9
- *
10
- * ```tsx
11
- * import { NextApp, NextAppProps } from "@koine/next/app/sc/auth";
12
- * import { Favicon, AnalyticsGoogle } from "@koine/next";
13
- * import { theme } from "src/helpers/theme";
14
- * import { Layout, ProgressOverlay } from "src/components/Layout";
15
- * // import "@fontsource/myfont/800.css";
16
- * // import "src/helpers/theme.css";
17
- *
18
- * const motion = () => import("@koine/react/m/max").then((m) => m.default);
19
- *
20
- * export default function App(props: NextAppProps) {
21
- * return (
22
- * <NextApp
23
- * {...props}
24
- * Layout={Layout}
25
- * ProgressOverlay={ProgressOverlay}
26
- * theme={theme}
27
- * motion={motion}
28
- * seo={{
29
- * titleTemplate: "%s | MyApp",
30
- * defaultTitle: "MyApp",
31
- * openGraph: {
32
- * type: "website",
33
- * locale: "en_US",
34
- * url: "https://myapp.com/",
35
- * site_name: "MyApp",
36
- * },
37
- * twitter: {
38
- * handle: "@MklrNl",
39
- * site: "@MyApp",
40
- * cardType: "summary_large_image",
41
- * },
42
- * }}
43
- * pre={
44
- * <>
45
- * <AnalyticsGoogle id="UA-xxxxxxxx-x" />
46
- * <Favicon name="MyApp" color="#000000" />
47
- * </>
48
- * }
49
- * />
50
- * );
51
- * }
52
- *
53
- * ```
54
- */
55
- export declare const NextApp: (props: NextAppProps) => import("react/jsx-runtime").JSX.Element;
56
- export default NextApp;
@@ -1,36 +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
- NextApp: function() {
13
- return NextApp;
14
- },
15
- default: function() {
16
- return _default;
17
- }
18
- });
19
- const _jsxruntime = require("react/jsx-runtime");
20
- const _AppHead = require("../AppHead");
21
- const _AppMain = require("./AppMain");
22
- const _AppTheme = require("./AppTheme");
23
- const NextApp = (props)=>{
24
- return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
25
- children: [
26
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_AppHead.AppHead, {}),
27
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_AppTheme.AppTheme, {
28
- ...props,
29
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_AppMain.AppMain, {
30
- ...props
31
- })
32
- })
33
- ]
34
- });
35
- };
36
- const _default = NextApp;
@@ -1,67 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { AppHead } from "../AppHead";
3
- import { AppMain } from "./AppMain";
4
- import { AppTheme } from "./AppTheme";
5
- /**
6
- * App
7
- *
8
- * @example
9
- *
10
- * ```tsx
11
- * import { NextApp, NextAppProps } from "@koine/next/app/sc/auth";
12
- * import { Favicon, AnalyticsGoogle } from "@koine/next";
13
- * import { theme } from "src/helpers/theme";
14
- * import { Layout, ProgressOverlay } from "src/components/Layout";
15
- * // import "@fontsource/myfont/800.css";
16
- * // import "src/helpers/theme.css";
17
- *
18
- * const motion = () => import("@koine/react/m/max").then((m) => m.default);
19
- *
20
- * export default function App(props: NextAppProps) {
21
- * return (
22
- * <NextApp
23
- * {...props}
24
- * Layout={Layout}
25
- * ProgressOverlay={ProgressOverlay}
26
- * theme={theme}
27
- * motion={motion}
28
- * seo={{
29
- * titleTemplate: "%s | MyApp",
30
- * defaultTitle: "MyApp",
31
- * openGraph: {
32
- * type: "website",
33
- * locale: "en_US",
34
- * url: "https://myapp.com/",
35
- * site_name: "MyApp",
36
- * },
37
- * twitter: {
38
- * handle: "@MklrNl",
39
- * site: "@MyApp",
40
- * cardType: "summary_large_image",
41
- * },
42
- * }}
43
- * pre={
44
- * <>
45
- * <AnalyticsGoogle id="UA-xxxxxxxx-x" />
46
- * <Favicon name="MyApp" color="#000000" />
47
- * </>
48
- * }
49
- * />
50
- * );
51
- * }
52
- *
53
- * ```
54
- */ export const NextApp = (props)=>{
55
- return /*#__PURE__*/ _jsxs(_Fragment, {
56
- children: [
57
- /*#__PURE__*/ _jsx(AppHead, {}),
58
- /*#__PURE__*/ _jsx(AppTheme, {
59
- ...props,
60
- children: /*#__PURE__*/ _jsx(AppMain, {
61
- ...props
62
- })
63
- })
64
- ]
65
- });
66
- };
67
- export default NextApp;
@@ -1,15 +0,0 @@
1
- import NextDocument from "next/document";
2
- /**
3
- * Next Document wrapper for bare projects
4
- *
5
- * @example
6
- *
7
- * in your `myapp/pages/_document.tsx`:
8
- * ```tsx
9
- * export { Document as default } from "@koine/next/document";
10
- * ```
11
- */
12
- export declare class Document extends NextDocument {
13
- render(): import("react/jsx-runtime").JSX.Element;
14
- }
15
- export default Document;
@@ -1,49 +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
- render() {
28
- const { locale, defaultLocale } = this.props.__NEXT_DATA__;
29
- return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_document.Html, {
30
- lang: locale || defaultLocale,
31
- className: "no-js",
32
- children: [
33
- /*#__PURE__*/ (0, _jsxruntime.jsxs)(_document.Head, {
34
- children: [
35
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_Meta.default, {}),
36
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_NoJs.default, {})
37
- ]
38
- }),
39
- /*#__PURE__*/ (0, _jsxruntime.jsxs)("body", {
40
- children: [
41
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_document.Main, {}),
42
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_document.NextScript, {})
43
- ]
44
- })
45
- ]
46
- });
47
- }
48
- };
49
- const _default = Document;
@@ -1,38 +0,0 @@
1
- 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 Meta from "@koine/react/Meta";
5
- import NoJs from "@koine/react/NoJs";
6
- /**
7
- * Next Document wrapper for bare projects
8
- *
9
- * @example
10
- *
11
- * in your `myapp/pages/_document.tsx`:
12
- * ```tsx
13
- * export { Document as default } from "@koine/next/document";
14
- * ```
15
- */ export class Document extends NextDocument {
16
- render() {
17
- const { locale, defaultLocale } = this.props.__NEXT_DATA__;
18
- return /*#__PURE__*/ _jsxs(Html, {
19
- lang: locale || defaultLocale,
20
- className: "no-js",
21
- children: [
22
- /*#__PURE__*/ _jsxs(Head, {
23
- children: [
24
- /*#__PURE__*/ _jsx(Meta, {}),
25
- /*#__PURE__*/ _jsx(NoJs, {})
26
- ]
27
- }),
28
- /*#__PURE__*/ _jsxs("body", {
29
- children: [
30
- /*#__PURE__*/ _jsx(Main, {}),
31
- /*#__PURE__*/ _jsx(NextScript, {})
32
- ]
33
- })
34
- ]
35
- });
36
- }
37
- }
38
- export default Document;
@@ -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;