@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.
- package/dist/.vite/manifest.json +3 -14
- package/dist/components/Container/index.cjs +1 -1
- package/dist/components/Container/index.cjs.map +1 -1
- package/dist/components/Container/index.mjs +1 -1
- package/dist/components/Container/index.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditor.cjs +18 -7
- package/dist/components/DictionaryFieldEditor/ContentEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditor.mjs +18 -7
- package/dist/components/DictionaryFieldEditor/ContentEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs +233 -204
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.d.ts +1 -0
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +237 -208
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EnumKeyInput.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/EnumKeyInput.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EnumKeyInput.mjs +1 -1
- package/dist/components/DictionaryFieldEditor/EnumKeyInput.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs +18 -12
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +19 -13
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.cjs +64 -0
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts +64 -0
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.mjs +64 -0
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureEditor.cjs +4 -4
- package/dist/components/DictionaryFieldEditor/StructureEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureEditor.mjs +4 -4
- package/dist/components/DictionaryFieldEditor/StructureEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureView/StructureView.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/StructureView/StructureView.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureView/StructureView.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/StructureView/StructureView.mjs.map +1 -1
- package/dist/components/MaxHeightSmoother/index.cjs +1 -1
- package/dist/components/MaxHeightSmoother/index.cjs.map +1 -1
- package/dist/components/MaxHeightSmoother/index.d.ts.map +1 -1
- package/dist/components/MaxHeightSmoother/index.mjs +1 -1
- package/dist/components/MaxHeightSmoother/index.mjs.map +1 -1
- package/dist/hooks/intlayerAPIHooks.cjs +1 -1
- package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
- package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
- package/dist/hooks/intlayerAPIHooks.mjs +1 -1
- package/dist/hooks/intlayerAPIHooks.mjs.map +1 -1
- package/dist/index-BCuMWKyy.js.map +1 -1
- package/dist/index-BYzBot7l.cjs.map +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/zod-BV4nCGJE.js.map +1 -1
- package/dist/zod-DSrtTSD_.cjs.map +1 -1
- package/package.json +19 -19
- package/dist/components/DictionaryFieldEditor/ContentEditorView/EditorView.cjs +0 -49
- package/dist/components/DictionaryFieldEditor/ContentEditorView/EditorView.cjs.map +0 -1
- package/dist/components/DictionaryFieldEditor/ContentEditorView/EditorView.d.ts +0 -10
- package/dist/components/DictionaryFieldEditor/ContentEditorView/EditorView.d.ts.map +0 -1
- package/dist/components/DictionaryFieldEditor/ContentEditorView/EditorView.mjs +0 -49
- package/dist/components/DictionaryFieldEditor/ContentEditorView/EditorView.mjs.map +0 -1
package/dist/.vite/manifest.json
CHANGED
|
@@ -794,22 +794,12 @@
|
|
|
794
794
|
"src/components/Container/index.tsx",
|
|
795
795
|
"src/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.tsx",
|
|
796
796
|
"src/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.tsx",
|
|
797
|
-
"src/components/DictionaryFieldEditor/ContentEditorView/
|
|
797
|
+
"src/components/DictionaryFieldEditor/ContentEditorView/TextEditor.tsx",
|
|
798
|
+
"src/components/DictionaryFieldEditor/getIsEditableSection.ts",
|
|
798
799
|
"src/components/DictionaryFieldEditor/KeyPathBreadcrumb.tsx",
|
|
799
800
|
"src/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.tsx"
|
|
800
801
|
]
|
|
801
802
|
},
|
|
802
|
-
"src/components/DictionaryFieldEditor/ContentEditorView/EditorView.tsx": {
|
|
803
|
-
"file": "components/DictionaryFieldEditor/ContentEditorView/EditorView.cjs",
|
|
804
|
-
"name": "components/DictionaryFieldEditor/ContentEditorView/EditorView",
|
|
805
|
-
"src": "src/components/DictionaryFieldEditor/ContentEditorView/EditorView.tsx",
|
|
806
|
-
"isEntry": true,
|
|
807
|
-
"imports": [
|
|
808
|
-
"src/components/Container/index.tsx",
|
|
809
|
-
"src/components/DictionaryFieldEditor/getIsEditableSection.ts",
|
|
810
|
-
"src/components/DictionaryFieldEditor/ContentEditorView/TextEditor.tsx"
|
|
811
|
-
]
|
|
812
|
-
},
|
|
813
803
|
"src/components/DictionaryFieldEditor/ContentEditorView/TextEditor.tsx": {
|
|
814
804
|
"file": "components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs",
|
|
815
805
|
"name": "components/DictionaryFieldEditor/ContentEditorView/TextEditor",
|
|
@@ -821,10 +811,10 @@
|
|
|
821
811
|
"src/hooks/intlayerAPIHooks.ts",
|
|
822
812
|
"src/utils/object.ts",
|
|
823
813
|
"src/components/Button/Button.tsx",
|
|
814
|
+
"src/components/Container/index.tsx",
|
|
824
815
|
"src/components/ContentEditor/ContentEditorInput.tsx",
|
|
825
816
|
"src/components/ContentEditor/ContentEditorTextArea.tsx",
|
|
826
817
|
"src/components/Label/index.tsx",
|
|
827
|
-
"src/components/Container/index.tsx",
|
|
828
818
|
"src/components/DropDown/index.tsx",
|
|
829
819
|
"src/components/Input/Input.tsx",
|
|
830
820
|
"src/components/Input/Checkbox.tsx",
|
|
@@ -833,7 +823,6 @@
|
|
|
833
823
|
"src/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.tsx",
|
|
834
824
|
"src/components/MarkDownRender/index.tsx",
|
|
835
825
|
"src/components/DictionaryFieldEditor/EnumKeyInput.tsx",
|
|
836
|
-
"src/components/DictionaryFieldEditor/getIsEditableSection.ts",
|
|
837
826
|
"src/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.ts"
|
|
838
827
|
]
|
|
839
828
|
},
|
|
@@ -61,7 +61,7 @@ const containerVariants = classVarianceAuthority.cva(
|
|
|
61
61
|
success: "border-success dark:border-success-dark"
|
|
62
62
|
},
|
|
63
63
|
background: {
|
|
64
|
-
none: "bg-inherit",
|
|
64
|
+
none: "bg-inherit dark:bg-inherit",
|
|
65
65
|
hoverable: "!bg-opacity-5 backdrop-blur-0 hover:!bg-opacity-10 hover:backdrop-blur focus:!bg-opacity-10 focus:backdrop-blur aria-selected:!bg-opacity-15 aria-selected:backdrop-blur",
|
|
66
66
|
with: ""
|
|
67
67
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/Container/index.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport {\n type PropsWithChildren,\n type HTMLAttributes,\n type FC,\n type DetailedHTMLProps,\n} from 'react';\nimport { cn } from '../../utils/cn';\n\nconst containerVariants = cva(\n 'flex flex-col p-10 text-text backdrop-blur dark:text-text-dark',\n {\n variants: {\n roundedSize: {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n '2xl': 'rounded-2xl',\n '3xl': 'rounded-3xl',\n full: 'rounded-full',\n },\n transparency: {\n none: '',\n full: 'bg-none',\n sm: 'dark:bg-opacity-90',\n md: 'dark:bg-opacity-70',\n lg: 'dark:bg-opacity-40',\n xl: 'dark:bg-opacity-20',\n },\n backgroundColor: {\n none: 'bg-card dark:bg-card-dark',\n primary: 'bg-primary dark:bg-primary-dark',\n secondary: 'bg-secondary dark:bg-secondary-dark',\n neutral: 'bg-neutral dark:bg-neutral-dark',\n text: 'bg-text dark:bg-text-dark',\n card: 'bg-card dark:bg-card-dark',\n contrast: 'bg-background-dark dark:bg-background',\n },\n padding: {\n none: 'p-0',\n sm: 'p-1',\n md: 'p-2',\n lg: 'p-3',\n xl: 'p-4',\n },\n separator: {\n without: '',\n x: 'divide-x divide-dashed divide-text/20 dark:divide-text-dark/20',\n y: 'divide-y divide-dashed divide-text/20 dark:divide-text-dark/20',\n both: 'divide-x divide-y divide-dashed divide-text/20 dark:divide-text-dark/20',\n },\n border: {\n none: '',\n with: 'border-[1.5px]',\n },\n borderColor: {\n primary: 'border-primary dark:border-primary-dark',\n secondary: 'border-secondary dark:border-secondary-dark',\n neutral: 'border-neutral dark:border-neutral-dark',\n text: 'border-text dark:border-text-dark',\n error: 'border-error dark:border-error-dark',\n warning: 'border-warning dark:border-warning-dark',\n success: 'border-success dark:border-success-dark',\n },\n background: {\n none: 'bg-inherit',\n hoverable:\n '!bg-opacity-5 backdrop-blur-0 hover:!bg-opacity-10 hover:backdrop-blur focus:!bg-opacity-10 focus:backdrop-blur aria-selected:!bg-opacity-15 aria-selected:backdrop-blur',\n with: '',\n },\n gap: {\n none: 'gap-0',\n sm: 'gap-1',\n md: 'gap-3',\n lg: 'gap-5',\n xl: 'gap-8',\n '2xl': 'gap-10',\n },\n },\n\n defaultVariants: {\n roundedSize: 'md',\n border: 'none',\n borderColor: 'text',\n backgroundColor: 'card',\n transparency: 'md',\n padding: 'none',\n separator: 'without',\n gap: 'none',\n },\n }\n);\n\nexport type ContainerProps = PropsWithChildren<\n Omit<VariantProps<typeof containerVariants>, 'border'>\n> &\n DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {\n border?: boolean;\n };\n\nexport const Container: FC<ContainerProps> = ({\n children,\n roundedSize,\n padding,\n transparency,\n separator,\n className,\n border,\n borderColor,\n backgroundColor,\n background,\n ...props\n}) => (\n <div\n className={cn(\n containerVariants({\n roundedSize,\n transparency,\n padding,\n separator,\n border:\n typeof border === 'boolean' ? (border ? 'with' : 'none') : undefined,\n background,\n backgroundColor,\n borderColor,\n className,\n })\n )}\n {...props}\n >\n {children}\n </div>\n);\n\nContainer.displayName = 'Container';\n"],"names":["cva","jsx","cn"],"mappings":";;;;;AASA,MAAM,oBAAoBA,uBAAA;AAAA,EACxB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,aAAa;AAAA,QACX,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,OAAO;AAAA,QACP,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,cAAc;AAAA,QACZ,MAAM;AAAA,QACN,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QAC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BAAkB;AAAA,QAChB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,QACE,OAAO,WAAW,YAAa,SAAS,SAAS,SAAU;AAAA,QAC7D;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD,CAAA;AAAA,IACH;AAAA,IACC,GAAG;AAAA,IAEH;AAAA,EAAA;AACH;AAGF,UAAU,cAAc;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/Container/index.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport {\n type PropsWithChildren,\n type HTMLAttributes,\n type FC,\n type DetailedHTMLProps,\n} from 'react';\nimport { cn } from '../../utils/cn';\n\nconst containerVariants = cva(\n 'flex flex-col p-10 text-text backdrop-blur dark:text-text-dark',\n {\n variants: {\n roundedSize: {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n '2xl': 'rounded-2xl',\n '3xl': 'rounded-3xl',\n full: 'rounded-full',\n },\n transparency: {\n none: '',\n full: 'bg-none',\n sm: 'dark:bg-opacity-90',\n md: 'dark:bg-opacity-70',\n lg: 'dark:bg-opacity-40',\n xl: 'dark:bg-opacity-20',\n },\n backgroundColor: {\n none: 'bg-card dark:bg-card-dark',\n primary: 'bg-primary dark:bg-primary-dark',\n secondary: 'bg-secondary dark:bg-secondary-dark',\n neutral: 'bg-neutral dark:bg-neutral-dark',\n text: 'bg-text dark:bg-text-dark',\n card: 'bg-card dark:bg-card-dark',\n contrast: 'bg-background-dark dark:bg-background',\n },\n padding: {\n none: 'p-0',\n sm: 'p-1',\n md: 'p-2',\n lg: 'p-3',\n xl: 'p-4',\n },\n separator: {\n without: '',\n x: 'divide-x divide-dashed divide-text/20 dark:divide-text-dark/20',\n y: 'divide-y divide-dashed divide-text/20 dark:divide-text-dark/20',\n both: 'divide-x divide-y divide-dashed divide-text/20 dark:divide-text-dark/20',\n },\n border: {\n none: '',\n with: 'border-[1.5px]',\n },\n borderColor: {\n primary: 'border-primary dark:border-primary-dark',\n secondary: 'border-secondary dark:border-secondary-dark',\n neutral: 'border-neutral dark:border-neutral-dark',\n text: 'border-text dark:border-text-dark',\n error: 'border-error dark:border-error-dark',\n warning: 'border-warning dark:border-warning-dark',\n success: 'border-success dark:border-success-dark',\n },\n background: {\n none: 'bg-inherit dark:bg-inherit',\n hoverable:\n '!bg-opacity-5 backdrop-blur-0 hover:!bg-opacity-10 hover:backdrop-blur focus:!bg-opacity-10 focus:backdrop-blur aria-selected:!bg-opacity-15 aria-selected:backdrop-blur',\n with: '',\n },\n gap: {\n none: 'gap-0',\n sm: 'gap-1',\n md: 'gap-3',\n lg: 'gap-5',\n xl: 'gap-8',\n '2xl': 'gap-10',\n },\n },\n\n defaultVariants: {\n roundedSize: 'md',\n border: 'none',\n borderColor: 'text',\n backgroundColor: 'card',\n transparency: 'md',\n padding: 'none',\n separator: 'without',\n gap: 'none',\n },\n }\n);\n\nexport type ContainerProps = PropsWithChildren<\n Omit<VariantProps<typeof containerVariants>, 'border'>\n> &\n DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {\n border?: boolean;\n };\n\nexport const Container: FC<ContainerProps> = ({\n children,\n roundedSize,\n padding,\n transparency,\n separator,\n className,\n border,\n borderColor,\n backgroundColor,\n background,\n ...props\n}) => (\n <div\n className={cn(\n containerVariants({\n roundedSize,\n transparency,\n padding,\n separator,\n border:\n typeof border === 'boolean' ? (border ? 'with' : 'none') : undefined,\n background,\n backgroundColor,\n borderColor,\n className,\n })\n )}\n {...props}\n >\n {children}\n </div>\n);\n\nContainer.displayName = 'Container';\n"],"names":["cva","jsx","cn"],"mappings":";;;;;AASA,MAAM,oBAAoBA,uBAAA;AAAA,EACxB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,aAAa;AAAA,QACX,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;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EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACEC,2BAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC,SAAA;AAAA,MACT,kBAAkB;AAAA,QAChB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,QACE,OAAO,WAAW,YAAa,SAAS,SAAS,SAAU;AAAA,QAC7D;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD,CAAA;AAAA,IACH;AAAA,IACC,GAAG;AAAA,IAEH;AAAA,EAAA;AACH;AAGF,UAAU,cAAc;;"}
|
|
@@ -59,7 +59,7 @@ const containerVariants = cva(
|
|
|
59
59
|
success: "border-success dark:border-success-dark"
|
|
60
60
|
},
|
|
61
61
|
background: {
|
|
62
|
-
none: "bg-inherit",
|
|
62
|
+
none: "bg-inherit dark:bg-inherit",
|
|
63
63
|
hoverable: "!bg-opacity-5 backdrop-blur-0 hover:!bg-opacity-10 hover:backdrop-blur focus:!bg-opacity-10 focus:backdrop-blur aria-selected:!bg-opacity-15 aria-selected:backdrop-blur",
|
|
64
64
|
with: ""
|
|
65
65
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/components/Container/index.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport {\n type PropsWithChildren,\n type HTMLAttributes,\n type FC,\n type DetailedHTMLProps,\n} from 'react';\nimport { cn } from '../../utils/cn';\n\nconst containerVariants = cva(\n 'flex flex-col p-10 text-text backdrop-blur dark:text-text-dark',\n {\n variants: {\n roundedSize: {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n '2xl': 'rounded-2xl',\n '3xl': 'rounded-3xl',\n full: 'rounded-full',\n },\n transparency: {\n none: '',\n full: 'bg-none',\n sm: 'dark:bg-opacity-90',\n md: 'dark:bg-opacity-70',\n lg: 'dark:bg-opacity-40',\n xl: 'dark:bg-opacity-20',\n },\n backgroundColor: {\n none: 'bg-card dark:bg-card-dark',\n primary: 'bg-primary dark:bg-primary-dark',\n secondary: 'bg-secondary dark:bg-secondary-dark',\n neutral: 'bg-neutral dark:bg-neutral-dark',\n text: 'bg-text dark:bg-text-dark',\n card: 'bg-card dark:bg-card-dark',\n contrast: 'bg-background-dark dark:bg-background',\n },\n padding: {\n none: 'p-0',\n sm: 'p-1',\n md: 'p-2',\n lg: 'p-3',\n xl: 'p-4',\n },\n separator: {\n without: '',\n x: 'divide-x divide-dashed divide-text/20 dark:divide-text-dark/20',\n y: 'divide-y divide-dashed divide-text/20 dark:divide-text-dark/20',\n both: 'divide-x divide-y divide-dashed divide-text/20 dark:divide-text-dark/20',\n },\n border: {\n none: '',\n with: 'border-[1.5px]',\n },\n borderColor: {\n primary: 'border-primary dark:border-primary-dark',\n secondary: 'border-secondary dark:border-secondary-dark',\n neutral: 'border-neutral dark:border-neutral-dark',\n text: 'border-text dark:border-text-dark',\n error: 'border-error dark:border-error-dark',\n warning: 'border-warning dark:border-warning-dark',\n success: 'border-success dark:border-success-dark',\n },\n background: {\n none: 'bg-inherit',\n hoverable:\n '!bg-opacity-5 backdrop-blur-0 hover:!bg-opacity-10 hover:backdrop-blur focus:!bg-opacity-10 focus:backdrop-blur aria-selected:!bg-opacity-15 aria-selected:backdrop-blur',\n with: '',\n },\n gap: {\n none: 'gap-0',\n sm: 'gap-1',\n md: 'gap-3',\n lg: 'gap-5',\n xl: 'gap-8',\n '2xl': 'gap-10',\n },\n },\n\n defaultVariants: {\n roundedSize: 'md',\n border: 'none',\n borderColor: 'text',\n backgroundColor: 'card',\n transparency: 'md',\n padding: 'none',\n separator: 'without',\n gap: 'none',\n },\n }\n);\n\nexport type ContainerProps = PropsWithChildren<\n Omit<VariantProps<typeof containerVariants>, 'border'>\n> &\n DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {\n border?: boolean;\n };\n\nexport const Container: FC<ContainerProps> = ({\n children,\n roundedSize,\n padding,\n transparency,\n separator,\n className,\n border,\n borderColor,\n backgroundColor,\n background,\n ...props\n}) => (\n <div\n className={cn(\n containerVariants({\n roundedSize,\n transparency,\n padding,\n separator,\n border:\n typeof border === 'boolean' ? (border ? 'with' : 'none') : undefined,\n background,\n backgroundColor,\n borderColor,\n className,\n })\n )}\n {...props}\n >\n {children}\n </div>\n);\n\nContainer.displayName = 'Container';\n"],"names":[],"mappings":";;;AASA,MAAM,oBAAoB;AAAA,EACxB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,aAAa;AAAA,QACX,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,OAAO;AAAA,QACP,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,cAAc;AAAA,QACZ,MAAM;AAAA,QACN,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACN;AAAA,MACA,iBAAiB;AAAA,QACf,MAAM;AAAA,QACN,SAAS;AAAA,QACT,WAAW;AAAA,QACX,SAAS;AAAA,QACT,MAAM;AAAA,QACN,MAAM;AAAA,QACN,UAAU;AAAA,MACZ;AAAA,MACA,SAAS;AAAA,QACP,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACN;AAAA,MACA,WAAW;AAAA,QACT,SAAS;AAAA,QACT,GAAG;AAAA,QACH,GAAG;AAAA,QACH,MAAM;AAAA,MACR;AAAA,MACA,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,MACA,aAAa;AAAA,QACX,SAAS;AAAA,QACT,WAAW;AAAA,QACX,SAAS;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,QACP,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,MACA,YAAY;AAAA,QACV,MAAM;AAAA,QACN,WACE;AAAA,QACF,MAAM;AAAA,MACR;AAAA,MACA,KAAK;AAAA,QACH,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,OAAO;AAAA,MAAA;AAAA,IAEX;AAAA,IAEA,iBAAiB;AAAA,MACf,aAAa;AAAA,MACb,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,iBAAiB;AAAA,MACjB,cAAc;AAAA,MACd,SAAS;AAAA,MACT,WAAW;AAAA,MACX,KAAK;AAAA,IAAA;AAAA,EACP;AAEJ;AASO,MAAM,YAAgC,CAAC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACE;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAW;AAAA,MACT,kBAAkB;AAAA,QAChB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,QACE,OAAO,WAAW,YAAa,SAAS,SAAS,SAAU;AAAA,QAC7D;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD,CAAA;AAAA,IACH;AAAA,IACC,GAAG;AAAA,IAEH;AAAA,EAAA;AACH;AAGF,UAAU,cAAc;"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/components/Container/index.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport {\n type PropsWithChildren,\n type HTMLAttributes,\n type FC,\n type DetailedHTMLProps,\n} from 'react';\nimport { cn } from '../../utils/cn';\n\nconst containerVariants = cva(\n 'flex flex-col p-10 text-text backdrop-blur dark:text-text-dark',\n {\n variants: {\n roundedSize: {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n '2xl': 'rounded-2xl',\n '3xl': 'rounded-3xl',\n full: 'rounded-full',\n },\n transparency: {\n none: '',\n full: 'bg-none',\n sm: 'dark:bg-opacity-90',\n md: 'dark:bg-opacity-70',\n lg: 'dark:bg-opacity-40',\n xl: 'dark:bg-opacity-20',\n },\n backgroundColor: {\n none: 'bg-card dark:bg-card-dark',\n primary: 'bg-primary dark:bg-primary-dark',\n secondary: 'bg-secondary dark:bg-secondary-dark',\n neutral: 'bg-neutral dark:bg-neutral-dark',\n text: 'bg-text dark:bg-text-dark',\n card: 'bg-card dark:bg-card-dark',\n contrast: 'bg-background-dark dark:bg-background',\n },\n padding: {\n none: 'p-0',\n sm: 'p-1',\n md: 'p-2',\n lg: 'p-3',\n xl: 'p-4',\n },\n separator: {\n without: '',\n x: 'divide-x divide-dashed divide-text/20 dark:divide-text-dark/20',\n y: 'divide-y divide-dashed divide-text/20 dark:divide-text-dark/20',\n both: 'divide-x divide-y divide-dashed divide-text/20 dark:divide-text-dark/20',\n },\n border: {\n none: '',\n with: 'border-[1.5px]',\n },\n borderColor: {\n primary: 'border-primary dark:border-primary-dark',\n secondary: 'border-secondary dark:border-secondary-dark',\n neutral: 'border-neutral dark:border-neutral-dark',\n text: 'border-text dark:border-text-dark',\n error: 'border-error dark:border-error-dark',\n warning: 'border-warning dark:border-warning-dark',\n success: 'border-success dark:border-success-dark',\n },\n background: {\n none: 'bg-inherit dark:bg-inherit',\n hoverable:\n '!bg-opacity-5 backdrop-blur-0 hover:!bg-opacity-10 hover:backdrop-blur focus:!bg-opacity-10 focus:backdrop-blur aria-selected:!bg-opacity-15 aria-selected:backdrop-blur',\n with: '',\n },\n gap: {\n none: 'gap-0',\n sm: 'gap-1',\n md: 'gap-3',\n lg: 'gap-5',\n xl: 'gap-8',\n '2xl': 'gap-10',\n },\n },\n\n defaultVariants: {\n roundedSize: 'md',\n border: 'none',\n borderColor: 'text',\n backgroundColor: 'card',\n transparency: 'md',\n padding: 'none',\n separator: 'without',\n gap: 'none',\n },\n }\n);\n\nexport type ContainerProps = PropsWithChildren<\n Omit<VariantProps<typeof containerVariants>, 'border'>\n> &\n DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {\n border?: boolean;\n };\n\nexport const Container: FC<ContainerProps> = ({\n children,\n roundedSize,\n padding,\n transparency,\n separator,\n className,\n border,\n borderColor,\n backgroundColor,\n background,\n ...props\n}) => (\n <div\n className={cn(\n containerVariants({\n roundedSize,\n transparency,\n padding,\n separator,\n border:\n typeof border === 'boolean' ? (border ? 'with' : 'none') : undefined,\n background,\n backgroundColor,\n borderColor,\n className,\n })\n )}\n {...props}\n >\n {children}\n </div>\n);\n\nContainer.displayName = 'Container';\n"],"names":[],"mappings":";;;AASA,MAAM,oBAAoB;AAAA,EACxB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,aAAa;AAAA,QACX,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,OAAO;AAAA,QACP,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,cAAc;AAAA,QACZ,MAAM;AAAA,QACN,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACN;AAAA,MACA,iBAAiB;AAAA,QACf,MAAM;AAAA,QACN,SAAS;AAAA,QACT,WAAW;AAAA,QACX,SAAS;AAAA,QACT,MAAM;AAAA,QACN,MAAM;AAAA,QACN,UAAU;AAAA,MACZ;AAAA,MACA,SAAS;AAAA,QACP,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACN;AAAA,MACA,WAAW;AAAA,QACT,SAAS;AAAA,QACT,GAAG;AAAA,QACH,GAAG;AAAA,QACH,MAAM;AAAA,MACR;AAAA,MACA,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,MACA,aAAa;AAAA,QACX,SAAS;AAAA,QACT,WAAW;AAAA,QACX,SAAS;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,QACP,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,MACA,YAAY;AAAA,QACV,MAAM;AAAA,QACN,WACE;AAAA,QACF,MAAM;AAAA,MACR;AAAA,MACA,KAAK;AAAA,QACH,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,OAAO;AAAA,MAAA;AAAA,IAEX;AAAA,IAEA,iBAAiB;AAAA,MACf,aAAa;AAAA,MACb,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,iBAAiB;AAAA,MACjB,cAAc;AAAA,MACd,SAAS;AAAA,MACT,WAAW;AAAA,MACX,KAAK;AAAA,IAAA;AAAA,EACP;AAEJ;AASO,MAAM,YAAgC,CAAC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACE;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAW;AAAA,MACT,kBAAkB;AAAA,QAChB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,QACE,OAAO,WAAW,YAAa,SAAS,SAAS,SAAU;AAAA,QAC7D;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD,CAAA;AAAA,IACH;AAAA,IACC,GAAG;AAAA,IAEH;AAAA,EAAA;AACH;AAGF,UAAU,cAAc;"}
|
|
@@ -2,22 +2,32 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
+
const core = require("@intlayer/core");
|
|
5
6
|
const editorReact = require("@intlayer/editor-react");
|
|
7
|
+
const ReactExports = require("react");
|
|
6
8
|
const components_Container_index = require("../Container/index.cjs");
|
|
7
9
|
const components_LocaleSwitcherContentDropDown_LocaleSwitcherContent = require("../LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs");
|
|
8
10
|
require("../LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs");
|
|
9
|
-
const
|
|
11
|
+
const components_DictionaryFieldEditor_ContentEditorView_TextEditor = require("./ContentEditorView/TextEditor.cjs");
|
|
12
|
+
const components_DictionaryFieldEditor_getIsEditableSection = require("./getIsEditableSection.cjs");
|
|
10
13
|
const components_DictionaryFieldEditor_KeyPathBreadcrumb = require("./KeyPathBreadcrumb.cjs");
|
|
11
14
|
const components_DictionaryFieldEditor_NavigationView_NavigationViewNode = require("./NavigationView/NavigationViewNode.cjs");
|
|
12
15
|
const ContentEditor = ({
|
|
13
16
|
dictionary,
|
|
14
17
|
isDarkMode
|
|
15
18
|
}) => {
|
|
16
|
-
const { content
|
|
19
|
+
const { content, key } = dictionary;
|
|
17
20
|
const { editedContent } = editorReact.useEditedContent();
|
|
18
21
|
const { focusedContent, setFocusedContentKeyPath } = editorReact.useFocusDictionary();
|
|
19
22
|
const focusedKeyPath = focusedContent?.keyPath;
|
|
20
|
-
const section = editedContent?.[key]?.content
|
|
23
|
+
const section = typeof editedContent?.[dictionary.key]?.content === "undefined" ? content : editedContent?.[key]?.content;
|
|
24
|
+
const focusedSection = core.getContentNodeByKeyPath(section, focusedKeyPath ?? []);
|
|
25
|
+
const isEditableFocusedSection = components_DictionaryFieldEditor_getIsEditableSection.getIsEditableSection(focusedSection);
|
|
26
|
+
ReactExports.useEffect(() => {
|
|
27
|
+
if (typeof focusedSection === "undefined") {
|
|
28
|
+
setFocusedContentKeyPath(focusedContent?.keyPath?.slice(0, -1) ?? []);
|
|
29
|
+
}
|
|
30
|
+
}, []);
|
|
21
31
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
22
32
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
23
33
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -49,14 +59,15 @@ const ContentEditor = ({
|
|
|
49
59
|
)
|
|
50
60
|
}
|
|
51
61
|
),
|
|
52
|
-
|
|
53
|
-
|
|
62
|
+
(isEditableFocusedSection || (focusedKeyPath ?? []).length > 0) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
63
|
+
components_DictionaryFieldEditor_ContentEditorView_TextEditor.TextEditorContainer,
|
|
54
64
|
{
|
|
65
|
+
keyPath: focusedKeyPath ?? [],
|
|
66
|
+
section: focusedSection,
|
|
55
67
|
dictionary,
|
|
56
|
-
dictionaryKey: key,
|
|
57
68
|
isDarkMode
|
|
58
69
|
}
|
|
59
|
-
)
|
|
70
|
+
)
|
|
60
71
|
] })
|
|
61
72
|
] });
|
|
62
73
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentEditor.cjs","sources":["../../../src/components/DictionaryFieldEditor/ContentEditor.tsx"],"sourcesContent":["'use client';\n\nimport type
|
|
1
|
+
{"version":3,"file":"ContentEditor.cjs","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 <>\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 <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 </>\n );\n};\n"],"names":["useEditedContent","useFocusDictionary","getContentNodeByKeyPath","getIsEditableSection","useEffect","jsxs","Fragment","jsx","KeyPathBreadcrumb","LocaleSwitcherContent","Container","NavigationViewNode","TextEditorContainer"],"mappings":";;;;;;;;;;;;;;AAiBO,MAAM,gBAAqC,CAAC;AAAA,EACjD;AAAA,EACA;AACF,MAAM;AACE,QAAA,EAAE,SAAS,IAAA,IAAQ;AACnB,QAAA,EAAE,cAAc,IAAIA,6BA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5DJ,2BAAA;AAAA,QAACK,8DAAA;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;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentEditor.d.ts","sourceRoot":"","sources":["../../../src/components/DictionaryFieldEditor/ContentEditor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
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,21 +1,31 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, Fragment, 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 {
|
|
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
|
|
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
|
|
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
|
+
}, []);
|
|
19
29
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
20
30
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
21
31
|
/* @__PURE__ */ jsx(
|
|
@@ -47,14 +57,15 @@ const ContentEditor = ({
|
|
|
47
57
|
)
|
|
48
58
|
}
|
|
49
59
|
),
|
|
50
|
-
|
|
51
|
-
|
|
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
|
|
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 <>\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 <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 </>\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,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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