You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Breaking changes
- Migrated to the generic `@topmarksdevelopment/position`. Breaking as underlying types have changed:
- `PositionAlignment` => `Alignment`
- `PositionCollision` => `CollisionHandler`
### Changed
- Now released as a `UMD`, `CJS` and `ES` module packages, for better support
### Other
- Added tests to check basic functionality (plan to extend in the future)
- Added workflows for auto releases to NPM and GitHub pages
- Tidied readme
- Other changes (nothing user facing)
Copy file name to clipboardExpand all lines: CHANGELOG.md
+34-6
Original file line number
Diff line number
Diff line change
@@ -26,19 +26,47 @@ All notable changes to this project will be documented in this file.
26
26
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
27
27
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
28
28
29
+
## [2.0.0] - 2022-12-22
30
+
31
+
<small>[Compare to previous release][comp:2.0.0]</small>
32
+
33
+
### Breaking changes
34
+
35
+
- Migrated to the generic `@topmarksdevelopment/position`. Breaking as underlying types have changed:
36
+
-`PositionAlignment` => `Alignment`
37
+
-`PositionCollision` => `CollisionHandler`
38
+
39
+
### Changed
40
+
41
+
- Now released as a `UMD`, `CJS` and `ES` module packages, for better support
42
+
43
+
### Other
44
+
45
+
- Added tests to check basic functionality (plan to extend in the future)
46
+
- Added workflows for auto releases to NPM and GitHub pages
47
+
- Tidied readme
48
+
- Other changes (nothing user facing)
49
+
29
50
## [1.0.1] - 2022-05-19
30
51
52
+
<small>[Compare to previous release][comp:1.0.1]</small>
53
+
31
54
### Fixed
32
-
- Fixed an issue where dragging back onto an element before its timeout fired would cancel the old hide queue but not re-queue it [#4](https://github.com/TopMarksDevelopment/JavaScript.HoverBox/pull/4)
55
+
56
+
- Fixed an issue where dragging back onto an element before its timeout fired would cancel the old hide queue but not re-queue it [#4](https://github.com/TopMarksDevelopment/JavaScript.HoverBox/pull/4)
33
57
34
58
### Updated
35
-
-`@topmarksdevelopment/hover-position` from `1.0.0` to `1.0.1`
36
-
- Fixed position when the anchor is inside a scrollable element [hover-position#4](https://github.com/TopMarksDevelopment/JavaScript.HoverPosition/pull/4)
37
-
- Other changes (nothing user facing)
59
+
60
+
-`@topmarksdevelopment/hover-position` from `1.0.0` to `1.0.1`
61
+
- Fixed position when the anchor is inside a scrollable element [hover-position#4](https://github.com/TopMarksDevelopment/JavaScript.HoverPosition/pull/4)
Copy file name to clipboardExpand all lines: README.md
+67-22
Original file line number
Diff line number
Diff line change
@@ -3,13 +3,17 @@
3
3
A simple package to reveal some extra information on hover
4
4
5
5
### Links
6
-
-[Change log](./CHANGELOG.md)
7
-
-[License (MIT)](./LICENSE)
6
+
7
+
-[Options](#options)
8
+
-[Change log](./CHANGELOG.md)
9
+
-[License (MIT)](./LICENSE)
8
10
9
11
## Usage
10
12
11
13
Add the below to your code to your project and you're away
12
14
15
+
_Note:_ by default, we're listening upon construction
16
+
13
17
```TS
14
18
const hb =newHoverBox(".HoverBox");
15
19
const hbWithOptions =newHoverBox(".HoverBox", options); // if you have options
@@ -21,33 +25,74 @@ hb.stopListening();
21
25
22
26
## Options
23
27
24
-
Option | Type | Default | Description
25
-
---|---|---|---
26
-
setMy? | [Type: pA][PositionAlignment] | `top center` | The part of the popup linked the anchor
27
-
at? | [Type: pA][PositionAlignment] | `bottom center` | The part of the anchor that the target should link to
28
-
keepOpen? | boolean | `true` | If the mouse moves into the popup, keep it open
29
-
allowHtml? | boolean | `false` | The text provided can be treated as safe HTML
30
-
transitionDelay? | number | `333` | The delay before we start the transition
31
-
transitionDuration? | number | `333` | Must match the CSS transition property
32
-
**HoverPosition specific**
33
-
collision? | [PositionCollision](#type-positioncollision) | `bestfit` | How to handle the popup colliding with the window edge
34
-
bestFitPreference? | `horizontal` OR `vertical` | `horizontal` | The preferred direction to try `bestfit` first
35
-
defaults? | { my: [pA][PositionAlignment]; at: [pA][PositionAlignment]; } | Same as `setMy` & `at` respectively | Defaults to use if parsing of `setMy` or `at` fails
28
+
### setMy?: [`alignment`][alignment]
29
+
30
+
The part of the popup linked to `at`
31
+
**Default:**`top center`
32
+
33
+
### at?: [`alignment`][alignment]
34
+
35
+
The part of the anchor `setMy` will "attach" to
36
+
**Default:**`bottom center`
37
+
38
+
### keepOpen?: `boolean`
39
+
40
+
If the mouse moves into the popup, keep the pop-up open
41
+
**Default:**`true`
42
+
43
+
### allowHtml?: `boolean`
44
+
45
+
The text provided can be treated as safe HTML
46
+
**Default:**`false`
47
+
48
+
### transitionDelay?: `number`
49
+
50
+
The delay before we start the transition (in milliseconds)
51
+
**Default:**`333`
36
52
37
-
### Type: `PositionAlignment`
53
+
### transitionDuration?: `number`
38
54
39
-
Where to position an element. Use either: `top`, `bottom`, `center`, `left` or `right`. You can also specify a vertical and horizontal alignment like `top right`, `bottom right` or `center left`.
55
+
A link to the transition duration (in milliseconds). This must match the CSS transition property or the element
0 commit comments