@sv443-network/userutils 2.0.1 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +49 -0
- package/README.md +511 -218
- package/dist/index.global.js +198 -114
- package/dist/index.js +197 -113
- package/dist/index.mjs +194 -109
- package/dist/lib/{config.d.ts → ConfigManager.d.ts} +8 -5
- package/dist/lib/SelectorObserver.d.ts +84 -0
- package/dist/lib/array.d.ts +6 -4
- package/dist/lib/dom.d.ts +8 -53
- package/dist/lib/index.d.ts +2 -2
- package/dist/lib/math.d.ts +12 -5
- package/dist/lib/misc.d.ts +26 -5
- package/dist/lib/translation.d.ts +2 -2
- package/package.json +10 -4
- package/dist/lib/onSelector.d.ts +0 -40
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,54 @@
|
|
|
1
1
|
# @sv443-network/userutils
|
|
2
2
|
|
|
3
|
+
## 4.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- dae5450: Removed `amplifyMedia` function due to massive inconsistencies in sound quality
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- 168c2aa: Added functions `compress` and `decompress` to compress and decompress strings using gzip or deflate
|
|
12
|
+
- 49bc85e: Added utility types `NonEmptyString` and `LooseUnion`
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 2ae665d: fixed wrong TS type for SelectorObserver options in constructor
|
|
17
|
+
|
|
18
|
+
## 3.0.0
|
|
19
|
+
|
|
20
|
+
### Major Changes
|
|
21
|
+
|
|
22
|
+
- 1859022: `onSelector()` has been turned into the `SelectorObserver` class to reduce the performance impact on larger sites:
|
|
23
|
+
|
|
24
|
+
- its instances can be scoped to any element lower in the DOM tree, unlike before where it was always observing the entire body with all its children
|
|
25
|
+
- separate instances can be disabled and reenabled individually on demand
|
|
26
|
+
- separate instances can have different MutationObserver options set to further reduce performance impact
|
|
27
|
+
- the separation into instances allows for a new "chaining" paradigm where selector listeners are only added and checked for once they are actually needed (see examples in the documentation)
|
|
28
|
+
- when using chaining, separate instances can be created and have listeners added to them before their base element is available in the DOM tree
|
|
29
|
+
- every listener can have a set debounce time, so that it doesn't get called too often (works the same as the [`debounce()` function](https://github.com/Sv443-Network/UserUtils/blob/main/README.md#debounce), but is disabled by default)
|
|
30
|
+
- there are now multiple methods to get and delete specific listeners
|
|
31
|
+
|
|
32
|
+
The `SelectorObserver.addListener()` method is backwards compatible with the old `onSelector()` function, so you can just add the class instance in front (for full backwards compat use `document.body` for the `baseElement` parameter of the constructor), then change the old function's name and it should work as before.
|
|
33
|
+
For more info and examples, please view the [SelectorObserver documentation](https://github.com/Sv443-Network/UserUtils/blob/main/README.md#selectorobserver)
|
|
34
|
+
|
|
35
|
+
### Minor Changes
|
|
36
|
+
|
|
37
|
+
- 0db73b5: Removed the limiter (DynamicsCompressorNode) from `amplifyMedia()` for clear and undistorted audio.
|
|
38
|
+
|
|
39
|
+
**Notable changes:**
|
|
40
|
+
|
|
41
|
+
- The property `source` has been renamed to `sourceNode` to fit the naming of the `gainNode` property
|
|
42
|
+
- A boolean property `enabled` has been added to check if the amplification is enabled or not
|
|
43
|
+
- The parameter `initialMultiplier` has been renamed to `initialGain` to reduce confusion (it is not a multiplier strictly speaking)
|
|
44
|
+
|
|
45
|
+
- 736784f: Added function `randomId()` to randomly generate cryptographically strong hexadecimal IDs
|
|
46
|
+
- 563e515: Added utility type `NonEmptyArray` for typing an array with at least 1 item
|
|
47
|
+
|
|
48
|
+
### Patch Changes
|
|
49
|
+
|
|
50
|
+
- a123da6: Added `@linkcode` references to the JSDoc in-IDE documentation
|
|
51
|
+
|
|
3
52
|
## 2.0.1
|
|
4
53
|
|
|
5
54
|
### Patch Changes
|