@baron1996/klinecharts-runtime 0.1.0

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 (37) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +22 -0
  3. package/README.md +40 -0
  4. package/dist/events.d.ts +9 -0
  5. package/dist/events.d.ts.map +1 -0
  6. package/dist/events.js +18 -0
  7. package/dist/index.d.ts +7 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +6 -0
  10. package/dist/lifecycle.d.ts +5 -0
  11. package/dist/lifecycle.d.ts.map +1 -0
  12. package/dist/lifecycle.js +23 -0
  13. package/dist/runtime.d.ts +25 -0
  14. package/dist/runtime.d.ts.map +1 -0
  15. package/dist/runtime.js +166 -0
  16. package/dist/toolbar/standard-toolbar-styles.d.ts +2 -0
  17. package/dist/toolbar/standard-toolbar-styles.d.ts.map +1 -0
  18. package/dist/toolbar/standard-toolbar-styles.js +219 -0
  19. package/dist/toolbar/standard-toolbar.d.ts +5 -0
  20. package/dist/toolbar/standard-toolbar.d.ts.map +1 -0
  21. package/dist/toolbar/standard-toolbar.js +219 -0
  22. package/dist/toolbar/toolbar-icons.d.ts +441 -0
  23. package/dist/toolbar/toolbar-icons.d.ts.map +1 -0
  24. package/dist/toolbar/toolbar-icons.js +187 -0
  25. package/dist/toolbar/toolbar-tools.d.ts +56 -0
  26. package/dist/toolbar/toolbar-tools.d.ts.map +1 -0
  27. package/dist/toolbar/toolbar-tools.js +138 -0
  28. package/dist/types.d.ts +46 -0
  29. package/dist/types.d.ts.map +1 -0
  30. package/dist/types.js +1 -0
  31. package/licenses/KLineCharts-LICENSE +201 -0
  32. package/licenses/KLineCharts-NOTICE +5 -0
  33. package/licenses/Noto-Sans-SC-OFL-1.1 +93 -0
  34. package/licenses/Tabler-Icons-LICENSE +21 -0
  35. package/licenses/TradingView-Lightweight-Charts-LICENSE +201 -0
  36. package/licenses/fflate-LICENSE +21 -0
  37. package/package.json +45 -0
@@ -0,0 +1,441 @@
1
+ declare const ICON_SPECS: {
2
+ readonly horizontalRay: readonly [{
3
+ readonly name: "path";
4
+ readonly attributes: {
5
+ readonly d: "M3 12h19";
6
+ };
7
+ }, {
8
+ readonly name: "circle";
9
+ readonly attributes: {
10
+ readonly cx: "5";
11
+ readonly cy: "12";
12
+ readonly r: "2";
13
+ };
14
+ }, {
15
+ readonly name: "circle";
16
+ readonly attributes: {
17
+ readonly cx: "13";
18
+ readonly cy: "12";
19
+ readonly r: "1.5";
20
+ };
21
+ }];
22
+ readonly horizontalSegment: readonly [{
23
+ readonly name: "path";
24
+ readonly attributes: {
25
+ readonly d: "M5 12h14";
26
+ };
27
+ }, {
28
+ readonly name: "circle";
29
+ readonly attributes: {
30
+ readonly cx: "5";
31
+ readonly cy: "12";
32
+ readonly r: "2";
33
+ };
34
+ }, {
35
+ readonly name: "circle";
36
+ readonly attributes: {
37
+ readonly cx: "19";
38
+ readonly cy: "12";
39
+ readonly r: "2";
40
+ };
41
+ }];
42
+ readonly horizontalStraight: readonly [{
43
+ readonly name: "path";
44
+ readonly attributes: {
45
+ readonly d: "M2 12h20";
46
+ };
47
+ }, {
48
+ readonly name: "circle";
49
+ readonly attributes: {
50
+ readonly cx: "8";
51
+ readonly cy: "12";
52
+ readonly r: "1.5";
53
+ };
54
+ }, {
55
+ readonly name: "circle";
56
+ readonly attributes: {
57
+ readonly cx: "16";
58
+ readonly cy: "12";
59
+ readonly r: "1.5";
60
+ };
61
+ }];
62
+ readonly verticalRay: readonly [{
63
+ readonly name: "path";
64
+ readonly attributes: {
65
+ readonly d: "M12 22v-19";
66
+ };
67
+ }, {
68
+ readonly name: "circle";
69
+ readonly attributes: {
70
+ readonly cx: "12";
71
+ readonly cy: "19";
72
+ readonly r: "2";
73
+ };
74
+ }, {
75
+ readonly name: "circle";
76
+ readonly attributes: {
77
+ readonly cx: "12";
78
+ readonly cy: "11";
79
+ readonly r: "1.5";
80
+ };
81
+ }];
82
+ readonly verticalSegment: readonly [{
83
+ readonly name: "path";
84
+ readonly attributes: {
85
+ readonly d: "M12 19v-14";
86
+ };
87
+ }, {
88
+ readonly name: "circle";
89
+ readonly attributes: {
90
+ readonly cx: "12";
91
+ readonly cy: "19";
92
+ readonly r: "2";
93
+ };
94
+ }, {
95
+ readonly name: "circle";
96
+ readonly attributes: {
97
+ readonly cx: "12";
98
+ readonly cy: "5";
99
+ readonly r: "2";
100
+ };
101
+ }];
102
+ readonly verticalStraight: readonly [{
103
+ readonly name: "path";
104
+ readonly attributes: {
105
+ readonly d: "M12 22v-20";
106
+ };
107
+ }, {
108
+ readonly name: "circle";
109
+ readonly attributes: {
110
+ readonly cx: "12";
111
+ readonly cy: "16";
112
+ readonly r: "1.5";
113
+ };
114
+ }, {
115
+ readonly name: "circle";
116
+ readonly attributes: {
117
+ readonly cx: "12";
118
+ readonly cy: "8";
119
+ readonly r: "1.5";
120
+ };
121
+ }];
122
+ readonly ray: readonly [{
123
+ readonly name: "path";
124
+ readonly attributes: {
125
+ readonly d: "M3 21l19 -19";
126
+ };
127
+ }, {
128
+ readonly name: "circle";
129
+ readonly attributes: {
130
+ readonly cx: "5";
131
+ readonly cy: "19";
132
+ readonly r: "2";
133
+ };
134
+ }, {
135
+ readonly name: "circle";
136
+ readonly attributes: {
137
+ readonly cx: "12";
138
+ readonly cy: "12";
139
+ readonly r: "1.5";
140
+ };
141
+ }];
142
+ readonly segment: readonly [{
143
+ readonly name: "path";
144
+ readonly attributes: {
145
+ readonly d: "M5 19l14 -14";
146
+ };
147
+ }, {
148
+ readonly name: "circle";
149
+ readonly attributes: {
150
+ readonly cx: "5";
151
+ readonly cy: "19";
152
+ readonly r: "2";
153
+ };
154
+ }, {
155
+ readonly name: "circle";
156
+ readonly attributes: {
157
+ readonly cx: "19";
158
+ readonly cy: "5";
159
+ readonly r: "2";
160
+ };
161
+ }];
162
+ readonly straight: readonly [{
163
+ readonly name: "path";
164
+ readonly attributes: {
165
+ readonly d: "M2 22l20 -20";
166
+ };
167
+ }, {
168
+ readonly name: "circle";
169
+ readonly attributes: {
170
+ readonly cx: "8";
171
+ readonly cy: "16";
172
+ readonly r: "1.5";
173
+ };
174
+ }, {
175
+ readonly name: "circle";
176
+ readonly attributes: {
177
+ readonly cx: "16";
178
+ readonly cy: "8";
179
+ readonly r: "1.5";
180
+ };
181
+ }];
182
+ readonly priceLine: readonly [{
183
+ readonly name: "path";
184
+ readonly attributes: {
185
+ readonly d: "M3 12h9";
186
+ };
187
+ }, {
188
+ readonly name: "path";
189
+ readonly attributes: {
190
+ readonly d: "M15 8h6v8h-6l-3 -4z";
191
+ };
192
+ }];
193
+ readonly priceChannel: readonly [{
194
+ readonly name: "path";
195
+ readonly attributes: {
196
+ readonly d: "M3 16l12 -12";
197
+ };
198
+ }, {
199
+ readonly name: "path";
200
+ readonly attributes: {
201
+ readonly d: "M9 22l12 -12";
202
+ };
203
+ }, {
204
+ readonly name: "path";
205
+ readonly attributes: {
206
+ readonly d: "M6 19l12 -12";
207
+ readonly 'stroke-dasharray': "2 3";
208
+ };
209
+ }];
210
+ readonly parallelStraight: readonly [{
211
+ readonly name: "path";
212
+ readonly attributes: {
213
+ readonly d: "M2 16l14 -14";
214
+ };
215
+ }, {
216
+ readonly name: "path";
217
+ readonly attributes: {
218
+ readonly d: "M8 22l14 -14";
219
+ };
220
+ }, {
221
+ readonly name: "circle";
222
+ readonly attributes: {
223
+ readonly cx: "8";
224
+ readonly cy: "10";
225
+ readonly r: "1.5";
226
+ };
227
+ }, {
228
+ readonly name: "circle";
229
+ readonly attributes: {
230
+ readonly cx: "16";
231
+ readonly cy: "14";
232
+ readonly r: "1.5";
233
+ };
234
+ }];
235
+ readonly fibonacci: readonly [{
236
+ readonly name: "path";
237
+ readonly attributes: {
238
+ readonly d: "M4 4h16";
239
+ };
240
+ }, {
241
+ readonly name: "path";
242
+ readonly attributes: {
243
+ readonly d: "M4 8h12";
244
+ };
245
+ }, {
246
+ readonly name: "path";
247
+ readonly attributes: {
248
+ readonly d: "M4 12h16";
249
+ };
250
+ }, {
251
+ readonly name: "path";
252
+ readonly attributes: {
253
+ readonly d: "M4 17h12";
254
+ };
255
+ }, {
256
+ readonly name: "path";
257
+ readonly attributes: {
258
+ readonly d: "M4 21h16";
259
+ };
260
+ }, {
261
+ readonly name: "path";
262
+ readonly attributes: {
263
+ readonly d: "M5 4l14 17";
264
+ };
265
+ }];
266
+ readonly brush: readonly [{
267
+ readonly name: "path";
268
+ readonly attributes: {
269
+ readonly d: "M3 21v-4a4 4 0 1 1 4 4h-4";
270
+ };
271
+ }, {
272
+ readonly name: "path";
273
+ readonly attributes: {
274
+ readonly d: "M21 3a16 16 0 0 0 -12.8 10.2";
275
+ };
276
+ }, {
277
+ readonly name: "path";
278
+ readonly attributes: {
279
+ readonly d: "M21 3a16 16 0 0 1 -10.2 12.8";
280
+ };
281
+ }, {
282
+ readonly name: "path";
283
+ readonly attributes: {
284
+ readonly d: "M10.6 9a9 9 0 0 1 4.4 4.4";
285
+ };
286
+ }];
287
+ readonly pencil: readonly [{
288
+ readonly name: "path";
289
+ readonly attributes: {
290
+ readonly d: "M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4";
291
+ };
292
+ }, {
293
+ readonly name: "path";
294
+ readonly attributes: {
295
+ readonly d: "M13.5 6.5l4 4";
296
+ };
297
+ }];
298
+ readonly tag: readonly [{
299
+ readonly name: "path";
300
+ readonly attributes: {
301
+ readonly d: "M6.5 7.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0";
302
+ };
303
+ }, {
304
+ readonly name: "path";
305
+ readonly attributes: {
306
+ readonly d: "M3 6v5.172a2 2 0 0 0 .586 1.414l7.71 7.71a2.41 2.41 0 0 0 3.408 0l5.592 -5.592a2.41 2.41 0 0 0 0 -3.408l-7.71 -7.71a2 2 0 0 0 -1.414 -.586h-5.172a3 3 0 0 0 -3 3";
307
+ };
308
+ }];
309
+ readonly rectangle: readonly [{
310
+ readonly name: "path";
311
+ readonly attributes: {
312
+ readonly d: "M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10";
313
+ };
314
+ }];
315
+ readonly arrow: readonly [{
316
+ readonly name: "path";
317
+ readonly attributes: {
318
+ readonly d: "M17 7l-10 10";
319
+ };
320
+ }, {
321
+ readonly name: "path";
322
+ readonly attributes: {
323
+ readonly d: "M8 7l9 0l0 9";
324
+ };
325
+ }];
326
+ readonly crosshair: readonly [{
327
+ readonly name: "path";
328
+ readonly attributes: {
329
+ readonly d: "M4 8v-2a2 2 0 0 1 2 -2h2";
330
+ };
331
+ }, {
332
+ readonly name: "path";
333
+ readonly attributes: {
334
+ readonly d: "M4 16v2a2 2 0 0 0 2 2h2";
335
+ };
336
+ }, {
337
+ readonly name: "path";
338
+ readonly attributes: {
339
+ readonly d: "M16 4h2a2 2 0 0 1 2 2v2";
340
+ };
341
+ }, {
342
+ readonly name: "path";
343
+ readonly attributes: {
344
+ readonly d: "M16 20h2a2 2 0 0 0 2 -2v-2";
345
+ };
346
+ }, {
347
+ readonly name: "path";
348
+ readonly attributes: {
349
+ readonly d: "M9 12l6 0";
350
+ };
351
+ }, {
352
+ readonly name: "path";
353
+ readonly attributes: {
354
+ readonly d: "M12 9l0 6";
355
+ };
356
+ }];
357
+ readonly message: readonly [{
358
+ readonly name: "path";
359
+ readonly attributes: {
360
+ readonly d: "M8 9h8";
361
+ };
362
+ }, {
363
+ readonly name: "path";
364
+ readonly attributes: {
365
+ readonly d: "M8 13h6";
366
+ };
367
+ }, {
368
+ readonly name: "path";
369
+ readonly attributes: {
370
+ readonly d: "M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12";
371
+ };
372
+ }];
373
+ readonly typography: readonly [{
374
+ readonly name: "path";
375
+ readonly attributes: {
376
+ readonly d: "M4 20l3 0";
377
+ };
378
+ }, {
379
+ readonly name: "path";
380
+ readonly attributes: {
381
+ readonly d: "M14 20l7 0";
382
+ };
383
+ }, {
384
+ readonly name: "path";
385
+ readonly attributes: {
386
+ readonly d: "M6.9 15l6.9 0";
387
+ };
388
+ }, {
389
+ readonly name: "path";
390
+ readonly attributes: {
391
+ readonly d: "M10.2 6.3l5.8 13.7";
392
+ };
393
+ }, {
394
+ readonly name: "path";
395
+ readonly attributes: {
396
+ readonly d: "M5 20l6 -16l2 0l7 16";
397
+ };
398
+ }];
399
+ readonly trash: readonly [{
400
+ readonly name: "path";
401
+ readonly attributes: {
402
+ readonly d: "M4 7l16 0";
403
+ };
404
+ }, {
405
+ readonly name: "path";
406
+ readonly attributes: {
407
+ readonly d: "M10 11l0 6";
408
+ };
409
+ }, {
410
+ readonly name: "path";
411
+ readonly attributes: {
412
+ readonly d: "M14 11l0 6";
413
+ };
414
+ }, {
415
+ readonly name: "path";
416
+ readonly attributes: {
417
+ readonly d: "M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12";
418
+ };
419
+ }, {
420
+ readonly name: "path";
421
+ readonly attributes: {
422
+ readonly d: "M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3";
423
+ };
424
+ }];
425
+ readonly fileExport: readonly [{
426
+ readonly name: "path";
427
+ readonly attributes: {
428
+ readonly d: "M14 3v4a1 1 0 0 0 1 1h4";
429
+ };
430
+ }, {
431
+ readonly name: "path";
432
+ readonly attributes: {
433
+ readonly d: "M11.5 21h-4.5a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v5m-5 6h7m-3 -3l3 3l-3 3";
434
+ };
435
+ }];
436
+ };
437
+ export type ToolbarIconName = keyof typeof ICON_SPECS;
438
+ /** 使用 DOM API 创建符合 24×24 / 2px 规范的工具栏图标。 */
439
+ export declare function createToolbarIcon(name: ToolbarIconName): SVGSVGElement;
440
+ export {};
441
+ //# sourceMappingURL=toolbar-icons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolbar-icons.d.ts","sourceRoot":"","sources":["../../src/toolbar/toolbar-icons.ts"],"names":[],"mappings":"AAcA,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiK2C,CAAC;AAE5D,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,UAAU,CAAC;AAEtD,4CAA4C;AAC5C,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,eAAe,GAAG,aAAa,CAoBtE"}
@@ -0,0 +1,187 @@
1
+ /*
2
+ * Tabler-derived icon geometry is used under the MIT License.
3
+ * See /licenses/Tabler-Icons-LICENSE in the distributed package.
4
+ */
5
+ const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
6
+ const ICON_SPECS = {
7
+ horizontalRay: [
8
+ { name: 'path', attributes: { d: 'M3 12h19' } },
9
+ { name: 'circle', attributes: { cx: '5', cy: '12', r: '2' } },
10
+ { name: 'circle', attributes: { cx: '13', cy: '12', r: '1.5' } },
11
+ ],
12
+ horizontalSegment: [
13
+ { name: 'path', attributes: { d: 'M5 12h14' } },
14
+ { name: 'circle', attributes: { cx: '5', cy: '12', r: '2' } },
15
+ { name: 'circle', attributes: { cx: '19', cy: '12', r: '2' } },
16
+ ],
17
+ horizontalStraight: [
18
+ { name: 'path', attributes: { d: 'M2 12h20' } },
19
+ { name: 'circle', attributes: { cx: '8', cy: '12', r: '1.5' } },
20
+ { name: 'circle', attributes: { cx: '16', cy: '12', r: '1.5' } },
21
+ ],
22
+ verticalRay: [
23
+ { name: 'path', attributes: { d: 'M12 22v-19' } },
24
+ { name: 'circle', attributes: { cx: '12', cy: '19', r: '2' } },
25
+ { name: 'circle', attributes: { cx: '12', cy: '11', r: '1.5' } },
26
+ ],
27
+ verticalSegment: [
28
+ { name: 'path', attributes: { d: 'M12 19v-14' } },
29
+ { name: 'circle', attributes: { cx: '12', cy: '19', r: '2' } },
30
+ { name: 'circle', attributes: { cx: '12', cy: '5', r: '2' } },
31
+ ],
32
+ verticalStraight: [
33
+ { name: 'path', attributes: { d: 'M12 22v-20' } },
34
+ { name: 'circle', attributes: { cx: '12', cy: '16', r: '1.5' } },
35
+ { name: 'circle', attributes: { cx: '12', cy: '8', r: '1.5' } },
36
+ ],
37
+ ray: [
38
+ { name: 'path', attributes: { d: 'M3 21l19 -19' } },
39
+ { name: 'circle', attributes: { cx: '5', cy: '19', r: '2' } },
40
+ { name: 'circle', attributes: { cx: '12', cy: '12', r: '1.5' } },
41
+ ],
42
+ segment: [
43
+ { name: 'path', attributes: { d: 'M5 19l14 -14' } },
44
+ { name: 'circle', attributes: { cx: '5', cy: '19', r: '2' } },
45
+ { name: 'circle', attributes: { cx: '19', cy: '5', r: '2' } },
46
+ ],
47
+ straight: [
48
+ { name: 'path', attributes: { d: 'M2 22l20 -20' } },
49
+ { name: 'circle', attributes: { cx: '8', cy: '16', r: '1.5' } },
50
+ { name: 'circle', attributes: { cx: '16', cy: '8', r: '1.5' } },
51
+ ],
52
+ priceLine: [
53
+ { name: 'path', attributes: { d: 'M3 12h9' } },
54
+ { name: 'path', attributes: { d: 'M15 8h6v8h-6l-3 -4z' } },
55
+ ],
56
+ priceChannel: [
57
+ { name: 'path', attributes: { d: 'M3 16l12 -12' } },
58
+ { name: 'path', attributes: { d: 'M9 22l12 -12' } },
59
+ {
60
+ name: 'path',
61
+ attributes: {
62
+ d: 'M6 19l12 -12',
63
+ 'stroke-dasharray': '2 3',
64
+ },
65
+ },
66
+ ],
67
+ parallelStraight: [
68
+ { name: 'path', attributes: { d: 'M2 16l14 -14' } },
69
+ { name: 'path', attributes: { d: 'M8 22l14 -14' } },
70
+ { name: 'circle', attributes: { cx: '8', cy: '10', r: '1.5' } },
71
+ { name: 'circle', attributes: { cx: '16', cy: '14', r: '1.5' } },
72
+ ],
73
+ fibonacci: [
74
+ { name: 'path', attributes: { d: 'M4 4h16' } },
75
+ { name: 'path', attributes: { d: 'M4 8h12' } },
76
+ { name: 'path', attributes: { d: 'M4 12h16' } },
77
+ { name: 'path', attributes: { d: 'M4 17h12' } },
78
+ { name: 'path', attributes: { d: 'M4 21h16' } },
79
+ { name: 'path', attributes: { d: 'M5 4l14 17' } },
80
+ ],
81
+ brush: [
82
+ { name: 'path', attributes: { d: 'M3 21v-4a4 4 0 1 1 4 4h-4' } },
83
+ { name: 'path', attributes: { d: 'M21 3a16 16 0 0 0 -12.8 10.2' } },
84
+ { name: 'path', attributes: { d: 'M21 3a16 16 0 0 1 -10.2 12.8' } },
85
+ { name: 'path', attributes: { d: 'M10.6 9a9 9 0 0 1 4.4 4.4' } },
86
+ ],
87
+ pencil: [
88
+ {
89
+ name: 'path',
90
+ attributes: {
91
+ d: 'M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4',
92
+ },
93
+ },
94
+ { name: 'path', attributes: { d: 'M13.5 6.5l4 4' } },
95
+ ],
96
+ tag: [
97
+ {
98
+ name: 'path',
99
+ attributes: { d: 'M6.5 7.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0' },
100
+ },
101
+ {
102
+ name: 'path',
103
+ attributes: {
104
+ d: 'M3 6v5.172a2 2 0 0 0 .586 1.414l7.71 7.71a2.41 2.41 0 0 0 3.408 0l5.592 -5.592a2.41 2.41 0 0 0 0 -3.408l-7.71 -7.71a2 2 0 0 0 -1.414 -.586h-5.172a3 3 0 0 0 -3 3',
105
+ },
106
+ },
107
+ ],
108
+ rectangle: [
109
+ {
110
+ name: 'path',
111
+ attributes: {
112
+ d: 'M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10',
113
+ },
114
+ },
115
+ ],
116
+ arrow: [
117
+ { name: 'path', attributes: { d: 'M17 7l-10 10' } },
118
+ { name: 'path', attributes: { d: 'M8 7l9 0l0 9' } },
119
+ ],
120
+ crosshair: [
121
+ { name: 'path', attributes: { d: 'M4 8v-2a2 2 0 0 1 2 -2h2' } },
122
+ { name: 'path', attributes: { d: 'M4 16v2a2 2 0 0 0 2 2h2' } },
123
+ { name: 'path', attributes: { d: 'M16 4h2a2 2 0 0 1 2 2v2' } },
124
+ { name: 'path', attributes: { d: 'M16 20h2a2 2 0 0 0 2 -2v-2' } },
125
+ { name: 'path', attributes: { d: 'M9 12l6 0' } },
126
+ { name: 'path', attributes: { d: 'M12 9l0 6' } },
127
+ ],
128
+ message: [
129
+ { name: 'path', attributes: { d: 'M8 9h8' } },
130
+ { name: 'path', attributes: { d: 'M8 13h6' } },
131
+ {
132
+ name: 'path',
133
+ attributes: {
134
+ d: 'M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12',
135
+ },
136
+ },
137
+ ],
138
+ typography: [
139
+ { name: 'path', attributes: { d: 'M4 20l3 0' } },
140
+ { name: 'path', attributes: { d: 'M14 20l7 0' } },
141
+ { name: 'path', attributes: { d: 'M6.9 15l6.9 0' } },
142
+ { name: 'path', attributes: { d: 'M10.2 6.3l5.8 13.7' } },
143
+ { name: 'path', attributes: { d: 'M5 20l6 -16l2 0l7 16' } },
144
+ ],
145
+ trash: [
146
+ { name: 'path', attributes: { d: 'M4 7l16 0' } },
147
+ { name: 'path', attributes: { d: 'M10 11l0 6' } },
148
+ { name: 'path', attributes: { d: 'M14 11l0 6' } },
149
+ {
150
+ name: 'path',
151
+ attributes: { d: 'M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12' },
152
+ },
153
+ {
154
+ name: 'path',
155
+ attributes: { d: 'M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3' },
156
+ },
157
+ ],
158
+ fileExport: [
159
+ { name: 'path', attributes: { d: 'M14 3v4a1 1 0 0 0 1 1h4' } },
160
+ {
161
+ name: 'path',
162
+ attributes: {
163
+ d: 'M11.5 21h-4.5a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v5m-5 6h7m-3 -3l3 3l-3 3',
164
+ },
165
+ },
166
+ ],
167
+ };
168
+ /** 使用 DOM API 创建符合 24×24 / 2px 规范的工具栏图标。 */
169
+ export function createToolbarIcon(name) {
170
+ const svg = document.createElementNS(SVG_NAMESPACE, 'svg');
171
+ svg.setAttribute('viewBox', '0 0 24 24');
172
+ svg.setAttribute('fill', 'none');
173
+ svg.setAttribute('stroke', 'currentColor');
174
+ svg.setAttribute('stroke-width', '2');
175
+ svg.setAttribute('stroke-linecap', 'round');
176
+ svg.setAttribute('stroke-linejoin', 'round');
177
+ svg.setAttribute('aria-hidden', 'true');
178
+ svg.setAttribute('focusable', 'false');
179
+ for (const spec of ICON_SPECS[name]) {
180
+ const node = document.createElementNS(SVG_NAMESPACE, spec.name);
181
+ for (const [attribute, value] of Object.entries(spec.attributes)) {
182
+ node.setAttribute(attribute, value);
183
+ }
184
+ svg.append(node);
185
+ }
186
+ return svg;
187
+ }
@@ -0,0 +1,56 @@
1
+ import type { SupportedOverlayType } from '../types.js';
2
+ import type { ToolbarIconName } from './toolbar-icons.js';
3
+ export type ToolbarGroupId = 'horizontal' | 'vertical' | 'trend' | 'analysis' | 'annotation' | 'shape' | 'action';
4
+ export interface ToolbarGroup {
5
+ readonly id: ToolbarGroupId;
6
+ readonly label: string;
7
+ }
8
+ export interface ToolbarToolPresentation {
9
+ readonly label: string;
10
+ readonly group: Exclude<ToolbarGroupId, 'action'>;
11
+ readonly icon: ToolbarIconName;
12
+ }
13
+ export interface ToolbarActionPresentation {
14
+ readonly action: 'delete' | 'export';
15
+ readonly label: string;
16
+ readonly group: 'action';
17
+ readonly icon: ToolbarIconName;
18
+ }
19
+ /** 工具栏分组顺序,与评审通过的排列保持一致。 */
20
+ export declare const TOOLBAR_GROUPS: readonly [{
21
+ readonly id: "horizontal";
22
+ readonly label: "水平线";
23
+ }, {
24
+ readonly id: "vertical";
25
+ readonly label: "垂直线";
26
+ }, {
27
+ readonly id: "trend";
28
+ readonly label: "趋势线";
29
+ }, {
30
+ readonly id: "analysis";
31
+ readonly label: "价格与分析";
32
+ }, {
33
+ readonly id: "annotation";
34
+ readonly label: "标注";
35
+ }, {
36
+ readonly id: "shape";
37
+ readonly label: "形状与文本";
38
+ }, {
39
+ readonly id: "action";
40
+ readonly label: "操作";
41
+ }];
42
+ /** 每个已注册 Overlay 都必须具备唯一且完整的图标语义。 */
43
+ export declare const OVERLAY_TOOL_PRESENTATIONS: Readonly<Record<SupportedOverlayType, ToolbarToolPresentation>>;
44
+ export declare const TOOLBAR_ACTIONS: readonly [{
45
+ readonly action: "delete";
46
+ readonly label: "删除选中标注";
47
+ readonly group: "action";
48
+ readonly icon: "trash";
49
+ }, {
50
+ readonly action: "export";
51
+ readonly label: "导出场景";
52
+ readonly group: "action";
53
+ readonly icon: "fileExport";
54
+ }];
55
+ export declare const TEXT_OVERLAY_TYPES: ReadonlySet<SupportedOverlayType>;
56
+ //# sourceMappingURL=toolbar-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolbar-tools.d.ts","sourceRoot":"","sources":["../../src/toolbar/toolbar-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,MAAM,MAAM,cAAc,GACvB,YAAY,GACZ,UAAU,GACV,OAAO,GACP,UAAU,GACV,YAAY,GACZ,OAAO,GACP,QAAQ,CAAC;AAEZ,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,EAAE,EAAE,cAAc,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,uBAAuB;IACvC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;IAClD,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;CAC/B;AAED,MAAM,WAAW,yBAAyB;IACzC,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAAC;IACrC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;CAC/B;AAED,4BAA4B;AAC5B,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;EAQiB,CAAC;AAE7C,qCAAqC;AACrC,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAChD,MAAM,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,CA2GrD,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;EAa6B,CAAC;AAE1D,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,oBAAoB,CAK/D,CAAC"}