angular-intlayer 5.5.9 → 5.5.10

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 (262) hide show
  1. package/README.md +42 -9
  2. package/dist/cjs/UI/ContentSelector.component.cjs +141 -0
  3. package/dist/cjs/UI/ContentSelector.component.cjs.map +1 -0
  4. package/dist/cjs/client/index.cjs +13 -27
  5. package/dist/cjs/client/index.cjs.map +1 -1
  6. package/dist/cjs/client/installIntlayer.cjs +72 -0
  7. package/dist/cjs/client/installIntlayer.cjs.map +1 -0
  8. package/dist/cjs/client/{getDictionary.cjs → useDictionary.cjs} +15 -19
  9. package/dist/cjs/client/useDictionary.cjs.map +1 -0
  10. package/dist/cjs/client/useDictionaryDynamic.cjs +42 -0
  11. package/dist/cjs/client/useDictionaryDynamic.cjs.map +1 -0
  12. package/dist/cjs/client/{getBrowserLocale.cjs → useIntlayer.cjs} +17 -11
  13. package/dist/cjs/client/useIntlayer.cjs.map +1 -0
  14. package/dist/cjs/client/{intlayer.service.cjs → useLoadDynamic.cjs} +21 -19
  15. package/dist/cjs/client/useLoadDynamic.cjs.map +1 -0
  16. package/dist/cjs/client/useLocale.cjs +69 -0
  17. package/dist/cjs/client/useLocale.cjs.map +1 -0
  18. package/dist/cjs/client/useLocaleCookie.cjs +60 -0
  19. package/dist/cjs/client/useLocaleCookie.cjs.map +1 -0
  20. package/dist/cjs/editor/ContentSelectorWrapper.component.cjs +73 -0
  21. package/dist/cjs/editor/ContentSelectorWrapper.component.cjs.map +1 -0
  22. package/dist/cjs/editor/EditedContentRenderer.component.cjs +77 -0
  23. package/dist/cjs/editor/EditedContentRenderer.component.cjs.map +1 -0
  24. package/dist/cjs/editor/EditorSelectorRenderer.component.cjs +58 -0
  25. package/dist/cjs/editor/EditorSelectorRenderer.component.cjs.map +1 -0
  26. package/dist/cjs/editor/changedContent.cjs +62 -0
  27. package/dist/cjs/editor/changedContent.cjs.map +1 -0
  28. package/dist/cjs/editor/communicator.cjs +82 -0
  29. package/dist/cjs/editor/communicator.cjs.map +1 -0
  30. package/dist/cjs/editor/configuration.cjs +57 -0
  31. package/dist/cjs/editor/configuration.cjs.map +1 -0
  32. package/dist/cjs/editor/createSharedComposable.cjs +68 -0
  33. package/dist/cjs/editor/createSharedComposable.cjs.map +1 -0
  34. package/dist/cjs/editor/dictionariesRecord.cjs +83 -0
  35. package/dist/cjs/editor/dictionariesRecord.cjs.map +1 -0
  36. package/dist/cjs/editor/editedContent.cjs +77 -0
  37. package/dist/cjs/editor/editedContent.cjs.map +1 -0
  38. package/dist/cjs/editor/editorEnabled.cjs +76 -0
  39. package/dist/cjs/editor/editorEnabled.cjs.map +1 -0
  40. package/dist/cjs/editor/editorLocale.cjs +47 -0
  41. package/dist/cjs/editor/editorLocale.cjs.map +1 -0
  42. package/dist/cjs/editor/focusDictionary.cjs +80 -0
  43. package/dist/cjs/editor/focusDictionary.cjs.map +1 -0
  44. package/dist/cjs/editor/index.cjs +38 -0
  45. package/dist/cjs/editor/index.cjs.map +1 -0
  46. package/dist/cjs/editor/installIntlayerEditor.cjs +72 -0
  47. package/dist/cjs/editor/installIntlayerEditor.cjs.map +1 -0
  48. package/dist/cjs/editor/useCrossFrameMessageListener.cjs +83 -0
  49. package/dist/cjs/editor/useCrossFrameMessageListener.cjs.map +1 -0
  50. package/dist/cjs/editor/useCrossFrameState.cjs +95 -0
  51. package/dist/cjs/editor/useCrossFrameState.cjs.map +1 -0
  52. package/dist/cjs/editor/useCrossURLPathState.cjs +72 -0
  53. package/dist/cjs/editor/useCrossURLPathState.cjs.map +1 -0
  54. package/dist/cjs/editor/useEditedContentRenderer.cjs +58 -0
  55. package/dist/cjs/editor/useEditedContentRenderer.cjs.map +1 -0
  56. package/dist/cjs/editor/useEditor.cjs +46 -0
  57. package/dist/cjs/editor/useEditor.cjs.map +1 -0
  58. package/dist/cjs/editor/useIframeClickInterceptor.cjs +62 -0
  59. package/dist/cjs/editor/useIframeClickInterceptor.cjs.map +1 -0
  60. package/dist/cjs/getDictionary.cjs +15 -2
  61. package/dist/cjs/getDictionary.cjs.map +1 -1
  62. package/dist/cjs/getIntlayer.cjs +9 -2
  63. package/dist/cjs/getIntlayer.cjs.map +1 -1
  64. package/dist/cjs/markdown/index.cjs +3 -16
  65. package/dist/cjs/markdown/index.cjs.map +1 -1
  66. package/dist/cjs/markdown/installIntlayerMarkdown.cjs +66 -0
  67. package/dist/cjs/markdown/installIntlayerMarkdown.cjs.map +1 -0
  68. package/dist/cjs/plugins.cjs +27 -18
  69. package/dist/cjs/plugins.cjs.map +1 -1
  70. package/dist/cjs/renderIntlayerNode.cjs +58 -0
  71. package/dist/cjs/renderIntlayerNode.cjs.map +1 -0
  72. package/dist/cjs/{client/getLocale.cjs → webpack/index.cjs} +6 -14
  73. package/dist/cjs/webpack/index.cjs.map +1 -0
  74. package/dist/cjs/webpack/mergeConfig.cjs +83 -0
  75. package/dist/cjs/webpack/mergeConfig.cjs.map +1 -0
  76. package/dist/esm/UI/ContentSelector.component.mjs +126 -0
  77. package/dist/esm/UI/ContentSelector.component.mjs.map +1 -0
  78. package/dist/esm/client/index.mjs +6 -16
  79. package/dist/esm/client/index.mjs.map +1 -1
  80. package/dist/esm/client/installIntlayer.mjs +35 -0
  81. package/dist/esm/client/installIntlayer.mjs.map +1 -0
  82. package/dist/esm/client/useDictionary.mjs +15 -0
  83. package/dist/esm/client/useDictionary.mjs.map +1 -0
  84. package/dist/esm/client/useDictionaryDynamic.mjs +18 -0
  85. package/dist/esm/client/useDictionaryDynamic.mjs.map +1 -0
  86. package/dist/esm/client/useIntlayer.mjs +15 -0
  87. package/dist/esm/client/useIntlayer.mjs.map +1 -0
  88. package/dist/esm/client/useLoadDynamic.mjs +21 -0
  89. package/dist/esm/client/useLoadDynamic.mjs.map +1 -0
  90. package/dist/esm/client/useLocale.mjs +35 -0
  91. package/dist/esm/client/useLocale.mjs.map +1 -0
  92. package/dist/esm/client/useLocaleCookie.mjs +24 -0
  93. package/dist/esm/client/useLocaleCookie.mjs.map +1 -0
  94. package/dist/esm/editor/ContentSelectorWrapper.component.mjs +49 -0
  95. package/dist/esm/editor/ContentSelectorWrapper.component.mjs.map +1 -0
  96. package/dist/esm/editor/EditedContentRenderer.component.mjs +53 -0
  97. package/dist/esm/editor/EditedContentRenderer.component.mjs.map +1 -0
  98. package/dist/esm/editor/EditorSelectorRenderer.component.mjs +34 -0
  99. package/dist/esm/editor/EditorSelectorRenderer.component.mjs.map +1 -0
  100. package/dist/esm/editor/changedContent.mjs +36 -0
  101. package/dist/esm/editor/changedContent.mjs.map +1 -0
  102. package/dist/esm/editor/communicator.mjs +46 -0
  103. package/dist/esm/editor/communicator.mjs.map +1 -0
  104. package/dist/esm/editor/configuration.mjs +23 -0
  105. package/dist/esm/editor/configuration.mjs.map +1 -0
  106. package/dist/esm/editor/createSharedComposable.mjs +43 -0
  107. package/dist/esm/editor/createSharedComposable.mjs.map +1 -0
  108. package/dist/esm/editor/dictionariesRecord.mjs +47 -0
  109. package/dist/esm/editor/dictionariesRecord.mjs.map +1 -0
  110. package/dist/esm/editor/editedContent.mjs +51 -0
  111. package/dist/esm/editor/editedContent.mjs.map +1 -0
  112. package/dist/esm/editor/editorEnabled.mjs +50 -0
  113. package/dist/esm/editor/editorEnabled.mjs.map +1 -0
  114. package/dist/esm/editor/editorLocale.mjs +23 -0
  115. package/dist/esm/editor/editorLocale.mjs.map +1 -0
  116. package/dist/esm/editor/focusDictionary.mjs +54 -0
  117. package/dist/esm/editor/focusDictionary.mjs.map +1 -0
  118. package/dist/esm/editor/index.mjs +10 -0
  119. package/dist/esm/editor/index.mjs.map +1 -0
  120. package/dist/esm/editor/installIntlayerEditor.mjs +38 -0
  121. package/dist/esm/editor/installIntlayerEditor.mjs.map +1 -0
  122. package/dist/esm/editor/useCrossFrameMessageListener.mjs +59 -0
  123. package/dist/esm/editor/useCrossFrameMessageListener.mjs.map +1 -0
  124. package/dist/esm/editor/useCrossFrameState.mjs +71 -0
  125. package/dist/esm/editor/useCrossFrameState.mjs.map +1 -0
  126. package/dist/esm/editor/useCrossURLPathState.mjs +47 -0
  127. package/dist/esm/editor/useCrossURLPathState.mjs.map +1 -0
  128. package/dist/esm/editor/useEditedContentRenderer.mjs +37 -0
  129. package/dist/esm/editor/useEditedContentRenderer.mjs.map +1 -0
  130. package/dist/esm/editor/useEditor.mjs +22 -0
  131. package/dist/esm/editor/useEditor.mjs.map +1 -0
  132. package/dist/esm/editor/useIframeClickInterceptor.mjs +37 -0
  133. package/dist/esm/editor/useIframeClickInterceptor.mjs.map +1 -0
  134. package/dist/esm/getDictionary.mjs +19 -1
  135. package/dist/esm/getDictionary.mjs.map +1 -1
  136. package/dist/esm/getIntlayer.mjs +14 -2
  137. package/dist/esm/getIntlayer.mjs.map +1 -1
  138. package/dist/esm/markdown/index.mjs +1 -10
  139. package/dist/esm/markdown/index.mjs.map +1 -1
  140. package/dist/esm/markdown/installIntlayerMarkdown.mjs +39 -0
  141. package/dist/esm/markdown/installIntlayerMarkdown.mjs.map +1 -0
  142. package/dist/esm/plugins.mjs +27 -17
  143. package/dist/esm/plugins.mjs.map +1 -1
  144. package/dist/esm/renderIntlayerNode.mjs +34 -0
  145. package/dist/esm/renderIntlayerNode.mjs.map +1 -0
  146. package/dist/esm/webpack/index.mjs +2 -0
  147. package/dist/esm/webpack/index.mjs.map +1 -0
  148. package/dist/esm/webpack/mergeConfig.mjs +49 -0
  149. package/dist/esm/webpack/mergeConfig.mjs.map +1 -0
  150. package/dist/types/UI/ContentSelector.component.d.ts +32 -0
  151. package/dist/types/UI/ContentSelector.component.d.ts.map +1 -0
  152. package/dist/types/client/index.d.ts +6 -7
  153. package/dist/types/client/index.d.ts.map +1 -1
  154. package/dist/types/client/installIntlayer.d.ts +17 -0
  155. package/dist/types/client/installIntlayer.d.ts.map +1 -0
  156. package/dist/types/client/useDictionary.d.ts +5 -0
  157. package/dist/types/client/useDictionary.d.ts.map +1 -0
  158. package/dist/types/client/useDictionaryDynamic.d.ts +9 -0
  159. package/dist/types/client/useDictionaryDynamic.d.ts.map +1 -0
  160. package/dist/types/client/useIntlayer.d.ts +10 -0
  161. package/dist/types/client/useIntlayer.d.ts.map +1 -0
  162. package/dist/types/client/useLoadDynamic.d.ts +8 -0
  163. package/dist/types/client/useLoadDynamic.d.ts.map +1 -0
  164. package/dist/types/client/useLocale.d.ts +15 -0
  165. package/dist/types/client/useLocale.d.ts.map +1 -0
  166. package/dist/types/client/useLocaleCookie.d.ts +17 -0
  167. package/dist/types/client/useLocaleCookie.d.ts.map +1 -0
  168. package/dist/types/editor/ContentSelectorWrapper.component.d.ts +19 -0
  169. package/dist/types/editor/ContentSelectorWrapper.component.d.ts.map +1 -0
  170. package/dist/types/editor/EditedContentRenderer.component.d.ts +19 -0
  171. package/dist/types/editor/EditedContentRenderer.component.d.ts.map +1 -0
  172. package/dist/types/editor/EditorSelectorRenderer.component.d.ts +13 -0
  173. package/dist/types/editor/EditorSelectorRenderer.component.d.ts.map +1 -0
  174. package/dist/types/editor/changedContent.d.ts +14 -0
  175. package/dist/types/editor/changedContent.d.ts.map +1 -0
  176. package/dist/types/editor/communicator.d.ts +28 -0
  177. package/dist/types/editor/communicator.d.ts.map +1 -0
  178. package/dist/types/editor/configuration.d.ts +2 -0
  179. package/dist/types/editor/configuration.d.ts.map +1 -0
  180. package/dist/types/editor/createSharedComposable.d.ts +14 -0
  181. package/dist/types/editor/createSharedComposable.d.ts.map +1 -0
  182. package/dist/types/editor/dictionariesRecord.d.ts +16 -0
  183. package/dist/types/editor/dictionariesRecord.d.ts.map +1 -0
  184. package/dist/types/editor/editedContent.d.ts +19 -0
  185. package/dist/types/editor/editedContent.d.ts.map +1 -0
  186. package/dist/types/editor/editorEnabled.d.ts +16 -0
  187. package/dist/types/editor/editorEnabled.d.ts.map +1 -0
  188. package/dist/types/editor/editorLocale.d.ts +3 -0
  189. package/dist/types/editor/editorLocale.d.ts.map +1 -0
  190. package/dist/types/editor/focusDictionary.d.ts +24 -0
  191. package/dist/types/editor/focusDictionary.d.ts.map +1 -0
  192. package/dist/types/editor/index.d.ts +5 -0
  193. package/dist/types/editor/index.d.ts.map +1 -0
  194. package/dist/types/editor/installIntlayerEditor.d.ts +18 -0
  195. package/dist/types/editor/installIntlayerEditor.d.ts.map +1 -0
  196. package/dist/types/editor/useCrossFrameMessageListener.d.ts +11 -0
  197. package/dist/types/editor/useCrossFrameMessageListener.d.ts.map +1 -0
  198. package/dist/types/editor/useCrossFrameState.d.ts +24 -0
  199. package/dist/types/editor/useCrossFrameState.d.ts.map +1 -0
  200. package/dist/types/editor/useCrossURLPathState.d.ts +16 -0
  201. package/dist/types/editor/useCrossURLPathState.d.ts.map +1 -0
  202. package/dist/types/editor/useEditedContentRenderer.d.ts +17 -0
  203. package/dist/types/editor/useEditedContentRenderer.d.ts.map +1 -0
  204. package/dist/types/editor/useEditor.d.ts +2 -0
  205. package/dist/types/editor/useEditor.d.ts.map +1 -0
  206. package/dist/types/editor/useIframeClickInterceptor.d.ts +11 -0
  207. package/dist/types/editor/useIframeClickInterceptor.d.ts.map +1 -0
  208. package/dist/types/getDictionary.d.ts +4 -1
  209. package/dist/types/getDictionary.d.ts.map +1 -1
  210. package/dist/types/getIntlayer.d.ts +4 -6
  211. package/dist/types/getIntlayer.d.ts.map +1 -1
  212. package/dist/types/markdown/index.d.ts +1 -4
  213. package/dist/types/markdown/index.d.ts.map +1 -1
  214. package/dist/types/markdown/installIntlayerMarkdown.d.ts +26 -0
  215. package/dist/types/markdown/installIntlayerMarkdown.d.ts.map +1 -0
  216. package/dist/types/plugins.d.ts +0 -9
  217. package/dist/types/plugins.d.ts.map +1 -1
  218. package/dist/types/renderIntlayerNode.d.ts +13 -0
  219. package/dist/types/renderIntlayerNode.d.ts.map +1 -0
  220. package/dist/types/webpack/index.d.ts +2 -0
  221. package/dist/types/webpack/index.d.ts.map +1 -0
  222. package/dist/types/webpack/mergeConfig.d.ts +3 -0
  223. package/dist/types/webpack/mergeConfig.d.ts.map +1 -0
  224. package/package.json +23 -9
  225. package/dist/cjs/client/dictionary.service.cjs +0 -70
  226. package/dist/cjs/client/dictionary.service.cjs.map +0 -1
  227. package/dist/cjs/client/getBrowserLocale.cjs.map +0 -1
  228. package/dist/cjs/client/getDictionary.cjs.map +0 -1
  229. package/dist/cjs/client/getLocale.cjs.map +0 -1
  230. package/dist/cjs/client/intlayer.service.cjs.map +0 -1
  231. package/dist/cjs/client/locale.service.cjs +0 -66
  232. package/dist/cjs/client/locale.service.cjs.map +0 -1
  233. package/dist/cjs/client/t.cjs +0 -32
  234. package/dist/cjs/client/t.cjs.map +0 -1
  235. package/dist/esm/client/dictionary.service.mjs +0 -46
  236. package/dist/esm/client/dictionary.service.mjs.map +0 -1
  237. package/dist/esm/client/getBrowserLocale.mjs +0 -10
  238. package/dist/esm/client/getBrowserLocale.mjs.map +0 -1
  239. package/dist/esm/client/getDictionary.mjs +0 -25
  240. package/dist/esm/client/getDictionary.mjs.map +0 -1
  241. package/dist/esm/client/getLocale.mjs +0 -7
  242. package/dist/esm/client/getLocale.mjs.map +0 -1
  243. package/dist/esm/client/intlayer.service.mjs +0 -19
  244. package/dist/esm/client/intlayer.service.mjs.map +0 -1
  245. package/dist/esm/client/locale.service.mjs +0 -42
  246. package/dist/esm/client/locale.service.mjs.map +0 -1
  247. package/dist/esm/client/t.mjs +0 -8
  248. package/dist/esm/client/t.mjs.map +0 -1
  249. package/dist/types/client/dictionary.service.d.ts +0 -21
  250. package/dist/types/client/dictionary.service.d.ts.map +0 -1
  251. package/dist/types/client/getBrowserLocale.d.ts +0 -6
  252. package/dist/types/client/getBrowserLocale.d.ts.map +0 -1
  253. package/dist/types/client/getDictionary.d.ts +0 -8
  254. package/dist/types/client/getDictionary.d.ts.map +0 -1
  255. package/dist/types/client/getLocale.d.ts +0 -7
  256. package/dist/types/client/getLocale.d.ts.map +0 -1
  257. package/dist/types/client/intlayer.service.d.ts +0 -8
  258. package/dist/types/client/intlayer.service.d.ts.map +0 -1
  259. package/dist/types/client/locale.service.d.ts +0 -12
  260. package/dist/types/client/locale.service.d.ts.map +0 -1
  261. package/dist/types/client/t.d.ts +0 -8
  262. package/dist/types/client/t.d.ts.map +0 -1
@@ -0,0 +1,16 @@
1
+ import { Injector, Signal } from '@angular/core';
2
+ export type EditorEnabledStateProps = {
3
+ wrapperEnabled: Signal<boolean>;
4
+ isInIframe: Signal<boolean>;
5
+ enabled: Signal<boolean>;
6
+ };
7
+ /**
8
+ * Creates an editor wrapperEnabled client
9
+ */
10
+ export declare const createEditorEnabledClient: () => EditorEnabledStateProps;
11
+ /**
12
+ * Helper to install the editor wrapperEnabled state into the injector
13
+ */
14
+ export declare const installEditorEnabled: (injector: Injector) => void;
15
+ export declare const useEditorEnabled: () => EditorEnabledStateProps;
16
+ //# sourceMappingURL=editorEnabled.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editorEnabled.d.ts","sourceRoot":"","sources":["../../../src/editor/editorEnabled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,QAAQ,EAAU,MAAM,EAAE,MAAM,eAAe,CAAC;AAQ3E,MAAM,MAAM,uBAAuB,GAAG;IACpC,cAAc,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;CAC1B,CAAC;AASF;;GAEG;AACH,eAAO,MAAM,yBAAyB,+BAgBrC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,UAAU,QAAQ,SAKtD,CAAC;AAEF,eAAO,MAAM,gBAAgB,+BA0B3B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IntlayerProvider } from '../client';
2
+ export declare const useEditorLocale: () => IntlayerProvider;
3
+ //# sourceMappingURL=editorLocale.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editorLocale.d.ts","sourceRoot":"","sources":["../../../src/editor/editorLocale.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAI7D,eAAO,MAAM,eAAe,wBAkB1B,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { Injector, Signal } from '@angular/core';
2
+ import type { KeyPath } from '@intlayer/core';
3
+ export type FileContent = {
4
+ dictionaryKey: string;
5
+ keyPath?: KeyPath[];
6
+ dictionaryPath?: string;
7
+ };
8
+ type FocusDictionaryClient = {
9
+ focusedContent: Signal<FileContent | null>;
10
+ setFocusedContent: (focussedContent: FileContent | null) => void;
11
+ setFocusedContentKeyPath: (keyPath: KeyPath[]) => void;
12
+ };
13
+ /**
14
+ * Creates a focus dictionary client
15
+ */
16
+ export declare const createFocusDictionaryClient: () => FocusDictionaryClient;
17
+ /**
18
+ * Helper to install the focus dictionary into the injector
19
+ */
20
+ export declare const installFocusDictionary: (injector: Injector) => void;
21
+ /** consumer */
22
+ export declare const useFocusDictionary: () => FocusDictionaryClient;
23
+ export {};
24
+ //# sourceMappingURL=focusDictionary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focusDictionary.d.ts","sourceRoot":"","sources":["../../../src/editor/focusDictionary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,QAAQ,EAAU,MAAM,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAK9C,MAAM,MAAM,WAAW,GAAG;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC3B,cAAc,EAAE,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC3C,iBAAiB,EAAE,CAAC,eAAe,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IACjE,wBAAwB,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;CACxD,CAAC;AAOF;;GAEG;AACH,eAAO,MAAM,2BAA2B,6BAsBvC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,GAAI,UAAU,QAAQ,SAKxD,CAAC;AAEF,eAAe;AACf,eAAO,MAAM,kBAAkB,6BA6B7B,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { ContentSelectorWrapperComponent } from './ContentSelectorWrapper.component';
2
+ export { EditedContentRendererComponent } from './EditedContentRenderer.component';
3
+ export { EditorSelectorRendererComponent } from './EditorSelectorRenderer.component';
4
+ export * from './installIntlayerEditor';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,EAAE,8BAA8B,EAAE,MAAM,mCAAmC,CAAC;AACnF,OAAO,EAAE,+BAA+B,EAAE,MAAM,oCAAoC,CAAC;AACrF,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { Injector } from '@angular/core';
2
+ /**
3
+ * Angular-side replacement for the former <IntlayerEditorProvider> React component.
4
+ *
5
+ * Call **once** in your Angular application's bootstrap function or main module:
6
+ *
7
+ * ```typescript
8
+ * import { bootstrapApplication } from '@angular/platform-browser';
9
+ * import { AppComponent } from './app/app.component';
10
+ * import { installIntlayerEditor } from 'angular-intlayer';
11
+ *
12
+ * bootstrapApplication(AppComponent).then(appRef => {
13
+ * installIntlayerEditor(appRef.injector);
14
+ * });
15
+ * ```
16
+ */
17
+ export declare const installIntlayerEditor: (injector: Injector) => void;
18
+ //# sourceMappingURL=installIntlayerEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"installIntlayerEditor.d.ts","sourceRoot":"","sources":["../../../src/editor/installIntlayerEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAgCzC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,qBAAqB,GAAI,UAAU,QAAQ,KAAG,IAc1D,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { type MessageKey } from '@intlayer/editor';
2
+ /**
3
+ * useCrossFrameMessageListener
4
+ *
5
+ * @template S - type of the message payload
6
+ * @param key message type we care about
7
+ * @param onEventTriggered optional callback when a matching message arrives
8
+ * @returns postMessage(data?) helper scoped to this key
9
+ */
10
+ export declare const useCrossFrameMessageListener: <S>(key: `${MessageKey}` | `${MessageKey}/post` | `${MessageKey}/get`, onEventTriggered?: (data: S) => void) => (data?: S) => void;
11
+ //# sourceMappingURL=useCrossFrameMessageListener.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCrossFrameMessageListener.d.ts","sourceRoot":"","sources":["../../../src/editor/useCrossFrameMessageListener.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,kBAAkB,CAAC;AAsDhE;;;;;;;GAOG;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,aA8BD,CAAC,SAKrC,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { Signal } from '@angular/core';
2
+ import { type MessageKey } from '@intlayer/editor';
3
+ export type CrossFrameStateOptions = {
4
+ /** Whether to broadcast state changes to other instances (default: true) */
5
+ emit?: boolean;
6
+ /** Whether to listen for state updates from other instances (default: true) */
7
+ receive?: boolean;
8
+ };
9
+ /**
10
+ * Angular replacement for Vue's cross-frame state composable.
11
+ * It synchronises a reactive value across frames/windows via the `postMessage` API.
12
+ *
13
+ * @template S The type of the state being synchronised.
14
+ * @param key Unique key identifying this state channel.
15
+ * @param initialState Initial value (or lazy factory) for the state.
16
+ * @param options Control flags for emitting/receiving updates.
17
+ *
18
+ * @returns `[stateSignal, setState, postState]`
19
+ * - `stateSignal` – Angular `Signal<S | undefined>` holding the current state.
20
+ * - `setState` – Setter with the same API as React's `setState`.
21
+ * - `postState` – Manually broadcast the current state (useful after mutations outside `setState`).
22
+ */
23
+ export declare const useCrossFrameState: <S>(key: `${MessageKey}`, initialState?: S | (() => S), options?: CrossFrameStateOptions) => [Signal<S | undefined>, (v: S | ((prev: S | undefined) => S)) => void, () => void];
24
+ //# sourceMappingURL=useCrossFrameState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCrossFrameState.d.ts","sourceRoot":"","sources":["../../../src/editor/useCrossFrameState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAInD,MAAM,MAAM,sBAAsB,GAAG;IACnC,4EAA4E;IAC5E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,+EAA+E;IAC/E,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAkCF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,EAClC,KAAK,GAAG,UAAU,EAAE,EACpB,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAC5B,UAAS,sBAAsD,KAC9D,CACD,MAAM,CAAC,CAAC,GAAG,SAAS,CAAC,EACrB,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,SAAS,KAAK,CAAC,CAAC,KAAK,IAAI,EAC7C,MAAM,IAAI,CAkGX,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { useCrossFrameState } from './useCrossFrameState';
2
+ /**
3
+ * Hook to create and manage a cross-frame synchronized URL path state
4
+ * @param initial - The initial URL path
5
+ * @param opts - Options for controlling emit and receive behavior
6
+ * @returns A tuple containing [state signal, setState function, forceSync function]
7
+ */
8
+ export declare const useCrossURLPathState: (initial?: string, opts?: Parameters<typeof useCrossFrameState>[2]) => [import("@angular/core").Signal<string>, (v: string | ((prev: string) => string)) => void, () => void];
9
+ /**
10
+ * Hook for host applications to push URL path changes into the shared state
11
+ * This also monkey patches history methods to capture navigation events
12
+ * @param initial - The initial URL path
13
+ * @returns A tuple containing [state signal, setState function]
14
+ */
15
+ export declare const useCrossURLPathSetter: (initial?: string) => readonly [import("@angular/core").Signal<string>, (v: string | ((prev: string) => string)) => void];
16
+ //# sourceMappingURL=useCrossURLPathState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCrossURLPathState.d.ts","sourceRoot":"","sources":["../../../src/editor/useCrossURLPathState.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAC/B,UAAU,MAAM,EAChB,OAAO,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC,CAAC,2GAC6B,CAAC;AAE/E;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAAI,UAAU,MAAM,wGAiErD,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { InjectionToken, Signal } from '@angular/core';
2
+ import { type KeyPath } from '@intlayer/core';
3
+ export interface EditedContentActions {
4
+ getEditedContentValue(dictionaryKey: string, keyPath: KeyPath[]): unknown;
5
+ }
6
+ export declare const EDITED_CONTENT_ACTIONS_TOKEN: InjectionToken<EditedContentActions>;
7
+ export declare class EditedContentRendererService {
8
+ /**
9
+ * Mirrors the React hook one-for-one.
10
+ */
11
+ useEditedContentRenderer(dictionaryKey: string, keyPath: KeyPath[], fallback: unknown): Signal<unknown>;
12
+ }
13
+ /**
14
+ * Standalone function that can be used like the Vue composable
15
+ */
16
+ export declare const useEditedContentRenderer: (dictionaryKey: string, keyPath: KeyPath[], fallback: unknown) => Signal<unknown>;
17
+ //# sourceMappingURL=useEditedContentRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useEditedContentRenderer.d.ts","sourceRoot":"","sources":["../../../src/editor/useEditedContentRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,cAAc,EACd,MAAM,EACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,WAAW,oBAAoB;IACnC,qBAAqB,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;CAC3E;AAED,eAAO,MAAM,4BAA4B,sCACgC,CAAC;AAE1E,qBAGa,4BAA4B;IACvC;;OAEG;IACH,wBAAwB,CACtB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,OAAO,EAAE,EAClB,QAAQ,EAAE,OAAO,GAChB,MAAM,CAAC,OAAO,CAAC;CAcnB;AAED;;GAEG;AACH,eAAO,MAAM,wBAAwB,GACnC,eAAe,MAAM,EACrB,SAAS,OAAO,EAAE,EAClB,UAAU,OAAO,KAChB,MAAM,CAAC,OAAO,CAGhB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const useEditor: () => void;
2
+ //# sourceMappingURL=useEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useEditor.d.ts","sourceRoot":"","sources":["../../../src/editor/useEditor.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,SAAS,YASpB,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Hook that intercepts clicks in the iframe and sends them to the parent window
3
+ * This allows the parent window to know when the iframe is clicked
4
+ */
5
+ export declare const useIframeClickInterceptor: () => void;
6
+ /**
7
+ * Hook for the parent window to listen for iframe clicks and merge them
8
+ * This makes iframe clicks behave as if they happened in the parent window
9
+ */
10
+ export declare const useIframeClickMerger: () => void;
11
+ //# sourceMappingURL=useIframeClickInterceptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIframeClickInterceptor.d.ts","sourceRoot":"","sources":["../../../src/editor/useIframeClickInterceptor.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,eAAO,MAAM,yBAAyB,YA4BpC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,oBAAoB,YAO/B,CAAC"}
@@ -1,2 +1,5 @@
1
- export { getDictionary } from './client/getDictionary';
1
+ import type { Locales, LocalesValues } from '@intlayer/config/client';
2
+ import { Dictionary, Plugins } from '@intlayer/core';
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"]>;
2
5
  //# sourceMappingURL=getDictionary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getDictionary.d.ts","sourceRoot":"","sources":["../../src/getDictionary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC"}
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,UAAU,EACV,OAAO,EAER,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,oBAAoB,EAGrB,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,KAYjB,oBAAoB,CAAC,CAAC,CAAC,SAAS,CAAC,CAC9C,CAAC"}
@@ -1,7 +1,5 @@
1
- import type { Locales, LocalesValues } from '@intlayer/config';
2
- import type { Dictionary, Plugins } from '@intlayer/core';
3
- /**
4
- * Function to get the content of a dictionary for Angular applications
5
- */
6
- export declare const getIntlayer: <T extends Dictionary, L extends LocalesValues = Locales>(dictionary: T, locale: L, additionalPlugins?: Plugins[]) => any;
1
+ import { DictionaryKeys, Plugins } from '@intlayer/core';
2
+ import type { IntlayerDictionaryTypesConnector, LocalesValues } from 'intlayer';
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"]>;
7
5
  //# sourceMappingURL=getIntlayer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getIntlayer.d.ts","sourceRoot":"","sources":["../../src/getIntlayer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,WAAW,GACtB,CAAC,SAAS,UAAU,EACpB,CAAC,SAAS,aAAa,GAAG,OAAO,EAEjC,YAAY,CAAC,EACb,QAAQ,CAAC,EACT,oBAAoB,OAAO,EAAE,KAC5B,GAGF,CAAC"}
1
+ {"version":3,"file":"getIntlayer.d.ts","sourceRoot":"","sources":["../../src/getIntlayer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EAEd,OAAO,EACR,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,gCAAgC,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAChF,OAAO,EACL,oBAAoB,EAGrB,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,KAQ0B,oBAAoB,CACzE,gCAAgC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAEjD,CAAC"}
@@ -1,5 +1,2 @@
1
- export declare const renderMarkdown: (content: string) => string;
2
- export declare const MarkdownModule: {
3
- renderMarkdown: (content: string) => string;
4
- };
1
+ export * from './installIntlayerMarkdown';
5
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/markdown/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc,GAAI,SAAS,MAAM,KAAG,MAGhD,CAAC;AAEF,eAAO,MAAM,cAAc;8BALa,MAAM,KAAG,MAAM;CAOtD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/markdown/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { InjectionToken, TemplateRef } from '@angular/core';
2
+ export declare const INTLAYER_MARKDOWN_TOKEN: InjectionToken<IntlayerMarkdownProvider>;
3
+ type RenderMarkdownFunction = (markdown: string) => string | TemplateRef<any>;
4
+ export type IntlayerMarkdownProvider = {
5
+ renderMarkdown: RenderMarkdownFunction;
6
+ };
7
+ /**
8
+ * Create IntlayerMarkdown provider configuration
9
+ */
10
+ export declare const createIntlayerMarkdownProvider: (renderMarkdown?: RenderMarkdownFunction) => {
11
+ provide: InjectionToken<IntlayerMarkdownProvider>;
12
+ useValue: IntlayerMarkdownProvider;
13
+ };
14
+ /**
15
+ * Injectable service for markdown rendering
16
+ */
17
+ export declare class IntlayerMarkdownService {
18
+ private markdownProvider;
19
+ renderMarkdown(markdown: string): string | TemplateRef<any>;
20
+ }
21
+ /**
22
+ * Function to inject markdown provider
23
+ */
24
+ export declare const useMarkdown: () => IntlayerMarkdownProvider;
25
+ export {};
26
+ //# sourceMappingURL=installIntlayerMarkdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"installIntlayerMarkdown.d.ts","sourceRoot":"","sources":["../../../src/markdown/installIntlayerMarkdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEhF,eAAO,MAAM,uBAAuB,0CAC8B,CAAC;AAEnE,KAAK,sBAAsB,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;AAE9E,MAAM,MAAM,wBAAwB,GAAG;IACrC,cAAc,EAAE,sBAAsB,CAAC;CACxC,CAAC;AAQF;;GAEG;AACH,eAAO,MAAM,8BAA8B,GACzC,iBAAgB,sBAAgD;;cAK3D,wBAAwB;CAC7B,CAAC;AAEH;;GAEG;AACH,qBAGa,uBAAuB;IAClC,OAAO,CAAC,gBAAgB,CAErB;IAEH,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC;CAM5D;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,QAAO,wBAU9B,CAAC"}
@@ -1,4 +1,3 @@
1
- import type { TemplateRef } from '@angular/core';
2
1
  import { NodeType, type DeepTransformContent as DeepTransformContentCore, type IInterpreterPluginState as IInterpreterPluginStateCore, type Plugins } from '@intlayer/core';
3
2
  /** ---------------------------------------------
4
3
  * INTLAYER NODE PLUGIN
@@ -11,12 +10,6 @@ export interface IntlayerNode<T, P = {}> {
11
10
  }
12
11
  /** Translation plugin. Replaces node with a locale string if nodeType = Translation. */
13
12
  export declare const intlayerNodePlugins: Plugins;
14
- /** ---------------------------------------------
15
- * ANGULAR TEMPLATE PLUGIN
16
- * --------------------------------------------- */
17
- export type AngularTemplateCond<T> = T extends TemplateRef<any> ? TemplateRef<any> : never;
18
- /** Angular template plugin. Handles Angular TemplateRef objects. */
19
- export declare const angularTemplatePlugin: Plugins;
20
13
  /**
21
14
  * MARKDOWN PLUGIN
22
15
  */
@@ -37,7 +30,6 @@ export declare const markdownPlugin: Plugins;
37
30
  * PLUGINS RESULT
38
31
  * --------------------------------------------- */
39
32
  export interface IInterpreterPluginAngular<T> {
40
- angularTemplate: AngularTemplateCond<T>;
41
33
  intlayerNode: IntlayerNodeCond<T>;
42
34
  markdown: MarkdownCond<T>;
43
35
  }
@@ -47,7 +39,6 @@ export interface IInterpreterPluginAngular<T> {
47
39
  * Otherwise the the `angular-intlayer` plugins will override the types of `intlayer` functions.
48
40
  */
49
41
  export type IInterpreterPluginState = IInterpreterPluginStateCore & {
50
- angularTemplate: true;
51
42
  intlayerNode: true;
52
43
  markdown: true;
53
44
  };
@@ -1 +1 @@
1
- {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAIL,QAAQ,EACR,KAAK,oBAAoB,IAAI,wBAAwB,EACrD,KAAK,uBAAuB,IAAI,2BAA2B,EAC3D,KAAK,OAAO,EACb,MAAM,gBAAgB,CAAC;AAExB;;oDAEoD;AAEpD,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAAG,MAAM,GACvD,YAAY,CAAC,CAAC,CAAC,GACf,KAAK,CAAC;AAEV,MAAM,WAAW,YAAY,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE;IACrC,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,eAAe,CAAC,EAAE,CAAC,CAAC;CACrB;AAED,wFAAwF;AACxF,eAAO,MAAM,mBAAmB,EAAE,OAWjC,CAAC;AAEF;;oDAEoD;AAEpD,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAC/B,CAAC,SAAS,WAAW,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAExD,oEAAoE;AACpE,eAAO,MAAM,qBAAqB,EAAE,OAWnC,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,OAyClC,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;AAEF;;oDAEoD;AAEpD,MAAM,WAAW,yBAAyB,CAAC,CAAC;IAC1C,eAAe,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC;IACxC,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,eAAe,EAAE,IAAI,CAAC;IACtB,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"}
1
+ {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,QAAQ,EACR,KAAK,oBAAoB,IAAI,wBAAwB,EACrD,KAAK,uBAAuB,IAAI,2BAA2B,EAC3D,KAAK,OAAO,EACb,MAAM,gBAAgB,CAAC;AAKxB;;oDAEoD;AAEpD,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAAG,MAAM,GACvD,YAAY,CAAC,CAAC,CAAC,GACf,KAAK,CAAC;AAEV,MAAM,WAAW,YAAY,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE;IACrC,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,eAAe,CAAC,EAAE,CAAC,CAAC;CACrB;AAED,wFAAwF;AACxF,eAAO,MAAM,mBAAmB,EAAE,OAmBjC,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,OAoDlC,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;AAEF;;oDAEoD;AAEpD,MAAM,WAAW,yBAAyB,CAAC,CAAC;IAC1C,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,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,13 @@
1
+ export type IntlayerNode<T = string, AdditionalProps = {}> = any & {
2
+ value: T;
3
+ } & AdditionalProps;
4
+ type RenderIntlayerNodeProps<T> = {
5
+ value: T;
6
+ children: any;
7
+ additionalProps?: {
8
+ [key: string]: any;
9
+ };
10
+ };
11
+ export declare const renderIntlayerNode: <T extends number | string | boolean | undefined | null>({ children, value, additionalProps, }: RenderIntlayerNodeProps<T>) => IntlayerNode<T>;
12
+ export {};
13
+ //# sourceMappingURL=renderIntlayerNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderIntlayerNode.d.ts","sourceRoot":"","sources":["../../src/renderIntlayerNode.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,MAAM,EAAE,eAAe,GAAG,EAAE,IAAI,GAAG,GAAG;IACjE,KAAK,EAAE,CAAC,CAAC;CACV,GAAG,eAAe,CAAC;AAEpB,KAAK,uBAAuB,CAAC,CAAC,IAAI;IAChC,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,GAAG,CAAC;IACd,eAAe,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;CAC1C,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,IAAI,EACtD,uCAIC,uBAAuB,CAAC,CAAC,CAAC,KAAG,YAAY,CAAC,CAAC,CAuC7C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './mergeConfig';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/webpack/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Configuration as WebpackConfig } from '../webpack';
2
+ export declare const mergeConfig: (baseConfig: WebpackConfig) => WebpackConfig;
3
+ //# sourceMappingURL=mergeConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mergeConfig.d.ts","sourceRoot":"","sources":["../../../src/webpack/mergeConfig.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,IAAI,aAAa,EAAE,MAAM,SAAS,CAAC;AAE9D,eAAO,MAAM,WAAW,GAAI,YAAY,aAAa,KAAG,aA+CvD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "angular-intlayer",
3
- "version": "5.5.9",
3
+ "version": "5.5.10",
4
4
  "private": false,
5
5
  "description": "Easily internationalize i18n your Angular applications with type-safe multilingual content management.",
6
6
  "keywords": [
@@ -39,6 +39,11 @@
39
39
  "require": "./dist/cjs/index.cjs",
40
40
  "import": "./dist/esm/index.mjs"
41
41
  },
42
+ "./webpack": {
43
+ "types": "./dist/types/webpack/index.d.ts",
44
+ "require": "./dist/cjs/webpack/index.cjs",
45
+ "import": "./dist/esm/webpack/index.mjs"
46
+ },
42
47
  "./package.json": "./package.json"
43
48
  },
44
49
  "main": "dist/cjs/index.cjs",
@@ -56,12 +61,19 @@
56
61
  "./package.json"
57
62
  ],
58
63
  "dependencies": {
59
- "@intlayer/chokidar": "5.5.9",
60
- "@intlayer/core": "5.5.9",
61
- "@intlayer/config": "5.5.9"
64
+ "deepmerge": "^4.3.1",
65
+ "js-cookie": "^3.0.5",
66
+ "uuid": "^11.1.0",
67
+ "@intlayer/chokidar": "5.5.10",
68
+ "@intlayer/core": "5.5.10",
69
+ "@intlayer/config": "5.5.10",
70
+ "@intlayer/dictionaries-entry": "5.5.10",
71
+ "@intlayer/webpack": "5.5.10",
72
+ "@intlayer/editor": "5.5.10"
62
73
  },
63
74
  "devDependencies": {
64
75
  "@types/node": "^22.15.30",
76
+ "@types/webpack": "^5.28.5",
65
77
  "@typescript-eslint/parser": "^8.33.1",
66
78
  "concurrently": "^9.1.2",
67
79
  "eslint": "^9.28.0",
@@ -71,16 +83,18 @@
71
83
  "tsup": "^8.5.0",
72
84
  "typescript": "^5.8.3",
73
85
  "@utils/eslint-config": "1.0.4",
74
- "@utils/ts-config": "1.0.4",
75
86
  "@utils/ts-config-types": "1.0.4",
87
+ "@utils/ts-config": "1.0.4",
76
88
  "@utils/tsup-config": "1.0.4"
77
89
  },
78
90
  "peerDependencies": {
79
- "@angular/core": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
91
+ "@angular/common": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0",
92
+ "@angular/core": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0",
80
93
  "rxjs": "^6.0.0 || ^7.0.0",
81
- "@intlayer/chokidar": "5.5.9",
82
- "@intlayer/core": "5.5.9",
83
- "@intlayer/config": "5.5.9"
94
+ "@intlayer/config": "5.5.10",
95
+ "@intlayer/chokidar": "5.5.10",
96
+ "@intlayer/dictionaries-entry": "5.5.10",
97
+ "@intlayer/core": "5.5.10"
84
98
  },
85
99
  "engines": {
86
100
  "node": ">=14.18"
@@ -1,70 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var dictionary_service_exports = {};
20
- __export(dictionary_service_exports, {
21
- DictionaryService: () => DictionaryService
22
- });
23
- module.exports = __toCommonJS(dictionary_service_exports);
24
- var import_core = require("@angular/core");
25
- var import_rxjs = require("rxjs");
26
- @((0, import_core.Injectable)({
27
- providedIn: "root"
28
- }))
29
- class DictionaryService {
30
- constructor(localeService) {
31
- this.localeService = localeService;
32
- }
33
- dictionaryCache = /* @__PURE__ */ new Map();
34
- getDictionary(dictionary, locale) {
35
- const targetLocale = locale || this.localeService.currentLocale;
36
- const cacheKey = `${dictionary.id}-${targetLocale}`;
37
- if (this.dictionaryCache.has(cacheKey)) {
38
- return this.dictionaryCache.get(cacheKey);
39
- }
40
- const result = dictionary.content || dictionary;
41
- this.dictionaryCache.set(cacheKey, result);
42
- return result;
43
- }
44
- getDictionary$(dictionary) {
45
- return this.localeService.locale$.pipe(
46
- (0, import_rxjs.map)((locale) => this.getDictionary(dictionary, locale))
47
- );
48
- }
49
- getDictionaries$(dictionaries) {
50
- return this.localeService.locale$.pipe(
51
- (0, import_rxjs.map)(
52
- (locale) => dictionaries.map((dict) => this.getDictionary(dict, locale))
53
- )
54
- );
55
- }
56
- clearCache() {
57
- this.dictionaryCache.clear();
58
- }
59
- clearCacheForDictionary(dictionaryId) {
60
- const keysToDelete = Array.from(this.dictionaryCache.keys()).filter(
61
- (key) => key.startsWith(`${dictionaryId}-`)
62
- );
63
- keysToDelete.forEach((key) => this.dictionaryCache.delete(key));
64
- }
65
- }
66
- // Annotate the CommonJS export names for ESM import in node:
67
- 0 && (module.exports = {
68
- DictionaryService
69
- });
70
- //# sourceMappingURL=dictionary.service.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/client/dictionary.service.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport type { Locales } from '@intlayer/config';\nimport type { Dictionary } from '@intlayer/core';\nimport { Observable, map } from 'rxjs';\nimport { LocaleService } from './locale.service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DictionaryService {\n private dictionaryCache = new Map<string, any>();\n\n constructor(private localeService: LocaleService) {}\n\n getDictionary<T extends Dictionary & { id: string }>(\n dictionary: T,\n locale?: Locales\n ): any {\n const targetLocale = locale || this.localeService.currentLocale;\n const cacheKey = `${dictionary.id}-${targetLocale}`;\n\n if (this.dictionaryCache.has(cacheKey)) {\n return this.dictionaryCache.get(cacheKey);\n }\n\n // Use a simpler approach to avoid type complexity\n const result = dictionary.content || dictionary;\n this.dictionaryCache.set(cacheKey, result);\n\n return result;\n }\n\n getDictionary$<T extends Dictionary & { id: string }>(\n dictionary: T\n ): Observable<any> {\n return this.localeService.locale$.pipe(\n map((locale) => this.getDictionary(dictionary, locale))\n );\n }\n\n getDictionaries$(\n dictionaries: (Dictionary & { id: string })[]\n ): Observable<any[]> {\n return this.localeService.locale$.pipe(\n map((locale) =>\n dictionaries.map((dict) => this.getDictionary(dict, locale))\n )\n );\n }\n\n clearCache(): void {\n this.dictionaryCache.clear();\n }\n\n clearCacheForDictionary(dictionaryId: string): void {\n const keysToDelete = Array.from(this.dictionaryCache.keys()).filter((key) =>\n key.startsWith(`${dictionaryId}-`)\n );\n\n keysToDelete.forEach((key) => this.dictionaryCache.delete(key));\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA2B;AAG3B,kBAAgC;AAGhC,MAAC,wBAAW;AAAA,EACV,YAAY;AACd,CAAC;AACM,MAAM,kBAAkB;AAAA,EAG7B,YAAoB,eAA8B;AAA9B;AAAA,EAA+B;AAAA,EAF3C,kBAAkB,oBAAI,IAAiB;AAAA,EAI/C,cACE,YACA,QACK;AACL,UAAM,eAAe,UAAU,KAAK,cAAc;AAClD,UAAM,WAAW,GAAG,WAAW,EAAE,IAAI,YAAY;AAEjD,QAAI,KAAK,gBAAgB,IAAI,QAAQ,GAAG;AACtC,aAAO,KAAK,gBAAgB,IAAI,QAAQ;AAAA,IAC1C;AAGA,UAAM,SAAS,WAAW,WAAW;AACrC,SAAK,gBAAgB,IAAI,UAAU,MAAM;AAEzC,WAAO;AAAA,EACT;AAAA,EAEA,eACE,YACiB;AACjB,WAAO,KAAK,cAAc,QAAQ;AAAA,UAChC,iBAAI,CAAC,WAAW,KAAK,cAAc,YAAY,MAAM,CAAC;AAAA,IACxD;AAAA,EACF;AAAA,EAEA,iBACE,cACmB;AACnB,WAAO,KAAK,cAAc,QAAQ;AAAA,UAChC;AAAA,QAAI,CAAC,WACH,aAAa,IAAI,CAAC,SAAS,KAAK,cAAc,MAAM,MAAM,CAAC;AAAA,MAC7D;AAAA,IACF;AAAA,EACF;AAAA,EAEA,aAAmB;AACjB,SAAK,gBAAgB,MAAM;AAAA,EAC7B;AAAA,EAEA,wBAAwB,cAA4B;AAClD,UAAM,eAAe,MAAM,KAAK,KAAK,gBAAgB,KAAK,CAAC,EAAE;AAAA,MAAO,CAAC,QACnE,IAAI,WAAW,GAAG,YAAY,GAAG;AAAA,IACnC;AAEA,iBAAa,QAAQ,CAAC,QAAQ,KAAK,gBAAgB,OAAO,GAAG,CAAC;AAAA,EAChE;AACF;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/client/getBrowserLocale.ts"],"sourcesContent":["import { Locales } from '@intlayer/config';\n\n/**\n * Get the locale from the browser\n */\nexport const getBrowserLocale = (): Locales | undefined => {\n if (typeof window !== 'undefined' && window.navigator) {\n return window.navigator.language.split('-')[0] as Locales;\n }\n return undefined;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKO,MAAM,mBAAmB,MAA2B;AACzD,MAAI,OAAO,WAAW,eAAe,OAAO,WAAW;AACrD,WAAO,OAAO,UAAU,SAAS,MAAM,GAAG,EAAE,CAAC;AAAA,EAC/C;AACA,SAAO;AACT;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/client/getDictionary.ts"],"sourcesContent":["import type { Locales, LocalesValues } from '@intlayer/config';\nimport {\n type Dictionary,\n type Plugins,\n getDictionary as getDictionaryCore,\n} from '@intlayer/core';\nimport {\n type DeepTransformContent,\n angularTemplatePlugin,\n intlayerNodePlugins,\n markdownPlugin,\n} from '../plugins';\n\n/**\n * Get dictionary content for a specific locale\n */\nexport const getDictionary = <\n T extends Dictionary,\n L extends LocalesValues = Locales,\n>(\n dictionary: T,\n locale?: L,\n additionalPlugins?: Plugins[]\n) => {\n const plugins: Plugins[] = [\n intlayerNodePlugins,\n angularTemplatePlugin,\n markdownPlugin,\n ...(additionalPlugins ?? []),\n ];\n\n return getDictionaryCore(\n dictionary,\n locale,\n plugins\n ) as any as DeepTransformContent<T['content']>;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAIO;AACP,qBAKO;AAKA,MAAM,gBAAgB,CAI3B,YACA,QACA,sBACG;AACH,QAAM,UAAqB;AAAA,IACzB;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAI,qBAAqB,CAAC;AAAA,EAC5B;AAEA,aAAO,YAAAA;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["getDictionaryCore"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/client/getLocale.ts"],"sourcesContent":["import type { Locales } from '@intlayer/config';\n\n/**\n * Get the current locale\n * This is a basic implementation that can be extended with Angular services\n */\nexport const getLocale = (): Locales => {\n // This is a placeholder implementation\n // In a real Angular app, this would likely use a service or injection\n return 'en' as Locales;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMO,MAAM,YAAY,MAAe;AAGtC,SAAO;AACT;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/client/intlayer.service.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport type { Locales } from '@intlayer/config';\nimport { BehaviorSubject } from 'rxjs';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class IntlayerService {\n private localeSubject = new BehaviorSubject<Locales>('en' as Locales);\n public locale$ = this.localeSubject.asObservable();\n\n get currentLocale(): Locales {\n return this.localeSubject.value;\n }\n\n setLocale(locale: Locales): void {\n this.localeSubject.next(locale);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA2B;AAE3B,kBAAgC;AAEhC,MAAC,wBAAW;AAAA,EACV,YAAY;AACd,CAAC;AACM,MAAM,gBAAgB;AAAA,EACnB,gBAAgB,IAAI,4BAAyB,IAAe;AAAA,EAC7D,UAAU,KAAK,cAAc,aAAa;AAAA,EAEjD,IAAI,gBAAyB;AAC3B,WAAO,KAAK,cAAc;AAAA,EAC5B;AAAA,EAEA,UAAU,QAAuB;AAC/B,SAAK,cAAc,KAAK,MAAM;AAAA,EAChC;AACF;","names":[]}
@@ -1,66 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var locale_service_exports = {};
20
- __export(locale_service_exports, {
21
- LocaleService: () => LocaleService
22
- });
23
- module.exports = __toCommonJS(locale_service_exports);
24
- var import_core = require("@angular/core");
25
- var import_rxjs = require("rxjs");
26
- var import_getBrowserLocale = require('./getBrowserLocale.cjs');
27
- @((0, import_core.Injectable)({
28
- providedIn: "root"
29
- }))
30
- class LocaleService {
31
- localeSubject = new import_rxjs.BehaviorSubject(
32
- (0, import_getBrowserLocale.getBrowserLocale)() || "en"
33
- );
34
- locale$ = this.localeSubject.asObservable();
35
- constructor() {
36
- const browserLocale = (0, import_getBrowserLocale.getBrowserLocale)();
37
- if (browserLocale) {
38
- this.setLocale(browserLocale);
39
- }
40
- }
41
- get currentLocale() {
42
- return this.localeSubject.value;
43
- }
44
- setLocale(locale) {
45
- this.localeSubject.next(locale);
46
- if (typeof localStorage !== "undefined") {
47
- localStorage.setItem("intlayer-locale", locale);
48
- }
49
- }
50
- getStoredLocale() {
51
- if (typeof localStorage !== "undefined") {
52
- return localStorage.getItem("intlayer-locale");
53
- }
54
- return null;
55
- }
56
- clearStoredLocale() {
57
- if (typeof localStorage !== "undefined") {
58
- localStorage.removeItem("intlayer-locale");
59
- }
60
- }
61
- }
62
- // Annotate the CommonJS export names for ESM import in node:
63
- 0 && (module.exports = {
64
- LocaleService
65
- });
66
- //# sourceMappingURL=locale.service.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/client/locale.service.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport type { Locales } from '@intlayer/config';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { getBrowserLocale } from './getBrowserLocale';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class LocaleService {\n private localeSubject = new BehaviorSubject<Locales>(\n getBrowserLocale() || ('en' as Locales)\n );\n\n public locale$: Observable<Locales> = this.localeSubject.asObservable();\n\n constructor() {\n // Initialize with browser locale if available\n const browserLocale = getBrowserLocale();\n if (browserLocale) {\n this.setLocale(browserLocale);\n }\n }\n\n get currentLocale(): Locales {\n return this.localeSubject.value;\n }\n\n setLocale(locale: Locales): void {\n this.localeSubject.next(locale);\n\n // Optionally store in localStorage for persistence\n if (typeof localStorage !== 'undefined') {\n localStorage.setItem('intlayer-locale', locale);\n }\n }\n\n getStoredLocale(): Locales | null {\n if (typeof localStorage !== 'undefined') {\n return localStorage.getItem('intlayer-locale') as Locales;\n }\n return null;\n }\n\n clearStoredLocale(): void {\n if (typeof localStorage !== 'undefined') {\n localStorage.removeItem('intlayer-locale');\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA2B;AAE3B,kBAA4C;AAC5C,8BAAiC;AAEjC,MAAC,wBAAW;AAAA,EACV,YAAY;AACd,CAAC;AACM,MAAM,cAAc;AAAA,EACjB,gBAAgB,IAAI;AAAA,QAC1B,0CAAiB,KAAM;AAAA,EACzB;AAAA,EAEO,UAA+B,KAAK,cAAc,aAAa;AAAA,EAEtE,cAAc;AAEZ,UAAM,oBAAgB,0CAAiB;AACvC,QAAI,eAAe;AACjB,WAAK,UAAU,aAAa;AAAA,IAC9B;AAAA,EACF;AAAA,EAEA,IAAI,gBAAyB;AAC3B,WAAO,KAAK,cAAc;AAAA,EAC5B;AAAA,EAEA,UAAU,QAAuB;AAC/B,SAAK,cAAc,KAAK,MAAM;AAG9B,QAAI,OAAO,iBAAiB,aAAa;AACvC,mBAAa,QAAQ,mBAAmB,MAAM;AAAA,IAChD;AAAA,EACF;AAAA,EAEA,kBAAkC;AAChC,QAAI,OAAO,iBAAiB,aAAa;AACvC,aAAO,aAAa,QAAQ,iBAAiB;AAAA,IAC/C;AACA,WAAO;AAAA,EACT;AAAA,EAEA,oBAA0B;AACxB,QAAI,OAAO,iBAAiB,aAAa;AACvC,mBAAa,WAAW,iBAAiB;AAAA,IAC3C;AAAA,EACF;AACF;","names":[]}