Skip to content
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 reveal image. #101987

Merged
merged 93 commits into from
Jul 1, 2021
Merged
Show file tree
Hide file tree
Changes from 85 commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
63ad0f8
expression_reveal_image skeleton.
Kuznietsov Jun 10, 2021
1240bb2
expression_functions added.
Kuznietsov Jun 10, 2021
72eac63
expression_renderers added.
Kuznietsov Jun 10, 2021
9e1e817
Backup of daily work.
Kuznietsov Jun 10, 2021
befec5d
Fixed errors.
Kuznietsov Jun 11, 2021
d60f43a
Merge branch 'master' into expression_reveal_image
kibanamachine Jun 11, 2021
03b214f
Added legacy support. Added button for legacy.
Kuznietsov Jun 11, 2021
cbbf981
Merge branch 'expression_reveal_image' of github.com:Kunzetsov/kibana…
Kuznietsov Jun 11, 2021
010b7b9
Added storybook.
Kuznietsov Jun 11, 2021
13789f1
Removed revealImage from canvas.
Kuznietsov Jun 11, 2021
96ec59b
setState while rendering error fixed.
Kuznietsov Jun 11, 2021
fc13023
tsconfig.json added.
Kuznietsov Jun 11, 2021
4196c5d
jest.config.js added.
Kuznietsov Jun 11, 2021
6be3ccf
Demo doc added.
Kuznietsov Jun 11, 2021
b317f8b
Types fixed.
Kuznietsov Jun 11, 2021
784450d
added limits.
Kuznietsov Jun 11, 2021
5de41e6
Removed not used imports.
Kuznietsov Jun 14, 2021
788c5f6
i18n namespaces fixed.
Kuznietsov Jun 14, 2021
3d6d5f3
Fixed test suite error.
Kuznietsov Jun 14, 2021
4911e14
Some errors fixed.
Kuznietsov Jun 14, 2021
3fb130a
Fixed eslint error.
Kuznietsov Jun 14, 2021
273a2a2
Removed more unused translations.
Kuznietsov Jun 14, 2021
02ed217
Moved UI and elements, related to expressionRevealImage from canvas.
Kuznietsov Jun 14, 2021
2e1e9bf
Fixed unused translations errors.
Kuznietsov Jun 14, 2021
2e727cd
Moved type of element to types.
Kuznietsov Jun 14, 2021
9680733
Fixed types and added service for representing elements, ui and suppo…
Kuznietsov Jun 14, 2021
3aebdf6
Added expression registration to canvas.
Kuznietsov Jun 15, 2021
49e52b0
Fixed
Kuznietsov Jun 15, 2021
5f9ab82
Fixed mutiple call of the function.
Kuznietsov Jun 15, 2021
0c11bcd
Removed support of a legacy lib for revealImage chart.
Kuznietsov Jun 15, 2021
2b36c94
Removed legacy presentation_utils plugin import.
Kuznietsov Jun 15, 2021
33b3ec7
Doc error fixed.
Kuznietsov Jun 15, 2021
82352a9
Merge branch 'master' into expression_reveal_image
kibanamachine Jun 15, 2021
aa1f474
Removed useless translations and tried to fix error.
Kuznietsov Jun 15, 2021
181f793
Merge branch 'expression_reveal_image' of github.com:Kunzetsov/kibana…
Kuznietsov Jun 15, 2021
7bad366
One more fix.
Kuznietsov Jun 15, 2021
2983097
Small imports fix.
Kuznietsov Jun 16, 2021
bf6c8ff
Merge branch 'master' into expression_reveal_image
kibanamachine Jun 16, 2021
226fc89
Fixed translations.
Kuznietsov Jun 16, 2021
ccd4450
Made fixes based on nits.
Kuznietsov Jun 16, 2021
390a547
Removed useless params.
Kuznietsov Jun 16, 2021
ec78576
fix.
Kuznietsov Jun 16, 2021
55b21d0
Fixed errors, related to jest and __mocks__.
Kuznietsov Jun 16, 2021
19e9024
Removed useless type definition.
Kuznietsov Jun 16, 2021
bdea22a
Replaced RendererHandlers with IInterpreterRendererHandlers.
Kuznietsov Jun 17, 2021
b4eaa1b
fixed supported_shareable.
Kuznietsov Jun 17, 2021
d552813
Moved elements back to canvas.
Kuznietsov Jun 17, 2021
596a027
Moved views to canvas, removed expression service and imported render…
Kuznietsov Jun 17, 2021
40af512
Fixed translations.
Kuznietsov Jun 17, 2021
6ba2baa
Types fix.
Kuznietsov Jun 17, 2021
8994828
Moved libs to presentation utils.
Kuznietsov Jun 17, 2021
7e71064
Fixed one mistake.
Kuznietsov Jun 17, 2021
199e16a
removed dataurl lib.
Kuznietsov Jun 17, 2021
fd998f1
Fixed jest files.
Kuznietsov Jun 17, 2021
5b95af7
elasticLogo removed.
Kuznietsov Jun 17, 2021
a290c31
Removed elastic_outline.
Kuznietsov Jun 17, 2021
29e3712
removed httpurl.
Kuznietsov Jun 17, 2021
4f2b9f9
Removed missing_asset.
Kuznietsov Jun 17, 2021
94dbd16
removed url.
Kuznietsov Jun 17, 2021
ce8c17b
replaced mostly all tests.
Kuznietsov Jun 17, 2021
7dc4ae5
Fixed types.
Kuznietsov Jun 18, 2021
b2cd923
Fixed types and removed function_wrapper.ts
Kuznietsov Jun 18, 2021
cc7c509
Fixed types of test helpers.
Kuznietsov Jun 18, 2021
f0200f2
Merge branch 'master' into expression_reveal_image
Kuznietsov Jun 18, 2021
340093f
Changed limits of presentationUtil plugin.
Kuznietsov Jun 18, 2021
1e98dc0
Fixed imports.
Kuznietsov Jun 18, 2021
84d193c
One more fix.
Kuznietsov Jun 18, 2021
e97aa5b
Fixed huge size of bundle.
Kuznietsov Jun 18, 2021
3be24f6
Reduced allow limit for presentationUtil
Kuznietsov Jun 18, 2021
9bf774c
Updated limits for presentationUtil.
Kuznietsov Jun 18, 2021
fec9bed
Fixed public API.
Kuznietsov Jun 18, 2021
b65b887
fixed type errors.
Kuznietsov Jun 18, 2021
ba3a5dd
Merge branch 'master' into expression_reveal_image
kibanamachine Jun 21, 2021
8d722b1
Moved css to component.
Kuznietsov Jun 22, 2021
7dd9049
Fixed spaces at element.
Kuznietsov Jun 22, 2021
4d3aa2d
Changed order of requiredPlugins.
Kuznietsov Jun 22, 2021
10e3617
Updated limits.
Kuznietsov Jun 22, 2021
e66bb1a
Removed unused plugin.
Kuznietsov Jun 22, 2021
ef67341
Added rule for allowing import from __stories__ directory.
Kuznietsov Jun 23, 2021
93b54b0
removed useless comment.
Kuznietsov Jun 23, 2021
2241b17
Changed readme.md
Kuznietsov Jun 23, 2021
086e34a
Fixed docs error.
Kuznietsov Jun 23, 2021
baa0a54
Merge branch 'master' into expression_reveal_image
kibanamachine Jun 23, 2021
493d40e
Merge branch 'master' into expression_reveal_image
kibanamachine Jun 23, 2021
8c3e2d3
A possible of smoke test.
Kuznietsov Jun 23, 2021
2831359
Merge branch 'master' into expression_reveal_image
Kuznietsov Jun 25, 2021
563a671
Merge branch 'master' into expression_reveal_image
kibanamachine Jun 29, 2021
3b2ed6a
onResize changed to useResizeObserver.
Kuznietsov Jun 29, 2021
fb7a16c
Remove useless events and `useEffect` block.
Kuznietsov Jun 29, 2021
febc98c
Changed from passing handlers to separate functions.
Kuznietsov Jun 29, 2021
56f7303
`function` moved to `server`.
Kuznietsov Jun 29, 2021
9015bb3
Merge branch 'master' into expression_reveal_image
Kuznietsov Jul 1, 2021
436b698
Fixed eslint error.
Kuznietsov Jul 1, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ module.exports = {
'(src|x-pack)/plugins/**/(public|server)/**/*',
'!(src|x-pack)/plugins/**/(public|server)/mocks/index.{js,mjs,ts}',
'!(src|x-pack)/plugins/**/(public|server)/(index|mocks).{js,mjs,ts,tsx}',
'!(src|x-pack)/plugins/**/__stories__/index.{js,mjs,ts,tsx}',
],
allowSameFolder: true,
errorMessage: 'Plugins may only import from top-level public and server modules.',
Expand Down
1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"esUi": "src/plugins/es_ui_shared",
"devTools": "src/plugins/dev_tools",
"expressions": "src/plugins/expressions",
"expressionRevealImage": "src/plugins/expression_reveal_image",
"inputControl": "src/plugins/input_control_vis",
"inspector": "src/plugins/inspector",
"inspectorViews": "src/legacy/core_plugins/inspector_views",
Expand Down
4 changes: 4 additions & 0 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ This API doesn't support angular, for registering angular dev tools, bootstrap a
|This plugin contains reusable code in the form of self-contained modules (or libraries). Each of these modules exports a set of functionality relevant to the domain of the module.


|{kib-repo}blob/{branch}/src/plugins/expression_reveal_image/README.md[expressionRevealImage]
|Expression Reveal Image plugin adds a revealImage function to the expression plugin and an associated renderer. The renderer will display the given percentage of a given image.


|<<kibana-expressions-plugin>>
|Expression pipeline is a chain of functions that *pipe* its output to the
input of the next function. Functions can be configured using arguments provided
Expand Down
3 changes: 2 additions & 1 deletion packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pageLoadAssetSize:
watcher: 43598
runtimeFields: 41752
stackAlerts: 29684
presentationUtil: 49767
presentationUtil: 94301
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the bulk of this increase comes from moving all those images over. Is there a way we can pull some of those images out of the main bundle and load them async. Maybe we investigate that in a followup pull request.

Also, please update the limits for expressionREvealImage below as it's gotten much smaller as a result of moving the stuff to PresentationUtil

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

spacesOss: 18817
indexPatternFieldEditor: 90489
osquery: 107090
Expand All @@ -110,4 +110,5 @@ pageLoadAssetSize:
timelines: 230410
screenshotMode: 17856
visTypePie: 35583
expressionRevealImage: 25675
cases: 144442
1 change: 1 addition & 0 deletions src/dev/storybook/aliases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const storybookAliases = {
dashboard_enhanced: 'x-pack/plugins/dashboard_enhanced/.storybook',
data_enhanced: 'x-pack/plugins/data_enhanced/.storybook',
embeddable: 'src/plugins/embeddable/.storybook',
expression_reveal_image: 'src/plugins/expression_reveal_image/.storybook',
infra: 'x-pack/plugins/infra/.storybook',
security_solution: 'x-pack/plugins/security_solution/.storybook',
ui_actions_enhanced: 'x-pack/plugins/ui_actions_enhanced/.storybook',
Expand Down
7 changes: 7 additions & 0 deletions src/plugins/expression_reveal_image/.i18nrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"prefix": "expressionRevealImage",
"paths": {
"expressionRevealImage": "."
},
"translations": ["translations/ja-JP.json"]
}
10 changes: 10 additions & 0 deletions src/plugins/expression_reveal_image/.storybook/main.js
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;
9 changes: 9 additions & 0 deletions src/plugins/expression_reveal_image/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# expressionRevealImage

Expression Reveal Image plugin adds a `revealImage` function to the expression plugin and an associated renderer. The renderer will display the given percentage of a given image.

---

## Development

See the [kibana contributing guide](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md) for instructions setting up your development environment.
9 changes: 9 additions & 0 deletions src/plugins/expression_reveal_image/common/constants.ts
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 const PLUGIN_ID = 'expressionRevealImage';
export const PLUGIN_NAME = 'expressionRevealImage';
10 changes: 10 additions & 0 deletions src/plugins/expression_reveal_image/common/i18n/constants.ts
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 const BASE64 = '`base64`';
export const URL = 'URL';
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
* 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 { revealImage } from '../../../canvas_plugin_src/functions/common/revealImage';
import { FunctionHelp } from '../function_help';
import { FunctionFactory } from '../../../types';
import { Position } from '../../../types';
import { BASE64, URL } from '../../constants';

export const help: FunctionHelp<FunctionFactory<typeof revealImage>> = {
help: i18n.translate('xpack.canvas.functions.revealImageHelpText', {
export const help = {
help: i18n.translate('expressionRevealImage.functions.revealImageHelpText', {
defaultMessage: 'Configures an image reveal element.',
}),
args: {
image: i18n.translate('xpack.canvas.functions.revealImage.args.imageHelpText', {
image: i18n.translate('expressionRevealImage.functions.revealImage.args.imageHelpText', {
defaultMessage:
'The image to reveal. Provide an image asset as a {BASE64} data {URL}, ' +
'or pass in a sub-expression.',
Expand All @@ -26,16 +24,19 @@ export const help: FunctionHelp<FunctionFactory<typeof revealImage>> = {
URL,
},
}),
emptyImage: i18n.translate('xpack.canvas.functions.revealImage.args.emptyImageHelpText', {
defaultMessage:
'An optional background image to reveal over. ' +
'Provide an image asset as a `{BASE64}` data {URL}, or pass in a sub-expression.',
values: {
BASE64,
URL,
},
}),
origin: i18n.translate('xpack.canvas.functions.revealImage.args.originHelpText', {
emptyImage: i18n.translate(
'expressionRevealImage.functions.revealImage.args.emptyImageHelpText',
{
defaultMessage:
'An optional background image to reveal over. ' +
'Provide an image asset as a `{BASE64}` data {URL}, or pass in a sub-expression.',
values: {
BASE64,
URL,
},
}
),
origin: i18n.translate('expressionRevealImage.functions.revealImage.args.originHelpText', {
defaultMessage: 'The position to start the image fill. For example, {list}, or {end}.',
values: {
list: Object.values(Position)
Expand All @@ -50,7 +51,7 @@ export const help: FunctionHelp<FunctionFactory<typeof revealImage>> = {
export const errors = {
invalidPercent: (percent: number) =>
new Error(
i18n.translate('xpack.canvas.functions.revealImage.invalidPercentErrorMessage', {
i18n.translate('expressionRevealImage.functions.revealImage.invalidPercentErrorMessage', {
defaultMessage: "Invalid value: '{percent}'. Percentage must be between 0 and 1",
values: {
percent,
Expand Down
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 { errors as revealImage } from './dict/reveal_image';

export const getFunctionErrors = () => ({
revealImage,
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* 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 { help as revealImage } from './dict/reveal_image';

/**
* Help text for Canvas Functions should be properly localized. This function will
* return a dictionary of help strings, organized by `ExpressionFunctionDefinition`
* specification and then by available arguments within each `ExpressionFunctionDefinition`.
*
* This a function, rather than an object, to future-proof string initialization,
* if ever necessary.
*/
export const getFunctionHelp = () => ({
revealImage,
});
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 './function_help';
export * from './function_errors';
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 { strings as revealImage } from './reveal_image';
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* 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';

export const strings = {
getDisplayName: () =>
i18n.translate('expressionRevealImage.renderer.revealImage.displayName', {
defaultMessage: 'Image reveal',
}),
getHelpDescription: () =>
i18n.translate('expressionRevealImage.renderer.revealImage.helpDescription', {
defaultMessage: 'Reveal a percentage of an image to make a custom gauge-style chart',
}),
};
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 './renderer_strings';
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* 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 { revealImage } from './dict';

/**
* Help text for Canvas Functions should be properly localized. This function will
* return a dictionary of help strings, organized by `ExpressionFunctionDefinition`
* specification and then by available arguments within each `ExpressionFunctionDefinition`.
*
* This a function, rather than an object, to future-proof string initialization,
* if ever necessary.
*/
export const getRendererStrings = () => ({
revealImage,
});
10 changes: 10 additions & 0 deletions src/plugins/expression_reveal_image/common/i18n/index.ts
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 './expression_functions';
export * from './expression_renderers';
9 changes: 9 additions & 0 deletions src/plugins/expression_reveal_image/common/index.ts
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 './constants';
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* 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, ExpressionValueRender } from 'src/plugins/expressions';

export enum Origin {
TOP = 'top',
LEFT = 'left',
BOTTOM = 'bottom',
RIGHT = 'right',
}

interface Arguments {
image: string | null;
emptyImage: string | null;
origin: Origin;
}

export interface Output {
image: string;
emptyImage: string;
origin: Origin;
percent: number;
}

export type ExpressionRevealImageFunction = () => ExpressionFunctionDefinition<
'revealImage',
number,
Arguments,
ExpressionValueRender<Output>
>;

export enum Position {
TOP = 'top',
BOTTOM = 'bottom',
LEFT = 'left',
RIGHT = 'right',
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* 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 type OriginString = 'bottom' | 'left' | 'top' | 'right';
export interface RevealImageRendererConfig {
percent: number;
origin?: OriginString;
image?: string;
emptyImage?: string;
}

export interface NodeDimensions {
width: number;
height: number;
}
9 changes: 9 additions & 0 deletions src/plugins/expression_reveal_image/common/types/index.ts
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';
13 changes: 13 additions & 0 deletions src/plugins/expression_reveal_image/jest.config.js
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_reveal_image'],
};
10 changes: 10 additions & 0 deletions src/plugins/expression_reveal_image/kibana.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"id": "expressionRevealImage",
"version": "1.0.0",
"kibanaVersion": "kibana",
"server": false,
"ui": true,
"requiredPlugins": ["expressions", "presentationUtil"],
"optionalPlugins": [],
"requiredBundles": []
}
Loading