@worktile/theia 20.2.4 → 20.2.6

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.
@@ -11289,6 +11289,39 @@ function getFollowElements(editor, element) {
11289
11289
  }
11290
11290
  return result;
11291
11291
  }
11292
+ function getAllVisibleState(editor) {
11293
+ let currentCollapsedHeading = null;
11294
+ let currentHeadingLevel = null;
11295
+ const visibleStates = [];
11296
+ const setCollapsedHeading = (targetElement) => {
11297
+ const isCollapsedHeading = isStandardHeadingElement(targetElement) && targetElement.isCollapsed;
11298
+ if (isCollapsedHeading) {
11299
+ currentCollapsedHeading = targetElement;
11300
+ currentHeadingLevel = HeaderLevelMap[targetElement.type];
11301
+ }
11302
+ };
11303
+ for (let i = 0; i < editor.children.length; i++) {
11304
+ const targetElement = editor.children[i];
11305
+ if (currentCollapsedHeading !== null && currentHeadingLevel !== null) {
11306
+ const isEnd = isStandardHeadingElement(targetElement) && HeaderLevelMap[targetElement.type] <= currentHeadingLevel;
11307
+ if (isEnd) {
11308
+ currentCollapsedHeading = null;
11309
+ currentHeadingLevel = null;
11310
+ visibleStates.push(true);
11311
+ setCollapsedHeading(targetElement);
11312
+ }
11313
+ else {
11314
+ visibleStates.push(false);
11315
+ continue;
11316
+ }
11317
+ }
11318
+ else {
11319
+ visibleStates.push(true);
11320
+ setCollapsedHeading(targetElement);
11321
+ }
11322
+ }
11323
+ return visibleStates;
11324
+ }
11292
11325
  function expandPreviousHeadings(editor, targetPath) {
11293
11326
  const relatedHeadingPaths = getPreviousRelatedHeadingElements(editor, targetPath);
11294
11327
  relatedHeadingPaths?.forEach(path => {
@@ -11330,6 +11363,20 @@ function getCollapsedStandardHeadingAbove(editor, path) {
11330
11363
  }
11331
11364
  return linkedHeadingPaths;
11332
11365
  }
11366
+ function getPreviousHeading(editor, path, options) {
11367
+ const index = path[0];
11368
+ const linkedHeadingPaths = [];
11369
+ for (let i = index - 1; i >= 0; i--) {
11370
+ const element = editor.children[i];
11371
+ if (isStandardHeadingElement(element) && editor.isVisible(element)) {
11372
+ linkedHeadingPaths.push([i]);
11373
+ if (options?.isFirst) {
11374
+ return linkedHeadingPaths;
11375
+ }
11376
+ }
11377
+ }
11378
+ return linkedHeadingPaths;
11379
+ }
11333
11380
 
11334
11381
  class TheTableSelect {
11335
11382
  constructor(popoverRef) {
@@ -13996,6 +14043,9 @@ const withHeading = (editor) => {
13996
14043
  }
13997
14044
  return isVisible(node);
13998
14045
  };
14046
+ editor.getAllVisibleStates = () => {
14047
+ return getAllVisibleState(editor);
14048
+ };
13999
14049
  editor.mousedown = (event) => {
14000
14050
  const target = event.target;
14001
14051
  if (target instanceof HTMLElement && target.classList.contains('slate-editable-container')) {
@@ -19041,5 +19091,5 @@ const withTestPlugin = (plugins, initValue) => {
19041
19091
  * Generated bundle index. Do not edit.
19042
19092
  */
19043
19093
 
19044
- export { ALIGN_BLOCK_TYPES, A_TAG_REL_ATTR, AlignEditor, Alignment, BLOCK_DELETE_BACKWARD_TYPES, BLOCK_HIDDEN_CLASS, BasicTest, BlockquoteEditor, CLIPBOARD_FORMAT_KEY, CODEMIRROR_DEFAULT_MAX_HEIGHT, 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, ROOT_ELEMENT_MARGIN_BOTTOM, 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, TheCode, TheColumnResizeDirective, TheColumnResizeOverlayHandle, TheContextMenu, TheContextService, TheConversionHint, TheDataMode, TheEditor, TheEditorComponent, TheEditorModule, TheI18nService, TheImage, TheInlineToolbar, TheListboxDirective, TheListboxGroupDirective, TheListboxOptionDirective, TheLocaleType, TheMode, TheModeConfig, ThePluginMenu, ThePluginMenuComponent, ThePluginMenuItemType, ThePreventDefaultDirective, index$1 as TheQueries, TheQuickInsert, TheTable, TheTableSelect, 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, createBreakBarChar, createCell, createEmptyContent, createEmptyParagraph, createMentionPlugin, createPluginFactory, createRow, createTable, createTablePosition, createTest1Plugin, createTestPlugin, createToolbar, createVerticalAlignPlugin, customPluginMock, customPluginMockKey, dataDeserialize, dataSerializing, deDeLocale, deleteElementKey, enUsLocale, errorImageUrlMock, expandPreviousHeadings, extractFragment, extractFragmentByHTML, 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, hasNumberedColumn, headingOptions, htmlToTheia, idCreator, inValidTypes, initializeDefaultMenuIcons, injectTranslations, insertDataByInvalidType, internalPlugins, isCleanEmptyParagraph, isColorIndicator, isColorInput, isColorPanel, isDirectionKeydown, isHeadingElement, isInside, isMobileMode, isPrintMode, isPureEmptyParagraph, isPureHeading, isPureParagraph, 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, toggleClass, toggleHeadingRelatedElement, toggleProperty, toggleStyle, topLeftPosition, topRightPosition, uniqueCellPosition, updatePopoverPosition, withMention, withTestPlugin, withTheia, zhHansLocale, zhHantLocale };
19094
+ export { ALIGN_BLOCK_TYPES, A_TAG_REL_ATTR, AlignEditor, Alignment, BLOCK_DELETE_BACKWARD_TYPES, BLOCK_HIDDEN_CLASS, BasicTest, BlockquoteEditor, CLIPBOARD_FORMAT_KEY, CODEMIRROR_DEFAULT_MAX_HEIGHT, 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, ROOT_ELEMENT_MARGIN_BOTTOM, 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, TheCode, TheColumnResizeDirective, TheColumnResizeOverlayHandle, TheContextMenu, TheContextService, TheConversionHint, TheDataMode, TheEditor, TheEditorComponent, TheEditorModule, TheI18nService, TheImage, TheInlineToolbar, TheListboxDirective, TheListboxGroupDirective, TheListboxOptionDirective, TheLocaleType, TheMode, TheModeConfig, ThePluginMenu, ThePluginMenuComponent, ThePluginMenuItemType, ThePreventDefaultDirective, index$1 as TheQueries, TheQuickInsert, TheTable, TheTableSelect, 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, createBreakBarChar, createCell, createEmptyContent, createEmptyParagraph, createMentionPlugin, createPluginFactory, createRow, createTable, createTablePosition, createTest1Plugin, createTestPlugin, createToolbar, createVerticalAlignPlugin, customPluginMock, customPluginMockKey, dataDeserialize, dataSerializing, deDeLocale, deleteElementKey, enUsLocale, errorImageUrlMock, expandPreviousHeadings, extractFragment, extractFragmentByHTML, filterTextFormat, fixBlockWithoutParagraph, fixBlockWithoutText, flattenDeepPlugins, getAllVisibleState, getCellPositionsFromRange, getCollapsedStandardHeadingAbove, getColsTotalWidth, getColumnsWidth, getDirtyElements, getEditorScrollContainer, getEditorUUID, getElementClassByPrefix, getElementHeight, getElementWidth, getEndBlock, getFollowElements, getGridColumns, getMode, getNextCell, getOriginCell, getPlugin, getPluginOptions, getPlugins, getPreviousHeading, getPreviousRelatedHeadingElements, getRowsTotalHeight, getSelectCellNode, getSelectedCellPositions, getStartBlock, getTableByCell, getTableByRow, getTheDefaultPluginMenu, getToolbarClass, hasHeaderRow, hasNumberedColumn, headingOptions, htmlToTheia, idCreator, inValidTypes, initializeDefaultMenuIcons, injectTranslations, insertDataByInvalidType, internalPlugins, isCleanEmptyParagraph, isColorIndicator, isColorInput, isColorPanel, isDirectionKeydown, isHeadingElement, isInside, isMobileMode, isPrintMode, isPureEmptyParagraph, isPureHeading, isPureParagraph, 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, toggleClass, toggleHeadingRelatedElement, toggleProperty, toggleStyle, topLeftPosition, topRightPosition, uniqueCellPosition, updatePopoverPosition, withMention, withTestPlugin, withTheia, zhHansLocale, zhHantLocale };
19045
19095
  //# sourceMappingURL=worktile-theia.mjs.map