-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Canvas] Expression shape #103219
Merged
Merged
[Canvas] Expression shape #103219
Changes from 111 commits
Commits
Show all changes
118 commits
Select commit
Hold shift + click to select a range
51a04ba
expression_reveal_image skeleton.
Kuznietsov d6dc04d
expression_functions added.
Kuznietsov 8438ec4
expression_renderers added.
Kuznietsov 73b357a
Backup of daily work.
Kuznietsov adc8613
Fixed errors.
Kuznietsov 0d80fb4
Added legacy support. Added button for legacy.
Kuznietsov 1bf5c60
Added storybook.
Kuznietsov f816d80
Removed revealImage from canvas.
Kuznietsov 2a9a7fe
Types fixed.
Kuznietsov c160885
Fixed test suite error.
Kuznietsov 21041b4
Fixed eslint error.
Kuznietsov bb8355a
Moved UI and elements, related to expressionRevealImage from canvas.
Kuznietsov 04d1a85
Fixed unused translations errors.
Kuznietsov 11c9892
Moved type of element to types.
Kuznietsov 0e9b5a6
Fixed types and added service for representing elements, ui and suppo…
Kuznietsov 1da3d57
Added expression registration to canvas.
Kuznietsov 3f11831
Fixed
Kuznietsov cef9b5c
Fixed mutiple call of the function.
Kuznietsov f97929d
Removed support of a legacy lib for revealImage chart.
Kuznietsov a37722c
Removed legacy presentation_utils plugin import.
Kuznietsov 463ad1d
Removed useless translations and tried to fix error.
Kuznietsov fce35ad
One more fix.
Kuznietsov 7b2b608
Small imports fix.
Kuznietsov a00bf52
Fixed translations.
Kuznietsov e6a4212
Made fixes based on nits.
Kuznietsov c0d9b4c
Removed useless params.
Kuznietsov 82876d8
fix.
Kuznietsov 2c6e2db
Fixed errors, related to jest and __mocks__.
Kuznietsov e75ec81
Removed useless type definition.
Kuznietsov 78503ab
Replaced RendererHandlers with IInterpreterRendererHandlers.
Kuznietsov d88654f
fixed supported_shareable.
Kuznietsov fb81f0e
Moved elements back to canvas.
Kuznietsov 7180dee
Moved views to canvas, removed expression service and imported render…
Kuznietsov 8fb2e7a
Fixed translations.
Kuznietsov 63b7b4f
Moved libs to presentation utils.
Kuznietsov eed7182
Fixed types and removed function_wrapper.ts
Kuznietsov 9191291
Fixed types of test helpers.
Kuznietsov a25c066
Fixed imports.
Kuznietsov 6b69b4b
One more fix.
Kuznietsov 3946fc6
Fixed public API.
Kuznietsov ad78689
Moved css to component.
Kuznietsov 8848354
Fixed spaces at element.
Kuznietsov 5b465fd
Removed unused plugin.
Kuznietsov 7a0ebed
Basic setup of error plugin.
Kuznietsov a9f72b2
Removed not used `function` files at `error` expression.
Kuznietsov 6b97196
Moved related components from canvas.
Kuznietsov ff1bbed
Changed imports of components.
Kuznietsov 895e779
Removed useless translations and fixed .i18nrc.json
Kuznietsov 97b5488
More fixes of i18nrc.
Kuznietsov 4165080
Fixed async functions.
Kuznietsov 0ebb754
Fixed one test with Expression input.
Kuznietsov 13cd55e
generated plugin and copied code from expression_reveal_image
Kuznietsov 89cbce3
fixed double import after merge.
Kuznietsov 07cfce6
Changed all names from reveal_image to shape.
Kuznietsov f695751
moved shape to plugin and added all necessary configs
Kuznietsov 3a85ad8
Fixed translations, fixed all imports and debug of svg.
Kuznietsov 35feb32
`function` moved to `server`.
Kuznietsov 47bca03
One shape is rewritten to `React` and rendering is written with passi…
Kuznietsov c909b1b
changed default width and heigth.
Kuznietsov 71bcb17
Added `ShapeHOC`.
Kuznietsov f8132ac
Shapes changed.
Kuznietsov 6b52aa0
small refactor.
Kuznietsov 58f7e7f
Removed useless import.
Kuznietsov ae098d4
one more refactor.
Kuznietsov ec15303
Refactor + fix errors + updated limits.
Kuznietsov 986949b
Changed ShapePreview from pure js to react and removed `dangerouslySe…
Kuznietsov cc0b938
Fixed types of viewbox.
Kuznietsov feeaf92
Changed types source for Shape components.
Kuznietsov 988d0d7
small refactor.
Kuznietsov 7565c54
Fixed imports.
Kuznietsov 71415af
Removed `shape` from `canvas`
Kuznietsov 7841dff
Updated docs.
Kuznietsov ee655aa
Basic setup of error plugin.
Kuznietsov 89bc21b
Removed not used `function` files at `error` expression.
Kuznietsov 0085e28
Changed imports of components.
Kuznietsov d91dcd1
Fixed errors, related to shape and autosuggestions.
Kuznietsov 0668b4c
Fixed i18n for shape.
Kuznietsov 508fbbb
Moved function from public to common and registered at server.
Kuznietsov 9adbf1e
Fixed types error.
Kuznietsov af3b711
Fixed snapshots and shape mocks.
Kuznietsov 73e54de
Moved some libs from `presentations_util` to `expression_shape`
Kuznietsov 4c4ed6f
Shape refactored.
Kuznietsov 05ae5ab
Shape picker fixed.
Kuznietsov 83b99db
Moved `Popover` back to `canvas`
Kuznietsov bfeb642
Removed `Popover` export from presentation_utils components.
Kuznietsov 838ad5b
Moved error_component and debug_component from presentation_util to e…
Kuznietsov c020f37
Removed `.i18nrc.json`.
Kuznietsov 7326c69
Removed `.i18nrc.json`.
Kuznietsov ac84165
Removed useless scss.
Kuznietsov ad82dc1
Fixed color of `error`.
Kuznietsov 365c7e8
added fixes of rebase.
Kuznietsov 134fe5b
More fixes of rebase error .
Kuznietsov f0221b8
Removed useless .i18nrc.json file.
Kuznietsov 7eeb8f2
More fixes.
Kuznietsov f54de25
More fixes of rebase.
Kuznietsov c448f0a
One more fix.
Kuznietsov 41ddc50
More fixes.
Kuznietsov c19f54e
Fixed limits and translations.
Kuznietsov 1210d38
Added.
Kuznietsov 7590fc9
Fixed i18nrc.
Kuznietsov a9efd93
Fixed error..
Kuznietsov 3235300
Moved shapes to async chunks.
Kuznietsov 4184b53
One more fix.
Kuznietsov 3dd8f20
Some fixes.
Kuznietsov 1229026
Trying to fix the typecheck error.
Kuznietsov 23083a7
Added temp of drawer.
Kuznietsov 5fb9c65
Moved shapes to the async chunk in a less complex way.
Kuznietsov 32d0d56
Made `ShapeDrawer` reusable among different `expressions`.
Kuznietsov 8bdd5e9
Merge branch 'master' into expression_shape
Kuznietsov 1abefd5
Changed type of `shapes` from `any` and `Shape` to `string`.
Kuznietsov 7122811
Merge branch 'expression_shape' of github.com:Kunzetsov/kibana into e…
Kuznietsov d701f0c
Made changes, based on nits.
Kuznietsov 2bec1e2
Removed not necessary changes.
Kuznietsov 5c5c95c
Moved all reusable libs to `expression_shapes`.
Kuznietsov 88c055d
Reduced the size of the bundle.
Kuznietsov 07b6e08
Hope, fixed type check errors.
Kuznietsov 02c525d
Removed getDefaultShapeData.
Kuznietsov 94abbcc
Removed `getViewBox` from bundle.
Kuznietsov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
|
@@ -114,3 +114,4 @@ pageLoadAssetSize: | |
cases: 144442 | ||
expressionError: 22127 | ||
userSetup: 18532 | ||
expressionShape: 30033 |
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,10 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
// eslint-disable-next-line import/no-commonjs | ||
module.exports = require('@kbn/storybook').defaultConfig; |
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,9 @@ | ||
# expressionShape | ||
|
||
Expression Shape plugin adds a `shape` function to the expression plugin and an associated renderer. The renderer will display the given shape with selected decorations. | ||
|
||
--- | ||
|
||
## Development | ||
|
||
See the [kibana contributing guide](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md) for instructions setting up your development environment. |
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 | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
export const PLUGIN_ID = 'expressionShape'; | ||
export const PLUGIN_NAME = 'expressionShape'; | ||
export const SVG = 'SVG'; |
13 changes: 13 additions & 0 deletions
13
src/plugins/expression_shape/common/expression_functions/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,13 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { shapeFunction } from './shape_function'; | ||
|
||
export const functions = [shapeFunction]; | ||
|
||
export { shapeFunction }; |
106 changes: 106 additions & 0 deletions
106
src/plugins/expression_shape/common/expression_functions/shape_function.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,106 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { i18n } from '@kbn/i18n'; | ||
import { ExpressionShapeFunction, Shape } from '../types'; | ||
import { SVG } from '../constants'; | ||
import { getAvailableShapes } from '../lib'; | ||
|
||
export const strings = { | ||
help: i18n.translate('expressionShape.functions.shapeHelpText', { | ||
defaultMessage: 'Creates a shape.', | ||
}), | ||
args: { | ||
shape: i18n.translate('expressionShape.functions.shape.args.shapeHelpText', { | ||
defaultMessage: 'Pick a shape.', | ||
}), | ||
border: i18n.translate('expressionShape.functions.shape.args.borderHelpText', { | ||
defaultMessage: 'An {SVG} color for the border outlining the shape.', | ||
values: { | ||
SVG, | ||
}, | ||
}), | ||
borderWidth: i18n.translate('expressionShape.functions.shape.args.borderWidthHelpText', { | ||
defaultMessage: 'The thickness of the border.', | ||
}), | ||
fill: i18n.translate('expressionShape.functions.shape.args.fillHelpText', { | ||
defaultMessage: 'An {SVG} color to fill the shape.', | ||
values: { | ||
SVG, | ||
}, | ||
}), | ||
maintainAspect: i18n.translate('expressionShape.functions.shape.args.maintainAspectHelpText', { | ||
defaultMessage: `Maintain the shape's original aspect ratio?`, | ||
}), | ||
}, | ||
}; | ||
|
||
export const errors = { | ||
invalidShape: (shape: string) => | ||
new Error( | ||
i18n.translate('expressionShape.functions.shape.invalidShapeErrorMessage', { | ||
defaultMessage: "Invalid value: '{shape}'. Such a shape doesn't exist.", | ||
values: { | ||
shape, | ||
}, | ||
}) | ||
), | ||
}; | ||
|
||
export const shapeFunction: ExpressionShapeFunction = () => { | ||
const { help, args: argHelp } = strings; | ||
|
||
return { | ||
name: 'shape', | ||
aliases: [], | ||
inputTypes: ['null'], | ||
help, | ||
args: { | ||
shape: { | ||
types: ['string'], | ||
help: argHelp.shape, | ||
aliases: ['_'], | ||
default: 'square', | ||
options: Object.values(Shape), | ||
}, | ||
border: { | ||
types: ['string'], | ||
aliases: ['stroke'], | ||
help: argHelp.border, | ||
}, | ||
borderWidth: { | ||
types: ['number'], | ||
aliases: ['strokeWidth'], | ||
help: argHelp.borderWidth, | ||
default: 0, | ||
}, | ||
fill: { | ||
types: ['string'], | ||
help: argHelp.fill, | ||
default: 'black', | ||
}, | ||
maintainAspect: { | ||
types: ['boolean'], | ||
help: argHelp.maintainAspect, | ||
default: false, | ||
options: [true, false], | ||
}, | ||
}, | ||
fn: (input, args) => { | ||
const avaliableShapes = getAvailableShapes(); | ||
if (!avaliableShapes.includes(args.shape)) { | ||
throw errors.invalidShape(args.shape); | ||
} | ||
|
||
return { | ||
type: 'shape', | ||
...args, | ||
}; | ||
}, | ||
}; | ||
}; |
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,12 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
export * from './constants'; | ||
export * from './types'; | ||
export * from './expression_functions'; | ||
export { getAvailableShapes } from './lib'; |
11 changes: 11 additions & 0 deletions
11
src/plugins/expression_shape/common/lib/available_shapes.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,11 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { Shape } from '../types'; | ||
|
||
export const getAvailableShapes = () => Object.values(Shape); |
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,10 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
export * from './view_box'; | ||
export * from './available_shapes'; |
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,48 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { ViewBoxParams } from '../../../presentation_util/common'; | ||
import { ParentNodeParams } from '../types'; | ||
|
||
function getMinxAndWidth(viewBoxParams: ViewBoxParams, { borderOffset, width }: ParentNodeParams) { | ||
let { minX, width: shapeWidth } = viewBoxParams; | ||
if (width) { | ||
const xOffset = (shapeWidth / width) * borderOffset; | ||
minX -= xOffset; | ||
shapeWidth += xOffset * 2; | ||
} else { | ||
shapeWidth = 0; | ||
} | ||
|
||
return [minX, shapeWidth]; | ||
} | ||
|
||
function getMinyAndHeight( | ||
viewBoxParams: ViewBoxParams, | ||
{ borderOffset, height }: ParentNodeParams | ||
) { | ||
let { minY, height: shapeHeight } = viewBoxParams; | ||
if (height) { | ||
const yOffset = (shapeHeight / height) * borderOffset; | ||
minY -= yOffset; | ||
shapeHeight += yOffset * 2; | ||
} else { | ||
shapeHeight = 0; | ||
} | ||
|
||
return [minY, shapeHeight]; | ||
} | ||
|
||
export function getViewBox( | ||
viewBoxParams: ViewBoxParams, | ||
parentNodeParams: ParentNodeParams | ||
): ViewBoxParams { | ||
const [minX, width] = getMinxAndWidth(viewBoxParams, parentNodeParams); | ||
const [minY, height] = getMinyAndHeight(viewBoxParams, parentNodeParams); | ||
return { minX, minY, width, height }; | ||
} |
46 changes: 46 additions & 0 deletions
46
src/plugins/expression_shape/common/types/expression_functions.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,46 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
import { ExpressionFunctionDefinition } from 'src/plugins/expressions'; | ||
|
||
export enum Shape { | ||
ARROW = 'arrow', | ||
ARROW_MULTI = 'arrowMulti', | ||
BOOKMARK = 'bookmark', | ||
CIRCLE = 'circle', | ||
CROSS = 'cross', | ||
HEXAGON = 'hexagon', | ||
KITE = 'kite', | ||
PENTAGON = 'pentagon', | ||
RHOMBUS = 'rhombus', | ||
SEMICIRCLE = 'semicircle', | ||
SPEECH_BUBBLE = 'speechBubble', | ||
SQUARE = 'square', | ||
STAR = 'star', | ||
TAG = 'tag', | ||
TRIANGLE = 'triangle', | ||
TRIANGLE_RIGHT = 'triangleRight', | ||
} | ||
|
||
interface Arguments { | ||
border: string; | ||
borderWidth: number; | ||
shape: Shape; | ||
fill: string; | ||
maintainAspect: boolean; | ||
} | ||
|
||
export interface Output extends Arguments { | ||
type: 'shape'; | ||
} | ||
|
||
export type ExpressionShapeFunction = () => ExpressionFunctionDefinition< | ||
'shape', | ||
number | null, | ||
Arguments, | ||
Output | ||
>; |
28 changes: 28 additions & 0 deletions
28
src/plugins/expression_shape/common/types/expression_renderers.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,28 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
import { Shape } from './expression_functions'; | ||
|
||
export type OriginString = 'bottom' | 'left' | 'top' | 'right'; | ||
export interface ShapeRendererConfig { | ||
border: string; | ||
borderWidth: number; | ||
shape: Shape; | ||
fill: string; | ||
maintainAspect: boolean; | ||
} | ||
|
||
export interface NodeDimensions { | ||
width: number; | ||
height: number; | ||
} | ||
|
||
export interface ParentNodeParams { | ||
borderOffset: number; | ||
width: number; | ||
height: number; | ||
} |
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,9 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
export * from './expression_functions'; | ||
export * from './expression_renderers'; |
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,13 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
module.exports = { | ||
preset: '@kbn/test', | ||
rootDir: '../../..', | ||
roots: ['<rootDir>/src/plugins/expression_shape'], | ||
}; |
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,13 @@ | ||
{ | ||
"id": "expressionShape", | ||
"version": "1.0.0", | ||
"kibanaVersion": "kibana", | ||
"server": true, | ||
"ui": true, | ||
"extraPublicDirs": [ | ||
"common" | ||
], | ||
"requiredPlugins": ["expressions", "presentationUtil"], | ||
"optionalPlugins": [], | ||
"requiredBundles": [] | ||
} |
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,12 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { lazy } from 'react'; | ||
|
||
export * from './shape_component'; | ||
export const LazyShapeDrawer = lazy(() => import('./shape_drawer')); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, so it looks like exporting * from here exports the component itself, which causes it to end up in the main bundle, defeating the purpose of the lazy wherever that is.
Or just export it as lazy from here to keep it out of the bundle and import the lazy where it's currently used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.