lakelib 0.1.21 → 0.1.23

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 (41) hide show
  1. package/README.md +4 -4
  2. package/dist/lake.css +45 -36
  3. package/dist/lake.min.js +37 -29
  4. package/dist/lake.min.js.map +1 -1
  5. package/lib/lake.css +45 -36
  6. package/lib/lake.js +989 -299
  7. package/lib/lake.js.map +1 -1
  8. package/lib/types/boxes/code-block.d.ts +2 -1
  9. package/lib/types/boxes/emoji.d.ts +2 -1
  10. package/lib/types/boxes/equation.d.ts +2 -1
  11. package/lib/types/boxes/file.d.ts +2 -1
  12. package/lib/types/boxes/hr.d.ts +2 -1
  13. package/lib/types/boxes/image.d.ts +2 -1
  14. package/lib/types/boxes/video.d.ts +2 -1
  15. package/lib/types/config/slash-items.d.ts +2 -0
  16. package/lib/types/css/index.d.ts +1 -1
  17. package/lib/types/editor.d.ts +3 -0
  18. package/lib/types/i18n/en-US/index.d.ts +36 -0
  19. package/lib/types/i18n/ja/index.d.ts +36 -0
  20. package/lib/types/i18n/ko/index.d.ts +36 -0
  21. package/lib/types/i18n/types.d.ts +278 -2
  22. package/lib/types/i18n/zh-CN/index.d.ts +36 -0
  23. package/lib/types/index.d.ts +3 -2
  24. package/lib/types/managers/keystroke.d.ts +0 -1
  25. package/lib/types/managers/plugin.d.ts +4 -5
  26. package/lib/types/managers/selection.d.ts +1 -1
  27. package/lib/types/models/box.d.ts +1 -1
  28. package/lib/types/models/nodes.d.ts +2 -0
  29. package/lib/types/plugins/slash.d.ts +3 -0
  30. package/lib/types/types/plugin.d.ts +3 -0
  31. package/lib/types/types/{commands.d.ts → slash.d.ts} +4 -4
  32. package/lib/types/ui/box-toolbar.d.ts +2 -1
  33. package/lib/types/ui/dropdown.d.ts +1 -0
  34. package/lib/types/ui/link-popup.d.ts +2 -3
  35. package/lib/types/ui/slash-popup.d.ts +34 -0
  36. package/lib/types/ui/toolbar.d.ts +5 -3
  37. package/lib/types/utils/index.d.ts +2 -1
  38. package/lib/types/utils/{node-and-view.d.ts → node-position.d.ts} +1 -1
  39. package/lib/types/utils/scroll-to-node.d.ts +2 -0
  40. package/package.json +1 -1
  41. package/lib/types/ui/commands-popup.d.ts +0 -24
@@ -1,2 +1,3 @@
1
1
  import { BoxComponent } from '../types/box';
2
- export declare const codeBlockBox: BoxComponent;
2
+ declare const _default: BoxComponent;
3
+ export default _default;
@@ -1,2 +1,3 @@
1
1
  import { BoxComponent } from '../types/box';
2
- export declare const emojiBox: BoxComponent;
2
+ declare const _default: BoxComponent;
3
+ export default _default;
@@ -1,2 +1,3 @@
1
1
  import { BoxComponent } from '../types/box';
2
- export declare const equationBox: BoxComponent;
2
+ declare const _default: BoxComponent;
3
+ export default _default;
@@ -1,2 +1,3 @@
1
1
  import { BoxComponent } from '../types/box';
2
- export declare const fileBox: BoxComponent;
2
+ declare const _default: BoxComponent;
3
+ export default _default;
@@ -1,2 +1,3 @@
1
1
  import { BoxComponent } from '../types/box';
2
- export declare const hrBox: BoxComponent;
2
+ declare const _default: BoxComponent;
3
+ export default _default;
@@ -1,3 +1,4 @@
1
1
  import 'photoswipe/style.css';
2
2
  import { BoxComponent } from '../types/box';
3
- export declare const imageBox: BoxComponent;
3
+ declare const _default: BoxComponent;
4
+ export default _default;
@@ -1,2 +1,3 @@
1
1
  import { BoxComponent } from '../types/box';
2
- export declare const videoBox: BoxComponent;
2
+ declare const _default: BoxComponent;
3
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import { SlashItem } from '../types/slash';
2
+ export declare const slashItems: SlashItem[];
@@ -21,4 +21,4 @@ import './file.css';
21
21
  import './emoji.css';
22
22
  import './equation.css';
23
23
  import './toolbar.css';
24
- import './commands-popup.css';
24
+ import './slash.css';
@@ -40,6 +40,7 @@ export declare class Editor {
40
40
  private unsavedInputData;
41
41
  private unsavedInputCount;
42
42
  private state;
43
+ private unmountPluginMap;
43
44
  static version: string;
44
45
  static box: BoxManager;
45
46
  static plugin: Plugin;
@@ -65,12 +66,14 @@ export declare class Editor {
65
66
  private selectionchangeListener;
66
67
  private clickListener;
67
68
  private resizeListener;
69
+ private scrollListener;
68
70
  private updateSelectionRange;
69
71
  private updateBoxSelectionStyle;
70
72
  private emitStateChangeEvent;
71
73
  private togglePlaceholderClass;
72
74
  private moveBoxStripText;
73
75
  private resetUnsavedInputData;
76
+ private handleInputEvent;
74
77
  private bindInputEvents;
75
78
  private bindHistoryEvents;
76
79
  get hasFocus(): boolean;
@@ -48,6 +48,42 @@ declare const _default: {
48
48
  equation: string;
49
49
  removeColor: string;
50
50
  };
51
+ slash: {
52
+ heading1: string;
53
+ heading1Desc: string;
54
+ heading2: string;
55
+ heading2Desc: string;
56
+ heading3: string;
57
+ heading3Desc: string;
58
+ heading4: string;
59
+ heading4Desc: string;
60
+ heading5: string;
61
+ heading5Desc: string;
62
+ heading6: string;
63
+ heading6Desc: string;
64
+ paragraph: string;
65
+ paragraphDesc: string;
66
+ blockQuote: string;
67
+ blockQuoteDesc: string;
68
+ numberedList: string;
69
+ numberedListDesc: string;
70
+ bulletedList: string;
71
+ bulletedListDesc: string;
72
+ checklist: string;
73
+ checklistDesc: string;
74
+ hr: string;
75
+ hrDesc: string;
76
+ codeBlock: string;
77
+ codeBlockDesc: string;
78
+ video: string;
79
+ videoDesc: string;
80
+ equation: string;
81
+ equationDesc: string;
82
+ image: string;
83
+ imageDesc: string;
84
+ file: string;
85
+ fileDesc: string;
86
+ };
51
87
  link: {
52
88
  newLink: string;
53
89
  url: string;
@@ -48,6 +48,42 @@ declare const _default: {
48
48
  equation: string;
49
49
  removeColor: string;
50
50
  };
51
+ slash: {
52
+ heading1: string;
53
+ heading1Desc: string;
54
+ heading2: string;
55
+ heading2Desc: string;
56
+ heading3: string;
57
+ heading3Desc: string;
58
+ heading4: string;
59
+ heading4Desc: string;
60
+ heading5: string;
61
+ heading5Desc: string;
62
+ heading6: string;
63
+ heading6Desc: string;
64
+ paragraph: string;
65
+ paragraphDesc: string;
66
+ blockQuote: string;
67
+ blockQuoteDesc: string;
68
+ numberedList: string;
69
+ numberedListDesc: string;
70
+ bulletedList: string;
71
+ bulletedListDesc: string;
72
+ checklist: string;
73
+ checklistDesc: string;
74
+ hr: string;
75
+ hrDesc: string;
76
+ codeBlock: string;
77
+ codeBlockDesc: string;
78
+ video: string;
79
+ videoDesc: string;
80
+ equation: string;
81
+ equationDesc: string;
82
+ image: string;
83
+ imageDesc: string;
84
+ file: string;
85
+ fileDesc: string;
86
+ };
51
87
  link: {
52
88
  newLink: string;
53
89
  url: string;
@@ -48,6 +48,42 @@ declare const _default: {
48
48
  equation: string;
49
49
  removeColor: string;
50
50
  };
51
+ slash: {
52
+ heading1: string;
53
+ heading1Desc: string;
54
+ heading2: string;
55
+ heading2Desc: string;
56
+ heading3: string;
57
+ heading3Desc: string;
58
+ heading4: string;
59
+ heading4Desc: string;
60
+ heading5: string;
61
+ heading5Desc: string;
62
+ heading6: string;
63
+ heading6Desc: string;
64
+ paragraph: string;
65
+ paragraphDesc: string;
66
+ blockQuote: string;
67
+ blockQuoteDesc: string;
68
+ numberedList: string;
69
+ numberedListDesc: string;
70
+ bulletedList: string;
71
+ bulletedListDesc: string;
72
+ checklist: string;
73
+ checklistDesc: string;
74
+ hr: string;
75
+ hrDesc: string;
76
+ codeBlock: string;
77
+ codeBlockDesc: string;
78
+ video: string;
79
+ videoDesc: string;
80
+ equation: string;
81
+ equationDesc: string;
82
+ image: string;
83
+ imageDesc: string;
84
+ file: string;
85
+ fileDesc: string;
86
+ };
51
87
  link: {
52
88
  newLink: string;
53
89
  url: string;
@@ -195,6 +195,144 @@ type RootTranslation = {
195
195
  */
196
196
  removeColor: string;
197
197
  };
198
+ slash: {
199
+ /**
200
+ * H​e​a​d​i​n​g​ ​1
201
+ */
202
+ heading1: string;
203
+ /**
204
+ * C​r​e​a​t​e​ ​a​ ​h​e​a​d​i​n​g​ ​l​e​v​e​l​ ​1
205
+ */
206
+ heading1Desc: string;
207
+ /**
208
+ * H​e​a​d​i​n​g​ ​2
209
+ */
210
+ heading2: string;
211
+ /**
212
+ * C​r​e​a​t​e​ ​a​ ​h​e​a​d​i​n​g​ ​l​e​v​e​l​ ​2
213
+ */
214
+ heading2Desc: string;
215
+ /**
216
+ * H​e​a​d​i​n​g​ ​3
217
+ */
218
+ heading3: string;
219
+ /**
220
+ * C​r​e​a​t​e​ ​a​ ​h​e​a​d​i​n​g​ ​l​e​v​e​l​ ​3
221
+ */
222
+ heading3Desc: string;
223
+ /**
224
+ * H​e​a​d​i​n​g​ ​4
225
+ */
226
+ heading4: string;
227
+ /**
228
+ * C​r​e​a​t​e​ ​a​ ​h​e​a​d​i​n​g​ ​l​e​v​e​l​ ​4
229
+ */
230
+ heading4Desc: string;
231
+ /**
232
+ * H​e​a​d​i​n​g​ ​5
233
+ */
234
+ heading5: string;
235
+ /**
236
+ * C​r​e​a​t​e​ ​a​ ​h​e​a​d​i​n​g​ ​l​e​v​e​l​ ​5
237
+ */
238
+ heading5Desc: string;
239
+ /**
240
+ * H​e​a​d​i​n​g​ ​6
241
+ */
242
+ heading6: string;
243
+ /**
244
+ * C​r​e​a​t​e​ ​a​ ​h​e​a​d​i​n​g​ ​l​e​v​e​l​ ​6
245
+ */
246
+ heading6Desc: string;
247
+ /**
248
+ * P​a​r​a​g​r​a​p​h
249
+ */
250
+ paragraph: string;
251
+ /**
252
+ * C​r​e​a​t​e​ ​a​ ​p​a​r​a​g​r​a​p​h
253
+ */
254
+ paragraphDesc: string;
255
+ /**
256
+ * B​l​o​c​k​ ​q​u​o​t​a​t​i​o​n
257
+ */
258
+ blockQuote: string;
259
+ /**
260
+ * C​r​e​a​t​e​ ​a​ ​b​l​o​c​k​ ​q​u​o​t​a​t​i​o​n
261
+ */
262
+ blockQuoteDesc: string;
263
+ /**
264
+ * N​u​m​b​e​r​e​d​ ​l​i​s​t
265
+ */
266
+ numberedList: string;
267
+ /**
268
+ * C​r​e​a​t​e​ ​a​ ​n​u​m​b​e​r​e​d​ ​l​i​s​t
269
+ */
270
+ numberedListDesc: string;
271
+ /**
272
+ * B​u​l​l​e​t​e​d​ ​l​i​s​t
273
+ */
274
+ bulletedList: string;
275
+ /**
276
+ * C​r​e​a​t​e​ ​a​ ​b​u​l​l​e​t​e​d​ ​l​i​s​t
277
+ */
278
+ bulletedListDesc: string;
279
+ /**
280
+ * C​h​e​c​k​l​i​s​t
281
+ */
282
+ checklist: string;
283
+ /**
284
+ * C​r​e​a​t​e​ ​a​ ​c​h​e​c​k​l​i​s​t
285
+ */
286
+ checklistDesc: string;
287
+ /**
288
+ * H​o​r​i​z​o​n​t​a​l​ ​l​i​n​e
289
+ */
290
+ hr: string;
291
+ /**
292
+ * I​n​s​e​r​t​ ​a​ ​h​o​r​i​z​o​n​t​a​l​ ​l​i​n​e
293
+ */
294
+ hrDesc: string;
295
+ /**
296
+ * C​o​d​e​ ​b​l​o​c​k
297
+ */
298
+ codeBlock: string;
299
+ /**
300
+ * I​n​s​e​r​t​ ​a​ ​c​o​d​e​ ​b​l​o​c​k
301
+ */
302
+ codeBlockDesc: string;
303
+ /**
304
+ * V​i​d​e​o
305
+ */
306
+ video: string;
307
+ /**
308
+ * I​n​s​e​r​t​ ​a​ ​v​i​d​e​o​ ​f​r​o​m​ ​Y​o​u​T​u​b​e
309
+ */
310
+ videoDesc: string;
311
+ /**
312
+ * E​q​u​a​t​i​o​n
313
+ */
314
+ equation: string;
315
+ /**
316
+ * I​n​s​e​r​t​ ​T​e​X​ ​e​x​p​r​e​s​s​i​o​n​ ​i​n​ ​t​e​x​t
317
+ */
318
+ equationDesc: string;
319
+ /**
320
+ * I​m​a​g​e
321
+ */
322
+ image: string;
323
+ /**
324
+ * U​p​l​o​a​d​ ​a​n​ ​i​m​a​g​e
325
+ */
326
+ imageDesc: string;
327
+ /**
328
+ * F​i​l​e
329
+ */
330
+ file: string;
331
+ /**
332
+ * U​p​l​o​a​d​ ​a​ ​f​i​l​e
333
+ */
334
+ fileDesc: string;
335
+ };
198
336
  link: {
199
337
  /**
200
338
  * N​e​w​ ​l​i​n​k
@@ -303,7 +441,7 @@ type RootTranslation = {
303
441
  */
304
442
  save: string;
305
443
  /**
306
- * T​y​p​e​ ​a​n​ ​e​x​p​r​e​s​s​i​o​n
444
+ * T​y​p​e​ ​a​ T​e​X​ ​e​x​p​r​e​s​s​i​o​n
307
445
  */
308
446
  placeholder: string;
309
447
  };
@@ -499,6 +637,144 @@ export type TranslationFunctions = {
499
637
  */
500
638
  removeColor: () => LocalizedString;
501
639
  };
640
+ slash: {
641
+ /**
642
+ * Heading 1
643
+ */
644
+ heading1: () => LocalizedString;
645
+ /**
646
+ * Create a heading level 1
647
+ */
648
+ heading1Desc: () => LocalizedString;
649
+ /**
650
+ * Heading 2
651
+ */
652
+ heading2: () => LocalizedString;
653
+ /**
654
+ * Create a heading level 2
655
+ */
656
+ heading2Desc: () => LocalizedString;
657
+ /**
658
+ * Heading 3
659
+ */
660
+ heading3: () => LocalizedString;
661
+ /**
662
+ * Create a heading level 3
663
+ */
664
+ heading3Desc: () => LocalizedString;
665
+ /**
666
+ * Heading 4
667
+ */
668
+ heading4: () => LocalizedString;
669
+ /**
670
+ * Create a heading level 4
671
+ */
672
+ heading4Desc: () => LocalizedString;
673
+ /**
674
+ * Heading 5
675
+ */
676
+ heading5: () => LocalizedString;
677
+ /**
678
+ * Create a heading level 5
679
+ */
680
+ heading5Desc: () => LocalizedString;
681
+ /**
682
+ * Heading 6
683
+ */
684
+ heading6: () => LocalizedString;
685
+ /**
686
+ * Create a heading level 6
687
+ */
688
+ heading6Desc: () => LocalizedString;
689
+ /**
690
+ * Paragraph
691
+ */
692
+ paragraph: () => LocalizedString;
693
+ /**
694
+ * Create a paragraph
695
+ */
696
+ paragraphDesc: () => LocalizedString;
697
+ /**
698
+ * Block quotation
699
+ */
700
+ blockQuote: () => LocalizedString;
701
+ /**
702
+ * Create a block quotation
703
+ */
704
+ blockQuoteDesc: () => LocalizedString;
705
+ /**
706
+ * Numbered list
707
+ */
708
+ numberedList: () => LocalizedString;
709
+ /**
710
+ * Create a numbered list
711
+ */
712
+ numberedListDesc: () => LocalizedString;
713
+ /**
714
+ * Bulleted list
715
+ */
716
+ bulletedList: () => LocalizedString;
717
+ /**
718
+ * Create a bulleted list
719
+ */
720
+ bulletedListDesc: () => LocalizedString;
721
+ /**
722
+ * Checklist
723
+ */
724
+ checklist: () => LocalizedString;
725
+ /**
726
+ * Create a checklist
727
+ */
728
+ checklistDesc: () => LocalizedString;
729
+ /**
730
+ * Horizontal line
731
+ */
732
+ hr: () => LocalizedString;
733
+ /**
734
+ * Insert a horizontal line
735
+ */
736
+ hrDesc: () => LocalizedString;
737
+ /**
738
+ * Code block
739
+ */
740
+ codeBlock: () => LocalizedString;
741
+ /**
742
+ * Insert a code block
743
+ */
744
+ codeBlockDesc: () => LocalizedString;
745
+ /**
746
+ * Video
747
+ */
748
+ video: () => LocalizedString;
749
+ /**
750
+ * Insert a video from YouTube
751
+ */
752
+ videoDesc: () => LocalizedString;
753
+ /**
754
+ * Equation
755
+ */
756
+ equation: () => LocalizedString;
757
+ /**
758
+ * Insert TeX expression in text
759
+ */
760
+ equationDesc: () => LocalizedString;
761
+ /**
762
+ * Image
763
+ */
764
+ image: () => LocalizedString;
765
+ /**
766
+ * Upload an image
767
+ */
768
+ imageDesc: () => LocalizedString;
769
+ /**
770
+ * File
771
+ */
772
+ file: () => LocalizedString;
773
+ /**
774
+ * Upload a file
775
+ */
776
+ fileDesc: () => LocalizedString;
777
+ };
502
778
  link: {
503
779
  /**
504
780
  * New link
@@ -607,7 +883,7 @@ export type TranslationFunctions = {
607
883
  */
608
884
  save: () => LocalizedString;
609
885
  /**
610
- * Type an expression
886
+ * Type a TeX expression
611
887
  */
612
888
  placeholder: () => LocalizedString;
613
889
  };
@@ -48,6 +48,42 @@ declare const _default: {
48
48
  equation: string;
49
49
  removeColor: string;
50
50
  };
51
+ slash: {
52
+ heading1: string;
53
+ heading1Desc: string;
54
+ heading2: string;
55
+ heading2Desc: string;
56
+ heading3: string;
57
+ heading3Desc: string;
58
+ heading4: string;
59
+ heading4Desc: string;
60
+ heading5: string;
61
+ heading5Desc: string;
62
+ heading6: string;
63
+ heading6Desc: string;
64
+ paragraph: string;
65
+ paragraphDesc: string;
66
+ blockQuote: string;
67
+ blockQuoteDesc: string;
68
+ numberedList: string;
69
+ numberedListDesc: string;
70
+ bulletedList: string;
71
+ bulletedListDesc: string;
72
+ checklist: string;
73
+ checklistDesc: string;
74
+ hr: string;
75
+ hrDesc: string;
76
+ codeBlock: string;
77
+ codeBlockDesc: string;
78
+ video: string;
79
+ videoDesc: string;
80
+ equation: string;
81
+ equationDesc: string;
82
+ image: string;
83
+ imageDesc: string;
84
+ file: string;
85
+ fileDesc: string;
86
+ };
51
87
  link: {
52
88
  newLink: string;
53
89
  url: string;
@@ -1,9 +1,10 @@
1
1
  import './css';
2
2
  import './elements/box';
3
3
  import './elements/bookmark';
4
- import { BoxComponent } from './types/box';
4
+ import { BoxComponent, BoxValue } from './types/box';
5
5
  import { ToolbarItem } from './types/toolbar';
6
6
  import { DropdownMenuItem } from './types/dropdown';
7
+ import { SlashItem } from './types/slash';
7
8
  import { icons } from './icons';
8
9
  import * as Utils from './utils';
9
10
  import { Nodes } from './models/nodes';
@@ -30,4 +31,4 @@ import { Button } from './ui/button';
30
31
  import { Dropdown } from './ui/dropdown';
31
32
  import { Editor } from './editor';
32
33
  import { Toolbar } from './ui/toolbar';
33
- export { Editor, Toolbar, ToolbarItem, DropdownMenuItem, BoxComponent, Button, Dropdown, icons, Utils, Nodes, Fragment, Range, Box, HTMLParser, TextParser, insertBookmark, toBookmark, insertNode, insertFragment, deleteContents, setBlocks, splitBlock, splitMarks, addMark, removeMark, fixList, insertLink, insertBox, removeBox, };
34
+ export { Editor, Toolbar, ToolbarItem, DropdownMenuItem, SlashItem, BoxComponent, BoxValue, Button, Dropdown, icons, Utils, Nodes, Fragment, Range, Box, HTMLParser, TextParser, insertBookmark, toBookmark, insertNode, insertFragment, deleteContents, setBlocks, splitBlock, splitMarks, addMark, removeMark, fixList, insertLink, insertBox, removeBox, };
@@ -4,7 +4,6 @@ export declare class Keystroke {
4
4
  private keydownEventList;
5
5
  private keyupEventList;
6
6
  constructor(container: Nodes);
7
- private normalizeType;
8
7
  setKeydown(type: string, listener: EventListener): void;
9
8
  setKeyup(type: string, listener: EventListener): void;
10
9
  keydown(type: string): void;
@@ -1,8 +1,7 @@
1
1
  import type { Editor } from '../editor';
2
- type PluginFunction = (editor: Editor) => void;
2
+ import { InitializePlugin, UnmountPlugin } from '../types/plugin';
3
3
  export declare class Plugin {
4
- private pluginList;
5
- add(plugin: PluginFunction): void;
6
- loadAll(editor: Editor): void;
4
+ private pluginMap;
5
+ add(name: string, plugin: InitializePlugin): void;
6
+ loadAll(editor: Editor): Map<string, UnmountPlugin>;
7
7
  }
8
- export {};
@@ -21,7 +21,7 @@ export declare class Selection {
21
21
  container: Nodes;
22
22
  range: Range;
23
23
  constructor(container: Nodes);
24
- private getRangeFromNativeSelection;
24
+ getCurrentRange(): Range;
25
25
  sync(): void;
26
26
  updateByRange(): void;
27
27
  updateByBookmark(): void;
@@ -14,7 +14,7 @@ export declare class Box {
14
14
  set value(value: BoxValue);
15
15
  updateValue(valueKey: string, valueValue: string): void;
16
16
  updateValue(valueKey: BoxValue): void;
17
- getEditor(): Editor | undefined;
17
+ getEditor(): Editor;
18
18
  getContainer(): Nodes;
19
19
  setToolbar(items: ('|' | BoxToolbarItem)[]): void;
20
20
  render(): void;
@@ -81,6 +81,8 @@ export declare class Nodes {
81
81
  html(value: string): this;
82
82
  text(): string;
83
83
  text(value: string): this;
84
+ value(): string;
85
+ value(value: string): this;
84
86
  outerHTML(): string;
85
87
  empty(): this;
86
88
  prepend(content: string | Node | DocumentFragment | Nodes): this;
@@ -0,0 +1,3 @@
1
+ import type { Editor } from '..';
2
+ declare const _default: (editor: Editor) => (() => void) | undefined;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import type { Editor } from '../editor';
2
+ export type UnmountPlugin = () => void;
3
+ export type InitializePlugin = (editor: Editor) => UnmountPlugin | void;
@@ -1,6 +1,6 @@
1
1
  import type { Editor } from '../editor';
2
2
  import { TranslationFunctions } from '../i18n/types';
3
- export type CommandButtonItem = {
3
+ export type SlashButtonItem = {
4
4
  name: string;
5
5
  type: 'button';
6
6
  icon?: string;
@@ -8,13 +8,13 @@ export type CommandButtonItem = {
8
8
  description: string | ((locale: TranslationFunctions) => string);
9
9
  onClick: (editor: Editor, value: string) => void;
10
10
  };
11
- export type CommandUploadItem = {
11
+ export type SlashUploadItem = {
12
12
  name: string;
13
13
  type: 'upload';
14
- icon: string;
14
+ icon?: string;
15
15
  title: string | ((locale: TranslationFunctions) => string);
16
16
  description: string | ((locale: TranslationFunctions) => string);
17
17
  accept?: string;
18
18
  multiple?: boolean;
19
19
  };
20
- export type CommandItem = CommandButtonItem | CommandUploadItem;
20
+ export type SlashItem = SlashButtonItem | SlashUploadItem;
@@ -8,12 +8,13 @@ export declare class BoxToolbar {
8
8
  private placement;
9
9
  private buttonItemList;
10
10
  private dropdownItemList;
11
+ private dropdownList;
11
12
  container: Nodes;
12
13
  constructor(config: BoxToolbarConfig);
13
14
  private appendDivider;
14
15
  private appendButton;
15
16
  private appendDropdown;
16
- updatePosition(): void;
17
+ position(): void;
17
18
  render(): void;
18
19
  unmount(): void;
19
20
  }