@koine/next 1.0.8 → 1.0.9
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 +0 -0
- package/Analytics/AnalyticsGoogle.js +2 -2
- package/Analytics/index.d.ts +0 -0
- package/Analytics/index.js +0 -0
- package/Analytics/package.json +6 -0
- package/Auth/helpers.d.ts +0 -0
- package/Auth/helpers.js +0 -0
- package/Auth/index.d.ts +0 -0
- package/Auth/index.js +0 -0
- package/Auth/package.json +6 -0
- package/Auth/useLogin.d.ts +1 -1
- package/Auth/useLogin.js +4 -1
- package/Auth/useLoginUrl.d.ts +0 -0
- package/Auth/useLoginUrl.js +0 -0
- package/Auth/useLogout.d.ts +0 -0
- package/Auth/useLogout.js +0 -0
- package/Favicon/Favicon.d.ts +0 -0
- package/Favicon/Favicon.js +1 -1
- package/Favicon/index.d.ts +0 -0
- package/Favicon/index.js +0 -0
- package/Favicon/package.json +6 -0
- package/Forms/index.d.ts +0 -0
- package/Forms/index.js +0 -0
- package/Forms/package.json +6 -0
- package/Forms/useForm.d.ts +0 -0
- package/Forms/useForm.js +7 -3
- package/Forms/useSubmit.d.ts +0 -0
- package/Forms/useSubmit.js +10 -7
- package/Head/Head.d.ts +0 -0
- package/Head/Head.js +0 -0
- package/Head/index.d.ts +0 -0
- package/Head/index.js +0 -0
- package/Head/package.json +6 -0
- package/I18n/I18n.d.ts +3 -7
- package/I18n/I18n.js +2 -14
- package/I18n/index.d.ts +0 -0
- package/I18n/index.js +0 -0
- package/I18n/package.json +6 -0
- package/Img/Img.d.ts +4 -4
- package/Img/Img.js +2 -4
- package/Img/index.d.ts +0 -0
- package/Img/index.js +0 -0
- package/Img/package.json +6 -0
- package/Link/Link.d.ts +4 -3
- package/Link/Link.js +2 -5
- package/Link/index.d.ts +0 -0
- package/Link/index.js +0 -0
- package/Link/package.json +6 -0
- package/NextProgress/NextProgress.d.ts +20 -9
- package/NextProgress/NextProgress.js +2 -3
- package/NextProgress/index.d.ts +2 -1
- package/NextProgress/index.js +1 -1
- package/NextProgress/package.json +6 -0
- package/README.md +0 -0
- package/Seo/Seo.d.ts +0 -0
- package/Seo/Seo.js +0 -0
- package/Seo/SeoDefaults.d.ts +0 -0
- package/Seo/SeoDefaults.js +0 -0
- package/Seo/helpers.d.ts +0 -0
- package/Seo/helpers.js +17 -19
- package/Seo/index.d.ts +0 -0
- package/Seo/index.js +0 -0
- package/Seo/package.json +6 -0
- package/Theme/Theme.d.ts +3 -3
- package/Theme/Theme.js +18 -18
- package/Theme/index.d.ts +0 -0
- package/Theme/index.js +0 -0
- package/Theme/package.json +6 -0
- package/app/AppHead.d.ts +1 -2
- package/app/AppHead.js +2 -2
- package/app/AppMain.d.ts +35 -0
- package/app/AppMain.js +1 -0
- package/app/css/AppMain.d.ts +8 -0
- package/app/{AppMain--vanilla.js → css/AppMain.js} +3 -3
- package/app/css/AppTheme.d.ts +10 -0
- package/app/{AppTheme--vanilla.js → css/AppTheme.js} +3 -3
- package/app/css/auth/index.d.ts +9 -0
- package/app/css/auth/index.js +13 -0
- package/app/css/auth/package.json +6 -0
- package/app/css/index.d.ts +54 -0
- package/app/css/index.js +57 -0
- package/app/css/package.json +6 -0
- package/app/em/AppMain.d.ts +10 -0
- package/app/em/AppMain.js +22 -0
- package/app/{AppTheme--emotion.d.ts → em/AppTheme.d.ts} +3 -3
- package/app/{AppTheme--emotion.js → em/AppTheme.js} +5 -5
- package/app/em/auth/index.d.ts +9 -0
- package/app/em/auth/index.js +13 -0
- package/app/em/auth/package.json +6 -0
- package/app/em/index.d.ts +9 -0
- package/app/em/index.js +12 -0
- package/app/em/package.json +6 -0
- package/app/index.d.ts +1 -10
- package/app/index.js +1 -10
- package/app/package.json +6 -0
- package/app/sc/AppMain.d.ts +10 -0
- package/app/sc/AppMain.js +22 -0
- package/app/sc/AppTheme.d.ts +13 -0
- package/app/sc/AppTheme.js +9 -0
- package/app/sc/auth/index.d.ts +9 -0
- package/app/sc/auth/index.js +13 -0
- package/app/sc/auth/package.json +6 -0
- package/app/sc/index.d.ts +56 -0
- package/app/sc/index.js +59 -0
- package/app/sc/package.json +6 -0
- package/config/index.d.ts +14 -1
- package/config/index.js +68 -38
- package/config/package.json +6 -0
- package/document/Document.d.ts +7 -2
- package/document/Document.js +8 -3
- package/document/css/index.d.ts +22 -0
- package/document/css/index.js +30 -0
- package/document/css/package.json +6 -0
- package/document/em/index.d.ts +16 -0
- package/document/{Document--emotion.js → em/index.js} +24 -11
- package/document/em/package.json +6 -0
- package/document/index.d.ts +2 -4
- package/document/index.js +2 -4
- package/document/package.json +6 -0
- package/document/{Document--sc.d.ts → sc/index.d.ts} +11 -2
- package/document/sc/index.js +44 -0
- package/document/sc/package.json +6 -0
- package/index.d.ts +0 -3
- package/index.js +0 -3
- package/node/Analytics/AnalyticsGoogle.js +42 -0
- package/node/Analytics/index.js +4 -0
- package/node/Auth/helpers.js +26 -0
- package/node/Auth/index.js +7 -0
- package/node/Auth/useLogin.js +54 -0
- package/node/Auth/useLoginUrl.js +15 -0
- package/node/Auth/useLogout.js +56 -0
- package/node/Favicon/Favicon.js +9 -0
- package/node/Favicon/index.js +4 -0
- package/node/Forms/index.js +5 -0
- package/node/Forms/useForm.js +41 -0
- package/node/Forms/useSubmit.js +27 -0
- package/node/Head/Head.js +8 -0
- package/node/Head/index.js +4 -0
- package/node/I18n/I18n.js +82 -0
- package/node/I18n/index.js +4 -0
- package/node/Img/Img.js +34 -0
- package/node/Img/index.js +4 -0
- package/node/Link/Link.js +13 -0
- package/node/Link/index.js +4 -0
- package/node/NextProgress/NextProgress.js +41 -0
- package/node/NextProgress/index.js +5 -0
- package/node/Seo/Seo.js +12 -0
- package/node/Seo/SeoDefaults.js +16 -0
- package/node/Seo/helpers.js +115 -0
- package/node/Seo/index.js +15 -0
- package/node/Theme/Theme.js +241 -0
- package/node/Theme/index.js +4 -0
- package/node/app/AppHead.js +10 -0
- package/node/app/AppMain.js +2 -0
- package/node/app/css/AppMain.js +16 -0
- package/node/app/css/AppTheme.js +16 -0
- package/node/app/css/auth/index.js +18 -0
- package/node/app/css/index.js +62 -0
- package/node/app/em/AppMain.js +26 -0
- package/node/app/em/AppTheme.js +22 -0
- package/node/app/em/auth/index.js +18 -0
- package/node/app/em/index.js +17 -0
- package/node/app/index.js +5 -0
- package/node/app/sc/AppMain.js +26 -0
- package/node/app/sc/AppTheme.js +13 -0
- package/node/app/sc/auth/index.js +18 -0
- package/node/app/sc/index.js +64 -0
- package/node/config/index.js +184 -0
- package/node/document/Document.js +24 -0
- package/node/document/css/index.js +35 -0
- package/node/document/em/index.js +73 -0
- package/node/document/index.js +7 -0
- package/node/document/sc/index.js +49 -0
- package/node/index.js +15 -0
- package/node/utils/api.js +38 -0
- package/node/utils/emotion-cache.js +13 -0
- package/node/utils/index.js +32 -0
- package/package.json +2 -35
- package/typings.d.ts +10 -7
- package/utils/api.d.ts +0 -0
- package/utils/api.js +8 -6
- package/utils/emotion-cache.d.ts +0 -0
- package/utils/emotion-cache.js +0 -0
- package/utils/index.d.ts +0 -1
- package/utils/index.js +0 -1
- package/utils/package.json +6 -0
- package/app/App--emotion.d.ts +0 -10
- package/app/App--emotion.js +0 -11
- package/app/App--sc.d.ts +0 -10
- package/app/App--sc.js +0 -11
- package/app/App--vanilla.d.ts +0 -10
- package/app/App--vanilla.js +0 -11
- package/app/AppAuth--emotion.d.ts +0 -10
- package/app/AppAuth--emotion.js +0 -12
- package/app/AppAuth--sc.d.ts +0 -10
- package/app/AppAuth--sc.js +0 -12
- package/app/AppMain--emotion.d.ts +0 -34
- package/app/AppMain--emotion.js +0 -27
- package/app/AppMain--sc.d.ts +0 -34
- package/app/AppMain--sc.js +0 -27
- package/app/AppMain--vanilla.d.ts +0 -27
- package/app/AppTheme--sc.d.ts +0 -13
- package/app/AppTheme--sc.js +0 -9
- package/app/AppTheme--vanilla.d.ts +0 -10
- package/app/motion-features.d.ts +0 -2
- package/app/motion-features.js +0 -2
- package/document/Document--emotion.d.ts +0 -5
- package/document/Document--sc.js +0 -33
- package/document/Document--vanilla.d.ts +0 -11
- package/document/Document--vanilla.js +0 -20
- package/index.umd.js +0 -6621
|
File without changes
|
|
@@ -27,11 +27,11 @@ export const AnalyticsGoogle = ({ id }) => {
|
|
|
27
27
|
if (!uid) {
|
|
28
28
|
return null;
|
|
29
29
|
}
|
|
30
|
-
return (_jsxs(_Fragment, { children: [_jsx(Script, { id: "google-tagmanager", src: `https://www.googletagmanager.com/gtag/js?id=${id}`, strategy: "afterInteractive", onLoad: () => setReady(true) }), _jsx(Script,
|
|
30
|
+
return (_jsxs(_Fragment, { children: [_jsx(Script, { id: "google-tagmanager", src: `https://www.googletagmanager.com/gtag/js?id=${id}`, strategy: "afterInteractive", onLoad: () => setReady(true) }), _jsx(Script, { id: "google-analytics", strategy: "afterInteractive", children: `
|
|
31
31
|
window.dataLayer = window.dataLayer || [];
|
|
32
32
|
function gtag(){window.dataLayer.push(arguments);}
|
|
33
33
|
gtag('js', new Date());
|
|
34
34
|
|
|
35
35
|
gtag('config', '${id}', { 'send_page_view': false });
|
|
36
|
-
` })
|
|
36
|
+
` })] }));
|
|
37
37
|
};
|
package/Analytics/index.d.ts
CHANGED
|
File without changes
|
package/Analytics/index.js
CHANGED
|
File without changes
|
package/Auth/helpers.d.ts
CHANGED
|
File without changes
|
package/Auth/helpers.js
CHANGED
|
File without changes
|
package/Auth/index.d.ts
CHANGED
|
File without changes
|
package/Auth/index.js
CHANGED
|
File without changes
|
package/Auth/useLogin.d.ts
CHANGED
package/Auth/useLogin.js
CHANGED
|
@@ -12,7 +12,10 @@ export function useLogin() {
|
|
|
12
12
|
const [fail, setFail] = useState(false);
|
|
13
13
|
const submit = useCallback((data) => {
|
|
14
14
|
setLoading(true);
|
|
15
|
-
signIn("credentials",
|
|
15
|
+
signIn("credentials", {
|
|
16
|
+
...data,
|
|
17
|
+
redirect: false,
|
|
18
|
+
})
|
|
16
19
|
// @ts-expect-error FIXME: at some point...
|
|
17
20
|
.then(({ ok }) => {
|
|
18
21
|
setLoading(false);
|
package/Auth/useLoginUrl.d.ts
CHANGED
|
File without changes
|
package/Auth/useLoginUrl.js
CHANGED
|
File without changes
|
package/Auth/useLogout.d.ts
CHANGED
|
File without changes
|
package/Auth/useLogout.js
CHANGED
|
File without changes
|
package/Favicon/Favicon.d.ts
CHANGED
|
File without changes
|
package/Favicon/Favicon.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import Head from "next/head";
|
|
3
3
|
import { FaviconTags } from "@koine/react";
|
|
4
|
-
export const Favicon = (props) => (_jsx(Head, { children: _jsx(FaviconTags,
|
|
4
|
+
export const Favicon = (props) => (_jsx(Head, { children: _jsx(FaviconTags, { ...props }) }));
|
package/Favicon/index.d.ts
CHANGED
|
File without changes
|
package/Favicon/index.js
CHANGED
|
File without changes
|
package/Forms/index.d.ts
CHANGED
|
File without changes
|
package/Forms/index.js
CHANGED
|
File without changes
|
package/Forms/useForm.d.ts
CHANGED
|
File without changes
|
package/Forms/useForm.js
CHANGED
|
@@ -7,9 +7,13 @@ export function useForm(
|
|
|
7
7
|
schema, i18nNamespace, formProps = {}, debug) {
|
|
8
8
|
const t = useT(i18nNamespace);
|
|
9
9
|
// const form = _useForm<InferType<ObjectSchema<T, object>>>({
|
|
10
|
-
const form = _useForm(
|
|
10
|
+
const form = _useForm({
|
|
11
11
|
// @ts-expect-error FIXME:
|
|
12
|
-
resolver: resolver(schema)
|
|
12
|
+
resolver: resolver(schema),
|
|
13
|
+
// make the form behave more closer as native:
|
|
14
|
+
// shouldUnregister: true,
|
|
15
|
+
...formProps,
|
|
16
|
+
});
|
|
13
17
|
// const { control, register, setValue } = form;
|
|
14
18
|
// const field = { control, register, setValue, t };
|
|
15
19
|
// if ("production" !== process.env["NODE_ENV"]) {
|
|
@@ -28,6 +32,6 @@ schema, i18nNamespace, formProps = {}, debug) {
|
|
|
28
32
|
return useMemo(() => {
|
|
29
33
|
const { control, register, setValue } = form;
|
|
30
34
|
const field = { control, register, setValue, t };
|
|
31
|
-
return
|
|
35
|
+
return { field, ...form };
|
|
32
36
|
}, [t, form]);
|
|
33
37
|
}
|
package/Forms/useSubmit.d.ts
CHANGED
|
File without changes
|
package/Forms/useSubmit.js
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import { __awaiter } from "tslib";
|
|
2
1
|
import { useAsyncFn } from "react-use";
|
|
3
2
|
import { api } from "../utils/api";
|
|
4
3
|
export function useSubmit(url, transformData) {
|
|
5
|
-
const [state, submit] = useAsyncFn((json) =>
|
|
4
|
+
const [state, submit] = useAsyncFn(async (json) => {
|
|
6
5
|
if (transformData)
|
|
7
6
|
json = transformData(json);
|
|
8
|
-
const response =
|
|
7
|
+
const response = await api.post(url, {
|
|
9
8
|
json,
|
|
10
9
|
});
|
|
11
10
|
if ("production" !== process.env["NODE_ENV"]) {
|
|
12
11
|
console.log("[@koine/next] useSubmit response", response);
|
|
13
12
|
}
|
|
14
13
|
return response;
|
|
15
|
-
}
|
|
14
|
+
}, [url, transformData]);
|
|
16
15
|
const { loading, error, value } = state;
|
|
17
|
-
const fail = !loading && (!!error ||
|
|
18
|
-
return
|
|
19
|
-
|
|
16
|
+
const fail = !loading && (!!error || value?.fail);
|
|
17
|
+
return {
|
|
18
|
+
submit,
|
|
19
|
+
loading,
|
|
20
|
+
...(value || {}),
|
|
21
|
+
fail,
|
|
22
|
+
};
|
|
20
23
|
}
|
package/Head/Head.d.ts
CHANGED
|
File without changes
|
package/Head/Head.js
CHANGED
|
File without changes
|
package/Head/index.d.ts
CHANGED
|
File without changes
|
package/Head/index.js
CHANGED
|
File without changes
|
package/I18n/I18n.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="@koine/next/typings" />
|
|
1
2
|
import format from "date-fns/format";
|
|
2
3
|
import type { Option } from "@koine/react";
|
|
3
4
|
export { default as T } from "next-translate/Trans";
|
|
@@ -7,10 +8,9 @@ declare type Paths<T> = {
|
|
|
7
8
|
}[keyof T];
|
|
8
9
|
export declare type AllPaths = {
|
|
9
10
|
[N in keyof Koine.NextTranslations]: {
|
|
10
|
-
[K in keyof Koine.NextTranslations[N]]: Koine.NextTranslations[N][K] extends Array<Record<string, unknown>> ? Join<K extends string ? `${N}:${K}` : `${N}:`, Paths<Koine.NextTranslations[N][K]>> : Koine.NextTranslations[N][K] extends Record<string, unknown> ? Join<K extends string ? `${N}:${K}` : `${N}:`, Paths<Koine.NextTranslations[N][K]>> : Koine.NextTranslations[N][K] extends Array<string | number | boolean> ? Join<K extends string ? `${N}:${K}` : `${N}`, Paths<Koine.NextTranslations[N][K]>> : Koine.NextTranslations[N][K] extends string | number | boolean ? K extends string ? `${N}:${K}` : `${N}:` : ``;
|
|
11
|
+
[K in keyof Koine.NextTranslations[N]]: Koine.NextTranslations[N][K] extends Array<Record<string, unknown>> ? Join<K extends string ? `${N}:${K}` : `${N}:`, Paths<Koine.NextTranslations[N][K]>> : Koine.NextTranslations[N][K] extends Record<string, unknown> ? Join<K extends string ? `${N}:${K}` : `${N}:`, Paths<Koine.NextTranslations[N][K]>> & Record<Koine.NextTranslations[N][K], object> : Koine.NextTranslations[N][K] extends Array<string | number | boolean> ? Join<K extends string ? `${N}:${K}` : `${N}`, Paths<Koine.NextTranslations[N][K]>> : Koine.NextTranslations[N][K] extends string | number | boolean ? K extends string ? `${N}:${K}` : `${N}:` : ``;
|
|
11
12
|
}[keyof Koine.NextTranslations[N]];
|
|
12
13
|
}[keyof Koine.NextTranslations];
|
|
13
|
-
declare type TranslateReturn<Q extends TranslationQuery, O extends TranslationOptions> = string;
|
|
14
14
|
/**
|
|
15
15
|
* Passing just `obj` is a shortcut for `{ returnObjects: true }`
|
|
16
16
|
*/
|
|
@@ -27,7 +27,7 @@ declare type TranslationOptions = undefined | "obj" | {
|
|
|
27
27
|
};
|
|
28
28
|
export declare type TranslateNamespace = keyof Koine.NextTranslations;
|
|
29
29
|
export declare type TranslateKey = AllPaths;
|
|
30
|
-
export declare type Translate<
|
|
30
|
+
export declare type Translate<N extends undefined | keyof Koine.NextTranslations = undefined> = <R extends unknown = string>(s: N extends TranslateNamespace ? Paths<Koine.NextTranslations[N]> | AllPaths : AllPaths, q?: TranslationQuery, o?: TranslationOptions) => R;
|
|
31
31
|
export declare type TranslateLoose = (s: any, q?: any, o?: any) => string;
|
|
32
32
|
/**
|
|
33
33
|
* FIXME: the use of `useMemo` is a hopefully-temporary solution to fix the FOUC
|
|
@@ -36,10 +36,6 @@ export declare type TranslateLoose = (s: any, q?: any, o?: any) => string;
|
|
|
36
36
|
* @see https://github.com/vinissimus/next-translate/issues/513#issuecomment-779826418
|
|
37
37
|
*/
|
|
38
38
|
export declare function useT<N extends TranslateNamespace | undefined>(namespace?: N): <R extends unknown = string>(s: N extends TranslateNamespace ? Paths<Koine.NextTranslations[N]> | AllPaths : AllPaths, q?: TranslationQuery, o?: TranslationOptions) => R;
|
|
39
|
-
/**
|
|
40
|
-
* @deprecated Not sure whether this will ever be useful
|
|
41
|
-
*/
|
|
42
|
-
export declare function useLooseT(namespace?: string): import("next-translate").Translate;
|
|
43
39
|
export declare function translationAsOptions(t: TranslateLoose, i18nKey: string): Option[];
|
|
44
40
|
/**
|
|
45
41
|
* Automatically returns the `date-fns/format` function with the right locale
|
package/I18n/I18n.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
+
/// <reference types="@koine/next/typings" />
|
|
1
2
|
/* eslint-disable @typescript-eslint/no-unnecessary-type-constraint */
|
|
2
3
|
/**
|
|
3
4
|
* @file
|
|
4
5
|
*
|
|
5
6
|
* About the typescript support for translation strings @see:
|
|
6
7
|
* - https://github.com/vinissimus/next-translate/issues/721
|
|
7
|
-
*
|
|
8
|
-
* About the issue with page transitions @see:
|
|
9
|
-
* - https://github.com/vinissimus/next-translate/issues/447
|
|
10
|
-
* - https://github.com/vinissimus/next-translate/pull/743
|
|
11
8
|
*/
|
|
12
9
|
import { useEffect, useState, useMemo } from "react";
|
|
13
10
|
import { useRouter } from "next/router";
|
|
@@ -50,15 +47,6 @@ export function useT(namespace) {
|
|
|
50
47
|
// return tMemoized as Translate<N>;
|
|
51
48
|
return tMemoized;
|
|
52
49
|
}
|
|
53
|
-
/**
|
|
54
|
-
* @deprecated Not sure whether this will ever be useful
|
|
55
|
-
*/
|
|
56
|
-
export function useLooseT(namespace) {
|
|
57
|
-
const { t } = useTranslation(namespace);
|
|
58
|
-
// return t;
|
|
59
|
-
const tMemoized = useMemo(() => t, [t]);
|
|
60
|
-
return tMemoized;
|
|
61
|
-
}
|
|
62
50
|
export function translationAsOptions(t, i18nKey) {
|
|
63
51
|
const dictionary = t(i18nKey, undefined, {
|
|
64
52
|
returnObjects: true,
|
|
@@ -78,7 +66,7 @@ export const useDateFormat = () => {
|
|
|
78
66
|
const locale = useDateLocale(router.locale);
|
|
79
67
|
useEffect(() => {
|
|
80
68
|
if (locale) {
|
|
81
|
-
const newFormatter = (date, _format, options) => format(date, _format,
|
|
69
|
+
const newFormatter = (date, _format, options) => format(date, _format, { ...(options || {}), locale });
|
|
82
70
|
setFormatter(() => (...args) => newFormatter(...args));
|
|
83
71
|
}
|
|
84
72
|
}, [locale]);
|
package/I18n/index.d.ts
CHANGED
|
File without changes
|
package/I18n/index.js
CHANGED
|
File without changes
|
package/Img/Img.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import NextImage, { ImageProps
|
|
3
|
-
import { KoineImgSmartProps, KoineImgSmartWrapProps } from "@koine/react";
|
|
2
|
+
import NextImage, { ImageProps, StaticImageData } from "next/image";
|
|
3
|
+
import type { KoineImgSmartProps, KoineImgSmartWrapProps } from "@koine/react";
|
|
4
4
|
interface StaticRequire {
|
|
5
5
|
default: StaticImageData;
|
|
6
6
|
}
|
|
7
7
|
declare type StaticImport = StaticRequire | StaticImageData;
|
|
8
|
-
export declare type NextImgProps = Omit<React.ComponentPropsWithoutRef<"img">, "src"> & Omit<
|
|
8
|
+
export declare type NextImgProps = Omit<React.ComponentPropsWithoutRef<"img">, "src"> & Omit<ImageProps, "src"> & {
|
|
9
9
|
src: string | StaticImport;
|
|
10
10
|
};
|
|
11
11
|
export declare const NextImg: typeof NextImage;
|
|
@@ -14,7 +14,7 @@ export declare type NextImgSmartProps = KoineImgSmartProps & NextImgProps;
|
|
|
14
14
|
export declare const NextImgSmart: (props: NextImgSmartProps) => JSX.Element;
|
|
15
15
|
export declare function getNextImgProps<T>({ src, alt, layout, blurDataURL, width, height, priority, objectFit, objectPosition, ...restProps }: T & NextImgProps): {
|
|
16
16
|
nextImgProps: NextImgProps;
|
|
17
|
-
restProps: Omit<T & Omit<Pick<React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "key" | keyof React.ImgHTMLAttributes<HTMLImageElement>>, "src"> & Omit<
|
|
17
|
+
restProps: Omit<T & Omit<Pick<React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "key" | keyof React.ImgHTMLAttributes<HTMLImageElement>>, "src"> & Omit<ImageProps, "src"> & {
|
|
18
18
|
src: string | StaticImport;
|
|
19
19
|
}, "src" | "alt" | "height" | "width" | "layout" | "priority" | "blurDataURL" | "objectFit" | "objectPosition">;
|
|
20
20
|
};
|
package/Img/Img.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __rest } from "tslib";
|
|
2
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { useState } from "react";
|
|
4
3
|
import NextImage from "next/image";
|
|
@@ -8,10 +7,9 @@ export const NextImgSmart = (props) => {
|
|
|
8
7
|
const [$error, setError] = useState(false);
|
|
9
8
|
const { nextImgProps, restProps } = getNextImgProps(props);
|
|
10
9
|
const { Wrap } = restProps;
|
|
11
|
-
return nextImgProps.priority ? (_jsx(NextImage,
|
|
10
|
+
return nextImgProps.priority ? (_jsx(NextImage, { ...nextImgProps })) : (_jsx(Wrap, { ...restProps, "$loaded": $loaded, "$error": $error, children: _jsx(NextImage, { ...nextImgProps, onLoadingComplete: () => setLoaded(true), onError: () => setError(true) }) }));
|
|
12
11
|
};
|
|
13
|
-
export function getNextImgProps(
|
|
14
|
-
var { src, alt, layout, blurDataURL, width, height, priority, objectFit, objectPosition } = _a, restProps = __rest(_a, ["src", "alt", "layout", "blurDataURL", "width", "height", "priority", "objectFit", "objectPosition"]);
|
|
12
|
+
export function getNextImgProps({ src, alt, layout, blurDataURL, width, height, priority, objectFit, objectPosition, ...restProps }) {
|
|
15
13
|
const nextImgProps = {
|
|
16
14
|
src,
|
|
17
15
|
alt,
|
package/Img/index.d.ts
CHANGED
|
File without changes
|
package/Img/index.js
CHANGED
|
File without changes
|
package/Img/package.json
ADDED
package/Link/Link.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { LinkProps as NextLinkProps } from "next/link";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
export declare type LinkProps = Omit<React.ComponentPropsWithRef<"a">, "href"> & Omit<NextLinkProps, "as" | "passHref" | "children"> & {
|
|
4
|
+
Link?: React.ComponentType<any>;
|
|
5
|
+
};
|
|
5
6
|
/**
|
|
6
7
|
* @see https://next.js.org/docs/api-reference/next/link
|
|
7
8
|
*/
|
|
8
|
-
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"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
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
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { __rest } from "tslib";
|
|
2
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { forwardRef } from "react";
|
|
4
3
|
import NextLink from "next/link";
|
|
5
|
-
import { KoineLink } from "@koine/react";
|
|
6
4
|
/**
|
|
7
5
|
* @see https://next.js.org/docs/api-reference/next/link
|
|
8
6
|
*/
|
|
9
|
-
export const Link = forwardRef(function Link(
|
|
10
|
-
|
|
11
|
-
return (_jsx(NextLink, Object.assign({ href: href, replace: replace, scroll: scroll, shallow: shallow, locale: locale, passHref: true }, { children: _jsx(KoineLink, Object.assign({ ref: ref }, props)) })));
|
|
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 }) }));
|
|
12
9
|
});
|
package/Link/index.d.ts
CHANGED
|
File without changes
|
package/Link/index.js
CHANGED
|
File without changes
|
|
@@ -1,13 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
import { WithComponents, Simplify } from "@koine/react";
|
|
2
|
+
declare type OwnProps = {
|
|
2
3
|
/** @default 0.3 */
|
|
3
|
-
startAt
|
|
4
|
+
startAt?: number;
|
|
4
5
|
/** @default true */
|
|
5
|
-
showOnShallow
|
|
6
|
+
showOnShallow?: boolean;
|
|
6
7
|
/** @default 200 */
|
|
7
|
-
stopDelayMs
|
|
8
|
+
stopDelayMs?: number;
|
|
8
9
|
};
|
|
9
|
-
export declare
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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,8 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
3
|
import { useRouter } from "next/router";
|
|
4
|
-
|
|
5
|
-
export const NextProgress = ({ startAt = 0.3, showOnShallow = true, stopDelayMs = 200, }) => {
|
|
4
|
+
export const NextProgress = ({ startAt = 0.3, showOnShallow = true, stopDelayMs = 200, Overlay = "div", }) => {
|
|
6
5
|
const { events } = useRouter();
|
|
7
6
|
// const [progress, setProgress] = useState(0);
|
|
8
7
|
const [running, setRunning] = useState(false);
|
|
@@ -34,5 +33,5 @@ export const NextProgress = ({ startAt = 0.3, showOnShallow = true, stopDelayMs
|
|
|
34
33
|
events.off("routeChangeError", routeChangeEnd);
|
|
35
34
|
};
|
|
36
35
|
}, [events, routeChangeStart, routeChangeEnd]);
|
|
37
|
-
return _jsx(
|
|
36
|
+
return _jsx(Overlay, { running: running });
|
|
38
37
|
};
|
package/NextProgress/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { NextProgress } from "./NextProgress";
|
|
2
|
+
export type { NextProgressProps } from "./NextProgress";
|
package/NextProgress/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { NextProgress } from "./NextProgress";
|
package/README.md
CHANGED
|
File without changes
|
package/Seo/Seo.d.ts
CHANGED
|
File without changes
|
package/Seo/Seo.js
CHANGED
|
File without changes
|
package/Seo/SeoDefaults.d.ts
CHANGED
|
File without changes
|
package/Seo/SeoDefaults.js
CHANGED
|
File without changes
|
package/Seo/helpers.d.ts
CHANGED
|
File without changes
|
package/Seo/helpers.js
CHANGED
|
@@ -24,7 +24,7 @@ export const buildTags = ({ seo, hidden, keywords, title = "", titleTemplate, de
|
|
|
24
24
|
if (titleTemplate) {
|
|
25
25
|
defaults.tplTitle = titleTemplate;
|
|
26
26
|
}
|
|
27
|
-
title = title ||
|
|
27
|
+
title = title || seo?.title || "";
|
|
28
28
|
if (title) {
|
|
29
29
|
if (defaults.tplTitle && defaults.tplTitle !== title) {
|
|
30
30
|
title = defaults.tplTitle.replace(/%s/g, title);
|
|
@@ -38,16 +38,16 @@ export const buildTags = ({ seo, hidden, keywords, title = "", titleTemplate, de
|
|
|
38
38
|
$properties["og:title"] = title; // overridden later...
|
|
39
39
|
}
|
|
40
40
|
$names["robots"] = `${noindex || hidden ? "noindex" : "index"},${nofollow || hidden ? "nofollow" : "follow"}`;
|
|
41
|
-
description = description ||
|
|
41
|
+
description = description || seo?.description;
|
|
42
42
|
if (description) {
|
|
43
43
|
$names["description"] = description;
|
|
44
44
|
$properties["og:description"] = description; // overridden later...
|
|
45
45
|
}
|
|
46
|
-
keywords = keywords ||
|
|
46
|
+
keywords = keywords || seo?.keywords;
|
|
47
47
|
if (keywords) {
|
|
48
48
|
$names["keywords"] = isArray(keywords) ? keywords.join(", ") : keywords;
|
|
49
49
|
}
|
|
50
|
-
if (
|
|
50
|
+
if (languageAlternates?.length > 0) {
|
|
51
51
|
languageAlternates.forEach((languageAlternate) => {
|
|
52
52
|
render.push(_jsx("link", { rel: "alternate", hrefLang: languageAlternate.hrefLang, href: languageAlternate.href }, `languageAlternate-${languageAlternate.hrefLang}`));
|
|
53
53
|
});
|
|
@@ -56,7 +56,7 @@ export const buildTags = ({ seo, hidden, keywords, title = "", titleTemplate, de
|
|
|
56
56
|
render.push(_jsx("link", { rel: "canonical", href: canonical }, "canonical"));
|
|
57
57
|
$properties["og:url"] = canonical;
|
|
58
58
|
}
|
|
59
|
-
if (facebook
|
|
59
|
+
if (facebook?.appId)
|
|
60
60
|
$properties["fb:app_id"] = facebook.appId;
|
|
61
61
|
if (twitter) {
|
|
62
62
|
if (twitter.cardType)
|
|
@@ -67,19 +67,19 @@ export const buildTags = ({ seo, hidden, keywords, title = "", titleTemplate, de
|
|
|
67
67
|
$names["twitter:creator"] = twitter.handle;
|
|
68
68
|
}
|
|
69
69
|
const og = ogAlias || openGraph;
|
|
70
|
-
if (og
|
|
71
|
-
$properties["og:title"] = og
|
|
72
|
-
if (og
|
|
73
|
-
$properties["og:description"] = og
|
|
74
|
-
if (og
|
|
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
75
|
$properties["og:url"] = og.url;
|
|
76
|
-
if (og
|
|
76
|
+
if (og?.type)
|
|
77
77
|
$properties["og:type"] = og.type.toLowerCase();
|
|
78
|
-
if (og
|
|
78
|
+
if (og?.locale)
|
|
79
79
|
$properties["og:locale"] = og.locale;
|
|
80
|
-
if (og
|
|
80
|
+
if (og?.site_name)
|
|
81
81
|
$properties["og:site_name"] = og.site_name;
|
|
82
|
-
const ogimage =
|
|
82
|
+
const ogimage = og?.image || seo?.ogimage;
|
|
83
83
|
if (ogimage)
|
|
84
84
|
$properties["og:image"] = ogimage;
|
|
85
85
|
Object.keys($names).forEach((key) => {
|
|
@@ -90,14 +90,12 @@ export const buildTags = ({ seo, hidden, keywords, title = "", titleTemplate, de
|
|
|
90
90
|
});
|
|
91
91
|
if (metaTags && metaTags.length > 0) {
|
|
92
92
|
metaTags.forEach((tag) => {
|
|
93
|
-
|
|
94
|
-
render.push(_jsx("meta", Object.assign({}, tag), `meta:${(_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}`));
|
|
93
|
+
render.push(_jsx("meta", { ...tag }, `meta:${tag.keyOverride ?? tag.name ?? tag.property ?? tag.httpEquiv}`));
|
|
95
94
|
});
|
|
96
95
|
}
|
|
97
|
-
if (linkTags
|
|
96
|
+
if (linkTags?.length) {
|
|
98
97
|
linkTags.forEach((tag) => {
|
|
99
|
-
|
|
100
|
-
render.push(_jsx("link", Object.assign({}, tag), `link${(_a = tag.keyOverride) !== null && _a !== void 0 ? _a : tag.href}${tag.rel}`));
|
|
98
|
+
render.push(_jsx("link", { ...tag }, `link${tag.keyOverride ?? tag.href}${tag.rel}`));
|
|
101
99
|
});
|
|
102
100
|
}
|
|
103
101
|
// TODO: alternates and canonical
|
package/Seo/index.d.ts
CHANGED
|
File without changes
|
package/Seo/index.js
CHANGED
|
File without changes
|