@intlayer/design-system 3.5.5 → 3.5.6
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 +241 -17
- 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-BB0kpER9.cjs +301 -0
- package/dist/Form-BB0kpER9.cjs.map +1 -0
- package/dist/Form-BDcoNTLV.cjs.map +1 -1
- 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/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/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/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/DictionaryEditor/ValidDictionaryChangeButtons.cjs +3 -3
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs.map +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs +3 -3
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs +4 -2
- 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 +4 -2
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +161 -69
- 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 +163 -71
- 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 +12 -4
- 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 +12 -4
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs +7 -5
- 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 +7 -5
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs +117 -55
- 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 +115 -53
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs.map +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 +10 -10
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +10 -10
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeEditor.cjs +23 -10
- 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 +23 -10
- package/dist/components/DictionaryFieldEditor/NodeEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +2 -4
- 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 +3 -5
- 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/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/EditableFieldInputElement.d.ts +1 -1
- package/dist/components/Form/elements/EditableFieldInputElement.d.ts.map +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/SelectElement.d.ts.map +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/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 +20 -26
- 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 +20 -26
- package/dist/components/MarkDownRender/index.mjs.map +1 -1
- package/dist/components/Modal/Modal.cjs +3 -3
- package/dist/components/Modal/Modal.cjs.map +1 -1
- package/dist/components/Modal/Modal.d.ts +1 -1
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Modal/Modal.mjs +3 -3
- 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 +16 -4
- 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 +15 -3
- package/dist/components/index.mjs.map +1 -1
- package/dist/hooks/index.cjs +8 -1
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.mjs +9 -2
- package/dist/hooks/intlayerAPIHooks.cjs +80 -5
- package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
- package/dist/hooks/intlayerAPIHooks.d.ts +12 -2
- package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
- package/dist/hooks/intlayerAPIHooks.mjs +80 -5
- package/dist/hooks/intlayerAPIHooks.mjs.map +1 -1
- package/dist/hooks/useAsync/useAsyncStateStore.cjs +1 -5
- package/dist/hooks/useAsync/useAsyncStateStore.cjs.map +1 -1
- package/dist/hooks/useAsync/useAsyncStateStore.d.ts.map +1 -1
- package/dist/hooks/useAsync/useAsyncStateStore.mjs +1 -5
- package/dist/hooks/useAsync/useAsyncStateStore.mjs.map +1 -1
- package/dist/hooks/useGetAllDictionaries.cjs +4 -2
- 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 +4 -2
- package/dist/hooks/useGetAllDictionaries.mjs.map +1 -1
- package/dist/hooks/useIntlayerAPI.d.ts +11 -2
- package/dist/hooks/useIntlayerAPI.d.ts.map +1 -1
- package/dist/hooks/usePersistedStore.cjs +17 -5
- package/dist/hooks/usePersistedStore.cjs.map +1 -1
- package/dist/hooks/usePersistedStore.d.ts.map +1 -1
- package/dist/hooks/usePersistedStore.mjs +17 -5
- package/dist/hooks/usePersistedStore.mjs.map +1 -1
- package/dist/libs/intlayer-api/ai.cjs +33 -3
- package/dist/libs/intlayer-api/ai.cjs.map +1 -1
- package/dist/libs/intlayer-api/ai.d.ts +9 -3
- package/dist/libs/intlayer-api/ai.d.ts.map +1 -1
- package/dist/libs/intlayer-api/ai.mjs +33 -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 +22 -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 +13 -14
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
const ClickOutsideDiv = ({
|
|
7
|
+
children,
|
|
8
|
+
onClickOutSide,
|
|
9
|
+
...props
|
|
10
|
+
}) => {
|
|
11
|
+
const divRef = require$$0.useRef(null);
|
|
12
|
+
require$$0.useEffect(() => {
|
|
13
|
+
const handleClick = (event) => {
|
|
14
|
+
if (divRef.current && !divRef.current.contains(event.target)) {
|
|
15
|
+
onClickOutSide();
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
document.addEventListener("mousedown", handleClick);
|
|
19
|
+
return () => {
|
|
20
|
+
document.removeEventListener("mousedown", handleClick);
|
|
21
|
+
};
|
|
22
|
+
}, [onClickOutSide]);
|
|
23
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("div", { ref: divRef, ...props, children });
|
|
24
|
+
};
|
|
25
|
+
exports.ClickOutsideDiv = ClickOutsideDiv;
|
|
26
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/ClickOutsideDiv/index.tsx"],"sourcesContent":["'use client';\n\nimport {\n type FC,\n type PropsWithChildren,\n useRef,\n useEffect,\n HTMLAttributes,\n} from 'react';\n\nexport type ClickOutsideDivProps = PropsWithChildren<{\n onClickOutSide: () => void; // note: changed return type to `void`\n}> &\n HTMLAttributes<HTMLDivElement>;\n\nexport const ClickOutsideDiv: FC<ClickOutsideDivProps> = ({\n children,\n onClickOutSide,\n ...props\n}) => {\n const divRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const handleClick = (event: MouseEvent) => {\n // If clicking outside of the referenced element, call onClickOutSide\n if (divRef.current && !divRef.current.contains(event.target as Node)) {\n onClickOutSide();\n }\n };\n\n // Attach the event listener\n document.addEventListener('mousedown', handleClick);\n\n // Clean up on unmount\n return () => {\n document.removeEventListener('mousedown', handleClick);\n };\n }, [onClickOutSide]);\n\n return (\n <div ref={divRef} {...props}>\n {children}\n </div>\n );\n};\n"],"names":["useRef","useEffect"],"mappings":";;;;;AAeO,MAAM,kBAA4C,CAAC;AAAA,EACxD;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACE,QAAA,SAASA,kBAAuB,IAAI;AAE1CC,aAAAA,UAAU,MAAM;AACR,UAAA,cAAc,CAAC,UAAsB;AAErC,UAAA,OAAO,WAAW,CAAC,OAAO,QAAQ,SAAS,MAAM,MAAc,GAAG;AACrD,uBAAA;AAAA,MAAA;AAAA,IAEnB;AAGS,aAAA,iBAAiB,aAAa,WAAW;AAGlD,WAAO,MAAM;AACF,eAAA,oBAAoB,aAAa,WAAW;AAAA,IACvD;AAAA,EAAA,GACC,CAAC,cAAc,CAAC;AAEnB,0DACG,OAAI,EAAA,KAAK,QAAS,GAAG,OACnB,UACH;AAEJ;;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FC, PropsWithChildren, HTMLAttributes } from 'react';
|
|
2
|
+
export type ClickOutsideDivProps = PropsWithChildren<{
|
|
3
|
+
onClickOutSide: () => void;
|
|
4
|
+
}> & HTMLAttributes<HTMLDivElement>;
|
|
5
|
+
export declare const ClickOutsideDiv: FC<ClickOutsideDivProps>;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ClickOutsideDiv/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,EAAE,EACP,KAAK,iBAAiB,EAGtB,cAAc,EACf,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,CAAC;IACnD,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC,GACA,cAAc,CAAC,cAAc,CAAC,CAAC;AAEjC,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CA6BpD,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { j as jsxRuntimeExports } from "../../jsx-runtime-DaNGiM0W.js";
|
|
3
|
+
import { useRef, useEffect } from "react";
|
|
4
|
+
const ClickOutsideDiv = ({
|
|
5
|
+
children,
|
|
6
|
+
onClickOutSide,
|
|
7
|
+
...props
|
|
8
|
+
}) => {
|
|
9
|
+
const divRef = useRef(null);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
const handleClick = (event) => {
|
|
12
|
+
if (divRef.current && !divRef.current.contains(event.target)) {
|
|
13
|
+
onClickOutSide();
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
document.addEventListener("mousedown", handleClick);
|
|
17
|
+
return () => {
|
|
18
|
+
document.removeEventListener("mousedown", handleClick);
|
|
19
|
+
};
|
|
20
|
+
}, [onClickOutSide]);
|
|
21
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: divRef, ...props, children });
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
ClickOutsideDiv
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/components/ClickOutsideDiv/index.tsx"],"sourcesContent":["'use client';\n\nimport {\n type FC,\n type PropsWithChildren,\n useRef,\n useEffect,\n HTMLAttributes,\n} from 'react';\n\nexport type ClickOutsideDivProps = PropsWithChildren<{\n onClickOutSide: () => void; // note: changed return type to `void`\n}> &\n HTMLAttributes<HTMLDivElement>;\n\nexport const ClickOutsideDiv: FC<ClickOutsideDivProps> = ({\n children,\n onClickOutSide,\n ...props\n}) => {\n const divRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const handleClick = (event: MouseEvent) => {\n // If clicking outside of the referenced element, call onClickOutSide\n if (divRef.current && !divRef.current.contains(event.target as Node)) {\n onClickOutSide();\n }\n };\n\n // Attach the event listener\n document.addEventListener('mousedown', handleClick);\n\n // Clean up on unmount\n return () => {\n document.removeEventListener('mousedown', handleClick);\n };\n }, [onClickOutSide]);\n\n return (\n <div ref={divRef} {...props}>\n {children}\n </div>\n );\n};\n"],"names":[],"mappings":";;;AAeO,MAAM,kBAA4C,CAAC;AAAA,EACxD;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACE,QAAA,SAAS,OAAuB,IAAI;AAE1C,YAAU,MAAM;AACR,UAAA,cAAc,CAAC,UAAsB;AAErC,UAAA,OAAO,WAAW,CAAC,OAAO,QAAQ,SAAS,MAAM,MAAc,GAAG;AACrD,uBAAA;AAAA,MAAA;AAAA,IAEnB;AAGS,aAAA,iBAAiB,aAAa,WAAW;AAGlD,WAAO,MAAM;AACF,eAAA,oBAAoB,aAAa,WAAW;AAAA,IACvD;AAAA,EAAA,GACC,CAAC,cAAc,CAAC;AAEnB,+CACG,OAAI,EAAA,KAAK,QAAS,GAAG,OACnB,UACH;AAEJ;"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use client";
|
|
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 require$$0 = require("react");
|
|
7
|
+
const components_Button_Button = require("../Button/Button.cjs");
|
|
8
|
+
const components_IDE_CodeBlock = require("../IDE/CodeBlock.cjs");
|
|
9
|
+
const ContentEditorCode = ({
|
|
10
|
+
children,
|
|
11
|
+
onContentChange,
|
|
12
|
+
disabled,
|
|
13
|
+
validate,
|
|
14
|
+
...props
|
|
15
|
+
}) => {
|
|
16
|
+
const [newValue, setNewValue] = require$$0.useState(children);
|
|
17
|
+
const [resetIncrementor, setResetIncrementor] = require$$0.useState(0);
|
|
18
|
+
const isEdited = newValue !== children;
|
|
19
|
+
const handleCancel = () => {
|
|
20
|
+
setNewValue(children);
|
|
21
|
+
setResetIncrementor((prev) => prev + 1);
|
|
22
|
+
};
|
|
23
|
+
const handleValid = () => {
|
|
24
|
+
onContentChange(newValue);
|
|
25
|
+
};
|
|
26
|
+
require$$0.useEffect(() => {
|
|
27
|
+
setNewValue(children);
|
|
28
|
+
}, [children]);
|
|
29
|
+
const isValid = validate?.(newValue) ?? true;
|
|
30
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
className: "flex size-full flex-col items-center justify-between gap-2 p-2",
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
36
|
+
components_IDE_CodeBlock.CodeBlock,
|
|
37
|
+
{
|
|
38
|
+
isEditable: true,
|
|
39
|
+
onChange: (value) => setNewValue(value),
|
|
40
|
+
...props,
|
|
41
|
+
children
|
|
42
|
+
},
|
|
43
|
+
resetIncrementor
|
|
44
|
+
),
|
|
45
|
+
isEdited && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("div", { className: "flex w-full items-center justify-end gap-2", children: [
|
|
46
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
47
|
+
components_Button_Button.Button,
|
|
48
|
+
{
|
|
49
|
+
Icon: lucideReact.Check,
|
|
50
|
+
label: "Validate",
|
|
51
|
+
variant: "hoverable",
|
|
52
|
+
color: "text",
|
|
53
|
+
size: "icon-sm",
|
|
54
|
+
className: "cursor-pointer hover:scale-110",
|
|
55
|
+
disabled: disabled || !isValid,
|
|
56
|
+
onClick: handleValid
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
60
|
+
components_Button_Button.Button,
|
|
61
|
+
{
|
|
62
|
+
Icon: lucideReact.X,
|
|
63
|
+
label: "Cancel",
|
|
64
|
+
variant: "hoverable",
|
|
65
|
+
size: "icon-sm",
|
|
66
|
+
color: "text",
|
|
67
|
+
className: "cursor-pointer hover:scale-110",
|
|
68
|
+
onClick: handleCancel
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
] })
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
children
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
exports.ContentEditorCode = ContentEditorCode;
|
|
78
|
+
//# sourceMappingURL=ContentEditorCode.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContentEditorCode.cjs","sources":["../../../src/components/ContentEditor/ContentEditorCode.tsx"],"sourcesContent":["'use client';\n\nimport { Check, X } from 'lucide-react';\nimport { useState, type FC, useEffect, memo } from 'react';\nimport { Button } from '../Button';\nimport { CodeBlock, type CodeBlockProps } from '../IDE/CodeBlock';\n\nexport type ContentEditorCodeProps = {\n children: string;\n onContentChange: (content: string) => void;\n disabled?: boolean;\n validate?: (content: string) => boolean;\n isDarkMode?: boolean;\n} & Omit<CodeBlockProps, 'children'>;\n\nexport const ContentEditorCode: FC<ContentEditorCodeProps> = ({\n children,\n onContentChange,\n disabled,\n validate,\n ...props\n}) => {\n const [newValue, setNewValue] = useState<string>(children);\n const [resetIncrementor, setResetIncrementor] = useState<number>(0); // To reset the div on cancel\n const isEdited: boolean = newValue !== children;\n\n const handleCancel = () => {\n setNewValue(children);\n setResetIncrementor((prev) => prev + 1);\n };\n const handleValid = () => {\n onContentChange(newValue);\n };\n\n useEffect(() => {\n setNewValue(children);\n }, [children]);\n\n const isValid = validate?.(newValue) ?? true;\n\n return (\n <div\n className=\"flex size-full flex-col items-center justify-between gap-2 p-2\"\n key={children}\n >\n <CodeBlock\n isEditable={true}\n onChange={(value) => setNewValue(value)}\n key={resetIncrementor}\n {...props}\n >\n {children}\n </CodeBlock>\n {isEdited && (\n <div className=\"flex w-full items-center justify-end gap-2\">\n <Button\n Icon={Check}\n label=\"Validate\"\n variant=\"hoverable\"\n color=\"text\"\n size=\"icon-sm\"\n className=\"cursor-pointer hover:scale-110\"\n disabled={disabled || !isValid}\n onClick={handleValid}\n />\n <Button\n Icon={X}\n label=\"Cancel\"\n variant=\"hoverable\"\n size=\"icon-sm\"\n color=\"text\"\n className=\"cursor-pointer hover:scale-110\"\n onClick={handleCancel}\n />\n </div>\n )}\n </div>\n );\n};\n"],"names":["useState","useEffect","jsxs","jsx","CodeBlock","Button","Check","X"],"mappings":";;;;;;;;AAeO,MAAM,oBAAgD,CAAC;AAAA,EAC5D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;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AAA;AAAA,IAAA;AAAA,IA/BG;AAAA,EAiCP;AAEJ;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { CodeBlockProps } from '../IDE/CodeBlock';
|
|
3
|
+
export type ContentEditorCodeProps = {
|
|
4
|
+
children: string;
|
|
5
|
+
onContentChange: (content: string) => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
validate?: (content: string) => boolean;
|
|
8
|
+
isDarkMode?: boolean;
|
|
9
|
+
} & Omit<CodeBlockProps, 'children'>;
|
|
10
|
+
export declare const ContentEditorCode: FC<ContentEditorCodeProps>;
|
|
11
|
+
//# sourceMappingURL=ContentEditorCode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContentEditorCode.d.ts","sourceRoot":"","sources":["../../../src/components/ContentEditor/ContentEditorCode.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAY,KAAK,EAAE,EAAmB,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElE,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;AAErC,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CA+DxD,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { j as jsxRuntimeExports } from "../../jsx-runtime-DaNGiM0W.js";
|
|
3
|
+
import { Check, X } from "lucide-react";
|
|
4
|
+
import { useState, useEffect } from "react";
|
|
5
|
+
import { Button } from "../Button/Button.mjs";
|
|
6
|
+
import { CodeBlock } from "../IDE/CodeBlock.mjs";
|
|
7
|
+
const ContentEditorCode = ({
|
|
8
|
+
children,
|
|
9
|
+
onContentChange,
|
|
10
|
+
disabled,
|
|
11
|
+
validate,
|
|
12
|
+
...props
|
|
13
|
+
}) => {
|
|
14
|
+
const [newValue, setNewValue] = useState(children);
|
|
15
|
+
const [resetIncrementor, setResetIncrementor] = useState(0);
|
|
16
|
+
const isEdited = newValue !== children;
|
|
17
|
+
const handleCancel = () => {
|
|
18
|
+
setNewValue(children);
|
|
19
|
+
setResetIncrementor((prev) => prev + 1);
|
|
20
|
+
};
|
|
21
|
+
const handleValid = () => {
|
|
22
|
+
onContentChange(newValue);
|
|
23
|
+
};
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
setNewValue(children);
|
|
26
|
+
}, [children]);
|
|
27
|
+
const isValid = validate?.(newValue) ?? true;
|
|
28
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
29
|
+
"div",
|
|
30
|
+
{
|
|
31
|
+
className: "flex size-full flex-col items-center justify-between gap-2 p-2",
|
|
32
|
+
children: [
|
|
33
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
34
|
+
CodeBlock,
|
|
35
|
+
{
|
|
36
|
+
isEditable: true,
|
|
37
|
+
onChange: (value) => setNewValue(value),
|
|
38
|
+
...props,
|
|
39
|
+
children
|
|
40
|
+
},
|
|
41
|
+
resetIncrementor
|
|
42
|
+
),
|
|
43
|
+
isEdited && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex w-full items-center justify-end gap-2", children: [
|
|
44
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45
|
+
Button,
|
|
46
|
+
{
|
|
47
|
+
Icon: Check,
|
|
48
|
+
label: "Validate",
|
|
49
|
+
variant: "hoverable",
|
|
50
|
+
color: "text",
|
|
51
|
+
size: "icon-sm",
|
|
52
|
+
className: "cursor-pointer hover:scale-110",
|
|
53
|
+
disabled: disabled || !isValid,
|
|
54
|
+
onClick: handleValid
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
58
|
+
Button,
|
|
59
|
+
{
|
|
60
|
+
Icon: X,
|
|
61
|
+
label: "Cancel",
|
|
62
|
+
variant: "hoverable",
|
|
63
|
+
size: "icon-sm",
|
|
64
|
+
color: "text",
|
|
65
|
+
className: "cursor-pointer hover:scale-110",
|
|
66
|
+
onClick: handleCancel
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
] })
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
children
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
export {
|
|
76
|
+
ContentEditorCode
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=ContentEditorCode.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContentEditorCode.mjs","sources":["../../../src/components/ContentEditor/ContentEditorCode.tsx"],"sourcesContent":["'use client';\n\nimport { Check, X } from 'lucide-react';\nimport { useState, type FC, useEffect, memo } from 'react';\nimport { Button } from '../Button';\nimport { CodeBlock, type CodeBlockProps } from '../IDE/CodeBlock';\n\nexport type ContentEditorCodeProps = {\n children: string;\n onContentChange: (content: string) => void;\n disabled?: boolean;\n validate?: (content: string) => boolean;\n isDarkMode?: boolean;\n} & Omit<CodeBlockProps, 'children'>;\n\nexport const ContentEditorCode: FC<ContentEditorCodeProps> = ({\n children,\n onContentChange,\n disabled,\n validate,\n ...props\n}) => {\n const [newValue, setNewValue] = useState<string>(children);\n const [resetIncrementor, setResetIncrementor] = useState<number>(0); // To reset the div on cancel\n const isEdited: boolean = newValue !== children;\n\n const handleCancel = () => {\n setNewValue(children);\n setResetIncrementor((prev) => prev + 1);\n };\n const handleValid = () => {\n onContentChange(newValue);\n };\n\n useEffect(() => {\n setNewValue(children);\n }, [children]);\n\n const isValid = validate?.(newValue) ?? true;\n\n return (\n <div\n className=\"flex size-full flex-col items-center justify-between gap-2 p-2\"\n key={children}\n >\n <CodeBlock\n isEditable={true}\n onChange={(value) => setNewValue(value)}\n key={resetIncrementor}\n {...props}\n >\n {children}\n </CodeBlock>\n {isEdited && (\n <div className=\"flex w-full items-center justify-end gap-2\">\n <Button\n Icon={Check}\n label=\"Validate\"\n variant=\"hoverable\"\n color=\"text\"\n size=\"icon-sm\"\n className=\"cursor-pointer hover:scale-110\"\n disabled={disabled || !isValid}\n onClick={handleValid}\n />\n <Button\n Icon={X}\n label=\"Cancel\"\n variant=\"hoverable\"\n size=\"icon-sm\"\n color=\"text\"\n className=\"cursor-pointer hover:scale-110\"\n onClick={handleCancel}\n />\n </div>\n )}\n </div>\n );\n};\n"],"names":["jsxs","jsx"],"mappings":";;;;;;AAeO,MAAM,oBAAgD,CAAC;AAAA,EAC5D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,CAAC,UAAU,WAAW,IAAI,SAAiB,QAAQ;AACzD,QAAM,CAAC,kBAAkB,mBAAmB,IAAI,SAAiB,CAAC;AAClE,QAAM,WAAoB,aAAa;AAEvC,QAAM,eAAe,MAAM;AACzB,gBAAY,QAAQ;AACA,wBAAA,CAAC,SAAS,OAAO,CAAC;AAAA,EACxC;AACA,QAAM,cAAc,MAAM;AACxB,oBAAgB,QAAQ;AAAA,EAC1B;AAEA,YAAU,MAAM;AACd,gBAAY,QAAQ;AAAA,EAAA,GACnB,CAAC,QAAQ,CAAC;AAEP,QAAA,UAAU,WAAW,QAAQ,KAAK;AAGtC,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MAGV,UAAA;AAAA,QAAAC,kCAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,YAAY;AAAA,YACZ,UAAU,CAAC,UAAU,YAAY,KAAK;AAAA,YAErC,GAAG;AAAA,YAEH;AAAA,UAAA;AAAA,UAHI;AAAA,QAIP;AAAA,QACC,YACCD,kCAAA,KAAC,OAAI,EAAA,WAAU,8CACb,UAAA;AAAA,UAAAC,kCAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAM;AAAA,cACN,OAAM;AAAA,cACN,SAAQ;AAAA,cACR,OAAM;AAAA,cACN,MAAK;AAAA,cACL,WAAU;AAAA,cACV,UAAU,YAAY,CAAC;AAAA,cACvB,SAAS;AAAA,YAAA;AAAA,UACX;AAAA,UACAA,kCAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAM;AAAA,cACN,OAAM;AAAA,cACN,SAAQ;AAAA,cACR,MAAK;AAAA,cACL,OAAM;AAAA,cACN,WAAU;AAAA,cACV,SAAS;AAAA,YAAA;AAAA,UAAA;AAAA,QACX,EACF,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IA/BG;AAAA,EAiCP;AAEJ;"}
|
|
@@ -12,6 +12,7 @@ const ContentEditorTextArea = ({
|
|
|
12
12
|
onContentChange,
|
|
13
13
|
disabled,
|
|
14
14
|
validate,
|
|
15
|
+
additionalButtons,
|
|
15
16
|
...props
|
|
16
17
|
}) => {
|
|
17
18
|
const [newValue, setNewValue] = require$$0.useState(children);
|
|
@@ -45,32 +46,35 @@ const ContentEditorTextArea = ({
|
|
|
45
46
|
},
|
|
46
47
|
resetIncrementor
|
|
47
48
|
),
|
|
48
|
-
isEdited && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("div", { className: "flex w-full items-center justify-end gap-2", children: [
|
|
49
|
-
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
49
|
+
(isEdited || additionalButtons) && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("div", { className: "flex w-full items-center justify-end gap-2", children: [
|
|
50
|
+
isEdited && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment, { children: [
|
|
51
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
52
|
+
components_Button_Button.Button,
|
|
53
|
+
{
|
|
54
|
+
Icon: lucideReact.Check,
|
|
55
|
+
label: "Validate",
|
|
56
|
+
variant: "hoverable",
|
|
57
|
+
color: "text",
|
|
58
|
+
size: "icon-sm",
|
|
59
|
+
className: "cursor-pointer hover:scale-110",
|
|
60
|
+
disabled: disabled || !isValid,
|
|
61
|
+
onClick: handleValid
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
65
|
+
components_Button_Button.Button,
|
|
66
|
+
{
|
|
67
|
+
Icon: lucideReact.X,
|
|
68
|
+
label: "Cancel",
|
|
69
|
+
variant: "hoverable",
|
|
70
|
+
size: "icon-sm",
|
|
71
|
+
color: "text",
|
|
72
|
+
className: "cursor-pointer hover:scale-110",
|
|
73
|
+
onClick: handleCancel
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
] }),
|
|
77
|
+
additionalButtons
|
|
74
78
|
] })
|
|
75
79
|
]
|
|
76
80
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentEditorTextArea.cjs","sources":["../../../src/components/ContentEditor/ContentEditorTextArea.tsx"],"sourcesContent":["'use client';\n\nimport { Check, X } from 'lucide-react';\nimport {
|
|
1
|
+
{"version":3,"file":"ContentEditorTextArea.cjs","sources":["../../../src/components/ContentEditor/ContentEditorTextArea.tsx"],"sourcesContent":["'use client';\n\nimport { Check, X } from 'lucide-react';\nimport {\n useState,\n type FC,\n type ChangeEventHandler,\n useEffect,\n ReactNode,\n} from 'react';\nimport { Button } from '../Button';\nimport { AutoSizedTextArea, AutoSizedTextAreaProps } from '../TextArea';\n\nexport type ContentEditorTextAreaProps = {\n children: string;\n onContentChange: (content: string) => void;\n disabled?: boolean;\n validate?: (content: string) => boolean;\n additionalButtons?: ReactNode;\n} & Omit<AutoSizedTextAreaProps, 'children'>;\n\nexport const ContentEditorTextArea: FC<ContentEditorTextAreaProps> = ({\n children,\n onContentChange,\n disabled,\n validate,\n additionalButtons,\n ...props\n}) => {\n const [newValue, setNewValue] = useState<string>(children);\n const [resetIncrementor, setResetIncrementor] = useState<number>(0); // To reset the div on cancel\n const isEdited: boolean = newValue !== children;\n\n const handleCancel = () => {\n setNewValue(children);\n setResetIncrementor((prev) => prev + 1);\n };\n const handleValid = () => {\n onContentChange(newValue);\n };\n\n const handleOnContentChange: ChangeEventHandler<HTMLTextAreaElement> = (e) =>\n setNewValue(e.currentTarget.value ?? '');\n\n useEffect(() => {\n setNewValue(children);\n }, [children]);\n\n const isValid = validate?.(newValue) ?? true;\n\n return (\n <div\n className=\"flex size-full flex-col items-center justify-between gap-2\"\n key={children}\n >\n <AutoSizedTextArea\n onChange={handleOnContentChange}\n key={resetIncrementor}\n variant=\"invisible\"\n className=\"size-full\"\n defaultValue={children}\n {...props}\n />\n {(isEdited || additionalButtons) && (\n <div className=\"flex w-full items-center justify-end gap-2\">\n {isEdited && (\n <>\n <Button\n Icon={Check}\n label=\"Validate\"\n variant=\"hoverable\"\n color=\"text\"\n size=\"icon-sm\"\n className=\"cursor-pointer hover:scale-110\"\n disabled={disabled || !isValid}\n onClick={handleValid}\n />\n <Button\n Icon={X}\n label=\"Cancel\"\n variant=\"hoverable\"\n size=\"icon-sm\"\n color=\"text\"\n className=\"cursor-pointer hover:scale-110\"\n onClick={handleCancel}\n />\n </>\n )}\n {additionalButtons}\n </div>\n )}\n </div>\n );\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AK;AAAA,gBACL,WAAU;AAAA,gBACV,UAAU,YAAY,CAAC;AAAA,gBACvB,SAAS;AAAA,cAAA;AAAA,YACX;AAAA,YACAJ,2BAAA,kBAAA;AAAA,cAACG,yBAAA;AAAA,cAAA;AAAA,gBACC,MAAME,YAAA;AAAA,gBACN,OAAM;AAAA,gBACN,SAAQ;AAAA,gBACR,MAAK;AAAA,gBACL,OAAM;AAAA,gBACN,WAAU;AAAA,gBACV,SAAS;AAAA,cAAA;AAAA,YAAA;AAAA,UACX,GACF;AAAA,UAED;AAAA,QAAA,EACH,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IApCG;AAAA,EAsCP;AAEJ;;"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
2
|
import { AutoSizedTextAreaProps } from '../TextArea';
|
|
3
3
|
export type ContentEditorTextAreaProps = {
|
|
4
4
|
children: string;
|
|
5
5
|
onContentChange: (content: string) => void;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
validate?: (content: string) => boolean;
|
|
8
|
+
additionalButtons?: ReactNode;
|
|
8
9
|
} & Omit<AutoSizedTextAreaProps, 'children'>;
|
|
9
10
|
export declare const ContentEditorTextArea: FC<ContentEditorTextAreaProps>;
|
|
10
11
|
//# sourceMappingURL=ContentEditorTextArea.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentEditorTextArea.d.ts","sourceRoot":"","sources":["../../../src/components/ContentEditor/ContentEditorTextArea.tsx"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"ContentEditorTextArea.d.ts","sourceRoot":"","sources":["../../../src/components/ContentEditor/ContentEditorTextArea.tsx"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,EAAE,EAGP,SAAS,EACV,MAAM,OAAO,CAAC;AAEf,OAAO,EAAqB,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAExE,MAAM,MAAM,0BAA0B,GAAG;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IACxC,iBAAiB,CAAC,EAAE,SAAS,CAAC;CAC/B,GAAG,IAAI,CAAC,sBAAsB,EAAE,UAAU,CAAC,CAAC;AAE7C,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,0BAA0B,CAwEhE,CAAC"}
|
|
@@ -10,6 +10,7 @@ const ContentEditorTextArea = ({
|
|
|
10
10
|
onContentChange,
|
|
11
11
|
disabled,
|
|
12
12
|
validate,
|
|
13
|
+
additionalButtons,
|
|
13
14
|
...props
|
|
14
15
|
}) => {
|
|
15
16
|
const [newValue, setNewValue] = useState(children);
|
|
@@ -43,32 +44,35 @@ const ContentEditorTextArea = ({
|
|
|
43
44
|
},
|
|
44
45
|
resetIncrementor
|
|
45
46
|
),
|
|
46
|
-
isEdited && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex w-full items-center justify-end gap-2", children: [
|
|
47
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
47
|
+
(isEdited || additionalButtons) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex w-full items-center justify-end gap-2", children: [
|
|
48
|
+
isEdited && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
49
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
50
|
+
Button,
|
|
51
|
+
{
|
|
52
|
+
Icon: Check,
|
|
53
|
+
label: "Validate",
|
|
54
|
+
variant: "hoverable",
|
|
55
|
+
color: "text",
|
|
56
|
+
size: "icon-sm",
|
|
57
|
+
className: "cursor-pointer hover:scale-110",
|
|
58
|
+
disabled: disabled || !isValid,
|
|
59
|
+
onClick: handleValid
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
63
|
+
Button,
|
|
64
|
+
{
|
|
65
|
+
Icon: X,
|
|
66
|
+
label: "Cancel",
|
|
67
|
+
variant: "hoverable",
|
|
68
|
+
size: "icon-sm",
|
|
69
|
+
color: "text",
|
|
70
|
+
className: "cursor-pointer hover:scale-110",
|
|
71
|
+
onClick: handleCancel
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
] }),
|
|
75
|
+
additionalButtons
|
|
72
76
|
] })
|
|
73
77
|
]
|
|
74
78
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentEditorTextArea.mjs","sources":["../../../src/components/ContentEditor/ContentEditorTextArea.tsx"],"sourcesContent":["'use client';\n\nimport { Check, X } from 'lucide-react';\nimport {
|
|
1
|
+
{"version":3,"file":"ContentEditorTextArea.mjs","sources":["../../../src/components/ContentEditor/ContentEditorTextArea.tsx"],"sourcesContent":["'use client';\n\nimport { Check, X } from 'lucide-react';\nimport {\n useState,\n type FC,\n type ChangeEventHandler,\n useEffect,\n ReactNode,\n} from 'react';\nimport { Button } from '../Button';\nimport { AutoSizedTextArea, AutoSizedTextAreaProps } from '../TextArea';\n\nexport type ContentEditorTextAreaProps = {\n children: string;\n onContentChange: (content: string) => void;\n disabled?: boolean;\n validate?: (content: string) => boolean;\n additionalButtons?: ReactNode;\n} & Omit<AutoSizedTextAreaProps, 'children'>;\n\nexport const ContentEditorTextArea: FC<ContentEditorTextAreaProps> = ({\n children,\n onContentChange,\n disabled,\n validate,\n additionalButtons,\n ...props\n}) => {\n const [newValue, setNewValue] = useState<string>(children);\n const [resetIncrementor, setResetIncrementor] = useState<number>(0); // To reset the div on cancel\n const isEdited: boolean = newValue !== children;\n\n const handleCancel = () => {\n setNewValue(children);\n setResetIncrementor((prev) => prev + 1);\n };\n const handleValid = () => {\n onContentChange(newValue);\n };\n\n const handleOnContentChange: ChangeEventHandler<HTMLTextAreaElement> = (e) =>\n setNewValue(e.currentTarget.value ?? '');\n\n useEffect(() => {\n setNewValue(children);\n }, [children]);\n\n const isValid = validate?.(newValue) ?? true;\n\n return (\n <div\n className=\"flex size-full flex-col items-center justify-between gap-2\"\n key={children}\n >\n <AutoSizedTextArea\n onChange={handleOnContentChange}\n key={resetIncrementor}\n variant=\"invisible\"\n className=\"size-full\"\n defaultValue={children}\n {...props}\n />\n {(isEdited || additionalButtons) && (\n <div className=\"flex w-full items-center justify-end gap-2\">\n {isEdited && (\n <>\n <Button\n Icon={Check}\n label=\"Validate\"\n variant=\"hoverable\"\n color=\"text\"\n size=\"icon-sm\"\n className=\"cursor-pointer hover:scale-110\"\n disabled={disabled || !isValid}\n onClick={handleValid}\n />\n <Button\n Icon={X}\n label=\"Cancel\"\n variant=\"hoverable\"\n size=\"icon-sm\"\n color=\"text\"\n className=\"cursor-pointer hover:scale-110\"\n onClick={handleCancel}\n />\n </>\n )}\n {additionalButtons}\n </div>\n )}\n </div>\n );\n};\n"],"names":["jsxs","jsx","Fragment"],"mappings":";;;;;;;AAqBO,MAAM,wBAAwD,CAAC;AAAA,EACpE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,CAAC,UAAU,WAAW,IAAI,SAAiB,QAAQ;AACzD,QAAM,CAAC,kBAAkB,mBAAmB,IAAI,SAAiB,CAAC;AAClE,QAAM,WAAoB,aAAa;AAEvC,QAAM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,7 @@ const ValidDictionaryChangeButtons = ({ dictionary }) => {
|
|
|
64
64
|
components_Form_layout_FormItemLayout.Form.Button,
|
|
65
65
|
{
|
|
66
66
|
type: "button",
|
|
67
|
-
label: resetButton.label
|
|
67
|
+
label: resetButton.label,
|
|
68
68
|
disabled: !isEdited || isSubmitting,
|
|
69
69
|
className: "ml-auto",
|
|
70
70
|
Icon: lucideReact.RotateCcw,
|
|
@@ -80,7 +80,7 @@ const ValidDictionaryChangeButtons = ({ dictionary }) => {
|
|
|
80
80
|
components_Form_layout_FormItemLayout.Form.Button,
|
|
81
81
|
{
|
|
82
82
|
type: "submit",
|
|
83
|
-
label: publishButton.label
|
|
83
|
+
label: publishButton.label,
|
|
84
84
|
disabled: !isEdited || isSubmitting,
|
|
85
85
|
Icon: lucideReact.ArrowUpFromLine,
|
|
86
86
|
color: "text",
|
|
@@ -92,7 +92,7 @@ const ValidDictionaryChangeButtons = ({ dictionary }) => {
|
|
|
92
92
|
components_Form_layout_FormItemLayout.Form.Button,
|
|
93
93
|
{
|
|
94
94
|
type: "submit",
|
|
95
|
-
label: saveButton.label
|
|
95
|
+
label: saveButton.label,
|
|
96
96
|
disabled: !isEdited || isSubmitting,
|
|
97
97
|
Icon: lucideReact.Save,
|
|
98
98
|
color: "text",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidDictionaryChangeButtons.cjs","sources":["../../../src/components/DictionaryEditor/ValidDictionaryChangeButtons.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport type { Dictionary } from '@intlayer/core';\nimport { ArrowUpFromLine, RotateCcw, Save } from 'lucide-react';\nimport { useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { usePushDictionaries } from '../../hooks';\nimport { Form, useForm } from '../Form';\nimport { useEditedContentStore } from './useEditedContentStore';\nimport { validDictionaryChangeButtonsContent } from './validDictionaryChangeButtons.content';\nimport { getValidDictionaryChangeButtonsSchemaSchema } from './validDictionaryChangeButtonsSchema';\n\ntype ValidDictionaryChangeButtonsProps = {\n dictionary: Dictionary;\n};\n\nexport const ValidDictionaryChangeButtons: FC<\n ValidDictionaryChangeButtonsProps\n> = ({ dictionary }) => {\n const ValidDictionaryChangeButtonsSchemaSchema =\n getValidDictionaryChangeButtonsSchemaSchema();\n\n const { resetButton, saveButton, publishButton } = useDictionary(\n validDictionaryChangeButtonsContent\n );\n\n const { pushDictionaries } = usePushDictionaries();\n\n const { editedContent, restoreEditedContent } = useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n restoreEditedContent: s.restoreEditedContent,\n }))\n );\n const { form, isSubmitting } = useForm(\n ValidDictionaryChangeButtonsSchemaSchema\n );\n\n const editedDictionary = useMemo(\n () => editedContent[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const isEdited = useMemo(\n () =>\n editedDictionary &&\n JSON.stringify(editedDictionary?.content) !==\n JSON.stringify(dictionary?.content),\n [editedDictionary, dictionary]\n );\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = async () => {\n await pushDictionaries([\n {\n ...dictionary,\n ...editedContent[dictionary.key],\n },\n ]);\n };\n\n return (\n <div className=\"mb-4\">\n <Form\n className=\"flex w-full flex-row flex-wrap justify-end gap-3\"\n {...form}\n schema={ValidDictionaryChangeButtonsSchemaSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n {isEdited && (\n <Form.Button\n type=\"button\"\n label={resetButton.label
|
|
1
|
+
{"version":3,"file":"ValidDictionaryChangeButtons.cjs","sources":["../../../src/components/DictionaryEditor/ValidDictionaryChangeButtons.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport type { Dictionary } from '@intlayer/core';\nimport { ArrowUpFromLine, RotateCcw, Save } from 'lucide-react';\nimport { useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { usePushDictionaries } from '../../hooks';\nimport { Form, useForm } from '../Form';\nimport { useEditedContentStore } from './useEditedContentStore';\nimport { validDictionaryChangeButtonsContent } from './validDictionaryChangeButtons.content';\nimport { getValidDictionaryChangeButtonsSchemaSchema } from './validDictionaryChangeButtonsSchema';\n\ntype ValidDictionaryChangeButtonsProps = {\n dictionary: Dictionary;\n};\n\nexport const ValidDictionaryChangeButtons: FC<\n ValidDictionaryChangeButtonsProps\n> = ({ dictionary }) => {\n const ValidDictionaryChangeButtonsSchemaSchema =\n getValidDictionaryChangeButtonsSchemaSchema();\n\n const { resetButton, saveButton, publishButton } = useDictionary(\n validDictionaryChangeButtonsContent\n );\n\n const { pushDictionaries } = usePushDictionaries();\n\n const { editedContent, restoreEditedContent } = useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n restoreEditedContent: s.restoreEditedContent,\n }))\n );\n const { form, isSubmitting } = useForm(\n ValidDictionaryChangeButtonsSchemaSchema\n );\n\n const editedDictionary = useMemo(\n () => editedContent[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const isEdited = useMemo(\n () =>\n editedDictionary &&\n JSON.stringify(editedDictionary?.content) !==\n JSON.stringify(dictionary?.content),\n [editedDictionary, dictionary]\n );\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = async () => {\n await pushDictionaries([\n {\n ...dictionary,\n ...editedContent[dictionary.key],\n },\n ]);\n };\n\n return (\n <div className=\"mb-4\">\n <Form\n className=\"flex w-full flex-row flex-wrap justify-end gap-3\"\n {...form}\n schema={ValidDictionaryChangeButtonsSchemaSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n {isEdited && (\n <Form.Button\n type=\"button\"\n label={resetButton.label}\n disabled={!isEdited || isSubmitting}\n className=\"ml-auto\"\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\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 isFullWidth\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 isFullWidth\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )\n )}\n </Form>\n </div>\n );\n};\n"],"names":["getValidDictionaryChangeButtonsSchemaSchema","useDictionary","validDictionaryChangeButtonsContent","usePushDictionaries","useEditedContentStore","useShallow","useForm","useMemo","jsx","jsxs","Form","RotateCcw","ArrowUpFromLine","Save"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBO,MAAM,+BAET,CAAC,EAAE,iBAAiB;AACtB,QAAM,2CACJA,+DAAAA,4CAA4C;AAE9C,QAAM,EAAE,aAAa,YAAY,cAAkB,IAAAC,cAAA;AAAA,IACjDC,iEAAAA;AAAAA,EACF;AAEM,QAAA,EAAE,iBAAiB,IAAIC,2CAAoB;AAE3C,QAAA,EAAE,eAAe,qBAAA,IAAyBC,kDAAA;AAAA,IAC9CC,QAAA,WAAW,CAAC,OAAO;AAAA,MACjB,eAAe,EAAE;AAAA,MACjB,sBAAsB,EAAE;AAAA,IAAA,EACxB;AAAA,EACJ;AACM,QAAA,EAAE,MAAM,aAAA,IAAiBC,yBAAA;AAAA,IAC7B;AAAA,EACF;AAEA,QAAM,mBAAmBC,WAAA;AAAA,IACvB,MAAM,cAAc,WAAW,GAAG;AAAA,IAClC,CAAC,eAAe,WAAW,GAAG;AAAA,EAChC;AAEA,QAAM,WAAWA,WAAA;AAAA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;AAAA,YACC,MAAK;AAAA,YACL,OAAO,WAAW;AAAA,YAClB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAMG,YAAA;AAAA,YACN,OAAM;AAAA,YACN,aAAW;AAAA,YACX,WAAW;AAAA,YAEV,UAAW,WAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACd;AAAA,IAAA;AAAA,EAAA,GAIR;AAEJ;;"}
|
|
@@ -62,7 +62,7 @@ const ValidDictionaryChangeButtons = ({ dictionary }) => {
|
|
|
62
62
|
Form.Button,
|
|
63
63
|
{
|
|
64
64
|
type: "button",
|
|
65
|
-
label: resetButton.label
|
|
65
|
+
label: resetButton.label,
|
|
66
66
|
disabled: !isEdited || isSubmitting,
|
|
67
67
|
className: "ml-auto",
|
|
68
68
|
Icon: RotateCcw,
|
|
@@ -78,7 +78,7 @@ const ValidDictionaryChangeButtons = ({ dictionary }) => {
|
|
|
78
78
|
Form.Button,
|
|
79
79
|
{
|
|
80
80
|
type: "submit",
|
|
81
|
-
label: publishButton.label
|
|
81
|
+
label: publishButton.label,
|
|
82
82
|
disabled: !isEdited || isSubmitting,
|
|
83
83
|
Icon: ArrowUpFromLine,
|
|
84
84
|
color: "text",
|
|
@@ -90,7 +90,7 @@ const ValidDictionaryChangeButtons = ({ dictionary }) => {
|
|
|
90
90
|
Form.Button,
|
|
91
91
|
{
|
|
92
92
|
type: "submit",
|
|
93
|
-
label: saveButton.label
|
|
93
|
+
label: saveButton.label,
|
|
94
94
|
disabled: !isEdited || isSubmitting,
|
|
95
95
|
Icon: Save,
|
|
96
96
|
color: "text",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidDictionaryChangeButtons.mjs","sources":["../../../src/components/DictionaryEditor/ValidDictionaryChangeButtons.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport type { Dictionary } from '@intlayer/core';\nimport { ArrowUpFromLine, RotateCcw, Save } from 'lucide-react';\nimport { useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { usePushDictionaries } from '../../hooks';\nimport { Form, useForm } from '../Form';\nimport { useEditedContentStore } from './useEditedContentStore';\nimport { validDictionaryChangeButtonsContent } from './validDictionaryChangeButtons.content';\nimport { getValidDictionaryChangeButtonsSchemaSchema } from './validDictionaryChangeButtonsSchema';\n\ntype ValidDictionaryChangeButtonsProps = {\n dictionary: Dictionary;\n};\n\nexport const ValidDictionaryChangeButtons: FC<\n ValidDictionaryChangeButtonsProps\n> = ({ dictionary }) => {\n const ValidDictionaryChangeButtonsSchemaSchema =\n getValidDictionaryChangeButtonsSchemaSchema();\n\n const { resetButton, saveButton, publishButton } = useDictionary(\n validDictionaryChangeButtonsContent\n );\n\n const { pushDictionaries } = usePushDictionaries();\n\n const { editedContent, restoreEditedContent } = useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n restoreEditedContent: s.restoreEditedContent,\n }))\n );\n const { form, isSubmitting } = useForm(\n ValidDictionaryChangeButtonsSchemaSchema\n );\n\n const editedDictionary = useMemo(\n () => editedContent[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const isEdited = useMemo(\n () =>\n editedDictionary &&\n JSON.stringify(editedDictionary?.content) !==\n JSON.stringify(dictionary?.content),\n [editedDictionary, dictionary]\n );\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = async () => {\n await pushDictionaries([\n {\n ...dictionary,\n ...editedContent[dictionary.key],\n },\n ]);\n };\n\n return (\n <div className=\"mb-4\">\n <Form\n className=\"flex w-full flex-row flex-wrap justify-end gap-3\"\n {...form}\n schema={ValidDictionaryChangeButtonsSchemaSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n {isEdited && (\n <Form.Button\n type=\"button\"\n label={resetButton.label
|
|
1
|
+
{"version":3,"file":"ValidDictionaryChangeButtons.mjs","sources":["../../../src/components/DictionaryEditor/ValidDictionaryChangeButtons.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport type { Dictionary } from '@intlayer/core';\nimport { ArrowUpFromLine, RotateCcw, Save } from 'lucide-react';\nimport { useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { usePushDictionaries } from '../../hooks';\nimport { Form, useForm } from '../Form';\nimport { useEditedContentStore } from './useEditedContentStore';\nimport { validDictionaryChangeButtonsContent } from './validDictionaryChangeButtons.content';\nimport { getValidDictionaryChangeButtonsSchemaSchema } from './validDictionaryChangeButtonsSchema';\n\ntype ValidDictionaryChangeButtonsProps = {\n dictionary: Dictionary;\n};\n\nexport const ValidDictionaryChangeButtons: FC<\n ValidDictionaryChangeButtonsProps\n> = ({ dictionary }) => {\n const ValidDictionaryChangeButtonsSchemaSchema =\n getValidDictionaryChangeButtonsSchemaSchema();\n\n const { resetButton, saveButton, publishButton } = useDictionary(\n validDictionaryChangeButtonsContent\n );\n\n const { pushDictionaries } = usePushDictionaries();\n\n const { editedContent, restoreEditedContent } = useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n restoreEditedContent: s.restoreEditedContent,\n }))\n );\n const { form, isSubmitting } = useForm(\n ValidDictionaryChangeButtonsSchemaSchema\n );\n\n const editedDictionary = useMemo(\n () => editedContent[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const isEdited = useMemo(\n () =>\n editedDictionary &&\n JSON.stringify(editedDictionary?.content) !==\n JSON.stringify(dictionary?.content),\n [editedDictionary, dictionary]\n );\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = async () => {\n await pushDictionaries([\n {\n ...dictionary,\n ...editedContent[dictionary.key],\n },\n ]);\n };\n\n return (\n <div className=\"mb-4\">\n <Form\n className=\"flex w-full flex-row flex-wrap justify-end gap-3\"\n {...form}\n schema={ValidDictionaryChangeButtonsSchemaSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n {isEdited && (\n <Form.Button\n type=\"button\"\n label={resetButton.label}\n disabled={!isEdited || isSubmitting}\n className=\"ml-auto\"\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\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 isFullWidth\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 isFullWidth\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )\n )}\n </Form>\n </div>\n );\n};\n"],"names":["jsx","jsxs"],"mappings":";;;;;;;;;;;;;;;;;AAmBO,MAAM,+BAET,CAAC,EAAE,iBAAiB;AACtB,QAAM,2CACJ,4CAA4C;AAE9C,QAAM,EAAE,aAAa,YAAY,cAAkB,IAAA;AAAA,IACjD;AAAA,EACF;AAEM,QAAA,EAAE,iBAAiB,IAAI,oBAAoB;AAE3C,QAAA,EAAE,eAAe,qBAAA,IAAyB;AAAA,IAC9C,WAAW,CAAC,OAAO;AAAA,MACjB,eAAe,EAAE;AAAA,MACjB,sBAAsB,EAAE;AAAA,IAAA,EACxB;AAAA,EACJ;AACM,QAAA,EAAE,MAAM,aAAA,IAAiB;AAAA,IAC7B;AAAA,EACF;AAEA,QAAM,mBAAmB;AAAA,IACvB,MAAM,cAAc,WAAW,GAAG;AAAA,IAClC,CAAC,eAAe,WAAW,GAAG;AAAA,EAChC;AAEA,QAAM,WAAW;AAAA,IACf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ACN,OAAM;AAAA,YACN,aAAW;AAAA,YACX,WAAW;AAAA,YAEV,UAAW,WAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACd;AAAA,IAAA;AAAA,EAAA,GAIR;AAEJ;"}
|
|
@@ -30,7 +30,8 @@ const components_DictionaryFieldEditor_DictionaryFieldEditor = require("../Dicti
|
|
|
30
30
|
const components_DictionaryFieldEditor_DictionariesSelector_dictionariesSelector_content = require("./dictionariesSelector.content.cjs");
|
|
31
31
|
const DictionariesSelector = ({
|
|
32
32
|
onClickDictionaryList,
|
|
33
|
-
isDarkMode
|
|
33
|
+
isDarkMode,
|
|
34
|
+
availableLocales
|
|
34
35
|
}) => {
|
|
35
36
|
const { online, locale, isLoading } = hooks_useGetAllDictionaries.useGetAllDictionaries();
|
|
36
37
|
const { focusedContent } = components_DictionaryEditor_useEditionPanelStore.useEditionPanelStore(
|
|
@@ -53,7 +54,8 @@ const DictionariesSelector = ({
|
|
|
53
54
|
{
|
|
54
55
|
dictionary,
|
|
55
56
|
onClickDictionaryList,
|
|
56
|
-
isDarkMode
|
|
57
|
+
isDarkMode,
|
|
58
|
+
availableLocales
|
|
57
59
|
}
|
|
58
60
|
);
|
|
59
61
|
};
|