Socket
Socket
Sign inDemoInstall

@codemirror/tooltip

Package Overview
Dependencies
Maintainers
2
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codemirror/tooltip - npm Package Compare versions

Comparing version 0.19.15 to 0.19.16

6

CHANGELOG.md

@@ -0,1 +1,7 @@

## 0.19.16 (2022-02-25)
### New features
Tooltip views may now have a `getPos` property, which can be used to override the way the tooltip's position is computed.
## 0.19.15 (2022-02-18)

@@ -2,0 +8,0 @@

import { EditorView, ViewUpdate } from '@codemirror/view';
import { Extension, Facet, EditorState, StateEffect } from '@codemirror/state';
declare type Rect = {
left: number;
right: number;
top: number;
bottom: number;
};
/**

@@ -103,2 +109,9 @@ Return an extension that configures tooltip behavior.

/**
By default, a tooltip's screen position will be based on the
text position of its `pos` property. This method can be provided
to make the tooltip view itself responsible for finding its
screen position.
*/
getCoords?: (pos: number) => Rect;
/**
By default, tooltips are moved when they overlap with other

@@ -105,0 +118,0 @@ tooltips. Set this to `true` to disable that behavior for this

5

dist/index.js

@@ -177,3 +177,6 @@ import { ViewPlugin, Direction, EditorView, logException } from '@codemirror/view';

parent: this.parent ? this.container.getBoundingClientRect() : editor,
pos: this.manager.tooltips.map(t => this.view.coordsAtPos(t.pos)),
pos: this.manager.tooltips.map((t, i) => {
let tv = this.manager.tooltipViews[i];
return tv.getCoords ? tv.getCoords(t.pos) : this.view.coordsAtPos(t.pos);
}),
size: this.manager.tooltipViews.map(({ dom }) => dom.getBoundingClientRect()),

@@ -180,0 +183,0 @@ space: this.view.state.facet(tooltipConfig).tooltipSpace(this.view),

2

package.json
{
"name": "@codemirror/tooltip",
"version": "0.19.15",
"version": "0.19.16",
"description": "Tooltip support for the CodeMirror code editor",

@@ -5,0 +5,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc