Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
Update `throttle-debounce` (#1705)
Olga Bulat039e45a13739
diff --git a/package.json b/package.jsonindex 36b42ebf4..68b430a21 100644--- a/package.json+++ b/package.json@@ -94,7 +94,7 @@"prom-client": "^14.0.1","rfdc": "^1.3.0","seeded-rand": "^2.0.1",- "throttle-debounce": "^4.0.1",+ "throttle-debounce": "^5.0.0","uuid": "^8.3.2","vue": "^2.6.14","vue-i18n": "^8.26.7"@@ -121,6 +121,7 @@"@types/lodash.sortby": "^4.7.7","@types/module-alias": "^2.0.1","@types/node": "^17.0.32",+ "@types/throttle-debounce": "^5.0.0","@types/uuid": "^8.3.4","@typescript-eslint/eslint-plugin": "^5.20.0","@typescript-eslint/parser": "^5.20.0",diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex d31b36f2b..8f5960709 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -35,6 +35,7 @@ specifiers:'@types/lodash.sortby': ^4.7.7'@types/module-alias': ^2.0.1'@types/node': ^17.0.32+ '@types/throttle-debounce': ^5.0.0'@types/uuid': ^8.3.4'@typescript-eslint/eslint-plugin': ^5.20.0'@typescript-eslint/parser': ^5.20.0@@ -91,7 +92,7 @@ specifiers:tailwindcss: ^3.0.23tailwindcss-rtl: ^0.9.0talkback: ^3.0.1- throttle-debounce: ^4.0.1+ throttle-debounce: ^5.0.0ts-node: ^10.7.0typescript: ^4.6.2uuid: ^8.3.2@@ -141,7 +142,7 @@ dependencies:prom-client: 14.0.1rfdc: 1.3.0seeded-rand: 2.0.1- throttle-debounce: 4.0.1+ throttle-debounce: 5.0.0uuid: 8.3.2vue: 2.6.14vue-i18n: [email protected]@@ -168,6 +169,7 @@ devDependencies:'@types/lodash.sortby': 4.7.7'@types/module-alias': 2.0.1'@types/node': 17.0.32+ '@types/throttle-debounce': 5.0.0'@types/uuid': 8.3.4'@typescript-eslint/eslint-plugin': 5.23.0_3uxjy4z5k6yagrpaxd7fqvv2xi'@typescript-eslint/parser': 5.23.0_2qyr5yzk6bquedgydwits76m2m@@ -6169,6 +6171,10 @@ packages:resolution: {integrity: sha512-5eQEtSCoESnh2FsiLTxE121IiE60hnMqcb435fShf4bpLRjEu1Eoekht23y6zXS9Ts3l+Szu3TARnTsA0GkOkQ==}dev: false+ /@types/throttle-debounce/5.0.0:+ resolution: {integrity: sha512-Pb7k35iCGFcGPECoNE4DYp3Oyf2xcTd3FbFQxXUI9hEYKUl6YX+KLf7HrBmgVcD05nl50LIH6i+80js4iYmWbw==}+ dev: true+/@types/uglify-js/3.13.1:resolution: {integrity: sha512-O3MmRAk6ZuAKa9CHgg0Pr0+lUOqoMLpc9AS4R8ano2auvsg7IE8syF3Xh/NPr26TWklxYcqoEEFdzLLs1fV9PQ==}dependencies:@@ -18386,8 +18392,8 @@ packages:engines: {node: '>=10'}dev: true- /throttle-debounce/4.0.1:- resolution: {integrity: sha512-s3PedbXdZtr8v3J5Sxd5T/GmWG80BcK5GVpwDdvgEaUXsaMqQe4zxgmC4TA7B8luSDCPxo3CeSBS3F9rF1CZwg==}+ /throttle-debounce/5.0.0:+ resolution: {integrity: sha512-2iQTSgkkc1Zyk0MeVrt/3BvuOXYPl/R8Z0U2xxo9rjwNciaHDG3R+Lm6dh4EeUci49DanvBnuqI6jshoQQRGEg==}engines: {node: '>=12.22'}dev: falsediff --git a/src/composables/use-scroll.js b/src/composables/use-scroll.jsdeleted file mode 100644index 6907c1bcb..000000000--- a/src/composables/use-scroll.js+++ /dev/null@@ -1,44 +0,0 @@-// code taken from Vueuse-import { throttle } from 'throttle-debounce'-import { ref } from '@nuxtjs/composition-api'--import { useEventListener } from '~/composables/use-event-listener'--/**- *- * @param { import('./types').MaybeRef<HTMLElement> } element- * @param {object} options- * @param {number} [options.throttleMs] - time to throttle the scroll handler.- * Set to 0 to remove throttling- */-export function useScroll(element, { throttleMs = 200 } = {}) {- /** @type { import('@nuxtjs/composition-api').Ref<number> } */- const y = ref(0)- /**- * Whether the element has been scrolled down at all- *- * @type { import('@nuxtjs/composition-api').Ref<boolean> }- */- const isScrolled = ref(false)-- if (element) {- /** @param { Event } e */- const scrollHandler = (e) => {- const eventTarget =- e.target === document ? e.target.documentElement : e.target- y.value = eventTarget.scrollTop- isScrolled.value = y.value > 0- }-- const handler = throttleMs- ? throttle(throttleMs, scrollHandler)- : scrollHandler-- useEventListener(element, 'scroll', handler, {- capture: false,- passive: true,- })- }-- return { y, isScrolled }-}