[8.19] [Canvas] Move expressions used in Canvas only back into Canvas plugin (#214993) (#218597)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Canvas] Move expressions used in Canvas only back into Canvas plugin
(#214993)](https://github.com/elastic/kibana/pull/214993)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Catherine
Liu","email":"catherine.liu@elastic.co"},"sourceCommit":{"committedDate":"2025-04-16T20:42:21Z","message":"[Canvas]
Move expressions used in Canvas only back into Canvas plugin
(#214993)\n\n## Summary\n\nCloses
[214026](https://github.com/elastic/kibana/issues/214026).\n\nThis
deletes the following expression plugins/package and moves the
code\nback into Canvas because they are functions and renderers
used\nexclusively by Canvas:\n- `expression_image`\n-
`expression_error`\n- `expression_repeat_image`\n-
`expression_reveal_image`\n- `expression_shape`\n-
`kbn-expression-utils`\n\nThis reduces the number of plugins loaded on
Kibana start and will only\nload these functions when using
Canvas.\n\nTo test, import these Canvas workpad saved objects to enable
Canvas:\n\n[test-workpads.ndjson.zip](https://github.com/user-attachments/files/19766567/test-workpads.ndjson.zip)\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [ ] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] If a plugin
configuration key changed, check if it needs to be\nallowlisted in the
cloud and added to the
[docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\nchanges have been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n###
Identify risks\n\nDoes this PR introduce any risks? For example,
consider risks like hard\nto test bugs, performance regression,
potential of data loss.\n\nDescribe the risk, its severity, and
mitigation for each identified\nrisk. Invite stakeholders and evaluate
how to proceed before merging.\n\n- [ ] [See some
risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n-
[ ] ...\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"a015e5f9f71f30d89b73db8cb27a161ad43d6aa8","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Presentation","Feature:ExpressionLanguage","loe:large","release_note:skip","impact:high","Feature:Canvas","backport:version","v9.1.0","v8.19.0"],"title":"[Canvas]
Move expressions used in Canvas only back into Canvas
plugin","number":214993,"url":"https://github.com/elastic/kibana/pull/214993","mergeCommit":{"message":"[Canvas]
Move expressions used in Canvas only back into Canvas plugin
(#214993)\n\n## Summary\n\nCloses
[214026](https://github.com/elastic/kibana/issues/214026).\n\nThis
deletes the following expression plugins/package and moves the
code\nback into Canvas because they are functions and renderers
used\nexclusively by Canvas:\n- `expression_image`\n-
`expression_error`\n- `expression_repeat_image`\n-
`expression_reveal_image`\n- `expression_shape`\n-
`kbn-expression-utils`\n\nThis reduces the number of plugins loaded on
Kibana start and will only\nload these functions when using
Canvas.\n\nTo test, import these Canvas workpad saved objects to enable
Canvas:\n\n[test-workpads.ndjson.zip](https://github.com/user-attachments/files/19766567/test-workpads.ndjson.zip)\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [ ] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] If a plugin
configuration key changed, check if it needs to be\nallowlisted in the
cloud and added to the
[docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\nchanges have been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n###
Identify risks\n\nDoes this PR introduce any risks? For example,
consider risks like hard\nto test bugs, performance regression,
potential of data loss.\n\nDescribe the risk, its severity, and
mitigation for each identified\nrisk. Invite stakeholders and evaluate
how to proceed before merging.\n\n- [ ] [See some
risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n-
[ ] ...\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"a015e5f9f71f30d89b73db8cb27a161ad43d6aa8"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/214993","number":214993,"mergeCommit":{"message":"[Canvas]
Move expressions used in Canvas only back into Canvas plugin
(#214993)\n\n## Summary\n\nCloses
[214026](https://github.com/elastic/kibana/issues/214026).\n\nThis
deletes the following expression plugins/package and moves the
code\nback into Canvas because they are functions and renderers
used\nexclusively by Canvas:\n- `expression_image`\n-
`expression_error`\n- `expression_repeat_image`\n-
`expression_reveal_image`\n- `expression_shape`\n-
`kbn-expression-utils`\n\nThis reduces the number of plugins loaded on
Kibana start and will only\nload these functions when using
Canvas.\n\nTo test, import these Canvas workpad saved objects to enable
Canvas:\n\n[test-workpads.ndjson.zip](https://github.com/user-attachments/files/19766567/test-workpads.ndjson.zip)\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [ ] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] If a plugin
configuration key changed, check if it needs to be\nallowlisted in the
cloud and added to the
[docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\nchanges have been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n###
Identify risks\n\nDoes this PR introduce any risks? For example,
consider risks like hard\nto test bugs, performance regression,
potential of data loss.\n\nDescribe the risk, its severity, and
mitigation for each identified\nrisk. Invite stakeholders and evaluate
how to proceed before merging.\n\n- [ ] [See some
risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n-
[ ] ...\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"a015e5f9f71f30d89b73db8cb27a161ad43d6aa8"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
This commit is contained in:
Catherine Liu 2025-04-18 12:07:41 -07:00 committed by GitHub
parent e4559bd813
commit f2be173e92
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
314 changed files with 2301 additions and 4496 deletions

65
.github/CODEOWNERS vendored
View file

@ -461,19 +461,12 @@ x-pack/solutions/security/packages/expandable-flyout @elastic/security-threat-hu
src/platform/packages/shared/kbn-expect @elastic/kibana-operations @elastic/appex-qa
x-pack/examples/exploratory_view_example @elastic/obs-ux-infra_services-team
x-pack/solutions/observability/plugins/exploratory_view @elastic/obs-ux-management-team
src/platform/plugins/shared/expression_error @elastic/kibana-presentation
src/platform/plugins/shared/chart_expressions/expression_gauge @elastic/kibana-visualizations
src/platform/plugins/shared/chart_expressions/expression_heatmap @elastic/kibana-visualizations
src/platform/plugins/shared/expression_image @elastic/kibana-presentation
src/platform/plugins/shared/chart_expressions/expression_legacy_metric @elastic/kibana-visualizations
src/platform/plugins/shared/expression_metric @elastic/kibana-presentation
src/platform/plugins/shared/chart_expressions/expression_metric @elastic/kibana-visualizations
src/platform/plugins/shared/chart_expressions/expression_partition_vis @elastic/kibana-visualizations
src/platform/plugins/shared/expression_repeat_image @elastic/kibana-presentation
src/platform/plugins/shared/expression_reveal_image @elastic/kibana-presentation
src/platform/plugins/shared/expression_shape @elastic/kibana-presentation
src/platform/plugins/shared/chart_expressions/expression_tagcloud @elastic/kibana-visualizations
src/platform/packages/private/kbn-expression-utils @elastic/kibana-presentation
src/platform/plugins/shared/chart_expressions/expression_xy @elastic/kibana-visualizations
examples/expressions_explorer @elastic/kibana-visualizations
src/platform/plugins/shared/expressions @elastic/kibana-visualizations
@ -1093,66 +1086,8 @@ x-pack/test_serverless/api_integration/test_suites/common/platform_security @ela
# Data Discovery
/x-pack/test/api_integration/services/data_view_api.ts @elastic/kibana-data-discovery
^/src/platform/test/functional/fixtures/es_archiver/makelogs @elastic/kibana-data-discovery
^/src/platform/test/functional/fixtures/es_archiver/large_fields @elastic/kibana-data-discovery # Assigned per only use: test/functional/apps/management/data_views/_test_huge_fields.ts
/x-pack/test/functional/fixtures/kbn_archiver/kibana_scripted_fields_on_logstash.json @elastic/kibana-data-discovery # Assigned per only use: https://github.com/elastic/kibana/blob/main/x-pack/test/functional/apps/discover/async_scripted_fields.ts#L35
/x-pack/test/functional/fixtures/kbn_archiver/discover @elastic/kibana-data-discovery
^/src/platform/test/functional/fixtures/kbn_archiver/unmapped_fields.json @elastic/kibana-data-discovery # Assigned per only use: https://github.com/elastic/kibana/blob/main/test/functional/apps/discover/group7/_indexpattern_with_unmapped_fields.ts#L28
^/src/platform/test/functional/fixtures/kbn_archiver/testlargestring.json @elastic/kibana-data-discovery # Assigned per only use: https://github.com/elastic/kibana/blob/main/test/functional/apps/discover/group5/_large_string.ts#L28
^/src/platform/test/functional/fixtures/kbn_archiver/message_with_newline.json @elastic/kibana-data-discovery # Assigned per only use: https://github.com/elastic/kibana/blob/main/test/functional/apps/discover/classic/_doc_table_newline.ts#L26
^/src/platform/test/functional/fixtures/kbn_archiver/invalid_scripted_field.json @elastic/kibana-data-discovery
^/src/platform/test/functional/fixtures/kbn_archiver/index_pattern_without_timefield.json @elastic/kibana-data-discovery
^/src/platform/test/functional/fixtures/kbn_archiver/discover @elastic/kibana-data-discovery
^/src/platform/test/functional/fixtures/kbn_archiver/discover.json @elastic/kibana-data-discovery
^/src/platform/test/functional/fixtures/kbn_archiver/date_nested.json @elastic/kibana-data-discovery
^/src/platform/test/functional/fixtures/kbn_archiver/date_* @elastic/kibana-data-discovery
^/src/platform/test/functional/fixtures/es_archiver/unmapped_fields @elastic/kibana-data-discovery # Assigned per the only use: https://github.com/elastic/kibana/blob/main/test/functional/apps/discover/group7/_indexpattern_with_unmapped_fields.ts#L26
^/src/platform/test/functional/fixtures/es_archiver/message_with_newline @elastic/kibana-data-discovery # Assigned per the only use: https://github.com/elastic/kibana/blob/main/test/functional/apps/discover/classic/_doc_table_newline.ts#L24
^/src/platform/test/functional/fixtures/es_archiver/hamlet @elastic/kibana-data-discovery # Assigned per the only use: https://github.com/elastic/kibana/blob/main/test/functional/apps/discover/group5/_large_string.ts#L30
^/src/platform/test/api_integration/fixtures/kbn_archiver/index_patterns @elastic/kibana-data-discovery
^/src/platform/test/api_integration/fixtures/es_archiver/index_patterns @elastic/kibana-data-discovery
^/src/platform/test/functional/fixtures/es_archiver/alias @elastic/kibana-data-discovery
^/src/platform/test/functional/page_objects/context_page.ts @elastic/kibana-data-discovery
^/src/platform/test/functional/services/data_views.ts @elastic/kibana-data-discovery
^/src/platform/test/functional/services/saved_objects_finder.ts @elastic/kibana-data-discovery
^/src/platform/test/plugin_functional/plugins/index_patterns @elastic/kibana-data-discovery
^/src/platform/test/plugin_functional/plugins/data_search @elastic/kibana-data-discovery
^/src/platform/test/functional/page_objects/discover_page.ts @elastic/kibana-data-discovery
^/src/platform/test/functional/fixtures/es_archiver/index_pattern_without_timefield @elastic/kibana-data-discovery
^/src/platform/test/functional/fixtures/es_archiver/huge_fields @elastic/kibana-data-discovery
^/src/platform/test/functional/fixtures/es_archiver/date_n* @elastic/kibana-data-discovery
^/src/platform/test/functional/firefox/discover.config.ts @elastic/kibana-data-discovery
^/src/platform/test/functional/fixtures/es_archiver/discover @elastic/kibana-data-discovery
^/src/platform/test/api_integration/apis/saved_queries @elastic/kibana-data-discovery
/x-pack/test/api_integration/apis/kibana/kql_telemetry @elastic/kibana-data-discovery @elastic/kibana-visualizations
/x-pack/test_serverless/functional/es_archives/pre_calculated_histogram @elastic/kibana-data-discovery
/x-pack/test_serverless/functional/es_archives/kibana_sample_data_flights_index_pattern @elastic/kibana-data-discovery
/x-pack/test_serverless/functional/test_suites/security/config.examples.ts @elastic/kibana-data-discovery
/x-pack/test_serverless/functional/test_suites/security/config.examples.context_awareness.ts @elastic/kibana-data-discovery
^/src/platform/test/accessibility/apps/discover.ts @elastic/kibana-data-discovery
^/src/platform/test/api_integration/apis/data_views @elastic/kibana-data-discovery
^/src/platform/test/api_integration/apis/data_view_field_editor @elastic/kibana-data-discovery
^/src/platform/test/api_integration/apis/kql_telemetry @elastic/kibana-data-discovery
^/src/platform/test/api_integration/apis/scripts @elastic/kibana-data-discovery
^/src/platform/test/api_integration/apis/search @elastic/kibana-data-discovery
^/src/platform/test/examples/data_view_field_editor_example @elastic/kibana-data-discovery
^/src/platform/test/examples/discover_customization_examples @elastic/kibana-data-discovery
^/src/platform/test/examples/field_formats @elastic/kibana-data-discovery
^/src/platform/test/examples/partial_results @elastic/kibana-data-discovery
^/src/platform/test/examples/search @elastic/kibana-data-discovery
^/src/platform/test/examples/unified_field_list_examples @elastic/kibana-data-discovery
^/src/platform/test/functional/apps/context @elastic/kibana-data-discovery
^/src/platform/test/functional/apps/discover @elastic/kibana-data-discovery
^/src/platform/test/functional/apps/management/ccs_compatibility/_data_views_ccs.ts @elastic/kibana-data-discovery
^/src/platform/test/functional/apps/management/data_views @elastic/kibana-data-discovery
^/src/platform/test/plugin_functional/test_suites/data_plugin @elastic/kibana-data-discovery
/x-pack/test/accessibility/apps/group3/search_sessions.ts @elastic/kibana-data-discovery
/x-pack/test/api_integration/apis/management/rollup/index_patterns_extensions.js @elastic/kibana-data-discovery
/x-pack/test/api_integration/apis/search @elastic/kibana-data-discovery
/x-pack/test/examples/search_examples @elastic/kibana-data-discovery
/x-pack/test/functional/apps/data_views @elastic/kibana-data-discovery
/x-pack/test/functional/apps/discover @elastic/kibana-data-discovery
/x-pack/test/functional/apps/saved_query_management @elastic/kibana-data-discovery
/x-pack/test/functional_with_es_ssl/apps/discover_ml_uptime/discover @elastic/kibana-data-discovery
/x-pack/test/search_sessions_integration @elastic/kibana-data-discovery
/x-pack/test/stack_functional_integration/apps/ccs/ccs_discover.js @elastic/kibana-data-discovery
/x-pack/test/stack_functional_integration/apps/management/_index_pattern_create.js @elastic/kibana-data-discovery

View file

@ -40,19 +40,13 @@
"kbnGridLayout": "src/platform/packages/private/kbn-grid-layout",
"esUi": "src/platform/plugins/shared/es_ui_shared",
"expandableFlyout": "packages/kbn-expandable-flyout",
"expressionError": "src/platform/plugins/shared/expression_error",
"expressionGauge": "src/platform/plugins/shared/chart_expressions/expression_gauge",
"expressionHeatmap": "src/platform/plugins/shared/chart_expressions/expression_heatmap",
"expressionImage": "src/platform/plugins/shared/expression_image",
"expressionMetric": "src/platform/plugins/shared/expression_metric",
"expressionMetricVis": "src/platform/plugins/shared/chart_expressions/expression_metric",
"expressionLegacyMetricVis": "src/platform/plugins/shared/chart_expressions/expression_legacy_metric",
"expressionPartitionVis": "src/platform/plugins/shared/chart_expressions/expression_partition_vis",
"expressionXY": "src/platform/plugins/shared/chart_expressions/expression_xy",
"expressionRepeatImage": "src/platform/plugins/shared/expression_repeat_image",
"expressionRevealImage": "src/platform/plugins/shared/expression_reveal_image",
"expressions": "src/platform/plugins/shared/expressions",
"expressionShape": "src/platform/plugins/shared/expression_shape",
"expressionTagcloud": "src/platform/plugins/shared/chart_expressions/expression_tagcloud",
"eventAnnotation": "src/platform/plugins/private/event_annotation",
"eventAnnotationListing": "src/platform/plugins/private/event_annotation_listing",

View file

@ -122,10 +122,6 @@ This API doesn't support angular, for registering angular dev tools, bootstrap a
|This plugin contains the library listing page for event annotation groups.
|{kib-repo}blob/{branch}/src/platform/plugins/shared/expression_error/README.md[expressionError]
|Expression Error plugin adds an error renderer to the expression plugin. The renderer will display the error image.
|{kib-repo}blob/{branch}/src/platform/plugins/shared/chart_expressions/expression_gauge[expressionGauge]
|WARNING: Missing or empty README.
@ -134,18 +130,10 @@ This API doesn't support angular, for registering angular dev tools, bootstrap a
|WARNING: Missing or empty README.
|{kib-repo}blob/{branch}/src/platform/plugins/shared/expression_image/README.md[expressionImage]
|Expression Image plugin adds an image renderer to the expression plugin. The renderer will display the given image.
|{kib-repo}blob/{branch}/src/platform/plugins/shared/chart_expressions/expression_legacy_metric/README.md[expressionLegacyMetricVis]
|Expression MetricVis plugin adds a metric renderer and function to the expression plugin. The renderer will display the metric chart.
|{kib-repo}blob/{branch}/src/platform/plugins/shared/expression_metric/README.md[expressionMetric]
|Expression Metric plugin adds a metric renderer and function to the expression plugin.
|{kib-repo}blob/{branch}/src/platform/plugins/shared/chart_expressions/expression_metric/README.md[expressionMetricVis]
|Expression MetricVis plugin adds a metric renderer and function to the expression plugin. The renderer will display the metric chart.
@ -154,14 +142,6 @@ This API doesn't support angular, for registering angular dev tools, bootstrap a
|Expression Partition Visualization plugin adds a partitionVis renderer and pieVis, mosaicVis, treemapVis, waffleVis functions to the expression plugin. The renderer will display the pie, waffle, treemap and mosaic charts.
|{kib-repo}blob/{branch}/src/platform/plugins/shared/expression_repeat_image/README.md[expressionRepeatImage]
|Expression Repeat Image plugin adds a repeatImage function to the expression plugin and an associated renderer. The renderer will display the given image in mutliple instances.
|{kib-repo}blob/{branch}/src/platform/plugins/shared/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
@ -184,10 +164,6 @@ want to incorporate their own functions, types, and renderers into the service
for use in their own application.
|{kib-repo}blob/{branch}/src/platform/plugins/shared/expression_shape/README.md[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.
|{kib-repo}blob/{branch}/src/platform/plugins/shared/chart_expressions/expression_tagcloud/README.md[expressionTagcloud]
|Expression Tagcloud plugin adds a tagcloud renderer and function to the expression plugin. The renderer will display the Wordcloud chart.

View file

@ -517,19 +517,12 @@
"@kbn/expandable-flyout": "link:x-pack/solutions/security/packages/expandable-flyout",
"@kbn/exploratory-view-example-plugin": "link:x-pack/examples/exploratory_view_example",
"@kbn/exploratory-view-plugin": "link:x-pack/solutions/observability/plugins/exploratory_view",
"@kbn/expression-error-plugin": "link:src/platform/plugins/shared/expression_error",
"@kbn/expression-gauge-plugin": "link:src/platform/plugins/shared/chart_expressions/expression_gauge",
"@kbn/expression-heatmap-plugin": "link:src/platform/plugins/shared/chart_expressions/expression_heatmap",
"@kbn/expression-image-plugin": "link:src/platform/plugins/shared/expression_image",
"@kbn/expression-legacy-metric-vis-plugin": "link:src/platform/plugins/shared/chart_expressions/expression_legacy_metric",
"@kbn/expression-metric-plugin": "link:src/platform/plugins/shared/expression_metric",
"@kbn/expression-metric-vis-plugin": "link:src/platform/plugins/shared/chart_expressions/expression_metric",
"@kbn/expression-partition-vis-plugin": "link:src/platform/plugins/shared/chart_expressions/expression_partition_vis",
"@kbn/expression-repeat-image-plugin": "link:src/platform/plugins/shared/expression_repeat_image",
"@kbn/expression-reveal-image-plugin": "link:src/platform/plugins/shared/expression_reveal_image",
"@kbn/expression-shape-plugin": "link:src/platform/plugins/shared/expression_shape",
"@kbn/expression-tagcloud-plugin": "link:src/platform/plugins/shared/chart_expressions/expression_tagcloud",
"@kbn/expression-utils": "link:src/platform/packages/private/kbn-expression-utils",
"@kbn/expression-xy-plugin": "link:src/platform/plugins/shared/chart_expressions/expression_xy",
"@kbn/expressions-explorer-plugin": "link:examples/expressions_explorer",
"@kbn/expressions-plugin": "link:src/platform/plugins/shared/expressions",

View file

@ -50,18 +50,12 @@ pageLoadAssetSize:
eventAnnotation: 30000
eventAnnotationListing: 25841
exploratoryView: 74673
expressionError: 22127
expressionGauge: 25000
expressionHeatmap: 27505
expressionImage: 19288
expressionLegacyMetricVis: 23121
expressionMetric: 22238
expressionMetricVis: 23121
expressionPartitionVis: 44888
expressionRepeatImage: 22341
expressionRevealImage: 25675
expressions: 140958
expressionShape: 34008
expressionTagcloud: 27505
expressionXY: 45000
features: 21723

View file

@ -30,16 +30,10 @@ export const storybookAliases = {
esql_editor: 'src/platform/packages/private/kbn-esql-editor/.storybook',
event_stacktrace: 'x-pack/platform/packages/shared/kbn-event-stacktrace/.storybook',
expandable_flyout: 'x-pack/solutions/security/packages/expandable-flyout/.storybook',
expression_error: 'src/platform/plugins/shared/expression_error/.storybook',
expression_image: 'src/platform/plugins/shared/expression_image/.storybook',
expression_metric_vis:
'src/platform/plugins/shared/chart_expressions/expression_legacy_metric/.storybook',
expression_metric: 'src/platform/plugins/shared/expression_metric/.storybook',
expression_partition_vis:
'src/platform/plugins/shared/chart_expressions/expression_partition_vis/.storybook',
expression_repeat_image: 'src/platform/plugins/shared/expression_repeat_image/.storybook',
expression_reveal_image: 'src/platform/plugins/shared/expression_reveal_image/.storybook',
expression_shape: 'src/platform/plugins/shared/expression_shape/.storybook',
expression_tagcloud:
'src/platform/plugins/shared/chart_expressions/expression_tagcloud/.storybook',
fleet: 'x-pack/platform/plugins/shared/fleet/.storybook',

View file

@ -1,3 +0,0 @@
# @kbn/expression-utils
Empty package generated by @kbn/generate

View file

@ -1,19 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
export {
elasticLogo,
elasticOutline,
isValidUrl,
isValidHttpUrl,
resolveWithMissingImage,
resolveFromArgs,
encode,
parseDataUrl,
} from './src';

View file

@ -1,14 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
module.exports = {
preset: '@kbn/test/jest_node',
rootDir: '../../../../..',
roots: ['<rootDir>/src/platform/packages/private/kbn-expression-utils'],
};

View file

@ -1,7 +0,0 @@
{
"type": "shared-common",
"id": "@kbn/expression-utils",
"owner": "@elastic/kibana-presentation",
"group": "platform",
"visibility": "private"
}

View file

@ -1,6 +0,0 @@
{
"name": "@kbn/expression-utils",
"private": true,
"version": "1.0.0",
"license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0"
}

View file

@ -1,15 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
// A cheap regex to distinguish an HTTP URL string from a data URL string
const httpurlRegex = /^https?:\/\/\S+(?:[0-9]+)?\/\S{1,}/;
export function isValidHttpUrl(str: string): boolean {
return httpurlRegex.test(str);
}

View file

@ -1,15 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
export * from './dataurl';
export { elasticLogo } from './elastic_logo';
export { elasticOutline } from './elastic_outline';
export * from './httpurl';
export * from './resolve_dataurl';
export * from './url';

View file

@ -1,15 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { isValidDataUrl } from './dataurl';
import { isValidHttpUrl } from './httpurl';
export function isValidUrl(url: string) {
return isValidDataUrl(url) || isValidHttpUrl(url);
}

View file

@ -1,17 +0,0 @@
{
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
"jest",
"node"
]
},
"include": [
"**/*.ts",
],
"exclude": [
"target/**/*"
],
"kbn_references": []
}

View file

@ -1,11 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
// eslint-disable-next-line import/no-commonjs
module.exports = require('@kbn/storybook').defaultConfig;

View file

@ -1,9 +0,0 @@
# expressionRevealImage
Expression Error plugin adds an `error` renderer to the expression plugin. The renderer will display the error image.
---
## Development
See the [kibana contributing guide](https://github.com/elastic/kibana/blob/main/CONTRIBUTING.md) for instructions setting up your development environment.

View file

@ -1,13 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
export const PLUGIN_ID = 'expressionError';
export const PLUGIN_NAME = 'expressionError';
export const JSON = 'JSON';

View file

@ -1,12 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
// TODO: https://github.com/elastic/kibana/issues/110893
export { PLUGIN_ID, PLUGIN_NAME, JSON } from './constants';

View file

@ -1,19 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
export type OriginString = 'bottom' | 'left' | 'top' | 'right';
export interface ErrorRendererConfig {
error: Error;
}
export interface NodeDimensions {
width: number;
height: number;
}

View file

@ -1,10 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
export * from './expression_renderers';

View file

@ -1,20 +0,0 @@
{
"type": "plugin",
"id": "@kbn/expression-error-plugin",
"owner": [
"@elastic/kibana-presentation"
],
"group": "platform",
"visibility": "shared",
"description": "Adds 'error' renderer to expressions",
"plugin": {
"id": "expressionError",
"browser": true,
"server": false,
"requiredPlugins": [
"expressions",
"presentationUtil"
],
"requiredBundles": []
}
}

View file

@ -1,11 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
// eslint-disable-next-line import/no-default-export
export { Debug as default } from './debug';

View file

@ -1,11 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
// eslint-disable-next-line import/no-default-export
export { Error as default } from './error';

View file

@ -1,16 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { lazy } from 'react';
export const LazyErrorComponent = lazy(() => import('./error'));
export const LazyDebugComponent = lazy(() => import('./debug'));
export const LazyErrorRenderComponent = lazy(() => import('./error_component'));
export const LazyDebugRenderComponent = lazy(() => import('./debug_component'));

View file

@ -1,11 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
export { getErrorRenderer, errorRendererFactory } from './error_renderer';
export { getDebugRenderer, debugRendererFactory } from './debug_renderer';

View file

@ -1,25 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { ExpressionErrorPlugin } from './plugin';
export type { ExpressionErrorPluginSetup, ExpressionErrorPluginStart } from './plugin';
export function plugin() {
return new ExpressionErrorPlugin();
}
export {
getErrorRenderer,
getDebugRenderer,
errorRendererFactory,
debugRendererFactory,
} from './expression_renderers';
export { LazyDebugComponent, LazyErrorComponent } from './components';

View file

@ -1,38 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { CoreSetup, CoreStart, Plugin } from '@kbn/core/public';
import { ExpressionsStart, ExpressionsSetup } from '@kbn/expressions-plugin/public';
import { debugRendererFactory, errorRendererFactory } from './expression_renderers';
interface SetupDeps {
expressions: ExpressionsSetup;
}
interface StartDeps {
expression: ExpressionsStart;
}
export type ExpressionErrorPluginSetup = void;
export type ExpressionErrorPluginStart = void;
export class ExpressionErrorPlugin
implements Plugin<ExpressionErrorPluginSetup, ExpressionErrorPluginStart, SetupDeps, StartDeps>
{
public setup(core: CoreSetup, { expressions }: SetupDeps): ExpressionErrorPluginSetup {
core.getStartServices().then(([start]) => {
expressions.registerRenderer(errorRendererFactory(start));
expressions.registerRenderer(debugRendererFactory(start));
});
}
public start(core: CoreStart): ExpressionErrorPluginStart {}
public stop() {}
}

View file

@ -1,25 +0,0 @@
{
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"isolatedModules": true
},
"include": [
"common/**/*",
"public/**/*",
"server/**/*",
],
"kbn_references": [
"@kbn/core",
"@kbn/presentation-util-plugin",
"@kbn/expressions-plugin",
"@kbn/i18n",
"@kbn/shared-ux-markdown",
"@kbn/react-kibana-context-theme",
"@kbn/i18n-react",
"@kbn/shared-ux-error-boundary",
],
"exclude": [
"target/**/*",
]
}

View file

@ -1,11 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
// eslint-disable-next-line import/no-commonjs
module.exports = require('@kbn/storybook').defaultConfig;

View file

@ -1,9 +0,0 @@
# expressionRevealImage
Expression Image plugin adds an `image` renderer to the expression plugin. The renderer will display the given image.
---
## Development
See the [kibana contributing guide](https://github.com/elastic/kibana/blob/main/CONTRIBUTING.md) for instructions setting up your development environment.

View file

@ -1,13 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { ExpressionFunction } from '@kbn/expressions-plugin/common';
import { imageFunction } from '../common/expression_functions';
export const functionSpecs = [imageFunction].map((fn) => new ExpressionFunction(fn()));

View file

@ -1,11 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
export { functionSpecs } from './function_specs';
export { imageFunction } from '../common/expression_functions';

View file

@ -1,15 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
export const PLUGIN_ID = 'expressionImage';
export const PLUGIN_NAME = 'expressionImage';
export const CONTEXT = '_context_';
export const BASE64 = '`base64`';
export const URL = 'URL';

View file

@ -1,96 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { i18n } from '@kbn/i18n';
import { BASE64, URL } from '../constants';
import { ExpressionImageFunction, ImageMode } from '../types';
export const strings = {
help: i18n.translate('expressionImage.functions.imageHelpText', {
defaultMessage:
'Displays an image. Provide an image asset as a {BASE64} data {URL}, or pass in a sub-expression.',
values: {
BASE64,
URL,
},
}),
args: {
dataurl: i18n.translate('expressionImage.functions.image.args.dataurlHelpText', {
defaultMessage: 'The {https} {URL} or {BASE64} data {URL} of an image.',
values: {
BASE64,
https: 'HTTP(S)',
URL,
},
}),
mode: i18n.translate('expressionImage.functions.image.args.modeHelpText', {
defaultMessage:
'{contain} shows the entire image, scaled to fit. ' +
'{cover} fills the container with the image, cropping from the sides or bottom as needed. ' +
'{stretch} resizes the height and width of the image to 100% of the container.',
values: {
contain: `\`"${ImageMode.CONTAIN}"\``,
cover: `\`"${ImageMode.COVER}"\``,
stretch: `\`"${ImageMode.STRETCH}"\``,
},
}),
},
};
const errors = {
invalidImageMode: () =>
i18n.translate('expressionImage.functions.image.invalidImageModeErrorMessage', {
defaultMessage: '"mode" must be "{contain}", "{cover}", or "{stretch}"',
values: {
contain: ImageMode.CONTAIN,
cover: ImageMode.COVER,
stretch: ImageMode.STRETCH,
},
}),
};
export const imageFunction: ExpressionImageFunction = () => {
const { help, args: argHelp } = strings;
return {
name: 'image',
aliases: [],
type: 'image',
inputTypes: ['null'],
help,
args: {
dataurl: {
// This was accepting dataurl, but there was no facility in fn for checking type and handling a dataurl type.
types: ['string', 'null'],
help: argHelp.dataurl,
aliases: ['_', 'url'],
default: null,
},
mode: {
types: ['string'],
help: argHelp.mode,
default: 'contain',
options: Object.values(ImageMode),
},
},
fn: async (input, { dataurl, mode }) => {
if (!mode || !Object.values(ImageMode).includes(mode)) {
throw new Error(errors.invalidImageMode());
}
const { elasticLogo, resolveWithMissingImage } = await import('@kbn/expression-utils');
const modeStyle = mode === 'stretch' ? '100% 100%' : mode;
return {
type: 'image',
mode: modeStyle,
dataurl: resolveWithMissingImage(dataurl, elasticLogo) as string,
};
},
};
};

View file

@ -1,14 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { imageFunction } from './image_function';
export const functions = [imageFunction];
export { imageFunction };

View file

@ -1,20 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
// TODO: https://github.com/elastic/kibana/issues/110893
export { PLUGIN_ID, PLUGIN_NAME, CONTEXT, BASE64, URL } from './constants';
export type {
Return,
ExpressionImageFunction,
OriginString,
ImageRendererConfig,
NodeDimensions,
} from './types';
export { ImageMode } from './types';

View file

@ -1,34 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common';
export enum ImageMode {
CONTAIN = 'contain',
COVER = 'cover',
STRETCH = 'stretch',
}
interface Arguments {
dataurl: string | null;
mode: ImageMode | null;
}
export interface Return {
type: 'image';
mode: string;
dataurl: string;
}
export type ExpressionImageFunction = () => ExpressionFunctionDefinition<
'image',
null,
Arguments,
Promise<Return>
>;

View file

@ -1,22 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { ImageMode } from './expression_functions';
export type OriginString = 'bottom' | 'left' | 'top' | 'right';
export interface ImageRendererConfig {
dataurl: string | null;
mode: ImageMode | null;
}
export interface NodeDimensions {
width: number;
height: number;
}

View file

@ -1,11 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
export * from './expression_functions';
export * from './expression_renderers';

View file

@ -1,20 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
module.exports = {
preset: '@kbn/test',
rootDir: '../../../../..',
roots: ['<rootDir>/src/platform/plugins/shared/expression_image'],
coverageDirectory:
'<rootDir>/target/kibana-coverage/jest/src/platform/plugins/shared/expression_image',
coverageReporters: ['text', 'html'],
collectCoverageFrom: [
'<rootDir>/src/platform/plugins/shared/expression_image/{common,public,server}/**/*.{ts,tsx}',
],
};

View file

@ -1,20 +0,0 @@
{
"type": "plugin",
"id": "@kbn/expression-image-plugin",
"owner": [
"@elastic/kibana-presentation"
],
"group": "platform",
"visibility": "shared",
"description": "Adds 'image' function and renderer to expressions",
"plugin": {
"id": "expressionImage",
"browser": true,
"server": true,
"requiredPlugins": [
"expressions",
"presentationUtil"
],
"requiredBundles": []
}
}

View file

@ -1,10 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
export { imageRendererFactory, getImageRenderer } from './image_renderer';

View file

@ -1,18 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { ExpressionImagePlugin } from './plugin';
export type { ExpressionImagePluginSetup, ExpressionImagePluginStart } from './plugin';
export function plugin() {
return new ExpressionImagePlugin();
}
export { imageRendererFactory, getImageRenderer } from './expression_renderers';

View file

@ -1,39 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { CoreSetup, CoreStart, Plugin } from '@kbn/core/public';
import { ExpressionsStart, ExpressionsSetup } from '@kbn/expressions-plugin/public';
import { imageRendererFactory } from './expression_renderers';
import { imageFunction } from '../common/expression_functions';
interface SetupDeps {
expressions: ExpressionsSetup;
}
interface StartDeps {
expression: ExpressionsStart;
}
export type ExpressionImagePluginSetup = void;
export type ExpressionImagePluginStart = void;
export class ExpressionImagePlugin
implements Plugin<ExpressionImagePluginSetup, ExpressionImagePluginStart, SetupDeps, StartDeps>
{
public setup(core: CoreSetup, { expressions }: SetupDeps): ExpressionImagePluginSetup {
core.getStartServices().then(([start]) => {
expressions.registerFunction(imageFunction);
expressions.registerRenderer(imageRendererFactory(start));
});
}
public start(core: CoreStart): ExpressionImagePluginStart {}
public stop() {}
}

View file

@ -1,15 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
export type { ExpressionImagePluginSetup, ExpressionImagePluginStart } from './plugin';
export async function plugin() {
const { ExpressionImagePlugin } = await import('./plugin');
return new ExpressionImagePlugin();
}

View file

@ -1,35 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { CoreSetup, CoreStart, Plugin } from '@kbn/core/server';
import { ExpressionsServerStart, ExpressionsServerSetup } from '@kbn/expressions-plugin/server';
import { imageFunction } from '../common/expression_functions';
interface SetupDeps {
expressions: ExpressionsServerSetup;
}
interface StartDeps {
expression: ExpressionsServerStart;
}
export type ExpressionImagePluginSetup = void;
export type ExpressionImagePluginStart = void;
export class ExpressionImagePlugin
implements Plugin<ExpressionImagePluginSetup, ExpressionImagePluginStart, SetupDeps, StartDeps>
{
public setup(core: CoreSetup, { expressions }: SetupDeps): ExpressionImagePluginSetup {
expressions.registerFunction(imageFunction);
}
public start(core: CoreStart): ExpressionImagePluginStart {}
public stop() {}
}

View file

@ -1,26 +0,0 @@
{
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"isolatedModules": true
},
"include": [
"common/**/*",
"public/**/*",
"server/**/*",
"__fixtures__/**/*",
],
"kbn_references": [
"@kbn/core",
"@kbn/presentation-util-plugin",
"@kbn/expressions-plugin",
"@kbn/expect",
"@kbn/i18n",
"@kbn/react-kibana-context-theme",
"@kbn/shared-ux-error-boundary",
"@kbn/expression-utils",
],
"exclude": [
"target/**/*",
]
}

View file

@ -1,11 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
// eslint-disable-next-line import/no-commonjs
module.exports = require('@kbn/storybook').defaultConfig;

View file

@ -1,9 +0,0 @@
# expressionMetric
Expression Metric plugin adds a `metric` renderer and function to the expression plugin.
---
## Development
See the [kibana contributing guide](https://github.com/elastic/kibana/blob/main/CONTRIBUTING.md) for instructions setting up your development environment.

View file

@ -1,13 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { ExpressionFunction } from '@kbn/expressions-plugin/common';
import { metricFunction } from '../common/expression_functions';
export const functionSpecs = [metricFunction].map((fn) => new ExpressionFunction(fn()));

View file

@ -1,10 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
export * from './function_specs';

View file

@ -1,16 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
export const PLUGIN_ID = 'expressionMetric';
export const PLUGIN_NAME = 'expressionMetric';
export const FONT_FAMILY = '`font-family`';
export const FONT_WEIGHT = '`font-weight`';
export const CSS = 'CSS';
export const NUMERALJS = 'Numeral pattern';

View file

@ -1,14 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { metricFunction } from './metric_function';
export const functions = [metricFunction];
export { metricFunction };

View file

@ -1,99 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { i18n } from '@kbn/i18n';
import { openSans } from '@kbn/expressions-plugin/common/fonts';
import { FONT_FAMILY, FONT_WEIGHT, CSS, NUMERALJS } from '../constants';
import { ExpressionMetricFunction } from '../types';
export const strings = {
help: i18n.translate('expressionMetric.functions.metricHelpText', {
defaultMessage: 'Displays a number over a label.',
}),
args: {
label: i18n.translate('expressionMetric.functions.metric.args.labelHelpText', {
defaultMessage: 'The text describing the metric.',
}),
labelFont: i18n.translate('expressionMetric.functions.metric.args.labelFontHelpText', {
defaultMessage:
'The {CSS} font properties for the label. For example, {FONT_FAMILY} or {FONT_WEIGHT}.',
values: {
CSS,
FONT_FAMILY,
FONT_WEIGHT,
},
}),
metricFont: i18n.translate('expressionMetric.functions.metric.args.metricFontHelpText', {
defaultMessage:
'The {CSS} font properties for the metric. For example, {FONT_FAMILY} or {FONT_WEIGHT}.',
values: {
CSS,
FONT_FAMILY,
FONT_WEIGHT,
},
}),
// TODO: Find a way to generate the docs URL here
metricFormat: i18n.translate('expressionMetric.functions.metric.args.metricFormatHelpText', {
defaultMessage: 'A {NUMERALJS} format string. For example, {example1} or {example2}.',
values: {
example1: '`"0.0a"`',
example2: '`"0%"`',
NUMERALJS,
},
}),
},
};
export const metricFunction: ExpressionMetricFunction = () => {
const { help, args: argHelp } = strings;
return {
name: 'metric',
aliases: [],
type: 'render',
inputTypes: ['number', 'string', 'null'],
help,
args: {
label: {
types: ['string'],
aliases: ['_', 'text', 'description'],
help: argHelp.label,
default: '""',
},
labelFont: {
types: ['style'],
help: argHelp.labelFont,
default: `{font size=14 family="${openSans.value}" color="#000000" align=center}`,
},
metricFont: {
types: ['style'],
help: argHelp.metricFont,
default: `{font size=48 family="${openSans.value}" color="#000000" align=center lHeight=48}`,
},
metricFormat: {
types: ['string'],
aliases: ['format'],
help: argHelp.metricFormat,
},
},
fn: (input, { label, labelFont, metricFont, metricFormat }) => {
return {
type: 'render',
as: 'metric',
value: {
metric: input === null ? '?' : input,
label,
labelFont,
metricFont,
metricFormat,
},
};
},
};
};

View file

@ -1,20 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
// TODO: https://github.com/elastic/kibana/issues/110893
export { PLUGIN_ID, PLUGIN_NAME, FONT_FAMILY, FONT_WEIGHT, CSS, NUMERALJS } from './constants';
export type {
Input,
Arguments,
ExpressionMetricFunction,
MetricRendererConfig,
NodeDimensions,
} from './types';
export { functions, metricFunction } from './expression_functions';

View file

@ -1,30 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import {
ExpressionFunctionDefinition,
ExpressionValueRender,
Style,
} from '@kbn/expressions-plugin/common';
export type Input = number | string | null;
export interface Arguments {
label: string;
metricFont: Style;
metricFormat: string;
labelFont: Style;
}
export type ExpressionMetricFunction = () => ExpressionFunctionDefinition<
'metric',
Input,
Arguments,
ExpressionValueRender<Arguments>
>;

View file

@ -1,28 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { Style } from '@kbn/expressions-plugin/common';
export interface MetricRendererConfig {
/** The text to display under the metric */
label: string;
/** Font settings for the label */
labelFont: Style;
/** Value of the metric to display */
metric: string | number | null;
/** Font settings for the metric */
metricFont: Style;
/** NumeralJS format string */
metricFormat: string;
}
export interface NodeDimensions {
width: number;
height: number;
}

View file

@ -1,11 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
export * from './expression_functions';
export * from './expression_renderers';

View file

@ -1,20 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
module.exports = {
preset: '@kbn/test',
rootDir: '../../../../..',
roots: ['<rootDir>/src/platform/plugins/shared/expression_metric'],
coverageDirectory:
'<rootDir>/target/kibana-coverage/jest/src/platform/plugins/shared/expression_metric',
coverageReporters: ['text', 'html'],
collectCoverageFrom: [
'<rootDir>/src/platform/plugins/shared/expression_metric/{common,public,server}/**/*.{ts,tsx}',
],
};

View file

@ -1,20 +0,0 @@
{
"type": "plugin",
"id": "@kbn/expression-metric-plugin",
"owner": [
"@elastic/kibana-presentation"
],
"group": "platform",
"visibility": "shared",
"description": "Adds 'metric' function and renderer to expressions",
"plugin": {
"id": "expressionMetric",
"browser": true,
"server": true,
"requiredPlugins": [
"expressions",
"presentationUtil"
],
"requiredBundles": []
}
}

View file

@ -1,10 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
export { MetricComponent } from './metric_component';

View file

@ -1,10 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
export { metricRendererFactory, getMetricRenderer } from './metric_renderer';

View file

@ -1,18 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { ExpressionMetricPlugin } from './plugin';
export type { ExpressionMetricPluginSetup, ExpressionMetricPluginStart } from './plugin';
export function plugin() {
return new ExpressionMetricPlugin();
}
export { metricRendererFactory, getMetricRenderer } from './expression_renderers';

View file

@ -1,39 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { CoreSetup, CoreStart, Plugin } from '@kbn/core/public';
import { ExpressionsStart, ExpressionsSetup } from '@kbn/expressions-plugin/public';
import { metricFunction } from '../common/expression_functions';
import { metricRendererFactory } from './expression_renderers';
interface SetupDeps {
expressions: ExpressionsSetup;
}
interface StartDeps {
expression: ExpressionsStart;
}
export type ExpressionMetricPluginSetup = void;
export type ExpressionMetricPluginStart = void;
export class ExpressionMetricPlugin
implements Plugin<ExpressionMetricPluginSetup, ExpressionMetricPluginStart, SetupDeps, StartDeps>
{
public setup(core: CoreSetup, { expressions }: SetupDeps): ExpressionMetricPluginSetup {
core.getStartServices().then(([start]) => {
expressions.registerFunction(metricFunction);
expressions.registerRenderer(metricRendererFactory(start));
});
}
public start(core: CoreStart): ExpressionMetricPluginStart {}
public stop() {}
}

View file

@ -1,15 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
export type { ExpressionMetricPluginSetup, ExpressionMetricPluginStart } from './plugin';
export async function plugin() {
const { ExpressionMetricPlugin } = await import('./plugin');
return new ExpressionMetricPlugin();
}

View file

@ -1,35 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { CoreSetup, CoreStart, Plugin } from '@kbn/core/server';
import { ExpressionsServerStart, ExpressionsServerSetup } from '@kbn/expressions-plugin/server';
import { metricFunction } from '../common';
interface SetupDeps {
expressions: ExpressionsServerSetup;
}
interface StartDeps {
expression: ExpressionsServerStart;
}
export type ExpressionMetricPluginSetup = void;
export type ExpressionMetricPluginStart = void;
export class ExpressionMetricPlugin
implements Plugin<ExpressionMetricPluginSetup, ExpressionMetricPluginStart, SetupDeps, StartDeps>
{
public setup(core: CoreSetup, { expressions }: SetupDeps): ExpressionMetricPluginSetup {
expressions.registerFunction(metricFunction);
}
public start(core: CoreStart): ExpressionMetricPluginStart {}
public stop() {}
}

View file

@ -1,24 +0,0 @@
{
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"isolatedModules": true
},
"include": [
"common/**/*",
"public/**/*",
"server/**/*",
"__fixtures__/**/*",
],
"kbn_references": [
"@kbn/core",
"@kbn/presentation-util-plugin",
"@kbn/expressions-plugin",
"@kbn/i18n",
"@kbn/react-kibana-context-theme",
"@kbn/shared-ux-error-boundary",
],
"exclude": [
"target/**/*",
]
}

View file

@ -1,11 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
// eslint-disable-next-line import/no-commonjs
module.exports = require('@kbn/storybook').defaultConfig;

View file

@ -1,9 +0,0 @@
# expressionRepeatImage
Expression Repeat Image plugin adds a `repeatImage` function to the expression plugin and an associated renderer. The renderer will display the given image in mutliple instances.
---
## Development
See the [kibana contributing guide](https://github.com/elastic/kibana/blob/main/CONTRIBUTING.md) for instructions setting up your development environment.

View file

@ -1,15 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
export const PLUGIN_ID = 'expressionRepeatImage';
export const PLUGIN_NAME = 'expressionRepeatImage';
export const CONTEXT = '_context_';
export const BASE64 = '`base64`';
export const URL = 'URL';

View file

@ -1,14 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { repeatImageFunction } from './repeat_image_function';
export const functions = [repeatImageFunction];
export { repeatImageFunction };

View file

@ -1,113 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { i18n } from '@kbn/i18n';
import { CONTEXT, BASE64, URL } from '../constants';
import { ExpressionRepeatImageFunction } from '../types';
export const strings = {
help: i18n.translate('expressionRepeatImage.functions.repeatImageHelpText', {
defaultMessage: 'Configures a repeating image element.',
}),
args: {
emptyImage: i18n.translate(
'expressionRepeatImage.functions.repeatImage.args.emptyImageHelpText',
{
defaultMessage:
'Fills the difference between the {CONTEXT} and {maxArg} parameter for the element with this image. ' +
'Provide an image asset as a {BASE64} data {URL}, or pass in a sub-expression.',
values: {
BASE64,
CONTEXT,
maxArg: '`max`',
URL,
},
}
),
image: i18n.translate('expressionRepeatImage.functions.repeatImage.args.imageHelpText', {
defaultMessage:
'The image to repeat. Provide an image asset as a {BASE64} data {URL}, or pass in a sub-expression.',
values: {
BASE64,
URL,
},
}),
max: i18n.translate('expressionRepeatImage.functions.repeatImage.args.maxHelpText', {
defaultMessage: 'The maximum number of times the image can repeat.',
}),
size: i18n.translate('expressionRepeatImage.functions.repeatImage.args.sizeHelpText', {
defaultMessage:
'The maximum height or width of the image, in pixels. ' +
'When the image is taller than it is wide, this function limits the height.',
}),
},
};
const errors = {
getMissingMaxArgumentErrorMessage: () =>
i18n.translate('expressionRepeatImage.error.repeatImage.missingMaxArgument', {
defaultMessage: '{maxArgument} must be set if providing an {emptyImageArgument}',
values: {
maxArgument: '`max`',
emptyImageArgument: '`emptyImage`',
},
}),
};
export const repeatImageFunction: ExpressionRepeatImageFunction = () => {
const { help, args: argHelp } = strings;
return {
name: 'repeatImage',
aliases: [],
type: 'render',
inputTypes: ['number'],
help,
args: {
emptyImage: {
types: ['string', 'null'],
help: argHelp.emptyImage,
default: null,
},
image: {
types: ['string', 'null'],
help: argHelp.image,
default: null,
},
max: {
types: ['number', 'null'],
help: argHelp.max,
default: 1000,
},
size: {
types: ['number'],
default: 100,
help: argHelp.size,
},
},
fn: async (count, args) => {
const { elasticOutline, isValidUrl, resolveWithMissingImage } = await import(
'@kbn/expression-utils'
);
if (args.emptyImage !== null && isValidUrl(args.emptyImage) && args.max === null) {
throw new Error(errors.getMissingMaxArgumentErrorMessage());
}
return {
type: 'render',
as: 'repeatImage',
value: {
count: Math.floor(count),
...args,
image: resolveWithMissingImage(args.image, elasticOutline),
emptyImage: resolveWithMissingImage(args.emptyImage),
},
};
},
};
};

View file

@ -1,20 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
// TODO: https://github.com/elastic/kibana/issues/110893
export { PLUGIN_ID, PLUGIN_NAME, CONTEXT, BASE64, URL } from './constants';
export type {
Return,
ExpressionRepeatImageFunction,
OriginString,
RepeatImageRendererConfig,
NodeDimensions,
} from './types';
export { functions, repeatImageFunction } from './expression_functions';

View file

@ -1,35 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import {
ExpressionFunctionDefinition,
ExpressionValueRender,
} from '@kbn/expressions-plugin/common';
interface Arguments {
image: string | null;
size: number;
max: number | null;
emptyImage: string | null;
}
export interface Return {
count: number;
image: string;
size: number;
max: number;
emptyImage: string | null;
}
export type ExpressionRepeatImageFunction = () => ExpressionFunctionDefinition<
'repeatImage',
number,
Arguments,
Promise<ExpressionValueRender<Arguments>>
>;

View file

@ -1,22 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
export type OriginString = 'bottom' | 'left' | 'top' | 'right';
export interface RepeatImageRendererConfig {
max: number;
count: number;
emptyImage: string;
image: string;
size: number;
}
export interface NodeDimensions {
width: number;
height: number;
}

View file

@ -1,11 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
export * from './expression_functions';
export * from './expression_renderers';

View file

@ -1,20 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
module.exports = {
preset: '@kbn/test',
rootDir: '../../../../..',
roots: ['<rootDir>/src/platform/plugins/shared/expression_repeat_image'],
coverageDirectory:
'<rootDir>/target/kibana-coverage/jest/src/platform/plugins/shared/expression_repeat_image',
coverageReporters: ['text', 'html'],
collectCoverageFrom: [
'<rootDir>/src/platform/plugins/shared/expression_repeat_image/{common,public,server}/**/*.{ts,tsx}',
],
};

View file

@ -1,20 +0,0 @@
{
"type": "plugin",
"id": "@kbn/expression-repeat-image-plugin",
"owner": [
"@elastic/kibana-presentation"
],
"group": "platform",
"visibility": "shared",
"description": "Adds 'repeatImage' function and renderer to expressions",
"plugin": {
"id": "expressionRepeatImage",
"browser": true,
"server": true,
"requiredPlugins": [
"expressions",
"presentationUtil"
],
"requiredBundles": []
}
}

View file

@ -1,10 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
export * from './repeat_image_component';

View file

@ -1,10 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
export { getRepeatImageRenderer, repeatImageRendererFactory } from './repeat_image_renderer';

View file

@ -1,18 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { ExpressionRepeatImagePlugin } from './plugin';
export type { ExpressionRepeatImagePluginSetup, ExpressionRepeatImagePluginStart } from './plugin';
export function plugin() {
return new ExpressionRepeatImagePlugin();
}
export { getRepeatImageRenderer, repeatImageRendererFactory } from './expression_renderers';

View file

@ -1,45 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { CoreSetup, CoreStart, Plugin } from '@kbn/core/public';
import { ExpressionsStart, ExpressionsSetup } from '@kbn/expressions-plugin/public';
import { repeatImageFunction } from '../common/expression_functions';
import { repeatImageRendererFactory } from './expression_renderers';
interface SetupDeps {
expressions: ExpressionsSetup;
}
interface StartDeps {
expression: ExpressionsStart;
}
export type ExpressionRepeatImagePluginSetup = void;
export type ExpressionRepeatImagePluginStart = void;
export class ExpressionRepeatImagePlugin
implements
Plugin<
ExpressionRepeatImagePluginSetup,
ExpressionRepeatImagePluginStart,
SetupDeps,
StartDeps
>
{
public setup(core: CoreSetup, { expressions }: SetupDeps): ExpressionRepeatImagePluginSetup {
core.getStartServices().then(([start]) => {
expressions.registerFunction(repeatImageFunction);
expressions.registerRenderer(repeatImageRendererFactory(start));
});
}
public start(core: CoreStart): ExpressionRepeatImagePluginStart {}
public stop() {}
}

View file

@ -1,15 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
export type { ExpressionRepeatImagePluginSetup, ExpressionRepeatImagePluginStart } from './plugin';
export async function plugin() {
const { ExpressionRepeatImagePlugin } = await import('./plugin');
return new ExpressionRepeatImagePlugin();
}

View file

@ -1,41 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { CoreSetup, CoreStart, Plugin } from '@kbn/core/server';
import { ExpressionsServerStart, ExpressionsServerSetup } from '@kbn/expressions-plugin/server';
import { repeatImageFunction } from '../common';
interface SetupDeps {
expressions: ExpressionsServerSetup;
}
interface StartDeps {
expression: ExpressionsServerStart;
}
export type ExpressionRepeatImagePluginSetup = void;
export type ExpressionRepeatImagePluginStart = void;
export class ExpressionRepeatImagePlugin
implements
Plugin<
ExpressionRepeatImagePluginSetup,
ExpressionRepeatImagePluginStart,
SetupDeps,
StartDeps
>
{
public setup(core: CoreSetup, { expressions }: SetupDeps): ExpressionRepeatImagePluginSetup {
expressions.registerFunction(repeatImageFunction);
}
public start(core: CoreStart): ExpressionRepeatImagePluginStart {}
public stop() {}
}

View file

@ -1,25 +0,0 @@
{
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"isolatedModules": true
},
"include": [
"common/**/*",
"public/**/*",
"server/**/*",
],
"kbn_references": [
"@kbn/core",
"@kbn/presentation-util-plugin",
"@kbn/expressions-plugin",
"@kbn/i18n",
"@kbn/react-kibana-context-theme",
"@kbn/i18n-react",
"@kbn/shared-ux-error-boundary",
"@kbn/expression-utils"
],
"exclude": [
"target/**/*",
]
}

View file

@ -1,11 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
// eslint-disable-next-line import/no-commonjs
module.exports = require('@kbn/storybook').defaultConfig;

View file

@ -1,9 +0,0 @@
# 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/main/CONTRIBUTING.md) for instructions setting up your development environment.

View file

@ -1,14 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
export const PLUGIN_ID = 'expressionRevealImage';
export const PLUGIN_NAME = 'expressionRevealImage';
export const BASE64 = '`base64`';
export const URL = 'URL';

View file

@ -1,14 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { revealImageFunction } from './reveal_image_function';
export const functions = [revealImageFunction];
export { revealImageFunction };

View file

@ -1,126 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { i18n } from '@kbn/i18n';
import { ExpressionRevealImageFunction, Origin, Position } from '../types';
import { BASE64, URL } from '../constants';
const strings = {
help: i18n.translate('expressionRevealImage.functions.revealImageHelpText', {
defaultMessage: 'Configures an image reveal element.',
}),
args: {
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.',
values: {
BASE64,
URL,
},
}),
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)
.slice(0, -1)
.map((position) => `\`"${position}"\``)
.join(', '),
end: Object.values(Position).slice(-1)[0],
},
}),
},
};
export const errors = {
invalidPercent: (percent: number) =>
new Error(
i18n.translate('expressionRevealImage.functions.revealImage.invalidPercentErrorMessage', {
defaultMessage: "Invalid value: ''{percent}''. Percentage must be between 0 and 1",
values: {
percent,
},
})
),
invalidImageUrl: (imageUrl: string) =>
new Error(
i18n.translate('expressionRevealImage.functions.revealImage.invalidImageUrl', {
defaultMessage: "Invalid image url: ''{imageUrl}''.",
values: {
imageUrl,
},
})
),
};
export const revealImageFunction: ExpressionRevealImageFunction = () => {
const { help, args: argHelp } = strings;
return {
name: 'revealImage',
aliases: [],
type: 'render',
inputTypes: ['number'],
help,
args: {
image: {
types: ['string', 'null'],
help: argHelp.image,
default: null,
},
emptyImage: {
types: ['string', 'null'],
help: argHelp.emptyImage,
default: null,
},
origin: {
types: ['string'],
help: argHelp.origin,
default: 'bottom',
options: Object.values(Origin),
},
},
fn: async (percent, args) => {
if (percent > 1 || percent < 0) {
throw errors.invalidPercent(percent);
}
const { resolveWithMissingImage, elasticOutline, isValidUrl } = await import(
'@kbn/expression-utils'
);
if (args.image && !isValidUrl(args.image)) {
throw errors.invalidImageUrl(args.image);
}
return {
type: 'render',
as: 'revealImage',
value: {
percent,
...args,
image: resolveWithMissingImage(args.image, elasticOutline) as string,
emptyImage: resolveWithMissingImage(args.emptyImage) as string,
},
};
},
};
};

View file

@ -1,13 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
// TODO: https://github.com/elastic/kibana/issues/110893
export { PLUGIN_ID, PLUGIN_NAME, BASE64, URL } from './constants';
export { functions, revealImageFunction } from './expression_functions';

View file

@ -1,47 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import {
ExpressionFunctionDefinition,
ExpressionValueRender,
} from '@kbn/expressions-plugin/common';
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,
Promise<ExpressionValueRender<Output>>
>;
export enum Position {
TOP = 'top',
BOTTOM = 'bottom',
LEFT = 'left',
RIGHT = 'right',
}

View file

@ -1,22 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", 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;
}

View file

@ -1,11 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
export * from './expression_functions';
export * from './expression_renderers';

View file

@ -1,20 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
module.exports = {
preset: '@kbn/test',
rootDir: '../../../../..',
roots: ['<rootDir>/src/platform/plugins/shared/expression_reveal_image'],
coverageDirectory:
'<rootDir>/target/kibana-coverage/jest/src/platform/plugins/shared/expression_reveal_image',
coverageReporters: ['text', 'html'],
collectCoverageFrom: [
'<rootDir>/src/platform/plugins/shared/expression_reveal_image/{common,public,server}/**/*.{ts,tsx}',
],
};

View file

@ -1,20 +0,0 @@
{
"type": "plugin",
"id": "@kbn/expression-reveal-image-plugin",
"owner": [
"@elastic/kibana-presentation"
],
"group": "platform",
"visibility": "shared",
"description": "Adds 'revealImage' function and renderer to expressions",
"plugin": {
"id": "expressionRevealImage",
"browser": true,
"server": true,
"requiredPlugins": [
"expressions",
"presentationUtil"
],
"requiredBundles": []
}
}

View file

@ -1,10 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
export * from './reveal_image_component';

View file

@ -1,10 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
export { revealImageRendererFactory, getRevealImageRenderer } from './reveal_image_renderer';

View file

@ -1,18 +0,0 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { ExpressionRevealImagePlugin } from './plugin';
export type { ExpressionRevealImagePluginSetup, ExpressionRevealImagePluginStart } from './plugin';
export function plugin() {
return new ExpressionRevealImagePlugin();
}
export { revealImageRendererFactory, getRevealImageRenderer } from './expression_renderers';

Some files were not shown because too many files have changed in this diff Show more