preact-intlayer 7.2.0 → 7.2.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/UI/ContentSelector.cjs +0 -1
- package/dist/cjs/UI/ContentSelector.cjs.map +1 -1
- package/dist/cjs/_virtual/rolldown_runtime.cjs +10 -6
- package/dist/cjs/client/IntlayerProvider.cjs +0 -1
- package/dist/cjs/client/IntlayerProvider.cjs.map +1 -1
- package/dist/cjs/client/format/useCompact.cjs +0 -1
- package/dist/cjs/client/format/useCompact.cjs.map +1 -1
- package/dist/cjs/client/format/useCurrency.cjs +0 -1
- package/dist/cjs/client/format/useCurrency.cjs.map +1 -1
- package/dist/cjs/client/format/useDate.cjs +0 -1
- package/dist/cjs/client/format/useDate.cjs.map +1 -1
- package/dist/cjs/client/format/useList.cjs +0 -1
- package/dist/cjs/client/format/useList.cjs.map +1 -1
- package/dist/cjs/client/format/useNumber.cjs +0 -1
- package/dist/cjs/client/format/useNumber.cjs.map +1 -1
- package/dist/cjs/client/format/usePercentage.cjs +0 -1
- package/dist/cjs/client/format/usePercentage.cjs.map +1 -1
- package/dist/cjs/client/format/useRelativeTime.cjs +0 -1
- package/dist/cjs/client/format/useRelativeTime.cjs.map +1 -1
- package/dist/cjs/client/format/useUnit.cjs +0 -1
- package/dist/cjs/client/format/useUnit.cjs.map +1 -1
- package/dist/cjs/client/t.cjs +0 -1
- package/dist/cjs/client/t.cjs.map +1 -1
- package/dist/cjs/client/useDictionary.cjs +0 -1
- package/dist/cjs/client/useDictionary.cjs.map +1 -1
- package/dist/cjs/client/useDictionaryAsync.cjs +0 -1
- package/dist/cjs/client/useDictionaryAsync.cjs.map +1 -1
- package/dist/cjs/client/useDictionaryDynamic.cjs +0 -1
- package/dist/cjs/client/useDictionaryDynamic.cjs.map +1 -1
- package/dist/cjs/client/useIntlayer.cjs +0 -1
- package/dist/cjs/client/useIntlayer.cjs.map +1 -1
- package/dist/cjs/client/useLocale.cjs +0 -1
- package/dist/cjs/client/useLocale.cjs.map +1 -1
- package/dist/cjs/client/useLocaleBase.cjs +0 -1
- package/dist/cjs/client/useLocaleBase.cjs.map +1 -1
- package/dist/cjs/editor/CommunicatorContext.cjs +0 -1
- package/dist/cjs/editor/CommunicatorContext.cjs.map +1 -1
- package/dist/cjs/editor/ConfigurationContext.cjs +0 -1
- package/dist/cjs/editor/ConfigurationContext.cjs.map +1 -1
- package/dist/cjs/editor/ContentSelectorWrapper.cjs +0 -1
- package/dist/cjs/editor/ContentSelectorWrapper.cjs.map +1 -1
- package/dist/cjs/editor/DictionariesRecordContext.cjs +0 -1
- package/dist/cjs/editor/DictionariesRecordContext.cjs.map +1 -1
- package/dist/cjs/editor/EditedContentContext.cjs +0 -1
- package/dist/cjs/editor/EditedContentContext.cjs.map +1 -1
- package/dist/cjs/editor/EditorEnabledContext.cjs +0 -1
- package/dist/cjs/editor/EditorEnabledContext.cjs.map +1 -1
- package/dist/cjs/editor/EditorProvider.cjs +0 -1
- package/dist/cjs/editor/EditorProvider.cjs.map +1 -1
- package/dist/cjs/editor/FocusDictionaryContext.cjs +0 -1
- package/dist/cjs/editor/FocusDictionaryContext.cjs.map +1 -1
- package/dist/cjs/editor/IntlayerEditorProvider.cjs +5 -5
- package/dist/cjs/editor/IntlayerEditorProvider.cjs.map +1 -1
- package/dist/cjs/editor/useCrossFrameMessageListener.cjs +0 -1
- package/dist/cjs/editor/useCrossFrameMessageListener.cjs.map +1 -1
- package/dist/cjs/editor/useCrossFrameState.cjs +0 -1
- package/dist/cjs/editor/useCrossFrameState.cjs.map +1 -1
- package/dist/cjs/editor/useCrossURLPathState.cjs +0 -1
- package/dist/cjs/editor/useCrossURLPathState.cjs.map +1 -1
- package/dist/cjs/editor/useEditedContentRenderer.cjs +0 -1
- package/dist/cjs/editor/useEditedContentRenderer.cjs.map +1 -1
- package/dist/cjs/editor/useIframeClickInterceptor.cjs +0 -1
- package/dist/cjs/editor/useIframeClickInterceptor.cjs.map +1 -1
- package/dist/cjs/markdown/MarkdownProvider.cjs +0 -1
- package/dist/cjs/markdown/MarkdownProvider.cjs.map +1 -1
- package/dist/cjs/markdown/MarkdownRenderer.cjs +0 -1
- package/dist/cjs/markdown/MarkdownRenderer.cjs.map +1 -1
- package/dist/esm/UI/ContentSelector.mjs +0 -1
- package/dist/esm/UI/ContentSelector.mjs.map +1 -1
- package/dist/esm/client/IntlayerProvider.mjs +0 -1
- package/dist/esm/client/IntlayerProvider.mjs.map +1 -1
- package/dist/esm/client/format/useCompact.mjs +0 -1
- package/dist/esm/client/format/useCompact.mjs.map +1 -1
- package/dist/esm/client/format/useCurrency.mjs +0 -1
- package/dist/esm/client/format/useCurrency.mjs.map +1 -1
- package/dist/esm/client/format/useDate.mjs +0 -1
- package/dist/esm/client/format/useDate.mjs.map +1 -1
- package/dist/esm/client/format/useList.mjs +0 -1
- package/dist/esm/client/format/useList.mjs.map +1 -1
- package/dist/esm/client/format/useNumber.mjs +0 -1
- package/dist/esm/client/format/useNumber.mjs.map +1 -1
- package/dist/esm/client/format/usePercentage.mjs +0 -1
- package/dist/esm/client/format/usePercentage.mjs.map +1 -1
- package/dist/esm/client/format/useRelativeTime.mjs +0 -1
- package/dist/esm/client/format/useRelativeTime.mjs.map +1 -1
- package/dist/esm/client/format/useUnit.mjs +0 -1
- package/dist/esm/client/format/useUnit.mjs.map +1 -1
- package/dist/esm/client/t.mjs +0 -1
- package/dist/esm/client/t.mjs.map +1 -1
- package/dist/esm/client/useDictionary.mjs +0 -1
- package/dist/esm/client/useDictionary.mjs.map +1 -1
- package/dist/esm/client/useDictionaryAsync.mjs +0 -1
- package/dist/esm/client/useDictionaryAsync.mjs.map +1 -1
- package/dist/esm/client/useDictionaryDynamic.mjs +0 -1
- package/dist/esm/client/useDictionaryDynamic.mjs.map +1 -1
- package/dist/esm/client/useIntlayer.mjs +0 -1
- package/dist/esm/client/useIntlayer.mjs.map +1 -1
- package/dist/esm/client/useLocale.mjs +0 -1
- package/dist/esm/client/useLocale.mjs.map +1 -1
- package/dist/esm/client/useLocaleBase.mjs +0 -1
- package/dist/esm/client/useLocaleBase.mjs.map +1 -1
- package/dist/esm/editor/CommunicatorContext.mjs +0 -1
- package/dist/esm/editor/CommunicatorContext.mjs.map +1 -1
- package/dist/esm/editor/ConfigurationContext.mjs +0 -1
- package/dist/esm/editor/ConfigurationContext.mjs.map +1 -1
- package/dist/esm/editor/ContentSelectorWrapper.mjs +0 -1
- package/dist/esm/editor/ContentSelectorWrapper.mjs.map +1 -1
- package/dist/esm/editor/DictionariesRecordContext.mjs +0 -1
- package/dist/esm/editor/DictionariesRecordContext.mjs.map +1 -1
- package/dist/esm/editor/EditedContentContext.mjs +0 -1
- package/dist/esm/editor/EditedContentContext.mjs.map +1 -1
- package/dist/esm/editor/EditorEnabledContext.mjs +0 -1
- package/dist/esm/editor/EditorEnabledContext.mjs.map +1 -1
- package/dist/esm/editor/EditorProvider.mjs +0 -1
- package/dist/esm/editor/EditorProvider.mjs.map +1 -1
- package/dist/esm/editor/FocusDictionaryContext.mjs +0 -1
- package/dist/esm/editor/FocusDictionaryContext.mjs.map +1 -1
- package/dist/esm/editor/IntlayerEditorProvider.mjs +5 -5
- package/dist/esm/editor/IntlayerEditorProvider.mjs.map +1 -1
- package/dist/esm/editor/useCrossFrameMessageListener.mjs +0 -1
- package/dist/esm/editor/useCrossFrameMessageListener.mjs.map +1 -1
- package/dist/esm/editor/useCrossFrameState.mjs +0 -1
- package/dist/esm/editor/useCrossFrameState.mjs.map +1 -1
- package/dist/esm/editor/useCrossURLPathState.mjs +0 -1
- package/dist/esm/editor/useCrossURLPathState.mjs.map +1 -1
- package/dist/esm/editor/useEditedContentRenderer.mjs +0 -1
- package/dist/esm/editor/useEditedContentRenderer.mjs.map +1 -1
- package/dist/esm/editor/useIframeClickInterceptor.mjs +0 -1
- package/dist/esm/editor/useIframeClickInterceptor.mjs.map +1 -1
- package/dist/esm/markdown/MarkdownProvider.mjs +0 -1
- package/dist/esm/markdown/MarkdownProvider.mjs.map +1 -1
- package/dist/esm/markdown/MarkdownRenderer.mjs +0 -1
- package/dist/esm/markdown/MarkdownRenderer.mjs.map +1 -1
- package/dist/types/client/format/useCompact.d.ts +2 -2
- package/dist/types/client/format/useCompact.d.ts.map +1 -1
- package/dist/types/client/format/useCurrency.d.ts +2 -2
- package/dist/types/client/format/useCurrency.d.ts.map +1 -1
- package/dist/types/client/format/useNumber.d.ts +2 -2
- package/dist/types/client/format/usePercentage.d.ts +2 -2
- package/dist/types/client/format/usePercentage.d.ts.map +1 -1
- package/dist/types/client/format/useRelativeTime.d.ts +2 -2
- package/dist/types/client/format/useUnit.d.ts +2 -2
- package/dist/types/client/useContent.d.ts +2 -2
- package/dist/types/client/useContent.d.ts.map +1 -1
- package/dist/types/client/useDictionary.d.ts +2 -2
- package/dist/types/client/useLocale.d.ts +3 -3
- package/dist/types/client/useLocaleBase.d.ts +5 -5
- package/dist/types/client/useLocaleBase.d.ts.map +1 -1
- package/dist/types/client/useLocaleStorage.d.ts +5 -5
- package/dist/types/client/useLocaleStorage.d.ts.map +1 -1
- package/dist/types/editor/ConfigurationContext.d.ts +2 -2
- package/dist/types/editor/EditorEnabledContext.d.ts +2 -2
- package/dist/types/editor/IntlayerEditorProvider.d.ts.map +1 -1
- package/dist/types/editor/useCrossURLPathState.d.ts +3 -3
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownRenderer.mjs","names":["MarkdownRenderer: FC<MarkdownRendererProps>","MarkdownMetadataRenderer: FC<MarkdownMetadataRendererProps>"],"sources":["../../../src/markdown/MarkdownRenderer.tsx"],"sourcesContent":["'use client';\n\nimport {\n getContent,\n getContentNodeByKeyPath,\n getMarkdownMetadata,\n} from '@intlayer/core';\nimport type { ContentNode, KeyPath, LocalesValues } from '@intlayer/types';\nimport type { FC, ReactNode } from 'preact/compat';\nimport { useEditedContentRenderer } from '../editor/useEditedContentRenderer';\nimport { useMarkdownContext } from './MarkdownProvider';\n\ntype MarkdownRendererProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n locale?: LocalesValues;\n children: string;\n};\n\nexport const MarkdownRenderer: FC<MarkdownRendererProps> = ({\n dictionaryKey,\n keyPath,\n children,\n locale,\n}): ReactNode => {\n const { renderMarkdown } = useMarkdownContext();\n const editedContentContext = useEditedContentRenderer({\n dictionaryKey,\n keyPath,\n children,\n });\n\n if (typeof editedContentContext !== 'string') {\n const transformedEditedContent = getContent(\n editedContentContext,\n {\n dictionaryKey,\n keyPath,\n },\n locale\n );\n\n if (typeof transformedEditedContent !== 'string') {\n console.error(\n `Incorrect Markdown content. Edited Markdown content type: ${typeof transformedEditedContent}. Expected string. Value ${JSON.stringify(transformedEditedContent)}`\n );\n\n return renderMarkdown(children);\n }\n\n return renderMarkdown(transformedEditedContent);\n }\n\n return renderMarkdown(editedContentContext);\n};\n\ntype MarkdownMetadataRendererProps = MarkdownRendererProps & {\n metadataKeyPath: KeyPath[];\n};\n\nexport const MarkdownMetadataRenderer: FC<MarkdownMetadataRendererProps> = ({\n dictionaryKey,\n keyPath,\n children,\n metadataKeyPath,\n}): ReactNode => {\n const editedContentContext = useEditedContentRenderer({\n dictionaryKey,\n keyPath,\n children,\n });\n const metadata = getMarkdownMetadata(editedContentContext);\n\n const metadataEl = getContentNodeByKeyPath(\n metadata as ContentNode,\n metadataKeyPath\n );\n\n return metadataEl as ReactNode;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"MarkdownRenderer.mjs","names":["MarkdownRenderer: FC<MarkdownRendererProps>","MarkdownMetadataRenderer: FC<MarkdownMetadataRendererProps>"],"sources":["../../../src/markdown/MarkdownRenderer.tsx"],"sourcesContent":["'use client';\n\nimport {\n getContent,\n getContentNodeByKeyPath,\n getMarkdownMetadata,\n} from '@intlayer/core';\nimport type { ContentNode, KeyPath, LocalesValues } from '@intlayer/types';\nimport type { FC, ReactNode } from 'preact/compat';\nimport { useEditedContentRenderer } from '../editor/useEditedContentRenderer';\nimport { useMarkdownContext } from './MarkdownProvider';\n\ntype MarkdownRendererProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n locale?: LocalesValues;\n children: string;\n};\n\nexport const MarkdownRenderer: FC<MarkdownRendererProps> = ({\n dictionaryKey,\n keyPath,\n children,\n locale,\n}): ReactNode => {\n const { renderMarkdown } = useMarkdownContext();\n const editedContentContext = useEditedContentRenderer({\n dictionaryKey,\n keyPath,\n children,\n });\n\n if (typeof editedContentContext !== 'string') {\n const transformedEditedContent = getContent(\n editedContentContext,\n {\n dictionaryKey,\n keyPath,\n },\n locale\n );\n\n if (typeof transformedEditedContent !== 'string') {\n console.error(\n `Incorrect Markdown content. Edited Markdown content type: ${typeof transformedEditedContent}. Expected string. Value ${JSON.stringify(transformedEditedContent)}`\n );\n\n return renderMarkdown(children);\n }\n\n return renderMarkdown(transformedEditedContent);\n }\n\n return renderMarkdown(editedContentContext);\n};\n\ntype MarkdownMetadataRendererProps = MarkdownRendererProps & {\n metadataKeyPath: KeyPath[];\n};\n\nexport const MarkdownMetadataRenderer: FC<MarkdownMetadataRendererProps> = ({\n dictionaryKey,\n keyPath,\n children,\n metadataKeyPath,\n}): ReactNode => {\n const editedContentContext = useEditedContentRenderer({\n dictionaryKey,\n keyPath,\n children,\n });\n const metadata = getMarkdownMetadata(editedContentContext);\n\n const metadataEl = getContentNodeByKeyPath(\n metadata as ContentNode,\n metadataKeyPath\n );\n\n return metadataEl as ReactNode;\n};\n"],"mappings":";;;;;;;AAmBA,MAAaA,oBAA+C,EAC1D,eACA,SACA,UACA,aACe;CACf,MAAM,EAAE,mBAAmB,oBAAoB;CAC/C,MAAM,uBAAuB,yBAAyB;EACpD;EACA;EACA;EACD,CAAC;AAEF,KAAI,OAAO,yBAAyB,UAAU;EAC5C,MAAM,2BAA2B,WAC/B,sBACA;GACE;GACA;GACD,EACD,OACD;AAED,MAAI,OAAO,6BAA6B,UAAU;AAChD,WAAQ,MACN,6DAA6D,OAAO,yBAAyB,2BAA2B,KAAK,UAAU,yBAAyB,GACjK;AAED,UAAO,eAAe,SAAS;;AAGjC,SAAO,eAAe,yBAAyB;;AAGjD,QAAO,eAAe,qBAAqB;;AAO7C,MAAaC,4BAA+D,EAC1E,eACA,SACA,UACA,sBACe;AAaf,QALmB,wBAFF,oBALY,yBAAyB;EACpD;EACA;EACA;EACD,CAAC,CACwD,EAIxD,gBACD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _intlayer_types7 from "@intlayer/types";
|
|
2
2
|
|
|
3
3
|
//#region src/client/format/useCompact.d.ts
|
|
4
4
|
|
|
@@ -13,7 +13,7 @@ import * as _intlayer_types10 from "@intlayer/types";
|
|
|
13
13
|
* ```
|
|
14
14
|
*/
|
|
15
15
|
declare const useCompact: () => (value: string | number, options?: Intl.NumberFormatOptions & {
|
|
16
|
-
locale?:
|
|
16
|
+
locale?: _intlayer_types7.LocalesValues;
|
|
17
17
|
}) => string;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { useCompact };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCompact.d.ts","names":[],"sources":["../../../../src/client/format/useCompact.ts"],"sourcesContent":[],"mappings":";;;;;;;AAgBA;;;;;;;cAAa,qDAAU,IAAA,CAAA;WAAA,
|
|
1
|
+
{"version":3,"file":"useCompact.d.ts","names":[],"sources":["../../../../src/client/format/useCompact.ts"],"sourcesContent":[],"mappings":";;;;;;;AAgBA;;;;;;;cAAa,qDAAU,IAAA,CAAA;WAAA,gBAAA,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _intlayer_types8 from "@intlayer/types";
|
|
2
2
|
|
|
3
3
|
//#region src/client/format/useCurrency.d.ts
|
|
4
4
|
|
|
@@ -27,7 +27,7 @@ import * as _intlayer_types11 from "@intlayer/types";
|
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
29
|
declare const useCurrency: () => (value: string | number, options?: Intl.NumberFormatOptions & {
|
|
30
|
-
locale?:
|
|
30
|
+
locale?: _intlayer_types8.LocalesValues;
|
|
31
31
|
}) => string;
|
|
32
32
|
//#endregion
|
|
33
33
|
export { useCurrency };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCurrency.d.ts","names":[],"sources":["../../../../src/client/format/useCurrency.ts"],"sourcesContent":[],"mappings":";;;;;;;AA8BA;;;;;;;;;;;;;;;;;;;;;cAAa,sDAAW,IAAA,CAAA;WAAA,
|
|
1
|
+
{"version":3,"file":"useCurrency.d.ts","names":[],"sources":["../../../../src/client/format/useCurrency.ts"],"sourcesContent":[],"mappings":";;;;;;;AA8BA;;;;;;;;;;;;;;;;;;;;;cAAa,sDAAW,IAAA,CAAA;WAAA,gBAAA,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _intlayer_types10 from "@intlayer/types";
|
|
2
2
|
|
|
3
3
|
//#region src/client/format/useNumber.d.ts
|
|
4
4
|
|
|
@@ -25,7 +25,7 @@ import * as _intlayer_types12 from "@intlayer/types";
|
|
|
25
25
|
* A number formatting function bound to the active locale.
|
|
26
26
|
*/
|
|
27
27
|
declare const useNumber: () => (value: string | number, options?: Intl.NumberFormatOptions & {
|
|
28
|
-
locale?:
|
|
28
|
+
locale?: _intlayer_types10.LocalesValues;
|
|
29
29
|
}) => string;
|
|
30
30
|
//#endregion
|
|
31
31
|
export { useNumber };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _intlayer_types11 from "@intlayer/types";
|
|
2
2
|
|
|
3
3
|
//#region src/client/format/usePercentage.d.ts
|
|
4
4
|
|
|
@@ -21,7 +21,7 @@ import * as _intlayer_types8 from "@intlayer/types";
|
|
|
21
21
|
* A function that formats numbers or numeric strings into localized percentages.
|
|
22
22
|
*/
|
|
23
23
|
declare const usePercentage: () => (value: string | number, options?: Intl.NumberFormatOptions & {
|
|
24
|
-
locale?:
|
|
24
|
+
locale?: _intlayer_types11.LocalesValues;
|
|
25
25
|
}) => string;
|
|
26
26
|
//#endregion
|
|
27
27
|
export { usePercentage };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePercentage.d.ts","names":[],"sources":["../../../../src/client/format/usePercentage.ts"],"sourcesContent":[],"mappings":";;;;;;;AAwBA;;;;;;;;;;;;;;;cAAa,wDAAa,IAAA,CAAA;WAAA,
|
|
1
|
+
{"version":3,"file":"usePercentage.d.ts","names":[],"sources":["../../../../src/client/format/usePercentage.ts"],"sourcesContent":[],"mappings":";;;;;;;AAwBA;;;;;;;;;;;;;;;cAAa,wDAAa,IAAA,CAAA;WAAA,iBAAA,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _intlayer_types12 from "@intlayer/types";
|
|
2
2
|
|
|
3
3
|
//#region src/client/format/useRelativeTime.d.ts
|
|
4
4
|
|
|
@@ -21,7 +21,7 @@ import * as _intlayer_types18 from "@intlayer/types";
|
|
|
21
21
|
* bound to the current client locale.
|
|
22
22
|
*/
|
|
23
23
|
declare const useRelativeTime: () => (from: string | number | Date, to?: string | number | Date, options?: Intl.RelativeTimeFormatOptions & {
|
|
24
|
-
locale?:
|
|
24
|
+
locale?: _intlayer_types12.LocalesValues;
|
|
25
25
|
unit?: Intl.RelativeTimeFormatUnit;
|
|
26
26
|
}) => string;
|
|
27
27
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _intlayer_types18 from "@intlayer/types";
|
|
2
2
|
|
|
3
3
|
//#region src/client/format/useUnit.d.ts
|
|
4
4
|
|
|
@@ -20,7 +20,7 @@ import * as _intlayer_types17 from "@intlayer/types";
|
|
|
20
20
|
* @returns {Function} A unit formatting function that accepts a value and optional formatting options.
|
|
21
21
|
*/
|
|
22
22
|
declare const useUnit: () => (value: string | number, options?: Intl.NumberFormatOptions & {
|
|
23
|
-
locale?:
|
|
23
|
+
locale?: _intlayer_types18.LocalesValues;
|
|
24
24
|
}) => string;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { useUnit };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _intlayer_types13 from "@intlayer/types";
|
|
2
2
|
import { StrictModeLocaleMap } from "@intlayer/types";
|
|
3
3
|
|
|
4
4
|
//#region src/client/useContent.d.ts
|
|
@@ -6,7 +6,7 @@ import { StrictModeLocaleMap } from "@intlayer/types";
|
|
|
6
6
|
* On the client side, hook to get the translation content based on the locale
|
|
7
7
|
*/
|
|
8
8
|
declare const useContent: <Content>(languageContent: StrictModeLocaleMap<Content>) => {
|
|
9
|
-
locale:
|
|
9
|
+
locale: _intlayer_types13.LocalesValues;
|
|
10
10
|
content: Content;
|
|
11
11
|
t: <Content_1 = string>(languageContent: StrictModeLocaleMap<Content_1>) => Content_1;
|
|
12
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useContent.d.ts","names":[],"sources":["../../../src/client/useContent.ts"],"sourcesContent":[],"mappings":";;;;;;;AAOa,cAAA,UAYZ,EAAA,CAAA,OAAA,CAAA,CAAA,eAAA,EAXkB,mBAWlB,CAXsC,OAWtC,CAAA,EAAA,GAAA;EAXsC,MAAA,EAAD,
|
|
1
|
+
{"version":3,"file":"useContent.d.ts","names":[],"sources":["../../../src/client/useContent.ts"],"sourcesContent":[],"mappings":";;;;;;;AAOa,cAAA,UAYZ,EAAA,CAAA,OAAA,CAAA,CAAA,eAAA,EAXkB,mBAWlB,CAXsC,OAWtC,CAAA,EAAA,GAAA;EAXsC,MAAA,EAAD,iBAAA,CAAA,aAAC;EAApB,OAAA,SAAA;EAAmB,CAAA,EAAA,CAAA,YAAA,MAAA,CAAA,CAAA,eAAA,qBAAA,UAAA,CAAA,EAAA,YAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IInterpreterPluginState as IInterpreterPluginState$1 } from "../plugins.js";
|
|
2
2
|
import * as _intlayer_core0 from "@intlayer/core";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _intlayer_types0 from "@intlayer/types";
|
|
4
4
|
import { DeclaredLocales, Dictionary, LocalesValues } from "@intlayer/types";
|
|
5
5
|
|
|
6
6
|
//#region src/client/useDictionary.d.ts
|
|
@@ -9,7 +9,7 @@ import { DeclaredLocales, Dictionary, LocalesValues } from "@intlayer/types";
|
|
|
9
9
|
*
|
|
10
10
|
* If the locale is not provided, it will use the locale from the client context
|
|
11
11
|
*/
|
|
12
|
-
declare const useDictionary: <T extends Dictionary, L extends LocalesValues = DeclaredLocales>(dictionary: T, locale?: L) => _intlayer_core0.DeepTransformContent<T["content"], IInterpreterPluginState$1,
|
|
12
|
+
declare const useDictionary: <T extends Dictionary, L extends LocalesValues = DeclaredLocales>(dictionary: T, locale?: L) => _intlayer_core0.DeepTransformContent<T["content"], IInterpreterPluginState$1, _intlayer_types0.Locale>;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { useDictionary };
|
|
15
15
|
//# sourceMappingURL=useDictionary.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _intlayer_types1 from "@intlayer/types";
|
|
2
2
|
import { LocalesValues } from "@intlayer/types";
|
|
3
3
|
|
|
4
4
|
//#region src/client/useLocale.d.ts
|
|
@@ -14,8 +14,8 @@ declare const useLocale: ({
|
|
|
14
14
|
onLocaleChange
|
|
15
15
|
}?: useLocaleProps) => {
|
|
16
16
|
locale: LocalesValues;
|
|
17
|
-
defaultLocale:
|
|
18
|
-
availableLocales:
|
|
17
|
+
defaultLocale: _intlayer_types1.Locale;
|
|
18
|
+
availableLocales: _intlayer_types1.Locale[];
|
|
19
19
|
setLocale: (locale: LocalesValues) => void;
|
|
20
20
|
};
|
|
21
21
|
//#endregion
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _intlayer_types3 from "@intlayer/types";
|
|
2
2
|
|
|
3
3
|
//#region src/client/useLocaleBase.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* On the client side, hook to get the current locale and all related fields
|
|
6
6
|
*/
|
|
7
7
|
declare const useLocaleBase: () => {
|
|
8
|
-
locale:
|
|
9
|
-
defaultLocale:
|
|
10
|
-
availableLocales:
|
|
11
|
-
setLocale: (newLocale:
|
|
8
|
+
locale: _intlayer_types3.LocalesValues;
|
|
9
|
+
defaultLocale: _intlayer_types3.Locale;
|
|
10
|
+
availableLocales: _intlayer_types3.Locale[];
|
|
11
|
+
setLocale: (newLocale: _intlayer_types3.LocalesValues) => void;
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
14
14
|
export { useLocaleBase };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocaleBase.d.ts","names":[],"sources":["../../../src/client/useLocaleBase.ts"],"sourcesContent":[],"mappings":";;;;;;AAYa,cAAA,aASZ,EAAA,GAAA,GAAA;EAAA,MAAA,EAAA,
|
|
1
|
+
{"version":3,"file":"useLocaleBase.d.ts","names":[],"sources":["../../../src/client/useLocaleBase.ts"],"sourcesContent":[],"mappings":";;;;;;AAYa,cAAA,aASZ,EAAA,GAAA,GAAA;EAAA,MAAA,EAAA,gBAAA,CAAA,aAAA"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _intlayer_types14 from "@intlayer/types";
|
|
2
2
|
import { LocalesValues } from "@intlayer/types";
|
|
3
3
|
|
|
4
4
|
//#region src/client/useLocaleStorage.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Get the locale cookie
|
|
7
7
|
*/
|
|
8
|
-
declare const localeInStorage:
|
|
8
|
+
declare const localeInStorage: _intlayer_types14.Locale;
|
|
9
9
|
/**
|
|
10
10
|
* @deprecated Use localeInStorage instead
|
|
11
11
|
*
|
|
12
12
|
* Get the locale cookie
|
|
13
13
|
*/
|
|
14
|
-
declare const localeCookie:
|
|
14
|
+
declare const localeCookie: _intlayer_types14.Locale;
|
|
15
15
|
/**
|
|
16
16
|
* Set the locale cookie
|
|
17
17
|
*/
|
|
@@ -26,7 +26,7 @@ declare const setLocaleCookie: (locale: LocalesValues, isCookieEnabled: boolean)
|
|
|
26
26
|
* Hook that provides the locale storage and a function to set it
|
|
27
27
|
*/
|
|
28
28
|
declare const useLocaleStorage: (isCookieEnabled?: boolean) => {
|
|
29
|
-
getLocale: () =>
|
|
29
|
+
getLocale: () => _intlayer_types14.Locale;
|
|
30
30
|
setLocale: (locale: LocalesValues) => void;
|
|
31
31
|
};
|
|
32
32
|
/**
|
|
@@ -37,7 +37,7 @@ declare const useLocaleStorage: (isCookieEnabled?: boolean) => {
|
|
|
37
37
|
* Hook that provides the locale cookie and a function to set it
|
|
38
38
|
*/
|
|
39
39
|
declare const useLocaleCookie: (isCookieEnabled?: boolean) => {
|
|
40
|
-
localeCookie:
|
|
40
|
+
localeCookie: _intlayer_types14.Locale;
|
|
41
41
|
setLocaleCookie: (locale: LocalesValues) => void;
|
|
42
42
|
};
|
|
43
43
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocaleStorage.d.ts","names":[],"sources":["../../../src/client/useLocaleStorage.ts"],"sourcesContent":[],"mappings":";;;;;;;AAYa,cAAA,eAA4D,EAAA,
|
|
1
|
+
{"version":3,"file":"useLocaleStorage.d.ts","names":[],"sources":["../../../src/client/useLocaleStorage.ts"],"sourcesContent":[],"mappings":";;;;;;;AAYa,cAAA,eAA4D,EAAA,iBAAA,CAA7C,MAA6C;AAMzE;AAKA;AAcA;AAKA;AAiBA;cAzCa,cAA8B,iBAAA,CAAlB;;;;cAKZ,6BACH;;;;;;cAaG,0BAbH;;;;cAkBG;mBAQV,iBAAA,CAAA;sBAAA;;;;;;;;;cASU;gBAMZ,iBAAA,CAAA;4BAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from "preact/compat";
|
|
2
2
|
import { IntlayerConfig } from "@intlayer/types";
|
|
3
|
-
import * as
|
|
3
|
+
import * as preact_hooks0 from "preact/hooks";
|
|
4
4
|
|
|
5
5
|
//#region src/editor/ConfigurationContext.d.ts
|
|
6
|
-
declare const useConfigurationState: () => [IntlayerConfig,
|
|
6
|
+
declare const useConfigurationState: () => [IntlayerConfig, preact_hooks0.Dispatch<preact_hooks0.StateUpdater<IntlayerConfig>>, () => void];
|
|
7
7
|
type ConfigurationProviderProps = {
|
|
8
8
|
configuration?: IntlayerConfig;
|
|
9
9
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { CrossFrameStateOptions } from "./useCrossFrameState.js";
|
|
2
2
|
import { FC, PropsWithChildren } from "preact/compat";
|
|
3
|
-
import * as
|
|
3
|
+
import * as preact_hooks1 from "preact/hooks";
|
|
4
4
|
|
|
5
5
|
//#region src/editor/EditorEnabledContext.d.ts
|
|
6
6
|
type EditorEnabledStateProps = {
|
|
7
7
|
enabled: boolean;
|
|
8
8
|
};
|
|
9
|
-
declare const useEditorEnabledState: (options?: CrossFrameStateOptions) => [boolean,
|
|
9
|
+
declare const useEditorEnabledState: (options?: CrossFrameStateOptions) => [boolean, preact_hooks1.Dispatch<preact_hooks1.StateUpdater<boolean>>, () => void];
|
|
10
10
|
declare const usePostEditorEnabledState: <S>(onEventTriggered?: (data: S) => void) => (data?: S) => void;
|
|
11
11
|
declare const useGetEditorEnabledState: <S>(onEventTriggered?: (data: S) => void) => (data?: S) => void;
|
|
12
12
|
declare const EditorEnabledProvider: FC<PropsWithChildren>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntlayerEditorProvider.d.ts","names":[],"sources":["../../../src/editor/IntlayerEditorProvider.tsx"],"sourcesContent":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"IntlayerEditorProvider.d.ts","names":[],"sources":["../../../src/editor/IntlayerEditorProvider.tsx"],"sourcesContent":[],"mappings":";;;cAoDa,wBAAwB;aACxB;AADb,CAAA,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CrossFrameStateOptions } from "./useCrossFrameState.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as preact_hooks3 from "preact/hooks";
|
|
3
3
|
|
|
4
4
|
//#region src/editor/useCrossURLPathState.d.ts
|
|
5
|
-
declare const useCrossURLPathState: (initialState?: string, options?: CrossFrameStateOptions) => [string,
|
|
6
|
-
declare const useCrossURLPathSetter: (initialState?: string) => [string,
|
|
5
|
+
declare const useCrossURLPathState: (initialState?: string, options?: CrossFrameStateOptions) => [string, preact_hooks3.Dispatch<preact_hooks3.StateUpdater<string>>, () => void];
|
|
6
|
+
declare const useCrossURLPathSetter: (initialState?: string) => [string, preact_hooks3.Dispatch<preact_hooks3.StateUpdater<string>>, () => void];
|
|
7
7
|
//#endregion
|
|
8
8
|
export { useCrossURLPathSetter, useCrossURLPathState };
|
|
9
9
|
//# sourceMappingURL=useCrossURLPathState.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "preact-intlayer",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Preact applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -84,23 +84,23 @@
|
|
|
84
84
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"@intlayer/api": "7.2.
|
|
88
|
-
"@intlayer/chokidar": "7.2.
|
|
89
|
-
"@intlayer/config": "7.2.
|
|
90
|
-
"@intlayer/core": "7.2.
|
|
91
|
-
"@intlayer/editor": "7.2.
|
|
92
|
-
"@intlayer/types": "7.2.
|
|
93
|
-
"@intlayer/unmerged-dictionaries-entry": "7.2.
|
|
87
|
+
"@intlayer/api": "7.2.2",
|
|
88
|
+
"@intlayer/chokidar": "7.2.2",
|
|
89
|
+
"@intlayer/config": "7.2.2",
|
|
90
|
+
"@intlayer/core": "7.2.1",
|
|
91
|
+
"@intlayer/editor": "7.2.2",
|
|
92
|
+
"@intlayer/types": "7.2.2",
|
|
93
|
+
"@intlayer/unmerged-dictionaries-entry": "7.2.2"
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": {
|
|
96
96
|
"@types/node": "24.10.1",
|
|
97
97
|
"@utils/ts-config": "1.0.4",
|
|
98
98
|
"@utils/ts-config-types": "1.0.4",
|
|
99
99
|
"@utils/tsdown-config": "1.0.4",
|
|
100
|
-
"rimraf": "6.1.
|
|
101
|
-
"tsdown": "0.16.
|
|
100
|
+
"rimraf": "6.1.2",
|
|
101
|
+
"tsdown": "0.16.6",
|
|
102
102
|
"typescript": "5.9.3",
|
|
103
|
-
"vitest": "4.0.
|
|
103
|
+
"vitest": "4.0.12"
|
|
104
104
|
},
|
|
105
105
|
"peerDependencies": {
|
|
106
106
|
"preact": ">=8.0.0"
|