From 36203b03ff95c928c573b13341095190d9c9017e Mon Sep 17 00:00:00 2001 From: Gerard Soldevila Date: Thu, 5 Dec 2024 20:13:32 +0100 Subject: [PATCH] Relocating module `@kbn/presentation-publishing` --- .github/CODEOWNERS | 2 +- package.json | 2 +- .../presentation/presentation_publishing/README.md | 0 .../comparators/fallback_comparator.ts | 0 .../presentation_publishing/comparators/index.ts | 0 .../comparators/state_comparators.ts | 0 .../presentation_publishing/comparators/types.ts | 0 .../shared}/presentation/presentation_publishing/index.ts | 0 .../interfaces/can_access_view_mode.ts | 0 .../interfaces/can_lock_hover_actions.ts | 0 .../interfaces/fetch/fetch.test.ts | 0 .../presentation_publishing/interfaces/fetch/fetch.ts | 0 .../interfaces/fetch/initialize_time_range.ts | 0 .../interfaces/fetch/publishes_reload.ts | 0 .../interfaces/fetch/publishes_search_session.ts | 0 .../interfaces/fetch/publishes_unified_search.ts | 0 .../presentation_publishing/interfaces/has_app_context.ts | 0 .../interfaces/has_disable_triggers.ts | 0 .../interfaces/has_edit_capabilities.ts | 0 .../interfaces/has_execution_context.ts | 0 .../interfaces/has_library_transforms.ts | 0 .../presentation_publishing/interfaces/has_parent_api.ts | 0 .../interfaces/has_supported_triggers.ts | 0 .../presentation_publishing/interfaces/has_type.ts | 0 .../presentation_publishing/interfaces/has_uuid.ts | 0 .../interfaces/publishes_blocking_error.ts | 0 .../interfaces/publishes_data_loading.ts | 0 .../interfaces/publishes_data_views.ts | 0 .../interfaces/publishes_disabled_action_ids.ts | 0 .../interfaces/publishes_phase_events.ts | 0 .../interfaces/publishes_rendered.ts | 0 .../interfaces/publishes_saved_object_id.ts | 0 .../interfaces/publishes_unsaved_changes.ts | 0 .../interfaces/publishes_view_mode.ts | 0 .../interfaces/titles/publishes_panel_description.test.ts | 0 .../interfaces/titles/publishes_panel_description.ts | 0 .../interfaces/titles/publishes_panel_title.test.ts | 0 .../interfaces/titles/publishes_panel_title.ts | 0 .../interfaces/titles/titles_api.test.ts | 0 .../interfaces/titles/titles_api.ts | 0 .../presentation/presentation_publishing/jest.config.js | 4 ++-- .../presentation/presentation_publishing/kibana.jsonc | 0 .../presentation/presentation_publishing/package.json | 0 .../presentation_publishing/publishing_subject/index.ts | 0 .../publishing_subject/publishing_batcher.ts | 0 .../publishing_subject/publishing_subject.test.tsx | 0 .../publishing_subject/publishing_subject.ts | 0 .../presentation_publishing/publishing_subject/types.ts | 0 .../presentation/presentation_publishing/tsconfig.json | 2 +- src/platform/plugins/shared/embeddable/README.md | 8 ++++---- tsconfig.base.json | 4 ++-- yarn.lock | 2 +- 52 files changed, 12 insertions(+), 12 deletions(-) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/README.md (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/comparators/fallback_comparator.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/comparators/index.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/comparators/state_comparators.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/comparators/types.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/index.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/can_access_view_mode.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/can_lock_hover_actions.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/fetch/fetch.test.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/fetch/fetch.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/fetch/initialize_time_range.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/fetch/publishes_reload.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/fetch/publishes_search_session.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/fetch/publishes_unified_search.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/has_app_context.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/has_disable_triggers.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/has_edit_capabilities.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/has_execution_context.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/has_library_transforms.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/has_parent_api.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/has_supported_triggers.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/has_type.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/has_uuid.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/publishes_blocking_error.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/publishes_data_loading.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/publishes_data_views.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/publishes_disabled_action_ids.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/publishes_phase_events.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/publishes_rendered.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/publishes_saved_object_id.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/publishes_unsaved_changes.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/publishes_view_mode.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/titles/publishes_panel_description.test.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/titles/publishes_panel_description.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/titles/publishes_panel_title.test.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/titles/publishes_panel_title.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/titles/titles_api.test.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/interfaces/titles/titles_api.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/jest.config.js (80%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/kibana.jsonc (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/package.json (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/publishing_subject/index.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/publishing_subject/publishing_batcher.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/publishing_subject/publishing_subject.test.tsx (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/publishing_subject/publishing_subject.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/publishing_subject/types.ts (100%) rename {packages => src/platform/packages/shared}/presentation/presentation_publishing/tsconfig.json (85%) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index fbda37a5165de..3d90df620d92a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -549,7 +549,6 @@ packages/kbn-xstate-utils @elastic/obs-ux-logs-team packages/kbn-yarn-lock-validator @elastic/kibana-operations packages/kbn-zod @elastic/kibana-core packages/kbn-zod-helpers @elastic/security-detection-rule-management -packages/presentation/presentation_publishing @elastic/kibana-presentation packages/react/kibana_context/common @elastic/appex-sharedux packages/react/kibana_context/render @elastic/appex-sharedux packages/react/kibana_context/root @elastic/appex-sharedux @@ -623,6 +622,7 @@ src/platform/packages/private/kbn-panel-loader @elastic/kibana-presentation src/platform/packages/shared/kbn-doc-links @elastic/docs src/platform/packages/shared/kbn-flot-charts @elastic/kibana-presentation @elastic/stack-monitoring src/platform/packages/shared/presentation/presentation_containers @elastic/kibana-presentation +src/platform/packages/shared/presentation/presentation_publishing @elastic/kibana-presentation src/platform/plugins/private/input_control_vis @elastic/kibana-presentation src/platform/plugins/private/links @elastic/kibana-presentation src/platform/plugins/private/maps_ems @elastic/kibana-presentation diff --git a/package.json b/package.json index 84e5e50495ad3..e1cf084a4afd6 100644 --- a/package.json +++ b/package.json @@ -722,7 +722,7 @@ "@kbn/preboot-example-plugin": "link:examples/preboot_example", "@kbn/presentation-containers": "link:src/platform/packages/shared/presentation/presentation_containers", "@kbn/presentation-panel-plugin": "link:src/platform/plugins/private/presentation_panel", - "@kbn/presentation-publishing": "link:packages/presentation/presentation_publishing", + "@kbn/presentation-publishing": "link:src/platform/packages/shared/presentation/presentation_publishing", "@kbn/presentation-util-plugin": "link:src/plugins/presentation_util", "@kbn/product-doc-base-plugin": "link:x-pack/plugins/ai_infra/product_doc_base", "@kbn/product-doc-common": "link:x-pack/packages/ai-infra/product-doc-common", diff --git a/packages/presentation/presentation_publishing/README.md b/src/platform/packages/shared/presentation/presentation_publishing/README.md similarity index 100% rename from packages/presentation/presentation_publishing/README.md rename to src/platform/packages/shared/presentation/presentation_publishing/README.md diff --git a/packages/presentation/presentation_publishing/comparators/fallback_comparator.ts b/src/platform/packages/shared/presentation/presentation_publishing/comparators/fallback_comparator.ts similarity index 100% rename from packages/presentation/presentation_publishing/comparators/fallback_comparator.ts rename to src/platform/packages/shared/presentation/presentation_publishing/comparators/fallback_comparator.ts diff --git a/packages/presentation/presentation_publishing/comparators/index.ts b/src/platform/packages/shared/presentation/presentation_publishing/comparators/index.ts similarity index 100% rename from packages/presentation/presentation_publishing/comparators/index.ts rename to src/platform/packages/shared/presentation/presentation_publishing/comparators/index.ts diff --git a/packages/presentation/presentation_publishing/comparators/state_comparators.ts b/src/platform/packages/shared/presentation/presentation_publishing/comparators/state_comparators.ts similarity index 100% rename from packages/presentation/presentation_publishing/comparators/state_comparators.ts rename to src/platform/packages/shared/presentation/presentation_publishing/comparators/state_comparators.ts diff --git a/packages/presentation/presentation_publishing/comparators/types.ts b/src/platform/packages/shared/presentation/presentation_publishing/comparators/types.ts similarity index 100% rename from packages/presentation/presentation_publishing/comparators/types.ts rename to src/platform/packages/shared/presentation/presentation_publishing/comparators/types.ts diff --git a/packages/presentation/presentation_publishing/index.ts b/src/platform/packages/shared/presentation/presentation_publishing/index.ts similarity index 100% rename from packages/presentation/presentation_publishing/index.ts rename to src/platform/packages/shared/presentation/presentation_publishing/index.ts diff --git a/packages/presentation/presentation_publishing/interfaces/can_access_view_mode.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/can_access_view_mode.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/can_access_view_mode.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/can_access_view_mode.ts diff --git a/packages/presentation/presentation_publishing/interfaces/can_lock_hover_actions.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/can_lock_hover_actions.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/can_lock_hover_actions.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/can_lock_hover_actions.ts diff --git a/packages/presentation/presentation_publishing/interfaces/fetch/fetch.test.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/fetch.test.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/fetch/fetch.test.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/fetch.test.ts diff --git a/packages/presentation/presentation_publishing/interfaces/fetch/fetch.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/fetch.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/fetch/fetch.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/fetch.ts diff --git a/packages/presentation/presentation_publishing/interfaces/fetch/initialize_time_range.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/initialize_time_range.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/fetch/initialize_time_range.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/initialize_time_range.ts diff --git a/packages/presentation/presentation_publishing/interfaces/fetch/publishes_reload.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_reload.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/fetch/publishes_reload.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_reload.ts diff --git a/packages/presentation/presentation_publishing/interfaces/fetch/publishes_search_session.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_search_session.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/fetch/publishes_search_session.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_search_session.ts diff --git a/packages/presentation/presentation_publishing/interfaces/fetch/publishes_unified_search.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_unified_search.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/fetch/publishes_unified_search.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_unified_search.ts diff --git a/packages/presentation/presentation_publishing/interfaces/has_app_context.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_app_context.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/has_app_context.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_app_context.ts diff --git a/packages/presentation/presentation_publishing/interfaces/has_disable_triggers.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_disable_triggers.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/has_disable_triggers.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_disable_triggers.ts diff --git a/packages/presentation/presentation_publishing/interfaces/has_edit_capabilities.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_edit_capabilities.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/has_edit_capabilities.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_edit_capabilities.ts diff --git a/packages/presentation/presentation_publishing/interfaces/has_execution_context.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_execution_context.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/has_execution_context.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_execution_context.ts diff --git a/packages/presentation/presentation_publishing/interfaces/has_library_transforms.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_library_transforms.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/has_library_transforms.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_library_transforms.ts diff --git a/packages/presentation/presentation_publishing/interfaces/has_parent_api.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_parent_api.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/has_parent_api.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_parent_api.ts diff --git a/packages/presentation/presentation_publishing/interfaces/has_supported_triggers.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_supported_triggers.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/has_supported_triggers.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_supported_triggers.ts diff --git a/packages/presentation/presentation_publishing/interfaces/has_type.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_type.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/has_type.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_type.ts diff --git a/packages/presentation/presentation_publishing/interfaces/has_uuid.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_uuid.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/has_uuid.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_uuid.ts diff --git a/packages/presentation/presentation_publishing/interfaces/publishes_blocking_error.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_blocking_error.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/publishes_blocking_error.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_blocking_error.ts diff --git a/packages/presentation/presentation_publishing/interfaces/publishes_data_loading.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_data_loading.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/publishes_data_loading.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_data_loading.ts diff --git a/packages/presentation/presentation_publishing/interfaces/publishes_data_views.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_data_views.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/publishes_data_views.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_data_views.ts diff --git a/packages/presentation/presentation_publishing/interfaces/publishes_disabled_action_ids.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_disabled_action_ids.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/publishes_disabled_action_ids.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_disabled_action_ids.ts diff --git a/packages/presentation/presentation_publishing/interfaces/publishes_phase_events.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_phase_events.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/publishes_phase_events.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_phase_events.ts diff --git a/packages/presentation/presentation_publishing/interfaces/publishes_rendered.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_rendered.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/publishes_rendered.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_rendered.ts diff --git a/packages/presentation/presentation_publishing/interfaces/publishes_saved_object_id.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_saved_object_id.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/publishes_saved_object_id.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_saved_object_id.ts diff --git a/packages/presentation/presentation_publishing/interfaces/publishes_unsaved_changes.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_unsaved_changes.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/publishes_unsaved_changes.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_unsaved_changes.ts diff --git a/packages/presentation/presentation_publishing/interfaces/publishes_view_mode.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_view_mode.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/publishes_view_mode.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_view_mode.ts diff --git a/packages/presentation/presentation_publishing/interfaces/titles/publishes_panel_description.test.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_panel_description.test.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/titles/publishes_panel_description.test.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_panel_description.test.ts diff --git a/packages/presentation/presentation_publishing/interfaces/titles/publishes_panel_description.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_panel_description.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/titles/publishes_panel_description.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_panel_description.ts diff --git a/packages/presentation/presentation_publishing/interfaces/titles/publishes_panel_title.test.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_panel_title.test.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/titles/publishes_panel_title.test.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_panel_title.test.ts diff --git a/packages/presentation/presentation_publishing/interfaces/titles/publishes_panel_title.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_panel_title.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/titles/publishes_panel_title.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_panel_title.ts diff --git a/packages/presentation/presentation_publishing/interfaces/titles/titles_api.test.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/titles_api.test.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/titles/titles_api.test.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/titles_api.test.ts diff --git a/packages/presentation/presentation_publishing/interfaces/titles/titles_api.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/titles_api.ts similarity index 100% rename from packages/presentation/presentation_publishing/interfaces/titles/titles_api.ts rename to src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/titles_api.ts diff --git a/packages/presentation/presentation_publishing/jest.config.js b/src/platform/packages/shared/presentation/presentation_publishing/jest.config.js similarity index 80% rename from packages/presentation/presentation_publishing/jest.config.js rename to src/platform/packages/shared/presentation/presentation_publishing/jest.config.js index dca7812d88eb3..5472459fba481 100644 --- a/packages/presentation/presentation_publishing/jest.config.js +++ b/src/platform/packages/shared/presentation/presentation_publishing/jest.config.js @@ -9,6 +9,6 @@ module.exports = { preset: '@kbn/test', - rootDir: '../../..', - roots: ['/packages/presentation/presentation_publishing'], + rootDir: '../../../../../..', + roots: ['/src/platform/packages/shared/presentation/presentation_publishing'], }; diff --git a/packages/presentation/presentation_publishing/kibana.jsonc b/src/platform/packages/shared/presentation/presentation_publishing/kibana.jsonc similarity index 100% rename from packages/presentation/presentation_publishing/kibana.jsonc rename to src/platform/packages/shared/presentation/presentation_publishing/kibana.jsonc diff --git a/packages/presentation/presentation_publishing/package.json b/src/platform/packages/shared/presentation/presentation_publishing/package.json similarity index 100% rename from packages/presentation/presentation_publishing/package.json rename to src/platform/packages/shared/presentation/presentation_publishing/package.json diff --git a/packages/presentation/presentation_publishing/publishing_subject/index.ts b/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/index.ts similarity index 100% rename from packages/presentation/presentation_publishing/publishing_subject/index.ts rename to src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/index.ts diff --git a/packages/presentation/presentation_publishing/publishing_subject/publishing_batcher.ts b/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/publishing_batcher.ts similarity index 100% rename from packages/presentation/presentation_publishing/publishing_subject/publishing_batcher.ts rename to src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/publishing_batcher.ts diff --git a/packages/presentation/presentation_publishing/publishing_subject/publishing_subject.test.tsx b/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/publishing_subject.test.tsx similarity index 100% rename from packages/presentation/presentation_publishing/publishing_subject/publishing_subject.test.tsx rename to src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/publishing_subject.test.tsx diff --git a/packages/presentation/presentation_publishing/publishing_subject/publishing_subject.ts b/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/publishing_subject.ts similarity index 100% rename from packages/presentation/presentation_publishing/publishing_subject/publishing_subject.ts rename to src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/publishing_subject.ts diff --git a/packages/presentation/presentation_publishing/publishing_subject/types.ts b/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/types.ts similarity index 100% rename from packages/presentation/presentation_publishing/publishing_subject/types.ts rename to src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/types.ts diff --git a/packages/presentation/presentation_publishing/tsconfig.json b/src/platform/packages/shared/presentation/presentation_publishing/tsconfig.json similarity index 85% rename from packages/presentation/presentation_publishing/tsconfig.json rename to src/platform/packages/shared/presentation/presentation_publishing/tsconfig.json index a08944f9674da..58edc9d14270d 100644 --- a/packages/presentation/presentation_publishing/tsconfig.json +++ b/src/platform/packages/shared/presentation/presentation_publishing/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../../../../tsconfig.base.json", "compilerOptions": { "outDir": "target/types", "types": ["jest", "node", "react"] diff --git a/src/platform/plugins/shared/embeddable/README.md b/src/platform/plugins/shared/embeddable/README.md index 62c5c007d86ad..4e0deea10830c 100644 --- a/src/platform/plugins/shared/embeddable/README.md +++ b/src/platform/plugins/shared/embeddable/README.md @@ -16,19 +16,19 @@ Each embeddable manages its own state. This is because the embeddable system all #### Publishing package An embeddable API is a plain old typescript object that implements any number of shared interfaces. A shared interface is defined by a publishing package. A publishing package also provides a type guard that is used to check if a given object fulfills the interface. -For example, the [has_edit_capabilites](https://github.com/elastic/kibana/tree/main/packages/presentation/presentation_publishing/interfaces/has_edit_capabilities.ts) publishing package defines the `HasEditCapabilities` interface and the `apiHasEditCapabilities` type guard. The [edit panal action](https://github.com/elastic/kibana/tree/main/src/platform/plugins/private/presentation_panel/public/panel_actions/edit_panel_action/edit_panel_action.ts) defines the "Edit" panel context menu action. The action's `isCompatible` check uses the `apiHasEditCapabilities` type guard to check that an embeddable API implements the `HasEditCapabilities` interface. When an embeddable API implements the interface and all other conditions of `isCompatible` check are true, the "Edit" action is availabe in the panel context menu. When an embeddable API does not implement the interface, the "Edit" action is not available in the panel context menu. +For example, the [has_edit_capabilites](https://github.com/elastic/kibana/tree/main/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_edit_capabilities.ts) publishing package defines the `HasEditCapabilities` interface and the `apiHasEditCapabilities` type guard. The [edit panal action](https://github.com/elastic/kibana/tree/main/src/platform/plugins/private/presentation_panel/public/panel_actions/edit_panel_action/edit_panel_action.ts) defines the "Edit" panel context menu action. The action's `isCompatible` check uses the `apiHasEditCapabilities` type guard to check that an embeddable API implements the `HasEditCapabilities` interface. When an embeddable API implements the interface and all other conditions of `isCompatible` check are true, the "Edit" action is availabe in the panel context menu. When an embeddable API does not implement the interface, the "Edit" action is not available in the panel context menu. #### Publishing subject An embeddable API shares state via a publishing subject, a read only RxJS Observable. -For example, [publishes_panel_title](https://github.com/elastic/kibana/tree/main/packages/presentation/presentation_publishing/interfaces/titles/publishes_panel_title.ts) publishing package defines interfaces and type guards for title state. [initializeTitles](https://github.com/elastic/kibana/tree/main/packages/presentation/presentation_publishing/interfaces/titles/titles_api.ts) provides an implemenation for the titles publishing package. `panelTitle` is provided as a publishing subject. [PresentationPanelInternal React component](https://github.com/elastic/kibana/tree/main/src/platform/plugins/private/presentation_panel/public/panel_component/presentation_panel_internal.tsx) uses a hook to consume `panelTitle` as React state. Changes to `panelTitle` publishing subject updates React state, which in turn, causes the UI to re-render with the current value. [CustomizePanelEditor React component](https://github.com/elastic/kibana/tree/main/src/platform/plugins/private/presentation_panel/public/panel_actions/customize_panel_action/customize_panel_editor.tsx) uses `api.setPanelTitle` to set the title on save. +For example, [publishes_panel_title](https://github.com/elastic/kibana/tree/main/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_panel_title.ts) publishing package defines interfaces and type guards for title state. [initializeTitles](https://github.com/elastic/kibana/tree/main/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/titles_api.ts) provides an implemenation for the titles publishing package. `panelTitle` is provided as a publishing subject. [PresentationPanelInternal React component](https://github.com/elastic/kibana/tree/main/src/platform/plugins/private/presentation_panel/public/panel_component/presentation_panel_internal.tsx) uses a hook to consume `panelTitle` as React state. Changes to `panelTitle` publishing subject updates React state, which in turn, causes the UI to re-render with the current value. [CustomizePanelEditor React component](https://github.com/elastic/kibana/tree/main/src/platform/plugins/private/presentation_panel/public/panel_actions/customize_panel_action/customize_panel_editor.tsx) uses `api.setPanelTitle` to set the title on save. #### Comparators Comparators allow a page to track changes to an embeddable's state. For example, Dashboard uses comparators to display a UI notification for unsaved changes, to reset changes, and persist unsaved changes to session storage. A comparator must be provided for each property in an embeddable's RuntimeState. A comparator is a 3 element tuple: where the first element is a publishing subject providing the current value. The second element is a setter allowing the page to reset the value. The third element is an optional comparator function which provides logic to diff this property. -For example, [initializeTitles](https://github.com/elastic/kibana/tree/main/packages/presentation/presentation_publishing/interfaces/titles/titles_api.ts) provides an implemenation for the titles publishing package. Comparitors are provided for each property from `SerializedTitles`. +For example, [initializeTitles](https://github.com/elastic/kibana/tree/main/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/titles_api.ts) provides an implemenation for the titles publishing package. Comparitors are provided for each property from `SerializedTitles`. ### Best practices @@ -42,7 +42,7 @@ Break your Component into a Package or another plugin to avoid circular plugin d Embeddable APIs are accessable to all Kibana systems and all embeddable siblings and parents. Functions and state that are internal to an embeddable including any child components should not be added to the API. Consider passing internal state to child as props or react context. #### Error handling -Embeddables should never throw. Instead, use [PublishesBlockingError](https://github.com/elastic/kibana/blob/main/packages/presentation/presentation_publishing/interfaces/publishes_blocking_error.ts) interface to surface unrecoverable errors. When an embeddable publishes a blocking error, the parent component will display an error component instead of the embeddable Component. Be thoughtful about which errors are surfaced with the PublishesBlockingError interface. If the embeddable can still render, use less invasive error handling such as a warning toast or notifications in the embeddable Component UI. +Embeddables should never throw. Instead, use [PublishesBlockingError](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_blocking_error.ts) interface to surface unrecoverable errors. When an embeddable publishes a blocking error, the parent component will display an error component instead of the embeddable Component. Be thoughtful about which errors are surfaced with the PublishesBlockingError interface. If the embeddable can still render, use less invasive error handling such as a warning toast or notifications in the embeddable Component UI. ### Examples Examples available at [/examples/embeddable_examples](https://github.com/elastic/kibana/tree/main/examples/embeddable_examples) diff --git a/tsconfig.base.json b/tsconfig.base.json index ddc6fd7c413f5..7b64cc1abeb53 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1398,8 +1398,8 @@ "@kbn/presentation-containers/*": ["src/platform/packages/shared/presentation/presentation_containers/*"], "@kbn/presentation-panel-plugin": ["src/platform/plugins/private/presentation_panel"], "@kbn/presentation-panel-plugin/*": ["src/platform/plugins/private/presentation_panel/*"], - "@kbn/presentation-publishing": ["packages/presentation/presentation_publishing"], - "@kbn/presentation-publishing/*": ["packages/presentation/presentation_publishing/*"], + "@kbn/presentation-publishing": ["src/platform/packages/shared/presentation/presentation_publishing"], + "@kbn/presentation-publishing/*": ["src/platform/packages/shared/presentation/presentation_publishing/*"], "@kbn/presentation-util-plugin": ["src/plugins/presentation_util"], "@kbn/presentation-util-plugin/*": ["src/plugins/presentation_util/*"], "@kbn/product-doc-artifact-builder": ["x-pack/packages/ai-infra/product-doc-artifact-builder"], diff --git a/yarn.lock b/yarn.lock index de2ce2bdff269..8aaf3473c1fc6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6612,7 +6612,7 @@ version "0.0.0" uid "" -"@kbn/presentation-publishing@link:packages/presentation/presentation_publishing": +"@kbn/presentation-publishing@link:src/platform/packages/shared/presentation/presentation_publishing": version "0.0.0" uid ""