@intlayer/design-system 3.5.4 → 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 +351 -60
- 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/CopyButton-Cxu3goRg.cjs +59 -0
- package/dist/CopyButton-Cxu3goRg.cjs.map +1 -0
- package/dist/CopyButton-DlcDlf6U.js +60 -0
- package/dist/CopyButton-DlcDlf6U.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/useAuth/useSession.cjs +1 -0
- package/dist/components/Auth/useAuth/useSession.cjs.map +1 -1
- package/dist/components/Auth/useAuth/useSession.mjs +1 -0
- package/dist/components/Auth/useAuth/useSession.mjs.map +1 -1
- package/dist/components/Breadcrumb/breadcrumb.content.cjs +26 -0
- package/dist/components/Breadcrumb/breadcrumb.content.cjs.map +1 -0
- package/dist/components/Breadcrumb/breadcrumb.content.d.ts +8 -0
- package/dist/components/Breadcrumb/breadcrumb.content.d.ts.map +1 -0
- package/dist/components/Breadcrumb/breadcrumb.content.mjs +26 -0
- package/dist/components/Breadcrumb/breadcrumb.content.mjs.map +1 -0
- package/dist/components/Breadcrumb/index.cjs +106 -34
- package/dist/components/Breadcrumb/index.cjs.map +1 -1
- package/dist/components/Breadcrumb/index.d.ts +6 -2
- package/dist/components/Breadcrumb/index.d.ts.map +1 -1
- package/dist/components/Breadcrumb/index.mjs +106 -34
- package/dist/components/Breadcrumb/index.mjs.map +1 -1
- package/dist/components/Button/Button.cjs +7 -8
- package/dist/components/Button/Button.cjs.map +1 -1
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.mjs +7 -8
- 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 +2 -2
- package/dist/components/Container/index.cjs.map +1 -1
- package/dist/components/Container/index.mjs +2 -2
- 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/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/DictionaryEditor/index.cjs +4 -0
- package/dist/components/DictionaryEditor/index.cjs.map +1 -1
- package/dist/components/DictionaryEditor/index.mjs +4 -0
- package/dist/components/DictionaryEditor/index.mjs.map +1 -1
- package/dist/components/DictionaryEditor/useEditedContentStore.cjs +3 -0
- package/dist/components/DictionaryEditor/useEditedContentStore.cjs.map +1 -1
- package/dist/components/DictionaryEditor/useEditedContentStore.d.ts +2 -2
- package/dist/components/DictionaryEditor/useEditedContentStore.d.ts.map +1 -1
- package/dist/components/DictionaryEditor/useEditedContentStore.mjs +3 -0
- package/dist/components/DictionaryEditor/useEditedContentStore.mjs.map +1 -1
- package/dist/components/DictionaryEditor/useEditionPanelStore.cjs.map +1 -1
- package/dist/components/DictionaryEditor/useEditionPanelStore.d.ts +1 -1
- package/dist/components/DictionaryEditor/useEditionPanelStore.d.ts.map +1 -1
- package/dist/components/DictionaryEditor/useEditionPanelStore.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs +9 -5
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.d.ts +3 -0
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs +9 -5
- 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 +17 -6
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts +3 -0
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +17 -6
- 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/JSONEditor.cjs +20 -18
- package/dist/components/DictionaryFieldEditor/JSONEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/JSONEditor.d.ts +1 -0
- package/dist/components/DictionaryFieldEditor/JSONEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/JSONEditor.mjs +20 -18
- package/dist/components/DictionaryFieldEditor/JSONEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/KeyPathBreadcrumb.cjs +10 -2
- package/dist/components/DictionaryFieldEditor/KeyPathBreadcrumb.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/KeyPathBreadcrumb.d.ts +2 -0
- package/dist/components/DictionaryFieldEditor/KeyPathBreadcrumb.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/KeyPathBreadcrumb.mjs +10 -2
- package/dist/components/DictionaryFieldEditor/KeyPathBreadcrumb.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 +32 -23
- 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 +32 -23
- 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 +59 -18
- 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 +62 -21
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs +32 -0
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts +4 -0
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs +32 -0
- 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/DropDown/index.cjs.map +1 -1
- package/dist/components/DropDown/index.d.ts +18 -1
- package/dist/components/DropDown/index.d.ts.map +1 -1
- package/dist/components/DropDown/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/Headers/index.cjs +1 -1
- package/dist/components/Headers/index.cjs.map +1 -1
- package/dist/components/Headers/index.mjs +1 -1
- package/dist/components/Headers/index.mjs.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/CodeRender copy.cjs +141 -0
- package/dist/components/IDE/CodeRender copy.cjs.map +1 -0
- package/dist/components/IDE/CodeRender copy.d.ts +14 -0
- package/dist/components/IDE/CodeRender copy.d.ts.map +1 -0
- package/dist/components/IDE/CodeRender copy.mjs +141 -0
- package/dist/components/IDE/CodeRender copy.mjs.map +1 -0
- package/dist/components/IDE/CodeRender.cjs +39 -625
- package/dist/components/IDE/CodeRender.cjs.map +1 -1
- package/dist/components/IDE/CodeRender.d.ts +4 -5
- package/dist/components/IDE/CodeRender.d.ts.map +1 -1
- package/dist/components/IDE/CodeRender.mjs +40 -604
- package/dist/components/IDE/CodeRender.mjs.map +1 -1
- 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/CopyButton.cjs +40 -0
- package/dist/components/IDE/CopyButton.cjs.map +1 -0
- package/dist/components/IDE/CopyButton.content.cjs +26 -0
- package/dist/components/IDE/CopyButton.content.cjs.map +1 -0
- package/dist/components/IDE/CopyButton.content.d.ts +8 -0
- package/dist/components/IDE/CopyButton.content.d.ts.map +1 -0
- package/dist/components/IDE/CopyButton.content.mjs +26 -0
- package/dist/components/IDE/CopyButton.content.mjs.map +1 -0
- package/dist/components/IDE/CopyButton.d.ts +7 -0
- package/dist/components/IDE/CopyButton.d.ts.map +1 -0
- package/dist/components/IDE/CopyButton.mjs +40 -0
- package/dist/components/IDE/CopyButton.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/IDE.cjs +1 -1
- package/dist/components/IDE/IDE.cjs.map +1 -1
- package/dist/components/IDE/IDE.mjs +1 -1
- package/dist/components/IDE/IDE.mjs.map +1 -1
- package/dist/components/IDE/MarkDownRender.cjs +11 -4
- 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 +11 -4
- package/dist/components/IDE/MarkDownRender.mjs.map +1 -1
- package/dist/components/IDE/MonacoCode.cjs +129 -0
- package/dist/components/IDE/MonacoCode.cjs.map +1 -0
- package/dist/components/IDE/MonacoCode.d.ts +14 -0
- package/dist/components/IDE/MonacoCode.d.ts.map +1 -0
- package/dist/components/IDE/MonacoCode.mjs +129 -0
- package/dist/components/IDE/MonacoCode.mjs.map +1 -0
- 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 +50 -31
- package/dist/components/Link/Link.cjs.map +1 -1
- package/dist/components/Link/Link.d.ts +3 -0
- package/dist/components/Link/Link.d.ts.map +1 -1
- package/dist/components/Link/Link.mjs +51 -32
- package/dist/components/Link/Link.mjs.map +1 -1
- package/dist/components/Link/index.cjs +1 -0
- package/dist/components/Link/index.cjs.map +1 -1
- package/dist/components/Link/index.mjs +3 -2
- 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 +110 -34
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.cjs.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.d.ts +2 -0
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.d.ts.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs +111 -35
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.cjs +63 -1
- package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.cjs.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.d.ts +6 -0
- package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.d.ts.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.mjs +63 -1
- package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.mjs.map +1 -1
- package/dist/components/MarkDownRender/index.cjs +22 -26
- package/dist/components/MarkDownRender/index.cjs.map +1 -1
- package/dist/components/MarkDownRender/index.d.ts +5 -1
- package/dist/components/MarkDownRender/index.d.ts.map +1 -1
- package/dist/components/MarkDownRender/index.mjs +22 -26
- package/dist/components/MarkDownRender/index.mjs.map +1 -1
- package/dist/components/Modal/Modal.cjs +11 -13
- 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 +11 -13
- package/dist/components/Modal/Modal.mjs.map +1 -1
- package/dist/components/Navbar/DesktopNavbar.cjs +1 -1
- package/dist/components/Navbar/DesktopNavbar.cjs.map +1 -1
- package/dist/components/Navbar/DesktopNavbar.mjs +1 -1
- package/dist/components/Navbar/DesktopNavbar.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 +21 -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 +21 -4
- package/dist/components/index.mjs.map +1 -1
- package/dist/design-system.css +235 -0
- package/dist/hooks/index.cjs +13 -0
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.mjs +14 -1
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/hooks/intlayerAPIHooks.cjs +86 -5
- package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
- package/dist/hooks/intlayerAPIHooks.d.ts +15 -1
- package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
- package/dist/hooks/intlayerAPIHooks.mjs +86 -5
- package/dist/hooks/intlayerAPIHooks.mjs.map +1 -1
- package/dist/hooks/useAsync/index.cjs +3 -0
- package/dist/hooks/useAsync/index.cjs.map +1 -1
- package/dist/hooks/useAsync/index.d.ts +1 -0
- package/dist/hooks/useAsync/index.d.ts.map +1 -1
- package/dist/hooks/useAsync/index.mjs +4 -1
- package/dist/hooks/useAsync/index.mjs.map +1 -1
- package/dist/hooks/useAsync/useAsync.cjs +2 -9
- package/dist/hooks/useAsync/useAsync.cjs.map +1 -1
- package/dist/hooks/useAsync/useAsync.d.ts.map +1 -1
- package/dist/hooks/useAsync/useAsync.mjs +3 -10
- package/dist/hooks/useAsync/useAsync.mjs.map +1 -1
- package/dist/hooks/useAsync/useAsyncStateStore.cjs +123 -73
- package/dist/hooks/useAsync/useAsyncStateStore.cjs.map +1 -1
- package/dist/hooks/useAsync/useAsyncStateStore.d.ts +35 -11
- package/dist/hooks/useAsync/useAsyncStateStore.d.ts.map +1 -1
- package/dist/hooks/useAsync/useAsyncStateStore.mjs +123 -73
- 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 +13 -1
- package/dist/hooks/useIntlayerAPI.d.ts.map +1 -1
- package/dist/hooks/useIsDarkMode.cjs +15 -0
- package/dist/hooks/useIsDarkMode.cjs.map +1 -0
- package/dist/hooks/useIsDarkMode.d.ts +2 -0
- package/dist/hooks/useIsDarkMode.d.ts.map +1 -0
- package/dist/hooks/useIsDarkMode.mjs +15 -0
- package/dist/hooks/useIsDarkMode.mjs.map +1 -0
- 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 +54 -0
- package/dist/libs/intlayer-api/ai.cjs.map +1 -0
- package/dist/libs/intlayer-api/ai.d.ts +16 -0
- package/dist/libs/intlayer-api/ai.d.ts.map +1 -0
- package/dist/libs/intlayer-api/ai.mjs +54 -0
- package/dist/libs/intlayer-api/ai.mjs.map +1 -0
- 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 +5 -1
- package/dist/libs/intlayer-api/index.cjs.map +1 -1
- package/dist/libs/intlayer-api/index.d.ts +26 -2
- package/dist/libs/intlayer-api/index.d.ts.map +1 -1
- package/dist/libs/intlayer-api/index.mjs +5 -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 +20 -18
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlockServer.cjs","sources":["../../../src/components/IDE/CodeBlockServer.tsx"],"sourcesContent":["import {\n transformerNotationDiff,\n transformerNotationHighlight,\n transformerNotationWordHighlight,\n transformerNotationErrorLevel,\n transformerMetaHighlight,\n transformerMetaWordHighlight,\n} from '@shikijs/transformers';\nimport { type HTMLAttributes, Suspense, type FC } from 'react';\nimport {\n BundledLanguage,\n BundledTheme,\n CodeToHastOptions,\n codeToHtml,\n} from 'shiki';\nimport { cn } from '../../utils/cn';\n\nexport const CodeBlockShiki = (async ({\n children,\n lang,\n isDarkMode,\n onChange,\n ...props\n}: CodeBlockProps) => {\n const shikiOptions: CodeToHastOptions<BundledLanguage, BundledTheme> = {\n lang,\n theme: isDarkMode ? 'github-dark' : 'github-light',\n transformers: [\n transformerNotationDiff(),\n transformerNotationHighlight(),\n transformerNotationWordHighlight(),\n transformerNotationErrorLevel(),\n transformerMetaHighlight(),\n transformerMetaWordHighlight(),\n ],\n };\n\n const out = await codeToHtml(children, shikiOptions);\n\n return <div dangerouslySetInnerHTML={{ __html: out }} {...props} />;\n}) as unknown as FC<CodeBlockProps>;\n\nconst CodeDefault: FC<CodeBlockProps> = ({\n children,\n isEditable,\n isDarkMode,\n onChange,\n ...props\n}) => (\n <div contentEditable={isEditable} {...props}>\n <pre>\n <code>\n {children.split('\\n').map((line, index) => (\n <span className=\"line block w-full\" key={index}>\n {line}\n </span>\n ))}\n </code>\n </pre>\n </div>\n);\n\nexport type CodeBlockProps = {\n children: string;\n lang: BundledLanguage;\n isDarkMode?: boolean;\n isEditable?: boolean;\n onChange?: (content: string) => void;\n} & Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>;\n\nexport const CodeBlock: FC<CodeBlockProps> = ({\n className,\n onChange,\n isEditable,\n ...props\n}) => (\n <Suspense fallback={<CodeDefault {...props} />}>\n <CodeBlockShiki\n className={cn('flex w-full', className)}\n contentEditable={isEditable}\n onInput={(e) => onChange?.(e.currentTarget.textContent ?? '')}\n {...props}\n />\n </Suspense>\n);\n"],"names":["transformerNotationDiff","transformerNotationHighlight","transformerNotationWordHighlight","transformerNotationErrorLevel","transformerMetaHighlight","transformerMetaWordHighlight","codeToHtml","jsx","Suspense","cn"],"mappings":";;;;;;;AAiBO,MAAM,iBAAkB,OAAO;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAsB;AACpB,QAAM,eAAiE;AAAA,IACrE;AAAA,IACA,OAAO,aAAa,gBAAgB;AAAA,IACpC,cAAc;AAAA,MACZA,qCAAwB;AAAA,MACxBC,0CAA6B;AAAA,MAC7BC,8CAAiC;AAAA,MACjCC,2CAA8B;AAAA,MAC9BC,sCAAyB;AAAA,MACzBC,aAA6B,6BAAA;AAAA,IAAA;AAAA,EAEjC;AAEA,QAAM,MAAM,MAAMC,iBAAW,UAAU,YAAY;AAE5C,SAAAC,2BAAA,kBAAA,IAAC,SAAI,yBAAyB,EAAE,QAAQ,IAAI,GAAI,GAAG,OAAO;AACnE;AAEA,MAAM,cAAkC,CAAC;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACEA,2BAAAA,kBAAAA,IAAC,OAAI,EAAA,iBAAiB,YAAa,GAAG,OACpC,UAAAA,2BAAA,kBAAA,IAAC,OACC,EAAA,UAAAA,2BAAAA,kBAAAA,IAAC,QACE,EAAA,UAAA,SAAS,MAAM,IAAI,EAAE,IAAI,CAAC,MAAM,UAC/BA,2BAAAA,kBAAAA,IAAC,QAAK,EAAA,WAAU,qBACb,UAAA,QADsC,KAEzC,CACD,EACH,CAAA,EACF,CAAA,GACF;AAWK,MAAM,YAAgC,CAAC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,uDACGC,WAAAA,UAAS,EAAA,2DAAW,aAAa,EAAA,GAAG,OAAO,GAC1C,UAAAD,2BAAA,kBAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWE,SAAAA,GAAG,eAAe,SAAS;AAAA,IACtC,iBAAiB;AAAA,IACjB,SAAS,CAAC,MAAM,WAAW,EAAE,cAAc,eAAe,EAAE;AAAA,IAC3D,GAAG;AAAA,EAAA;AACN,EACF,CAAA;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HTMLAttributes, FC } from 'react';
|
|
2
|
+
import { BundledLanguage } from 'shiki';
|
|
3
|
+
export declare const CodeBlockShiki: FC<CodeBlockProps>;
|
|
4
|
+
export type CodeBlockProps = {
|
|
5
|
+
children: string;
|
|
6
|
+
lang: BundledLanguage;
|
|
7
|
+
isDarkMode?: boolean;
|
|
8
|
+
isEditable?: boolean;
|
|
9
|
+
onChange?: (content: string) => void;
|
|
10
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>;
|
|
11
|
+
export declare const CodeBlock: FC<CodeBlockProps>;
|
|
12
|
+
//# sourceMappingURL=CodeBlockServer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlockServer.d.ts","sourceRoot":"","sources":["../../../src/components/IDE/CodeBlockServer.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,cAAc,EAAY,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EACL,eAAe,EAIhB,MAAM,OAAO,CAAC;AAGf,eAAO,MAAM,cAAc,EAuBV,EAAE,CAAC,cAAc,CAAC,CAAC;AAsBpC,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,eAAe,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,CAAC;AAErD,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAcxC,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../../jsx-runtime-DaNGiM0W.js";
|
|
2
|
+
import { transformerNotationDiff, transformerNotationHighlight, transformerNotationWordHighlight, transformerNotationErrorLevel, transformerMetaHighlight, transformerMetaWordHighlight } from "@shikijs/transformers";
|
|
3
|
+
import { Suspense } from "react";
|
|
4
|
+
import { codeToHtml } from "shiki";
|
|
5
|
+
import { cn } from "../../utils/cn.mjs";
|
|
6
|
+
const CodeBlockShiki = async ({
|
|
7
|
+
children,
|
|
8
|
+
lang,
|
|
9
|
+
isDarkMode,
|
|
10
|
+
onChange,
|
|
11
|
+
...props
|
|
12
|
+
}) => {
|
|
13
|
+
const shikiOptions = {
|
|
14
|
+
lang,
|
|
15
|
+
theme: isDarkMode ? "github-dark" : "github-light",
|
|
16
|
+
transformers: [
|
|
17
|
+
transformerNotationDiff(),
|
|
18
|
+
transformerNotationHighlight(),
|
|
19
|
+
transformerNotationWordHighlight(),
|
|
20
|
+
transformerNotationErrorLevel(),
|
|
21
|
+
transformerMetaHighlight(),
|
|
22
|
+
transformerMetaWordHighlight()
|
|
23
|
+
]
|
|
24
|
+
};
|
|
25
|
+
const out = await codeToHtml(children, shikiOptions);
|
|
26
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { dangerouslySetInnerHTML: { __html: out }, ...props });
|
|
27
|
+
};
|
|
28
|
+
const CodeDefault = ({
|
|
29
|
+
children,
|
|
30
|
+
isEditable,
|
|
31
|
+
isDarkMode,
|
|
32
|
+
onChange,
|
|
33
|
+
...props
|
|
34
|
+
}) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { contentEditable: isEditable, ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("code", { children: children.split("\n").map((line, index) => /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "line block w-full", children: line }, index)) }) }) });
|
|
35
|
+
const CodeBlock = ({
|
|
36
|
+
className,
|
|
37
|
+
onChange,
|
|
38
|
+
isEditable,
|
|
39
|
+
...props
|
|
40
|
+
}) => /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(CodeDefault, { ...props }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
41
|
+
CodeBlockShiki,
|
|
42
|
+
{
|
|
43
|
+
className: cn("flex w-full", className),
|
|
44
|
+
contentEditable: isEditable,
|
|
45
|
+
onInput: (e) => onChange?.(e.currentTarget.textContent ?? ""),
|
|
46
|
+
...props
|
|
47
|
+
}
|
|
48
|
+
) });
|
|
49
|
+
export {
|
|
50
|
+
CodeBlock,
|
|
51
|
+
CodeBlockShiki
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=CodeBlockServer.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlockServer.mjs","sources":["../../../src/components/IDE/CodeBlockServer.tsx"],"sourcesContent":["import {\n transformerNotationDiff,\n transformerNotationHighlight,\n transformerNotationWordHighlight,\n transformerNotationErrorLevel,\n transformerMetaHighlight,\n transformerMetaWordHighlight,\n} from '@shikijs/transformers';\nimport { type HTMLAttributes, Suspense, type FC } from 'react';\nimport {\n BundledLanguage,\n BundledTheme,\n CodeToHastOptions,\n codeToHtml,\n} from 'shiki';\nimport { cn } from '../../utils/cn';\n\nexport const CodeBlockShiki = (async ({\n children,\n lang,\n isDarkMode,\n onChange,\n ...props\n}: CodeBlockProps) => {\n const shikiOptions: CodeToHastOptions<BundledLanguage, BundledTheme> = {\n lang,\n theme: isDarkMode ? 'github-dark' : 'github-light',\n transformers: [\n transformerNotationDiff(),\n transformerNotationHighlight(),\n transformerNotationWordHighlight(),\n transformerNotationErrorLevel(),\n transformerMetaHighlight(),\n transformerMetaWordHighlight(),\n ],\n };\n\n const out = await codeToHtml(children, shikiOptions);\n\n return <div dangerouslySetInnerHTML={{ __html: out }} {...props} />;\n}) as unknown as FC<CodeBlockProps>;\n\nconst CodeDefault: FC<CodeBlockProps> = ({\n children,\n isEditable,\n isDarkMode,\n onChange,\n ...props\n}) => (\n <div contentEditable={isEditable} {...props}>\n <pre>\n <code>\n {children.split('\\n').map((line, index) => (\n <span className=\"line block w-full\" key={index}>\n {line}\n </span>\n ))}\n </code>\n </pre>\n </div>\n);\n\nexport type CodeBlockProps = {\n children: string;\n lang: BundledLanguage;\n isDarkMode?: boolean;\n isEditable?: boolean;\n onChange?: (content: string) => void;\n} & Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>;\n\nexport const CodeBlock: FC<CodeBlockProps> = ({\n className,\n onChange,\n isEditable,\n ...props\n}) => (\n <Suspense fallback={<CodeDefault {...props} />}>\n <CodeBlockShiki\n className={cn('flex w-full', className)}\n contentEditable={isEditable}\n onInput={(e) => onChange?.(e.currentTarget.textContent ?? '')}\n {...props}\n />\n </Suspense>\n);\n"],"names":["jsx"],"mappings":";;;;;AAiBO,MAAM,iBAAkB,OAAO;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAsB;AACpB,QAAM,eAAiE;AAAA,IACrE;AAAA,IACA,OAAO,aAAa,gBAAgB;AAAA,IACpC,cAAc;AAAA,MACZ,wBAAwB;AAAA,MACxB,6BAA6B;AAAA,MAC7B,iCAAiC;AAAA,MACjC,8BAA8B;AAAA,MAC9B,yBAAyB;AAAA,MACzB,6BAA6B;AAAA,IAAA;AAAA,EAEjC;AAEA,QAAM,MAAM,MAAM,WAAW,UAAU,YAAY;AAE5C,SAAAA,kCAAA,IAAC,SAAI,yBAAyB,EAAE,QAAQ,IAAI,GAAI,GAAG,OAAO;AACnE;AAEA,MAAM,cAAkC,CAAC;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACEA,kCAAAA,IAAC,OAAI,EAAA,iBAAiB,YAAa,GAAG,OACpC,UAAAA,kCAAA,IAAC,OACC,EAAA,UAAAA,kCAAAA,IAAC,QACE,EAAA,UAAA,SAAS,MAAM,IAAI,EAAE,IAAI,CAAC,MAAM,UAC/BA,kCAAAA,IAAC,QAAK,EAAA,WAAU,qBACb,UAAA,QADsC,KAEzC,CACD,EACH,CAAA,EACF,CAAA,GACF;AAWK,MAAM,YAAgC,CAAC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,4CACG,UAAS,EAAA,gDAAW,aAAa,EAAA,GAAG,OAAO,GAC1C,UAAAA,kCAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAW,GAAG,eAAe,SAAS;AAAA,IACtC,iBAAiB;AAAA,IACjB,SAAS,CAAC,MAAM,WAAW,EAAE,cAAc,eAAe,EAAE;AAAA,IAC3D,GAAG;AAAA,EAAA;AACN,EACF,CAAA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlockShiki.d.ts","sourceRoot":"","sources":["../../../src/components/IDE/CodeBlockShiki.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,eAAO,MAAM,cAAc,uDAMxB,cAAc,qDAiBhB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HTMLAttributes, FC } from 'react';
|
|
2
|
+
import { BundledLanguage } from 'shiki';
|
|
3
|
+
export declare const CodeBlockShiki: FC<CodeBlockProps>;
|
|
4
|
+
export type CodeBlockProps = {
|
|
5
|
+
children: string;
|
|
6
|
+
lang: BundledLanguage;
|
|
7
|
+
isDarkMode?: boolean;
|
|
8
|
+
isEditable?: boolean;
|
|
9
|
+
onChange?: (content: string) => void;
|
|
10
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>;
|
|
11
|
+
export declare const CodeBlock: FC<CodeBlockProps>;
|
|
12
|
+
//# sourceMappingURL=CodeBlockClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlockClient.d.ts","sourceRoot":"","sources":["../../../src/components/IDE/CodeBlockClient.tsx"],"names":[],"mappings":"AAUA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,EAAE,EAIR,MAAM,OAAO,CAAC;AACf,OAAO,EACL,eAAe,EAIhB,MAAM,OAAO,CAAC;AAiBf,eAAO,MAAM,cAAc,EAkCV,EAAE,CAAC,cAAc,CAAC,CAAC;AAEpC,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,eAAe,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,CAAC;AAErD,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAYxC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const jsxRuntime = require("../../jsx-runtime-XHKiWCTo.cjs");
|
|
5
|
+
const components_IDE_CodeContext = require("./CodeContext.cjs");
|
|
6
|
+
const CodeConditionalRender = ({ children, ...props }) => {
|
|
7
|
+
const { packageManager, codeFormat, contentDeclarationFormat } = components_IDE_CodeContext.useCodeContext();
|
|
8
|
+
const isPackageManagerUndefined = typeof props.packageManager === "undefined";
|
|
9
|
+
const isPackageManagerSelected = packageManager === props.packageManager;
|
|
10
|
+
const isCodeFormatUndefined = typeof props.codeFormat === "undefined";
|
|
11
|
+
const isCodeFormatSelected = codeFormat === props.codeFormat;
|
|
12
|
+
const isContentDeclarationFormatUndefined = typeof props.contentDeclarationFormat === "undefined";
|
|
13
|
+
const isContentDeclarationFormatSelected = contentDeclarationFormat === props.contentDeclarationFormat;
|
|
14
|
+
if ((isPackageManagerUndefined || isPackageManagerSelected) && (isCodeFormatUndefined || isCodeFormatSelected) && (isContentDeclarationFormatUndefined || isContentDeclarationFormatSelected)) {
|
|
15
|
+
return children;
|
|
16
|
+
}
|
|
17
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment, {});
|
|
18
|
+
};
|
|
19
|
+
exports.CodeConditionalRender = CodeConditionalRender;
|
|
20
|
+
//# sourceMappingURL=CodeConditionalRenderer.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeConditionalRenderer.cjs","sources":["../../../src/components/IDE/CodeConditionalRenderer.tsx"],"sourcesContent":["'use client';\n\nimport { FC, PropsWithChildren } from 'react';\nimport type { CodeCompAttributes } from './Code';\nimport { useCodeContext } from './CodeContext';\n\nexport const CodeConditionalRender: FC<\n PropsWithChildren<CodeCompAttributes>\n> = ({ children, ...props }) => {\n const { packageManager, codeFormat, contentDeclarationFormat } =\n useCodeContext();\n\n const isPackageManagerUndefined = typeof props.packageManager === 'undefined';\n const isPackageManagerSelected = packageManager === props.packageManager;\n\n const isCodeFormatUndefined = typeof props.codeFormat === 'undefined';\n const isCodeFormatSelected = codeFormat === props.codeFormat;\n\n const isContentDeclarationFormatUndefined =\n typeof props.contentDeclarationFormat === 'undefined';\n const isContentDeclarationFormatSelected =\n contentDeclarationFormat === props.contentDeclarationFormat;\n\n if (\n (isPackageManagerUndefined || isPackageManagerSelected) &&\n (isCodeFormatUndefined || isCodeFormatSelected) &&\n (isContentDeclarationFormatUndefined || isContentDeclarationFormatSelected)\n ) {\n return children;\n }\n\n return <></>;\n};\n"],"names":["useCodeContext","jsx","Fragment"],"mappings":";;;;;AAMO,MAAM,wBAET,CAAC,EAAE,UAAU,GAAG,YAAY;AAC9B,QAAM,EAAE,gBAAgB,YAAY,yBAAA,IAClCA,2BAAAA,eAAe;AAEX,QAAA,4BAA4B,OAAO,MAAM,mBAAmB;AAC5D,QAAA,2BAA2B,mBAAmB,MAAM;AAEpD,QAAA,wBAAwB,OAAO,MAAM,eAAe;AACpD,QAAA,uBAAuB,eAAe,MAAM;AAE5C,QAAA,sCACJ,OAAO,MAAM,6BAA6B;AACtC,QAAA,qCACJ,6BAA6B,MAAM;AAErC,OACG,6BAA6B,8BAC7B,yBAAyB,0BACzB,uCAAuC,qCACxC;AACO,WAAA;AAAA,EAAA;AAGT,SAASC,2BAAA,kBAAA,IAAAC,WAAA,kBAAA,UAAA,EAAA;AACX;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeConditionalRenderer.d.ts","sourceRoot":"","sources":["../../../src/components/IDE/CodeConditionalRenderer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAGjD,eAAO,MAAM,qBAAqB,EAAE,EAAE,CACpC,iBAAiB,CAAC,kBAAkB,CAAC,CAyBtC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { j as jsxRuntimeExports } from "../../jsx-runtime-DaNGiM0W.js";
|
|
3
|
+
import { useCodeContext } from "./CodeContext.mjs";
|
|
4
|
+
const CodeConditionalRender = ({ children, ...props }) => {
|
|
5
|
+
const { packageManager, codeFormat, contentDeclarationFormat } = useCodeContext();
|
|
6
|
+
const isPackageManagerUndefined = typeof props.packageManager === "undefined";
|
|
7
|
+
const isPackageManagerSelected = packageManager === props.packageManager;
|
|
8
|
+
const isCodeFormatUndefined = typeof props.codeFormat === "undefined";
|
|
9
|
+
const isCodeFormatSelected = codeFormat === props.codeFormat;
|
|
10
|
+
const isContentDeclarationFormatUndefined = typeof props.contentDeclarationFormat === "undefined";
|
|
11
|
+
const isContentDeclarationFormatSelected = contentDeclarationFormat === props.contentDeclarationFormat;
|
|
12
|
+
if ((isPackageManagerUndefined || isPackageManagerSelected) && (isCodeFormatUndefined || isCodeFormatSelected) && (isContentDeclarationFormatUndefined || isContentDeclarationFormatSelected)) {
|
|
13
|
+
return children;
|
|
14
|
+
}
|
|
15
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
CodeConditionalRender
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=CodeConditionalRenderer.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeConditionalRenderer.mjs","sources":["../../../src/components/IDE/CodeConditionalRenderer.tsx"],"sourcesContent":["'use client';\n\nimport { FC, PropsWithChildren } from 'react';\nimport type { CodeCompAttributes } from './Code';\nimport { useCodeContext } from './CodeContext';\n\nexport const CodeConditionalRender: FC<\n PropsWithChildren<CodeCompAttributes>\n> = ({ children, ...props }) => {\n const { packageManager, codeFormat, contentDeclarationFormat } =\n useCodeContext();\n\n const isPackageManagerUndefined = typeof props.packageManager === 'undefined';\n const isPackageManagerSelected = packageManager === props.packageManager;\n\n const isCodeFormatUndefined = typeof props.codeFormat === 'undefined';\n const isCodeFormatSelected = codeFormat === props.codeFormat;\n\n const isContentDeclarationFormatUndefined =\n typeof props.contentDeclarationFormat === 'undefined';\n const isContentDeclarationFormatSelected =\n contentDeclarationFormat === props.contentDeclarationFormat;\n\n if (\n (isPackageManagerUndefined || isPackageManagerSelected) &&\n (isCodeFormatUndefined || isCodeFormatSelected) &&\n (isContentDeclarationFormatUndefined || isContentDeclarationFormatSelected)\n ) {\n return children;\n }\n\n return <></>;\n};\n"],"names":["jsx","Fragment"],"mappings":";;;AAMO,MAAM,wBAET,CAAC,EAAE,UAAU,GAAG,YAAY;AAC9B,QAAM,EAAE,gBAAgB,YAAY,yBAAA,IAClC,eAAe;AAEX,QAAA,4BAA4B,OAAO,MAAM,mBAAmB;AAC5D,QAAA,2BAA2B,mBAAmB,MAAM;AAEpD,QAAA,wBAAwB,OAAO,MAAM,eAAe;AACpD,QAAA,uBAAuB,eAAe,MAAM;AAE5C,QAAA,sCACJ,OAAO,MAAM,6BAA6B;AACtC,QAAA,qCACJ,6BAA6B,MAAM;AAErC,OACG,6BAA6B,8BAC7B,yBAAyB,0BACzB,uCAAuC,qCACxC;AACO,WAAA;AAAA,EAAA;AAGT,SAASA,kCAAA,IAAAC,kBAAA,UAAA,EAAA;AACX;"}
|
|
@@ -0,0 +1,57 @@
|
|
|
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 CodeContext = require$$0.createContext({
|
|
15
|
+
packageManager: "npm",
|
|
16
|
+
setPackageManager: () => {
|
|
17
|
+
},
|
|
18
|
+
codeFormat: "typescript",
|
|
19
|
+
setCodeFormat: () => {
|
|
20
|
+
},
|
|
21
|
+
contentDeclarationFormat: "typescript",
|
|
22
|
+
setContentDeclarationFormat: () => {
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
const useCodeContext = () => require$$0.useContext(CodeContext);
|
|
26
|
+
const CodeProvider = ({ children }) => {
|
|
27
|
+
const [packageManager, setPackageManager] = hooks_usePersistedStore.usePersistedStore(
|
|
28
|
+
"packageManager",
|
|
29
|
+
"npm"
|
|
30
|
+
);
|
|
31
|
+
const [codeFormat, setCodeFormat] = hooks_usePersistedStore.usePersistedStore(
|
|
32
|
+
"codeFormat",
|
|
33
|
+
"typescript"
|
|
34
|
+
);
|
|
35
|
+
const [contentDeclarationFormat, setContentDeclarationFormat] = hooks_usePersistedStore.usePersistedStore(
|
|
36
|
+
"contentDeclarationFormat",
|
|
37
|
+
"typescript"
|
|
38
|
+
);
|
|
39
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
40
|
+
CodeContext.Provider,
|
|
41
|
+
{
|
|
42
|
+
value: {
|
|
43
|
+
packageManager,
|
|
44
|
+
setPackageManager,
|
|
45
|
+
codeFormat,
|
|
46
|
+
setCodeFormat,
|
|
47
|
+
contentDeclarationFormat,
|
|
48
|
+
setContentDeclarationFormat
|
|
49
|
+
},
|
|
50
|
+
children
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
exports.CodeContext = CodeContext;
|
|
55
|
+
exports.CodeProvider = CodeProvider;
|
|
56
|
+
exports.useCodeContext = useCodeContext;
|
|
57
|
+
//# sourceMappingURL=CodeContext.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeContext.cjs","sources":["../../../src/components/IDE/CodeContext.tsx"],"sourcesContent":["'use client';\n\nimport {\n type FC,\n type PropsWithChildren,\n createContext,\n useContext,\n} from 'react';\nimport { usePersistedStore } from '../../hooks';\n\nexport type PackageManager = 'npm' | 'pnpm' | 'yarn';\nexport type CodeFormat = 'typescript' | 'commonjs' | 'esm';\nexport type ContentDeclarationFormat =\n | 'typescript'\n | 'commonjs'\n | 'esm'\n | 'json';\n\ntype CodeContextValue = {\n packageManager: PackageManager;\n setPackageManager: (packageManager: PackageManager) => void;\n codeFormat: CodeFormat;\n setCodeFormat: (codeFormat: CodeFormat) => void;\n contentDeclarationFormat: ContentDeclarationFormat;\n setContentDeclarationFormat: (\n contentDeclarationFormat: ContentDeclarationFormat\n ) => void;\n};\n\n/**\n * Context that store the current locale on the client side\n */\nexport const CodeContext = createContext<CodeContextValue>({\n packageManager: 'npm',\n setPackageManager: () => {},\n codeFormat: 'typescript',\n setCodeFormat: () => {},\n contentDeclarationFormat: 'typescript',\n setContentDeclarationFormat: () => {},\n});\n\n/**\n * Hook that provides the current locale\n */\nexport const useCodeContext = () => useContext(CodeContext);\n\n/**\n * Provider that store the current locale on the client side\n */\nexport const CodeProvider: FC<PropsWithChildren> = ({ children }) => {\n const [packageManager, setPackageManager] = usePersistedStore<PackageManager>(\n 'packageManager',\n 'npm'\n );\n const [codeFormat, setCodeFormat] = usePersistedStore<CodeFormat>(\n 'codeFormat',\n 'typescript'\n );\n const [contentDeclarationFormat, setContentDeclarationFormat] =\n usePersistedStore<ContentDeclarationFormat>(\n 'contentDeclarationFormat',\n 'typescript'\n );\n\n return (\n <CodeContext.Provider\n value={{\n packageManager,\n setPackageManager,\n codeFormat,\n setCodeFormat,\n contentDeclarationFormat,\n setContentDeclarationFormat,\n }}\n >\n {children}\n </CodeContext.Provider>\n );\n};\n"],"names":["createContext","useContext","usePersistedStore","jsx"],"mappings":";;;;;;;;;;;;;AAgCO,MAAM,cAAcA,WAAAA,cAAgC;AAAA,EACzD,gBAAgB;AAAA,EAChB,mBAAmB,MAAM;AAAA,EAAC;AAAA,EAC1B,YAAY;AAAA,EACZ,eAAe,MAAM;AAAA,EAAC;AAAA,EACtB,0BAA0B;AAAA,EAC1B,6BAA6B,MAAM;AAAA,EAAA;AACrC,CAAC;AAKY,MAAA,iBAAiB,MAAMC,WAAAA,WAAW,WAAW;AAKnD,MAAM,eAAsC,CAAC,EAAE,eAAe;AAC7D,QAAA,CAAC,gBAAgB,iBAAiB,IAAIC,wBAAA;AAAA,IAC1C;AAAA,IACA;AAAA,EACF;AACM,QAAA,CAAC,YAAY,aAAa,IAAIA,wBAAA;AAAA,IAClC;AAAA,IACA;AAAA,EACF;AACM,QAAA,CAAC,0BAA0B,2BAA2B,IAC1DA,wBAAA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAGA,SAAAC,2BAAA,kBAAA;AAAA,IAAC,YAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MAEC;AAAA,IAAA;AAAA,EACH;AAEJ;;;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
export type PackageManager = 'npm' | 'pnpm' | 'yarn';
|
|
3
|
+
export type CodeFormat = 'typescript' | 'commonjs' | 'esm';
|
|
4
|
+
export type ContentDeclarationFormat = 'typescript' | 'commonjs' | 'esm' | 'json';
|
|
5
|
+
type CodeContextValue = {
|
|
6
|
+
packageManager: PackageManager;
|
|
7
|
+
setPackageManager: (packageManager: PackageManager) => void;
|
|
8
|
+
codeFormat: CodeFormat;
|
|
9
|
+
setCodeFormat: (codeFormat: CodeFormat) => void;
|
|
10
|
+
contentDeclarationFormat: ContentDeclarationFormat;
|
|
11
|
+
setContentDeclarationFormat: (contentDeclarationFormat: ContentDeclarationFormat) => void;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Context that store the current locale on the client side
|
|
15
|
+
*/
|
|
16
|
+
export declare const CodeContext: import('react').Context<CodeContextValue>;
|
|
17
|
+
/**
|
|
18
|
+
* Hook that provides the current locale
|
|
19
|
+
*/
|
|
20
|
+
export declare const useCodeContext: () => CodeContextValue;
|
|
21
|
+
/**
|
|
22
|
+
* Provider that store the current locale on the client side
|
|
23
|
+
*/
|
|
24
|
+
export declare const CodeProvider: FC<PropsWithChildren>;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=CodeContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeContext.d.ts","sourceRoot":"","sources":["../../../src/components/IDE/CodeContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,EAAE,EACP,KAAK,iBAAiB,EAGvB,MAAM,OAAO,CAAC;AAGf,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AACrD,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,UAAU,GAAG,KAAK,CAAC;AAC3D,MAAM,MAAM,wBAAwB,GAChC,YAAY,GACZ,UAAU,GACV,KAAK,GACL,MAAM,CAAC;AAEX,KAAK,gBAAgB,GAAG;IACtB,cAAc,EAAE,cAAc,CAAC;IAC/B,iBAAiB,EAAE,CAAC,cAAc,EAAE,cAAc,KAAK,IAAI,CAAC;IAC5D,UAAU,EAAE,UAAU,CAAC;IACvB,aAAa,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAChD,wBAAwB,EAAE,wBAAwB,CAAC;IACnD,2BAA2B,EAAE,CAC3B,wBAAwB,EAAE,wBAAwB,KAC/C,IAAI,CAAC;CACX,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,2CAOtB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,cAAc,wBAAgC,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CA6B9C,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { j as jsxRuntimeExports } from "../../jsx-runtime-DaNGiM0W.js";
|
|
3
|
+
import { createContext, useContext } from "react";
|
|
4
|
+
import "../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
|
|
5
|
+
import "../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
6
|
+
import "../../libs/intlayer-api/index.mjs";
|
|
7
|
+
import "@intlayer/config/client";
|
|
8
|
+
import "../Toaster/Toast.mjs";
|
|
9
|
+
import "@intlayer/dictionaries-entry";
|
|
10
|
+
import "deepmerge";
|
|
11
|
+
import { usePersistedStore } from "../../hooks/usePersistedStore.mjs";
|
|
12
|
+
const CodeContext = createContext({
|
|
13
|
+
packageManager: "npm",
|
|
14
|
+
setPackageManager: () => {
|
|
15
|
+
},
|
|
16
|
+
codeFormat: "typescript",
|
|
17
|
+
setCodeFormat: () => {
|
|
18
|
+
},
|
|
19
|
+
contentDeclarationFormat: "typescript",
|
|
20
|
+
setContentDeclarationFormat: () => {
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const useCodeContext = () => useContext(CodeContext);
|
|
24
|
+
const CodeProvider = ({ children }) => {
|
|
25
|
+
const [packageManager, setPackageManager] = usePersistedStore(
|
|
26
|
+
"packageManager",
|
|
27
|
+
"npm"
|
|
28
|
+
);
|
|
29
|
+
const [codeFormat, setCodeFormat] = usePersistedStore(
|
|
30
|
+
"codeFormat",
|
|
31
|
+
"typescript"
|
|
32
|
+
);
|
|
33
|
+
const [contentDeclarationFormat, setContentDeclarationFormat] = usePersistedStore(
|
|
34
|
+
"contentDeclarationFormat",
|
|
35
|
+
"typescript"
|
|
36
|
+
);
|
|
37
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38
|
+
CodeContext.Provider,
|
|
39
|
+
{
|
|
40
|
+
value: {
|
|
41
|
+
packageManager,
|
|
42
|
+
setPackageManager,
|
|
43
|
+
codeFormat,
|
|
44
|
+
setCodeFormat,
|
|
45
|
+
contentDeclarationFormat,
|
|
46
|
+
setContentDeclarationFormat
|
|
47
|
+
},
|
|
48
|
+
children
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
CodeContext,
|
|
54
|
+
CodeProvider,
|
|
55
|
+
useCodeContext
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=CodeContext.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeContext.mjs","sources":["../../../src/components/IDE/CodeContext.tsx"],"sourcesContent":["'use client';\n\nimport {\n type FC,\n type PropsWithChildren,\n createContext,\n useContext,\n} from 'react';\nimport { usePersistedStore } from '../../hooks';\n\nexport type PackageManager = 'npm' | 'pnpm' | 'yarn';\nexport type CodeFormat = 'typescript' | 'commonjs' | 'esm';\nexport type ContentDeclarationFormat =\n | 'typescript'\n | 'commonjs'\n | 'esm'\n | 'json';\n\ntype CodeContextValue = {\n packageManager: PackageManager;\n setPackageManager: (packageManager: PackageManager) => void;\n codeFormat: CodeFormat;\n setCodeFormat: (codeFormat: CodeFormat) => void;\n contentDeclarationFormat: ContentDeclarationFormat;\n setContentDeclarationFormat: (\n contentDeclarationFormat: ContentDeclarationFormat\n ) => void;\n};\n\n/**\n * Context that store the current locale on the client side\n */\nexport const CodeContext = createContext<CodeContextValue>({\n packageManager: 'npm',\n setPackageManager: () => {},\n codeFormat: 'typescript',\n setCodeFormat: () => {},\n contentDeclarationFormat: 'typescript',\n setContentDeclarationFormat: () => {},\n});\n\n/**\n * Hook that provides the current locale\n */\nexport const useCodeContext = () => useContext(CodeContext);\n\n/**\n * Provider that store the current locale on the client side\n */\nexport const CodeProvider: FC<PropsWithChildren> = ({ children }) => {\n const [packageManager, setPackageManager] = usePersistedStore<PackageManager>(\n 'packageManager',\n 'npm'\n );\n const [codeFormat, setCodeFormat] = usePersistedStore<CodeFormat>(\n 'codeFormat',\n 'typescript'\n );\n const [contentDeclarationFormat, setContentDeclarationFormat] =\n usePersistedStore<ContentDeclarationFormat>(\n 'contentDeclarationFormat',\n 'typescript'\n );\n\n return (\n <CodeContext.Provider\n value={{\n packageManager,\n setPackageManager,\n codeFormat,\n setCodeFormat,\n contentDeclarationFormat,\n setContentDeclarationFormat,\n }}\n >\n {children}\n </CodeContext.Provider>\n );\n};\n"],"names":["jsx"],"mappings":";;;;;;;;;;;AAgCO,MAAM,cAAc,cAAgC;AAAA,EACzD,gBAAgB;AAAA,EAChB,mBAAmB,MAAM;AAAA,EAAC;AAAA,EAC1B,YAAY;AAAA,EACZ,eAAe,MAAM;AAAA,EAAC;AAAA,EACtB,0BAA0B;AAAA,EAC1B,6BAA6B,MAAM;AAAA,EAAA;AACrC,CAAC;AAKY,MAAA,iBAAiB,MAAM,WAAW,WAAW;AAKnD,MAAM,eAAsC,CAAC,EAAE,eAAe;AAC7D,QAAA,CAAC,gBAAgB,iBAAiB,IAAI;AAAA,IAC1C;AAAA,IACA;AAAA,EACF;AACM,QAAA,CAAC,YAAY,aAAa,IAAI;AAAA,IAClC;AAAA,IACA;AAAA,EACF;AACM,QAAA,CAAC,0BAA0B,2BAA2B,IAC1D;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAGA,SAAAA,kCAAA;AAAA,IAAC,YAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MAEC;AAAA,IAAA;AAAA,EACH;AAEJ;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const jsxRuntime = require("../../jsx-runtime-XHKiWCTo.cjs");
|
|
5
|
+
require("../Select/Multiselect.cjs");
|
|
6
|
+
const components_Select_Select = require("../Select/Select.cjs");
|
|
7
|
+
const components_IDE_CodeContext = require("./CodeContext.cjs");
|
|
8
|
+
const CodeFormatSelector = () => {
|
|
9
|
+
const { codeFormat, setCodeFormat, setContentDeclarationFormat } = components_IDE_CodeContext.useCodeContext();
|
|
10
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
|
|
11
|
+
components_Select_Select.Select,
|
|
12
|
+
{
|
|
13
|
+
value: codeFormat,
|
|
14
|
+
onValueChange: (value) => {
|
|
15
|
+
setCodeFormat(value);
|
|
16
|
+
setContentDeclarationFormat(value);
|
|
17
|
+
},
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Select_Select.Select.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Select_Select.Select.Value, { placeholder: "Code Format" }) }),
|
|
20
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(components_Select_Select.Select.Content, { children: [
|
|
21
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Select_Select.Select.Item, { value: "typescript", children: "TypeScript" }),
|
|
22
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Select_Select.Select.Item, { value: "esm", children: "ESM" }),
|
|
23
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Select_Select.Select.Item, { value: "commonjs", children: "CommonJS" })
|
|
24
|
+
] })
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
exports.CodeFormatSelector = CodeFormatSelector;
|
|
30
|
+
//# sourceMappingURL=CodeFormatSelector.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeFormatSelector.cjs","sources":["../../../src/components/IDE/CodeFormatSelector.tsx"],"sourcesContent":["'use client';\n\nimport type { FC } from 'react';\nimport { Select } from '../Select';\nimport { useCodeContext } from './CodeContext';\n\nexport const CodeFormatSelector: FC = () => {\n const { codeFormat, setCodeFormat, setContentDeclarationFormat } =\n useCodeContext();\n\n return (\n <Select\n value={codeFormat}\n onValueChange={(value) => {\n setCodeFormat(value as typeof codeFormat);\n setContentDeclarationFormat(value as typeof codeFormat);\n }}\n >\n <Select.Trigger>\n <Select.Value placeholder=\"Code Format\" />\n </Select.Trigger>\n <Select.Content>\n <Select.Item value=\"typescript\">TypeScript</Select.Item>\n <Select.Item value=\"esm\">ESM</Select.Item>\n <Select.Item value=\"commonjs\">CommonJS</Select.Item>\n </Select.Content>\n </Select>\n );\n};\n"],"names":["useCodeContext","jsxs","Select","jsx"],"mappings":";;;;;;;AAMO,MAAM,qBAAyB,MAAM;AAC1C,QAAM,EAAE,YAAY,eAAe,4BAAA,IACjCA,2BAAAA,eAAe;AAGf,SAAAC,2BAAA,kBAAA;AAAA,IAACC,yBAAA;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,MACP,eAAe,CAAC,UAAU;AACxB,sBAAc,KAA0B;AACxC,oCAA4B,KAA0B;AAAA,MACxD;AAAA,MAEA,UAAA;AAAA,QAACC,2BAAAA,kBAAAA,IAAAD,yBAAA,OAAO,SAAP,EACC,UAAAC,2BAAA,kBAAA,IAACD,gCAAO,OAAP,EAAa,aAAY,cAAA,CAAc,EAC1C,CAAA;AAAA,QACAD,2BAAAA,kBAAAA,KAACC,yBAAO,OAAA,SAAP,EACC,UAAA;AAAA,UAAAC,2BAAA,kBAAA,IAACD,yBAAO,OAAA,MAAP,EAAY,OAAM,cAAa,UAAU,cAAA;AAAA,2DACzCA,yBAAO,OAAA,MAAP,EAAY,OAAM,OAAM,UAAG,OAAA;AAAA,2DAC3BA,yBAAO,OAAA,MAAP,EAAY,OAAM,YAAW,UAAQ,WAAA,CAAA;AAAA,QAAA,EACxC,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACF;AAEJ;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeFormatSelector.d.ts","sourceRoot":"","sources":["../../../src/components/IDE/CodeFormatSelector.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,eAAO,MAAM,kBAAkB,EAAE,EAsBhC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { j as jsxRuntimeExports } from "../../jsx-runtime-DaNGiM0W.js";
|
|
3
|
+
import "../Select/Multiselect.mjs";
|
|
4
|
+
import { Select } from "../Select/Select.mjs";
|
|
5
|
+
import { useCodeContext } from "./CodeContext.mjs";
|
|
6
|
+
const CodeFormatSelector = () => {
|
|
7
|
+
const { codeFormat, setCodeFormat, setContentDeclarationFormat } = useCodeContext();
|
|
8
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
9
|
+
Select,
|
|
10
|
+
{
|
|
11
|
+
value: codeFormat,
|
|
12
|
+
onValueChange: (value) => {
|
|
13
|
+
setCodeFormat(value);
|
|
14
|
+
setContentDeclarationFormat(value);
|
|
15
|
+
},
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Trigger, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Value, { placeholder: "Code Format" }) }),
|
|
18
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Select.Content, { children: [
|
|
19
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, { value: "typescript", children: "TypeScript" }),
|
|
20
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, { value: "esm", children: "ESM" }),
|
|
21
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, { value: "commonjs", children: "CommonJS" })
|
|
22
|
+
] })
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
CodeFormatSelector
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=CodeFormatSelector.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeFormatSelector.mjs","sources":["../../../src/components/IDE/CodeFormatSelector.tsx"],"sourcesContent":["'use client';\n\nimport type { FC } from 'react';\nimport { Select } from '../Select';\nimport { useCodeContext } from './CodeContext';\n\nexport const CodeFormatSelector: FC = () => {\n const { codeFormat, setCodeFormat, setContentDeclarationFormat } =\n useCodeContext();\n\n return (\n <Select\n value={codeFormat}\n onValueChange={(value) => {\n setCodeFormat(value as typeof codeFormat);\n setContentDeclarationFormat(value as typeof codeFormat);\n }}\n >\n <Select.Trigger>\n <Select.Value placeholder=\"Code Format\" />\n </Select.Trigger>\n <Select.Content>\n <Select.Item value=\"typescript\">TypeScript</Select.Item>\n <Select.Item value=\"esm\">ESM</Select.Item>\n <Select.Item value=\"commonjs\">CommonJS</Select.Item>\n </Select.Content>\n </Select>\n );\n};\n"],"names":["jsxs","jsx"],"mappings":";;;;;AAMO,MAAM,qBAAyB,MAAM;AAC1C,QAAM,EAAE,YAAY,eAAe,4BAAA,IACjC,eAAe;AAGf,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,MACP,eAAe,CAAC,UAAU;AACxB,sBAAc,KAA0B;AACxC,oCAA4B,KAA0B;AAAA,MACxD;AAAA,MAEA,UAAA;AAAA,QAACC,kCAAAA,IAAA,OAAO,SAAP,EACC,UAAAA,kCAAA,IAAC,OAAO,OAAP,EAAa,aAAY,cAAA,CAAc,EAC1C,CAAA;AAAA,QACAD,kCAAAA,KAAC,OAAO,SAAP,EACC,UAAA;AAAA,UAAAC,kCAAA,IAAC,OAAO,MAAP,EAAY,OAAM,cAAa,UAAU,cAAA;AAAA,gDACzC,OAAO,MAAP,EAAY,OAAM,OAAM,UAAG,OAAA;AAAA,gDAC3B,OAAO,MAAP,EAAY,OAAM,YAAW,UAAQ,WAAA,CAAA;AAAA,QAAA,EACxC,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const jsxRuntime = require("../../jsx-runtime-XHKiWCTo.cjs");
|
|
5
|
+
const react = require("@monaco-editor/react");
|
|
6
|
+
const lucideReact = require("lucide-react");
|
|
7
|
+
const require$$0 = require("react");
|
|
8
|
+
const CopyToClipboard = require("react-copy-to-clipboard");
|
|
9
|
+
const utils_cn = require("../../utils/cn.cjs");
|
|
10
|
+
const components_Button_Button = require("../Button/Button.cjs");
|
|
11
|
+
const components_Loader_index = require("../Loader/index.cjs");
|
|
12
|
+
const MonacoCode = ({
|
|
13
|
+
children,
|
|
14
|
+
language,
|
|
15
|
+
isDarkMode,
|
|
16
|
+
showLineNumbers,
|
|
17
|
+
showCopyButton = true,
|
|
18
|
+
isReadOnly = false,
|
|
19
|
+
onChange
|
|
20
|
+
}) => {
|
|
21
|
+
const [copied, setCopied] = require$$0.useState(false);
|
|
22
|
+
const containerRef = require$$0.useRef(null);
|
|
23
|
+
const ideRef = require$$0.useRef(null);
|
|
24
|
+
const [editorSize, setEditorSize] = require$$0.useState({ height: 0, width: 0 });
|
|
25
|
+
require$$0.useEffect(() => {
|
|
26
|
+
const timer = setTimeout(() => {
|
|
27
|
+
setCopied(false);
|
|
28
|
+
}, 1e3);
|
|
29
|
+
return () => clearTimeout(timer);
|
|
30
|
+
}, [copied]);
|
|
31
|
+
const handleMountIde = require$$0.useCallback(
|
|
32
|
+
(editor, monaco) => {
|
|
33
|
+
ideRef.current = editor;
|
|
34
|
+
const contentHeight = (editor.getContentHeight() ?? 0) + 25;
|
|
35
|
+
monaco.editor.defineTheme("transparent-theme", {
|
|
36
|
+
base: isDarkMode ? "vs-dark" : "vs",
|
|
37
|
+
inherit: true,
|
|
38
|
+
rules: [],
|
|
39
|
+
colors: {
|
|
40
|
+
"editor.background": "#00000000"
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
monaco.languages.typescript.typescriptDefaults.setDiagnosticsOptions({
|
|
44
|
+
noSemanticValidation: true,
|
|
45
|
+
// Disables type checking
|
|
46
|
+
noSyntaxValidation: true
|
|
47
|
+
// Disables syntax errors
|
|
48
|
+
});
|
|
49
|
+
monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({
|
|
50
|
+
noSemanticValidation: true,
|
|
51
|
+
noSyntaxValidation: true
|
|
52
|
+
});
|
|
53
|
+
monaco.languages.typescript.typescriptDefaults.setCompilerOptions({
|
|
54
|
+
noLib: true,
|
|
55
|
+
allowNonTsExtensions: true
|
|
56
|
+
});
|
|
57
|
+
monaco.languages.typescript.javascriptDefaults.setCompilerOptions({
|
|
58
|
+
noLib: true,
|
|
59
|
+
allowNonTsExtensions: true
|
|
60
|
+
});
|
|
61
|
+
setEditorSize({
|
|
62
|
+
height: contentHeight,
|
|
63
|
+
width: containerRef.current?.clientWidth ?? 0
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
[isDarkMode]
|
|
67
|
+
);
|
|
68
|
+
const isShowLineNumbers = showLineNumbers ?? children.split("\n").length > 1;
|
|
69
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
className: utils_cn.cn(
|
|
73
|
+
"relative h-full w-full text-sm",
|
|
74
|
+
showLineNumbers && "ml-0"
|
|
75
|
+
),
|
|
76
|
+
children: [
|
|
77
|
+
showCopyButton && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(CopyToClipboard, { text: children, onCopy: () => setCopied(true), children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
78
|
+
components_Button_Button.Button,
|
|
79
|
+
{
|
|
80
|
+
className: utils_cn.cn(
|
|
81
|
+
"absolute right-3 top-3 z-50",
|
|
82
|
+
copied && "!text-success/70 !dark:text-success-dark/70"
|
|
83
|
+
),
|
|
84
|
+
label: "Cpoy code",
|
|
85
|
+
variant: "hoverable",
|
|
86
|
+
color: "text",
|
|
87
|
+
size: "icon-sm",
|
|
88
|
+
Icon: copied ? lucideReact.CopyCheckIcon : lucideReact.CopyIcon
|
|
89
|
+
}
|
|
90
|
+
) }),
|
|
91
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
92
|
+
"div",
|
|
93
|
+
{
|
|
94
|
+
className: "grid size-full grid-cols-[0px] overflow-auto",
|
|
95
|
+
ref: containerRef,
|
|
96
|
+
children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
97
|
+
react.Editor,
|
|
98
|
+
{
|
|
99
|
+
...editorSize,
|
|
100
|
+
defaultLanguage: "typescript",
|
|
101
|
+
language,
|
|
102
|
+
loading: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Loader_index.Loader, {}),
|
|
103
|
+
defaultValue: String(children).replace(/\n$/, ""),
|
|
104
|
+
onMount: handleMountIde,
|
|
105
|
+
onChange,
|
|
106
|
+
options: {
|
|
107
|
+
readOnly: isReadOnly,
|
|
108
|
+
cursorStyle: "line",
|
|
109
|
+
minimap: { enabled: false },
|
|
110
|
+
scrollbar: {
|
|
111
|
+
vertical: "hidden",
|
|
112
|
+
verticalScrollbarSize: 0,
|
|
113
|
+
alwaysConsumeMouseWheel: false
|
|
114
|
+
},
|
|
115
|
+
folding: false,
|
|
116
|
+
// Disable code folding
|
|
117
|
+
renderValidationDecorations: "off",
|
|
118
|
+
// Disable error/warning decorations
|
|
119
|
+
quickSuggestions: false,
|
|
120
|
+
// Disable IntelliSense
|
|
121
|
+
parameterHints: { enabled: false },
|
|
122
|
+
// Disable parameter hints
|
|
123
|
+
suggestOnTriggerCharacters: false,
|
|
124
|
+
// Disable suggestions on typing
|
|
125
|
+
mouseWheelScrollSensitivity: 0,
|
|
126
|
+
fastScrollSensitivity: 0,
|
|
127
|
+
scrollBeyondLastLine: false,
|
|
128
|
+
lineNumbers: isShowLineNumbers ? "on" : "off"
|
|
129
|
+
},
|
|
130
|
+
theme: "transparent-theme",
|
|
131
|
+
className: "my-2 rounded-md"
|
|
132
|
+
}
|
|
133
|
+
)
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
};
|
|
140
|
+
exports.MonacoCode = MonacoCode;
|
|
141
|
+
//# sourceMappingURL=CodeRender copy.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeRender copy.cjs","sources":["../../../src/components/IDE/CodeRender copy.tsx"],"sourcesContent":["'use client';\n\nimport { Editor, OnChange, OnMount } from '@monaco-editor/react';\nimport { CopyCheckIcon, CopyIcon } from 'lucide-react';\nimport { type FC, useEffect, useState, useRef, useCallback } from 'react';\nimport CopyToClipboard from 'react-copy-to-clipboard';\nimport { cn } from '../../utils/cn';\nimport { Button } from '../Button';\nimport { Loader } from '../Loader';\n\ntype CodeCompProps = {\n children: string;\n language: string;\n isDarkMode?: boolean;\n showLineNumbers?: boolean;\n showCopyButton?: boolean;\n isReadOnly?: boolean;\n onChange?: OnChange;\n};\n\nexport const MonacoCode: FC<CodeCompProps> = ({\n children,\n language,\n isDarkMode,\n showLineNumbers,\n showCopyButton = true,\n isReadOnly = false,\n onChange,\n}) => {\n const [copied, setCopied] = useState(false);\n const containerRef = useRef<HTMLDivElement>(null);\n const ideRef = useRef(null);\n const [editorSize, setEditorSize] = useState<{\n height: number;\n width: number;\n }>({ height: 0, width: 0 });\n\n useEffect(() => {\n const timer = setTimeout(() => {\n setCopied(false);\n }, 1000);\n return () => clearTimeout(timer);\n }, [copied]);\n\n const handleMountIde: OnMount = useCallback(\n (editor, monaco) => {\n // first time you set the height based on content Height\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ideRef.current = editor as any;\n const contentHeight = (editor.getContentHeight() ?? 0) + 25;\n\n monaco.editor.defineTheme('transparent-theme', {\n base: isDarkMode ? 'vs-dark' : 'vs',\n inherit: true,\n rules: [],\n colors: {\n 'editor.background': '#00000000',\n },\n });\n\n // Disable TypeScript diagnostics\n monaco.languages.typescript.typescriptDefaults.setDiagnosticsOptions({\n noSemanticValidation: true, // Disables type checking\n noSyntaxValidation: true, // Disables syntax errors\n });\n\n // Disable JavaScript diagnostics\n monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({\n noSemanticValidation: true,\n noSyntaxValidation: true,\n });\n\n // Disable unnecessary language features (e.g., suggestions, quick fixes)\n monaco.languages.typescript.typescriptDefaults.setCompilerOptions({\n noLib: true,\n allowNonTsExtensions: true,\n });\n\n monaco.languages.typescript.javascriptDefaults.setCompilerOptions({\n noLib: true,\n allowNonTsExtensions: true,\n });\n\n setEditorSize({\n height: contentHeight,\n width: containerRef.current?.clientWidth ?? 0,\n });\n },\n [isDarkMode]\n );\n\n const isShowLineNumbers = showLineNumbers ?? children.split('\\n').length > 1;\n\n return (\n <div\n className={cn(\n 'relative h-full w-full text-sm',\n showLineNumbers && 'ml-0'\n )}\n >\n {showCopyButton && (\n <CopyToClipboard text={children} onCopy={() => setCopied(true)}>\n <Button\n className={cn(\n 'absolute right-3 top-3 z-50',\n copied && '!text-success/70 !dark:text-success-dark/70'\n )}\n label=\"Cpoy code\"\n variant=\"hoverable\"\n color=\"text\"\n size=\"icon-sm\"\n Icon={copied ? CopyCheckIcon : CopyIcon}\n />\n </CopyToClipboard>\n )}\n <div\n className=\"grid size-full grid-cols-[0px] overflow-auto\"\n ref={containerRef}\n >\n <Editor\n {...editorSize}\n defaultLanguage=\"typescript\"\n language={language}\n loading={<Loader />}\n defaultValue={String(children).replace(/\\n$/, '')}\n onMount={handleMountIde}\n onChange={onChange}\n options={{\n readOnly: isReadOnly,\n cursorStyle: 'line',\n minimap: { enabled: false },\n scrollbar: {\n vertical: 'hidden',\n verticalScrollbarSize: 0,\n alwaysConsumeMouseWheel: false,\n },\n folding: false, // Disable code folding\n renderValidationDecorations: 'off', // Disable error/warning decorations\n quickSuggestions: false, // Disable IntelliSense\n parameterHints: { enabled: false }, // Disable parameter hints\n suggestOnTriggerCharacters: false, // Disable suggestions on typing\n\n mouseWheelScrollSensitivity: 0,\n fastScrollSensitivity: 0,\n scrollBeyondLastLine: false,\n lineNumbers: isShowLineNumbers ? 'on' : 'off',\n }}\n theme=\"transparent-theme\"\n className=\"my-2 rounded-md\"\n />\n </div>\n </div>\n );\n};\n"],"names":["useState","useRef","useEffect","useCallback","jsxs","cn","jsx","Button","CopyCheckIcon","CopyIcon","Editor","Loader"],"mappings":";;;;;;;;;;;AAoBO,MAAM,aAAgC,CAAC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb;AACF,MAAM;AACJ,QAAM,CAAC,QAAQ,SAAS,IAAIA,WAAAA,SAAS,KAAK;AACpC,QAAA,eAAeC,kBAAuB,IAAI;AAC1C,QAAA,SAASA,kBAAO,IAAI;AACpB,QAAA,CAAC,YAAY,aAAa,IAAID,WAAA,SAGjC,EAAE,QAAQ,GAAG,OAAO,GAAG;AAE1BE,aAAAA,UAAU,MAAM;AACR,UAAA,QAAQ,WAAW,MAAM;AAC7B,gBAAU,KAAK;AAAA,OACd,GAAI;AACA,WAAA,MAAM,aAAa,KAAK;AAAA,EAAA,GAC9B,CAAC,MAAM,CAAC;AAEX,QAAM,iBAA0BC,WAAA;AAAA,IAC9B,CAAC,QAAQ,WAAW;AAGlB,aAAO,UAAU;AACjB,YAAM,iBAAiB,OAAO,iBAAiB,KAAK,KAAK;AAElD,aAAA,OAAO,YAAY,qBAAqB;AAAA,QAC7C,MAAM,aAAa,YAAY;AAAA,QAC/B,SAAS;AAAA,QACT,OAAO,CAAC;AAAA,QACR,QAAQ;AAAA,UACN,qBAAqB;AAAA,QAAA;AAAA,MACvB,CACD;AAGM,aAAA,UAAU,WAAW,mBAAmB,sBAAsB;AAAA,QACnE,sBAAsB;AAAA;AAAA,QACtB,oBAAoB;AAAA;AAAA,MAAA,CACrB;AAGM,aAAA,UAAU,WAAW,mBAAmB,sBAAsB;AAAA,QACnE,sBAAsB;AAAA,QACtB,oBAAoB;AAAA,MAAA,CACrB;AAGM,aAAA,UAAU,WAAW,mBAAmB,mBAAmB;AAAA,QAChE,OAAO;AAAA,QACP,sBAAsB;AAAA,MAAA,CACvB;AAEM,aAAA,UAAU,WAAW,mBAAmB,mBAAmB;AAAA,QAChE,OAAO;AAAA,QACP,sBAAsB;AAAA,MAAA,CACvB;AAEa,oBAAA;AAAA,QACZ,QAAQ;AAAA,QACR,OAAO,aAAa,SAAS,eAAe;AAAA,MAAA,CAC7C;AAAA,IACH;AAAA,IACA,CAAC,UAAU;AAAA,EACb;AAEA,QAAM,oBAAoB,mBAAmB,SAAS,MAAM,IAAI,EAAE,SAAS;AAGzE,SAAAC,2BAAA,kBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,SAAA;AAAA,QACT;AAAA,QACA,mBAAmB;AAAA,MACrB;AAAA,MAEC,UAAA;AAAA,QACC,kBAAAC,2BAAA,kBAAA,IAAC,mBAAgB,MAAM,UAAU,QAAQ,MAAM,UAAU,IAAI,GAC3D,UAAAA,2BAAA,kBAAA;AAAA,UAACC,yBAAA;AAAA,UAAA;AAAA,YACC,WAAWF,SAAA;AAAA,cACT;AAAA,cACA,UAAU;AAAA,YACZ;AAAA,YACA,OAAM;AAAA,YACN,SAAQ;AAAA,YACR,OAAM;AAAA,YACN,MAAK;AAAA,YACL,MAAM,SAASG,4BAAgBC,YAAAA;AAAAA,UAAA;AAAA,QAAA,GAEnC;AAAA,QAEFH,2BAAA,kBAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,KAAK;AAAA,YAEL,UAAAA,2BAAA,kBAAA;AAAA,cAACI,MAAA;AAAA,cAAA;AAAA,gBACE,GAAG;AAAA,gBACJ,iBAAgB;AAAA,gBAChB;AAAA,gBACA,0DAAUC,wBAAO,QAAA,EAAA;AAAA,gBACjB,cAAc,OAAO,QAAQ,EAAE,QAAQ,OAAO,EAAE;AAAA,gBAChD,SAAS;AAAA,gBACT;AAAA,gBACA,SAAS;AAAA,kBACP,UAAU;AAAA,kBACV,aAAa;AAAA,kBACb,SAAS,EAAE,SAAS,MAAM;AAAA,kBAC1B,WAAW;AAAA,oBACT,UAAU;AAAA,oBACV,uBAAuB;AAAA,oBACvB,yBAAyB;AAAA,kBAC3B;AAAA,kBACA,SAAS;AAAA;AAAA,kBACT,6BAA6B;AAAA;AAAA,kBAC7B,kBAAkB;AAAA;AAAA,kBAClB,gBAAgB,EAAE,SAAS,MAAM;AAAA;AAAA,kBACjC,4BAA4B;AAAA;AAAA,kBAE5B,6BAA6B;AAAA,kBAC7B,uBAAuB;AAAA,kBACvB,sBAAsB;AAAA,kBACtB,aAAa,oBAAoB,OAAO;AAAA,gBAC1C;AAAA,gBACA,OAAM;AAAA,gBACN,WAAU;AAAA,cAAA;AAAA,YAAA;AAAA,UACZ;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EACF;AAEJ;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { OnChange } from '@monaco-editor/react';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
type CodeCompProps = {
|
|
4
|
+
children: string;
|
|
5
|
+
language: string;
|
|
6
|
+
isDarkMode?: boolean;
|
|
7
|
+
showLineNumbers?: boolean;
|
|
8
|
+
showCopyButton?: boolean;
|
|
9
|
+
isReadOnly?: boolean;
|
|
10
|
+
onChange?: OnChange;
|
|
11
|
+
};
|
|
12
|
+
export declare const MonacoCode: FC<CodeCompProps>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=CodeRender%20copy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeRender copy.d.ts","sourceRoot":"","sources":["../../../src/components/IDE/CodeRender copy.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAU,QAAQ,EAAW,MAAM,sBAAsB,CAAC;AAEjE,OAAO,EAAE,KAAK,EAAE,EAA4C,MAAM,OAAO,CAAC;AAM1E,KAAK,aAAa,GAAG;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,aAAa,CAqIxC,CAAC"}
|