@koine/next 1.0.44 → 1.0.47

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/{Analytics/AnalyticsGoogle.d.ts → AnalyticsGoogle.d.ts} +1 -0
  2. package/{Analytics/AnalyticsGoogle.js → AnalyticsGoogle.js} +1 -0
  3. package/DynamicNamespaces.d.ts +13 -0
  4. package/DynamicNamespaces.js +8 -0
  5. package/{Favicon/Favicon.d.ts → Favicon.d.ts} +1 -0
  6. package/{Favicon/Favicon.js → Favicon.js} +1 -0
  7. package/Head.d.ts +3 -0
  8. package/Head.js +3 -0
  9. package/Link.d.ts +10 -0
  10. package/{Link/Link.js → Link.js} +1 -0
  11. package/{Img/Img.d.ts → NextImg.d.ts} +2 -6
  12. package/{Img/Img.js → NextImg.js} +2 -10
  13. package/NextImgSmart.d.ts +6 -0
  14. package/NextImgSmart.js +13 -0
  15. package/{NextProgress/NextProgress.d.ts → NextProgress.d.ts} +1 -1
  16. package/{NextProgress/NextProgress.js → NextProgress.js} +1 -0
  17. package/Seo.d.ts +27 -0
  18. package/Seo.js +16 -0
  19. package/SeoDefaults.d.ts +11 -0
  20. package/{Seo/SeoDefaults.js → SeoDefaults.js} +3 -2
  21. package/{i18n/T/index.d.ts → T.d.ts} +1 -1
  22. package/{i18n/T/index.js → T.js} +0 -0
  23. package/app/AppMain.d.ts +1 -1
  24. package/app/css/AppMain.js +1 -1
  25. package/app/css/AppTheme.d.ts +1 -1
  26. package/app/css/AppTheme.js +1 -1
  27. package/app/em/AppMain.js +1 -1
  28. package/app/em/AppTheme.js +1 -1
  29. package/app/sc/AppMain.js +1 -1
  30. package/{Auth → auth}/helpers.d.ts +1 -1
  31. package/{Auth → auth}/helpers.js +0 -0
  32. package/{Auth → auth}/index.d.ts +0 -0
  33. package/{Auth → auth}/index.js +0 -0
  34. package/{Head → auth}/package.json +1 -1
  35. package/{Auth → auth}/useLogin.d.ts +1 -0
  36. package/{Auth → auth}/useLogin.js +2 -1
  37. package/{Auth → auth}/useLoginUrl.d.ts +1 -0
  38. package/{Auth → auth}/useLoginUrl.js +2 -1
  39. package/{Auth → auth}/useLogout.d.ts +1 -0
  40. package/{Auth → auth}/useLogout.js +2 -1
  41. package/config/index.d.ts +3 -3
  42. package/config/index.js +20 -10
  43. package/{utils/emotion-cache.d.ts → createEmotionCache.d.ts} +1 -0
  44. package/{utils/emotion-cache.js → createEmotionCache.js} +1 -0
  45. package/document/em/index.js +1 -1
  46. package/getSiteUrl.d.ts +8 -0
  47. package/getSiteUrl.js +12 -0
  48. package/{i18n/getT/index.d.ts → getT.d.ts} +2 -1
  49. package/{i18n/getT/index.js → getT.js} +1 -0
  50. package/index.d.ts +21 -7
  51. package/index.js +23 -7
  52. package/{utils/index.d.ts → load.d.ts} +1 -9
  53. package/{utils/index.js → load.js} +1 -13
  54. package/node/{Analytics/AnalyticsGoogle.js → AnalyticsGoogle.js} +1 -0
  55. package/node/DynamicNamespaces.js +12 -0
  56. package/node/{Favicon/Favicon.js → Favicon.js} +1 -0
  57. package/node/Head.js +7 -0
  58. package/node/{Link/Link.js → Link.js} +1 -0
  59. package/node/{Img/Img.js → NextImg.js} +2 -11
  60. package/node/NextImgSmart.js +17 -0
  61. package/node/{NextProgress/NextProgress.js → NextProgress.js} +1 -0
  62. package/node/{Seo/Seo.js → Seo.js} +10 -2
  63. package/node/{Seo/SeoDefaults.js → SeoDefaults.js} +3 -2
  64. package/node/{i18n/T/index.js → T.js} +0 -0
  65. package/node/app/css/AppMain.js +2 -2
  66. package/node/app/css/AppTheme.js +2 -2
  67. package/node/app/em/AppMain.js +2 -2
  68. package/node/app/em/AppTheme.js +2 -2
  69. package/node/app/sc/AppMain.js +2 -2
  70. package/node/{Auth → auth}/helpers.js +0 -0
  71. package/node/{Auth → auth}/index.js +0 -0
  72. package/node/{Auth → auth}/useLogin.js +3 -2
  73. package/node/{Auth → auth}/useLoginUrl.js +3 -2
  74. package/node/{Auth → auth}/useLogout.js +3 -2
  75. package/node/config/index.js +20 -10
  76. package/node/{utils/emotion-cache.js → createEmotionCache.js} +1 -0
  77. package/node/document/em/index.js +2 -2
  78. package/node/getSiteUrl.js +16 -0
  79. package/node/{i18n/getT/index.js → getT.js} +1 -0
  80. package/node/index.js +23 -7
  81. package/node/{utils/index.js → load.js} +2 -15
  82. package/node/revalidate.js +8 -0
  83. package/node/{Seo/helpers.js → seoBuildTags.js} +7 -5
  84. package/node/to.js +29 -0
  85. package/node/{i18n/translationAsOptions/index.js → translationAsOptions.js} +0 -0
  86. package/node/{i18n/types.js → types-i18n.js} +0 -0
  87. package/node/types-seo.js +2 -0
  88. package/node/useBackUrl.js +31 -0
  89. package/node/{i18n/useDateFormat/index.js → useDateFormat.js} +0 -0
  90. package/node/{Forms/useForm.js → useForm.js} +0 -0
  91. package/node/{i18n/useLocale/index.js → useLocale.js} +0 -0
  92. package/node/{i18n/useT/index.js → useT.js} +0 -0
  93. package/node/{Theme/Theme.js → useTheme.js} +7 -0
  94. package/node/useTo.js +18 -0
  95. package/package.json +5 -5
  96. package/revalidate.d.ts +5 -0
  97. package/revalidate.js +5 -0
  98. package/seoBuildTags.d.ts +21 -0
  99. package/{Seo/helpers.js → seoBuildTags.js} +5 -3
  100. package/to.d.ts +24 -0
  101. package/to.js +25 -0
  102. package/{i18n/translationAsOptions/index.d.ts → translationAsOptions.d.ts} +1 -1
  103. package/{i18n/translationAsOptions/index.js → translationAsOptions.js} +0 -0
  104. package/{i18n/types.d.ts → types-i18n.d.ts} +6 -0
  105. package/{i18n/types.js → types-i18n.js} +0 -0
  106. package/types-seo.d.ts +7 -0
  107. package/types-seo.js +1 -0
  108. package/useBackUrl.d.ts +2 -0
  109. package/useBackUrl.js +27 -0
  110. package/{i18n/useDateFormat/index.d.ts → useDateFormat.d.ts} +0 -0
  111. package/{i18n/useDateFormat/index.js → useDateFormat.js} +0 -0
  112. package/{Forms/useForm.d.ts → useForm.d.ts} +1 -1
  113. package/{Forms/useForm.js → useForm.js} +0 -0
  114. package/{i18n/useLocale/index.d.ts → useLocale.d.ts} +0 -0
  115. package/{i18n/useLocale/index.js → useLocale.js} +0 -0
  116. package/{i18n/useT/index.d.ts → useT.d.ts} +1 -1
  117. package/{i18n/useT/index.js → useT.js} +0 -0
  118. package/{Theme/Theme.d.ts → useTheme.d.ts} +8 -13
  119. package/{Theme/Theme.js → useTheme.js} +7 -0
  120. package/useTo.d.ts +3 -0
  121. package/useTo.js +14 -0
  122. package/Analytics/index.d.ts +0 -1
  123. package/Analytics/index.js +0 -1
  124. package/Analytics/package.json +0 -6
  125. package/Auth/package.json +0 -6
  126. package/Favicon/index.d.ts +0 -1
  127. package/Favicon/index.js +0 -1
  128. package/Favicon/package.json +0 -6
  129. package/Forms/index.d.ts +0 -1
  130. package/Forms/index.js +0 -1
  131. package/Forms/package.json +0 -6
  132. package/Head/Head.d.ts +0 -1
  133. package/Head/Head.js +0 -1
  134. package/Head/index.d.ts +0 -1
  135. package/Head/index.js +0 -1
  136. package/Img/index.d.ts +0 -1
  137. package/Img/index.js +0 -1
  138. package/Img/package.json +0 -6
  139. package/Link/Link.d.ts +0 -9
  140. package/Link/index.d.ts +0 -1
  141. package/Link/index.js +0 -1
  142. package/Link/package.json +0 -6
  143. package/NextProgress/index.d.ts +0 -2
  144. package/NextProgress/index.js +0 -1
  145. package/NextProgress/package.json +0 -6
  146. package/Seo/Seo.d.ts +0 -3
  147. package/Seo/Seo.js +0 -8
  148. package/Seo/SeoDefaults.d.ts +0 -3
  149. package/Seo/helpers.d.ts +0 -48
  150. package/Seo/index.d.ts +0 -12
  151. package/Seo/index.js +0 -12
  152. package/Seo/package.json +0 -6
  153. package/Theme/index.d.ts +0 -1
  154. package/Theme/index.js +0 -1
  155. package/Theme/package.json +0 -6
  156. package/i18n/T/package.json +0 -6
  157. package/i18n/getT/package.json +0 -6
  158. package/i18n/index.d.ts +0 -7
  159. package/i18n/index.js +0 -7
  160. package/i18n/package.json +0 -6
  161. package/i18n/translationAsOptions/package.json +0 -6
  162. package/i18n/useDateFormat/package.json +0 -6
  163. package/i18n/useLocale/package.json +0 -6
  164. package/i18n/useT/package.json +0 -6
  165. package/node/Analytics/index.js +0 -4
  166. package/node/Favicon/index.js +0 -4
  167. package/node/Forms/index.js +0 -4
  168. package/node/Head/Head.js +0 -5
  169. package/node/Head/index.js +0 -4
  170. package/node/Img/index.js +0 -4
  171. package/node/Link/index.js +0 -4
  172. package/node/NextProgress/index.js +0 -5
  173. package/node/Seo/index.js +0 -15
  174. package/node/Theme/index.js +0 -4
  175. package/node/i18n/index.js +0 -10
  176. package/utils/package.json +0 -6
@@ -3,3 +3,4 @@ export declare type AnalyticsGoogleProps = {
3
3
  id?: string;
4
4
  };
5
5
  export declare const AnalyticsGoogle: ({ id }: AnalyticsGoogleProps) => JSX.Element | null;
6
+ export default AnalyticsGoogle;
@@ -31,3 +31,4 @@ export var AnalyticsGoogle = function (_a) {
31
31
  }
32
32
  return (_jsxs(_Fragment, { children: [_jsx(Script, { id: "google-tagmanager", src: "https://www.googletagmanager.com/gtag/js?id=".concat(id), strategy: "afterInteractive", onLoad: function () { return setReady(true); } }), _jsx(Script, __assign({ id: "google-analytics", strategy: "afterInteractive" }, { children: "\n window.dataLayer = window.dataLayer || [];\n function gtag(){window.dataLayer.push(arguments);}\n gtag('js', new Date());\n\n gtag('config', '".concat(id, "', { 'send_page_view': false });\n ") }))] }));
33
33
  };
34
+ export default AnalyticsGoogle;
@@ -0,0 +1,13 @@
1
+ import BaseDynamicNamespaces from "next-translate/DynamicNamespaces";
2
+ import type { DynamicNamespacesProps as BaseDynamicNamespacesProps } from "next-translate";
3
+ import type { TranslateNamespace } from "./types-i18n";
4
+ export declare type DynamicNamespacesProps = Omit<BaseDynamicNamespacesProps, "namespaces"> & {
5
+ namespaces: TranslateNamespace[];
6
+ };
7
+ /**
8
+ * **NOTE**: To make typescript work nicely here make sure to enable
9
+ * [`resolveJsonModule`](https://www.typescriptlang.org/tsconfig#resolveJsonModule)
10
+ * in your `tsconfig.json` file.
11
+ */
12
+ export declare const DynamicNamespaces: (props: DynamicNamespacesProps) => ReturnType<typeof BaseDynamicNamespaces>;
13
+ export default DynamicNamespaces;
@@ -0,0 +1,8 @@
1
+ import BaseDynamicNamespaces from "next-translate/DynamicNamespaces";
2
+ /**
3
+ * **NOTE**: To make typescript work nicely here make sure to enable
4
+ * [`resolveJsonModule`](https://www.typescriptlang.org/tsconfig#resolveJsonModule)
5
+ * in your `tsconfig.json` file.
6
+ */
7
+ export var DynamicNamespaces = BaseDynamicNamespaces;
8
+ export default DynamicNamespaces;
@@ -1,3 +1,4 @@
1
1
  import { FaviconTagsProps } from "@koine/react";
2
2
  export declare type FaviconProps = FaviconTagsProps;
3
3
  export declare const Favicon: (props: FaviconTagsProps) => JSX.Element;
4
+ export default Favicon;
@@ -3,3 +3,4 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import Head from "next/head";
4
4
  import { FaviconTags } from "@koine/react";
5
5
  export var Favicon = function (props) { return (_jsx(Head, { children: _jsx(FaviconTags, __assign({}, props)) })); };
6
+ export default Favicon;
package/Head.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import NextHead from "next/head";
2
+ export declare const Head: typeof NextHead;
3
+ export default Head;
package/Head.js ADDED
@@ -0,0 +1,3 @@
1
+ import NextHead from "next/head";
2
+ export var Head = NextHead;
3
+ export default Head;
package/Link.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { LinkProps as NextLinkProps } from "next/link";
3
+ export declare type LinkProps = Omit<React.ComponentPropsWithRef<"a">, "href"> & Omit<NextLinkProps, "as" | "passHref" | "children"> & {
4
+ Link?: React.ComponentType<any>;
5
+ };
6
+ /**
7
+ * @see https://next.js.org/docs/api-reference/next/link
8
+ */
9
+ export declare const Link: React.ForwardRefExoticComponent<Pick<LinkProps, "key" | "title" | "replace" | "slot" | "style" | "children" | "hidden" | "type" | "locale" | "rel" | "href" | "hrefLang" | "property" | "id" | "prefetch" | "onLoad" | "color" | "download" | "media" | "ping" | "target" | "referrerPolicy" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "scroll" | "shallow" | "legacyBehavior" | "Link"> & React.RefAttributes<HTMLAnchorElement>>;
10
+ export default Link;
@@ -9,3 +9,4 @@ export var Link = forwardRef(function Link(_a, ref) {
9
9
  var href = _a.href, prefetch = _a.prefetch, replace = _a.replace, scroll = _a.scroll, shallow = _a.shallow, locale = _a.locale, _b = _a.Link, Link = _b === void 0 ? "span" : _b, props = __rest(_a, ["href", "prefetch", "replace", "scroll", "shallow", "locale", "Link"]);
10
10
  return (_jsx(NextLink, __assign({ href: href, replace: replace, scroll: scroll, shallow: shallow, locale: locale, passHref: true }, { children: _jsx(Link, __assign({ ref: ref }, props)) })));
11
11
  });
12
+ export default Link;
@@ -1,6 +1,5 @@
1
1
  import React from "react";
2
- import NextImage, { ImageProps, StaticImageData } from "next/image";
3
- import type { KoineImgSmartProps, KoineImgSmartWrapProps } from "@koine/react";
2
+ import NextImage, { type ImageProps, type StaticImageData } from "next/image";
4
3
  interface StaticRequire {
5
4
  default: StaticImageData;
6
5
  }
@@ -9,13 +8,10 @@ export declare type NextImgProps = Omit<React.ComponentPropsWithoutRef<"img">, "
9
8
  src: string | StaticImport;
10
9
  };
11
10
  export declare const NextImg: typeof NextImage;
12
- export declare type NextImgSmartWrapProps = KoineImgSmartWrapProps;
13
- export declare type NextImgSmartProps = KoineImgSmartProps & NextImgProps;
14
- export declare const NextImgSmart: (props: NextImgSmartProps) => JSX.Element;
15
11
  export declare function getNextImgProps<T>({ src, alt, layout, blurDataURL, width, height, priority, objectFit, objectPosition, ...restProps }: T & NextImgProps): {
16
12
  nextImgProps: NextImgProps;
17
13
  restProps: Omit<T & Omit<Pick<React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "key" | keyof React.ImgHTMLAttributes<HTMLImageElement>>, "src"> & Omit<ImageProps, "src"> & {
18
14
  src: string | StaticImport;
19
15
  }, "src" | "alt" | "height" | "width" | "layout" | "priority" | "blurDataURL" | "objectFit" | "objectPosition">;
20
16
  };
21
- export {};
17
+ export default NextImg;
@@ -1,15 +1,6 @@
1
- import { __assign, __rest } from "tslib";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { useState } from "react";
1
+ import { __rest } from "tslib";
4
2
  import NextImage from "next/image";
5
3
  export var NextImg = NextImage;
6
- export var NextImgSmart = function (props) {
7
- var _a = useState(false), $loaded = _a[0], setLoaded = _a[1];
8
- var _b = useState(false), $error = _b[0], setError = _b[1];
9
- var _c = getNextImgProps(props), nextImgProps = _c.nextImgProps, restProps = _c.restProps;
10
- var Wrap = restProps.Wrap;
11
- return nextImgProps.priority ? (_jsx(NextImage, __assign({}, nextImgProps))) : (_jsx(Wrap, __assign({}, restProps, { "$loaded": $loaded, "$error": $error }, { children: _jsx(NextImage, __assign({}, nextImgProps, { onLoadingComplete: function () { return setLoaded(true); }, onError: function () { return setError(true); } })) })));
12
- };
13
4
  export function getNextImgProps(_a) {
14
5
  var src = _a.src, alt = _a.alt, layout = _a.layout, blurDataURL = _a.blurDataURL, width = _a.width, height = _a.height, priority = _a.priority, objectFit = _a.objectFit, objectPosition = _a.objectPosition, restProps = __rest(_a, ["src", "alt", "layout", "blurDataURL", "width", "height", "priority", "objectFit", "objectPosition"]);
15
6
  var nextImgProps = {
@@ -28,3 +19,4 @@ export function getNextImgProps(_a) {
28
19
  restProps: restProps,
29
20
  };
30
21
  }
22
+ export default NextImg;
@@ -0,0 +1,6 @@
1
+ import type { KoineImgSmartProps, KoineImgSmartWrapProps } from "@koine/react";
2
+ import { type NextImgProps } from "./NextImg";
3
+ export declare type NextImgSmartWrapProps = KoineImgSmartWrapProps;
4
+ export declare type NextImgSmartProps = KoineImgSmartProps & NextImgProps;
5
+ export declare const NextImgSmart: (props: NextImgSmartProps) => JSX.Element;
6
+ export default NextImgSmart;
@@ -0,0 +1,13 @@
1
+ import { __assign } from "tslib";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import NextImage from "next/image";
5
+ import { getNextImgProps } from "./NextImg";
6
+ export var NextImgSmart = function (props) {
7
+ var _a = useState(false), $loaded = _a[0], setLoaded = _a[1];
8
+ var _b = useState(false), $error = _b[0], setError = _b[1];
9
+ var _c = getNextImgProps(props), nextImgProps = _c.nextImgProps, restProps = _c.restProps;
10
+ var Wrap = restProps.Wrap;
11
+ return nextImgProps.priority ? (_jsx(NextImage, __assign({}, nextImgProps))) : (_jsx(Wrap, __assign({}, restProps, { "$loaded": $loaded, "$error": $error }, { children: _jsx(NextImage, __assign({}, nextImgProps, { onLoadingComplete: function () { return setLoaded(true); }, onError: function () { return setError(true); } })) })));
12
+ };
13
+ export default NextImgSmart;
@@ -21,4 +21,4 @@ export declare type ComponentsProps = {
21
21
  declare type Props = Simplify<WithComponents<OwnProps, Components>>;
22
22
  export declare type NextProgressProps = Props;
23
23
  export declare const NextProgress: ({ startAt, showOnShallow, stopDelayMs, Overlay, }: NextProgressProps) => JSX.Element;
24
- export {};
24
+ export default NextProgress;
@@ -38,3 +38,4 @@ export var NextProgress = function (_a) {
38
38
  }, [events, routeChangeStart, routeChangeEnd]);
39
39
  return _jsx(Overlay, { running: running });
40
40
  };
41
+ export default NextProgress;
package/Seo.d.ts ADDED
@@ -0,0 +1,27 @@
1
+ /// <reference types="react" />
2
+ import type { NextSeoProps } from "next-seo/lib/types";
3
+ import type { SeoData } from "./types-seo";
4
+ declare type SeoPropsOpenGraph = NextSeoProps["openGraph"] & {
5
+ image?: string;
6
+ };
7
+ /**
8
+ * @see https://github.com/garmeeh/next-seo/blob/master/src/types.ts#L395
9
+ */
10
+ export declare type SeoProps = Omit<NextSeoProps, "additionalMetaTags" | "additionalLinkTags" | "mobileAlternate" | "robotsProps"> & {
11
+ metaTags?: NextSeoProps["additionalMetaTags"];
12
+ linkTags?: NextSeoProps["additionalLinkTags"];
13
+ seo?: SeoData;
14
+ hidden?: SeoData["hidden"];
15
+ keywords?: SeoData["keywords"];
16
+ openGraph?: SeoPropsOpenGraph;
17
+ og?: SeoPropsOpenGraph;
18
+ };
19
+ /**
20
+ * Adapted from [garmeeh/next-seo](https://github.com/garmeeh/next-seo)
21
+ *
22
+ * See also:
23
+ * - https://github.com/catnose99/next-head-seo
24
+ * - https://nextjs.org/docs/api-reference/next/head
25
+ */
26
+ export declare const Seo: import("react").MemoExoticComponent<(props: SeoProps) => JSX.Element>;
27
+ export default Seo;
package/Seo.js ADDED
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { memo } from "react";
3
+ import Head from "next/head";
4
+ import { seoBuildTags } from "./seoBuildTags";
5
+ var _Seo = function (props) {
6
+ return _jsx(Head, { children: seoBuildTags(props) });
7
+ };
8
+ /**
9
+ * Adapted from [garmeeh/next-seo](https://github.com/garmeeh/next-seo)
10
+ *
11
+ * See also:
12
+ * - https://github.com/catnose99/next-head-seo
13
+ * - https://nextjs.org/docs/api-reference/next/head
14
+ */
15
+ export var Seo = memo(_Seo);
16
+ export default Seo;
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import type { DefaultSeoProps } from "next-seo/lib/types";
3
+ /**
4
+ * @see https://github.com/garmeeh/next-seo/blob/master/src/types.ts#L413
5
+ */
6
+ export declare type SeoDefaultsProps = Omit<DefaultSeoProps, "additionalMetaTags" | "additionalLinkTags" | "dangerouslySetAllPagesToNoIndex" | "dangerouslySetAllPagesToNoFollow" | "defaultOpenGraphImageWidth" | "defaultOpenGraphImageHeight" | "defaultOpenGraphVideoWidth" | "defaultOpenGraphVideoHeight" | "mobileAlternate" | "robotsProps"> & {
7
+ metaTags?: DefaultSeoProps["additionalMetaTags"];
8
+ linkTags?: DefaultSeoProps["additionalLinkTags"];
9
+ };
10
+ export declare const SeoDefaults: import("react").MemoExoticComponent<(props: SeoDefaultsProps) => JSX.Element>;
11
+ export default SeoDefaults;
@@ -3,10 +3,11 @@ import { memo } from "react";
3
3
  import Head from "next/head";
4
4
  // import { useRouter } from "next/router";
5
5
  // import { getSiteUrl } from "../utils";
6
- import { buildTags } from "./helpers";
6
+ import { seoBuildTags } from "./seoBuildTags";
7
7
  var _SeoDefaults = function (props) {
8
8
  // const router = useRouter();
9
9
  // props.openGraph.url = getSiteUrl(router.asPath);
10
- return _jsx(Head, { children: buildTags(props) });
10
+ return _jsx(Head, { children: seoBuildTags(props) });
11
11
  };
12
12
  export var SeoDefaults = memo(_SeoDefaults);
13
+ export default SeoDefaults;
@@ -1,5 +1,5 @@
1
1
  import type { TransProps } from "next-translate";
2
- import type { TranslateNamespace, TranslationsPaths, TranslationsAllPaths } from "../types";
2
+ import type { TranslateNamespace, TranslationsPaths, TranslationsAllPaths } from "./types-i18n";
3
3
  export declare type TProps<TNamespace extends TranslateNamespace | undefined = undefined> = (Omit<TransProps, "i18nKey" | "ns"> & {
4
4
  i18nKey: TranslationsAllPaths;
5
5
  }) | (Omit<TransProps, "i18nKey" | "ns"> & {
File without changes
package/app/AppMain.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import type { AppProps as NextAppProps } from "next/app";
3
3
  import type { HTMLMotionProps } from "framer-motion";
4
- import type { SeoDefaultsProps } from "../Seo";
4
+ import type { SeoDefaultsProps } from "../SeoDefaults";
5
5
  import type { NextProgressProps } from "../NextProgress";
6
6
  import type { MotionProviderFeatures } from "@koine/react/m";
7
7
  export declare type AppMainBaseProps = NextAppProps & {
@@ -1,7 +1,7 @@
1
1
  import { __assign } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import React from "react";
4
- import { SeoDefaults } from "../../Seo";
4
+ import { SeoDefaults } from "../../SeoDefaults";
5
5
  /**
6
6
  * App main
7
7
  *
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { AppProps as NextAppProps } from "next/app";
3
- import { ThemeProviderProps } from "../../Theme";
3
+ import { type ThemeProviderProps } from "../../useTheme";
4
4
  export declare type AppThemeProps = React.PropsWithChildren<NextAppProps & {
5
5
  theme: ThemeProviderProps["defaultTheme"];
6
6
  }>;
@@ -1,7 +1,7 @@
1
1
  import { __assign } from "tslib";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  // import { ThemeVanillaProvider, ThemeVanillaValue } from "@koine/react";
4
- import { ThemeProvider } from "../../Theme";
4
+ import { ThemeProvider } from "../../useTheme";
5
5
  /**
6
6
  * App theme with vanilla class based theme (good for `tailwindcss`)
7
7
  */
package/app/em/AppMain.js CHANGED
@@ -4,7 +4,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
4
4
  import { useRouter } from "next/router";
5
5
  import { AnimatePresence, m } from "framer-motion";
6
6
  import { MotionProvider } from "@koine/react/m";
7
- import { SeoDefaults } from "../../Seo";
7
+ import { SeoDefaults } from "../../SeoDefaults";
8
8
  import { NextProgress } from "../../NextProgress";
9
9
  /**
10
10
  * App main
@@ -5,7 +5,7 @@ import { CacheProvider } from "@emotion/react";
5
5
  import CssBaseline from "@mui/material/CssBaseline";
6
6
  import { Global, css } from "@emotion/react";
7
7
  import { stylesGlobal } from "@koine/react/sc";
8
- import { createEmotionCache } from "../../utils/emotion-cache";
8
+ import { createEmotionCache } from "../../createEmotionCache";
9
9
  // client-side cache, shared for the whole session of the user in the browser.
10
10
  var clientSideEmotionCache = createEmotionCache();
11
11
  /**
package/app/sc/AppMain.js CHANGED
@@ -4,7 +4,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
4
4
  import { useRouter } from "next/router";
5
5
  import { AnimatePresence, m } from "framer-motion";
6
6
  import { MotionProvider } from "@koine/react/m";
7
- import { SeoDefaults } from "../../Seo";
7
+ import { SeoDefaults } from "../../SeoDefaults";
8
8
  import { NextProgress } from "../../NextProgress";
9
9
  /**
10
10
  * App main
@@ -1,4 +1,4 @@
1
- import type { TranslateLoose } from "../i18n";
1
+ import type { TranslateLoose } from "../types-i18n";
2
2
  /**
3
3
  * @see next/auth `pages` mapping: https://next-auth.js.org/configuration/pages`
4
4
  */
File without changes
File without changes
File without changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "sideEffects": false,
3
3
  "module": "./index.js",
4
- "main": "../node/Head/index.js",
4
+ "main": "../node/auth/index.js",
5
5
  "types": "./index.d.ts"
6
6
  }
@@ -5,3 +5,4 @@ export declare function useLogin<LoginForm extends {} = {}>(): {
5
5
  ok: boolean;
6
6
  fail: boolean;
7
7
  };
8
+ export default useLogin;
@@ -3,7 +3,7 @@ import { useState, useCallback } from "react";
3
3
  import { useRouter } from "next/router";
4
4
  import { signIn } from "next-auth/react";
5
5
  import { parseURL } from "@koine/utils";
6
- import { useT } from "../i18n";
6
+ import { useT } from "../useT";
7
7
  import { getAuthRoutes, getCallbackUrl } from "./helpers";
8
8
  export function useLogin() {
9
9
  var t = useT();
@@ -47,3 +47,4 @@ export function useLogin() {
47
47
  fail: fail,
48
48
  };
49
49
  }
50
+ export default useLogin;
@@ -1 +1,2 @@
1
1
  export declare function useLoginUrl(): string;
2
+ export default useLoginUrl;
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useState } from "react";
2
- import { useT } from "../i18n";
2
+ import { useT } from "../useT";
3
3
  import { getAuthRoutes } from "./helpers";
4
4
  export function useLoginUrl() {
5
5
  var _a = useState(""), currentUrl = _a[0], setCurrentUrl = _a[1];
@@ -9,3 +9,4 @@ export function useLoginUrl() {
9
9
  }, []);
10
10
  return "".concat(getAuthRoutes(t).login).concat(currentUrl);
11
11
  }
12
+ export default useLoginUrl;
@@ -4,3 +4,4 @@ export declare function useLogout(): {
4
4
  ok: boolean;
5
5
  fail: boolean;
6
6
  };
7
+ export default useLogout;
@@ -2,7 +2,7 @@ import { useState, useCallback } from "react";
2
2
  import { useRouter } from "next/router";
3
3
  import { signOut } from "next-auth/react";
4
4
  import { parseURL } from "@koine/utils";
5
- import { useT } from "../i18n";
5
+ import { useT } from "../useT";
6
6
  import { getAuthRoutes, getCallbackUrl } from "./helpers";
7
7
  export function useLogout() {
8
8
  var t = useT();
@@ -50,3 +50,4 @@ export function useLogout() {
50
50
  fail: fail,
51
51
  };
52
52
  }
53
+ export default useLogout;
package/config/index.d.ts CHANGED
@@ -76,10 +76,10 @@ declare type KoineNextConfig = {
76
76
  * "home": "/",
77
77
  * "products": {
78
78
  * "list": "/products",
79
- * "[category]": "/products/[category]",
79
+ * "[category]": "/products/{{ category }}",
80
80
  * "[tag]": {
81
- * "view": "/products/[category]/[tag]",
82
- * "related": "/products/[category]/[tag]/related"
81
+ * "view": "/products/{{ category }}/{{ tag }}",
82
+ * "related": "/products/{{ category }}/{{ tag }}/related"
83
83
  * }
84
84
  * },
85
85
  * "company": {
package/config/index.js CHANGED
@@ -52,9 +52,25 @@ export function encodePathname(pathname) {
52
52
  .join("/");
53
53
  }
54
54
  /**
55
- * It replaces `/[dynamic-slug]/` with the given replacer.
55
+ * It replaces `/{{ slug }}/` with the given replacer.
56
56
  */
57
57
  function transformRoutePathname(rawPathname, replacer) {
58
+ var pathNameParts = rawPathname.split("/").filter(function (part) { return !!part; });
59
+ return pathNameParts
60
+ .map(function (part, _idx) {
61
+ var isDynamic = part.startsWith("{{") && part.endsWith("}}");
62
+ part = isDynamic ? replacer : part;
63
+ // if (isDynamic && _idx === pathNameParts.length - 1) {
64
+ // part += "*";
65
+ // }
66
+ return isDynamic ? part : encodeURIComponent(part);
67
+ })
68
+ .join("/");
69
+ }
70
+ /**
71
+ * It replaces `/[slug]/` with the given replacer.
72
+ */
73
+ function transformRouteTemplate(rawPathname, replacer) {
58
74
  var pathNameParts = rawPathname.split("/").filter(function (part) { return !!part; });
59
75
  return pathNameParts
60
76
  .map(function (part, _idx) {
@@ -91,7 +107,7 @@ function getRoutesMap(map, routes, pathnameBuffer, templateBuffer) {
91
107
  */
92
108
  export function getPathRewrite(pathname, template) {
93
109
  pathname = transformRoutePathname(pathname, ":path");
94
- template = transformRoutePathname(template, ":path");
110
+ template = transformRouteTemplate(template, ":path");
95
111
  var source = "/".concat(normaliseUrlPathname(pathname));
96
112
  var destination = "/".concat(normaliseUrlPathname(template));
97
113
  // console.log(`rewrite pathname "${source}" to template "${destination}"`);
@@ -105,7 +121,7 @@ export function getPathRewrite(pathname, template) {
105
121
  */
106
122
  export function getPathRedirect(locale, pathname, template, permanent) {
107
123
  if (locale === void 0) { locale = ""; }
108
- template = transformRoutePathname(template, ":slug");
124
+ template = transformRouteTemplate(template, ":slug");
109
125
  pathname = transformRoutePathname(pathname, ":slug");
110
126
  var source = "/".concat(normaliseUrlPathname((locale ? "/".concat(locale, "/") : "/") + template));
111
127
  var destination = "/".concat(normaliseUrlPathname(pathname));
@@ -190,16 +206,10 @@ export function withKoine(_a) {
190
206
  // @see https://nextjs.org/docs/advanced-features/compiler#modularize-imports
191
207
  modularizeImports: __assign(__assign({}, (((_b = custom === null || custom === void 0 ? void 0 : custom["experimental"]) === null || _b === void 0 ? void 0 : _b.modularizeImports) || {})), {
192
208
  // FIXME: make these work with the right file/folder structure?
193
- // "@koine/next/?(((\\w*)?/?)*)": {
194
- // transform: "@koine/next/{{ matches.[1] }}/{{member}}",
195
- // },
196
209
  // "@koine/react/?(((\\w*)?/?)*)": {
197
210
  // transform: "@koine/react/{{ matches.[1] }}/{{member}}",
198
211
  // },
199
- // "@koine/utils/?(((\\w*)?/?)*)": {
200
- // transform: "@koine/utils/{{ matches.[1] }}/{{member}}",
201
- // },
202
- "@koine/utils": { transform: "@koine/utils/{{member}}" } }) }),
212
+ "@koine/next": { transform: "@koine/next/{{member}}" }, "@koine/utils": { transform: "@koine/utils/{{member}}" } }) }),
203
213
  // @see https://github.com/vercel/next.js/issues/7322#issuecomment-887330111
204
214
  reactStrictMode: true }, custom);
205
215
  if (svg) {
@@ -3,3 +3,4 @@
3
3
  * It allows developers to easily override MUI styles with other styling solutions, like CSS modules.
4
4
  */
5
5
  export declare function createEmotionCache(): import("@emotion/utils").EmotionCache;
6
+ export default createEmotionCache;
@@ -6,3 +6,4 @@ import createCache from "@emotion/cache";
6
6
  export function createEmotionCache() {
7
7
  return createCache({ key: "css", prepend: true });
8
8
  }
9
+ export default createEmotionCache;
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import NextDocument, { Html, Head, Main, NextScript } from "next/document";
4
4
  import { Meta, NoJs } from "@koine/react";
5
5
  import createEmotionServer from "@emotion/server/create-instance";
6
- import { createEmotionCache } from "../../utils/emotion-cache";
6
+ import { createEmotionCache } from "../../createEmotionCache";
7
7
  /**
8
8
  * Next Document wrapper for `emotion` based projects
9
9
  *
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Get site absolute url with the given path
3
+ *
4
+ * - It uses the `NEXT_PUBLIC_APP_URL` env variable
5
+ * - It removes the trailing slashes
6
+ */
7
+ export declare function getSiteUrl(path?: string): string;
8
+ export default getSiteUrl;
package/getSiteUrl.js ADDED
@@ -0,0 +1,12 @@
1
+ import { normaliseUrl } from "@koine/utils";
2
+ /**
3
+ * Get site absolute url with the given path
4
+ *
5
+ * - It uses the `NEXT_PUBLIC_APP_URL` env variable
6
+ * - It removes the trailing slashes
7
+ */
8
+ export function getSiteUrl(path) {
9
+ if (path === void 0) { path = ""; }
10
+ return normaliseUrl("".concat(process.env["NEXT_PUBLIC_APP_URL"], "/").concat(path));
11
+ }
12
+ export default getSiteUrl;
@@ -1,4 +1,4 @@
1
- import type { Translate, TranslateNamespace } from "../types";
1
+ import type { Translate, TranslateNamespace } from "./types-i18n";
2
2
  export declare type GetT = <TNamespace extends TranslateNamespace | undefined = undefined>(locale?: string, namespace?: TNamespace) => Promise<Translate<TNamespace>>;
3
3
  /**
4
4
  * **NOTE**: To make typescript work nicely here make sure to enable
@@ -6,3 +6,4 @@ export declare type GetT = <TNamespace extends TranslateNamespace | undefined =
6
6
  * in your `tsconfig.json` file.
7
7
  */
8
8
  export declare const getT: GetT;
9
+ export default getT;
@@ -6,3 +6,4 @@ import getTranslation from "next-translate/getT";
6
6
  * in your `tsconfig.json` file.
7
7
  */
8
8
  export var getT = getTranslation;
9
+ export default getT;
package/index.d.ts CHANGED
@@ -1,12 +1,26 @@
1
- export * from "./Analytics";
2
- export * from "./Auth";
1
+ export * from "./AnalyticsGoogle";
2
+ export * from "./DynamicNamespaces";
3
3
  export * from "./Favicon";
4
- export * from "./Forms";
4
+ export * from "./getSiteUrl";
5
+ export * from "./getT";
5
6
  export * from "./Head";
6
- export * from "./i18n";
7
- export * from "./Img";
8
7
  export * from "./Link";
8
+ export * from "./load";
9
+ export * from "./NextImg";
10
+ export * from "./NextImgSmart";
9
11
  export * from "./NextProgress";
12
+ export * from "./revalidate";
10
13
  export * from "./Seo";
11
- export * from "./Theme";
12
- export * from "./utils";
14
+ export * from "./SeoDefaults";
15
+ export * from "./T";
16
+ export * from "./to";
17
+ export * from "./translationAsOptions";
18
+ export * from "./types-i18n";
19
+ export * from "./types-seo";
20
+ export * from "./useBackUrl";
21
+ export * from "./useDateFormat";
22
+ export * from "./useForm";
23
+ export * from "./useLocale";
24
+ export * from "./useT";
25
+ export * from "./useTheme";
26
+ export * from "./useTo";