From 22efc71a4934f6afa665681817c067d56afab49d Mon Sep 17 00:00:00 2001 From: Offroaders123 <65947371+Offroaders123@users.noreply.github.com> Date: Mon, 25 Sep 2023 03:15:38 -0700 Subject: [PATCH] Strictness Checks Bringing over the stricter config from NBTify and my other projects :) --- package-lock.json | 246 +++++++++++++++++++-------------------- package.json | 10 +- public/service-worker.js | 2 +- src/Card.ts | 14 +-- src/Editor.ts | 23 ++-- src/Tools.ts | 2 +- src/Workspace.ts | 12 +- src/app.ts | 2 +- src/dom.ts | 4 +- tsconfig.json | 12 +- 10 files changed, 167 insertions(+), 160 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9f2f166..05f54e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,17 +10,17 @@ "@stedit/num-text": "^1.0.1" }, "devDependencies": { - "@types/prismjs": "^1.26.0", - "better-typescript": "^0.1.2", - "new-javascript": "^0.3.5", - "typescript": "^5.1.6", - "vite": "^4.4.2" + "@types/prismjs": "^1.26.1", + "better-typescript": "^0.1.6", + "new-javascript": "^0.3.6", + "typescript": "^5.2.2", + "vite": "^4.4.9" } }, "node_modules/@esbuild/android-arm": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.11.tgz", - "integrity": "sha512-q4qlUf5ucwbUJZXF5tEQ8LF7y0Nk4P58hOsGk3ucY0oCwgQqAnqXVbUuahCddVHfrxmpyewRpiTHwVHIETYu7Q==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", + "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==", "cpu": [ "arm" ], @@ -34,9 +34,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.11.tgz", - "integrity": "sha512-snieiq75Z1z5LJX9cduSAjUr7vEI1OdlzFPMw0HH5YI7qQHDd3qs+WZoMrWYDsfRJSq36lIA6mfZBkvL46KoIw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz", + "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==", "cpu": [ "arm64" ], @@ -50,9 +50,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.11.tgz", - "integrity": "sha512-iPuoxQEV34+hTF6FT7om+Qwziv1U519lEOvekXO9zaMMlT9+XneAhKL32DW3H7okrCOBQ44BMihE8dclbZtTuw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz", + "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==", "cpu": [ "x64" ], @@ -66,9 +66,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.11.tgz", - "integrity": "sha512-Gm0QkI3k402OpfMKyQEEMG0RuW2LQsSmI6OeO4El2ojJMoF5NLYb3qMIjvbG/lbMeLOGiW6ooU8xqc+S0fgz2w==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz", + "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==", "cpu": [ "arm64" ], @@ -82,9 +82,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.11.tgz", - "integrity": "sha512-N15Vzy0YNHu6cfyDOjiyfJlRJCB/ngKOAvoBf1qybG3eOq0SL2Lutzz9N7DYUbb7Q23XtHPn6lMDF6uWbGv9Fw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz", + "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==", "cpu": [ "x64" ], @@ -98,9 +98,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.11.tgz", - "integrity": "sha512-atEyuq6a3omEY5qAh5jIORWk8MzFnCpSTUruBgeyN9jZq1K/QI9uke0ATi3MHu4L8c59CnIi4+1jDKMuqmR71A==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz", + "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==", "cpu": [ "arm64" ], @@ -114,9 +114,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.11.tgz", - "integrity": "sha512-XtuPrEfBj/YYYnAAB7KcorzzpGTvOr/dTtXPGesRfmflqhA4LMF0Gh/n5+a9JBzPuJ+CGk17CA++Hmr1F/gI0Q==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz", + "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==", "cpu": [ "x64" ], @@ -130,9 +130,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.11.tgz", - "integrity": "sha512-Idipz+Taso/toi2ETugShXjQ3S59b6m62KmLHkJlSq/cBejixmIydqrtM2XTvNCywFl3VC7SreSf6NV0i6sRyg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz", + "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==", "cpu": [ "arm" ], @@ -146,9 +146,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.11.tgz", - "integrity": "sha512-c6Vh2WS9VFKxKZ2TvJdA7gdy0n6eSy+yunBvv4aqNCEhSWVor1TU43wNRp2YLO9Vng2G+W94aRz+ILDSwAiYog==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz", + "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==", "cpu": [ "arm64" ], @@ -162,9 +162,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.11.tgz", - "integrity": "sha512-S3hkIF6KUqRh9n1Q0dSyYcWmcVa9Cg+mSoZEfFuzoYXXsk6196qndrM+ZiHNwpZKi3XOXpShZZ+9dfN5ykqjjw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz", + "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==", "cpu": [ "ia32" ], @@ -178,9 +178,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.11.tgz", - "integrity": "sha512-MRESANOoObQINBA+RMZW+Z0TJWpibtE7cPFnahzyQHDCA9X9LOmGh68MVimZlM9J8n5Ia8lU773te6O3ILW8kw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz", + "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==", "cpu": [ "loong64" ], @@ -194,9 +194,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.11.tgz", - "integrity": "sha512-qVyPIZrXNMOLYegtD1u8EBccCrBVshxMrn5MkuFc3mEVsw7CCQHaqZ4jm9hbn4gWY95XFnb7i4SsT3eflxZsUg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz", + "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==", "cpu": [ "mips64el" ], @@ -210,9 +210,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.11.tgz", - "integrity": "sha512-T3yd8vJXfPirZaUOoA9D2ZjxZX4Gr3QuC3GztBJA6PklLotc/7sXTOuuRkhE9W/5JvJP/K9b99ayPNAD+R+4qQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz", + "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==", "cpu": [ "ppc64" ], @@ -226,9 +226,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.11.tgz", - "integrity": "sha512-evUoRPWiwuFk++snjH9e2cAjF5VVSTj+Dnf+rkO/Q20tRqv+644279TZlPK8nUGunjPAtQRCj1jQkDAvL6rm2w==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz", + "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==", "cpu": [ "riscv64" ], @@ -242,9 +242,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.11.tgz", - "integrity": "sha512-/SlRJ15XR6i93gRWquRxYCfhTeC5PdqEapKoLbX63PLCmAkXZHY2uQm2l9bN0oPHBsOw2IswRZctMYS0MijFcg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz", + "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==", "cpu": [ "s390x" ], @@ -258,9 +258,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.11.tgz", - "integrity": "sha512-xcncej+wF16WEmIwPtCHi0qmx1FweBqgsRtEL1mSHLFR6/mb3GEZfLQnx+pUDfRDEM4DQF8dpXIW7eDOZl1IbA==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", + "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", "cpu": [ "x64" ], @@ -274,9 +274,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.11.tgz", - "integrity": "sha512-aSjMHj/F7BuS1CptSXNg6S3M4F3bLp5wfFPIJM+Km2NfIVfFKhdmfHF9frhiCLIGVzDziggqWll0B+9AUbud/Q==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz", + "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==", "cpu": [ "x64" ], @@ -290,9 +290,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.11.tgz", - "integrity": "sha512-tNBq+6XIBZtht0xJGv7IBB5XaSyvYPCm1PxJ33zLQONdZoLVM0bgGqUrXnJyiEguD9LU4AHiu+GCXy/Hm9LsdQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz", + "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==", "cpu": [ "x64" ], @@ -306,9 +306,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.11.tgz", - "integrity": "sha512-kxfbDOrH4dHuAAOhr7D7EqaYf+W45LsAOOhAet99EyuxxQmjbk8M9N4ezHcEiCYPaiW8Dj3K26Z2V17Gt6p3ng==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz", + "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==", "cpu": [ "x64" ], @@ -322,9 +322,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.11.tgz", - "integrity": "sha512-Sh0dDRyk1Xi348idbal7lZyfSkjhJsdFeuC13zqdipsvMetlGiFQNdO+Yfp6f6B4FbyQm7qsk16yaZk25LChzg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz", + "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==", "cpu": [ "arm64" ], @@ -338,9 +338,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.11.tgz", - "integrity": "sha512-o9JUIKF1j0rqJTFbIoF4bXj6rvrTZYOrfRcGyL0Vm5uJ/j5CkBD/51tpdxe9lXEDouhRgdr/BYzUrDOvrWwJpg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz", + "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==", "cpu": [ "ia32" ], @@ -354,9 +354,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.11.tgz", - "integrity": "sha512-rQI4cjLHd2hGsM1LqgDI7oOCYbQ6IBOVsX9ejuRMSze0GqXUG2ekwiKkiBU1pRGSeCqFFHxTrcEydB2Hyoz9CA==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz", + "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==", "cpu": [ "x64" ], @@ -380,24 +380,24 @@ "integrity": "sha512-O+hAF64/HbmgbGLL2RZgjY2MjnjD3rTt5A3IUBAZZgFUgEsxjZkcMa8kOVvs8bZ3yMsox/PdJLuSPqv/I5TUWQ==" }, "node_modules/@types/prismjs": { - "version": "1.26.0", - "resolved": "https://registry.npmjs.org/@types/prismjs/-/prismjs-1.26.0.tgz", - "integrity": "sha512-ZTaqn/qSqUuAq1YwvOFQfVW1AR/oQJlLSZVustdjwI+GZ8kr0MSHBj0tsXPW1EqHubx50gtBEjbPGsdZwQwCjQ==", + "version": "1.26.1", + "resolved": "https://registry.npmjs.org/@types/prismjs/-/prismjs-1.26.1.tgz", + "integrity": "sha512-Q7jDsRbzcNHIQje15CS/piKhu6lMLb9jwjxSfEIi4KcFKXW23GoJMkwQiJ8VObyfx+VmUaDcJxXaWN+cTCjVog==", "dev": true }, "node_modules/better-typescript": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/better-typescript/-/better-typescript-0.1.2.tgz", - "integrity": "sha512-8QCnjZB5IXx2q4mP4PslrRFQTeFlQ78stgh905tkAhTPOhVBlQnvNC6V/yb00Nzu3T2oSbOjgLo9yQJtyhkQ6Q==", + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/better-typescript/-/better-typescript-0.1.6.tgz", + "integrity": "sha512-6u1GCBc518wIj8FI4xDcKpCtIiE2HCzDjNK09lRKCzZBaAuB8lv/aCOAWs04SAPWw06SGKlUOP0vuxsj/IOJ4A==", "dev": true, "dependencies": { - "new-javascript": ">=0.3.1" + "new-javascript": ">=0.3.5" } }, "node_modules/esbuild": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.11.tgz", - "integrity": "sha512-i8u6mQF0JKJUlGR3OdFLKldJQMMs8OqM9Cc3UCi9XXziJ9WERM5bfkHaEAy0YAvPRMgqSW55W7xYn84XtEFTtA==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", + "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", "dev": true, "hasInstallScript": true, "bin": { @@ -407,34 +407,34 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/android-arm": "0.18.11", - "@esbuild/android-arm64": "0.18.11", - "@esbuild/android-x64": "0.18.11", - "@esbuild/darwin-arm64": "0.18.11", - "@esbuild/darwin-x64": "0.18.11", - "@esbuild/freebsd-arm64": "0.18.11", - "@esbuild/freebsd-x64": "0.18.11", - "@esbuild/linux-arm": "0.18.11", - "@esbuild/linux-arm64": "0.18.11", - "@esbuild/linux-ia32": "0.18.11", - "@esbuild/linux-loong64": "0.18.11", - "@esbuild/linux-mips64el": "0.18.11", - "@esbuild/linux-ppc64": "0.18.11", - "@esbuild/linux-riscv64": "0.18.11", - "@esbuild/linux-s390x": "0.18.11", - "@esbuild/linux-x64": "0.18.11", - "@esbuild/netbsd-x64": "0.18.11", - "@esbuild/openbsd-x64": "0.18.11", - "@esbuild/sunos-x64": "0.18.11", - "@esbuild/win32-arm64": "0.18.11", - "@esbuild/win32-ia32": "0.18.11", - "@esbuild/win32-x64": "0.18.11" + "@esbuild/android-arm": "0.18.20", + "@esbuild/android-arm64": "0.18.20", + "@esbuild/android-x64": "0.18.20", + "@esbuild/darwin-arm64": "0.18.20", + "@esbuild/darwin-x64": "0.18.20", + "@esbuild/freebsd-arm64": "0.18.20", + "@esbuild/freebsd-x64": "0.18.20", + "@esbuild/linux-arm": "0.18.20", + "@esbuild/linux-arm64": "0.18.20", + "@esbuild/linux-ia32": "0.18.20", + "@esbuild/linux-loong64": "0.18.20", + "@esbuild/linux-mips64el": "0.18.20", + "@esbuild/linux-ppc64": "0.18.20", + "@esbuild/linux-riscv64": "0.18.20", + "@esbuild/linux-s390x": "0.18.20", + "@esbuild/linux-x64": "0.18.20", + "@esbuild/netbsd-x64": "0.18.20", + "@esbuild/openbsd-x64": "0.18.20", + "@esbuild/sunos-x64": "0.18.20", + "@esbuild/win32-arm64": "0.18.20", + "@esbuild/win32-ia32": "0.18.20", + "@esbuild/win32-x64": "0.18.20" } }, "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "hasInstallScript": true, "optional": true, @@ -464,9 +464,9 @@ } }, "node_modules/new-javascript": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/new-javascript/-/new-javascript-0.3.5.tgz", - "integrity": "sha512-ZRs4U/JXho4R+baz961KpfafZx3j80/kjj8ZEoByqIeeZTpEZRrM+ZgXjP+3JKT5L4WJQBlh71+qI6buCyPvNg==", + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/new-javascript/-/new-javascript-0.3.6.tgz", + "integrity": "sha512-T0iqXpvN5CQJ2yXl8z7cW0KoLR7uNSj5OG1uWlNrHPE22PzYy5ogjoAn8cWOpM4+FiZkw1axuNB9mP0pIJMWPw==", "dev": true }, "node_modules/picocolors": { @@ -476,9 +476,9 @@ "dev": true }, "node_modules/postcss": { - "version": "8.4.24", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.24.tgz", - "integrity": "sha512-M0RzbcI0sO/XJNucsGjvWU9ERWxb/ytp1w6dKtxTKgixdtQDq4rmx/g8W1hnaheq9jgwL/oyEdH5Bc4WwJKMqg==", + "version": "8.4.30", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.30.tgz", + "integrity": "sha512-7ZEao1g4kd68l97aWG/etQKPKq07us0ieSZ2TnFDk11i0ZfDW2AwKHYU8qv4MZKqN2fdBfg+7q0ES06UA73C1g==", "dev": true, "funding": [ { @@ -504,9 +504,9 @@ } }, "node_modules/rollup": { - "version": "3.26.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.26.2.tgz", - "integrity": "sha512-6umBIGVz93er97pMgQO08LuH3m6PUb3jlDUUGFsNJB6VgTCUaDFpupf5JfU30529m/UKOgmiX+uY6Sx8cOYpLA==", + "version": "3.29.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.3.tgz", + "integrity": "sha512-T7du6Hum8jOkSWetjRgbwpM6Sy0nECYrYRSmZjayFcOddtKJWU4d17AC3HNUk7HRuqy4p+G7aEZclSHytqUmEg==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -529,9 +529,9 @@ } }, "node_modules/typescript": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", - "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -542,14 +542,14 @@ } }, "node_modules/vite": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.2.tgz", - "integrity": "sha512-zUcsJN+UvdSyHhYa277UHhiJ3iq4hUBwHavOpsNUGsTgjBeoBlK8eDt+iT09pBq0h9/knhG/SPrZiM7cGmg7NA==", + "version": "4.4.9", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.9.tgz", + "integrity": "sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==", "dev": true, "dependencies": { "esbuild": "^0.18.10", - "postcss": "^8.4.24", - "rollup": "^3.25.2" + "postcss": "^8.4.27", + "rollup": "^3.27.1" }, "bin": { "vite": "bin/vite.js" diff --git a/package.json b/package.json index d8518a4..e45a80a 100644 --- a/package.json +++ b/package.json @@ -12,10 +12,10 @@ "@stedit/num-text": "^1.0.1" }, "devDependencies": { - "@types/prismjs": "^1.26.0", - "better-typescript": "^0.1.2", - "new-javascript": "^0.3.5", - "typescript": "^5.1.6", - "vite": "^4.4.2" + "@types/prismjs": "^1.26.1", + "better-typescript": "^0.1.6", + "new-javascript": "^0.3.6", + "typescript": "^5.2.2", + "vite": "^4.4.9" } } \ No newline at end of file diff --git a/public/service-worker.js b/public/service-worker.js index da8db4b..c92fd23 100644 --- a/public/service-worker.js +++ b/public/service-worker.js @@ -4,7 +4,7 @@ var self = /** @type { ServiceWorkerGlobalScope } */ (/** @type { unknown } */ (globalThis)); const NAME = "Smart Text Editor"; -const VERSION = "v4.27.3"; +const VERSION = "v4.27.4"; const CACHE_NAME = /** @type { const } */ (`${NAME} ${VERSION}`); const IS_MACOS_DEVICE = (/(macOS|Mac)/i.test(navigator.userAgentData?.platform ?? navigator.platform) && navigator.standalone === undefined); diff --git a/src/Card.ts b/src/Card.ts index 6c8d5c4..b99e933 100644 --- a/src/Card.ts +++ b/src/Card.ts @@ -28,10 +28,10 @@ export class Card extends HTMLElement { if (!event.shiftKey){ if (document.activeElement != navigable[navigable.length - 1]) return; event.preventDefault(); - navigable[0].focus(); + navigable[0]?.focus(); } else if (document.activeElement == navigable[0]){ event.preventDefault(); - navigable[navigable.length - 1].focus(); + navigable[navigable.length - 1]?.focus(); } }); this.type = this.getAttribute("data-type"); @@ -76,7 +76,7 @@ export class Card extends HTMLElement { if (card.type != "dialog" && card.type != this.type) return; card.close(); if (!card.matches(".minimize")) return; - const transitionDuration = parseInt(`${Number(getElementStyle({ element: card, property: "transition-duration" }).split(",")[0].replace(/s/g,"")) * 1000}`); + const transitionDuration = parseInt(`${Number(getElementStyle({ element: card, property: "transition-duration" }).split(",")[0]!.replace(/s/g,"")) * 1000}`); window.setTimeout(() => card.minimize(),transitionDuration); }); } @@ -98,7 +98,7 @@ export class Card extends HTMLElement { STE.dialogPrevious = document.activeElement as Card; } document.querySelectorAll("menu-drop[data-open]").forEach(menu => menu.close()); - const transitionDuration = parseInt(`${Number(getElementStyle({ element: this, property: "transition-duration" }).split(",")[0].replace(/s/g,"")) * 500}`); + const transitionDuration = parseInt(`${Number(getElementStyle({ element: this, property: "transition-duration" }).split(",")[0]!.replace(/s/g,"")) * 500}`); window.setTimeout(() => { if (document.activeElement instanceof HTMLElement) document.activeElement.blur(); if (previous) this.querySelector(`[data-card-previous="${previous.id}"]`)!.focus(); @@ -115,7 +115,7 @@ export class Card extends HTMLElement { this.setAttribute("data-minimize-change",changeIdentifier); workspace_tabs.setAttribute("data-minimize-change",changeIdentifier); - const transitionDuration = parseInt(`${Number(getElementStyle({ element: this, property: "transition-duration" }).split(",")[0].replace(/s/g,"")) * 1000}`); + const transitionDuration = parseInt(`${Number(getElementStyle({ element: this, property: "transition-duration" }).split(",")[0]!.replace(/s/g,"")) * 1000}`); if (!this.matches(".minimize")){ this.classList.add("minimize"); if (this.controls === undefined) return; @@ -147,7 +147,7 @@ export class Card extends HTMLElement { close(): void { this.classList.remove("active"); if (this.matches(".minimize")){ - const transitionDuration = parseInt(`${Number(getElementStyle({ element: this, property: "transition-duration" }).split(",")[0].replace(/s/g,"")) * 1000}`); + const transitionDuration = parseInt(`${Number(getElementStyle({ element: this, property: "transition-duration" }).split(",")[0]!.replace(/s/g,"")) * 1000}`); window.setTimeout(() => this.minimize(),transitionDuration); } if (this.type == "dialog"){ @@ -178,7 +178,7 @@ export class Card extends HTMLElement { if (!STE.activeDialog || event.key != "Tab" || document.activeElement != document.body) return; const navigable = Card.#getNavigableElements({ container: STE.activeDialog, scope: true }); event.preventDefault(); - navigable[((!event.shiftKey) ? 0 : navigable.length - 1)].focus(); + navigable[((!event.shiftKey) ? 0 : navigable.length - 1)]?.focus(); } } diff --git a/src/Editor.ts b/src/Editor.ts index 4355ebb..1226ffb 100644 --- a/src/Editor.ts +++ b/src/Editor.ts @@ -27,7 +27,7 @@ export class Editor extends NumTextElement { */ static open(identifier: string, options: EditorOpenOptions = {}): void { const editor = this.#editors[identifier]; - editor.open(options); + editor?.open(options); } /** @@ -35,7 +35,7 @@ export class Editor extends NumTextElement { */ static async close(identifier: string): Promise { const editor = this.#editors[identifier]; - await editor.close(); + await editor?.close(); } /** @@ -45,6 +45,9 @@ export class Editor extends NumTextElement { */ static rename(identifier: string, rename?: string): void { const editor = this.#editors[identifier]; + if (editor === undefined){ + throw new Error(`Failed to rename editor '${identifier}', it may not exist`); + } const currentName = editor.#name; if (!rename){ @@ -62,12 +65,12 @@ export class Editor extends NumTextElement { * * If the active Editor is the first one in the Workspace, it will wrap around to give the last Editor in the Workspace. */ - static getPrevious(identifier: string, wrap: boolean = true): string | null { + static getPrevious(identifier: string, _wrap: boolean = true): string | null { const { tab } = STE.query(identifier); if (tab === null) return tab; const editorTabs = [...workspace_tabs.querySelectorAll(".tab:not([data-editor-change])")]; const previousTab = editorTabs[(editorTabs.indexOf(tab) || editorTabs.length) - 1]; - const previousEditor = previousTab.getAttribute("data-editor-identifier"); + const previousEditor = previousTab?.getAttribute("data-editor-identifier") ?? null; return previousEditor; } @@ -76,12 +79,12 @@ export class Editor extends NumTextElement { * * If the active Editor is the last one in the Workspace, it will wrap around to give the first Editor in the Workspace. */ - static getNext(identifier: string, wrap: boolean = true): string | null { + static getNext(identifier: string, _wrap: boolean = true): string | null { const { tab } = STE.query(identifier); if (tab === null) return tab; const editorTabs = [...workspace_tabs.querySelectorAll(".tab:not([data-editor-change])")]; const nextTab = editorTabs[(editorTabs.indexOf(tab) !== editorTabs.length - 1) ? editorTabs.indexOf(tab) + 1 : 0]; - const nextEditor = nextTab.getAttribute("data-editor-identifier"); + const nextEditor = nextTab?.getAttribute("data-editor-identifier") ?? null; return nextEditor; } @@ -136,7 +139,7 @@ export class Editor extends NumTextElement { const changeIdentifier = Math.random().toString(); document.body.setAttribute("data-editor-change",changeIdentifier); - const transitionDuration = parseInt(`${Number(getElementStyle({ element: workspace_tabs, property: "transition-duration" }).split(",")[0].replace(/s/g,"")) * 1000}`); + const transitionDuration = parseInt(`${Number(getElementStyle({ element: workspace_tabs, property: "transition-duration" }).split(",")[0]!.replace(/s/g,"")) * 1000}`); this.tab.classList.add("tab"); this.tab.setAttribute("data-editor-identifier",this.identifier); @@ -364,7 +367,7 @@ export class Editor extends NumTextElement { } } - const transitionDuration = (document.body.hasAttribute("data-editor-change")) ? parseInt(`${Number(getElementStyle({ element: workspace_tabs, property: "transition-duration" }).split(",")[0].replace(/s/g,"")) * 1000}`) : 0; + const transitionDuration = (document.body.hasAttribute("data-editor-change")) ? parseInt(`${Number(getElementStyle({ element: workspace_tabs, property: "transition-duration" }).split(",")[0]!.replace(/s/g,"")) * 1000}`) : 0; if (this.tab === editorTabs[0] && editorTabs.length === 1){ STE.activeEditor = null; @@ -381,11 +384,11 @@ export class Editor extends NumTextElement { Editor.open(identifier); } if (this.tab === editorTabs[editorTabs.length - 1] && this.tab !== editorTabs[0] && this.tab.classList.contains("active")){ - const identifier = editorTabs[editorTabs.length - 2].getAttribute("data-editor-identifier")!; + const identifier = editorTabs[editorTabs.length - 2]!.getAttribute("data-editor-identifier")!; Editor.open(identifier); } if (this.tab !== editorTabs[0] && this.tab.classList.contains("active")){ - const identifier = editorTabs[editorTabs.indexOf(this.tab) + 1].getAttribute("data-editor-identifier")!; + const identifier = editorTabs[editorTabs.indexOf(this.tab) + 1]!.getAttribute("data-editor-identifier")!; Editor.open(identifier); } diff --git a/src/Tools.ts b/src/Tools.ts index 5eb4af0..e54e6cd 100644 --- a/src/Tools.ts +++ b/src/Tools.ts @@ -24,7 +24,7 @@ export class Tools { }, clear(): void { - [replacer_find.value,replacer_replace.value] = ""; + [replacer_find.value,replacer_replace.value] = ["",""]; } } diff --git a/src/Workspace.ts b/src/Workspace.ts index 152d2da..c12bad2 100644 --- a/src/Workspace.ts +++ b/src/Workspace.ts @@ -39,7 +39,7 @@ export function setView(type: View, { force = false }: SetViewOptions = {}): voi if ((STE.orientationChange && !force) || STE.scalingChange) return; const changeIdentifier = Math.random().toString(); document.body.setAttribute("data-view-change",changeIdentifier); - const transitionDuration = parseInt(`${Number(getElementStyle({ element: workspace, property: "transition-duration" }).split(",")[0].replace(/s/g,"")) * 1000}`); + const transitionDuration = parseInt(`${Number(getElementStyle({ element: workspace, property: "transition-duration" }).split(",")[0]!.replace(/s/g,"")) * 1000}`); document.body.classList.remove(STE.view); document.body.setAttribute("data-view",type); document.body.classList.add(STE.view); @@ -62,7 +62,7 @@ export type Orientation = "horizontal" | "vertical"; export function setOrientation(orientation?: Orientation): void { if (STE.orientationChange || STE.scalingChange) return; document.body.setAttribute("data-orientation-change",""); - const param = (orientation), transitionDuration = ((STE.view != "split") ? 0 : parseInt(`${Number(getElementStyle({ element: workspace, property: "transition-duration" }).split(",")[0].replace(/s/g,"")) * 1000}`)); + const param = (orientation), transitionDuration = ((STE.view != "split") ? 0 : parseInt(`${Number(getElementStyle({ element: workspace, property: "transition-duration" }).split(",")[0]!.replace(/s/g,"")) * 1000}`)); if (!param && STE.view == "split") setView("code",{ force: true }); if (!param && STE.orientation == "horizontal") orientation = "vertical"; if (!param && STE.orientation == "vertical") orientation = "horizontal"; @@ -197,8 +197,8 @@ export async function saveFile(extension?: string): Promise { }); if (!handle) return; STE.fileHandles[identifier] = handle; - } else handle = STE.fileHandles[identifier]; - const stream = await STE.fileHandles[identifier].createWritable().catch(error => { + } else handle = STE.fileHandles[identifier]!; + const stream = await STE.fileHandles[identifier]?.createWritable().catch(error => { alert(`"${STE.query().getName()}" could not be saved.`); if (error.toString().toLowerCase().includes("not allowed")) return; }); @@ -276,8 +276,8 @@ export function setScaling(event: MouseEvent | TouchEvent): void { }; const touchEvent = (STE.environment.touchDevice && event instanceof TouchEvent); - if (STE.orientation == "horizontal") scalingOffset = (!touchEvent) ? (event as MouseEvent).pageX : (event as TouchEvent).touches[0].pageX; - if (STE.orientation == "vertical") scalingOffset = (!touchEvent) ? (event as MouseEvent).pageY - header.offsetHeight : (event as TouchEvent).touches[0].pageY - header.offsetHeight; + if (STE.orientation == "horizontal") scalingOffset = (!touchEvent) ? (event as MouseEvent).pageX : (event as TouchEvent).touches[0]!.pageX; + if (STE.orientation == "vertical") scalingOffset = (!touchEvent) ? (event as MouseEvent).pageY - header.offsetHeight : (event as TouchEvent).touches[0]!.pageY - header.offsetHeight; if (scalingOffset < scalingRange.minimum) scalingOffset = scalingRange.minimum; if (scalingOffset > scalingRange.maximum) scalingOffset = scalingRange.maximum; document.body.setAttribute("data-scaling-active",""); diff --git a/src/app.ts b/src/app.ts index 272f1da..b39fed2 100644 --- a/src/app.ts +++ b/src/app.ts @@ -90,7 +90,7 @@ window.addEventListener("beforeinstallprompt",event => { event.preventDefault(); STE.installPrompt = event; document.documentElement.classList.add("install-prompt-available"); - theme_button.childNodes[0].textContent = "Theme"; + theme_button.childNodes[0]!.textContent = "Theme"; }); window.addEventListener("beforeunload",event => { diff --git a/src/dom.ts b/src/dom.ts index 9d1a0c8..927960c 100644 --- a/src/dom.ts +++ b/src/dom.ts @@ -25,7 +25,7 @@ export function applyEditingBehavior(element: HTMLInputElement | NumTextElement) (element as HTMLElement).addEventListener("drop",event => { if (event.dataTransfer === null) return; - if ([...event.dataTransfer.items][0].kind === "file") return; + if ([...event.dataTransfer.items][0]?.kind === "file") return; event.stopPropagation(); for (const menu of document.querySelectorAll("menu-drop[data-open]")){ menu.close(); @@ -72,7 +72,7 @@ export async function showInstallPrompt(): Promise { const result = await STE.installPrompt.userChoice; if (result.outcome !== "accepted") return; document.documentElement.classList.remove("install-prompt-available"); - theme_button.childNodes[0].textContent = "Customize Theme"; + theme_button.childNodes[0]!.textContent = "Customize Theme"; } /** diff --git a/tsconfig.json b/tsconfig.json index b422bd3..a7a0815 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,10 +2,9 @@ "compilerOptions": { "allowJs": true, "checkJs": true, - "module": "ESNext", - "moduleResolution": "NodeNext", - "isolatedModules": true, + "module": "NodeNext", "target": "ESNext", + "isolatedModules": true, "types": [ "@stedit/menu-drop", "@stedit/num-text", @@ -14,7 +13,12 @@ "noEmit": true, "skipLibCheck": true, "strict": true, - "noImplicitOverride": true + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noUncheckedIndexedAccess": true, + "allowUnreachableCode": false, + "noUnusedLocals": true, + "noUnusedParameters": true }, "exclude": [ "./dist"