solid-intlayer 6.1.6 → 7.0.0-canary.3

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.
Files changed (116) hide show
  1. package/dist/cjs/client/IntlayerProvider.cjs +1 -1
  2. package/dist/cjs/client/getBrowserLocale.cjs +1 -1
  3. package/dist/cjs/client/index.cjs +1 -1
  4. package/dist/cjs/client/useDictionaryAsync.cjs +1 -1
  5. package/dist/cjs/client/useDictionaryDynamic.cjs +1 -1
  6. package/dist/cjs/client/useLocale.cjs +1 -1
  7. package/dist/cjs/client/useLocaleStorage.cjs +1 -0
  8. package/dist/cjs/client/useTraduction.cjs +1 -1
  9. package/dist/cjs/editor/ContentSelectorWrapper.cjs +1 -1
  10. package/dist/cjs/editor/contexts/CommunicatorContext.cjs +1 -1
  11. package/dist/cjs/editor/contexts/EditedContentContext.cjs +1 -1
  12. package/dist/cjs/editor/contexts/useCrossFrameMessageListener.cjs +1 -1
  13. package/dist/cjs/index.cjs +1 -1
  14. package/dist/cjs/plugins.cjs +1 -1
  15. package/dist/cjs/solidElement/renderSolidElement.cjs +1 -1
  16. package/dist/esm/client/IntlayerProvider.mjs +9 -9
  17. package/dist/esm/client/getBrowserLocale.mjs +80 -84
  18. package/dist/esm/client/index.mjs +21 -18
  19. package/dist/esm/client/useDictionaryAsync.mjs +1 -1
  20. package/dist/esm/client/useDictionaryDynamic.mjs +2 -2
  21. package/dist/esm/client/useLocale.mjs +19 -13
  22. package/dist/esm/client/useLocaleStorage.mjs +25 -0
  23. package/dist/esm/client/useTraduction.mjs +10 -6
  24. package/dist/esm/editor/ContentSelectorWrapper.mjs +2 -2
  25. package/dist/esm/editor/contexts/CommunicatorContext.mjs +10 -10
  26. package/dist/esm/editor/contexts/EditedContentContext.mjs +92 -83
  27. package/dist/esm/editor/contexts/useCrossFrameMessageListener.mjs +8 -8
  28. package/dist/esm/getDictionary.mjs +1 -5
  29. package/dist/esm/index.mjs +26 -23
  30. package/dist/esm/plugins.mjs +25 -24
  31. package/dist/esm/solidElement/renderSolidElement.mjs +1 -1
  32. package/dist/types/IntlayerNode.d.ts +0 -1
  33. package/dist/types/UI/ContentSelector.d.ts +0 -1
  34. package/dist/types/client/IntlayerProvider.d.ts +3 -2
  35. package/dist/types/client/getBrowserLocale.d.ts +16 -12
  36. package/dist/types/client/index.d.ts +2 -3
  37. package/dist/types/client/t.d.ts +2 -4
  38. package/dist/types/client/useContent.d.ts +4 -5
  39. package/dist/types/client/useDictionary.d.ts +4 -4
  40. package/dist/types/client/useDictionaryAsync.d.ts +2 -4
  41. package/dist/types/client/useDictionaryDynamic.d.ts +2 -4
  42. package/dist/types/client/useIntlayer.d.ts +3 -5
  43. package/dist/types/client/useLoadDynamic.d.ts +0 -1
  44. package/dist/types/client/useLocale.d.ts +9 -8
  45. package/dist/types/client/useLocaleBase.d.ts +9 -7
  46. package/dist/types/client/useLocaleStorage.d.ts +39 -0
  47. package/dist/types/client/useTraduction.d.ts +2 -3
  48. package/dist/types/editor/ContentSelectorWrapper.d.ts +0 -1
  49. package/dist/types/editor/IntlayerEditorProvider.d.ts +0 -1
  50. package/dist/types/editor/contexts/CommunicatorContext.d.ts +0 -1
  51. package/dist/types/editor/contexts/ConfigurationContext.d.ts +1 -2
  52. package/dist/types/editor/contexts/DictionariesRecordContext.d.ts +1 -2
  53. package/dist/types/editor/contexts/EditedContentContext.d.ts +3 -4
  54. package/dist/types/editor/contexts/EditorEnabledContext.d.ts +0 -1
  55. package/dist/types/editor/contexts/EditorProvider.d.ts +0 -1
  56. package/dist/types/editor/contexts/FocusDictionaryContext.d.ts +1 -2
  57. package/dist/types/editor/contexts/index.d.ts +0 -1
  58. package/dist/types/editor/contexts/useCrossFrameMessageListener.d.ts +1 -2
  59. package/dist/types/editor/contexts/useCrossFrameState.d.ts +0 -1
  60. package/dist/types/editor/contexts/useCrossURLPathState.d.ts +0 -1
  61. package/dist/types/editor/contexts/useIframeClickInterceptor.d.ts +0 -1
  62. package/dist/types/editor/index.d.ts +0 -1
  63. package/dist/types/editor/useEditedContentRenderer.d.ts +2 -4
  64. package/dist/types/getDictionary.d.ts +3 -4
  65. package/dist/types/getIntlayer.d.ts +3 -4
  66. package/dist/types/index.d.ts +3 -4
  67. package/dist/types/markdown/MarkdownProvider.d.ts +1 -2
  68. package/dist/types/markdown/MarkdownRenderer.d.ts +1 -3
  69. package/dist/types/markdown/index.d.ts +0 -1
  70. package/dist/types/plugins.d.ts +3 -3
  71. package/dist/types/solidElement/renderSolidElement.d.ts +0 -1
  72. package/package.json +44 -46
  73. package/LICENSE +0 -202
  74. package/dist/cjs/client/useLocaleCookie.cjs +0 -1
  75. package/dist/esm/client/useLocaleCookie.mjs +0 -19
  76. package/dist/types/IntlayerNode.d.ts.map +0 -1
  77. package/dist/types/UI/ContentSelector.d.ts.map +0 -1
  78. package/dist/types/client/IntlayerProvider.d.ts.map +0 -1
  79. package/dist/types/client/getBrowserLocale.d.ts.map +0 -1
  80. package/dist/types/client/index.d.ts.map +0 -1
  81. package/dist/types/client/t.d.ts.map +0 -1
  82. package/dist/types/client/useContent.d.ts.map +0 -1
  83. package/dist/types/client/useDictionary.d.ts.map +0 -1
  84. package/dist/types/client/useDictionaryAsync.d.ts.map +0 -1
  85. package/dist/types/client/useDictionaryDynamic.d.ts.map +0 -1
  86. package/dist/types/client/useIntlayer.d.ts.map +0 -1
  87. package/dist/types/client/useLoadDynamic.d.ts.map +0 -1
  88. package/dist/types/client/useLocale.d.ts.map +0 -1
  89. package/dist/types/client/useLocaleBase.d.ts.map +0 -1
  90. package/dist/types/client/useLocaleCookie.d.ts +0 -17
  91. package/dist/types/client/useLocaleCookie.d.ts.map +0 -1
  92. package/dist/types/client/useTraduction.d.ts.map +0 -1
  93. package/dist/types/editor/ContentSelectorWrapper.d.ts.map +0 -1
  94. package/dist/types/editor/IntlayerEditorProvider.d.ts.map +0 -1
  95. package/dist/types/editor/contexts/CommunicatorContext.d.ts.map +0 -1
  96. package/dist/types/editor/contexts/ConfigurationContext.d.ts.map +0 -1
  97. package/dist/types/editor/contexts/DictionariesRecordContext.d.ts.map +0 -1
  98. package/dist/types/editor/contexts/EditedContentContext.d.ts.map +0 -1
  99. package/dist/types/editor/contexts/EditorEnabledContext.d.ts.map +0 -1
  100. package/dist/types/editor/contexts/EditorProvider.d.ts.map +0 -1
  101. package/dist/types/editor/contexts/FocusDictionaryContext.d.ts.map +0 -1
  102. package/dist/types/editor/contexts/index.d.ts.map +0 -1
  103. package/dist/types/editor/contexts/useCrossFrameMessageListener.d.ts.map +0 -1
  104. package/dist/types/editor/contexts/useCrossFrameState.d.ts.map +0 -1
  105. package/dist/types/editor/contexts/useCrossURLPathState.d.ts.map +0 -1
  106. package/dist/types/editor/contexts/useIframeClickInterceptor.d.ts.map +0 -1
  107. package/dist/types/editor/index.d.ts.map +0 -1
  108. package/dist/types/editor/useEditedContentRenderer.d.ts.map +0 -1
  109. package/dist/types/getDictionary.d.ts.map +0 -1
  110. package/dist/types/getIntlayer.d.ts.map +0 -1
  111. package/dist/types/index.d.ts.map +0 -1
  112. package/dist/types/markdown/MarkdownProvider.d.ts.map +0 -1
  113. package/dist/types/markdown/MarkdownRenderer.d.ts.map +0 -1
  114. package/dist/types/markdown/index.d.ts.map +0 -1
  115. package/dist/types/plugins.d.ts.map +0 -1
  116. package/dist/types/solidElement/renderSolidElement.d.ts.map +0 -1
@@ -1,9 +1,7 @@
1
- import { LocalesValues } from '@intlayer/config/client';
2
- import { Dictionary, DictionaryKeys, LanguageContent } from '@intlayer/core';
1
+ import { Dictionary, DictionaryKeys, LocalesValues, StrictModeLocaleMap } from '@intlayer/types';
3
2
  /**
4
3
  * On the server side, Hook that transform a dictionary and return the content
5
4
  *
6
5
  * If the locale is not provided, it will use the locale from the client context
7
6
  */
8
- export declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: LanguageContent<() => Promise<T>>, key: K, locale?: LocalesValues) => import('solid-js').Accessor<import('@intlayer/core').DeepTransformContent<T["content"], import('../plugins').IInterpreterPluginState>>;
9
- //# sourceMappingURL=useDictionaryDynamic.d.ts.map
7
+ export declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K, locale?: LocalesValues) => import('solid-js').Accessor<import('@intlayer/core').DeepTransformContent<T["content"], import('../plugins').IInterpreterPluginState, (string & {}) | "af" | "af-ZA" | "ar" | "ar-AE" | "ar-BH" | "ar-DZ" | "ar-EG" | "ar-IQ" | "ar-JO" | "ar-KW" | "ar-LB" | "ar-LY" | "ar-MA" | "ar-OM" | "ar-QA" | "ar-SA" | "ar-SY" | "ar-TN" | "ar-YE" | "az" | "az-AZ" | "be" | "be-BY" | "bg" | "bg-BG" | "bs" | "bs-BA" | "ca" | "ca-ES" | "cs" | "cs-CZ" | "cy" | "cy-GB" | "da" | "da-DK" | "de" | "de-AT" | "de-CH" | "de-DE" | "de-LI" | "de-LU" | "dv" | "dv-MV" | "el" | "el-GR" | "en" | "en-AU" | "en-BZ" | "en-CA" | "en-CB" | "en-GB" | "en-IE" | "en-JM" | "en-NZ" | "en-PH" | "en-TT" | "en-US" | "en-ZA" | "en-ZW" | "eo" | "es" | "es-AR" | "es-BO" | "es-CL" | "es-CO" | "es-CR" | "es-DO" | "es-EC" | "es-ES" | "es-GT" | "es-HN" | "es-MX" | "es-NI" | "es-PA" | "es-PE" | "es-PR" | "es-PY" | "es-SV" | "es-UY" | "es-VE" | "et" | "et-EE" | "eu" | "eu-ES" | "fa" | "fa-IR" | "fi" | "fi-FI" | "fo" | "fo-FO" | "fr" | "fr-BE" | "fr-CA" | "fr-CH" | "fr-FR" | "fr-LU" | "fr-MC" | "gl" | "gl-ES" | "gu" | "gu-IN" | "he" | "he-IL" | "hi" | "hi-IN" | "hr" | "hr-BA" | "hr-HR" | "hu" | "hu-HU" | "hy" | "hy-AM" | "id" | "id-ID" | "is" | "is-IS" | "it" | "it-CH" | "it-IT" | "ja" | "ja-JP" | "ka" | "ka-GE" | "kk" | "kk-KZ" | "kn" | "kn-IN" | "ko" | "ko-KR" | "kok" | "kok-IN" | "ky" | "ky-KG" | "lt" | "lt-LT" | "lv" | "lv-LV" | "mi" | "mi-NZ" | "mk" | "mk-MK" | "mn" | "mn-MN" | "mr" | "mr-IN" | "ms" | "ms-BN" | "ms-MY" | "mt" | "mt-MT" | "nb" | "nb-NO" | "nl" | "nl-BE" | "nl-NL" | "nn-NO" | "ns" | "ns-ZA" | "pa" | "pa-IN" | "pl" | "pl-PL" | "ps" | "ps-AR" | "pt" | "pt-BR" | "pt-PT" | "qu" | "qu-BO" | "qu-EC" | "qu-PE" | "ro" | "ro-RO" | "ru" | "ru-RU" | "sa" | "sa-IN" | "se" | "se-FI" | "se-NO" | "se-SE" | "sk" | "sk-SK" | "sl" | "sl-SI" | "sq" | "sq-AL" | "sr" | "sr-BA" | "sr-SP" | "sv" | "sv-FI" | "sv-SE" | "sw" | "sw-KE" | "syr" | "syr-SY" | "ta" | "ta-IN" | "te" | "te-IN" | "th" | "th-TH" | "tl" | "tl-PH" | "tn" | "tn-ZA" | "tr" | "tr-TR" | "tt" | "tt-RU" | "ts" | "uk" | "uk-UA" | "ur" | "ur-PK" | "uz" | "uz-UZ" | "vi" | "vi-VN" | "xh" | "xh-ZA" | "zh" | "zh-Hans" | "zh-CN" | "zh-HK" | "zh-MO" | "zh-SG" | "zh-Hant" | "zu" | "zu-ZA" | "bn" | "bn-BD" | "bn-IN" | "bn-MM" | "my" | "my-MM" | "km" | "km-KH" | "lo" | "lo-LA" | "yo" | "yo-NG" | "am" | "am-ET" | "ne" | "ne-NP" | "si" | "si-LK" | "sr-Cyrl" | "sr-RS" | "en-IN" | "en-SG" | "en-HK" | "en-NG" | "en-PK" | "en-MY" | "en-BW" | "en-KE" | "en-TZ" | "en-GH" | "en-UG" | "es-CU" | "es-US" | "pt-GW" | "pt-MZ" | "pt-ST" | "pt-CV" | "pt-TL" | "pt-MO" | "zh-TW" | "ar-MR" | "ar-PS" | "ar-SD" | "ar-DJ" | "ar-SO" | "ar-TD" | "ar-KM">>;
@@ -1,11 +1,9 @@
1
- import { LocalesValues } from '@intlayer/config/client';
2
- import { DictionaryKeys } from '@intlayer/core';
3
- import { IntlayerDictionaryTypesConnector } from 'intlayer';
1
+ import { DeclaredLocales, DictionaryKeys, DictionaryRegistryContent, LocalesValues } from '@intlayer/types';
2
+ import { Accessor } from 'solid-js';
4
3
  import { DeepTransformContent } from '../plugins';
5
4
  /**
6
5
  * On the client side, Hook that picking one dictionary by its key and return the content
7
6
  *
8
7
  * If the locale is not provided, it will use the locale from the client context
9
8
  */
10
- export declare const useIntlayer: <T extends DictionaryKeys>(key: T, locale?: LocalesValues) => (() => DeepTransformContent<IntlayerDictionaryTypesConnector[T]["content"]>);
11
- //# sourceMappingURL=useIntlayer.d.ts.map
9
+ export declare const useIntlayer: <T extends DictionaryKeys, L extends LocalesValues = DeclaredLocales>(key: T, locale?: L) => Accessor<DeepTransformContent<DictionaryRegistryContent<T>, L>>;
@@ -1,2 +1 @@
1
1
  export declare const useLoadDynamic: <T>(key: string, promise: Promise<T>) => T;
2
- //# sourceMappingURL=useLoadDynamic.d.ts.map
@@ -1,15 +1,16 @@
1
- import { LocalesValues } from '@intlayer/config/client';
1
+ import { DeclaredLocales, LocalesValues } from '@intlayer/types';
2
2
  type useLocaleProps = {
3
+ isCookieEnabled?: boolean;
3
4
  onLocaleChange?: (locale: LocalesValues) => void;
4
5
  };
6
+ type UseLocaleResult = {
7
+ locale: DeclaredLocales;
8
+ defaultLocale: DeclaredLocales;
9
+ availableLocales: DeclaredLocales[];
10
+ setLocale: (locale: LocalesValues) => void;
11
+ };
5
12
  /**
6
13
  * On the client side, hook to get the current locale and all related fields
7
14
  */
8
- export declare const useLocale: ({ onLocaleChange }?: useLocaleProps) => {
9
- locale: () => LocalesValues;
10
- defaultLocale: import('intlayer').Locales;
11
- availableLocales: import('intlayer').Locales[];
12
- setLocale: (locale: LocalesValues) => void;
13
- };
15
+ export declare const useLocale: ({ isCookieEnabled, onLocaleChange, }?: useLocaleProps) => UseLocaleResult;
14
16
  export {};
15
- //# sourceMappingURL=useLocale.d.ts.map
@@ -1,10 +1,12 @@
1
+ import { DeclaredLocales, LocalesValues } from '@intlayer/types';
2
+ type UseLocaleBaseResult = {
3
+ locale: DeclaredLocales;
4
+ defaultLocale: DeclaredLocales;
5
+ availableLocales: DeclaredLocales[];
6
+ setLocale: (locale: LocalesValues) => void;
7
+ };
1
8
  /**
2
9
  * On the client side, hook to get the current locale and all related fields
3
10
  */
4
- export declare const useLocaleBase: () => {
5
- locale: () => import('intlayer').LocalesValues;
6
- defaultLocale: import('intlayer').Locales;
7
- availableLocales: import('intlayer').Locales[];
8
- setLocale: (newLocale: import('intlayer').LocalesValues) => void;
9
- };
10
- //# sourceMappingURL=useLocaleBase.d.ts.map
11
+ export declare const useLocaleBase: () => UseLocaleBaseResult;
12
+ export {};
@@ -0,0 +1,39 @@
1
+ import { LocalesValues } from '@intlayer/types';
2
+ /**
3
+ * Get the locale cookie
4
+ */
5
+ export declare const localeInStorage: import('intlayer').Locale | undefined;
6
+ /**
7
+ * @deprecated Use localeInStorage instead
8
+ *
9
+ * Get the locale cookie
10
+ */
11
+ export declare const localeCookie: import('intlayer').Locale | undefined;
12
+ /**
13
+ * Set the locale cookie
14
+ */
15
+ export declare const setLocaleInStorage: (locale: LocalesValues, isCookieEnabled?: boolean) => void;
16
+ /**
17
+ * @deprecated Use setLocaleInStorage instead
18
+ *
19
+ * Set the locale cookie
20
+ */
21
+ export declare const setLocaleCookie: (locale: LocalesValues, isCookieEnabled?: boolean) => void;
22
+ /**
23
+ * Hook that provides the locale storage and a function to set it
24
+ */
25
+ export declare const useLocaleStorage: (isCookieEnabled?: boolean) => import('solid-js').Accessor<{
26
+ getLocale: () => import('intlayer').Locale;
27
+ setLocale: (locale: LocalesValues) => void;
28
+ }>;
29
+ /**
30
+ * @deprecated Use useLocaleStorage instead
31
+ *
32
+ * For GDPR compliance, use useLocaleStorage instead
33
+ *
34
+ * Hook that provides the locale cookie and a function to set it
35
+ */
36
+ export declare const useLocaleCookie: (isCookieEnabled?: boolean) => {
37
+ localeCookie: import('intlayer').Locale;
38
+ setLocaleCookie: (locale: LocalesValues) => void;
39
+ };
@@ -1,4 +1,4 @@
1
- import { LanguageContent } from '@intlayer/core';
1
+ import { StrictModeLocaleMap } from '@intlayer/types';
2
2
  /**
3
3
  * On the client side, Hook that picking one dictionary by its id and return the content.
4
4
  *
@@ -20,5 +20,4 @@ import { LanguageContent } from '@intlayer/core';
20
20
  * - this function will require each locale to be defined if defined in the project configuration.
21
21
  * - If a locale is missing, it will make each existing locale optional and raise an error if the locale is not found.
22
22
  */
23
- export declare const useTranslation: <Content = string>(languageContent: LanguageContent<Content>) => Content;
24
- //# sourceMappingURL=useTraduction.d.ts.map
23
+ export declare const useTranslation: <Content = string>(languageContent: StrictModeLocaleMap<Content>) => Content;
@@ -4,4 +4,3 @@ export type ContentSelectorWrapperProps = NodeProps & Omit<JSX.HTMLAttributes<HT
4
4
  children?: JSX.Element;
5
5
  };
6
6
  export declare const ContentSelectorRenderer: Component<ContentSelectorWrapperProps>;
7
- //# sourceMappingURL=ContentSelectorWrapper.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import { Component, ParentProps } from 'solid-js';
2
2
  export declare const IntlayerEditorProvider: Component<ParentProps>;
3
- //# sourceMappingURL=IntlayerEditorProvider.d.ts.map
@@ -7,4 +7,3 @@ export type UseCrossPlatformStateProps = {
7
7
  export type CommunicatorProviderProps = ParentProps<Omit<UseCrossPlatformStateProps, 'senderId'>>;
8
8
  export declare const CommunicatorProvider: Component<CommunicatorProviderProps>;
9
9
  export declare const useCommunicator: () => UseCrossPlatformStateProps;
10
- //# sourceMappingURL=CommunicatorContext.d.ts.map
@@ -1,4 +1,4 @@
1
- import { IntlayerConfig } from '@intlayer/config/client';
1
+ import { IntlayerConfig } from '@intlayer/types';
2
2
  import { Component, ParentProps } from 'solid-js';
3
3
  export declare const useConfigurationState: () => [import('solid-js').Accessor<IntlayerConfig>, (value: IntlayerConfig | ((prev: IntlayerConfig) => IntlayerConfig)) => void, () => void];
4
4
  export type ConfigurationProviderProps = ParentProps<{
@@ -6,4 +6,3 @@ export type ConfigurationProviderProps = ParentProps<{
6
6
  }>;
7
7
  export declare const ConfigurationProvider: Component<ConfigurationProviderProps>;
8
8
  export declare const useConfiguration: () => IntlayerConfig | undefined;
9
- //# sourceMappingURL=ConfigurationContext.d.ts.map
@@ -1,4 +1,4 @@
1
- import { Dictionary } from '@intlayer/core';
1
+ import { Dictionary } from '@intlayer/types';
2
2
  import { Component, ParentProps, Setter } from 'solid-js';
3
3
  export type DictionaryContent = Record<Dictionary['key'], Dictionary>;
4
4
  type DictionariesRecordActionsContextType = {
@@ -13,4 +13,3 @@ export declare const useDictionariesRecord: () => {
13
13
  localeDictionaries: DictionaryContent;
14
14
  };
15
15
  export {};
16
- //# sourceMappingURL=DictionariesRecordContext.d.ts.map
@@ -1,4 +1,4 @@
1
- import { ContentNode, Dictionary, KeyPath } from '@intlayer/core';
1
+ import { ContentNode, Dictionary, KeyPath, LocalDictionaryId } from '@intlayer/types';
2
2
  import { Component, ParentProps } from 'solid-js';
3
3
  export declare const usePostEditedContentState: <S>(onEventTriggered?: (data: S) => void) => (data?: S | undefined) => void;
4
4
  export declare const useGetEditedContentState: <S>(onEventTriggered?: (data: S) => void) => (data?: S | undefined) => void;
@@ -12,7 +12,7 @@ type EditedContentActionsContextType = {
12
12
  restoreEditedContent: (dictionaryKey: Dictionary['key']) => void;
13
13
  clearEditedDictionaryContent: (dictionaryKey: Dictionary['key']) => void;
14
14
  clearEditedContent: () => void;
15
- getEditedContentValue: (dictionaryKey: Dictionary['key'], keyPath: KeyPath[]) => ContentNode | undefined;
15
+ getEditedContentValue: (localDictionaryIdOrKey: LocalDictionaryId | Dictionary['key'] | string, keyPath: KeyPath[]) => ContentNode | undefined;
16
16
  };
17
17
  export declare const EditedContentProvider: Component<ParentProps>;
18
18
  export declare const useEditedContentActions: () => EditedContentActionsContextType | undefined;
@@ -26,8 +26,7 @@ export declare const useEditedContent: () => {
26
26
  restoreEditedContent?: ((dictionaryKey: Dictionary["key"]) => void) | undefined;
27
27
  clearEditedDictionaryContent?: ((dictionaryKey: Dictionary["key"]) => void) | undefined;
28
28
  clearEditedContent?: (() => void) | undefined;
29
- getEditedContentValue?: ((dictionaryKey: Dictionary["key"], keyPath: KeyPath[]) => ContentNode | undefined) | undefined;
29
+ getEditedContentValue?: ((localDictionaryIdOrKey: LocalDictionaryId | Dictionary["key"] | string, keyPath: KeyPath[]) => ContentNode | undefined) | undefined;
30
30
  editedContent: Record<Dictionary["key"], Dictionary> | undefined;
31
31
  };
32
32
  export {};
33
- //# sourceMappingURL=EditedContentContext.d.ts.map
@@ -8,4 +8,3 @@ export declare const usePostEditorEnabledState: <S>(onEventTriggered?: (data: S)
8
8
  export declare const useGetEditorEnabledState: <S>(onEventTriggered?: (data: S) => void) => (data?: S | undefined) => void;
9
9
  export declare const EditorEnabledProvider: Component<ParentProps>;
10
10
  export declare const useEditorEnabled: () => EditorEnabledStateProps;
11
- //# sourceMappingURL=EditorEnabledContext.d.ts.map
@@ -3,4 +3,3 @@ import { CommunicatorProviderProps } from './CommunicatorContext';
3
3
  import { ConfigurationProviderProps } from './ConfigurationContext';
4
4
  export type EditorProviderProps = CommunicatorProviderProps & ConfigurationProviderProps;
5
5
  export declare const EditorProvider: Component<ParentProps<EditorProviderProps>>;
6
- //# sourceMappingURL=EditorProvider.d.ts.map
@@ -1,4 +1,4 @@
1
- import { KeyPath } from '@intlayer/core';
1
+ import { KeyPath } from '@intlayer/types';
2
2
  import { Component, ParentProps, Setter } from 'solid-js';
3
3
  type DictionaryPath = string;
4
4
  export type FileContent = {
@@ -18,4 +18,3 @@ export declare const useFocusDictionary: () => {
18
18
  focusedContent: FileContent | null;
19
19
  };
20
20
  export {};
21
- //# sourceMappingURL=FocusDictionaryContext.d.ts.map
@@ -9,4 +9,3 @@ export * from './useCrossFrameMessageListener';
9
9
  export * from './useCrossFrameState';
10
10
  export * from './useCrossURLPathState';
11
11
  export * from './useIframeClickInterceptor';
12
- //# sourceMappingURL=index.d.ts.map
@@ -15,5 +15,4 @@ import { MessageKey } from '@intlayer/editor';
15
15
  * @returns {{ postMessage: (data: S) => void }} An object containing a `postMessage` function
16
16
  * that allows broadcasting messages with the specified key and data.
17
17
  */
18
- export declare const useCrossFrameMessageListener: <S>(key: `${MessageKey}` | `${MessageKey}/post` | `${MessageKey}/get`, onEventTriggered?: (data: S) => void, revalidator?: any) => (data?: S) => void;
19
- //# sourceMappingURL=useCrossFrameMessageListener.d.ts.map
18
+ export declare const useCrossFrameMessageListener: <S>(key: `${MessageKey}` | `${MessageKey}/post` | `${MessageKey}/get`, onEventTriggered?: (data: S) => void) => (data?: S) => void;
@@ -26,4 +26,3 @@ export type CrossFrameStateOptions = {
26
26
  * @returns {[Accessor<S>, (value: S | ((prev: S) => S)) => void, () => void]} An array containing the current state accessor, setter function, and post function.
27
27
  */
28
28
  export declare const useCrossFrameState: <S>(key: `${MessageKey}`, initialState?: S | (() => S), options?: CrossFrameStateOptions) => [Accessor<S>, (value: S | ((prev: S) => S)) => void, () => void];
29
- //# sourceMappingURL=useCrossFrameState.d.ts.map
@@ -1,4 +1,3 @@
1
1
  import { CrossFrameStateOptions } from './useCrossFrameState';
2
2
  export declare const useCrossURLPathState: (initialState?: string, options?: CrossFrameStateOptions) => [import('solid-js').Accessor<string>, (value: string | ((prev: string) => string)) => void, () => void];
3
3
  export declare const useCrossURLPathSetter: (initialState?: string) => [import('solid-js').Accessor<string>, (value: string | ((prev: string) => string)) => void, () => void];
4
- //# sourceMappingURL=useCrossURLPathState.d.ts.map
@@ -6,4 +6,3 @@
6
6
  */
7
7
  export declare const useIframeClickInterceptor: () => void;
8
8
  export declare const useIframeClickMerger: () => (data?: MessageEvent<any> | undefined) => void;
9
- //# sourceMappingURL=useIframeClickInterceptor.d.ts.map
@@ -1,2 +1 @@
1
1
  export * from './ContentSelectorWrapper';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,13 +1,11 @@
1
- import { Locales } from '@intlayer/config/client';
2
- import { KeyPath } from '@intlayer/core';
1
+ import { KeyPath, Locale } from '@intlayer/types';
3
2
  import { Component } from 'solid-js';
4
3
  type EditedContentRendererProps = {
5
4
  dictionaryKey: string;
6
5
  keyPath: KeyPath[];
7
6
  children: string;
8
- locale?: Locales;
7
+ locale?: Locale;
9
8
  };
10
9
  export declare const useEditedContentRenderer: ({ dictionaryKey, keyPath, children, }: EditedContentRendererProps) => string;
11
10
  export declare const EditedContentRenderer: Component<EditedContentRendererProps>;
12
11
  export {};
13
- //# sourceMappingURL=useEditedContentRenderer.d.ts.map
@@ -1,5 +1,4 @@
1
- import { Locales, LocalesValues } from '@intlayer/config/client';
2
- import { Dictionary, Plugins } from '@intlayer/core';
1
+ import { Plugins } from '@intlayer/core';
2
+ import { DeclaredLocales, Dictionary, LocalesValues } from '@intlayer/types';
3
3
  import { DeepTransformContent } from './plugins';
4
- export declare const getDictionary: <T extends Dictionary, L extends LocalesValues = Locales>(dictionary: T, locale?: L, additionalPlugins?: Plugins[]) => DeepTransformContent<T["content"]>;
5
- //# sourceMappingURL=getDictionary.d.ts.map
4
+ export declare const getDictionary: <T extends Dictionary, L extends LocalesValues = DeclaredLocales>(dictionary: T, locale?: L, additionalPlugins?: Plugins[]) => DeepTransformContent<T["content"], L>;
@@ -1,5 +1,4 @@
1
- import { DictionaryKeys, Plugins } from '@intlayer/core';
2
- import { IntlayerDictionaryTypesConnector, LocalesValues } from 'intlayer';
1
+ import { Plugins } from '@intlayer/core';
2
+ import { DeclaredLocales, DictionaryKeys, DictionaryRegistryContent, LocalesValues } from '@intlayer/types';
3
3
  import { DeepTransformContent } from './plugins';
4
- export declare const getIntlayer: <T extends DictionaryKeys, L extends LocalesValues>(key: T, locale?: L, additionalPlugins?: Plugins[]) => DeepTransformContent<IntlayerDictionaryTypesConnector[T]["content"]>;
5
- //# sourceMappingURL=getIntlayer.d.ts.map
4
+ export declare const getIntlayer: <T extends DictionaryKeys, L extends LocalesValues = DeclaredLocales>(key: T, locale?: L, additionalPlugins?: Plugins[]) => DeepTransformContent<DictionaryRegistryContent<T>, L>;
@@ -1,9 +1,8 @@
1
1
  import { IInterpreterPluginSolid } from './plugins';
2
2
  declare module '@intlayer/core' {
3
- interface IInterpreterPlugin<T, S> extends IInterpreterPluginSolid<T> {
3
+ interface IInterpreterPlugin<T, S, L> extends IInterpreterPluginSolid<T> {
4
4
  }
5
5
  }
6
- export { getBrowserLocale, IntlayerClientContext, IntlayerProvider, IntlayerProviderContent, localeCookie, setLocaleCookie, t, useDictionary, useDictionaryAsync, useDictionaryDynamic, useIntlayer, useIntlayerContext, useLoadDynamic, useLocale, useLocaleBase, useLocaleCookie, type IntlayerProviderProps, } from './client/index';
7
- export { type IntlayerNode } from './IntlayerNode';
6
+ export { getBrowserLocale, IntlayerClientContext, IntlayerProvider, IntlayerProviderContent, type IntlayerProviderProps, localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage, t, useDictionary, useDictionaryAsync, useDictionaryDynamic, useIntlayer, useIntlayerContext, useLoadDynamic, useLocale, useLocaleBase, useLocaleCookie, useLocaleStorage, } from './client/index';
7
+ export type { IntlayerNode } from './IntlayerNode';
8
8
  export { MarkdownProvider } from './markdown/index';
9
- //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import { JSXElement, Component, ParentProps } from 'solid-js';
1
+ import { Component, JSXElement, ParentProps } from 'solid-js';
2
2
  type MarkdownProviderValue = {
3
3
  renderMarkdown: (content: string) => JSXElement;
4
4
  };
@@ -9,4 +9,3 @@ export type MarkdownProviderProps = ParentProps<{
9
9
  export declare const MarkdownProvider: Component<MarkdownProviderProps>;
10
10
  export declare const useMarkdown: () => MarkdownProviderValue;
11
11
  export {};
12
- //# sourceMappingURL=MarkdownProvider.d.ts.map
@@ -1,5 +1,4 @@
1
- import { LocalesValues } from '@intlayer/config/client';
2
- import { KeyPath } from '@intlayer/core';
1
+ import { KeyPath, LocalesValues } from '@intlayer/types';
3
2
  import { Component } from 'solid-js';
4
3
  type MarkdownRendererProps = {
5
4
  dictionaryKey: string;
@@ -13,4 +12,3 @@ type MarkdownMetadataRendererProps = MarkdownRendererProps & {
13
12
  };
14
13
  export declare const MarkdownMetadataRenderer: Component<MarkdownMetadataRendererProps>;
15
14
  export {};
16
- //# sourceMappingURL=MarkdownRenderer.d.ts.map
@@ -1,3 +1,2 @@
1
1
  export * from './MarkdownProvider';
2
2
  export * from './MarkdownRenderer';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,5 @@
1
- import { NodeType, DeepTransformContent as DeepTransformContentCore, IInterpreterPluginState as IInterpreterPluginStateCore, Plugins } from '@intlayer/core';
1
+ import { DeepTransformContent as DeepTransformContentCore, IInterpreterPluginState as IInterpreterPluginStateCore, Plugins } from '@intlayer/core';
2
+ import { DeclaredLocales, LocalesValues, NodeType } from '@intlayer/types';
2
3
  import { JSX } from 'solid-js';
3
4
  import { IntlayerNode } from './IntlayerNode';
4
5
  /** ---------------------------------------------
@@ -50,9 +51,8 @@ export type IInterpreterPluginState = IInterpreterPluginStateCore & {
50
51
  intlayerNode: true;
51
52
  markdown: true;
52
53
  };
53
- export type DeepTransformContent<T> = DeepTransformContentCore<T, IInterpreterPluginState>;
54
+ export type DeepTransformContent<T, L extends LocalesValues = DeclaredLocales> = DeepTransformContentCore<T, IInterpreterPluginState, L>;
54
55
  /**
55
56
  * Default enabled state for the plugins. Those are necessary for the rendering on client side.
56
57
  */
57
58
  export declare const interpreterPluginsEnabledState: IInterpreterPluginState;
58
- //# sourceMappingURL=plugins.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import { JSX } from 'solid-js';
2
2
  export declare const renderSolidElement: (element: JSX.Element) => JSX.Element;
3
- //# sourceMappingURL=renderSolidElement.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solid-intlayer",
3
- "version": "6.1.6",
3
+ "version": "7.0.0-canary.3",
4
4
  "private": false,
5
5
  "description": "Easily internationalize i18n your Solid applications with type-safe multilingual content management.",
6
6
  "keywords": [
@@ -55,60 +55,58 @@
55
55
  "./dist",
56
56
  "./package.json"
57
57
  ],
58
+ "scripts": {
59
+ "build": "vite build",
60
+ "build:ci": "vite build",
61
+ "clean": "rimraf ./dist .turbo",
62
+ "dev": "vite build --watch",
63
+ "format": "biome format . --check",
64
+ "format:fix": "biome format --write .",
65
+ "lint": "biome lint .",
66
+ "lint:fix": "biome lint --write .",
67
+ "prepublish": "cp -f ../../README.md ./README.md",
68
+ "test": "vitest run",
69
+ "test:watch": "vitest",
70
+ "typecheck": "tsc --noEmit --project tsconfig.types.json"
71
+ },
58
72
  "dependencies": {
59
- "js-cookie": "^3.0.5",
60
- "@intlayer/editor": "6.1.6",
61
- "@intlayer/core": "6.1.6",
62
- "@intlayer/api": "6.1.6",
63
- "@intlayer/config": "6.1.6"
73
+ "@intlayer/api": "7.0.0-canary.3",
74
+ "@intlayer/config": "7.0.0-canary.3",
75
+ "@intlayer/core": "7.0.0-canary.3",
76
+ "@intlayer/editor": "7.0.0-canary.3",
77
+ "@intlayer/types": "7.0.0-canary.3",
78
+ "js-cookie": "3.0.5"
64
79
  },
65
80
  "devDependencies": {
66
- "@solidjs/testing-library": "^0.8.10",
67
- "@testing-library/jest-dom": "^6.6.3",
68
- "@testing-library/user-event": "^14.6.1",
69
- "@types/js-cookie": "^3.0.6",
70
- "@types/node": "^24.5.2",
71
- "@typescript-eslint/parser": "^8.44.1",
72
- "concurrently": "^9.2.1",
73
- "eslint": "^9.36.0",
74
- "jsdom": "^26.1.0",
75
- "prettier": "^3.6.2",
76
- "rimraf": "^6.0.1",
77
- "typescript": "^5.9.2",
78
- "vite": "^7.1.7",
79
- "vite-plugin-dts": "^4.5.3",
80
- "vite-plugin-solid": "^2.11.6",
81
- "vitest": "^3.2.4",
82
- "@utils/ts-config-types": "1.0.4",
83
- "@utils/tsup-config": "1.0.4",
84
- "@utils/eslint-config": "1.0.4",
85
- "@utils/ts-config": "1.0.4"
81
+ "@solidjs/testing-library": "0.8.10",
82
+ "@testing-library/jest-dom": "6.6.4",
83
+ "@testing-library/user-event": "14.6.1",
84
+ "@types/js-cookie": "3.0.6",
85
+ "@types/node": "24.9.1",
86
+ "@utils/ts-config": "7.0.0-canary.3",
87
+ "@utils/ts-config-types": "7.0.0-canary.3",
88
+ "@utils/tsdown-config": "7.0.0-canary.3",
89
+ "jsdom": "26.1.0",
90
+ "rimraf": "6.0.1",
91
+ "tsdown": "0.15.9",
92
+ "typescript": "5.9.3",
93
+ "vite": "7.1.12",
94
+ "vite-plugin-dts": "4.5.4",
95
+ "vite-plugin-solid": "2.11.6",
96
+ "vitest": "4.0.3"
86
97
  },
87
98
  "peerDependencies": {
88
- "solid-js": "^1.9.5",
89
- "@intlayer/api": "6.1.6",
90
- "@intlayer/core": "6.1.6",
91
- "@intlayer/config": "6.1.6",
92
- "@intlayer/editor": "6.1.6"
99
+ "@intlayer/api": "7.0.0-canary.3",
100
+ "@intlayer/config": "7.0.0-canary.3",
101
+ "@intlayer/core": "7.0.0-canary.3",
102
+ "@intlayer/editor": "7.0.0-canary.3",
103
+ "@intlayer/types": "7.0.0-canary.3",
104
+ "solid-js": ">=1.0.0"
93
105
  },
94
106
  "engines": {
95
107
  "node": ">=14.18"
96
108
  },
97
109
  "bug": {
98
110
  "url": "https://github.com/aymericzip/intlayer/issues"
99
- },
100
- "scripts": {
101
- "build": "pnpm clean & pnpm build:ci",
102
- "build:ci": "vite build",
103
- "clean": "rimraf ./dist",
104
- "dev": "vite build --watch",
105
- "lint": "eslint . --cache",
106
- "lint:fix": "eslint . --cache --fix",
107
- "prettier": "prettier . --check",
108
- "prettier:fix": "prettier . --write",
109
- "prepublish": "cp -f ../../README.md ./README.md",
110
- "test": "vitest run",
111
- "test:watch": "vitest",
112
- "typecheck": "tsup --project ./tsconfig.json --noEmit"
113
111
  }
114
- }
112
+ }