From 9135c951f2702ae28bd54958c8e71e826cf2f0c9 Mon Sep 17 00:00:00 2001 From: Michal Szczepanski Date: Thu, 15 Jun 2023 21:55:08 +0200 Subject: [PATCH] feat: save pdf poc --- package-lock.json | 957 +++++++++++++++++- package.json | 3 +- src/common/factory/screenshot.factory.ts | 4 +- src/common/factory/url.factory.ts | 2 + src/common/model/bus.model.ts | 1 + src/common/model/obj-request.model.ts | 5 +- src/common/model/obj/obj-binary.dto.ts | 34 + src/common/model/obj/obj.dto.ts | 6 +- src/common/popup/log.manager.ts | 4 +- .../snapshot/content-fetch-iframe.command.ts | 10 +- .../content-page-segment-save.command.ts | 4 +- .../content-page-snapshot-add.command.ts | 26 +- .../snapshot/content-pdf-save.command.ts | 25 + src/content-script/content-message.handler.ts | 7 +- src/content-script/content-script.ts | 8 +- src/content-script/iframe-message.handler.ts | 10 +- .../mediator/document.mediator.ts | 6 +- .../account/account-details.component.tsx | 10 +- .../components/account/login.component.tsx | 4 +- .../account/verify-2fa.component.tsx | 4 +- .../components/main/main-header.component.tsx | 11 +- .../main/main-menu-list.component.tsx | 6 +- .../components/obj/obj-view.component.tsx | 4 +- .../obj/snapshot-list-element.component.tsx | 16 +- .../components/tabs/logs-tab.component.tsx | 11 +- .../components/tabs/main-tab.component.tsx | 4 +- src/default-popup/popup-message.handler.ts | 4 +- .../store/popup-active-tab.store.ts | 4 +- src/iframe/iframe-script.ts | 8 +- src/options-ui/options-message.handler.ts | 4 +- .../content/content-fetch-image.command.ts | 2 +- .../content/content-fetch-pdf.command.ts | 54 + src/service-worker/service-worker.ts | 6 +- tsconfig.json | 2 +- 34 files changed, 1138 insertions(+), 128 deletions(-) create mode 100644 src/common/model/obj/obj-binary.dto.ts create mode 100644 src/content-script/command/snapshot/content-pdf-save.command.ts create mode 100644 src/service-worker/command/content/content-fetch-pdf.command.ts diff --git a/package-lock.json b/package-lock.json index fd29dcf..8194f89 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "@mui/icons-material": "^5.8.4", "@mui/material": "^5.9.3", "@mui/x-date-pickers": "^6.1.0", - "@pinmenote/browser-api": "^0.0.2", + "@pinmenote/browser-api": "^0.0.4", "@pinmenote/fetch-service": "^0.0.3", "@pinmenote/page-compute": "^0.0.9", "@pinmenote/tiny-dispatcher": "^0.0.2", @@ -29,6 +29,7 @@ "nanoid": "^4.0.0", "openpgp": "^5.5.0", "parse5": "^7.1.2", + "pdfjs-dist": "^3.7.107", "prosemirror-commands": "^1.3.1", "prosemirror-dropcursor": "^1.6.1", "prosemirror-gapcursor": "^1.3.1", @@ -965,6 +966,50 @@ "win32" ] }, + "node_modules/@mapbox/node-pre-gyp": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz", + "integrity": "sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==", + "optional": true, + "dependencies": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/detect-libc": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", + "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/semver": { + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", + "optional": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@mischnic/json-sourcemap": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/@mischnic/json-sourcemap/-/json-sourcemap-0.1.0.tgz", @@ -12043,9 +12088,9 @@ } }, "node_modules/@pinmenote/browser-api": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@pinmenote/browser-api/-/browser-api-0.0.2.tgz", - "integrity": "sha512-vFe2CJMc69AYFhrZPDEep3XEH7leRm1fhT95vaFdlyN7UPlN7IaOG5n+x6Yac8im48gj4VLt9E0BHDpSsE9Gnw==" + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@pinmenote/browser-api/-/browser-api-0.0.4.tgz", + "integrity": "sha512-BVDB4xICEGjlRi69rBa9Xjmqy9U0V5pRuBSX2TOp+pWXH1o96JRQGeL7hcvbHDfBJlGDWW+abKGyAcMm+ZssyA==" }, "node_modules/@pinmenote/fetch-service": { "version": "0.0.3", @@ -12447,6 +12492,12 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "optional": true + }, "node_modules/abortcontroller-polyfill": { "version": "1.7.3", "resolved": "https://registry.npmjs.org/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.3.tgz", @@ -12474,6 +12525,18 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "optional": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -12494,7 +12557,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, + "devOptional": true, "engines": { "node": ">=8" } @@ -12514,6 +12577,39 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "optional": true + }, + "node_modules/are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "optional": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/are-we-there-yet/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "optional": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -12621,7 +12717,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "devOptional": true }, "node_modules/base-x": { "version": "3.0.9", @@ -12667,7 +12763,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, + "devOptional": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -12778,6 +12874,21 @@ } ] }, + "node_modules/canvas": { + "version": "2.11.2", + "resolved": "https://registry.npmjs.org/canvas/-/canvas-2.11.2.tgz", + "integrity": "sha512-ItanGBMrmRV7Py2Z+Xhs7cT+FNt5K0vPL4p9EZ/UX/Mu7hFbkxSjKF2KVtPwX7UYWp7dRKnrTvReflgrItJbdw==", + "hasInstallScript": true, + "optional": true, + "dependencies": { + "@mapbox/node-pre-gyp": "^1.0.0", + "nan": "^2.17.0", + "simple-get": "^3.0.3" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -12794,6 +12905,15 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "optional": true, + "engines": { + "node": ">=10" + } + }, "node_modules/chrome-trace-event": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", @@ -12838,6 +12958,15 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "optional": true, + "bin": { + "color-support": "bin.js" + } + }, "node_modules/commander": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", @@ -12851,7 +12980,7 @@ "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "devOptional": true }, "node_modules/concat-stream": { "version": "1.6.2", @@ -12868,6 +12997,12 @@ "typedarray": "^0.0.6" } }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "optional": true + }, "node_modules/content-security-policy-parser": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/content-security-policy-parser/-/content-security-policy-parser-0.3.0.tgz", @@ -13022,6 +13157,18 @@ "node": ">=0.10" } }, + "node_modules/decompress-response": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", + "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", + "optional": true, + "dependencies": { + "mimic-response": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -13044,6 +13191,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "optional": true + }, "node_modules/detect-libc": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", @@ -13173,6 +13326,12 @@ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.211.tgz", "integrity": "sha512-BZSbMpyFQU0KBJ1JG26XGeFI3i4op+qOYGxftmZXFZoHkhLgsSv4DHDJfl8ogII3hIuzGt51PaZ195OVu0yJ9A==" }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "optional": true + }, "node_modules/entities": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/entities/-/entities-3.0.1.tgz", @@ -13702,11 +13861,35 @@ "integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==", "dev": true }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true + "devOptional": true }, "node_modules/function-bind": { "version": "1.1.1", @@ -13746,6 +13929,26 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "optional": true, + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -13798,7 +14001,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, + "devOptional": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -13935,6 +14138,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "optional": true + }, "node_modules/hoist-non-react-statics": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", @@ -14015,6 +14224,19 @@ "entities": "^3.0.1" } }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "optional": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -14072,7 +14294,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, + "devOptional": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -14177,6 +14399,15 @@ "node": ">=0.10.0" } }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "optional": true, + "engines": { + "node": ">=8" + } + }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -14677,7 +14908,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, + "devOptional": true, "dependencies": { "yallist": "^4.0.0" }, @@ -14685,6 +14916,30 @@ "node": ">=10" } }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "optional": true, + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "optional": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/markdown-it": { "version": "13.0.1", "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-13.0.1.tgz", @@ -14744,6 +14999,18 @@ "node": ">=8.6" } }, + "node_modules/mimic-response": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", + "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", + "optional": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -14753,7 +15020,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, + "devOptional": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -14761,6 +15028,52 @@ "node": "*" } }, + "node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "optional": true, + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "optional": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -14797,6 +15110,12 @@ "@msgpackr-extract/msgpackr-extract-win32-x64": "2.1.2" } }, + "node_modules/nan": { + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz", + "integrity": "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==", + "optional": true + }, "node_modules/nanoid": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-4.0.2.tgz", @@ -14826,6 +15145,26 @@ "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==", "dev": true }, + "node_modules/node-fetch": { + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz", + "integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==", + "optional": true, + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, "node_modules/node-gyp-build": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.5.0.tgz", @@ -14853,6 +15192,33 @@ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.6.tgz", "integrity": "sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg==" }, + "node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "optional": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "optional": true, + "dependencies": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, "node_modules/nth-check": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", @@ -14980,7 +15346,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, + "devOptional": true, "dependencies": { "wrappy": "1" } @@ -15401,7 +15767,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, + "devOptional": true, "engines": { "node": ">=0.10.0" } @@ -15428,6 +15794,27 @@ "node": ">=8" } }, + "node_modules/path2d-polyfill": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path2d-polyfill/-/path2d-polyfill-2.0.1.tgz", + "integrity": "sha512-ad/3bsalbbWhmBo0D6FZ4RNMwsLsPpL6gnvhuSaU5Vm7b06Kr5ubSltQQ0T7YKsiJQO+g22zJ4dJKNTXIyOXtA==", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/pdfjs-dist": { + "version": "3.7.107", + "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-3.7.107.tgz", + "integrity": "sha512-D0pZgz4u8VNjCCXfNCjzeFcenxKFGh2RnGlLIvDHgpT+ZvOlsBlHugpOfmcLQyKk7csHBhPalf+mCM6thiclSQ==", + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "canvas": "^2.11.2", + "path2d-polyfill": "^2.0.1" + } + }, "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", @@ -15945,7 +16332,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, + "devOptional": true, "dependencies": { "glob": "^7.1.3" }, @@ -16026,6 +16413,12 @@ "semver": "bin/semver" } }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "optional": true + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -16061,6 +16454,43 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "optional": true + }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "optional": true + }, + "node_modules/simple-get": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz", + "integrity": "sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==", + "optional": true, + "dependencies": { + "decompress-response": "^4.2.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -16120,7 +16550,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, + "devOptional": true, "dependencies": { "safe-buffer": "~5.1.0" } @@ -16129,7 +16559,21 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "devOptional": true + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "optional": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } }, "node_modules/string.prototype.matchall": { "version": "4.0.7", @@ -16182,7 +16626,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, + "devOptional": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -16251,6 +16695,23 @@ "node": ">=10.13.0" } }, + "node_modules/tar": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.15.tgz", + "integrity": "sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==", + "optional": true, + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/term-size": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.1.tgz", @@ -16324,6 +16785,12 @@ "node": ">=8.0" } }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "optional": true + }, "node_modules/tslib": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", @@ -16461,7 +16928,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true + "devOptional": true }, "node_modules/utility-types": { "version": "3.10.0", @@ -16489,6 +16956,22 @@ "integrity": "sha512-DEAoo25RfSYMuTGc9vPJzZcZullwIqRDSI9LOy+fkCJPi6hykCnfKaXTuPBDuXAUcqHXyOgFtHNp/kB2FjYHbw==", "dev": true }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "optional": true + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "optional": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -16520,6 +17003,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "optional": true, + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, "node_modules/word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -16533,7 +17025,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true + "devOptional": true }, "node_modules/xxhash-wasm": { "version": "0.4.2", @@ -16545,7 +17037,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "devOptional": true }, "node_modules/yaml": { "version": "1.10.2", @@ -17218,6 +17710,40 @@ "dev": true, "optional": true }, + "@mapbox/node-pre-gyp": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz", + "integrity": "sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==", + "optional": true, + "requires": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "dependencies": { + "detect-libc": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", + "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==", + "optional": true + }, + "semver": { + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", + "optional": true, + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, "@mischnic/json-sourcemap": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/@mischnic/json-sourcemap/-/json-sourcemap-0.1.0.tgz", @@ -23933,9 +24459,9 @@ } }, "@pinmenote/browser-api": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@pinmenote/browser-api/-/browser-api-0.0.2.tgz", - "integrity": "sha512-vFe2CJMc69AYFhrZPDEep3XEH7leRm1fhT95vaFdlyN7UPlN7IaOG5n+x6Yac8im48gj4VLt9E0BHDpSsE9Gnw==" + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@pinmenote/browser-api/-/browser-api-0.0.4.tgz", + "integrity": "sha512-BVDB4xICEGjlRi69rBa9Xjmqy9U0V5pRuBSX2TOp+pWXH1o96JRQGeL7hcvbHDfBJlGDWW+abKGyAcMm+ZssyA==" }, "@pinmenote/fetch-service": { "version": "0.0.3", @@ -24233,6 +24759,12 @@ "eslint-visitor-keys": "^3.3.0" } }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "optional": true + }, "abortcontroller-polyfill": { "version": "1.7.3", "resolved": "https://registry.npmjs.org/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.3.tgz", @@ -24252,6 +24784,15 @@ "dev": true, "requires": {} }, + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "optional": true, + "requires": { + "debug": "4" + } + }, "ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -24268,7 +24809,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true + "devOptional": true }, "ansi-styles": { "version": "4.3.0", @@ -24279,6 +24820,35 @@ "color-convert": "^2.0.1" } }, + "aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "optional": true + }, + "are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "optional": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, "argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -24357,7 +24927,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "devOptional": true }, "base-x": { "version": "3.0.9", @@ -24389,7 +24959,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, + "devOptional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -24451,6 +25021,17 @@ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001374.tgz", "integrity": "sha512-mWvzatRx3w+j5wx/mpFN5v5twlPrabG8NqX2c6e45LCpymdoGqNvRkRutFUqpRTXKFQFNQJasvK0YT7suW6/Hw==" }, + "canvas": { + "version": "2.11.2", + "resolved": "https://registry.npmjs.org/canvas/-/canvas-2.11.2.tgz", + "integrity": "sha512-ItanGBMrmRV7Py2Z+Xhs7cT+FNt5K0vPL4p9EZ/UX/Mu7hFbkxSjKF2KVtPwX7UYWp7dRKnrTvReflgrItJbdw==", + "optional": true, + "requires": { + "@mapbox/node-pre-gyp": "^1.0.0", + "nan": "^2.17.0", + "simple-get": "^3.0.3" + } + }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -24461,6 +25042,12 @@ "supports-color": "^7.1.0" } }, + "chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "optional": true + }, "chrome-trace-event": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", @@ -24493,6 +25080,12 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "optional": true + }, "commander": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", @@ -24503,7 +25096,7 @@ "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "devOptional": true }, "concat-stream": { "version": "1.6.2", @@ -24517,6 +25110,12 @@ "typedarray": "^0.0.6" } }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "optional": true + }, "content-security-policy-parser": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/content-security-policy-parser/-/content-security-policy-parser-0.3.0.tgz", @@ -24638,6 +25237,15 @@ "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==" }, + "decompress-response": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", + "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", + "optional": true, + "requires": { + "mimic-response": "^2.0.0" + } + }, "deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -24654,6 +25262,12 @@ "object-keys": "^1.1.1" } }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "optional": true + }, "detect-libc": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", @@ -24749,6 +25363,12 @@ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.211.tgz", "integrity": "sha512-BZSbMpyFQU0KBJ1JG26XGeFI3i4op+qOYGxftmZXFZoHkhLgsSv4DHDJfl8ogII3hIuzGt51PaZ195OVu0yJ9A==" }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "optional": true + }, "entities": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/entities/-/entities-3.0.1.tgz", @@ -25150,11 +25770,31 @@ "integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==", "dev": true }, + "fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "optional": true, + "requires": { + "minipass": "^3.0.0" + }, + "dependencies": { + "minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "optional": true, + "requires": { + "yallist": "^4.0.0" + } + } + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true + "devOptional": true }, "function-bind": { "version": "1.1.1", @@ -25185,6 +25825,23 @@ "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", "dev": true }, + "gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "optional": true, + "requires": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + } + }, "gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -25222,7 +25879,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, + "devOptional": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -25314,6 +25971,12 @@ "has-symbols": "^1.0.2" } }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "optional": true + }, "hoist-non-react-statics": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", @@ -25351,6 +26014,16 @@ "entities": "^3.0.1" } }, + "https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "optional": true, + "requires": { + "agent-base": "6", + "debug": "4" + } + }, "ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -25382,7 +26055,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, + "devOptional": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -25457,6 +26130,12 @@ "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "optional": true + }, "is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -25768,11 +26447,28 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, + "devOptional": true, "requires": { "yallist": "^4.0.0" } }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "optional": true, + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "optional": true + } + } + }, "markdown-it": { "version": "13.0.1", "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-13.0.1.tgz", @@ -25817,6 +26513,12 @@ "picomatch": "^2.3.1" } }, + "mimic-response": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", + "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", + "optional": true + }, "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -25826,11 +26528,44 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, + "devOptional": true, "requires": { "brace-expansion": "^1.1.7" } }, + "minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "optional": true + }, + "minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "optional": true, + "requires": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "dependencies": { + "minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "optional": true, + "requires": { + "yallist": "^4.0.0" + } + } + } + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "optional": true + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -25861,6 +26596,12 @@ "node-gyp-build-optional-packages": "5.0.3" } }, + "nan": { + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz", + "integrity": "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==", + "optional": true + }, "nanoid": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-4.0.2.tgz", @@ -25878,6 +26619,15 @@ "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==", "dev": true }, + "node-fetch": { + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz", + "integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==", + "optional": true, + "requires": { + "whatwg-url": "^5.0.0" + } + }, "node-gyp-build": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.5.0.tgz", @@ -25895,6 +26645,27 @@ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.6.tgz", "integrity": "sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg==" }, + "nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "optional": true, + "requires": { + "abbrev": "1" + } + }, + "npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "optional": true, + "requires": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, "nth-check": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", @@ -25986,7 +26757,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, + "devOptional": true, "requires": { "wrappy": "1" } @@ -26263,7 +27034,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true + "devOptional": true }, "path-key": { "version": "3.1.1", @@ -26281,6 +27052,21 @@ "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" }, + "path2d-polyfill": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path2d-polyfill/-/path2d-polyfill-2.0.1.tgz", + "integrity": "sha512-ad/3bsalbbWhmBo0D6FZ4RNMwsLsPpL6gnvhuSaU5Vm7b06Kr5ubSltQQ0T7YKsiJQO+g22zJ4dJKNTXIyOXtA==", + "optional": true + }, + "pdfjs-dist": { + "version": "3.7.107", + "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-3.7.107.tgz", + "integrity": "sha512-D0pZgz4u8VNjCCXfNCjzeFcenxKFGh2RnGlLIvDHgpT+ZvOlsBlHugpOfmcLQyKk7csHBhPalf+mCM6thiclSQ==", + "requires": { + "canvas": "^2.11.2", + "path2d-polyfill": "^2.0.1" + } + }, "picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", @@ -26706,7 +27492,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, + "devOptional": true, "requires": { "glob": "^7.1.3" } @@ -26750,6 +27536,12 @@ "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "optional": true + }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -26776,6 +27568,29 @@ "object-inspect": "^1.9.0" } }, + "signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "optional": true + }, + "simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "optional": true + }, + "simple-get": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz", + "integrity": "sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==", + "optional": true, + "requires": { + "decompress-response": "^4.2.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -26826,7 +27641,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, + "devOptional": true, "requires": { "safe-buffer": "~5.1.0" }, @@ -26835,10 +27650,21 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "devOptional": true } } }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "optional": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, "string.prototype.matchall": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.7.tgz", @@ -26881,7 +27707,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, + "devOptional": true, "requires": { "ansi-regex": "^5.0.1" } @@ -26926,6 +27752,20 @@ "stable": "^0.1.8" } }, + "tar": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.15.tgz", + "integrity": "sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==", + "optional": true, + "requires": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + } + }, "term-size": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.1.tgz", @@ -26983,6 +27823,12 @@ "is-number": "^7.0.0" } }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "optional": true + }, "tslib": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", @@ -27080,7 +27926,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true + "devOptional": true }, "utility-types": { "version": "3.10.0", @@ -27105,6 +27951,22 @@ "integrity": "sha512-DEAoo25RfSYMuTGc9vPJzZcZullwIqRDSI9LOy+fkCJPi6hykCnfKaXTuPBDuXAUcqHXyOgFtHNp/kB2FjYHbw==", "dev": true }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "optional": true + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "optional": true, + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -27127,6 +27989,15 @@ "is-symbol": "^1.0.3" } }, + "wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "optional": true, + "requires": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -27137,7 +28008,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true + "devOptional": true }, "xxhash-wasm": { "version": "0.4.2", @@ -27149,7 +28020,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "devOptional": true }, "yaml": { "version": "1.10.2", diff --git a/package.json b/package.json index 090e0dc..ff9aaa3 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "@mui/icons-material": "^5.8.4", "@mui/material": "^5.9.3", "@mui/x-date-pickers": "^6.1.0", - "@pinmenote/browser-api": "^0.0.2", + "@pinmenote/browser-api": "^0.0.4", "@pinmenote/fetch-service": "^0.0.3", "@pinmenote/page-compute": "^0.0.9", "@pinmenote/tiny-dispatcher": "^0.0.2", @@ -75,6 +75,7 @@ "nanoid": "^4.0.0", "openpgp": "^5.5.0", "parse5": "^7.1.2", + "pdfjs-dist": "^3.7.107", "prosemirror-commands": "^1.3.1", "prosemirror-dropcursor": "^1.6.1", "prosemirror-gapcursor": "^1.3.1", diff --git a/src/common/factory/screenshot.factory.ts b/src/common/factory/screenshot.factory.ts index 608fe85..8b8f45d 100644 --- a/src/common/factory/screenshot.factory.ts +++ b/src/common/factory/screenshot.factory.ts @@ -27,10 +27,10 @@ export class ScreenshotFactory { static takeScreenshot = async (doc: PinDocument, rect?: ObjRectangleDto, url?: ObjUrlDto): Promise => { return new Promise((resolve, reject) => { // Crop screenshot function - TinyDispatcher.addListener( + TinyDispatcher.getInstance().addListener( BusMessageType.CONTENT_TAKE_SCREENSHOT, async (event: string, key: string, screenshot: string) => { - TinyDispatcher.removeListener(event, key); + TinyDispatcher.getInstance().removeListener(event, key); if (rect) screenshot = await ImageResizeFactory.resize(doc, rect, screenshot); resolve(screenshot); } diff --git a/src/common/factory/url.factory.ts b/src/common/factory/url.factory.ts index 6b1f404..f31e13d 100644 --- a/src/common/factory/url.factory.ts +++ b/src/common/factory/url.factory.ts @@ -15,6 +15,7 @@ * along with this program. If not, see . */ import { ObjUrlDto } from '../model/obj/obj.dto'; +import { fnConsoleLog } from '../fn/fn-console'; interface QueryParam { key: string; @@ -71,6 +72,7 @@ export class UrlFactory { resolve(this.result as string); }; reader.onerror = function () { + fnConsoleLog('UrlFactory->toDataUri->error', value, this.error); reject(this.error); }; reader.readAsDataURL(value); diff --git a/src/common/model/bus.model.ts b/src/common/model/bus.model.ts index cd898a6..496e858 100644 --- a/src/common/model/bus.model.ts +++ b/src/common/model/bus.model.ts @@ -53,6 +53,7 @@ export enum BusMessageType { CONTENT_PIN_REMOVE = 'content.pin.remove', CONTENT_STOP_LISTENERS = 'content.stop.listeners', CONTENT_TAKE_SCREENSHOT = 'content.take.screenshot', + CONTENT_FETCH_PDF = 'content.fetch.pdf', CONTENT_THEME = 'content.theme', // Iframe content script IFRAME_INDEX = 'iframe.index', diff --git a/src/common/model/obj-request.model.ts b/src/common/model/obj-request.model.ts index c563d85..34cd79d 100644 --- a/src/common/model/obj-request.model.ts +++ b/src/common/model/obj-request.model.ts @@ -42,9 +42,8 @@ export interface FetchCssRequest { url: string; } -export interface FetchImageRequest { - url: string; -} +export type FetchImageRequest = FetchCssRequest; +export type FetchPDFRequest = FetchCssRequest; export interface ExtensionPopupInitData { isAdding: boolean; diff --git a/src/common/model/obj/obj-binary.dto.ts b/src/common/model/obj/obj-binary.dto.ts new file mode 100644 index 0000000..0929ebb --- /dev/null +++ b/src/common/model/obj/obj-binary.dto.ts @@ -0,0 +1,34 @@ +/* + * This file is part of the pinmenote-extension distribution (https://github.com/pinmenote/pinmenote-extension). + * Copyright (c) 2023 Michal Szczepanski. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +import { ObjCommentListDto } from './obj-comment.dto'; +import { ObjUrlDto } from './obj.dto'; + +export type ObjBinaryType = 'PDF' | 'IMAGE'; + +export interface ObjBinaryDataDto { + type: ObjBinaryType; + hash: string; + data: string; +} + +export interface ObjBinaryDto { + hash: string; + url?: ObjUrlDto; + words?: string[]; + hashtags?: string[]; + comments?: ObjCommentListDto; +} diff --git a/src/common/model/obj/obj.dto.ts b/src/common/model/obj/obj.dto.ts index b9290b3..9540f82 100644 --- a/src/common/model/obj/obj.dto.ts +++ b/src/common/model/obj/obj.dto.ts @@ -14,6 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ +import { ObjBinaryDto } from './obj-binary.dto'; import { ObjNoteDto } from './obj-note.dto'; import { ObjPageDto } from './obj-page.dto'; import { ObjPinDto } from './obj-pin.dto'; @@ -41,10 +42,11 @@ export enum ObjTypeDto { Note = 'Note', PageAlter = 'PAGE_ALTER', PageTask = 'PAGE_TASK', - PageEvent = 'PAGE_EVENT' + Pdf = 'PDF', + Image = 'IMAGE' } -export type ObjDataDto = ObjPageDto | ObjNoteDto | ObjPinDto; +export type ObjDataDto = ObjPageDto | ObjNoteDto | ObjPinDto | ObjBinaryDto; export type ObjPageDataDto = ObjPinDto | ObjPageDto | ObjNoteDto | ObjTaskDto; export interface ObjDto { diff --git a/src/common/popup/log.manager.ts b/src/common/popup/log.manager.ts index a0c7f5a..cd375e3 100644 --- a/src/common/popup/log.manager.ts +++ b/src/common/popup/log.manager.ts @@ -24,7 +24,7 @@ export class LogManager { static log = (value: string): void => { this.logValue = '' + value + '
' + this.logValue; fnConsoleLog(value); - TinyDispatcher.dispatch(BusMessageType.POP_CONSOLE_LOG, this.logValue); + TinyDispatcher.getInstance().dispatch(BusMessageType.POP_CONSOLE_LOG, this.logValue); }; static get logs(): string { @@ -33,6 +33,6 @@ export class LogManager { static clear(): void { this.logValue = ''; - TinyDispatcher.dispatch(BusMessageType.POP_CONSOLE_LOG, this.logValue); + TinyDispatcher.getInstance().dispatch(BusMessageType.POP_CONSOLE_LOG, this.logValue); } } diff --git a/src/content-script/command/snapshot/content-fetch-iframe.command.ts b/src/content-script/command/snapshot/content-fetch-iframe.command.ts index 8798b89..4a33b8f 100644 --- a/src/content-script/command/snapshot/content-fetch-iframe.command.ts +++ b/src/content-script/command/snapshot/content-fetch-iframe.command.ts @@ -20,6 +20,7 @@ import { ICommand } from '../../../common/model/shared/common.dto'; import { IFrameFetchMessage } from '../../../common/model/iframe-message.model'; import { IFrameStore } from '../../store/iframe.store'; import { PageSegmentAddCommand } from '../../../common/command/snapshot/segment/page-segment-add.command'; +import { TinyDispatcher } from '@pinmenote/tiny-dispatcher'; import { fnConsoleLog } from '../../../common/fn/fn-console'; import { fnIframeIndex } from '../../../common/fn/fn-iframe-index'; @@ -37,8 +38,13 @@ export class ContentFetchIframeCommand implements ICommand> { 'children', document.body.children.length ); - - const snapshot = await PageCompute.compute(document.body, this.contentCallback, IFrameStore.getInstance(), []); + const snapshot = await PageCompute.compute( + document.body, + this.contentCallback, + IFrameStore.getInstance(), + [], + TinyDispatcher.getInstance() + ); const dto: SegmentPage = { html: snapshot.content.html, diff --git a/src/content-script/command/snapshot/content-page-segment-save.command.ts b/src/content-script/command/snapshot/content-page-segment-save.command.ts index 1d3ff4f..3675549 100644 --- a/src/content-script/command/snapshot/content-page-segment-save.command.ts +++ b/src/content-script/command/snapshot/content-page-segment-save.command.ts @@ -20,6 +20,7 @@ import { HtmlConstraints } from '../../factory/html/html.constraints'; import { ICommand } from '../../../common/model/shared/common.dto'; import { IFrameStore } from '../../store/iframe.store'; import { PageSegmentAddCommand } from '../../../common/command/snapshot/segment/page-segment-add.command'; +import { TinyDispatcher } from '@pinmenote/tiny-dispatcher'; import { fnConsoleLog } from '../../../common/fn/fn-console'; interface SnapshotResult { @@ -40,7 +41,8 @@ export class ContentPageSegmentSaveCommand implements ICommand> { constructor(private settings: SettingsConfig, private url: ObjUrlDto) {} async execute(): Promise { - const pageSnapshot = await new ContentPageSnapshotCreateCommand( - this.settings, - this.url, - document.body, - [], - undefined - ).execute(); - await new PageSnapshotAddCommand(pageSnapshot, ObjTypeDto.PageSnapshot).execute(); + if (this.url.href.endsWith('.pdf')) { + await new ContentPdfSaveCommand(this.url).execute(); + await BrowserApi.sendRuntimeMessage({ type: BusMessageType.POPUP_PAGE_SNAPSHOT_ADD }); + } else { + const pageSnapshot = await new ContentPageSnapshotCreateCommand( + this.settings, + this.url, + document.body, + [], + undefined + ).execute(); + await new PageSnapshotAddCommand(pageSnapshot, ObjTypeDto.PageSnapshot).execute(); - await BrowserApi.sendRuntimeMessage({ type: BusMessageType.POPUP_PAGE_SNAPSHOT_ADD }); - PinStore.each((v) => v.show()); + await BrowserApi.sendRuntimeMessage({ type: BusMessageType.POPUP_PAGE_SNAPSHOT_ADD }); + PinStore.each((v) => v.show()); + } } } diff --git a/src/content-script/command/snapshot/content-pdf-save.command.ts b/src/content-script/command/snapshot/content-pdf-save.command.ts new file mode 100644 index 0000000..8e9efd2 --- /dev/null +++ b/src/content-script/command/snapshot/content-pdf-save.command.ts @@ -0,0 +1,25 @@ +import { BrowserApi } from '@pinmenote/browser-api'; +import { BusMessageType } from '../../../common/model/bus.model'; +import { FetchPDFRequest } from '../../../common/model/obj-request.model'; +import { FetchResponse } from '@pinmenote/fetch-service'; +import { ICommand } from '../../../common/model/shared/common.dto'; +import { ObjUrlDto } from '../../../common/model/obj/obj.dto'; +import { TinyDispatcher } from '@pinmenote/tiny-dispatcher'; +import { fnConsoleLog } from '../../../common/fn/fn-console'; + +export class ContentPdfSaveCommand implements ICommand> { + constructor(private url: ObjUrlDto) {} + async execute(): Promise { + const data: FetchPDFRequest = { url: this.url.href }; + TinyDispatcher.getInstance().addListener>( + BusMessageType.CONTENT_FETCH_PDF, + (event, key, value) => { + if (value.url === this.url.href) { + TinyDispatcher.getInstance().removeListener(event, key); + fnConsoleLog('GOT PDF BUT MAYBE JUST SAVE IT INSIDE SERVICE WORKER!!!', value); + } + } + ); + await BrowserApi.sendRuntimeMessage({ type: BusMessageType.CONTENT_FETCH_PDF, data }); + } +} diff --git a/src/content-script/content-message.handler.ts b/src/content-script/content-message.handler.ts index 4a49bc2..2476628 100644 --- a/src/content-script/content-message.handler.ts +++ b/src/content-script/content-message.handler.ts @@ -40,7 +40,7 @@ export class ContentMessageHandler { this.iframe = iframe; this.uid = uid; BrowserApi.runtime.onMessage.addListener(this.handleMessage); - TinyDispatcher.addListener(BusMessageType.POPUP_OPEN, this.handlePopupOpen); + TinyDispatcher.getInstance().addListener(BusMessageType.POPUP_OPEN, this.handlePopupOpen); } static updateHref(href: string): void { @@ -60,7 +60,7 @@ export class ContentMessageHandler { runtime: BrowserGlobalSender, sendResponse: (response: BusMessage) => void ): Promise => { - // fnConsoleLog('ContentMessageHandler->handleMessage', this.href, msg); + fnConsoleLog('ContentMessageHandler->handleMessage', this.href, msg, this.iframe); sendResponse({ type: BusMessageType.CONTENT_ACK }); @@ -69,7 +69,6 @@ export class ContentMessageHandler { case BusMessageType.IFRAME_INDEX_REGISTER: case BusMessageType.IFRAME_PIN_SEND: case BusMessageType.IFRAME_PIN_SHOW: - case PageComputeMessage.IFRAME_PING: case BusMessageType.IFRAME_START_LISTENERS: case BusMessageType.IFRAME_START_LISTENERS_RESULT: case BusMessageType.IFRAME_STOP_LISTENERS: @@ -106,7 +105,7 @@ export class ContentMessageHandler { new PinVisibleCommand(msg.data).execute(); break; default: - TinyDispatcher.dispatch(msg.type, msg.data); + TinyDispatcher.getInstance().dispatch(msg.type, msg.data); break; } }; diff --git a/src/content-script/content-script.ts b/src/content-script/content-script.ts index 29f160a..a7d17ab 100644 --- a/src/content-script/content-script.ts +++ b/src/content-script/content-script.ts @@ -47,12 +47,12 @@ class PinMeScript { document.addEventListener('visibilitychange', this.handleVisibilityChange); - TinyDispatcher.addListener(BusMessageType.CNT_SETTINGS, this.handlePinSettings); - TinyDispatcher.dispatch(BusMessageType.CNT_SETTINGS, {}); + TinyDispatcher.getInstance().addListener(BusMessageType.CNT_SETTINGS, this.handlePinSettings); + TinyDispatcher.getInstance().dispatch(BusMessageType.CNT_SETTINGS, {}); } private handlePinSettings = async (event: string, key: string): Promise => { - TinyDispatcher.removeListener(event, key); + TinyDispatcher.getInstance().removeListener(event, key); await ContentSettingsStore.initSettings(); @@ -106,7 +106,7 @@ class PinMeScript { private cleanup(): void { document.removeEventListener('visibilitychange', this.handleVisibilityChange); - TinyDispatcher.cleanup(); + TinyDispatcher.getInstance().cleanup(); DocumentMediator.stopListeners(); PinStore.clear(); ContentMessageHandler.cleanup(); diff --git a/src/content-script/iframe-message.handler.ts b/src/content-script/iframe-message.handler.ts index 6264c32..4b0b6a4 100644 --- a/src/content-script/iframe-message.handler.ts +++ b/src/content-script/iframe-message.handler.ts @@ -47,7 +47,7 @@ export class IFrameMessageHandler { if (iframe && msg.data.uid === uid && href) { await new ContentFetchIframeCommand(href, uid, msg.data.depth).execute(); } else { - TinyDispatcher.dispatch(msg.type, msg.data); + TinyDispatcher.getInstance().dispatch(msg.type, msg.data); } break; } @@ -66,12 +66,6 @@ export class IFrameMessageHandler { IFrameStore.resumeListeners(msg.data); break; } - case PageComputeMessage.IFRAME_PING: { - if (iframe && msg.data.uid === uid) { - await BrowserApi.sendRuntimeMessage({ type: PageComputeMessage.IFRAME_PING_RESULT, data: msg.data }); - } - break; - } case BusMessageType.IFRAME_PIN_SEND: { const index = fnIframeIndex(); if (msg.data.data.data.iframe && index === msg.data.data.data.iframe.index) { @@ -86,7 +80,7 @@ export class IFrameMessageHandler { break; } default: - TinyDispatcher.dispatch(msg.type, msg.data); + TinyDispatcher.getInstance().dispatch(msg.type, msg.data); break; } }; diff --git a/src/content-script/mediator/document.mediator.ts b/src/content-script/mediator/document.mediator.ts index 97ceeaf..c92c6fd 100644 --- a/src/content-script/mediator/document.mediator.ts +++ b/src/content-script/mediator/document.mediator.ts @@ -75,13 +75,13 @@ export class DocumentMediator { } fnConsoleLog('DocumentMediator->startIframeListeners', msg, this.baseUrl, this.iframe); - const key = TinyDispatcher.addListener( + const key = TinyDispatcher.getInstance().addListener( BusMessageType.IFRAME_START_LISTENERS_RESULT, (event, key, value) => { if (msg.uid === value.uid) { fnConsoleLog('DocumentMediator->startIframeListeners->IFRAME_START_LISTENERS_RESULT'); clearTimeout(timeout); - TinyDispatcher.removeListener(event, key); + TinyDispatcher.getInstance().removeListener(event, key); this.stopListeners(false); this.startingIframeListeners = false; IFrameStore.passListeners(msg); @@ -102,7 +102,7 @@ export class DocumentMediator { const timeout = setTimeout(() => { fnConsoleLog('DocumentMediator->startIframeListeners->timeout'); this.startingIframeListeners = false; - TinyDispatcher.removeListener(BusMessageType.IFRAME_START_LISTENERS_RESULT, key); + TinyDispatcher.getInstance().removeListener(BusMessageType.IFRAME_START_LISTENERS_RESULT, key); }, 1000); } diff --git a/src/default-popup/components/account/account-details.component.tsx b/src/default-popup/components/account/account-details.component.tsx index 4816cde..ac42574 100644 --- a/src/default-popup/components/account/account-details.component.tsx +++ b/src/default-popup/components/account/account-details.component.tsx @@ -41,17 +41,17 @@ export const AccountDetailsComponent: FunctionComponent(PopupTokenStore.token.access_token)); } - const loginSuccessKey = TinyDispatcher.addListener( + const loginSuccessKey = TinyDispatcher.getInstance().addListener( BusMessageType.POPUP_LOGIN_SUCCESS, async (event, key, value) => { - TinyDispatcher.removeListener(event, key); + TinyDispatcher.getInstance().removeListener(event, key); await PopupTokenStore.init(); if (PopupTokenStore.token) setTokenData(jwtDecode(PopupTokenStore.token.access_token)); // TODO upload keys ??? LogManager.log(`${JSON.stringify(value)}`); } ); - const logoutKey = TinyDispatcher.addListener>( + const logoutKey = TinyDispatcher.getInstance().addListener>( BusMessageType.POPUP_LOGOUT, (event, key, value) => { LogManager.log('POPUP_LOGOUT_RESPONSE'); @@ -63,8 +63,8 @@ export const AccountDetailsComponent: FunctionComponent { - TinyDispatcher.removeListener(BusMessageType.POPUP_LOGIN_SUCCESS, loginSuccessKey); - TinyDispatcher.removeListener(BusMessageType.POPUP_LOGOUT, logoutKey); + TinyDispatcher.getInstance().removeListener(BusMessageType.POPUP_LOGIN_SUCCESS, loginSuccessKey); + TinyDispatcher.getInstance().removeListener(BusMessageType.POPUP_LOGOUT, logoutKey); }; }, []); diff --git a/src/default-popup/components/account/login.component.tsx b/src/default-popup/components/account/login.component.tsx index 874c86a..7750ee2 100644 --- a/src/default-popup/components/account/login.component.tsx +++ b/src/default-popup/components/account/login.component.tsx @@ -51,7 +51,7 @@ export const LoginComponent: FunctionComponent = ({ loginSu const [responseError, setResponseError] = useState(undefined); useEffect(() => { - const loginKey = TinyDispatcher.addListener>( + const loginKey = TinyDispatcher.getInstance().addListener>( BusMessageType.POPUP_LOGIN, (event, key, value) => { LogManager.log(`POPUP_LOGIN: ${JSON.stringify(value)}`); @@ -63,7 +63,7 @@ export const LoginComponent: FunctionComponent = ({ loginSu } ); return () => { - TinyDispatcher.removeListener(BusMessageType.POPUP_LOGIN, loginKey); + TinyDispatcher.getInstance().removeListener(BusMessageType.POPUP_LOGIN, loginKey); }; }, []); diff --git a/src/default-popup/components/account/verify-2fa.component.tsx b/src/default-popup/components/account/verify-2fa.component.tsx index 0a03562..60b6d61 100644 --- a/src/default-popup/components/account/verify-2fa.component.tsx +++ b/src/default-popup/components/account/verify-2fa.component.tsx @@ -51,7 +51,7 @@ export const Verify2faComponent: FunctionComponent = ({ const [responseError, setResponseError] = useState(undefined); useEffect(() => { - const loginKey = TinyDispatcher.addListener>( + const loginKey = TinyDispatcher.getInstance().addListener>( BusMessageType.POPUP_VERIFY_2FA, (event, key, value) => { LogManager.log(`POPUP_LOGIN: ${JSON.stringify(value)}`); @@ -63,7 +63,7 @@ export const Verify2faComponent: FunctionComponent = ({ } ); return () => { - TinyDispatcher.removeListener(BusMessageType.POPUP_VERIFY_2FA, loginKey); + TinyDispatcher.getInstance().removeListener(BusMessageType.POPUP_VERIFY_2FA, loginKey); }; }, []); diff --git a/src/default-popup/components/main/main-header.component.tsx b/src/default-popup/components/main/main-header.component.tsx index 8c87364..2dd932e 100644 --- a/src/default-popup/components/main/main-header.component.tsx +++ b/src/default-popup/components/main/main-header.component.tsx @@ -37,11 +37,14 @@ export const MainHeaderComponent: FunctionComponent = (pro const [isAdding, setIsAdding] = useState(PopupActiveTabStore.isAdding); useEffect(() => { - const addKey = TinyDispatcher.addListener(BusMessageType.POP_IS_ADDING, (event, key, value) => { - setIsAdding(value); - }); + const addKey = TinyDispatcher.getInstance().addListener( + BusMessageType.POP_IS_ADDING, + (event, key, value) => { + setIsAdding(value); + } + ); return () => { - TinyDispatcher.removeListener(BusMessageType.POP_IS_ADDING, addKey); + TinyDispatcher.getInstance().removeListener(BusMessageType.POP_IS_ADDING, addKey); }; }, []); const handleNewPin = async () => { diff --git a/src/default-popup/components/main/main-menu-list.component.tsx b/src/default-popup/components/main/main-menu-list.component.tsx index 4ef4f30..265ecd6 100644 --- a/src/default-popup/components/main/main-menu-list.component.tsx +++ b/src/default-popup/components/main/main-menu-list.component.tsx @@ -57,13 +57,13 @@ export const MainMenuListComponent: FunctionComponent = (props) const [isLoading, setIsLoading] = useState(IsLoadingType.None); const handleSavePageClick = async () => { - TinyDispatcher.addListener(BusMessageType.POPUP_PAGE_SNAPSHOT_ADD, (event, key) => { - TinyDispatcher.removeListener(event, key); + TinyDispatcher.getInstance().addListener(BusMessageType.POPUP_PAGE_SNAPSHOT_ADD, (event, key) => { + TinyDispatcher.getInstance().removeListener(event, key); setIsLoading(IsLoadingType.None); setTimeout(() => props.closeListCallback(MainViewEnum.PAGE_OBJECTS), 100); }); - await BrowserApi.sendTabMessage({ type: BusMessageType.POPUP_PAGE_SNAPSHOT_ADD, data: PopupActiveTabStore.url }); setIsLoading(IsLoadingType.PageSave); + await BrowserApi.sendTabMessage({ type: BusMessageType.POPUP_PAGE_SNAPSHOT_ADD, data: PopupActiveTabStore.url }); }; const handleSaveElementClick = async (): Promise => { diff --git a/src/default-popup/components/obj/obj-view.component.tsx b/src/default-popup/components/obj/obj-view.component.tsx index 6ca0967..17c4ab9 100644 --- a/src/default-popup/components/obj/obj-view.component.tsx +++ b/src/default-popup/components/obj/obj-view.component.tsx @@ -38,11 +38,11 @@ export const ObjViewComponent: FunctionComponent = (props) => (async () => { await initUrl(); })(); - const urlKey = TinyDispatcher.addListener(BusMessageType.POP_UPDATE_URL, async () => { + const urlKey = TinyDispatcher.getInstance().addListener(BusMessageType.POP_UPDATE_URL, async () => { await initUrl(); }); return () => { - TinyDispatcher.removeListener(BusMessageType.POP_UPDATE_URL, urlKey); + TinyDispatcher.getInstance().removeListener(BusMessageType.POP_UPDATE_URL, urlKey); }; }, []); diff --git a/src/default-popup/components/obj/snapshot-list-element.component.tsx b/src/default-popup/components/obj/snapshot-list-element.component.tsx index 3e0f1c1..a773911 100644 --- a/src/default-popup/components/obj/snapshot-list-element.component.tsx +++ b/src/default-popup/components/obj/snapshot-list-element.component.tsx @@ -53,6 +53,16 @@ export const SnapshotListElement: FunctionComponent = setIsExpanded(!isExpanded); }; + const handleOpenPage = (data: ObjDto): void => { + if (BrowserApi.isChrome) { + BrowserApi.openOptionsPage(`#obj/${data.id}`); + } else { + // TODO change to BrowserApi 0.0.5 + window.open(`${browser.runtime.getManifest().options_ui?.page || ''}#obj/${data.id}`); + window.close(); + } + }; + const expandIcon = isExpanded ? ( ) : ( @@ -93,11 +103,7 @@ export const SnapshotListElement: FunctionComponent = justifyContent: 'flex-end' }} > - BrowserApi.openOptionsPage(`#obj/${props.obj.id}`)} - > + handleOpenPage(props.obj)}> handleNavigate(props.obj)}> diff --git a/src/default-popup/components/tabs/logs-tab.component.tsx b/src/default-popup/components/tabs/logs-tab.component.tsx index 5745bdd..74303d2 100644 --- a/src/default-popup/components/tabs/logs-tab.component.tsx +++ b/src/default-popup/components/tabs/logs-tab.component.tsx @@ -28,11 +28,14 @@ export const LogsTabComponent: FunctionComponent = () => { useEffect(() => { if (ref.current) ref.current.innerHTML = LogManager.logs; - const key = TinyDispatcher.addListener(BusMessageType.POP_CONSOLE_LOG, (event, key, value) => { - if (ref.current) ref.current.innerHTML = value; - }); + const key = TinyDispatcher.getInstance().addListener( + BusMessageType.POP_CONSOLE_LOG, + (event, key, value) => { + if (ref.current) ref.current.innerHTML = value; + } + ); return () => { - TinyDispatcher.removeListener(BusMessageType.POP_CONSOLE_LOG, key); + TinyDispatcher.getInstance().removeListener(BusMessageType.POP_CONSOLE_LOG, key); }; }, []); diff --git a/src/default-popup/components/tabs/main-tab.component.tsx b/src/default-popup/components/tabs/main-tab.component.tsx index 5bc5a43..008139a 100644 --- a/src/default-popup/components/tabs/main-tab.component.tsx +++ b/src/default-popup/components/tabs/main-tab.component.tsx @@ -25,11 +25,11 @@ export const MainTabComponent: FunctionComponent = () => { const [isError, setIsError] = useState(PopupActiveTabStore.showErrorText); useEffect(() => { - const urlKey = TinyDispatcher.addListener(BusMessageType.POP_UPDATE_URL, () => { + const urlKey = TinyDispatcher.getInstance().addListener(BusMessageType.POP_UPDATE_URL, () => { setIsError(PopupActiveTabStore.showErrorText); }); return () => { - TinyDispatcher.removeListener(BusMessageType.POP_UPDATE_URL, urlKey); + TinyDispatcher.getInstance().removeListener(BusMessageType.POP_UPDATE_URL, urlKey); }; }, []); diff --git a/src/default-popup/popup-message.handler.ts b/src/default-popup/popup-message.handler.ts index 366a6a2..29632a6 100644 --- a/src/default-popup/popup-message.handler.ts +++ b/src/default-popup/popup-message.handler.ts @@ -34,7 +34,7 @@ export class PopupMessageHandler { } private static popupInitListener(): void { - TinyDispatcher.addListener(BusMessageType.POPUP_INIT, (event, key, value) => { + TinyDispatcher.getInstance().addListener(BusMessageType.POPUP_INIT, (event, key, value) => { PopupActiveTabStore.updateState(value); }); } @@ -50,6 +50,6 @@ export class PopupMessageHandler { // Skip not owned messages if (runtime.id !== BrowserApi.runtime.id) return; - TinyDispatcher.dispatch(msg.type, msg.data); + TinyDispatcher.getInstance().dispatch(msg.type, msg.data); }; } diff --git a/src/default-popup/store/popup-active-tab.store.ts b/src/default-popup/store/popup-active-tab.store.ts index 10912da..9891db9 100644 --- a/src/default-popup/store/popup-active-tab.store.ts +++ b/src/default-popup/store/popup-active-tab.store.ts @@ -69,7 +69,7 @@ export class PopupActiveTabStore { } else if (this.urlValue?.href.startsWith(BrowserApi.disabledUrl)) { this.isError = true; } - TinyDispatcher.dispatch(BusMessageType.POP_UPDATE_URL); + TinyDispatcher.getInstance().dispatch(BusMessageType.POP_UPDATE_URL); } }; @@ -77,7 +77,7 @@ export class PopupActiveTabStore { LogManager.log(`PopupActiveTabStore->INIT - ${JSON.stringify(initData || {})}`); if (initData?.isAdding) { this.isAddingValue = true; - TinyDispatcher.dispatch(BusMessageType.POP_IS_ADDING, this.isAddingValue); + TinyDispatcher.getInstance().dispatch(BusMessageType.POP_IS_ADDING, this.isAddingValue); } }; } diff --git a/src/iframe/iframe-script.ts b/src/iframe/iframe-script.ts index d890cac..3e34dd8 100644 --- a/src/iframe/iframe-script.ts +++ b/src/iframe/iframe-script.ts @@ -46,12 +46,12 @@ export class IframeScript { document.addEventListener('visibilitychange', this.handleVisibilityChange); document.addEventListener('mouseout', this.handleMouseOut); - TinyDispatcher.addListener(BusMessageType.CNT_SETTINGS, this.handlePinSettings); - TinyDispatcher.dispatch(BusMessageType.CNT_SETTINGS, {}); + TinyDispatcher.getInstance().addListener(BusMessageType.CNT_SETTINGS, this.handlePinSettings); + TinyDispatcher.getInstance().dispatch(BusMessageType.CNT_SETTINGS, {}); } private handlePinSettings = async (event: string, key: string): Promise => { - TinyDispatcher.removeListener(event, key); + TinyDispatcher.getInstance().removeListener(event, key); await ContentSettingsStore.initSettings(); }; @@ -91,7 +91,7 @@ export class IframeScript { private cleanup(): void { document.removeEventListener('visibilitychange', this.handleVisibilityChange); document.removeEventListener('mouseout', this.handleMouseOut); - TinyDispatcher.cleanup(); + TinyDispatcher.getInstance().cleanup(); DocumentMediator.stopListeners(); ContentMessageHandler.cleanup(); clearTimeout(this.timeoutId); diff --git a/src/options-ui/options-message.handler.ts b/src/options-ui/options-message.handler.ts index d71e7ad..866feb0 100644 --- a/src/options-ui/options-message.handler.ts +++ b/src/options-ui/options-message.handler.ts @@ -23,7 +23,7 @@ import { fnConsoleLog } from '../common/fn/fn-console'; export class OptionsMessageHandler { static init(): void { BrowserApi.runtime.onMessage.addListener(this.handleRemoteMessage); - TinyDispatcher.addListener(BusMessageType.POPUP_OPEN, this.handlePopupOpen); + TinyDispatcher.getInstance().addListener(BusMessageType.POPUP_OPEN, this.handlePopupOpen); } private static handleRemoteMessage = ( @@ -35,7 +35,7 @@ export class OptionsMessageHandler { sendResponse({ type: BusMessageType.CONTENT_ACK }); - TinyDispatcher.dispatch(msg.type, msg.data); + TinyDispatcher.getInstance().dispatch(msg.type, msg.data); }; private static handlePopupOpen = async (): Promise => { diff --git a/src/service-worker/command/content/content-fetch-image.command.ts b/src/service-worker/command/content/content-fetch-image.command.ts index cf542a1..9c2213a 100644 --- a/src/service-worker/command/content/content-fetch-image.command.ts +++ b/src/service-worker/command/content/content-fetch-image.command.ts @@ -26,7 +26,7 @@ export class ContentFetchImageCommand implements ICommand> { constructor(private req: FetchImageRequest) {} async execute(): Promise { try { - // fnConsoleLog('ContentFetchImageCommand->execute', this.req.url); + fnConsoleLog('ContentFetchImageCommand->execute', this.req.url); const req = await FetchService.fetch(this.req.url, { type: 'BLOB' }); diff --git a/src/service-worker/command/content/content-fetch-pdf.command.ts b/src/service-worker/command/content/content-fetch-pdf.command.ts new file mode 100644 index 0000000..efa7e28 --- /dev/null +++ b/src/service-worker/command/content/content-fetch-pdf.command.ts @@ -0,0 +1,54 @@ +/* + * This file is part of the pinmenote-extension distribution (https://github.com/pinmenote/pinmenote-extension). + * Copyright (c) 2023 Michal Szczepanski. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +import { FetchResponse, FetchService } from '@pinmenote/fetch-service'; +import { BrowserApi } from '@pinmenote/browser-api'; +import { BusMessageType } from '../../../common/model/bus.model'; +import { FetchPDFRequest } from '../../../common/model/obj-request.model'; +import { ICommand } from '../../../common/model/shared/common.dto'; +import { UrlFactory } from '../../../common/factory/url.factory'; +import { fnConsoleLog } from '../../../common/fn/fn-console'; + +export class ContentFetchPDFCommand implements ICommand> { + constructor(private req: FetchPDFRequest) {} + async execute(): Promise { + try { + // fnConsoleLog('ContentFetchImageCommand->execute', this.req.url); + const req = await FetchService.fetch(this.req.url, { + type: 'BLOB' + }); + const data = await UrlFactory.toDataUri(req.data); + const ok = req.ok; + fnConsoleLog('ContentFetchImageCommand->result', this.req.url, data); + await BrowserApi.sendTabMessage>({ + type: BusMessageType.CONTENT_FETCH_PDF, + data: { data, ok, url: req.url, status: req.status, type: req.type } + }); + } catch (e) { + fnConsoleLog('ContentFetchImageCommand->ERROR', e, this.req.url); + await BrowserApi.sendTabMessage>({ + type: BusMessageType.CONTENT_FETCH_PDF, + data: { + url: this.req.url, + ok: false, + status: 500, + type: 'BLOB', + data: '' + } + }); + } + } +} diff --git a/src/service-worker/service-worker.ts b/src/service-worker/service-worker.ts index e6b6002..0afdc5e 100644 --- a/src/service-worker/service-worker.ts +++ b/src/service-worker/service-worker.ts @@ -19,6 +19,7 @@ import { BusMessageType } from '../common/model/bus.model'; import { ContentDownloadDataCommand } from './command/content/content-download-data.command'; import { ContentFetchCssCommand } from './command/content/content-fetch-css.command'; import { ContentFetchImageCommand } from './command/content/content-fetch-image.command'; +import { ContentFetchPDFCommand } from './command/content/content-fetch-pdf.command'; import { ContentInvalidateCommand } from './command/content/content-invalidate.command'; import { ContentPinStopCommand } from './command/content/content-pin-stop.command'; import { ContentTakeScreenshotCommand } from './command/content/content-take-screenshot.command'; @@ -69,6 +70,9 @@ const handleMessage = async ( case PageComputeMessage.CONTENT_FETCH_IMAGE: await new ContentFetchImageCommand(msg.data).execute(); break; + case BusMessageType.CONTENT_FETCH_PDF: + await new ContentFetchPDFCommand(msg.data).execute(); + break; case BusMessageType.POPUP_LOGIN: await new PopupLoginCommand(msg.data).execute(); break; @@ -92,8 +96,6 @@ const handleMessage = async ( case BusMessageType.IFRAME_MOUSE_OUT: case BusMessageType.IFRAME_PIN_SEND: case BusMessageType.IFRAME_PIN_SHOW: - case PageComputeMessage.IFRAME_PING: - case PageComputeMessage.IFRAME_PING_RESULT: case PageComputeMessage.IFRAME_FETCH: case PageComputeMessage.IFRAME_FETCH_RESULT: { await new IframePassMessageCommand(msg).execute(); diff --git a/tsconfig.json b/tsconfig.json index 5ee4bf7..2810df3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "es5", + "target": "es2015", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true,