next-intlayer 9.0.0-canary.2 → 9.0.0-canary.4
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/dist/cjs/client/index.cjs +2 -0
- package/dist/cjs/client/useLocale.cjs +2 -10
- package/dist/cjs/client/useLocale.cjs.map +1 -1
- package/dist/cjs/client/usePathname.cjs +42 -0
- package/dist/cjs/client/usePathname.cjs.map +1 -0
- package/dist/cjs/index.cjs +2 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/client/index.mjs +2 -1
- package/dist/esm/client/useLocale.mjs +5 -13
- package/dist/esm/client/useLocale.mjs.map +1 -1
- package/dist/esm/client/usePathname.mjs +40 -0
- package/dist/esm/client/usePathname.mjs.map +1 -0
- package/dist/esm/index.mjs +2 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/client/index.d.ts +2 -1
- package/dist/types/client/useLocale.d.ts.map +1 -1
- package/dist/types/client/usePathname.d.ts +25 -0
- package/dist/types/client/usePathname.d.ts.map +1 -0
- package/dist/types/index.d.ts +31 -30
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +9 -9
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
const require_client_IntlayerClientProvider = require('./IntlayerClientProvider.cjs');
|
|
4
|
+
const require_client_usePathname = require('./usePathname.cjs');
|
|
4
5
|
const require_client_useLocale = require('./useLocale.cjs');
|
|
5
6
|
const require_client_useLocalePageRouter = require('./useLocalePageRouter.cjs');
|
|
6
7
|
let react_intlayer = require("react-intlayer");
|
|
@@ -8,6 +9,7 @@ let react_intlayer = require("react-intlayer");
|
|
|
8
9
|
exports.IntlayerClientProvider = require_client_IntlayerClientProvider.IntlayerClientProvider;
|
|
9
10
|
exports.useLocale = require_client_useLocale.useLocale;
|
|
10
11
|
exports.useLocalePageRouter = require_client_useLocalePageRouter.useLocalePageRouter;
|
|
12
|
+
exports.usePathname = require_client_usePathname.usePathname;
|
|
11
13
|
Object.defineProperty(exports, 'useRewriteURL', {
|
|
12
14
|
enumerable: true,
|
|
13
15
|
get: function () {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
5
|
+
const require_client_usePathname = require('./usePathname.cjs');
|
|
5
6
|
let react_intlayer = require("react-intlayer");
|
|
6
7
|
let _intlayer_core_localization = require("@intlayer/core/localization");
|
|
7
8
|
let _intlayer_core_utils = require("@intlayer/core/utils");
|
|
@@ -9,15 +10,6 @@ let next_navigation_js = require("next/navigation.js");
|
|
|
9
10
|
let react = require("react");
|
|
10
11
|
|
|
11
12
|
//#region src/client/useLocale.ts
|
|
12
|
-
const usePathWithoutLocale = () => {
|
|
13
|
-
const pathname = (0, next_navigation_js.usePathname)();
|
|
14
|
-
const [fullPath, setFullPath] = (0, react.useState)(pathname);
|
|
15
|
-
(0, react.useEffect)(() => {
|
|
16
|
-
const search = typeof window !== "undefined" ? window.location.search : "";
|
|
17
|
-
setFullPath(search ? `${pathname}${search}` : pathname);
|
|
18
|
-
}, [pathname]);
|
|
19
|
-
return (0, react.useMemo)(() => (0, _intlayer_core_localization.getPathWithoutLocale)(fullPath), [fullPath]);
|
|
20
|
-
};
|
|
21
13
|
/**
|
|
22
14
|
* Hook to manage the current locale in Next.js App Router.
|
|
23
15
|
*
|
|
@@ -44,7 +36,7 @@ const usePathWithoutLocale = () => {
|
|
|
44
36
|
*/
|
|
45
37
|
const useLocale = ({ onChange = "replace", onLocaleChange, isCookieEnabled } = {}) => {
|
|
46
38
|
const { replace, push } = (0, next_navigation_js.useRouter)();
|
|
47
|
-
const pathWithoutLocale =
|
|
39
|
+
const pathWithoutLocale = require_client_usePathname.usePathname();
|
|
48
40
|
return {
|
|
49
41
|
...(0, react_intlayer.useLocale)({
|
|
50
42
|
onLocaleChange: (0, react.useCallback)((locale) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocale.cjs","names":[],"sources":["../../../src/client/useLocale.ts"],"sourcesContent":["'use client';\n\nimport {
|
|
1
|
+
{"version":3,"file":"useLocale.cjs","names":["usePathname"],"sources":["../../../src/client/useLocale.ts"],"sourcesContent":["'use client';\n\nimport { getLocalizedUrl } from '@intlayer/core/localization';\nimport { checkIsURLAbsolute } from '@intlayer/core/utils';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { useRouter } from 'next/navigation.js';\nimport { useCallback } from 'react';\nimport {\n type UseLocaleResult as UseLocaleResultReact,\n useLocale as useLocaleReact,\n} from 'react-intlayer';\nimport { usePathname } from './usePathname';\n\nexport type UseLocaleProps = {\n isCookieEnabled?: boolean;\n onLocaleChange?: (locale: DeclaredLocales) => void;\n onChange?:\n | 'replace'\n | 'push'\n | 'none'\n | ((params: { locale: LocalesValues; path: string }) => void);\n};\n\nexport type UseLocaleResult = UseLocaleResultReact & {\n pathWithoutLocale: string;\n};\n\n/**\n * Hook to manage the current locale in Next.js App Router.\n *\n * This hook extends the base `useLocale` from `react-intlayer` by adding\n * Next.js-specific navigation logic for locale changes.\n *\n * @param props - Optional properties to configure locale change behavior.\n * @returns An object containing the current locale, path without locale, and functions to update the locale.\n *\n * @example\n * ```tsx\n * 'use client';\n *\n * import { useLocale } from 'next-intlayer';\n *\n * const LocaleSwitcher = () => {\n * const { setLocale } = useLocale({ onChange: 'push' });\n *\n * return (\n * <button onClick={() => setLocale('fr')}>Switch to French</button>\n * );\n * };\n * ```\n */\nexport const useLocale = ({\n onChange = 'replace',\n onLocaleChange,\n isCookieEnabled,\n}: UseLocaleProps = {}): UseLocaleResult => {\n const { replace, push } = useRouter();\n const pathWithoutLocale = usePathname();\n\n const redirectionFunction = useCallback(\n (locale: LocalesValues) => {\n if (!onChange) return;\n\n const currentDomain =\n process.env['INTLAYER_ROUTING_DOMAINS'] !== 'false' &&\n typeof window !== 'undefined'\n ? window.location.hostname\n : undefined;\n\n const pathWithLocale = getLocalizedUrl(pathWithoutLocale, locale, {\n currentDomain,\n });\n\n if (typeof onChange === 'function') {\n onChange({ locale, path: pathWithLocale });\n return;\n }\n\n // Cross-domain navigation: the Next.js router cannot navigate to a\n // different origin, so fall back to a full page load.\n if (\n process.env['INTLAYER_ROUTING_DOMAINS'] !== 'false' &&\n checkIsURLAbsolute(pathWithLocale)\n ) {\n try {\n const parsed = new URL(pathWithLocale);\n if (parsed.protocol === 'http:' || parsed.protocol === 'https:') {\n window.location.href = pathWithLocale;\n }\n } catch {\n // Malformed URL — skip redirect\n }\n return;\n }\n\n if (onChange === 'replace') {\n replace(pathWithLocale);\n }\n if (onChange === 'push') {\n push(pathWithLocale);\n }\n\n onLocaleChange?.(locale as DeclaredLocales);\n },\n [replace, push, pathWithoutLocale, onChange, onLocaleChange]\n );\n\n const reactLocaleHook = useLocaleReact({\n onLocaleChange: redirectionFunction,\n isCookieEnabled,\n });\n\n return {\n ...reactLocaleHook,\n pathWithoutLocale,\n } as UseLocaleResult;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,MAAa,aAAa,EACxB,WAAW,WACX,gBACA,oBACkB,EAAE,KAAsB;CAC1C,MAAM,EAAE,SAAS,4CAAoB;CACrC,MAAM,oBAAoBA,wCAAa;AAuDvC,QAAO;EACL,iCANqC;GACrC,wCAhDC,WAA0B;AACzB,QAAI,CAAC,SAAU;IAQf,MAAM,kEAAiC,mBAAmB,QAAQ,EAChE,eANA,QAAQ,IAAI,gCAAgC,WAC5C,OAAO,WAAW,cACd,OAAO,SAAS,WAChB,QAIL,CAAC;AAEF,QAAI,OAAO,aAAa,YAAY;AAClC,cAAS;MAAE;MAAQ,MAAM;MAAgB,CAAC;AAC1C;;AAKF,QACE,QAAQ,IAAI,gCAAgC,wDACzB,eAAe,EAClC;AACA,SAAI;MACF,MAAM,SAAS,IAAI,IAAI,eAAe;AACtC,UAAI,OAAO,aAAa,WAAW,OAAO,aAAa,SACrD,QAAO,SAAS,OAAO;aAEnB;AAGR;;AAGF,QAAI,aAAa,UACf,SAAQ,eAAe;AAEzB,QAAI,aAAa,OACf,MAAK,eAAe;AAGtB,qBAAiB,OAA0B;MAE7C;IAAC;IAAS;IAAM;IAAmB;IAAU;IAAe,CAIzB;GACnC;GACD,CAGmB;EAClB;EACD"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
5
|
+
let _intlayer_core_localization = require("@intlayer/core/localization");
|
|
6
|
+
let next_navigation_js = require("next/navigation.js");
|
|
7
|
+
let react = require("react");
|
|
8
|
+
|
|
9
|
+
//#region src/client/usePathname.ts
|
|
10
|
+
/**
|
|
11
|
+
* Next.js hook that returns the current pathname with the locale segment removed.
|
|
12
|
+
*
|
|
13
|
+
* Wraps Next.js `usePathname()` so it re-renders on client navigations and
|
|
14
|
+
* appends any search parameters before stripping the locale prefix.
|
|
15
|
+
*
|
|
16
|
+
* @returns The current pathname without the locale prefix.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* 'use client';
|
|
21
|
+
*
|
|
22
|
+
* import { usePathname } from 'next-intlayer';
|
|
23
|
+
*
|
|
24
|
+
* const NavItem = ({ href }: { href: string }) => {
|
|
25
|
+
* const pathname = usePathname();
|
|
26
|
+
* return <a className={pathname === href ? 'active' : ''}>{href}</a>;
|
|
27
|
+
* };
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
const usePathname = () => {
|
|
31
|
+
const nextPathname = (0, next_navigation_js.usePathname)();
|
|
32
|
+
const [searchParams, setSearchParams] = (0, react.useState)("");
|
|
33
|
+
(0, react.useEffect)(() => {
|
|
34
|
+
setSearchParams(typeof window !== "undefined" ? window.location.search : "");
|
|
35
|
+
}, [nextPathname]);
|
|
36
|
+
const fullPath = searchParams ? `${nextPathname}${searchParams}` : nextPathname;
|
|
37
|
+
return (0, react.useMemo)(() => (0, _intlayer_core_localization.getPathWithoutLocale)(fullPath), [fullPath]);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
41
|
+
exports.usePathname = usePathname;
|
|
42
|
+
//# sourceMappingURL=usePathname.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePathname.cjs","names":[],"sources":["../../../src/client/usePathname.ts"],"sourcesContent":["'use client';\n\nimport { getPathWithoutLocale } from '@intlayer/core/localization';\nimport { usePathname as useNextPathname } from 'next/navigation.js';\nimport { useEffect, useMemo, useState } from 'react';\n\n/**\n * Next.js hook that returns the current pathname with the locale segment removed.\n *\n * Wraps Next.js `usePathname()` so it re-renders on client navigations and\n * appends any search parameters before stripping the locale prefix.\n *\n * @returns The current pathname without the locale prefix.\n *\n * @example\n * ```tsx\n * 'use client';\n *\n * import { usePathname } from 'next-intlayer';\n *\n * const NavItem = ({ href }: { href: string }) => {\n * const pathname = usePathname();\n * return <a className={pathname === href ? 'active' : ''}>{href}</a>;\n * };\n * ```\n */\nexport const usePathname = (): string => {\n const nextPathname = useNextPathname();\n const [searchParams, setSearchParams] = useState<string>('');\n\n useEffect(() => {\n const search = typeof window !== 'undefined' ? window.location.search : '';\n setSearchParams(search);\n }, [nextPathname]);\n\n const fullPath = searchParams\n ? `${nextPathname}${searchParams}`\n : nextPathname;\n\n return useMemo(() => getPathWithoutLocale(fullPath), [fullPath]);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAa,oBAA4B;CACvC,MAAM,oDAAgC;CACtC,MAAM,CAAC,cAAc,uCAAoC,GAAG;AAE5D,4BAAgB;AAEd,kBADe,OAAO,WAAW,cAAc,OAAO,SAAS,SAAS,GACjD;IACtB,CAAC,aAAa,CAAC;CAElB,MAAM,WAAW,eACb,GAAG,eAAe,iBAClB;AAEJ,uFAA0C,SAAS,EAAE,CAAC,SAAS,CAAC"}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
const require_client_IntlayerClientProvider = require('./client/IntlayerClientProvider.cjs');
|
|
4
|
+
const require_client_usePathname = require('./client/usePathname.cjs');
|
|
4
5
|
const require_client_useLocale = require('./client/useLocale.cjs');
|
|
5
6
|
const require_client_useLocalePageRouter = require('./client/useLocalePageRouter.cjs');
|
|
6
7
|
const require_generateStaticParams = require('./generateStaticParams.cjs');
|
|
@@ -141,6 +142,7 @@ Object.defineProperty(exports, 'useLocaleStorage', {
|
|
|
141
142
|
});
|
|
142
143
|
exports.useMarkdownContext = useMarkdownContext;
|
|
143
144
|
exports.useMarkdownRenderer = useMarkdownRenderer;
|
|
145
|
+
exports.usePathname = require_client_usePathname.usePathname;
|
|
144
146
|
Object.defineProperty(exports, 'useRewriteURL', {
|
|
145
147
|
enumerable: true,
|
|
146
148
|
get: function () {
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["_MarkdownProvider","_useMarkdownContext","_renderMarkdown","_useMarkdownRenderer","_MarkdownRenderer"],"sources":["../../src/index.ts"],"sourcesContent":["export {\n getDictionary,\n getIntlayer,\n IntlayerClientContext,\n type IntlayerNode,\n localeCookie,\n localeInStorage,\n setLocaleCookie,\n setLocaleInStorage,\n t,\n useDictionary,\n useDictionaryAsync,\n useDictionaryDynamic,\n useI18n,\n useIntl,\n useIntlayer,\n useLoadDynamic,\n useLocaleCookie,\n useLocaleStorage,\n} from 'react-intlayer';\nexport * from './client/index';\nexport { generateStaticParams } from './generateStaticParams';\nexport type {\n LocalParams,\n LocalPromiseParams,\n Next14LayoutIntlayer,\n Next14PageIntlayer,\n Next15LayoutIntlayer,\n Next15PageIntlayer,\n NextLayoutIntlayer,\n NextPageIntlayer,\n} from './types/index';\n\nimport type {\n MarkdownProviderOptions as _MarkdownProviderOptions,\n MarkdownRendererProps as _MarkdownRendererProps,\n RenderMarkdownProps as _RenderMarkdownProps,\n} from './markdown';\nimport {\n MarkdownProvider as _MarkdownProvider,\n MarkdownRenderer as _MarkdownRenderer,\n renderMarkdown as _renderMarkdown,\n useMarkdownContext as _useMarkdownContext,\n useMarkdownRenderer as _useMarkdownRenderer,\n} from './markdown';\n\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const MarkdownProvider = _MarkdownProvider;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const useMarkdownContext = _useMarkdownContext;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport type MarkdownProviderOptions = _MarkdownProviderOptions;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const renderMarkdown = _renderMarkdown;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const useMarkdownRenderer = _useMarkdownRenderer;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const MarkdownRenderer = _MarkdownRenderer;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport type RenderMarkdownProps = _RenderMarkdownProps;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport type MarkdownRendererProps = _MarkdownRendererProps;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["_MarkdownProvider","_useMarkdownContext","_renderMarkdown","_useMarkdownRenderer","_MarkdownRenderer"],"sources":["../../src/index.ts"],"sourcesContent":["export {\n getDictionary,\n getIntlayer,\n IntlayerClientContext,\n type IntlayerNode,\n localeCookie,\n localeInStorage,\n setLocaleCookie,\n setLocaleInStorage,\n t,\n useDictionary,\n useDictionaryAsync,\n useDictionaryDynamic,\n useI18n,\n useIntl,\n useIntlayer,\n useLoadDynamic,\n useLocaleCookie,\n useLocaleStorage,\n} from 'react-intlayer';\nexport * from './client/index';\nexport { generateStaticParams } from './generateStaticParams';\nexport type {\n LocalParams,\n LocalPromiseParams,\n Next14LayoutIntlayer,\n Next14PageIntlayer,\n Next15LayoutIntlayer,\n Next15PageIntlayer,\n NextLayoutIntlayer,\n NextPageIntlayer,\n} from './types/index';\n\nimport type {\n MarkdownProviderOptions as _MarkdownProviderOptions,\n MarkdownRendererProps as _MarkdownRendererProps,\n RenderMarkdownProps as _RenderMarkdownProps,\n} from './markdown';\nimport {\n MarkdownProvider as _MarkdownProvider,\n MarkdownRenderer as _MarkdownRenderer,\n renderMarkdown as _renderMarkdown,\n useMarkdownContext as _useMarkdownContext,\n useMarkdownRenderer as _useMarkdownRenderer,\n} from './markdown';\n\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const MarkdownProvider = _MarkdownProvider;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const useMarkdownContext = _useMarkdownContext;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport type MarkdownProviderOptions = _MarkdownProviderOptions;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const renderMarkdown = _renderMarkdown;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const useMarkdownRenderer = _useMarkdownRenderer;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const MarkdownRenderer = _MarkdownRenderer;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport type RenderMarkdownProps = _RenderMarkdownProps;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport type MarkdownRendererProps = _MarkdownRendererProps;\n"],"mappings":";;;;;;;;;;;;;;AAiDA,MAAa,2DAAmBA;;;;AAIhC,MAAa,6DAAqBC;;;;AAQlC,MAAa,yDAAiBC;;;;AAI9B,MAAa,8DAAsBC;;;;AAInC,MAAa,2DAAmBC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IntlayerClientProvider } from "./IntlayerClientProvider.mjs";
|
|
2
|
+
import { usePathname } from "./usePathname.mjs";
|
|
2
3
|
import { useLocale } from "./useLocale.mjs";
|
|
3
4
|
import { useLocalePageRouter } from "./useLocalePageRouter.mjs";
|
|
4
5
|
import { useRewriteURL } from "./useRewriteURL.mjs";
|
|
5
6
|
|
|
6
|
-
export { IntlayerClientProvider, useLocale, useLocalePageRouter, useRewriteURL };
|
|
7
|
+
export { IntlayerClientProvider, useLocale, useLocalePageRouter, usePathname, useRewriteURL };
|
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { usePathname as usePathname$1 } from "./usePathname.mjs";
|
|
3
4
|
import { useLocale as useLocale$1 } from "react-intlayer";
|
|
4
|
-
import { getLocalizedUrl
|
|
5
|
+
import { getLocalizedUrl } from "@intlayer/core/localization";
|
|
5
6
|
import { checkIsURLAbsolute } from "@intlayer/core/utils";
|
|
6
|
-
import {
|
|
7
|
-
import { useCallback
|
|
7
|
+
import { useRouter } from "next/navigation.js";
|
|
8
|
+
import { useCallback } from "react";
|
|
8
9
|
|
|
9
10
|
//#region src/client/useLocale.ts
|
|
10
|
-
const usePathWithoutLocale = () => {
|
|
11
|
-
const pathname = usePathname();
|
|
12
|
-
const [fullPath, setFullPath] = useState(pathname);
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
const search = typeof window !== "undefined" ? window.location.search : "";
|
|
15
|
-
setFullPath(search ? `${pathname}${search}` : pathname);
|
|
16
|
-
}, [pathname]);
|
|
17
|
-
return useMemo(() => getPathWithoutLocale(fullPath), [fullPath]);
|
|
18
|
-
};
|
|
19
11
|
/**
|
|
20
12
|
* Hook to manage the current locale in Next.js App Router.
|
|
21
13
|
*
|
|
@@ -42,7 +34,7 @@ const usePathWithoutLocale = () => {
|
|
|
42
34
|
*/
|
|
43
35
|
const useLocale = ({ onChange = "replace", onLocaleChange, isCookieEnabled } = {}) => {
|
|
44
36
|
const { replace, push } = useRouter();
|
|
45
|
-
const pathWithoutLocale =
|
|
37
|
+
const pathWithoutLocale = usePathname$1();
|
|
46
38
|
return {
|
|
47
39
|
...useLocale$1({
|
|
48
40
|
onLocaleChange: useCallback((locale) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocale.mjs","names":["useLocaleReact"],"sources":["../../../src/client/useLocale.ts"],"sourcesContent":["'use client';\n\nimport {
|
|
1
|
+
{"version":3,"file":"useLocale.mjs","names":["usePathname","useLocaleReact"],"sources":["../../../src/client/useLocale.ts"],"sourcesContent":["'use client';\n\nimport { getLocalizedUrl } from '@intlayer/core/localization';\nimport { checkIsURLAbsolute } from '@intlayer/core/utils';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { useRouter } from 'next/navigation.js';\nimport { useCallback } from 'react';\nimport {\n type UseLocaleResult as UseLocaleResultReact,\n useLocale as useLocaleReact,\n} from 'react-intlayer';\nimport { usePathname } from './usePathname';\n\nexport type UseLocaleProps = {\n isCookieEnabled?: boolean;\n onLocaleChange?: (locale: DeclaredLocales) => void;\n onChange?:\n | 'replace'\n | 'push'\n | 'none'\n | ((params: { locale: LocalesValues; path: string }) => void);\n};\n\nexport type UseLocaleResult = UseLocaleResultReact & {\n pathWithoutLocale: string;\n};\n\n/**\n * Hook to manage the current locale in Next.js App Router.\n *\n * This hook extends the base `useLocale` from `react-intlayer` by adding\n * Next.js-specific navigation logic for locale changes.\n *\n * @param props - Optional properties to configure locale change behavior.\n * @returns An object containing the current locale, path without locale, and functions to update the locale.\n *\n * @example\n * ```tsx\n * 'use client';\n *\n * import { useLocale } from 'next-intlayer';\n *\n * const LocaleSwitcher = () => {\n * const { setLocale } = useLocale({ onChange: 'push' });\n *\n * return (\n * <button onClick={() => setLocale('fr')}>Switch to French</button>\n * );\n * };\n * ```\n */\nexport const useLocale = ({\n onChange = 'replace',\n onLocaleChange,\n isCookieEnabled,\n}: UseLocaleProps = {}): UseLocaleResult => {\n const { replace, push } = useRouter();\n const pathWithoutLocale = usePathname();\n\n const redirectionFunction = useCallback(\n (locale: LocalesValues) => {\n if (!onChange) return;\n\n const currentDomain =\n process.env['INTLAYER_ROUTING_DOMAINS'] !== 'false' &&\n typeof window !== 'undefined'\n ? window.location.hostname\n : undefined;\n\n const pathWithLocale = getLocalizedUrl(pathWithoutLocale, locale, {\n currentDomain,\n });\n\n if (typeof onChange === 'function') {\n onChange({ locale, path: pathWithLocale });\n return;\n }\n\n // Cross-domain navigation: the Next.js router cannot navigate to a\n // different origin, so fall back to a full page load.\n if (\n process.env['INTLAYER_ROUTING_DOMAINS'] !== 'false' &&\n checkIsURLAbsolute(pathWithLocale)\n ) {\n try {\n const parsed = new URL(pathWithLocale);\n if (parsed.protocol === 'http:' || parsed.protocol === 'https:') {\n window.location.href = pathWithLocale;\n }\n } catch {\n // Malformed URL — skip redirect\n }\n return;\n }\n\n if (onChange === 'replace') {\n replace(pathWithLocale);\n }\n if (onChange === 'push') {\n push(pathWithLocale);\n }\n\n onLocaleChange?.(locale as DeclaredLocales);\n },\n [replace, push, pathWithoutLocale, onChange, onLocaleChange]\n );\n\n const reactLocaleHook = useLocaleReact({\n onLocaleChange: redirectionFunction,\n isCookieEnabled,\n });\n\n return {\n ...reactLocaleHook,\n pathWithoutLocale,\n } as UseLocaleResult;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,MAAa,aAAa,EACxB,WAAW,WACX,gBACA,oBACkB,EAAE,KAAsB;CAC1C,MAAM,EAAE,SAAS,SAAS,WAAW;CACrC,MAAM,oBAAoBA,eAAa;AAuDvC,QAAO;EACL,GANsBC,YAAe;GACrC,gBAjD0B,aACzB,WAA0B;AACzB,QAAI,CAAC,SAAU;IAQf,MAAM,iBAAiB,gBAAgB,mBAAmB,QAAQ,EAChE,eANA,QAAQ,IAAI,gCAAgC,WAC5C,OAAO,WAAW,cACd,OAAO,SAAS,WAChB,QAIL,CAAC;AAEF,QAAI,OAAO,aAAa,YAAY;AAClC,cAAS;MAAE;MAAQ,MAAM;MAAgB,CAAC;AAC1C;;AAKF,QACE,QAAQ,IAAI,gCAAgC,WAC5C,mBAAmB,eAAe,EAClC;AACA,SAAI;MACF,MAAM,SAAS,IAAI,IAAI,eAAe;AACtC,UAAI,OAAO,aAAa,WAAW,OAAO,aAAa,SACrD,QAAO,SAAS,OAAO;aAEnB;AAGR;;AAGF,QAAI,aAAa,UACf,SAAQ,eAAe;AAEzB,QAAI,aAAa,OACf,MAAK,eAAe;AAGtB,qBAAiB,OAA0B;MAE7C;IAAC;IAAS;IAAM;IAAmB;IAAU;IAAe,CAIzB;GACnC;GACD,CAGmB;EAClB;EACD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { getPathWithoutLocale } from "@intlayer/core/localization";
|
|
4
|
+
import { usePathname as usePathname$1 } from "next/navigation.js";
|
|
5
|
+
import { useEffect, useMemo, useState } from "react";
|
|
6
|
+
|
|
7
|
+
//#region src/client/usePathname.ts
|
|
8
|
+
/**
|
|
9
|
+
* Next.js hook that returns the current pathname with the locale segment removed.
|
|
10
|
+
*
|
|
11
|
+
* Wraps Next.js `usePathname()` so it re-renders on client navigations and
|
|
12
|
+
* appends any search parameters before stripping the locale prefix.
|
|
13
|
+
*
|
|
14
|
+
* @returns The current pathname without the locale prefix.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* 'use client';
|
|
19
|
+
*
|
|
20
|
+
* import { usePathname } from 'next-intlayer';
|
|
21
|
+
*
|
|
22
|
+
* const NavItem = ({ href }: { href: string }) => {
|
|
23
|
+
* const pathname = usePathname();
|
|
24
|
+
* return <a className={pathname === href ? 'active' : ''}>{href}</a>;
|
|
25
|
+
* };
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
const usePathname = () => {
|
|
29
|
+
const nextPathname = usePathname$1();
|
|
30
|
+
const [searchParams, setSearchParams] = useState("");
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
setSearchParams(typeof window !== "undefined" ? window.location.search : "");
|
|
33
|
+
}, [nextPathname]);
|
|
34
|
+
const fullPath = searchParams ? `${nextPathname}${searchParams}` : nextPathname;
|
|
35
|
+
return useMemo(() => getPathWithoutLocale(fullPath), [fullPath]);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
export { usePathname };
|
|
40
|
+
//# sourceMappingURL=usePathname.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePathname.mjs","names":["useNextPathname"],"sources":["../../../src/client/usePathname.ts"],"sourcesContent":["'use client';\n\nimport { getPathWithoutLocale } from '@intlayer/core/localization';\nimport { usePathname as useNextPathname } from 'next/navigation.js';\nimport { useEffect, useMemo, useState } from 'react';\n\n/**\n * Next.js hook that returns the current pathname with the locale segment removed.\n *\n * Wraps Next.js `usePathname()` so it re-renders on client navigations and\n * appends any search parameters before stripping the locale prefix.\n *\n * @returns The current pathname without the locale prefix.\n *\n * @example\n * ```tsx\n * 'use client';\n *\n * import { usePathname } from 'next-intlayer';\n *\n * const NavItem = ({ href }: { href: string }) => {\n * const pathname = usePathname();\n * return <a className={pathname === href ? 'active' : ''}>{href}</a>;\n * };\n * ```\n */\nexport const usePathname = (): string => {\n const nextPathname = useNextPathname();\n const [searchParams, setSearchParams] = useState<string>('');\n\n useEffect(() => {\n const search = typeof window !== 'undefined' ? window.location.search : '';\n setSearchParams(search);\n }, [nextPathname]);\n\n const fullPath = searchParams\n ? `${nextPathname}${searchParams}`\n : nextPathname;\n\n return useMemo(() => getPathWithoutLocale(fullPath), [fullPath]);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAa,oBAA4B;CACvC,MAAM,eAAeA,eAAiB;CACtC,MAAM,CAAC,cAAc,mBAAmB,SAAiB,GAAG;AAE5D,iBAAgB;AAEd,kBADe,OAAO,WAAW,cAAc,OAAO,SAAS,SAAS,GACjD;IACtB,CAAC,aAAa,CAAC;CAElB,MAAM,WAAW,eACb,GAAG,eAAe,iBAClB;AAEJ,QAAO,cAAc,qBAAqB,SAAS,EAAE,CAAC,SAAS,CAAC"}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IntlayerClientProvider } from "./client/IntlayerClientProvider.mjs";
|
|
2
|
+
import { usePathname } from "./client/usePathname.mjs";
|
|
2
3
|
import { useLocale } from "./client/useLocale.mjs";
|
|
3
4
|
import { useLocalePageRouter } from "./client/useLocalePageRouter.mjs";
|
|
4
5
|
import { useRewriteURL } from "./client/useRewriteURL.mjs";
|
|
@@ -29,5 +30,5 @@ const useMarkdownRenderer = markdown_exports.useMarkdownRenderer;
|
|
|
29
30
|
const MarkdownRenderer = markdown_exports.MarkdownRenderer;
|
|
30
31
|
|
|
31
32
|
//#endregion
|
|
32
|
-
export { IntlayerClientContext, IntlayerClientProvider, MarkdownProvider, MarkdownRenderer, generateStaticParams, getDictionary, getIntlayer, localeCookie, localeInStorage, renderMarkdown, setLocaleCookie, setLocaleInStorage, t, useDictionary, useDictionaryAsync, useDictionaryDynamic, useI18n, useIntl, useIntlayer, useLoadDynamic, useLocale, useLocaleCookie, useLocalePageRouter, useLocaleStorage, useMarkdownContext, useMarkdownRenderer, useRewriteURL };
|
|
33
|
+
export { IntlayerClientContext, IntlayerClientProvider, MarkdownProvider, MarkdownRenderer, generateStaticParams, getDictionary, getIntlayer, localeCookie, localeInStorage, renderMarkdown, setLocaleCookie, setLocaleInStorage, t, useDictionary, useDictionaryAsync, useDictionaryDynamic, useI18n, useIntl, useIntlayer, useLoadDynamic, useLocale, useLocaleCookie, useLocalePageRouter, useLocaleStorage, useMarkdownContext, useMarkdownRenderer, usePathname, useRewriteURL };
|
|
33
34
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["_MarkdownProvider","_useMarkdownContext","_renderMarkdown","_useMarkdownRenderer","_MarkdownRenderer"],"sources":["../../src/index.ts"],"sourcesContent":["export {\n getDictionary,\n getIntlayer,\n IntlayerClientContext,\n type IntlayerNode,\n localeCookie,\n localeInStorage,\n setLocaleCookie,\n setLocaleInStorage,\n t,\n useDictionary,\n useDictionaryAsync,\n useDictionaryDynamic,\n useI18n,\n useIntl,\n useIntlayer,\n useLoadDynamic,\n useLocaleCookie,\n useLocaleStorage,\n} from 'react-intlayer';\nexport * from './client/index';\nexport { generateStaticParams } from './generateStaticParams';\nexport type {\n LocalParams,\n LocalPromiseParams,\n Next14LayoutIntlayer,\n Next14PageIntlayer,\n Next15LayoutIntlayer,\n Next15PageIntlayer,\n NextLayoutIntlayer,\n NextPageIntlayer,\n} from './types/index';\n\nimport type {\n MarkdownProviderOptions as _MarkdownProviderOptions,\n MarkdownRendererProps as _MarkdownRendererProps,\n RenderMarkdownProps as _RenderMarkdownProps,\n} from './markdown';\nimport {\n MarkdownProvider as _MarkdownProvider,\n MarkdownRenderer as _MarkdownRenderer,\n renderMarkdown as _renderMarkdown,\n useMarkdownContext as _useMarkdownContext,\n useMarkdownRenderer as _useMarkdownRenderer,\n} from './markdown';\n\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const MarkdownProvider = _MarkdownProvider;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const useMarkdownContext = _useMarkdownContext;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport type MarkdownProviderOptions = _MarkdownProviderOptions;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const renderMarkdown = _renderMarkdown;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const useMarkdownRenderer = _useMarkdownRenderer;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const MarkdownRenderer = _MarkdownRenderer;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport type RenderMarkdownProps = _RenderMarkdownProps;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport type MarkdownRendererProps = _MarkdownRendererProps;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["_MarkdownProvider","_useMarkdownContext","_renderMarkdown","_useMarkdownRenderer","_MarkdownRenderer"],"sources":["../../src/index.ts"],"sourcesContent":["export {\n getDictionary,\n getIntlayer,\n IntlayerClientContext,\n type IntlayerNode,\n localeCookie,\n localeInStorage,\n setLocaleCookie,\n setLocaleInStorage,\n t,\n useDictionary,\n useDictionaryAsync,\n useDictionaryDynamic,\n useI18n,\n useIntl,\n useIntlayer,\n useLoadDynamic,\n useLocaleCookie,\n useLocaleStorage,\n} from 'react-intlayer';\nexport * from './client/index';\nexport { generateStaticParams } from './generateStaticParams';\nexport type {\n LocalParams,\n LocalPromiseParams,\n Next14LayoutIntlayer,\n Next14PageIntlayer,\n Next15LayoutIntlayer,\n Next15PageIntlayer,\n NextLayoutIntlayer,\n NextPageIntlayer,\n} from './types/index';\n\nimport type {\n MarkdownProviderOptions as _MarkdownProviderOptions,\n MarkdownRendererProps as _MarkdownRendererProps,\n RenderMarkdownProps as _RenderMarkdownProps,\n} from './markdown';\nimport {\n MarkdownProvider as _MarkdownProvider,\n MarkdownRenderer as _MarkdownRenderer,\n renderMarkdown as _renderMarkdown,\n useMarkdownContext as _useMarkdownContext,\n useMarkdownRenderer as _useMarkdownRenderer,\n} from './markdown';\n\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const MarkdownProvider = _MarkdownProvider;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const useMarkdownContext = _useMarkdownContext;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport type MarkdownProviderOptions = _MarkdownProviderOptions;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const renderMarkdown = _renderMarkdown;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const useMarkdownRenderer = _useMarkdownRenderer;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const MarkdownRenderer = _MarkdownRenderer;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport type RenderMarkdownProps = _RenderMarkdownProps;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport type MarkdownRendererProps = _MarkdownRendererProps;\n"],"mappings":";;;;;;;;;;;;;AAiDA,MAAa,mBAAmBA;;;;AAIhC,MAAa,qBAAqBC;;;;AAQlC,MAAa,iBAAiBC;;;;AAI9B,MAAa,sBAAsBC;;;;AAInC,MAAa,mBAAmBC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IntlayerClientProvider, IntlayerClientProviderProps } from "./IntlayerClientProvider.js";
|
|
2
2
|
import { useLocale } from "./useLocale.js";
|
|
3
3
|
import { useLocalePageRouter } from "./useLocalePageRouter.js";
|
|
4
|
+
import { usePathname } from "./usePathname.js";
|
|
4
5
|
import { useRewriteURL } from "./useRewriteURL.js";
|
|
5
|
-
export { IntlayerClientProvider, type IntlayerClientProviderProps, useLocale, useLocalePageRouter, useRewriteURL };
|
|
6
|
+
export { IntlayerClientProvider, type IntlayerClientProviderProps, useLocale, useLocalePageRouter, usePathname, useRewriteURL };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocale.d.ts","names":[],"sources":["../../../src/client/useLocale.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"useLocale.d.ts","names":[],"sources":["../../../src/client/useLocale.ts"],"mappings":";;;;KAgBY,cAAA;EACV,eAAA;EACA,cAAA,IAAkB,MAAA,EAAQ,eAAA;EAC1B,QAAA,mCAIM,MAAA;IAAU,MAAA,EAAQ,aAAA;IAAe,IAAA;EAAA;AAAA;AAAA,KAG7B,eAAA,GAAkB,iBAAA;EAC5B,iBAAA;AAAA;;;;;;;AADF;;;;;AA4BA;;;;;;;;;;;;;cAAa,SAAA;EAAa,QAAA;EAAA,cAAA;EAAA;AAAA,IAIvB,cAAA,KAAsB,eAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/client/usePathname.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Next.js hook that returns the current pathname with the locale segment removed.
|
|
4
|
+
*
|
|
5
|
+
* Wraps Next.js `usePathname()` so it re-renders on client navigations and
|
|
6
|
+
* appends any search parameters before stripping the locale prefix.
|
|
7
|
+
*
|
|
8
|
+
* @returns The current pathname without the locale prefix.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* 'use client';
|
|
13
|
+
*
|
|
14
|
+
* import { usePathname } from 'next-intlayer';
|
|
15
|
+
*
|
|
16
|
+
* const NavItem = ({ href }: { href: string }) => {
|
|
17
|
+
* const pathname = usePathname();
|
|
18
|
+
* return <a className={pathname === href ? 'active' : ''}>{href}</a>;
|
|
19
|
+
* };
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
declare const usePathname: () => string;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { usePathname };
|
|
25
|
+
//# sourceMappingURL=usePathname.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePathname.d.ts","names":[],"sources":["../../../src/client/usePathname.ts"],"mappings":";;AA0BA;;;;;;;;;;;;;;;;;;;cAAa,WAAA"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IntlayerClientProvider, IntlayerClientProviderProps } from "./client/IntlayerClientProvider.js";
|
|
2
2
|
import { useLocale } from "./client/useLocale.js";
|
|
3
3
|
import { useLocalePageRouter } from "./client/useLocalePageRouter.js";
|
|
4
|
+
import { usePathname } from "./client/usePathname.js";
|
|
4
5
|
import { useRewriteURL } from "./client/useRewriteURL.js";
|
|
5
6
|
import { generateStaticParams } from "./generateStaticParams.js";
|
|
6
7
|
import { LocalParams, LocalPromiseParams, Next14LayoutIntlayer, Next14PageIntlayer, Next15LayoutIntlayer, Next15PageIntlayer, NextLayoutIntlayer, NextPageIntlayer } from "./types/NextPage.js";
|
|
@@ -16,13 +17,6 @@ import * as _$react_intlayer_markdown0 from "react-intlayer/markdown";
|
|
|
16
17
|
declare const MarkdownProvider: _$react.FC<index_d_exports.MarkdownProviderOptions & {
|
|
17
18
|
components?: {} & {
|
|
18
19
|
object?: _$react.FC<_$react.DetailedHTMLProps<_$react.ObjectHTMLAttributes<HTMLObjectElement>, HTMLObjectElement>>;
|
|
19
|
-
hr?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLHRElement>, HTMLHRElement>>;
|
|
20
|
-
th?: _$react.FC<_$react.DetailedHTMLProps<_$react.ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>>;
|
|
21
|
-
tr?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>>;
|
|
22
|
-
small?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
23
|
-
sub?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
24
|
-
sup?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
25
|
-
output?: _$react.FC<_$react.DetailedHTMLProps<_$react.OutputHTMLAttributes<HTMLOutputElement>, HTMLOutputElement>>;
|
|
26
20
|
html?: _$react.FC<_$react.DetailedHTMLProps<_$react.HtmlHTMLAttributes<HTMLHtmlElement>, HTMLHtmlElement>>;
|
|
27
21
|
head?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLHeadElement>, HTMLHeadElement>>;
|
|
28
22
|
body?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLBodyElement>, HTMLBodyElement>>;
|
|
@@ -52,6 +46,9 @@ declare const MarkdownProvider: _$react.FC<index_d_exports.MarkdownProviderOptio
|
|
|
52
46
|
del?: _$react.FC<_$react.DetailedHTMLProps<_$react.DelHTMLAttributes<HTMLModElement>, HTMLModElement>>;
|
|
53
47
|
ins?: _$react.FC<_$react.DetailedHTMLProps<_$react.InsHTMLAttributes<HTMLModElement>, HTMLModElement>>;
|
|
54
48
|
mark?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
49
|
+
small?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
50
|
+
sub?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
51
|
+
sup?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
55
52
|
code?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
56
53
|
pre?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLPreElement>, HTMLPreElement>>;
|
|
57
54
|
blockquote?: _$react.FC<_$react.DetailedHTMLProps<_$react.BlockquoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>>;
|
|
@@ -73,6 +70,8 @@ declare const MarkdownProvider: _$react.FC<index_d_exports.MarkdownProviderOptio
|
|
|
73
70
|
thead?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>>;
|
|
74
71
|
tbody?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>>;
|
|
75
72
|
tfoot?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>>;
|
|
73
|
+
tr?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>>;
|
|
74
|
+
th?: _$react.FC<_$react.DetailedHTMLProps<_$react.ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>>;
|
|
76
75
|
td?: _$react.FC<_$react.DetailedHTMLProps<_$react.TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>>;
|
|
77
76
|
caption?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
78
77
|
colgroup?: _$react.FC<_$react.DetailedHTMLProps<_$react.ColgroupHTMLAttributes<HTMLTableColElement>, HTMLTableColElement>>;
|
|
@@ -88,6 +87,7 @@ declare const MarkdownProvider: _$react.FC<index_d_exports.MarkdownProviderOptio
|
|
|
88
87
|
fieldset?: _$react.FC<_$react.DetailedHTMLProps<_$react.FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>>;
|
|
89
88
|
legend?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLLegendElement>, HTMLLegendElement>>;
|
|
90
89
|
datalist?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLDataListElement>, HTMLDataListElement>>;
|
|
90
|
+
output?: _$react.FC<_$react.DetailedHTMLProps<_$react.OutputHTMLAttributes<HTMLOutputElement>, HTMLOutputElement>>;
|
|
91
91
|
progress?: _$react.FC<_$react.DetailedHTMLProps<_$react.ProgressHTMLAttributes<HTMLProgressElement>, HTMLProgressElement>>;
|
|
92
92
|
meter?: _$react.FC<_$react.DetailedHTMLProps<_$react.MeterHTMLAttributes<HTMLMeterElement>, HTMLMeterElement>>;
|
|
93
93
|
img?: _$react.FC<_$react.DetailedHTMLProps<_$react.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>>;
|
|
@@ -106,6 +106,7 @@ declare const MarkdownProvider: _$react.FC<index_d_exports.MarkdownProviderOptio
|
|
|
106
106
|
summary?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
107
107
|
dialog?: _$react.FC<_$react.DetailedHTMLProps<_$react.DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>>;
|
|
108
108
|
br?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLBRElement>, HTMLBRElement>>;
|
|
109
|
+
hr?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLHRElement>, HTMLHRElement>>;
|
|
109
110
|
wbr?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
110
111
|
ruby?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
111
112
|
rt?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
@@ -121,13 +122,6 @@ declare const MarkdownProvider: _$react.FC<index_d_exports.MarkdownProviderOptio
|
|
|
121
122
|
wrapper?: _$react.FC<_$react.HTMLAttributes<HTMLElement>>;
|
|
122
123
|
renderMarkdown?: (markdown: string | _$react_intlayer_markdown0.ParsedMarkdown, options?: index_d_exports.MarkdownProviderOptions, components?: {} & {
|
|
123
124
|
object?: _$react.FC<_$react.DetailedHTMLProps<_$react.ObjectHTMLAttributes<HTMLObjectElement>, HTMLObjectElement>>;
|
|
124
|
-
hr?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLHRElement>, HTMLHRElement>>;
|
|
125
|
-
th?: _$react.FC<_$react.DetailedHTMLProps<_$react.ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>>;
|
|
126
|
-
tr?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>>;
|
|
127
|
-
small?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
128
|
-
sub?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
129
|
-
sup?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
130
|
-
output?: _$react.FC<_$react.DetailedHTMLProps<_$react.OutputHTMLAttributes<HTMLOutputElement>, HTMLOutputElement>>;
|
|
131
125
|
html?: _$react.FC<_$react.DetailedHTMLProps<_$react.HtmlHTMLAttributes<HTMLHtmlElement>, HTMLHtmlElement>>;
|
|
132
126
|
head?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLHeadElement>, HTMLHeadElement>>;
|
|
133
127
|
body?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLBodyElement>, HTMLBodyElement>>;
|
|
@@ -157,6 +151,9 @@ declare const MarkdownProvider: _$react.FC<index_d_exports.MarkdownProviderOptio
|
|
|
157
151
|
del?: _$react.FC<_$react.DetailedHTMLProps<_$react.DelHTMLAttributes<HTMLModElement>, HTMLModElement>>;
|
|
158
152
|
ins?: _$react.FC<_$react.DetailedHTMLProps<_$react.InsHTMLAttributes<HTMLModElement>, HTMLModElement>>;
|
|
159
153
|
mark?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
154
|
+
small?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
155
|
+
sub?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
156
|
+
sup?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
160
157
|
code?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
161
158
|
pre?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLPreElement>, HTMLPreElement>>;
|
|
162
159
|
blockquote?: _$react.FC<_$react.DetailedHTMLProps<_$react.BlockquoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>>;
|
|
@@ -178,6 +175,8 @@ declare const MarkdownProvider: _$react.FC<index_d_exports.MarkdownProviderOptio
|
|
|
178
175
|
thead?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>>;
|
|
179
176
|
tbody?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>>;
|
|
180
177
|
tfoot?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>>;
|
|
178
|
+
tr?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>>;
|
|
179
|
+
th?: _$react.FC<_$react.DetailedHTMLProps<_$react.ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>>;
|
|
181
180
|
td?: _$react.FC<_$react.DetailedHTMLProps<_$react.TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>>;
|
|
182
181
|
caption?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
183
182
|
colgroup?: _$react.FC<_$react.DetailedHTMLProps<_$react.ColgroupHTMLAttributes<HTMLTableColElement>, HTMLTableColElement>>;
|
|
@@ -193,6 +192,7 @@ declare const MarkdownProvider: _$react.FC<index_d_exports.MarkdownProviderOptio
|
|
|
193
192
|
fieldset?: _$react.FC<_$react.DetailedHTMLProps<_$react.FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>>;
|
|
194
193
|
legend?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLLegendElement>, HTMLLegendElement>>;
|
|
195
194
|
datalist?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLDataListElement>, HTMLDataListElement>>;
|
|
195
|
+
output?: _$react.FC<_$react.DetailedHTMLProps<_$react.OutputHTMLAttributes<HTMLOutputElement>, HTMLOutputElement>>;
|
|
196
196
|
progress?: _$react.FC<_$react.DetailedHTMLProps<_$react.ProgressHTMLAttributes<HTMLProgressElement>, HTMLProgressElement>>;
|
|
197
197
|
meter?: _$react.FC<_$react.DetailedHTMLProps<_$react.MeterHTMLAttributes<HTMLMeterElement>, HTMLMeterElement>>;
|
|
198
198
|
img?: _$react.FC<_$react.DetailedHTMLProps<_$react.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>>;
|
|
@@ -211,6 +211,7 @@ declare const MarkdownProvider: _$react.FC<index_d_exports.MarkdownProviderOptio
|
|
|
211
211
|
summary?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
212
212
|
dialog?: _$react.FC<_$react.DetailedHTMLProps<_$react.DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>>;
|
|
213
213
|
br?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLBRElement>, HTMLBRElement>>;
|
|
214
|
+
hr?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLHRElement>, HTMLHRElement>>;
|
|
214
215
|
wbr?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
215
216
|
ruby?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
216
217
|
rt?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
@@ -232,13 +233,6 @@ declare const MarkdownProvider: _$react.FC<index_d_exports.MarkdownProviderOptio
|
|
|
232
233
|
declare const useMarkdownContext: () => {
|
|
233
234
|
components?: {} & {
|
|
234
235
|
object?: _$react.FC<_$react.DetailedHTMLProps<_$react.ObjectHTMLAttributes<HTMLObjectElement>, HTMLObjectElement>>;
|
|
235
|
-
hr?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLHRElement>, HTMLHRElement>>;
|
|
236
|
-
th?: _$react.FC<_$react.DetailedHTMLProps<_$react.ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>>;
|
|
237
|
-
tr?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>>;
|
|
238
|
-
small?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
239
|
-
sub?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
240
|
-
sup?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
241
|
-
output?: _$react.FC<_$react.DetailedHTMLProps<_$react.OutputHTMLAttributes<HTMLOutputElement>, HTMLOutputElement>>;
|
|
242
236
|
html?: _$react.FC<_$react.DetailedHTMLProps<_$react.HtmlHTMLAttributes<HTMLHtmlElement>, HTMLHtmlElement>>;
|
|
243
237
|
head?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLHeadElement>, HTMLHeadElement>>;
|
|
244
238
|
body?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLBodyElement>, HTMLBodyElement>>;
|
|
@@ -268,6 +262,9 @@ declare const useMarkdownContext: () => {
|
|
|
268
262
|
del?: _$react.FC<_$react.DetailedHTMLProps<_$react.DelHTMLAttributes<HTMLModElement>, HTMLModElement>>;
|
|
269
263
|
ins?: _$react.FC<_$react.DetailedHTMLProps<_$react.InsHTMLAttributes<HTMLModElement>, HTMLModElement>>;
|
|
270
264
|
mark?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
265
|
+
small?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
266
|
+
sub?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
267
|
+
sup?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
271
268
|
code?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
272
269
|
pre?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLPreElement>, HTMLPreElement>>;
|
|
273
270
|
blockquote?: _$react.FC<_$react.DetailedHTMLProps<_$react.BlockquoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>>;
|
|
@@ -289,6 +286,8 @@ declare const useMarkdownContext: () => {
|
|
|
289
286
|
thead?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>>;
|
|
290
287
|
tbody?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>>;
|
|
291
288
|
tfoot?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>>;
|
|
289
|
+
tr?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>>;
|
|
290
|
+
th?: _$react.FC<_$react.DetailedHTMLProps<_$react.ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>>;
|
|
292
291
|
td?: _$react.FC<_$react.DetailedHTMLProps<_$react.TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>>;
|
|
293
292
|
caption?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
294
293
|
colgroup?: _$react.FC<_$react.DetailedHTMLProps<_$react.ColgroupHTMLAttributes<HTMLTableColElement>, HTMLTableColElement>>;
|
|
@@ -304,6 +303,7 @@ declare const useMarkdownContext: () => {
|
|
|
304
303
|
fieldset?: _$react.FC<_$react.DetailedHTMLProps<_$react.FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>>;
|
|
305
304
|
legend?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLLegendElement>, HTMLLegendElement>>;
|
|
306
305
|
datalist?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLDataListElement>, HTMLDataListElement>>;
|
|
306
|
+
output?: _$react.FC<_$react.DetailedHTMLProps<_$react.OutputHTMLAttributes<HTMLOutputElement>, HTMLOutputElement>>;
|
|
307
307
|
progress?: _$react.FC<_$react.DetailedHTMLProps<_$react.ProgressHTMLAttributes<HTMLProgressElement>, HTMLProgressElement>>;
|
|
308
308
|
meter?: _$react.FC<_$react.DetailedHTMLProps<_$react.MeterHTMLAttributes<HTMLMeterElement>, HTMLMeterElement>>;
|
|
309
309
|
img?: _$react.FC<_$react.DetailedHTMLProps<_$react.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>>;
|
|
@@ -322,6 +322,7 @@ declare const useMarkdownContext: () => {
|
|
|
322
322
|
summary?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
323
323
|
dialog?: _$react.FC<_$react.DetailedHTMLProps<_$react.DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>>;
|
|
324
324
|
br?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLBRElement>, HTMLBRElement>>;
|
|
325
|
+
hr?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLHRElement>, HTMLHRElement>>;
|
|
325
326
|
wbr?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
326
327
|
ruby?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
327
328
|
rt?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
@@ -336,13 +337,6 @@ declare const useMarkdownContext: () => {
|
|
|
336
337
|
};
|
|
337
338
|
renderMarkdown: (markdown: string | _$react_intlayer_markdown0.ParsedMarkdown, options?: index_d_exports.MarkdownProviderOptions, components?: {} & {
|
|
338
339
|
object?: _$react.FC<_$react.DetailedHTMLProps<_$react.ObjectHTMLAttributes<HTMLObjectElement>, HTMLObjectElement>>;
|
|
339
|
-
hr?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLHRElement>, HTMLHRElement>>;
|
|
340
|
-
th?: _$react.FC<_$react.DetailedHTMLProps<_$react.ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>>;
|
|
341
|
-
tr?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>>;
|
|
342
|
-
small?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
343
|
-
sub?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
344
|
-
sup?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
345
|
-
output?: _$react.FC<_$react.DetailedHTMLProps<_$react.OutputHTMLAttributes<HTMLOutputElement>, HTMLOutputElement>>;
|
|
346
340
|
html?: _$react.FC<_$react.DetailedHTMLProps<_$react.HtmlHTMLAttributes<HTMLHtmlElement>, HTMLHtmlElement>>;
|
|
347
341
|
head?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLHeadElement>, HTMLHeadElement>>;
|
|
348
342
|
body?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLBodyElement>, HTMLBodyElement>>;
|
|
@@ -372,6 +366,9 @@ declare const useMarkdownContext: () => {
|
|
|
372
366
|
del?: _$react.FC<_$react.DetailedHTMLProps<_$react.DelHTMLAttributes<HTMLModElement>, HTMLModElement>>;
|
|
373
367
|
ins?: _$react.FC<_$react.DetailedHTMLProps<_$react.InsHTMLAttributes<HTMLModElement>, HTMLModElement>>;
|
|
374
368
|
mark?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
369
|
+
small?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
370
|
+
sub?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
371
|
+
sup?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
375
372
|
code?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
376
373
|
pre?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLPreElement>, HTMLPreElement>>;
|
|
377
374
|
blockquote?: _$react.FC<_$react.DetailedHTMLProps<_$react.BlockquoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>>;
|
|
@@ -393,6 +390,8 @@ declare const useMarkdownContext: () => {
|
|
|
393
390
|
thead?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>>;
|
|
394
391
|
tbody?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>>;
|
|
395
392
|
tfoot?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>>;
|
|
393
|
+
tr?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>>;
|
|
394
|
+
th?: _$react.FC<_$react.DetailedHTMLProps<_$react.ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>>;
|
|
396
395
|
td?: _$react.FC<_$react.DetailedHTMLProps<_$react.TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>>;
|
|
397
396
|
caption?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
398
397
|
colgroup?: _$react.FC<_$react.DetailedHTMLProps<_$react.ColgroupHTMLAttributes<HTMLTableColElement>, HTMLTableColElement>>;
|
|
@@ -408,6 +407,7 @@ declare const useMarkdownContext: () => {
|
|
|
408
407
|
fieldset?: _$react.FC<_$react.DetailedHTMLProps<_$react.FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>>;
|
|
409
408
|
legend?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLLegendElement>, HTMLLegendElement>>;
|
|
410
409
|
datalist?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLDataListElement>, HTMLDataListElement>>;
|
|
410
|
+
output?: _$react.FC<_$react.DetailedHTMLProps<_$react.OutputHTMLAttributes<HTMLOutputElement>, HTMLOutputElement>>;
|
|
411
411
|
progress?: _$react.FC<_$react.DetailedHTMLProps<_$react.ProgressHTMLAttributes<HTMLProgressElement>, HTMLProgressElement>>;
|
|
412
412
|
meter?: _$react.FC<_$react.DetailedHTMLProps<_$react.MeterHTMLAttributes<HTMLMeterElement>, HTMLMeterElement>>;
|
|
413
413
|
img?: _$react.FC<_$react.DetailedHTMLProps<_$react.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>>;
|
|
@@ -426,6 +426,7 @@ declare const useMarkdownContext: () => {
|
|
|
426
426
|
summary?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
427
427
|
dialog?: _$react.FC<_$react.DetailedHTMLProps<_$react.DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>>;
|
|
428
428
|
br?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLBRElement>, HTMLBRElement>>;
|
|
429
|
+
hr?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLHRElement>, HTMLHRElement>>;
|
|
429
430
|
wbr?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
430
431
|
ruby?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
431
432
|
rt?: _$react.FC<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
@@ -464,7 +465,7 @@ declare const useMarkdownRenderer: ({
|
|
|
464
465
|
forceInline,
|
|
465
466
|
preserveFrontmatter,
|
|
466
467
|
tagfilter
|
|
467
|
-
}?: index_d_exports.RenderMarkdownProps) => (content: string | _$react_intlayer_markdown0.ParsedMarkdown) => string | number | bigint | boolean | Iterable<_$react.ReactNode> |
|
|
468
|
+
}?: index_d_exports.RenderMarkdownProps) => (content: string | _$react_intlayer_markdown0.ParsedMarkdown) => string | number | bigint | boolean | Iterable<_$react.ReactNode> | _$react.JSX.Element | Promise<_$react.ReactNode>;
|
|
468
469
|
/**
|
|
469
470
|
* @deprecated import from next-intlayer/markdown instead
|
|
470
471
|
*/
|
|
@@ -478,5 +479,5 @@ type RenderMarkdownProps = index_d_exports.RenderMarkdownProps;
|
|
|
478
479
|
*/
|
|
479
480
|
type MarkdownRendererProps = index_d_exports.MarkdownRendererProps;
|
|
480
481
|
//#endregion
|
|
481
|
-
export { IntlayerClientContext, IntlayerClientProvider, IntlayerClientProviderProps, type IntlayerNode, type LocalParams, type LocalPromiseParams, MarkdownProvider, MarkdownProviderOptions, MarkdownRenderer, MarkdownRendererProps, type Next14LayoutIntlayer, type Next14PageIntlayer, type Next15LayoutIntlayer, type Next15PageIntlayer, type NextLayoutIntlayer, type NextPageIntlayer, RenderMarkdownProps, generateStaticParams, getDictionary, getIntlayer, localeCookie, localeInStorage, renderMarkdown, setLocaleCookie, setLocaleInStorage, t, useDictionary, useDictionaryAsync, useDictionaryDynamic, useI18n, useIntl, useIntlayer, useLoadDynamic, useLocale, useLocaleCookie, useLocalePageRouter, useLocaleStorage, useMarkdownContext, useMarkdownRenderer, useRewriteURL };
|
|
482
|
+
export { IntlayerClientContext, IntlayerClientProvider, IntlayerClientProviderProps, type IntlayerNode, type LocalParams, type LocalPromiseParams, MarkdownProvider, MarkdownProviderOptions, MarkdownRenderer, MarkdownRendererProps, type Next14LayoutIntlayer, type Next14PageIntlayer, type Next15LayoutIntlayer, type Next15PageIntlayer, type NextLayoutIntlayer, type NextPageIntlayer, RenderMarkdownProps, generateStaticParams, getDictionary, getIntlayer, localeCookie, localeInStorage, renderMarkdown, setLocaleCookie, setLocaleInStorage, t, useDictionary, useDictionaryAsync, useDictionaryDynamic, useI18n, useIntl, useIntlayer, useLoadDynamic, useLocale, useLocaleCookie, useLocalePageRouter, useLocaleStorage, useMarkdownContext, useMarkdownRenderer, usePathname, useRewriteURL };
|
|
482
483
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;cAiDa,gBAAA,UAAgB,EAAA,CAAA,eAAA,CAAA,uBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4FAAD,eAAA,CAAA,uBAAA,EAAA,UAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAE2B,OAAA,CAAA,EAAA,CAAA,OAAA,CAAA,cAAA,CAAA,WAAA,OAAA,OAAA,CAAA,SAAA,GAAA,OAAA,CAAA,OAAA,CAAA,SAAA;AAAA;aAAA,OAAA,CAAA,SAAA;AAAA;;;;cAE1C,kBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2FAjBI,eAAA,CAAA,uBAAA,EAAA,UAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAGK,OAAA,CAAA,EAAA,CAAA,OAAA,CAAA,cAAA,CAAA,WAAA,OAAA,OAAA,CAAA,SAAA,GAAA,OAAA,CAAA,OAAA,CAAA,SAAA;AAAA;;;;KAkBV,uBAAA,GAA0B,eAAA,CAAA,uBAAA;;;;cAIzB,cAAA,GAAc,OAAA,WAAkB,0BAAA,CAAlB,cAAA;EAAA,UAAA;EAAA,OAAA;EAAA,UAAA;EAAA,WAAA;EAAA,mBAAA;EAAA;AAAA,IAAA,eAAA,CAAA,mBAAA,KAAA,OAAA,CAAA,GAAA,CAAA,OAAA;;;;cAId,mBAAA;EAAmB,UAAA;EAAA,OAAA;EAAA,UAAA;EAAA,WAAA;EAAA,mBAAA;EAAA;AAAA,IAAA,eAAA,CAAA,mBAAA,MAAA,OAAA,WAAA,0BAAA,CAAA,cAAA,0CAAA,QAAA,CAAA,OAAA,CAAA,SAAA,IAAA,OAAA,CAAA,GAAA,CAAA,OAAA,GAAA,OAAA,CAAA,OAAA,CAAA,SAAA;;;;cAInB,gBAAA,EAAgB,OAAA,CAAA,EAAA,CAAA,eAAA,CAAA,qBAAA;;;;KAIjB,mBAAA,GAAsB,eAAA,CAAA,mBAAA;;;;KAItB,qBAAA,GAAwB,eAAA,CAAA,qBAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-intlayer",
|
|
3
|
-
"version": "9.0.0-canary.
|
|
3
|
+
"version": "9.0.0-canary.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Simplify internationalization i18n in Next.js with context providers, hooks, locale detection, and multilingual content integration.",
|
|
6
6
|
"keywords": [
|
|
@@ -133,18 +133,18 @@
|
|
|
133
133
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
134
134
|
},
|
|
135
135
|
"dependencies": {
|
|
136
|
-
"@intlayer/chokidar": "9.0.0-canary.
|
|
137
|
-
"@intlayer/config": "9.0.0-canary.
|
|
138
|
-
"@intlayer/core": "9.0.0-canary.
|
|
139
|
-
"@intlayer/dictionaries-entry": "9.0.0-canary.
|
|
140
|
-
"@intlayer/types": "9.0.0-canary.
|
|
141
|
-
"@intlayer/webpack": "9.0.0-canary.
|
|
136
|
+
"@intlayer/chokidar": "9.0.0-canary.4",
|
|
137
|
+
"@intlayer/config": "9.0.0-canary.4",
|
|
138
|
+
"@intlayer/core": "9.0.0-canary.4",
|
|
139
|
+
"@intlayer/dictionaries-entry": "9.0.0-canary.4",
|
|
140
|
+
"@intlayer/types": "9.0.0-canary.4",
|
|
141
|
+
"@intlayer/webpack": "9.0.0-canary.4",
|
|
142
142
|
"defu": "6.1.7",
|
|
143
143
|
"node-loader": "2.1.0",
|
|
144
|
-
"react-intlayer": "9.0.0-canary.
|
|
144
|
+
"react-intlayer": "9.0.0-canary.4"
|
|
145
145
|
},
|
|
146
146
|
"devDependencies": {
|
|
147
|
-
"@types/node": "25.9.
|
|
147
|
+
"@types/node": "25.9.4",
|
|
148
148
|
"@types/react": ">=16.0.0",
|
|
149
149
|
"@types/react-dom": ">=16.0.0",
|
|
150
150
|
"@utils/ts-config": "1.0.4",
|