@koine/next 1.0.45 → 1.0.46
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/{Analytics/AnalyticsGoogle.d.ts → AnalyticsGoogle.d.ts} +1 -0
- package/{Analytics/AnalyticsGoogle.js → AnalyticsGoogle.js} +1 -0
- package/DynamicNamespaces.d.ts +13 -0
- package/DynamicNamespaces.js +8 -0
- package/{Favicon/Favicon.d.ts → Favicon.d.ts} +1 -0
- package/{Favicon/Favicon.js → Favicon.js} +1 -0
- package/Head.d.ts +3 -0
- package/Head.js +3 -0
- package/Link.d.ts +10 -0
- package/{Link/Link.js → Link.js} +1 -0
- package/{Img/Img.d.ts → NextImg.d.ts} +2 -6
- package/{Img/Img.js → NextImg.js} +2 -10
- package/NextImgSmart.d.ts +6 -0
- package/NextImgSmart.js +13 -0
- package/{NextProgress/NextProgress.d.ts → NextProgress.d.ts} +1 -1
- package/{NextProgress/NextProgress.js → NextProgress.js} +1 -0
- package/Seo.d.ts +27 -0
- package/Seo.js +16 -0
- package/SeoDefaults.d.ts +11 -0
- package/{Seo/SeoDefaults.js → SeoDefaults.js} +3 -2
- package/{i18n/T/index.d.ts → T.d.ts} +1 -1
- package/{i18n/T/index.js → T.js} +0 -0
- package/app/AppMain.d.ts +1 -1
- package/app/css/AppMain.js +1 -1
- package/app/css/AppTheme.d.ts +1 -1
- package/app/css/AppTheme.js +1 -1
- package/app/em/AppMain.js +1 -1
- package/app/em/AppTheme.js +1 -1
- package/app/sc/AppMain.js +1 -1
- package/{Auth → auth}/helpers.d.ts +1 -1
- package/{Auth → auth}/helpers.js +0 -0
- package/{Auth → auth}/index.d.ts +0 -0
- package/{Auth → auth}/index.js +0 -0
- package/{Head → auth}/package.json +1 -1
- package/{Auth → auth}/useLogin.d.ts +1 -0
- package/{Auth → auth}/useLogin.js +2 -1
- package/{Auth → auth}/useLoginUrl.d.ts +1 -0
- package/{Auth → auth}/useLoginUrl.js +2 -1
- package/{Auth → auth}/useLogout.d.ts +1 -0
- package/{Auth → auth}/useLogout.js +2 -1
- package/config/index.js +1 -7
- package/{utils/emotion-cache.d.ts → createEmotionCache.d.ts} +1 -0
- package/{utils/emotion-cache.js → createEmotionCache.js} +1 -0
- package/document/em/index.js +1 -1
- package/getSiteUrl.d.ts +8 -0
- package/getSiteUrl.js +12 -0
- package/{i18n/getT/index.d.ts → getT.d.ts} +2 -1
- package/{i18n/getT/index.js → getT.js} +1 -0
- package/index.d.ts +21 -7
- package/index.js +23 -7
- package/{utils/index.d.ts → load.d.ts} +1 -9
- package/{utils/index.js → load.js} +1 -13
- package/node/{Analytics/AnalyticsGoogle.js → AnalyticsGoogle.js} +1 -0
- package/node/DynamicNamespaces.js +12 -0
- package/node/{Favicon/Favicon.js → Favicon.js} +1 -0
- package/node/Head.js +7 -0
- package/node/{Link/Link.js → Link.js} +1 -0
- package/node/{Img/Img.js → NextImg.js} +2 -11
- package/node/NextImgSmart.js +17 -0
- package/node/{NextProgress/NextProgress.js → NextProgress.js} +1 -0
- package/node/{Seo/Seo.js → Seo.js} +10 -2
- package/node/{Seo/SeoDefaults.js → SeoDefaults.js} +3 -2
- package/node/{i18n/T/index.js → T.js} +0 -0
- package/node/app/css/AppMain.js +2 -2
- package/node/app/css/AppTheme.js +2 -2
- package/node/app/em/AppMain.js +2 -2
- package/node/app/em/AppTheme.js +2 -2
- package/node/app/sc/AppMain.js +2 -2
- package/node/{Auth → auth}/helpers.js +0 -0
- package/node/{Auth → auth}/index.js +0 -0
- package/node/{Auth → auth}/useLogin.js +3 -2
- package/node/{Auth → auth}/useLoginUrl.js +3 -2
- package/node/{Auth → auth}/useLogout.js +3 -2
- package/node/config/index.js +1 -7
- package/node/{utils/emotion-cache.js → createEmotionCache.js} +1 -0
- package/node/document/em/index.js +2 -2
- package/node/getSiteUrl.js +16 -0
- package/node/{i18n/getT/index.js → getT.js} +1 -0
- package/node/index.js +23 -7
- package/node/{utils/index.js → load.js} +2 -15
- package/node/revalidate.js +8 -0
- package/node/{Seo/helpers.js → seoBuildTags.js} +7 -5
- package/node/to.js +29 -0
- package/node/{i18n/translationAsOptions/index.js → translationAsOptions.js} +0 -0
- package/node/{i18n/types.js → types-i18n.js} +0 -0
- package/node/types-seo.js +2 -0
- package/node/useBackUrl.js +31 -0
- package/node/{i18n/useDateFormat/index.js → useDateFormat.js} +0 -0
- package/node/{Forms/useForm.js → useForm.js} +0 -0
- package/node/{i18n/useLocale/index.js → useLocale.js} +0 -0
- package/node/{i18n/useT/index.js → useT.js} +0 -0
- package/node/{Theme/Theme.js → useTheme.js} +1 -0
- package/node/useTo.js +18 -0
- package/package.json +5 -5
- package/revalidate.d.ts +5 -0
- package/revalidate.js +5 -0
- package/seoBuildTags.d.ts +21 -0
- package/{Seo/helpers.js → seoBuildTags.js} +5 -3
- package/to.d.ts +24 -0
- package/to.js +25 -0
- package/{i18n/translationAsOptions/index.d.ts → translationAsOptions.d.ts} +1 -1
- package/{i18n/translationAsOptions/index.js → translationAsOptions.js} +0 -0
- package/{i18n/types.d.ts → types-i18n.d.ts} +6 -0
- package/{i18n/types.js → types-i18n.js} +0 -0
- package/types-seo.d.ts +7 -0
- package/types-seo.js +1 -0
- package/useBackUrl.d.ts +2 -0
- package/useBackUrl.js +27 -0
- package/{i18n/useDateFormat/index.d.ts → useDateFormat.d.ts} +0 -0
- package/{i18n/useDateFormat/index.js → useDateFormat.js} +0 -0
- package/{Forms/useForm.d.ts → useForm.d.ts} +1 -1
- package/{Forms/useForm.js → useForm.js} +0 -0
- package/{i18n/useLocale/index.d.ts → useLocale.d.ts} +0 -0
- package/{i18n/useLocale/index.js → useLocale.js} +0 -0
- package/{i18n/useT/index.d.ts → useT.d.ts} +1 -1
- package/{i18n/useT/index.js → useT.js} +0 -0
- package/{Theme/Theme.d.ts → useTheme.d.ts} +2 -13
- package/{Theme/Theme.js → useTheme.js} +1 -0
- package/useTo.d.ts +3 -0
- package/useTo.js +14 -0
- package/Analytics/index.d.ts +0 -1
- package/Analytics/index.js +0 -1
- package/Analytics/package.json +0 -6
- package/Auth/package.json +0 -6
- package/Favicon/index.d.ts +0 -1
- package/Favicon/index.js +0 -1
- package/Favicon/package.json +0 -6
- package/Forms/index.d.ts +0 -1
- package/Forms/index.js +0 -1
- package/Forms/package.json +0 -6
- package/Head/Head.d.ts +0 -1
- package/Head/Head.js +0 -1
- package/Head/index.d.ts +0 -1
- package/Head/index.js +0 -1
- package/Img/index.d.ts +0 -1
- package/Img/index.js +0 -1
- package/Img/package.json +0 -6
- package/Link/Link.d.ts +0 -9
- package/Link/index.d.ts +0 -1
- package/Link/index.js +0 -1
- package/Link/package.json +0 -6
- package/NextProgress/index.d.ts +0 -2
- package/NextProgress/index.js +0 -1
- package/NextProgress/package.json +0 -6
- package/Seo/Seo.d.ts +0 -3
- package/Seo/Seo.js +0 -8
- package/Seo/SeoDefaults.d.ts +0 -3
- package/Seo/helpers.d.ts +0 -48
- package/Seo/index.d.ts +0 -12
- package/Seo/index.js +0 -12
- package/Seo/package.json +0 -6
- package/Theme/index.d.ts +0 -1
- package/Theme/index.js +0 -1
- package/Theme/package.json +0 -6
- package/i18n/T/package.json +0 -6
- package/i18n/getT/package.json +0 -6
- package/i18n/index.d.ts +0 -7
- package/i18n/index.js +0 -7
- package/i18n/package.json +0 -6
- package/i18n/translationAsOptions/package.json +0 -6
- package/i18n/useDateFormat/package.json +0 -6
- package/i18n/useLocale/package.json +0 -6
- package/i18n/useT/package.json +0 -6
- package/node/Analytics/index.js +0 -4
- package/node/Favicon/index.js +0 -4
- package/node/Forms/index.js +0 -4
- package/node/Head/Head.js +0 -5
- package/node/Head/index.js +0 -4
- package/node/Img/index.js +0 -4
- package/node/Link/index.js +0 -4
- package/node/NextProgress/index.js +0 -5
- package/node/Seo/index.js +0 -15
- package/node/Theme/index.js +0 -4
- package/node/i18n/index.js +0 -10
- package/utils/package.json +0 -6
|
@@ -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;
|
package/Head.d.ts
ADDED
package/Head.js
ADDED
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;
|
package/{Link/Link.js → Link.js}
RENAMED
|
@@ -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 {
|
|
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;
|
package/NextImgSmart.js
ADDED
|
@@ -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;
|
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;
|
package/SeoDefaults.d.ts
ADDED
|
@@ -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 {
|
|
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:
|
|
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 "
|
|
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"> & {
|
package/{i18n/T/index.js → T.js}
RENAMED
|
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 "../
|
|
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 & {
|
package/app/css/AppMain.js
CHANGED
package/app/css/AppTheme.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { AppProps as NextAppProps } from "next/app";
|
|
3
|
-
import { ThemeProviderProps } from "../../
|
|
3
|
+
import { type ThemeProviderProps } from "../../useTheme";
|
|
4
4
|
export declare type AppThemeProps = React.PropsWithChildren<NextAppProps & {
|
|
5
5
|
theme: ThemeProviderProps["defaultTheme"];
|
|
6
6
|
}>;
|
package/app/css/AppTheme.js
CHANGED
|
@@ -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 "../../
|
|
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 "../../
|
|
7
|
+
import { SeoDefaults } from "../../SeoDefaults";
|
|
8
8
|
import { NextProgress } from "../../NextProgress";
|
|
9
9
|
/**
|
|
10
10
|
* App main
|
package/app/em/AppTheme.js
CHANGED
|
@@ -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 "../../
|
|
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 "../../
|
|
7
|
+
import { SeoDefaults } from "../../SeoDefaults";
|
|
8
8
|
import { NextProgress } from "../../NextProgress";
|
|
9
9
|
/**
|
|
10
10
|
* App main
|
package/{Auth → auth}/helpers.js
RENAMED
|
File without changes
|
package/{Auth → auth}/index.d.ts
RENAMED
|
File without changes
|
package/{Auth → auth}/index.js
RENAMED
|
File without changes
|
|
@@ -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 "../
|
|
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,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useState } from "react";
|
|
2
|
-
import { useT } from "../
|
|
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;
|
|
@@ -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 "../
|
|
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.js
CHANGED
|
@@ -206,16 +206,10 @@ export function withKoine(_a) {
|
|
|
206
206
|
// @see https://nextjs.org/docs/advanced-features/compiler#modularize-imports
|
|
207
207
|
modularizeImports: __assign(__assign({}, (((_b = custom === null || custom === void 0 ? void 0 : custom["experimental"]) === null || _b === void 0 ? void 0 : _b.modularizeImports) || {})), {
|
|
208
208
|
// FIXME: make these work with the right file/folder structure?
|
|
209
|
-
// "@koine/next/?(((\\w*)?/?)*)": {
|
|
210
|
-
// transform: "@koine/next/{{ matches.[1] }}/{{member}}",
|
|
211
|
-
// },
|
|
212
209
|
// "@koine/react/?(((\\w*)?/?)*)": {
|
|
213
210
|
// transform: "@koine/react/{{ matches.[1] }}/{{member}}",
|
|
214
211
|
// },
|
|
215
|
-
|
|
216
|
-
// transform: "@koine/utils/{{ matches.[1] }}/{{member}}",
|
|
217
|
-
// },
|
|
218
|
-
"@koine/utils": { transform: "@koine/utils/{{member}}" } }) }),
|
|
212
|
+
"@koine/next": { transform: "@koine/next/{{member}}" }, "@koine/utils": { transform: "@koine/utils/{{member}}" } }) }),
|
|
219
213
|
// @see https://github.com/vercel/next.js/issues/7322#issuecomment-887330111
|
|
220
214
|
reactStrictMode: true }, custom);
|
|
221
215
|
if (svg) {
|
package/document/em/index.js
CHANGED
|
@@ -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 "../../
|
|
6
|
+
import { createEmotionCache } from "../../createEmotionCache";
|
|
7
7
|
/**
|
|
8
8
|
* Next Document wrapper for `emotion` based projects
|
|
9
9
|
*
|
package/getSiteUrl.d.ts
ADDED
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 "
|
|
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;
|
package/index.d.ts
CHANGED
|
@@ -1,12 +1,26 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
1
|
+
export * from "./AnalyticsGoogle";
|
|
2
|
+
export * from "./DynamicNamespaces";
|
|
3
3
|
export * from "./Favicon";
|
|
4
|
-
export * from "./
|
|
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 "./
|
|
12
|
-
export * from "./
|
|
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";
|
package/index.js
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
1
|
+
export * from "./AnalyticsGoogle";
|
|
2
|
+
// export * from "./createEmotionCache";
|
|
3
|
+
export * from "./DynamicNamespaces";
|
|
3
4
|
export * from "./Favicon";
|
|
4
|
-
export * from "./
|
|
5
|
+
export * from "./getSiteUrl";
|
|
6
|
+
export * from "./getT";
|
|
5
7
|
export * from "./Head";
|
|
6
|
-
export * from "./i18n";
|
|
7
|
-
export * from "./Img";
|
|
8
8
|
export * from "./Link";
|
|
9
|
+
export * from "./load";
|
|
10
|
+
export * from "./NextImg";
|
|
11
|
+
export * from "./NextImgSmart";
|
|
9
12
|
export * from "./NextProgress";
|
|
13
|
+
export * from "./revalidate";
|
|
10
14
|
export * from "./Seo";
|
|
11
|
-
export * from "./
|
|
12
|
-
export * from "./
|
|
15
|
+
// export * from "./seoBuildTags";
|
|
16
|
+
export * from "./SeoDefaults";
|
|
17
|
+
export * from "./T";
|
|
18
|
+
export * from "./to";
|
|
19
|
+
export * from "./translationAsOptions";
|
|
20
|
+
export * from "./types-i18n";
|
|
21
|
+
export * from "./types-seo";
|
|
22
|
+
export * from "./useBackUrl";
|
|
23
|
+
export * from "./useDateFormat";
|
|
24
|
+
export * from "./useForm";
|
|
25
|
+
export * from "./useLocale";
|
|
26
|
+
export * from "./useT";
|
|
27
|
+
export * from "./useTheme";
|
|
28
|
+
export * from "./useTo";
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
export declare const ONE_HOUR = 3600;
|
|
2
|
-
export declare const ONE_DAY = 84000;
|
|
3
|
-
/**
|
|
4
|
-
* Get site absolute url with the given path
|
|
5
|
-
*
|
|
6
|
-
* - It uses the `NEXT_PUBLIC_APP_URL` env variable
|
|
7
|
-
* - It removes the trailing slashes
|
|
8
|
-
*/
|
|
9
|
-
export declare function getSiteUrl(path?: string): string;
|
|
10
1
|
/**
|
|
11
2
|
* Utility to load a component with an optional pre-determined delay.
|
|
12
3
|
*
|
|
@@ -16,3 +7,4 @@ export declare function getSiteUrl(path?: string): string;
|
|
|
16
7
|
* @see https://github.com/vercel/next.js/blob/canary/examples/with-dynamic-import/pages/index.js
|
|
17
8
|
*/
|
|
18
9
|
export declare function load<T>(component: T, milliseconds: number): Promise<T>;
|
|
10
|
+
export default load;
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
import { normaliseUrl } from "@koine/utils";
|
|
2
|
-
export var ONE_HOUR = 3600;
|
|
3
|
-
export var ONE_DAY = 84000;
|
|
4
|
-
/**
|
|
5
|
-
* Get site absolute url with the given path
|
|
6
|
-
*
|
|
7
|
-
* - It uses the `NEXT_PUBLIC_APP_URL` env variable
|
|
8
|
-
* - It removes the trailing slashes
|
|
9
|
-
*/
|
|
10
|
-
export function getSiteUrl(path) {
|
|
11
|
-
if (path === void 0) { path = ""; }
|
|
12
|
-
return normaliseUrl("".concat(process.env["NEXT_PUBLIC_APP_URL"], "/").concat(path));
|
|
13
|
-
}
|
|
14
1
|
/**
|
|
15
2
|
* Utility to load a component with an optional pre-determined delay.
|
|
16
3
|
*
|
|
@@ -24,3 +11,4 @@ export function load(component, milliseconds) {
|
|
|
24
11
|
setTimeout(function () { return resolve(component); }, milliseconds);
|
|
25
12
|
});
|
|
26
13
|
}
|
|
14
|
+
export default load;
|
|
@@ -35,3 +35,4 @@ var AnalyticsGoogle = function (_a) {
|
|
|
35
35
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(script_1.default, { id: "google-tagmanager", src: "https://www.googletagmanager.com/gtag/js?id=".concat(id), strategy: "afterInteractive", onLoad: function () { return setReady(true); } }), (0, jsx_runtime_1.jsx)(script_1.default, tslib_1.__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 ") }))] }));
|
|
36
36
|
};
|
|
37
37
|
exports.AnalyticsGoogle = AnalyticsGoogle;
|
|
38
|
+
exports.default = exports.AnalyticsGoogle;
|