@intlayer/design-system 5.6.0 → 5.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/manifest.json +88 -560
- package/dist/components/Command/index.d.ts +5 -5
- package/dist/components/ContentEditor/ContentEditorTextArea.cjs +2 -27
- package/dist/components/ContentEditor/ContentEditorTextArea.cjs.map +1 -1
- package/dist/components/ContentEditor/ContentEditorTextArea.d.ts +1 -1
- package/dist/components/ContentEditor/ContentEditorTextArea.d.ts.map +1 -1
- package/dist/components/ContentEditor/ContentEditorTextArea.mjs +1 -26
- package/dist/components/ContentEditor/ContentEditorTextArea.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs +2 -0
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +2 -0
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +9 -28
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +8 -27
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.mjs +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +10 -26
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +9 -25
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.mjs +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +7 -20
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +6 -19
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureView/StructureView.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/StructureView/StructureView.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs +2 -2
- package/dist/components/EditableField/EditableFieldTextArea.cjs +2 -2
- package/dist/components/EditableField/EditableFieldTextArea.mjs +2 -2
- package/dist/components/Form/elements/FormElementWrapper.cjs +1 -1
- package/dist/components/Form/elements/FormElementWrapper.mjs +1 -1
- package/dist/components/IDE/CodeContext.cjs +2 -2
- package/dist/components/IDE/CodeContext.mjs +2 -2
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs +2 -2
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +2 -2
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs +2 -2
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs +2 -2
- package/dist/components/Modal/Modal.cjs +3 -3
- package/dist/components/Modal/Modal.mjs +3 -3
- package/dist/components/Navbar/MobileNavbar.cjs +2 -2
- package/dist/components/Navbar/MobileNavbar.mjs +2 -2
- package/dist/components/Navbar/index.cjs +3 -3
- package/dist/components/Navbar/index.mjs +3 -3
- package/dist/components/Pattern/GridPattern.cjs +45 -48
- package/dist/components/Pattern/GridPattern.cjs.map +1 -1
- package/dist/components/Pattern/GridPattern.d.ts.map +1 -1
- package/dist/components/Pattern/GridPattern.mjs +45 -48
- package/dist/components/Pattern/GridPattern.mjs.map +1 -1
- package/dist/components/SwitchSelector/index.cjs +2 -2
- package/dist/components/SwitchSelector/index.mjs +2 -2
- package/dist/components/TabSelector/TabSelector.cjs +2 -2
- package/dist/components/TabSelector/TabSelector.mjs +2 -2
- package/dist/components/TextArea/AutocompleteTextArea.cjs +90 -13
- package/dist/components/TextArea/AutocompleteTextArea.cjs.map +1 -1
- package/dist/components/TextArea/AutocompleteTextArea.d.ts.map +1 -1
- package/dist/components/TextArea/AutocompleteTextArea.mjs +92 -15
- package/dist/components/TextArea/AutocompleteTextArea.mjs.map +1 -1
- package/dist/components/index.cjs +0 -38
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.ts +0 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.mjs +0 -38
- package/dist/components/index.mjs.map +1 -1
- package/dist/hooks/index.cjs +8 -1
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.mjs +9 -2
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/hooks/intlayerAPIHooks.cjs +29 -31
- package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
- package/dist/hooks/intlayerAPIHooks.d.ts +678 -10
- package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
- package/dist/hooks/intlayerAPIHooks.mjs +29 -31
- package/dist/hooks/intlayerAPIHooks.mjs.map +1 -1
- package/dist/hooks/useAsync/useAsync.cjs +0 -1
- package/dist/hooks/useAsync/useAsync.cjs.map +1 -1
- package/dist/hooks/useAsync/useAsync.d.ts.map +1 -1
- package/dist/hooks/useAsync/useAsync.mjs +0 -1
- package/dist/hooks/useAsync/useAsync.mjs.map +1 -1
- package/dist/hooks/useAuth/index.cjs +9 -0
- package/dist/{components/Auth/AuthenticationBarrier → hooks/useAuth}/index.cjs.map +1 -1
- package/dist/hooks/useAuth/index.d.ts +4 -0
- package/dist/hooks/useAuth/index.d.ts.map +1 -0
- package/dist/hooks/useAuth/index.mjs +9 -0
- package/dist/{components/Auth/ExternalsLoginButtons → hooks/useAuth}/index.mjs.map +1 -1
- package/dist/hooks/useAuth/useAuth.cjs +25 -0
- package/dist/hooks/useAuth/useAuth.cjs.map +1 -0
- package/dist/{components/Auth/useAuth/index.d.ts → hooks/useAuth/useAuth.d.ts} +3 -13
- package/dist/hooks/useAuth/useAuth.d.ts.map +1 -0
- package/dist/{components/Auth/useAuth/index.mjs → hooks/useAuth/useAuth.mjs} +2 -8
- package/dist/hooks/useAuth/useAuth.mjs.map +1 -0
- package/dist/{components/Auth → hooks}/useAuth/useOAuth2.cjs +3 -3
- package/dist/hooks/useAuth/useOAuth2.cjs.map +1 -0
- package/dist/{components/Auth → hooks}/useAuth/useOAuth2.d.ts +1 -1
- package/dist/hooks/useAuth/useOAuth2.d.ts.map +1 -0
- package/dist/{components/Auth → hooks}/useAuth/useOAuth2.mjs +4 -4
- package/dist/hooks/useAuth/useOAuth2.mjs.map +1 -0
- package/dist/{components/Auth → hooks}/useAuth/useSession.cjs +6 -25
- package/dist/hooks/useAuth/useSession.cjs.map +1 -0
- package/dist/{components/Auth → hooks}/useAuth/useSession.d.ts +3 -3
- package/dist/hooks/useAuth/useSession.d.ts.map +1 -0
- package/dist/hooks/useAuth/useSession.mjs +47 -0
- package/dist/hooks/useAuth/useSession.mjs.map +1 -0
- package/dist/hooks/useIntlayerAPI.cjs +5 -4
- package/dist/hooks/useIntlayerAPI.cjs.map +1 -1
- package/dist/hooks/useIntlayerAPI.mjs +5 -4
- package/dist/hooks/useIntlayerAPI.mjs.map +1 -1
- package/dist/{components/Auth → hooks}/useUser/index.cjs +7 -5
- package/dist/hooks/useUser/index.cjs.map +1 -0
- package/dist/hooks/useUser/index.d.ts +8 -0
- package/dist/hooks/useUser/index.d.ts.map +1 -0
- package/dist/{components/Auth → hooks}/useUser/index.mjs +6 -4
- package/dist/hooks/useUser/index.mjs.map +1 -0
- package/dist/{schemas-itjzX6bG.js → schemas-BIuxHDyZ.js} +3 -7
- package/dist/{schemas-itjzX6bG.js.map → schemas-BIuxHDyZ.js.map} +1 -1
- package/dist/{schemas-DlCjM5d_.cjs → schemas-Q6C7ZNs3.cjs} +3 -7
- package/dist/{schemas-DlCjM5d_.cjs.map → schemas-Q6C7ZNs3.cjs.map} +1 -1
- package/dist/tailwind.css +1 -1
- package/package.json +17 -17
- package/dist/components/Auth/AuthModal/index.cjs +0 -106
- package/dist/components/Auth/AuthModal/index.cjs.map +0 -1
- package/dist/components/Auth/AuthModal/index.d.ts +0 -20
- package/dist/components/Auth/AuthModal/index.d.ts.map +0 -1
- package/dist/components/Auth/AuthModal/index.mjs +0 -106
- package/dist/components/Auth/AuthModal/index.mjs.map +0 -1
- package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.cjs +0 -36
- package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.cjs.map +0 -1
- package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.d.ts +0 -5
- package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.d.ts.map +0 -1
- package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.mjs +0 -36
- package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.mjs.map +0 -1
- package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierServer.cjs +0 -22
- package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierServer.cjs.map +0 -1
- package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierServer.d.ts +0 -8
- package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierServer.d.ts.map +0 -1
- package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierServer.mjs +0 -22
- package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierServer.mjs.map +0 -1
- package/dist/components/Auth/AuthenticationBarrier/accessValidation.cjs +0 -15
- package/dist/components/Auth/AuthenticationBarrier/accessValidation.cjs.map +0 -1
- package/dist/components/Auth/AuthenticationBarrier/accessValidation.d.ts +0 -4
- package/dist/components/Auth/AuthenticationBarrier/accessValidation.d.ts.map +0 -1
- package/dist/components/Auth/AuthenticationBarrier/accessValidation.mjs +0 -15
- package/dist/components/Auth/AuthenticationBarrier/accessValidation.mjs.map +0 -1
- package/dist/components/Auth/AuthenticationBarrier/index.cjs +0 -7
- package/dist/components/Auth/AuthenticationBarrier/index.d.ts +0 -23
- package/dist/components/Auth/AuthenticationBarrier/index.d.ts.map +0 -1
- package/dist/components/Auth/AuthenticationBarrier/index.mjs +0 -7
- package/dist/components/Auth/AuthenticationBarrier/index.mjs.map +0 -1
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs +0 -95
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs.map +0 -1
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.d.ts +0 -9
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.d.ts.map +0 -1
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs +0 -95
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs.map +0 -1
- package/dist/components/Auth/ChangePasswordForm/changePasswordForm.content.cjs +0 -138
- package/dist/components/Auth/ChangePasswordForm/changePasswordForm.content.cjs.map +0 -1
- package/dist/components/Auth/ChangePasswordForm/changePasswordForm.content.d.ts +0 -278
- package/dist/components/Auth/ChangePasswordForm/changePasswordForm.content.d.ts.map +0 -1
- package/dist/components/Auth/ChangePasswordForm/changePasswordForm.content.mjs +0 -138
- package/dist/components/Auth/ChangePasswordForm/changePasswordForm.content.mjs.map +0 -1
- package/dist/components/Auth/ChangePasswordForm/index.cjs +0 -7
- package/dist/components/Auth/ChangePasswordForm/index.cjs.map +0 -1
- package/dist/components/Auth/ChangePasswordForm/index.d.ts +0 -3
- package/dist/components/Auth/ChangePasswordForm/index.d.ts.map +0 -1
- package/dist/components/Auth/ChangePasswordForm/index.mjs +0 -7
- package/dist/components/Auth/ChangePasswordForm/index.mjs.map +0 -1
- package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.cjs +0 -34
- package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.cjs.map +0 -1
- package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.content.cjs +0 -131
- package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.content.cjs.map +0 -1
- package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.content.d.ts +0 -271
- package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.content.d.ts.map +0 -1
- package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.content.mjs +0 -131
- package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.content.mjs.map +0 -1
- package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.d.ts +0 -8
- package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.d.ts.map +0 -1
- package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.mjs +0 -34
- package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.mjs.map +0 -1
- package/dist/components/Auth/DefineNewPasswordForm/DefineNewPasswordForm.cjs +0 -81
- package/dist/components/Auth/DefineNewPasswordForm/DefineNewPasswordForm.cjs.map +0 -1
- package/dist/components/Auth/DefineNewPasswordForm/DefineNewPasswordForm.d.ts +0 -9
- package/dist/components/Auth/DefineNewPasswordForm/DefineNewPasswordForm.d.ts.map +0 -1
- package/dist/components/Auth/DefineNewPasswordForm/DefineNewPasswordForm.mjs +0 -81
- package/dist/components/Auth/DefineNewPasswordForm/DefineNewPasswordForm.mjs.map +0 -1
- package/dist/components/Auth/DefineNewPasswordForm/defineNewPasswordForm.content.cjs +0 -106
- package/dist/components/Auth/DefineNewPasswordForm/defineNewPasswordForm.content.cjs.map +0 -1
- package/dist/components/Auth/DefineNewPasswordForm/defineNewPasswordForm.content.d.ts +0 -210
- package/dist/components/Auth/DefineNewPasswordForm/defineNewPasswordForm.content.d.ts.map +0 -1
- package/dist/components/Auth/DefineNewPasswordForm/defineNewPasswordForm.content.mjs +0 -106
- package/dist/components/Auth/DefineNewPasswordForm/defineNewPasswordForm.content.mjs.map +0 -1
- package/dist/components/Auth/DefineNewPasswordForm/index.cjs +0 -7
- package/dist/components/Auth/DefineNewPasswordForm/index.cjs.map +0 -1
- package/dist/components/Auth/DefineNewPasswordForm/index.d.ts +0 -3
- package/dist/components/Auth/DefineNewPasswordForm/index.d.ts.map +0 -1
- package/dist/components/Auth/DefineNewPasswordForm/index.mjs +0 -7
- package/dist/components/Auth/DefineNewPasswordForm/index.mjs.map +0 -1
- package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.cjs +0 -29
- package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.cjs.map +0 -1
- package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.cjs +0 -101
- package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.cjs.map +0 -1
- package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.d.ts +0 -205
- package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.d.ts.map +0 -1
- package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.mjs +0 -101
- package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.mjs.map +0 -1
- package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.d.ts +0 -7
- package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.d.ts.map +0 -1
- package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.mjs +0 -29
- package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.mjs.map +0 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs +0 -81
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs.map +0 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.d.ts +0 -9
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.d.ts.map +0 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs +0 -81
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs.map +0 -1
- package/dist/components/Auth/ExternalsLoginButtons/assets/GithubLogo.cjs +0 -15
- package/dist/components/Auth/ExternalsLoginButtons/assets/GithubLogo.cjs.map +0 -1
- package/dist/components/Auth/ExternalsLoginButtons/assets/GithubLogo.d.ts +0 -3
- package/dist/components/Auth/ExternalsLoginButtons/assets/GithubLogo.d.ts.map +0 -1
- package/dist/components/Auth/ExternalsLoginButtons/assets/GithubLogo.mjs +0 -15
- package/dist/components/Auth/ExternalsLoginButtons/assets/GithubLogo.mjs.map +0 -1
- package/dist/components/Auth/ExternalsLoginButtons/assets/GoogleLogo.cjs +0 -23
- package/dist/components/Auth/ExternalsLoginButtons/assets/GoogleLogo.cjs.map +0 -1
- package/dist/components/Auth/ExternalsLoginButtons/assets/GoogleLogo.d.ts +0 -3
- package/dist/components/Auth/ExternalsLoginButtons/assets/GoogleLogo.d.ts.map +0 -1
- package/dist/components/Auth/ExternalsLoginButtons/assets/GoogleLogo.mjs +0 -23
- package/dist/components/Auth/ExternalsLoginButtons/assets/GoogleLogo.mjs.map +0 -1
- package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.cjs +0 -90
- package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.cjs.map +0 -1
- package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.d.ts +0 -176
- package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.d.ts.map +0 -1
- package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.mjs +0 -90
- package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.mjs.map +0 -1
- package/dist/components/Auth/ExternalsLoginButtons/index.cjs +0 -7
- package/dist/components/Auth/ExternalsLoginButtons/index.cjs.map +0 -1
- package/dist/components/Auth/ExternalsLoginButtons/index.d.ts +0 -2
- package/dist/components/Auth/ExternalsLoginButtons/index.d.ts.map +0 -1
- package/dist/components/Auth/ExternalsLoginButtons/index.mjs +0 -7
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs +0 -113
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs.map +0 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.d.ts +0 -11
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.d.ts.map +0 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs +0 -113
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs.map +0 -1
- package/dist/components/Auth/ResetPasswordForm/index.cjs +0 -7
- package/dist/components/Auth/ResetPasswordForm/index.cjs.map +0 -1
- package/dist/components/Auth/ResetPasswordForm/index.d.ts +0 -3
- package/dist/components/Auth/ResetPasswordForm/index.d.ts.map +0 -1
- package/dist/components/Auth/ResetPasswordForm/index.mjs +0 -7
- package/dist/components/Auth/ResetPasswordForm/index.mjs.map +0 -1
- package/dist/components/Auth/ResetPasswordForm/resetPasswordContent.content.cjs +0 -123
- package/dist/components/Auth/ResetPasswordForm/resetPasswordContent.content.cjs.map +0 -1
- package/dist/components/Auth/ResetPasswordForm/resetPasswordContent.content.d.ts +0 -245
- package/dist/components/Auth/ResetPasswordForm/resetPasswordContent.content.d.ts.map +0 -1
- package/dist/components/Auth/ResetPasswordForm/resetPasswordContent.content.mjs +0 -123
- package/dist/components/Auth/ResetPasswordForm/resetPasswordContent.content.mjs.map +0 -1
- package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.cjs +0 -15
- package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.cjs.map +0 -1
- package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.content.cjs +0 -56
- package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.content.cjs.map +0 -1
- package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.content.d.ts +0 -106
- package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.content.d.ts.map +0 -1
- package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.content.mjs +0 -56
- package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.content.mjs.map +0 -1
- package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.d.ts +0 -6
- package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.d.ts.map +0 -1
- package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.mjs +0 -15
- package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.mjs.map +0 -1
- package/dist/components/Auth/SignInForm/SignInForm.cjs +0 -105
- package/dist/components/Auth/SignInForm/SignInForm.cjs.map +0 -1
- package/dist/components/Auth/SignInForm/SignInForm.d.ts +0 -11
- package/dist/components/Auth/SignInForm/SignInForm.d.ts.map +0 -1
- package/dist/components/Auth/SignInForm/SignInForm.mjs +0 -105
- package/dist/components/Auth/SignInForm/SignInForm.mjs.map +0 -1
- package/dist/components/Auth/SignInForm/index.cjs +0 -7
- package/dist/components/Auth/SignInForm/index.cjs.map +0 -1
- package/dist/components/Auth/SignInForm/index.d.ts +0 -3
- package/dist/components/Auth/SignInForm/index.d.ts.map +0 -1
- package/dist/components/Auth/SignInForm/index.mjs +0 -7
- package/dist/components/Auth/SignInForm/index.mjs.map +0 -1
- package/dist/components/Auth/SignInForm/signIn.content.cjs +0 -217
- package/dist/components/Auth/SignInForm/signIn.content.cjs.map +0 -1
- package/dist/components/Auth/SignInForm/signIn.content.d.ts +0 -447
- package/dist/components/Auth/SignInForm/signIn.content.d.ts.map +0 -1
- package/dist/components/Auth/SignInForm/signIn.content.mjs +0 -217
- package/dist/components/Auth/SignInForm/signIn.content.mjs.map +0 -1
- package/dist/components/Auth/SignInForm/useSignInSchema.cjs +0 -23
- package/dist/components/Auth/SignInForm/useSignInSchema.cjs.map +0 -1
- package/dist/components/Auth/SignInForm/useSignInSchema.content.cjs +0 -71
- package/dist/components/Auth/SignInForm/useSignInSchema.content.cjs.map +0 -1
- package/dist/components/Auth/SignInForm/useSignInSchema.content.d.ts +0 -139
- package/dist/components/Auth/SignInForm/useSignInSchema.content.d.ts.map +0 -1
- package/dist/components/Auth/SignInForm/useSignInSchema.content.mjs +0 -71
- package/dist/components/Auth/SignInForm/useSignInSchema.content.mjs.map +0 -1
- package/dist/components/Auth/SignInForm/useSignInSchema.d.ts +0 -7
- package/dist/components/Auth/SignInForm/useSignInSchema.d.ts.map +0 -1
- package/dist/components/Auth/SignInForm/useSignInSchema.mjs +0 -23
- package/dist/components/Auth/SignInForm/useSignInSchema.mjs.map +0 -1
- package/dist/components/Auth/SignUpForm/SignUpForm.cjs +0 -98
- package/dist/components/Auth/SignUpForm/SignUpForm.cjs.map +0 -1
- package/dist/components/Auth/SignUpForm/SignUpForm.d.ts +0 -10
- package/dist/components/Auth/SignUpForm/SignUpForm.d.ts.map +0 -1
- package/dist/components/Auth/SignUpForm/SignUpForm.mjs +0 -98
- package/dist/components/Auth/SignUpForm/SignUpForm.mjs.map +0 -1
- package/dist/components/Auth/SignUpForm/index.cjs +0 -7
- package/dist/components/Auth/SignUpForm/index.cjs.map +0 -1
- package/dist/components/Auth/SignUpForm/index.d.ts +0 -3
- package/dist/components/Auth/SignUpForm/index.d.ts.map +0 -1
- package/dist/components/Auth/SignUpForm/index.mjs +0 -7
- package/dist/components/Auth/SignUpForm/index.mjs.map +0 -1
- package/dist/components/Auth/SignUpForm/signUpForm.content.cjs +0 -184
- package/dist/components/Auth/SignUpForm/signUpForm.content.cjs.map +0 -1
- package/dist/components/Auth/SignUpForm/signUpForm.content.d.ts +0 -380
- package/dist/components/Auth/SignUpForm/signUpForm.content.d.ts.map +0 -1
- package/dist/components/Auth/SignUpForm/signUpForm.content.mjs +0 -185
- package/dist/components/Auth/SignUpForm/signUpForm.content.mjs.map +0 -1
- package/dist/components/Auth/SignUpForm/useSignUpSchema.cjs +0 -33
- package/dist/components/Auth/SignUpForm/useSignUpSchema.cjs.map +0 -1
- package/dist/components/Auth/SignUpForm/useSignUpSchema.content.cjs +0 -116
- package/dist/components/Auth/SignUpForm/useSignUpSchema.content.cjs.map +0 -1
- package/dist/components/Auth/SignUpForm/useSignUpSchema.content.d.ts +0 -238
- package/dist/components/Auth/SignUpForm/useSignUpSchema.content.d.ts.map +0 -1
- package/dist/components/Auth/SignUpForm/useSignUpSchema.content.mjs +0 -116
- package/dist/components/Auth/SignUpForm/useSignUpSchema.content.mjs.map +0 -1
- package/dist/components/Auth/SignUpForm/useSignUpSchema.d.ts +0 -8
- package/dist/components/Auth/SignUpForm/useSignUpSchema.d.ts.map +0 -1
- package/dist/components/Auth/SignUpForm/useSignUpSchema.mjs +0 -33
- package/dist/components/Auth/SignUpForm/useSignUpSchema.mjs.map +0 -1
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.cjs +0 -79
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.cjs.map +0 -1
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.d.ts +0 -10
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.d.ts.map +0 -1
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.mjs +0 -79
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.mjs.map +0 -1
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailSchema.cjs +0 -8
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailSchema.cjs.map +0 -1
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailSchema.d.ts +0 -4
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailSchema.d.ts.map +0 -1
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailSchema.mjs +0 -8
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailSchema.mjs.map +0 -1
- package/dist/components/Auth/VerifyEmailForm/index.cjs +0 -5
- package/dist/components/Auth/VerifyEmailForm/index.cjs.map +0 -1
- package/dist/components/Auth/VerifyEmailForm/index.content.cjs +0 -73
- package/dist/components/Auth/VerifyEmailForm/index.content.cjs.map +0 -1
- package/dist/components/Auth/VerifyEmailForm/index.content.d.ts +0 -143
- package/dist/components/Auth/VerifyEmailForm/index.content.d.ts.map +0 -1
- package/dist/components/Auth/VerifyEmailForm/index.content.mjs +0 -74
- package/dist/components/Auth/VerifyEmailForm/index.content.mjs.map +0 -1
- package/dist/components/Auth/VerifyEmailForm/index.d.ts +0 -2
- package/dist/components/Auth/VerifyEmailForm/index.d.ts.map +0 -1
- package/dist/components/Auth/VerifyEmailForm/index.mjs +0 -5
- package/dist/components/Auth/VerifyEmailForm/index.mjs.map +0 -1
- package/dist/components/Auth/index.cjs +0 -39
- package/dist/components/Auth/index.cjs.map +0 -1
- package/dist/components/Auth/index.d.ts +0 -12
- package/dist/components/Auth/index.d.ts.map +0 -1
- package/dist/components/Auth/index.mjs +0 -39
- package/dist/components/Auth/index.mjs.map +0 -1
- package/dist/components/Auth/useAuth/index.cjs +0 -31
- package/dist/components/Auth/useAuth/index.cjs.map +0 -1
- package/dist/components/Auth/useAuth/index.d.ts.map +0 -1
- package/dist/components/Auth/useAuth/index.mjs.map +0 -1
- package/dist/components/Auth/useAuth/useCSRF.cjs +0 -27
- package/dist/components/Auth/useAuth/useCSRF.cjs.map +0 -1
- package/dist/components/Auth/useAuth/useCSRF.d.ts +0 -6
- package/dist/components/Auth/useAuth/useCSRF.d.ts.map +0 -1
- package/dist/components/Auth/useAuth/useCSRF.mjs +0 -27
- package/dist/components/Auth/useAuth/useCSRF.mjs.map +0 -1
- package/dist/components/Auth/useAuth/useOAuth2.cjs.map +0 -1
- package/dist/components/Auth/useAuth/useOAuth2.d.ts.map +0 -1
- package/dist/components/Auth/useAuth/useOAuth2.mjs.map +0 -1
- package/dist/components/Auth/useAuth/useSession.cjs.map +0 -1
- package/dist/components/Auth/useAuth/useSession.d.ts.map +0 -1
- package/dist/components/Auth/useAuth/useSession.mjs +0 -66
- package/dist/components/Auth/useAuth/useSession.mjs.map +0 -1
- package/dist/components/Auth/useUser/index.cjs.map +0 -1
- package/dist/components/Auth/useUser/index.d.ts +0 -8
- package/dist/components/Auth/useUser/index.d.ts.map +0 -1
- package/dist/components/Auth/useUser/index.mjs.map +0 -1
- package/dist/components/ProfileDropDown/index.cjs +0 -25
- package/dist/components/ProfileDropDown/index.cjs.map +0 -1
- package/dist/components/ProfileDropDown/index.d.ts +0 -6
- package/dist/components/ProfileDropDown/index.d.ts.map +0 -1
- package/dist/components/ProfileDropDown/index.mjs +0 -25
- package/dist/components/ProfileDropDown/index.mjs.map +0 -1
- package/dist/hooks/useIntlayerAPI.d.ts +0 -103
- package/dist/hooks/useIntlayerAPI.d.ts.map +0 -1
|
@@ -9,29 +9,16 @@ const reactIntlayer = require("react-intlayer");
|
|
|
9
9
|
const components_Modal_Modal = require("../../Modal/Modal.cjs");
|
|
10
10
|
const hooks_intlayerAPIHooks = require("../../../hooks/intlayerAPIHooks.cjs");
|
|
11
11
|
require("../../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
12
|
+
const hooks_useAuth_useAuth = require("../../../hooks/useAuth/useAuth.cjs");
|
|
13
|
+
require("@intlayer/api");
|
|
14
|
+
require("@intlayer/config/built");
|
|
12
15
|
require("deepmerge");
|
|
13
16
|
require("../../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
|
|
14
17
|
const utils_cn = require("../../../utils/cn.cjs");
|
|
15
|
-
require("../../Button/Button.cjs");
|
|
16
|
-
const components_Auth_useAuth_index = require("../../Auth/useAuth/index.cjs");
|
|
17
|
-
require("../../Auth/ExternalsLoginButtons/externalsLoginButtons.content.cjs");
|
|
18
|
-
require("@intlayer/api");
|
|
19
18
|
require("@hookform/resolvers");
|
|
20
19
|
require("react-hook-form");
|
|
21
20
|
require("../../Form/FormField.cjs");
|
|
22
21
|
const components_Form_layout_FormItemLayout = require("../../../Form-DJrUK3mm.cjs");
|
|
23
|
-
require("../../Auth/SignInForm/signIn.content.cjs");
|
|
24
|
-
require("../../Auth/SignInForm/useSignInSchema.content.cjs");
|
|
25
|
-
require("../../Auth/SignUpForm/signUpForm.content.cjs");
|
|
26
|
-
require("../../Auth/SignUpForm/useSignUpSchema.content.cjs");
|
|
27
|
-
require("../../Auth/ChangePasswordForm/changePasswordForm.content.cjs");
|
|
28
|
-
require("../../Auth/ChangePasswordForm/useChangePasswordSchema.content.cjs");
|
|
29
|
-
require("../../Auth/ResetPasswordForm/resetPasswordContent.content.cjs");
|
|
30
|
-
require("../../Auth/ResetPasswordForm/useResetPasswordSchema.content.cjs");
|
|
31
|
-
require("@intlayer/config/built");
|
|
32
|
-
require("../../Auth/VerifyEmailForm/index.content.cjs");
|
|
33
|
-
require("../../Auth/DefineNewPasswordForm/defineNewPasswordForm.content.cjs");
|
|
34
|
-
require("../../Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.cjs");
|
|
35
22
|
const components_DictionaryFieldEditor_SaveForm_saveForm_content = require("./saveForm.content.cjs");
|
|
36
23
|
const SaveForm = ({
|
|
37
24
|
dictionary,
|
|
@@ -56,10 +43,10 @@ const SaveForm = ({
|
|
|
56
43
|
downloadButton,
|
|
57
44
|
confirmation
|
|
58
45
|
} = reactIntlayer.useDictionary(components_DictionaryFieldEditor_SaveForm_saveForm_content.saveDictionaryContent);
|
|
59
|
-
const { isAuthenticated } =
|
|
46
|
+
const { isAuthenticated } = hooks_useAuth_useAuth.useAuth();
|
|
60
47
|
const editedDictionary = editedContent?.[dictionary.key];
|
|
61
48
|
const isEdited = editedDictionary && JSON.stringify(editedDictionary) !== JSON.stringify(dictionary);
|
|
62
|
-
const isDistantDictionary = typeof dictionary?.
|
|
49
|
+
const isDistantDictionary = typeof dictionary?.id !== "undefined";
|
|
63
50
|
const handleSaveDictionaryConfirmation = async () => {
|
|
64
51
|
if (!editedContent?.[dictionary.key]) return;
|
|
65
52
|
const updatedDictionary = {
|
|
@@ -85,9 +72,9 @@ const SaveForm = ({
|
|
|
85
72
|
});
|
|
86
73
|
};
|
|
87
74
|
const handleDeleteDictionary = async () => {
|
|
88
|
-
if (!dictionary.
|
|
75
|
+
if (!dictionary.id) return;
|
|
89
76
|
await deleteDictionary(
|
|
90
|
-
dictionary.
|
|
77
|
+
dictionary.id.toString()
|
|
91
78
|
).then((res) => {
|
|
92
79
|
if (res) {
|
|
93
80
|
onDelete?.();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport type { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport type { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport {\n ArrowUpFromLine,\n Download,\n RotateCcw,\n Save,\n Trash,\n} from 'lucide-react';\nimport {\n type DetailedHTMLProps,\n type FC,\n type FormHTMLAttributes,\n useState,\n} from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { Modal } from '../../../components/Modal';\nimport {\n useDeleteDictionary,\n usePushDictionaries,\n useWriteDictionary,\n} from '../../../hooks';\nimport { cn } from '../../../utils/cn';\nimport { useAuth } from '../../Auth';\nimport { Form } from '../../Form';\nimport { saveDictionaryContent } from './saveForm.content';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n mode: ('local' | 'remote')[];\n onDelete?: () => void;\n} & DetailedHTMLProps<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>;\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({\n dictionary,\n mode,\n className,\n onDelete,\n ...props\n}) => {\n const [isFormatAlertModalOpen, setIsFormatAlertModalOpen] = useState(false);\n const { setLocaleDictionary } = useDictionariesRecordActions();\n const { deleteDictionary, isLoading: isDeleting } = useDeleteDictionary();\n const { writeDictionary, isLoading: isWriting } = useWriteDictionary();\n const { pushDictionaries, isLoading: isPushing } = usePushDictionaries();\n const isLoading = isWriting || isPushing;\n const isJsonFormat =\n mode.includes('local') && dictionary.filePath?.endsWith('.json');\n\n const { editedContent, restoreEditedContent } = useEditedContent();\n const {\n deleteButton,\n resetButton,\n saveButton,\n publishButton,\n downloadButton,\n confirmation,\n } = useDictionary(saveDictionaryContent);\n const { isAuthenticated } = useAuth();\n\n const editedDictionary = editedContent?.[dictionary.key];\n\n const isEdited =\n editedDictionary &&\n JSON.stringify(editedDictionary) !== JSON.stringify(dictionary);\n\n const isDistantDictionary =\n typeof (dictionary as DistantDictionary)?._id !== 'undefined';\n\n const handleSaveDictionaryConfirmation = async () => {\n if (!editedContent?.[dictionary.key]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.key],\n };\n\n await writeDictionary(updatedDictionary).then(() => {\n setLocaleDictionary(editedContent?.[dictionary.key]);\n restoreEditedContent(dictionary.key);\n });\n };\n\n const handlePushDictionary = async () => {\n if (!editedContent?.[dictionary.key]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.key],\n };\n\n await pushDictionaries([updatedDictionary]).then((res) => {\n if (res) {\n setLocaleDictionary(editedContent?.[dictionary.key]);\n restoreEditedContent(dictionary.key);\n }\n });\n };\n\n const handleDeleteDictionary = async () => {\n if (!(dictionary as DistantDictionary)._id) return;\n\n await deleteDictionary(\n (dictionary as DistantDictionary)._id.toString()\n ).then((res) => {\n if (res) {\n onDelete?.();\n }\n });\n };\n\n return (\n <>\n <Modal\n isOpen={isFormatAlertModalOpen}\n title={confirmation.title.value}\n size=\"md\"\n >\n <form className=\"size-full px-3\">\n {isJsonFormat ? (\n <p className=\"text-neutral py-4 text-sm\">{confirmation.message}</p>\n ) : (\n <p className=\"text-neutral py-4 text-sm\">\n {confirmation.differentFormatMessage}\n </p>\n )}\n <div className=\"mt-12 flex justify-end gap-2 max-md:flex-col\">\n <Form.Button\n label={confirmation.cancelButton.label.value}\n disabled={!isEdited || isLoading}\n color=\"text\"\n className=\"max-md:w-full\"\n variant=\"outline\"\n onClick={() => setIsFormatAlertModalOpen(false)}\n >\n {confirmation.cancelButton.text}\n </Form.Button>\n <Form.Button\n label={confirmation.confirmButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Save}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handleSaveDictionaryConfirmation}\n >\n {confirmation.confirmButton.text}\n </Form.Button>\n </div>\n </form>\n </Modal>\n <form\n className={cn('flex justify-end gap-2 max-md:flex-col', className)}\n {...props}\n >\n {mode.includes('remote') &&\n isDistantDictionary &&\n onDelete &&\n isAuthenticated && (\n <Form.Button\n label={deleteButton.label.value}\n Icon={Trash}\n color=\"error\"\n variant=\"outline\"\n className=\"max-md:w-full\"\n isLoading={isDeleting}\n onClick={handleDeleteDictionary}\n >\n {deleteButton.text}\n </Form.Button>\n )}\n {isEdited && (\n <Form.Button\n label={resetButton.label.value}\n disabled={!isEdited}\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n className=\"max-md:w-full\"\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {mode.includes('local') && (\n <Form.Button\n label={downloadButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Download}\n color=\"text\"\n variant={isAuthenticated ? 'outline' : 'default'}\n className=\"max-md:w-full\"\n isLoading={isWriting}\n onClick={() => setIsFormatAlertModalOpen(true)}\n >\n {downloadButton.text}\n </Form.Button>\n )}\n {mode.includes('remote') && isAuthenticated && !isDistantDictionary && (\n <Form.Button\n label={publishButton.label.value}\n disabled={isLoading}\n Icon={ArrowUpFromLine}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handlePushDictionary}\n >\n {publishButton.text}\n </Form.Button>\n )}\n {mode.includes('remote') &&\n isAuthenticated &&\n isDistantDictionary &&\n isEdited && (\n <Form.Button\n label={saveButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Save}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handlePushDictionary}\n >\n {saveButton.text}\n </Form.Button>\n )}\n </form>\n </>\n );\n};\n"],"names":["useState","useDictionariesRecordActions","useDeleteDictionary","useWriteDictionary","usePushDictionaries","useEditedContent","useDictionary","saveDictionaryContent","useAuth","jsxs","Fragment","jsx","Modal","Form","Save","cn","Trash","RotateCcw","Download","ArrowUpFromLine"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCO,MAAM,WAAuC,CAAC;AAAA,EACnD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,CAAC,wBAAwB,yBAAyB,IAAIA,aAAAA,SAAS,KAAK;AACpE,QAAA,EAAE,oBAAoB,IAAIC,yCAA6B;AAC7D,QAAM,EAAE,kBAAkB,WAAW,WAAA,IAAeC,uBAAAA,oBAAoB;AACxE,QAAM,EAAE,iBAAiB,WAAW,UAAA,IAAcC,uBAAAA,mBAAmB;AACrE,QAAM,EAAE,kBAAkB,WAAW,UAAA,IAAcC,uBAAAA,oBAAoB;AACvE,QAAM,YAAY,aAAa;AACzB,QAAA,eACJ,KAAK,SAAS,OAAO,KAAK,WAAW,UAAU,SAAS,OAAO;AAEjE,QAAM,EAAE,eAAe,qBAAqB,IAAIC,6BAAiB;AAC3D,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACEC,cAAAA,cAAcC,2DAAAA,qBAAqB;AACjC,QAAA,EAAE,gBAAgB,IAAIC,sCAAQ;AAE9B,QAAA,mBAAmB,gBAAg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;AAAA,EAEN,GACF;AAEJ;;"}
|
|
1
|
+
{"version":3,"file":"SaveForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport type { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport type { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport {\n ArrowUpFromLine,\n Download,\n RotateCcw,\n Save,\n Trash,\n} from 'lucide-react';\nimport {\n type DetailedHTMLProps,\n type FC,\n type FormHTMLAttributes,\n useState,\n} from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { Modal } from '../../../components/Modal';\nimport {\n useAuth,\n useDeleteDictionary,\n usePushDictionaries,\n useWriteDictionary,\n} from '../../../hooks';\nimport { cn } from '../../../utils/cn';\nimport { Form } from '../../Form';\nimport { saveDictionaryContent } from './saveForm.content';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n mode: ('local' | 'remote')[];\n onDelete?: () => void;\n} & DetailedHTMLProps<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>;\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({\n dictionary,\n mode,\n className,\n onDelete,\n ...props\n}) => {\n const [isFormatAlertModalOpen, setIsFormatAlertModalOpen] = useState(false);\n const { setLocaleDictionary } = useDictionariesRecordActions();\n const { deleteDictionary, isLoading: isDeleting } = useDeleteDictionary();\n const { writeDictionary, isLoading: isWriting } = useWriteDictionary();\n const { pushDictionaries, isLoading: isPushing } = usePushDictionaries();\n const isLoading = isWriting || isPushing;\n const isJsonFormat =\n mode.includes('local') && dictionary.filePath?.endsWith('.json');\n\n const { editedContent, restoreEditedContent } = useEditedContent();\n const {\n deleteButton,\n resetButton,\n saveButton,\n publishButton,\n downloadButton,\n confirmation,\n } = useDictionary(saveDictionaryContent);\n const { isAuthenticated } = useAuth();\n\n const editedDictionary = editedContent?.[dictionary.key];\n\n const isEdited =\n editedDictionary &&\n JSON.stringify(editedDictionary) !== JSON.stringify(dictionary);\n\n const isDistantDictionary =\n typeof (dictionary as DistantDictionary)?.id !== 'undefined';\n\n const handleSaveDictionaryConfirmation = async () => {\n if (!editedContent?.[dictionary.key]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.key],\n };\n\n await writeDictionary(updatedDictionary).then(() => {\n setLocaleDictionary(editedContent?.[dictionary.key]);\n restoreEditedContent(dictionary.key);\n });\n };\n\n const handlePushDictionary = async () => {\n if (!editedContent?.[dictionary.key]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.key],\n };\n\n await pushDictionaries([updatedDictionary]).then((res) => {\n if (res) {\n setLocaleDictionary(editedContent?.[dictionary.key]);\n restoreEditedContent(dictionary.key);\n }\n });\n };\n\n const handleDeleteDictionary = async () => {\n if (!(dictionary as DistantDictionary).id) return;\n\n await deleteDictionary(\n (dictionary as DistantDictionary).id.toString()\n ).then((res) => {\n if (res) {\n onDelete?.();\n }\n });\n };\n\n return (\n <>\n <Modal\n isOpen={isFormatAlertModalOpen}\n title={confirmation.title.value}\n size=\"md\"\n >\n <form className=\"size-full px-3\">\n {isJsonFormat ? (\n <p className=\"text-neutral py-4 text-sm\">{confirmation.message}</p>\n ) : (\n <p className=\"text-neutral py-4 text-sm\">\n {confirmation.differentFormatMessage}\n </p>\n )}\n <div className=\"mt-12 flex justify-end gap-2 max-md:flex-col\">\n <Form.Button\n label={confirmation.cancelButton.label.value}\n disabled={!isEdited || isLoading}\n color=\"text\"\n className=\"max-md:w-full\"\n variant=\"outline\"\n onClick={() => setIsFormatAlertModalOpen(false)}\n >\n {confirmation.cancelButton.text}\n </Form.Button>\n <Form.Button\n label={confirmation.confirmButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Save}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handleSaveDictionaryConfirmation}\n >\n {confirmation.confirmButton.text}\n </Form.Button>\n </div>\n </form>\n </Modal>\n <form\n className={cn('flex justify-end gap-2 max-md:flex-col', className)}\n {...props}\n >\n {mode.includes('remote') &&\n isDistantDictionary &&\n onDelete &&\n isAuthenticated && (\n <Form.Button\n label={deleteButton.label.value}\n Icon={Trash}\n color=\"error\"\n variant=\"outline\"\n className=\"max-md:w-full\"\n isLoading={isDeleting}\n onClick={handleDeleteDictionary}\n >\n {deleteButton.text}\n </Form.Button>\n )}\n {isEdited && (\n <Form.Button\n label={resetButton.label.value}\n disabled={!isEdited}\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n className=\"max-md:w-full\"\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {mode.includes('local') && (\n <Form.Button\n label={downloadButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Download}\n color=\"text\"\n variant={isAuthenticated ? 'outline' : 'default'}\n className=\"max-md:w-full\"\n isLoading={isWriting}\n onClick={() => setIsFormatAlertModalOpen(true)}\n >\n {downloadButton.text}\n </Form.Button>\n )}\n {mode.includes('remote') && isAuthenticated && !isDistantDictionary && (\n <Form.Button\n label={publishButton.label.value}\n disabled={isLoading}\n Icon={ArrowUpFromLine}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handlePushDictionary}\n >\n {publishButton.text}\n </Form.Button>\n )}\n {mode.includes('remote') &&\n isAuthenticated &&\n isDistantDictionary &&\n isEdited && (\n <Form.Button\n label={saveButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Save}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handlePushDictionary}\n >\n {saveButton.text}\n </Form.Button>\n )}\n </form>\n </>\n );\n};\n"],"names":["useState","useDictionariesRecordActions","useDeleteDictionary","useWriteDictionary","usePushDictionaries","useEditedContent","useDictionary","saveDictionaryContent","useAuth","jsxs","Fragment","jsx","Modal","Form","Save","cn","Trash","RotateCcw","Download","ArrowUpFromLine"],"mappings":";;;;;;;;;;;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,cACvC,WAAU;AAAA,cACV,WAAW;AAAA,cACX,SAAS,MAAM,0BAA0B,IAAI;AAAA,cAE5C,UAAe,eAAA;AAAA,YAAA;AAAA,UAClB;AAAA,UAED,KAAK,SAAS,QAAQ,KAAK,mBAAmB,CAAC,uBAC9CP,2BAAA;AAAA,YAACE,sCAAAA,KAAK;AAAA,YAAL;AAAA,cACC,OAAO,cAAc,MAAM;AAAA,cAC3B,UAAU;AAAA,cACV,MAAMM,YAAA;AAAA,cACN,OAAM;AAAA,cACN,WAAU;AAAA,cACV,WAAW;AAAA,cACX,SAAS;AAAA,cAER,UAAc,cAAA;AAAA,YAAA;AAAA,UACjB;AAAA,UAED,KAAK,SAAS,QAAQ,KACrB,mBACA,uBACA,YACER,2BAAA;AAAA,YAACE,sCAAAA,KAAK;AAAA,YAAL;AAAA,cACC,OAAO,WAAW,MAAM;AAAA,cACxB,UAAU,CAAC,YAAY;AAAA,cACvB,MAAMC,YAAA;AAAA,cACN,OAAM;AAAA,cACN,WAAU;AAAA,cACV,WAAW;AAAA,cACX,SAAS;AAAA,cAER,UAAW,WAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACd;AAAA,MAAA;AAAA,IAAA;AAAA,EAEN,GACF;AAEJ;;"}
|
|
@@ -7,29 +7,16 @@ import { useDictionary } from "react-intlayer";
|
|
|
7
7
|
import { Modal } from "../../Modal/Modal.mjs";
|
|
8
8
|
import { useDeleteDictionary, useWriteDictionary, usePushDictionaries } from "../../../hooks/intlayerAPIHooks.mjs";
|
|
9
9
|
import "../../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
10
|
+
import { useAuth } from "../../../hooks/useAuth/useAuth.mjs";
|
|
11
|
+
import "@intlayer/api";
|
|
12
|
+
import "@intlayer/config/built";
|
|
10
13
|
import "deepmerge";
|
|
11
14
|
import "../../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
|
|
12
15
|
import { cn } from "../../../utils/cn.mjs";
|
|
13
|
-
import "../../Button/Button.mjs";
|
|
14
|
-
import { useAuth } from "../../Auth/useAuth/index.mjs";
|
|
15
|
-
import "../../Auth/ExternalsLoginButtons/externalsLoginButtons.content.mjs";
|
|
16
|
-
import "@intlayer/api";
|
|
17
16
|
import "@hookform/resolvers";
|
|
18
17
|
import "react-hook-form";
|
|
19
18
|
import "../../Form/FormField.mjs";
|
|
20
19
|
import { F as Form } from "../../../Form-CriPBaZk.js";
|
|
21
|
-
import "../../Auth/SignInForm/signIn.content.mjs";
|
|
22
|
-
import "../../Auth/SignInForm/useSignInSchema.content.mjs";
|
|
23
|
-
import "../../Auth/SignUpForm/signUpForm.content.mjs";
|
|
24
|
-
import "../../Auth/SignUpForm/useSignUpSchema.content.mjs";
|
|
25
|
-
import "../../Auth/ChangePasswordForm/changePasswordForm.content.mjs";
|
|
26
|
-
import "../../Auth/ChangePasswordForm/useChangePasswordSchema.content.mjs";
|
|
27
|
-
import "../../Auth/ResetPasswordForm/resetPasswordContent.content.mjs";
|
|
28
|
-
import "../../Auth/ResetPasswordForm/useResetPasswordSchema.content.mjs";
|
|
29
|
-
import "@intlayer/config/built";
|
|
30
|
-
import "../../Auth/VerifyEmailForm/index.content.mjs";
|
|
31
|
-
import "../../Auth/DefineNewPasswordForm/defineNewPasswordForm.content.mjs";
|
|
32
|
-
import "../../Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.mjs";
|
|
33
20
|
import { saveDictionaryContent } from "./saveForm.content.mjs";
|
|
34
21
|
const SaveForm = ({
|
|
35
22
|
dictionary,
|
|
@@ -57,7 +44,7 @@ const SaveForm = ({
|
|
|
57
44
|
const { isAuthenticated } = useAuth();
|
|
58
45
|
const editedDictionary = editedContent?.[dictionary.key];
|
|
59
46
|
const isEdited = editedDictionary && JSON.stringify(editedDictionary) !== JSON.stringify(dictionary);
|
|
60
|
-
const isDistantDictionary = typeof dictionary?.
|
|
47
|
+
const isDistantDictionary = typeof dictionary?.id !== "undefined";
|
|
61
48
|
const handleSaveDictionaryConfirmation = async () => {
|
|
62
49
|
if (!editedContent?.[dictionary.key]) return;
|
|
63
50
|
const updatedDictionary = {
|
|
@@ -83,9 +70,9 @@ const SaveForm = ({
|
|
|
83
70
|
});
|
|
84
71
|
};
|
|
85
72
|
const handleDeleteDictionary = async () => {
|
|
86
|
-
if (!dictionary.
|
|
73
|
+
if (!dictionary.id) return;
|
|
87
74
|
await deleteDictionary(
|
|
88
|
-
dictionary.
|
|
75
|
+
dictionary.id.toString()
|
|
89
76
|
).then((res) => {
|
|
90
77
|
if (res) {
|
|
91
78
|
onDelete?.();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport type { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport type { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport {\n ArrowUpFromLine,\n Download,\n RotateCcw,\n Save,\n Trash,\n} from 'lucide-react';\nimport {\n type DetailedHTMLProps,\n type FC,\n type FormHTMLAttributes,\n useState,\n} from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { Modal } from '../../../components/Modal';\nimport {\n useDeleteDictionary,\n usePushDictionaries,\n useWriteDictionary,\n} from '../../../hooks';\nimport { cn } from '../../../utils/cn';\nimport { useAuth } from '../../Auth';\nimport { Form } from '../../Form';\nimport { saveDictionaryContent } from './saveForm.content';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n mode: ('local' | 'remote')[];\n onDelete?: () => void;\n} & DetailedHTMLProps<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>;\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({\n dictionary,\n mode,\n className,\n onDelete,\n ...props\n}) => {\n const [isFormatAlertModalOpen, setIsFormatAlertModalOpen] = useState(false);\n const { setLocaleDictionary } = useDictionariesRecordActions();\n const { deleteDictionary, isLoading: isDeleting } = useDeleteDictionary();\n const { writeDictionary, isLoading: isWriting } = useWriteDictionary();\n const { pushDictionaries, isLoading: isPushing } = usePushDictionaries();\n const isLoading = isWriting || isPushing;\n const isJsonFormat =\n mode.includes('local') && dictionary.filePath?.endsWith('.json');\n\n const { editedContent, restoreEditedContent } = useEditedContent();\n const {\n deleteButton,\n resetButton,\n saveButton,\n publishButton,\n downloadButton,\n confirmation,\n } = useDictionary(saveDictionaryContent);\n const { isAuthenticated } = useAuth();\n\n const editedDictionary = editedContent?.[dictionary.key];\n\n const isEdited =\n editedDictionary &&\n JSON.stringify(editedDictionary) !== JSON.stringify(dictionary);\n\n const isDistantDictionary =\n typeof (dictionary as DistantDictionary)?._id !== 'undefined';\n\n const handleSaveDictionaryConfirmation = async () => {\n if (!editedContent?.[dictionary.key]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.key],\n };\n\n await writeDictionary(updatedDictionary).then(() => {\n setLocaleDictionary(editedContent?.[dictionary.key]);\n restoreEditedContent(dictionary.key);\n });\n };\n\n const handlePushDictionary = async () => {\n if (!editedContent?.[dictionary.key]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.key],\n };\n\n await pushDictionaries([updatedDictionary]).then((res) => {\n if (res) {\n setLocaleDictionary(editedContent?.[dictionary.key]);\n restoreEditedContent(dictionary.key);\n }\n });\n };\n\n const handleDeleteDictionary = async () => {\n if (!(dictionary as DistantDictionary)._id) return;\n\n await deleteDictionary(\n (dictionary as DistantDictionary)._id.toString()\n ).then((res) => {\n if (res) {\n onDelete?.();\n }\n });\n };\n\n return (\n <>\n <Modal\n isOpen={isFormatAlertModalOpen}\n title={confirmation.title.value}\n size=\"md\"\n >\n <form className=\"size-full px-3\">\n {isJsonFormat ? (\n <p className=\"text-neutral py-4 text-sm\">{confirmation.message}</p>\n ) : (\n <p className=\"text-neutral py-4 text-sm\">\n {confirmation.differentFormatMessage}\n </p>\n )}\n <div className=\"mt-12 flex justify-end gap-2 max-md:flex-col\">\n <Form.Button\n label={confirmation.cancelButton.label.value}\n disabled={!isEdited || isLoading}\n color=\"text\"\n className=\"max-md:w-full\"\n variant=\"outline\"\n onClick={() => setIsFormatAlertModalOpen(false)}\n >\n {confirmation.cancelButton.text}\n </Form.Button>\n <Form.Button\n label={confirmation.confirmButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Save}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handleSaveDictionaryConfirmation}\n >\n {confirmation.confirmButton.text}\n </Form.Button>\n </div>\n </form>\n </Modal>\n <form\n className={cn('flex justify-end gap-2 max-md:flex-col', className)}\n {...props}\n >\n {mode.includes('remote') &&\n isDistantDictionary &&\n onDelete &&\n isAuthenticated && (\n <Form.Button\n label={deleteButton.label.value}\n Icon={Trash}\n color=\"error\"\n variant=\"outline\"\n className=\"max-md:w-full\"\n isLoading={isDeleting}\n onClick={handleDeleteDictionary}\n >\n {deleteButton.text}\n </Form.Button>\n )}\n {isEdited && (\n <Form.Button\n label={resetButton.label.value}\n disabled={!isEdited}\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n className=\"max-md:w-full\"\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {mode.includes('local') && (\n <Form.Button\n label={downloadButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Download}\n color=\"text\"\n variant={isAuthenticated ? 'outline' : 'default'}\n className=\"max-md:w-full\"\n isLoading={isWriting}\n onClick={() => setIsFormatAlertModalOpen(true)}\n >\n {downloadButton.text}\n </Form.Button>\n )}\n {mode.includes('remote') && isAuthenticated && !isDistantDictionary && (\n <Form.Button\n label={publishButton.label.value}\n disabled={isLoading}\n Icon={ArrowUpFromLine}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handlePushDictionary}\n >\n {publishButton.text}\n </Form.Button>\n )}\n {mode.includes('remote') &&\n isAuthenticated &&\n isDistantDictionary &&\n isEdited && (\n <Form.Button\n label={saveButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Save}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handlePushDictionary}\n >\n {saveButton.text}\n </Form.Button>\n )}\n </form>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCO,MAAM,WAAuC,CAAC;AAAA,EACnD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,CAAC,wBAAwB,yBAAyB,IAAI,SAAS,KAAK;AACpE,QAAA,EAAE,oBAAoB,IAAI,6BAA6B;AAC7D,QAAM,EAAE,kBAAkB,WAAW,WAAA,IAAe,oBAAoB;AACxE,QAAM,EAAE,iBAAiB,WAAW,UAAA,IAAc,mBAAmB;AACrE,QAAM,EAAE,kBAAkB,WAAW,UAAA,IAAc,oBAAoB;AACvE,QAAM,YAAY,aAAa;AACzB,QAAA,eACJ,KAAK,SAAS,OAAO,KAAK,WAAW,UAAU,SAAS,OAAO;AAEjE,QAAM,EAAE,eAAe,qBAAqB,IAAI,iBAAiB;AAC3D,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACE,cAAc,qBAAqB;AACjC,QAAA,EAAE,gBAAgB,IAAI,QAAQ;AAE9B,QAAA,mBAAmB,gBAAgB,WAAW,GAAG;AAEjD,QAAA,WACJ,oBACA,KAAK,UAAU,gBAAgB,MAAM,KAAK,UAAU,UAAU;AAE1D,QAAA,sBACJ,OAAQ,YAAkC,QAAQ;AAEpD,QAAM,mCAAmC,YAAY;AACnD,QAAI,CAAC,gBAAgB,WAAW,GAAG,EAAG;AAEtC,UAAM,oBAAoB;AAAA,MACxB,GAAG;AAAA,MACH,GAAG,gBAAgB,WAAW,GAAG;AAAA,IACnC;AAEA,UAAM,gBAAgB,iBAAiB,EAAE,KAAK,MAAM;AAC9B,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cACX,SAAS,MAAM,0BAA0B,IAAI;AAAA,cAE5C,UAAe,eAAA;AAAA,YAAA;AAAA,UAClB;AAAA,UAED,KAAK,SAAS,QAAQ,KAAK,mBAAmB,CAAC,uBAC9C;AAAA,YAAC,KAAK;AAAA,YAAL;AAAA,cACC,OAAO,cAAc,MAAM;AAAA,cAC3B,UAAU;AAAA,cACV,MAAM;AAAA,cACN,OAAM;AAAA,cACN,WAAU;AAAA,cACV,WAAW;AAAA,cACX,SAAS;AAAA,cAER,UAAc,cAAA;AAAA,YAAA;AAAA,UACjB;AAAA,UAED,KAAK,SAAS,QAAQ,KACrB,mBACA,uBACA,YACE;AAAA,YAAC,KAAK;AAAA,YAAL;AAAA,cACC,OAAO,WAAW,MAAM;AAAA,cACxB,UAAU,CAAC,YAAY;AAAA,cACvB,MAAM;AAAA,cACN,OAAM;AAAA,cACN,WAAU;AAAA,cACV,WAAW;AAAA,cACX,SAAS;AAAA,cAER,UAAW,WAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACd;AAAA,MAAA;AAAA,IAAA;AAAA,EAEN,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"SaveForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport type { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport type { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport {\n ArrowUpFromLine,\n Download,\n RotateCcw,\n Save,\n Trash,\n} from 'lucide-react';\nimport {\n type DetailedHTMLProps,\n type FC,\n type FormHTMLAttributes,\n useState,\n} from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { Modal } from '../../../components/Modal';\nimport {\n useAuth,\n useDeleteDictionary,\n usePushDictionaries,\n useWriteDictionary,\n} from '../../../hooks';\nimport { cn } from '../../../utils/cn';\nimport { Form } from '../../Form';\nimport { saveDictionaryContent } from './saveForm.content';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n mode: ('local' | 'remote')[];\n onDelete?: () => void;\n} & DetailedHTMLProps<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>;\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({\n dictionary,\n mode,\n className,\n onDelete,\n ...props\n}) => {\n const [isFormatAlertModalOpen, setIsFormatAlertModalOpen] = useState(false);\n const { setLocaleDictionary } = useDictionariesRecordActions();\n const { deleteDictionary, isLoading: isDeleting } = useDeleteDictionary();\n const { writeDictionary, isLoading: isWriting } = useWriteDictionary();\n const { pushDictionaries, isLoading: isPushing } = usePushDictionaries();\n const isLoading = isWriting || isPushing;\n const isJsonFormat =\n mode.includes('local') && dictionary.filePath?.endsWith('.json');\n\n const { editedContent, restoreEditedContent } = useEditedContent();\n const {\n deleteButton,\n resetButton,\n saveButton,\n publishButton,\n downloadButton,\n confirmation,\n } = useDictionary(saveDictionaryContent);\n const { isAuthenticated } = useAuth();\n\n const editedDictionary = editedContent?.[dictionary.key];\n\n const isEdited =\n editedDictionary &&\n JSON.stringify(editedDictionary) !== JSON.stringify(dictionary);\n\n const isDistantDictionary =\n typeof (dictionary as DistantDictionary)?.id !== 'undefined';\n\n const handleSaveDictionaryConfirmation = async () => {\n if (!editedContent?.[dictionary.key]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.key],\n };\n\n await writeDictionary(updatedDictionary).then(() => {\n setLocaleDictionary(editedContent?.[dictionary.key]);\n restoreEditedContent(dictionary.key);\n });\n };\n\n const handlePushDictionary = async () => {\n if (!editedContent?.[dictionary.key]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.key],\n };\n\n await pushDictionaries([updatedDictionary]).then((res) => {\n if (res) {\n setLocaleDictionary(editedContent?.[dictionary.key]);\n restoreEditedContent(dictionary.key);\n }\n });\n };\n\n const handleDeleteDictionary = async () => {\n if (!(dictionary as DistantDictionary).id) return;\n\n await deleteDictionary(\n (dictionary as DistantDictionary).id.toString()\n ).then((res) => {\n if (res) {\n onDelete?.();\n }\n });\n };\n\n return (\n <>\n <Modal\n isOpen={isFormatAlertModalOpen}\n title={confirmation.title.value}\n size=\"md\"\n >\n <form className=\"size-full px-3\">\n {isJsonFormat ? (\n <p className=\"text-neutral py-4 text-sm\">{confirmation.message}</p>\n ) : (\n <p className=\"text-neutral py-4 text-sm\">\n {confirmation.differentFormatMessage}\n </p>\n )}\n <div className=\"mt-12 flex justify-end gap-2 max-md:flex-col\">\n <Form.Button\n label={confirmation.cancelButton.label.value}\n disabled={!isEdited || isLoading}\n color=\"text\"\n className=\"max-md:w-full\"\n variant=\"outline\"\n onClick={() => setIsFormatAlertModalOpen(false)}\n >\n {confirmation.cancelButton.text}\n </Form.Button>\n <Form.Button\n label={confirmation.confirmButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Save}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handleSaveDictionaryConfirmation}\n >\n {confirmation.confirmButton.text}\n </Form.Button>\n </div>\n </form>\n </Modal>\n <form\n className={cn('flex justify-end gap-2 max-md:flex-col', className)}\n {...props}\n >\n {mode.includes('remote') &&\n isDistantDictionary &&\n onDelete &&\n isAuthenticated && (\n <Form.Button\n label={deleteButton.label.value}\n Icon={Trash}\n color=\"error\"\n variant=\"outline\"\n className=\"max-md:w-full\"\n isLoading={isDeleting}\n onClick={handleDeleteDictionary}\n >\n {deleteButton.text}\n </Form.Button>\n )}\n {isEdited && (\n <Form.Button\n label={resetButton.label.value}\n disabled={!isEdited}\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n className=\"max-md:w-full\"\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {mode.includes('local') && (\n <Form.Button\n label={downloadButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Download}\n color=\"text\"\n variant={isAuthenticated ? 'outline' : 'default'}\n className=\"max-md:w-full\"\n isLoading={isWriting}\n onClick={() => setIsFormatAlertModalOpen(true)}\n >\n {downloadButton.text}\n </Form.Button>\n )}\n {mode.includes('remote') && isAuthenticated && !isDistantDictionary && (\n <Form.Button\n label={publishButton.label.value}\n disabled={isLoading}\n Icon={ArrowUpFromLine}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handlePushDictionary}\n >\n {publishButton.text}\n </Form.Button>\n )}\n {mode.includes('remote') &&\n isAuthenticated &&\n isDistantDictionary &&\n isEdited && (\n <Form.Button\n label={saveButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Save}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handlePushDictionary}\n >\n {saveButton.text}\n </Form.Button>\n )}\n </form>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAuCO,MAAM,WAAuC,CAAC;AAAA,EACnD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,CAAC,wBAAwB,yBAAyB,IAAI,SAAS,KAAK;AACpE,QAAA,EAAE,oBAAoB,IAAI,6BAA6B;AAC7D,QAAM,EAAE,kBAAkB,WAAW,WAAA,IAAe,oBAAoB;AACxE,QAAM,EAAE,iBAAiB,WAAW,UAAA,IAAc,mBAAmB;AACrE,QAAM,EAAE,kBAAkB,WAAW,UAAA,IAAc,oBAAoB;AACvE,QAAM,YAAY,aAAa;AACzB,QAAA,eACJ,KAAK,SAAS,OAAO,KAAK,WAAW,UAAU,SAAS,OAAO;AAEjE,QAAM,EAAE,eAAe,qBAAqB,IAAI,iBAAiB;AAC3D,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACE,cAAc,qBAAqB;AACjC,QAAA,EAAE,gBAAgB,IAAI,QAAQ;AAE9B,QAAA,mBAAmB,gBAAgB,WAAW,GAAG;AAEjD,QAAA,WACJ,oBACA,KAAK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B,WAAW,GAAG;AAAA,cAEjD,UAAY,YAAA;AAAA,YAAA;AAAA,UACf;AAAA,UAED,KAAK,SAAS,OAAO,KACpB;AAAA,YAAC,KAAK;AAAA,YAAL;AAAA,cACC,OAAO,eAAe,MAAM;AAAA,cAC5B,UAAU,CAAC,YAAY;AAAA,cACvB,MAAM;AAAA,cACN,OAAM;AAAA,cACN,SAAS,kBAAkB,YAAY;AAAA,cACvC,WAAU;AAAA,cACV,WAAW;AAAA,cACX,SAAS,MAAM,0BAA0B,IAAI;AAAA,cAE5C,UAAe,eAAA;AAAA,YAAA;AAAA,UAClB;AAAA,UAED,KAAK,SAAS,QAAQ,KAAK,mBAAmB,CAAC,uBAC9C;AAAA,YAAC,KAAK;AAAA,YAAL;AAAA,cACC,OAAO,cAAc,MAAM;AAAA,cAC3B,UAAU;AAAA,cACV,MAAM;AAAA,cACN,OAAM;AAAA,cACN,WAAU;AAAA,cACV,WAAW;AAAA,cACX,SAAS;AAAA,cAER,UAAc,cAAA;AAAA,YAAA;AAAA,UACjB;AAAA,UAED,KAAK,SAAS,QAAQ,KACrB,mBACA,uBACA,YACE;AAAA,YAAC,KAAK;AAAA,YAAL;AAAA,cACC,OAAO,WAAW,MAAM;AAAA,cACxB,UAAU,CAAC,YAAY;AAAA,cACvB,MAAM;AAAA,cACN,OAAM;AAAA,cACN,WAAU;AAAA,cACV,WAAW;AAAA,cACX,SAAS;AAAA,cAER,UAAW,WAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACd;AAAA,MAAA;AAAA,IAAA;AAAA,EAEN,GACF;AAEJ;"}
|
|
@@ -15,10 +15,10 @@ require("clsx");
|
|
|
15
15
|
require("tailwind-merge");
|
|
16
16
|
require("../../Input/Input.cjs");
|
|
17
17
|
require("../../Input/Checkbox.cjs");
|
|
18
|
+
require("../../Toaster/Toast.cjs");
|
|
19
|
+
require("../../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
18
20
|
require("@intlayer/api");
|
|
19
21
|
require("@intlayer/config/built");
|
|
20
|
-
require("../../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
21
|
-
require("../../Toaster/Toast.cjs");
|
|
22
22
|
require("deepmerge");
|
|
23
23
|
require("../../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
|
|
24
24
|
const components_DictionaryFieldEditor_NodeTypeSelector = require("../NodeTypeSelector.cjs");
|
|
@@ -13,10 +13,10 @@ import "clsx";
|
|
|
13
13
|
import "tailwind-merge";
|
|
14
14
|
import "../../Input/Input.mjs";
|
|
15
15
|
import "../../Input/Checkbox.mjs";
|
|
16
|
+
import "../../Toaster/Toast.mjs";
|
|
17
|
+
import "../../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
16
18
|
import "@intlayer/api";
|
|
17
19
|
import "@intlayer/config/built";
|
|
18
|
-
import "../../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
19
|
-
import "../../Toaster/Toast.mjs";
|
|
20
20
|
import "deepmerge";
|
|
21
21
|
import "../../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
|
|
22
22
|
import { NodeTypeSelector } from "../NodeTypeSelector.mjs";
|
package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs
CHANGED
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
4
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
5
5
|
const ReactExports = require("react");
|
|
6
6
|
require("@intlayer/editor-react");
|
|
7
|
+
require("../../Toaster/Toast.cjs");
|
|
8
|
+
require("../../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
7
9
|
require("@intlayer/api");
|
|
8
10
|
require("@intlayer/config/built");
|
|
9
|
-
require("../../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
10
|
-
require("../../Toaster/Toast.cjs");
|
|
11
11
|
require("deepmerge");
|
|
12
12
|
const hooks_usePersistedStore = require("../../../hooks/usePersistedStore.cjs");
|
|
13
13
|
require("../../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
|
package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, useContext } from "react";
|
|
4
4
|
import "@intlayer/editor-react";
|
|
5
|
+
import "../../Toaster/Toast.mjs";
|
|
6
|
+
import "../../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
5
7
|
import "@intlayer/api";
|
|
6
8
|
import "@intlayer/config/built";
|
|
7
|
-
import "../../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
8
|
-
import "../../Toaster/Toast.mjs";
|
|
9
9
|
import "deepmerge";
|
|
10
10
|
import { usePersistedStore } from "../../../hooks/usePersistedStore.mjs";
|
|
11
11
|
import "../../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
|
|
@@ -10,10 +10,10 @@ require("../Input/Input.cjs");
|
|
|
10
10
|
require("lucide-react");
|
|
11
11
|
require("../Input/Checkbox.cjs");
|
|
12
12
|
require("@intlayer/editor-react");
|
|
13
|
+
require("../Toaster/Toast.cjs");
|
|
14
|
+
require("../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
13
15
|
require("@intlayer/api");
|
|
14
16
|
require("@intlayer/config/built");
|
|
15
|
-
require("../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
16
|
-
require("../Toaster/Toast.cjs");
|
|
17
17
|
require("deepmerge");
|
|
18
18
|
require("../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
|
|
19
19
|
const components_EditableField_EditableFieldLayout = require("./EditableFieldLayout.cjs");
|
|
@@ -8,10 +8,10 @@ import "../Input/Input.mjs";
|
|
|
8
8
|
import "lucide-react";
|
|
9
9
|
import "../Input/Checkbox.mjs";
|
|
10
10
|
import "@intlayer/editor-react";
|
|
11
|
+
import "../Toaster/Toast.mjs";
|
|
12
|
+
import "../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
11
13
|
import "@intlayer/api";
|
|
12
14
|
import "@intlayer/config/built";
|
|
13
|
-
import "../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
14
|
-
import "../Toaster/Toast.mjs";
|
|
15
15
|
import "deepmerge";
|
|
16
16
|
import "../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
|
|
17
17
|
import { EditableFieldLayout } from "./EditableFieldLayout.mjs";
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
4
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
5
5
|
const zod = require("../../../zod-K7y5gPX4.cjs");
|
|
6
6
|
const reactHookForm = require("react-hook-form");
|
|
7
|
-
const schemas = require("../../../schemas-
|
|
7
|
+
const schemas = require("../../../schemas-Q6C7ZNs3.cjs");
|
|
8
8
|
const Schema = schemas.object({
|
|
9
9
|
test: schemas.string().min(3, "test error")
|
|
10
10
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { a } from "../../../zod-D4WapgbL.js";
|
|
4
4
|
import { useForm, FormProvider } from "react-hook-form";
|
|
5
|
-
import { o as object, s as string } from "../../../schemas-
|
|
5
|
+
import { o as object, s as string } from "../../../schemas-BIuxHDyZ.js";
|
|
6
6
|
const Schema = object({
|
|
7
7
|
test: string().min(3, "test error")
|
|
8
8
|
});
|
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
4
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
5
5
|
const ReactExports = require("react");
|
|
6
6
|
require("@intlayer/editor-react");
|
|
7
|
+
require("../Toaster/Toast.cjs");
|
|
8
|
+
require("../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
7
9
|
require("@intlayer/api");
|
|
8
10
|
require("@intlayer/config/built");
|
|
9
|
-
require("../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
10
|
-
require("../Toaster/Toast.cjs");
|
|
11
11
|
require("deepmerge");
|
|
12
12
|
const hooks_usePersistedStore = require("../../hooks/usePersistedStore.cjs");
|
|
13
13
|
require("../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, useContext } from "react";
|
|
4
4
|
import "@intlayer/editor-react";
|
|
5
|
+
import "../Toaster/Toast.mjs";
|
|
6
|
+
import "../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
5
7
|
import "@intlayer/api";
|
|
6
8
|
import "@intlayer/config/built";
|
|
7
|
-
import "../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
8
|
-
import "../Toaster/Toast.mjs";
|
|
9
9
|
import "deepmerge";
|
|
10
10
|
import { usePersistedStore } from "../../hooks/usePersistedStore.mjs";
|
|
11
11
|
import "../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
|
|
@@ -9,10 +9,10 @@ const lucideReact = require("lucide-react");
|
|
|
9
9
|
const ReactExports = require("react");
|
|
10
10
|
const reactIntlayer = require("react-intlayer");
|
|
11
11
|
require("@intlayer/editor-react");
|
|
12
|
+
require("../Toaster/Toast.cjs");
|
|
13
|
+
require("../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
12
14
|
require("@intlayer/api");
|
|
13
15
|
require("@intlayer/config/built");
|
|
14
|
-
require("../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
15
|
-
require("../Toaster/Toast.cjs");
|
|
16
16
|
require("deepmerge");
|
|
17
17
|
const hooks_usePersistedStore = require("../../hooks/usePersistedStore.cjs");
|
|
18
18
|
require("../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
|
|
@@ -7,10 +7,10 @@ import { Globe, MoveVertical, Check } from "lucide-react";
|
|
|
7
7
|
import { useRef, useMemo, useState, useCallback } from "react";
|
|
8
8
|
import { useDictionary, useLocale } from "react-intlayer";
|
|
9
9
|
import "@intlayer/editor-react";
|
|
10
|
+
import "../Toaster/Toast.mjs";
|
|
11
|
+
import "../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
10
12
|
import "@intlayer/api";
|
|
11
13
|
import "@intlayer/config/built";
|
|
12
|
-
import "../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
13
|
-
import "../Toaster/Toast.mjs";
|
|
14
14
|
import "deepmerge";
|
|
15
15
|
import { usePersistedStore } from "../../hooks/usePersistedStore.mjs";
|
|
16
16
|
import "../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
|
|
@@ -5,10 +5,10 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
5
5
|
const ReactExports = require("react");
|
|
6
6
|
const reactIntlayer = require("react-intlayer");
|
|
7
7
|
require("@intlayer/editor-react");
|
|
8
|
+
require("../Toaster/Toast.cjs");
|
|
9
|
+
require("../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
8
10
|
require("@intlayer/api");
|
|
9
11
|
require("@intlayer/config/built");
|
|
10
|
-
require("../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
11
|
-
require("../Toaster/Toast.cjs");
|
|
12
12
|
require("deepmerge");
|
|
13
13
|
const hooks_usePersistedStore = require("../../hooks/usePersistedStore.cjs");
|
|
14
14
|
require("../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
|
|
@@ -3,10 +3,10 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { createContext, useContext } from "react";
|
|
4
4
|
import { useLocale } from "react-intlayer";
|
|
5
5
|
import "@intlayer/editor-react";
|
|
6
|
+
import "../Toaster/Toast.mjs";
|
|
7
|
+
import "../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
6
8
|
import "@intlayer/api";
|
|
7
9
|
import "@intlayer/config/built";
|
|
8
|
-
import "../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
9
|
-
import "../Toaster/Toast.mjs";
|
|
10
10
|
import "deepmerge";
|
|
11
11
|
import { usePersistedStore } from "../../hooks/usePersistedStore.mjs";
|
|
12
12
|
import "../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
|
|
@@ -7,11 +7,11 @@ const framerMotion = require("framer-motion");
|
|
|
7
7
|
const lucideReact = require("lucide-react");
|
|
8
8
|
const reactDom = require("react-dom");
|
|
9
9
|
require("@intlayer/editor-react");
|
|
10
|
-
require("
|
|
11
|
-
require("@intlayer/config/built");
|
|
10
|
+
require("../Toaster/Toast.cjs");
|
|
12
11
|
require("react");
|
|
13
12
|
require("../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
14
|
-
require("
|
|
13
|
+
require("@intlayer/api");
|
|
14
|
+
require("@intlayer/config/built");
|
|
15
15
|
require("deepmerge");
|
|
16
16
|
const hooks_useGetElementOrWindow = require("../../hooks/useGetElementOrWindow.cjs");
|
|
17
17
|
const hooks_useScrollBlockage_index = require("../../index-BYzBot7l.cjs");
|
|
@@ -5,11 +5,11 @@ import { motion } from "framer-motion";
|
|
|
5
5
|
import { X } from "lucide-react";
|
|
6
6
|
import { createPortal } from "react-dom";
|
|
7
7
|
import "@intlayer/editor-react";
|
|
8
|
-
import "
|
|
9
|
-
import "@intlayer/config/built";
|
|
8
|
+
import "../Toaster/Toast.mjs";
|
|
10
9
|
import "react";
|
|
11
10
|
import "../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
12
|
-
import "
|
|
11
|
+
import "@intlayer/api";
|
|
12
|
+
import "@intlayer/config/built";
|
|
13
13
|
import "deepmerge";
|
|
14
14
|
import { useGetElementOrWindow } from "../../hooks/useGetElementOrWindow.mjs";
|
|
15
15
|
import { u as useScrollBlockage } from "../../index-BCuMWKyy.js";
|
|
@@ -5,10 +5,10 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
5
5
|
const framerMotion = require("framer-motion");
|
|
6
6
|
const ReactExports = require("react");
|
|
7
7
|
require("@intlayer/editor-react");
|
|
8
|
+
require("../Toaster/Toast.cjs");
|
|
9
|
+
require("../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
8
10
|
require("@intlayer/api");
|
|
9
11
|
require("@intlayer/config/built");
|
|
10
|
-
require("../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
11
|
-
require("../Toaster/Toast.cjs");
|
|
12
12
|
require("deepmerge");
|
|
13
13
|
const hooks_useScrollBlockage_index = require("../../index-BYzBot7l.cjs");
|
|
14
14
|
const hooks_useScrollDetection = require("../../hooks/useScrollDetection.cjs");
|
|
@@ -3,10 +3,10 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { m } from "framer-motion";
|
|
4
4
|
import { useState, useRef } from "react";
|
|
5
5
|
import "@intlayer/editor-react";
|
|
6
|
+
import "../Toaster/Toast.mjs";
|
|
7
|
+
import "../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
6
8
|
import "@intlayer/api";
|
|
7
9
|
import "@intlayer/config/built";
|
|
8
|
-
import "../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
9
|
-
import "../Toaster/Toast.mjs";
|
|
10
10
|
import "deepmerge";
|
|
11
11
|
import { u as useScrollBlockage } from "../../index-BCuMWKyy.js";
|
|
12
12
|
import { useScrollDetection } from "../../hooks/useScrollDetection.mjs";
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
5
5
|
require("@intlayer/editor-react");
|
|
6
|
-
require("
|
|
7
|
-
require("@intlayer/config/built");
|
|
6
|
+
require("../Toaster/Toast.cjs");
|
|
8
7
|
require("react");
|
|
9
8
|
require("../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
10
|
-
require("
|
|
9
|
+
require("@intlayer/api");
|
|
10
|
+
require("@intlayer/config/built");
|
|
11
11
|
const hooks_useDevice = require("../../hooks/useDevice.cjs");
|
|
12
12
|
require("deepmerge");
|
|
13
13
|
const hooks_useIsMounted = require("../../hooks/useIsMounted.cjs");
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, Fragment } from "react/jsx-runtime";
|
|
3
3
|
import "@intlayer/editor-react";
|
|
4
|
-
import "
|
|
5
|
-
import "@intlayer/config/built";
|
|
4
|
+
import "../Toaster/Toast.mjs";
|
|
6
5
|
import "react";
|
|
7
6
|
import "../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
8
|
-
import "
|
|
7
|
+
import "@intlayer/api";
|
|
8
|
+
import "@intlayer/config/built";
|
|
9
9
|
import { useDevice } from "../../hooks/useDevice.mjs";
|
|
10
10
|
import "deepmerge";
|
|
11
11
|
import { useIsMounted } from "../../hooks/useIsMounted.mjs";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const ReactExports = require("react");
|
|
5
4
|
const utils_cn = require("../../utils/cn.cjs");
|
|
5
|
+
const id = "grid-pattern";
|
|
6
6
|
const GridPattern = ({
|
|
7
7
|
width = 40,
|
|
8
8
|
height = 40,
|
|
@@ -12,52 +12,49 @@ const GridPattern = ({
|
|
|
12
12
|
squares,
|
|
13
13
|
className,
|
|
14
14
|
...props
|
|
15
|
-
}) =>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
className
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
);
|
|
61
|
-
};
|
|
15
|
+
}) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16
|
+
"svg",
|
|
17
|
+
{
|
|
18
|
+
"aria-hidden": "true",
|
|
19
|
+
className: utils_cn.cn(
|
|
20
|
+
"fill-neutral/10 stroke-neutral/15 dark:stroke-neutral/30 pointer-events-none absolute inset-0 h-full max-h-full w-full",
|
|
21
|
+
className
|
|
22
|
+
),
|
|
23
|
+
...props,
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
26
|
+
"pattern",
|
|
27
|
+
{
|
|
28
|
+
id,
|
|
29
|
+
width,
|
|
30
|
+
height,
|
|
31
|
+
patternUnits: "userSpaceOnUse",
|
|
32
|
+
x,
|
|
33
|
+
y,
|
|
34
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
35
|
+
"path",
|
|
36
|
+
{
|
|
37
|
+
d: `M.5 ${height}V.5H${width}`,
|
|
38
|
+
fill: "none",
|
|
39
|
+
strokeDasharray
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
) }),
|
|
44
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "100%", height: "100%", strokeWidth: 0, fill: `url(#${id})` }),
|
|
45
|
+
squares && /* @__PURE__ */ jsxRuntime.jsx("svg", { x, y, className: "overflow-visible", children: squares.map(([x2, y2]) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
46
|
+
"rect",
|
|
47
|
+
{
|
|
48
|
+
strokeWidth: "0",
|
|
49
|
+
width: width - 1,
|
|
50
|
+
height: height - 1,
|
|
51
|
+
x: x2 * width + 1,
|
|
52
|
+
y: y2 * height + 1
|
|
53
|
+
},
|
|
54
|
+
`${x2}-${y2}`
|
|
55
|
+
)) })
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
);
|
|
62
59
|
exports.GridPattern = GridPattern;
|
|
63
60
|
//# sourceMappingURL=GridPattern.cjs.map
|