@worktile/theia 19.5.0-next.3 → 19.5.0-next.5

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.
@@ -30,6 +30,8 @@ export declare const HeaderLevelMap: {
30
30
  "heading-two": number;
31
31
  "heading-three": number;
32
32
  "heading-four": number;
33
+ "heading-five": number;
34
+ "heading-six": number;
33
35
  };
34
36
  export declare enum Alignment {
35
37
  left = "left",
@@ -95,7 +95,9 @@ const HeaderLevelMap = {
95
95
  [ElementKinds.heading_1]: 0,
96
96
  [ElementKinds.heading_2]: 1,
97
97
  [ElementKinds.heading_3]: 2,
98
- [ElementKinds.heading_4]: 3
98
+ [ElementKinds.heading_4]: 3,
99
+ [ElementKinds.heading_5]: 4,
100
+ [ElementKinds.heading_6]: 5
99
101
  };
100
102
  var Alignment;
101
103
  (function (Alignment) {
@@ -196,9 +198,11 @@ const STANDARD_HEADING_TYPES = [
196
198
  ElementKinds.heading_1,
197
199
  ElementKinds.heading_2,
198
200
  ElementKinds.heading_3,
199
- ElementKinds.heading_4
201
+ ElementKinds.heading_4,
202
+ ElementKinds.heading_5,
203
+ ElementKinds.heading_6
200
204
  ];
201
- const HEADING_TYPES = [...STANDARD_HEADING_TYPES, ElementKinds.heading_5, ElementKinds.heading_6];
205
+ const HEADING_TYPES = [...STANDARD_HEADING_TYPES];
202
206
  const ALIGN_BLOCK_TYPES = [ElementKinds.default, ElementKinds.listItem, ElementKinds.image, ...HEADING_TYPES];
203
207
  const CONTAINER_BLOCKS = [ElementKinds.blockquote, ElementKinds.tableCell];
204
208
  const LIST_BLOCK_TYPES = [ElementKinds.numberedList, ElementKinds.bulletedList];
@@ -3066,6 +3070,10 @@ var zhHansLocale = {
3066
3070
  heading3Desc: '插入三级标题',
3067
3071
  heading4: '标题4',
3068
3072
  heading4Desc: '插入四级标题',
3073
+ heading5: '标题5',
3074
+ heading5Desc: '插入五级标题',
3075
+ heading6: '标题6',
3076
+ heading6Desc: '插入六级标题',
3069
3077
  divider: '分割线',
3070
3078
  dividerDesc: '使用水平线分隔内容',
3071
3079
  image: '图片',
@@ -3167,6 +3175,10 @@ var zhHantLocale = {
3167
3175
  heading3Desc: '插入三級標題',
3168
3176
  heading4: '標題4',
3169
3177
  heading4Desc: '插入四級標題',
3178
+ heading5: '標題5',
3179
+ heading5Desc: '插入五級標題',
3180
+ heading6: '標題6',
3181
+ heading6Desc: '插入六級標題',
3170
3182
  divider: '分隔線',
3171
3183
  dividerDesc: '使用水平線分隔內容',
3172
3184
  image: '圖片',
@@ -3268,6 +3280,10 @@ var enUsLocale = {
3268
3280
  heading3Desc: 'Insert heading 3',
3269
3281
  heading4: 'Heading 4',
3270
3282
  heading4Desc: 'Insert heading 4',
3283
+ heading5: 'Heading 5',
3284
+ heading5Desc: 'Insert heading 5',
3285
+ heading6: 'Heading 6',
3286
+ heading6Desc: 'Insert heading 6',
3271
3287
  divider: 'Divider',
3272
3288
  dividerDesc: 'Insert horizontal divider',
3273
3289
  image: 'Image',
@@ -3369,6 +3385,10 @@ var jaJpLocale = {
3369
3385
  heading3Desc: '見出し3を挿入',
3370
3386
  heading4: '見出し4',
3371
3387
  heading4Desc: '見出し4を挿入',
3388
+ heading5: '見出し5',
3389
+ heading5Desc: '見出し5を挿入',
3390
+ heading6: '見出し6',
3391
+ heading6Desc: '見出し6を挿入',
3372
3392
  divider: '区切り線',
3373
3393
  dividerDesc: '水平線を挿入',
3374
3394
  image: '画像',
@@ -3470,6 +3490,10 @@ var deDeLocale = {
3470
3490
  heading3Desc: 'Überschrift 3 einfügen',
3471
3491
  heading4: 'Überschrift 4',
3472
3492
  heading4Desc: 'Überschrift 4 einfügen',
3493
+ heading5: 'Überschrift 5',
3494
+ heading5Desc: 'Überschrift 5 einfügen',
3495
+ heading6: 'Überschrift 6',
3496
+ heading6Desc: 'Überschrift 6 einfügen',
3473
3497
  divider: 'Trennlinie',
3474
3498
  dividerDesc: 'Horizontale Linie einfügen',
3475
3499
  image: 'Bild',
@@ -3571,6 +3595,10 @@ var ruRuLocale = {
3571
3595
  heading3Desc: 'Вставить заголовок 3',
3572
3596
  heading4: 'Заголовок 4',
3573
3597
  heading4Desc: 'Вставить заголовок 4',
3598
+ heading5: 'Заголовок 5',
3599
+ heading5Desc: 'Вставить заголовок 5',
3600
+ heading6: 'Заголовок 6',
3601
+ heading6Desc: 'Вставить заголовок 6',
3574
3602
  divider: 'Разделитель',
3575
3603
  dividerDesc: 'Вставить горизонтальную линию',
3576
3604
  image: 'Изображение',
@@ -11317,6 +11345,22 @@ const createHeadingPlugin = (locale) => createPluginFactory({
11317
11345
  styles: { height: '30px', fontSize: '16px' },
11318
11346
  execute: editor => HeadingEditor.setHeading(editor, ElementKinds.heading_4),
11319
11347
  active: editor => HeadingEditor.isHeadingActive(editor, ElementKinds.heading_4)
11348
+ },
11349
+ {
11350
+ key: ElementKinds.heading_5,
11351
+ icon: 'header-5',
11352
+ name: locale().heading5,
11353
+ styles: { height: '26px', fontSize: '12px' },
11354
+ execute: editor => HeadingEditor.setHeading(editor, ElementKinds.heading_5),
11355
+ active: editor => HeadingEditor.isHeadingActive(editor, ElementKinds.heading_5)
11356
+ },
11357
+ {
11358
+ key: ElementKinds.heading_6,
11359
+ icon: 'header-6',
11360
+ name: locale().heading6,
11361
+ styles: { height: '22px', fontSize: '10px' },
11362
+ execute: editor => HeadingEditor.setHeading(editor, ElementKinds.heading_6),
11363
+ active: editor => HeadingEditor.isHeadingActive(editor, ElementKinds.heading_6)
11320
11364
  }
11321
11365
  ],
11322
11366
  menuItems: [
@@ -11367,6 +11411,28 @@ const createHeadingPlugin = (locale) => createPluginFactory({
11367
11411
  displayKey: '/h4',
11368
11412
  menuIcon: PluginMenuIcons.heading_4,
11369
11413
  keywords: `h,H,bt,heading4,BT,h4,${locale().heading4}`
11414
+ },
11415
+ {
11416
+ key: ElementKinds.heading_5,
11417
+ type: ThePluginMenuItemType.icon,
11418
+ execute: editor => HeadingEditor.setHeading(editor, ElementKinds.heading_5),
11419
+ active: editor => HeadingEditor.isHeadingActive(editor, ElementKinds.heading_5),
11420
+ name: locale().heading5,
11421
+ icon: 'header-5',
11422
+ description: locale().heading5Desc,
11423
+ displayKey: '/h5',
11424
+ keywords: `h,H,bt,heading5,h5,${locale().heading5}`
11425
+ },
11426
+ {
11427
+ key: ElementKinds.heading_6,
11428
+ type: ThePluginMenuItemType.icon,
11429
+ execute: editor => HeadingEditor.setHeading(editor, ElementKinds.heading_6),
11430
+ active: editor => HeadingEditor.isHeadingActive(editor, ElementKinds.heading_6),
11431
+ name: locale().heading6,
11432
+ icon: 'header-6',
11433
+ description: locale().heading6Desc,
11434
+ displayKey: '/h6',
11435
+ keywords: `h,H,bt,heading6,h6,${locale().heading6}`
11370
11436
  }
11371
11437
  ],
11372
11438
  options: headingOptions
@@ -18229,6 +18295,36 @@ class HeadingFlavour extends TheBaseFlavourElement {
18229
18295
  return document.createElement(`h${level}`);
18230
18296
  }
18231
18297
  }
18298
+ class HeadingOneFlavour extends HeadingFlavour {
18299
+ }
18300
+ class HeadingTwoFlavour extends HeadingFlavour {
18301
+ }
18302
+ class HeadingThreeFlavour extends HeadingFlavour {
18303
+ }
18304
+ class HeadingFourFlavour extends HeadingFlavour {
18305
+ }
18306
+ class HeadingFiveFlavour extends HeadingFlavour {
18307
+ }
18308
+ class HeadingSixFlavour extends HeadingFlavour {
18309
+ }
18310
+ const getHeadingFlavour = (element) => {
18311
+ const type = element.type;
18312
+ switch (type) {
18313
+ case 'heading-one':
18314
+ return HeadingOneFlavour;
18315
+ case 'heading-two':
18316
+ return HeadingTwoFlavour;
18317
+ case 'heading-three':
18318
+ return HeadingThreeFlavour;
18319
+ case 'heading-four':
18320
+ return HeadingFourFlavour;
18321
+ case 'heading-five':
18322
+ return HeadingFiveFlavour;
18323
+ case 'heading-six':
18324
+ return HeadingSixFlavour;
18325
+ }
18326
+ return HeadingFlavour;
18327
+ };
18232
18328
 
18233
18329
  class TextFlavour extends DefaultTextFlavour {
18234
18330
  constructor() {
@@ -18322,7 +18418,7 @@ class TheEditorComponent {
18322
18418
  return ParagraphFlavour;
18323
18419
  }
18324
18420
  if (isHeadingElement(element)) {
18325
- return HeadingFlavour;
18421
+ return getHeadingFlavour(element);
18326
18422
  }
18327
18423
  return null;
18328
18424
  };