@intlayer/design-system 3.0.3 → 3.2.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 (648) hide show
  1. package/dist/.vite/manifest.json +269 -117
  2. package/dist/Form-2XHQV7F_.cjs +295 -0
  3. package/dist/Form-2XHQV7F_.cjs.map +1 -0
  4. package/dist/Form-BO0i3nT9.js +300 -0
  5. package/dist/Form-BO0i3nT9.js.map +1 -0
  6. package/dist/Form-BaHDK0RZ.cjs +298 -0
  7. package/dist/Form-BaHDK0RZ.cjs.map +1 -0
  8. package/dist/Form-BfZMqK2D.js +300 -0
  9. package/dist/Form-BfZMqK2D.js.map +1 -0
  10. package/dist/Form-C13KWSZs.cjs +299 -0
  11. package/dist/Form-C13KWSZs.cjs.map +1 -0
  12. package/dist/Form-C8K2f8ph.js +300 -0
  13. package/dist/Form-C8K2f8ph.js.map +1 -0
  14. package/dist/Form-CKvCgz8c.cjs +299 -0
  15. package/dist/Form-CKvCgz8c.cjs.map +1 -0
  16. package/dist/Form-Cbk5Lhpd.js +299 -0
  17. package/dist/Form-Cbk5Lhpd.js.map +1 -0
  18. package/dist/Form-CiAgFAPb.cjs +300 -0
  19. package/dist/Form-CiAgFAPb.cjs.map +1 -0
  20. package/dist/Form-CnBKDneQ.js +296 -0
  21. package/dist/Form-CnBKDneQ.js.map +1 -0
  22. package/dist/Form-DERuauvB.cjs +300 -0
  23. package/dist/Form-DERuauvB.cjs.map +1 -0
  24. package/dist/Form-DhlDf3ML.cjs +299 -0
  25. package/dist/Form-DhlDf3ML.cjs.map +1 -0
  26. package/dist/Form-DkAZ0Jdf.cjs +299 -0
  27. package/dist/Form-DkAZ0Jdf.cjs.map +1 -0
  28. package/dist/Form-DqnNP4DA.js +300 -0
  29. package/dist/Form-DqnNP4DA.js.map +1 -0
  30. package/dist/Form-DyFBmVya.js +301 -0
  31. package/dist/Form-DyFBmVya.js.map +1 -0
  32. package/dist/Form-FW4Odjfm.js +301 -0
  33. package/dist/Form-FW4Odjfm.js.map +1 -0
  34. package/dist/TabSelector-BmkzVPXl.js +660 -0
  35. package/dist/TabSelector-BmkzVPXl.js.map +1 -0
  36. package/dist/TabSelector-o_NRBvPQ.cjs +659 -0
  37. package/dist/TabSelector-o_NRBvPQ.cjs.map +1 -0
  38. package/dist/components/Accordion/Accordion.d.ts +0 -1
  39. package/dist/components/Auth/AuthModal/index.cjs +17 -62
  40. package/dist/components/Auth/AuthModal/index.cjs.map +1 -1
  41. package/dist/components/Auth/AuthModal/index.d.ts +0 -1
  42. package/dist/components/Auth/AuthModal/index.d.ts.map +1 -1
  43. package/dist/components/Auth/AuthModal/index.mjs +17 -62
  44. package/dist/components/Auth/AuthModal/index.mjs.map +1 -1
  45. package/dist/components/Auth/AuthProvider/index.cjs +5 -21
  46. package/dist/components/Auth/AuthProvider/index.cjs.map +1 -1
  47. package/dist/components/Auth/AuthProvider/index.d.ts +7 -6
  48. package/dist/components/Auth/AuthProvider/index.d.ts.map +1 -1
  49. package/dist/components/Auth/AuthProvider/index.mjs +6 -22
  50. package/dist/components/Auth/AuthProvider/index.mjs.map +1 -1
  51. package/dist/components/Auth/AuthProvider/useSession.cjs +14 -11
  52. package/dist/components/Auth/AuthProvider/useSession.cjs.map +1 -1
  53. package/dist/components/Auth/AuthProvider/useSession.d.ts +0 -1
  54. package/dist/components/Auth/AuthProvider/useSession.d.ts.map +1 -1
  55. package/dist/components/Auth/AuthProvider/useSession.mjs +14 -11
  56. package/dist/components/Auth/AuthProvider/useSession.mjs.map +1 -1
  57. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.cjs +2 -2
  58. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.cjs.map +1 -1
  59. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.d.ts +0 -1
  60. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.mjs +1 -1
  61. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.mjs.map +1 -1
  62. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierServer.cjs.map +1 -1
  63. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierServer.d.ts +2 -3
  64. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierServer.d.ts.map +1 -1
  65. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierServer.mjs.map +1 -1
  66. package/dist/components/Auth/AuthenticationBarrier/accessValidation.cjs.map +1 -1
  67. package/dist/components/Auth/AuthenticationBarrier/accessValidation.d.ts +1 -2
  68. package/dist/components/Auth/AuthenticationBarrier/accessValidation.d.ts.map +1 -1
  69. package/dist/components/Auth/AuthenticationBarrier/accessValidation.mjs.map +1 -1
  70. package/dist/components/Auth/AuthenticationBarrier/index.d.ts +3 -4
  71. package/dist/components/Auth/AuthenticationBarrier/index.d.ts.map +1 -1
  72. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs +2 -1
  73. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs.map +1 -1
  74. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.d.ts +1 -2
  75. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.d.ts.map +1 -1
  76. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs +2 -1
  77. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs.map +1 -1
  78. package/dist/components/Auth/ChangePasswordForm/ChangePasswordSchema.cjs.map +1 -1
  79. package/dist/components/Auth/ChangePasswordForm/ChangePasswordSchema.d.ts +0 -1
  80. package/dist/components/Auth/ChangePasswordForm/ChangePasswordSchema.mjs.map +1 -1
  81. package/dist/components/Auth/ChangePasswordForm/index.content.cjs.map +1 -1
  82. package/dist/components/Auth/ChangePasswordForm/index.content.mjs.map +1 -1
  83. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs +3 -2
  84. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs.map +1 -1
  85. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.d.ts +0 -1
  86. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.d.ts.map +1 -1
  87. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs +3 -2
  88. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs.map +1 -1
  89. package/dist/components/Auth/ExternalsLoginButtons/assets/GithubLogo.d.ts +0 -1
  90. package/dist/components/Auth/ExternalsLoginButtons/assets/GoogleLogo.d.ts +0 -1
  91. package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.cjs.map +1 -1
  92. package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.mjs.map +1 -1
  93. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs +2 -1
  94. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs.map +1 -1
  95. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.d.ts +1 -2
  96. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.d.ts.map +1 -1
  97. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs +2 -1
  98. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs.map +1 -1
  99. package/dist/components/Auth/ResetPasswordForm/ResetPasswordSchema.cjs.map +1 -1
  100. package/dist/components/Auth/ResetPasswordForm/ResetPasswordSchema.d.ts +0 -1
  101. package/dist/components/Auth/ResetPasswordForm/ResetPasswordSchema.mjs.map +1 -1
  102. package/dist/components/Auth/ResetPasswordForm/index.content.cjs.map +1 -1
  103. package/dist/components/Auth/ResetPasswordForm/index.content.mjs.map +1 -1
  104. package/dist/components/Auth/SignInForm/SignInForm.cjs +5 -4
  105. package/dist/components/Auth/SignInForm/SignInForm.cjs.map +1 -1
  106. package/dist/components/Auth/SignInForm/SignInForm.d.ts +1 -2
  107. package/dist/components/Auth/SignInForm/SignInForm.d.ts.map +1 -1
  108. package/dist/components/Auth/SignInForm/SignInForm.mjs +5 -4
  109. package/dist/components/Auth/SignInForm/SignInForm.mjs.map +1 -1
  110. package/dist/components/Auth/SignInForm/SignInSchema.cjs.map +1 -1
  111. package/dist/components/Auth/SignInForm/SignInSchema.d.ts +0 -1
  112. package/dist/components/Auth/SignInForm/SignInSchema.mjs.map +1 -1
  113. package/dist/components/Auth/SignInForm/index.content.cjs.map +1 -1
  114. package/dist/components/Auth/SignInForm/index.content.mjs.map +1 -1
  115. package/dist/components/Auth/SignUpForm/SignUpForm.cjs +4 -4
  116. package/dist/components/Auth/SignUpForm/SignUpForm.cjs.map +1 -1
  117. package/dist/components/Auth/SignUpForm/SignUpForm.d.ts +1 -2
  118. package/dist/components/Auth/SignUpForm/SignUpForm.d.ts.map +1 -1
  119. package/dist/components/Auth/SignUpForm/SignUpForm.mjs +4 -4
  120. package/dist/components/Auth/SignUpForm/SignUpForm.mjs.map +1 -1
  121. package/dist/components/Auth/SignUpForm/SignUpSchema.cjs.map +1 -1
  122. package/dist/components/Auth/SignUpForm/SignUpSchema.d.ts +0 -1
  123. package/dist/components/Auth/SignUpForm/SignUpSchema.mjs.map +1 -1
  124. package/dist/components/Auth/SignUpForm/index.content.cjs.map +1 -1
  125. package/dist/components/Auth/SignUpForm/index.content.mjs.map +1 -1
  126. package/dist/components/Auth/index.cjs +2 -4
  127. package/dist/components/Auth/index.cjs.map +1 -1
  128. package/dist/components/Auth/index.d.ts +1 -1
  129. package/dist/components/Auth/index.d.ts.map +1 -1
  130. package/dist/components/Auth/index.mjs +1 -3
  131. package/dist/components/Auth/useAuth/index.cjs +39 -0
  132. package/dist/components/Auth/useAuth/index.cjs.map +1 -0
  133. package/dist/components/Auth/useAuth/index.d.ts +24 -0
  134. package/dist/components/Auth/useAuth/index.d.ts.map +1 -0
  135. package/dist/components/Auth/useAuth/index.mjs +39 -0
  136. package/dist/components/Auth/useAuth/index.mjs.map +1 -0
  137. package/dist/components/Auth/useAuth/useCSRF.cjs +22 -0
  138. package/dist/components/Auth/useAuth/useCSRF.cjs.map +1 -0
  139. package/dist/components/Auth/useAuth/useCSRF.d.ts +5 -0
  140. package/dist/components/Auth/useAuth/useCSRF.d.ts.map +1 -0
  141. package/dist/components/Auth/useAuth/useCSRF.mjs +22 -0
  142. package/dist/components/Auth/useAuth/useCSRF.mjs.map +1 -0
  143. package/dist/components/Auth/useAuth/useOAuth2.cjs +26 -0
  144. package/dist/components/Auth/useAuth/useOAuth2.cjs.map +1 -0
  145. package/dist/components/Auth/useAuth/useOAuth2.d.ts +4 -0
  146. package/dist/components/Auth/useAuth/useOAuth2.d.ts.map +1 -0
  147. package/dist/components/Auth/useAuth/useOAuth2.mjs +26 -0
  148. package/dist/components/Auth/useAuth/useOAuth2.mjs.map +1 -0
  149. package/dist/components/Auth/useAuth/useSession.cjs +60 -0
  150. package/dist/components/Auth/useAuth/useSession.cjs.map +1 -0
  151. package/dist/components/Auth/useAuth/useSession.d.ts +8 -0
  152. package/dist/components/Auth/useAuth/useSession.d.ts.map +1 -0
  153. package/dist/components/Auth/useAuth/useSession.mjs +60 -0
  154. package/dist/components/Auth/useAuth/useSession.mjs.map +1 -0
  155. package/dist/components/Auth/useUser/index.cjs +3 -3
  156. package/dist/components/Auth/useUser/index.cjs.map +1 -1
  157. package/dist/components/Auth/useUser/index.d.ts.map +1 -1
  158. package/dist/components/Auth/useUser/index.mjs +3 -3
  159. package/dist/components/Auth/useUser/index.mjs.map +1 -1
  160. package/dist/components/Avatar/index.d.ts +0 -1
  161. package/dist/components/Badge/index.d.ts +0 -1
  162. package/dist/components/Breadcrumb/index.d.ts +0 -1
  163. package/dist/components/Button/Button.cjs +1 -0
  164. package/dist/components/Button/Button.cjs.map +1 -1
  165. package/dist/components/Button/Button.d.ts +1 -3
  166. package/dist/components/Button/Button.d.ts.map +1 -1
  167. package/dist/components/Button/Button.mjs +1 -0
  168. package/dist/components/Button/Button.mjs.map +1 -1
  169. package/dist/components/Command/index.d.ts +9 -10
  170. package/dist/components/Command/index.d.ts.map +1 -1
  171. package/dist/components/Container/index.cjs +1 -0
  172. package/dist/components/Container/index.cjs.map +1 -1
  173. package/dist/components/Container/index.d.ts +20 -7
  174. package/dist/components/Container/index.d.ts.map +1 -1
  175. package/dist/components/Container/index.mjs +1 -0
  176. package/dist/components/Container/index.mjs.map +1 -1
  177. package/dist/components/ContentEditor/ContentEditor.d.ts +0 -1
  178. package/dist/components/ContentEditor/ContentEditorTextArea.d.ts +0 -1
  179. package/dist/components/ContentSelector/ContentSelector.d.ts +0 -1
  180. package/dist/components/CopyToClipboard/index.d.ts +0 -1
  181. package/dist/components/DictionaryEditor/DictionaryEditor.cjs +30 -24
  182. package/dist/components/DictionaryEditor/DictionaryEditor.cjs.map +1 -1
  183. package/dist/components/DictionaryEditor/DictionaryEditor.d.ts +0 -7
  184. package/dist/components/DictionaryEditor/DictionaryEditor.d.ts.map +1 -1
  185. package/dist/components/DictionaryEditor/DictionaryEditor.mjs +30 -24
  186. package/dist/components/DictionaryEditor/DictionaryEditor.mjs.map +1 -1
  187. package/dist/components/DictionaryEditor/ItemLayout.cjs +1 -0
  188. package/dist/components/DictionaryEditor/ItemLayout.cjs.map +1 -1
  189. package/dist/components/DictionaryEditor/ItemLayout.d.ts +0 -1
  190. package/dist/components/DictionaryEditor/ItemLayout.d.ts.map +1 -1
  191. package/dist/components/DictionaryEditor/ItemLayout.mjs +1 -0
  192. package/dist/components/DictionaryEditor/ItemLayout.mjs.map +1 -1
  193. package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.d.ts +0 -1
  194. package/dist/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.d.ts +0 -1
  195. package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.d.ts +0 -1
  196. package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.cjs +7 -5
  197. package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.cjs.map +1 -1
  198. package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.d.ts +0 -1
  199. package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs +7 -5
  200. package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs.map +1 -1
  201. package/dist/components/DictionaryEditor/NodeWrapper/TranslationWrapper.d.ts +0 -1
  202. package/dist/components/DictionaryEditor/NodeWrapper/index.d.ts +0 -1
  203. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs +98 -19
  204. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs.map +1 -1
  205. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.d.ts +1 -5
  206. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.d.ts.map +1 -1
  207. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs +99 -20
  208. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs.map +1 -1
  209. package/dist/components/DictionaryEditor/useEditedContentStore.cjs +18 -20
  210. package/dist/components/DictionaryEditor/useEditedContentStore.cjs.map +1 -1
  211. package/dist/components/DictionaryEditor/useEditedContentStore.d.ts +0 -1
  212. package/dist/components/DictionaryEditor/useEditedContentStore.d.ts.map +1 -1
  213. package/dist/components/DictionaryEditor/useEditedContentStore.mjs +19 -21
  214. package/dist/components/DictionaryEditor/useEditedContentStore.mjs.map +1 -1
  215. package/dist/components/DictionaryEditor/useEditionPanelStore.d.ts +0 -1
  216. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.cjs +46 -0
  217. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.cjs.map +1 -0
  218. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.d.ts +18 -0
  219. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.d.ts.map +1 -0
  220. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.mjs +46 -0
  221. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.mjs.map +1 -0
  222. package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.cjs +8 -0
  223. package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.cjs.map +1 -0
  224. package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.d.ts +4 -0
  225. package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.d.ts.map +1 -0
  226. package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.mjs +8 -0
  227. package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.mjs.map +1 -0
  228. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs +10 -3
  229. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs.map +1 -1
  230. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.d.ts +0 -1
  231. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.d.ts.map +1 -1
  232. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs +10 -3
  233. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs.map +1 -1
  234. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +8 -25
  235. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs.map +1 -1
  236. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.d.ts +0 -1
  237. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.d.ts.map +1 -1
  238. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +7 -24
  239. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
  240. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.cjs +0 -42
  241. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.cjs.map +1 -1
  242. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts +0 -18
  243. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts.map +1 -1
  244. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.mjs +0 -42
  245. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.mjs.map +1 -1
  246. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryFormSchema.cjs.map +1 -1
  247. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryFormSchema.d.ts +0 -1
  248. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryFormSchema.d.ts.map +1 -1
  249. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryFormSchema.mjs.map +1 -1
  250. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +5 -37
  251. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map +1 -1
  252. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts +0 -1
  253. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts.map +1 -1
  254. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +4 -36
  255. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
  256. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsSchema.cjs.map +1 -1
  257. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsSchema.d.ts +2 -3
  258. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsSchema.d.ts.map +1 -1
  259. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsSchema.mjs.map +1 -1
  260. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs +2 -49
  261. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs.map +1 -1
  262. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts +0 -19
  263. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts.map +1 -1
  264. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs +2 -49
  265. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs.map +1 -1
  266. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs +38 -13
  267. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
  268. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts +0 -1
  269. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts.map +1 -1
  270. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +38 -13
  271. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
  272. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs +22 -6
  273. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs.map +1 -1
  274. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.d.ts +0 -1
  275. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.d.ts.map +1 -1
  276. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs +22 -6
  277. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs.map +1 -1
  278. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs +29 -14
  279. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs.map +1 -1
  280. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.d.ts +0 -1
  281. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.d.ts.map +1 -1
  282. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs +29 -14
  283. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs.map +1 -1
  284. package/dist/components/DictionaryFieldEditor/EnumKeyInput.cjs +1 -0
  285. package/dist/components/DictionaryFieldEditor/EnumKeyInput.cjs.map +1 -1
  286. package/dist/components/DictionaryFieldEditor/EnumKeyInput.d.ts +0 -1
  287. package/dist/components/DictionaryFieldEditor/EnumKeyInput.mjs +1 -0
  288. package/dist/components/DictionaryFieldEditor/EnumKeyInput.mjs.map +1 -1
  289. package/dist/components/DictionaryFieldEditor/KeyPathBreadcrumb.d.ts +0 -1
  290. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs +18 -2
  291. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs.map +1 -1
  292. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.d.ts +0 -1
  293. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.d.ts.map +1 -1
  294. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +18 -2
  295. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
  296. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs +18 -2
  297. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs.map +1 -1
  298. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.d.ts +0 -1
  299. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.d.ts.map +1 -1
  300. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs +18 -2
  301. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs.map +1 -1
  302. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +14 -28
  303. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
  304. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts +0 -1
  305. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts.map +1 -1
  306. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +14 -28
  307. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
  308. package/dist/components/DictionaryFieldEditor/SaveForm/SaveFormSchema.d.ts +0 -1
  309. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs +2 -23
  310. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs.map +1 -1
  311. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts +0 -9
  312. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts.map +1 -1
  313. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs +2 -23
  314. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs.map +1 -1
  315. package/dist/components/DictionaryFieldEditor/getIsEditableSection.d.ts +0 -1
  316. package/dist/components/DropDown/index.d.ts +0 -1
  317. package/dist/components/DropDown/types.d.ts +0 -1
  318. package/dist/components/EditableField/EditableFieldInput.cjs +12 -5
  319. package/dist/components/EditableField/EditableFieldInput.cjs.map +1 -1
  320. package/dist/components/EditableField/EditableFieldInput.d.ts +2 -4
  321. package/dist/components/EditableField/EditableFieldInput.d.ts.map +1 -1
  322. package/dist/components/EditableField/EditableFieldInput.mjs +13 -6
  323. package/dist/components/EditableField/EditableFieldInput.mjs.map +1 -1
  324. package/dist/components/EditableField/EditableFieldLayout.d.ts +0 -1
  325. package/dist/components/EditableField/EditableFieldTextArea.cjs +17 -4
  326. package/dist/components/EditableField/EditableFieldTextArea.cjs.map +1 -1
  327. package/dist/components/EditableField/EditableFieldTextArea.d.ts +6 -3
  328. package/dist/components/EditableField/EditableFieldTextArea.d.ts.map +1 -1
  329. package/dist/components/EditableField/EditableFieldTextArea.mjs +18 -5
  330. package/dist/components/EditableField/EditableFieldTextArea.mjs.map +1 -1
  331. package/dist/components/Flags/Flag.d.ts +0 -1
  332. package/dist/components/Footer/index.d.ts +0 -1
  333. package/dist/components/Form/Form.cjs +1 -1
  334. package/dist/components/Form/Form.d.ts +2 -1
  335. package/dist/components/Form/Form.d.ts.map +1 -1
  336. package/dist/components/Form/Form.mjs +1 -1
  337. package/dist/components/Form/FormBase.cjs +4 -1
  338. package/dist/components/Form/FormBase.cjs.map +1 -1
  339. package/dist/components/Form/FormBase.d.ts +1 -2
  340. package/dist/components/Form/FormBase.d.ts.map +1 -1
  341. package/dist/components/Form/FormBase.mjs +4 -1
  342. package/dist/components/Form/FormBase.mjs.map +1 -1
  343. package/dist/components/Form/FormDescription.d.ts +0 -1
  344. package/dist/components/Form/FormField.d.ts +0 -1
  345. package/dist/components/Form/FormItem.d.ts +0 -1
  346. package/dist/components/Form/FormMessage.d.ts +0 -1
  347. package/dist/components/Form/elements/CheckboxElement.cjs +10 -0
  348. package/dist/components/Form/elements/CheckboxElement.cjs.map +1 -0
  349. package/dist/components/Form/elements/CheckboxElement.d.ts +10 -0
  350. package/dist/components/Form/elements/CheckboxElement.d.ts.map +1 -0
  351. package/dist/components/Form/elements/CheckboxElement.mjs +10 -0
  352. package/dist/components/Form/elements/CheckboxElement.mjs.map +1 -0
  353. package/dist/components/Form/elements/EditableFieldInputElement.cjs +1 -1
  354. package/dist/components/Form/elements/EditableFieldInputElement.d.ts +0 -1
  355. package/dist/components/Form/elements/EditableFieldInputElement.mjs +1 -1
  356. package/dist/components/Form/elements/EditableFieldTextAreaElement.cjs +1 -1
  357. package/dist/components/Form/elements/EditableFieldTextAreaElement.d.ts +0 -1
  358. package/dist/components/Form/elements/EditableFieldTextAreaElement.mjs +1 -1
  359. package/dist/components/Form/elements/FormElement.cjs +1 -1
  360. package/dist/components/Form/elements/FormElement.d.ts +0 -1
  361. package/dist/components/Form/elements/FormElement.mjs +1 -1
  362. package/dist/components/Form/elements/FormElementWrapper.d.ts +0 -1
  363. package/dist/components/Form/elements/InputElement.cjs +2 -1
  364. package/dist/components/Form/elements/InputElement.cjs.map +1 -1
  365. package/dist/components/Form/elements/InputElement.d.ts +2 -3
  366. package/dist/components/Form/elements/InputElement.d.ts.map +1 -1
  367. package/dist/components/Form/elements/InputElement.mjs +2 -1
  368. package/dist/components/Form/elements/InputElement.mjs.map +1 -1
  369. package/dist/components/Form/elements/InputPasswordElement.cjs +2 -1
  370. package/dist/components/Form/elements/InputPasswordElement.cjs.map +1 -1
  371. package/dist/components/Form/elements/InputPasswordElement.d.ts +2 -3
  372. package/dist/components/Form/elements/InputPasswordElement.d.ts.map +1 -1
  373. package/dist/components/Form/elements/InputPasswordElement.mjs +2 -1
  374. package/dist/components/Form/elements/InputPasswordElement.mjs.map +1 -1
  375. package/dist/components/Form/elements/MultiselectElement.cjs +1 -1
  376. package/dist/components/Form/elements/MultiselectElement.d.ts +0 -1
  377. package/dist/components/Form/elements/MultiselectElement.mjs +1 -1
  378. package/dist/components/Form/elements/SelectElement.cjs +1 -1
  379. package/dist/components/Form/elements/SelectElement.d.ts +0 -1
  380. package/dist/components/Form/elements/SelectElement.mjs +1 -1
  381. package/dist/components/Form/elements/SwitchSelectorElement.cjs +1 -1
  382. package/dist/components/Form/elements/SwitchSelectorElement.d.ts +0 -1
  383. package/dist/components/Form/elements/SwitchSelectorElement.mjs +1 -1
  384. package/dist/components/Form/elements/TextAreaElement.cjs +1 -1
  385. package/dist/components/Form/elements/TextAreaElement.d.ts +0 -1
  386. package/dist/components/Form/elements/TextAreaElement.mjs +1 -1
  387. package/dist/components/Form/elements/index.cjs +1 -1
  388. package/dist/components/Form/elements/index.mjs +1 -1
  389. package/dist/components/Form/index.cjs +1 -1
  390. package/dist/components/Form/index.mjs +1 -1
  391. package/dist/components/Form/layout/FormItemLayout.cjs +1 -1
  392. package/dist/components/Form/layout/FormItemLayout.d.ts +1 -2
  393. package/dist/components/Form/layout/FormItemLayout.d.ts.map +1 -1
  394. package/dist/components/Form/layout/FormItemLayout.mjs +1 -1
  395. package/dist/components/Form/layout/FormLabelLayout.d.ts +0 -1
  396. package/dist/components/Form/layout/RequiredStar.d.ts +0 -1
  397. package/dist/components/Form/layout/index.cjs +1 -1
  398. package/dist/components/Form/layout/index.mjs +1 -1
  399. package/dist/components/Headers/index.d.ts +0 -1
  400. package/dist/components/IDE/CodeRender.cjs.map +1 -1
  401. package/dist/components/IDE/CodeRender.d.ts +0 -1
  402. package/dist/components/IDE/CodeRender.mjs.map +1 -1
  403. package/dist/components/IDE/FileList.d.ts +0 -1
  404. package/dist/components/IDE/FileTree.d.ts +0 -1
  405. package/dist/components/IDE/IDE.d.ts +0 -1
  406. package/dist/components/IDE/MarkDownRender.d.ts +0 -1
  407. package/dist/components/InformationTag/index.d.ts +0 -1
  408. package/dist/components/Input/Checkbox.cjs +80 -0
  409. package/dist/components/Input/Checkbox.cjs.map +1 -0
  410. package/dist/components/Input/Checkbox.d.ts +14 -0
  411. package/dist/components/Input/Checkbox.d.ts.map +1 -0
  412. package/dist/components/Input/Checkbox.mjs +80 -0
  413. package/dist/components/Input/Checkbox.mjs.map +1 -0
  414. package/dist/components/Input/Input.cjs +8 -2
  415. package/dist/components/Input/Input.cjs.map +1 -1
  416. package/dist/components/Input/Input.d.ts +1 -1
  417. package/dist/components/Input/Input.d.ts.map +1 -1
  418. package/dist/components/Input/Input.mjs +8 -2
  419. package/dist/components/Input/Input.mjs.map +1 -1
  420. package/dist/components/Input/InputPassword.d.ts +0 -1
  421. package/dist/components/Input/index.cjs +3 -0
  422. package/dist/components/Input/index.cjs.map +1 -1
  423. package/dist/components/Input/index.d.ts +1 -0
  424. package/dist/components/Input/index.d.ts.map +1 -1
  425. package/dist/components/Input/index.mjs +3 -0
  426. package/dist/components/Input/index.mjs.map +1 -1
  427. package/dist/components/Label/index.d.ts +0 -1
  428. package/dist/components/Link/Link.cjs +7 -2
  429. package/dist/components/Link/Link.cjs.map +1 -1
  430. package/dist/components/Link/Link.d.ts +2 -2
  431. package/dist/components/Link/Link.d.ts.map +1 -1
  432. package/dist/components/Link/Link.mjs +7 -2
  433. package/dist/components/Link/Link.mjs.map +1 -1
  434. package/dist/components/Loader/index.d.ts +0 -1
  435. package/dist/components/Loader/spinner.d.ts +0 -1
  436. package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.d.ts +0 -1
  437. package/dist/components/Logo/LogoCircle.d.ts +0 -1
  438. package/dist/components/Logo/LogoNoFrame.d.ts +0 -1
  439. package/dist/components/Logo/LogoSquare.d.ts +0 -1
  440. package/dist/components/Logo/LogoSquircle.d.ts +0 -1
  441. package/dist/components/Logo/LogoTextOnly.d.ts +0 -1
  442. package/dist/components/Logo/LogoWithTextBelowCircle.d.ts +0 -1
  443. package/dist/components/Logo/LogoWithTextBelowNoFrame.d.ts +0 -1
  444. package/dist/components/Logo/LogoWithTextBelowSquircle.d.ts +0 -1
  445. package/dist/components/Logo/LogoWithTextCircle.d.ts +0 -1
  446. package/dist/components/Logo/LogoWithTextNoFrame.d.ts +0 -1
  447. package/dist/components/Logo/LogoWithTextSquircle.d.ts +0 -1
  448. package/dist/components/Logo/index.d.ts +0 -1
  449. package/dist/components/MarkDownRender/index.d.ts +0 -1
  450. package/dist/components/MaxHeightSmoother/index.d.ts +0 -1
  451. package/dist/components/MaxWidthSmoother/index.d.ts +0 -1
  452. package/dist/components/Modal/Modal.cjs +22 -16
  453. package/dist/components/Modal/Modal.cjs.map +1 -1
  454. package/dist/components/Modal/Modal.d.ts +3 -3
  455. package/dist/components/Modal/Modal.d.ts.map +1 -1
  456. package/dist/components/Modal/Modal.mjs +22 -16
  457. package/dist/components/Modal/Modal.mjs.map +1 -1
  458. package/dist/components/Navbar/Burger.d.ts +0 -1
  459. package/dist/components/Navbar/DesktopNavbar.cjs +10 -26
  460. package/dist/components/Navbar/DesktopNavbar.cjs.map +1 -1
  461. package/dist/components/Navbar/DesktopNavbar.d.ts +6 -6
  462. package/dist/components/Navbar/DesktopNavbar.d.ts.map +1 -1
  463. package/dist/components/Navbar/DesktopNavbar.mjs +10 -26
  464. package/dist/components/Navbar/DesktopNavbar.mjs.map +1 -1
  465. package/dist/components/Navbar/MobileNavbar.cjs +6 -58
  466. package/dist/components/Navbar/MobileNavbar.cjs.map +1 -1
  467. package/dist/components/Navbar/MobileNavbar.d.ts +6 -7
  468. package/dist/components/Navbar/MobileNavbar.d.ts.map +1 -1
  469. package/dist/components/Navbar/MobileNavbar.mjs +6 -58
  470. package/dist/components/Navbar/MobileNavbar.mjs.map +1 -1
  471. package/dist/components/Navbar/index.cjs +7 -3
  472. package/dist/components/Navbar/index.cjs.map +1 -1
  473. package/dist/components/Navbar/index.d.ts +9 -15
  474. package/dist/components/Navbar/index.d.ts.map +1 -1
  475. package/dist/components/Navbar/index.mjs +7 -3
  476. package/dist/components/Navbar/index.mjs.map +1 -1
  477. package/dist/components/Pattern/DotPattern.d.ts +0 -1
  478. package/dist/components/Pattern/GridPattern.d.ts +0 -1
  479. package/dist/components/Pattern/SpotLight.d.ts +0 -1
  480. package/dist/components/Popover/index.d.ts +0 -1
  481. package/dist/components/PressableSpan/PressableSpan.d.ts +0 -1
  482. package/dist/components/ProfileDropDown/index.d.ts +0 -1
  483. package/dist/components/RightDrawer/RightDrawer.d.ts +0 -1
  484. package/dist/components/Select/Multiselect.d.ts +2 -3
  485. package/dist/components/Select/Multiselect.d.ts.map +1 -1
  486. package/dist/components/SwitchSelector/index.cjs +3 -1
  487. package/dist/components/SwitchSelector/index.cjs.map +1 -1
  488. package/dist/components/SwitchSelector/index.d.ts +0 -1
  489. package/dist/components/SwitchSelector/index.mjs +3 -1
  490. package/dist/components/SwitchSelector/index.mjs.map +1 -1
  491. package/dist/components/TabSelector/TabSelector.cjs +15 -10
  492. package/dist/components/TabSelector/TabSelector.cjs.map +1 -1
  493. package/dist/components/TabSelector/TabSelector.d.ts +1 -2
  494. package/dist/components/TabSelector/TabSelector.d.ts.map +1 -1
  495. package/dist/components/TabSelector/TabSelector.mjs +15 -10
  496. package/dist/components/TabSelector/TabSelector.mjs.map +1 -1
  497. package/dist/components/Tag/index.cjs +79 -0
  498. package/dist/components/Tag/index.cjs.map +1 -0
  499. package/dist/components/Tag/index.d.ts +12 -0
  500. package/dist/components/Tag/index.d.ts.map +1 -0
  501. package/dist/components/Tag/index.mjs +79 -0
  502. package/dist/components/Tag/index.mjs.map +1 -0
  503. package/dist/components/TextArea/AutoSizeTextArea.d.ts +0 -1
  504. package/dist/components/TextArea/TextArea.cjs +1 -0
  505. package/dist/components/TextArea/TextArea.cjs.map +1 -1
  506. package/dist/components/TextArea/TextArea.d.ts +0 -1
  507. package/dist/components/TextArea/TextArea.mjs +1 -0
  508. package/dist/components/TextArea/TextArea.mjs.map +1 -1
  509. package/dist/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.d.ts +0 -1
  510. package/dist/components/ThemeSwitcherDropDown/MobileThemeSwitcher.d.ts +0 -1
  511. package/dist/components/Toaster/useToast.d.ts +0 -1
  512. package/dist/components/WithResizer/index.d.ts +0 -1
  513. package/dist/components/index.cjs +8 -7
  514. package/dist/components/index.cjs.map +1 -1
  515. package/dist/components/index.d.ts +1 -1
  516. package/dist/components/index.d.ts.map +1 -1
  517. package/dist/components/index.mjs +7 -6
  518. package/dist/components/index.mjs.map +1 -1
  519. package/dist/hooks/index.cjs +4 -1
  520. package/dist/hooks/index.cjs.map +1 -1
  521. package/dist/hooks/index.d.ts +1 -0
  522. package/dist/hooks/index.d.ts.map +1 -1
  523. package/dist/hooks/index.mjs +5 -2
  524. package/dist/hooks/index.mjs.map +1 -1
  525. package/dist/hooks/intlayerAPIHooks.cjs +258 -114
  526. package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
  527. package/dist/hooks/intlayerAPIHooks.d.ts +43 -39
  528. package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
  529. package/dist/hooks/intlayerAPIHooks.mjs +259 -115
  530. package/dist/hooks/intlayerAPIHooks.mjs.map +1 -1
  531. package/dist/hooks/useAsync/useAsync.cjs +142 -108
  532. package/dist/hooks/useAsync/useAsync.cjs.map +1 -1
  533. package/dist/hooks/useAsync/useAsync.d.ts +0 -2
  534. package/dist/hooks/useAsync/useAsync.d.ts.map +1 -1
  535. package/dist/hooks/useAsync/useAsync.mjs +143 -109
  536. package/dist/hooks/useAsync/useAsync.mjs.map +1 -1
  537. package/dist/hooks/useAsync/useAsyncStateStore.cjs +50 -112
  538. package/dist/hooks/useAsync/useAsyncStateStore.cjs.map +1 -1
  539. package/dist/hooks/useAsync/useAsyncStateStore.d.ts +3 -9
  540. package/dist/hooks/useAsync/useAsyncStateStore.d.ts.map +1 -1
  541. package/dist/hooks/useAsync/useAsyncStateStore.mjs +50 -112
  542. package/dist/hooks/useAsync/useAsyncStateStore.mjs.map +1 -1
  543. package/dist/hooks/useAsync/useAsyncWrapper.d.ts +0 -1
  544. package/dist/hooks/useAsync/useProxyState.d.ts +3 -0
  545. package/dist/hooks/useAsync/useProxyState.d.ts.map +1 -0
  546. package/dist/hooks/useGetAllDictionaries.d.ts +0 -1
  547. package/dist/hooks/useIntlayerAPI.cjs +6 -5
  548. package/dist/hooks/useIntlayerAPI.cjs.map +1 -1
  549. package/dist/hooks/useIntlayerAPI.d.ts +51 -45
  550. package/dist/hooks/useIntlayerAPI.d.ts.map +1 -1
  551. package/dist/hooks/useIntlayerAPI.mjs +5 -4
  552. package/dist/hooks/useIntlayerAPI.mjs.map +1 -1
  553. package/dist/hooks/useItemSelector.cjs +11 -2
  554. package/dist/hooks/useItemSelector.cjs.map +1 -1
  555. package/dist/hooks/useItemSelector.d.ts +3 -3
  556. package/dist/hooks/useItemSelector.d.ts.map +1 -1
  557. package/dist/hooks/useItemSelector.mjs +11 -2
  558. package/dist/hooks/useItemSelector.mjs.map +1 -1
  559. package/dist/hooks/usePersistedStore.cjs +22 -0
  560. package/dist/hooks/usePersistedStore.cjs.map +1 -0
  561. package/dist/hooks/usePersistedStore.d.ts +2 -0
  562. package/dist/hooks/usePersistedStore.d.ts.map +1 -0
  563. package/dist/hooks/usePersistedStore.mjs +22 -0
  564. package/dist/hooks/usePersistedStore.mjs.map +1 -0
  565. package/dist/hooks/usePersistenceStore.cjs +22 -0
  566. package/dist/hooks/usePersistenceStore.cjs.map +1 -0
  567. package/dist/hooks/usePersistenceStore.d.ts +2 -0
  568. package/dist/hooks/usePersistenceStore.d.ts.map +1 -0
  569. package/dist/hooks/usePersistenceStore.mjs +22 -0
  570. package/dist/hooks/usePersistenceStore.mjs.map +1 -0
  571. package/dist/index-BUDsCMdX.cjs +204 -0
  572. package/dist/index-BUDsCMdX.cjs.map +1 -0
  573. package/dist/index-C09rI9kw.js +205 -0
  574. package/dist/index-C09rI9kw.js.map +1 -0
  575. package/dist/libs/intlayer-api/auth.cjs +14 -2
  576. package/dist/libs/intlayer-api/auth.cjs.map +1 -1
  577. package/dist/libs/intlayer-api/auth.d.ts +7 -4
  578. package/dist/libs/intlayer-api/auth.d.ts.map +1 -1
  579. package/dist/libs/intlayer-api/auth.mjs +14 -2
  580. package/dist/libs/intlayer-api/auth.mjs.map +1 -1
  581. package/dist/libs/intlayer-api/dictionary.d.ts +0 -1
  582. package/dist/libs/intlayer-api/fetcher.cjs +4 -3
  583. package/dist/libs/intlayer-api/fetcher.cjs.map +1 -1
  584. package/dist/libs/intlayer-api/fetcher.d.ts.map +1 -1
  585. package/dist/libs/intlayer-api/fetcher.mjs +4 -3
  586. package/dist/libs/intlayer-api/fetcher.mjs.map +1 -1
  587. package/dist/libs/intlayer-api/index.cjs +3 -1
  588. package/dist/libs/intlayer-api/index.cjs.map +1 -1
  589. package/dist/libs/intlayer-api/index.d.ts +12 -3
  590. package/dist/libs/intlayer-api/index.d.ts.map +1 -1
  591. package/dist/libs/intlayer-api/index.mjs +3 -1
  592. package/dist/libs/intlayer-api/index.mjs.map +1 -1
  593. package/dist/libs/intlayer-api/organization.d.ts +0 -1
  594. package/dist/libs/intlayer-api/project.d.ts +0 -1
  595. package/dist/libs/intlayer-api/stripe.cjs +22 -0
  596. package/dist/libs/intlayer-api/stripe.cjs.map +1 -0
  597. package/dist/libs/intlayer-api/stripe.d.ts +6 -0
  598. package/dist/libs/intlayer-api/stripe.d.ts.map +1 -0
  599. package/dist/libs/intlayer-api/stripe.mjs +22 -0
  600. package/dist/libs/intlayer-api/stripe.mjs.map +1 -0
  601. package/dist/libs/intlayer-api/user.d.ts +0 -1
  602. package/dist/stripe-BsI0lJWz.js +22 -0
  603. package/dist/stripe-BsI0lJWz.js.map +1 -0
  604. package/dist/stripe-C-u5RvGh.js +22 -0
  605. package/dist/stripe-C-u5RvGh.js.map +1 -0
  606. package/dist/stripe-CF_E65Vu.js +22 -0
  607. package/dist/stripe-CF_E65Vu.js.map +1 -0
  608. package/dist/stripe-CpGvfq6T.cjs +21 -0
  609. package/dist/stripe-CpGvfq6T.cjs.map +1 -0
  610. package/dist/stripe-DEv4DjAL.cjs +21 -0
  611. package/dist/stripe-DEv4DjAL.cjs.map +1 -0
  612. package/dist/stripe-DuG0uaEn.cjs +21 -0
  613. package/dist/stripe-DuG0uaEn.cjs.map +1 -0
  614. package/dist/tailwind.css +1 -1
  615. package/dist/useProxyState-D5GLrY2y.js +20 -0
  616. package/dist/useProxyState-D5GLrY2y.js.map +1 -0
  617. package/dist/useProxyState-DewdF3no.cjs +19 -0
  618. package/dist/useProxyState-DewdF3no.cjs.map +1 -0
  619. package/dist/utils/cn.d.ts +0 -1
  620. package/dist/utils/dictionary.cjs +37 -1
  621. package/dist/utils/dictionary.cjs.map +1 -1
  622. package/dist/utils/dictionary.d.ts +1 -1
  623. package/dist/utils/dictionary.d.ts.map +1 -1
  624. package/dist/utils/dictionary.mjs +38 -2
  625. package/dist/utils/dictionary.mjs.map +1 -1
  626. package/dist/validDictionaryChangeButtons.content-BK9QaXPm.cjs +66 -0
  627. package/dist/validDictionaryChangeButtons.content-BK9QaXPm.cjs.map +1 -0
  628. package/dist/validDictionaryChangeButtons.content-CAAscqJI.cjs +66 -0
  629. package/dist/validDictionaryChangeButtons.content-CAAscqJI.cjs.map +1 -0
  630. package/dist/validDictionaryChangeButtons.content-D7AvoBdl.js +67 -0
  631. package/dist/validDictionaryChangeButtons.content-D7AvoBdl.js.map +1 -0
  632. package/dist/validDictionaryChangeButtons.content-DQwoUNCC.cjs +45 -0
  633. package/dist/validDictionaryChangeButtons.content-DQwoUNCC.cjs.map +1 -0
  634. package/dist/validDictionaryChangeButtons.content-DQxPoIe6.js +67 -0
  635. package/dist/validDictionaryChangeButtons.content-DQxPoIe6.js.map +1 -0
  636. package/dist/validDictionaryChangeButtons.content-JUcjGdBx.cjs +66 -0
  637. package/dist/validDictionaryChangeButtons.content-JUcjGdBx.cjs.map +1 -0
  638. package/dist/validDictionaryChangeButtons.content-ejY3-sbG.js +67 -0
  639. package/dist/validDictionaryChangeButtons.content-ejY3-sbG.js.map +1 -0
  640. package/dist/validDictionaryChangeButtons.content-iyT0lKy7.js +46 -0
  641. package/dist/validDictionaryChangeButtons.content-iyT0lKy7.js.map +1 -0
  642. package/dist/validDictionaryChangeButtons.content-u4qShrQh.cjs +66 -0
  643. package/dist/validDictionaryChangeButtons.content-u4qShrQh.cjs.map +1 -0
  644. package/dist/validDictionaryChangeButtons.content-y4up9NU8.js +67 -0
  645. package/dist/validDictionaryChangeButtons.content-y4up9NU8.js.map +1 -0
  646. package/dist/zod-BV4nCGJE.js.map +1 -1
  647. package/dist/zod-DSrtTSD_.cjs.map +1 -1
  648. package/package.json +87 -56
@@ -1,27 +1,106 @@
1
1
  "use client";
2
2
  import { j as jsxRuntimeExports } from "../../jsx-runtime-BgSF1HG2.js";
3
- import { Check, X } from "lucide-react";
4
- const ValidDictionaryChangeButtons = ({ onCancelEdition, onValidEdition, ...props }) => {
5
- const isEditing = Object.keys(props.editedContent ?? {}).length > 0;
6
- return isEditing && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row items-center justify-end gap-2", children: [
7
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Valid dictionary changes" }),
8
- /* @__PURE__ */ jsxRuntimeExports.jsx(
9
- Check,
3
+ import { RotateCcw, ArrowUpFromLine, Save } from "lucide-react";
4
+ import { useMemo } from "react";
5
+ import { useDictionary } from "react-intlayer";
6
+ import "../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
7
+ import "../../hooks/useAsync/useAsyncStateStore.mjs";
8
+ import { usePushDictionaries } from "../../hooks/intlayerAPIHooks.mjs";
9
+ import "@intlayer/dictionaries-entry";
10
+ import "deepmerge";
11
+ import { useForm } from "../Form/FormBase.mjs";
12
+ import "../Form/FormField.mjs";
13
+ import { F as Form } from "../../Form-DyFBmVya.js";
14
+ import { useEditedContentStore } from "./useEditedContentStore.mjs";
15
+ import { validDictionaryChangeButtonsContent } from "./validDictionaryChangeButtons.content.mjs";
16
+ import { getValidDictionaryChangeButtonsSchemaSchema } from "./validDictionaryChangeButtonsSchema.mjs";
17
+ const ValidDictionaryChangeButtons = ({ dictionary }) => {
18
+ const ValidDictionaryChangeButtonsSchemaSchema = getValidDictionaryChangeButtonsSchemaSchema();
19
+ const { resetButton, saveButton, publishButton } = useDictionary(
20
+ validDictionaryChangeButtonsContent
21
+ );
22
+ const { pushDictionaries } = usePushDictionaries();
23
+ const { editedContent, restoreEditedContent } = useEditedContentStore(
24
+ (s) => ({
25
+ editedContent: s.editedContent,
26
+ restoreEditedContent: s.restoreEditedContent
27
+ })
28
+ );
29
+ const { form, isSubmitting } = useForm(
30
+ ValidDictionaryChangeButtonsSchemaSchema
31
+ );
32
+ const editedDictionary = useMemo(
33
+ () => editedContent[dictionary.key],
34
+ [editedContent, dictionary.key]
35
+ );
36
+ const isEdited = useMemo(
37
+ () => editedDictionary && JSON.stringify(editedDictionary?.content) !== JSON.stringify(dictionary?.content),
38
+ [editedDictionary, dictionary]
39
+ );
40
+ const isLocalDictionary = useMemo(
41
+ () => typeof dictionary?._id === "undefined",
42
+ [dictionary]
43
+ );
44
+ const onSubmitSuccess = async () => {
45
+ await pushDictionaries([
10
46
  {
11
- className: "cursor-pointer hover:scale-110",
12
- size: 16,
13
- onClick: onValidEdition
47
+ ...dictionary,
48
+ ...editedContent[dictionary.key]
14
49
  }
15
- ),
16
- /* @__PURE__ */ jsxRuntimeExports.jsx(
17
- X,
18
- {
19
- className: "cursor-pointer hover:scale-110",
20
- size: 16,
21
- onClick: onCancelEdition
22
- }
23
- )
24
- ] });
50
+ ]);
51
+ };
52
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
53
+ Form,
54
+ {
55
+ className: "flex w-full flex-row flex-wrap justify-end gap-3",
56
+ ...form,
57
+ schema: ValidDictionaryChangeButtonsSchemaSchema,
58
+ onSubmitSuccess,
59
+ children: [
60
+ isEdited && /* @__PURE__ */ jsxRuntimeExports.jsx(
61
+ Form.Button,
62
+ {
63
+ type: "button",
64
+ label: resetButton.label.value,
65
+ disabled: !isEdited || isSubmitting,
66
+ className: "ml-auto",
67
+ Icon: RotateCcw,
68
+ variant: "outline",
69
+ color: "text",
70
+ isFullWidth: true,
71
+ isLoading: isSubmitting,
72
+ onClick: () => restoreEditedContent(dictionary.key),
73
+ children: resetButton.text
74
+ }
75
+ ),
76
+ isLocalDictionary ? /* @__PURE__ */ jsxRuntimeExports.jsx(
77
+ Form.Button,
78
+ {
79
+ type: "submit",
80
+ label: publishButton.label.value,
81
+ disabled: !isEdited || isSubmitting,
82
+ Icon: ArrowUpFromLine,
83
+ color: "text",
84
+ isFullWidth: true,
85
+ isLoading: isSubmitting,
86
+ children: publishButton.text
87
+ }
88
+ ) : isEdited && /* @__PURE__ */ jsxRuntimeExports.jsx(
89
+ Form.Button,
90
+ {
91
+ type: "submit",
92
+ label: saveButton.label.value,
93
+ disabled: !isEdited || isSubmitting,
94
+ Icon: Save,
95
+ color: "text",
96
+ isFullWidth: true,
97
+ isLoading: isSubmitting,
98
+ children: saveButton.text
99
+ }
100
+ )
101
+ ]
102
+ }
103
+ ) });
25
104
  };
26
105
  export {
27
106
  ValidDictionaryChangeButtons
@@ -1 +1 @@
1
- {"version":3,"file":"ValidDictionaryChangeButtons.mjs","sources":["../../../src/components/DictionaryEditor/ValidDictionaryChangeButtons.tsx"],"sourcesContent":["'use client';\n\nimport type { Dictionary } from '@intlayer/core';\nimport { Check, X } from 'lucide-react';\nimport type { FC } from 'react';\n\ntype ValidDictionaryChangeButtonsProps = {\n onValidEdition: () => void;\n onCancelEdition: () => void;\n editedContent?: Dictionary;\n dictionaryId?: string;\n};\n\nexport const ValidDictionaryChangeButtons: FC<\n ValidDictionaryChangeButtonsProps\n> = ({ onCancelEdition, onValidEdition, ...props }) => {\n const isEditing = Object.keys(props.editedContent ?? {}).length > 0;\n\n return (\n isEditing && (\n <div className=\"flex flex-row items-center justify-end gap-2\">\n <span>Valid dictionary changes</span>\n <Check\n className=\"cursor-pointer hover:scale-110\"\n size={16}\n onClick={onValidEdition}\n />\n <X\n className=\"cursor-pointer hover:scale-110\"\n size={16}\n onClick={onCancelEdition}\n />\n </div>\n )\n );\n};\n"],"names":["jsxs","jsx"],"mappings":";;;AAaO,MAAM,+BAET,CAAC,EAAE,iBAAiB,gBAAgB,GAAG,YAAY;AAC/C,QAAA,YAAY,OAAO,KAAK,MAAM,iBAAiB,CAAE,CAAA,EAAE,SAAS;AAElE,SACE,aACEA,kCAAAA,KAAC,OAAI,EAAA,WAAU,gDACb,UAAA;AAAA,IAAAC,kCAAAA,IAAC,UAAK,UAAwB,2BAAA,CAAA;AAAA,IAC9BA,kCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAU;AAAA,QACV,MAAM;AAAA,QACN,SAAS;AAAA,MAAA;AAAA,IACX;AAAA,IACAA,kCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAU;AAAA,QACV,MAAM;AAAA,QACN,SAAS;AAAA,MAAA;AAAA,IACX;AAAA,EACF,EAAA,CAAA;AAGN;"}
1
+ {"version":3,"file":"ValidDictionaryChangeButtons.mjs","sources":["../../../src/components/DictionaryEditor/ValidDictionaryChangeButtons.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport type { Dictionary } from '@intlayer/core';\nimport { ArrowUpFromLine, RotateCcw, Save } from 'lucide-react';\nimport { useMemo, type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { usePushDictionaries } from '../../hooks';\nimport { Form, useForm } from '../Form';\nimport { useEditedContentStore } from './useEditedContentStore';\nimport { validDictionaryChangeButtonsContent } from './validDictionaryChangeButtons.content';\nimport { getValidDictionaryChangeButtonsSchemaSchema } from './validDictionaryChangeButtonsSchema';\n\ntype ValidDictionaryChangeButtonsProps = {\n dictionary: Dictionary;\n};\n\nexport const ValidDictionaryChangeButtons: FC<\n ValidDictionaryChangeButtonsProps\n> = ({ dictionary }) => {\n const ValidDictionaryChangeButtonsSchemaSchema =\n getValidDictionaryChangeButtonsSchemaSchema();\n\n const { resetButton, saveButton, publishButton } = useDictionary(\n validDictionaryChangeButtonsContent\n );\n\n const { pushDictionaries } = usePushDictionaries();\n\n const { editedContent, restoreEditedContent } = useEditedContentStore(\n (s) => ({\n editedContent: s.editedContent,\n restoreEditedContent: s.restoreEditedContent,\n })\n );\n const { form, isSubmitting } = useForm(\n ValidDictionaryChangeButtonsSchemaSchema\n );\n\n const editedDictionary = useMemo(\n () => editedContent[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const isEdited = useMemo(\n () =>\n editedDictionary &&\n JSON.stringify(editedDictionary?.content) !==\n JSON.stringify(dictionary?.content),\n [editedDictionary, dictionary]\n );\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = async () => {\n await pushDictionaries([\n {\n ...dictionary,\n ...editedContent[dictionary.key],\n },\n ]);\n };\n\n return (\n <div className=\"mb-4\">\n <Form\n className=\"flex w-full flex-row flex-wrap justify-end gap-3\"\n {...form}\n schema={ValidDictionaryChangeButtonsSchemaSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n {isEdited && (\n <Form.Button\n type=\"button\"\n label={resetButton.label.value}\n disabled={!isEdited || isSubmitting}\n className=\"ml-auto\"\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={ArrowUpFromLine}\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n isEdited && (\n <Form.Button\n type=\"submit\"\n label={saveButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={Save}\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )\n )}\n </Form>\n </div>\n );\n};\n"],"names":["jsx","jsxs"],"mappings":";;;;;;;;;;;;;;;;AAiBO,MAAM,+BAET,CAAC,EAAE,iBAAiB;AACtB,QAAM,2CACJ;AAEF,QAAM,EAAE,aAAa,YAAY,cAAkB,IAAA;AAAA,IACjD;AAAA,EAAA;AAGI,QAAA,EAAE,qBAAqB;AAEvB,QAAA,EAAE,eAAe,qBAAA,IAAyB;AAAA,IAC9C,CAAC,OAAO;AAAA,MACN,eAAe,EAAE;AAAA,MACjB,sBAAsB,EAAE;AAAA,IAAA;AAAA,EAC1B;AAEI,QAAA,EAAE,MAAM,aAAA,IAAiB;AAAA,IAC7B;AAAA,EAAA;AAGF,QAAM,mBAAmB;AAAA,IACvB,MAAM,cAAc,WAAW,GAAG;AAAA,IAClC,CAAC,eAAe,WAAW,GAAG;AAAA,EAAA;AAGhC,QAAM,WAAW;AAAA,IACf,MACE,oBACA,KAAK,UAAU,kBAAkB,OAAO,MACtC,KAAK,UAAU,YAAY,OAAO;AAAA,IACtC,CAAC,kBAAkB,UAAU;AAAA,EAAA;AAG/B,QAAM,oBAAoB;AAAA,IACxB,MAAM,OAAQ,YAAkC,QAAQ;AAAA,IACxD,CAAC,UAAU;AAAA,EAAA;AAGb,QAAM,kBAAkB,YAAY;AAClC,UAAM,iBAAiB;AAAA,MACrB;AAAA,QACE,GAAG;AAAA,QACH,GAAG,cAAc,WAAW,GAAG;AAAA,MACjC;AAAA,IAAA,CACD;AAAA,EAAA;AAID,SAAAA,kCAAAA,IAAC,OAAI,EAAA,WAAU,QACb,UAAAC,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACT,GAAG;AAAA,MACJ,QAAQ;AAAA,MACR;AAAA,MAEC,UAAA;AAAA,QACC,YAAAD,kCAAA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,YAAY,MAAM;AAAA,YACzB,UAAU,CAAC,YAAY;AAAA,YACvB,WAAU;AAAA,YACV,MAAM;AAAA,YACN,SAAQ;AAAA,YACR,OAAM;AAAA,YACN,aAAW;AAAA,YACX,WAAW;AAAA,YACX,SAAS,MAAM,qBAAqB,WAAW,GAAG;AAAA,YAEjD,UAAY,YAAA;AAAA,UAAA;AAAA,QACf;AAAA,QAED,oBACCA,kCAAA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,cAAc,MAAM;AAAA,YAC3B,UAAU,CAAC,YAAY;AAAA,YACvB,MAAM;AAAA,YACN,OAAM;AAAA,YACN,aAAW;AAAA,YACX,WAAW;AAAA,YAEV,UAAc,cAAA;AAAA,UAAA;AAAA,YAGjB,YACEA,kCAAA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,WAAW,MAAM;AAAA,YACxB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAM;AAAA,YACN,OAAM;AAAA,YACN,aAAW;AAAA,YACX,WAAW;AAAA,YAEV,UAAW,WAAA;AAAA,UAAA;AAAA,QACd;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR,EAAA,CAAA;AAEJ;"}
@@ -342,9 +342,16 @@ const useEditedContentStore = zustand.create(
342
342
  (set, get) => ({
343
343
  dictionariesRecord: {},
344
344
  editedContent: {},
345
- setDictionariesRecord: (dictionariesRecord) => set(() => ({ dictionariesRecord })),
345
+ setDictionariesRecord: (dictionariesRecord) => set((state) => ({
346
+ dictionariesRecord: {
347
+ ...state.dictionariesRecord,
348
+ ...dictionariesRecord
349
+ }
350
+ })),
346
351
  addEditedContent: (dictionaryKey, newValue, keyPath = [], overwrite = true) => set((state) => {
347
- const dictionaryContent = state.editedContent[dictionaryKey]?.content ?? state.dictionariesRecord[dictionaryKey].content;
352
+ const dictionaryContent = state.editedContent[dictionaryKey]?.content ?? JSON.parse(
353
+ JSON.stringify(state.dictionariesRecord[dictionaryKey].content)
354
+ );
348
355
  let newKeyPath = keyPath;
349
356
  if (!overwrite) {
350
357
  let isKeyExist = false;
@@ -386,24 +393,13 @@ const useEditedContentStore = zustand.create(
386
393
  }),
387
394
  renameEditedContent: (dictionaryKey, newKey, keyPath = []) => {
388
395
  set((state) => {
389
- const dictionaryContent = state.editedContent[dictionaryKey]?.content ?? state.dictionariesRecord[dictionaryKey].content;
390
- const lastKeyPath = keyPath[keyPath.length - 1];
391
- const otherKeyPath = keyPath.slice(0, -1);
392
- const newKeyPath = [
393
- ...otherKeyPath,
394
- { ...lastKeyPath, key: newKey }
395
- ];
396
- const contentValue = utils_dictionary.getDictionaryValueByKeyPath(
397
- dictionaryContent,
398
- keyPath
396
+ const initialDictionaryContent = JSON.parse(
397
+ JSON.stringify(state.dictionariesRecord[dictionaryKey].content)
399
398
  );
400
- const contentWithNewField = utils_dictionary.editDictionaryByKeyPath(
399
+ const dictionaryContent = state.editedContent[dictionaryKey]?.content ?? initialDictionaryContent;
400
+ const contentWithNewField = utils_dictionary.renameDictionaryValueByKeyPath(
401
401
  dictionaryContent,
402
- newKeyPath,
403
- contentValue
404
- );
405
- const editedContent = utils_dictionary.removeDictionaryValueByKeyPath(
406
- contentWithNewField,
402
+ newKey,
407
403
  keyPath
408
404
  );
409
405
  return {
@@ -411,7 +407,7 @@ const useEditedContentStore = zustand.create(
411
407
  ...state.editedContent,
412
408
  [dictionaryKey]: {
413
409
  ...state.editedContent[dictionaryKey],
414
- content: editedContent
410
+ content: contentWithNewField
415
411
  }
416
412
  }
417
413
  };
@@ -419,7 +415,9 @@ const useEditedContentStore = zustand.create(
419
415
  },
420
416
  removeEditedContent: (dictionaryKey, keyPath) => {
421
417
  set((state) => {
422
- const initialDictionaryContent = state.dictionariesRecord[dictionaryKey].content;
418
+ const initialDictionaryContent = JSON.parse(
419
+ JSON.stringify(state.dictionariesRecord[dictionaryKey].content)
420
+ );
423
421
  const editedDictionaryContent = state.editedContent[dictionaryKey]?.content ?? initialDictionaryContent;
424
422
  const initialContent = utils_dictionary.getDictionaryValueByKeyPath(
425
423
  initialDictionaryContent,
@@ -1 +1 @@
1
- {"version":3,"file":"useEditedContentStore.cjs","sources":["../../../../../../node_modules/.pnpm/zustand@4.5.5_@types+react@18.3.11_react@18.3.1/node_modules/zustand/esm/middleware.mjs","../../../src/components/DictionaryEditor/useEditedContentStore.ts"],"sourcesContent":["const reduxImpl = (reducer, initial) => (set, _get, api) => {\n api.dispatch = (action) => {\n set((state) => reducer(state, action), false, action);\n return action;\n };\n api.dispatchFromDevtools = true;\n return { dispatch: (...a) => api.dispatch(...a), ...initial };\n};\nconst redux = reduxImpl;\n\nconst trackedConnections = /* @__PURE__ */ new Map();\nconst getTrackedConnectionState = (name) => {\n const api = trackedConnections.get(name);\n if (!api) return {};\n return Object.fromEntries(\n Object.entries(api.stores).map(([key, api2]) => [key, api2.getState()])\n );\n};\nconst extractConnectionInformation = (store, extensionConnector, options) => {\n if (store === void 0) {\n return {\n type: \"untracked\",\n connection: extensionConnector.connect(options)\n };\n }\n const existingConnection = trackedConnections.get(options.name);\n if (existingConnection) {\n return { type: \"tracked\", store, ...existingConnection };\n }\n const newConnection = {\n connection: extensionConnector.connect(options),\n stores: {}\n };\n trackedConnections.set(options.name, newConnection);\n return { type: \"tracked\", store, ...newConnection };\n};\nconst devtoolsImpl = (fn, devtoolsOptions = {}) => (set, get, api) => {\n const { enabled, anonymousActionType, store, ...options } = devtoolsOptions;\n let extensionConnector;\n try {\n extensionConnector = (enabled != null ? enabled : (import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") && window.__REDUX_DEVTOOLS_EXTENSION__;\n } catch (_e) {\n }\n if (!extensionConnector) {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\" && enabled) {\n console.warn(\n \"[zustand devtools middleware] Please install/enable Redux devtools extension\"\n );\n }\n return fn(set, get, api);\n }\n const { connection, ...connectionInformation } = extractConnectionInformation(store, extensionConnector, options);\n let isRecording = true;\n api.setState = (state, replace, nameOrAction) => {\n const r = set(state, replace);\n if (!isRecording) return r;\n const action = nameOrAction === void 0 ? { type: anonymousActionType || \"anonymous\" } : typeof nameOrAction === \"string\" ? { type: nameOrAction } : nameOrAction;\n if (store === void 0) {\n connection == null ? void 0 : connection.send(action, get());\n return r;\n }\n connection == null ? void 0 : connection.send(\n {\n ...action,\n type: `${store}/${action.type}`\n },\n {\n ...getTrackedConnectionState(options.name),\n [store]: api.getState()\n }\n );\n return r;\n };\n const setStateFromDevtools = (...a) => {\n const originalIsRecording = isRecording;\n isRecording = false;\n set(...a);\n isRecording = originalIsRecording;\n };\n const initialState = fn(api.setState, get, api);\n if (connectionInformation.type === \"untracked\") {\n connection == null ? void 0 : connection.init(initialState);\n } else {\n connectionInformation.stores[connectionInformation.store] = api;\n connection == null ? void 0 : connection.init(\n Object.fromEntries(\n Object.entries(connectionInformation.stores).map(([key, store2]) => [\n key,\n key === connectionInformation.store ? initialState : store2.getState()\n ])\n )\n );\n }\n if (api.dispatchFromDevtools && typeof api.dispatch === \"function\") {\n let didWarnAboutReservedActionType = false;\n const originalDispatch = api.dispatch;\n api.dispatch = (...a) => {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\" && a[0].type === \"__setState\" && !didWarnAboutReservedActionType) {\n console.warn(\n '[zustand devtools middleware] \"__setState\" action type is reserved to set state from the devtools. Avoid using it.'\n );\n didWarnAboutReservedActionType = true;\n }\n originalDispatch(...a);\n };\n }\n connection.subscribe((message) => {\n var _a;\n switch (message.type) {\n case \"ACTION\":\n if (typeof message.payload !== \"string\") {\n console.error(\n \"[zustand devtools middleware] Unsupported action format\"\n );\n return;\n }\n return parseJsonThen(\n message.payload,\n (action) => {\n if (action.type === \"__setState\") {\n if (store === void 0) {\n setStateFromDevtools(action.state);\n return;\n }\n if (Object.keys(action.state).length !== 1) {\n console.error(\n `\n [zustand devtools middleware] Unsupported __setState action format. \n When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),\n and value of this only key should be a state object. Example: { \"type\": \"__setState\", \"state\": { \"abc123Store\": { \"foo\": \"bar\" } } }\n `\n );\n }\n const stateFromDevtools = action.state[store];\n if (stateFromDevtools === void 0 || stateFromDevtools === null) {\n return;\n }\n if (JSON.stringify(api.getState()) !== JSON.stringify(stateFromDevtools)) {\n setStateFromDevtools(stateFromDevtools);\n }\n return;\n }\n if (!api.dispatchFromDevtools) return;\n if (typeof api.dispatch !== \"function\") return;\n api.dispatch(action);\n }\n );\n case \"DISPATCH\":\n switch (message.payload.type) {\n case \"RESET\":\n setStateFromDevtools(initialState);\n if (store === void 0) {\n return connection == null ? void 0 : connection.init(api.getState());\n }\n return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n case \"COMMIT\":\n if (store === void 0) {\n connection == null ? void 0 : connection.init(api.getState());\n return;\n }\n return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n case \"ROLLBACK\":\n return parseJsonThen(message.state, (state) => {\n if (store === void 0) {\n setStateFromDevtools(state);\n connection == null ? void 0 : connection.init(api.getState());\n return;\n }\n setStateFromDevtools(state[store]);\n connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n });\n case \"JUMP_TO_STATE\":\n case \"JUMP_TO_ACTION\":\n return parseJsonThen(message.state, (state) => {\n if (store === void 0) {\n setStateFromDevtools(state);\n return;\n }\n if (JSON.stringify(api.getState()) !== JSON.stringify(state[store])) {\n setStateFromDevtools(state[store]);\n }\n });\n case \"IMPORT_STATE\": {\n const { nextLiftedState } = message.payload;\n const lastComputedState = (_a = nextLiftedState.computedStates.slice(-1)[0]) == null ? void 0 : _a.state;\n if (!lastComputedState) return;\n if (store === void 0) {\n setStateFromDevtools(lastComputedState);\n } else {\n setStateFromDevtools(lastComputedState[store]);\n }\n connection == null ? void 0 : connection.send(\n null,\n // FIXME no-any\n nextLiftedState\n );\n return;\n }\n case \"PAUSE_RECORDING\":\n return isRecording = !isRecording;\n }\n return;\n }\n });\n return initialState;\n};\nconst devtools = devtoolsImpl;\nconst parseJsonThen = (stringified, f) => {\n let parsed;\n try {\n parsed = JSON.parse(stringified);\n } catch (e) {\n console.error(\n \"[zustand devtools middleware] Could not parse the received json\",\n e\n );\n }\n if (parsed !== void 0) f(parsed);\n};\n\nconst subscribeWithSelectorImpl = (fn) => (set, get, api) => {\n const origSubscribe = api.subscribe;\n api.subscribe = (selector, optListener, options) => {\n let listener = selector;\n if (optListener) {\n const equalityFn = (options == null ? void 0 : options.equalityFn) || Object.is;\n let currentSlice = selector(api.getState());\n listener = (state) => {\n const nextSlice = selector(state);\n if (!equalityFn(currentSlice, nextSlice)) {\n const previousSlice = currentSlice;\n optListener(currentSlice = nextSlice, previousSlice);\n }\n };\n if (options == null ? void 0 : options.fireImmediately) {\n optListener(currentSlice, currentSlice);\n }\n }\n return origSubscribe(listener);\n };\n const initialState = fn(set, get, api);\n return initialState;\n};\nconst subscribeWithSelector = subscribeWithSelectorImpl;\n\nconst combine = (initialState, create) => (...a) => Object.assign({}, initialState, create(...a));\n\nfunction createJSONStorage(getStorage, options) {\n let storage;\n try {\n storage = getStorage();\n } catch (_e) {\n return;\n }\n const persistStorage = {\n getItem: (name) => {\n var _a;\n const parse = (str2) => {\n if (str2 === null) {\n return null;\n }\n return JSON.parse(str2, options == null ? void 0 : options.reviver);\n };\n const str = (_a = storage.getItem(name)) != null ? _a : null;\n if (str instanceof Promise) {\n return str.then(parse);\n }\n return parse(str);\n },\n setItem: (name, newValue) => storage.setItem(\n name,\n JSON.stringify(newValue, options == null ? void 0 : options.replacer)\n ),\n removeItem: (name) => storage.removeItem(name)\n };\n return persistStorage;\n}\nconst toThenable = (fn) => (input) => {\n try {\n const result = fn(input);\n if (result instanceof Promise) {\n return result;\n }\n return {\n then(onFulfilled) {\n return toThenable(onFulfilled)(result);\n },\n catch(_onRejected) {\n return this;\n }\n };\n } catch (e) {\n return {\n then(_onFulfilled) {\n return this;\n },\n catch(onRejected) {\n return toThenable(onRejected)(e);\n }\n };\n }\n};\nconst oldImpl = (config, baseOptions) => (set, get, api) => {\n let options = {\n getStorage: () => localStorage,\n serialize: JSON.stringify,\n deserialize: JSON.parse,\n partialize: (state) => state,\n version: 0,\n merge: (persistedState, currentState) => ({\n ...currentState,\n ...persistedState\n }),\n ...baseOptions\n };\n let hasHydrated = false;\n const hydrationListeners = /* @__PURE__ */ new Set();\n const finishHydrationListeners = /* @__PURE__ */ new Set();\n let storage;\n try {\n storage = options.getStorage();\n } catch (_e) {\n }\n if (!storage) {\n return config(\n (...args) => {\n console.warn(\n `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.`\n );\n set(...args);\n },\n get,\n api\n );\n }\n const thenableSerialize = toThenable(options.serialize);\n const setItem = () => {\n const state = options.partialize({ ...get() });\n let errorInSync;\n const thenable = thenableSerialize({ state, version: options.version }).then(\n (serializedValue) => storage.setItem(options.name, serializedValue)\n ).catch((e) => {\n errorInSync = e;\n });\n if (errorInSync) {\n throw errorInSync;\n }\n return thenable;\n };\n const savedSetState = api.setState;\n api.setState = (state, replace) => {\n savedSetState(state, replace);\n void setItem();\n };\n const configResult = config(\n (...args) => {\n set(...args);\n void setItem();\n },\n get,\n api\n );\n let stateFromStorage;\n const hydrate = () => {\n var _a;\n if (!storage) return;\n hasHydrated = false;\n hydrationListeners.forEach((cb) => cb(get()));\n const postRehydrationCallback = ((_a = options.onRehydrateStorage) == null ? void 0 : _a.call(options, get())) || void 0;\n return toThenable(storage.getItem.bind(storage))(options.name).then((storageValue) => {\n if (storageValue) {\n return options.deserialize(storageValue);\n }\n }).then((deserializedStorageValue) => {\n if (deserializedStorageValue) {\n if (typeof deserializedStorageValue.version === \"number\" && deserializedStorageValue.version !== options.version) {\n if (options.migrate) {\n return options.migrate(\n deserializedStorageValue.state,\n deserializedStorageValue.version\n );\n }\n console.error(\n `State loaded from storage couldn't be migrated since no migrate function was provided`\n );\n } else {\n return deserializedStorageValue.state;\n }\n }\n }).then((migratedState) => {\n var _a2;\n stateFromStorage = options.merge(\n migratedState,\n (_a2 = get()) != null ? _a2 : configResult\n );\n set(stateFromStorage, true);\n return setItem();\n }).then(() => {\n postRehydrationCallback == null ? void 0 : postRehydrationCallback(stateFromStorage, void 0);\n hasHydrated = true;\n finishHydrationListeners.forEach((cb) => cb(stateFromStorage));\n }).catch((e) => {\n postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e);\n });\n };\n api.persist = {\n setOptions: (newOptions) => {\n options = {\n ...options,\n ...newOptions\n };\n if (newOptions.getStorage) {\n storage = newOptions.getStorage();\n }\n },\n clearStorage: () => {\n storage == null ? void 0 : storage.removeItem(options.name);\n },\n getOptions: () => options,\n rehydrate: () => hydrate(),\n hasHydrated: () => hasHydrated,\n onHydrate: (cb) => {\n hydrationListeners.add(cb);\n return () => {\n hydrationListeners.delete(cb);\n };\n },\n onFinishHydration: (cb) => {\n finishHydrationListeners.add(cb);\n return () => {\n finishHydrationListeners.delete(cb);\n };\n }\n };\n hydrate();\n return stateFromStorage || configResult;\n};\nconst newImpl = (config, baseOptions) => (set, get, api) => {\n let options = {\n storage: createJSONStorage(() => localStorage),\n partialize: (state) => state,\n version: 0,\n merge: (persistedState, currentState) => ({\n ...currentState,\n ...persistedState\n }),\n ...baseOptions\n };\n let hasHydrated = false;\n const hydrationListeners = /* @__PURE__ */ new Set();\n const finishHydrationListeners = /* @__PURE__ */ new Set();\n let storage = options.storage;\n if (!storage) {\n return config(\n (...args) => {\n console.warn(\n `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.`\n );\n set(...args);\n },\n get,\n api\n );\n }\n const setItem = () => {\n const state = options.partialize({ ...get() });\n return storage.setItem(options.name, {\n state,\n version: options.version\n });\n };\n const savedSetState = api.setState;\n api.setState = (state, replace) => {\n savedSetState(state, replace);\n void setItem();\n };\n const configResult = config(\n (...args) => {\n set(...args);\n void setItem();\n },\n get,\n api\n );\n api.getInitialState = () => configResult;\n let stateFromStorage;\n const hydrate = () => {\n var _a, _b;\n if (!storage) return;\n hasHydrated = false;\n hydrationListeners.forEach((cb) => {\n var _a2;\n return cb((_a2 = get()) != null ? _a2 : configResult);\n });\n const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ? void 0 : _b.call(options, (_a = get()) != null ? _a : configResult)) || void 0;\n return toThenable(storage.getItem.bind(storage))(options.name).then((deserializedStorageValue) => {\n if (deserializedStorageValue) {\n if (typeof deserializedStorageValue.version === \"number\" && deserializedStorageValue.version !== options.version) {\n if (options.migrate) {\n return [\n true,\n options.migrate(\n deserializedStorageValue.state,\n deserializedStorageValue.version\n )\n ];\n }\n console.error(\n `State loaded from storage couldn't be migrated since no migrate function was provided`\n );\n } else {\n return [false, deserializedStorageValue.state];\n }\n }\n return [false, void 0];\n }).then((migrationResult) => {\n var _a2;\n const [migrated, migratedState] = migrationResult;\n stateFromStorage = options.merge(\n migratedState,\n (_a2 = get()) != null ? _a2 : configResult\n );\n set(stateFromStorage, true);\n if (migrated) {\n return setItem();\n }\n }).then(() => {\n postRehydrationCallback == null ? void 0 : postRehydrationCallback(stateFromStorage, void 0);\n stateFromStorage = get();\n hasHydrated = true;\n finishHydrationListeners.forEach((cb) => cb(stateFromStorage));\n }).catch((e) => {\n postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e);\n });\n };\n api.persist = {\n setOptions: (newOptions) => {\n options = {\n ...options,\n ...newOptions\n };\n if (newOptions.storage) {\n storage = newOptions.storage;\n }\n },\n clearStorage: () => {\n storage == null ? void 0 : storage.removeItem(options.name);\n },\n getOptions: () => options,\n rehydrate: () => hydrate(),\n hasHydrated: () => hasHydrated,\n onHydrate: (cb) => {\n hydrationListeners.add(cb);\n return () => {\n hydrationListeners.delete(cb);\n };\n },\n onFinishHydration: (cb) => {\n finishHydrationListeners.add(cb);\n return () => {\n finishHydrationListeners.delete(cb);\n };\n }\n };\n if (!options.skipHydration) {\n hydrate();\n }\n return stateFromStorage || configResult;\n};\nconst persistImpl = (config, baseOptions) => {\n if (\"getStorage\" in baseOptions || \"serialize\" in baseOptions || \"deserialize\" in baseOptions) {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n console.warn(\n \"[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead.\"\n );\n }\n return oldImpl(config, baseOptions);\n }\n return newImpl(config, baseOptions);\n};\nconst persist = persistImpl;\n\nexport { combine, createJSONStorage, devtools, persist, redux, subscribeWithSelector };\n","import type { Dictionary, DictionaryValue, KeyPath } from '@intlayer/core';\nimport { create } from 'zustand';\nimport { persist, createJSONStorage } from 'zustand/middleware';\nimport {\n editDictionaryByKeyPath,\n getDictionaryValueByKeyPath,\n removeDictionaryValueByKeyPath,\n} from '../../utils/dictionary';\n\nexport type DictionaryContent = Record<Dictionary['key'], Dictionary>;\n\ntype EditedContentStore = {\n dictionariesRecord: DictionaryContent;\n editedContent: DictionaryContent;\n setDictionariesRecord: (\n dictionariesRecord: Record<Dictionary['key'], Dictionary>\n ) => void;\n addEditedContent: (\n dictionaryKey: Dictionary['key'],\n newValue: DictionaryValue,\n keyPath?: KeyPath[],\n overwrite?: boolean\n ) => void;\n renameEditedContent: (\n dictionaryKey: Dictionary['key'],\n newKey: KeyPath['key'],\n keyPath?: KeyPath[]\n ) => void;\n removeEditedContent: (\n dictionaryKey: Dictionary['key'],\n keyPath: KeyPath[]\n ) => void;\n restoreEditedContent: (dictionaryKey: Dictionary['key']) => void;\n clearEditedDictionaryContent: (dictionaryKey: Dictionary['key']) => void;\n clearEditedContent: () => void;\n getEditedContentValue: (\n dictionaryKey: Dictionary['key'],\n keyPath: KeyPath[]\n ) => DictionaryValue | undefined;\n};\n\nexport const useEditedContentStore = create(\n persist<EditedContentStore>(\n (set, get) => ({\n dictionariesRecord: {},\n editedContent: {},\n setDictionariesRecord: (dictionariesRecord) =>\n set(() => ({ dictionariesRecord })),\n addEditedContent: (\n dictionaryKey,\n newValue,\n keyPath = [],\n overwrite = true\n ) =>\n set((state) => {\n const dictionaryContent =\n state.editedContent[dictionaryKey]?.content ??\n state.dictionariesRecord[dictionaryKey].content;\n\n let newKeyPath: KeyPath[] = keyPath;\n\n if (!overwrite) {\n // Check if the key already exists, and increment the key if it does\n\n let isKeyExist = false;\n let index = 0;\n const otherKeyPath: KeyPath[] = keyPath.slice(0, -1);\n const lastKeyPath: KeyPath = keyPath[keyPath.length - 1];\n let finalKey = lastKeyPath.key;\n\n while (!isKeyExist) {\n const content = getDictionaryValueByKeyPath(\n dictionaryContent,\n newKeyPath\n );\n\n if (typeof content === 'undefined') {\n isKeyExist = true;\n } else {\n index++;\n finalKey =\n index === 0\n ? lastKeyPath.key\n : `${lastKeyPath.key} (${index})`;\n\n newKeyPath = [\n ...otherKeyPath,\n { ...lastKeyPath, key: finalKey } as KeyPath,\n ];\n }\n }\n }\n\n const editedContent = editDictionaryByKeyPath(\n dictionaryContent,\n newKeyPath,\n newValue\n );\n\n return {\n editedContent: {\n ...state.editedContent,\n [dictionaryKey]: {\n ...state.editedContent[dictionaryKey],\n content: editedContent,\n },\n },\n };\n }),\n renameEditedContent: (dictionaryKey, newKey, keyPath = []) => {\n set((state) => {\n const dictionaryContent =\n state.editedContent[dictionaryKey]?.content ??\n state.dictionariesRecord[dictionaryKey].content;\n\n const lastKeyPath: KeyPath = keyPath[keyPath.length - 1];\n const otherKeyPath: KeyPath[] = keyPath.slice(0, -1);\n const newKeyPath: KeyPath[] = [\n ...otherKeyPath,\n { ...lastKeyPath, key: newKey } as KeyPath,\n ];\n\n // Get the original value\n const contentValue = getDictionaryValueByKeyPath(\n dictionaryContent,\n keyPath\n );\n\n // Add the new field\n const contentWithNewField = editDictionaryByKeyPath(\n dictionaryContent,\n newKeyPath,\n contentValue\n );\n\n // Remove the old field\n const editedContent = removeDictionaryValueByKeyPath(\n contentWithNewField,\n keyPath\n );\n\n return {\n editedContent: {\n ...state.editedContent,\n [dictionaryKey]: {\n ...state.editedContent[dictionaryKey],\n content: editedContent,\n },\n },\n };\n });\n },\n removeEditedContent: (dictionaryKey, keyPath) => {\n set((state) => {\n const initialDictionaryContent =\n state.dictionariesRecord[dictionaryKey].content;\n const editedDictionaryContent =\n state.editedContent[dictionaryKey]?.content ??\n initialDictionaryContent;\n\n const initialContent = getDictionaryValueByKeyPath(\n initialDictionaryContent,\n keyPath\n );\n\n const restoredContent = editDictionaryByKeyPath(\n editedDictionaryContent,\n keyPath,\n initialContent\n );\n\n return {\n editedContent: {\n ...state.editedContent,\n [dictionaryKey]: {\n ...state.editedContent[dictionaryKey],\n content: restoredContent,\n },\n },\n };\n });\n },\n\n restoreEditedContent: (dictionaryKey) => {\n set((state) => {\n const dictionaryContent =\n state.dictionariesRecord[dictionaryKey].content;\n const clonedContent = JSON.parse(JSON.stringify(dictionaryContent));\n\n return {\n editedContent: {\n ...state.editedContent,\n [dictionaryKey]: {\n ...state.editedContent[dictionaryKey],\n content: clonedContent,\n },\n },\n };\n });\n },\n\n clearEditedDictionaryContent: (dictionaryKey) => {\n set((state) => {\n const filteredEditedContent = Object.entries(\n state.editedContent\n ).reduce((acc, [path, content]) => {\n if (path === dictionaryKey) {\n return acc;\n }\n\n return {\n ...acc,\n [path]: content,\n };\n }, {});\n\n return {\n editedContent: filteredEditedContent,\n };\n });\n },\n\n clearEditedContent: () => {\n set({ editedContent: {} });\n },\n\n getEditedContentValue: (dictionaryKey, keyPath) =>\n getDictionaryValueByKeyPath(\n get().editedContent[dictionaryKey],\n keyPath\n ),\n }),\n {\n name: 'edited-content-store',\n storage: createJSONStorage(() => sessionStorage),\n }\n )\n);\n"],"names":["create","getDictionaryValueByKeyPath","editDictionaryByKeyPath","removeDictionaryValueByKeyPath"],"mappings":";;;;;AAuPA,SAAS,kBAAkB,YAAY,SAAS;AAC1C,MAAA;AACA,MAAA;AACF,cAAU,WAAW;AAAA,WACd,IAAI;AACX;AAAA,EACF;AACA,QAAM,iBAAiB;AAAA,IACrB,SAAS,CAAC,SAAS;AACb,UAAA;AACE,YAAA,QAAQ,CAAC,SAAS;AACtB,YAAI,SAAS,MAAM;AACV,iBAAA;AAAA,QACT;AACA,eAAO,KAAK,MAAM,MAAwB,MAAwB;AAAA,MAAA;AAEpE,YAAM,OAAO,KAAK,QAAQ,QAAQ,IAAI,MAAM,OAAO,KAAK;AACxD,UAAI,eAAe,SAAS;AACnB,eAAA,IAAI,KAAK,KAAK;AAAA,MACvB;AACA,aAAO,MAAM,GAAG;AAAA,IAClB;AAAA,IACA,SAAS,CAAC,MAAM,aAAa,QAAQ;AAAA,MACnC;AAAA,MACA,KAAK,UAAU,UAA4B,MAAyB;AAAA,IACtE;AAAA,IACA,YAAY,CAAC,SAAS,QAAQ,WAAW,IAAI;AAAA,EAAA;AAExC,SAAA;AACT;AACA,MAAM,aAAa,CAAC,OAAO,CAAC,UAAU;AAChC,MAAA;AACI,UAAA,SAAS,GAAG,KAAK;AACvB,QAAI,kBAAkB,SAAS;AACtB,aAAA;AAAA,IACT;AACO,WAAA;AAAA,MACL,KAAK,aAAa;AACT,eAAA,WAAW,WAAW,EAAE,MAAM;AAAA,MACvC;AAAA,MACA,MAAM,aAAa;AACV,eAAA;AAAA,MACT;AAAA,IAAA;AAAA,WAEK,GAAG;AACH,WAAA;AAAA,MACL,KAAK,cAAc;AACV,eAAA;AAAA,MACT;AAAA,MACA,MAAM,YAAY;AACT,eAAA,WAAW,UAAU,EAAE,CAAC;AAAA,MACjC;AAAA,IAAA;AAAA,EAEJ;AACF;AACA,MAAM,UAAU,CAAC,QAAQ,gBAAgB,CAAC,KAAK,KAAK,QAA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MAAM,cAAc,aAAa;AAAA,gBACpC,SAAS;AAAA,cACX;AAAA,YACF;AAAA,UAAA;AAAA,QACF,CACD;AAAA,MACH;AAAA,MAEA,sBAAsB,CAAC,kBAAkB;AACvC,YAAI,CAAC,UAAU;AACb,gBAAM,oBACJ,MAAM,mBAAmB,aAAa,EAAE;AAC1C,gBAAM,gBAAgB,KAAK,MAAM,KAAK,UAAU,iBAAiB,CAAC;AAE3D,iBAAA;AAAA,YACL,eAAe;AAAA,cACb,GAAG,MAAM;AAAA,cACT,CAAC,aAAa,GAAG;AAAA,gBACf,GAAG,MAAM,cAAc,aAAa;AAAA,gBACpC,SAAS;AAAA,cACX;AAAA,YACF;AAAA,UAAA;AAAA,QACF,CACD;AAAA,MACH;AAAA,MAEA,8BAA8B,CAAC,kBAAkB;AAC/C,YAAI,CAAC,UAAU;AACb,gBAAM,wBAAwB,OAAO;AAAA,YACnC,MAAM;AAAA,YACN,OAAO,CAAC,KAAK,CAAC,MAAM,OAAO,MAAM;AACjC,gBAAI,SAAS,eAAe;AACnB,qBAAA;AAAA,YACT;AAEO,mBAAA;AAAA,cACL,GAAG;AAAA,cACH,CAAC,IAAI,GAAG;AAAA,YAAA;AAAA,UAEZ,GAAG,CAAE,CAAA;AAEE,iBAAA;AAAA,YACL,eAAe;AAAA,UAAA;AAAA,QACjB,CACD;AAAA,MACH;AAAA,MAEA,oBAAoB,MAAM;AACxB,YAAI,EAAE,eAAe,CAAC,EAAA,CAAG;AAAA,MAC3B;AAAA,MAEA,uBAAuB,CAAC,eAAe,YACrCD,iBAAA;AAAA,QACE,IAAM,EAAA,cAAc,aAAa;AAAA,QACjC;AAAA,MACF;AAAA,IAAA;AAAA,IAEJ;AAAA,MACE,MAAM;AAAA,MACN,SAAS,kBAAkB,MAAM,cAAc;AAAA,IACjD;AAAA,EACF;AACF;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"useEditedContentStore.cjs","sources":["../../../../../../node_modules/.pnpm/zustand@4.5.5_@types+react@18.3.12_react@18.3.1/node_modules/zustand/esm/middleware.mjs","../../../src/components/DictionaryEditor/useEditedContentStore.ts"],"sourcesContent":["const reduxImpl = (reducer, initial) => (set, _get, api) => {\n api.dispatch = (action) => {\n set((state) => reducer(state, action), false, action);\n return action;\n };\n api.dispatchFromDevtools = true;\n return { dispatch: (...a) => api.dispatch(...a), ...initial };\n};\nconst redux = reduxImpl;\n\nconst trackedConnections = /* @__PURE__ */ new Map();\nconst getTrackedConnectionState = (name) => {\n const api = trackedConnections.get(name);\n if (!api) return {};\n return Object.fromEntries(\n Object.entries(api.stores).map(([key, api2]) => [key, api2.getState()])\n );\n};\nconst extractConnectionInformation = (store, extensionConnector, options) => {\n if (store === void 0) {\n return {\n type: \"untracked\",\n connection: extensionConnector.connect(options)\n };\n }\n const existingConnection = trackedConnections.get(options.name);\n if (existingConnection) {\n return { type: \"tracked\", store, ...existingConnection };\n }\n const newConnection = {\n connection: extensionConnector.connect(options),\n stores: {}\n };\n trackedConnections.set(options.name, newConnection);\n return { type: \"tracked\", store, ...newConnection };\n};\nconst devtoolsImpl = (fn, devtoolsOptions = {}) => (set, get, api) => {\n const { enabled, anonymousActionType, store, ...options } = devtoolsOptions;\n let extensionConnector;\n try {\n extensionConnector = (enabled != null ? enabled : (import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") && window.__REDUX_DEVTOOLS_EXTENSION__;\n } catch (_e) {\n }\n if (!extensionConnector) {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\" && enabled) {\n console.warn(\n \"[zustand devtools middleware] Please install/enable Redux devtools extension\"\n );\n }\n return fn(set, get, api);\n }\n const { connection, ...connectionInformation } = extractConnectionInformation(store, extensionConnector, options);\n let isRecording = true;\n api.setState = (state, replace, nameOrAction) => {\n const r = set(state, replace);\n if (!isRecording) return r;\n const action = nameOrAction === void 0 ? { type: anonymousActionType || \"anonymous\" } : typeof nameOrAction === \"string\" ? { type: nameOrAction } : nameOrAction;\n if (store === void 0) {\n connection == null ? void 0 : connection.send(action, get());\n return r;\n }\n connection == null ? void 0 : connection.send(\n {\n ...action,\n type: `${store}/${action.type}`\n },\n {\n ...getTrackedConnectionState(options.name),\n [store]: api.getState()\n }\n );\n return r;\n };\n const setStateFromDevtools = (...a) => {\n const originalIsRecording = isRecording;\n isRecording = false;\n set(...a);\n isRecording = originalIsRecording;\n };\n const initialState = fn(api.setState, get, api);\n if (connectionInformation.type === \"untracked\") {\n connection == null ? void 0 : connection.init(initialState);\n } else {\n connectionInformation.stores[connectionInformation.store] = api;\n connection == null ? void 0 : connection.init(\n Object.fromEntries(\n Object.entries(connectionInformation.stores).map(([key, store2]) => [\n key,\n key === connectionInformation.store ? initialState : store2.getState()\n ])\n )\n );\n }\n if (api.dispatchFromDevtools && typeof api.dispatch === \"function\") {\n let didWarnAboutReservedActionType = false;\n const originalDispatch = api.dispatch;\n api.dispatch = (...a) => {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\" && a[0].type === \"__setState\" && !didWarnAboutReservedActionType) {\n console.warn(\n '[zustand devtools middleware] \"__setState\" action type is reserved to set state from the devtools. Avoid using it.'\n );\n didWarnAboutReservedActionType = true;\n }\n originalDispatch(...a);\n };\n }\n connection.subscribe((message) => {\n var _a;\n switch (message.type) {\n case \"ACTION\":\n if (typeof message.payload !== \"string\") {\n console.error(\n \"[zustand devtools middleware] Unsupported action format\"\n );\n return;\n }\n return parseJsonThen(\n message.payload,\n (action) => {\n if (action.type === \"__setState\") {\n if (store === void 0) {\n setStateFromDevtools(action.state);\n return;\n }\n if (Object.keys(action.state).length !== 1) {\n console.error(\n `\n [zustand devtools middleware] Unsupported __setState action format. \n When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),\n and value of this only key should be a state object. Example: { \"type\": \"__setState\", \"state\": { \"abc123Store\": { \"foo\": \"bar\" } } }\n `\n );\n }\n const stateFromDevtools = action.state[store];\n if (stateFromDevtools === void 0 || stateFromDevtools === null) {\n return;\n }\n if (JSON.stringify(api.getState()) !== JSON.stringify(stateFromDevtools)) {\n setStateFromDevtools(stateFromDevtools);\n }\n return;\n }\n if (!api.dispatchFromDevtools) return;\n if (typeof api.dispatch !== \"function\") return;\n api.dispatch(action);\n }\n );\n case \"DISPATCH\":\n switch (message.payload.type) {\n case \"RESET\":\n setStateFromDevtools(initialState);\n if (store === void 0) {\n return connection == null ? void 0 : connection.init(api.getState());\n }\n return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n case \"COMMIT\":\n if (store === void 0) {\n connection == null ? void 0 : connection.init(api.getState());\n return;\n }\n return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n case \"ROLLBACK\":\n return parseJsonThen(message.state, (state) => {\n if (store === void 0) {\n setStateFromDevtools(state);\n connection == null ? void 0 : connection.init(api.getState());\n return;\n }\n setStateFromDevtools(state[store]);\n connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n });\n case \"JUMP_TO_STATE\":\n case \"JUMP_TO_ACTION\":\n return parseJsonThen(message.state, (state) => {\n if (store === void 0) {\n setStateFromDevtools(state);\n return;\n }\n if (JSON.stringify(api.getState()) !== JSON.stringify(state[store])) {\n setStateFromDevtools(state[store]);\n }\n });\n case \"IMPORT_STATE\": {\n const { nextLiftedState } = message.payload;\n const lastComputedState = (_a = nextLiftedState.computedStates.slice(-1)[0]) == null ? void 0 : _a.state;\n if (!lastComputedState) return;\n if (store === void 0) {\n setStateFromDevtools(lastComputedState);\n } else {\n setStateFromDevtools(lastComputedState[store]);\n }\n connection == null ? void 0 : connection.send(\n null,\n // FIXME no-any\n nextLiftedState\n );\n return;\n }\n case \"PAUSE_RECORDING\":\n return isRecording = !isRecording;\n }\n return;\n }\n });\n return initialState;\n};\nconst devtools = devtoolsImpl;\nconst parseJsonThen = (stringified, f) => {\n let parsed;\n try {\n parsed = JSON.parse(stringified);\n } catch (e) {\n console.error(\n \"[zustand devtools middleware] Could not parse the received json\",\n e\n );\n }\n if (parsed !== void 0) f(parsed);\n};\n\nconst subscribeWithSelectorImpl = (fn) => (set, get, api) => {\n const origSubscribe = api.subscribe;\n api.subscribe = (selector, optListener, options) => {\n let listener = selector;\n if (optListener) {\n const equalityFn = (options == null ? void 0 : options.equalityFn) || Object.is;\n let currentSlice = selector(api.getState());\n listener = (state) => {\n const nextSlice = selector(state);\n if (!equalityFn(currentSlice, nextSlice)) {\n const previousSlice = currentSlice;\n optListener(currentSlice = nextSlice, previousSlice);\n }\n };\n if (options == null ? void 0 : options.fireImmediately) {\n optListener(currentSlice, currentSlice);\n }\n }\n return origSubscribe(listener);\n };\n const initialState = fn(set, get, api);\n return initialState;\n};\nconst subscribeWithSelector = subscribeWithSelectorImpl;\n\nconst combine = (initialState, create) => (...a) => Object.assign({}, initialState, create(...a));\n\nfunction createJSONStorage(getStorage, options) {\n let storage;\n try {\n storage = getStorage();\n } catch (_e) {\n return;\n }\n const persistStorage = {\n getItem: (name) => {\n var _a;\n const parse = (str2) => {\n if (str2 === null) {\n return null;\n }\n return JSON.parse(str2, options == null ? void 0 : options.reviver);\n };\n const str = (_a = storage.getItem(name)) != null ? _a : null;\n if (str instanceof Promise) {\n return str.then(parse);\n }\n return parse(str);\n },\n setItem: (name, newValue) => storage.setItem(\n name,\n JSON.stringify(newValue, options == null ? void 0 : options.replacer)\n ),\n removeItem: (name) => storage.removeItem(name)\n };\n return persistStorage;\n}\nconst toThenable = (fn) => (input) => {\n try {\n const result = fn(input);\n if (result instanceof Promise) {\n return result;\n }\n return {\n then(onFulfilled) {\n return toThenable(onFulfilled)(result);\n },\n catch(_onRejected) {\n return this;\n }\n };\n } catch (e) {\n return {\n then(_onFulfilled) {\n return this;\n },\n catch(onRejected) {\n return toThenable(onRejected)(e);\n }\n };\n }\n};\nconst oldImpl = (config, baseOptions) => (set, get, api) => {\n let options = {\n getStorage: () => localStorage,\n serialize: JSON.stringify,\n deserialize: JSON.parse,\n partialize: (state) => state,\n version: 0,\n merge: (persistedState, currentState) => ({\n ...currentState,\n ...persistedState\n }),\n ...baseOptions\n };\n let hasHydrated = false;\n const hydrationListeners = /* @__PURE__ */ new Set();\n const finishHydrationListeners = /* @__PURE__ */ new Set();\n let storage;\n try {\n storage = options.getStorage();\n } catch (_e) {\n }\n if (!storage) {\n return config(\n (...args) => {\n console.warn(\n `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.`\n );\n set(...args);\n },\n get,\n api\n );\n }\n const thenableSerialize = toThenable(options.serialize);\n const setItem = () => {\n const state = options.partialize({ ...get() });\n let errorInSync;\n const thenable = thenableSerialize({ state, version: options.version }).then(\n (serializedValue) => storage.setItem(options.name, serializedValue)\n ).catch((e) => {\n errorInSync = e;\n });\n if (errorInSync) {\n throw errorInSync;\n }\n return thenable;\n };\n const savedSetState = api.setState;\n api.setState = (state, replace) => {\n savedSetState(state, replace);\n void setItem();\n };\n const configResult = config(\n (...args) => {\n set(...args);\n void setItem();\n },\n get,\n api\n );\n let stateFromStorage;\n const hydrate = () => {\n var _a;\n if (!storage) return;\n hasHydrated = false;\n hydrationListeners.forEach((cb) => cb(get()));\n const postRehydrationCallback = ((_a = options.onRehydrateStorage) == null ? void 0 : _a.call(options, get())) || void 0;\n return toThenable(storage.getItem.bind(storage))(options.name).then((storageValue) => {\n if (storageValue) {\n return options.deserialize(storageValue);\n }\n }).then((deserializedStorageValue) => {\n if (deserializedStorageValue) {\n if (typeof deserializedStorageValue.version === \"number\" && deserializedStorageValue.version !== options.version) {\n if (options.migrate) {\n return options.migrate(\n deserializedStorageValue.state,\n deserializedStorageValue.version\n );\n }\n console.error(\n `State loaded from storage couldn't be migrated since no migrate function was provided`\n );\n } else {\n return deserializedStorageValue.state;\n }\n }\n }).then((migratedState) => {\n var _a2;\n stateFromStorage = options.merge(\n migratedState,\n (_a2 = get()) != null ? _a2 : configResult\n );\n set(stateFromStorage, true);\n return setItem();\n }).then(() => {\n postRehydrationCallback == null ? void 0 : postRehydrationCallback(stateFromStorage, void 0);\n hasHydrated = true;\n finishHydrationListeners.forEach((cb) => cb(stateFromStorage));\n }).catch((e) => {\n postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e);\n });\n };\n api.persist = {\n setOptions: (newOptions) => {\n options = {\n ...options,\n ...newOptions\n };\n if (newOptions.getStorage) {\n storage = newOptions.getStorage();\n }\n },\n clearStorage: () => {\n storage == null ? void 0 : storage.removeItem(options.name);\n },\n getOptions: () => options,\n rehydrate: () => hydrate(),\n hasHydrated: () => hasHydrated,\n onHydrate: (cb) => {\n hydrationListeners.add(cb);\n return () => {\n hydrationListeners.delete(cb);\n };\n },\n onFinishHydration: (cb) => {\n finishHydrationListeners.add(cb);\n return () => {\n finishHydrationListeners.delete(cb);\n };\n }\n };\n hydrate();\n return stateFromStorage || configResult;\n};\nconst newImpl = (config, baseOptions) => (set, get, api) => {\n let options = {\n storage: createJSONStorage(() => localStorage),\n partialize: (state) => state,\n version: 0,\n merge: (persistedState, currentState) => ({\n ...currentState,\n ...persistedState\n }),\n ...baseOptions\n };\n let hasHydrated = false;\n const hydrationListeners = /* @__PURE__ */ new Set();\n const finishHydrationListeners = /* @__PURE__ */ new Set();\n let storage = options.storage;\n if (!storage) {\n return config(\n (...args) => {\n console.warn(\n `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.`\n );\n set(...args);\n },\n get,\n api\n );\n }\n const setItem = () => {\n const state = options.partialize({ ...get() });\n return storage.setItem(options.name, {\n state,\n version: options.version\n });\n };\n const savedSetState = api.setState;\n api.setState = (state, replace) => {\n savedSetState(state, replace);\n void setItem();\n };\n const configResult = config(\n (...args) => {\n set(...args);\n void setItem();\n },\n get,\n api\n );\n api.getInitialState = () => configResult;\n let stateFromStorage;\n const hydrate = () => {\n var _a, _b;\n if (!storage) return;\n hasHydrated = false;\n hydrationListeners.forEach((cb) => {\n var _a2;\n return cb((_a2 = get()) != null ? _a2 : configResult);\n });\n const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ? void 0 : _b.call(options, (_a = get()) != null ? _a : configResult)) || void 0;\n return toThenable(storage.getItem.bind(storage))(options.name).then((deserializedStorageValue) => {\n if (deserializedStorageValue) {\n if (typeof deserializedStorageValue.version === \"number\" && deserializedStorageValue.version !== options.version) {\n if (options.migrate) {\n return [\n true,\n options.migrate(\n deserializedStorageValue.state,\n deserializedStorageValue.version\n )\n ];\n }\n console.error(\n `State loaded from storage couldn't be migrated since no migrate function was provided`\n );\n } else {\n return [false, deserializedStorageValue.state];\n }\n }\n return [false, void 0];\n }).then((migrationResult) => {\n var _a2;\n const [migrated, migratedState] = migrationResult;\n stateFromStorage = options.merge(\n migratedState,\n (_a2 = get()) != null ? _a2 : configResult\n );\n set(stateFromStorage, true);\n if (migrated) {\n return setItem();\n }\n }).then(() => {\n postRehydrationCallback == null ? void 0 : postRehydrationCallback(stateFromStorage, void 0);\n stateFromStorage = get();\n hasHydrated = true;\n finishHydrationListeners.forEach((cb) => cb(stateFromStorage));\n }).catch((e) => {\n postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e);\n });\n };\n api.persist = {\n setOptions: (newOptions) => {\n options = {\n ...options,\n ...newOptions\n };\n if (newOptions.storage) {\n storage = newOptions.storage;\n }\n },\n clearStorage: () => {\n storage == null ? void 0 : storage.removeItem(options.name);\n },\n getOptions: () => options,\n rehydrate: () => hydrate(),\n hasHydrated: () => hasHydrated,\n onHydrate: (cb) => {\n hydrationListeners.add(cb);\n return () => {\n hydrationListeners.delete(cb);\n };\n },\n onFinishHydration: (cb) => {\n finishHydrationListeners.add(cb);\n return () => {\n finishHydrationListeners.delete(cb);\n };\n }\n };\n if (!options.skipHydration) {\n hydrate();\n }\n return stateFromStorage || configResult;\n};\nconst persistImpl = (config, baseOptions) => {\n if (\"getStorage\" in baseOptions || \"serialize\" in baseOptions || \"deserialize\" in baseOptions) {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n console.warn(\n \"[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead.\"\n );\n }\n return oldImpl(config, baseOptions);\n }\n return newImpl(config, baseOptions);\n};\nconst persist = persistImpl;\n\nexport { combine, createJSONStorage, devtools, persist, redux, subscribeWithSelector };\n","import type { Dictionary, DictionaryValue, KeyPath } from '@intlayer/core';\nimport { create } from 'zustand';\nimport { persist, createJSONStorage } from 'zustand/middleware';\nimport {\n editDictionaryByKeyPath,\n getDictionaryValueByKeyPath,\n renameDictionaryValueByKeyPath,\n} from '../../utils/dictionary';\n\nexport type DictionaryContent = Record<Dictionary['key'], Dictionary>;\n\ntype EditedContentStore = {\n dictionariesRecord: DictionaryContent;\n editedContent: DictionaryContent;\n setDictionariesRecord: (\n dictionariesRecord: Record<Dictionary['key'], Dictionary>\n ) => void;\n addEditedContent: (\n dictionaryKey: Dictionary['key'],\n newValue: DictionaryValue,\n keyPath?: KeyPath[],\n overwrite?: boolean\n ) => void;\n renameEditedContent: (\n dictionaryKey: Dictionary['key'],\n newKey: KeyPath['key'],\n keyPath?: KeyPath[]\n ) => void;\n removeEditedContent: (\n dictionaryKey: Dictionary['key'],\n keyPath: KeyPath[]\n ) => void;\n restoreEditedContent: (dictionaryKey: Dictionary['key']) => void;\n clearEditedDictionaryContent: (dictionaryKey: Dictionary['key']) => void;\n clearEditedContent: () => void;\n getEditedContentValue: (\n dictionaryKey: Dictionary['key'],\n keyPath: KeyPath[]\n ) => DictionaryValue | undefined;\n};\n\nexport const useEditedContentStore = create(\n persist<EditedContentStore>(\n (set, get) => ({\n dictionariesRecord: {},\n editedContent: {},\n setDictionariesRecord: (dictionariesRecord) =>\n set((state) => ({\n dictionariesRecord: {\n ...state.dictionariesRecord,\n ...dictionariesRecord,\n },\n })),\n addEditedContent: (\n dictionaryKey,\n newValue,\n keyPath = [],\n overwrite = true\n ) =>\n set((state) => {\n const dictionaryContent =\n state.editedContent[dictionaryKey]?.content ??\n JSON.parse(\n JSON.stringify(state.dictionariesRecord[dictionaryKey].content)\n );\n\n let newKeyPath: KeyPath[] = keyPath;\n\n if (!overwrite) {\n // Check if the key already exists, and increment the key if it does\n\n let isKeyExist = false;\n let index = 0;\n const otherKeyPath: KeyPath[] = keyPath.slice(0, -1);\n const lastKeyPath: KeyPath = keyPath[keyPath.length - 1];\n let finalKey = lastKeyPath.key;\n\n while (!isKeyExist) {\n const content = getDictionaryValueByKeyPath(\n dictionaryContent,\n newKeyPath\n );\n\n if (typeof content === 'undefined') {\n isKeyExist = true;\n } else {\n index++;\n finalKey =\n index === 0\n ? lastKeyPath.key\n : `${lastKeyPath.key} (${index})`;\n\n newKeyPath = [\n ...otherKeyPath,\n { ...lastKeyPath, key: finalKey } as KeyPath,\n ];\n }\n }\n }\n\n const editedContent = editDictionaryByKeyPath(\n dictionaryContent,\n newKeyPath,\n newValue\n );\n\n return {\n editedContent: {\n ...state.editedContent,\n [dictionaryKey]: {\n ...state.editedContent[dictionaryKey],\n content: editedContent,\n },\n },\n };\n }),\n renameEditedContent: (dictionaryKey, newKey, keyPath = []) => {\n set((state) => {\n const initialDictionaryContent = JSON.parse(\n JSON.stringify(state.dictionariesRecord[dictionaryKey].content)\n );\n\n const dictionaryContent =\n state.editedContent[dictionaryKey]?.content ??\n initialDictionaryContent;\n\n // Add the new field\n const contentWithNewField = renameDictionaryValueByKeyPath(\n dictionaryContent,\n newKey,\n keyPath\n );\n\n return {\n editedContent: {\n ...state.editedContent,\n [dictionaryKey]: {\n ...state.editedContent[dictionaryKey],\n content: contentWithNewField,\n },\n },\n };\n });\n },\n removeEditedContent: (dictionaryKey, keyPath) => {\n set((state) => {\n const initialDictionaryContent = JSON.parse(\n JSON.stringify(state.dictionariesRecord[dictionaryKey].content)\n );\n\n const editedDictionaryContent =\n state.editedContent[dictionaryKey]?.content ??\n initialDictionaryContent;\n\n const initialContent = getDictionaryValueByKeyPath(\n initialDictionaryContent,\n keyPath\n );\n\n const restoredContent = editDictionaryByKeyPath(\n editedDictionaryContent,\n keyPath,\n initialContent\n );\n\n return {\n editedContent: {\n ...state.editedContent,\n [dictionaryKey]: {\n ...state.editedContent[dictionaryKey],\n content: restoredContent,\n },\n },\n };\n });\n },\n\n restoreEditedContent: (dictionaryKey) => {\n set((state) => {\n const dictionaryContent =\n state.dictionariesRecord[dictionaryKey].content;\n const clonedContent = JSON.parse(JSON.stringify(dictionaryContent));\n\n return {\n editedContent: {\n ...state.editedContent,\n [dictionaryKey]: {\n ...state.editedContent[dictionaryKey],\n content: clonedContent,\n },\n },\n };\n });\n },\n\n clearEditedDictionaryContent: (dictionaryKey) => {\n set((state) => {\n const filteredEditedContent = Object.entries(\n state.editedContent\n ).reduce((acc, [path, content]) => {\n if (path === dictionaryKey) {\n return acc;\n }\n\n return {\n ...acc,\n [path]: content,\n };\n }, {});\n\n return {\n editedContent: filteredEditedContent,\n };\n });\n },\n\n clearEditedContent: () => {\n set({ editedContent: {} });\n },\n\n getEditedContentValue: (dictionaryKey, keyPath) =>\n getDictionaryValueByKeyPath(\n get().editedContent[dictionaryKey],\n keyPath\n ),\n }),\n {\n name: 'edited-content-store',\n storage: createJSONStorage(() => sessionStorage),\n }\n )\n);\n"],"names":["create","getDictionaryValueByKeyPath","editDictionaryByKeyPath","renameDictionaryValueByKeyPath"],"mappings":";;;;;AAuPA,SAAS,kBAAkB,YAAY,SAAS;AAC1C,MAAA;AACA,MAAA;AACF,cAAU,WAAW;AAAA,WACd,IAAI;AACX;AAAA,EACF;AACA,QAAM,iBAAiB;AAAA,IACrB,SAAS,CAAC,SAAS;AACb,UAAA;AACE,YAAA,QAAQ,CAAC,SAAS;AACtB,YAAI,SAAS,MAAM;AACV,iBAAA;AAAA,QACT;AACA,eAAO,KAAK,MAAM,MAAwB,MAAwB;AAAA,MAAA;AAEpE,YAAM,OAAO,KAAK,QAAQ,QAAQ,IAAI,MAAM,OAAO,KAAK;AACxD,UAAI,eAAe,SAAS;AACnB,eAAA,IAAI,KAAK,KAAK;AAAA,MACvB;AACA,aAAO,MAAM,GAAG;AAAA,IAClB;AAAA,IACA,SAAS,CAAC,MAAM,aAAa,QAAQ;AAAA,MACnC;AAAA,MACA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cACL,GAAG;AAAA,cACH,CAAC,IAAI,GAAG;AAAA,YAAA;AAAA,UAEZ,GAAG,CAAE,CAAA;AAEE,iBAAA;AAAA,YACL,eAAe;AAAA,UAAA;AAAA,QACjB,CACD;AAAA,MACH;AAAA,MAEA,oBAAoB,MAAM;AACxB,YAAI,EAAE,eAAe,CAAC,EAAA,CAAG;AAAA,MAC3B;AAAA,MAEA,uBAAuB,CAAC,eAAe,YACrCD,iBAAA;AAAA,QACE,IAAM,EAAA,cAAc,aAAa;AAAA,QACjC;AAAA,MACF;AAAA,IAAA;AAAA,IAEJ;AAAA,MACE,MAAM;AAAA,MACN,SAAS,kBAAkB,MAAM,cAAc;AAAA,IACjD;AAAA,EACF;AACF;;","x_google_ignoreList":[0]}
@@ -1,5 +1,4 @@
1
1
  import { Dictionary, DictionaryValue, KeyPath } from '@intlayer/core';
2
-
3
2
  export type DictionaryContent = Record<Dictionary['key'], Dictionary>;
4
3
  type EditedContentStore = {
5
4
  dictionariesRecord: DictionaryContent;
@@ -1 +1 @@
1
- {"version":3,"file":"useEditedContentStore.d.ts","sourceRoot":"","sources":["../../../src/components/DictionaryEditor/useEditedContentStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAS3E,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,CAAC;AAEtE,KAAK,kBAAkB,GAAG;IACxB,kBAAkB,EAAE,iBAAiB,CAAC;IACtC,aAAa,EAAE,iBAAiB,CAAC;IACjC,qBAAqB,EAAE,CACrB,kBAAkB,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,KACtD,IAAI,CAAC;IACV,gBAAgB,EAAE,CAChB,aAAa,EAAE,UAAU,CAAC,KAAK,CAAC,EAChC,QAAQ,EAAE,eAAe,EACzB,OAAO,CAAC,EAAE,OAAO,EAAE,EACnB,SAAS,CAAC,EAAE,OAAO,KAChB,IAAI,CAAC;IACV,mBAAmB,EAAE,CACnB,aAAa,EAAE,UAAU,CAAC,KAAK,CAAC,EAChC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,EACtB,OAAO,CAAC,EAAE,OAAO,EAAE,KAChB,IAAI,CAAC;IACV,mBAAmB,EAAE,CACnB,aAAa,EAAE,UAAU,CAAC,KAAK,CAAC,EAChC,OAAO,EAAE,OAAO,EAAE,KACf,IAAI,CAAC;IACV,oBAAoB,EAAE,CAAC,aAAa,EAAE,UAAU,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;IACjE,4BAA4B,EAAE,CAAC,aAAa,EAAE,UAAU,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;IACzE,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,qBAAqB,EAAE,CACrB,aAAa,EAAE,UAAU,CAAC,KAAK,CAAC,EAChC,OAAO,EAAE,OAAO,EAAE,KACf,eAAe,GAAG,SAAS,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;EAoMjC,CAAC"}
1
+ {"version":3,"file":"useEditedContentStore.d.ts","sourceRoot":"","sources":["../../../src/components/DictionaryEditor/useEditedContentStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAS3E,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,CAAC;AAEtE,KAAK,kBAAkB,GAAG;IACxB,kBAAkB,EAAE,iBAAiB,CAAC;IACtC,aAAa,EAAE,iBAAiB,CAAC;IACjC,qBAAqB,EAAE,CACrB,kBAAkB,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,KACtD,IAAI,CAAC;IACV,gBAAgB,EAAE,CAChB,aAAa,EAAE,UAAU,CAAC,KAAK,CAAC,EAChC,QAAQ,EAAE,eAAe,EACzB,OAAO,CAAC,EAAE,OAAO,EAAE,EACnB,SAAS,CAAC,EAAE,OAAO,KAChB,IAAI,CAAC;IACV,mBAAmB,EAAE,CACnB,aAAa,EAAE,UAAU,CAAC,KAAK,CAAC,EAChC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,EACtB,OAAO,CAAC,EAAE,OAAO,EAAE,KAChB,IAAI,CAAC;IACV,mBAAmB,EAAE,CACnB,aAAa,EAAE,UAAU,CAAC,KAAK,CAAC,EAChC,OAAO,EAAE,OAAO,EAAE,KACf,IAAI,CAAC;IACV,oBAAoB,EAAE,CAAC,aAAa,EAAE,UAAU,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;IACjE,4BAA4B,EAAE,CAAC,aAAa,EAAE,UAAU,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;IACzE,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,qBAAqB,EAAE,CACrB,aAAa,EAAE,UAAU,CAAC,KAAK,CAAC,EAChC,OAAO,EAAE,OAAO,EAAE,KACf,eAAe,GAAG,SAAS,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;EA8LjC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { create } from "zustand";
2
- import { getDictionaryValueByKeyPath, editDictionaryByKeyPath, removeDictionaryValueByKeyPath } from "../../utils/dictionary.mjs";
2
+ import { getDictionaryValueByKeyPath, editDictionaryByKeyPath, renameDictionaryValueByKeyPath } from "../../utils/dictionary.mjs";
3
3
  const __vite_import_meta_env__ = { "BASE_URL": "/", "DEV": false, "MODE": "production", "PROD": true, "SSR": false };
4
4
  function createJSONStorage(getStorage, options) {
5
5
  let storage;
@@ -340,9 +340,16 @@ const useEditedContentStore = create(
340
340
  (set, get) => ({
341
341
  dictionariesRecord: {},
342
342
  editedContent: {},
343
- setDictionariesRecord: (dictionariesRecord) => set(() => ({ dictionariesRecord })),
343
+ setDictionariesRecord: (dictionariesRecord) => set((state) => ({
344
+ dictionariesRecord: {
345
+ ...state.dictionariesRecord,
346
+ ...dictionariesRecord
347
+ }
348
+ })),
344
349
  addEditedContent: (dictionaryKey, newValue, keyPath = [], overwrite = true) => set((state) => {
345
- const dictionaryContent = state.editedContent[dictionaryKey]?.content ?? state.dictionariesRecord[dictionaryKey].content;
350
+ const dictionaryContent = state.editedContent[dictionaryKey]?.content ?? JSON.parse(
351
+ JSON.stringify(state.dictionariesRecord[dictionaryKey].content)
352
+ );
346
353
  let newKeyPath = keyPath;
347
354
  if (!overwrite) {
348
355
  let isKeyExist = false;
@@ -384,24 +391,13 @@ const useEditedContentStore = create(
384
391
  }),
385
392
  renameEditedContent: (dictionaryKey, newKey, keyPath = []) => {
386
393
  set((state) => {
387
- const dictionaryContent = state.editedContent[dictionaryKey]?.content ?? state.dictionariesRecord[dictionaryKey].content;
388
- const lastKeyPath = keyPath[keyPath.length - 1];
389
- const otherKeyPath = keyPath.slice(0, -1);
390
- const newKeyPath = [
391
- ...otherKeyPath,
392
- { ...lastKeyPath, key: newKey }
393
- ];
394
- const contentValue = getDictionaryValueByKeyPath(
395
- dictionaryContent,
396
- keyPath
394
+ const initialDictionaryContent = JSON.parse(
395
+ JSON.stringify(state.dictionariesRecord[dictionaryKey].content)
397
396
  );
398
- const contentWithNewField = editDictionaryByKeyPath(
397
+ const dictionaryContent = state.editedContent[dictionaryKey]?.content ?? initialDictionaryContent;
398
+ const contentWithNewField = renameDictionaryValueByKeyPath(
399
399
  dictionaryContent,
400
- newKeyPath,
401
- contentValue
402
- );
403
- const editedContent = removeDictionaryValueByKeyPath(
404
- contentWithNewField,
400
+ newKey,
405
401
  keyPath
406
402
  );
407
403
  return {
@@ -409,7 +405,7 @@ const useEditedContentStore = create(
409
405
  ...state.editedContent,
410
406
  [dictionaryKey]: {
411
407
  ...state.editedContent[dictionaryKey],
412
- content: editedContent
408
+ content: contentWithNewField
413
409
  }
414
410
  }
415
411
  };
@@ -417,7 +413,9 @@ const useEditedContentStore = create(
417
413
  },
418
414
  removeEditedContent: (dictionaryKey, keyPath) => {
419
415
  set((state) => {
420
- const initialDictionaryContent = state.dictionariesRecord[dictionaryKey].content;
416
+ const initialDictionaryContent = JSON.parse(
417
+ JSON.stringify(state.dictionariesRecord[dictionaryKey].content)
418
+ );
421
419
  const editedDictionaryContent = state.editedContent[dictionaryKey]?.content ?? initialDictionaryContent;
422
420
  const initialContent = getDictionaryValueByKeyPath(
423
421
  initialDictionaryContent,