@koine/next 1.1.10 → 1.1.12

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 (176) hide show
  1. package/AnalyticsGoogle.js +19 -15
  2. package/AnalyticsGoogle.mjs +34 -0
  3. package/DisableErrorOverlay.js +10 -5
  4. package/DisableErrorOverlay.mjs +13 -0
  5. package/DynamicNamespaces.js +7 -3
  6. package/DynamicNamespaces.mjs +8 -0
  7. package/Favicon.js +10 -6
  8. package/Favicon.mjs +6 -0
  9. package/Head.js +7 -3
  10. package/Head.mjs +3 -0
  11. package/Link.d.ts +1 -1
  12. package/Link.js +11 -8
  13. package/Link.mjs +12 -0
  14. package/NextProgress.js +16 -12
  15. package/{node/NextProgress.js → NextProgress.mjs} +12 -16
  16. package/Seo.js +11 -6
  17. package/{node/Seo.js → Seo.mjs} +6 -11
  18. package/SeoDefaults.js +11 -6
  19. package/SeoDefaults.mjs +12 -0
  20. package/T.js +9 -5
  21. package/T.mjs +10 -0
  22. package/ThemeContext.js +6 -3
  23. package/ThemeContext.mjs +7 -0
  24. package/ThemeProvider.js +28 -24
  25. package/{node/ThemeProvider.js → ThemeProvider.mjs} +24 -28
  26. package/TransText.js +7 -3
  27. package/TransText.mjs +3 -0
  28. package/app/AppHead.js +10 -5
  29. package/app/AppHead.mjs +6 -0
  30. package/app/AppMain.js +2 -1
  31. package/app/AppMain.mjs +1 -0
  32. package/app/css/AppMain.js +11 -7
  33. package/app/css/AppMain.mjs +14 -0
  34. package/app/css/AppTheme.js +10 -6
  35. package/app/css/AppTheme.mjs +15 -0
  36. package/app/css/auth/index.js +13 -9
  37. package/app/css/auth/index.mjs +13 -0
  38. package/app/css/auth/package.json +2 -2
  39. package/app/css/index.js +12 -8
  40. package/{node/app/css/index.js → app/css/index.mjs} +8 -12
  41. package/app/css/package.json +2 -2
  42. package/app/em/AppMain.js +16 -12
  43. package/app/em/AppMain.mjs +25 -0
  44. package/app/em/AppTheme.js +16 -12
  45. package/app/em/AppTheme.mjs +19 -0
  46. package/app/em/auth/index.js +13 -9
  47. package/app/em/auth/index.mjs +13 -0
  48. package/app/em/auth/package.json +2 -2
  49. package/app/em/index.js +12 -8
  50. package/app/em/index.mjs +12 -0
  51. package/app/em/package.json +2 -2
  52. package/app/index.js +5 -2
  53. package/app/index.mjs +2 -0
  54. package/app/package.json +2 -2
  55. package/app/sc/AppMain.js +16 -12
  56. package/app/sc/AppMain.mjs +25 -0
  57. package/app/sc/AppTheme.js +11 -7
  58. package/app/sc/AppTheme.mjs +12 -0
  59. package/app/sc/auth/index.js +13 -9
  60. package/app/sc/auth/index.mjs +13 -0
  61. package/app/sc/auth/package.json +2 -2
  62. package/app/sc/index.js +12 -8
  63. package/{node/app/sc/index.js → app/sc/index.mjs} +8 -12
  64. package/app/sc/package.json +2 -2
  65. package/auth/helpers.js +13 -7
  66. package/auth/helpers.mjs +22 -0
  67. package/auth/index.js +7 -4
  68. package/auth/index.mjs +4 -0
  69. package/auth/package.json +2 -2
  70. package/auth/useLogin.js +22 -18
  71. package/auth/useLogin.mjs +50 -0
  72. package/auth/useLoginUrl.js +13 -9
  73. package/auth/useLoginUrl.mjs +12 -0
  74. package/auth/useLogout.js +23 -18
  75. package/auth/useLogout.mjs +53 -0
  76. package/config/index.js +36 -25
  77. package/{node/config/index.js → config/index.mjs} +25 -36
  78. package/config/package.json +2 -2
  79. package/createEmotionCache.js +9 -4
  80. package/createEmotionCache.mjs +9 -0
  81. package/document/Document.js +13 -10
  82. package/document/Document.mjs +28 -0
  83. package/document/css/index.js +18 -15
  84. package/document/css/index.mjs +45 -0
  85. package/document/css/package.json +2 -2
  86. package/document/em/index.js +22 -19
  87. package/document/em/index.mjs +60 -0
  88. package/document/em/package.json +2 -2
  89. package/document/index.js +7 -2
  90. package/document/index.mjs +2 -0
  91. package/document/package.json +2 -2
  92. package/document/sc/index.js +21 -18
  93. package/document/sc/index.mjs +64 -0
  94. package/document/sc/package.json +2 -2
  95. package/getSiteUrl.js +9 -4
  96. package/getSiteUrl.mjs +12 -0
  97. package/getT.js +7 -3
  98. package/{node/getT.js → getT.mjs} +3 -7
  99. package/index.js +31 -28
  100. package/index.mjs +30 -0
  101. package/load.js +6 -2
  102. package/{node/load.js → load.mjs} +2 -6
  103. package/package.json +36 -30
  104. package/revalidate.js +5 -2
  105. package/revalidate.mjs +5 -0
  106. package/seoBuildTags.js +17 -13
  107. package/{node/seoBuildTags.js → seoBuildTags.mjs} +13 -17
  108. package/to.js +6 -2
  109. package/{node/to.js → to.mjs} +2 -6
  110. package/translationAsOptions.js +5 -1
  111. package/{node/translationAsOptions.js → translationAsOptions.mjs} +1 -5
  112. package/types-i18n.js +2 -1
  113. package/{node/types-i18n.js → types-i18n.mjs} +1 -2
  114. package/types-seo.js +2 -1
  115. package/types-seo.mjs +1 -0
  116. package/useBackUrl.js +15 -10
  117. package/useBackUrl.mjs +27 -0
  118. package/useDateFormat.js +17 -13
  119. package/useDateFormat.mjs +38 -0
  120. package/useForm.js +14 -10
  121. package/{node/useForm.js → useForm.mjs} +10 -14
  122. package/useLocale.js +9 -4
  123. package/useLocale.mjs +5 -0
  124. package/useT.js +11 -6
  125. package/{node/useT.js → useT.mjs} +6 -11
  126. package/useTheme.js +8 -4
  127. package/useTheme.mjs +7 -0
  128. package/useTo.js +11 -7
  129. package/useTo.mjs +14 -0
  130. package/NextImg.d.ts +0 -16
  131. package/NextImg.js +0 -20
  132. package/NextImgSmart.d.ts +0 -6
  133. package/NextImgSmart.js +0 -13
  134. package/node/AnalyticsGoogle.js +0 -38
  135. package/node/DisableErrorOverlay.js +0 -18
  136. package/node/DynamicNamespaces.js +0 -12
  137. package/node/Favicon.js +0 -10
  138. package/node/Head.js +0 -7
  139. package/node/Link.js +0 -15
  140. package/node/SeoDefaults.js +0 -17
  141. package/node/T.js +0 -14
  142. package/node/ThemeContext.js +0 -10
  143. package/node/TransText.js +0 -7
  144. package/node/app/AppHead.js +0 -11
  145. package/node/app/AppMain.js +0 -2
  146. package/node/app/css/AppMain.js +0 -18
  147. package/node/app/css/AppTheme.js +0 -19
  148. package/node/app/css/auth/index.js +0 -17
  149. package/node/app/em/AppMain.js +0 -29
  150. package/node/app/em/AppTheme.js +0 -23
  151. package/node/app/em/auth/index.js +0 -17
  152. package/node/app/em/index.js +0 -16
  153. package/node/app/index.js +0 -5
  154. package/node/app/sc/AppMain.js +0 -29
  155. package/node/app/sc/AppTheme.js +0 -16
  156. package/node/app/sc/auth/index.js +0 -17
  157. package/node/auth/helpers.js +0 -28
  158. package/node/auth/index.js +0 -7
  159. package/node/auth/useLogin.js +0 -54
  160. package/node/auth/useLoginUrl.js +0 -16
  161. package/node/auth/useLogout.js +0 -58
  162. package/node/createEmotionCache.js +0 -14
  163. package/node/document/Document.js +0 -31
  164. package/node/document/css/index.js +0 -48
  165. package/node/document/em/index.js +0 -63
  166. package/node/document/index.js +0 -7
  167. package/node/document/sc/index.js +0 -67
  168. package/node/getSiteUrl.js +0 -17
  169. package/node/index.js +0 -33
  170. package/node/revalidate.js +0 -8
  171. package/node/types-seo.js +0 -2
  172. package/node/useBackUrl.js +0 -32
  173. package/node/useDateFormat.js +0 -42
  174. package/node/useLocale.js +0 -10
  175. package/node/useTheme.js +0 -11
  176. package/node/useTo.js +0 -18
package/ThemeProvider.js CHANGED
@@ -1,9 +1,12 @@
1
- import { __assign, __spreadArray } from "tslib";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useCallback, useEffect, useState, memo } from "react";
4
- import NextScript from "next/script";
5
- import isServer from "@koine/utils/isServer";
6
- import { ThemeContext } from "./ThemeContext";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ThemeProvider = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var jsx_runtime_1 = require("react/jsx-runtime");
6
+ var react_1 = require("react");
7
+ var script_1 = tslib_1.__importDefault(require("next/script"));
8
+ var isServer_1 = tslib_1.__importDefault(require("@koine/utils/isServer"));
9
+ var ThemeContext_1 = require("./ThemeContext");
7
10
  var colorSchemes = ["light", "dark"];
8
11
  var MEDIA = "(prefers-color-scheme: dark)";
9
12
  var THEME_STORAGE_KEY = "theme";
@@ -16,19 +19,19 @@ var THEME_STORAGE_KEY = "theme";
16
19
  * nicely with tailwind `dark` class mode as dark theme is supposed to be only
17
20
  * controlled by tailwind modifiers
18
21
  */
19
- export var ThemeProvider = function (_a) {
22
+ var ThemeProvider = function (_a) {
20
23
  var forcedTheme = _a.forcedTheme, _b = _a.disableTransitionOnChange, disableTransitionOnChange = _b === void 0 ? false : _b, _c = _a.enableSystem, enableSystem = _c === void 0 ? true : _c, enableColorScheme = _a.enableColorScheme, _d = _a.themes, themes = _d === void 0 ? ["light", "dark"] : _d, _e = _a.defaultTheme, defaultTheme = _e === void 0 ? enableSystem ? "system" : "light" : _e, _f = _a.attribute, attribute = _f === void 0 ? "data-theme" : _f, value = _a.value, children = _a.children, nonce = _a.nonce;
21
- var _g = useState(function () {
24
+ var _g = (0, react_1.useState)(function () {
22
25
  return getTheme(THEME_STORAGE_KEY, defaultTheme);
23
26
  }), theme = _g[0], setThemeState = _g[1];
24
- var _h = useState(function () {
27
+ var _h = (0, react_1.useState)(function () {
25
28
  return getTheme(THEME_STORAGE_KEY);
26
29
  }), resolvedTheme = _h[0], setResolvedTheme = _h[1];
27
30
  var attrs = !value ? themes : Object.values(value);
28
- var applyTheme = useCallback(function (theme) {
31
+ var applyTheme = (0, react_1.useCallback)(function (theme) {
29
32
  var _a;
30
33
  var resolved = theme;
31
- if (isServer || !resolved)
34
+ if (isServer_1.default || !resolved)
32
35
  return;
33
36
  // If theme is system, resolve it before setting theme
34
37
  if (theme === "system" && enableSystem) {
@@ -69,7 +72,7 @@ export var ThemeProvider = function (_a) {
69
72
  enableSystem,
70
73
  value,
71
74
  ]);
72
- var setTheme = useCallback(function (theme) {
75
+ var setTheme = (0, react_1.useCallback)(function (theme) {
73
76
  setThemeState(theme);
74
77
  // Save to storage
75
78
  try {
@@ -79,7 +82,7 @@ export var ThemeProvider = function (_a) {
79
82
  // Unsupported
80
83
  }
81
84
  }, []);
82
- var handleMediaQuery = useCallback(function (e) {
85
+ var handleMediaQuery = (0, react_1.useCallback)(function (e) {
83
86
  var resolved = getSystemTheme(e);
84
87
  setResolvedTheme(resolved);
85
88
  if (theme === "system" && enableSystem && !forcedTheme) {
@@ -87,7 +90,7 @@ export var ThemeProvider = function (_a) {
87
90
  }
88
91
  }, [theme, enableSystem, forcedTheme, applyTheme]);
89
92
  // Always listen to System preference
90
- useEffect(function () {
93
+ (0, react_1.useEffect)(function () {
91
94
  var media = window.matchMedia(MEDIA);
92
95
  // Intentionally use deprecated listener methods to support iOS & old browsers
93
96
  media.addListener(handleMediaQuery);
@@ -95,7 +98,7 @@ export var ThemeProvider = function (_a) {
95
98
  return function () { return media.removeListener(handleMediaQuery); };
96
99
  }, [handleMediaQuery]);
97
100
  // localStorage event handling
98
- useEffect(function () {
101
+ (0, react_1.useEffect)(function () {
99
102
  var handleStorage = function (e) {
100
103
  if (e.key !== THEME_STORAGE_KEY) {
101
104
  return;
@@ -108,17 +111,17 @@ export var ThemeProvider = function (_a) {
108
111
  return function () { return window.removeEventListener("storage", handleStorage); };
109
112
  }, [defaultTheme, setTheme]);
110
113
  // Whenever theme or forcedTheme changes, apply it
111
- useEffect(function () {
114
+ (0, react_1.useEffect)(function () {
112
115
  applyTheme(forcedTheme !== null && forcedTheme !== void 0 ? forcedTheme : theme);
113
116
  }, [applyTheme, forcedTheme, theme]);
114
- return (_jsxs(ThemeContext.Provider, __assign({ value: {
117
+ return ((0, jsx_runtime_1.jsxs)(ThemeContext_1.ThemeContext.Provider, tslib_1.__assign({ value: {
115
118
  theme: theme,
116
119
  setTheme: setTheme,
117
120
  forcedTheme: forcedTheme,
118
121
  resolvedTheme: theme === "system" ? resolvedTheme : theme,
119
- themes: enableSystem ? __spreadArray(__spreadArray([], themes, true), ["system"], false) : themes,
122
+ themes: enableSystem ? tslib_1.__spreadArray(tslib_1.__spreadArray([], themes, true), ["system"], false) : themes,
120
123
  systemTheme: (enableSystem ? resolvedTheme : undefined),
121
- } }, { children: [_jsx(ThemeScript, __assign({}, {
124
+ } }, { children: [(0, jsx_runtime_1.jsx)(ThemeScript, tslib_1.__assign({}, {
122
125
  forcedTheme: forcedTheme,
123
126
  disableTransitionOnChange: disableTransitionOnChange,
124
127
  enableSystem: enableSystem,
@@ -132,7 +135,8 @@ export var ThemeProvider = function (_a) {
132
135
  nonce: nonce,
133
136
  })), children] })));
134
137
  };
135
- var ThemeScript = memo(function (_a) {
138
+ exports.ThemeProvider = ThemeProvider;
139
+ var ThemeScript = (0, react_1.memo)(function (_a) {
136
140
  var forcedTheme = _a.forcedTheme, attribute = _a.attribute, enableSystem = _a.enableSystem, enableColorScheme = _a.enableColorScheme, defaultTheme = _a.defaultTheme, value = _a.value, attrs = _a.attrs, nonce = _a.nonce;
137
141
  var defaultSystem = defaultTheme === "system";
138
142
  // Code-golfing the amount of characters in the script
@@ -202,13 +206,13 @@ var ThemeScript = memo(function (_a) {
202
206
  // But our script cannot be external because it changes at runtime based on React props
203
207
  // so we trick next/script by passing `src` as a base64 JS script
204
208
  var encodedScript = "data:text/javascript;base64,".concat(encodeBase64(scriptSrc));
205
- return (_jsx(NextScript, { id: "next-theme-script", strategy: "beforeInteractive", src: encodedScript, nonce: nonce }));
209
+ return ((0, jsx_runtime_1.jsx)(script_1.default, { id: "next-theme-script", strategy: "beforeInteractive", src: encodedScript, nonce: nonce }));
206
210
  },
207
211
  // Never re-render this component
208
212
  function () { return true; });
209
213
  // Helpers
210
214
  var getTheme = function (key, fallback) {
211
- if (isServer)
215
+ if (isServer_1.default)
212
216
  return undefined;
213
217
  var theme;
214
218
  try {
@@ -241,6 +245,6 @@ var getSystemTheme = function (e) {
241
245
  return systemTheme;
242
246
  };
243
247
  var encodeBase64 = function (str) {
244
- return isServer ? Buffer.from(str).toString("base64") : btoa(str);
248
+ return isServer_1.default ? Buffer.from(str).toString("base64") : btoa(str);
245
249
  };
246
- export default ThemeProvider;
250
+ exports.default = exports.ThemeProvider;
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ThemeProvider = void 0;
4
- var tslib_1 = require("tslib");
5
- var jsx_runtime_1 = require("react/jsx-runtime");
6
- var react_1 = require("react");
7
- var script_1 = tslib_1.__importDefault(require("next/script"));
8
- var isServer_1 = tslib_1.__importDefault(require("@koine/utils/isServer"));
9
- var ThemeContext_1 = require("./ThemeContext");
1
+ import { __assign, __spreadArray } from "tslib";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useCallback, useEffect, useState, memo } from "react";
4
+ import NextScript from "next/script";
5
+ import isServer from "@koine/utils/isServer";
6
+ import { ThemeContext } from "./ThemeContext";
10
7
  var colorSchemes = ["light", "dark"];
11
8
  var MEDIA = "(prefers-color-scheme: dark)";
12
9
  var THEME_STORAGE_KEY = "theme";
@@ -19,19 +16,19 @@ var THEME_STORAGE_KEY = "theme";
19
16
  * nicely with tailwind `dark` class mode as dark theme is supposed to be only
20
17
  * controlled by tailwind modifiers
21
18
  */
22
- var ThemeProvider = function (_a) {
19
+ export var ThemeProvider = function (_a) {
23
20
  var forcedTheme = _a.forcedTheme, _b = _a.disableTransitionOnChange, disableTransitionOnChange = _b === void 0 ? false : _b, _c = _a.enableSystem, enableSystem = _c === void 0 ? true : _c, enableColorScheme = _a.enableColorScheme, _d = _a.themes, themes = _d === void 0 ? ["light", "dark"] : _d, _e = _a.defaultTheme, defaultTheme = _e === void 0 ? enableSystem ? "system" : "light" : _e, _f = _a.attribute, attribute = _f === void 0 ? "data-theme" : _f, value = _a.value, children = _a.children, nonce = _a.nonce;
24
- var _g = (0, react_1.useState)(function () {
21
+ var _g = useState(function () {
25
22
  return getTheme(THEME_STORAGE_KEY, defaultTheme);
26
23
  }), theme = _g[0], setThemeState = _g[1];
27
- var _h = (0, react_1.useState)(function () {
24
+ var _h = useState(function () {
28
25
  return getTheme(THEME_STORAGE_KEY);
29
26
  }), resolvedTheme = _h[0], setResolvedTheme = _h[1];
30
27
  var attrs = !value ? themes : Object.values(value);
31
- var applyTheme = (0, react_1.useCallback)(function (theme) {
28
+ var applyTheme = useCallback(function (theme) {
32
29
  var _a;
33
30
  var resolved = theme;
34
- if (isServer_1.default || !resolved)
31
+ if (isServer || !resolved)
35
32
  return;
36
33
  // If theme is system, resolve it before setting theme
37
34
  if (theme === "system" && enableSystem) {
@@ -72,7 +69,7 @@ var ThemeProvider = function (_a) {
72
69
  enableSystem,
73
70
  value,
74
71
  ]);
75
- var setTheme = (0, react_1.useCallback)(function (theme) {
72
+ var setTheme = useCallback(function (theme) {
76
73
  setThemeState(theme);
77
74
  // Save to storage
78
75
  try {
@@ -82,7 +79,7 @@ var ThemeProvider = function (_a) {
82
79
  // Unsupported
83
80
  }
84
81
  }, []);
85
- var handleMediaQuery = (0, react_1.useCallback)(function (e) {
82
+ var handleMediaQuery = useCallback(function (e) {
86
83
  var resolved = getSystemTheme(e);
87
84
  setResolvedTheme(resolved);
88
85
  if (theme === "system" && enableSystem && !forcedTheme) {
@@ -90,7 +87,7 @@ var ThemeProvider = function (_a) {
90
87
  }
91
88
  }, [theme, enableSystem, forcedTheme, applyTheme]);
92
89
  // Always listen to System preference
93
- (0, react_1.useEffect)(function () {
90
+ useEffect(function () {
94
91
  var media = window.matchMedia(MEDIA);
95
92
  // Intentionally use deprecated listener methods to support iOS & old browsers
96
93
  media.addListener(handleMediaQuery);
@@ -98,7 +95,7 @@ var ThemeProvider = function (_a) {
98
95
  return function () { return media.removeListener(handleMediaQuery); };
99
96
  }, [handleMediaQuery]);
100
97
  // localStorage event handling
101
- (0, react_1.useEffect)(function () {
98
+ useEffect(function () {
102
99
  var handleStorage = function (e) {
103
100
  if (e.key !== THEME_STORAGE_KEY) {
104
101
  return;
@@ -111,17 +108,17 @@ var ThemeProvider = function (_a) {
111
108
  return function () { return window.removeEventListener("storage", handleStorage); };
112
109
  }, [defaultTheme, setTheme]);
113
110
  // Whenever theme or forcedTheme changes, apply it
114
- (0, react_1.useEffect)(function () {
111
+ useEffect(function () {
115
112
  applyTheme(forcedTheme !== null && forcedTheme !== void 0 ? forcedTheme : theme);
116
113
  }, [applyTheme, forcedTheme, theme]);
117
- return ((0, jsx_runtime_1.jsxs)(ThemeContext_1.ThemeContext.Provider, tslib_1.__assign({ value: {
114
+ return (_jsxs(ThemeContext.Provider, __assign({ value: {
118
115
  theme: theme,
119
116
  setTheme: setTheme,
120
117
  forcedTheme: forcedTheme,
121
118
  resolvedTheme: theme === "system" ? resolvedTheme : theme,
122
- themes: enableSystem ? tslib_1.__spreadArray(tslib_1.__spreadArray([], themes, true), ["system"], false) : themes,
119
+ themes: enableSystem ? __spreadArray(__spreadArray([], themes, true), ["system"], false) : themes,
123
120
  systemTheme: (enableSystem ? resolvedTheme : undefined),
124
- } }, { children: [(0, jsx_runtime_1.jsx)(ThemeScript, tslib_1.__assign({}, {
121
+ } }, { children: [_jsx(ThemeScript, __assign({}, {
125
122
  forcedTheme: forcedTheme,
126
123
  disableTransitionOnChange: disableTransitionOnChange,
127
124
  enableSystem: enableSystem,
@@ -135,8 +132,7 @@ var ThemeProvider = function (_a) {
135
132
  nonce: nonce,
136
133
  })), children] })));
137
134
  };
138
- exports.ThemeProvider = ThemeProvider;
139
- var ThemeScript = (0, react_1.memo)(function (_a) {
135
+ var ThemeScript = memo(function (_a) {
140
136
  var forcedTheme = _a.forcedTheme, attribute = _a.attribute, enableSystem = _a.enableSystem, enableColorScheme = _a.enableColorScheme, defaultTheme = _a.defaultTheme, value = _a.value, attrs = _a.attrs, nonce = _a.nonce;
141
137
  var defaultSystem = defaultTheme === "system";
142
138
  // Code-golfing the amount of characters in the script
@@ -206,13 +202,13 @@ var ThemeScript = (0, react_1.memo)(function (_a) {
206
202
  // But our script cannot be external because it changes at runtime based on React props
207
203
  // so we trick next/script by passing `src` as a base64 JS script
208
204
  var encodedScript = "data:text/javascript;base64,".concat(encodeBase64(scriptSrc));
209
- return ((0, jsx_runtime_1.jsx)(script_1.default, { id: "next-theme-script", strategy: "beforeInteractive", src: encodedScript, nonce: nonce }));
205
+ return (_jsx(NextScript, { id: "next-theme-script", strategy: "beforeInteractive", src: encodedScript, nonce: nonce }));
210
206
  },
211
207
  // Never re-render this component
212
208
  function () { return true; });
213
209
  // Helpers
214
210
  var getTheme = function (key, fallback) {
215
- if (isServer_1.default)
211
+ if (isServer)
216
212
  return undefined;
217
213
  var theme;
218
214
  try {
@@ -245,6 +241,6 @@ var getSystemTheme = function (e) {
245
241
  return systemTheme;
246
242
  };
247
243
  var encodeBase64 = function (str) {
248
- return isServer_1.default ? Buffer.from(str).toString("base64") : btoa(str);
244
+ return isServer ? Buffer.from(str).toString("base64") : btoa(str);
249
245
  };
250
- exports.default = exports.ThemeProvider;
246
+ export default ThemeProvider;
package/TransText.js CHANGED
@@ -1,3 +1,7 @@
1
- import _TransText from "next-translate/TransText";
2
- export var TransText = _TransText;
3
- export default TransText;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TransText = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var TransText_1 = tslib_1.__importDefault(require("next-translate/TransText"));
6
+ exports.TransText = TransText_1.default;
7
+ exports.default = exports.TransText;
package/TransText.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import _TransText from "next-translate/TransText";
2
+ export var TransText = _TransText;
3
+ export default TransText;
package/app/AppHead.js CHANGED
@@ -1,6 +1,11 @@
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" }) }));
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AppHead = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var jsx_runtime_1 = require("react/jsx-runtime");
6
+ var head_1 = tslib_1.__importDefault(require("next/head"));
7
+ var AppHead = function () {
8
+ return ((0, jsx_runtime_1.jsx)(head_1.default, { children: (0, jsx_runtime_1.jsx)("meta", { name: "viewport", content: "width=device-width" }) }));
5
9
  };
6
- export default AppHead;
10
+ exports.AppHead = AppHead;
11
+ exports.default = exports.AppHead;
@@ -0,0 +1,6 @@
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;
package/app/AppMain.js CHANGED
@@ -1 +1,2 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export {};
@@ -1,14 +1,18 @@
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";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AppMain = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var jsx_runtime_1 = require("react/jsx-runtime");
6
+ var react_1 = tslib_1.__importDefault(require("react"));
7
+ var SeoDefaults_1 = require("../../SeoDefaults");
5
8
  /**
6
9
  * App main
7
10
  *
8
11
  * It does not imply any specific styling or animation solution
9
12
  */
10
- export var AppMain = function (_a) {
13
+ var AppMain = function (_a) {
11
14
  var Component = _a.Component, pageProps = _a.pageProps, Layout = _a.Layout, seo = _a.seo, pre = _a.pre, post = _a.post;
12
- return (_jsxs(React.Fragment, { children: [_jsx(SeoDefaults, __assign({}, seo)), pre, _jsx(Layout, { children: _jsx(Component, __assign({}, pageProps)) }), post] }));
15
+ return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(SeoDefaults_1.SeoDefaults, tslib_1.__assign({}, seo)), pre, (0, jsx_runtime_1.jsx)(Layout, { children: (0, jsx_runtime_1.jsx)(Component, tslib_1.__assign({}, pageProps)) }), post] }));
13
16
  };
14
- export default AppMain;
17
+ exports.AppMain = AppMain;
18
+ exports.default = exports.AppMain;
@@ -0,0 +1,14 @@
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";
5
+ /**
6
+ * App main
7
+ *
8
+ * It does not imply any specific styling or animation solution
9
+ */
10
+ export var AppMain = function (_a) {
11
+ var Component = _a.Component, pageProps = _a.pageProps, Layout = _a.Layout, seo = _a.seo, pre = _a.pre, post = _a.post;
12
+ return (_jsxs(React.Fragment, { children: [_jsx(SeoDefaults, __assign({}, seo)), pre, _jsx(Layout, { children: _jsx(Component, __assign({}, pageProps)) }), post] }));
13
+ };
14
+ export default AppMain;
@@ -1,15 +1,19 @@
1
- import { __assign } from "tslib";
2
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AppTheme = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var jsx_runtime_1 = require("react/jsx-runtime");
3
6
  // import { ThemeVanillaProvider, ThemeVanillaValue } from "@koine/react/styles";
4
- import { ThemeProvider } from "../../ThemeProvider";
7
+ var ThemeProvider_1 = require("../../ThemeProvider");
5
8
  /**
6
9
  * App theme with vanilla class based theme (good for `tailwindcss`)
7
10
  */
8
- export var AppTheme = function (_a) {
11
+ var AppTheme = function (_a) {
9
12
  var theme = _a.theme, children = _a.children;
10
13
  // return (
11
14
  // <ThemeVanillaProvider initialTheme={theme}>{children}</ThemeVanillaProvider>
12
15
  // );
13
- return (_jsx(ThemeProvider, __assign({ defaultTheme: theme, attribute: "class" }, { children: children })));
16
+ return ((0, jsx_runtime_1.jsx)(ThemeProvider_1.ThemeProvider, tslib_1.__assign({ defaultTheme: theme, attribute: "class" }, { children: children })));
14
17
  };
15
- export default AppTheme;
18
+ exports.AppTheme = AppTheme;
19
+ exports.default = exports.AppTheme;
@@ -0,0 +1,15 @@
1
+ import { __assign } from "tslib";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ // import { ThemeVanillaProvider, ThemeVanillaValue } from "@koine/react/styles";
4
+ import { ThemeProvider } from "../../ThemeProvider";
5
+ /**
6
+ * App theme with vanilla class based theme (good for `tailwindcss`)
7
+ */
8
+ export var AppTheme = function (_a) {
9
+ var theme = _a.theme, children = _a.children;
10
+ // return (
11
+ // <ThemeVanillaProvider initialTheme={theme}>{children}</ThemeVanillaProvider>
12
+ // );
13
+ return (_jsx(ThemeProvider, __assign({ defaultTheme: theme, attribute: "class" }, { children: children })));
14
+ };
15
+ export default AppTheme;
@@ -1,13 +1,17 @@
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";
5
- import { AppTheme } from "../AppTheme";
6
- import { AppMain } from "../AppMain";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NextApp = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var jsx_runtime_1 = require("react/jsx-runtime");
6
+ var react_1 = require("next-auth/react");
7
+ var AppHead_1 = require("../../AppHead");
8
+ var AppTheme_1 = require("../AppTheme");
9
+ var AppMain_1 = require("../AppMain");
7
10
  /**
8
11
  * App with authentication provided by `next-auth`
9
12
  */
10
- export var NextApp = function (props) {
11
- return (_jsxs(_Fragment, { children: [_jsx(AppHead, {}), _jsx(SessionProvider, __assign({ session: props.pageProps.session }, { children: _jsx(AppTheme, __assign({}, props, { children: _jsx(AppMain, __assign({}, props)) })) }))] }));
13
+ var NextApp = function (props) {
14
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(AppHead_1.AppHead, {}), (0, jsx_runtime_1.jsx)(react_1.SessionProvider, tslib_1.__assign({ session: props.pageProps.session }, { children: (0, jsx_runtime_1.jsx)(AppTheme_1.AppTheme, tslib_1.__assign({}, props, { children: (0, jsx_runtime_1.jsx)(AppMain_1.AppMain, tslib_1.__assign({}, props)) })) }))] }));
12
15
  };
13
- export default NextApp;
16
+ exports.NextApp = NextApp;
17
+ exports.default = exports.NextApp;
@@ -0,0 +1,13 @@
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";
5
+ import { AppTheme } from "../AppTheme";
6
+ import { AppMain } from "../AppMain";
7
+ /**
8
+ * App with authentication provided by `next-auth`
9
+ */
10
+ export var NextApp = function (props) {
11
+ return (_jsxs(_Fragment, { children: [_jsx(AppHead, {}), _jsx(SessionProvider, __assign({ session: props.pageProps.session }, { children: _jsx(AppTheme, __assign({}, props, { children: _jsx(AppMain, __assign({}, props)) })) }))] }));
12
+ };
13
+ export default NextApp;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "sideEffects": false,
3
- "module": "./index.js",
4
- "main": "../../../node/app/css/auth/index.js",
3
+ "module": "./index.mjs",
4
+ "main": "./index.js",
5
5
  "types": "./index.d.ts"
6
6
  }
package/app/css/index.js CHANGED
@@ -1,8 +1,11 @@
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";
4
- import { AppTheme } from "./AppTheme";
5
- import { AppMain } from "./AppMain";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NextApp = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var jsx_runtime_1 = require("react/jsx-runtime");
6
+ var AppHead_1 = require("../AppHead");
7
+ var AppTheme_1 = require("./AppTheme");
8
+ var AppMain_1 = require("./AppMain");
6
9
  /**
7
10
  * App
8
11
  *
@@ -51,7 +54,8 @@ import { AppMain } from "./AppMain";
51
54
  *
52
55
  * ```
53
56
  */
54
- export var NextApp = function (props) {
55
- return (_jsxs(_Fragment, { children: [_jsx(AppHead, {}), _jsx(AppTheme, __assign({}, props, { children: _jsx(AppMain, __assign({}, props)) }))] }));
57
+ var NextApp = function (props) {
58
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(AppHead_1.AppHead, {}), (0, jsx_runtime_1.jsx)(AppTheme_1.AppTheme, tslib_1.__assign({}, props, { children: (0, jsx_runtime_1.jsx)(AppMain_1.AppMain, tslib_1.__assign({}, props)) }))] }));
56
59
  };
57
- export default NextApp;
60
+ exports.NextApp = NextApp;
61
+ exports.default = exports.NextApp;
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NextApp = void 0;
4
- var tslib_1 = require("tslib");
5
- var jsx_runtime_1 = require("react/jsx-runtime");
6
- var AppHead_1 = require("../AppHead");
7
- var AppTheme_1 = require("./AppTheme");
8
- var AppMain_1 = require("./AppMain");
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";
4
+ import { AppTheme } from "./AppTheme";
5
+ import { AppMain } from "./AppMain";
9
6
  /**
10
7
  * App
11
8
  *
@@ -54,8 +51,7 @@ var AppMain_1 = require("./AppMain");
54
51
  *
55
52
  * ```
56
53
  */
57
- var NextApp = function (props) {
58
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(AppHead_1.AppHead, {}), (0, jsx_runtime_1.jsx)(AppTheme_1.AppTheme, tslib_1.__assign({}, props, { children: (0, jsx_runtime_1.jsx)(AppMain_1.AppMain, tslib_1.__assign({}, props)) }))] }));
54
+ export var NextApp = function (props) {
55
+ return (_jsxs(_Fragment, { children: [_jsx(AppHead, {}), _jsx(AppTheme, __assign({}, props, { children: _jsx(AppMain, __assign({}, props)) }))] }));
59
56
  };
60
- exports.NextApp = NextApp;
61
- exports.default = exports.NextApp;
57
+ export default NextApp;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "sideEffects": false,
3
- "module": "./index.js",
4
- "main": "../../node/app/css/index.js",
3
+ "module": "./index.mjs",
4
+ "main": "./index.js",
5
5
  "types": "./index.d.ts"
6
6
  }
package/app/em/AppMain.js CHANGED
@@ -1,11 +1,14 @@
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 { useRouter } from "next/router";
5
- import { AnimatePresence, m } from "framer-motion";
6
- import MotionProvider from "@koine/react/m/MotionProvider";
7
- import { SeoDefaults } from "../../SeoDefaults";
8
- import { NextProgress } from "../../NextProgress";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AppMain = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var react_1 = require("react");
6
+ var jsx_runtime_1 = require("react/jsx-runtime");
7
+ var router_1 = require("next/router");
8
+ var framer_motion_1 = require("framer-motion");
9
+ var MotionProvider_1 = tslib_1.__importDefault(require("@koine/react/m/MotionProvider"));
10
+ var SeoDefaults_1 = require("../../SeoDefaults");
11
+ var NextProgress_1 = require("../../NextProgress");
9
12
  /**
10
13
  * App main
11
14
  *
@@ -13,13 +16,14 @@ import { NextProgress } from "../../NextProgress";
13
16
  *
14
17
  * About the page transition [wallis' blog post](https://wallis.dev/blog/nextjs-page-transitions-with-framer-motion)
15
18
  */
16
- export var AppMain = function (_a) {
19
+ var AppMain = function (_a) {
17
20
  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 ? {
18
21
  initial: { opacity: 0 },
19
22
  animate: { opacity: 1 },
20
23
  exit: { opacity: 0 },
21
24
  } : _b, pre = _a.pre, post = _a.post;
22
- var pathname = useRouter().pathname;
23
- return (_jsxs(_Fragment, { children: [_jsx(SeoDefaults, __assign({}, seo)), pre, _jsxs(MotionProvider, __assign({ features: motion }, { children: [ProgressOverlay && _jsx(NextProgress, { Overlay: ProgressOverlay }), _jsx(Layout, { children: _jsx(AnimatePresence, __assign({ exitBeforeEnter: true, initial: false }, { children: _jsx(m.div, __assign({}, transition, { children: _createElement(Component, __assign({}, pageProps, { key: pathname })) }), pathname) })) })] })), post] }));
25
+ var pathname = (0, router_1.useRouter)().pathname;
26
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SeoDefaults_1.SeoDefaults, tslib_1.__assign({}, seo)), pre, (0, jsx_runtime_1.jsxs)(MotionProvider_1.default, tslib_1.__assign({ features: motion }, { children: [ProgressOverlay && (0, jsx_runtime_1.jsx)(NextProgress_1.NextProgress, { Overlay: ProgressOverlay }), (0, jsx_runtime_1.jsx)(Layout, { children: (0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, tslib_1.__assign({ exitBeforeEnter: true, initial: false }, { children: (0, jsx_runtime_1.jsx)(framer_motion_1.m.div, tslib_1.__assign({}, transition, { children: (0, react_1.createElement)(Component, tslib_1.__assign({}, pageProps, { key: pathname })) }), pathname) })) })] })), post] }));
24
27
  };
25
- export default AppMain;
28
+ exports.AppMain = AppMain;
29
+ exports.default = exports.AppMain;
@@ -0,0 +1,25 @@
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 { useRouter } from "next/router";
5
+ import { AnimatePresence, m } from "framer-motion";
6
+ import MotionProvider from "@koine/react/m/MotionProvider";
7
+ import { SeoDefaults } from "../../SeoDefaults";
8
+ import { NextProgress } from "../../NextProgress";
9
+ /**
10
+ * App main
11
+ *
12
+ * It implies a setup for `styled-components` and `framer-motion` libraries.
13
+ *
14
+ * About the page transition [wallis' blog post](https://wallis.dev/blog/nextjs-page-transitions-with-framer-motion)
15
+ */
16
+ export var AppMain = function (_a) {
17
+ 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 ? {
18
+ initial: { opacity: 0 },
19
+ animate: { opacity: 1 },
20
+ exit: { opacity: 0 },
21
+ } : _b, pre = _a.pre, post = _a.post;
22
+ var pathname = useRouter().pathname;
23
+ return (_jsxs(_Fragment, { children: [_jsx(SeoDefaults, __assign({}, seo)), pre, _jsxs(MotionProvider, __assign({ features: motion }, { children: [ProgressOverlay && _jsx(NextProgress, { Overlay: ProgressOverlay }), _jsx(Layout, { children: _jsx(AnimatePresence, __assign({ exitBeforeEnter: true, initial: false }, { children: _jsx(m.div, __assign({}, transition, { children: _createElement(Component, __assign({}, pageProps, { key: pathname })) }), pathname) })) })] })), post] }));
24
+ };
25
+ export default AppMain;