@worktile/theia 19.3.2 → 19.3.4
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.
|
@@ -2275,45 +2275,6 @@ const refocus = (editor) => {
|
|
|
2275
2275
|
AngularEditor.focus(editor);
|
|
2276
2276
|
};
|
|
2277
2277
|
|
|
2278
|
-
const getEditableElementHeight = (editor) => {
|
|
2279
|
-
const editable = AngularEditor.toDOMNode(editor, editor);
|
|
2280
|
-
return editable.clientHeight;
|
|
2281
|
-
};
|
|
2282
|
-
|
|
2283
|
-
let previousHeight = 0;
|
|
2284
|
-
/**
|
|
2285
|
-
* reset the sliding distance when the viewport position of the sliding
|
|
2286
|
-
* container coincides with the viewport position of the focus element
|
|
2287
|
-
*/
|
|
2288
|
-
const scrollIntoView = (editor, scrollContainer) => {
|
|
2289
|
-
const isFocused = AngularEditor.isFocused(editor);
|
|
2290
|
-
const nativeSelection = window.getSelection();
|
|
2291
|
-
if (!isFocused || !nativeSelection?.focusNode) {
|
|
2292
|
-
return;
|
|
2293
|
-
}
|
|
2294
|
-
// fix the page scrolling problem when the associated page card and text status switch in the table
|
|
2295
|
-
// the native selection area is abnormal, and the cursor automatically jumps to the left cursor of the block-level element (browser native behavior when switching display)
|
|
2296
|
-
// temporary solution: Determine whether the DOM corresponding to the Slate selection area is equal to the DOM corresponding to the browser selection. If they are not equal, it means an abnormal situation, and automatic scrolling will no longer be performed
|
|
2297
|
-
const domRange = AngularEditor.toDOMRange(editor, editor.selection);
|
|
2298
|
-
if (domRange.startContainer !== nativeSelection.anchorNode) {
|
|
2299
|
-
return;
|
|
2300
|
-
}
|
|
2301
|
-
const currentNodeElement = nativeSelection.focusNode.parentElement;
|
|
2302
|
-
const scrollContainerElement = currentNodeElement.closest(scrollContainer ?? DEFAULT_SCROLL_CONTAINER);
|
|
2303
|
-
if (!scrollContainerElement) {
|
|
2304
|
-
return;
|
|
2305
|
-
}
|
|
2306
|
-
const scrollContainerRect = scrollContainerElement.getBoundingClientRect();
|
|
2307
|
-
const focusBlockRect = currentNodeElement.getBoundingClientRect();
|
|
2308
|
-
const scrollHeight = scrollContainer ? window.innerHeight : scrollContainerRect.bottom;
|
|
2309
|
-
const currentHeight = getEditableElementHeight(editor);
|
|
2310
|
-
const scrollOffset = scrollHeight - focusBlockRect.bottom;
|
|
2311
|
-
if (currentHeight && scrollOffset < 30) {
|
|
2312
|
-
// 16 为底部间隔,防止紧贴底部
|
|
2313
|
-
scrollContainerElement.scrollTop = scrollContainerElement.scrollTop - scrollOffset + 16;
|
|
2314
|
-
}
|
|
2315
|
-
previousHeight = currentHeight;
|
|
2316
|
-
};
|
|
2317
2278
|
const getEditorScrollContainer = (editor, scrollContainerSelector) => {
|
|
2318
2279
|
const selector = scrollContainerSelector || editor.options.scrollContainer || DEFAULT_SCROLL_CONTAINER;
|
|
2319
2280
|
const editable = AngularEditor.toDOMNode(editor, editor);
|
|
@@ -2334,6 +2295,20 @@ const bottomLeftPosition = {
|
|
|
2334
2295
|
overlayY: 'top',
|
|
2335
2296
|
offsetY: 4
|
|
2336
2297
|
};
|
|
2298
|
+
const bottomRightPosition = {
|
|
2299
|
+
originX: 'end',
|
|
2300
|
+
originY: 'bottom',
|
|
2301
|
+
overlayX: 'end',
|
|
2302
|
+
overlayY: 'top',
|
|
2303
|
+
offsetX: 0,
|
|
2304
|
+
offsetY: 4
|
|
2305
|
+
};
|
|
2306
|
+
const topRightPosition = {
|
|
2307
|
+
...bottomRightPosition,
|
|
2308
|
+
originY: 'top',
|
|
2309
|
+
overlayY: 'bottom',
|
|
2310
|
+
offsetY: -4
|
|
2311
|
+
};
|
|
2337
2312
|
const updatePopoverPosition = (overlayRef, origin, positions = []) => {
|
|
2338
2313
|
if (overlayRef) {
|
|
2339
2314
|
const positionStrategy = overlayRef.getConfig().positionStrategy;
|
|
@@ -3533,7 +3508,7 @@ class TheToolbarDropdown extends TheBaseToolbarDropdown {
|
|
|
3533
3508
|
updatePopoverPosition() {
|
|
3534
3509
|
const origin = this.elementRef.nativeElement;
|
|
3535
3510
|
const overlayRef = this.dropdownPopoverRef?.getOverlayRef();
|
|
3536
|
-
updatePopoverPosition(overlayRef, origin, [bottomLeftPosition, topLeftPosition]);
|
|
3511
|
+
updatePopoverPosition(overlayRef, origin, [bottomLeftPosition, bottomRightPosition, topLeftPosition, topRightPosition]);
|
|
3537
3512
|
}
|
|
3538
3513
|
closeDropdownPopover() {
|
|
3539
3514
|
if (this.dropdownPopoverRef) {
|
|
@@ -9992,7 +9967,7 @@ const createColorPlugin = (locale) => createPluginFactory({
|
|
|
9992
9967
|
icon: 'color-tt',
|
|
9993
9968
|
name: locale().fontColor,
|
|
9994
9969
|
type: ToolbarItemType.default,
|
|
9995
|
-
|
|
9970
|
+
width: 48,
|
|
9996
9971
|
iconComponent: TheColorToolbarItem,
|
|
9997
9972
|
active: editor => ColorEditor.getActiveColor(editor, MarkTypes.color)
|
|
9998
9973
|
},
|
|
@@ -10001,7 +9976,7 @@ const createColorPlugin = (locale) => createPluginFactory({
|
|
|
10001
9976
|
icon: 'background-tt',
|
|
10002
9977
|
name: locale().backgroundColor,
|
|
10003
9978
|
type: ToolbarItemType.default,
|
|
10004
|
-
|
|
9979
|
+
width: 48,
|
|
10005
9980
|
iconComponent: TheColorToolbarItem,
|
|
10006
9981
|
active: editor => ColorEditor.getActiveColor(editor, MarkTypes.backgroundColor)
|
|
10007
9982
|
}
|
|
@@ -17405,8 +17380,8 @@ const createTablePlugin = (locale) => createPluginFactory({
|
|
|
17405
17380
|
icon: 'table-border-all',
|
|
17406
17381
|
name: locale().table,
|
|
17407
17382
|
type: ToolbarItemType.default,
|
|
17408
|
-
dropdownMode: DropdownMode.icon,
|
|
17409
17383
|
iconComponent: TheTableToolbarItem,
|
|
17384
|
+
width: 48,
|
|
17410
17385
|
execute: editor => TableEditor.insertTable(editor),
|
|
17411
17386
|
active: editor => TableEditor.isActive(editor)
|
|
17412
17387
|
}
|
|
@@ -18369,5 +18344,5 @@ const withTestPlugin = (plugins, initValue) => {
|
|
|
18369
18344
|
* Generated bundle index. Do not edit.
|
|
18370
18345
|
*/
|
|
18371
18346
|
|
|
18372
|
-
export { ALIGN_BLOCK_TYPES, A_TAG_REL_ATTR, AlignEditor, Alignment, BLOCK_DELETE_BACKWARD_TYPES, BLOCK_HIDDEN_CLASS, BasicTest, BlockquoteEditor, CLIPBOARD_FORMAT_KEY, CODEMIRROR_PADDING_TOP, CODE_MODES, CONTAINER_BLOCKS, CONTROL_KEY, CodeEditor, ColorEditor, ColumnResizeNotifierSource, ColumnResizingStore, DEFAULT_LANGUAGE, DEFAULT_SCROLL_CONTAINER, DISABLED_OPERATE_TYPES, DataTransferFaker, DefaultElementOptions, DefaultGlobalToolbarDefinition, DefaultInlineToolbarDefinition, DropdownMode, ELEMENT_UNIQUE_ID, EditorPresetConfigFactoryMock, ElementKinds, ErrorCodes, FontSizeTypes, FontSizes, HEADING_TYPES, HeaderLevelMap, HeadingEditor, HoveredCellInfo, HrEditor, IS_MAC, ImageEditor, IndentEditor, Indents, InlineCodeEditor, LINK_DEFAULT_TEXT, LIST_BLOCK_TYPES, LOWEST_TEXT_CONTAINER_TYPES, LayoutTypes, LinkEditor, ListEditor, MarkEditor, MarkProps, MarkTypes, MentionEditor, PICTURE_ACCEPTED_UPLOAD_MIME, PICTURE_ACCEPTED_UPLOAD_SIZE, PluginKeys, PluginMenuIcons, PluginMenuSvgs, Position, QUICK_INSERT_HOTKEY, QuickInsertEditor, ResizeRef, SLA_TABLE_CELL_SELECTOR, SLA_TABLE_SELECTOR, STANDARD_HEADING_TYPES, ScrollDirection, SpecialBackgroundColor, TAB_SPACE, THE_EDITOR_BG_COLOR, THE_EDITOR_COLOR, THE_EDITOR_CONVERSION_HINT_REF, THE_EDITOR_ORIGIN_ANCHOR, THE_EDITOR_POPOVER_REF, THE_EDITOR_PREVIOUS_SELECTION, THE_EDITOR_UUID, THE_I18N_DE_DE, THE_I18N_EN_US, THE_I18N_JA_JP, THE_I18N_LOCALE_ID, THE_I18N_RU_RU, THE_I18N_ZH_HANS, THE_I18N_ZH_HANT, THE_IMAGE_SERVICE_TOKEN, THE_LISTBOX_PARENT_GROUP_TOKEN, THE_LISTBOX_PARENT_OPTION_TOKEN, THE_LISTBOX_TOKEN, THE_MODE_PROVIDER, THE_MODE_TOKEN, THE_PLUGIN_MENU_REF, THE_PRESET_CONFIG_TOKEN, TableCellEventDispatcher, TableEditor, TableHeaderBackgroundColor, TablePosition, TheBaseElement, TheBaseSuggestion, TheBaseToolbarDropdown, TheBaseToolbarItem, TheColumnResizeDirective, TheColumnResizeOverlayHandle, TheContextMenu, TheContextService, TheConversionHint, TheDataMode, TheDefaultElement, TheEditor, TheEditorComponent, TheEditorModule, TheI18nService, TheImage, TheInlineToolbar, TheListboxDirective, TheListboxGroupDirective, TheListboxOptionDirective, TheLocaleType, TheMode, TheModeConfig, ThePluginMenu, ThePluginMenuComponent, ThePluginMenuItemType, ThePreventDefaultDirective, index$1 as TheQueries, TheQuickInsert, TheTableSelect, TheTemplate, TheText, TheToolbarComponent, TheToolbarDropdown, TheToolbarGroup, TheToolbarGroupToken, TheToolbarItem, TheToolbarService, index as TheTransforms, TodoItemEditor, ToolbarActionTypes, ToolbarAlignment, ToolbarItemType, ToolbarMoreGroup, VOID_BLOCK_TYPES, VerticalAlignEditor, VerticalAlignment, ZERO_WIDTH_CHAR, autoFocus, base64toBlob, bottomLeftPosition, buildPluginMenu, buildPluginMenuItemMap, buildQuickInsertMenus, calcPrintColumnWidth, calcSpanForColumn, calcSpanForRow, calculateHeaderRowHeight, calculateRowControls, coercePixelsFromCssValue, combinePlugins, copyNode, createCell, createEmptyContent, createEmptyParagraph, createMentionPlugin, createPluginFactory, createRow, createTable, createTablePosition, createTest1Plugin, createTestPlugin, createToolbar, createVerticalAlignPlugin, customPluginMock, customPluginMockKey, dataDeserialize, dataSerializing, deDeLocale, deleteElementKey, enUsLocale, errorImageUrlMock, expandPreviousHeadings, extractFragment, filterTextFormat, fixBlockWithoutParagraph, fixBlockWithoutText, flattenDeepPlugins, getCellPositionsFromRange, getCollapsedStandardHeadingAbove, getColsTotalWidth, getColumnsWidth, getDirtyElements, getEditorScrollContainer, getEditorUUID, getElementClassByPrefix, getElementHeight, getElementWidth, getEndBlock, getFollowElements, getGridColumns, getMode, getNextCell, getOriginCell, getPlugin, getPluginOptions, getPlugins, getPreviousRelatedHeadingElements, getRowsTotalHeight, getSelectCellNode, getSelectedCellPositions, getStartBlock, getTableByCell, getTableByRow, getTheDefaultPluginMenu, getToolbarClass, hasHeaderRow, headingOptions, htmlToTheia, idCreator, inValidTypes, initializeDefaultMenuIcons, injectTranslations, insertDataByInvalidType, internalPlugins, isCleanEmptyParagraph, isColorIndicator, isColorInput, isColorPanel, isDirectionKeydown, isHeadingElement, isInside, isMobileMode, isPrintMode, isPureEmptyParagraph, isRangeInTable, isRectangularInTableCells, isSelectedAllCell, isSelectionInTable, isStandardHeadingElement, isStandardHeadingElementByType, isUrl, isVirtualKey, jaJpLocale, matchOptions, mergeArray, mergeDeepPlugins, mergeElementOptions, mergeOptions, nestedStructureByKey, normalizeValue, originOptions, plainToTheia, pluginKey, pluginKey1, pluginsByKey, reSelection, recursionNodes, refocus, ruRuLocale,
|
|
18347
|
+
export { ALIGN_BLOCK_TYPES, A_TAG_REL_ATTR, AlignEditor, Alignment, BLOCK_DELETE_BACKWARD_TYPES, BLOCK_HIDDEN_CLASS, BasicTest, BlockquoteEditor, CLIPBOARD_FORMAT_KEY, CODEMIRROR_PADDING_TOP, CODE_MODES, CONTAINER_BLOCKS, CONTROL_KEY, CodeEditor, ColorEditor, ColumnResizeNotifierSource, ColumnResizingStore, DEFAULT_LANGUAGE, DEFAULT_SCROLL_CONTAINER, DISABLED_OPERATE_TYPES, DataTransferFaker, DefaultElementOptions, DefaultGlobalToolbarDefinition, DefaultInlineToolbarDefinition, DropdownMode, ELEMENT_UNIQUE_ID, EditorPresetConfigFactoryMock, ElementKinds, ErrorCodes, FontSizeTypes, FontSizes, HEADING_TYPES, HeaderLevelMap, HeadingEditor, HoveredCellInfo, HrEditor, IS_MAC, ImageEditor, IndentEditor, Indents, InlineCodeEditor, LINK_DEFAULT_TEXT, LIST_BLOCK_TYPES, LOWEST_TEXT_CONTAINER_TYPES, LayoutTypes, LinkEditor, ListEditor, MarkEditor, MarkProps, MarkTypes, MentionEditor, PICTURE_ACCEPTED_UPLOAD_MIME, PICTURE_ACCEPTED_UPLOAD_SIZE, PluginKeys, PluginMenuIcons, PluginMenuSvgs, Position, QUICK_INSERT_HOTKEY, QuickInsertEditor, ResizeRef, SLA_TABLE_CELL_SELECTOR, SLA_TABLE_SELECTOR, STANDARD_HEADING_TYPES, ScrollDirection, SpecialBackgroundColor, TAB_SPACE, THE_EDITOR_BG_COLOR, THE_EDITOR_COLOR, THE_EDITOR_CONVERSION_HINT_REF, THE_EDITOR_ORIGIN_ANCHOR, THE_EDITOR_POPOVER_REF, THE_EDITOR_PREVIOUS_SELECTION, THE_EDITOR_UUID, THE_I18N_DE_DE, THE_I18N_EN_US, THE_I18N_JA_JP, THE_I18N_LOCALE_ID, THE_I18N_RU_RU, THE_I18N_ZH_HANS, THE_I18N_ZH_HANT, THE_IMAGE_SERVICE_TOKEN, THE_LISTBOX_PARENT_GROUP_TOKEN, THE_LISTBOX_PARENT_OPTION_TOKEN, THE_LISTBOX_TOKEN, THE_MODE_PROVIDER, THE_MODE_TOKEN, THE_PLUGIN_MENU_REF, THE_PRESET_CONFIG_TOKEN, TableCellEventDispatcher, TableEditor, TableHeaderBackgroundColor, TablePosition, TheBaseElement, TheBaseSuggestion, TheBaseToolbarDropdown, TheBaseToolbarItem, TheColumnResizeDirective, TheColumnResizeOverlayHandle, TheContextMenu, TheContextService, TheConversionHint, TheDataMode, TheDefaultElement, TheEditor, TheEditorComponent, TheEditorModule, TheI18nService, TheImage, TheInlineToolbar, TheListboxDirective, TheListboxGroupDirective, TheListboxOptionDirective, TheLocaleType, TheMode, TheModeConfig, ThePluginMenu, ThePluginMenuComponent, ThePluginMenuItemType, ThePreventDefaultDirective, index$1 as TheQueries, TheQuickInsert, TheTableSelect, TheTemplate, TheText, TheToolbarComponent, TheToolbarDropdown, TheToolbarGroup, TheToolbarGroupToken, TheToolbarItem, TheToolbarService, index as TheTransforms, TodoItemEditor, ToolbarActionTypes, ToolbarAlignment, ToolbarItemType, ToolbarMoreGroup, VOID_BLOCK_TYPES, VerticalAlignEditor, VerticalAlignment, ZERO_WIDTH_CHAR, autoFocus, base64toBlob, bottomLeftPosition, bottomRightPosition, buildPluginMenu, buildPluginMenuItemMap, buildQuickInsertMenus, calcPrintColumnWidth, calcSpanForColumn, calcSpanForRow, calculateHeaderRowHeight, calculateRowControls, coercePixelsFromCssValue, combinePlugins, copyNode, createCell, createEmptyContent, createEmptyParagraph, createMentionPlugin, createPluginFactory, createRow, createTable, createTablePosition, createTest1Plugin, createTestPlugin, createToolbar, createVerticalAlignPlugin, customPluginMock, customPluginMockKey, dataDeserialize, dataSerializing, deDeLocale, deleteElementKey, enUsLocale, errorImageUrlMock, expandPreviousHeadings, extractFragment, filterTextFormat, fixBlockWithoutParagraph, fixBlockWithoutText, flattenDeepPlugins, getCellPositionsFromRange, getCollapsedStandardHeadingAbove, getColsTotalWidth, getColumnsWidth, getDirtyElements, getEditorScrollContainer, getEditorUUID, getElementClassByPrefix, getElementHeight, getElementWidth, getEndBlock, getFollowElements, getGridColumns, getMode, getNextCell, getOriginCell, getPlugin, getPluginOptions, getPlugins, getPreviousRelatedHeadingElements, getRowsTotalHeight, getSelectCellNode, getSelectedCellPositions, getStartBlock, getTableByCell, getTableByRow, getTheDefaultPluginMenu, getToolbarClass, hasHeaderRow, headingOptions, htmlToTheia, idCreator, inValidTypes, initializeDefaultMenuIcons, injectTranslations, insertDataByInvalidType, internalPlugins, isCleanEmptyParagraph, isColorIndicator, isColorInput, isColorPanel, isDirectionKeydown, isHeadingElement, isInside, isMobileMode, isPrintMode, isPureEmptyParagraph, isRangeInTable, isRectangularInTableCells, isSelectedAllCell, isSelectionInTable, isStandardHeadingElement, isStandardHeadingElementByType, isUrl, isVirtualKey, jaJpLocale, matchOptions, mergeArray, mergeDeepPlugins, mergeElementOptions, mergeOptions, nestedStructureByKey, normalizeValue, originOptions, plainToTheia, pluginKey, pluginKey1, pluginsByKey, reSelection, recursionNodes, refocus, ruRuLocale, setClipboardDataByDom, setEditorUUID, theTethysIconRegistryFaker, toggleHeadingRelatedElement, topLeftPosition, topRightPosition, uniqueCellPosition, updatePopoverPosition, useElementStyle, withMention, withTestPlugin, withTheia, zhHansLocale, zhHantLocale };
|
|
18373
18348
|
//# sourceMappingURL=worktile-theia.mjs.map
|