@intlayer/design-system 5.1.3 → 5.1.5

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 (197) hide show
  1. package/dist/.vite/manifest.json +37 -102
  2. package/dist/Form-BZUDRfoN.js.map +1 -1
  3. package/dist/Form-yi0CMK-a.cjs.map +1 -1
  4. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs +1 -1
  5. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs +1 -1
  6. package/dist/components/Command/index.d.ts +1 -1
  7. package/dist/components/Container/index.cjs +6 -7
  8. package/dist/components/Container/index.cjs.map +1 -1
  9. package/dist/components/Container/index.mjs +6 -7
  10. package/dist/components/Container/index.mjs.map +1 -1
  11. package/dist/components/DictionaryEditor/DictionaryEditor.cjs +3 -3
  12. package/dist/components/DictionaryEditor/DictionaryEditor.cjs.map +1 -1
  13. package/dist/components/DictionaryEditor/DictionaryEditor.d.ts +1 -1
  14. package/dist/components/DictionaryEditor/DictionaryEditor.d.ts.map +1 -1
  15. package/dist/components/DictionaryEditor/DictionaryEditor.mjs +3 -3
  16. package/dist/components/DictionaryEditor/DictionaryEditor.mjs.map +1 -1
  17. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs +33 -20
  18. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs.map +1 -1
  19. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.d.ts.map +1 -1
  20. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs +34 -21
  21. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs.map +1 -1
  22. package/dist/components/DictionaryFieldEditor/ContentEditor.cjs +20 -9
  23. package/dist/components/DictionaryFieldEditor/ContentEditor.cjs.map +1 -1
  24. package/dist/components/DictionaryFieldEditor/ContentEditor.d.ts.map +1 -1
  25. package/dist/components/DictionaryFieldEditor/ContentEditor.mjs +21 -10
  26. package/dist/components/DictionaryFieldEditor/ContentEditor.mjs.map +1 -1
  27. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs +241 -209
  28. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs.map +1 -1
  29. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.d.ts +1 -0
  30. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.d.ts.map +1 -1
  31. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +245 -213
  32. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs.map +1 -1
  33. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs.map +1 -1
  34. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.d.ts +1 -1
  35. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.d.ts.map +1 -1
  36. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs.map +1 -1
  37. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +1 -1
  38. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +1 -1
  39. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +92 -120
  40. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map +1 -1
  41. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts +1 -1
  42. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts.map +1 -1
  43. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +94 -122
  44. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
  45. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs +0 -143
  46. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs.map +1 -1
  47. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts +0 -143
  48. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts.map +1 -1
  49. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs +0 -143
  50. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs.map +1 -1
  51. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.cjs +1 -2
  52. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.cjs.map +1 -1
  53. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.d.ts +0 -3
  54. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.d.ts.map +1 -1
  55. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.mjs +1 -2
  56. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.mjs.map +1 -1
  57. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs +51 -70
  58. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
  59. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts +1 -1
  60. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts.map +1 -1
  61. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +51 -70
  62. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
  63. package/dist/components/DictionaryFieldEditor/EnumKeyInput.cjs +1 -1
  64. package/dist/components/DictionaryFieldEditor/EnumKeyInput.cjs.map +1 -1
  65. package/dist/components/DictionaryFieldEditor/EnumKeyInput.mjs +1 -1
  66. package/dist/components/DictionaryFieldEditor/EnumKeyInput.mjs.map +1 -1
  67. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs +18 -12
  68. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs.map +1 -1
  69. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.d.ts.map +1 -1
  70. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +19 -13
  71. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
  72. package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.cjs +64 -0
  73. package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.cjs.map +1 -1
  74. package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts +64 -0
  75. package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts.map +1 -1
  76. package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.mjs +64 -0
  77. package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.mjs.map +1 -1
  78. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +52 -103
  79. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
  80. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts +3 -3
  81. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts.map +1 -1
  82. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +56 -107
  83. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
  84. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs +0 -32
  85. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs.map +1 -1
  86. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts +0 -32
  87. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts.map +1 -1
  88. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs +0 -32
  89. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs.map +1 -1
  90. package/dist/components/DictionaryFieldEditor/StructureEditor.cjs +4 -4
  91. package/dist/components/DictionaryFieldEditor/StructureEditor.cjs.map +1 -1
  92. package/dist/components/DictionaryFieldEditor/StructureEditor.d.ts.map +1 -1
  93. package/dist/components/DictionaryFieldEditor/StructureEditor.mjs +4 -4
  94. package/dist/components/DictionaryFieldEditor/StructureEditor.mjs.map +1 -1
  95. package/dist/components/DictionaryFieldEditor/StructureView/StructureView.cjs +3 -2
  96. package/dist/components/DictionaryFieldEditor/StructureView/StructureView.cjs.map +1 -1
  97. package/dist/components/DictionaryFieldEditor/StructureView/StructureView.d.ts.map +1 -1
  98. package/dist/components/DictionaryFieldEditor/StructureView/StructureView.mjs +3 -2
  99. package/dist/components/DictionaryFieldEditor/StructureView/StructureView.mjs.map +1 -1
  100. package/dist/components/DictionaryFieldEditor/index.cjs +0 -2
  101. package/dist/components/DictionaryFieldEditor/index.cjs.map +1 -1
  102. package/dist/components/DictionaryFieldEditor/index.d.ts +0 -1
  103. package/dist/components/DictionaryFieldEditor/index.d.ts.map +1 -1
  104. package/dist/components/DictionaryFieldEditor/index.mjs +0 -2
  105. package/dist/components/DictionaryFieldEditor/index.mjs.map +1 -1
  106. package/dist/components/Form/FormBase.cjs +0 -1
  107. package/dist/components/Form/FormBase.cjs.map +1 -1
  108. package/dist/components/Form/FormBase.d.ts +1 -4
  109. package/dist/components/Form/FormBase.d.ts.map +1 -1
  110. package/dist/components/Form/FormBase.mjs +0 -1
  111. package/dist/components/Form/FormBase.mjs.map +1 -1
  112. package/dist/components/Form/elements/EditableFieldInputElement.d.ts +1 -1
  113. package/dist/components/Form/elements/EditableFieldInputElement.d.ts.map +1 -1
  114. package/dist/components/Form/elements/EditableFieldTextAreaElement.d.ts +1 -1
  115. package/dist/components/Form/elements/EditableFieldTextAreaElement.d.ts.map +1 -1
  116. package/dist/components/Input/Checkbox.cjs +0 -1
  117. package/dist/components/Input/Checkbox.cjs.map +1 -1
  118. package/dist/components/Input/Checkbox.mjs +0 -1
  119. package/dist/components/Input/Checkbox.mjs.map +1 -1
  120. package/dist/components/Input/Input.cjs +1 -1
  121. package/dist/components/Input/Input.cjs.map +1 -1
  122. package/dist/components/Input/Input.mjs +1 -1
  123. package/dist/components/Input/Input.mjs.map +1 -1
  124. package/dist/components/KeyboardScreenAdapter/index.cjs +25 -0
  125. package/dist/components/KeyboardScreenAdapter/index.cjs.map +1 -0
  126. package/dist/components/KeyboardScreenAdapter/index.d.ts +3 -0
  127. package/dist/components/KeyboardScreenAdapter/index.d.ts.map +1 -0
  128. package/dist/components/KeyboardScreenAdapter/index.mjs +25 -0
  129. package/dist/components/KeyboardScreenAdapter/index.mjs.map +1 -0
  130. package/dist/components/MaxHeightSmoother/index.cjs +3 -1
  131. package/dist/components/MaxHeightSmoother/index.cjs.map +1 -1
  132. package/dist/components/MaxHeightSmoother/index.d.ts.map +1 -1
  133. package/dist/components/MaxHeightSmoother/index.mjs +3 -1
  134. package/dist/components/MaxHeightSmoother/index.mjs.map +1 -1
  135. package/dist/components/Modal/Modal.cjs +15 -13
  136. package/dist/components/Modal/Modal.cjs.map +1 -1
  137. package/dist/components/Modal/Modal.d.ts.map +1 -1
  138. package/dist/components/Modal/Modal.mjs +15 -13
  139. package/dist/components/Modal/Modal.mjs.map +1 -1
  140. package/dist/components/RightDrawer/RightDrawer.cjs +1 -1
  141. package/dist/components/RightDrawer/RightDrawer.cjs.map +1 -1
  142. package/dist/components/RightDrawer/RightDrawer.mjs +1 -1
  143. package/dist/components/RightDrawer/RightDrawer.mjs.map +1 -1
  144. package/dist/components/Select/Multiselect.cjs +0 -1
  145. package/dist/components/Select/Multiselect.cjs.map +1 -1
  146. package/dist/components/Select/Multiselect.d.ts.map +1 -1
  147. package/dist/components/Select/Multiselect.mjs +1 -2
  148. package/dist/components/Select/Multiselect.mjs.map +1 -1
  149. package/dist/components/Select/Select.cjs +0 -1
  150. package/dist/components/Select/Select.cjs.map +1 -1
  151. package/dist/components/Select/Select.d.ts.map +1 -1
  152. package/dist/components/Select/Select.mjs +0 -1
  153. package/dist/components/Select/Select.mjs.map +1 -1
  154. package/dist/components/index.cjs +2 -2
  155. package/dist/components/index.d.ts +1 -0
  156. package/dist/components/index.d.ts.map +1 -1
  157. package/dist/components/index.mjs +2 -2
  158. package/dist/hooks/index.cjs +2 -0
  159. package/dist/hooks/index.cjs.map +1 -1
  160. package/dist/hooks/index.d.ts +1 -0
  161. package/dist/hooks/index.d.ts.map +1 -1
  162. package/dist/hooks/index.mjs +2 -0
  163. package/dist/hooks/index.mjs.map +1 -1
  164. package/dist/hooks/intlayerAPIHooks.cjs +1 -1
  165. package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
  166. package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
  167. package/dist/hooks/intlayerAPIHooks.mjs +1 -1
  168. package/dist/hooks/intlayerAPIHooks.mjs.map +1 -1
  169. package/dist/hooks/useAsync/useAsyncStateStore.cjs +8 -14
  170. package/dist/hooks/useAsync/useAsyncStateStore.cjs.map +1 -1
  171. package/dist/hooks/useAsync/useAsyncStateStore.d.ts.map +1 -1
  172. package/dist/hooks/useAsync/useAsyncStateStore.mjs +8 -14
  173. package/dist/hooks/useAsync/useAsyncStateStore.mjs.map +1 -1
  174. package/dist/hooks/useKeyboardDetector.cjs +27 -0
  175. package/dist/hooks/useKeyboardDetector.cjs.map +1 -0
  176. package/dist/hooks/useKeyboardDetector.d.ts +5 -0
  177. package/dist/hooks/useKeyboardDetector.d.ts.map +1 -0
  178. package/dist/hooks/useKeyboardDetector.mjs +27 -0
  179. package/dist/hooks/useKeyboardDetector.mjs.map +1 -0
  180. package/dist/{index-BTDHuTxL.js → index-B1w5h_6-.js} +7 -7
  181. package/dist/index-B1w5h_6-.js.map +1 -0
  182. package/dist/index-BCuMWKyy.js.map +1 -1
  183. package/dist/index-BYzBot7l.cjs.map +1 -1
  184. package/dist/{index-Db5Dym4h.cjs → index-U1U6ySIn.cjs} +7 -7
  185. package/dist/index-U1U6ySIn.cjs.map +1 -0
  186. package/dist/tailwind.css +1 -1
  187. package/dist/zod-BV4nCGJE.js.map +1 -1
  188. package/dist/zod-DSrtTSD_.cjs.map +1 -1
  189. package/package.json +19 -19
  190. package/dist/components/DictionaryFieldEditor/ContentEditorView/EditorView.cjs +0 -49
  191. package/dist/components/DictionaryFieldEditor/ContentEditorView/EditorView.cjs.map +0 -1
  192. package/dist/components/DictionaryFieldEditor/ContentEditorView/EditorView.d.ts +0 -10
  193. package/dist/components/DictionaryFieldEditor/ContentEditorView/EditorView.d.ts.map +0 -1
  194. package/dist/components/DictionaryFieldEditor/ContentEditorView/EditorView.mjs +0 -49
  195. package/dist/components/DictionaryFieldEditor/ContentEditorView/EditorView.mjs.map +0 -1
  196. package/dist/index-BTDHuTxL.js.map +0 -1
  197. package/dist/index-Db5Dym4h.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ContentEditor.d.ts","sourceRoot":"","sources":["../../../src/components/DictionaryFieldEditor/ContentEditor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAOhC,KAAK,eAAe,GAAG;IACrB,UAAU,EAAE,UAAU,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,eAAe,CAqD7C,CAAC"}
1
+ {"version":3,"file":"ContentEditor.d.ts","sourceRoot":"","sources":["../../../src/components/DictionaryFieldEditor/ContentEditor.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA2B,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE1E,OAAO,EAAa,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAQ3C,KAAK,eAAe,GAAG;IACrB,UAAU,EAAE,UAAU,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,eAAe,CAgE7C,CAAC"}
@@ -1,23 +1,33 @@
1
1
  "use client";
2
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import { jsxs, jsx } from "react/jsx-runtime";
3
+ import { getContentNodeByKeyPath } from "@intlayer/core";
3
4
  import { useEditedContent, useFocusDictionary } from "@intlayer/editor-react";
5
+ import { useEffect } from "react";
4
6
  import { Container } from "../Container/index.mjs";
5
7
  import { LocaleSwitcherContent } from "../LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs";
6
8
  import "../LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs";
7
- import { EditorView } from "./ContentEditorView/EditorView.mjs";
9
+ import { TextEditorContainer } from "./ContentEditorView/TextEditor.mjs";
10
+ import { getIsEditableSection } from "./getIsEditableSection.mjs";
8
11
  import { KeyPathBreadcrumb } from "./KeyPathBreadcrumb.mjs";
9
12
  import { NavigationViewNode } from "./NavigationView/NavigationViewNode.mjs";
10
13
  const ContentEditor = ({
11
14
  dictionary,
12
15
  isDarkMode
13
16
  }) => {
14
- const { content: dictionaryContent, key } = dictionary;
17
+ const { content, key } = dictionary;
15
18
  const { editedContent } = useEditedContent();
16
19
  const { focusedContent, setFocusedContentKeyPath } = useFocusDictionary();
17
20
  const focusedKeyPath = focusedContent?.keyPath;
18
- const section = editedContent?.[key]?.content ?? dictionaryContent;
19
- return /* @__PURE__ */ jsxs(Fragment, { children: [
20
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
21
+ const section = typeof editedContent?.[dictionary.key]?.content === "undefined" ? content : editedContent?.[key]?.content;
22
+ const focusedSection = getContentNodeByKeyPath(section, focusedKeyPath ?? []);
23
+ const isEditableFocusedSection = getIsEditableSection(focusedSection);
24
+ useEffect(() => {
25
+ if (typeof focusedSection === "undefined") {
26
+ setFocusedContentKeyPath(focusedContent?.keyPath?.slice(0, -1) ?? []);
27
+ }
28
+ }, []);
29
+ return /* @__PURE__ */ jsxs("div", { children: [
30
+ /* @__PURE__ */ jsxs("div", { className: "mb-6 flex items-center justify-between gap-2", children: [
21
31
  /* @__PURE__ */ jsx(
22
32
  KeyPathBreadcrumb,
23
33
  {
@@ -47,14 +57,15 @@ const ContentEditor = ({
47
57
  )
48
58
  }
49
59
  ),
50
- /* @__PURE__ */ jsx("div", { className: "top-6 flex h-full flex-1 flex-col gap-6 md:sticky", children: /* @__PURE__ */ jsx(
51
- EditorView,
60
+ (isEditableFocusedSection || (focusedKeyPath ?? []).length > 0) && /* @__PURE__ */ jsx(
61
+ TextEditorContainer,
52
62
  {
63
+ keyPath: focusedKeyPath ?? [],
64
+ section: focusedSection,
53
65
  dictionary,
54
- dictionaryKey: key,
55
66
  isDarkMode
56
67
  }
57
- ) })
68
+ )
58
69
  ] })
59
70
  ] });
60
71
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ContentEditor.mjs","sources":["../../../src/components/DictionaryFieldEditor/ContentEditor.tsx"],"sourcesContent":["'use client';\n\nimport type { Dictionary } from '@intlayer/core';\nimport { useEditedContent, useFocusDictionary } from '@intlayer/editor-react';\nimport { type FC } from 'react';\nimport { Container } from '../Container';\nimport { LocaleSwitcherContent } from '../LocaleSwitcherContentDropDown';\nimport { EditorView } from './ContentEditorView/EditorView';\nimport { KeyPathBreadcrumb } from './KeyPathBreadcrumb';\nimport { NavigationViewNode } from './NavigationView/NavigationViewNode';\n\ntype NodeEditorProps = {\n dictionary: Dictionary;\n isDarkMode?: boolean;\n};\n\nexport const ContentEditor: FC<NodeEditorProps> = ({\n dictionary,\n isDarkMode,\n}) => {\n const { content: dictionaryContent, key } = dictionary;\n const { editedContent } = useEditedContent();\n const { focusedContent, setFocusedContentKeyPath } = useFocusDictionary();\n\n const focusedKeyPath = focusedContent?.keyPath;\n\n const section = editedContent?.[key]?.content ?? dictionaryContent;\n\n return (\n <>\n <div className=\"flex items-center justify-between gap-2\">\n <KeyPathBreadcrumb\n dictionaryKey={key}\n keyPath={focusedKeyPath ?? []}\n onClickKeyPath={setFocusedContentKeyPath}\n />\n <div className=\"flex items-center gap-2\">\n <LocaleSwitcherContent />\n </div>\n </div>\n\n <div className=\"flex gap-2 max-md:flex-col\">\n {typeof section === 'object' &&\n section &&\n Object.keys(section).length > 0 && (\n <Container\n border\n background=\"none\"\n className=\"top-6 flex h-full flex-col items-start gap-0.5 overflow-auto p-2 md:sticky md:max-w-[50%]\"\n roundedSize=\"xl\"\n transparency=\"sm\"\n >\n <NavigationViewNode\n keyPath={[]}\n section={section}\n dictionaryKey={key}\n />\n </Container>\n )}\n <div className=\"top-6 flex h-full flex-1 flex-col gap-6 md:sticky\">\n <EditorView\n dictionary={dictionary}\n dictionaryKey={key}\n isDarkMode={isDarkMode}\n />\n </div>\n </div>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAgBO,MAAM,gBAAqC,CAAC;AAAA,EACjD;AAAA,EACA;AACF,MAAM;AACJ,QAAM,EAAE,SAAS,mBAAmB,IAAQ,IAAA;AACtC,QAAA,EAAE,cAAc,IAAI,iBAAiB;AAC3C,QAAM,EAAE,gBAAgB,yBAAyB,IAAI,mBAAmB;AAExE,QAAM,iBAAiB,gBAAgB;AAEvC,QAAM,UAAU,gBAAgB,GAAG,GAAG,WAAW;AAEjD,SAEI,qBAAA,UAAA,EAAA,UAAA;AAAA,IAAC,qBAAA,OAAA,EAAI,WAAU,2CACb,UAAA;AAAA,MAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,eAAe;AAAA,UACf,SAAS,kBAAkB,CAAC;AAAA,UAC5B,gBAAgB;AAAA,QAAA;AAAA,MAClB;AAAA,0BACC,OAAI,EAAA,WAAU,2BACb,UAAA,oBAAC,yBAAsB,EACzB,CAAA;AAAA,IAAA,GACF;AAAA,IAEA,qBAAC,OAAI,EAAA,WAAU,8BACZ,UAAA;AAAA,MAAO,OAAA,YAAY,YAClB,WACA,OAAO,KAAK,OAAO,EAAE,SAAS,KAC5B;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,QAAM;AAAA,UACN,YAAW;AAAA,UACX,WAAU;AAAA,UACV,aAAY;AAAA,UACZ,cAAa;AAAA,UAEb,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,SAAS,CAAC;AAAA,cACV;AAAA,cACA,eAAe;AAAA,YAAA;AAAA,UAAA;AAAA,QACjB;AAAA,MACF;AAAA,MAEJ,oBAAC,OAAI,EAAA,WAAU,qDACb,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC;AAAA,UACA,eAAe;AAAA,UACf;AAAA,QAAA;AAAA,MAAA,EAEJ,CAAA;AAAA,IAAA,EACF,CAAA;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"ContentEditor.mjs","sources":["../../../src/components/DictionaryFieldEditor/ContentEditor.tsx"],"sourcesContent":["'use client';\n\nimport { getContentNodeByKeyPath, type Dictionary } from '@intlayer/core';\nimport { useEditedContent, useFocusDictionary } from '@intlayer/editor-react';\nimport { useEffect, type FC } from 'react';\nimport { Container } from '../Container';\nimport { LocaleSwitcherContent } from '../LocaleSwitcherContentDropDown';\nimport { TextEditorContainer } from './ContentEditorView/TextEditor';\nimport { getIsEditableSection } from './getIsEditableSection';\nimport { KeyPathBreadcrumb } from './KeyPathBreadcrumb';\nimport { NavigationViewNode } from './NavigationView/NavigationViewNode';\n\ntype NodeEditorProps = {\n dictionary: Dictionary;\n isDarkMode?: boolean;\n};\n\nexport const ContentEditor: FC<NodeEditorProps> = ({\n dictionary,\n isDarkMode,\n}) => {\n const { content, key } = dictionary;\n const { editedContent } = useEditedContent();\n const { focusedContent, setFocusedContentKeyPath } = useFocusDictionary();\n\n const focusedKeyPath = focusedContent?.keyPath;\n const section =\n typeof editedContent?.[dictionary.key]?.content === 'undefined'\n ? content\n : editedContent?.[key]?.content;\n\n const focusedSection = getContentNodeByKeyPath(section, focusedKeyPath ?? []);\n const isEditableFocusedSection = getIsEditableSection(focusedSection);\n\n useEffect(() => {\n if (typeof focusedSection === 'undefined') {\n setFocusedContentKeyPath(focusedContent?.keyPath?.slice(0, -1) ?? []);\n }\n }, []);\n\n return (\n <div>\n <div className=\"mb-6 flex items-center justify-between gap-2\">\n <KeyPathBreadcrumb\n dictionaryKey={key}\n keyPath={focusedKeyPath ?? []}\n onClickKeyPath={setFocusedContentKeyPath}\n />\n <div className=\"flex items-center gap-2\">\n <LocaleSwitcherContent />\n </div>\n </div>\n <div className=\"flex gap-2 max-md:flex-col\">\n {typeof section === 'object' &&\n section &&\n Object.keys(section).length > 0 && (\n <Container\n border\n background=\"none\"\n className=\"top-6 flex h-full flex-col items-start gap-0.5 overflow-auto p-2 md:sticky md:max-w-[50%]\"\n roundedSize=\"xl\"\n transparency=\"sm\"\n >\n <NavigationViewNode\n keyPath={[]}\n section={section}\n dictionaryKey={key}\n />\n </Container>\n )}\n {(isEditableFocusedSection || (focusedKeyPath ?? []).length > 0) && (\n <TextEditorContainer\n keyPath={focusedKeyPath ?? []}\n section={focusedSection}\n dictionary={dictionary}\n isDarkMode={isDarkMode}\n />\n )}\n </div>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAiBO,MAAM,gBAAqC,CAAC;AAAA,EACjD;AAAA,EACA;AACF,MAAM;AACE,QAAA,EAAE,SAAS,IAAA,IAAQ;AACnB,QAAA,EAAE,cAAc,IAAI,iBAAiB;AAC3C,QAAM,EAAE,gBAAgB,yBAAyB,IAAI,mBAAmB;AAExE,QAAM,iBAAiB,gBAAgB;AACjC,QAAA,UACJ,OAAO,gBAAgB,WAAW,GAAG,GAAG,YAAY,cAChD,UACA,gBAAgB,GAAG,GAAG;AAE5B,QAAM,iBAAiB,wBAAwB,SAAS,kBAAkB,CAAA,CAAE;AACtE,QAAA,2BAA2B,qBAAqB,cAAc;AAEpE,YAAU,MAAM;AACV,QAAA,OAAO,mBAAmB,aAAa;AACzC,+BAAyB,gBAAgB,SAAS,MAAM,GAAG,EAAE,KAAK,EAAE;AAAA,IAAA;AAAA,EAExE,GAAG,EAAE;AAEL,8BACG,OACC,EAAA,UAAA;AAAA,IAAC,qBAAA,OAAA,EAAI,WAAU,gDACb,UAAA;AAAA,MAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,eAAe;AAAA,UACf,SAAS,kBAAkB,CAAC;AAAA,UAC5B,gBAAgB;AAAA,QAAA;AAAA,MAClB;AAAA,0BACC,OAAI,EAAA,WAAU,2BACb,UAAA,oBAAC,yBAAsB,EACzB,CAAA;AAAA,IAAA,GACF;AAAA,IACA,qBAAC,OAAI,EAAA,WAAU,8BACZ,UAAA;AAAA,MAAO,OAAA,YAAY,YAClB,WACA,OAAO,KAAK,OAAO,EAAE,SAAS,KAC5B;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,QAAM;AAAA,UACN,YAAW;AAAA,UACX,WAAU;AAAA,UACV,aAAY;AAAA,UACZ,cAAa;AAAA,UAEb,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,SAAS,CAAC;AAAA,cACV;AAAA,cACA,eAAe;AAAA,YAAA;AAAA,UAAA;AAAA,QACjB;AAAA,MACF;AAAA,OAEF,6BAA6B,kBAAkB,CAAC,GAAG,SAAS,MAC5D;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,SAAS,kBAAkB,CAAC;AAAA,UAC5B,SAAS;AAAA,UACT;AAAA,UACA;AAAA,QAAA;AAAA,MAAA;AAAA,IACF,EAEJ,CAAA;AAAA,EAAA,GACF;AAEJ;"}