@worktile/theia 19.5.0-next.6 → 19.5.0-prod.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.
- package/constants/node-types.d.ts +0 -2
- package/fesm2022/worktile-theia.mjs +17 -81
- package/fesm2022/worktile-theia.mjs.map +1 -1
- package/i18n/i18n.d.ts +0 -4
- package/i18n/locales/de-de.d.ts +0 -4
- package/i18n/locales/en-us.d.ts +0 -4
- package/i18n/locales/ja-jp.d.ts +0 -4
- package/i18n/locales/ru-ru.d.ts +0 -4
- package/i18n/locales/zh-hans.d.ts +0 -4
- package/i18n/locales/zh-hant.d.ts +0 -4
- package/package.json +1 -1
|
@@ -95,9 +95,7 @@ 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
|
|
99
|
-
[ElementKinds.heading_5]: 4,
|
|
100
|
-
[ElementKinds.heading_6]: 5
|
|
98
|
+
[ElementKinds.heading_4]: 3
|
|
101
99
|
};
|
|
102
100
|
var Alignment;
|
|
103
101
|
(function (Alignment) {
|
|
@@ -198,11 +196,9 @@ const STANDARD_HEADING_TYPES = [
|
|
|
198
196
|
ElementKinds.heading_1,
|
|
199
197
|
ElementKinds.heading_2,
|
|
200
198
|
ElementKinds.heading_3,
|
|
201
|
-
ElementKinds.heading_4
|
|
202
|
-
ElementKinds.heading_5,
|
|
203
|
-
ElementKinds.heading_6
|
|
199
|
+
ElementKinds.heading_4
|
|
204
200
|
];
|
|
205
|
-
const HEADING_TYPES = [...STANDARD_HEADING_TYPES];
|
|
201
|
+
const HEADING_TYPES = [...STANDARD_HEADING_TYPES, ElementKinds.heading_5, ElementKinds.heading_6];
|
|
206
202
|
const ALIGN_BLOCK_TYPES = [ElementKinds.default, ElementKinds.listItem, ElementKinds.image, ...HEADING_TYPES];
|
|
207
203
|
const CONTAINER_BLOCKS = [ElementKinds.blockquote, ElementKinds.tableCell];
|
|
208
204
|
const LIST_BLOCK_TYPES = [ElementKinds.numberedList, ElementKinds.bulletedList];
|
|
@@ -3070,10 +3066,6 @@ var zhHansLocale = {
|
|
|
3070
3066
|
heading3Desc: '插入三级标题',
|
|
3071
3067
|
heading4: '标题4',
|
|
3072
3068
|
heading4Desc: '插入四级标题',
|
|
3073
|
-
heading5: '标题5',
|
|
3074
|
-
heading5Desc: '插入五级标题',
|
|
3075
|
-
heading6: '标题6',
|
|
3076
|
-
heading6Desc: '插入六级标题',
|
|
3077
3069
|
divider: '分割线',
|
|
3078
3070
|
dividerDesc: '使用水平线分隔内容',
|
|
3079
3071
|
image: '图片',
|
|
@@ -3175,10 +3167,6 @@ var zhHantLocale = {
|
|
|
3175
3167
|
heading3Desc: '插入三級標題',
|
|
3176
3168
|
heading4: '標題4',
|
|
3177
3169
|
heading4Desc: '插入四級標題',
|
|
3178
|
-
heading5: '標題5',
|
|
3179
|
-
heading5Desc: '插入五級標題',
|
|
3180
|
-
heading6: '標題6',
|
|
3181
|
-
heading6Desc: '插入六級標題',
|
|
3182
3170
|
divider: '分隔線',
|
|
3183
3171
|
dividerDesc: '使用水平線分隔內容',
|
|
3184
3172
|
image: '圖片',
|
|
@@ -3280,10 +3268,6 @@ var enUsLocale = {
|
|
|
3280
3268
|
heading3Desc: 'Insert heading 3',
|
|
3281
3269
|
heading4: 'Heading 4',
|
|
3282
3270
|
heading4Desc: 'Insert heading 4',
|
|
3283
|
-
heading5: 'Heading 5',
|
|
3284
|
-
heading5Desc: 'Insert heading 5',
|
|
3285
|
-
heading6: 'Heading 6',
|
|
3286
|
-
heading6Desc: 'Insert heading 6',
|
|
3287
3271
|
divider: 'Divider',
|
|
3288
3272
|
dividerDesc: 'Insert horizontal divider',
|
|
3289
3273
|
image: 'Image',
|
|
@@ -3385,10 +3369,6 @@ var jaJpLocale = {
|
|
|
3385
3369
|
heading3Desc: '見出し3を挿入',
|
|
3386
3370
|
heading4: '見出し4',
|
|
3387
3371
|
heading4Desc: '見出し4を挿入',
|
|
3388
|
-
heading5: '見出し5',
|
|
3389
|
-
heading5Desc: '見出し5を挿入',
|
|
3390
|
-
heading6: '見出し6',
|
|
3391
|
-
heading6Desc: '見出し6を挿入',
|
|
3392
3372
|
divider: '区切り線',
|
|
3393
3373
|
dividerDesc: '水平線を挿入',
|
|
3394
3374
|
image: '画像',
|
|
@@ -3490,10 +3470,6 @@ var deDeLocale = {
|
|
|
3490
3470
|
heading3Desc: 'Überschrift 3 einfügen',
|
|
3491
3471
|
heading4: 'Überschrift 4',
|
|
3492
3472
|
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',
|
|
3497
3473
|
divider: 'Trennlinie',
|
|
3498
3474
|
dividerDesc: 'Horizontale Linie einfügen',
|
|
3499
3475
|
image: 'Bild',
|
|
@@ -3595,10 +3571,6 @@ var ruRuLocale = {
|
|
|
3595
3571
|
heading3Desc: 'Вставить заголовок 3',
|
|
3596
3572
|
heading4: 'Заголовок 4',
|
|
3597
3573
|
heading4Desc: 'Вставить заголовок 4',
|
|
3598
|
-
heading5: 'Заголовок 5',
|
|
3599
|
-
heading5Desc: 'Вставить заголовок 5',
|
|
3600
|
-
heading6: 'Заголовок 6',
|
|
3601
|
-
heading6Desc: 'Вставить заголовок 6',
|
|
3602
3574
|
divider: 'Разделитель',
|
|
3603
3575
|
dividerDesc: 'Вставить горизонтальную линию',
|
|
3604
3576
|
image: 'Изображение',
|
|
@@ -11232,22 +11204,24 @@ const withHeading = (editor) => {
|
|
|
11232
11204
|
return true;
|
|
11233
11205
|
}
|
|
11234
11206
|
// 如果本身是二级标题,只可能被一级标题影响
|
|
11235
|
-
let minHeadingLevel = headingLevel - 1;
|
|
11207
|
+
let minHeadingLevel = headingLevel !== undefined ? headingLevel - 1 : HeaderLevelMap[ElementKinds.heading_4];
|
|
11236
11208
|
for (let i = index - 1; i >= 0; i--) {
|
|
11237
11209
|
const element = editor.children[i];
|
|
11238
11210
|
if (isHeadingElement(element)) {
|
|
11239
11211
|
const elementHeadingLevel = HeaderLevelMap[element.type];
|
|
11240
|
-
|
|
11241
|
-
|
|
11242
|
-
|
|
11243
|
-
|
|
11244
|
-
|
|
11245
|
-
|
|
11246
|
-
|
|
11247
|
-
|
|
11248
|
-
|
|
11249
|
-
|
|
11250
|
-
|
|
11212
|
+
if (elementHeadingLevel <= minHeadingLevel) {
|
|
11213
|
+
// 遇到一级标题直接退出,无论是否折叠
|
|
11214
|
+
// 其余情况如果是折叠标题,可以直接返回结果,否则需要继续向上查找
|
|
11215
|
+
if (element.type === ElementKinds.heading_1) {
|
|
11216
|
+
return !element.isCollapsed;
|
|
11217
|
+
}
|
|
11218
|
+
else if (element.isCollapsed) {
|
|
11219
|
+
return false;
|
|
11220
|
+
}
|
|
11221
|
+
else {
|
|
11222
|
+
// 遇到未折叠标题,则只能被比它更大的标题影响
|
|
11223
|
+
minHeadingLevel = elementHeadingLevel - 1;
|
|
11224
|
+
}
|
|
11251
11225
|
}
|
|
11252
11226
|
}
|
|
11253
11227
|
}
|
|
@@ -11343,22 +11317,6 @@ const createHeadingPlugin = (locale) => createPluginFactory({
|
|
|
11343
11317
|
styles: { height: '30px', fontSize: '16px' },
|
|
11344
11318
|
execute: editor => HeadingEditor.setHeading(editor, ElementKinds.heading_4),
|
|
11345
11319
|
active: editor => HeadingEditor.isHeadingActive(editor, ElementKinds.heading_4)
|
|
11346
|
-
},
|
|
11347
|
-
{
|
|
11348
|
-
key: ElementKinds.heading_5,
|
|
11349
|
-
icon: 'header-5',
|
|
11350
|
-
name: locale().heading5,
|
|
11351
|
-
styles: { height: '26px', fontSize: '12px' },
|
|
11352
|
-
execute: editor => HeadingEditor.setHeading(editor, ElementKinds.heading_5),
|
|
11353
|
-
active: editor => HeadingEditor.isHeadingActive(editor, ElementKinds.heading_5)
|
|
11354
|
-
},
|
|
11355
|
-
{
|
|
11356
|
-
key: ElementKinds.heading_6,
|
|
11357
|
-
icon: 'header-6',
|
|
11358
|
-
name: locale().heading6,
|
|
11359
|
-
styles: { height: '22px', fontSize: '10px' },
|
|
11360
|
-
execute: editor => HeadingEditor.setHeading(editor, ElementKinds.heading_6),
|
|
11361
|
-
active: editor => HeadingEditor.isHeadingActive(editor, ElementKinds.heading_6)
|
|
11362
11320
|
}
|
|
11363
11321
|
],
|
|
11364
11322
|
menuItems: [
|
|
@@ -11409,28 +11367,6 @@ const createHeadingPlugin = (locale) => createPluginFactory({
|
|
|
11409
11367
|
displayKey: '/h4',
|
|
11410
11368
|
menuIcon: PluginMenuIcons.heading_4,
|
|
11411
11369
|
keywords: `h,H,bt,heading4,BT,h4,${locale().heading4}`
|
|
11412
|
-
},
|
|
11413
|
-
{
|
|
11414
|
-
key: ElementKinds.heading_5,
|
|
11415
|
-
type: ThePluginMenuItemType.icon,
|
|
11416
|
-
execute: editor => HeadingEditor.setHeading(editor, ElementKinds.heading_5),
|
|
11417
|
-
active: editor => HeadingEditor.isHeadingActive(editor, ElementKinds.heading_5),
|
|
11418
|
-
name: locale().heading5,
|
|
11419
|
-
icon: 'header-5',
|
|
11420
|
-
description: locale().heading5Desc,
|
|
11421
|
-
displayKey: '/h5',
|
|
11422
|
-
keywords: `h,H,bt,heading5,h5,${locale().heading5}`
|
|
11423
|
-
},
|
|
11424
|
-
{
|
|
11425
|
-
key: ElementKinds.heading_6,
|
|
11426
|
-
type: ThePluginMenuItemType.icon,
|
|
11427
|
-
execute: editor => HeadingEditor.setHeading(editor, ElementKinds.heading_6),
|
|
11428
|
-
active: editor => HeadingEditor.isHeadingActive(editor, ElementKinds.heading_6),
|
|
11429
|
-
name: locale().heading6,
|
|
11430
|
-
icon: 'header-6',
|
|
11431
|
-
description: locale().heading6Desc,
|
|
11432
|
-
displayKey: '/h6',
|
|
11433
|
-
keywords: `h,H,bt,heading6,h6,${locale().heading6}`
|
|
11434
11370
|
}
|
|
11435
11371
|
],
|
|
11436
11372
|
options: headingOptions
|