feat(extensions): Allow replacing editors using extensions (#37499)

This commit is contained in:
Michael S. Molina
2026-01-29 08:22:32 -03:00
committed by GitHub
parent 675a4c7a66
commit 6cb3cea960
46 changed files with 2706 additions and 477 deletions

View File

@@ -22,7 +22,8 @@ import { css, styled } from '@apache-superset/core/ui';
import { useSingleViewResource } from 'src/views/CRUD/hooks';
import { ModalTitleWithIcon } from 'src/components/ModalTitleWithIcon';
import withToasts from 'src/components/MessageToasts/withToasts';
import { Input, CssEditor, Modal } from '@superset-ui/core/components';
import { Input, Modal } from '@superset-ui/core/components';
import { EditorHost } from 'src/core/editors';
import { Typography } from '@superset-ui/core/components/Typography';
import { OnlyKeyWithType } from 'src/utils/types';
import { TemplateObject } from './types';
@@ -46,7 +47,7 @@ const StyledCssTemplateTitle = styled.div(
`,
);
const StyledCssEditor = styled(CssEditor)`
const StyledEditorHost = styled(EditorHost)`
${({ theme }) => css`
border-radius: ${theme.borderRadius}px;
border: 1px solid ${theme.colorPrimaryBg};
@@ -262,9 +263,11 @@ const CssTemplateModal: FunctionComponent<CssTemplateModalProps> = ({
{t('css')}
<span className="required">*</span>
</div>
<StyledCssEditor
<StyledEditorHost
id="css-template-editor"
onChange={onCssChange}
value={currentCssTemplate?.css}
value={currentCssTemplate?.css ?? ''}
language="css"
width="100%"
/>
</TemplateContainer>