@intlayer/design-system 8.7.3 → 8.7.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/esm/components/Accordion/Accordion.mjs +2 -2
- package/dist/esm/components/Accordion/Accordion.mjs.map +1 -1
- package/dist/esm/components/Avatar/image.mjs +4 -14
- package/dist/esm/components/Avatar/image.mjs.map +1 -1
- package/dist/esm/components/Badge/index.mjs +21 -21
- package/dist/esm/components/Badge/index.mjs.map +1 -1
- package/dist/esm/components/Breadcrumb/index.mjs +13 -13
- package/dist/esm/components/Breadcrumb/index.mjs.map +1 -1
- package/dist/esm/components/Browser/Browser.content.mjs +0 -20
- package/dist/esm/components/Browser/Browser.content.mjs.map +1 -1
- package/dist/esm/components/Button/Button.mjs +60 -60
- package/dist/esm/components/Button/Button.mjs.map +1 -1
- package/dist/esm/components/Carousel/index.mjs +6 -6
- package/dist/esm/components/Carousel/index.mjs.map +1 -1
- package/dist/esm/components/ContentEditor/ContentEditor.mjs +1 -1
- package/dist/esm/components/ContentEditor/ContentEditor.mjs.map +1 -1
- package/dist/esm/components/ContentEditor/ContentEditorInput.mjs +7 -7
- package/dist/esm/components/ContentEditor/ContentEditorInput.mjs.map +1 -1
- package/dist/esm/components/ContentEditor/ContentEditorTextArea.mjs +6 -6
- package/dist/esm/components/ContentEditor/ContentEditorTextArea.mjs.map +1 -1
- package/dist/esm/components/CopyButton/index.mjs +3 -3
- package/dist/esm/components/CopyButton/index.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +28 -38
- package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +1 -1
- package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.mjs +0 -42
- package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +3 -3
- package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +2 -2
- package/dist/esm/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +10 -10
- package/dist/esm/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +11 -11
- package/dist/esm/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/StructureView/StructureView.mjs +7 -7
- package/dist/esm/components/DictionaryFieldEditor/StructureView/StructureView.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs +4 -4
- package/dist/esm/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs.map +1 -1
- package/dist/esm/components/DropDown/index.mjs +2 -2
- package/dist/esm/components/DropDown/index.mjs.map +1 -1
- package/dist/esm/components/EditableField/EditableFieldLayout.mjs +9 -9
- package/dist/esm/components/EditableField/EditableFieldLayout.mjs.map +1 -1
- package/dist/esm/components/IDE/CopyCode.mjs +1 -1
- package/dist/esm/components/IDE/CopyCode.mjs.map +1 -1
- package/dist/esm/components/Link/Link.mjs +70 -70
- package/dist/esm/components/Link/Link.mjs.map +1 -1
- package/dist/esm/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +6 -6
- package/dist/esm/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs.map +1 -1
- package/dist/esm/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs +3 -3
- package/dist/esm/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs.map +1 -1
- package/dist/esm/components/Modal/Modal.mjs +4 -4
- package/dist/esm/components/Modal/Modal.mjs.map +1 -1
- package/dist/esm/components/Navbar/DesktopNavbar.mjs +1 -1
- package/dist/esm/components/Navbar/DesktopNavbar.mjs.map +1 -1
- package/dist/esm/components/Pagination/Pagination.mjs +14 -12
- package/dist/esm/components/Pagination/Pagination.mjs.map +1 -1
- package/dist/esm/components/Popover/dynamic.mjs +9 -9
- package/dist/esm/components/Popover/dynamic.mjs.map +1 -1
- package/dist/esm/components/Popover/static.mjs +1 -1
- package/dist/esm/components/Popover/static.mjs.map +1 -1
- package/dist/esm/components/RightDrawer/RightDrawer.mjs +5 -5
- package/dist/esm/components/RightDrawer/RightDrawer.mjs.map +1 -1
- package/dist/esm/components/Select/Multiselect.mjs +1 -1
- package/dist/esm/components/Select/Multiselect.mjs.map +1 -1
- package/dist/esm/components/Select/Select.mjs +1 -1
- package/dist/esm/components/Select/Select.mjs.map +1 -1
- package/dist/esm/components/SwitchSelector/index.mjs +20 -20
- package/dist/esm/components/SwitchSelector/index.mjs.map +1 -1
- package/dist/esm/components/Tab/Tab.mjs +1 -1
- package/dist/esm/components/Tab/Tab.mjs.map +1 -1
- package/dist/esm/components/TabSelector/TabSelector.mjs +1 -1
- package/dist/esm/components/TabSelector/TabSelector.mjs.map +1 -1
- package/dist/esm/components/Table/ExpandButton.mjs +1 -1
- package/dist/esm/components/Table/ExpandButton.mjs.map +1 -1
- package/dist/esm/components/Table/SmartTable.mjs +1 -1
- package/dist/esm/components/Table/SmartTable.mjs.map +1 -1
- package/dist/esm/components/Tag/index.mjs +38 -38
- package/dist/esm/components/Tag/index.mjs.map +1 -1
- package/dist/esm/components/TechLogo/TechLogo.mjs +36 -36
- package/dist/esm/components/TechLogo/TechLogo.mjs.map +1 -1
- package/dist/esm/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs +12 -12
- package/dist/esm/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs.map +1 -1
- package/dist/esm/components/ThemeSwitcherDropDown/MobileThemeSwitcher.mjs +9 -9
- package/dist/esm/components/ThemeSwitcherDropDown/MobileThemeSwitcher.mjs.map +1 -1
- package/dist/esm/components/Toaster/useToast.mjs +9 -26
- package/dist/esm/components/Toaster/useToast.mjs.map +1 -1
- package/dist/esm/hooks/useAuth/useOAuth2.mjs +1 -1
- package/dist/esm/hooks/useAuth/useSession.mjs +1 -1
- package/dist/esm/libs/auth.mjs +1 -1
- package/dist/types/components/Badge/index.d.ts +1 -1
- package/dist/types/components/Browser/Browser.content.d.ts +0 -20
- package/dist/types/components/Browser/Browser.content.d.ts.map +1 -1
- package/dist/types/components/Button/Button.d.ts +2 -2
- package/dist/types/components/CollapsibleTable/CollapsibleTable.d.ts +2 -2
- package/dist/types/components/Command/index.d.ts +2 -2
- package/dist/types/components/Container/index.d.ts +6 -6
- package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts +0 -42
- package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts.map +1 -1
- package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.d.ts +1 -1
- package/dist/types/components/Input/Checkbox.d.ts +1 -1
- package/dist/types/components/Link/Link.d.ts +1 -1
- package/dist/types/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/types/components/Tag/index.d.ts +1 -1
- package/dist/types/components/Toaster/Toast.d.ts +1 -1
- package/package.json +20 -20
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentEditorTextArea.mjs","names":[],"sources":["../../../../src/components/ContentEditor/ContentEditorTextArea.tsx"],"sourcesContent":["'use client';\n\nimport { useUser } from '@hooks/useUser';\nimport { Check, X } from 'lucide-react';\nimport {\n type ChangeEventHandler,\n type FC,\n type ReactNode,\n useEffect,\n useState,\n} from 'react';\nimport { Button, ButtonColor, ButtonSize, ButtonVariant } from '../Button';\nimport { AutoCompleteTextarea, type AutoSizedTextAreaProps } from '../TextArea';\n\n/** Props for the ContentEditorTextArea component */\nexport type ContentEditorTextAreaProps = {\n /** The current content to display and edit */\n children: string;\n /** Callback function called when content is saved/validated */\n onContentChange: (content: string) => void;\n /** Whether the editor is disabled */\n disabled?: boolean;\n /** Optional validation function to check content validity */\n validate?: (content: string) => boolean;\n /** Additional buttons to display alongside edit actions */\n additionalButtons?: ReactNode;\n} & Omit<AutoSizedTextAreaProps, 'children'>;\n\n/**\n * ContentEditorTextArea Component\n *\n * An inline editing component for multi-line text with autocomplete functionality,\n * user authentication integration, and validation support. This component combines\n * the auto-sizing textarea with smart autocomplete features.\n *\n * ## Features\n * - **Auto-sizing Textarea**: Automatically adjusts height to content\n * - **Autocomplete Integration**: Smart text completion when user is authenticated\n * - **Validation Support**: Optional content validation with visual feedback\n * - **Action Buttons**: Built-in save/cancel with support for additional buttons\n * - **Keyboard Shortcuts**: Enter to save, Escape to cancel\n * - **User Authentication**: Autocomplete features activate based on auth status\n * - **Accessibility**: Full ARIA support and keyboard navigation\n *\n * ## Accessibility\n * - Proper ARIA labels and descriptions for all controls\n * - Keyboard navigation (Tab, Enter, Escape)\n * - Screen reader support for validation states and user auth status\n * - Focus management and visual indicators\n *\n * @param children - Current textarea content\n * @param onContentChange - Callback when content is saved\n * @param disabled - Whether the editor is disabled\n * @param validate - Optional validation function\n * @param additionalButtons - Extra buttons to display\n * @param props - Additional AutoSizedTextArea component props\n */\nexport const ContentEditorTextArea: FC<ContentEditorTextAreaProps> = ({\n children,\n onContentChange,\n disabled,\n validate,\n additionalButtons,\n ...props\n}) => {\n const { isAuthenticated } = useUser();\n const [newValue, setNewValue] = useState<string>(children);\n const [resetIncrementor, setResetIncrementor] = useState<number>(0); // To reset the textarea on cancel\n const isEdited: boolean = newValue !== children;\n\n const handleCancel = () => {\n setNewValue(children);\n setResetIncrementor((prev) => prev + 1);\n };\n\n const handleValid = () => {\n onContentChange(newValue);\n };\n\n const handleOnContentChange: ChangeEventHandler<HTMLTextAreaElement> = (e) =>\n setNewValue(e.currentTarget.value ?? '');\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === 'Enter' && (e.metaKey || e.ctrlKey) && !disabled && isValid) {\n e.preventDefault();\n handleValid();\n } else if (e.key === 'Escape') {\n e.preventDefault();\n handleCancel();\n }\n };\n\n useEffect(() => {\n setNewValue(children);\n // Force textarea to reset when children changes externally\n setResetIncrementor((prev) => prev + 1);\n }, [children]);\n\n const isValid = validate?.(newValue) ?? true;\n\n return (\n <div\n className=\"flex size-full flex-col items-center justify-between gap-2\"\n key={children}\n role=\"group\"\n aria-label=\"Content editor textarea\"\n >\n <AutoCompleteTextarea\n onChange={handleOnContentChange}\n onKeyDown={handleKeyDown}\n key={resetIncrementor}\n variant=\"invisible\"\n className=\"size-full\"\n value={children}\n isActive={isAuthenticated}\n disabled={disabled}\n aria-label=\"Editable textarea content\"\n aria-describedby={\n isEdited || additionalButtons\n ? 'content-editor-textarea-actions'\n : undefined\n }\n aria-invalid={!isValid}\n {...props}\n />\n {(isEdited || additionalButtons) && (\n <div\n id=\"content-editor-textarea-actions\"\n className=\"flex w-full items-center justify-end gap-2\"\n role=\"group\"\n aria-label=\"Edit actions\"\n >\n {isEdited && (\n <>\n <Button\n Icon={Check}\n label={`Save changes${!isValid ? ' (invalid content)' : ''}`}\n variant={ButtonVariant.HOVERABLE}\n color={ButtonColor.TEXT}\n size={ButtonSize.ICON_SM}\n className=\"cursor-pointer hover:scale-110\"\n disabled={disabled || !isValid}\n onClick={handleValid}\n aria-describedby={\n !isValid ? 'textarea-validation-error' : undefined\n }\n />\n <Button\n Icon={X}\n label=\"Cancel changes\"\n variant={ButtonVariant.HOVERABLE}\n size={ButtonSize.ICON_SM}\n color={ButtonColor.TEXT}\n className=\"cursor-pointer hover:scale-110\"\n onClick={handleCancel}\n disabled={disabled}\n />\n </>\n )}\n {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"file":"ContentEditorTextArea.mjs","names":[],"sources":["../../../../src/components/ContentEditor/ContentEditorTextArea.tsx"],"sourcesContent":["'use client';\n\nimport { useUser } from '@hooks/useUser';\nimport { Check, X } from 'lucide-react';\nimport {\n type ChangeEventHandler,\n type FC,\n type ReactNode,\n useEffect,\n useState,\n} from 'react';\nimport { Button, ButtonColor, ButtonSize, ButtonVariant } from '../Button';\nimport { AutoCompleteTextarea, type AutoSizedTextAreaProps } from '../TextArea';\n\n/** Props for the ContentEditorTextArea component */\nexport type ContentEditorTextAreaProps = {\n /** The current content to display and edit */\n children: string;\n /** Callback function called when content is saved/validated */\n onContentChange: (content: string) => void;\n /** Whether the editor is disabled */\n disabled?: boolean;\n /** Optional validation function to check content validity */\n validate?: (content: string) => boolean;\n /** Additional buttons to display alongside edit actions */\n additionalButtons?: ReactNode;\n} & Omit<AutoSizedTextAreaProps, 'children'>;\n\n/**\n * ContentEditorTextArea Component\n *\n * An inline editing component for multi-line text with autocomplete functionality,\n * user authentication integration, and validation support. This component combines\n * the auto-sizing textarea with smart autocomplete features.\n *\n * ## Features\n * - **Auto-sizing Textarea**: Automatically adjusts height to content\n * - **Autocomplete Integration**: Smart text completion when user is authenticated\n * - **Validation Support**: Optional content validation with visual feedback\n * - **Action Buttons**: Built-in save/cancel with support for additional buttons\n * - **Keyboard Shortcuts**: Enter to save, Escape to cancel\n * - **User Authentication**: Autocomplete features activate based on auth status\n * - **Accessibility**: Full ARIA support and keyboard navigation\n *\n * ## Accessibility\n * - Proper ARIA labels and descriptions for all controls\n * - Keyboard navigation (Tab, Enter, Escape)\n * - Screen reader support for validation states and user auth status\n * - Focus management and visual indicators\n *\n * @param children - Current textarea content\n * @param onContentChange - Callback when content is saved\n * @param disabled - Whether the editor is disabled\n * @param validate - Optional validation function\n * @param additionalButtons - Extra buttons to display\n * @param props - Additional AutoSizedTextArea component props\n */\nexport const ContentEditorTextArea: FC<ContentEditorTextAreaProps> = ({\n children,\n onContentChange,\n disabled,\n validate,\n additionalButtons,\n ...props\n}) => {\n const { isAuthenticated } = useUser();\n const [newValue, setNewValue] = useState<string>(children);\n const [resetIncrementor, setResetIncrementor] = useState<number>(0); // To reset the textarea on cancel\n const isEdited: boolean = newValue !== children;\n\n const handleCancel = () => {\n setNewValue(children);\n setResetIncrementor((prev) => prev + 1);\n };\n\n const handleValid = () => {\n onContentChange(newValue);\n };\n\n const handleOnContentChange: ChangeEventHandler<HTMLTextAreaElement> = (e) =>\n setNewValue(e.currentTarget.value ?? '');\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === 'Enter' && (e.metaKey || e.ctrlKey) && !disabled && isValid) {\n e.preventDefault();\n handleValid();\n } else if (e.key === 'Escape') {\n e.preventDefault();\n handleCancel();\n }\n };\n\n useEffect(() => {\n setNewValue(children);\n // Force textarea to reset when children changes externally\n setResetIncrementor((prev) => prev + 1);\n }, [children]);\n\n const isValid = validate?.(newValue) ?? true;\n\n return (\n <div\n className=\"flex size-full flex-col items-center justify-between gap-2\"\n key={children}\n role=\"group\"\n aria-label=\"Content editor textarea\"\n >\n <AutoCompleteTextarea\n onChange={handleOnContentChange}\n onKeyDown={handleKeyDown}\n key={resetIncrementor}\n variant=\"invisible\"\n className=\"size-full\"\n value={children}\n isActive={isAuthenticated}\n disabled={disabled}\n aria-label=\"Editable textarea content\"\n aria-describedby={\n isEdited || additionalButtons\n ? 'content-editor-textarea-actions'\n : undefined\n }\n aria-invalid={!isValid}\n {...props}\n />\n {(isEdited || additionalButtons) && (\n <div\n id=\"content-editor-textarea-actions\"\n className=\"flex w-full items-center justify-end gap-2\"\n role=\"group\"\n aria-label=\"Edit actions\"\n >\n {isEdited && (\n <>\n <Button\n Icon={Check}\n label={`Save changes${!isValid ? ' (invalid content)' : ''}`}\n variant={ButtonVariant.HOVERABLE}\n color={ButtonColor.TEXT}\n size={ButtonSize.ICON_SM}\n className=\"cursor-pointer hover:scale-110\"\n disabled={disabled || !isValid}\n onClick={handleValid}\n aria-describedby={\n !isValid ? 'textarea-validation-error' : undefined\n }\n />\n <Button\n Icon={X}\n label=\"Cancel changes\"\n variant={ButtonVariant.HOVERABLE}\n size={ButtonSize.ICON_SM}\n color={ButtonColor.TEXT}\n className=\"cursor-pointer hover:scale-110\"\n onClick={handleCancel}\n disabled={disabled}\n />\n </>\n )}\n {additionalButtons}\n </div>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,MAAa,yBAAyD,EACpE,UACA,iBACA,UACA,UACA,mBACA,GAAG,YACC;CACJ,MAAM,EAAE,oBAAoB,SAAS;CACrC,MAAM,CAAC,UAAU,eAAe,SAAiB,SAAS;CAC1D,MAAM,CAAC,kBAAkB,uBAAuB,SAAiB,EAAE;CACnE,MAAM,WAAoB,aAAa;CAEvC,MAAM,qBAAqB;AACzB,cAAY,SAAS;AACrB,uBAAqB,SAAS,OAAO,EAAE;;CAGzC,MAAM,oBAAoB;AACxB,kBAAgB,SAAS;;CAG3B,MAAM,yBAAkE,MACtE,YAAY,EAAE,cAAc,SAAS,GAAG;CAE1C,MAAM,iBAAiB,MAAgD;AACrE,MAAI,EAAE,QAAQ,YAAY,EAAE,WAAW,EAAE,YAAY,CAAC,YAAY,SAAS;AACzE,KAAE,gBAAgB;AAClB,gBAAa;aACJ,EAAE,QAAQ,UAAU;AAC7B,KAAE,gBAAgB;AAClB,iBAAc;;;AAIlB,iBAAgB;AACd,cAAY,SAAS;AAErB,uBAAqB,SAAS,OAAO,EAAE;IACtC,CAAC,SAAS,CAAC;CAEd,MAAM,UAAU,WAAW,SAAS,IAAI;AAExC,QACE,qBAAC,OAAD;EACE,WAAU;EAEV,MAAK;EACL,cAAW;YAJb,CAME,oBAAC,sBAAD;GACE,UAAU;GACV,WAAW;GAEX,SAAQ;GACR,WAAU;GACV,OAAO;GACP,UAAU;GACA;GACV,cAAW;GACX,oBACE,YAAY,oBACR,oCACA;GAEN,gBAAc,CAAC;GACf,GAAI;GACJ,EAdK,iBAcL,GACA,YAAY,sBACZ,qBAAC,OAAD;GACE,IAAG;GACH,WAAU;GACV,MAAK;GACL,cAAW;aAJb,CAMG,YACC,8CACE,oBAAC,QAAD;IACE,MAAM;IACN,OAAO,eAAe,CAAC,UAAU,uBAAuB;IACxD;IACA;IACA;IACA,WAAU;IACV,UAAU,YAAY,CAAC;IACvB,SAAS;IACT,oBACE,CAAC,UAAU,8BAA8B;IAE3C,GACF,oBAAC,QAAD;IACE,MAAM;IACN,OAAM;IACN;IACA;IACA;IACA,WAAU;IACV,SAAS;IACC;IACV,EACD,KAEJ,kBACG;KAEJ;IA3DC,SA2DD"}
|
|
@@ -106,9 +106,9 @@ const CopyButton = ({ content, ...props }) => {
|
|
|
106
106
|
return /* @__PURE__ */ jsx(Button, {
|
|
107
107
|
Icon: copied ? CopyCheckIcon : CopyIcon,
|
|
108
108
|
onClick: handleCopy,
|
|
109
|
-
variant:
|
|
110
|
-
color:
|
|
111
|
-
size:
|
|
109
|
+
variant: "hoverable",
|
|
110
|
+
color: "text",
|
|
111
|
+
size: "icon-sm",
|
|
112
112
|
tabIndex: 0,
|
|
113
113
|
title: getAriaLabel(),
|
|
114
114
|
...props,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/CopyButton/index.tsx"],"sourcesContent":["'use client';\n\nimport { CopyCheckIcon, CopyIcon } from 'lucide-react';\nimport { type FC, useEffect, useState } from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport {\n Button,\n ButtonColor,\n type ButtonProps,\n ButtonSize,\n ButtonVariant,\n} from '../Button';\n\n/**\n * Props for the CopyButton component\n */\ntype CopyButtonProps = {\n /**\n * The text content to copy to the clipboard\n * @example\n * ```tsx\n * <CopyButton content=\"Hello World!\" />\n * ```\n */\n content: string;\n} & Partial<ButtonProps>;\n\n/**\n * CopyButton - A specialized button component for copying text to the clipboard\n *\n * This component provides a user-friendly way to copy text content to the system clipboard\n * with visual feedback and accessibility features. It uses the modern Clipboard API with\n * fallback error handling, and provides clear visual indication of successful copy operations.\n *\n * ## Key Features\n * - **Clipboard Integration**: Uses modern Clipboard API for reliable text copying\n * - **Visual Feedback**: Icon changes from copy to check mark on successful copy\n * - **Auto-Reset**: Automatically reverts to copy icon after 1 second\n * - **Error Handling**: Graceful error handling with console logging\n * - **Accessibility**: Full keyboard navigation and screen reader support\n * - **Internationalization**: Multi-language support via Intlayer\n *\n * ## Use Cases\n * - Code snippet copying in documentation\n * - Sharing URLs or links\n * - Copying configuration values\n * - Form data duplication\n * - API key or token copying\n * - Text content sharing in interfaces\n *\n * ## Accessibility\n * - Uses semantic button element with proper ARIA labeling\n * - Keyboard accessible (Tab, Enter, Space)\n * - Screen reader announces copy actions\n * - Focus management with visible indicators\n * - Proper error state handling for assistive technologies\n *\n * ## Browser Compatibility\n * - Requires modern browsers with Clipboard API support\n * - Falls back gracefully with error logging for unsupported browsers\n * - Works in secure contexts (HTTPS) as required by Clipboard API\n *\n * @example\n * Basic usage:\n * ```tsx\n * <CopyButton content=\"Text to copy\" />\n * ```\n *\n * @example\n * With custom styling and label:\n * ```tsx\n * <CopyButton\n * content=\"https://example.com/api/endpoint\"\n * label=\"Copy API endpoint\"\n * variant={ButtonVariant.OUTLINE}\n * color={ButtonColor.PRIMARY}\n * size={ButtonSize.ICON_MD}\n * />\n * ```\n *\n * @example\n * In a code block context:\n * ```tsx\n * <div className=\"relative\">\n * <pre className=\"bg-gray-100 p-4 rounded\">\n * <code>npm install @intlayer/design-system</code>\n * </pre>\n * <CopyButton\n * content=\"npm install @intlayer/design-system\"\n * className=\"absolute top-2 right-2\"\n * label=\"Copy installation command\"\n * />\n * </div>\n * ```\n */\n\nexport const CopyButton: FC<CopyButtonProps> = ({ content, ...props }) => {\n const [copied, setCopied] = useState(false);\n const [error, setError] = useState(false);\n const { label } = useIntlayer('copy-button');\n\n const handleCopy = async () => {\n try {\n setError(false);\n await navigator.clipboard.writeText(content);\n setCopied(true);\n } catch (error) {\n console.error('Failed to copy text: ', error);\n setError(true);\n }\n };\n\n useEffect(() => {\n if (copied || error) {\n const timer = setTimeout(() => {\n setCopied(false);\n setError(false);\n }, 1000);\n return () => clearTimeout(timer);\n }\n }, [copied, error]);\n\n // Determine the current state for accessibility\n const getAriaLabel = () => {\n if (copied) return 'Content copied to clipboard';\n if (error) return 'Failed to copy content';\n return props.label ?? label.value;\n };\n\n return (\n <Button\n Icon={copied ? CopyCheckIcon : CopyIcon}\n onClick={handleCopy}\n variant={ButtonVariant.HOVERABLE}\n color={ButtonColor.TEXT}\n size={ButtonSize.ICON_SM}\n tabIndex={0}\n title={getAriaLabel()}\n {...props}\n label={getAriaLabel()}\n aria-describedby={\n copied ? 'copy-success' : error ? 'copy-error' : undefined\n }\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgGA,MAAa,cAAmC,EAAE,SAAS,GAAG,YAAY;CACxE,MAAM,CAAC,QAAQ,aAAa,SAAS,MAAM;CAC3C,MAAM,CAAC,OAAO,YAAY,SAAS,MAAM;CACzC,MAAM,EAAE,UAAU,YAAY,cAAc;CAE5C,MAAM,aAAa,YAAY;AAC7B,MAAI;AACF,YAAS,MAAM;AACf,SAAM,UAAU,UAAU,UAAU,QAAQ;AAC5C,aAAU,KAAK;WACR,OAAO;AACd,WAAQ,MAAM,yBAAyB,MAAM;AAC7C,YAAS,KAAK;;;AAIlB,iBAAgB;AACd,MAAI,UAAU,OAAO;GACnB,MAAM,QAAQ,iBAAiB;AAC7B,cAAU,MAAM;AAChB,aAAS,MAAM;MACd,IAAK;AACR,gBAAa,aAAa,MAAM;;IAEjC,CAAC,QAAQ,MAAM,CAAC;CAGnB,MAAM,qBAAqB;AACzB,MAAI,OAAQ,QAAO;AACnB,MAAI,MAAO,QAAO;AAClB,SAAO,MAAM,SAAS,MAAM;;AAG9B,QACE,oBAAC,QAAD;EACE,MAAM,SAAS,gBAAgB;EAC/B,SAAS;EACT
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/CopyButton/index.tsx"],"sourcesContent":["'use client';\n\nimport { CopyCheckIcon, CopyIcon } from 'lucide-react';\nimport { type FC, useEffect, useState } from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport {\n Button,\n ButtonColor,\n type ButtonProps,\n ButtonSize,\n ButtonVariant,\n} from '../Button';\n\n/**\n * Props for the CopyButton component\n */\ntype CopyButtonProps = {\n /**\n * The text content to copy to the clipboard\n * @example\n * ```tsx\n * <CopyButton content=\"Hello World!\" />\n * ```\n */\n content: string;\n} & Partial<ButtonProps>;\n\n/**\n * CopyButton - A specialized button component for copying text to the clipboard\n *\n * This component provides a user-friendly way to copy text content to the system clipboard\n * with visual feedback and accessibility features. It uses the modern Clipboard API with\n * fallback error handling, and provides clear visual indication of successful copy operations.\n *\n * ## Key Features\n * - **Clipboard Integration**: Uses modern Clipboard API for reliable text copying\n * - **Visual Feedback**: Icon changes from copy to check mark on successful copy\n * - **Auto-Reset**: Automatically reverts to copy icon after 1 second\n * - **Error Handling**: Graceful error handling with console logging\n * - **Accessibility**: Full keyboard navigation and screen reader support\n * - **Internationalization**: Multi-language support via Intlayer\n *\n * ## Use Cases\n * - Code snippet copying in documentation\n * - Sharing URLs or links\n * - Copying configuration values\n * - Form data duplication\n * - API key or token copying\n * - Text content sharing in interfaces\n *\n * ## Accessibility\n * - Uses semantic button element with proper ARIA labeling\n * - Keyboard accessible (Tab, Enter, Space)\n * - Screen reader announces copy actions\n * - Focus management with visible indicators\n * - Proper error state handling for assistive technologies\n *\n * ## Browser Compatibility\n * - Requires modern browsers with Clipboard API support\n * - Falls back gracefully with error logging for unsupported browsers\n * - Works in secure contexts (HTTPS) as required by Clipboard API\n *\n * @example\n * Basic usage:\n * ```tsx\n * <CopyButton content=\"Text to copy\" />\n * ```\n *\n * @example\n * With custom styling and label:\n * ```tsx\n * <CopyButton\n * content=\"https://example.com/api/endpoint\"\n * label=\"Copy API endpoint\"\n * variant={ButtonVariant.OUTLINE}\n * color={ButtonColor.PRIMARY}\n * size={ButtonSize.ICON_MD}\n * />\n * ```\n *\n * @example\n * In a code block context:\n * ```tsx\n * <div className=\"relative\">\n * <pre className=\"bg-gray-100 p-4 rounded\">\n * <code>npm install @intlayer/design-system</code>\n * </pre>\n * <CopyButton\n * content=\"npm install @intlayer/design-system\"\n * className=\"absolute top-2 right-2\"\n * label=\"Copy installation command\"\n * />\n * </div>\n * ```\n */\n\nexport const CopyButton: FC<CopyButtonProps> = ({ content, ...props }) => {\n const [copied, setCopied] = useState(false);\n const [error, setError] = useState(false);\n const { label } = useIntlayer('copy-button');\n\n const handleCopy = async () => {\n try {\n setError(false);\n await navigator.clipboard.writeText(content);\n setCopied(true);\n } catch (error) {\n console.error('Failed to copy text: ', error);\n setError(true);\n }\n };\n\n useEffect(() => {\n if (copied || error) {\n const timer = setTimeout(() => {\n setCopied(false);\n setError(false);\n }, 1000);\n return () => clearTimeout(timer);\n }\n }, [copied, error]);\n\n // Determine the current state for accessibility\n const getAriaLabel = () => {\n if (copied) return 'Content copied to clipboard';\n if (error) return 'Failed to copy content';\n return props.label ?? label.value;\n };\n\n return (\n <Button\n Icon={copied ? CopyCheckIcon : CopyIcon}\n onClick={handleCopy}\n variant={ButtonVariant.HOVERABLE}\n color={ButtonColor.TEXT}\n size={ButtonSize.ICON_SM}\n tabIndex={0}\n title={getAriaLabel()}\n {...props}\n label={getAriaLabel()}\n aria-describedby={\n copied ? 'copy-success' : error ? 'copy-error' : undefined\n }\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgGA,MAAa,cAAmC,EAAE,SAAS,GAAG,YAAY;CACxE,MAAM,CAAC,QAAQ,aAAa,SAAS,MAAM;CAC3C,MAAM,CAAC,OAAO,YAAY,SAAS,MAAM;CACzC,MAAM,EAAE,UAAU,YAAY,cAAc;CAE5C,MAAM,aAAa,YAAY;AAC7B,MAAI;AACF,YAAS,MAAM;AACf,SAAM,UAAU,UAAU,UAAU,QAAQ;AAC5C,aAAU,KAAK;WACR,OAAO;AACd,WAAQ,MAAM,yBAAyB,MAAM;AAC7C,YAAS,KAAK;;;AAIlB,iBAAgB;AACd,MAAI,UAAU,OAAO;GACnB,MAAM,QAAQ,iBAAiB;AAC7B,cAAU,MAAM;AAChB,aAAS,MAAM;MACd,IAAK;AACR,gBAAa,aAAa,MAAM;;IAEjC,CAAC,QAAQ,MAAM,CAAC;CAGnB,MAAM,qBAAqB;AACzB,MAAI,OAAQ,QAAO;AACnB,MAAI,MAAO,QAAO;AAClB,SAAO,MAAM,SAAS,MAAM;;AAG9B,QACE,oBAAC,QAAD;EACE,MAAM,SAAS,gBAAgB;EAC/B,SAAS;EACT;EACA;EACA;EACA,UAAU;EACV,OAAO,cAAc;EACrB,GAAI;EACJ,OAAO,cAAc;EACrB,oBACE,SAAS,iBAAiB,QAAQ,eAAe;EAEnD"}
|
|
@@ -32,14 +32,14 @@ const ContentEditorTextArea = ({ keyPath, dictionary, ...props }) => {
|
|
|
32
32
|
const configuration = useConfiguration();
|
|
33
33
|
const { mutate: auditContentDeclarationField, isPending: isAuditing } = useAuditContentDeclarationField();
|
|
34
34
|
return /* @__PURE__ */ jsx(ContentEditorTextArea$1, {
|
|
35
|
-
variant:
|
|
35
|
+
variant: "default",
|
|
36
36
|
onContentChange: (newValue) => addEditedContent(dictionary.localId, newValue, keyPath),
|
|
37
37
|
additionalButtons: /* @__PURE__ */ jsx(Button, {
|
|
38
38
|
Icon: WandSparkles,
|
|
39
39
|
label: "Audit",
|
|
40
|
-
variant:
|
|
41
|
-
size:
|
|
42
|
-
color:
|
|
40
|
+
variant: "hoverable",
|
|
41
|
+
size: "icon-sm",
|
|
42
|
+
color: "text",
|
|
43
43
|
className: "cursor-pointer hover:scale-110",
|
|
44
44
|
isLoading: isAuditing,
|
|
45
45
|
onClick: () => {
|
|
@@ -72,7 +72,7 @@ const ContentEditorTextArea = ({ keyPath, dictionary, ...props }) => {
|
|
|
72
72
|
const ContentEditorInput = ({ keyPath, dictionary, ...props }) => {
|
|
73
73
|
const { addEditedContent } = useEditedContent();
|
|
74
74
|
return /* @__PURE__ */ jsx(ContentEditorInput$1, {
|
|
75
|
-
variant:
|
|
75
|
+
variant: "default",
|
|
76
76
|
onContentChange: (newValue) => addEditedContent(dictionary.localId, newValue, keyPath),
|
|
77
77
|
...props
|
|
78
78
|
});
|
|
@@ -90,8 +90,8 @@ const ContentEditorToggle = ({ dictionary, keyPath, ...props }) => {
|
|
|
90
90
|
choices: toggleContent,
|
|
91
91
|
value: true,
|
|
92
92
|
onChange: (value) => addEditedContent(dictionary.localId, value, keyPath),
|
|
93
|
-
color:
|
|
94
|
-
size:
|
|
93
|
+
color: "text",
|
|
94
|
+
size: "sm",
|
|
95
95
|
...props
|
|
96
96
|
});
|
|
97
97
|
};
|
|
@@ -206,9 +206,9 @@ const EnumerationTextEditor = ({ section, keyPath, dictionary, renderSection })
|
|
|
206
206
|
})
|
|
207
207
|
}), /* @__PURE__ */ jsx(Button, {
|
|
208
208
|
label: addNewEnumeration.label.value,
|
|
209
|
-
variant:
|
|
210
|
-
color:
|
|
211
|
-
textAlign:
|
|
209
|
+
variant: "hoverable",
|
|
210
|
+
color: "neutral",
|
|
211
|
+
textAlign: "left",
|
|
212
212
|
isFullWidth: true,
|
|
213
213
|
onClick: () => addEditedContent(dictionary.localId, getEmptyNode(content[firstKey]) ?? "", [...keyPath, {
|
|
214
214
|
type: NodeTypes.ENUMERATION,
|
|
@@ -351,9 +351,9 @@ const ArrayTextEditor = ({ section, keyPath, dictionary, renderSection }) => {
|
|
|
351
351
|
})
|
|
352
352
|
}), /* @__PURE__ */ jsx(Button, {
|
|
353
353
|
label: addNewElement.label.value,
|
|
354
|
-
variant:
|
|
355
|
-
color:
|
|
356
|
-
textAlign:
|
|
354
|
+
variant: "hoverable",
|
|
355
|
+
color: "neutral",
|
|
356
|
+
textAlign: "left",
|
|
357
357
|
isFullWidth: true,
|
|
358
358
|
onClick: () => {
|
|
359
359
|
const newKeyPath = [...keyPath, {
|
|
@@ -401,24 +401,14 @@ const ObjectTextEditor = ({ section, keyPath, dictionary, renderSection }) => /*
|
|
|
401
401
|
})
|
|
402
402
|
})
|
|
403
403
|
}) });
|
|
404
|
-
var MarkdownViewMode = /* @__PURE__ */ function(MarkdownViewMode) {
|
|
405
|
-
MarkdownViewMode[MarkdownViewMode["Edit"] = 0] = "Edit";
|
|
406
|
-
MarkdownViewMode[MarkdownViewMode["Preview"] = 1] = "Preview";
|
|
407
|
-
return MarkdownViewMode;
|
|
408
|
-
}(MarkdownViewMode || {});
|
|
409
|
-
var HtmlViewMode = /* @__PURE__ */ function(HtmlViewMode) {
|
|
410
|
-
HtmlViewMode[HtmlViewMode["Edit"] = 0] = "Edit";
|
|
411
|
-
HtmlViewMode[HtmlViewMode["Preview"] = 1] = "Preview";
|
|
412
|
-
return HtmlViewMode;
|
|
413
|
-
}(HtmlViewMode || {});
|
|
414
404
|
const HtmlTextEditor = ({ section, keyPath, dictionary }) => {
|
|
415
|
-
const [mode, setMode] = useState(
|
|
405
|
+
const [mode, setMode] = useState(0);
|
|
416
406
|
const toggleContent = [{
|
|
417
407
|
content: "Edit",
|
|
418
|
-
value:
|
|
408
|
+
value: 0
|
|
419
409
|
}, {
|
|
420
410
|
content: "Preview",
|
|
421
|
-
value:
|
|
411
|
+
value: 1
|
|
422
412
|
}];
|
|
423
413
|
const childKeyPath = [...keyPath, { type: NodeTypes.HTML }];
|
|
424
414
|
const content = section[NodeTypes.HTML];
|
|
@@ -428,25 +418,25 @@ const HtmlTextEditor = ({ section, keyPath, dictionary }) => {
|
|
|
428
418
|
choices: toggleContent,
|
|
429
419
|
value: mode,
|
|
430
420
|
onChange: setMode,
|
|
431
|
-
color:
|
|
432
|
-
size:
|
|
421
|
+
color: "text",
|
|
422
|
+
size: "sm",
|
|
433
423
|
className: "ml-auto"
|
|
434
424
|
}), /* @__PURE__ */ jsx(TextEditorContainer, {
|
|
435
425
|
section: content,
|
|
436
426
|
keyPath: childKeyPath,
|
|
437
427
|
dictionary,
|
|
438
|
-
renderSection: mode ===
|
|
428
|
+
renderSection: mode === 1 ? (content) => /* @__PURE__ */ jsx("div", { dangerouslySetInnerHTML: { __html: content } }) : void 0
|
|
439
429
|
})]
|
|
440
430
|
});
|
|
441
431
|
};
|
|
442
432
|
const MarkdownTextEditor = ({ section, keyPath, dictionary, isDarkMode }) => {
|
|
443
|
-
const [mode, setMode] = useState(
|
|
433
|
+
const [mode, setMode] = useState(0);
|
|
444
434
|
const toggleContent = [{
|
|
445
435
|
content: "Edit",
|
|
446
|
-
value:
|
|
436
|
+
value: 0
|
|
447
437
|
}, {
|
|
448
438
|
content: "Preview",
|
|
449
|
-
value:
|
|
439
|
+
value: 1
|
|
450
440
|
}];
|
|
451
441
|
const childKeyPath = [...keyPath, { type: NodeTypes.MARKDOWN }];
|
|
452
442
|
const content = section[NodeTypes.MARKDOWN];
|
|
@@ -456,14 +446,14 @@ const MarkdownTextEditor = ({ section, keyPath, dictionary, isDarkMode }) => {
|
|
|
456
446
|
choices: toggleContent,
|
|
457
447
|
value: mode,
|
|
458
448
|
onChange: setMode,
|
|
459
|
-
color:
|
|
460
|
-
size:
|
|
449
|
+
color: "text",
|
|
450
|
+
size: "sm",
|
|
461
451
|
className: "ml-auto"
|
|
462
452
|
}), /* @__PURE__ */ jsx(TextEditorContainer, {
|
|
463
453
|
section: content,
|
|
464
454
|
keyPath: childKeyPath,
|
|
465
455
|
dictionary,
|
|
466
|
-
renderSection: mode ===
|
|
456
|
+
renderSection: mode === 1 ? (content) => /* @__PURE__ */ jsx(MarkdownRenderer$1, {
|
|
467
457
|
isDarkMode,
|
|
468
458
|
children: content
|
|
469
459
|
}) : void 0
|
|
@@ -509,7 +499,7 @@ const NestedTextEditor = ({ keyPath, dictionary, renderSection, section, ...prop
|
|
|
509
499
|
/* @__PURE__ */ jsx(ContentEditorInput$1, {
|
|
510
500
|
"aria-label": "Edit field",
|
|
511
501
|
type: "text",
|
|
512
|
-
variant:
|
|
502
|
+
variant: "default",
|
|
513
503
|
...props,
|
|
514
504
|
onContentChange: (newValue) => {
|
|
515
505
|
addEditedContent(dictionary.localId, {
|
|
@@ -523,7 +513,7 @@ const NestedTextEditor = ({ keyPath, dictionary, renderSection, section, ...prop
|
|
|
523
513
|
/* @__PURE__ */ jsx(ContentEditorInput$1, {
|
|
524
514
|
"aria-label": "Edit field",
|
|
525
515
|
type: "text",
|
|
526
|
-
variant:
|
|
516
|
+
variant: "default",
|
|
527
517
|
...props,
|
|
528
518
|
onContentChange: (newValue) => {
|
|
529
519
|
addEditedContent(dictionary.localId, {
|
|
@@ -624,7 +614,7 @@ const TextEditor = ({ section, keyPath, dictionary, renderSection, isDarkMode })
|
|
|
624
614
|
if (nodeType === NodeTypes.TEXT) return /* @__PURE__ */ jsx("div", {
|
|
625
615
|
className: "w-full p-2",
|
|
626
616
|
children: typeof renderSection === "function" ? renderSection(section) : /* @__PURE__ */ jsx(ContentEditorTextArea, {
|
|
627
|
-
variant:
|
|
617
|
+
variant: "default",
|
|
628
618
|
"aria-label": "Edit field",
|
|
629
619
|
keyPath,
|
|
630
620
|
dictionary,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextEditor.mjs","names":["ContentEditorTextAreaBase","ContentEditorInputBase","MarkdownRenderer"],"sources":["../../../../../src/components/DictionaryFieldEditor/ContentEditorView/TextEditor.tsx"],"sourcesContent":["'use client';\n\nimport {\n Button,\n ButtonColor,\n ButtonSize,\n ButtonTextAlign,\n ButtonVariant,\n} from '@components/Button';\nimport { Container } from '@components/Container';\nimport {\n ContentEditorInput as ContentEditorInputBase,\n type ContentEditorInputProps as ContentEditorInputPropsBase,\n} from '@components/ContentEditor/ContentEditorInput';\nimport {\n ContentEditorTextArea as ContentEditorTextAreaBase,\n type ContentEditorTextAreaProps as ContentEditorTextAreaPropsBase,\n} from '@components/ContentEditor/ContentEditorTextArea';\nimport { renameKey } from '@components/DictionaryFieldEditor/ContentEditorView/object';\nimport { InputVariant } from '@components/Input';\nimport { Label } from '@components/Label';\nimport { useLocaleSwitcherContent } from '@components/LocaleSwitcherContentDropDown';\nimport { MarkdownRenderer } from '@components/MarkDownRender';\nimport {\n SwitchSelector,\n type SwitchSelectorChoices,\n SwitchSelectorColor,\n type SwitchSelectorProps,\n SwitchSelectorSize,\n} from '@components/SwitchSelector';\nimport { useAuditContentDeclarationField } from '@hooks/reactQuery';\nimport {\n getEmptyNode,\n getNodeType,\n} from '@intlayer/core/dictionaryManipulator';\nimport { getLocaleName } from '@intlayer/core/localization';\nimport type {\n ConditionContent,\n EnumerationContent,\n FileContent,\n GenderContent,\n HTMLContent,\n InsertionContent,\n MarkdownContent,\n TranslationContent,\n} from '@intlayer/core/transpiler';\nimport { useConfiguration, useEditedContent } from '@intlayer/editor-react';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport type { ContentNode, Dictionary } from '@intlayer/types/dictionary';\nimport type { KeyPath } from '@intlayer/types/keyPath';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport * as NodeTypes from '@intlayer/types/nodeType';\nimport { Plus, Trash, WandSparkles } from 'lucide-react';\nimport { type FC, Fragment, type ReactNode, useState } from 'react';\nimport { useIntlayer, useLocale } from 'react-intlayer';\nimport { EnumKeyInput } from '../EnumKeyInput';\n\nexport const traceKeys: string[] = ['filePath', 'id', 'nodeType'];\n\ntype ContentEditorTextAreaProps = Omit<\n ContentEditorTextAreaPropsBase,\n 'onContentChange'\n> & {\n keyPath: KeyPath[];\n dictionary: Dictionary;\n};\n\nconst ContentEditorTextArea: FC<ContentEditorTextAreaProps> = ({\n keyPath,\n dictionary,\n ...props\n}) => {\n const { editedContent, addEditedContent } = useEditedContent();\n const configuration = useConfiguration();\n const { mutate: auditContentDeclarationField, isPending: isAuditing } =\n useAuditContentDeclarationField();\n\n return (\n <ContentEditorTextAreaBase\n variant={InputVariant.DEFAULT}\n onContentChange={(newValue) =>\n addEditedContent(dictionary.localId!, newValue, keyPath)\n }\n additionalButtons={\n <Button\n Icon={WandSparkles}\n label=\"Audit\"\n variant={ButtonVariant.HOVERABLE}\n size={ButtonSize.ICON_SM}\n color={ButtonColor.TEXT}\n className=\"cursor-pointer hover:scale-110\"\n isLoading={isAuditing}\n onClick={() => {\n auditContentDeclarationField(\n {\n fileContent: JSON.stringify({\n ...dictionary,\n ...(editedContent?.[dictionary.localId!] ?? {}),\n }),\n keyPath,\n locales: configuration?.internationalization.locales ?? [],\n aiOptions: {\n apiKey: configuration?.ai?.apiKey,\n model: configuration?.ai?.model,\n temperature: configuration?.ai?.temperature,\n },\n },\n {\n onSuccess: (response) => {\n if (!response?.data) return;\n\n try {\n const editedContent = response.data.fileContent as string;\n\n addEditedContent(\n dictionary.localId!,\n editedContent,\n keyPath\n );\n } catch (error) {\n console.error(error);\n }\n },\n }\n );\n }}\n />\n }\n {...props}\n />\n );\n};\n\ntype ContentEditorInputProps = Omit<\n ContentEditorInputPropsBase,\n 'onContentChange'\n> & {\n keyPath: KeyPath[];\n dictionary: Dictionary;\n};\n\nconst ContentEditorInput: FC<ContentEditorInputProps> = ({\n keyPath,\n dictionary,\n ...props\n}) => {\n const { addEditedContent } = useEditedContent();\n\n return (\n <ContentEditorInputBase\n variant={InputVariant.DEFAULT}\n onContentChange={(newValue) =>\n addEditedContent(dictionary.localId!, newValue, keyPath)\n }\n {...props}\n />\n );\n};\n\nconst toggleContent = [\n {\n content: 'False',\n value: false,\n },\n {\n content: 'True',\n value: true,\n },\n] as SwitchSelectorChoices<boolean>;\n\ntype ContentEditorToggleProps = SwitchSelectorProps & {\n dictionary: Dictionary;\n keyPath: KeyPath[];\n};\n\nconst ContentEditorToggle: FC<ContentEditorToggleProps> = ({\n dictionary,\n keyPath,\n ...props\n}) => {\n const { addEditedContent } = useEditedContent();\n\n return (\n <SwitchSelector\n choices={toggleContent}\n value={true}\n onChange={(value) =>\n addEditedContent(dictionary.localId!, value, keyPath)\n }\n color={SwitchSelectorColor.TEXT}\n size={SwitchSelectorSize.SM}\n {...props}\n />\n );\n};\n\nexport type TextEditorProps = {\n dictionary: Dictionary;\n keyPath: KeyPath[];\n section: ContentNode;\n isDarkMode?: boolean;\n renderSection?: (content: string) => ReactNode;\n onContentChange?: (newValue: string) => void;\n};\n\nconst TranslationTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n renderSection,\n}: TextEditorProps) => {\n const { locale, defaultLocale } = useLocale();\n const { selectedLocales, availableLocales } = useLocaleSwitcherContent();\n\n const sectionContent = (section as TranslationContent<string>)[\n NodeTypes.TRANSLATION\n ] as Record<Locale, string>;\n\n const sectionContentKeys = Object.keys(sectionContent) as LocalesValues[];\n\n const isFiltered = availableLocales.length > selectedLocales.length;\n\n const localesList = isFiltered\n ? selectedLocales\n : // If the translation include content in other locales, we display all of them\n [...new Set([...availableLocales, ...sectionContentKeys])];\n\n const content: any = (section as TranslationContent<string>)[\n NodeTypes.TRANSLATION\n ];\n\n return (\n <table className=\"w-full\">\n <tbody className=\"flex w-full flex-col gap-2\">\n {localesList.map((translationKey) => {\n const uniqueKey = `${JSON.stringify(keyPath)}-translation-${translationKey}`;\n return (\n <Fragment key={uniqueKey}>\n <tr className=\"mt-2 w-full p-2 text-xs\">\n <td className=\"flex w-full\">\n {getLocaleName(translationKey, locale)}\n </td>\n </tr>\n <tr className=\"flex\">\n <td className=\"flex w-full\">\n <TextEditorContainer\n section={\n content[translationKey] ??\n getEmptyNode(content[defaultLocale])\n }\n keyPath={[\n ...keyPath,\n { type: NodeTypes.TRANSLATION, key: translationKey },\n ]}\n dictionary={dictionary}\n renderSection={renderSection}\n />\n </td>\n </tr>\n </Fragment>\n );\n })}\n </tbody>\n </table>\n );\n};\n\nconst EnumerationTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n renderSection,\n}) => {\n const { addEditedContent } = useEditedContent();\n const { addNewEnumeration, removeEnumeration } =\n useIntlayer('navigation-view');\n\n const content = (section as EnumerationContent<string>)[\n NodeTypes.ENUMERATION\n ];\n const firstKey = Object.keys(content)[0] as keyof typeof content;\n\n return (\n <div className=\"flex flex-col gap-2\">\n <table className=\"w-full\">\n <tbody className=\"flex w-full flex-col gap-2\">\n {Object.keys(\n (section as EnumerationContent<ContentNode>)[NodeTypes.ENUMERATION]\n ).map((enumKey) => {\n const childrenKeyPath = [\n ...keyPath,\n { type: NodeTypes.ENUMERATION, key: enumKey },\n ] as KeyPath[];\n const uniqueKey = `${JSON.stringify(keyPath)}-enumeration-${enumKey}`;\n\n return (\n <Fragment key={uniqueKey}>\n <tr className=\"mt-2 w-full\">\n <td className=\"flex w-full\">\n <div className=\"flex flex-1\">\n <Button\n label={removeEnumeration.label.value}\n variant=\"hoverable\"\n size=\"sm\"\n color=\"error\"\n className=\"ml-auto text-neutral hover:text-error\"\n Icon={Trash}\n onClick={() =>\n addEditedContent(\n dictionary.localId!,\n undefined,\n childrenKeyPath\n )\n }\n >\n {removeEnumeration.text}\n </Button>\n </div>\n </td>\n </tr>\n <tr className=\"w-full p-2\">\n <td className=\"flex w-full\">\n <EnumKeyInput\n value={enumKey}\n onChange={(value) => {\n const preValueContent = (\n section as EnumerationContent<string>\n )[NodeTypes.ENUMERATION];\n\n const newValueContent = renameKey(\n preValueContent,\n enumKey as keyof typeof preValueContent,\n value\n );\n const newValue = {\n ...(section as EnumerationContent<string>),\n [NodeTypes.ENUMERATION]: newValueContent,\n };\n\n console.log('newValue', newValue);\n\n addEditedContent(\n dictionary.localId!,\n newValue,\n keyPath\n );\n }}\n />\n </td>\n </tr>\n <tr className=\"block w-full\">\n <td className=\"flex w-full\">\n <TextEditor\n section={\n content[enumKey as keyof typeof content] ??\n getEmptyNode(content[firstKey])\n }\n keyPath={childrenKeyPath}\n dictionary={dictionary}\n renderSection={renderSection}\n />\n </td>\n </tr>\n </Fragment>\n );\n })}\n </tbody>\n </table>\n\n <Button\n label={addNewEnumeration.label.value}\n variant={ButtonVariant.HOVERABLE}\n color={ButtonColor.NEUTRAL}\n textAlign={ButtonTextAlign.LEFT}\n isFullWidth\n onClick={() =>\n addEditedContent(\n dictionary.localId!,\n getEmptyNode(content[firstKey]) ?? '',\n [...keyPath, { type: NodeTypes.ENUMERATION, key: 'unknown' }]\n )\n }\n Icon={Plus}\n className=\"m-2\"\n >\n {addNewEnumeration.text}\n </Button>\n </div>\n );\n};\n\nconst ConditionTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n renderSection,\n}) => {\n const content = (section as ConditionContent<string>)[NodeTypes.CONDITION];\n\n return (\n <table className=\"w-full\">\n <tbody className=\"flex w-full flex-col gap-2\">\n {['true', 'false', 'fallback'].map((condKey) => {\n const uniqueKey = `${JSON.stringify(keyPath)}-condition-${condKey}`;\n return (\n <Fragment key={uniqueKey}>\n <tr className=\"mt-2 block w-full p-2 text-xs\">\n <td className=\"flex w-full\">{String(condKey)}</td>\n </tr>\n <tr className=\"block w-full\">\n <td className=\"flex w-full\">\n <TextEditorContainer\n section={\n content[condKey as keyof typeof content] ??\n getEmptyNode(content.true)\n }\n keyPath={[\n ...keyPath,\n {\n type: NodeTypes.CONDITION,\n key: condKey,\n } as KeyPath,\n ]}\n dictionary={dictionary}\n renderSection={renderSection}\n />\n </td>\n </tr>\n </Fragment>\n );\n })}\n </tbody>\n </table>\n );\n};\n\nconst GenderTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n renderSection,\n}) => {\n const content = (section as GenderContent<string>)[NodeTypes.GENDER];\n\n return (\n <table className=\"w-full\">\n <tbody className=\"flex w-full flex-col gap-2\">\n {['male', 'female', 'fallback'].map((condKey) => {\n const uniqueKey = `${JSON.stringify(keyPath)}-gender-${condKey}`;\n return (\n <Fragment key={uniqueKey}>\n <tr className=\"mt-2 block w-full p-2 text-xs\">\n <td className=\"flex w-full\">{String(condKey)}</td>\n </tr>\n <tr className=\"block w-full\">\n <td className=\"flex w-full\">\n <TextEditorContainer\n section={\n content[condKey as keyof typeof content] ??\n getEmptyNode(content.male)\n }\n keyPath={[\n ...keyPath,\n {\n type: NodeTypes.GENDER,\n key: condKey,\n } as KeyPath,\n ]}\n dictionary={dictionary}\n renderSection={renderSection}\n />\n </td>\n </tr>\n </Fragment>\n );\n })}\n </tbody>\n </table>\n );\n};\n\nconst ArrayTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n renderSection,\n}) => {\n const { addEditedContent } = useEditedContent();\n const { addNewElement, removeElement } = useIntlayer('navigation-view');\n\n return (\n <div className=\"flex flex-col gap-2\">\n <table className=\"w-full\">\n <tbody className=\"flex w-full flex-col gap-2\">\n {(section as unknown as ContentNode[]).map((subSection, index) => {\n const uniqueKey = `${JSON.stringify(keyPath)}-array-${index}`;\n return (\n <Fragment key={uniqueKey}>\n <tr className=\"mt-2 w-full p-2\">\n <td className=\"flex w-full\">\n <div className=\"flex w-full items-center justify-between gap-2\">\n <span className=\"text-xs\">{String(index)}</span>\n <Button\n label={removeElement.label.value}\n variant=\"hoverable\"\n size=\"sm\"\n color=\"error\"\n className=\"ml-auto text-neutral hover:text-error\"\n onClick={() => {\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n {\n type: NodeTypes.ARRAY,\n key: index, // Fixed: Use index instead of length\n },\n ];\n addEditedContent(\n dictionary.localId!,\n undefined,\n newKeyPath\n );\n }}\n Icon={Trash}\n >\n {removeElement.text}\n </Button>\n </div>\n </td>\n </tr>\n\n <tr className=\"block w-full\">\n <td className=\"flex w-full\">\n <TextEditorContainer\n section={\n subSection ??\n getEmptyNode((section as unknown as ContentNode[])[0])\n }\n keyPath={[\n ...keyPath,\n {\n type: NodeTypes.ARRAY,\n key: index,\n },\n ]}\n dictionary={dictionary}\n renderSection={renderSection}\n />\n </td>\n </tr>\n </Fragment>\n );\n })}\n </tbody>\n </table>\n <Button\n label={addNewElement.label.value}\n variant={ButtonVariant.HOVERABLE}\n color={ButtonColor.NEUTRAL}\n textAlign={ButtonTextAlign.LEFT}\n isFullWidth\n onClick={() => {\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n {\n type: NodeTypes.ARRAY,\n key: (section as unknown as ContentNode[]).length, // Keeps length for adding new items\n },\n ];\n addEditedContent(\n dictionary.localId!,\n getEmptyNode((section as unknown as ContentNode[])[0]) ?? '',\n newKeyPath,\n false\n );\n }}\n Icon={Plus}\n >\n {addNewElement.text}\n </Button>\n </div>\n );\n};\n\nconst ObjectTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n renderSection,\n}) => (\n <>\n <table className=\"w-full\">\n <tbody className=\"flex flex-col gap-2\">\n {Object.keys(section as unknown as Record<string, ContentNode>).map(\n (key) => {\n const childKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeTypes.OBJECT, key },\n ];\n const typedSection = section as unknown as Record<\n string,\n ContentNode\n >;\n const firstKey = Object.keys(\n typedSection\n )[0] as keyof typeof section;\n const subSection =\n typedSection[key as keyof typeof section] ??\n getEmptyNode(typedSection[firstKey]);\n const uniqueKey = `${JSON.stringify(keyPath)}-object-${key}`;\n\n return (\n <Fragment key={uniqueKey}>\n <tr className=\"mt-2 p-2 text-xs\">\n <td className=\"flex w-full\">{String(key)}</td>\n </tr>\n <tr className=\"block w-full\">\n <td className=\"flex w-full\">\n <TextEditor\n section={subSection}\n keyPath={childKeyPath}\n dictionary={dictionary}\n renderSection={renderSection}\n />\n </td>\n </tr>\n </Fragment>\n );\n }\n )}\n </tbody>\n </table>\n </>\n);\n\nenum MarkdownViewMode {\n Edit,\n Preview,\n}\n\nenum HtmlViewMode {\n Edit,\n Preview,\n}\n\nconst HtmlTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n}) => {\n const [mode, setMode] = useState(HtmlViewMode.Edit);\n const toggleContent = [\n {\n content: 'Edit',\n value: HtmlViewMode.Edit,\n },\n {\n content: 'Preview',\n value: HtmlViewMode.Preview,\n },\n ] as SwitchSelectorChoices<HtmlViewMode>;\n const childKeyPath: KeyPath[] = [...keyPath, { type: NodeTypes.HTML }];\n\n const content = (section as HTMLContent<ContentNode>)[\n NodeTypes.HTML\n ] as ContentNode;\n\n return (\n <div className=\"flex w-full flex-col justify-center gap-6 p-2\">\n <SwitchSelector\n choices={toggleContent}\n value={mode}\n onChange={setMode}\n color={SwitchSelectorColor.TEXT}\n size={SwitchSelectorSize.SM}\n className=\"ml-auto\"\n />\n\n <TextEditorContainer\n section={content}\n keyPath={childKeyPath}\n dictionary={dictionary}\n renderSection={\n mode === HtmlViewMode.Preview\n ? (content) => (\n // biome-ignore lint/security/noDangerouslySetInnerHtml: HTML content is user-controlled and rendered in editor context\n <div dangerouslySetInnerHTML={{ __html: content }} />\n )\n : undefined\n }\n />\n </div>\n );\n};\n\nconst MarkdownTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n isDarkMode,\n}) => {\n const [mode, setMode] = useState(MarkdownViewMode.Edit);\n const toggleContent = [\n {\n content: 'Edit',\n value: MarkdownViewMode.Edit,\n },\n {\n content: 'Preview',\n value: MarkdownViewMode.Preview,\n },\n ] as SwitchSelectorChoices<MarkdownViewMode>;\n const childKeyPath: KeyPath[] = [...keyPath, { type: NodeTypes.MARKDOWN }];\n\n const content = (section as MarkdownContent<ContentNode>)[\n NodeTypes.MARKDOWN\n ] as ContentNode;\n\n return (\n <div className=\"flex w-full flex-col justify-center gap-6 p-2\">\n <SwitchSelector\n choices={toggleContent}\n value={mode}\n onChange={setMode}\n color={SwitchSelectorColor.TEXT}\n size={SwitchSelectorSize.SM}\n className=\"ml-auto\"\n />\n\n <TextEditorContainer\n section={content}\n keyPath={childKeyPath}\n dictionary={dictionary}\n renderSection={\n mode === MarkdownViewMode.Preview\n ? (content) => (\n <MarkdownRenderer isDarkMode={isDarkMode}>\n {content}\n </MarkdownRenderer>\n )\n : undefined\n }\n />\n </div>\n );\n};\n\nconst InsertionTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n ...props\n}) => {\n const childKeyPath: KeyPath[] = [...keyPath, { type: NodeTypes.INSERTION }];\n\n const content = (section as InsertionContent<ContentNode>)[\n NodeTypes.INSERTION\n ];\n\n return (\n <div className=\"flex w-full flex-col justify-center gap-6 p-2\">\n <TextEditorContainer\n section={content}\n keyPath={childKeyPath}\n {...props}\n />\n </div>\n );\n};\n\nconst FileTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n ...props\n}) => {\n const childKeyPath: KeyPath[] = [...keyPath, { type: NodeTypes.FILE }];\n\n const fileUrl = (section as FileContent)[NodeTypes.FILE];\n const { content } = section as FileContent;\n\n return (\n <div className=\"flex w-full flex-col justify-center gap-6 p-2\">\n <span className=\"text-neutral text-sm\">{fileUrl} </span>\n <TextEditorContainer\n section={content}\n keyPath={childKeyPath}\n {...props}\n />\n </div>\n );\n};\n\nconst NestedTextEditor: FC<TextEditorProps> = ({\n keyPath,\n dictionary,\n renderSection,\n section,\n ...props\n}) => {\n const { addEditedContent } = useEditedContent();\n\n const content = (section as any)[NodeTypes.NESTED];\n const childrenKeyPath = [...keyPath, { type: NodeTypes.NESTED }] as KeyPath[];\n\n return (\n <div className=\"flex w-full flex-col gap-4 p-2\">\n <Label>Dictionary key</Label>\n <ContentEditorInputBase\n aria-label=\"Edit field\"\n type=\"text\"\n variant={InputVariant.DEFAULT}\n {...props}\n onContentChange={(newValue) => {\n addEditedContent(\n dictionary.localId!,\n {\n ...content,\n dictionaryKey: String(newValue),\n },\n childrenKeyPath\n );\n }}\n >\n {content.dictionaryKey ?? ''}\n </ContentEditorInputBase>\n\n <Label>Path (optional)</Label>\n <ContentEditorInputBase\n aria-label=\"Edit field\"\n type=\"text\"\n variant={InputVariant.DEFAULT}\n {...props}\n onContentChange={(newValue) => {\n addEditedContent(\n dictionary.localId!,\n {\n ...content,\n path: newValue !== '' ? newValue : undefined,\n },\n childrenKeyPath\n );\n }}\n >\n {content.path ?? ''}\n </ContentEditorInputBase>\n </div>\n );\n};\n\nexport const TextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n renderSection,\n isDarkMode,\n}) => {\n const { tsxNotEditable } = useIntlayer('navigation-view');\n const nodeType = getNodeType(section);\n\n if (nodeType === NodeTypes.REACT_NODE) {\n return (\n <div className=\"flex w-full flex-col gap-2\">\n <span>(React Node)</span>\n <span className=\"flex text-neutral text-xs\">{tsxNotEditable}</span>\n </div>\n );\n }\n\n if (nodeType === NodeTypes.NESTED) {\n return (\n <NestedTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.TRANSLATION) {\n return (\n <TranslationTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.ENUMERATION) {\n return (\n <EnumerationTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.CONDITION) {\n return (\n <ConditionTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.GENDER) {\n return (\n <GenderTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.INSERTION) {\n return (\n <InsertionTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.MARKDOWN) {\n return (\n <MarkdownTextEditor\n dictionary={dictionary}\n keyPath={keyPath}\n section={section}\n isDarkMode={isDarkMode}\n />\n );\n }\n\n if (nodeType === NodeTypes.HTML) {\n return (\n <HtmlTextEditor\n dictionary={dictionary}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.FILE) {\n return (\n <FileTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.ARRAY) {\n return (\n <ArrayTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.OBJECT) {\n return (\n <ObjectTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.NUMBER) {\n return (\n <div className=\"w-full p-2\">\n <ContentEditorInput\n dictionary={dictionary}\n keyPath={keyPath}\n type=\"number\"\n aria-label=\"Edit field\"\n >\n {section as number}\n </ContentEditorInput>\n </div>\n );\n }\n\n if (nodeType === NodeTypes.TEXT) {\n return (\n <div className=\"w-full p-2\">\n {typeof renderSection === 'function' ? (\n renderSection(section as string)\n ) : (\n <ContentEditorTextArea\n variant={InputVariant.DEFAULT}\n aria-label=\"Edit field\"\n keyPath={keyPath}\n dictionary={dictionary}\n >\n {section as string}\n </ContentEditorTextArea>\n )}\n </div>\n );\n }\n\n if (nodeType === NodeTypes.BOOLEAN) {\n return (\n <div className=\"w-full p-2\">\n <ContentEditorToggle\n dictionary={dictionary}\n keyPath={keyPath}\n value={section as boolean}\n />\n </div>\n );\n }\n\n return (\n <div className=\"w-full p-2\">\n Error. Format not supported.\n {JSON.stringify(section, null, 2)}\n {JSON.stringify(keyPath, null, 2)}\n NodeType : {nodeType}\n </div>\n );\n};\n\nexport const TextEditorContainer: FC<TextEditorProps> = (props) => (\n <Container\n border\n background=\"none\"\n className=\"top-6 flex h-full flex-1 flex-col gap-6 overflow-hidden p-2 md:sticky\"\n roundedSize=\"xl\"\n >\n <TextEditor {...props} />\n </Container>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAyDA,MAAa,YAAsB;CAAC;CAAY;CAAM;CAAW;AAUjE,MAAM,yBAAyD,EAC7D,SACA,YACA,GAAG,YACC;CACJ,MAAM,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;GACP;EACE;AAIV,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf;GAA4B;GAEzB,KAAK,UAAU,SAAS,MAAM,EAAE;GAChC,KAAK,UAAU,SAAS,MAAM,EAAE;GAAC;GACtB;GACR;;;AAIV,MAAa,uBAA4C,UACvD,oBAAC,WAAD;CACE;CACA,YAAW;CACX,WAAU;CACV,aAAY;WAEZ,oBAAC,YAAD,EAAY,GAAI,OAAS;CACf"}
|
|
1
|
+
{"version":3,"file":"TextEditor.mjs","names":["ContentEditorTextAreaBase","ContentEditorInputBase","MarkdownRenderer"],"sources":["../../../../../src/components/DictionaryFieldEditor/ContentEditorView/TextEditor.tsx"],"sourcesContent":["'use client';\n\nimport {\n Button,\n ButtonColor,\n ButtonSize,\n ButtonTextAlign,\n ButtonVariant,\n} from '@components/Button';\nimport { Container } from '@components/Container';\nimport {\n ContentEditorInput as ContentEditorInputBase,\n type ContentEditorInputProps as ContentEditorInputPropsBase,\n} from '@components/ContentEditor/ContentEditorInput';\nimport {\n ContentEditorTextArea as ContentEditorTextAreaBase,\n type ContentEditorTextAreaProps as ContentEditorTextAreaPropsBase,\n} from '@components/ContentEditor/ContentEditorTextArea';\nimport { renameKey } from '@components/DictionaryFieldEditor/ContentEditorView/object';\nimport { InputVariant } from '@components/Input';\nimport { Label } from '@components/Label';\nimport { useLocaleSwitcherContent } from '@components/LocaleSwitcherContentDropDown';\nimport { MarkdownRenderer } from '@components/MarkDownRender';\nimport {\n SwitchSelector,\n type SwitchSelectorChoices,\n SwitchSelectorColor,\n type SwitchSelectorProps,\n SwitchSelectorSize,\n} from '@components/SwitchSelector';\nimport { useAuditContentDeclarationField } from '@hooks/reactQuery';\nimport {\n getEmptyNode,\n getNodeType,\n} from '@intlayer/core/dictionaryManipulator';\nimport { getLocaleName } from '@intlayer/core/localization';\nimport type {\n ConditionContent,\n EnumerationContent,\n FileContent,\n GenderContent,\n HTMLContent,\n InsertionContent,\n MarkdownContent,\n TranslationContent,\n} from '@intlayer/core/transpiler';\nimport { useConfiguration, useEditedContent } from '@intlayer/editor-react';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport type { ContentNode, Dictionary } from '@intlayer/types/dictionary';\nimport type { KeyPath } from '@intlayer/types/keyPath';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport * as NodeTypes from '@intlayer/types/nodeType';\nimport { Plus, Trash, WandSparkles } from 'lucide-react';\nimport { type FC, Fragment, type ReactNode, useState } from 'react';\nimport { useIntlayer, useLocale } from 'react-intlayer';\nimport { EnumKeyInput } from '../EnumKeyInput';\n\nexport const traceKeys: string[] = ['filePath', 'id', 'nodeType'];\n\ntype ContentEditorTextAreaProps = Omit<\n ContentEditorTextAreaPropsBase,\n 'onContentChange'\n> & {\n keyPath: KeyPath[];\n dictionary: Dictionary;\n};\n\nconst ContentEditorTextArea: FC<ContentEditorTextAreaProps> = ({\n keyPath,\n dictionary,\n ...props\n}) => {\n const { editedContent, addEditedContent } = useEditedContent();\n const configuration = useConfiguration();\n const { mutate: auditContentDeclarationField, isPending: isAuditing } =\n useAuditContentDeclarationField();\n\n return (\n <ContentEditorTextAreaBase\n variant={InputVariant.DEFAULT}\n onContentChange={(newValue) =>\n addEditedContent(dictionary.localId!, newValue, keyPath)\n }\n additionalButtons={\n <Button\n Icon={WandSparkles}\n label=\"Audit\"\n variant={ButtonVariant.HOVERABLE}\n size={ButtonSize.ICON_SM}\n color={ButtonColor.TEXT}\n className=\"cursor-pointer hover:scale-110\"\n isLoading={isAuditing}\n onClick={() => {\n auditContentDeclarationField(\n {\n fileContent: JSON.stringify({\n ...dictionary,\n ...(editedContent?.[dictionary.localId!] ?? {}),\n }),\n keyPath,\n locales: configuration?.internationalization.locales ?? [],\n aiOptions: {\n apiKey: configuration?.ai?.apiKey,\n model: configuration?.ai?.model,\n temperature: configuration?.ai?.temperature,\n },\n },\n {\n onSuccess: (response) => {\n if (!response?.data) return;\n\n try {\n const editedContent = response.data.fileContent as string;\n\n addEditedContent(\n dictionary.localId!,\n editedContent,\n keyPath\n );\n } catch (error) {\n console.error(error);\n }\n },\n }\n );\n }}\n />\n }\n {...props}\n />\n );\n};\n\ntype ContentEditorInputProps = Omit<\n ContentEditorInputPropsBase,\n 'onContentChange'\n> & {\n keyPath: KeyPath[];\n dictionary: Dictionary;\n};\n\nconst ContentEditorInput: FC<ContentEditorInputProps> = ({\n keyPath,\n dictionary,\n ...props\n}) => {\n const { addEditedContent } = useEditedContent();\n\n return (\n <ContentEditorInputBase\n variant={InputVariant.DEFAULT}\n onContentChange={(newValue) =>\n addEditedContent(dictionary.localId!, newValue, keyPath)\n }\n {...props}\n />\n );\n};\n\nconst toggleContent = [\n {\n content: 'False',\n value: false,\n },\n {\n content: 'True',\n value: true,\n },\n] as SwitchSelectorChoices<boolean>;\n\ntype ContentEditorToggleProps = SwitchSelectorProps & {\n dictionary: Dictionary;\n keyPath: KeyPath[];\n};\n\nconst ContentEditorToggle: FC<ContentEditorToggleProps> = ({\n dictionary,\n keyPath,\n ...props\n}) => {\n const { addEditedContent } = useEditedContent();\n\n return (\n <SwitchSelector\n choices={toggleContent}\n value={true}\n onChange={(value) =>\n addEditedContent(dictionary.localId!, value, keyPath)\n }\n color={SwitchSelectorColor.TEXT}\n size={SwitchSelectorSize.SM}\n {...props}\n />\n );\n};\n\nexport type TextEditorProps = {\n dictionary: Dictionary;\n keyPath: KeyPath[];\n section: ContentNode;\n isDarkMode?: boolean;\n renderSection?: (content: string) => ReactNode;\n onContentChange?: (newValue: string) => void;\n};\n\nconst TranslationTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n renderSection,\n}: TextEditorProps) => {\n const { locale, defaultLocale } = useLocale();\n const { selectedLocales, availableLocales } = useLocaleSwitcherContent();\n\n const sectionContent = (section as TranslationContent<string>)[\n NodeTypes.TRANSLATION\n ] as Record<Locale, string>;\n\n const sectionContentKeys = Object.keys(sectionContent) as LocalesValues[];\n\n const isFiltered = availableLocales.length > selectedLocales.length;\n\n const localesList = isFiltered\n ? selectedLocales\n : // If the translation include content in other locales, we display all of them\n [...new Set([...availableLocales, ...sectionContentKeys])];\n\n const content: any = (section as TranslationContent<string>)[\n NodeTypes.TRANSLATION\n ];\n\n return (\n <table className=\"w-full\">\n <tbody className=\"flex w-full flex-col gap-2\">\n {localesList.map((translationKey) => {\n const uniqueKey = `${JSON.stringify(keyPath)}-translation-${translationKey}`;\n return (\n <Fragment key={uniqueKey}>\n <tr className=\"mt-2 w-full p-2 text-xs\">\n <td className=\"flex w-full\">\n {getLocaleName(translationKey, locale)}\n </td>\n </tr>\n <tr className=\"flex\">\n <td className=\"flex w-full\">\n <TextEditorContainer\n section={\n content[translationKey] ??\n getEmptyNode(content[defaultLocale])\n }\n keyPath={[\n ...keyPath,\n { type: NodeTypes.TRANSLATION, key: translationKey },\n ]}\n dictionary={dictionary}\n renderSection={renderSection}\n />\n </td>\n </tr>\n </Fragment>\n );\n })}\n </tbody>\n </table>\n );\n};\n\nconst EnumerationTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n renderSection,\n}) => {\n const { addEditedContent } = useEditedContent();\n const { addNewEnumeration, removeEnumeration } =\n useIntlayer('navigation-view');\n\n const content = (section as EnumerationContent<string>)[\n NodeTypes.ENUMERATION\n ];\n const firstKey = Object.keys(content)[0] as keyof typeof content;\n\n return (\n <div className=\"flex flex-col gap-2\">\n <table className=\"w-full\">\n <tbody className=\"flex w-full flex-col gap-2\">\n {Object.keys(\n (section as EnumerationContent<ContentNode>)[NodeTypes.ENUMERATION]\n ).map((enumKey) => {\n const childrenKeyPath = [\n ...keyPath,\n { type: NodeTypes.ENUMERATION, key: enumKey },\n ] as KeyPath[];\n const uniqueKey = `${JSON.stringify(keyPath)}-enumeration-${enumKey}`;\n\n return (\n <Fragment key={uniqueKey}>\n <tr className=\"mt-2 w-full\">\n <td className=\"flex w-full\">\n <div className=\"flex flex-1\">\n <Button\n label={removeEnumeration.label.value}\n variant=\"hoverable\"\n size=\"sm\"\n color=\"error\"\n className=\"ml-auto text-neutral hover:text-error\"\n Icon={Trash}\n onClick={() =>\n addEditedContent(\n dictionary.localId!,\n undefined,\n childrenKeyPath\n )\n }\n >\n {removeEnumeration.text}\n </Button>\n </div>\n </td>\n </tr>\n <tr className=\"w-full p-2\">\n <td className=\"flex w-full\">\n <EnumKeyInput\n value={enumKey}\n onChange={(value) => {\n const preValueContent = (\n section as EnumerationContent<string>\n )[NodeTypes.ENUMERATION];\n\n const newValueContent = renameKey(\n preValueContent,\n enumKey as keyof typeof preValueContent,\n value\n );\n const newValue = {\n ...(section as EnumerationContent<string>),\n [NodeTypes.ENUMERATION]: newValueContent,\n };\n\n console.log('newValue', newValue);\n\n addEditedContent(\n dictionary.localId!,\n newValue,\n keyPath\n );\n }}\n />\n </td>\n </tr>\n <tr className=\"block w-full\">\n <td className=\"flex w-full\">\n <TextEditor\n section={\n content[enumKey as keyof typeof content] ??\n getEmptyNode(content[firstKey])\n }\n keyPath={childrenKeyPath}\n dictionary={dictionary}\n renderSection={renderSection}\n />\n </td>\n </tr>\n </Fragment>\n );\n })}\n </tbody>\n </table>\n\n <Button\n label={addNewEnumeration.label.value}\n variant={ButtonVariant.HOVERABLE}\n color={ButtonColor.NEUTRAL}\n textAlign={ButtonTextAlign.LEFT}\n isFullWidth\n onClick={() =>\n addEditedContent(\n dictionary.localId!,\n getEmptyNode(content[firstKey]) ?? '',\n [...keyPath, { type: NodeTypes.ENUMERATION, key: 'unknown' }]\n )\n }\n Icon={Plus}\n className=\"m-2\"\n >\n {addNewEnumeration.text}\n </Button>\n </div>\n );\n};\n\nconst ConditionTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n renderSection,\n}) => {\n const content = (section as ConditionContent<string>)[NodeTypes.CONDITION];\n\n return (\n <table className=\"w-full\">\n <tbody className=\"flex w-full flex-col gap-2\">\n {['true', 'false', 'fallback'].map((condKey) => {\n const uniqueKey = `${JSON.stringify(keyPath)}-condition-${condKey}`;\n return (\n <Fragment key={uniqueKey}>\n <tr className=\"mt-2 block w-full p-2 text-xs\">\n <td className=\"flex w-full\">{String(condKey)}</td>\n </tr>\n <tr className=\"block w-full\">\n <td className=\"flex w-full\">\n <TextEditorContainer\n section={\n content[condKey as keyof typeof content] ??\n getEmptyNode(content.true)\n }\n keyPath={[\n ...keyPath,\n {\n type: NodeTypes.CONDITION,\n key: condKey,\n } as KeyPath,\n ]}\n dictionary={dictionary}\n renderSection={renderSection}\n />\n </td>\n </tr>\n </Fragment>\n );\n })}\n </tbody>\n </table>\n );\n};\n\nconst GenderTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n renderSection,\n}) => {\n const content = (section as GenderContent<string>)[NodeTypes.GENDER];\n\n return (\n <table className=\"w-full\">\n <tbody className=\"flex w-full flex-col gap-2\">\n {['male', 'female', 'fallback'].map((condKey) => {\n const uniqueKey = `${JSON.stringify(keyPath)}-gender-${condKey}`;\n return (\n <Fragment key={uniqueKey}>\n <tr className=\"mt-2 block w-full p-2 text-xs\">\n <td className=\"flex w-full\">{String(condKey)}</td>\n </tr>\n <tr className=\"block w-full\">\n <td className=\"flex w-full\">\n <TextEditorContainer\n section={\n content[condKey as keyof typeof content] ??\n getEmptyNode(content.male)\n }\n keyPath={[\n ...keyPath,\n {\n type: NodeTypes.GENDER,\n key: condKey,\n } as KeyPath,\n ]}\n dictionary={dictionary}\n renderSection={renderSection}\n />\n </td>\n </tr>\n </Fragment>\n );\n })}\n </tbody>\n </table>\n );\n};\n\nconst ArrayTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n renderSection,\n}) => {\n const { addEditedContent } = useEditedContent();\n const { addNewElement, removeElement } = useIntlayer('navigation-view');\n\n return (\n <div className=\"flex flex-col gap-2\">\n <table className=\"w-full\">\n <tbody className=\"flex w-full flex-col gap-2\">\n {(section as unknown as ContentNode[]).map((subSection, index) => {\n const uniqueKey = `${JSON.stringify(keyPath)}-array-${index}`;\n return (\n <Fragment key={uniqueKey}>\n <tr className=\"mt-2 w-full p-2\">\n <td className=\"flex w-full\">\n <div className=\"flex w-full items-center justify-between gap-2\">\n <span className=\"text-xs\">{String(index)}</span>\n <Button\n label={removeElement.label.value}\n variant=\"hoverable\"\n size=\"sm\"\n color=\"error\"\n className=\"ml-auto text-neutral hover:text-error\"\n onClick={() => {\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n {\n type: NodeTypes.ARRAY,\n key: index, // Fixed: Use index instead of length\n },\n ];\n addEditedContent(\n dictionary.localId!,\n undefined,\n newKeyPath\n );\n }}\n Icon={Trash}\n >\n {removeElement.text}\n </Button>\n </div>\n </td>\n </tr>\n\n <tr className=\"block w-full\">\n <td className=\"flex w-full\">\n <TextEditorContainer\n section={\n subSection ??\n getEmptyNode((section as unknown as ContentNode[])[0])\n }\n keyPath={[\n ...keyPath,\n {\n type: NodeTypes.ARRAY,\n key: index,\n },\n ]}\n dictionary={dictionary}\n renderSection={renderSection}\n />\n </td>\n </tr>\n </Fragment>\n );\n })}\n </tbody>\n </table>\n <Button\n label={addNewElement.label.value}\n variant={ButtonVariant.HOVERABLE}\n color={ButtonColor.NEUTRAL}\n textAlign={ButtonTextAlign.LEFT}\n isFullWidth\n onClick={() => {\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n {\n type: NodeTypes.ARRAY,\n key: (section as unknown as ContentNode[]).length, // Keeps length for adding new items\n },\n ];\n addEditedContent(\n dictionary.localId!,\n getEmptyNode((section as unknown as ContentNode[])[0]) ?? '',\n newKeyPath,\n false\n );\n }}\n Icon={Plus}\n >\n {addNewElement.text}\n </Button>\n </div>\n );\n};\n\nconst ObjectTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n renderSection,\n}) => (\n <>\n <table className=\"w-full\">\n <tbody className=\"flex flex-col gap-2\">\n {Object.keys(section as unknown as Record<string, ContentNode>).map(\n (key) => {\n const childKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeTypes.OBJECT, key },\n ];\n const typedSection = section as unknown as Record<\n string,\n ContentNode\n >;\n const firstKey = Object.keys(\n typedSection\n )[0] as keyof typeof section;\n const subSection =\n typedSection[key as keyof typeof section] ??\n getEmptyNode(typedSection[firstKey]);\n const uniqueKey = `${JSON.stringify(keyPath)}-object-${key}`;\n\n return (\n <Fragment key={uniqueKey}>\n <tr className=\"mt-2 p-2 text-xs\">\n <td className=\"flex w-full\">{String(key)}</td>\n </tr>\n <tr className=\"block w-full\">\n <td className=\"flex w-full\">\n <TextEditor\n section={subSection}\n keyPath={childKeyPath}\n dictionary={dictionary}\n renderSection={renderSection}\n />\n </td>\n </tr>\n </Fragment>\n );\n }\n )}\n </tbody>\n </table>\n </>\n);\n\nenum MarkdownViewMode {\n Edit,\n Preview,\n}\n\nenum HtmlViewMode {\n Edit,\n Preview,\n}\n\nconst HtmlTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n}) => {\n const [mode, setMode] = useState(HtmlViewMode.Edit);\n const toggleContent = [\n {\n content: 'Edit',\n value: HtmlViewMode.Edit,\n },\n {\n content: 'Preview',\n value: HtmlViewMode.Preview,\n },\n ] as SwitchSelectorChoices<HtmlViewMode>;\n const childKeyPath: KeyPath[] = [...keyPath, { type: NodeTypes.HTML }];\n\n const content = (section as HTMLContent<ContentNode>)[\n NodeTypes.HTML\n ] as ContentNode;\n\n return (\n <div className=\"flex w-full flex-col justify-center gap-6 p-2\">\n <SwitchSelector\n choices={toggleContent}\n value={mode}\n onChange={setMode}\n color={SwitchSelectorColor.TEXT}\n size={SwitchSelectorSize.SM}\n className=\"ml-auto\"\n />\n\n <TextEditorContainer\n section={content}\n keyPath={childKeyPath}\n dictionary={dictionary}\n renderSection={\n mode === HtmlViewMode.Preview\n ? (content) => (\n // biome-ignore lint/security/noDangerouslySetInnerHtml: HTML content is user-controlled and rendered in editor context\n <div dangerouslySetInnerHTML={{ __html: content }} />\n )\n : undefined\n }\n />\n </div>\n );\n};\n\nconst MarkdownTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n isDarkMode,\n}) => {\n const [mode, setMode] = useState(MarkdownViewMode.Edit);\n const toggleContent = [\n {\n content: 'Edit',\n value: MarkdownViewMode.Edit,\n },\n {\n content: 'Preview',\n value: MarkdownViewMode.Preview,\n },\n ] as SwitchSelectorChoices<MarkdownViewMode>;\n const childKeyPath: KeyPath[] = [...keyPath, { type: NodeTypes.MARKDOWN }];\n\n const content = (section as MarkdownContent<ContentNode>)[\n NodeTypes.MARKDOWN\n ] as ContentNode;\n\n return (\n <div className=\"flex w-full flex-col justify-center gap-6 p-2\">\n <SwitchSelector\n choices={toggleContent}\n value={mode}\n onChange={setMode}\n color={SwitchSelectorColor.TEXT}\n size={SwitchSelectorSize.SM}\n className=\"ml-auto\"\n />\n\n <TextEditorContainer\n section={content}\n keyPath={childKeyPath}\n dictionary={dictionary}\n renderSection={\n mode === MarkdownViewMode.Preview\n ? (content) => (\n <MarkdownRenderer isDarkMode={isDarkMode}>\n {content}\n </MarkdownRenderer>\n )\n : undefined\n }\n />\n </div>\n );\n};\n\nconst InsertionTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n ...props\n}) => {\n const childKeyPath: KeyPath[] = [...keyPath, { type: NodeTypes.INSERTION }];\n\n const content = (section as InsertionContent<ContentNode>)[\n NodeTypes.INSERTION\n ];\n\n return (\n <div className=\"flex w-full flex-col justify-center gap-6 p-2\">\n <TextEditorContainer\n section={content}\n keyPath={childKeyPath}\n {...props}\n />\n </div>\n );\n};\n\nconst FileTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n ...props\n}) => {\n const childKeyPath: KeyPath[] = [...keyPath, { type: NodeTypes.FILE }];\n\n const fileUrl = (section as FileContent)[NodeTypes.FILE];\n const { content } = section as FileContent;\n\n return (\n <div className=\"flex w-full flex-col justify-center gap-6 p-2\">\n <span className=\"text-neutral text-sm\">{fileUrl} </span>\n <TextEditorContainer\n section={content}\n keyPath={childKeyPath}\n {...props}\n />\n </div>\n );\n};\n\nconst NestedTextEditor: FC<TextEditorProps> = ({\n keyPath,\n dictionary,\n renderSection,\n section,\n ...props\n}) => {\n const { addEditedContent } = useEditedContent();\n\n const content = (section as any)[NodeTypes.NESTED];\n const childrenKeyPath = [...keyPath, { type: NodeTypes.NESTED }] as KeyPath[];\n\n return (\n <div className=\"flex w-full flex-col gap-4 p-2\">\n <Label>Dictionary key</Label>\n <ContentEditorInputBase\n aria-label=\"Edit field\"\n type=\"text\"\n variant={InputVariant.DEFAULT}\n {...props}\n onContentChange={(newValue) => {\n addEditedContent(\n dictionary.localId!,\n {\n ...content,\n dictionaryKey: String(newValue),\n },\n childrenKeyPath\n );\n }}\n >\n {content.dictionaryKey ?? ''}\n </ContentEditorInputBase>\n\n <Label>Path (optional)</Label>\n <ContentEditorInputBase\n aria-label=\"Edit field\"\n type=\"text\"\n variant={InputVariant.DEFAULT}\n {...props}\n onContentChange={(newValue) => {\n addEditedContent(\n dictionary.localId!,\n {\n ...content,\n path: newValue !== '' ? newValue : undefined,\n },\n childrenKeyPath\n );\n }}\n >\n {content.path ?? ''}\n </ContentEditorInputBase>\n </div>\n );\n};\n\nexport const TextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n renderSection,\n isDarkMode,\n}) => {\n const { tsxNotEditable } = useIntlayer('navigation-view');\n const nodeType = getNodeType(section);\n\n if (nodeType === NodeTypes.REACT_NODE) {\n return (\n <div className=\"flex w-full flex-col gap-2\">\n <span>(React Node)</span>\n <span className=\"flex text-neutral text-xs\">{tsxNotEditable}</span>\n </div>\n );\n }\n\n if (nodeType === NodeTypes.NESTED) {\n return (\n <NestedTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.TRANSLATION) {\n return (\n <TranslationTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.ENUMERATION) {\n return (\n <EnumerationTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.CONDITION) {\n return (\n <ConditionTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.GENDER) {\n return (\n <GenderTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.INSERTION) {\n return (\n <InsertionTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.MARKDOWN) {\n return (\n <MarkdownTextEditor\n dictionary={dictionary}\n keyPath={keyPath}\n section={section}\n isDarkMode={isDarkMode}\n />\n );\n }\n\n if (nodeType === NodeTypes.HTML) {\n return (\n <HtmlTextEditor\n dictionary={dictionary}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.FILE) {\n return (\n <FileTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.ARRAY) {\n return (\n <ArrayTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.OBJECT) {\n return (\n <ObjectTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.NUMBER) {\n return (\n <div className=\"w-full p-2\">\n <ContentEditorInput\n dictionary={dictionary}\n keyPath={keyPath}\n type=\"number\"\n aria-label=\"Edit field\"\n >\n {section as number}\n </ContentEditorInput>\n </div>\n );\n }\n\n if (nodeType === NodeTypes.TEXT) {\n return (\n <div className=\"w-full p-2\">\n {typeof renderSection === 'function' ? (\n renderSection(section as string)\n ) : (\n <ContentEditorTextArea\n variant={InputVariant.DEFAULT}\n aria-label=\"Edit field\"\n keyPath={keyPath}\n dictionary={dictionary}\n >\n {section as string}\n </ContentEditorTextArea>\n )}\n </div>\n );\n }\n\n if (nodeType === NodeTypes.BOOLEAN) {\n return (\n <div className=\"w-full p-2\">\n <ContentEditorToggle\n dictionary={dictionary}\n keyPath={keyPath}\n value={section as boolean}\n />\n </div>\n );\n }\n\n return (\n <div className=\"w-full p-2\">\n Error. Format not supported.\n {JSON.stringify(section, null, 2)}\n {JSON.stringify(keyPath, null, 2)}\n NodeType : {nodeType}\n </div>\n );\n};\n\nexport const TextEditorContainer: FC<TextEditorProps> = (props) => (\n <Container\n border\n background=\"none\"\n className=\"top-6 flex h-full flex-1 flex-col gap-6 overflow-hidden p-2 md:sticky\"\n roundedSize=\"xl\"\n >\n <TextEditor {...props} />\n </Container>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAyDA,MAAa,YAAsB;CAAC;CAAY;CAAM;CAAW;AAUjE,MAAM,yBAAyD,EAC7D,SACA,YACA,GAAG,YACC;CACJ,MAAM,EAAE,eAAe,qBAAqB,kBAAkB;CAC9D,MAAM,gBAAgB,kBAAkB;CACxC,MAAM,EAAE,QAAQ,8BAA8B,WAAW,eACvD,iCAAiC;AAEnC,QACE,oBAACA,yBAAD;EACE;EACA,kBAAkB,aAChB,iBAAiB,WAAW,SAAU,UAAU,QAAQ;EAE1D,mBACE,oBAAC,QAAD;GACE,MAAM;GACN,OAAM;GACN;GACA;GACA;GACA,WAAU;GACV,WAAW;GACX,eAAe;AACb,iCACE;KACE,aAAa,KAAK,UAAU;MAC1B,GAAG;MACH,GAAI,gBAAgB,WAAW,YAAa,EAAE;MAC/C,CAAC;KACF;KACA,SAAS,eAAe,qBAAqB,WAAW,EAAE;KAC1D,WAAW;MACT,QAAQ,eAAe,IAAI;MAC3B,OAAO,eAAe,IAAI;MAC1B,aAAa,eAAe,IAAI;MACjC;KACF,EACD,EACE,YAAY,aAAa;AACvB,SAAI,CAAC,UAAU,KAAM;AAErB,SA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AAC,uBAAD;GACE;GACA,cAAW;GACF;GACG;aAEX;GACqB;EAEtB;AAIV,KAAI,aAAa,UAAU,QACzB,QACE,oBAAC,OAAD;EAAK,WAAU;YACb,oBAAC,qBAAD;GACc;GACH;GACT,OAAO;GACP;EACE;AAIV,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf;GAA4B;GAEzB,KAAK,UAAU,SAAS,MAAM,EAAE;GAChC,KAAK,UAAU,SAAS,MAAM,EAAE;GAAC;GACtB;GACR;;;AAIV,MAAa,uBAA4C,UACvD,oBAAC,WAAD;CACE;CACA,YAAW;CACX,WAAU;CACV,aAAY;WAEZ,oBAAC,YAAD,EAAY,GAAI,OAAS;CACf"}
|
package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs
CHANGED
|
@@ -50,7 +50,7 @@ const DictionaryCreationForm = ({ onDictionaryCreated }) => {
|
|
|
50
50
|
/* @__PURE__ */ jsx(Form.Button, {
|
|
51
51
|
className: "mt-12 ml-auto",
|
|
52
52
|
type: "submit",
|
|
53
|
-
color:
|
|
53
|
+
color: "text",
|
|
54
54
|
isLoading: isSubmitting || isPending,
|
|
55
55
|
label: createDictionaryButton.ariaLabel.value,
|
|
56
56
|
isFullWidth: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionaryCreationForm.mjs","names":[],"sources":["../../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.tsx"],"sourcesContent":["'use client';\n\nimport { ButtonColor } from '@components/Button';\nimport { Form, useForm } from '@components/Form';\nimport { MultiSelect } from '@components/Select';\nimport { useAddDictionary, useGetProjects } from '@hooks/reactQuery';\nimport { useSession } from '@hooks/useAuth';\nimport type { FC } from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport {\n type DictionaryFormData,\n useDictionarySchema,\n} from './useDictionaryFormSchema';\n\ntype DictionaryCreationFormProps = {\n onDictionaryCreated?: () => void;\n};\n\nexport const DictionaryCreationForm: FC<DictionaryCreationFormProps> = ({\n onDictionaryCreated,\n}) => {\n const { session } = useSession();\n const { project } = session ?? {};\n const { mutate: addDictionary, isPending } = useAddDictionary();\n const { data: projectsData } = useGetProjects();\n const DictionarySchema = useDictionarySchema(String(project?.id));\n const { form, isSubmitting } = useForm(DictionarySchema, {\n defaultValues: {\n projectIds: [project?.id],\n },\n });\n const { keyInput, createDictionaryButton, projectInput } =\n useIntlayer('dictionary-form');\n\n const onSubmitSuccess = (data: DictionaryFormData) => {\n addDictionary(\n { dictionary: data },\n {\n onSuccess: () => {\n onDictionaryCreated?.();\n },\n }\n );\n };\n\n return (\n <Form\n schema={DictionarySchema}\n onSubmitSuccess={onSubmitSuccess}\n className=\"m-auto w-full max-w-[400px]\"\n {...form}\n >\n <Form.Input\n name=\"key\"\n label={keyInput.label.value}\n placeholder={keyInput.placeholder.value}\n isRequired\n />\n\n <Form.MultiSelect name=\"projectIds\" label={projectInput.label.value}>\n <MultiSelect.Trigger\n getBadgeValue={(value) =>\n projectsData?.data?.find((project) => String(project.id) === value)\n ?.name ?? value\n }\n >\n <MultiSelect.Input placeholder={projectInput.placeholder.value} />\n </MultiSelect.Trigger>\n <MultiSelect.Content>\n <MultiSelect.List>\n {projectsData?.data?.map((project) => (\n <MultiSelect.Item\n key={String(project.id)}\n value={String(project.id)}\n >\n {project.name}\n </MultiSelect.Item>\n ))}\n </MultiSelect.List>\n </MultiSelect.Content>\n </Form.MultiSelect>\n\n <Form.Button\n className=\"mt-12 ml-auto\"\n type=\"submit\"\n color={ButtonColor.TEXT}\n isLoading={isSubmitting || isPending}\n label={createDictionaryButton.ariaLabel.value}\n isFullWidth\n >\n {createDictionaryButton.text}\n </Form.Button>\n </Form>\n );\n};\n"],"mappings":";;;;;;;;;;;;;AAkBA,MAAa,0BAA2D,EACtE,0BACI;CACJ,MAAM,EAAE,YAAY,YAAY;CAChC,MAAM,EAAE,YAAY,WAAW,EAAE;CACjC,MAAM,EAAE,QAAQ,eAAe,cAAc,kBAAkB;CAC/D,MAAM,EAAE,MAAM,iBAAiB,gBAAgB;CAC/C,MAAM,mBAAmB,oBAAoB,OAAO,SAAS,GAAG,CAAC;CACjE,MAAM,EAAE,MAAM,iBAAiB,QAAQ,kBAAkB,EACvD,eAAe,EACb,YAAY,CAAC,SAAS,GAAG,EAC1B,EACF,CAAC;CACF,MAAM,EAAE,UAAU,wBAAwB,iBACxC,YAAY,kBAAkB;CAEhC,MAAM,mBAAmB,SAA6B;AACpD,gBACE,EAAE,YAAY,MAAM,EACpB,EACE,iBAAiB;AACf,0BAAuB;KAE1B,CACF;;AAGH,QACE,qBAAC,MAAD;EACE,QAAQ;EACS;EACjB,WAAU;EACV,GAAI;YAJN;GAME,oBAAC,KAAK,OAAN;IACE,MAAK;IACL,OAAO,SAAS,MAAM;IACtB,aAAa,SAAS,YAAY;IAClC;IACA;GAEF,qBAAC,KAAK,aAAN;IAAkB,MAAK;IAAa,OAAO,aAAa,MAAM;cAA9D,CACE,oBAAC,YAAY,SAAb;KACE,gBAAgB,UACd,cAAc,MAAM,MAAM,YAAY,OAAO,QAAQ,GAAG,KAAK,MAAM,EAC/D,QAAQ;eAGd,oBAAC,YAAY,OAAb,EAAmB,aAAa,aAAa,YAAY,OAAS;KAC9C,GACtB,oBAAC,YAAY,SAAb,YACE,oBAAC,YAAY,MAAb,YACG,cAAc,MAAM,KAAK,YACxB,oBAAC,YAAY,MAAb;KAEE,OAAO,OAAO,QAAQ,GAAG;eAExB,QAAQ;KACQ,EAJZ,OAAO,QAAQ,GAAG,CAIN,CACnB,EACe,GACC,EACL;;GAEnB,oBAAC,KAAK,QAAN;IACE,WAAU;IACV,MAAK;IACL
|
|
1
|
+
{"version":3,"file":"DictionaryCreationForm.mjs","names":[],"sources":["../../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.tsx"],"sourcesContent":["'use client';\n\nimport { ButtonColor } from '@components/Button';\nimport { Form, useForm } from '@components/Form';\nimport { MultiSelect } from '@components/Select';\nimport { useAddDictionary, useGetProjects } from '@hooks/reactQuery';\nimport { useSession } from '@hooks/useAuth';\nimport type { FC } from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport {\n type DictionaryFormData,\n useDictionarySchema,\n} from './useDictionaryFormSchema';\n\ntype DictionaryCreationFormProps = {\n onDictionaryCreated?: () => void;\n};\n\nexport const DictionaryCreationForm: FC<DictionaryCreationFormProps> = ({\n onDictionaryCreated,\n}) => {\n const { session } = useSession();\n const { project } = session ?? {};\n const { mutate: addDictionary, isPending } = useAddDictionary();\n const { data: projectsData } = useGetProjects();\n const DictionarySchema = useDictionarySchema(String(project?.id));\n const { form, isSubmitting } = useForm(DictionarySchema, {\n defaultValues: {\n projectIds: [project?.id],\n },\n });\n const { keyInput, createDictionaryButton, projectInput } =\n useIntlayer('dictionary-form');\n\n const onSubmitSuccess = (data: DictionaryFormData) => {\n addDictionary(\n { dictionary: data },\n {\n onSuccess: () => {\n onDictionaryCreated?.();\n },\n }\n );\n };\n\n return (\n <Form\n schema={DictionarySchema}\n onSubmitSuccess={onSubmitSuccess}\n className=\"m-auto w-full max-w-[400px]\"\n {...form}\n >\n <Form.Input\n name=\"key\"\n label={keyInput.label.value}\n placeholder={keyInput.placeholder.value}\n isRequired\n />\n\n <Form.MultiSelect name=\"projectIds\" label={projectInput.label.value}>\n <MultiSelect.Trigger\n getBadgeValue={(value) =>\n projectsData?.data?.find((project) => String(project.id) === value)\n ?.name ?? value\n }\n >\n <MultiSelect.Input placeholder={projectInput.placeholder.value} />\n </MultiSelect.Trigger>\n <MultiSelect.Content>\n <MultiSelect.List>\n {projectsData?.data?.map((project) => (\n <MultiSelect.Item\n key={String(project.id)}\n value={String(project.id)}\n >\n {project.name}\n </MultiSelect.Item>\n ))}\n </MultiSelect.List>\n </MultiSelect.Content>\n </Form.MultiSelect>\n\n <Form.Button\n className=\"mt-12 ml-auto\"\n type=\"submit\"\n color={ButtonColor.TEXT}\n isLoading={isSubmitting || isPending}\n label={createDictionaryButton.ari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;IACE,WAAU;IACV,MAAK;IACL;IACA,WAAW,gBAAgB;IAC3B,OAAO,uBAAuB,UAAU;IACxC;cAEC,uBAAuB;IACZ;GACT"}
|
|
@@ -129,48 +129,6 @@ const dictionaryFormContent = {
|
|
|
129
129
|
vi: "Nhấn để tạo từ điển",
|
|
130
130
|
uk: "Натисніть, щоб створити словник"
|
|
131
131
|
})
|
|
132
|
-
},
|
|
133
|
-
editButton: {
|
|
134
|
-
text: t({
|
|
135
|
-
en: "Edit dictionary",
|
|
136
|
-
"en-GB": "Edit dictionary",
|
|
137
|
-
fr: "Modifier le dictionnaire",
|
|
138
|
-
es: "Editar el diccionario",
|
|
139
|
-
de: "Wörterbuch bearbeiten",
|
|
140
|
-
ja: "辞書を編集",
|
|
141
|
-
ko: "사전 편집",
|
|
142
|
-
zh: "编辑字典",
|
|
143
|
-
it: "Modifica dizionario",
|
|
144
|
-
pt: "Editar dicionário",
|
|
145
|
-
hi: "शब्दकोश संपादित करें",
|
|
146
|
-
ar: "تعديل القاموس",
|
|
147
|
-
ru: "Редактировать словарь",
|
|
148
|
-
tr: "Sözlüğü düzenle",
|
|
149
|
-
pl: "Edytuj słownik",
|
|
150
|
-
id: "Edit dictionary",
|
|
151
|
-
vi: "Chỉnh sửa từ điển",
|
|
152
|
-
uk: "Редагувати словник"
|
|
153
|
-
}),
|
|
154
|
-
ariaLabel: t({
|
|
155
|
-
en: "Click to edit",
|
|
156
|
-
"en-GB": "Click to edit",
|
|
157
|
-
fr: "Cliquez pour modifier",
|
|
158
|
-
es: "Haga clic para editar",
|
|
159
|
-
de: "Klicken Sie, um zu bearbeiten",
|
|
160
|
-
ja: "編集するにはクリックしてください",
|
|
161
|
-
ko: "편집하려면 클릭하세요",
|
|
162
|
-
zh: "点击编辑",
|
|
163
|
-
it: "Clicca per modificare",
|
|
164
|
-
pt: "Clique para editar",
|
|
165
|
-
hi: "संपादित करने के लिए क्लिक करें",
|
|
166
|
-
ar: "انقر لتعديل",
|
|
167
|
-
ru: "Нажмите, чтобы отредактировать",
|
|
168
|
-
tr: "Düzenlemek için tıklayın",
|
|
169
|
-
pl: "Kliknij, aby edytować",
|
|
170
|
-
id: "Klik untuk mengedit",
|
|
171
|
-
vi: "Nhấn để chỉnh sửa",
|
|
172
|
-
uk: "Натисніть, щоб редагувати словник"
|
|
173
|
-
})
|
|
174
132
|
}
|
|
175
133
|
},
|
|
176
134
|
title: "Dictionary form",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionaryCreationForm.content.mjs","names":[],"sources":["../../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.ts"],"sourcesContent":["import { type Dictionary, t } from 'intlayer';\n\nexport const dictionaryFormContent = {\n key: 'dictionary-form',\n content: {\n keyInput: {\n label: t({\n en: 'Key',\n 'en-GB': 'Key',\n fr: 'Clé',\n es: 'Clave',\n de: 'Schlüssel',\n ja: 'キー',\n ko: '키',\n zh: '键',\n it: 'Chiave',\n pt: 'Chave',\n hi: 'कुंजी',\n ar: 'مفتاح',\n ru: 'Ключ',\n tr: 'Anahtar',\n pl: 'Klucz',\n id: 'Key',\n vi: 'Key',\n uk: 'Ключ',\n }),\n placeholder: t({\n en: 'Enter the key of your dictionary',\n 'en-GB': 'Enter the key of your dictionary',\n fr: 'Entrez la clé de votre dictionnaire',\n es: 'Ingrese la clave de su diccionario',\n de: 'Geben Sie den Schlüssel Ihres Wörterbuchs ein',\n ja: '辞書のキーを入力してください',\n ko: '사전의 키를 입력하세요',\n zh: '输入字典的键',\n it: 'Inserisci la chiave del tuo dizionario',\n pt: 'Insira a chave do seu dicionário',\n hi: 'अपने शब्दकोश की कुंजी दर्ज करें',\n ar: 'أدخل مفتاح القاموس الخاص بك',\n ru: 'Введите ключ вашего словаря',\n tr: 'Sözlüğünüzün anahtarını girin',\n pl: 'Wprowadź klucz słownika',\n id: 'Masukkan key dictionary Anda',\n vi: 'Nhập key của từ điển của bạn',\n uk: 'Введіть ключ вашого словника',\n }),\n },\n\n projectInput: {\n label: t({\n en: 'Projects',\n 'en-GB': 'Projects',\n fr: 'Projets',\n es: 'Proyectos',\n de: 'Projekte',\n ja: 'プロジェクト',\n ko: '프로젝트',\n zh: '项目',\n it: 'Progetti',\n pt: 'Projetos',\n hi: 'प्रोजेक्ट',\n ar: 'مشاريع',\n ru: 'Проекты',\n tr: 'Projeler',\n pl: 'Projekty',\n id: 'Projects',\n vi: 'Dự án',\n uk: 'Проєкти',\n }),\n placeholder: t({\n en: 'Select one or more projects to associate with your dictionary',\n 'en-GB':\n 'Select one or more projects to associate with your dictionary',\n fr: 'Sélectionnez un ou plusieurs projets à associer à votre dictionnaire',\n es: 'Seleccione uno o más proyectos para asociar con su diccionario',\n de: 'Wählen Sie ein oder mehrere Projekte aus, um sie mit Ihrem Wörterbuch zu verknüpfen',\n ja: '辞書に関連付けるプロジェクトを1つ以上選択してください',\n ko: '사전과 연결할 프로젝트를 하나 이상 선택하세요',\n zh: '选择一个或多个项目与您的字典关联',\n it: 'Seleziona uno o più progetti da associare al tuo dizionario',\n pt: 'Selecione um ou mais projetos para associar ao seu dicionário',\n hi: 'अपने शब्दकोश से जोड़ने के लिए एक या एक से अधिक प्रोजेक्ट चुनें',\n ar: 'حدد مشروعًا أو أكثر للربط مع قاموسك',\n ru: 'Выберите один или несколько проектов для связывания со словарем',\n tr: 'Sözlüğünüzle ilişkilendirmek için bir veya daha fazla proje seçin',\n pl: 'Wybierz jeden lub więcej projektów do powiązania z tym słownikiem',\n id: 'Pilih satu atau lebih Projects untuk dikaitkan dengan dictionary Anda',\n vi: 'Chọn một hoặc nhiều dự án để liên kết với từ điển của bạn',\n uk: \"Виберіть один або кілька проєктів, щоб пов'язати їх із вашим словником\",\n }),\n },\n\n createDictionaryButton: {\n text: t({\n en: 'Create dictionary',\n 'en-GB': 'Create dictionary',\n fr: 'Créer un dictionnaire',\n es: 'Crear un diccionario',\n de: 'Wörterbuch erstellen',\n ja: '辞書を作成',\n ko: '사전 만들기',\n zh: '创建字典',\n it: 'Crea dizionario',\n pt: 'Criar dicionário',\n hi: 'शब्दकोश बनाएँ',\n ar: 'إنشاء قاموس',\n ru: 'Создать словарь',\n tr: 'Sözlük oluştur',\n pl: 'Utwórz słownik',\n id: 'Buat dictionary',\n vi: 'Tạo từ điển',\n uk: 'Створити словник',\n }),\n ariaLabel: t({\n en: 'Click to create dictionary',\n 'en-GB': 'Click to create dictionary',\n fr: 'Cliquez pour créer un dictionnaire',\n es: 'Haga clic para crear un diccionario',\n de: 'Klicken Sie, um ein Wörterbuch zu erstellen',\n ja: '辞書を作成するにはクリックしてください',\n ko: '사전을 만들려면 클릭하세요',\n zh: '点击创建字典',\n it: 'Clicca per creare un dizionario',\n pt: 'Clique para criar dicionário',\n hi: 'शब्दकोश बनाने के लिए क्लिक करें',\n ar: 'انقر لإنشاء قاموس',\n ru: 'Нажмите, чтобы создать словарь',\n tr: 'Sözlük oluşturmak için tıklayın',\n pl: 'Kliknij, aby utworzyć słownik',\n id: 'Klik untuk membuat dictionary',\n vi: 'Nhấn để tạo từ điển',\n uk: 'Натисніть, щоб створити словник',\n }),\n },\n
|
|
1
|
+
{"version":3,"file":"dictionaryCreationForm.content.mjs","names":[],"sources":["../../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.ts"],"sourcesContent":["import { type Dictionary, t } from 'intlayer';\n\nexport const dictionaryFormContent = {\n key: 'dictionary-form',\n content: {\n keyInput: {\n label: t({\n en: 'Key',\n 'en-GB': 'Key',\n fr: 'Clé',\n es: 'Clave',\n de: 'Schlüssel',\n ja: 'キー',\n ko: '키',\n zh: '键',\n it: 'Chiave',\n pt: 'Chave',\n hi: 'कुंजी',\n ar: 'مفتاح',\n ru: 'Ключ',\n tr: 'Anahtar',\n pl: 'Klucz',\n id: 'Key',\n vi: 'Key',\n uk: 'Ключ',\n }),\n placeholder: t({\n en: 'Enter the key of your dictionary',\n 'en-GB': 'Enter the key of your dictionary',\n fr: 'Entrez la clé de votre dictionnaire',\n es: 'Ingrese la clave de su diccionario',\n de: 'Geben Sie den Schlüssel Ihres Wörterbuchs ein',\n ja: '辞書のキーを入力してください',\n ko: '사전의 키를 입력하세요',\n zh: '输入字典的键',\n it: 'Inserisci la chiave del tuo dizionario',\n pt: 'Insira a chave do seu dicionário',\n hi: 'अपने शब्दकोश की कुंजी दर्ज करें',\n ar: 'أدخل مفتاح القاموس الخاص بك',\n ru: 'Введите ключ вашего словаря',\n tr: 'Sözlüğünüzün anahtarını girin',\n pl: 'Wprowadź klucz słownika',\n id: 'Masukkan key dictionary Anda',\n vi: 'Nhập key của từ điển của bạn',\n uk: 'Введіть ключ вашого словника',\n }),\n },\n\n projectInput: {\n label: t({\n en: 'Projects',\n 'en-GB': 'Projects',\n fr: 'Projets',\n es: 'Proyectos',\n de: 'Projekte',\n ja: 'プロジェクト',\n ko: '프로젝트',\n zh: '项目',\n it: 'Progetti',\n pt: 'Projetos',\n hi: 'प्रोजेक्ट',\n ar: 'مشاريع',\n ru: 'Проекты',\n tr: 'Projeler',\n pl: 'Projekty',\n id: 'Projects',\n vi: 'Dự án',\n uk: 'Проєкти',\n }),\n placeholder: t({\n en: 'Select one or more projects to associate with your dictionary',\n 'en-GB':\n 'Select one or more projects to associate with your dictionary',\n fr: 'Sélectionnez un ou plusieurs projets à associer à votre dictionnaire',\n es: 'Seleccione uno o más proyectos para asociar con su diccionario',\n de: 'Wählen Sie ein oder mehrere Projekte aus, um sie mit Ihrem Wörterbuch zu verknüpfen',\n ja: '辞書に関連付けるプロジェクトを1つ以上選択してください',\n ko: '사전과 연결할 프로젝트를 하나 이상 선택하세요',\n zh: '选择一个或多个项目与您的字典关联',\n it: 'Seleziona uno o più progetti da associare al tuo dizionario',\n pt: 'Selecione um ou mais projetos para associar ao seu dicionário',\n hi: 'अपने शब्दकोश से जोड़ने के लिए एक या एक से अधिक प्रोजेक्ट चुनें',\n ar: 'حدد مشروعًا أو أكثر للربط مع قاموسك',\n ru: 'Выберите один или несколько проектов для связывания со словарем',\n tr: 'Sözlüğünüzle ilişkilendirmek için bir veya daha fazla proje seçin',\n pl: 'Wybierz jeden lub więcej projektów do powiązania z tym słownikiem',\n id: 'Pilih satu atau lebih Projects untuk dikaitkan dengan dictionary Anda',\n vi: 'Chọn một hoặc nhiều dự án để liên kết với từ điển của bạn',\n uk: \"Виберіть один або кілька проєктів, щоб пов'язати їх із вашим словником\",\n }),\n },\n\n createDictionaryButton: {\n text: t({\n en: 'Create dictionary',\n 'en-GB': 'Create dictionary',\n fr: 'Créer un dictionnaire',\n es: 'Crear un diccionario',\n de: 'Wörterbuch erstellen',\n ja: '辞書を作成',\n ko: '사전 만들기',\n zh: '创建字典',\n it: 'Crea dizionario',\n pt: 'Criar dicionário',\n hi: 'शब्दकोश बनाएँ',\n ar: 'إنشاء قاموس',\n ru: 'Создать словарь',\n tr: 'Sözlük oluştur',\n pl: 'Utwórz słownik',\n id: 'Buat dictionary',\n vi: 'Tạo từ điển',\n uk: 'Створити словник',\n }),\n ariaLabel: t({\n en: 'Click to create dictionary',\n 'en-GB': 'Click to create dictionary',\n fr: 'Cliquez pour créer un dictionnaire',\n es: 'Haga clic para crear un diccionario',\n de: 'Klicken Sie, um ein Wörterbuch zu erstellen',\n ja: '辞書を作成するにはクリックしてください',\n ko: '사전을 만들려면 클릭하세요',\n zh: '点击创建字典',\n it: 'Clicca per creare un dizionario',\n pt: 'Clique para criar dicionário',\n hi: 'शब्दकोश बनाने के लिए क्लिक करें',\n ar: 'انقر لإنشاء قاموس',\n ru: 'Нажмите, чтобы создать словарь',\n tr: 'Sözlük oluşturmak için tıklayın',\n pl: 'Kliknij, aby utworzyć słownik',\n id: 'Klik untuk membuat dictionary',\n vi: 'Nhấn để tạo từ điển',\n uk: 'Натисніть, щоб створити словник',\n }),\n },\n },\n title: 'Dictionary form',\n description:\n 'Content declarations for the dictionary creation form, including labels, placeholders, titles, descriptions, and button texts for managing dictionaries within Intlayer.',\n tags: ['form', 'dictionary creation', 'intlayer cms'],\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,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACL,CAAC;GACF,WAAW,EAAE;IACX,IAAI;IACJ,SAAS;IACT,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACL,CAAC;GACH;EACF;CACD,OAAO;CACP,aACE;CACF,MAAM;EAAC;EAAQ;EAAuB;EAAe;CACtD"}
|
package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs
CHANGED
|
@@ -309,11 +309,11 @@ const DictionaryDetailsForm = ({ dictionary, mode }) => {
|
|
|
309
309
|
className: "flex flex-wrap items-center justify-end gap-2 max-md:flex-col",
|
|
310
310
|
children: /* @__PURE__ */ jsx(Form.Button, {
|
|
311
311
|
type: "button",
|
|
312
|
-
size:
|
|
312
|
+
size: "icon-md",
|
|
313
313
|
label: auditButton.label.value,
|
|
314
314
|
Icon: WandSparkles,
|
|
315
|
-
variant:
|
|
316
|
-
color:
|
|
315
|
+
variant: "outline",
|
|
316
|
+
color: "text",
|
|
317
317
|
className: "max-md:w-full",
|
|
318
318
|
onClick: handleOnAuditFile,
|
|
319
319
|
disabled: isSubmitting || isAuditing,
|