@sv443-network/userutils 0.5.0 → 0.5.2
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 +12 -0
- package/README.md +13 -1
- package/package.json +11 -5
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -60,7 +60,17 @@ If you like using this library, please consider [supporting the development ❤
|
|
|
60
60
|
|
|
61
61
|
- If you are not using a bundler, you can include the latest release from GreasyFork by adding this directive to the userscript header:
|
|
62
62
|
```
|
|
63
|
-
// @require https://greasyfork.org/scripts/
|
|
63
|
+
// @require https://greasyfork.org/scripts/472956-userutils/code/UserUtils.js
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Then, access the functions on the global variable `UserUtils`:
|
|
67
|
+
```ts
|
|
68
|
+
UserUtils.addGlobalStyle("body { background-color: red; }");
|
|
69
|
+
|
|
70
|
+
// or using object destructuring:
|
|
71
|
+
|
|
72
|
+
const { clamp } = UserUtils;
|
|
73
|
+
console.log(clamp(1, 5, 10); // 5
|
|
64
74
|
```
|
|
65
75
|
|
|
66
76
|
<br><br>
|
|
@@ -431,6 +441,8 @@ button.addEventListener("click", () => {
|
|
|
431
441
|
});
|
|
432
442
|
```
|
|
433
443
|
|
|
444
|
+
</details>
|
|
445
|
+
|
|
434
446
|
<br><br>
|
|
435
447
|
|
|
436
448
|
## Math:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sv443-network/userutils",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "Library with various utilities for userscripts - register listeners for when CSS selectors exist, intercept events, modify the DOM more easily and more ",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"scripts": {
|
|
9
9
|
"lint": "tsc && eslint .",
|
|
10
10
|
"build-common": "tsup lib/index.ts --format cjs,esm --dts --clean --treeshake",
|
|
11
|
+
"build-iife": "tsup lib/index.ts --format cjs,esm,iife --dts --clean --treeshake --minify",
|
|
11
12
|
"build": "npm run build-common -- --minify",
|
|
12
13
|
"dev": "npm run build-common -- --sourcemap --watch",
|
|
13
14
|
"publish-package": "npm run build && changeset publish"
|
|
@@ -39,9 +40,14 @@
|
|
|
39
40
|
"tsup": "^7.2.0",
|
|
40
41
|
"typescript": "^5.1.6"
|
|
41
42
|
},
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
43
|
+
"files": [
|
|
44
|
+
"/dist/index.js",
|
|
45
|
+
"/dist/index.mjs",
|
|
46
|
+
"/dist/index.d.ts",
|
|
47
|
+
"/dist/index.d.mts",
|
|
48
|
+
"/package.json",
|
|
49
|
+
"/README.md",
|
|
50
|
+
"/CHANGELOG.md",
|
|
51
|
+
"/LICENSE.txt"
|
|
46
52
|
]
|
|
47
53
|
}
|