Ver código fonte

chore: update userutils

Sven 1 ano atrás
pai
commit
ce438ed044
5 arquivos alterados com 200 adições e 456 exclusões
  1. 196 443
      package-lock.json
  2. 1 1
      package.json
  3. 1 1
      src/events.ts
  4. 2 2
      src/features/menu/menu_old.ts
  5. 0 9
      src/utils.ts

Diferenças do arquivo suprimidas por serem muito extensas
+ 196 - 443
package-lock.json


+ 1 - 1
package.json

@@ -35,7 +35,7 @@
   },
   "dependencies": {
     "@billjs/event-emitter": "^1.0.3",
-    "@sv443-network/userutils": "^1.0.0"
+    "@sv443-network/userutils": "^1.1.0"
   },
   "devDependencies": {
     "@types/express": "^4.17.17",

+ 1 - 1
src/events.ts

@@ -115,5 +115,5 @@ async function initHomeObservers() {
     childList: true,
   });
 
-  observers = observers.concat([ shelfContainerObs ]);
+  observers.push(shelfContainerObs);
 }

+ 2 - 2
src/features/menu/menu_old.ts

@@ -1,9 +1,9 @@
-import { debounce, pauseFor } from "@sv443-network/userutils";
+import { debounce, isScrollable, pauseFor } from "@sv443-network/userutils";
 import { defaultConfig, getFeatures, saveFeatures, setDefaultFeatures } from "../../config";
 import { scriptInfo } from "../../constants";
 import { FeatureCategory, FeatInfoKey, categoryNames, featInfo } from "../index";
 import { FeatureConfig } from "../../types";
-import { getResourceUrl, info, isScrollable, log } from "../../utils";
+import { getResourceUrl, info, log } from "../../utils";
 import "./menu_old.css";
 
 //#MARKER create menu elements

+ 0 - 9
src/utils.ts

@@ -225,12 +225,3 @@ export function getDomain(): Domain {
 export function getResourceUrl(name: keyof typeof resources) {
   return GM.getResourceUrl(name);
 }
-
-/** Checks if an element is scrollable in the horizontal and vertical directions */
-export function isScrollable(element: HTMLElement) {
-  const { overflowX, overflowY } = getComputedStyle(element);
-  return {
-    vertical: (overflowY === "scroll" || overflowY === "auto") && element.scrollHeight > element.clientHeight,
-    horizontal: (overflowX === "scroll" || overflowX === "auto") && element.scrollWidth > element.clientWidth,
-  };
-}

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff