@koine/next 1.0.9 → 1.0.10
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/package.json +30 -2
- package/Analytics/AnalyticsGoogle.d.ts +0 -5
- package/Analytics/AnalyticsGoogle.js +0 -37
- package/Analytics/index.d.ts +0 -1
- package/Analytics/index.js +0 -1
- package/Analytics/package.json +0 -6
- package/Auth/helpers.d.ts +0 -17
- package/Auth/helpers.js +0 -21
- package/Auth/index.d.ts +0 -4
- package/Auth/index.js +0 -4
- package/Auth/package.json +0 -6
- package/Auth/useLogin.d.ts +0 -7
- package/Auth/useLogin.js +0 -50
- package/Auth/useLoginUrl.d.ts +0 -1
- package/Auth/useLoginUrl.js +0 -11
- package/Auth/useLogout.d.ts +0 -6
- package/Auth/useLogout.js +0 -52
- package/Favicon/Favicon.d.ts +0 -3
- package/Favicon/Favicon.js +0 -4
- 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 -2
- package/Forms/index.js +0 -2
- package/Forms/package.json +0 -6
- package/Forms/useForm.d.ts +0 -32
- package/Forms/useForm.js +0 -37
- package/Forms/useSubmit.d.ts +0 -24
- package/Forms/useSubmit.js +0 -23
- 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/Head/package.json +0 -6
- package/I18n/I18n.d.ts +0 -44
- package/I18n/I18n.js +0 -74
- package/I18n/index.d.ts +0 -1
- package/I18n/index.js +0 -1
- package/I18n/package.json +0 -6
- package/Img/Img.d.ts +0 -21
- package/Img/Img.js +0 -28
- 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/Link.js +0 -9
- package/Link/index.d.ts +0 -1
- package/Link/index.js +0 -1
- package/Link/package.json +0 -6
- package/NextProgress/NextProgress.d.ts +0 -24
- package/NextProgress/NextProgress.js +0 -37
- 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/SeoDefaults.js +0 -12
- package/Seo/helpers.d.ts +0 -48
- package/Seo/helpers.js +0 -111
- package/Seo/index.d.ts +0 -12
- package/Seo/index.js +0 -12
- package/Seo/package.json +0 -6
- package/Theme/Theme.d.ts +0 -46
- package/Theme/Theme.js +0 -235
- package/Theme/index.d.ts +0 -1
- package/Theme/index.js +0 -1
- package/Theme/package.json +0 -6
- package/app/AppHead.d.ts +0 -2
- package/app/AppHead.js +0 -5
- package/app/AppMain.d.ts +0 -35
- package/app/AppMain.js +0 -1
- package/app/css/AppMain.d.ts +0 -8
- package/app/css/AppMain.js +0 -11
- package/app/css/AppTheme.d.ts +0 -10
- package/app/css/AppTheme.js +0 -12
- package/app/css/auth/index.d.ts +0 -9
- package/app/css/auth/index.js +0 -13
- package/app/css/auth/package.json +0 -6
- package/app/css/index.d.ts +0 -54
- package/app/css/index.js +0 -57
- package/app/css/package.json +0 -6
- package/app/em/AppMain.d.ts +0 -10
- package/app/em/AppMain.js +0 -22
- package/app/em/AppTheme.d.ts +0 -15
- package/app/em/AppTheme.js +0 -17
- package/app/em/auth/index.d.ts +0 -9
- package/app/em/auth/index.js +0 -13
- package/app/em/auth/package.json +0 -6
- package/app/em/index.d.ts +0 -9
- package/app/em/index.js +0 -12
- package/app/em/package.json +0 -6
- package/app/index.d.ts +0 -2
- package/app/index.js +0 -2
- package/app/package.json +0 -6
- package/app/sc/AppMain.d.ts +0 -10
- package/app/sc/AppMain.js +0 -22
- package/app/sc/AppTheme.d.ts +0 -13
- package/app/sc/AppTheme.js +0 -9
- package/app/sc/auth/index.d.ts +0 -9
- package/app/sc/auth/index.js +0 -13
- package/app/sc/auth/package.json +0 -6
- package/app/sc/index.d.ts +0 -56
- package/app/sc/index.js +0 -59
- package/app/sc/package.json +0 -6
- package/config/index.d.ts +0 -71
- package/config/index.js +0 -174
- package/config/package.json +0 -6
- package/document/Document.d.ts +0 -15
- package/document/Document.js +0 -19
- package/document/css/index.d.ts +0 -22
- package/document/css/index.js +0 -30
- package/document/css/package.json +0 -6
- package/document/em/index.d.ts +0 -16
- package/document/em/index.js +0 -68
- package/document/em/package.json +0 -6
- package/document/index.d.ts +0 -2
- package/document/index.js +0 -2
- package/document/package.json +0 -6
- package/document/sc/index.d.ts +0 -20
- package/document/sc/index.js +0 -44
- package/document/sc/package.json +0 -6
- package/index.d.ts +0 -12
- package/index.js +0 -12
- package/node/Analytics/AnalyticsGoogle.js +0 -42
- package/node/Analytics/index.js +0 -4
- package/node/Auth/helpers.js +0 -26
- package/node/Auth/index.js +0 -7
- package/node/Auth/useLogin.js +0 -54
- package/node/Auth/useLoginUrl.js +0 -15
- package/node/Auth/useLogout.js +0 -56
- package/node/Favicon/Favicon.js +0 -9
- package/node/Favicon/index.js +0 -4
- package/node/Forms/index.js +0 -5
- package/node/Forms/useForm.js +0 -41
- package/node/Forms/useSubmit.js +0 -27
- package/node/Head/Head.js +0 -8
- package/node/Head/index.js +0 -4
- package/node/I18n/I18n.js +0 -82
- package/node/I18n/index.js +0 -4
- package/node/Img/Img.js +0 -34
- package/node/Img/index.js +0 -4
- package/node/Link/Link.js +0 -13
- package/node/Link/index.js +0 -4
- package/node/NextProgress/NextProgress.js +0 -41
- package/node/NextProgress/index.js +0 -5
- package/node/Seo/Seo.js +0 -12
- package/node/Seo/SeoDefaults.js +0 -16
- package/node/Seo/helpers.js +0 -115
- package/node/Seo/index.js +0 -15
- package/node/Theme/Theme.js +0 -241
- package/node/Theme/index.js +0 -4
- package/node/app/AppHead.js +0 -10
- package/node/app/AppMain.js +0 -2
- package/node/app/css/AppMain.js +0 -16
- package/node/app/css/AppTheme.js +0 -16
- package/node/app/css/auth/index.js +0 -18
- package/node/app/css/index.js +0 -62
- package/node/app/em/AppMain.js +0 -26
- package/node/app/em/AppTheme.js +0 -22
- package/node/app/em/auth/index.js +0 -18
- package/node/app/em/index.js +0 -17
- package/node/app/index.js +0 -5
- package/node/app/sc/AppMain.js +0 -26
- package/node/app/sc/AppTheme.js +0 -13
- package/node/app/sc/auth/index.js +0 -18
- package/node/app/sc/index.js +0 -64
- package/node/config/index.js +0 -184
- package/node/document/Document.js +0 -24
- package/node/document/css/index.js +0 -35
- package/node/document/em/index.js +0 -73
- package/node/document/index.js +0 -7
- package/node/document/sc/index.js +0 -49
- package/node/index.js +0 -15
- package/node/utils/api.js +0 -38
- package/node/utils/emotion-cache.js +0 -13
- package/node/utils/index.js +0 -32
- package/utils/api.d.ts +0 -55
- package/utils/api.js +0 -35
- package/utils/emotion-cache.d.ts +0 -5
- package/utils/emotion-cache.js +0 -8
- package/utils/index.d.ts +0 -19
- package/utils/index.js +0 -26
- package/utils/package.json +0 -6
package/Img/Img.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import NextImage from "next/image";
|
|
4
|
-
export const NextImg = NextImage;
|
|
5
|
-
export const NextImgSmart = (props) => {
|
|
6
|
-
const [$loaded, setLoaded] = useState(false);
|
|
7
|
-
const [$error, setError] = useState(false);
|
|
8
|
-
const { nextImgProps, restProps } = getNextImgProps(props);
|
|
9
|
-
const { Wrap } = restProps;
|
|
10
|
-
return nextImgProps.priority ? (_jsx(NextImage, { ...nextImgProps })) : (_jsx(Wrap, { ...restProps, "$loaded": $loaded, "$error": $error, children: _jsx(NextImage, { ...nextImgProps, onLoadingComplete: () => setLoaded(true), onError: () => setError(true) }) }));
|
|
11
|
-
};
|
|
12
|
-
export function getNextImgProps({ src, alt, layout, blurDataURL, width, height, priority, objectFit, objectPosition, ...restProps }) {
|
|
13
|
-
const nextImgProps = {
|
|
14
|
-
src,
|
|
15
|
-
alt,
|
|
16
|
-
layout,
|
|
17
|
-
blurDataURL,
|
|
18
|
-
width,
|
|
19
|
-
height,
|
|
20
|
-
priority,
|
|
21
|
-
objectFit,
|
|
22
|
-
objectPosition,
|
|
23
|
-
};
|
|
24
|
-
return {
|
|
25
|
-
nextImgProps,
|
|
26
|
-
restProps,
|
|
27
|
-
};
|
|
28
|
-
}
|
package/Img/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Img";
|
package/Img/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Img";
|
package/Img/package.json
DELETED
package/Link/Link.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
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" | "hidden" | "type" | "locale" | "replace" | "slot" | "style" | "children" | "rel" | "href" | "hrefLang" | "property" | "id" | "prefetch" | "onLoad" | "color" | "onBlur" | "onChange" | "onSubmit" | "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" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "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" | "download" | "media" | "ping" | "target" | "scroll" | "shallow" | "legacyBehavior" | "Link"> & React.RefAttributes<HTMLAnchorElement>>;
|
package/Link/Link.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
|
-
import NextLink from "next/link";
|
|
4
|
-
/**
|
|
5
|
-
* @see https://next.js.org/docs/api-reference/next/link
|
|
6
|
-
*/
|
|
7
|
-
export const Link = forwardRef(function Link({ href, prefetch, replace, scroll, shallow, locale, Link = "span", ...props }, ref) {
|
|
8
|
-
return (_jsx(NextLink, { href: href, replace: replace, scroll: scroll, shallow: shallow, locale: locale, passHref: true, children: _jsx(Link, { ref: ref, ...props }) }));
|
|
9
|
-
});
|
package/Link/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Link";
|
package/Link/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Link";
|
package/Link/package.json
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { WithComponents, Simplify } from "@koine/react";
|
|
2
|
-
declare type OwnProps = {
|
|
3
|
-
/** @default 0.3 */
|
|
4
|
-
startAt?: number;
|
|
5
|
-
/** @default true */
|
|
6
|
-
showOnShallow?: boolean;
|
|
7
|
-
/** @default 200 */
|
|
8
|
-
stopDelayMs?: number;
|
|
9
|
-
};
|
|
10
|
-
export declare type Components = {
|
|
11
|
-
Overlay: {
|
|
12
|
-
type: "div";
|
|
13
|
-
props: {
|
|
14
|
-
running?: boolean;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export declare type ComponentsProps = {
|
|
19
|
-
[Name in keyof Components]: Components[Name]["props"];
|
|
20
|
-
};
|
|
21
|
-
declare type Props = Simplify<WithComponents<OwnProps, Components>>;
|
|
22
|
-
export declare type NextProgressProps = Props;
|
|
23
|
-
export declare const NextProgress: ({ startAt, showOnShallow, stopDelayMs, Overlay, }: NextProgressProps) => JSX.Element;
|
|
24
|
-
export {};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
|
-
import { useRouter } from "next/router";
|
|
4
|
-
export const NextProgress = ({ startAt = 0.3, showOnShallow = true, stopDelayMs = 200, Overlay = "div", }) => {
|
|
5
|
-
const { events } = useRouter();
|
|
6
|
-
// const [progress, setProgress] = useState(0);
|
|
7
|
-
const [running, setRunning] = useState(false);
|
|
8
|
-
const timer = useRef(null);
|
|
9
|
-
const routeChangeStart = useCallback((_, { shallow }) => {
|
|
10
|
-
if (!shallow || showOnShallow) {
|
|
11
|
-
// setProgress(startAt);
|
|
12
|
-
setRunning(true);
|
|
13
|
-
}
|
|
14
|
-
}, [showOnShallow]);
|
|
15
|
-
const routeChangeEnd = useCallback((_, { shallow }) => {
|
|
16
|
-
if (!shallow || showOnShallow) {
|
|
17
|
-
if (timer.current) {
|
|
18
|
-
clearTimeout(timer.current);
|
|
19
|
-
}
|
|
20
|
-
timer.current = setTimeout(() => {
|
|
21
|
-
// setProgress(100);
|
|
22
|
-
setRunning(false);
|
|
23
|
-
}, stopDelayMs);
|
|
24
|
-
}
|
|
25
|
-
}, [showOnShallow, stopDelayMs, timer]);
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
events.on("routeChangeStart", routeChangeStart);
|
|
28
|
-
events.on("routeChangeComplete", routeChangeEnd);
|
|
29
|
-
events.on("routeChangeError", routeChangeEnd);
|
|
30
|
-
return () => {
|
|
31
|
-
events.off("routeChangeStart", routeChangeStart);
|
|
32
|
-
events.off("routeChangeComplete", routeChangeEnd);
|
|
33
|
-
events.off("routeChangeError", routeChangeEnd);
|
|
34
|
-
};
|
|
35
|
-
}, [events, routeChangeStart, routeChangeEnd]);
|
|
36
|
-
return _jsx(Overlay, { running: running });
|
|
37
|
-
};
|
package/NextProgress/index.d.ts
DELETED
package/NextProgress/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { NextProgress } from "./NextProgress";
|
package/Seo/Seo.d.ts
DELETED
package/Seo/Seo.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { memo } from "react";
|
|
3
|
-
import Head from "next/head";
|
|
4
|
-
import { buildTags } from "./helpers";
|
|
5
|
-
const _Seo = (props) => {
|
|
6
|
-
return _jsx(Head, { children: buildTags(props) });
|
|
7
|
-
};
|
|
8
|
-
export const Seo = memo(_Seo);
|
package/Seo/SeoDefaults.d.ts
DELETED
package/Seo/SeoDefaults.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { memo } from "react";
|
|
3
|
-
import Head from "next/head";
|
|
4
|
-
// import { useRouter } from "next/router";
|
|
5
|
-
// import { getSiteUrl } from "../utils";
|
|
6
|
-
import { buildTags } from "./helpers";
|
|
7
|
-
const _SeoDefaults = (props) => {
|
|
8
|
-
// const router = useRouter();
|
|
9
|
-
// props.openGraph.url = getSiteUrl(router.asPath);
|
|
10
|
-
return _jsx(Head, { children: buildTags(props) });
|
|
11
|
-
};
|
|
12
|
-
export const SeoDefaults = memo(_SeoDefaults);
|
package/Seo/helpers.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { NextSeoProps, DefaultSeoProps } from "next-seo/lib/types";
|
|
3
|
-
export declare type SeoData = {
|
|
4
|
-
hidden?: boolean;
|
|
5
|
-
title?: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
keywords?: string | string[];
|
|
8
|
-
ogimage?: string;
|
|
9
|
-
};
|
|
10
|
-
declare type SeoPropsOpenGraph = NextSeoProps["openGraph"] & {
|
|
11
|
-
image?: string;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* @see https://github.com/garmeeh/next-seo/blob/master/src/types.ts#L395
|
|
15
|
-
*/
|
|
16
|
-
export declare type SeoProps = Omit<NextSeoProps, "additionalMetaTags" | "additionalLinkTags" | "mobileAlternate" | "robotsProps"> & {
|
|
17
|
-
metaTags?: NextSeoProps["additionalMetaTags"];
|
|
18
|
-
linkTags?: NextSeoProps["additionalLinkTags"];
|
|
19
|
-
seo?: SeoData;
|
|
20
|
-
hidden?: SeoData["hidden"];
|
|
21
|
-
keywords?: SeoData["keywords"];
|
|
22
|
-
openGraph?: SeoPropsOpenGraph;
|
|
23
|
-
og?: SeoPropsOpenGraph;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* @see https://github.com/garmeeh/next-seo/blob/master/src/types.ts#L413
|
|
27
|
-
*/
|
|
28
|
-
export declare type SeoDefaultsProps = Omit<DefaultSeoProps, "additionalMetaTags" | "additionalLinkTags" | "dangerouslySetAllPagesToNoIndex" | "dangerouslySetAllPagesToNoFollow" | "defaultOpenGraphImageWidth" | "defaultOpenGraphImageHeight" | "defaultOpenGraphVideoWidth" | "defaultOpenGraphVideoHeight" | "mobileAlternate" | "robotsProps"> & {
|
|
29
|
-
metaTags?: DefaultSeoProps["additionalMetaTags"];
|
|
30
|
-
linkTags?: DefaultSeoProps["additionalLinkTags"];
|
|
31
|
-
};
|
|
32
|
-
declare type BuildTagsParams = SeoProps & SeoDefaultsProps;
|
|
33
|
-
/**
|
|
34
|
-
* We do a couple of things in addition while many other are removed.
|
|
35
|
-
*
|
|
36
|
-
* - Add `seo` meta object coming from a CMS probably
|
|
37
|
-
* - Add `ogimage` and `openGraph.image` as single image source
|
|
38
|
-
* - Add `og` alias to define `openGraph`
|
|
39
|
-
* - Add check for `title` equale to `templateTitle` to avoid meta titles like
|
|
40
|
-
* "My site | My site" often happening in homepages
|
|
41
|
-
* - Remove the open graph videos and images
|
|
42
|
-
*
|
|
43
|
-
* - Shorter code
|
|
44
|
-
*
|
|
45
|
-
* @returns
|
|
46
|
-
*/
|
|
47
|
-
export declare const buildTags: ({ seo, hidden, keywords, title, titleTemplate, defaultTitle, noindex, nofollow, description, languageAlternates, twitter, facebook, openGraph, og: ogAlias, canonical, metaTags, linkTags, }?: BuildTagsParams) => React.ReactNode[];
|
|
48
|
-
export {};
|
package/Seo/helpers.js
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { isArray } from "@koine/utils";
|
|
3
|
-
const defaults = {
|
|
4
|
-
tplTitle: "",
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* We do a couple of things in addition while many other are removed.
|
|
8
|
-
*
|
|
9
|
-
* - Add `seo` meta object coming from a CMS probably
|
|
10
|
-
* - Add `ogimage` and `openGraph.image` as single image source
|
|
11
|
-
* - Add `og` alias to define `openGraph`
|
|
12
|
-
* - Add check for `title` equale to `templateTitle` to avoid meta titles like
|
|
13
|
-
* "My site | My site" often happening in homepages
|
|
14
|
-
* - Remove the open graph videos and images
|
|
15
|
-
*
|
|
16
|
-
* - Shorter code
|
|
17
|
-
*
|
|
18
|
-
* @returns
|
|
19
|
-
*/
|
|
20
|
-
export const buildTags = ({ seo, hidden, keywords, title = "", titleTemplate, defaultTitle, noindex, nofollow, description, languageAlternates = [], twitter, facebook, openGraph, og: ogAlias, canonical, metaTags, linkTags, } = {}) => {
|
|
21
|
-
const render = [];
|
|
22
|
-
const $names = {};
|
|
23
|
-
const $properties = {};
|
|
24
|
-
if (titleTemplate) {
|
|
25
|
-
defaults.tplTitle = titleTemplate;
|
|
26
|
-
}
|
|
27
|
-
title = title || seo?.title || "";
|
|
28
|
-
if (title) {
|
|
29
|
-
if (defaults.tplTitle && defaults.tplTitle !== title) {
|
|
30
|
-
title = defaults.tplTitle.replace(/%s/g, title);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
else if (defaultTitle) {
|
|
34
|
-
title = defaultTitle;
|
|
35
|
-
}
|
|
36
|
-
if (title) {
|
|
37
|
-
render.push(_jsx("title", { children: title }, "title"));
|
|
38
|
-
$properties["og:title"] = title; // overridden later...
|
|
39
|
-
}
|
|
40
|
-
$names["robots"] = `${noindex || hidden ? "noindex" : "index"},${nofollow || hidden ? "nofollow" : "follow"}`;
|
|
41
|
-
description = description || seo?.description;
|
|
42
|
-
if (description) {
|
|
43
|
-
$names["description"] = description;
|
|
44
|
-
$properties["og:description"] = description; // overridden later...
|
|
45
|
-
}
|
|
46
|
-
keywords = keywords || seo?.keywords;
|
|
47
|
-
if (keywords) {
|
|
48
|
-
$names["keywords"] = isArray(keywords) ? keywords.join(", ") : keywords;
|
|
49
|
-
}
|
|
50
|
-
if (languageAlternates?.length > 0) {
|
|
51
|
-
languageAlternates.forEach((languageAlternate) => {
|
|
52
|
-
render.push(_jsx("link", { rel: "alternate", hrefLang: languageAlternate.hrefLang, href: languageAlternate.href }, `languageAlternate-${languageAlternate.hrefLang}`));
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
if (canonical) {
|
|
56
|
-
render.push(_jsx("link", { rel: "canonical", href: canonical }, "canonical"));
|
|
57
|
-
$properties["og:url"] = canonical;
|
|
58
|
-
}
|
|
59
|
-
if (facebook?.appId)
|
|
60
|
-
$properties["fb:app_id"] = facebook.appId;
|
|
61
|
-
if (twitter) {
|
|
62
|
-
if (twitter.cardType)
|
|
63
|
-
$names["twitter:card"] = twitter.cardType;
|
|
64
|
-
if (twitter.site)
|
|
65
|
-
$names["twitter:site"] = twitter.site;
|
|
66
|
-
if (twitter.handle)
|
|
67
|
-
$names["twitter:creator"] = twitter.handle;
|
|
68
|
-
}
|
|
69
|
-
const og = ogAlias || openGraph;
|
|
70
|
-
if (og?.title)
|
|
71
|
-
$properties["og:title"] = og?.title;
|
|
72
|
-
if (og?.description)
|
|
73
|
-
$properties["og:description"] = og?.description;
|
|
74
|
-
if (og?.url)
|
|
75
|
-
$properties["og:url"] = og.url;
|
|
76
|
-
if (og?.type)
|
|
77
|
-
$properties["og:type"] = og.type.toLowerCase();
|
|
78
|
-
if (og?.locale)
|
|
79
|
-
$properties["og:locale"] = og.locale;
|
|
80
|
-
if (og?.site_name)
|
|
81
|
-
$properties["og:site_name"] = og.site_name;
|
|
82
|
-
const ogimage = og?.image || seo?.ogimage;
|
|
83
|
-
if (ogimage)
|
|
84
|
-
$properties["og:image"] = ogimage;
|
|
85
|
-
Object.keys($names).forEach((key) => {
|
|
86
|
-
render.push(_jsx("meta", { name: key, content: $names[key] }, key));
|
|
87
|
-
});
|
|
88
|
-
Object.keys($properties).forEach((key) => {
|
|
89
|
-
render.push(_jsx("meta", { property: key, content: $properties[key] }, key));
|
|
90
|
-
});
|
|
91
|
-
if (metaTags && metaTags.length > 0) {
|
|
92
|
-
metaTags.forEach((tag) => {
|
|
93
|
-
render.push(_jsx("meta", { ...tag }, `meta:${tag.keyOverride ?? tag.name ?? tag.property ?? tag.httpEquiv}`));
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
if (linkTags?.length) {
|
|
97
|
-
linkTags.forEach((tag) => {
|
|
98
|
-
render.push(_jsx("link", { ...tag }, `link${tag.keyOverride ?? tag.href}${tag.rel}`));
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
// TODO: alternates and canonical
|
|
102
|
-
// canonical = 'https://www.domain.com/';
|
|
103
|
-
// languageAlternates={[{
|
|
104
|
-
// hrefLang: 'en',
|
|
105
|
-
// href: 'https://www.domain.com/en',
|
|
106
|
-
// }]}
|
|
107
|
-
// <link rel="alternate" hreflang="x-default" href="https://www.domain.com/nl/">
|
|
108
|
-
// <link rel="alternate" hreflang="nl" href="https://www.domain.com/nl/">
|
|
109
|
-
// <link rel="alternate" hreflang="en" href="https://www.domain.com/en/">
|
|
110
|
-
return render;
|
|
111
|
-
};
|
package/Seo/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file
|
|
3
|
-
*
|
|
4
|
-
* Adapted from https://github.com/garmeeh/next-seo
|
|
5
|
-
*
|
|
6
|
-
* See also:
|
|
7
|
-
* - https://github.com/catnose99/next-head-seo
|
|
8
|
-
* - https://nextjs.org/docs/api-reference/next/head
|
|
9
|
-
*/
|
|
10
|
-
export * from "./helpers";
|
|
11
|
-
export * from "./Seo";
|
|
12
|
-
export * from "./SeoDefaults";
|
package/Seo/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file
|
|
3
|
-
*
|
|
4
|
-
* Adapted from https://github.com/garmeeh/next-seo
|
|
5
|
-
*
|
|
6
|
-
* See also:
|
|
7
|
-
* - https://github.com/catnose99/next-head-seo
|
|
8
|
-
* - https://nextjs.org/docs/api-reference/next/head
|
|
9
|
-
*/
|
|
10
|
-
export * from "./helpers";
|
|
11
|
-
export * from "./Seo";
|
|
12
|
-
export * from "./SeoDefaults";
|
package/Seo/package.json
DELETED
package/Theme/Theme.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file
|
|
3
|
-
*
|
|
4
|
-
* Adapted from [next-themes](https://github.com/pacocoursey/next-themes)
|
|
5
|
-
*/
|
|
6
|
-
import React from "react";
|
|
7
|
-
declare type ValueObject = {
|
|
8
|
-
[themeName: string]: string;
|
|
9
|
-
};
|
|
10
|
-
export declare type UseThemeProps = {
|
|
11
|
-
/** List of all available theme names */
|
|
12
|
-
themes: string[];
|
|
13
|
-
/** Forced theme name for the current page */
|
|
14
|
-
forcedTheme?: string;
|
|
15
|
-
/** Update the theme */
|
|
16
|
-
setTheme: (theme: string) => void;
|
|
17
|
-
/** Active theme name */
|
|
18
|
-
theme?: string;
|
|
19
|
-
/** If `enableSystem` is true and the active theme is "system", this returns whether the system preference resolved to "dark" or "light". Otherwise, identical to `theme` */
|
|
20
|
-
resolvedTheme?: string;
|
|
21
|
-
/** If enableSystem is true, returns the System theme preference ("dark" or "light"), regardless what the active theme is */
|
|
22
|
-
systemTheme?: "dark" | "light";
|
|
23
|
-
};
|
|
24
|
-
export declare type ThemeProviderProps = React.PropsWithChildren<{
|
|
25
|
-
/** List of all available theme names */
|
|
26
|
-
themes?: string[];
|
|
27
|
-
/** Forced theme name for the current page */
|
|
28
|
-
forcedTheme?: string;
|
|
29
|
-
/** Whether to switch between dark and light themes based on prefers-color-scheme */
|
|
30
|
-
enableSystem?: boolean;
|
|
31
|
-
/** Disable all CSS transitions when switching themes */
|
|
32
|
-
disableTransitionOnChange?: boolean;
|
|
33
|
-
/** Whether to indicate to browsers which color scheme is used (dark or light) for built-in UI like inputs and buttons */
|
|
34
|
-
enableColorScheme?: boolean;
|
|
35
|
-
/** Default theme name (for v0.0.12 and lower the default was light). If `enableSystem` is false, the default theme is light */
|
|
36
|
-
defaultTheme?: string;
|
|
37
|
-
/** HTML attribute modified based on the active theme. Accepts `class` and `data-*` (meaning any data attribute, `data-mode`, `data-color`, etc.) */
|
|
38
|
-
attribute?: string | "class";
|
|
39
|
-
/** Mapping of theme name to HTML attribute value. Object where key is the theme name and value is the attribute value */
|
|
40
|
-
value?: ValueObject;
|
|
41
|
-
/** Nonce string to pass to the inline script for CSP headers */
|
|
42
|
-
nonce?: string;
|
|
43
|
-
}>;
|
|
44
|
-
export declare const useTheme: () => UseThemeProps;
|
|
45
|
-
export declare const ThemeProvider: ({ forcedTheme, disableTransitionOnChange, enableSystem, enableColorScheme, themes, defaultTheme, attribute, value, children, nonce, }: ThemeProviderProps) => JSX.Element;
|
|
46
|
-
export {};
|