@koine/next 1.2.3 → 2.0.0-alpha.2

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 (184) hide show
  1. package/{AnalyticsGoogle.d.ts → 12/AnalyticsGoogle.d.ts} +1 -1
  2. package/{AnalyticsGoogle.js → 12/AnalyticsGoogle.js} +2 -1
  3. package/{AnalyticsGoogle.mjs → 12/AnalyticsGoogle.mjs} +2 -2
  4. package/{DisableErrorOverlay.d.ts → 12/DisableErrorOverlay.d.ts} +1 -1
  5. package/{DynamicNamespaces.js → 12/DynamicNamespaces.js} +1 -0
  6. package/{DynamicNamespaces.mjs → 12/DynamicNamespaces.mjs} +1 -0
  7. package/{Favicon.d.ts → 12/Favicon.d.ts} +1 -1
  8. package/{Link.js → 12/Link.js} +1 -1
  9. package/{Link.mjs → 12/Link.mjs} +1 -1
  10. package/{NextProgress.d.ts → 12/NextProgress.d.ts} +1 -1
  11. package/{NextProgress.js → 12/NextProgress.js} +1 -0
  12. package/{NextProgress.mjs → 12/NextProgress.mjs} +1 -0
  13. package/{Seo.d.ts → 12/Seo.d.ts} +1 -1
  14. package/{SeoDefaults.d.ts → 12/SeoDefaults.d.ts} +1 -1
  15. package/{T.d.ts → 12/T.d.ts} +1 -0
  16. package/{T.js → 12/T.js} +1 -0
  17. package/{T.mjs → 12/T.mjs} +1 -0
  18. package/{ThemeProvider.d.ts → 12/ThemeProvider.d.ts} +1 -1
  19. package/{ThemeProvider.js → 12/ThemeProvider.js} +3 -14
  20. package/{ThemeProvider.mjs → 12/ThemeProvider.mjs} +4 -15
  21. package/{TransText.js → 12/TransText.js} +1 -0
  22. package/{TransText.mjs → 12/TransText.mjs} +1 -0
  23. package/12/app/AppHead.d.ts +3 -0
  24. package/{app → 12/app}/css/AppMain.d.ts +1 -1
  25. package/{app → 12/app}/css/AppTheme.d.ts +2 -2
  26. package/{app → 12/app}/css/AppTheme.js +1 -2
  27. package/{app → 12/app}/css/AppTheme.mjs +1 -2
  28. package/12/app/css/auth/index.d.ts +11 -0
  29. package/{app → 12/app}/css/auth/index.js +1 -1
  30. package/{app → 12/app}/css/auth/index.mjs +1 -1
  31. package/{app → 12/app}/css/index.d.ts +1 -1
  32. package/{app/em → 12/app/sc}/AppMain.d.ts +1 -1
  33. package/{app → 12/app}/sc/AppMain.js +1 -1
  34. package/{app → 12/app}/sc/AppMain.mjs +1 -1
  35. package/{app → 12/app}/sc/AppTheme.d.ts +2 -2
  36. package/{app → 12/app}/sc/AppTheme.js +1 -2
  37. package/{app → 12/app}/sc/AppTheme.mjs +1 -2
  38. package/12/app/sc/auth/index.d.ts +11 -0
  39. package/{app/em → 12/app/sc}/auth/index.js +1 -1
  40. package/{app/em → 12/app/sc}/auth/index.mjs +1 -1
  41. package/{app → 12/app}/sc/index.d.ts +4 -4
  42. package/{document → 12/document}/Document.d.ts +1 -2
  43. package/{document → 12/document}/Document.js +1 -1
  44. package/{document → 12/document}/Document.mjs +2 -2
  45. package/{document → 12/document}/css/index.d.ts +1 -2
  46. package/{document → 12/document}/css/index.js +1 -1
  47. package/{document → 12/document}/css/index.mjs +3 -3
  48. package/{document → 12/document}/sc/index.d.ts +2 -3
  49. package/{document → 12/document}/sc/index.js +1 -1
  50. package/{document → 12/document}/sc/index.mjs +1 -1
  51. package/{getT.js → 12/getT.js} +2 -1
  52. package/{getT.mjs → 12/getT.mjs} +1 -0
  53. package/12/index.d.ts +24 -0
  54. package/12/index.js +52 -0
  55. package/12/index.mjs +27 -0
  56. package/{types-i18n.d.ts → 12/types-i18n.d.ts} +1 -1
  57. package/{useBackUrl.js → 12/useBackUrl.js} +1 -0
  58. package/{useBackUrl.mjs → 12/useBackUrl.mjs} +1 -0
  59. package/{useDateFormat.js → 12/useDateFormat.js} +1 -0
  60. package/{useDateFormat.mjs → 12/useDateFormat.mjs} +1 -0
  61. package/{useForm.d.ts → 12/useForm.d.ts} +1 -1
  62. package/{useForm.js → 12/useForm.js} +1 -0
  63. package/{useForm.mjs → 12/useForm.mjs} +1 -0
  64. package/{useLocale.js → 12/useLocale.js} +1 -0
  65. package/{useLocale.mjs → 12/useLocale.mjs} +1 -0
  66. package/12/useT.d.ts +4 -0
  67. package/{useT.js → 12/useT.js} +21 -16
  68. package/12/useT.mjs +21 -0
  69. package/{useTheme.js → 12/useTheme.js} +1 -0
  70. package/{useTheme.mjs → 12/useTheme.mjs} +1 -0
  71. package/{useTo.js → 12/useTo.js} +1 -0
  72. package/{useTo.mjs → 12/useTo.mjs} +1 -0
  73. package/index.d.ts +2 -28
  74. package/index.js +5 -31
  75. package/index.mjs +2 -30
  76. package/package.json +13 -30
  77. package/typings.d.ts +0 -87
  78. package/Head.d.ts +0 -3
  79. package/Head.js +0 -7
  80. package/Head.mjs +0 -3
  81. package/app/AppHead.d.ts +0 -3
  82. package/app/css/auth/index.d.ts +0 -11
  83. package/app/em/AppMain.js +0 -29
  84. package/app/em/AppMain.mjs +0 -25
  85. package/app/em/AppTheme.d.ts +0 -16
  86. package/app/em/AppTheme.js +0 -23
  87. package/app/em/AppTheme.mjs +0 -19
  88. package/app/em/auth/index.d.ts +0 -11
  89. package/app/em/index.d.ts +0 -9
  90. package/app/em/index.js +0 -16
  91. package/app/em/index.mjs +0 -12
  92. package/app/sc/AppMain.d.ts +0 -11
  93. package/app/sc/auth/index.d.ts +0 -11
  94. package/app/sc/auth/index.js +0 -17
  95. package/app/sc/auth/index.mjs +0 -13
  96. package/auth/helpers.d.ts +0 -17
  97. package/auth/helpers.js +0 -28
  98. package/auth/helpers.mjs +0 -22
  99. package/auth/index.d.ts +0 -4
  100. package/auth/index.js +0 -7
  101. package/auth/index.mjs +0 -4
  102. package/auth/useLogin.d.ts +0 -8
  103. package/auth/useLogin.js +0 -54
  104. package/auth/useLogin.mjs +0 -50
  105. package/auth/useLoginUrl.d.ts +0 -2
  106. package/auth/useLoginUrl.js +0 -16
  107. package/auth/useLoginUrl.mjs +0 -12
  108. package/auth/useLogout.d.ts +0 -7
  109. package/auth/useLogout.js +0 -58
  110. package/auth/useLogout.mjs +0 -53
  111. package/createEmotionCache.d.ts +0 -6
  112. package/createEmotionCache.js +0 -14
  113. package/createEmotionCache.mjs +0 -9
  114. package/document/em/index.d.ts +0 -16
  115. package/document/em/index.js +0 -63
  116. package/document/em/index.mjs +0 -60
  117. package/document/em/package.json +0 -6
  118. package/document/package.json +0 -6
  119. package/document/sc/package.json +0 -6
  120. package/revalidate.d.ts +0 -5
  121. package/revalidate.js +0 -8
  122. package/revalidate.mjs +0 -5
  123. package/useT.d.ts +0 -17
  124. package/useT.mjs +0 -34
  125. /package/{DisableErrorOverlay.js → 12/DisableErrorOverlay.js} +0 -0
  126. /package/{DisableErrorOverlay.mjs → 12/DisableErrorOverlay.mjs} +0 -0
  127. /package/{DynamicNamespaces.d.ts → 12/DynamicNamespaces.d.ts} +0 -0
  128. /package/{Favicon.js → 12/Favicon.js} +0 -0
  129. /package/{Favicon.mjs → 12/Favicon.mjs} +0 -0
  130. /package/{Link.d.ts → 12/Link.d.ts} +0 -0
  131. /package/{Seo.js → 12/Seo.js} +0 -0
  132. /package/{Seo.mjs → 12/Seo.mjs} +0 -0
  133. /package/{SeoDefaults.js → 12/SeoDefaults.js} +0 -0
  134. /package/{SeoDefaults.mjs → 12/SeoDefaults.mjs} +0 -0
  135. /package/{ThemeContext.d.ts → 12/ThemeContext.d.ts} +0 -0
  136. /package/{ThemeContext.js → 12/ThemeContext.js} +0 -0
  137. /package/{ThemeContext.mjs → 12/ThemeContext.mjs} +0 -0
  138. /package/{TransText.d.ts → 12/TransText.d.ts} +0 -0
  139. /package/{app → 12/app}/AppHead.js +0 -0
  140. /package/{app → 12/app}/AppHead.mjs +0 -0
  141. /package/{app → 12/app}/AppMain.d.ts +0 -0
  142. /package/{app → 12/app}/AppMain.js +0 -0
  143. /package/{app → 12/app}/AppMain.mjs +0 -0
  144. /package/{app → 12/app}/css/AppMain.js +0 -0
  145. /package/{app → 12/app}/css/AppMain.mjs +0 -0
  146. /package/{app → 12/app}/css/auth/package.json +0 -0
  147. /package/{app → 12/app}/css/index.js +0 -0
  148. /package/{app → 12/app}/css/index.mjs +0 -0
  149. /package/{app → 12/app}/css/package.json +0 -0
  150. /package/{app → 12/app}/index.d.ts +0 -0
  151. /package/{app → 12/app}/index.js +0 -0
  152. /package/{app → 12/app}/index.mjs +0 -0
  153. /package/{app/em/auth → 12/app}/package.json +0 -0
  154. /package/{app/em → 12/app/sc/auth}/package.json +0 -0
  155. /package/{app → 12/app}/sc/index.js +0 -0
  156. /package/{app → 12/app}/sc/index.mjs +0 -0
  157. /package/{app → 12/app/sc}/package.json +0 -0
  158. /package/{app/sc/auth → 12/document/css}/package.json +0 -0
  159. /package/{document → 12/document}/index.d.ts +0 -0
  160. /package/{document → 12/document}/index.js +0 -0
  161. /package/{document → 12/document}/index.mjs +0 -0
  162. /package/{app/sc → 12/document}/package.json +0 -0
  163. /package/{auth → 12/document/sc}/package.json +0 -0
  164. /package/{getT.d.ts → 12/getT.d.ts} +0 -0
  165. /package/{document/css → 12}/package.json +0 -0
  166. /package/{seoBuildTags.d.ts → 12/seoBuildTags.d.ts} +0 -0
  167. /package/{seoBuildTags.js → 12/seoBuildTags.js} +0 -0
  168. /package/{seoBuildTags.mjs → 12/seoBuildTags.mjs} +0 -0
  169. /package/{to.d.ts → 12/to.d.ts} +0 -0
  170. /package/{to.js → 12/to.js} +0 -0
  171. /package/{to.mjs → 12/to.mjs} +0 -0
  172. /package/{translationAsOptions.d.ts → 12/translationAsOptions.d.ts} +0 -0
  173. /package/{translationAsOptions.js → 12/translationAsOptions.js} +0 -0
  174. /package/{translationAsOptions.mjs → 12/translationAsOptions.mjs} +0 -0
  175. /package/{types-i18n.js → 12/types-i18n.js} +0 -0
  176. /package/{types-i18n.mjs → 12/types-i18n.mjs} +0 -0
  177. /package/{types-seo.d.ts → 12/types-seo.d.ts} +0 -0
  178. /package/{types-seo.js → 12/types-seo.js} +0 -0
  179. /package/{types-seo.mjs → 12/types-seo.mjs} +0 -0
  180. /package/{useBackUrl.d.ts → 12/useBackUrl.d.ts} +0 -0
  181. /package/{useDateFormat.d.ts → 12/useDateFormat.d.ts} +0 -0
  182. /package/{useLocale.d.ts → 12/useLocale.d.ts} +0 -0
  183. /package/{useTheme.d.ts → 12/useTheme.d.ts} +0 -0
  184. /package/{useTo.d.ts → 12/useTo.d.ts} +0 -0
@@ -1,63 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Document = void 0;
4
- var tslib_1 = require("tslib");
5
- var jsx_runtime_1 = require("react/jsx-runtime");
6
- var document_1 = tslib_1.__importStar(require("next/document"));
7
- var Meta_1 = tslib_1.__importDefault(require("@koine/react/Meta"));
8
- var NoJs_1 = tslib_1.__importDefault(require("@koine/react/NoJs"));
9
- var create_instance_1 = tslib_1.__importDefault(require("@emotion/server/create-instance"));
10
- var createEmotionCache_1 = require("../../createEmotionCache");
11
- /**
12
- * Next Document wrapper for `emotion` based projects
13
- *
14
- * @example
15
- *
16
- * in your `myapp/pages/_document.tsx`:
17
- * ```tsx
18
- * export { Document as default } from "@koine/next/document/em";
19
- * ```
20
- */
21
- var Document = /** @class */ (function (_super) {
22
- tslib_1.__extends(Document, _super);
23
- function Document() {
24
- return _super !== null && _super.apply(this, arguments) || this;
25
- }
26
- Document.prototype.render = function () {
27
- var _a = this.props.__NEXT_DATA__, locale = _a.locale, defaultLocale = _a.defaultLocale;
28
- return ((0, jsx_runtime_1.jsxs)(document_1.Html, tslib_1.__assign({ lang: locale || defaultLocale, className: "no-js" }, { children: [(0, jsx_runtime_1.jsxs)(document_1.Head, { children: [(0, jsx_runtime_1.jsx)(Meta_1.default, {}), (0, jsx_runtime_1.jsx)(NoJs_1.default, {}), this.props.emotionStyleTags] }), (0, jsx_runtime_1.jsxs)("body", { children: [(0, jsx_runtime_1.jsx)(document_1.Main, {}), (0, jsx_runtime_1.jsx)(document_1.NextScript, {})] })] })));
29
- };
30
- return Document;
31
- }(document_1.default));
32
- exports.Document = Document;
33
- // `getInitialProps` belongs to `_document` (instead of `_app`),
34
- // it's compatible with static-site generation (SSG).
35
- Document.getInitialProps = function (ctx) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
36
- var originalRenderPage, cache, extractCriticalToChunks, initialProps, emotionStyles, emotionStyleTags;
37
- return tslib_1.__generator(this, function (_a) {
38
- switch (_a.label) {
39
- case 0:
40
- originalRenderPage = ctx.renderPage;
41
- cache = (0, createEmotionCache_1.createEmotionCache)();
42
- extractCriticalToChunks = (0, create_instance_1.default)(cache).extractCriticalToChunks;
43
- ctx.renderPage = function () {
44
- return originalRenderPage({
45
- enhanceApp: function (App) {
46
- return function EnhanceApp(props) {
47
- return (0, jsx_runtime_1.jsx)(App, tslib_1.__assign({ emotionCache: cache }, props));
48
- };
49
- },
50
- });
51
- };
52
- return [4 /*yield*/, Document.getInitialProps(ctx)];
53
- case 1:
54
- initialProps = _a.sent();
55
- emotionStyles = extractCriticalToChunks(initialProps.html);
56
- emotionStyleTags = emotionStyles.styles.map(function (style) { return ((0, jsx_runtime_1.jsx)("style", { "data-emotion": "".concat(style.key, " ").concat(style.ids.join(" ")),
57
- // eslint-disable-next-line react/no-danger
58
- dangerouslySetInnerHTML: { __html: style.css } }, style.key)); });
59
- return [2 /*return*/, tslib_1.__assign(tslib_1.__assign({}, initialProps), { emotionStyleTags: emotionStyleTags })];
60
- }
61
- });
62
- }); };
63
- exports.default = Document;
@@ -1,60 +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, { Html, Head, Main, NextScript } from "next/document";
4
- import Meta from "@koine/react/Meta";
5
- import NoJs from "@koine/react/NoJs";
6
- import createEmotionServer from "@emotion/server/create-instance";
7
- import { createEmotionCache } from "../../createEmotionCache";
8
- /**
9
- * Next Document wrapper for `emotion` based projects
10
- *
11
- * @example
12
- *
13
- * in your `myapp/pages/_document.tsx`:
14
- * ```tsx
15
- * export { Document as default } from "@koine/next/document/em";
16
- * ```
17
- */
18
- var Document = /** @class */ (function (_super) {
19
- __extends(Document, _super);
20
- function Document() {
21
- return _super !== null && _super.apply(this, arguments) || this;
22
- }
23
- Document.prototype.render = function () {
24
- var _a = this.props.__NEXT_DATA__, locale = _a.locale, defaultLocale = _a.defaultLocale;
25
- return (_jsxs(Html, __assign({ lang: locale || defaultLocale, className: "no-js" }, { children: [_jsxs(Head, { children: [_jsx(Meta, {}), _jsx(NoJs, {}), this.props.emotionStyleTags] }), _jsxs("body", { children: [_jsx(Main, {}), _jsx(NextScript, {})] })] })));
26
- };
27
- return Document;
28
- }(NextDocument));
29
- export { Document };
30
- // `getInitialProps` belongs to `_document` (instead of `_app`),
31
- // it's compatible with static-site generation (SSG).
32
- Document.getInitialProps = function (ctx) { return __awaiter(void 0, void 0, void 0, function () {
33
- var originalRenderPage, cache, extractCriticalToChunks, initialProps, emotionStyles, emotionStyleTags;
34
- return __generator(this, function (_a) {
35
- switch (_a.label) {
36
- case 0:
37
- originalRenderPage = ctx.renderPage;
38
- cache = createEmotionCache();
39
- extractCriticalToChunks = createEmotionServer(cache).extractCriticalToChunks;
40
- ctx.renderPage = function () {
41
- return originalRenderPage({
42
- enhanceApp: function (App) {
43
- return function EnhanceApp(props) {
44
- return _jsx(App, __assign({ emotionCache: cache }, props));
45
- };
46
- },
47
- });
48
- };
49
- return [4 /*yield*/, Document.getInitialProps(ctx)];
50
- case 1:
51
- initialProps = _a.sent();
52
- emotionStyles = extractCriticalToChunks(initialProps.html);
53
- emotionStyleTags = emotionStyles.styles.map(function (style) { return (_jsx("style", { "data-emotion": "".concat(style.key, " ").concat(style.ids.join(" ")),
54
- // eslint-disable-next-line react/no-danger
55
- dangerouslySetInnerHTML: { __html: style.css } }, style.key)); });
56
- return [2 /*return*/, __assign(__assign({}, initialProps), { emotionStyleTags: emotionStyleTags })];
57
- }
58
- });
59
- }); };
60
- export default Document;
@@ -1,6 +0,0 @@
1
- {
2
- "sideEffects": false,
3
- "module": "./index.mjs",
4
- "main": "./index.js",
5
- "types": "./index.d.ts"
6
- }
@@ -1,6 +0,0 @@
1
- {
2
- "sideEffects": false,
3
- "module": "./index.mjs",
4
- "main": "./index.js",
5
- "types": "./index.d.ts"
6
- }
@@ -1,6 +0,0 @@
1
- {
2
- "sideEffects": false,
3
- "module": "./index.mjs",
4
- "main": "./index.js",
5
- "types": "./index.d.ts"
6
- }
package/revalidate.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export declare const revalidate: {
2
- oneHour: number;
3
- onDay: number;
4
- };
5
- export default revalidate;
package/revalidate.js DELETED
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.revalidate = void 0;
4
- exports.revalidate = {
5
- oneHour: 3600,
6
- onDay: 84000,
7
- };
8
- exports.default = exports.revalidate;
package/revalidate.mjs DELETED
@@ -1,5 +0,0 @@
1
- export var revalidate = {
2
- oneHour: 3600,
3
- onDay: 84000,
4
- };
5
- export default revalidate;
package/useT.d.ts DELETED
@@ -1,17 +0,0 @@
1
- import type { TranslateNamespace, TranslateDefault, TranslateNamespaced } from "./types-i18n";
2
- /**
3
- * Wrap `next-translate` useTranslations for type safety and adds TranslationShortcut
4
- * as second/thir argument.
5
- *
6
- * @see https://github.com/vinissimus/next-translate/issues/513#issuecomment-779826418
7
- *
8
- * About the typescript support for translation strings see:
9
- * - https://github.com/vinissimus/next-translate/issues/721
10
- *
11
- * **NOTE**: To make typescript work nicely here make sure to enable
12
- * [`resolveJsonModule`](https://www.typescriptlang.org/tsconfig#resolveJsonModule)
13
- * in your `tsconfig.json` file.
14
- */
15
- export declare function useT(): TranslateDefault;
16
- export declare function useT<TNamespace extends TranslateNamespace>(namespace: TNamespace): TranslateNamespaced<TNamespace>;
17
- export default useT;
package/useT.mjs DELETED
@@ -1,34 +0,0 @@
1
- import { useMemo } from "react";
2
- import useTranslation from "next-translate/useTranslation";
3
- export function useT(namespace) {
4
- var t = useTranslation().t;
5
- var tMemoized = useMemo(function () {
6
- return function (s, q, o) {
7
- return t(namespace ? "".concat(namespace, ":").concat(s) : "".concat(s), q === "obj" || q === "" ? null : q, q === "obj" || o === "obj"
8
- ? { returnObjects: true }
9
- : q === "" || o === ""
10
- ? { fallback: "" }
11
- : o
12
- // ) as TReturn extends (undefined | never | unknown) ? TranslateReturn<TranslationQuery, TranslationOptions> : TReturn;
13
- );
14
- };
15
- }, [t, namespace]);
16
- return tMemoized;
17
- }
18
- export default useT;
19
- // Instead of wrapping the `useTranslation` hook from [`next-translate`](https://github.com/vinissimus/next-translate/blob/master/src/useTranslation.tsx)
20
- // we might just rewrite it with our custom implementation but the `_context`
21
- // to use is not exposed by the library...
22
- // import { useContext, useMemo } from "react"
23
- // import wrapTWithDefaultNs from "next-translate/lib/cjs/wrapTWithDefaultNs";
24
- // import I18nContext from "next-translate/lib/cjs/_context";
25
- // export default function useTranslation(defaultNS?: string): I18n {
26
- // const ctx = useContext(I18nContext)
27
- // return useMemo(
28
- // () => ({
29
- // ...ctx,
30
- // t: wrapTWithDefaultNs(ctx.t, defaultNS),
31
- // }),
32
- // [ctx.lang, defaultNS]
33
- // )
34
- // }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes