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.
- package/README.md +4 -4
- package/dist/lake.css +45 -36
- package/dist/lake.min.js +37 -29
- package/dist/lake.min.js.map +1 -1
- package/lib/lake.css +45 -36
- package/lib/lake.js +989 -299
- package/lib/lake.js.map +1 -1
- package/lib/types/boxes/code-block.d.ts +2 -1
- package/lib/types/boxes/emoji.d.ts +2 -1
- package/lib/types/boxes/equation.d.ts +2 -1
- package/lib/types/boxes/file.d.ts +2 -1
- package/lib/types/boxes/hr.d.ts +2 -1
- package/lib/types/boxes/image.d.ts +2 -1
- package/lib/types/boxes/video.d.ts +2 -1
- package/lib/types/config/slash-items.d.ts +2 -0
- package/lib/types/css/index.d.ts +1 -1
- package/lib/types/editor.d.ts +3 -0
- package/lib/types/i18n/en-US/index.d.ts +36 -0
- package/lib/types/i18n/ja/index.d.ts +36 -0
- package/lib/types/i18n/ko/index.d.ts +36 -0
- package/lib/types/i18n/types.d.ts +278 -2
- package/lib/types/i18n/zh-CN/index.d.ts +36 -0
- package/lib/types/index.d.ts +3 -2
- package/lib/types/managers/keystroke.d.ts +0 -1
- package/lib/types/managers/plugin.d.ts +4 -5
- package/lib/types/managers/selection.d.ts +1 -1
- package/lib/types/models/box.d.ts +1 -1
- package/lib/types/models/nodes.d.ts +2 -0
- package/lib/types/plugins/slash.d.ts +3 -0
- package/lib/types/types/plugin.d.ts +3 -0
- package/lib/types/types/{commands.d.ts → slash.d.ts} +4 -4
- package/lib/types/ui/box-toolbar.d.ts +2 -1
- package/lib/types/ui/dropdown.d.ts +1 -0
- package/lib/types/ui/link-popup.d.ts +2 -3
- package/lib/types/ui/slash-popup.d.ts +34 -0
- package/lib/types/ui/toolbar.d.ts +5 -3
- package/lib/types/utils/index.d.ts +2 -1
- package/lib/types/utils/{node-and-view.d.ts → node-position.d.ts} +1 -1
- package/lib/types/utils/scroll-to-node.d.ts +2 -0
- package/package.json +1 -1
- package/lib/types/ui/commands-popup.d.ts +0 -24
package/lib/types/boxes/hr.d.ts
CHANGED
package/lib/types/css/index.d.ts
CHANGED
package/lib/types/editor.d.ts
CHANGED
|
@@ -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
|
+
* Heading 1
|
|
201
|
+
*/
|
|
202
|
+
heading1: string;
|
|
203
|
+
/**
|
|
204
|
+
* Create a heading level 1
|
|
205
|
+
*/
|
|
206
|
+
heading1Desc: string;
|
|
207
|
+
/**
|
|
208
|
+
* Heading 2
|
|
209
|
+
*/
|
|
210
|
+
heading2: string;
|
|
211
|
+
/**
|
|
212
|
+
* Create a heading level 2
|
|
213
|
+
*/
|
|
214
|
+
heading2Desc: string;
|
|
215
|
+
/**
|
|
216
|
+
* Heading 3
|
|
217
|
+
*/
|
|
218
|
+
heading3: string;
|
|
219
|
+
/**
|
|
220
|
+
* Create a heading level 3
|
|
221
|
+
*/
|
|
222
|
+
heading3Desc: string;
|
|
223
|
+
/**
|
|
224
|
+
* Heading 4
|
|
225
|
+
*/
|
|
226
|
+
heading4: string;
|
|
227
|
+
/**
|
|
228
|
+
* Create a heading level 4
|
|
229
|
+
*/
|
|
230
|
+
heading4Desc: string;
|
|
231
|
+
/**
|
|
232
|
+
* Heading 5
|
|
233
|
+
*/
|
|
234
|
+
heading5: string;
|
|
235
|
+
/**
|
|
236
|
+
* Create a heading level 5
|
|
237
|
+
*/
|
|
238
|
+
heading5Desc: string;
|
|
239
|
+
/**
|
|
240
|
+
* Heading 6
|
|
241
|
+
*/
|
|
242
|
+
heading6: string;
|
|
243
|
+
/**
|
|
244
|
+
* Create a heading level 6
|
|
245
|
+
*/
|
|
246
|
+
heading6Desc: string;
|
|
247
|
+
/**
|
|
248
|
+
* Paragraph
|
|
249
|
+
*/
|
|
250
|
+
paragraph: string;
|
|
251
|
+
/**
|
|
252
|
+
* Create a paragraph
|
|
253
|
+
*/
|
|
254
|
+
paragraphDesc: string;
|
|
255
|
+
/**
|
|
256
|
+
* Block quotation
|
|
257
|
+
*/
|
|
258
|
+
blockQuote: string;
|
|
259
|
+
/**
|
|
260
|
+
* Create a block quotation
|
|
261
|
+
*/
|
|
262
|
+
blockQuoteDesc: string;
|
|
263
|
+
/**
|
|
264
|
+
* Numbered list
|
|
265
|
+
*/
|
|
266
|
+
numberedList: string;
|
|
267
|
+
/**
|
|
268
|
+
* Create a numbered list
|
|
269
|
+
*/
|
|
270
|
+
numberedListDesc: string;
|
|
271
|
+
/**
|
|
272
|
+
* Bulleted list
|
|
273
|
+
*/
|
|
274
|
+
bulletedList: string;
|
|
275
|
+
/**
|
|
276
|
+
* Create a bulleted list
|
|
277
|
+
*/
|
|
278
|
+
bulletedListDesc: string;
|
|
279
|
+
/**
|
|
280
|
+
* Checklist
|
|
281
|
+
*/
|
|
282
|
+
checklist: string;
|
|
283
|
+
/**
|
|
284
|
+
* Create a checklist
|
|
285
|
+
*/
|
|
286
|
+
checklistDesc: string;
|
|
287
|
+
/**
|
|
288
|
+
* Horizontal line
|
|
289
|
+
*/
|
|
290
|
+
hr: string;
|
|
291
|
+
/**
|
|
292
|
+
* Insert a horizontal line
|
|
293
|
+
*/
|
|
294
|
+
hrDesc: string;
|
|
295
|
+
/**
|
|
296
|
+
* Code block
|
|
297
|
+
*/
|
|
298
|
+
codeBlock: string;
|
|
299
|
+
/**
|
|
300
|
+
* Insert a code block
|
|
301
|
+
*/
|
|
302
|
+
codeBlockDesc: string;
|
|
303
|
+
/**
|
|
304
|
+
* Video
|
|
305
|
+
*/
|
|
306
|
+
video: string;
|
|
307
|
+
/**
|
|
308
|
+
* Insert a video from YouTube
|
|
309
|
+
*/
|
|
310
|
+
videoDesc: string;
|
|
311
|
+
/**
|
|
312
|
+
* Equation
|
|
313
|
+
*/
|
|
314
|
+
equation: string;
|
|
315
|
+
/**
|
|
316
|
+
* Insert TeX expression in text
|
|
317
|
+
*/
|
|
318
|
+
equationDesc: string;
|
|
319
|
+
/**
|
|
320
|
+
* Image
|
|
321
|
+
*/
|
|
322
|
+
image: string;
|
|
323
|
+
/**
|
|
324
|
+
* Upload an image
|
|
325
|
+
*/
|
|
326
|
+
imageDesc: string;
|
|
327
|
+
/**
|
|
328
|
+
* File
|
|
329
|
+
*/
|
|
330
|
+
file: string;
|
|
331
|
+
/**
|
|
332
|
+
* Upload a file
|
|
333
|
+
*/
|
|
334
|
+
fileDesc: string;
|
|
335
|
+
};
|
|
198
336
|
link: {
|
|
199
337
|
/**
|
|
200
338
|
* New link
|
|
@@ -303,7 +441,7 @@ type RootTranslation = {
|
|
|
303
441
|
*/
|
|
304
442
|
save: string;
|
|
305
443
|
/**
|
|
306
|
-
* Type a
|
|
444
|
+
* Type a TeX expression
|
|
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
|
|
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;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -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
|
-
|
|
2
|
+
import { InitializePlugin, UnmountPlugin } from '../types/plugin';
|
|
3
3
|
export declare class Plugin {
|
|
4
|
-
private
|
|
5
|
-
add(plugin:
|
|
6
|
-
loadAll(editor: Editor):
|
|
4
|
+
private pluginMap;
|
|
5
|
+
add(name: string, plugin: InitializePlugin): void;
|
|
6
|
+
loadAll(editor: Editor): Map<string, UnmountPlugin>;
|
|
7
7
|
}
|
|
8
|
-
export {};
|
|
@@ -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
|
|
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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Editor } from '../editor';
|
|
2
2
|
import { TranslationFunctions } from '../i18n/types';
|
|
3
|
-
export type
|
|
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
|
|
11
|
+
export type SlashUploadItem = {
|
|
12
12
|
name: string;
|
|
13
13
|
type: 'upload';
|
|
14
|
-
icon
|
|
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
|
|
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
|
-
|
|
17
|
+
position(): void;
|
|
17
18
|
render(): void;
|
|
18
19
|
unmount(): void;
|
|
19
20
|
}
|