@intlayer/design-system 3.5.5 → 3.5.7
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 +297 -54
- package/dist/CodeBlockShiki-BlmZyrr7.cjs +29 -0
- package/dist/CodeBlockShiki-BlmZyrr7.cjs.map +1 -0
- package/dist/CodeBlockShiki-CcpV9SVi.js +29 -0
- package/dist/CodeBlockShiki-CcpV9SVi.js.map +1 -0
- package/dist/Form-0D7KBafQ.cjs +311 -0
- package/dist/Form-0D7KBafQ.cjs.map +1 -0
- package/dist/Form-7BqwvjVI.cjs +320 -0
- package/dist/Form-7BqwvjVI.cjs.map +1 -0
- package/dist/Form-B2UufQRJ.cjs +319 -0
- package/dist/Form-B2UufQRJ.cjs.map +1 -0
- package/dist/Form-BB0kpER9.cjs +301 -0
- package/dist/Form-BB0kpER9.cjs.map +1 -0
- package/dist/Form-BDcoNTLV.cjs.map +1 -1
- package/dist/Form-BTogr-fp.js +312 -0
- package/dist/Form-BTogr-fp.js.map +1 -0
- package/dist/Form-BVkkvSKP.js +312 -0
- package/dist/Form-BVkkvSKP.js.map +1 -0
- package/dist/Form-Be6Uhb5-.js +312 -0
- package/dist/Form-Be6Uhb5-.js.map +1 -0
- package/dist/Form-BmQQnl-6.js +312 -0
- package/dist/Form-BmQQnl-6.js.map +1 -0
- package/dist/Form-Bp_ubH9I.cjs +311 -0
- package/dist/Form-Bp_ubH9I.cjs.map +1 -0
- package/dist/Form-BtqRbgLu.cjs +311 -0
- package/dist/Form-BtqRbgLu.cjs.map +1 -0
- package/dist/Form-COVZyto7.cjs +311 -0
- package/dist/Form-COVZyto7.cjs.map +1 -0
- package/dist/Form-CVD_3nCD.js +312 -0
- package/dist/Form-CVD_3nCD.js.map +1 -0
- package/dist/Form-Cfklj1_H.js +320 -0
- package/dist/Form-Cfklj1_H.js.map +1 -0
- package/dist/Form-ClAAiVNm.cjs +311 -0
- package/dist/Form-ClAAiVNm.cjs.map +1 -0
- package/dist/Form-DGLgTAdY.js +302 -0
- package/dist/Form-DGLgTAdY.js.map +1 -0
- package/dist/Form-DhsgC7kB.js.map +1 -1
- package/dist/Form-OK9zfg6E.js +321 -0
- package/dist/Form-OK9zfg6E.js.map +1 -0
- package/dist/components/Accordion/Accordion.cjs +7 -15
- package/dist/components/Accordion/Accordion.cjs.map +1 -1
- package/dist/components/Accordion/Accordion.d.ts +0 -1
- package/dist/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/components/Accordion/Accordion.mjs +8 -16
- package/dist/components/Accordion/Accordion.mjs.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs +1 -1
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs +1 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs +1 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs +1 -1
- package/dist/components/Auth/SignInForm/SignInForm.cjs +1 -1
- package/dist/components/Auth/SignInForm/SignInForm.mjs +1 -1
- package/dist/components/Auth/SignUpForm/SignUpForm.cjs +1 -1
- package/dist/components/Auth/SignUpForm/SignUpForm.mjs +1 -1
- package/dist/components/Auth/SignUpForm/signUpForm.content.d.ts +11 -11
- package/dist/components/Breadcrumb/index.cjs +5 -2
- 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 +5 -2
- package/dist/components/Breadcrumb/index.mjs.map +1 -1
- package/dist/components/Button/Button.cjs +47 -25
- package/dist/components/Button/Button.cjs.map +1 -1
- package/dist/components/Button/Button.d.ts +2 -0
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.mjs +47 -25
- package/dist/components/Button/Button.mjs.map +1 -1
- package/dist/components/ClickOutsideDiv/index.cjs +26 -0
- package/dist/components/ClickOutsideDiv/index.cjs.map +1 -0
- package/dist/components/ClickOutsideDiv/index.d.ts +6 -0
- package/dist/components/ClickOutsideDiv/index.d.ts.map +1 -0
- package/dist/components/ClickOutsideDiv/index.mjs +26 -0
- package/dist/components/ClickOutsideDiv/index.mjs.map +1 -0
- package/dist/components/Container/index.cjs +1 -1
- package/dist/components/Container/index.cjs.map +1 -1
- package/dist/components/Container/index.mjs +1 -1
- package/dist/components/Container/index.mjs.map +1 -1
- package/dist/components/ContentEditor/ContentEditorCode.cjs +78 -0
- package/dist/components/ContentEditor/ContentEditorCode.cjs.map +1 -0
- package/dist/components/ContentEditor/ContentEditorCode.d.ts +11 -0
- package/dist/components/ContentEditor/ContentEditorCode.d.ts.map +1 -0
- package/dist/components/ContentEditor/ContentEditorCode.mjs +78 -0
- package/dist/components/ContentEditor/ContentEditorCode.mjs.map +1 -0
- package/dist/components/ContentEditor/ContentEditorTextArea.cjs +30 -26
- package/dist/components/ContentEditor/ContentEditorTextArea.cjs.map +1 -1
- package/dist/components/ContentEditor/ContentEditorTextArea.d.ts +2 -1
- package/dist/components/ContentEditor/ContentEditorTextArea.d.ts.map +1 -1
- package/dist/components/ContentEditor/ContentEditorTextArea.mjs +30 -26
- package/dist/components/ContentEditor/ContentEditorTextArea.mjs.map +1 -1
- package/dist/components/CopyToClipboard/index.cjs +1 -1
- package/dist/components/CopyToClipboard/index.cjs.map +1 -1
- package/dist/components/CopyToClipboard/index.d.ts.map +1 -1
- package/dist/components/CopyToClipboard/index.mjs +1 -1
- package/dist/components/CopyToClipboard/index.mjs.map +1 -1
- package/dist/components/DictionaryEditor/ItemLayout.cjs +0 -1
- package/dist/components/DictionaryEditor/ItemLayout.cjs.map +1 -1
- package/dist/components/DictionaryEditor/ItemLayout.d.ts.map +1 -1
- package/dist/components/DictionaryEditor/ItemLayout.mjs +0 -1
- package/dist/components/DictionaryEditor/ItemLayout.mjs.map +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs +4 -4
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs.map +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs +4 -4
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs +5 -3
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.d.ts +2 -0
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs +5 -3
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +162 -70
- 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 +164 -72
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs +123 -0
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts +14 -0
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs +123 -0
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.cjs +9 -2
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.cjs +15 -0
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts +1 -0
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.mjs +15 -0
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.d.ts +6 -0
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.mjs +9 -2
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs +13 -5
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts +2 -0
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +13 -5
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs +8 -6
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.d.ts +2 -0
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs +8 -6
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs +129 -66
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.d.ts +4 -2
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs +128 -65
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/JSONEditor.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/JSONEditor.mjs +1 -1
- package/dist/components/DictionaryFieldEditor/LocaleSelector/LocaleSelector.d.ts +8 -0
- package/dist/components/DictionaryFieldEditor/LocaleSelector/LocaleSelector.d.ts.map +1 -0
- package/dist/components/DictionaryFieldEditor/LocaleSelector/LocaleSelectorContext.d.ts +13 -0
- package/dist/components/DictionaryFieldEditor/LocaleSelector/LocaleSelectorContext.d.ts.map +1 -0
- package/dist/components/DictionaryFieldEditor/LocaleSelector/localeSelector.content.d.ts +9 -0
- package/dist/components/DictionaryFieldEditor/LocaleSelector/localeSelector.content.d.ts.map +1 -0
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs +15 -19
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +15 -19
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeEditor.cjs +24 -11
- package/dist/components/DictionaryFieldEditor/NodeEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeEditor.d.ts +2 -0
- package/dist/components/DictionaryFieldEditor/NodeEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeEditor.mjs +24 -11
- package/dist/components/DictionaryFieldEditor/NodeEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +3 -5
- 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 +4 -6
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs +13 -13
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs +13 -13
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs +73 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs.map +1 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.d.ts +7 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.d.ts.map +1 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs +73 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs.map +1 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs +37 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs.map +1 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.d.ts +14 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.d.ts.map +1 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs +37 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs.map +1 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/index.cjs +8 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/index.cjs.map +1 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/index.d.ts +3 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/index.d.ts.map +1 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/index.mjs +8 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/index.mjs.map +1 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.cjs +54 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.cjs.map +1 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.d.ts +10 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.d.ts.map +1 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.mjs +55 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.mjs.map +1 -0
- package/dist/components/DictionaryFieldEditor/index.cjs +5 -0
- package/dist/components/DictionaryFieldEditor/index.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/index.d.ts +1 -0
- package/dist/components/DictionaryFieldEditor/index.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/index.mjs +6 -1
- package/dist/components/DictionaryFieldEditor/index.mjs.map +1 -1
- package/dist/components/EditableField/EditableFieldInput.cjs +5 -1
- package/dist/components/EditableField/EditableFieldInput.cjs.map +1 -1
- package/dist/components/EditableField/EditableFieldInput.d.ts.map +1 -1
- package/dist/components/EditableField/EditableFieldInput.mjs +6 -2
- package/dist/components/EditableField/EditableFieldInput.mjs.map +1 -1
- package/dist/components/EditableField/EditableFieldTextArea.cjs +2 -8
- package/dist/components/EditableField/EditableFieldTextArea.cjs.map +1 -1
- package/dist/components/EditableField/EditableFieldTextArea.d.ts.map +1 -1
- package/dist/components/EditableField/EditableFieldTextArea.mjs +2 -8
- package/dist/components/EditableField/EditableFieldTextArea.mjs.map +1 -1
- package/dist/components/Form/Form.cjs +1 -1
- package/dist/components/Form/Form.d.ts +2 -0
- package/dist/components/Form/Form.d.ts.map +1 -1
- package/dist/components/Form/Form.mjs +1 -1
- package/dist/components/Form/FormLabel.cjs +6 -2
- package/dist/components/Form/FormLabel.cjs.map +1 -1
- package/dist/components/Form/FormLabel.d.ts.map +1 -1
- package/dist/components/Form/FormLabel.mjs +6 -2
- package/dist/components/Form/FormLabel.mjs.map +1 -1
- package/dist/components/Form/elements/AutoSizeTextAreaElement.cjs +7 -0
- package/dist/components/Form/elements/AutoSizeTextAreaElement.cjs.map +1 -0
- package/dist/components/Form/elements/AutoSizeTextAreaElement.d.ts +9 -0
- package/dist/components/Form/elements/AutoSizeTextAreaElement.d.ts.map +1 -0
- package/dist/components/Form/elements/AutoSizeTextAreaElement.mjs +7 -0
- package/dist/components/Form/elements/AutoSizeTextAreaElement.mjs.map +1 -0
- package/dist/components/Form/elements/CheckboxElement.cjs +1 -1
- package/dist/components/Form/elements/CheckboxElement.mjs +1 -1
- package/dist/components/Form/elements/EditableFieldInputElement.cjs +1 -1
- package/dist/components/Form/elements/EditableFieldInputElement.d.ts +1 -1
- package/dist/components/Form/elements/EditableFieldInputElement.d.ts.map +1 -1
- package/dist/components/Form/elements/EditableFieldInputElement.mjs +1 -1
- package/dist/components/Form/elements/EditableFieldTextAreaElement.cjs +1 -1
- package/dist/components/Form/elements/EditableFieldTextAreaElement.d.ts +1 -1
- package/dist/components/Form/elements/EditableFieldTextAreaElement.d.ts.map +1 -1
- package/dist/components/Form/elements/EditableFieldTextAreaElement.mjs +1 -1
- package/dist/components/Form/elements/FormElement.cjs +1 -1
- package/dist/components/Form/elements/FormElement.mjs +1 -1
- package/dist/components/Form/elements/InputElement.cjs +1 -1
- package/dist/components/Form/elements/InputElement.mjs +1 -1
- package/dist/components/Form/elements/InputPasswordElement.cjs +1 -1
- package/dist/components/Form/elements/InputPasswordElement.mjs +1 -1
- package/dist/components/Form/elements/MultiselectElement.cjs +1 -1
- package/dist/components/Form/elements/MultiselectElement.mjs +1 -1
- package/dist/components/Form/elements/SelectElement.cjs +1 -1
- package/dist/components/Form/elements/SelectElement.d.ts.map +1 -1
- package/dist/components/Form/elements/SelectElement.mjs +1 -1
- package/dist/components/Form/elements/SwitchSelectorElement.cjs +1 -1
- package/dist/components/Form/elements/SwitchSelectorElement.mjs +1 -1
- package/dist/components/Form/elements/TextAreaElement.cjs +1 -1
- package/dist/components/Form/elements/TextAreaElement.mjs +1 -1
- package/dist/components/Form/elements/index.cjs +1 -1
- package/dist/components/Form/elements/index.mjs +1 -1
- package/dist/components/Form/index.cjs +1 -1
- package/dist/components/Form/index.mjs +1 -1
- package/dist/components/Form/layout/FormItemLayout.cjs +1 -1
- package/dist/components/Form/layout/FormItemLayout.d.ts.map +1 -1
- package/dist/components/Form/layout/FormItemLayout.mjs +1 -1
- package/dist/components/Form/layout/index.cjs +1 -1
- package/dist/components/Form/layout/index.mjs +1 -1
- package/dist/components/IDE/Code.cjs +77 -0
- package/dist/components/IDE/Code.cjs.map +1 -0
- package/dist/components/IDE/Code.d.ts +18 -0
- package/dist/components/IDE/Code.d.ts.map +1 -0
- package/dist/components/IDE/Code.mjs +77 -0
- package/dist/components/IDE/Code.mjs.map +1 -0
- package/dist/components/IDE/CodeBlock.cjs +54 -0
- package/dist/components/IDE/CodeBlock.cjs.map +1 -0
- package/dist/components/IDE/CodeBlock.d.ts +12 -0
- package/dist/components/IDE/CodeBlock.d.ts.map +1 -0
- package/dist/components/IDE/CodeBlock.mjs +54 -0
- package/dist/components/IDE/CodeBlock.mjs.map +1 -0
- package/dist/components/IDE/CodeBlockClient.cjs +55 -0
- package/dist/components/IDE/CodeBlockClient.cjs.map +1 -0
- package/dist/components/IDE/CodeBlockClient.mjs +55 -0
- package/dist/components/IDE/CodeBlockClient.mjs.map +1 -0
- package/dist/components/IDE/CodeBlockLoader.cjs +28 -0
- package/dist/components/IDE/CodeBlockLoader.cjs.map +1 -0
- package/dist/components/IDE/CodeBlockLoader.d.ts +4 -0
- package/dist/components/IDE/CodeBlockLoader.d.ts.map +1 -0
- package/dist/components/IDE/CodeBlockLoader.mjs +28 -0
- package/dist/components/IDE/CodeBlockLoader.mjs.map +1 -0
- package/dist/components/IDE/CodeBlockServer.cjs +53 -0
- package/dist/components/IDE/CodeBlockServer.cjs.map +1 -0
- package/dist/components/IDE/CodeBlockServer.d.ts +12 -0
- package/dist/components/IDE/CodeBlockServer.d.ts.map +1 -0
- package/dist/components/IDE/CodeBlockServer.mjs +53 -0
- package/dist/components/IDE/CodeBlockServer.mjs.map +1 -0
- package/dist/components/IDE/CodeBlockShiki.d.ts +3 -0
- package/dist/components/IDE/CodeBlockShiki.d.ts.map +1 -0
- package/dist/components/IDE/CodeBlockclient.d.ts +12 -0
- package/dist/components/IDE/CodeBlockclient.d.ts.map +1 -0
- package/dist/components/IDE/CodeConditionalRenderer.cjs +20 -0
- package/dist/components/IDE/CodeConditionalRenderer.cjs.map +1 -0
- package/dist/components/IDE/CodeConditionalRenderer.d.ts +4 -0
- package/dist/components/IDE/CodeConditionalRenderer.d.ts.map +1 -0
- package/dist/components/IDE/CodeConditionalRenderer.mjs +20 -0
- package/dist/components/IDE/CodeConditionalRenderer.mjs.map +1 -0
- package/dist/components/IDE/CodeContext.cjs +57 -0
- package/dist/components/IDE/CodeContext.cjs.map +1 -0
- package/dist/components/IDE/CodeContext.d.ts +26 -0
- package/dist/components/IDE/CodeContext.d.ts.map +1 -0
- package/dist/components/IDE/CodeContext.mjs +57 -0
- package/dist/components/IDE/CodeContext.mjs.map +1 -0
- package/dist/components/IDE/CodeFormatSelector.cjs +30 -0
- package/dist/components/IDE/CodeFormatSelector.cjs.map +1 -0
- package/dist/components/IDE/CodeFormatSelector.d.ts +3 -0
- package/dist/components/IDE/CodeFormatSelector.d.ts.map +1 -0
- package/dist/components/IDE/CodeFormatSelector.mjs +30 -0
- package/dist/components/IDE/CodeFormatSelector.mjs.map +1 -0
- package/dist/components/IDE/CodeRenderer.cjs +27 -0
- package/dist/components/IDE/CodeRenderer.cjs.map +1 -0
- package/dist/components/IDE/CodeRenderer.d.ts +5 -0
- package/dist/components/IDE/CodeRenderer.d.ts.map +1 -0
- package/dist/components/IDE/CodeRenderer.mjs +27 -0
- package/dist/components/IDE/CodeRenderer.mjs.map +1 -0
- package/dist/components/IDE/ContentDeclarationFormatSelector.cjs +28 -0
- package/dist/components/IDE/ContentDeclarationFormatSelector.cjs.map +1 -0
- package/dist/components/IDE/ContentDeclarationFormatSelector.d.ts +3 -0
- package/dist/components/IDE/ContentDeclarationFormatSelector.d.ts.map +1 -0
- package/dist/components/IDE/ContentDeclarationFormatSelector.mjs +28 -0
- package/dist/components/IDE/ContentDeclarationFormatSelector.mjs.map +1 -0
- package/dist/components/IDE/EditableCodeBlock.d.ts +9 -0
- package/dist/components/IDE/EditableCodeBlock.d.ts.map +1 -0
- package/dist/components/IDE/MarkDownRender.cjs +2 -3
- package/dist/components/IDE/MarkDownRender.cjs.map +1 -1
- package/dist/components/IDE/MarkDownRender.d.ts.map +1 -1
- package/dist/components/IDE/MarkDownRender.mjs +1 -2
- package/dist/components/IDE/MarkDownRender.mjs.map +1 -1
- package/dist/components/IDE/PackageManagerSelector.cjs +20 -0
- package/dist/components/IDE/PackageManagerSelector.cjs.map +1 -0
- package/dist/components/IDE/PackageManagerSelector.d.ts +3 -0
- package/dist/components/IDE/PackageManagerSelector.d.ts.map +1 -0
- package/dist/components/IDE/PackageManagerSelector.mjs +20 -0
- package/dist/components/IDE/PackageManagerSelector.mjs.map +1 -0
- package/dist/components/IDE/index.cjs +2 -2
- package/dist/components/IDE/index.d.ts +1 -1
- package/dist/components/IDE/index.d.ts.map +1 -1
- package/dist/components/IDE/index.mjs +1 -1
- package/dist/components/Link/Link.cjs +3 -4
- package/dist/components/Link/Link.cjs.map +1 -1
- package/dist/components/Link/Link.d.ts +1 -1
- package/dist/components/Link/Link.d.ts.map +1 -1
- package/dist/components/Link/Link.mjs +3 -4
- package/dist/components/Link/Link.mjs.map +1 -1
- package/dist/components/Loader/index.cjs +6 -1
- package/dist/components/Loader/index.cjs.map +1 -1
- package/dist/components/Loader/index.content.cjs +23 -0
- package/dist/components/Loader/index.content.cjs.map +1 -0
- package/dist/components/Loader/index.content.d.ts +8 -0
- package/dist/components/Loader/index.content.d.ts.map +1 -0
- package/dist/components/Loader/index.content.mjs +23 -0
- package/dist/components/Loader/index.content.mjs.map +1 -0
- package/dist/components/Loader/index.d.ts +2 -2
- package/dist/components/Loader/index.d.ts.map +1 -1
- package/dist/components/Loader/index.mjs +6 -1
- package/dist/components/Loader/index.mjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSelectorContext.d.ts +13 -0
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSelectorContext.d.ts.map +1 -0
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs +218 -0
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs.map +1 -0
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.d.ts +8 -0
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.d.ts.map +1 -0
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +218 -0
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs.map +1 -0
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs +42 -0
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs.map +1 -0
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.d.ts +15 -0
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.d.ts.map +1 -0
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs +42 -0
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs.map +1 -0
- package/dist/components/LocaleSwitcherContentDropDown/index.cjs +8 -0
- package/dist/components/LocaleSwitcherContentDropDown/index.cjs.map +1 -0
- package/dist/components/LocaleSwitcherContentDropDown/index.d.ts +3 -0
- package/dist/components/LocaleSwitcherContentDropDown/index.d.ts.map +1 -0
- package/dist/components/LocaleSwitcherContentDropDown/index.mjs +8 -0
- package/dist/components/LocaleSwitcherContentDropDown/index.mjs.map +1 -0
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.cjs +118 -0
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.cjs.map +1 -0
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts +18 -0
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts.map +1 -0
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.mjs +119 -0
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.mjs.map +1 -0
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.cjs +14 -22
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.cjs.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.d.ts.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs +14 -22
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs.map +1 -1
- package/dist/components/MarkDownRender/index.cjs +59 -30
- package/dist/components/MarkDownRender/index.cjs.map +1 -1
- package/dist/components/MarkDownRender/index.d.ts +2 -0
- package/dist/components/MarkDownRender/index.d.ts.map +1 -1
- package/dist/components/MarkDownRender/index.mjs +60 -31
- package/dist/components/MarkDownRender/index.mjs.map +1 -1
- package/dist/components/Modal/Modal.cjs +21 -13
- package/dist/components/Modal/Modal.cjs.map +1 -1
- package/dist/components/Modal/Modal.d.ts +2 -2
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Modal/Modal.mjs +22 -14
- package/dist/components/Modal/Modal.mjs.map +1 -1
- package/dist/components/SwitchSelector/index.cjs +4 -0
- package/dist/components/SwitchSelector/index.cjs.map +1 -1
- package/dist/components/SwitchSelector/index.d.ts.map +1 -1
- package/dist/components/SwitchSelector/index.mjs +5 -1
- package/dist/components/SwitchSelector/index.mjs.map +1 -1
- package/dist/components/index.cjs +17 -5
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.ts +3 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.mjs +16 -4
- package/dist/components/index.mjs.map +1 -1
- package/dist/hooks/index.cjs +9 -1
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.mjs +10 -2
- package/dist/hooks/intlayerAPIHooks.cjs +82 -5
- package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
- package/dist/hooks/intlayerAPIHooks.d.ts +13 -2
- package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
- package/dist/hooks/intlayerAPIHooks.mjs +82 -5
- package/dist/hooks/intlayerAPIHooks.mjs.map +1 -1
- package/dist/hooks/useAsync/useAsync.cjs +81 -78
- package/dist/hooks/useAsync/useAsync.cjs.map +1 -1
- package/dist/hooks/useAsync/useAsync.d.ts +5 -25
- package/dist/hooks/useAsync/useAsync.d.ts.map +1 -1
- package/dist/hooks/useAsync/useAsync.mjs +81 -78
- package/dist/hooks/useAsync/useAsync.mjs.map +1 -1
- package/dist/hooks/useAsync/useAsyncStateStore.cjs +3 -7
- package/dist/hooks/useAsync/useAsyncStateStore.cjs.map +1 -1
- package/dist/hooks/useAsync/useAsyncStateStore.d.ts +1 -1
- package/dist/hooks/useAsync/useAsyncStateStore.d.ts.map +1 -1
- package/dist/hooks/useAsync/useAsyncStateStore.mjs +3 -7
- package/dist/hooks/useAsync/useAsyncStateStore.mjs.map +1 -1
- package/dist/hooks/useGetAllDictionaries.cjs +5 -3
- package/dist/hooks/useGetAllDictionaries.cjs.map +1 -1
- package/dist/hooks/useGetAllDictionaries.d.ts +4 -1
- package/dist/hooks/useGetAllDictionaries.d.ts.map +1 -1
- package/dist/hooks/useGetAllDictionaries.mjs +5 -3
- package/dist/hooks/useGetAllDictionaries.mjs.map +1 -1
- package/dist/hooks/useIntlayerAPI.d.ts +12 -2
- package/dist/hooks/useIntlayerAPI.d.ts.map +1 -1
- package/dist/hooks/usePersistedStore.cjs +22 -8
- package/dist/hooks/usePersistedStore.cjs.map +1 -1
- package/dist/hooks/usePersistedStore.d.ts.map +1 -1
- package/dist/hooks/usePersistedStore.mjs +22 -8
- package/dist/hooks/usePersistedStore.mjs.map +1 -1
- package/dist/libs/intlayer-api/ai.cjs +43 -3
- package/dist/libs/intlayer-api/ai.cjs.map +1 -1
- package/dist/libs/intlayer-api/ai.d.ts +11 -3
- package/dist/libs/intlayer-api/ai.d.ts.map +1 -1
- package/dist/libs/intlayer-api/ai.mjs +43 -3
- package/dist/libs/intlayer-api/ai.mjs.map +1 -1
- package/dist/libs/intlayer-api/dictionary.cjs +2 -2
- package/dist/libs/intlayer-api/dictionary.cjs.map +1 -1
- package/dist/libs/intlayer-api/dictionary.d.ts +3 -3
- package/dist/libs/intlayer-api/dictionary.d.ts.map +1 -1
- package/dist/libs/intlayer-api/dictionary.mjs +2 -2
- package/dist/libs/intlayer-api/dictionary.mjs.map +1 -1
- package/dist/libs/intlayer-api/index.cjs +3 -1
- package/dist/libs/intlayer-api/index.cjs.map +1 -1
- package/dist/libs/intlayer-api/index.d.ts +24 -4
- package/dist/libs/intlayer-api/index.d.ts.map +1 -1
- package/dist/libs/intlayer-api/index.mjs +3 -1
- package/dist/libs/intlayer-api/index.mjs.map +1 -1
- package/dist/libs/intlayer-api/tag.cjs +52 -0
- package/dist/libs/intlayer-api/tag.cjs.map +1 -0
- package/dist/libs/intlayer-api/tag.d.ts +16 -0
- package/dist/libs/intlayer-api/tag.d.ts.map +1 -0
- package/dist/libs/intlayer-api/tag.mjs +52 -0
- package/dist/libs/intlayer-api/tag.mjs.map +1 -0
- package/dist/tailwind.css +1 -1
- package/package.json +18 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeTypeSelector.mjs","sources":["../../../src/components/DictionaryFieldEditor/NodeTypeSelector.tsx"],"sourcesContent":["'use client';\n\nimport { getConfiguration } from '@intlayer/config/client';\nimport {\n type DictionaryValue,\n type EnumerationContent,\n type KeyPath,\n NodeType,\n type TranslationContent,\n} from '@intlayer/core';\nimport { type FC, useEffect, useState } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { getSectionType } from '../../utils/dictionary';\nimport { useEditedContentStore } from '../DictionaryEditor';\nimport { Select } from '../Select';\nimport { nodeTypeSelectorContent } from './nodeTypeSelector.content';\n\ntype NodeTypeSelectorProps = {\n keyPath: KeyPath[];\n dictionaryKey: string;\n section: DictionaryValue;\n};\n\nexport const NodeTypeSelector: FC<NodeTypeSelectorProps> = ({\n keyPath,\n dictionaryKey,\n section,\n}) => {\n const {\n multilingualText,\n text,\n node,\n array,\n enumeration,\n triggerPlaceHolder,\n } = useDictionary(nodeTypeSelectorContent);\n const nodeType = getSectionType(section);\n const [keyType, setKeyType] = useState<NodeType>(nodeType);\n const { addEditedContent } = useEditedContentStore(\n useShallow((s) => ({\n addEditedContent: s.addEditedContent,\n }))\n );\n const { locales } = getConfiguration().internationalization;\n\n const onValueChange = (keyType: NodeType) => {\n setKeyType(keyType);\n\n switch (keyType) {\n case NodeType.Translation:\n addEditedContent(\n dictionaryKey,\n {\n nodeType: NodeType.Translation,\n [NodeType.Translation]: Object.assign(\n {},\n ...locales.map((locale) => ({\n [locale]: '',\n }))\n ),\n } as TranslationContent<DictionaryValue>,\n keyPath\n );\n break;\n case NodeType.Enumeration:\n addEditedContent(\n dictionaryKey,\n {\n nodeType: NodeType.Enumeration,\n [NodeType.Enumeration]: {\n '1': '',\n '>1': '',\n },\n } as EnumerationContent<DictionaryValue>,\n keyPath\n );\n break;\n case NodeType.Object:\n addEditedContent(dictionaryKey, {}, keyPath);\n break;\n case NodeType.Array:\n addEditedContent(dictionaryKey, [''], keyPath);\n break;\n case NodeType.Text:\n addEditedContent(dictionaryKey, '', keyPath);\n break;\n default:\n addEditedContent(dictionaryKey, {}, keyPath);\n }\n };\n\n useEffect(() => {\n setKeyType(nodeType);\n }, [nodeType]);\n\n return (\n <Select value={keyType} onValueChange={onValueChange}>\n <Select.Trigger className=\"w-40\">\n <Select.Value placeholder={triggerPlaceHolder
|
|
1
|
+
{"version":3,"file":"NodeTypeSelector.mjs","sources":["../../../src/components/DictionaryFieldEditor/NodeTypeSelector.tsx"],"sourcesContent":["'use client';\n\nimport { getConfiguration } from '@intlayer/config/client';\nimport {\n type DictionaryValue,\n type EnumerationContent,\n type KeyPath,\n NodeType,\n type TranslationContent,\n} from '@intlayer/core';\nimport { type FC, useEffect, useState } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { getSectionType } from '../../utils/dictionary';\nimport { useEditedContentStore } from '../DictionaryEditor';\nimport { Select } from '../Select';\nimport { nodeTypeSelectorContent } from './nodeTypeSelector.content';\n\ntype NodeTypeSelectorProps = {\n keyPath: KeyPath[];\n dictionaryKey: string;\n section: DictionaryValue;\n};\n\nexport const NodeTypeSelector: FC<NodeTypeSelectorProps> = ({\n keyPath,\n dictionaryKey,\n section,\n}) => {\n const {\n multilingualText,\n text,\n node,\n array,\n enumeration,\n triggerPlaceHolder,\n } = useDictionary(nodeTypeSelectorContent);\n const nodeType = getSectionType(section);\n const [keyType, setKeyType] = useState<NodeType>(nodeType);\n const { addEditedContent } = useEditedContentStore(\n useShallow((s) => ({\n addEditedContent: s.addEditedContent,\n }))\n );\n const { locales } = getConfiguration().internationalization;\n\n const onValueChange = (keyType: NodeType) => {\n setKeyType(keyType);\n\n switch (keyType) {\n case NodeType.Translation:\n addEditedContent(\n dictionaryKey,\n {\n nodeType: NodeType.Translation,\n [NodeType.Translation]: Object.assign(\n {},\n ...locales.map((locale) => ({\n [locale]: '',\n }))\n ),\n } as TranslationContent<DictionaryValue>,\n keyPath\n );\n break;\n case NodeType.Enumeration:\n addEditedContent(\n dictionaryKey,\n {\n nodeType: NodeType.Enumeration,\n [NodeType.Enumeration]: {\n '1': '',\n '>1': '',\n },\n } as EnumerationContent<DictionaryValue>,\n keyPath\n );\n break;\n case NodeType.Object:\n addEditedContent(dictionaryKey, {}, keyPath);\n break;\n case NodeType.Array:\n addEditedContent(dictionaryKey, [''], keyPath);\n break;\n case NodeType.Text:\n addEditedContent(dictionaryKey, '', keyPath);\n break;\n default:\n addEditedContent(dictionaryKey, {}, keyPath);\n }\n };\n\n useEffect(() => {\n setKeyType(nodeType);\n }, [nodeType]);\n\n return (\n <Select value={keyType} onValueChange={onValueChange}>\n <Select.Trigger className=\"w-40\">\n <Select.Value placeholder={triggerPlaceHolder} />\n </Select.Trigger>\n <Select.Content>\n <Select.Item value={NodeType.Translation}>\n {multilingualText}\n </Select.Item>\n <Select.Item value={NodeType.Text}>{text}</Select.Item>\n <Select.Item value={NodeType.Object}>{node}</Select.Item>\n <Select.Item value={NodeType.Array}>{array}</Select.Item>\n <Select.Item value={NodeType.Enumeration}>{enumeration}</Select.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yBAAA,eAAe,IAAI,OAAO;AAC3C;AAAA,MACF;AACmB,yBAAA,eAAe,CAAC,GAAG,OAAO;AAAA,IAAA;AAAA,EAEjD;AAEA,YAAU,MAAM;AACd,eAAW,QAAQ;AAAA,EAAA,GAClB,CAAC,QAAQ,CAAC;AAEb,SACGC,kCAAAA,KAAA,QAAA,EAAO,OAAO,SAAS,eACtB,UAAA;AAAA,IAACC,kCAAAA,IAAA,OAAO,SAAP,EAAe,WAAU,QACxB,UAACA,sCAAA,OAAO,OAAP,EAAa,aAAa,mBAAA,CAAoB,EACjD,CAAA;AAAA,IACAD,kCAAAA,KAAC,OAAO,SAAP,EACC,UAAA;AAAA,MAAAC,sCAAC,OAAO,MAAP,EAAY,OAAO,SAAS,aAC1B,UACH,kBAAA;AAAA,4CACC,OAAO,MAAP,EAAY,OAAO,SAAS,MAAO,UAAK,MAAA;AAAA,4CACxC,OAAO,MAAP,EAAY,OAAO,SAAS,QAAS,UAAK,MAAA;AAAA,4CAC1C,OAAO,MAAP,EAAY,OAAO,SAAS,OAAQ,UAAM,OAAA;AAAA,4CAC1C,OAAO,MAAP,EAAY,OAAO,SAAS,aAAc,UAAY,YAAA,CAAA;AAAA,IAAA,EACzD,CAAA;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -12,7 +12,7 @@ require("../../Button/Button.cjs");
|
|
|
12
12
|
require("../../Auth/ExternalsLoginButtons/externalsLoginButtons.content.cjs");
|
|
13
13
|
const components_Form_FormBase = require("../../Form/FormBase.cjs");
|
|
14
14
|
require("../../Form/FormField.cjs");
|
|
15
|
-
const components_Form_layout_FormItemLayout = require("../../../Form-
|
|
15
|
+
const components_Form_layout_FormItemLayout = require("../../../Form-7BqwvjVI.cjs");
|
|
16
16
|
require("../../Auth/SignInForm/signIn.content.cjs");
|
|
17
17
|
require("zod");
|
|
18
18
|
require("../../Auth/SignInForm/useSignInSchema.content.cjs");
|
|
@@ -43,7 +43,7 @@ const SaveForm = ({ dictionary }) => {
|
|
|
43
43
|
const { pushDictionaries } = hooks_intlayerAPIHooks.usePushDictionaries();
|
|
44
44
|
const SaveFormSchema = components_DictionaryFieldEditor_SaveForm_SaveFormSchema.getSaveFormSchema();
|
|
45
45
|
const { online } = hooks_useGetAllDictionaries.useGetAllDictionaries();
|
|
46
|
-
const { isLoading: isAuditing,
|
|
46
|
+
const { isLoading: isAuditing, auditContentDeclaration } = hooks_intlayerAPIHooks.useAuditContentDeclaration();
|
|
47
47
|
const { editedContent, restoreEditedContent, setEditedContent } = components_DictionaryEditor_useEditedContentStore.useEditedContentStore(
|
|
48
48
|
shallow.useShallow((s) => ({
|
|
49
49
|
editedContent: s.editedContent,
|
|
@@ -78,7 +78,7 @@ const SaveForm = ({ dictionary }) => {
|
|
|
78
78
|
}
|
|
79
79
|
]);
|
|
80
80
|
}, [dictionary, editedContent, pushDictionaries]);
|
|
81
|
-
const handleOnAuditFile = async () => await
|
|
81
|
+
const handleOnAuditFile = async () => await auditContentDeclaration({
|
|
82
82
|
defaultLocale: project?.defaultLocale ?? intlayer.Locales.ENGLISH,
|
|
83
83
|
locales: project?.locales ?? [intlayer.Locales.ENGLISH],
|
|
84
84
|
fileContent: JSON.stringify(editedDictionary ?? dictionary)
|
|
@@ -89,7 +89,6 @@ const SaveForm = ({ dictionary }) => {
|
|
|
89
89
|
);
|
|
90
90
|
setEditedContent(dictionary.key, editedDictionary2.content);
|
|
91
91
|
});
|
|
92
|
-
console.log("isLoading", isAuditing);
|
|
93
92
|
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
|
|
94
93
|
components_Form_layout_FormItemLayout.Form,
|
|
95
94
|
{
|
|
@@ -123,7 +122,6 @@ const SaveForm = ({ dictionary }) => {
|
|
|
123
122
|
variant: "outline",
|
|
124
123
|
color: "text",
|
|
125
124
|
className: "max-md:w-full",
|
|
126
|
-
isLoading: isSubmitting,
|
|
127
125
|
onClick: () => restoreEditedContent(dictionary.key),
|
|
128
126
|
children: resetButton.text
|
|
129
127
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport { Locales } from 'intlayer';\nimport { ArrowUpFromLine, RotateCcw, Save, WandSparkles } from 'lucide-react';\nimport { useCallback, useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { useAuth } from '../../../components/Auth';\nimport {\n
|
|
1
|
+
{"version":3,"file":"SaveForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport { Locales } from 'intlayer';\nimport { ArrowUpFromLine, RotateCcw, Save, WandSparkles } from 'lucide-react';\nimport { useCallback, useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { useAuth } from '../../../components/Auth';\nimport {\n useAuditContentDeclaration,\n useGetAllDictionaries,\n usePushDictionaries,\n} from '../../../hooks';\nimport { useEditedContentStore } from '../../DictionaryEditor';\nimport { Form, useForm } from '../../Form';\nimport { saveDictionaryContent } from './saveForm.content';\nimport { getSaveFormSchema } from './SaveFormSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n};\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({ dictionary }) => {\n const { session } = useAuth();\n const project = session?.project;\n const { pushDictionaries } = usePushDictionaries();\n const SaveFormSchema = getSaveFormSchema();\n const { online } = useGetAllDictionaries();\n const { isLoading: isAuditing, auditContentDeclaration } =\n useAuditContentDeclaration();\n\n const { editedContent, restoreEditedContent, setEditedContent } =\n useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n restoreEditedContent: s.restoreEditedContent,\n setEditedContent: s.setEditedContent,\n }))\n );\n const { form, isSubmitting } = useForm(SaveFormSchema);\n const { auditButton, resetButton, saveButton, publishButton } = useDictionary(\n saveDictionaryContent\n );\n\n const editedDictionary = useMemo(\n () => editedContent[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const onlineDictionary = useMemo(() => {\n return online?.[dictionary.key];\n }, [online, dictionary.key]);\n\n const isEdited = useMemo(\n () =>\n editedDictionary &&\n onlineDictionary &&\n JSON.stringify(editedDictionary.content) !==\n JSON.stringify(onlineDictionary.content),\n [onlineDictionary, editedDictionary]\n );\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = useCallback(async () => {\n await pushDictionaries([\n {\n ...dictionary,\n ...editedContent[dictionary.key],\n },\n ]);\n }, [dictionary, editedContent, pushDictionaries]);\n\n const handleOnAuditFile = async () =>\n await auditContentDeclaration({\n defaultLocale: project?.defaultLocale ?? Locales.ENGLISH,\n locales: project?.locales ?? [Locales.ENGLISH],\n fileContent: JSON.stringify(editedDictionary ?? dictionary),\n }).then((response) => {\n if (!response.data) return;\n\n const editedDictionary = JSON.parse(\n response.data.fileContent\n ) as Dictionary;\n\n setEditedContent(dictionary.key, editedDictionary.content);\n });\n\n return (\n <Form\n className=\"flex w-full flex-1 flex-row flex-wrap justify-end gap-3\"\n {...form}\n schema={SaveFormSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n <Form.Button\n type=\"button\"\n label={auditButton.label}\n disabled={isSubmitting}\n Icon={WandSparkles}\n variant=\"outline\"\n color=\"text\"\n className=\"ml-auto max-md:w-full\"\n isLoading={isAuditing}\n onClick={handleOnAuditFile}\n >\n {auditButton.text}\n </Form.Button>\n {isEdited && (\n <Form.Button\n type=\"button\"\n label={resetButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n className=\"max-md:w-full\"\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={ArrowUpFromLine}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n isEdited && (\n <Form.Button\n type=\"submit\"\n label={saveButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={Save}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )\n )}\n </Form>\n );\n};\n"],"names":["useAuth","usePushDictionaries","getSaveFormSchema","useGetAllDictionaries","useAuditContentDeclaration","useEditedContentStore","useShallow","useForm","useDictionary","saveDictionaryContent","useMemo","useCallback","Locales","editedDictionary","jsxs","Form","jsx","WandSparkles","RotateCcw","ArrowUpFromLine","Save"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBO,MAAM,WAAuC,CAAC,EAAE,iBAAiB;AAChE,QAAA,EAAE,QAAQ,IAAIA,sCAAQ;AAC5B,QAAM,UAAU,SAAS;AACnB,QAAA,EAAE,iBAAiB,IAAIC,2CAAoB;AACjD,QAAM,iBAAiBC,yDAAAA,kBAAkB;AACnC,QAAA,EAAE,OAAO,IAAIC,kDAAsB;AACzC,QAAM,EAAE,WAAW,YAAY,wBAAA,IAC7BC,uBAAAA,2BAA2B;AAE7B,QAAM,EAAE,eAAe,sBAAsB,iBAC3C,IAAAC,kDAAA;AAAA,IACEC,QAAA,WAAW,CAAC,OAAO;AAAA,MACjB,eAAe,EAAE;AAAA,MACjB,sBAAsB,EAAE;AAAA,MACxB,kBAAkB,EAAE;AAAA,IAAA,EACpB;AAAA,EACJ;AACF,QAAM,EAAE,MAAM,iBAAiBC,yBAAAA,QAAQ,cAAc;AACrD,Q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AEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveForm.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAG5C,OAAO,EAAwB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAetD,KAAK,sBAAsB,GAAG;IAC5B,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,sBAAsB,
|
|
1
|
+
{"version":3,"file":"SaveForm.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAG5C,OAAO,EAAwB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAetD,KAAK,sBAAsB,GAAG;IAC5B,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,sBAAsB,CAoI/C,CAAC"}
|
|
@@ -10,14 +10,14 @@ import "../../Button/Button.mjs";
|
|
|
10
10
|
import "../../Auth/ExternalsLoginButtons/externalsLoginButtons.content.mjs";
|
|
11
11
|
import { useForm } from "../../Form/FormBase.mjs";
|
|
12
12
|
import "../../Form/FormField.mjs";
|
|
13
|
-
import { F as Form } from "../../../Form-
|
|
13
|
+
import { F as Form } from "../../../Form-OK9zfg6E.js";
|
|
14
14
|
import "../../Auth/SignInForm/signIn.content.mjs";
|
|
15
15
|
import "zod";
|
|
16
16
|
import "../../Auth/SignInForm/useSignInSchema.content.mjs";
|
|
17
17
|
import "../../Auth/SignUpForm/useSignUpSchema.content.mjs";
|
|
18
18
|
import "../../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
|
|
19
19
|
import "../../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
20
|
-
import { usePushDictionaries,
|
|
20
|
+
import { usePushDictionaries, useAuditContentDeclaration } from "../../../hooks/intlayerAPIHooks.mjs";
|
|
21
21
|
import { useGetAllDictionaries } from "../../../hooks/useGetAllDictionaries.mjs";
|
|
22
22
|
import { useAuth } from "../../Auth/useAuth/index.mjs";
|
|
23
23
|
import "../../Auth/ChangePasswordForm/changePasswordForm.content.mjs";
|
|
@@ -41,7 +41,7 @@ const SaveForm = ({ dictionary }) => {
|
|
|
41
41
|
const { pushDictionaries } = usePushDictionaries();
|
|
42
42
|
const SaveFormSchema = getSaveFormSchema();
|
|
43
43
|
const { online } = useGetAllDictionaries();
|
|
44
|
-
const { isLoading: isAuditing,
|
|
44
|
+
const { isLoading: isAuditing, auditContentDeclaration } = useAuditContentDeclaration();
|
|
45
45
|
const { editedContent, restoreEditedContent, setEditedContent } = useEditedContentStore(
|
|
46
46
|
useShallow((s) => ({
|
|
47
47
|
editedContent: s.editedContent,
|
|
@@ -76,7 +76,7 @@ const SaveForm = ({ dictionary }) => {
|
|
|
76
76
|
}
|
|
77
77
|
]);
|
|
78
78
|
}, [dictionary, editedContent, pushDictionaries]);
|
|
79
|
-
const handleOnAuditFile = async () => await
|
|
79
|
+
const handleOnAuditFile = async () => await auditContentDeclaration({
|
|
80
80
|
defaultLocale: project?.defaultLocale ?? Locales.ENGLISH,
|
|
81
81
|
locales: project?.locales ?? [Locales.ENGLISH],
|
|
82
82
|
fileContent: JSON.stringify(editedDictionary ?? dictionary)
|
|
@@ -87,7 +87,6 @@ const SaveForm = ({ dictionary }) => {
|
|
|
87
87
|
);
|
|
88
88
|
setEditedContent(dictionary.key, editedDictionary2.content);
|
|
89
89
|
});
|
|
90
|
-
console.log("isLoading", isAuditing);
|
|
91
90
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
92
91
|
Form,
|
|
93
92
|
{
|
|
@@ -121,7 +120,6 @@ const SaveForm = ({ dictionary }) => {
|
|
|
121
120
|
variant: "outline",
|
|
122
121
|
color: "text",
|
|
123
122
|
className: "max-md:w-full",
|
|
124
|
-
isLoading: isSubmitting,
|
|
125
123
|
onClick: () => restoreEditedContent(dictionary.key),
|
|
126
124
|
children: resetButton.text
|
|
127
125
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport { Locales } from 'intlayer';\nimport { ArrowUpFromLine, RotateCcw, Save, WandSparkles } from 'lucide-react';\nimport { useCallback, useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { useAuth } from '../../../components/Auth';\nimport {\n
|
|
1
|
+
{"version":3,"file":"SaveForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport { Locales } from 'intlayer';\nimport { ArrowUpFromLine, RotateCcw, Save, WandSparkles } from 'lucide-react';\nimport { useCallback, useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { useAuth } from '../../../components/Auth';\nimport {\n useAuditContentDeclaration,\n useGetAllDictionaries,\n usePushDictionaries,\n} from '../../../hooks';\nimport { useEditedContentStore } from '../../DictionaryEditor';\nimport { Form, useForm } from '../../Form';\nimport { saveDictionaryContent } from './saveForm.content';\nimport { getSaveFormSchema } from './SaveFormSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n};\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({ dictionary }) => {\n const { session } = useAuth();\n const project = session?.project;\n const { pushDictionaries } = usePushDictionaries();\n const SaveFormSchema = getSaveFormSchema();\n const { online } = useGetAllDictionaries();\n const { isLoading: isAuditing, auditContentDeclaration } =\n useAuditContentDeclaration();\n\n const { editedContent, restoreEditedContent, setEditedContent } =\n useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n restoreEditedContent: s.restoreEditedContent,\n setEditedContent: s.setEditedContent,\n }))\n );\n const { form, isSubmitting } = useForm(SaveFormSchema);\n const { auditButton, resetButton, saveButton, publishButton } = useDictionary(\n saveDictionaryContent\n );\n\n const editedDictionary = useMemo(\n () => editedContent[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const onlineDictionary = useMemo(() => {\n return online?.[dictionary.key];\n }, [online, dictionary.key]);\n\n const isEdited = useMemo(\n () =>\n editedDictionary &&\n onlineDictionary &&\n JSON.stringify(editedDictionary.content) !==\n JSON.stringify(onlineDictionary.content),\n [onlineDictionary, editedDictionary]\n );\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = useCallback(async () => {\n await pushDictionaries([\n {\n ...dictionary,\n ...editedContent[dictionary.key],\n },\n ]);\n }, [dictionary, editedContent, pushDictionaries]);\n\n const handleOnAuditFile = async () =>\n await auditContentDeclaration({\n defaultLocale: project?.defaultLocale ?? Locales.ENGLISH,\n locales: project?.locales ?? [Locales.ENGLISH],\n fileContent: JSON.stringify(editedDictionary ?? dictionary),\n }).then((response) => {\n if (!response.data) return;\n\n const editedDictionary = JSON.parse(\n response.data.fileContent\n ) as Dictionary;\n\n setEditedContent(dictionary.key, editedDictionary.content);\n });\n\n return (\n <Form\n className=\"flex w-full flex-1 flex-row flex-wrap justify-end gap-3\"\n {...form}\n schema={SaveFormSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n <Form.Button\n type=\"button\"\n label={auditButton.label}\n disabled={isSubmitting}\n Icon={WandSparkles}\n variant=\"outline\"\n color=\"text\"\n className=\"ml-auto max-md:w-full\"\n isLoading={isAuditing}\n onClick={handleOnAuditFile}\n >\n {auditButton.text}\n </Form.Button>\n {isEdited && (\n <Form.Button\n type=\"button\"\n label={resetButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n className=\"max-md:w-full\"\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={ArrowUpFromLine}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n isEdited && (\n <Form.Button\n type=\"submit\"\n label={saveButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={Save}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )\n )}\n </Form>\n );\n};\n"],"names":["editedDictionary","jsxs","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBO,MAAM,WAAuC,CAAC,EAAE,iBAAiB;AAChE,QAAA,EAAE,QAAQ,IAAI,QAAQ;AAC5B,QAAM,UAAU,SAAS;AACnB,QAAA,EAAE,iBAAiB,IAAI,oBAAoB;AACjD,QAAM,iBAAiB,kBAAkB;AACnC,QAAA,EAAE,OAAO,IAAI,sBAAsB;AACzC,QAAM,EAAE,WAAW,YAAY,wBAAA,IAC7B,2BAA2B;AAE7B,QAAM,EAAE,eAAe,sBAAsB,iBAC3C,IAAA;AAAA,IACE,WAAW,CAAC,OAAO;AAAA,MACjB,eAAe,EAAE;AAAA,MACjB,sBAAsB,EAAE;AAAA,MACxB,kBAAkB,EAAE;AAAA,IAAA,EACpB;AAAA,EACJ;AACF,QAAM,EAAE,MAAM,iBAAiB,QAAQ,cAAc;AACrD,QAAM,EAAE,aAAa,aAAa,YAAY,cAAkB,IAAA;AAAA,IAC9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L;AAAA,YACC,MAAK;AAAA,YACL,OAAO,YAAY;AAAA,YACnB,UAAU;AAAA,YACV,MAAM;AAAA,YACN,SAAQ;AAAA,YACR,OAAM;AAAA,YACN,WAAU;AAAA,YACV,WAAW;AAAA,YACX,SAAS;AAAA,YAER,UAAY,YAAA;AAAA,UAAA;AAAA,QACf;AAAA,QACC,YACCA,kCAAA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,YAAY;AAAA,YACnB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAM;AAAA,YACN,SAAQ;AAAA,YACR,OAAM;AAAA,YACN,WAAU;AAAA,YACV,SAAS,MAAM,qBAAqB,WAAW,GAAG;AAAA,YAEjD,UAAY,YAAA;AAAA,UAAA;AAAA,QACf;AAAA,QAED,oBACCA,kCAAA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,cAAc;AAAA,YACrB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAM;AAAA,YACN,OAAM;AAAA,YACN,WAAU;AAAA,YACV,WAAW;AAAA,YAEV,UAAc,cAAA;AAAA,UAAA;AAAA,YAGjB,YACEA,kCAAA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,WAAW;AAAA,YAClB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAM;AAAA,YACN,OAAM;AAAA,YACN,WAAU;AAAA,YACV,WAAW;AAAA,YAEV,UAAW,WAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACd;AAAA,IAAA;AAAA,EAGN;AAEJ;"}
|
|
@@ -6,19 +6,19 @@ const saveDictionaryContent = {
|
|
|
6
6
|
content: {
|
|
7
7
|
auditButton: {
|
|
8
8
|
text: intlayer.t({
|
|
9
|
-
en: "Audit",
|
|
10
|
-
"en-GB": "Audit",
|
|
11
|
-
fr: "Auditer",
|
|
12
|
-
es: "Auditar",
|
|
13
|
-
de: "
|
|
14
|
-
ja: "
|
|
15
|
-
ko: "감사",
|
|
16
|
-
zh: "
|
|
17
|
-
it: "
|
|
18
|
-
pt: "Auditar",
|
|
19
|
-
hi: "ऑडिट",
|
|
20
|
-
ar: "التدقيق",
|
|
21
|
-
ru: "Отслеживание"
|
|
9
|
+
en: "Audit all content",
|
|
10
|
+
"en-GB": "Audit all content",
|
|
11
|
+
fr: "Auditer tout le contenu",
|
|
12
|
+
es: "Auditar todo el contenido",
|
|
13
|
+
de: "Allen Inhalt überprüfen",
|
|
14
|
+
ja: "すべてのコンテンツを監査する",
|
|
15
|
+
ko: "모든 콘텐츠 감사",
|
|
16
|
+
zh: "审核所有内容",
|
|
17
|
+
it: "Controlla tutto il contenuto",
|
|
18
|
+
pt: "Auditar todo o conteúdo",
|
|
19
|
+
hi: "सभी सामग्री ऑडिट करें",
|
|
20
|
+
ar: "التدقيق على كل المحتوى",
|
|
21
|
+
ru: "Отслеживание всего контента"
|
|
22
22
|
}),
|
|
23
23
|
label: intlayer.t({
|
|
24
24
|
en: "Audit",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saveForm.content.cjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/saveForm.content.tsx"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const saveDictionaryContent = {\n key: 'save-dictionary-details',\n content: {\n auditButton: {\n text: t({\n en: 'Audit',\n 'en-GB': 'Audit',\n fr: 'Auditer',\n es: 'Auditar',\n de: '
|
|
1
|
+
{"version":3,"file":"saveForm.content.cjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/saveForm.content.tsx"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const saveDictionaryContent = {\n key: 'save-dictionary-details',\n content: {\n auditButton: {\n text: t({\n en: 'Audit all content',\n 'en-GB': 'Audit all content',\n fr: 'Auditer tout le contenu',\n es: 'Auditar todo el contenido',\n de: 'Allen Inhalt überprüfen',\n ja: 'すべてのコンテンツを監査する',\n ko: '모든 콘텐츠 감사',\n zh: '审核所有内容',\n it: 'Controlla tutto il contenuto',\n pt: 'Auditar todo o conteúdo',\n hi: 'सभी सामग्री ऑडिट करें',\n ar: 'التدقيق على كل المحتوى',\n ru: 'Отслеживание всего контента',\n }),\n label: t({\n en: 'Audit',\n 'en-GB': 'Audit',\n fr: 'Auditer',\n es: 'Auditar',\n de: 'Prüfen',\n ja: '監査',\n ko: '감사',\n zh: '审核',\n it: 'Controllo',\n pt: 'Auditar',\n hi: 'ऑडिट',\n ar: 'التدقيق',\n ru: 'Отслеживание',\n }),\n },\n resetButton: {\n text: t({\n en: 'Reset all changes',\n 'en-GB': 'Reset all changes',\n fr: 'Réinitialiser toutes les modifications',\n es: 'Restablecer todas las modificaciones',\n de: 'Alle Änderungen zurücksetzen',\n ja: 'すべての変更をリセット',\n ko: '모든 변경 사항 초기화',\n zh: '重置所有更改',\n it: 'Reimposta tutte le modifiche',\n pt: 'Redefinir todas as alterações',\n hi: 'सभी परिवर्तनों को रीसेट करें',\n ar: 'إعادة تعيين جميع التغييرات',\n ru: 'Сбросить все изменения',\n }),\n label: t({\n en: 'Click to reset all the changes',\n 'en-GB': 'Click to reset all the changes',\n fr: 'Cliquez pour réinitialiser toutes les modifications',\n es: 'Haga clic para restablecer todas las modificaciones',\n de: 'Klicken Sie, um alle Änderungen zurückzusetzen',\n ja: 'すべての変更をリセットするにはクリックしてください',\n ko: '모든 변경 사항을 초기화하려면 클릭하세요',\n zh: '单击以重置所有更改',\n it: 'Fai clic per ripristinare tutte le modifiche',\n pt: 'Clique para redefinir todas as alterações',\n hi: 'सभी परिवर्तनों को रीसेट करने के लिए क्लिक करें',\n ar: 'انقر لإعادة تعيين جميع التغييرات',\n ru: 'Нажмите, чтобы сбросить все изменения',\n }),\n },\n saveButton: {\n text: t({\n en: 'Save changes',\n 'en-GB': 'Save changes',\n fr: 'Enregistrer les modifications',\n es: 'Guardar cambios',\n de: 'Änderungen speichern',\n ja: '変更を保存',\n ko: '변경 사항 저장',\n zh: '保存更改',\n it: 'Salva le modifiche',\n pt: 'Salvar alterações',\n hi: 'परिवर्तनों को सहेजें',\n ar: 'احفظ التغييرات',\n ru: 'Сохранить изменения',\n }),\n label: t({\n en: 'Click to save changes',\n 'en-GB': 'Click to save changes',\n fr: 'Cliquez pour enregistrer les modifications',\n es: 'Haga clic para guardar cambios',\n de: 'Klicken Sie, um Änderungen zu speichern',\n ja: '変更を保存するにはクリックしてください',\n ko: '변경 사항을 저장하려면 클릭하세요',\n zh: '单击保存更改',\n it: 'Fai clic per salvare le modifiche',\n pt: 'Clique para salvar alterações',\n hi: 'परिवर्तनों को सहेजने के लिए क्लिक करें',\n ar: 'انقر لحفظ التغييرات',\n ru: 'Нажмите, чтобы сохранить изменения',\n }),\n },\n publishButton: {\n text: t({\n en: 'Publish dictionary',\n 'en-GB': 'Publish dictionary',\n fr: 'Publier dictionnaire',\n es: 'Publicar diccionario',\n de: 'Wörterbuch veröffentlichen',\n ja: '辞書を公開',\n ko: '사전을 게시합니다',\n zh: '发布字典',\n it: 'Pubblica dizionario',\n pt: 'Publicar dicionário',\n hi: 'शब्दकोश प्रकाशित करें',\n ar: 'نشر القاموس',\n ru: 'Опубликовать словарь',\n }),\n label: t({\n en: 'Click to publish dictionary',\n 'en-GB': 'Click to publish dictionary',\n fr: 'Cliquez pour publier dictionnaire',\n es: 'Haga clic para publicar diccionario',\n de: 'Klicken Sie, um das Wörterbuch zu veröffentlichen',\n ja: '辞書を公開するにはクリックしてください',\n ko: '사전을 게시하려면 클릭하세요',\n zh: '单击以发布字典',\n it: 'Fai clic per pubblicare il dizionario',\n pt: 'Clique para publicar dicionário',\n hi: 'शब्दकोश प्रकाशित करने के लिए क्लिक करें',\n ar: 'انقر لنشر القاموس',\n ru: 'Нажмите, чтобы опубликовать словарь',\n }),\n },\n },\n} satisfies DeclarationContent;\n"],"names":["t"],"mappings":";;;AAEO,MAAM,wBAAwB;AAAA,EACnC,KAAK;AAAA,EACL,SAAS;AA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|
text: t({
|
|
7
|
-
en: "Audit",
|
|
8
|
-
"en-GB": "Audit",
|
|
9
|
-
fr: "Auditer",
|
|
10
|
-
es: "Auditar",
|
|
11
|
-
de: "
|
|
12
|
-
ja: "
|
|
13
|
-
ko: "감사",
|
|
14
|
-
zh: "
|
|
15
|
-
it: "
|
|
16
|
-
pt: "Auditar",
|
|
17
|
-
hi: "ऑडिट",
|
|
18
|
-
ar: "التدقيق",
|
|
19
|
-
ru: "Отслеживание"
|
|
7
|
+
en: "Audit all content",
|
|
8
|
+
"en-GB": "Audit all content",
|
|
9
|
+
fr: "Auditer tout le contenu",
|
|
10
|
+
es: "Auditar todo el contenido",
|
|
11
|
+
de: "Allen Inhalt überprüfen",
|
|
12
|
+
ja: "すべてのコンテンツを監査する",
|
|
13
|
+
ko: "모든 콘텐츠 감사",
|
|
14
|
+
zh: "审核所有内容",
|
|
15
|
+
it: "Controlla tutto il contenuto",
|
|
16
|
+
pt: "Auditar todo o conteúdo",
|
|
17
|
+
hi: "सभी सामग्री ऑडिट करें",
|
|
18
|
+
ar: "التدقيق على كل المحتوى",
|
|
19
|
+
ru: "Отслеживание всего контента"
|
|
20
20
|
}),
|
|
21
21
|
label: t({
|
|
22
22
|
en: "Audit",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saveForm.content.mjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/saveForm.content.tsx"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const saveDictionaryContent = {\n key: 'save-dictionary-details',\n content: {\n auditButton: {\n text: t({\n en: 'Audit',\n 'en-GB': 'Audit',\n fr: 'Auditer',\n es: 'Auditar',\n de: '
|
|
1
|
+
{"version":3,"file":"saveForm.content.mjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/saveForm.content.tsx"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const saveDictionaryContent = {\n key: 'save-dictionary-details',\n content: {\n auditButton: {\n text: t({\n en: 'Audit all content',\n 'en-GB': 'Audit all content',\n fr: 'Auditer tout le contenu',\n es: 'Auditar todo el contenido',\n de: 'Allen Inhalt überprüfen',\n ja: 'すべてのコンテンツを監査する',\n ko: '모든 콘텐츠 감사',\n zh: '审核所有内容',\n it: 'Controlla tutto il contenuto',\n pt: 'Auditar todo o conteúdo',\n hi: 'सभी सामग्री ऑडिट करें',\n ar: 'التدقيق على كل المحتوى',\n ru: 'Отслеживание всего контента',\n }),\n label: t({\n en: 'Audit',\n 'en-GB': 'Audit',\n fr: 'Auditer',\n es: 'Auditar',\n de: 'Prüfen',\n ja: '監査',\n ko: '감사',\n zh: '审核',\n it: 'Controllo',\n pt: 'Auditar',\n hi: 'ऑडिट',\n ar: 'التدقيق',\n ru: 'Отслеживание',\n }),\n },\n resetButton: {\n text: t({\n en: 'Reset all changes',\n 'en-GB': 'Reset all changes',\n fr: 'Réinitialiser toutes les modifications',\n es: 'Restablecer todas las modificaciones',\n de: 'Alle Änderungen zurücksetzen',\n ja: 'すべての変更をリセット',\n ko: '모든 변경 사항 초기화',\n zh: '重置所有更改',\n it: 'Reimposta tutte le modifiche',\n pt: 'Redefinir todas as alterações',\n hi: 'सभी परिवर्तनों को रीसेट करें',\n ar: 'إعادة تعيين جميع التغييرات',\n ru: 'Сбросить все изменения',\n }),\n label: t({\n en: 'Click to reset all the changes',\n 'en-GB': 'Click to reset all the changes',\n fr: 'Cliquez pour réinitialiser toutes les modifications',\n es: 'Haga clic para restablecer todas las modificaciones',\n de: 'Klicken Sie, um alle Änderungen zurückzusetzen',\n ja: 'すべての変更をリセットするにはクリックしてください',\n ko: '모든 변경 사항을 초기화하려면 클릭하세요',\n zh: '单击以重置所有更改',\n it: 'Fai clic per ripristinare tutte le modifiche',\n pt: 'Clique para redefinir todas as alterações',\n hi: 'सभी परिवर्तनों को रीसेट करने के लिए क्लिक करें',\n ar: 'انقر لإعادة تعيين جميع التغييرات',\n ru: 'Нажмите, чтобы сбросить все изменения',\n }),\n },\n saveButton: {\n text: t({\n en: 'Save changes',\n 'en-GB': 'Save changes',\n fr: 'Enregistrer les modifications',\n es: 'Guardar cambios',\n de: 'Änderungen speichern',\n ja: '変更を保存',\n ko: '변경 사항 저장',\n zh: '保存更改',\n it: 'Salva le modifiche',\n pt: 'Salvar alterações',\n hi: 'परिवर्तनों को सहेजें',\n ar: 'احفظ التغييرات',\n ru: 'Сохранить изменения',\n }),\n label: t({\n en: 'Click to save changes',\n 'en-GB': 'Click to save changes',\n fr: 'Cliquez pour enregistrer les modifications',\n es: 'Haga clic para guardar cambios',\n de: 'Klicken Sie, um Änderungen zu speichern',\n ja: '変更を保存するにはクリックしてください',\n ko: '변경 사항을 저장하려면 클릭하세요',\n zh: '单击保存更改',\n it: 'Fai clic per salvare le modifiche',\n pt: 'Clique para salvar alterações',\n hi: 'परिवर्तनों को सहेजने के लिए क्लिक करें',\n ar: 'انقر لحفظ التغييرات',\n ru: 'Нажмите, чтобы сохранить изменения',\n }),\n },\n publishButton: {\n text: t({\n en: 'Publish dictionary',\n 'en-GB': 'Publish dictionary',\n fr: 'Publier dictionnaire',\n es: 'Publicar diccionario',\n de: 'Wörterbuch veröffentlichen',\n ja: '辞書を公開',\n ko: '사전을 게시합니다',\n zh: '发布字典',\n it: 'Pubblica dizionario',\n pt: 'Publicar dicionário',\n hi: 'शब्दकोश प्रकाशित करें',\n ar: 'نشر القاموس',\n ru: 'Опубликовать словарь',\n }),\n label: t({\n en: 'Click to publish dictionary',\n 'en-GB': 'Click to publish dictionary',\n fr: 'Cliquez pour publier dictionnaire',\n es: 'Haga clic para publicar diccionario',\n de: 'Klicken Sie, um das Wörterbuch zu veröffentlichen',\n ja: '辞書を公開するにはクリックしてください',\n ko: '사전을 게시하려면 클릭하세요',\n zh: '单击以发布字典',\n it: 'Fai clic per pubblicare il dizionario',\n pt: 'Clique para publicar dicionário',\n hi: 'शब्दकोश प्रकाशित करने के लिए क्लिक करें',\n ar: 'انقر لنشر القاموس',\n ru: 'Нажмите, чтобы опуб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
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const jsxRuntime = require("../../../jsx-runtime-XHKiWCTo.cjs");
|
|
5
|
+
const lucideReact = require("lucide-react");
|
|
6
|
+
const reactIntlayer = require("react-intlayer");
|
|
7
|
+
const components_Button_Button = require("../../Button/Button.cjs");
|
|
8
|
+
const components_Container_index = require("../../Container/index.cjs");
|
|
9
|
+
const components_DropDown_index = require("../../DropDown/index.cjs");
|
|
10
|
+
const components_DictionaryFieldEditor_VersionSwitcherDropDown_VersionSwitcherContext = require("./VersionSwitcherContext.cjs");
|
|
11
|
+
const components_DictionaryFieldEditor_VersionSwitcherDropDown_versionSwitcherDropDown_content = require("./versionSwitcherDropDown.content.cjs");
|
|
12
|
+
const DROPDOWN_IDENTIFIER = "version-switcher";
|
|
13
|
+
const VersionSwitcher = ({ panelProps }) => {
|
|
14
|
+
const { switchTo, versionSwitcherLabel, versionListLabel } = reactIntlayer.useDictionary(
|
|
15
|
+
components_DictionaryFieldEditor_VersionSwitcherDropDown_versionSwitcherDropDown_content
|
|
16
|
+
);
|
|
17
|
+
const { selectedVersion, availableVersions, setSelectedVersion } = components_DictionaryFieldEditor_VersionSwitcherDropDown_VersionSwitcherContext.useVersionSwitcher();
|
|
18
|
+
if (availableVersions.length === 0) {
|
|
19
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment, {});
|
|
20
|
+
}
|
|
21
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
className: "border-text text-text dark:border-text-dark dark:text-text-dark rounded-xl border transition-colors",
|
|
25
|
+
"aria-label": versionListLabel,
|
|
26
|
+
children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(components_DropDown_index.DropDown, { identifier: DROPDOWN_IDENTIFIER, children: [
|
|
27
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_DropDown_index.DropDown.Trigger, { identifier: DROPDOWN_IDENTIFIER, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("div", { className: "flex w-full items-center justify-between", children: [
|
|
28
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("div", { className: "px-2", children: selectedVersion ?? "LTS" }),
|
|
29
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(lucideReact.MoveVertical, { className: "w-5 self-center" })
|
|
30
|
+
] }) }),
|
|
31
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
32
|
+
components_DropDown_index.DropDown.Panel,
|
|
33
|
+
{
|
|
34
|
+
identifier: DROPDOWN_IDENTIFIER,
|
|
35
|
+
isOverable: true,
|
|
36
|
+
isFocusable: true,
|
|
37
|
+
className: "left-auto right-0",
|
|
38
|
+
...panelProps,
|
|
39
|
+
children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
40
|
+
components_Container_index.Container,
|
|
41
|
+
{
|
|
42
|
+
className: "max-h-[80vh] min-w-28",
|
|
43
|
+
separator: "y",
|
|
44
|
+
role: "listbox",
|
|
45
|
+
transparency: "sm",
|
|
46
|
+
border: true,
|
|
47
|
+
roundedSize: "2xl",
|
|
48
|
+
borderColor: "text",
|
|
49
|
+
"aria-label": versionSwitcherLabel,
|
|
50
|
+
children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("ol", { className: "divide-text/20 dark:divide-text-dark/20 divide-y divide-dashed overflow-y-auto p-1", children: availableVersions.reverse().map((version) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("li", { className: "px-1.5 py-1", children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
51
|
+
components_Button_Button.Button,
|
|
52
|
+
{
|
|
53
|
+
onClick: () => setSelectedVersion(version),
|
|
54
|
+
label: `${switchTo} v${version}`,
|
|
55
|
+
isActive: selectedVersion === version,
|
|
56
|
+
variant: "hoverable",
|
|
57
|
+
color: "text",
|
|
58
|
+
isFullWidth: true,
|
|
59
|
+
textAlign: "left",
|
|
60
|
+
size: "sm",
|
|
61
|
+
children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("div", { className: "text-neutral dark:text-neutral-dark flex flex-1 flex-row items-center justify-between gap-3 px-2 py-1 text-sm", children: version })
|
|
62
|
+
}
|
|
63
|
+
) }, version)) })
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
] })
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
exports.VersionSwitcher = VersionSwitcher;
|
|
73
|
+
//# sourceMappingURL=VersionSwitcher.cjs.map
|
|
@@ -0,0 +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';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { Button } from '../../Button';\nimport { Container } from '../../Container';\nimport { DropDown, type PanelProps } from '../../DropDown';\nimport { useVersionSwitcher } from './VersionSwitcherContext';\nimport versionSwitcherContent from './versionSwitcherDropDown.content';\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 } = useDictionary(\n versionSwitcherContent\n );\n const { selectedVersion, availableVersions, setSelectedVersion } =\n useVersionSwitcher();\n\n if (availableVersions.length === 0) {\n return <></>;\n }\n\n return (\n <div\n className=\"border-text text-text dark:border-text-dark dark:text-text-dark rounded-xl border transition-colors\"\n aria-label={versionListLabel}\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}\n >\n <ol className=\"divide-text/20 dark:divide-text-dark/20 divide-y divide-dashed overflow-y-auto p-1\">\n {availableVersions.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=\"hoverable\"\n color=\"text\"\n isFullWidth\n textAlign=\"left\"\n size=\"sm\"\n >\n <div className=\"text-neutral dark:text-neutral-dark 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":["useDictionary","versionSwitcherContent","useVersionSwitcher","jsx","Fragment","jsxs","DropDown","MoveVertical","Container","Button"],"mappings":";;;;;;;;;;;AAgBA,MAAM,sBAAsB;AAErB,MAAM,kBAA4C,CAAC,EAAE,iBAAiB;AAC3E,QAAM,EAAE,UAAU,sBAAsB,iBAAqB,IAAAA,cAAA;AAAA,IAC3DC;AAAAA,EACF;AACA,QAAM,EAAE,iBAAiB,mBAAmB,mBAAA,IAC1CC,gFAAAA,mBAAmB;AAEjB,MAAA,kBAAkB,WAAW,GAAG;AAClC,WAASC,2BAAA,kBAAA,IAAAC,WAAA,kBAAA,UAAA,EA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N,aAAW;AAAA,oBACX,WAAU;AAAA,oBACV,MAAK;AAAA,oBAEL,UAACN,2BAAA,kBAAA,IAAA,OAAA,EAAI,WAAU,iHACZ,UACH,QAAA,CAAA;AAAA,kBAAA;AAAA,gBAAA,EACF,GAd+B,OAejC,CACD,EACH,CAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MACF,EACF,CAAA;AAAA,IAAA;AAAA,EACF;AAEJ;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { PanelProps } from '../../DropDown';
|
|
3
|
+
export type VersionSwitcherProps = {
|
|
4
|
+
panelProps?: Omit<PanelProps, 'identifier'>;
|
|
5
|
+
};
|
|
6
|
+
export declare const VersionSwitcher: FC<VersionSwitcherProps>;
|
|
7
|
+
//# sourceMappingURL=VersionSwitcher.d.ts.map
|
package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VersionSwitcher.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAKhC,OAAO,EAAY,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAI3D,MAAM,MAAM,oBAAoB,GAAG;IACjC,UAAU,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;CAC7C,CAAC;AAIF,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAkEpD,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { j as jsxRuntimeExports } from "../../../jsx-runtime-DaNGiM0W.js";
|
|
3
|
+
import { MoveVertical } from "lucide-react";
|
|
4
|
+
import { useDictionary } from "react-intlayer";
|
|
5
|
+
import { Button } from "../../Button/Button.mjs";
|
|
6
|
+
import { Container } from "../../Container/index.mjs";
|
|
7
|
+
import { DropDown } from "../../DropDown/index.mjs";
|
|
8
|
+
import { useVersionSwitcher } from "./VersionSwitcherContext.mjs";
|
|
9
|
+
import versionSwitcherContent from "./versionSwitcherDropDown.content.mjs";
|
|
10
|
+
const DROPDOWN_IDENTIFIER = "version-switcher";
|
|
11
|
+
const VersionSwitcher = ({ panelProps }) => {
|
|
12
|
+
const { switchTo, versionSwitcherLabel, versionListLabel } = useDictionary(
|
|
13
|
+
versionSwitcherContent
|
|
14
|
+
);
|
|
15
|
+
const { selectedVersion, availableVersions, setSelectedVersion } = useVersionSwitcher();
|
|
16
|
+
if (availableVersions.length === 0) {
|
|
17
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
|
|
18
|
+
}
|
|
19
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
className: "border-text text-text dark:border-text-dark dark:text-text-dark rounded-xl border transition-colors",
|
|
23
|
+
"aria-label": versionListLabel,
|
|
24
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(DropDown, { identifier: DROPDOWN_IDENTIFIER, children: [
|
|
25
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(DropDown.Trigger, { identifier: DROPDOWN_IDENTIFIER, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex w-full items-center justify-between", children: [
|
|
26
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-2", children: selectedVersion ?? "LTS" }),
|
|
27
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(MoveVertical, { className: "w-5 self-center" })
|
|
28
|
+
] }) }),
|
|
29
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
30
|
+
DropDown.Panel,
|
|
31
|
+
{
|
|
32
|
+
identifier: DROPDOWN_IDENTIFIER,
|
|
33
|
+
isOverable: true,
|
|
34
|
+
isFocusable: true,
|
|
35
|
+
className: "left-auto right-0",
|
|
36
|
+
...panelProps,
|
|
37
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38
|
+
Container,
|
|
39
|
+
{
|
|
40
|
+
className: "max-h-[80vh] min-w-28",
|
|
41
|
+
separator: "y",
|
|
42
|
+
role: "listbox",
|
|
43
|
+
transparency: "sm",
|
|
44
|
+
border: true,
|
|
45
|
+
roundedSize: "2xl",
|
|
46
|
+
borderColor: "text",
|
|
47
|
+
"aria-label": versionSwitcherLabel,
|
|
48
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("ol", { className: "divide-text/20 dark:divide-text-dark/20 divide-y divide-dashed overflow-y-auto p-1", children: availableVersions.reverse().map((version) => /* @__PURE__ */ jsxRuntimeExports.jsx("li", { className: "px-1.5 py-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
49
|
+
Button,
|
|
50
|
+
{
|
|
51
|
+
onClick: () => setSelectedVersion(version),
|
|
52
|
+
label: `${switchTo} v${version}`,
|
|
53
|
+
isActive: selectedVersion === version,
|
|
54
|
+
variant: "hoverable",
|
|
55
|
+
color: "text",
|
|
56
|
+
isFullWidth: true,
|
|
57
|
+
textAlign: "left",
|
|
58
|
+
size: "sm",
|
|
59
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-neutral dark:text-neutral-dark flex flex-1 flex-row items-center justify-between gap-3 px-2 py-1 text-sm", children: version })
|
|
60
|
+
}
|
|
61
|
+
) }, version)) })
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
] })
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
export {
|
|
71
|
+
VersionSwitcher
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=VersionSwitcher.mjs.map
|
|
@@ -0,0 +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';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { Button } from '../../Button';\nimport { Container } from '../../Container';\nimport { DropDown, type PanelProps } from '../../DropDown';\nimport { useVersionSwitcher } from './VersionSwitcherContext';\nimport versionSwitcherContent from './versionSwitcherDropDown.content';\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 } = useDictionary(\n versionSwitcherContent\n );\n const { selectedVersion, availableVersions, setSelectedVersion } =\n useVersionSwitcher();\n\n if (availableVersions.length === 0) {\n return <></>;\n }\n\n return (\n <div\n className=\"border-text text-text dark:border-text-dark dark:text-text-dark rounded-xl border transition-colors\"\n aria-label={versionListLabel}\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}\n >\n <ol className=\"divide-text/20 dark:divide-text-dark/20 divide-y divide-dashed overflow-y-auto p-1\">\n {availableVersions.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=\"hoverable\"\n color=\"text\"\n isFullWidth\n textAlign=\"left\"\n size=\"sm\"\n >\n <div className=\"text-neutral dark:text-neutral-dark 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":["jsx","Fragment","jsxs"],"mappings":";;;;;;;;;AAgBA,MAAM,sBAAsB;AAErB,MAAM,kBAA4C,CAAC,EAAE,iBAAiB;AAC3E,QAAM,EAAE,UAAU,sBAAsB,iBAAqB,IAAA;AAAA,IAC3D;AAAA,EACF;AACA,QAAM,EAAE,iBAAiB,mBAAmB,mBAAA,IAC1C,mBAAmB;AAEjB,MAAA,kBAAkB,WAAW,GAAG;AAClC,WAASA,kCAAA,IAAAC,kBAAA,UAAA,EAAA;AAAA,EAAA;AAIT,SAAAD,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,cAAY;AAAA,MAEZ,UAAAE,kCAAA,KAAC,UAAS,EAAA,YAAY,qBACpB,UAAA;AAAA,QAACF,kCAAAA,IAAA,SAAS,SAAT,EAAiB,YAAY,qBAC5B,UAACE,kCAAAA,KAAA,OAAA,EAAI,WAAU,4CACb,UAAA;AAAA,UAAAF,kCAAA,IAAC,OAAI,EAAA,WAAU,QAAQ,UAAA,mBAAmB,OAAM;AAAA,UAChDA,kCAAAA,IAAC,cAAa,EAAA,WAAU,kBAAkB,CAAA;AAAA,QAAA,EAAA,CAC5C,EACF,CAAA;AAAA,QAEAA,kCAAA;AAAA,UAAC,SAAS;AAAA,UAAT;AAAA,YACC,YAAY;AAAA,YACZ,YAAU;AAAA,YACV,aAAW;AAAA,YACX,WAAU;AAAA,YACT,GAAG;AAAA,YAEJ,UAAAA,kCAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAU;AAAA,gBACV,WAAU;AAAA,gBACV,MAAK;AAAA,gBACL,cAAa;AAAA,gBACb,QAAM;AAAA,gBACN,aAAY;AAAA,gBACZ,aAAY;AAAA,gBACZ,cAAY;AAAA,gBAEZ,UAACA,kCAAA,IAAA,MAAA,EAAG,WAAU,sFACX,UAAkB,kBAAA,QAAA,EAAU,IAAI,CAAC,YAC/BA,sCAAA,MAAA,EAAG,WAAU,eACZ,UAAAA,kCAAA;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,SAAS,MAAM,mBAAmB,OAAO;AAAA,oBACzC,OAAO,GAAG,QAAQ,KAAK,OAAO;AAAA,oBAC9B,UAAU,oBAAoB;AAAA,oBAC9B,SAAQ;AAAA,oBACR,OAAM;AAAA,oBACN,aAAW;AAAA,oBACX,WAAU;AAAA,oBACV,MAAK;AAAA,oBAEL,UAACA,kCAAA,IAAA,OAAA,EAAI,WAAU,iHACZ,UACH,QAAA,CAAA;AAAA,kBAAA;AAAA,gBAAA,EACF,GAd+B,OAejC,CACD,EACH,CAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MACF,EACF,CAAA;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const jsxRuntime = require("../../../jsx-runtime-XHKiWCTo.cjs");
|
|
5
|
+
const require$$0 = require("react");
|
|
6
|
+
require("../../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
|
|
7
|
+
require("../../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
8
|
+
require("../../../libs/intlayer-api/index.cjs");
|
|
9
|
+
require("@intlayer/config/client");
|
|
10
|
+
require("../../Toaster/Toast.cjs");
|
|
11
|
+
require("@intlayer/dictionaries-entry");
|
|
12
|
+
require("deepmerge");
|
|
13
|
+
const hooks_usePersistedStore = require("../../../hooks/usePersistedStore.cjs");
|
|
14
|
+
const VersionSwitcherContext = require$$0.createContext({
|
|
15
|
+
availableVersions: [],
|
|
16
|
+
selectedVersion: null,
|
|
17
|
+
setSelectedVersion: () => {
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const useVersionSwitcher = () => require$$0.useContext(VersionSwitcherContext);
|
|
21
|
+
const VersionSwitcherProvider = ({ availableVersions, defaultSelectedVersion, children }) => {
|
|
22
|
+
const [selectedVersion, setSelectedVersion] = hooks_usePersistedStore.usePersistedStore("version-selector", defaultSelectedVersion);
|
|
23
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
24
|
+
VersionSwitcherContext.Provider,
|
|
25
|
+
{
|
|
26
|
+
value: {
|
|
27
|
+
availableVersions,
|
|
28
|
+
selectedVersion,
|
|
29
|
+
setSelectedVersion
|
|
30
|
+
},
|
|
31
|
+
children
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
exports.VersionSwitcherProvider = VersionSwitcherProvider;
|
|
36
|
+
exports.useVersionSwitcher = useVersionSwitcher;
|
|
37
|
+
//# sourceMappingURL=VersionSwitcherContext.cjs.map
|
package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs.map
ADDED
|
@@ -0,0 +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 PropsWithChildren,\n type SetStateAction,\n type FC,\n} from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { usePersistedStore } from '../../../hooks';\n\ntype VersionSwitcherContextProps = {\n availableVersions: string[];\n selectedVersion: string | null;\n setSelectedVersion: Dispatch<SetStateAction<string | null>>;\n};\n\nconst VersionSwitcherContext = createContext<VersionSwitcherContextProps>({\n availableVersions: [],\n selectedVersion: null,\n setSelectedVersion: () => {},\n});\n\nexport const useVersionSwitcher = () => useContext(VersionSwitcherContext);\n\ntype VersionSwitcherProviderProps = {\n availableVersions: string[];\n defaultSelectedVersion?: string;\n};\n\nexport const VersionSwitcherProvider: FC<\n PropsWithChildren<VersionSwitcherProviderProps>\n> = ({ availableVersions, defaultSelectedVersion, children }) => {\n const [selectedVersion, setSelectedVersion] = usePersistedStore<\n string | null\n >('version-selector', defaultSelectedVersion);\n\n return (\n <VersionSwitcherContext.Provider\n value={{\n availableVersions,\n selectedVersion,\n setSelectedVersion,\n }}\n >\n {children}\n </VersionSwitcherContext.Provider>\n );\n};\n"],"names":["createContext","useContext","usePersistedStore","jsx"],"mappings":";;;;;;;;;;;;;AAmBA,MAAM,yBAAyBA,WAAAA,cAA2C;AAAA,EACxE,mBAAmB,CAAC;AAAA,EACpB,iBAAiB;AAAA,EACjB,oBAAoB,MAAM;AAAA,EAAA;AAC5B,CAAC;AAEY,MAAA,qBAAqB,MAAMC,WAAAA,WAAW,sBAAsB;AAOlE,MAAM,0BAET,CAAC,EAAE,mBAAmB,wBAAwB,eAAe;AAC/D,QAAM,CAAC,iBAAiB,kBAAkB,IAAIC,wBAAAA,kBAE5C,oBAAoB,sBAAsB;AAG1C,SAAAC,2BAAA,kBAAA;AAAA,IAAC,uBAAuB;AAAA,IAAvB;AAAA,MACC,OAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MAEC;AAAA,IAAA;AAAA,EACH;AAEJ;;;"}
|