diff --git a/package.json b/package.json index 1812f5a..5a149bb 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "@rollup/plugin-inject": "^5.0.5", "chai": "^5.1.1", "concurrently": "^8.2.2", + "cssnano": "^7.0.4", "dotenv": "^16.4.5", "eslint-config-airbnb-base": "^14.2.1", "eslint-plugin-import": "^2.29.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1411f4c..a9f31c8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -69,6 +69,9 @@ importers: concurrently: specifier: ^8.2.2 version: 8.2.2 + cssnano: + specifier: ^7.0.4 + version: 7.0.4(postcss@8.4.39) dotenv: specifier: ^16.4.5 version: 16.4.5 @@ -1019,6 +1022,10 @@ packages: cpu: [x64] os: [win32] + '@trysound/sax@0.2.0': + resolution: {integrity: sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==} + engines: {node: '>=10.13.0'} + '@types/estree@1.0.5': resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} @@ -1200,6 +1207,9 @@ packages: resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} engines: {node: '>=8'} + boolbase@1.0.0: + resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} + bootstrap@5.3.3: resolution: {integrity: sha512-8HLCdWgyoMguSO9o+aH+iuZ+aht+mzW0u3HIMzVu7Srrpv7EBBxTnrFlSCskwdY1+EOFQSm7uMJhNQHkdPcmjg==} peerDependencies: @@ -1241,6 +1251,9 @@ packages: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} + caniuse-api@3.0.0: + resolution: {integrity: sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==} + caniuse-lite@1.0.30001640: resolution: {integrity: sha512-lA4VMpW0PSUrFnkmVuEKBUovSWKhj7puyCg8StBChgu298N1AtuF1sKWEvfDuimSEDbhlb/KqPKC3fs1HbuQUA==} @@ -1295,6 +1308,9 @@ packages: resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} hasBin: true + colord@2.9.3: + resolution: {integrity: sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==} + colorette@1.4.0: resolution: {integrity: sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==} @@ -1305,6 +1321,10 @@ packages: commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} + commander@7.2.0: + resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==} + engines: {node: '>= 10'} + concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} @@ -1336,6 +1356,54 @@ packages: crypto-js@4.2.0: resolution: {integrity: sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==} + css-declaration-sorter@7.2.0: + resolution: {integrity: sha512-h70rUM+3PNFuaBDTLe8wF/cdWu+dOZmb7pJt8Z2sedYbAcQVQV/tEchueg3GWxwqS0cxtbxmaHEdkNACqcvsow==} + engines: {node: ^14 || ^16 || >=18} + peerDependencies: + postcss: ^8.0.9 + + css-select@5.1.0: + resolution: {integrity: sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==} + + css-tree@2.2.1: + resolution: {integrity: sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==} + engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0, npm: '>=7.0.0'} + + css-tree@2.3.1: + resolution: {integrity: sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==} + engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0} + + css-what@6.1.0: + resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==} + engines: {node: '>= 6'} + + cssesc@3.0.0: + resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} + engines: {node: '>=4'} + hasBin: true + + cssnano-preset-default@7.0.4: + resolution: {integrity: sha512-jQ6zY9GAomQX7/YNLibMEsRZguqMUGuupXcEk2zZ+p3GUxwCAsobqPYE62VrJ9qZ0l9ltrv2rgjwZPBIFIjYtw==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + cssnano-utils@5.0.0: + resolution: {integrity: sha512-Uij0Xdxc24L6SirFr25MlwC2rCFX6scyUmuKpzI+JQ7cyqDEwD42fJ0xfB3yLfOnRDU5LKGgjQ9FA6LYh76GWQ==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + cssnano@7.0.4: + resolution: {integrity: sha512-rQgpZra72iFjiheNreXn77q1haS2GEy69zCMbu4cpXCFPMQF+D4Ik5V7ktMzUF/sA7xCIgcqHwGPnCD+0a1vHg==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + csso@5.0.5: + resolution: {integrity: sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==} + engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0, npm: '>=7.0.0'} + data-view-buffer@1.0.1: resolution: {integrity: sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==} engines: {node: '>= 0.4'} @@ -1413,9 +1481,22 @@ packages: resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} engines: {node: '>=6.0.0'} + dom-serializer@2.0.0: + resolution: {integrity: sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==} + + domelementtype@2.3.0: + resolution: {integrity: sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==} + + domhandler@5.0.3: + resolution: {integrity: sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==} + engines: {node: '>= 4'} + dompurify@3.1.6: resolution: {integrity: sha512-cTOAhc36AalkjtBpfG6O8JimdTMWNXjiePT2xQH/ppBGi/4uIpmj8eKyIkMJErXWARyINV/sB38yf8JCLF5pbQ==} + domutils@3.1.0: + resolution: {integrity: sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==} + dotenv@16.4.5: resolution: {integrity: sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==} engines: {node: '>=12'} @@ -1436,6 +1517,10 @@ packages: resolution: {integrity: sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==} engines: {node: '>=8.6'} + entities@4.5.0: + resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} + engines: {node: '>=0.12'} + error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} @@ -2039,6 +2124,10 @@ packages: resolution: {integrity: sha512-V0RMVZzK1+rCHpymRv4URK2lNhIRyO8g7U7zOFwVAhJuat74HtkjIQpQRKNCwFEYkRGpafOpmXXLoaoBcyVtBg==} engines: {node: '>= 12.0.0'} + lilconfig@3.1.2: + resolution: {integrity: sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==} + engines: {node: '>=14'} + load-json-file@4.0.0: resolution: {integrity: sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==} engines: {node: '>=4'} @@ -2050,12 +2139,18 @@ packages: lodash.debounce@4.0.8: resolution: {integrity: sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==} + lodash.memoize@4.1.2: + resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} + lodash.merge@4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} lodash.truncate@4.4.2: resolution: {integrity: sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==} + lodash.uniq@4.5.0: + resolution: {integrity: sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==} + lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} @@ -2079,6 +2174,12 @@ packages: md5@2.3.0: resolution: {integrity: sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==} + mdn-data@2.0.28: + resolution: {integrity: sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==} + + mdn-data@2.0.30: + resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==} + memorystream@0.3.1: resolution: {integrity: sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==} engines: {node: '>= 0.10.0'} @@ -2163,6 +2264,9 @@ packages: engines: {node: '>= 4'} hasBin: true + nth-check@2.1.1: + resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} + nuxeo@4.0.3: resolution: {integrity: sha512-OesY0uH0dx1u/0/GfFSgioQvOUxuvC+tWx7gAPrx45x/tf4zQmln5DNIDw4U8QHNxF4IdHrUK6aFrinm+NtaCg==} engines: {node: '>= 14'} @@ -2284,6 +2388,175 @@ packages: resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==} engines: {node: '>= 0.4'} + postcss-calc@10.0.0: + resolution: {integrity: sha512-OmjhudoNTP0QleZCwl1i6NeBwN+5MZbY5ersLZz69mjJiDVv/p57RjRuKDkHeDWr4T+S97wQfsqRTNoDHB2e3g==} + engines: {node: ^18.12 || ^20.9 || >=22.0} + peerDependencies: + postcss: ^8.4.38 + + postcss-colormin@7.0.1: + resolution: {integrity: sha512-uszdT0dULt3FQs47G5UHCduYK+FnkLYlpu1HpWu061eGsKZ7setoG7kA+WC9NQLsOJf69D5TxGHgnAdRgylnFQ==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-convert-values@7.0.2: + resolution: {integrity: sha512-MuZIF6HJ4izko07Q0TgW6pClalI4al6wHRNPkFzqQdwAwG7hPn0lA58VZdxyb2Vl5AYjJ1piO+jgF9EnTjQwQQ==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-discard-comments@7.0.1: + resolution: {integrity: sha512-GVrQxUOhmle1W6jX2SvNLt4kmN+JYhV7mzI6BMnkAWR9DtVvg8e67rrV0NfdWhn7x1zxvzdWkMBPdBDCls+uwQ==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-discard-duplicates@7.0.0: + resolution: {integrity: sha512-bAnSuBop5LpAIUmmOSsuvtKAAKREB6BBIYStWUTGq8oG5q9fClDMMuY8i4UPI/cEcDx2TN+7PMnXYIId20UVDw==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-discard-empty@7.0.0: + resolution: {integrity: sha512-e+QzoReTZ8IAwhnSdp/++7gBZ/F+nBq9y6PomfwORfP7q9nBpK5AMP64kOt0bA+lShBFbBDcgpJ3X4etHg4lzA==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-discard-overridden@7.0.0: + resolution: {integrity: sha512-GmNAzx88u3k2+sBTZrJSDauR0ccpE24omTQCVmaTTZFz1du6AasspjaUPMJ2ud4RslZpoFKyf+6MSPETLojc6w==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-merge-longhand@7.0.2: + resolution: {integrity: sha512-06vrW6ZWi9qeP7KMS9fsa9QW56+tIMW55KYqF7X3Ccn+NI2pIgPV6gFfvXTMQ05H90Y5DvnCDPZ2IuHa30PMUg==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-merge-rules@7.0.2: + resolution: {integrity: sha512-VAR47UNvRsdrTHLe7TV1CeEtF9SJYR5ukIB9U4GZyZOptgtsS20xSxy+k5wMrI3udST6O1XuIn7cjQkg7sDAAw==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-minify-font-values@7.0.0: + resolution: {integrity: sha512-2ckkZtgT0zG8SMc5aoNwtm5234eUx1GGFJKf2b1bSp8UflqaeFzR50lid4PfqVI9NtGqJ2J4Y7fwvnP/u1cQog==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-minify-gradients@7.0.0: + resolution: {integrity: sha512-pdUIIdj/C93ryCHew0UgBnL2DtUS3hfFa5XtERrs4x+hmpMYGhbzo6l/Ir5de41O0GaKVpK1ZbDNXSY6GkXvtg==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-minify-params@7.0.1: + resolution: {integrity: sha512-e+Xt8xErSRPgSRFxHeBCSxMiO8B8xng7lh8E0A5ep1VfwYhY8FXhu4Q3APMjgx9YDDbSp53IBGENrzygbUvgUQ==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-minify-selectors@7.0.2: + resolution: {integrity: sha512-dCzm04wqW1uqLmDZ41XYNBJfjgps3ZugDpogAmJXoCb5oCiTzIX4oPXXKxDpTvWOnKxQKR4EbV4ZawJBLcdXXA==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-normalize-charset@7.0.0: + resolution: {integrity: sha512-ABisNUXMeZeDNzCQxPxBCkXexvBrUHV+p7/BXOY+ulxkcjUZO0cp8ekGBwvIh2LbCwnWbyMPNJVtBSdyhM2zYQ==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-normalize-display-values@7.0.0: + resolution: {integrity: sha512-lnFZzNPeDf5uGMPYgGOw7v0BfB45+irSRz9gHQStdkkhiM0gTfvWkWB5BMxpn0OqgOQuZG/mRlZyJxp0EImr2Q==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-normalize-positions@7.0.0: + resolution: {integrity: sha512-I0yt8wX529UKIGs2y/9Ybs2CelSvItfmvg/DBIjTnoUSrPxSV7Z0yZ8ShSVtKNaV/wAY+m7bgtyVQLhB00A1NQ==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-normalize-repeat-style@7.0.0: + resolution: {integrity: sha512-o3uSGYH+2q30ieM3ppu9GTjSXIzOrRdCUn8UOMGNw7Af61bmurHTWI87hRybrP6xDHvOe5WlAj3XzN6vEO8jLw==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-normalize-string@7.0.0: + resolution: {integrity: sha512-w/qzL212DFVOpMy3UGyxrND+Kb0fvCiBBujiaONIihq7VvtC7bswjWgKQU/w4VcRyDD8gpfqUiBQ4DUOwEJ6Qg==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-normalize-timing-functions@7.0.0: + resolution: {integrity: sha512-tNgw3YV0LYoRwg43N3lTe3AEWZ66W7Dh7lVEpJbHoKOuHc1sLrzMLMFjP8SNULHaykzsonUEDbKedv8C+7ej6g==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-normalize-unicode@7.0.1: + resolution: {integrity: sha512-PTPGdY9xAkTw+8ZZ71DUePb7M/Vtgkbbq+EoI33EuyQEzbKemEQMhe5QSr0VP5UfZlreANDPxSfcdSprENcbsg==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-normalize-url@7.0.0: + resolution: {integrity: sha512-+d7+PpE+jyPX1hDQZYG+NaFD+Nd2ris6r8fPTBAjE8z/U41n/bib3vze8x7rKs5H1uEw5ppe9IojewouHk0klQ==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-normalize-whitespace@7.0.0: + resolution: {integrity: sha512-37/toN4wwZErqohedXYqWgvcHUGlT8O/m2jVkAfAe9Bd4MzRqlBmXrJRePH0e9Wgnz2X7KymTgTOaaFizQe3AQ==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-ordered-values@7.0.1: + resolution: {integrity: sha512-irWScWRL6nRzYmBOXReIKch75RRhNS86UPUAxXdmW/l0FcAsg0lvAXQCby/1lymxn/o0gVa6Rv/0f03eJOwHxw==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-reduce-initial@7.0.1: + resolution: {integrity: sha512-0JDUSV4bGB5FGM5g8MkS+rvqKukJZ7OTHw/lcKn7xPNqeaqJyQbUO8/dJpvyTpaVwPsd3Uc33+CfNzdVowp2WA==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-reduce-transforms@7.0.0: + resolution: {integrity: sha512-pnt1HKKZ07/idH8cpATX/ujMbtOGhUfE+m8gbqwJE05aTaNw8gbo34a2e3if0xc0dlu75sUOiqvwCGY3fzOHew==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-selector-parser@6.1.0: + resolution: {integrity: sha512-UMz42UD0UY0EApS0ZL9o1XnLhSTtvvvLe5Dc2H2O56fvRZi+KulDyf5ctDhhtYJBGKStV2FL1fy6253cmLgqVQ==} + engines: {node: '>=4'} + + postcss-svgo@7.0.1: + resolution: {integrity: sha512-0WBUlSL4lhD9rA5k1e5D8EN5wCEyZD6HJk0jIvRxl+FDVOMlJ7DePHYWGGVc5QRqrJ3/06FTXM0bxjmJpmTPSA==} + engines: {node: ^18.12.0 || ^20.9.0 || >= 18} + peerDependencies: + postcss: ^8.4.31 + + postcss-unique-selectors@7.0.1: + resolution: {integrity: sha512-MH7QE/eKUftTB5ta40xcHLl7hkZjgDFydpfTK+QWXeHxghVt3VoPqYL5/G+zYZPPIs+8GuqFXSTgxBSoB1RZtQ==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-value-parser@4.2.0: + resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} + postcss@8.4.39: resolution: {integrity: sha512-0vzE+lAiG7hZl1/9I8yzKLx3aR9Xbof3fBHKunvMfOCYAtMhrsnccJY2iTURb9EZd5+pLuiNV9/c/GZJOHsgIw==} engines: {node: ^10 || ^12 || >=14} @@ -2546,6 +2819,12 @@ packages: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} + stylehacks@7.0.2: + resolution: {integrity: sha512-HdkWZS9b4gbgYTdMg4gJLmm7biAUug1qTqXjS+u8X+/pUd+9Px1E+520GnOW3rST9MNsVOVpsJG+mPHNosxjOQ==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + supports-color@2.0.0: resolution: {integrity: sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==} engines: {node: '>=0.8.0'} @@ -2566,6 +2845,11 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} + svgo@3.3.2: + resolution: {integrity: sha512-OoohrmuUlBs8B8o6MB2Aevn+pRIH9zDALSR+6hhqVfa6fRwG/Qw9VUMSMW9VNg2CFc/MTIfabtdOVl9ODIJjpw==} + engines: {node: '>=14.0.0'} + hasBin: true + sweetalert2@11.12.2: resolution: {integrity: sha512-Rwv5iRYlApkDSXeX22aLhhWMlWPzFxnNBVLZajkFKYhaVEfQkMOPQQRhBtSFxKBPCoko9U3SccWm9hI4o3Id0Q==} @@ -2674,6 +2958,9 @@ packages: uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + util-deprecate@1.0.2: + resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + v8-compile-cache@2.4.0: resolution: {integrity: sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw==} @@ -3804,6 +4091,8 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.18.1': optional: true + '@trysound/sax@0.2.0': {} + '@types/estree@1.0.5': {} '@types/fs-extra@8.1.5': @@ -3991,6 +4280,8 @@ snapshots: binary-extensions@2.3.0: {} + boolbase@1.0.0: {} + bootstrap@5.3.3(@popperjs/core@2.11.8): dependencies: '@popperjs/core': 2.11.8 @@ -4036,6 +4327,13 @@ snapshots: camelcase@6.3.0: {} + caniuse-api@3.0.0: + dependencies: + browserslist: 4.23.1 + caniuse-lite: 1.0.30001640 + lodash.memoize: 4.1.2 + lodash.uniq: 4.5.0 + caniuse-lite@1.0.30001640: {} chai@5.1.1: @@ -4107,6 +4405,8 @@ snapshots: color-support@1.1.3: {} + colord@2.9.3: {} + colorette@1.4.0: {} combined-stream@1.0.8: @@ -4115,6 +4415,8 @@ snapshots: commander@2.20.3: {} + commander@7.2.0: {} + concat-map@0.0.1: {} concurrently@8.2.2: @@ -4155,6 +4457,80 @@ snapshots: crypto-js@4.2.0: {} + css-declaration-sorter@7.2.0(postcss@8.4.39): + dependencies: + postcss: 8.4.39 + + css-select@5.1.0: + dependencies: + boolbase: 1.0.0 + css-what: 6.1.0 + domhandler: 5.0.3 + domutils: 3.1.0 + nth-check: 2.1.1 + + css-tree@2.2.1: + dependencies: + mdn-data: 2.0.28 + source-map-js: 1.2.0 + + css-tree@2.3.1: + dependencies: + mdn-data: 2.0.30 + source-map-js: 1.2.0 + + css-what@6.1.0: {} + + cssesc@3.0.0: {} + + cssnano-preset-default@7.0.4(postcss@8.4.39): + dependencies: + browserslist: 4.23.1 + css-declaration-sorter: 7.2.0(postcss@8.4.39) + cssnano-utils: 5.0.0(postcss@8.4.39) + postcss: 8.4.39 + postcss-calc: 10.0.0(postcss@8.4.39) + postcss-colormin: 7.0.1(postcss@8.4.39) + postcss-convert-values: 7.0.2(postcss@8.4.39) + postcss-discard-comments: 7.0.1(postcss@8.4.39) + postcss-discard-duplicates: 7.0.0(postcss@8.4.39) + postcss-discard-empty: 7.0.0(postcss@8.4.39) + postcss-discard-overridden: 7.0.0(postcss@8.4.39) + postcss-merge-longhand: 7.0.2(postcss@8.4.39) + postcss-merge-rules: 7.0.2(postcss@8.4.39) + postcss-minify-font-values: 7.0.0(postcss@8.4.39) + postcss-minify-gradients: 7.0.0(postcss@8.4.39) + postcss-minify-params: 7.0.1(postcss@8.4.39) + postcss-minify-selectors: 7.0.2(postcss@8.4.39) + postcss-normalize-charset: 7.0.0(postcss@8.4.39) + postcss-normalize-display-values: 7.0.0(postcss@8.4.39) + postcss-normalize-positions: 7.0.0(postcss@8.4.39) + postcss-normalize-repeat-style: 7.0.0(postcss@8.4.39) + postcss-normalize-string: 7.0.0(postcss@8.4.39) + postcss-normalize-timing-functions: 7.0.0(postcss@8.4.39) + postcss-normalize-unicode: 7.0.1(postcss@8.4.39) + postcss-normalize-url: 7.0.0(postcss@8.4.39) + postcss-normalize-whitespace: 7.0.0(postcss@8.4.39) + postcss-ordered-values: 7.0.1(postcss@8.4.39) + postcss-reduce-initial: 7.0.1(postcss@8.4.39) + postcss-reduce-transforms: 7.0.0(postcss@8.4.39) + postcss-svgo: 7.0.1(postcss@8.4.39) + postcss-unique-selectors: 7.0.1(postcss@8.4.39) + + cssnano-utils@5.0.0(postcss@8.4.39): + dependencies: + postcss: 8.4.39 + + cssnano@7.0.4(postcss@8.4.39): + dependencies: + cssnano-preset-default: 7.0.4(postcss@8.4.39) + lilconfig: 3.1.2 + postcss: 8.4.39 + + csso@5.0.5: + dependencies: + css-tree: 2.2.1 + data-view-buffer@1.0.1: dependencies: call-bind: 1.0.7 @@ -4223,8 +4599,26 @@ snapshots: dependencies: esutils: 2.0.3 + dom-serializer@2.0.0: + dependencies: + domelementtype: 2.3.0 + domhandler: 5.0.3 + entities: 4.5.0 + + domelementtype@2.3.0: {} + + domhandler@5.0.3: + dependencies: + domelementtype: 2.3.0 + dompurify@3.1.6: {} + domutils@3.1.0: + dependencies: + dom-serializer: 2.0.0 + domelementtype: 2.3.0 + domhandler: 5.0.3 + dotenv@16.4.5: {} eastasianwidth@0.2.0: {} @@ -4240,6 +4634,8 @@ snapshots: ansi-colors: 4.1.3 strip-ansi: 6.0.1 + entities@4.5.0: {} + error-ex@1.3.2: dependencies: is-arrayish: 0.2.1 @@ -4910,6 +5306,8 @@ snapshots: lightningcss-linux-x64-musl: 1.25.1 lightningcss-win32-x64-msvc: 1.25.1 + lilconfig@3.1.2: {} + load-json-file@4.0.0: dependencies: graceful-fs: 4.2.11 @@ -4923,10 +5321,14 @@ snapshots: lodash.debounce@4.0.8: {} + lodash.memoize@4.1.2: {} + lodash.merge@4.6.2: {} lodash.truncate@4.4.2: {} + lodash.uniq@4.5.0: {} + lodash@4.17.21: {} log-symbols@4.1.0: @@ -4954,6 +5356,10 @@ snapshots: crypt: 0.0.2 is-buffer: 1.1.6 + mdn-data@2.0.28: {} + + mdn-data@2.0.30: {} + memorystream@0.3.1: {} merge2@1.4.1: {} @@ -5045,6 +5451,10 @@ snapshots: shell-quote: 1.8.1 string.prototype.padend: 3.1.6 + nth-check@2.1.1: + dependencies: + boolbase: 1.0.0 + nuxeo@4.0.3: dependencies: buffer: 6.0.3 @@ -5172,6 +5582,162 @@ snapshots: possible-typed-array-names@1.0.0: {} + postcss-calc@10.0.0(postcss@8.4.39): + dependencies: + postcss: 8.4.39 + postcss-selector-parser: 6.1.0 + postcss-value-parser: 4.2.0 + + postcss-colormin@7.0.1(postcss@8.4.39): + dependencies: + browserslist: 4.23.1 + caniuse-api: 3.0.0 + colord: 2.9.3 + postcss: 8.4.39 + postcss-value-parser: 4.2.0 + + postcss-convert-values@7.0.2(postcss@8.4.39): + dependencies: + browserslist: 4.23.1 + postcss: 8.4.39 + postcss-value-parser: 4.2.0 + + postcss-discard-comments@7.0.1(postcss@8.4.39): + dependencies: + postcss: 8.4.39 + postcss-selector-parser: 6.1.0 + + postcss-discard-duplicates@7.0.0(postcss@8.4.39): + dependencies: + postcss: 8.4.39 + + postcss-discard-empty@7.0.0(postcss@8.4.39): + dependencies: + postcss: 8.4.39 + + postcss-discard-overridden@7.0.0(postcss@8.4.39): + dependencies: + postcss: 8.4.39 + + postcss-merge-longhand@7.0.2(postcss@8.4.39): + dependencies: + postcss: 8.4.39 + postcss-value-parser: 4.2.0 + stylehacks: 7.0.2(postcss@8.4.39) + + postcss-merge-rules@7.0.2(postcss@8.4.39): + dependencies: + browserslist: 4.23.1 + caniuse-api: 3.0.0 + cssnano-utils: 5.0.0(postcss@8.4.39) + postcss: 8.4.39 + postcss-selector-parser: 6.1.0 + + postcss-minify-font-values@7.0.0(postcss@8.4.39): + dependencies: + postcss: 8.4.39 + postcss-value-parser: 4.2.0 + + postcss-minify-gradients@7.0.0(postcss@8.4.39): + dependencies: + colord: 2.9.3 + cssnano-utils: 5.0.0(postcss@8.4.39) + postcss: 8.4.39 + postcss-value-parser: 4.2.0 + + postcss-minify-params@7.0.1(postcss@8.4.39): + dependencies: + browserslist: 4.23.1 + cssnano-utils: 5.0.0(postcss@8.4.39) + postcss: 8.4.39 + postcss-value-parser: 4.2.0 + + postcss-minify-selectors@7.0.2(postcss@8.4.39): + dependencies: + cssesc: 3.0.0 + postcss: 8.4.39 + postcss-selector-parser: 6.1.0 + + postcss-normalize-charset@7.0.0(postcss@8.4.39): + dependencies: + postcss: 8.4.39 + + postcss-normalize-display-values@7.0.0(postcss@8.4.39): + dependencies: + postcss: 8.4.39 + postcss-value-parser: 4.2.0 + + postcss-normalize-positions@7.0.0(postcss@8.4.39): + dependencies: + postcss: 8.4.39 + postcss-value-parser: 4.2.0 + + postcss-normalize-repeat-style@7.0.0(postcss@8.4.39): + dependencies: + postcss: 8.4.39 + postcss-value-parser: 4.2.0 + + postcss-normalize-string@7.0.0(postcss@8.4.39): + dependencies: + postcss: 8.4.39 + postcss-value-parser: 4.2.0 + + postcss-normalize-timing-functions@7.0.0(postcss@8.4.39): + dependencies: + postcss: 8.4.39 + postcss-value-parser: 4.2.0 + + postcss-normalize-unicode@7.0.1(postcss@8.4.39): + dependencies: + browserslist: 4.23.1 + postcss: 8.4.39 + postcss-value-parser: 4.2.0 + + postcss-normalize-url@7.0.0(postcss@8.4.39): + dependencies: + postcss: 8.4.39 + postcss-value-parser: 4.2.0 + + postcss-normalize-whitespace@7.0.0(postcss@8.4.39): + dependencies: + postcss: 8.4.39 + postcss-value-parser: 4.2.0 + + postcss-ordered-values@7.0.1(postcss@8.4.39): + dependencies: + cssnano-utils: 5.0.0(postcss@8.4.39) + postcss: 8.4.39 + postcss-value-parser: 4.2.0 + + postcss-reduce-initial@7.0.1(postcss@8.4.39): + dependencies: + browserslist: 4.23.1 + caniuse-api: 3.0.0 + postcss: 8.4.39 + + postcss-reduce-transforms@7.0.0(postcss@8.4.39): + dependencies: + postcss: 8.4.39 + postcss-value-parser: 4.2.0 + + postcss-selector-parser@6.1.0: + dependencies: + cssesc: 3.0.0 + util-deprecate: 1.0.2 + + postcss-svgo@7.0.1(postcss@8.4.39): + dependencies: + postcss: 8.4.39 + postcss-value-parser: 4.2.0 + svgo: 3.3.2 + + postcss-unique-selectors@7.0.1(postcss@8.4.39): + dependencies: + postcss: 8.4.39 + postcss-selector-parser: 6.1.0 + + postcss-value-parser@4.2.0: {} + postcss@8.4.39: dependencies: nanoid: 3.3.7 @@ -5459,6 +6025,12 @@ snapshots: strip-json-comments@3.1.1: {} + stylehacks@7.0.2(postcss@8.4.39): + dependencies: + browserslist: 4.23.1 + postcss: 8.4.39 + postcss-selector-parser: 6.1.0 + supports-color@2.0.0: {} supports-color@5.5.0: @@ -5475,6 +6047,16 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} + svgo@3.3.2: + dependencies: + '@trysound/sax': 0.2.0 + commander: 7.2.0 + css-select: 5.1.0 + css-tree: 2.3.1 + css-what: 6.1.0 + csso: 5.0.5 + picocolors: 1.0.1 + sweetalert2@11.12.2: {} table@6.8.2: @@ -5589,6 +6171,8 @@ snapshots: dependencies: punycode: 2.3.1 + util-deprecate@1.0.2: {} + v8-compile-cache@2.4.0: {} validate-npm-package-license@3.0.4: diff --git a/src/main/main-chrome.js b/src/main/main-chrome.js index 9536d25..5b1dba0 100644 --- a/src/main/main-chrome.js +++ b/src/main/main-chrome.js @@ -20,7 +20,7 @@ import ServiceWorker from './service-worker'; const buildTime = import.meta.env.VITE_BUILD_TIMESTAMP; const buildVersion = import.meta.env.VITE_BUILD_VERSION; const browserVendor = import.meta.env.VITE_BROWSER_VENDOR; -const developmentMode = import.meta.env.VITE_DEVELOPMENT_MODE; +const developmentMode = import.meta.env.VITE_DEVELOPMENT_MODE === 'true'; self.addEventListener('activate', new ServiceWorker(developmentMode, buildTime, buildVersion, browserVendor) .asPromise() diff --git a/src/main/runtime-build-info.js b/src/main/runtime-build-info.js index d3da98d..5fac3ca 100644 --- a/src/main/runtime-build-info.js +++ b/src/main/runtime-build-info.js @@ -1,3 +1,4 @@ +/* eslint-disable no-return-assign */ /* eslint-disable max-classes-per-file */ import ServiceWorkerComponent from './service-worker-component'; @@ -53,26 +54,28 @@ class DevelopmentMode extends ServiceWorkerComponent { } isEnabled() { - return this._isEnabled; + return this.asPromise().then((self) => self._isEnabled); } toggle() { - this._isEnabled = !this._isEnabled; + return this.asPromise().then((self) => (self._isEnabled = !self._isEnabled)); } setFeatureFlag(flag, value) { - this._featureFlags[flag] = value; + return this.asPromise().then((self) => (self._featureFlags[flag] = value)); } isFeatureFlagSet(flag) { - if (!this._featureFlags[flag]) { - return false; - } - return this._featureFlags[flag]; + return this.asPromise().then((self) => { + if (!self._featureFlags[flag]) { + return false; + } + return self._featureFlags[flag]; + }); } toggleFeatureFlag(flag) { - this._featureFlags[flag] = !this._featureFlags[flag]; + return this.asPromise().then((self) => (self._featureFlags[flag] = !self._featureFlags[flag])); } asConsole() { diff --git a/src/popup/index.css b/src/popup/index.css index a694ada..fefbda4 100644 --- a/src/popup/index.css +++ b/src/popup/index.css @@ -277,6 +277,22 @@ label[for="studio-package-name-input"] { width: 380px; } +/*============================================================================== +FORMS +==============================================================================*/ + +.read-only-form input, +.read-only-form textarea, +.read-only-form select { + background-color: #f3f3f3; /* Light grey background */ + color: #666; /* Darker text */ + border: 1px solid #ccc; /* Light grey border */ +} + +.read-only-form select { + pointer-events: none; /* Prevent opening dropdown */ +} + /*============================================================================== BUTTONS ==============================================================================*/ diff --git a/src/popup/index.html b/src/popup/index.html index 2fedbcd..7106ec9 100644 --- a/src/popup/index.html +++ b/src/popup/index.html @@ -102,9 +102,11 @@ - 🚫 - 💾 - +
diff --git a/src/popup/index.js b/src/popup/index.js index 137b23f..9ef5926 100644 --- a/src/popup/index.js +++ b/src/popup/index.js @@ -249,32 +249,100 @@ Please open the JavaScript console of the nuxeo w // process the page, should split this in multiple functions // eslint-disable-next-line no-unused-vars .then(({ connectUrl, connectCredentials, cookiesGranted }) => { + // bind the fields with the js worker const pendingPromises = []; - $('#connect-url-input').val(connectUrl); - - // Grant cookies permissions to connect if needed - // Define a variable in memory to keep track of the permission state - // eslint-disable-next-line no-unused-vars - let newCookiesGranted = cookiesGranted; - const onCookiesGranted = (granted) => { - const style = ``; - $('#grant').html(style); - newCookiesGranted = granted; - }; - onCookiesGranted(cookiesGranted); - $('#grant').click(() => { - const permissions = { origins: [`${connectUrl.origin}/*`], permissions: ['cookies'] }; - chrome.permissions.contains(permissions) - .then((isGranted) => ( - isGranted ? chrome.permissions.remove(permissions) : chrome.permissions.request(permissions))) - .then(() => chrome.permissions.contains(permissions)) - .then((granted) => onCookiesGranted(granted)) - .catch((error) => { - console.error('Error handling permissions', permissions, error); - // Handle the error appropriately in your extension - // For example, you might want to inform the user that the permissions cannot be modified + + pendingPromises.push(worker.developmentMode + .isEnabled() + .then((isEnabled) => { + // Assuming isEnabled is already determined + const shouldBeReadOnly = !isEnabled; + // Toggle class for read-only styling + $('.server-main #options').toggleClass('read-only-form', shouldBeReadOnly); + // Disable all inputs, textareas, selects, and buttons + $('.server-main #options').find('input, textarea, select, button').prop('disabled', shouldBeReadOnly); + // Additionally, make inputs and textareas readonly if needed + $('.server-main #options').find('input, textarea').prop('readonly', shouldBeReadOnly); + + // set values + $('#connect-url-input').val(connectUrl); + + // toggle the buttons displaying + $('.server-main #options #buttons').toggle(isEnabled); + if (!isEnabled) return; + + $('#save').click(() => { + const savingPromises = []; + + // connect URL + savingPromises.push(Promise.resolve($('#connect-url-input')) + .then((inputField) => ($('#connect-url').hide(), { field: inputField, value: inputField.val() })) + .then(({ field, value }) => { + const registration = value.length !== 0 + ? worker.connectLocator.asRegistration(value) + : worker.connectLocator.asRegistration(); + return registration + .then(({ location }) => (field.val(location), new URL(location))); + })); + + // studio package name + savingPromises.push(Promise.resolve($('#studio-package-name-input')) + .then((selectBox) => (selectBox.length === 0 ? undefined : selectBox.val())) + .then((name) => { + if (!name) { + return undefined; + } + return worker.serverConnector + .registerDevelopedStudioProject(name) + .then(() => name); + })); + + // highlight + savingPromises.push(worker.browserStore + .set({ highlight: $('#highlight-input').prop('checked') }) + .then((store) => store.highlight)); + + Promise + .all(savingPromises) + .then(() => worker.componentInventory.reload()); }); - }); + + $('#reset').click(() => { + Swal.fire({ + title: 'Reset Options', + text: 'Click Reset to reset all options to default settings.', + showCancelButton: true, + confirmButtonText: 'Reset', + cancelButtonText: 'Cancel', + }).then((result) => { + if (!result.isConfirmed) return; + worker.componentInventory.reset(); + }); + }); + // Grant cookies permissions to connect if needed + // Define a variable in memory to keep track of the permission state + // eslint-disable-next-line no-unused-vars + let newCookiesGranted = cookiesGranted; + const onCookiesGranted = (granted) => { + const style = ``; + $('#grant').html(style); + newCookiesGranted = granted; + }; + onCookiesGranted(cookiesGranted); + $('#grant').click(() => { + const permissions = { origins: [`${connectUrl.origin}/*`], permissions: ['cookies'] }; + chrome.permissions.contains(permissions) + .then((isGranted) => ( + isGranted ? chrome.permissions.remove(permissions) : chrome.permissions.request(permissions))) + .then(() => chrome.permissions.contains(permissions)) + .then((granted) => onCookiesGranted(granted)) + .catch((error) => { + console.error('Error handling permissions', permissions, error); + // Handle the error appropriately in your extension + // For example, you might want to inform the user that the permissions cannot be modified + }); + }); + })); // update the page according to the feature flags pendingPromises.push(worker.developmentMode @@ -312,55 +380,6 @@ Please open the JavaScript console of the nuxeo w $('#connect-url').toggle(); }); - $('#save').click(() => { - const savingPromises = []; - - // connect URL - savingPromises.push(Promise.resolve($('#connect-url-input')) - .then((inputField) => ($('#connect-url').hide(), { field: inputField, value: inputField.val() })) - .then(({ field, value }) => { - const registration = value.length !== 0 - ? worker.connectLocator.asRegistration(value) - : worker.connectLocator.asRegistration(); - return registration - .then(({ location }) => (field.val(location), new URL(location))); - })); - - // studio package name - savingPromises.push(Promise.resolve($('#studio-package-name-input')) - .then((selectBox) => (selectBox.length === 0 ? undefined : selectBox.val())) - .then((name) => { - if (!name) { - return undefined; - } - return worker.serverConnector - .registerDevelopedStudioProject(name) - .then(() => name); - })); - - // highlight - savingPromises.push(worker.browserStore - .set({ highlight: $('#highlight-input').prop('checked') }) - .then((store) => store.highlight)); - - Promise - .all(savingPromises) - .then(() => worker.componentInventory.reload()); - }); - - $('#reset').click(() => { - Swal.fire({ - title: 'Reset Options', - text: 'Click Reset to reset all options to default settings.', - showCancelButton: true, - confirmButtonText: 'Reset', - cancelButtonText: 'Cancel', - }).then((result) => { - if (!result.isConfirmed) return; - worker.componentInventory.reset(); - }); - }); - // being resolved in promise for handles, better be bound in a dedicated class I think let onUI; let repository = 'default'; diff --git a/vite.config.js b/vite.config.js index e77a7b0..9413db5 100644 --- a/vite.config.js +++ b/vite.config.js @@ -2,6 +2,7 @@ /* eslint-disable no-cond-assign */ /* eslint-disable comma-dangle */ import copy from 'rollup-plugin-copy'; +import cssnano from 'cssnano'; import dotenv from 'dotenv'; import inject from '@rollup/plugin-inject'; import fs from 'fs'; @@ -46,10 +47,13 @@ export default defineConfig(({ mode }) => { const viteConfig = { css: { - transformer: 'lightningcss' + transformer: 'lightningcss', + postcss: { + plugins: [cssnano(['default', { normalizeUrl: false }])], + }, }, build: { - base: './', + base: `/${buildEntry.root}/`, assetsDir: './', // relative to outDir outDir: `dist/${browserVendor}`, copyPublicDir: buildEntry.copyPublicDir || false, @@ -66,7 +70,7 @@ export default defineConfig(({ mode }) => { output: { dir: `dist/${browserVendor}/${buildEntry.root}`, format: 'es', - inlineDynamicImports: false, + inlineDynamicImports: true, assetFileNames: '[name]-[hash][extname]', entryFileNames: () => { if (buildEntry.root === 'main') {