@koine/next 1.0.104 → 1.1.0
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.
- package/AnalyticsGoogle.d.ts +1 -1
- package/DynamicNamespaces.d.ts +1 -1
- package/Favicon.d.ts +1 -1
- package/Link.d.ts +2 -2
- package/NextImg.d.ts +5 -6
- package/NextImg.js +1 -3
- package/NextImgSmart.d.ts +2 -2
- package/NextProgress.d.ts +5 -5
- package/Seo.d.ts +6 -6
- package/Seo.js +4 -5
- package/SeoDefaults.d.ts +5 -5
- package/SeoDefaults.js +2 -3
- package/T.d.ts +1 -1
- package/ThemeContext.d.ts +1 -1
- package/ThemeProvider.d.ts +2 -2
- package/TransText.d.ts +3 -0
- package/TransText.js +3 -0
- package/app/AppHead.d.ts +1 -1
- package/app/AppMain.d.ts +2 -2
- package/app/css/AppMain.d.ts +1 -1
- package/app/css/AppTheme.d.ts +1 -1
- package/app/css/auth/index.d.ts +1 -1
- package/app/css/index.d.ts +1 -1
- package/app/em/AppMain.d.ts +1 -1
- package/app/em/AppTheme.d.ts +1 -1
- package/app/em/auth/index.d.ts +1 -1
- package/app/em/index.d.ts +1 -1
- package/app/sc/AppMain.d.ts +1 -1
- package/app/sc/AppTheme.d.ts +1 -1
- package/app/sc/auth/index.d.ts +1 -1
- package/app/sc/index.d.ts +1 -1
- package/auth/helpers.d.ts +1 -1
- package/config/index.d.ts +4 -4
- package/config/index.js +5 -14
- package/getT.d.ts +1 -1
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/node/NextImg.js +2 -4
- package/node/Seo.js +5 -5
- package/node/SeoDefaults.js +3 -3
- package/node/TransText.js +7 -0
- package/node/config/index.js +5 -14
- package/node/index.js +1 -0
- package/node/seoBuildTags.js +12 -12
- package/package.json +47 -33
- package/seoBuildTags.d.ts +3 -1
- package/seoBuildTags.js +12 -12
- package/to.d.ts +7 -7
- package/types-i18n.d.ts +14 -14
- package/types-seo.d.ts +1 -1
- package/useTheme.d.ts +1 -1
package/AnalyticsGoogle.d.ts
CHANGED
package/DynamicNamespaces.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import BaseDynamicNamespaces from "next-translate/DynamicNamespaces";
|
|
2
2
|
import type { DynamicNamespacesProps as BaseDynamicNamespacesProps } from "next-translate";
|
|
3
3
|
import type { TranslateNamespace } from "./types-i18n";
|
|
4
|
-
export
|
|
4
|
+
export type DynamicNamespacesProps = Omit<BaseDynamicNamespacesProps, "namespaces"> & {
|
|
5
5
|
namespaces: TranslateNamespace[];
|
|
6
6
|
};
|
|
7
7
|
/**
|
package/Favicon.d.ts
CHANGED
package/Link.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { LinkProps as NextLinkProps } from "next/link";
|
|
3
|
-
export
|
|
3
|
+
export type LinkProps = Omit<React.ComponentPropsWithRef<"a">, "href"> & Omit<NextLinkProps, "as" | "passHref" | "children"> & {
|
|
4
4
|
Link?: React.ComponentType<any>;
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
7
|
* @see https://next.js.org/docs/api-reference/next/link
|
|
8
8
|
*/
|
|
9
|
-
export declare const Link: React.ForwardRefExoticComponent<Pick<LinkProps, "key" | "title" | "replace" | "slot" | "style" | "
|
|
9
|
+
export declare const Link: React.ForwardRefExoticComponent<Pick<LinkProps, "key" | "title" | "children" | "replace" | "slot" | "style" | "hidden" | "media" | "href" | "hrefLang" | "referrerPolicy" | "rel" | "type" | "locale" | "property" | "id" | "prefetch" | "onLoad" | "dangerouslySetInnerHTML" | "color" | "download" | "ping" | "target" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "nonce" | "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" | "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" | "onResize" | "onResizeCapture" | "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
10
|
export default Link;
|
package/NextImg.d.ts
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
2
|
+
import { type ImageProps, type StaticImageData } from "next/image";
|
|
3
3
|
interface StaticRequire {
|
|
4
4
|
default: StaticImageData;
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
export
|
|
6
|
+
type StaticImport = StaticRequire | StaticImageData;
|
|
7
|
+
export type NextImgProps = Omit<React.ComponentPropsWithoutRef<"img">, "src"> & Omit<ImageProps, "src"> & {
|
|
8
8
|
src: string | StaticImport;
|
|
9
9
|
};
|
|
10
|
-
export declare const NextImg: typeof NextImage;
|
|
11
10
|
export declare function getNextImgProps<T>({ src, alt, layout, blurDataURL, width, height, priority, objectFit, objectPosition, ...restProps }: T & NextImgProps): {
|
|
12
11
|
nextImgProps: NextImgProps;
|
|
13
12
|
restProps: Omit<T & Omit<Pick<React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "key" | keyof React.ImgHTMLAttributes<HTMLImageElement>>, "src"> & Omit<ImageProps, "src"> & {
|
|
14
13
|
src: string | StaticImport;
|
|
15
|
-
}, "src" | "alt" | "height" | "width" | "
|
|
14
|
+
}, "src" | "alt" | "height" | "width" | "priority" | "blurDataURL" | "layout" | "objectFit" | "objectPosition">;
|
|
16
15
|
};
|
|
17
|
-
export default
|
|
16
|
+
export default getNextImgProps;
|
package/NextImg.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
|
-
import NextImage from "next/image";
|
|
3
|
-
export var NextImg = NextImage;
|
|
4
2
|
export function getNextImgProps(_a) {
|
|
5
3
|
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"]);
|
|
6
4
|
var nextImgProps = {
|
|
@@ -19,4 +17,4 @@ export function getNextImgProps(_a) {
|
|
|
19
17
|
restProps: restProps,
|
|
20
18
|
};
|
|
21
19
|
}
|
|
22
|
-
export default
|
|
20
|
+
export default getNextImgProps;
|
package/NextImgSmart.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { KoineImgSmartProps, KoineImgSmartWrapProps } from "@koine/react";
|
|
2
2
|
import { type NextImgProps } from "./NextImg";
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type NextImgSmartWrapProps = KoineImgSmartWrapProps;
|
|
4
|
+
export type NextImgSmartProps = KoineImgSmartProps & NextImgProps;
|
|
5
5
|
export declare const NextImgSmart: (props: NextImgSmartProps) => JSX.Element;
|
|
6
6
|
export default NextImgSmart;
|
package/NextProgress.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Simplify } from "@koine/utils";
|
|
2
2
|
import { type WithComponents } from "@koine/react";
|
|
3
|
-
|
|
3
|
+
type OwnProps = {
|
|
4
4
|
/** @default 0.3 */
|
|
5
5
|
startAt?: number;
|
|
6
6
|
/** @default true */
|
|
@@ -8,7 +8,7 @@ declare type OwnProps = {
|
|
|
8
8
|
/** @default 200 */
|
|
9
9
|
stopDelayMs?: number;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type Components = {
|
|
12
12
|
Overlay: {
|
|
13
13
|
type: "div";
|
|
14
14
|
props: {
|
|
@@ -16,10 +16,10 @@ export declare type Components = {
|
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
-
export
|
|
19
|
+
export type ComponentsProps = {
|
|
20
20
|
[Name in keyof Components]: Components[Name]["props"];
|
|
21
21
|
};
|
|
22
|
-
|
|
23
|
-
export
|
|
22
|
+
type Props = Simplify<WithComponents<OwnProps, Components>>;
|
|
23
|
+
export type NextProgressProps = Props;
|
|
24
24
|
export declare const NextProgress: ({ startAt, showOnShallow, stopDelayMs, Overlay, }: NextProgressProps) => JSX.Element;
|
|
25
25
|
export default NextProgress;
|
package/Seo.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { NextSeoProps } from "next-seo/lib/types";
|
|
3
2
|
import type { SeoData } from "./types-seo";
|
|
4
|
-
|
|
3
|
+
import { type MetaTag, type LinkTag } from "./seoBuildTags";
|
|
4
|
+
type SeoPropsOpenGraph = NextSeoProps["openGraph"] & {
|
|
5
5
|
image?: string;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
8
|
* @see https://github.com/garmeeh/next-seo/blob/master/src/types.ts#L395
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
11
|
-
metaTags?:
|
|
12
|
-
linkTags?:
|
|
10
|
+
export type SeoProps = Omit<NextSeoProps, "additionalMetaTags" | "additionalLinkTags" | "mobileAlternate" | "robotsProps"> & {
|
|
11
|
+
metaTags?: ReadonlyArray<MetaTag>;
|
|
12
|
+
linkTags?: ReadonlyArray<LinkTag>;
|
|
13
13
|
seo?: SeoData;
|
|
14
14
|
hidden?: SeoData["hidden"];
|
|
15
15
|
keywords?: SeoData["keywords"];
|
|
@@ -37,5 +37,5 @@ export declare type SeoProps = Omit<NextSeoProps, "additionalMetaTags" | "additi
|
|
|
37
37
|
* <Seo title="MyApp | Some description" titleTemplate="%s" />
|
|
38
38
|
* ```
|
|
39
39
|
*/
|
|
40
|
-
export declare const Seo:
|
|
40
|
+
export declare const Seo: (props: SeoProps) => JSX.Element;
|
|
41
41
|
export default Seo;
|
package/Seo.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { memo } from "react";
|
|
2
|
+
// import { memo } from "react";
|
|
3
3
|
import Head from "next/head";
|
|
4
4
|
import { seoBuildTags } from "./seoBuildTags";
|
|
5
|
-
var _Seo = function (props) {
|
|
6
|
-
return _jsx(Head, { children: seoBuildTags(props) });
|
|
7
|
-
};
|
|
8
5
|
/**
|
|
9
6
|
* Adapted from [garmeeh/next-seo](https://github.com/garmeeh/next-seo)
|
|
10
7
|
*
|
|
@@ -26,5 +23,7 @@ var _Seo = function (props) {
|
|
|
26
23
|
* <Seo title="MyApp | Some description" titleTemplate="%s" />
|
|
27
24
|
* ```
|
|
28
25
|
*/
|
|
29
|
-
export var Seo =
|
|
26
|
+
export var Seo = function (props) {
|
|
27
|
+
return _jsx(Head, { children: seoBuildTags(props) });
|
|
28
|
+
};
|
|
30
29
|
export default Seo;
|
package/SeoDefaults.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { DefaultSeoProps } from "next-seo/lib/types";
|
|
2
|
+
import { type MetaTag, type LinkTag } from "./seoBuildTags";
|
|
3
3
|
/**
|
|
4
4
|
* @see https://github.com/garmeeh/next-seo/blob/master/src/types.ts#L413
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
7
|
-
metaTags?:
|
|
8
|
-
linkTags?:
|
|
6
|
+
export type SeoDefaultsProps = Omit<DefaultSeoProps, "additionalMetaTags" | "additionalLinkTags" | "dangerouslySetAllPagesToNoIndex" | "dangerouslySetAllPagesToNoFollow" | "defaultOpenGraphImageWidth" | "defaultOpenGraphImageHeight" | "defaultOpenGraphVideoWidth" | "defaultOpenGraphVideoHeight" | "mobileAlternate" | "robotsProps"> & {
|
|
7
|
+
metaTags?: ReadonlyArray<MetaTag>;
|
|
8
|
+
linkTags?: ReadonlyArray<LinkTag>;
|
|
9
9
|
};
|
|
10
|
-
export declare const SeoDefaults:
|
|
10
|
+
export declare const SeoDefaults: (props: SeoDefaultsProps) => JSX.Element;
|
|
11
11
|
export default SeoDefaults;
|
package/SeoDefaults.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { memo } from "react";
|
|
2
|
+
// 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
6
|
import { seoBuildTags } from "./seoBuildTags";
|
|
7
|
-
var
|
|
7
|
+
export var SeoDefaults = function (props) {
|
|
8
8
|
// const router = useRouter();
|
|
9
9
|
// props.openGraph.url = getSiteUrl(router.asPath);
|
|
10
10
|
return _jsx(Head, { children: seoBuildTags(props) });
|
|
11
11
|
};
|
|
12
|
-
export var SeoDefaults = memo(_SeoDefaults);
|
|
13
12
|
export default SeoDefaults;
|
package/T.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TransProps } from "next-translate";
|
|
2
2
|
import type { TranslateNamespace, TranslationsPaths, TranslationsAllPaths } from "./types-i18n";
|
|
3
|
-
export
|
|
3
|
+
export type TProps<TNamespace extends TranslateNamespace | undefined = undefined> = (Omit<TransProps, "i18nKey" | "ns"> & {
|
|
4
4
|
i18nKey: TranslationsAllPaths;
|
|
5
5
|
}) | (Omit<TransProps, "i18nKey" | "ns"> & {
|
|
6
6
|
ns: TNamespace;
|
package/ThemeContext.d.ts
CHANGED
package/ThemeProvider.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
type ValueObject = {
|
|
3
3
|
[themeName: string]: string;
|
|
4
4
|
};
|
|
5
|
-
export
|
|
5
|
+
export type ThemeProviderProps = React.PropsWithChildren<{
|
|
6
6
|
/** List of all available theme names */
|
|
7
7
|
themes?: string[];
|
|
8
8
|
/** Forced theme name for the current page */
|
package/TransText.d.ts
ADDED
package/TransText.js
ADDED
package/app/AppHead.d.ts
CHANGED
package/app/AppMain.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { HTMLMotionProps } from "framer-motion";
|
|
|
4
4
|
import type { SeoDefaultsProps } from "../SeoDefaults";
|
|
5
5
|
import type { NextProgressProps } from "../NextProgress";
|
|
6
6
|
import type { MotionProviderFeatures } from "@koine/react/m";
|
|
7
|
-
export
|
|
7
|
+
export type AppMainBaseProps = NextAppProps & {
|
|
8
8
|
/**
|
|
9
9
|
* A wrapping layout component
|
|
10
10
|
*/
|
|
@@ -26,7 +26,7 @@ export declare type AppMainBaseProps = NextAppProps & {
|
|
|
26
26
|
*/
|
|
27
27
|
post?: React.ReactNode;
|
|
28
28
|
};
|
|
29
|
-
export
|
|
29
|
+
export type AppMainFramerProps = {
|
|
30
30
|
motion: MotionProviderFeatures;
|
|
31
31
|
/**
|
|
32
32
|
* Default layout transition, by default it is a simple fade in/out
|
package/app/css/AppMain.d.ts
CHANGED
package/app/css/AppTheme.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { AppProps as NextAppProps } from "next/app";
|
|
3
3
|
import { type ThemeProviderProps } from "../../ThemeProvider";
|
|
4
|
-
export
|
|
4
|
+
export type AppThemeProps = React.PropsWithChildren<NextAppProps & {
|
|
5
5
|
theme: ThemeProviderProps["defaultTheme"];
|
|
6
6
|
}>;
|
|
7
7
|
/**
|
package/app/css/auth/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AppProps } from "next/app";
|
|
2
2
|
import { AppThemeProps } from "../AppTheme";
|
|
3
3
|
import { AppMainProps } from "../AppMain";
|
|
4
|
-
export
|
|
4
|
+
export type NextAppProps = AppProps<{
|
|
5
5
|
session: any;
|
|
6
6
|
}> & AppThemeProps & AppMainProps;
|
|
7
7
|
/**
|
package/app/css/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AppProps } from "next/app";
|
|
2
2
|
import { AppThemeProps } from "./AppTheme";
|
|
3
3
|
import { AppMainProps } from "./AppMain";
|
|
4
|
-
export
|
|
4
|
+
export type NextAppProps = AppProps & AppThemeProps & AppMainProps;
|
|
5
5
|
/**
|
|
6
6
|
* App
|
|
7
7
|
*
|
package/app/em/AppMain.d.ts
CHANGED
package/app/em/AppTheme.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { AppProps as NextAppProps } from "next/app";
|
|
3
3
|
import { Theme } from "@mui/material/styles";
|
|
4
4
|
import { EmotionCache } from "@emotion/react";
|
|
5
|
-
export
|
|
5
|
+
export type AppThemeProps = React.PropsWithChildren<NextAppProps & {
|
|
6
6
|
emotionCache?: EmotionCache;
|
|
7
7
|
/**
|
|
8
8
|
* A theme object
|
package/app/em/auth/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AppProps } from "next/app";
|
|
2
2
|
import { AppThemeProps } from "../AppTheme";
|
|
3
3
|
import { AppMainProps } from "../AppMain";
|
|
4
|
-
export
|
|
4
|
+
export type NextAppProps = AppProps<{
|
|
5
5
|
session: any;
|
|
6
6
|
}> & AppThemeProps & AppMainProps;
|
|
7
7
|
/**
|
package/app/em/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AppProps } from "next/app";
|
|
2
2
|
import { AppThemeProps } from "./AppTheme";
|
|
3
3
|
import { AppMainProps } from "./AppMain";
|
|
4
|
-
export
|
|
4
|
+
export type NextAppProps = AppProps & AppThemeProps & AppMainProps;
|
|
5
5
|
/**
|
|
6
6
|
* App
|
|
7
7
|
*/
|
package/app/sc/AppMain.d.ts
CHANGED
package/app/sc/AppTheme.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { AppProps as NextAppProps } from "next/app";
|
|
3
3
|
import { Theme } from "@koine/react/sc";
|
|
4
|
-
export
|
|
4
|
+
export type AppThemeProps = React.PropsWithChildren<NextAppProps & {
|
|
5
5
|
/**
|
|
6
6
|
* A theme object
|
|
7
7
|
*/
|
package/app/sc/auth/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AppProps } from "next/app";
|
|
2
2
|
import { AppThemeProps } from "../AppTheme";
|
|
3
3
|
import { AppMainProps } from "../AppMain";
|
|
4
|
-
export
|
|
4
|
+
export type NextAppProps = AppProps<{
|
|
5
5
|
session: any;
|
|
6
6
|
}> & AppThemeProps & AppMainProps;
|
|
7
7
|
/**
|
package/app/sc/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AppProps } from "next/app";
|
|
2
2
|
import { AppThemeProps } from "./AppTheme";
|
|
3
3
|
import { AppMainProps } from "./AppMain";
|
|
4
|
-
export
|
|
4
|
+
export type NextAppProps = AppProps & AppThemeProps & AppMainProps;
|
|
5
5
|
/**
|
|
6
6
|
* App
|
|
7
7
|
*
|
package/auth/helpers.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { TranslateLoose } from "../types-i18n";
|
|
|
2
2
|
/**
|
|
3
3
|
* @see next/auth `pages` mapping: https://next-auth.js.org/configuration/pages`
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export type AuthRoutesMap = {
|
|
6
6
|
login?: string;
|
|
7
7
|
profile?: string;
|
|
8
8
|
register?: string;
|
package/config/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { NextConfig } from "next";
|
|
2
2
|
import type { Redirect, Rewrite } from "next/dist/lib/load-custom-routes";
|
|
3
|
-
|
|
3
|
+
type Route = string | {
|
|
4
4
|
[key: string]: Route | string;
|
|
5
5
|
};
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
type Routes = Record<string, Route>;
|
|
7
|
+
type RoutesMapRoute = {
|
|
8
8
|
template: string;
|
|
9
9
|
pathname: string;
|
|
10
10
|
wildcard?: boolean;
|
|
@@ -58,7 +58,7 @@ export declare function getRedirects(defaultLocale: string, routes: Routes, perm
|
|
|
58
58
|
/**
|
|
59
59
|
*/
|
|
60
60
|
export declare function getRewrites(routes: Routes, debug?: boolean): Promise<Rewrite[]>;
|
|
61
|
-
|
|
61
|
+
type KoineNextConfig = {
|
|
62
62
|
/** @default true Nx monorepo setup */
|
|
63
63
|
nx?: boolean;
|
|
64
64
|
/** @default true Svg to react components */
|
package/config/index.js
CHANGED
|
@@ -202,32 +202,23 @@ export function getRewrites(routes, debug) {
|
|
|
202
202
|
* and it enables the same for `next-translate`.
|
|
203
203
|
*/
|
|
204
204
|
export function withKoine(_a) {
|
|
205
|
-
var _b
|
|
205
|
+
var _b;
|
|
206
206
|
if (_a === void 0) { _a = {
|
|
207
207
|
i18n: { locales: ["en"], defaultLocale: "en" },
|
|
208
208
|
}; }
|
|
209
|
-
var
|
|
209
|
+
var _c = _a.nx, nx = _c === void 0 ? true : _c, _d = _a.svg, svg = _d === void 0 ? true : _d, _e = _a.sc, sc = _e === void 0 ? true : _e, page = _a.page, routes = _a.routes, permanent = _a.permanent, debug = _a.debug, custom = __rest(_a, ["nx", "svg", "sc", "page", "routes", "permanent", "debug"]);
|
|
210
210
|
var nextConfig = __assign({
|
|
211
211
|
// @see https://nextjs.org/docs/api-reference/next.config.js/custom-page-extensions#including-non-page-files-in-the-pages-directory
|
|
212
212
|
pageExtensions: page ? ["page.tsx", "page.ts"] : undefined, eslint: {
|
|
213
213
|
ignoreDuringBuilds: true, // we have this strict check on each commit
|
|
214
214
|
}, typescript: {
|
|
215
215
|
ignoreBuildErrors: true, // we have this strict check on each commit
|
|
216
|
-
}, poweredByHeader: false, swcMinify: true,
|
|
216
|
+
}, poweredByHeader: false, swcMinify: true, modularizeImports: __assign({ "@koine/api": { transform: "@koine/api/{{member}}" }, "@koine/browser": { transform: "@koine/browser/{{member}}" }, "@koine/dom": { transform: "@koine/dom/{{member}}" }, "@koine/next/?(((\\w*)?/?)*)": { transform: "@koine/next/{{ matches.[1] }}/{{member}}" }, "@koine/react/?(((\\w*)?/?)*)": { transform: "@koine/react/{{ matches.[1] }}/{{member}}" }, "@koine/utils": { transform: "@koine/utils/{{member}}" } }, (custom["modularizeImports"] || {})), experimental: __assign({
|
|
217
217
|
// @see https://github.com/vercel/vercel/discussions/5973#discussioncomment-472618
|
|
218
218
|
// @see critters error https://github.com/vercel/next.js/issues/20742
|
|
219
219
|
// optimizeCss: true,
|
|
220
220
|
// @see https://github.com/vercel/next.js/discussions/30174#discussion-3643870
|
|
221
|
-
scrollRestoration: true }, (custom["experimental"] || {})),
|
|
222
|
-
// @see https://nextjs.org/docs/advanced-features/compiler#modularize-imports
|
|
223
|
-
modularizeImports: __assign(__assign({}, (((_b = custom === null || custom === void 0 ? void 0 : custom["experimental"]) === null || _b === void 0 ? void 0 : _b.modularizeImports) || {})), {
|
|
224
|
-
// FIXME: make these work with the right file/folder structure?
|
|
225
|
-
// "@koine/react/?(((\\w*)?/?)*)": {
|
|
226
|
-
// transform: "@koine/react/{{ matches.[1] }}/{{member}}",
|
|
227
|
-
// },
|
|
228
|
-
"@koine/api": { transform: "@koine/api/{{member}}" }, "@koine/browser": { transform: "@koine/browser/{{member}}" }, "@koine/dom": { transform: "@koine/dom/{{member}}" }, "@koine/next": { transform: "@koine/next/{{member}}" }, "@koine/utils": { transform: "@koine/utils/{{member}}" } }) }),
|
|
229
|
-
// @see https://github.com/vercel/next.js/issues/7322#issuecomment-887330111
|
|
230
|
-
reactStrictMode: true }, custom);
|
|
221
|
+
scrollRestoration: true }, (custom["experimental"] || {})) }, custom);
|
|
231
222
|
if (svg) {
|
|
232
223
|
if (nx) {
|
|
233
224
|
// @see https://github.com/gregberge/svgr
|
|
@@ -270,7 +261,7 @@ export function withKoine(_a) {
|
|
|
270
261
|
}
|
|
271
262
|
if (routes) {
|
|
272
263
|
// we pass the default values, so we can assert I guess
|
|
273
|
-
var defaultLocale_1 = (
|
|
264
|
+
var defaultLocale_1 = (_b = nextConfig === null || nextConfig === void 0 ? void 0 : nextConfig.i18n) === null || _b === void 0 ? void 0 : _b.defaultLocale;
|
|
274
265
|
return __assign(__assign({}, nextConfig), { redirects: function () {
|
|
275
266
|
return __awaiter(this, void 0, void 0, function () {
|
|
276
267
|
var defaults, customs;
|
package/getT.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Translate, TranslateNamespace } from "./types-i18n";
|
|
2
|
-
export
|
|
2
|
+
export 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
|
|
5
5
|
* [`resolveJsonModule`](https://www.typescriptlang.org/tsconfig#resolveJsonModule)
|
package/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export * from "./ThemeContext";
|
|
|
18
18
|
export * from "./ThemeProvider";
|
|
19
19
|
export * from "./to";
|
|
20
20
|
export * from "./translationAsOptions";
|
|
21
|
+
export * from "./TransText";
|
|
21
22
|
export * from "./types-i18n";
|
|
22
23
|
export * from "./types-seo";
|
|
23
24
|
export * from "./useBackUrl";
|
package/index.js
CHANGED
|
@@ -20,6 +20,7 @@ export * from "./ThemeContext";
|
|
|
20
20
|
export * from "./ThemeProvider";
|
|
21
21
|
export * from "./to";
|
|
22
22
|
export * from "./translationAsOptions";
|
|
23
|
+
export * from "./TransText";
|
|
23
24
|
export * from "./types-i18n";
|
|
24
25
|
export * from "./types-seo";
|
|
25
26
|
export * from "./useBackUrl";
|
package/node/NextImg.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getNextImgProps =
|
|
3
|
+
exports.getNextImgProps = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
|
-
var image_1 = tslib_1.__importDefault(require("next/image"));
|
|
6
|
-
exports.NextImg = image_1.default;
|
|
7
5
|
function getNextImgProps(_a) {
|
|
8
6
|
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 = tslib_1.__rest(_a, ["src", "alt", "layout", "blurDataURL", "width", "height", "priority", "objectFit", "objectPosition"]);
|
|
9
7
|
var nextImgProps = {
|
|
@@ -23,4 +21,4 @@ function getNextImgProps(_a) {
|
|
|
23
21
|
};
|
|
24
22
|
}
|
|
25
23
|
exports.getNextImgProps = getNextImgProps;
|
|
26
|
-
exports.default =
|
|
24
|
+
exports.default = getNextImgProps;
|
package/node/Seo.js
CHANGED
|
@@ -3,12 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Seo = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
|
|
6
|
+
// import { memo } from "react";
|
|
7
7
|
var head_1 = tslib_1.__importDefault(require("next/head"));
|
|
8
8
|
var seoBuildTags_1 = require("./seoBuildTags");
|
|
9
|
-
var _Seo = function (props) {
|
|
10
|
-
return (0, jsx_runtime_1.jsx)(head_1.default, { children: (0, seoBuildTags_1.seoBuildTags)(props) });
|
|
11
|
-
};
|
|
12
9
|
/**
|
|
13
10
|
* Adapted from [garmeeh/next-seo](https://github.com/garmeeh/next-seo)
|
|
14
11
|
*
|
|
@@ -30,5 +27,8 @@ var _Seo = function (props) {
|
|
|
30
27
|
* <Seo title="MyApp | Some description" titleTemplate="%s" />
|
|
31
28
|
* ```
|
|
32
29
|
*/
|
|
33
|
-
|
|
30
|
+
var Seo = function (props) {
|
|
31
|
+
return (0, jsx_runtime_1.jsx)(head_1.default, { children: (0, seoBuildTags_1.seoBuildTags)(props) });
|
|
32
|
+
};
|
|
33
|
+
exports.Seo = Seo;
|
|
34
34
|
exports.default = exports.Seo;
|
package/node/SeoDefaults.js
CHANGED
|
@@ -3,15 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SeoDefaults = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
|
|
6
|
+
// import { memo } from "react";
|
|
7
7
|
var head_1 = tslib_1.__importDefault(require("next/head"));
|
|
8
8
|
// import { useRouter } from "next/router";
|
|
9
9
|
// import { getSiteUrl } from "../utils";
|
|
10
10
|
var seoBuildTags_1 = require("./seoBuildTags");
|
|
11
|
-
var
|
|
11
|
+
var SeoDefaults = function (props) {
|
|
12
12
|
// const router = useRouter();
|
|
13
13
|
// props.openGraph.url = getSiteUrl(router.asPath);
|
|
14
14
|
return (0, jsx_runtime_1.jsx)(head_1.default, { children: (0, seoBuildTags_1.seoBuildTags)(props) });
|
|
15
15
|
};
|
|
16
|
-
exports.SeoDefaults =
|
|
16
|
+
exports.SeoDefaults = SeoDefaults;
|
|
17
17
|
exports.default = exports.SeoDefaults;
|
|
@@ -0,0 +1,7 @@
|
|
|
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/node/config/index.js
CHANGED
|
@@ -212,32 +212,23 @@ exports.getRewrites = getRewrites;
|
|
|
212
212
|
* and it enables the same for `next-translate`.
|
|
213
213
|
*/
|
|
214
214
|
function withKoine(_a) {
|
|
215
|
-
var _b
|
|
215
|
+
var _b;
|
|
216
216
|
if (_a === void 0) { _a = {
|
|
217
217
|
i18n: { locales: ["en"], defaultLocale: "en" },
|
|
218
218
|
}; }
|
|
219
|
-
var
|
|
219
|
+
var _c = _a.nx, nx = _c === void 0 ? true : _c, _d = _a.svg, svg = _d === void 0 ? true : _d, _e = _a.sc, sc = _e === void 0 ? true : _e, page = _a.page, routes = _a.routes, permanent = _a.permanent, debug = _a.debug, custom = tslib_1.__rest(_a, ["nx", "svg", "sc", "page", "routes", "permanent", "debug"]);
|
|
220
220
|
var nextConfig = tslib_1.__assign({
|
|
221
221
|
// @see https://nextjs.org/docs/api-reference/next.config.js/custom-page-extensions#including-non-page-files-in-the-pages-directory
|
|
222
222
|
pageExtensions: page ? ["page.tsx", "page.ts"] : undefined, eslint: {
|
|
223
223
|
ignoreDuringBuilds: true, // we have this strict check on each commit
|
|
224
224
|
}, typescript: {
|
|
225
225
|
ignoreBuildErrors: true, // we have this strict check on each commit
|
|
226
|
-
}, poweredByHeader: false, swcMinify: true,
|
|
226
|
+
}, poweredByHeader: false, swcMinify: true, modularizeImports: tslib_1.__assign({ "@koine/api": { transform: "@koine/api/{{member}}" }, "@koine/browser": { transform: "@koine/browser/{{member}}" }, "@koine/dom": { transform: "@koine/dom/{{member}}" }, "@koine/next/?(((\\w*)?/?)*)": { transform: "@koine/next/{{ matches.[1] }}/{{member}}" }, "@koine/react/?(((\\w*)?/?)*)": { transform: "@koine/react/{{ matches.[1] }}/{{member}}" }, "@koine/utils": { transform: "@koine/utils/{{member}}" } }, (custom["modularizeImports"] || {})), experimental: tslib_1.__assign({
|
|
227
227
|
// @see https://github.com/vercel/vercel/discussions/5973#discussioncomment-472618
|
|
228
228
|
// @see critters error https://github.com/vercel/next.js/issues/20742
|
|
229
229
|
// optimizeCss: true,
|
|
230
230
|
// @see https://github.com/vercel/next.js/discussions/30174#discussion-3643870
|
|
231
|
-
scrollRestoration: true }, (custom["experimental"] || {})),
|
|
232
|
-
// @see https://nextjs.org/docs/advanced-features/compiler#modularize-imports
|
|
233
|
-
modularizeImports: tslib_1.__assign(tslib_1.__assign({}, (((_b = custom === null || custom === void 0 ? void 0 : custom["experimental"]) === null || _b === void 0 ? void 0 : _b.modularizeImports) || {})), {
|
|
234
|
-
// FIXME: make these work with the right file/folder structure?
|
|
235
|
-
// "@koine/react/?(((\\w*)?/?)*)": {
|
|
236
|
-
// transform: "@koine/react/{{ matches.[1] }}/{{member}}",
|
|
237
|
-
// },
|
|
238
|
-
"@koine/api": { transform: "@koine/api/{{member}}" }, "@koine/browser": { transform: "@koine/browser/{{member}}" }, "@koine/dom": { transform: "@koine/dom/{{member}}" }, "@koine/next": { transform: "@koine/next/{{member}}" }, "@koine/utils": { transform: "@koine/utils/{{member}}" } }) }),
|
|
239
|
-
// @see https://github.com/vercel/next.js/issues/7322#issuecomment-887330111
|
|
240
|
-
reactStrictMode: true }, custom);
|
|
231
|
+
scrollRestoration: true }, (custom["experimental"] || {})) }, custom);
|
|
241
232
|
if (svg) {
|
|
242
233
|
if (nx) {
|
|
243
234
|
// @see https://github.com/gregberge/svgr
|
|
@@ -280,7 +271,7 @@ function withKoine(_a) {
|
|
|
280
271
|
}
|
|
281
272
|
if (routes) {
|
|
282
273
|
// we pass the default values, so we can assert I guess
|
|
283
|
-
var defaultLocale_1 = (
|
|
274
|
+
var defaultLocale_1 = (_b = nextConfig === null || nextConfig === void 0 ? void 0 : nextConfig.i18n) === null || _b === void 0 ? void 0 : _b.defaultLocale;
|
|
284
275
|
return tslib_1.__assign(tslib_1.__assign({}, nextConfig), { redirects: function () {
|
|
285
276
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
286
277
|
var defaults, customs;
|
package/node/index.js
CHANGED
|
@@ -23,6 +23,7 @@ tslib_1.__exportStar(require("./ThemeContext"), exports);
|
|
|
23
23
|
tslib_1.__exportStar(require("./ThemeProvider"), exports);
|
|
24
24
|
tslib_1.__exportStar(require("./to"), exports);
|
|
25
25
|
tslib_1.__exportStar(require("./translationAsOptions"), exports);
|
|
26
|
+
tslib_1.__exportStar(require("./TransText"), exports);
|
|
26
27
|
tslib_1.__exportStar(require("./types-i18n"), exports);
|
|
27
28
|
tslib_1.__exportStar(require("./types-seo"), exports);
|
|
28
29
|
tslib_1.__exportStar(require("./useBackUrl"), exports);
|
package/node/seoBuildTags.js
CHANGED
|
@@ -24,6 +24,7 @@ var defaults = {
|
|
|
24
24
|
*/
|
|
25
25
|
var seoBuildTags = function (_a) {
|
|
26
26
|
var _b = _a === void 0 ? {} : _a, seo = _b.seo, hidden = _b.hidden, keywords = _b.keywords, _c = _b.title, title = _c === void 0 ? "" : _c, titleTemplate = _b.titleTemplate, defaultTitle = _b.defaultTitle, noindex = _b.noindex, nofollow = _b.nofollow, description = _b.description, _d = _b.languageAlternates, languageAlternates = _d === void 0 ? [] : _d, twitter = _b.twitter, facebook = _b.facebook, openGraph = _b.openGraph, ogAlias = _b.og, canonical = _b.canonical, metaTags = _b.metaTags, linkTags = _b.linkTags;
|
|
27
|
+
var id = "seo-";
|
|
27
28
|
var render = [];
|
|
28
29
|
var $names = {};
|
|
29
30
|
var $properties = {};
|
|
@@ -40,7 +41,7 @@ var seoBuildTags = function (_a) {
|
|
|
40
41
|
title = defaultTitle;
|
|
41
42
|
}
|
|
42
43
|
if (title) {
|
|
43
|
-
render.push((0, jsx_runtime_1.jsx)("title", { children: title }, "title"));
|
|
44
|
+
render.push((0, jsx_runtime_1.jsx)("title", { children: title }, id + "title"));
|
|
44
45
|
$properties["og:title"] = title; // overridden later...
|
|
45
46
|
}
|
|
46
47
|
$names["robots"] = "".concat(noindex || hidden ? "noindex" : "index", ",").concat(nofollow || hidden ? "nofollow" : "follow");
|
|
@@ -54,12 +55,13 @@ var seoBuildTags = function (_a) {
|
|
|
54
55
|
$names["keywords"] = (0, utils_1.isArray)(keywords) ? keywords.join(", ") : keywords;
|
|
55
56
|
}
|
|
56
57
|
if ((languageAlternates === null || languageAlternates === void 0 ? void 0 : languageAlternates.length) > 0) {
|
|
57
|
-
languageAlternates.forEach(function (
|
|
58
|
-
|
|
58
|
+
languageAlternates.forEach(function (_a) {
|
|
59
|
+
var href = _a.href, hrefLang = _a.hrefLang;
|
|
60
|
+
render.push((0, jsx_runtime_1.jsx)("link", { rel: "alternate", hrefLang: hrefLang, href: href }, id + "languageAlternate-" + hrefLang));
|
|
59
61
|
});
|
|
60
62
|
}
|
|
61
63
|
if (canonical) {
|
|
62
|
-
render.push((0, jsx_runtime_1.jsx)("link", { rel: "canonical", href: canonical }, "canonical"));
|
|
64
|
+
render.push((0, jsx_runtime_1.jsx)("link", { rel: "canonical", href: canonical }, id + "canonical"));
|
|
63
65
|
$properties["og:url"] = canonical;
|
|
64
66
|
}
|
|
65
67
|
if (facebook === null || facebook === void 0 ? void 0 : facebook.appId)
|
|
@@ -83,27 +85,25 @@ var seoBuildTags = function (_a) {
|
|
|
83
85
|
$properties["og:type"] = og.type.toLowerCase();
|
|
84
86
|
if (og === null || og === void 0 ? void 0 : og.locale)
|
|
85
87
|
$properties["og:locale"] = og.locale;
|
|
86
|
-
if (og === null || og === void 0 ? void 0 : og.
|
|
87
|
-
$properties["og:
|
|
88
|
+
if (og === null || og === void 0 ? void 0 : og.siteName)
|
|
89
|
+
$properties["og:siteName"] = og.siteName;
|
|
88
90
|
var ogimage = (og === null || og === void 0 ? void 0 : og.image) || (seo === null || seo === void 0 ? void 0 : seo.ogimage);
|
|
89
91
|
if (ogimage)
|
|
90
92
|
$properties["og:image"] = ogimage;
|
|
91
93
|
Object.keys($names).forEach(function (key) {
|
|
92
|
-
render.push((0, jsx_runtime_1.jsx)("meta", { name: key, content: $names[key] }, key));
|
|
94
|
+
render.push((0, jsx_runtime_1.jsx)("meta", { name: key, content: $names[key] }, id + "name-" + key));
|
|
93
95
|
});
|
|
94
96
|
Object.keys($properties).forEach(function (key) {
|
|
95
|
-
render.push((0, jsx_runtime_1.jsx)("meta", { property: key, content: $properties[key] }, key));
|
|
97
|
+
render.push((0, jsx_runtime_1.jsx)("meta", { property: key, content: $properties[key] }, id + "prop-" + +key));
|
|
96
98
|
});
|
|
97
99
|
if (metaTags && metaTags.length > 0) {
|
|
98
100
|
metaTags.forEach(function (tag) {
|
|
99
|
-
|
|
100
|
-
render.push((0, jsx_runtime_1.jsx)("meta", tslib_1.__assign({}, tag), "meta:".concat((_c = (_b = (_a = tag.keyOverride) !== null && _a !== void 0 ? _a : tag.name) !== null && _b !== void 0 ? _b : tag.property) !== null && _c !== void 0 ? _c : tag.httpEquiv)));
|
|
101
|
+
render.push((0, jsx_runtime_1.jsx)("meta", tslib_1.__assign({}, tag), id + "meta-" + (tag.name || tag.property || tag.httpEquiv)));
|
|
101
102
|
});
|
|
102
103
|
}
|
|
103
104
|
if (linkTags === null || linkTags === void 0 ? void 0 : linkTags.length) {
|
|
104
105
|
linkTags.forEach(function (tag) {
|
|
105
|
-
|
|
106
|
-
render.push((0, jsx_runtime_1.jsx)("link", tslib_1.__assign({}, tag), "link".concat((_a = tag.keyOverride) !== null && _a !== void 0 ? _a : tag.href).concat(tag.rel)));
|
|
106
|
+
render.push((0, jsx_runtime_1.jsx)("link", tslib_1.__assign({}, tag), id + "link-" + (tag.href || tag.rel)));
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
109
|
// TODO: alternates and canonical
|
package/package.json
CHANGED
|
@@ -10,41 +10,55 @@
|
|
|
10
10
|
},
|
|
11
11
|
"@emotion/server": {
|
|
12
12
|
"optional": true
|
|
13
|
+
},
|
|
14
|
+
"@emotion/styled": {
|
|
15
|
+
"optional": true
|
|
16
|
+
},
|
|
17
|
+
"framer-motion": {
|
|
18
|
+
"optional": true
|
|
19
|
+
},
|
|
20
|
+
"next-auth": {
|
|
21
|
+
"optional": true
|
|
22
|
+
},
|
|
23
|
+
"react-is": {
|
|
24
|
+
"optional": true
|
|
25
|
+
},
|
|
26
|
+
"styled-components": {
|
|
27
|
+
"optional": true
|
|
13
28
|
}
|
|
14
29
|
},
|
|
15
30
|
"main": "./node/index.js",
|
|
16
|
-
"
|
|
17
|
-
"dependencies": {
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"@koine/
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"@
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"react-
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"@
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"next-
|
|
44
|
-
"
|
|
31
|
+
"types": "./index.d.ts",
|
|
32
|
+
"dependencies": {},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"react": "18.2.0",
|
|
35
|
+
"next": "13.1.6",
|
|
36
|
+
"@koine/browser": "1.1.0",
|
|
37
|
+
"@koine/utils": "1.1.0",
|
|
38
|
+
"ts-debounce": "4.0.0",
|
|
39
|
+
"type-fest": "3.5.3",
|
|
40
|
+
"@koine/dom": "1.1.0",
|
|
41
|
+
"date-fns-tz": "1.3.7",
|
|
42
|
+
"framer-motion": "7.10.3",
|
|
43
|
+
"next-auth": "4.19.0",
|
|
44
|
+
"@mui/material": "5.11.6",
|
|
45
|
+
"@emotion/react": "11.10.5",
|
|
46
|
+
"styled-components": "5.3.6",
|
|
47
|
+
"react-hook-form": "7.42.1",
|
|
48
|
+
"@mui/base": "5.0.0-alpha.115",
|
|
49
|
+
"react-icons": "4.7.1",
|
|
50
|
+
"date-fns": "2.29.3",
|
|
51
|
+
"react-swipeable": "7.0.0",
|
|
52
|
+
"@tiptap/react": "2.0.0-beta.209",
|
|
53
|
+
"@tiptap/starter-kit": "2.0.0-beta.209",
|
|
54
|
+
"@kuus/yup": "1.0.0-beta.7",
|
|
55
|
+
"react-popper": "2.3.0",
|
|
56
|
+
"tslib": "2.5.0",
|
|
57
|
+
"@emotion/server": "11.10.0",
|
|
58
|
+
"next-translate": "1.6.0",
|
|
59
|
+
"next-seo": "5.15.0",
|
|
60
|
+
"@hookform/resolvers": "2.9.10"
|
|
45
61
|
},
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"module": "./index.js",
|
|
49
|
-
"types": "./index.d.ts"
|
|
62
|
+
"version": "1.1.0",
|
|
63
|
+
"module": "./index.js"
|
|
50
64
|
}
|
package/seoBuildTags.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { SeoProps } from "./Seo";
|
|
3
3
|
import type { SeoDefaultsProps } from "./SeoDefaults";
|
|
4
|
-
|
|
4
|
+
export type MetaTag = React.DetailedHTMLProps<React.MetaHTMLAttributes<HTMLMetaElement>, HTMLMetaElement>;
|
|
5
|
+
export type LinkTag = React.DetailedHTMLProps<React.LinkHTMLAttributes<HTMLLinkElement>, HTMLLinkElement>;
|
|
6
|
+
type BuildTagsParams = SeoProps & SeoDefaultsProps;
|
|
5
7
|
/**
|
|
6
8
|
* Comparing to `next-seo` we do a couple of things in addition while many
|
|
7
9
|
* others are removed.
|
package/seoBuildTags.js
CHANGED
|
@@ -21,6 +21,7 @@ var defaults = {
|
|
|
21
21
|
*/
|
|
22
22
|
export var seoBuildTags = function (_a) {
|
|
23
23
|
var _b = _a === void 0 ? {} : _a, seo = _b.seo, hidden = _b.hidden, keywords = _b.keywords, _c = _b.title, title = _c === void 0 ? "" : _c, titleTemplate = _b.titleTemplate, defaultTitle = _b.defaultTitle, noindex = _b.noindex, nofollow = _b.nofollow, description = _b.description, _d = _b.languageAlternates, languageAlternates = _d === void 0 ? [] : _d, twitter = _b.twitter, facebook = _b.facebook, openGraph = _b.openGraph, ogAlias = _b.og, canonical = _b.canonical, metaTags = _b.metaTags, linkTags = _b.linkTags;
|
|
24
|
+
var id = "seo-";
|
|
24
25
|
var render = [];
|
|
25
26
|
var $names = {};
|
|
26
27
|
var $properties = {};
|
|
@@ -37,7 +38,7 @@ export var seoBuildTags = function (_a) {
|
|
|
37
38
|
title = defaultTitle;
|
|
38
39
|
}
|
|
39
40
|
if (title) {
|
|
40
|
-
render.push(_jsx("title", { children: title }, "title"));
|
|
41
|
+
render.push(_jsx("title", { children: title }, id + "title"));
|
|
41
42
|
$properties["og:title"] = title; // overridden later...
|
|
42
43
|
}
|
|
43
44
|
$names["robots"] = "".concat(noindex || hidden ? "noindex" : "index", ",").concat(nofollow || hidden ? "nofollow" : "follow");
|
|
@@ -51,12 +52,13 @@ export var seoBuildTags = function (_a) {
|
|
|
51
52
|
$names["keywords"] = isArray(keywords) ? keywords.join(", ") : keywords;
|
|
52
53
|
}
|
|
53
54
|
if ((languageAlternates === null || languageAlternates === void 0 ? void 0 : languageAlternates.length) > 0) {
|
|
54
|
-
languageAlternates.forEach(function (
|
|
55
|
-
|
|
55
|
+
languageAlternates.forEach(function (_a) {
|
|
56
|
+
var href = _a.href, hrefLang = _a.hrefLang;
|
|
57
|
+
render.push(_jsx("link", { rel: "alternate", hrefLang: hrefLang, href: href }, id + "languageAlternate-" + hrefLang));
|
|
56
58
|
});
|
|
57
59
|
}
|
|
58
60
|
if (canonical) {
|
|
59
|
-
render.push(_jsx("link", { rel: "canonical", href: canonical }, "canonical"));
|
|
61
|
+
render.push(_jsx("link", { rel: "canonical", href: canonical }, id + "canonical"));
|
|
60
62
|
$properties["og:url"] = canonical;
|
|
61
63
|
}
|
|
62
64
|
if (facebook === null || facebook === void 0 ? void 0 : facebook.appId)
|
|
@@ -80,27 +82,25 @@ export var seoBuildTags = function (_a) {
|
|
|
80
82
|
$properties["og:type"] = og.type.toLowerCase();
|
|
81
83
|
if (og === null || og === void 0 ? void 0 : og.locale)
|
|
82
84
|
$properties["og:locale"] = og.locale;
|
|
83
|
-
if (og === null || og === void 0 ? void 0 : og.
|
|
84
|
-
$properties["og:
|
|
85
|
+
if (og === null || og === void 0 ? void 0 : og.siteName)
|
|
86
|
+
$properties["og:siteName"] = og.siteName;
|
|
85
87
|
var ogimage = (og === null || og === void 0 ? void 0 : og.image) || (seo === null || seo === void 0 ? void 0 : seo.ogimage);
|
|
86
88
|
if (ogimage)
|
|
87
89
|
$properties["og:image"] = ogimage;
|
|
88
90
|
Object.keys($names).forEach(function (key) {
|
|
89
|
-
render.push(_jsx("meta", { name: key, content: $names[key] }, key));
|
|
91
|
+
render.push(_jsx("meta", { name: key, content: $names[key] }, id + "name-" + key));
|
|
90
92
|
});
|
|
91
93
|
Object.keys($properties).forEach(function (key) {
|
|
92
|
-
render.push(_jsx("meta", { property: key, content: $properties[key] }, key));
|
|
94
|
+
render.push(_jsx("meta", { property: key, content: $properties[key] }, id + "prop-" + +key));
|
|
93
95
|
});
|
|
94
96
|
if (metaTags && metaTags.length > 0) {
|
|
95
97
|
metaTags.forEach(function (tag) {
|
|
96
|
-
|
|
97
|
-
render.push(_jsx("meta", __assign({}, tag), "meta:".concat((_c = (_b = (_a = tag.keyOverride) !== null && _a !== void 0 ? _a : tag.name) !== null && _b !== void 0 ? _b : tag.property) !== null && _c !== void 0 ? _c : tag.httpEquiv)));
|
|
98
|
+
render.push(_jsx("meta", __assign({}, tag), id + "meta-" + (tag.name || tag.property || tag.httpEquiv)));
|
|
98
99
|
});
|
|
99
100
|
}
|
|
100
101
|
if (linkTags === null || linkTags === void 0 ? void 0 : linkTags.length) {
|
|
101
102
|
linkTags.forEach(function (tag) {
|
|
102
|
-
|
|
103
|
-
render.push(_jsx("link", __assign({}, tag), "link".concat((_a = tag.keyOverride) !== null && _a !== void 0 ? _a : tag.href).concat(tag.rel)));
|
|
103
|
+
render.push(_jsx("link", __assign({}, tag), id + "link-" + (tag.href || tag.rel)));
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
// TODO: alternates and canonical
|
package/to.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import type { TranslateNamespaced, TranslatedRoute } from "./types-i18n";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type OnlyStatic<T extends string> = T extends `${string}.[${string}].${string}` | `${string}.[${string}]` | `[${string}].${string}` | `[${string}]` ? never : T;
|
|
3
|
+
type OnlyDynamic<T extends string> = T extends `${string}.[${string}].${string}` | `${string}.[${string}]` | `[${string}].${string}` | `[${string}]` ? T : never;
|
|
4
4
|
/**
|
|
5
5
|
* @borrows [awesome-template-literal-types](https://github.com/ghoullier/awesome-template-literal-types#router-params-parsing)
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
type ExtractRouteParams<T extends string> = string extends T ? Record<string, string> : T extends `${infer _Start}[${infer Param}].${infer Rest}` ? {
|
|
8
8
|
[k in Param | keyof ExtractRouteParams<Rest>]: string | number;
|
|
9
9
|
} : T extends `${infer _Start}[${infer Param}]` ? {
|
|
10
10
|
[k in Param]: string | number;
|
|
11
11
|
} : {};
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
12
|
+
export type ToTranslate = TranslateNamespaced<"~">;
|
|
13
|
+
export type ToStaticRoute = OnlyStatic<TranslatedRoute>;
|
|
14
|
+
export type ToDynamicRoute = OnlyDynamic<TranslatedRoute>;
|
|
15
|
+
export type ToArgs = [ToStaticRoute] | [ToDynamicRoute, ExtractRouteParams<ToDynamicRoute>];
|
|
16
16
|
/**
|
|
17
17
|
* `To` named route utility. It accept either a single argument if that is a static
|
|
18
18
|
* route name or a second argument that interpolates the dynamic portions of
|
package/types-i18n.d.ts
CHANGED
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
* would use a `~my~account-settings.json` file.
|
|
44
44
|
* - `ComponentName.json`: pascal cased for **components** specific data
|
|
45
45
|
*/
|
|
46
|
-
export
|
|
47
|
-
export
|
|
48
|
-
|
|
49
|
-
export
|
|
46
|
+
export type TranslationsDictionary = Koine.Translations;
|
|
47
|
+
export type TranslateNamespace = Extract<keyof TranslationsDictionary, string>;
|
|
48
|
+
type Join<S1, S2> = S1 extends string ? S2 extends string ? `${S1}.${S2}` : S1 : never;
|
|
49
|
+
export type TranslationsPaths<T, TAddRoot extends true | undefined = undefined> = {
|
|
50
50
|
[K in Extract<keyof T, string>]: T[K] extends Array<Record<string, unknown>> ? `${K}` : T[K] extends Record<string, unknown> ? TAddRoot extends true ? `${K}` | Join<K, TranslationsPaths<T[K], TAddRoot>> : Join<K, TranslationsPaths<T[K], TAddRoot>> : T[K] extends Array<string | number | boolean> ? `${K}` : T[K] extends string | number | boolean ? K extends string ? `${K}` : never : never;
|
|
51
51
|
}[Extract<keyof T, string>];
|
|
52
|
-
export
|
|
52
|
+
export type TranslationsAllPaths = {
|
|
53
53
|
[N in Extract<keyof TranslationsDictionary, string>]: {
|
|
54
54
|
[K in Extract<keyof TranslationsDictionary[N], string>]: TranslationsDictionary[N][K] extends Array<Record<string, unknown>> ? `${N}:${K}` : TranslationsDictionary[N][K] extends Record<string, unknown> ? `${N}:${K}` | Join<K extends string ? `${N}:${K}` : `${N}:`, TranslationsPaths<TranslationsDictionary[N][K], true>> : TranslationsDictionary[N][K] extends Array<string | number | boolean> ? `${N}:${K}` : TranslationsDictionary[N][K] extends string | number | boolean ? K extends string ? `${N}:${K}` : `${N}:` : never;
|
|
55
55
|
}[Extract<keyof TranslationsDictionary[N], string>];
|
|
@@ -61,7 +61,7 @@ export declare type TranslationsAllPaths = {
|
|
|
61
61
|
* - `""` as a shortcut for `{ fallback: "" }`
|
|
62
62
|
*
|
|
63
63
|
*/
|
|
64
|
-
export
|
|
64
|
+
export type TranslationShortcut = "obj" | "";
|
|
65
65
|
/**
|
|
66
66
|
* Query object to populate the returned translated string interpolating data
|
|
67
67
|
* or a TranslationShortcut.
|
|
@@ -69,7 +69,7 @@ export declare type TranslationShortcut = "obj" | "";
|
|
|
69
69
|
* NOTE: when using a shortcut passing TranslationOptions to `t()` is not supported
|
|
70
70
|
* TODO: type safe this behaviour of the third argument (options).
|
|
71
71
|
*/
|
|
72
|
-
export
|
|
72
|
+
export type TranslationQuery = undefined | null | TranslationShortcut | {
|
|
73
73
|
[key: string]: string | number | boolean;
|
|
74
74
|
};
|
|
75
75
|
/**
|
|
@@ -78,7 +78,7 @@ export declare type TranslationQuery = undefined | null | TranslationShortcut |
|
|
|
78
78
|
* NOTE: when using a shortcut passing TranslationOptions to `t()` is not supported
|
|
79
79
|
* TODO: type safe this behaviour of the third argument (options).
|
|
80
80
|
*/
|
|
81
|
-
export
|
|
81
|
+
export type TranslationOptions = undefined | TranslationShortcut | {
|
|
82
82
|
returnObjects?: boolean;
|
|
83
83
|
fallback?: string | string[];
|
|
84
84
|
default?: string;
|
|
@@ -86,29 +86,29 @@ export declare type TranslationOptions = undefined | TranslationShortcut | {
|
|
|
86
86
|
/**
|
|
87
87
|
* Translate function which optionally accept a namespace as first argument
|
|
88
88
|
*/
|
|
89
|
-
export
|
|
89
|
+
export type Translate<TNamespace extends TranslateNamespace | undefined> = TNamespace extends TranslateNamespace ? TranslateNamespaced<TNamespace> : TranslateDefault;
|
|
90
90
|
/**
|
|
91
91
|
* Translate function **without** namespace, it allows to select any of the all
|
|
92
92
|
* available strings in all namespaces.
|
|
93
93
|
*/
|
|
94
|
-
export
|
|
94
|
+
export type TranslateDefault = <TReturn = string>(s: TranslationsAllPaths, q?: TranslationQuery, o?: TranslationOptions) => TReturn;
|
|
95
95
|
/**
|
|
96
96
|
* Translate function **with** namespace, it allows to select only the all available
|
|
97
97
|
* strings in the given namespace.
|
|
98
98
|
*/
|
|
99
|
-
export
|
|
99
|
+
export type TranslateNamespaced<TNamespace extends TranslateNamespace> = <TReturn = string>(s: TranslationsPaths<TranslationsDictionary[TNamespace], true>, q?: TranslationQuery, o?: TranslationOptions) => TReturn;
|
|
100
100
|
/**
|
|
101
101
|
* Translate function loose type, to use only in implementations that uses
|
|
102
102
|
* the `t` function indirectly without needng knowledge of the string it needs
|
|
103
103
|
* to output.
|
|
104
104
|
*/
|
|
105
|
-
export
|
|
105
|
+
export type TranslateLoose = (s?: any, q?: TranslationQuery, o?: TranslationOptions) => string;
|
|
106
106
|
/**
|
|
107
107
|
* By convention routes definitions are in the `~.json` file in the locales/{locale}/
|
|
108
108
|
* root folder. This type represent every possibly name of the defined route's
|
|
109
109
|
* localised pathname (even with dynamic portions).
|
|
110
110
|
*/
|
|
111
|
-
export
|
|
111
|
+
export type TranslatedRoute = TranslationsPaths<TranslationsDictionary["~"]>;
|
|
112
112
|
/**
|
|
113
113
|
* Utility standalone type to extract all (max two level depth) children routes
|
|
114
114
|
* that starts with the given string.
|
|
@@ -120,5 +120,5 @@ export declare type TranslatedRoute = TranslationsPaths<TranslationsDictionary["
|
|
|
120
120
|
* type DashboardRoutes = TranslatedRoutesChildrenOf<"dashboard">;
|
|
121
121
|
* ```
|
|
122
122
|
*/
|
|
123
|
-
export
|
|
123
|
+
export type TranslatedRoutesChildrenOf<TStarts extends string, T extends string = TranslatedRoute> = T extends `${TStarts}.${infer First}.${infer Second}` ? First | `${First}.${Second}` : T extends `${TStarts}.${infer First}` ? First : never;
|
|
124
124
|
export {};
|
package/types-seo.d.ts
CHANGED
package/useTheme.d.ts
CHANGED