@atlaskit/editor-plugin-insert-block 1.12.0 → 1.14.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 (30) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/cjs/plugin.js +36 -5
  3. package/dist/cjs/ui/ElementBrowser/InsertMenu.js +47 -13
  4. package/dist/cjs/ui/ElementRail/index.js +186 -2
  5. package/dist/cjs/ui/ElementRail/useInsertMenuRailItems.js +63 -0
  6. package/dist/cjs/ui/templateOptions.js +128 -57
  7. package/dist/cjs/ui/templates.js +1130 -0
  8. package/dist/es2019/plugin.js +36 -5
  9. package/dist/es2019/ui/ElementBrowser/InsertMenu.js +61 -26
  10. package/dist/es2019/ui/ElementRail/index.js +189 -1
  11. package/dist/es2019/ui/ElementRail/useInsertMenuRailItems.js +54 -0
  12. package/dist/es2019/ui/templateOptions.js +78 -11
  13. package/dist/es2019/ui/templates.js +1118 -0
  14. package/dist/esm/plugin.js +36 -5
  15. package/dist/esm/ui/ElementBrowser/InsertMenu.js +47 -13
  16. package/dist/esm/ui/ElementRail/index.js +185 -2
  17. package/dist/esm/ui/ElementRail/useInsertMenuRailItems.js +56 -0
  18. package/dist/esm/ui/templateOptions.js +128 -57
  19. package/dist/esm/ui/templates.js +1124 -0
  20. package/dist/types/ui/ElementRail/index.d.ts +7 -4
  21. package/dist/types/ui/ElementRail/useInsertMenuRailItems.d.ts +4 -0
  22. package/dist/types/ui/ToolbarInsertBlock/create-items.d.ts +1 -1
  23. package/dist/types/ui/templateOptions.d.ts +3 -1
  24. package/dist/types/ui/templates.d.ts +522 -0
  25. package/dist/types-ts4.5/ui/ElementRail/index.d.ts +7 -4
  26. package/dist/types-ts4.5/ui/ElementRail/useInsertMenuRailItems.d.ts +4 -0
  27. package/dist/types-ts4.5/ui/ToolbarInsertBlock/create-items.d.ts +1 -1
  28. package/dist/types-ts4.5/ui/templateOptions.d.ts +3 -1
  29. package/dist/types-ts4.5/ui/templates.d.ts +522 -0
  30. package/package.json +14 -6
@@ -1,13 +1,16 @@
1
1
  /// <reference types="react" />
2
- import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import { type InsertBlockPlugin } from '../../plugin';
2
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
+ import { type InsertBlockOptions, type InsertBlockPlugin } from '../../plugin';
4
5
  /**
5
6
  * For insert menu in right rail experiment
6
7
  * - Clean up ticket ED-24801
7
8
  */
8
- export declare const InsertMenuRail: ({ api }: {
9
+ export declare const InsertMenuRail: ({ editorView, options, api, }: {
10
+ editorView: EditorView;
11
+ options: InsertBlockOptions;
9
12
  api?: import("@atlaskit/editor-common/types").EditorInjectionAPI<"insertBlock", {
10
- pluginConfiguration: import("../../plugin").InsertBlockOptions | undefined;
13
+ pluginConfiguration: InsertBlockOptions | undefined;
11
14
  dependencies: import("../..").InsertBlockPluginDependencies;
12
15
  actions: {
13
16
  toggleAdditionalMenu: () => void;
@@ -0,0 +1,4 @@
1
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
+ import type { InsertBlockOptions, insertBlockPlugin } from '../../plugin';
4
+ export declare const useInsertMenuRailItems: (editorView: EditorView, options: InsertBlockOptions, api?: ExtractInjectionAPI<typeof insertBlockPlugin>) => import("../ToolbarInsertBlock/create-items").BlockMenuItem[];
@@ -28,7 +28,7 @@ export interface CreateItemsConfig {
28
28
  showElementBrowserLink?: boolean;
29
29
  expandEnabled?: boolean;
30
30
  insertMenuItems?: MenuItem[];
31
- emojiProvider?: Promise<EmojiProvider>;
31
+ emojiProvider?: Promise<EmojiProvider> | EmojiProvider;
32
32
  schema: Schema;
33
33
  numberOfButtons: number;
34
34
  formatMessage: WrappedComponentProps['intl']['formatMessage'];
@@ -1,2 +1,4 @@
1
1
  import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
2
- export declare const templateOptions: QuickInsertItem[];
2
+ import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
+ import { type InsertBlockPlugin } from '../plugin';
4
+ export declare const templateOptions: (api: ExtractInjectionAPI<InsertBlockPlugin> | undefined) => QuickInsertItem[];
@@ -0,0 +1,522 @@
1
+ export declare const discussionNotes: (tableWidth: number) => ({
2
+ type: string;
3
+ attrs: {
4
+ panelType: string;
5
+ panelIcon: string;
6
+ panelIconId: string;
7
+ panelIconText: string;
8
+ panelColor: string;
9
+ isNumberColumnEnabled?: undefined;
10
+ layout?: undefined;
11
+ localId?: undefined;
12
+ width?: undefined;
13
+ };
14
+ content: {
15
+ type: string;
16
+ content: ({
17
+ type: string;
18
+ text: string;
19
+ marks?: undefined;
20
+ } | {
21
+ type: string;
22
+ text: string;
23
+ marks: {
24
+ type: string;
25
+ }[];
26
+ } | {
27
+ type: string;
28
+ text: string;
29
+ marks: {
30
+ type: string;
31
+ attrs: {
32
+ href: string;
33
+ };
34
+ }[];
35
+ })[];
36
+ }[];
37
+ } | {
38
+ type: string;
39
+ attrs: {
40
+ isNumberColumnEnabled: boolean;
41
+ layout: string;
42
+ localId: string;
43
+ width: number;
44
+ panelType?: undefined;
45
+ panelIcon?: undefined;
46
+ panelIconId?: undefined;
47
+ panelIconText?: undefined;
48
+ panelColor?: undefined;
49
+ };
50
+ content: ({
51
+ type: string;
52
+ content: {
53
+ type: string;
54
+ attrs: {};
55
+ content: {
56
+ type: string;
57
+ content: {
58
+ type: string;
59
+ text: string;
60
+ marks: {
61
+ type: string;
62
+ }[];
63
+ }[];
64
+ }[];
65
+ }[];
66
+ } | {
67
+ type: string;
68
+ content: ({
69
+ type: string;
70
+ attrs: {};
71
+ content: {
72
+ type: string;
73
+ content: ({
74
+ type: string;
75
+ attrs: {
76
+ timestamp: string;
77
+ };
78
+ text?: undefined;
79
+ } | {
80
+ type: string;
81
+ text: string;
82
+ attrs?: undefined;
83
+ })[];
84
+ }[];
85
+ } | {
86
+ type: string;
87
+ attrs: {};
88
+ content: ({
89
+ type: string;
90
+ attrs: {
91
+ localId: string;
92
+ };
93
+ content: {
94
+ type: string;
95
+ attrs: {
96
+ localId: string;
97
+ state: string;
98
+ };
99
+ content: {
100
+ type: string;
101
+ text: string;
102
+ }[];
103
+ }[];
104
+ } | {
105
+ type: string;
106
+ attrs: {
107
+ localId: string;
108
+ };
109
+ content: {
110
+ type: string;
111
+ attrs: {
112
+ localId: string;
113
+ state: string;
114
+ };
115
+ }[];
116
+ })[];
117
+ })[];
118
+ })[];
119
+ })[];
120
+ export declare const approvalsTracker: (tableWidth: number) => ({
121
+ type: string;
122
+ attrs: {
123
+ panelType: string;
124
+ panelIcon: string;
125
+ panelIconId: string;
126
+ panelIconText: string;
127
+ panelColor: string;
128
+ isNumberColumnEnabled?: undefined;
129
+ layout?: undefined;
130
+ localId?: undefined;
131
+ width?: undefined;
132
+ };
133
+ content: {
134
+ type: string;
135
+ content: ({
136
+ type: string;
137
+ text: string;
138
+ marks?: undefined;
139
+ } | {
140
+ type: string;
141
+ text: string;
142
+ marks: {
143
+ type: string;
144
+ }[];
145
+ } | {
146
+ type: string;
147
+ text: string;
148
+ marks: {
149
+ type: string;
150
+ attrs: {
151
+ href: string;
152
+ };
153
+ }[];
154
+ })[];
155
+ }[];
156
+ } | {
157
+ type: string;
158
+ attrs: {
159
+ isNumberColumnEnabled: boolean;
160
+ layout: string;
161
+ localId: string;
162
+ width: number;
163
+ panelType?: undefined;
164
+ panelIcon?: undefined;
165
+ panelIconId?: undefined;
166
+ panelIconText?: undefined;
167
+ panelColor?: undefined;
168
+ };
169
+ content: ({
170
+ type: string;
171
+ content: {
172
+ type: string;
173
+ attrs: {};
174
+ content: {
175
+ type: string;
176
+ content: {
177
+ type: string;
178
+ text: string;
179
+ marks: {
180
+ type: string;
181
+ }[];
182
+ }[];
183
+ }[];
184
+ }[];
185
+ } | {
186
+ type: string;
187
+ content: ({
188
+ type: string;
189
+ attrs: {};
190
+ content: {
191
+ type: string;
192
+ content: {
193
+ type: string;
194
+ text: string;
195
+ }[];
196
+ }[];
197
+ } | {
198
+ type: string;
199
+ attrs: {};
200
+ content: {
201
+ type: string;
202
+ attrs: {
203
+ localId: string;
204
+ };
205
+ content: {
206
+ type: string;
207
+ attrs: {
208
+ localId: string;
209
+ state: string;
210
+ };
211
+ content: ({
212
+ type: string;
213
+ text: string;
214
+ attrs?: undefined;
215
+ } | {
216
+ type: string;
217
+ attrs: {
218
+ timestamp: string;
219
+ };
220
+ text?: undefined;
221
+ })[];
222
+ }[];
223
+ }[];
224
+ })[];
225
+ })[];
226
+ })[];
227
+ export declare const decisionMatrix: (tableWidth: number) => ({
228
+ type: string;
229
+ attrs: {
230
+ panelType: string;
231
+ panelIcon: string;
232
+ panelIconId: string;
233
+ panelIconText: string;
234
+ panelColor: string;
235
+ isNumberColumnEnabled?: undefined;
236
+ layout?: undefined;
237
+ localId?: undefined;
238
+ width?: undefined;
239
+ };
240
+ content: {
241
+ type: string;
242
+ content: ({
243
+ type: string;
244
+ text: string;
245
+ marks?: undefined;
246
+ } | {
247
+ type: string;
248
+ text: string;
249
+ marks: {
250
+ type: string;
251
+ }[];
252
+ } | {
253
+ type: string;
254
+ text: string;
255
+ marks: {
256
+ type: string;
257
+ attrs: {
258
+ href: string;
259
+ };
260
+ }[];
261
+ })[];
262
+ }[];
263
+ } | {
264
+ type: string;
265
+ attrs: {
266
+ isNumberColumnEnabled: boolean;
267
+ layout: string;
268
+ localId: string;
269
+ width: number;
270
+ panelType?: undefined;
271
+ panelIcon?: undefined;
272
+ panelIconId?: undefined;
273
+ panelIconText?: undefined;
274
+ panelColor?: undefined;
275
+ };
276
+ content: ({
277
+ type: string;
278
+ content: {
279
+ type: string;
280
+ attrs: {
281
+ background: string;
282
+ };
283
+ content: {
284
+ type: string;
285
+ content: ({
286
+ type: string;
287
+ text: string;
288
+ marks: {
289
+ type: string;
290
+ }[];
291
+ attrs?: undefined;
292
+ } | {
293
+ type: string;
294
+ attrs: {
295
+ text: string;
296
+ color: string;
297
+ localId: string;
298
+ style: string;
299
+ };
300
+ text?: undefined;
301
+ marks?: undefined;
302
+ })[];
303
+ marks: {
304
+ type: string;
305
+ attrs: {
306
+ align: string;
307
+ };
308
+ }[];
309
+ }[];
310
+ }[];
311
+ } | {
312
+ type: string;
313
+ content: ({
314
+ type: string;
315
+ attrs: {
316
+ background: string;
317
+ };
318
+ content: {
319
+ type: string;
320
+ content: {
321
+ type: string;
322
+ text: string;
323
+ marks: {
324
+ type: string;
325
+ }[];
326
+ }[];
327
+ }[];
328
+ } | {
329
+ type: string;
330
+ attrs: {
331
+ background?: undefined;
332
+ };
333
+ content: {
334
+ type: string;
335
+ content: ({
336
+ type: string;
337
+ attrs: {
338
+ shortName: string;
339
+ id: string;
340
+ text: string;
341
+ };
342
+ text?: undefined;
343
+ } | {
344
+ type: string;
345
+ text: string;
346
+ attrs?: undefined;
347
+ })[];
348
+ }[];
349
+ })[];
350
+ })[];
351
+ } | {
352
+ type: string;
353
+ content: never[];
354
+ attrs?: undefined;
355
+ })[];
356
+ export declare const actionList: ({
357
+ type: string;
358
+ attrs: {
359
+ panelType: string;
360
+ panelIcon: string;
361
+ panelIconId: string;
362
+ panelIconText: string;
363
+ panelColor: string;
364
+ localId?: undefined;
365
+ };
366
+ content: {
367
+ type: string;
368
+ content: ({
369
+ type: string;
370
+ text: string;
371
+ marks?: undefined;
372
+ } | {
373
+ type: string;
374
+ text: string;
375
+ marks: {
376
+ type: string;
377
+ }[];
378
+ } | {
379
+ type: string;
380
+ text: string;
381
+ marks: {
382
+ type: string;
383
+ attrs: {
384
+ href: string;
385
+ };
386
+ }[];
387
+ })[];
388
+ }[];
389
+ } | {
390
+ type: string;
391
+ attrs: {
392
+ localId: string;
393
+ panelType?: undefined;
394
+ panelIcon?: undefined;
395
+ panelIconId?: undefined;
396
+ panelIconText?: undefined;
397
+ panelColor?: undefined;
398
+ };
399
+ content: {
400
+ type: string;
401
+ attrs: {
402
+ localId: string;
403
+ state: string;
404
+ };
405
+ content: ({
406
+ type: string;
407
+ text: string;
408
+ attrs?: undefined;
409
+ } | {
410
+ type: string;
411
+ attrs: {
412
+ timestamp: string;
413
+ };
414
+ text?: undefined;
415
+ })[];
416
+ }[];
417
+ })[];
418
+ export declare const instructionsOutline: ({
419
+ type: string;
420
+ attrs: {
421
+ panelType: string;
422
+ panelIcon: string;
423
+ panelIconId: string;
424
+ panelIconText: string;
425
+ panelColor: string;
426
+ order?: undefined;
427
+ title?: undefined;
428
+ };
429
+ content: {
430
+ type: string;
431
+ content: ({
432
+ type: string;
433
+ text: string;
434
+ marks?: undefined;
435
+ } | {
436
+ type: string;
437
+ text: string;
438
+ marks: {
439
+ type: string;
440
+ }[];
441
+ } | {
442
+ type: string;
443
+ text: string;
444
+ marks: {
445
+ type: string;
446
+ attrs: {
447
+ href: string;
448
+ };
449
+ }[];
450
+ })[];
451
+ }[];
452
+ } | {
453
+ type: string;
454
+ attrs: {
455
+ order: number;
456
+ panelType?: undefined;
457
+ panelIcon?: undefined;
458
+ panelIconId?: undefined;
459
+ panelIconText?: undefined;
460
+ panelColor?: undefined;
461
+ title?: undefined;
462
+ };
463
+ content: {
464
+ type: string;
465
+ content: {
466
+ type: string;
467
+ content: {
468
+ type: string;
469
+ text: string;
470
+ }[];
471
+ }[];
472
+ }[];
473
+ } | {
474
+ type: string;
475
+ content: {
476
+ type: string;
477
+ attrs: {
478
+ width: number;
479
+ };
480
+ content: {
481
+ type: string;
482
+ content: {
483
+ type: string;
484
+ text: string;
485
+ }[];
486
+ }[];
487
+ }[];
488
+ attrs?: undefined;
489
+ } | {
490
+ type: string;
491
+ attrs: {
492
+ panelType: string;
493
+ panelIcon?: undefined;
494
+ panelIconId?: undefined;
495
+ panelIconText?: undefined;
496
+ panelColor?: undefined;
497
+ order?: undefined;
498
+ title?: undefined;
499
+ };
500
+ content: {
501
+ type: string;
502
+ content: {
503
+ type: string;
504
+ text: string;
505
+ }[];
506
+ }[];
507
+ } | {
508
+ type: string;
509
+ attrs: {
510
+ title: string;
511
+ panelType?: undefined;
512
+ panelIcon?: undefined;
513
+ panelIconId?: undefined;
514
+ panelIconText?: undefined;
515
+ panelColor?: undefined;
516
+ order?: undefined;
517
+ };
518
+ content: {
519
+ type: string;
520
+ content: never[];
521
+ }[];
522
+ })[];
@@ -1,13 +1,16 @@
1
1
  /// <reference types="react" />
2
- import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import { type InsertBlockPlugin } from '../../plugin';
2
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
+ import { type InsertBlockOptions, type InsertBlockPlugin } from '../../plugin';
4
5
  /**
5
6
  * For insert menu in right rail experiment
6
7
  * - Clean up ticket ED-24801
7
8
  */
8
- export declare const InsertMenuRail: ({ api }: {
9
+ export declare const InsertMenuRail: ({ editorView, options, api, }: {
10
+ editorView: EditorView;
11
+ options: InsertBlockOptions;
9
12
  api?: import("@atlaskit/editor-common/types").EditorInjectionAPI<"insertBlock", {
10
- pluginConfiguration: import("../../plugin").InsertBlockOptions | undefined;
13
+ pluginConfiguration: InsertBlockOptions | undefined;
11
14
  dependencies: import("../..").InsertBlockPluginDependencies;
12
15
  actions: {
13
16
  toggleAdditionalMenu: () => void;
@@ -0,0 +1,4 @@
1
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
+ import type { InsertBlockOptions, insertBlockPlugin } from '../../plugin';
4
+ export declare const useInsertMenuRailItems: (editorView: EditorView, options: InsertBlockOptions, api?: ExtractInjectionAPI<typeof insertBlockPlugin>) => import("../ToolbarInsertBlock/create-items").BlockMenuItem[];
@@ -28,7 +28,7 @@ export interface CreateItemsConfig {
28
28
  showElementBrowserLink?: boolean;
29
29
  expandEnabled?: boolean;
30
30
  insertMenuItems?: MenuItem[];
31
- emojiProvider?: Promise<EmojiProvider>;
31
+ emojiProvider?: Promise<EmojiProvider> | EmojiProvider;
32
32
  schema: Schema;
33
33
  numberOfButtons: number;
34
34
  formatMessage: WrappedComponentProps['intl']['formatMessage'];
@@ -1,2 +1,4 @@
1
1
  import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
2
- export declare const templateOptions: QuickInsertItem[];
2
+ import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
+ import { type InsertBlockPlugin } from '../plugin';
4
+ export declare const templateOptions: (api: ExtractInjectionAPI<InsertBlockPlugin> | undefined) => QuickInsertItem[];