
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@haprompt/selection
Advanced tools
This package contains utilities and helpers for handling Haprompt selection.
@haprompt/selectionThis package contains selection helpers for Haprompt.
getStyleObjectFromCSSGiven a CSS string, returns an object from the style cache.
export function getStyleObjectFromCSS(css: string): {
[key: string]: string;
} | null;
$patchStyleTextApplies the provided styles to the TextNodes in the provided Selection. Key names in the patch argument should be the valid CSS properties (i.e., kebab-case).
export function $patchStyleText(
selection: RangeSelection | GridSelection,
patch: {
[key: string]: string;
},
): void;
$getSelectionStyleValueForPropertyGiven a selection and a valid CSS property name, returns the current value of that property for TextNodes in the Selection, if set. If not set, it returns the defaultValue. If all TextNodes do not have the same value, it returns an empty string.
export function $getSelectionStyleValueForProperty(
selection: RangeSelection,
styleProperty: string,
defaultValue: string,
): string;
$moveCaretSelectionMoves the selection according to the arguments.
export function $moveCaretSelection(
selection: RangeSelection,
isHoldingShift: boolean,
isBackward: boolean,
granularity: 'character' | 'word' | 'lineboundary',
): void;
$isParentElementRTLReturns true if the parent of the Selection anchor node is in Right-To-Left mode, false if not.
export function $isParentElementRTL(selection: RangeSelection): boolean;
$moveCharacterWraps $moveCaretSelection, using character granularity and accounting for RTL mode.
export function $moveCharacter(
selection: RangeSelection,
isHoldingShift: boolean,
isBackward: boolean,
): void;
$selectAllExpands the current Selection to cover all of the content in the editor.
export function $selectAll(selection: RangeSelection): void;
$setBlocksTypeConverts all nodes in the selection that are of one block type to another specified by parameter
export function $setBlocksType(
selection: RangeSelection,
createElement: () => ElementNode,
): void;
$isAtNodeEndReturns true if the provided point offset is in the last possible position.
export function $isAtNodeEnd(point: Point): boolean;
$shouldOverrideDefaultCharacterSelectionReturns true if default character selection should be overridden, false if not. Used with DecoratorNodes
export function $shouldOverrideDefaultCharacterSelection(
selection: RangeSelection,
isBackward: boolean,
): boolean;
FAQs
This package contains utilities and helpers for handling Haprompt selection.
The npm package @haprompt/selection receives a total of 2 weekly downloads. As such, @haprompt/selection popularity was classified as not popular.
We found that @haprompt/selection demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.