preact-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 (126) hide show
  1. package/dist/cjs/client/index.cjs +0 -2
  2. package/dist/cjs/format/index.cjs +20 -0
  3. package/dist/cjs/{client/format → format}/useCompact.cjs +3 -3
  4. package/dist/cjs/format/useCompact.cjs.map +1 -0
  5. package/dist/cjs/{client/format → format}/useCurrency.cjs +3 -3
  6. package/dist/cjs/format/useCurrency.cjs.map +1 -0
  7. package/dist/cjs/{client/format → format}/useDate.cjs +3 -3
  8. package/dist/cjs/format/useDate.cjs.map +1 -0
  9. package/dist/cjs/{client/format → format}/useIntl.cjs +3 -3
  10. package/dist/cjs/format/useIntl.cjs.map +1 -0
  11. package/dist/cjs/{client/format → format}/useList.cjs +3 -3
  12. package/dist/cjs/format/useList.cjs.map +1 -0
  13. package/dist/cjs/{client/format → format}/useNumber.cjs +3 -3
  14. package/dist/cjs/format/useNumber.cjs.map +1 -0
  15. package/dist/cjs/{client/format → format}/usePercentage.cjs +3 -3
  16. package/dist/cjs/format/usePercentage.cjs.map +1 -0
  17. package/dist/cjs/{client/format → format}/useRelativeTime.cjs +3 -3
  18. package/dist/cjs/format/useRelativeTime.cjs.map +1 -0
  19. package/dist/cjs/{client/format → format}/useUnit.cjs +3 -3
  20. package/dist/cjs/format/useUnit.cjs.map +1 -0
  21. package/dist/cjs/html/index.cjs +0 -1
  22. package/dist/cjs/index.cjs +1 -25
  23. package/dist/cjs/markdown/MarkdownProvider.cjs.map +1 -1
  24. package/dist/cjs/markdown/MarkdownRenderer.cjs +2 -6
  25. package/dist/cjs/markdown/MarkdownRenderer.cjs.map +1 -1
  26. package/dist/cjs/markdown/index.cjs +0 -12
  27. package/dist/cjs/plugins.cjs +16 -12
  28. package/dist/cjs/plugins.cjs.map +1 -1
  29. package/dist/esm/client/index.mjs +1 -2
  30. package/dist/esm/{client/format → format}/index.mjs +2 -1
  31. package/dist/esm/{client/format → format}/useCompact.mjs +2 -2
  32. package/dist/esm/format/useCompact.mjs.map +1 -0
  33. package/dist/esm/{client/format → format}/useCurrency.mjs +2 -2
  34. package/dist/esm/format/useCurrency.mjs.map +1 -0
  35. package/dist/esm/{client/format → format}/useDate.mjs +2 -2
  36. package/dist/esm/format/useDate.mjs.map +1 -0
  37. package/dist/esm/{client/format → format}/useIntl.mjs +2 -2
  38. package/dist/esm/format/useIntl.mjs.map +1 -0
  39. package/dist/esm/{client/format → format}/useList.mjs +2 -2
  40. package/dist/esm/format/useList.mjs.map +1 -0
  41. package/dist/esm/{client/format → format}/useNumber.mjs +2 -2
  42. package/dist/esm/format/useNumber.mjs.map +1 -0
  43. package/dist/esm/{client/format → format}/usePercentage.mjs +2 -2
  44. package/dist/esm/format/usePercentage.mjs.map +1 -0
  45. package/dist/esm/{client/format → format}/useRelativeTime.mjs +2 -2
  46. package/dist/esm/format/useRelativeTime.mjs.map +1 -0
  47. package/dist/esm/{client/format → format}/useUnit.mjs +2 -2
  48. package/dist/esm/format/useUnit.mjs.map +1 -0
  49. package/dist/esm/html/index.mjs +2 -2
  50. package/dist/esm/index.mjs +1 -9
  51. package/dist/esm/markdown/MarkdownProvider.mjs.map +1 -1
  52. package/dist/esm/markdown/MarkdownRenderer.mjs +2 -6
  53. package/dist/esm/markdown/MarkdownRenderer.mjs.map +1 -1
  54. package/dist/esm/markdown/index.mjs +2 -4
  55. package/dist/esm/plugins.mjs +16 -12
  56. package/dist/esm/plugins.mjs.map +1 -1
  57. package/dist/types/client/index.d.ts +1 -2
  58. package/dist/types/client/useContent.d.ts +2 -2
  59. package/dist/types/client/useContent.d.ts.map +1 -1
  60. package/dist/types/client/useDictionary.d.ts +2 -2
  61. package/dist/types/client/useDictionary.d.ts.map +1 -1
  62. package/dist/types/client/useDictionaryDynamic.d.ts +2 -2
  63. package/dist/types/client/useDictionaryDynamic.d.ts.map +1 -1
  64. package/dist/types/client/useLocale.d.ts +3 -3
  65. package/dist/types/client/useLocaleBase.d.ts +5 -6
  66. package/dist/types/client/useLocaleBase.d.ts.map +1 -1
  67. package/dist/types/client/useLocaleStorage.d.ts +5 -5
  68. package/dist/types/client/useLocaleStorage.d.ts.map +1 -1
  69. package/dist/types/{client/format → format}/index.d.ts +2 -1
  70. package/dist/types/{client/format → format}/useCompact.d.ts +3 -3
  71. package/dist/types/format/useCompact.d.ts.map +1 -0
  72. package/dist/types/{client/format → format}/useCurrency.d.ts +3 -3
  73. package/dist/types/format/useCurrency.d.ts.map +1 -0
  74. package/dist/types/{client/format → format}/useDate.d.ts +1 -1
  75. package/dist/types/format/useDate.d.ts.map +1 -0
  76. package/dist/types/{client/format → format}/useIntl.d.ts +1 -1
  77. package/dist/types/format/useIntl.d.ts.map +1 -0
  78. package/dist/types/{client/format → format}/useList.d.ts +3 -3
  79. package/dist/types/format/useList.d.ts.map +1 -0
  80. package/dist/types/{client/format → format}/useNumber.d.ts +3 -3
  81. package/dist/types/format/useNumber.d.ts.map +1 -0
  82. package/dist/types/{client/format → format}/usePercentage.d.ts +3 -3
  83. package/dist/types/format/usePercentage.d.ts.map +1 -0
  84. package/dist/types/{client/format → format}/useRelativeTime.d.ts +3 -3
  85. package/dist/types/format/useRelativeTime.d.ts.map +1 -0
  86. package/dist/types/{client/format → format}/useUnit.d.ts +3 -3
  87. package/dist/types/format/useUnit.d.ts.map +1 -0
  88. package/dist/types/html/index.d.ts +3 -2
  89. package/dist/types/index.d.ts +2 -9
  90. package/dist/types/index.d.ts.map +1 -1
  91. package/dist/types/intlayer/dist/types/index.d.ts +4 -0
  92. package/dist/types/markdown/MarkdownProvider.d.ts +4 -4
  93. package/dist/types/markdown/MarkdownProvider.d.ts.map +1 -1
  94. package/dist/types/markdown/MarkdownRenderer.d.ts +5 -5
  95. package/dist/types/markdown/MarkdownRenderer.d.ts.map +1 -1
  96. package/dist/types/markdown/index.d.ts +3 -5
  97. package/dist/types/plugins.d.ts.map +1 -1
  98. package/package.json +19 -11
  99. package/dist/cjs/client/format/index.cjs +0 -18
  100. package/dist/cjs/client/format/useCompact.cjs.map +0 -1
  101. package/dist/cjs/client/format/useCurrency.cjs.map +0 -1
  102. package/dist/cjs/client/format/useDate.cjs.map +0 -1
  103. package/dist/cjs/client/format/useIntl.cjs.map +0 -1
  104. package/dist/cjs/client/format/useList.cjs.map +0 -1
  105. package/dist/cjs/client/format/useNumber.cjs.map +0 -1
  106. package/dist/cjs/client/format/usePercentage.cjs.map +0 -1
  107. package/dist/cjs/client/format/useRelativeTime.cjs.map +0 -1
  108. package/dist/cjs/client/format/useUnit.cjs.map +0 -1
  109. package/dist/esm/client/format/useCompact.mjs.map +0 -1
  110. package/dist/esm/client/format/useCurrency.mjs.map +0 -1
  111. package/dist/esm/client/format/useDate.mjs.map +0 -1
  112. package/dist/esm/client/format/useIntl.mjs.map +0 -1
  113. package/dist/esm/client/format/useList.mjs.map +0 -1
  114. package/dist/esm/client/format/useNumber.mjs.map +0 -1
  115. package/dist/esm/client/format/usePercentage.mjs.map +0 -1
  116. package/dist/esm/client/format/useRelativeTime.mjs.map +0 -1
  117. package/dist/esm/client/format/useUnit.mjs.map +0 -1
  118. package/dist/types/client/format/useCompact.d.ts.map +0 -1
  119. package/dist/types/client/format/useCurrency.d.ts.map +0 -1
  120. package/dist/types/client/format/useDate.d.ts.map +0 -1
  121. package/dist/types/client/format/useIntl.d.ts.map +0 -1
  122. package/dist/types/client/format/useList.d.ts.map +0 -1
  123. package/dist/types/client/format/useNumber.d.ts.map +0 -1
  124. package/dist/types/client/format/usePercentage.d.ts.map +0 -1
  125. package/dist/types/client/format/useRelativeTime.d.ts.map +0 -1
  126. package/dist/types/client/format/useUnit.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"MarkdownRenderer.d.ts","names":[],"sources":["../../../src/markdown/MarkdownRenderer.tsx"],"mappings":";;;;;KAQY,mBAAA,GAAsB,uBAAA;;AAAlC;;;EAKE,UAAA,GAAa,cAAA;EAAA;;;;EAKb,OAAA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IACzC,UAAA;IACA,WAAA;IACA,mBAAA;IACA,SAAA;EAAA,MAEC,iBAAA,GAAoB,OAAA,CAAQ,iBAAA;AAAA;;;;;;;cAStB,gBAAA,EAAkB,iBAAA,CAAkB,qBAAA"}
@@ -1,6 +1,4 @@
1
- import { MarkdownCompilerOptions, RuleType, compile, compileMarkdown, compiler, sanitizer as defaultSanitizer, slugify as defaultSlugify } from "./compiler.js";
2
1
  import { MarkdownProvider, MarkdownProviderOptions, useMarkdownContext } from "./MarkdownProvider.js";
3
- import { MarkdownRenderer, RenderMarkdownProps, renderMarkdown, useMarkdownRenderer } from "./MarkdownRenderer.js";
4
- import { MarkdownMetadataRenderer, MarkdownRendererPlugin } from "./MarkdownRendererPlugin.js";
5
- import preactRuntime from "./runtime.js";
6
- export { MarkdownCompilerOptions, MarkdownMetadataRenderer, MarkdownProvider, MarkdownProviderOptions, MarkdownRenderer, MarkdownRendererPlugin, RenderMarkdownProps, RuleType, compile, compileMarkdown, compiler, preactRuntime, renderMarkdown, defaultSanitizer as sanitizer, defaultSlugify as slugify, useMarkdownContext, useMarkdownRenderer };
2
+ import { MarkdownRenderer, MarkdownRendererProps, RenderMarkdownProps, renderMarkdown, useMarkdownRenderer } from "./MarkdownRenderer.js";
3
+ import { compileMarkdown } from "./compiler.js";
4
+ export { MarkdownProvider, type MarkdownProviderOptions, MarkdownRenderer, type MarkdownRendererProps, type RenderMarkdownProps, compileMarkdown, renderMarkdown, useMarkdownContext, useMarkdownRenderer };
@@ -1 +1 @@
1
- {"version":3,"file":"plugins.d.ts","names":[],"sources":["../../src/plugins.tsx"],"mappings":";;;;;;;;;;;AAsDA;KAAY,gBAAA,MAAsB,CAAA,2BAC9B,YAAA,CAAa,CAAA;;cAIJ,mBAAA,EAAqB,OAAA;;;;KA8BtB,cAAA,MAAoB,CAAA;EAC9B,KAAA;EACA,GAAA;AAAA,IAEE,KAAA;;cAIS,iBAAA,EAAmB,OAAA;;AAtChC;;KAmEY,aAAA,kBAA+B,aA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EAC9B,QAAA,EAAU,QAAA;EAAA,CACT,SAAA,CAAU,IAAA;EACX,IAAA;AAAA;EAGI,GAAA,GAAM,UAAA,GAAa,cAAA,eAA6B,CAAA,MAAO,YAAA,CAAa,CAAA;AAAA;;cAK7D,UAAA,EAAY,OAAA;;;;UAyCR,wBAAA,iBAAyC,aAAA;EACxD,UAAA,EAAY,cAAA,CAAe,CAAA;EAC3B,kBAAA,EAAoB,gBAAA,CAAiB,CAAA;EACrC,eAAA,EAAiB,aAAA,CAAc,CAAA,EAAG,CAAA,EAAG,CAAA;EACrC,cAAA,EAAgB,YAAA,CAAa,CAAA;EAC7B,UAAA,EAAY,cAAA,CAAe,CAAA;AAAA;;;;;;KAQjB,uBAAA,GAA0B,IAAA,CACpC,yBAAA;EAGA,UAAA;EACA,kBAAA;EACA,eAAA;EACA,cAAA;EACA,UAAA;AAAA;AAAA,KAGU,oBAAA,cAEA,aAAA,GAAgB,eAAA,IACxB,sBAAA,CAAyB,CAAA,EAAG,uBAAA,EAAyB,CAAA;;;;;cAM5C,UAAA,GACX,MAAA,GAAS,aAAA,EACT,QAAA,eACC,OAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "preact-intlayer",
3
- "version": "8.4.10",
3
+ "version": "8.5.1",
4
4
  "private": false,
5
5
  "description": "Easily internationalize i18n your Preact applications with type-safe multilingual content management.",
6
6
  "keywords": [
@@ -40,9 +40,14 @@
40
40
  "import": "./dist/esm/index.mjs"
41
41
  },
42
42
  "./format": {
43
- "types": "./dist/types/client/format/index.d.ts",
44
- "require": "./dist/cjs/client/format/index.cjs",
45
- "import": "./dist/esm/client/format/index.mjs"
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"
46
51
  },
47
52
  "./markdown": {
48
53
  "types": "./dist/types/markdown/index.d.ts",
@@ -60,7 +65,10 @@
60
65
  "./dist/types/index.d.ts"
61
66
  ],
62
67
  "format": [
63
- "./dist/types/client/format/index.d.ts"
68
+ "./dist/types/format/index.d.ts"
69
+ ],
70
+ "html": [
71
+ "./dist/types/html/index.d.ts"
64
72
  ],
65
73
  "markdown": [
66
74
  "./dist/types/markdown/index.d.ts"
@@ -92,12 +100,12 @@
92
100
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
93
101
  },
94
102
  "dependencies": {
95
- "@intlayer/api": "8.4.10",
96
- "@intlayer/chokidar": "8.4.10",
97
- "@intlayer/config": "8.4.10",
98
- "@intlayer/core": "8.4.10",
99
- "@intlayer/editor": "8.4.10",
100
- "@intlayer/types": "8.4.10"
103
+ "@intlayer/api": "8.5.1",
104
+ "@intlayer/chokidar": "8.5.1",
105
+ "@intlayer/config": "8.5.1",
106
+ "@intlayer/core": "8.5.1",
107
+ "@intlayer/editor": "8.5.1",
108
+ "@intlayer/types": "8.5.1"
101
109
  },
102
110
  "devDependencies": {
103
111
  "@types/node": "25.5.0",
@@ -1,18 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_client_format_useUnit = require('./useUnit.cjs');
3
- const require_client_format_useDate = require('./useDate.cjs');
4
- const require_client_format_useNumber = require('./useNumber.cjs');
5
- const require_client_format_useRelativeTime = require('./useRelativeTime.cjs');
6
- const require_client_format_useCompact = require('./useCompact.cjs');
7
- const require_client_format_useList = require('./useList.cjs');
8
- const require_client_format_usePercentage = require('./usePercentage.cjs');
9
- const require_client_format_useCurrency = require('./useCurrency.cjs');
10
-
11
- exports.useCompact = require_client_format_useCompact.useCompact;
12
- exports.useCurrency = require_client_format_useCurrency.useCurrency;
13
- exports.useDate = require_client_format_useDate.useDate;
14
- exports.useList = require_client_format_useList.useList;
15
- exports.useNumber = require_client_format_useNumber.useNumber;
16
- exports.usePercentage = require_client_format_usePercentage.usePercentage;
17
- exports.useRelativeTime = require_client_format_useRelativeTime.useRelativeTime;
18
- exports.useUnit = require_client_format_useUnit.useUnit;
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCompact.cjs","names":["IntlayerClientContext"],"sources":["../../../../src/client/format/useCompact.ts"],"sourcesContent":["import { compact } from '@intlayer/core/formatters';\nimport { useCallback, useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React client hook that provides a compact number formatter\n * bound to the current application locale.\n *\n * @example\n * ```tsx\n * const formatCompact = useCompact();\n * formatCompact(1500); // \"1.5K\"\n * ```\n */\nexport const useCompact = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useCallback(\n (...args: Parameters<typeof compact>) =>\n compact(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n }),\n [locale]\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAcA,MAAa,mBAAmB;CAC9B,MAAM,EAAE,wCAAsBA,sDAAsB;AAEpD,uCACG,GAAG,gDACM,KAAK,IAAI;EACf,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU;EAC5B,CAAC,EACJ,CAAC,OAAO,CACT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCurrency.cjs","names":["IntlayerClientContext"],"sources":["../../../../src/client/format/useCurrency.ts"],"sourcesContent":["import { currency } from '@intlayer/core/formatters';\nimport { useCallback, useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React client hook that provides a currency formatter\n * bound to the current application locale.\n *\n * @returns {(value: string | number, options?: CurrencyProps) => string}\n * A function to format numbers into localized currency strings.\n *\n * @example\n * ```tsx\n * const formatCurrency = useCurrency();\n *\n * formatCurrency(1500, { currency: \"USD\" });\n * // \"$1,500.00\"\n *\n * formatCurrency(1500, { currency: \"EUR\", locale: \"de-DE\" });\n * // \"1.500,00 €\"\n *\n * formatCurrency(9876543.21, {\n * currency: \"JPY\",\n * fractionDigits: 0,\n * });\n * // \"¥9,876,543\"\n * ```\n */\nexport const useCurrency = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useCallback(\n (...args: Parameters<typeof currency>) =>\n currency(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n }),\n [locale]\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAa,oBAAoB;CAC/B,MAAM,EAAE,wCAAsBA,sDAAsB;AAEpD,uCACG,GAAG,iDACO,KAAK,IAAI;EAChB,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU;EAC5B,CAAC,EACJ,CAAC,OAAO,CACT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDate.cjs","names":["IntlayerClientContext"],"sources":["../../../../src/client/format/useDate.ts"],"sourcesContent":["import { date } from '@intlayer/core/formatters';\nimport { useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React client hook that provides a localized date/time formatter\n * bound to the current application locale.\n *\n * @returns {(date: Date | string | number, options?: DateProps) => string}\n * A function to format dates or timestamps into localized date/time strings.\n *\n * @example\n * ```tsx\n * const formatDate = useDate();\n *\n * formatDate(new Date(\"2025-01-01\"));\n * // \"Jan 1, 2025\"\n *\n * formatDate(\"2025-01-01T15:30:00Z\", {\n * dateStyle: \"full\",\n * timeStyle: \"short\",\n * });\n * // \"Wednesday, January 1, 2025 at 3:30 PM\"\n *\n * formatDate(1735689600000, { locale: \"fr-FR\", dateStyle: \"long\" });\n * // \"1 janvier 2025\"\n * ```\n *\n * @see createDate\n */\nexport const useDate = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return (...args: Parameters<typeof date>) =>\n date(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAa,gBAAgB;CAC3B,MAAM,EAAE,wCAAsBA,sDAAsB;AAEpD,SAAQ,GAAG,6CACJ,KAAK,IAAI;EACZ,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU;EAC5B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useIntl.cjs","names":["IntlayerClientContext"],"sources":["../../../../src/client/format/useIntl.ts"],"sourcesContent":["import { bindIntl, type WrappedIntl } from '@intlayer/core/formatters';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { useContext, useMemo } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * Preact client hook 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 * ```tsx\n * const intl = useIntl(); // uses context locale\n *\n * // Standard API, but no need to pass locale as the first argument\n * const formatted = new intl.NumberFormat({\n * style: 'currency',\n * currency: 'USD'\n * }).format(123.45);\n * ```\n */\nexport const useIntl = (locale?: LocalesValues) => {\n const { locale: contextLocale } = useContext(IntlayerClientContext);\n const currentLocale = locale ?? contextLocale;\n\n return useMemo<WrappedIntl>(() => bindIntl(currentLocale), [currentLocale]);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAa,WAAW,WAA2B;CACjD,MAAM,EAAE,QAAQ,+CAA6BA,sDAAsB;CACnE,MAAM,gBAAgB,UAAU;AAEhC,gFAA2C,cAAc,EAAE,CAAC,cAAc,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useList.cjs","names":["IntlayerClientContext"],"sources":["../../../../src/client/format/useList.ts"],"sourcesContent":["import { list } from '@intlayer/core/formatters';\nimport { useCallback, useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React client hook that provides a list formatter\n * bound to the current application locale.\n *\n * @returns {(values: (string | number)[], options?: ListProps) => string}\n * A function to format arrays into localized list strings.\n *\n * @example\n * ```tsx\n * const formatList = useList();\n *\n * formatList(['apple', 'banana', 'orange']);\n * // \"apple, banana, and orange\"\n *\n * formatList(['red', 'green', 'blue'], { type: 'disjunction' });\n * // \"red, green, or blue\"\n *\n * formatList([1, 2, 3], { type: 'unit', locale: 'de-DE' });\n * // \"1, 2 und 3\"\n * ```\n */\nexport const useList = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useCallback(\n (...args: Parameters<typeof list>) =>\n list(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n }),\n [locale]\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAa,gBAAgB;CAC3B,MAAM,EAAE,wCAAsBA,sDAAsB;AAEpD,uCACG,GAAG,6CACG,KAAK,IAAI;EACZ,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU;EAC5B,CAAC,EACJ,CAAC,OAAO,CACT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useNumber.cjs","names":["IntlayerClientContext"],"sources":["../../../../src/client/format/useNumber.ts"],"sourcesContent":["import { number } from '@intlayer/core/formatters';\nimport { useCallback, useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React client hook that provides a localized number formatter.\n *\n * Uses the current locale from {@link useLocaleBase} and returns\n * a function that can be used to format numbers consistently\n * according to the user's locale.\n *\n * @example\n * ```tsx\n * const formatNumber = useNumber();\n *\n * formatNumber(12345);\n * // e.g. \"12,345\" (en-US)\n * // e.g. \"12 345\" (fr-FR)\n *\n * formatNumber(0.75, { style: \"percent\" });\n * // e.g. \"75%\"\n * ```\n *\n * @returns {(value: string | number, options?: import(\"../createNumber\").NumberProps) => string}\n * A number formatting function bound to the active locale.\n */\nexport const useNumber = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useCallback(\n (...args: Parameters<typeof number>) =>\n number(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n }),\n [locale]\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAa,kBAAkB;CAC7B,MAAM,EAAE,wCAAsBA,sDAAsB;AAEpD,uCACG,GAAG,+CACK,KAAK,IAAI;EACd,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU;EAC5B,CAAC,EACJ,CAAC,OAAO,CACT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"usePercentage.cjs","names":["IntlayerClientContext"],"sources":["../../../../src/client/format/usePercentage.ts"],"sourcesContent":["import { percentage } from '@intlayer/core/formatters';\nimport { useCallback, useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React hook to provide a percentage formatter function\n * based on the current application locale.\n *\n * This hook retrieves the active locale using {@link useLocaleBase}\n * and memoizes a `createPercentage` instance for that locale.\n *\n * @example\n * ```tsx\n * const formatPercentage = usePercentage();\n *\n * const result = formatPercentage(0.875, { maximumFractionDigits: 1 });\n * // \"87.5%\" (depending on locale)\n * ```\n *\n * @returns {(value: string | number, options?: Omit<PercentageOptions, \"value\">) => string}\n * A function that formats numbers or numeric strings into localized percentages.\n */\nexport const usePercentage = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useCallback(\n (...args: Parameters<typeof percentage>) =>\n percentage(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n }),\n [locale]\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAa,sBAAsB;CACjC,MAAM,EAAE,wCAAsBA,sDAAsB;AAEpD,uCACG,GAAG,mDACS,KAAK,IAAI;EAClB,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU;EAC5B,CAAC,EACJ,CAAC,OAAO,CACT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useRelativeTime.cjs","names":["IntlayerClientContext"],"sources":["../../../../src/client/format/useRelativeTime.ts"],"sourcesContent":["import { relativeTime } from '@intlayer/core/formatters';\nimport { useCallback, useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * Client-side React hook for accessing a localized relative time formatter.\n *\n * This hook:\n * - Reads the current locale from {@link useLocaleBase}.\n * - Creates a new relative time formatter with {@link createRelativeTime}.\n * - Returns a function that can format time differences into localized strings.\n *\n * Example:\n * ```tsx\n * const relativeTime = useRelativeTime();\n * const formatted = relativeTime(new Date(\"2024-08-01\"), new Date());\n * // e.g., \"2 weeks ago\"\n * ```\n *\n * @returns {ReturnType<typeof createRelativeTime>} A relative time formatting function\n * bound to the current client locale.\n */\nexport const useRelativeTime = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useCallback(\n (...args: Parameters<typeof relativeTime>) =>\n relativeTime(args[0], args[1], {\n ...args[2],\n locale: args[2]?.locale ?? locale,\n }),\n [locale]\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAa,wBAAwB;CACnC,MAAM,EAAE,wCAAsBA,sDAAsB;AAEpD,uCACG,GAAG,qDACW,KAAK,IAAI,KAAK,IAAI;EAC7B,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU;EAC5B,CAAC,EACJ,CAAC,OAAO,CACT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useUnit.cjs","names":["IntlayerClientContext"],"sources":["../../../../src/client/format/useUnit.ts"],"sourcesContent":["import { units } from '@intlayer/core/formatters';\nimport { useCallback, useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React hook that provides a unit formatting function\n * based on the current locale from {@link useLocaleBase}.\n *\n * This hook wraps {@link createUnit} to return a formatter\n * that can convert values into human-readable localized units\n * (e.g., \"10 km\", \"5 lbs\").\n *\n * @example\n * ```tsx\n * const formatUnit = useUnit();\n * const distance = formatUnit(10, { unit: \"kilometer\" });\n * // \"10 km\" (depending on locale)\n * ```\n *\n * @returns {Function} A unit formatting function that accepts a value and optional formatting options.\n */\nexport const useUnit = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useCallback(\n (...args: Parameters<typeof units>) =>\n units(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n }),\n [locale]\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAa,gBAAgB;CAC3B,MAAM,EAAE,wCAAsBA,sDAAsB;AAEpD,uCACG,GAAG,8CACI,KAAK,IAAI;EACb,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU;EAC5B,CAAC,EACJ,CAAC,OAAO,CACT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCompact.mjs","names":[],"sources":["../../../../src/client/format/useCompact.ts"],"sourcesContent":["import { compact } from '@intlayer/core/formatters';\nimport { useCallback, useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React client hook that provides a compact number formatter\n * bound to the current application locale.\n *\n * @example\n * ```tsx\n * const formatCompact = useCompact();\n * formatCompact(1500); // \"1.5K\"\n * ```\n */\nexport const useCompact = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useCallback(\n (...args: Parameters<typeof compact>) =>\n compact(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n }),\n [locale]\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;AAcA,MAAa,mBAAmB;CAC9B,MAAM,EAAE,WAAW,WAAW,sBAAsB;AAEpD,QAAO,aACJ,GAAG,SACF,QAAQ,KAAK,IAAI;EACf,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU;EAC5B,CAAC,EACJ,CAAC,OAAO,CACT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCurrency.mjs","names":[],"sources":["../../../../src/client/format/useCurrency.ts"],"sourcesContent":["import { currency } from '@intlayer/core/formatters';\nimport { useCallback, useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React client hook that provides a currency formatter\n * bound to the current application locale.\n *\n * @returns {(value: string | number, options?: CurrencyProps) => string}\n * A function to format numbers into localized currency strings.\n *\n * @example\n * ```tsx\n * const formatCurrency = useCurrency();\n *\n * formatCurrency(1500, { currency: \"USD\" });\n * // \"$1,500.00\"\n *\n * formatCurrency(1500, { currency: \"EUR\", locale: \"de-DE\" });\n * // \"1.500,00 €\"\n *\n * formatCurrency(9876543.21, {\n * currency: \"JPY\",\n * fractionDigits: 0,\n * });\n * // \"¥9,876,543\"\n * ```\n */\nexport const useCurrency = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useCallback(\n (...args: Parameters<typeof currency>) =>\n currency(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n }),\n [locale]\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAa,oBAAoB;CAC/B,MAAM,EAAE,WAAW,WAAW,sBAAsB;AAEpD,QAAO,aACJ,GAAG,SACF,SAAS,KAAK,IAAI;EAChB,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU;EAC5B,CAAC,EACJ,CAAC,OAAO,CACT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDate.mjs","names":[],"sources":["../../../../src/client/format/useDate.ts"],"sourcesContent":["import { date } from '@intlayer/core/formatters';\nimport { useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React client hook that provides a localized date/time formatter\n * bound to the current application locale.\n *\n * @returns {(date: Date | string | number, options?: DateProps) => string}\n * A function to format dates or timestamps into localized date/time strings.\n *\n * @example\n * ```tsx\n * const formatDate = useDate();\n *\n * formatDate(new Date(\"2025-01-01\"));\n * // \"Jan 1, 2025\"\n *\n * formatDate(\"2025-01-01T15:30:00Z\", {\n * dateStyle: \"full\",\n * timeStyle: \"short\",\n * });\n * // \"Wednesday, January 1, 2025 at 3:30 PM\"\n *\n * formatDate(1735689600000, { locale: \"fr-FR\", dateStyle: \"long\" });\n * // \"1 janvier 2025\"\n * ```\n *\n * @see createDate\n */\nexport const useDate = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return (...args: Parameters<typeof date>) =>\n date(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAa,gBAAgB;CAC3B,MAAM,EAAE,WAAW,WAAW,sBAAsB;AAEpD,SAAQ,GAAG,SACT,KAAK,KAAK,IAAI;EACZ,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU;EAC5B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useIntl.mjs","names":[],"sources":["../../../../src/client/format/useIntl.ts"],"sourcesContent":["import { bindIntl, type WrappedIntl } from '@intlayer/core/formatters';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { useContext, useMemo } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * Preact client hook 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 * ```tsx\n * const intl = useIntl(); // uses context locale\n *\n * // Standard API, but no need to pass locale as the first argument\n * const formatted = new intl.NumberFormat({\n * style: 'currency',\n * currency: 'USD'\n * }).format(123.45);\n * ```\n */\nexport const useIntl = (locale?: LocalesValues) => {\n const { locale: contextLocale } = useContext(IntlayerClientContext);\n const currentLocale = locale ?? contextLocale;\n\n return useMemo<WrappedIntl>(() => bindIntl(currentLocale), [currentLocale]);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAa,WAAW,WAA2B;CACjD,MAAM,EAAE,QAAQ,kBAAkB,WAAW,sBAAsB;CACnE,MAAM,gBAAgB,UAAU;AAEhC,QAAO,cAA2B,SAAS,cAAc,EAAE,CAAC,cAAc,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useList.mjs","names":[],"sources":["../../../../src/client/format/useList.ts"],"sourcesContent":["import { list } from '@intlayer/core/formatters';\nimport { useCallback, useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React client hook that provides a list formatter\n * bound to the current application locale.\n *\n * @returns {(values: (string | number)[], options?: ListProps) => string}\n * A function to format arrays into localized list strings.\n *\n * @example\n * ```tsx\n * const formatList = useList();\n *\n * formatList(['apple', 'banana', 'orange']);\n * // \"apple, banana, and orange\"\n *\n * formatList(['red', 'green', 'blue'], { type: 'disjunction' });\n * // \"red, green, or blue\"\n *\n * formatList([1, 2, 3], { type: 'unit', locale: 'de-DE' });\n * // \"1, 2 und 3\"\n * ```\n */\nexport const useList = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useCallback(\n (...args: Parameters<typeof list>) =>\n list(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n }),\n [locale]\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAa,gBAAgB;CAC3B,MAAM,EAAE,WAAW,WAAW,sBAAsB;AAEpD,QAAO,aACJ,GAAG,SACF,KAAK,KAAK,IAAI;EACZ,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU;EAC5B,CAAC,EACJ,CAAC,OAAO,CACT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useNumber.mjs","names":[],"sources":["../../../../src/client/format/useNumber.ts"],"sourcesContent":["import { number } from '@intlayer/core/formatters';\nimport { useCallback, useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React client hook that provides a localized number formatter.\n *\n * Uses the current locale from {@link useLocaleBase} and returns\n * a function that can be used to format numbers consistently\n * according to the user's locale.\n *\n * @example\n * ```tsx\n * const formatNumber = useNumber();\n *\n * formatNumber(12345);\n * // e.g. \"12,345\" (en-US)\n * // e.g. \"12 345\" (fr-FR)\n *\n * formatNumber(0.75, { style: \"percent\" });\n * // e.g. \"75%\"\n * ```\n *\n * @returns {(value: string | number, options?: import(\"../createNumber\").NumberProps) => string}\n * A number formatting function bound to the active locale.\n */\nexport const useNumber = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useCallback(\n (...args: Parameters<typeof number>) =>\n number(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n }),\n [locale]\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAa,kBAAkB;CAC7B,MAAM,EAAE,WAAW,WAAW,sBAAsB;AAEpD,QAAO,aACJ,GAAG,SACF,OAAO,KAAK,IAAI;EACd,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU;EAC5B,CAAC,EACJ,CAAC,OAAO,CACT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"usePercentage.mjs","names":[],"sources":["../../../../src/client/format/usePercentage.ts"],"sourcesContent":["import { percentage } from '@intlayer/core/formatters';\nimport { useCallback, useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React hook to provide a percentage formatter function\n * based on the current application locale.\n *\n * This hook retrieves the active locale using {@link useLocaleBase}\n * and memoizes a `createPercentage` instance for that locale.\n *\n * @example\n * ```tsx\n * const formatPercentage = usePercentage();\n *\n * const result = formatPercentage(0.875, { maximumFractionDigits: 1 });\n * // \"87.5%\" (depending on locale)\n * ```\n *\n * @returns {(value: string | number, options?: Omit<PercentageOptions, \"value\">) => string}\n * A function that formats numbers or numeric strings into localized percentages.\n */\nexport const usePercentage = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useCallback(\n (...args: Parameters<typeof percentage>) =>\n percentage(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n }),\n [locale]\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAa,sBAAsB;CACjC,MAAM,EAAE,WAAW,WAAW,sBAAsB;AAEpD,QAAO,aACJ,GAAG,SACF,WAAW,KAAK,IAAI;EAClB,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU;EAC5B,CAAC,EACJ,CAAC,OAAO,CACT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useRelativeTime.mjs","names":[],"sources":["../../../../src/client/format/useRelativeTime.ts"],"sourcesContent":["import { relativeTime } from '@intlayer/core/formatters';\nimport { useCallback, useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * Client-side React hook for accessing a localized relative time formatter.\n *\n * This hook:\n * - Reads the current locale from {@link useLocaleBase}.\n * - Creates a new relative time formatter with {@link createRelativeTime}.\n * - Returns a function that can format time differences into localized strings.\n *\n * Example:\n * ```tsx\n * const relativeTime = useRelativeTime();\n * const formatted = relativeTime(new Date(\"2024-08-01\"), new Date());\n * // e.g., \"2 weeks ago\"\n * ```\n *\n * @returns {ReturnType<typeof createRelativeTime>} A relative time formatting function\n * bound to the current client locale.\n */\nexport const useRelativeTime = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useCallback(\n (...args: Parameters<typeof relativeTime>) =>\n relativeTime(args[0], args[1], {\n ...args[2],\n locale: args[2]?.locale ?? locale,\n }),\n [locale]\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAa,wBAAwB;CACnC,MAAM,EAAE,WAAW,WAAW,sBAAsB;AAEpD,QAAO,aACJ,GAAG,SACF,aAAa,KAAK,IAAI,KAAK,IAAI;EAC7B,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU;EAC5B,CAAC,EACJ,CAAC,OAAO,CACT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useUnit.mjs","names":[],"sources":["../../../../src/client/format/useUnit.ts"],"sourcesContent":["import { units } from '@intlayer/core/formatters';\nimport { useCallback, useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React hook that provides a unit formatting function\n * based on the current locale from {@link useLocaleBase}.\n *\n * This hook wraps {@link createUnit} to return a formatter\n * that can convert values into human-readable localized units\n * (e.g., \"10 km\", \"5 lbs\").\n *\n * @example\n * ```tsx\n * const formatUnit = useUnit();\n * const distance = formatUnit(10, { unit: \"kilometer\" });\n * // \"10 km\" (depending on locale)\n * ```\n *\n * @returns {Function} A unit formatting function that accepts a value and optional formatting options.\n */\nexport const useUnit = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useCallback(\n (...args: Parameters<typeof units>) =>\n units(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n }),\n [locale]\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAa,gBAAgB;CAC3B,MAAM,EAAE,WAAW,WAAW,sBAAsB;AAEpD,QAAO,aACJ,GAAG,SACF,MAAM,KAAK,IAAI;EACb,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU;EAC5B,CAAC,EACJ,CAAC,OAAO,CACT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCompact.d.ts","names":[],"sources":["../../../../src/client/format/useCompact.ts"],"mappings":";;;;;;AAcA;;;;;;;cAAa,UAAA,SAAU,KAAA,mBAAA,OAAA,GAAA,IAAA,CAAA,mBAAA;WAAA,oCAAA,CAAA,aAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCurrency.d.ts","names":[],"sources":["../../../../src/client/format/useCurrency.ts"],"mappings":";;;;;;AA4BA;;;;;;;;;;;;;;;;;;;;;cAAa,WAAA,SAAW,KAAA,mBAAA,OAAA,GAAA,IAAA,CAAA,mBAAA;WAAA,oCAAA,CAAA,aAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDate.d.ts","names":[],"sources":["../../../../src/client/format/useDate.ts"],"mappings":";;;;;AA8BA;;;;;;;;;;;;;;;;;;;;;;;;cAAa,OAAA,YAGA,IAAA,EAAM,UAAA,QAAkB,IAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useIntl.d.ts","names":[],"sources":["../../../../src/client/format/useIntl.ts"],"mappings":";;;;;;AAuBA;;;;;;;;;;;;;;;;cAAa,OAAA,GAAW,MAAA,GAAS,aAAA,KAAa,WAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useList.d.ts","names":[],"sources":["../../../../src/client/format/useList.ts"],"mappings":";;;;;;AAyBA;;;;;;;;;;;;;;;;;;cAAa,OAAA,SAAO,MAAA,uBAAA,OAAA;;;;;WAWnB,oCAAA,CAAA,aAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useNumber.d.ts","names":[],"sources":["../../../../src/client/format/useNumber.ts"],"mappings":";;;;;;AA0BA;;;;;;;;;;;;;;;;;;;cAAa,SAAA,SAAS,KAAA,mBAAA,OAAA,GAAA,IAAA,CAAA,mBAAA;WAAA,oCAAA,CAAA,aAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"usePercentage.d.ts","names":[],"sources":["../../../../src/client/format/usePercentage.ts"],"mappings":";;;;;;AAsBA;;;;;;;;;;;;;;;cAAa,aAAA,SAAa,KAAA,mBAAA,OAAA,GAAA,IAAA,CAAA,mBAAA;WAAA,oCAAA,CAAA,aAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useRelativeTime.d.ts","names":[],"sources":["../../../../src/client/format/useRelativeTime.ts"],"mappings":";;;;;;AAsBA;;;;;;;;;;;;;;;cAAa,eAAA,SAAe,IAAA,oBAAA,IAAA,EAAA,EAAA,qBAAA,IAAA,EAAA,OAAA,GAAA,IAAA,CAAA,yBAAA;WAAA,oCAAA,CAAA,aAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useUnit.d.ts","names":[],"sources":["../../../../src/client/format/useUnit.ts"],"mappings":";;;;;;AAqBA;;;;;;;;;;;;;;cAAa,OAAA,SAAO,KAAA,mBAAA,OAAA,GAAA,IAAA,CAAA,mBAAA;WAAA,oCAAA,CAAA,aAAA;AAAA"}