A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
web: compress image in realtime for better UX in attach files dialog (#9899)
01zulfi08cf21b05ad7
diff --git a/apps/web/package-lock.json b/apps/web/package-lock.jsonindex f42ec9f0e..40071d8fa 100644--- a/apps/web/package-lock.json+++ b/apps/web/package-lock.json@@ -63,6 +63,7 @@"katex": "0.16.11","mac-scrollbar": "0.13.6","mutative": "^1.1.0",+ "p-queue": "^9.3.0","pdfjs-dist": "3.6.172","phone": "^3.1.14","platform": "^1.3.6",@@ -89,7 +90,7 @@"devDependencies": {"@babel/core": "7.22.5","@cloudflare/workers-types": "^4.20250224.0",- "@playwright/test": "^1.58.2",+ "@playwright/test": "1.58.2","@swc/plugin-react-remove-properties": "^6.0.2","@trpc/server": "10.45.2","@types/babel__core": "^7.20.1",@@ -133,7 +134,7 @@},"../../extensions/web-clipper": {"name": "@notesnook/web-clipper",- "version": "0.4.0",+ "version": "0.4.1","license": "GPL-3.0-or-later","dependencies": {"@emotion/react": "11.11.1",@@ -509,7 +510,7 @@},"../desktop": {"name": "@notesnook/desktop",- "version": "3.4.0-beta.0",+ "version": "3.4.0","hasInstallScript": true,"license": "GPL-3.0-or-later","dependencies": {@@ -529,6 +530,7 @@"zod": "3.24.3"},"devDependencies": {+ "@playwright/test": "1.61.1","@streetwriters/kysely": "^0.27.4","@types/node": "22.15.3","@types/yargs": "^17.0.33",@@ -536,9 +538,10 @@"electron": "^37.0.0","electron-builder": "^26.8.1","esbuild": "0.21.5",+ "fkill": "^10.0.3","node-abi": "^4.5.0","node-gyp-build": "^4.8.4",- "playwright": "1.48.2",+ "playwright-core": "1.61.1","prebuildify": "^6.0.1","slugify": "1.6.6","tree-kill": "^1.2.2",@@ -553,7 +556,6 @@"version": "2.3.0","resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz","integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==",- "dev": true,"license": "Apache-2.0","dependencies": {"@jridgewell/gen-mapping": "^0.3.5",@@ -590,7 +592,6 @@"version": "7.22.5","resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.5.tgz","integrity": "sha512-SBuTAjg91A3eKOvD+bPEz3LlhHZRNu1nFOVts9lzDJTXshHTjII0BAtDS3Y2DAkdZdDKWVZGVwkDfc4Clxn1dg==",- "dev": true,"license": "MIT","dependencies": {"@ampproject/remapping": "^2.2.0",@@ -749,7 +750,6 @@"version": "7.27.3","resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.27.3.tgz","integrity": "sha512-dSOvYwvyLsWBeIRyOeHXp5vPj5l1I011r52FM1+r1jCERv+aFXYk4whgQccYEGYxK2H3ZAIA8nuPkQ0HaUo3qg==",- "dev": true,"license": "MIT","dependencies": {"@babel/helper-module-imports": "^7.27.1",@@ -881,7 +881,6 @@"version": "7.27.6","resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.27.6.tgz","integrity": "sha512-muE8Tt8M22638HU31A3CgfSUciwz1fhATfoVai05aPXGor//CdWDCbnlY1yvBPo07njuVOCNGCSp/GTt12lIug==",- "dev": true,"license": "MIT","dependencies": {"@babel/template": "^7.27.2",@@ -2136,6 +2135,50 @@"react": ">=16.8.0"}},+ "node_modules/@electron-internal/extract-zip": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/@electron-internal/extract-zip/-/extract-zip-1.0.2.tgz",+ "integrity": "sha512-VJuNETNPEhrmQEZezeTZO5TZMV+dobBRyJ7zHjGJWIhMS7m7W1UeClt69u4hkUxv9ZZVxuli/E9Yvc4gDNHGsg==",+ "license": "BSD-2-Clause",+ "peer": true,+ "engines": {+ "node": ">=22.12.0"+ }+ },+ "node_modules/@electron/get": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/@electron/get/-/get-5.0.0.tgz",+ "integrity": "sha512-pjoBpru1KdEtcExBnuHAP1cAc/5faoedw0hzJkL3o4/IJp7HNF1+fbrdxT3gMYRX2oJfvnA/WXeCTVQpYYxyJA==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "debug": "^4.1.1",+ "env-paths": "^3.0.0",+ "graceful-fs": "^4.2.11",+ "progress": "^2.0.3",+ "semver": "^7.6.3",+ "sumchecker": "^3.0.1"+ },+ "engines": {+ "node": ">=22.12.0"+ },+ "optionalDependencies": {+ "undici": "^7.24.4"+ }+ },+ "node_modules/@electron/get/node_modules/semver": {+ "version": "7.8.4",+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.4.tgz",+ "integrity": "sha512-rUCObTnP32Q08R2uuIrt7r9PlEonuTmtuXYcW6s5kjdlj3xbnwe+21yXptAUYcMAABLkYYTtnmzb3w3EDZfueA==",+ "license": "ISC",+ "peer": true,+ "bin": {+ "semver": "bin/semver.js"+ },+ "engines": {+ "node": ">=10"+ }+ },"node_modules/@emotion/babel-plugin": {"version": "11.13.5","resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.13.5.tgz",@@ -4498,6 +4541,37 @@"polished": "^4.0.5"}},+ "node_modules/@theme-ui/color-modes": {+ "version": "0.16.2",+ "resolved": "https://registry.npmjs.org/@theme-ui/color-modes/-/color-modes-0.16.2.tgz",+ "integrity": "sha512-jWEWx53lxNgWCT38i/kwLV2rsvJz8lVZgi5oImnVwYba9VejXD23q1ckbNFJHosQ8KKXY87ht0KPC6BQFIiHtQ==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@theme-ui/core": "^0.16.2",+ "@theme-ui/css": "^0.16.2",+ "deepmerge": "^4.2.2"+ },+ "peerDependencies": {+ "@emotion/react": "^11.11.1",+ "react": ">=18"+ }+ },+ "node_modules/@theme-ui/color-modes/node_modules/@theme-ui/core": {+ "version": "0.16.2",+ "resolved": "https://registry.npmjs.org/@theme-ui/core/-/core-0.16.2.tgz",+ "integrity": "sha512-bBd/ltbwO9vIUjF1jtlOX6XN0IIOdf1vzBp2JCKsSOqdfn84m+XL8OogIe/zOhQ+aM94Nrq4+32tFJc8sFav4Q==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@theme-ui/css": "^0.16.2",+ "deepmerge": "^4.2.2"+ },+ "peerDependencies": {+ "@emotion/react": "^11.11.1",+ "react": ">=18"+ }+ },"node_modules/@theme-ui/components": {"version": "0.16.1","resolved": "https://registry.npmjs.org/@theme-ui/components/-/components-0.16.1.tgz",@@ -4543,6 +4617,37 @@"@emotion/react": "^11.11.1"}},+ "node_modules/@theme-ui/theme-provider": {+ "version": "0.16.2",+ "resolved": "https://registry.npmjs.org/@theme-ui/theme-provider/-/theme-provider-0.16.2.tgz",+ "integrity": "sha512-LRnVevODcGqO0JyLJ3wht+PV3ZoZcJ7XXLJAJWDoGeII4vZcPQKwVy4Lpz/juHsZppQxKcB3U+sQDGBnP25irQ==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@theme-ui/color-modes": "^0.16.2",+ "@theme-ui/core": "^0.16.2",+ "@theme-ui/css": "^0.16.2"+ },+ "peerDependencies": {+ "@emotion/react": "^11.11.1",+ "react": ">=18"+ }+ },+ "node_modules/@theme-ui/theme-provider/node_modules/@theme-ui/core": {+ "version": "0.16.2",+ "resolved": "https://registry.npmjs.org/@theme-ui/core/-/core-0.16.2.tgz",+ "integrity": "sha512-bBd/ltbwO9vIUjF1jtlOX6XN0IIOdf1vzBp2JCKsSOqdfn84m+XL8OogIe/zOhQ+aM94Nrq4+32tFJc8sFav4Q==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@theme-ui/css": "^0.16.2",+ "deepmerge": "^4.2.2"+ },+ "peerDependencies": {+ "@emotion/react": "^11.11.1",+ "react": ">=18"+ }+ },"node_modules/@trpc/client": {"version": "10.45.2","resolved": "https://registry.npmjs.org/@trpc/client/-/client-10.45.2.tgz",@@ -4575,7 +4680,6 @@"version": "10.45.2","resolved": "https://registry.npmjs.org/@trpc/server/-/server-10.45.2.tgz","integrity": "sha512-wOrSThNNE4HUnuhJG6PfDRp4L2009KDVxsd+2VYH8ro6o/7/jwYZ8Uu5j+VaW+mOmc8EHerHzGcdbGNQSAUPgg==",- "dev": true,"funding": ["https://trpc.io/sponsor"],@@ -4748,14 +4852,12 @@"version": "15.7.15","resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz","integrity": "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==",- "dev": true,"license": "MIT"},"node_modules/@types/react": {"version": "18.3.5","resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.5.tgz","integrity": "sha512-WeqMfGJLGuLCqHGYRGHxnKrXcTitc6L/nBUWfWPcTarG3t9PsquqUMuVeXZeca+mglY4Vo5GZjCi0A3Or2lnxA==",- "dev": true,"license": "MIT","dependencies": {"@types/prop-types": "*",@@ -5001,6 +5103,198 @@"url": "https://opencollective.com/vitest"}},+ "node_modules/@webassemblyjs/ast": {+ "version": "1.14.1",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz",+ "integrity": "sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@webassemblyjs/helper-numbers": "1.13.2",+ "@webassemblyjs/helper-wasm-bytecode": "1.13.2"+ }+ },+ "node_modules/@webassemblyjs/floating-point-hex-parser": {+ "version": "1.13.2",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz",+ "integrity": "sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA==",+ "dev": true,+ "license": "MIT",+ "peer": true+ },+ "node_modules/@webassemblyjs/helper-api-error": {+ "version": "1.13.2",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz",+ "integrity": "sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ==",+ "dev": true,+ "license": "MIT",+ "peer": true+ },+ "node_modules/@webassemblyjs/helper-buffer": {+ "version": "1.14.1",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz",+ "integrity": "sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA==",+ "dev": true,+ "license": "MIT",+ "peer": true+ },+ "node_modules/@webassemblyjs/helper-numbers": {+ "version": "1.13.2",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz",+ "integrity": "sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@webassemblyjs/floating-point-hex-parser": "1.13.2",+ "@webassemblyjs/helper-api-error": "1.13.2",+ "@xtuc/long": "4.2.2"+ }+ },+ "node_modules/@webassemblyjs/helper-wasm-bytecode": {+ "version": "1.13.2",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz",+ "integrity": "sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA==",+ "dev": true,+ "license": "MIT",+ "peer": true+ },+ "node_modules/@webassemblyjs/helper-wasm-section": {+ "version": "1.14.1",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz",+ "integrity": "sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@webassemblyjs/ast": "1.14.1",+ "@webassemblyjs/helper-buffer": "1.14.1",+ "@webassemblyjs/helper-wasm-bytecode": "1.13.2",+ "@webassemblyjs/wasm-gen": "1.14.1"+ }+ },+ "node_modules/@webassemblyjs/ieee754": {+ "version": "1.13.2",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz",+ "integrity": "sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@xtuc/ieee754": "^1.2.0"+ }+ },+ "node_modules/@webassemblyjs/leb128": {+ "version": "1.13.2",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.13.2.tgz",+ "integrity": "sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw==",+ "dev": true,+ "license": "Apache-2.0",+ "peer": true,+ "dependencies": {+ "@xtuc/long": "4.2.2"+ }+ },+ "node_modules/@webassemblyjs/utf8": {+ "version": "1.13.2",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.13.2.tgz",+ "integrity": "sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ==",+ "dev": true,+ "license": "MIT",+ "peer": true+ },+ "node_modules/@webassemblyjs/wasm-edit": {+ "version": "1.14.1",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz",+ "integrity": "sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@webassemblyjs/ast": "1.14.1",+ "@webassemblyjs/helper-buffer": "1.14.1",+ "@webassemblyjs/helper-wasm-bytecode": "1.13.2",+ "@webassemblyjs/helper-wasm-section": "1.14.1",+ "@webassemblyjs/wasm-gen": "1.14.1",+ "@webassemblyjs/wasm-opt": "1.14.1",+ "@webassemblyjs/wasm-parser": "1.14.1",+ "@webassemblyjs/wast-printer": "1.14.1"+ }+ },+ "node_modules/@webassemblyjs/wasm-gen": {+ "version": "1.14.1",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz",+ "integrity": "sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@webassemblyjs/ast": "1.14.1",+ "@webassemblyjs/helper-wasm-bytecode": "1.13.2",+ "@webassemblyjs/ieee754": "1.13.2",+ "@webassemblyjs/leb128": "1.13.2",+ "@webassemblyjs/utf8": "1.13.2"+ }+ },+ "node_modules/@webassemblyjs/wasm-opt": {+ "version": "1.14.1",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz",+ "integrity": "sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@webassemblyjs/ast": "1.14.1",+ "@webassemblyjs/helper-buffer": "1.14.1",+ "@webassemblyjs/wasm-gen": "1.14.1",+ "@webassemblyjs/wasm-parser": "1.14.1"+ }+ },+ "node_modules/@webassemblyjs/wasm-parser": {+ "version": "1.14.1",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz",+ "integrity": "sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@webassemblyjs/ast": "1.14.1",+ "@webassemblyjs/helper-api-error": "1.13.2",+ "@webassemblyjs/helper-wasm-bytecode": "1.13.2",+ "@webassemblyjs/ieee754": "1.13.2",+ "@webassemblyjs/leb128": "1.13.2",+ "@webassemblyjs/utf8": "1.13.2"+ }+ },+ "node_modules/@webassemblyjs/wast-printer": {+ "version": "1.14.1",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz",+ "integrity": "sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@webassemblyjs/ast": "1.14.1",+ "@xtuc/long": "4.2.2"+ }+ },+ "node_modules/@xtuc/ieee754": {+ "version": "1.2.0",+ "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz",+ "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==",+ "dev": true,+ "license": "BSD-3-Clause",+ "peer": true+ },+ "node_modules/@xtuc/long": {+ "version": "4.2.2",+ "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz",+ "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==",+ "dev": true,+ "license": "Apache-2.0",+ "peer": true+ },"node_modules/@zip.js/zip.js": {"version": "2.7.62","resolved": "https://registry.npmjs.org/@zip.js/zip.js/-/zip.js-2.7.62.tgz",@@ -5032,6 +5326,20 @@"node": ">=0.4.0"}},+ "node_modules/acorn-import-phases": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/acorn-import-phases/-/acorn-import-phases-1.0.4.tgz",+ "integrity": "sha512-wKmbr/DDiIXzEOiWrTTUcDm24kQ2vGfZQvM2fwg2vXqR5uW6aapr7ObPtj1th32b9u90/Pf4AItvdTh42fBmVQ==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "engines": {+ "node": ">=10.13.0"+ },+ "peerDependencies": {+ "acorn": "^8.14.0"+ }+ },"node_modules/agent-base": {"version": "6.0.2","resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",@@ -5062,6 +5370,51 @@"url": "https://github.com/sponsors/epoberezkin"}},+ "node_modules/ajv-formats": {+ "version": "2.1.1",+ "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz",+ "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "ajv": "^8.0.0"+ },+ "peerDependencies": {+ "ajv": "^8.0.0"+ },+ "peerDependenciesMeta": {+ "ajv": {+ "optional": true+ }+ }+ },+ "node_modules/ajv-formats/node_modules/ajv": {+ "version": "8.20.0",+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz",+ "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "fast-deep-equal": "^3.1.3",+ "fast-uri": "^3.0.1",+ "json-schema-traverse": "^1.0.0",+ "require-from-string": "^2.0.2"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/epoberezkin"+ }+ },+ "node_modules/ajv-formats/node_modules/json-schema-traverse": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",+ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",+ "dev": true,+ "license": "MIT",+ "peer": true+ },"node_modules/ajv-keywords": {"version": "3.5.2","resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz",@@ -5756,6 +6109,17 @@"node": ">=10"}},+ "node_modules/chrome-trace-event": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz",+ "integrity": "sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "engines": {+ "node": ">=6.0"+ }+ },"node_modules/clipboard-polyfill": {"version": "4.1.0","resolved": "https://registry.npmjs.org/clipboard-polyfill/-/clipboard-polyfill-4.1.0.tgz",@@ -6363,6 +6727,25 @@"node": ">=0.10.0"}},+ "node_modules/electron": {+ "version": "42.4.0",+ "resolved": "https://registry.npmjs.org/electron/-/electron-42.4.0.tgz",+ "integrity": "sha512-OXXqh9LD9KxXPv2Fe25EfU9N9AvWTuV6V81sfhQaNvTAXCd9ONA+Q4OWvMe+CmYD6xIwjFxGGtG/ZphDYYC5OQ==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@electron-internal/extract-zip": "^1.0.1",+ "@electron/get": "^5.0.0",+ "@types/node": "^24.9.0"+ },+ "bin": {+ "electron": "cli.js",+ "install-electron": "install.js"+ },+ "engines": {+ "node": ">= 22.12.0"+ }+ },"node_modules/electron-to-chromium": {"version": "1.5.267","resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.267.tgz",@@ -6383,6 +6766,23 @@"electron": ">19.0.0"}},+ "node_modules/electron/node_modules/@types/node": {+ "version": "24.13.2",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-24.13.2.tgz",+ "integrity": "sha512-fRa09kZTgu8o71KFcDjUFuc7F+dEbZYZmkI0mg5YBTRs0yMKjYHsq/c0urDKeDb+D5qVgXOdFcuu+DZPKOITwA==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "undici-types": "~7.18.0"+ }+ },+ "node_modules/electron/node_modules/undici-types": {+ "version": "7.18.2",+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz",+ "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==",+ "license": "MIT",+ "peer": true+ },"node_modules/emoji-regex": {"version": "8.0.0","resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",@@ -6410,6 +6810,21 @@"once": "^1.4.0"}},+ "node_modules/enhanced-resolve": {+ "version": "5.23.0",+ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.23.0.tgz",+ "integrity": "sha512-yJN/BOOLxcOW2aQgeif9mSnaUB8KtvmMMp56oA1kx1CRfBKbhZm2pJ+NBY+3eOboHxix8lfjWpHE0Ei5U8RbSA==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "graceful-fs": "^4.2.4",+ "tapable": "^2.3.3"+ },+ "engines": {+ "node": ">=10.13.0"+ }+ },"node_modules/entities": {"version": "7.0.1","resolved": "https://registry.npmjs.org/entities/-/entities-7.0.1.tgz",@@ -6422,6 +6837,19 @@"url": "https://github.com/fb55/entities?sponsor=1"}},+ "node_modules/env-paths": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-3.0.0.tgz",+ "integrity": "sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==",+ "license": "MIT",+ "peer": true,+ "engines": {+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },"node_modules/error-ex": {"version": "1.3.2","resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",@@ -6630,6 +7058,21 @@"url": "https://github.com/sponsors/sindresorhus"}},+ "node_modules/eslint-scope": {+ "version": "5.1.1",+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",+ "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==",+ "dev": true,+ "license": "BSD-2-Clause",+ "peer": true,+ "dependencies": {+ "esrecurse": "^4.3.0",+ "estraverse": "^4.1.1"+ },+ "engines": {+ "node": ">=8.0.0"+ }+ },"node_modules/esprima": {"version": "4.0.1","resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",@@ -6643,6 +7086,42 @@"node": ">=4"}},+ "node_modules/esrecurse": {+ "version": "4.3.0",+ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",+ "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",+ "dev": true,+ "license": "BSD-2-Clause",+ "peer": true,+ "dependencies": {+ "estraverse": "^5.2.0"+ },+ "engines": {+ "node": ">=4.0"+ }+ },+ "node_modules/esrecurse/node_modules/estraverse": {+ "version": "5.3.0",+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",+ "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",+ "dev": true,+ "license": "BSD-2-Clause",+ "peer": true,+ "engines": {+ "node": ">=4.0"+ }+ },+ "node_modules/estraverse": {+ "version": "4.3.0",+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",+ "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",+ "dev": true,+ "license": "BSD-2-Clause",+ "peer": true,+ "engines": {+ "node": ">=4.0"+ }+ },"node_modules/estree-walker": {"version": "2.0.2","resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",@@ -6666,6 +7145,23 @@"integrity": "sha512-4IJSItgS/41IxN5UVAVuAyczwZF7ZIEsM1XAoUzIHA6A+xzusEZUutdXz2Nr+MQPLxfTiCvqE79/C8HT8fKFvA==","license": "MIT"},+ "node_modules/eventemitter3": {+ "version": "5.0.4",+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz",+ "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==",+ "license": "MIT"+ },+ "node_modules/events": {+ "version": "3.3.0",+ "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz",+ "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "engines": {+ "node": ">=0.8.x"+ }+ },"node_modules/exenv": {"version": "1.2.2","resolved": "https://registry.npmjs.org/exenv/-/exenv-1.2.2.tgz",@@ -7056,7 +7552,6 @@"version": "1.0.0-beta.2","resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz","integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==",- "dev": true,"license": "MIT","engines": {"node": ">=6.9.0"@@ -7163,6 +7658,14 @@"url": "https://github.com/sponsors/isaacs"}},+ "node_modules/glob-to-regexp": {+ "version": "0.4.1",+ "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz",+ "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==",+ "dev": true,+ "license": "BSD-2-Clause",+ "peer": true+ },"node_modules/globals": {"version": "11.12.0","resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",@@ -7214,7 +7717,6 @@"version": "4.2.11","resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz","integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",- "dev": true,"license": "ISC"},"node_modules/gray-matter": {@@ -8179,6 +8681,39 @@"node": ">=10"}},+ "node_modules/jest-worker": {+ "version": "27.5.1",+ "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz",+ "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@types/node": "*",+ "merge-stream": "^2.0.0",+ "supports-color": "^8.0.0"+ },+ "engines": {+ "node": ">= 10.13.0"+ }+ },+ "node_modules/jest-worker/node_modules/supports-color": {+ "version": "8.1.1",+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",+ "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "has-flag": "^4.0.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/chalk/supports-color?sponsor=1"+ }+ },"node_modules/js-sha256": {"version": "0.10.1","resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.10.1.tgz",@@ -8240,7 +8775,6 @@"version": "2.2.3","resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz","integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",- "dev": true,"license": "MIT","bin": {"json5": "lib/cli.js"@@ -8318,6 +8852,21 @@"integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==","license": "MIT"},+ "node_modules/loader-runner": {+ "version": "4.3.2",+ "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.2.tgz",+ "integrity": "sha512-DFEqQ3ihfS9blba08cLfYf1NRAIEm+dDjic073DRDc3/JspI/8wYmtDsHwd3+4hwvdxSK7PGaElfTmm0awWJ4w==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "engines": {+ "node": ">=6.11.5"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/webpack"+ }+ },"node_modules/loader-utils": {"version": "2.0.4","resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz",@@ -8807,6 +9356,14 @@"url": "https://opencollective.com/unified"}},+ "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,+ "license": "MIT",+ "peer": true+ },"node_modules/micromark": {"version": "3.2.0","resolved": "https://registry.npmjs.org/micromark/-/micromark-3.2.0.tgz",@@ -9560,6 +10117,14 @@"dev": true,"license": "MIT"},+ "node_modules/neo-async": {+ "version": "2.6.2",+ "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",+ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==",+ "dev": true,+ "license": "MIT",+ "peer": true+ },"node_modules/no-case": {"version": "3.0.4","resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz",@@ -9800,6 +10365,34 @@"url": "https://github.com/sponsors/ljharb"}},+ "node_modules/p-queue": {+ "version": "9.3.0",+ "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-9.3.0.tgz",+ "integrity": "sha512-7NED7xhQ74Ngp4JP/2e0VZHp7vSWfJfqeiR92jPgxsz6m0Se4P03YoTKa9dDXyZ3r6P616gUXttrB6nnHYKang==",+ "license": "MIT",+ "dependencies": {+ "eventemitter3": "^5.0.4",+ "p-timeout": "^7.0.0"+ },+ "engines": {+ "node": ">=20"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/p-timeout": {+ "version": "7.0.1",+ "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-7.0.1.tgz",+ "integrity": "sha512-AxTM2wDGORHGEkPCt8yqxOTMgpfbEHqF51f/5fJCmwFC3C/zNcGT63SymH2ttOAaiIws2zVg4+izQCjrakcwHg==",+ "license": "MIT",+ "engines": {+ "node": ">=20"+ },+ "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",@@ -10093,6 +10686,16 @@"url": "https://github.com/sponsors/sindresorhus"}},+ "node_modules/progress": {+ "version": "2.0.3",+ "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",+ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",+ "license": "MIT",+ "peer": true,+ "engines": {+ "node": ">=0.4.0"+ }+ },"node_modules/prop-types": {"version": "15.8.1","resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz",@@ -11452,6 +12055,19 @@"integrity": "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==","license": "MIT"},+ "node_modules/sumchecker": {+ "version": "3.0.1",+ "resolved": "https://registry.npmjs.org/sumchecker/-/sumchecker-3.0.1.tgz",+ "integrity": "sha512-MvjXzkz/BOfyVDkG0oFOtBxHX2u3gKbMHIF/dXblZsgD3BWOFLmHovIpZY7BykJdAjcqRCBi1WYBNdEC9yI7vg==",+ "license": "Apache-2.0",+ "peer": true,+ "dependencies": {+ "debug": "^4.1.0"+ },+ "engines": {+ "node": ">= 8.0"+ }+ },"node_modules/supports-color": {"version": "7.2.0","resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",@@ -11484,6 +12100,21 @@"dev": true,"license": "MIT"},+ "node_modules/tapable": {+ "version": "2.3.3",+ "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.3.tgz",+ "integrity": "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "engines": {+ "node": ">=6"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/webpack"+ }+ },"node_modules/tar": {"version": "6.2.1","resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz",@@ -11607,6 +12238,129 @@"node": ">=10"}},+ "node_modules/terser-webpack-plugin": {+ "version": "5.6.1",+ "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.6.1.tgz",+ "integrity": "sha512-201R5j+sJpK8nFWwKVyNfZot8FaJbLZDq5evriVzbV1wDtSXDjRUDRfJzHpAaxFDMEhsZL1QkeqM61wgsS3KaQ==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@jridgewell/trace-mapping": "^0.3.25",+ "jest-worker": "^27.4.5",+ "schema-utils": "^4.3.0",+ "terser": "^5.31.1"+ },+ "engines": {+ "node": ">= 10.13.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/webpack"+ },+ "peerDependencies": {+ "webpack": "^5.1.0"+ },+ "peerDependenciesMeta": {+ "@minify-html/node": {+ "optional": true+ },+ "@swc/core": {+ "optional": true+ },+ "@swc/css": {+ "optional": true+ },+ "@swc/html": {+ "optional": true+ },+ "clean-css": {+ "optional": true+ },+ "cssnano": {+ "optional": true+ },+ "csso": {+ "optional": true+ },+ "esbuild": {+ "optional": true+ },+ "html-minifier-terser": {+ "optional": true+ },+ "lightningcss": {+ "optional": true+ },+ "postcss": {+ "optional": true+ },+ "uglify-js": {+ "optional": true+ }+ }+ },+ "node_modules/terser-webpack-plugin/node_modules/ajv": {+ "version": "8.20.0",+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz",+ "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "fast-deep-equal": "^3.1.3",+ "fast-uri": "^3.0.1",+ "json-schema-traverse": "^1.0.0",+ "require-from-string": "^2.0.2"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/epoberezkin"+ }+ },+ "node_modules/terser-webpack-plugin/node_modules/ajv-keywords": {+ "version": "5.1.0",+ "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz",+ "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "fast-deep-equal": "^3.1.3"+ },+ "peerDependencies": {+ "ajv": "^8.8.2"+ }+ },+ "node_modules/terser-webpack-plugin/node_modules/json-schema-traverse": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",+ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",+ "dev": true,+ "license": "MIT",+ "peer": true+ },+ "node_modules/terser-webpack-plugin/node_modules/schema-utils": {+ "version": "4.3.3",+ "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.3.tgz",+ "integrity": "sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@types/json-schema": "^7.0.9",+ "ajv": "^8.9.0",+ "ajv-formats": "^2.1.1",+ "ajv-keywords": "^5.1.0"+ },+ "engines": {+ "node": ">= 10.13.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/webpack"+ }+ },"node_modules/terser/node_modules/commander": {"version": "2.20.3","resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",@@ -11824,6 +12578,17 @@"url": "https://github.com/sponsors/ljharb"}},+ "node_modules/undici": {+ "version": "7.27.2",+ "resolved": "https://registry.npmjs.org/undici/-/undici-7.27.2.tgz",+ "integrity": "sha512-uZsKNuzQxDMUY6M3pIMvy5tvlGmtq8XJ2oLAkfRKGNu+1VQAIvLy2xIVG5ATZl5wDXl/tddByAWCizRbOme+TA==",+ "license": "MIT",+ "optional": true,+ "peer": true,+ "engines": {+ "node": ">=20.18.1"+ }+ },"node_modules/undici-types": {"version": "7.8.0","resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz",@@ -12405,6 +13170,21 @@"loose-envify": "^1.0.0"}},+ "node_modules/watchpack": {+ "version": "2.5.1",+ "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.5.1.tgz",+ "integrity": "sha512-Zn5uXdcFNIA1+1Ei5McRd+iRzfhENPCe7LeABkJtNulSxjma+l7ltNx55BWZkRlwRnpOgHqxnjyaDgJnNXnqzg==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "glob-to-regexp": "^0.4.1",+ "graceful-fs": "^4.1.2"+ },+ "engines": {+ "node": ">=10.13.0"+ }+ },"node_modules/web-namespaces": {"version": "2.0.1","resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz",@@ -12434,6 +13214,153 @@"node": ">=12"}},+ "node_modules/webpack": {+ "version": "5.107.2",+ "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.107.2.tgz",+ "integrity": "sha512-v7RhXaJbpMlV0D7hC7lb2EbnxkoeUqf9qhKr6lozx3Q48pmFrqqNRmZFUEGmi7pSwm6fCQ2H1IjvCkHqdpVdjQ==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@types/estree": "^1.0.8",+ "@types/json-schema": "^7.0.15",+ "@webassemblyjs/ast": "^1.14.1",+ "@webassemblyjs/wasm-edit": "^1.14.1",+ "@webassemblyjs/wasm-parser": "^1.14.1",+ "acorn": "^8.16.0",+ "acorn-import-phases": "^1.0.3",+ "browserslist": "^4.28.1",+ "chrome-trace-event": "^1.0.2",+ "enhanced-resolve": "^5.22.0",+ "es-module-lexer": "^2.1.0",+ "eslint-scope": "5.1.1",+ "events": "^3.2.0",+ "glob-to-regexp": "^0.4.1",+ "graceful-fs": "^4.2.11",+ "loader-runner": "^4.3.2",+ "mime-db": "^1.54.0",+ "neo-async": "^2.6.2",+ "schema-utils": "^4.3.3",+ "tapable": "^2.3.0",+ "terser-webpack-plugin": "^5.5.0",+ "watchpack": "^2.5.1",+ "webpack-sources": "^3.5.0"+ },+ "bin": {+ "webpack": "bin/webpack.js"+ },+ "engines": {+ "node": ">=10.13.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/webpack"+ },+ "peerDependenciesMeta": {+ "webpack-cli": {+ "optional": true+ }+ }+ },+ "node_modules/webpack-sources": {+ "version": "3.5.0",+ "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.5.0.tgz",+ "integrity": "sha512-HPuy+uuoTCaaoEoI1LQ3JN9+vrPBvEesnnX1jADHy728cHSMlq4wUc4afYqahq2B1mhQVZxCXOkNTnXltr+2vQ==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "engines": {+ "node": ">=10.13.0"+ }+ },+ "node_modules/webpack/node_modules/@types/estree": {+ "version": "1.0.9",+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz",+ "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==",+ "dev": true,+ "license": "MIT",+ "peer": true+ },+ "node_modules/webpack/node_modules/ajv": {+ "version": "8.20.0",+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz",+ "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "fast-deep-equal": "^3.1.3",+ "fast-uri": "^3.0.1",+ "json-schema-traverse": "^1.0.0",+ "require-from-string": "^2.0.2"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/epoberezkin"+ }+ },+ "node_modules/webpack/node_modules/ajv-keywords": {+ "version": "5.1.0",+ "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz",+ "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "fast-deep-equal": "^3.1.3"+ },+ "peerDependencies": {+ "ajv": "^8.8.2"+ }+ },+ "node_modules/webpack/node_modules/es-module-lexer": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.1.0.tgz",+ "integrity": "sha512-n27zTYMjYu1aj4MjCWzSP7G9r75utsaoc8m61weK+W8JMBGGQybd43GstCXZ3WNmSFtGT9wi59qQTW6mhTR5LQ==",+ "dev": true,+ "license": "MIT",+ "peer": true+ },+ "node_modules/webpack/node_modules/json-schema-traverse": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",+ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",+ "dev": true,+ "license": "MIT",+ "peer": true+ },+ "node_modules/webpack/node_modules/mime-db": {+ "version": "1.54.0",+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz",+ "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/webpack/node_modules/schema-utils": {+ "version": "4.3.3",+ "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.3.tgz",+ "integrity": "sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@types/json-schema": "^7.0.9",+ "ajv": "^8.9.0",+ "ajv-formats": "^2.1.1",+ "ajv-keywords": "^5.1.0"+ },+ "engines": {+ "node": ">= 10.13.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/webpack"+ }+ },"node_modules/whatwg-mimetype": {"version": "3.0.0","resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz",diff --git a/apps/web/package.json b/apps/web/package.jsonindex 82c88c1cd..85a0e1b3d 100644--- a/apps/web/package.json+++ b/apps/web/package.json@@ -61,6 +61,7 @@"katex": "0.16.11","mac-scrollbar": "0.13.6","mutative": "^1.1.0",+ "p-queue": "^9.3.0","pdfjs-dist": "3.6.172","phone": "^3.1.14","platform": "^1.3.6",diff --git a/apps/web/src/components/editor/index.tsx b/apps/web/src/components/editor/index.tsxindex 0f0c0901d..78292f3a5 100644--- a/apps/web/src/components/editor/index.tsx+++ b/apps/web/src/components/editor/index.tsx@@ -589,7 +589,7 @@ export function Editor(props: EditorProps) {const attachment = await db.attachments.attachment(hash);if (!attachment)throw new Error("No attachment found with hash: " + hash);- if (attachment.mimeType.startsWith("image/")) {+ if (attachment.mimeType.startsWith("image/") || type === "image") {await previewImageAttachment(attachment);} else if (onPreviewDocument &&@@ -633,7 +633,7 @@ export function Editor(props: EditorProps) {await insertAttachments(mime, (attachments) => {const editor = useEditorManager.getState().getEditor(id)?.editor;if (!editor) return;- attachments.forEach((a) => editor?.attachFile(a));+ editor?.attachFiles(...attachments);});}}onGetAttachmentData={async (attachment) => {@@ -662,7 +662,7 @@ export function Editor(props: EditorProps) {onDone: (attachments) => {const editor = useEditorManager.getState().getEditor(id)?.editor;if (!editor) return;- attachments.forEach((a) => editor?.attachFile(a));+ editor?.attachFiles(...attachments);}});}}@@ -825,7 +825,7 @@ function DropZone(props: DropZoneProps) {.getState().getEditor(activeEditorId)?.editor;if (!editor) return;- attachments.forEach((a) => editor?.attachFile(a));+ editor?.attachFiles(...attachments);}});} catch (e) {diff --git a/apps/web/src/components/editor/picker.ts b/apps/web/src/components/editor/picker.tsindex 1a04bc4da..9f82c8bab 100644--- a/apps/web/src/components/editor/picker.ts+++ b/apps/web/src/components/editor/picker.ts@@ -27,10 +27,10 @@ import {hashStream,writeEncryptedFile} from "../../interfaces/fs";-import { compressImage, FileWithURI } from "../../utils/image-compressor";import { checkFeature } from "../../common";import { AttachFilesDialog } from "../../dialogs/attach-files-dialog";import { strings } from "@notesnook/intl";+import Queue from "p-queue";export async function insertAttachments(type: string,@@ -81,7 +81,6 @@ export async function reuploadAttachment(}type AttachFilesMessage =- | { type: "compressing"; index: number }| { type: "encrypting"; index: number }| {type: "done";@@ -90,60 +89,39 @@ type AttachFilesMessage =}| { type: "error"; index: number; error: string };-export async function* attachFiles(+export async function attachFiles(files: File[],- shouldCompress: boolean[],+ report: (progress: AttachFilesMessage) => void,skipSpecialImageHandling = false-): AsyncGenerator<AttachFilesMessage> {+) {+ const queue = new Queue({ concurrency: 8 });for (let i = 0; i < files.length; i++) {- let file = files[i];- const shouldCompressFile = shouldCompress[i];+ queue.add(async () => {+ const file = files[i];++ report({ type: "encrypting", index: i });- if (shouldCompressFile) {- yield { type: "compressing", index: i };try {- const compressed = await compressImage(file, {- maxWidth: (naturalWidth) => Math.min(1920, naturalWidth * 0.7),- width: (naturalWidth) => naturalWidth,- height: (_, naturalHeight) => naturalHeight,- resize: "contain",- quality: 0.7- });- file = new FileWithURI([compressed], file.name, {- lastModified: file.lastModified,- type: file.type+ const allowed = await checkFeature("fileSize", {+ value: file.size,+ type: "toast"});- } catch (e) {- yield {- type: "error",- index: i,- error: (e as Error).message || strings.compressionFailed()- };- continue;- }- }+ if (!allowed) {+ throw new Error(strings.fileSizeLimitExceededPleaseUpgrade());+ }- yield { type: "encrypting", index: i };+ const attachment =+ !skipSpecialImageHandling && file.type.startsWith("image/")+ ? await pickImage(file)+ : await pickFile(file);- try {- const allowed = await checkFeature("fileSize", {- value: file.size,- type: "toast"- });- if (!allowed) {- throw new Error(strings.fileSizeLimitExceededPleaseUpgrade());+ report({ type: "done", index: i, attachment: attachment || undefined });+ } catch (e) {+ report({ type: "error", index: i, error: (e as Error).message });}-- const attachment =- !skipSpecialImageHandling && file.type.startsWith("image/")- ? await pickImage(file)- : await pickFile(file);-- yield { type: "done", index: i, attachment: attachment || undefined };- } catch (e) {- yield { type: "error", index: i, error: (e as Error).message };- }+ });}+ await queue.onIdle();}/**@@ -205,6 +183,7 @@ export type AttachmentProgress = {type: "encrypt" | "download" | "upload";total: number;loaded: number;+ file?: File;};type AddAttachmentOptions = {@@ -250,7 +229,7 @@ async function addAttachment(hash,hashType,filename: exists?.filename || file.name,- mimeType: exists?.type || file.type,+ mimeType: exists?.mimeType || file.type,key});}diff --git a/apps/web/src/components/editor/tiptap.tsx b/apps/web/src/components/editor/tiptap.tsxindex 859b9d264..c2ccd6a65 100644--- a/apps/web/src/components/editor/tiptap.tsx+++ b/apps/web/src/components/editor/tiptap.tsx@@ -786,10 +786,8 @@ function toIEditor(editor: Editor): IEditor {}).run();},- attachFile: (file: Attachment) =>- file.type === "image"- ? editor.commands.insertImage(file)- : editor.commands.insertAttachment(file),+ attachFiles: async (...files: Attachment[]) =>+ editor.commands.insertAttachment(...files),sendAttachmentProgress: (hash, progress) =>editor.commands.updateAttachment({diff --git a/apps/web/src/components/editor/types.ts b/apps/web/src/components/editor/types.tsindex 477fafbf8..5d39b21be 100644--- a/apps/web/src/components/editor/types.ts+++ b/apps/web/src/components/editor/types.ts@@ -48,7 +48,7 @@ export interface IEditor {undo: () => void;redo: () => void;updateContent: (content: string) => void;- attachFile: (file: Attachment) => void;+ attachFiles: (...files: Attachment[]) => void;sendAttachmentProgress: (hash: string, progress: number) => void;startSearch: () => void;getContent: () => string;diff --git a/apps/web/src/components/properties/toggle.tsx b/apps/web/src/components/properties/toggle.tsxindex e789112e4..0670c3803 100644--- a/apps/web/src/components/properties/toggle.tsx+++ b/apps/web/src/components/properties/toggle.tsx@@ -67,8 +67,7 @@ function Toggle(props: ToggleProps) {sx={{m: 0,bg: isOn ? "accent" : "icon-secondary",- flexShrink: 0,- scale: 0.75+ flexShrink: 0}}checked={isOn}onClick={(e) => e.stopPropagation()}diff --git a/apps/web/src/components/publish-view/index.tsx b/apps/web/src/components/publish-view/index.tsxindex 665e25c30..1ba1f106a 100644--- a/apps/web/src/components/publish-view/index.tsx+++ b/apps/web/src/components/publish-view/index.tsx@@ -265,8 +265,7 @@ function PublishView(props: PublishViewProps) {sx={{m: 0,bg: selfDestruct ? "accent" : "icon-secondary",- flexShrink: 0,- scale: 0.75+ flexShrink: 0}}checked={selfDestruct}onClick={(e) => e.stopPropagation()}diff --git a/apps/web/src/dialogs/attach-files-dialog.tsx b/apps/web/src/dialogs/attach-files-dialog.tsxindex dd306883d..0cc1b2c72 100644--- a/apps/web/src/dialogs/attach-files-dialog.tsx+++ b/apps/web/src/dialogs/attach-files-dialog.tsx@@ -17,10 +17,9 @@ You should have received a copy of the GNU General Public Licensealong with this program. If not, see <http://www.gnu.org/licenses/>.*/-import { useEffect, useMemo, useRef, useState } from "react";+import { useCallback, useEffect, useMemo, useState } from "react";import Dialog from "../components/dialog";-import { ScrollContainer } from "@notesnook/ui";-import { Box, Flex, Image, Switch, Text } from "@theme-ui/components";+import { Flex, Image, Switch, Text } from "@theme-ui/components";import { formatBytes } from "@notesnook/common";import { BaseDialogProps, DialogManager } from "../common/dialog-manager";import { strings } from "@notesnook/intl";@@ -32,10 +31,11 @@ import { ImageCompressionOptions } from "../stores/setting-store";import { Attachment } from "@notesnook/editor";import {CheckCircle,- Loading,File as FileIcon,CloseCircle} from "../components/icons";+import { compressImage } from "../utils/image-compressor";+import Queue from "p-queue";type FileStatus = "pending" | "compressing" | "encrypting" | "done" | "error";@@ -45,6 +45,7 @@ type FileState = {progress: number;error?: string;compress: boolean;+ compressedFile?: File;};type AttachFilesDialogProps = BaseDialogProps<false> & {@@ -66,40 +67,46 @@ export const AttachFilesDialog = DialogManager.register(ImageCompressionOptions.ASK_EVERY_TIME);const [fileStates, setFileStates] = useState<FileState[]>(() =>- files.map((file) => ({- file,- status: "pending",- progress: 0,- compress: file.type.startsWith("image/")- ? imageCompressionConfig !== ImageCompressionOptions.DISABLE- : false- }))+ files+ .sort((a, b) => {+ const aIsImage = a.type.startsWith("image/");+ const bIsImage = b.type.startsWith("image/");+ if (aIsImage && !bIsImage) return -1;+ if (!aIsImage && bIsImage) return 1;+ return a.type.localeCompare(b.type);+ })+ .map((file) => ({+ file,+ status: "pending",+ progress: 0,+ compress: file.type.startsWith("image/")+ ? imageCompressionConfig !== ImageCompressionOptions.DISABLE+ : false+ })));- const [showCompressionPrompt, setShowCompressionPrompt] = useState(+ const isCompressionOptional =hasImages &&- imageCompressionConfig === ImageCompressionOptions.ASK_EVERY_TIME+ imageCompressionConfig === ImageCompressionOptions.ASK_EVERY_TIME;+ const isProcessing = fileStates.some(+ (f) => f.status === "compressing" || f.status === "encrypting"+ );+ const isDone = fileStates.every(+ (f) => f.status === "done" || f.status === "error");- const processingRef = useRef(false);useEffect(() => {const event = AppEventManager.subscribe(AppEvents.UPDATE_ATTACHMENT_PROGRESS,- ({ type, total, loaded }: AttachmentProgress) => {+ ({ type, total, loaded, file }: AttachmentProgress) => {if (type !== "encrypt") return;- setFileStates((prev) =>- prev.map((s) => {- /**- * only one file is encrypted at a time, so we can just update progress of the state with "encrypting" status- */- if (s.status !== "encrypting") return s;-- return {- ...s,- progress: Math.round((loaded / total) * 100)- };- })- );+ setFileStates((prev) => {+ const index = prev.findIndex((s) => s.file === file);+ if (index === -1) return prev;+ return updateFileStates(prev, index, {+ progress: Math.round((loaded / total) * 100)+ });+ });});return () => {@@ -107,133 +114,166 @@ export const AttachFilesDialog = DialogManager.register(};}, []);- useEffect(() => {- if (showCompressionPrompt || processingRef.current) return;+ const compressFiles = useCallback(async () => {+ setFileStates((prev) =>+ prev.map((s) => ({+ ...s,+ status: s.compressedFile || !s.compress ? s.status : "compressing"+ }))+ );++ const queue = new Queue({ concurrency: 8 });- processingRef.current = true;+ for (const [index, state] of fileStates.entries()) {+ if (state.compressedFile || !state.compress) continue;- const shouldCompress: boolean[] = fileStates.map((s) => !!s.compress);+ await queue.add(async () => {+ try {+ const compressed = await compressImage(state.file, {+ maxWidth: (naturalWidth) => Math.min(1920, naturalWidth * 0.7),+ width: (naturalWidth) => naturalWidth,+ height: (_, naturalHeight) => naturalHeight,+ resize: "contain",+ quality: 0.7+ });+ const compressedFile = new File([compressed], state.file.name, {+ lastModified: state.file.lastModified,+ type: state.file.type+ });+ setFileStates((prev) =>+ updateFileStates(prev, index, {+ status: "pending",+ compressedFile+ })+ );+ } catch (e) {+ const error = (e as Error).message || strings.compressionFailed();+ setFileStates((prev) =>+ updateFileStates(prev, index, { status: "error", error })+ );+ }+ });+ }- (async () => {- const attachments: Attachment[] = [];- let hasError = false;+ await queue.onIdle();+ }, [fileStates]);- for await (const message of attachFiles(- files,- shouldCompress,- skipSpecialImageHandling- )) {- const { index } = message;+ const processFiles = useCallback(async () => {+ const attachments: Attachment[] = [];+ const validIndices = fileStates+ .map((s, i) => (s.status === "error" ? -1 : i))+ .filter((i) => i !== -1);+ const filesToAttach = validIndices.map((i) => {+ const state = fileStates[i];+ return state.compress && state.compressedFile+ ? state.compressedFile+ : state.file;+ });++ await attachFiles(+ filesToAttach,+ (message) => {+ const index = validIndices[message.index];switch (message.type) {- case "compressing":- setFileStates((prev) =>- prev.map((s, i) =>- i === index- ? { ...s, status: "compressing" as FileStatus }- : s- )- );- break;case "encrypting":setFileStates((prev) =>- prev.map((s, i) =>- i === index- ? { ...s, status: "encrypting" as FileStatus, progress: 0 }- : s- )+ updateFileStates(prev, index, {+ status: "encrypting",+ progress: 0+ }));break;case "done":if (message.attachment) attachments.push(message.attachment);setFileStates((prev) =>- prev.map((s, i) =>- i === index- ? {- ...s,- status: "done" as FileStatus- }- : s- )+ updateFileStates(prev, index, { status: "done" }));break;case "error":- hasError = true;setFileStates((prev) =>- prev.map((s, i) =>- i === index- ? {- ...s,- status: "error" as FileStatus,- error: message.error- }- : s- )+ updateFileStates(prev, index, {+ status: "error",+ error: message.error+ }));break;}- }+ },+ skipSpecialImageHandling+ );++ onDone(attachments);- onDone(attachments);- if (files.length === 1 && !hasError) onClose(false);- })();- }, [showCompressionPrompt]);+ const hasError = fileStates.some((s) => s.status === "error");+ if (fileStates.length === 1 && !hasError) onClose(false);+ }, [fileStates, onClose, onDone, skipSpecialImageHandling]);return (<DialogisOpen={true}- title={- showCompressionPrompt- ? strings.imageCompression()- : strings.attachingFiles()- }- description={- showCompressionPrompt ? strings.imageCompressionDesc() : ""- }- onClose={() => onClose(false)}+ title={strings.attachingFiles()}+ onOpen={async () => {+ await compressFiles();+ if (!isCompressionOptional) await processFiles();+ }}+ onClose={() => {+ if (isProcessing) return;+ onClose(false);+ }}width={500}positiveButton={- showCompressionPrompt+ isCompressionOptional && !isDone? {- text: strings.done(),- onClick: () => setShowCompressionPrompt(false)+ text: strings.insert(),+ disabled: isProcessing,+ onClick: async () => {+ await processFiles();+ }}: undefined}negativeButton={{text: strings.close(),+ disabled: isProcessing,onClick: () => onClose(false)}}>- <ScrollContainer- style={{- maxHeight: 350,- display: "flex",- flexDirection: "column",- position: "relative"+ <Flex+ sx={{+ alignItems: "center",+ py: 1,+ px: 1,+ gap: 2}}>- {fileStates.map((state, index) => (- <FileRow- key={`${state.file.name}-${index}`}- state={state}- showDivider={fileStates.length > 1}- showCompressionToggle={showCompressionPrompt}- onToggleCompress={async () => {- if (- !(await checkFeature("fullQualityImages", { type: "toast" }))- ) {- return;- }+ <Text variant="body" sx={{ color: "paragraph-secondary", flex: 1 }}>+ {strings.name()}+ </Text>+ <Text variant="body" sx={{ color: "paragraph-secondary" }}>+ {isCompressionOptional && !isProcessing && !isDone+ ? strings.compress()+ : strings.status()}+ </Text>+ </Flex>+ {fileStates.map((state, index) => (+ <FileRow+ key={`${state.file.name}-${index}`}+ state={state}+ showDivider={fileStates.length > 1}+ showCompressionToggle={isCompressionOptional}+ onToggleCompress={async () => {+ if (+ !(await checkFeature("fullQualityImages", { type: "toast" }))+ ) {+ return;+ }- setFileStates((prev) =>- prev.map((s, idx) =>- idx === index ? { ...s, compress: !s.compress } : s- )- );- }}- />- ))}- </ScrollContainer>+ setFileStates((prev) =>+ updateFileStates(prev, index, { compress: !state.compress })+ );+ }}+ />+ ))}</Dialog>);}@@ -250,11 +290,12 @@ function FileRow({showCompressionToggle?: boolean;onToggleCompress?: () => void;}) {- const { file, status, progress, error, compress } = state;+ const { file, status, progress, error, compress, compressedFile } = state;const isImage = file.type.startsWith("image/");+ const activeFile = compress && compressedFile ? compressedFile : file;const thumbnail = useMemo(- () => (isImage ? URL.createObjectURL(file) : undefined),- [file, isImage]+ () => (isImage ? URL.createObjectURL(activeFile) : undefined),+ [activeFile, isImage]);useEffect(() => {@@ -309,28 +350,33 @@ function FileRow({whiteSpace: "nowrap"}}>- {file.name}+ {activeFile.name}</Text><Text variant="subBody" sx={{ color: "paragraph-secondary" }}>- {formatBytes(file.size)}- {status === "compressing"- ? ` — ${strings.compressing()}...`- : status === "encrypting"- ? ` — ${strings.encrypting()} ${progress}%`- : status === "error"- ? ` — ${error}`- : ""}+ {formatBytes(activeFile.size)}+ {status === "error" ? ` — ${error}` : ""}</Text></Flex><Flex sx={{ flexShrink: 0, alignItems: "center" }}>- {showCompressionToggle && isImage ? (+ {status === "error" ? (+ <CloseCircle size={20} color="accent-error" />+ ) : status === "done" ? (+ <CheckCircle size={20} color="accent" />+ ) : status === "encrypting" || status === "compressing" ? (+ <Text variant="subBody" sx={{ color: "paragraph-secondary" }}>+ {status === "compressing"+ ? `${strings.compressing()}`+ : status === "encrypting"+ ? `${strings.encrypting()} ${progress}%`+ : ""}+ </Text>+ ) : showCompressionToggle && isImage ? (<Switchsx={{m: 0,bg: compress ? "accent" : "icon-secondary",- flexShrink: 0,- scale: 0.75+ flexShrink: 0}}checked={compress}onChange={onToggleCompress}@@ -339,35 +385,18 @@ function FileRow({<Text variant="subBody" sx={{ color: "paragraph-secondary" }}>N/A</Text>- ) : status === "done" ? (- <CheckCircle size={20} color="accent" />- ) : status === "error" ? (- <CloseCircle size={20} color="accent-error" />- ) : status === "encrypting" || status === "compressing" ? (- <Flex sx={{ alignItems: "center", gap: 1 }}>- <Box- sx={{- width: 60,- height: 4,- bg: "border",- borderRadius: "full",- overflow: "hidden"- }}- >- <Box- sx={{- width: `${status === "compressing" ? 50 : progress}%`,- height: "100%",- bg: "accent",- transition: "width 0.2s ease"- }}- />- </Box>- </Flex>- ) : (- <Loading size={16} color="icon" />- )}+ ) : null}</Flex></Flex>);}++function updateFileStates(+ prev: FileState[],+ index: number,+ update: Partial<FileState>+) {+ const clone = prev.slice();+ clone[index] = { ...clone[index], ...update };+ return clone;+}diff --git a/apps/web/src/interfaces/fs.ts b/apps/web/src/interfaces/fs.tsindex 7049b0a1f..28005d89c 100644--- a/apps/web/src/interfaces/fs.ts+++ b/apps/web/src/interfaces/fs.ts@@ -103,7 +103,7 @@ export async function writeEncryptedFile(total: file.size,loaded: done ? file.size : totalRead},- { type: "encrypt", hash }+ { type: "encrypt", hash, file })))@@ -470,11 +470,12 @@ export async function checkUpload(function reportProgress(ev: { total?: number; loaded?: number } | undefined,- { type, hash }: { type: string; hash: string }+ { type, hash, file }: { type: string; hash: string; file?: File }) {AppEventManager.publish(AppEvents.UPDATE_ATTACHMENT_PROGRESS, {type,hash,+ file,total: ev?.total || 1,loaded: ev?.loaded || 1});diff --git a/apps/web/src/utils/image-compressor.ts b/apps/web/src/utils/image-compressor.tsindex c01164799..2db494356 100644--- a/apps/web/src/utils/image-compressor.ts+++ b/apps/web/src/utils/image-compressor.ts@@ -17,18 +17,6 @@ You should have received a copy of the GNU General Public Licensealong with this program. If not, see <http://www.gnu.org/licenses/>.*/-export class FileWithURI extends File {- uri: string;- constructor(- fileBits: BlobPart[],- fileName: string,- options?: FilePropertyBag- ) {- super(fileBits, fileName, options);- this.uri = URL.createObjectURL(this);- }-}-type DeriveDimension = (naturalWidth: number, naturalHeight: number) => number;interface CompressorOptions {@@ -84,7 +72,7 @@ export function compressImage(file: File, options: Partial<CompressorOptions>) {naturalHeight: image.naturalHeight,naturalWidth: image.naturalWidth});- resolve(compressed);+ resolve(compressed.size > file.size ? file : compressed);URL.revokeObjectURL(image.src);};image.onabort = () => {diff --git a/apps/web/src/utils/web-extension-server.ts b/apps/web/src/utils/web-extension-server.tsindex 3ef523d86..71c474b9a 100644--- a/apps/web/src/utils/web-extension-server.ts+++ b/apps/web/src/utils/web-extension-server.ts@@ -89,7 +89,7 @@ export class WebExtensionServer implements Server {);let attachment;- for await (const message of attachFiles([clippedFile], [false])) {+ for await (const message of attachFiles([clippedFile])) {if (message.type === "done") attachment = message.attachment;else if (message.type === "error") return;}diff --git a/packages/editor/src/extensions/attachment/attachment.ts b/packages/editor/src/extensions/attachment/attachment.tsindex 6749c813d..bf77dcb3d 100644--- a/packages/editor/src/extensions/attachment/attachment.ts+++ b/packages/editor/src/extensions/attachment/attachment.ts@@ -25,6 +25,8 @@ import { Attachment } from "./types.js";import { tiptapKeys } from "@notesnook/common";import { hasPermission } from "../../types.js";import { AudioNode } from "../audio/audio.js";+import { ImageNode } from "../image/image.js";+import { WebClipNode } from "../web-clip/web-clip.js";export type AttachmentType = "image" | "file" | "camera";export interface AttachmentOptions {@@ -35,7 +37,7 @@ export interface AttachmentOptions {declare module "@tiptap/core" {interface Commands<ReturnType> {attachment: {- insertAttachment: (attachment: Attachment) => ReturnType;+ insertAttachment: (...attachment: Attachment[]) => ReturnType;removeAttachment: () => ReturnType;updateAttachment: (attachment: Partial<Attachment>,@@ -110,27 +112,41 @@ export const AttachmentNode = Node.create<AttachmentOptions>({addCommands() {return {insertAttachment:- (attachment) =>+ (...attachments) =>({ commands, state }) => {- if (!hasPermission("insertAttachment")) {+ if (!hasPermission("insertAttachment") || attachments.length === 0) {return false;}const { $from } = state.selection;- const maybeAttachmentNode = state.doc.nodeAt($from.pos);- if (maybeAttachmentNode?.type === this.type) {+ const selectedNode = state.doc.nodeAt($from.pos);+ if (+ selectedNode &&+ [+ ImageNode.name,+ WebClipNode.name,+ AudioNode.name,+ this.name+ ].includes(selectedNode.type.name)+ ) {+ console.log(+ "Inserting attachment after the selected node",+ selectedNode+ );return commands.insertContentAt(- $from.pos + maybeAttachmentNode.nodeSize,- {- type: mimeToExtension(attachment.mime),- attrs: attachment- }+ $from.pos + selectedNode.nodeSize,+ attachments.map((a) => ({+ type: mimeToExtension(a.mime),+ attrs: a+ })));}- return commands.insertContent({- type: mimeToExtension(attachment.mime),- attrs: attachment- });+ return commands.insertContent(+ attachments.map((a) => ({+ type: mimeToExtension(a.mime),+ attrs: a+ }))+ );},removeAttachment:() =>@@ -189,7 +205,8 @@ export const AttachmentNode = Node.create<AttachmentOptions>({});function mimeToExtension(mime: string): string {- if (mime.startsWith("audio/")) return AudioNode.name;+ if (mime.startsWith("image/")) return ImageNode.name;+ else if (mime.startsWith("audio/")) return AudioNode.name;return AttachmentNode.name;}diff --git a/packages/editor/src/extensions/image/image.ts b/packages/editor/src/extensions/image/image.tsindex cf53ffad1..10e6d0a07 100644--- a/packages/editor/src/extensions/image/image.ts+++ b/packages/editor/src/extensions/image/image.ts@@ -31,7 +31,6 @@ import { createNodeView } from "../react/index.js";import { TextDirections } from "../text-direction/index.js";import { ImageComponent } from "./component.js";import { tiptapKeys } from "@notesnook/common";-import { hasPermission } from "../../types.js";import { toBlob } from "../../utils/downloader.js";export interface ImageOptions {@@ -55,7 +54,7 @@ declare module "@tiptap/core" {/*** Add an image*/- insertImage: (options: Partial<ImageAttributes>) => ReturnType;+ insertImage: (...options: Partial<ImageAttributes>[]) => ReturnType;setImageAlignment: (options: ImageAlignmentOptions) => ReturnType;setImageSize: (size: ImageSize) => ReturnType;};@@ -161,25 +160,9 @@ export const ImageNode = Node.create<ImageOptions>({addCommands() {return {insertImage:- (options) =>- ({ commands, state }) => {- if (!hasPermission("insertAttachment")) {- return false;- }-- const { $from } = state.selection;- const maybeImageNode = state.doc.nodeAt($from.pos);- if (maybeImageNode?.type === this.type) {- return commands.insertContentAt($from.pos + 1, {- type: this.name,- attrs: options- });- }-- return commands.insertContent({- type: this.name,- attrs: options- });+ (...images) =>+ ({ commands }) => {+ return commands.insertAttachment(...(images as ImageAttachment[]));},setImageAlignment:(options) =>diff --git a/packages/theme/src/theme/variants/input.ts b/packages/theme/src/theme/variants/input.tsindex 743c8cb28..845b2108e 100644--- a/packages/theme/src/theme/variants/input.ts+++ b/packages/theme/src/theme/variants/input.ts@@ -95,6 +95,18 @@ const radio: ThemeUIStyleObject = {};export const inputVariants = {+ switch: {+ width: 34,+ height: 18,+ "& > div": {+ width: 14,+ height: 14+ },+ p: "2px !important",+ "input:checked ~ & > div": {+ transform: "translateX(115%)"+ }+ },input: defaultVariant,borderless,error,