@intlayer/design-system 3.5.9 → 3.5.10
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 +200 -200
- package/dist/Form-BoWOdiwq.js +321 -0
- package/dist/Form-BoWOdiwq.js.map +1 -0
- package/dist/Form-CSMiPnjC.cjs +320 -0
- package/dist/Form-CSMiPnjC.cjs.map +1 -0
- package/dist/Form-DlqjTz3u.js +321 -0
- package/dist/Form-DlqjTz3u.js.map +1 -0
- package/dist/Form-Dv0uHqbL.cjs +320 -0
- package/dist/Form-Dv0uHqbL.cjs.map +1 -0
- package/dist/components/Accordion/Accordion.cjs +1 -1
- package/dist/components/Accordion/Accordion.mjs +1 -1
- package/dist/components/Auth/AuthModal/index.cjs +1 -1
- package/dist/components/Auth/AuthModal/index.mjs +1 -1
- package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.cjs +1 -1
- package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.mjs +1 -1
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs +2 -2
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs +2 -2
- package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.d.ts +4 -4
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/assets/GithubLogo.cjs +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/assets/GithubLogo.mjs +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/assets/GoogleLogo.cjs +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/assets/GoogleLogo.mjs +1 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs +2 -2
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs +2 -2
- package/dist/components/Auth/SignInForm/SignInForm.cjs +2 -2
- package/dist/components/Auth/SignInForm/SignInForm.mjs +2 -2
- package/dist/components/Auth/SignUpForm/SignUpForm.cjs +2 -2
- package/dist/components/Auth/SignUpForm/SignUpForm.mjs +2 -2
- package/dist/components/Auth/useAuth/useCSRF.d.ts +1 -1
- package/dist/components/Auth/useAuth/useOAuth2.d.ts +1 -1
- package/dist/components/Avatar/index.cjs +1 -1
- package/dist/components/Avatar/index.mjs +1 -1
- package/dist/components/Badge/index.cjs +1 -1
- package/dist/components/Badge/index.mjs +1 -1
- package/dist/components/Breadcrumb/index.cjs +1 -1
- package/dist/components/Breadcrumb/index.mjs +1 -1
- package/dist/components/Button/Button.cjs +1 -1
- package/dist/components/Button/Button.mjs +1 -1
- package/dist/components/ClickOutsideDiv/index.cjs +1 -1
- package/dist/components/ClickOutsideDiv/index.mjs +1 -1
- package/dist/components/Command/index.cjs +1 -1
- package/dist/components/Command/index.mjs +1 -1
- package/dist/components/Container/index.cjs +1 -1
- package/dist/components/Container/index.mjs +1 -1
- package/dist/components/ContentEditor/ContentEditor.cjs +1 -1
- package/dist/components/ContentEditor/ContentEditor.mjs +1 -1
- package/dist/components/ContentEditor/ContentEditorTextArea.cjs +1 -1
- package/dist/components/ContentEditor/ContentEditorTextArea.mjs +1 -1
- package/dist/components/ContentSelector/ContentSelector.cjs +1 -1
- package/dist/components/ContentSelector/ContentSelector.mjs +1 -1
- package/dist/components/CopyToClipboard/index.cjs +1 -1
- package/dist/components/CopyToClipboard/index.mjs +1 -1
- package/dist/components/DictionaryEditor/DictionaryEditor.cjs +2 -2
- package/dist/components/DictionaryEditor/DictionaryEditor.mjs +2 -2
- package/dist/components/DictionaryEditor/ItemLayout.cjs +1 -1
- package/dist/components/DictionaryEditor/ItemLayout.mjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.cjs +2 -2
- package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.mjs +2 -2
- package/dist/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.cjs +2 -2
- package/dist/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.mjs +2 -2
- package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.cjs +2 -2
- package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.mjs +2 -2
- package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.cjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/TranslationWrapper.cjs +2 -2
- package/dist/components/DictionaryEditor/NodeWrapper/TranslationWrapper.mjs +2 -2
- package/dist/components/DictionaryEditor/NodeWrapper/index.cjs +2 -2
- package/dist/components/DictionaryEditor/NodeWrapper/index.mjs +2 -2
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs +2 -2
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs +2 -2
- package/dist/components/DictionaryEditor/useEditedContentStore.cjs +0 -6
- package/dist/components/DictionaryEditor/useEditedContentStore.cjs.map +1 -1
- package/dist/components/DictionaryEditor/useEditedContentStore.mjs +0 -6
- package/dist/components/DictionaryEditor/useEditedContentStore.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/EnumKeyInput.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/EnumKeyInput.mjs +1 -1
- package/dist/components/DictionaryFieldEditor/JSONEditor.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/JSONEditor.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/KeyPathBreadcrumb.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/KeyPathBreadcrumb.mjs +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/NodeEditor.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/NodeEditor.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs +1 -1
- package/dist/components/DropDown/index.cjs +1 -1
- package/dist/components/DropDown/index.mjs +1 -1
- package/dist/components/EditableField/EditableFieldInput.cjs +1 -1
- package/dist/components/EditableField/EditableFieldInput.mjs +1 -1
- package/dist/components/EditableField/EditableFieldLayout.cjs +1 -1
- package/dist/components/EditableField/EditableFieldLayout.mjs +1 -1
- package/dist/components/EditableField/EditableFieldTextArea.cjs +1 -1
- package/dist/components/EditableField/EditableFieldTextArea.mjs +1 -1
- package/dist/components/Flags/Flag.cjs +1 -1
- package/dist/components/Flags/Flag.mjs +1 -1
- package/dist/components/Footer/index.cjs +1 -1
- package/dist/components/Footer/index.mjs +1 -1
- package/dist/components/Form/Form.cjs +2 -2
- package/dist/components/Form/Form.mjs +2 -2
- package/dist/components/Form/FormBase.cjs +1 -1
- package/dist/components/Form/FormBase.d.ts.map +1 -1
- package/dist/components/Form/FormBase.mjs +1 -1
- package/dist/components/Form/FormControl.cjs +1 -1
- package/dist/components/Form/FormControl.mjs +1 -1
- package/dist/components/Form/FormDescription.cjs +1 -1
- package/dist/components/Form/FormDescription.mjs +1 -1
- package/dist/components/Form/FormField.cjs +1 -1
- package/dist/components/Form/FormField.mjs +1 -1
- package/dist/components/Form/FormItem.cjs +1 -1
- package/dist/components/Form/FormItem.mjs +1 -1
- package/dist/components/Form/FormLabel.cjs +1 -1
- package/dist/components/Form/FormLabel.mjs +1 -1
- package/dist/components/Form/FormMessage.cjs +1 -1
- package/dist/components/Form/FormMessage.mjs +1 -1
- package/dist/components/Form/elements/AutoSizeTextAreaElement.cjs +2 -2
- package/dist/components/Form/elements/AutoSizeTextAreaElement.mjs +2 -2
- package/dist/components/Form/elements/CheckboxElement.cjs +2 -2
- package/dist/components/Form/elements/CheckboxElement.mjs +2 -2
- package/dist/components/Form/elements/EditableFieldInputElement.cjs +2 -2
- package/dist/components/Form/elements/EditableFieldInputElement.mjs +2 -2
- package/dist/components/Form/elements/EditableFieldTextAreaElement.cjs +2 -2
- package/dist/components/Form/elements/EditableFieldTextAreaElement.mjs +2 -2
- package/dist/components/Form/elements/FormElement.cjs +2 -2
- package/dist/components/Form/elements/FormElement.mjs +2 -2
- package/dist/components/Form/elements/FormElementWrapper.cjs +1 -1
- package/dist/components/Form/elements/FormElementWrapper.mjs +1 -1
- package/dist/components/Form/elements/InputElement.cjs +2 -2
- package/dist/components/Form/elements/InputElement.mjs +2 -2
- package/dist/components/Form/elements/InputPasswordElement.cjs +2 -2
- package/dist/components/Form/elements/InputPasswordElement.mjs +2 -2
- package/dist/components/Form/elements/MultiselectElement.cjs +2 -2
- package/dist/components/Form/elements/MultiselectElement.mjs +2 -2
- package/dist/components/Form/elements/SelectElement.cjs +2 -2
- package/dist/components/Form/elements/SelectElement.mjs +2 -2
- package/dist/components/Form/elements/SwitchSelectorElement.cjs +2 -2
- package/dist/components/Form/elements/SwitchSelectorElement.mjs +2 -2
- package/dist/components/Form/elements/TextAreaElement.cjs +2 -2
- package/dist/components/Form/elements/TextAreaElement.mjs +2 -2
- package/dist/components/Form/elements/index.cjs +1 -1
- package/dist/components/Form/elements/index.mjs +1 -1
- package/dist/components/Form/index.cjs +1 -1
- package/dist/components/Form/index.mjs +1 -1
- package/dist/components/Form/layout/FormItemLayout.cjs +2 -2
- package/dist/components/Form/layout/FormItemLayout.mjs +2 -2
- package/dist/components/Form/layout/FormLabelLayout.cjs +1 -1
- package/dist/components/Form/layout/FormLabelLayout.mjs +1 -1
- package/dist/components/Form/layout/RequiredStar.cjs +1 -1
- package/dist/components/Form/layout/RequiredStar.mjs +1 -1
- package/dist/components/Form/layout/index.cjs +1 -1
- package/dist/components/Form/layout/index.mjs +1 -1
- package/dist/components/Headers/index.cjs +1 -1
- package/dist/components/Headers/index.mjs +1 -1
- package/dist/components/IDE/Code.cjs +1 -1
- package/dist/components/IDE/Code.mjs +1 -1
- package/dist/components/IDE/CodeBlockClient.cjs +1 -1
- package/dist/components/IDE/CodeBlockClient.mjs +1 -1
- package/dist/components/IDE/CodeBlockServer.cjs +1 -1
- package/dist/components/IDE/CodeBlockServer.mjs +1 -1
- package/dist/components/IDE/CodeConditionalRenderer.cjs +1 -1
- package/dist/components/IDE/CodeConditionalRenderer.mjs +1 -1
- package/dist/components/IDE/CodeContext.cjs +1 -1
- package/dist/components/IDE/CodeContext.mjs +1 -1
- package/dist/components/IDE/CodeFormatSelector.cjs +1 -1
- package/dist/components/IDE/CodeFormatSelector.mjs +1 -1
- package/dist/components/IDE/ContentDeclarationFormatSelector.cjs +1 -1
- package/dist/components/IDE/ContentDeclarationFormatSelector.mjs +1 -1
- package/dist/components/IDE/CopyButton.cjs +1 -1
- package/dist/components/IDE/CopyButton.mjs +1 -1
- package/dist/components/IDE/FileList.cjs +1 -1
- package/dist/components/IDE/FileList.mjs +1 -1
- package/dist/components/IDE/FileTree.cjs +1 -1
- package/dist/components/IDE/FileTree.mjs +1 -1
- package/dist/components/IDE/IDE.cjs +1 -1
- package/dist/components/IDE/IDE.mjs +1 -1
- package/dist/components/IDE/MarkDownRender.cjs +1 -1
- package/dist/components/IDE/MarkDownRender.mjs +1 -1
- package/dist/components/IDE/MonacoCode.cjs +1 -1
- package/dist/components/IDE/MonacoCode.mjs +1 -1
- package/dist/components/IDE/PackageManagerSelector.cjs +1 -1
- package/dist/components/IDE/PackageManagerSelector.mjs +1 -1
- package/dist/components/InformationTag/index.cjs +1 -1
- package/dist/components/InformationTag/index.mjs +1 -1
- package/dist/components/Input/Checkbox.cjs +1 -1
- package/dist/components/Input/Checkbox.mjs +1 -1
- package/dist/components/Input/Input.cjs +1 -1
- package/dist/components/Input/Input.mjs +1 -1
- package/dist/components/Input/InputPassword.cjs +1 -1
- package/dist/components/Input/InputPassword.mjs +1 -1
- package/dist/components/Label/index.cjs +1 -1
- package/dist/components/Label/index.mjs +1 -1
- package/dist/components/Link/Link.cjs +1 -1
- package/dist/components/Link/Link.mjs +1 -1
- package/dist/components/Loader/index.cjs +1 -1
- package/dist/components/Loader/index.mjs +1 -1
- package/dist/components/Loader/spinner.cjs +1 -1
- package/dist/components/Loader/spinner.mjs +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs +1 -1
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.cjs +1 -1
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs +1 -1
- package/dist/components/Logo/LogoCircle.cjs +1 -1
- package/dist/components/Logo/LogoCircle.mjs +1 -1
- package/dist/components/Logo/LogoNoFrame.cjs +1 -1
- package/dist/components/Logo/LogoNoFrame.mjs +1 -1
- package/dist/components/Logo/LogoSquare.cjs +1 -1
- package/dist/components/Logo/LogoSquare.mjs +1 -1
- package/dist/components/Logo/LogoSquircle.cjs +1 -1
- package/dist/components/Logo/LogoSquircle.mjs +1 -1
- package/dist/components/Logo/LogoTextOnly.cjs +1 -1
- package/dist/components/Logo/LogoTextOnly.mjs +1 -1
- package/dist/components/Logo/LogoWithTextBelowCircle.cjs +1 -1
- package/dist/components/Logo/LogoWithTextBelowCircle.mjs +1 -1
- package/dist/components/Logo/LogoWithTextBelowNoFrame.cjs +1 -1
- package/dist/components/Logo/LogoWithTextBelowNoFrame.mjs +1 -1
- package/dist/components/Logo/LogoWithTextBelowSquircle.cjs +1 -1
- package/dist/components/Logo/LogoWithTextBelowSquircle.mjs +1 -1
- package/dist/components/Logo/LogoWithTextCircle.cjs +1 -1
- package/dist/components/Logo/LogoWithTextCircle.mjs +1 -1
- package/dist/components/Logo/LogoWithTextNoFrame.cjs +1 -1
- package/dist/components/Logo/LogoWithTextNoFrame.mjs +1 -1
- package/dist/components/Logo/LogoWithTextSquircle.cjs +1 -1
- package/dist/components/Logo/LogoWithTextSquircle.mjs +1 -1
- package/dist/components/Logo/index.cjs +1 -1
- package/dist/components/Logo/index.mjs +1 -1
- package/dist/components/MarkDownRender/index.cjs +1 -1
- package/dist/components/MarkDownRender/index.mjs +1 -1
- package/dist/components/MaxHeightSmoother/index.cjs +1 -1
- package/dist/components/MaxHeightSmoother/index.mjs +1 -1
- package/dist/components/MaxWidthSmoother/index.cjs +1 -1
- package/dist/components/MaxWidthSmoother/index.mjs +1 -1
- package/dist/components/Modal/Modal.cjs +1 -1
- package/dist/components/Modal/Modal.mjs +1 -1
- package/dist/components/Navbar/Burger.cjs +1 -1
- package/dist/components/Navbar/Burger.mjs +1 -1
- package/dist/components/Navbar/DesktopNavbar.cjs +1 -1
- package/dist/components/Navbar/DesktopNavbar.mjs +1 -1
- package/dist/components/Navbar/MobileNavbar.cjs +1 -1
- package/dist/components/Navbar/MobileNavbar.mjs +1 -1
- package/dist/components/Navbar/index.cjs +1 -1
- package/dist/components/Navbar/index.mjs +1 -1
- package/dist/components/Pattern/DotPattern.cjs +1 -1
- package/dist/components/Pattern/DotPattern.mjs +1 -1
- package/dist/components/Pattern/GridPattern.cjs +1 -1
- package/dist/components/Pattern/GridPattern.mjs +1 -1
- package/dist/components/Pattern/SpotLight.cjs +1 -1
- package/dist/components/Pattern/SpotLight.mjs +1 -1
- package/dist/components/Popover/index.cjs +1 -1
- package/dist/components/Popover/index.mjs +1 -1
- package/dist/components/PressableSpan/PressableSpan.cjs +1 -1
- package/dist/components/PressableSpan/PressableSpan.mjs +1 -1
- package/dist/components/ProfileDropDown/index.cjs +1 -1
- package/dist/components/ProfileDropDown/index.mjs +1 -1
- package/dist/components/RightDrawer/RightDrawer.cjs +1 -1
- package/dist/components/RightDrawer/RightDrawer.mjs +1 -1
- package/dist/components/Select/Multiselect.cjs +1 -1
- package/dist/components/Select/Multiselect.cjs.map +1 -1
- package/dist/components/Select/Multiselect.mjs +1 -1
- package/dist/components/Select/Select.cjs +1 -1
- package/dist/components/Select/Select.mjs +1 -1
- package/dist/components/SwitchSelector/index.cjs +1 -1
- package/dist/components/SwitchSelector/index.mjs +1 -1
- package/dist/components/TabSelector/TabSelector.cjs +1 -1
- package/dist/components/TabSelector/TabSelector.mjs +1 -1
- package/dist/components/Tag/index.cjs +1 -1
- package/dist/components/Tag/index.mjs +1 -1
- package/dist/components/TextArea/AutoSizeTextArea.cjs +1 -1
- package/dist/components/TextArea/AutoSizeTextArea.mjs +1 -1
- package/dist/components/TextArea/TextArea.cjs +1 -1
- package/dist/components/TextArea/TextArea.mjs +1 -1
- package/dist/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.cjs +1 -1
- package/dist/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs +1 -1
- package/dist/components/ThemeSwitcherDropDown/MobileThemeSwitcher.cjs +1 -1
- package/dist/components/ThemeSwitcherDropDown/MobileThemeSwitcher.mjs +1 -1
- package/dist/components/Toaster/Toast.cjs +1 -1
- package/dist/components/Toaster/Toast.mjs +1 -1
- package/dist/components/Toaster/Toaster.cjs +1 -1
- package/dist/components/Toaster/Toaster.mjs +1 -1
- package/dist/components/WithResizer/index.cjs +1 -1
- package/dist/components/WithResizer/index.mjs +1 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/hooks/intlayerAPIHooks.cjs +1 -1
- package/dist/hooks/intlayerAPIHooks.d.ts +47 -47
- package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
- package/dist/hooks/intlayerAPIHooks.mjs +1 -1
- package/dist/hooks/useAsync/useAsyncStateStore.cjs +1 -1
- package/dist/hooks/useAsync/useAsyncStateStore.mjs +1 -1
- package/dist/hooks/useIntlayerAPI.cjs.map +1 -1
- package/dist/hooks/useIntlayerAPI.d.ts +58 -58
- package/dist/hooks/useIntlayerAPI.mjs.map +1 -1
- package/dist/index-B2UElBcQ.cjs +200 -0
- package/dist/index-B2UElBcQ.cjs.map +1 -0
- package/dist/index-BMzh1_UJ.js +201 -0
- package/dist/index-BMzh1_UJ.js.map +1 -0
- package/dist/index-BdTa-9zc.js +201 -0
- package/dist/index-BdTa-9zc.js.map +1 -0
- package/dist/index-DFc7og1d.cjs.map +1 -1
- package/dist/index-DTCehvKe.cjs +200 -0
- package/dist/index-DTCehvKe.cjs.map +1 -0
- package/dist/index-DcWYZrJW.js.map +1 -1
- package/dist/jsx-runtime-CL03FswV.cjs +506 -0
- package/dist/jsx-runtime-CL03FswV.cjs.map +1 -0
- package/dist/jsx-runtime-CgFM7lM3.cjs +934 -0
- package/dist/jsx-runtime-CgFM7lM3.cjs.map +1 -0
- package/dist/jsx-runtime-DQkoUcjV.js +935 -0
- package/dist/jsx-runtime-DQkoUcjV.js.map +1 -0
- package/dist/jsx-runtime-kmx34TxC.js +507 -0
- package/dist/jsx-runtime-kmx34TxC.js.map +1 -0
- 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/zod-BV4nCGJE.js.map +1 -1
- package/dist/zod-DSrtTSD_.cjs.map +1 -1
- package/package.json +55 -60
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIntlayerAPI.cjs","sources":["../../src/hooks/useIntlayerAPI.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { getIntlayerAPI } from '../../../api/src';\nimport { FetcherOptions } from '../../../api/src/fetcher';\nimport { useAuth } from '../components/Auth/useAuth';\n\nexport const useIntlayerAuth = (options?: FetcherOptions) => {\n const { csrfToken, oAuth2AccessToken } = useAuth();\n\n const headers = useMemo(\n () =>\n oAuth2AccessToken?.accessToken\n ? {\n Authorization: `Bearer ${oAuth2AccessToken.accessToken}`,\n }\n : undefined,\n [oAuth2AccessToken?.accessToken]\n );\n\n const body = useMemo(\n () => (csrfToken ? { csrf_token: csrfToken } : undefined),\n [csrfToken]\n );\n\n return useMemo(\n () =>\n getIntlayerAPI({\n headers,\n body,\n ...options,\n }),\n [body, headers]\n );\n};\n"],"names":["useAuth","useMemo","getIntlayerAPI"],"mappings":";;;;;AAKa,MAAA,kBAAkB,CAAC,YAA6B;AAC3D,QAAM,EAAE,WAAW,kBAAkB,IAAIA,sCAAQ;AAEjD,QAAM,UAAUC,WAAA;AAAA,IACd,MACE,mBAAmB,cACf;AAAA,MACE,eAAe,UAAU,kBAAkB,WAAW;AAAA,IAExD
|
|
1
|
+
{"version":3,"file":"useIntlayerAPI.cjs","sources":["../../src/hooks/useIntlayerAPI.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { getIntlayerAPI } from '../../../api/src';\nimport { FetcherOptions } from '../../../api/src/fetcher';\nimport { useAuth } from '../components/Auth/useAuth';\n\nexport const useIntlayerAuth = (options?: FetcherOptions) => {\n const { csrfToken, oAuth2AccessToken } = useAuth();\n\n const headers = useMemo(\n () =>\n oAuth2AccessToken?.accessToken\n ? {\n Authorization: `Bearer ${oAuth2AccessToken.accessToken}`,\n }\n : undefined,\n [oAuth2AccessToken?.accessToken]\n );\n\n const body = useMemo(\n () => (csrfToken ? { csrf_token: csrfToken } : undefined),\n [csrfToken]\n );\n\n return useMemo(\n () =>\n getIntlayerAPI({\n headers,\n body,\n ...options,\n }),\n [body, headers]\n );\n};\n"],"names":["useAuth","useMemo","getIntlayerAPI"],"mappings":";;;;;AAKa,MAAA,kBAAkB,CAAC,YAA6B;AAC3D,QAAM,EAAE,WAAW,kBAAkB,IAAIA,sCAAQ;AAEjD,QAAM,UAAUC,WAAA;AAAA,IACd,MACE,mBAAmB,cACf;AAAA,MACE,eAAe,UAAU,kBAAkB,WAAW;AAAA,IAAA,IAExD;AAAA,IACN,CAAC,mBAAmB,WAAW;AAAA,EACjC;AAEA,QAAM,OAAOA,WAAA;AAAA,IACX,MAAO,YAAY,EAAE,YAAY,UAAc,IAAA;AAAA,IAC/C,CAAC,SAAS;AAAA,EACZ;AAEO,SAAAA,WAAA;AAAA,IACL,MACEC,qBAAe;AAAA,MACb;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IAAA,CACJ;AAAA,IACH,CAAC,MAAM,OAAO;AAAA,EAChB;AACF;;"}
|
|
@@ -1,79 +1,79 @@
|
|
|
1
1
|
import { FetcherOptions } from '../../../api/src/fetcher';
|
|
2
2
|
export declare const useIntlayerAuth: (options?: FetcherOptions) => {
|
|
3
3
|
organization: {
|
|
4
|
-
getOrganizations: (filters?: GetOrganizationsParams, otherOptions?: FetcherOptions) => Promise<GetOrganizationsResult>;
|
|
5
|
-
getOrganization: (organizationId: GetOrganizationParam, otherOptions?: FetcherOptions) => Promise<GetOrganizationResult>;
|
|
6
|
-
addOrganization: (organization: AddOrganizationBody, otherOptions?: FetcherOptions) => Promise<AddOrganizationResult>;
|
|
7
|
-
addOrganizationMember: (body: AddOrganizationMemberBody, otherOptions?: FetcherOptions) => Promise<AddOrganizationMemberResult>;
|
|
8
|
-
updateOrganization: (organization: UpdateOrganizationBody, otherOptions?: FetcherOptions) => Promise<UpdateOrganizationResult>;
|
|
9
|
-
updateOrganizationMembers: (body: UpdateOrganizationMembersBody, otherOptions?: FetcherOptions) => Promise<UpdateOrganizationMembersResult>;
|
|
10
|
-
deleteOrganization: (otherOptions?: FetcherOptions) => Promise<DeleteOrganizationResult>;
|
|
11
|
-
selectOrganization: (organizationId: SelectOrganizationParam, otherOptions?: FetcherOptions) => Promise<SelectOrganizationResult>;
|
|
12
|
-
unselectOrganization: (otherOptions?: FetcherOptions) => Promise<UnselectOrganizationResult>;
|
|
4
|
+
getOrganizations: (filters?: import('@intlayer/backend').GetOrganizationsParams, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetOrganizationsResult>;
|
|
5
|
+
getOrganization: (organizationId: import('@intlayer/backend').GetOrganizationParam["organizationId"], otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetOrganizationResult>;
|
|
6
|
+
addOrganization: (organization: import('@intlayer/backend').AddOrganizationBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').AddOrganizationResult>;
|
|
7
|
+
addOrganizationMember: (body: import('@intlayer/backend').AddOrganizationMemberBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').AddOrganizationMemberResult>;
|
|
8
|
+
updateOrganization: (organization: import('@intlayer/backend').UpdateOrganizationBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').UpdateOrganizationResult>;
|
|
9
|
+
updateOrganizationMembers: (body: import('@intlayer/backend').UpdateOrganizationMembersBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').UpdateOrganizationMembersResult>;
|
|
10
|
+
deleteOrganization: (otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').DeleteOrganizationResult>;
|
|
11
|
+
selectOrganization: (organizationId: import('@intlayer/backend').SelectOrganizationParam["organizationId"], otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').SelectOrganizationResult>;
|
|
12
|
+
unselectOrganization: (otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').UnselectOrganizationResult>;
|
|
13
13
|
};
|
|
14
14
|
project: {
|
|
15
|
-
getProjects: (filters?: GetProjectsParams, otherOptions?: FetcherOptions) => Promise<GetProjectsResult>;
|
|
16
|
-
addProject: (project: AddProjectBody, otherOptions?: FetcherOptions) => Promise<AddProjectResult>;
|
|
17
|
-
updateProject: (project: UpdateProjectBody, otherOptions?: FetcherOptions) => Promise<UpdateProjectResult>;
|
|
18
|
-
updateProjectMembers: (body: UpdateProjectMembersBody, otherOptions?: FetcherOptions) => Promise<UpdateProjectMembersResult>;
|
|
19
|
-
deleteProject: (otherOptions?: FetcherOptions) => Promise<DeleteProjectResult>;
|
|
20
|
-
selectProject: (projectId: SelectProjectParam, otherOptions?: FetcherOptions) => Promise<SelectProjectResult>;
|
|
21
|
-
unselectProject: (otherOptions?: FetcherOptions) => Promise<UnselectProjectResult>;
|
|
22
|
-
addNewAccessKey: (accessKey: AddNewAccessKeyBody, otherOptions?: FetcherOptions) => Promise<AddNewAccessKeyResponse>;
|
|
23
|
-
deleteAccessKey: (clientId: DeleteAccessKeyBody, otherOptions?: FetcherOptions) => Promise<DeleteAccessKeyResponse>;
|
|
24
|
-
refreshAccessKey: (clientId: RefreshAccessKeyBody, otherOptions?: FetcherOptions) => Promise<RefreshAccessKeyResponse>;
|
|
15
|
+
getProjects: (filters?: import('@intlayer/backend').GetProjectsParams, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetProjectsResult>;
|
|
16
|
+
addProject: (project: import('@intlayer/backend').AddProjectBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').AddProjectResult>;
|
|
17
|
+
updateProject: (project: import('@intlayer/backend').UpdateProjectBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').UpdateProjectResult>;
|
|
18
|
+
updateProjectMembers: (body: import('@intlayer/backend').UpdateProjectMembersBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').UpdateProjectMembersResult>;
|
|
19
|
+
deleteProject: (otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').DeleteProjectResult>;
|
|
20
|
+
selectProject: (projectId: import('@intlayer/backend').SelectProjectParam["projectId"], otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').SelectProjectResult>;
|
|
21
|
+
unselectProject: (otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').UnselectProjectResult>;
|
|
22
|
+
addNewAccessKey: (accessKey: import('@intlayer/backend').AddNewAccessKeyBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').AddNewAccessKeyResponse>;
|
|
23
|
+
deleteAccessKey: (clientId: import('@intlayer/backend').DeleteAccessKeyBody["clientId"], otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').DeleteAccessKeyResponse>;
|
|
24
|
+
refreshAccessKey: (clientId: import('@intlayer/backend').RefreshAccessKeyBody["clientId"], otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').RefreshAccessKeyResponse>;
|
|
25
25
|
};
|
|
26
26
|
user: {
|
|
27
|
-
createUser: (user: CreateUserBody, otherOptions?: FetcherOptions) => Promise<CreateUserResult>;
|
|
28
|
-
getUsers: (filters?: GetUsersParams, otherOptions?: FetcherOptions) => Promise<GetUsersResult>;
|
|
29
|
-
getUserById: (userId: GetUserByIdParams, otherOptions?: FetcherOptions) => Promise<GetUserByIdResult>;
|
|
30
|
-
getUserByAccount: (providerAccountId: GetUserByAccountParams, provider: GetUserByAccountParams, otherOptions?: FetcherOptions) => Promise<GetUserByAccountResult>;
|
|
31
|
-
getUserByEmail: (email: GetUserByEmailParams, otherOptions?: FetcherOptions) => Promise<GetUserByEmailResult>;
|
|
32
|
-
updateUser: (user: UpdateUserBody, otherOptions?: FetcherOptions) => Promise<UpdateUserResult>;
|
|
33
|
-
deleteUser: (userId: string, otherOptions?: FetcherOptions) => Promise<UpdateUserResult>;
|
|
27
|
+
createUser: (user: import('@intlayer/backend').CreateUserBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').CreateUserResult>;
|
|
28
|
+
getUsers: (filters?: import('@intlayer/backend').GetUsersParams, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetUsersResult>;
|
|
29
|
+
getUserById: (userId: import('@intlayer/backend').GetUserByIdParams["userId"], otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetUserByIdResult>;
|
|
30
|
+
getUserByAccount: (providerAccountId: import('@intlayer/backend').GetUserByAccountParams["providerAccountId"], provider: import('@intlayer/backend').GetUserByAccountParams["provider"], otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetUserByAccountResult>;
|
|
31
|
+
getUserByEmail: (email: import('@intlayer/backend').GetUserByEmailParams["email"], otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetUserByEmailResult>;
|
|
32
|
+
updateUser: (user: import('@intlayer/backend').UpdateUserBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').UpdateUserResult>;
|
|
33
|
+
deleteUser: (userId: string, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').UpdateUserResult>;
|
|
34
34
|
};
|
|
35
35
|
auth: {
|
|
36
|
-
login: (user: LoginBody, otherOptions?: FetcherOptions) => Promise<LoginResult>;
|
|
37
|
-
getLoginWithGitHubURL: (params: GithubLoginQueryParams) => string;
|
|
38
|
-
getLoginWithGoogleURL: (params: GoogleLoginQueryParams) => string;
|
|
39
|
-
register: (user: RegisterBody, query?: RegisterQuery, otherOptions?: FetcherOptions) => Promise<RegisterResult>;
|
|
36
|
+
login: (user: import('@intlayer/backend').LoginBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').LoginResult>;
|
|
37
|
+
getLoginWithGitHubURL: (params: import('@intlayer/backend').GithubLoginQueryParams) => string;
|
|
38
|
+
getLoginWithGoogleURL: (params: import('@intlayer/backend').GoogleLoginQueryParams) => string;
|
|
39
|
+
register: (user: import('@intlayer/backend').RegisterBody, query?: import('@intlayer/backend').RegisterQuery, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').RegisterResult>;
|
|
40
40
|
logout: (otherOptions?: FetcherOptions) => Promise<void>;
|
|
41
|
-
resetPassword: (params: ResetPasswordParams, otherOptions?: FetcherOptions) => Promise<ResetPasswordResult>;
|
|
42
|
-
askResetPassword: (email: AskResetPasswordBody, otherOptions?: FetcherOptions) => Promise<AskResetPasswordResult>;
|
|
43
|
-
checkIfUserHasPassword: (otherOptions?: FetcherOptions) => Promise<CheckIfUserHasPasswordResult>;
|
|
44
|
-
verifyEmail: ({ userId, secret }: ValidEmailParams, otherOptions?: FetcherOptions) => Promise<ValidEmailResult>;
|
|
45
|
-
getVerifyEmailStatusURL: (userId: string | UserAPI) => string;
|
|
46
|
-
changePassword: (data: UpdatePasswordBody, otherOptions?: FetcherOptions) => Promise<UpdatePasswordResult>;
|
|
47
|
-
createSession: (data: CreateSessionBody, otherOptions?: FetcherOptions) => Promise<CreateSessionResult>;
|
|
48
|
-
getSession: (sessionToken?: GetSessionInformationQuery, otherOptions?: FetcherOptions) => Promise<GetSessionInformationResult>;
|
|
49
|
-
getCSRFToken: (otherOptions?: FetcherOptions) => Promise<SetCSRFTokenResult>;
|
|
50
|
-
getOAuth2AccessToken: (otherOptions?: FetcherOptions) => Promise<GetOAuth2TokenResult>;
|
|
41
|
+
resetPassword: (params: import('@intlayer/backend').ResetPasswordParams, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').ResetPasswordResult>;
|
|
42
|
+
askResetPassword: (email: import('@intlayer/backend').AskResetPasswordBody["email"], otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').AskResetPasswordResult>;
|
|
43
|
+
checkIfUserHasPassword: (otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').CheckIfUserHasPasswordResult>;
|
|
44
|
+
verifyEmail: ({ userId, secret }: import('@intlayer/backend').ValidEmailParams, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').ValidEmailResult>;
|
|
45
|
+
getVerifyEmailStatusURL: (userId: string | import('@intlayer/backend').UserAPI["_id"]) => string;
|
|
46
|
+
changePassword: (data: import('@intlayer/backend').UpdatePasswordBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').UpdatePasswordResult>;
|
|
47
|
+
createSession: (data: import('@intlayer/backend').CreateSessionBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').CreateSessionResult>;
|
|
48
|
+
getSession: (sessionToken?: import('@intlayer/backend').GetSessionInformationQuery["session_token"], otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetSessionInformationResult>;
|
|
49
|
+
getCSRFToken: (otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').SetCSRFTokenResult>;
|
|
50
|
+
getOAuth2AccessToken: (otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetOAuth2TokenResult>;
|
|
51
51
|
};
|
|
52
52
|
dictionary: {
|
|
53
|
-
getDictionaries: (filters?: GetDictionariesParams, otherOptions?: FetcherOptions) => Promise<GetDictionariesResult>;
|
|
54
|
-
getDictionariesKeys: (otherOptions?: FetcherOptions) => Promise<GetDictionariesKeysResult>;
|
|
55
|
-
getDictionary: (dictionaryKey: GetDictionaryParams, version?: GetDictionaryQuery, otherOptions?: FetcherOptions) => Promise<GetDictionaryResult>;
|
|
56
|
-
pushDictionaries: (dictionaries: PushDictionariesBody, otherOptions?: FetcherOptions) => Promise<PushDictionariesResult>;
|
|
57
|
-
addDictionary: (dictionary: AddDictionaryBody, otherOptions?: FetcherOptions) => Promise<AddDictionaryResult>;
|
|
58
|
-
updateDictionary: (dictionaryId: UpdateDictionaryParam, dictionary: UpdateDictionaryBody, otherOptions?: FetcherOptions) => Promise<UpdateDictionaryResult>;
|
|
59
|
-
deleteDictionary: (id: DeleteDictionaryParam, otherOptions?: FetcherOptions) => Promise<DeleteDictionaryResult>;
|
|
53
|
+
getDictionaries: (filters?: import('@intlayer/backend').GetDictionariesParams, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetDictionariesResult>;
|
|
54
|
+
getDictionariesKeys: (otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetDictionariesKeysResult>;
|
|
55
|
+
getDictionary: (dictionaryKey: import('@intlayer/backend').GetDictionaryParams["dictionaryKey"], version?: import('@intlayer/backend').GetDictionaryQuery["version"], otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetDictionaryResult>;
|
|
56
|
+
pushDictionaries: (dictionaries: import('@intlayer/backend').PushDictionariesBody["dictionaries"], otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').PushDictionariesResult>;
|
|
57
|
+
addDictionary: (dictionary: import('@intlayer/backend').AddDictionaryBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').AddDictionaryResult>;
|
|
58
|
+
updateDictionary: (dictionaryId: import('@intlayer/backend').UpdateDictionaryParam["dictionaryId"], dictionary: import('@intlayer/backend').UpdateDictionaryBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').UpdateDictionaryResult>;
|
|
59
|
+
deleteDictionary: (id: import('@intlayer/backend').DeleteDictionaryParam["dictionaryId"], otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').DeleteDictionaryResult>;
|
|
60
60
|
};
|
|
61
61
|
stripe: {
|
|
62
|
-
getSubscription: (body?: GetCheckoutSessionBody, otherOptions?: FetcherOptions) => Promise<GetCheckoutSessionResult>;
|
|
63
|
-
cancelSubscription: (otherOptions?: FetcherOptions) => Promise<GetCheckoutSessionResult>;
|
|
62
|
+
getSubscription: (body?: import('@intlayer/backend').GetCheckoutSessionBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetCheckoutSessionResult>;
|
|
63
|
+
cancelSubscription: (otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetCheckoutSessionResult>;
|
|
64
64
|
};
|
|
65
65
|
ai: {
|
|
66
|
-
auditContentDeclaration: (body?: AuditContentDeclarationBody, otherOptions?: FetcherOptions) => Promise<AuditContentDeclarationResult>;
|
|
67
|
-
auditContentDeclarationField: (body?: AuditContentDeclarationFieldBody, otherOptions?: FetcherOptions) => Promise<AuditContentDeclarationFieldResult>;
|
|
68
|
-
auditContentDeclarationMetadata: (body?: AuditContentDeclarationMetadataBody, otherOptions?: FetcherOptions) => Promise<AuditContentDeclarationMetadataResult>;
|
|
69
|
-
auditTag: (body?: AuditTagBody, otherOptions?: FetcherOptions) => Promise<AuditTagResult>;
|
|
70
|
-
askDocQuestion: (body?: AskDocQuestionBody, otherOptions?: FetcherOptions) => Promise<AskDocQuestionResult>;
|
|
66
|
+
auditContentDeclaration: (body?: import('@intlayer/backend').AuditContentDeclarationBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').AuditContentDeclarationResult>;
|
|
67
|
+
auditContentDeclarationField: (body?: import('@intlayer/backend').AuditContentDeclarationFieldBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').AuditContentDeclarationFieldResult>;
|
|
68
|
+
auditContentDeclarationMetadata: (body?: import('@intlayer/backend').AuditContentDeclarationMetadataBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').AuditContentDeclarationMetadataResult>;
|
|
69
|
+
auditTag: (body?: import('@intlayer/backend').AuditTagBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').AuditTagResult>;
|
|
70
|
+
askDocQuestion: (body?: import('@intlayer/backend').AskDocQuestionBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').AskDocQuestionResult>;
|
|
71
71
|
};
|
|
72
72
|
tag: {
|
|
73
|
-
getTags: (filters?: GetTagsParams, otherOptions?: FetcherOptions) => Promise<GetTagsResult>;
|
|
74
|
-
addTag: (tag: AddTagBody, otherOptions?: FetcherOptions) => Promise<AddTagResult>;
|
|
75
|
-
updateTag: (tagId: UpdateTagParams, tag: UpdateTagBody, otherOptions?: FetcherOptions) => Promise<UpdateTagResult>;
|
|
76
|
-
deleteTag: (tagId: DeleteTagParams, otherOptions?: FetcherOptions) => Promise<DeleteTagResult>;
|
|
73
|
+
getTags: (filters?: import('@intlayer/backend').GetTagsParams, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetTagsResult>;
|
|
74
|
+
addTag: (tag: import('@intlayer/backend').AddTagBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').AddTagResult>;
|
|
75
|
+
updateTag: (tagId: import('@intlayer/backend').UpdateTagParams["tagId"], tag: import('@intlayer/backend').UpdateTagBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').UpdateTagResult>;
|
|
76
|
+
deleteTag: (tagId: import('@intlayer/backend').DeleteTagParams["tagId"], otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').DeleteTagResult>;
|
|
77
77
|
};
|
|
78
78
|
};
|
|
79
79
|
//# sourceMappingURL=useIntlayerAPI.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIntlayerAPI.mjs","sources":["../../src/hooks/useIntlayerAPI.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { getIntlayerAPI } from '../../../api/src';\nimport { FetcherOptions } from '../../../api/src/fetcher';\nimport { useAuth } from '../components/Auth/useAuth';\n\nexport const useIntlayerAuth = (options?: FetcherOptions) => {\n const { csrfToken, oAuth2AccessToken } = useAuth();\n\n const headers = useMemo(\n () =>\n oAuth2AccessToken?.accessToken\n ? {\n Authorization: `Bearer ${oAuth2AccessToken.accessToken}`,\n }\n : undefined,\n [oAuth2AccessToken?.accessToken]\n );\n\n const body = useMemo(\n () => (csrfToken ? { csrf_token: csrfToken } : undefined),\n [csrfToken]\n );\n\n return useMemo(\n () =>\n getIntlayerAPI({\n headers,\n body,\n ...options,\n }),\n [body, headers]\n );\n};\n"],"names":[],"mappings":";;;AAKa,MAAA,kBAAkB,CAAC,YAA6B;AAC3D,QAAM,EAAE,WAAW,kBAAkB,IAAI,QAAQ;AAEjD,QAAM,UAAU;AAAA,IACd,MACE,mBAAmB,cACf;AAAA,MACE,eAAe,UAAU,kBAAkB,WAAW;AAAA,IAExD
|
|
1
|
+
{"version":3,"file":"useIntlayerAPI.mjs","sources":["../../src/hooks/useIntlayerAPI.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { getIntlayerAPI } from '../../../api/src';\nimport { FetcherOptions } from '../../../api/src/fetcher';\nimport { useAuth } from '../components/Auth/useAuth';\n\nexport const useIntlayerAuth = (options?: FetcherOptions) => {\n const { csrfToken, oAuth2AccessToken } = useAuth();\n\n const headers = useMemo(\n () =>\n oAuth2AccessToken?.accessToken\n ? {\n Authorization: `Bearer ${oAuth2AccessToken.accessToken}`,\n }\n : undefined,\n [oAuth2AccessToken?.accessToken]\n );\n\n const body = useMemo(\n () => (csrfToken ? { csrf_token: csrfToken } : undefined),\n [csrfToken]\n );\n\n return useMemo(\n () =>\n getIntlayerAPI({\n headers,\n body,\n ...options,\n }),\n [body, headers]\n );\n};\n"],"names":[],"mappings":";;;AAKa,MAAA,kBAAkB,CAAC,YAA6B;AAC3D,QAAM,EAAE,WAAW,kBAAkB,IAAI,QAAQ;AAEjD,QAAM,UAAU;AAAA,IACd,MACE,mBAAmB,cACf;AAAA,MACE,eAAe,UAAU,kBAAkB,WAAW;AAAA,IAAA,IAExD;AAAA,IACN,CAAC,mBAAmB,WAAW;AAAA,EACjC;AAEA,QAAM,OAAO;AAAA,IACX,MAAO,YAAY,EAAE,YAAY,UAAc,IAAA;AAAA,IAC/C,CAAC,SAAS;AAAA,EACZ;AAEO,SAAA;AAAA,IACL,MACE,eAAe;AAAA,MACb;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IAAA,CACJ;AAAA,IACH,CAAC,MAAM,OAAO;AAAA,EAChB;AACF;"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
const jsxRuntime = require("./jsx-runtime-CL03FswV.cjs");
|
|
4
|
+
const core = require("@intlayer/core");
|
|
5
|
+
const require$$0 = require("react");
|
|
6
|
+
const lucideReact = require("lucide-react");
|
|
7
|
+
const components_DictionaryEditor_ItemLayout = require("./components/DictionaryEditor/ItemLayout.cjs");
|
|
8
|
+
const components_DictionaryEditor_NodeWrapper_StringWrapper = require("./components/DictionaryEditor/NodeWrapper/StringWrapper.cjs");
|
|
9
|
+
const ArrayWrapper = (props) => {
|
|
10
|
+
const {
|
|
11
|
+
keyPath,
|
|
12
|
+
section,
|
|
13
|
+
onFocusKeyPath,
|
|
14
|
+
onClickEdit,
|
|
15
|
+
focusedKeyPath = []
|
|
16
|
+
} = props;
|
|
17
|
+
return section.map((subSection, key) => {
|
|
18
|
+
const newKeyPathEl = {
|
|
19
|
+
key,
|
|
20
|
+
type: core.NodeType.Array
|
|
21
|
+
};
|
|
22
|
+
const newKeyPath = [...keyPath, newKeyPathEl];
|
|
23
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
24
|
+
components_DictionaryEditor_ItemLayout.ItemLayout,
|
|
25
|
+
{
|
|
26
|
+
level: keyPath.length,
|
|
27
|
+
title: `${key}`,
|
|
28
|
+
description: "",
|
|
29
|
+
isSelected: core.isSameKeyPath(newKeyPath, focusedKeyPath),
|
|
30
|
+
onClick: (e) => {
|
|
31
|
+
e.stopPropagation();
|
|
32
|
+
onFocusKeyPath(newKeyPath);
|
|
33
|
+
},
|
|
34
|
+
rightParam: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
35
|
+
lucideReact.Edit,
|
|
36
|
+
{
|
|
37
|
+
size: 16,
|
|
38
|
+
role: "button",
|
|
39
|
+
"aria-label": "Open the editor",
|
|
40
|
+
onClick: (e) => {
|
|
41
|
+
e.stopPropagation();
|
|
42
|
+
onClickEdit?.(newKeyPath);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
),
|
|
46
|
+
children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(NodeWrapper, { ...props, keyPath: newKeyPath, section: subSection })
|
|
47
|
+
},
|
|
48
|
+
JSON.stringify(subSection)
|
|
49
|
+
);
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
const EnumerationWrapper = (props) => {
|
|
53
|
+
const { keyPath, section } = props;
|
|
54
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("div", { className: "ml-2 grid grid-cols-[auto,1fr] gap-2", children: Object.keys(section).filter((key) => !traceKeys.includes(key)).map((key) => {
|
|
55
|
+
const newKeyPathEl = {
|
|
56
|
+
type: core.NodeType.Enumeration,
|
|
57
|
+
key
|
|
58
|
+
};
|
|
59
|
+
const newKeyPath = [...keyPath, newKeyPathEl];
|
|
60
|
+
const subSection = section.enumeration[key];
|
|
61
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment, { children: [
|
|
62
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("span", { className: "flex items-center font-bold", children: key }),
|
|
63
|
+
/* @__PURE__ */ require$$0.createElement(
|
|
64
|
+
NodeWrapper,
|
|
65
|
+
{
|
|
66
|
+
...props,
|
|
67
|
+
key,
|
|
68
|
+
keyPath: newKeyPath,
|
|
69
|
+
section: subSection
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
] });
|
|
73
|
+
}) });
|
|
74
|
+
};
|
|
75
|
+
const NestedObjectWrapper = (props) => {
|
|
76
|
+
const {
|
|
77
|
+
keyPath,
|
|
78
|
+
section,
|
|
79
|
+
focusedKeyPath = [],
|
|
80
|
+
onClickEdit,
|
|
81
|
+
onFocusKeyPath
|
|
82
|
+
} = props;
|
|
83
|
+
return Object.keys(section).filter((key) => !traceKeys.includes(key)).map((key) => {
|
|
84
|
+
const newKeyPathEl = { key, type: core.NodeType.Object };
|
|
85
|
+
const newKeyPath = [...keyPath, newKeyPathEl];
|
|
86
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
87
|
+
components_DictionaryEditor_ItemLayout.ItemLayout,
|
|
88
|
+
{
|
|
89
|
+
level: keyPath.length,
|
|
90
|
+
title: key,
|
|
91
|
+
description: "",
|
|
92
|
+
isSelected: core.isSameKeyPath(newKeyPath, focusedKeyPath),
|
|
93
|
+
onClick: (e) => {
|
|
94
|
+
e.stopPropagation();
|
|
95
|
+
onFocusKeyPath(newKeyPath);
|
|
96
|
+
},
|
|
97
|
+
rightParam: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
98
|
+
lucideReact.Edit,
|
|
99
|
+
{
|
|
100
|
+
size: 16,
|
|
101
|
+
role: "button",
|
|
102
|
+
"aria-label": "Open the editor",
|
|
103
|
+
onClick: (e) => {
|
|
104
|
+
e.stopPropagation();
|
|
105
|
+
onClickEdit?.(newKeyPath);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
),
|
|
109
|
+
children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(NodeWrapper, { ...props, keyPath: newKeyPath, section: section[key] })
|
|
110
|
+
},
|
|
111
|
+
key
|
|
112
|
+
);
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
const TranslationWrapper = (props) => {
|
|
116
|
+
const { keyPath, section, locale } = props;
|
|
117
|
+
const newKeyPathEl = {
|
|
118
|
+
type: core.NodeType.Translation,
|
|
119
|
+
key: locale
|
|
120
|
+
};
|
|
121
|
+
const newKeyPath = [...keyPath, newKeyPathEl];
|
|
122
|
+
const subSection = section.translation[locale];
|
|
123
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(NodeWrapper, { ...props, keyPath: newKeyPath, section: subSection });
|
|
124
|
+
};
|
|
125
|
+
const traceKeys = ["filePath", "id", "nodeType"];
|
|
126
|
+
const isReactNode = (node) => typeof node?.key !== "undefined" && typeof node?.props !== "undefined";
|
|
127
|
+
const createReactElement = (element) => {
|
|
128
|
+
if (typeof element === "string") {
|
|
129
|
+
return element;
|
|
130
|
+
}
|
|
131
|
+
const convertChildrenAsArray = (element2) => {
|
|
132
|
+
if (element2?.props && typeof element2.props.children === "object") {
|
|
133
|
+
const childrenResult = [];
|
|
134
|
+
const { children } = element2.props;
|
|
135
|
+
Object.keys(children).forEach((key) => {
|
|
136
|
+
childrenResult.push(createReactElement(children[key]));
|
|
137
|
+
});
|
|
138
|
+
return {
|
|
139
|
+
...element2,
|
|
140
|
+
props: { ...element2.props, children: childrenResult }
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
return {
|
|
144
|
+
...element2,
|
|
145
|
+
props: { ...element2.props, children: element2.props.children }
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
const fixedElement = convertChildrenAsArray(element);
|
|
149
|
+
const { type, props } = fixedElement;
|
|
150
|
+
return require$$0.createElement(type ?? "div", props, ...props.children);
|
|
151
|
+
};
|
|
152
|
+
const NodeWrapper = (props) => {
|
|
153
|
+
const { section } = props;
|
|
154
|
+
if (typeof section === "object") {
|
|
155
|
+
if (isReactNode(section)) {
|
|
156
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment, { children: [
|
|
157
|
+
createReactElement(section),
|
|
158
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("span", { className: "text-neutral dark:text-neutral-dark text-xs", children: "React node not editable" })
|
|
159
|
+
] });
|
|
160
|
+
}
|
|
161
|
+
if (section.nodeType === core.NodeType.Translation) {
|
|
162
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
163
|
+
TranslationWrapper,
|
|
164
|
+
{
|
|
165
|
+
...props,
|
|
166
|
+
section
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
if (section.nodeType === core.NodeType.Enumeration) {
|
|
171
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
172
|
+
EnumerationWrapper,
|
|
173
|
+
{
|
|
174
|
+
...props,
|
|
175
|
+
section
|
|
176
|
+
}
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
if (Array.isArray(section)) {
|
|
180
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(ArrayWrapper, { ...props, section });
|
|
181
|
+
}
|
|
182
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
183
|
+
NestedObjectWrapper,
|
|
184
|
+
{
|
|
185
|
+
...props,
|
|
186
|
+
section
|
|
187
|
+
}
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
if (typeof section === "string") {
|
|
191
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_DictionaryEditor_NodeWrapper_StringWrapper.StringWrapper, { ...props, section });
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
exports.ArrayWrapper = ArrayWrapper;
|
|
195
|
+
exports.EnumerationWrapper = EnumerationWrapper;
|
|
196
|
+
exports.NestedObjectWrapper = NestedObjectWrapper;
|
|
197
|
+
exports.NodeWrapper = NodeWrapper;
|
|
198
|
+
exports.TranslationWrapper = TranslationWrapper;
|
|
199
|
+
exports.traceKeys = traceKeys;
|
|
200
|
+
//# sourceMappingURL=index-B2UElBcQ.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-B2UElBcQ.cjs","sources":["../src/components/DictionaryEditor/NodeWrapper/ArrayWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/TranslationWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/index.tsx"],"sourcesContent":["/* eslint-disable import/no-cycle */\nimport {\n isSameKeyPath,\n NodeType,\n type DictionaryValue,\n type KeyPath,\n} from '@intlayer/core';\nimport { Edit } from 'lucide-react';\nimport type { FC } from 'react';\nimport { ItemLayout } from '../ItemLayout';\nimport { NodeWrapper, type NodeWrapperProps } from './index';\n\ntype ArrayWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: DictionaryValue[];\n};\n\nexport const ArrayWrapper: FC<ArrayWrapperProps> = (props) => {\n const {\n keyPath,\n section,\n onFocusKeyPath,\n onClickEdit,\n focusedKeyPath = [],\n } = props;\n\n return section.map((subSection, key) => {\n const newKeyPathEl: KeyPath = {\n key,\n type: NodeType.Array,\n };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n return (\n <ItemLayout\n level={keyPath.length}\n key={JSON.stringify(subSection)}\n title={`${key}`}\n description=\"\"\n isSelected={isSameKeyPath(newKeyPath, focusedKeyPath)}\n onClick={(e) => {\n e.stopPropagation();\n onFocusKeyPath(newKeyPath);\n }}\n rightParam={\n <Edit\n size={16}\n role=\"button\"\n aria-label=\"Open the editor\"\n onClick={(e) => {\n e.stopPropagation();\n\n onClickEdit?.(newKeyPath);\n }}\n />\n }\n >\n <NodeWrapper {...props} keyPath={newKeyPath} section={subSection} />\n </ItemLayout>\n );\n });\n};\n","/* eslint-disable import/no-cycle */\nimport {\n type KeyPath,\n NodeType,\n type EnumerationContent,\n type DictionaryValue,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { NodeWrapper, traceKeys, type NodeWrapperProps } from './index';\n\ntype EnumerationWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: EnumerationContent<DictionaryValue>;\n};\n\nexport const EnumerationWrapper: FC<EnumerationWrapperProps> = (props) => {\n const { keyPath, section } = props;\n\n return (\n <div className=\"ml-2 grid grid-cols-[auto,1fr] gap-2\">\n {Object.keys(section)\n .filter((key) => !traceKeys.includes(key))\n .map((key) => {\n const newKeyPathEl: KeyPath = {\n type: NodeType.Enumeration,\n key,\n };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n const subSection =\n section.enumeration[key as keyof (typeof section)['enumeration']]!;\n\n return (\n <>\n <span className=\"flex items-center font-bold\">{key}</span>\n <NodeWrapper\n {...props}\n key={key}\n keyPath={newKeyPath}\n section={subSection}\n />\n </>\n );\n })}\n </div>\n );\n};\n","/* eslint-disable import/no-cycle */\n\nimport {\n type KeyPath,\n isSameKeyPath,\n type DictionaryValue,\n NodeType,\n} from '@intlayer/core';\nimport { Edit } from 'lucide-react';\nimport type { FC } from 'react';\nimport { ItemLayout } from '../ItemLayout';\nimport { NodeWrapper, traceKeys, type NodeWrapperProps } from './index';\n\ntype NestedObjectWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: Record<string, DictionaryValue>;\n};\n\nexport const NestedObjectWrapper: FC<NestedObjectWrapperProps> = (props) => {\n const {\n keyPath,\n section,\n focusedKeyPath = [],\n onClickEdit,\n onFocusKeyPath,\n } = props;\n\n return Object.keys(section)\n .filter((key) => !traceKeys.includes(key))\n .map((key) => {\n const newKeyPathEl: KeyPath = { key, type: NodeType.Object };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n return (\n <ItemLayout\n level={keyPath.length}\n key={key}\n title={key}\n description=\"\"\n isSelected={isSameKeyPath(newKeyPath, focusedKeyPath)}\n onClick={(e) => {\n e.stopPropagation();\n\n onFocusKeyPath(newKeyPath);\n }}\n rightParam={\n <Edit\n size={16}\n role=\"button\"\n aria-label=\"Open the editor\"\n onClick={(e) => {\n e.stopPropagation();\n\n onClickEdit?.(newKeyPath);\n }}\n />\n }\n >\n <NodeWrapper {...props} keyPath={newKeyPath} section={section[key]} />\n </ItemLayout>\n );\n });\n};\n","/* eslint-disable import/no-cycle */\n\nimport {\n type KeyPath,\n NodeType,\n type TranslationContent,\n type DictionaryValue,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { NodeWrapper, type NodeWrapperProps } from './index';\n\ntype TranslationWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: TranslationContent<DictionaryValue>;\n};\n\nexport const TranslationWrapper: FC<TranslationWrapperProps> = (props) => {\n const { keyPath, section, locale } = props;\n\n const newKeyPathEl: KeyPath = {\n type: NodeType.Translation,\n key: locale,\n };\n\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n const subSection =\n section.translation[\n locale as unknown as keyof (typeof section)['translation']\n ]!;\n\n return <NodeWrapper {...props} keyPath={newKeyPath} section={subSection} />;\n};\n","/* eslint-disable import/no-cycle */\n'use client';\n\nimport type { Locales } from '@intlayer/config/client';\nimport {\n type EnumerationContent,\n type TranslationContent,\n NodeType,\n type KeyPath,\n type DictionaryValue,\n} from '@intlayer/core';\nimport {\n createElement,\n type ReactElement,\n type ReactNode,\n type FC,\n} from 'react';\nimport { ArrayWrapper } from './ArrayWrapper';\nimport { EnumerationWrapper } from './EnumerationWrapper';\nimport { NestedObjectWrapper } from './NestedObjectWrapper';\nimport { StringWrapper } from './StringWrapper';\nimport { TranslationWrapper } from './TranslationWrapper';\n\nexport const traceKeys: string[] = ['filePath', 'id', 'nodeType'];\n\nconst isReactNode = (node: Record<string, unknown>): boolean =>\n typeof node?.key !== 'undefined' && typeof node?.props !== 'undefined';\n\nexport type NodeWrapperProps = {\n keyPath: KeyPath[];\n section: DictionaryValue;\n onContentChange: (content: { keyPath: KeyPath[]; newValue: string }) => void;\n locale: Locales;\n editedContent: DictionaryValue;\n focusedKeyPath: KeyPath[] | undefined;\n onFocusKeyPath: (keyPath: KeyPath[]) => void;\n onClickEdit?: (keyPath: KeyPath[]) => void;\n};\n\nconst createReactElement = (element: ReactElement) => {\n if (typeof element === 'string') {\n // If it's a string, simply return it (used for text content)\n return element;\n }\n\n const convertChildrenAsArray = (element: ReactElement): ReactElement => {\n if (element?.props && typeof element.props.children === 'object') {\n const childrenResult: ReactNode[] = [];\n const { children } = element.props;\n\n // Create the children elements recursively, if any\n Object.keys(children).forEach((key) => {\n childrenResult.push(createReactElement(children[key]));\n });\n\n return {\n ...element,\n props: { ...element.props, children: childrenResult },\n };\n }\n\n return {\n ...element,\n props: { ...element.props, children: element.props.children },\n };\n };\n\n const fixedElement = convertChildrenAsArray(element);\n\n const { type, props } = fixedElement;\n\n // Create and return the React element\n return createElement(type ?? 'div', props, ...props.children);\n};\n\nexport const NodeWrapper: FC<NodeWrapperProps> = (props) => {\n const { section } = props;\n\n if (typeof section === 'object') {\n if (isReactNode(section as Record<string, unknown>)) {\n return (\n <>\n {createReactElement(section as unknown as ReactElement)}\n <span className=\"text-neutral dark:text-neutral-dark text-xs\">\n React node not editable\n </span>\n </>\n );\n }\n\n if (\n (section as TranslationContent<DictionaryValue>).nodeType ===\n NodeType.Translation\n ) {\n return (\n <TranslationWrapper\n {...props}\n section={section as TranslationContent<DictionaryValue>}\n />\n );\n }\n\n if (\n (section as EnumerationContent<DictionaryValue>).nodeType ===\n NodeType.Enumeration\n ) {\n return (\n <EnumerationWrapper\n {...props}\n section={section as EnumerationContent<DictionaryValue>}\n />\n );\n }\n\n if (Array.isArray(section)) {\n return <ArrayWrapper {...props} section={section as DictionaryValue[]} />;\n }\n\n return (\n <NestedObjectWrapper\n {...props}\n section={section as Record<string, DictionaryValue>}\n />\n );\n }\n\n if (typeof section === 'string') {\n return <StringWrapper {...props} section={section} />;\n }\n};\n"],"names":["NodeType","jsx","ItemLayout","isSameKeyPath","Edit","jsxs","Fragment","createElement","element","StringWrapper"],"mappings":";;;;;;;;AAgBa,MAAA,eAAsC,CAAC,UAAU;AACtD,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,iBAAiB,CAAA;AAAA,EAAC,IAChB;AAEJ,SAAO,QAAQ,IAAI,CAAC,YAAY,QAAQ;AACtC,UAAM,eAAwB;AAAA,MAC5B;AAAA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AAAA,QAAA,mBAAmB,OAAkC;AAAA,QACrDL,2BAAA,kBAAA,IAAA,QAAA,EAAK,WAAU,+CAA8C,UAE9D,0BAAA,CAAA;AAAA,MAAA,GACF;AAAA,IAAA;AAKD,QAAA,QAAgD,aACjDD,KAAA,SAAS,aACT;AAEE,aAAAC,2BAAA,kBAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACE,GAAG;AAAA,UACJ;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAKD,QAAA,QAAgD,aACjDD,KAAA,SAAS,aACT;AAEE,aAAAC,2BAAA,kBAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACE,GAAG;AAAA,UACJ;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAIA,QAAA,MAAM,QAAQ,OAAO,GAAG;AAC1B,aAAQA,2BAAA,kBAAA,IAAA,cAAA,EAAc,GAAG,OAAO,QAAuC,CAAA;AAAA,IAAA;AAIvE,WAAAA,2BAAA,kBAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAIA,MAAA,OAAO,YAAY,UAAU;AAC/B,WAAQA,2BAAA,kBAAA,IAAAQ,sDAAA,eAAA,EAAe,GAAG,OAAO,QAAkB,CAAA;AAAA,EAAA;AAEvD;;;;;;;"}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { j as jsxRuntimeExports } from "./jsx-runtime-kmx34TxC.js";
|
|
3
|
+
import { NodeType, isSameKeyPath } from "@intlayer/core";
|
|
4
|
+
import { createElement } from "react";
|
|
5
|
+
import { Edit } from "lucide-react";
|
|
6
|
+
import { ItemLayout } from "./components/DictionaryEditor/ItemLayout.mjs";
|
|
7
|
+
import { StringWrapper } from "./components/DictionaryEditor/NodeWrapper/StringWrapper.mjs";
|
|
8
|
+
const ArrayWrapper = (props) => {
|
|
9
|
+
const {
|
|
10
|
+
keyPath,
|
|
11
|
+
section,
|
|
12
|
+
onFocusKeyPath,
|
|
13
|
+
onClickEdit,
|
|
14
|
+
focusedKeyPath = []
|
|
15
|
+
} = props;
|
|
16
|
+
return section.map((subSection, key) => {
|
|
17
|
+
const newKeyPathEl = {
|
|
18
|
+
key,
|
|
19
|
+
type: NodeType.Array
|
|
20
|
+
};
|
|
21
|
+
const newKeyPath = [...keyPath, newKeyPathEl];
|
|
22
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
23
|
+
ItemLayout,
|
|
24
|
+
{
|
|
25
|
+
level: keyPath.length,
|
|
26
|
+
title: `${key}`,
|
|
27
|
+
description: "",
|
|
28
|
+
isSelected: isSameKeyPath(newKeyPath, focusedKeyPath),
|
|
29
|
+
onClick: (e) => {
|
|
30
|
+
e.stopPropagation();
|
|
31
|
+
onFocusKeyPath(newKeyPath);
|
|
32
|
+
},
|
|
33
|
+
rightParam: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
34
|
+
Edit,
|
|
35
|
+
{
|
|
36
|
+
size: 16,
|
|
37
|
+
role: "button",
|
|
38
|
+
"aria-label": "Open the editor",
|
|
39
|
+
onClick: (e) => {
|
|
40
|
+
e.stopPropagation();
|
|
41
|
+
onClickEdit?.(newKeyPath);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(NodeWrapper, { ...props, keyPath: newKeyPath, section: subSection })
|
|
46
|
+
},
|
|
47
|
+
JSON.stringify(subSection)
|
|
48
|
+
);
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
const EnumerationWrapper = (props) => {
|
|
52
|
+
const { keyPath, section } = props;
|
|
53
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ml-2 grid grid-cols-[auto,1fr] gap-2", children: Object.keys(section).filter((key) => !traceKeys.includes(key)).map((key) => {
|
|
54
|
+
const newKeyPathEl = {
|
|
55
|
+
type: NodeType.Enumeration,
|
|
56
|
+
key
|
|
57
|
+
};
|
|
58
|
+
const newKeyPath = [...keyPath, newKeyPathEl];
|
|
59
|
+
const subSection = section.enumeration[key];
|
|
60
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
61
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex items-center font-bold", children: key }),
|
|
62
|
+
/* @__PURE__ */ createElement(
|
|
63
|
+
NodeWrapper,
|
|
64
|
+
{
|
|
65
|
+
...props,
|
|
66
|
+
key,
|
|
67
|
+
keyPath: newKeyPath,
|
|
68
|
+
section: subSection
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
] });
|
|
72
|
+
}) });
|
|
73
|
+
};
|
|
74
|
+
const NestedObjectWrapper = (props) => {
|
|
75
|
+
const {
|
|
76
|
+
keyPath,
|
|
77
|
+
section,
|
|
78
|
+
focusedKeyPath = [],
|
|
79
|
+
onClickEdit,
|
|
80
|
+
onFocusKeyPath
|
|
81
|
+
} = props;
|
|
82
|
+
return Object.keys(section).filter((key) => !traceKeys.includes(key)).map((key) => {
|
|
83
|
+
const newKeyPathEl = { key, type: NodeType.Object };
|
|
84
|
+
const newKeyPath = [...keyPath, newKeyPathEl];
|
|
85
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
86
|
+
ItemLayout,
|
|
87
|
+
{
|
|
88
|
+
level: keyPath.length,
|
|
89
|
+
title: key,
|
|
90
|
+
description: "",
|
|
91
|
+
isSelected: isSameKeyPath(newKeyPath, focusedKeyPath),
|
|
92
|
+
onClick: (e) => {
|
|
93
|
+
e.stopPropagation();
|
|
94
|
+
onFocusKeyPath(newKeyPath);
|
|
95
|
+
},
|
|
96
|
+
rightParam: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
97
|
+
Edit,
|
|
98
|
+
{
|
|
99
|
+
size: 16,
|
|
100
|
+
role: "button",
|
|
101
|
+
"aria-label": "Open the editor",
|
|
102
|
+
onClick: (e) => {
|
|
103
|
+
e.stopPropagation();
|
|
104
|
+
onClickEdit?.(newKeyPath);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(NodeWrapper, { ...props, keyPath: newKeyPath, section: section[key] })
|
|
109
|
+
},
|
|
110
|
+
key
|
|
111
|
+
);
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
const TranslationWrapper = (props) => {
|
|
115
|
+
const { keyPath, section, locale } = props;
|
|
116
|
+
const newKeyPathEl = {
|
|
117
|
+
type: NodeType.Translation,
|
|
118
|
+
key: locale
|
|
119
|
+
};
|
|
120
|
+
const newKeyPath = [...keyPath, newKeyPathEl];
|
|
121
|
+
const subSection = section.translation[locale];
|
|
122
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(NodeWrapper, { ...props, keyPath: newKeyPath, section: subSection });
|
|
123
|
+
};
|
|
124
|
+
const traceKeys = ["filePath", "id", "nodeType"];
|
|
125
|
+
const isReactNode = (node) => typeof node?.key !== "undefined" && typeof node?.props !== "undefined";
|
|
126
|
+
const createReactElement = (element) => {
|
|
127
|
+
if (typeof element === "string") {
|
|
128
|
+
return element;
|
|
129
|
+
}
|
|
130
|
+
const convertChildrenAsArray = (element2) => {
|
|
131
|
+
if (element2?.props && typeof element2.props.children === "object") {
|
|
132
|
+
const childrenResult = [];
|
|
133
|
+
const { children } = element2.props;
|
|
134
|
+
Object.keys(children).forEach((key) => {
|
|
135
|
+
childrenResult.push(createReactElement(children[key]));
|
|
136
|
+
});
|
|
137
|
+
return {
|
|
138
|
+
...element2,
|
|
139
|
+
props: { ...element2.props, children: childrenResult }
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
return {
|
|
143
|
+
...element2,
|
|
144
|
+
props: { ...element2.props, children: element2.props.children }
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
const fixedElement = convertChildrenAsArray(element);
|
|
148
|
+
const { type, props } = fixedElement;
|
|
149
|
+
return createElement(type ?? "div", props, ...props.children);
|
|
150
|
+
};
|
|
151
|
+
const NodeWrapper = (props) => {
|
|
152
|
+
const { section } = props;
|
|
153
|
+
if (typeof section === "object") {
|
|
154
|
+
if (isReactNode(section)) {
|
|
155
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
156
|
+
createReactElement(section),
|
|
157
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-neutral dark:text-neutral-dark text-xs", children: "React node not editable" })
|
|
158
|
+
] });
|
|
159
|
+
}
|
|
160
|
+
if (section.nodeType === NodeType.Translation) {
|
|
161
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
162
|
+
TranslationWrapper,
|
|
163
|
+
{
|
|
164
|
+
...props,
|
|
165
|
+
section
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
if (section.nodeType === NodeType.Enumeration) {
|
|
170
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
171
|
+
EnumerationWrapper,
|
|
172
|
+
{
|
|
173
|
+
...props,
|
|
174
|
+
section
|
|
175
|
+
}
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
if (Array.isArray(section)) {
|
|
179
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ArrayWrapper, { ...props, section });
|
|
180
|
+
}
|
|
181
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
182
|
+
NestedObjectWrapper,
|
|
183
|
+
{
|
|
184
|
+
...props,
|
|
185
|
+
section
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
if (typeof section === "string") {
|
|
190
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(StringWrapper, { ...props, section });
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
export {
|
|
194
|
+
ArrayWrapper as A,
|
|
195
|
+
EnumerationWrapper as E,
|
|
196
|
+
NodeWrapper as N,
|
|
197
|
+
TranslationWrapper as T,
|
|
198
|
+
NestedObjectWrapper as a,
|
|
199
|
+
traceKeys as t
|
|
200
|
+
};
|
|
201
|
+
//# sourceMappingURL=index-BMzh1_UJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BMzh1_UJ.js","sources":["../src/components/DictionaryEditor/NodeWrapper/ArrayWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/TranslationWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/index.tsx"],"sourcesContent":["/* eslint-disable import/no-cycle */\nimport {\n isSameKeyPath,\n NodeType,\n type DictionaryValue,\n type KeyPath,\n} from '@intlayer/core';\nimport { Edit } from 'lucide-react';\nimport type { FC } from 'react';\nimport { ItemLayout } from '../ItemLayout';\nimport { NodeWrapper, type NodeWrapperProps } from './index';\n\ntype ArrayWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: DictionaryValue[];\n};\n\nexport const ArrayWrapper: FC<ArrayWrapperProps> = (props) => {\n const {\n keyPath,\n section,\n onFocusKeyPath,\n onClickEdit,\n focusedKeyPath = [],\n } = props;\n\n return section.map((subSection, key) => {\n const newKeyPathEl: KeyPath = {\n key,\n type: NodeType.Array,\n };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n return (\n <ItemLayout\n level={keyPath.length}\n key={JSON.stringify(subSection)}\n title={`${key}`}\n description=\"\"\n isSelected={isSameKeyPath(newKeyPath, focusedKeyPath)}\n onClick={(e) => {\n e.stopPropagation();\n onFocusKeyPath(newKeyPath);\n }}\n rightParam={\n <Edit\n size={16}\n role=\"button\"\n aria-label=\"Open the editor\"\n onClick={(e) => {\n e.stopPropagation();\n\n onClickEdit?.(newKeyPath);\n }}\n />\n }\n >\n <NodeWrapper {...props} keyPath={newKeyPath} section={subSection} />\n </ItemLayout>\n );\n });\n};\n","/* eslint-disable import/no-cycle */\nimport {\n type KeyPath,\n NodeType,\n type EnumerationContent,\n type DictionaryValue,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { NodeWrapper, traceKeys, type NodeWrapperProps } from './index';\n\ntype EnumerationWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: EnumerationContent<DictionaryValue>;\n};\n\nexport const EnumerationWrapper: FC<EnumerationWrapperProps> = (props) => {\n const { keyPath, section } = props;\n\n return (\n <div className=\"ml-2 grid grid-cols-[auto,1fr] gap-2\">\n {Object.keys(section)\n .filter((key) => !traceKeys.includes(key))\n .map((key) => {\n const newKeyPathEl: KeyPath = {\n type: NodeType.Enumeration,\n key,\n };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n const subSection =\n section.enumeration[key as keyof (typeof section)['enumeration']]!;\n\n return (\n <>\n <span className=\"flex items-center font-bold\">{key}</span>\n <NodeWrapper\n {...props}\n key={key}\n keyPath={newKeyPath}\n section={subSection}\n />\n </>\n );\n })}\n </div>\n );\n};\n","/* eslint-disable import/no-cycle */\n\nimport {\n type KeyPath,\n isSameKeyPath,\n type DictionaryValue,\n NodeType,\n} from '@intlayer/core';\nimport { Edit } from 'lucide-react';\nimport type { FC } from 'react';\nimport { ItemLayout } from '../ItemLayout';\nimport { NodeWrapper, traceKeys, type NodeWrapperProps } from './index';\n\ntype NestedObjectWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: Record<string, DictionaryValue>;\n};\n\nexport const NestedObjectWrapper: FC<NestedObjectWrapperProps> = (props) => {\n const {\n keyPath,\n section,\n focusedKeyPath = [],\n onClickEdit,\n onFocusKeyPath,\n } = props;\n\n return Object.keys(section)\n .filter((key) => !traceKeys.includes(key))\n .map((key) => {\n const newKeyPathEl: KeyPath = { key, type: NodeType.Object };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n return (\n <ItemLayout\n level={keyPath.length}\n key={key}\n title={key}\n description=\"\"\n isSelected={isSameKeyPath(newKeyPath, focusedKeyPath)}\n onClick={(e) => {\n e.stopPropagation();\n\n onFocusKeyPath(newKeyPath);\n }}\n rightParam={\n <Edit\n size={16}\n role=\"button\"\n aria-label=\"Open the editor\"\n onClick={(e) => {\n e.stopPropagation();\n\n onClickEdit?.(newKeyPath);\n }}\n />\n }\n >\n <NodeWrapper {...props} keyPath={newKeyPath} section={section[key]} />\n </ItemLayout>\n );\n });\n};\n","/* eslint-disable import/no-cycle */\n\nimport {\n type KeyPath,\n NodeType,\n type TranslationContent,\n type DictionaryValue,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { NodeWrapper, type NodeWrapperProps } from './index';\n\ntype TranslationWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: TranslationContent<DictionaryValue>;\n};\n\nexport const TranslationWrapper: FC<TranslationWrapperProps> = (props) => {\n const { keyPath, section, locale } = props;\n\n const newKeyPathEl: KeyPath = {\n type: NodeType.Translation,\n key: locale,\n };\n\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n const subSection =\n section.translation[\n locale as unknown as keyof (typeof section)['translation']\n ]!;\n\n return <NodeWrapper {...props} keyPath={newKeyPath} section={subSection} />;\n};\n","/* eslint-disable import/no-cycle */\n'use client';\n\nimport type { Locales } from '@intlayer/config/client';\nimport {\n type EnumerationContent,\n type TranslationContent,\n NodeType,\n type KeyPath,\n type DictionaryValue,\n} from '@intlayer/core';\nimport {\n createElement,\n type ReactElement,\n type ReactNode,\n type FC,\n} from 'react';\nimport { ArrayWrapper } from './ArrayWrapper';\nimport { EnumerationWrapper } from './EnumerationWrapper';\nimport { NestedObjectWrapper } from './NestedObjectWrapper';\nimport { StringWrapper } from './StringWrapper';\nimport { TranslationWrapper } from './TranslationWrapper';\n\nexport const traceKeys: string[] = ['filePath', 'id', 'nodeType'];\n\nconst isReactNode = (node: Record<string, unknown>): boolean =>\n typeof node?.key !== 'undefined' && typeof node?.props !== 'undefined';\n\nexport type NodeWrapperProps = {\n keyPath: KeyPath[];\n section: DictionaryValue;\n onContentChange: (content: { keyPath: KeyPath[]; newValue: string }) => void;\n locale: Locales;\n editedContent: DictionaryValue;\n focusedKeyPath: KeyPath[] | undefined;\n onFocusKeyPath: (keyPath: KeyPath[]) => void;\n onClickEdit?: (keyPath: KeyPath[]) => void;\n};\n\nconst createReactElement = (element: ReactElement) => {\n if (typeof element === 'string') {\n // If it's a string, simply return it (used for text content)\n return element;\n }\n\n const convertChildrenAsArray = (element: ReactElement): ReactElement => {\n if (element?.props && typeof element.props.children === 'object') {\n const childrenResult: ReactNode[] = [];\n const { children } = element.props;\n\n // Create the children elements recursively, if any\n Object.keys(children).forEach((key) => {\n childrenResult.push(createReactElement(children[key]));\n });\n\n return {\n ...element,\n props: { ...element.props, children: childrenResult },\n };\n }\n\n return {\n ...element,\n props: { ...element.props, children: element.props.children },\n };\n };\n\n const fixedElement = convertChildrenAsArray(element);\n\n const { type, props } = fixedElement;\n\n // Create and return the React element\n return createElement(type ?? 'div', props, ...props.children);\n};\n\nexport const NodeWrapper: FC<NodeWrapperProps> = (props) => {\n const { section } = props;\n\n if (typeof section === 'object') {\n if (isReactNode(section as Record<string, unknown>)) {\n return (\n <>\n {createReactElement(section as unknown as ReactElement)}\n <span className=\"text-neutral dark:text-neutral-dark text-xs\">\n React node not editable\n </span>\n </>\n );\n }\n\n if (\n (section as TranslationContent<DictionaryValue>).nodeType ===\n NodeType.Translation\n ) {\n return (\n <TranslationWrapper\n {...props}\n section={section as TranslationContent<DictionaryValue>}\n />\n );\n }\n\n if (\n (section as EnumerationContent<DictionaryValue>).nodeType ===\n NodeType.Enumeration\n ) {\n return (\n <EnumerationWrapper\n {...props}\n section={section as EnumerationContent<DictionaryValue>}\n />\n );\n }\n\n if (Array.isArray(section)) {\n return <ArrayWrapper {...props} section={section as DictionaryValue[]} />;\n }\n\n return (\n <NestedObjectWrapper\n {...props}\n section={section as Record<string, DictionaryValue>}\n />\n );\n }\n\n if (typeof section ===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