solid-intlayer 8.11.0 → 8.11.2
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/useLocaleStorage.cjs +1 -1
- package/dist/cjs/markdown/compiler.cjs +1 -1
- package/dist/cjs/markdown/index.cjs +1 -1
- package/dist/esm/client/useLocaleStorage.mjs +6 -7
- package/dist/esm/markdown/compiler.mjs +23 -4
- package/dist/esm/markdown/index.mjs +4 -3
- package/dist/types/client/useDictionary.d.ts +1 -1
- package/dist/types/client/useDictionaryAsync.d.ts +1 -1
- package/dist/types/client/useDictionaryDynamic.d.ts +1 -1
- package/dist/types/client/useIntlayer.d.ts +1 -1
- package/dist/types/getDictionary.d.ts +1 -1
- package/dist/types/getIntlayer.d.ts +1 -1
- package/dist/types/markdown/MarkdownProvider.d.ts +3 -2
- package/dist/types/markdown/MarkdownRenderer.d.ts +4 -3
- package/dist/types/markdown/compiler.d.ts +6 -4
- package/dist/types/markdown/index.d.ts +1 -0
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("solid-js"),t=require("@intlayer/core/
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("solid-js"),t=require("@intlayer/core/utils");var n=(0,t.getLocaleFromStorageClient)(t.localeStorageOptions),r=n,i=(e,n)=>(0,t.setLocaleInStorageClient)(e,{...t.localeStorageOptions,isCookieEnabled:n}),a=i,o=n=>(0,e.createMemo)(()=>(0,t.LocaleStorageClient)({...t.localeStorageOptions,isCookieEnabled:n})),s=o;exports.localeCookie=r,exports.localeInStorage=n,exports.setLocaleCookie=a,exports.setLocaleInStorage=i,exports.useLocaleCookie=s,exports.useLocaleStorage=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./runtime.cjs");var t=async(t=``,n={})=>{let{compileWithOptions:r}=await import(`@intlayer/core/markdown`);return r(t,e.default,n)},n
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./runtime.cjs");var t=async(t=``,n={})=>{let{parseMarkdown:r}=await import(`@intlayer/core/markdown`),{components:i,namedCodesToUnicode:a,sanitizer:o,slugify:s,...c}=n;return r(t,{runtime:e.default,components:i,namedCodesToUnicode:a,sanitizer:o,slugify:s},c)},n=async(t=``,n={})=>{if(typeof t==`string`){let{compileWithOptions:r}=await import(`@intlayer/core/markdown`);return r(t,e.default,n)}let{renderMarkdownAst:r}=await import(`@intlayer/core/markdown`),{components:i,namedCodesToUnicode:a,sanitizer:o,slugify:s,...c}=n;return r(t,{runtime:e.default,components:i,namedCodesToUnicode:a,sanitizer:o,slugify:s},c)},r=n,i=n;exports.compile=i,exports.compileMarkdown=n,exports.compiler=r,exports.parseMarkdown=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./compiler.cjs"),t=require("./MarkdownProvider.cjs"),n=require("./MarkdownRenderer.cjs");exports.MarkdownProvider=t.MarkdownProvider,exports.MarkdownRenderer=n.MarkdownRenderer,exports.compile=e.compile,exports.compileMarkdown=e.compileMarkdown,exports.compiler=e.compiler,exports.parseMarkdown=e.parseMarkdown,exports.renderMarkdown=n.renderMarkdown,exports.useMarkdown=t.useMarkdown,exports.useMarkdownRenderer=n.useMarkdownRenderer;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { createMemo as e } from "solid-js";
|
|
2
|
-
import {
|
|
3
|
-
import { LocaleStorageClient as n, getLocaleFromStorageClient as r, setLocaleInStorageClient as i } from "@intlayer/core/utils";
|
|
2
|
+
import { LocaleStorageClient as t, getLocaleFromStorageClient as n, localeStorageOptions as r, setLocaleInStorageClient as i } from "@intlayer/core/utils";
|
|
4
3
|
//#region src/client/useLocaleStorage.ts
|
|
5
|
-
var a = r
|
|
6
|
-
...
|
|
4
|
+
var a = n(r), o = a, s = (e, t) => i(e, {
|
|
5
|
+
...r,
|
|
6
|
+
isCookieEnabled: t
|
|
7
|
+
}), c = s, l = (n) => e(() => t({
|
|
8
|
+
...r,
|
|
7
9
|
isCookieEnabled: n
|
|
8
|
-
}), c = s, l = (r) => e(() => n({
|
|
9
|
-
...t,
|
|
10
|
-
isCookieEnabled: r
|
|
11
10
|
})), u = l;
|
|
12
11
|
//#endregion
|
|
13
12
|
export { o as localeCookie, a as localeInStorage, c as setLocaleCookie, s as setLocaleInStorage, u as useLocaleCookie, l as useLocaleStorage };
|
|
@@ -1,8 +1,27 @@
|
|
|
1
1
|
import e from "./runtime.mjs";
|
|
2
2
|
//#region src/markdown/compiler.tsx
|
|
3
3
|
var t = async (t = "", n = {}) => {
|
|
4
|
-
let {
|
|
5
|
-
return r(t,
|
|
6
|
-
|
|
4
|
+
let { parseMarkdown: r } = await import("@intlayer/core/markdown"), { components: i, namedCodesToUnicode: a, sanitizer: o, slugify: s, ...c } = n;
|
|
5
|
+
return r(t, {
|
|
6
|
+
runtime: e,
|
|
7
|
+
components: i,
|
|
8
|
+
namedCodesToUnicode: a,
|
|
9
|
+
sanitizer: o,
|
|
10
|
+
slugify: s
|
|
11
|
+
}, c);
|
|
12
|
+
}, n = async (t = "", n = {}) => {
|
|
13
|
+
if (typeof t == "string") {
|
|
14
|
+
let { compileWithOptions: r } = await import("@intlayer/core/markdown");
|
|
15
|
+
return r(t, e, n);
|
|
16
|
+
}
|
|
17
|
+
let { renderMarkdownAst: r } = await import("@intlayer/core/markdown"), { components: i, namedCodesToUnicode: a, sanitizer: o, slugify: s, ...c } = n;
|
|
18
|
+
return r(t, {
|
|
19
|
+
runtime: e,
|
|
20
|
+
components: i,
|
|
21
|
+
namedCodesToUnicode: a,
|
|
22
|
+
sanitizer: o,
|
|
23
|
+
slugify: s
|
|
24
|
+
}, c);
|
|
25
|
+
}, r = n, i = n;
|
|
7
26
|
//#endregion
|
|
8
|
-
export {
|
|
27
|
+
export { i as compile, n as compileMarkdown, r as compiler, t as parseMarkdown };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { compile as e, compileMarkdown as t, compiler as n, parseMarkdown as r } from "./compiler.mjs";
|
|
2
|
+
import { MarkdownProvider as i, useMarkdown as a } from "./MarkdownProvider.mjs";
|
|
3
|
+
import { MarkdownRenderer as o, renderMarkdown as s, useMarkdownRenderer as c } from "./MarkdownRenderer.mjs";
|
|
4
|
+
export { i as MarkdownProvider, o as MarkdownRenderer, e as compile, t as compileMarkdown, n as compiler, r as parseMarkdown, s as renderMarkdown, a as useMarkdown, c as useMarkdownRenderer };
|
|
@@ -6,4 +6,4 @@ import { DeepTransformContent } from '../plugins';
|
|
|
6
6
|
*
|
|
7
7
|
* If the locale is not provided, it will use the locale from the client context
|
|
8
8
|
*/
|
|
9
|
-
export declare const useDictionary: <T extends Dictionary, L extends LocalesValues = DeclaredLocales>(dictionary: T, locale?: L) => DeepTransformContent<T["content"], L>;
|
|
9
|
+
export declare const useDictionary: <const T extends Dictionary, const L extends LocalesValues = DeclaredLocales>(dictionary: T, locale?: L) => DeepTransformContent<T["content"], L>;
|
|
@@ -5,4 +5,4 @@ import { DeclaredLocales, LocalesValues, StrictModeLocaleMap } from '@intlayer/t
|
|
|
5
5
|
*
|
|
6
6
|
* If the locale is not provided, it will use the locale from the client context
|
|
7
7
|
*/
|
|
8
|
-
export declare const useDictionaryAsync: <T extends Dictionary, L extends LocalesValues = DeclaredLocales>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, locale?: L) => Promise<import('@intlayer/core/interpreter').DeepTransformContent<T["content"], import('../plugins').IInterpreterPluginState, L>>;
|
|
8
|
+
export declare const useDictionaryAsync: <const T extends Dictionary, const L extends LocalesValues = DeclaredLocales>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, locale?: L) => Promise<import('@intlayer/core/interpreter').DeepTransformContent<T["content"], import('../plugins').IInterpreterPluginState, L>>;
|
|
@@ -5,4 +5,4 @@ import { DictionaryKeys, LocalesValues, StrictModeLocaleMap } from '@intlayer/ty
|
|
|
5
5
|
*
|
|
6
6
|
* If the locale is not provided, it will use the locale from the client context
|
|
7
7
|
*/
|
|
8
|
-
export declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K, locale?: LocalesValues) => import('@intlayer/core/interpreter').DeepTransformContent<T["content"], import('../plugins').IInterpreterPluginState, (string & {}) | "tr" | "th" | "hr" | "mi" | "mn" | "ms" | "is" | "id" | "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" | "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" | "ml" | "ml-IN" | "ms-BN" | "ms-MY" | "mt" | "mt-MT" | "mi-NZ" | "mr" | "mr-IN" | "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">;
|
|
8
|
+
export declare const useDictionaryDynamic: <const T extends Dictionary, const K extends DictionaryKeys>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K, locale?: LocalesValues) => import('@intlayer/core/interpreter').DeepTransformContent<T["content"], import('../plugins').IInterpreterPluginState, (string & {}) | "tr" | "th" | "hr" | "mi" | "mn" | "ms" | "is" | "id" | "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" | "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" | "ml" | "ml-IN" | "ms-BN" | "ms-MY" | "mt" | "mt-MT" | "mi-NZ" | "mr" | "mr-IN" | "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">;
|
|
@@ -22,4 +22,4 @@ import { DeepTransformContent } from '../plugins';
|
|
|
22
22
|
* };
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
|
-
export declare const useIntlayer: <T extends DictionaryKeys, L extends LocalesValues = DeclaredLocales>(key: T, locale?: L) => DeepTransformContent<DictionaryRegistryContent<T>, L>;
|
|
25
|
+
export declare const useIntlayer: <const T extends DictionaryKeys, const L extends LocalesValues = DeclaredLocales>(key: T, locale?: L) => DeepTransformContent<DictionaryRegistryContent<T>, L>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Dictionary } from '@intlayer/types/dictionary';
|
|
2
2
|
import { DeclaredLocales, LocalesValues } from '@intlayer/types/module_augmentation';
|
|
3
3
|
import { DeepTransformContent } from './plugins';
|
|
4
|
-
export declare const getDictionary: <T extends Dictionary, L extends LocalesValues = DeclaredLocales>(dictionary: T, locale?: L) => DeepTransformContent<T["content"], L>;
|
|
4
|
+
export declare const getDictionary: <const T extends Dictionary, const L extends LocalesValues = DeclaredLocales>(dictionary: T, locale?: L) => DeepTransformContent<T["content"], L>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DeclaredLocales, DictionaryKeys, DictionaryRegistryContent, LocalesValues } from '@intlayer/types/module_augmentation';
|
|
2
2
|
import { DeepTransformContent } from './plugins';
|
|
3
|
-
export declare const getIntlayer: <T extends DictionaryKeys, L extends LocalesValues = DeclaredLocales>(key: T, locale?: L) => DeepTransformContent<DictionaryRegistryContent<T>, L>;
|
|
3
|
+
export declare const getIntlayer: <const T extends DictionaryKeys, const L extends LocalesValues = DeclaredLocales>(key: T, locale?: L) => DeepTransformContent<DictionaryRegistryContent<T>, L>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Component, JSXElement, ParentProps, ValidComponent } from 'solid-js';
|
|
2
2
|
import { HTMLComponents } from '../html/types';
|
|
3
|
+
import { ParsedMarkdown } from './compiler';
|
|
3
4
|
export type MarkdownProviderOptions = {
|
|
4
5
|
/** Forces the compiler to always output content with a block-level wrapper. */
|
|
5
6
|
forceBlock?: boolean;
|
|
@@ -10,7 +11,7 @@ export type MarkdownProviderOptions = {
|
|
|
10
11
|
};
|
|
11
12
|
type MarkdownProviderValue = {
|
|
12
13
|
components?: HTMLComponents<'permissive', {}>;
|
|
13
|
-
renderMarkdown: (content: string, options?: MarkdownProviderOptions, components?: HTMLComponents<'permissive', {}>, wrapper?: ValidComponent) => JSXElement | Promise<JSXElement>;
|
|
14
|
+
renderMarkdown: (content: string | ParsedMarkdown, options?: MarkdownProviderOptions, components?: HTMLComponents<'permissive', {}>, wrapper?: ValidComponent) => JSXElement | Promise<JSXElement>;
|
|
14
15
|
};
|
|
15
16
|
export declare const MarkdownContext: import('solid-js').Context<MarkdownProviderValue | undefined>;
|
|
16
17
|
export type MarkdownProviderProps = ParentProps<{
|
|
@@ -19,7 +20,7 @@ export type MarkdownProviderProps = ParentProps<{
|
|
|
19
20
|
forceBlock?: boolean;
|
|
20
21
|
preserveFrontmatter?: boolean;
|
|
21
22
|
tagfilter?: boolean;
|
|
22
|
-
renderMarkdown?: (content: string, options?: MarkdownProviderOptions, components?: HTMLComponents<'permissive', {}>, wrapper?: ValidComponent) => JSXElement | Promise<JSXElement>;
|
|
23
|
+
renderMarkdown?: (content: string | ParsedMarkdown, options?: MarkdownProviderOptions, components?: HTMLComponents<'permissive', {}>, wrapper?: ValidComponent) => JSXElement | Promise<JSXElement>;
|
|
23
24
|
}>;
|
|
24
25
|
export declare const MarkdownProvider: Component<MarkdownProviderProps>;
|
|
25
26
|
export declare const useMarkdown: () => MarkdownProviderValue;
|
|
@@ -2,6 +2,7 @@ import { KeyPath } from '@intlayer/types/keyPath';
|
|
|
2
2
|
import { LocalesValues } from '@intlayer/types/module_augmentation';
|
|
3
3
|
import { Component, JSX, ValidComponent } from 'solid-js';
|
|
4
4
|
import { HTMLComponents } from '../html/types';
|
|
5
|
+
import { ParsedMarkdown } from './compiler';
|
|
5
6
|
export type RenderMarkdownOptions = {
|
|
6
7
|
components?: HTMLComponents<'permissive', {}>;
|
|
7
8
|
wrapper?: ValidComponent;
|
|
@@ -9,13 +10,13 @@ export type RenderMarkdownOptions = {
|
|
|
9
10
|
preserveFrontmatter?: boolean;
|
|
10
11
|
tagfilter?: boolean;
|
|
11
12
|
};
|
|
12
|
-
export declare const renderMarkdown: (content: string, options?: RenderMarkdownOptions) => Promise<JSX.Element>;
|
|
13
|
-
export declare const useMarkdownRenderer: (options?: RenderMarkdownOptions) => (content: string) => Promise<JSX.Element>;
|
|
13
|
+
export declare const renderMarkdown: (content: string | ParsedMarkdown, options?: RenderMarkdownOptions) => Promise<JSX.Element>;
|
|
14
|
+
export declare const useMarkdownRenderer: (options?: RenderMarkdownOptions) => (content: string | ParsedMarkdown) => Promise<JSX.Element>;
|
|
14
15
|
export type MarkdownRendererProps = RenderMarkdownOptions & {
|
|
15
16
|
dictionaryKey: string;
|
|
16
17
|
keyPath: KeyPath[];
|
|
17
18
|
locale?: LocalesValues;
|
|
18
|
-
children: string;
|
|
19
|
+
children: string | ParsedMarkdown;
|
|
19
20
|
};
|
|
20
21
|
export declare const MarkdownRenderer: (props: MarkdownRendererProps) => JSX.Element;
|
|
21
22
|
export type MarkdownMetadataRendererProps = MarkdownRendererProps & {
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { CompileOptions } from '@intlayer/core/markdown';
|
|
1
|
+
import { CompileOptions, ParsedMarkdown } from '@intlayer/core/markdown';
|
|
2
2
|
import { JSX } from 'solid-js';
|
|
3
3
|
/**
|
|
4
4
|
* Compile markdown to Solid JSX elements.
|
|
5
5
|
* Lazily imports the heavy markdown library to enable code splitting.
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export type { ParsedMarkdown };
|
|
8
|
+
export declare const parseMarkdown: (markdown?: string, options?: CompileOptions) => Promise<ParsedMarkdown>;
|
|
9
|
+
export declare const compileMarkdown: (input?: string | ParsedMarkdown, options?: CompileOptions) => Promise<JSX.Element>;
|
|
8
10
|
/**
|
|
9
11
|
* Solid component that renders markdown to JSX.
|
|
10
12
|
*/
|
|
11
|
-
export declare const compiler: (
|
|
12
|
-
export declare const compile: (
|
|
13
|
+
export declare const compiler: (input?: string | ParsedMarkdown, options?: CompileOptions) => Promise<JSX.Element>;
|
|
14
|
+
export declare const compile: (input?: string | ParsedMarkdown, options?: CompileOptions) => Promise<JSX.Element>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solid-intlayer",
|
|
3
|
-
"version": "8.11.
|
|
3
|
+
"version": "8.11.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Solid applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -104,11 +104,11 @@
|
|
|
104
104
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
105
105
|
},
|
|
106
106
|
"dependencies": {
|
|
107
|
-
"@intlayer/api": "8.11.
|
|
108
|
-
"@intlayer/config": "8.11.
|
|
109
|
-
"@intlayer/core": "8.11.
|
|
110
|
-
"@intlayer/editor": "8.11.
|
|
111
|
-
"@intlayer/types": "8.11.
|
|
107
|
+
"@intlayer/api": "8.11.2",
|
|
108
|
+
"@intlayer/config": "8.11.2",
|
|
109
|
+
"@intlayer/core": "8.11.2",
|
|
110
|
+
"@intlayer/editor": "8.11.2",
|
|
111
|
+
"@intlayer/types": "8.11.2"
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
114
|
"@solidjs/testing-library": "0.8.10",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"@utils/tsdown-config": "1.0.4",
|
|
121
121
|
"jsdom": "29.1.1",
|
|
122
122
|
"rimraf": "6.1.3",
|
|
123
|
-
"tsdown": "0.22.
|
|
123
|
+
"tsdown": "0.22.1",
|
|
124
124
|
"typescript": "6.0.3",
|
|
125
125
|
"vite": "8.0.14",
|
|
126
126
|
"vite-plugin-dts": "5.0.1",
|