@univerjs-pro/boards-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 (131) hide show
  1. package/README.md +42 -0
  2. package/lib/cjs/index.js +1 -0
  3. package/lib/cjs/locale/ar-SA.js +1 -0
  4. package/lib/cjs/locale/ca-ES.js +1 -0
  5. package/lib/cjs/locale/de-DE.js +1 -0
  6. package/lib/cjs/locale/en-US.js +1 -0
  7. package/lib/cjs/locale/es-ES.js +1 -0
  8. package/lib/cjs/locale/fa-IR.js +1 -0
  9. package/lib/cjs/locale/fr-FR.js +1 -0
  10. package/lib/cjs/locale/id-ID.js +1 -0
  11. package/lib/cjs/locale/it-IT.js +1 -0
  12. package/lib/cjs/locale/ja-JP.js +1 -0
  13. package/lib/cjs/locale/ko-KR.js +1 -0
  14. package/lib/cjs/locale/pl-PL.js +1 -0
  15. package/lib/cjs/locale/pt-BR.js +1 -0
  16. package/lib/cjs/locale/ru-RU.js +1 -0
  17. package/lib/cjs/locale/sk-SK.js +1 -0
  18. package/lib/cjs/locale/vi-VN.js +1 -0
  19. package/lib/cjs/locale/zh-CN.js +1 -0
  20. package/lib/cjs/locale/zh-HK.js +1 -0
  21. package/lib/cjs/locale/zh-TW.js +1 -0
  22. package/lib/es/index.js +1 -0
  23. package/lib/es/locale/ar-SA.js +1 -0
  24. package/lib/es/locale/ca-ES.js +1 -0
  25. package/lib/es/locale/de-DE.js +1 -0
  26. package/lib/es/locale/en-US.js +1 -0
  27. package/lib/es/locale/es-ES.js +1 -0
  28. package/lib/es/locale/fa-IR.js +1 -0
  29. package/lib/es/locale/fr-FR.js +1 -0
  30. package/lib/es/locale/id-ID.js +1 -0
  31. package/lib/es/locale/it-IT.js +1 -0
  32. package/lib/es/locale/ja-JP.js +1 -0
  33. package/lib/es/locale/ko-KR.js +1 -0
  34. package/lib/es/locale/pl-PL.js +1 -0
  35. package/lib/es/locale/pt-BR.js +1 -0
  36. package/lib/es/locale/ru-RU.js +1 -0
  37. package/lib/es/locale/sk-SK.js +1 -0
  38. package/lib/es/locale/vi-VN.js +1 -0
  39. package/lib/es/locale/zh-CN.js +1 -0
  40. package/lib/es/locale/zh-HK.js +1 -0
  41. package/lib/es/locale/zh-TW.js +1 -0
  42. package/lib/index.css +325 -0
  43. package/lib/index.js +1 -0
  44. package/lib/locale/ar-SA.js +1 -0
  45. package/lib/locale/ca-ES.js +1 -0
  46. package/lib/locale/de-DE.js +1 -0
  47. package/lib/locale/en-US.js +1 -0
  48. package/lib/locale/es-ES.js +1 -0
  49. package/lib/locale/fa-IR.js +1 -0
  50. package/lib/locale/fr-FR.js +1 -0
  51. package/lib/locale/id-ID.js +1 -0
  52. package/lib/locale/it-IT.js +1 -0
  53. package/lib/locale/ja-JP.js +1 -0
  54. package/lib/locale/ko-KR.js +1 -0
  55. package/lib/locale/pl-PL.js +1 -0
  56. package/lib/locale/pt-BR.js +1 -0
  57. package/lib/locale/ru-RU.js +1 -0
  58. package/lib/locale/sk-SK.js +1 -0
  59. package/lib/locale/vi-VN.js +1 -0
  60. package/lib/locale/zh-CN.js +1 -0
  61. package/lib/locale/zh-HK.js +1 -0
  62. package/lib/locale/zh-TW.js +1 -0
  63. package/lib/types/common/BoardChartTypeOptions.d.ts +9 -0
  64. package/lib/types/common/board-chart-frame-style.d.ts +40 -0
  65. package/lib/types/components/BoardChartDataEditorDialog.d.ts +13 -0
  66. package/lib/types/components/BoardChartDomRenderer.d.ts +7 -0
  67. package/lib/types/components/BoardChartEditPanel.d.ts +8 -0
  68. package/lib/types/config/config.d.ts +5 -0
  69. package/lib/types/controllers/board-chart-element-float-menu.controller.d.ts +27 -0
  70. package/lib/types/controllers/board-chart-floating-toolbar.render-controller.d.ts +27 -0
  71. package/lib/types/controllers/board-chart-open-edit.controller.d.ts +21 -0
  72. package/lib/types/controllers/board-chart-panel.controller.d.ts +24 -0
  73. package/lib/types/controllers/board-chart-selection.controller.d.ts +21 -0
  74. package/lib/types/controllers/board-chart-snapshot-refresh.controller.d.ts +12 -0
  75. package/lib/types/controllers/boards-chart-ui-components.controller.d.ts +5 -0
  76. package/lib/types/hooks.d.ts +3 -0
  77. package/lib/types/index.d.ts +27 -0
  78. package/lib/types/locale/ar-SA.d.ts +3 -0
  79. package/lib/types/locale/ca-ES.d.ts +3 -0
  80. package/lib/types/locale/de-DE.d.ts +3 -0
  81. package/lib/types/locale/en-US.d.ts +248 -0
  82. package/lib/types/locale/es-ES.d.ts +3 -0
  83. package/lib/types/locale/fa-IR.d.ts +3 -0
  84. package/lib/types/locale/fr-FR.d.ts +3 -0
  85. package/lib/types/locale/id-ID.d.ts +3 -0
  86. package/lib/types/locale/it-IT.d.ts +3 -0
  87. package/lib/types/locale/ja-JP.d.ts +3 -0
  88. package/lib/types/locale/ko-KR.d.ts +3 -0
  89. package/lib/types/locale/pl-PL.d.ts +3 -0
  90. package/lib/types/locale/pt-BR.d.ts +3 -0
  91. package/lib/types/locale/ru-RU.d.ts +3 -0
  92. package/lib/types/locale/sk-SK.d.ts +3 -0
  93. package/lib/types/locale/types.d.ts +3 -0
  94. package/lib/types/locale/vi-VN.d.ts +3 -0
  95. package/lib/types/locale/zh-CN.d.ts +3 -0
  96. package/lib/types/locale/zh-HK.d.ts +3 -0
  97. package/lib/types/locale/zh-TW.d.ts +3 -0
  98. package/lib/types/plugin.d.ts +23 -0
  99. package/lib/types/render-adapters/board-chart-render-adapter.d.ts +23 -0
  100. package/lib/types/render-objects/board-chart-image-rect.d.ts +24 -0
  101. package/lib/types/services/board-chart-clipboard-adapter.d.ts +28 -0
  102. package/lib/types/services/board-chart-data-edit.service.d.ts +24 -0
  103. package/lib/types/services/board-chart-edit-session.service.d.ts +31 -0
  104. package/lib/types/services/board-chart-element-popup-anchor.d.ts +10 -0
  105. package/lib/types/services/board-chart-element-selection.d.ts +7 -0
  106. package/lib/types/services/board-chart-host.d.ts +29 -0
  107. package/lib/types/services/board-chart-render.service.d.ts +55 -0
  108. package/lib/types/services/board-chart-snapshot-render.service.d.ts +57 -0
  109. package/lib/types/services/board-chart-ui.service.d.ts +124 -0
  110. package/lib/types/views/BoardChartFloatingToolbar.d.ts +14 -0
  111. package/lib/umd/index.js +1 -0
  112. package/lib/umd/locale/ar-SA.js +1 -0
  113. package/lib/umd/locale/ca-ES.js +1 -0
  114. package/lib/umd/locale/de-DE.js +1 -0
  115. package/lib/umd/locale/en-US.js +1 -0
  116. package/lib/umd/locale/es-ES.js +1 -0
  117. package/lib/umd/locale/fa-IR.js +1 -0
  118. package/lib/umd/locale/fr-FR.js +1 -0
  119. package/lib/umd/locale/id-ID.js +1 -0
  120. package/lib/umd/locale/it-IT.js +1 -0
  121. package/lib/umd/locale/ja-JP.js +1 -0
  122. package/lib/umd/locale/ko-KR.js +1 -0
  123. package/lib/umd/locale/pl-PL.js +1 -0
  124. package/lib/umd/locale/pt-BR.js +1 -0
  125. package/lib/umd/locale/ru-RU.js +1 -0
  126. package/lib/umd/locale/sk-SK.js +1 -0
  127. package/lib/umd/locale/vi-VN.js +1 -0
  128. package/lib/umd/locale/zh-CN.js +1 -0
  129. package/lib/umd/locale/zh-HK.js +1 -0
  130. package/lib/umd/locale/zh-TW.js +1 -0
  131. package/package.json +91 -0
@@ -0,0 +1,248 @@
1
+ declare const locale: {
2
+ 'boards-chart-ui': {
3
+ editChart: string;
4
+ deleteChart: string;
5
+ setupChart: string;
6
+ customizeChart: string;
7
+ data: string;
8
+ chartType: string;
9
+ themes: string;
10
+ gradientFill: string;
11
+ stack: string;
12
+ category: string;
13
+ series: string;
14
+ addSeries: string;
15
+ removeSeries: string;
16
+ switchRowColumn: string;
17
+ waterfall: string;
18
+ useSubtotal: string;
19
+ chartStyle: string;
20
+ chartAndAxisTitles: string;
21
+ legend: string;
22
+ horizontalAxis: string;
23
+ verticalAxis: string;
24
+ rightVerticalAxis: string;
25
+ gridlinesAndTicks: string;
26
+ indicatorLine: string;
27
+ trendline: string;
28
+ paretoBarSeries: string;
29
+ paretoLineSeries: string;
30
+ pie: string;
31
+ wordCloud: string;
32
+ radar: string;
33
+ funnel: string;
34
+ heatmap: string;
35
+ relation: string;
36
+ lineAndArea: string;
37
+ bubbleData: string;
38
+ waterfallStack: string;
39
+ field: {
40
+ label: string;
41
+ xAxis: string;
42
+ yAxis: string;
43
+ size: string;
44
+ position: string;
45
+ labelFormat: string;
46
+ labelRotate: string;
47
+ min: string;
48
+ max: string;
49
+ numberFormat: string;
50
+ gridlineColor: string;
51
+ gridlineWidth: string;
52
+ tickPosition: string;
53
+ tickLength: string;
54
+ tickWidth: string;
55
+ tickColor: string;
56
+ seriesType: string;
57
+ fill: string;
58
+ fillOpacity: string;
59
+ border: string;
60
+ borderWidth: string;
61
+ borderDash: string;
62
+ borderOpacity: string;
63
+ pointShape: string;
64
+ pointSize: string;
65
+ pointColor: string;
66
+ dataPoint: string;
67
+ selectDataPoint: string;
68
+ pointFill: string;
69
+ pointOpacity: string;
70
+ dataNodeShape: string;
71
+ layout: string;
72
+ repulsion: string;
73
+ gravity: string;
74
+ edgeLength: string;
75
+ displayName: string;
76
+ type: string;
77
+ order: string;
78
+ period: string;
79
+ lineColor: string;
80
+ lineOpacity: string;
81
+ lineType: string;
82
+ lineWidth: string;
83
+ formulaColor: string;
84
+ r2Color: string;
85
+ textSize: string;
86
+ titleSize: string;
87
+ title: string;
88
+ titleText: string;
89
+ titlePosition: string;
90
+ titleAlign: string;
91
+ titleFormat: string;
92
+ legendText: string;
93
+ doughnutHole: string;
94
+ valueScale: string;
95
+ fixedDigits: string;
96
+ valueSuffix: string;
97
+ shape: string;
98
+ maskImageId: string;
99
+ gap: string;
100
+ visualMap: string;
101
+ areaLine: string;
102
+ invalidValues: string;
103
+ selectMode: string;
104
+ legendLabelFormat: string;
105
+ axis: string;
106
+ line: string;
107
+ labelBackground: string;
108
+ labelText: string;
109
+ };
110
+ control: {
111
+ dataLabels: string;
112
+ showLabels: string;
113
+ reverseAxis: string;
114
+ showAxisLine: string;
115
+ useDateAxis: string;
116
+ majorGridlines: string;
117
+ majorTicks: string;
118
+ useRightVerticalAxis: string;
119
+ useValueAsSymbolSize: string;
120
+ emphasisOnHover: string;
121
+ rotateLabels: string;
122
+ showFormula: string;
123
+ showR2: string;
124
+ padAngle: string;
125
+ halfPie: string;
126
+ rosePie: string;
127
+ showLabelLine: string;
128
+ repeatWords: string;
129
+ fill: string;
130
+ useAbsoluteValues: string;
131
+ };
132
+ content: {
133
+ trendlineIndex: string;
134
+ trendlineUnavailable: string;
135
+ positive: string;
136
+ negative: string;
137
+ subtotal: string;
138
+ };
139
+ option: {
140
+ default: string;
141
+ none: string;
142
+ stacked: string;
143
+ percentStacked: string;
144
+ top: string;
145
+ right: string;
146
+ bottom: string;
147
+ left: string;
148
+ arrangement: string;
149
+ solid: string;
150
+ dashed: string;
151
+ dotted: string;
152
+ circle: string;
153
+ square: string;
154
+ triangle: string;
155
+ diamond: string;
156
+ rectangle: string;
157
+ roundRectangle: string;
158
+ pin: string;
159
+ arrow: string;
160
+ emptyCircle: string;
161
+ emptySquare: string;
162
+ emptyTriangle: string;
163
+ emptyDiamond: string;
164
+ emptyRectangle: string;
165
+ emptyRoundRectangle: string;
166
+ emptyPin: string;
167
+ emptyArrow: string;
168
+ auto: string;
169
+ inside: string;
170
+ outside: string;
171
+ value: string;
172
+ percentage: string;
173
+ chartTitle: string;
174
+ subtitle: string;
175
+ horizontalAxisTitle: string;
176
+ verticalAxisTitle: string;
177
+ rightVerticalAxisTitle: string;
178
+ start: string;
179
+ center: string;
180
+ end: string;
181
+ single: string;
182
+ multiple: string;
183
+ disabled: string;
184
+ continuous: string;
185
+ piecewise: string;
186
+ line: string;
187
+ smooth: string;
188
+ step: string;
189
+ polygon: string;
190
+ showAsGaps: string;
191
+ showAsZero: string;
192
+ connectDataPoints: string;
193
+ circular: string;
194
+ force: string;
195
+ column: string;
196
+ area: string;
197
+ linear: string;
198
+ exponential: string;
199
+ logarithmic: string;
200
+ power: string;
201
+ movingAverage: string;
202
+ polynomial: string;
203
+ allSeries: string;
204
+ cloud: string;
205
+ rect: string;
206
+ cardioid: string;
207
+ heart: string;
208
+ triangleForward: string;
209
+ pentagon: string;
210
+ star: string;
211
+ };
212
+ dataEditor: {
213
+ unavailable: string;
214
+ tableEmpty: string;
215
+ updateFailed: string;
216
+ cancel: string;
217
+ duplicate: string;
218
+ apply: string;
219
+ };
220
+ chartTypes: {
221
+ line: string;
222
+ column: string;
223
+ columnStacked: string;
224
+ columnPercentStacked: string;
225
+ bar: string;
226
+ barStacked: string;
227
+ barPercentStacked: string;
228
+ pie: string;
229
+ donut: string;
230
+ area: string;
231
+ areaStacked: string;
232
+ areaPercentStacked: string;
233
+ radar: string;
234
+ scatter: string;
235
+ combination: string;
236
+ wordCloud: string;
237
+ funnel: string;
238
+ bubble: string;
239
+ relation: string;
240
+ waterfall: string;
241
+ pareto: string;
242
+ sankey: string;
243
+ heatmap: string;
244
+ boxplot: string;
245
+ };
246
+ };
247
+ };
248
+ 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 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,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,23 @@
1
+ import type { BoardToolbarToolConfig } from '@univerjs-pro/boards-ui';
2
+ import type { IUniverBoardsChartUIConfig } from './config/config';
3
+ import { IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
4
+ import { IRenderManagerService } from '@univerjs/engine-render';
5
+ export declare const BOARDS_CHART_UI_PLUGIN_NAME = "UNIVER_BOARDS_CHART_UI_PLUGIN";
6
+ export declare class UniverBoardsChartUIPlugin extends Plugin {
7
+ private readonly _config;
8
+ protected readonly _injector: Injector;
9
+ private readonly _configService;
10
+ private readonly _renderManagerService;
11
+ static pluginName: string;
12
+ static packageName: string;
13
+ static version: string;
14
+ static type: UniverInstanceType;
15
+ private _adapter;
16
+ constructor(_config: Partial<IUniverBoardsChartUIConfig> | undefined, _injector: Injector, _configService: IConfigService, _renderManagerService: IRenderManagerService);
17
+ onStarting(): void;
18
+ onReady(): void;
19
+ private _appendRenderAdapter;
20
+ private _removeRenderAdapter;
21
+ private _getBoardsUIConfig;
22
+ }
23
+ export declare function enableChartTool(config: BoardToolbarToolConfig | undefined): BoardToolbarToolConfig;
@@ -0,0 +1,23 @@
1
+ import type { IBoardElementRenderAdapter, IBoardElementRenderAdapterContext } from '@univerjs-pro/boards-ui';
2
+ import type { BaseObject } from '@univerjs/engine-render';
3
+ import { BoardChartResourceService } from '@univerjs-pro/boards-chart';
4
+ import { ThemeService } from '@univerjs/core';
5
+ import { BoardChartImageRect } from '../render-objects/board-chart-image-rect';
6
+ import { BoardChartRenderService } from '../services/board-chart-render.service';
7
+ import { BoardChartSnapshotRenderService } from '../services/board-chart-snapshot-render.service';
8
+ export declare class BoardChartRenderAdapter implements IBoardElementRenderAdapter {
9
+ private readonly _themeService;
10
+ private readonly _snapshotService?;
11
+ private readonly _resourceService?;
12
+ private readonly _renderService?;
13
+ readonly name = "chart";
14
+ constructor(_themeService: ThemeService, _snapshotService?: BoardChartSnapshotRenderService | undefined, _resourceService?: BoardChartResourceService | undefined, _renderService?: BoardChartRenderService | undefined);
15
+ createObject(context: IBoardElementRenderAdapterContext): BoardChartImageRect | null;
16
+ syncObject(object: BaseObject, context: IBoardElementRenderAdapterContext & {
17
+ preserveTransform?: boolean;
18
+ }): boolean;
19
+ private _watchSnapshotUpdates;
20
+ private _requestSnapshotForObject;
21
+ private _updateFrameStyle;
22
+ private _resolveFrameStyle;
23
+ }
@@ -0,0 +1,24 @@
1
+ import type { IBoardChartElement } from '@univerjs-pro/boards';
2
+ import type { IImageProps, IViewportInfo, UniverRenderingContext } from '@univerjs/engine-render';
3
+ import type { IBoardChartFrameStyle } from '../common/board-chart-frame-style';
4
+ import { Image } from '@univerjs/engine-render';
5
+ export declare const BOARD_CHART_PLACEHOLDER_URL: string;
6
+ export interface IBoardChartImageRectProps extends IImageProps {
7
+ element: IBoardChartElement;
8
+ frameStyle: IBoardChartFrameStyle;
9
+ }
10
+ export declare class BoardChartImageRect extends Image {
11
+ private _element;
12
+ private _frameStyle;
13
+ constructor(key: string, props: IBoardChartImageRectProps);
14
+ updateElement(element: IBoardChartElement): void;
15
+ updateFrameStyle(frameStyle: IBoardChartFrameStyle): void;
16
+ getElement(): IBoardChartElement;
17
+ getFrameStyle(): IBoardChartFrameStyle;
18
+ changeChartSource(url: string): void;
19
+ protected _draw(ctx: UniverRenderingContext, _bounds?: IViewportInfo, renderWidth?: number, renderHeight?: number): void;
20
+ private _drawChartImage;
21
+ private _drawFrameStroke;
22
+ private _notifyScene;
23
+ private _attachNativeLoadHandlers;
24
+ }
@@ -0,0 +1,28 @@
1
+ import type { IBoardPageElement } from '@univerjs-pro/boards';
2
+ import type { IBoardChartInlineDataSource, IBoardChartSnapshot } from '@univerjs-pro/boards-chart';
3
+ import type { IBoardClipboardPreparedResourcePaste, IBoardClipboardResourceAdapter } from '@univerjs-pro/boards-ui';
4
+ import { BoardChartResourceService } from '@univerjs-pro/boards-chart';
5
+ export declare const BOARD_CHART_CLIPBOARD_RESOURCE_KEY = "board-chart";
6
+ interface IBoardChartClipboardPayload {
7
+ charts: Record<string, IBoardChartSnapshot>;
8
+ dataSources: Record<string, IBoardChartInlineDataSource>;
9
+ chartIdByElementId: Record<string, string>;
10
+ }
11
+ export declare class BoardChartClipboardAdapter implements IBoardClipboardResourceAdapter {
12
+ private readonly _resourceService;
13
+ readonly key = "board-chart";
14
+ constructor(_resourceService: BoardChartResourceService);
15
+ collect(params: {
16
+ unitId: string;
17
+ subUnitId: string;
18
+ elements: IBoardPageElement[];
19
+ }): IBoardChartClipboardPayload | null;
20
+ preparePaste(params: {
21
+ targetUnitId: string;
22
+ targetSubUnitId: string;
23
+ payload: unknown;
24
+ elementIdMap: ReadonlyMap<string, string>;
25
+ elements: IBoardPageElement[];
26
+ }): IBoardClipboardPreparedResourcePaste | null;
27
+ }
28
+ export {};
@@ -0,0 +1,24 @@
1
+ import type { BoardChartCellValue, IBoardChartInlineDataSource } from '@univerjs-pro/boards-chart';
2
+ import { BoardChartModelService, BoardChartResourceService } from '@univerjs-pro/boards-chart';
3
+ import { Disposable, ICommandService } from '@univerjs/core';
4
+ export interface IBoardChartDataEditState {
5
+ chartId: string;
6
+ dataSource: IBoardChartInlineDataSource;
7
+ sharingCount: number;
8
+ unitId: string;
9
+ }
10
+ export interface IBoardChartUpdateDataOptions {
11
+ chartId: string;
12
+ name?: string;
13
+ unitId: string;
14
+ updateShared?: boolean;
15
+ values: BoardChartCellValue[][];
16
+ }
17
+ export declare class BoardChartDataEditService extends Disposable {
18
+ private readonly _resourceService;
19
+ private readonly _modelService;
20
+ private readonly _commandService;
21
+ constructor(_resourceService: BoardChartResourceService, _modelService: BoardChartModelService, _commandService: ICommandService);
22
+ getDataEditState(unitId: string, chartId: string): IBoardChartDataEditState | null;
23
+ updateDataForChart(options: IBoardChartUpdateDataOptions): Promise<boolean>;
24
+ }
@@ -0,0 +1,31 @@
1
+ import { IBoardElementService } from '@univerjs-pro/boards';
2
+ import { IBoardElementStateService } from '@univerjs-pro/boards-ui';
3
+ import { Disposable } from '@univerjs/core';
4
+ export interface IBoardChartEditSession {
5
+ chartId: string;
6
+ elementId: string;
7
+ source: BoardChartEditSessionSource;
8
+ subUnitId: string;
9
+ unitId: string;
10
+ }
11
+ export type BoardChartEditSessionSource = 'doubleClick' | 'programmatic' | 'quickToolbar';
12
+ export type BoardChartEditSessionCloseReason = 'dispose' | 'elementRemoved' | 'manual' | 'pageChange' | 'selectionChange' | 'transformStart';
13
+ export interface IBoardChartEditSessionOpenParams {
14
+ chartId: string;
15
+ elementId: string;
16
+ source: BoardChartEditSessionSource;
17
+ subUnitId: string;
18
+ unitId: string;
19
+ }
20
+ export declare class BoardChartEditSessionService extends Disposable {
21
+ private readonly _elementStateService;
22
+ private readonly _boardElementService;
23
+ private readonly _activeSession$;
24
+ readonly activeSession$: import("rxjs").Observable<IBoardChartEditSession | null>;
25
+ constructor(_elementStateService: IBoardElementStateService, _boardElementService: IBoardElementService);
26
+ dispose(): void;
27
+ getActiveSession(): IBoardChartEditSession | null;
28
+ open(params: IBoardChartEditSessionOpenParams): void;
29
+ close(_reason?: BoardChartEditSessionCloseReason): void;
30
+ private _syncSelectionState;
31
+ }
@@ -0,0 +1,10 @@
1
+ import type { IChartElementEvent } from '@univerjs-pro/engine-chart';
2
+ import type { IDisposable } from '@univerjs/core';
3
+ import type { IBoundRectNoAngle } from '@univerjs/engine-render';
4
+ import type { Observable } from 'rxjs';
5
+ export interface IBoardChartElementPopupAnchorObserver extends IDisposable {
6
+ initialRect: IBoundRectNoAngle;
7
+ anchorRect$: Observable<IBoundRectNoAngle>;
8
+ visible: boolean;
9
+ }
10
+ export declare function createBoardChartElementPopupAnchorObserver(event: IChartElementEvent, onHidden: () => void): IBoardChartElementPopupAnchorObserver;
@@ -0,0 +1,7 @@
1
+ import type { ChartElementConfigTarget } from '@univerjs-pro/chart-ui';
2
+ import type { ChartModel, IChartElementHit } from '@univerjs-pro/engine-chart';
3
+ export interface IBoardChartElementSelection {
4
+ target: ChartElementConfigTarget;
5
+ showFloatMenu: boolean;
6
+ }
7
+ export declare function resolveBoardChartElementSelection(chartModel: ChartModel, hit: IChartElementHit): IBoardChartElementSelection | undefined;
@@ -0,0 +1,29 @@
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 BoardImageChartHost 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 BoardDomChartHost extends Disposable implements IDomChartHost {
17
+ readonly chartId: string;
18
+ private readonly _host;
19
+ private readonly _applyHostStyle;
20
+ readonly mode = ChartHostRenderMode.Dom;
21
+ constructor(chartId: string, _host: HTMLElement, _applyHostStyle: (host: HTMLElement, style: IChartHostStyle) => void);
22
+ getRect(): IChartHostRect;
23
+ setStyle(style: IChartHostStyle): void;
24
+ ensureMount(): Promise<HTMLElement>;
25
+ checkMounted(): boolean;
26
+ syncLayout(): void;
27
+ markReady(): void;
28
+ markNotReady(): void;
29
+ }
@@ -0,0 +1,55 @@
1
+ import type { IBoardChartRuntimeModel } from '@univerjs-pro/boards-chart';
2
+ import type { ChartElementEventHandler, ChartElementEventType, ChartHostRenderMode, ChartStyle, IChartConfig, IChartHostRect, IChartInstance, IChartRenderInstance, IChartRenderModel } from '@univerjs-pro/engine-chart';
3
+ import type { IDisposable } from '@univerjs/core';
4
+ import { ChartThemeService, IChartRenderModelManagerService } from '@univerjs-pro/engine-chart';
5
+ import { Disposable, LocaleService } from '@univerjs/core';
6
+ export interface IBoardChartRenderSpecResult {
7
+ spec: Record<string, unknown>;
8
+ chartConfig: IChartConfig;
9
+ chartStyle: ChartStyle;
10
+ hostStyle: {
11
+ fill?: string;
12
+ stroke?: string;
13
+ border?: {
14
+ color?: string;
15
+ width?: number;
16
+ };
17
+ radius?: number;
18
+ };
19
+ }
20
+ export interface IBoardChartRenderInput {
21
+ chartConfig: IChartConfig;
22
+ chartStyle: ChartStyle;
23
+ }
24
+ export declare const IBoardChartRenderModelService: import("@wendellhu/redi").IdentifierDecorator<IChartRenderModel<Record<string, any>>>;
25
+ export declare class BoardChartRenderService extends Disposable {
26
+ private readonly _localeService;
27
+ private readonly _chartThemeService?;
28
+ private readonly _chartInstanceMap;
29
+ private readonly _chartElementEditMode;
30
+ private readonly _chartEventHandlers;
31
+ private readonly _chartEventSubscriptions;
32
+ private readonly _renderModelManager;
33
+ private readonly _ownsRenderModelManager;
34
+ constructor(_localeService: LocaleService, renderModel?: IChartRenderModel, _chartThemeService?: ChartThemeService | undefined, renderModelManager?: IChartRenderModelManagerService);
35
+ registerRenderModel(name: string, renderModel: IChartRenderModel): void;
36
+ setRenderModel(name: string): void;
37
+ getRenderModel(name?: string): IChartRenderModel | undefined;
38
+ createChartInstance(): IChartInstance;
39
+ createChartInstance(mode: ChartHostRenderMode): IChartRenderInstance;
40
+ registerChartInstance(unitId: string, chartId: string, chartInstance: IChartRenderInstance): IDisposable;
41
+ setElementEditMode(unitId: string, chartId: string, enabled: boolean): void;
42
+ isElementEditModeActive(unitId: string, chartId: string): boolean;
43
+ on(unitId: string, chartId: string, type: ChartElementEventType, handler: ChartElementEventHandler): IDisposable;
44
+ createRenderInput(runtime: IBoardChartRuntimeModel): IBoardChartRenderInput;
45
+ createRenderSpec(runtime: IBoardChartRuntimeModel, rect: IChartHostRect, chartInstance?: IChartInstance): IBoardChartRenderSpecResult;
46
+ getHostStyle(chartStyle: ChartStyle): IBoardChartRenderSpecResult['hostStyle'];
47
+ applyHostStyle(host: HTMLElement, hostStyle: IBoardChartRenderSpecResult['hostStyle']): void;
48
+ private _createChartRenderInstanceContext;
49
+ private _bindChartEventHandlers;
50
+ private _bindChartEventHandler;
51
+ private _disposeChartEventSubscription;
52
+ private _disposeChartEventSubscriptions;
53
+ private _getChartRuntimeKey;
54
+ dispose(): void;
55
+ }
@@ -0,0 +1,57 @@
1
+ import type { IBoardChartRuntimeModel } from '@univerjs-pro/boards-chart';
2
+ import { BoardChartModelService } from '@univerjs-pro/boards-chart';
3
+ import { Disposable, LocaleService } from '@univerjs/core';
4
+ import { Subject } from 'rxjs';
5
+ import { BoardChartRenderService } from './board-chart-render.service';
6
+ export interface IBoardChartSnapshotRequest {
7
+ unitId: string;
8
+ chartId: string;
9
+ width: number;
10
+ height: number;
11
+ dpr?: number;
12
+ mode?: 'main' | 'thumbnail';
13
+ }
14
+ export interface IBoardChartSnapshotEntry {
15
+ key: string;
16
+ status: 'pending' | 'ready' | 'error';
17
+ dataUrl?: string;
18
+ error?: unknown;
19
+ }
20
+ export interface IBoardChartInvalidation {
21
+ unitId: string;
22
+ chartId: string;
23
+ }
24
+ export interface IBoardChartInvalidationOptions {
25
+ waitForConfig?: boolean;
26
+ }
27
+ export interface IBoardChartSnapshotRenderer {
28
+ render(request: IBoardChartSnapshotRequest, runtime: IBoardChartRuntimeModel): Promise<string>;
29
+ }
30
+ export declare const IBoardChartSnapshotRendererService: import("@wendellhu/redi").IdentifierDecorator<IBoardChartSnapshotRenderer>;
31
+ export declare class BoardChartSnapshotRenderService extends Disposable {
32
+ private readonly _localeService;
33
+ private readonly _modelService?;
34
+ readonly snapshotUpdated$: Subject<IBoardChartSnapshotEntry>;
35
+ readonly chartInvalidated$: Subject<IBoardChartInvalidation>;
36
+ private readonly _cache;
37
+ private readonly _queue;
38
+ private readonly _configWaitKeys;
39
+ private readonly _renderer;
40
+ private _rendering;
41
+ private _activeDrain;
42
+ constructor(_localeService: LocaleService, _modelService?: BoardChartModelService | undefined, renderer?: IBoardChartSnapshotRenderer, renderService?: BoardChartRenderService);
43
+ requestSnapshot(request: IBoardChartSnapshotRequest): IBoardChartSnapshotEntry;
44
+ getSnapshot(request: IBoardChartSnapshotRequest): IBoardChartSnapshotEntry | undefined;
45
+ invalidateChart(unitId: string, chartId: string, options?: IBoardChartInvalidationOptions): void;
46
+ getCacheKey(request: IBoardChartSnapshotRequest): string;
47
+ flushForTests(): Promise<void>;
48
+ dispose(): void;
49
+ private _createRenderService;
50
+ private _drainQueue;
51
+ private _invalidateSnapshotsForDirectionChange;
52
+ private _runQueue;
53
+ private _renderOne;
54
+ private _waitForRuntimeConfig;
55
+ private _getChartKey;
56
+ private _getRuntimeModel;
57
+ }