-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Expose CodeBlockPanel component This separates the current CodeBlock component into two: * CodeBlock, which simply renders the code view without padding/margin * CodeBlockPanel which wraps the CodeBlock in an EUIPanel and allows overrides It seems like APM will want to use the former for their integration, while the latter is currently used internally by Code. It's very simple, though, and could absolutely be inlined. * Update demo page to use CodeBlock This has no styling, and so a header could go right against it, it could be shown/hidden distinct from the header, etc. * Export our current integration components from main index Adds a 'shared' manifest that does all the reaching in; the main one just re-exports that. * Move shared exports to the frontend manifest This was incorrectly placed a level too high, in the plugin itself. * Rename to better reflect relationship CodeBlockPanel = EuiPanel + CodeBlock * Distinguish monaco CSS overrides with page-specific layout
- Loading branch information
Showing
11 changed files
with
69 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
x-pack/legacy/plugins/code/public/components/code_block/code_block_panel.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React, { ReactNode } from 'react'; | ||
import { EuiPanel } from '@elastic/eui'; | ||
|
||
import { CodeBlock, Props as CodeBlockProps } from './code_block'; | ||
|
||
export interface Props extends CodeBlockProps { | ||
className?: string; | ||
header?: ReactNode; | ||
} | ||
|
||
export const CodeBlockPanel = ({ className, header, ...rest }: Props) => ( | ||
<EuiPanel paddingSize="s" className={className}> | ||
{header} | ||
<CodeBlock {...rest} /> | ||
</EuiPanel> | ||
); | ||
|
||
CodeBlockPanel.defaultProps = CodeBlock.defaultProps; |
8 changes: 8 additions & 0 deletions
8
x-pack/legacy/plugins/code/public/components/code_block/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export { CodeBlock, Position, Props as CodeBlockProps } from './code_block'; | ||
export { CodeBlockPanel, Props as CodeBlockPanelProps } from './code_block_panel'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
x-pack/legacy/plugins/code/public/monaco/override_monaco_styles.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export * from './components/code_block'; | ||
export { | ||
CodeIntegrator, | ||
Props as CodeIntegratorProps, | ||
} from './components/integrations/code_integrator'; |