@intlayer/design-system 3.5.0 → 3.5.3
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/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.d.ts +10 -10
- 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.d.ts +5 -5
- 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.d.ts +7 -7
- 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.d.ts +13 -13
- 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.d.ts +11 -11
- 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.map +1 -1
- 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 +11 -4
- package/dist/components/Link/Link.cjs.map +1 -1
- package/dist/components/Link/Link.d.ts +2 -1
- package/dist/components/Link/Link.d.ts.map +1 -1
- package/dist/components/Link/Link.mjs +11 -4
- 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 +9 -1
- package/dist/components/MarkDownRender/index.cjs.map +1 -1
- package/dist/components/MarkDownRender/index.d.ts.map +1 -1
- package/dist/components/MarkDownRender/index.mjs +9 -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 +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationViewNode.cjs","sources":["../../../../src/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.tsx"],"sourcesContent":["import { getConfiguration } from '@intlayer/config/client';\nimport {\n type EnumerationContent,\n NodeType,\n type KeyPath,\n type DictionaryValue,\n isSameKeyPath,\n} from '@intlayer/core';\nimport { ChevronRight, Plus } from 'lucide-react';\nimport { useCallback, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { camelCaseToSentence } from '../../../utils/camelCase';\nimport {\n getDictionaryValueByKeyPath,\n getSectionType,\n} from '../../../utils/dictionary';\nimport { Accordion } from '../../Accordion';\nimport { Button } from '../../Button';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../../DictionaryEditor';\nimport { getIsEditableSection } from '../getIsEditableSection';\nimport { navigationViewContent } from './navigationViewNode.content';\n\nexport const traceKeys: string[] = ['filePath', 'id', 'nodeType'];\n\nexport type NodeWrapperProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: DictionaryValue;\n};\n\nexport const NavigationViewNode: FC<NodeWrapperProps> = ({\n section: sectionProp,\n keyPath,\n dictionaryKey,\n}) => {\n const { locales } = getConfiguration().internationalization;\n const section = getDictionaryValueByKeyPath(sectionProp, keyPath);\n const addEditedContent = useEditedContentStore(\n useShallow((s) => s.addEditedContent)\n );\n const { setFocusedContentKeyPath, focusedContent } = useEditionPanelStore(\n useShallow((s) => ({\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n focusedContent: s.focusedContent,\n }))\n );\n const {\n addNewElement,\n addNewField,\n goToElement,\n goToField,\n goToEnumeration,\n goToTranslation,\n } = useDictionary(navigationViewContent);\n const nodeType = getSectionType(section);\n const isEditableSection = getIsEditableSection(section);\n const getIsSelected = useCallback(\n (keyPath: KeyPath[]) =>\n (focusedContent?.keyPath?.length ?? 0) > 0 &&\n isSameKeyPath(keyPath, focusedContent?.keyPath ?? []),\n [focusedContent?.keyPath]\n );\n\n if (isEditableSection) return <>-</>;\n\n if (!section) return <>-</>;\n\n if (typeof section === 'object') {\n if (nodeType === NodeType.ReactNode) {\n return <>React Node</>;\n }\n\n if (nodeType === NodeType.Translation) {\n return (\n <div className=\"flex flex-col justify-between gap-2\">\n {locales.map((translationKey) => {\n const childKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Translation, key: translationKey },\n ];\n const subSection = getDictionaryValueByKeyPath(\n sectionProp,\n childKeyPath\n );\n const isEditableSubSection = getIsEditableSection(subSection);\n\n if (isEditableSubSection) {\n return (\n <Button\n label={`${goToTranslation.label.value} ${translationKey}`}\n key={translationKey}\n isActive={getIsSelected(childKeyPath)}\n variant=\"hoverable\"\n color=\"text\"\n className=\"w-full\"\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n IconRight={ChevronRight}\n >\n {translationKey}\n </Button>\n );\n }\n\n return (\n <Accordion\n key={translationKey}\n identifier={translationKey}\n label={`${goToTranslation.label.value} ${translationKey}`}\n isActive={getIsSelected(childKeyPath)}\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n header={translationKey}\n >\n <div className=\"flex w-full max-w-full\">\n <div className=\"flex-1 pl-10\">\n <NavigationViewNode\n keyPath={childKeyPath}\n section={sectionProp}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </div>\n </Accordion>\n );\n })}\n </div>\n );\n }\n\n if (nodeType === NodeType.Enumeration) {\n return (\n <div className=\"flex flex-col justify-between gap-2\">\n {Object.keys(\n (section as EnumerationContent<DictionaryValue>)[\n NodeType.Enumeration\n ]\n ).map((key) => {\n const childKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Enumeration, key },\n ];\n const subSection = getDictionaryValueByKeyPath(\n sectionProp,\n childKeyPath\n );\n const isEditableSubSection = getIsEditableSection(subSection);\n\n if (isEditableSubSection) {\n return (\n <Button\n label={`${goToEnumeration.label.value} ${key}`}\n key={key}\n isActive={getIsSelected(childKeyPath)}\n variant=\"hoverable\"\n color=\"text\"\n className=\"w-full\"\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n IconRight={ChevronRight}\n >\n {key}\n </Button>\n );\n }\n\n return (\n <Accordion\n key={key}\n identifier={key}\n label={`${goToEnumeration.label.value} ${key}`}\n isActive={getIsSelected(childKeyPath)}\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n header={key}\n >\n <div className=\"flex w-full max-w-full\">\n <div className=\"flex-1 pl-10\">\n <NavigationViewNode\n keyPath={childKeyPath}\n section={sectionProp}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </div>\n </Accordion>\n );\n })}\n </div>\n );\n }\n\n if (nodeType === NodeType.Array) {\n return (\n <div className=\"flex flex-col justify-between gap-2\">\n {(section as DictionaryValue[]).map((subSection, index) => {\n const childKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Array, key: index },\n ];\n\n const isEditableSubSection = getIsEditableSection(subSection);\n\n if (isEditableSubSection) {\n return (\n <Button\n label={`${goToElement.label.value} ${index}`}\n key={`${index}`}\n isActive={getIsSelected(childKeyPath)}\n variant=\"hoverable\"\n color=\"text\"\n className=\"w-full\"\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n IconRight={ChevronRight}\n >\n {index}\n </Button>\n );\n }\n\n return (\n <Accordion\n key={`${index}`}\n identifier={`${index}`}\n label={`${goToElement.label.value} ${index}`}\n isActive={getIsSelected(childKeyPath)}\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n header={index}\n >\n <div className=\"flex w-full max-w-full\">\n <div className=\"flex-1 pl-10\">\n <NavigationViewNode\n keyPath={childKeyPath}\n section={sectionProp}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </div>\n </Accordion>\n );\n })}\n\n <Button\n label={addNewElement.label.value}\n variant=\"hoverable\"\n color=\"neutral\"\n textAlign=\"left\"\n onClick={() => {\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n {\n type: NodeType.Array,\n key: (section as DictionaryValue[]).length,\n },\n ];\n addEditedContent(dictionaryKey, {}, newKeyPath, false);\n setFocusedContentKeyPath(newKeyPath);\n }}\n Icon={Plus}\n >\n {addNewElement.text}\n </Button>\n </div>\n );\n }\n\n const sectionArray = Object.keys(section);\n return (\n <div className=\"flex w-full max-w-full flex-col justify-between gap-2\">\n {sectionArray.map((key) => {\n const childKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Object, key },\n ];\n const subSection = getDictionaryValueByKeyPath(\n sectionProp,\n childKeyPath\n );\n const isEditableSubSection = getIsEditableSection(subSection);\n\n if (isEditableSubSection) {\n return (\n <Button\n label={`${goToField.label.value} ${key}`}\n key={key}\n isActive={getIsSelected(childKeyPath)}\n variant=\"hoverable\"\n color=\"text\"\n className=\"w-full\"\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n IconRight={ChevronRight}\n >\n {camelCaseToSentence(key)}\n </Button>\n );\n }\n\n return (\n <Accordion\n key={key}\n identifier={key}\n label={`${goToField.label.value} ${key}`}\n isActive={getIsSelected(childKeyPath)}\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n header={camelCaseToSentence(key)}\n >\n <div className=\"flex w-full max-w-full\">\n <div className=\"flex-1 pl-10\">\n <NavigationViewNode\n keyPath={childKeyPath}\n section={sectionProp}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </div>\n </Accordion>\n );\n })}\n\n <Button\n label={addNewField.label.value}\n variant=\"hoverable\"\n color=\"neutral\"\n textAlign=\"left\"\n onClick={() => {\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Object, key: 'newField' },\n ];\n addEditedContent(dictionaryKey, {}, newKeyPath, false);\n setFocusedContentKeyPath(newKeyPath);\n }}\n Icon={Plus}\n >\n {addNewField.text}\n </Button>\n </div>\n );\n }\n\n return (\n <>\n Error loading section --\n {nodeType}\n --\n {JSON.stringify(section)}\n --\n {JSON.stringify(keyPath)}\n </>\n );\n};\n"],"names":["getConfiguration","getDictionaryValueByKeyPath","useEditedContentStore","useShallow","useEditionPanelStore","useDictionary","navigationViewContent","getSectionType","getIsEditableSection","useCallback","keyPath","isSameKeyPath","jsx","Fragment","NodeType","Button","ChevronRight","Accordion","jsxs","Plus","camelCaseToSentence"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BO,MAAM,YAAsB,CAAC,YAAY,MAAM,UAAU;AAQzD,MAAM,qBAA2C,CAAC;AAAA,EACvD,SAAS;AAAA,EACT;AAAA,EACA;AACF,MAAM;AACJ,QAAM,EAAE,QAAA,IAAYA,OAAA,iBAAA,EAAmB;AACjC,QAAA,UAAUC,iBAAAA,4BA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;AAAA,eAEJ,EACF,CAAA;AAAA,UAAA;AAAA,UAfK;AAAA,QAAA;AAAA,MAgBP,CAEH;AAAA,MAEDA,2BAAA,kBAAA;AAAA,QAACG,yBAAA;AAAA,QAAA;AAAA,UACC,OAAO,YAAY,MAAM;AAAA,UACzB,SAAQ;AAAA,UACR,OAAM;AAAA,UACN,WAAU;AAAA,UACV,SAAS,MAAM;AACb,kBAAM,aAAwB;AAAA,cAC5B,GAAG;AAAA,cACH,EAAE,MAAMD,KAAS,SAAA,QAAQ,KAAK,WAAW;AAAA,YAAA;AAE3C,6BAAiB,eAAe,CAAA,GAAI,YAAY,KAAK;AACrD,qCAAyB,UAAU;AAAA,UACrC;AAAA,UACA,MAAMK,YAAA;AAAA,UAEL,UAAY,YAAA;AAAA,QAAA;AAAA,MACf;AAAA,IACF,EAAA,CAAA;AAAA,EAEJ;AAEA,SACID,2BAAA,kBAAA,KAAAL,uCAAA,EAAA,UAAA;AAAA,IAAA;AAAA,IAEC;AAAA,IAAS;AAAA,IAET,KAAK,UAAU,OAAO;AAAA,IAAE;AAAA,IAExB,KAAK,UAAU,OAAO;AAAA,EACzB,EAAA,CAAA;AAEJ;;;"}
|
|
1
|
+
{"version":3,"file":"NavigationViewNode.cjs","sources":["../../../../src/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.tsx"],"sourcesContent":["import { getConfiguration } from '@intlayer/config/client';\nimport {\n type EnumerationContent,\n NodeType,\n type KeyPath,\n type DictionaryValue,\n isSameKeyPath,\n} from '@intlayer/core';\nimport { ChevronRight, Plus } from 'lucide-react';\nimport { useCallback, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { camelCaseToSentence } from '../../../utils/camelCase';\nimport {\n getDictionaryValueByKeyPath,\n getSectionType,\n} from '../../../utils/dictionary';\nimport { Accordion } from '../../Accordion';\nimport { Button } from '../../Button';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../../DictionaryEditor';\nimport { getIsEditableSection } from '../getIsEditableSection';\nimport { navigationViewContent } from './navigationViewNode.content';\n\nexport const traceKeys: string[] = ['filePath', 'id', 'nodeType'];\n\nexport type NodeWrapperProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: DictionaryValue;\n};\n\nexport const NavigationViewNode: FC<NodeWrapperProps> = ({\n section: sectionProp,\n keyPath,\n dictionaryKey,\n}) => {\n const { locales } = getConfiguration().internationalization;\n const section = getDictionaryValueByKeyPath(sectionProp, keyPath);\n const addEditedContent = useEditedContentStore(\n useShallow((s) => s.addEditedContent)\n );\n const { setFocusedContentKeyPath, focusedContent } = useEditionPanelStore(\n useShallow((s) => ({\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n focusedContent: s.focusedContent,\n }))\n );\n const {\n addNewElement,\n addNewField,\n goToElement,\n goToField,\n goToEnumeration,\n goToTranslation,\n } = useDictionary(navigationViewContent);\n const nodeType = getSectionType(section);\n const isEditableSection = getIsEditableSection(section);\n const getIsSelected = useCallback(\n (keyPath: KeyPath[]) =>\n (focusedContent?.keyPath?.length ?? 0) > 0 &&\n isSameKeyPath(keyPath, focusedContent?.keyPath ?? []),\n [focusedContent?.keyPath]\n );\n\n if (isEditableSection) return <>-</>;\n\n if (!section) return <>-</>;\n\n if (typeof section === 'object') {\n if (nodeType === NodeType.ReactNode) {\n return <>React Node</>;\n }\n\n if (nodeType === NodeType.Translation) {\n return (\n <div className=\"flex flex-col justify-between gap-2\">\n {locales.map((translationKey) => {\n const childKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Translation, key: translationKey },\n ];\n const subSection = getDictionaryValueByKeyPath(\n sectionProp,\n childKeyPath\n );\n const isEditableSubSection = getIsEditableSection(subSection);\n\n if (isEditableSubSection) {\n return (\n <Button\n label={`${goToTranslation.label.value} ${translationKey}`}\n key={translationKey}\n isActive={getIsSelected(childKeyPath)}\n variant=\"hoverable\"\n color=\"text\"\n className=\"w-full\"\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n IconRight={ChevronRight}\n >\n {translationKey}\n </Button>\n );\n }\n\n return (\n <Accordion\n key={translationKey}\n identifier={translationKey}\n label={`${goToTranslation.label.value} ${translationKey}`}\n isActive={getIsSelected(childKeyPath)}\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n header={translationKey}\n >\n <div className=\"flex w-full max-w-full\">\n <div className=\"flex-1 pl-10\">\n <NavigationViewNode\n keyPath={childKeyPath}\n section={sectionProp}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </div>\n </Accordion>\n );\n })}\n </div>\n );\n }\n\n if (nodeType === NodeType.Enumeration) {\n return (\n <div className=\"flex flex-col justify-between gap-2\">\n {Object.keys(\n (section as EnumerationContent<DictionaryValue>)[\n NodeType.Enumeration\n ]\n ).map((key) => {\n const childKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Enumeration, key },\n ];\n const subSection = getDictionaryValueByKeyPath(\n sectionProp,\n childKeyPath\n );\n const isEditableSubSection = getIsEditableSection(subSection);\n\n if (isEditableSubSection) {\n return (\n <Button\n label={`${goToEnumeration.label.value} ${key}`}\n key={key}\n isActive={getIsSelected(childKeyPath)}\n variant=\"hoverable\"\n color=\"text\"\n className=\"w-full\"\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n IconRight={ChevronRight}\n >\n {key}\n </Button>\n );\n }\n\n return (\n <Accordion\n key={key}\n identifier={key}\n label={`${goToEnumeration.label.value} ${key}`}\n isActive={getIsSelected(childKeyPath)}\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n header={key}\n >\n <div className=\"flex w-full max-w-full\">\n <div className=\"flex-1 pl-10\">\n <NavigationViewNode\n keyPath={childKeyPath}\n section={sectionProp}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </div>\n </Accordion>\n );\n })}\n </div>\n );\n }\n\n if (nodeType === NodeType.Array) {\n return (\n <div className=\"flex flex-col justify-between gap-2\">\n {(section as DictionaryValue[]).map((subSection, index) => {\n const childKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Array, key: index },\n ];\n\n const isEditableSubSection = getIsEditableSection(subSection);\n\n if (isEditableSubSection) {\n return (\n <Button\n label={`${goToElement.label.value} ${index}`}\n key={`${index}`}\n isActive={getIsSelected(childKeyPath)}\n variant=\"hoverable\"\n color=\"text\"\n className=\"w-full\"\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n IconRight={ChevronRight}\n >\n {index}\n </Button>\n );\n }\n\n return (\n <Accordion\n key={`${index}`}\n identifier={`${index}`}\n label={`${goToElement.label.value} ${index}`}\n isActive={getIsSelected(childKeyPath)}\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n header={index}\n >\n <div className=\"flex w-full max-w-full\">\n <div className=\"flex-1 pl-10\">\n <NavigationViewNode\n keyPath={childKeyPath}\n section={sectionProp}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </div>\n </Accordion>\n );\n })}\n\n <Button\n label={addNewElement.label.value}\n variant=\"hoverable\"\n color=\"neutral\"\n textAlign=\"left\"\n onClick={() => {\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n {\n type: NodeType.Array,\n key: (section as DictionaryValue[]).length,\n },\n ];\n addEditedContent(dictionaryKey, {}, newKeyPath, false);\n setFocusedContentKeyPath(newKeyPath);\n }}\n Icon={Plus}\n >\n {addNewElement.text}\n </Button>\n </div>\n );\n }\n\n const sectionArray = Object.keys(section);\n return (\n <div className=\"flex w-full max-w-full flex-col justify-between gap-2\">\n {sectionArray.map((key) => {\n const childKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Object, key },\n ];\n const subSection = getDictionaryValueByKeyPath(\n sectionProp,\n childKeyPath\n );\n const isEditableSubSection = getIsEditableSection(subSection);\n\n if (isEditableSubSection) {\n return (\n <Button\n label={`${goToField.label.value} ${key}`}\n key={key}\n isActive={getIsSelected(childKeyPath)}\n variant=\"hoverable\"\n color=\"text\"\n className=\"w-full\"\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n IconRight={ChevronRight}\n >\n {camelCaseToSentence(key)}\n </Button>\n );\n }\n\n return (\n <Accordion\n key={key}\n identifier={key}\n label={`${goToField.label.value} ${key}`}\n isActive={getIsSelected(childKeyPath)}\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n header={camelCaseToSentence(key)}\n >\n <div className=\"flex w-full max-w-full\">\n <div className=\"flex-1 pl-10\">\n <NavigationViewNode\n keyPath={childKeyPath}\n section={sectionProp}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </div>\n </Accordion>\n );\n })}\n\n <Button\n label={addNewField.label.value}\n variant=\"hoverable\"\n color=\"neutral\"\n textAlign=\"left\"\n onClick={() => {\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Object, key: 'newField' },\n ];\n addEditedContent(dictionaryKey, {}, newKeyPath, false);\n setFocusedContentKeyPath(newKeyPath);\n }}\n Icon={Plus}\n >\n {addNewField.text}\n </Button>\n </div>\n );\n }\n\n return (\n <>\n Error loading section --\n {nodeType}\n --\n {JSON.stringify(section)}\n --\n {JSON.stringify(keyPath)}\n </>\n );\n};\n"],"names":["getConfiguration","getDictionaryValueByKeyPath","useEditedContentStore","useShallow","useEditionPanelStore","useDictionary","navigationViewContent","getSectionType","getIsEditableSection","useCallback","keyPath","isSameKeyPath","jsx","Fragment","NodeType","Button","ChevronRight","Accordion","jsxs","Plus","camelCaseToSentence"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BO,MAAM,YAAsB,CAAC,YAAY,MAAM,UAAU;AAQzD,MAAM,qBAA2C,CAAC;AAAA,EACvD,SAAS;AAAA,EACT;AAAA,EACA;AACF,MAAM;AACJ,QAAM,EAAE,QAAA,IAAYA,OAAA,iBAAA,EAAmB;AACjC,QAAA,UAAUC,iBAAAA,4BAA4B,aAAa,OAAO;AAChE,QAAM,mBAAmBC,kDAAA;AAAA,IACvBC,mBAAW,CAAC,MAAM,EAAE,gBAAgB;AAAA,EACtC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UACzB,SAAQ;AAAA,UACR,OAAM;AAAA,UACN,WAAU;AAAA,UACV,SAAS,MAAM;AACb,kBAAM,aAAwB;AAAA,cAC5B,GAAG;AAAA,cACH,EAAE,MAAMD,KAAAA,SAAS,QAAQ,KAAK,WAAW;AAAA,YAC3C;AACA,6BAAiB,eAAe,IAAI,YAAY,KAAK;AACrD,qCAAyB,UAAU;AAAA,UACrC;AAAA,UACA,MAAMK,YAAA;AAAA,UAEL,UAAY,YAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACf,GACF;AAAA,EAAA;AAIJ,SACID,2BAAA,kBAAA,KAAAL,uCAAA,EAAA,UAAA;AAAA,IAAA;AAAA,IAEC;AAAA,IAAS;AAAA,IAET,KAAK,UAAU,OAAO;AAAA,IAAE;AAAA,IAExB,KAAK,UAAU,OAAO;AAAA,EAAA,GACzB;AAEJ;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationViewNode.mjs","sources":["../../../../src/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.tsx"],"sourcesContent":["import { getConfiguration } from '@intlayer/config/client';\nimport {\n type EnumerationContent,\n NodeType,\n type KeyPath,\n type DictionaryValue,\n isSameKeyPath,\n} from '@intlayer/core';\nimport { ChevronRight, Plus } from 'lucide-react';\nimport { useCallback, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { camelCaseToSentence } from '../../../utils/camelCase';\nimport {\n getDictionaryValueByKeyPath,\n getSectionType,\n} from '../../../utils/dictionary';\nimport { Accordion } from '../../Accordion';\nimport { Button } from '../../Button';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../../DictionaryEditor';\nimport { getIsEditableSection } from '../getIsEditableSection';\nimport { navigationViewContent } from './navigationViewNode.content';\n\nexport const traceKeys: string[] = ['filePath', 'id', 'nodeType'];\n\nexport type NodeWrapperProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: DictionaryValue;\n};\n\nexport const NavigationViewNode: FC<NodeWrapperProps> = ({\n section: sectionProp,\n keyPath,\n dictionaryKey,\n}) => {\n const { locales } = getConfiguration().internationalization;\n const section = getDictionaryValueByKeyPath(sectionProp, keyPath);\n const addEditedContent = useEditedContentStore(\n useShallow((s) => s.addEditedContent)\n );\n const { setFocusedContentKeyPath, focusedContent } = useEditionPanelStore(\n useShallow((s) => ({\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n focusedContent: s.focusedContent,\n }))\n );\n const {\n addNewElement,\n addNewField,\n goToElement,\n goToField,\n goToEnumeration,\n goToTranslation,\n } = useDictionary(navigationViewContent);\n const nodeType = getSectionType(section);\n const isEditableSection = getIsEditableSection(section);\n const getIsSelected = useCallback(\n (keyPath: KeyPath[]) =>\n (focusedContent?.keyPath?.length ?? 0) > 0 &&\n isSameKeyPath(keyPath, focusedContent?.keyPath ?? []),\n [focusedContent?.keyPath]\n );\n\n if (isEditableSection) return <>-</>;\n\n if (!section) return <>-</>;\n\n if (typeof section === 'object') {\n if (nodeType === NodeType.ReactNode) {\n return <>React Node</>;\n }\n\n if (nodeType === NodeType.Translation) {\n return (\n <div className=\"flex flex-col justify-between gap-2\">\n {locales.map((translationKey) => {\n const childKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Translation, key: translationKey },\n ];\n const subSection = getDictionaryValueByKeyPath(\n sectionProp,\n childKeyPath\n );\n const isEditableSubSection = getIsEditableSection(subSection);\n\n if (isEditableSubSection) {\n return (\n <Button\n label={`${goToTranslation.label.value} ${translationKey}`}\n key={translationKey}\n isActive={getIsSelected(childKeyPath)}\n variant=\"hoverable\"\n color=\"text\"\n className=\"w-full\"\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n IconRight={ChevronRight}\n >\n {translationKey}\n </Button>\n );\n }\n\n return (\n <Accordion\n key={translationKey}\n identifier={translationKey}\n label={`${goToTranslation.label.value} ${translationKey}`}\n isActive={getIsSelected(childKeyPath)}\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n header={translationKey}\n >\n <div className=\"flex w-full max-w-full\">\n <div className=\"flex-1 pl-10\">\n <NavigationViewNode\n keyPath={childKeyPath}\n section={sectionProp}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </div>\n </Accordion>\n );\n })}\n </div>\n );\n }\n\n if (nodeType === NodeType.Enumeration) {\n return (\n <div className=\"flex flex-col justify-between gap-2\">\n {Object.keys(\n (section as EnumerationContent<DictionaryValue>)[\n NodeType.Enumeration\n ]\n ).map((key) => {\n const childKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Enumeration, key },\n ];\n const subSection = getDictionaryValueByKeyPath(\n sectionProp,\n childKeyPath\n );\n const isEditableSubSection = getIsEditableSection(subSection);\n\n if (isEditableSubSection) {\n return (\n <Button\n label={`${goToEnumeration.label.value} ${key}`}\n key={key}\n isActive={getIsSelected(childKeyPath)}\n variant=\"hoverable\"\n color=\"text\"\n className=\"w-full\"\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n IconRight={ChevronRight}\n >\n {key}\n </Button>\n );\n }\n\n return (\n <Accordion\n key={key}\n identifier={key}\n label={`${goToEnumeration.label.value} ${key}`}\n isActive={getIsSelected(childKeyPath)}\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n header={key}\n >\n <div className=\"flex w-full max-w-full\">\n <div className=\"flex-1 pl-10\">\n <NavigationViewNode\n keyPath={childKeyPath}\n section={sectionProp}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </div>\n </Accordion>\n );\n })}\n </div>\n );\n }\n\n if (nodeType === NodeType.Array) {\n return (\n <div className=\"flex flex-col justify-between gap-2\">\n {(section as DictionaryValue[]).map((subSection, index) => {\n const childKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Array, key: index },\n ];\n\n const isEditableSubSection = getIsEditableSection(subSection);\n\n if (isEditableSubSection) {\n return (\n <Button\n label={`${goToElement.label.value} ${index}`}\n key={`${index}`}\n isActive={getIsSelected(childKeyPath)}\n variant=\"hoverable\"\n color=\"text\"\n className=\"w-full\"\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n IconRight={ChevronRight}\n >\n {index}\n </Button>\n );\n }\n\n return (\n <Accordion\n key={`${index}`}\n identifier={`${index}`}\n label={`${goToElement.label.value} ${index}`}\n isActive={getIsSelected(childKeyPath)}\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n header={index}\n >\n <div className=\"flex w-full max-w-full\">\n <div className=\"flex-1 pl-10\">\n <NavigationViewNode\n keyPath={childKeyPath}\n section={sectionProp}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </div>\n </Accordion>\n );\n })}\n\n <Button\n label={addNewElement.label.value}\n variant=\"hoverable\"\n color=\"neutral\"\n textAlign=\"left\"\n onClick={() => {\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n {\n type: NodeType.Array,\n key: (section as DictionaryValue[]).length,\n },\n ];\n addEditedContent(dictionaryKey, {}, newKeyPath, false);\n setFocusedContentKeyPath(newKeyPath);\n }}\n Icon={Plus}\n >\n {addNewElement.text}\n </Button>\n </div>\n );\n }\n\n const sectionArray = Object.keys(section);\n return (\n <div className=\"flex w-full max-w-full flex-col justify-between gap-2\">\n {sectionArray.map((key) => {\n const childKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Object, key },\n ];\n const subSection = getDictionaryValueByKeyPath(\n sectionProp,\n childKeyPath\n );\n const isEditableSubSection = getIsEditableSection(subSection);\n\n if (isEditableSubSection) {\n return (\n <Button\n label={`${goToField.label.value} ${key}`}\n key={key}\n isActive={getIsSelected(childKeyPath)}\n variant=\"hoverable\"\n color=\"text\"\n className=\"w-full\"\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n IconRight={ChevronRight}\n >\n {camelCaseToSentence(key)}\n </Button>\n );\n }\n\n return (\n <Accordion\n key={key}\n identifier={key}\n label={`${goToField.label.value} ${key}`}\n isActive={getIsSelected(childKeyPath)}\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n header={camelCaseToSentence(key)}\n >\n <div className=\"flex w-full max-w-full\">\n <div className=\"flex-1 pl-10\">\n <NavigationViewNode\n keyPath={childKeyPath}\n section={sectionProp}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </div>\n </Accordion>\n );\n })}\n\n <Button\n label={addNewField.label.value}\n variant=\"hoverable\"\n color=\"neutral\"\n textAlign=\"left\"\n onClick={() => {\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Object, key: 'newField' },\n ];\n addEditedContent(dictionaryKey, {}, newKeyPath, false);\n setFocusedContentKeyPath(newKeyPath);\n }}\n Icon={Plus}\n >\n {addNewField.text}\n </Button>\n </div>\n );\n }\n\n return (\n <>\n Error loading section --\n {nodeType}\n --\n {JSON.stringify(section)}\n --\n {JSON.stringify(keyPath)}\n </>\n );\n};\n"],"names":["keyPath","jsx","Fragment","jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BO,MAAM,YAAsB,CAAC,YAAY,MAAM,UAAU;AAQzD,MAAM,qBAA2C,CAAC;AAAA,EACvD,SAAS;AAAA,EACT;AAAA,EACA;AACF,MAAM;AACJ,QAAM,EAAE,QAAA,IAAY,iBAAA,EAAmB;AACjC,QAAA,UAAU,4BAA4B,aAAa,OAAO;AAChE,QAAM,mBAAmB;AAAA,IACvB,WAAW,CAAC,MAAM,EAAE,gBAAgB;AAAA,EAAA;AAEhC,QAAA,EAAE,0BAA0B,eAAA,IAAmB;AAAA,IACnD,WAAW,CAAC,OAAO;AAAA,MACjB,0BAA0B,EAAE;AAAA,MAC5B,gBAAgB,EAAE;AAAA,IAAA,EAClB;AAAA,EAAA;AAEE,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACE,cAAc,qBAAqB;AACjC,QAAA,WAAW,eAAe,OAAO;AACjC,QAAA,oBAAoB,qBAAqB,OAAO;AACtD,QAAM,gBAAg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AAC;AAAA,UAAA;AAAA,YAEC,YAAY;AAAA,YACZ,OAAO,GAAG,UAAU,MAAM,KAAK,IAAI,GAAG;AAAA,YACtC,UAAU,cAAc,YAAY;AAAA,YACpC,SAAS,MAAM,yBAAyB,YAAY;AAAA,YACpD,QAAQ,oBAAoB,GAAG;AAAA,YAE/B,gDAAC,OAAI,EAAA,WAAU,0BACb,UAACA,kCAAA,IAAA,OAAA,EAAI,WAAU,gBACb,UAAAA,kCAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,SAAS;AAAA,gBACT,SAAS;AAAA,gBACT;AAAA,cAAA;AAAA,eAEJ,EACF,CAAA;AAAA,UAAA;AAAA,UAfK;AAAA,QAAA;AAAA,MAgBP,CAEH;AAAA,MAEDA,kCAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,OAAO,YAAY,MAAM;AAAA,UACzB,SAAQ;AAAA,UACR,OAAM;AAAA,UACN,WAAU;AAAA,UACV,SAAS,MAAM;AACb,kBAAM,aAAwB;AAAA,cAC5B,GAAG;AAAA,cACH,EAAE,MAAM,SAAS,QAAQ,KAAK,WAAW;AAAA,YAAA;AAE3C,6BAAiB,eAAe,CAAA,GAAI,YAAY,KAAK;AACrD,qCAAyB,UAAU;AAAA,UACrC;AAAA,UACA,MAAM;AAAA,UAEL,UAAY,YAAA;AAAA,QAAA;AAAA,MACf;AAAA,IACF,EAAA,CAAA;AAAA,EAEJ;AAEA,SACIE,kCAAA,KAAAD,4BAAA,EAAA,UAAA;AAAA,IAAA;AAAA,IAEC;AAAA,IAAS;AAAA,IAET,KAAK,UAAU,OAAO;AAAA,IAAE;AAAA,IAExB,KAAK,UAAU,OAAO;AAAA,EACzB,EAAA,CAAA;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"NavigationViewNode.mjs","sources":["../../../../src/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.tsx"],"sourcesContent":["import { getConfiguration } from '@intlayer/config/client';\nimport {\n type EnumerationContent,\n NodeType,\n type KeyPath,\n type DictionaryValue,\n isSameKeyPath,\n} from '@intlayer/core';\nimport { ChevronRight, Plus } from 'lucide-react';\nimport { useCallback, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { camelCaseToSentence } from '../../../utils/camelCase';\nimport {\n getDictionaryValueByKeyPath,\n getSectionType,\n} from '../../../utils/dictionary';\nimport { Accordion } from '../../Accordion';\nimport { Button } from '../../Button';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../../DictionaryEditor';\nimport { getIsEditableSection } from '../getIsEditableSection';\nimport { navigationViewContent } from './navigationViewNode.content';\n\nexport const traceKeys: string[] = ['filePath', 'id', 'nodeType'];\n\nexport type NodeWrapperProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: DictionaryValue;\n};\n\nexport const NavigationViewNode: FC<NodeWrapperProps> = ({\n section: sectionProp,\n keyPath,\n dictionaryKey,\n}) => {\n const { locales } = getConfiguration().internationalization;\n const section = getDictionaryValueByKeyPath(sectionProp, keyPath);\n const addEditedContent = useEditedContentStore(\n useShallow((s) => s.addEditedContent)\n );\n const { setFocusedContentKeyPath, focusedContent } = useEditionPanelStore(\n useShallow((s) => ({\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n focusedContent: s.focusedContent,\n }))\n );\n const {\n addNewElement,\n addNewField,\n goToElement,\n goToField,\n goToEnumeration,\n goToTranslation,\n } = useDictionary(navigationViewContent);\n const nodeType = getSectionType(section);\n const isEditableSection = getIsEditableSection(section);\n const getIsSelected = useCallback(\n (keyPath: KeyPath[]) =>\n (focusedContent?.keyPath?.length ?? 0) > 0 &&\n isSameKeyPath(keyPath, focusedContent?.keyPath ?? []),\n [focusedContent?.keyPath]\n );\n\n if (isEditableSection) return <>-</>;\n\n if (!section) return <>-</>;\n\n if (typeof section === 'object') {\n if (nodeType === NodeType.ReactNode) {\n return <>React Node</>;\n }\n\n if (nodeType === NodeType.Translation) {\n return (\n <div className=\"flex flex-col justify-between gap-2\">\n {locales.map((translationKey) => {\n const childKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Translation, key: translationKey },\n ];\n const subSection = getDictionaryValueByKeyPath(\n sectionProp,\n childKeyPath\n );\n const isEditableSubSection = getIsEditableSection(subSection);\n\n if (isEditableSubSection) {\n return (\n <Button\n label={`${goToTranslation.label.value} ${translationKey}`}\n key={translationKey}\n isActive={getIsSelected(childKeyPath)}\n variant=\"hoverable\"\n color=\"text\"\n className=\"w-full\"\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n IconRight={ChevronRight}\n >\n {translationKey}\n </Button>\n );\n }\n\n return (\n <Accordion\n key={translationKey}\n identifier={translationKey}\n label={`${goToTranslation.label.value} ${translationKey}`}\n isActive={getIsSelected(childKeyPath)}\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n header={translationKey}\n >\n <div className=\"flex w-full max-w-full\">\n <div className=\"flex-1 pl-10\">\n <NavigationViewNode\n keyPath={childKeyPath}\n section={sectionProp}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </div>\n </Accordion>\n );\n })}\n </div>\n );\n }\n\n if (nodeType === NodeType.Enumeration) {\n return (\n <div className=\"flex flex-col justify-between gap-2\">\n {Object.keys(\n (section as EnumerationContent<DictionaryValue>)[\n NodeType.Enumeration\n ]\n ).map((key) => {\n const childKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Enumeration, key },\n ];\n const subSection = getDictionaryValueByKeyPath(\n sectionProp,\n childKeyPath\n );\n const isEditableSubSection = getIsEditableSection(subSection);\n\n if (isEditableSubSection) {\n return (\n <Button\n label={`${goToEnumeration.label.value} ${key}`}\n key={key}\n isActive={getIsSelected(childKeyPath)}\n variant=\"hoverable\"\n color=\"text\"\n className=\"w-full\"\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n IconRight={ChevronRight}\n >\n {key}\n </Button>\n );\n }\n\n return (\n <Accordion\n key={key}\n identifier={key}\n label={`${goToEnumeration.label.value} ${key}`}\n isActive={getIsSelected(childKeyPath)}\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n header={key}\n >\n <div className=\"flex w-full max-w-full\">\n <div className=\"flex-1 pl-10\">\n <NavigationViewNode\n keyPath={childKeyPath}\n section={sectionProp}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </div>\n </Accordion>\n );\n })}\n </div>\n );\n }\n\n if (nodeType === NodeType.Array) {\n return (\n <div className=\"flex flex-col justify-between gap-2\">\n {(section as DictionaryValue[]).map((subSection, index) => {\n const childKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Array, key: index },\n ];\n\n const isEditableSubSection = getIsEditableSection(subSection);\n\n if (isEditableSubSection) {\n return (\n <Button\n label={`${goToElement.label.value} ${index}`}\n key={`${index}`}\n isActive={getIsSelected(childKeyPath)}\n variant=\"hoverable\"\n color=\"text\"\n className=\"w-full\"\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n IconRight={ChevronRight}\n >\n {index}\n </Button>\n );\n }\n\n return (\n <Accordion\n key={`${index}`}\n identifier={`${index}`}\n label={`${goToElement.label.value} ${index}`}\n isActive={getIsSelected(childKeyPath)}\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n header={index}\n >\n <div className=\"flex w-full max-w-full\">\n <div className=\"flex-1 pl-10\">\n <NavigationViewNode\n keyPath={childKeyPath}\n section={sectionProp}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </div>\n </Accordion>\n );\n })}\n\n <Button\n label={addNewElement.label.value}\n variant=\"hoverable\"\n color=\"neutral\"\n textAlign=\"left\"\n onClick={() => {\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n {\n type: NodeType.Array,\n key: (section as DictionaryValue[]).length,\n },\n ];\n addEditedContent(dictionaryKey, {}, newKeyPath, false);\n setFocusedContentKeyPath(newKeyPath);\n }}\n Icon={Plus}\n >\n {addNewElement.text}\n </Button>\n </div>\n );\n }\n\n const sectionArray = Object.keys(section);\n return (\n <div className=\"flex w-full max-w-full flex-col justify-between gap-2\">\n {sectionArray.map((key) => {\n const childKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Object, key },\n ];\n const subSection = getDictionaryValueByKeyPath(\n sectionProp,\n childKeyPath\n );\n const isEditableSubSection = getIsEditableSection(subSection);\n\n if (isEditableSubSection) {\n return (\n <Button\n label={`${goToField.label.value} ${key}`}\n key={key}\n isActive={getIsSelected(childKeyPath)}\n variant=\"hoverable\"\n color=\"text\"\n className=\"w-full\"\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n IconRight={ChevronRight}\n >\n {camelCaseToSentence(key)}\n </Button>\n );\n }\n\n return (\n <Accordion\n key={key}\n identifier={key}\n label={`${goToField.label.value} ${key}`}\n isActive={getIsSelected(childKeyPath)}\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n header={camelCaseToSentence(key)}\n >\n <div className=\"flex w-full max-w-full\">\n <div className=\"flex-1 pl-10\">\n <NavigationViewNode\n keyPath={childKeyPath}\n section={sectionProp}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </div>\n </Accordion>\n );\n })}\n\n <Button\n label={addNewField.label.value}\n variant=\"hoverable\"\n color=\"neutral\"\n textAlign=\"left\"\n onClick={() => {\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Object, key: 'newField' },\n ];\n addEditedContent(dictionaryKey, {}, newKeyPath, false);\n setFocusedContentKeyPath(newKeyPath);\n }}\n Icon={Plus}\n >\n {addNewField.text}\n </Button>\n </div>\n );\n }\n\n return (\n <>\n Error loading section --\n {nodeType}\n --\n {JSON.stringify(section)}\n --\n {JSON.stringify(keyPath)}\n </>\n );\n};\n"],"names":["keyPath","jsx","Fragment","jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BO,MAAM,YAAsB,CAAC,YAAY,MAAM,UAAU;AAQzD,MAAM,qBAA2C,CAAC;AAAA,EACvD,SAAS;AAAA,EACT;AAAA,EACA;AACF,MAA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,UACA,MAAM;AAAA,UAEL,UAAY,YAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACf,GACF;AAAA,EAAA;AAIJ,SACIE,kCAAA,KAAAD,4BAAA,EAAA,UAAA;AAAA,IAAA;AAAA,IAEC;AAAA,IAAS;AAAA,IAET,KAAK,UAAU,OAAO;AAAA,IAAE;AAAA,IAExB,KAAK,UAAU,OAAO;AAAA,EAAA,GACzB;AAEJ;"}
|
package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigationViewNode.content.cjs","sources":["../../../../src/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.ts"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const navigationViewContent = {\n key: 'navigation-view',\n content: {\n tsxNotEditable: t({\n en: 'React node not editable',\n fr: 'Node React non éditable',\n es: 'Nodo React no editable',\n }),\n goToField: {\n label: t({\n en: 'Go to field',\n fr: 'Aller au champ',\n es: 'Ir al campo',\n }),\n },\n addNewField: {\n label: t({\n en: 'Click to add field',\n fr: 'Cliquez pour ajouter un champ',\n es: 'Haga clic para agregar un campo',\n }),\n text: t({\n en: 'Add new field',\n fr: 'Ajouter un nouveau champ',\n es: 'Agregar nuevo campo',\n }),\n },\n goToElement: {\n label: t({\n en: 'Go to element',\n fr: \"Aller à l'élément\",\n es: 'Ir al elemento',\n }),\n },\n addNewElement: {\n label: t({\n en: 'Click to add element',\n fr: 'Cliquez pour ajouter un élément',\n es: 'Haga clic para agregar un elemento',\n }),\n text: t({\n en: 'Add new element',\n fr: 'Ajouter un nouvel élément',\n es: 'Agregar nuevo elemento',\n }),\n },\n goToTranslation: {\n label: t({\n en: 'Go to translation',\n fr: 'Aller à la traduction',\n es: 'Ir a la traducción',\n }),\n },\n goToEnumeration: {\n label: t({\n en: 'Go to enumeration',\n fr: \"Aller à l'énumération\",\n es: 'Ir a la enumeración',\n }),\n },\n addNewEnumeration: {\n label: t({\n en: 'Click to add enumeration',\n fr: 'Cliquez pour ajouter une énumération',\n es: 'Haga clic para agregar una enumeración',\n }),\n text: t({\n en: 'Add new enumeration',\n fr: 'Ajouter une nouvelle énumération',\n es: 'Agregar nueva enumeración',\n }),\n },\n },\n} satisfies DeclarationContent;\n"],"names":["t"],"mappings":";;;AAEO,MAAM,wBAAwB;AAAA,EACnC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,gBAAgBA,SAAAA,EAAE;AAAA,MAChB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,WAAW;AAAA,MACT,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,
|
|
1
|
+
{"version":3,"file":"navigationViewNode.content.cjs","sources":["../../../../src/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.ts"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const navigationViewContent = {\n key: 'navigation-view',\n content: {\n tsxNotEditable: t({\n en: 'React node not editable',\n fr: 'Node React non éditable',\n es: 'Nodo React no editable',\n }),\n goToField: {\n label: t({\n en: 'Go to field',\n fr: 'Aller au champ',\n es: 'Ir al campo',\n }),\n },\n addNewField: {\n label: t({\n en: 'Click to add field',\n fr: 'Cliquez pour ajouter un champ',\n es: 'Haga clic para agregar un campo',\n }),\n text: t({\n en: 'Add new field',\n fr: 'Ajouter un nouveau champ',\n es: 'Agregar nuevo campo',\n }),\n },\n goToElement: {\n label: t({\n en: 'Go to element',\n fr: \"Aller à l'élément\",\n es: 'Ir al elemento',\n }),\n },\n addNewElement: {\n label: t({\n en: 'Click to add element',\n fr: 'Cliquez pour ajouter un élément',\n es: 'Haga clic para agregar un elemento',\n }),\n text: t({\n en: 'Add new element',\n fr: 'Ajouter un nouvel élément',\n es: 'Agregar nuevo elemento',\n }),\n },\n goToTranslation: {\n label: t({\n en: 'Go to translation',\n fr: 'Aller à la traduction',\n es: 'Ir a la traducción',\n }),\n },\n goToEnumeration: {\n label: t({\n en: 'Go to enumeration',\n fr: \"Aller à l'énumération\",\n es: 'Ir a la enumeración',\n }),\n },\n addNewEnumeration: {\n label: t({\n en: 'Click to add enumeration',\n fr: 'Cliquez pour ajouter une énumération',\n es: 'Haga clic para agregar una enumeración',\n }),\n text: t({\n en: 'Add new enumeration',\n fr: 'Ajouter une nouvelle énumération',\n es: 'Agregar nueva enumeración',\n }),\n },\n },\n} satisfies DeclarationContent;\n"],"names":["t"],"mappings":";;;AAEO,MAAM,wBAAwB;AAAA,EACnC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,gBAAgBA,SAAAA,EAAE;AAAA,MAChB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,WAAW;AAAA,MACT,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IACH;AAAA,IACA,aAAa;AAAA,MACX,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,MAAMA,SAAAA,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IACH;AAAA,IACA,aAAa;AAAA,MACX,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IACH;AAAA,IACA,eAAe;AAAA,MACb,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,MAAMA,SAAAA,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IACH;AAAA,IACA,iBAAiB;AAAA,MACf,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IACH;AAAA,IACA,iBAAiB;AAAA,MACf,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IACH;AAAA,IACA,mBAAmB;AAAA,MACjB,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,MAAMA,SAAAA,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IAAA;AAAA,EACH;AAEJ;;"}
|
package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigationViewNode.content.mjs","sources":["../../../../src/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.ts"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const navigationViewContent = {\n key: 'navigation-view',\n content: {\n tsxNotEditable: t({\n en: 'React node not editable',\n fr: 'Node React non éditable',\n es: 'Nodo React no editable',\n }),\n goToField: {\n label: t({\n en: 'Go to field',\n fr: 'Aller au champ',\n es: 'Ir al campo',\n }),\n },\n addNewField: {\n label: t({\n en: 'Click to add field',\n fr: 'Cliquez pour ajouter un champ',\n es: 'Haga clic para agregar un campo',\n }),\n text: t({\n en: 'Add new field',\n fr: 'Ajouter un nouveau champ',\n es: 'Agregar nuevo campo',\n }),\n },\n goToElement: {\n label: t({\n en: 'Go to element',\n fr: \"Aller à l'élément\",\n es: 'Ir al elemento',\n }),\n },\n addNewElement: {\n label: t({\n en: 'Click to add element',\n fr: 'Cliquez pour ajouter un élément',\n es: 'Haga clic para agregar un elemento',\n }),\n text: t({\n en: 'Add new element',\n fr: 'Ajouter un nouvel élément',\n es: 'Agregar nuevo elemento',\n }),\n },\n goToTranslation: {\n label: t({\n en: 'Go to translation',\n fr: 'Aller à la traduction',\n es: 'Ir a la traducción',\n }),\n },\n goToEnumeration: {\n label: t({\n en: 'Go to enumeration',\n fr: \"Aller à l'énumération\",\n es: 'Ir a la enumeración',\n }),\n },\n addNewEnumeration: {\n label: t({\n en: 'Click to add enumeration',\n fr: 'Cliquez pour ajouter une énumération',\n es: 'Haga clic para agregar una enumeración',\n }),\n text: t({\n en: 'Add new enumeration',\n fr: 'Ajouter une nouvelle énumération',\n es: 'Agregar nueva enumeración',\n }),\n },\n },\n} satisfies DeclarationContent;\n"],"names":[],"mappings":";AAEO,MAAM,wBAAwB;AAAA,EACnC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,gBAAgB,EAAE;AAAA,MAChB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,WAAW;AAAA,MACT,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,
|
|
1
|
+
{"version":3,"file":"navigationViewNode.content.mjs","sources":["../../../../src/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.ts"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const navigationViewContent = {\n key: 'navigation-view',\n content: {\n tsxNotEditable: t({\n en: 'React node not editable',\n fr: 'Node React non éditable',\n es: 'Nodo React no editable',\n }),\n goToField: {\n label: t({\n en: 'Go to field',\n fr: 'Aller au champ',\n es: 'Ir al campo',\n }),\n },\n addNewField: {\n label: t({\n en: 'Click to add field',\n fr: 'Cliquez pour ajouter un champ',\n es: 'Haga clic para agregar un campo',\n }),\n text: t({\n en: 'Add new field',\n fr: 'Ajouter un nouveau champ',\n es: 'Agregar nuevo campo',\n }),\n },\n goToElement: {\n label: t({\n en: 'Go to element',\n fr: \"Aller à l'élément\",\n es: 'Ir al elemento',\n }),\n },\n addNewElement: {\n label: t({\n en: 'Click to add element',\n fr: 'Cliquez pour ajouter un élément',\n es: 'Haga clic para agregar un elemento',\n }),\n text: t({\n en: 'Add new element',\n fr: 'Ajouter un nouvel élément',\n es: 'Agregar nuevo elemento',\n }),\n },\n goToTranslation: {\n label: t({\n en: 'Go to translation',\n fr: 'Aller à la traduction',\n es: 'Ir a la traducción',\n }),\n },\n goToEnumeration: {\n label: t({\n en: 'Go to enumeration',\n fr: \"Aller à l'énumération\",\n es: 'Ir a la enumeración',\n }),\n },\n addNewEnumeration: {\n label: t({\n en: 'Click to add enumeration',\n fr: 'Cliquez pour ajouter une énumération',\n es: 'Haga clic para agregar una enumeración',\n }),\n text: t({\n en: 'Add new enumeration',\n fr: 'Ajouter une nouvelle énumération',\n es: 'Agregar nueva enumeración',\n }),\n },\n },\n} satisfies DeclarationContent;\n"],"names":[],"mappings":";AAEO,MAAM,wBAAwB;AAAA,EACnC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,gBAAgB,EAAE;AAAA,MAChB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,WAAW;AAAA,MACT,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IACH;AAAA,IACA,aAAa;AAAA,MACX,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,MAAM,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IACH;AAAA,IACA,aAAa;AAAA,MACX,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IACH;AAAA,IACA,eAAe;AAAA,MACb,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,MAAM,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IACH;AAAA,IACA,iBAAiB;AAAA,MACf,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IACH;AAAA,IACA,iBAAiB;AAAA,MACf,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IACH;AAAA,IACA,mBAAmB;AAAA,MACjB,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,MAAM,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IAAA;AAAA,EACH;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeEditor.cjs","sources":["../../../src/components/DictionaryFieldEditor/NodeEditor.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary } from '@intlayer/core';\nimport { useEffect, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { Container } from '../Container';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../DictionaryEditor';\nimport { EditorView } from './EditorView/EditorView';\nimport { KeyPathBreadcrumb } from './KeyPathBreadcrumb';\nimport { NavigationViewNode } from './NavigationView/NavigationViewNode';\nimport { SaveForm } from './SaveForm/SaveForm';\n\ntype NodeEditorProps = {\n dictionary: Dictionary;\n};\n\nexport const NodeEditor: FC<NodeEditorProps> = ({ dictionary }) => {\n const { content: dictionaryContent, key } = dictionary;\n const { editedContent, dictionaryRecord, setDictionariesRecord } =\n useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n dictionaryRecord: s.dictionariesRecord,\n setDictionariesRecord: s.setDictionariesRecord,\n }))\n );\n\n const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(\n useShallow((s) => ({\n focusedContent: s.focusedContent,\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n }))\n );\n\n const focusedKeyPath = focusedContent?.keyPath;\n\n const section = editedContent[key]?.content ?? dictionaryContent;\n\n useEffect(() => {\n if (dictionaryRecord[key]) return;\n\n setDictionariesRecord({\n [key]: dictionary,\n });\n }, [dictionary, key, setDictionariesRecord, dictionaryRecord]);\n\n return (\n <>\n <KeyPathBreadcrumb\n dictionaryKey={key}\n keyPath={focusedKeyPath ?? []}\n onClickKeyPath={setFocusedContentKeyPath}\n />\n <div className=\"flex gap-2 max-md:flex-col\">\n <Container\n border\n background={false}\n className=\"top-6 flex h-full flex-col items-start gap-0.5 overflow-auto p-2 md:sticky md:max-w-[50%]\"\n roundedSize=\"xl\"\n >\n <NavigationViewNode\n keyPath={[]}\n section={section}\n dictionaryKey={key}\n />\n </Container>\n <div className=\"top-6 flex h-full flex-1 flex-col gap-6 md:sticky\">\n {(focusedKeyPath?.length ?? 0) > 0 && (\n <Container\n border\n background={false}\n className=\"h-full flex-1 overflow-hidden\"\n roundedSize=\"xl\"\n >\n <EditorView dictionary={dictionary} dictionaryKey={key} />\n </Container>\n )}\n <SaveForm dictionary={dictionary} />\n </div>\n </div>\n </>\n );\n};\n"],"names":["useEditedContentStore","useShallow","useEditionPanelStore","useEffect","jsxs","Fragment","jsx","KeyPathBreadcrumb","Container","NavigationViewNode","EditorView","SaveForm"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBO,MAAM,aAAkC,CAAC,EAAE,iBAAiB;AACjE,QAAM,EAAE,SAAS,mBAAmB,IAAA
|
|
1
|
+
{"version":3,"file":"NodeEditor.cjs","sources":["../../../src/components/DictionaryFieldEditor/NodeEditor.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary } from '@intlayer/core';\nimport { useEffect, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { Container } from '../Container';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../DictionaryEditor';\nimport { EditorView } from './EditorView/EditorView';\nimport { KeyPathBreadcrumb } from './KeyPathBreadcrumb';\nimport { NavigationViewNode } from './NavigationView/NavigationViewNode';\nimport { SaveForm } from './SaveForm/SaveForm';\n\ntype NodeEditorProps = {\n dictionary: Dictionary;\n};\n\nexport const NodeEditor: FC<NodeEditorProps> = ({ dictionary }) => {\n const { content: dictionaryContent, key } = dictionary;\n const { editedContent, dictionaryRecord, setDictionariesRecord } =\n useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n dictionaryRecord: s.dictionariesRecord,\n setDictionariesRecord: s.setDictionariesRecord,\n }))\n );\n\n const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(\n useShallow((s) => ({\n focusedContent: s.focusedContent,\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n }))\n );\n\n const focusedKeyPath = focusedContent?.keyPath;\n\n const section = editedContent[key]?.content ?? dictionaryContent;\n\n useEffect(() => {\n if (dictionaryRecord[key]) return;\n\n setDictionariesRecord({\n [key]: dictionary,\n });\n }, [dictionary, key, setDictionariesRecord, dictionaryRecord]);\n\n return (\n <>\n <KeyPathBreadcrumb\n dictionaryKey={key}\n keyPath={focusedKeyPath ?? []}\n onClickKeyPath={setFocusedContentKeyPath}\n />\n <div className=\"flex gap-2 max-md:flex-col\">\n <Container\n border\n background={false}\n className=\"top-6 flex h-full flex-col items-start gap-0.5 overflow-auto p-2 md:sticky md:max-w-[50%]\"\n roundedSize=\"xl\"\n >\n <NavigationViewNode\n keyPath={[]}\n section={section}\n dictionaryKey={key}\n />\n </Container>\n <div className=\"top-6 flex h-full flex-1 flex-col gap-6 md:sticky\">\n {(focusedKeyPath?.length ?? 0) > 0 && (\n <Container\n border\n background={false}\n className=\"h-full flex-1 overflow-hidden\"\n roundedSize=\"xl\"\n >\n <EditorView dictionary={dictionary} dictionaryKey={key} />\n </Container>\n )}\n <SaveForm dictionary={dictionary} />\n </div>\n </div>\n </>\n );\n};\n"],"names":["useEditedContentStore","useShallow","useEditionPanelStore","useEffect","jsxs","Fragment","jsx","KeyPathBreadcrumb","Container","NavigationViewNode","EditorView","SaveForm"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBO,MAAM,aAAkC,CAAC,EAAE,iBAAiB;AACjE,QAAM,EAAE,SAAS,mBAAmB,IAAQ,IAAA;AAC5C,QAAM,EAAE,eAAe,kBAAkB,sBACvC,IAAAA,kDAAA;AAAA,IACEC,QAAA,WAAW,CAAC,OAAO;AAAA,MACjB,eAAe,EAAE;AAAA,MACjB,kBAAkB,EAAE;AAAA,MACpB,uBAAuB,EAAE;AAAA,IAAA,EACzB;AAAA,EACJ;AAEI,QAAA,EAAE,gBAAgB,yBAAA,IAA6BC,iDAAA;AAAA,IACnDD,QAAA,WAAW,CAAC,OAAO;AAAA,MACjB,gBAAgB,EAAE;AAAA,MAClB,0BAA0B,EAAE;AAAA,IAAA,EAC5B;AAAA,EACJ;AAEA,QAAM,iBAAiB,gBAAgB;AAEvC,QAAM,UAAU,cAAc,GAAG,GAAG,WAAW;AAE/CE,aAAAA,UAAU,MAAM;AACV,QAAA,iBAAiB,GAAG,EAAG;AAEL,0BAAA;AAAA,MACpB,CAAC,GAAG,GAAG;AAAA,IAAA,CACR;AAAA,KACA,CAAC,YAAY,KAAK,uBAAuB,gBAAgB,CAAC;AAE7D,SAEIC,2BAAA,kBAAA,KAAAC,uCAAA,EAAA,UAAA;AAAA,IAAAC,2BAAA,kBAAA;AAAA,MAACC,mDAAA;AAAA,MAAA;AAAA,QACC,eAAe;AAAA,QACf,SAAS,kBAAkB,CAAC;AAAA,QAC5B,gBAAgB;AAAA,MAAA;AAAA,IAClB;AAAA,IACAH,2BAAAA,kBAAAA,KAAC,OAAI,EAAA,WAAU,8BACb,UAAA;AAAA,MAAAE,2BAAA,kBAAA;AAAA,QAACE,2BAAA;AAAA,QAAA;AAAA,UACC,QAAM;AAAA,UACN,YAAY;AAAA,UACZ,WAAU;AAAA,UACV,aAAY;AAAA,UAEZ,UAAAF,2BAAA,kBAAA;AAAA,YAACG,mEAAA;AAAA,YAAA;AAAA,cACC,SAAS,CAAC;AAAA,cACV;AAAA,cACA,eAAe;AAAA,YAAA;AAAA,UAAA;AAAA,QACjB;AAAA,MACF;AAAA,MACAL,2BAAAA,kBAAAA,KAAC,OAAI,EAAA,WAAU,qDACX,UAAA;AAAA,SAAgB,gBAAA,UAAU,KAAK,KAC/BE,2BAAA,kBAAA;AAAA,UAACE,2BAAA;AAAA,UAAA;AAAA,YACC,QAAM;AAAA,YACN,YAAY;AAAA,YACZ,WAAU;AAAA,YACV,aAAY;AAAA,YAEZ,UAACF,2BAAA,kBAAA,IAAAI,uDAAA,YAAA,EAAW,YAAwB,eAAe,IAAK,CAAA;AAAA,UAAA;AAAA,QAC1D;AAAA,QAEFJ,iDAACK,mDAAAA,YAAS,WAAwB,CAAA;AAAA,MAAA,EACpC,CAAA;AAAA,IAAA,EACF,CAAA;AAAA,EAAA,GACF;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeEditor.mjs","sources":["../../../src/components/DictionaryFieldEditor/NodeEditor.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary } from '@intlayer/core';\nimport { useEffect, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { Container } from '../Container';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../DictionaryEditor';\nimport { EditorView } from './EditorView/EditorView';\nimport { KeyPathBreadcrumb } from './KeyPathBreadcrumb';\nimport { NavigationViewNode } from './NavigationView/NavigationViewNode';\nimport { SaveForm } from './SaveForm/SaveForm';\n\ntype NodeEditorProps = {\n dictionary: Dictionary;\n};\n\nexport const NodeEditor: FC<NodeEditorProps> = ({ dictionary }) => {\n const { content: dictionaryContent, key } = dictionary;\n const { editedContent, dictionaryRecord, setDictionariesRecord } =\n useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n dictionaryRecord: s.dictionariesRecord,\n setDictionariesRecord: s.setDictionariesRecord,\n }))\n );\n\n const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(\n useShallow((s) => ({\n focusedContent: s.focusedContent,\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n }))\n );\n\n const focusedKeyPath = focusedContent?.keyPath;\n\n const section = editedContent[key]?.content ?? dictionaryContent;\n\n useEffect(() => {\n if (dictionaryRecord[key]) return;\n\n setDictionariesRecord({\n [key]: dictionary,\n });\n }, [dictionary, key, setDictionariesRecord, dictionaryRecord]);\n\n return (\n <>\n <KeyPathBreadcrumb\n dictionaryKey={key}\n keyPath={focusedKeyPath ?? []}\n onClickKeyPath={setFocusedContentKeyPath}\n />\n <div className=\"flex gap-2 max-md:flex-col\">\n <Container\n border\n background={false}\n className=\"top-6 flex h-full flex-col items-start gap-0.5 overflow-auto p-2 md:sticky md:max-w-[50%]\"\n roundedSize=\"xl\"\n >\n <NavigationViewNode\n keyPath={[]}\n section={section}\n dictionaryKey={key}\n />\n </Container>\n <div className=\"top-6 flex h-full flex-1 flex-col gap-6 md:sticky\">\n {(focusedKeyPath?.length ?? 0) > 0 && (\n <Container\n border\n background={false}\n className=\"h-full flex-1 overflow-hidden\"\n roundedSize=\"xl\"\n >\n <EditorView dictionary={dictionary} dictionaryKey={key} />\n </Container>\n )}\n <SaveForm dictionary={dictionary} />\n </div>\n </div>\n </>\n );\n};\n"],"names":["jsxs","Fragment","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBO,MAAM,aAAkC,CAAC,EAAE,iBAAiB;AACjE,QAAM,EAAE,SAAS,mBAAmB,IAAA
|
|
1
|
+
{"version":3,"file":"NodeEditor.mjs","sources":["../../../src/components/DictionaryFieldEditor/NodeEditor.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary } from '@intlayer/core';\nimport { useEffect, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { Container } from '../Container';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../DictionaryEditor';\nimport { EditorView } from './EditorView/EditorView';\nimport { KeyPathBreadcrumb } from './KeyPathBreadcrumb';\nimport { NavigationViewNode } from './NavigationView/NavigationViewNode';\nimport { SaveForm } from './SaveForm/SaveForm';\n\ntype NodeEditorProps = {\n dictionary: Dictionary;\n};\n\nexport const NodeEditor: FC<NodeEditorProps> = ({ dictionary }) => {\n const { content: dictionaryContent, key } = dictionary;\n const { editedContent, dictionaryRecord, setDictionariesRecord } =\n useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n dictionaryRecord: s.dictionariesRecord,\n setDictionariesRecord: s.setDictionariesRecord,\n }))\n );\n\n const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(\n useShallow((s) => ({\n focusedContent: s.focusedContent,\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n }))\n );\n\n const focusedKeyPath = focusedContent?.keyPath;\n\n const section = editedContent[key]?.content ?? dictionaryContent;\n\n useEffect(() => {\n if (dictionaryRecord[key]) return;\n\n setDictionariesRecord({\n [key]: dictionary,\n });\n }, [dictionary, key, setDictionariesRecord, dictionaryRecord]);\n\n return (\n <>\n <KeyPathBreadcrumb\n dictionaryKey={key}\n keyPath={focusedKeyPath ?? []}\n onClickKeyPath={setFocusedContentKeyPath}\n />\n <div className=\"flex gap-2 max-md:flex-col\">\n <Container\n border\n background={false}\n className=\"top-6 flex h-full flex-col items-start gap-0.5 overflow-auto p-2 md:sticky md:max-w-[50%]\"\n roundedSize=\"xl\"\n >\n <NavigationViewNode\n keyPath={[]}\n section={section}\n dictionaryKey={key}\n />\n </Container>\n <div className=\"top-6 flex h-full flex-1 flex-col gap-6 md:sticky\">\n {(focusedKeyPath?.length ?? 0) > 0 && (\n <Container\n border\n background={false}\n className=\"h-full flex-1 overflow-hidden\"\n roundedSize=\"xl\"\n >\n <EditorView dictionary={dictionary} dictionaryKey={key} />\n </Container>\n )}\n <SaveForm dictionary={dictionary} />\n </div>\n </div>\n </>\n );\n};\n"],"names":["jsxs","Fragment","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBO,MAAM,aAAkC,CAAC,EAAE,iBAAiB;AACjE,QAAM,EAAE,SAAS,mBAAmB,IAAQ,IAAA;AAC5C,QAAM,EAAE,eAAe,kBAAkB,sBACvC,IAAA;AAAA,IACE,WAAW,CAAC,OAAO;AAAA,MACjB,eAAe,EAAE;AAAA,MACjB,kBAAkB,EAAE;AAAA,MACpB,uBAAuB,EAAE;AAAA,IAAA,EACzB;AAAA,EACJ;AAEI,QAAA,EAAE,gBAAgB,yBAAA,IAA6B;AAAA,IACnD,WAAW,CAAC,OAAO;AAAA,MACjB,gBAAgB,EAAE;AAAA,MAClB,0BAA0B,EAAE;AAAA,IAAA,EAC5B;AAAA,EACJ;AAEA,QAAM,iBAAiB,gBAAgB;AAEvC,QAAM,UAAU,cAAc,GAAG,GAAG,WAAW;AAE/C,YAAU,MAAM;AACV,QAAA,iBAAiB,GAAG,EAAG;AAEL,0BAAA;AAAA,MACpB,CAAC,GAAG,GAAG;AAAA,IAAA,CACR;AAAA,KACA,CAAC,YAAY,KAAK,uBAAuB,gBAAgB,CAAC;AAE7D,SAEIA,kCAAA,KAAAC,4BAAA,EAAA,UAAA;AAAA,IAAAC,kCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,eAAe;AAAA,QACf,SAAS,kBAAkB,CAAC;AAAA,QAC5B,gBAAgB;AAAA,MAAA;AAAA,IAClB;AAAA,IACAF,kCAAAA,KAAC,OAAI,EAAA,WAAU,8BACb,UAAA;AAAA,MAAAE,kCAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,QAAM;AAAA,UACN,YAAY;AAAA,UACZ,WAAU;AAAA,UACV,aAAY;AAAA,UAEZ,UAAAA,kCAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,SAAS,CAAC;AAAA,cACV;AAAA,cACA,eAAe;AAAA,YAAA;AAAA,UAAA;AAAA,QACjB;AAAA,MACF;AAAA,MACAF,kCAAAA,KAAC,OAAI,EAAA,WAAU,qDACX,UAAA;AAAA,SAAgB,gBAAA,UAAU,KAAK,KAC/BE,kCAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,QAAM;AAAA,YACN,YAAY;AAAA,YACZ,WAAU;AAAA,YACV,aAAY;AAAA,YAEZ,UAACA,kCAAA,IAAA,YAAA,EAAW,YAAwB,eAAe,IAAK,CAAA;AAAA,UAAA;AAAA,QAC1D;AAAA,QAEFA,sCAAC,YAAS,WAAwB,CAAA;AAAA,MAAA,EACpC,CAAA;AAAA,IAAA,EACF,CAAA;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeTypeSelector.cjs","sources":["../../../src/components/DictionaryFieldEditor/NodeTypeSelector.tsx"],"sourcesContent":["'use client';\n\nimport { getConfiguration } from '@intlayer/config/client';\nimport {\n type DictionaryValue,\n type EnumerationContent,\n type KeyPath,\n NodeType,\n type TranslationContent,\n} from '@intlayer/core';\nimport { type FC, useEffect, useState } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { getSectionType } from '../../utils/dictionary';\nimport { useEditedContentStore } from '../DictionaryEditor';\nimport { Select } from '../Select';\nimport { nodeTypeSelectorContent } from './nodeTypeSelector.content';\n\ntype NodeTypeSelectorProps = {\n keyPath: KeyPath[];\n dictionaryKey: string;\n section: DictionaryValue;\n};\n\nexport const NodeTypeSelector: FC<NodeTypeSelectorProps> = ({\n keyPath,\n dictionaryKey,\n section,\n}) => {\n const {\n multilingualText,\n text,\n node,\n array,\n enumeration,\n triggerPlaceHolder,\n } = useDictionary(nodeTypeSelectorContent);\n const nodeType = getSectionType(section);\n const [keyType, setKeyType] = useState<NodeType>(nodeType);\n const { addEditedContent } = useEditedContentStore(\n useShallow((s) => ({\n addEditedContent: s.addEditedContent,\n }))\n );\n const { locales } = getConfiguration().internationalization;\n\n const onValueChange = (keyType: NodeType) => {\n setKeyType(keyType);\n\n switch (keyType) {\n case NodeType.Translation:\n addEditedContent(\n dictionaryKey,\n {\n nodeType: NodeType.Translation,\n [NodeType.Translation]: Object.assign(\n {},\n ...locales.map((locale) => ({\n [locale]: '',\n }))\n ),\n } as TranslationContent<DictionaryValue>,\n keyPath\n );\n break;\n case NodeType.Enumeration:\n addEditedContent(\n dictionaryKey,\n {\n nodeType: NodeType.Enumeration,\n [NodeType.Enumeration]: {\n '1': '',\n '>1': '',\n },\n } as EnumerationContent<DictionaryValue>,\n keyPath\n );\n break;\n case NodeType.Object:\n addEditedContent(dictionaryKey, {}, keyPath);\n break;\n case NodeType.Array:\n addEditedContent(dictionaryKey, [''], keyPath);\n break;\n case NodeType.Text:\n addEditedContent(dictionaryKey, '', keyPath);\n break;\n default:\n addEditedContent(dictionaryKey, {}, keyPath);\n }\n };\n\n useEffect(() => {\n setKeyType(nodeType);\n }, [nodeType]);\n\n return (\n <Select value={keyType} onValueChange={onValueChange}>\n <Select.Trigger className=\"w-40\">\n <Select.Value placeholder={triggerPlaceHolder.value} />\n </Select.Trigger>\n <Select.Content>\n <Select.Item value={NodeType.Translation}>\n {multilingualText}\n </Select.Item>\n <Select.Item value={NodeType.Text}>{text}</Select.Item>\n <Select.Item value={NodeType.Object}>{node}</Select.Item>\n <Select.Item value={NodeType.Array}>{array}</Select.Item>\n <Select.Item value={NodeType.Enumeration}>{enumeration}</Select.Item>\n </Select.Content>\n </Select>\n );\n};\n"],"names":["useDictionary","nodeTypeSelectorContent","getSectionType","useState","useEditedContentStore","useShallow","getConfiguration","keyType","NodeType","useEffect","jsxs","Select","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBO,MAAM,mBAA8C,CAAC;AAAA,EAC1D;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACE,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACEA,cAAAA,cAAcC,0DAAAA,uBAAuB;AACnC,QAAA,WAAWC,gCAAe,OAAO;AACvC,QAAM,CAAC,SAAS,UAAU,IAAIC,
|
|
1
|
+
{"version":3,"file":"NodeTypeSelector.cjs","sources":["../../../src/components/DictionaryFieldEditor/NodeTypeSelector.tsx"],"sourcesContent":["'use client';\n\nimport { getConfiguration } from '@intlayer/config/client';\nimport {\n type DictionaryValue,\n type EnumerationContent,\n type KeyPath,\n NodeType,\n type TranslationContent,\n} from '@intlayer/core';\nimport { type FC, useEffect, useState } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { getSectionType } from '../../utils/dictionary';\nimport { useEditedContentStore } from '../DictionaryEditor';\nimport { Select } from '../Select';\nimport { nodeTypeSelectorContent } from './nodeTypeSelector.content';\n\ntype NodeTypeSelectorProps = {\n keyPath: KeyPath[];\n dictionaryKey: string;\n section: DictionaryValue;\n};\n\nexport const NodeTypeSelector: FC<NodeTypeSelectorProps> = ({\n keyPath,\n dictionaryKey,\n section,\n}) => {\n const {\n multilingualText,\n text,\n node,\n array,\n enumeration,\n triggerPlaceHolder,\n } = useDictionary(nodeTypeSelectorContent);\n const nodeType = getSectionType(section);\n const [keyType, setKeyType] = useState<NodeType>(nodeType);\n const { addEditedContent } = useEditedContentStore(\n useShallow((s) => ({\n addEditedContent: s.addEditedContent,\n }))\n );\n const { locales } = getConfiguration().internationalization;\n\n const onValueChange = (keyType: NodeType) => {\n setKeyType(keyType);\n\n switch (keyType) {\n case NodeType.Translation:\n addEditedContent(\n dictionaryKey,\n {\n nodeType: NodeType.Translation,\n [NodeType.Translation]: Object.assign(\n {},\n ...locales.map((locale) => ({\n [locale]: '',\n }))\n ),\n } as TranslationContent<DictionaryValue>,\n keyPath\n );\n break;\n case NodeType.Enumeration:\n addEditedContent(\n dictionaryKey,\n {\n nodeType: NodeType.Enumeration,\n [NodeType.Enumeration]: {\n '1': '',\n '>1': '',\n },\n } as EnumerationContent<DictionaryValue>,\n keyPath\n );\n break;\n case NodeType.Object:\n addEditedContent(dictionaryKey, {}, keyPath);\n break;\n case NodeType.Array:\n addEditedContent(dictionaryKey, [''], keyPath);\n break;\n case NodeType.Text:\n addEditedContent(dictionaryKey, '', keyPath);\n break;\n default:\n addEditedContent(dictionaryKey, {}, keyPath);\n }\n };\n\n useEffect(() => {\n setKeyType(nodeType);\n }, [nodeType]);\n\n return (\n <Select value={keyType} onValueChange={onValueChange}>\n <Select.Trigger className=\"w-40\">\n <Select.Value placeholder={triggerPlaceHolder.value} />\n </Select.Trigger>\n <Select.Content>\n <Select.Item value={NodeType.Translation}>\n {multilingualText}\n </Select.Item>\n <Select.Item value={NodeType.Text}>{text}</Select.Item>\n <Select.Item value={NodeType.Object}>{node}</Select.Item>\n <Select.Item value={NodeType.Array}>{array}</Select.Item>\n <Select.Item value={NodeType.Enumeration}>{enumeration}</Select.Item>\n </Select.Content>\n </Select>\n );\n};\n"],"names":["useDictionary","nodeTypeSelectorContent","getSectionType","useState","useEditedContentStore","useShallow","getConfiguration","keyType","NodeType","useEffect","jsxs","Select","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBO,MAAM,mBAA8C,CAAC;AAAA,EAC1D;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACE,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAA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,MAAM;AACd,eAAW,QAAQ;AAAA,EAAA,GAClB,CAAC,QAAQ,CAAC;AAEb,SACGC,2BAAAA,kBAAAA,KAAAC,yBAAAA,QAAA,EAAO,OAAO,SAAS,eACtB,UAAA;AAAA,IAAAC,2BAAA,kBAAA,IAACD,yBAAO,OAAA,SAAP,EAAe,WAAU,QACxB,UAAAC,2BAAAA,kBAAAA,IAACD,yBAAAA,OAAO,OAAP,EAAa,aAAa,mBAAmB,MAAA,CAAO,EACvD,CAAA;AAAA,IACAD,2BAAAA,kBAAAA,KAACC,yBAAO,OAAA,SAAP,EACC,UAAA;AAAA,MAAAC,iDAACD,yBAAAA,OAAO,MAAP,EAAY,OAAOH,KAAAA,SAAS,aAC1B,UACH,kBAAA;AAAA,uDACCG,yBAAAA,OAAO,MAAP,EAAY,OAAOH,KAAAA,SAAS,MAAO,UAAK,MAAA;AAAA,uDACxCG,yBAAAA,OAAO,MAAP,EAAY,OAAOH,KAAAA,SAAS,QAAS,UAAK,MAAA;AAAA,uDAC1CG,yBAAAA,OAAO,MAAP,EAAY,OAAOH,KAAAA,SAAS,OAAQ,UAAM,OAAA;AAAA,uDAC1CG,yBAAAA,OAAO,MAAP,EAAY,OAAOH,KAAAA,SAAS,aAAc,UAAY,YAAA,CAAA;AAAA,IAAA,EACzD,CAAA;AAAA,EAAA,GACF;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeTypeSelector.mjs","sources":["../../../src/components/DictionaryFieldEditor/NodeTypeSelector.tsx"],"sourcesContent":["'use client';\n\nimport { getConfiguration } from '@intlayer/config/client';\nimport {\n type DictionaryValue,\n type EnumerationContent,\n type KeyPath,\n NodeType,\n type TranslationContent,\n} from '@intlayer/core';\nimport { type FC, useEffect, useState } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { getSectionType } from '../../utils/dictionary';\nimport { useEditedContentStore } from '../DictionaryEditor';\nimport { Select } from '../Select';\nimport { nodeTypeSelectorContent } from './nodeTypeSelector.content';\n\ntype NodeTypeSelectorProps = {\n keyPath: KeyPath[];\n dictionaryKey: string;\n section: DictionaryValue;\n};\n\nexport const NodeTypeSelector: FC<NodeTypeSelectorProps> = ({\n keyPath,\n dictionaryKey,\n section,\n}) => {\n const {\n multilingualText,\n text,\n node,\n array,\n enumeration,\n triggerPlaceHolder,\n } = useDictionary(nodeTypeSelectorContent);\n const nodeType = getSectionType(section);\n const [keyType, setKeyType] = useState<NodeType>(nodeType);\n const { addEditedContent } = useEditedContentStore(\n useShallow((s) => ({\n addEditedContent: s.addEditedContent,\n }))\n );\n const { locales } = getConfiguration().internationalization;\n\n const onValueChange = (keyType: NodeType) => {\n setKeyType(keyType);\n\n switch (keyType) {\n case NodeType.Translation:\n addEditedContent(\n dictionaryKey,\n {\n nodeType: NodeType.Translation,\n [NodeType.Translation]: Object.assign(\n {},\n ...locales.map((locale) => ({\n [locale]: '',\n }))\n ),\n } as TranslationContent<DictionaryValue>,\n keyPath\n );\n break;\n case NodeType.Enumeration:\n addEditedContent(\n dictionaryKey,\n {\n nodeType: NodeType.Enumeration,\n [NodeType.Enumeration]: {\n '1': '',\n '>1': '',\n },\n } as EnumerationContent<DictionaryValue>,\n keyPath\n );\n break;\n case NodeType.Object:\n addEditedContent(dictionaryKey, {}, keyPath);\n break;\n case NodeType.Array:\n addEditedContent(dictionaryKey, [''], keyPath);\n break;\n case NodeType.Text:\n addEditedContent(dictionaryKey, '', keyPath);\n break;\n default:\n addEditedContent(dictionaryKey, {}, keyPath);\n }\n };\n\n useEffect(() => {\n setKeyType(nodeType);\n }, [nodeType]);\n\n return (\n <Select value={keyType} onValueChange={onValueChange}>\n <Select.Trigger className=\"w-40\">\n <Select.Value placeholder={triggerPlaceHolder.value} />\n </Select.Trigger>\n <Select.Content>\n <Select.Item value={NodeType.Translation}>\n {multilingualText}\n </Select.Item>\n <Select.Item value={NodeType.Text}>{text}</Select.Item>\n <Select.Item value={NodeType.Object}>{node}</Select.Item>\n <Select.Item value={NodeType.Array}>{array}</Select.Item>\n <Select.Item value={NodeType.Enumeration}>{enumeration}</Select.Item>\n </Select.Content>\n </Select>\n );\n};\n"],"names":["keyType","jsxs","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBO,MAAM,mBAA8C,CAAC;AAAA,EAC1D;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACE,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACE,cAAc,uBAAuB;AACnC,QAAA,WAAW,eAAe,OAAO;AACvC,QAAM,CAAC,SAAS,UAAU,IAAI,SAAmB,QAAQ;AACnD,QAAA,EAAE,qBAAqB;AAAA,IAC3B,WAAW,CAAC,OAAO;AAAA,MACjB,kBAAkB,EAAE;AAAA,IAAA,EACpB;AAAA,
|
|
1
|
+
{"version":3,"file":"NodeTypeSelector.mjs","sources":["../../../src/components/DictionaryFieldEditor/NodeTypeSelector.tsx"],"sourcesContent":["'use client';\n\nimport { getConfiguration } from '@intlayer/config/client';\nimport {\n type DictionaryValue,\n type EnumerationContent,\n type KeyPath,\n NodeType,\n type TranslationContent,\n} from '@intlayer/core';\nimport { type FC, useEffect, useState } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { getSectionType } from '../../utils/dictionary';\nimport { useEditedContentStore } from '../DictionaryEditor';\nimport { Select } from '../Select';\nimport { nodeTypeSelectorContent } from './nodeTypeSelector.content';\n\ntype NodeTypeSelectorProps = {\n keyPath: KeyPath[];\n dictionaryKey: string;\n section: DictionaryValue;\n};\n\nexport const NodeTypeSelector: FC<NodeTypeSelectorProps> = ({\n keyPath,\n dictionaryKey,\n section,\n}) => {\n const {\n multilingualText,\n text,\n node,\n array,\n enumeration,\n triggerPlaceHolder,\n } = useDictionary(nodeTypeSelectorContent);\n const nodeType = getSectionType(section);\n const [keyType, setKeyType] = useState<NodeType>(nodeType);\n const { addEditedContent } = useEditedContentStore(\n useShallow((s) => ({\n addEditedContent: s.addEditedContent,\n }))\n );\n const { locales } = getConfiguration().internationalization;\n\n const onValueChange = (keyType: NodeType) => {\n setKeyType(keyType);\n\n switch (keyType) {\n case NodeType.Translation:\n addEditedContent(\n dictionaryKey,\n {\n nodeType: NodeType.Translation,\n [NodeType.Translation]: Object.assign(\n {},\n ...locales.map((locale) => ({\n [locale]: '',\n }))\n ),\n } as TranslationContent<DictionaryValue>,\n keyPath\n );\n break;\n case NodeType.Enumeration:\n addEditedContent(\n dictionaryKey,\n {\n nodeType: NodeType.Enumeration,\n [NodeType.Enumeration]: {\n '1': '',\n '>1': '',\n },\n } as EnumerationContent<DictionaryValue>,\n keyPath\n );\n break;\n case NodeType.Object:\n addEditedContent(dictionaryKey, {}, keyPath);\n break;\n case NodeType.Array:\n addEditedContent(dictionaryKey, [''], keyPath);\n break;\n case NodeType.Text:\n addEditedContent(dictionaryKey, '', keyPath);\n break;\n default:\n addEditedContent(dictionaryKey, {}, keyPath);\n }\n };\n\n useEffect(() => {\n setKeyType(nodeType);\n }, [nodeType]);\n\n return (\n <Select value={keyType} onValueChange={onValueChange}>\n <Select.Trigger className=\"w-40\">\n <Select.Value placeholder={triggerPlaceHolder.value} />\n </Select.Trigger>\n <Select.Content>\n <Select.Item value={NodeType.Translation}>\n {multilingualText}\n </Select.Item>\n <Select.Item value={NodeType.Text}>{text}</Select.Item>\n <Select.Item value={NodeType.Object}>{node}</Select.Item>\n <Select.Item value={NodeType.Array}>{array}</Select.Item>\n <Select.Item value={NodeType.Enumeration}>{enumeration}</Select.Item>\n </Select.Content>\n </Select>\n );\n};\n"],"names":["keyType","jsxs","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBO,MAAM,mBAA8C,CAAC;AAAA,EAC1D;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACE,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AC;AAEb,SACGC,kCAAAA,KAAA,QAAA,EAAO,OAAO,SAAS,eACtB,UAAA;AAAA,IAAAC,kCAAA,IAAC,OAAO,SAAP,EAAe,WAAU,QACxB,UAAAA,kCAAAA,IAAC,OAAO,OAAP,EAAa,aAAa,mBAAmB,MAAA,CAAO,EACvD,CAAA;AAAA,IACAD,kCAAAA,KAAC,OAAO,SAAP,EACC,UAAA;AAAA,MAAAC,sCAAC,OAAO,MAAP,EAAY,OAAO,SAAS,aAC1B,UACH,kBAAA;AAAA,4CACC,OAAO,MAAP,EAAY,OAAO,SAAS,MAAO,UAAK,MAAA;AAAA,4CACxC,OAAO,MAAP,EAAY,OAAO,SAAS,QAAS,UAAK,MAAA;AAAA,4CAC1C,OAAO,MAAP,EAAY,OAAO,SAAS,OAAQ,UAAM,OAAA;AAAA,4CAC1C,OAAO,MAAP,EAAY,OAAO,SAAS,aAAc,UAAY,YAAA,CAAA;AAAA,IAAA,EACzD,CAAA;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowUpFromLine, RotateCcw, Save } 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 { useGetAllDictionaries, usePushDictionaries } from '../../../hooks';\nimport { useEditedContentStore } from '../../DictionaryEditor';\nimport { Form, useForm } from '../../Form';\nimport { saveDictionaryContent } from './saveForm.content';\nimport { getSaveFormSchema } from './SaveFormSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n};\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({ dictionary }) => {\n const { pushDictionaries } = usePushDictionaries();\n const SaveFormSchema = getSaveFormSchema();\n const { online } = useGetAllDictionaries();\n\n const { editedContent, restoreEditedContent } = useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n restoreEditedContent: s.restoreEditedContent,\n }))\n );\n const { form, isSubmitting } = useForm(SaveFormSchema);\n const { resetButton, saveButton, publishButton } = useDictionary(\n saveDictionaryContent\n );\n\n const editedDictionary = useMemo(\n () => editedContent[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const onlineDictionary = useMemo(() => {\n return online?.[dictionary.key];\n }, [online, dictionary.key]);\n\n const isEdited = useMemo(\n () =>\n editedDictionary &&\n onlineDictionary &&\n JSON.stringify(editedDictionary.content) !==\n JSON.stringify(onlineDictionary.content),\n [onlineDictionary, editedDictionary]\n );\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = async () => {\n await pushDictionaries([\n {\n ...dictionary,\n ...editedContent[dictionary.key],\n },\n ]);\n };\n\n return (\n <Form\n className=\"flex w-full flex-1 flex-row justify-end gap-3\"\n {...form}\n schema={SaveFormSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n {isEdited && (\n <Form.Button\n type=\"button\"\n label={resetButton.label.value}\n disabled={!isEdited || isSubmitting}\n className=\"ml-auto\"\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n isLoading={isSubmitting}\n onClick={() => {\n restoreEditedContent(dictionary.key);\n }}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={ArrowUpFromLine}\n color=\"text\"\n isLoading={isSubmitting}\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n isEdited && (\n <Form.Button\n type=\"submit\"\n label={saveButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={Save}\n color=\"text\"\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )\n )}\n </Form>\n );\n};\n"],"names":["usePushDictionaries","getSaveFormSchema","useGetAllDictionaries","useEditedContentStore","useShallow","useForm","useDictionary","saveDictionaryContent","useMemo","jsxs","Form","jsx","RotateCcw","ArrowUpFromLine","Save"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBO,MAAM,WAAuC,CAAC,EAAE,iBAAiB;AAChE,QAAA,EAAE,
|
|
1
|
+
{"version":3,"file":"SaveForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowUpFromLine, RotateCcw, Save } 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 { useGetAllDictionaries, usePushDictionaries } from '../../../hooks';\nimport { useEditedContentStore } from '../../DictionaryEditor';\nimport { Form, useForm } from '../../Form';\nimport { saveDictionaryContent } from './saveForm.content';\nimport { getSaveFormSchema } from './SaveFormSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n};\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({ dictionary }) => {\n const { pushDictionaries } = usePushDictionaries();\n const SaveFormSchema = getSaveFormSchema();\n const { online } = useGetAllDictionaries();\n\n const { editedContent, restoreEditedContent } = useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n restoreEditedContent: s.restoreEditedContent,\n }))\n );\n const { form, isSubmitting } = useForm(SaveFormSchema);\n const { resetButton, saveButton, publishButton } = useDictionary(\n saveDictionaryContent\n );\n\n const editedDictionary = useMemo(\n () => editedContent[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const onlineDictionary = useMemo(() => {\n return online?.[dictionary.key];\n }, [online, dictionary.key]);\n\n const isEdited = useMemo(\n () =>\n editedDictionary &&\n onlineDictionary &&\n JSON.stringify(editedDictionary.content) !==\n JSON.stringify(onlineDictionary.content),\n [onlineDictionary, editedDictionary]\n );\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = async () => {\n await pushDictionaries([\n {\n ...dictionary,\n ...editedContent[dictionary.key],\n },\n ]);\n };\n\n return (\n <Form\n className=\"flex w-full flex-1 flex-row justify-end gap-3\"\n {...form}\n schema={SaveFormSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n {isEdited && (\n <Form.Button\n type=\"button\"\n label={resetButton.label.value}\n disabled={!isEdited || isSubmitting}\n className=\"ml-auto\"\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n isLoading={isSubmitting}\n onClick={() => {\n restoreEditedContent(dictionary.key);\n }}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={ArrowUpFromLine}\n color=\"text\"\n isLoading={isSubmitting}\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n isEdited && (\n <Form.Button\n type=\"submit\"\n label={saveButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={Save}\n color=\"text\"\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )\n )}\n </Form>\n );\n};\n"],"names":["usePushDictionaries","getSaveFormSchema","useGetAllDictionaries","useEditedContentStore","useShallow","useForm","useDictionary","saveDictionaryContent","useMemo","jsxs","Form","jsx","RotateCcw","ArrowUpFromLine","Save"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBO,MAAM,WAAuC,CAAC,EAAE,iBAAiB;AAChE,QAAA,EAAE,iBAAiB,IAAIA,2CAAoB;AACjD,QAAM,iBAAiBC,yDAAAA,kBAAkB;AACnC,QAAA,EAAE,OAAO,IAAIC,kDAAsB;AAEnC,QAAA,EAAE,eAAe,qBA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AAAA,YACV,MAAME,YAAA;AAAA,YACN,SAAQ;AAAA,YACR,OAAM;AAAA,YACN,WAAW;AAAA,YACX,SAAS,MAAM;AACb,mCAAqB,WAAW,GAAG;AAAA,YACrC;AAAA,YAEC,UAAY,YAAA;AAAA,UAAA;AAAA,QACf;AAAA,QAED,oBACCD,2BAAA,kBAAA;AAAA,UAACD,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,cAAc,MAAM;AAAA,YAC3B,UAAU,CAAC,YAAY;AAAA,YACvB,MAAMG,YAAA;AAAA,YACN,OAAM;AAAA,YACN,WAAW;AAAA,YAEV,UAAc,cAAA;AAAA,UAAA;AAAA,YAGjB,YACEF,2BAAA,kBAAA;AAAA,UAACD,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,WAAW,MAAM;AAAA,YACxB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAMI,YAAA;AAAA,YACN,OAAM;AAAA,YACN,WAAW;AAAA,YAEV,UAAW,WAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACd;AAAA,IAAA;AAAA,EAGN;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowUpFromLine, RotateCcw, Save } 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 { useGetAllDictionaries, usePushDictionaries } from '../../../hooks';\nimport { useEditedContentStore } from '../../DictionaryEditor';\nimport { Form, useForm } from '../../Form';\nimport { saveDictionaryContent } from './saveForm.content';\nimport { getSaveFormSchema } from './SaveFormSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n};\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({ dictionary }) => {\n const { pushDictionaries } = usePushDictionaries();\n const SaveFormSchema = getSaveFormSchema();\n const { online } = useGetAllDictionaries();\n\n const { editedContent, restoreEditedContent } = useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n restoreEditedContent: s.restoreEditedContent,\n }))\n );\n const { form, isSubmitting } = useForm(SaveFormSchema);\n const { resetButton, saveButton, publishButton } = useDictionary(\n saveDictionaryContent\n );\n\n const editedDictionary = useMemo(\n () => editedContent[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const onlineDictionary = useMemo(() => {\n return online?.[dictionary.key];\n }, [online, dictionary.key]);\n\n const isEdited = useMemo(\n () =>\n editedDictionary &&\n onlineDictionary &&\n JSON.stringify(editedDictionary.content) !==\n JSON.stringify(onlineDictionary.content),\n [onlineDictionary, editedDictionary]\n );\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = async () => {\n await pushDictionaries([\n {\n ...dictionary,\n ...editedContent[dictionary.key],\n },\n ]);\n };\n\n return (\n <Form\n className=\"flex w-full flex-1 flex-row justify-end gap-3\"\n {...form}\n schema={SaveFormSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n {isEdited && (\n <Form.Button\n type=\"button\"\n label={resetButton.label.value}\n disabled={!isEdited || isSubmitting}\n className=\"ml-auto\"\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n isLoading={isSubmitting}\n onClick={() => {\n restoreEditedContent(dictionary.key);\n }}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={ArrowUpFromLine}\n color=\"text\"\n isLoading={isSubmitting}\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n isEdited && (\n <Form.Button\n type=\"submit\"\n label={saveButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={Save}\n color=\"text\"\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )\n )}\n </Form>\n );\n};\n"],"names":["jsxs","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAmBO,MAAM,WAAuC,CAAC,EAAE,iBAAiB;AAChE,QAAA,EAAE,
|
|
1
|
+
{"version":3,"file":"SaveForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowUpFromLine, RotateCcw, Save } 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 { useGetAllDictionaries, usePushDictionaries } from '../../../hooks';\nimport { useEditedContentStore } from '../../DictionaryEditor';\nimport { Form, useForm } from '../../Form';\nimport { saveDictionaryContent } from './saveForm.content';\nimport { getSaveFormSchema } from './SaveFormSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n};\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({ dictionary }) => {\n const { pushDictionaries } = usePushDictionaries();\n const SaveFormSchema = getSaveFormSchema();\n const { online } = useGetAllDictionaries();\n\n const { editedContent, restoreEditedContent } = useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n restoreEditedContent: s.restoreEditedContent,\n }))\n );\n const { form, isSubmitting } = useForm(SaveFormSchema);\n const { resetButton, saveButton, publishButton } = useDictionary(\n saveDictionaryContent\n );\n\n const editedDictionary = useMemo(\n () => editedContent[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const onlineDictionary = useMemo(() => {\n return online?.[dictionary.key];\n }, [online, dictionary.key]);\n\n const isEdited = useMemo(\n () =>\n editedDictionary &&\n onlineDictionary &&\n JSON.stringify(editedDictionary.content) !==\n JSON.stringify(onlineDictionary.content),\n [onlineDictionary, editedDictionary]\n );\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = async () => {\n await pushDictionaries([\n {\n ...dictionary,\n ...editedContent[dictionary.key],\n },\n ]);\n };\n\n return (\n <Form\n className=\"flex w-full flex-1 flex-row justify-end gap-3\"\n {...form}\n schema={SaveFormSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n {isEdited && (\n <Form.Button\n type=\"button\"\n label={resetButton.label.value}\n disabled={!isEdited || isSubmitting}\n className=\"ml-auto\"\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n isLoading={isSubmitting}\n onClick={() => {\n restoreEditedContent(dictionary.key);\n }}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={ArrowUpFromLine}\n color=\"text\"\n isLoading={isSubmitting}\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n isEdited && (\n <Form.Button\n type=\"submit\"\n label={saveButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={Save}\n color=\"text\"\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )\n )}\n </Form>\n );\n};\n"],"names":["jsxs","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAmBO,MAAM,WAAuC,CAAC,EAAE,iBAAiB;AAChE,QAAA,EAAE,iBAAiB,IAAI,oBAAoB;AACjD,QAAM,iBAAiB,kBAAkB;AACnC,QAAA,EAAE,OAAO,IAAI,sBAAsB;AAEnC,QAAA,EAAE,eAAe,qBAAA,IAAyB;AAAA,IAC9C,WAAW,CAAC,OAAO;AAAA,MACjB,eAAe,EAAE;AAAA,MACjB,sBAAsB,EAAE;AAAA,IAAA,EACxB;AAAA,EACJ;AACA,QAAM,EAAE,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AAK;AAAA,YACL,OAAO,cAAc,MAAM;AAAA,YAC3B,UAAU,CAAC,YAAY;AAAA,YACvB,MAAM;AAAA,YACN,OAAM;AAAA,YACN,WAAW;AAAA,YAEV,UAAc,cAAA;AAAA,UAAA;AAAA,YAGjB,YACEA,kCAAA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,WAAW,MAAM;AAAA,YACxB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAM;AAAA,YACN,OAAM;AAAA,YACN,WAAW;AAAA,YAEV,UAAW,WAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACd;AAAA,IAAA;AAAA,EAGN;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveFormSchema.cjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveFormSchema.ts"],"sourcesContent":["import { z } from 'zod';\n\nexport const getSaveFormSchema = () => {\n return z.object({});\n};\n\nexport type SaveFormData = z.infer<ReturnType<typeof getSaveFormSchema>>;\n"],"names":["z"],"mappings":";;;AAEO,MAAM,oBAAoB,MAAM;AAC9B,SAAAA,IAAA,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"SaveFormSchema.cjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveFormSchema.ts"],"sourcesContent":["import { z } from 'zod';\n\nexport const getSaveFormSchema = () => {\n return z.object({});\n};\n\nexport type SaveFormData = z.infer<ReturnType<typeof getSaveFormSchema>>;\n"],"names":["z"],"mappings":";;;AAEO,MAAM,oBAAoB,MAAM;AAC9B,SAAAA,IAAA,EAAE,OAAO,EAAE;AACpB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveFormSchema.mjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveFormSchema.ts"],"sourcesContent":["import { z } from 'zod';\n\nexport const getSaveFormSchema = () => {\n return z.object({});\n};\n\nexport type SaveFormData = z.infer<ReturnType<typeof getSaveFormSchema>>;\n"],"names":[],"mappings":";AAEO,MAAM,oBAAoB,MAAM;AAC9B,SAAA,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"SaveFormSchema.mjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveFormSchema.ts"],"sourcesContent":["import { z } from 'zod';\n\nexport const getSaveFormSchema = () => {\n return z.object({});\n};\n\nexport type SaveFormData = z.infer<ReturnType<typeof getSaveFormSchema>>;\n"],"names":[],"mappings":";AAEO,MAAM,oBAAoB,MAAM;AAC9B,SAAA,EAAE,OAAO,EAAE;AACpB;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saveForm.content.cjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/saveForm.content.tsx"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const saveDictionaryContent = {\n key: 'save-dictionary-details',\n content: {\n resetButton: {\n text: t({\n en: 'Reset all changes',\n fr: 'Réinitialiser toutes les modifications',\n es: 'Restablecer todas las modificaciones',\n }),\n label: t({\n en: 'Click to reset all the changes',\n fr: 'Cliquez pour réinitialiser toutes les modifications',\n es: 'Haga clic para restablecer todas las modificaciones',\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 dictionnaire',\n es: 'Publicar diccionario',\n }),\n label: t({\n en: 'Click to publish dictionary',\n fr: 'Cliquez pour publier dictionnaire',\n es: 'Haga clic para publicar el diccionario',\n }),\n },\n },\n} satisfies DeclarationContent;\n"],"names":["t"],"mappings":";;;AAEO,MAAM,wBAAwB;AAAA,EACnC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,aAAa;AAAA,MACX,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,
|
|
1
|
+
{"version":3,"file":"saveForm.content.cjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/saveForm.content.tsx"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const saveDictionaryContent = {\n key: 'save-dictionary-details',\n content: {\n resetButton: {\n text: t({\n en: 'Reset all changes',\n fr: 'Réinitialiser toutes les modifications',\n es: 'Restablecer todas las modificaciones',\n }),\n label: t({\n en: 'Click to reset all the changes',\n fr: 'Cliquez pour réinitialiser toutes les modifications',\n es: 'Haga clic para restablecer todas las modificaciones',\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 dictionnaire',\n es: 'Publicar diccionario',\n }),\n label: t({\n en: 'Click to publish dictionary',\n fr: 'Cliquez pour publier dictionnaire',\n es: 'Haga clic para publicar el diccionario',\n }),\n },\n },\n} satisfies DeclarationContent;\n"],"names":["t"],"mappings":";;;AAEO,MAAM,wBAAwB;AAAA,EACnC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,aAAa;AAAA,MACX,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,IACH;AAAA,IACA,YAAY;AAAA,MACV,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,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;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saveForm.content.mjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/saveForm.content.tsx"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const saveDictionaryContent = {\n key: 'save-dictionary-details',\n content: {\n resetButton: {\n text: t({\n en: 'Reset all changes',\n fr: 'Réinitialiser toutes les modifications',\n es: 'Restablecer todas las modificaciones',\n }),\n label: t({\n en: 'Click to reset all the changes',\n fr: 'Cliquez pour réinitialiser toutes les modifications',\n es: 'Haga clic para restablecer todas las modificaciones',\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 dictionnaire',\n es: 'Publicar diccionario',\n }),\n label: t({\n en: 'Click to publish dictionary',\n fr: 'Cliquez pour publier dictionnaire',\n es: 'Haga clic para publicar el diccionario',\n }),\n },\n },\n} satisfies DeclarationContent;\n"],"names":[],"mappings":";AAEO,MAAM,wBAAwB;AAAA,EACnC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,aAAa;AAAA,MACX,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,
|
|
1
|
+
{"version":3,"file":"saveForm.content.mjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/saveForm.content.tsx"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const saveDictionaryContent = {\n key: 'save-dictionary-details',\n content: {\n resetButton: {\n text: t({\n en: 'Reset all changes',\n fr: 'Réinitialiser toutes les modifications',\n es: 'Restablecer todas las modificaciones',\n }),\n label: t({\n en: 'Click to reset all the changes',\n fr: 'Cliquez pour réinitialiser toutes les modifications',\n es: 'Haga clic para restablecer todas las modificaciones',\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 dictionnaire',\n es: 'Publicar diccionario',\n }),\n label: t({\n en: 'Click to publish dictionary',\n fr: 'Cliquez pour publier dictionnaire',\n es: 'Haga clic para publicar el diccionario',\n }),\n },\n },\n} satisfies DeclarationContent;\n"],"names":[],"mappings":";AAEO,MAAM,wBAAwB;AAAA,EACnC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,aAAa;AAAA,MACX,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,IACH;AAAA,IACA,YAAY;AAAA,MACV,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,IACH;AAAA,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.content.cjs","sources":["../../../src/components/DictionaryFieldEditor/dictionaryFieldEditor.content.ts"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const dictionaryFieldEditorContent = {\n key: 'dictionary-field-editor',\n content: {\n titleInformation: t({\n en: 'Dictionary informations',\n fr: 'Informations du dictionnaire',\n es: 'Información del diccionario',\n }),\n titleContent: t({\n en: 'Dictionary content',\n fr: 'Contenu du dictionnaire',\n es: 'Contenido del diccionario',\n }),\n returnToDictionaryList: {\n label: t({\n en: 'Return to dictionary list',\n fr: 'Retourner à la liste des dictionnaires',\n es: 'Volver a la lista de diccionarios',\n }),\n text: t({\n en: 'Dictionary list',\n fr: 'Liste des dictionnaires',\n es: 'Lista de diccionarios',\n }),\n },\n },\n} satisfies DeclarationContent;\n"],"names":["t"],"mappings":";;;AAEO,MAAM,+BAA+B;AAAA,EAC1C,KAAK;AAAA,EACL,SAAS;AAAA,IACP,kBAAkBA,SAAAA,EAAE;AAAA,MAClB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,cAAcA,SAAAA,EAAE;AAAA,MACd,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,wBAAwB;AAAA,MACtB,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,MAAMA,SAAAA,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,
|
|
1
|
+
{"version":3,"file":"dictionaryFieldEditor.content.cjs","sources":["../../../src/components/DictionaryFieldEditor/dictionaryFieldEditor.content.ts"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const dictionaryFieldEditorContent = {\n key: 'dictionary-field-editor',\n content: {\n titleInformation: t({\n en: 'Dictionary informations',\n fr: 'Informations du dictionnaire',\n es: 'Información del diccionario',\n }),\n titleContent: t({\n en: 'Dictionary content',\n fr: 'Contenu du dictionnaire',\n es: 'Contenido del diccionario',\n }),\n returnToDictionaryList: {\n label: t({\n en: 'Return to dictionary list',\n fr: 'Retourner à la liste des dictionnaires',\n es: 'Volver a la lista de diccionarios',\n }),\n text: t({\n en: 'Dictionary list',\n fr: 'Liste des dictionnaires',\n es: 'Lista de diccionarios',\n }),\n },\n },\n} satisfies DeclarationContent;\n"],"names":["t"],"mappings":";;;AAEO,MAAM,+BAA+B;AAAA,EAC1C,KAAK;AAAA,EACL,SAAS;AAAA,IACP,kBAAkBA,SAAAA,EAAE;AAAA,MAClB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,cAAcA,SAAAA,EAAE;AAAA,MACd,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,wBAAwB;AAAA,MACtB,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,MAAMA,SAAAA,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IAAA;AAAA,EACH;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionaryFieldEditor.content.mjs","sources":["../../../src/components/DictionaryFieldEditor/dictionaryFieldEditor.content.ts"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const dictionaryFieldEditorContent = {\n key: 'dictionary-field-editor',\n content: {\n titleInformation: t({\n en: 'Dictionary informations',\n fr: 'Informations du dictionnaire',\n es: 'Información del diccionario',\n }),\n titleContent: t({\n en: 'Dictionary content',\n fr: 'Contenu du dictionnaire',\n es: 'Contenido del diccionario',\n }),\n returnToDictionaryList: {\n label: t({\n en: 'Return to dictionary list',\n fr: 'Retourner à la liste des dictionnaires',\n es: 'Volver a la lista de diccionarios',\n }),\n text: t({\n en: 'Dictionary list',\n fr: 'Liste des dictionnaires',\n es: 'Lista de diccionarios',\n }),\n },\n },\n} satisfies DeclarationContent;\n"],"names":[],"mappings":";AAEO,MAAM,+BAA+B;AAAA,EAC1C,KAAK;AAAA,EACL,SAAS;AAAA,IACP,kBAAkB,EAAE;AAAA,MAClB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,cAAc,EAAE;AAAA,MACd,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,wBAAwB;AAAA,MACtB,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,MAAM,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,
|
|
1
|
+
{"version":3,"file":"dictionaryFieldEditor.content.mjs","sources":["../../../src/components/DictionaryFieldEditor/dictionaryFieldEditor.content.ts"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const dictionaryFieldEditorContent = {\n key: 'dictionary-field-editor',\n content: {\n titleInformation: t({\n en: 'Dictionary informations',\n fr: 'Informations du dictionnaire',\n es: 'Información del diccionario',\n }),\n titleContent: t({\n en: 'Dictionary content',\n fr: 'Contenu du dictionnaire',\n es: 'Contenido del diccionario',\n }),\n returnToDictionaryList: {\n label: t({\n en: 'Return to dictionary list',\n fr: 'Retourner à la liste des dictionnaires',\n es: 'Volver a la lista de diccionarios',\n }),\n text: t({\n en: 'Dictionary list',\n fr: 'Liste des dictionnaires',\n es: 'Lista de diccionarios',\n }),\n },\n },\n} satisfies DeclarationContent;\n"],"names":[],"mappings":";AAEO,MAAM,+BAA+B;AAAA,EAC1C,KAAK;AAAA,EACL,SAAS;AAAA,IACP,kBAAkB,EAAE;AAAA,MAClB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,cAAc,EAAE;AAAA,MACd,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,wBAAwB;AAAA,MACtB,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,MAAM,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IAAA;AAAA,EACH;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editorView.content.cjs","sources":["../../../src/components/DictionaryFieldEditor/editorView.content.ts"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const editorViewContent = {\n key: 'editor-view',\n content: {\n titleInput: {\n label: t({\n en: 'Node key',\n fr: 'Clé du nœud',\n es: 'Clave del nodo',\n }),\n placeholder: t({\n en: 'Enter the key of your node',\n fr: 'Entrez la clé de votre nœud',\n es: 'Ingrese la clave de su nodo',\n }),\n },\n nodeTypeSelector: {\n label: t({\n en: 'Node type',\n fr: 'Type de nœud',\n es: 'Tipo de nodo',\n }),\n },\n restoreButton: {\n text: t({\n en: 'Restore node changes',\n fr: 'Restaurer les modifications du nœud',\n es: 'Restaurar los cambios del nodo',\n }),\n label: t({\n en: 'Restore node changes',\n fr: 'Restaurer les modifications du nœud',\n es: 'Restaurar los cambios del nodo',\n }),\n },\n deleteButton: {\n text: t({\n en: 'Delete node',\n fr: 'Supprimer le nœud',\n es: 'Eliminar el nodo',\n }),\n label: t({\n en: 'Remove node from section',\n fr: 'Supprimer le nœud de la section',\n es: 'Eliminar el nodo de la sección',\n }),\n },\n },\n} satisfies DeclarationContent;\n"],"names":["t"],"mappings":";;;AAEO,MAAM,oBAAoB;AAAA,EAC/B,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,
|
|
1
|
+
{"version":3,"file":"editorView.content.cjs","sources":["../../../src/components/DictionaryFieldEditor/editorView.content.ts"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const editorViewContent = {\n key: 'editor-view',\n content: {\n titleInput: {\n label: t({\n en: 'Node key',\n fr: 'Clé du nœud',\n es: 'Clave del nodo',\n }),\n placeholder: t({\n en: 'Enter the key of your node',\n fr: 'Entrez la clé de votre nœud',\n es: 'Ingrese la clave de su nodo',\n }),\n },\n nodeTypeSelector: {\n label: t({\n en: 'Node type',\n fr: 'Type de nœud',\n es: 'Tipo de nodo',\n }),\n },\n restoreButton: {\n text: t({\n en: 'Restore node changes',\n fr: 'Restaurer les modifications du nœud',\n es: 'Restaurar los cambios del nodo',\n }),\n label: t({\n en: 'Restore node changes',\n fr: 'Restaurer les modifications du nœud',\n es: 'Restaurar los cambios del nodo',\n }),\n },\n deleteButton: {\n text: t({\n en: 'Delete node',\n fr: 'Supprimer le nœud',\n es: 'Eliminar el nodo',\n }),\n label: t({\n en: 'Remove node from section',\n fr: 'Supprimer le nœud de la section',\n es: 'Eliminar el nodo de la sección',\n }),\n },\n },\n} satisfies DeclarationContent;\n"],"names":["t"],"mappings":";;;AAEO,MAAM,oBAAoB;AAAA,EAC/B,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,MACL,CAAA;AAAA,IACH;AAAA,IACA,kBAAkB;AAAA,MAChB,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,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,IACH;AAAA,IACA,cAAc;AAAA,MACZ,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;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editorView.content.mjs","sources":["../../../src/components/DictionaryFieldEditor/editorView.content.ts"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const editorViewContent = {\n key: 'editor-view',\n content: {\n titleInput: {\n label: t({\n en: 'Node key',\n fr: 'Clé du nœud',\n es: 'Clave del nodo',\n }),\n placeholder: t({\n en: 'Enter the key of your node',\n fr: 'Entrez la clé de votre nœud',\n es: 'Ingrese la clave de su nodo',\n }),\n },\n nodeTypeSelector: {\n label: t({\n en: 'Node type',\n fr: 'Type de nœud',\n es: 'Tipo de nodo',\n }),\n },\n restoreButton: {\n text: t({\n en: 'Restore node changes',\n fr: 'Restaurer les modifications du nœud',\n es: 'Restaurar los cambios del nodo',\n }),\n label: t({\n en: 'Restore node changes',\n fr: 'Restaurer les modifications du nœud',\n es: 'Restaurar los cambios del nodo',\n }),\n },\n deleteButton: {\n text: t({\n en: 'Delete node',\n fr: 'Supprimer le nœud',\n es: 'Eliminar el nodo',\n }),\n label: t({\n en: 'Remove node from section',\n fr: 'Supprimer le nœud de la section',\n es: 'Eliminar el nodo de la sección',\n }),\n },\n },\n} satisfies DeclarationContent;\n"],"names":[],"mappings":";AAEO,MAAM,oBAAoB;AAAA,EAC/B,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,
|
|
1
|
+
{"version":3,"file":"editorView.content.mjs","sources":["../../../src/components/DictionaryFieldEditor/editorView.content.ts"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const editorViewContent = {\n key: 'editor-view',\n content: {\n titleInput: {\n label: t({\n en: 'Node key',\n fr: 'Clé du nœud',\n es: 'Clave del nodo',\n }),\n placeholder: t({\n en: 'Enter the key of your node',\n fr: 'Entrez la clé de votre nœud',\n es: 'Ingrese la clave de su nodo',\n }),\n },\n nodeTypeSelector: {\n label: t({\n en: 'Node type',\n fr: 'Type de nœud',\n es: 'Tipo de nodo',\n }),\n },\n restoreButton: {\n text: t({\n en: 'Restore node changes',\n fr: 'Restaurer les modifications du nœud',\n es: 'Restaurar los cambios del nodo',\n }),\n label: t({\n en: 'Restore node changes',\n fr: 'Restaurer les modifications du nœud',\n es: 'Restaurar los cambios del nodo',\n }),\n },\n deleteButton: {\n text: t({\n en: 'Delete node',\n fr: 'Supprimer le nœud',\n es: 'Eliminar el nodo',\n }),\n label: t({\n en: 'Remove node from section',\n fr: 'Supprimer le nœud de la section',\n es: 'Eliminar el nodo de la sección',\n }),\n },\n },\n} satisfies DeclarationContent;\n"],"names":[],"mappings":";AAEO,MAAM,oBAAoB;AAAA,EAC/B,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,MACL,CAAA;AAAA,IACH;AAAA,IACA,kBAAkB;AAAA,MAChB,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IACH;AAAA,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,IACH;AAAA,IACA,cAAc;AAAA,MACZ,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":"getIsEditableSection.cjs","sources":["../../../src/components/DictionaryFieldEditor/getIsEditableSection.ts"],"sourcesContent":["import {\n type DictionaryValue,\n type TranslationContent,\n type EnumerationContent,\n type RecursiveDictionaryValue,\n NodeType,\n} from '@intlayer/core';\nimport { isValidElement } from 'react';\n\nconst getIsReactNodeContent = (section: DictionaryValue) =>\n // Check if type of section is multilingual content\n isValidElement(section);\n\nconst getIsStringTranslationContent = (section: DictionaryValue) =>\n // Check if type of section is multilingual content\n (section as TranslationContent<unknown>)?.nodeType === NodeType.Translation &&\n // Check if the content is a string\n typeof Object.values(\n (section as TranslationContent<unknown>)[NodeType.Translation]\n )[0] === 'string';\n\nconst getIsStringEnumerationContent = (section: DictionaryValue) =>\n // Check if type of section is enumeration content\n (section as EnumerationContent<unknown>)?.nodeType === NodeType.Enumeration &&\n // Check if the enum has no content\n (Object.values((section as EnumerationContent<unknown>)[NodeType.Enumeration])\n .length === 0 ||\n // Check if the content is a string\n typeof Object.values(\n (section as EnumerationContent<unknown>)[NodeType.Enumeration]\n )[0] === 'string');\n\nconst getIsStringArrayContent = (section: DictionaryValue) =>\n // Check if the content is an array\n Array.isArray(section) &&\n // Check if the array has no content\n (section.length === 0 ||\n // Check if the content is a string\n (section as RecursiveDictionaryValue[]).every(\n (el) => typeof el === 'string'\n ));\n\nexport const getIsEditableSection = (section: DictionaryValue) =>\n typeof section === 'string' || // String\n getIsReactNodeContent(section) || // ReactNode\n getIsStringTranslationContent(section) || // Translation\n getIsStringEnumerationContent(section) || // Translation\n getIsStringArrayContent(section); // Array\n"],"names":["isValidElement","NodeType"],"mappings":";;;;AASA,MAAM,wBAAwB,CAAC;AAAA;AAAA,EAE7BA,WAAAA,eAAe,OAAO;AAAA;AAExB,MAAM,gCAAgC,CAAC;AAAA;AAAA,EAEpC,SAAyC,aAAaC,KAAAA,SAAS;AAAA,EAEhE,OAAO,OAAO;AAAA,IACX,QAAwCA,cAAS,WAAW;AAAA,
|
|
1
|
+
{"version":3,"file":"getIsEditableSection.cjs","sources":["../../../src/components/DictionaryFieldEditor/getIsEditableSection.ts"],"sourcesContent":["import {\n type DictionaryValue,\n type TranslationContent,\n type EnumerationContent,\n type RecursiveDictionaryValue,\n NodeType,\n} from '@intlayer/core';\nimport { isValidElement } from 'react';\n\nconst getIsReactNodeContent = (section: DictionaryValue) =>\n // Check if type of section is multilingual content\n isValidElement(section);\n\nconst getIsStringTranslationContent = (section: DictionaryValue) =>\n // Check if type of section is multilingual content\n (section as TranslationContent<unknown>)?.nodeType === NodeType.Translation &&\n // Check if the content is a string\n typeof Object.values(\n (section as TranslationContent<unknown>)[NodeType.Translation]\n )[0] === 'string';\n\nconst getIsStringEnumerationContent = (section: DictionaryValue) =>\n // Check if type of section is enumeration content\n (section as EnumerationContent<unknown>)?.nodeType === NodeType.Enumeration &&\n // Check if the enum has no content\n (Object.values((section as EnumerationContent<unknown>)[NodeType.Enumeration])\n .length === 0 ||\n // Check if the content is a string\n typeof Object.values(\n (section as EnumerationContent<unknown>)[NodeType.Enumeration]\n )[0] === 'string');\n\nconst getIsStringArrayContent = (section: DictionaryValue) =>\n // Check if the content is an array\n Array.isArray(section) &&\n // Check if the array has no content\n (section.length === 0 ||\n // Check if the content is a string\n (section as RecursiveDictionaryValue[]).every(\n (el) => typeof el === 'string'\n ));\n\nexport const getIsEditableSection = (section: DictionaryValue) =>\n typeof section === 'string' || // String\n getIsReactNodeContent(section) || // ReactNode\n getIsStringTranslationContent(section) || // Translation\n getIsStringEnumerationContent(section) || // Translation\n getIsStringArrayContent(section); // Array\n"],"names":["isValidElement","NodeType"],"mappings":";;;;AASA,MAAM,wBAAwB,CAAC;AAAA;AAAA,EAE7BA,WAAAA,eAAe,OAAO;AAAA;AAExB,MAAM,gCAAgC,CAAC;AAAA;AAAA,EAEpC,SAAyC,aAAaC,KAAAA,SAAS;AAAA,EAEhE,OAAO,OAAO;AAAA,IACX,QAAwCA,cAAS,WAAW;AAAA,EAC/D,EAAE,CAAC,MAAM;AAAA;AAEX,MAAM,gCAAgC,CAAC;AAAA;AAAA,EAEpC,SAAyC,aAAaA,KAAAA,SAAS;AAAA,GAE/D,OAAO,OAAQ,QAAwCA,KAAAA,SAAS,WAAW,CAAC,EAC1E,WAAW;AAAA,EAEZ,OAAO,OAAO;AAAA,IACX,QAAwCA,cAAS,WAAW;AAAA,EAAA,EAC7D,CAAC,MAAM;AAAA;AAEb,MAAM,0BAA0B,CAAC;AAAA;AAAA,EAE/B,MAAM,QAAQ,OAAO;AAAA,GAEpB,QAAQ,WAAW;AAAA,EAEjB,QAAuC;AAAA,IACtC,CAAC,OAAO,OAAO,OAAO;AAAA,EACxB;AAAA;AAEG,MAAM,uBAAuB,CAAC,YACnC,OAAO,YAAY;AACnB,sBAAsB,OAAO;AAC7B,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,wBAAwB,OAAO;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getIsEditableSection.mjs","sources":["../../../src/components/DictionaryFieldEditor/getIsEditableSection.ts"],"sourcesContent":["import {\n type DictionaryValue,\n type TranslationContent,\n type EnumerationContent,\n type RecursiveDictionaryValue,\n NodeType,\n} from '@intlayer/core';\nimport { isValidElement } from 'react';\n\nconst getIsReactNodeContent = (section: DictionaryValue) =>\n // Check if type of section is multilingual content\n isValidElement(section);\n\nconst getIsStringTranslationContent = (section: DictionaryValue) =>\n // Check if type of section is multilingual content\n (section as TranslationContent<unknown>)?.nodeType === NodeType.Translation &&\n // Check if the content is a string\n typeof Object.values(\n (section as TranslationContent<unknown>)[NodeType.Translation]\n )[0] === 'string';\n\nconst getIsStringEnumerationContent = (section: DictionaryValue) =>\n // Check if type of section is enumeration content\n (section as EnumerationContent<unknown>)?.nodeType === NodeType.Enumeration &&\n // Check if the enum has no content\n (Object.values((section as EnumerationContent<unknown>)[NodeType.Enumeration])\n .length === 0 ||\n // Check if the content is a string\n typeof Object.values(\n (section as EnumerationContent<unknown>)[NodeType.Enumeration]\n )[0] === 'string');\n\nconst getIsStringArrayContent = (section: DictionaryValue) =>\n // Check if the content is an array\n Array.isArray(section) &&\n // Check if the array has no content\n (section.length === 0 ||\n // Check if the content is a string\n (section as RecursiveDictionaryValue[]).every(\n (el) => typeof el === 'string'\n ));\n\nexport const getIsEditableSection = (section: DictionaryValue) =>\n typeof section === 'string' || // String\n getIsReactNodeContent(section) || // ReactNode\n getIsStringTranslationContent(section) || // Translation\n getIsStringEnumerationContent(section) || // Translation\n getIsStringArrayContent(section); // Array\n"],"names":[],"mappings":";;AASA,MAAM,wBAAwB,CAAC;AAAA;AAAA,EAE7B,eAAe,OAAO;AAAA;AAExB,MAAM,gCAAgC,CAAC;AAAA;AAAA,EAEpC,SAAyC,aAAa,SAAS;AAAA,EAEhE,OAAO,OAAO;AAAA,IACX,QAAwC,SAAS,WAAW;AAAA,
|
|
1
|
+
{"version":3,"file":"getIsEditableSection.mjs","sources":["../../../src/components/DictionaryFieldEditor/getIsEditableSection.ts"],"sourcesContent":["import {\n type DictionaryValue,\n type TranslationContent,\n type EnumerationContent,\n type RecursiveDictionaryValue,\n NodeType,\n} from '@intlayer/core';\nimport { isValidElement } from 'react';\n\nconst getIsReactNodeContent = (section: DictionaryValue) =>\n // Check if type of section is multilingual content\n isValidElement(section);\n\nconst getIsStringTranslationContent = (section: DictionaryValue) =>\n // Check if type of section is multilingual content\n (section as TranslationContent<unknown>)?.nodeType === NodeType.Translation &&\n // Check if the content is a string\n typeof Object.values(\n (section as TranslationContent<unknown>)[NodeType.Translation]\n )[0] === 'string';\n\nconst getIsStringEnumerationContent = (section: DictionaryValue) =>\n // Check if type of section is enumeration content\n (section as EnumerationContent<unknown>)?.nodeType === NodeType.Enumeration &&\n // Check if the enum has no content\n (Object.values((section as EnumerationContent<unknown>)[NodeType.Enumeration])\n .length === 0 ||\n // Check if the content is a string\n typeof Object.values(\n (section as EnumerationContent<unknown>)[NodeType.Enumeration]\n )[0] === 'string');\n\nconst getIsStringArrayContent = (section: DictionaryValue) =>\n // Check if the content is an array\n Array.isArray(section) &&\n // Check if the array has no content\n (section.length === 0 ||\n // Check if the content is a string\n (section as RecursiveDictionaryValue[]).every(\n (el) => typeof el === 'string'\n ));\n\nexport const getIsEditableSection = (section: DictionaryValue) =>\n typeof section === 'string' || // String\n getIsReactNodeContent(section) || // ReactNode\n getIsStringTranslationContent(section) || // Translation\n getIsStringEnumerationContent(section) || // Translation\n getIsStringArrayContent(section); // Array\n"],"names":[],"mappings":";;AASA,MAAM,wBAAwB,CAAC;AAAA;AAAA,EAE7B,eAAe,OAAO;AAAA;AAExB,MAAM,gCAAgC,CAAC;AAAA;AAAA,EAEpC,SAAyC,aAAa,SAAS;AAAA,EAEhE,OAAO,OAAO;AAAA,IACX,QAAwC,SAAS,WAAW;AAAA,EAC/D,EAAE,CAAC,MAAM;AAAA;AAEX,MAAM,gCAAgC,CAAC;AAAA;AAAA,EAEpC,SAAyC,aAAa,SAAS;AAAA,GAE/D,OAAO,OAAQ,QAAwC,SAAS,WAAW,CAAC,EAC1E,WAAW;AAAA,EAEZ,OAAO,OAAO;AAAA,IACX,QAAwC,SAAS,WAAW;AAAA,EAAA,EAC7D,CAAC,MAAM;AAAA;AAEb,MAAM,0BAA0B,CAAC;AAAA;AAAA,EAE/B,MAAM,QAAQ,OAAO;AAAA,GAEpB,QAAQ,WAAW;AAAA,EAEjB,QAAuC;AAAA,IACtC,CAAC,OAAO,OAAO,OAAO;AAAA,EACxB;AAAA;AAEG,MAAM,uBAAuB,CAAC,YACnC,OAAO,YAAY;AACnB,sBAAsB,OAAO;AAC7B,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,wBAAwB,OAAO;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeTypeSelector.content.cjs","sources":["../../../src/components/DictionaryFieldEditor/nodeTypeSelector.content.ts"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const nodeTypeSelectorContent = {\n key: 'node-type-selector',\n content: {\n triggerPlaceHolder: t({\n en: 'Node type',\n fr: 'Type du Nœud',\n es: 'Typo del nodo',\n }),\n multilingualText: t({\n en: 'Multilingual Text',\n fr: 'Texte multilingue',\n es: 'Texto multilingüe',\n }),\n text: t({\n en: 'Text',\n fr: 'Texte',\n es: 'Texto',\n }),\n node: t({\n en: 'Node',\n fr: 'Nœud',\n es: 'Nodo',\n }),\n array: t({\n en: 'Array',\n fr: 'Tableau',\n es: 'Matriz',\n }),\n enumeration: t({\n en: 'Enumeration',\n fr: 'Énumération',\n es: 'Enumeración',\n }),\n },\n} satisfies DeclarationContent;\n"],"names":["t"],"mappings":";;;AAEO,MAAM,0BAA0B;AAAA,EACrC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,oBAAoBA,SAAAA,EAAE;AAAA,MACpB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,kBAAkBA,SAAAA,EAAE;AAAA,MAClB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,MAAMA,SAAAA,EAAE;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,MAAMA,SAAAA,EAAE;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,OAAOA,SAAAA,EAAE;AAAA,MACP,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,aAAaA,SAAAA,EAAE;AAAA,MACb,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,
|
|
1
|
+
{"version":3,"file":"nodeTypeSelector.content.cjs","sources":["../../../src/components/DictionaryFieldEditor/nodeTypeSelector.content.ts"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const nodeTypeSelectorContent = {\n key: 'node-type-selector',\n content: {\n triggerPlaceHolder: t({\n en: 'Node type',\n fr: 'Type du Nœud',\n es: 'Typo del nodo',\n }),\n multilingualText: t({\n en: 'Multilingual Text',\n fr: 'Texte multilingue',\n es: 'Texto multilingüe',\n }),\n text: t({\n en: 'Text',\n fr: 'Texte',\n es: 'Texto',\n }),\n node: t({\n en: 'Node',\n fr: 'Nœud',\n es: 'Nodo',\n }),\n array: t({\n en: 'Array',\n fr: 'Tableau',\n es: 'Matriz',\n }),\n enumeration: t({\n en: 'Enumeration',\n fr: 'Énumération',\n es: 'Enumeración',\n }),\n },\n} satisfies DeclarationContent;\n"],"names":["t"],"mappings":";;;AAEO,MAAM,0BAA0B;AAAA,EACrC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,oBAAoBA,SAAAA,EAAE;AAAA,MACpB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,kBAAkBA,SAAAA,EAAE;AAAA,MAClB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,MAAMA,SAAAA,EAAE;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,MAAMA,SAAAA,EAAE;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,OAAOA,SAAAA,EAAE;AAAA,MACP,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,aAAaA,SAAAA,EAAE;AAAA,MACb,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACL,CAAA;AAAA,EAAA;AAEL;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeTypeSelector.content.mjs","sources":["../../../src/components/DictionaryFieldEditor/nodeTypeSelector.content.ts"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const nodeTypeSelectorContent = {\n key: 'node-type-selector',\n content: {\n triggerPlaceHolder: t({\n en: 'Node type',\n fr: 'Type du Nœud',\n es: 'Typo del nodo',\n }),\n multilingualText: t({\n en: 'Multilingual Text',\n fr: 'Texte multilingue',\n es: 'Texto multilingüe',\n }),\n text: t({\n en: 'Text',\n fr: 'Texte',\n es: 'Texto',\n }),\n node: t({\n en: 'Node',\n fr: 'Nœud',\n es: 'Nodo',\n }),\n array: t({\n en: 'Array',\n fr: 'Tableau',\n es: 'Matriz',\n }),\n enumeration: t({\n en: 'Enumeration',\n fr: 'Énumération',\n es: 'Enumeración',\n }),\n },\n} satisfies DeclarationContent;\n"],"names":[],"mappings":";AAEO,MAAM,0BAA0B;AAAA,EACrC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,oBAAoB,EAAE;AAAA,MACpB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,kBAAkB,EAAE;AAAA,MAClB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,MAAM,EAAE;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,MAAM,EAAE;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,OAAO,EAAE;AAAA,MACP,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,aAAa,EAAE;AAAA,MACb,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,
|
|
1
|
+
{"version":3,"file":"nodeTypeSelector.content.mjs","sources":["../../../src/components/DictionaryFieldEditor/nodeTypeSelector.content.ts"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const nodeTypeSelectorContent = {\n key: 'node-type-selector',\n content: {\n triggerPlaceHolder: t({\n en: 'Node type',\n fr: 'Type du Nœud',\n es: 'Typo del nodo',\n }),\n multilingualText: t({\n en: 'Multilingual Text',\n fr: 'Texte multilingue',\n es: 'Texto multilingüe',\n }),\n text: t({\n en: 'Text',\n fr: 'Texte',\n es: 'Texto',\n }),\n node: t({\n en: 'Node',\n fr: 'Nœud',\n es: 'Nodo',\n }),\n array: t({\n en: 'Array',\n fr: 'Tableau',\n es: 'Matriz',\n }),\n enumeration: t({\n en: 'Enumeration',\n fr: 'Énumération',\n es: 'Enumeración',\n }),\n },\n} satisfies DeclarationContent;\n"],"names":[],"mappings":";AAEO,MAAM,0BAA0B;AAAA,EACrC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,oBAAoB,EAAE;AAAA,MACpB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,kBAAkB,EAAE;AAAA,MAClB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,MAAM,EAAE;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,MAAM,EAAE;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,OAAO,EAAE;AAAA,MACP,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,aAAa,EAAE;AAAA,MACb,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACL,CAAA;AAAA,EAAA;AAEL;"}
|