react-intlayer 8.5.0 → 8.5.1
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/format/useDate.cjs +10 -4
- package/dist/cjs/client/format/useDate.cjs.map +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/markdown/runtime.cjs +1 -2
- package/dist/cjs/markdown/runtime.cjs.map +1 -1
- package/dist/esm/client/format/useDate.mjs +11 -5
- package/dist/esm/client/format/useDate.mjs.map +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/markdown/runtime.mjs +1 -1
- package/dist/esm/markdown/runtime.mjs.map +1 -1
- package/dist/types/client/useDictionaryDynamic.d.ts +1 -1
- package/dist/types/html/HTMLRenderer.d.ts +4 -4
- package/dist/types/index.d.ts +4 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/markdown/MarkdownRenderer.d.ts +1 -1
- package/dist/types/markdown/MarkdownRenderer.d.ts.map +1 -1
- package/dist/types/markdown/runtime.d.ts +1 -1
- package/package.json +9 -9
|
@@ -35,10 +35,16 @@ let _intlayer_core_formatters = require("@intlayer/core/formatters");
|
|
|
35
35
|
*/
|
|
36
36
|
const useDate = () => {
|
|
37
37
|
const { locale } = (0, react.useContext)(require_client_IntlayerProvider.IntlayerClientContext);
|
|
38
|
-
return (...args) =>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
return (...args) => {
|
|
39
|
+
const options = typeof args[1] === "string" ? {
|
|
40
|
+
..._intlayer_core_formatters.presets[args[1]],
|
|
41
|
+
locale
|
|
42
|
+
} : {
|
|
43
|
+
...args[1],
|
|
44
|
+
locale: args[1]?.locale ?? locale
|
|
45
|
+
};
|
|
46
|
+
return (0, _intlayer_core_formatters.date)(args[0], options);
|
|
47
|
+
};
|
|
42
48
|
};
|
|
43
49
|
|
|
44
50
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDate.cjs","names":["IntlayerClientContext"],"sources":["../../../../src/client/format/useDate.ts"],"sourcesContent":["'use client';\n\nimport { date } from '@intlayer/core/formatters';\nimport { useContext } from 'react';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React client hook that provides a localized date/time formatter\n * bound to the current application locale.\n *\n * @returns {(date: Date | string | number, options?: DateProps) => string}\n * A function to format dates or timestamps into localized date/time strings.\n *\n * @example\n * ```tsx\n * const formatDate = useDate();\n *\n * formatDate(new Date(\"2025-01-01\"));\n * // \"Jan 1, 2025\"\n *\n * formatDate(\"2025-01-01T15:30:00Z\", {\n * dateStyle: \"full\",\n * timeStyle: \"short\",\n * });\n * // \"Wednesday, January 1, 2025 at 3:30 PM\"\n *\n * formatDate(1735689600000, { locale: \"fr-FR\", dateStyle: \"long\" });\n * // \"1 janvier 2025\"\n * ```\n *\n * @see createDate\n */\nexport const useDate = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return (...args: Parameters<typeof date>)
|
|
1
|
+
{"version":3,"file":"useDate.cjs","names":["IntlayerClientContext","presets"],"sources":["../../../../src/client/format/useDate.ts"],"sourcesContent":["'use client';\n\nimport { date, presets } from '@intlayer/core/formatters';\nimport { useContext } from 'react';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React client hook that provides a localized date/time formatter\n * bound to the current application locale.\n *\n * @returns {(date: Date | string | number, options?: DateProps) => string}\n * A function to format dates or timestamps into localized date/time strings.\n *\n * @example\n * ```tsx\n * const formatDate = useDate();\n *\n * formatDate(new Date(\"2025-01-01\"));\n * // \"Jan 1, 2025\"\n *\n * formatDate(\"2025-01-01T15:30:00Z\", {\n * dateStyle: \"full\",\n * timeStyle: \"short\",\n * });\n * // \"Wednesday, January 1, 2025 at 3:30 PM\"\n *\n * formatDate(1735689600000, { locale: \"fr-FR\", dateStyle: \"long\" });\n * // \"1 janvier 2025\"\n * ```\n *\n * @see createDate\n */\nexport const useDate = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return (...args: Parameters<typeof date>) => {\n const options =\n typeof args[1] === 'string'\n ? { ...presets[args[1]], locale: locale }\n : { ...args[1], locale: args[1]?.locale ?? locale };\n\n return date(args[0], options as Parameters<typeof date>[1]);\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,MAAa,gBAAgB;CAC3B,MAAM,EAAE,iCAAsBA,sDAAsB;AAEpD,SAAQ,GAAG,SAAkC;EAC3C,MAAM,UACJ,OAAO,KAAK,OAAO,WACf;GAAE,GAAGC,kCAAQ,KAAK;GAAa;GAAQ,GACvC;GAAE,GAAG,KAAK;GAAI,QAAQ,KAAK,IAAI,UAAU;GAAQ;AAEvD,6CAAY,KAAK,IAAI,QAAsC"}
|
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":["import type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport type { IInterpreterPluginReact } from './plugins';\n\ndeclare module '@intlayer/core/interpreter' {\n interface IInterpreterPlugin<T, S, L extends LocalesValues>\n extends IInterpreterPluginReact<T, S, L> {}\n}\n\nexport { useIntl } from './client/format/useIntl';\n// Import directly from individual files to avoid circular dependency issues\nexport {\n IntlayerClientContext,\n IntlayerProvider,\n IntlayerProviderContent,\n type IntlayerProviderProps,\n useIntlayerContext,\n} from './client/IntlayerProvider';\nexport { t } from './client/t';\nexport { useDictionary } from './client/useDictionary';\nexport { useDictionaryAsync } from './client/useDictionaryAsync';\nexport { useDictionaryDynamic } from './client/useDictionaryDynamic';\nexport { useI18n } from './client/useI18n';\nexport { useIntlayer } from './client/useIntlayer';\nexport { useLoadDynamic } from './client/useLoadDynamic';\nexport { useLocale } from './client/useLocale';\nexport { useLocaleBase } from './client/useLocaleBase';\nexport {\n localeCookie,\n localeInStorage,\n setLocaleCookie,\n setLocaleInStorage,\n useLocaleCookie,\n useLocaleStorage,\n} from './client/useLocaleStorage';\nexport { useRewriteURL } from './client/useRewriteURL';\nexport { getDictionary } from './getDictionary';\nexport { getIntlayer } from './getIntlayer';\nexport type { IntlayerNode } from './IntlayerNode';\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
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["_MarkdownProvider","_useMarkdownContext","_renderMarkdown","_useMarkdownRenderer","_MarkdownRenderer"],"sources":["../../src/index.ts"],"sourcesContent":["import type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport type { IInterpreterPluginReact } from './plugins';\n\ndeclare module '@intlayer/core/interpreter' {\n interface IInterpreterPlugin<T, S, L extends LocalesValues>\n extends IInterpreterPluginReact<T, S, L> {}\n}\n\n/**\n * @deprecated import from react-intlayer/format instead\n */\nexport { useIntl } from './client/format/useIntl';\n// Import directly from individual files to avoid circular dependency issues\nexport {\n IntlayerClientContext,\n IntlayerProvider,\n IntlayerProviderContent,\n type IntlayerProviderProps,\n useIntlayerContext,\n} from './client/IntlayerProvider';\nexport { t } from './client/t';\nexport { useDictionary } from './client/useDictionary';\nexport { useDictionaryAsync } from './client/useDictionaryAsync';\nexport { useDictionaryDynamic } from './client/useDictionaryDynamic';\nexport { useI18n } from './client/useI18n';\nexport { useIntlayer } from './client/useIntlayer';\nexport { useLoadDynamic } from './client/useLoadDynamic';\nexport { useLocale } from './client/useLocale';\nexport { useLocaleBase } from './client/useLocaleBase';\nexport {\n localeCookie,\n localeInStorage,\n setLocaleCookie,\n setLocaleInStorage,\n useLocaleCookie,\n useLocaleStorage,\n} from './client/useLocaleStorage';\nexport { useRewriteURL } from './client/useRewriteURL';\nexport { getDictionary } from './getDictionary';\nexport { getIntlayer } from './getIntlayer';\nexport type { IntlayerNode } from './IntlayerNode';\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 * @deprecated import from react-intlayer/markdown instead\n */\nexport const MarkdownProvider = _MarkdownProvider;\n/**\n * @deprecated import from react-intlayer/markdown instead\n */\nexport const useMarkdownContext = _useMarkdownContext;\n/**\n * @deprecated import from react-intlayer/markdown instead\n */\nexport type MarkdownProviderOptions = _MarkdownProviderOptions;\n/**\n * @deprecated import from react-intlayer/markdown instead\n */\nexport const renderMarkdown = _renderMarkdown;\n/**\n * @deprecated import from react-intlayer/markdown instead\n */\nexport const useMarkdownRenderer = _useMarkdownRenderer;\n/**\n * @deprecated import from react-intlayer/markdown instead\n */\nexport const MarkdownRenderer = _MarkdownRenderer;\n/**\n * @deprecated import from react-intlayer/markdown instead\n */\nexport type RenderMarkdownProps = _RenderMarkdownProps;\n/**\n * @deprecated import from react-intlayer/markdown instead\n */\nexport type MarkdownRendererProps = _MarkdownRendererProps;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAyDA,MAAa,mBAAmBA;;;;AAIhC,MAAa,qBAAqBC;;;;AAQlC,MAAa,iBAAiBC;;;;AAI9B,MAAa,sBAAsBC;;;;AAInC,MAAa,mBAAmBC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
let react = require("react");
|
|
4
4
|
|
|
@@ -39,6 +39,5 @@ const createReactRuntime = (options = {}) => {
|
|
|
39
39
|
|
|
40
40
|
//#endregion
|
|
41
41
|
exports.createReactRuntime = createReactRuntime;
|
|
42
|
-
exports.default = reactRuntime;
|
|
43
42
|
exports.reactRuntime = reactRuntime;
|
|
44
43
|
//# sourceMappingURL=runtime.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.cjs","names":[],"sources":["../../../src/markdown/runtime.ts"],"sourcesContent":["import type { HTMLTag, MarkdownRuntime } from '@intlayer/core/markdown';\nimport {\n cloneElement,\n createElement,\n Fragment,\n type ReactElement,\n type ReactNode,\n} from 'react';\n\n/**\n * React-specific runtime for the markdown processor.\n * Implements the MarkdownRuntime interface using React's primitives.\n */\nexport const reactRuntime: MarkdownRuntime = {\n /**\n * Creates a React element.\n * Handles the conversion of props and children to React format.\n */\n createElement: (\n type: string | any,\n props: Record<string, any> | null,\n ...children: any[]\n ): ReactNode => {\n // React accepts children as rest args or as a single array\n // If there's only one child, pass it directly to avoid unnecessary array\n if (children.length === 0) {\n return createElement(type, props);\n }\n if (children.length === 1) {\n return createElement(type, props, children[0]);\n }\n return createElement(type, props, ...children);\n },\n\n /**\n * Clones a React element with new props.\n */\n cloneElement: (\n element: unknown,\n props: Record<string, any>,\n ...children: any[]\n ): ReactNode => {\n if (children.length === 0) {\n return cloneElement(element as ReactElement, props);\n }\n return cloneElement(element as ReactElement, props, ...children);\n },\n\n /**\n * React Fragment component.\n */\n Fragment,\n\n /**\n * React-specific prop normalization.\n * React uses className instead of class, htmlFor instead of for, etc.\n * The core processor already handles ATTRIBUTE_TO_NODE_PROP_MAP,\n * so this is mostly a no-op but can be used for additional React-specific transforms.\n */\n normalizeProps: (\n _tag: HTMLTag,\n props: Record<string, any>\n ): Record<string, any> => {\n // The core already handles class -> className and for -> htmlFor\n // via ATTRIBUTE_TO_NODE_PROP_MAP in the attrStringToMap function.\n // This hook is available for any additional React-specific transforms.\n return props;\n },\n};\n\n/**\n * Creates a React runtime with custom createElement for advanced use cases.\n * Useful for wrapping elements or adding middleware.\n */\nexport const createReactRuntime = (\n options: {\n onCreateElement?: (\n type: string | any,\n props: Record<string, any> | null,\n children: any[]\n ) => ReactNode;\n } = {}\n): MarkdownRuntime => {\n const { onCreateElement } = options;\n\n if (onCreateElement) {\n return {\n ...reactRuntime,\n createElement: (\n type: string | any,\n props: Record<string, any> | null,\n ...children: any[]\n ): ReactNode => {\n return onCreateElement(type, props, children);\n },\n };\n }\n\n return reactRuntime;\n};\n
|
|
1
|
+
{"version":3,"file":"runtime.cjs","names":[],"sources":["../../../src/markdown/runtime.ts"],"sourcesContent":["import type { HTMLTag, MarkdownRuntime } from '@intlayer/core/markdown';\nimport {\n cloneElement,\n createElement,\n Fragment,\n type ReactElement,\n type ReactNode,\n} from 'react';\n\n/**\n * React-specific runtime for the markdown processor.\n * Implements the MarkdownRuntime interface using React's primitives.\n */\nexport const reactRuntime: MarkdownRuntime = {\n /**\n * Creates a React element.\n * Handles the conversion of props and children to React format.\n */\n createElement: (\n type: string | any,\n props: Record<string, any> | null,\n ...children: any[]\n ): ReactNode => {\n // React accepts children as rest args or as a single array\n // If there's only one child, pass it directly to avoid unnecessary array\n if (children.length === 0) {\n return createElement(type, props);\n }\n if (children.length === 1) {\n return createElement(type, props, children[0]);\n }\n return createElement(type, props, ...children);\n },\n\n /**\n * Clones a React element with new props.\n */\n cloneElement: (\n element: unknown,\n props: Record<string, any>,\n ...children: any[]\n ): ReactNode => {\n if (children.length === 0) {\n return cloneElement(element as ReactElement, props);\n }\n return cloneElement(element as ReactElement, props, ...children);\n },\n\n /**\n * React Fragment component.\n */\n Fragment,\n\n /**\n * React-specific prop normalization.\n * React uses className instead of class, htmlFor instead of for, etc.\n * The core processor already handles ATTRIBUTE_TO_NODE_PROP_MAP,\n * so this is mostly a no-op but can be used for additional React-specific transforms.\n */\n normalizeProps: (\n _tag: HTMLTag,\n props: Record<string, any>\n ): Record<string, any> => {\n // The core already handles class -> className and for -> htmlFor\n // via ATTRIBUTE_TO_NODE_PROP_MAP in the attrStringToMap function.\n // This hook is available for any additional React-specific transforms.\n return props;\n },\n};\n\n/**\n * Creates a React runtime with custom createElement for advanced use cases.\n * Useful for wrapping elements or adding middleware.\n */\nexport const createReactRuntime = (\n options: {\n onCreateElement?: (\n type: string | any,\n props: Record<string, any> | null,\n children: any[]\n ) => ReactNode;\n } = {}\n): MarkdownRuntime => {\n const { onCreateElement } = options;\n\n if (onCreateElement) {\n return {\n ...reactRuntime,\n createElement: (\n type: string | any,\n props: Record<string, any> | null,\n ...children: any[]\n ): ReactNode => {\n return onCreateElement(type, props, children);\n },\n };\n }\n\n return reactRuntime;\n};\n"],"mappings":";;;;;;;;;AAaA,MAAa,eAAgC;CAK3C,gBACE,MACA,OACA,GAAG,aACW;AAGd,MAAI,SAAS,WAAW,EACtB,iCAAqB,MAAM,MAAM;AAEnC,MAAI,SAAS,WAAW,EACtB,iCAAqB,MAAM,OAAO,SAAS,GAAG;AAEhD,kCAAqB,MAAM,OAAO,GAAG,SAAS;;CAMhD,eACE,SACA,OACA,GAAG,aACW;AACd,MAAI,SAAS,WAAW,EACtB,gCAAoB,SAAyB,MAAM;AAErD,iCAAoB,SAAyB,OAAO,GAAG,SAAS;;CAMlE;CAQA,iBACE,MACA,UACwB;AAIxB,SAAO;;CAEV;;;;;AAMD,MAAa,sBACX,UAMI,EAAE,KACc;CACpB,MAAM,EAAE,oBAAoB;AAE5B,KAAI,gBACF,QAAO;EACL,GAAG;EACH,gBACE,MACA,OACA,GAAG,aACW;AACd,UAAO,gBAAgB,MAAM,OAAO,SAAS;;EAEhD;AAGH,QAAO"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { IntlayerClientContext } from "../IntlayerProvider.mjs";
|
|
4
4
|
import { useContext } from "react";
|
|
5
|
-
import { date } from "@intlayer/core/formatters";
|
|
5
|
+
import { date, presets } from "@intlayer/core/formatters";
|
|
6
6
|
|
|
7
7
|
//#region src/client/format/useDate.ts
|
|
8
8
|
/**
|
|
@@ -33,10 +33,16 @@ import { date } from "@intlayer/core/formatters";
|
|
|
33
33
|
*/
|
|
34
34
|
const useDate = () => {
|
|
35
35
|
const { locale } = useContext(IntlayerClientContext);
|
|
36
|
-
return (...args) =>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
return (...args) => {
|
|
37
|
+
const options = typeof args[1] === "string" ? {
|
|
38
|
+
...presets[args[1]],
|
|
39
|
+
locale
|
|
40
|
+
} : {
|
|
41
|
+
...args[1],
|
|
42
|
+
locale: args[1]?.locale ?? locale
|
|
43
|
+
};
|
|
44
|
+
return date(args[0], options);
|
|
45
|
+
};
|
|
40
46
|
};
|
|
41
47
|
|
|
42
48
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDate.mjs","names":[],"sources":["../../../../src/client/format/useDate.ts"],"sourcesContent":["'use client';\n\nimport { date } from '@intlayer/core/formatters';\nimport { useContext } from 'react';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React client hook that provides a localized date/time formatter\n * bound to the current application locale.\n *\n * @returns {(date: Date | string | number, options?: DateProps) => string}\n * A function to format dates or timestamps into localized date/time strings.\n *\n * @example\n * ```tsx\n * const formatDate = useDate();\n *\n * formatDate(new Date(\"2025-01-01\"));\n * // \"Jan 1, 2025\"\n *\n * formatDate(\"2025-01-01T15:30:00Z\", {\n * dateStyle: \"full\",\n * timeStyle: \"short\",\n * });\n * // \"Wednesday, January 1, 2025 at 3:30 PM\"\n *\n * formatDate(1735689600000, { locale: \"fr-FR\", dateStyle: \"long\" });\n * // \"1 janvier 2025\"\n * ```\n *\n * @see createDate\n */\nexport const useDate = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return (...args: Parameters<typeof date>)
|
|
1
|
+
{"version":3,"file":"useDate.mjs","names":[],"sources":["../../../../src/client/format/useDate.ts"],"sourcesContent":["'use client';\n\nimport { date, presets } from '@intlayer/core/formatters';\nimport { useContext } from 'react';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React client hook that provides a localized date/time formatter\n * bound to the current application locale.\n *\n * @returns {(date: Date | string | number, options?: DateProps) => string}\n * A function to format dates or timestamps into localized date/time strings.\n *\n * @example\n * ```tsx\n * const formatDate = useDate();\n *\n * formatDate(new Date(\"2025-01-01\"));\n * // \"Jan 1, 2025\"\n *\n * formatDate(\"2025-01-01T15:30:00Z\", {\n * dateStyle: \"full\",\n * timeStyle: \"short\",\n * });\n * // \"Wednesday, January 1, 2025 at 3:30 PM\"\n *\n * formatDate(1735689600000, { locale: \"fr-FR\", dateStyle: \"long\" });\n * // \"1 janvier 2025\"\n * ```\n *\n * @see createDate\n */\nexport const useDate = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return (...args: Parameters<typeof date>) => {\n const options =\n typeof args[1] === 'string'\n ? { ...presets[args[1]], locale: locale }\n : { ...args[1], locale: args[1]?.locale ?? locale };\n\n return date(args[0], options as Parameters<typeof date>[1]);\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,MAAa,gBAAgB;CAC3B,MAAM,EAAE,WAAW,WAAW,sBAAsB;AAEpD,SAAQ,GAAG,SAAkC;EAC3C,MAAM,UACJ,OAAO,KAAK,OAAO,WACf;GAAE,GAAG,QAAQ,KAAK;GAAa;GAAQ,GACvC;GAAE,GAAG,KAAK;GAAI,QAAQ,KAAK,IAAI,UAAU;GAAQ;AAEvD,SAAO,KAAK,KAAK,IAAI,QAAsC"}
|
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":["import type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport type { IInterpreterPluginReact } from './plugins';\n\ndeclare module '@intlayer/core/interpreter' {\n interface IInterpreterPlugin<T, S, L extends LocalesValues>\n extends IInterpreterPluginReact<T, S, L> {}\n}\n\nexport { useIntl } from './client/format/useIntl';\n// Import directly from individual files to avoid circular dependency issues\nexport {\n IntlayerClientContext,\n IntlayerProvider,\n IntlayerProviderContent,\n type IntlayerProviderProps,\n useIntlayerContext,\n} from './client/IntlayerProvider';\nexport { t } from './client/t';\nexport { useDictionary } from './client/useDictionary';\nexport { useDictionaryAsync } from './client/useDictionaryAsync';\nexport { useDictionaryDynamic } from './client/useDictionaryDynamic';\nexport { useI18n } from './client/useI18n';\nexport { useIntlayer } from './client/useIntlayer';\nexport { useLoadDynamic } from './client/useLoadDynamic';\nexport { useLocale } from './client/useLocale';\nexport { useLocaleBase } from './client/useLocaleBase';\nexport {\n localeCookie,\n localeInStorage,\n setLocaleCookie,\n setLocaleInStorage,\n useLocaleCookie,\n useLocaleStorage,\n} from './client/useLocaleStorage';\nexport { useRewriteURL } from './client/useRewriteURL';\nexport { getDictionary } from './getDictionary';\nexport { getIntlayer } from './getIntlayer';\nexport type { IntlayerNode } from './IntlayerNode';\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
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["_MarkdownProvider","_useMarkdownContext","_renderMarkdown","_useMarkdownRenderer","_MarkdownRenderer"],"sources":["../../src/index.ts"],"sourcesContent":["import type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport type { IInterpreterPluginReact } from './plugins';\n\ndeclare module '@intlayer/core/interpreter' {\n interface IInterpreterPlugin<T, S, L extends LocalesValues>\n extends IInterpreterPluginReact<T, S, L> {}\n}\n\n/**\n * @deprecated import from react-intlayer/format instead\n */\nexport { useIntl } from './client/format/useIntl';\n// Import directly from individual files to avoid circular dependency issues\nexport {\n IntlayerClientContext,\n IntlayerProvider,\n IntlayerProviderContent,\n type IntlayerProviderProps,\n useIntlayerContext,\n} from './client/IntlayerProvider';\nexport { t } from './client/t';\nexport { useDictionary } from './client/useDictionary';\nexport { useDictionaryAsync } from './client/useDictionaryAsync';\nexport { useDictionaryDynamic } from './client/useDictionaryDynamic';\nexport { useI18n } from './client/useI18n';\nexport { useIntlayer } from './client/useIntlayer';\nexport { useLoadDynamic } from './client/useLoadDynamic';\nexport { useLocale } from './client/useLocale';\nexport { useLocaleBase } from './client/useLocaleBase';\nexport {\n localeCookie,\n localeInStorage,\n setLocaleCookie,\n setLocaleInStorage,\n useLocaleCookie,\n useLocaleStorage,\n} from './client/useLocaleStorage';\nexport { useRewriteURL } from './client/useRewriteURL';\nexport { getDictionary } from './getDictionary';\nexport { getIntlayer } from './getIntlayer';\nexport type { IntlayerNode } from './IntlayerNode';\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 * @deprecated import from react-intlayer/markdown instead\n */\nexport const MarkdownProvider = _MarkdownProvider;\n/**\n * @deprecated import from react-intlayer/markdown instead\n */\nexport const useMarkdownContext = _useMarkdownContext;\n/**\n * @deprecated import from react-intlayer/markdown instead\n */\nexport type MarkdownProviderOptions = _MarkdownProviderOptions;\n/**\n * @deprecated import from react-intlayer/markdown instead\n */\nexport const renderMarkdown = _renderMarkdown;\n/**\n * @deprecated import from react-intlayer/markdown instead\n */\nexport const useMarkdownRenderer = _useMarkdownRenderer;\n/**\n * @deprecated import from react-intlayer/markdown instead\n */\nexport const MarkdownRenderer = _MarkdownRenderer;\n/**\n * @deprecated import from react-intlayer/markdown instead\n */\nexport type RenderMarkdownProps = _RenderMarkdownProps;\n/**\n * @deprecated import from react-intlayer/markdown instead\n */\nexport type MarkdownRendererProps = _MarkdownRendererProps;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAyDA,MAAa,mBAAmBA;;;;AAIhC,MAAa,qBAAqBC;;;;AAQlC,MAAa,iBAAiBC;;;;AAI9B,MAAa,sBAAsBC;;;;AAInC,MAAa,mBAAmBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.mjs","names":[],"sources":["../../../src/markdown/runtime.ts"],"sourcesContent":["import type { HTMLTag, MarkdownRuntime } from '@intlayer/core/markdown';\nimport {\n cloneElement,\n createElement,\n Fragment,\n type ReactElement,\n type ReactNode,\n} from 'react';\n\n/**\n * React-specific runtime for the markdown processor.\n * Implements the MarkdownRuntime interface using React's primitives.\n */\nexport const reactRuntime: MarkdownRuntime = {\n /**\n * Creates a React element.\n * Handles the conversion of props and children to React format.\n */\n createElement: (\n type: string | any,\n props: Record<string, any> | null,\n ...children: any[]\n ): ReactNode => {\n // React accepts children as rest args or as a single array\n // If there's only one child, pass it directly to avoid unnecessary array\n if (children.length === 0) {\n return createElement(type, props);\n }\n if (children.length === 1) {\n return createElement(type, props, children[0]);\n }\n return createElement(type, props, ...children);\n },\n\n /**\n * Clones a React element with new props.\n */\n cloneElement: (\n element: unknown,\n props: Record<string, any>,\n ...children: any[]\n ): ReactNode => {\n if (children.length === 0) {\n return cloneElement(element as ReactElement, props);\n }\n return cloneElement(element as ReactElement, props, ...children);\n },\n\n /**\n * React Fragment component.\n */\n Fragment,\n\n /**\n * React-specific prop normalization.\n * React uses className instead of class, htmlFor instead of for, etc.\n * The core processor already handles ATTRIBUTE_TO_NODE_PROP_MAP,\n * so this is mostly a no-op but can be used for additional React-specific transforms.\n */\n normalizeProps: (\n _tag: HTMLTag,\n props: Record<string, any>\n ): Record<string, any> => {\n // The core already handles class -> className and for -> htmlFor\n // via ATTRIBUTE_TO_NODE_PROP_MAP in the attrStringToMap function.\n // This hook is available for any additional React-specific transforms.\n return props;\n },\n};\n\n/**\n * Creates a React runtime with custom createElement for advanced use cases.\n * Useful for wrapping elements or adding middleware.\n */\nexport const createReactRuntime = (\n options: {\n onCreateElement?: (\n type: string | any,\n props: Record<string, any> | null,\n children: any[]\n ) => ReactNode;\n } = {}\n): MarkdownRuntime => {\n const { onCreateElement } = options;\n\n if (onCreateElement) {\n return {\n ...reactRuntime,\n createElement: (\n type: string | any,\n props: Record<string, any> | null,\n ...children: any[]\n ): ReactNode => {\n return onCreateElement(type, props, children);\n },\n };\n }\n\n return reactRuntime;\n};\n
|
|
1
|
+
{"version":3,"file":"runtime.mjs","names":[],"sources":["../../../src/markdown/runtime.ts"],"sourcesContent":["import type { HTMLTag, MarkdownRuntime } from '@intlayer/core/markdown';\nimport {\n cloneElement,\n createElement,\n Fragment,\n type ReactElement,\n type ReactNode,\n} from 'react';\n\n/**\n * React-specific runtime for the markdown processor.\n * Implements the MarkdownRuntime interface using React's primitives.\n */\nexport const reactRuntime: MarkdownRuntime = {\n /**\n * Creates a React element.\n * Handles the conversion of props and children to React format.\n */\n createElement: (\n type: string | any,\n props: Record<string, any> | null,\n ...children: any[]\n ): ReactNode => {\n // React accepts children as rest args or as a single array\n // If there's only one child, pass it directly to avoid unnecessary array\n if (children.length === 0) {\n return createElement(type, props);\n }\n if (children.length === 1) {\n return createElement(type, props, children[0]);\n }\n return createElement(type, props, ...children);\n },\n\n /**\n * Clones a React element with new props.\n */\n cloneElement: (\n element: unknown,\n props: Record<string, any>,\n ...children: any[]\n ): ReactNode => {\n if (children.length === 0) {\n return cloneElement(element as ReactElement, props);\n }\n return cloneElement(element as ReactElement, props, ...children);\n },\n\n /**\n * React Fragment component.\n */\n Fragment,\n\n /**\n * React-specific prop normalization.\n * React uses className instead of class, htmlFor instead of for, etc.\n * The core processor already handles ATTRIBUTE_TO_NODE_PROP_MAP,\n * so this is mostly a no-op but can be used for additional React-specific transforms.\n */\n normalizeProps: (\n _tag: HTMLTag,\n props: Record<string, any>\n ): Record<string, any> => {\n // The core already handles class -> className and for -> htmlFor\n // via ATTRIBUTE_TO_NODE_PROP_MAP in the attrStringToMap function.\n // This hook is available for any additional React-specific transforms.\n return props;\n },\n};\n\n/**\n * Creates a React runtime with custom createElement for advanced use cases.\n * Useful for wrapping elements or adding middleware.\n */\nexport const createReactRuntime = (\n options: {\n onCreateElement?: (\n type: string | any,\n props: Record<string, any> | null,\n children: any[]\n ) => ReactNode;\n } = {}\n): MarkdownRuntime => {\n const { onCreateElement } = options;\n\n if (onCreateElement) {\n return {\n ...reactRuntime,\n createElement: (\n type: string | any,\n props: Record<string, any> | null,\n ...children: any[]\n ): ReactNode => {\n return onCreateElement(type, props, children);\n },\n };\n }\n\n return reactRuntime;\n};\n"],"mappings":";;;;;;;AAaA,MAAa,eAAgC;CAK3C,gBACE,MACA,OACA,GAAG,aACW;AAGd,MAAI,SAAS,WAAW,EACtB,QAAO,cAAc,MAAM,MAAM;AAEnC,MAAI,SAAS,WAAW,EACtB,QAAO,cAAc,MAAM,OAAO,SAAS,GAAG;AAEhD,SAAO,cAAc,MAAM,OAAO,GAAG,SAAS;;CAMhD,eACE,SACA,OACA,GAAG,aACW;AACd,MAAI,SAAS,WAAW,EACtB,QAAO,aAAa,SAAyB,MAAM;AAErD,SAAO,aAAa,SAAyB,OAAO,GAAG,SAAS;;CAMlE;CAQA,iBACE,MACA,UACwB;AAIxB,SAAO;;CAEV;;;;;AAMD,MAAa,sBACX,UAMI,EAAE,KACc;CACpB,MAAM,EAAE,oBAAoB;AAE5B,KAAI,gBACF,QAAO;EACL,GAAG;EACH,gBACE,MACA,OACA,GAAG,aACW;AACd,UAAO,gBAAgB,MAAM,OAAO,SAAS;;EAEhD;AAGH,QAAO"}
|
|
@@ -9,7 +9,7 @@ import { Dictionary } from "@intlayer/types/dictionary";
|
|
|
9
9
|
*
|
|
10
10
|
* If the locale is not provided, it will use the locale from the client context
|
|
11
11
|
*/
|
|
12
|
-
declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K, locale?: LocalesValues) => _intlayer_core_interpreter0.DeepTransformContent<T["content"], IInterpreterPluginState$1, "af" | "af-ZA" | "sq" | "sq-AL" | "am" | "am-ET" | "ar" | "ar-DZ" | "ar-BH" | "ar-TD" | "ar-KM" | "ar-DJ" | "ar-EG" | "ar-IQ" | "ar-JO" | "ar-KW" | "ar-LB" | "ar-LY" | "ar-MR" | "ar-MA" | "ar-OM" | "ar-PS" | "ar-QA" | "ar-SA" | "ar-SO" | "ar-SD" | "ar-SY" | "ar-TN" | "ar-AE" | "ar-YE" | "hy" | "hy-AM" | "az" | "az-AZ" | "eu" | "eu-ES" | "be" | "be-BY" | "bn" | "bn-BD" | "bn-IN" | "bn-MM" | "bs" | "bs-BA" | "bg" | "bg-BG" | "my" | "my-MM" | "ca" | "ca-ES" | "zh" | "zh-HK" | "zh-MO" | "zh-Hans" | "zh-CN" | "zh-SG" | "zh-TW" | "zh-Hant" | "hr
|
|
12
|
+
declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K, locale?: LocalesValues) => _intlayer_core_interpreter0.DeepTransformContent<T["content"], IInterpreterPluginState$1, "tr" | "th" | "hr" | "af" | "af-ZA" | "sq" | "sq-AL" | "am" | "am-ET" | "ar" | "ar-DZ" | "ar-BH" | "ar-TD" | "ar-KM" | "ar-DJ" | "ar-EG" | "ar-IQ" | "ar-JO" | "ar-KW" | "ar-LB" | "ar-LY" | "ar-MR" | "ar-MA" | "ar-OM" | "ar-PS" | "ar-QA" | "ar-SA" | "ar-SO" | "ar-SD" | "ar-SY" | "ar-TN" | "ar-AE" | "ar-YE" | "hy" | "hy-AM" | "az" | "az-AZ" | "eu" | "eu-ES" | "be" | "be-BY" | "bn" | "bn-BD" | "bn-IN" | "bn-MM" | "bs" | "bs-BA" | "bg" | "bg-BG" | "my" | "my-MM" | "ca" | "ca-ES" | "zh" | "zh-HK" | "zh-MO" | "zh-Hans" | "zh-CN" | "zh-SG" | "zh-TW" | "zh-Hant" | "hr-BA" | "hr-HR" | "cs" | "cs-CZ" | "da" | "da-DK" | "dv" | "dv-MV" | "nl" | "nl-BE" | "nl-NL" | "en" | "en-AU" | "en-BZ" | "en-BW" | "en-CA" | "en-CB" | "en-GH" | "en-HK" | "en-IN" | "en-IE" | "en-JM" | "en-KE" | "en-MY" | "en-NZ" | "en-NG" | "en-PK" | "en-PH" | "en-SG" | "en-ZA" | "en-TZ" | "en-TT" | "en-UG" | "en-GB" | "en-US" | "en-ZW" | "eo" | "et" | "et-EE" | "fo" | "fo-FO" | "fa" | "fa-IR" | "fi" | "fi-FI" | "fr" | "fr-BE" | "fr-CA" | "fr-FR" | "fr-LU" | "fr-MC" | "fr-CH" | "mk" | "mk-MK" | "gl" | "gl-ES" | "ka" | "ka-GE" | "de" | "de-AT" | "de-DE" | "de-LI" | "de-LU" | "de-CH" | "el" | "el-GR" | "gu" | "gu-IN" | "he" | "he-IL" | "hi" | "hi-IN" | "hu" | "hu-HU" | "is" | "is-IS" | "id" | "id-ID" | "ga" | "ga-IE" | "it" | "it-IT" | "it-CH" | "ja" | "ja-JP" | "kn" | "kn-IN" | "kk" | "kk-KZ" | "km" | "km-KH" | "kok" | "kok-IN" | "ko" | "ko-KR" | "ku" | "ku-TR" | "ky" | "ky-KG" | "lo" | "lo-LA" | "lv" | "lv-LV" | "lt" | "lt-LT" | "dsb" | "dsb-DE" | "mg-MG" | "ms" | "ml" | "ml-IN" | "ms-BN" | "ms-MY" | "mt" | "mt-MT" | "mi" | "mi-NZ" | "mr" | "mr-IN" | "mn" | "mn-MN" | "ne" | "ne-NP" | "ns" | "ns-ZA" | "no" | "nb" | "nb-NO" | "nn" | "nn-NO" | "ps" | "ps-AR" | "pl" | "pl-PL" | "pt" | "pt-BR" | "pt-CV" | "pt-GW" | "pt-MO" | "pt-MZ" | "pt-PT" | "pt-ST" | "pt-TL" | "pa" | "pa-IN" | "qu" | "qu-BO" | "qu-EC" | "qu-PE" | "ro" | "ro-MD" | "ro-RO" | "rm" | "rm-CH" | "ru" | "ru-MD" | "ru-RU" | "se" | "se-FI" | "se-NO" | "se-SE" | "sa" | "sa-IN" | "gd" | "gd-GB" | "sr-Cyrl" | "sr-BA" | "sr-RS" | "sr" | "sr-SP" | "si" | "si-LK" | "sk" | "sk-SK" | "sl" | "sl-SI" | "es" | "es-AR" | "es-BO" | "es-CL" | "es-CO" | "es-CR" | "es-CU" | "es-DO" | "es-EC" | "es-SV" | "es-GT" | "es-HN" | "es-MX" | "es-NI" | "es-PA" | "es-PY" | "es-PE" | "es-PR" | "es-ES" | "es-US" | "es-UY" | "es-VE" | "sw" | "sw-KE" | "sv" | "sv-FI" | "sv-SE" | "syr" | "syr-SY" | "tl" | "tl-PH" | "ta" | "ta-IN" | "tt" | "tt-RU" | "te" | "te-IN" | "th-TH" | "ts" | "tn" | "tn-ZA" | "tr-TR" | "uk" | "uk-UA" | "hsb" | "hsb-DE" | "ur" | "ur-PK" | "uz" | "uz-UZ" | "ve" | "ve-ZA" | "vi" | "vi-VN" | "cy" | "cy-GB" | "xh" | "xh-ZA" | "yi" | "yi-001" | "yo" | "yo-NG" | "zu" | "zu-ZA" | (string & {})>;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { useDictionaryDynamic };
|
|
15
15
|
//# sourceMappingURL=useDictionaryDynamic.d.ts.map
|
|
@@ -6,10 +6,6 @@ import { FC, JSX } from "react";
|
|
|
6
6
|
declare const defaultHTMLComponents: {} & {
|
|
7
7
|
object?: FC<react.DetailedHTMLProps<react.ObjectHTMLAttributes<HTMLObjectElement>, HTMLObjectElement>>;
|
|
8
8
|
html?: FC<react.DetailedHTMLProps<react.HtmlHTMLAttributes<HTMLHtmlElement>, HTMLHtmlElement>>;
|
|
9
|
-
hr?: FC<react.DetailedHTMLProps<react.HTMLAttributes<HTMLHRElement>, HTMLHRElement>>;
|
|
10
|
-
th?: FC<react.DetailedHTMLProps<react.ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>>;
|
|
11
|
-
tr?: FC<react.DetailedHTMLProps<react.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>>;
|
|
12
|
-
slot?: FC<react.DetailedHTMLProps<react.SlotHTMLAttributes<HTMLSlotElement>, HTMLSlotElement>>;
|
|
13
9
|
head?: FC<react.DetailedHTMLProps<react.HTMLAttributes<HTMLHeadElement>, HTMLHeadElement>>;
|
|
14
10
|
body?: FC<react.DetailedHTMLProps<react.HTMLAttributes<HTMLBodyElement>, HTMLBodyElement>>;
|
|
15
11
|
main?: FC<react.DetailedHTMLProps<react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
@@ -62,6 +58,8 @@ declare const defaultHTMLComponents: {} & {
|
|
|
62
58
|
thead?: FC<react.DetailedHTMLProps<react.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>>;
|
|
63
59
|
tbody?: FC<react.DetailedHTMLProps<react.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>>;
|
|
64
60
|
tfoot?: FC<react.DetailedHTMLProps<react.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>>;
|
|
61
|
+
tr?: FC<react.DetailedHTMLProps<react.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>>;
|
|
62
|
+
th?: FC<react.DetailedHTMLProps<react.ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>>;
|
|
65
63
|
td?: FC<react.DetailedHTMLProps<react.TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>>;
|
|
66
64
|
caption?: FC<react.DetailedHTMLProps<react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
67
65
|
colgroup?: FC<react.DetailedHTMLProps<react.ColgroupHTMLAttributes<HTMLTableColElement>, HTMLTableColElement>>;
|
|
@@ -96,6 +94,7 @@ declare const defaultHTMLComponents: {} & {
|
|
|
96
94
|
summary?: FC<react.DetailedHTMLProps<react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
97
95
|
dialog?: FC<react.DetailedHTMLProps<react.DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>>;
|
|
98
96
|
br?: FC<react.DetailedHTMLProps<react.HTMLAttributes<HTMLBRElement>, HTMLBRElement>>;
|
|
97
|
+
hr?: FC<react.DetailedHTMLProps<react.HTMLAttributes<HTMLHRElement>, HTMLHRElement>>;
|
|
99
98
|
wbr?: FC<react.DetailedHTMLProps<react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
100
99
|
ruby?: FC<react.DetailedHTMLProps<react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
101
100
|
rt?: FC<react.DetailedHTMLProps<react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
@@ -104,6 +103,7 @@ declare const defaultHTMLComponents: {} & {
|
|
|
104
103
|
bdo?: FC<react.DetailedHTMLProps<react.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
105
104
|
data?: FC<react.DetailedHTMLProps<react.DataHTMLAttributes<HTMLDataElement>, HTMLDataElement>>;
|
|
106
105
|
template?: FC<react.DetailedHTMLProps<react.HTMLAttributes<HTMLTemplateElement>, HTMLTemplateElement>>;
|
|
106
|
+
slot?: FC<react.DetailedHTMLProps<react.SlotHTMLAttributes<HTMLSlotElement>, HTMLSlotElement>>;
|
|
107
107
|
} & {
|
|
108
108
|
[key: string]: FC<any>;
|
|
109
109
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -25,6 +25,9 @@ import * as react from "react";
|
|
|
25
25
|
declare module '@intlayer/core/interpreter' {
|
|
26
26
|
interface IInterpreterPlugin<T, S, L extends LocalesValues> extends IInterpreterPluginReact<T, S, L> {}
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated import from react-intlayer/format instead
|
|
30
|
+
*/
|
|
28
31
|
/**
|
|
29
32
|
* @deprecated import from react-intlayer/markdown instead
|
|
30
33
|
*/
|
|
@@ -67,7 +70,7 @@ declare const useMarkdownRenderer: ({
|
|
|
67
70
|
forceInline,
|
|
68
71
|
preserveFrontmatter,
|
|
69
72
|
tagfilter
|
|
70
|
-
}?: RenderMarkdownProps$1) => (content: string) => string | number | bigint | boolean | Iterable<react.ReactNode> | react.
|
|
73
|
+
}?: RenderMarkdownProps$1) => (content: string) => string | number | bigint | boolean | Iterable<react.ReactNode> | Promise<react.ReactNode> | react.JSX.Element;
|
|
71
74
|
/**
|
|
72
75
|
* @deprecated import from react-intlayer/markdown instead
|
|
73
76
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;YAIY,kBAAA,iBAAmC,aAAA,UACnC,uBAAA,CAAwB,CAAA,EAAG,CAAA,EAAG,CAAA;AAAA;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;YAIY,kBAAA,iBAAmC,aAAA,UACnC,uBAAA,CAAwB,CAAA,EAAG,CAAA,EAAG,CAAA;AAAA;;;;AAJe;;;AAAA,cAwD5C,gBAAA,QAAgB,EAAA,CAAA,yBAAA;eAAA,cAAA;;gDAtBX,yBAAA,EAAA,UAAA,GAAA,cAAA,oBAEZ,OAAA,GACN,KAAA,CAAA,EAAA,CAAA,KAAA,CAAA,cAAA,CAAA,WAAA,OAAA,KAAA,CAAA,SAAA,GAAA,OAAA,CAAA,KAAA,CAAA,SAAA;AAAA;aAAA,KAAA,CAAA,SAAA;AAAA;;;;cAuBa,kBAAA;eAAwC,cAAA;+CAtCP,yBAAA,EAAA,UAAA,GAAA,cAAA,oBAC5B,OAAA,GACI,KAAA,CAAA,EAAA,CAAA,KAAA,CAAA,cAAA,CAAA,WAAA,OAAA,KAAA,CAAA,SAAA,GAAA,OAAA,CAAA,KAAA,CAAA,SAAA;AAAA;;;;KAwCV,uBAAA,GAA0B,yBAAA;;AARtC;;cAYa,cAAA,GAAc,OAAA;EAAA,UAAA;EAAA,OAAA;EAAA,UAAA;EAAA,WAAA;EAAA,mBAAA;EAAA;AAAA,IAAA,qBAAA,KAAA,KAAA,CAAA,GAAA,CAAA,OAAA;;;;cAId,mBAAA;EAAmB,UAAA;EAAA,OAAA;EAAA,UAAA;EAAA,WAAA;EAAA,mBAAA;EAAA;AAAA,IAAA,qBAAA,MAa44C,OAAA,kDAAe,QAAA,CAb35C,KAAA,CAa25C,SAAA,IAAA,OAAA,CAAA,KAAA,CAAA,SAAA,IAAA,KAAA,CAAA,GAAA,CAAA,OAAA;;;;cAT96C,gBAAA,EAAgB,KAAA,CAAA,EAAA,CAAA,uBAAA;;;;KAIjB,mBAAA,GAAsB,qBAAA;;;;KAItB,qBAAA,GAAwB,uBAAA"}
|
|
@@ -133,7 +133,7 @@ declare const useMarkdownRenderer: ({
|
|
|
133
133
|
forceInline,
|
|
134
134
|
preserveFrontmatter,
|
|
135
135
|
tagfilter
|
|
136
|
-
}?: RenderMarkdownProps) => (content: string) => string | number | bigint | boolean | Iterable<ReactNode> | JSX.Element
|
|
136
|
+
}?: RenderMarkdownProps) => (content: string) => string | number | bigint | boolean | Iterable<ReactNode> | Promise<ReactNode> | JSX.Element;
|
|
137
137
|
/**
|
|
138
138
|
* Props for the MarkdownRenderer component.
|
|
139
139
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownRenderer.d.ts","names":[],"sources":["../../../src/markdown/MarkdownRenderer.tsx"],"mappings":";;;;;;;AA6BA;;;;;;;;;;;;;;;;;KAAY,mBAAA,GAAsB,uBAAA;EAwBO;AA4BzC;;;;;;;;;;;;EAtCE,UAAA,GAAa,cAAA;EAuCb;;;;;;;;;EA7BA,OAAA,GAAU,EAAA,CAAG,cAAA,CAAe,WAAA;AAAA;;;;;;;;AAkG9B;;;;;;;;;;;;;;;;;;cAtEa,cAAA,GACX,OAAA;EACA,UAAA;EAAA,OAAA;EAAA,UAAA;EAAA,WAAA;EAAA,mBAAA;EAAA;AAAA,IAOG,mBAAA,KACF,GAAA,CAAI,OAAA;;;;;;;;;;;;;;;;;;;;;AA+GP;;;;;;;;;;;;;;;;;;;;;;;;;cAnDa,mBAAA;EAAuB,UAAA;EAAA,OAAA;EAAA,UAAA;EAAA,WAAA;EAAA,mBAAA;EAAA;AAAA,IAOjC,mBAAA,MAGO,OAAA,kDAAe,QAAA,CAAA,SAAA,IAAA,
|
|
1
|
+
{"version":3,"file":"MarkdownRenderer.d.ts","names":[],"sources":["../../../src/markdown/MarkdownRenderer.tsx"],"mappings":";;;;;;;AA6BA;;;;;;;;;;;;;;;;;KAAY,mBAAA,GAAsB,uBAAA;EAwBO;AA4BzC;;;;;;;;;;;;EAtCE,UAAA,GAAa,cAAA;EAuCb;;;;;;;;;EA7BA,OAAA,GAAU,EAAA,CAAG,cAAA,CAAe,WAAA;AAAA;;;;;;;;AAkG9B;;;;;;;;;;;;;;;;;;cAtEa,cAAA,GACX,OAAA;EACA,UAAA;EAAA,OAAA;EAAA,UAAA;EAAA,WAAA;EAAA,mBAAA;EAAA;AAAA,IAOG,mBAAA,KACF,GAAA,CAAI,OAAA;;;;;;;;;;;;;;;;;;;;;AA+GP;;;;;;;;;;;;;;;;;;;;;;;;;cAnDa,mBAAA;EAAuB,UAAA;EAAA,OAAA;EAAA,UAAA;EAAA,WAAA;EAAA,mBAAA;EAAA;AAAA,IAOjC,mBAAA,MAGO,OAAA,kDAAe,QAAA,CAAA,SAAA,IAAA,OAAA,CAAA,SAAA,IAAA,GAAA,CAAA,OAAA;;;;AAmJzB;;;;;;;;;;;;KA1GY,qBAAA,GAAwB,mBAAA;;;;;;;;;;;EAWlC,QAAA;;;;;;;;;;;;;;;;;;;;;EAqBA,cAAA,IACE,QAAA,UACA,OAAA;IACE,UAAA,GAAa,cAAA;IACb,OAAA,GAAU,EAAA;IACV,UAAA;IACA,WAAA;IACA,mBAAA;IACA,SAAA;EAAA,MAEC,SAAA,GAAY,OAAA,CAAQ,SAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAgEd,gBAAA,EAAkB,EAAA,CAAG,qBAAA"}
|
|
@@ -15,5 +15,5 @@ declare const createReactRuntime: (options?: {
|
|
|
15
15
|
onCreateElement?: (type: string | any, props: Record<string, any> | null, children: any[]) => ReactNode;
|
|
16
16
|
}) => MarkdownRuntime;
|
|
17
17
|
//#endregion
|
|
18
|
-
export { createReactRuntime, reactRuntime
|
|
18
|
+
export { createReactRuntime, reactRuntime };
|
|
19
19
|
//# sourceMappingURL=runtime.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-intlayer",
|
|
3
|
-
"version": "8.5.
|
|
3
|
+
"version": "8.5.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your React applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -123,14 +123,14 @@
|
|
|
123
123
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
124
124
|
},
|
|
125
125
|
"dependencies": {
|
|
126
|
-
"@intlayer/api": "8.5.
|
|
127
|
-
"@intlayer/config": "8.5.
|
|
128
|
-
"@intlayer/core": "8.5.
|
|
129
|
-
"@intlayer/dictionaries-entry": "8.5.
|
|
130
|
-
"@intlayer/editor": "8.5.
|
|
131
|
-
"@intlayer/editor-react": "8.5.
|
|
132
|
-
"@intlayer/types": "8.5.
|
|
133
|
-
"intlayer": "8.5.
|
|
126
|
+
"@intlayer/api": "8.5.1",
|
|
127
|
+
"@intlayer/config": "8.5.1",
|
|
128
|
+
"@intlayer/core": "8.5.1",
|
|
129
|
+
"@intlayer/dictionaries-entry": "8.5.1",
|
|
130
|
+
"@intlayer/editor": "8.5.1",
|
|
131
|
+
"@intlayer/editor-react": "8.5.1",
|
|
132
|
+
"@intlayer/types": "8.5.1",
|
|
133
|
+
"intlayer": "8.5.1"
|
|
134
134
|
},
|
|
135
135
|
"devDependencies": {
|
|
136
136
|
"@craco/types": "7.1.0",
|