@univerjs-pro/docs-chart-ui 1.0.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/README.md +46 -0
  2. package/lib/cjs/index.js +1 -0
  3. package/lib/cjs/locale/ca-ES.js +1 -0
  4. package/lib/cjs/locale/en-US.js +1 -0
  5. package/lib/cjs/locale/es-ES.js +1 -0
  6. package/lib/cjs/locale/fa-IR.js +1 -0
  7. package/lib/cjs/locale/fr-FR.js +1 -0
  8. package/lib/cjs/locale/ja-JP.js +1 -0
  9. package/lib/cjs/locale/ko-KR.js +1 -0
  10. package/lib/cjs/locale/ru-RU.js +1 -0
  11. package/lib/cjs/locale/sk-SK.js +1 -0
  12. package/lib/cjs/locale/vi-VN.js +1 -0
  13. package/lib/cjs/locale/zh-CN.js +1 -0
  14. package/lib/cjs/locale/zh-TW.js +1 -0
  15. package/lib/es/index.js +1 -0
  16. package/lib/es/locale/ca-ES.js +1 -0
  17. package/lib/es/locale/en-US.js +1 -0
  18. package/lib/es/locale/es-ES.js +1 -0
  19. package/lib/es/locale/fa-IR.js +1 -0
  20. package/lib/es/locale/fr-FR.js +1 -0
  21. package/lib/es/locale/ja-JP.js +1 -0
  22. package/lib/es/locale/ko-KR.js +1 -0
  23. package/lib/es/locale/ru-RU.js +1 -0
  24. package/lib/es/locale/sk-SK.js +1 -0
  25. package/lib/es/locale/vi-VN.js +1 -0
  26. package/lib/es/locale/zh-CN.js +1 -0
  27. package/lib/es/locale/zh-TW.js +1 -0
  28. package/lib/index.css +261 -0
  29. package/lib/index.js +1 -0
  30. package/lib/locale/ca-ES.js +1 -0
  31. package/lib/locale/en-US.js +1 -0
  32. package/lib/locale/es-ES.js +1 -0
  33. package/lib/locale/fa-IR.js +1 -0
  34. package/lib/locale/fr-FR.js +1 -0
  35. package/lib/locale/ja-JP.js +1 -0
  36. package/lib/locale/ko-KR.js +1 -0
  37. package/lib/locale/ru-RU.js +1 -0
  38. package/lib/locale/sk-SK.js +1 -0
  39. package/lib/locale/vi-VN.js +1 -0
  40. package/lib/locale/zh-CN.js +1 -0
  41. package/lib/locale/zh-TW.js +1 -0
  42. package/lib/types/commands/operations/chart-dialog.operation.d.ts +15 -0
  43. package/lib/types/components/DocChartDataEditor.d.ts +15 -0
  44. package/lib/types/components/DocChartEditPanel.d.ts +20 -0
  45. package/lib/types/components/DocChartEditorDialog.d.ts +9 -0
  46. package/lib/types/components/DocChartInlineTableEditor.d.ts +11 -0
  47. package/lib/types/components/DocChartInsertPanel.d.ts +11 -0
  48. package/lib/types/components/DocChartPreview.d.ts +10 -0
  49. package/lib/types/config/config.d.ts +5 -0
  50. package/lib/types/controllers/components.controller.d.ts +9 -0
  51. package/lib/types/controllers/doc-chart-clipboard.controller.d.ts +20 -0
  52. package/lib/types/controllers/doc-chart-drawing-edit.controller.d.ts +12 -0
  53. package/lib/types/controllers/doc-chart-snapshot-refresh.controller.d.ts +12 -0
  54. package/lib/types/controllers/doc-chart-static-render.controller.d.ts +21 -0
  55. package/lib/types/controllers/ui.controller.d.ts +20 -0
  56. package/lib/types/index.d.ts +35 -0
  57. package/lib/types/locale/ca-ES.d.ts +3 -0
  58. package/lib/types/locale/en-US.d.ts +72 -0
  59. package/lib/types/locale/es-ES.d.ts +3 -0
  60. package/lib/types/locale/fa-IR.d.ts +3 -0
  61. package/lib/types/locale/fr-FR.d.ts +3 -0
  62. package/lib/types/locale/ja-JP.d.ts +3 -0
  63. package/lib/types/locale/ko-KR.d.ts +3 -0
  64. package/lib/types/locale/ru-RU.d.ts +3 -0
  65. package/lib/types/locale/sk-SK.d.ts +3 -0
  66. package/lib/types/locale/types.d.ts +3 -0
  67. package/lib/types/locale/vi-VN.d.ts +3 -0
  68. package/lib/types/locale/zh-CN.d.ts +3 -0
  69. package/lib/types/locale/zh-TW.d.ts +3 -0
  70. package/lib/types/menu/chart.menu.d.ts +12 -0
  71. package/lib/types/menu/schema.d.ts +2 -0
  72. package/lib/types/plugin.d.ts +16 -0
  73. package/lib/types/services/doc-chart-active-render.service.d.ts +41 -0
  74. package/lib/types/services/doc-chart-data-edit.service.d.ts +24 -0
  75. package/lib/types/services/doc-chart-host.d.ts +43 -0
  76. package/lib/types/services/doc-chart-insert-position.d.ts +18 -0
  77. package/lib/types/services/doc-chart-insert.service.d.ts +28 -0
  78. package/lib/types/services/doc-chart-print.service.d.ts +16 -0
  79. package/lib/types/services/doc-chart-render.service.d.ts +33 -0
  80. package/lib/types/services/doc-chart-snapshot-render.service.d.ts +57 -0
  81. package/lib/types/utils/ChartPanelOptions.d.ts +9 -0
  82. package/lib/types/views/active-chart/index.d.ts +11 -0
  83. package/lib/types/views/print-chart/index.d.ts +9 -0
  84. package/lib/umd/index.js +1 -0
  85. package/lib/umd/locale/ca-ES.js +1 -0
  86. package/lib/umd/locale/en-US.js +1 -0
  87. package/lib/umd/locale/es-ES.js +1 -0
  88. package/lib/umd/locale/fa-IR.js +1 -0
  89. package/lib/umd/locale/fr-FR.js +1 -0
  90. package/lib/umd/locale/ja-JP.js +1 -0
  91. package/lib/umd/locale/ko-KR.js +1 -0
  92. package/lib/umd/locale/ru-RU.js +1 -0
  93. package/lib/umd/locale/sk-SK.js +1 -0
  94. package/lib/umd/locale/vi-VN.js +1 -0
  95. package/lib/umd/locale/zh-CN.js +1 -0
  96. package/lib/umd/locale/zh-TW.js +1 -0
  97. package/package.json +94 -0
@@ -0,0 +1,15 @@
1
+ import type { ChartTypeBits } from '@univerjs-pro/engine-chart';
2
+ import type { IOperation, ITextRangeParam } from '@univerjs/core';
3
+ export interface IOpenDocChartInsertDialogOperationParams {
4
+ value?: ChartTypeBits;
5
+ defaultChartType?: ChartTypeBits;
6
+ defaultTableText?: string;
7
+ insertRange?: ITextRangeParam;
8
+ }
9
+ export interface IOpenDocChartEditorDialogOperationParams {
10
+ unitId: string;
11
+ chartId: string;
12
+ drawingId?: string;
13
+ }
14
+ export declare const OpenDocChartInsertDialogOperation: IOperation<IOpenDocChartInsertDialogOperationParams>;
15
+ export declare const OpenDocChartEditorDialogOperation: IOperation<IOpenDocChartEditorDialogOperationParams>;
@@ -0,0 +1,15 @@
1
+ import type { DocChartCellValue } from '@univerjs-pro/docs-chart';
2
+ export declare const DOC_CHART_DATA_EDITOR_COMPONENT = "doc-chart.data-editor";
3
+ export declare const DOC_CHART_DATA_EDITOR_DIALOG_ID = "doc-chart.dialog.data-editor";
4
+ export declare enum DocChartDataEditorSubmitMode {
5
+ SHARED = "shared",
6
+ DUPLICATE = "duplicate"
7
+ }
8
+ export interface IDocChartDataEditorProps {
9
+ values: DocChartCellValue[][];
10
+ sharingCount?: number;
11
+ onCancel?: () => void;
12
+ onChange?: (values: DocChartCellValue[][]) => void;
13
+ onSubmit: (values: DocChartCellValue[][], mode: DocChartDataEditorSubmitMode) => void;
14
+ }
15
+ export declare function DocChartDataEditor(props: IDocChartDataEditorProps): import("react").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import type { DocChartCellValue, IDocChartContext } from '@univerjs-pro/docs-chart';
2
+ import type { ChartStyle, IChartDataAggregation } from '@univerjs-pro/engine-chart';
3
+ import { ChartTypeBits } from '@univerjs-pro/engine-chart';
4
+ export interface IDocChartEditPanelProps {
5
+ chartType: ChartTypeBits;
6
+ values: DocChartCellValue[][];
7
+ context?: IDocChartContext;
8
+ dataAggregation?: IChartDataAggregation;
9
+ style?: ChartStyle;
10
+ onChartTypeChange: (chartType: ChartTypeBits) => void;
11
+ onContextChange: (context: Partial<IDocChartContext>) => void;
12
+ onDataAggregationChange: (dataAggregation: Partial<IChartDataAggregation>) => void;
13
+ onStyleChange: (style: ChartStyle) => void;
14
+ onValuesChange: (values: DocChartCellValue[][]) => void;
15
+ onClose?: () => void;
16
+ }
17
+ type DocChartCustomizePanelItemId = 'chartStyle' | 'chartAndAxisTitles' | 'series' | 'lineAndArea' | 'wordCloud' | 'radar' | 'waterfall' | 'pie' | 'funnel' | 'heatmap' | 'relation' | 'legend' | 'horizontalAxis' | 'verticalAxis' | 'gridlinesAndTicks' | 'indicatorLine';
18
+ export declare function getDocChartCustomizePanelItemIds(chartType: ChartTypeBits | undefined): DocChartCustomizePanelItemId[];
19
+ export declare function DocChartEditPanel(props: IDocChartEditPanelProps): import("react").JSX.Element;
20
+ export {};
@@ -0,0 +1,9 @@
1
+ export declare const DOC_CHART_EDITOR_DIALOG_COMPONENT = "doc-chart.editor-dialog";
2
+ export declare const DOC_CHART_EDITOR_DIALOG_ID = "doc-chart.dialog.editor";
3
+ export interface IDocChartEditorDialogProps {
4
+ unitId: string;
5
+ chartId: string;
6
+ drawingId?: string;
7
+ onClose?: () => void;
8
+ }
9
+ export declare function DocChartEditorDialog(props: IDocChartEditorDialogProps): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import type { DocChartCellValue } from '@univerjs-pro/docs-chart';
2
+ import { appendInlineTableColumn, appendInlineTableRow, compactInlineTableValues, normalizeInlineTableValues } from '@univerjs-pro/chart-ui';
3
+ export interface IDocChartInlineTableEditorProps {
4
+ values: DocChartCellValue[][];
5
+ onChange: (values: DocChartCellValue[][]) => void;
6
+ minRows?: number;
7
+ minColumns?: number;
8
+ }
9
+ export { appendInlineTableColumn, appendInlineTableRow, compactInlineTableValues, normalizeInlineTableValues, };
10
+ export declare function applyInlineTablePaste(_values: DocChartCellValue[][], pastedText: string, minRows?: number, minColumns?: number): DocChartCellValue[][] | null;
11
+ export declare function DocChartInlineTableEditor(props: IDocChartInlineTableEditorProps): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import type { IDocChartInsertOptions, IDocChartInsertResult } from '../services/doc-chart-insert.service';
2
+ import { ChartTypeBits } from '@univerjs-pro/engine-chart';
3
+ export declare const DOC_CHART_INSERT_PANEL_COMPONENT = "doc-chart.insert-panel";
4
+ export interface IDocChartInsertPanelProps {
5
+ defaultChartType?: ChartTypeBits;
6
+ defaultTableText?: string;
7
+ insertOptions?: IDocChartInsertOptions;
8
+ onCancel?: () => void;
9
+ onInserted?: (result: IDocChartInsertResult) => void;
10
+ }
11
+ export declare function DocChartInsertPanel(props: IDocChartInsertPanelProps): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import type { DocChartCellValue, IDocChartContext } from '@univerjs-pro/docs-chart';
2
+ import type { ChartStyle, ChartTypeBits, IChartDataAggregation } from '@univerjs-pro/engine-chart';
3
+ export interface IDocChartPreviewProps {
4
+ values: DocChartCellValue[][];
5
+ chartType: ChartTypeBits;
6
+ context?: IDocChartContext;
7
+ dataAggregation?: IChartDataAggregation;
8
+ style?: ChartStyle;
9
+ }
10
+ export declare function DocChartPreview(props: IDocChartPreviewProps): import("react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export declare const DOCS_CHART_UI_PLUGIN_CONFIG_KEY = "docs-chart-ui.config";
2
+ export declare const configSymbol: unique symbol;
3
+ export interface IUniverDocsChartUIConfig {
4
+ }
5
+ export declare const defaultPluginConfig: IUniverDocsChartUIConfig;
@@ -0,0 +1,9 @@
1
+ import { Disposable } from '@univerjs/core';
2
+ import { ComponentManager, IconManager } from '@univerjs/ui';
3
+ export declare class ComponentsController extends Disposable {
4
+ private readonly _componentManager;
5
+ private readonly _iconManager;
6
+ constructor(_componentManager: ComponentManager, _iconManager: IconManager);
7
+ private _registerIcons;
8
+ private _registerComponents;
9
+ }
@@ -0,0 +1,20 @@
1
+ import type { IDocChartResource } from '@univerjs-pro/docs-chart';
2
+ import type { IDocumentData } from '@univerjs/core';
3
+ import { DocChartResourceService } from '@univerjs-pro/docs-chart';
4
+ import { Disposable } from '@univerjs/core';
5
+ import { IDocClipboardPasteAdapterService, IDocClipboardService } from '@univerjs/docs-ui';
6
+ export declare const DOC_CHART_CLIPBOARD_RESOURCE_KEY = "__docsChartResource";
7
+ export interface IDocChartClipboardDocData extends Partial<IDocumentData> {
8
+ [DOC_CHART_CLIPBOARD_RESOURCE_KEY]?: IDocChartResource;
9
+ }
10
+ export declare class DocChartClipboardController extends Disposable {
11
+ private readonly _docClipboardService;
12
+ private readonly _pasteAdapterService;
13
+ private readonly _resourceService;
14
+ constructor(_docClipboardService: IDocClipboardService, _pasteAdapterService: IDocClipboardPasteAdapterService, _resourceService: DocChartResourceService);
15
+ private _initClipboardHooks;
16
+ private _appendChartResources;
17
+ private _getPasteMutationInfos;
18
+ private _getOrCreatePastedDataSourceId;
19
+ private _isDocChartDrawing;
20
+ }
@@ -0,0 +1,12 @@
1
+ import { DocChartResourceService } from '@univerjs-pro/docs-chart';
2
+ import { Disposable, LocaleService } from '@univerjs/core';
3
+ import { IDocDrawingAdapterService } from '@univerjs/docs-drawing';
4
+ import { DocDrawingFloatingToolbarAdapterService } from '@univerjs/docs-drawing-ui';
5
+ export declare class DocChartDrawingEditController extends Disposable {
6
+ private readonly _drawingAdapterService;
7
+ private readonly _floatingToolbarAdapterService;
8
+ private readonly _resourceService;
9
+ private readonly _localeService;
10
+ constructor(_drawingAdapterService: IDocDrawingAdapterService, _floatingToolbarAdapterService: DocDrawingFloatingToolbarAdapterService, _resourceService: DocChartResourceService, _localeService: LocaleService);
11
+ private _initAdapter;
12
+ }
@@ -0,0 +1,12 @@
1
+ import { DocChartModelService, DocChartResourceService } from '@univerjs-pro/docs-chart';
2
+ import { Disposable, ICommandService } from '@univerjs/core';
3
+ import { DocChartSnapshotRenderService } from '../services/doc-chart-snapshot-render.service';
4
+ export declare class DocChartSnapshotRefreshController extends Disposable {
5
+ private readonly _commandService;
6
+ private readonly _snapshotService;
7
+ private readonly _resourceService;
8
+ private readonly _modelService?;
9
+ constructor(_commandService: ICommandService, _snapshotService: DocChartSnapshotRenderService, _resourceService: DocChartResourceService, _modelService?: DocChartModelService | undefined);
10
+ private _listenChartResourceMutations;
11
+ private _shouldWaitForChartConfig;
12
+ }
@@ -0,0 +1,21 @@
1
+ import { Disposable } from '@univerjs/core';
2
+ import { IDrawingManagerService } from '@univerjs/drawing';
3
+ import { IRenderManagerService } from '@univerjs/engine-render';
4
+ import { DocChartSnapshotRenderService } from '../services/doc-chart-snapshot-render.service';
5
+ export declare class DocChartStaticRenderController extends Disposable {
6
+ private readonly _drawingManagerService;
7
+ private readonly _renderManagerService;
8
+ private readonly _snapshotRenderService;
9
+ constructor(_drawingManagerService: IDrawingManagerService, _renderManagerService: IRenderManagerService, _snapshotRenderService: DocChartSnapshotRenderService);
10
+ private _init;
11
+ private _requestSnapshotsForSearches;
12
+ private _requestSnapshotsForUnit;
13
+ private _requestSnapshot;
14
+ private _renderCharts;
15
+ private _renderDrawing;
16
+ private _createImageShape;
17
+ private _removeRenderedCharts;
18
+ private _getChartDrawing;
19
+ private _forEachChartDrawing;
20
+ private _getDrawingRect;
21
+ }
@@ -0,0 +1,20 @@
1
+ import type { IOpenDocChartEditorDialogOperationParams, IOpenDocChartInsertDialogOperationParams } from '../commands/operations/chart-dialog.operation';
2
+ import { Disposable, ICommandService, IUniverInstanceService, LocaleService } from '@univerjs/core';
3
+ import { DocContentInsertService, DocSelectionManagerService } from '@univerjs/docs';
4
+ import { IDialogService, IMenuManagerService } from '@univerjs/ui';
5
+ export declare const DOC_CHART_INSERT_DIALOG_ID = "doc-chart.dialog.insert";
6
+ export declare class DocChartUIController extends Disposable {
7
+ private readonly _dialogService;
8
+ private readonly _localeService;
9
+ private readonly _instanceService;
10
+ private readonly _docSelectionManagerService;
11
+ private readonly _docContentInsertService;
12
+ private readonly _menuManagerService;
13
+ private readonly _commandService;
14
+ constructor(_dialogService: IDialogService, _localeService: LocaleService, _instanceService: IUniverInstanceService, _docSelectionManagerService: DocSelectionManagerService, _docContentInsertService: DocContentInsertService, _menuManagerService: IMenuManagerService, _commandService: ICommandService);
15
+ openInsertDialog(params?: IOpenDocChartInsertDialogOperationParams): boolean;
16
+ openEditorDialog(params: IOpenDocChartEditorDialogOperationParams): boolean;
17
+ private _initMenus;
18
+ private _registerDialogOperations;
19
+ private _captureInsertRange;
20
+ }
@@ -0,0 +1,35 @@
1
+ import './global.css';
2
+ export { OpenDocChartEditorDialogOperation, OpenDocChartInsertDialogOperation, } from './commands/operations/chart-dialog.operation';
3
+ export type { IOpenDocChartEditorDialogOperationParams, IOpenDocChartInsertDialogOperationParams, } from './commands/operations/chart-dialog.operation';
4
+ export { DOC_CHART_DATA_EDITOR_COMPONENT, DOC_CHART_DATA_EDITOR_DIALOG_ID, DocChartDataEditor, DocChartDataEditorSubmitMode, } from './components/DocChartDataEditor';
5
+ export { DOC_CHART_EDITOR_DIALOG_COMPONENT, DOC_CHART_EDITOR_DIALOG_ID, DocChartEditorDialog, } from './components/DocChartEditorDialog';
6
+ export { DocChartEditPanel, } from './components/DocChartEditPanel';
7
+ export type { IDocChartEditPanelProps, } from './components/DocChartEditPanel';
8
+ export { DocChartInlineTableEditor } from './components/DocChartInlineTableEditor';
9
+ export { appendInlineTableColumn, appendInlineTableRow, applyInlineTablePaste, compactInlineTableValues, normalizeInlineTableValues, } from './components/DocChartInlineTableEditor';
10
+ export { DOC_CHART_INSERT_PANEL_COMPONENT, DocChartInsertPanel, } from './components/DocChartInsertPanel';
11
+ export { defaultPluginConfig, DOCS_CHART_UI_PLUGIN_CONFIG_KEY } from './config/config';
12
+ export type { IUniverDocsChartUIConfig } from './config/config';
13
+ export { DOC_CHART_CLIPBOARD_RESOURCE_KEY, DocChartClipboardController, } from './controllers/doc-chart-clipboard.controller';
14
+ export type { IDocChartClipboardDocData } from './controllers/doc-chart-clipboard.controller';
15
+ export { DocChartDrawingEditController } from './controllers/doc-chart-drawing-edit.controller';
16
+ export { DocChartSnapshotRefreshController } from './controllers/doc-chart-snapshot-refresh.controller';
17
+ export { DOC_CHART_INSERT_BELOW_MENU_ID, DOC_CHART_INSERT_MENU_ID, DOC_CHART_INSERT_MENU_OPTIONS, DocChartInsertBelowMenuItemFactory, DocChartInsertMenuItemFactory, DocChartInsertRibbonMenuItemFactory, getDocChartInsertDisabledObservable, } from './menu/chart.menu';
18
+ export { menuSchema as DocsChartUIMenuSchema } from './menu/schema';
19
+ export { UniverDocsChartUIPlugin } from './plugin';
20
+ export { DocChartActiveRenderService } from './services/doc-chart-active-render.service';
21
+ export type { IDocChartDomMountParams } from './services/doc-chart-active-render.service';
22
+ export { DocChartDataEditService } from './services/doc-chart-data-edit.service';
23
+ export type { IDocChartDataEditorState } from './services/doc-chart-data-edit.service';
24
+ export { DocDomChartHost, DocImageChartHost } from './services/doc-chart-host';
25
+ export { DocChartInsertService } from './services/doc-chart-insert.service';
26
+ export type { IDocChartInsertOptions, IDocChartInsertResult } from './services/doc-chart-insert.service';
27
+ export { DocChartPrintService } from './services/doc-chart-print.service';
28
+ export type { IDocChartPrintRect } from './services/doc-chart-print.service';
29
+ export { DocChartRenderService, IDocChartRenderModelService, } from './services/doc-chart-render.service';
30
+ export type { IDocChartRenderInput, IDocChartRenderSpecResult, } from './services/doc-chart-render.service';
31
+ export { DocChartSnapshotRenderService, IDocChartSnapshotRendererService, } from './services/doc-chart-snapshot-render.service';
32
+ export type { IDocChartInvalidation, IDocChartInvalidationOptions, IDocChartSnapshotEntry, IDocChartSnapshotRenderer, IDocChartSnapshotRequest, } from './services/doc-chart-snapshot-render.service';
33
+ export { DOC_ACTIVE_CHART_COMPONENT, DocActiveChart, } from './views/active-chart';
34
+ export type { IDocActiveChartProps } from './views/active-chart';
35
+ export { DocPrintChart } from './views/print-chart';
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,72 @@
1
+ declare const locale: {
2
+ 'docs-chart-ui': {
3
+ insertChart: string;
4
+ editChart: string;
5
+ chartType: string;
6
+ inlineData: string;
7
+ cancel: string;
8
+ insert: string;
9
+ save: string;
10
+ apply: string;
11
+ close: string;
12
+ duplicate: string;
13
+ delete: string;
14
+ chartPreview: string;
15
+ previewRenderFailed: string;
16
+ setupChart: string;
17
+ customizeChart: string;
18
+ data: string;
19
+ editData: string;
20
+ rows: string;
21
+ columns: string;
22
+ sharedData: string;
23
+ backgroundColor: string;
24
+ chartStyle: string;
25
+ chartAndAxisTitles: string;
26
+ fill: string;
27
+ border: string;
28
+ title: string;
29
+ subtitle: string;
30
+ horizontalAxisTitle: string;
31
+ verticalAxisTitle: string;
32
+ series: string;
33
+ showDataLabels: string;
34
+ legend: string;
35
+ horizontalAxis: string;
36
+ verticalAxis: string;
37
+ visible: string;
38
+ showLabels: string;
39
+ reverseAxis: string;
40
+ gridlinesAndTicks: string;
41
+ indicatorLine: string;
42
+ useAbsoluteValue: string;
43
+ tableDataEmpty: string;
44
+ insertChartFailed: string;
45
+ updateChartFailed: string;
46
+ chartNotFound: string;
47
+ chartTypes: {
48
+ line: string;
49
+ area: string;
50
+ areaStacked: string;
51
+ areaPercentStacked: string;
52
+ column: string;
53
+ bar: string;
54
+ barStacked: string;
55
+ barPercentStacked: string;
56
+ pie: string;
57
+ scatter: string;
58
+ radar: string;
59
+ combination: string;
60
+ wordCloud: string;
61
+ funnel: string;
62
+ bubble: string;
63
+ relation: string;
64
+ waterfall: string;
65
+ pareto: string;
66
+ sankey: string;
67
+ heatmap: string;
68
+ boxplot: string;
69
+ };
70
+ };
71
+ };
72
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type { LocaleLeafKeys } from '@univerjs/core';
2
+ import type enUS from './en-US';
3
+ export type LocaleKey = LocaleLeafKeys<typeof enUS>;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,12 @@
1
+ import type { IAccessor } from '@univerjs/core';
2
+ import type { IMenuButtonItem, IMenuSelectorItem, IValueOption } from '@univerjs/ui';
3
+ import type { LocaleKey } from '../locale/types';
4
+ import { ChartTypeBits } from '@univerjs-pro/engine-chart';
5
+ import { Observable } from 'rxjs';
6
+ export declare const DOC_CHART_INSERT_MENU_ID: string;
7
+ export declare const DOC_CHART_INSERT_BELOW_MENU_ID: string;
8
+ export declare const DOC_CHART_INSERT_MENU_OPTIONS: Array<IValueOption<LocaleKey, ChartTypeBits>>;
9
+ export declare function getDocChartInsertDisabledObservable(accessor: IAccessor): Observable<boolean>;
10
+ export declare function DocChartInsertRibbonMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<LocaleKey, ChartTypeBits, ChartTypeBits>;
11
+ export declare function DocChartInsertMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
12
+ export declare function DocChartInsertBelowMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
@@ -0,0 +1,2 @@
1
+ import type { MenuSchemaType } from '@univerjs/ui';
2
+ export declare const menuSchema: MenuSchemaType;
@@ -0,0 +1,16 @@
1
+ import type { IUniverDocsChartUIConfig } from './config/config';
2
+ import { ICommandService, IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
3
+ export declare class UniverDocsChartUIPlugin extends Plugin {
4
+ private readonly _config;
5
+ protected readonly _injector: Injector;
6
+ private readonly _configService;
7
+ private readonly _commandService;
8
+ static type: UniverInstanceType;
9
+ static pluginName: string;
10
+ static packageName: string;
11
+ static version: string;
12
+ constructor(_config: Partial<IUniverDocsChartUIConfig> | undefined, _injector: Injector, _configService: IConfigService, _commandService: ICommandService);
13
+ onStarting(): void;
14
+ onReady(): void;
15
+ private _initCommands;
16
+ }
@@ -0,0 +1,41 @@
1
+ import type { IDisposable } from '@univerjs/core';
2
+ import { DocChartModelService } from '@univerjs-pro/docs-chart';
3
+ import { Disposable, ICommandService, IUniverInstanceService, LocaleService } from '@univerjs/core';
4
+ import { IDrawingManagerService } from '@univerjs/drawing';
5
+ import { IRenderManagerService } from '@univerjs/engine-render';
6
+ import { CanvasFloatDomService } from '@univerjs/ui';
7
+ import { DocChartRenderService } from './doc-chart-render.service';
8
+ import { DocChartSnapshotRenderService } from './doc-chart-snapshot-render.service';
9
+ export interface IDocChartDomMountParams {
10
+ unitId: string;
11
+ drawingId: string;
12
+ chartId: string;
13
+ root: HTMLElement;
14
+ }
15
+ export declare class DocChartActiveRenderService extends Disposable {
16
+ private readonly _drawingManagerService;
17
+ private readonly _renderManagerService;
18
+ private readonly _canvasFloatDomService;
19
+ private readonly _modelService;
20
+ private readonly _renderService;
21
+ private readonly _snapshotRenderService;
22
+ private readonly _commandService;
23
+ private readonly _univerInstanceService;
24
+ private readonly _localeService;
25
+ private _activeLayer;
26
+ private readonly _layoutChanged$;
27
+ constructor(_drawingManagerService: IDrawingManagerService, _renderManagerService: IRenderManagerService, _canvasFloatDomService: CanvasFloatDomService, _modelService: DocChartModelService, _renderService: DocChartRenderService, _snapshotRenderService: DocChartSnapshotRenderService, _commandService: ICommandService, _univerInstanceService: IUniverInstanceService, _localeService: LocaleService);
28
+ mountChart(params: IDocChartDomMountParams): IDisposable;
29
+ dispose(): void;
30
+ private _init;
31
+ private _subscribeRender;
32
+ private _handleFocus;
33
+ private _activate;
34
+ private _deactivate;
35
+ private _updatePosition;
36
+ private _retryActivateFocusedChart;
37
+ private _getPosition;
38
+ private _getRenderRect;
39
+ private _getActiveRenderRect;
40
+ private _isDocChartDrawing;
41
+ }
@@ -0,0 +1,24 @@
1
+ import type { DocChartCellValue, IDocChartContext } from '@univerjs-pro/docs-chart';
2
+ import type { ChartStyle, ChartTypeBits, IChartDataAggregation } from '@univerjs-pro/engine-chart';
3
+ import { DocChartResourceService } from '@univerjs-pro/docs-chart';
4
+ import { ICommandService } from '@univerjs/core';
5
+ import { DocChartDataEditorSubmitMode } from '../components/DocChartDataEditor';
6
+ export interface IDocChartDataEditorState {
7
+ unitId: string;
8
+ chartId: string;
9
+ dataSourceId: string;
10
+ values: DocChartCellValue[][];
11
+ sharingCount: number;
12
+ }
13
+ export declare class DocChartDataEditService {
14
+ private readonly _commandService;
15
+ private readonly _resourceService;
16
+ constructor(_commandService: ICommandService, _resourceService: DocChartResourceService);
17
+ getEditorState(unitId: string, chartId: string): IDocChartDataEditorState | null;
18
+ updateChartType(unitId: string, chartId: string, chartType: ChartTypeBits): boolean;
19
+ updateChartStyle(unitId: string, chartId: string, style: ChartStyle): boolean;
20
+ updateChartContext(unitId: string, chartId: string, context: Partial<IDocChartContext>): boolean;
21
+ updateDataAggregation(unitId: string, chartId: string, dataAggregation: Partial<IChartDataAggregation>): boolean;
22
+ updateDataFromText(unitId: string, chartId: string, text: string, mode: DocChartDataEditorSubmitMode): boolean;
23
+ updateData(unitId: string, chartId: string, values: DocChartCellValue[][], mode: DocChartDataEditorSubmitMode): boolean;
24
+ }
@@ -0,0 +1,43 @@
1
+ import type { ChartImageSource, IChartHostRect, IChartHostStyle, IDomChartHost } from '@univerjs-pro/engine-chart';
2
+ import { ChartHostRenderMode, ImageChartHost } from '@univerjs-pro/engine-chart';
3
+ import { Disposable } from '@univerjs/core';
4
+ export declare class DocImageChartHost extends ImageChartHost {
5
+ private readonly _rect;
6
+ private _dataUrl;
7
+ constructor(chartId: string, _rect: IChartHostRect);
8
+ getRect(): IChartHostRect;
9
+ setStyle(_style: IChartHostStyle): void;
10
+ nextVersion(): number;
11
+ commitSnapshot(image: ChartImageSource, _version: number): boolean;
12
+ requestPaint(): void;
13
+ invalidateSnapshot(): void;
14
+ getDataUrl(): string | undefined;
15
+ }
16
+ export declare class DocDomChartHost extends Disposable implements IDomChartHost {
17
+ readonly chartId: string;
18
+ private readonly _host;
19
+ private readonly _applyHostStyle;
20
+ private readonly _getRenderRect?;
21
+ /**
22
+ * Preview hosts are absolutely stretched by their parent, while active drawing hosts need an explicit size.
23
+ */
24
+ private readonly _manageHostSize;
25
+ readonly mode = ChartHostRenderMode.Dom;
26
+ private _mountNode;
27
+ private _hostStyle;
28
+ constructor(chartId: string, _host: HTMLElement, _applyHostStyle: (host: HTMLElement, style: IChartHostStyle) => void, _getRenderRect?: (() => IChartHostRect | null) | undefined,
29
+ /**
30
+ * Preview hosts are absolutely stretched by their parent, while active drawing hosts need an explicit size.
31
+ */
32
+ _manageHostSize?: boolean);
33
+ getRect(): IChartHostRect;
34
+ setStyle(style: IChartHostStyle): void;
35
+ ensureMount(): Promise<HTMLElement>;
36
+ checkMounted(): boolean;
37
+ syncLayout(): void;
38
+ markReady(): void;
39
+ markNotReady(): void;
40
+ dispose(): void;
41
+ private _setElementSize;
42
+ private _getContentRect;
43
+ }
@@ -0,0 +1,18 @@
1
+ import type { DocumentDataModel, IDocumentBody, ITextRangeParam } from '@univerjs/core';
2
+ export interface IDocChartInsertPosition {
3
+ unitId: string;
4
+ index: number;
5
+ segmentId: string;
6
+ breakOffsets: number[];
7
+ }
8
+ export interface IDocChartStandaloneSplit {
9
+ index: number;
10
+ breakOffsets: number[];
11
+ }
12
+ type BodyRangeFields = Pick<IDocumentBody, 'blockRanges' | 'customBlocks' | 'dataStream' | 'tables'>;
13
+ export declare function resolveDocChartInsertPosition(document: DocumentDataModel, range: ITextRangeParam | null | undefined): IDocChartInsertPosition | null;
14
+ export declare function normalizeDocChartInsertOffset(body: Pick<IDocumentBody, 'dataStream'>, startOffset: number): number;
15
+ export declare function canInsertDocChartAtOffset(body: Pick<BodyRangeFields, 'blockRanges' | 'customBlocks' | 'tables'>, offset: number): boolean;
16
+ export declare function isDocChartStandaloneInsertOffset(body: Pick<IDocumentBody, 'dataStream'>, offset: number): boolean;
17
+ export declare function getDocChartStandaloneSplit(body: Pick<IDocumentBody, 'dataStream'>, offset: number): IDocChartStandaloneSplit | null;
18
+ export {};
@@ -0,0 +1,28 @@
1
+ import type { DocChartCellValue, IDocChartContext, IInsertDocChartCommandResult } from '@univerjs-pro/docs-chart';
2
+ import type { ChartStyle, ChartTypeBits, IChartDataAggregation } from '@univerjs-pro/engine-chart';
3
+ import type { ITextRangeParam } from '@univerjs/core';
4
+ import { ICommandService, IUniverInstanceService } from '@univerjs/core';
5
+ import { DocContentInsertService, DocSelectionManagerService } from '@univerjs/docs';
6
+ export interface IDocChartInsertOptions {
7
+ context?: IDocChartContext;
8
+ dataAggregation?: IChartDataAggregation;
9
+ style?: ChartStyle;
10
+ insertRange?: ITextRangeParam;
11
+ width?: number;
12
+ height?: number;
13
+ focus?: boolean;
14
+ }
15
+ export interface IDocChartInsertResult extends IInsertDocChartCommandResult {
16
+ unitId: string;
17
+ }
18
+ export declare class DocChartInsertService {
19
+ private readonly _instanceService;
20
+ private readonly _commandService;
21
+ private readonly _docSelectionManagerService;
22
+ private readonly _docContentInsertService;
23
+ constructor(_instanceService: IUniverInstanceService, _commandService: ICommandService, _docSelectionManagerService: DocSelectionManagerService, _docContentInsertService: DocContentInsertService);
24
+ insertChartFromText(text: string, chartType: ChartTypeBits, options?: IDocChartInsertOptions): IDocChartInsertResult | false;
25
+ insertChart(values: DocChartCellValue[][], chartType: ChartTypeBits, options?: IDocChartInsertOptions): IDocChartInsertResult | false;
26
+ private _resolveInsertPosition;
27
+ private _prepareStandaloneInsertLine;
28
+ }
@@ -0,0 +1,16 @@
1
+ import type { IDisposable } from '@univerjs/core';
2
+ import { Disposable } from '@univerjs/core';
3
+ import { IDrawingManagerService } from '@univerjs/drawing';
4
+ import { DocChartSnapshotRenderService } from './doc-chart-snapshot-render.service';
5
+ export interface IDocChartPrintRect {
6
+ width: number;
7
+ height: number;
8
+ }
9
+ export declare class DocChartPrintService extends Disposable {
10
+ private readonly _drawingManagerService;
11
+ private readonly _snapshotRenderService;
12
+ constructor(_drawingManagerService: IDrawingManagerService, _snapshotRenderService: DocChartSnapshotRenderService);
13
+ printChart(unitId: string, drawingId: string, root: HTMLElement, rect: IDocChartPrintRect): IDisposable;
14
+ private _getDrawing;
15
+ private _renderEntry;
16
+ }
@@ -0,0 +1,33 @@
1
+ import type { IDocChartRuntimeModel } from '@univerjs-pro/docs-chart';
2
+ import type { ChartHostRenderMode, ChartStyle, IChartConfig, IChartHostRect, IChartHostStyle, IChartInstance, IChartRenderInstance, IChartRenderModel } from '@univerjs-pro/engine-chart';
3
+ import { ChartThemeService, IChartRenderModelManagerService } from '@univerjs-pro/engine-chart';
4
+ import { Disposable, LocaleService } from '@univerjs/core';
5
+ export interface IDocChartRenderSpecResult {
6
+ spec: Record<string, unknown>;
7
+ chartConfig: IChartConfig;
8
+ chartStyle: ChartStyle;
9
+ hostStyle: IChartHostStyle;
10
+ }
11
+ export interface IDocChartRenderInput {
12
+ chartConfig: IChartConfig;
13
+ chartStyle: ChartStyle;
14
+ }
15
+ export declare const IDocChartRenderModelService: import("@wendellhu/redi").IdentifierDecorator<IChartRenderModel<Record<string, any>>>;
16
+ export declare class DocChartRenderService extends Disposable {
17
+ private readonly _localeService;
18
+ private readonly _chartThemeService?;
19
+ private readonly _renderModelManager;
20
+ private readonly _ownsRenderModelManager;
21
+ constructor(_localeService: LocaleService, renderModel?: IChartRenderModel, _chartThemeService?: ChartThemeService | undefined, renderModelManager?: IChartRenderModelManagerService);
22
+ registerRenderModel(name: string, renderModel: IChartRenderModel): void;
23
+ setRenderModel(name: string): void;
24
+ getRenderModel(name?: string): IChartRenderModel | undefined;
25
+ createChartInstance(): IChartInstance;
26
+ createChartInstance(mode: ChartHostRenderMode): IChartRenderInstance;
27
+ createRenderInput(runtime: IDocChartRuntimeModel): IDocChartRenderInput;
28
+ createRenderSpec(runtime: IDocChartRuntimeModel, rect: IChartHostRect, chartInstance?: IChartInstance): IDocChartRenderSpecResult;
29
+ getHostStyle(chartStyle: ChartStyle): IDocChartRenderSpecResult['hostStyle'];
30
+ applyHostStyle(host: HTMLElement, hostStyle: IDocChartRenderSpecResult['hostStyle']): void;
31
+ private _createChartRenderInstanceContext;
32
+ dispose(): void;
33
+ }