diff --git a/package.json b/package.json index e4c1570..e8c54c8 100644 --- a/package.json +++ b/package.json @@ -34,12 +34,12 @@ "eslint": "8.40.0", "eslint-plugin-react": "7.32.2", "eslint-plugin-react-hooks": "4.6.0", - "postcss": "8.4.23", + "postcss": "^8.4.38", "prettier": "^2.8.8", "semantic-release": "21.0.2", "tailwindcss": "3.3.2", "typescript": "4.9.5", - "vite": "4.3.5", + "vite": "4.5.3", "vite-plugin-logseq": "1.1.2", "vite-plugin-static-copy": "^0.14.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index db8b477..671b61b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,10 +57,10 @@ devDependencies: version: 5.59.5(eslint@8.40.0)(typescript@4.9.5) '@vitejs/plugin-react': specifier: 3.1.0 - version: 3.1.0(vite@4.3.5) + version: 3.1.0(vite@4.5.3) autoprefixer: specifier: 10.4.14 - version: 10.4.14(postcss@8.4.23) + version: 10.4.14(postcss@8.4.38) conventional-changelog-conventionalcommits: specifier: 5.0.0 version: 5.0.0 @@ -74,8 +74,8 @@ devDependencies: specifier: 4.6.0 version: 4.6.0(eslint@8.40.0) postcss: - specifier: 8.4.23 - version: 8.4.23 + specifier: ^8.4.38 + version: 8.4.38 prettier: specifier: ^2.8.8 version: 2.8.8 @@ -89,14 +89,14 @@ devDependencies: specifier: 4.9.5 version: 4.9.5 vite: - specifier: 4.3.5 - version: 4.3.5(@types/node@18.16.8) + specifier: 4.5.3 + version: 4.5.3(@types/node@18.16.8) vite-plugin-logseq: specifier: 1.1.2 version: 1.1.2 vite-plugin-static-copy: specifier: ^0.14.0 - version: 0.14.0(vite@4.3.5) + version: 0.14.0(vite@4.5.3) packages: @@ -347,8 +347,8 @@ packages: to-fast-properties: 2.0.0 dev: true - /@esbuild/android-arm64@0.17.11: - resolution: {integrity: sha512-QnK4d/zhVTuV4/pRM4HUjcsbl43POALU2zvBynmrrqZt9LPcLA3x1fTZPBg2RRguBQnJcnU059yKr+bydkntjg==} + /@esbuild/android-arm64@0.18.20: + resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -356,8 +356,8 @@ packages: dev: true optional: true - /@esbuild/android-arm@0.17.11: - resolution: {integrity: sha512-CdyX6sRVh1NzFCsf5vw3kULwlAhfy9wVt8SZlrhQ7eL2qBjGbFhRBWkkAzuZm9IIEOCKJw4DXA6R85g+qc8RDw==} + /@esbuild/android-arm@0.18.20: + resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==} engines: {node: '>=12'} cpu: [arm] os: [android] @@ -365,8 +365,8 @@ packages: dev: true optional: true - /@esbuild/android-x64@0.17.11: - resolution: {integrity: sha512-3PL3HKtsDIXGQcSCKtWD/dy+mgc4p2Tvo2qKgKHj9Yf+eniwFnuoQ0OUhlSfAEpKAFzF9N21Nwgnap6zy3L3MQ==} + /@esbuild/android-x64@0.18.20: + resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -374,8 +374,8 @@ packages: dev: true optional: true - /@esbuild/darwin-arm64@0.17.11: - resolution: {integrity: sha512-pJ950bNKgzhkGNO3Z9TeHzIFtEyC2GDQL3wxkMApDEghYx5Qers84UTNc1bAxWbRkuJOgmOha5V0WUeh8G+YGw==} + /@esbuild/darwin-arm64@0.18.20: + resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -383,8 +383,8 @@ packages: dev: true optional: true - /@esbuild/darwin-x64@0.17.11: - resolution: {integrity: sha512-iB0dQkIHXyczK3BZtzw1tqegf0F0Ab5texX2TvMQjiJIWXAfM4FQl7D909YfXWnB92OQz4ivBYQ2RlxBJrMJOw==} + /@esbuild/darwin-x64@0.18.20: + resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -392,8 +392,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-arm64@0.17.11: - resolution: {integrity: sha512-7EFzUADmI1jCHeDRGKgbnF5sDIceZsQGapoO6dmw7r/ZBEKX7CCDnIz8m9yEclzr7mFsd+DyasHzpjfJnmBB1Q==} + /@esbuild/freebsd-arm64@0.18.20: + resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -401,8 +401,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-x64@0.17.11: - resolution: {integrity: sha512-iPgenptC8i8pdvkHQvXJFzc1eVMR7W2lBPrTE6GbhR54sLcF42mk3zBOjKPOodezzuAz/KSu8CPyFSjcBMkE9g==} + /@esbuild/freebsd-x64@0.18.20: + resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -410,8 +410,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm64@0.17.11: - resolution: {integrity: sha512-Qxth3gsWWGKz2/qG2d5DsW/57SeA2AmpSMhdg9TSB5Svn2KDob3qxfQSkdnWjSd42kqoxIPy3EJFs+6w1+6Qjg==} + /@esbuild/linux-arm64@0.18.20: + resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -419,8 +419,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm@0.17.11: - resolution: {integrity: sha512-M9iK/d4lgZH0U5M1R2p2gqhPV/7JPJcRz+8O8GBKVgqndTzydQ7B2XGDbxtbvFkvIs53uXTobOhv+RyaqhUiMg==} + /@esbuild/linux-arm@0.18.20: + resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -428,8 +428,8 @@ packages: dev: true optional: true - /@esbuild/linux-ia32@0.17.11: - resolution: {integrity: sha512-dB1nGaVWtUlb/rRDHmuDQhfqazWE0LMro/AIbT2lWM3CDMHJNpLckH+gCddQyhhcLac2OYw69ikUMO34JLt3wA==} + /@esbuild/linux-ia32@0.18.20: + resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -437,8 +437,8 @@ packages: dev: true optional: true - /@esbuild/linux-loong64@0.17.11: - resolution: {integrity: sha512-aCWlq70Q7Nc9WDnormntGS1ar6ZFvUpqr8gXtO+HRejRYPweAFQN615PcgaSJkZjhHp61+MNLhzyVALSF2/Q0g==} + /@esbuild/linux-loong64@0.18.20: + resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -446,8 +446,8 @@ packages: dev: true optional: true - /@esbuild/linux-mips64el@0.17.11: - resolution: {integrity: sha512-cGeGNdQxqY8qJwlYH1BP6rjIIiEcrM05H7k3tR7WxOLmD1ZxRMd6/QIOWMb8mD2s2YJFNRuNQ+wjMhgEL2oCEw==} + /@esbuild/linux-mips64el@0.18.20: + resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -455,8 +455,8 @@ packages: dev: true optional: true - /@esbuild/linux-ppc64@0.17.11: - resolution: {integrity: sha512-BdlziJQPW/bNe0E8eYsHB40mYOluS+jULPCjlWiHzDgr+ZBRXPtgMV1nkLEGdpjrwgmtkZHEGEPaKdS/8faLDA==} + /@esbuild/linux-ppc64@0.18.20: + resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -464,8 +464,8 @@ packages: dev: true optional: true - /@esbuild/linux-riscv64@0.17.11: - resolution: {integrity: sha512-MDLwQbtF+83oJCI1Cixn68Et/ME6gelmhssPebC40RdJaect+IM+l7o/CuG0ZlDs6tZTEIoxUe53H3GmMn8oMA==} + /@esbuild/linux-riscv64@0.18.20: + resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -473,8 +473,8 @@ packages: dev: true optional: true - /@esbuild/linux-s390x@0.17.11: - resolution: {integrity: sha512-4N5EMESvws0Ozr2J94VoUD8HIRi7X0uvUv4c0wpTHZyZY9qpaaN7THjosdiW56irQ4qnJ6Lsc+i+5zGWnyqWqQ==} + /@esbuild/linux-s390x@0.18.20: + resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -482,8 +482,8 @@ packages: dev: true optional: true - /@esbuild/linux-x64@0.17.11: - resolution: {integrity: sha512-rM/v8UlluxpytFSmVdbCe1yyKQd/e+FmIJE2oPJvbBo+D0XVWi1y/NQ4iTNx+436WmDHQBjVLrbnAQLQ6U7wlw==} + /@esbuild/linux-x64@0.18.20: + resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -491,8 +491,8 @@ packages: dev: true optional: true - /@esbuild/netbsd-x64@0.17.11: - resolution: {integrity: sha512-4WaAhuz5f91h3/g43VBGdto1Q+X7VEZfpcWGtOFXnggEuLvjV+cP6DyLRU15IjiU9fKLLk41OoJfBFN5DhPvag==} + /@esbuild/netbsd-x64@0.18.20: + resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -500,8 +500,8 @@ packages: dev: true optional: true - /@esbuild/openbsd-x64@0.17.11: - resolution: {integrity: sha512-UBj135Nx4FpnvtE+C8TWGp98oUgBcmNmdYgl5ToKc0mBHxVVqVE7FUS5/ELMImOp205qDAittL6Ezhasc2Ev/w==} + /@esbuild/openbsd-x64@0.18.20: + resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -509,8 +509,8 @@ packages: dev: true optional: true - /@esbuild/sunos-x64@0.17.11: - resolution: {integrity: sha512-1/gxTifDC9aXbV2xOfCbOceh5AlIidUrPsMpivgzo8P8zUtczlq1ncFpeN1ZyQJ9lVs2hILy1PG5KPp+w8QPPg==} + /@esbuild/sunos-x64@0.18.20: + resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -518,8 +518,8 @@ packages: dev: true optional: true - /@esbuild/win32-arm64@0.17.11: - resolution: {integrity: sha512-vtSfyx5yRdpiOW9yp6Ax0zyNOv9HjOAw8WaZg3dF5djEHKKm3UnoohftVvIJtRh0Ec7Hso0RIdTqZvPXJ7FdvQ==} + /@esbuild/win32-arm64@0.18.20: + resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -527,8 +527,8 @@ packages: dev: true optional: true - /@esbuild/win32-ia32@0.17.11: - resolution: {integrity: sha512-GFPSLEGQr4wHFTiIUJQrnJKZhZjjq4Sphf+mM76nQR6WkQn73vm7IsacmBRPkALfpOCHsopSvLgqdd4iUW2mYw==} + /@esbuild/win32-ia32@0.18.20: + resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -536,8 +536,8 @@ packages: dev: true optional: true - /@esbuild/win32-x64@0.17.11: - resolution: {integrity: sha512-N9vXqLP3eRL8BqSy8yn4Y98cZI2pZ8fyuHx6lKjiG2WABpT2l01TXdzq5Ma2ZUBzfB7tx5dXVhge8X9u0S70ZQ==} + /@esbuild/win32-x64@0.18.20: + resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -1130,7 +1130,7 @@ packages: eslint-visitor-keys: 3.4.1 dev: true - /@vitejs/plugin-react@3.1.0(vite@4.3.5): + /@vitejs/plugin-react@3.1.0(vite@4.5.3): resolution: {integrity: sha512-AfgcRL8ZBhAlc3BFdigClmTUMISmmzHn7sB2h9U1odvc5U/MjWXsAaz18b/WoppUTDBzxOJwo2VdClfUcItu9g==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -1141,7 +1141,7 @@ packages: '@babel/plugin-transform-react-jsx-source': 7.19.6(@babel/core@7.20.12) magic-string: 0.27.0 react-refresh: 0.14.0 - vite: 4.3.5(@types/node@18.16.8) + vite: 4.5.3(@types/node@18.16.8) transitivePeerDependencies: - supports-color dev: true @@ -1301,7 +1301,7 @@ packages: engines: {node: '>=0.10.0'} dev: true - /autoprefixer@10.4.14(postcss@8.4.23): + /autoprefixer@10.4.14(postcss@8.4.38): resolution: {integrity: sha512-FQzyfOsTlwVzjHxKEqRIAdJx9niO6VCBCoEwax/VLSoQF29ggECcPuBqUMZ+u8jCZOPSy8b8/8KnuFbp0SaFZQ==} engines: {node: ^10 || ^12 || >=14} hasBin: true @@ -1313,7 +1313,7 @@ packages: fraction.js: 4.2.0 normalize-range: 0.1.2 picocolors: 1.0.0 - postcss: 8.4.23 + postcss: 8.4.38 postcss-value-parser: 4.2.0 dev: true @@ -1436,7 +1436,7 @@ packages: normalize-path: 3.0.0 readdirp: 3.6.0 optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true /clean-stack@2.2.0: @@ -1812,34 +1812,34 @@ packages: is-symbol: 1.0.4 dev: true - /esbuild@0.17.11: - resolution: {integrity: sha512-pAMImyokbWDtnA/ufPxjQg0fYo2DDuzAlqwnDvbXqHLphe+m80eF++perYKVm8LeTuj2zUuFXC+xgSVxyoHUdg==} + /esbuild@0.18.20: + resolution: {integrity: sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@esbuild/android-arm': 0.17.11 - '@esbuild/android-arm64': 0.17.11 - '@esbuild/android-x64': 0.17.11 - '@esbuild/darwin-arm64': 0.17.11 - '@esbuild/darwin-x64': 0.17.11 - '@esbuild/freebsd-arm64': 0.17.11 - '@esbuild/freebsd-x64': 0.17.11 - '@esbuild/linux-arm': 0.17.11 - '@esbuild/linux-arm64': 0.17.11 - '@esbuild/linux-ia32': 0.17.11 - '@esbuild/linux-loong64': 0.17.11 - '@esbuild/linux-mips64el': 0.17.11 - '@esbuild/linux-ppc64': 0.17.11 - '@esbuild/linux-riscv64': 0.17.11 - '@esbuild/linux-s390x': 0.17.11 - '@esbuild/linux-x64': 0.17.11 - '@esbuild/netbsd-x64': 0.17.11 - '@esbuild/openbsd-x64': 0.17.11 - '@esbuild/sunos-x64': 0.17.11 - '@esbuild/win32-arm64': 0.17.11 - '@esbuild/win32-ia32': 0.17.11 - '@esbuild/win32-x64': 0.17.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 dev: true /escalade@3.1.1: @@ -2196,8 +2196,8 @@ packages: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} dev: true - /fsevents@2.3.2: - resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} + /fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] requiresBuild: true @@ -2342,7 +2342,7 @@ packages: source-map: 0.6.1 wordwrap: 1.0.0 optionalDependencies: - uglify-js: 3.16.2 + uglify-js: 3.17.4 dev: true /hard-rejection@2.1.0: @@ -3043,8 +3043,8 @@ packages: thenify-all: 1.6.0 dev: true - /nanoid@3.3.6: - resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} + /nanoid@3.3.7: + resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true dev: true @@ -3540,29 +3540,29 @@ packages: load-json-file: 4.0.0 dev: true - /postcss-import@15.1.0(postcss@8.4.23): + /postcss-import@15.1.0(postcss@8.4.38): resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==} engines: {node: '>=14.0.0'} peerDependencies: postcss: ^8.0.0 dependencies: - postcss: 8.4.23 + postcss: 8.4.38 postcss-value-parser: 4.2.0 read-cache: 1.0.0 resolve: 1.22.2 dev: true - /postcss-js@4.0.1(postcss@8.4.23): + /postcss-js@4.0.1(postcss@8.4.38): resolution: {integrity: sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==} engines: {node: ^12 || ^14 || >= 16} peerDependencies: postcss: ^8.4.21 dependencies: camelcase-css: 2.0.1 - postcss: 8.4.23 + postcss: 8.4.38 dev: true - /postcss-load-config@4.0.1(postcss@8.4.23): + /postcss-load-config@4.0.1(postcss@8.4.38): resolution: {integrity: sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==} engines: {node: '>= 14'} peerDependencies: @@ -3575,17 +3575,17 @@ packages: optional: true dependencies: lilconfig: 2.1.0 - postcss: 8.4.23 + postcss: 8.4.38 yaml: 2.2.2 dev: true - /postcss-nested@6.0.1(postcss@8.4.23): + /postcss-nested@6.0.1(postcss@8.4.38): resolution: {integrity: sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==} engines: {node: '>=12.0'} peerDependencies: postcss: ^8.2.14 dependencies: - postcss: 8.4.23 + postcss: 8.4.38 postcss-selector-parser: 6.0.11 dev: true @@ -3601,13 +3601,13 @@ packages: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} dev: true - /postcss@8.4.23: - resolution: {integrity: sha512-bQ3qMcpF6A/YjR55xtoTr0jGOlnPOKAIMdOWiv0EIT6HVPEaJiJB4NLljSbiHoC2RX7DN5Uvjtpbg1NPdwv1oA==} + /postcss@8.4.38: + resolution: {integrity: sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==} engines: {node: ^10 || ^12 || >=14} dependencies: - nanoid: 3.3.6 + nanoid: 3.3.7 picocolors: 1.0.0 - source-map-js: 1.0.2 + source-map-js: 1.2.0 dev: true /prelude-ls@1.2.1: @@ -3859,12 +3859,12 @@ packages: glob: 7.2.0 dev: true - /rollup@3.21.0: - resolution: {integrity: sha512-ANPhVcyeHvYdQMUyCbczy33nbLzI7RzrBje4uvNiTDJGIMtlKoOStmympwr9OtS1LZxiDmE2wvxHyVhoLtf1KQ==} + /rollup@3.29.4: + resolution: {integrity: sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true /run-parallel@1.2.0: @@ -4012,8 +4012,8 @@ packages: tslib: 2.4.0 dev: false - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} + /source-map-js@1.2.0: + resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} engines: {node: '>=0.10.0'} dev: true @@ -4226,11 +4226,11 @@ packages: normalize-path: 3.0.0 object-hash: 3.0.0 picocolors: 1.0.0 - postcss: 8.4.23 - postcss-import: 15.1.0(postcss@8.4.23) - postcss-js: 4.0.1(postcss@8.4.23) - postcss-load-config: 4.0.1(postcss@8.4.23) - postcss-nested: 6.0.1(postcss@8.4.23) + postcss: 8.4.38 + postcss-import: 15.1.0(postcss@8.4.38) + postcss-js: 4.0.1(postcss@8.4.38) + postcss-load-config: 4.0.1(postcss@8.4.38) + postcss-nested: 6.0.1(postcss@8.4.38) postcss-selector-parser: 6.0.11 postcss-value-parser: 4.2.0 resolve: 1.22.2 @@ -4388,8 +4388,8 @@ packages: hasBin: true dev: true - /uglify-js@3.16.2: - resolution: {integrity: sha512-AaQNokTNgExWrkEYA24BTNMSjyqEXPSfhqoS0AxmHkCJ4U+Dyy5AvbGV/sqxuxficEfGGoX3zWw9R7QpLFfEsg==} + /uglify-js@3.17.4: + resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==} engines: {node: '>=0.8.0'} hasBin: true requiresBuild: true @@ -4465,7 +4465,7 @@ packages: magic-string: 0.26.1 dev: true - /vite-plugin-static-copy@0.14.0(vite@4.3.5): + /vite-plugin-static-copy@0.14.0(vite@4.5.3): resolution: {integrity: sha512-RMFmb4czomcrsbQBiUZs9HcDGN3kxGvF+OrtkfTVocp12CuoUCuJQhcY26RK35A6KS4WasGzEwcYZqHMjkAvVw==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -4475,16 +4475,17 @@ packages: fast-glob: 3.2.12 fs-extra: 11.1.1 picocolors: 1.0.0 - vite: 4.3.5(@types/node@18.16.8) + vite: 4.5.3(@types/node@18.16.8) dev: true - /vite@4.3.5(@types/node@18.16.8): - resolution: {integrity: sha512-0gEnL9wiRFxgz40o/i/eTBwm+NEbpUeTWhzKrZDSdKm6nplj+z4lKz8ANDgildxHm47Vg8EUia0aicKbawUVVA==} + /vite@4.5.3(@types/node@18.16.8): + resolution: {integrity: sha512-kQL23kMeX92v3ph7IauVkXkikdDRsYMGTVl5KY2E9OY4ONLvkHf04MDTbnfo6NKxZiDLWzVpP5oTa8hQD8U3dg==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true peerDependencies: '@types/node': '>= 14' less: '*' + lightningcss: ^1.21.0 sass: '*' stylus: '*' sugarss: '*' @@ -4494,6 +4495,8 @@ packages: optional: true less: optional: true + lightningcss: + optional: true sass: optional: true stylus: @@ -4504,11 +4507,11 @@ packages: optional: true dependencies: '@types/node': 18.16.8 - esbuild: 0.17.11 - postcss: 8.4.23 - rollup: 3.21.0 + esbuild: 0.18.20 + postcss: 8.4.38 + rollup: 3.29.4 optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true /webidl-conversions@3.0.1: diff --git a/src/DrawioManager.ts b/src/DrawioManager.ts index b8d79f7..7415535 100644 --- a/src/DrawioManager.ts +++ b/src/DrawioManager.ts @@ -103,7 +103,6 @@ export class DrawioManager extends EventEmitter { // pass } - console.log(json) this.messageEventEmitter.emit(json.event, json) } diff --git a/src/PreviewManager.ts b/src/PreviewManager.ts index b84a244..6161afb 100644 --- a/src/PreviewManager.ts +++ b/src/PreviewManager.ts @@ -28,7 +28,6 @@ export class PreviewManager extends EventEmitter { } private handleMouseMove = (e: MouseEvent) => { - console.log('mouse move', e) const { movementX, movementY } = e this.moveX = this.moveX + movementX / this.scale this.moveY = this.moveY + movementY / this.scale diff --git a/src/main.ts b/src/main.ts index 7a4a89d..4568ca0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -11,7 +11,8 @@ import { openFile, preview, removeFile, - download + download, + copyImage } from './utils' import { PreviewManager } from './PreviewManager' import { SpinnerManager } from './SpinnerManager' @@ -38,7 +39,8 @@ function main() { remove: removeFile, preview: (e: LogseqDomEvent) => preview(e, previewManager), download: (e: LogseqDomEvent) => download(e, 'origin'), - 'download-svg': (e: LogseqDomEvent) => download(e, 'svg') + 'download-svg': (e: LogseqDomEvent) => download(e, 'svg'), + 'copy-image': copyImage } } @@ -77,19 +79,22 @@ function main() {
+
diff --git a/src/utils.ts b/src/utils.ts index a7f9ac3..fa494a9 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -2,6 +2,7 @@ import { DrawioManager, PublicEvents } from './DrawioManager' import { PreviewManager } from './PreviewManager' import { SpinnerManager } from './SpinnerManager' import unescape from 'lodash/unescape' +import { encode } from 'js-base64' export interface LogseqDomEvent { id: string @@ -237,3 +238,57 @@ export const download = async (e: LogseqDomEvent, type: 'svg' | 'origin') => { a.href = '' }) } + +export const copyImage = async (e: LogseqDomEvent) => { + const storage = logseq.Assets.makeSandboxStorage() + + const fileName = e.dataset.fileName + + const content = await storage.getItem(fileName) + + if (!content) { + logseq.UI.showMsg(`file(${fileName}) is not found!`, 'error') + return + } + + const base64Svg = encode(content ?? '') + const img = document.createElement('img') + const { width, height } = await new Promise<{ + width: number + height: number + }>((resolve) => { + img.onload = () => { + const width = img.naturalWidth + const height = img.naturalHeight + resolve({ width, height }) + } + img.src = `data:image/svg+xml;base64,${base64Svg}` + }) + + const canvas = document.createElement('canvas') + canvas.width = width + canvas.height = height + const ctx = canvas.getContext('2d') + if (!ctx) return + // when use ctx.clearRect and export to clipboard, the background is black. + ctx.fillStyle = '#FFFFFF' + ctx.fillRect(0, 0, width, height) + ctx.drawImage(img, 0, 0) + const type = 'image/png' + const blob = await new Promise((resolve) => + canvas.toBlob(resolve, type) + ) + if (!blob) return + + // only showing ui and focus can use clipboard api + await logseq.showMainUI({ autoFocus: true }) + + try { + await navigator.clipboard.write([new ClipboardItem({ [type]: blob })]) + logseq.UI.showMsg('Copied to clipboard!', 'success') + } catch (e) { + logseq.UI.showMsg(`Failed(${String(e)}) to copy to clipboard!`, 'error') + } finally { + logseq.hideMainUI() + } +}