MCPcopy
hub / github.com/udecode/plate / select

Method select

packages/selection/src/internal/SelectionArea.ts:895–917  ·  view source on GitHub ↗

* Adds elements to the selection * * @param query - CSS Query, can be an array of queries * @param quiet - If this should not trigger the move event

(query: SelectAllSelectors, quiet = false)

Source from the content-addressed store, hash-verified

893 * @param quiet - If this should not trigger the move event
894 */
895 select(query: SelectAllSelectors, quiet = false): Element[] {
896 const { changed, selected, stored } = this._selection;
897 const elements = selectAll(query, this._options.document).filter(
898 (el) => !selected.includes(el) && !stored.includes(el)
899 );
900
901 // Update element lists
902 stored.push(...elements);
903 selected.push(...elements);
904 changed.added.push(...elements);
905 changed.removed = [];
906
907 // We don't know which element was "selected" first so clear it
908 this._latestElement = undefined;
909
910 // Fire event
911 if (!quiet) {
912 this._emitEvent('move', null);
913 this._emitEvent('stop', null);
914 }
915
916 return elements;
917 }
918
919 /**
920 * Manually triggers the start of a selection

Callers 15

_onSingleTapMethod · 0.95
applyFunction · 0.80
insertColumnGroupFunction · 0.80
toggleColumnGroupFunction · 0.80
useScaleInputFunction · 0.80
useResizableStateFunction · 0.80
normalizeNodeFunction · 0.80
applyAutolinkMatchFunction · 0.80
moveSelectionAfterLinkFunction · 0.80
withLink.spec.tsxFile · 0.80
applyFunction · 0.80

Calls 2

_emitEventMethod · 0.95
selectAllFunction · 0.90

Tested by

no test coverage detected