Skip to content

Commit 622cc02

Browse files
committed
v1.0.0
Initial release
1 parent 23edc74 commit 622cc02

File tree

4 files changed

+311
-557
lines changed

4 files changed

+311
-557
lines changed

CHANGELOG.md

+2-20
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,9 @@ All notable changes to this project will be documented in this file.
2626
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2727
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
2828

29-
> **⚠ Alphas may contain breaking changes between releases.**
30-
>
31-
> When the release is NOT a major release, the breaking changes will only be relative to the prior `alpha` release
32-
>
33-
> As this package is not released (kind of), this change log will be cleared on the official release of `v1`
34-
35-
## v0.0.0-alpha.1
36-
37-
### Changes
38-
39-
- Updated the `gitnore`, `tsconfig` and `npm` package to appropriately handle the new `lib/` folder
40-
- Added dependencies for, and tweaked, linting
41-
- Added `.prettierrc` for consistent formatting (and applied it)
42-
- Added some package scripts for linting, formatting, building, etc
43-
- Removed `.npmignore` in favour of `"files"` in the `package.json`
44-
45-
<!--
46-
## [1.0.0] - 2021-06-##
29+
## [1.0.0] - 2022-05-12
4730

4831
**This was the first release**
4932

5033
[unreleased]: https://github.com/TopMarksDevelopment/JavaScript.HoverBox/compare/v1.0.0...development
51-
[1.0.0]: https://github.com/TopMarksDevelopment/JavaScript.HoverBox/release/tag/v1.0.0
52-
-->
34+
[1.0.0]: https://github.com/TopMarksDevelopment/JavaScript.HoverBox/release/tag/v1.0.0

README.md

+36-12
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,52 @@
22

33
A simple package to reveal some extra information on hover
44

5-
> **This package is still under development**
6-
>
7-
> Although it's in a usable state, there is still a little work to do - just to refine it
8-
> - Primarily, there is CSS to add to the package, document changes and some more testing
9-
> - For now, you can implement the styling how you see fit and submit issues for any problems you find
5+
### Links
6+
- [Change log](./CHANGELOG.md)
7+
- [License (MIT)](./LICENSE)
108

119
## Usage
1210

1311
Add the below to your code to your project and you're away
1412

1513
```TS
16-
const hB = new HoverBox(".HoverBox");
14+
const hb = new HoverBox(".HoverBox");
15+
const hbWithOptions = new HoverBox(".HoverBox", options); // if you have options
1716

1817
// Inside some other functions somewhere
19-
hB.startListening();
20-
hB.stopListening();
18+
hb.startListening();
19+
hb.stopListening();
2120
```
2221

23-
## Changes
22+
## Options
2423

25-
You can see all the changes in our [change log](./CHANGELOG.md)
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
2636

27-
## License
37+
### Type: `PositionAlignment`
2838

29-
This extension is licensed under the [MIT License](./LICENSE)
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`.
40+
41+
42+
Using a single value will default the other to `center` so `left` == `center left`
43+
44+
### Type: `PositionCollision`
45+
46+
How to handle any collisions, either:
47+
48+
- `bestFit`: find the best fit before trying to flip the element
49+
- `flipFit`: flip the element completely vertically and horizontally
50+
- `ignore`: ignore any collisions and just carry on
51+
52+
53+
[PositionAlignment]: #type-positionalignment

0 commit comments

Comments
 (0)