preact-intlayer 6.1.6 → 7.0.0-canary.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 (297) hide show
  1. package/dist/cjs/IntlayerNode.cjs +15 -45
  2. package/dist/cjs/IntlayerNode.cjs.map +1 -1
  3. package/dist/cjs/UI/ContentSelector.cjs +98 -130
  4. package/dist/cjs/UI/ContentSelector.cjs.map +1 -1
  5. package/dist/cjs/_virtual/rolldown_runtime.cjs +25 -0
  6. package/dist/cjs/client/IntlayerProvider.cjs +67 -95
  7. package/dist/cjs/client/IntlayerProvider.cjs.map +1 -1
  8. package/dist/cjs/client/format/index.cjs +17 -50
  9. package/dist/cjs/client/format/useCompact.cjs +29 -39
  10. package/dist/cjs/client/format/useCompact.cjs.map +1 -1
  11. package/dist/cjs/client/format/useCurrency.cjs +43 -39
  12. package/dist/cjs/client/format/useCurrency.cjs.map +1 -1
  13. package/dist/cjs/client/format/useDate.cjs +45 -36
  14. package/dist/cjs/client/format/useDate.cjs.map +1 -1
  15. package/dist/cjs/client/format/useList.cjs +40 -39
  16. package/dist/cjs/client/format/useList.cjs.map +1 -1
  17. package/dist/cjs/client/format/useNumber.cjs +41 -39
  18. package/dist/cjs/client/format/useNumber.cjs.map +1 -1
  19. package/dist/cjs/client/format/usePercentage.cjs +37 -39
  20. package/dist/cjs/client/format/usePercentage.cjs.map +1 -1
  21. package/dist/cjs/client/format/useRelativeTime.cjs +37 -39
  22. package/dist/cjs/client/format/useRelativeTime.cjs.map +1 -1
  23. package/dist/cjs/client/format/useUnit.cjs +36 -39
  24. package/dist/cjs/client/format/useUnit.cjs.map +1 -1
  25. package/dist/cjs/client/index.cjs +29 -69
  26. package/dist/cjs/client/t.cjs +21 -34
  27. package/dist/cjs/client/t.cjs.map +1 -1
  28. package/dist/cjs/client/useContent.cjs +16 -36
  29. package/dist/cjs/client/useContent.cjs.map +1 -1
  30. package/dist/cjs/client/useDictionary.cjs +26 -36
  31. package/dist/cjs/client/useDictionary.cjs.map +1 -1
  32. package/dist/cjs/client/useDictionaryAsync.cjs +23 -52
  33. package/dist/cjs/client/useDictionaryAsync.cjs.map +1 -1
  34. package/dist/cjs/client/useDictionaryDynamic.cjs +22 -42
  35. package/dist/cjs/client/useDictionaryDynamic.cjs.map +1 -1
  36. package/dist/cjs/client/useIntlayer.cjs +26 -36
  37. package/dist/cjs/client/useIntlayer.cjs.map +1 -1
  38. package/dist/cjs/client/useLoadDynamic.cjs +21 -50
  39. package/dist/cjs/client/useLoadDynamic.cjs.map +1 -1
  40. package/dist/cjs/client/useLocale.cjs +36 -67
  41. package/dist/cjs/client/useLocale.cjs.map +1 -1
  42. package/dist/cjs/client/useLocaleBase.cjs +25 -53
  43. package/dist/cjs/client/useLocaleBase.cjs.map +1 -1
  44. package/dist/cjs/client/useLocaleStorage.cjs +60 -0
  45. package/dist/cjs/client/useLocaleStorage.cjs.map +1 -0
  46. package/dist/cjs/client/useTraduction.cjs +34 -35
  47. package/dist/cjs/client/useTraduction.cjs.map +1 -1
  48. package/dist/cjs/editor/CommunicatorContext.cjs +40 -62
  49. package/dist/cjs/editor/CommunicatorContext.cjs.map +1 -1
  50. package/dist/cjs/editor/ConfigurationContext.cjs +26 -47
  51. package/dist/cjs/editor/ConfigurationContext.cjs.map +1 -1
  52. package/dist/cjs/editor/ContentSelectorWrapper.cjs +58 -94
  53. package/dist/cjs/editor/ContentSelectorWrapper.cjs.map +1 -1
  54. package/dist/cjs/editor/DictionariesRecordContext.cjs +47 -73
  55. package/dist/cjs/editor/DictionariesRecordContext.cjs.map +1 -1
  56. package/dist/cjs/editor/EditedContentContext.cjs +160 -211
  57. package/dist/cjs/editor/EditedContentContext.cjs.map +1 -1
  58. package/dist/cjs/editor/EditorEnabledContext.cjs +34 -59
  59. package/dist/cjs/editor/EditorEnabledContext.cjs.map +1 -1
  60. package/dist/cjs/editor/EditorProvider.cjs +62 -66
  61. package/dist/cjs/editor/EditorProvider.cjs.map +1 -1
  62. package/dist/cjs/editor/FocusDictionaryContext.cjs +51 -75
  63. package/dist/cjs/editor/FocusDictionaryContext.cjs.map +1 -1
  64. package/dist/cjs/editor/IntlayerEditorProvider.cjs +45 -94
  65. package/dist/cjs/editor/IntlayerEditorProvider.cjs.map +1 -1
  66. package/dist/cjs/editor/index.cjs +3 -23
  67. package/dist/cjs/editor/useCrossFrameMessageListener.cjs +73 -50
  68. package/dist/cjs/editor/useCrossFrameMessageListener.cjs.map +1 -1
  69. package/dist/cjs/editor/useCrossFrameState.cjs +106 -73
  70. package/dist/cjs/editor/useCrossFrameState.cjs.map +1 -1
  71. package/dist/cjs/editor/useCrossURLPathState.cjs +67 -66
  72. package/dist/cjs/editor/useCrossURLPathState.cjs.map +1 -1
  73. package/dist/cjs/editor/useEditedContentRenderer.cjs +27 -59
  74. package/dist/cjs/editor/useEditedContentRenderer.cjs.map +1 -1
  75. package/dist/cjs/editor/useIframeClickInterceptor.cjs +24 -47
  76. package/dist/cjs/editor/useIframeClickInterceptor.cjs.map +1 -1
  77. package/dist/cjs/getDictionary.cjs +15 -40
  78. package/dist/cjs/getDictionary.cjs.map +1 -1
  79. package/dist/cjs/getIntlayer.cjs +15 -36
  80. package/dist/cjs/getIntlayer.cjs.map +1 -1
  81. package/dist/cjs/index.cjs +30 -62
  82. package/dist/cjs/markdown/MarkdownProvider.cjs +19 -39
  83. package/dist/cjs/markdown/MarkdownProvider.cjs.map +1 -1
  84. package/dist/cjs/markdown/MarkdownRenderer.cjs +39 -80
  85. package/dist/cjs/markdown/MarkdownRenderer.cjs.map +1 -1
  86. package/dist/cjs/markdown/index.cjs +7 -25
  87. package/dist/cjs/plugins.cjs +97 -119
  88. package/dist/cjs/plugins.cjs.map +1 -1
  89. package/dist/cjs/preactElement/renderPreactElement.cjs +34 -59
  90. package/dist/cjs/preactElement/renderPreactElement.cjs.map +1 -1
  91. package/dist/esm/IntlayerNode.mjs +13 -25
  92. package/dist/esm/IntlayerNode.mjs.map +1 -1
  93. package/dist/esm/UI/ContentSelector.mjs +94 -105
  94. package/dist/esm/UI/ContentSelector.mjs.map +1 -1
  95. package/dist/esm/client/IntlayerProvider.mjs +51 -54
  96. package/dist/esm/client/IntlayerProvider.mjs.map +1 -1
  97. package/dist/esm/client/format/index.mjs +2 -11
  98. package/dist/esm/client/format/useCompact.mjs +24 -13
  99. package/dist/esm/client/format/useCompact.mjs.map +1 -1
  100. package/dist/esm/client/format/useCurrency.mjs +38 -13
  101. package/dist/esm/client/format/useCurrency.mjs.map +1 -1
  102. package/dist/esm/client/format/useDate.mjs +40 -10
  103. package/dist/esm/client/format/useDate.mjs.map +1 -1
  104. package/dist/esm/client/format/useList.mjs +35 -13
  105. package/dist/esm/client/format/useList.mjs.map +1 -1
  106. package/dist/esm/client/format/useNumber.mjs +36 -13
  107. package/dist/esm/client/format/useNumber.mjs.map +1 -1
  108. package/dist/esm/client/format/usePercentage.mjs +32 -13
  109. package/dist/esm/client/format/usePercentage.mjs.map +1 -1
  110. package/dist/esm/client/format/useRelativeTime.mjs +32 -13
  111. package/dist/esm/client/format/useRelativeTime.mjs.map +1 -1
  112. package/dist/esm/client/format/useUnit.mjs +31 -13
  113. package/dist/esm/client/format/useUnit.mjs.map +1 -1
  114. package/dist/esm/client/index.mjs +5 -32
  115. package/dist/esm/client/t.mjs +16 -8
  116. package/dist/esm/client/t.mjs.map +1 -1
  117. package/dist/esm/client/useContent.mjs +14 -10
  118. package/dist/esm/client/useContent.mjs.map +1 -1
  119. package/dist/esm/client/useDictionary.mjs +23 -11
  120. package/dist/esm/client/useDictionary.mjs.map +1 -1
  121. package/dist/esm/client/useDictionaryAsync.mjs +18 -16
  122. package/dist/esm/client/useDictionaryAsync.mjs.map +1 -1
  123. package/dist/esm/client/useDictionaryDynamic.mjs +17 -15
  124. package/dist/esm/client/useDictionaryDynamic.mjs.map +1 -1
  125. package/dist/esm/client/useIntlayer.mjs +23 -11
  126. package/dist/esm/client/useIntlayer.mjs.map +1 -1
  127. package/dist/esm/client/useLoadDynamic.mjs +20 -26
  128. package/dist/esm/client/useLoadDynamic.mjs.map +1 -1
  129. package/dist/esm/client/useLocale.mjs +31 -31
  130. package/dist/esm/client/useLocale.mjs.map +1 -1
  131. package/dist/esm/client/useLocaleBase.mjs +19 -16
  132. package/dist/esm/client/useLocaleBase.mjs.map +1 -1
  133. package/dist/esm/client/useLocaleStorage.mjs +52 -0
  134. package/dist/esm/client/useLocaleStorage.mjs.map +1 -0
  135. package/dist/esm/client/useTraduction.mjs +29 -9
  136. package/dist/esm/client/useTraduction.mjs.map +1 -1
  137. package/dist/esm/editor/CommunicatorContext.mjs +28 -24
  138. package/dist/esm/editor/CommunicatorContext.mjs.map +1 -1
  139. package/dist/esm/editor/ConfigurationContext.mjs +20 -24
  140. package/dist/esm/editor/ConfigurationContext.mjs.map +1 -1
  141. package/dist/esm/editor/ContentSelectorWrapper.mjs +50 -70
  142. package/dist/esm/editor/ContentSelectorWrapper.mjs.map +1 -1
  143. package/dist/esm/editor/DictionariesRecordContext.mjs +37 -47
  144. package/dist/esm/editor/DictionariesRecordContext.mjs.map +1 -1
  145. package/dist/esm/editor/EditedContentContext.mjs +146 -187
  146. package/dist/esm/editor/EditedContentContext.mjs.map +1 -1
  147. package/dist/esm/editor/EditorEnabledContext.mjs +23 -33
  148. package/dist/esm/editor/EditorEnabledContext.mjs.map +1 -1
  149. package/dist/esm/editor/EditorProvider.mjs +57 -54
  150. package/dist/esm/editor/EditorProvider.mjs.map +1 -1
  151. package/dist/esm/editor/FocusDictionaryContext.mjs +42 -49
  152. package/dist/esm/editor/FocusDictionaryContext.mjs.map +1 -1
  153. package/dist/esm/editor/IntlayerEditorProvider.mjs +37 -55
  154. package/dist/esm/editor/IntlayerEditorProvider.mjs.map +1 -1
  155. package/dist/esm/editor/index.mjs +3 -2
  156. package/dist/esm/editor/useCrossFrameMessageListener.mjs +68 -24
  157. package/dist/esm/editor/useCrossFrameMessageListener.mjs.map +1 -1
  158. package/dist/esm/editor/useCrossFrameState.mjs +102 -47
  159. package/dist/esm/editor/useCrossFrameState.mjs.map +1 -1
  160. package/dist/esm/editor/useCrossURLPathState.mjs +60 -40
  161. package/dist/esm/editor/useCrossURLPathState.mjs.map +1 -1
  162. package/dist/esm/editor/useEditedContentRenderer.mjs +23 -33
  163. package/dist/esm/editor/useEditedContentRenderer.mjs.map +1 -1
  164. package/dist/esm/editor/useIframeClickInterceptor.mjs +18 -20
  165. package/dist/esm/editor/useIframeClickInterceptor.mjs.map +1 -1
  166. package/dist/esm/getDictionary.mjs +13 -22
  167. package/dist/esm/getDictionary.mjs.map +1 -1
  168. package/dist/esm/getIntlayer.mjs +13 -18
  169. package/dist/esm/getIntlayer.mjs.map +1 -1
  170. package/dist/esm/index.mjs +13 -39
  171. package/dist/esm/markdown/MarkdownProvider.mjs +14 -16
  172. package/dist/esm/markdown/MarkdownProvider.mjs.map +1 -1
  173. package/dist/esm/markdown/MarkdownRenderer.mjs +34 -57
  174. package/dist/esm/markdown/MarkdownRenderer.mjs.map +1 -1
  175. package/dist/esm/markdown/index.mjs +4 -3
  176. package/dist/esm/plugins.mjs +86 -92
  177. package/dist/esm/plugins.mjs.map +1 -1
  178. package/dist/esm/preactElement/renderPreactElement.mjs +31 -34
  179. package/dist/esm/preactElement/renderPreactElement.mjs.map +1 -1
  180. package/dist/types/IntlayerNode.d.ts +19 -12
  181. package/dist/types/IntlayerNode.d.ts.map +1 -1
  182. package/dist/types/UI/ContentSelector.d.ts +12 -9
  183. package/dist/types/UI/ContentSelector.d.ts.map +1 -1
  184. package/dist/types/client/IntlayerProvider.d.ts +22 -16
  185. package/dist/types/client/IntlayerProvider.d.ts.map +1 -1
  186. package/dist/types/client/format/index.d.ts +9 -9
  187. package/dist/types/client/format/useCompact.d.ts +8 -2
  188. package/dist/types/client/format/useCompact.d.ts.map +1 -1
  189. package/dist/types/client/format/useCurrency.d.ts +8 -2
  190. package/dist/types/client/format/useCurrency.d.ts.map +1 -1
  191. package/dist/types/client/format/useDate.d.ts +7 -2
  192. package/dist/types/client/format/useDate.d.ts.map +1 -1
  193. package/dist/types/client/format/useList.d.ts +8 -2
  194. package/dist/types/client/format/useList.d.ts.map +1 -1
  195. package/dist/types/client/format/useNumber.d.ts +8 -2
  196. package/dist/types/client/format/useNumber.d.ts.map +1 -1
  197. package/dist/types/client/format/usePercentage.d.ts +8 -2
  198. package/dist/types/client/format/usePercentage.d.ts.map +1 -1
  199. package/dist/types/client/format/useRelativeTime.d.ts +9 -3
  200. package/dist/types/client/format/useRelativeTime.d.ts.map +1 -1
  201. package/dist/types/client/format/useUnit.d.ts +8 -2
  202. package/dist/types/client/format/useUnit.d.ts.map +1 -1
  203. package/dist/types/client/index.d.ts +11 -12
  204. package/dist/types/client/t.d.ts +7 -3
  205. package/dist/types/client/t.d.ts.map +1 -1
  206. package/dist/types/client/useContent.d.ts +10 -5
  207. package/dist/types/client/useContent.d.ts.map +1 -1
  208. package/dist/types/client/useDictionary.d.ts +9 -3
  209. package/dist/types/client/useDictionary.d.ts.map +1 -1
  210. package/dist/types/client/useDictionaryAsync.d.ts +7 -3
  211. package/dist/types/client/useDictionaryAsync.d.ts.map +1 -1
  212. package/dist/types/client/useDictionaryDynamic.d.ts +9 -3
  213. package/dist/types/client/useDictionaryDynamic.d.ts.map +1 -1
  214. package/dist/types/client/useIntlayer.d.ts +8 -5
  215. package/dist/types/client/useIntlayer.d.ts.map +1 -1
  216. package/dist/types/client/useLoadDynamic.d.ts +4 -1
  217. package/dist/types/client/useLoadDynamic.d.ts.map +1 -1
  218. package/dist/types/client/useLocale.d.ts +16 -8
  219. package/dist/types/client/useLocale.d.ts.map +1 -1
  220. package/dist/types/client/useLocaleBase.d.ts +10 -5
  221. package/dist/types/client/useLocaleBase.d.ts.map +1 -1
  222. package/dist/types/client/useLocaleStorage.d.ts +45 -0
  223. package/dist/types/client/useLocaleStorage.d.ts.map +1 -0
  224. package/dist/types/client/useTraduction.d.ts +7 -2
  225. package/dist/types/client/useTraduction.d.ts.map +1 -1
  226. package/dist/types/editor/CommunicatorContext.d.ts +15 -11
  227. package/dist/types/editor/CommunicatorContext.d.ts.map +1 -1
  228. package/dist/types/editor/ConfigurationContext.d.ts +12 -7
  229. package/dist/types/editor/ConfigurationContext.d.ts.map +1 -1
  230. package/dist/types/editor/ContentSelectorWrapper.d.ts +8 -4
  231. package/dist/types/editor/ContentSelectorWrapper.d.ts.map +1 -1
  232. package/dist/types/editor/DictionariesRecordContext.d.ts +15 -12
  233. package/dist/types/editor/DictionariesRecordContext.d.ts.map +1 -1
  234. package/dist/types/editor/EditedContentContext.d.ts +32 -29
  235. package/dist/types/editor/EditedContentContext.d.ts.map +1 -1
  236. package/dist/types/editor/EditorEnabledContext.d.ts +14 -9
  237. package/dist/types/editor/EditorEnabledContext.d.ts.map +1 -1
  238. package/dist/types/editor/EditorProvider.d.ts +9 -5
  239. package/dist/types/editor/EditorProvider.d.ts.map +1 -1
  240. package/dist/types/editor/FocusDictionaryContext.d.ts +18 -15
  241. package/dist/types/editor/FocusDictionaryContext.d.ts.map +1 -1
  242. package/dist/types/editor/IntlayerEditorProvider.d.ts +7 -3
  243. package/dist/types/editor/IntlayerEditorProvider.d.ts.map +1 -1
  244. package/dist/types/editor/index.d.ts +2 -2
  245. package/dist/types/editor/useCrossFrameMessageListener.d.ts +7 -2
  246. package/dist/types/editor/useCrossFrameMessageListener.d.ts.map +1 -1
  247. package/dist/types/editor/useCrossFrameState.d.ts +11 -7
  248. package/dist/types/editor/useCrossFrameState.d.ts.map +1 -1
  249. package/dist/types/editor/useCrossURLPathState.d.ts +8 -3
  250. package/dist/types/editor/useCrossURLPathState.d.ts.map +1 -1
  251. package/dist/types/editor/useEditedContentRenderer.d.ts +16 -10
  252. package/dist/types/editor/useEditedContentRenderer.d.ts.map +1 -1
  253. package/dist/types/editor/useIframeClickInterceptor.d.ts +5 -2
  254. package/dist/types/editor/useIframeClickInterceptor.d.ts.map +1 -1
  255. package/dist/types/getDictionary.d.ts +8 -4
  256. package/dist/types/getDictionary.d.ts.map +1 -1
  257. package/dist/types/getIntlayer.d.ts +8 -4
  258. package/dist/types/getIntlayer.d.ts.map +1 -1
  259. package/dist/types/index.d.ts +18 -6
  260. package/dist/types/index.d.ts.map +1 -1
  261. package/dist/types/markdown/MarkdownProvider.d.ts +8 -5
  262. package/dist/types/markdown/MarkdownProvider.d.ts.map +1 -1
  263. package/dist/types/markdown/MarkdownRenderer.d.ts +13 -11
  264. package/dist/types/markdown/MarkdownRenderer.d.ts.map +1 -1
  265. package/dist/types/markdown/index.d.ts +3 -3
  266. package/dist/types/plugins.d.ts +33 -27
  267. package/dist/types/plugins.d.ts.map +1 -1
  268. package/dist/types/preactElement/renderPreactElement.d.ts +7 -3
  269. package/dist/types/preactElement/renderPreactElement.d.ts.map +1 -1
  270. package/package.json +40 -46
  271. package/LICENSE +0 -202
  272. package/dist/cjs/client/format/index.cjs.map +0 -1
  273. package/dist/cjs/client/getBrowserLocale.cjs +0 -173
  274. package/dist/cjs/client/getBrowserLocale.cjs.map +0 -1
  275. package/dist/cjs/client/index.cjs.map +0 -1
  276. package/dist/cjs/client/useLocaleCookie.cjs +0 -60
  277. package/dist/cjs/client/useLocaleCookie.cjs.map +0 -1
  278. package/dist/cjs/editor/index.cjs.map +0 -1
  279. package/dist/cjs/index.cjs.map +0 -1
  280. package/dist/cjs/markdown/index.cjs.map +0 -1
  281. package/dist/esm/client/format/index.mjs.map +0 -1
  282. package/dist/esm/client/getBrowserLocale.mjs +0 -138
  283. package/dist/esm/client/getBrowserLocale.mjs.map +0 -1
  284. package/dist/esm/client/index.mjs.map +0 -1
  285. package/dist/esm/client/useLocaleCookie.mjs +0 -24
  286. package/dist/esm/client/useLocaleCookie.mjs.map +0 -1
  287. package/dist/esm/editor/index.mjs.map +0 -1
  288. package/dist/esm/index.mjs.map +0 -1
  289. package/dist/esm/markdown/index.mjs.map +0 -1
  290. package/dist/types/client/format/index.d.ts.map +0 -1
  291. package/dist/types/client/getBrowserLocale.d.ts +0 -25
  292. package/dist/types/client/getBrowserLocale.d.ts.map +0 -1
  293. package/dist/types/client/index.d.ts.map +0 -1
  294. package/dist/types/client/useLocaleCookie.d.ts +0 -17
  295. package/dist/types/client/useLocaleCookie.d.ts.map +0 -1
  296. package/dist/types/editor/index.d.ts.map +0 -1
  297. package/dist/types/markdown/index.d.ts.map +0 -1
@@ -1,173 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var getBrowserLocale_exports = {};
30
- __export(getBrowserLocale_exports, {
31
- LanguageDetector: () => LanguageDetector,
32
- getBrowserLocale: () => getBrowserLocale
33
- });
34
- module.exports = __toCommonJS(getBrowserLocale_exports);
35
- var import_built = __toESM(require("@intlayer/config/built"));
36
- var import_client = require("@intlayer/config/client");
37
- var LanguageDetector = /* @__PURE__ */ ((LanguageDetector2) => {
38
- LanguageDetector2["Querystring"] = "querystring";
39
- LanguageDetector2["Cookie"] = "cookie";
40
- LanguageDetector2["LocalStorage"] = "localStorage";
41
- LanguageDetector2["SessionStorage"] = "sessionStorage";
42
- LanguageDetector2["Navigator"] = "navigator";
43
- LanguageDetector2["HtmlTag"] = "htmlTag";
44
- return LanguageDetector2;
45
- })(LanguageDetector || {});
46
- const getDefaultsOptions = () => {
47
- const { middleware } = import_built.default;
48
- return {
49
- order: [
50
- "querystring" /* Querystring */,
51
- "cookie" /* Cookie */,
52
- "navigator" /* Navigator */,
53
- "htmlTag" /* HtmlTag */
54
- ],
55
- lookupQuerystring: "locale",
56
- lookupCookie: middleware?.cookieName,
57
- htmlTag: document.documentElement
58
- };
59
- };
60
- const isLocalStorageAvailable = () => {
61
- try {
62
- if (typeof window === "undefined") return false;
63
- const testKey = "intlayer.translate.boo";
64
- window.localStorage.setItem(testKey, "foo");
65
- window.localStorage.removeItem(testKey);
66
- return true;
67
- } catch {
68
- return false;
69
- }
70
- };
71
- const isSessionStorageAvailable = () => {
72
- try {
73
- if (typeof window === "undefined") return false;
74
- const testKey = "intlayer.translate.boo";
75
- window.sessionStorage.setItem(testKey, "foo");
76
- window.sessionStorage.removeItem(testKey);
77
- return true;
78
- } catch {
79
- return false;
80
- }
81
- };
82
- const detectLanguage = (order, options) => {
83
- const detected = {};
84
- const queryStringDetector = () => {
85
- if (typeof window === "undefined") return;
86
- const search = window.location.search || "";
87
- const params = new URLSearchParams(search);
88
- const value = params.get(options.lookupQuerystring ?? "");
89
- if (value) {
90
- detected["querystring" /* Querystring */] = value;
91
- }
92
- };
93
- const cookieDetector = () => {
94
- if (typeof document === "undefined") return;
95
- const cookies = document.cookie.split(";");
96
- const cookieName = `${options.lookupCookie ?? ""}=`;
97
- const cookie = cookies.find((c) => c.trim().startsWith(cookieName));
98
- if (cookie) {
99
- const value = cookie.split("=")[1].trim();
100
- detected["cookie" /* Cookie */] = value;
101
- }
102
- };
103
- const localStorageDetector = () => {
104
- if (!isLocalStorageAvailable()) return;
105
- const value = window.localStorage.getItem(options.lookupLocalStorage ?? "");
106
- if (value) {
107
- detected["localStorage" /* LocalStorage */] = value;
108
- }
109
- };
110
- const sessionStorageDetector = () => {
111
- if (!isSessionStorageAvailable()) return;
112
- const value = window.sessionStorage.getItem(
113
- options.lookupSessionStorage ?? ""
114
- );
115
- if (value) {
116
- detected["sessionStorage" /* SessionStorage */] = value;
117
- }
118
- };
119
- const navigatorDetector = () => {
120
- if (typeof navigator === "undefined") return;
121
- if (navigator.language) {
122
- detected["navigator" /* Navigator */] = navigator.language;
123
- }
124
- };
125
- const htmlTagDetector = () => {
126
- const htmlTag = options.htmlTag;
127
- if (htmlTag && typeof htmlTag.getAttribute === "function") {
128
- const lang = htmlTag.getAttribute("lang");
129
- if (lang) {
130
- detected["htmlTag" /* HtmlTag */] = lang;
131
- }
132
- }
133
- };
134
- const detectors = {
135
- ["querystring" /* Querystring */]: queryStringDetector,
136
- ["cookie" /* Cookie */]: cookieDetector,
137
- ["localStorage" /* LocalStorage */]: localStorageDetector,
138
- ["sessionStorage" /* SessionStorage */]: sessionStorageDetector,
139
- ["navigator" /* Navigator */]: navigatorDetector,
140
- ["htmlTag" /* HtmlTag */]: htmlTagDetector
141
- };
142
- order.forEach((detectorName) => {
143
- detectors[detectorName]?.();
144
- });
145
- return detected;
146
- };
147
- const getFirstAvailableLocale = (locales, order) => {
148
- const { internationalization } = import_built.default;
149
- for (const detector of order) {
150
- const localesArray = [locales[detector]].flat();
151
- for (const locale of localesArray) {
152
- if (locale && (internationalization?.locales).includes(locale)) {
153
- return locale;
154
- } else if (locale?.includes("-") && (internationalization?.locales).includes(
155
- locale.split("-")[0]
156
- )) {
157
- return locale.split("-")[0];
158
- }
159
- }
160
- }
161
- return internationalization?.defaultLocale ?? import_client.Locales.ENGLISH;
162
- };
163
- const getBrowserLocale = (userOptions = {}) => {
164
- const options = { ...getDefaultsOptions(), ...userOptions };
165
- const locales = detectLanguage(options.order ?? [], options);
166
- return getFirstAvailableLocale(locales, options.order ?? []);
167
- };
168
- // Annotate the CommonJS export names for ESM import in node:
169
- 0 && (module.exports = {
170
- LanguageDetector,
171
- getBrowserLocale
172
- });
173
- //# sourceMappingURL=getBrowserLocale.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/client/getBrowserLocale.tsx"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport { Locales } from '@intlayer/config/client';\n\nexport enum LanguageDetector {\n Querystring = 'querystring',\n Cookie = 'cookie',\n LocalStorage = 'localStorage',\n SessionStorage = 'sessionStorage',\n Navigator = 'navigator',\n HtmlTag = 'htmlTag',\n}\n\n// Default settings for the language detector\ntype LanguageDetectorOptions = {\n order?: LanguageDetector[];\n lookupQuerystring?: string;\n lookupCookie?: string;\n lookupLocalStorage?: string;\n lookupSessionStorage?: string;\n excludeCacheFor?: string[];\n htmlTag?: HTMLElement | null;\n};\n\nconst getDefaultsOptions = (): LanguageDetectorOptions => {\n const { middleware } = configuration;\n\n return {\n order: [\n LanguageDetector.Querystring,\n LanguageDetector.Cookie,\n LanguageDetector.Navigator,\n LanguageDetector.HtmlTag,\n ],\n lookupQuerystring: 'locale',\n lookupCookie: middleware?.cookieName,\n htmlTag: document.documentElement,\n };\n};\n\n// Helper functions for various checks and operations\nconst isLocalStorageAvailable = (): boolean => {\n try {\n if (typeof window === 'undefined') return false;\n const testKey = 'intlayer.translate.boo';\n window.localStorage.setItem(testKey, 'foo');\n window.localStorage.removeItem(testKey);\n return true;\n } catch {\n return false;\n }\n};\n\nconst isSessionStorageAvailable = (): boolean => {\n try {\n if (typeof window === 'undefined') return false;\n const testKey = 'intlayer.translate.boo';\n window.sessionStorage.setItem(testKey, 'foo');\n window.sessionStorage.removeItem(testKey);\n return true;\n } catch {\n return false;\n }\n};\n\n// Function to detect language using different detectors\nconst detectLanguage = (\n order: string[],\n options: LanguageDetectorOptions\n): Record<LanguageDetector, Locales | Locales[]> => {\n const detected: Record<LanguageDetector, Locales | Locales[]> = {} as Record<\n LanguageDetector,\n Locales | Locales[]\n >;\n\n const queryStringDetector = () => {\n if (typeof window === 'undefined') return;\n const search = window.location.search || '';\n const params = new URLSearchParams(search);\n const value = params.get(options.lookupQuerystring ?? '');\n if (value) {\n detected[LanguageDetector.Querystring] = value as Locales;\n }\n };\n\n const cookieDetector = () => {\n if (typeof document === 'undefined') return;\n const cookies = document.cookie.split(';');\n const cookieName = `${options.lookupCookie ?? ''}=`;\n const cookie = cookies.find((c) => c.trim().startsWith(cookieName));\n if (cookie) {\n const value = cookie.split('=')[1].trim();\n\n detected[LanguageDetector.Cookie] = value as Locales;\n }\n };\n\n const localStorageDetector = () => {\n if (!isLocalStorageAvailable()) return;\n const value = window.localStorage.getItem(options.lookupLocalStorage ?? '');\n if (value) {\n detected[LanguageDetector.LocalStorage] = value as Locales;\n }\n };\n\n const sessionStorageDetector = () => {\n if (!isSessionStorageAvailable()) return;\n const value = window.sessionStorage.getItem(\n options.lookupSessionStorage ?? ''\n );\n if (value) {\n detected[LanguageDetector.SessionStorage] = value as Locales;\n }\n };\n\n const navigatorDetector = () => {\n if (typeof navigator === 'undefined') return;\n\n if (navigator.language) {\n detected[LanguageDetector.Navigator] = navigator.language as Locales;\n }\n };\n\n const htmlTagDetector = () => {\n const htmlTag = options.htmlTag;\n if (htmlTag && typeof htmlTag.getAttribute === 'function') {\n const lang = htmlTag.getAttribute('lang');\n if (lang) {\n detected[LanguageDetector.HtmlTag] = lang as Locales;\n }\n }\n };\n\n // Map detector names to their corresponding functions\n const detectors: Record<string, () => void> = {\n [LanguageDetector.Querystring]: queryStringDetector,\n [LanguageDetector.Cookie]: cookieDetector,\n [LanguageDetector.LocalStorage]: localStorageDetector,\n [LanguageDetector.SessionStorage]: sessionStorageDetector,\n [LanguageDetector.Navigator]: navigatorDetector,\n [LanguageDetector.HtmlTag]: htmlTagDetector,\n };\n\n // Use the provided order to run each detector\n order.forEach((detectorName) => {\n detectors[detectorName]?.();\n });\n\n return detected;\n};\n\nconst getFirstAvailableLocale = (\n locales: Record<LanguageDetector, Locales | Locales[]>,\n order: LanguageDetector[]\n): Locales => {\n const { internationalization } = configuration;\n\n for (const detector of order) {\n const localesArray = [locales[detector]].flat();\n\n for (const locale of localesArray) {\n if (locale && (internationalization?.locales).includes(locale)) {\n return locale;\n } else if (\n locale?.includes('-') &&\n (internationalization?.locales).includes(\n locale.split('-')[0] as Locales\n )\n ) {\n return locale.split('-')[0] as Locales;\n }\n }\n }\n\n return internationalization?.defaultLocale ?? Locales.ENGLISH;\n};\n\n/**\n * Core language detector function\n * const detectedLanguages = detectLanguage(['LanguageDetector.Cookie', 'LanguageDetector.LocalStorage'], { lookupCookie: 'myCookie' });\n */\nexport const getBrowserLocale = (\n userOptions: LanguageDetectorOptions | undefined = {}\n): Locales => {\n const options = { ...getDefaultsOptions(), ...userOptions };\n\n const locales = detectLanguage(options.order ?? [], options);\n\n return getFirstAvailableLocale(locales, options.order ?? []);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA0B;AAC1B,oBAAwB;AAEjB,IAAK,mBAAL,kBAAKA,sBAAL;AACL,EAAAA,kBAAA,iBAAc;AACd,EAAAA,kBAAA,YAAS;AACT,EAAAA,kBAAA,kBAAe;AACf,EAAAA,kBAAA,oBAAiB;AACjB,EAAAA,kBAAA,eAAY;AACZ,EAAAA,kBAAA,aAAU;AANA,SAAAA;AAAA,GAAA;AAoBZ,MAAM,qBAAqB,MAA+B;AACxD,QAAM,EAAE,WAAW,IAAI,aAAAC;AAEvB,SAAO;AAAA,IACL,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,IACnB,cAAc,YAAY;AAAA,IAC1B,SAAS,SAAS;AAAA,EACpB;AACF;AAGA,MAAM,0BAA0B,MAAe;AAC7C,MAA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G,EAAE,CAAC;AAAA,MACrB,GACA;AACA,eAAO,OAAO,MAAM,GAAG,EAAE,CAAC;AAAA,MAC5B;AAAA,IACF;AAAA,EACF;AAEA,SAAO,sBAAsB,iBAAiB,sBAAQ;AACxD;AAMO,MAAM,mBAAmB,CAC9B,cAAmD,CAAC,MACxC;AACZ,QAAM,UAAU,EAAE,GAAG,mBAAmB,GAAG,GAAG,YAAY;AAE1D,QAAM,UAAU,eAAe,QAAQ,SAAS,CAAC,GAAG,OAAO;AAE3D,SAAO,wBAAwB,SAAS,QAAQ,SAAS,CAAC,CAAC;AAC7D;","names":["LanguageDetector","configuration"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/client/index.ts"],"sourcesContent":["export { getBrowserLocale } from './getBrowserLocale';\nexport {\n IntlayerClientContext,\n IntlayerProvider,\n IntlayerProviderContent,\n useIntlayerContext,\n type IntlayerProviderProps,\n} from './IntlayerProvider';\nexport { t } from './t';\nexport { useDictionary } from './useDictionary';\nexport { useDictionaryAsync } from './useDictionaryAsync';\nexport { useDictionaryDynamic } from './useDictionaryDynamic';\nexport { useIntlayer } from './useIntlayer';\nexport { useLoadDynamic } from './useLoadDynamic';\nexport { useLocale } from './useLocale';\nexport { useLocaleBase } from './useLocaleBase';\nexport {\n localeCookie,\n setLocaleCookie,\n useLocaleCookie,\n} from './useLocaleCookie';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAAiC;AACjC,8BAMO;AACP,eAAkB;AAClB,2BAA8B;AAC9B,gCAAmC;AACnC,kCAAqC;AACrC,yBAA4B;AAC5B,4BAA+B;AAC/B,uBAA0B;AAC1B,2BAA8B;AAC9B,6BAIO;","names":[]}
@@ -1,60 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var useLocaleCookie_exports = {};
30
- __export(useLocaleCookie_exports, {
31
- localeCookie: () => localeCookie,
32
- setLocaleCookie: () => setLocaleCookie,
33
- useLocaleCookie: () => useLocaleCookie
34
- });
35
- module.exports = __toCommonJS(useLocaleCookie_exports);
36
- var import_built = __toESM(require("@intlayer/config/built"));
37
- var import_js_cookie = __toESM(require("js-cookie"));
38
- const { cookieName } = import_built.default.middleware;
39
- const cookieAttributes = {
40
- path: "/",
41
- expires: void 0,
42
- domain: void 0,
43
- secure: false,
44
- sameSite: "strict"
45
- };
46
- const localeCookie = import_js_cookie.default.get(cookieName);
47
- const setLocaleCookie = (locale) => {
48
- import_js_cookie.default.set(cookieName, locale, cookieAttributes);
49
- };
50
- const useLocaleCookie = () => ({
51
- localeCookie,
52
- setLocaleCookie
53
- });
54
- // Annotate the CommonJS export names for ESM import in node:
55
- 0 && (module.exports = {
56
- localeCookie,
57
- setLocaleCookie,
58
- useLocaleCookie
59
- });
60
- //# sourceMappingURL=useLocaleCookie.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/client/useLocaleCookie.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/config/client';\n\nimport Cookies from 'js-cookie';\n\nconst { cookieName } = configuration.middleware;\n\nconst cookieAttributes: Cookies.CookieAttributes = {\n path: '/',\n expires: undefined,\n domain: undefined,\n secure: false,\n sameSite: 'strict',\n};\n\n/**\n * Get the locale cookie\n */\nexport const localeCookie = Cookies.get(cookieName) as unknown as\n | LocalesValues\n | undefined;\n\n/**\n * Set the locale cookie\n */\nexport const setLocaleCookie = (locale: LocalesValues) => {\n Cookies.set(cookieName, locale, cookieAttributes);\n};\n\n/**\n * Hook that provides the locale cookie and a function to set it\n */\nexport const useLocaleCookie = () => ({\n localeCookie,\n setLocaleCookie,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA0B;AAG1B,uBAAoB;AAEpB,MAAM,EAAE,WAAW,IAAI,aAAAA,QAAc;AAErC,MAAM,mBAA6C;AAAA,EACjD,MAAM;AAAA,EACN,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AACZ;AAKO,MAAM,eAAe,iBAAAC,QAAQ,IAAI,UAAU;AAO3C,MAAM,kBAAkB,CAAC,WAA0B;AACxD,mBAAAA,QAAQ,IAAI,YAAY,QAAQ,gBAAgB;AAClD;AAKO,MAAM,kBAAkB,OAAO;AAAA,EACpC;AAAA,EACA;AACF;","names":["configuration","Cookies"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/editor/index.ts"],"sourcesContent":["export * from './ContentSelectorWrapper';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,2BAAc,qCAAd;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import type { IInterpreterPluginPreact } from './plugins';\n\ndeclare module '@intlayer/core' {\n interface IInterpreterPlugin<T, S> extends IInterpreterPluginPreact<T> {}\n}\n\nexport {\n getBrowserLocale,\n IntlayerClientContext,\n IntlayerProvider,\n IntlayerProviderContent,\n localeCookie,\n setLocaleCookie,\n t,\n useDictionary,\n useDictionaryAsync,\n useDictionaryDynamic,\n useIntlayer,\n useIntlayerContext,\n useLoadDynamic,\n useLocale,\n useLocaleBase,\n useLocaleCookie,\n type IntlayerProviderProps,\n} from './client/index';\nexport { type IntlayerNode } from './IntlayerNode';\nexport { MarkdownProvider } from './markdown/index';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,oBAkBO;AAEP,sBAAiC;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/markdown/index.ts"],"sourcesContent":["export * from './MarkdownProvider';\nexport * from './MarkdownRenderer';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,6BAAc,+BAAd;AACA,6BAAc,+BADd;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/client/format/index.ts"],"sourcesContent":["export { useCompact } from './useCompact';\nexport { useCurrency } from './useCurrency';\nexport { useDate } from './useDate';\nexport { useList } from './useList';\nexport { useNumber } from './useNumber';\nexport { usePercentage } from './usePercentage';\nexport { useRelativeTime } from './useRelativeTime';\nexport { useUnit } from './useUnit';\n"],"mappings":"AAAA,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,eAAe;AACxB,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAC1B,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,SAAS,eAAe;","names":[]}
@@ -1,138 +0,0 @@
1
- import configuration from "@intlayer/config/built";
2
- import { Locales } from "@intlayer/config/client";
3
- var LanguageDetector = /* @__PURE__ */ ((LanguageDetector2) => {
4
- LanguageDetector2["Querystring"] = "querystring";
5
- LanguageDetector2["Cookie"] = "cookie";
6
- LanguageDetector2["LocalStorage"] = "localStorage";
7
- LanguageDetector2["SessionStorage"] = "sessionStorage";
8
- LanguageDetector2["Navigator"] = "navigator";
9
- LanguageDetector2["HtmlTag"] = "htmlTag";
10
- return LanguageDetector2;
11
- })(LanguageDetector || {});
12
- const getDefaultsOptions = () => {
13
- const { middleware } = configuration;
14
- return {
15
- order: [
16
- "querystring" /* Querystring */,
17
- "cookie" /* Cookie */,
18
- "navigator" /* Navigator */,
19
- "htmlTag" /* HtmlTag */
20
- ],
21
- lookupQuerystring: "locale",
22
- lookupCookie: middleware?.cookieName,
23
- htmlTag: document.documentElement
24
- };
25
- };
26
- const isLocalStorageAvailable = () => {
27
- try {
28
- if (typeof window === "undefined") return false;
29
- const testKey = "intlayer.translate.boo";
30
- window.localStorage.setItem(testKey, "foo");
31
- window.localStorage.removeItem(testKey);
32
- return true;
33
- } catch {
34
- return false;
35
- }
36
- };
37
- const isSessionStorageAvailable = () => {
38
- try {
39
- if (typeof window === "undefined") return false;
40
- const testKey = "intlayer.translate.boo";
41
- window.sessionStorage.setItem(testKey, "foo");
42
- window.sessionStorage.removeItem(testKey);
43
- return true;
44
- } catch {
45
- return false;
46
- }
47
- };
48
- const detectLanguage = (order, options) => {
49
- const detected = {};
50
- const queryStringDetector = () => {
51
- if (typeof window === "undefined") return;
52
- const search = window.location.search || "";
53
- const params = new URLSearchParams(search);
54
- const value = params.get(options.lookupQuerystring ?? "");
55
- if (value) {
56
- detected["querystring" /* Querystring */] = value;
57
- }
58
- };
59
- const cookieDetector = () => {
60
- if (typeof document === "undefined") return;
61
- const cookies = document.cookie.split(";");
62
- const cookieName = `${options.lookupCookie ?? ""}=`;
63
- const cookie = cookies.find((c) => c.trim().startsWith(cookieName));
64
- if (cookie) {
65
- const value = cookie.split("=")[1].trim();
66
- detected["cookie" /* Cookie */] = value;
67
- }
68
- };
69
- const localStorageDetector = () => {
70
- if (!isLocalStorageAvailable()) return;
71
- const value = window.localStorage.getItem(options.lookupLocalStorage ?? "");
72
- if (value) {
73
- detected["localStorage" /* LocalStorage */] = value;
74
- }
75
- };
76
- const sessionStorageDetector = () => {
77
- if (!isSessionStorageAvailable()) return;
78
- const value = window.sessionStorage.getItem(
79
- options.lookupSessionStorage ?? ""
80
- );
81
- if (value) {
82
- detected["sessionStorage" /* SessionStorage */] = value;
83
- }
84
- };
85
- const navigatorDetector = () => {
86
- if (typeof navigator === "undefined") return;
87
- if (navigator.language) {
88
- detected["navigator" /* Navigator */] = navigator.language;
89
- }
90
- };
91
- const htmlTagDetector = () => {
92
- const htmlTag = options.htmlTag;
93
- if (htmlTag && typeof htmlTag.getAttribute === "function") {
94
- const lang = htmlTag.getAttribute("lang");
95
- if (lang) {
96
- detected["htmlTag" /* HtmlTag */] = lang;
97
- }
98
- }
99
- };
100
- const detectors = {
101
- ["querystring" /* Querystring */]: queryStringDetector,
102
- ["cookie" /* Cookie */]: cookieDetector,
103
- ["localStorage" /* LocalStorage */]: localStorageDetector,
104
- ["sessionStorage" /* SessionStorage */]: sessionStorageDetector,
105
- ["navigator" /* Navigator */]: navigatorDetector,
106
- ["htmlTag" /* HtmlTag */]: htmlTagDetector
107
- };
108
- order.forEach((detectorName) => {
109
- detectors[detectorName]?.();
110
- });
111
- return detected;
112
- };
113
- const getFirstAvailableLocale = (locales, order) => {
114
- const { internationalization } = configuration;
115
- for (const detector of order) {
116
- const localesArray = [locales[detector]].flat();
117
- for (const locale of localesArray) {
118
- if (locale && (internationalization?.locales).includes(locale)) {
119
- return locale;
120
- } else if (locale?.includes("-") && (internationalization?.locales).includes(
121
- locale.split("-")[0]
122
- )) {
123
- return locale.split("-")[0];
124
- }
125
- }
126
- }
127
- return internationalization?.defaultLocale ?? Locales.ENGLISH;
128
- };
129
- const getBrowserLocale = (userOptions = {}) => {
130
- const options = { ...getDefaultsOptions(), ...userOptions };
131
- const locales = detectLanguage(options.order ?? [], options);
132
- return getFirstAvailableLocale(locales, options.order ?? []);
133
- };
134
- export {
135
- LanguageDetector,
136
- getBrowserLocale
137
- };
138
- //# sourceMappingURL=getBrowserLocale.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/client/getBrowserLocale.tsx"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport { Locales } from '@intlayer/config/client';\n\nexport enum LanguageDetector {\n Querystring = 'querystring',\n Cookie = 'cookie',\n LocalStorage = 'localStorage',\n SessionStorage = 'sessionStorage',\n Navigator = 'navigator',\n HtmlTag = 'htmlTag',\n}\n\n// Default settings for the language detector\ntype LanguageDetectorOptions = {\n order?: LanguageDetector[];\n lookupQuerystring?: string;\n lookupCookie?: string;\n lookupLocalStorage?: string;\n lookupSessionStorage?: string;\n excludeCacheFor?: string[];\n htmlTag?: HTMLElement | null;\n};\n\nconst getDefaultsOptions = (): LanguageDetectorOptions => {\n const { middleware } = configuration;\n\n return {\n order: [\n LanguageDetector.Querystring,\n LanguageDetector.Cookie,\n LanguageDetector.Navigator,\n LanguageDetector.HtmlTag,\n ],\n lookupQuerystring: 'locale',\n lookupCookie: middleware?.cookieName,\n htmlTag: document.documentElement,\n };\n};\n\n// Helper functions for various checks and operations\nconst isLocalStorageAvailable = (): boolean => {\n try {\n if (typeof window === 'undefined') return false;\n const testKey = 'intlayer.translate.boo';\n window.localStorage.setItem(testKey, 'foo');\n window.localStorage.removeItem(testKey);\n return true;\n } catch {\n return false;\n }\n};\n\nconst isSessionStorageAvailable = (): boolean => {\n try {\n if (typeof window === 'undefined') return false;\n const testKey = 'intlayer.translate.boo';\n window.sessionStorage.setItem(testKey, 'foo');\n window.sessionStorage.removeItem(testKey);\n return true;\n } catch {\n return false;\n }\n};\n\n// Function to detect language using different detectors\nconst detectLanguage = (\n order: string[],\n options: LanguageDetectorOptions\n): Record<LanguageDetector, Locales | Locales[]> => {\n const detected: Record<LanguageDetector, Locales | Locales[]> = {} as Record<\n LanguageDetector,\n Locales | Locales[]\n >;\n\n const queryStringDetector = () => {\n if (typeof window === 'undefined') return;\n const search = window.location.search || '';\n const params = new URLSearchParams(search);\n const value = params.get(options.lookupQuerystring ?? '');\n if (value) {\n detected[LanguageDetector.Querystring] = value as Locales;\n }\n };\n\n const cookieDetector = () => {\n if (typeof document === 'undefined') return;\n const cookies = document.cookie.split(';');\n const cookieName = `${options.lookupCookie ?? ''}=`;\n const cookie = cookies.find((c) => c.trim().startsWith(cookieName));\n if (cookie) {\n const value = cookie.split('=')[1].trim();\n\n detected[LanguageDetector.Cookie] = value as Locales;\n }\n };\n\n const localStorageDetector = () => {\n if (!isLocalStorageAvailable()) return;\n const value = window.localStorage.getItem(options.lookupLocalStorage ?? '');\n if (value) {\n detected[LanguageDetector.LocalStorage] = value as Locales;\n }\n };\n\n const sessionStorageDetector = () => {\n if (!isSessionStorageAvailable()) return;\n const value = window.sessionStorage.getItem(\n options.lookupSessionStorage ?? ''\n );\n if (value) {\n detected[LanguageDetector.SessionStorage] = value as Locales;\n }\n };\n\n const navigatorDetector = () => {\n if (typeof navigator === 'undefined') return;\n\n if (navigator.language) {\n detected[LanguageDetector.Navigator] = navigator.language as Locales;\n }\n };\n\n const htmlTagDetector = () => {\n const htmlTag = options.htmlTag;\n if (htmlTag && typeof htmlTag.getAttribute === 'function') {\n const lang = htmlTag.getAttribute('lang');\n if (lang) {\n detected[LanguageDetector.HtmlTag] = lang as Locales;\n }\n }\n };\n\n // Map detector names to their corresponding functions\n const detectors: Record<string, () => void> = {\n [LanguageDetector.Querystring]: queryStringDetector,\n [LanguageDetector.Cookie]: cookieDetector,\n [LanguageDetector.LocalStorage]: localStorageDetector,\n [LanguageDetector.SessionStorage]: sessionStorageDetector,\n [LanguageDetector.Navigator]: navigatorDetector,\n [LanguageDetector.HtmlTag]: htmlTagDetector,\n };\n\n // Use the provided order to run each detector\n order.forEach((detectorName) => {\n detectors[detectorName]?.();\n });\n\n return detected;\n};\n\nconst getFirstAvailableLocale = (\n locales: Record<LanguageDetector, Locales | Locales[]>,\n order: LanguageDetector[]\n): Locales => {\n const { internationalization } = configuration;\n\n for (const detector of order) {\n const localesArray = [locales[detector]].flat();\n\n for (const locale of localesArray) {\n if (locale && (internationalization?.locales).includes(locale)) {\n return locale;\n } else if (\n locale?.includes('-') &&\n (internationalization?.locales).includes(\n locale.split('-')[0] as Locales\n )\n ) {\n return locale.split('-')[0] as Locales;\n }\n }\n }\n\n return internationalization?.defaultLocale ?? Locales.ENGLISH;\n};\n\n/**\n * Core language detector function\n * const detectedLanguages = detectLanguage(['LanguageDetector.Cookie', 'LanguageDetector.LocalStorage'], { lookupCookie: 'myCookie' });\n */\nexport const getBrowserLocale = (\n userOptions: LanguageDetectorOptions | undefined = {}\n): Locales => {\n const options = { ...getDefaultsOptions(), ...userOptions };\n\n const locales = detectLanguage(options.order ?? [], options);\n\n return getFirstAvailableLocale(locales, options.order ?? []);\n};\n"],"mappings":"AAAA,OAAO,mBAAmB;AAC1B,SAAS,eAAe;AAEjB,IAAK,mBAAL,kBAAKA,sBAAL;AACL,EAAAA,kBAAA,iBAAc;AACd,EAAAA,kBAAA,YAAS;AACT,EAAAA,kBAAA,kBAAe;AACf,EAAAA,kBAAA,oBAAiB;AACjB,EAAAA,kBAAA,eAAY;AACZ,EAAAA,kBAAA,aAAU;AANA,SAAAA;AAAA,GAAA;AAoBZ,MAAM,qBAAqB,MAA+B;AACxD,QAAM,EAAE,WAAW,IAAI;AAEvB,SAAO;AAAA,IACL,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,IACnB,cAAc,YAAY;AAAA,IAC1B,SAAS,SAAS;AAAA,EACpB;AACF;AAGA,MAA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C9B,OAAO,MAAM,GAAG,EAAE,CAAC;AAAA,MACrB,GACA;AACA,eAAO,OAAO,MAAM,GAAG,EAAE,CAAC;AAAA,MAC5B;AAAA,IACF;AAAA,EACF;AAEA,SAAO,sBAAsB,iBAAiB,QAAQ;AACxD;AAMO,MAAM,mBAAmB,CAC9B,cAAmD,CAAC,MACxC;AACZ,QAAM,UAAU,EAAE,GAAG,mBAAmB,GAAG,GAAG,YAAY;AAE1D,QAAM,UAAU,eAAe,QAAQ,SAAS,CAAC,GAAG,OAAO;AAE3D,SAAO,wBAAwB,SAAS,QAAQ,SAAS,CAAC,CAAC;AAC7D;","names":["LanguageDetector"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/client/index.ts"],"sourcesContent":["export { getBrowserLocale } from './getBrowserLocale';\nexport {\n IntlayerClientContext,\n IntlayerProvider,\n IntlayerProviderContent,\n useIntlayerContext,\n type IntlayerProviderProps,\n} from './IntlayerProvider';\nexport { t } from './t';\nexport { useDictionary } from './useDictionary';\nexport { useDictionaryAsync } from './useDictionaryAsync';\nexport { useDictionaryDynamic } from './useDictionaryDynamic';\nexport { useIntlayer } from './useIntlayer';\nexport { useLoadDynamic } from './useLoadDynamic';\nexport { useLocale } from './useLocale';\nexport { useLocaleBase } from './useLocaleBase';\nexport {\n localeCookie,\n setLocaleCookie,\n useLocaleCookie,\n} from './useLocaleCookie';\n"],"mappings":"AAAA,SAAS,wBAAwB;AACjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,SAAS;AAClB,SAAS,qBAAqB;AAC9B,SAAS,0BAA0B;AACnC,SAAS,4BAA4B;AACrC,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAC/B,SAAS,iBAAiB;AAC1B,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
@@ -1,24 +0,0 @@
1
- import configuration from "@intlayer/config/built";
2
- import Cookies from "js-cookie";
3
- const { cookieName } = configuration.middleware;
4
- const cookieAttributes = {
5
- path: "/",
6
- expires: void 0,
7
- domain: void 0,
8
- secure: false,
9
- sameSite: "strict"
10
- };
11
- const localeCookie = Cookies.get(cookieName);
12
- const setLocaleCookie = (locale) => {
13
- Cookies.set(cookieName, locale, cookieAttributes);
14
- };
15
- const useLocaleCookie = () => ({
16
- localeCookie,
17
- setLocaleCookie
18
- });
19
- export {
20
- localeCookie,
21
- setLocaleCookie,
22
- useLocaleCookie
23
- };
24
- //# sourceMappingURL=useLocaleCookie.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/client/useLocaleCookie.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/config/client';\n\nimport Cookies from 'js-cookie';\n\nconst { cookieName } = configuration.middleware;\n\nconst cookieAttributes: Cookies.CookieAttributes = {\n path: '/',\n expires: undefined,\n domain: undefined,\n secure: false,\n sameSite: 'strict',\n};\n\n/**\n * Get the locale cookie\n */\nexport const localeCookie = Cookies.get(cookieName) as unknown as\n | LocalesValues\n | undefined;\n\n/**\n * Set the locale cookie\n */\nexport const setLocaleCookie = (locale: LocalesValues) => {\n Cookies.set(cookieName, locale, cookieAttributes);\n};\n\n/**\n * Hook that provides the locale cookie and a function to set it\n */\nexport const useLocaleCookie = () => ({\n localeCookie,\n setLocaleCookie,\n});\n"],"mappings":"AAAA,OAAO,mBAAmB;AAG1B,OAAO,aAAa;AAEpB,MAAM,EAAE,WAAW,IAAI,cAAc;AAErC,MAAM,mBAA6C;AAAA,EACjD,MAAM;AAAA,EACN,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AACZ;AAKO,MAAM,eAAe,QAAQ,IAAI,UAAU;AAO3C,MAAM,kBAAkB,CAAC,WAA0B;AACxD,UAAQ,IAAI,YAAY,QAAQ,gBAAgB;AAClD;AAKO,MAAM,kBAAkB,OAAO;AAAA,EACpC;AAAA,EACA;AACF;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/editor/index.ts"],"sourcesContent":["export * from './ContentSelectorWrapper';\n"],"mappings":"AAAA,cAAc;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import type { IInterpreterPluginPreact } from './plugins';\n\ndeclare module '@intlayer/core' {\n interface IInterpreterPlugin<T, S> extends IInterpreterPluginPreact<T> {}\n}\n\nexport {\n getBrowserLocale,\n IntlayerClientContext,\n IntlayerProvider,\n IntlayerProviderContent,\n localeCookie,\n setLocaleCookie,\n t,\n useDictionary,\n useDictionaryAsync,\n useDictionaryDynamic,\n useIntlayer,\n useIntlayerContext,\n useLoadDynamic,\n useLocale,\n useLocaleBase,\n useLocaleCookie,\n type IntlayerProviderProps,\n} from './client/index';\nexport { type IntlayerNode } from './IntlayerNode';\nexport { MarkdownProvider } from './markdown/index';\n"],"mappings":"AAMA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAEP,SAAS,wBAAwB;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/markdown/index.ts"],"sourcesContent":["export * from './MarkdownProvider';\nexport * from './MarkdownRenderer';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/format/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
@@ -1,25 +0,0 @@
1
- import { Locales } from '@intlayer/config/client';
2
- export declare enum LanguageDetector {
3
- Querystring = "querystring",
4
- Cookie = "cookie",
5
- LocalStorage = "localStorage",
6
- SessionStorage = "sessionStorage",
7
- Navigator = "navigator",
8
- HtmlTag = "htmlTag"
9
- }
10
- type LanguageDetectorOptions = {
11
- order?: LanguageDetector[];
12
- lookupQuerystring?: string;
13
- lookupCookie?: string;
14
- lookupLocalStorage?: string;
15
- lookupSessionStorage?: string;
16
- excludeCacheFor?: string[];
17
- htmlTag?: HTMLElement | null;
18
- };
19
- /**
20
- * Core language detector function
21
- * const detectedLanguages = detectLanguage(['LanguageDetector.Cookie', 'LanguageDetector.LocalStorage'], { lookupCookie: 'myCookie' });
22
- */
23
- export declare const getBrowserLocale: (userOptions?: LanguageDetectorOptions | undefined) => Locales;
24
- export {};
25
- //# sourceMappingURL=getBrowserLocale.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getBrowserLocale.d.ts","sourceRoot":"","sources":["../../../src/client/getBrowserLocale.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,oBAAY,gBAAgB;IAC1B,WAAW,gBAAgB;IAC3B,MAAM,WAAW;IACjB,YAAY,iBAAiB;IAC7B,cAAc,mBAAmB;IACjC,SAAS,cAAc;IACvB,OAAO,YAAY;CACpB;AAGD,KAAK,uBAAuB,GAAG;IAC7B,KAAK,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CAC9B,CAAC;AA2JF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAC3B,cAAa,uBAAuB,GAAG,SAAc,KACpD,OAMF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,EAClB,KAAK,qBAAqB,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACL,YAAY,EACZ,eAAe,EACf,eAAe,GAChB,MAAM,mBAAmB,CAAC"}
@@ -1,17 +0,0 @@
1
- import type { LocalesValues } from '@intlayer/config/client';
2
- /**
3
- * Get the locale cookie
4
- */
5
- export declare const localeCookie: LocalesValues | undefined;
6
- /**
7
- * Set the locale cookie
8
- */
9
- export declare const setLocaleCookie: (locale: LocalesValues) => void;
10
- /**
11
- * Hook that provides the locale cookie and a function to set it
12
- */
13
- export declare const useLocaleCookie: () => {
14
- localeCookie: LocalesValues;
15
- setLocaleCookie: (locale: LocalesValues) => void;
16
- };
17
- //# sourceMappingURL=useLocaleCookie.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useLocaleCookie.d.ts","sourceRoot":"","sources":["../../../src/client/useLocaleCookie.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAc7D;;GAEG;AACH,eAAO,MAAM,YAAY,EACrB,aAAa,GACb,SAAS,CAAC;AAEd;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,aAAa,SAEpD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe;;8BAPY,aAAa;CAUnD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/editor/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/markdown/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC"}