preact-intlayer 5.5.5 → 5.5.7

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 (253) hide show
  1. package/dist/cjs/IntlayerNode.cjs +47 -0
  2. package/dist/cjs/IntlayerNode.cjs.map +1 -0
  3. package/dist/cjs/UI/ContentSelector.cjs +127 -0
  4. package/dist/cjs/UI/ContentSelector.cjs.map +1 -0
  5. package/dist/cjs/client/IntlayerProvider.cjs +98 -0
  6. package/dist/cjs/client/IntlayerProvider.cjs.map +1 -0
  7. package/dist/cjs/client/getBrowserLocale.cjs +173 -0
  8. package/dist/cjs/client/getBrowserLocale.cjs.map +1 -0
  9. package/dist/cjs/client/index.cjs +69 -0
  10. package/dist/cjs/client/index.cjs.map +1 -0
  11. package/dist/cjs/client/t.cjs +37 -0
  12. package/dist/cjs/client/t.cjs.map +1 -0
  13. package/dist/cjs/client/useContent.cjs +39 -0
  14. package/dist/cjs/client/useContent.cjs.map +1 -0
  15. package/dist/cjs/client/useDictionary.cjs +42 -0
  16. package/dist/cjs/client/useDictionary.cjs.map +1 -0
  17. package/dist/cjs/client/useDictionaryDynamic.cjs +42 -0
  18. package/dist/cjs/client/useDictionaryDynamic.cjs.map +1 -0
  19. package/dist/cjs/client/useIntlayer.cjs +43 -0
  20. package/dist/cjs/client/useIntlayer.cjs.map +1 -0
  21. package/dist/cjs/client/useIntlayerAsync.cjs +54 -0
  22. package/dist/cjs/client/useIntlayerAsync.cjs.map +1 -0
  23. package/dist/cjs/client/useLoadDynamic.cjs +56 -0
  24. package/dist/cjs/client/useLoadDynamic.cjs.map +1 -0
  25. package/dist/cjs/client/useLocale.cjs +69 -0
  26. package/dist/cjs/client/useLocale.cjs.map +1 -0
  27. package/dist/cjs/client/useLocaleBase.cjs +56 -0
  28. package/dist/cjs/client/useLocaleBase.cjs.map +1 -0
  29. package/dist/cjs/client/useLocaleCookie.cjs +60 -0
  30. package/dist/cjs/client/useLocaleCookie.cjs.map +1 -0
  31. package/dist/cjs/client/useTraduction.cjs +35 -0
  32. package/dist/cjs/client/useTraduction.cjs.map +1 -0
  33. package/dist/cjs/editor/ChangedContentContext.cjs +77 -0
  34. package/dist/cjs/editor/ChangedContentContext.cjs.map +1 -0
  35. package/dist/cjs/editor/CommunicatorContext.cjs +66 -0
  36. package/dist/cjs/editor/CommunicatorContext.cjs.map +1 -0
  37. package/dist/cjs/editor/ConfigurationContext.cjs +50 -0
  38. package/dist/cjs/editor/ConfigurationContext.cjs.map +1 -0
  39. package/dist/cjs/editor/ContentSelectorWrapper.cjs +66 -0
  40. package/dist/cjs/editor/ContentSelectorWrapper.cjs.map +1 -0
  41. package/dist/cjs/editor/DictionariesRecordContext.cjs +77 -0
  42. package/dist/cjs/editor/DictionariesRecordContext.cjs.map +1 -0
  43. package/dist/cjs/editor/EditedContentContext.cjs +217 -0
  44. package/dist/cjs/editor/EditedContentContext.cjs.map +1 -0
  45. package/dist/cjs/editor/EditorEnabledContext.cjs +62 -0
  46. package/dist/cjs/editor/EditorEnabledContext.cjs.map +1 -0
  47. package/dist/cjs/editor/EditorProvider.cjs +72 -0
  48. package/dist/cjs/editor/EditorProvider.cjs.map +1 -0
  49. package/dist/cjs/editor/FocusDictionaryContext.cjs +81 -0
  50. package/dist/cjs/editor/FocusDictionaryContext.cjs.map +1 -0
  51. package/dist/cjs/editor/IntlayerEditorProvider.cjs +122 -0
  52. package/dist/cjs/editor/IntlayerEditorProvider.cjs.map +1 -0
  53. package/dist/cjs/editor/index.cjs +23 -0
  54. package/dist/cjs/editor/index.cjs.map +1 -0
  55. package/dist/cjs/editor/useCrossFrameMessageListener.cjs +53 -0
  56. package/dist/cjs/editor/useCrossFrameMessageListener.cjs.map +1 -0
  57. package/dist/cjs/editor/useCrossFrameState.cjs +77 -0
  58. package/dist/cjs/editor/useCrossFrameState.cjs.map +1 -0
  59. package/dist/cjs/editor/useCrossURLPathState.cjs +69 -0
  60. package/dist/cjs/editor/useCrossURLPathState.cjs.map +1 -0
  61. package/dist/cjs/editor/useEditedContentRenderer.cjs +63 -0
  62. package/dist/cjs/editor/useEditedContentRenderer.cjs.map +1 -0
  63. package/dist/cjs/editor/useIframeClickInterceptor.cjs +50 -0
  64. package/dist/cjs/editor/useIframeClickInterceptor.cjs.map +1 -0
  65. package/dist/cjs/getDictionary.cjs +43 -0
  66. package/dist/cjs/getDictionary.cjs.map +1 -0
  67. package/dist/cjs/getIntlayer.cjs +39 -0
  68. package/dist/cjs/getIntlayer.cjs.map +1 -0
  69. package/dist/cjs/index.cjs +42 -5
  70. package/dist/cjs/index.cjs.map +1 -1
  71. package/dist/cjs/markdown/MarkdownProvider.cjs +41 -0
  72. package/dist/cjs/markdown/MarkdownProvider.cjs.map +1 -0
  73. package/dist/cjs/markdown/MarkdownRenderer.cjs +83 -0
  74. package/dist/cjs/markdown/MarkdownRenderer.cjs.map +1 -0
  75. package/dist/cjs/markdown/index.cjs +25 -0
  76. package/dist/cjs/markdown/index.cjs.map +1 -0
  77. package/dist/cjs/plugins.cjs +128 -0
  78. package/dist/cjs/plugins.cjs.map +1 -0
  79. package/dist/cjs/preactElement/renderPreactElement.cjs +62 -0
  80. package/dist/cjs/preactElement/renderPreactElement.cjs.map +1 -0
  81. package/dist/esm/IntlayerNode.mjs +27 -0
  82. package/dist/esm/IntlayerNode.mjs.map +1 -0
  83. package/dist/esm/UI/ContentSelector.mjs +103 -0
  84. package/dist/esm/UI/ContentSelector.mjs.map +1 -0
  85. package/dist/esm/client/IntlayerProvider.mjs +63 -0
  86. package/dist/esm/client/IntlayerProvider.mjs.map +1 -0
  87. package/dist/esm/client/getBrowserLocale.mjs +138 -0
  88. package/dist/esm/client/getBrowserLocale.mjs.map +1 -0
  89. package/dist/esm/client/index.mjs +39 -0
  90. package/dist/esm/client/index.mjs.map +1 -0
  91. package/dist/esm/client/t.mjs +13 -0
  92. package/dist/esm/client/t.mjs.map +1 -0
  93. package/dist/esm/client/useContent.mjs +15 -0
  94. package/dist/esm/client/useContent.mjs.map +1 -0
  95. package/dist/esm/client/useDictionary.mjs +18 -0
  96. package/dist/esm/client/useDictionary.mjs.map +1 -0
  97. package/dist/esm/client/useDictionaryDynamic.mjs +18 -0
  98. package/dist/esm/client/useDictionaryDynamic.mjs.map +1 -0
  99. package/dist/esm/client/useIntlayer.mjs +19 -0
  100. package/dist/esm/client/useIntlayer.mjs.map +1 -0
  101. package/dist/esm/client/useIntlayerAsync.mjs +33 -0
  102. package/dist/esm/client/useIntlayerAsync.mjs.map +1 -0
  103. package/dist/esm/client/useLoadDynamic.mjs +32 -0
  104. package/dist/esm/client/useLoadDynamic.mjs.map +1 -0
  105. package/dist/esm/client/useLocale.mjs +35 -0
  106. package/dist/esm/client/useLocale.mjs.map +1 -0
  107. package/dist/esm/client/useLocaleBase.mjs +22 -0
  108. package/dist/esm/client/useLocaleBase.mjs.map +1 -0
  109. package/dist/esm/client/useLocaleCookie.mjs +24 -0
  110. package/dist/esm/client/useLocaleCookie.mjs.map +1 -0
  111. package/dist/esm/client/useTraduction.mjs +11 -0
  112. package/dist/esm/client/useTraduction.mjs.map +1 -0
  113. package/dist/esm/editor/ChangedContentContext.mjs +55 -0
  114. package/dist/esm/editor/ChangedContentContext.mjs.map +1 -0
  115. package/dist/esm/editor/CommunicatorContext.mjs +33 -0
  116. package/dist/esm/editor/CommunicatorContext.mjs.map +1 -0
  117. package/dist/esm/editor/ConfigurationContext.mjs +27 -0
  118. package/dist/esm/editor/ConfigurationContext.mjs.map +1 -0
  119. package/dist/esm/editor/ContentSelectorWrapper.mjs +45 -0
  120. package/dist/esm/editor/ContentSelectorWrapper.mjs.map +1 -0
  121. package/dist/esm/editor/DictionariesRecordContext.mjs +55 -0
  122. package/dist/esm/editor/DictionariesRecordContext.mjs.map +1 -0
  123. package/dist/esm/editor/EditedContentContext.mjs +198 -0
  124. package/dist/esm/editor/EditedContentContext.mjs.map +1 -0
  125. package/dist/esm/editor/EditorEnabledContext.mjs +39 -0
  126. package/dist/esm/editor/EditorEnabledContext.mjs.map +1 -0
  127. package/dist/esm/editor/EditorProvider.mjs +62 -0
  128. package/dist/esm/editor/EditorProvider.mjs.map +1 -0
  129. package/dist/esm/editor/FocusDictionaryContext.mjs +58 -0
  130. package/dist/esm/editor/FocusDictionaryContext.mjs.map +1 -0
  131. package/dist/esm/editor/IntlayerEditorProvider.mjs +88 -0
  132. package/dist/esm/editor/IntlayerEditorProvider.mjs.map +1 -0
  133. package/dist/esm/editor/index.mjs +2 -0
  134. package/dist/esm/editor/index.mjs.map +1 -0
  135. package/dist/esm/editor/useCrossFrameMessageListener.mjs +29 -0
  136. package/dist/esm/editor/useCrossFrameMessageListener.mjs.map +1 -0
  137. package/dist/esm/editor/useCrossFrameState.mjs +53 -0
  138. package/dist/esm/editor/useCrossFrameState.mjs.map +1 -0
  139. package/dist/esm/editor/useCrossURLPathState.mjs +46 -0
  140. package/dist/esm/editor/useCrossURLPathState.mjs.map +1 -0
  141. package/dist/esm/editor/useEditedContentRenderer.mjs +38 -0
  142. package/dist/esm/editor/useEditedContentRenderer.mjs.map +1 -0
  143. package/dist/esm/editor/useIframeClickInterceptor.mjs +25 -0
  144. package/dist/esm/editor/useIframeClickInterceptor.mjs.map +1 -0
  145. package/dist/esm/getDictionary.mjs +25 -0
  146. package/dist/esm/getDictionary.mjs.map +1 -0
  147. package/dist/esm/getIntlayer.mjs +21 -0
  148. package/dist/esm/getIntlayer.mjs.map +1 -0
  149. package/dist/esm/index.mjs +38 -2
  150. package/dist/esm/index.mjs.map +1 -1
  151. package/dist/esm/markdown/MarkdownProvider.mjs +19 -0
  152. package/dist/esm/markdown/MarkdownProvider.mjs.map +1 -0
  153. package/dist/esm/markdown/MarkdownRenderer.mjs +62 -0
  154. package/dist/esm/markdown/MarkdownRenderer.mjs.map +1 -0
  155. package/dist/esm/markdown/index.mjs +3 -0
  156. package/dist/esm/markdown/index.mjs.map +1 -0
  157. package/dist/esm/plugins.mjs +104 -0
  158. package/dist/esm/plugins.mjs.map +1 -0
  159. package/dist/esm/preactElement/renderPreactElement.mjs +38 -0
  160. package/dist/esm/preactElement/renderPreactElement.mjs.map +1 -0
  161. package/dist/types/IntlayerNode.d.ts +15 -0
  162. package/dist/types/IntlayerNode.d.ts.map +1 -0
  163. package/dist/types/UI/ContentSelector.d.ts +10 -0
  164. package/dist/types/UI/ContentSelector.d.ts.map +1 -0
  165. package/dist/types/client/IntlayerProvider.d.ts +29 -0
  166. package/dist/types/client/IntlayerProvider.d.ts.map +1 -0
  167. package/dist/types/client/getBrowserLocale.d.ts +25 -0
  168. package/dist/types/client/getBrowserLocale.d.ts.map +1 -0
  169. package/dist/types/client/index.d.ts +12 -0
  170. package/dist/types/client/index.d.ts.map +1 -0
  171. package/dist/types/client/t.d.ts +9 -0
  172. package/dist/types/client/t.d.ts.map +1 -0
  173. package/dist/types/client/useContent.d.ts +10 -0
  174. package/dist/types/client/useContent.d.ts.map +1 -0
  175. package/dist/types/client/useDictionary.d.ts +9 -0
  176. package/dist/types/client/useDictionary.d.ts.map +1 -0
  177. package/dist/types/client/useDictionaryDynamic.d.ts +9 -0
  178. package/dist/types/client/useDictionaryDynamic.d.ts.map +1 -0
  179. package/dist/types/client/useIntlayer.d.ts +11 -0
  180. package/dist/types/client/useIntlayer.d.ts.map +1 -0
  181. package/dist/types/client/useIntlayerAsync.d.ts +14 -0
  182. package/dist/types/client/useIntlayerAsync.d.ts.map +1 -0
  183. package/dist/types/client/useLoadDynamic.d.ts +2 -0
  184. package/dist/types/client/useLoadDynamic.d.ts.map +1 -0
  185. package/dist/types/client/useLocale.d.ts +15 -0
  186. package/dist/types/client/useLocale.d.ts.map +1 -0
  187. package/dist/types/client/useLocaleBase.d.ts +10 -0
  188. package/dist/types/client/useLocaleBase.d.ts.map +1 -0
  189. package/dist/types/client/useLocaleCookie.d.ts +17 -0
  190. package/dist/types/client/useLocaleCookie.d.ts.map +1 -0
  191. package/dist/types/client/useTraduction.d.ts +24 -0
  192. package/dist/types/client/useTraduction.d.ts.map +1 -0
  193. package/dist/types/editor/ChangedContentContext.d.ts +13 -0
  194. package/dist/types/editor/ChangedContentContext.d.ts.map +1 -0
  195. package/dist/types/editor/CommunicatorContext.d.ts +14 -0
  196. package/dist/types/editor/CommunicatorContext.d.ts.map +1 -0
  197. package/dist/types/editor/ConfigurationContext.d.ts +9 -0
  198. package/dist/types/editor/ConfigurationContext.d.ts.map +1 -0
  199. package/dist/types/editor/ContentSelectorWrapper.d.ts +5 -0
  200. package/dist/types/editor/ContentSelectorWrapper.d.ts.map +1 -0
  201. package/dist/types/editor/DictionariesRecordContext.d.ts +16 -0
  202. package/dist/types/editor/DictionariesRecordContext.d.ts.map +1 -0
  203. package/dist/types/editor/EditedContentContext.d.ts +33 -0
  204. package/dist/types/editor/EditedContentContext.d.ts.map +1 -0
  205. package/dist/types/editor/EditorEnabledContext.d.ts +11 -0
  206. package/dist/types/editor/EditorEnabledContext.d.ts.map +1 -0
  207. package/dist/types/editor/EditorProvider.d.ts +6 -0
  208. package/dist/types/editor/EditorProvider.d.ts.map +1 -0
  209. package/dist/types/editor/FocusDictionaryContext.d.ts +21 -0
  210. package/dist/types/editor/FocusDictionaryContext.d.ts.map +1 -0
  211. package/dist/types/editor/IntlayerEditorProvider.d.ts +5 -0
  212. package/dist/types/editor/IntlayerEditorProvider.d.ts.map +1 -0
  213. package/dist/types/editor/index.d.ts +2 -0
  214. package/dist/types/editor/index.d.ts.map +1 -0
  215. package/dist/types/editor/useCrossFrameMessageListener.d.ts +19 -0
  216. package/dist/types/editor/useCrossFrameMessageListener.d.ts.map +1 -0
  217. package/dist/types/editor/useCrossFrameState.d.ts +30 -0
  218. package/dist/types/editor/useCrossFrameState.d.ts.map +1 -0
  219. package/dist/types/editor/useCrossURLPathState.d.ts +4 -0
  220. package/dist/types/editor/useCrossURLPathState.d.ts.map +1 -0
  221. package/dist/types/editor/useEditedContentRenderer.d.ts +13 -0
  222. package/dist/types/editor/useEditedContentRenderer.d.ts.map +1 -0
  223. package/dist/types/editor/useIframeClickInterceptor.d.ts +3 -0
  224. package/dist/types/editor/useIframeClickInterceptor.d.ts.map +1 -0
  225. package/dist/types/getDictionary.d.ts +5 -0
  226. package/dist/types/getDictionary.d.ts.map +1 -0
  227. package/dist/types/getIntlayer.d.ts +5 -0
  228. package/dist/types/getIntlayer.d.ts.map +1 -0
  229. package/dist/types/index.d.ts +8 -2
  230. package/dist/types/index.d.ts.map +1 -1
  231. package/dist/types/markdown/MarkdownProvider.d.ts +9 -0
  232. package/dist/types/markdown/MarkdownProvider.d.ts.map +1 -0
  233. package/dist/types/markdown/MarkdownRenderer.d.ts +16 -0
  234. package/dist/types/markdown/MarkdownRenderer.d.ts.map +1 -0
  235. package/dist/types/markdown/index.d.ts +3 -0
  236. package/dist/types/markdown/index.d.ts.map +1 -0
  237. package/dist/types/plugins.d.ts +54 -0
  238. package/dist/types/plugins.d.ts.map +1 -0
  239. package/dist/types/preactElement/renderPreactElement.d.ts +5 -0
  240. package/dist/types/preactElement/renderPreactElement.d.ts.map +1 -0
  241. package/package.json +17 -10
  242. package/dist/cjs/intlayerMiddlewarePlugin.cjs +0 -224
  243. package/dist/cjs/intlayerMiddlewarePlugin.cjs.map +0 -1
  244. package/dist/cjs/intlayerPlugin.cjs +0 -76
  245. package/dist/cjs/intlayerPlugin.cjs.map +0 -1
  246. package/dist/esm/intlayerMiddlewarePlugin.mjs +0 -200
  247. package/dist/esm/intlayerMiddlewarePlugin.mjs.map +0 -1
  248. package/dist/esm/intlayerPlugin.mjs +0 -52
  249. package/dist/esm/intlayerPlugin.mjs.map +0 -1
  250. package/dist/types/intlayerMiddlewarePlugin.d.ts +0 -6
  251. package/dist/types/intlayerMiddlewarePlugin.d.ts.map +0 -1
  252. package/dist/types/intlayerPlugin.d.ts +0 -16
  253. package/dist/types/intlayerPlugin.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContentSelectorWrapper.d.ts","sourceRoot":"","sources":["../../../src/editor/ContentSelectorWrapper.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAiB,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EACL,KAAK,EAAE,EACP,KAAK,cAAc,EAGpB,MAAM,eAAe,CAAC;AAMvB,MAAM,MAAM,2BAA2B,GAAG,SAAS,GACjD,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,CAAC;AAkCnD,eAAO,MAAM,uBAAuB,EAAE,EAAE,CAAC,2BAA2B,CAgBnE,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { Dictionary } from '@intlayer/core';
2
+ import { type Dispatch, type FC, type PropsWithChildren, type SetStateAction } from 'preact/compat';
3
+ export type DictionaryContent = Record<Dictionary['key'], Dictionary>;
4
+ type DictionariesRecordActionsContextType = {
5
+ setLocaleDictionaries: Dispatch<SetStateAction<DictionaryContent>>;
6
+ setLocaleDictionary: (dictionary: Dictionary) => void;
7
+ };
8
+ export declare const DictionariesRecordProvider: FC<PropsWithChildren>;
9
+ export declare const useDictionariesRecordActions: () => DictionariesRecordActionsContextType;
10
+ export declare const useDictionariesRecord: () => {
11
+ setLocaleDictionaries: Dispatch<SetStateAction<DictionaryContent>>;
12
+ setLocaleDictionary: (dictionary: Dictionary) => void;
13
+ localeDictionaries: DictionaryContent;
14
+ };
15
+ export {};
16
+ //# sourceMappingURL=DictionariesRecordContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DictionariesRecordContext.d.ts","sourceRoot":"","sources":["../../../src/editor/DictionariesRecordContext.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EAIL,KAAK,QAAQ,EACb,KAAK,EAAE,EACP,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AAGvB,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,CAAC;AAKtE,KAAK,oCAAoC,GAAG;IAC1C,qBAAqB,EAAE,QAAQ,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACnE,mBAAmB,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;CACvD,CAAC;AASF,eAAO,MAAM,0BAA0B,EAAE,EAAE,CAAC,iBAAiB,CAoC5D,CAAC;AAEF,eAAO,MAAM,4BAA4B,4CACK,CAAC;AAE/C,eAAO,MAAM,qBAAqB;2BApDT,QAAQ,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;yBAC7C,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI;wBAJjC,iBAAiB;CAkEtC,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { type ContentNode, type Dictionary, type KeyPath } from '@intlayer/core';
2
+ import { type Dispatch, type FC, type PropsWithChildren, type SetStateAction } from 'preact/compat';
3
+ export declare const usePostEditedContentState: <S>(onEventTriggered?: (data: S) => void) => (data?: S) => void;
4
+ export declare const useGetEditedContentState: <S>(onEventTriggered?: (data: S) => void) => (data?: S) => void;
5
+ type EditedContentActionsContextType = {
6
+ setEditedContentState: (editedContent: Record<Dictionary['key'], Dictionary>) => void;
7
+ setEditedDictionary: Dispatch<SetStateAction<Dictionary>>;
8
+ setEditedContent: (dictionaryKey: Dictionary['key'], newValue: Dictionary['content']) => void;
9
+ addEditedContent: (dictionaryKey: Dictionary['key'], newValue: ContentNode<any>, keyPath?: KeyPath[], overwrite?: boolean) => void;
10
+ renameEditedContent: (dictionaryKey: Dictionary['key'], newKey: KeyPath['key'], keyPath?: KeyPath[]) => void;
11
+ removeEditedContent: (dictionaryKey: Dictionary['key'], keyPath: KeyPath[]) => void;
12
+ restoreEditedContent: (dictionaryKey: Dictionary['key']) => void;
13
+ clearEditedDictionaryContent: (dictionaryKey: Dictionary['key']) => void;
14
+ clearEditedContent: () => void;
15
+ getEditedContentValue: (dictionaryKey: Dictionary['key'], keyPath: KeyPath[]) => ContentNode | undefined;
16
+ };
17
+ export declare const EditedContentProvider: FC<PropsWithChildren>;
18
+ export declare const useEditedContentActions: () => EditedContentActionsContextType;
19
+ export declare const useEditedContent: () => {
20
+ setEditedContentState: (editedContent: Record<Dictionary["key"], Dictionary>) => void;
21
+ setEditedDictionary: Dispatch<SetStateAction<Dictionary>>;
22
+ setEditedContent: (dictionaryKey: Dictionary["key"], newValue: Dictionary["content"]) => void;
23
+ addEditedContent: (dictionaryKey: Dictionary["key"], newValue: ContentNode<any>, keyPath?: KeyPath[], overwrite?: boolean) => void;
24
+ renameEditedContent: (dictionaryKey: Dictionary["key"], newKey: KeyPath["key"], keyPath?: KeyPath[]) => void;
25
+ removeEditedContent: (dictionaryKey: Dictionary["key"], keyPath: KeyPath[]) => void;
26
+ restoreEditedContent: (dictionaryKey: Dictionary["key"]) => void;
27
+ clearEditedDictionaryContent: (dictionaryKey: Dictionary["key"]) => void;
28
+ clearEditedContent: () => void;
29
+ getEditedContentValue: (dictionaryKey: Dictionary["key"], keyPath: KeyPath[]) => ContentNode | undefined;
30
+ editedContent: Record<Dictionary["key"], Dictionary> | undefined;
31
+ };
32
+ export {};
33
+ //# sourceMappingURL=EditedContentContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditedContentContext.d.ts","sourceRoot":"","sources":["../../../src/editor/EditedContentContext.tsx"],"names":[],"mappings":"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"}
@@ -0,0 +1,11 @@
1
+ import { type FC, type PropsWithChildren } from 'preact/compat';
2
+ import { type CrossFrameStateOptions } from './useCrossFrameState';
3
+ export type EditorEnabledStateProps = {
4
+ enabled: boolean;
5
+ };
6
+ export declare const useEditorEnabledState: (options?: CrossFrameStateOptions) => [boolean, import("preact/hooks").Dispatch<import("preact/hooks").StateUpdater<boolean>>, () => void];
7
+ export declare const usePostEditorEnabledState: <S>(onEventTriggered?: (data: S) => void) => (data?: S) => void;
8
+ export declare const useGetEditorEnabledState: <S>(onEventTriggered?: (data: S) => void) => (data?: S) => void;
9
+ export declare const EditorEnabledProvider: FC<PropsWithChildren>;
10
+ export declare const useEditorEnabled: () => EditorEnabledStateProps;
11
+ //# sourceMappingURL=EditorEnabledContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorEnabledContext.d.ts","sourceRoot":"","sources":["../../../src/editor/EditorEnabledContext.tsx"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,EAAE,EACP,KAAK,iBAAiB,EACvB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,sBAAsB,CAAC;AAE9B,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAMF,eAAO,MAAM,qBAAqB,GAAI,UAAU,sBAAsB,yGACE,CAAC;AAEzE,eAAO,MAAM,yBAAyB,GAAI,CAAC,EACzC,mBAAmB,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,uBAKnC,CAAC;AAEJ,eAAO,MAAM,wBAAwB,GAAI,CAAC,EACxC,mBAAmB,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,uBAKnC,CAAC;AAEJ,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,iBAAiB,CAWvD,CAAC;AAEF,eAAO,MAAM,gBAAgB,+BAAyC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { type FC, type PropsWithChildren } from 'preact/compat';
2
+ import { type CommunicatorProviderProps } from './CommunicatorContext';
3
+ import { type ConfigurationProviderProps } from './ConfigurationContext';
4
+ export type EditorProviderProps = CommunicatorProviderProps & ConfigurationProviderProps;
5
+ export declare const EditorProvider: FC<PropsWithChildren<EditorProviderProps>>;
6
+ //# sourceMappingURL=EditorProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorProvider.d.ts","sourceRoot":"","sources":["../../../src/editor/EditorProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,EAAE,EACP,KAAK,iBAAiB,EAIvB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,KAAK,yBAAyB,EAE/B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,0BAA0B,EAEhC,MAAM,wBAAwB,CAAC;AA2EhC,MAAM,MAAM,mBAAmB,GAAG,yBAAyB,GACzD,0BAA0B,CAAC;AAE7B,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAkBrE,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { KeyPath } from '@intlayer/core';
2
+ import { type Dispatch, type FC, type PropsWithChildren, type SetStateAction } from 'preact/compat';
3
+ type DictionaryPath = string;
4
+ export type FileContent = {
5
+ dictionaryKey: string;
6
+ keyPath?: KeyPath[];
7
+ dictionaryPath?: DictionaryPath;
8
+ };
9
+ type FocusDictionaryActions = {
10
+ setFocusedContent: Dispatch<SetStateAction<FileContent | null>>;
11
+ setFocusedContentKeyPath: (keyPath: KeyPath[]) => void;
12
+ };
13
+ export declare const FocusDictionaryProvider: FC<PropsWithChildren>;
14
+ export declare const useFocusDictionaryActions: () => FocusDictionaryActions;
15
+ export declare const useFocusDictionary: () => {
16
+ setFocusedContent: Dispatch<SetStateAction<FileContent | null>>;
17
+ setFocusedContentKeyPath: (keyPath: KeyPath[]) => void;
18
+ focusedContent: FileContent | null;
19
+ };
20
+ export {};
21
+ //# sourceMappingURL=FocusDictionaryContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FocusDictionaryContext.d.ts","sourceRoot":"","sources":["../../../src/editor/FocusDictionaryContext.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,EAAE,EACP,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AAGvB,KAAK,cAAc,GAAG,MAAM,CAAC;AAE7B,MAAM,MAAM,WAAW,GAAG;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IACpB,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC,CAAC;AAMF,KAAK,sBAAsB,GAAG;IAC5B,iBAAiB,EAAE,QAAQ,CAAC,cAAc,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC;IAChE,wBAAwB,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;CACxD,CAAC;AASF,eAAO,MAAM,uBAAuB,EAAE,EAAE,CAAC,iBAAiB,CA2BzD,CAAC;AAEF,eAAO,MAAM,yBAAyB,8BAQrC,CAAC;AAEF,eAAO,MAAM,kBAAkB;uBAlDV,QAAQ,CAAC,cAAc,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;8BACrC,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,IAAI;oBALtC,WAAW,GAAG,IAAI;CAiEnC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { type ComponentChildren, type FunctionComponent } from 'preact';
2
+ export declare const IntlayerEditorProvider: FunctionComponent<{
3
+ children?: ComponentChildren;
4
+ }>;
5
+ //# sourceMappingURL=IntlayerEditorProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IntlayerEditorProvider.d.ts","sourceRoot":"","sources":["../../../src/editor/IntlayerEditorProvider.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAwDxE,eAAO,MAAM,sBAAsB,EAAE,iBAAiB,CAAC;IACrD,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B,CA+CA,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './ContentSelectorWrapper';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/editor/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { type MessageKey } from '@intlayer/editor';
2
+ /**
3
+ * useCrossFrameMessageListener
4
+ *
5
+ * This React hook listens for messages sent via the `postMessage` API and triggers a callback
6
+ * whenever a message of the specified type (`key`) is received. It is useful for synchronizing
7
+ * state or events across different windows, iframes, or contexts.
8
+ *
9
+ * @template S - The type of the data payload in the message.
10
+ * @param key - A unique identifier for the message type to listen for.
11
+ * @param [onEventTriggered] - A callback function triggered when a message
12
+ * @param [revalidator] - A function that re-suscribes the listener. Could be usefull if onEventTriggered depend of some state
13
+ * with the specified key is received. The callback receives the message data as its argument.
14
+ *
15
+ * @returns {{ postMessage: (data: S) => void }} An object containing a `postMessage` function
16
+ * that allows broadcasting messages with the specified key and data.
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCrossFrameMessageListener.d.ts","sourceRoot":"","sources":["../../../src/editor/useCrossFrameMessageListener.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,kBAAkB,CAAC;AAIhE;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,4BAA4B,GAAI,CAAC,EAC5C,KAAK,GAAG,UAAU,EAAE,GAAG,GAAG,UAAU,OAAO,GAAG,GAAG,UAAU,MAAM,EACjE,mBAAmB,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,EACpC,cAAc,GAAG,aAoDiB,CAAC,KAAK,IAKzC,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { type MessageKey } from '@intlayer/editor';
2
+ import { SetStateAction } from 'preact/compat';
3
+ import { Dispatch } from 'preact/hooks';
4
+ export type CrossFrameStateOptions = {
5
+ emit?: boolean;
6
+ receive?: boolean;
7
+ };
8
+ /**
9
+ * Configuration options for `useCrossFrameState`.
10
+ * @typedef {Object} CrossFrameStateOptions
11
+ * @property {boolean} [emit=true] - Whether to broadcast state changes to other instances.
12
+ * @property {boolean} [receive=true] - Whether to listen for state updates from other instances.
13
+ */
14
+ /**
15
+ * useCrossFrameState
16
+ *
17
+ * This Preact hook synchronizes state across multiple instances (e.g., different iframes or windows).
18
+ * It uses the `postMessage` API to communicate state changes and updates between instances.
19
+ *
20
+ * @template S - The type of the state.
21
+ * @param key - A unique identifier for the state to synchronize.
22
+ * @param initialState - The initial state value or a function to compute it lazily.
23
+ * @param options - Configuration options to control emitting and receiving messages.
24
+ * - `emit` (default: true): Whether to broadcast state changes to other instances.
25
+ * - `receive` (default: true): Whether to listen for state updates from other instances.
26
+ *
27
+ * @returns {[S, StateUpdater<S>, typeof postState]} An array containing the current state and a setter function, and a function to manually post the state.
28
+ */
29
+ export declare const useCrossFrameState: <S>(key: `${MessageKey}`, initialState?: S | (() => S), options?: CrossFrameStateOptions) => [S, Dispatch<SetStateAction<S>>, () => void];
30
+ //# sourceMappingURL=useCrossFrameState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCrossFrameState.d.ts","sourceRoot":"","sources":["../../../src/editor/useCrossFrameState.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAA0C,MAAM,cAAc,CAAC;AAIhF,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAUF;;;;;GAKG;AAEH;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,EAClC,KAAK,GAAG,UAAU,EAAE,EACpB,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAC5B,UAAU,sBAAsB,KAC/B,CAAC,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,aAiGjC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type CrossFrameStateOptions } from './useCrossFrameState';
2
+ export declare const useCrossURLPathState: (initialState?: string, options?: CrossFrameStateOptions) => [string, import("preact/hooks").Dispatch<import("preact/hooks").StateUpdater<string>>, () => void];
3
+ export declare const useCrossURLPathSetter: (initialState?: string) => [string, import("preact/hooks").Dispatch<import("preact/hooks").StateUpdater<string>>, () => void];
4
+ //# sourceMappingURL=useCrossURLPathState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCrossURLPathState.d.ts","sourceRoot":"","sources":["../../../src/editor/useCrossURLPathState.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,oBAAoB,GAC/B,eAAe,MAAM,EACrB,UAAU,sBAAsB,uGAC4C,CAAC;AAE/E,eAAO,MAAM,qBAAqB,GAAI,eAAe,MAAM,uGA8D1D,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { Locales } from '@intlayer/config/client';
2
+ import { type KeyPath } from '@intlayer/core';
3
+ import { FC } from 'preact/compat';
4
+ type EditedContentRendererProps = {
5
+ dictionaryKey: string;
6
+ keyPath: KeyPath[];
7
+ children: string;
8
+ locale?: Locales;
9
+ };
10
+ export declare const useEditedContentRenderer: ({ dictionaryKey, keyPath, children, }: EditedContentRendererProps) => string;
11
+ export declare const EditedContentRenderer: FC<EditedContentRendererProps>;
12
+ export {};
13
+ //# sourceMappingURL=useEditedContentRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useEditedContentRenderer.d.ts","sourceRoot":"","sources":["../../../src/editor/useEditedContentRenderer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAc,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAGnC,KAAK,0BAA0B,GAAG;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,uCAItC,0BAA0B,WAe5B,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,0BAA0B,CAoBhE,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const useIframeClickInterceptor: () => void;
2
+ export declare const useIframeClickMerger: () => (data?: MessageEvent<any>) => void;
3
+ //# sourceMappingURL=useIframeClickInterceptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIframeClickInterceptor.d.ts","sourceRoot":"","sources":["../../../src/editor/useIframeClickInterceptor.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,yBAAyB,YAcrC,CAAC;AAEF,eAAO,MAAM,oBAAoB,0CAI9B,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { Locales, LocalesValues } from '@intlayer/config/client';
2
+ import { type Dictionary, type Plugins } from '@intlayer/core';
3
+ import { type 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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getDictionary.d.ts","sourceRoot":"","sources":["../../src/getDictionary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EACL,KAAK,UAAU,EACf,KAAK,OAAO,EAEb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,oBAAoB,EAI1B,MAAM,WAAW,CAAC;AAEnB,eAAO,MAAM,aAAa,GACxB,CAAC,SAAS,UAAU,EACpB,CAAC,SAAS,aAAa,GAAG,OAAO,EAEjC,YAAY,CAAC,EACb,SAAS,CAAC,EACV,oBAAoB,OAAO,EAAE,KAajB,oBAAoB,CAAC,CAAC,CAAC,SAAS,CAAC,CAC9C,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { type DictionaryKeys, type Plugins } from '@intlayer/core';
2
+ import type { IntlayerDictionaryTypesConnector, LocalesValues } from 'intlayer';
3
+ import { type 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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getIntlayer.d.ts","sourceRoot":"","sources":["../../src/getIntlayer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,OAAO,EAEb,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,gCAAgC,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAChF,OAAO,EACL,KAAK,oBAAoB,EAI1B,MAAM,WAAW,CAAC;AAEnB,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,cAAc,EAAE,CAAC,SAAS,aAAa,EAC3E,KAAK,CAAC,EACN,SAAS,CAAC,EACV,oBAAoB,OAAO,EAAE,KAS0B,oBAAoB,CACzE,gCAAgC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAEjD,CAAC"}
@@ -1,3 +1,9 @@
1
- export * from './intlayerPlugin';
2
- export * from './intlayerMiddlewarePlugin';
1
+ import type { IInterpreterPluginPreact } from './plugins';
2
+ declare module '@intlayer/core' {
3
+ interface IInterpreterPlugin<T, S> extends IInterpreterPluginPreact<T> {
4
+ }
5
+ }
6
+ export { getBrowserLocale, IntlayerClientContext, IntlayerProvider, IntlayerProviderContent, localeCookie, setLocaleCookie, t, useDictionary, useDictionaryDynamic, useIntlayer, useIntlayerAsync, useIntlayerContext, useLoadDynamic, useLocale, useLocaleBase, useLocaleCookie, type IntlayerProviderProps, } from './client/index';
7
+ export { type IntlayerNode } from './IntlayerNode';
8
+ export { MarkdownProvider } from './markdown/index';
3
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAE1D,OAAO,QAAQ,gBAAgB,CAAC;IAC9B,UAAU,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAE,SAAQ,wBAAwB,CAAC,CAAC,CAAC;KAAG;CAC1E;AAED,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,YAAY,EACZ,eAAe,EACf,CAAC,EACD,aAAa,EACb,oBAAoB,EACpB,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,SAAS,EACT,aAAa,EACb,eAAe,EACf,KAAK,qBAAqB,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { type FC, type PropsWithChildren, type ReactNode } from 'preact/compat';
2
+ type MarkdownContextValue = {
3
+ renderMarkdown: (markdown: string) => ReactNode;
4
+ };
5
+ type MarkdownProviderProps = PropsWithChildren<MarkdownContextValue>;
6
+ export declare const useMarkdownContext: () => MarkdownContextValue;
7
+ export declare const MarkdownProvider: FC<MarkdownProviderProps>;
8
+ export {};
9
+ //# sourceMappingURL=MarkdownProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MarkdownProvider.d.ts","sourceRoot":"","sources":["../../../src/markdown/MarkdownProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,EAAE,EACP,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACf,MAAM,eAAe,CAAC;AAEvB,KAAK,oBAAoB,GAAG;IAC1B,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,SAAS,CAAC;CACjD,CAAC;AAEF,KAAK,qBAAqB,GAAG,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;AAMrE,eAAO,MAAM,kBAAkB,4BAAoC,CAAC;AAEpE,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAOtD,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { LocalesValues } from '@intlayer/config/client';
2
+ import { KeyPath } from '@intlayer/core';
3
+ import { FC } from 'preact/compat';
4
+ type MarkdownRendererProps = {
5
+ dictionaryKey: string;
6
+ keyPath: KeyPath[];
7
+ locale?: LocalesValues;
8
+ children: string;
9
+ };
10
+ export declare const MarkdownRenderer: FC<MarkdownRendererProps>;
11
+ type MarkdownMetadataRendererProps = MarkdownRendererProps & {
12
+ metadataKeyPath: KeyPath[];
13
+ };
14
+ export declare const MarkdownMetadataRenderer: FC<MarkdownMetadataRendererProps>;
15
+ export {};
16
+ //# sourceMappingURL=MarkdownRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MarkdownRenderer.d.ts","sourceRoot":"","sources":["../../../src/markdown/MarkdownRenderer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAKL,OAAO,EACR,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,EAAE,EAAa,MAAM,eAAe,CAAC;AAI9C,KAAK,qBAAqB,GAAG;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAmCtD,CAAC;AAEF,KAAK,6BAA6B,GAAG,qBAAqB,GAAG;IAC3D,eAAe,EAAE,OAAO,EAAE,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,EAAE,CAAC,6BAA6B,CAmBtE,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './MarkdownProvider';
2
+ export * from './MarkdownRenderer';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/markdown/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,54 @@
1
+ import { NodeType, type DeepTransformContent as DeepTransformContentCore, type IInterpreterPluginState as IInterpreterPluginStateCore, type Plugins } from '@intlayer/core';
2
+ import type { ComponentChildren } from 'preact';
3
+ import { type IntlayerNode } from './IntlayerNode';
4
+ /** ---------------------------------------------
5
+ * INTLAYER NODE PLUGIN
6
+ * --------------------------------------------- */
7
+ export type IntlayerNodeCond<T> = T extends number | string ? IntlayerNode<T> : never;
8
+ /** Translation plugin. Replaces node with a locale string if nodeType = Translation. */
9
+ export declare const intlayerNodePlugins: Plugins;
10
+ /** ---------------------------------------------
11
+ * PREACT NODE PLUGIN
12
+ * --------------------------------------------- */
13
+ export type PreactNodeCond<T> = T extends {
14
+ props: any;
15
+ key: any;
16
+ } ? ComponentChildren : never;
17
+ /** Translation plugin. Replaces node with a locale string if nodeType = Translation. */
18
+ export declare const preactNodePlugins: Plugins;
19
+ /**
20
+ * MARKDOWN PLUGIN
21
+ */
22
+ export type MarkdownStringCond<T> = T extends string ? IntlayerNode<string, {
23
+ metadata: DeepTransformContent<string>;
24
+ }> : never;
25
+ /** Markdown string plugin. Replaces string node with a component that render the markdown. */
26
+ export declare const markdownStringPlugin: Plugins;
27
+ export type MarkdownCond<T> = T extends {
28
+ nodeType: NodeType | string;
29
+ [NodeType.Markdown]: infer M;
30
+ metadata?: infer U;
31
+ } ? IntlayerNode<DeepTransformContent<M>, {
32
+ metadata: DeepTransformContent<U>;
33
+ }> : never;
34
+ export declare const markdownPlugin: Plugins;
35
+ /** ---------------------------------------------
36
+ * PLUGINS RESULT
37
+ * --------------------------------------------- */
38
+ export interface IInterpreterPluginPreact<T> {
39
+ preactNode: PreactNodeCond<T>;
40
+ intlayerNode: IntlayerNodeCond<T>;
41
+ markdown: MarkdownCond<T>;
42
+ }
43
+ /**
44
+ * Insert this type as param of `DeepTransformContent` to avoid `intlayer` package pollution.
45
+ *
46
+ * Otherwise the the `preact-intlayer` plugins will override the types of `intlayer` functions.
47
+ */
48
+ export type IInterpreterPluginState = IInterpreterPluginStateCore & {
49
+ preactNode: true;
50
+ intlayerNode: true;
51
+ markdown: true;
52
+ };
53
+ export type DeepTransformContent<T> = DeepTransformContentCore<T, IInterpreterPluginState>;
54
+ //# sourceMappingURL=plugins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/plugins.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAER,KAAK,oBAAoB,IAAI,wBAAwB,EACrD,KAAK,uBAAuB,IAAI,2BAA2B,EAE3D,KAAK,OAAO,EACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAMvE;;oDAEoD;AAEpD,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAAG,MAAM,GACvD,YAAY,CAAC,CAAC,CAAC,GACf,KAAK,CAAC;AAEV,wFAAwF;AACxF,eAAO,MAAM,mBAAmB,EAAE,OAwBjC,CAAC;AAEF;;oDAEoD;AAEpD,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS;IACxC,KAAK,EAAE,GAAG,CAAC;IACX,GAAG,EAAE,GAAG,CAAC;CACV,GACG,iBAAiB,GACjB,KAAK,CAAC;AAEV,wFAAwF;AACxF,eAAO,MAAM,iBAAiB,EAAE,OAuB/B,CAAC;AAEF;;GAEG;AAEH,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAChD,YAAY,CAAC,MAAM,EAAE;IAAE,QAAQ,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC,GAChE,KAAK,CAAC;AAEV,8FAA8F;AAC9F,eAAO,MAAM,oBAAoB,EAAE,OAuDlC,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS;IACtC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC5B,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;CACpB,GACG,YAAY,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE;IAAE,QAAQ,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC,GAC5E,KAAK,CAAC;AAEV,eAAO,MAAM,cAAc,EAAE,OAqB5B,CAAC;AACF;;oDAEoD;AAEpD,MAAM,WAAW,wBAAwB,CAAC,CAAC;IACzC,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;IAC9B,YAAY,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAClC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;CAC3B;AAED;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,2BAA2B,GAAG;IAClE,UAAU,EAAE,IAAI,CAAC;IACjB,YAAY,EAAE,IAAI,CAAC;IACnB,QAAQ,EAAE,IAAI,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,wBAAwB,CAC5D,CAAC,EACD,uBAAuB,CACxB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { type ComponentChild, type VNode } from 'preact';
2
+ export declare const renderPreactElement: (element: VNode<any>) => VNode<{
3
+ children?: ComponentChild | ComponentChild[];
4
+ }>;
5
+ //# sourceMappingURL=renderPreactElement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderPreactElement.d.ts","sourceRoot":"","sources":["../../../src/preactElement/renderPreactElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,KAAK,EAAE,MAAM,QAAQ,CAAC;AAIzD,eAAO,MAAM,mBAAmB,GAAI,SAAS,KAAK,CAAC,GAAG,CAAC;eAQ/B,cAAc,GAAG,cAAc,EAAE;EAoCxD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "preact-intlayer",
3
- "version": "5.5.5",
3
+ "version": "5.5.7",
4
4
  "private": false,
5
5
  "description": "Easily internationalize i18n your Preact applications with type-safe multilingual content management.",
6
6
  "keywords": [
@@ -56,12 +56,17 @@
56
56
  "./package.json"
57
57
  ],
58
58
  "dependencies": {
59
- "@intlayer/core": "5.5.5",
60
- "@intlayer/config": "5.5.5",
61
- "@intlayer/chokidar": "5.5.5"
59
+ "js-cookie": "^3.0.5",
60
+ "uuid": "^11.1.0",
61
+ "@intlayer/api": "5.5.7",
62
+ "@intlayer/chokidar": "5.5.7",
63
+ "@intlayer/config": "5.5.7",
64
+ "@intlayer/core": "5.5.7",
65
+ "@intlayer/editor": "5.5.7"
62
66
  },
63
67
  "devDependencies": {
64
68
  "@types/node": "^22.13.10",
69
+ "@types/uuid": "^10.0.0",
65
70
  "@typescript-eslint/parser": "^8.27.0",
66
71
  "concurrently": "^9.1.2",
67
72
  "eslint": "^9.22.0",
@@ -70,16 +75,18 @@
70
75
  "tsc-alias": "^1.8.11",
71
76
  "tsup": "^8.4.0",
72
77
  "typescript": "^5.8.2",
73
- "@utils/eslint-config": "1.0.4",
74
- "@utils/ts-config-types": "1.0.4",
75
78
  "@utils/ts-config": "1.0.4",
76
- "@utils/tsup-config": "1.0.4"
79
+ "@utils/tsup-config": "1.0.4",
80
+ "@utils/ts-config-types": "1.0.4",
81
+ "@utils/eslint-config": "1.0.4"
77
82
  },
78
83
  "peerDependencies": {
79
84
  "preact": "^10.26.4",
80
- "@intlayer/chokidar": "5.5.5",
81
- "@intlayer/config": "5.5.5",
82
- "@intlayer/core": "5.5.5"
85
+ "@intlayer/api": "5.5.7",
86
+ "@intlayer/config": "5.5.7",
87
+ "@intlayer/chokidar": "5.5.7",
88
+ "@intlayer/core": "5.5.7",
89
+ "@intlayer/editor": "5.5.7"
83
90
  },
84
91
  "engines": {
85
92
  "node": ">=14.18"