返回 presentation-ai
static-custom-kit.tsx
根目录 / src / components / notebook / presentation / editor / plugins / static-custom-kit.tsx
1 import {
2 BaseTableCellHeaderPlugin,
3 BaseTableCellPlugin,
4 BaseTablePlugin,
5 BaseTableRowPlugin,
6 } from "@platejs/table";
7 import { KEYS } from "platejs";
8 import { createTPlatePlugin } from "platejs/react";
9
10 import VisualizationItemElementStatic from "../custom-elements/legacy/visualization-item-static";
11 import VisualizationListElementStatic from "../custom-elements/legacy/visualization-list-static";
12 import AntvInfographicStatic from "../custom-elements/static/antv-infographic-static";
13 import { ArrowItemStatic } from "../custom-elements/static/arrow-item-static";
14 import ArrowListStatic from "../custom-elements/static/arrow-list-static";
15 import { BeforeAfterSideStatic } from "../custom-elements/static/before-after-side-static";
16 import BeforeAfterGroupStatic from "../custom-elements/static/before-after-static";
17 import { BoxItemStatic } from "../custom-elements/static/box-item-static";
18 import BoxGroupStatic from "../custom-elements/static/box-static";
19 import { BulletItemStatic } from "../custom-elements/static/bullet-item-static";
20 import { BulletsElementStatic } from "../custom-elements/static/bullet-static";
21 import ButtonStatic from "../custom-elements/static/button-static";
22 import { CircularGridItemStatic } from "../custom-elements/static/circular-grid-item-static";
23 import CircularGridStatic from "../custom-elements/static/circular-grid-static";
24 import { CompareSideStatic } from "../custom-elements/static/compare-side-static";
25 import CompareGroupStatic from "../custom-elements/static/compare-static";
26 import { ConnectedCircleItemStatic } from "../custom-elements/static/connected-circle-item-static";
27 import ConnectedCirclesStatic from "../custom-elements/static/connected-circles-static";
28 import { ConsItemStatic } from "../custom-elements/static/cons-item-static";
29 import { ContributorStatic } from "../custom-elements/static/contributor-static";
30 import { CycleElementStatic } from "../custom-elements/static/cycle-element-static";
31 import { CycleItemStatic } from "../custom-elements/static/cycle-item-static";
32 import FlexBoxStatic from "../custom-elements/static/flex-box-static";
33 import { GeneratingLeafStatic } from "../custom-elements/static/generating-leaf-static";
34 import { IconListItemStatic } from "../custom-elements/static/icon-list-item-static";
35 import { IconListStatic } from "../custom-elements/static/icon-list-static";
36 import { IconStatic } from "../custom-elements/static/icon-static";
37 import { LabelStatic } from "../custom-elements/static/label-static";
38 import { MediaEmbedElementStatic } from "../custom-elements/static/media-embed-element-static";
39 import { PresentationImageElementStatic } from "../custom-elements/static/presentation-image-element-static";
40 import {
41 PresentationTableCellElementStatic,
42 PresentationTableCellHeaderElementStatic,
43 PresentationTableElementStatic,
44 PresentationTableRowElementStatic,
45 } from "../custom-elements/static/presentation-table-static";
46 import { PresentationTitleStatic } from "../custom-elements/static/presentation-title-static";
47 import ProsConsGroupStatic from "../custom-elements/static/pros-cons-static";
48 import { ProsItemStatic } from "../custom-elements/static/pros-item-static";
49 import { PyramidItemStatic } from "../custom-elements/static/pyramid-item-static";
50 import PyramidStatic from "../custom-elements/static/pyramid-static";
51 import { QuoteStatic } from "../custom-elements/static/quote-static";
52 import { SequenceArrowItemStatic } from "../custom-elements/static/sequence-arrow-item-static";
53 import SequenceArrowStatic from "../custom-elements/static/sequence-arrow-static";
54 import { SlopeItemStatic } from "../custom-elements/static/slope-item-static";
55 import SlopeStatic from "../custom-elements/static/slope-static";
56 import { SnakeItemStatic } from "../custom-elements/static/snake-item-static";
57 import SnakeStatic from "../custom-elements/static/snake-static";
58 import { StairItemStatic } from "../custom-elements/static/staircase-item-static";
59 import StaircaseStatic from "../custom-elements/static/staircase-static";
60 import { StatsItemStatic } from "../custom-elements/static/stats-item-static";
61 import StatsGroupStatic from "../custom-elements/static/stats-static";
62 import StepsElementStatic from "../custom-elements/static/steps-element-static";
63 import { StepsItemStatic } from "../custom-elements/static/steps-item-static";
64 import { TimelineItemStatic } from "../custom-elements/static/timeline-item-static";
65 import TimelineStatic from "../custom-elements/static/timeline-static";
66 import {
67 ANTV_INFOGRAPHIC,
68 ARROW_LIST,
69 ARROW_LIST_ITEM,
70 BEFORE_AFTER_GROUP,
71 BEFORE_AFTER_SIDE,
72 BOX_GROUP,
73 BOX_ITEM,
74 BULLET_GROUP,
75 BULLET_ITEM,
76 BUTTON_ELEMENT,
77 CIRCULAR_GRID_GROUP,
78 CIRCULAR_GRID_ITEM,
79 COMPARE_GROUP,
80 COMPARE_SIDE,
81 CONNECTED_CIRCLES_GROUP,
82 CONNECTED_CIRCLES_ITEM,
83 CONS_ITEM,
84 CONTRIBUTOR_ELEMENT,
85 CYCLE_GROUP,
86 CYCLE_ITEM,
87 FLEX_BOX,
88 ICON_ELEMENT,
89 ICON_LIST,
90 ICON_LIST_ITEM,
91 LABEL_ELEMENT,
92 PRESENTATION_TITLE_ELEMENT,
93 PROS_CONS_GROUP,
94 PROS_ITEM,
95 PYRAMID_GROUP,
96 PYRAMID_ITEM,
97 QUOTE_ELEMENT,
98 SEQUENCE_ARROW_GROUP,
99 SEQUENCE_ARROW_ITEM,
100 SLOPE_GROUP,
101 SLOPE_ITEM,
102 SNAKE_GROUP,
103 SNAKE_ITEM,
104 STAIR_ITEM,
105 STAIRCASE_GROUP,
106 STATS_GROUP,
107 STATS_ITEM,
108 STEPS_GROUP,
109 STEPS_ITEM,
110 TIMELINE_GROUP,
111 TIMELINE_ITEM,
112 } from "../lib";
113 import {
114 AreaChartStaticPlugin,
115 BarChartStaticPlugin,
116 BoxPlotChartStaticPlugin,
117 BubbleChartStaticPlugin,
118 CandlestickChartStaticPlugin,
119 ChordChartStaticPlugin,
120 ComposedChartStaticPlugin,
121 ConeFunnelChartStaticPlugin,
122 DonutChartStaticPlugin,
123 FunnelChartStaticPlugin,
124 HeatmapChartStaticPlugin,
125 HistogramChartStaticPlugin,
126 LinearGaugeStaticPlugin,
127 LineChartStaticPlugin,
128 NightingaleChartStaticPlugin,
129 OhlcChartStaticPlugin,
130 PieChartStaticPlugin,
131 PyramidChartStaticPlugin,
132 RadarChartStaticPlugin,
133 RadialBarChartStaticPlugin,
134 RadialColumnChartStaticPlugin,
135 RadialGaugeStaticPlugin,
136 RangeAreaChartStaticPlugin,
137 RangeBarChartStaticPlugin,
138 SankeyChartStaticPlugin,
139 ScatterChartStaticPlugin,
140 SunburstChartStaticPlugin,
141 TreemapChartStaticPlugin,
142 WaterfallChartStaticPlugin,
143 } from "./chart-plugin";
144
145 export const PresentationStaticCustomKit = [
146 // Image
147 createTPlatePlugin({
148 key: KEYS.img,
149 node: { isElement: true, component: PresentationImageElementStatic },
150 }),
151 // Media Embed
152 createTPlatePlugin({
153 key: KEYS.mediaEmbed,
154 node: { isElement: true, component: MediaEmbedElementStatic },
155 }),
156 createTPlatePlugin({
157 key: ARROW_LIST,
158 node: { isElement: true, component: ArrowListStatic },
159 }),
160 createTPlatePlugin({
161 key: ARROW_LIST_ITEM,
162 node: { isElement: true, component: ArrowItemStatic },
163 }),
164 createTPlatePlugin({
165 key: BULLET_GROUP,
166 node: { isElement: true, component: BulletsElementStatic },
167 }),
168 createTPlatePlugin({
169 key: BULLET_ITEM,
170 node: { isElement: true, component: BulletItemStatic },
171 }),
172 createTPlatePlugin({
173 key: STAIRCASE_GROUP,
174 node: { isElement: true, component: StaircaseStatic },
175 }),
176 createTPlatePlugin({
177 key: STAIR_ITEM,
178 node: { isElement: true, component: StairItemStatic },
179 }),
180 createTPlatePlugin({
181 key: CYCLE_GROUP,
182 node: { isElement: true, component: CycleElementStatic },
183 }),
184 createTPlatePlugin({
185 key: CYCLE_ITEM,
186 node: { isElement: true, component: CycleItemStatic },
187 }),
188 createTPlatePlugin({
189 key: SLOPE_GROUP,
190 node: { isElement: true, component: SlopeStatic },
191 }),
192 createTPlatePlugin({
193 key: SLOPE_ITEM,
194 node: { isElement: true, component: SlopeItemStatic },
195 }),
196 createTPlatePlugin({
197 key: CONNECTED_CIRCLES_GROUP,
198 node: { isElement: true, component: ConnectedCirclesStatic },
199 }),
200 createTPlatePlugin({
201 key: CONNECTED_CIRCLES_ITEM,
202 node: { isElement: true, component: ConnectedCircleItemStatic },
203 }),
204 createTPlatePlugin({
205 key: CIRCULAR_GRID_GROUP,
206 node: { isElement: true, component: CircularGridStatic },
207 }),
208 createTPlatePlugin({
209 key: CIRCULAR_GRID_ITEM,
210 node: { isElement: true, component: CircularGridItemStatic },
211 }),
212 createTPlatePlugin({
213 key: SNAKE_GROUP,
214 node: { isElement: true, component: SnakeStatic },
215 }),
216 createTPlatePlugin({
217 key: SNAKE_ITEM,
218 node: { isElement: true, component: SnakeItemStatic },
219 }),
220 createTPlatePlugin({
221 key: ICON_ELEMENT,
222 node: { isElement: true, component: IconStatic },
223 }),
224 createTPlatePlugin({
225 key: ICON_LIST,
226 node: { isElement: true, component: IconListStatic },
227 }),
228 createTPlatePlugin({
229 key: ICON_LIST_ITEM,
230 node: { isElement: true, component: IconListItemStatic },
231 }),
232 createTPlatePlugin({
233 key: PYRAMID_GROUP,
234 node: { isElement: true, component: PyramidStatic },
235 }),
236 createTPlatePlugin({
237 key: PYRAMID_ITEM,
238 node: { isElement: true, component: PyramidItemStatic },
239 }),
240 createTPlatePlugin({
241 key: TIMELINE_GROUP,
242 node: { isElement: true, component: TimelineStatic },
243 }),
244 createTPlatePlugin({
245 key: TIMELINE_ITEM,
246 node: { isElement: true, component: TimelineItemStatic },
247 }),
248 createTPlatePlugin({
249 key: STEPS_GROUP,
250 node: { isElement: true, component: StepsElementStatic },
251 }),
252 createTPlatePlugin({
253 key: STEPS_ITEM,
254 node: { isElement: true, component: StepsItemStatic },
255 }),
256 // Box
257 createTPlatePlugin({
258 key: BOX_GROUP,
259 node: { isElement: true, component: BoxGroupStatic },
260 }),
261 createTPlatePlugin({
262 key: BOX_ITEM,
263 node: { isElement: true, component: BoxItemStatic },
264 }),
265 // Compare
266 createTPlatePlugin({
267 key: COMPARE_GROUP,
268 node: { isElement: true, component: CompareGroupStatic },
269 }),
270 createTPlatePlugin({
271 key: COMPARE_SIDE,
272 node: { isElement: true, component: CompareSideStatic },
273 }),
274 // Before/After
275 createTPlatePlugin({
276 key: BEFORE_AFTER_GROUP,
277 node: { isElement: true, component: BeforeAfterGroupStatic },
278 }),
279 createTPlatePlugin({
280 key: BEFORE_AFTER_SIDE,
281 node: { isElement: true, component: BeforeAfterSideStatic },
282 }),
283 // Pros & Cons
284 createTPlatePlugin({
285 key: PROS_CONS_GROUP,
286 node: { isElement: true, component: ProsConsGroupStatic },
287 }),
288 createTPlatePlugin({
289 key: PROS_ITEM,
290 node: { isElement: true, component: ProsItemStatic },
291 }),
292 createTPlatePlugin({
293 key: CONS_ITEM,
294 node: { isElement: true, component: ConsItemStatic },
295 }),
296 // Arrow Vertical
297 createTPlatePlugin({
298 key: SEQUENCE_ARROW_GROUP,
299 node: { isElement: true, component: SequenceArrowStatic },
300 }),
301 createTPlatePlugin({
302 key: SEQUENCE_ARROW_ITEM,
303 node: { isElement: true, component: SequenceArrowItemStatic },
304 }),
305 // Stats
306 createTPlatePlugin({
307 key: STATS_GROUP,
308 node: { isElement: true, component: StatsGroupStatic },
309 }),
310 createTPlatePlugin({
311 key: STATS_ITEM,
312 node: { isElement: true, component: StatsItemStatic },
313 }),
314 // Button
315 createTPlatePlugin({
316 key: BUTTON_ELEMENT,
317 node: { isElement: true, component: ButtonStatic },
318 }),
319 createTPlatePlugin({
320 key: PRESENTATION_TITLE_ELEMENT,
321 node: { isElement: true, component: PresentationTitleStatic },
322 }),
323 createTPlatePlugin({
324 key: LABEL_ELEMENT,
325 node: { isElement: true, component: LabelStatic },
326 }),
327 createTPlatePlugin({
328 key: CONTRIBUTOR_ELEMENT,
329 node: { isElement: true, component: ContributorStatic },
330 }),
331 // FlexBox
332 createTPlatePlugin({
333 key: FLEX_BOX,
334 node: { isElement: true, component: FlexBoxStatic },
335 }),
336 // Legacy adapters
337 createTPlatePlugin({
338 key: "visualization-list",
339 node: { isElement: true, component: VisualizationListElementStatic },
340 }),
341 createTPlatePlugin({
342 key: "visualization-item",
343 node: { isElement: true, component: VisualizationItemElementStatic },
344 }),
345
346 BaseTablePlugin.withComponent(PresentationTableElementStatic),
347 BaseTableRowPlugin.withComponent(PresentationTableRowElementStatic),
348 BaseTableCellPlugin.withComponent(PresentationTableCellElementStatic),
349 BaseTableCellHeaderPlugin.withComponent(
350 PresentationTableCellHeaderElementStatic,
351 ),
352
353 // Removed generic chart element router per request
354 // Individual static chart elements
355 PieChartStaticPlugin,
356 BarChartStaticPlugin,
357 AreaChartStaticPlugin,
358 RadarChartStaticPlugin,
359 ScatterChartStaticPlugin,
360 BubbleChartStaticPlugin,
361 LineChartStaticPlugin,
362 RadialBarChartStaticPlugin,
363 ComposedChartStaticPlugin,
364 TreemapChartStaticPlugin,
365 DonutChartStaticPlugin,
366 // New static chart plugins
367 HistogramChartStaticPlugin,
368 HeatmapChartStaticPlugin,
369 RangeBarChartStaticPlugin,
370 RangeAreaChartStaticPlugin,
371 WaterfallChartStaticPlugin,
372 BoxPlotChartStaticPlugin,
373 CandlestickChartStaticPlugin,
374 OhlcChartStaticPlugin,
375 NightingaleChartStaticPlugin,
376 RadialColumnChartStaticPlugin,
377 SunburstChartStaticPlugin,
378 SankeyChartStaticPlugin,
379 ChordChartStaticPlugin,
380 FunnelChartStaticPlugin,
381 ConeFunnelChartStaticPlugin,
382 PyramidChartStaticPlugin,
383 RadialGaugeStaticPlugin,
384 LinearGaugeStaticPlugin,
385 // Quote
386 createTPlatePlugin({
387 key: QUOTE_ELEMENT,
388 node: { isElement: true, component: QuoteStatic },
389 }),
390 // Leaf for generating caret in static mode
391 createTPlatePlugin({
392 key: "generating",
393 node: { isLeaf: true, component: GeneratingLeafStatic },
394 }),
395 // AntV Infographic
396 createTPlatePlugin({
397 key: ANTV_INFOGRAPHIC,
398 node: { isElement: true, isVoid: true, component: AntvInfographicStatic },
399 }),
400 ];
401
401 lines Plain Text