@intlayer/design-system 3.4.9 → 3.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/manifest.json +0 -1
- package/dist/Form-BDcoNTLV.cjs.map +1 -1
- package/dist/Form-DhsgC7kB.js.map +1 -1
- package/dist/components/Accordion/Accordion.cjs.map +1 -1
- package/dist/components/Accordion/Accordion.mjs.map +1 -1
- package/dist/components/Auth/AuthModal/index.cjs.map +1 -1
- package/dist/components/Auth/AuthModal/index.mjs.map +1 -1
- package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.cjs.map +1 -1
- package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.mjs.map +1 -1
- package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierServer.cjs.map +1 -1
- package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierServer.mjs.map +1 -1
- package/dist/components/Auth/AuthenticationBarrier/accessValidation.cjs.map +1 -1
- package/dist/components/Auth/AuthenticationBarrier/accessValidation.mjs.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordSchema.cjs.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordSchema.mjs.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/index.content.cjs.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/index.content.mjs.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/assets/GoogleLogo.cjs.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/assets/GoogleLogo.mjs.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.cjs.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.mjs.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordSchema.cjs.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordSchema.mjs.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/index.content.cjs.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/index.content.mjs.map +1 -1
- package/dist/components/Auth/SignInForm/SignInForm.cjs.map +1 -1
- package/dist/components/Auth/SignInForm/SignInForm.mjs.map +1 -1
- package/dist/components/Auth/SignInForm/SignInSchema.cjs.map +1 -1
- package/dist/components/Auth/SignInForm/SignInSchema.mjs.map +1 -1
- package/dist/components/Auth/SignInForm/index.content.cjs.map +1 -1
- package/dist/components/Auth/SignInForm/index.content.mjs.map +1 -1
- package/dist/components/Auth/SignUpForm/SignUpForm.cjs.map +1 -1
- package/dist/components/Auth/SignUpForm/SignUpForm.mjs.map +1 -1
- package/dist/components/Auth/SignUpForm/SignUpSchema.cjs.map +1 -1
- package/dist/components/Auth/SignUpForm/SignUpSchema.mjs.map +1 -1
- package/dist/components/Auth/SignUpForm/index.content.cjs.map +1 -1
- package/dist/components/Auth/SignUpForm/index.content.mjs.map +1 -1
- package/dist/components/Auth/useAuth/index.cjs.map +1 -1
- package/dist/components/Auth/useAuth/index.mjs.map +1 -1
- package/dist/components/Auth/useAuth/useCSRF.cjs.map +1 -1
- package/dist/components/Auth/useAuth/useCSRF.mjs.map +1 -1
- package/dist/components/Auth/useAuth/useOAuth2.cjs.map +1 -1
- package/dist/components/Auth/useAuth/useOAuth2.mjs.map +1 -1
- package/dist/components/Auth/useAuth/useSession.cjs.map +1 -1
- package/dist/components/Auth/useAuth/useSession.mjs.map +1 -1
- package/dist/components/Auth/useUser/index.cjs.map +1 -1
- package/dist/components/Auth/useUser/index.mjs.map +1 -1
- package/dist/components/Avatar/index.cjs.map +1 -1
- package/dist/components/Avatar/index.mjs.map +1 -1
- package/dist/components/Badge/index.cjs.map +1 -1
- package/dist/components/Badge/index.mjs.map +1 -1
- package/dist/components/Breadcrumb/index.cjs.map +1 -1
- package/dist/components/Breadcrumb/index.mjs.map +1 -1
- package/dist/components/Button/Button.cjs.map +1 -1
- package/dist/components/Button/Button.mjs.map +1 -1
- package/dist/components/Command/index.cjs.map +1 -1
- package/dist/components/Command/index.mjs.map +1 -1
- package/dist/components/Container/index.cjs.map +1 -1
- package/dist/components/Container/index.mjs.map +1 -1
- package/dist/components/ContentEditor/ContentEditor.cjs.map +1 -1
- package/dist/components/ContentEditor/ContentEditor.mjs.map +1 -1
- package/dist/components/ContentEditor/ContentEditorTextArea.cjs.map +1 -1
- package/dist/components/ContentEditor/ContentEditorTextArea.mjs.map +1 -1
- package/dist/components/CopyToClipboard/index.cjs.map +1 -1
- package/dist/components/CopyToClipboard/index.mjs.map +1 -1
- package/dist/components/DictionaryEditor/DictionaryEditor.cjs.map +1 -1
- package/dist/components/DictionaryEditor/DictionaryEditor.mjs.map +1 -1
- package/dist/components/DictionaryEditor/ItemLayout.cjs.map +1 -1
- package/dist/components/DictionaryEditor/ItemLayout.mjs.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.cjs.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs.map +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs.map +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs.map +1 -1
- package/dist/components/DictionaryEditor/useEditedContentStore.cjs.map +1 -1
- package/dist/components/DictionaryEditor/useEditedContentStore.mjs.map +1 -1
- package/dist/components/DictionaryEditor/useEditionPanelStore.cjs.map +1 -1
- package/dist/components/DictionaryEditor/useEditionPanelStore.mjs.map +1 -1
- package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.cjs.map +1 -1
- package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.mjs.map +1 -1
- package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.cjs.map +1 -1
- package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/dictionariesSelector.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/dictionariesSelector.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryFormSchema.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryFormSchema.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsSchema.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsSchema.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EnumKeyInput.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EnumKeyInput.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/JSONEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/JSONEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/KeyPathBreadcrumb.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/KeyPathBreadcrumb.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveFormSchema.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveFormSchema.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/editorView.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/editorView.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/getIsEditableSection.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/getIsEditableSection.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.mjs.map +1 -1
- package/dist/components/DropDown/index.cjs.map +1 -1
- package/dist/components/DropDown/index.mjs.map +1 -1
- package/dist/components/EditableField/EditableFieldInput.cjs.map +1 -1
- package/dist/components/EditableField/EditableFieldInput.mjs.map +1 -1
- package/dist/components/EditableField/EditableFieldLayout.cjs.map +1 -1
- package/dist/components/EditableField/EditableFieldLayout.mjs.map +1 -1
- package/dist/components/EditableField/EditableFieldTextArea.cjs.map +1 -1
- package/dist/components/EditableField/EditableFieldTextArea.mjs.map +1 -1
- package/dist/components/Footer/index.cjs.map +1 -1
- package/dist/components/Footer/index.mjs.map +1 -1
- package/dist/components/Form/FormBase.cjs.map +1 -1
- package/dist/components/Form/FormBase.mjs.map +1 -1
- package/dist/components/Form/FormControl.cjs.map +1 -1
- package/dist/components/Form/FormControl.mjs.map +1 -1
- package/dist/components/Form/FormDescription.cjs.map +1 -1
- package/dist/components/Form/FormDescription.mjs.map +1 -1
- package/dist/components/Form/FormField.cjs.map +1 -1
- package/dist/components/Form/FormField.mjs.map +1 -1
- package/dist/components/Form/FormItem.cjs.map +1 -1
- package/dist/components/Form/FormItem.mjs.map +1 -1
- package/dist/components/Form/FormLabel.cjs.map +1 -1
- package/dist/components/Form/FormLabel.mjs.map +1 -1
- package/dist/components/Form/FormMessage.cjs.map +1 -1
- package/dist/components/Form/FormMessage.mjs.map +1 -1
- package/dist/components/Form/elements/FormElementWrapper.cjs.map +1 -1
- package/dist/components/Form/elements/FormElementWrapper.mjs.map +1 -1
- package/dist/components/Form/layout/FormLabelLayout.cjs.map +1 -1
- package/dist/components/Form/layout/FormLabelLayout.mjs.map +1 -1
- package/dist/components/Headers/SectionScroller.cjs.map +1 -1
- package/dist/components/Headers/SectionScroller.mjs.map +1 -1
- package/dist/components/Headers/index.cjs.map +1 -1
- package/dist/components/Headers/index.mjs.map +1 -1
- package/dist/components/IDE/CodeRender.cjs +9 -3
- package/dist/components/IDE/CodeRender.cjs.map +1 -1
- package/dist/components/IDE/CodeRender.d.ts.map +1 -1
- package/dist/components/IDE/CodeRender.mjs +9 -3
- package/dist/components/IDE/CodeRender.mjs.map +1 -1
- package/dist/components/IDE/FileList.cjs.map +1 -1
- package/dist/components/IDE/FileList.mjs.map +1 -1
- package/dist/components/IDE/FileTree.cjs.map +1 -1
- package/dist/components/IDE/FileTree.mjs.map +1 -1
- package/dist/components/IDE/IDE.cjs +1 -1
- package/dist/components/IDE/IDE.cjs.map +1 -1
- package/dist/components/IDE/IDE.mjs +1 -1
- package/dist/components/IDE/IDE.mjs.map +1 -1
- package/dist/components/IDE/MarkDownRender.cjs.map +1 -1
- package/dist/components/IDE/MarkDownRender.mjs.map +1 -1
- package/dist/components/IDE/createFileTree.cjs.map +1 -1
- package/dist/components/IDE/createFileTree.mjs.map +1 -1
- package/dist/components/Input/Checkbox.cjs.map +1 -1
- package/dist/components/Input/Checkbox.mjs.map +1 -1
- package/dist/components/Input/Input.cjs.map +1 -1
- package/dist/components/Input/Input.mjs.map +1 -1
- package/dist/components/Input/InputPassword.cjs.map +1 -1
- package/dist/components/Input/InputPassword.mjs.map +1 -1
- package/dist/components/Link/Link.cjs.map +1 -1
- package/dist/components/Link/Link.mjs.map +1 -1
- package/dist/components/Loader/spinner.cjs.map +1 -1
- package/dist/components/Loader/spinner.mjs.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.cjs.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs.map +1 -1
- package/dist/components/Logo/LogoCircle.cjs.map +1 -1
- package/dist/components/Logo/LogoCircle.mjs.map +1 -1
- package/dist/components/Logo/LogoNoFrame.cjs.map +1 -1
- package/dist/components/Logo/LogoNoFrame.mjs.map +1 -1
- package/dist/components/Logo/LogoSquare.cjs.map +1 -1
- package/dist/components/Logo/LogoSquare.mjs.map +1 -1
- package/dist/components/Logo/LogoSquircle.cjs.map +1 -1
- package/dist/components/Logo/LogoSquircle.mjs.map +1 -1
- package/dist/components/Logo/LogoTextOnly.cjs.map +1 -1
- package/dist/components/Logo/LogoTextOnly.mjs.map +1 -1
- package/dist/components/Logo/LogoWithTextBelowCircle.cjs.map +1 -1
- package/dist/components/Logo/LogoWithTextBelowCircle.mjs.map +1 -1
- package/dist/components/Logo/LogoWithTextBelowNoFrame.cjs.map +1 -1
- package/dist/components/Logo/LogoWithTextBelowNoFrame.mjs.map +1 -1
- package/dist/components/Logo/LogoWithTextBelowSquircle.cjs.map +1 -1
- package/dist/components/Logo/LogoWithTextBelowSquircle.mjs.map +1 -1
- package/dist/components/Logo/LogoWithTextCircle.cjs.map +1 -1
- package/dist/components/Logo/LogoWithTextCircle.mjs.map +1 -1
- package/dist/components/Logo/LogoWithTextNoFrame.cjs.map +1 -1
- package/dist/components/Logo/LogoWithTextNoFrame.mjs.map +1 -1
- package/dist/components/Logo/LogoWithTextSquircle.cjs.map +1 -1
- package/dist/components/Logo/LogoWithTextSquircle.mjs.map +1 -1
- package/dist/components/Logo/index.cjs.map +1 -1
- package/dist/components/Logo/index.mjs.map +1 -1
- package/dist/components/MarkDownRender/index.cjs.map +1 -1
- package/dist/components/MarkDownRender/index.mjs.map +1 -1
- package/dist/components/MaxHeightSmoother/index.cjs.map +1 -1
- package/dist/components/MaxHeightSmoother/index.mjs.map +1 -1
- package/dist/components/MaxWidthSmoother/index.cjs.map +1 -1
- package/dist/components/MaxWidthSmoother/index.mjs.map +1 -1
- package/dist/components/Modal/Modal.cjs.map +1 -1
- package/dist/components/Modal/Modal.mjs.map +1 -1
- package/dist/components/Navbar/Burger.cjs.map +1 -1
- package/dist/components/Navbar/Burger.mjs.map +1 -1
- package/dist/components/Navbar/DesktopNavbar.cjs.map +1 -1
- package/dist/components/Navbar/DesktopNavbar.mjs.map +1 -1
- package/dist/components/Navbar/MobileNavbar.cjs.map +1 -1
- package/dist/components/Navbar/MobileNavbar.mjs.map +1 -1
- package/dist/components/Navbar/index.cjs.map +1 -1
- package/dist/components/Navbar/index.mjs.map +1 -1
- package/dist/components/Navbar/useNavigation.cjs.map +1 -1
- package/dist/components/Navbar/useNavigation.mjs.map +1 -1
- package/dist/components/Pattern/DotPattern.cjs.map +1 -1
- package/dist/components/Pattern/DotPattern.mjs.map +1 -1
- package/dist/components/Pattern/GridPattern.cjs.map +1 -1
- package/dist/components/Pattern/GridPattern.mjs.map +1 -1
- package/dist/components/Pattern/SpotLight.cjs.map +1 -1
- package/dist/components/Pattern/SpotLight.mjs.map +1 -1
- package/dist/components/Popover/index.cjs.map +1 -1
- package/dist/components/Popover/index.mjs.map +1 -1
- package/dist/components/PressableSpan/PressableSpan.cjs.map +1 -1
- package/dist/components/PressableSpan/PressableSpan.mjs.map +1 -1
- package/dist/components/ProfileDropDown/index.cjs.map +1 -1
- package/dist/components/ProfileDropDown/index.mjs.map +1 -1
- package/dist/components/RightDrawer/RightDrawer.cjs.map +1 -1
- package/dist/components/RightDrawer/RightDrawer.mjs.map +1 -1
- package/dist/components/RightDrawer/useRightDrawerStore.cjs.map +1 -1
- package/dist/components/RightDrawer/useRightDrawerStore.mjs.map +1 -1
- package/dist/components/Select/Multiselect.cjs.map +1 -1
- package/dist/components/Select/Multiselect.mjs.map +1 -1
- package/dist/components/Select/Select.cjs.map +1 -1
- package/dist/components/Select/Select.mjs.map +1 -1
- package/dist/components/SwitchSelector/index.cjs.map +1 -1
- package/dist/components/SwitchSelector/index.mjs.map +1 -1
- package/dist/components/TabSelector/TabSelector.cjs.map +1 -1
- package/dist/components/TabSelector/TabSelector.mjs.map +1 -1
- package/dist/components/Tag/index.cjs.map +1 -1
- package/dist/components/Tag/index.mjs.map +1 -1
- package/dist/components/TextArea/AutoSizeTextArea.cjs.map +1 -1
- package/dist/components/TextArea/AutoSizeTextArea.mjs.map +1 -1
- package/dist/components/TextArea/TextArea.cjs.map +1 -1
- package/dist/components/TextArea/TextArea.mjs.map +1 -1
- package/dist/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.cjs.map +1 -1
- package/dist/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs.map +1 -1
- package/dist/components/ThemeSwitcherDropDown/MobileThemeSwitcher.cjs.map +1 -1
- package/dist/components/ThemeSwitcherDropDown/MobileThemeSwitcher.mjs.map +1 -1
- package/dist/components/Toaster/Toast.cjs.map +1 -1
- package/dist/components/Toaster/Toast.mjs.map +1 -1
- package/dist/components/Toaster/Toaster.cjs.map +1 -1
- package/dist/components/Toaster/Toaster.mjs.map +1 -1
- package/dist/components/Toaster/useToast.cjs.map +1 -1
- package/dist/components/Toaster/useToast.mjs.map +1 -1
- package/dist/components/WithResizer/index.cjs.map +1 -1
- package/dist/components/WithResizer/index.mjs.map +1 -1
- package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
- package/dist/hooks/intlayerAPIHooks.mjs.map +1 -1
- package/dist/hooks/useAsync/useAsync.cjs.map +1 -1
- package/dist/hooks/useAsync/useAsync.mjs.map +1 -1
- package/dist/hooks/useAsync/useAsyncStateStore.cjs.map +1 -1
- package/dist/hooks/useAsync/useAsyncStateStore.mjs.map +1 -1
- package/dist/hooks/useDevice.cjs.map +1 -1
- package/dist/hooks/useDevice.mjs.map +1 -1
- package/dist/hooks/useGetAllDictionaries.cjs.map +1 -1
- package/dist/hooks/useGetAllDictionaries.mjs.map +1 -1
- package/dist/hooks/useGetElementOrWindow.cjs.map +1 -1
- package/dist/hooks/useIntlayerAPI.cjs.map +1 -1
- package/dist/hooks/useIntlayerAPI.mjs.map +1 -1
- package/dist/hooks/useIsMounted.cjs.map +1 -1
- package/dist/hooks/useIsMounted.mjs.map +1 -1
- package/dist/hooks/useItemSelector.cjs.map +1 -1
- package/dist/hooks/useItemSelector.mjs.map +1 -1
- package/dist/hooks/usePersistedStore.cjs.map +1 -1
- package/dist/hooks/usePersistedStore.mjs.map +1 -1
- package/dist/hooks/useScrollBlockage/index.cjs.map +1 -1
- package/dist/hooks/useScrollBlockage/index.mjs.map +1 -1
- package/dist/hooks/useScrollBlockage/useScrollBlockageStore.cjs.map +1 -1
- package/dist/hooks/useScrollBlockage/useScrollBlockageStore.mjs.map +1 -1
- package/dist/hooks/useScrollDetection.cjs.map +1 -1
- package/dist/hooks/useScrollDetection.mjs.map +1 -1
- package/dist/index-BtZWYJhL.cjs.map +1 -1
- package/dist/index-D9oaKvKC.js.map +1 -1
- package/dist/jsx-runtime-DaNGiM0W.js.map +1 -1
- package/dist/jsx-runtime-XHKiWCTo.cjs.map +1 -1
- package/dist/libs/intlayer-api/auth.cjs.map +1 -1
- package/dist/libs/intlayer-api/auth.mjs.map +1 -1
- package/dist/libs/intlayer-api/dictionary.cjs.map +1 -1
- package/dist/libs/intlayer-api/dictionary.mjs.map +1 -1
- package/dist/libs/intlayer-api/fetcher.cjs.map +1 -1
- package/dist/libs/intlayer-api/fetcher.mjs.map +1 -1
- package/dist/libs/intlayer-api/organization.cjs.map +1 -1
- package/dist/libs/intlayer-api/organization.mjs.map +1 -1
- package/dist/libs/intlayer-api/project.cjs.map +1 -1
- package/dist/libs/intlayer-api/project.mjs.map +1 -1
- package/dist/libs/intlayer-api/stripe.cjs.map +1 -1
- package/dist/libs/intlayer-api/stripe.mjs.map +1 -1
- package/dist/libs/intlayer-api/user.cjs.map +1 -1
- package/dist/libs/intlayer-api/user.mjs.map +1 -1
- package/dist/shallow-lhDIFtEp.cjs.map +1 -1
- package/dist/shallow-m9BpCkKh.js.map +1 -1
- package/dist/tailwind.config.cjs.map +1 -1
- package/dist/tailwind.config.mjs.map +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/utils/camelCase.cjs.map +1 -1
- package/dist/utils/camelCase.mjs.map +1 -1
- package/dist/utils/capitalize.cjs.map +1 -1
- package/dist/utils/capitalize.mjs.map +1 -1
- package/dist/utils/dictionary.cjs.map +1 -1
- package/dist/utils/dictionary.mjs.map +1 -1
- package/dist/utils/isElementAtTopAndNotCovered.cjs.map +1 -1
- package/dist/utils/isElementAtTopAndNotCovered.mjs.map +1 -1
- package/dist/utils/object.cjs.map +1 -1
- package/dist/utils/object.mjs.map +1 -1
- package/dist/zod-BV4nCGJE.js.map +1 -1
- package/dist/zod-DSrtTSD_.cjs.map +1 -1
- package/package.json +14 -14
package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionariesSelector.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.tsx"],"sourcesContent":["'use client';\n\nimport { useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { useGetAllDictionaries } from '../../../hooks';\nimport { useEditionPanelStore } from '../../DictionaryEditor';\nimport { Loader } from '../../Loader';\nimport { DictionaryFieldEditor } from '../DictionaryFieldEditor';\nimport { dictionariesSelectorContent } from './dictionariesSelector.content';\n\ntype DictionariesSelectorProps = {\n onClickDictionaryList: () => void;\n};\n\nexport const DictionariesSelector: FC<DictionariesSelectorProps> = ({\n onClickDictionaryList,\n}) => {\n const { online, locale, isLoading } = useGetAllDictionaries();\n const { focusedContent } = useEditionPanelStore(\n useShallow((s) => ({\n focusedContent: s.focusedContent,\n }))\n );\n const { noDictionaryMessage, dictionaryNotFoundMessage } = useDictionary(\n dictionariesSelectorContent\n );\n const dictionary = useMemo(\n () =>\n focusedContent?.dictionaryId\n ? (online?.[focusedContent?.dictionaryId] ??\n locale?.[focusedContent?.dictionaryId])\n : null,\n [online, locale, focusedContent?.dictionaryId]\n );\n\n if (isLoading) return <Loader />;\n\n if (!focusedContent?.dictionaryId) return noDictionaryMessage;\n\n if (!dictionary) return dictionaryNotFoundMessage;\n\n return (\n <DictionaryFieldEditor\n dictionary={dictionary}\n onClickDictionaryList={onClickDictionaryList}\n />\n );\n};\n"],"names":["jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBO,MAAM,uBAAsD,CAAC;AAAA,EAClE;AACF,MAAM;AACJ,QAAM,EAAE,QAAQ,QAAQ,
|
|
1
|
+
{"version":3,"file":"DictionariesSelector.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.tsx"],"sourcesContent":["'use client';\n\nimport { useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { useGetAllDictionaries } from '../../../hooks';\nimport { useEditionPanelStore } from '../../DictionaryEditor';\nimport { Loader } from '../../Loader';\nimport { DictionaryFieldEditor } from '../DictionaryFieldEditor';\nimport { dictionariesSelectorContent } from './dictionariesSelector.content';\n\ntype DictionariesSelectorProps = {\n onClickDictionaryList: () => void;\n};\n\nexport const DictionariesSelector: FC<DictionariesSelectorProps> = ({\n onClickDictionaryList,\n}) => {\n const { online, locale, isLoading } = useGetAllDictionaries();\n const { focusedContent } = useEditionPanelStore(\n useShallow((s) => ({\n focusedContent: s.focusedContent,\n }))\n );\n const { noDictionaryMessage, dictionaryNotFoundMessage } = useDictionary(\n dictionariesSelectorContent\n );\n const dictionary = useMemo(\n () =>\n focusedContent?.dictionaryId\n ? (online?.[focusedContent?.dictionaryId] ??\n locale?.[focusedContent?.dictionaryId])\n : null,\n [online, locale, focusedContent?.dictionaryId]\n );\n\n if (isLoading) return <Loader />;\n\n if (!focusedContent?.dictionaryId) return noDictionaryMessage;\n\n if (!dictionary) return dictionaryNotFoundMessage;\n\n return (\n <DictionaryFieldEditor\n dictionary={dictionary}\n onClickDictionaryList={onClickDictionaryList}\n />\n );\n};\n"],"names":["jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBO,MAAM,uBAAsD,CAAC;AAAA,EAClE;AACF,MAAM;AACJ,QAAM,EAAE,QAAQ,QAAQ,UAAA,IAAc,sBAAsB;AACtD,QAAA,EAAE,mBAAmB;AAAA,IACzB,WAAW,CAAC,OAAO;AAAA,MACjB,gBAAgB,EAAE;AAAA,IAAA,EAClB;AAAA,EACJ;AACM,QAAA,EAAE,qBAAqB,0BAAA,IAA8B;AAAA,IACzD;AAAA,EACF;AACA,QAAM,aAAa;AAAA,IACjB,MACE,gBAAgB,eACX,SAAS,gBAAgB,YAAY,KACtC,SAAS,gBAAgB,YAAY,IACrC;AAAA,IACN,CAAC,QAAQ,QAAQ,gBAAgB,YAAY;AAAA,EAC/C;AAEI,MAAA,UAAkB,QAAAA,sCAAC,QAAO,CAAA,CAAA;AAE1B,MAAA,CAAC,gBAAgB,aAAqB,QAAA;AAEtC,MAAA,CAAC,WAAmB,QAAA;AAGtB,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionariesSelector.content.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionariesSelector/dictionariesSelector.content.ts"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const dictionariesSelectorContent = {\n key: 'dictionaries-selector',\n content: {\n noDictionaryMessage: t({\n en: 'No dictionary',\n fr: 'Aucun dictionnaire',\n es: 'Sin diccionario',\n }),\n dictionaryNotFoundMessage: t({\n en: 'Dictionary not found',\n fr: 'Dictionnaire non trouvé',\n es: 'Diccionario no encontrado',\n }),\n },\n} satisfies DeclarationContent;\n"],"names":["t"],"mappings":";;;AAEO,MAAM,8BAA8B;AAAA,EACzC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,qBAAqBA,SAAAA,EAAE;AAAA,MACrB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,2BAA2BA,SAAAA,EAAE;AAAA,MAC3B,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,
|
|
1
|
+
{"version":3,"file":"dictionariesSelector.content.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionariesSelector/dictionariesSelector.content.ts"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const dictionariesSelectorContent = {\n key: 'dictionaries-selector',\n content: {\n noDictionaryMessage: t({\n en: 'No dictionary',\n fr: 'Aucun dictionnaire',\n es: 'Sin diccionario',\n }),\n dictionaryNotFoundMessage: t({\n en: 'Dictionary not found',\n fr: 'Dictionnaire non trouvé',\n es: 'Diccionario no encontrado',\n }),\n },\n} satisfies DeclarationContent;\n"],"names":["t"],"mappings":";;;AAEO,MAAM,8BAA8B;AAAA,EACzC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,qBAAqBA,SAAAA,EAAE;AAAA,MACrB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,2BAA2BA,SAAAA,EAAE;AAAA,MAC3B,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACL,CAAA;AAAA,EAAA;AAEL;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionariesSelector.content.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionariesSelector/dictionariesSelector.content.ts"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const dictionariesSelectorContent = {\n key: 'dictionaries-selector',\n content: {\n noDictionaryMessage: t({\n en: 'No dictionary',\n fr: 'Aucun dictionnaire',\n es: 'Sin diccionario',\n }),\n dictionaryNotFoundMessage: t({\n en: 'Dictionary not found',\n fr: 'Dictionnaire non trouvé',\n es: 'Diccionario no encontrado',\n }),\n },\n} satisfies DeclarationContent;\n"],"names":[],"mappings":";AAEO,MAAM,8BAA8B;AAAA,EACzC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,qBAAqB,EAAE;AAAA,MACrB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,2BAA2B,EAAE;AAAA,MAC3B,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,
|
|
1
|
+
{"version":3,"file":"dictionariesSelector.content.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionariesSelector/dictionariesSelector.content.ts"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const dictionariesSelectorContent = {\n key: 'dictionaries-selector',\n content: {\n noDictionaryMessage: t({\n en: 'No dictionary',\n fr: 'Aucun dictionnaire',\n es: 'Sin diccionario',\n }),\n dictionaryNotFoundMessage: t({\n en: 'Dictionary not found',\n fr: 'Dictionnaire non trouvé',\n es: 'Diccionario no encontrado',\n }),\n },\n} satisfies DeclarationContent;\n"],"names":[],"mappings":";AAEO,MAAM,8BAA8B;AAAA,EACzC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,qBAAqB,EAAE;AAAA,MACrB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,2BAA2B,EAAE;AAAA,MAC3B,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACL,CAAA;AAAA,EAAA;AAEL;"}
|
package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionaryCreationForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.tsx"],"sourcesContent":["'use client';\n\nimport { type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport {\n useAddDictionary,\n useGetProjects,\n} from '../../../hooks/intlayerAPIHooks';\nimport { useAuth } from '../../Auth';\nimport { Form, useForm } from '../../Form';\nimport { MultiSelect } from '../../Select';\nimport { dictionaryFormContent } from './dictionaryCreationForm.content';\nimport {\n getDictionarySchema,\n type DictionaryFormData,\n} from './dictionaryFormSchema';\n\nexport const DictionaryCreationForm: FC = () => {\n const { session } = useAuth();\n const { project } = session ?? {};\n const { addDictionary } = useAddDictionary();\n const { data: projects } = useGetProjects();\n const DictionarySchema = getDictionarySchema(String(project?._id));\n const { form, isSubmitting } = useForm(DictionarySchema);\n const { keyInput, createDictionaryButton, projectInput } = useDictionary(\n dictionaryFormContent\n );\n\n const onSubmitSuccess = async (data: DictionaryFormData) => {\n await addDictionary(data);\n };\n\n return (\n <Form\n schema={DictionarySchema}\n onSubmitSuccess={onSubmitSuccess}\n className=\"w-full max-w-[400px]\"\n {...form}\n >\n <Form.Input\n name=\"key\"\n label={keyInput.label}\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 projects?.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 {projects?.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=\"ml-auto mt-12\"\n type=\"submit\"\n color=\"text\"\n isLoading={isSubmitting}\n label={createDictionaryButton.ariaLabel.value}\n >\n {createDictionaryButton.text}\n </Form.Button>\n </Form>\n );\n};\n"],"names":["useAuth","useAddDictionary","useGetProjects","getDictionarySchema","useForm","useDictionary","dictionaryFormContent","jsxs","Form","jsx","MultiSelect","project"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAkBO,MAAM,yBAA6B,MAAM;AACxC,QAAA,EAAE,
|
|
1
|
+
{"version":3,"file":"DictionaryCreationForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.tsx"],"sourcesContent":["'use client';\n\nimport { type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport {\n useAddDictionary,\n useGetProjects,\n} from '../../../hooks/intlayerAPIHooks';\nimport { useAuth } from '../../Auth';\nimport { Form, useForm } from '../../Form';\nimport { MultiSelect } from '../../Select';\nimport { dictionaryFormContent } from './dictionaryCreationForm.content';\nimport {\n getDictionarySchema,\n type DictionaryFormData,\n} from './dictionaryFormSchema';\n\nexport const DictionaryCreationForm: FC = () => {\n const { session } = useAuth();\n const { project } = session ?? {};\n const { addDictionary } = useAddDictionary();\n const { data: projects } = useGetProjects();\n const DictionarySchema = getDictionarySchema(String(project?._id));\n const { form, isSubmitting } = useForm(DictionarySchema);\n const { keyInput, createDictionaryButton, projectInput } = useDictionary(\n dictionaryFormContent\n );\n\n const onSubmitSuccess = async (data: DictionaryFormData) => {\n await addDictionary(data);\n };\n\n return (\n <Form\n schema={DictionarySchema}\n onSubmitSuccess={onSubmitSuccess}\n className=\"w-full max-w-[400px]\"\n {...form}\n >\n <Form.Input\n name=\"key\"\n label={keyInput.label}\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 projects?.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 {projects?.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=\"ml-auto mt-12\"\n type=\"submit\"\n color=\"text\"\n isLoading={isSubmitting}\n label={createDictionaryButton.ariaLabel.value}\n >\n {createDictionaryButton.text}\n </Form.Button>\n </Form>\n );\n};\n"],"names":["useAuth","useAddDictionary","useGetProjects","getDictionarySchema","useForm","useDictionary","dictionaryFormContent","jsxs","Form","jsx","MultiSelect","project"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAkBO,MAAM,yBAA6B,MAAM;AACxC,QAAA,EAAE,QAAQ,IAAIA,sCAAQ;AAC5B,QAAM,EAAE,YAAY,WAAW,CAAC;AAC1B,QAAA,EAAE,cAAc,IAAIC,wCAAiB;AAC3C,QAAM,EAAE,MAAM,SAAS,IAAIC,sCAAe;AAC1C,QAAM,mBAAmBC,6EAAA,oBAAoB,OAAO,SAAS,GAAG,CAAC;AACjE,QAAM,EAAE,MAAM,iBAAiBC,yBAAAA,QAAQ,gBAAgB;AACvD,QAAM,EAAE,UAAU,wBAAwB,aAAiB,IAAAC,cAAA;AAAA,IACzDC,uFAAAA;AAAAA,EACF;AAEM,QAAA,kBAAkB,OAAO,SAA6B;AAC1D,UAAM,cAAc,IAAI;AAAA,EAC1B;AAGE,SAAAC,2BAAA,kBAAA;AAAA,IAACC,sCAAA;AAAA,IAAA;AAAA,MACC,QAAQ;AAAA,MACR;AAAA,MACA,WAAU;AAAA,MACT,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAAC,2BAAA,kBAAA;AAAA,UAACD,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,SAAS;AAAA,YAChB,aAAa,SAAS,YAAY;AAAA,YAClC,YAAU;AAAA,UAAA;AAAA,QACZ;AAAA,QAEAD,2BAAAA,kBAAAA,KAACC,2CAAK,aAAL,EAAiB,MAAK,cAAa,OAAO,aAAa,MAAM,OAC5D,UAAA;AAAA,UAAAC,2BAAA,kBAAA;AAAA,YAACC,8BAAAA,YAAY;AAAA,YAAZ;AAAA,cACC,eAAe,CAAC,UACd,UAAU,MAAM,KAAK,CAACC,aAAY,OAAOA,SAAQ,GAAG,MAAM,KAAK,GAC3D,QAAQ;AAAA,cAGd,2DAACD,8BAAAA,YAAY,OAAZ,EAAkB,aAAa,aAAa,YAAY,MAAO,CAAA;AAAA,YAAA;AAAA,UAClE;AAAA,UACCD,2BAAAA,kBAAAA,IAAAC,8BAAAA,YAAY,SAAZ,EACC,UAACD,2BAAA,kBAAA,IAAAC,8BAAA,YAAY,MAAZ,EACE,UAAU,UAAA,MAAM,IAAI,CAACC,aACpBF,2BAAA,kBAAA;AAAA,YAACC,8BAAAA,YAAY;AAAA,YAAZ;AAAA,cAEC,OAAO,OAAOC,SAAQ,GAAG;AAAA,cAExB,UAAAA,SAAQ;AAAA,YAAA;AAAA,YAHJ,OAAOA,SAAQ,GAAG;AAAA,UAK1B,CAAA,EACH,CAAA,EACF,CAAA;AAAA,QAAA,GACF;AAAA,QAEAF,2BAAA,kBAAA;AAAA,UAACD,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,WAAU;AAAA,YACV,MAAK;AAAA,YACL,OAAM;AAAA,YACN,WAAW;AAAA,YACX,OAAO,uBAAuB,UAAU;AAAA,YAEvC,UAAuB,uBAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAC1B;AAAA,IAAA;AAAA,EACF;AAEJ;;"}
|
package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionaryCreationForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.tsx"],"sourcesContent":["'use client';\n\nimport { type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport {\n useAddDictionary,\n useGetProjects,\n} from '../../../hooks/intlayerAPIHooks';\nimport { useAuth } from '../../Auth';\nimport { Form, useForm } from '../../Form';\nimport { MultiSelect } from '../../Select';\nimport { dictionaryFormContent } from './dictionaryCreationForm.content';\nimport {\n getDictionarySchema,\n type DictionaryFormData,\n} from './dictionaryFormSchema';\n\nexport const DictionaryCreationForm: FC = () => {\n const { session } = useAuth();\n const { project } = session ?? {};\n const { addDictionary } = useAddDictionary();\n const { data: projects } = useGetProjects();\n const DictionarySchema = getDictionarySchema(String(project?._id));\n const { form, isSubmitting } = useForm(DictionarySchema);\n const { keyInput, createDictionaryButton, projectInput } = useDictionary(\n dictionaryFormContent\n );\n\n const onSubmitSuccess = async (data: DictionaryFormData) => {\n await addDictionary(data);\n };\n\n return (\n <Form\n schema={DictionarySchema}\n onSubmitSuccess={onSubmitSuccess}\n className=\"w-full max-w-[400px]\"\n {...form}\n >\n <Form.Input\n name=\"key\"\n label={keyInput.label}\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 projects?.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 {projects?.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=\"ml-auto mt-12\"\n type=\"submit\"\n color=\"text\"\n isLoading={isSubmitting}\n label={createDictionaryButton.ariaLabel.value}\n >\n {createDictionaryButton.text}\n </Form.Button>\n </Form>\n );\n};\n"],"names":["jsxs","jsx","project"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAkBO,MAAM,yBAA6B,MAAM;AACxC,QAAA,EAAE,
|
|
1
|
+
{"version":3,"file":"DictionaryCreationForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.tsx"],"sourcesContent":["'use client';\n\nimport { type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport {\n useAddDictionary,\n useGetProjects,\n} from '../../../hooks/intlayerAPIHooks';\nimport { useAuth } from '../../Auth';\nimport { Form, useForm } from '../../Form';\nimport { MultiSelect } from '../../Select';\nimport { dictionaryFormContent } from './dictionaryCreationForm.content';\nimport {\n getDictionarySchema,\n type DictionaryFormData,\n} from './dictionaryFormSchema';\n\nexport const DictionaryCreationForm: FC = () => {\n const { session } = useAuth();\n const { project } = session ?? {};\n const { addDictionary } = useAddDictionary();\n const { data: projects } = useGetProjects();\n const DictionarySchema = getDictionarySchema(String(project?._id));\n const { form, isSubmitting } = useForm(DictionarySchema);\n const { keyInput, createDictionaryButton, projectInput } = useDictionary(\n dictionaryFormContent\n );\n\n const onSubmitSuccess = async (data: DictionaryFormData) => {\n await addDictionary(data);\n };\n\n return (\n <Form\n schema={DictionarySchema}\n onSubmitSuccess={onSubmitSuccess}\n className=\"w-full max-w-[400px]\"\n {...form}\n >\n <Form.Input\n name=\"key\"\n label={keyInput.label}\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 projects?.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 {projects?.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=\"ml-auto mt-12\"\n type=\"submit\"\n color=\"text\"\n isLoading={isSubmitting}\n label={createDictionaryButton.ariaLabel.value}\n >\n {createDictionaryButton.text}\n </Form.Button>\n </Form>\n );\n};\n"],"names":["jsxs","jsx","project"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAkBO,MAAM,yBAA6B,MAAM;AACxC,QAAA,EAAE,QAAQ,IAAI,QAAQ;AAC5B,QAAM,EAAE,YAAY,WAAW,CAAC;AAC1B,QAAA,EAAE,cAAc,IAAI,iBAAiB;AAC3C,QAAM,EAAE,MAAM,SAAS,IAAI,eAAe;AAC1C,QAAM,mBAAmB,oBAAoB,OAAO,SAAS,GAAG,CAAC;AACjE,QAAM,EAAE,MAAM,iBAAiB,QAAQ,gBAAgB;AACvD,QAAM,EAAE,UAAU,wBAAwB,aAAiB,IAAA;AAAA,IACzD;AAAA,EACF;AAEM,QAAA,kBAAkB,OAAO,SAA6B;AAC1D,UAAM,cAAc,IAAI;AAAA,EAC1B;AAGE,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,QAAQ;AAAA,MACR;AAAA,MACA,WAAU;AAAA,MACT,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAAC,kCAAA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,SAAS;AAAA,YAChB,aAAa,SAAS,YAAY;AAAA,YAClC,YAAU;AAAA,UAAA;AAAA,QACZ;AAAA,QAEAD,kCAAAA,KAAC,KAAK,aAAL,EAAiB,MAAK,cAAa,OAAO,aAAa,MAAM,OAC5D,UAAA;AAAA,UAAAC,kCAAA;AAAA,YAAC,YAAY;AAAA,YAAZ;AAAA,cACC,eAAe,CAAC,UACd,UAAU,MAAM,KAAK,CAACC,aAAY,OAAOA,SAAQ,GAAG,MAAM,KAAK,GAC3D,QAAQ;AAAA,cAGd,gDAAC,YAAY,OAAZ,EAAkB,aAAa,aAAa,YAAY,MAAO,CAAA;AAAA,YAAA;AAAA,UAClE;AAAA,UACCD,kCAAAA,IAAA,YAAY,SAAZ,EACC,UAACA,kCAAA,IAAA,YAAY,MAAZ,EACE,UAAU,UAAA,MAAM,IAAI,CAACC,aACpBD,kCAAA;AAAA,YAAC,YAAY;AAAA,YAAZ;AAAA,cAEC,OAAO,OAAOC,SAAQ,GAAG;AAAA,cAExB,UAAAA,SAAQ;AAAA,YAAA;AAAA,YAHJ,OAAOA,SAAQ,GAAG;AAAA,UAK1B,CAAA,EACH,CAAA,EACF,CAAA;AAAA,QAAA,GACF;AAAA,QAEAD,kCAAA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,WAAU;AAAA,YACV,MAAK;AAAA,YACL,OAAM;AAAA,YACN,WAAW;AAAA,YACX,OAAO,uBAAuB,UAAU;AAAA,YAEvC,UAAuB,uBAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAC1B;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionaryCreationForm.content.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.ts"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const dictionaryFormContent = {\n key: 'dictionary-form',\n content: {\n keyInput: {\n label: t({\n en: 'Key',\n fr: 'Clé',\n es: 'Clave',\n }),\n placeholder: t({\n en: 'Enter the key of your dictionary',\n fr: 'Entrez la clée de votre dictionaire',\n es: 'Ingrese el clave de su diccionario',\n }),\n },\n\n projectInput: {\n label: t({\n en: 'Projects',\n fr: 'Projets',\n es: 'Proyectos',\n }),\n placeholder: t({\n en: '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 }),\n },\n\n noDictionaryView: {\n title: t({\n en: 'No dictionary',\n fr: 'Aucune dictionaire',\n es: 'Sin diccionario',\n }),\n description: t({\n en: 'Create your first dictionary to start using Intlayer',\n fr: 'Créez votre première dictionaire pour commencer à utiliser Intlayer',\n es: 'Cree su primera diccionario para comenzar a usar Intlayer',\n }),\n },\n\n dictionaryList: {\n title: t({\n en: 'Dictionary list',\n fr: 'Liste des dictionnaires',\n es: 'Lista de diccionarios',\n }),\n },\n\n createDictionaryTitle: t({\n en: 'No dictionary',\n fr: 'Aucune dictionaire',\n es: 'Sin diccionario',\n }),\n\n createDictionaryDescription: t({\n en: 'Create your first dictionary to start using Intlayer',\n fr: 'Créez votre première dictionaire pour commencer à utiliser Intlayer',\n es: 'Cree su primera diccionario para comenzar a usar Intlayer',\n }),\n\n createDictionaryButton: {\n text: t({\n en: 'Create dictionary',\n fr: 'Créer un dictionair',\n es: 'Crear un diccionario',\n }),\n ariaLabel: t({\n en: 'Click to create dictionary',\n fr: 'Cliquez pour créer un dictionair',\n es: 'Haga clic para crear un diccionario',\n }),\n },\n\n editButton: {\n text: t({\n en: 'Edit dictionary',\n fr: \"Modifier l'dictionaire\",\n es: 'Editar la diccionario',\n }),\n ariaLabel: t({\n en: 'Click to edit',\n fr: 'Cliquez pour modifier',\n es: 'Haga clic para editar',\n }),\n },\n },\n} satisfies DeclarationContent;\n"],"names":["t"],"mappings":";;;AAEO,MAAM,wBAAwB;AAAA,EACnC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,UAAU;AAAA,MACR,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,aAAaA,SAAAA,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,
|
|
1
|
+
{"version":3,"file":"dictionaryCreationForm.content.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.ts"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const dictionaryFormContent = {\n key: 'dictionary-form',\n content: {\n keyInput: {\n label: t({\n en: 'Key',\n fr: 'Clé',\n es: 'Clave',\n }),\n placeholder: t({\n en: 'Enter the key of your dictionary',\n fr: 'Entrez la clée de votre dictionaire',\n es: 'Ingrese el clave de su diccionario',\n }),\n },\n\n projectInput: {\n label: t({\n en: 'Projects',\n fr: 'Projets',\n es: 'Proyectos',\n }),\n placeholder: t({\n en: '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 }),\n },\n\n noDictionaryView: {\n title: t({\n en: 'No dictionary',\n fr: 'Aucune dictionaire',\n es: 'Sin diccionario',\n }),\n description: t({\n en: 'Create your first dictionary to start using Intlayer',\n fr: 'Créez votre première dictionaire pour commencer à utiliser Intlayer',\n es: 'Cree su primera diccionario para comenzar a usar Intlayer',\n }),\n },\n\n dictionaryList: {\n title: t({\n en: 'Dictionary list',\n fr: 'Liste des dictionnaires',\n es: 'Lista de diccionarios',\n }),\n },\n\n createDictionaryTitle: t({\n en: 'No dictionary',\n fr: 'Aucune dictionaire',\n es: 'Sin diccionario',\n }),\n\n createDictionaryDescription: t({\n en: 'Create your first dictionary to start using Intlayer',\n fr: 'Créez votre première dictionaire pour commencer à utiliser Intlayer',\n es: 'Cree su primera diccionario para comenzar a usar Intlayer',\n }),\n\n createDictionaryButton: {\n text: t({\n en: 'Create dictionary',\n fr: 'Créer un dictionair',\n es: 'Crear un diccionario',\n }),\n ariaLabel: t({\n en: 'Click to create dictionary',\n fr: 'Cliquez pour créer un dictionair',\n es: 'Haga clic para crear un diccionario',\n }),\n },\n\n editButton: {\n text: t({\n en: 'Edit dictionary',\n fr: \"Modifier l'dictionaire\",\n es: 'Editar la diccionario',\n }),\n ariaLabel: t({\n en: 'Click to edit',\n fr: 'Cliquez pour modifier',\n es: 'Haga clic para editar',\n }),\n },\n },\n} satisfies DeclarationContent;\n"],"names":["t"],"mappings":";;;AAEO,MAAM,wBAAwB;AAAA,EACnC,KAAK;AAAA,EACL,SAAS;AAA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ACJ,IAAI;AAAA,MACL,CAAA;AAAA,IACH;AAAA,IAEA,YAAY;AAAA,MACV,MAAMA,SAAAA,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,WAAWA,SAAAA,EAAE;AAAA,QACX,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IAAA;AAAA,EACH;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionaryCreationForm.content.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.ts"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const dictionaryFormContent = {\n key: 'dictionary-form',\n content: {\n keyInput: {\n label: t({\n en: 'Key',\n fr: 'Clé',\n es: 'Clave',\n }),\n placeholder: t({\n en: 'Enter the key of your dictionary',\n fr: 'Entrez la clée de votre dictionaire',\n es: 'Ingrese el clave de su diccionario',\n }),\n },\n\n projectInput: {\n label: t({\n en: 'Projects',\n fr: 'Projets',\n es: 'Proyectos',\n }),\n placeholder: t({\n en: '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 }),\n },\n\n noDictionaryView: {\n title: t({\n en: 'No dictionary',\n fr: 'Aucune dictionaire',\n es: 'Sin diccionario',\n }),\n description: t({\n en: 'Create your first dictionary to start using Intlayer',\n fr: 'Créez votre première dictionaire pour commencer à utiliser Intlayer',\n es: 'Cree su primera diccionario para comenzar a usar Intlayer',\n }),\n },\n\n dictionaryList: {\n title: t({\n en: 'Dictionary list',\n fr: 'Liste des dictionnaires',\n es: 'Lista de diccionarios',\n }),\n },\n\n createDictionaryTitle: t({\n en: 'No dictionary',\n fr: 'Aucune dictionaire',\n es: 'Sin diccionario',\n }),\n\n createDictionaryDescription: t({\n en: 'Create your first dictionary to start using Intlayer',\n fr: 'Créez votre première dictionaire pour commencer à utiliser Intlayer',\n es: 'Cree su primera diccionario para comenzar a usar Intlayer',\n }),\n\n createDictionaryButton: {\n text: t({\n en: 'Create dictionary',\n fr: 'Créer un dictionair',\n es: 'Crear un diccionario',\n }),\n ariaLabel: t({\n en: 'Click to create dictionary',\n fr: 'Cliquez pour créer un dictionair',\n es: 'Haga clic para crear un diccionario',\n }),\n },\n\n editButton: {\n text: t({\n en: 'Edit dictionary',\n fr: \"Modifier l'dictionaire\",\n es: 'Editar la diccionario',\n }),\n ariaLabel: t({\n en: 'Click to edit',\n fr: 'Cliquez pour modifier',\n es: 'Haga clic para editar',\n }),\n },\n },\n} satisfies DeclarationContent;\n"],"names":[],"mappings":";AAEO,MAAM,wBAAwB;AAAA,EACnC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,UAAU;AAAA,MACR,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,aAAa,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,
|
|
1
|
+
{"version":3,"file":"dictionaryCreationForm.content.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.ts"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const dictionaryFormContent = {\n key: 'dictionary-form',\n content: {\n keyInput: {\n label: t({\n en: 'Key',\n fr: 'Clé',\n es: 'Clave',\n }),\n placeholder: t({\n en: 'Enter the key of your dictionary',\n fr: 'Entrez la clée de votre dictionaire',\n es: 'Ingrese el clave de su diccionario',\n }),\n },\n\n projectInput: {\n label: t({\n en: 'Projects',\n fr: 'Projets',\n es: 'Proyectos',\n }),\n placeholder: t({\n en: '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 }),\n },\n\n noDictionaryView: {\n title: t({\n en: 'No dictionary',\n fr: 'Aucune dictionaire',\n es: 'Sin diccionario',\n }),\n description: t({\n en: 'Create your first dictionary to start using Intlayer',\n fr: 'Créez votre première dictionaire pour commencer à utiliser Intlayer',\n es: 'Cree su primera diccionario para comenzar a usar Intlayer',\n }),\n },\n\n dictionaryList: {\n title: t({\n en: 'Dictionary list',\n fr: 'Liste des dictionnaires',\n es: 'Lista de diccionarios',\n }),\n },\n\n createDictionaryTitle: t({\n en: 'No dictionary',\n fr: 'Aucune dictionaire',\n es: 'Sin diccionario',\n }),\n\n createDictionaryDescription: t({\n en: 'Create your first dictionary to start using Intlayer',\n fr: 'Créez votre première dictionaire pour commencer à utiliser Intlayer',\n es: 'Cree su primera diccionario para comenzar a usar Intlayer',\n }),\n\n createDictionaryButton: {\n text: t({\n en: 'Create dictionary',\n fr: 'Créer un dictionair',\n es: 'Crear un diccionario',\n }),\n ariaLabel: t({\n en: 'Click to create dictionary',\n fr: 'Cliquez pour créer un dictionair',\n es: 'Haga clic para crear un diccionario',\n }),\n },\n\n editButton: {\n text: t({\n en: 'Edit dictionary',\n fr: \"Modifier l'dictionaire\",\n es: 'Editar la diccionario',\n }),\n ariaLabel: t({\n en: 'Click to edit',\n fr: 'Cliquez pour modifier',\n es: 'Haga clic para editar',\n }),\n },\n },\n} satisfies DeclarationContent;\n"],"names":[],"mappings":";AAEO,MAAM,wBAAwB;AAAA,EACnC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,UAAU;AAAA,MACR,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,aAAa,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IACH;AAAA,IAEA,cAAc;AAAA,MACZ,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QAC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ionaryFormSchema.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryFormSchema.ts"],"sourcesContent":["// @ts-ignore react-intlayer not build yet\nimport { t } from 'react-intlayer';\nimport { z } from 'zod';\n\nexport const getDictionarySchema = (projectId: string) => {\n const requiredErrorName = t({\n en: 'Please enter a key for your dictionary',\n fr: 'Veuillez saisir une clef pour votre dictionaire',\n es: 'Por favor, ingrese un clave para su diccionario',\n });\n\n const invalidTypeErrorName = t({\n en: 'Please enter a valid key for your dictionary',\n fr: 'Veuillez saisir une clée valide pour votre dictionaire',\n es: 'Por favor, ingrese un clave válido para su diccionario',\n });\n\n const requiredErrorProjectId = t({\n en: 'Please select a project',\n fr: 'Veuillez sélectionner un projet',\n es: 'Por favor, seleccione un proyecto',\n });\n\n const invalidTypeErrorProjectId = t({\n en: 'Please select a valid project',\n fr: 'Veuillez sélectionner un projet valide',\n es: 'Por favor, seleccione un proyecto válido',\n });\n\n return z.object({\n key: z\n .string({\n required_error: requiredErrorName,\n invalid_type_error: invalidTypeErrorName,\n })\n .min(1, { message: invalidTypeErrorName })\n .default(''),\n projectIds: z\n .array(\n z.string({\n required_error: requiredErrorProjectId,\n invalid_type_error: invalidTypeErrorProjectId,\n })\n )\n .default([projectId]),\n });\n};\n\nexport type DictionaryFormData = z.infer<\n ReturnType<typeof getDictionarySchema>\n>;\n"],"names":["t","z"],"mappings":";;;;AAIa,MAAA,sBAAsB,CAAC,cAAsB;AACxD,QAAM,oBAAoBA,cAAAA,EAAE;AAAA,IAC1B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,uBAAuBA,cAAAA,EAAE;AAAA,IAC7B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,yBAAyBA,cAAAA,EAAE;AAAA,IAC/B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,4BAA4BA,cAAAA,EAAE;AAAA,IAClC,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,SAAOC,IAAAA,EAAE,OAAO;AAAA,IACd,KAAKA,MACF,OAAO;AAAA,MACN,gBAAgB;AAAA,MAChB,oBAAoB;AAAA,IAAA,CACrB,EACA,IAAI,GAAG,EAAE,SAAS,sBAAsB,EACxC,QAAQ,EAAE;AAAA,IACb,YAAYA,IACT,EAAA;AAAA,MACCA,IAAAA,EAAE,OAAO;AAAA,QACP,gBAAgB;AAAA,QAChB,oBAAoB;AAAA,
|
|
1
|
+
{"version":3,"file":"dictionaryFormSchema.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryFormSchema.ts"],"sourcesContent":["// @ts-ignore react-intlayer not build yet\nimport { t } from 'react-intlayer';\nimport { z } from 'zod';\n\nexport const getDictionarySchema = (projectId: string) => {\n const requiredErrorName = t({\n en: 'Please enter a key for your dictionary',\n fr: 'Veuillez saisir une clef pour votre dictionaire',\n es: 'Por favor, ingrese un clave para su diccionario',\n });\n\n const invalidTypeErrorName = t({\n en: 'Please enter a valid key for your dictionary',\n fr: 'Veuillez saisir une clée valide pour votre dictionaire',\n es: 'Por favor, ingrese un clave válido para su diccionario',\n });\n\n const requiredErrorProjectId = t({\n en: 'Please select a project',\n fr: 'Veuillez sélectionner un projet',\n es: 'Por favor, seleccione un proyecto',\n });\n\n const invalidTypeErrorProjectId = t({\n en: 'Please select a valid project',\n fr: 'Veuillez sélectionner un projet valide',\n es: 'Por favor, seleccione un proyecto válido',\n });\n\n return z.object({\n key: z\n .string({\n required_error: requiredErrorName,\n invalid_type_error: invalidTypeErrorName,\n })\n .min(1, { message: invalidTypeErrorName })\n .default(''),\n projectIds: z\n .array(\n z.string({\n required_error: requiredErrorProjectId,\n invalid_type_error: invalidTypeErrorProjectId,\n })\n )\n .default([projectId]),\n });\n};\n\nexport type DictionaryFormData = z.infer<\n ReturnType<typeof getDictionarySchema>\n>;\n"],"names":["t","z"],"mappings":";;;;AAIa,MAAA,sBAAsB,CAAC,cAAsB;AACxD,QAAM,oBAAoBA,cAAAA,EAAE;AAAA,IAC1B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,uBAAuBA,cAAAA,EAAE;AAAA,IAC7B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,yBAAyBA,cAAAA,EAAE;AAAA,IAC/B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,4BAA4BA,cAAAA,EAAE;AAAA,IAClC,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,SAAOC,IAAAA,EAAE,OAAO;AAAA,IACd,KAAKA,MACF,OAAO;AAAA,MACN,gBAAgB;AAAA,MAChB,oBAAoB;AAAA,IAAA,CACrB,EACA,IAAI,GAAG,EAAE,SAAS,sBAAsB,EACxC,QAAQ,EAAE;AAAA,IACb,YAAYA,IACT,EAAA;AAAA,MACCA,IAAAA,EAAE,OAAO;AAAA,QACP,gBAAgB;AAAA,QAChB,oBAAoB;AAAA,MACrB,CAAA;AAAA,IAAA,EAEF,QAAQ,CAAC,SAAS,CAAC;AAAA,EAAA,CACvB;AACH;;"}
|
package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryFormSchema.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionaryFormSchema.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryFormSchema.ts"],"sourcesContent":["// @ts-ignore react-intlayer not build yet\nimport { t } from 'react-intlayer';\nimport { z } from 'zod';\n\nexport const getDictionarySchema = (projectId: string) => {\n const requiredErrorName = t({\n en: 'Please enter a key for your dictionary',\n fr: 'Veuillez saisir une clef pour votre dictionaire',\n es: 'Por favor, ingrese un clave para su diccionario',\n });\n\n const invalidTypeErrorName = t({\n en: 'Please enter a valid key for your dictionary',\n fr: 'Veuillez saisir une clée valide pour votre dictionaire',\n es: 'Por favor, ingrese un clave válido para su diccionario',\n });\n\n const requiredErrorProjectId = t({\n en: 'Please select a project',\n fr: 'Veuillez sélectionner un projet',\n es: 'Por favor, seleccione un proyecto',\n });\n\n const invalidTypeErrorProjectId = t({\n en: 'Please select a valid project',\n fr: 'Veuillez sélectionner un projet valide',\n es: 'Por favor, seleccione un proyecto válido',\n });\n\n return z.object({\n key: z\n .string({\n required_error: requiredErrorName,\n invalid_type_error: invalidTypeErrorName,\n })\n .min(1, { message: invalidTypeErrorName })\n .default(''),\n projectIds: z\n .array(\n z.string({\n required_error: requiredErrorProjectId,\n invalid_type_error: invalidTypeErrorProjectId,\n })\n )\n .default([projectId]),\n });\n};\n\nexport type DictionaryFormData = z.infer<\n ReturnType<typeof getDictionarySchema>\n>;\n"],"names":[],"mappings":";;AAIa,MAAA,sBAAsB,CAAC,cAAsB;AACxD,QAAM,oBAAoB,EAAE;AAAA,IAC1B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,uBAAuB,EAAE;AAAA,IAC7B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,yBAAyB,EAAE;AAAA,IAC/B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,4BAA4B,EAAE;AAAA,IAClC,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,SAAO,EAAE,OAAO;AAAA,IACd,KAAK,EACF,OAAO;AAAA,MACN,gBAAgB;AAAA,MAChB,oBAAoB;AAAA,IAAA,CACrB,EACA,IAAI,GAAG,EAAE,SAAS,sBAAsB,EACxC,QAAQ,EAAE;AAAA,IACb,YAAY,EACT;AAAA,MACC,EAAE,OAAO;AAAA,QACP,gBAAgB;AAAA,QAChB,oBAAoB;AAAA,
|
|
1
|
+
{"version":3,"file":"dictionaryFormSchema.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryFormSchema.ts"],"sourcesContent":["// @ts-ignore react-intlayer not build yet\nimport { t } from 'react-intlayer';\nimport { z } from 'zod';\n\nexport const getDictionarySchema = (projectId: string) => {\n const requiredErrorName = t({\n en: 'Please enter a key for your dictionary',\n fr: 'Veuillez saisir une clef pour votre dictionaire',\n es: 'Por favor, ingrese un clave para su diccionario',\n });\n\n const invalidTypeErrorName = t({\n en: 'Please enter a valid key for your dictionary',\n fr: 'Veuillez saisir une clée valide pour votre dictionaire',\n es: 'Por favor, ingrese un clave válido para su diccionario',\n });\n\n const requiredErrorProjectId = t({\n en: 'Please select a project',\n fr: 'Veuillez sélectionner un projet',\n es: 'Por favor, seleccione un proyecto',\n });\n\n const invalidTypeErrorProjectId = t({\n en: 'Please select a valid project',\n fr: 'Veuillez sélectionner un projet valide',\n es: 'Por favor, seleccione un proyecto válido',\n });\n\n return z.object({\n key: z\n .string({\n required_error: requiredErrorName,\n invalid_type_error: invalidTypeErrorName,\n })\n .min(1, { message: invalidTypeErrorName })\n .default(''),\n projectIds: z\n .array(\n z.string({\n required_error: requiredErrorProjectId,\n invalid_type_error: invalidTypeErrorProjectId,\n })\n )\n .default([projectId]),\n });\n};\n\nexport type DictionaryFormData = z.infer<\n ReturnType<typeof getDictionarySchema>\n>;\n"],"names":[],"mappings":";;AAIa,MAAA,sBAAsB,CAAC,cAAsB;AACxD,QAAM,oBAAoB,EAAE;AAAA,IAC1B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,uBAAuB,EAAE;AAAA,IAC7B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,yBAAyB,EAAE;AAAA,IAC/B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,4BAA4B,EAAE;AAAA,IAClC,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,SAAO,EAAE,OAAO;AAAA,IACd,KAAK,EACF,OAAO;AAAA,MACN,gBAAgB;AAAA,MAChB,oBAAoB;AAAA,IAAA,CACrB,EACA,IAAI,GAAG,EAAE,SAAS,sBAAsB,EACxC,QAAQ,EAAE;AAAA,IACb,YAAY,EACT;AAAA,MACC,EAAE,OAAO;AAAA,QACP,gBAAgB;AAAA,QAChB,oBAAoB;AAAA,MACrB,CAAA;AAAA,IAAA,EAEF,QAAQ,CAAC,SAAS,CAAC;AAAA,EAAA,CACvB;AACH;"}
|
package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionaryDetailsForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowUpFromLine, Save } from 'lucide-react';\nimport { type FC, useEffect } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useGetProjects, usePushDictionaries } from '../../../hooks';\nimport { cn } from '../../../utils/cn';\nimport { useAuth } from '../../Auth';\nimport { Form, useForm } from '../../Form';\nimport { MultiSelect } from '../../Select';\nimport { dictionaryDetailsContent } from './dictionaryDetails.content';\nimport {\n getDictionaryDetailsSchema,\n DictionaryDetailsFormData,\n} from './DictionaryDetailsSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n};\n\nexport const DictionaryDetailsForm: FC<DictionaryDetailsProps> = ({\n dictionary,\n}) => {\n const { session } = useAuth();\n const { project } = session ?? {};\n const { pushDictionaries } = usePushDictionaries();\n const { data: projects } = useGetProjects();\n\n const DictionaryDetailsSchema = getDictionaryDetailsSchema(\n String(project?._id)\n );\n const { form, isSubmitting } = useForm(DictionaryDetailsSchema, {\n defaultValues: dictionary,\n });\n const {\n titleInput,\n keyInput,\n descriptionInput,\n publishButton,\n saveButton,\n projectInput,\n } = useDictionary(dictionaryDetailsContent);\n\n useEffect(() => {\n form.reset(dictionary);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [dictionary, form?.reset]);\n\n const isFormEdited = form.formState.isDirty;\n const isLocalDictionary =\n typeof (dictionary as DistantDictionary)?._id === 'undefined';\n\n const onSubmitSuccess = async (data: DictionaryDetailsFormData) => {\n await pushDictionaries([\n {\n ...dictionary,\n ...data,\n },\n ]);\n };\n\n return (\n <Form\n className=\"flex size-full flex-1 flex-col gap-8\"\n {...form}\n schema={DictionaryDetailsSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n <div className=\"flex size-full flex-1 gap-8 max-md:flex-col\">\n <Form.EditableFieldInput\n name=\"title\"\n label={titleInput.label.value}\n placeholder={titleInput.placeholder.value}\n description={titleInput.description.value}\n disabled={isSubmitting}\n />\n <Form.EditableFieldInput\n name=\"key\"\n label={keyInput.label.value}\n placeholder={keyInput.label.value}\n description={keyInput.description.value}\n disabled={isSubmitting}\n required\n />\n </div>\n\n <Form.EditableFieldTextArea\n name=\"description\"\n label={descriptionInput.label.value}\n placeholder={descriptionInput.placeholder.value}\n description={descriptionInput.description.value}\n disabled={isSubmitting}\n />\n\n <Form.MultiSelect\n name=\"projectIds\"\n label={projectInput.label.value}\n description={projectInput.description.value}\n >\n <MultiSelect.Trigger\n getBadgeValue={(value) =>\n projects?.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 {projects?.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 {isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label.value}\n disabled={isSubmitting || !isFormEdited}\n Icon={ArrowUpFromLine}\n isFullWidth={false}\n color=\"text\"\n isLoading={isSubmitting}\n className=\"ml-auto\"\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n <Form.Button\n type=\"submit\"\n label={saveButton.label.value}\n disabled={isSubmitting}\n isFullWidth={false}\n className={cn('ml-auto', isFormEdited ? '' : 'invisible')}\n Icon={Save}\n color=\"text\"\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )}\n </Form>\n );\n};\n"],"names":["useAuth","usePushDictionaries","useGetProjects","getDictionaryDetailsSchema","useForm","useDictionary","dictionaryDetailsContent","useEffect","jsxs","Form","jsx","MultiSelect","project","ArrowUpFromLine","cn","Save"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAuBO,MAAM,wBAAoD,CAAC;AAAA,EAChE;AACF,MAAM;AACE,QAAA,EAAE,
|
|
1
|
+
{"version":3,"file":"DictionaryDetailsForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowUpFromLine, Save } from 'lucide-react';\nimport { type FC, useEffect } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useGetProjects, usePushDictionaries } from '../../../hooks';\nimport { cn } from '../../../utils/cn';\nimport { useAuth } from '../../Auth';\nimport { Form, useForm } from '../../Form';\nimport { MultiSelect } from '../../Select';\nimport { dictionaryDetailsContent } from './dictionaryDetails.content';\nimport {\n getDictionaryDetailsSchema,\n DictionaryDetailsFormData,\n} from './DictionaryDetailsSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n};\n\nexport const DictionaryDetailsForm: FC<DictionaryDetailsProps> = ({\n dictionary,\n}) => {\n const { session } = useAuth();\n const { project } = session ?? {};\n const { pushDictionaries } = usePushDictionaries();\n const { data: projects } = useGetProjects();\n\n const DictionaryDetailsSchema = getDictionaryDetailsSchema(\n String(project?._id)\n );\n const { form, isSubmitting } = useForm(DictionaryDetailsSchema, {\n defaultValues: dictionary,\n });\n const {\n titleInput,\n keyInput,\n descriptionInput,\n publishButton,\n saveButton,\n projectInput,\n } = useDictionary(dictionaryDetailsContent);\n\n useEffect(() => {\n form.reset(dictionary);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [dictionary, form?.reset]);\n\n const isFormEdited = form.formState.isDirty;\n const isLocalDictionary =\n typeof (dictionary as DistantDictionary)?._id === 'undefined';\n\n const onSubmitSuccess = async (data: DictionaryDetailsFormData) => {\n await pushDictionaries([\n {\n ...dictionary,\n ...data,\n },\n ]);\n };\n\n return (\n <Form\n className=\"flex size-full flex-1 flex-col gap-8\"\n {...form}\n schema={DictionaryDetailsSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n <div className=\"flex size-full flex-1 gap-8 max-md:flex-col\">\n <Form.EditableFieldInput\n name=\"title\"\n label={titleInput.label.value}\n placeholder={titleInput.placeholder.value}\n description={titleInput.description.value}\n disabled={isSubmitting}\n />\n <Form.EditableFieldInput\n name=\"key\"\n label={keyInput.label.value}\n placeholder={keyInput.label.value}\n description={keyInput.description.value}\n disabled={isSubmitting}\n required\n />\n </div>\n\n <Form.EditableFieldTextArea\n name=\"description\"\n label={descriptionInput.label.value}\n placeholder={descriptionInput.placeholder.value}\n description={descriptionInput.description.value}\n disabled={isSubmitting}\n />\n\n <Form.MultiSelect\n name=\"projectIds\"\n label={projectInput.label.value}\n description={projectInput.description.value}\n >\n <MultiSelect.Trigger\n getBadgeValue={(value) =>\n projects?.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 {projects?.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 {isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label.value}\n disabled={isSubmitting || !isFormEdited}\n Icon={ArrowUpFromLine}\n isFullWidth={false}\n color=\"text\"\n isLoading={isSubmitting}\n className=\"ml-auto\"\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n <Form.Button\n type=\"submit\"\n label={saveButton.label.value}\n disabled={isSubmitting}\n isFullWidth={false}\n className={cn('ml-auto', isFormEdited ? '' : 'invisible')}\n Icon={Save}\n color=\"text\"\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )}\n </Form>\n );\n};\n"],"names":["useAuth","usePushDictionaries","useGetProjects","getDictionaryDetailsSchema","useForm","useDictionary","dictionaryDetailsContent","useEffect","jsxs","Form","jsx","MultiSelect","project","ArrowUpFromLine","cn","Save"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAuBO,MAAM,wBAAoD,CAAC;AAAA,EAChE;AACF,MAAM;AACE,QAAA,EAAE,QAAQ,IAAIA,sCAAQ;AAC5B,QAAM,EAAE,YAAY,WAAW,CAAC;AAC1B,QAAA,EAAE,iBAAiB,IAAIC,2CAAoB;AACjD,QAAM,EAAE,MAAM,SAAS,IAAIC,sCAAe;AAE1C,QAAM,0BAA0BC,2EAAA;AAAA,IAC9B,OAAO,SAAS,GAAG;AAAA,EACrB;AACA,QAAM,EAAE,MAAM,iBAAiBC,yBAAAA,QAAQ,yBAAyB;AAAA,IAC9D,eAAe;AAAA,EAAA,CAChB;AACK,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACEC,cAAAA,cA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MAAM;AAAA,YACxB,UAAU;AAAA,YACV,aAAa;AAAA,YACb,WAAWK,SAAAA,GAAG,WAAW,eAAe,KAAK,WAAW;AAAA,YACxD,MAAMC,YAAA;AAAA,YACN,OAAM;AAAA,YACN,WAAW;AAAA,YAEV,UAAW,WAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACd;AAAA,IAAA;AAAA,EAEJ;AAEJ;;"}
|
package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionaryDetailsForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowUpFromLine, Save } from 'lucide-react';\nimport { type FC, useEffect } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useGetProjects, usePushDictionaries } from '../../../hooks';\nimport { cn } from '../../../utils/cn';\nimport { useAuth } from '../../Auth';\nimport { Form, useForm } from '../../Form';\nimport { MultiSelect } from '../../Select';\nimport { dictionaryDetailsContent } from './dictionaryDetails.content';\nimport {\n getDictionaryDetailsSchema,\n DictionaryDetailsFormData,\n} from './DictionaryDetailsSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n};\n\nexport const DictionaryDetailsForm: FC<DictionaryDetailsProps> = ({\n dictionary,\n}) => {\n const { session } = useAuth();\n const { project } = session ?? {};\n const { pushDictionaries } = usePushDictionaries();\n const { data: projects } = useGetProjects();\n\n const DictionaryDetailsSchema = getDictionaryDetailsSchema(\n String(project?._id)\n );\n const { form, isSubmitting } = useForm(DictionaryDetailsSchema, {\n defaultValues: dictionary,\n });\n const {\n titleInput,\n keyInput,\n descriptionInput,\n publishButton,\n saveButton,\n projectInput,\n } = useDictionary(dictionaryDetailsContent);\n\n useEffect(() => {\n form.reset(dictionary);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [dictionary, form?.reset]);\n\n const isFormEdited = form.formState.isDirty;\n const isLocalDictionary =\n typeof (dictionary as DistantDictionary)?._id === 'undefined';\n\n const onSubmitSuccess = async (data: DictionaryDetailsFormData) => {\n await pushDictionaries([\n {\n ...dictionary,\n ...data,\n },\n ]);\n };\n\n return (\n <Form\n className=\"flex size-full flex-1 flex-col gap-8\"\n {...form}\n schema={DictionaryDetailsSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n <div className=\"flex size-full flex-1 gap-8 max-md:flex-col\">\n <Form.EditableFieldInput\n name=\"title\"\n label={titleInput.label.value}\n placeholder={titleInput.placeholder.value}\n description={titleInput.description.value}\n disabled={isSubmitting}\n />\n <Form.EditableFieldInput\n name=\"key\"\n label={keyInput.label.value}\n placeholder={keyInput.label.value}\n description={keyInput.description.value}\n disabled={isSubmitting}\n required\n />\n </div>\n\n <Form.EditableFieldTextArea\n name=\"description\"\n label={descriptionInput.label.value}\n placeholder={descriptionInput.placeholder.value}\n description={descriptionInput.description.value}\n disabled={isSubmitting}\n />\n\n <Form.MultiSelect\n name=\"projectIds\"\n label={projectInput.label.value}\n description={projectInput.description.value}\n >\n <MultiSelect.Trigger\n getBadgeValue={(value) =>\n projects?.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 {projects?.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 {isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label.value}\n disabled={isSubmitting || !isFormEdited}\n Icon={ArrowUpFromLine}\n isFullWidth={false}\n color=\"text\"\n isLoading={isSubmitting}\n className=\"ml-auto\"\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n <Form.Button\n type=\"submit\"\n label={saveButton.label.value}\n disabled={isSubmitting}\n isFullWidth={false}\n className={cn('ml-auto', isFormEdited ? '' : 'invisible')}\n Icon={Save}\n color=\"text\"\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )}\n </Form>\n );\n};\n"],"names":["jsxs","jsx","project"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBO,MAAM,wBAAoD,CAAC;AAAA,EAChE;AACF,MAAM;AACE,QAAA,EAAE,
|
|
1
|
+
{"version":3,"file":"DictionaryDetailsForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowUpFromLine, Save } from 'lucide-react';\nimport { type FC, useEffect } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useGetProjects, usePushDictionaries } from '../../../hooks';\nimport { cn } from '../../../utils/cn';\nimport { useAuth } from '../../Auth';\nimport { Form, useForm } from '../../Form';\nimport { MultiSelect } from '../../Select';\nimport { dictionaryDetailsContent } from './dictionaryDetails.content';\nimport {\n getDictionaryDetailsSchema,\n DictionaryDetailsFormData,\n} from './DictionaryDetailsSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n};\n\nexport const DictionaryDetailsForm: FC<DictionaryDetailsProps> = ({\n dictionary,\n}) => {\n const { session } = useAuth();\n const { project } = session ?? {};\n const { pushDictionaries } = usePushDictionaries();\n const { data: projects } = useGetProjects();\n\n const DictionaryDetailsSchema = getDictionaryDetailsSchema(\n String(project?._id)\n );\n const { form, isSubmitting } = useForm(DictionaryDetailsSchema, {\n defaultValues: dictionary,\n });\n const {\n titleInput,\n keyInput,\n descriptionInput,\n publishButton,\n saveButton,\n projectInput,\n } = useDictionary(dictionaryDetailsContent);\n\n useEffect(() => {\n form.reset(dictionary);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [dictionary, form?.reset]);\n\n const isFormEdited = form.formState.isDirty;\n const isLocalDictionary =\n typeof (dictionary as DistantDictionary)?._id === 'undefined';\n\n const onSubmitSuccess = async (data: DictionaryDetailsFormData) => {\n await pushDictionaries([\n {\n ...dictionary,\n ...data,\n },\n ]);\n };\n\n return (\n <Form\n className=\"flex size-full flex-1 flex-col gap-8\"\n {...form}\n schema={DictionaryDetailsSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n <div className=\"flex size-full flex-1 gap-8 max-md:flex-col\">\n <Form.EditableFieldInput\n name=\"title\"\n label={titleInput.label.value}\n placeholder={titleInput.placeholder.value}\n description={titleInput.description.value}\n disabled={isSubmitting}\n />\n <Form.EditableFieldInput\n name=\"key\"\n label={keyInput.label.value}\n placeholder={keyInput.label.value}\n description={keyInput.description.value}\n disabled={isSubmitting}\n required\n />\n </div>\n\n <Form.EditableFieldTextArea\n name=\"description\"\n label={descriptionInput.label.value}\n placeholder={descriptionInput.placeholder.value}\n description={descriptionInput.description.value}\n disabled={isSubmitting}\n />\n\n <Form.MultiSelect\n name=\"projectIds\"\n label={projectInput.label.value}\n description={projectInput.description.value}\n >\n <MultiSelect.Trigger\n getBadgeValue={(value) =>\n projects?.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 {projects?.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 {isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label.value}\n disabled={isSubmitting || !isFormEdited}\n Icon={ArrowUpFromLine}\n isFullWidth={false}\n color=\"text\"\n isLoading={isSubmitting}\n className=\"ml-auto\"\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n <Form.Button\n type=\"submit\"\n label={saveButton.label.value}\n disabled={isSubmitting}\n isFullWidth={false}\n className={cn('ml-auto', isFormEdited ? '' : 'invisible')}\n Icon={Save}\n color=\"text\"\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )}\n </Form>\n );\n};\n"],"names":["jsxs","jsx","project"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBO,MAAM,wBAAoD,CAAC;AAAA,EAChE;AACF,MAAM;AACE,QAAA,EAAE,QAAQ,IAAI,QAAQ;AAC5B,QAAM,EAAE,YAAY,WAAW,CAAC;AAC1B,QAAA,EAAE,iBAAiB,IAAI,oBAAoB;AACjD,QAAM,EAAE,MAAM,SAAS,IAAI,eAAe;AAE1C,QAAM,0BAA0B;AAAA,IAC9B,OAAO,SAAS,GAAG;AAAA,EACrB;AACA,QAAM,EAAE,MAAM,iBAAiB,QAAQ,yBAAyB;AAAA,IAC9D,eAAe;AAAA,EAAA,CAChB;AACK,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACE,cAAc,wBAAwB;AAE1C,YAAU,MAAM;AACd,SAAK,MAAM,UAAU;AAAA,EAEpB,GAAA,CAAC,YAAY,MAAM,KAAK,CAAC;AAEtB,QAAA,eAAe,KAAK,UAAU;AAC9B,QAAA,oBACJ,OAAQ,YAAkC,QAAQ;AAE9C,QAAA,kBAAkB,OAAO,SAAoC;AACjE,UAAM,iBAAiB;AAAA,MACrB;AAAA,QACE,GAAG;AAAA,QACH,GAAG;AAAA,MAAA;AAAA,IACL,CACD;AAAA,EACH;AAGE,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACT,GAAG;AAAA,MACJ,QAAQ;AAAA,MACR;AAAA,MAEA,UAAA;AAAA,QAACA,kCAAAA,KAAA,OAAA,EAA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AEC,OAAO,OAAOC,SAAQ,GAAG;AAAA,kBAExB,UAAAA,SAAQ;AAAA,gBAAA;AAAA,gBAHJ,OAAOA,SAAQ,GAAG;AAAA,cAK1B,CAAA,EACH,CAAA,EACF,CAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,QAEC,oBACCD,kCAAA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,cAAc,MAAM;AAAA,YAC3B,UAAU,gBAAgB,CAAC;AAAA,YAC3B,MAAM;AAAA,YACN,aAAa;AAAA,YACb,OAAM;AAAA,YACN,WAAW;AAAA,YACX,WAAU;AAAA,YAET,UAAc,cAAA;AAAA,UAAA;AAAA,QAAA,IAGjBA,kCAAA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,WAAW,MAAM;AAAA,YACxB,UAAU;AAAA,YACV,aAAa;AAAA,YACb,WAAW,GAAG,WAAW,eAAe,KAAK,WAAW;AAAA,YACxD,MAAM;AAAA,YACN,OAAM;AAAA,YACN,WAAW;AAAA,YAEV,UAAW,WAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACd;AAAA,IAAA;AAAA,EAEJ;AAEJ;"}
|
package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsSchema.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionaryDetailsSchema.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsSchema.ts"],"sourcesContent":["// @ts-ignore react-intlayer not build yet\nimport { t } from 'react-intlayer';\nimport { z } from 'zod';\n\nexport const getDictionaryDetailsSchema = (projectId: string) => {\n // Title Field Error Messages\n const titleRequiredError = t({\n en: 'Please enter a name for your organization.',\n fr: 'Veuillez saisir un nom pour votre organisation.',\n es: 'Por favor, ingrese un nombre para su organización.',\n });\n\n const titleInvalidTypeError = t({\n en: 'The organization name must be a valid string.',\n fr: 'Le nom de votre organisation doit être une chaîne valide.',\n es: 'El nombre de su organización debe ser una cadena válida.',\n });\n\n const titleMinLengthError = t({\n en: 'The organization name must be at least 4 characters long.',\n fr: 'Le nom de votre organisation doit comporter au moins 4 caractères.',\n es: 'El nombre de su organización debe tener al menos 4 caracteres.',\n });\n\n // Key Field Error Messages\n const keyRequiredError = t({\n en: 'Please enter a key for your organization.',\n fr: 'Veuillez saisir une clé pour votre organisation.',\n es: 'Por favor, ingrese una clave para su organización.',\n });\n\n const keyInvalidTypeError = t({\n en: 'The key must be a valid string.',\n fr: 'La clé doit être une chaîne valide.',\n es: 'La clave debe ser una cadena válida.',\n });\n\n const keySpaceError = t({\n en: 'The key cannot contain spaces or special characters.',\n fr: \"La clé ne peut pas contenir d'espaces ou de caractères spéciaux.\",\n es: 'La clave no puede contener espacios o caracteres especiales.',\n });\n\n const keyMinLengthError = t({\n en: 'The key must be at least 4 characters long.',\n fr: 'La clé doit comporter au moins 4 caractères.',\n es: 'La clave debe tener al menos 4 caracteres.',\n });\n\n // Description Field Error Messages\n const descriptionRequiredError = t({\n en: 'Please enter a description for your organization.',\n fr: 'Veuillez saisir une description pour votre organisation.',\n es: 'Por favor, ingrese una descripción para su organización.',\n });\n\n const descriptionInvalidTypeError = t({\n en: 'The description must be a valid string.',\n fr: 'La description doit être une chaîne valide.',\n es: 'La descripción debe ser una cadena válida.',\n });\n\n const requiredErrorProjectId = t({\n en: 'Please select a project',\n fr: 'Veuillez sélectionner un projet',\n es: 'Por favor, seleccione un proyecto',\n });\n\n const invalidTypeErrorProjectId = t({\n en: 'Please select a valid project',\n fr: 'Veuillez sélectionner un projet valide',\n es: 'Por favor, seleccione un proyecto válido',\n });\n\n return z.object({\n title: z\n .string({\n required_error: titleRequiredError,\n invalid_type_error: titleInvalidTypeError,\n })\n // Can be length of 0 or > 4\n .refine((val) => val.length === 0 || val.length >= 4, {\n message: titleMinLengthError,\n })\n .optional(),\n key: z\n .string({\n required_error: keyRequiredError,\n invalid_type_error: keyInvalidTypeError,\n })\n .min(4, { message: keyMinLengthError })\n /**\n * Valid :\n * my-key\n * my_key\n *\n * Invalid :\n * my key\n * my.key\n */\n .regex(/^[a-zA-Z0-9-_]+$/, { message: keySpaceError })\n .default(''),\n description: z\n .string({\n required_error: descriptionRequiredError,\n invalid_type_error: descriptionInvalidTypeError,\n })\n .optional(),\n projectIds: z\n .array(\n z.string({\n required_error: requiredErrorProjectId,\n invalid_type_error: invalidTypeErrorProjectId,\n })\n )\n .default([projectId]),\n });\n};\n\nexport type DictionaryDetailsFormData = z.infer<\n ReturnType<typeof getDictionaryDetailsSchema>\n>;\n"],"names":["t","z"],"mappings":";;;;AAIa,MAAA,6BAA6B,CAAC,cAAsB;AAE/D,QAAM,qBAAqBA,cAAAA,EAAE;AAAA,IAC3B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,wBAAwBA,cAAAA,EAAE;AAAA,IAC9B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,sBAAsBA,cAAAA,EAAE;AAAA,IAC5B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAGD,QAAM,mBAAmBA,cAAAA,EAAE;AAAA,IACzB,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,sBAAsBA,cAAAA,EAAE;AAAA,IAC5B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,gBAAgBA,cAAAA,EAAE;AAAA,IACtB,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,oBAAoBA,cAAAA,EAAE;AAAA,IAC1B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAGD,QAAM,2BAA2BA,cAAAA,EAAE;AAAA,IACjC,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,8BAA8BA,cAAAA,EAAE;AAAA,IACpC,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,yBAAyBA,cAAAA,EAAE;AAAA,IAC/B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,4BAA4BA,cAAAA,EAAE;AAAA,IAClC,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,SAAOC,IAAAA,EAAE,OAAO;AAAA,IACd,OAAOA,MACJ,OAAO;AAAA,MACN,gBAAgB;AAAA,MAChB,oBAAoB;AAAA,IAAA,CACrB,EAEA,OAAO,CAAC,QAAQ,IAAI,WAAW,KAAK,IAAI,UAAU,GAAG;AAAA,MACpD,SAAS;AAAA,IACV,CAAA,EACA,SAAS;AAAA,IACZ,KAAKA,MACF,OAAO;AAAA,MACN,gBAAgB;AAAA,MAChB,oBAAoB;AAAA,IACrB,CAAA,EACA,IAAI,GAAG,EAAE,SAAS,kBAAkB,CAAC,EAUrC,MAAM,oBAAoB,EAAE,SAAS,cAAe,CAAA,EACpD,QAAQ,EAAE;AAAA,IACb,aAAaA,MACV,OAAO;AAAA,MACN,gBAAgB;AAAA,MAChB,oBAAoB;AAAA,IACrB,CAAA,EACA,SAAS;AAAA,IACZ,YAAYA,IACT,EAAA;AAAA,MACCA,IAAAA,EAAE,OAAO;AAAA,QACP,gBAAgB;AAAA,QAChB,oBAAoB;AAAA,
|
|
1
|
+
{"version":3,"file":"DictionaryDetailsSchema.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsSchema.ts"],"sourcesContent":["// @ts-ignore react-intlayer not build yet\nimport { t } from 'react-intlayer';\nimport { z } from 'zod';\n\nexport const getDictionaryDetailsSchema = (projectId: string) => {\n // Title Field Error Messages\n const titleRequiredError = t({\n en: 'Please enter a name for your organization.',\n fr: 'Veuillez saisir un nom pour votre organisation.',\n es: 'Por favor, ingrese un nombre para su organización.',\n });\n\n const titleInvalidTypeError = t({\n en: 'The organization name must be a valid string.',\n fr: 'Le nom de votre organisation doit être une chaîne valide.',\n es: 'El nombre de su organización debe ser una cadena válida.',\n });\n\n const titleMinLengthError = t({\n en: 'The organization name must be at least 4 characters long.',\n fr: 'Le nom de votre organisation doit comporter au moins 4 caractères.',\n es: 'El nombre de su organización debe tener al menos 4 caracteres.',\n });\n\n // Key Field Error Messages\n const keyRequiredError = t({\n en: 'Please enter a key for your organization.',\n fr: 'Veuillez saisir une clé pour votre organisation.',\n es: 'Por favor, ingrese una clave para su organización.',\n });\n\n const keyInvalidTypeError = t({\n en: 'The key must be a valid string.',\n fr: 'La clé doit être une chaîne valide.',\n es: 'La clave debe ser una cadena válida.',\n });\n\n const keySpaceError = t({\n en: 'The key cannot contain spaces or special characters.',\n fr: \"La clé ne peut pas contenir d'espaces ou de caractères spéciaux.\",\n es: 'La clave no puede contener espacios o caracteres especiales.',\n });\n\n const keyMinLengthError = t({\n en: 'The key must be at least 4 characters long.',\n fr: 'La clé doit comporter au moins 4 caractères.',\n es: 'La clave debe tener al menos 4 caracteres.',\n });\n\n // Description Field Error Messages\n const descriptionRequiredError = t({\n en: 'Please enter a description for your organization.',\n fr: 'Veuillez saisir une description pour votre organisation.',\n es: 'Por favor, ingrese una descripción para su organización.',\n });\n\n const descriptionInvalidTypeError = t({\n en: 'The description must be a valid string.',\n fr: 'La description doit être une chaîne valide.',\n es: 'La descripción debe ser una cadena válida.',\n });\n\n const requiredErrorProjectId = t({\n en: 'Please select a project',\n fr: 'Veuillez sélectionner un projet',\n es: 'Por favor, seleccione un proyecto',\n });\n\n const invalidTypeErrorProjectId = t({\n en: 'Please select a valid project',\n fr: 'Veuillez sélectionner un projet valide',\n es: 'Por favor, seleccione un proyecto válido',\n });\n\n return z.object({\n title: z\n .string({\n required_error: titleRequiredError,\n invalid_type_error: titleInvalidTypeError,\n })\n // Can be length of 0 or > 4\n .refine((val) => val.length === 0 || val.length >= 4, {\n message: titleMinLengthError,\n })\n .optional(),\n key: z\n .string({\n required_error: keyRequiredError,\n invalid_type_error: keyInvalidTypeError,\n })\n .min(4, { message: keyMinLengthError })\n /**\n * Valid :\n * my-key\n * my_key\n *\n * Invalid :\n * my key\n * my.key\n */\n .regex(/^[a-zA-Z0-9-_]+$/, { message: keySpaceError })\n .default(''),\n description: z\n .string({\n required_error: descriptionRequiredError,\n invalid_type_error: descriptionInvalidTypeError,\n })\n .optional(),\n projectIds: z\n .array(\n z.string({\n required_error: requiredErrorProjectId,\n invalid_type_error: invalidTypeErrorProjectId,\n })\n )\n .default([projectId]),\n });\n};\n\nexport type DictionaryDetailsFormData = z.infer<\n ReturnType<typeof getDictionaryDetailsSchema>\n>;\n"],"names":["t","z"],"mappings":";;;;AAIa,MAAA,6BAA6B,CAAC,cAAsB;AAE/D,QAAM,qBAAqBA,cAAAA,EAAE;AAAA,IAC3B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,wBAAwBA,cAAAA,EAAE;AAAA,IAC9B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,sBAAsBA,cAAAA,EAAE;AAAA,IAC5B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAGD,QAAM,mBAAmBA,cAAAA,EAAE;AAAA,IACzB,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,sBAAsBA,cAAAA,EAAE;AAAA,IAC5B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,gBAAgBA,cAAAA,EAAE;AAAA,IACtB,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA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;AACH;;"}
|
package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsSchema.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionaryDetailsSchema.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsSchema.ts"],"sourcesContent":["// @ts-ignore react-intlayer not build yet\nimport { t } from 'react-intlayer';\nimport { z } from 'zod';\n\nexport const getDictionaryDetailsSchema = (projectId: string) => {\n // Title Field Error Messages\n const titleRequiredError = t({\n en: 'Please enter a name for your organization.',\n fr: 'Veuillez saisir un nom pour votre organisation.',\n es: 'Por favor, ingrese un nombre para su organización.',\n });\n\n const titleInvalidTypeError = t({\n en: 'The organization name must be a valid string.',\n fr: 'Le nom de votre organisation doit être une chaîne valide.',\n es: 'El nombre de su organización debe ser una cadena válida.',\n });\n\n const titleMinLengthError = t({\n en: 'The organization name must be at least 4 characters long.',\n fr: 'Le nom de votre organisation doit comporter au moins 4 caractères.',\n es: 'El nombre de su organización debe tener al menos 4 caracteres.',\n });\n\n // Key Field Error Messages\n const keyRequiredError = t({\n en: 'Please enter a key for your organization.',\n fr: 'Veuillez saisir une clé pour votre organisation.',\n es: 'Por favor, ingrese una clave para su organización.',\n });\n\n const keyInvalidTypeError = t({\n en: 'The key must be a valid string.',\n fr: 'La clé doit être une chaîne valide.',\n es: 'La clave debe ser una cadena válida.',\n });\n\n const keySpaceError = t({\n en: 'The key cannot contain spaces or special characters.',\n fr: \"La clé ne peut pas contenir d'espaces ou de caractères spéciaux.\",\n es: 'La clave no puede contener espacios o caracteres especiales.',\n });\n\n const keyMinLengthError = t({\n en: 'The key must be at least 4 characters long.',\n fr: 'La clé doit comporter au moins 4 caractères.',\n es: 'La clave debe tener al menos 4 caracteres.',\n });\n\n // Description Field Error Messages\n const descriptionRequiredError = t({\n en: 'Please enter a description for your organization.',\n fr: 'Veuillez saisir une description pour votre organisation.',\n es: 'Por favor, ingrese una descripción para su organización.',\n });\n\n const descriptionInvalidTypeError = t({\n en: 'The description must be a valid string.',\n fr: 'La description doit être une chaîne valide.',\n es: 'La descripción debe ser una cadena válida.',\n });\n\n const requiredErrorProjectId = t({\n en: 'Please select a project',\n fr: 'Veuillez sélectionner un projet',\n es: 'Por favor, seleccione un proyecto',\n });\n\n const invalidTypeErrorProjectId = t({\n en: 'Please select a valid project',\n fr: 'Veuillez sélectionner un projet valide',\n es: 'Por favor, seleccione un proyecto válido',\n });\n\n return z.object({\n title: z\n .string({\n required_error: titleRequiredError,\n invalid_type_error: titleInvalidTypeError,\n })\n // Can be length of 0 or > 4\n .refine((val) => val.length === 0 || val.length >= 4, {\n message: titleMinLengthError,\n })\n .optional(),\n key: z\n .string({\n required_error: keyRequiredError,\n invalid_type_error: keyInvalidTypeError,\n })\n .min(4, { message: keyMinLengthError })\n /**\n * Valid :\n * my-key\n * my_key\n *\n * Invalid :\n * my key\n * my.key\n */\n .regex(/^[a-zA-Z0-9-_]+$/, { message: keySpaceError })\n .default(''),\n description: z\n .string({\n required_error: descriptionRequiredError,\n invalid_type_error: descriptionInvalidTypeError,\n })\n .optional(),\n projectIds: z\n .array(\n z.string({\n required_error: requiredErrorProjectId,\n invalid_type_error: invalidTypeErrorProjectId,\n })\n )\n .default([projectId]),\n });\n};\n\nexport type DictionaryDetailsFormData = z.infer<\n ReturnType<typeof getDictionaryDetailsSchema>\n>;\n"],"names":[],"mappings":";;AAIa,MAAA,6BAA6B,CAAC,cAAsB;AAE/D,QAAM,qBAAqB,EAAE;AAAA,IAC3B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,wBAAwB,EAAE;AAAA,IAC9B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,sBAAsB,EAAE;AAAA,IAC5B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAGD,QAAM,mBAAmB,EAA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AAA,IACrB,CAAA,EACA,SAAS;AAAA,IACZ,YAAY,EACT;AAAA,MACC,EAAE,OAAO;AAAA,QACP,gBAAgB;AAAA,QAChB,oBAAoB;AAAA,
|
|
1
|
+
{"version":3,"file":"DictionaryDetailsSchema.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsSchema.ts"],"sourcesContent":["// @ts-ignore react-intlayer not build yet\nimport { t } from 'react-intlayer';\nimport { z } from 'zod';\n\nexport const getDictionaryDetailsSchema = (projectId: string) => {\n // Title Field Error Messages\n const titleRequiredError = t({\n en: 'Please enter a name for your organization.',\n fr: 'Veuillez saisir un nom pour votre organisation.',\n es: 'Por favor, ingrese un nombre para su organización.',\n });\n\n const titleInvalidTypeError = t({\n en: 'The organization name must be a valid string.',\n fr: 'Le nom de votre organisation doit être une chaîne valide.',\n es: 'El nombre de su organización debe ser una cadena válida.',\n });\n\n const titleMinLengthError = t({\n en: 'The organization name must be at least 4 characters long.',\n fr: 'Le nom de votre organisation doit comporter au moins 4 caractères.',\n es: 'El nombre de su organización debe tener al menos 4 caracteres.',\n });\n\n // Key Field Error Messages\n const keyRequiredError = t({\n en: 'Please enter a key for your organization.',\n fr: 'Veuillez saisir une clé pour votre organisation.',\n es: 'Por favor, ingrese una clave para su organización.',\n });\n\n const keyInvalidTypeError = t({\n en: 'The key must be a valid string.',\n fr: 'La clé doit être une chaîne valide.',\n es: 'La clave debe ser una cadena válida.',\n });\n\n const keySpaceError = t({\n en: 'The key cannot contain spaces or special characters.',\n fr: \"La clé ne peut pas contenir d'espaces ou de caractères spéciaux.\",\n es: 'La clave no puede contener espacios o caracteres especiales.',\n });\n\n const keyMinLengthError = t({\n en: 'The key must be at least 4 characters long.',\n fr: 'La clé doit comporter au moins 4 caractères.',\n es: 'La clave debe tener al menos 4 caracteres.',\n });\n\n // Description Field Error Messages\n const descriptionRequiredError = t({\n en: 'Please enter a description for your organization.',\n fr: 'Veuillez saisir une description pour votre organisation.',\n es: 'Por favor, ingrese una descripción para su organización.',\n });\n\n const descriptionInvalidTypeError = t({\n en: 'The description must be a valid string.',\n fr: 'La description doit être une chaîne valide.',\n es: 'La descripción debe ser una cadena válida.',\n });\n\n const requiredErrorProjectId = t({\n en: 'Please select a project',\n fr: 'Veuillez sélectionner un projet',\n es: 'Por favor, seleccione un proyecto',\n });\n\n const invalidTypeErrorProjectId = t({\n en: 'Please select a valid project',\n fr: 'Veuillez sélectionner un projet valide',\n es: 'Por favor, seleccione un proyecto válido',\n });\n\n return z.object({\n title: z\n .string({\n required_error: titleRequiredError,\n invalid_type_error: titleInvalidTypeError,\n })\n // Can be length of 0 or > 4\n .refine((val) => val.length === 0 || val.length >= 4, {\n message: titleMinLengthError,\n })\n .optional(),\n key: z\n .string({\n required_error: keyRequiredError,\n invalid_type_error: keyInvalidTypeError,\n })\n .min(4, { message: keyMinLengthError })\n /**\n * Valid :\n * my-key\n * my_key\n *\n * Invalid :\n * my key\n * my.key\n */\n .regex(/^[a-zA-Z0-9-_]+$/, { message: keySpaceError })\n .default(''),\n description: z\n .string({\n required_error: descriptionRequiredError,\n invalid_type_error: descriptionInvalidTypeError,\n })\n .optional(),\n projectIds: z\n .array(\n z.string({\n required_error: requiredErrorProjectId,\n invalid_type_error: invalidTypeErrorProjectId,\n })\n )\n .default([projectId]),\n });\n};\n\nexport type DictionaryDetailsFormData = z.infer<\n ReturnType<typeof getDictionaryDetailsSchema>\n>;\n"],"names":[],"mappings":";;AAIa,MAAA,6BAA6B,CAAC,cAAsB;AAE/D,QAAM,qBAAqB,EAAE;AAAA,IAC3B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,wBAAwB,EAAE;AAAA,IAC9B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,sBAAsB,EAAE;AAAA,IAC5B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;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B;AAAA,MAChB,oBAAoB;AAAA,IACrB,CAAA,EACA,SAAS;AAAA,IACZ,YAAY,EACT;AAAA,MACC,EAAE,OAAO;AAAA,QACP,gBAAgB;AAAA,QAChB,oBAAoB;AAAA,MACrB,CAAA;AAAA,IAAA,EAEF,QAAQ,CAAC,SAAS,CAAC;AAAA,EAAA,CACvB;AACH;"}
|
package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionaryDetails.content.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.tsx"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const dictionaryDetailsContent = {\n key: 'dictionary-details',\n content: {\n titleInput: {\n label: t({\n en: 'Title',\n fr: 'Titre',\n es: 'Título',\n }),\n description: t({\n en: 'The title of your dictionary allows you to easily identify it',\n fr: \"Le titre de votre dictionnaire permet de l'identifier facilement\",\n es: 'El título de su diccionario le permite identificar fácilmente',\n }),\n placeholder: t({\n en: 'Enter the title of your dictionary',\n fr: 'Entrez le titre de votre dictionnaire',\n es: 'Ingrese el título de su diccionario',\n }),\n },\n keyInput: {\n label: t({\n en: 'Key',\n fr: 'Clé',\n es: 'Clave',\n }),\n description: t({\n en: 'The key of your dictionary is used to identify it in the application',\n fr: \"La clé de votre dictionnaire est utilisée pour l'identifier dans l'application\",\n es: 'La clave de su diccionario se utiliza para identificarla en la aplicación',\n }),\n placeholder: t({\n en: 'Enter the key of your dictionary',\n fr: 'Entrez la clé de votre dictionnaire',\n es: 'Ingrese la clave de su diccionario',\n }),\n },\n descriptionInput: {\n label: t({\n en: 'Description',\n fr: 'Description',\n es: 'Descripción',\n }),\n placeholder: t({\n en: 'Enter the description of your dictionary',\n fr: 'Entrez la description de votre dictionnaire',\n es: 'Ingrese la descripción de su diccionario',\n }),\n description: t({\n en: 'The description of your dictionary allows you to easily identify it using keywords. It is also used to search for your dictionary, and to assist the AI in understanding your dictionary.',\n fr: \"La description de votre dictionnaire permet d'identifier facilement l'utilisateur en utilisant des mots-clés. Elle est également utilisée pour rechercher votre dictionnaire et pour aider l'IA à comprendre votre dictionnaire.\",\n es: 'La descripción de su diccionario le permite identificar fácilmente el usuario utilizando palabras clave. También se utiliza para buscar su diccionario y para ayudar a la IA a entender su diccionario.',\n }),\n },\n\n projectInput: {\n label: t({\n en: 'Projects',\n fr: 'Projets',\n es: 'Proyectos',\n }),\n description: t({\n en: 'A dictionary can be associated with one or more projects. This allows you load the dictionary on different applications, and share it across different teams.',\n fr: 'Un dictionnaire peut être associé à un ou plusieurs projets. Cela permet de charger le dictionnaire sur différentes applications et de le partager entre différentes équipes.',\n es: 'Un diccionario puede estar asociado con uno o más proyectos. Esto permite cargar el diccionario en diferentes aplicaciones y compartirlo entre diferentes equipos.',\n }),\n placeholder: t({\n en: '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 }),\n },\n\n saveButton: {\n text: t({\n en: 'Save changes',\n fr: 'Enregistrer les modifications',\n es: 'Guardar cambios',\n }),\n label: t({\n en: 'Click to save changes',\n fr: 'Cliquez pour enregistrer les modifications',\n es: 'Haga clic para guardar los cambios',\n }),\n },\n publishButton: {\n text: t({\n en: 'Publish dictionary',\n fr: 'Publier le dictionnaire',\n es: 'Publicar diccionario',\n }),\n label: t({\n en: 'Click to publish dictionary',\n fr: 'Cliquez pour publier le dictionnaire',\n es: 'Haga clic para publicar el diccionario',\n }),\n },\n },\n} satisfies DeclarationContent;\n"],"names":["t"],"mappings":";;;AAEO,MAAM,2BAA2B;AAAA,EACtC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,YAAY;AAAA,MACV,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,aAAaA,SAAAA,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,aAAaA,SAAAA,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,
|
|
1
|
+
{"version":3,"file":"dictionaryDetails.content.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.tsx"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const dictionaryDetailsContent = {\n key: 'dictionary-details',\n content: {\n titleInput: {\n label: t({\n en: 'Title',\n fr: 'Titre',\n es: 'Título',\n }),\n description: t({\n en: 'The title of your dictionary allows you to easily identify it',\n fr: \"Le titre de votre dictionnaire permet de l'identifier facilement\",\n es: 'El título de su diccionario le permite identificar fácilmente',\n }),\n placeholder: t({\n en: 'Enter the title of your dictionary',\n fr: 'Entrez le titre de votre dictionnaire',\n es: 'Ingrese el título de su diccionario',\n }),\n },\n keyInput: {\n label: t({\n en: 'Key',\n fr: 'Clé',\n es: 'Clave',\n }),\n description: t({\n en: 'The key of your dictionary is used to identify it in the application',\n fr: \"La clé de votre dictionnaire est utilisée pour l'identifier dans l'application\",\n es: 'La clave de su diccionario se utiliza para identificarla en la aplicación',\n }),\n placeholder: t({\n en: 'Enter the key of your dictionary',\n fr: 'Entrez la clé de votre dictionnaire',\n es: 'Ingrese la clave de su diccionario',\n }),\n },\n descriptionInput: {\n label: t({\n en: 'Description',\n fr: 'Description',\n es: 'Descripción',\n }),\n placeholder: t({\n en: 'Enter the description of your dictionary',\n fr: 'Entrez la description de votre dictionnaire',\n es: 'Ingrese la descripción de su diccionario',\n }),\n description: t({\n en: 'The description of your dictionary allows you to easily identify it using keywords. It is also used to search for your dictionary, and to assist the AI in understanding your dictionary.',\n fr: \"La description de votre dictionnaire permet d'identifier facilement l'utilisateur en utilisant des mots-clés. Elle est également utilisée pour rechercher votre dictionnaire et pour aider l'IA à comprendre votre dictionnaire.\",\n es: 'La descripción de su diccionario le permite identificar fácilmente el usuario utilizando palabras clave. También se utiliza para buscar su diccionario y para ayudar a la IA a entender su diccionario.',\n }),\n },\n\n projectInput: {\n label: t({\n en: 'Projects',\n fr: 'Projets',\n es: 'Proyectos',\n }),\n description: t({\n en: 'A dictionary can be associated with one or more projects. This allows you load the dictionary on different applications, and share it across different teams.',\n fr: 'Un dictionnaire peut être associé à un ou plusieurs projets. Cela permet de charger le dictionnaire sur différentes applications et de le partager entre différentes équipes.',\n es: 'Un diccionario puede estar asociado con uno o más proyectos. Esto permite cargar el diccionario en diferentes aplicaciones y compartirlo entre diferentes equipos.',\n }),\n placeholder: t({\n en: '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 }),\n },\n\n saveButton: {\n text: t({\n en: 'Save changes',\n fr: 'Enregistrer les modifications',\n es: 'Guardar cambios',\n }),\n label: t({\n en: 'Click to save changes',\n fr: 'Cliquez pour enregistrer les modifications',\n es: 'Haga clic para guardar los cambios',\n }),\n },\n publishButton: {\n text: t({\n en: 'Publish dictionary',\n fr: 'Publier le dictionnaire',\n es: 'Publicar diccionario',\n }),\n label: t({\n en: 'Click to publish dictionary',\n fr: 'Cliquez pour publier le dictionnaire',\n es: 'Haga clic para publicar el diccionario',\n }),\n },\n },\n} satisfies DeclarationContent;\n"],"names":["t"],"mappings":";;;AAEO,MAAM,2BAA2B;AAAA,EACtC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,YAAY;AAAA,MACV,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,aAAaA,SAAAA,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,aAAaA,SAAAA,EAAE;AAAA,QACb,IAAI;AA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,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IACH;AAAA,IACA,eAAe;AAAA,MACb,MAAMA,SAAAA,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IAAA;AAAA,EACH;AAEJ;;"}
|
package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionaryDetails.content.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.tsx"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const dictionaryDetailsContent = {\n key: 'dictionary-details',\n content: {\n titleInput: {\n label: t({\n en: 'Title',\n fr: 'Titre',\n es: 'Título',\n }),\n description: t({\n en: 'The title of your dictionary allows you to easily identify it',\n fr: \"Le titre de votre dictionnaire permet de l'identifier facilement\",\n es: 'El título de su diccionario le permite identificar fácilmente',\n }),\n placeholder: t({\n en: 'Enter the title of your dictionary',\n fr: 'Entrez le titre de votre dictionnaire',\n es: 'Ingrese el título de su diccionario',\n }),\n },\n keyInput: {\n label: t({\n en: 'Key',\n fr: 'Clé',\n es: 'Clave',\n }),\n description: t({\n en: 'The key of your dictionary is used to identify it in the application',\n fr: \"La clé de votre dictionnaire est utilisée pour l'identifier dans l'application\",\n es: 'La clave de su diccionario se utiliza para identificarla en la aplicación',\n }),\n placeholder: t({\n en: 'Enter the key of your dictionary',\n fr: 'Entrez la clé de votre dictionnaire',\n es: 'Ingrese la clave de su diccionario',\n }),\n },\n descriptionInput: {\n label: t({\n en: 'Description',\n fr: 'Description',\n es: 'Descripción',\n }),\n placeholder: t({\n en: 'Enter the description of your dictionary',\n fr: 'Entrez la description de votre dictionnaire',\n es: 'Ingrese la descripción de su diccionario',\n }),\n description: t({\n en: 'The description of your dictionary allows you to easily identify it using keywords. It is also used to search for your dictionary, and to assist the AI in understanding your dictionary.',\n fr: \"La description de votre dictionnaire permet d'identifier facilement l'utilisateur en utilisant des mots-clés. Elle est également utilisée pour rechercher votre dictionnaire et pour aider l'IA à comprendre votre dictionnaire.\",\n es: 'La descripción de su diccionario le permite identificar fácilmente el usuario utilizando palabras clave. También se utiliza para buscar su diccionario y para ayudar a la IA a entender su diccionario.',\n }),\n },\n\n projectInput: {\n label: t({\n en: 'Projects',\n fr: 'Projets',\n es: 'Proyectos',\n }),\n description: t({\n en: 'A dictionary can be associated with one or more projects. This allows you load the dictionary on different applications, and share it across different teams.',\n fr: 'Un dictionnaire peut être associé à un ou plusieurs projets. Cela permet de charger le dictionnaire sur différentes applications et de le partager entre différentes équipes.',\n es: 'Un diccionario puede estar asociado con uno o más proyectos. Esto permite cargar el diccionario en diferentes aplicaciones y compartirlo entre diferentes equipos.',\n }),\n placeholder: t({\n en: '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 }),\n },\n\n saveButton: {\n text: t({\n en: 'Save changes',\n fr: 'Enregistrer les modifications',\n es: 'Guardar cambios',\n }),\n label: t({\n en: 'Click to save changes',\n fr: 'Cliquez pour enregistrer les modifications',\n es: 'Haga clic para guardar los cambios',\n }),\n },\n publishButton: {\n text: t({\n en: 'Publish dictionary',\n fr: 'Publier le dictionnaire',\n es: 'Publicar diccionario',\n }),\n label: t({\n en: 'Click to publish dictionary',\n fr: 'Cliquez pour publier le dictionnaire',\n es: 'Haga clic para publicar el diccionario',\n }),\n },\n },\n} satisfies DeclarationContent;\n"],"names":[],"mappings":";AAEO,MAAM,2BAA2B;AAAA,EACtC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,YAAY;AAAA,MACV,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,aAAa,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,aAAa,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,
|
|
1
|
+
{"version":3,"file":"dictionaryDetails.content.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.tsx"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const dictionaryDetailsContent = {\n key: 'dictionary-details',\n content: {\n titleInput: {\n label: t({\n en: 'Title',\n fr: 'Titre',\n es: 'Título',\n }),\n description: t({\n en: 'The title of your dictionary allows you to easily identify it',\n fr: \"Le titre de votre dictionnaire permet de l'identifier facilement\",\n es: 'El título de su diccionario le permite identificar fácilmente',\n }),\n placeholder: t({\n en: 'Enter the title of your dictionary',\n fr: 'Entrez le titre de votre dictionnaire',\n es: 'Ingrese el título de su diccionario',\n }),\n },\n keyInput: {\n label: t({\n en: 'Key',\n fr: 'Clé',\n es: 'Clave',\n }),\n description: t({\n en: 'The key of your dictionary is used to identify it in the application',\n fr: \"La clé de votre dictionnaire est utilisée pour l'identifier dans l'application\",\n es: 'La clave de su diccionario se utiliza para identificarla en la aplicación',\n }),\n placeholder: t({\n en: 'Enter the key of your dictionary',\n fr: 'Entrez la clé de votre dictionnaire',\n es: 'Ingrese la clave de su diccionario',\n }),\n },\n descriptionInput: {\n label: t({\n en: 'Description',\n fr: 'Description',\n es: 'Descripción',\n }),\n placeholder: t({\n en: 'Enter the description of your dictionary',\n fr: 'Entrez la description de votre dictionnaire',\n es: 'Ingrese la descripción de su diccionario',\n }),\n description: t({\n en: 'The description of your dictionary allows you to easily identify it using keywords. It is also used to search for your dictionary, and to assist the AI in understanding your dictionary.',\n fr: \"La description de votre dictionnaire permet d'identifier facilement l'utilisateur en utilisant des mots-clés. Elle est également utilisée pour rechercher votre dictionnaire et pour aider l'IA à comprendre votre dictionnaire.\",\n es: 'La descripción de su diccionario le permite identificar fácilmente el usuario utilizando palabras clave. También se utiliza para buscar su diccionario y para ayudar a la IA a entender su diccionario.',\n }),\n },\n\n projectInput: {\n label: t({\n en: 'Projects',\n fr: 'Projets',\n es: 'Proyectos',\n }),\n description: t({\n en: 'A dictionary can be associated with one or more projects. This allows you load the dictionary on different applications, and share it across different teams.',\n fr: 'Un dictionnaire peut être associé à un ou plusieurs projets. Cela permet de charger le dictionnaire sur différentes applications et de le partager entre différentes équipes.',\n es: 'Un diccionario puede estar asociado con uno o más proyectos. Esto permite cargar el diccionario en diferentes aplicaciones y compartirlo entre diferentes equipos.',\n }),\n placeholder: t({\n en: '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 }),\n },\n\n saveButton: {\n text: t({\n en: 'Save changes',\n fr: 'Enregistrer les modifications',\n es: 'Guardar cambios',\n }),\n label: t({\n en: 'Click to save changes',\n fr: 'Cliquez pour enregistrer les modifications',\n es: 'Haga clic para guardar los cambios',\n }),\n },\n publishButton: {\n text: t({\n en: 'Publish dictionary',\n fr: 'Publier le dictionnaire',\n es: 'Publicar diccionario',\n }),\n label: t({\n en: 'Click to publish dictionary',\n fr: 'Cliquez pour publier le dictionnaire',\n es: 'Haga clic para publicar el diccionario',\n }),\n },\n },\n} satisfies DeclarationContent;\n"],"names":[],"mappings":";AAEO,MAAM,2BAA2B;AAAA,EACtC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,YAAY;AAAA,MACV,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,aAAa,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,aAA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IACA,eAAe;AAAA,MACb,MAAM,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IAAA;AAAA,EACH;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionaryFieldEditor.cjs","sources":["../../../src/components/DictionaryFieldEditor/DictionaryFieldEditor.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowLeft } from 'lucide-react';\nimport { useEffect, useState, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { Button } from '../Button';\nimport { Container } from '../Container';\nimport { useEditedContentStore } from '../DictionaryEditor';\nimport { H2 } from '../Headers';\nimport { SwitchSelector } from '../SwitchSelector';\nimport { DictionaryDetailsForm } from './DictionaryDetails/DictionaryDetailsForm';\nimport { dictionaryFieldEditorContent } from './dictionaryFieldEditor.content';\nimport { JSONEditor } from './JSONEditor';\nimport { NodeEditor } from './NodeEditor';\n\ntype DictionaryFieldEditorProps = {\n dictionary: Dictionary;\n onClickDictionaryList?: () => void;\n};\n\nenum EditorViewType {\n NodeEditor,\n JSONEditor,\n}\n\nexport const DictionaryFieldEditor: FC<DictionaryFieldEditorProps> = ({\n dictionary,\n onClickDictionaryList,\n}) => {\n const { key } = dictionary;\n const [editorView, setEditorView] = useState<EditorViewType>(\n EditorViewType.NodeEditor\n );\n const { dictionaryRecord, setDictionariesRecord } = useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n dictionaryRecord: s.dictionariesRecord,\n setDictionariesRecord: s.setDictionariesRecord,\n }))\n );\n const { returnToDictionaryList, titleContent, titleInformation } =\n useDictionary(dictionaryFieldEditorContent);\n\n useEffect(() => {\n if (dictionaryRecord[key]) return;\n\n setDictionariesRecord({\n [key]: dictionary,\n });\n }, [dictionary, key, setDictionariesRecord, dictionaryRecord]);\n\n return (\n <div className=\"flex size-full flex-1 flex-col gap-10\">\n <div className=\"flex items-center gap-2\">\n <Button\n onClick={() => onClickDictionaryList?.()}\n variant=\"hoverable\"\n size=\"icon-md\"\n color=\"text\"\n id=\"return-to-dictionary-list\"\n Icon={ArrowLeft}\n label={returnToDictionaryList.label.value}\n />\n <label\n className=\"cursor-pointer text-xs hover:underline\"\n htmlFor=\"return-to-dictionary-list\"\n >\n {returnToDictionaryList.text}\n </label>\n </div>\n\n <Container\n className=\"flex size-full justify-center gap-10 p-6\"\n roundedSize=\"xl\"\n >\n <H2>{titleInformation}</H2>\n\n <DictionaryDetailsForm dictionary={dictionary} />\n </Container>\n\n <Container\n className=\"flex size-full justify-center gap-10 p-6\"\n roundedSize=\"xl\"\n >\n <H2>{titleContent}</H2>\n <SwitchSelector\n defaultValue={editorView}\n onChange={(value) => setEditorView(value)}\n color=\"text\"\n size=\"sm\"\n className=\"ml-auto\"\n choices={[\n {\n content: 'Node editor',\n value: EditorViewType.NodeEditor,\n },\n {\n content: 'JSON editor',\n value: EditorViewType.JSONEditor,\n },\n ]}\n />\n {editorView === EditorViewType.NodeEditor && (\n <NodeEditor dictionary={dictionary} />\n )}\n {editorView === EditorViewType.JSONEditor && (\n <JSONEditor dictionary={dictionary} />\n )}\n </Container>\n </div>\n );\n};\n"],"names":["useState","useEditedContentStore","useShallow","useDictionary","dictionaryFieldEditorContent","useEffect","jsxs","jsx","Button","ArrowLeft","Container","H2","DictionaryDetailsForm","SwitchSelector","NodeEditor","JSONEditor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BO,MAAM,wBAAwD,CAAC;AAAA,EACpE;AAAA,EACA;AACF,MAAM;AACE,QAAA,EAAE,
|
|
1
|
+
{"version":3,"file":"DictionaryFieldEditor.cjs","sources":["../../../src/components/DictionaryFieldEditor/DictionaryFieldEditor.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowLeft } from 'lucide-react';\nimport { useEffect, useState, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { Button } from '../Button';\nimport { Container } from '../Container';\nimport { useEditedContentStore } from '../DictionaryEditor';\nimport { H2 } from '../Headers';\nimport { SwitchSelector } from '../SwitchSelector';\nimport { DictionaryDetailsForm } from './DictionaryDetails/DictionaryDetailsForm';\nimport { dictionaryFieldEditorContent } from './dictionaryFieldEditor.content';\nimport { JSONEditor } from './JSONEditor';\nimport { NodeEditor } from './NodeEditor';\n\ntype DictionaryFieldEditorProps = {\n dictionary: Dictionary;\n onClickDictionaryList?: () => void;\n};\n\nenum EditorViewType {\n NodeEditor,\n JSONEditor,\n}\n\nexport const DictionaryFieldEditor: FC<DictionaryFieldEditorProps> = ({\n dictionary,\n onClickDictionaryList,\n}) => {\n const { key } = dictionary;\n const [editorView, setEditorView] = useState<EditorViewType>(\n EditorViewType.NodeEditor\n );\n const { dictionaryRecord, setDictionariesRecord } = useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n dictionaryRecord: s.dictionariesRecord,\n setDictionariesRecord: s.setDictionariesRecord,\n }))\n );\n const { returnToDictionaryList, titleContent, titleInformation } =\n useDictionary(dictionaryFieldEditorContent);\n\n useEffect(() => {\n if (dictionaryRecord[key]) return;\n\n setDictionariesRecord({\n [key]: dictionary,\n });\n }, [dictionary, key, setDictionariesRecord, dictionaryRecord]);\n\n return (\n <div className=\"flex size-full flex-1 flex-col gap-10\">\n <div className=\"flex items-center gap-2\">\n <Button\n onClick={() => onClickDictionaryList?.()}\n variant=\"hoverable\"\n size=\"icon-md\"\n color=\"text\"\n id=\"return-to-dictionary-list\"\n Icon={ArrowLeft}\n label={returnToDictionaryList.label.value}\n />\n <label\n className=\"cursor-pointer text-xs hover:underline\"\n htmlFor=\"return-to-dictionary-list\"\n >\n {returnToDictionaryList.text}\n </label>\n </div>\n\n <Container\n className=\"flex size-full justify-center gap-10 p-6\"\n roundedSize=\"xl\"\n >\n <H2>{titleInformation}</H2>\n\n <DictionaryDetailsForm dictionary={dictionary} />\n </Container>\n\n <Container\n className=\"flex size-full justify-center gap-10 p-6\"\n roundedSize=\"xl\"\n >\n <H2>{titleContent}</H2>\n <SwitchSelector\n defaultValue={editorView}\n onChange={(value) => setEditorView(value)}\n color=\"text\"\n size=\"sm\"\n className=\"ml-auto\"\n choices={[\n {\n content: 'Node editor',\n value: EditorViewType.NodeEditor,\n },\n {\n content: 'JSON editor',\n value: EditorViewType.JSONEditor,\n },\n ]}\n />\n {editorView === EditorViewType.NodeEditor && (\n <NodeEditor dictionary={dictionary} />\n )}\n {editorView === EditorViewType.JSONEditor && (\n <JSONEditor dictionary={dictionary} />\n )}\n </Container>\n </div>\n );\n};\n"],"names":["useState","useEditedContentStore","useShallow","useDictionary","dictionaryFieldEditorContent","useEffect","jsxs","jsx","Button","ArrowLeft","Container","H2","DictionaryDetailsForm","SwitchSelector","NodeEditor","JSONEditor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BO,MAAM,wBAAwD,CAAC;AAAA,EACpE;AAAA,EACA;AACF,MAAM;AACE,QAAA,EAAE,QAAQ;AACV,QAAA,CAAC,YAAY,aAAa,IAAIA,WAAA;AAAA,IAClC;AAAA;AAAA,EACF;AACM,QAAA,EAAE,kBAAkB,sBAAA,IAA0BC,kDAAA;AAAA,IAClDC,QAAA,WAAW,CAAC,OAAO;AAAA,MACjB,eAAe,EAAE;AAAA,MACjB,kBAAkB,EAAE;AAAA,MACpB,uBAAuB,EAAE;AAAA,IAAA,EACzB;AAAA,EACJ;AACA,QAAM,EAAE,wBAAwB,cAAc,iBAAiB,IAC7DC,cAAAA,cAAcC,+DAAAA,4BAA4B;AAE5CC,aAAAA,UAAU,MAAM;AACV,QAAA,iBA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cACN,MAAK;AAAA,cACL,WAAU;AAAA,cACV,SAAS;AAAA,gBACP;AAAA,kBACE,SAAS;AAAA,kBACT,OAAO;AAAA;AAAA,gBACT;AAAA,gBACA;AAAA,kBACE,SAAS;AAAA,kBACT,OAAO;AAAA;AAAA,gBAAA;AAAA,cACT;AAAA,YACF;AAAA,UACF;AAAA,UACC,eAAe,KACbN,2BAAAA,kBAAAA,IAAAO,4CAAAA,YAAA,EAAW,WAAwB,CAAA;AAAA,UAErC,eAAe,KACbP,2BAAAA,kBAAAA,IAAAQ,4CAAA,YAAA,EAAW,WAAwB,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAExC,GACF;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionaryFieldEditor.mjs","sources":["../../../src/components/DictionaryFieldEditor/DictionaryFieldEditor.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowLeft } from 'lucide-react';\nimport { useEffect, useState, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { Button } from '../Button';\nimport { Container } from '../Container';\nimport { useEditedContentStore } from '../DictionaryEditor';\nimport { H2 } from '../Headers';\nimport { SwitchSelector } from '../SwitchSelector';\nimport { DictionaryDetailsForm } from './DictionaryDetails/DictionaryDetailsForm';\nimport { dictionaryFieldEditorContent } from './dictionaryFieldEditor.content';\nimport { JSONEditor } from './JSONEditor';\nimport { NodeEditor } from './NodeEditor';\n\ntype DictionaryFieldEditorProps = {\n dictionary: Dictionary;\n onClickDictionaryList?: () => void;\n};\n\nenum EditorViewType {\n NodeEditor,\n JSONEditor,\n}\n\nexport const DictionaryFieldEditor: FC<DictionaryFieldEditorProps> = ({\n dictionary,\n onClickDictionaryList,\n}) => {\n const { key } = dictionary;\n const [editorView, setEditorView] = useState<EditorViewType>(\n EditorViewType.NodeEditor\n );\n const { dictionaryRecord, setDictionariesRecord } = useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n dictionaryRecord: s.dictionariesRecord,\n setDictionariesRecord: s.setDictionariesRecord,\n }))\n );\n const { returnToDictionaryList, titleContent, titleInformation } =\n useDictionary(dictionaryFieldEditorContent);\n\n useEffect(() => {\n if (dictionaryRecord[key]) return;\n\n setDictionariesRecord({\n [key]: dictionary,\n });\n }, [dictionary, key, setDictionariesRecord, dictionaryRecord]);\n\n return (\n <div className=\"flex size-full flex-1 flex-col gap-10\">\n <div className=\"flex items-center gap-2\">\n <Button\n onClick={() => onClickDictionaryList?.()}\n variant=\"hoverable\"\n size=\"icon-md\"\n color=\"text\"\n id=\"return-to-dictionary-list\"\n Icon={ArrowLeft}\n label={returnToDictionaryList.label.value}\n />\n <label\n className=\"cursor-pointer text-xs hover:underline\"\n htmlFor=\"return-to-dictionary-list\"\n >\n {returnToDictionaryList.text}\n </label>\n </div>\n\n <Container\n className=\"flex size-full justify-center gap-10 p-6\"\n roundedSize=\"xl\"\n >\n <H2>{titleInformation}</H2>\n\n <DictionaryDetailsForm dictionary={dictionary} />\n </Container>\n\n <Container\n className=\"flex size-full justify-center gap-10 p-6\"\n roundedSize=\"xl\"\n >\n <H2>{titleContent}</H2>\n <SwitchSelector\n defaultValue={editorView}\n onChange={(value) => setEditorView(value)}\n color=\"text\"\n size=\"sm\"\n className=\"ml-auto\"\n choices={[\n {\n content: 'Node editor',\n value: EditorViewType.NodeEditor,\n },\n {\n content: 'JSON editor',\n value: EditorViewType.JSONEditor,\n },\n ]}\n />\n {editorView === EditorViewType.NodeEditor && (\n <NodeEditor dictionary={dictionary} />\n )}\n {editorView === EditorViewType.JSONEditor && (\n <JSONEditor dictionary={dictionary} />\n )}\n </Container>\n </div>\n );\n};\n"],"names":["jsxs","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BO,MAAM,wBAAwD,CAAC;AAAA,EACpE;AAAA,EACA;AACF,MAAM;AACE,QAAA,EAAE,
|
|
1
|
+
{"version":3,"file":"DictionaryFieldEditor.mjs","sources":["../../../src/components/DictionaryFieldEditor/DictionaryFieldEditor.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowLeft } from 'lucide-react';\nimport { useEffect, useState, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { Button } from '../Button';\nimport { Container } from '../Container';\nimport { useEditedContentStore } from '../DictionaryEditor';\nimport { H2 } from '../Headers';\nimport { SwitchSelector } from '../SwitchSelector';\nimport { DictionaryDetailsForm } from './DictionaryDetails/DictionaryDetailsForm';\nimport { dictionaryFieldEditorContent } from './dictionaryFieldEditor.content';\nimport { JSONEditor } from './JSONEditor';\nimport { NodeEditor } from './NodeEditor';\n\ntype DictionaryFieldEditorProps = {\n dictionary: Dictionary;\n onClickDictionaryList?: () => void;\n};\n\nenum EditorViewType {\n NodeEditor,\n JSONEditor,\n}\n\nexport const DictionaryFieldEditor: FC<DictionaryFieldEditorProps> = ({\n dictionary,\n onClickDictionaryList,\n}) => {\n const { key } = dictionary;\n const [editorView, setEditorView] = useState<EditorViewType>(\n EditorViewType.NodeEditor\n );\n const { dictionaryRecord, setDictionariesRecord } = useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n dictionaryRecord: s.dictionariesRecord,\n setDictionariesRecord: s.setDictionariesRecord,\n }))\n );\n const { returnToDictionaryList, titleContent, titleInformation } =\n useDictionary(dictionaryFieldEditorContent);\n\n useEffect(() => {\n if (dictionaryRecord[key]) return;\n\n setDictionariesRecord({\n [key]: dictionary,\n });\n }, [dictionary, key, setDictionariesRecord, dictionaryRecord]);\n\n return (\n <div className=\"flex size-full flex-1 flex-col gap-10\">\n <div className=\"flex items-center gap-2\">\n <Button\n onClick={() => onClickDictionaryList?.()}\n variant=\"hoverable\"\n size=\"icon-md\"\n color=\"text\"\n id=\"return-to-dictionary-list\"\n Icon={ArrowLeft}\n label={returnToDictionaryList.label.value}\n />\n <label\n className=\"cursor-pointer text-xs hover:underline\"\n htmlFor=\"return-to-dictionary-list\"\n >\n {returnToDictionaryList.text}\n </label>\n </div>\n\n <Container\n className=\"flex size-full justify-center gap-10 p-6\"\n roundedSize=\"xl\"\n >\n <H2>{titleInformation}</H2>\n\n <DictionaryDetailsForm dictionary={dictionary} />\n </Container>\n\n <Container\n className=\"flex size-full justify-center gap-10 p-6\"\n roundedSize=\"xl\"\n >\n <H2>{titleContent}</H2>\n <SwitchSelector\n defaultValue={editorView}\n onChange={(value) => setEditorView(value)}\n color=\"text\"\n size=\"sm\"\n className=\"ml-auto\"\n choices={[\n {\n content: 'Node editor',\n value: EditorViewType.NodeEditor,\n },\n {\n content: 'JSON editor',\n value: EditorViewType.JSONEditor,\n },\n ]}\n />\n {editorView === EditorViewType.NodeEditor && (\n <NodeEditor dictionary={dictionary} />\n )}\n {editorView === EditorViewType.JSONEditor && (\n <JSONEditor dictionary={dictionary} />\n )}\n </Container>\n </div>\n );\n};\n"],"names":["jsxs","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BO,MAAM,wBAAwD,CAAC;AAAA,EACpE;AAAA,EACA;AACF,MAAM;AACE,QAAA,EAAE,QAAQ;AACV,QAAA,CAAC,YAAY,aAAa,IAAI;AAAA,IAClC;AAAA;AAAA,EACF;AACM,QAAA,EAAE,kBAAkB,sBAAA,IAA0B;AAAA,IAClD,WAAW,CAAC,OAAO;AAAA,MACjB,eAAe,EAAE;AAAA,MACjB,kBAAkB,EAAE;AAAA,MACpB,uBAAuB,EAAE;AAAA,IAAA,EACzB;AAAA,EACJ;AACA,QAAM,EAAE,wBAAwB,cAAc,iBAAiB,IAC7D,cAAc,4BAA4B;AAE5C,YAAU,MAAM;AACV,QAAA,iBAAiB,GAAG,EAAG;AAEL,0BAAA;AAAA,MACpB,CAAC,GAAG,GAAG;AAAA,IAA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;AAAA,YACF;AAAA,UACF;AAAA,UACC,eAAe,KACbA,kCAAAA,IAAA,YAAA,EAAW,WAAwB,CAAA;AAAA,UAErC,eAAe,KACbA,kCAAAA,IAAA,YAAA,EAAW,WAAwB,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAExC,GACF;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorView.cjs","sources":["../../../../src/components/DictionaryFieldEditor/EditorView/EditorView.tsx"],"sourcesContent":["'use client';\n\nimport { type KeyPath, type Dictionary } from '@intlayer/core';\nimport { RotateCcw, X } from 'lucide-react';\nimport { useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { EditableFieldInput } from '../..//EditableField';\nimport {\n camelCaseToSentence,\n sentenceToCamelCase,\n} from '../../../utils/camelCase';\nimport { getDictionaryValueByKeyPath } from '../../../utils/dictionary';\nimport { Button } from '../../Button';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../../DictionaryEditor';\nimport { Label } from '../../Label';\nimport { editorViewContent } from '../editorView.content';\nimport { getIsEditableSection } from '../getIsEditableSection';\nimport { NodeTypeSelector } from '../NodeTypeSelector';\nimport { TextEditor } from './TextEditor';\n\ntype EditorViewProps = {\n dictionaryKey: string;\n dictionary: Dictionary;\n};\n\nexport const EditorView: FC<EditorViewProps> = ({\n dictionaryKey,\n dictionary,\n}) => {\n const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(\n useShallow((s) => ({\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n focusedContent: s.focusedContent,\n }))\n );\n const keyPath = focusedContent?.keyPath ?? [];\n const initialKeyName = keyPath[keyPath.length - 1]?.key ?? '';\n const { titleInput, deleteButton, nodeTypeSelector, restoreButton } =\n useDictionary(editorViewContent);\n\n const {\n editedContent,\n renameEditedContent,\n addEditedContent,\n removeEditedContent,\n } = useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n renameEditedContent: s.renameEditedContent,\n addEditedContent: s.addEditedContent,\n removeEditedContent: s.removeEditedContent,\n }))\n );\n\n const editedSection = editedContent[dictionaryKey]?.content\n ? getDictionaryValueByKeyPath(editedContent[dictionaryKey].content, keyPath)\n : undefined;\n\n const dictionarySection = getDictionaryValueByKeyPath(\n dictionary.content,\n keyPath\n );\n\n const section = editedSection ?? dictionarySection;\n\n const isEdited = useMemo(\n () =>\n editedSection &&\n JSON.stringify(editedSection) !== JSON.stringify(dictionarySection),\n [editedSection, dictionarySection]\n );\n\n const isEditableSection = getIsEditableSection(section);\n\n const handleRenameNodeKey = (keyName: string) => {\n const camelCaseSentence = sentenceToCamelCase(keyName);\n renameEditedContent(dictionaryKey, camelCaseSentence, keyPath);\n const prevKeyPath: KeyPath[] = keyPath.slice(0, -1);\n const lastKeyPath: KeyPath = keyPath[keyPath.length - 1];\n const newKeyPath: KeyPath[] = [\n ...prevKeyPath,\n { ...lastKeyPath, key: camelCaseSentence } as KeyPath,\n ];\n setFocusedContentKeyPath(newKeyPath);\n };\n\n return (\n <>\n {isEditableSection && (\n <TextEditor\n key={keyPath.join('.')}\n keyPath={keyPath}\n section={section}\n dictionaryKey={dictionaryKey}\n />\n )}\n\n {keyPath.length > 0 ? (\n <form\n className=\"bg-text text-text-dark dark:bg-text-dark dark:text-text flex w-full flex-col items-start justify-between gap-6 px-4 py-2\"\n key={JSON.stringify(focusedContent?.keyPath)}\n >\n <div className=\"flex w-full flex-wrap items-start justify-between gap-6\">\n {typeof initialKeyName === 'string' && (\n <div className=\"flex flex-col gap-3\">\n <Label>{titleInput.label}</Label>\n <div className=\"flex flex-wrap items-center gap-4\">\n <EditableFieldInput\n name=\"key\"\n aria-label=\"Key\"\n key={initialKeyName}\n placeholder={titleInput.placeholder.value}\n defaultValue={camelCaseToSentence(initialKeyName)}\n onSave={(value) => handleRenameNodeKey(value)}\n className=\"h-8\"\n variant=\"invisible\"\n />\n <span className=\"text-neutral dark:text-neutral-dark text-sm\">\n ({initialKeyName})\n </span>\n </div>\n </div>\n )}\n\n <div>\n <Label>{nodeTypeSelector.label}</Label>\n\n <NodeTypeSelector\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n section={section}\n />\n </div>\n </div>\n {keyPath.length > 0 && (\n <div className=\"ml-auto flex gap-2\">\n {isEdited && (\n <Button\n label={restoreButton.label.value}\n variant=\"outline\"\n color=\"text-inverse\"\n Icon={RotateCcw}\n onClick={() => removeEditedContent(dictionaryKey, keyPath)}\n >\n {restoreButton.text}\n </Button>\n )}\n <Button\n label={deleteButton.label.value}\n variant=\"outline\"\n color=\"error\"\n Icon={X}\n onClick={() => {\n addEditedContent(dictionaryKey, undefined, keyPath);\n\n const parentKeyPath: KeyPath[] = keyPath.slice(0, -1);\n setFocusedContentKeyPath(parentKeyPath);\n }}\n >\n {deleteButton.text}\n </Button>\n </div>\n )}\n </form>\n ) : (\n <span className=\"h-8\"></span>\n )}\n </>\n );\n};\n"],"names":["useEditionPanelStore","useShallow","useDictionary","editorViewContent","useEditedContentStore","getDictionaryValueByKeyPath","useMemo","getIsEditableSection","sentenceToCamelCase","jsxs","Fragment","jsx","TextEditor","Label","EditableFieldInput","camelCaseToSentence","NodeTypeSelector","Button","RotateCcw","X"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BO,MAAM,aAAkC,CAAC;AAAA,EAC9C;AAAA,EACA;AACF,MAAM;AACE,QAAA,EAAE,gBAAgB,yBAAA,IAA6BA,iDAAA;AAAA,IACnDC,QAAA,WAAW,CAAC,OAAO;AAAA,MACjB,0BAA0B,EAAE;AAAA,MAC5B,gBAAgB,EAAE;AAAA,IAAA,EAClB;AAAA,
|
|
1
|
+
{"version":3,"file":"EditorView.cjs","sources":["../../../../src/components/DictionaryFieldEditor/EditorView/EditorView.tsx"],"sourcesContent":["'use client';\n\nimport { type KeyPath, type Dictionary } from '@intlayer/core';\nimport { RotateCcw, X } from 'lucide-react';\nimport { useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { EditableFieldInput } from '../..//EditableField';\nimport {\n camelCaseToSentence,\n sentenceToCamelCase,\n} from '../../../utils/camelCase';\nimport { getDictionaryValueByKeyPath } from '../../../utils/dictionary';\nimport { Button } from '../../Button';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../../DictionaryEditor';\nimport { Label } from '../../Label';\nimport { editorViewContent } from '../editorView.content';\nimport { getIsEditableSection } from '../getIsEditableSection';\nimport { NodeTypeSelector } from '../NodeTypeSelector';\nimport { TextEditor } from './TextEditor';\n\ntype EditorViewProps = {\n dictionaryKey: string;\n dictionary: Dictionary;\n};\n\nexport const EditorView: FC<EditorViewProps> = ({\n dictionaryKey,\n dictionary,\n}) => {\n const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(\n useShallow((s) => ({\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n focusedContent: s.focusedContent,\n }))\n );\n const keyPath = focusedContent?.keyPath ?? [];\n const initialKeyName = keyPath[keyPath.length - 1]?.key ?? '';\n const { titleInput, deleteButton, nodeTypeSelector, restoreButton } =\n useDictionary(editorViewContent);\n\n const {\n editedContent,\n renameEditedContent,\n addEditedContent,\n removeEditedContent,\n } = useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n renameEditedContent: s.renameEditedContent,\n addEditedContent: s.addEditedContent,\n removeEditedContent: s.removeEditedContent,\n }))\n );\n\n const editedSection = editedContent[dictionaryKey]?.content\n ? getDictionaryValueByKeyPath(editedContent[dictionaryKey].content, keyPath)\n : undefined;\n\n const dictionarySection = getDictionaryValueByKeyPath(\n dictionary.content,\n keyPath\n );\n\n const section = editedSection ?? dictionarySection;\n\n const isEdited = useMemo(\n () =>\n editedSection &&\n JSON.stringify(editedSection) !== JSON.stringify(dictionarySection),\n [editedSection, dictionarySection]\n );\n\n const isEditableSection = getIsEditableSection(section);\n\n const handleRenameNodeKey = (keyName: string) => {\n const camelCaseSentence = sentenceToCamelCase(keyName);\n renameEditedContent(dictionaryKey, camelCaseSentence, keyPath);\n const prevKeyPath: KeyPath[] = keyPath.slice(0, -1);\n const lastKeyPath: KeyPath = keyPath[keyPath.length - 1];\n const newKeyPath: KeyPath[] = [\n ...prevKeyPath,\n { ...lastKeyPath, key: camelCaseSentence } as KeyPath,\n ];\n setFocusedContentKeyPath(newKeyPath);\n };\n\n return (\n <>\n {isEditableSection && (\n <TextEditor\n key={keyPath.join('.')}\n keyPath={keyPath}\n section={section}\n dictionaryKey={dictionaryKey}\n />\n )}\n\n {keyPath.length > 0 ? (\n <form\n className=\"bg-text text-text-dark dark:bg-text-dark dark:text-text flex w-full flex-col items-start justify-between gap-6 px-4 py-2\"\n key={JSON.stringify(focusedContent?.keyPath)}\n >\n <div className=\"flex w-full flex-wrap items-start justify-between gap-6\">\n {typeof initialKeyName === 'string' && (\n <div className=\"flex flex-col gap-3\">\n <Label>{titleInput.label}</Label>\n <div className=\"flex flex-wrap items-center gap-4\">\n <EditableFieldInput\n name=\"key\"\n aria-label=\"Key\"\n key={initialKeyName}\n placeholder={titleInput.placeholder.value}\n defaultValue={camelCaseToSentence(initialKeyName)}\n onSave={(value) => handleRenameNodeKey(value)}\n className=\"h-8\"\n variant=\"invisible\"\n />\n <span className=\"text-neutral dark:text-neutral-dark text-sm\">\n ({initialKeyName})\n </span>\n </div>\n </div>\n )}\n\n <div>\n <Label>{nodeTypeSelector.label}</Label>\n\n <NodeTypeSelector\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n section={section}\n />\n </div>\n </div>\n {keyPath.length > 0 && (\n <div className=\"ml-auto flex gap-2\">\n {isEdited && (\n <Button\n label={restoreButton.label.value}\n variant=\"outline\"\n color=\"text-inverse\"\n Icon={RotateCcw}\n onClick={() => removeEditedContent(dictionaryKey, keyPath)}\n >\n {restoreButton.text}\n </Button>\n )}\n <Button\n label={deleteButton.label.value}\n variant=\"outline\"\n color=\"error\"\n Icon={X}\n onClick={() => {\n addEditedContent(dictionaryKey, undefined, keyPath);\n\n const parentKeyPath: KeyPath[] = keyPath.slice(0, -1);\n setFocusedContentKeyPath(parentKeyPath);\n }}\n >\n {deleteButton.text}\n </Button>\n </div>\n )}\n </form>\n ) : (\n <span className=\"h-8\"></span>\n )}\n </>\n );\n};\n"],"names":["useEditionPanelStore","useShallow","useDictionary","editorViewContent","useEditedContentStore","getDictionaryValueByKeyPath","useMemo","getIsEditableSection","sentenceToCamelCase","jsxs","Fragment","jsx","TextEditor","Label","EditableFieldInput","camelCaseToSentence","NodeTypeSelector","Button","RotateCcw","X"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BO,MAAM,aAAkC,CAAC;AAAA,EAC9C;AAAA,EACA;AACF,MAAM;AACE,QAAA,EAAE,gBAAgB,yBAAA,IAA6BA,iDAAA;AAAA,IACnDC,QAAA,WAAW,CAAC,OAAO;AAAA,MACjB,0BAA0B,EAAE;AAAA,MAC5B,gBAAgB,EAAE;AAAA,IAAA,EAClB;AAAA,EACJ;AACM,QAAA,UAAU,gBAAgB,WAAW,CAAC;AAC5C,QAAM,iBAAiB,QAAQ,QAAQ,SAAS,CAAC,GAAG,OAAO;AAC3D,QAAM,EAAE,YAAY,cAAc,kBAAkB,cAAc,IAChEC,4BAAcC,qEAAiB;AAE3B,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACEC,kDAAA;AAAA,IACFH,QAAA,WAAW,CAAC,OAAO;AAAA,MACjB,eAAe,EAAE;AAAA,MACjB,qBAAqB,EAAE;AAAA,MACvB,kBAAkB,EAAE;AAAA,MACpB,qBAAqB,EAAE;AAAA,IAAA,EACvB;AAAA,EACJ;AAEM,QAAA,gBAAgB,cAAc,aAAa,GAAG,UAChDI,iBAAAA,4BAA4B,cAAc,aAAa,EAAE,SAAS,OAAO,IACz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e,QAAW,OAAO;AAElD,wBAAM,gBAA2B,QAAQ,MAAM,GAAG,EAAE;AACpD,2CAAyB,aAAa;AAAA,gBACxC;AAAA,gBAEC,UAAa,aAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UAChB,EACF,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,MA7DG,KAAK,UAAU,gBAAgB,OAAO;AAAA,IAiE7C,IAAAR,iDAAC,QAAK,EAAA,WAAU,MAAM,CAAA;AAAA,EAAA,GAE1B;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorView.mjs","sources":["../../../../src/components/DictionaryFieldEditor/EditorView/EditorView.tsx"],"sourcesContent":["'use client';\n\nimport { type KeyPath, type Dictionary } from '@intlayer/core';\nimport { RotateCcw, X } from 'lucide-react';\nimport { useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { EditableFieldInput } from '../..//EditableField';\nimport {\n camelCaseToSentence,\n sentenceToCamelCase,\n} from '../../../utils/camelCase';\nimport { getDictionaryValueByKeyPath } from '../../../utils/dictionary';\nimport { Button } from '../../Button';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../../DictionaryEditor';\nimport { Label } from '../../Label';\nimport { editorViewContent } from '../editorView.content';\nimport { getIsEditableSection } from '../getIsEditableSection';\nimport { NodeTypeSelector } from '../NodeTypeSelector';\nimport { TextEditor } from './TextEditor';\n\ntype EditorViewProps = {\n dictionaryKey: string;\n dictionary: Dictionary;\n};\n\nexport const EditorView: FC<EditorViewProps> = ({\n dictionaryKey,\n dictionary,\n}) => {\n const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(\n useShallow((s) => ({\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n focusedContent: s.focusedContent,\n }))\n );\n const keyPath = focusedContent?.keyPath ?? [];\n const initialKeyName = keyPath[keyPath.length - 1]?.key ?? '';\n const { titleInput, deleteButton, nodeTypeSelector, restoreButton } =\n useDictionary(editorViewContent);\n\n const {\n editedContent,\n renameEditedContent,\n addEditedContent,\n removeEditedContent,\n } = useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n renameEditedContent: s.renameEditedContent,\n addEditedContent: s.addEditedContent,\n removeEditedContent: s.removeEditedContent,\n }))\n );\n\n const editedSection = editedContent[dictionaryKey]?.content\n ? getDictionaryValueByKeyPath(editedContent[dictionaryKey].content, keyPath)\n : undefined;\n\n const dictionarySection = getDictionaryValueByKeyPath(\n dictionary.content,\n keyPath\n );\n\n const section = editedSection ?? dictionarySection;\n\n const isEdited = useMemo(\n () =>\n editedSection &&\n JSON.stringify(editedSection) !== JSON.stringify(dictionarySection),\n [editedSection, dictionarySection]\n );\n\n const isEditableSection = getIsEditableSection(section);\n\n const handleRenameNodeKey = (keyName: string) => {\n const camelCaseSentence = sentenceToCamelCase(keyName);\n renameEditedContent(dictionaryKey, camelCaseSentence, keyPath);\n const prevKeyPath: KeyPath[] = keyPath.slice(0, -1);\n const lastKeyPath: KeyPath = keyPath[keyPath.length - 1];\n const newKeyPath: KeyPath[] = [\n ...prevKeyPath,\n { ...lastKeyPath, key: camelCaseSentence } as KeyPath,\n ];\n setFocusedContentKeyPath(newKeyPath);\n };\n\n return (\n <>\n {isEditableSection && (\n <TextEditor\n key={keyPath.join('.')}\n keyPath={keyPath}\n section={section}\n dictionaryKey={dictionaryKey}\n />\n )}\n\n {keyPath.length > 0 ? (\n <form\n className=\"bg-text text-text-dark dark:bg-text-dark dark:text-text flex w-full flex-col items-start justify-between gap-6 px-4 py-2\"\n key={JSON.stringify(focusedContent?.keyPath)}\n >\n <div className=\"flex w-full flex-wrap items-start justify-between gap-6\">\n {typeof initialKeyName === 'string' && (\n <div className=\"flex flex-col gap-3\">\n <Label>{titleInput.label}</Label>\n <div className=\"flex flex-wrap items-center gap-4\">\n <EditableFieldInput\n name=\"key\"\n aria-label=\"Key\"\n key={initialKeyName}\n placeholder={titleInput.placeholder.value}\n defaultValue={camelCaseToSentence(initialKeyName)}\n onSave={(value) => handleRenameNodeKey(value)}\n className=\"h-8\"\n variant=\"invisible\"\n />\n <span className=\"text-neutral dark:text-neutral-dark text-sm\">\n ({initialKeyName})\n </span>\n </div>\n </div>\n )}\n\n <div>\n <Label>{nodeTypeSelector.label}</Label>\n\n <NodeTypeSelector\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n section={section}\n />\n </div>\n </div>\n {keyPath.length > 0 && (\n <div className=\"ml-auto flex gap-2\">\n {isEdited && (\n <Button\n label={restoreButton.label.value}\n variant=\"outline\"\n color=\"text-inverse\"\n Icon={RotateCcw}\n onClick={() => removeEditedContent(dictionaryKey, keyPath)}\n >\n {restoreButton.text}\n </Button>\n )}\n <Button\n label={deleteButton.label.value}\n variant=\"outline\"\n color=\"error\"\n Icon={X}\n onClick={() => {\n addEditedContent(dictionaryKey, undefined, keyPath);\n\n const parentKeyPath: KeyPath[] = keyPath.slice(0, -1);\n setFocusedContentKeyPath(parentKeyPath);\n }}\n >\n {deleteButton.text}\n </Button>\n </div>\n )}\n </form>\n ) : (\n <span className=\"h-8\"></span>\n )}\n </>\n );\n};\n"],"names":["jsxs","Fragment","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BO,MAAM,aAAkC,CAAC;AAAA,EAC9C;AAAA,EACA;AACF,MAAM;AACE,QAAA,EAAE,gBAAgB,yBAAA,IAA6B;AAAA,IACnD,WAAW,CAAC,OAAO;AAAA,MACjB,0BAA0B,EAAE;AAAA,MAC5B,gBAAgB,EAAE;AAAA,IAAA,EAClB;AAAA,
|
|
1
|
+
{"version":3,"file":"EditorView.mjs","sources":["../../../../src/components/DictionaryFieldEditor/EditorView/EditorView.tsx"],"sourcesContent":["'use client';\n\nimport { type KeyPath, type Dictionary } from '@intlayer/core';\nimport { RotateCcw, X } from 'lucide-react';\nimport { useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { EditableFieldInput } from '../..//EditableField';\nimport {\n camelCaseToSentence,\n sentenceToCamelCase,\n} from '../../../utils/camelCase';\nimport { getDictionaryValueByKeyPath } from '../../../utils/dictionary';\nimport { Button } from '../../Button';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../../DictionaryEditor';\nimport { Label } from '../../Label';\nimport { editorViewContent } from '../editorView.content';\nimport { getIsEditableSection } from '../getIsEditableSection';\nimport { NodeTypeSelector } from '../NodeTypeSelector';\nimport { TextEditor } from './TextEditor';\n\ntype EditorViewProps = {\n dictionaryKey: string;\n dictionary: Dictionary;\n};\n\nexport const EditorView: FC<EditorViewProps> = ({\n dictionaryKey,\n dictionary,\n}) => {\n const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(\n useShallow((s) => ({\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n focusedContent: s.focusedContent,\n }))\n );\n const keyPath = focusedContent?.keyPath ?? [];\n const initialKeyName = keyPath[keyPath.length - 1]?.key ?? '';\n const { titleInput, deleteButton, nodeTypeSelector, restoreButton } =\n useDictionary(editorViewContent);\n\n const {\n editedContent,\n renameEditedContent,\n addEditedContent,\n removeEditedContent,\n } = useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n renameEditedContent: s.renameEditedContent,\n addEditedContent: s.addEditedContent,\n removeEditedContent: s.removeEditedContent,\n }))\n );\n\n const editedSection = editedContent[dictionaryKey]?.content\n ? getDictionaryValueByKeyPath(editedContent[dictionaryKey].content, keyPath)\n : undefined;\n\n const dictionarySection = getDictionaryValueByKeyPath(\n dictionary.content,\n keyPath\n );\n\n const section = editedSection ?? dictionarySection;\n\n const isEdited = useMemo(\n () =>\n editedSection &&\n JSON.stringify(editedSection) !== JSON.stringify(dictionarySection),\n [editedSection, dictionarySection]\n );\n\n const isEditableSection = getIsEditableSection(section);\n\n const handleRenameNodeKey = (keyName: string) => {\n const camelCaseSentence = sentenceToCamelCase(keyName);\n renameEditedContent(dictionaryKey, camelCaseSentence, keyPath);\n const prevKeyPath: KeyPath[] = keyPath.slice(0, -1);\n const lastKeyPath: KeyPath = keyPath[keyPath.length - 1];\n const newKeyPath: KeyPath[] = [\n ...prevKeyPath,\n { ...lastKeyPath, key: camelCaseSentence } as KeyPath,\n ];\n setFocusedContentKeyPath(newKeyPath);\n };\n\n return (\n <>\n {isEditableSection && (\n <TextEditor\n key={keyPath.join('.')}\n keyPath={keyPath}\n section={section}\n dictionaryKey={dictionaryKey}\n />\n )}\n\n {keyPath.length > 0 ? (\n <form\n className=\"bg-text text-text-dark dark:bg-text-dark dark:text-text flex w-full flex-col items-start justify-between gap-6 px-4 py-2\"\n key={JSON.stringify(focusedContent?.keyPath)}\n >\n <div className=\"flex w-full flex-wrap items-start justify-between gap-6\">\n {typeof initialKeyName === 'string' && (\n <div className=\"flex flex-col gap-3\">\n <Label>{titleInput.label}</Label>\n <div className=\"flex flex-wrap items-center gap-4\">\n <EditableFieldInput\n name=\"key\"\n aria-label=\"Key\"\n key={initialKeyName}\n placeholder={titleInput.placeholder.value}\n defaultValue={camelCaseToSentence(initialKeyName)}\n onSave={(value) => handleRenameNodeKey(value)}\n className=\"h-8\"\n variant=\"invisible\"\n />\n <span className=\"text-neutral dark:text-neutral-dark text-sm\">\n ({initialKeyName})\n </span>\n </div>\n </div>\n )}\n\n <div>\n <Label>{nodeTypeSelector.label}</Label>\n\n <NodeTypeSelector\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n section={section}\n />\n </div>\n </div>\n {keyPath.length > 0 && (\n <div className=\"ml-auto flex gap-2\">\n {isEdited && (\n <Button\n label={restoreButton.label.value}\n variant=\"outline\"\n color=\"text-inverse\"\n Icon={RotateCcw}\n onClick={() => removeEditedContent(dictionaryKey, keyPath)}\n >\n {restoreButton.text}\n </Button>\n )}\n <Button\n label={deleteButton.label.value}\n variant=\"outline\"\n color=\"error\"\n Icon={X}\n onClick={() => {\n addEditedContent(dictionaryKey, undefined, keyPath);\n\n const parentKeyPath: KeyPath[] = keyPath.slice(0, -1);\n setFocusedContentKeyPath(parentKeyPath);\n }}\n >\n {deleteButton.text}\n </Button>\n </div>\n )}\n </form>\n ) : (\n <span className=\"h-8\"></span>\n )}\n </>\n );\n};\n"],"names":["jsxs","Fragment","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BO,MAAM,aAAkC,CAAC;AAAA,EAC9C;AAAA,EACA;AACF,MAAM;AACE,QAAA,EAAE,gBAAgB,yBAAA,IAA6B;AAAA,IACnD,WAAW,CAAC,OAAO;AAAA,MACjB,0BAA0B,EAAE;AAAA,MAC5B,gBAAgB,EAAE;AAAA,IAAA,EAClB;AAAA,EACJ;AACM,QAAA,UAAU,gBAAgB,WAAW,CAAC;AAC5C,QAAM,iBAAiB,QAAQ,QAAQ,SAAS,CAAC,GAAG,OAAO;AAC3D,QAAM,EAAE,YAAY,cAAc,kBAAkB,cAAc,IAChE,cAAc,iBAAiB;AAE3B,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACE;AAAA,IACF,WAAW,CAAC,OAAO;AAAA,MACjB,eAAe,EAAE;AAAA,MACjB,qBAAqB,EAAE;AAAA,MACvB,kBAAkB,EAAE;AAAA,MACpB,qBAAqB,EAAE;AAAA,IAAA,EACvB;AAAA,EACJ;AAEM,QAAA,gBAAgB,cAAc,aAAa,GAAG,UAChD,4BAA4B,cAAc,aAAa,EAAE,SAAS,OAAO,IACzE;AAEJ,QAAM,oBAAoB;AAAA,IACxB,WAAW;AAAA,IACX;AAAA,EACF;AAEA,QAAM,UAAU,iBAAiB;AAEjC,QAAM,WAAW;AAAA,IACf,MACE,iBACA,KAAK,UAAU,aAAa,MAAM,KAAK,UAAU,iBAAiB;AAAA,IACpE,CAAC,eAAe,iBAAiB;AAAA,EACnC;AAEM,QAAA,oBAAoB,qBAAqB,OAAO;AAEhD,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