@intlayer/design-system 4.0.2 → 4.0.4

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 (240) hide show
  1. package/README.md +1 -1
  2. package/dist/.vite/manifest.json +58 -197
  3. package/dist/components/Accordion/Accordion.cjs +1 -1
  4. package/dist/components/Accordion/Accordion.cjs.map +1 -1
  5. package/dist/components/Accordion/Accordion.mjs +1 -1
  6. package/dist/components/Accordion/Accordion.mjs.map +1 -1
  7. package/dist/components/Auth/AuthModal/index.cjs +1 -1
  8. package/dist/components/Auth/AuthModal/index.mjs +1 -1
  9. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs +2 -1
  10. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs.map +1 -1
  11. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs +2 -1
  12. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs.map +1 -1
  13. package/dist/components/Auth/useAuth/index.cjs +8 -4
  14. package/dist/components/Auth/useAuth/index.cjs.map +1 -1
  15. package/dist/components/Auth/useAuth/index.d.ts +3 -1
  16. package/dist/components/Auth/useAuth/index.d.ts.map +1 -1
  17. package/dist/components/Auth/useAuth/index.mjs +8 -4
  18. package/dist/components/Auth/useAuth/index.mjs.map +1 -1
  19. package/dist/components/Auth/useAuth/useCSRF.cjs +6 -3
  20. package/dist/components/Auth/useAuth/useCSRF.cjs.map +1 -1
  21. package/dist/components/Auth/useAuth/useCSRF.d.ts +2 -1
  22. package/dist/components/Auth/useAuth/useCSRF.d.ts.map +1 -1
  23. package/dist/components/Auth/useAuth/useCSRF.mjs +5 -2
  24. package/dist/components/Auth/useAuth/useCSRF.mjs.map +1 -1
  25. package/dist/components/Auth/useAuth/useOAuth2.cjs +6 -5
  26. package/dist/components/Auth/useAuth/useOAuth2.cjs.map +1 -1
  27. package/dist/components/Auth/useAuth/useOAuth2.d.ts +2 -1
  28. package/dist/components/Auth/useAuth/useOAuth2.d.ts.map +1 -1
  29. package/dist/components/Auth/useAuth/useOAuth2.mjs +5 -4
  30. package/dist/components/Auth/useAuth/useOAuth2.mjs.map +1 -1
  31. package/dist/components/Auth/useAuth/useSession.cjs +6 -3
  32. package/dist/components/Auth/useAuth/useSession.cjs.map +1 -1
  33. package/dist/components/Auth/useAuth/useSession.d.ts +2 -1
  34. package/dist/components/Auth/useAuth/useSession.d.ts.map +1 -1
  35. package/dist/components/Auth/useAuth/useSession.mjs +6 -3
  36. package/dist/components/Auth/useAuth/useSession.mjs.map +1 -1
  37. package/dist/components/Auth/useUser/index.cjs +1 -1
  38. package/dist/components/Auth/useUser/index.mjs +1 -1
  39. package/dist/components/Container/index.d.ts +2 -2
  40. package/dist/components/DictionaryEditor/DictionaryEditor.cjs +4 -16
  41. package/dist/components/DictionaryEditor/DictionaryEditor.cjs.map +1 -1
  42. package/dist/components/DictionaryEditor/DictionaryEditor.d.ts.map +1 -1
  43. package/dist/components/DictionaryEditor/DictionaryEditor.mjs +4 -16
  44. package/dist/components/DictionaryEditor/DictionaryEditor.mjs.map +1 -1
  45. package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.cjs +2 -1
  46. package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.cjs.map +1 -1
  47. package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.d.ts.map +1 -1
  48. package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.mjs +2 -1
  49. package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.mjs.map +1 -1
  50. package/dist/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.cjs +1 -1
  51. package/dist/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.mjs +1 -1
  52. package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.cjs +2 -1
  53. package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.cjs.map +1 -1
  54. package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.d.ts.map +1 -1
  55. package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.mjs +2 -1
  56. package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.mjs.map +1 -1
  57. package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.cjs +3 -3
  58. package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.cjs.map +1 -1
  59. package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.d.ts.map +1 -1
  60. package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs +2 -2
  61. package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs.map +1 -1
  62. package/dist/components/DictionaryEditor/NodeWrapper/TranslationWrapper.cjs +1 -1
  63. package/dist/components/DictionaryEditor/NodeWrapper/TranslationWrapper.mjs +1 -1
  64. package/dist/components/DictionaryEditor/NodeWrapper/index.cjs +1 -1
  65. package/dist/components/DictionaryEditor/NodeWrapper/index.mjs +1 -1
  66. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs +2 -9
  67. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs.map +1 -1
  68. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.d.ts.map +1 -1
  69. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs +2 -9
  70. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs.map +1 -1
  71. package/dist/components/DictionaryEditor/index.cjs +0 -8
  72. package/dist/components/DictionaryEditor/index.cjs.map +1 -1
  73. package/dist/components/DictionaryEditor/index.d.ts +0 -2
  74. package/dist/components/DictionaryEditor/index.d.ts.map +1 -1
  75. package/dist/components/DictionaryEditor/index.mjs +1 -9
  76. package/dist/components/DictionaryEditor/index.mjs.map +1 -1
  77. package/dist/components/DictionaryEditor/useEditedContentStore.d.ts +1 -1
  78. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs +3 -21
  79. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs.map +1 -1
  80. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.d.ts.map +1 -1
  81. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs +3 -21
  82. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs.map +1 -1
  83. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +4 -2
  84. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs.map +1 -1
  85. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +4 -2
  86. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
  87. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +4 -2
  88. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map +1 -1
  89. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +4 -2
  90. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
  91. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs +5 -31
  92. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
  93. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts.map +1 -1
  94. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +6 -32
  95. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
  96. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs +8 -37
  97. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs.map +1 -1
  98. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.d.ts.map +1 -1
  99. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs +6 -35
  100. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs.map +1 -1
  101. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs +6 -24
  102. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs.map +1 -1
  103. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.d.ts.map +1 -1
  104. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs +5 -23
  105. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs.map +1 -1
  106. package/dist/components/DictionaryFieldEditor/JSONEditor.cjs +2 -29
  107. package/dist/components/DictionaryFieldEditor/JSONEditor.cjs.map +1 -1
  108. package/dist/components/DictionaryFieldEditor/JSONEditor.d.ts.map +1 -1
  109. package/dist/components/DictionaryFieldEditor/JSONEditor.mjs +2 -29
  110. package/dist/components/DictionaryFieldEditor/JSONEditor.mjs.map +1 -1
  111. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs +9 -33
  112. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs.map +1 -1
  113. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.d.ts.map +1 -1
  114. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +4 -28
  115. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
  116. package/dist/components/DictionaryFieldEditor/NodeEditor.cjs +3 -43
  117. package/dist/components/DictionaryFieldEditor/NodeEditor.cjs.map +1 -1
  118. package/dist/components/DictionaryFieldEditor/NodeEditor.d.ts.map +1 -1
  119. package/dist/components/DictionaryFieldEditor/NodeEditor.mjs +3 -43
  120. package/dist/components/DictionaryFieldEditor/NodeEditor.mjs.map +1 -1
  121. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs +4 -27
  122. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs.map +1 -1
  123. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.d.ts.map +1 -1
  124. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs +3 -26
  125. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs.map +1 -1
  126. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +9 -19
  127. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
  128. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts.map +1 -1
  129. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +9 -19
  130. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
  131. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs +2 -2
  132. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs +2 -2
  133. package/dist/components/EditableField/EditableFieldLayout.cjs +7 -3
  134. package/dist/components/EditableField/EditableFieldLayout.cjs.map +1 -1
  135. package/dist/components/EditableField/EditableFieldLayout.d.ts.map +1 -1
  136. package/dist/components/EditableField/EditableFieldLayout.mjs +7 -3
  137. package/dist/components/EditableField/EditableFieldLayout.mjs.map +1 -1
  138. package/dist/components/IDE/CodeContext.cjs +2 -2
  139. package/dist/components/IDE/CodeContext.mjs +2 -2
  140. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs +2 -2
  141. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +2 -2
  142. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs +2 -2
  143. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs +2 -2
  144. package/dist/components/Modal/Modal.cjs +12 -8
  145. package/dist/components/Modal/Modal.cjs.map +1 -1
  146. package/dist/components/Modal/Modal.d.ts.map +1 -1
  147. package/dist/components/Modal/Modal.mjs +12 -8
  148. package/dist/components/Modal/Modal.mjs.map +1 -1
  149. package/dist/components/Navbar/MobileNavbar.cjs +3 -3
  150. package/dist/components/Navbar/MobileNavbar.mjs +3 -3
  151. package/dist/components/Navbar/index.cjs +2 -2
  152. package/dist/components/Navbar/index.mjs +2 -2
  153. package/dist/components/RightDrawer/RightDrawer.cjs +34 -18
  154. package/dist/components/RightDrawer/RightDrawer.cjs.map +1 -1
  155. package/dist/components/RightDrawer/RightDrawer.d.ts.map +1 -1
  156. package/dist/components/RightDrawer/RightDrawer.mjs +33 -17
  157. package/dist/components/RightDrawer/RightDrawer.mjs.map +1 -1
  158. package/dist/components/SwitchSelector/index.cjs +2 -2
  159. package/dist/components/SwitchSelector/index.mjs +2 -2
  160. package/dist/components/TabSelector/TabSelector.cjs +2 -2
  161. package/dist/components/TabSelector/TabSelector.mjs +2 -2
  162. package/dist/components/index.cjs +0 -8
  163. package/dist/components/index.cjs.map +1 -1
  164. package/dist/components/index.mjs +0 -8
  165. package/dist/components/index.mjs.map +1 -1
  166. package/dist/hooks/index.cjs +1 -1
  167. package/dist/hooks/index.mjs +2 -2
  168. package/dist/hooks/intlayerAPIHooks.cjs +5 -1
  169. package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
  170. package/dist/hooks/intlayerAPIHooks.d.ts +49 -49
  171. package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
  172. package/dist/hooks/intlayerAPIHooks.mjs +5 -1
  173. package/dist/hooks/intlayerAPIHooks.mjs.map +1 -1
  174. package/dist/hooks/useAsync/useAsync.cjs +14 -0
  175. package/dist/hooks/useAsync/useAsync.cjs.map +1 -1
  176. package/dist/hooks/useAsync/useAsync.d.ts.map +1 -1
  177. package/dist/hooks/useAsync/useAsync.mjs +14 -0
  178. package/dist/hooks/useAsync/useAsync.mjs.map +1 -1
  179. package/dist/hooks/useGetAllDictionaries.cjs +3 -2
  180. package/dist/hooks/useGetAllDictionaries.cjs.map +1 -1
  181. package/dist/hooks/useGetAllDictionaries.d.ts +2 -2
  182. package/dist/hooks/useGetAllDictionaries.d.ts.map +1 -1
  183. package/dist/hooks/useGetAllDictionaries.mjs +3 -2
  184. package/dist/hooks/useGetAllDictionaries.mjs.map +1 -1
  185. package/dist/hooks/useIntlayerAPI.cjs +10 -7
  186. package/dist/hooks/useIntlayerAPI.cjs.map +1 -1
  187. package/dist/hooks/useIntlayerAPI.d.ts +8 -2
  188. package/dist/hooks/useIntlayerAPI.d.ts.map +1 -1
  189. package/dist/hooks/useIntlayerAPI.mjs +10 -7
  190. package/dist/hooks/useIntlayerAPI.mjs.map +1 -1
  191. package/dist/hooks/usePersistedStore.cjs +25 -15
  192. package/dist/hooks/usePersistedStore.cjs.map +1 -1
  193. package/dist/hooks/usePersistedStore.d.ts +2 -1
  194. package/dist/hooks/usePersistedStore.d.ts.map +1 -1
  195. package/dist/hooks/usePersistedStore.mjs +26 -16
  196. package/dist/hooks/usePersistedStore.mjs.map +1 -1
  197. package/dist/hooks/useScrollBlockage/index.cjs +5 -31
  198. package/dist/hooks/useScrollBlockage/index.cjs.map +1 -1
  199. package/dist/hooks/useScrollBlockage/index.mjs +5 -31
  200. package/dist/hooks/useScrollBlockage/index.mjs.map +1 -1
  201. package/dist/hooks/useScrollDetection.cjs +1 -1
  202. package/dist/hooks/useScrollDetection.mjs +1 -1
  203. package/dist/index-B-VAyQ9R.js +673 -0
  204. package/dist/index-B-VAyQ9R.js.map +1 -0
  205. package/dist/index-B-adg6xa.js +206 -0
  206. package/dist/index-B-adg6xa.js.map +1 -0
  207. package/dist/index-BIV0x_z2.js +206 -0
  208. package/dist/index-BIV0x_z2.js.map +1 -0
  209. package/dist/index-BNH9wXVj.cjs +205 -0
  210. package/dist/index-BNH9wXVj.cjs.map +1 -0
  211. package/dist/index-Cg-S9ry9.cjs +77 -0
  212. package/dist/index-Cg-S9ry9.cjs.map +1 -0
  213. package/dist/index-D69JRZcQ.js +206 -0
  214. package/dist/index-D69JRZcQ.js.map +1 -0
  215. package/dist/index-DAsui9u9.cjs +205 -0
  216. package/dist/index-DAsui9u9.cjs.map +1 -0
  217. package/dist/index-O_7rYrbW.js +78 -0
  218. package/dist/index-O_7rYrbW.js.map +1 -0
  219. package/dist/index-SOIahRpS.cjs +205 -0
  220. package/dist/index-SOIahRpS.cjs.map +1 -0
  221. package/dist/index-T-TjVQoD.js +671 -0
  222. package/dist/index-T-TjVQoD.js.map +1 -0
  223. package/dist/index-f8_VC6c8.cjs +672 -0
  224. package/dist/index-f8_VC6c8.cjs.map +1 -0
  225. package/dist/index-llGIfxqV.cjs +670 -0
  226. package/dist/index-llGIfxqV.cjs.map +1 -0
  227. package/dist/tailwind.css +1 -1
  228. package/dist/useGetAllDictionaries-B1sqs2IB.cjs +34 -0
  229. package/dist/useGetAllDictionaries-B1sqs2IB.cjs.map +1 -0
  230. package/dist/useGetAllDictionaries-BbH8vTkY.js +35 -0
  231. package/dist/useGetAllDictionaries-BbH8vTkY.js.map +1 -0
  232. package/dist/useGetAllDictionaries-Bgkytpa2.cjs +34 -0
  233. package/dist/useGetAllDictionaries-Bgkytpa2.cjs.map +1 -0
  234. package/dist/useGetAllDictionaries-D8ma3h41.cjs +33 -0
  235. package/dist/useGetAllDictionaries-D8ma3h41.cjs.map +1 -0
  236. package/dist/useGetAllDictionaries-DHgHEbD5.js +34 -0
  237. package/dist/useGetAllDictionaries-DHgHEbD5.js.map +1 -0
  238. package/dist/useGetAllDictionaries-DUzm0rIa.js +35 -0
  239. package/dist/useGetAllDictionaries-DUzm0rIa.js.map +1 -0
  240. package/package.json +24 -16
@@ -1,27 +1,15 @@
1
1
  "use client";
2
2
  import { j as jsxRuntimeExports } from "../../jsx-runtime-DQkoUcjV.js";
3
3
  import { createElement } from "react";
4
- import { u as useShallow } from "../../shallow-m9BpCkKh.js";
5
- import { N as NodeWrapper } from "../../index-BdTa-9zc.js";
6
- import { useEditedContentStore } from "./useEditedContentStore.mjs";
7
- import { useEditionPanelStore } from "./useEditionPanelStore.mjs";
4
+ import { useEditedContent, useFocusDictionary } from "@intlayer/editor-react";
5
+ import { N as NodeWrapper } from "../../index-B-adg6xa.js";
8
6
  import { ValidDictionaryChangeButtons } from "./ValidDictionaryChangeButtons.mjs";
9
7
  const DictionaryEditor = ({
10
8
  dictionary,
11
9
  ...props
12
10
  }) => {
13
- const { addEditedContent, editedContent } = useEditedContentStore(
14
- useShallow((s) => ({
15
- addEditedContent: s.addEditedContent,
16
- editedContent: s.editedContent
17
- }))
18
- );
19
- const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(
20
- useShallow((s) => ({
21
- focusedContent: s.focusedContent,
22
- setFocusedContentKeyPath: s.setFocusedContentKeyPath
23
- }))
24
- );
11
+ const { editedContent, addEditedContent } = useEditedContent();
12
+ const { focusedContent, setFocusedContentKeyPath } = useFocusDictionary();
25
13
  const focusedKeyPath = focusedContent?.keyPath;
26
14
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-full flex-col justify-between gap-2", children: [
27
15
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ createElement(
@@ -1 +1 @@
1
- {"version":3,"file":"DictionaryEditor.mjs","sources":["../../../src/components/DictionaryEditor/DictionaryEditor.tsx"],"sourcesContent":["'use client';\n\nimport type { Locales } from '@intlayer/config/client';\nimport type { Dictionary, KeyPath } from '@intlayer/core';\nimport type { FC } from 'react';\nimport { useShallow } from 'zustand/react/shallow';\nimport { NodeWrapper } from './NodeWrapper';\nimport { useEditedContentStore } from './useEditedContentStore';\nimport { useEditionPanelStore } from './useEditionPanelStore';\nimport { ValidDictionaryChangeButtons } from './ValidDictionaryChangeButtons';\n\ntype DictionaryEditorProps = {\n dictionary: Dictionary;\n locale: Locales;\n onClickEdit?: (keyPath: KeyPath[]) => void;\n};\n\nexport const DictionaryEditor: FC<DictionaryEditorProps> = ({\n dictionary,\n ...props\n}) => {\n const { addEditedContent, editedContent } = useEditedContentStore(\n useShallow((s) => ({\n addEditedContent: s.addEditedContent,\n editedContent: s.editedContent,\n }))\n );\n const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(\n useShallow((s) => ({\n focusedContent: s.focusedContent,\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n }))\n );\n\n const focusedKeyPath = focusedContent?.keyPath;\n\n return (\n <div className=\"flex h-full flex-col justify-between gap-2\">\n <div>\n <NodeWrapper\n {...props}\n keyPath={[]}\n key={JSON.stringify(\n (editedContent[dictionary.key] ?? dictionary).content\n )}\n editedContent={editedContent[dictionary.key]?.content}\n focusedKeyPath={focusedKeyPath}\n section={dictionary.content}\n onContentChange={(content) => {\n addEditedContent(dictionary.key, content.newValue, content.keyPath);\n }}\n onFocusKeyPath={setFocusedContentKeyPath}\n />\n </div>\n <ValidDictionaryChangeButtons dictionary={dictionary} />\n </div>\n );\n};\n"],"names":["jsxs","jsx"],"mappings":";;;;;;;;AAiBO,MAAM,mBAA8C,CAAC;AAAA,EAC1D;AAAA,EACA,GAAG;AACL,MAAM;AACE,QAAA,EAAE,kBAAkB,cAAA,IAAkB;AAAA,IAC1C,WAAW,CAAC,OAAO;AAAA,MACjB,kBAAkB,EAAE;AAAA,MACpB,eAAe,EAAE;AAAA,IAAA,EACjB;AAAA,EACJ;AACM,QAAA,EAAE,gBAAgB,yBAAA,IAA6B;AAAA,IACnD,WAAW,CAAC,OAAO;AAAA,MACjB,gBAAgB,EAAE;AAAA,MAClB,0BAA0B,EAAE;AAAA,IAAA,EAC5B;AAAA,EACJ;AAEA,QAAM,iBAAiB,gBAAgB;AAGrC,SAAAA,kCAAA,KAAC,OAAI,EAAA,WAAU,8CACb,UAAA;AAAA,IAAAC,sCAAC,OACC,EAAA,UAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAG;AAAA,QACJ,SAAS,CAAC;AAAA,QACV,KAAK,KAAK;AAAA,WACP,cAAc,WAAW,GAAG,KAAK,YAAY;AAAA,QAChD;AAAA,QACA,eAAe,cAAc,WAAW,GAAG,GAAG;AAAA,QAC9C;AAAA,QACA,SAAS,WAAW;AAAA,QACpB,iBAAiB,CAAC,YAAY;AAC5B,2BAAiB,WAAW,KAAK,QAAQ,UAAU,QAAQ,OAAO;AAAA,QACpE;AAAA,QACA,gBAAgB;AAAA,MAAA;AAAA,IAAA,GAEpB;AAAA,IACAA,sCAAC,gCAA6B,WAAwB,CAAA;AAAA,EAAA,GACxD;AAEJ;"}
1
+ {"version":3,"file":"DictionaryEditor.mjs","sources":["../../../src/components/DictionaryEditor/DictionaryEditor.tsx"],"sourcesContent":["'use client';\n\nimport type { Locales } from '@intlayer/config/client';\nimport type { Dictionary, KeyPath } from '@intlayer/core';\nimport { useEditedContent, useFocusDictionary } from '@intlayer/editor-react';\nimport type { FC } from 'react';\nimport { NodeWrapper } from './NodeWrapper';\nimport { ValidDictionaryChangeButtons } from './ValidDictionaryChangeButtons';\n\ntype DictionaryEditorProps = {\n dictionary: Dictionary;\n locale: Locales;\n onClickEdit?: (keyPath: KeyPath[]) => void;\n};\n\nexport const DictionaryEditor: FC<DictionaryEditorProps> = ({\n dictionary,\n ...props\n}) => {\n const { editedContent, addEditedContent } = useEditedContent();\n const { focusedContent, setFocusedContentKeyPath } = useFocusDictionary();\n\n const focusedKeyPath = focusedContent?.keyPath;\n\n return (\n <div className=\"flex h-full flex-col justify-between gap-2\">\n <div>\n <NodeWrapper\n {...props}\n keyPath={[]}\n key={JSON.stringify(\n (editedContent[dictionary.key] ?? dictionary).content\n )}\n editedContent={editedContent[dictionary.key]?.content}\n focusedKeyPath={focusedKeyPath}\n section={dictionary.content}\n onContentChange={(content) => {\n addEditedContent(dictionary.key, content.newValue, content.keyPath);\n }}\n onFocusKeyPath={setFocusedContentKeyPath}\n />\n </div>\n <ValidDictionaryChangeButtons dictionary={dictionary} />\n </div>\n );\n};\n"],"names":["jsxs","jsx"],"mappings":";;;;;;AAeO,MAAM,mBAA8C,CAAC;AAAA,EAC1D;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,EAAE,eAAe,iBAAiB,IAAI,iBAAiB;AAC7D,QAAM,EAAE,gBAAgB,yBAAyB,IAAI,mBAAmB;AAExE,QAAM,iBAAiB,gBAAgB;AAGrC,SAAAA,kCAAA,KAAC,OAAI,EAAA,WAAU,8CACb,UAAA;AAAA,IAAAC,sCAAC,OACC,EAAA,UAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAG;AAAA,QACJ,SAAS,CAAC;AAAA,QACV,KAAK,KAAK;AAAA,WACP,cAAc,WAAW,GAAG,KAAK,YAAY;AAAA,QAChD;AAAA,QACA,eAAe,cAAc,WAAW,GAAG,GAAG;AAAA,QAC9C;AAAA,QACA,SAAS,WAAW;AAAA,QACpB,iBAAiB,CAAC,YAAY;AAC5B,2BAAiB,WAAW,KAAK,QAAQ,UAAU,QAAQ,OAAO;AAAA,QACpE;AAAA,QACA,gBAAgB;AAAA,MAAA;AAAA,IAAA,GAEpB;AAAA,IACAA,sCAAC,gCAA6B,WAAwB,CAAA;AAAA,EAAA,GACxD;AAEJ;"}
@@ -3,7 +3,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  require("../../../jsx-runtime-CgFM7lM3.cjs");
4
4
  require("@intlayer/core");
5
5
  require("lucide-react");
6
+ require("../../Button/Button.cjs");
6
7
  require("../ItemLayout.cjs");
7
- const components_DictionaryEditor_NodeWrapper_ArrayWrapper = require("../../../index-DTCehvKe.cjs");
8
+ const components_DictionaryEditor_NodeWrapper_ArrayWrapper = require("../../../index-DAsui9u9.cjs");
8
9
  exports.ArrayWrapper = components_DictionaryEditor_NodeWrapper_ArrayWrapper.ArrayWrapper;
9
10
  //# sourceMappingURL=ArrayWrapper.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ArrayWrapper.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
1
+ {"version":3,"file":"ArrayWrapper.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ArrayWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryEditor/NodeWrapper/ArrayWrapper.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE7D,KAAK,iBAAiB,GAAG,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,GAAG;IAC3D,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CA4C9C,CAAC"}
1
+ {"version":3,"file":"ArrayWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryEditor/NodeWrapper/ArrayWrapper.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE7D,KAAK,iBAAiB,GAAG,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,GAAG;IAC3D,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CA8C9C,CAAC"}
@@ -1,8 +1,9 @@
1
1
  import "../../../jsx-runtime-DQkoUcjV.js";
2
2
  import "@intlayer/core";
3
3
  import "lucide-react";
4
+ import "../../Button/Button.mjs";
4
5
  import "../ItemLayout.mjs";
5
- import { A } from "../../../index-BdTa-9zc.js";
6
+ import { A } from "../../../index-B-adg6xa.js";
6
7
  export {
7
8
  A as ArrayWrapper
8
9
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ArrayWrapper.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
1
+ {"version":3,"file":"ArrayWrapper.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -3,6 +3,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  require("../../../jsx-runtime-CgFM7lM3.cjs");
4
4
  require("react");
5
5
  require("@intlayer/core");
6
- const components_DictionaryEditor_NodeWrapper_ArrayWrapper = require("../../../index-DTCehvKe.cjs");
6
+ const components_DictionaryEditor_NodeWrapper_ArrayWrapper = require("../../../index-DAsui9u9.cjs");
7
7
  exports.EnumerationWrapper = components_DictionaryEditor_NodeWrapper_ArrayWrapper.EnumerationWrapper;
8
8
  //# sourceMappingURL=EnumerationWrapper.cjs.map
@@ -1,7 +1,7 @@
1
1
  import "../../../jsx-runtime-DQkoUcjV.js";
2
2
  import "react";
3
3
  import "@intlayer/core";
4
- import { E } from "../../../index-BdTa-9zc.js";
4
+ import { E } from "../../../index-B-adg6xa.js";
5
5
  export {
6
6
  E as EnumerationWrapper
7
7
  };
@@ -3,7 +3,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  require("../../../jsx-runtime-CgFM7lM3.cjs");
4
4
  require("@intlayer/core");
5
5
  require("lucide-react");
6
+ require("../../Button/Button.cjs");
6
7
  require("../ItemLayout.cjs");
7
- const components_DictionaryEditor_NodeWrapper_ArrayWrapper = require("../../../index-DTCehvKe.cjs");
8
+ const components_DictionaryEditor_NodeWrapper_ArrayWrapper = require("../../../index-DAsui9u9.cjs");
8
9
  exports.NestedObjectWrapper = components_DictionaryEditor_NodeWrapper_ArrayWrapper.NestedObjectWrapper;
9
10
  //# sourceMappingURL=NestedObjectWrapper.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"NestedObjectWrapper.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
1
+ {"version":3,"file":"NestedObjectWrapper.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"NestedObjectWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAA0B,KAAK,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAExE,KAAK,wBAAwB,GAAG,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,GAAG;IAClE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CAC1C,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,wBAAwB,CA4C5D,CAAC"}
1
+ {"version":3,"file":"NestedObjectWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,EAA0B,KAAK,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAExE,KAAK,wBAAwB,GAAG,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,GAAG;IAClE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CAC1C,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,wBAAwB,CA8C5D,CAAC"}
@@ -1,8 +1,9 @@
1
1
  import "../../../jsx-runtime-DQkoUcjV.js";
2
2
  import "@intlayer/core";
3
3
  import "lucide-react";
4
+ import "../../Button/Button.mjs";
4
5
  import "../ItemLayout.mjs";
5
- import { a } from "../../../index-BdTa-9zc.js";
6
+ import { a } from "../../../index-B-adg6xa.js";
6
7
  export {
7
8
  a as NestedObjectWrapper
8
9
  };
@@ -1 +1 @@
1
- {"version":3,"file":"NestedObjectWrapper.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
1
+ {"version":3,"file":"NestedObjectWrapper.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("../../../jsx-runtime-CgFM7lM3.cjs");
4
+ const editor = require("@intlayer/editor");
5
+ const utils_cn = require("../../../utils/cn.cjs");
4
6
  require("../../EditableField/EditableFieldInput.cjs");
5
7
  const components_EditableField_EditableFieldTextArea = require("../../EditableField/EditableFieldTextArea.cjs");
6
- const utils_cn = require("../../../utils/cn.cjs");
7
- const utils_dictionary = require("../../../utils/dictionary.cjs");
8
8
  const StringWrapper = ({
9
9
  keyPath,
10
10
  section,
@@ -12,7 +12,7 @@ const StringWrapper = ({
12
12
  onContentChange,
13
13
  onFocusKeyPath
14
14
  }) => {
15
- const editedContentValue = utils_dictionary.getDictionaryValueByKeyPath(
15
+ const editedContentValue = editor.getDictionaryValueByKeyPath(
16
16
  editedContent,
17
17
  keyPath
18
18
  );
@@ -1 +1 @@
1
- {"version":3,"file":"StringWrapper.cjs","sources":["../../../../src/components/DictionaryEditor/NodeWrapper/StringWrapper.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { EditableFieldTextArea } from '../..//EditableField';\nimport { cn } from '../../../utils/cn';\nimport { getDictionaryValueByKeyPath } from '../../../utils/dictionary';\nimport type { NodeWrapperProps } from './index';\n\ntype StringWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: string;\n};\n\nexport const StringWrapper: FC<StringWrapperProps> = ({\n keyPath,\n section,\n editedContent,\n onContentChange,\n onFocusKeyPath,\n}) => {\n const editedContentValue = getDictionaryValueByKeyPath(\n editedContent,\n keyPath\n );\n\n if (editedContentValue && typeof editedContentValue !== 'string') {\n return <>Error loading section</>;\n }\n\n const level = keyPath.length;\n\n const content = editedContentValue ?? section;\n\n return (\n <button\n className={cn(\n 'w-full rounded-md p-2 text-left transition',\n 'hover:bg-card/30 dark:hover:bg-card-dark/30 [&:has(.section:hover)]:bg-transparent',\n level === 2 && 'hover:bg-card/30 dark:hover:bg-card-dark/30',\n level >= 3 && ''\n )}\n onClick={(e) => {\n e.stopPropagation();\n onFocusKeyPath(keyPath);\n }}\n >\n <EditableFieldTextArea\n defaultValue={content}\n onSave={(newValue) => onContentChange({ keyPath, newValue })}\n onCancel={() => null}\n />\n </button>\n );\n};\n"],"names":["getDictionaryValueByKeyPath","jsx","cn","EditableFieldTextArea"],"mappings":";;;;;;;AAUO,MAAM,gBAAwC,CAAC;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,qBAAqBA,iBAAA;AAAA,IACzB;AAAA,IACA;AAAA,EACF;AAEI,MAAA,sBAAsB,OAAO,uBAAuB,UAAU;AAChE,qGAAS,UAAqB,wBAAA,CAAA;AAAA,EAAA;AAGhC,QAAM,QAAQ,QAAQ;AAEtB,QAAM,UAAU,sBAAsB;AAGpC,SAAAC,2BAAA,kBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,SAAA;AAAA,QACT;AAAA,QACA;AAAA,QACA,UAAU,KAAK;AAAA,QACf,SAAS,KAAK;AAAA,MAChB;AAAA,MACA,SAAS,CAAC,MAAM;AACd,UAAE,gBAAgB;AAClB,uBAAe,OAAO;AAAA,MACxB;AAAA,MAEA,UAAAD,2BAAA,kBAAA;AAAA,QAACE,+CAAA;AAAA,QAAA;AAAA,UACC,cAAc;AAAA,UACd,QAAQ,CAAC,aAAa,gBAAgB,EAAE,SAAS,UAAU;AAAA,UAC3D,UAAU,MAAM;AAAA,QAAA;AAAA,MAAA;AAAA,IAClB;AAAA,EACF;AAEJ;;"}
1
+ {"version":3,"file":"StringWrapper.cjs","sources":["../../../../src/components/DictionaryEditor/NodeWrapper/StringWrapper.tsx"],"sourcesContent":["import { getDictionaryValueByKeyPath } from '@intlayer/editor';\nimport type { FC } from 'react';\nimport { cn } from '../../../utils/cn';\nimport { EditableFieldTextArea } from '../../EditableField';\nimport type { NodeWrapperProps } from './index';\n\ntype StringWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: string;\n};\n\nexport const StringWrapper: FC<StringWrapperProps> = ({\n keyPath,\n section,\n editedContent,\n onContentChange,\n onFocusKeyPath,\n}) => {\n const editedContentValue = getDictionaryValueByKeyPath(\n editedContent,\n keyPath\n );\n\n if (editedContentValue && typeof editedContentValue !== 'string') {\n return <>Error loading section</>;\n }\n\n const level = keyPath.length;\n\n const content = editedContentValue ?? section;\n\n return (\n <button\n className={cn(\n 'w-full rounded-md p-2 text-left transition',\n 'hover:bg-card/30 dark:hover:bg-card-dark/30 [&:has(.section:hover)]:bg-transparent',\n level === 2 && 'hover:bg-card/30 dark:hover:bg-card-dark/30',\n level >= 3 && ''\n )}\n onClick={(e) => {\n e.stopPropagation();\n onFocusKeyPath(keyPath);\n }}\n >\n <EditableFieldTextArea\n defaultValue={content}\n onSave={(newValue) => onContentChange({ keyPath, newValue })}\n onCancel={() => null}\n />\n </button>\n );\n};\n"],"names":["getDictionaryValueByKeyPath","jsx","cn","EditableFieldTextArea"],"mappings":";;;;;;;AAUO,MAAM,gBAAwC,CAAC;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,qBAAqBA,OAAA;AAAA,IACzB;AAAA,IACA;AAAA,EACF;AAEI,MAAA,sBAAsB,OAAO,uBAAuB,UAAU;AAChE,qGAAS,UAAqB,wBAAA,CAAA;AAAA,EAAA;AAGhC,QAAM,QAAQ,QAAQ;AAEtB,QAAM,UAAU,sBAAsB;AAGpC,SAAAC,2BAAA,kBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,SAAA;AAAA,QACT;AAAA,QACA;AAAA,QACA,UAAU,KAAK;AAAA,QACf,SAAS,KAAK;AAAA,MAChB;AAAA,MACA,SAAS,CAAC,MAAM;AACd,UAAE,gBAAgB;AAClB,uBAAe,OAAO;AAAA,MACxB;AAAA,MAEA,UAAAD,2BAAA,kBAAA;AAAA,QAACE,+CAAA;AAAA,QAAA;AAAA,UACC,cAAc;AAAA,UACd,QAAQ,CAAC,aAAa,gBAAgB,EAAE,SAAS,UAAU;AAAA,UAC3D,UAAU,MAAM;AAAA,QAAA;AAAA,MAAA;AAAA,IAClB;AAAA,EACF;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"StringWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryEditor/NodeWrapper/StringWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,KAAK,kBAAkB,GAAG,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,GAAG;IAC5D,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAwChD,CAAC"}
1
+ {"version":3,"file":"StringWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryEditor/NodeWrapper/StringWrapper.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,KAAK,kBAAkB,GAAG,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,GAAG;IAC5D,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAwChD,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import { j as jsxRuntimeExports } from "../../../jsx-runtime-DQkoUcjV.js";
2
+ import { getDictionaryValueByKeyPath } from "@intlayer/editor";
3
+ import { cn } from "../../../utils/cn.mjs";
2
4
  import "../../EditableField/EditableFieldInput.mjs";
3
5
  import { EditableFieldTextArea } from "../../EditableField/EditableFieldTextArea.mjs";
4
- import { cn } from "../../../utils/cn.mjs";
5
- import { getDictionaryValueByKeyPath } from "../../../utils/dictionary.mjs";
6
6
  const StringWrapper = ({
7
7
  keyPath,
8
8
  section,
@@ -1 +1 @@
1
- {"version":3,"file":"StringWrapper.mjs","sources":["../../../../src/components/DictionaryEditor/NodeWrapper/StringWrapper.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { EditableFieldTextArea } from '../..//EditableField';\nimport { cn } from '../../../utils/cn';\nimport { getDictionaryValueByKeyPath } from '../../../utils/dictionary';\nimport type { NodeWrapperProps } from './index';\n\ntype StringWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: string;\n};\n\nexport const StringWrapper: FC<StringWrapperProps> = ({\n keyPath,\n section,\n editedContent,\n onContentChange,\n onFocusKeyPath,\n}) => {\n const editedContentValue = getDictionaryValueByKeyPath(\n editedContent,\n keyPath\n );\n\n if (editedContentValue && typeof editedContentValue !== 'string') {\n return <>Error loading section</>;\n }\n\n const level = keyPath.length;\n\n const content = editedContentValue ?? section;\n\n return (\n <button\n className={cn(\n 'w-full rounded-md p-2 text-left transition',\n 'hover:bg-card/30 dark:hover:bg-card-dark/30 [&:has(.section:hover)]:bg-transparent',\n level === 2 && 'hover:bg-card/30 dark:hover:bg-card-dark/30',\n level >= 3 && ''\n )}\n onClick={(e) => {\n e.stopPropagation();\n onFocusKeyPath(keyPath);\n }}\n >\n <EditableFieldTextArea\n defaultValue={content}\n onSave={(newValue) => onContentChange({ keyPath, newValue })}\n onCancel={() => null}\n />\n </button>\n );\n};\n"],"names":["jsx"],"mappings":";;;;;AAUO,MAAM,gBAAwC,CAAC;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,qBAAqB;AAAA,IACzB;AAAA,IACA;AAAA,EACF;AAEI,MAAA,sBAAsB,OAAO,uBAAuB,UAAU;AAChE,+EAAS,UAAqB,wBAAA,CAAA;AAAA,EAAA;AAGhC,QAAM,QAAQ,QAAQ;AAEtB,QAAM,UAAU,sBAAsB;AAGpC,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA,UAAU,KAAK;AAAA,QACf,SAAS,KAAK;AAAA,MAChB;AAAA,MACA,SAAS,CAAC,MAAM;AACd,UAAE,gBAAgB;AAClB,uBAAe,OAAO;AAAA,MACxB;AAAA,MAEA,UAAAA,kCAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,cAAc;AAAA,UACd,QAAQ,CAAC,aAAa,gBAAgB,EAAE,SAAS,UAAU;AAAA,UAC3D,UAAU,MAAM;AAAA,QAAA;AAAA,MAAA;AAAA,IAClB;AAAA,EACF;AAEJ;"}
1
+ {"version":3,"file":"StringWrapper.mjs","sources":["../../../../src/components/DictionaryEditor/NodeWrapper/StringWrapper.tsx"],"sourcesContent":["import { getDictionaryValueByKeyPath } from '@intlayer/editor';\nimport type { FC } from 'react';\nimport { cn } from '../../../utils/cn';\nimport { EditableFieldTextArea } from '../../EditableField';\nimport type { NodeWrapperProps } from './index';\n\ntype StringWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: string;\n};\n\nexport const StringWrapper: FC<StringWrapperProps> = ({\n keyPath,\n section,\n editedContent,\n onContentChange,\n onFocusKeyPath,\n}) => {\n const editedContentValue = getDictionaryValueByKeyPath(\n editedContent,\n keyPath\n );\n\n if (editedContentValue && typeof editedContentValue !== 'string') {\n return <>Error loading section</>;\n }\n\n const level = keyPath.length;\n\n const content = editedContentValue ?? section;\n\n return (\n <button\n className={cn(\n 'w-full rounded-md p-2 text-left transition',\n 'hover:bg-card/30 dark:hover:bg-card-dark/30 [&:has(.section:hover)]:bg-transparent',\n level === 2 && 'hover:bg-card/30 dark:hover:bg-card-dark/30',\n level >= 3 && ''\n )}\n onClick={(e) => {\n e.stopPropagation();\n onFocusKeyPath(keyPath);\n }}\n >\n <EditableFieldTextArea\n defaultValue={content}\n onSave={(newValue) => onContentChange({ keyPath, newValue })}\n onCancel={() => null}\n />\n </button>\n );\n};\n"],"names":["jsx"],"mappings":";;;;;AAUO,MAAM,gBAAwC,CAAC;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,qBAAqB;AAAA,IACzB;AAAA,IACA;AAAA,EACF;AAEI,MAAA,sBAAsB,OAAO,uBAAuB,UAAU;AAChE,+EAAS,UAAqB,wBAAA,CAAA;AAAA,EAAA;AAGhC,QAAM,QAAQ,QAAQ;AAEtB,QAAM,UAAU,sBAAsB;AAGpC,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA,UAAU,KAAK;AAAA,QACf,SAAS,KAAK;AAAA,MAChB;AAAA,MACA,SAAS,CAAC,MAAM;AACd,UAAE,gBAAgB;AAClB,uBAAe,OAAO;AAAA,MACxB;AAAA,MAEA,UAAAA,kCAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,cAAc;AAAA,UACd,QAAQ,CAAC,aAAa,gBAAgB,EAAE,SAAS,UAAU;AAAA,UAC3D,UAAU,MAAM;AAAA,QAAA;AAAA,MAAA;AAAA,IAClB;AAAA,EACF;AAEJ;"}
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  require("../../../jsx-runtime-CgFM7lM3.cjs");
4
4
  require("@intlayer/core");
5
- const components_DictionaryEditor_NodeWrapper_ArrayWrapper = require("../../../index-DTCehvKe.cjs");
5
+ const components_DictionaryEditor_NodeWrapper_ArrayWrapper = require("../../../index-DAsui9u9.cjs");
6
6
  exports.TranslationWrapper = components_DictionaryEditor_NodeWrapper_ArrayWrapper.TranslationWrapper;
7
7
  //# sourceMappingURL=TranslationWrapper.cjs.map
@@ -1,6 +1,6 @@
1
1
  import "../../../jsx-runtime-DQkoUcjV.js";
2
2
  import "@intlayer/core";
3
- import { T } from "../../../index-BdTa-9zc.js";
3
+ import { T } from "../../../index-B-adg6xa.js";
4
4
  export {
5
5
  T as TranslationWrapper
6
6
  };
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  require("../../../jsx-runtime-CgFM7lM3.cjs");
4
4
  require("@intlayer/core");
5
5
  require("react");
6
- const components_DictionaryEditor_NodeWrapper_ArrayWrapper = require("../../../index-DTCehvKe.cjs");
6
+ const components_DictionaryEditor_NodeWrapper_ArrayWrapper = require("../../../index-DAsui9u9.cjs");
7
7
  require("./StringWrapper.cjs");
8
8
  exports.NodeWrapper = components_DictionaryEditor_NodeWrapper_ArrayWrapper.NodeWrapper;
9
9
  exports.traceKeys = components_DictionaryEditor_NodeWrapper_ArrayWrapper.traceKeys;
@@ -1,7 +1,7 @@
1
1
  import "../../../jsx-runtime-DQkoUcjV.js";
2
2
  import "@intlayer/core";
3
3
  import "react";
4
- import { N, t } from "../../../index-BdTa-9zc.js";
4
+ import { N, t } from "../../../index-B-adg6xa.js";
5
5
  import "./StringWrapper.mjs";
6
6
  export {
7
7
  N as NodeWrapper,
@@ -2,19 +2,17 @@
2
2
  "use strict";
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
4
  const jsxRuntime = require("../../jsx-runtime-CgFM7lM3.cjs");
5
+ const editorReact = require("@intlayer/editor-react");
5
6
  const lucideReact = require("lucide-react");
6
7
  const require$$0 = require("react");
7
8
  const reactIntlayer = require("react-intlayer");
8
- const shallow = require("../../shallow-lhDIFtEp.cjs");
9
9
  require("../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
10
10
  require("../../hooks/useAsync/useAsyncStateStore.cjs");
11
11
  const hooks_intlayerAPIHooks = require("../../hooks/intlayerAPIHooks.cjs");
12
- require("@intlayer/dictionaries-entry");
13
12
  require("deepmerge");
14
13
  const components_Form_FormBase = require("../Form/FormBase.cjs");
15
14
  require("../Form/FormField.cjs");
16
15
  const components_Form_layout_FormItemLayout = require("../../Form-CSMiPnjC.cjs");
17
- const components_DictionaryEditor_useEditedContentStore = require("./useEditedContentStore.cjs");
18
16
  const components_DictionaryEditor_validDictionaryChangeButtons_content = require("./validDictionaryChangeButtons.content.cjs");
19
17
  const components_DictionaryEditor_validDictionaryChangeButtonsSchema = require("./validDictionaryChangeButtonsSchema.cjs");
20
18
  const ValidDictionaryChangeButtons = ({ dictionary }) => {
@@ -23,12 +21,7 @@ const ValidDictionaryChangeButtons = ({ dictionary }) => {
23
21
  components_DictionaryEditor_validDictionaryChangeButtons_content.validDictionaryChangeButtonsContent
24
22
  );
25
23
  const { pushDictionaries } = hooks_intlayerAPIHooks.usePushDictionaries();
26
- const { editedContent, restoreEditedContent } = components_DictionaryEditor_useEditedContentStore.useEditedContentStore(
27
- shallow.useShallow((s) => ({
28
- editedContent: s.editedContent,
29
- restoreEditedContent: s.restoreEditedContent
30
- }))
31
- );
24
+ const { editedContent, restoreEditedContent } = editorReact.useEditedContent();
32
25
  const { form, isSubmitting } = components_Form_FormBase.useForm(
33
26
  ValidDictionaryChangeButtonsSchemaSchema
34
27
  );
@@ -1 +1 @@
1
- {"version":3,"file":"ValidDictionaryChangeButtons.cjs","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';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\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 useShallow((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}\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}\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}\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":["getValidDictionaryChangeButtonsSchemaSchema","useDictionary","validDictionaryChangeButtonsContent","usePushDictionaries","useEditedContentStore","useShallow","useForm","useMemo","jsx","jsxs","Form","RotateCcw","ArrowUpFromLine","Save"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBO,MAAM,+BAET,CAAC,EAAE,iBAAiB;AACtB,QAAM,2CACJA,+DAAAA,4CAA4C;AAE9C,QAAM,EAAE,aAAa,YAAY,cAAkB,IAAAC,cAAA;AAAA,IACjDC,iEAAAA;AAAAA,EACF;AAEM,QAAA,EAAE,iBAAiB,IAAIC,2CAAoB;AAE3C,QAAA,EAAE,eAAe,qBAAA,IAAyBC,kDAAA;AAAA,IAC9CC,QAAA,WAAW,CAAC,OAAO;AAAA,MACjB,eAAe,EAAE;AAAA,MACjB,sBAAsB,EAAE;AAAA,IAAA,EACxB;AAAA,EACJ;AACM,QAAA,EAAE,MAAM,aAAA,IAAiBC,yBAAA;AAAA,IAC7B;AAAA,EACF;AAEA,QAAM,mBAAmBC,WAAA;AAAA,IACvB,MAAM,cAAc,WAAW,GAAG;AAAA,IAClC,CAAC,eAAe,WAAW,GAAG;AAAA,EAChC;AAEA,QAAM,WAAWA,WAAA;AAAA,IACf,MACE,oBACA,KAAK,UAAU,kBAAkB,OAAO,MACtC,KAAK,UAAU,YAAY,OAAO;AAAA,IACtC,CAAC,kBAAkB,UAAU;AAAA,EAC/B;AAEA,QAAM,oBAAoBA,WAAA;AAAA,IACxB,MAAM,OAAQ,YAAkC,QAAQ;AAAA,IACxD,CAAC,UAAU;AAAA,EACb;AAEA,QAAM,kBAAkB,YAAY;AAClC,UAAM,iBAAiB;AAAA,MACrB;AAAA,QACE,GAAG;AAAA,QACH,GAAG,cAAc,WAAW,GAAG;AAAA,MAAA;AAAA,IACjC,CACD;AAAA,EACH;AAGE,SAAAC,2BAAAA,kBAAAA,IAAC,OAAI,EAAA,WAAU,QACb,UAAAC,2BAAA,kBAAA;AAAA,IAACC,sCAAA;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACT,GAAG;AAAA,MACJ,QAAQ;AAAA,MACR;AAAA,MAEC,UAAA;AAAA,QACC,YAAAF,2BAAA,kBAAA;AAAA,UAACE,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,YAAY;AAAA,YACnB,UAAU,CAAC,YAAY;AAAA,YACvB,WAAU;AAAA,YACV,MAAMC,YAAA;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,oBACCH,2BAAA,kBAAA;AAAA,UAACE,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,cAAc;AAAA,YACrB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAME,YAAA;AAAA,YACN,OAAM;AAAA,YACN,aAAW;AAAA,YACX,WAAW;AAAA,YAEV,UAAc,cAAA;AAAA,UAAA;AAAA,YAGjB,YACEJ,2BAAA,kBAAA;AAAA,UAACE,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,WAAW;AAAA,YAClB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAMG,YAAA;AAAA,YACN,OAAM;AAAA,YACN,aAAW;AAAA,YACX,WAAW;AAAA,YAEV,UAAW,WAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACd;AAAA,IAAA;AAAA,EAAA,GAIR;AAEJ;;"}
1
+ {"version":3,"file":"ValidDictionaryChangeButtons.cjs","sources":["../../../src/components/DictionaryEditor/ValidDictionaryChangeButtons.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport type { Dictionary } from '@intlayer/core';\nimport { useEditedContent } from '@intlayer/editor-react';\nimport { ArrowUpFromLine, RotateCcw, Save } from 'lucide-react';\nimport { useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { usePushDictionaries } from '../../hooks';\nimport { Form, useForm } from '../Form';\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 } = useEditedContent();\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}\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}\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}\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":["getValidDictionaryChangeButtonsSchemaSchema","useDictionary","validDictionaryChangeButtonsContent","usePushDictionaries","useEditedContent","useForm","useMemo","jsx","jsxs","Form","RotateCcw","ArrowUpFromLine","Save"],"mappings":";;;;;;;;;;;;;;;;;AAkBO,MAAM,+BAET,CAAC,EAAE,iBAAiB;AACtB,QAAM,2CACJA,+DAAAA,4CAA4C;AAE9C,QAAM,EAAE,aAAa,YAAY,cAAkB,IAAAC,cAAA;AAAA,IACjDC,iEAAAA;AAAAA,EACF;AAEM,QAAA,EAAE,iBAAiB,IAAIC,2CAAoB;AAEjD,QAAM,EAAE,eAAe,qBAAqB,IAAIC,6BAAiB;AAC3D,QAAA,EAAE,MAAM,aAAA,IAAiBC,yBAAA;AAAA,IAC7B;AAAA,EACF;AAEA,QAAM,mBAAmBC,WAAA;AAAA,IACvB,MAAM,cAAc,WAAW,GAAG;AAAA,IAClC,CAAC,eAAe,WAAW,GAAG;AAAA,EAChC;AAEA,QAAM,WAAWA,WAAA;AAAA,IACf,MACE,oBACA,KAAK,UAAU,kBAAkB,OAAO,MACtC,KAAK,UAAU,YAAY,OAAO;AAAA,IACtC,CAAC,kBAAkB,UAAU;AAAA,EAC/B;AAEA,QAAM,oBAAoBA,WAAA;AAAA,IACxB,MAAM,OAAQ,YAAkC,QAAQ;AAAA,IACxD,CAAC,UAAU;AAAA,EACb;AAEA,QAAM,kBAAkB,YAAY;AAClC,UAAM,iBAAiB;AAAA,MACrB;AAAA,QACE,GAAG;AAAA,QACH,GAAG,cAAc,WAAW,GAAG;AAAA,MAAA;AAAA,IACjC,CACD;AAAA,EACH;AAGE,SAAAC,2BAAAA,kBAAAA,IAAC,OAAI,EAAA,WAAU,QACb,UAAAC,2BAAA,kBAAA;AAAA,IAACC,sCAAA;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACT,GAAG;AAAA,MACJ,QAAQ;AAAA,MACR;AAAA,MAEC,UAAA;AAAA,QACC,YAAAF,2BAAA,kBAAA;AAAA,UAACE,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,YAAY;AAAA,YACnB,UAAU,CAAC,YAAY;AAAA,YACvB,WAAU;AAAA,YACV,MAAMC,YAAA;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,oBACCH,2BAAA,kBAAA;AAAA,UAACE,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,cAAc;AAAA,YACrB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAME,YAAA;AAAA,YACN,OAAM;AAAA,YACN,aAAW;AAAA,YACX,WAAW;AAAA,YAEV,UAAc,cAAA;AAAA,UAAA;AAAA,YAGjB,YACEJ,2BAAA,kBAAA;AAAA,UAACE,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,WAAW;AAAA,YAClB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAMG,YAAA;AAAA,YACN,OAAM;AAAA,YACN,aAAW;AAAA,YACX,WAAW;AAAA,YAEV,UAAW,WAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACd;AAAA,IAAA;AAAA,EAAA,GAIR;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ValidDictionaryChangeButtons.d.ts","sourceRoot":"","sources":["../../../src/components/DictionaryEditor/ValidDictionaryChangeButtons.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EAAW,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAUzC,KAAK,iCAAiC,GAAG;IACvC,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,EAAE,CAC3C,iCAAiC,CAsGlC,CAAC"}
1
+ {"version":3,"file":"ValidDictionaryChangeButtons.d.ts","sourceRoot":"","sources":["../../../src/components/DictionaryEditor/ValidDictionaryChangeButtons.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,OAAO,EAAW,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAQzC,KAAK,iCAAiC,GAAG;IACvC,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,EAAE,CAC3C,iCAAiC,CAiGlC,CAAC"}
@@ -1,18 +1,16 @@
1
1
  "use client";
2
2
  import { j as jsxRuntimeExports } from "../../jsx-runtime-DQkoUcjV.js";
3
+ import { useEditedContent } from "@intlayer/editor-react";
3
4
  import { RotateCcw, ArrowUpFromLine, Save } from "lucide-react";
4
5
  import { useMemo } from "react";
5
6
  import { useDictionary } from "react-intlayer";
6
- import { u as useShallow } from "../../shallow-m9BpCkKh.js";
7
7
  import "../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
8
8
  import "../../hooks/useAsync/useAsyncStateStore.mjs";
9
9
  import { usePushDictionaries } from "../../hooks/intlayerAPIHooks.mjs";
10
- import "@intlayer/dictionaries-entry";
11
10
  import "deepmerge";
12
11
  import { useForm } from "../Form/FormBase.mjs";
13
12
  import "../Form/FormField.mjs";
14
13
  import { F as Form } from "../../Form-DlqjTz3u.js";
15
- import { useEditedContentStore } from "./useEditedContentStore.mjs";
16
14
  import { validDictionaryChangeButtonsContent } from "./validDictionaryChangeButtons.content.mjs";
17
15
  import { getValidDictionaryChangeButtonsSchemaSchema } from "./validDictionaryChangeButtonsSchema.mjs";
18
16
  const ValidDictionaryChangeButtons = ({ dictionary }) => {
@@ -21,12 +19,7 @@ const ValidDictionaryChangeButtons = ({ dictionary }) => {
21
19
  validDictionaryChangeButtonsContent
22
20
  );
23
21
  const { pushDictionaries } = usePushDictionaries();
24
- const { editedContent, restoreEditedContent } = useEditedContentStore(
25
- useShallow((s) => ({
26
- editedContent: s.editedContent,
27
- restoreEditedContent: s.restoreEditedContent
28
- }))
29
- );
22
+ const { editedContent, restoreEditedContent } = useEditedContent();
30
23
  const { form, isSubmitting } = useForm(
31
24
  ValidDictionaryChangeButtonsSchemaSchema
32
25
  );
@@ -1 +1 @@
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';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\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 useShallow((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}\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}\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}\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":";;;;;;;;;;;;;;;;;AAmBO,MAAM,+BAET,CAAC,EAAE,iBAAiB;AACtB,QAAM,2CACJ,4CAA4C;AAE9C,QAAM,EAAE,aAAa,YAAY,cAAkB,IAAA;AAAA,IACjD;AAAA,EACF;AAEM,QAAA,EAAE,iBAAiB,IAAI,oBAAoB;AAE3C,QAAA,EAAE,eAAe,qBAAA,IAAyB;AAAA,IAC9C,WAAW,CAAC,OAAO;AAAA,MACjB,eAAe,EAAE;AAAA,MACjB,sBAAsB,EAAE;AAAA,IAAA,EACxB;AAAA,EACJ;AACM,QAAA,EAAE,MAAM,aAAA,IAAiB;AAAA,IAC7B;AAAA,EACF;AAEA,QAAM,mBAAmB;AAAA,IACvB,MAAM,cAAc,WAAW,GAAG;AAAA,IAClC,CAAC,eAAe,WAAW,GAAG;AAAA,EAChC;AAEA,QAAM,WAAW;AAAA,IACf,MACE,oBACA,KAAK,UAAU,kBAAkB,OAAO,MACtC,KAAK,UAAU,YAAY,OAAO;AAAA,IACtC,CAAC,kBAAkB,UAAU;AAAA,EAC/B;AAEA,QAAM,oBAAoB;AAAA,IACxB,MAAM,OAAQ,YAAkC,QAAQ;AAAA,IACxD,CAAC,UAAU;AAAA,EACb;AAEA,QAAM,kBAAkB,YAAY;AAClC,UAAM,iBAAiB;AAAA,MACrB;AAAA,QACE,GAAG;AAAA,QACH,GAAG,cAAc,WAAW,GAAG;AAAA,MAAA;AAAA,IACjC,CACD;AAAA,EACH;AAGE,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;AAAA,YACnB,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;AAAA,YACrB,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;AAAA,YAClB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAM;AAAA,YACN,OAAM;AAAA,YACN,aAAW;AAAA,YACX,WAAW;AAAA,YAEV,UAAW,WAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACd;AAAA,IAAA;AAAA,EAAA,GAIR;AAEJ;"}
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 { useEditedContent } from '@intlayer/editor-react';\nimport { ArrowUpFromLine, RotateCcw, Save } from 'lucide-react';\nimport { useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { usePushDictionaries } from '../../hooks';\nimport { Form, useForm } from '../Form';\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 } = useEditedContent();\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}\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}\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}\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":";;;;;;;;;;;;;;;AAkBO,MAAM,+BAET,CAAC,EAAE,iBAAiB;AACtB,QAAM,2CACJ,4CAA4C;AAE9C,QAAM,EAAE,aAAa,YAAY,cAAkB,IAAA;AAAA,IACjD;AAAA,EACF;AAEM,QAAA,EAAE,iBAAiB,IAAI,oBAAoB;AAEjD,QAAM,EAAE,eAAe,qBAAqB,IAAI,iBAAiB;AAC3D,QAAA,EAAE,MAAM,aAAA,IAAiB;AAAA,IAC7B;AAAA,EACF;AAEA,QAAM,mBAAmB;AAAA,IACvB,MAAM,cAAc,WAAW,GAAG;AAAA,IAClC,CAAC,eAAe,WAAW,GAAG;AAAA,EAChC;AAEA,QAAM,WAAW;AAAA,IACf,MACE,oBACA,KAAK,UAAU,kBAAkB,OAAO,MACtC,KAAK,UAAU,YAAY,OAAO;AAAA,IACtC,CAAC,kBAAkB,UAAU;AAAA,EAC/B;AAEA,QAAM,oBAAoB;AAAA,IACxB,MAAM,OAAQ,YAAkC,QAAQ;AAAA,IACxD,CAAC,UAAU;AAAA,EACb;AAEA,QAAM,kBAAkB,YAAY;AAClC,UAAM,iBAAiB;AAAA,MACrB;AAAA,QACE,GAAG;AAAA,QACH,GAAG,cAAc,WAAW,GAAG;AAAA,MAAA;AAAA,IACjC,CACD;AAAA,EACH;AAGE,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;AAAA,YACnB,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;AAAA,YACrB,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;AAAA,YAClB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAM;AAAA,YACN,OAAM;AAAA,YACN,aAAW;AAAA,YACX,WAAW;AAAA,YAEV,UAAW,WAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACd;AAAA,IAAA;AAAA,EAAA,GAIR;AAEJ;"}
@@ -1,13 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const components_DictionaryEditor_useEditedContentStore = require("./useEditedContentStore.cjs");
4
- const components_DictionaryEditor_useEditionPanelStore = require("./useEditionPanelStore.cjs");
5
3
  const components_DictionaryEditor_DictionaryEditor = require("./DictionaryEditor.cjs");
6
- const utils_dictionary = require("../../utils/dictionary.cjs");
7
- exports.useEditedContentStore = components_DictionaryEditor_useEditedContentStore.useEditedContentStore;
8
- exports.useEditionPanelStore = components_DictionaryEditor_useEditionPanelStore.useEditionPanelStore;
9
4
  exports.DictionaryEditor = components_DictionaryEditor_DictionaryEditor.DictionaryEditor;
10
- exports.editDictionaryByKeyPath = utils_dictionary.editDictionaryByKeyPath;
11
- exports.getDictionaryValueByKeyPath = utils_dictionary.getDictionaryValueByKeyPath;
12
- exports.renameDictionaryValueByKeyPath = utils_dictionary.renameDictionaryValueByKeyPath;
13
5
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,4 +1,2 @@
1
- export * from './useEditedContentStore';
2
- export * from './useEditionPanelStore';
3
1
  export * from './DictionaryEditor';
4
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DictionaryEditor/index.tsx"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DictionaryEditor/index.tsx"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -1,13 +1,5 @@
1
- import { useEditedContentStore } from "./useEditedContentStore.mjs";
2
- import { useEditionPanelStore } from "./useEditionPanelStore.mjs";
3
1
  import { DictionaryEditor } from "./DictionaryEditor.mjs";
4
- import { editDictionaryByKeyPath, getDictionaryValueByKeyPath, renameDictionaryValueByKeyPath } from "../../utils/dictionary.mjs";
5
2
  export {
6
- DictionaryEditor,
7
- editDictionaryByKeyPath,
8
- getDictionaryValueByKeyPath,
9
- renameDictionaryValueByKeyPath,
10
- useEditedContentStore,
11
- useEditionPanelStore
3
+ DictionaryEditor
12
4
  };
13
5
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,5 +1,5 @@
1
1
  import { Dictionary, DictionaryValue, KeyPath } from '@intlayer/core';
2
- export { editDictionaryByKeyPath, getDictionaryValueByKeyPath, renameDictionaryValueByKeyPath, } from '../../utils/dictionary';
2
+ export { editDictionaryByKeyPath, getDictionaryValueByKeyPath, renameDictionaryValueByKeyPath, } from '../../../../core/src/dictionaryUtils';
3
3
  export type DictionaryContent = Record<Dictionary['key'], Dictionary>;
4
4
  type EditedContentStore = {
5
5
  dictionariesRecord: DictionaryContent;
@@ -2,29 +2,15 @@
2
2
  "use strict";
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
4
  const jsxRuntime = require("../../../jsx-runtime-CgFM7lM3.cjs");
5
+ const editorReact = require("@intlayer/editor-react");
5
6
  const require$$0 = require("react");
6
7
  const reactIntlayer = require("react-intlayer");
7
- const shallow = require("../../../shallow-lhDIFtEp.cjs");
8
8
  require("../../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
9
9
  require("../../../hooks/useAsync/useAsyncStateStore.cjs");
10
- require("../../../index-DFc7og1d.cjs");
10
+ require("@intlayer/api");
11
11
  require("@intlayer/config/client");
12
12
  require("../../Toaster/Toast.cjs");
13
13
  const hooks_useGetAllDictionaries = require("../../../hooks/useGetAllDictionaries.cjs");
14
- require("../../DictionaryEditor/useEditedContentStore.cjs");
15
- const components_DictionaryEditor_useEditionPanelStore = require("../../DictionaryEditor/useEditionPanelStore.cjs");
16
- require("@intlayer/core");
17
- require("lucide-react");
18
- require("clsx");
19
- require("tailwind-merge");
20
- require("../../Button/Button.cjs");
21
- require("../../EditableField/EditableFieldInput.cjs");
22
- require("../../EditableField/EditableFieldTextArea.cjs");
23
- require("../../Form/FormBase.cjs");
24
- require("../../Form/FormField.cjs");
25
- require("../../../Form-CSMiPnjC.cjs");
26
- require("../../DictionaryEditor/validDictionaryChangeButtons.content.cjs");
27
- require("zod");
28
14
  const components_Loader_index = require("../../Loader/index.cjs");
29
15
  const components_DictionaryFieldEditor_DictionaryFieldEditor = require("../DictionaryFieldEditor.cjs");
30
16
  const components_DictionaryFieldEditor_DictionariesSelector_dictionariesSelector_content = require("./dictionariesSelector.content.cjs");
@@ -34,11 +20,7 @@ const DictionariesSelector = ({
34
20
  availableLocales
35
21
  }) => {
36
22
  const { online, locale, isLoading } = hooks_useGetAllDictionaries.useGetAllDictionaries();
37
- const { focusedContent } = components_DictionaryEditor_useEditionPanelStore.useEditionPanelStore(
38
- shallow.useShallow((s) => ({
39
- focusedContent: s.focusedContent
40
- }))
41
- );
23
+ const { focusedContent } = editorReact.useFocusDictionary();
42
24
  const { noDictionaryMessage, dictionaryNotFoundMessage } = reactIntlayer.useDictionary(
43
25
  components_DictionaryFieldEditor_DictionariesSelector_dictionariesSelector_content.dictionariesSelectorContent
44
26
  );
@@ -1 +1 @@
1
- {"version":3,"file":"DictionariesSelector.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.tsx"],"sourcesContent":["'use client';\n\nimport { Locales } from '@intlayer/config';\nimport { useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { useGetAllDictionaries } from '../../../hooks';\nimport { useEditionPanelStore } from '../../DictionaryEditor';\nimport { Loader } from '../../Loader';\nimport { DictionaryFieldEditor } from '../DictionaryFieldEditor';\nimport { dictionariesSelectorContent } from './dictionariesSelector.content';\n\ntype DictionariesSelectorProps = {\n onClickDictionaryList: () => void;\n isDarkMode?: boolean;\n availableLocales: Locales[];\n};\n\nexport const DictionariesSelector: FC<DictionariesSelectorProps> = ({\n onClickDictionaryList,\n isDarkMode,\n availableLocales,\n}) => {\n const { online, locale, isLoading } = useGetAllDictionaries();\n const { focusedContent } = useEditionPanelStore(\n useShallow((s) => ({\n focusedContent: s.focusedContent,\n }))\n );\n const { noDictionaryMessage, dictionaryNotFoundMessage } = useDictionary(\n dictionariesSelectorContent\n );\n const dictionary = useMemo(\n () =>\n focusedContent?.dictionaryKey\n ? (online?.[focusedContent?.dictionaryKey] ??\n locale?.[focusedContent?.dictionaryKey])\n : null,\n [online, locale, focusedContent?.dictionaryKey]\n );\n\n if (isLoading) return <Loader />;\n\n if (!focusedContent?.dictionaryKey) return noDictionaryMessage;\n\n if (!dictionary) return dictionaryNotFoundMessage;\n\n return (\n <DictionaryFieldEditor\n dictionary={dictionary}\n onClickDictionaryList={onClickDictionaryList}\n isDarkMode={isDarkMode}\n availableLocales={availableLocales}\n />\n );\n};\n"],"names":["useGetAllDictionaries","useEditionPanelStore","useShallow","useDictionary","dictionariesSelectorContent","useMemo","jsx","Loader","DictionaryFieldEditor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBO,MAAM,uBAAsD,CAAC;AAAA,EAClE;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,EAAE,QAAQ,QAAQ,UAAA,IAAcA,4BAAAA,sBAAsB;AACtD,QAAA,EAAE,mBAAmBC,iDAAA;AAAA,IACzBC,QAAA,WAAW,CAAC,OAAO;AAAA,MACjB,gBAAgB,EAAE;AAAA,IAAA,EAClB;AAAA,EACJ;AACM,QAAA,EAAE,qBAAqB,0BAAA,IAA8BC,cAAA;AAAA,IACzDC,mFAAAA;AAAAA,EACF;AACA,QAAM,aAAaC,WAAA;AAAA,IACjB,MACE,gBAAgB,gBACX,SAAS,gBAAgB,aAAa,KACvC,SAAS,gBAAgB,aAAa,IACtC;AAAA,IACN,CAAC,QAAQ,QAAQ,gBAAgB,aAAa;AAAA,EAChD;AAEI,MAAA,UAAkB,QAAAC,iDAACC,wBAAAA,QAAO,CAAA,CAAA;AAE1B,MAAA,CAAC,gBAAgB,cAAsB,QAAA;AAEvC,MAAA,CAAC,WAAmB,QAAA;AAGtB,SAAAD,2BAAA,kBAAA;AAAA,IAACE,uDAAA;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EACF;AAEJ;;"}
1
+ {"version":3,"file":"DictionariesSelector.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.tsx"],"sourcesContent":["'use client';\n\nimport { Locales } from '@intlayer/config';\nimport { useFocusDictionary } from '@intlayer/editor-react';\nimport { useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useGetAllDictionaries } from '../../../hooks';\nimport { Loader } from '../../Loader';\nimport { DictionaryFieldEditor } from '../DictionaryFieldEditor';\nimport { dictionariesSelectorContent } from './dictionariesSelector.content';\n\ntype DictionariesSelectorProps = {\n onClickDictionaryList: () => void;\n isDarkMode?: boolean;\n availableLocales: Locales[];\n};\n\nexport const DictionariesSelector: FC<DictionariesSelectorProps> = ({\n onClickDictionaryList,\n isDarkMode,\n availableLocales,\n}) => {\n const { online, locale, isLoading } = useGetAllDictionaries();\n const { focusedContent } = useFocusDictionary();\n const { noDictionaryMessage, dictionaryNotFoundMessage } = useDictionary(\n dictionariesSelectorContent\n );\n const dictionary = useMemo(\n () =>\n focusedContent?.dictionaryKey\n ? (online?.[focusedContent?.dictionaryKey] ??\n locale?.[focusedContent?.dictionaryKey])\n : null,\n [online, locale, focusedContent?.dictionaryKey]\n );\n\n if (isLoading) return <Loader />;\n\n if (!focusedContent?.dictionaryKey) return noDictionaryMessage;\n\n if (!dictionary) return dictionaryNotFoundMessage;\n\n return (\n <DictionaryFieldEditor\n dictionary={dictionary}\n onClickDictionaryList={onClickDictionaryList}\n isDarkMode={isDarkMode}\n availableLocales={availableLocales}\n />\n );\n};\n"],"names":["useGetAllDictionaries","useFocusDictionary","useDictionary","dictionariesSelectorContent","useMemo","jsx","Loader","DictionaryFieldEditor"],"mappings":";;;;;;;;;;;;;;;;AAkBO,MAAM,uBAAsD,CAAC;AAAA,EAClE;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,EAAE,QAAQ,QAAQ,UAAA,IAAcA,4BAAAA,sBAAsB;AACtD,QAAA,EAAE,eAAe,IAAIC,+BAAmB;AACxC,QAAA,EAAE,qBAAqB,0BAAA,IAA8BC,cAAA;AAAA,IACzDC,mFAAAA;AAAAA,EACF;AACA,QAAM,aAAaC,WAAA;AAAA,IACjB,MACE,gBAAgB,gBACX,SAAS,gBAAgB,aAAa,KACvC,SAAS,gBAAgB,aAAa,IACtC;AAAA,IACN,CAAC,QAAQ,QAAQ,gBAAgB,aAAa;AAAA,EAChD;AAEI,MAAA,UAAkB,QAAAC,iDAACC,wBAAAA,QAAO,CAAA,CAAA;AAE1B,MAAA,CAAC,gBAAgB,cAAsB,QAAA;AAEvC,MAAA,CAAC,WAAmB,QAAA;AAGtB,SAAAD,2BAAA,kBAAA;AAAA,IAACE,uDAAA;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EACF;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DictionariesSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAW,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAUzC,KAAK,yBAAyB,GAAG;IAC/B,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,OAAO,EAAE,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CAqC9D,CAAC"}
1
+ {"version":3,"file":"DictionariesSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAW,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAQzC,KAAK,yBAAyB,GAAG;IAC/B,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,OAAO,EAAE,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CAiC9D,CAAC"}
@@ -1,28 +1,14 @@
1
1
  "use client";
2
2
  import { j as jsxRuntimeExports } from "../../../jsx-runtime-DQkoUcjV.js";
3
+ import { useFocusDictionary } from "@intlayer/editor-react";
3
4
  import { useMemo } from "react";
4
5
  import { useDictionary } from "react-intlayer";
5
- import { u as useShallow } from "../../../shallow-m9BpCkKh.js";
6
6
  import "../../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
7
7
  import "../../../hooks/useAsync/useAsyncStateStore.mjs";
8
- import "../../../index-DcWYZrJW.js";
8
+ import "@intlayer/api";
9
9
  import "@intlayer/config/client";
10
10
  import "../../Toaster/Toast.mjs";
11
11
  import { useGetAllDictionaries } from "../../../hooks/useGetAllDictionaries.mjs";
12
- import "../../DictionaryEditor/useEditedContentStore.mjs";
13
- import { useEditionPanelStore } from "../../DictionaryEditor/useEditionPanelStore.mjs";
14
- import "@intlayer/core";
15
- import "lucide-react";
16
- import "clsx";
17
- import "tailwind-merge";
18
- import "../../Button/Button.mjs";
19
- import "../../EditableField/EditableFieldInput.mjs";
20
- import "../../EditableField/EditableFieldTextArea.mjs";
21
- import "../../Form/FormBase.mjs";
22
- import "../../Form/FormField.mjs";
23
- import "../../../Form-DlqjTz3u.js";
24
- import "../../DictionaryEditor/validDictionaryChangeButtons.content.mjs";
25
- import "zod";
26
12
  import { Loader } from "../../Loader/index.mjs";
27
13
  import { DictionaryFieldEditor } from "../DictionaryFieldEditor.mjs";
28
14
  import { dictionariesSelectorContent } from "./dictionariesSelector.content.mjs";
@@ -32,11 +18,7 @@ const DictionariesSelector = ({
32
18
  availableLocales
33
19
  }) => {
34
20
  const { online, locale, isLoading } = useGetAllDictionaries();
35
- const { focusedContent } = useEditionPanelStore(
36
- useShallow((s) => ({
37
- focusedContent: s.focusedContent
38
- }))
39
- );
21
+ const { focusedContent } = useFocusDictionary();
40
22
  const { noDictionaryMessage, dictionaryNotFoundMessage } = useDictionary(
41
23
  dictionariesSelectorContent
42
24
  );
@@ -1 +1 @@
1
- {"version":3,"file":"DictionariesSelector.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.tsx"],"sourcesContent":["'use client';\n\nimport { Locales } from '@intlayer/config';\nimport { useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { useGetAllDictionaries } from '../../../hooks';\nimport { useEditionPanelStore } from '../../DictionaryEditor';\nimport { Loader } from '../../Loader';\nimport { DictionaryFieldEditor } from '../DictionaryFieldEditor';\nimport { dictionariesSelectorContent } from './dictionariesSelector.content';\n\ntype DictionariesSelectorProps = {\n onClickDictionaryList: () => void;\n isDarkMode?: boolean;\n availableLocales: Locales[];\n};\n\nexport const DictionariesSelector: FC<DictionariesSelectorProps> = ({\n onClickDictionaryList,\n isDarkMode,\n availableLocales,\n}) => {\n const { online, locale, isLoading } = useGetAllDictionaries();\n const { focusedContent } = useEditionPanelStore(\n useShallow((s) => ({\n focusedContent: s.focusedContent,\n }))\n );\n const { noDictionaryMessage, dictionaryNotFoundMessage } = useDictionary(\n dictionariesSelectorContent\n );\n const dictionary = useMemo(\n () =>\n focusedContent?.dictionaryKey\n ? (online?.[focusedContent?.dictionaryKey] ??\n locale?.[focusedContent?.dictionaryKey])\n : null,\n [online, locale, focusedContent?.dictionaryKey]\n );\n\n if (isLoading) return <Loader />;\n\n if (!focusedContent?.dictionaryKey) return noDictionaryMessage;\n\n if (!dictionary) return dictionaryNotFoundMessage;\n\n return (\n <DictionaryFieldEditor\n dictionary={dictionary}\n onClickDictionaryList={onClickDictionaryList}\n isDarkMode={isDarkMode}\n availableLocales={availableLocales}\n />\n );\n};\n"],"names":["jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBO,MAAM,uBAAsD,CAAC;AAAA,EAClE;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,EAAE,QAAQ,QAAQ,UAAA,IAAc,sBAAsB;AACtD,QAAA,EAAE,mBAAmB;AAAA,IACzB,WAAW,CAAC,OAAO;AAAA,MACjB,gBAAgB,EAAE;AAAA,IAAA,EAClB;AAAA,EACJ;AACM,QAAA,EAAE,qBAAqB,0BAAA,IAA8B;AAAA,IACzD;AAAA,EACF;AACA,QAAM,aAAa;AAAA,IACjB,MACE,gBAAgB,gBACX,SAAS,gBAAgB,aAAa,KACvC,SAAS,gBAAgB,aAAa,IACtC;AAAA,IACN,CAAC,QAAQ,QAAQ,gBAAgB,aAAa;AAAA,EAChD;AAEI,MAAA,UAAkB,QAAAA,sCAAC,QAAO,CAAA,CAAA;AAE1B,MAAA,CAAC,gBAAgB,cAAsB,QAAA;AAEvC,MAAA,CAAC,WAAmB,QAAA;AAGtB,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EACF;AAEJ;"}
1
+ {"version":3,"file":"DictionariesSelector.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.tsx"],"sourcesContent":["'use client';\n\nimport { Locales } from '@intlayer/config';\nimport { useFocusDictionary } from '@intlayer/editor-react';\nimport { useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useGetAllDictionaries } from '../../../hooks';\nimport { Loader } from '../../Loader';\nimport { DictionaryFieldEditor } from '../DictionaryFieldEditor';\nimport { dictionariesSelectorContent } from './dictionariesSelector.content';\n\ntype DictionariesSelectorProps = {\n onClickDictionaryList: () => void;\n isDarkMode?: boolean;\n availableLocales: Locales[];\n};\n\nexport const DictionariesSelector: FC<DictionariesSelectorProps> = ({\n onClickDictionaryList,\n isDarkMode,\n availableLocales,\n}) => {\n const { online, locale, isLoading } = useGetAllDictionaries();\n const { focusedContent } = useFocusDictionary();\n const { noDictionaryMessage, dictionaryNotFoundMessage } = useDictionary(\n dictionariesSelectorContent\n );\n const dictionary = useMemo(\n () =>\n focusedContent?.dictionaryKey\n ? (online?.[focusedContent?.dictionaryKey] ??\n locale?.[focusedContent?.dictionaryKey])\n : null,\n [online, locale, focusedContent?.dictionaryKey]\n );\n\n if (isLoading) return <Loader />;\n\n if (!focusedContent?.dictionaryKey) return noDictionaryMessage;\n\n if (!dictionary) return dictionaryNotFoundMessage;\n\n return (\n <DictionaryFieldEditor\n dictionary={dictionary}\n onClickDictionaryList={onClickDictionaryList}\n isDarkMode={isDarkMode}\n availableLocales={availableLocales}\n />\n );\n};\n"],"names":["jsx"],"mappings":";;;;;;;;;;;;;;AAkBO,MAAM,uBAAsD,CAAC;AAAA,EAClE;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,EAAE,QAAQ,QAAQ,UAAA,IAAc,sBAAsB;AACtD,QAAA,EAAE,eAAe,IAAI,mBAAmB;AACxC,QAAA,EAAE,qBAAqB,0BAAA,IAA8B;AAAA,IACzD;AAAA,EACF;AACA,QAAM,aAAa;AAAA,IACjB,MACE,gBAAgB,gBACX,SAAS,gBAAgB,aAAa,KACvC,SAAS,gBAAgB,aAAa,IACtC;AAAA,IACN,CAAC,QAAQ,QAAQ,gBAAgB,aAAa;AAAA,EAChD;AAEI,MAAA,UAAkB,QAAAA,sCAAC,QAAO,CAAA,CAAA;AAE1B,MAAA,CAAC,gBAAgB,cAAsB,QAAA;AAEvC,MAAA,CAAC,WAAmB,QAAA;AAGtB,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EACF;AAEJ;"}