From f38f65ea8aa3138713542e48332cb80b63efeb7d Mon Sep 17 00:00:00 2001 From: bnjmnrsh Date: Wed, 17 Jan 2024 22:56:40 +0000 Subject: [PATCH 1/9] Add vitest --- package-lock.json | 1206 ++++++++++++++++++++++++++++++++++++++++++++- package.json | 6 +- 2 files changed, 1200 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 53677fa..c02381c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,8 @@ "eslint-plugin-promise": "^4.2.1", "prettier": "^2.2.1", "rollup": "^4.9.5", - "rollup-plugin-banner": "^0.2.1" + "rollup-plugin-banner": "^0.2.1", + "vitest": "^1.2.1" } }, "node_modules/@babel/code-frame": { @@ -108,6 +109,374 @@ "node": ">=4" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.11.tgz", + "integrity": "sha512-FnzU0LyE3ySQk7UntJO4+qIiQgI7KoODnZg5xzXIrFJlKd2P2gwHsHY4927xj9y5PJmJSzULiUCWmv7iWnNa7g==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.11.tgz", + "integrity": "sha512-5OVapq0ClabvKvQ58Bws8+wkLCV+Rxg7tUVbo9xu034Nm536QTII4YzhaFriQ7rMrorfnFKUsArD2lqKbFY4vw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.11.tgz", + "integrity": "sha512-aiu7K/5JnLj//KOnOfEZ0D90obUkRzDMyqd/wNAUQ34m4YUPVhRZpnqKV9uqDGxT7cToSDnIHsGooyIczu9T+Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.11.tgz", + "integrity": "sha512-eccxjlfGw43WYoY9QgB82SgGgDbibcqyDTlk3l3C0jOVHKxrjdc9CTwDUQd0vkvYg5um0OH+GpxYvp39r+IPOg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.11.tgz", + "integrity": "sha512-ETp87DRWuSt9KdDVkqSoKoLFHYTrkyz2+65fj9nfXsaV3bMhTCjtQfw3y+um88vGRKRiF7erPrh/ZuIdLUIVxQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.11.tgz", + "integrity": "sha512-fkFUiS6IUK9WYUO/+22omwetaSNl5/A8giXvQlcinLIjVkxwTLSktbF5f/kJMftM2MJp9+fXqZ5ezS7+SALp4g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.11.tgz", + "integrity": "sha512-lhoSp5K6bxKRNdXUtHoNc5HhbXVCS8V0iZmDvyWvYq9S5WSfTIHU2UGjcGt7UeS6iEYp9eeymIl5mJBn0yiuxA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.11.tgz", + "integrity": "sha512-JkUqn44AffGXitVI6/AbQdoYAq0TEullFdqcMY/PCUZ36xJ9ZJRtQabzMA+Vi7r78+25ZIBosLTOKnUXBSi1Kw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.11.tgz", + "integrity": "sha512-3CRkr9+vCV2XJbjwgzjPtO8T0SZUmRZla+UL1jw+XqHZPkPgZiyWvbDvl9rqAN8Zl7qJF0O/9ycMtjU67HN9/Q==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.11.tgz", + "integrity": "sha512-LneLg3ypEeveBSMuoa0kwMpCGmpu8XQUh+mL8XXwoYZ6Be2qBnVtcDI5azSvh7vioMDhoJFZzp9GWp9IWpYoUg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.11.tgz", + "integrity": "sha512-caHy++CsD8Bgq2V5CodbJjFPEiDPq8JJmBdeyZ8GWVQMjRD0sU548nNdwPNvKjVpamYYVL40AORekgfIubwHoA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.11.tgz", + "integrity": "sha512-ppZSSLVpPrwHccvC6nQVZaSHlFsvCQyjnvirnVjbKSHuE5N24Yl8F3UwYUUR1UEPaFObGD2tSvVKbvR+uT1Nrg==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.11.tgz", + "integrity": "sha512-B5x9j0OgjG+v1dF2DkH34lr+7Gmv0kzX6/V0afF41FkPMMqaQ77pH7CrhWeR22aEeHKaeZVtZ6yFwlxOKPVFyg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.11.tgz", + "integrity": "sha512-MHrZYLeCG8vXblMetWyttkdVRjQlQUb/oMgBNurVEnhj4YWOr4G5lmBfZjHYQHHN0g6yDmCAQRR8MUHldvvRDA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.11.tgz", + "integrity": "sha512-f3DY++t94uVg141dozDu4CCUkYW+09rWtaWfnb3bqe4w5NqmZd6nPVBm+qbz7WaHZCoqXqHz5p6CM6qv3qnSSQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.11.tgz", + "integrity": "sha512-A5xdUoyWJHMMlcSMcPGVLzYzpcY8QP1RtYzX5/bS4dvjBGVxdhuiYyFwp7z74ocV7WDc0n1harxmpq2ePOjI0Q==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.11.tgz", + "integrity": "sha512-grbyMlVCvJSfxFQUndw5mCtWs5LO1gUlwP4CDi4iJBbVpZcqLVT29FxgGuBJGSzyOxotFG4LoO5X+M1350zmPA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.11.tgz", + "integrity": "sha512-13jvrQZJc3P230OhU8xgwUnDeuC/9egsjTkXN49b3GcS5BKvJqZn86aGM8W9pd14Kd+u7HuFBMVtrNGhh6fHEQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.11.tgz", + "integrity": "sha512-ysyOGZuTp6SNKPE11INDUeFVVQFrhcNDVUgSQVDzqsqX38DjhPEPATpid04LCoUr2WXhQTEZ8ct/EgJCUDpyNw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.11.tgz", + "integrity": "sha512-Hf+Sad9nVwvtxy4DXCZQqLpgmRTQqyFyhT3bZ4F2XlJCjxGmRFF0Shwn9rzhOYRB61w9VMXUkxlBy56dk9JJiQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.11.tgz", + "integrity": "sha512-0P58Sbi0LctOMOQbpEOvOL44Ne0sqbS0XWHMvvrg6NE5jQ1xguCSSw9jQeUk2lfrXYsKDdOe6K+oZiwKPilYPQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.11.tgz", + "integrity": "sha512-6YOrWS+sDJDmshdBIQU+Uoyh7pQKrdykdefC1avn76ss5c+RN6gut3LZA4E2cH5xUEp5/cA0+YxRaVtRAb0xBg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.11.tgz", + "integrity": "sha512-vfkhltrjCAb603XaFhqhAF4LGDi2M4OrCRrFusyQ+iTLQ/o60QQXxc9cZC/FFpihBI9N1Grn6SMKVJ4KP7Fuiw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@eslint/eslintrc": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.3.0.tgz", @@ -153,6 +522,18 @@ "node": ">= 4" } }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", @@ -402,6 +783,12 @@ "win32" ] }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true + }, "node_modules/@types/estree": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", @@ -414,6 +801,75 @@ "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", "dev": true }, + "node_modules/@vitest/expect": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.2.1.tgz", + "integrity": "sha512-/bqGXcHfyKgFWYwIgFr1QYDaR9e64pRKxgBNWNXPefPFRhgm+K3+a/dS0cUGEreWngets3dlr8w8SBRw2fCfFQ==", + "dev": true, + "dependencies": { + "@vitest/spy": "1.2.1", + "@vitest/utils": "1.2.1", + "chai": "^4.3.10" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.2.1.tgz", + "integrity": "sha512-zc2dP5LQpzNzbpaBt7OeYAvmIsRS1KpZQw4G3WM/yqSV1cQKNKwLGmnm79GyZZjMhQGlRcSFMImLjZaUQvNVZQ==", + "dev": true, + "dependencies": { + "@vitest/utils": "1.2.1", + "p-limit": "^5.0.0", + "pathe": "^1.1.1" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.2.1.tgz", + "integrity": "sha512-Tmp/IcYEemKaqAYCS08sh0vORLJkMr0NRV76Gl8sHGxXT5151cITJCET20063wk0Yr/1koQ6dnmP6eEqezmd/Q==", + "dev": true, + "dependencies": { + "magic-string": "^0.30.5", + "pathe": "^1.1.1", + "pretty-format": "^29.7.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.2.1.tgz", + "integrity": "sha512-vG3a/b7INKH7L49Lbp0IWrG6sw9j4waWAucwnksPB1r1FTJgV7nkBByd9ufzu6VWya/QTvQW4V9FShZbZIB2UQ==", + "dev": true, + "dependencies": { + "tinyspy": "^2.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.2.1.tgz", + "integrity": "sha512-bsH6WVZYe/J2v3+81M5LDU8kW76xWObKIURpPrOXm2pjBniBu2MERI/XP60GpS4PHU3jyK50LUutOwrx4CyHUg==", + "dev": true, + "dependencies": { + "diff-sequences": "^29.6.3", + "estree-walker": "^3.0.3", + "loupe": "^2.3.7", + "pretty-format": "^29.7.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, "node_modules/acorn": { "version": "7.4.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", @@ -435,6 +891,15 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/acorn-walk": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -528,6 +993,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/astral-regex": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", @@ -557,6 +1031,15 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/call-bind": { "version": "1.0.2", "dev": true, @@ -578,6 +1061,36 @@ "node": ">=6" } }, + "node_modules/chai": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", + "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", + "dev": true, + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", + "pathval": "^1.1.1", + "type-detect": "^4.0.8" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/check-error": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "dev": true, + "dependencies": { + "get-func-name": "^2.0.2" + }, + "engines": { + "node": "*" + } + }, "node_modules/color-convert": { "version": "2.0.1", "dev": true, @@ -629,9 +1142,10 @@ } }, "node_modules/debug": { - "version": "4.3.1", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, - "license": "MIT", "dependencies": { "ms": "2.1.2" }, @@ -644,6 +1158,18 @@ } } }, + "node_modules/deep-eql": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", + "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "dev": true, + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -661,6 +1187,15 @@ "node": ">= 0.4" } }, + "node_modules/diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -742,6 +1277,44 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/esbuild": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.11.tgz", + "integrity": "sha512-HJ96Hev2hX/6i5cDVwcqiJBBtuo9+FeIJOtZ9W1kA5M6AMJRHUZlpYZ1/SbEwtO0ioNAW8rUooVpC/WehY2SfA==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.19.11", + "@esbuild/android-arm": "0.19.11", + "@esbuild/android-arm64": "0.19.11", + "@esbuild/android-x64": "0.19.11", + "@esbuild/darwin-arm64": "0.19.11", + "@esbuild/darwin-x64": "0.19.11", + "@esbuild/freebsd-arm64": "0.19.11", + "@esbuild/freebsd-x64": "0.19.11", + "@esbuild/linux-arm": "0.19.11", + "@esbuild/linux-arm64": "0.19.11", + "@esbuild/linux-ia32": "0.19.11", + "@esbuild/linux-loong64": "0.19.11", + "@esbuild/linux-mips64el": "0.19.11", + "@esbuild/linux-ppc64": "0.19.11", + "@esbuild/linux-riscv64": "0.19.11", + "@esbuild/linux-s390x": "0.19.11", + "@esbuild/linux-x64": "0.19.11", + "@esbuild/netbsd-x64": "0.19.11", + "@esbuild/openbsd-x64": "0.19.11", + "@esbuild/sunos-x64": "0.19.11", + "@esbuild/win32-arm64": "0.19.11", + "@esbuild/win32-ia32": "0.19.11", + "@esbuild/win32-x64": "0.19.11" + } + }, "node_modules/eslint": { "version": "7.19.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.19.0.tgz", @@ -1293,6 +1866,15 @@ "node": ">=4.0" } }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "dependencies": { + "@types/estree": "^1.0.0" + } + }, "node_modules/esutils": { "version": "2.0.3", "dev": true, @@ -1301,6 +1883,29 @@ "node": ">=0.10.0" } }, + "node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -1356,9 +1961,11 @@ "license": "ISC" }, "node_modules/fsevents": { - "version": "2.3.2", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, - "license": "MIT", + "hasInstallScript": true, "optional": true, "os": [ "darwin" @@ -1378,6 +1985,15 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, + "node_modules/get-func-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/get-intrinsic": { "version": "1.1.1", "dev": true, @@ -1391,6 +2007,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/glob": { "version": "7.1.6", "dev": true, @@ -1461,6 +2089,15 @@ "dev": true, "license": "ISC" }, + "node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true, + "engines": { + "node": ">=16.17.0" + } + }, "node_modules/ignore": { "version": "5.1.8", "dev": true, @@ -1601,6 +2238,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-string": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", @@ -1669,6 +2318,12 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, + "node_modules/jsonc-parser": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", + "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", + "dev": true + }, "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -1718,6 +2373,22 @@ "node": ">=4" } }, + "node_modules/local-pkg": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", + "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", + "dev": true, + "dependencies": { + "mlly": "^1.4.2", + "pkg-types": "^1.0.3" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/lodash": { "version": "4.17.20", "dev": true, @@ -1748,6 +2419,15 @@ "lodash._reinterpolate": "^3.0.0" } }, + "node_modules/loupe": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "dev": true, + "dependencies": { + "get-func-name": "^2.0.1" + } + }, "node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -1760,6 +2440,36 @@ "node": ">=10" } }, + "node_modules/magic-string": { + "version": "0.30.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.5.tgz", + "integrity": "sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==", + "dev": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/minimatch": { "version": "3.0.4", "dev": true, @@ -1771,16 +2481,58 @@ "node": "*" } }, - "node_modules/minimist": { - "version": "1.2.5", - "dev": true, - "license": "MIT" - }, + "node_modules/minimist": { + "version": "1.2.5", + "dev": true, + "license": "MIT" + }, + "node_modules/mlly": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.5.0.tgz", + "integrity": "sha512-NPVQvAY1xr1QoVeG0cy8yUYC7FQcOx6evl/RjT1wL5FvzPnzOysoqB/jmx/DhssT2dYa8nxECLAaFI/+gVLhDQ==", + "dev": true, + "dependencies": { + "acorn": "^8.11.3", + "pathe": "^1.1.2", + "pkg-types": "^1.0.3", + "ufo": "^1.3.2" + } + }, + "node_modules/mlly/node_modules/acorn": { + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/ms": { "version": "2.1.2", "dev": true, "license": "MIT" }, + "node_modules/nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, "node_modules/natural-compare": { "version": "1.4.0", "dev": true, @@ -1797,6 +2549,33 @@ "validate-npm-package-license": "^3.0.1" } }, + "node_modules/npm-run-path": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.2.0.tgz", + "integrity": "sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-path/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/object-inspect": { "version": "1.9.0", "dev": true, @@ -1856,6 +2635,21 @@ "wrappy": "1" } }, + "node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", @@ -1873,6 +2667,21 @@ "node": ">= 0.8.0" } }, + "node_modules/p-limit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", + "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -1907,6 +2716,27 @@ "dev": true, "license": "MIT" }, + "node_modules/pathe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "dev": true + }, + "node_modules/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, "node_modules/pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", @@ -1995,6 +2825,45 @@ "node": ">=4" } }, + "node_modules/pkg-types": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", + "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", + "dev": true, + "dependencies": { + "jsonc-parser": "^3.2.0", + "mlly": "^1.2.0", + "pathe": "^1.1.0" + } + }, + "node_modules/postcss": { + "version": "8.4.33", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.33.tgz", + "integrity": "sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -2016,6 +2885,32 @@ "node": ">=10.13.0" } }, + "node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", @@ -2034,6 +2929,12 @@ "safe-buffer": "^5.1.0" } }, + "node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true + }, "node_modules/regexpp": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", @@ -2174,6 +3075,24 @@ "node": ">=8" } }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/slice-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", @@ -2197,6 +3116,15 @@ "integrity": "sha512-9LK+E7Hv5R9u4g4C3p+jjLstaLe11MDsL21UpYaCNmapvMkYhqCV4A/f/3gyH8QjMyh6l68q9xC85vihY9ahMQ==", "dev": true }, + "node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/source-map-support": { "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", @@ -2250,6 +3178,18 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true + }, + "node_modules/std-env": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", + "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", + "dev": true + }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -2300,6 +3240,18 @@ "node": ">=8" } }, + "node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -2312,6 +3264,30 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/strip-literal": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.3.0.tgz", + "integrity": "sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==", + "dev": true, + "dependencies": { + "acorn": "^8.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/strip-literal/node_modules/acorn": { + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/supports-color": { "version": "7.2.0", "dev": true, @@ -2396,6 +3372,30 @@ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, + "node_modules/tinybench": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", + "integrity": "sha512-N8hW3PG/3aOoZAN5V/NSAEDz0ZixDSSt5b/a05iqtpgfLWMSVuCo7w0k2vVvEjdrIoeGqZzweX2WlyioNIHchA==", + "dev": true + }, + "node_modules/tinypool": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.1.tgz", + "integrity": "sha512-zBTCK0cCgRROxvs9c0CGK838sPkeokNGdQVUUwHAbynHFlmyJYj825f/oRs528HaIJ97lo0pLIlDUzwN+IorWg==", + "dev": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.0.tgz", + "integrity": "sha512-d2eda04AN/cPOR89F7Xv5bK/jrQEhmcLFe6HFldoeO9AJtps+fqEnh486vnT/8y4bw38pSyxDcTCAq+Ks2aJTg==", + "dev": true, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/tsconfig-paths": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", @@ -2441,6 +3441,15 @@ "node": ">= 0.8.0" } }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/type-fest": { "version": "0.8.1", "dev": true, @@ -2449,6 +3458,12 @@ "node": ">=8" } }, + "node_modules/ufo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.3.2.tgz", + "integrity": "sha512-o+ORpgGwaYQXgqGDwd+hkS4PuZ3QnmqMMxRuajK/a38L6fTpcE5GPIfrf+L/KemFzfUpeUQc1rRS1iDBozvnFA==", + "dev": true + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -2482,6 +3497,149 @@ "spdx-expression-parse": "^3.0.0" } }, + "node_modules/vite": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.0.11.tgz", + "integrity": "sha512-XBMnDjZcNAw/G1gEiskiM1v6yzM4GE5aMGvhWTlHAYYhxb7S3/V1s3m2LDHa8Vh6yIWYYB0iJwsEaS523c4oYA==", + "dev": true, + "dependencies": { + "esbuild": "^0.19.3", + "postcss": "^8.4.32", + "rollup": "^4.2.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vite-node": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.2.1.tgz", + "integrity": "sha512-fNzHmQUSOY+y30naohBvSW7pPn/xn3Ib/uqm+5wAJQJiqQsU0NBR78XdRJb04l4bOFKjpTWld0XAfkKlrDbySg==", + "dev": true, + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.3.4", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "vite": "^5.0.0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vitest": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.2.1.tgz", + "integrity": "sha512-TRph8N8rnSDa5M2wKWJCMnztCZS9cDcgVTQ6tsTFTG/odHJ4l5yNVqvbeDJYJRZ6is3uxaEpFs8LL6QM+YFSdA==", + "dev": true, + "dependencies": { + "@vitest/expect": "1.2.1", + "@vitest/runner": "1.2.1", + "@vitest/snapshot": "1.2.1", + "@vitest/spy": "1.2.1", + "@vitest/utils": "1.2.1", + "acorn-walk": "^8.3.2", + "cac": "^6.7.14", + "chai": "^4.3.10", + "debug": "^4.3.4", + "execa": "^8.0.1", + "local-pkg": "^0.5.0", + "magic-string": "^0.30.5", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "std-env": "^3.5.0", + "strip-literal": "^1.3.0", + "tinybench": "^2.5.1", + "tinypool": "^0.8.1", + "vite": "^5.0.0", + "vite-node": "1.2.1", + "why-is-node-running": "^2.2.2" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/node": "^18.0.0 || >=20.0.0", + "@vitest/browser": "^1.0.0", + "@vitest/ui": "^1.0.0", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -2497,6 +3655,22 @@ "node": ">= 8" } }, + "node_modules/why-is-node-running": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", + "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", + "dev": true, + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -2516,6 +3690,18 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true + }, + "node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } } } } diff --git a/package.json b/package.json index 5dd7ee4..a43772b 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "main": "dist/searchlights.js", "scripts": { "build": "rollup -c", - "help": "rollup --help" + "help": "rollup --help", + "test": "vitest" }, "browserslist": "> 0.5%, last 2 versions, not dead", "repository": { @@ -36,6 +37,7 @@ "eslint-plugin-promise": "^4.2.1", "prettier": "^2.2.1", "rollup": "^4.9.5", - "rollup-plugin-banner": "^0.2.1" + "rollup-plugin-banner": "^0.2.1", + "vitest": "^1.2.1" } } From dd2a6f44eef998dfdef29d827feac1cad8611879 Mon Sep 17 00:00:00 2001 From: bnjmnrsh Date: Thu, 18 Jan 2024 01:00:29 +0000 Subject: [PATCH 2/9] added esm export --- rollup.config.mjs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/rollup.config.mjs b/rollup.config.mjs index c4db90b..f25300e 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -7,7 +7,7 @@ const pkg = JSON.parse( // Configs const configs = { name: pkg.name, - files: ['searchlights.js'], + files: ['searchlights.js', 'searchlights.mjs'], formats: ['iife'], //, 'es', 'amd', 'cjs' default: 'iife', pathIn: 'src/', @@ -36,6 +36,12 @@ const createOutput = function (filename, minify) { output.name = configs.name ? configs.name : pkg.name output.name = output.name.trim().replace(/\W+/g, '_') } + // A quick intervention for our one mjs file. + if (filename.includes('.mjs')) { + minify = false + output.format = 'es' + output.file = `${configs.pathOut}/${filename}` + } if (minify) { output.plugins = [terser()] } @@ -66,6 +72,8 @@ const createOutputs = function (filename) { /** * Create export object + * + * @param {*} file * @return {Array} The export object */ const createExport = function (file) { From 5a56af194d5adb215fcb619478ed4cae12feffa1 Mon Sep 17 00:00:00 2001 From: bnjmnrsh Date: Thu, 18 Jan 2024 02:38:51 +0000 Subject: [PATCH 3/9] Bump version, add MIT, add update-tests script to clear snapshots --- package.json | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index a43772b..67e2b1c 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,14 @@ { "name": "searchlights.js", - "version": "0.0.2", + "version": "0.0.3", "description": "A js plugin to turn your cursor into an array of searchlights.", "source": "src/searchlights.js", "main": "dist/searchlights.js", "scripts": { "build": "rollup -c", "help": "rollup --help", - "test": "vitest" + "test": "vitest --coverage", + "update-tests": "vitest -u --coverage" }, "browserslist": "> 0.5%, last 2 versions, not dead", "repository": { @@ -22,19 +23,22 @@ "name": "bnjmnrsh", "website": "https://github.com/bnjmnrsh/searchlights" }, - "license": "WTFPL", + "license": "MIT", "bugs": { "url": "https://github.com/bnjmnrsh/searchlights/issues" }, "homepage": "https://github.com/bnjmnrsh/searchlights#readme", "devDependencies": { "@rollup/plugin-terser": "^0.4.4", + "@vitest/coverage-v8": "^1.2.1", + "canvas": "^2.11.2", "eslint": "^7.18.0", "eslint-config-prettier": "^7.2.0", "eslint-config-standard": "^16.0.2", "eslint-plugin-import": "^2.22.1", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.2.1", + "jsdom": "^23.2.0", "prettier": "^2.2.1", "rollup": "^4.9.5", "rollup-plugin-banner": "^0.2.1", From a19db4d81e6ee260759383a2f167577549557322 Mon Sep 17 00:00:00 2001 From: bnjmnrsh Date: Thu, 18 Jan 2024 02:51:10 +0000 Subject: [PATCH 4/9] Subject: vitest requiers single threaded due to use of canvas Reason for Commit:Error: `Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package)` Summary: When starting vitest, we receieve the above error even though the canvas package is installed. The issue below relates this to multithreading issues. The `--pool=forks` flag solves this problem as the expesnse of performance. This is a limitation of the node`canvas` package. Notes: https://github.com/vitest-dev/vitest/issues/3025 https://github.com/vitest-dev/vitest/issues/740#issuecomment-1581232942 https://vitest.dev/guide/migration.html --- package-lock.json | 1226 ++++++++++++++++++++++++++++++++++++++++++++- package.json | 4 +- 2 files changed, 1201 insertions(+), 29 deletions(-) diff --git a/package-lock.json b/package-lock.json index c02381c..63e7b47 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,27 +1,54 @@ { "name": "searchlights.js", - "version": "0.0.2", + "version": "0.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "searchlights.js", - "version": "0.0.2", - "license": "WTFPL", + "version": "0.0.3", + "license": "MIT", "devDependencies": { "@rollup/plugin-terser": "^0.4.4", + "@vitest/coverage-v8": "^1.2.1", + "canvas": "^2.11.2", "eslint": "^7.18.0", "eslint-config-prettier": "^7.2.0", "eslint-config-standard": "^16.0.2", "eslint-plugin-import": "^2.22.1", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.2.1", + "jsdom": "^23.2.0", "prettier": "^2.2.1", "rollup": "^4.9.5", "rollup-plugin-banner": "^0.2.1", "vitest": "^1.2.1" } }, + "node_modules/@ampproject/remapping": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", + "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@asamuzakjp/dom-selector": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@asamuzakjp/dom-selector/-/dom-selector-2.0.2.tgz", + "integrity": "sha512-x1KXOatwofR6ZAYzXRBL5wrdV0vwNxlTCK9NCuLqAzQYARqGcvFwiJA6A1ERuh+dgeA4Dxm3JBYictIes+SqUQ==", + "dev": true, + "dependencies": { + "bidi-js": "^1.0.3", + "css-tree": "^2.3.1", + "is-potential-custom-element-name": "^1.0.1" + } + }, "node_modules/@babel/code-frame": { "version": "7.12.13", "dev": true, @@ -30,10 +57,23 @@ "@babel/highlight": "^7.12.13" } }, + "node_modules/@babel/helper-string-parser": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.12.11", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true, - "license": "MIT" + "engines": { + "node": ">=6.9.0" + } }, "node_modules/@babel/highlight": { "version": "7.12.13", @@ -109,6 +149,38 @@ "node": ">=4" } }, + "node_modules/@babel/parser": { + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.6.tgz", + "integrity": "sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/types": { + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.6.tgz", + "integrity": "sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.23.4", + "@babel/helper-validator-identifier": "^7.22.20", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.19.11", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.11.tgz", @@ -522,6 +594,15 @@ "node": ">= 4" } }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/@jest/schemas": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", @@ -592,6 +673,90 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@mapbox/node-pre-gyp": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", + "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", + "dev": true, + "dependencies": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/make-dir/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@rollup/plugin-terser": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-0.4.4.tgz", @@ -795,12 +960,45 @@ "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "dev": true + }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", "dev": true }, + "node_modules/@vitest/coverage-v8": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-1.2.1.tgz", + "integrity": "sha512-fJEhKaDwGMZtJUX7BRcGxooGwg1Hl0qt53mVup/ZJeznhvL5EodteVnb/mcByhEcvVWbK83ZF31c7nPEDi4LOQ==", + "dev": true, + "dependencies": { + "@ampproject/remapping": "^2.2.1", + "@bcoe/v8-coverage": "^0.2.3", + "debug": "^4.3.4", + "istanbul-lib-coverage": "^3.2.2", + "istanbul-lib-report": "^3.0.1", + "istanbul-lib-source-maps": "^4.0.1", + "istanbul-reports": "^3.1.6", + "magic-string": "^0.30.5", + "magicast": "^0.3.3", + "picocolors": "^1.0.0", + "std-env": "^3.5.0", + "test-exclude": "^6.0.0", + "v8-to-istanbul": "^9.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "vitest": "^1.0.0" + } + }, "node_modules/@vitest/expect": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.2.1.tgz", @@ -870,6 +1068,12 @@ "url": "https://opencollective.com/vitest" } }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, "node_modules/acorn": { "version": "7.4.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", @@ -900,6 +1104,18 @@ "node": ">=0.4.0" } }, + "node_modules/agent-base": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", + "dev": true, + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -948,6 +1164,25 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "dev": true + }, + "node_modules/are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "dev": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -1011,11 +1246,26 @@ "node": ">=8" } }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true + }, "node_modules/balanced-match": { "version": "1.0.0", "dev": true, "license": "MIT" }, + "node_modules/bidi-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/bidi-js/-/bidi-js-1.0.3.tgz", + "integrity": "sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw==", + "dev": true, + "dependencies": { + "require-from-string": "^2.0.2" + } + }, "node_modules/brace-expansion": { "version": "1.1.11", "dev": true, @@ -1061,6 +1311,21 @@ "node": ">=6" } }, + "node_modules/canvas": { + "version": "2.11.2", + "resolved": "https://registry.npmjs.org/canvas/-/canvas-2.11.2.tgz", + "integrity": "sha512-ItanGBMrmRV7Py2Z+Xhs7cT+FNt5K0vPL4p9EZ/UX/Mu7hFbkxSjKF2KVtPwX7UYWp7dRKnrTvReflgrItJbdw==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "@mapbox/node-pre-gyp": "^1.0.0", + "nan": "^2.17.0", + "simple-get": "^3.0.3" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/chai": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", @@ -1091,6 +1356,15 @@ "node": "*" } }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/color-convert": { "version": "2.0.1", "dev": true, @@ -1107,6 +1381,27 @@ "dev": true, "license": "MIT" }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "dev": true, + "bin": { + "color-support": "bin.js" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", @@ -1118,6 +1413,12 @@ "dev": true, "license": "MIT" }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "dev": true + }, "node_modules/contains-path": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", @@ -1127,6 +1428,12 @@ "node": ">=0.10.0" } }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -1141,6 +1448,44 @@ "node": ">= 8" } }, + "node_modules/css-tree": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", + "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==", + "dev": true, + "dependencies": { + "mdn-data": "2.0.30", + "source-map-js": "^1.0.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" + } + }, + "node_modules/cssstyle": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.0.1.tgz", + "integrity": "sha512-8ZYiJ3A/3OkDd093CBT/0UKDWry7ak4BdPTFP2+QEP7cmhouyq/Up709ASSj2cK02BbZiMgk7kYjZNS4QP5qrQ==", + "dev": true, + "dependencies": { + "rrweb-cssom": "^0.6.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/data-urls": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", + "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==", + "dev": true, + "dependencies": { + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -1158,6 +1503,24 @@ } } }, + "node_modules/decimal.js": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", + "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", + "dev": true + }, + "node_modules/decompress-response": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", + "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", + "dev": true, + "dependencies": { + "mimic-response": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/deep-eql": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", @@ -1187,6 +1550,30 @@ "node": ">= 0.4" } }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "dev": true + }, + "node_modules/detect-libc": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", + "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/diff-sequences": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", @@ -1226,6 +1613,18 @@ "node": ">=8.6" } }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/error-ex": { "version": "1.3.2", "dev": true, @@ -1955,6 +2354,44 @@ "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", "dev": true }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "dev": true, @@ -1985,13 +2422,39 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, - "node_modules/get-func-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", - "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "node_modules/gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", "dev": true, + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + }, "engines": { - "node": "*" + "node": ">=10" + } + }, + "node_modules/gauge/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "node_modules/get-func-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "dev": true, + "engines": { + "node": "*" } }, "node_modules/get-intrinsic": { @@ -2084,11 +2547,61 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "dev": true + }, "node_modules/hosted-git-info": { "version": "2.8.8", "dev": true, "license": "ISC" }, + "node_modules/html-encoding-sniffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz", + "integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==", + "dev": true, + "dependencies": { + "whatwg-encoding": "^3.1.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "node_modules/http-proxy-agent": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz", + "integrity": "sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==", + "dev": true, + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz", + "integrity": "sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==", + "dev": true, + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/human-signals": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", @@ -2098,6 +2611,18 @@ "node": ">=16.17.0" } }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/ignore": { "version": "5.1.8", "dev": true, @@ -2223,6 +2748,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true + }, "node_modules/is-regex": { "version": "1.1.2", "dev": true, @@ -2288,6 +2819,56 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", + "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", + "dev": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "dev": true, @@ -2306,6 +2887,46 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsdom": { + "version": "23.2.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-23.2.0.tgz", + "integrity": "sha512-L88oL7D/8ufIES+Zjz7v0aes+oBMh2Xnh3ygWvL0OaICOomKEPKuPnIfBJekiXr+BHbbMjrWn/xqrDQuxFTeyA==", + "dev": true, + "dependencies": { + "@asamuzakjp/dom-selector": "^2.0.1", + "cssstyle": "^4.0.1", + "data-urls": "^5.0.0", + "decimal.js": "^10.4.3", + "form-data": "^4.0.0", + "html-encoding-sniffer": "^4.0.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.2", + "is-potential-custom-element-name": "^1.0.1", + "parse5": "^7.1.2", + "rrweb-cssom": "^0.6.0", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^4.1.3", + "w3c-xmlserializer": "^5.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^3.1.1", + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0", + "ws": "^8.16.0", + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "canvas": "^2.11.2" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -2452,12 +3073,80 @@ "node": ">=12" } }, + "node_modules/magicast": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.3.3.tgz", + "integrity": "sha512-ZbrP1Qxnpoes8sz47AM0z08U+jW6TyRgZzcWy3Ma3vDhJttwMwAFDMMQFobwdBxByBD46JYmxRzeF7w2+wJEuw==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.23.6", + "@babel/types": "^7.23.6", + "source-map-js": "^1.0.2" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mdn-data": { + "version": "2.0.30", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", + "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==", + "dev": true + }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/mimic-fn": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", @@ -2470,6 +3159,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/mimic-response": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", + "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/minimatch": { "version": "3.0.4", "dev": true, @@ -2486,6 +3187,52 @@ "dev": true, "license": "MIT" }, + "node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/mlly": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.5.0.tgz", @@ -2515,6 +3262,12 @@ "dev": true, "license": "MIT" }, + "node_modules/nan": { + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.18.0.tgz", + "integrity": "sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w==", + "dev": true + }, "node_modules/nanoid": { "version": "3.3.7", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", @@ -2538,6 +3291,63 @@ "dev": true, "license": "MIT" }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dev": true, + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-fetch/node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true + }, + "node_modules/node-fetch/node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true + }, + "node_modules/node-fetch/node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "dev": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/normalize-package-data": { "version": "2.5.0", "dev": true, @@ -2576,6 +3386,27 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "dev": true, + "dependencies": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/object-inspect": { "version": "1.9.0", "dev": true, @@ -2694,6 +3525,18 @@ "node": ">=6" } }, + "node_modules/parse5": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "dev": true, + "dependencies": { + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, "node_modules/path-is-absolute": { "version": "1.0.1", "dev": true, @@ -2920,6 +3763,27 @@ "node": ">=0.4.0" } }, + "node_modules/psl": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", + "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", + "dev": true + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true + }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -2935,6 +3799,20 @@ "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", "dev": true }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/regexpp": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", @@ -2956,6 +3834,12 @@ "node": ">=0.10.0" } }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "dev": true + }, "node_modules/resolve": { "version": "1.19.0", "dev": true, @@ -3032,10 +3916,49 @@ "lodash.template": "^4.4.0" } }, + "node_modules/rrweb-cssom": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", + "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", + "dev": true + }, "node_modules/safe-buffer": { - "version": "5.1.2", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "dev": true, - "license": "MIT" + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "node_modules/saxes": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", + "dev": true, + "dependencies": { + "xmlchars": "^2.2.0" + }, + "engines": { + "node": ">=v12.22.7" + } }, "node_modules/semver": { "version": "5.7.1", @@ -3054,6 +3977,12 @@ "randombytes": "^2.1.0" } }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "dev": true + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -3093,6 +4022,37 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/simple-get": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz", + "integrity": "sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==", + "dev": true, + "dependencies": { + "decompress-response": "^4.2.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, "node_modules/slice-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", @@ -3116,6 +4076,15 @@ "integrity": "sha512-9LK+E7Hv5R9u4g4C3p+jjLstaLe11MDsL21UpYaCNmapvMkYhqCV4A/f/3gyH8QjMyh6l68q9xC85vihY9ahMQ==", "dev": true }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/source-map-js": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", @@ -3135,15 +4104,6 @@ "source-map": "^0.6.0" } }, - "node_modules/source-map-support/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/spdx-correct": { "version": "3.1.1", "dev": true, @@ -3190,6 +4150,15 @@ "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", "dev": true }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -3299,6 +4268,12 @@ "node": ">=8" } }, + "node_modules/symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dev": true + }, "node_modules/table": { "version": "6.0.7", "resolved": "https://registry.npmjs.org/table/-/table-6.0.7.tgz", @@ -3336,6 +4311,23 @@ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "dev": true }, + "node_modules/tar": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz", + "integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==", + "dev": true, + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/terser": { "version": "5.27.0", "resolved": "https://registry.npmjs.org/terser/-/terser-5.27.0.tgz", @@ -3366,6 +4358,20 @@ "node": ">=0.4.0" } }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -3396,6 +4402,42 @@ "node": ">=14.0.0" } }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/tough-cookie": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", + "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", + "dev": true, + "dependencies": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.2.0", + "url-parse": "^1.5.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tr46": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.0.0.tgz", + "integrity": "sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==", + "dev": true, + "dependencies": { + "punycode": "^2.3.1" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/tsconfig-paths": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", @@ -3464,6 +4506,15 @@ "integrity": "sha512-o+ORpgGwaYQXgqGDwd+hkS4PuZ3QnmqMMxRuajK/a38L6fTpcE5GPIfrf+L/KemFzfUpeUQc1rRS1iDBozvnFA==", "dev": true }, + "node_modules/universalify": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -3473,21 +4524,42 @@ "punycode": "^2.1.0" } }, - "node_modules/uri-js/node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", "dev": true, - "engines": { - "node": ">=6" + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" } }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true + }, "node_modules/v8-compile-cache": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==", "dev": true }, + "node_modules/v8-to-istanbul": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz", + "integrity": "sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, "node_modules/validate-npm-package-license": { "version": "3.0.4", "dev": true, @@ -3640,6 +4712,61 @@ } } }, + "node_modules/w3c-xmlserializer": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", + "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", + "dev": true, + "dependencies": { + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-encoding": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", + "dev": true, + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-mimetype": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-url": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.0.0.tgz", + "integrity": "sha512-1lfMEm2IEr7RIV+f4lUNPOqfFL+pO+Xw3fJSqmjX9AbXcXcYOkCe1P6+9VBZB6n94af16NfZf+sSk0JCBZC9aw==", + "dev": true, + "dependencies": { + "tr46": "^5.0.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -3671,6 +4798,15 @@ "node": ">=8" } }, + "node_modules/wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "dev": true, + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, "node_modules/word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -3685,6 +4821,42 @@ "dev": true, "license": "ISC" }, + "node_modules/ws": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz", + "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==", + "dev": true, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xml-name-validator": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true + }, "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", diff --git a/package.json b/package.json index 67e2b1c..046b719 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "scripts": { "build": "rollup -c", "help": "rollup --help", - "test": "vitest --coverage", - "update-tests": "vitest -u --coverage" + "test": "vitest --coverage --pool=forks", + "update-tests": "vitest -u --coverage --pool=forks" }, "browserslist": "> 0.5%, last 2 versions, not dead", "repository": { From 66db0482cc3bebb5e7e0cf1095a0f99ad6ed73d2 Mon Sep 17 00:00:00 2001 From: bnjmnrsh Date: Thu, 18 Jan 2024 02:52:21 +0000 Subject: [PATCH 5/9] offer esm export --- src/searchlights.js | 670 +---------------------------------------- src/searchlights.mjs | 687 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 689 insertions(+), 668 deletions(-) create mode 100644 src/searchlights.mjs diff --git a/src/searchlights.js b/src/searchlights.js index a8c8ece..815e430 100644 --- a/src/searchlights.js +++ b/src/searchlights.js @@ -1,674 +1,8 @@ +import searchLights from './searchlights.mjs' /** * searchlights.js * * @param {object} options * @returns {object} searchLights */ -window.searchLights = function (options) { - // * Default element values - const _Defaults = { - blur: 3, - dia: 100, - blend: 'screen', - opacity: 0.8, - easing: 'ease-out', - timing: 90, - width: undefined, - height: undefined, - color: undefined, - zindex: 0, - } - _Defaults.aSrchLtElsOpts = [ - { - classes: ['red', 'srchLts-def'], - color: 'rgb(255,0,0)', - dia: _Defaults.dia, - blur: _Defaults.blur, - blend: _Defaults.blend, - opacity: _Defaults.opacity, - timing: 400, - }, - { - classes: ['green', 'srchLts-def'], - color: 'rgb(0,255,0)', - dia: _Defaults.dia, - blur: _Defaults.blur, - blend: _Defaults.blend, - opacity: _Defaults.opacity, - timing: 425, - }, - { - classes: ['blue', 'srchLts-def'], - color: 'rgb(0,0,255)', - dia: _Defaults.dia, - blur: _Defaults.blur, - blend: _Defaults.blend, - opacity: _Defaults.opacity, - timing: 475, - }, - ] - - // * Private internal helper methods - /** - * Test if provided element is a DOM node - * - * @param {DOM element} el - * @returns {boolean} - */ - const _fnIsDOM = (el) => el instanceof Element - - /** - * Test for if provided value is a NodeList, through existence of item(). - * - * @param {nodeList} nl - * @returns {boolean} - */ - const _fnIsNodeList = (nl) => (nl ? typeof nl.item !== 'undefined' : false) - - /** - * Checks if the browser reports supporting mixBlendingMode - * Adds the class "mixBlendMode" to body if the browser supports it. - * - * A JS based test is nessicary here as IE11 and doesn't support mix-blend-mode, nor does it - * support @supports. - * - * Note Safari has partial support, and will return true, despite not supporting the following: - * hue, saturation, color, and luminosity - * - * https://caniuse.com/css-mixblendmode - * - * @returns {boolean} - */ - const _fnSupportsBlend = function () { - const bSupported = - typeof window.getComputedStyle(document.body).mixBlendMode !== - 'undefined' - bSupported ? document.body.classList.add('mix-blend-mode') : '' - return bSupported - } - - /** - * Builds the base syles for searchLights and prepends them to the head - * Use of display none helps prevent FOUS - * We use opacity 0, so that opacity transitions rather then just 'appearing' on the screen. - * - * @returns {node} DOM style element with content - */ - const _fnSetBaseStyles = function () { - const nBaseStyleEl = document.createElement('style') - nBaseStyleEl.innerHTML = ` -.mix-blend-mode ${sL.sTargetClass} { - position: absolute; - will-change: transform, opacity, left, top; -}` - nBaseStyleEl.setAttribute('srchlts', '') - document.head.insertAdjacentElement('afterbegin', nBaseStyleEl) - } - - /** - * Set an element's opacity mode - * - * @param {node} n - * @param {float} fOpacity - */ - const _fnSetOpacity = function (n, fOpacity = sL.settings.opacity) { - // test incoming values - if (!_fnIsDOM(n) || typeof fOpacity !== 'number') return - n.style.opacity = fOpacity - } - - /** - * Set an element's blend mode - * - * @param {node} n - * @param {string} sBlend - */ - const _fnSetBlending = function (n, sBlend = sL.settings.blend) { - // test incoming values - if (!_fnIsDOM(n) || typeof sBlend !== 'string') return - n.style.mixBlendMode = sBlend - } - - /** - * Set an element's easing (transitionTimingFunction) - * - * @param {node} n - * @param {string} sEasing - */ - const _fnSetEasing = function (n, sEasing = sL.settings.easing) { - // test incoming values - if (!_fnIsDOM(n) || typeof sEasing !== 'string') return - n.style.transitionTimingFunction = sEasing - } - - /** - * Set an element's transition in milliseconds - * - * @todo fix incoming number/string issue - * - * @param {node} n - * @param {int} iTiming - */ - const _fnSetTiming = function (n, iTiming = sL.settings.transition) { - // if (!_fnIsDOM(n) || typeof iTiming !== 'number') return - n.style.transitionDuration = iTiming + 'ms' - } - - /** - * Set an element's z-index - * - * - * @param {node} n - * @param {int} iZindex - */ - const _fnSetZindex = function (n, iZindex = sL.settings.zIndex) { - // test incoming values - if (!_fnIsDOM(n) || typeof iZindex !== 'number') return - n.style.zIndex = iZindex - } - - /** - * Event Listener callback functions - * @param {event object} e - */ - const _fnPointerFollow = function (e) { - sL.m.fnFollowPtr(e, sL._data._nlSrchLtsEls) - sL.fnPtrMoveCallbk(e, sL) - } - const _fnPointerEnter = function (e) { - sL.m.fnSrchLtElsShow(sL._data._nlSrchLtsEls, e, sL) - sL.fnPtrEnterCallbk(e, sL) - } - const _fnPointerLeave = function (e) { - sL.m.fnSrchLtElsHide(sL._data._nlSrchLtsEls, e, sL) - sL.fnPtrLeaveCallbk(e, sL) - } - - /** - * Create the sL.options object - * by combining any provided user options with the _Defaults object. - * - * @param {object} oOptions - */ - const _fnBuildSettingsObj = function (oOptions) { - // copy the _Defaults obj so we dont accidently mutate it - let oDefaultsCopy = { ..._Defaults } - - // Allow user to override any API method by including tehm with their options object. - sL = Object.assign(sL, oOptions) - - // do we have any current elements in the DOM? - const nlCurrentEls = document.querySelectorAll(sL.sTargetClass) - - // TODO cleanup - if ( - sL._data._aDOMhadEls.length && - oOptions && - oOptions.aSrchLtElsOpts === 'undefined' - ) { - // delete the _Default.aSrchLtElsOpts - // if we've had DOM els, and we're not reciving any oOptions.aSrchLtElsOpts - delete oDefaultsCopy.aSrchLtElsOpts - } else { - // TODO cleanup - // if we found some previously - if (nlCurrentEls.length) { - // delete the _Default.aSrchLtElsOpts - // if we have some in the DOM already - delete oDefaultsCopy.aSrchLtElsOpts - } - - if (!sL._data._aDOMhadEls.length) { - // We've not been here before - // Turn the node list into an array - sL._data._aDOMhadEls = [...nlCurrentEls] - // Add our custom parentNode prop to each el, - // as el.parentNode is lost after removal from DOM - sL._data._aDOMhadEls.forEach(function (n, i) { - n.srchLtParentNode = sL._data._aDOMhadEls[i].parentNode - n.srchLtPeviousElementSibling = - sL._data._aDOMhadEls[i].previousElementSibling - }) - } - } - // create a new settings obj by merge the incoming options with oDefaultsCopy - sL.settings = Object.assign({}, oDefaultsCopy, sL.options) - - // If the user didn't provide options.aSrchLtElsOpts, or only partial options - // then we merge any missing top level options into each el as default values. - if (oOptions && oOptions.options.aSrchLtElsOpts !== undefined) { - sL.settings.aSrchLtElsOpts.forEach((srchLtEl, i) => { - srchLtEl = Object.assign( - srchLtEl, - oOptions.options.aSrchLtElsOpts[i] - ) - srchLtEl = Object.assign({}, oDefaultsCopy, srchLtEl) - // prevent Inception moment that later creates a data-srchltels[obj] attr - delete srchLtEl.aSrchLtElsOpts - sL.settings.aSrchLtElsOpts[i] = srchLtEl - }) - } - - // Now that we have set up Defaults, grab the parent to attach to - sL._data._nSrchLtsParent = document.querySelector(sL.sParentEl) - } - - /** - * Add searchLight elements to DOM, apply inline styles, and render the Context. - */ - const _fnAssembleSrchLtEls = function () { - sL._data._nlSrchLtsEls = sL.m.fnCreateSrchLtEls( - sL.settings.aSrchLtElsOpts, - sL.sTargetClass - ) - - if (sL._data._nlSrchLtsEls) { - // draw each element - sL._data._nlSrchLtsEls.forEach(function (el) { - if (!_fnIsDOM(el)) return - - // create the 2d conext - const oCtx = sL.m.fnCreateCtx(el, sL) - - // Set each element's specific styles - sL.m.fnCenterOnPtr(el) - - // if bUseInlineStyles is true assign the styles to each element - if (sL.bUseInlineStyles) { - _fnSetBlending(el, oCtx.srchLt.blend) - _fnSetOpacity(el, oCtx.srchLt.opacity) - _fnSetEasing(el, oCtx.srchLt.easing) - _fnSetTiming(el, oCtx.srchLt.timing) - _fnSetZindex(el, oCtx.srchLt.zindex) - } - - // do any rendering on the elements - sL.m.fnDraw(oCtx) - }) - } - } - - // * The public searchLights object - let sL = {} - - // Default parent to attach searchLight elements to - sL.sParentEl = 'body' - // Default seachLight element class - sL.sTargetClass = '.searchlight' - // Prevent most inline styles on serchLight elements - sL.bUseInlineStyles = true - // Enables the hiding of searchLight elements when the pointer exits the parent El - sL.bEnableShowHide = true - - // * searchLight Private objects - sL._data = {} - // An array of captured srchLt DOM api elements if they exsist on first load - sL._data._aDOMhadEls = [] - // A nodeList of current srchLt elemtnts - sL._data._nlSrchLtsEls - // The srchLts parent node - sL._data._nSrchLtsParent - - // * searchLights Public API methods - sL.m = {} - - /** - * Follow the pointer - * - * @param {event object} e - * @param {nodeList} nl - */ - sL.m.fnFollowPtr = function (e, nl) { - if (!_fnIsNodeList(nl)) return - - nl.forEach(function (el) { - el.style.left = e.pageX + 'px' - el.style.top = e.pageY + 'px' - }) - sL.m.fnSrchLtElsShow(nl, e, sL) - } - - /** - * Takes an array of class names, and merges it with any provided string - * It will strip empty values and remove any stray peroids(.) from user data - * It returns the assembled string of classes. - * - * @param {array} aClasses - * @param {string} s - * - * @returns string of css classes - */ - sL.m.fnStringifyClassArray = function (aClasses = [], s = '') { - // Leave the origional array alone - let aClassesCopy = [...aClasses] - // merge with provided string - aClassesCopy.push(s) - // Remove fasey elememts - aClassesCopy.filter(Boolean) - // Remove duplicates - aClassesCopy = [...new Set(aClassesCopy)] - // Return string, removing full stops and extra spaces - return aClassesCopy.join(' ').replace(/\s\s+/g, ' ').replace(/[.]/g, '') - } - - /** - * A terse debouce function - * - * @param {function} fn - * @param {int} iDelay - * @returns {function} - */ - sL.m._fnDbnce = (fn, iDelay = 300) => { - let timer - return (...args) => { - clearTimeout(timer) - timer = setTimeout(() => { - fn(...args) - }, iDelay) - } - } - - /** - * Create canvas elements using provided array of aSrchLtElsOpts - * Returns the resulting DOM NodeList of canvas elements. - * - * - * @param {array} [aSrchLtElsOpts] - * @param {string} sTargetClass - * @returns {nodeList} - */ - sL.m.fnCreateSrchLtEls = function ( - aSrchLtElsOpts = [], - sTargetClass = sL.sTargetClass - ) { - if (aSrchLtElsOpts.length) { - // We have element options, so create them - const htmlTemp = document.createDocumentFragment() - aSrchLtElsOpts.forEach(function (aSrchLtElsOpts) { - const nCanvas = document.createElement('canvas') - // Add classes - nCanvas.className = sL.m.fnStringifyClassArray( - aSrchLtElsOpts.classes, - sTargetClass - ) - - // copy the current aSrchLtElsOpts into a new object - const aCopySrchLtEls = { ...aSrchLtElsOpts } - - // remove the classes array - delete aCopySrchLtEls.classes - - // turn any incoming settings.aSrchLtElsOpt into data attributes - // used for showHide and other flags - for (const property in aCopySrchLtEls) { - if (aCopySrchLtEls[property]) { - nCanvas.setAttribute( - `data-${property}`, - `${aCopySrchLtEls[property]}` - ) - } - } - htmlTemp.prepend(nCanvas) - }) - - // Attach it to the DOM - sL._data._nSrchLtsParent - ? sL._data._nSrchLtsParent.prepend(htmlTemp) - : '' - } - // refresh the nodeList of searchlight elements now in the DOM - const nlAllSrcLtsEls = document.querySelectorAll(sTargetClass) - return nlAllSrcLtsEls ? nlAllSrcLtsEls : -1 - } - - /** - * Creates a 2D context from the provided canvas element - * sanitise dataset values used in drawing - * - * @param {node} canvasEl - * @returns {object} context object, with element data attrs attached - */ - sL.m.fnCreateCtx = function (canvasEl) { - // If its not a canvas el, return the element - if (canvasEl.tagName !== 'CANVAS') return canvasEl - - const dia = Math.abs(parseInt(canvasEl.dataset.dia || sL.settings.dia)) - const blur = Math.abs( - parseInt(canvasEl.dataset.blur || sL.settings.blur) - ) - - // Set height and width of canvas element - canvasEl.width = dia + blur * 2 - canvasEl.height = dia + blur * 2 - canvasEl.setAttribute('hidden', '') - - const ctx = canvasEl.getContext('2d') - - // copy the current aSrchLtElsOpts into a new object - let oSlsettingsCopy = 'settings' in sL ? { ...sL.settings } : {} - - // Merge the data attrs with settings into ctx object for future use - ctx.srchLt = { ...oSlsettingsCopy, ...canvasEl.dataset } - - return ctx - } - - /** - * Draw elements in provided rendering context - * You could also use values from ctx.canvas.dataset.x, - * but we have them in ctx.srchLt.x, with dia and blur sanitised - * as well as all top level sL.settings, if they were missing off the origional element. - * Any custom data-attrs are included as well. - * - * @param {object} ctx - */ - sL.m.fnDraw = function (ctx) { - if (ctx.constructor.name !== 'CanvasRenderingContext2D') return - - const dia = ctx.srchLt.dia - const blur = parseInt(ctx.srchLt.blur) - ctx.fillStyle = ctx.srchLt.color - ctx.filter = 'blur(' + blur + 'px)' - ctx.beginPath() - ctx.closePath() - ctx.arc( - dia / 2 + blur, - dia / 2 + blur, - Math.abs(dia / 2), - 0, - Math.PI * 2 - ) - ctx.fill() - } - - /** - * Show the srchLt elements - * - * - * @param {event object} e - * @param {nodeList} nodeList - * @param {object} searchLight object - */ - sL.m.fnSrchLtElsShow = function (nodeList, e, sL = {}) { - if (!_fnIsNodeList(nodeList)) return - nodeList.forEach(function (el) { - el.removeAttribute('hidden') - const timing = el.dataset.timing || sL.settings.timing - sL.m._fnDbnce(function () { - el.style.opacity = el.dataset.opacity || sL.settings.opacity - }, timing)() - }) - } - - /** - * Hide the srchLt elements with a nice opacity decay based on the element's timing. - * - * - * @param {event object} e - * @param {nodeList} nodeList - * @param {object} searchLight object - */ - sL.m.fnSrchLtElsHide = function (nodeList, e, sl = {}) { - if (!nodeList) return - nodeList.forEach(function (el) { - if (sL.bEnableShowHide) { - // dial down the opacity - el.style.opacity = '0' - - // Grab timing value of current element - const timing = el.dataset.timing || sL.settings.timing - - // hide DOM after transistion completed - sL.m._fnDbnce(function () { - el.setAttribute('hidden', '') - }, timing)() - } - }) - } - - /** - * Adjusts the style property of a srchLt element so that the cursor is centered over it by default. - * Uses translate3d in order to trigger hardware exceleration - * - * @param {node} n - */ - sL.m.fnCenterOnPtr = function (n) { - if (!_fnIsDOM(n)) return - n.style.transform = - 'translate3d( ' + -n.width / 2 + 'px, ' + -n.height / 2 + 'px, 0)' - } - - /** - * Public callback methods - */ - sL.fnPtrMoveCallbk = function () {} - sL.fnPtrLeaveCallbk = function () {} - sL.fnPtrEnterCallbk = function () {} - - /** - * Sets up event listeners onto the sL._data._nSrchLtsParent element - * TODO: Does this need to be public? - */ - sL.m.fnEventsCreate = function () { - const node = sL._data._nSrchLtsParent - node.addEventListener('pointermove', _fnPointerFollow, false) - node.addEventListener('pointerEnter', _fnPointerEnter, false) - node.addEventListener('pointerleave', _fnPointerLeave, false) - } - - /** - * Destroy event listeners on the sL._data._nSrchLtsParent element - * TODO: Does this need to be public? - */ - sL.m.fnEventsDestroy = function () { - const node = sL._data._nSrchLtsParent - - node.removeEventListener('pointermove', _fnPointerFollow, false) - node.removeEventListener('pointerenter', _fnPointerEnter, false) - node.removeEventListener('pointerleave', _fnPointerLeave, false) - } - - /** - * Build DOM elements - * Takes an array of elements and adds them to the DOM. - * Defaults to any previliously captured srcLt els - * if a target node is provided it will append to it, - * otherwise it will look for our custom node attribute el.srchLtParentNode - * - * @param {arrat} [els=sL._data._aDOMhadEls] - * @param {string} [nTarget=''] - * @returns - */ - sL._build = function (els = sL._data._aDOMhadEls, nTarget = '') { - if (els && els.length) { - // have we been provided a target node? - if (_fnIsDOM(nTarget)) { - const htmlTemp = document.createDocumentFragment() - els.forEach(function (el, i) { - els[i].htmlTemp.appendChild(el) - }) - // this is more efficent for large numbers of elements... - nTarget.appendChild(htmlTemp) - } else { - // otherwise, do the els have a custom srchLtParentNode? - els.forEach(function (el, i) { - if (_fnIsDOM(els[i].srchLtParentNode)) { - els[i].srchLtParentNode.appendChild(el) - } - }) - } - } - return sL - } - - /** - * Public destroy method - * removes event listeners, srchLtEls - * Clears settings & options and ptrs objects - */ - sL._destroy = function () { - // Make sure we have already been initialised - - if (!sL.settings) return - - // Remove event listeners - sL.m.fnEventsDestroy() - // Remove elements we built from Options and added to DOM - // Not ALL srchLt elements that may have been on the DOM initially - if (sL._data._nlSrchLtsEls) { - console.log('destroying') - sL._data._nlSrchLtsEls.forEach(function (el) { - el.setAttribute('hidden', '') - el.remove() - }) - } - - // Nuke run time objects: settings, nodeLists ect - delete sL.options - delete sL.settings - delete sL._data._nlSrchLtsEls - delete sL._data._nSrchLtsParent - // * sL._data._aDOMhadEls is not destroyed so that we have the option to _build() them in future. - - // reset callbacks - sL.fnPtrMoveCallbk = function () {} - sL.fnPtrLeaveCallbk = function () {} - sL.fnPtrEnterCallbk = function () {} - - // remove the style element - const styleEL = document.querySelector('style[srchlts]') - styleEL ? styleEL.remove() : '' - - return sL - } - - /** - * Public init method - * - * @param {object} options - */ - sL._init = function (oOptions) { - // Destroy any preexsiting initialisation - sL._destroy() - - // Bail if browser dosen't support blending modes (see notes on safari) - if (!_fnSupportsBlend()) return - - // Add the base styles to head if bUseInlineStyles - if (sL.bUseInlineStyles) _fnSetBaseStyles() - - // Merge Defaults and user options into new sL.settings object - _fnBuildSettingsObj(oOptions) - - // Draw each searchlight and add it to the DOM - _fnAssembleSrchLtEls() - - // Create event listeners - sL.m.fnEventsCreate() - - // return updated srchLts object - return sL - } - // return public API - return sL -} +window.searchLights = (options) => searchLights(options) diff --git a/src/searchlights.mjs b/src/searchlights.mjs new file mode 100644 index 0000000..003f013 --- /dev/null +++ b/src/searchlights.mjs @@ -0,0 +1,687 @@ +/** + * The base searchLights function. + * + * @param {object} options - searchlight options object. + * @returns {object} searchLights - the searchLights object. + */ +export default function searchLights(options = {}) { + // * Default element values + const _Defaults = { + blur: 3, + dia: 100, + blend: 'screen', + opacity: 0.8, + easing: 'ease-out', + timing: 90, + width: undefined, + height: undefined, + color: undefined, + zindex: 0, + } + _Defaults.aSrchLtElsOpts = [ + { + classes: ['red', 'srchLts-def'], + color: 'rgb(255,0,0)', + dia: _Defaults.dia, + blur: _Defaults.blur, + blend: _Defaults.blend, + opacity: _Defaults.opacity, + timing: 400, + }, + { + classes: ['green', 'srchLts-def'], + color: 'rgb(0,255,0)', + dia: _Defaults.dia, + blur: _Defaults.blur, + blend: _Defaults.blend, + opacity: _Defaults.opacity, + timing: 425, + }, + { + classes: ['blue', 'srchLts-def'], + color: 'rgb(0,0,255)', + dia: _Defaults.dia, + blur: _Defaults.blur, + blend: _Defaults.blend, + opacity: _Defaults.opacity, + timing: 475, + }, + ] + + // * Private internal helper methods + /** + * Test if provided element is a DOM node + * + * @param {DOM element} el + * @returns {boolean} + */ + const _fnIsDOM = (el) => el instanceof Element + + /** + * Test for if provided value is a NodeList, through existence of item(). + * + * @param {nodeList} nl + * @returns {boolean} + */ + const _fnIsNodeList = (nl) => (nl ? typeof nl.item !== 'undefined' : false) + + /** + * Checks if the browser reports supporting mixBlendingMode + * Adds the class "mixBlendMode" to body if the browser supports it. + * + * A JS based test is nessicary here as IE11 and doesn't support mix-blend-mode, nor does it + * support @supports. + * + * Note Safari has partial support, and will return true, despite not supporting the following: + * hue, saturation, color, and luminosity + * + * https://caniuse.com/css-mixblendmode + * + * @returns {boolean} + */ + const _fnSupportsBlend = function () { + const bSupported = + typeof window.getComputedStyle(document.body).mixBlendMode !== + 'undefined' + bSupported ? document.body.classList.add('mix-blend-mode') : '' + return bSupported + } + + /** + * Builds the base syles for searchLights and prepends them to the head + * Use of display none helps prevent FOUC + * We use opacity 0, so that opacity transitions rather then just 'appearing' on the screen. + * + * @returns {node} DOM style element with content + */ + const _fnSetBaseStyles = function () { + const nBaseStyleEl = document.createElement('style') + nBaseStyleEl.innerHTML = ` +.mix-blend-mode ${sL.sTargetClass} { + position: absolute; + will-change: transform, opacity, left, top; +}` + nBaseStyleEl.setAttribute('srchlts', '') + document.head.insertAdjacentElement('afterbegin', nBaseStyleEl) + } + + /** + * Set an element's opacity mode + * + * @param {node} n + * @param {float} fOpacity + */ + const _fnSetOpacity = function (n, fOpacity = sL.settings.opacity) { + // test incoming values + if (!_fnIsDOM(n) || typeof fOpacity !== 'number') return + n.style.opacity = fOpacity + } + + /** + * Set an element's blend mode + * + * @param {node} n + * @param {string} sBlend + */ + const _fnSetBlending = function (n, sBlend = sL.settings.blend) { + // test incoming values + if (!_fnIsDOM(n) || typeof sBlend !== 'string') return + n.style.mixBlendMode = sBlend + } + + /** + * Set an element's easing (transitionTimingFunction) + * + * @param {node} n + * @param {string} sEasing + */ + const _fnSetEasing = function (n, sEasing = sL.settings.easing) { + // test incoming values + if (!_fnIsDOM(n) || typeof sEasing !== 'string') return + n.style.transitionTimingFunction = sEasing + } + + /** + * Set an element's transition in milliseconds + * + * @todo fix incoming number/string issue + * + * @param {node} n + * @param {int} iTiming + */ + const _fnSetTiming = function (n, iTiming = sL.settings.transition) { + // if (!_fnIsDOM(n) || typeof iTiming !== 'number') return + n.style.transitionDuration = iTiming + 'ms' + } + + /** + * Set an element's z-index + * + * + * @param {node} n + * @param {int} iZindex + */ + const _fnSetZindex = function (n, iZindex = sL.settings.zIndex) { + // test incoming values + if (!_fnIsDOM(n) || typeof iZindex !== 'number') return + n.style.zIndex = iZindex + } + + /** + * PointerFollow Event Listener callback + * + * @param {event object} e + */ + const _fnPointerFollow = function (e) { + sL.m.fnFollowPtr(e, sL._data._nlSrchLtsEls) + sL.fnPtrMoveCallbk(e, sL) + } + + /** + * PointerEnter Event Listener callback + * + * @param {event object} e + */ + const _fnPointerEnter = function (e) { + sL.m.fnSrchLtElsShow(sL._data._nlSrchLtsEls, e, sL) + sL.fnPtrEnterCallbk(e, sL) + } + + /** + * PointerLeave Event Listener callback + * + * @param {event object} e + */ + const _fnPointerLeave = function (e) { + sL.m.fnSrchLtElsHide(sL._data._nlSrchLtsEls, e, sL) + sL.fnPtrLeaveCallbk(e, sL) + } + + /** + * Create the sL.options object + * by combining any provided user options with the _Defaults object. + * + * @param {object} oOptions + */ + const _fnBuildSettingsObj = function (oOptions) { + // copy the _Defaults obj so we dont accidently mutate it + let oDefaultsCopy = { ..._Defaults } + + // Allow user to override any API method by including tehm with their options object. + sL = Object.assign(sL, oOptions) + + // do we have any current elements in the DOM? + const nlCurrentEls = document.querySelectorAll(sL.sTargetClass) + + // TODO cleanup + if ( + sL._data._aDOMhadEls.length && + oOptions && + oOptions.aSrchLtElsOpts === 'undefined' + ) { + // delete the _Default.aSrchLtElsOpts + // if we've had DOM els, and we're not reciving any oOptions.aSrchLtElsOpts + delete oDefaultsCopy.aSrchLtElsOpts + } else { + // TODO cleanup + // if we found some previously + if (nlCurrentEls.length) { + // delete the _Default.aSrchLtElsOpts + // if we have some in the DOM already + delete oDefaultsCopy.aSrchLtElsOpts + } + + if (!sL._data._aDOMhadEls.length) { + // We've not been here before + // Turn the node list into an array + sL._data._aDOMhadEls = [...nlCurrentEls] + // Add our custom parentNode prop to each el, + // as el.parentNode is lost after removal from DOM + sL._data._aDOMhadEls.forEach(function (n, i) { + n.srchLtParentNode = sL._data._aDOMhadEls[i].parentNode + n.srchLtPeviousElementSibling = + sL._data._aDOMhadEls[i].previousElementSibling + }) + } + } + // create a new settings obj by merge the incoming options with oDefaultsCopy + sL.settings = Object.assign({}, oDefaultsCopy, sL.options) + + // If the user didn't provide options.aSrchLtElsOpts, or only partial options + // then we merge any missing top level options into each el as default values. + if (oOptions && oOptions.options.aSrchLtElsOpts !== undefined) { + sL.settings.aSrchLtElsOpts.forEach((srchLtEl, i) => { + srchLtEl = Object.assign( + srchLtEl, + oOptions.options.aSrchLtElsOpts[i] + ) + srchLtEl = Object.assign({}, oDefaultsCopy, srchLtEl) + // prevent Inception moment that later creates a data-srchltels[obj] attr + delete srchLtEl.aSrchLtElsOpts + sL.settings.aSrchLtElsOpts[i] = srchLtEl + }) + } + + // Now that we have set up Defaults, grab the parent to attach to + sL._data._nSrchLtsParent = document.querySelector(sL.sParentEl) + } + + /** + * Add searchLight elements to DOM, apply inline styles, and render the Context. + */ + const _fnAssembleSrchLtEls = function () { + sL._data._nlSrchLtsEls = sL.m.fnCreateSrchLtEls( + sL.settings.aSrchLtElsOpts, + sL.sTargetClass + ) + + if (sL._data._nlSrchLtsEls) { + // draw each element + sL._data._nlSrchLtsEls.forEach(function (el) { + if (!_fnIsDOM(el)) return + + // create the 2d conext + const oCtx = sL.m.fnCreateCtx(el, sL) + + // Set each element's specific styles + sL.m.fnCenterOnPtr(el) + + // if bUseInlineStyles is true assign the styles to each element + if (sL.bUseInlineStyles) { + _fnSetBlending(el, oCtx.srchLt.blend) + _fnSetOpacity(el, oCtx.srchLt.opacity) + _fnSetEasing(el, oCtx.srchLt.easing) + _fnSetTiming(el, oCtx.srchLt.timing) + _fnSetZindex(el, oCtx.srchLt.zindex) + } + + // do any rendering on the elements + sL.m.fnDraw(oCtx) + }) + } + } + + // * The public searchLights object + let sL = {} + + // Default parent to attach searchLight elements to + sL.sParentEl = 'body' + // Default seachLight element class + sL.sTargetClass = '.searchlight' + // Prevent most inline styles on serchLight elements + sL.bUseInlineStyles = true + // Enables the hiding of searchLight elements when the pointer exits the parent El + sL.bEnableShowHide = true + + // * searchLight Private objects + sL._data = {} + // An array of captured srchLt DOM api elements if they exsist on first load + sL._data._aDOMhadEls = [] + // A nodeList of current srchLt elemtnts + sL._data._nlSrchLtsEls + // The srchLts parent node + sL._data._nSrchLtsParent + + // * searchLights Public API methods + sL.m = {} + + /** + * Follow the pointer + * + * @param {event object} e + * @param {nodeList} nl + */ + sL.m.fnFollowPtr = function (e, nl) { + if (!_fnIsNodeList(nl)) return + + nl.forEach(function (el) { + el.style.left = e.pageX + 'px' + el.style.top = e.pageY + 'px' + }) + sL.m.fnSrchLtElsShow(nl, e, sL) + } + + /** + * Takes an array of class names, and merges it with any provided string + * It will strip empty values and remove any stray peroids(.) from user data + * It returns the assembled string of classes. + * + * @param {array} aClasses + * @param {string} s + * + * @returns string of css classes + */ + sL.m.fnStringifyClassArray = function (aClasses = [], s = '') { + // Leave the origional array alone + let aClassesCopy = [...aClasses] + // merge with provided string + aClassesCopy.push(s) + // Remove fasey elememts + aClassesCopy.filter(Boolean) + // Remove duplicates + aClassesCopy = [...new Set(aClassesCopy)] + // Return string, removing full stops and extra spaces + return aClassesCopy.join(' ').replace(/\s\s+/g, ' ').replace(/[.]/g, '') + } + + /** + * A terse debouce function + * + * @param {function} fn + * @param {int} iDelay + * @returns {function} + */ + sL.m._fnDbnce = (fn, iDelay = 300) => { + let timer + return (...args) => { + clearTimeout(timer) + timer = setTimeout(() => { + fn(...args) + }, iDelay) + } + } + + /** + * Create canvas elements using provided array of aSrchLtElsOpts + * Returns the resulting DOM NodeList of canvas elements. + * + * + * @param {array} [aSrchLtElsOpts] + * @param {string} sTargetClass + * @returns {nodeList} + */ + sL.m.fnCreateSrchLtEls = function ( + aSrchLtElsOpts = [], + sTargetClass = sL.sTargetClass + ) { + if (aSrchLtElsOpts.length) { + // We have element options, so create them + const htmlTemp = document.createDocumentFragment() + aSrchLtElsOpts.forEach(function (aSrchLtElsOpts) { + const nCanvas = document.createElement('canvas') + // Add classes + nCanvas.className = sL.m.fnStringifyClassArray( + aSrchLtElsOpts.classes, + sTargetClass + ) + + // copy the current aSrchLtElsOpts into a new object + const aCopySrchLtEls = { ...aSrchLtElsOpts } + + // remove the classes array + delete aCopySrchLtEls.classes + + // turn any incoming settings.aSrchLtElsOpt into data attributes + // used for showHide and other flags + for (const property in aCopySrchLtEls) { + if (aCopySrchLtEls[property]) { + nCanvas.setAttribute( + `data-${property}`, + `${aCopySrchLtEls[property]}` + ) + } + } + htmlTemp.prepend(nCanvas) + }) + + // Attach it to the DOM + sL._data._nSrchLtsParent + ? sL._data._nSrchLtsParent.prepend(htmlTemp) + : '' + } + // refresh the nodeList of searchlight elements now in the DOM + const nlAllSrcLtsEls = document.querySelectorAll(sTargetClass) + return nlAllSrcLtsEls ? nlAllSrcLtsEls : -1 + } + + /** + * Creates a 2D context from the provided canvas element + * sanitise dataset values used in drawing + * + * @param {node} canvasEl + * @returns {object} context object, with element data attrs attached + */ + sL.m.fnCreateCtx = function (canvasEl) { + // If its not a canvas el, return the element + if (canvasEl.tagName !== 'CANVAS') return canvasEl + + const dia = Math.abs(parseInt(canvasEl.dataset.dia || sL.settings.dia)) + const blur = Math.abs( + parseInt(canvasEl.dataset.blur || sL.settings.blur) + ) + + // Set height and width of canvas element + canvasEl.width = dia + blur * 2 + canvasEl.height = dia + blur * 2 + canvasEl.setAttribute('hidden', '') + + const ctx = canvasEl.getContext('2d') + + // copy the current aSrchLtElsOpts into a new object + let oSlsettingsCopy = 'settings' in sL ? { ...sL.settings } : {} + + // Merge the data attrs with settings into ctx object for future use + ctx.srchLt = { ...oSlsettingsCopy, ...canvasEl.dataset } + + return ctx + } + + /** + * Draw elements in provided rendering context + * You could also use values from ctx.canvas.dataset.x, + * but we have them in ctx.srchLt.x, with dia and blur sanitised + * as well as all top level sL.settings, if they were missing off the origional element. + * Any custom data-attrs are included as well. + * + * @param {object} ctx + */ + sL.m.fnDraw = function (ctx) { + if (ctx.constructor.name !== 'CanvasRenderingContext2D') return + + const dia = ctx.srchLt.dia + const blur = parseInt(ctx.srchLt.blur) + ctx.fillStyle = ctx.srchLt.color + ctx.filter = 'blur(' + blur + 'px)' + ctx.beginPath() + ctx.closePath() + ctx.arc( + dia / 2 + blur, + dia / 2 + blur, + Math.abs(dia / 2), + 0, + Math.PI * 2 + ) + ctx.fill() + } + + /** + * Show the srchLt elements + * + * + * @param {event object} e + * @param {nodeList} nodeList + * @param {object} searchLight object + */ + sL.m.fnSrchLtElsShow = function (nodeList, e, sL = {}) { + if (!_fnIsNodeList(nodeList)) return + nodeList.forEach(function (el) { + el.removeAttribute('hidden') + const timing = el.dataset.timing || sL.settings.timing + sL.m._fnDbnce(function () { + el.style.opacity = el.dataset.opacity || sL.settings.opacity + }, timing)() + }) + } + + /** + * Hide the srchLt elements with a nice opacity decay based on the element's timing. + * + * + * @param {event object} e + * @param {nodeList} nodeList + * @param {object} searchLight object + */ + sL.m.fnSrchLtElsHide = function (nodeList, e, sl = {}) { + if (!nodeList) return + nodeList.forEach(function (el) { + if (sL.bEnableShowHide) { + // dial down the opacity + el.style.opacity = '0' + + // Grab timing value of current element + const timing = el.dataset.timing || sL.settings.timing + + // hide DOM after transistion completed + sL.m._fnDbnce(function () { + el.setAttribute('hidden', '') + }, timing)() + } + }) + } + + /** + * Adjusts the style property of a srchLt element so that the cursor is centered over it by default. + * Uses translate3d in order to trigger hardware exceleration + * + * @param {node} n + */ + sL.m.fnCenterOnPtr = function (n) { + if (!_fnIsDOM(n)) return + n.style.transform = + 'translate3d( ' + -n.width / 2 + 'px, ' + -n.height / 2 + 'px, 0)' + } + + /** + * Sets up event listeners onto the sL._data._nSrchLtsParent element + * TODO: Does this need to be public? + */ + sL.m.fnEventsCreate = function () { + const node = sL._data._nSrchLtsParent + node.addEventListener('pointermove', _fnPointerFollow, false) + node.addEventListener('pointerEnter', _fnPointerEnter, false) + node.addEventListener('pointerleave', _fnPointerLeave, false) + } + + /** + * Destroy event listeners on the sL._data._nSrchLtsParent element + * TODO: Does this need to be public? + */ + sL.m.fnEventsDestroy = function () { + const node = sL._data._nSrchLtsParent + + node.removeEventListener('pointermove', _fnPointerFollow, false) + node.removeEventListener('pointerenter', _fnPointerEnter, false) + node.removeEventListener('pointerleave', _fnPointerLeave, false) + } + + /** + * Public callback methods + */ + sL.fnPtrMoveCallbk = function () {} + sL.fnPtrLeaveCallbk = function () {} + sL.fnPtrEnterCallbk = function () {} + + /** + * Build DOM elements + * Takes an array of elements and adds them to the DOM. + * Defaults to any previliously captured srcLt els + * if a target node is provided it will append to it, + * otherwise it will look for our custom node attribute el.srchLtParentNode + * + * @param {arrat} [els=sL._data._aDOMhadEls] + * @param {string} [nTarget=''] + * @returns + */ + sL._build = function (els = sL._data._aDOMhadEls, nTarget = '') { + if (els && els.length) { + // have we been provided a target node? + if (_fnIsDOM(nTarget)) { + const htmlTemp = document.createDocumentFragment() + els.forEach(function (el, i) { + els[i].htmlTemp.appendChild(el) + }) + // this is more efficent for large numbers of elements... + nTarget.appendChild(htmlTemp) + } else { + // otherwise, do the els have a custom srchLtParentNode? + els.forEach(function (el, i) { + if (_fnIsDOM(els[i].srchLtParentNode)) { + els[i].srchLtParentNode.appendChild(el) + } + }) + } + } + return sL + } + + /** + * Public destroy method + * removes event listeners, srchLtEls + * Clears settings & options and ptrs objects + */ + sL._destroy = function () { + // Make sure we have already been initialised + + if (!sL.settings) return + + // Remove event listeners + sL.m.fnEventsDestroy() + // Remove elements we built from Options and added to DOM + // Not ALL srchLt elements that may have been on the DOM initially + if (sL._data._nlSrchLtsEls) { + console.log('destroying') + sL._data._nlSrchLtsEls.forEach(function (el) { + el.setAttribute('hidden', '') + el.remove() + }) + } + + // Nuke run time objects: settings, nodeLists ect + delete sL.options + delete sL.settings + delete sL._data._nlSrchLtsEls + delete sL._data._nSrchLtsParent + // * sL._data._aDOMhadEls is not destroyed so that we have the option to _build() them in future. + + // reset callbacks + sL.fnPtrMoveCallbk = function () {} + sL.fnPtrLeaveCallbk = function () {} + sL.fnPtrEnterCallbk = function () {} + + // remove the style element + const styleEL = document.querySelector('style[srchlts]') + styleEL ? styleEL.remove() : '' + + return sL + } + + /** + * Public init method + * + * @param {object} options + */ + sL._init = function (oOptions) { + // Destroy any preexsiting initialisation + sL._destroy() + + // Bail if browser dosen't support blending modes (see notes on safari) + if (!_fnSupportsBlend()) return + + // Add the base styles to head if bUseInlineStyles + if (sL.bUseInlineStyles) _fnSetBaseStyles() + + // Merge Defaults and user options into new sL.settings object + _fnBuildSettingsObj(oOptions) + + // Draw each searchlight and add it to the DOM + _fnAssembleSrchLtEls() + + // Create event listeners + sL.m.fnEventsCreate() + + // return updated srchLts object + return sL + } + // return public API + return sL +} From 1827534a1128ddd15c758e6b45843d5fdd2cedbb Mon Sep 17 00:00:00 2001 From: bnjmnrsh Date: Thu, 18 Jan 2024 02:53:51 +0000 Subject: [PATCH 6/9] Vitest config required as we are not using vite. --- vitest.config.mjs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 vitest.config.mjs diff --git a/vitest.config.mjs b/vitest.config.mjs new file mode 100644 index 0000000..53d9c6f --- /dev/null +++ b/vitest.config.mjs @@ -0,0 +1,12 @@ +// vitest.config.js +import { defineConfig } from 'vitest/config' + +export default defineConfig({ + test: { + globals: false, + coverage: { + reporter: ['text', 'html'], + }, + environment: 'jsdom', + }, +}) From fe42d40c3b3765eda7db970aeef285ee8bb82ff5 Mon Sep 17 00:00:00 2001 From: bnjmnrsh Date: Thu, 18 Jan 2024 06:54:46 +0000 Subject: [PATCH 7/9] remove code coverage from being tracked. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index cecf146..22d14af 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ dist/ # Unit test reports TEST*.xml +coverage/ # Generated by MacOS .DS_Store From 3ed5ad948868969e8bad90e401073982e5171dfb Mon Sep 17 00:00:00 2001 From: bnjmnrsh Date: Thu, 18 Jan 2024 06:58:07 +0000 Subject: [PATCH 8/9] typos --- src/searchlights.mjs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/searchlights.mjs b/src/searchlights.mjs index 003f013..f438dc4 100644 --- a/src/searchlights.mjs +++ b/src/searchlights.mjs @@ -588,7 +588,7 @@ export default function searchLights(options = {}) { * if a target node is provided it will append to it, * otherwise it will look for our custom node attribute el.srchLtParentNode * - * @param {arrat} [els=sL._data._aDOMhadEls] + * @param {array} [els=sL._data._aDOMhadEls] * @param {string} [nTarget=''] * @returns */ @@ -623,13 +623,11 @@ export default function searchLights(options = {}) { // Make sure we have already been initialised if (!sL.settings) return - // Remove event listeners sL.m.fnEventsDestroy() // Remove elements we built from Options and added to DOM - // Not ALL srchLt elements that may have been on the DOM initially + // Not ALL srchLt elements may have been on the DOM initially if (sL._data._nlSrchLtsEls) { - console.log('destroying') sL._data._nlSrchLtsEls.forEach(function (el) { el.setAttribute('hidden', '') el.remove() From c2c9e9c4483ff5d58bb8b7120091d9061a9a01ef Mon Sep 17 00:00:00 2001 From: bnjmnrsh Date: Thu, 18 Jan 2024 07:01:03 +0000 Subject: [PATCH 9/9] base test coverage --- tests/sL-copy.iife.empty-opts+DOM.test.js | 33 +++++++++++++ tests/sL.iife.empty-opts+DOM.test.js | 32 +++++++++++++ tests/sL.iife.init.empty-opts+els.test.js | 41 +++++++++++++++++ tests/sL.iife.init.empty-opts.test.js | 13 ++++++ tests/sL.iife.init.with-opts.test.js | 56 +++++++++++++++++++++++ 5 files changed, 175 insertions(+) create mode 100644 tests/sL-copy.iife.empty-opts+DOM.test.js create mode 100644 tests/sL.iife.empty-opts+DOM.test.js create mode 100644 tests/sL.iife.init.empty-opts+els.test.js create mode 100644 tests/sL.iife.init.empty-opts.test.js create mode 100644 tests/sL.iife.init.with-opts.test.js diff --git a/tests/sL-copy.iife.empty-opts+DOM.test.js b/tests/sL-copy.iife.empty-opts+DOM.test.js new file mode 100644 index 0000000..dc64fc8 --- /dev/null +++ b/tests/sL-copy.iife.empty-opts+DOM.test.js @@ -0,0 +1,33 @@ +import '../src/searchlights.js' +import { describe, expect, it } from 'vitest' + +describe('test if _build() and _destroy() work', () => { + document.body.innerHTML = `
` + const sl = window.searchLights()._init() + const sldata = { ...sl._data } + + it('test if searchLight elements are created on the dom', () => { + let nodes = document.querySelectorAll('.searchlight') + // Default number of searchlights + expect(nodes.length).toBe(3) + }) + it('test if searchLights()._destroy() nukes them out of the DOM', () => { + sl._destroy() // nuke them all + let nodes = document.querySelectorAll('.searchlight') + expect(nodes.length).toBe(0) + }) + // At present _build is unreachable due to limitations with jsdom and calling appendChild on documentFragment + // + // it('test if searchLights()._build() creates new ones', () => { + // const els = ` + // + // ` + + // const htmlTemp = document.createElement('div') + // htmlTemp.innerHTML = els + // const canvases = htmlTemp.querySelectorAll('canvas') + // sl._build(canvases, document.body) // build new ones + // let nodes = document.querySelectorAll('.searchlight') + // expect(nodes.length).toBe(3) + // }) +}) diff --git a/tests/sL.iife.empty-opts+DOM.test.js b/tests/sL.iife.empty-opts+DOM.test.js new file mode 100644 index 0000000..5456dcc --- /dev/null +++ b/tests/sL.iife.empty-opts+DOM.test.js @@ -0,0 +1,32 @@ +import '../src/searchlights.js' +import { describe, expect, it } from 'vitest' + +describe('_init() with options, no aSrchLtElsOpts', () => { + document.body.innerHTML = `
+ + +
` + + it('should generate a CanvasRenderingContext2D from the provided canvas element with a pre-defined srchLt object attached from data attributes', () => { + const comparison = { + blur: '3', + dia: '20', + blend: 'normal', + opacity: 0.8, + easing: 'ease-out', + timing: '900', + width: undefined, + height: undefined, + color: 'red', + zindex: 0, + food: 'tacos', + z: '1', + } + + const sl = window.searchLights()._init() + // Create CanvasRenderingContext2D object + const ctx = sl.m.fnCreateCtx(sl._data._aDOMhadEls[0]) + // console.log(ctx.srchLt) + expect(ctx.srchLt).toEqual(comparison) + }) +}) diff --git a/tests/sL.iife.init.empty-opts+els.test.js b/tests/sL.iife.init.empty-opts+els.test.js new file mode 100644 index 0000000..be361af --- /dev/null +++ b/tests/sL.iife.init.empty-opts+els.test.js @@ -0,0 +1,41 @@ +import '../src/searchlights.js' +import { describe, expect, it } from 'vitest' + +describe('_init() sL.settings with options and aSrchLtElsOpts', () => { + document.body.innerHTML = `
` + it('should populate aSrchLtElsOpts aray, and any missing values with _Defaults', () => { + const opts = { + options: { + aSrchLtElsOpts: [ + { + classes: ['test-a', 'blue'], + blur: 1, + color: 'rgb(33, 27, 27)', + dia: 300, + opacity: 0.5, + blend: 'screen', + easing: 'ease-in', + timing: 200, + }, + { + classes: ['test-a', ' red'], + color: 'rgb(15,30,200)', + dia: 250, + blur: 2, + blend: 'normal', + opacity: 1, + }, + { + classes: ['test-a', 'green'], + color: 'rgb(15,200,30)', + opacity: 0.5, + }, + ], + }, + } + const comparison = + '{"aSrchLtElsOpts":[{"blur":1,"dia":300,"blend":"screen","opacity":0.5,"easing":"ease-in","timing":200,"color":"rgb(33, 27, 27)","zindex":0,"classes":["test-a","blue"]},{"blur":2,"dia":250,"blend":"normal","opacity":1,"easing":"ease-out","timing":90,"color":"rgb(15,30,200)","zindex":0,"classes":["test-a"," red"]},{"blur":3,"dia":100,"blend":"screen","opacity":0.5,"easing":"ease-out","timing":90,"color":"rgb(15,200,30)","zindex":0,"classes":["test-a","green"]}]}' + const sl = window.searchLights()._init(opts) + expect(JSON.stringify(sl.options)).toEqual(comparison) + }) +}) diff --git a/tests/sL.iife.init.empty-opts.test.js b/tests/sL.iife.init.empty-opts.test.js new file mode 100644 index 0000000..ecb4936 --- /dev/null +++ b/tests/sL.iife.init.empty-opts.test.js @@ -0,0 +1,13 @@ +import '../src/searchlights.js' +import { describe, expect, it } from 'vitest' + +describe('_init() without options', () => { + document.body.innerHTML = `
` + + it('should populate sL.settings with _Defaults values', () => { + const sl = window.searchLights()._init() + const comparison = + '{"blur":3,"dia":100,"blend":"screen","opacity":0.8,"easing":"ease-out","timing":90,"zindex":0,"aSrchLtElsOpts":[{"classes":["red","srchLts-def"],"color":"rgb(255,0,0)","dia":100,"blur":3,"blend":"screen","opacity":0.8,"timing":400},{"classes":["green","srchLts-def"],"color":"rgb(0,255,0)","dia":100,"blur":3,"blend":"screen","opacity":0.8,"timing":425},{"classes":["blue","srchLts-def"],"color":"rgb(0,0,255)","dia":100,"blur":3,"blend":"screen","opacity":0.8,"timing":475}]}' + expect(JSON.stringify(sl.settings)).toEqual(comparison) + }) +}) diff --git a/tests/sL.iife.init.with-opts.test.js b/tests/sL.iife.init.with-opts.test.js new file mode 100644 index 0000000..5fda093 --- /dev/null +++ b/tests/sL.iife.init.with-opts.test.js @@ -0,0 +1,56 @@ +import '../src/searchlights.js' +import { describe, expect, it } from 'vitest' + +describe('_init() with options.', () => { + document.body.innerHTML = `
` + it('should accept an options object and populate sL.options with the values provided.', () => { + const opts = { + sParentEl: 'body', + sTargetClass: '.searchlight', + bUseInlineStyles: true, + bEnableShowHide: true, + options: { + blur: 2, + dia: 200, + blend: 'difference', + opacity: 0.2, + easing: 'ease', + timing: 20, + zindex: 1, + aSrchLtElsOpts: [ + { + classes: ['test-a', 'blue'], + color: 'rgb(33, 27, 27)', + dia: 300, + blur: 1, + opacity: 0.5, + blend: 'screen', + easing: 'ease-in', + timing: 200, + width: '30px', + height: '30px', + }, + { + classes: ['test-a', ' red'], + color: 'rgb(15,30,200)', + dia: 250, + blur: 2, + blend: 'normal', + opacity: 1, + }, + { + classes: ['test-a', 'green'], + color: 'rgb(15,200,30)', + opacity: 0.5, + }, + ], + }, + } + + const comparison = + '{"blur":2,"dia":200,"blend":"difference","opacity":0.2,"easing":"ease","timing":20,"zindex":1,"aSrchLtElsOpts":[{"blur":1,"dia":300,"blend":"screen","opacity":0.5,"easing":"ease-in","timing":200,"width":"30px","height":"30px","color":"rgb(33, 27, 27)","zindex":0,"classes":["test-a","blue"]},{"blur":2,"dia":250,"blend":"normal","opacity":1,"easing":"ease-out","timing":90,"color":"rgb(15,30,200)","zindex":0,"classes":["test-a"," red"]},{"blur":3,"dia":100,"blend":"screen","opacity":0.5,"easing":"ease-out","timing":90,"color":"rgb(15,200,30)","zindex":0,"classes":["test-a","green"]}]}' + + const sl = window.searchLights()._init(opts) + expect(JSON.stringify(sl.options)).toEqual(comparison) + }) +})