mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 02:09:32 -04:00
## Summary This PR started out as an attempt to resolve https://github.com/elastic/kibana/issues/166559; which it does, the appropriate colours for the message prompt displayed when an edit attempt on read only content is made in the code editor for both dark and light mode are now set; ### Light mode <img width="412" alt="Screenshot 2023-11-22 at 11 30 17" src=" |
||
---|---|---|
.. | ||
__snapshots__ | ||
languages | ||
mocks | ||
BUILD.bazel | ||
code_editor.stories.tsx | ||
code_editor.test.tsx | ||
code_editor.tsx | ||
editor.styles.ts | ||
index.tsx | ||
jest.config.js | ||
kibana.jsonc | ||
package.json | ||
placeholder_widget.ts | ||
README.mdx | ||
register_languages.ts | ||
remeasure_fonts.ts | ||
tsconfig.json |
--- id: sharedUX/Components/CodeEditor slug: /shared-ux/components/code-editor title: Code Editor description: A code editor to display code and edit code in Kibana. tags: ['shared-ux', 'component'] date: 2022-12-05 --- ## Description This component is an abstraction of the [Monaco Code Editor](https://microsoft.github.io/monaco-editor/) (and the [React Monaco Editor component](https://github.com/react-monaco-editor/react-monaco-editor)). This component still allows access to the other Monaco features. ## Usage This editor component allows easy access to: * [Syntax highlighting (including custom language highlighting)](https://microsoft.github.io/monaco-editor/playground.html#extending-language-services-custom-languages) * [Suggestion/autocompletion widget](https://microsoft.github.io/monaco-editor/playground.html#extending-language-services-completion-provider-example) * Function signature widget * [Hover widget](https://microsoft.github.io/monaco-editor/playground.html#extending-language-services-hover-provider-example) The Monaco editor doesn't automatically resize the editor area on window or container resize so this component includes a [resize detector](https://github.com/maslianok/react-resize-detector) to cause the Monaco editor to re-layout and adjust its size when the window or container size changes ## API