@intlayer/design-system 8.0.5 → 8.1.1

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 (92) hide show
  1. package/dist/esm/components/Accordion/Accordion.mjs +1 -1
  2. package/dist/esm/components/Avatar/index.mjs +1 -1
  3. package/dist/esm/components/Breadcrumb/index.mjs +1 -1
  4. package/dist/esm/components/Browser/Browser.mjs +1 -1
  5. package/dist/esm/components/Carousel/index.mjs +1 -1
  6. package/dist/esm/components/CollapsibleTable/CollapsibleTable.mjs +1 -1
  7. package/dist/esm/components/ContentEditor/ContentEditor.mjs +1 -1
  8. package/dist/esm/components/ContentEditor/ContentEditorInput.mjs +1 -1
  9. package/dist/esm/components/ContentEditor/ContentEditorTextArea.mjs +2 -2
  10. package/dist/esm/components/CopyButton/index.mjs +1 -1
  11. package/dist/esm/components/CopyToClipboard/index.mjs +1 -1
  12. package/dist/esm/components/DictionaryEditor/DictionaryEditor.mjs +1 -1
  13. package/dist/esm/components/DictionaryEditor/NodeWrapper/FileWrapper.mjs +1 -1
  14. package/dist/esm/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs +1 -1
  15. package/dist/esm/components/DictionaryEditor/NodeWrapper/index.mjs +1 -1
  16. package/dist/esm/components/DictionaryFieldEditor/ContentEditor.mjs +1 -1
  17. package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +3 -3
  18. package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +1 -1
  19. package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +4 -4
  20. package/dist/esm/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +2 -2
  21. package/dist/esm/components/DictionaryFieldEditor/JSONEditor.mjs +1 -1
  22. package/dist/esm/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +2 -2
  23. package/dist/esm/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +4 -4
  24. package/dist/esm/components/DictionaryFieldEditor/StructureEditor.mjs +1 -1
  25. package/dist/esm/components/DictionaryFieldEditor/StructureView/StructureView.mjs +1 -1
  26. package/dist/esm/components/EditableField/EditableFieldLayout.mjs +1 -1
  27. package/dist/esm/components/Form/elements/OTPElement.mjs +1 -1
  28. package/dist/esm/components/HideShow/index.mjs +1 -1
  29. package/dist/esm/components/IDE/FileTree.mjs +1 -1
  30. package/dist/esm/components/Input/InputPassword.mjs +1 -1
  31. package/dist/esm/components/Input/OTPInput.mjs +1 -1
  32. package/dist/esm/components/KeyboardScreenAdapter/index.mjs +1 -1
  33. package/dist/esm/components/KeyboardShortcut/KeyboardShortcut.mjs +1 -1
  34. package/dist/esm/components/Link/Link.mjs +1 -1
  35. package/dist/esm/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +2 -2
  36. package/dist/esm/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs +1 -1
  37. package/dist/esm/components/MarkDownRender/MarkDownRender.mjs +1 -1
  38. package/dist/esm/components/MarkDownRender/MarkDownRender.mjs.map +1 -1
  39. package/dist/esm/components/Modal/Modal.mjs +3 -3
  40. package/dist/esm/components/Navbar/MobileNavbar.mjs +2 -2
  41. package/dist/esm/components/Pagination/Pagination.mjs +2 -2
  42. package/dist/esm/components/RightDrawer/RightDrawer.mjs +3 -3
  43. package/dist/esm/components/Select/Multiselect.mjs +1 -1
  44. package/dist/esm/components/SwitchSelector/index.mjs +1 -1
  45. package/dist/esm/components/Tab/Tab.mjs +1 -1
  46. package/dist/esm/components/TabSelector/TabSelector.mjs +1 -1
  47. package/dist/esm/components/Table/Table.mjs +1 -1
  48. package/dist/esm/components/TextArea/AutocompleteTextArea.mjs +1 -1
  49. package/dist/esm/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs +1 -1
  50. package/dist/esm/components/ThemeSwitcherDropDown/MobileThemeSwitcher.mjs +1 -1
  51. package/dist/esm/components/Toaster/Toast.mjs +2 -2
  52. package/dist/esm/components/index.mjs +3 -3
  53. package/dist/esm/hooks/index.mjs +5 -5
  54. package/dist/esm/providers/ReactQueryProvider.mjs +1 -1
  55. package/dist/types/components/Breadcrumb/breadcrumb.content.d.ts +1 -1
  56. package/dist/types/components/Browser/Browser.content.d.ts +8 -8
  57. package/dist/types/components/Button/Button.d.ts +4 -4
  58. package/dist/types/components/Carousel/index.content.d.ts +3 -3
  59. package/dist/types/components/CollapsibleTable/CollapsibleTable.d.ts +2 -2
  60. package/dist/types/components/Command/index.d.ts +1 -1
  61. package/dist/types/components/Container/index.d.ts +5 -5
  62. package/dist/types/components/CopyButton/CopyButton.content.d.ts +1 -1
  63. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts +12 -12
  64. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.d.ts +4 -4
  65. package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts +27 -27
  66. package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts +16 -16
  67. package/dist/types/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts +12 -12
  68. package/dist/types/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts +16 -16
  69. package/dist/types/components/DictionaryFieldEditor/StructureView/structureView.content.d.ts +4 -4
  70. package/dist/types/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.d.ts +3 -3
  71. package/dist/types/components/DictionaryFieldEditor/dictionaryFieldEditor.content.d.ts +2 -2
  72. package/dist/types/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts +15 -15
  73. package/dist/types/components/ExpandCollapse/expandCollapse.content.d.ts +1 -1
  74. package/dist/types/components/IDE/code.content.d.ts +2 -2
  75. package/dist/types/components/IDE/copyCode.content.d.ts +2 -2
  76. package/dist/types/components/IDE/selectors.content.d.ts +6 -6
  77. package/dist/types/components/Input/Checkbox.d.ts +2 -2
  78. package/dist/types/components/Input/Input.d.ts +1 -1
  79. package/dist/types/components/Link/Link.d.ts +3 -3
  80. package/dist/types/components/Loader/index.content.d.ts +1 -1
  81. package/dist/types/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts +8 -8
  82. package/dist/types/components/LocaleSwitcherDropDown/localeSwitcher.content.d.ts +6 -6
  83. package/dist/types/components/Pagination/Pagination.d.ts +1 -1
  84. package/dist/types/components/Pagination/pagination.content.d.ts +5 -5
  85. package/dist/types/components/RightDrawer/rightDrawer.content.d.ts +2 -2
  86. package/dist/types/components/SwitchSelector/index.d.ts +1 -1
  87. package/dist/types/components/TabSelector/TabSelector.d.ts +1 -1
  88. package/dist/types/components/Table/table.content.d.ts +1 -1
  89. package/dist/types/components/Tag/index.d.ts +3 -3
  90. package/dist/types/components/Terminal/terminal.content.d.ts +2 -2
  91. package/dist/types/components/Toaster/Toast.d.ts +1 -1
  92. package/package.json +18 -18
@@ -3,8 +3,8 @@
3
3
  import { cn } from "../../utils/cn.mjs";
4
4
  import { Button, ButtonColor, ButtonVariant } from "../Button/Button.mjs";
5
5
  import { MaxHeightSmoother } from "../MaxHeightSmoother/index.mjs";
6
- import { ChevronDown } from "lucide-react";
7
6
  import { useId, useState } from "react";
7
+ import { ChevronDown } from "lucide-react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
9
 
10
10
  //#region src/components/Accordion/Accordion.tsx
@@ -1,7 +1,7 @@
1
1
  import { cn } from "../../utils/cn.mjs";
2
2
  import { Loader } from "../Loader/index.mjs";
3
- import { User } from "lucide-react";
4
3
  import { useMemo } from "react";
4
+ import { User } from "lucide-react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
 
7
7
  //#region src/components/Avatar/index.tsx
@@ -3,9 +3,9 @@
3
3
  import { cn } from "../../utils/cn.mjs";
4
4
  import { Button, ButtonVariant } from "../Button/Button.mjs";
5
5
  import { Link, LinkColor } from "../Link/Link.mjs";
6
- import { ChevronRightIcon } from "lucide-react";
7
6
  import { Fragment, createElement } from "react";
8
7
  import { cva } from "class-variance-authority";
8
+ import { ChevronRightIcon } from "lucide-react";
9
9
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
10
10
  import { getIntlayer } from "@intlayer/core";
11
11
  import { useIntlayer } from "react-intlayer";
@@ -3,8 +3,8 @@
3
3
  import { cn } from "../../utils/cn.mjs";
4
4
  import { Button } from "../Button/Button.mjs";
5
5
  import { Input, inputVariants } from "../Input/Input.mjs";
6
- import { ArrowLeft, ArrowRight, RotateCw } from "lucide-react";
7
6
  import { useEffect, useImperativeHandle, useRef, useState } from "react";
7
+ import { ArrowLeft, ArrowRight, RotateCw } from "lucide-react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
9
  import { useIntlayer } from "react-intlayer";
10
10
 
@@ -4,8 +4,8 @@ import { cn } from "../../utils/cn.mjs";
4
4
  import { Button, ButtonColor, ButtonSize, ButtonVariant } from "../Button/Button.mjs";
5
5
  import { KeyboardShortcut } from "../KeyboardShortcut/KeyboardShortcut.mjs";
6
6
  import { Popover } from "../Popover/dynamic.mjs";
7
- import { ChevronLeft, ChevronRight } from "lucide-react";
8
7
  import { Children, createContext, isValidElement, useContext, useEffect, useRef, useState } from "react";
8
+ import { ChevronLeft, ChevronRight } from "lucide-react";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
10
  import { useIntlayer } from "react-intlayer";
11
11
 
@@ -2,9 +2,9 @@
2
2
 
3
3
  import { cn } from "../../utils/cn.mjs";
4
4
  import { MaxHeightSmoother } from "../MaxHeightSmoother/index.mjs";
5
- import { ChevronRight } from "lucide-react";
6
5
  import { useState } from "react";
7
6
  import { cva } from "class-variance-authority";
7
+ import { ChevronRight } from "lucide-react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
9
 
10
10
  //#region src/components/CollapsibleTable/CollapsibleTable.tsx
@@ -3,8 +3,8 @@
3
3
  import { cn } from "../../utils/cn.mjs";
4
4
  import { InputVariant } from "../Input/Input.mjs";
5
5
  import { AutoSizedTextArea } from "../TextArea/AutoSizeTextArea.mjs";
6
- import { Check, X } from "lucide-react";
7
6
  import { useState } from "react";
7
+ import { Check, X } from "lucide-react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
9
 
10
10
  //#region src/components/ContentEditor/ContentEditor.tsx
@@ -2,8 +2,8 @@
2
2
 
3
3
  import { Button, ButtonColor, ButtonSize, ButtonVariant } from "../Button/Button.mjs";
4
4
  import { Input, InputVariant } from "../Input/Input.mjs";
5
- import { Check, X } from "lucide-react";
6
5
  import { useEffect, useState } from "react";
6
+ import { Check, X } from "lucide-react";
7
7
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
8
8
 
9
9
  //#region src/components/ContentEditor/ContentEditorInput.tsx
@@ -1,10 +1,10 @@
1
1
  'use client';
2
2
 
3
+ import { useUser } from "../../hooks/useUser/index.mjs";
3
4
  import { Button, ButtonColor, ButtonSize, ButtonVariant } from "../Button/Button.mjs";
4
5
  import { AutoCompleteTextarea } from "../TextArea/AutocompleteTextArea.mjs";
5
- import { useUser } from "../../hooks/useUser/index.mjs";
6
- import { Check, X } from "lucide-react";
7
6
  import { useEffect, useState } from "react";
7
+ import { Check, X } from "lucide-react";
8
8
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
9
9
 
10
10
  //#region src/components/ContentEditor/ContentEditorTextArea.tsx
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
 
3
3
  import { Button, ButtonColor, ButtonSize, ButtonVariant } from "../Button/Button.mjs";
4
- import { CopyCheckIcon, CopyIcon } from "lucide-react";
5
4
  import { useEffect, useState } from "react";
5
+ import { CopyCheckIcon, CopyIcon } from "lucide-react";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  import { useIntlayer } from "react-intlayer";
8
8
 
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
 
3
3
  import { cn } from "../../utils/cn.mjs";
4
- import { CopyCheck, CopyIcon } from "lucide-react";
5
4
  import { useState } from "react";
5
+ import { CopyCheck, CopyIcon } from "lucide-react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
 
8
8
  //#region src/components/CopyToClipboard/index.tsx
@@ -1,9 +1,9 @@
1
1
  'use client';
2
2
 
3
3
  import { NodeWrapper } from "./NodeWrapper/index.mjs";
4
+ import { useEditedContent, useFocusUnmergedDictionary } from "@intlayer/editor-react";
4
5
  import { createElement } from "react";
5
6
  import { jsx } from "react/jsx-runtime";
6
- import { useEditedContent, useFocusUnmergedDictionary } from "@intlayer/editor-react";
7
7
 
8
8
  //#region src/components/DictionaryEditor/DictionaryEditor.tsx
9
9
  const DictionaryEditor = ({ dictionary, ...props }) => {
@@ -1,7 +1,7 @@
1
1
  import { StringWrapper } from "./StringWrapper.mjs";
2
+ import { useEditedContent } from "@intlayer/editor-react";
2
3
  import { jsx, jsxs } from "react/jsx-runtime";
3
4
  import { getContentNodeByKeyPath } from "@intlayer/core";
4
- import { useEditedContent } from "@intlayer/editor-react";
5
5
  import { NodeType } from "@intlayer/types";
6
6
 
7
7
  //#region src/components/DictionaryEditor/NodeWrapper/FileWrapper.tsx
@@ -1,8 +1,8 @@
1
1
  import { cn } from "../../../utils/cn.mjs";
2
2
  import { EditableFieldTextArea } from "../../EditableField/EditableFieldTextArea.mjs";
3
+ import { useEditorLocale } from "@intlayer/editor-react";
3
4
  import { Fragment, jsx } from "react/jsx-runtime";
4
5
  import { getContentNodeByKeyPath } from "@intlayer/core";
5
- import { useEditorLocale } from "@intlayer/editor-react";
6
6
 
7
7
  //#region src/components/DictionaryEditor/NodeWrapper/StringWrapper.tsx
8
8
  const StringWrapper = ({ keyPath, section, editedContent, editedContentValue: editedContentValueProp, onContentChange, onFocusKeyPath, renderSection }) => {
@@ -10,10 +10,10 @@ import { InsertionWrapper } from "./InsertionWrapper.mjs";
10
10
  import { MarkdownWrapper } from "./MarkdownWrapper.mjs";
11
11
  import { NestedObjectWrapper } from "./NestedObjectWrapper.mjs";
12
12
  import { TranslationWrapper } from "./TranslationWrapper.mjs";
13
+ import { useEditorLocale } from "@intlayer/editor-react";
13
14
  import { memo, useMemo } from "react";
14
15
  import { jsx } from "react/jsx-runtime";
15
16
  import { getContentNodeByKeyPath, getNodeType } from "@intlayer/core";
16
- import { useEditorLocale } from "@intlayer/editor-react";
17
17
  import { NodeType } from "@intlayer/types";
18
18
 
19
19
  //#region src/components/DictionaryEditor/NodeWrapper/index.tsx
@@ -6,10 +6,10 @@ import { TextEditorContainer } from "./ContentEditorView/TextEditor.mjs";
6
6
  import { getIsEditableSection } from "./getIsEditableSection.mjs";
7
7
  import { KeyPathBreadcrumb } from "./KeyPathBreadcrumb.mjs";
8
8
  import { NavigationViewNode } from "./NavigationView/NavigationViewNode.mjs";
9
+ import { useEditedContent, useEditorLocale, useFocusUnmergedDictionary } from "@intlayer/editor-react";
9
10
  import { useEffect } from "react";
10
11
  import { jsx, jsxs } from "react/jsx-runtime";
11
12
  import { getContentNodeByKeyPath } from "@intlayer/core";
12
- import { useEditedContent, useEditorLocale, useFocusUnmergedDictionary } from "@intlayer/editor-react";
13
13
 
14
14
  //#region src/components/DictionaryFieldEditor/ContentEditor.tsx
15
15
  const ContentEditor = ({ dictionary, isDarkMode }) => {
@@ -1,9 +1,9 @@
1
1
  'use client';
2
2
 
3
+ import { useAuditContentDeclarationField } from "../../../hooks/reactQuery.mjs";
3
4
  import { Container } from "../../Container/index.mjs";
4
5
  import { Button, ButtonColor, ButtonSize, ButtonTextAlign, ButtonVariant } from "../../Button/Button.mjs";
5
6
  import { InputVariant } from "../../Input/Input.mjs";
6
- import { useAuditContentDeclarationField } from "../../../hooks/reactQuery.mjs";
7
7
  import { SwitchSelector, SwitchSelectorColor, SwitchSelectorSize } from "../../SwitchSelector/index.mjs";
8
8
  import { useLocaleSwitcherContent } from "../../LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs";
9
9
  import { ContentEditorInput as ContentEditorInput$1 } from "../../ContentEditor/ContentEditorInput.mjs";
@@ -12,12 +12,12 @@ import { Label } from "../../Label/index.mjs";
12
12
  import { MarkdownRenderer as MarkdownRenderer$1 } from "../../MarkDownRender/MarkDownRender.mjs";
13
13
  import { renameKey } from "../../../utils/object.mjs";
14
14
  import { EnumKeyInput } from "../EnumKeyInput.mjs";
15
- import { Plus, Trash, WandSparkles } from "lucide-react";
15
+ import { useConfiguration, useEditedContent } from "@intlayer/editor-react";
16
16
  import { Fragment, useState } from "react";
17
+ import { Plus, Trash, WandSparkles } from "lucide-react";
17
18
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
18
19
  import { getEmptyNode, getLocaleName, getNodeType } from "@intlayer/core";
19
20
  import { useIntlayer, useLocale } from "react-intlayer";
20
- import { useConfiguration, useEditedContent } from "@intlayer/editor-react";
21
21
  import { NodeType } from "@intlayer/types";
22
22
 
23
23
  //#region src/components/DictionaryFieldEditor/ContentEditorView/TextEditor.tsx
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
 
3
- import { ButtonColor } from "../../Button/Button.mjs";
4
3
  import { useSession } from "../../../hooks/useAuth/useSession.mjs";
5
4
  import { useAddDictionary, useGetProjects } from "../../../hooks/reactQuery.mjs";
5
+ import { ButtonColor } from "../../Button/Button.mjs";
6
6
  import { MultiSelect } from "../../Select/Multiselect.mjs";
7
7
  import { useForm } from "../../Form/FormBase.mjs";
8
8
  import { Form } from "../../Form/Form.mjs";
@@ -1,20 +1,20 @@
1
1
  'use client';
2
2
 
3
+ import { useSession } from "../../../hooks/useAuth/useSession.mjs";
4
+ import { useAuditContentDeclarationMetadata, useGetProjects, useGetTags } from "../../../hooks/reactQuery.mjs";
3
5
  import { Loader } from "../../Loader/index.mjs";
4
6
  import { ButtonColor, ButtonSize, ButtonVariant } from "../../Button/Button.mjs";
5
7
  import { Checkbox } from "../../Input/Checkbox.mjs";
6
- import { useSession } from "../../../hooks/useAuth/useSession.mjs";
7
- import { useAuditContentDeclarationMetadata, useGetProjects, useGetTags } from "../../../hooks/reactQuery.mjs";
8
8
  import { MultiSelect } from "../../Select/Multiselect.mjs";
9
9
  import { Select } from "../../Select/Select.mjs";
10
10
  import { useForm as useForm$1 } from "../../Form/FormBase.mjs";
11
11
  import { Form } from "../../Form/Form.mjs";
12
12
  import { useDictionaryDetailsSchema } from "./useDictionaryDetailsSchema.mjs";
13
- import { WandSparkles } from "lucide-react";
13
+ import { useEditedContent } from "@intlayer/editor-react";
14
14
  import { useEffect } from "react";
15
+ import { WandSparkles } from "lucide-react";
15
16
  import { jsx, jsxs } from "react/jsx-runtime";
16
17
  import { useIntlayer } from "react-intlayer";
17
- import { useEditedContent } from "@intlayer/editor-react";
18
18
  import { AnimatePresence, motion } from "framer-motion";
19
19
  import { useWatch } from "react-hook-form";
20
20
 
@@ -9,11 +9,11 @@ import { DictionaryDetailsForm } from "./DictionaryDetails/DictionaryDetailsForm
9
9
  import { JSONEditor } from "./JSONEditor.mjs";
10
10
  import { SaveForm } from "./SaveForm/SaveForm.mjs";
11
11
  import { StructureEditor } from "./StructureEditor.mjs";
12
- import { ArrowLeft } from "lucide-react";
12
+ import { useConfiguration, useDictionariesRecordActions, useFocusUnmergedDictionary } from "@intlayer/editor-react";
13
13
  import { useEffect } from "react";
14
+ import { ArrowLeft } from "lucide-react";
14
15
  import { jsx, jsxs } from "react/jsx-runtime";
15
16
  import { useIntlayer } from "react-intlayer";
16
- import { useConfiguration, useDictionariesRecordActions, useFocusUnmergedDictionary } from "@intlayer/editor-react";
17
17
 
18
18
  //#region src/components/DictionaryFieldEditor/DictionaryFieldEditor.tsx
19
19
  const DictionaryFieldEditor = ({ dictionary, onClickDictionaryList, isDarkMode, mode, onDelete, onSave, showReturnButton = true }) => {
@@ -1,6 +1,6 @@
1
1
  import { MonacoCode } from "../IDE/MonacoCode.mjs";
2
- import { jsx } from "react/jsx-runtime";
3
2
  import { useEditedContent } from "@intlayer/editor-react";
3
+ import { jsx } from "react/jsx-runtime";
4
4
 
5
5
  //#region src/components/DictionaryFieldEditor/JSONEditor.tsx
6
6
  const JSONEditor = ({ dictionary, isDarkMode }) => {
@@ -1,13 +1,13 @@
1
1
  import { Button, ButtonColor, ButtonTextAlign, ButtonVariant } from "../../Button/Button.mjs";
2
2
  import { Accordion } from "../../Accordion/Accordion.mjs";
3
3
  import { getIsEditableSection } from "../getIsEditableSection.mjs";
4
+ import { useEditedContentActions, useEditorLocale, useFocusUnmergedDictionary } from "@intlayer/editor-react";
5
+ import configuration from "@intlayer/config/built";
4
6
  import { ChevronRight, Plus } from "lucide-react";
5
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
8
  import { getContentNodeByKeyPath, getEmptyNode, getNodeType, isSameKeyPath } from "@intlayer/core";
7
9
  import { useIntlayer } from "react-intlayer";
8
- import { useEditedContentActions, useEditorLocale, useFocusUnmergedDictionary } from "@intlayer/editor-react";
9
10
  import { NodeType } from "@intlayer/types";
10
- import configuration from "@intlayer/config/built";
11
11
  import { camelCaseToSentence } from "@intlayer/config/client";
12
12
 
13
13
  //#region src/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.tsx
@@ -1,16 +1,16 @@
1
1
  'use client';
2
2
 
3
- import { cn } from "../../../utils/cn.mjs";
4
- import { ButtonColor, ButtonVariant } from "../../Button/Button.mjs";
5
3
  import { useAuth } from "../../../hooks/useAuth/useAuth.mjs";
6
4
  import { useDeleteDictionary, usePushDictionaries, useWriteDictionary } from "../../../hooks/reactQuery.mjs";
5
+ import { cn } from "../../../utils/cn.mjs";
6
+ import { ButtonColor, ButtonVariant } from "../../Button/Button.mjs";
7
7
  import { Modal, ModalSize } from "../../Modal/Modal.mjs";
8
8
  import { Form } from "../../Form/Form.mjs";
9
- import { ArrowUpFromLine, Download, RotateCcw, Save, Trash } from "lucide-react";
9
+ import { useDictionariesRecordActions, useEditedContent } from "@intlayer/editor-react";
10
10
  import { useState } from "react";
11
+ import { ArrowUpFromLine, Download, RotateCcw, Save, Trash } from "lucide-react";
11
12
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
12
13
  import { useIntlayer } from "react-intlayer";
13
- import { useDictionariesRecordActions, useEditedContent } from "@intlayer/editor-react";
14
14
 
15
15
  //#region src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx
16
16
  const SaveForm = ({ dictionary, mode, className, onDelete, onSave, ...props }) => {
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
 
3
3
  import { NodeView } from "./StructureView/StructureView.mjs";
4
- import { jsx } from "react/jsx-runtime";
5
4
  import { useEditedContent } from "@intlayer/editor-react";
5
+ import { jsx } from "react/jsx-runtime";
6
6
 
7
7
  //#region src/components/DictionaryFieldEditor/StructureEditor.tsx
8
8
  const StructureEditor = ({ dictionary }) => {
@@ -5,11 +5,11 @@ import { Button, ButtonColor, ButtonSize, ButtonVariant } from "../../Button/But
5
5
  import { InputVariant } from "../../Input/Input.mjs";
6
6
  import { EditableFieldInput } from "../../EditableField/EditableFieldInput.mjs";
7
7
  import { NodeTypeSelector } from "../NodeTypeSelector.mjs";
8
+ import { useConfiguration, useEditedContentActions, useFocusUnmergedDictionary } from "@intlayer/editor-react";
8
9
  import { Plus, Trash } from "lucide-react";
9
10
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
10
11
  import { getDefaultNode, getNodeChildren, getNodeType, isSameKeyPath } from "@intlayer/core";
11
12
  import { useIntlayer } from "react-intlayer";
12
- import { useConfiguration, useEditedContentActions, useFocusUnmergedDictionary } from "@intlayer/editor-react";
13
13
  import { NodeType } from "@intlayer/types";
14
14
  import { camelCaseToSentence } from "@intlayer/config/client";
15
15
 
@@ -2,8 +2,8 @@
2
2
 
3
3
  import { cn } from "../../utils/cn.mjs";
4
4
  import { Button, ButtonColor, ButtonSize, ButtonVariant } from "../Button/Button.mjs";
5
- import { Check, Pencil, X } from "lucide-react";
6
5
  import { useCallback, useEffect, useRef, useState } from "react";
6
+ import { Check, Pencil, X } from "lucide-react";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
8
 
9
9
  //#region src/components/EditableField/EditableFieldLayout.tsx
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
- import { InputIndicator, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot } from "../../Input/OTPInput.mjs";
4
3
  import { useItemSelector } from "../../../hooks/useItemSelector.mjs";
4
+ import { InputIndicator, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot } from "../../Input/OTPInput.mjs";
5
5
  import { useFormField } from "../FormField.mjs";
6
6
  import { FormItemLayout } from "../layout/FormItemLayout.mjs";
7
7
  import { Form } from "../Form.mjs";
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
 
3
3
  import { cn } from "../../utils/cn.mjs";
4
- import { Eye, EyeOff } from "lucide-react";
5
4
  import { useEffect, useMemo, useRef, useState } from "react";
5
+ import { Eye, EyeOff } from "lucide-react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
 
8
8
  //#region src/components/HideShow/index.tsx
@@ -3,8 +3,8 @@
3
3
  import { cn } from "../../utils/cn.mjs";
4
4
  import { MaxHeightSmoother } from "../MaxHeightSmoother/index.mjs";
5
5
  import { createFileTree } from "./createFileTree.mjs";
6
- import { ChevronRight } from "lucide-react";
7
6
  import { useState } from "react";
7
+ import { ChevronRight } from "lucide-react";
8
8
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
9
9
 
10
10
  //#region src/components/IDE/FileTree.tsx
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
 
3
3
  import { Input } from "./Input.mjs";
4
- import { EyeIcon, EyeOffIcon } from "lucide-react";
5
4
  import { useState } from "react";
5
+ import { EyeIcon, EyeOffIcon } from "lucide-react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
 
8
8
  //#region src/components/Input/InputPassword.tsx
@@ -2,9 +2,9 @@
2
2
 
3
3
  import { cn } from "../../utils/cn.mjs";
4
4
  import { Button } from "../Button/Button.mjs";
5
- import { MinusIcon } from "lucide-react";
6
5
  import { createContext, useContext, useEffect, useRef, useState } from "react";
7
6
  import { cva } from "class-variance-authority";
7
+ import { MinusIcon } from "lucide-react";
8
8
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
9
9
 
10
10
  //#region src/components/Input/OTPInput.tsx
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
- import { cn } from "../../utils/cn.mjs";
4
3
  import { useKeyboardDetector } from "../../hooks/useKeyboardDetector.mjs";
4
+ import { cn } from "../../utils/cn.mjs";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
 
7
7
  //#region src/components/KeyboardScreenAdapter/index.tsx
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
- import { cn } from "../../utils/cn.mjs";
4
3
  import { useDevice } from "../../hooks/useDevice.mjs";
4
+ import { cn } from "../../utils/cn.mjs";
5
5
  import { useEffect, useState } from "react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
 
@@ -1,7 +1,7 @@
1
1
  import { cn } from "../../utils/cn.mjs";
2
- import { ExternalLink, MoveRight } from "lucide-react";
3
2
  import { isValidElement } from "react";
4
3
  import { cva } from "class-variance-authority";
4
+ import { ExternalLink, MoveRight } from "lucide-react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { getLocalizedUrl } from "@intlayer/core";
7
7
 
@@ -1,14 +1,14 @@
1
1
  'use client';
2
2
 
3
+ import { usePersistedStore } from "../../hooks/usePersistedStore.mjs";
3
4
  import { Container } from "../Container/index.mjs";
4
5
  import { Button, ButtonColor, ButtonSize, ButtonTextAlign, ButtonVariant } from "../Button/Button.mjs";
5
6
  import { Input } from "../Input/Input.mjs";
6
- import { usePersistedStore } from "../../hooks/usePersistedStore.mjs";
7
7
  import { DropDown } from "../DropDown/index.mjs";
8
8
  import { SwitchSelector, SwitchSelectorColor, SwitchSelectorSize } from "../SwitchSelector/index.mjs";
9
9
  import { useLocaleSwitcherContent } from "./LocaleSwitcherContentContext.mjs";
10
- import { Check, Globe, MoveVertical } from "lucide-react";
11
10
  import { useMemo, useRef, useState } from "react";
11
+ import { Check, Globe, MoveVertical } from "lucide-react";
12
12
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
13
13
  import { getHTMLTextDir, getLocaleName } from "@intlayer/core";
14
14
  import { useIntlayer, useLocale } from "react-intlayer";
@@ -4,8 +4,8 @@ import { Container } from "../Container/index.mjs";
4
4
  import { Button, ButtonColor, ButtonTextAlign, ButtonVariant } from "../Button/Button.mjs";
5
5
  import { Input } from "../Input/Input.mjs";
6
6
  import { DropDown } from "../DropDown/index.mjs";
7
- import { MoveVertical } from "lucide-react";
8
7
  import { useCallback, useMemo, useRef, useState } from "react";
8
+ import { MoveVertical } from "lucide-react";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
10
  import { getHTMLTextDir, getLocaleName } from "@intlayer/core";
11
11
  import { useIntlayer } from "react-intlayer";
@@ -105,7 +105,7 @@ const getIntlayerMarkdownOptions = (isDarkMode) => ({ components: {
105
105
  Tabs: (props) => /* @__PURE__ */ jsx(Tab, {
106
106
  ...props,
107
107
  className: "rounded-xl border border-card",
108
- headerClassName: "sticky rounded-xl top-36 z-10 bg-background/70 backdrop-blur overflow-x-auto"
108
+ headerClassName: "sticky rounded-xl top-24 z-5 bg-background/70 backdrop-blur overflow-x-auto"
109
109
  }),
110
110
  Tab: Tab.Item,
111
111
  Columns: ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
@@ -1 +1 @@
1
- {"version":3,"file":"MarkDownRender.mjs","names":[],"sources":["../../../../src/components/MarkDownRender/MarkDownRender.tsx"],"sourcesContent":["import type { LocalesValues } from '@intlayer/types';\nimport { cn } from '@utils/cn';\nimport type { ComponentProps, ComponentPropsWithoutRef, FC } from 'react';\nimport {\n type MarkdownRenderer as MarkdownRendererIntlayer,\n type RenderMarkdownProps,\n renderMarkdown,\n} from 'react-intlayer';\nimport type { BundledLanguage } from 'shiki/bundle/web';\nimport { H1, H2, H3, H4, H5, H6 } from '../Headers';\nimport { Code } from '../IDE/Code';\nimport { CodeProvider } from '../IDE/CodeContext';\nimport { Link } from '../Link';\nimport { Tab } from '../Tab';\nimport { TabProvider } from '../Tab/TabContext';\nimport { Table } from '../Table';\n\ntype MarkdownRendererProps = {\n children: string;\n isDarkMode?: boolean;\n locale?: LocalesValues;\n forceBlock?: boolean;\n preserveFrontmatter?: boolean;\n tagfilter?: boolean;\n components?: ComponentProps<typeof MarkdownRendererIntlayer>['components'];\n wrapper?: ComponentProps<typeof MarkdownRendererIntlayer>['wrapper'];\n};\n\nexport const getIntlayerMarkdownOptions: (\n isDarkMode: boolean\n) => RenderMarkdownProps = (isDarkMode) => ({\n components: {\n h1: (props) => <H1 isClickable={true} {...props} />,\n h2: (props) => <H2 isClickable={true} className=\"mt-16\" {...props} />,\n h3: (props) => <H3 isClickable={true} className=\"mt-5\" {...props} />,\n h4: (props) => <H4 isClickable={true} className=\"mt-3\" {...props} />,\n h5: (props) => <H5 isClickable={true} className=\"mt-3\" {...props} />,\n h6: (props) => <H6 isClickable={true} className=\"mt-3\" {...props} />,\n\n code: ({ className, children, ...rest }: ComponentProps<'code'>) => {\n // Ensure children is a string (Markdown renderer might pass ReactNodes)\n const content = String(children ?? '').replace(/\\n$/, '');\n\n // Determine if it is inline code or a code block\n // Code blocks usually have a className like 'language-ts'\n const isBlock = !!className;\n\n if (!isBlock) {\n return (\n <strong className=\"rounded bg-card/60 box-decoration-clone px-1 py-0.5 font-mono text-sm\">\n {content}\n </strong>\n );\n }\n\n // Extract language from className (e.g., \"language-typescript\" -> \"typescript\")\n const language = (className?.replace(/lang(?:uage)?-/, '') ||\n 'plaintext') as BundledLanguage;\n\n console.log({ rest });\n\n return (\n <Code\n {...rest}\n language={language}\n showHeader={true}\n isDarkMode={isDarkMode} // Ensure this variable is available in scope\n >\n {content}\n </Code>\n );\n },\n\n blockquote: ({ className, ...props }) => (\n <blockquote\n className={cn(\n 'mt-5 gap-3 border-card border-l-4 pl-5 text-neutral',\n className\n )}\n {...props}\n />\n ),\n ul: ({ className, ...props }) => (\n <ul\n className={cn('mt-5 flex list-disc flex-col gap-3 pl-5', className)}\n {...props}\n />\n ),\n ol: ({ className, ...props }) => (\n <ol\n className={cn('mt-5 flex list-decimal flex-col gap-3 pl-5', className)}\n {...props}\n />\n ),\n img: ({ className, ...props }) => (\n <img\n {...props}\n alt={props.alt ?? ''}\n loading=\"lazy\"\n className={cn('max-h-[80vh] max-w-full rounded-md', className)}\n src={`${props.src}?raw=true`}\n />\n ),\n a: (props) => (\n // @ts-expect-error - label is not required in LinkProps\n <Link\n isExternalLink={props.href?.startsWith('http')}\n underlined={true}\n // locale={locale}\n {...props}\n color=\"neutral\"\n />\n ),\n pre: (props) => props.children,\n\n table: (props: ComponentProps<typeof Table>) => (\n <Table isRollable={true} {...props} />\n ),\n th: ({ className, ...props }) => (\n <th\n className={cn('border-neutral border-b bg-neutral/10 p-4', className)}\n {...props}\n />\n ),\n tr: ({ className, ...props }) => (\n <tr\n className={cn('hover:/10 hover:bg-neutral/10', className)}\n {...props}\n />\n ),\n td: ({ className, ...props }) => (\n <td\n className={cn('border-neutral-500/50 border-b p-4', className)}\n {...props}\n />\n ),\n hr: ({ className, ...props }) => (\n <hr className={cn('mx-6 mt-16 text-neutral', className)} {...props} />\n ),\n Tabs: (props: ComponentProps<typeof Tab>) => (\n <Tab\n {...props}\n className=\"rounded-xl border border-card\"\n headerClassName=\"sticky rounded-xl top-36 z-10 bg-background/70 backdrop-blur overflow-x-auto\"\n />\n ),\n Tab: Tab.Item,\n Columns: ({ className, ...props }: ComponentPropsWithoutRef<'div'>) => (\n <div className={cn('flex gap-4 max-md:flex-col', className)} {...props} />\n ),\n Column: ({ className, ...props }: ComponentPropsWithoutRef<'div'>) => (\n <div className={cn('flex-1', className)} {...props} />\n ),\n },\n});\n\n/**\n * MarkdownRenderer Component\n *\n * A comprehensive markdown renderer that transforms markdown text into rich,\n * interactive HTML with custom styling and Intlayer integration. Supports\n * code syntax highlighting, responsive tables, internationalized links,\n * and automatic frontmatter stripping.\n *\n * @component\n */\nexport const MarkdownRenderer: FC<MarkdownRendererProps> = ({\n children,\n isDarkMode,\n locale,\n forceBlock,\n preserveFrontmatter,\n tagfilter,\n components: componentsProp,\n wrapper,\n}) => {\n const markdownOptions = getIntlayerMarkdownOptions(isDarkMode ?? false);\n\n const markdownContent = renderMarkdown(children, {\n components: {\n ...markdownOptions.components,\n // Pass dynamic props to components\n code: ({ className, children, ...rest }: ComponentProps<'code'>) => {\n // Ensure children is a string (Markdown renderer might pass ReactNodes)\n const content = String(children ?? '').replace(/\\n$/, '');\n\n // Determine if it is inline code or a code block\n // Code blocks usually have a className like 'language-ts'\n const isBlock = !!className;\n\n if (!isBlock) {\n return (\n <strong className=\"rounded bg-card/60 box-decoration-clone px-1 py-0.5 font-mono text-sm\">\n {content}\n </strong>\n );\n }\n\n // Extract language from className (e.g., \"language-typescript\" -> \"typescript\")\n const language = (className?.replace(/lang(?:uage)?-/, '') ||\n 'plaintext') as BundledLanguage;\n\n return (\n <Code\n {...rest}\n language={language}\n showHeader={true}\n isDarkMode={isDarkMode} // Ensure this variable is available in scope\n >\n {content}\n </Code>\n );\n },\n\n a: (props) => (\n // @ts-expect-error - label is not required in LinkProps\n <Link\n isExternalLink={props.href?.startsWith('http')}\n underlined={true}\n locale={locale}\n {...props}\n color=\"neutral\"\n />\n ),\n ...componentsProp,\n },\n wrapper: wrapper ?? markdownOptions.wrapper,\n forceBlock: forceBlock ?? markdownOptions.forceBlock,\n preserveFrontmatter:\n preserveFrontmatter ?? markdownOptions.preserveFrontmatter,\n tagfilter: tagfilter ?? markdownOptions.tagfilter,\n });\n\n return (\n <CodeProvider>\n <TabProvider>{markdownContent}</TabProvider>\n </CodeProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;;AA4BA,MAAa,8BAEe,gBAAgB,EAC1C,YAAY;CACV,KAAK,UAAU,oBAAC;EAAG,aAAa;EAAM,GAAI;GAAS;CACnD,KAAK,UAAU,oBAAC;EAAG,aA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MAAM,MAAM,WAAW,OAAO;IAC9C,YAAY;IACJ;IACR,GAAI;IACJ,OAAM;KACN;GAEJ,GAAG;GACJ;EACD,SAAS,WAAW,gBAAgB;EACpC,YAAY,cAAc,gBAAgB;EAC1C,qBACE,uBAAuB,gBAAgB;EACzC,WAAW,aAAa,gBAAgB;EACzC,CAAC,GAI8C,GAC/B"}
1
+ {"version":3,"file":"MarkDownRender.mjs","names":[],"sources":["../../../../src/components/MarkDownRender/MarkDownRender.tsx"],"sourcesContent":["import type { LocalesValues } from '@intlayer/types';\nimport { cn } from '@utils/cn';\nimport type { ComponentProps, ComponentPropsWithoutRef, FC } from 'react';\nimport {\n type MarkdownRenderer as MarkdownRendererIntlayer,\n type RenderMarkdownProps,\n renderMarkdown,\n} from 'react-intlayer';\nimport type { BundledLanguage } from 'shiki/bundle/web';\nimport { H1, H2, H3, H4, H5, H6 } from '../Headers';\nimport { Code } from '../IDE/Code';\nimport { CodeProvider } from '../IDE/CodeContext';\nimport { Link } from '../Link';\nimport { Tab } from '../Tab';\nimport { TabProvider } from '../Tab/TabContext';\nimport { Table } from '../Table';\n\ntype MarkdownRendererProps = {\n children: string;\n isDarkMode?: boolean;\n locale?: LocalesValues;\n forceBlock?: boolean;\n preserveFrontmatter?: boolean;\n tagfilter?: boolean;\n components?: ComponentProps<typeof MarkdownRendererIntlayer>['components'];\n wrapper?: ComponentProps<typeof MarkdownRendererIntlayer>['wrapper'];\n};\n\nexport const getIntlayerMarkdownOptions: (\n isDarkMode: boolean\n) => RenderMarkdownProps = (isDarkMode) => ({\n components: {\n h1: (props) => <H1 isClickable={true} {...props} />,\n h2: (props) => <H2 isClickable={true} className=\"mt-16\" {...props} />,\n h3: (props) => <H3 isClickable={true} className=\"mt-5\" {...props} />,\n h4: (props) => <H4 isClickable={true} className=\"mt-3\" {...props} />,\n h5: (props) => <H5 isClickable={true} className=\"mt-3\" {...props} />,\n h6: (props) => <H6 isClickable={true} className=\"mt-3\" {...props} />,\n\n code: ({ className, children, ...rest }: ComponentProps<'code'>) => {\n // Ensure children is a string (Markdown renderer might pass ReactNodes)\n const content = String(children ?? '').replace(/\\n$/, '');\n\n // Determine if it is inline code or a code block\n // Code blocks usually have a className like 'language-ts'\n const isBlock = !!className;\n\n if (!isBlock) {\n return (\n <strong className=\"rounded bg-card/60 box-decoration-clone px-1 py-0.5 font-mono text-sm\">\n {content}\n </strong>\n );\n }\n\n // Extract language from className (e.g., \"language-typescript\" -> \"typescript\")\n const language = (className?.replace(/lang(?:uage)?-/, '') ||\n 'plaintext') as BundledLanguage;\n\n console.log({ rest });\n\n return (\n <Code\n {...rest}\n language={language}\n showHeader={true}\n isDarkMode={isDarkMode} // Ensure this variable is available in scope\n >\n {content}\n </Code>\n );\n },\n\n blockquote: ({ className, ...props }) => (\n <blockquote\n className={cn(\n 'mt-5 gap-3 border-card border-l-4 pl-5 text-neutral',\n className\n )}\n {...props}\n />\n ),\n ul: ({ className, ...props }) => (\n <ul\n className={cn('mt-5 flex list-disc flex-col gap-3 pl-5', className)}\n {...props}\n />\n ),\n ol: ({ className, ...props }) => (\n <ol\n className={cn('mt-5 flex list-decimal flex-col gap-3 pl-5', className)}\n {...props}\n />\n ),\n img: ({ className, ...props }) => (\n <img\n {...props}\n alt={props.alt ?? ''}\n loading=\"lazy\"\n className={cn('max-h-[80vh] max-w-full rounded-md', className)}\n src={`${props.src}?raw=true`}\n />\n ),\n a: (props) => (\n // @ts-expect-error - label is not required in LinkProps\n <Link\n isExternalLink={props.href?.startsWith('http')}\n underlined={true}\n // locale={locale}\n {...props}\n color=\"neutral\"\n />\n ),\n pre: (props) => props.children,\n\n table: (props: ComponentProps<typeof Table>) => (\n <Table isRollable={true} {...props} />\n ),\n th: ({ className, ...props }) => (\n <th\n className={cn('border-neutral border-b bg-neutral/10 p-4', className)}\n {...props}\n />\n ),\n tr: ({ className, ...props }) => (\n <tr\n className={cn('hover:/10 hover:bg-neutral/10', className)}\n {...props}\n />\n ),\n td: ({ className, ...props }) => (\n <td\n className={cn('border-neutral-500/50 border-b p-4', className)}\n {...props}\n />\n ),\n hr: ({ className, ...props }) => (\n <hr className={cn('mx-6 mt-16 text-neutral', className)} {...props} />\n ),\n Tabs: (props: ComponentProps<typeof Tab>) => (\n <Tab\n {...props}\n className=\"rounded-xl border border-card\"\n headerClassName=\"sticky rounded-xl top-24 z-5 bg-background/70 backdrop-blur overflow-x-auto\"\n />\n ),\n Tab: Tab.Item,\n Columns: ({ className, ...props }: ComponentPropsWithoutRef<'div'>) => (\n <div className={cn('flex gap-4 max-md:flex-col', className)} {...props} />\n ),\n Column: ({ className, ...props }: ComponentPropsWithoutRef<'div'>) => (\n <div className={cn('flex-1', className)} {...props} />\n ),\n },\n});\n\n/**\n * MarkdownRenderer Component\n *\n * A comprehensive markdown renderer that transforms markdown text into rich,\n * interactive HTML with custom styling and Intlayer integration. Supports\n * code syntax highlighting, responsive tables, internationalized links,\n * and automatic frontmatter stripping.\n *\n * @component\n */\nexport const MarkdownRenderer: FC<MarkdownRendererProps> = ({\n children,\n isDarkMode,\n locale,\n forceBlock,\n preserveFrontmatter,\n tagfilter,\n components: componentsProp,\n wrapper,\n}) => {\n const markdownOptions = getIntlayerMarkdownOptions(isDarkMode ?? false);\n\n const markdownContent = renderMarkdown(children, {\n components: {\n ...markdownOptions.components,\n // Pass dynamic props to components\n code: ({ className, children, ...rest }: ComponentProps<'code'>) => {\n // Ensure children is a string (Markdown renderer might pass ReactNodes)\n const content = String(children ?? '').replace(/\\n$/, '');\n\n // Determine if it is inline code or a code block\n // Code blocks usually have a className like 'language-ts'\n const isBlock = !!className;\n\n if (!isBlock) {\n return (\n <strong className=\"rounded bg-card/60 box-decoration-clone px-1 py-0.5 font-mono text-sm\">\n {content}\n </strong>\n );\n }\n\n // Extract language from className (e.g., \"language-typescript\" -> \"typescript\")\n const language = (className?.replace(/lang(?:uage)?-/, '') ||\n 'plaintext') as BundledLanguage;\n\n return (\n <Code\n {...rest}\n language={language}\n showHeader={true}\n isDarkMode={isDarkMode} // Ensure this variable is available in scope\n >\n {content}\n </Code>\n );\n },\n\n a: (props) => (\n // @ts-expect-error - label is not required in LinkProps\n <Link\n isExternalLink={props.href?.startsWith('http')}\n underlined={true}\n locale={locale}\n {...props}\n color=\"neutral\"\n />\n ),\n ...componentsProp,\n },\n wrapper: wrapper ?? markdownOptions.wrapper,\n forceBlock: forceBlock ?? markdownOptions.forceBlock,\n preserveFrontmatter:\n preserveFrontmatter ?? markdownOptions.preserveFrontmatter,\n tagfilter: tagfilter ?? markdownOptions.tagfilter,\n });\n\n return (\n <CodeProvider>\n <TabProvider>{markdownContent}</TabProvider>\n </CodeProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;;AA4BA,MAAa,8BAEe,gBAAgB,EAC1C,YAAY;CACV,KAAK,UAAU,oBAAC;EAAG,aAAa;EAAM,GAAI;GAAS;CACnD,KAAK,UAAU,oBAAC;EAAG,aAAa;EAAM,WAAU;EAAQ,GAAI;GAAS;CACrE,KAAK,UAAU,oBAAC;EAAG,aAAa;EAAM,WAAU;EAAO,GAAI;GAAS;CACpE,KAAK,UAAU,oBAAC;EAAG,aAAa;EAAM,WAAU;EAAO,GAAI;GAAS;CACpE,KAAK,UAAU,oBAAC;EAAG,aAAa;EAAM,WAAU;EAAO,GAAI;GAAS;CACpE,KAAK,UAAU,oBAAC;EAAG,aAAa;EAAM,WAAU;EAAO,GAAI;GAAS;CAEpE,OAAO,EAAE,WAAW,UAAU,GAAG,WAAmC;EAElE,MAAM,UAAU,OAAO,YAAY,GAAG,CAAC,QAAQ,OAAO,GAAG;AAMzD,MAAI,CAFY,CAAC,CAAC,UAGhB,QACE,oBAAC;GAAO,WAAU;aACf;IACM;EAKb,MAAM,WAAY,WAAW,QAAQ,kBAAkB,GAAG,IACxD;AAEF,UAAQ,IAAI,EAAE,MAAM,CAAC;AAErB,SACE,oBAAC;GACC,GAAI;GACM;GACV,YAAY;GACA;aAEX;IACI;;CAIX,aAAa,EAAE,WAAW,GAAG,YAC3B,oB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;CAEzD,EACF;;;;;;;;;;;AAYD,MAAa,oBAA+C,EAC1D,UACA,YACA,QACA,YACA,qBACA,WACA,YAAY,gBACZ,cACI;CACJ,MAAM,kBAAkB,2BAA2B,cAAc,MAAM;AAyDvE,QACE,oBAAC,0BACC,oBAAC,yBAzDmB,eAAe,UAAU;EAC/C,YAAY;GACV,GAAG,gBAAgB;GAEnB,OAAO,EAAE,WAAW,UAAU,GAAG,WAAmC;IAElE,MAAM,UAAU,OAAO,YAAY,GAAG,CAAC,QAAQ,OAAO,GAAG;AAMzD,QAAI,CAFY,CAAC,CAAC,UAGhB,QACE,oBAAC;KAAO,WAAU;eACf;MACM;IAKb,MAAM,WAAY,WAAW,QAAQ,kBAAkB,GAAG,IACxD;AAEF,WACE,oBAAC;KACC,GAAI;KACM;KACV,YAAY;KACA;eAEX;MACI;;GAIX,IAAI,UAEF,oBAAC;IACC,gBAAgB,MAAM,MAAM,WAAW,OAAO;IAC9C,YAAY;IACJ;IACR,GAAI;IACJ,OAAM;KACN;GAEJ,GAAG;GACJ;EACD,SAAS,WAAW,gBAAgB;EACpC,YAAY,cAAc,gBAAgB;EAC1C,qBACE,uBAAuB,gBAAgB;EACzC,WAAW,aAAa,gBAAgB;EACzC,CAAC,GAI8C,GAC/B"}
@@ -1,14 +1,14 @@
1
1
  'use client';
2
2
 
3
+ import { useGetElementOrWindow } from "../../hooks/useGetElementOrWindow.mjs";
4
+ import { useScrollBlockage } from "../../hooks/useScrollBlockage/index.mjs";
3
5
  import { cn } from "../../utils/cn.mjs";
4
6
  import { Container } from "../Container/index.mjs";
5
7
  import { Button, ButtonColor, ButtonSize, ButtonVariant } from "../Button/Button.mjs";
6
8
  import { H3 } from "../Headers/index.mjs";
7
- import { useGetElementOrWindow } from "../../hooks/useGetElementOrWindow.mjs";
8
- import { useScrollBlockage } from "../../hooks/useScrollBlockage/index.mjs";
9
- import { X } from "lucide-react";
10
9
  import { useEffect } from "react";
11
10
  import { cva } from "class-variance-authority";
11
+ import { X } from "lucide-react";
12
12
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
13
13
  import { motion } from "framer-motion";
14
14
  import { createPortal } from "react-dom";
@@ -1,9 +1,9 @@
1
1
  'use client';
2
2
 
3
- import { cn } from "../../utils/cn.mjs";
4
- import { MaxHeightSmoother } from "../MaxHeightSmoother/index.mjs";
5
3
  import { useScrollBlockage } from "../../hooks/useScrollBlockage/index.mjs";
6
4
  import { useScrollDetection } from "../../hooks/useScrollDetection.mjs";
5
+ import { cn } from "../../utils/cn.mjs";
6
+ import { MaxHeightSmoother } from "../MaxHeightSmoother/index.mjs";
7
7
  import { Burger } from "./Burger.mjs";
8
8
  import { useRef, useState } from "react";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,11 +1,11 @@
1
1
  'use client';
2
2
 
3
+ import { useItemSelector } from "../../hooks/useItemSelector.mjs";
3
4
  import { cn } from "../../utils/cn.mjs";
4
5
  import { Button, ButtonColor, ButtonSize, ButtonVariant } from "../Button/Button.mjs";
5
- import { useItemSelector } from "../../hooks/useItemSelector.mjs";
6
- import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react";
7
6
  import { useEffect, useRef } from "react";
8
7
  import { cva } from "class-variance-authority";
8
+ import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
10
 
11
11
  //#region src/components/Pagination/Pagination.tsx
@@ -1,16 +1,16 @@
1
1
  'use client';
2
2
 
3
+ import { useDevice } from "../../hooks/useDevice.mjs";
4
+ import { useScrollBlockage } from "../../hooks/useScrollBlockage/index.mjs";
3
5
  import { Container } from "../Container/index.mjs";
4
6
  import { Button, ButtonColor, ButtonSize, ButtonVariant } from "../Button/Button.mjs";
5
- import { useDevice } from "../../hooks/useDevice.mjs";
6
7
  import { KeyboardShortcut } from "../KeyboardShortcut/KeyboardShortcut.mjs";
7
8
  import { Popover } from "../Popover/dynamic.mjs";
8
- import { useScrollBlockage } from "../../hooks/useScrollBlockage/index.mjs";
9
9
  import { MaxWidthSmoother } from "../MaxWidthSmoother/index.mjs";
10
10
  import { isElementAtTopAndNotCovered } from "./isElementAtTopAndNotCovered.mjs";
11
11
  import { useRightDrawer } from "./useRightDrawer.mjs";
12
- import { ChevronLeft, X } from "lucide-react";
13
12
  import { useEffect, useRef } from "react";
13
+ import { ChevronLeft, X } from "lucide-react";
14
14
  import { jsx, jsxs } from "react/jsx-runtime";
15
15
  import { useIntlayer } from "react-intlayer";
16
16
 
@@ -3,8 +3,8 @@
3
3
  import { cn } from "../../utils/cn.mjs";
4
4
  import { Badge, BadgeColor } from "../Badge/index.mjs";
5
5
  import { Command, CommandRoot } from "../Command/index.mjs";
6
- import { Check, X } from "lucide-react";
7
6
  import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
7
+ import { Check, X } from "lucide-react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
9
 
10
10
  //#region src/components/Select/Multiselect.tsx