Skip to content
This repository was archived by the owner on Nov 25, 2021. It is now read-only.

Commit e0caa80

Browse files
committed
feat: remove HoverOverlay component
This library no longer provides the React component for rendering the hover tooltip. BREAKING CHANGE: Removes the HoverOverlay component. You must create your own UI component that renders from the hoverStateUpdates data.
1 parent 60d4adc commit e0caa80

File tree

12 files changed

+66
-381
lines changed

12 files changed

+66
-381
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
77
[![sourcegraph: search](https://img.shields.io/badge/sourcegraph-search-brightgreen.svg)](https://sourcegraph.com/github.com/sourcegraph/codeintellify)
88

9-
Adds code intelligence to code views on the web. Used in [Sourcegraph](https://sourcegraph.com).
9+
This library manages all of the inputs (mouse/keyboard events, location changes, hover information, and hover actions) necessary to display hover tooltips on with a code view. All together, this makes it easier to add code intelligence to code views on the web. Used in [Sourcegraph](https://sourcegraph.com).
1010

1111
## What it does
1212

@@ -16,10 +16,12 @@ Adds code intelligence to code views on the web. Used in [Sourcegraph](https://s
1616
- When clicking a token, pins the tooltip to that token
1717
- Highlights the hovered token
1818

19+
You need to provide your own UI component (referred to as the HoverOverlay) that actually displays this information and exposes these actions to the user.
20+
1921
## Usage
2022

2123
- Call `createHoverifier()` to create a `Hoverifier` object (there should only be one on the page, to have only one HoverOverlay shown).
22-
- The Hoverifier exposes an Observable `hoverStateUpdates` that a consumer can subscribe to, which emits all data needed to render the `HoverOverlay` React component.
24+
- The Hoverifier exposes an Observable `hoverStateUpdates` that a consumer can subscribe to, which emits all data needed to render the HoverOverlay
2325
- For each code view on the page, call `hoverifier.hoverify()`, passing the position events coming from `findPositionsFromEvents()`.
2426
- `hoverify()` returns a `Subscription` that will "unhoverify" the code view again if unsubscribed from
2527

karma.conf.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ export default (config: Config): void => {
1212
included: true,
1313
served: true,
1414
},
15-
{
16-
pattern: 'src/**/*.tsx',
17-
watched: false,
18-
included: true,
19-
served: true,
20-
},
2115
],
2216
preprocessors: {
2317
'src/**/*.ts?(x)': ['webpack', 'sourcemap'],
@@ -28,7 +22,7 @@ export default (config: Config): void => {
2822

2923
// karma-webpack doesn't change the file extensions so we just need to tell karma what these extensions mean.
3024
mime: {
31-
'text/x-typescript': ['ts', 'tsx'],
25+
'text/x-typescript': ['ts'],
3226
},
3327

3428
webpack: webpackConfig,

package-lock.json

Lines changed: 21 additions & 100 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@
3131
"dependencies": {
3232
"@sourcegraph/event-positions": "^1.0.0",
3333
"@sourcegraph/extension-api-types": "^1.0.1",
34-
"@sourcegraph/react-loading-spinner": "0.0.7",
3534
"lodash": "^4.17.10",
36-
"mdi-react": "^5.1.0",
3735
"rxjs": "^6.3.3",
3836
"ts-key-enum": "^2.0.0"
3937
},

src/HoverOverlay.scss

Lines changed: 0 additions & 113 deletions
This file was deleted.

0 commit comments

Comments
 (0)