@intlayer/design-system 5.1.3 → 5.1.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 (62) hide show
  1. package/dist/.vite/manifest.json +3 -14
  2. package/dist/components/Container/index.cjs +1 -1
  3. package/dist/components/Container/index.cjs.map +1 -1
  4. package/dist/components/Container/index.mjs +1 -1
  5. package/dist/components/Container/index.mjs.map +1 -1
  6. package/dist/components/DictionaryFieldEditor/ContentEditor.cjs +18 -7
  7. package/dist/components/DictionaryFieldEditor/ContentEditor.cjs.map +1 -1
  8. package/dist/components/DictionaryFieldEditor/ContentEditor.d.ts.map +1 -1
  9. package/dist/components/DictionaryFieldEditor/ContentEditor.mjs +18 -7
  10. package/dist/components/DictionaryFieldEditor/ContentEditor.mjs.map +1 -1
  11. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs +233 -204
  12. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs.map +1 -1
  13. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.d.ts +1 -0
  14. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.d.ts.map +1 -1
  15. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +237 -208
  16. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs.map +1 -1
  17. package/dist/components/DictionaryFieldEditor/EnumKeyInput.cjs +1 -1
  18. package/dist/components/DictionaryFieldEditor/EnumKeyInput.cjs.map +1 -1
  19. package/dist/components/DictionaryFieldEditor/EnumKeyInput.mjs +1 -1
  20. package/dist/components/DictionaryFieldEditor/EnumKeyInput.mjs.map +1 -1
  21. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs +18 -12
  22. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs.map +1 -1
  23. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.d.ts.map +1 -1
  24. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +19 -13
  25. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
  26. package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.cjs +64 -0
  27. package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.cjs.map +1 -1
  28. package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts +64 -0
  29. package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts.map +1 -1
  30. package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.mjs +64 -0
  31. package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.mjs.map +1 -1
  32. package/dist/components/DictionaryFieldEditor/StructureEditor.cjs +4 -4
  33. package/dist/components/DictionaryFieldEditor/StructureEditor.cjs.map +1 -1
  34. package/dist/components/DictionaryFieldEditor/StructureEditor.d.ts.map +1 -1
  35. package/dist/components/DictionaryFieldEditor/StructureEditor.mjs +4 -4
  36. package/dist/components/DictionaryFieldEditor/StructureEditor.mjs.map +1 -1
  37. package/dist/components/DictionaryFieldEditor/StructureView/StructureView.cjs +2 -2
  38. package/dist/components/DictionaryFieldEditor/StructureView/StructureView.cjs.map +1 -1
  39. package/dist/components/DictionaryFieldEditor/StructureView/StructureView.mjs +2 -2
  40. package/dist/components/DictionaryFieldEditor/StructureView/StructureView.mjs.map +1 -1
  41. package/dist/components/MaxHeightSmoother/index.cjs +1 -1
  42. package/dist/components/MaxHeightSmoother/index.cjs.map +1 -1
  43. package/dist/components/MaxHeightSmoother/index.d.ts.map +1 -1
  44. package/dist/components/MaxHeightSmoother/index.mjs +1 -1
  45. package/dist/components/MaxHeightSmoother/index.mjs.map +1 -1
  46. package/dist/hooks/intlayerAPIHooks.cjs +1 -1
  47. package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
  48. package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
  49. package/dist/hooks/intlayerAPIHooks.mjs +1 -1
  50. package/dist/hooks/intlayerAPIHooks.mjs.map +1 -1
  51. package/dist/index-BCuMWKyy.js.map +1 -1
  52. package/dist/index-BYzBot7l.cjs.map +1 -1
  53. package/dist/tailwind.css +1 -1
  54. package/dist/zod-BV4nCGJE.js.map +1 -1
  55. package/dist/zod-DSrtTSD_.cjs.map +1 -1
  56. package/package.json +19 -19
  57. package/dist/components/DictionaryFieldEditor/ContentEditorView/EditorView.cjs +0 -49
  58. package/dist/components/DictionaryFieldEditor/ContentEditorView/EditorView.cjs.map +0 -1
  59. package/dist/components/DictionaryFieldEditor/ContentEditorView/EditorView.d.ts +0 -10
  60. package/dist/components/DictionaryFieldEditor/ContentEditorView/EditorView.d.ts.map +0 -1
  61. package/dist/components/DictionaryFieldEditor/ContentEditorView/EditorView.mjs +0 -49
  62. package/dist/components/DictionaryFieldEditor/ContentEditorView/EditorView.mjs.map +0 -1
@@ -1,9 +1,9 @@
1
1
  "use client";
2
- import { jsx, Fragment, jsxs } from "react/jsx-runtime";
3
- import { getNodeType, NodeType, getLocaleName } from "@intlayer/core";
2
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
3
+ import { getNodeType, NodeType, getLocaleName, getEmptyNode } from "@intlayer/core";
4
4
  import { useEditedContent, useConfiguration } from "@intlayer/editor-react";
5
- import { X, Plus, WandSparkles } from "lucide-react";
6
- import { useState } from "react";
5
+ import { Trash, Plus, WandSparkles } from "lucide-react";
6
+ import { Fragment as Fragment$1, useState } from "react";
7
7
  import { useDictionary, useLocale } from "react-intlayer";
8
8
  import "../../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
9
9
  import "../../../hooks/useAsync/useAsyncStateStore.mjs";
@@ -11,12 +11,12 @@ import { useAuditContentDeclarationField } from "../../../hooks/intlayerAPIHooks
11
11
  import "deepmerge";
12
12
  import { renameKey } from "../../../utils/object.mjs";
13
13
  import { Button } from "../../Button/Button.mjs";
14
+ import { Container } from "../../Container/index.mjs";
14
15
  import { ContentEditorInput as ContentEditorInput$1 } from "../../ContentEditor/ContentEditorInput.mjs";
15
16
  import { ContentEditorTextArea as ContentEditorTextArea$1 } from "../../ContentEditor/ContentEditorTextArea.mjs";
16
17
  import { Label } from "../../Label/index.mjs";
17
18
  import "@intlayer/config/client";
18
19
  import "fuse.js";
19
- import "../../Container/index.mjs";
20
20
  import "../../DropDown/index.mjs";
21
21
  import "../../Input/Input.mjs";
22
22
  import "../../Input/Checkbox.mjs";
@@ -25,7 +25,6 @@ import "../../LocaleSwitcherContentDropDown/localeSwitcher.content.mjs";
25
25
  import { useLocaleSwitcherContent } from "../../LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs";
26
26
  import { MarkdownRenderer } from "../../MarkDownRender/index.mjs";
27
27
  import { EnumKeyInput } from "../EnumKeyInput.mjs";
28
- import { getIsEditableSection } from "../getIsEditableSection.mjs";
29
28
  import { navigationViewContent } from "../NavigationView/navigationViewNode.content.mjs";
30
29
  const traceKeys = ["filePath", "id", "nodeType"];
31
30
  const ContentEditorTextArea = ({
@@ -120,7 +119,7 @@ const TranslationTextEditor = ({
120
119
  keyPath,
121
120
  dictionary
122
121
  }) => {
123
- const { locale } = useLocale();
122
+ const { locale, defaultLocale } = useLocale();
124
123
  const { selectedLocales, availableLocales } = useLocaleSwitcherContent();
125
124
  const sectionContent = section[NodeType.Translation];
126
125
  const sectionContentKeys = Object.keys(sectionContent);
@@ -129,20 +128,21 @@ const TranslationTextEditor = ({
129
128
  // If the translation include content in other locales, we display all of them
130
129
  [.../* @__PURE__ */ new Set([...availableLocales, ...sectionContentKeys])]
131
130
  );
132
- return /* @__PURE__ */ jsx("table", { className: "w-full gap-2", children: /* @__PURE__ */ jsx("tbody", { className: "divide-y-[1.5px]", children: localesList.map((translationKey) => /* @__PURE__ */ jsx("tr", { className: "w-full", lang: translationKey, children: /* @__PURE__ */ jsxs("td", { className: "flex w-full flex-col p-2", children: [
133
- selectedLocales.length > 1 && /* @__PURE__ */ jsx("span", { className: "w-full p-2 text-xs", children: getLocaleName(translationKey, locale) }),
134
- /* @__PURE__ */ jsx(
135
- TextEditor,
131
+ const content = section[NodeType.Translation];
132
+ return /* @__PURE__ */ jsx("table", { className: "w-full", children: /* @__PURE__ */ jsx("tbody", { className: "flex w-full flex-col gap-2", children: localesList.map((translationKey) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
133
+ /* @__PURE__ */ jsx("tr", { className: "mt-2 w-full p-2 text-xs", children: getLocaleName(translationKey, locale) }),
134
+ /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
135
+ TextEditorContainer,
136
136
  {
137
- section: section[NodeType.Translation][translationKey],
137
+ section: content[translationKey] ?? getEmptyNode(content[defaultLocale]),
138
138
  keyPath: [
139
139
  ...keyPath,
140
140
  { type: NodeType.Translation, key: translationKey }
141
141
  ],
142
142
  dictionary
143
143
  }
144
- )
145
- ] }) }, translationKey)) }) });
144
+ ) })
145
+ ] }, translationKey)) }) });
146
146
  };
147
147
  const EnumerationTextEditor = ({
148
148
  section,
@@ -150,31 +150,37 @@ const EnumerationTextEditor = ({
150
150
  dictionary
151
151
  }) => {
152
152
  const { addEditedContent } = useEditedContent();
153
- const { addNewEnumeration } = useDictionary(navigationViewContent);
154
- return /* @__PURE__ */ jsxs("table", { className: "w-full table-fixed gap-2", children: [
155
- /* @__PURE__ */ jsx("tbody", { className: "divide-y-[1.5px]", children: Object.keys(
153
+ const { addNewEnumeration, removeEnumeration } = useDictionary(
154
+ navigationViewContent
155
+ );
156
+ const content = section[NodeType.Enumeration];
157
+ const firstKey = Object.keys(content)[0];
158
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
159
+ /* @__PURE__ */ jsx("table", { className: "w-full", children: /* @__PURE__ */ jsx("tbody", { className: "flex w-full flex-col gap-2", children: Object.keys(
156
160
  section[NodeType.Enumeration]
157
- ).map((enumKey) => /* @__PURE__ */ jsxs("tr", { className: "w-full", children: [
158
- /* @__PURE__ */ jsx("td", { className: "w-44 p-2", children: /* @__PURE__ */ jsxs("div", { className: "flex gap-1", children: [
159
- /* @__PURE__ */ jsx(
161
+ ).map((enumKey) => {
162
+ const childrenKeyPath = [
163
+ ...keyPath,
164
+ { type: NodeType.Enumeration }
165
+ ];
166
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
167
+ /* @__PURE__ */ jsx("tr", { className: "mt-2 w-full", children: /* @__PURE__ */ jsx("div", { className: "flex flex-1", children: /* @__PURE__ */ jsx(
160
168
  Button,
161
169
  {
162
- label: "Remove",
170
+ label: removeEnumeration.label.value,
163
171
  variant: "hoverable",
164
- size: "icon-md",
165
172
  color: "text",
166
- Icon: X,
167
- className: "w-16",
168
- onClick: () => addEditedContent(dictionary.key, void 0, [
169
- ...keyPath,
170
- {
171
- type: NodeType.Enumeration,
172
- key: enumKey
173
- }
174
- ])
173
+ Icon: Trash,
174
+ className: "ml-auto",
175
+ onClick: () => addEditedContent(
176
+ dictionary.key,
177
+ void 0,
178
+ childrenKeyPath
179
+ ),
180
+ children: removeEnumeration.text
175
181
  }
176
- ),
177
- /* @__PURE__ */ jsx(
182
+ ) }) }),
183
+ /* @__PURE__ */ jsx("tr", { className: "w-full p-2", children: /* @__PURE__ */ jsx(
178
184
  EnumKeyInput,
179
185
  {
180
186
  value: enumKey,
@@ -192,38 +198,35 @@ const EnumerationTextEditor = ({
192
198
  addEditedContent(dictionary.key, newValue, keyPath);
193
199
  }
194
200
  }
195
- )
196
- ] }) }),
197
- /* @__PURE__ */ jsx("td", { className: "w-full p-2", children: /* @__PURE__ */ jsx(
198
- TextEditor,
199
- {
200
- section: section[NodeType.Enumeration][enumKey],
201
- keyPath: [
202
- ...keyPath,
203
- { type: NodeType.Enumeration, key: enumKey }
204
- ],
205
- dictionary
206
- }
207
- ) })
208
- ] }, enumKey)) }),
209
- /* @__PURE__ */ jsx("tfoot", { children: /* @__PURE__ */ jsx(
201
+ ) }),
202
+ /* @__PURE__ */ jsx("tr", { className: "block w-full", children: /* @__PURE__ */ jsx(
203
+ TextEditor,
204
+ {
205
+ section: content[enumKey] ?? getEmptyNode(content[firstKey]),
206
+ keyPath: childrenKeyPath,
207
+ dictionary
208
+ }
209
+ ) })
210
+ ] }, enumKey);
211
+ }) }) }),
212
+ /* @__PURE__ */ jsx(
210
213
  Button,
211
214
  {
212
215
  label: addNewEnumeration.label.value,
213
216
  variant: "hoverable",
214
217
  color: "neutral",
215
218
  textAlign: "left",
219
+ isFullWidth: true,
216
220
  onClick: () => addEditedContent(
217
221
  dictionary.key,
218
- "",
219
- [...keyPath, { type: NodeType.Enumeration, key: "unknown" }],
220
- false
222
+ getEmptyNode(content[firstKey]) ?? "",
223
+ [...keyPath, { type: NodeType.Enumeration, key: "unknown" }]
221
224
  ),
222
225
  Icon: Plus,
223
226
  className: "m-2",
224
227
  children: addNewEnumeration.text
225
228
  }
226
- ) })
229
+ )
227
230
  ] });
228
231
  };
229
232
  const ConditionTextEditor = ({
@@ -231,83 +234,24 @@ const ConditionTextEditor = ({
231
234
  keyPath,
232
235
  dictionary
233
236
  }) => {
234
- const { addEditedContent } = useEditedContent();
235
- const { addNewEnumeration } = useDictionary(navigationViewContent);
236
- return /* @__PURE__ */ jsxs("table", { className: "w-full table-fixed gap-2", children: [
237
- /* @__PURE__ */ jsx("tbody", { className: "divide-y-[1.5px]", children: ["true", "false", "fallback"].map((condKey) => /* @__PURE__ */ jsxs("tr", { className: "w-full", children: [
238
- /* @__PURE__ */ jsx("td", { className: "w-44 p-2", children: /* @__PURE__ */ jsxs("div", { className: "flex gap-1", children: [
239
- /* @__PURE__ */ jsx(
240
- Button,
237
+ const content = section[NodeType.Condition];
238
+ return /* @__PURE__ */ jsx("table", { className: "w-full", children: /* @__PURE__ */ jsx("tbody", { className: "flex w-full flex-col gap-2", children: ["true", "false", "fallback"].map((condKey) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
239
+ /* @__PURE__ */ jsx("tr", { className: "mt-2 block w-full p-2 text-xs", children: String(condKey) }, condKey),
240
+ /* @__PURE__ */ jsx("tr", { className: "block w-full", children: /* @__PURE__ */ jsx(
241
+ TextEditorContainer,
242
+ {
243
+ section: content[condKey] ?? getEmptyNode(content["true"]),
244
+ keyPath: [
245
+ ...keyPath,
241
246
  {
242
- label: "Remove",
243
- variant: "hoverable",
244
- size: "icon-md",
245
- color: "text",
246
- Icon: X,
247
- className: "w-16",
248
- onClick: () => addEditedContent(dictionary.key, void 0, [
249
- ...keyPath,
250
- {
251
- type: NodeType.Condition,
252
- key: condKey
253
- }
254
- ])
247
+ type: NodeType.Condition,
248
+ key: condKey
255
249
  }
256
- ),
257
- /* @__PURE__ */ jsx(
258
- EnumKeyInput,
259
- {
260
- value: condKey,
261
- onChange: (value) => {
262
- const preValueContent = section[NodeType.Condition];
263
- const newValueContent = renameKey(
264
- preValueContent,
265
- condKey,
266
- value
267
- );
268
- const newValue = {
269
- ...section,
270
- [NodeType.Condition]: newValueContent
271
- };
272
- addEditedContent(dictionary.key, newValue, keyPath);
273
- }
274
- }
275
- )
276
- ] }) }),
277
- /* @__PURE__ */ jsx("td", { className: "w-full p-2", children: /* @__PURE__ */ jsx(
278
- TextEditor,
279
- {
280
- section: section[NodeType.Enumeration][condKey],
281
- keyPath: [
282
- ...keyPath,
283
- {
284
- type: NodeType.Array,
285
- key: parseInt(condKey)
286
- }
287
- ],
288
- dictionary
289
- }
290
- ) })
291
- ] }, condKey)) }),
292
- /* @__PURE__ */ jsx("tfoot", { children: /* @__PURE__ */ jsx(
293
- Button,
294
- {
295
- label: addNewEnumeration.label.value,
296
- variant: "hoverable",
297
- color: "neutral",
298
- textAlign: "left",
299
- onClick: () => addEditedContent(
300
- dictionary.key,
301
- "",
302
- [...keyPath, { type: NodeType.Enumeration, key: "unknown" }],
303
- false
304
- ),
305
- Icon: Plus,
306
- className: "m-2",
307
- children: addNewEnumeration.text
250
+ ],
251
+ dictionary
308
252
  }
309
- ) })
310
- ] });
253
+ ) }, condKey)
254
+ ] }, condKey)) }) });
311
255
  };
312
256
  const ArrayTextEditor = ({
313
257
  section,
@@ -315,14 +259,38 @@ const ArrayTextEditor = ({
315
259
  dictionary
316
260
  }) => {
317
261
  const { addEditedContent } = useEditedContent();
318
- const { addNewElement } = useDictionary(navigationViewContent);
319
- return /* @__PURE__ */ jsxs("table", { className: "w-full gap-2", children: [
320
- /* @__PURE__ */ jsx("tbody", { className: "divide-y-[1.5px]", children: section.map((subSection, index) => /* @__PURE__ */ jsxs("tr", { className: "w-full", children: [
321
- /* @__PURE__ */ jsx("td", { className: "p-2", children: index }),
322
- /* @__PURE__ */ jsx("td", { className: "w-full p-2", children: /* @__PURE__ */ jsx(
323
- TextEditor,
262
+ const { addNewElement, removeElement } = useDictionary(navigationViewContent);
263
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
264
+ /* @__PURE__ */ jsx("table", { className: "w-full", children: /* @__PURE__ */ jsx("tbody", { className: "flex w-full flex-col gap-2", children: section.map((subSection, index) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
265
+ /* @__PURE__ */ jsxs("tr", { className: "mt-2 flex w-full justify-between gap-2 p-2", children: [
266
+ /* @__PURE__ */ jsx("span", { className: "text-xs", children: String(index) }),
267
+ /* @__PURE__ */ jsx(
268
+ Button,
269
+ {
270
+ label: removeElement.label.value,
271
+ variant: "hoverable",
272
+ color: "neutral",
273
+ className: "ml-auto",
274
+ textAlign: "left",
275
+ onClick: () => {
276
+ const newKeyPath = [
277
+ ...keyPath,
278
+ {
279
+ type: NodeType.Array,
280
+ key: section.length
281
+ }
282
+ ];
283
+ addEditedContent(dictionary.key, void 0, newKeyPath);
284
+ },
285
+ Icon: Trash,
286
+ children: removeElement.text
287
+ }
288
+ )
289
+ ] }),
290
+ /* @__PURE__ */ jsx("tr", { className: "block w-full", children: /* @__PURE__ */ jsx(
291
+ TextEditorContainer,
324
292
  {
325
- section: subSection,
293
+ section: subSection ?? getEmptyNode(section[0]),
326
294
  keyPath: [
327
295
  ...keyPath,
328
296
  {
@@ -333,14 +301,15 @@ const ArrayTextEditor = ({
333
301
  dictionary
334
302
  }
335
303
  ) })
336
- ] }, JSON.stringify(subSection))) }),
337
- /* @__PURE__ */ jsx("tfoot", { children: /* @__PURE__ */ jsx(
304
+ ] }, JSON.stringify(subSection))) }) }),
305
+ /* @__PURE__ */ jsx(
338
306
  Button,
339
307
  {
340
308
  label: addNewElement.label.value,
341
309
  variant: "hoverable",
342
310
  color: "neutral",
343
311
  textAlign: "left",
312
+ isFullWidth: true,
344
313
  onClick: () => {
345
314
  const newKeyPath = [
346
315
  ...keyPath,
@@ -349,14 +318,54 @@ const ArrayTextEditor = ({
349
318
  key: section.length
350
319
  }
351
320
  ];
352
- addEditedContent(dictionary.key, "", newKeyPath, false);
321
+ addEditedContent(
322
+ dictionary.key,
323
+ getEmptyNode(section[0]) ?? "",
324
+ newKeyPath,
325
+ false
326
+ );
353
327
  },
354
328
  Icon: Plus,
355
329
  children: addNewElement.text
356
330
  }
357
- ) })
331
+ )
358
332
  ] });
359
333
  };
334
+ const ObjectTextEditor = ({
335
+ section,
336
+ keyPath,
337
+ dictionary
338
+ }) => /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("table", { className: "w-full", children: /* @__PURE__ */ jsx("tbody", { className: "flex flex-col gap-2", children: Object.keys(section).map(
339
+ (key) => {
340
+ const childKeyPath = [
341
+ ...keyPath,
342
+ { type: NodeType.Object, key }
343
+ ];
344
+ const typedSection = section;
345
+ const firstKey = Object.keys(
346
+ typedSection
347
+ )[0];
348
+ const subSection = typedSection[key] ?? getEmptyNode(typedSection[firstKey]);
349
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
350
+ /* @__PURE__ */ jsx(
351
+ "tr",
352
+ {
353
+ className: "mt-2 p-2 text-xs",
354
+ children: String(key)
355
+ },
356
+ JSON.stringify(subSection)
357
+ ),
358
+ /* @__PURE__ */ jsx("tr", { className: "block w-full", children: /* @__PURE__ */ jsx(
359
+ TextEditor,
360
+ {
361
+ section: subSection,
362
+ keyPath: childKeyPath,
363
+ dictionary
364
+ }
365
+ ) }, JSON.stringify(subSection))
366
+ ] }, key);
367
+ }
368
+ ) }) }) });
360
369
  const MarkdownTextEditor = ({
361
370
  section,
362
371
  keyPath,
@@ -467,76 +476,82 @@ const TextEditor = ({
467
476
  }) => {
468
477
  const { tsxNotEditable } = useDictionary(navigationViewContent);
469
478
  const nodeType = getNodeType(section);
470
- const isEditableSection = getIsEditableSection(section);
471
- if (!isEditableSection) return /* @__PURE__ */ jsx(Fragment, {});
472
- if (typeof section === "object") {
473
- if (nodeType === NodeType.ReactNode) {
474
- return /* @__PURE__ */ jsxs(Fragment, { children: [
475
- /* @__PURE__ */ jsx("span", { children: "[React Node]" }),
476
- /* @__PURE__ */ jsx("span", { className: "text-neutral dark:text-neutral-dark text-xs", children: tsxNotEditable })
477
- ] });
478
- }
479
- if (nodeType === NodeType.Nested) {
480
- return /* @__PURE__ */ jsx(
481
- NestedTextEditor,
482
- {
483
- dictionary,
484
- keyPath,
485
- section
486
- }
487
- );
488
- }
489
- if (nodeType === NodeType.Translation) {
490
- return /* @__PURE__ */ jsx(
491
- TranslationTextEditor,
492
- {
493
- dictionary,
494
- keyPath,
495
- section
496
- }
497
- );
498
- }
499
- if (nodeType === NodeType.Enumeration) {
500
- return /* @__PURE__ */ jsx(
501
- EnumerationTextEditor,
502
- {
503
- dictionary,
504
- keyPath,
505
- section
506
- }
507
- );
508
- }
509
- if (nodeType === NodeType.Condition) {
510
- return /* @__PURE__ */ jsx(
511
- ConditionTextEditor,
512
- {
513
- dictionary,
514
- keyPath,
515
- section
516
- }
517
- );
518
- }
519
- if (nodeType === NodeType.Markdown) {
520
- return /* @__PURE__ */ jsx(
521
- MarkdownTextEditor,
522
- {
523
- dictionary,
524
- keyPath,
525
- section,
526
- isDarkMode
527
- }
528
- );
529
- }
530
- if (nodeType === NodeType.Array) {
531
- return /* @__PURE__ */ jsx(
532
- ArrayTextEditor,
533
- {
534
- dictionary,
535
- keyPath,
536
- section
537
- }
538
- );
539
- }
479
+ if (nodeType === NodeType.ReactNode) {
480
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
481
+ /* @__PURE__ */ jsx("span", { children: "[React Node]" }),
482
+ /* @__PURE__ */ jsx("span", { className: "text-neutral dark:text-neutral-dark text-xs", children: tsxNotEditable })
483
+ ] });
484
+ }
485
+ if (nodeType === NodeType.Nested) {
486
+ return /* @__PURE__ */ jsx(
487
+ NestedTextEditor,
488
+ {
489
+ dictionary,
490
+ keyPath,
491
+ section
492
+ }
493
+ );
494
+ }
495
+ if (nodeType === NodeType.Translation) {
496
+ return /* @__PURE__ */ jsx(
497
+ TranslationTextEditor,
498
+ {
499
+ dictionary,
500
+ keyPath,
501
+ section
502
+ }
503
+ );
504
+ }
505
+ if (nodeType === NodeType.Enumeration) {
506
+ return /* @__PURE__ */ jsx(
507
+ EnumerationTextEditor,
508
+ {
509
+ dictionary,
510
+ keyPath,
511
+ section
512
+ }
513
+ );
514
+ }
515
+ if (nodeType === NodeType.Condition) {
516
+ return /* @__PURE__ */ jsx(
517
+ ConditionTextEditor,
518
+ {
519
+ dictionary,
520
+ keyPath,
521
+ section
522
+ }
523
+ );
524
+ }
525
+ if (nodeType === NodeType.Markdown) {
526
+ return /* @__PURE__ */ jsx(
527
+ MarkdownTextEditor,
528
+ {
529
+ dictionary,
530
+ keyPath,
531
+ section,
532
+ isDarkMode
533
+ }
534
+ );
535
+ }
536
+ if (nodeType === NodeType.Array) {
537
+ return /* @__PURE__ */ jsx(
538
+ ArrayTextEditor,
539
+ {
540
+ dictionary,
541
+ keyPath,
542
+ section
543
+ }
544
+ );
545
+ }
546
+ if (nodeType === NodeType.Object) {
547
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
548
+ ObjectTextEditor,
549
+ {
550
+ dictionary,
551
+ keyPath,
552
+ section
553
+ }
554
+ ) });
540
555
  }
541
556
  if (nodeType === NodeType.Number) {
542
557
  return /* @__PURE__ */ jsx("div", { className: "w-full p-2", children: /* @__PURE__ */ jsx(
@@ -574,11 +589,25 @@ const TextEditor = ({
574
589
  }
575
590
  return /* @__PURE__ */ jsxs("div", { className: "w-full p-2", children: [
576
591
  "Error. Format not supported.",
577
- JSON.stringify(section)
592
+ JSON.stringify(section, null, 2),
593
+ JSON.stringify(keyPath, null, 2),
594
+ "NodeType : ",
595
+ nodeType
578
596
  ] });
579
597
  };
598
+ const TextEditorContainer = (props) => /* @__PURE__ */ jsx(
599
+ Container,
600
+ {
601
+ border: true,
602
+ background: "none",
603
+ className: "top-6 flex h-full flex-1 flex-col gap-6 overflow-hidden p-2 md:sticky",
604
+ roundedSize: "xl",
605
+ children: /* @__PURE__ */ jsx(TextEditor, { ...props })
606
+ }
607
+ );
580
608
  export {
581
609
  TextEditor,
610
+ TextEditorContainer,
582
611
  traceKeys
583
612
  };
584
613
  //# sourceMappingURL=TextEditor.mjs.map