@intlayer/design-system 5.8.1 → 6.0.0-canary.0

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 (340) hide show
  1. package/dist/.vite/manifest.json +34 -106
  2. package/dist/better-auth.CMQ3rA-I-7umXOENE.js.map +1 -1
  3. package/dist/better-auth.CMQ3rA-I-C2nBKRMa.cjs.map +1 -1
  4. package/dist/components/Breadcrumb/breadcrumb.content.cjs +3 -1
  5. package/dist/components/Breadcrumb/breadcrumb.content.cjs.map +1 -1
  6. package/dist/components/Breadcrumb/breadcrumb.content.d.ts +3 -0
  7. package/dist/components/Breadcrumb/breadcrumb.content.d.ts.map +1 -1
  8. package/dist/components/Breadcrumb/breadcrumb.content.mjs +3 -1
  9. package/dist/components/Breadcrumb/breadcrumb.content.mjs.map +1 -1
  10. package/dist/components/Breadcrumb/index.cjs.map +1 -1
  11. package/dist/components/Breadcrumb/index.d.ts.map +1 -1
  12. package/dist/components/Breadcrumb/index.mjs.map +1 -1
  13. package/dist/components/CopyButton/CopyButton.content.cjs +3 -1
  14. package/dist/components/CopyButton/CopyButton.content.cjs.map +1 -1
  15. package/dist/components/CopyButton/CopyButton.content.d.ts +3 -0
  16. package/dist/components/CopyButton/CopyButton.content.d.ts.map +1 -1
  17. package/dist/components/CopyButton/CopyButton.content.mjs +3 -1
  18. package/dist/components/CopyButton/CopyButton.content.mjs.map +1 -1
  19. package/dist/components/DictionaryEditor/DictionaryEditor.cjs +7 -3
  20. package/dist/components/DictionaryEditor/DictionaryEditor.cjs.map +1 -1
  21. package/dist/components/DictionaryEditor/DictionaryEditor.d.ts.map +1 -1
  22. package/dist/components/DictionaryEditor/DictionaryEditor.mjs +7 -3
  23. package/dist/components/DictionaryEditor/DictionaryEditor.mjs.map +1 -1
  24. package/dist/components/DictionaryFieldEditor/ContentEditor.cjs +1 -1
  25. package/dist/components/DictionaryFieldEditor/ContentEditor.cjs.map +1 -1
  26. package/dist/components/DictionaryFieldEditor/ContentEditor.mjs +1 -1
  27. package/dist/components/DictionaryFieldEditor/ContentEditor.mjs.map +1 -1
  28. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs +83 -34
  29. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs.map +1 -1
  30. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.d.ts.map +1 -1
  31. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +83 -34
  32. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs.map +1 -1
  33. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +13 -9
  34. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs.map +1 -1
  35. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.d.ts.map +1 -1
  36. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +12 -8
  37. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
  38. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.cjs +27 -13
  39. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.cjs.map +1 -1
  40. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts +27 -0
  41. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts.map +1 -1
  42. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.mjs +27 -13
  43. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.mjs.map +1 -1
  44. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.cjs +9 -4
  45. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.cjs.map +1 -1
  46. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.d.ts +9 -0
  47. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.d.ts.map +1 -1
  48. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.mjs +9 -4
  49. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.mjs.map +1 -1
  50. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +29 -25
  51. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map +1 -1
  52. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts.map +1 -1
  53. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +27 -23
  54. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
  55. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs +37 -17
  56. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs.map +1 -1
  57. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts +64 -2
  58. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts.map +1 -1
  59. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs +37 -17
  60. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs.map +1 -1
  61. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.cjs +25 -12
  62. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.cjs.map +1 -1
  63. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts +25 -0
  64. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts.map +1 -1
  65. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.mjs +25 -12
  66. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.mjs.map +1 -1
  67. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs +4 -5
  68. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
  69. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts.map +1 -1
  70. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +4 -5
  71. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
  72. package/dist/components/DictionaryFieldEditor/JSONEditor.cjs +2 -2
  73. package/dist/components/DictionaryFieldEditor/JSONEditor.cjs.map +1 -1
  74. package/dist/components/DictionaryFieldEditor/JSONEditor.d.ts.map +1 -1
  75. package/dist/components/DictionaryFieldEditor/JSONEditor.mjs +2 -2
  76. package/dist/components/DictionaryFieldEditor/JSONEditor.mjs.map +1 -1
  77. package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.cjs +25 -12
  78. package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.cjs.map +1 -1
  79. package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts +25 -0
  80. package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts.map +1 -1
  81. package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.mjs +25 -12
  82. package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.mjs.map +1 -1
  83. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +36 -31
  84. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
  85. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts.map +1 -1
  86. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +36 -31
  87. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
  88. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs +32 -28
  89. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs.map +1 -1
  90. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts +32 -5
  91. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts.map +1 -1
  92. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs +32 -28
  93. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs.map +1 -1
  94. package/dist/components/DictionaryFieldEditor/StructureEditor.cjs +2 -2
  95. package/dist/components/DictionaryFieldEditor/StructureEditor.cjs.map +1 -1
  96. package/dist/components/DictionaryFieldEditor/StructureEditor.mjs +2 -2
  97. package/dist/components/DictionaryFieldEditor/StructureEditor.mjs.map +1 -1
  98. package/dist/components/DictionaryFieldEditor/StructureView/StructureView.cjs +2 -5
  99. package/dist/components/DictionaryFieldEditor/StructureView/StructureView.cjs.map +1 -1
  100. package/dist/components/DictionaryFieldEditor/StructureView/StructureView.mjs +2 -5
  101. package/dist/components/DictionaryFieldEditor/StructureView/StructureView.mjs.map +1 -1
  102. package/dist/components/DictionaryFieldEditor/StructureView/structureView.content.cjs +9 -4
  103. package/dist/components/DictionaryFieldEditor/StructureView/structureView.content.cjs.map +1 -1
  104. package/dist/components/DictionaryFieldEditor/StructureView/structureView.content.d.ts +9 -0
  105. package/dist/components/DictionaryFieldEditor/StructureView/structureView.content.d.ts.map +1 -1
  106. package/dist/components/DictionaryFieldEditor/StructureView/structureView.content.mjs +9 -4
  107. package/dist/components/DictionaryFieldEditor/StructureView/structureView.content.mjs.map +1 -1
  108. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs +3 -3
  109. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs.map +1 -1
  110. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs +3 -3
  111. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs.map +1 -1
  112. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs +4 -6
  113. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs.map +1 -1
  114. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.d.ts +3 -3
  115. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.d.ts.map +1 -1
  116. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs +4 -6
  117. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs.map +1 -1
  118. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.cjs +7 -3
  119. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.cjs.map +1 -1
  120. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.d.ts +7 -0
  121. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.d.ts.map +1 -1
  122. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.mjs +7 -3
  123. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.mjs.map +1 -1
  124. package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.cjs +9 -6
  125. package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.cjs.map +1 -1
  126. package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.d.ts +9 -4
  127. package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.d.ts.map +1 -1
  128. package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.mjs +9 -6
  129. package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.mjs.map +1 -1
  130. package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.cjs +28 -14
  131. package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.cjs.map +1 -1
  132. package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts +29 -2
  133. package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts.map +1 -1
  134. package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.mjs +28 -14
  135. package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.mjs.map +1 -1
  136. package/dist/components/DropDown/index.cjs +2 -2
  137. package/dist/components/DropDown/index.cjs.map +1 -1
  138. package/dist/components/DropDown/index.d.ts.map +1 -1
  139. package/dist/components/DropDown/index.mjs +2 -2
  140. package/dist/components/DropDown/index.mjs.map +1 -1
  141. package/dist/components/EditableField/EditableFieldTextArea.cjs +2 -5
  142. package/dist/components/EditableField/EditableFieldTextArea.cjs.map +1 -1
  143. package/dist/components/EditableField/EditableFieldTextArea.mjs +2 -5
  144. package/dist/components/EditableField/EditableFieldTextArea.mjs.map +1 -1
  145. package/dist/components/ExpandCollapse/ExpandCollapse.cjs.map +1 -1
  146. package/dist/components/ExpandCollapse/ExpandCollapse.d.ts +2 -2
  147. package/dist/components/ExpandCollapse/ExpandCollapse.d.ts.map +1 -1
  148. package/dist/components/ExpandCollapse/ExpandCollapse.mjs.map +1 -1
  149. package/dist/components/ExpandCollapse/expandCollapse.content.cjs +5 -2
  150. package/dist/components/ExpandCollapse/expandCollapse.content.cjs.map +1 -1
  151. package/dist/components/ExpandCollapse/expandCollapse.content.d.ts +3 -0
  152. package/dist/components/ExpandCollapse/expandCollapse.content.d.ts.map +1 -1
  153. package/dist/components/ExpandCollapse/expandCollapse.content.mjs +5 -2
  154. package/dist/components/ExpandCollapse/expandCollapse.content.mjs.map +1 -1
  155. package/dist/components/Flags/Flag.cjs +2 -1
  156. package/dist/components/Flags/Flag.cjs.map +1 -1
  157. package/dist/components/Flags/Flag.d.ts.map +1 -1
  158. package/dist/components/Flags/Flag.mjs +2 -1
  159. package/dist/components/Flags/Flag.mjs.map +1 -1
  160. package/dist/components/IDE/Code.cjs +8 -8
  161. package/dist/components/IDE/Code.cjs.map +1 -1
  162. package/dist/components/IDE/Code.mjs +8 -8
  163. package/dist/components/IDE/Code.mjs.map +1 -1
  164. package/dist/components/IDE/CodeBlockClient.cjs +1 -1
  165. package/dist/components/IDE/CodeBlockClient.cjs.map +1 -1
  166. package/dist/components/IDE/CodeBlockClient.d.ts +1 -1
  167. package/dist/components/IDE/CodeBlockClient.d.ts.map +1 -1
  168. package/dist/components/IDE/CodeBlockClient.mjs +1 -1
  169. package/dist/components/IDE/CodeBlockClient.mjs.map +1 -1
  170. package/dist/components/IDE/CodeContext.cjs +1 -3
  171. package/dist/components/IDE/CodeContext.cjs.map +1 -1
  172. package/dist/components/IDE/CodeContext.mjs +1 -3
  173. package/dist/components/IDE/CodeContext.mjs.map +1 -1
  174. package/dist/components/IDE/code.content.cjs +5 -2
  175. package/dist/components/IDE/code.content.cjs.map +1 -1
  176. package/dist/components/IDE/code.content.d.ts +5 -0
  177. package/dist/components/IDE/code.content.d.ts.map +1 -1
  178. package/dist/components/IDE/code.content.mjs +5 -2
  179. package/dist/components/IDE/code.content.mjs.map +1 -1
  180. package/dist/components/IDE/copyCode.content.cjs +5 -2
  181. package/dist/components/IDE/copyCode.content.cjs.map +1 -1
  182. package/dist/components/IDE/copyCode.content.d.ts +5 -0
  183. package/dist/components/IDE/copyCode.content.d.ts.map +1 -1
  184. package/dist/components/IDE/copyCode.content.mjs +5 -2
  185. package/dist/components/IDE/copyCode.content.mjs.map +1 -1
  186. package/dist/components/Input/Checkbox.cjs.map +1 -1
  187. package/dist/components/Input/Checkbox.d.ts +2 -2
  188. package/dist/components/Input/Checkbox.d.ts.map +1 -1
  189. package/dist/components/Input/Checkbox.mjs.map +1 -1
  190. package/dist/components/Loader/index.content.cjs +6 -1
  191. package/dist/components/Loader/index.content.cjs.map +1 -1
  192. package/dist/components/Loader/index.content.d.ts +33 -2
  193. package/dist/components/Loader/index.content.d.ts.map +1 -1
  194. package/dist/components/Loader/index.content.mjs +6 -1
  195. package/dist/components/Loader/index.content.mjs.map +1 -1
  196. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs +1 -3
  197. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs.map +1 -1
  198. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +1 -3
  199. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs.map +1 -1
  200. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs +1 -3
  201. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs.map +1 -1
  202. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs +1 -3
  203. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs.map +1 -1
  204. package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.cjs +17 -8
  205. package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.cjs.map +1 -1
  206. package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts +17 -0
  207. package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts.map +1 -1
  208. package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.mjs +17 -8
  209. package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.mjs.map +1 -1
  210. package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.cjs +13 -6
  211. package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.cjs.map +1 -1
  212. package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.d.ts +13 -0
  213. package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.d.ts.map +1 -1
  214. package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.mjs +13 -6
  215. package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.mjs.map +1 -1
  216. package/dist/components/Modal/Modal.cjs +2 -4
  217. package/dist/components/Modal/Modal.cjs.map +1 -1
  218. package/dist/components/Modal/Modal.mjs +2 -4
  219. package/dist/components/Modal/Modal.mjs.map +1 -1
  220. package/dist/components/Navbar/MobileNavbar.cjs +1 -3
  221. package/dist/components/Navbar/MobileNavbar.cjs.map +1 -1
  222. package/dist/components/Navbar/MobileNavbar.mjs +1 -3
  223. package/dist/components/Navbar/MobileNavbar.mjs.map +1 -1
  224. package/dist/components/Navbar/index.cjs +2 -4
  225. package/dist/components/Navbar/index.cjs.map +1 -1
  226. package/dist/components/Navbar/index.mjs +2 -4
  227. package/dist/components/Navbar/index.mjs.map +1 -1
  228. package/dist/components/SwitchSelector/index.cjs +1 -3
  229. package/dist/components/SwitchSelector/index.cjs.map +1 -1
  230. package/dist/components/SwitchSelector/index.mjs +1 -3
  231. package/dist/components/SwitchSelector/index.mjs.map +1 -1
  232. package/dist/components/TabSelector/TabSelector.cjs +1 -3
  233. package/dist/components/TabSelector/TabSelector.cjs.map +1 -1
  234. package/dist/components/TabSelector/TabSelector.d.ts +1 -1
  235. package/dist/components/TabSelector/TabSelector.d.ts.map +1 -1
  236. package/dist/components/TabSelector/TabSelector.mjs +1 -3
  237. package/dist/components/TabSelector/TabSelector.mjs.map +1 -1
  238. package/dist/components/Table/table.content.cjs +3 -1
  239. package/dist/components/Table/table.content.cjs.map +1 -1
  240. package/dist/components/Table/table.content.d.ts +3 -0
  241. package/dist/components/Table/table.content.d.ts.map +1 -1
  242. package/dist/components/Table/table.content.mjs +3 -1
  243. package/dist/components/Table/table.content.mjs.map +1 -1
  244. package/dist/components/Tag/index.cjs +22 -88
  245. package/dist/components/Tag/index.cjs.map +1 -1
  246. package/dist/components/Tag/index.d.ts +5 -5
  247. package/dist/components/Tag/index.mjs +22 -88
  248. package/dist/components/Tag/index.mjs.map +1 -1
  249. package/dist/components/TextArea/AutocompleteTextArea.cjs +20 -21
  250. package/dist/components/TextArea/AutocompleteTextArea.cjs.map +1 -1
  251. package/dist/components/TextArea/AutocompleteTextArea.d.ts.map +1 -1
  252. package/dist/components/TextArea/AutocompleteTextArea.mjs +20 -21
  253. package/dist/components/TextArea/AutocompleteTextArea.mjs.map +1 -1
  254. package/dist/hooks/auth.cjs +26 -11
  255. package/dist/hooks/auth.cjs.map +1 -1
  256. package/dist/hooks/auth.mjs +26 -11
  257. package/dist/hooks/auth.mjs.map +1 -1
  258. package/dist/hooks/index.cjs +65 -66
  259. package/dist/hooks/index.cjs.map +1 -1
  260. package/dist/hooks/index.d.ts +1 -3
  261. package/dist/hooks/index.d.ts.map +1 -1
  262. package/dist/hooks/index.mjs +4 -8
  263. package/dist/hooks/index.mjs.map +1 -1
  264. package/dist/hooks/reactQuery.cjs +648 -0
  265. package/dist/hooks/reactQuery.cjs.map +1 -0
  266. package/dist/hooks/reactQuery.d.ts +899 -0
  267. package/dist/hooks/reactQuery.d.ts.map +1 -0
  268. package/dist/hooks/reactQuery.mjs +646 -0
  269. package/dist/hooks/reactQuery.mjs.map +1 -0
  270. package/dist/hooks/useAuth/useOAuth2.cjs +13 -10
  271. package/dist/hooks/useAuth/useOAuth2.cjs.map +1 -1
  272. package/dist/hooks/useAuth/useOAuth2.d.ts +1 -1
  273. package/dist/hooks/useAuth/useOAuth2.d.ts.map +1 -1
  274. package/dist/hooks/useAuth/useOAuth2.mjs +13 -10
  275. package/dist/hooks/useAuth/useOAuth2.mjs.map +1 -1
  276. package/dist/hooks/useAuth/useSession.cjs +23 -26
  277. package/dist/hooks/useAuth/useSession.cjs.map +1 -1
  278. package/dist/hooks/useAuth/useSession.d.ts +4 -352
  279. package/dist/hooks/useAuth/useSession.d.ts.map +1 -1
  280. package/dist/hooks/useAuth/useSession.mjs +23 -26
  281. package/dist/hooks/useAuth/useSession.mjs.map +1 -1
  282. package/dist/hooks/useIntlayerAPI.cjs +2 -3
  283. package/dist/hooks/useIntlayerAPI.cjs.map +1 -1
  284. package/dist/hooks/useIntlayerAPI.mjs +2 -3
  285. package/dist/hooks/useIntlayerAPI.mjs.map +1 -1
  286. package/dist/hooks/useUser/index.cjs +6 -9
  287. package/dist/hooks/useUser/index.cjs.map +1 -1
  288. package/dist/hooks/useUser/index.d.ts +2 -18
  289. package/dist/hooks/useUser/index.d.ts.map +1 -1
  290. package/dist/hooks/useUser/index.mjs +6 -9
  291. package/dist/hooks/useUser/index.mjs.map +1 -1
  292. package/dist/index-BCuMWKyy.js.map +1 -1
  293. package/dist/index-BYzBot7l.cjs.map +1 -1
  294. package/dist/providers/ReactQueryProvider.cjs +85 -0
  295. package/dist/providers/ReactQueryProvider.cjs.map +1 -0
  296. package/dist/providers/ReactQueryProvider.d.ts +13 -0
  297. package/dist/providers/ReactQueryProvider.d.ts.map +1 -0
  298. package/dist/providers/ReactQueryProvider.mjs +85 -0
  299. package/dist/providers/ReactQueryProvider.mjs.map +1 -0
  300. package/dist/providers/index.cjs +5 -0
  301. package/dist/{hooks/useAsync → providers}/index.cjs.map +1 -1
  302. package/dist/providers/index.d.ts +2 -0
  303. package/dist/providers/index.d.ts.map +1 -0
  304. package/dist/providers/index.mjs +5 -0
  305. package/dist/{hooks/useAsync → providers}/index.mjs.map +1 -1
  306. package/package.json +31 -21
  307. package/dist/hooks/intlayerAPIHooks.cjs +0 -542
  308. package/dist/hooks/intlayerAPIHooks.cjs.map +0 -1
  309. package/dist/hooks/intlayerAPIHooks.d.ts +0 -968
  310. package/dist/hooks/intlayerAPIHooks.d.ts.map +0 -1
  311. package/dist/hooks/intlayerAPIHooks.mjs +0 -542
  312. package/dist/hooks/intlayerAPIHooks.mjs.map +0 -1
  313. package/dist/hooks/useAsync/index.cjs +0 -8
  314. package/dist/hooks/useAsync/index.d.ts +0 -3
  315. package/dist/hooks/useAsync/index.d.ts.map +0 -1
  316. package/dist/hooks/useAsync/index.mjs +0 -8
  317. package/dist/hooks/useAsync/useAsync.cjs +0 -244
  318. package/dist/hooks/useAsync/useAsync.cjs.map +0 -1
  319. package/dist/hooks/useAsync/useAsync.d.ts +0 -73
  320. package/dist/hooks/useAsync/useAsync.d.ts.map +0 -1
  321. package/dist/hooks/useAsync/useAsync.mjs +0 -244
  322. package/dist/hooks/useAsync/useAsync.mjs.map +0 -1
  323. package/dist/hooks/useAsync/useAsyncStateStore.cjs +0 -150
  324. package/dist/hooks/useAsync/useAsyncStateStore.cjs.map +0 -1
  325. package/dist/hooks/useAsync/useAsyncStateStore.d.ts +0 -52
  326. package/dist/hooks/useAsync/useAsyncStateStore.d.ts.map +0 -1
  327. package/dist/hooks/useAsync/useAsyncStateStore.mjs +0 -150
  328. package/dist/hooks/useAsync/useAsyncStateStore.mjs.map +0 -1
  329. package/dist/hooks/useAsync/useAsyncWrapper.cjs +0 -10
  330. package/dist/hooks/useAsync/useAsyncWrapper.cjs.map +0 -1
  331. package/dist/hooks/useAsync/useAsyncWrapper.d.ts +0 -37
  332. package/dist/hooks/useAsync/useAsyncWrapper.d.ts.map +0 -1
  333. package/dist/hooks/useAsync/useAsyncWrapper.mjs +0 -10
  334. package/dist/hooks/useAsync/useAsyncWrapper.mjs.map +0 -1
  335. package/dist/hooks/useGetAllDictionaries.cjs +0 -35
  336. package/dist/hooks/useGetAllDictionaries.cjs.map +0 -1
  337. package/dist/hooks/useGetAllDictionaries.d.ts +0 -11
  338. package/dist/hooks/useGetAllDictionaries.d.ts.map +0 -1
  339. package/dist/hooks/useGetAllDictionaries.mjs +0 -35
  340. package/dist/hooks/useGetAllDictionaries.mjs.map +0 -1
@@ -1,150 +0,0 @@
1
- "use client";
2
- "use strict";
3
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const jsxRuntime = require("react/jsx-runtime");
5
- const ReactExports = require("react");
6
- const createDefaultStates = () => ({
7
- isFetched: false,
8
- fetchedDateTime: null,
9
- isLoading: false,
10
- isInvalidated: false,
11
- error: null,
12
- isSuccess: false,
13
- data: null,
14
- errorCount: 0,
15
- isEnabled: true
16
- });
17
- const getMatchKeys = (selectorsKeys, keysWithArgs) => keysWithArgs.filter((key) => selectorsKeys.includes(key.split("/")[0]));
18
- const reducer = (state, action) => {
19
- switch (action.type) {
20
- case "SET_QUERY_STATE": {
21
- const { key, value } = action;
22
- return {
23
- ...state,
24
- states: {
25
- ...state.states,
26
- [key]: {
27
- // Merge existing state for the key or default state if not present
28
- ...state.states[key] ?? createDefaultStates(),
29
- ...value
30
- }
31
- }
32
- };
33
- }
34
- case "MAKE_QUERY_IN_ERROR": {
35
- const { key, error } = action;
36
- return {
37
- ...state,
38
- states: {
39
- ...state.states,
40
- [key]: {
41
- // Merge existing state or default if not found
42
- ...state.states[key] ?? createDefaultStates(),
43
- // Explicitly set error and related flags
44
- error,
45
- isFetched: true,
46
- isSuccess: false,
47
- errorCount: (state.states[key]?.errorCount ?? 0) + 1,
48
- isLoading: false,
49
- isInvalidated: false
50
- }
51
- }
52
- };
53
- }
54
- case "SET_QUERIES_STATE": {
55
- const { keys, value } = action;
56
- const keyArray = [keys].flat();
57
- const allKeys = Object.keys(state.states);
58
- const matchedKeys = getMatchKeys(keyArray, allKeys);
59
- if (matchedKeys.length === 0) return state;
60
- const updatedStates = structuredClone(state.states);
61
- matchedKeys.forEach((key) => {
62
- updatedStates[key] = {
63
- ...state.states[key] ?? createDefaultStates(),
64
- ...value
65
- };
66
- });
67
- return {
68
- ...state,
69
- states: updatedStates
70
- };
71
- }
72
- case "RESET_KEY_STATE": {
73
- const { keys } = action;
74
- const keyArray = [keys].flat();
75
- if (keyArray.length === 0) return state;
76
- const allKeys = Object.keys(state.states);
77
- const matchedKeys = getMatchKeys(keyArray, allKeys);
78
- if (matchedKeys.length === 0) return state;
79
- const resetStates = { ...state.states };
80
- matchedKeys.forEach((key) => {
81
- resetStates[key] = createDefaultStates();
82
- });
83
- return {
84
- ...state,
85
- states: resetStates
86
- };
87
- }
88
- case "RESET_STATE": {
89
- const excludeArray = [action.excludeKeys].flat();
90
- const allKeys = Object.keys(state.states);
91
- const matchedKeys = getMatchKeys(excludeArray, allKeys);
92
- const newStates = {};
93
- allKeys.forEach((key) => {
94
- newStates[key] = matchedKeys.includes(key) ? state.states[key] : createDefaultStates();
95
- });
96
- return {
97
- ...state,
98
- states: newStates
99
- };
100
- }
101
- default:
102
- return state;
103
- }
104
- };
105
- const AsyncStateContext = ReactExports.createContext(
106
- null
107
- );
108
- const AsyncStateProvider = ({ children }) => {
109
- const [asyncState, dispatch] = ReactExports.useReducer(reducer, { states: {} });
110
- const getStates = (key) => asyncState.states[key] ?? createDefaultStates();
111
- const setQueryState = (key, value) => {
112
- dispatch({ type: "SET_QUERY_STATE", key, value });
113
- };
114
- const setQueriesState = (keys, value) => {
115
- dispatch({ type: "SET_QUERIES_STATE", keys, value });
116
- };
117
- const makeQueryInError = (key, error) => {
118
- dispatch({ type: "MAKE_QUERY_IN_ERROR", key, error });
119
- };
120
- const resetKeyState = (keys) => {
121
- dispatch({ type: "RESET_KEY_STATE", keys });
122
- };
123
- const resetState = (excludedKeys) => {
124
- dispatch({ type: "RESET_STATE", excludeKeys: excludedKeys });
125
- };
126
- return /* @__PURE__ */ jsxRuntime.jsx(
127
- AsyncStateContext.Provider,
128
- {
129
- value: {
130
- getStates,
131
- setQueryState,
132
- setQueriesState,
133
- makeQueryInError,
134
- resetKeyState,
135
- resetState
136
- },
137
- children
138
- }
139
- );
140
- };
141
- const useAsyncState = () => {
142
- const context = ReactExports.useContext(AsyncStateContext);
143
- if (!context) {
144
- throw new Error("useAsyncState must be used within an AsyncStateProvider");
145
- }
146
- return context;
147
- };
148
- exports.AsyncStateProvider = AsyncStateProvider;
149
- exports.useAsyncState = useAsyncState;
150
- //# sourceMappingURL=useAsyncStateStore.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAsyncStateStore.cjs","sources":["../../../src/hooks/useAsync/useAsyncStateStore.tsx"],"sourcesContent":["'use client';\n\nimport {\n type PropsWithChildren,\n createContext,\n useContext,\n useReducer,\n} from 'react';\n\n/**\n * Represents the states for a given key in the asynchronous state management.\n * This includes flags for loading, fetched, invalidation, and success/error status.\n * It also keeps track of the fetched datetime, retry counts, the data itself, and whether queries are enabled.\n */\ntype States<T> = {\n isLoading: boolean;\n isFetched: boolean;\n isInvalidated: boolean;\n fetchedDateTime: null | Date;\n error: string | null;\n isSuccess: boolean;\n data: T | null;\n errorCount: number;\n isEnabled: boolean;\n};\n\n/**\n * Holds a mapping from a key (string) to its associated state.\n */\ntype StateSlice<T> = {\n [key: string]: States<T>;\n};\n\n/**\n * Describes all the possible actions that can be dispatched to the reducer.\n * These actions allow setting or updating states for specific keys or multiple keys at once,\n * handling errors, and resetting states.\n */\ntype Actions<T> =\n | { type: 'SET_QUERY_STATE'; key: string; value: Partial<States<T>> }\n | { type: 'MAKE_QUERY_IN_ERROR'; key: string; error: string }\n | { type: 'SET_QUERIES_STATE'; keys: string[]; value: Partial<States<T>> }\n | { type: 'RESET_KEY_STATE'; keys: string[] }\n | { type: 'RESET_STATE'; excludeKeys: string[] };\n\n/**\n * The shape of the entire asynchronous state, holding all states in a single object.\n */\ntype AsyncState<T> = {\n states: StateSlice<T>;\n};\n\n/**\n * Creates a default state object with initial values. This is useful when a key\n * has not been initialized yet or when resetting a state back to defaults.\n */\nconst createDefaultStates = <T,>(): States<T> => ({\n isFetched: false,\n fetchedDateTime: null,\n isLoading: false,\n isInvalidated: false,\n error: null,\n isSuccess: false,\n data: null,\n errorCount: 0,\n isEnabled: true,\n});\n\n/**\n * Given a list of selector keys and a list of keys that may contain arguments,\n * this function returns all keys that match the selectors. Matching is determined\n * by comparing the initial part (split by \"/\") of the key.\n *\n * For example:\n * selectorsKeys = [\"user\", \"posts\"]\n * keysWithArgs = [\"user/123\", \"posts/active\", \"comments/42\"]\n * Result = [\"user/123\", \"posts/active\"]\n */\nconst getMatchKeys = (\n selectorsKeys: string[],\n keysWithArgs: string[]\n): string[] =>\n keysWithArgs.filter((key) => selectorsKeys.includes(key.split('/')[0]));\n\n/**\n * The reducer function handling all state transitions. It takes the current state and an action,\n * and returns a new state based on the type of the action.\n *\n * Actions include:\n * - SET_QUERY_STATE: Update a single key with partial new state.\n * - MAKE_QUERY_IN_ERROR: Mark a single key as errored and update related flags.\n * - SET_QUERIES_STATE: Update multiple keys at once with partial new state.\n * - RESET_KEY_STATE: Reset certain keys to their default states.\n * - RESET_STATE: Reset all keys to their default states except those excluded.\n */\nconst reducer = <T,>(\n state: AsyncState<T>,\n action: Actions<T>\n): AsyncState<T> => {\n switch (action.type) {\n case 'SET_QUERY_STATE': {\n const { key, value } = action;\n return {\n ...state,\n states: {\n ...state.states,\n [key]: {\n // Merge existing state for the key or default state if not present\n ...(state.states[key] ?? createDefaultStates<T>()),\n ...value,\n },\n },\n };\n }\n case 'MAKE_QUERY_IN_ERROR': {\n const { key, error } = action;\n return {\n ...state,\n states: {\n ...state.states,\n [key]: {\n // Merge existing state or default if not found\n ...(state.states[key] ?? createDefaultStates<T>()),\n // Explicitly set error and related flags\n error,\n isFetched: true,\n isSuccess: false,\n errorCount: (state.states[key]?.errorCount ?? 0) + 1,\n isLoading: false,\n isInvalidated: false,\n },\n },\n };\n }\n case 'SET_QUERIES_STATE': {\n const { keys, value } = action;\n const keyArray = [keys].flat();\n\n // Find all keys that match the given selectors\n const allKeys = Object.keys(state.states);\n const matchedKeys = getMatchKeys(keyArray, allKeys);\n if (matchedKeys.length === 0) return state;\n\n // Update multiple keys in a single action\n const updatedStates = structuredClone(state.states);\n matchedKeys.forEach((key) => {\n updatedStates[key] = {\n ...(state.states[key] ?? createDefaultStates<T>()),\n ...value,\n };\n });\n\n return {\n ...state,\n states: updatedStates,\n };\n }\n case 'RESET_KEY_STATE': {\n const { keys } = action;\n const keyArray = [keys].flat();\n if (keyArray.length === 0) return state;\n\n // Find all keys that match the given selectors\n const allKeys = Object.keys(state.states);\n const matchedKeys = getMatchKeys(keyArray, allKeys);\n if (matchedKeys.length === 0) return state;\n\n // Reset the matched keys back to default states\n const resetStates = { ...state.states };\n matchedKeys.forEach((key) => {\n resetStates[key] = createDefaultStates<T>();\n });\n\n return {\n ...state,\n states: resetStates,\n };\n }\n case 'RESET_STATE': {\n const excludeArray = [action.excludeKeys].flat();\n const allKeys = Object.keys(state.states);\n\n const matchedKeys = getMatchKeys(excludeArray, allKeys);\n\n // Reset all states except those that match the exclude keys\n const newStates: StateSlice<T> = {};\n allKeys.forEach((key) => {\n newStates[key] = matchedKeys.includes(key)\n ? state.states[key]\n : createDefaultStates<T>();\n });\n\n return {\n ...state,\n states: newStates,\n };\n }\n default:\n return state;\n }\n};\n\n/**\n * The context type that will be provided to consumers.\n * It exposes a set of functions for interacting with the asynchronous state:\n * - getStates: Retrieve the current state for a given key.\n * - setQueryState: Partially update a single key's state.\n * - setQueriesState: Partially update multiple keys' states.\n * - makeQueryInError: Set a particular key into an error state.\n * - resetKeyState: Reset certain keys to their default states.\n * - resetState: Reset all keys to their default states except a set of excluded ones.\n */\ntype AsyncStateContextType<T> = {\n getStates: (key: string) => States<T>;\n setQueryState: (key: string, value: Partial<States<T>>) => void;\n setQueriesState: (keys: string[], value: Partial<States<T>>) => void;\n makeQueryInError: (key: string, error: string) => void;\n resetKeyState: (keys: string[]) => void;\n resetState: (excludedKeys: string[]) => void;\n};\n\n/**\n * Creates a React context for asynchronous state management.\n * This context will be provided by the AsyncStateProvider and consumed by hooks like useAsyncState.\n */\nconst AsyncStateContext = createContext<AsyncStateContextType<unknown> | null>(\n null\n);\n\n/**\n * A provider component that wraps its children and provides the asynchronous\n * state context. It uses the reducer to manage states and dispatch actions\n * based on consumer interactions.\n *\n * @param children The React children elements that should have access to this context.\n */\nexport const AsyncStateProvider = ({ children }: PropsWithChildren<{}>) => {\n // Initialize the reducer with an empty state object\n const [asyncState, dispatch] = useReducer(reducer, { states: {} });\n\n /**\n * Retrieve the state associated with a given key. If no state exists for that key,\n * return a default state.\n *\n * @param key The key for which to retrieve the state.\n */\n const getStates = (key: string) =>\n asyncState.states[key] ?? createDefaultStates<unknown>();\n\n /**\n * Partially update the state for a given key.\n *\n * @param key The key to update.\n * @param value A partial state object to merge with the existing state.\n */\n const setQueryState = (key: string, value: Partial<States<unknown>>) => {\n dispatch({ type: 'SET_QUERY_STATE', key, value });\n };\n\n /**\n * Partially update the state for multiple keys at once.\n *\n * @param keys An array of keys to update.\n * @param value A partial state object to merge with each key's existing state.\n */\n const setQueriesState = (keys: string[], value: Partial<States<unknown>>) => {\n dispatch({ type: 'SET_QUERIES_STATE', keys, value });\n };\n\n /**\n * Mark a given query as having encountered an error.\n *\n * @param key The key associated with the query.\n * @param error The error message to set.\n */\n const makeQueryInError = (key: string, error: string) => {\n dispatch({ type: 'MAKE_QUERY_IN_ERROR', key, error });\n };\n\n /**\n * Reset certain keys back to their default states.\n *\n * @param keys The keys to reset.\n */\n const resetKeyState = (keys: string[]) => {\n dispatch({ type: 'RESET_KEY_STATE', keys });\n };\n\n /**\n * Reset the entire state back to defaults, except for keys that match the excluded ones.\n *\n * @param excludedKeys Keys that should not be reset.\n */\n const resetState = (excludedKeys: string[]) => {\n dispatch({ type: 'RESET_STATE', excludeKeys: excludedKeys });\n };\n\n return (\n <AsyncStateContext.Provider\n value={{\n getStates,\n setQueryState,\n setQueriesState,\n makeQueryInError,\n resetKeyState,\n resetState,\n }}\n >\n {children}\n </AsyncStateContext.Provider>\n );\n};\n\n/**\n * A custom hook for accessing the asynchronous state context. It throws an error if used\n * outside of a provider.\n *\n * @returns The asynchronous state context value.\n */\nexport const useAsyncState = () => {\n const context = useContext(AsyncStateContext);\n if (!context) {\n throw new Error('useAsyncState must be used within an AsyncStateProvider');\n }\n return context;\n};\n"],"names":["createContext","useReducer","jsx","useContext"],"mappings":";;;;;AAwDA,MAAM,sBAAsB,OAAsB;AAAA,EAChD,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,WAAW;AAAA,EACX,eAAe;AAAA,EACf,OAAO;AAAA,EACP,WAAW;AAAA,EACX,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,WAAW;AACb;AAYA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,CAAC,KAAa,UAAoC;AACtE,aAAS,EAAE,MAAM,mBAAmB,KAAK,OAAO;AAAA,EAClD;AAQA,QAAM,kBAAkB,CAAC,MAAgB,UAAoC;AAC3E,aAAS,EAAE,MAAM,qBAAqB,MAAM,OAAO;AAAA,EACrD;AAQA,QAAM,mBAAmB,CAAC,KAAa,UAAkB;AACvD,aAAS,EAAE,MAAM,uBAAuB,KAAK,OAAO;AAAA,EACtD;AAOA,QAAM,gBAAgB,CAAC,SAAmB;AACxC,aAAS,EAAE,MAAM,mBAAmB,KAAA,CAAM;AAAA,EAC5C;AAOA,QAAM,aAAa,CAAC,iBAA2B;AAC7C,aAAS,EAAE,MAAM,eAAe,aAAa,cAAc;AAAA,EAC7D;AAEA,SACEC,2BAAAA;AAAAA,IAAC,kBAAkB;AAAA,IAAlB;AAAA,MACC,OAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,MAGD;AAAA,IAAA;AAAA,EAAA;AAGP;AAQO,MAAM,gBAAgB,MAAM;AACjC,QAAM,UAAUC,aAAAA,WAAW,iBAAiB;AAC5C,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,yDAAyD;AAAA,EAC3E;AACA,SAAO;AACT;;;"}
@@ -1,52 +0,0 @@
1
- import { PropsWithChildren } from 'react';
2
- /**
3
- * Represents the states for a given key in the asynchronous state management.
4
- * This includes flags for loading, fetched, invalidation, and success/error status.
5
- * It also keeps track of the fetched datetime, retry counts, the data itself, and whether queries are enabled.
6
- */
7
- type States<T> = {
8
- isLoading: boolean;
9
- isFetched: boolean;
10
- isInvalidated: boolean;
11
- fetchedDateTime: null | Date;
12
- error: string | null;
13
- isSuccess: boolean;
14
- data: T | null;
15
- errorCount: number;
16
- isEnabled: boolean;
17
- };
18
- /**
19
- * The context type that will be provided to consumers.
20
- * It exposes a set of functions for interacting with the asynchronous state:
21
- * - getStates: Retrieve the current state for a given key.
22
- * - setQueryState: Partially update a single key's state.
23
- * - setQueriesState: Partially update multiple keys' states.
24
- * - makeQueryInError: Set a particular key into an error state.
25
- * - resetKeyState: Reset certain keys to their default states.
26
- * - resetState: Reset all keys to their default states except a set of excluded ones.
27
- */
28
- type AsyncStateContextType<T> = {
29
- getStates: (key: string) => States<T>;
30
- setQueryState: (key: string, value: Partial<States<T>>) => void;
31
- setQueriesState: (keys: string[], value: Partial<States<T>>) => void;
32
- makeQueryInError: (key: string, error: string) => void;
33
- resetKeyState: (keys: string[]) => void;
34
- resetState: (excludedKeys: string[]) => void;
35
- };
36
- /**
37
- * A provider component that wraps its children and provides the asynchronous
38
- * state context. It uses the reducer to manage states and dispatch actions
39
- * based on consumer interactions.
40
- *
41
- * @param children The React children elements that should have access to this context.
42
- */
43
- export declare const AsyncStateProvider: ({ children }: PropsWithChildren<{}>) => import("react/jsx-runtime").JSX.Element;
44
- /**
45
- * A custom hook for accessing the asynchronous state context. It throws an error if used
46
- * outside of a provider.
47
- *
48
- * @returns The asynchronous state context value.
49
- */
50
- export declare const useAsyncState: () => AsyncStateContextType<unknown>;
51
- export {};
52
- //# sourceMappingURL=useAsyncStateStore.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAsyncStateStore.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAsync/useAsyncStateStore.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,iBAAiB,EAIvB,MAAM,OAAO,CAAC;AAEf;;;;GAIG;AACH,KAAK,MAAM,CAAC,CAAC,IAAI;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,IAAI,GAAG,IAAI,CAAC;IAC7B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAkLF;;;;;;;;;GASG;AACH,KAAK,qBAAqB,CAAC,CAAC,IAAI;IAC9B,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC;IACtC,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAChE,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IACrE,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACxC,UAAU,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAC9C,CAAC;AAUF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAI,cAAc,iBAAiB,CAAC,EAAE,CAAC,4CA2ErE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,sCAMzB,CAAC"}
@@ -1,150 +0,0 @@
1
- "use client";
2
- import { jsx } from "react/jsx-runtime";
3
- import { createContext, useReducer, useContext } from "react";
4
- const createDefaultStates = () => ({
5
- isFetched: false,
6
- fetchedDateTime: null,
7
- isLoading: false,
8
- isInvalidated: false,
9
- error: null,
10
- isSuccess: false,
11
- data: null,
12
- errorCount: 0,
13
- isEnabled: true
14
- });
15
- const getMatchKeys = (selectorsKeys, keysWithArgs) => keysWithArgs.filter((key) => selectorsKeys.includes(key.split("/")[0]));
16
- const reducer = (state, action) => {
17
- switch (action.type) {
18
- case "SET_QUERY_STATE": {
19
- const { key, value } = action;
20
- return {
21
- ...state,
22
- states: {
23
- ...state.states,
24
- [key]: {
25
- // Merge existing state for the key or default state if not present
26
- ...state.states[key] ?? createDefaultStates(),
27
- ...value
28
- }
29
- }
30
- };
31
- }
32
- case "MAKE_QUERY_IN_ERROR": {
33
- const { key, error } = action;
34
- return {
35
- ...state,
36
- states: {
37
- ...state.states,
38
- [key]: {
39
- // Merge existing state or default if not found
40
- ...state.states[key] ?? createDefaultStates(),
41
- // Explicitly set error and related flags
42
- error,
43
- isFetched: true,
44
- isSuccess: false,
45
- errorCount: (state.states[key]?.errorCount ?? 0) + 1,
46
- isLoading: false,
47
- isInvalidated: false
48
- }
49
- }
50
- };
51
- }
52
- case "SET_QUERIES_STATE": {
53
- const { keys, value } = action;
54
- const keyArray = [keys].flat();
55
- const allKeys = Object.keys(state.states);
56
- const matchedKeys = getMatchKeys(keyArray, allKeys);
57
- if (matchedKeys.length === 0) return state;
58
- const updatedStates = structuredClone(state.states);
59
- matchedKeys.forEach((key) => {
60
- updatedStates[key] = {
61
- ...state.states[key] ?? createDefaultStates(),
62
- ...value
63
- };
64
- });
65
- return {
66
- ...state,
67
- states: updatedStates
68
- };
69
- }
70
- case "RESET_KEY_STATE": {
71
- const { keys } = action;
72
- const keyArray = [keys].flat();
73
- if (keyArray.length === 0) return state;
74
- const allKeys = Object.keys(state.states);
75
- const matchedKeys = getMatchKeys(keyArray, allKeys);
76
- if (matchedKeys.length === 0) return state;
77
- const resetStates = { ...state.states };
78
- matchedKeys.forEach((key) => {
79
- resetStates[key] = createDefaultStates();
80
- });
81
- return {
82
- ...state,
83
- states: resetStates
84
- };
85
- }
86
- case "RESET_STATE": {
87
- const excludeArray = [action.excludeKeys].flat();
88
- const allKeys = Object.keys(state.states);
89
- const matchedKeys = getMatchKeys(excludeArray, allKeys);
90
- const newStates = {};
91
- allKeys.forEach((key) => {
92
- newStates[key] = matchedKeys.includes(key) ? state.states[key] : createDefaultStates();
93
- });
94
- return {
95
- ...state,
96
- states: newStates
97
- };
98
- }
99
- default:
100
- return state;
101
- }
102
- };
103
- const AsyncStateContext = createContext(
104
- null
105
- );
106
- const AsyncStateProvider = ({ children }) => {
107
- const [asyncState, dispatch] = useReducer(reducer, { states: {} });
108
- const getStates = (key) => asyncState.states[key] ?? createDefaultStates();
109
- const setQueryState = (key, value) => {
110
- dispatch({ type: "SET_QUERY_STATE", key, value });
111
- };
112
- const setQueriesState = (keys, value) => {
113
- dispatch({ type: "SET_QUERIES_STATE", keys, value });
114
- };
115
- const makeQueryInError = (key, error) => {
116
- dispatch({ type: "MAKE_QUERY_IN_ERROR", key, error });
117
- };
118
- const resetKeyState = (keys) => {
119
- dispatch({ type: "RESET_KEY_STATE", keys });
120
- };
121
- const resetState = (excludedKeys) => {
122
- dispatch({ type: "RESET_STATE", excludeKeys: excludedKeys });
123
- };
124
- return /* @__PURE__ */ jsx(
125
- AsyncStateContext.Provider,
126
- {
127
- value: {
128
- getStates,
129
- setQueryState,
130
- setQueriesState,
131
- makeQueryInError,
132
- resetKeyState,
133
- resetState
134
- },
135
- children
136
- }
137
- );
138
- };
139
- const useAsyncState = () => {
140
- const context = useContext(AsyncStateContext);
141
- if (!context) {
142
- throw new Error("useAsyncState must be used within an AsyncStateProvider");
143
- }
144
- return context;
145
- };
146
- export {
147
- AsyncStateProvider,
148
- useAsyncState
149
- };
150
- //# sourceMappingURL=useAsyncStateStore.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAsyncStateStore.mjs","sources":["../../../src/hooks/useAsync/useAsyncStateStore.tsx"],"sourcesContent":["'use client';\n\nimport {\n type PropsWithChildren,\n createContext,\n useContext,\n useReducer,\n} from 'react';\n\n/**\n * Represents the states for a given key in the asynchronous state management.\n * This includes flags for loading, fetched, invalidation, and success/error status.\n * It also keeps track of the fetched datetime, retry counts, the data itself, and whether queries are enabled.\n */\ntype States<T> = {\n isLoading: boolean;\n isFetched: boolean;\n isInvalidated: boolean;\n fetchedDateTime: null | Date;\n error: string | null;\n isSuccess: boolean;\n data: T | null;\n errorCount: number;\n isEnabled: boolean;\n};\n\n/**\n * Holds a mapping from a key (string) to its associated state.\n */\ntype StateSlice<T> = {\n [key: string]: States<T>;\n};\n\n/**\n * Describes all the possible actions that can be dispatched to the reducer.\n * These actions allow setting or updating states for specific keys or multiple keys at once,\n * handling errors, and resetting states.\n */\ntype Actions<T> =\n | { type: 'SET_QUERY_STATE'; key: string; value: Partial<States<T>> }\n | { type: 'MAKE_QUERY_IN_ERROR'; key: string; error: string }\n | { type: 'SET_QUERIES_STATE'; keys: string[]; value: Partial<States<T>> }\n | { type: 'RESET_KEY_STATE'; keys: string[] }\n | { type: 'RESET_STATE'; excludeKeys: string[] };\n\n/**\n * The shape of the entire asynchronous state, holding all states in a single object.\n */\ntype AsyncState<T> = {\n states: StateSlice<T>;\n};\n\n/**\n * Creates a default state object with initial values. This is useful when a key\n * has not been initialized yet or when resetting a state back to defaults.\n */\nconst createDefaultStates = <T,>(): States<T> => ({\n isFetched: false,\n fetchedDateTime: null,\n isLoading: false,\n isInvalidated: false,\n error: null,\n isSuccess: false,\n data: null,\n errorCount: 0,\n isEnabled: true,\n});\n\n/**\n * Given a list of selector keys and a list of keys that may contain arguments,\n * this function returns all keys that match the selectors. Matching is determined\n * by comparing the initial part (split by \"/\") of the key.\n *\n * For example:\n * selectorsKeys = [\"user\", \"posts\"]\n * keysWithArgs = [\"user/123\", \"posts/active\", \"comments/42\"]\n * Result = [\"user/123\", \"posts/active\"]\n */\nconst getMatchKeys = (\n selectorsKeys: string[],\n keysWithArgs: string[]\n): string[] =>\n keysWithArgs.filter((key) => selectorsKeys.includes(key.split('/')[0]));\n\n/**\n * The reducer function handling all state transitions. It takes the current state and an action,\n * and returns a new state based on the type of the action.\n *\n * Actions include:\n * - SET_QUERY_STATE: Update a single key with partial new state.\n * - MAKE_QUERY_IN_ERROR: Mark a single key as errored and update related flags.\n * - SET_QUERIES_STATE: Update multiple keys at once with partial new state.\n * - RESET_KEY_STATE: Reset certain keys to their default states.\n * - RESET_STATE: Reset all keys to their default states except those excluded.\n */\nconst reducer = <T,>(\n state: AsyncState<T>,\n action: Actions<T>\n): AsyncState<T> => {\n switch (action.type) {\n case 'SET_QUERY_STATE': {\n const { key, value } = action;\n return {\n ...state,\n states: {\n ...state.states,\n [key]: {\n // Merge existing state for the key or default state if not present\n ...(state.states[key] ?? createDefaultStates<T>()),\n ...value,\n },\n },\n };\n }\n case 'MAKE_QUERY_IN_ERROR': {\n const { key, error } = action;\n return {\n ...state,\n states: {\n ...state.states,\n [key]: {\n // Merge existing state or default if not found\n ...(state.states[key] ?? createDefaultStates<T>()),\n // Explicitly set error and related flags\n error,\n isFetched: true,\n isSuccess: false,\n errorCount: (state.states[key]?.errorCount ?? 0) + 1,\n isLoading: false,\n isInvalidated: false,\n },\n },\n };\n }\n case 'SET_QUERIES_STATE': {\n const { keys, value } = action;\n const keyArray = [keys].flat();\n\n // Find all keys that match the given selectors\n const allKeys = Object.keys(state.states);\n const matchedKeys = getMatchKeys(keyArray, allKeys);\n if (matchedKeys.length === 0) return state;\n\n // Update multiple keys in a single action\n const updatedStates = structuredClone(state.states);\n matchedKeys.forEach((key) => {\n updatedStates[key] = {\n ...(state.states[key] ?? createDefaultStates<T>()),\n ...value,\n };\n });\n\n return {\n ...state,\n states: updatedStates,\n };\n }\n case 'RESET_KEY_STATE': {\n const { keys } = action;\n const keyArray = [keys].flat();\n if (keyArray.length === 0) return state;\n\n // Find all keys that match the given selectors\n const allKeys = Object.keys(state.states);\n const matchedKeys = getMatchKeys(keyArray, allKeys);\n if (matchedKeys.length === 0) return state;\n\n // Reset the matched keys back to default states\n const resetStates = { ...state.states };\n matchedKeys.forEach((key) => {\n resetStates[key] = createDefaultStates<T>();\n });\n\n return {\n ...state,\n states: resetStates,\n };\n }\n case 'RESET_STATE': {\n const excludeArray = [action.excludeKeys].flat();\n const allKeys = Object.keys(state.states);\n\n const matchedKeys = getMatchKeys(excludeArray, allKeys);\n\n // Reset all states except those that match the exclude keys\n const newStates: StateSlice<T> = {};\n allKeys.forEach((key) => {\n newStates[key] = matchedKeys.includes(key)\n ? state.states[key]\n : createDefaultStates<T>();\n });\n\n return {\n ...state,\n states: newStates,\n };\n }\n default:\n return state;\n }\n};\n\n/**\n * The context type that will be provided to consumers.\n * It exposes a set of functions for interacting with the asynchronous state:\n * - getStates: Retrieve the current state for a given key.\n * - setQueryState: Partially update a single key's state.\n * - setQueriesState: Partially update multiple keys' states.\n * - makeQueryInError: Set a particular key into an error state.\n * - resetKeyState: Reset certain keys to their default states.\n * - resetState: Reset all keys to their default states except a set of excluded ones.\n */\ntype AsyncStateContextType<T> = {\n getStates: (key: string) => States<T>;\n setQueryState: (key: string, value: Partial<States<T>>) => void;\n setQueriesState: (keys: string[], value: Partial<States<T>>) => void;\n makeQueryInError: (key: string, error: string) => void;\n resetKeyState: (keys: string[]) => void;\n resetState: (excludedKeys: string[]) => void;\n};\n\n/**\n * Creates a React context for asynchronous state management.\n * This context will be provided by the AsyncStateProvider and consumed by hooks like useAsyncState.\n */\nconst AsyncStateContext = createContext<AsyncStateContextType<unknown> | null>(\n null\n);\n\n/**\n * A provider component that wraps its children and provides the asynchronous\n * state context. It uses the reducer to manage states and dispatch actions\n * based on consumer interactions.\n *\n * @param children The React children elements that should have access to this context.\n */\nexport const AsyncStateProvider = ({ children }: PropsWithChildren<{}>) => {\n // Initialize the reducer with an empty state object\n const [asyncState, dispatch] = useReducer(reducer, { states: {} });\n\n /**\n * Retrieve the state associated with a given key. If no state exists for that key,\n * return a default state.\n *\n * @param key The key for which to retrieve the state.\n */\n const getStates = (key: string) =>\n asyncState.states[key] ?? createDefaultStates<unknown>();\n\n /**\n * Partially update the state for a given key.\n *\n * @param key The key to update.\n * @param value A partial state object to merge with the existing state.\n */\n const setQueryState = (key: string, value: Partial<States<unknown>>) => {\n dispatch({ type: 'SET_QUERY_STATE', key, value });\n };\n\n /**\n * Partially update the state for multiple keys at once.\n *\n * @param keys An array of keys to update.\n * @param value A partial state object to merge with each key's existing state.\n */\n const setQueriesState = (keys: string[], value: Partial<States<unknown>>) => {\n dispatch({ type: 'SET_QUERIES_STATE', keys, value });\n };\n\n /**\n * Mark a given query as having encountered an error.\n *\n * @param key The key associated with the query.\n * @param error The error message to set.\n */\n const makeQueryInError = (key: string, error: string) => {\n dispatch({ type: 'MAKE_QUERY_IN_ERROR', key, error });\n };\n\n /**\n * Reset certain keys back to their default states.\n *\n * @param keys The keys to reset.\n */\n const resetKeyState = (keys: string[]) => {\n dispatch({ type: 'RESET_KEY_STATE', keys });\n };\n\n /**\n * Reset the entire state back to defaults, except for keys that match the excluded ones.\n *\n * @param excludedKeys Keys that should not be reset.\n */\n const resetState = (excludedKeys: string[]) => {\n dispatch({ type: 'RESET_STATE', excludeKeys: excludedKeys });\n };\n\n return (\n <AsyncStateContext.Provider\n value={{\n getStates,\n setQueryState,\n setQueriesState,\n makeQueryInError,\n resetKeyState,\n resetState,\n }}\n >\n {children}\n </AsyncStateContext.Provider>\n );\n};\n\n/**\n * A custom hook for accessing the asynchronous state context. It throws an error if used\n * outside of a provider.\n *\n * @returns The asynchronous state context value.\n */\nexport const useAsyncState = () => {\n const context = useContext(AsyncStateContext);\n if (!context) {\n throw new Error('useAsyncState must be used within an AsyncStateProvider');\n }\n return context;\n};\n"],"names":[],"mappings":";;;AAwDA,MAAM,sBAAsB,OAAsB;AAAA,EAChD,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,WAAW;AAAA,EACX,eAAe;AAAA,EACf,OAAO;AAAA,EACP,WAAW;AAAA,EACX,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,WAAW;AACb;AAYA,MAAM,eAAe,CACnB,eACA,iBAEA,aAAa,OAAO,CAAC,QAAQ,cAAc,SAAS,IAAI,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC;AAaxE,MAAM,UAAU,CACd,OACA,WACkB;AAClB,UAAQ,OAAO,MAAA;AAAA,IACb,KAAK,mBAAmB;AACtB,YAAM,EAAE,KAAK,MAAA,IAAU;AACvB,aAAO;AAAA,QACL,GAAG;AAAA,QACH,QAA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AAC,SAAmB;AACxC,aAAS,EAAE,MAAM,mBAAmB,KAAA,CAAM;AAAA,EAC5C;AAOA,QAAM,aAAa,CAAC,iBAA2B;AAC7C,aAAS,EAAE,MAAM,eAAe,aAAa,cAAc;AAAA,EAC7D;AAEA,SACE;AAAA,IAAC,kBAAkB;AAAA,IAAlB;AAAA,MACC,OAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,MAGD;AAAA,IAAA;AAAA,EAAA;AAGP;AAQO,MAAM,gBAAgB,MAAM;AACjC,QAAM,UAAU,WAAW,iBAAiB;AAC5C,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,yDAAyD;AAAA,EAC3E;AACA,SAAO;AACT;"}
@@ -1,10 +0,0 @@
1
- "use client";
2
- "use strict";
3
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const hooks_useAsync_useAsync = require("./useAsync.cjs");
5
- const useAsyncWrapper = (key, asyncFunction, options) => (...args) => hooks_useAsync_useAsync.useAsync(key, asyncFunction, {
6
- ...options,
7
- args
8
- });
9
- exports.useAsyncWrapper = useAsyncWrapper;
10
- //# sourceMappingURL=useAsyncWrapper.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAsyncWrapper.cjs","sources":["../../../src/hooks/useAsync/useAsyncWrapper.ts"],"sourcesContent":["'use client';\n\nimport {\n type UseAsyncOptions,\n type UseAsyncResult,\n useAsync,\n} from './useAsync';\n\n/**\n * This hook allow the declaration of a custom hook that wraps an async function.\n * It provides a simpler way to make your useAsync hook more readable and maintainable.\n *\n * @example\n * // Example of using useAsync to manage fetching user data from an API.\n * const fetchUserData = async (userId) => {\n * const response = await fetch(`/api/users/${userId}`);\n * if (!response.ok) throw new Error('Failed to fetch');\n * return await response.json();\n * };\n *\n * // Define a custom hook that wraps the fetchUserData function\n * const useUserDetails = useAsyncWrapper('userDetails', fetchUserData);\n *\n * // Use the custom hook to fetch user data\n * const UserDetails = ({ userId }) => {\n * const {\n * isLoading,\n * data,\n * error,\n * revalidate,\n * } = useUserDetails(userId);\n *\n * if (isLoading) return <div>Loading...</div>;\n * if (error) return <div>Error: {error}</div>;\n * return (\n * <div>\n * <h1>{data.name}</h1>\n * <button onClick={() => revalidate()}>Refresh</button>\n * </div>\n * );\n * };\n */\nexport const useAsyncWrapper =\n <U extends string, T extends (...args: any[]) => Promise<any>>(\n key: U,\n asyncFunction: T,\n options?: UseAsyncOptions<T>\n ): ((...args: Parameters<T>) => UseAsyncResult<U, T>) =>\n (...args: Parameters<T>) =>\n useAsync(key, asyncFunction, {\n ...options,\n args,\n });\n"],"names":["useAsync"],"mappings":";;;;AA0CO,MAAM,kBACX,CACE,KACA,eACA,YAEF,IAAI,SACFA,wBAAAA,SAAS,KAAK,eAAe;AAAA,EAC3B,GAAG;AAAA,EACH;AACF,CAAC;;"}
@@ -1,37 +0,0 @@
1
- import { UseAsyncOptions, UseAsyncResult } from './useAsync';
2
- /**
3
- * This hook allow the declaration of a custom hook that wraps an async function.
4
- * It provides a simpler way to make your useAsync hook more readable and maintainable.
5
- *
6
- * @example
7
- * // Example of using useAsync to manage fetching user data from an API.
8
- * const fetchUserData = async (userId) => {
9
- * const response = await fetch(`/api/users/${userId}`);
10
- * if (!response.ok) throw new Error('Failed to fetch');
11
- * return await response.json();
12
- * };
13
- *
14
- * // Define a custom hook that wraps the fetchUserData function
15
- * const useUserDetails = useAsyncWrapper('userDetails', fetchUserData);
16
- *
17
- * // Use the custom hook to fetch user data
18
- * const UserDetails = ({ userId }) => {
19
- * const {
20
- * isLoading,
21
- * data,
22
- * error,
23
- * revalidate,
24
- * } = useUserDetails(userId);
25
- *
26
- * if (isLoading) return <div>Loading...</div>;
27
- * if (error) return <div>Error: {error}</div>;
28
- * return (
29
- * <div>
30
- * <h1>{data.name}</h1>
31
- * <button onClick={() => revalidate()}>Refresh</button>
32
- * </div>
33
- * );
34
- * };
35
- */
36
- export declare const useAsyncWrapper: <U extends string, T extends (...args: any[]) => Promise<any>>(key: U, asyncFunction: T, options?: UseAsyncOptions<T>) => ((...args: Parameters<T>) => UseAsyncResult<U, T>);
37
- //# sourceMappingURL=useAsyncWrapper.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAsyncWrapper.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAsync/useAsyncWrapper.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,cAAc,EAEpB,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,eAAe,GACzB,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,EAC3D,KAAK,CAAC,EACN,eAAe,CAAC,EAChB,UAAU,eAAe,CAAC,CAAC,CAAC,KAC3B,CAAC,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAKhD,CAAC"}
@@ -1,10 +0,0 @@
1
- "use client";
2
- import { useAsync } from "./useAsync.mjs";
3
- const useAsyncWrapper = (key, asyncFunction, options) => (...args) => useAsync(key, asyncFunction, {
4
- ...options,
5
- args
6
- });
7
- export {
8
- useAsyncWrapper
9
- };
10
- //# sourceMappingURL=useAsyncWrapper.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAsyncWrapper.mjs","sources":["../../../src/hooks/useAsync/useAsyncWrapper.ts"],"sourcesContent":["'use client';\n\nimport {\n type UseAsyncOptions,\n type UseAsyncResult,\n useAsync,\n} from './useAsync';\n\n/**\n * This hook allow the declaration of a custom hook that wraps an async function.\n * It provides a simpler way to make your useAsync hook more readable and maintainable.\n *\n * @example\n * // Example of using useAsync to manage fetching user data from an API.\n * const fetchUserData = async (userId) => {\n * const response = await fetch(`/api/users/${userId}`);\n * if (!response.ok) throw new Error('Failed to fetch');\n * return await response.json();\n * };\n *\n * // Define a custom hook that wraps the fetchUserData function\n * const useUserDetails = useAsyncWrapper('userDetails', fetchUserData);\n *\n * // Use the custom hook to fetch user data\n * const UserDetails = ({ userId }) => {\n * const {\n * isLoading,\n * data,\n * error,\n * revalidate,\n * } = useUserDetails(userId);\n *\n * if (isLoading) return <div>Loading...</div>;\n * if (error) return <div>Error: {error}</div>;\n * return (\n * <div>\n * <h1>{data.name}</h1>\n * <button onClick={() => revalidate()}>Refresh</button>\n * </div>\n * );\n * };\n */\nexport const useAsyncWrapper =\n <U extends string, T extends (...args: any[]) => Promise<any>>(\n key: U,\n asyncFunction: T,\n options?: UseAsyncOptions<T>\n ): ((...args: Parameters<T>) => UseAsyncResult<U, T>) =>\n (...args: Parameters<T>) =>\n useAsync(key, asyncFunction, {\n ...options,\n args,\n });\n"],"names":[],"mappings":";;AA0CO,MAAM,kBACX,CACE,KACA,eACA,YAEF,IAAI,SACF,SAAS,KAAK,eAAe;AAAA,EAC3B,GAAG;AAAA,EACH;AACF,CAAC;"}
@@ -1,35 +0,0 @@
1
- "use client";
2
- "use strict";
3
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const editorReact = require("@intlayer/editor-react");
5
- const merge = require("deepmerge");
6
- const ReactExports = require("react");
7
- const hooks_intlayerAPIHooks = require("./intlayerAPIHooks.cjs");
8
- const useGetAllDictionaries = (...props) => {
9
- const { localeDictionaries } = editorReact.useDictionariesRecord();
10
- const { data: onlineDictionariesAPI, isWaitingData } = hooks_intlayerAPIHooks.useGetDictionaries(
11
- ...props
12
- );
13
- const onlineDictionaries = ReactExports.useMemo(
14
- () => (onlineDictionariesAPI?.data ?? []).reduce(
15
- (acc, dictionary) => {
16
- acc[dictionary.key] = dictionary;
17
- return acc;
18
- },
19
- {}
20
- ),
21
- [onlineDictionariesAPI]
22
- );
23
- const allDictionaries = ReactExports.useMemo(
24
- () => merge(onlineDictionaries ?? {}, localeDictionaries),
25
- [onlineDictionaries, localeDictionaries]
26
- );
27
- return {
28
- online: onlineDictionaries,
29
- locale: localeDictionaries,
30
- all: allDictionaries,
31
- isLoading: isWaitingData
32
- };
33
- };
34
- exports.useGetAllDictionaries = useGetAllDictionaries;
35
- //# sourceMappingURL=useGetAllDictionaries.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useGetAllDictionaries.cjs","sources":["../../src/hooks/useGetAllDictionaries.tsx"],"sourcesContent":["'use client';\n\n/**\n * @intlayer/dictionaries-entry is a package that only returns the dictionary entry path.\n * Using an external package allow to alias it in the bundle configuration (such as webpack).\n * The alias allow hot reload the app (such as nextjs) on any dictionary change.\n */\nimport type { Dictionary } from '@intlayer/core';\nimport { useDictionariesRecord } from '@intlayer/editor-react';\nimport merge from 'deepmerge';\nimport { useMemo } from 'react';\nimport { useGetDictionaries } from './intlayerAPIHooks';\n\ntype Args = Parameters<typeof useGetDictionaries>;\n\nexport const useGetAllDictionaries = (...props: Args) => {\n const { localeDictionaries } = useDictionariesRecord();\n const { data: onlineDictionariesAPI, isWaitingData } = useGetDictionaries(\n ...props\n );\n\n const onlineDictionaries: Record<string, Dictionary> = useMemo(\n () =>\n (onlineDictionariesAPI?.data ?? []).reduce(\n (acc, dictionary) => {\n acc[dictionary.key] = dictionary;\n return acc;\n },\n {} as Record<string, Dictionary>\n ),\n [onlineDictionariesAPI]\n );\n\n const allDictionaries: Record<string, Dictionary> = useMemo(\n () => merge(onlineDictionaries ?? {}, localeDictionaries),\n [onlineDictionaries, localeDictionaries]\n );\n\n return {\n online: onlineDictionaries,\n locale: localeDictionaries,\n all: allDictionaries,\n isLoading: isWaitingData,\n };\n};\n"],"names":["useDictionariesRecord","useGetDictionaries","useMemo"],"mappings":";;;;;;;AAeO,MAAM,wBAAwB,IAAI,UAAgB;AACvD,QAAM,EAAE,mBAAA,IAAuBA,kCAAA;AAC/B,QAAM,EAAE,MAAM,uBAAuB,cAAA,IAAkBC,uBAAAA;AAAAA,IACrD,GAAG;AAAA,EAAA;AAGL,QAAM,qBAAiDC,aAAAA;AAAAA,IACrD,OACG,uBAAuB,QAAQ,CAAA,GAAI;AAAA,MAClC,CAAC,KAAK,eAAe;AACnB,YAAI,WAAW,GAAG,IAAI;AACtB,eAAO;AAAA,MACT;AAAA,MACA,CAAA;AAAA,IAAC;AAAA,IAEL,CAAC,qBAAqB;AAAA,EAAA;AAGxB,QAAM,kBAA8CA,aAAAA;AAAAA,IAClD,MAAM,MAAM,sBAAsB,CAAA,GAAI,kBAAkB;AAAA,IACxD,CAAC,oBAAoB,kBAAkB;AAAA,EAAA;AAGzC,SAAO;AAAA,IACL,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,WAAW;AAAA,EAAA;AAEf;;"}
@@ -1,11 +0,0 @@
1
- import { Dictionary } from '@intlayer/core';
2
- import { useGetDictionaries } from './intlayerAPIHooks';
3
- type Args = Parameters<typeof useGetDictionaries>;
4
- export declare const useGetAllDictionaries: (...props: Args) => {
5
- online: Record<string, Dictionary>;
6
- locale: import('@intlayer/editor-react').DictionaryContent;
7
- all: Record<string, Dictionary>;
8
- isLoading: boolean;
9
- };
10
- export {};
11
- //# sourceMappingURL=useGetAllDictionaries.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useGetAllDictionaries.d.ts","sourceRoot":"","sources":["../../src/hooks/useGetAllDictionaries.tsx"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAElD,eAAO,MAAM,qBAAqB,GAAI,GAAG,OAAO,IAAI;;;;;CA6BnD,CAAC"}
@@ -1,35 +0,0 @@
1
- "use client";
2
- import { useDictionariesRecord } from "@intlayer/editor-react";
3
- import merge from "deepmerge";
4
- import { useMemo } from "react";
5
- import { useGetDictionaries } from "./intlayerAPIHooks.mjs";
6
- const useGetAllDictionaries = (...props) => {
7
- const { localeDictionaries } = useDictionariesRecord();
8
- const { data: onlineDictionariesAPI, isWaitingData } = useGetDictionaries(
9
- ...props
10
- );
11
- const onlineDictionaries = useMemo(
12
- () => (onlineDictionariesAPI?.data ?? []).reduce(
13
- (acc, dictionary) => {
14
- acc[dictionary.key] = dictionary;
15
- return acc;
16
- },
17
- {}
18
- ),
19
- [onlineDictionariesAPI]
20
- );
21
- const allDictionaries = useMemo(
22
- () => merge(onlineDictionaries ?? {}, localeDictionaries),
23
- [onlineDictionaries, localeDictionaries]
24
- );
25
- return {
26
- online: onlineDictionaries,
27
- locale: localeDictionaries,
28
- all: allDictionaries,
29
- isLoading: isWaitingData
30
- };
31
- };
32
- export {
33
- useGetAllDictionaries
34
- };
35
- //# sourceMappingURL=useGetAllDictionaries.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useGetAllDictionaries.mjs","sources":["../../src/hooks/useGetAllDictionaries.tsx"],"sourcesContent":["'use client';\n\n/**\n * @intlayer/dictionaries-entry is a package that only returns the dictionary entry path.\n * Using an external package allow to alias it in the bundle configuration (such as webpack).\n * The alias allow hot reload the app (such as nextjs) on any dictionary change.\n */\nimport type { Dictionary } from '@intlayer/core';\nimport { useDictionariesRecord } from '@intlayer/editor-react';\nimport merge from 'deepmerge';\nimport { useMemo } from 'react';\nimport { useGetDictionaries } from './intlayerAPIHooks';\n\ntype Args = Parameters<typeof useGetDictionaries>;\n\nexport const useGetAllDictionaries = (...props: Args) => {\n const { localeDictionaries } = useDictionariesRecord();\n const { data: onlineDictionariesAPI, isWaitingData } = useGetDictionaries(\n ...props\n );\n\n const onlineDictionaries: Record<string, Dictionary> = useMemo(\n () =>\n (onlineDictionariesAPI?.data ?? []).reduce(\n (acc, dictionary) => {\n acc[dictionary.key] = dictionary;\n return acc;\n },\n {} as Record<string, Dictionary>\n ),\n [onlineDictionariesAPI]\n );\n\n const allDictionaries: Record<string, Dictionary> = useMemo(\n () => merge(onlineDictionaries ?? {}, localeDictionaries),\n [onlineDictionaries, localeDictionaries]\n );\n\n return {\n online: onlineDictionaries,\n locale: localeDictionaries,\n all: allDictionaries,\n isLoading: isWaitingData,\n };\n};\n"],"names":[],"mappings":";;;;;AAeO,MAAM,wBAAwB,IAAI,UAAgB;AACvD,QAAM,EAAE,mBAAA,IAAuB,sBAAA;AAC/B,QAAM,EAAE,MAAM,uBAAuB,cAAA,IAAkB;AAAA,IACrD,GAAG;AAAA,EAAA;AAGL,QAAM,qBAAiD;AAAA,IACrD,OACG,uBAAuB,QAAQ,CAAA,GAAI;AAAA,MAClC,CAAC,KAAK,eAAe;AACnB,YAAI,WAAW,GAAG,IAAI;AACtB,eAAO;AAAA,MACT;AAAA,MACA,CAAA;AAAA,IAAC;AAAA,IAEL,CAAC,qBAAqB;AAAA,EAAA;AAGxB,QAAM,kBAA8C;AAAA,IAClD,MAAM,MAAM,sBAAsB,CAAA,GAAI,kBAAkB;AAAA,IACxD,CAAC,oBAAoB,kBAAkB;AAAA,EAAA;AAGzC,SAAO;AAAA,IACL,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,WAAW;AAAA,EAAA;AAEf;"}