angular-intlayer 8.4.10 → 8.5.1

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 (164) hide show
  1. package/dist/cjs/@intlayer/editor/src/isEnabled.cjs +10 -0
  2. package/dist/cjs/@intlayer/editor/src/isEnabled.cjs.map +1 -0
  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/html/index.cjs +12 -0
  46. package/dist/cjs/html/installIntlayerHTML.cjs +47 -0
  47. package/dist/cjs/html/installIntlayerHTML.cjs.map +1 -0
  48. package/dist/cjs/index.cjs +8 -18
  49. package/dist/cjs/markdown/index.cjs +0 -1
  50. package/dist/cjs/markdown/installIntlayerMarkdown.cjs +1 -1
  51. package/dist/cjs/markdown/installIntlayerMarkdown.cjs.map +1 -1
  52. package/dist/cjs/plugins.cjs +14 -22
  53. package/dist/cjs/plugins.cjs.map +1 -1
  54. package/dist/cjs/renderIntlayerNode.cjs +2 -1
  55. package/dist/cjs/renderIntlayerNode.cjs.map +1 -1
  56. package/dist/esm/@intlayer/editor/src/isEnabled.mjs +8 -0
  57. package/dist/esm/@intlayer/editor/src/isEnabled.mjs.map +1 -0
  58. package/dist/esm/UI/IntlayerNode.component.mjs +46 -0
  59. package/dist/esm/UI/IntlayerNode.component.mjs.map +1 -0
  60. package/dist/esm/UI/index.mjs +3 -0
  61. package/dist/esm/client/index.mjs +3 -3
  62. package/dist/esm/client/installIntlayer.mjs +15 -37
  63. package/dist/esm/client/installIntlayer.mjs.map +1 -1
  64. package/dist/esm/client/intlayerToken.mjs +31 -0
  65. package/dist/esm/client/intlayerToken.mjs.map +1 -0
  66. package/dist/esm/client/useDictionary.mjs +1 -1
  67. package/dist/esm/client/useDictionary.mjs.map +1 -1
  68. package/dist/esm/client/useDictionaryAsync.mjs +1 -1
  69. package/dist/esm/client/useDictionaryAsync.mjs.map +1 -1
  70. package/dist/esm/client/useDictionaryDynamic.mjs +1 -1
  71. package/dist/esm/client/useDictionaryDynamic.mjs.map +1 -1
  72. package/dist/esm/client/useIntlayer.mjs +1 -1
  73. package/dist/esm/client/useIntlayer.mjs.map +1 -1
  74. package/dist/esm/client/useLocale.mjs +1 -1
  75. package/dist/esm/editor/EditorProvider.component.mjs +20 -0
  76. package/dist/esm/editor/EditorProvider.component.mjs.map +1 -0
  77. package/dist/esm/editor/index.mjs +5 -0
  78. package/dist/esm/editor/useEditor.mjs +48 -14
  79. package/dist/esm/editor/useEditor.mjs.map +1 -1
  80. package/dist/esm/format/index.mjs +11 -0
  81. package/dist/esm/format/useCompact.mjs +16 -0
  82. package/dist/esm/format/useCompact.mjs.map +1 -0
  83. package/dist/esm/format/useCurrency.mjs +16 -0
  84. package/dist/esm/format/useCurrency.mjs.map +1 -0
  85. package/dist/esm/format/useDate.mjs +26 -0
  86. package/dist/esm/format/useDate.mjs.map +1 -0
  87. package/dist/esm/format/useIntl.mjs +18 -0
  88. package/dist/esm/format/useIntl.mjs.map +1 -0
  89. package/dist/esm/format/useList.mjs +16 -0
  90. package/dist/esm/format/useList.mjs.map +1 -0
  91. package/dist/esm/format/useNumber.mjs +19 -0
  92. package/dist/esm/format/useNumber.mjs.map +1 -0
  93. package/dist/esm/format/usePercentage.mjs +16 -0
  94. package/dist/esm/format/usePercentage.mjs.map +1 -0
  95. package/dist/esm/format/useRelativeTime.mjs +16 -0
  96. package/dist/esm/format/useRelativeTime.mjs.map +1 -0
  97. package/dist/esm/format/useUnit.mjs +16 -0
  98. package/dist/esm/format/useUnit.mjs.map +1 -0
  99. package/dist/esm/html/index.mjs +3 -0
  100. package/dist/esm/html/installIntlayerHTML.mjs +37 -0
  101. package/dist/esm/html/installIntlayerHTML.mjs.map +1 -0
  102. package/dist/esm/index.mjs +4 -4
  103. package/dist/esm/markdown/index.mjs +2 -2
  104. package/dist/esm/markdown/installIntlayerMarkdown.mjs +1 -1
  105. package/dist/esm/markdown/installIntlayerMarkdown.mjs.map +1 -1
  106. package/dist/esm/plugins.mjs +14 -22
  107. package/dist/esm/plugins.mjs.map +1 -1
  108. package/dist/esm/renderIntlayerNode.mjs +2 -1
  109. package/dist/esm/renderIntlayerNode.mjs.map +1 -1
  110. package/dist/types/UI/IntlayerNode.component.d.ts +27 -0
  111. package/dist/types/UI/IntlayerNode.component.d.ts.map +1 -0
  112. package/dist/types/UI/index.d.ts +2 -0
  113. package/dist/types/client/index.d.ts +3 -3
  114. package/dist/types/client/installIntlayer.d.ts +10 -21
  115. package/dist/types/client/installIntlayer.d.ts.map +1 -1
  116. package/dist/types/client/intlayerToken.d.ts +19 -0
  117. package/dist/types/client/intlayerToken.d.ts.map +1 -0
  118. package/dist/types/client/useDictionaryAsync.d.ts.map +1 -1
  119. package/dist/types/client/useDictionaryDynamic.d.ts +2 -2
  120. package/dist/types/client/useDictionaryDynamic.d.ts.map +1 -1
  121. package/dist/types/client/useIntlayer.d.ts.map +1 -1
  122. package/dist/types/client/useLocale.d.ts +3 -3
  123. package/dist/types/client/useLocaleStorage.d.ts +5 -5
  124. package/dist/types/client/useLocaleStorage.d.ts.map +1 -1
  125. package/dist/types/editor/EditorProvider.component.d.ts +33 -0
  126. package/dist/types/editor/EditorProvider.component.d.ts.map +1 -0
  127. package/dist/types/editor/index.d.ts +4 -0
  128. package/dist/types/editor/useEditor.d.ts +35 -2
  129. package/dist/types/editor/useEditor.d.ts.map +1 -1
  130. package/dist/types/format/index.d.ts +10 -0
  131. package/dist/types/format/useCompact.d.ts +10 -0
  132. package/dist/types/format/useCompact.d.ts.map +1 -0
  133. package/dist/types/format/useCurrency.d.ts +10 -0
  134. package/dist/types/format/useCurrency.d.ts.map +1 -0
  135. package/dist/types/format/useDate.d.ts +14 -0
  136. package/dist/types/format/useDate.d.ts.map +1 -0
  137. package/dist/types/format/useIntl.d.ts +12 -0
  138. package/dist/types/format/useIntl.d.ts.map +1 -0
  139. package/dist/types/format/useList.d.ts +14 -0
  140. package/dist/types/format/useList.d.ts.map +1 -0
  141. package/dist/types/format/useNumber.d.ts +13 -0
  142. package/dist/types/format/useNumber.d.ts.map +1 -0
  143. package/dist/types/format/usePercentage.d.ts +10 -0
  144. package/dist/types/format/usePercentage.d.ts.map +1 -0
  145. package/dist/types/format/useRelativeTime.d.ts +11 -0
  146. package/dist/types/format/useRelativeTime.d.ts.map +1 -0
  147. package/dist/types/format/useUnit.d.ts +10 -0
  148. package/dist/types/format/useUnit.d.ts.map +1 -0
  149. package/dist/types/html/index.d.ts +2 -0
  150. package/dist/types/html/installIntlayerHTML.d.ts +34 -0
  151. package/dist/types/html/installIntlayerHTML.d.ts.map +1 -0
  152. package/dist/types/index.d.ts +4 -4
  153. package/dist/types/intlayer/dist/types/index.d.ts +4 -0
  154. package/dist/types/markdown/index.d.ts +2 -2
  155. package/dist/types/markdown/installIntlayerMarkdown.d.ts +3 -3
  156. package/dist/types/markdown/installIntlayerMarkdown.d.ts.map +1 -1
  157. package/dist/types/plugins.d.ts.map +1 -1
  158. package/package.json +32 -8
  159. package/dist/cjs/client/useIntl.cjs +0 -41
  160. package/dist/cjs/client/useIntl.cjs.map +0 -1
  161. package/dist/esm/client/useIntl.mjs +0 -39
  162. package/dist/esm/client/useIntl.mjs.map +0 -1
  163. package/dist/types/client/useIntl.d.ts +0 -33
  164. package/dist/types/client/useIntl.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "angular-intlayer",
3
- "version": "8.4.10",
3
+ "version": "8.5.1",
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.4.10",
90
- "@intlayer/config": "8.4.10",
91
- "@intlayer/core": "8.4.10",
92
- "@intlayer/dictionaries-entry": "8.4.10",
93
- "@intlayer/editor": "8.4.10",
94
- "@intlayer/types": "8.4.10",
95
- "@intlayer/webpack": "8.4.10",
113
+ "@intlayer/chokidar": "8.5.1",
114
+ "@intlayer/config": "8.5.1",
115
+ "@intlayer/core": "8.5.1",
116
+ "@intlayer/dictionaries-entry": "8.5.1",
117
+ "@intlayer/editor": "8.5.1",
118
+ "@intlayer/types": "8.5.1",
119
+ "@intlayer/webpack": "8.5.1",
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"}