angular-intlayer 8.5.0 → 8.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/dist/cjs/@intlayer/editor/src/isEnabled.cjs +1 -1
  2. package/dist/cjs/@intlayer/editor/src/isEnabled.cjs.map +1 -1
  3. package/dist/cjs/UI/IntlayerNode.component.cjs +53 -0
  4. package/dist/cjs/UI/IntlayerNode.component.cjs.map +1 -0
  5. package/dist/cjs/UI/index.cjs +9 -0
  6. package/dist/cjs/client/index.cjs +4 -10
  7. package/dist/cjs/client/installIntlayer.cjs +19 -48
  8. package/dist/cjs/client/installIntlayer.cjs.map +1 -1
  9. package/dist/cjs/client/intlayerToken.cjs +36 -0
  10. package/dist/cjs/client/intlayerToken.cjs.map +1 -0
  11. package/dist/cjs/client/useDictionary.cjs +2 -2
  12. package/dist/cjs/client/useDictionary.cjs.map +1 -1
  13. package/dist/cjs/client/useDictionaryAsync.cjs +2 -2
  14. package/dist/cjs/client/useDictionaryAsync.cjs.map +1 -1
  15. package/dist/cjs/client/useDictionaryDynamic.cjs +2 -2
  16. package/dist/cjs/client/useDictionaryDynamic.cjs.map +1 -1
  17. package/dist/cjs/client/useIntlayer.cjs +2 -2
  18. package/dist/cjs/client/useIntlayer.cjs.map +1 -1
  19. package/dist/cjs/client/useLocale.cjs +2 -2
  20. package/dist/cjs/client/useLocale.cjs.map +1 -1
  21. package/dist/cjs/editor/EditorProvider.component.cjs +27 -0
  22. package/dist/cjs/editor/EditorProvider.component.cjs.map +1 -0
  23. package/dist/cjs/editor/index.cjs +19 -0
  24. package/dist/cjs/editor/useEditor.cjs +47 -12
  25. package/dist/cjs/editor/useEditor.cjs.map +1 -1
  26. package/dist/cjs/format/index.cjs +20 -0
  27. package/dist/cjs/format/useCompact.cjs +18 -0
  28. package/dist/cjs/format/useCompact.cjs.map +1 -0
  29. package/dist/cjs/format/useCurrency.cjs +18 -0
  30. package/dist/cjs/format/useCurrency.cjs.map +1 -0
  31. package/dist/cjs/format/useDate.cjs +28 -0
  32. package/dist/cjs/format/useDate.cjs.map +1 -0
  33. package/dist/cjs/format/useIntl.cjs +20 -0
  34. package/dist/cjs/format/useIntl.cjs.map +1 -0
  35. package/dist/cjs/format/useList.cjs +18 -0
  36. package/dist/cjs/format/useList.cjs.map +1 -0
  37. package/dist/cjs/format/useNumber.cjs +21 -0
  38. package/dist/cjs/format/useNumber.cjs.map +1 -0
  39. package/dist/cjs/format/usePercentage.cjs +18 -0
  40. package/dist/cjs/format/usePercentage.cjs.map +1 -0
  41. package/dist/cjs/format/useRelativeTime.cjs +18 -0
  42. package/dist/cjs/format/useRelativeTime.cjs.map +1 -0
  43. package/dist/cjs/format/useUnit.cjs +18 -0
  44. package/dist/cjs/format/useUnit.cjs.map +1 -0
  45. package/dist/cjs/index.cjs +7 -6
  46. package/dist/cjs/renderIntlayerNode.cjs +2 -1
  47. package/dist/cjs/renderIntlayerNode.cjs.map +1 -1
  48. package/dist/esm/@intlayer/editor/src/isEnabled.mjs +1 -1
  49. package/dist/esm/@intlayer/editor/src/isEnabled.mjs.map +1 -1
  50. package/dist/esm/UI/IntlayerNode.component.mjs +46 -0
  51. package/dist/esm/UI/IntlayerNode.component.mjs.map +1 -0
  52. package/dist/esm/UI/index.mjs +3 -0
  53. package/dist/esm/client/index.mjs +3 -3
  54. package/dist/esm/client/installIntlayer.mjs +15 -37
  55. package/dist/esm/client/installIntlayer.mjs.map +1 -1
  56. package/dist/esm/client/intlayerToken.mjs +31 -0
  57. package/dist/esm/client/intlayerToken.mjs.map +1 -0
  58. package/dist/esm/client/useDictionary.mjs +1 -1
  59. package/dist/esm/client/useDictionary.mjs.map +1 -1
  60. package/dist/esm/client/useDictionaryAsync.mjs +1 -1
  61. package/dist/esm/client/useDictionaryAsync.mjs.map +1 -1
  62. package/dist/esm/client/useDictionaryDynamic.mjs +1 -1
  63. package/dist/esm/client/useDictionaryDynamic.mjs.map +1 -1
  64. package/dist/esm/client/useIntlayer.mjs +1 -1
  65. package/dist/esm/client/useIntlayer.mjs.map +1 -1
  66. package/dist/esm/client/useLocale.mjs +1 -1
  67. package/dist/esm/editor/EditorProvider.component.mjs +20 -0
  68. package/dist/esm/editor/EditorProvider.component.mjs.map +1 -0
  69. package/dist/esm/editor/index.mjs +5 -0
  70. package/dist/esm/editor/useEditor.mjs +48 -14
  71. package/dist/esm/editor/useEditor.mjs.map +1 -1
  72. package/dist/esm/format/index.mjs +11 -0
  73. package/dist/esm/format/useCompact.mjs +16 -0
  74. package/dist/esm/format/useCompact.mjs.map +1 -0
  75. package/dist/esm/format/useCurrency.mjs +16 -0
  76. package/dist/esm/format/useCurrency.mjs.map +1 -0
  77. package/dist/esm/format/useDate.mjs +26 -0
  78. package/dist/esm/format/useDate.mjs.map +1 -0
  79. package/dist/esm/format/useIntl.mjs +18 -0
  80. package/dist/esm/format/useIntl.mjs.map +1 -0
  81. package/dist/esm/format/useList.mjs +16 -0
  82. package/dist/esm/format/useList.mjs.map +1 -0
  83. package/dist/esm/format/useNumber.mjs +19 -0
  84. package/dist/esm/format/useNumber.mjs.map +1 -0
  85. package/dist/esm/format/usePercentage.mjs +16 -0
  86. package/dist/esm/format/usePercentage.mjs.map +1 -0
  87. package/dist/esm/format/useRelativeTime.mjs +16 -0
  88. package/dist/esm/format/useRelativeTime.mjs.map +1 -0
  89. package/dist/esm/format/useUnit.mjs +16 -0
  90. package/dist/esm/format/useUnit.mjs.map +1 -0
  91. package/dist/esm/index.mjs +4 -3
  92. package/dist/esm/renderIntlayerNode.mjs +2 -1
  93. package/dist/esm/renderIntlayerNode.mjs.map +1 -1
  94. package/dist/types/UI/IntlayerNode.component.d.ts +27 -0
  95. package/dist/types/UI/IntlayerNode.component.d.ts.map +1 -0
  96. package/dist/types/UI/index.d.ts +2 -0
  97. package/dist/types/client/index.d.ts +3 -3
  98. package/dist/types/client/installIntlayer.d.ts +10 -21
  99. package/dist/types/client/installIntlayer.d.ts.map +1 -1
  100. package/dist/types/client/intlayerToken.d.ts +19 -0
  101. package/dist/types/client/intlayerToken.d.ts.map +1 -0
  102. package/dist/types/client/useDictionaryAsync.d.ts.map +1 -1
  103. package/dist/types/client/useDictionaryDynamic.d.ts.map +1 -1
  104. package/dist/types/client/useIntlayer.d.ts.map +1 -1
  105. package/dist/types/editor/EditorProvider.component.d.ts +33 -0
  106. package/dist/types/editor/EditorProvider.component.d.ts.map +1 -0
  107. package/dist/types/editor/index.d.ts +4 -0
  108. package/dist/types/editor/useEditor.d.ts +35 -2
  109. package/dist/types/editor/useEditor.d.ts.map +1 -1
  110. package/dist/types/format/index.d.ts +10 -0
  111. package/dist/types/format/useCompact.d.ts +10 -0
  112. package/dist/types/format/useCompact.d.ts.map +1 -0
  113. package/dist/types/format/useCurrency.d.ts +10 -0
  114. package/dist/types/format/useCurrency.d.ts.map +1 -0
  115. package/dist/types/format/useDate.d.ts +14 -0
  116. package/dist/types/format/useDate.d.ts.map +1 -0
  117. package/dist/types/format/useIntl.d.ts +12 -0
  118. package/dist/types/format/useIntl.d.ts.map +1 -0
  119. package/dist/types/format/useList.d.ts +14 -0
  120. package/dist/types/format/useList.d.ts.map +1 -0
  121. package/dist/types/format/useNumber.d.ts +13 -0
  122. package/dist/types/format/useNumber.d.ts.map +1 -0
  123. package/dist/types/format/usePercentage.d.ts +10 -0
  124. package/dist/types/format/usePercentage.d.ts.map +1 -0
  125. package/dist/types/format/useRelativeTime.d.ts +11 -0
  126. package/dist/types/format/useRelativeTime.d.ts.map +1 -0
  127. package/dist/types/format/useUnit.d.ts +10 -0
  128. package/dist/types/format/useUnit.d.ts.map +1 -0
  129. package/dist/types/index.d.ts +4 -3
  130. package/dist/types/index.d.ts.map +1 -1
  131. package/package.json +32 -8
  132. package/dist/cjs/client/useIntl.cjs +0 -41
  133. package/dist/cjs/client/useIntl.cjs.map +0 -1
  134. package/dist/esm/client/useIntl.mjs +0 -39
  135. package/dist/esm/client/useIntl.mjs.map +0 -1
  136. package/dist/types/client/useIntl.d.ts +0 -33
  137. package/dist/types/client/useIntl.d.ts.map +0 -1
@@ -0,0 +1,33 @@
1
+ //#region src/editor/EditorProvider.component.d.ts
2
+ /**
3
+ * Drop-in Angular equivalent of React's `EditorProvider`.
4
+ *
5
+ * Wrap your root component (or any subtree) with this component to automatically
6
+ * start the Intlayer editor client. The editor will be started on mount and
7
+ * stopped when this component is destroyed.
8
+ *
9
+ * @example
10
+ * ```html
11
+ * <!-- app.component.html -->
12
+ * <intlayer-editor-provider>
13
+ * <router-outlet />
14
+ * </intlayer-editor-provider>
15
+ * ```
16
+ *
17
+ * ```ts
18
+ * // app.component.ts
19
+ * import { EditorProviderComponent } from 'angular-intlayer';
20
+ *
21
+ * @Component({
22
+ * imports: [EditorProviderComponent],
23
+ * …
24
+ * })
25
+ * export class AppComponent {}
26
+ * ```
27
+ */
28
+ declare class EditorProviderComponent {
29
+ constructor();
30
+ }
31
+ //#endregion
32
+ export { EditorProviderComponent };
33
+ //# sourceMappingURL=EditorProvider.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorProvider.component.d.ts","names":[],"sources":["../../../src/editor/EditorProvider.component.ts"],"mappings":";;AA6BA;;;;;;;;;;;;;;;;;;;;;;;;;cAKa,uBAAA;EAAuB,WAAA,CAAA;AAAA"}
@@ -0,0 +1,4 @@
1
+ import { ContentSelectorWrapperComponent } from "./ContentSelector.component.js";
2
+ import { EditorProviderComponent } from "./EditorProvider.component.js";
3
+ import { provideIntlayerEditor, useEditor } from "./useEditor.js";
4
+ export { ContentSelectorWrapperComponent, EditorProviderComponent, provideIntlayerEditor, useEditor };
@@ -1,5 +1,38 @@
1
+ import { IntlayerProvider } from "../client/intlayerToken.js";
2
+ import * as _angular_core0 from "@angular/core";
3
+
1
4
  //#region src/editor/useEditor.d.ts
2
- declare const useEditor: () => void;
5
+ /**
6
+ * Initialises the Intlayer editor client singleton when the editor is enabled.
7
+ * Syncs the current locale from the provided Intlayer client into the editor
8
+ * manager so the editor always knows which locale the app is displaying.
9
+ *
10
+ * Must be called inside an Angular injection context (e.g. a component
11
+ * constructor, `provideAppInitializer`, or `runInInjectionContext`).
12
+ *
13
+ * @param client - The IntlayerProvider instance to sync locale from.
14
+ * When omitted the function injects `INTLAYER_TOKEN` from the DI tree,
15
+ * so it still works when called directly from a component.
16
+ */
17
+ declare const useEditor: (client?: IntlayerProvider | null) => void;
18
+ /**
19
+ * Angular provider that wires `useEditor` into the application initialisation
20
+ * phase via `provideAppInitializer`.
21
+ *
22
+ * `provideIntlayer()` already calls this internally, so you only need this
23
+ * function when you want to manage providers individually.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * // app.config.ts
28
+ * import { provideIntlayer, provideIntlayerEditor } from 'angular-intlayer';
29
+ *
30
+ * export const appConfig: ApplicationConfig = {
31
+ * providers: [provideIntlayer(), provideIntlayerEditor()],
32
+ * };
33
+ * ```
34
+ */
35
+ declare const provideIntlayerEditor: (client?: IntlayerProvider | null) => _angular_core0.EnvironmentProviders;
3
36
  //#endregion
4
- export { useEditor };
37
+ export { provideIntlayerEditor, useEditor };
5
38
  //# sourceMappingURL=useEditor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useEditor.d.ts","names":[],"sources":["../../../src/editor/useEditor.ts"],"mappings":";cAWa,SAAA"}
1
+ {"version":3,"file":"useEditor.d.ts","names":[],"sources":["../../../src/editor/useEditor.ts"],"mappings":";;;;;;;AA4BA;;;;;AA6DA;;;;cA7Da,SAAA,GAAa,MAAA,GAAS,gBAAA;;;;;;;;;;;;;;;;;;cA6DtB,qBAAA,GAAyB,MAAA,GAAS,gBAAA,YAAgB,cAAA,CAAO,oBAAA"}
@@ -0,0 +1,10 @@
1
+ import { useCompact } from "./useCompact.js";
2
+ import { useCurrency } from "./useCurrency.js";
3
+ import { useDate } from "./useDate.js";
4
+ import { useIntl } from "./useIntl.js";
5
+ import { useList } from "./useList.js";
6
+ import { useNumber } from "./useNumber.js";
7
+ import { usePercentage } from "./usePercentage.js";
8
+ import { useRelativeTime } from "./useRelativeTime.js";
9
+ import { useUnit } from "./useUnit.js";
10
+ export { useCompact, useCurrency, useDate, useIntl, useList, useNumber, usePercentage, useRelativeTime, useUnit };
@@ -0,0 +1,10 @@
1
+ import * as _angular_core0 from "@angular/core";
2
+ import * as _intlayer_types_module_augmentation0 from "@intlayer/types/module_augmentation";
3
+
4
+ //#region src/format/useCompact.d.ts
5
+ declare const useCompact: () => _angular_core0.Signal<(value: string | number, options?: Intl.NumberFormatOptions & {
6
+ locale?: _intlayer_types_module_augmentation0.LocalesValues;
7
+ }) => string>;
8
+ //#endregion
9
+ export { useCompact };
10
+ //# sourceMappingURL=useCompact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCompact.d.ts","names":[],"sources":["../../../src/format/useCompact.ts"],"mappings":";;;;cAIa,UAAA,uBAAU,MAAA,EAAA,KAAA,mBAAA,OAAA,GAAA,IAAA,CAAA,mBAAA;WAAA,oCAAA,CAAA,aAAA;AAAA"}
@@ -0,0 +1,10 @@
1
+ import * as _angular_core0 from "@angular/core";
2
+ import * as _intlayer_types_module_augmentation0 from "@intlayer/types/module_augmentation";
3
+
4
+ //#region src/format/useCurrency.d.ts
5
+ declare const useCurrency: () => _angular_core0.Signal<(value: string | number, options?: Intl.NumberFormatOptions & {
6
+ locale?: _intlayer_types_module_augmentation0.LocalesValues;
7
+ }) => string>;
8
+ //#endregion
9
+ export { useCurrency };
10
+ //# sourceMappingURL=useCurrency.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCurrency.d.ts","names":[],"sources":["../../../src/format/useCurrency.ts"],"mappings":";;;;cAIa,WAAA,uBAAW,MAAA,EAAA,KAAA,mBAAA,OAAA,GAAA,IAAA,CAAA,mBAAA;WAAA,oCAAA,CAAA,aAAA;AAAA"}
@@ -0,0 +1,14 @@
1
+ import * as _angular_core0 from "@angular/core";
2
+ import * as _intlayer_types_module_augmentation0 from "@intlayer/types/module_augmentation";
3
+ import * as _intlayer_core_formatters0 from "@intlayer/core/formatters";
4
+
5
+ //#region src/format/useDate.d.ts
6
+ /**
7
+ * Angular client hook that provides a localized date/time formatter.
8
+ */
9
+ declare const useDate: () => _angular_core0.Signal<(date: string | number | Date, options?: (Intl.DateTimeFormatOptions & {
10
+ locale?: _intlayer_types_module_augmentation0.LocalesValues;
11
+ }) | _intlayer_core_formatters0.DateTimePreset) => string>;
12
+ //#endregion
13
+ export { useDate };
14
+ //# sourceMappingURL=useDate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDate.d.ts","names":[],"sources":["../../../src/format/useDate.ts"],"mappings":";;;;;;;;cAOa,OAAA,uBAAO,MAAA,EAAA,IAAA,oBAAA,IAAA,EAAA,OAAA,IAAA,IAAA,CAAA,qBAAA;WAAA,oCAAA,CAAA,aAAA;AAAA"}
@@ -0,0 +1,12 @@
1
+ import * as _angular_core0 from "@angular/core";
2
+ import { LocalesValues } from "@intlayer/types/module_augmentation";
3
+ import { WrappedIntl } from "@intlayer/core/formatters";
4
+
5
+ //#region src/format/useIntl.d.ts
6
+ /**
7
+ * Angular composable that provides a locale-bound `Intl` object as a Signal.
8
+ */
9
+ declare const useIntl: (locale?: LocalesValues) => _angular_core0.Signal<WrappedIntl>;
10
+ //#endregion
11
+ export { useIntl };
12
+ //# sourceMappingURL=useIntl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIntl.d.ts","names":[],"sources":["../../../src/format/useIntl.ts"],"mappings":";;;;;;;;cAQa,OAAA,GAAW,MAAA,GAAS,aAAA,KAAa,cAAA,CAAA,MAAA,CAAA,WAAA"}
@@ -0,0 +1,14 @@
1
+ import * as _angular_core0 from "@angular/core";
2
+ import * as _intlayer_types_module_augmentation0 from "@intlayer/types/module_augmentation";
3
+
4
+ //#region src/format/useList.d.ts
5
+ declare const useList: () => _angular_core0.Signal<(values: (string | number)[], options?: {
6
+ localeMatcher?: "lookup" | "best fit";
7
+ type?: "conjunction" | "disjunction" | "unit";
8
+ style?: "long" | "short" | "narrow";
9
+ } & {
10
+ locale?: _intlayer_types_module_augmentation0.LocalesValues;
11
+ }) => string>;
12
+ //#endregion
13
+ export { useList };
14
+ //# sourceMappingURL=useList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useList.d.ts","names":[],"sources":["../../../src/format/useList.ts"],"mappings":";;;;cAIa,OAAA,QAWZ,cAAA,CAXmB,MAAA,EAAA,MAAA,uBAAA,OAAA;;;;;WAWnB,oCAAA,CAAA,aAAA;AAAA"}
@@ -0,0 +1,13 @@
1
+ import * as _angular_core0 from "@angular/core";
2
+ import * as _intlayer_types_module_augmentation0 from "@intlayer/types/module_augmentation";
3
+
4
+ //#region src/format/useNumber.d.ts
5
+ /**
6
+ * Angular client hook that provides a localized number formatter.
7
+ */
8
+ declare const useNumber: () => _angular_core0.Signal<(value: string | number, options?: Intl.NumberFormatOptions & {
9
+ locale?: _intlayer_types_module_augmentation0.LocalesValues;
10
+ }) => string>;
11
+ //#endregion
12
+ export { useNumber };
13
+ //# sourceMappingURL=useNumber.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useNumber.d.ts","names":[],"sources":["../../../src/format/useNumber.ts"],"mappings":";;;;;;;cAOa,SAAA,uBAAS,MAAA,EAAA,KAAA,mBAAA,OAAA,GAAA,IAAA,CAAA,mBAAA;WAAA,oCAAA,CAAA,aAAA;AAAA"}
@@ -0,0 +1,10 @@
1
+ import * as _angular_core0 from "@angular/core";
2
+ import * as _intlayer_types_module_augmentation0 from "@intlayer/types/module_augmentation";
3
+
4
+ //#region src/format/usePercentage.d.ts
5
+ declare const usePercentage: () => _angular_core0.Signal<(value: string | number, options?: Intl.NumberFormatOptions & {
6
+ locale?: _intlayer_types_module_augmentation0.LocalesValues;
7
+ }) => string>;
8
+ //#endregion
9
+ export { usePercentage };
10
+ //# sourceMappingURL=usePercentage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePercentage.d.ts","names":[],"sources":["../../../src/format/usePercentage.ts"],"mappings":";;;;cAIa,aAAA,uBAAa,MAAA,EAAA,KAAA,mBAAA,OAAA,GAAA,IAAA,CAAA,mBAAA;WAAA,oCAAA,CAAA,aAAA;AAAA"}
@@ -0,0 +1,11 @@
1
+ import * as _angular_core0 from "@angular/core";
2
+ import * as _intlayer_types_module_augmentation0 from "@intlayer/types/module_augmentation";
3
+
4
+ //#region src/format/useRelativeTime.d.ts
5
+ declare const useRelativeTime: () => _angular_core0.Signal<(from: string | number | Date, to?: string | number | Date, options?: Intl.RelativeTimeFormatOptions & {
6
+ locale?: _intlayer_types_module_augmentation0.LocalesValues;
7
+ unit?: Intl.RelativeTimeFormatUnit;
8
+ }) => string>;
9
+ //#endregion
10
+ export { useRelativeTime };
11
+ //# sourceMappingURL=useRelativeTime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRelativeTime.d.ts","names":[],"sources":["../../../src/format/useRelativeTime.ts"],"mappings":";;;;cAIa,eAAA,uBAAe,MAAA,EAAA,IAAA,oBAAA,IAAA,EAAA,EAAA,qBAAA,IAAA,EAAA,OAAA,GAAA,IAAA,CAAA,yBAAA;WAAA,oCAAA,CAAA,aAAA"}
@@ -0,0 +1,10 @@
1
+ import * as _angular_core0 from "@angular/core";
2
+ import * as _intlayer_types_module_augmentation0 from "@intlayer/types/module_augmentation";
3
+
4
+ //#region src/format/useUnit.d.ts
5
+ declare const useUnit: () => _angular_core0.Signal<(value: string | number, options?: Intl.NumberFormatOptions & {
6
+ locale?: _intlayer_types_module_augmentation0.LocalesValues;
7
+ }) => string>;
8
+ //#endregion
9
+ export { useUnit };
10
+ //# sourceMappingURL=useUnit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUnit.d.ts","names":[],"sources":["../../../src/format/useUnit.ts"],"mappings":";;;;cAIa,OAAA,uBAAO,MAAA,EAAA,KAAA,mBAAA,OAAA,GAAA,IAAA,CAAA,mBAAA;WAAA,oCAAA,CAAA,aAAA;AAAA"}
@@ -1,11 +1,12 @@
1
- import { INTLAYER_TOKEN, IntlayerProvider, createIntlayerClient, installIntlayer, provideIntlayer } from "./client/installIntlayer.js";
1
+ import { IntlayerNodeComponent } from "./UI/IntlayerNode.component.js";
2
+ import { INTLAYER_TOKEN, IntlayerProvider, createIntlayerClient } from "./client/intlayerToken.js";
3
+ import { installIntlayer, provideIntlayer } from "./client/installIntlayer.js";
2
4
  import { DeepTransformContent, HTMLPluginCond, IInterpreterPluginAngular, IInterpreterPluginState, InsertionPluginCond, IntlayerNode, IntlayerNodeCond, MarkdownCond, MarkdownStringCond, getPlugins, htmlPlugin, insertionPlugin, intlayerNodePlugins, markdownPlugin, markdownStringPlugin } from "./plugins.js";
3
5
  import { useDictionary } from "./client/useDictionary.js";
4
6
  import { useDictionaryAsync } from "./client/useDictionaryAsync.js";
5
7
  import { getDictionary } from "./getDictionary.js";
6
8
  import { getIntlayer } from "./getIntlayer.js";
7
9
  import { useDictionaryDynamic } from "./client/useDictionaryDynamic.js";
8
- import { useIntl } from "./client/useIntl.js";
9
10
  import { isUpdatableNode, useIntlayer } from "./client/useIntlayer.js";
10
11
  import { useLoadDynamic } from "./client/useLoadDynamic.js";
11
12
  import { useLocale } from "./client/useLocale.js";
@@ -16,5 +17,5 @@ declare module '@intlayer/core/interpreter' {
16
17
  interface IInterpreterPlugin<T, S, L extends LocalesValues> extends IInterpreterPluginAngular<T, S, L> {}
17
18
  }
18
19
  //#endregion
19
- export { DeepTransformContent, HTMLPluginCond, IInterpreterPluginAngular, IInterpreterPluginState, INTLAYER_TOKEN, InsertionPluginCond, IntlayerNode, IntlayerNodeCond, IntlayerProvider, MarkdownCond, MarkdownStringCond, createIntlayerClient, getDictionary, getIntlayer, getPlugins, htmlPlugin, insertionPlugin, installIntlayer, intlayerNodePlugins, isUpdatableNode, markdownPlugin, markdownStringPlugin, provideIntlayer, useDictionary, useDictionaryAsync, useDictionaryDynamic, useIntl, useIntlayer, useLoadDynamic, useLocale };
20
+ export { DeepTransformContent, HTMLPluginCond, IInterpreterPluginAngular, IInterpreterPluginState, INTLAYER_TOKEN, InsertionPluginCond, IntlayerNode, IntlayerNodeComponent, IntlayerNodeCond, IntlayerProvider, MarkdownCond, MarkdownStringCond, createIntlayerClient, getDictionary, getIntlayer, getPlugins, htmlPlugin, insertionPlugin, installIntlayer, intlayerNodePlugins, isUpdatableNode, markdownPlugin, markdownStringPlugin, provideIntlayer, useDictionary, useDictionaryAsync, useDictionaryDynamic, useIntlayer, useLoadDynamic, useLocale };
20
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;;;;;;;;;;;;YAIY,kBAAA,iBAAmC,aAAA,UACnC,yBAAA,CAA0B,CAAA,EAAG,CAAA,EAAG,CAAA;AAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;YAIY,kBAAA,iBAAmC,aAAA,UACnC,yBAAA,CAA0B,CAAA,EAAG,CAAA,EAAG,CAAA;AAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "angular-intlayer",
3
- "version": "8.5.0",
3
+ "version": "8.5.2",
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,21 @@
39
39
  "require": "./dist/cjs/index.cjs",
40
40
  "import": "./dist/esm/index.mjs"
41
41
  },
42
+ "./format": {
43
+ "types": "./dist/types/format/index.d.ts",
44
+ "require": "./dist/cjs/format/index.cjs",
45
+ "import": "./dist/esm/format/index.mjs"
46
+ },
47
+ "./html": {
48
+ "types": "./dist/types/html/index.d.ts",
49
+ "require": "./dist/cjs/html/index.cjs",
50
+ "import": "./dist/esm/html/index.mjs"
51
+ },
52
+ "./markdown": {
53
+ "types": "./dist/types/markdown/index.d.ts",
54
+ "require": "./dist/cjs/markdown/index.cjs",
55
+ "import": "./dist/esm/markdown/index.mjs"
56
+ },
42
57
  "./webpack": {
43
58
  "types": "./dist/types/webpack/index.d.ts",
44
59
  "require": "./dist/cjs/webpack/index.cjs",
@@ -54,6 +69,15 @@
54
69
  ".": [
55
70
  "./dist/types/index.d.ts"
56
71
  ],
72
+ "format": [
73
+ "./dist/types/format/index.d.ts"
74
+ ],
75
+ "html": [
76
+ "./dist/types/html/index.d.ts"
77
+ ],
78
+ "markdown": [
79
+ "./dist/types/markdown/index.d.ts"
80
+ ],
57
81
  "webpack": [
58
82
  "./dist/types/webpack/index.d.ts"
59
83
  ],
@@ -86,13 +110,13 @@
86
110
  "dependencies": {
87
111
  "@babel/plugin-syntax-import-attributes": "^7.28.6",
88
112
  "@babel/preset-env": "^7.29.0",
89
- "@intlayer/chokidar": "8.5.0",
90
- "@intlayer/config": "8.5.0",
91
- "@intlayer/core": "8.5.0",
92
- "@intlayer/dictionaries-entry": "8.5.0",
93
- "@intlayer/editor": "8.5.0",
94
- "@intlayer/types": "8.5.0",
95
- "@intlayer/webpack": "8.5.0",
113
+ "@intlayer/chokidar": "8.5.2",
114
+ "@intlayer/config": "8.5.2",
115
+ "@intlayer/core": "8.5.2",
116
+ "@intlayer/dictionaries-entry": "8.5.2",
117
+ "@intlayer/editor": "8.5.2",
118
+ "@intlayer/types": "8.5.2",
119
+ "@intlayer/webpack": "8.5.2",
96
120
  "babel-loader": "^10.1.1",
97
121
  "defu": "6.1.4"
98
122
  },
@@ -1,41 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
- const require_client_installIntlayer = require('./installIntlayer.cjs');
4
- let _angular_core = require("@angular/core");
5
- let _intlayer_core_formatters = require("@intlayer/core/formatters");
6
-
7
- //#region src/client/useIntl.ts
8
- /**
9
- * Angular composable that provides a locale-bound `Intl` object.
10
- *
11
- * It acts exactly like the native `Intl` object, but acts as a proxy to:
12
- * 1. Inject the current locale automatically if none is provided.
13
- * 2. Use the performance-optimized `CachedIntl` under the hood.
14
- *
15
- * @example
16
- * ```typescript
17
- * import { Component, computed } from '@angular/core';
18
- * import { useIntl } from 'angular-intlayer';
19
- *
20
- * @Component({ ... })
21
- * export class MyComponent {
22
- * intl = useIntl();
23
- * formattedPrice = computed(() =>
24
- * new this.intl().NumberFormat({
25
- * style: 'currency',
26
- * currency: 'USD'
27
- * }).format(123.45)
28
- * );
29
- * }
30
- * ```
31
- */
32
- const useIntl = (locale) => {
33
- const intlayer = (0, _angular_core.inject)(require_client_installIntlayer.IntlayerProvider);
34
- return (0, _angular_core.computed)(() => {
35
- return (0, _intlayer_core_formatters.bindIntl)(locale ?? intlayer.locale());
36
- });
37
- };
38
-
39
- //#endregion
40
- exports.useIntl = useIntl;
41
- //# sourceMappingURL=useIntl.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useIntl.cjs","names":["IntlayerProvider"],"sources":["../../../src/client/useIntl.ts"],"sourcesContent":["import { computed, inject } from '@angular/core';\nimport { bindIntl, type WrappedIntl } from '@intlayer/core/formatters';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { IntlayerProvider } from './installIntlayer';\n\n/**\n * Angular composable that provides a locale-bound `Intl` object.\n *\n * It acts exactly like the native `Intl` object, but acts as a proxy to:\n * 1. Inject the current locale automatically if none is provided.\n * 2. Use the performance-optimized `CachedIntl` under the hood.\n *\n * @example\n * ```typescript\n * import { Component, computed } from '@angular/core';\n * import { useIntl } from 'angular-intlayer';\n *\n * @Component({ ... })\n * export class MyComponent {\n * intl = useIntl();\n * formattedPrice = computed(() =>\n * new this.intl().NumberFormat({\n * style: 'currency',\n * currency: 'USD'\n * }).format(123.45)\n * );\n * }\n * ```\n */\nexport const useIntl = (locale?: LocalesValues) => {\n const intlayer = inject(IntlayerProvider);\n\n return computed<WrappedIntl>(() => {\n const currentLocale = locale ?? intlayer.locale();\n\n return bindIntl(currentLocale);\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAa,WAAW,WAA2B;CACjD,MAAM,qCAAkBA,gDAAiB;AAEzC,0CAAmC;AAGjC,iDAFsB,UAAU,SAAS,QAAQ,CAEnB;GAC9B"}
@@ -1,39 +0,0 @@
1
- import { IntlayerProvider } from "./installIntlayer.mjs";
2
- import { computed, inject } from "@angular/core";
3
- import { bindIntl } from "@intlayer/core/formatters";
4
-
5
- //#region src/client/useIntl.ts
6
- /**
7
- * Angular composable that provides a locale-bound `Intl` object.
8
- *
9
- * It acts exactly like the native `Intl` object, but acts as a proxy to:
10
- * 1. Inject the current locale automatically if none is provided.
11
- * 2. Use the performance-optimized `CachedIntl` under the hood.
12
- *
13
- * @example
14
- * ```typescript
15
- * import { Component, computed } from '@angular/core';
16
- * import { useIntl } from 'angular-intlayer';
17
- *
18
- * @Component({ ... })
19
- * export class MyComponent {
20
- * intl = useIntl();
21
- * formattedPrice = computed(() =>
22
- * new this.intl().NumberFormat({
23
- * style: 'currency',
24
- * currency: 'USD'
25
- * }).format(123.45)
26
- * );
27
- * }
28
- * ```
29
- */
30
- const useIntl = (locale) => {
31
- const intlayer = inject(IntlayerProvider);
32
- return computed(() => {
33
- return bindIntl(locale ?? intlayer.locale());
34
- });
35
- };
36
-
37
- //#endregion
38
- export { useIntl };
39
- //# sourceMappingURL=useIntl.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useIntl.mjs","names":[],"sources":["../../../src/client/useIntl.ts"],"sourcesContent":["import { computed, inject } from '@angular/core';\nimport { bindIntl, type WrappedIntl } from '@intlayer/core/formatters';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { IntlayerProvider } from './installIntlayer';\n\n/**\n * Angular composable that provides a locale-bound `Intl` object.\n *\n * It acts exactly like the native `Intl` object, but acts as a proxy to:\n * 1. Inject the current locale automatically if none is provided.\n * 2. Use the performance-optimized `CachedIntl` under the hood.\n *\n * @example\n * ```typescript\n * import { Component, computed } from '@angular/core';\n * import { useIntl } from 'angular-intlayer';\n *\n * @Component({ ... })\n * export class MyComponent {\n * intl = useIntl();\n * formattedPrice = computed(() =>\n * new this.intl().NumberFormat({\n * style: 'currency',\n * currency: 'USD'\n * }).format(123.45)\n * );\n * }\n * ```\n */\nexport const useIntl = (locale?: LocalesValues) => {\n const intlayer = inject(IntlayerProvider);\n\n return computed<WrappedIntl>(() => {\n const currentLocale = locale ?? intlayer.locale();\n\n return bindIntl(currentLocale);\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAa,WAAW,WAA2B;CACjD,MAAM,WAAW,OAAO,iBAAiB;AAEzC,QAAO,eAA4B;AAGjC,SAAO,SAFe,UAAU,SAAS,QAAQ,CAEnB;GAC9B"}
@@ -1,33 +0,0 @@
1
- import * as _angular_core0 from "@angular/core";
2
- import { LocalesValues } from "@intlayer/types/module_augmentation";
3
- import { WrappedIntl } from "@intlayer/core/formatters";
4
-
5
- //#region src/client/useIntl.d.ts
6
- /**
7
- * Angular composable that provides a locale-bound `Intl` object.
8
- *
9
- * It acts exactly like the native `Intl` object, but acts as a proxy to:
10
- * 1. Inject the current locale automatically if none is provided.
11
- * 2. Use the performance-optimized `CachedIntl` under the hood.
12
- *
13
- * @example
14
- * ```typescript
15
- * import { Component, computed } from '@angular/core';
16
- * import { useIntl } from 'angular-intlayer';
17
- *
18
- * @Component({ ... })
19
- * export class MyComponent {
20
- * intl = useIntl();
21
- * formattedPrice = computed(() =>
22
- * new this.intl().NumberFormat({
23
- * style: 'currency',
24
- * currency: 'USD'
25
- * }).format(123.45)
26
- * );
27
- * }
28
- * ```
29
- */
30
- declare const useIntl: (locale?: LocalesValues) => _angular_core0.Signal<WrappedIntl>;
31
- //#endregion
32
- export { useIntl };
33
- //# sourceMappingURL=useIntl.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useIntl.d.ts","names":[],"sources":["../../../src/client/useIntl.ts"],"mappings":";;;;;;;;AA6BA;;;;;;;;;;;;;;;;;;;;;cAAa,OAAA,GAAW,MAAA,GAAS,aAAA,KAAa,cAAA,CAAA,MAAA,CAAA,WAAA"}