Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UnifiedDocViewer] Move Discover doc viewer into plugin/package #162847

Merged
merged 80 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
7a2a503
Move doc viewer into plugin/package
lukasolson Jul 31, 2023
a07ca98
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Jul 31, 2023
b8b65c2
[CI] Auto-commit changed files from 'node scripts/generate codeowners'
kibanamachine Jul 31, 2023
1f4fbc1
[CI] Auto-commit changed files from 'node scripts/build_plugin_list_d…
kibanamachine Jul 31, 2023
5275b6b
Merge branch 'main' into pkg/unified-doc-viewer
lukasolson Aug 2, 2023
372d724
Fix build errors
lukasolson Aug 2, 2023
de505d2
Merge remote-tracking branch 'origin/pkg/unified-doc-viewer' into pkg…
lukasolson Aug 2, 2023
9b49d8c
Update limits.yml
lukasolson Aug 2, 2023
17c4a78
Fix 18n
lukasolson Aug 3, 2023
93f5bcf
Merge branch 'main' into pkg/unified-doc-viewer
lukasolson Aug 3, 2023
e603b88
Fix tests
lukasolson Aug 3, 2023
a4f5c41
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Aug 3, 2023
cf5682f
Fix translations
lukasolson Aug 3, 2023
8065393
Merge branch 'pkg/unified-doc-viewer' of github.com:lukasolson/kibana…
lukasolson Aug 3, 2023
f04eac9
Merge branch 'main' into pkg/unified-doc-viewer
lukasolson Aug 3, 2023
46fb835
Fix another translation
lukasolson Aug 3, 2023
b5a87cb
Merge branch 'main' into pkg/unified-doc-viewer
lukasolson Aug 4, 2023
95d5424
Merge branch 'main' into pkg/unified-doc-viewer
lukasolson Aug 4, 2023
764b3ae
Merge branch 'main' into pkg/unified-doc-viewer
lukasolson Aug 8, 2023
34911d8
Add examples app
lukasolson Aug 8, 2023
b81d2fd
Merge branch 'pkg/unified-doc-viewer' of github.com:lukasolson/kibana…
lukasolson Aug 8, 2023
dce729e
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Aug 8, 2023
257287c
[CI] Auto-commit changed files from 'node scripts/generate codeowners'
kibanamachine Aug 8, 2023
f535894
Fix build issues with examples plugin
lukasolson Aug 9, 2023
1a1a523
Merge remote-tracking branch 'origin/pkg/unified-doc-viewer' into pkg…
lukasolson Aug 9, 2023
5b2bdd4
Merge branch 'main' into pkg/unified-doc-viewer
lukasolson Aug 9, 2023
b954057
Bundle size improvements
lukasolson Aug 10, 2023
70384dd
Move fieldname component to package
lukasolson Aug 12, 2023
3b18b3c
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Aug 12, 2023
e24da75
Merge branch 'main' into pkg/unified-doc-viewer
lukasolson Aug 14, 2023
e2a454e
Merge branch 'pkg/unified-doc-viewer' of github.com:lukasolson/kibana…
lukasolson Aug 14, 2023
69e609d
Fix build errors
lukasolson Aug 14, 2023
688c91c
Fix build
lukasolson Aug 14, 2023
90f0b77
Build issues
lukasolson Aug 14, 2023
8e3fea6
Fix build issues
lukasolson Aug 14, 2023
badf0e4
Fix more build issues
lukasolson Aug 14, 2023
24a9930
Move translation namespace
lukasolson Aug 14, 2023
bc620b0
Fix translation
lukasolson Aug 14, 2023
8c5b0dd
Merge branch 'main' into pkg/unified-doc-viewer
lukasolson Aug 15, 2023
0ff1dcb
Merge branch 'main' into pkg/unified-doc-viewer
kibanamachine Aug 16, 2023
b540828
Merge branch 'main' into pkg/unified-doc-viewer
shahzad31 Aug 16, 2023
77ec259
Merge branch 'main' into pkg/unified-doc-viewer
shahzad31 Aug 16, 2023
1af8b59
Merge branch 'main' into pkg/unified-doc-viewer
lukasolson Aug 16, 2023
33e7c44
Bundle size improvements
lukasolson Aug 16, 2023
21ba039
Merge branch 'pkg/unified-doc-viewer' of github.com:lukasolson/kibana…
lukasolson Aug 16, 2023
d2cbce9
Update snapshot
lukasolson Aug 16, 2023
d3dc5f7
Merge branch 'main' into pkg/unified-doc-viewer
lukasolson Aug 17, 2023
8ea96b4
Actual bundle size improvements
lukasolson Aug 18, 2023
ff75f32
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Aug 18, 2023
c4b9392
Merge branch 'main' into pkg/unified-doc-viewer
lukasolson Aug 21, 2023
38b6fda
Merge branch 'pkg/unified-doc-viewer' of github.com:lukasolson/kibana…
lukasolson Aug 21, 2023
4fa4a04
Export props type
lukasolson Aug 21, 2023
8139387
Update Jest snapshot
lukasolson Aug 21, 2023
9cd6ed7
Merge branch 'main' into pkg/unified-doc-viewer
lukasolson Aug 21, 2023
05bd2c3
Merge branch 'main' into pkg/unified-doc-viewer
lukasolson Aug 23, 2023
649380f
Merge branch 'pkg/unified-doc-viewer' of github.com:lukasolson/kibana…
lukasolson Aug 23, 2023
948fcb8
Use withSuspense
lukasolson Aug 23, 2023
76e0ac8
Merge branch 'main' into pkg/unified-doc-viewer
lukasolson Aug 24, 2023
0823096
Merge branch 'main' into pkg/unified-doc-viewer
lukasolson Aug 25, 2023
5209511
Merge branch 'pkg/unified-doc-viewer' of github.com:lukasolson/kibana…
lukasolson Aug 25, 2023
921af0e
Add unified doc viewer wrapper
lukasolson Aug 25, 2023
8ba0429
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Aug 25, 2023
e7432d8
Merge branch 'main' into pkg/unified-doc-viewer
lukasolson Aug 28, 2023
04ed272
Merge branch 'pkg/unified-doc-viewer' of github.com:lukasolson/kibana…
lukasolson Aug 28, 2023
98ca7c0
Fix getServices
lukasolson Aug 28, 2023
3f548d6
Inject services into component
lukasolson Aug 28, 2023
694cece
Remove react dependency
lukasolson Aug 28, 2023
f9b141e
create mocks & fix tests
lukasolson Aug 29, 2023
9c3cd88
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Aug 29, 2023
c0d2fe6
Move get/set to start
lukasolson Aug 29, 2023
ed1bd61
Merge branch 'pkg/unified-doc-viewer' of github.com:lukasolson/kibana…
lukasolson Aug 29, 2023
3c99e94
Page load size improvements
lukasolson Aug 29, 2023
48341b4
Remove deferred spinner
lukasolson Aug 29, 2023
47b67f7
Dedup DocProps and remove referrer
lukasolson Aug 29, 2023
f84929d
Merge branch 'main' into pkg/unified-doc-viewer
lukasolson Aug 30, 2023
5335161
Remove unifiedDocViewer from discover services & remove DocViewer pro…
lukasolson Aug 30, 2023
5659b3a
Merge branch 'main' into pkg/unified-doc-viewer
lukasolson Aug 30, 2023
e23a04f
Matthias feedback
lukasolson Aug 31, 2023
0de986a
Merge branch 'pkg/unified-doc-viewer' of github.com:lukasolson/kibana…
lukasolson Aug 31, 2023
ebfad2e
Merge branch 'main' into pkg/unified-doc-viewer
lukasolson Aug 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,8 @@ test/plugin_functional/plugins/ui_settings_plugin @elastic/kibana-core
packages/kbn-ui-shared-deps-npm @elastic/kibana-operations
packages/kbn-ui-shared-deps-src @elastic/kibana-operations
packages/kbn-ui-theme @elastic/kibana-operations
packages/kbn-unified-doc-viewer @elastic/kibana-data-discovery
src/plugins/unified_doc_viewer @elastic/kibana-data-discovery
packages/kbn-unified-field-list @elastic/kibana-data-discovery
examples/unified_field_list_examples @elastic/kibana-data-discovery
src/plugins/unified_histogram @elastic/kibana-data-discovery
Expand Down
1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
"visTypeXy": "src/plugins/vis_types/xy",
"visualizations": "src/plugins/visualizations",
"visualizationUiComponents": "packages/kbn-visualization-ui-components",
"unifiedDocViewer": ["src/plugins/unified_doc_viewer", "packages/kbn-unified-doc-viewer"],
"unifiedSearch": "src/plugins/unified_search",
"unifiedFieldList": "packages/kbn-unified-field-list",
"unifiedHistogram": "src/plugins/unified_histogram"
Expand Down
4 changes: 4 additions & 0 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,10 @@ In general this plugin provides:
|Registers commercially licensed generic actions like per panel time range and contains some code that supports drilldown work.


|{kib-repo}blob/{branch}/src/plugins/unified_doc_viewer/README.md[unifiedDocViewer]
|This plugin contains services reliant on the plugin lifecycle for the unified doc viewer component (see @kbn/unified-doc-viewer).


|{kib-repo}blob/{branch}/src/plugins/unified_histogram/README.md[unifiedHistogram]
|Unified Histogram is a UX Building Block including a layout with a resizable histogram and a main display.
It manages its own state and data fetching, and can easily be dropped into pages with minimal setup.
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,8 @@
"@kbn/ui-shared-deps-npm": "link:packages/kbn-ui-shared-deps-npm",
"@kbn/ui-shared-deps-src": "link:packages/kbn-ui-shared-deps-src",
"@kbn/ui-theme": "link:packages/kbn-ui-theme",
"@kbn/unified-doc-viewer": "link:packages/kbn-unified-doc-viewer",
"@kbn/unified-doc-viewer-plugin": "link:src/plugins/unified_doc_viewer",
"@kbn/unified-field-list": "link:packages/kbn-unified-field-list",
"@kbn/unified-field-list-examples-plugin": "link:examples/unified_field_list_examples",
"@kbn/unified-histogram-plugin": "link:src/plugins/unified_histogram",
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-discover-utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
export * from './constants';
export * from './hooks';
export * from './utils';
export * from './constants';
lukasolson marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ pageLoadAssetSize:
triggersActionsUi: 135613
uiActions: 35121
uiActionsEnhanced: 38494
unifiedDocViewer: 66289
lukasolson marked this conversation as resolved.
Show resolved Hide resolved
unifiedHistogram: 19928
unifiedSearch: 71059
upgradeAssistant: 81241
Expand Down
15 changes: 15 additions & 0 deletions packages/kbn-unified-doc-viewer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# @kbn/unified-doc-viewer

This package contains components and services for the unified doc viewer component.

Discover (Classic view → Expanded document)

![image](https://github.com/elastic/kibana/assets/1178348/a0a360bf-2697-4427-a32e-c728f06f5a7e)

Discover (Document explorer → Toggle dialog with details)

![image](https://github.com/elastic/kibana/assets/1178348/c9c11587-c53f-4bcd-8d48-aaceb64981ea)

Discover (View single document)

![image](https://github.com/elastic/kibana/assets/1178348/4a8ea694-d4f5-4c9c-9259-1212f0d50a18)
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,4 @@
* Side Public License, v 1.
*/

export enum ElasticRequestState {
Loading,
NotFound,
Found,
Error,
NotFoundDataView,
}
export { DeferredSpinner, DocViewer, DocViewsRegistry, ElasticRequestState } from './src';
13 changes: 13 additions & 0 deletions packages/kbn-unified-doc-viewer/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

module.exports = {
preset: '@kbn/test',
rootDir: '../..',
roots: ['<rootDir>/packages/kbn-unified-doc-viewer'],
};
5 changes: 5 additions & 0 deletions packages/kbn-unified-doc-viewer/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/unified-doc-viewer",
"owner": "@elastic/kibana-data-discovery"
}
6 changes: 6 additions & 0 deletions packages/kbn-unified-doc-viewer/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "@kbn/unified-doc-viewer",
"private": true,
"version": "1.0.0",
"license": "SSPL-1.0 OR Elastic License 2.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
* Side Public License, v 1.
*/

export { DeferredSpinner } from './common/deferred_spinner';
export * from './deferred_spinner';

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import React from 'react';
import { mount, shallow } from 'enzyme';
import { DocViewer } from './doc_viewer';
import { findTestSubject } from '@elastic/eui/lib/test';
import type { DocViewRenderProps } from '../../types';
import { buildDataTableRecord } from '@kbn/discover-utils';
import { DocViewsRegistry } from '../..';

describe('<DocViewer />', () => {
test('Render <DocViewer/> with 3 different tabs', () => {
const registry = new DocViewsRegistry();
registry.addDocView({ order: 10, title: 'Render function', render: jest.fn() });
registry.addDocView({ order: 20, title: 'React component', component: () => <div>test</div> });
// @ts-expect-error This should be invalid and will throw an error when rendering
registry.addDocView({ order: 30, title: 'Invalid doc view' });

const renderProps = { hit: {} } as DocViewRenderProps;

const wrapper = shallow(<DocViewer docViewsRegistry={registry} {...renderProps} />);

expect(wrapper).toMatchSnapshot();
});

test('Render <DocViewer/> with 1 tab displaying error message', () => {
function SomeComponent() {
// this is just a placeholder
return null;
}

const registry = new DocViewsRegistry();
registry.addDocView({
order: 10,
title: 'React component',
component: SomeComponent,
});

const renderProps = {
hit: buildDataTableRecord({ _index: 't', _id: '1' }),
} as DocViewRenderProps;
const errorMsg = 'Catch me if you can!';

const wrapper = mount(<DocViewer docViewsRegistry={registry} {...renderProps} />);
const error = new Error(errorMsg);
wrapper.find(SomeComponent).simulateError(error);
const errorMsgComponent = findTestSubject(wrapper, 'docViewerError');
expect(errorMsgComponent.text()).toMatch(new RegExp(`${errorMsg}`));
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@

import React from 'react';
import { EuiTabbedContent } from '@elastic/eui';
import { getDocViewsRegistry } from '../../../../kibana_services';
import type { DocViewsRegistry } from '../../..';
import { DocViewerTab } from './doc_viewer_tab';
import { DocView, DocViewRenderProps } from '../../doc_views_types';
import type { DocView, DocViewRenderProps } from '../../types';

export interface DocViewerProps extends DocViewRenderProps {
docViewsRegistry: DocViewsRegistry;
}

/**
* Rendering tabs with different views of 1 Elasticsearch hit in Discover.
* The tabs are provided by the `docs_views` registry.
* A view can contain a React `component`, or any JS framework by using
* a `render` function.
*/
export function DocViewer(renderProps: DocViewRenderProps) {
const docViewsRegistry = getDocViewsRegistry();
export function DocViewer({ docViewsRegistry, ...renderProps }: DocViewerProps) {
const tabs = docViewsRegistry
.getDocViewsSorted(renderProps.hit)
.map(({ title, render, component }: DocView, idx: number) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import React from 'react';
import { mount } from 'enzyme';
import { DocViewerError } from './doc_viewer_error';

test('DocViewerError should wrap error in boundary', () => {
const props = {
error: new Error('my error'),
};

expect(() => {
const wrapper = mount(<DocViewerError {...props} />);
const html = wrapper.html();
expect(html).toContain('euiErrorBoundary');
expect(html).toContain('my error');
}).not.toThrowError();
});
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import React from 'react';
import { mount } from 'enzyme';
import { DocViewRenderTab } from './doc_viewer_render_tab';
import { DocViewRenderProps } from '../../doc_views_types';
import type { DocViewRenderProps } from '../../types';

test('Mounting and unmounting DocViewerRenderTab', () => {
const unmountFn = jest.fn();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import React, { useRef, useEffect } from 'react';
import { DocViewRenderFn, DocViewRenderProps } from '../../doc_views_types';
import type { DocViewRenderFn, DocViewRenderProps } from '../../types';

interface Props {
render: DocViewRenderFn;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import React from 'react';
import { isEqual } from 'lodash';
import { DocViewRenderTab } from './doc_viewer_render_tab';
import { DocViewerError } from './doc_viewer_render_error';
import { DocViewRenderFn, DocViewRenderProps } from '../../doc_views_types';
import { DocViewerError } from './doc_viewer_error';
import type { DocViewRenderFn, DocViewRenderProps } from '../../types';

interface Props {
id: number;
Expand Down
10 changes: 10 additions & 0 deletions packages/kbn-unified-doc-viewer/src/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

export * from './deferred_spinner';
export * from './doc_viewer';
10 changes: 10 additions & 0 deletions packages/kbn-unified-doc-viewer/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

export * from './components';
export * from './services';
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@
*/

import type { DataTableRecord } from '@kbn/discover-utils/types';
import { DocView, DocViewInput, DocViewInputFn } from './doc_views_types';
import { DocView, DocViewInput, DocViewInputFn } from './types';

export enum ElasticRequestState {
Loading,
NotFound,
Found,
Error,
NotFoundDataView,
}

export class DocViewsRegistry {
private docViews: DocView[] = [];
Expand All @@ -17,10 +25,10 @@ export class DocViewsRegistry {
*/
addDocView(docViewRaw: DocViewInput | DocViewInputFn) {
const docView = typeof docViewRaw === 'function' ? docViewRaw() : docViewRaw;
if (typeof docView.shouldShow !== 'function') {
docView.shouldShow = () => true;
}
this.docViews.push(docView as DocView);
this.docViews.push({
...docView,
shouldShow: docView.shouldShow ?? (() => true),
});
}
/**
* Returns a sorted array of doc_views for rendering tabs
Expand Down
9 changes: 9 additions & 0 deletions packages/kbn-unified-doc-viewer/src/services/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

export { DocViewsRegistry, ElasticRequestState } from './doc_views_registry';
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { DataView, DataViewField } from '@kbn/data-views-plugin/public';
import type { DataView, DataViewField } from '@kbn/data-views-plugin/public';
import type { AggregateQuery, Query } from '@kbn/es-query';
import type { DataTableRecord, IgnoredReason } from '@kbn/discover-utils/types';

Expand Down
15 changes: 15 additions & 0 deletions packages/kbn-unified-doc-viewer/src/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

export type {
DocView,
DocViewFilterFn,
DocViewRenderFn,
DocViewRenderProps,
FieldRecordLegacy,
} from './services/types';
23 changes: 23 additions & 0 deletions packages/kbn-unified-doc-viewer/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
"jest",
"node",
"react"
]
},
"include": [
"**/*.ts",
"**/*.tsx",
],
"exclude": [
"target/**/*"
],
"kbn_references": [
"@kbn/discover-utils",
"@kbn/data-views-plugin",
"@kbn/es-query",
]
}
10 changes: 10 additions & 0 deletions packages/kbn-unified-doc-viewer/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

export type { ElasticRequestState } from '.';
export type { DocViewFilterFn, DocViewRenderProps, FieldRecordLegacy } from './src/types';
1 change: 1 addition & 0 deletions src/plugins/discover/kibana.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"dataViewFieldEditor",
"dataViewEditor",
"expressions",
"unifiedDocViewer",
"unifiedSearch",
"unifiedHistogram"
],
Expand Down
Loading