@intlayer/design-system 5.8.1 → 6.0.0-canary.0
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 +34 -106
- package/dist/better-auth.CMQ3rA-I-7umXOENE.js.map +1 -1
- package/dist/better-auth.CMQ3rA-I-C2nBKRMa.cjs.map +1 -1
- package/dist/components/Breadcrumb/breadcrumb.content.cjs +3 -1
- package/dist/components/Breadcrumb/breadcrumb.content.cjs.map +1 -1
- package/dist/components/Breadcrumb/breadcrumb.content.d.ts +3 -0
- package/dist/components/Breadcrumb/breadcrumb.content.d.ts.map +1 -1
- package/dist/components/Breadcrumb/breadcrumb.content.mjs +3 -1
- package/dist/components/Breadcrumb/breadcrumb.content.mjs.map +1 -1
- package/dist/components/Breadcrumb/index.cjs.map +1 -1
- package/dist/components/Breadcrumb/index.d.ts.map +1 -1
- package/dist/components/Breadcrumb/index.mjs.map +1 -1
- package/dist/components/CopyButton/CopyButton.content.cjs +3 -1
- package/dist/components/CopyButton/CopyButton.content.cjs.map +1 -1
- package/dist/components/CopyButton/CopyButton.content.d.ts +3 -0
- package/dist/components/CopyButton/CopyButton.content.d.ts.map +1 -1
- package/dist/components/CopyButton/CopyButton.content.mjs +3 -1
- package/dist/components/CopyButton/CopyButton.content.mjs.map +1 -1
- package/dist/components/DictionaryEditor/DictionaryEditor.cjs +7 -3
- package/dist/components/DictionaryEditor/DictionaryEditor.cjs.map +1 -1
- package/dist/components/DictionaryEditor/DictionaryEditor.d.ts.map +1 -1
- package/dist/components/DictionaryEditor/DictionaryEditor.mjs +7 -3
- package/dist/components/DictionaryEditor/DictionaryEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditor.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditor.mjs +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs +83 -34
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +83 -34
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +13 -9
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +12 -8
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.cjs +27 -13
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts +27 -0
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.mjs +27 -13
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.cjs +9 -4
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.d.ts +9 -0
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.mjs +9 -4
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +29 -25
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +27 -23
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs +37 -17
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts +64 -2
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs +37 -17
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.cjs +25 -12
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts +25 -0
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.mjs +25 -12
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs +4 -5
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +4 -5
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/JSONEditor.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/JSONEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/JSONEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/JSONEditor.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/JSONEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.cjs +25 -12
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts +25 -0
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.mjs +25 -12
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +36 -31
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +36 -31
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs +32 -28
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts +32 -5
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs +32 -28
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureEditor.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/StructureEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureEditor.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/StructureEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureView/StructureView.cjs +2 -5
- package/dist/components/DictionaryFieldEditor/StructureView/StructureView.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureView/StructureView.mjs +2 -5
- package/dist/components/DictionaryFieldEditor/StructureView/StructureView.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureView/structureView.content.cjs +9 -4
- package/dist/components/DictionaryFieldEditor/StructureView/structureView.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureView/structureView.content.d.ts +9 -0
- package/dist/components/DictionaryFieldEditor/StructureView/structureView.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureView/structureView.content.mjs +9 -4
- package/dist/components/DictionaryFieldEditor/StructureView/structureView.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs +3 -3
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs +3 -3
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs +4 -6
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.d.ts +3 -3
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs +4 -6
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.cjs +7 -3
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.d.ts +7 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.mjs +7 -3
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.cjs +9 -6
- package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.d.ts +9 -4
- package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.mjs +9 -6
- package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.cjs +28 -14
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts +29 -2
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.mjs +28 -14
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.mjs.map +1 -1
- package/dist/components/DropDown/index.cjs +2 -2
- package/dist/components/DropDown/index.cjs.map +1 -1
- package/dist/components/DropDown/index.d.ts.map +1 -1
- package/dist/components/DropDown/index.mjs +2 -2
- package/dist/components/DropDown/index.mjs.map +1 -1
- package/dist/components/EditableField/EditableFieldTextArea.cjs +2 -5
- package/dist/components/EditableField/EditableFieldTextArea.cjs.map +1 -1
- package/dist/components/EditableField/EditableFieldTextArea.mjs +2 -5
- package/dist/components/EditableField/EditableFieldTextArea.mjs.map +1 -1
- package/dist/components/ExpandCollapse/ExpandCollapse.cjs.map +1 -1
- package/dist/components/ExpandCollapse/ExpandCollapse.d.ts +2 -2
- package/dist/components/ExpandCollapse/ExpandCollapse.d.ts.map +1 -1
- package/dist/components/ExpandCollapse/ExpandCollapse.mjs.map +1 -1
- package/dist/components/ExpandCollapse/expandCollapse.content.cjs +5 -2
- package/dist/components/ExpandCollapse/expandCollapse.content.cjs.map +1 -1
- package/dist/components/ExpandCollapse/expandCollapse.content.d.ts +3 -0
- package/dist/components/ExpandCollapse/expandCollapse.content.d.ts.map +1 -1
- package/dist/components/ExpandCollapse/expandCollapse.content.mjs +5 -2
- package/dist/components/ExpandCollapse/expandCollapse.content.mjs.map +1 -1
- package/dist/components/Flags/Flag.cjs +2 -1
- package/dist/components/Flags/Flag.cjs.map +1 -1
- package/dist/components/Flags/Flag.d.ts.map +1 -1
- package/dist/components/Flags/Flag.mjs +2 -1
- package/dist/components/Flags/Flag.mjs.map +1 -1
- package/dist/components/IDE/Code.cjs +8 -8
- package/dist/components/IDE/Code.cjs.map +1 -1
- package/dist/components/IDE/Code.mjs +8 -8
- package/dist/components/IDE/Code.mjs.map +1 -1
- package/dist/components/IDE/CodeBlockClient.cjs +1 -1
- package/dist/components/IDE/CodeBlockClient.cjs.map +1 -1
- package/dist/components/IDE/CodeBlockClient.d.ts +1 -1
- package/dist/components/IDE/CodeBlockClient.d.ts.map +1 -1
- package/dist/components/IDE/CodeBlockClient.mjs +1 -1
- package/dist/components/IDE/CodeBlockClient.mjs.map +1 -1
- package/dist/components/IDE/CodeContext.cjs +1 -3
- package/dist/components/IDE/CodeContext.cjs.map +1 -1
- package/dist/components/IDE/CodeContext.mjs +1 -3
- package/dist/components/IDE/CodeContext.mjs.map +1 -1
- package/dist/components/IDE/code.content.cjs +5 -2
- package/dist/components/IDE/code.content.cjs.map +1 -1
- package/dist/components/IDE/code.content.d.ts +5 -0
- package/dist/components/IDE/code.content.d.ts.map +1 -1
- package/dist/components/IDE/code.content.mjs +5 -2
- package/dist/components/IDE/code.content.mjs.map +1 -1
- package/dist/components/IDE/copyCode.content.cjs +5 -2
- package/dist/components/IDE/copyCode.content.cjs.map +1 -1
- package/dist/components/IDE/copyCode.content.d.ts +5 -0
- package/dist/components/IDE/copyCode.content.d.ts.map +1 -1
- package/dist/components/IDE/copyCode.content.mjs +5 -2
- package/dist/components/IDE/copyCode.content.mjs.map +1 -1
- package/dist/components/Input/Checkbox.cjs.map +1 -1
- package/dist/components/Input/Checkbox.d.ts +2 -2
- package/dist/components/Input/Checkbox.d.ts.map +1 -1
- package/dist/components/Input/Checkbox.mjs.map +1 -1
- package/dist/components/Loader/index.content.cjs +6 -1
- package/dist/components/Loader/index.content.cjs.map +1 -1
- package/dist/components/Loader/index.content.d.ts +33 -2
- package/dist/components/Loader/index.content.d.ts.map +1 -1
- package/dist/components/Loader/index.content.mjs +6 -1
- package/dist/components/Loader/index.content.mjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs +1 -3
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +1 -3
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs +1 -3
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs +1 -3
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.cjs +17 -8
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.cjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts +17 -0
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.mjs +17 -8
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.mjs.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.cjs +13 -6
- package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.cjs.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.d.ts +13 -0
- package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.d.ts.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.mjs +13 -6
- package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.mjs.map +1 -1
- package/dist/components/Modal/Modal.cjs +2 -4
- package/dist/components/Modal/Modal.cjs.map +1 -1
- package/dist/components/Modal/Modal.mjs +2 -4
- package/dist/components/Modal/Modal.mjs.map +1 -1
- package/dist/components/Navbar/MobileNavbar.cjs +1 -3
- package/dist/components/Navbar/MobileNavbar.cjs.map +1 -1
- package/dist/components/Navbar/MobileNavbar.mjs +1 -3
- package/dist/components/Navbar/MobileNavbar.mjs.map +1 -1
- package/dist/components/Navbar/index.cjs +2 -4
- package/dist/components/Navbar/index.cjs.map +1 -1
- package/dist/components/Navbar/index.mjs +2 -4
- package/dist/components/Navbar/index.mjs.map +1 -1
- package/dist/components/SwitchSelector/index.cjs +1 -3
- package/dist/components/SwitchSelector/index.cjs.map +1 -1
- package/dist/components/SwitchSelector/index.mjs +1 -3
- package/dist/components/SwitchSelector/index.mjs.map +1 -1
- package/dist/components/TabSelector/TabSelector.cjs +1 -3
- package/dist/components/TabSelector/TabSelector.cjs.map +1 -1
- package/dist/components/TabSelector/TabSelector.d.ts +1 -1
- package/dist/components/TabSelector/TabSelector.d.ts.map +1 -1
- package/dist/components/TabSelector/TabSelector.mjs +1 -3
- package/dist/components/TabSelector/TabSelector.mjs.map +1 -1
- package/dist/components/Table/table.content.cjs +3 -1
- package/dist/components/Table/table.content.cjs.map +1 -1
- package/dist/components/Table/table.content.d.ts +3 -0
- package/dist/components/Table/table.content.d.ts.map +1 -1
- package/dist/components/Table/table.content.mjs +3 -1
- package/dist/components/Table/table.content.mjs.map +1 -1
- package/dist/components/Tag/index.cjs +22 -88
- package/dist/components/Tag/index.cjs.map +1 -1
- package/dist/components/Tag/index.d.ts +5 -5
- package/dist/components/Tag/index.mjs +22 -88
- package/dist/components/Tag/index.mjs.map +1 -1
- package/dist/components/TextArea/AutocompleteTextArea.cjs +20 -21
- 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 +20 -21
- package/dist/components/TextArea/AutocompleteTextArea.mjs.map +1 -1
- package/dist/hooks/auth.cjs +26 -11
- package/dist/hooks/auth.cjs.map +1 -1
- package/dist/hooks/auth.mjs +26 -11
- package/dist/hooks/auth.mjs.map +1 -1
- package/dist/hooks/index.cjs +65 -66
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.ts +1 -3
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.mjs +4 -8
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/hooks/reactQuery.cjs +648 -0
- package/dist/hooks/reactQuery.cjs.map +1 -0
- package/dist/hooks/reactQuery.d.ts +899 -0
- package/dist/hooks/reactQuery.d.ts.map +1 -0
- package/dist/hooks/reactQuery.mjs +646 -0
- package/dist/hooks/reactQuery.mjs.map +1 -0
- package/dist/hooks/useAuth/useOAuth2.cjs +13 -10
- package/dist/hooks/useAuth/useOAuth2.cjs.map +1 -1
- package/dist/hooks/useAuth/useOAuth2.d.ts +1 -1
- package/dist/hooks/useAuth/useOAuth2.d.ts.map +1 -1
- package/dist/hooks/useAuth/useOAuth2.mjs +13 -10
- package/dist/hooks/useAuth/useOAuth2.mjs.map +1 -1
- package/dist/hooks/useAuth/useSession.cjs +23 -26
- package/dist/hooks/useAuth/useSession.cjs.map +1 -1
- package/dist/hooks/useAuth/useSession.d.ts +4 -352
- package/dist/hooks/useAuth/useSession.d.ts.map +1 -1
- package/dist/hooks/useAuth/useSession.mjs +23 -26
- package/dist/hooks/useAuth/useSession.mjs.map +1 -1
- package/dist/hooks/useIntlayerAPI.cjs +2 -3
- package/dist/hooks/useIntlayerAPI.cjs.map +1 -1
- package/dist/hooks/useIntlayerAPI.mjs +2 -3
- package/dist/hooks/useIntlayerAPI.mjs.map +1 -1
- package/dist/hooks/useUser/index.cjs +6 -9
- package/dist/hooks/useUser/index.cjs.map +1 -1
- package/dist/hooks/useUser/index.d.ts +2 -18
- package/dist/hooks/useUser/index.d.ts.map +1 -1
- package/dist/hooks/useUser/index.mjs +6 -9
- package/dist/hooks/useUser/index.mjs.map +1 -1
- package/dist/index-BCuMWKyy.js.map +1 -1
- package/dist/index-BYzBot7l.cjs.map +1 -1
- package/dist/providers/ReactQueryProvider.cjs +85 -0
- package/dist/providers/ReactQueryProvider.cjs.map +1 -0
- package/dist/providers/ReactQueryProvider.d.ts +13 -0
- package/dist/providers/ReactQueryProvider.d.ts.map +1 -0
- package/dist/providers/ReactQueryProvider.mjs +85 -0
- package/dist/providers/ReactQueryProvider.mjs.map +1 -0
- package/dist/providers/index.cjs +5 -0
- package/dist/{hooks/useAsync → providers}/index.cjs.map +1 -1
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.mjs +5 -0
- package/dist/{hooks/useAsync → providers}/index.mjs.map +1 -1
- package/package.json +31 -21
- package/dist/hooks/intlayerAPIHooks.cjs +0 -542
- package/dist/hooks/intlayerAPIHooks.cjs.map +0 -1
- package/dist/hooks/intlayerAPIHooks.d.ts +0 -968
- package/dist/hooks/intlayerAPIHooks.d.ts.map +0 -1
- package/dist/hooks/intlayerAPIHooks.mjs +0 -542
- package/dist/hooks/intlayerAPIHooks.mjs.map +0 -1
- package/dist/hooks/useAsync/index.cjs +0 -8
- package/dist/hooks/useAsync/index.d.ts +0 -3
- package/dist/hooks/useAsync/index.d.ts.map +0 -1
- package/dist/hooks/useAsync/index.mjs +0 -8
- package/dist/hooks/useAsync/useAsync.cjs +0 -244
- package/dist/hooks/useAsync/useAsync.cjs.map +0 -1
- package/dist/hooks/useAsync/useAsync.d.ts +0 -73
- package/dist/hooks/useAsync/useAsync.d.ts.map +0 -1
- package/dist/hooks/useAsync/useAsync.mjs +0 -244
- package/dist/hooks/useAsync/useAsync.mjs.map +0 -1
- package/dist/hooks/useAsync/useAsyncStateStore.cjs +0 -150
- package/dist/hooks/useAsync/useAsyncStateStore.cjs.map +0 -1
- package/dist/hooks/useAsync/useAsyncStateStore.d.ts +0 -52
- package/dist/hooks/useAsync/useAsyncStateStore.d.ts.map +0 -1
- package/dist/hooks/useAsync/useAsyncStateStore.mjs +0 -150
- package/dist/hooks/useAsync/useAsyncStateStore.mjs.map +0 -1
- package/dist/hooks/useAsync/useAsyncWrapper.cjs +0 -10
- package/dist/hooks/useAsync/useAsyncWrapper.cjs.map +0 -1
- package/dist/hooks/useAsync/useAsyncWrapper.d.ts +0 -37
- package/dist/hooks/useAsync/useAsyncWrapper.d.ts.map +0 -1
- package/dist/hooks/useAsync/useAsyncWrapper.mjs +0 -10
- package/dist/hooks/useAsync/useAsyncWrapper.mjs.map +0 -1
- package/dist/hooks/useGetAllDictionaries.cjs +0 -35
- package/dist/hooks/useGetAllDictionaries.cjs.map +0 -1
- package/dist/hooks/useGetAllDictionaries.d.ts +0 -11
- package/dist/hooks/useGetAllDictionaries.d.ts.map +0 -1
- package/dist/hooks/useGetAllDictionaries.mjs +0 -35
- package/dist/hooks/useGetAllDictionaries.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StructureView.cjs","sources":["../../../../src/components/DictionaryFieldEditor/StructureView/StructureView.tsx"],"sourcesContent":["'use client';\n\nimport {\n type ContentNode,\n getDefaultNode,\n getNodeChildren,\n getNodeType,\n isSameKeyPath,\n type KeyPath,\n NodeType,\n type TypedNode,\n} from '@intlayer/core';\nimport {\n useConfiguration,\n useEditedContentActions,\n useFocusDictionary,\n useFocusDictionaryActions,\n} from '@intlayer/editor-react';\nimport { Plus, Trash } from 'lucide-react';\nimport { type FC } from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport { camelCaseToSentence } from '../../../utils/camelCase';\nimport { Button, ButtonColor, ButtonSize, ButtonVariant } from '../../Button';\nimport { Container } from '../../Container';\nimport { EditableFieldInput } from '../../EditableField';\nimport { InputVariant } from '../../Input';\nimport { NodeTypeSelector } from '../NodeTypeSelector';\n\ntype NodeTypeViewProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n onNodeTypeChange: (content?: ContentNode) => void;\n};\n\nconst NodeTypeView: FC<NodeTypeViewProps> = ({\n section,\n dictionaryKey,\n keyPath,\n onNodeTypeChange: onNodeTypeChangeProp,\n}) => {\n const locales = useConfiguration()?.internationalization.locales ?? [];\n const nodeType = getNodeType(section);\n const children = getNodeChildren(section);\n\n const onNodeTypeChange = (content?: ContentNode) => {\n const transformedContent = getDefaultNode(\n nodeType,\n locales,\n content\n ) as ContentNode;\n\n onNodeTypeChangeProp(transformedContent);\n };\n\n if (\n nodeType === NodeType.Translation ||\n nodeType === NodeType.Condition ||\n nodeType === NodeType.Enumeration\n ) {\n const firstKey = Object.keys(\n (section as unknown as TypedNode)[nodeType as keyof typeof section]\n )[0];\n const childrenKeyPath = [\n ...keyPath,\n { type: nodeType, key: firstKey },\n ] as KeyPath[];\n\n return (\n <div className=\"flex w-full flex-col gap-1\">\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(\n getDefaultNode(nodeType, locales) as ContentNode\n )\n }\n />\n\n <NodeTypeView\n section={children}\n keyPath={childrenKeyPath}\n dictionaryKey={dictionaryKey}\n onNodeTypeChange={onNodeTypeChange}\n />\n </div>\n );\n }\n\n if (nodeType === NodeType.Array) {\n const childrenKeyPath = [...keyPath, { type: nodeType, key: 0 } as KeyPath];\n return (\n <div className=\"flex w-full flex-col gap-1\">\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(\n getDefaultNode(nodeType, locales) as ContentNode\n )\n }\n />\n\n <NodeTypeView\n section={children}\n keyPath={childrenKeyPath}\n dictionaryKey={dictionaryKey}\n onNodeTypeChange={onNodeTypeChange}\n />\n </div>\n );\n }\n\n if (nodeType === NodeType.Object) {\n return (\n <>\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(\n getDefaultNode(nodeType, locales) as ContentNode\n )\n }\n />\n <div className=\"ml-10 mt-6\">\n <StructureView\n keyPath={keyPath}\n section={section}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </>\n );\n }\n\n return (\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(getDefaultNode(nodeType, locales) as ContentNode)\n }\n />\n );\n};\n\ntype NodeWrapperProps = {\n sectionKey?: string;\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n};\n\nexport const NodeView: FC<NodeWrapperProps> = ({\n sectionKey,\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const { focusedContent, setFocusedContentKeyPath } = useFocusDictionary();\n const { renameEditedContent, addEditedContent } = useEditedContentActions();\n\n const { titleInput, deleteButton } = useIntlayer('structure-view');\n\n const handleRenameNodeKey = (keyName: string) => {\n renameEditedContent(dictionaryKey, keyName, keyPath);\n const prevKeyPath: KeyPath[] = keyPath.slice(0, -1);\n const lastKeyPath: KeyPath = keyPath[keyPath.length - 1];\n const newKeyPath: KeyPath[] = [\n ...prevKeyPath,\n { ...lastKeyPath, key: keyName } as KeyPath,\n ];\n setFocusedContentKeyPath(newKeyPath);\n };\n\n return (\n <Container\n transparency=\"xl\"\n roundedSize=\"xl\"\n className=\"w-full min-w-80 gap-2 overflow-auto px-5 py-2\"\n border\n borderColor=\"text\"\n background=\"none\"\n aria-selected={isSameKeyPath(keyPath, focusedContent?.keyPath ?? [])}\n onClick={() => setFocusedContentKeyPath(keyPath)}\n >\n <div className=\"flex w-full flex-col items-start justify-between gap-3\">\n {typeof sectionKey === 'string' && (\n <div className=\"w-full\">\n <div className=\"flex w-full items-center justify-between gap-10\">\n <EditableFieldInput\n name=\"key\"\n aria-label=\"Key\"\n placeholder={titleInput.placeholder.value}\n defaultValue={sectionKey}\n onSave={(value) => handleRenameNodeKey(value)}\n variant={InputVariant.INVISIBLE}\n />\n <Button\n label={deleteButton.label.value}\n variant={ButtonVariant.HOVERABLE}\n size={ButtonSize.ICON_SM}\n color={ButtonColor.TEXT}\n className=\"translate-x-2\"\n Icon={Trash}\n onClick={() => {\n addEditedContent(dictionaryKey, undefined, keyPath);\n\n const parentKeyPath: KeyPath[] = keyPath.slice(0, -1);\n setFocusedContentKeyPath(parentKeyPath);\n }}\n />\n </div>\n\n <span className=\"text-neutral ml-3 text-sm\">\n ( {camelCaseToSentence(sectionKey)} )\n </span>\n </div>\n )}\n <NodeTypeView\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n section={section}\n onNodeTypeChange={(content) => {\n addEditedContent(dictionaryKey, content, keyPath);\n }}\n />\n </div>\n </Container>\n );\n};\n\ntype ObjectViewProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n};\n\nexport const ObjectView: FC<ObjectViewProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const { addNodeButton } = useIntlayer('structure-view');\n const { setFocusedContentKeyPath } = useFocusDictionaryActions();\n const { addEditedContent } = useEditedContentActions();\n\n if (!section || typeof section !== 'object') {\n return <div>Not an object</div>;\n }\n\n return (\n <div className=\"flex flex-col gap-2 overflow-y-auto\">\n <ul className=\"mr-auto flex flex-col gap-4\">\n {Object.keys(section).map((key) => (\n <li key={key} className=\"flex w-full\">\n <NodeView\n sectionKey={key}\n section={section?.[key as keyof typeof section]}\n keyPath={[...keyPath, { type: NodeType.Object, key }]}\n dictionaryKey={dictionaryKey}\n />\n </li>\n ))}\n </ul>\n <Button\n label={addNodeButton.label.value}\n variant={ButtonVariant.HOVERABLE}\n size={ButtonSize.MD}\n color={ButtonColor.TEXT}\n Icon={Plus}\n className=\"flex-1\"\n onClick={() => {\n const newKey = 'newKey';\n const newKeyPath = [\n ...keyPath,\n { type: NodeType.Object, key: newKey },\n ] as KeyPath[];\n addEditedContent(dictionaryKey, '', newKeyPath);\n setFocusedContentKeyPath(newKeyPath);\n }}\n >\n {addNodeButton.text}\n </Button>\n </div>\n );\n};\n\ntype StructureViewProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n};\n\nexport const StructureView: FC<StructureViewProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n if (\n !section ||\n typeof section !== 'object' ||\n typeof section.nodeType === 'string'\n ) {\n return (\n <NodeView\n sectionKey={'content'}\n section={section}\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n />\n );\n }\n\n return (\n <ObjectView\n section={section}\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n />\n );\n};\n"],"names":["useConfiguration","getNodeType","getNodeChildren","getDefaultNode","NodeType","jsxs","jsx","NodeTypeSelector","nodeType","Fragment","useFocusDictionary","useEditedContentActions","useIntlayer","Container","isSameKeyPath","EditableFieldInput","InputVariant","Button","ButtonVariant","ButtonSize","ButtonColor","Trash","camelCaseToSentence","useFocusDictionaryActions","Plus"],"mappings":";;;;;;;;;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A;AAAAA,MAAA;AAAA,QACC,OAAO,cAAc,MAAM;AAAA,QAC3B,SAASC,yBAAAA,cAAc;AAAA,QACvB,MAAMC,yBAAAA,WAAW;AAAA,QACjB,OAAOC,yBAAAA,YAAY;AAAA,QACnB,MAAMI,YAAAA;AAAAA,QACN,WAAU;AAAA,QACV,SAAS,MAAM;AACb,gBAAM,SAAS;AACf,gBAAM,aAAa;AAAA,YACjB,GAAG;AAAA,YACH,EAAE,MAAMpB,KAAAA,SAAS,QAAQ,KAAK,OAAA;AAAA,UAAO;AAEvC,2BAAiB,eAAe,IAAI,UAAU;AAC9C,mCAAyB,UAAU;AAAA,QACrC;AAAA,QAEC,UAAA,cAAc;AAAA,MAAA;AAAA,IAAA;AAAA,EACjB,GACF;AAEJ;AAQO,MAAM,gBAAwC,CAAC;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,MACE,CAAC,WACD,OAAO,YAAY,YACnB,OAAO,QAAQ,aAAa,UAC5B;AACA,WACEE,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC,YAAY;AAAA,QACZ;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AAEA,SACEA,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EAAA;AAGN;;;;"}
|
|
1
|
+
{"version":3,"file":"StructureView.cjs","sources":["../../../../src/components/DictionaryFieldEditor/StructureView/StructureView.tsx"],"sourcesContent":["'use client';\n\nimport {\n type ContentNode,\n getDefaultNode,\n getNodeChildren,\n getNodeType,\n isSameKeyPath,\n type KeyPath,\n NodeType,\n type TypedNode,\n} from '@intlayer/core';\nimport {\n useConfiguration,\n useEditedContentActions,\n useFocusDictionary,\n useFocusDictionaryActions,\n} from '@intlayer/editor-react';\nimport { Plus, Trash } from 'lucide-react';\nimport { type FC } from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport { camelCaseToSentence } from '../../../utils/camelCase';\nimport { Button, ButtonColor, ButtonSize, ButtonVariant } from '../../Button';\nimport { Container } from '../../Container';\nimport { EditableFieldInput } from '../../EditableField';\nimport { InputVariant } from '../../Input';\nimport { NodeTypeSelector } from '../NodeTypeSelector';\n\ntype NodeTypeViewProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n onNodeTypeChange: (content?: ContentNode) => void;\n};\n\nconst NodeTypeView: FC<NodeTypeViewProps> = ({\n section,\n dictionaryKey,\n keyPath,\n onNodeTypeChange: onNodeTypeChangeProp,\n}) => {\n const locales = useConfiguration()?.internationalization.locales ?? [];\n const nodeType = getNodeType(section);\n const children = getNodeChildren(section);\n\n const onNodeTypeChange = (content?: ContentNode) => {\n const transformedContent = getDefaultNode(\n nodeType,\n locales,\n content\n ) as ContentNode;\n\n onNodeTypeChangeProp(transformedContent);\n };\n\n if (\n nodeType === NodeType.Translation ||\n nodeType === NodeType.Condition ||\n nodeType === NodeType.Enumeration\n ) {\n const firstKey = Object.keys(\n (section as unknown as TypedNode)[nodeType as keyof typeof section]\n )[0];\n const childrenKeyPath = [\n ...keyPath,\n { type: nodeType, key: firstKey },\n ] as KeyPath[];\n\n return (\n <div className=\"flex w-full flex-col gap-1\">\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(\n getDefaultNode(nodeType, locales) as ContentNode\n )\n }\n />\n\n <NodeTypeView\n section={children}\n keyPath={childrenKeyPath}\n dictionaryKey={dictionaryKey}\n onNodeTypeChange={onNodeTypeChange}\n />\n </div>\n );\n }\n\n if (nodeType === NodeType.Array) {\n const childrenKeyPath = [...keyPath, { type: nodeType, key: 0 } as KeyPath];\n return (\n <div className=\"flex w-full flex-col gap-1\">\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(\n getDefaultNode(nodeType, locales) as ContentNode\n )\n }\n />\n\n <NodeTypeView\n section={children}\n keyPath={childrenKeyPath}\n dictionaryKey={dictionaryKey}\n onNodeTypeChange={onNodeTypeChange}\n />\n </div>\n );\n }\n\n if (nodeType === NodeType.Object) {\n return (\n <>\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(\n getDefaultNode(nodeType, locales) as ContentNode\n )\n }\n />\n <div className=\"ml-10 mt-6\">\n <StructureView\n keyPath={keyPath}\n section={section}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </>\n );\n }\n\n return (\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(getDefaultNode(nodeType, locales) as ContentNode)\n }\n />\n );\n};\n\ntype NodeWrapperProps = {\n sectionKey?: string;\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n};\n\nexport const NodeView: FC<NodeWrapperProps> = ({\n sectionKey,\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const { focusedContent, setFocusedContentKeyPath } = useFocusDictionary();\n const { renameEditedContent, addEditedContent } = useEditedContentActions();\n\n const { titleInput, deleteButton } = useIntlayer('structure-view');\n\n const handleRenameNodeKey = (keyName: string) => {\n renameEditedContent(dictionaryKey, keyName, keyPath);\n const prevKeyPath: KeyPath[] = keyPath.slice(0, -1);\n const lastKeyPath: KeyPath = keyPath[keyPath.length - 1];\n const newKeyPath: KeyPath[] = [\n ...prevKeyPath,\n { ...lastKeyPath, key: keyName } as KeyPath,\n ];\n setFocusedContentKeyPath(newKeyPath);\n };\n\n return (\n <Container\n transparency=\"xl\"\n roundedSize=\"xl\"\n className=\"w-full min-w-80 gap-2 overflow-auto px-5 py-2\"\n border\n borderColor=\"text\"\n background=\"none\"\n aria-selected={isSameKeyPath(keyPath, focusedContent?.keyPath ?? [])}\n onClick={() => setFocusedContentKeyPath(keyPath)}\n >\n <div className=\"flex w-full flex-col items-start justify-between gap-3\">\n {typeof sectionKey === 'string' && (\n <div className=\"w-full\">\n <div className=\"flex w-full items-center justify-between gap-10\">\n <EditableFieldInput\n name=\"key\"\n aria-label=\"Key\"\n placeholder={titleInput.placeholder.value}\n defaultValue={sectionKey}\n onSave={(value) => handleRenameNodeKey(value)}\n variant={InputVariant.INVISIBLE}\n />\n <Button\n label={deleteButton.label.value}\n variant={ButtonVariant.HOVERABLE}\n size={ButtonSize.ICON_SM}\n color={ButtonColor.TEXT}\n className=\"translate-x-2\"\n Icon={Trash}\n onClick={() => {\n addEditedContent(dictionaryKey, undefined, keyPath);\n\n const parentKeyPath: KeyPath[] = keyPath.slice(0, -1);\n setFocusedContentKeyPath(parentKeyPath);\n }}\n />\n </div>\n\n <span className=\"text-neutral ml-3 text-sm\">\n ( {camelCaseToSentence(sectionKey)} )\n </span>\n </div>\n )}\n <NodeTypeView\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n section={section}\n onNodeTypeChange={(content) => {\n addEditedContent(dictionaryKey, content, keyPath);\n }}\n />\n </div>\n </Container>\n );\n};\n\ntype ObjectViewProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n};\n\nexport const ObjectView: FC<ObjectViewProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const { addNodeButton } = useIntlayer('structure-view');\n const { setFocusedContentKeyPath } = useFocusDictionaryActions();\n const { addEditedContent } = useEditedContentActions();\n\n if (!section || typeof section !== 'object') {\n return <div>Not an object</div>;\n }\n\n return (\n <div className=\"flex flex-col gap-2 overflow-y-auto\">\n <ul className=\"mr-auto flex flex-col gap-4\">\n {Object.keys(section).map((key) => (\n <li key={key} className=\"flex w-full\">\n <NodeView\n sectionKey={key}\n section={section?.[key as keyof typeof section]}\n keyPath={[...keyPath, { type: NodeType.Object, key }]}\n dictionaryKey={dictionaryKey}\n />\n </li>\n ))}\n </ul>\n <Button\n label={addNodeButton.label.value}\n variant={ButtonVariant.HOVERABLE}\n size={ButtonSize.MD}\n color={ButtonColor.TEXT}\n Icon={Plus}\n className=\"flex-1\"\n onClick={() => {\n const newKey = 'newKey';\n const newKeyPath = [\n ...keyPath,\n { type: NodeType.Object, key: newKey },\n ] as KeyPath[];\n addEditedContent(dictionaryKey, '', newKeyPath);\n setFocusedContentKeyPath(newKeyPath);\n }}\n >\n {addNodeButton.text}\n </Button>\n </div>\n );\n};\n\ntype StructureViewProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n};\n\nexport const StructureView: FC<StructureViewProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n if (\n !section ||\n typeof section !== 'object' ||\n typeof section.nodeType === 'string'\n ) {\n return (\n <NodeView\n sectionKey={'content'}\n section={section}\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n />\n );\n }\n\n return (\n <ObjectView\n section={section}\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n />\n );\n};\n"],"names":["useConfiguration","getNodeType","getNodeChildren","getDefaultNode","NodeType","jsxs","jsx","NodeTypeSelector","nodeType","Fragment","useFocusDictionary","useEditedContentActions","useIntlayer","Container","isSameKeyPath","EditableFieldInput","InputVariant","Button","ButtonVariant","ButtonSize","ButtonColor","Trash","camelCaseToSentence","useFocusDictionaryActions","Plus"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAmCA,MAAM,eAAsC,CAAC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA,kBAAkB;AACpB,MAAM;AACJ,QAAM,UAAUA,YAAAA,iBAAA,GAAoB,qBAAqB,WAAW,CAAA;AACpE,QAAM,WAAWC,KAAAA,YAAY,OAAO;AACpC,QAAM,WAAWC,KAAAA,gBAAgB,OAAO;AAExC,QAAM,mBAAmB,CAAC,YAA0B;AAClD,UAAM,qBAAqBC,KAAAA;AAAAA,MACzB;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAGF,yBAAqB,kBAAkB;AAAA,EACzC;AAEA,MACE,aAAaC,cAAS,eACtB,aAAaA,KAAAA,SAAS,aACtB,aAAaA,KAAAA,SAAS,aACtB;AACA,UAAM,WAAW,OAAO;AAAA,MACrB,QAAiC,QAA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AAAA,EACA;AACF,MAAM;AACJ,MACE,CAAC,WACD,OAAO,YAAY,YACnB,OAAO,QAAQ,aAAa,UAC5B;AACA,WACEE,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC,YAAY;AAAA,QACZ;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AAEA,SACEA,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EAAA;AAGN;;;;"}
|
|
@@ -13,13 +13,10 @@ import "clsx";
|
|
|
13
13
|
import "tailwind-merge";
|
|
14
14
|
import { InputVariant } from "../../Input/Input.mjs";
|
|
15
15
|
import "../../Input/Checkbox.mjs";
|
|
16
|
+
import "@tanstack/react-query";
|
|
17
|
+
import "@intlayer/api";
|
|
16
18
|
import "@intlayer/config/built";
|
|
17
19
|
import "../../../better-auth.CMQ3rA-I-7umXOENE.js";
|
|
18
|
-
import "../../Toaster/Toast.mjs";
|
|
19
|
-
import "../../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
20
|
-
import "@intlayer/api";
|
|
21
|
-
import "deepmerge";
|
|
22
|
-
import "../../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
|
|
23
20
|
import { NodeTypeSelector } from "../NodeTypeSelector.mjs";
|
|
24
21
|
const NodeTypeView = ({
|
|
25
22
|
section,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StructureView.mjs","sources":["../../../../src/components/DictionaryFieldEditor/StructureView/StructureView.tsx"],"sourcesContent":["'use client';\n\nimport {\n type ContentNode,\n getDefaultNode,\n getNodeChildren,\n getNodeType,\n isSameKeyPath,\n type KeyPath,\n NodeType,\n type TypedNode,\n} from '@intlayer/core';\nimport {\n useConfiguration,\n useEditedContentActions,\n useFocusDictionary,\n useFocusDictionaryActions,\n} from '@intlayer/editor-react';\nimport { Plus, Trash } from 'lucide-react';\nimport { type FC } from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport { camelCaseToSentence } from '../../../utils/camelCase';\nimport { Button, ButtonColor, ButtonSize, ButtonVariant } from '../../Button';\nimport { Container } from '../../Container';\nimport { EditableFieldInput } from '../../EditableField';\nimport { InputVariant } from '../../Input';\nimport { NodeTypeSelector } from '../NodeTypeSelector';\n\ntype NodeTypeViewProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n onNodeTypeChange: (content?: ContentNode) => void;\n};\n\nconst NodeTypeView: FC<NodeTypeViewProps> = ({\n section,\n dictionaryKey,\n keyPath,\n onNodeTypeChange: onNodeTypeChangeProp,\n}) => {\n const locales = useConfiguration()?.internationalization.locales ?? [];\n const nodeType = getNodeType(section);\n const children = getNodeChildren(section);\n\n const onNodeTypeChange = (content?: ContentNode) => {\n const transformedContent = getDefaultNode(\n nodeType,\n locales,\n content\n ) as ContentNode;\n\n onNodeTypeChangeProp(transformedContent);\n };\n\n if (\n nodeType === NodeType.Translation ||\n nodeType === NodeType.Condition ||\n nodeType === NodeType.Enumeration\n ) {\n const firstKey = Object.keys(\n (section as unknown as TypedNode)[nodeType as keyof typeof section]\n )[0];\n const childrenKeyPath = [\n ...keyPath,\n { type: nodeType, key: firstKey },\n ] as KeyPath[];\n\n return (\n <div className=\"flex w-full flex-col gap-1\">\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(\n getDefaultNode(nodeType, locales) as ContentNode\n )\n }\n />\n\n <NodeTypeView\n section={children}\n keyPath={childrenKeyPath}\n dictionaryKey={dictionaryKey}\n onNodeTypeChange={onNodeTypeChange}\n />\n </div>\n );\n }\n\n if (nodeType === NodeType.Array) {\n const childrenKeyPath = [...keyPath, { type: nodeType, key: 0 } as KeyPath];\n return (\n <div className=\"flex w-full flex-col gap-1\">\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(\n getDefaultNode(nodeType, locales) as ContentNode\n )\n }\n />\n\n <NodeTypeView\n section={children}\n keyPath={childrenKeyPath}\n dictionaryKey={dictionaryKey}\n onNodeTypeChange={onNodeTypeChange}\n />\n </div>\n );\n }\n\n if (nodeType === NodeType.Object) {\n return (\n <>\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(\n getDefaultNode(nodeType, locales) as ContentNode\n )\n }\n />\n <div className=\"ml-10 mt-6\">\n <StructureView\n keyPath={keyPath}\n section={section}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </>\n );\n }\n\n return (\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(getDefaultNode(nodeType, locales) as ContentNode)\n }\n />\n );\n};\n\ntype NodeWrapperProps = {\n sectionKey?: string;\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n};\n\nexport const NodeView: FC<NodeWrapperProps> = ({\n sectionKey,\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const { focusedContent, setFocusedContentKeyPath } = useFocusDictionary();\n const { renameEditedContent, addEditedContent } = useEditedContentActions();\n\n const { titleInput, deleteButton } = useIntlayer('structure-view');\n\n const handleRenameNodeKey = (keyName: string) => {\n renameEditedContent(dictionaryKey, keyName, keyPath);\n const prevKeyPath: KeyPath[] = keyPath.slice(0, -1);\n const lastKeyPath: KeyPath = keyPath[keyPath.length - 1];\n const newKeyPath: KeyPath[] = [\n ...prevKeyPath,\n { ...lastKeyPath, key: keyName } as KeyPath,\n ];\n setFocusedContentKeyPath(newKeyPath);\n };\n\n return (\n <Container\n transparency=\"xl\"\n roundedSize=\"xl\"\n className=\"w-full min-w-80 gap-2 overflow-auto px-5 py-2\"\n border\n borderColor=\"text\"\n background=\"none\"\n aria-selected={isSameKeyPath(keyPath, focusedContent?.keyPath ?? [])}\n onClick={() => setFocusedContentKeyPath(keyPath)}\n >\n <div className=\"flex w-full flex-col items-start justify-between gap-3\">\n {typeof sectionKey === 'string' && (\n <div className=\"w-full\">\n <div className=\"flex w-full items-center justify-between gap-10\">\n <EditableFieldInput\n name=\"key\"\n aria-label=\"Key\"\n placeholder={titleInput.placeholder.value}\n defaultValue={sectionKey}\n onSave={(value) => handleRenameNodeKey(value)}\n variant={InputVariant.INVISIBLE}\n />\n <Button\n label={deleteButton.label.value}\n variant={ButtonVariant.HOVERABLE}\n size={ButtonSize.ICON_SM}\n color={ButtonColor.TEXT}\n className=\"translate-x-2\"\n Icon={Trash}\n onClick={() => {\n addEditedContent(dictionaryKey, undefined, keyPath);\n\n const parentKeyPath: KeyPath[] = keyPath.slice(0, -1);\n setFocusedContentKeyPath(parentKeyPath);\n }}\n />\n </div>\n\n <span className=\"text-neutral ml-3 text-sm\">\n ( {camelCaseToSentence(sectionKey)} )\n </span>\n </div>\n )}\n <NodeTypeView\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n section={section}\n onNodeTypeChange={(content) => {\n addEditedContent(dictionaryKey, content, keyPath);\n }}\n />\n </div>\n </Container>\n );\n};\n\ntype ObjectViewProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n};\n\nexport const ObjectView: FC<ObjectViewProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const { addNodeButton } = useIntlayer('structure-view');\n const { setFocusedContentKeyPath } = useFocusDictionaryActions();\n const { addEditedContent } = useEditedContentActions();\n\n if (!section || typeof section !== 'object') {\n return <div>Not an object</div>;\n }\n\n return (\n <div className=\"flex flex-col gap-2 overflow-y-auto\">\n <ul className=\"mr-auto flex flex-col gap-4\">\n {Object.keys(section).map((key) => (\n <li key={key} className=\"flex w-full\">\n <NodeView\n sectionKey={key}\n section={section?.[key as keyof typeof section]}\n keyPath={[...keyPath, { type: NodeType.Object, key }]}\n dictionaryKey={dictionaryKey}\n />\n </li>\n ))}\n </ul>\n <Button\n label={addNodeButton.label.value}\n variant={ButtonVariant.HOVERABLE}\n size={ButtonSize.MD}\n color={ButtonColor.TEXT}\n Icon={Plus}\n className=\"flex-1\"\n onClick={() => {\n const newKey = 'newKey';\n const newKeyPath = [\n ...keyPath,\n { type: NodeType.Object, key: newKey },\n ] as KeyPath[];\n addEditedContent(dictionaryKey, '', newKeyPath);\n setFocusedContentKeyPath(newKeyPath);\n }}\n >\n {addNodeButton.text}\n </Button>\n </div>\n );\n};\n\ntype StructureViewProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n};\n\nexport const StructureView: FC<StructureViewProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n if (\n !section ||\n typeof section !== 'object' ||\n typeof section.nodeType === 'string'\n ) {\n return (\n <NodeView\n sectionKey={'content'}\n section={section}\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n />\n );\n }\n\n return (\n <ObjectView\n section={section}\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n />\n );\n};\n"],"names":["nodeType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAmCA,MAAM,eAAsC,CAAC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA,kBAAkB;AACpB,MAAM;AACJ,QAAM,UAAU,iBAAA,GAAoB,qBAAqB,WAAW,CAAA;AACpE,QAAM,WAAW,YAAY,OAAO;AACpC,QAAM,WAAW,gBAAgB,OAAO;AAExC,QAAM,mBAAmB,CAAC,YAA0B;AAClD,UAAM,qBAAqB;AAAA,MACzB;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAGF,yBAAqB,kBAAkB;AAAA,EACzC;AAEA,MACE,aAAa,SAAS,eACtB,aAAa,SAAS,aACtB,aAAa,SAAS,aACtB;AACA,UAAM,WAAW,OAAO;AAAA,MACrB,QAAiC,QAAgC;AAAA,IAAA,EAClE,CAAC;AACH,UAAM,kBAAkB;AAAA,MACtB,GAAG;AAAA,MACH,EAAE,MAAM,UAAU,KAAK,SAAA;AAAA,IAAS;AAGlC,WACE,qBAAC,OAAA,EAAI,WAAU,8BACb,UAAA;AAAA,MAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC;AAAA,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GAOT,CACD,GACH;AAAA,IACA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,OAAO,cAAc,MAAM;AAAA,QAC3B,SAAS,cAAc;AAAA,QACvB,MAAM,WAAW;AAAA,QACjB,OAAO,YAAY;AAAA,QACnB,MAAM;AAAA,QACN,WAAU;AAAA,QACV,SAAS,MAAM;AACb,gBAAM,SAAS;AACf,gBAAM,aAAa;AAAA,YACjB,GAAG;AAAA,YACH,EAAE,MAAM,SAAS,QAAQ,KAAK,OAAA;AAAA,UAAO;AAEvC,2BAAiB,eAAe,IAAI,UAAU;AAC9C,mCAAyB,UAAU;AAAA,QACrC;AAAA,QAEC,UAAA,cAAc;AAAA,MAAA;AAAA,IAAA;AAAA,EACjB,GACF;AAEJ;AAQO,MAAM,gBAAwC,CAAC;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,MACE,CAAC,WACD,OAAO,YAAY,YACnB,OAAO,QAAQ,aAAa,UAC5B;AACA,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,YAAY;AAAA,QACZ;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AAEA,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
1
|
+
{"version":3,"file":"StructureView.mjs","sources":["../../../../src/components/DictionaryFieldEditor/StructureView/StructureView.tsx"],"sourcesContent":["'use client';\n\nimport {\n type ContentNode,\n getDefaultNode,\n getNodeChildren,\n getNodeType,\n isSameKeyPath,\n type KeyPath,\n NodeType,\n type TypedNode,\n} from '@intlayer/core';\nimport {\n useConfiguration,\n useEditedContentActions,\n useFocusDictionary,\n useFocusDictionaryActions,\n} from '@intlayer/editor-react';\nimport { Plus, Trash } from 'lucide-react';\nimport { type FC } from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport { camelCaseToSentence } from '../../../utils/camelCase';\nimport { Button, ButtonColor, ButtonSize, ButtonVariant } from '../../Button';\nimport { Container } from '../../Container';\nimport { EditableFieldInput } from '../../EditableField';\nimport { InputVariant } from '../../Input';\nimport { NodeTypeSelector } from '../NodeTypeSelector';\n\ntype NodeTypeViewProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n onNodeTypeChange: (content?: ContentNode) => void;\n};\n\nconst NodeTypeView: FC<NodeTypeViewProps> = ({\n section,\n dictionaryKey,\n keyPath,\n onNodeTypeChange: onNodeTypeChangeProp,\n}) => {\n const locales = useConfiguration()?.internationalization.locales ?? [];\n const nodeType = getNodeType(section);\n const children = getNodeChildren(section);\n\n const onNodeTypeChange = (content?: ContentNode) => {\n const transformedContent = getDefaultNode(\n nodeType,\n locales,\n content\n ) as ContentNode;\n\n onNodeTypeChangeProp(transformedContent);\n };\n\n if (\n nodeType === NodeType.Translation ||\n nodeType === NodeType.Condition ||\n nodeType === NodeType.Enumeration\n ) {\n const firstKey = Object.keys(\n (section as unknown as TypedNode)[nodeType as keyof typeof section]\n )[0];\n const childrenKeyPath = [\n ...keyPath,\n { type: nodeType, key: firstKey },\n ] as KeyPath[];\n\n return (\n <div className=\"flex w-full flex-col gap-1\">\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(\n getDefaultNode(nodeType, locales) as ContentNode\n )\n }\n />\n\n <NodeTypeView\n section={children}\n keyPath={childrenKeyPath}\n dictionaryKey={dictionaryKey}\n onNodeTypeChange={onNodeTypeChange}\n />\n </div>\n );\n }\n\n if (nodeType === NodeType.Array) {\n const childrenKeyPath = [...keyPath, { type: nodeType, key: 0 } as KeyPath];\n return (\n <div className=\"flex w-full flex-col gap-1\">\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(\n getDefaultNode(nodeType, locales) as ContentNode\n )\n }\n />\n\n <NodeTypeView\n section={children}\n keyPath={childrenKeyPath}\n dictionaryKey={dictionaryKey}\n onNodeTypeChange={onNodeTypeChange}\n />\n </div>\n );\n }\n\n if (nodeType === NodeType.Object) {\n return (\n <>\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(\n getDefaultNode(nodeType, locales) as ContentNode\n )\n }\n />\n <div className=\"ml-10 mt-6\">\n <StructureView\n keyPath={keyPath}\n section={section}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </>\n );\n }\n\n return (\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(getDefaultNode(nodeType, locales) as ContentNode)\n }\n />\n );\n};\n\ntype NodeWrapperProps = {\n sectionKey?: string;\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n};\n\nexport const NodeView: FC<NodeWrapperProps> = ({\n sectionKey,\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const { focusedContent, setFocusedContentKeyPath } = useFocusDictionary();\n const { renameEditedContent, addEditedContent } = useEditedContentActions();\n\n const { titleInput, deleteButton } = useIntlayer('structure-view');\n\n const handleRenameNodeKey = (keyName: string) => {\n renameEditedContent(dictionaryKey, keyName, keyPath);\n const prevKeyPath: KeyPath[] = keyPath.slice(0, -1);\n const lastKeyPath: KeyPath = keyPath[keyPath.length - 1];\n const newKeyPath: KeyPath[] = [\n ...prevKeyPath,\n { ...lastKeyPath, key: keyName } as KeyPath,\n ];\n setFocusedContentKeyPath(newKeyPath);\n };\n\n return (\n <Container\n transparency=\"xl\"\n roundedSize=\"xl\"\n className=\"w-full min-w-80 gap-2 overflow-auto px-5 py-2\"\n border\n borderColor=\"text\"\n background=\"none\"\n aria-selected={isSameKeyPath(keyPath, focusedContent?.keyPath ?? [])}\n onClick={() => setFocusedContentKeyPath(keyPath)}\n >\n <div className=\"flex w-full flex-col items-start justify-between gap-3\">\n {typeof sectionKey === 'string' && (\n <div className=\"w-full\">\n <div className=\"flex w-full items-center justify-between gap-10\">\n <EditableFieldInput\n name=\"key\"\n aria-label=\"Key\"\n placeholder={titleInput.placeholder.value}\n defaultValue={sectionKey}\n onSave={(value) => handleRenameNodeKey(value)}\n variant={InputVariant.INVISIBLE}\n />\n <Button\n label={deleteButton.label.value}\n variant={ButtonVariant.HOVERABLE}\n size={ButtonSize.ICON_SM}\n color={ButtonColor.TEXT}\n className=\"translate-x-2\"\n Icon={Trash}\n onClick={() => {\n addEditedContent(dictionaryKey, undefined, keyPath);\n\n const parentKeyPath: KeyPath[] = keyPath.slice(0, -1);\n setFocusedContentKeyPath(parentKeyPath);\n }}\n />\n </div>\n\n <span className=\"text-neutral ml-3 text-sm\">\n ( {camelCaseToSentence(sectionKey)} )\n </span>\n </div>\n )}\n <NodeTypeView\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n section={section}\n onNodeTypeChange={(content) => {\n addEditedContent(dictionaryKey, content, keyPath);\n }}\n />\n </div>\n </Container>\n );\n};\n\ntype ObjectViewProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n};\n\nexport const ObjectView: FC<ObjectViewProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const { addNodeButton } = useIntlayer('structure-view');\n const { setFocusedContentKeyPath } = useFocusDictionaryActions();\n const { addEditedContent } = useEditedContentActions();\n\n if (!section || typeof section !== 'object') {\n return <div>Not an object</div>;\n }\n\n return (\n <div className=\"flex flex-col gap-2 overflow-y-auto\">\n <ul className=\"mr-auto flex flex-col gap-4\">\n {Object.keys(section).map((key) => (\n <li key={key} className=\"flex w-full\">\n <NodeView\n sectionKey={key}\n section={section?.[key as keyof typeof section]}\n keyPath={[...keyPath, { type: NodeType.Object, key }]}\n dictionaryKey={dictionaryKey}\n />\n </li>\n ))}\n </ul>\n <Button\n label={addNodeButton.label.value}\n variant={ButtonVariant.HOVERABLE}\n size={ButtonSize.MD}\n color={ButtonColor.TEXT}\n Icon={Plus}\n className=\"flex-1\"\n onClick={() => {\n const newKey = 'newKey';\n const newKeyPath = [\n ...keyPath,\n { type: NodeType.Object, key: newKey },\n ] as KeyPath[];\n addEditedContent(dictionaryKey, '', newKeyPath);\n setFocusedContentKeyPath(newKeyPath);\n }}\n >\n {addNodeButton.text}\n </Button>\n </div>\n );\n};\n\ntype StructureViewProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n};\n\nexport const StructureView: FC<StructureViewProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n if (\n !section ||\n typeof section !== 'object' ||\n typeof section.nodeType === 'string'\n ) {\n return (\n <NodeView\n sectionKey={'content'}\n section={section}\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n />\n );\n }\n\n return (\n <ObjectView\n section={section}\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n />\n );\n};\n"],"names":["nodeType"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmCA,MAAM,eAAsC,CAAC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA,kBAAkB;AACpB,MAAM;AACJ,QAAM,UAAU,iBAAA,GAAoB,qBAAqB,WAAW,CAAA;AACpE,QAAM,WAAW,YAAY,OAAO;AACpC,QAAM,WAAW,gBAAgB,OAAO;AAExC,QAAM,mBAAmB,CAAC,YAA0B;AAClD,UAAM,qBAAqB;AAAA,MACzB;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAGF,yBAAqB,kBAAkB;AAAA,EACzC;AAEA,MACE,aAAa,SAAS,eACtB,aAAa,SAAS,aACtB,aAAa,SAAS,aACtB;AACA,UAAM,WAAW,OAAO;AAAA,MACrB,QAAiC,QAAgC;AAAA,IAAA,EAClE,CAAC;AACH,UAAM,kBAAkB;AAAA,MACtB,GAAG;AAAA,MACH,EAAE,MAAM,UAAU,KAAK,SAAA;AAAA,IAAS;AAGlC,WACE,qBAAC,OAAA,EAAI,WAAU,8BACb,UAAA;AAAA,MAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC;AAAA,UACA,eAAe,CAACA,cACd;AAAA,YACE,eAAeA,WAAU,OAAO;AAAA,UAAA;AAAA,Q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c,MAAM;AAAA,QAC3B,SAAS,cAAc;AAAA,QACvB,MAAM,WAAW;AAAA,QACjB,OAAO,YAAY;AAAA,QACnB,MAAM;AAAA,QACN,WAAU;AAAA,QACV,SAAS,MAAM;AACb,gBAAM,SAAS;AACf,gBAAM,aAAa;AAAA,YACjB,GAAG;AAAA,YACH,EAAE,MAAM,SAAS,QAAQ,KAAK,OAAA;AAAA,UAAO;AAEvC,2BAAiB,eAAe,IAAI,UAAU;AAC9C,mCAAyB,UAAU;AAAA,QACrC;AAAA,QAEC,UAAA,cAAc;AAAA,MAAA;AAAA,IAAA;AAAA,EACjB,GACF;AAEJ;AAQO,MAAM,gBAAwC,CAAC;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,MACE,CAAC,WACD,OAAO,YAAY,YACnB,OAAO,QAAQ,aAAa,UAC5B;AACA,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,YAAY;AAAA,QACZ;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AAEA,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
3
3
|
const intlayer = require("intlayer");
|
|
4
4
|
const structureViewContent = {
|
|
5
5
|
key: "structure-view",
|
|
6
|
+
autoFill: "./{{key}}.content.json",
|
|
6
7
|
content: {
|
|
7
8
|
titleInput: {
|
|
8
9
|
placeholder: intlayer.t({
|
|
@@ -18,7 +19,8 @@ const structureViewContent = {
|
|
|
18
19
|
pt: "Insira a chave do seu nó",
|
|
19
20
|
hi: "अपनी नोड की कुंजी दर्ज करें",
|
|
20
21
|
ar: "أدخل مفتاح العقدة الخاص بك",
|
|
21
|
-
ru: "Введите ключ вашего узла"
|
|
22
|
+
ru: "Введите ключ вашего узла",
|
|
23
|
+
tr: "Düğümünüzün anahtarını girin"
|
|
22
24
|
})
|
|
23
25
|
},
|
|
24
26
|
deleteButton: {
|
|
@@ -35,7 +37,8 @@ const structureViewContent = {
|
|
|
35
37
|
pt: "Remover nó da seção",
|
|
36
38
|
hi: "सेक्शन से नोड हटाएं",
|
|
37
39
|
ar: "إزالة العقدة من القسم",
|
|
38
|
-
ru: "Удалить узел из секции"
|
|
40
|
+
ru: "Удалить узел из секции",
|
|
41
|
+
tr: "Düğümü bölümden kaldır"
|
|
39
42
|
})
|
|
40
43
|
},
|
|
41
44
|
addNodeButton: {
|
|
@@ -52,7 +55,8 @@ const structureViewContent = {
|
|
|
52
55
|
pt: "Clique para adicionar um novo nó",
|
|
53
56
|
hi: "नया नोड जोड़ने के लिए क्लिक करें",
|
|
54
57
|
ar: "انقر لإضافة عقدة جديدة",
|
|
55
|
-
ru: "Нажмите, чтобы добавить новый узел"
|
|
58
|
+
ru: "Нажмите, чтобы добавить новый узел",
|
|
59
|
+
tr: "Yeni bir düğüm eklemek için tıklayın"
|
|
56
60
|
}),
|
|
57
61
|
text: intlayer.t({
|
|
58
62
|
en: "Add a new node",
|
|
@@ -67,7 +71,8 @@ const structureViewContent = {
|
|
|
67
71
|
pt: "Adicionar um novo nó",
|
|
68
72
|
hi: "नया नोड जोड़ें",
|
|
69
73
|
ar: "إضافة عقدة جديدة",
|
|
70
|
-
ru: "Добавить новый узел"
|
|
74
|
+
ru: "Добавить новый узел",
|
|
75
|
+
tr: "Yeni bir düğüm ekle"
|
|
71
76
|
})
|
|
72
77
|
}
|
|
73
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structureView.content.cjs","sources":["../../../../src/components/DictionaryFieldEditor/StructureView/structureView.content.ts"],"sourcesContent":["import { t, type Dictionary } from 'intlayer';\n\nexport const structureViewContent = {\n key: 'structure-view',\n content: {\n titleInput: {\n placeholder: t({\n en: 'Enter the key of your node',\n 'en-GB': 'Enter the key of your node',\n fr: 'Entrez la clé de votre nœud',\n es: 'Ingrese la clave de su nodo',\n de: 'Geben Sie den Schlüssel Ihres Knotens ein',\n ja: 'ノードのキーを入力してください',\n ko: '노드의 키를 입력하세요',\n zh: '输入您节点的键',\n it: 'Inserisci la chiave del tuo nodo',\n pt: 'Insira a chave do seu nó',\n hi: 'अपनी नोड की कुंजी दर्ज करें',\n ar: 'أدخل مفتاح العقدة الخاص بك',\n ru: 'Введите ключ вашего узла',\n }),\n },\n deleteButton: {\n label: t({\n en: 'Remove node from section',\n 'en-GB': 'Remove node from section',\n fr: 'Supprimer le nœud de la section',\n es: 'Eliminar el nodo de la sección',\n de: 'Knoten aus dem Abschnitt entfernen',\n ja: 'セクションからノードを削除',\n ko: '섹션에서 노드를 제거',\n zh: '从部分中移除节点',\n it: 'Rimuovi nodo dalla sezione',\n pt: 'Remover nó da seção',\n hi: 'सेक्शन से नोड हटाएं',\n ar: 'إزالة العقدة من القسم',\n ru: 'Удалить узел из секции',\n }),\n },\n addNodeButton: {\n label: t({\n en: 'Click to add a new node',\n 'en-GB': 'Click to add a new node',\n fr: 'Cliquez pour ajouter un nouveau nœud',\n es: 'Haga clic para agregar un nuevo nodo',\n de: 'Klicken, um einen neuen Knoten hinzuzufügen',\n ja: '新しいノードを追加するにはクリックしてください',\n ko: '새 노드를 추가하려면 클릭하세요',\n zh: '点击添加新节点',\n it: 'Fai clic per aggiungere un nuovo nodo',\n pt: 'Clique para adicionar um novo nó',\n hi: 'नया नोड जोड़ने के लिए क्लिक करें',\n ar: 'انقر لإضافة عقدة جديدة',\n ru: 'Нажмите, чтобы добавить новый узел',\n }),\n text: t({\n en: 'Add a new node',\n 'en-GB': 'Add a new node',\n fr: 'Ajouter un nouveau nœud',\n es: 'Agregar un nuevo nodo',\n de: 'Neuen Knoten hinzufügen',\n ja: '新しいノードを追加',\n ko: '새 노드 추가',\n zh: '添加新节点',\n it: 'Aggiungi un nuovo nodo',\n pt: 'Adicionar um novo nó',\n hi: 'नया नोड जोड़ें',\n ar: 'إضافة عقدة جديدة',\n ru: 'Добавить новый узел',\n }),\n },\n },\n} satisfies Dictionary;\n\nexport default structureViewContent;\n"],"names":["t"],"mappings":";;;AAEO,MAAM,uBAAuB;AAAA,EAClC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,YAAY;AAAA,MACV,aAAaA,SAAAA,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IAAA;AAAA,IAEH,cAAc;AAAA,MACZ,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IAAA;AAAA,IAEH,eAAe;AAAA,MACb,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,MAAMA,SAAAA,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IAAA;AAAA,EACH;AAEJ;;;"}
|
|
1
|
+
{"version":3,"file":"structureView.content.cjs","sources":["../../../../src/components/DictionaryFieldEditor/StructureView/structureView.content.ts"],"sourcesContent":["import { t, type Dictionary } from 'intlayer';\n\nexport const structureViewContent = {\n key: 'structure-view',\n autoFill: './{{key}}.content.json',\n content: {\n titleInput: {\n placeholder: t({\n en: 'Enter the key of your node',\n 'en-GB': 'Enter the key of your node',\n fr: 'Entrez la clé de votre nœud',\n es: 'Ingrese la clave de su nodo',\n de: 'Geben Sie den Schlüssel Ihres Knotens ein',\n ja: 'ノードのキーを入力してください',\n ko: '노드의 키를 입력하세요',\n zh: '输入您节点的键',\n it: 'Inserisci la chiave del tuo nodo',\n pt: 'Insira a chave do seu nó',\n hi: 'अपनी नोड की कुंजी दर्ज करें',\n ar: 'أدخل مفتاح العقدة الخاص بك',\n ru: 'Введите ключ вашего узла',\n tr: 'Düğümünüzün anahtarını girin',\n }),\n },\n deleteButton: {\n label: t({\n en: 'Remove node from section',\n 'en-GB': 'Remove node from section',\n fr: 'Supprimer le nœud de la section',\n es: 'Eliminar el nodo de la sección',\n de: 'Knoten aus dem Abschnitt entfernen',\n ja: 'セクションからノードを削除',\n ko: '섹션에서 노드를 제거',\n zh: '从部分中移除节点',\n it: 'Rimuovi nodo dalla sezione',\n pt: 'Remover nó da seção',\n hi: 'सेक्शन से नोड हटाएं',\n ar: 'إزالة العقدة من القسم',\n ru: 'Удалить узел из секции',\n tr: 'Düğümü bölümden kaldır',\n }),\n },\n addNodeButton: {\n label: t({\n en: 'Click to add a new node',\n 'en-GB': 'Click to add a new node',\n fr: 'Cliquez pour ajouter un nouveau nœud',\n es: 'Haga clic para agregar un nuevo nodo',\n de: 'Klicken, um einen neuen Knoten hinzuzufügen',\n ja: '新しいノードを追加するにはクリックしてください',\n ko: '새 노드를 추가하려면 클릭하세요',\n zh: '点击添加新节点',\n it: 'Fai clic per aggiungere un nuovo nodo',\n pt: 'Clique para adicionar um novo nó',\n hi: 'नया नोड जोड़ने के लिए क्लिक करें',\n ar: 'انقر لإضافة عقدة جديدة',\n ru: 'Нажмите, чтобы добавить новый узел',\n tr: 'Yeni bir düğüm eklemek için tıklayın',\n }),\n text: t({\n en: 'Add a new node',\n 'en-GB': 'Add a new node',\n fr: 'Ajouter un nouveau nœud',\n es: 'Agregar un nuevo nodo',\n de: 'Neuen Knoten hinzufügen',\n ja: '新しいノードを追加',\n ko: '새 노드 추가',\n zh: '添加新节点',\n it: 'Aggiungi un nuovo nodo',\n pt: 'Adicionar um novo nó',\n hi: 'नया नोड जोड़ें',\n ar: 'إضافة عقدة جديدة',\n ru: 'Добавить новый узел',\n tr: 'Yeni bir düğüm ekle',\n }),\n },\n },\n} satisfies Dictionary;\n\nexport default structureViewContent;\n"],"names":["t"],"mappings":";;;AAEO,MAAM,uBAAuB;AAAA,EAClC,KAAK;AAAA,EACL,UAAU;AAAA,EACV,SAAS;AAAA,IACP,YAAY;AAAA,MACV,aAAaA,SAAAA,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IAAA;AAAA,IAEH,cAAc;AAAA,MACZ,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IAAA;AAAA,IAEH,eAAe;AAAA,MACb,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,MAAMA,SAAAA,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IAAA;AAAA,EACH;AAEJ;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const structureViewContent: {
|
|
2
2
|
key: string;
|
|
3
|
+
autoFill: string;
|
|
3
4
|
content: {
|
|
4
5
|
titleInput: {
|
|
5
6
|
placeholder: import('@intlayer/core').TypedNodeModel<import("@intlayer/core").NodeType.Translation, {
|
|
@@ -16,6 +17,7 @@ export declare const structureViewContent: {
|
|
|
16
17
|
hi: string;
|
|
17
18
|
ar: string;
|
|
18
19
|
ru: string;
|
|
20
|
+
tr: string;
|
|
19
21
|
}, {
|
|
20
22
|
nodeType: import("@intlayer/core").NodeType.Translation | "translation";
|
|
21
23
|
} & {
|
|
@@ -33,6 +35,7 @@ export declare const structureViewContent: {
|
|
|
33
35
|
hi: string;
|
|
34
36
|
ar: string;
|
|
35
37
|
ru: string;
|
|
38
|
+
tr: string;
|
|
36
39
|
};
|
|
37
40
|
}>;
|
|
38
41
|
};
|
|
@@ -51,6 +54,7 @@ export declare const structureViewContent: {
|
|
|
51
54
|
hi: string;
|
|
52
55
|
ar: string;
|
|
53
56
|
ru: string;
|
|
57
|
+
tr: string;
|
|
54
58
|
}, {
|
|
55
59
|
nodeType: import("@intlayer/core").NodeType.Translation | "translation";
|
|
56
60
|
} & {
|
|
@@ -68,6 +72,7 @@ export declare const structureViewContent: {
|
|
|
68
72
|
hi: string;
|
|
69
73
|
ar: string;
|
|
70
74
|
ru: string;
|
|
75
|
+
tr: string;
|
|
71
76
|
};
|
|
72
77
|
}>;
|
|
73
78
|
};
|
|
@@ -86,6 +91,7 @@ export declare const structureViewContent: {
|
|
|
86
91
|
hi: string;
|
|
87
92
|
ar: string;
|
|
88
93
|
ru: string;
|
|
94
|
+
tr: string;
|
|
89
95
|
}, {
|
|
90
96
|
nodeType: import("@intlayer/core").NodeType.Translation | "translation";
|
|
91
97
|
} & {
|
|
@@ -103,6 +109,7 @@ export declare const structureViewContent: {
|
|
|
103
109
|
hi: string;
|
|
104
110
|
ar: string;
|
|
105
111
|
ru: string;
|
|
112
|
+
tr: string;
|
|
106
113
|
};
|
|
107
114
|
}>;
|
|
108
115
|
text: import('@intlayer/core').TypedNodeModel<import("@intlayer/core").NodeType.Translation, {
|
|
@@ -119,6 +126,7 @@ export declare const structureViewContent: {
|
|
|
119
126
|
hi: string;
|
|
120
127
|
ar: string;
|
|
121
128
|
ru: string;
|
|
129
|
+
tr: string;
|
|
122
130
|
}, {
|
|
123
131
|
nodeType: import("@intlayer/core").NodeType.Translation | "translation";
|
|
124
132
|
} & {
|
|
@@ -136,6 +144,7 @@ export declare const structureViewContent: {
|
|
|
136
144
|
hi: string;
|
|
137
145
|
ar: string;
|
|
138
146
|
ru: string;
|
|
147
|
+
tr: string;
|
|
139
148
|
};
|
|
140
149
|
}>;
|
|
141
150
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structureView.content.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/StructureView/structureView.content.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"structureView.content.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/StructureView/structureView.content.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2EX,CAAC;AAEvB,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { t } from "intlayer";
|
|
2
2
|
const structureViewContent = {
|
|
3
3
|
key: "structure-view",
|
|
4
|
+
autoFill: "./{{key}}.content.json",
|
|
4
5
|
content: {
|
|
5
6
|
titleInput: {
|
|
6
7
|
placeholder: t({
|
|
@@ -16,7 +17,8 @@ const structureViewContent = {
|
|
|
16
17
|
pt: "Insira a chave do seu nó",
|
|
17
18
|
hi: "अपनी नोड की कुंजी दर्ज करें",
|
|
18
19
|
ar: "أدخل مفتاح العقدة الخاص بك",
|
|
19
|
-
ru: "Введите ключ вашего узла"
|
|
20
|
+
ru: "Введите ключ вашего узла",
|
|
21
|
+
tr: "Düğümünüzün anahtarını girin"
|
|
20
22
|
})
|
|
21
23
|
},
|
|
22
24
|
deleteButton: {
|
|
@@ -33,7 +35,8 @@ const structureViewContent = {
|
|
|
33
35
|
pt: "Remover nó da seção",
|
|
34
36
|
hi: "सेक्शन से नोड हटाएं",
|
|
35
37
|
ar: "إزالة العقدة من القسم",
|
|
36
|
-
ru: "Удалить узел из секции"
|
|
38
|
+
ru: "Удалить узел из секции",
|
|
39
|
+
tr: "Düğümü bölümden kaldır"
|
|
37
40
|
})
|
|
38
41
|
},
|
|
39
42
|
addNodeButton: {
|
|
@@ -50,7 +53,8 @@ const structureViewContent = {
|
|
|
50
53
|
pt: "Clique para adicionar um novo nó",
|
|
51
54
|
hi: "नया नोड जोड़ने के लिए क्लिक करें",
|
|
52
55
|
ar: "انقر لإضافة عقدة جديدة",
|
|
53
|
-
ru: "Нажмите, чтобы добавить новый узел"
|
|
56
|
+
ru: "Нажмите, чтобы добавить новый узел",
|
|
57
|
+
tr: "Yeni bir düğüm eklemek için tıklayın"
|
|
54
58
|
}),
|
|
55
59
|
text: t({
|
|
56
60
|
en: "Add a new node",
|
|
@@ -65,7 +69,8 @@ const structureViewContent = {
|
|
|
65
69
|
pt: "Adicionar um novo nó",
|
|
66
70
|
hi: "नया नोड जोड़ें",
|
|
67
71
|
ar: "إضافة عقدة جديدة",
|
|
68
|
-
ru: "Добавить новый узел"
|
|
72
|
+
ru: "Добавить новый узел",
|
|
73
|
+
tr: "Yeni bir düğüm ekle"
|
|
69
74
|
})
|
|
70
75
|
}
|
|
71
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structureView.content.mjs","sources":["../../../../src/components/DictionaryFieldEditor/StructureView/structureView.content.ts"],"sourcesContent":["import { t, type Dictionary } from 'intlayer';\n\nexport const structureViewContent = {\n key: 'structure-view',\n content: {\n titleInput: {\n placeholder: t({\n en: 'Enter the key of your node',\n 'en-GB': 'Enter the key of your node',\n fr: 'Entrez la clé de votre nœud',\n es: 'Ingrese la clave de su nodo',\n de: 'Geben Sie den Schlüssel Ihres Knotens ein',\n ja: 'ノードのキーを入力してください',\n ko: '노드의 키를 입력하세요',\n zh: '输入您节点的键',\n it: 'Inserisci la chiave del tuo nodo',\n pt: 'Insira a chave do seu nó',\n hi: 'अपनी नोड की कुंजी दर्ज करें',\n ar: 'أدخل مفتاح العقدة الخاص بك',\n ru: 'Введите ключ вашего узла',\n }),\n },\n deleteButton: {\n label: t({\n en: 'Remove node from section',\n 'en-GB': 'Remove node from section',\n fr: 'Supprimer le nœud de la section',\n es: 'Eliminar el nodo de la sección',\n de: 'Knoten aus dem Abschnitt entfernen',\n ja: 'セクションからノードを削除',\n ko: '섹션에서 노드를 제거',\n zh: '从部分中移除节点',\n it: 'Rimuovi nodo dalla sezione',\n pt: 'Remover nó da seção',\n hi: 'सेक्शन से नोड हटाएं',\n ar: 'إزالة العقدة من القسم',\n ru: 'Удалить узел из секции',\n }),\n },\n addNodeButton: {\n label: t({\n en: 'Click to add a new node',\n 'en-GB': 'Click to add a new node',\n fr: 'Cliquez pour ajouter un nouveau nœud',\n es: 'Haga clic para agregar un nuevo nodo',\n de: 'Klicken, um einen neuen Knoten hinzuzufügen',\n ja: '新しいノードを追加するにはクリックしてください',\n ko: '새 노드를 추가하려면 클릭하세요',\n zh: '点击添加新节点',\n it: 'Fai clic per aggiungere un nuovo nodo',\n pt: 'Clique para adicionar um novo nó',\n hi: 'नया नोड जोड़ने के लिए क्लिक करें',\n ar: 'انقر لإضافة عقدة جديدة',\n ru: 'Нажмите, чтобы добавить новый узел',\n }),\n text: t({\n en: 'Add a new node',\n 'en-GB': 'Add a new node',\n fr: 'Ajouter un nouveau nœud',\n es: 'Agregar un nuevo nodo',\n de: 'Neuen Knoten hinzufügen',\n ja: '新しいノードを追加',\n ko: '새 노드 추가',\n zh: '添加新节点',\n it: 'Aggiungi un nuovo nodo',\n pt: 'Adicionar um novo nó',\n hi: 'नया नोड जोड़ें',\n ar: 'إضافة عقدة جديدة',\n ru: 'Добавить новый узел',\n }),\n },\n },\n} satisfies Dictionary;\n\nexport default structureViewContent;\n"],"names":[],"mappings":";AAEO,MAAM,uBAAuB;AAAA,EAClC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,YAAY;AAAA,MACV,aAAa,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IAAA;AAAA,IAEH,cAAc;AAAA,MACZ,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IAAA;AAAA,IAEH,eAAe;AAAA,MACb,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,MAAM,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IAAA;AAAA,EACH;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"structureView.content.mjs","sources":["../../../../src/components/DictionaryFieldEditor/StructureView/structureView.content.ts"],"sourcesContent":["import { t, type Dictionary } from 'intlayer';\n\nexport const structureViewContent = {\n key: 'structure-view',\n autoFill: './{{key}}.content.json',\n content: {\n titleInput: {\n placeholder: t({\n en: 'Enter the key of your node',\n 'en-GB': 'Enter the key of your node',\n fr: 'Entrez la clé de votre nœud',\n es: 'Ingrese la clave de su nodo',\n de: 'Geben Sie den Schlüssel Ihres Knotens ein',\n ja: 'ノードのキーを入力してください',\n ko: '노드의 키를 입력하세요',\n zh: '输入您节点的键',\n it: 'Inserisci la chiave del tuo nodo',\n pt: 'Insira a chave do seu nó',\n hi: 'अपनी नोड की कुंजी दर्ज करें',\n ar: 'أدخل مفتاح العقدة الخاص بك',\n ru: 'Введите ключ вашего узла',\n tr: 'Düğümünüzün anahtarını girin',\n }),\n },\n deleteButton: {\n label: t({\n en: 'Remove node from section',\n 'en-GB': 'Remove node from section',\n fr: 'Supprimer le nœud de la section',\n es: 'Eliminar el nodo de la sección',\n de: 'Knoten aus dem Abschnitt entfernen',\n ja: 'セクションからノードを削除',\n ko: '섹션에서 노드를 제거',\n zh: '从部分中移除节点',\n it: 'Rimuovi nodo dalla sezione',\n pt: 'Remover nó da seção',\n hi: 'सेक्शन से नोड हटाएं',\n ar: 'إزالة العقدة من القسم',\n ru: 'Удалить узел из секции',\n tr: 'Düğümü bölümden kaldır',\n }),\n },\n addNodeButton: {\n label: t({\n en: 'Click to add a new node',\n 'en-GB': 'Click to add a new node',\n fr: 'Cliquez pour ajouter un nouveau nœud',\n es: 'Haga clic para agregar un nuevo nodo',\n de: 'Klicken, um einen neuen Knoten hinzuzufügen',\n ja: '新しいノードを追加するにはクリックしてください',\n ko: '새 노드를 추가하려면 클릭하세요',\n zh: '点击添加新节点',\n it: 'Fai clic per aggiungere un nuovo nodo',\n pt: 'Clique para adicionar um novo nó',\n hi: 'नया नोड जोड़ने के लिए क्लिक करें',\n ar: 'انقر لإضافة عقدة جديدة',\n ru: 'Нажмите, чтобы добавить новый узел',\n tr: 'Yeni bir düğüm eklemek için tıklayın',\n }),\n text: t({\n en: 'Add a new node',\n 'en-GB': 'Add a new node',\n fr: 'Ajouter un nouveau nœud',\n es: 'Agregar un nuevo nodo',\n de: 'Neuen Knoten hinzufügen',\n ja: '新しいノードを追加',\n ko: '새 노드 추가',\n zh: '添加新节点',\n it: 'Aggiungi un nuovo nodo',\n pt: 'Adicionar um novo nó',\n hi: 'नया नोड जोड़ें',\n ar: 'إضافة عقدة جديدة',\n ru: 'Добавить новый узел',\n tr: 'Yeni bir düğüm ekle',\n }),\n },\n },\n} satisfies Dictionary;\n\nexport default structureViewContent;\n"],"names":[],"mappings":";AAEO,MAAM,uBAAuB;AAAA,EAClC,KAAK;AAAA,EACL,UAAU;AAAA,EACV,SAAS;AAAA,IACP,YAAY;AAAA,MACV,aAAa,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IAAA;AAAA,IAEH,cAAc;AAAA,MACZ,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IAAA;AAAA,IAEH,eAAe;AAAA,MACb,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,MAAM,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IAAA;AAAA,EACH;AAEJ;"}
|
|
@@ -11,8 +11,8 @@ const components_DictionaryFieldEditor_VersionSwitcherDropDown_VersionSwitcherCo
|
|
|
11
11
|
const DROPDOWN_IDENTIFIER = "version-switcher";
|
|
12
12
|
const VersionSwitcher = ({ panelProps }) => {
|
|
13
13
|
const { switchTo, versionSwitcherLabel, versionListLabel } = reactIntlayer.useIntlayer("version-switcher");
|
|
14
|
-
const { selectedVersion,
|
|
15
|
-
if (
|
|
14
|
+
const { selectedVersion, versions, setSelectedVersion } = components_DictionaryFieldEditor_VersionSwitcherDropDown_VersionSwitcherContext.useVersionSwitcher();
|
|
15
|
+
if (versions.length === 0) {
|
|
16
16
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
17
17
|
}
|
|
18
18
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -44,7 +44,7 @@ const VersionSwitcher = ({ panelProps }) => {
|
|
|
44
44
|
roundedSize: "2xl",
|
|
45
45
|
borderColor: "text",
|
|
46
46
|
"aria-label": versionSwitcherLabel.value,
|
|
47
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "divide-text/20 divide-y divide-dashed overflow-y-auto p-1", children:
|
|
47
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "divide-text/20 divide-y divide-dashed overflow-y-auto p-1", children: versions.reverse().map((version) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: "px-1.5 py-1", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
48
48
|
components_Button_Button.Button,
|
|
49
49
|
{
|
|
50
50
|
onClick: () => setSelectedVersion(version),
|
package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VersionSwitcher.cjs","sources":["../../../../src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.tsx"],"sourcesContent":["'use client';\n\nimport { MoveVertical } from 'lucide-react';\nimport { type FC } from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport {\n Button,\n ButtonColor,\n ButtonSize,\n ButtonTextAlign,\n ButtonVariant,\n} from '../../Button';\nimport { Container } from '../../Container';\nimport { DropDown, type PanelProps } from '../../DropDown';\nimport { useVersionSwitcher } from './VersionSwitcherContext';\n\nexport type VersionSwitcherProps = {\n panelProps?: Omit<PanelProps, 'identifier'>;\n};\n\nconst DROPDOWN_IDENTIFIER = 'version-switcher';\n\nexport const VersionSwitcher: FC<VersionSwitcherProps> = ({ panelProps }) => {\n const { switchTo, versionSwitcherLabel, versionListLabel } =\n useIntlayer('version-switcher');\n const { selectedVersion,
|
|
1
|
+
{"version":3,"file":"VersionSwitcher.cjs","sources":["../../../../src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.tsx"],"sourcesContent":["'use client';\n\nimport { MoveVertical } from 'lucide-react';\nimport { type FC } from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport {\n Button,\n ButtonColor,\n ButtonSize,\n ButtonTextAlign,\n ButtonVariant,\n} from '../../Button';\nimport { Container } from '../../Container';\nimport { DropDown, type PanelProps } from '../../DropDown';\nimport { useVersionSwitcher } from './VersionSwitcherContext';\n\nexport type VersionSwitcherProps = {\n panelProps?: Omit<PanelProps, 'identifier'>;\n};\n\nconst DROPDOWN_IDENTIFIER = 'version-switcher';\n\nexport const VersionSwitcher: FC<VersionSwitcherProps> = ({ panelProps }) => {\n const { switchTo, versionSwitcherLabel, versionListLabel } =\n useIntlayer('version-switcher');\n const { selectedVersion, versions, setSelectedVersion } =\n useVersionSwitcher();\n\n if (versions.length === 0) {\n return <></>;\n }\n\n return (\n <div\n className=\"border-text text-text rounded-xl border transition-colors\"\n aria-label={versionListLabel.value}\n >\n <DropDown identifier={DROPDOWN_IDENTIFIER}>\n <DropDown.Trigger identifier={DROPDOWN_IDENTIFIER}>\n <div className=\"flex w-full items-center justify-between\">\n <div className=\"px-2\">{selectedVersion ?? 'LTS'}</div>\n <MoveVertical className=\"w-5 self-center\" />\n </div>\n </DropDown.Trigger>\n\n <DropDown.Panel\n identifier={DROPDOWN_IDENTIFIER}\n isOverable\n isFocusable\n className=\"left-auto right-0\"\n {...panelProps}\n >\n <Container\n className=\"max-h-[80vh] min-w-28\"\n separator=\"y\"\n role=\"listbox\"\n transparency=\"sm\"\n border\n roundedSize=\"2xl\"\n borderColor=\"text\"\n aria-label={versionSwitcherLabel.value}\n >\n <ol className=\"divide-text/20 divide-y divide-dashed overflow-y-auto p-1\">\n {versions.reverse().map((version) => (\n <li className=\"px-1.5 py-1\" key={version}>\n <Button\n onClick={() => setSelectedVersion(version)}\n label={`${switchTo} v${version}`}\n isActive={selectedVersion === version}\n variant={ButtonVariant.HOVERABLE}\n color={ButtonColor.TEXT}\n isFullWidth\n textAlign={ButtonTextAlign.LEFT}\n size={ButtonSize.SM}\n >\n <div className=\"text-neutral flex flex-1 flex-row items-center justify-between gap-3 px-2 py-1 text-sm\">\n {version}\n </div>\n </Button>\n </li>\n ))}\n </ol>\n </Container>\n </DropDown.Panel>\n </DropDown>\n </div>\n );\n};\n"],"names":["useIntlayer","useVersionSwitcher","jsx","Fragment","jsxs","DropDown","MoveVertical","Container","Button","ButtonVariant","ButtonColor","ButtonTextAlign","ButtonSize"],"mappings":";;;;;;;;;;AAoBA,MAAM,sBAAsB;AA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AAA;AAAAA,kBAACM,yBAAAA;AAAAA,kBAAA;AAAA,oBACC,SAAS,MAAM,mBAAmB,OAAO;AAAA,oBACzC,OAAO,GAAG,QAAQ,KAAK,OAAO;AAAA,oBAC9B,UAAU,oBAAoB;AAAA,oBAC9B,SAASC,yBAAAA,cAAc;AAAA,oBACvB,OAAOC,yBAAAA,YAAY;AAAA,oBACnB,aAAW;AAAA,oBACX,WAAWC,yBAAAA,gBAAgB;AAAA,oBAC3B,MAAMC,yBAAAA,WAAW;AAAA,oBAEjB,UAAAV,2BAAAA,IAAC,OAAA,EAAI,WAAU,0FACZ,UAAA,QAAA,CACH;AAAA,kBAAA;AAAA,gBAAA,EACF,GAd+B,OAejC,CACD,EAAA,CACH;AAAA,cAAA;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MACF,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;;"}
|
|
@@ -9,8 +9,8 @@ import { useVersionSwitcher } from "./VersionSwitcherContext.mjs";
|
|
|
9
9
|
const DROPDOWN_IDENTIFIER = "version-switcher";
|
|
10
10
|
const VersionSwitcher = ({ panelProps }) => {
|
|
11
11
|
const { switchTo, versionSwitcherLabel, versionListLabel } = useIntlayer("version-switcher");
|
|
12
|
-
const { selectedVersion,
|
|
13
|
-
if (
|
|
12
|
+
const { selectedVersion, versions, setSelectedVersion } = useVersionSwitcher();
|
|
13
|
+
if (versions.length === 0) {
|
|
14
14
|
return /* @__PURE__ */ jsx(Fragment, {});
|
|
15
15
|
}
|
|
16
16
|
return /* @__PURE__ */ jsx(
|
|
@@ -42,7 +42,7 @@ const VersionSwitcher = ({ panelProps }) => {
|
|
|
42
42
|
roundedSize: "2xl",
|
|
43
43
|
borderColor: "text",
|
|
44
44
|
"aria-label": versionSwitcherLabel.value,
|
|
45
|
-
children: /* @__PURE__ */ jsx("ol", { className: "divide-text/20 divide-y divide-dashed overflow-y-auto p-1", children:
|
|
45
|
+
children: /* @__PURE__ */ jsx("ol", { className: "divide-text/20 divide-y divide-dashed overflow-y-auto p-1", children: versions.reverse().map((version) => /* @__PURE__ */ jsx("li", { className: "px-1.5 py-1", children: /* @__PURE__ */ jsx(
|
|
46
46
|
Button,
|
|
47
47
|
{
|
|
48
48
|
onClick: () => setSelectedVersion(version),
|
package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VersionSwitcher.mjs","sources":["../../../../src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.tsx"],"sourcesContent":["'use client';\n\nimport { MoveVertical } from 'lucide-react';\nimport { type FC } from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport {\n Button,\n ButtonColor,\n ButtonSize,\n ButtonTextAlign,\n ButtonVariant,\n} from '../../Button';\nimport { Container } from '../../Container';\nimport { DropDown, type PanelProps } from '../../DropDown';\nimport { useVersionSwitcher } from './VersionSwitcherContext';\n\nexport type VersionSwitcherProps = {\n panelProps?: Omit<PanelProps, 'identifier'>;\n};\n\nconst DROPDOWN_IDENTIFIER = 'version-switcher';\n\nexport const VersionSwitcher: FC<VersionSwitcherProps> = ({ panelProps }) => {\n const { switchTo, versionSwitcherLabel, versionListLabel } =\n useIntlayer('version-switcher');\n const { selectedVersion,
|
|
1
|
+
{"version":3,"file":"VersionSwitcher.mjs","sources":["../../../../src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.tsx"],"sourcesContent":["'use client';\n\nimport { MoveVertical } from 'lucide-react';\nimport { type FC } from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport {\n Button,\n ButtonColor,\n ButtonSize,\n ButtonTextAlign,\n ButtonVariant,\n} from '../../Button';\nimport { Container } from '../../Container';\nimport { DropDown, type PanelProps } from '../../DropDown';\nimport { useVersionSwitcher } from './VersionSwitcherContext';\n\nexport type VersionSwitcherProps = {\n panelProps?: Omit<PanelProps, 'identifier'>;\n};\n\nconst DROPDOWN_IDENTIFIER = 'version-switcher';\n\nexport const VersionSwitcher: FC<VersionSwitcherProps> = ({ panelProps }) => {\n const { switchTo, versionSwitcherLabel, versionListLabel } =\n useIntlayer('version-switcher');\n const { selectedVersion, versions, setSelectedVersion } =\n useVersionSwitcher();\n\n if (versions.length === 0) {\n return <></>;\n }\n\n return (\n <div\n className=\"border-text text-text rounded-xl border transition-colors\"\n aria-label={versionListLabel.value}\n >\n <DropDown identifier={DROPDOWN_IDENTIFIER}>\n <DropDown.Trigger identifier={DROPDOWN_IDENTIFIER}>\n <div className=\"flex w-full items-center justify-between\">\n <div className=\"px-2\">{selectedVersion ?? 'LTS'}</div>\n <MoveVertical className=\"w-5 self-center\" />\n </div>\n </DropDown.Trigger>\n\n <DropDown.Panel\n identifier={DROPDOWN_IDENTIFIER}\n isOverable\n isFocusable\n className=\"left-auto right-0\"\n {...panelProps}\n >\n <Container\n className=\"max-h-[80vh] min-w-28\"\n separator=\"y\"\n role=\"listbox\"\n transparency=\"sm\"\n border\n roundedSize=\"2xl\"\n borderColor=\"text\"\n aria-label={versionSwitcherLabel.value}\n >\n <ol className=\"divide-text/20 divide-y divide-dashed overflow-y-auto p-1\">\n {versions.reverse().map((version) => (\n <li className=\"px-1.5 py-1\" key={version}>\n <Button\n onClick={() => setSelectedVersion(version)}\n label={`${switchTo} v${version}`}\n isActive={selectedVersion === version}\n variant={ButtonVariant.HOVERABLE}\n color={ButtonColor.TEXT}\n isFullWidth\n textAlign={ButtonTextAlign.LEFT}\n size={ButtonSize.SM}\n >\n <div className=\"text-neutral flex flex-1 flex-row items-center justify-between gap-3 px-2 py-1 text-sm\">\n {version}\n </div>\n </Button>\n </li>\n ))}\n </ol>\n </Container>\n </DropDown.Panel>\n </DropDown>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAoBA,MAAM,sBAAsB;AAErB,MAAM,kBAA4C,CAAC,EAAE,iBAAiB;AAC3E,QAAM,EAAE,UAAU,sBAAsB,iBAAA,IACtC,YAAY,kBAA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AAAA,oBAEjB,UAAA,oBAAC,OAAA,EAAI,WAAU,0FACZ,UAAA,QAAA,CACH;AAAA,kBAAA;AAAA,gBAAA,EACF,GAd+B,OAejC,CACD,EAAA,CACH;AAAA,cAAA;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MACF,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs
CHANGED
|
@@ -6,26 +6,24 @@ const ReactExports = require("react");
|
|
|
6
6
|
require("@intlayer/config/built");
|
|
7
7
|
require("../../../better-auth.CMQ3rA-I-C2nBKRMa.cjs");
|
|
8
8
|
require("@intlayer/editor-react");
|
|
9
|
-
require("
|
|
10
|
-
require("../../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
9
|
+
require("@tanstack/react-query");
|
|
11
10
|
require("@intlayer/api");
|
|
12
|
-
require("deepmerge");
|
|
13
11
|
const hooks_usePersistedStore = require("../../../hooks/usePersistedStore.cjs");
|
|
14
12
|
require("../../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
|
|
15
13
|
const VersionSwitcherContext = ReactExports.createContext({
|
|
16
|
-
|
|
14
|
+
versions: [],
|
|
17
15
|
selectedVersion: null,
|
|
18
16
|
setSelectedVersion: () => {
|
|
19
17
|
}
|
|
20
18
|
});
|
|
21
19
|
const useVersionSwitcher = () => ReactExports.useContext(VersionSwitcherContext);
|
|
22
|
-
const VersionSwitcherProvider = ({
|
|
20
|
+
const VersionSwitcherProvider = ({ versions, defaultSelectedVersion, children }) => {
|
|
23
21
|
const [selectedVersion, setSelectedVersion] = hooks_usePersistedStore.usePersistedStore("version-selector", defaultSelectedVersion);
|
|
24
22
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
25
23
|
VersionSwitcherContext,
|
|
26
24
|
{
|
|
27
25
|
value: {
|
|
28
|
-
|
|
26
|
+
versions,
|
|
29
27
|
selectedVersion,
|
|
30
28
|
setSelectedVersion
|
|
31
29
|
},
|
package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VersionSwitcherContext.cjs","sources":["../../../../src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.tsx"],"sourcesContent":["'use client';\n\nimport {\n createContext,\n useContext,\n type Dispatch,\n type
|
|
1
|
+
{"version":3,"file":"VersionSwitcherContext.cjs","sources":["../../../../src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.tsx"],"sourcesContent":["'use client';\n\nimport {\n createContext,\n useContext,\n type Dispatch,\n type FC,\n type PropsWithChildren,\n type SetStateAction,\n} from 'react';\nimport { usePersistedStore } from '../../../hooks';\n\ntype VersionSwitcherContextProps = {\n versions: string[];\n selectedVersion: string | null;\n setSelectedVersion: Dispatch<SetStateAction<string | null>>;\n};\n\nconst VersionSwitcherContext = createContext<VersionSwitcherContextProps>({\n versions: [],\n selectedVersion: null,\n setSelectedVersion: () => {},\n});\n\nexport const useVersionSwitcher = () => useContext(VersionSwitcherContext);\n\ntype VersionSwitcherProviderProps = {\n versions: string[];\n defaultSelectedVersion?: string;\n};\n\nexport const VersionSwitcherProvider: FC<\n PropsWithChildren<VersionSwitcherProviderProps>\n> = ({ versions, defaultSelectedVersion, children }) => {\n const [selectedVersion, setSelectedVersion] = usePersistedStore<\n string | null\n >('version-selector', defaultSelectedVersion);\n\n return (\n <VersionSwitcherContext\n value={{\n versions,\n selectedVersion,\n setSelectedVersion,\n }}\n >\n {children}\n </VersionSwitcherContext>\n );\n};\n"],"names":["createContext","useContext","usePersistedStore","jsx"],"mappings":";;;;;;;;;;;;AAkBA,MAAM,yBAAyBA,aAAAA,cAA2C;AAAA,EACxE,UAAU,CAAA;AAAA,EACV,iBAAiB;AAAA,EACjB,oBAAoB,MAAM;AAAA,EAAC;AAC7B,CAAC;AAEM,MAAM,qBAAqB,MAAMC,aAAAA,WAAW,sBAAsB;AAOlE,MAAM,0BAET,CAAC,EAAE,UAAU,wBAAwB,eAAe;AACtD,QAAM,CAAC,iBAAiB,kBAAkB,IAAIC,wBAAAA,kBAE5C,oBAAoB,sBAAsB;AAE5C,SACEC,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,MAGD;AAAA,IAAA;AAAA,EAAA;AAGP;;;"}
|
package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Dispatch, PropsWithChildren, SetStateAction
|
|
1
|
+
import { Dispatch, FC, PropsWithChildren, SetStateAction } from 'react';
|
|
2
2
|
type VersionSwitcherContextProps = {
|
|
3
|
-
|
|
3
|
+
versions: string[];
|
|
4
4
|
selectedVersion: string | null;
|
|
5
5
|
setSelectedVersion: Dispatch<SetStateAction<string | null>>;
|
|
6
6
|
};
|
|
7
7
|
export declare const useVersionSwitcher: () => VersionSwitcherContextProps;
|
|
8
8
|
type VersionSwitcherProviderProps = {
|
|
9
|
-
|
|
9
|
+
versions: string[];
|
|
10
10
|
defaultSelectedVersion?: string;
|
|
11
11
|
};
|
|
12
12
|
export declare const VersionSwitcherProvider: FC<PropsWithChildren<VersionSwitcherProviderProps>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VersionSwitcherContext.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,
|
|
1
|
+
{"version":3,"file":"VersionSwitcherContext.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,EAAE,EACP,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAGf,KAAK,2BAA2B,GAAG;IACjC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,kBAAkB,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;CAC7D,CAAC;AAQF,eAAO,MAAM,kBAAkB,mCAA2C,CAAC;AAE3E,KAAK,4BAA4B,GAAG;IAClC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,EAAE,CACtC,iBAAiB,CAAC,4BAA4B,CAAC,CAiBhD,CAAC"}
|
package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs
CHANGED
|
@@ -4,26 +4,24 @@ import { createContext, useContext } from "react";
|
|
|
4
4
|
import "@intlayer/config/built";
|
|
5
5
|
import "../../../better-auth.CMQ3rA-I-7umXOENE.js";
|
|
6
6
|
import "@intlayer/editor-react";
|
|
7
|
-
import "
|
|
8
|
-
import "../../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
7
|
+
import "@tanstack/react-query";
|
|
9
8
|
import "@intlayer/api";
|
|
10
|
-
import "deepmerge";
|
|
11
9
|
import { usePersistedStore } from "../../../hooks/usePersistedStore.mjs";
|
|
12
10
|
import "../../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
|
|
13
11
|
const VersionSwitcherContext = createContext({
|
|
14
|
-
|
|
12
|
+
versions: [],
|
|
15
13
|
selectedVersion: null,
|
|
16
14
|
setSelectedVersion: () => {
|
|
17
15
|
}
|
|
18
16
|
});
|
|
19
17
|
const useVersionSwitcher = () => useContext(VersionSwitcherContext);
|
|
20
|
-
const VersionSwitcherProvider = ({
|
|
18
|
+
const VersionSwitcherProvider = ({ versions, defaultSelectedVersion, children }) => {
|
|
21
19
|
const [selectedVersion, setSelectedVersion] = usePersistedStore("version-selector", defaultSelectedVersion);
|
|
22
20
|
return /* @__PURE__ */ jsx(
|
|
23
21
|
VersionSwitcherContext,
|
|
24
22
|
{
|
|
25
23
|
value: {
|
|
26
|
-
|
|
24
|
+
versions,
|
|
27
25
|
selectedVersion,
|
|
28
26
|
setSelectedVersion
|
|
29
27
|
},
|
package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VersionSwitcherContext.mjs","sources":["../../../../src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.tsx"],"sourcesContent":["'use client';\n\nimport {\n createContext,\n useContext,\n type Dispatch,\n type
|
|
1
|
+
{"version":3,"file":"VersionSwitcherContext.mjs","sources":["../../../../src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.tsx"],"sourcesContent":["'use client';\n\nimport {\n createContext,\n useContext,\n type Dispatch,\n type FC,\n type PropsWithChildren,\n type SetStateAction,\n} from 'react';\nimport { usePersistedStore } from '../../../hooks';\n\ntype VersionSwitcherContextProps = {\n versions: string[];\n selectedVersion: string | null;\n setSelectedVersion: Dispatch<SetStateAction<string | null>>;\n};\n\nconst VersionSwitcherContext = createContext<VersionSwitcherContextProps>({\n versions: [],\n selectedVersion: null,\n setSelectedVersion: () => {},\n});\n\nexport const useVersionSwitcher = () => useContext(VersionSwitcherContext);\n\ntype VersionSwitcherProviderProps = {\n versions: string[];\n defaultSelectedVersion?: string;\n};\n\nexport const VersionSwitcherProvider: FC<\n PropsWithChildren<VersionSwitcherProviderProps>\n> = ({ versions, defaultSelectedVersion, children }) => {\n const [selectedVersion, setSelectedVersion] = usePersistedStore<\n string | null\n >('version-selector', defaultSelectedVersion);\n\n return (\n <VersionSwitcherContext\n value={{\n versions,\n selectedVersion,\n setSelectedVersion,\n }}\n >\n {children}\n </VersionSwitcherContext>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAkBA,MAAM,yBAAyB,cAA2C;AAAA,EACxE,UAAU,CAAA;AAAA,EACV,iBAAiB;AAAA,EACjB,oBAAoB,MAAM;AAAA,EAAC;AAC7B,CAAC;AAEM,MAAM,qBAAqB,MAAM,WAAW,sBAAsB;AAOlE,MAAM,0BAET,CAAC,EAAE,UAAU,wBAAwB,eAAe;AACtD,QAAM,CAAC,iBAAiB,kBAAkB,IAAI,kBAE5C,oBAAoB,sBAAsB;AAE5C,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,MAGD;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|