From c769432993b4eddeeab61a587e20dd37703fee28 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Apr 2025 20:07:07 -0700 Subject: [PATCH 01/59] chore(deps): bump mammoth from 1.8.0 to 1.9.0 (#8900) Bumps [mammoth](https://github.com/mwilliamson/mammoth.js) from 1.8.0 to 1.9.0. - [Release notes](https://github.com/mwilliamson/mammoth.js/releases) - [Changelog](https://github.com/mwilliamson/mammoth.js/blob/master/NEWS) - [Commits](https://github.com/mwilliamson/mammoth.js/compare/1.8.0...1.9.0) --- updated-dependencies: - dependency-name: mammoth dependency-version: 1.9.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index ddf8dcf2ad..2843818174 100644 --- a/package.json +++ b/package.json @@ -153,7 +153,7 @@ "koa-useragent": "^4.1.0", "lodash": "^4.17.21", "mailparser": "^3.7.2", - "mammoth": "^1.8.0", + "mammoth": "^1.9.0", "markdown-it": "^13.0.2", "markdown-it-container": "^3.0.0", "markdown-it-emoji": "^2.0.0", diff --git a/yarn.lock b/yarn.lock index 77a935b751..fbb978e71f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11618,10 +11618,10 @@ loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3 dependencies: js-tokens "^3.0.0 || ^4.0.0" -lop@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/lop/-/lop-0.4.1.tgz#744f1696ef480e68ce1947fe557b09db5af2a738" - integrity "sha1-dE8Wlu9IDmjOGUf+VXsJ21rypzg= sha512-9xyho9why2A2tzm5aIcMWKvzqKsnxrf9B5I+8O30olh6lQU8PH978LqZoI4++37RBgS1Em5i54v1TFs/3wnmXQ==" +lop@^0.4.2: + version "0.4.2" + resolved "https://registry.yarnpkg.com/lop/-/lop-0.4.2.tgz#c9c2f958a39b9da1c2f36ca9ad66891a9fe84640" + integrity sha512-RefILVDQ4DKoRZsJ4Pj22TxE3omDO47yFpkIBoDKzkqPRISs5U1cnAdg/5583YPkWPaLIYHOKRMQSvjFsO26cw== dependencies: duck "^0.1.12" option "~0.2.1" @@ -11737,10 +11737,10 @@ makeerror@1.0.12: dependencies: tmpl "1.0.5" -mammoth@^1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/mammoth/-/mammoth-1.8.0.tgz#d8f1b0d3a0355fda129270346e9dc853f223028f" - integrity sha512-pJNfxSk9IEGVpau+tsZFz22ofjUsl2mnA5eT8PjPs2n0BP+rhVte4Nez6FdgEuxv3IGI3afiV46ImKqTGDVlbA== +mammoth@^1.9.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/mammoth/-/mammoth-1.9.0.tgz#71e34ca280735275788bfe95e653a058dcab4df2" + integrity sha512-F+0NxzankQV9XSUAuVKvkdQK0GbtGGuqVnND9aVf9VSeUA82LQa29GjLqYU6Eez8LHqSJG3eGiDW3224OKdpZg== dependencies: "@xmldom/xmldom" "^0.8.6" argparse "~1.0.3" @@ -11748,7 +11748,7 @@ mammoth@^1.8.0: bluebird "~3.4.0" dingbat-to-unicode "^1.0.1" jszip "^3.7.1" - lop "^0.4.1" + lop "^0.4.2" path-is-absolute "^1.0.0" underscore "^1.13.1" xmlbuilder "^10.0.0" From a4040a93a298ece279b629b039658736e2894022 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Apr 2025 20:07:17 -0700 Subject: [PATCH 02/59] chore(deps-dev): bump @types/node from 20.17.27 to 20.17.30 (#8898) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.17.27 to 20.17.30. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-version: 20.17.30 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 2843818174..6099e697c3 100644 --- a/package.json +++ b/package.json @@ -296,7 +296,7 @@ "@types/markdown-it-emoji": "^2.0.4", "@types/mime-types": "^2.1.4", "@types/natural-sort": "^0.0.24", - "@types/node": "20.17.27", + "@types/node": "20.17.30", "@types/node-fetch": "^2.6.9", "@types/nodemailer": "^6.4.17", "@types/passport-oauth2": "^1.4.17", diff --git a/yarn.lock b/yarn.lock index fbb978e71f..ab8051f22f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5315,10 +5315,10 @@ "@types/node" "*" form-data "^4.0.0" -"@types/node@*", "@types/node@20.17.27", "@types/node@>=10.0.0", "@types/node@>=13.7.0": - version "20.17.27" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.17.27.tgz#dbf0f9e6f905e9004045742f94e8413e20bad776" - integrity sha512-U58sbKhDrthHlxHRJw7ZLiLDZGmAUOZUbpw0S6nL27sYUdhvgBLCRu/keSd6qcTsfArd1sRFCCBxzWATGr/0UA== +"@types/node@*", "@types/node@20.17.30", "@types/node@>=10.0.0", "@types/node@>=13.7.0": + version "20.17.30" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.17.30.tgz#1d93f656d3b869dbef7b796568ac457606ba58d0" + integrity sha512-7zf4YyHA+jvBNfVrk2Gtvs6x7E8V+YDW05bNfG2XkWDJfYRXrTiP/DsB2zSYTaHX0bGIujTBQdMVAhb+j7mwpg== dependencies: undici-types "~6.19.2" From d300e34447b986c76c31f791140c36929f0141a1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Apr 2025 20:07:38 -0700 Subject: [PATCH 03/59] chore(deps): bump prosemirror-inputrules from 1.4.0 to 1.5.0 (#8897) Bumps [prosemirror-inputrules](https://github.com/prosemirror/prosemirror-inputrules) from 1.4.0 to 1.5.0. - [Changelog](https://github.com/ProseMirror/prosemirror-inputrules/blob/master/CHANGELOG.md) - [Commits](https://github.com/prosemirror/prosemirror-inputrules/compare/1.4.0...1.5.0) --- updated-dependencies: - dependency-name: prosemirror-inputrules dependency-version: 1.5.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 6099e697c3..0dc904e4a2 100644 --- a/package.json +++ b/package.json @@ -183,7 +183,7 @@ "prosemirror-dropcursor": "^1.8.1", "prosemirror-gapcursor": "^1.3.2", "prosemirror-history": "^1.4.1", - "prosemirror-inputrules": "^1.4.0", + "prosemirror-inputrules": "^1.5.0", "prosemirror-keymap": "^1.2.2", "prosemirror-markdown": "^1.13.2", "prosemirror-model": "^1.25.0", diff --git a/yarn.lock b/yarn.lock index ab8051f22f..784fe2dc0a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13090,10 +13090,10 @@ prosemirror-history@^1.4.1: prosemirror-view "^1.31.0" rope-sequence "^1.3.0" -prosemirror-inputrules@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/prosemirror-inputrules/-/prosemirror-inputrules-1.4.0.tgz#ef1519bb2cb0d1e0cec74bad1a97f1c1555068bb" - integrity sha512-6ygpPRuTJ2lcOXs9JkefieMst63wVJBgHZGl5QOytN7oSZs3Co/BYbc3Yx9zm9H37Bxw8kVzCnDsihsVsL4yEg== +prosemirror-inputrules@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/prosemirror-inputrules/-/prosemirror-inputrules-1.5.0.tgz#e22bfaf1d6ea4fe240ad447c184af3d520d43c37" + integrity sha512-K0xJRCmt+uSw7xesnHmcn72yBGTbY45vm8gXI4LZXbx2Z0jwh5aF9xrGQgrVPu0WbyFVFF3E/o9VhJYz6SQWnA== dependencies: prosemirror-state "^1.0.0" prosemirror-transform "^1.0.0" From 5659aeb360b811b5ed3326f23c27b68c30f21c23 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Apr 2025 10:35:10 -0400 Subject: [PATCH 04/59] chore(deps): bump vite from 5.4.16 to 5.4.17 (#8903) Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.16 to 5.4.17. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/v5.4.17/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v5.4.17/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-version: 5.4.17 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 0dc904e4a2..f4bd0a1b13 100644 --- a/package.json +++ b/package.json @@ -248,7 +248,7 @@ "uuid": "^8.3.2", "validator": "13.12.0", "vaul": "^1.1.2", - "vite": "^5.4.16", + "vite": "^5.4.17", "vite-plugin-pwa": "^0.20.3", "winston": "^3.17.0", "ws": "^7.5.10", diff --git a/yarn.lock b/yarn.lock index 784fe2dc0a..2cbff2bee2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15610,10 +15610,10 @@ vite-plugin-static-copy@^0.17.0: fs-extra "^11.1.0" picocolors "^1.0.0" -vite@^5.4.16: - version "5.4.16" - resolved "https://registry.yarnpkg.com/vite/-/vite-5.4.16.tgz#471983257a890ef33f2700cbbbc2134f2d08abf1" - integrity sha512-Y5gnfp4NemVfgOTDQAunSD4346fal44L9mszGGY/e+qxsRT5y1sMlS/8tiQ8AFAp+MFgYNSINdfEchJiPm41vQ== +vite@^5.4.17: + version "5.4.17" + resolved "https://registry.yarnpkg.com/vite/-/vite-5.4.17.tgz#4bf61dd4cdbf64b0d6661f5dba76954cc81d5082" + integrity sha512-5+VqZryDj4wgCs55o9Lp+p8GE78TLVg0lasCH5xFZ4jacZjtqZa6JUw9/p0WeAojaOfncSM6v77InkFPGnvPvg== dependencies: esbuild "^0.21.3" postcss "^8.4.43" From 01a5ff031aef97f76a6b6066fc29333828964d64 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Apr 2025 10:38:45 -0400 Subject: [PATCH 05/59] chore(deps): bump sonner from 1.7.1 to 1.7.4 (#8896) Bumps [sonner](https://github.com/emilkowalski/sonner) from 1.7.1 to 1.7.4. - [Release notes](https://github.com/emilkowalski/sonner/releases) - [Commits](https://github.com/emilkowalski/sonner/commits) --- updated-dependencies: - dependency-name: sonner dependency-version: 1.7.4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f4bd0a1b13..e17264c1c9 100644 --- a/package.json +++ b/package.json @@ -232,7 +232,7 @@ "socket.io": "^4.8.1", "socket.io-client": "^4.8.1", "socket.io-redis": "^6.1.1", - "sonner": "^1.7.1", + "sonner": "^1.7.4", "stoppable": "^1.1.0", "string-replace-to-array": "^2.1.1", "styled-components": "^5.3.11", diff --git a/yarn.lock b/yarn.lock index 2cbff2bee2..05b77186d0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14378,10 +14378,10 @@ socket.io@^4.8.1: socket.io-adapter "~2.5.2" socket.io-parser "~4.2.4" -sonner@^1.7.1: - version "1.7.1" - resolved "https://registry.yarnpkg.com/sonner/-/sonner-1.7.1.tgz#737110a3e6211d8d766442076f852ddde1725205" - integrity sha512-b6LHBfH32SoVasRFECrdY8p8s7hXPDn3OHUFbZZbiB1ctLS9Gdh6rpX2dVrpQA0kiL5jcRzDDldwwLkSKk3+QQ== +sonner@^1.7.4: + version "1.7.4" + resolved "https://registry.yarnpkg.com/sonner/-/sonner-1.7.4.tgz#4c39820db86623800a17115c8970796aa862133a" + integrity sha512-DIS8z4PfJRbIyfVFDVnK9rO3eYDtse4Omcm6bt0oEr5/jtLgysmjuBl1frJ9E/EQZrFmKx2A8m/s5s9CRXIzhw== sort-keys@^5.0.0: version "5.0.0" From 9ce71338377696e9d5c9e190cd855b7b9c8c9dbf Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Tue, 8 Apr 2025 20:59:54 -0400 Subject: [PATCH 06/59] fix: Increase lock timeout for calculating document diff (#8902) --- .../templates/DocumentPublishedOrUpdatedEmail.tsx | 3 ++- server/utils/CacheHelper.ts | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/server/emails/templates/DocumentPublishedOrUpdatedEmail.tsx b/server/emails/templates/DocumentPublishedOrUpdatedEmail.tsx index 1192b54188..c09610033e 100644 --- a/server/emails/templates/DocumentPublishedOrUpdatedEmail.tsx +++ b/server/emails/templates/DocumentPublishedOrUpdatedEmail.tsx @@ -86,7 +86,8 @@ export default class DocumentPublishedOrUpdatedEmail extends BaseEmail< } return; }, - 30 + 30, + 10000 ); } diff --git a/server/utils/CacheHelper.ts b/server/utils/CacheHelper.ts index 825a3561be..9748ff16e1 100644 --- a/server/utils/CacheHelper.ts +++ b/server/utils/CacheHelper.ts @@ -18,11 +18,14 @@ export class CacheHelper { * @param key Cache key * @param callback Callback to get the data if not found in cache * @param expiry Cache data expiry in seconds + * @param lockTimeout Lock timeout in milliseconds + * @returns The data from cache or the result of the callback */ public static async getDataOrSet( key: string, callback: () => Promise, - expiry?: number + expiry: number, + lockTimeout: number = MutexLock.defaultLockTimeout ): Promise { let cache = await this.getData(key); @@ -35,10 +38,7 @@ export class CacheHelper { const lockKey = `lock:${key}`; try { try { - lock = await MutexLock.lock.acquire( - [lockKey], - MutexLock.defaultLockTimeout - ); + lock = await MutexLock.lock.acquire([lockKey], lockTimeout); } catch (err) { Logger.error(`Could not acquire lock for ${key}`, err); } From 0d09e547577967cd754a0a23b1e23ac51f3b95c6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Apr 2025 18:00:01 -0700 Subject: [PATCH 07/59] chore(deps): bump the aws group with 5 updates (#8899) Bumps the aws group with 5 updates: | Package | From | To | | --- | --- | --- | | [@aws-sdk/client-s3](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-s3) | `3.777.0` | `3.782.0` | | [@aws-sdk/lib-storage](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/lib/lib-storage) | `3.777.0` | `3.782.0` | | [@aws-sdk/s3-presigned-post](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/packages/s3-presigned-post) | `3.777.0` | `3.782.0` | | [@aws-sdk/s3-request-presigner](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/packages/s3-request-presigner) | `3.777.0` | `3.782.0` | | [@aws-sdk/signature-v4-crt](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/packages/signature-v4-crt) | `3.775.0` | `3.782.0` | Updates `@aws-sdk/client-s3` from 3.777.0 to 3.782.0 - [Release notes](https://github.com/aws/aws-sdk-js-v3/releases) - [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-s3/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.782.0/clients/client-s3) Updates `@aws-sdk/lib-storage` from 3.777.0 to 3.782.0 - [Release notes](https://github.com/aws/aws-sdk-js-v3/releases) - [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/lib/lib-storage/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.782.0/lib/lib-storage) Updates `@aws-sdk/s3-presigned-post` from 3.777.0 to 3.782.0 - [Release notes](https://github.com/aws/aws-sdk-js-v3/releases) - [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/s3-presigned-post/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.782.0/packages/s3-presigned-post) Updates `@aws-sdk/s3-request-presigner` from 3.777.0 to 3.782.0 - [Release notes](https://github.com/aws/aws-sdk-js-v3/releases) - [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/s3-request-presigner/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.782.0/packages/s3-request-presigner) Updates `@aws-sdk/signature-v4-crt` from 3.775.0 to 3.782.0 - [Release notes](https://github.com/aws/aws-sdk-js-v3/releases) - [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/signature-v4-crt/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.782.0/packages/signature-v4-crt) --- updated-dependencies: - dependency-name: "@aws-sdk/client-s3" dependency-version: 3.782.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: aws - dependency-name: "@aws-sdk/lib-storage" dependency-version: 3.782.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: aws - dependency-name: "@aws-sdk/s3-presigned-post" dependency-version: 3.782.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: aws - dependency-name: "@aws-sdk/s3-request-presigner" dependency-version: 3.782.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: aws - dependency-name: "@aws-sdk/signature-v4-crt" dependency-version: 3.782.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: aws ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 10 +-- yarn.lock | 185 +++++++++++++++++++++++++-------------------------- 2 files changed, 95 insertions(+), 100 deletions(-) diff --git a/package.json b/package.json index e17264c1c9..2108e971bb 100644 --- a/package.json +++ b/package.json @@ -48,11 +48,11 @@ "> 0.25%, not dead" ], "dependencies": { - "@aws-sdk/client-s3": "3.777.0", - "@aws-sdk/lib-storage": "3.777.0", - "@aws-sdk/s3-presigned-post": "3.777.0", - "@aws-sdk/s3-request-presigner": "3.777.0", - "@aws-sdk/signature-v4-crt": "^3.775.0", + "@aws-sdk/client-s3": "3.782.0", + "@aws-sdk/lib-storage": "3.782.0", + "@aws-sdk/s3-presigned-post": "3.782.0", + "@aws-sdk/s3-request-presigner": "3.782.0", + "@aws-sdk/signature-v4-crt": "^3.782.0", "@babel/core": "^7.26.10", "@babel/plugin-proposal-decorators": "^7.25.9", "@babel/plugin-transform-class-properties": "^7.25.9", diff --git a/yarn.lock b/yarn.lock index 05b77186d0..bac8c0446f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -105,16 +105,16 @@ "@smithy/util-utf8" "^2.0.0" tslib "^2.6.2" -"@aws-sdk/client-s3@3.777.0": - version "3.777.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/client-s3/-/client-s3-3.777.0.tgz#50e14ced9c1667b14c7dea79b4cc19cd58c58916" - integrity sha512-KVX2QD6lLczZxtzIRCpmztgNnGq+spiMIDYqkum/rCBjCX1YJoDHwMYXaMf2EtAH8tFkJmBiA/CiT/J36iN7Xg== +"@aws-sdk/client-s3@3.782.0": + version "3.782.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/client-s3/-/client-s3-3.782.0.tgz#ed807a1cd9a3e7a55bf41dfb486da0bbd1f4852d" + integrity sha512-V6JR2JAGYQY7J8wk5un5n/ja2nfCUyyoRCF8Du8JL91NGI8i41Mdr/TzuOGwTgFl6RSXb/ge1K1jk30OH4MugQ== dependencies: "@aws-crypto/sha1-browser" "5.2.0" "@aws-crypto/sha256-browser" "5.2.0" "@aws-crypto/sha256-js" "5.2.0" "@aws-sdk/core" "3.775.0" - "@aws-sdk/credential-provider-node" "3.777.0" + "@aws-sdk/credential-provider-node" "3.782.0" "@aws-sdk/middleware-bucket-endpoint" "3.775.0" "@aws-sdk/middleware-expect-continue" "3.775.0" "@aws-sdk/middleware-flexible-checksums" "3.775.0" @@ -124,13 +124,13 @@ "@aws-sdk/middleware-recursion-detection" "3.775.0" "@aws-sdk/middleware-sdk-s3" "3.775.0" "@aws-sdk/middleware-ssec" "3.775.0" - "@aws-sdk/middleware-user-agent" "3.775.0" + "@aws-sdk/middleware-user-agent" "3.782.0" "@aws-sdk/region-config-resolver" "3.775.0" "@aws-sdk/signature-v4-multi-region" "3.775.0" "@aws-sdk/types" "3.775.0" - "@aws-sdk/util-endpoints" "3.775.0" + "@aws-sdk/util-endpoints" "3.782.0" "@aws-sdk/util-user-agent-browser" "3.775.0" - "@aws-sdk/util-user-agent-node" "3.775.0" + "@aws-sdk/util-user-agent-node" "3.782.0" "@aws-sdk/xml-builder" "3.775.0" "@smithy/config-resolver" "^4.1.0" "@smithy/core" "^3.2.0" @@ -167,10 +167,10 @@ "@smithy/util-waiter" "^4.0.3" tslib "^2.6.2" -"@aws-sdk/client-sso@3.777.0": - version "3.777.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/client-sso/-/client-sso-3.777.0.tgz#75582dad211497ab7e52ac2d51d7eb3e7954f5e6" - integrity sha512-0+z6CiAYIQa7s6FJ+dpBYPi9zr9yY5jBg/4/FGcwYbmqWPXwL9Thdtr0FearYRZgKl7bhL3m3dILCCfWqr3teQ== +"@aws-sdk/client-sso@3.782.0": + version "3.782.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/client-sso/-/client-sso-3.782.0.tgz#072cbb23a90ec6fd53145ff75bef8329a857f362" + integrity sha512-5GlJBejo8wqMpSSEKb45WE82YxI2k73YuebjLH/eWDNQeE6VI5Bh9lA1YQ7xNkLLH8hIsb0pSfKVuwh0VEzVrg== dependencies: "@aws-crypto/sha256-browser" "5.2.0" "@aws-crypto/sha256-js" "5.2.0" @@ -178,12 +178,12 @@ "@aws-sdk/middleware-host-header" "3.775.0" "@aws-sdk/middleware-logger" "3.775.0" "@aws-sdk/middleware-recursion-detection" "3.775.0" - "@aws-sdk/middleware-user-agent" "3.775.0" + "@aws-sdk/middleware-user-agent" "3.782.0" "@aws-sdk/region-config-resolver" "3.775.0" "@aws-sdk/types" "3.775.0" - "@aws-sdk/util-endpoints" "3.775.0" + "@aws-sdk/util-endpoints" "3.782.0" "@aws-sdk/util-user-agent-browser" "3.775.0" - "@aws-sdk/util-user-agent-node" "3.775.0" + "@aws-sdk/util-user-agent-node" "3.782.0" "@smithy/config-resolver" "^4.1.0" "@smithy/core" "^3.2.0" "@smithy/fetch-http-handler" "^5.0.2" @@ -255,18 +255,18 @@ "@smithy/util-stream" "^4.2.0" tslib "^2.6.2" -"@aws-sdk/credential-provider-ini@3.777.0": - version "3.777.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.777.0.tgz#bd508b1e8d421ac5009d7f756a826796817970d9" - integrity sha512-1X9mCuM9JSQPmQ+D2TODt4THy6aJWCNiURkmKmTIPRdno7EIKgAqrr/LLN++K5mBf54DZVKpqcJutXU2jwo01A== +"@aws-sdk/credential-provider-ini@3.782.0": + version "3.782.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.782.0.tgz#4ffd90f6b3b6b34d1dabcba875e5d00fc5da23f1" + integrity sha512-wd4KdRy2YjLsE4Y7pz00470Iip06GlRHkG4dyLW7/hFMzEO2o7ixswCWp6J2VGZVAX64acknlv2Q0z02ebjmhw== dependencies: "@aws-sdk/core" "3.775.0" "@aws-sdk/credential-provider-env" "3.775.0" "@aws-sdk/credential-provider-http" "3.775.0" "@aws-sdk/credential-provider-process" "3.775.0" - "@aws-sdk/credential-provider-sso" "3.777.0" - "@aws-sdk/credential-provider-web-identity" "3.777.0" - "@aws-sdk/nested-clients" "3.777.0" + "@aws-sdk/credential-provider-sso" "3.782.0" + "@aws-sdk/credential-provider-web-identity" "3.782.0" + "@aws-sdk/nested-clients" "3.782.0" "@aws-sdk/types" "3.775.0" "@smithy/credential-provider-imds" "^4.0.2" "@smithy/property-provider" "^4.0.2" @@ -274,17 +274,17 @@ "@smithy/types" "^4.2.0" tslib "^2.6.2" -"@aws-sdk/credential-provider-node@3.777.0": - version "3.777.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-node/-/credential-provider-node-3.777.0.tgz#65e6de233a8d885c63f0362968239bac61001c4f" - integrity sha512-ZD66ywx1Q0KyUSuBXZIQzBe3Q7MzX8lNwsrCU43H3Fww+Y+HB3Ncws9grhSdNhKQNeGmZ+MgKybuZYaaeLwJEQ== +"@aws-sdk/credential-provider-node@3.782.0": + version "3.782.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-node/-/credential-provider-node-3.782.0.tgz#81a798710d0567b26cd20a105790b49586e68d40" + integrity sha512-HZiAF+TCEyKjju9dgysjiPIWgt/+VerGaeEp18mvKLNfgKz1d+/82A2USEpNKTze7v3cMFASx3CvL8yYyF7mJw== dependencies: "@aws-sdk/credential-provider-env" "3.775.0" "@aws-sdk/credential-provider-http" "3.775.0" - "@aws-sdk/credential-provider-ini" "3.777.0" + "@aws-sdk/credential-provider-ini" "3.782.0" "@aws-sdk/credential-provider-process" "3.775.0" - "@aws-sdk/credential-provider-sso" "3.777.0" - "@aws-sdk/credential-provider-web-identity" "3.777.0" + "@aws-sdk/credential-provider-sso" "3.782.0" + "@aws-sdk/credential-provider-web-identity" "3.782.0" "@aws-sdk/types" "3.775.0" "@smithy/credential-provider-imds" "^4.0.2" "@smithy/property-provider" "^4.0.2" @@ -304,45 +304,45 @@ "@smithy/types" "^4.2.0" tslib "^2.6.2" -"@aws-sdk/credential-provider-sso@3.777.0": - version "3.777.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.777.0.tgz#570779b2bc2f4181024b1af81bf0a5bd65e7c15c" - integrity sha512-9mPz7vk9uE4PBVprfINv4tlTkyq1OonNevx2DiXC1LY4mCUCNN3RdBwAY0BTLzj0uyc3k5KxFFNbn3/8ZDQP7w== +"@aws-sdk/credential-provider-sso@3.782.0": + version "3.782.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.782.0.tgz#f644884cae368204f750c35d8a61a04d77c02674" + integrity sha512-1y1ucxTtTIGDSNSNxriQY8msinilhe9gGvQpUDYW9gboyC7WQJPDw66imy258V6osdtdi+xoHzVCbCz3WhosMQ== dependencies: - "@aws-sdk/client-sso" "3.777.0" + "@aws-sdk/client-sso" "3.782.0" "@aws-sdk/core" "3.775.0" - "@aws-sdk/token-providers" "3.777.0" + "@aws-sdk/token-providers" "3.782.0" "@aws-sdk/types" "3.775.0" "@smithy/property-provider" "^4.0.2" "@smithy/shared-ini-file-loader" "^4.0.2" "@smithy/types" "^4.2.0" tslib "^2.6.2" -"@aws-sdk/credential-provider-web-identity@3.777.0": - version "3.777.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.777.0.tgz#4f36ccd876fd045e2bfd7678287d381a5430e7b9" - integrity sha512-uGCqr47fnthkqwq5luNl2dksgcpHHjSXz2jUra7TXtFOpqvnhOW8qXjoa1ivlkq8qhqlaZwCzPdbcN0lXpmLzQ== +"@aws-sdk/credential-provider-web-identity@3.782.0": + version "3.782.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.782.0.tgz#5dbab53a7b49dcf8390d71415855e78b911a4742" + integrity sha512-xCna0opVPaueEbJoclj5C6OpDNi0Gynj+4d7tnuXGgQhTHPyAz8ZyClkVqpi5qvHTgxROdUEDxWqEO5jqRHZHQ== dependencies: "@aws-sdk/core" "3.775.0" - "@aws-sdk/nested-clients" "3.777.0" + "@aws-sdk/nested-clients" "3.782.0" "@aws-sdk/types" "3.775.0" "@smithy/property-provider" "^4.0.2" "@smithy/types" "^4.2.0" tslib "^2.6.2" -"@aws-sdk/crt-loader@3.775.0": - version "3.775.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/crt-loader/-/crt-loader-3.775.0.tgz#9c5cdc7d33230a4995d1b1ecc9b6752e39bc0b3f" - integrity sha512-jSlyWzJ5E4e/Rz7TaFvTj4rNelZeBTixaEkg0o4Cnu5SuIWeEk4VRtHuTA1ygbja4OHFxX7S3ntzH35xfJVf1w== +"@aws-sdk/crt-loader@3.782.0": + version "3.782.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/crt-loader/-/crt-loader-3.782.0.tgz#a2f8d34a22155d9730426cb727694c54dc0299c4" + integrity sha512-S3fDfZfVhGBvyseJEIcVwa7pumyjqhMKIGHYzcxpthBptJ9gcpYgyHSC6Z7hguQfsfurawe7MNvFnx8O6oLFLA== dependencies: - "@aws-sdk/util-user-agent-node" "3.775.0" + "@aws-sdk/util-user-agent-node" "3.782.0" aws-crt "^1.24.0" tslib "^2.6.2" -"@aws-sdk/lib-storage@3.777.0": - version "3.777.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/lib-storage/-/lib-storage-3.777.0.tgz#8e57c704775b114300576d7672d8b16af6ad7666" - integrity sha512-mX9LcdJe9QeQwo9WPejpEglHobpTYb2kHT4q2k4JMKu9npNF0HlF0hrW3rNNEfHH/4mlj1NrA216LgXYp1+YmA== +"@aws-sdk/lib-storage@3.782.0": + version "3.782.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/lib-storage/-/lib-storage-3.782.0.tgz#721fd62f01805a9eed661f19f556dc7c6f17a70e" + integrity sha512-UQYnIzpBReLko2XhDgG/rWpoHTWv4/zqUNl4XJXZRo9akLzrxGKtPrp5nJ4OLUkH3tIm1cvmI3XlSjHUW/OxWw== dependencies: "@smithy/abort-controller" "^4.0.2" "@smithy/middleware-endpoint" "^4.1.0" @@ -461,23 +461,23 @@ "@smithy/types" "^4.2.0" tslib "^2.6.2" -"@aws-sdk/middleware-user-agent@3.775.0": - version "3.775.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.775.0.tgz#66950672df55ddb32062baa4d92c67b3b67dfa65" - integrity sha512-7Lffpr1ptOEDE1ZYH1T78pheEY1YmeXWBfFt/amZ6AGsKSLG+JPXvof3ltporTGR2bhH/eJPo7UHCglIuXfzYg== +"@aws-sdk/middleware-user-agent@3.782.0": + version "3.782.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.782.0.tgz#60e47e365a39cfa64aa81c3c881896face74da45" + integrity sha512-i32H2R6IItX+bQ2p4+v2gGO2jA80jQoJO2m1xjU9rYWQW3+ErWy4I5YIuQHTBfb6hSdAHbaRfqPDgbv9J2rjEg== dependencies: "@aws-sdk/core" "3.775.0" "@aws-sdk/types" "3.775.0" - "@aws-sdk/util-endpoints" "3.775.0" + "@aws-sdk/util-endpoints" "3.782.0" "@smithy/core" "^3.2.0" "@smithy/protocol-http" "^5.1.0" "@smithy/types" "^4.2.0" tslib "^2.6.2" -"@aws-sdk/nested-clients@3.777.0": - version "3.777.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/nested-clients/-/nested-clients-3.777.0.tgz#e3b72bdebe4b60364ff82aff6c272aa163404196" - integrity sha512-bmmVRsCjuYlStYPt06hr+f8iEyWg7+AklKCA8ZLDEJujXhXIowgUIqXmqpTkXwkVvDQ9tzU7hxaONjyaQCGybA== +"@aws-sdk/nested-clients@3.782.0": + version "3.782.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/nested-clients/-/nested-clients-3.782.0.tgz#73f56fc4d22e1be342e00b7eba9de4d192521a05" + integrity sha512-QOYC8q7luzHFXrP0xYAqBctoPkynjfV0r9dqntFu4/IWMTyC1vlo1UTxFAjIPyclYw92XJyEkVCVg9v/nQnsUA== dependencies: "@aws-crypto/sha256-browser" "5.2.0" "@aws-crypto/sha256-js" "5.2.0" @@ -485,12 +485,12 @@ "@aws-sdk/middleware-host-header" "3.775.0" "@aws-sdk/middleware-logger" "3.775.0" "@aws-sdk/middleware-recursion-detection" "3.775.0" - "@aws-sdk/middleware-user-agent" "3.775.0" + "@aws-sdk/middleware-user-agent" "3.782.0" "@aws-sdk/region-config-resolver" "3.775.0" "@aws-sdk/types" "3.775.0" - "@aws-sdk/util-endpoints" "3.775.0" + "@aws-sdk/util-endpoints" "3.782.0" "@aws-sdk/util-user-agent-browser" "3.775.0" - "@aws-sdk/util-user-agent-node" "3.775.0" + "@aws-sdk/util-user-agent-node" "3.782.0" "@smithy/config-resolver" "^4.1.0" "@smithy/core" "^3.2.0" "@smithy/fetch-http-handler" "^5.0.2" @@ -530,12 +530,12 @@ "@smithy/util-middleware" "^4.0.2" tslib "^2.6.2" -"@aws-sdk/s3-presigned-post@3.777.0": - version "3.777.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/s3-presigned-post/-/s3-presigned-post-3.777.0.tgz#6bbd3c897d5d60fd3937bead299b765285237560" - integrity sha512-1fLlgRPPTEWlAxhl3KxJ0z+2vJXg21WFIh+16EUiY1T1vO9bHFbxM0t0Ea0RQxlv1ndxvAs0f2Aov3tXNIvagQ== +"@aws-sdk/s3-presigned-post@3.782.0": + version "3.782.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/s3-presigned-post/-/s3-presigned-post-3.782.0.tgz#bf6fd60c20a511e6e039c6740f1a80a078d2469e" + integrity sha512-JlgZ3wZ3wId0zT0hiEkL6GapAWWh6m4P3uJsDWpcSv1yOA+9bqA3fLcxofnNodL2/7fxam2elI+jVvx/wXIqlQ== dependencies: - "@aws-sdk/client-s3" "3.777.0" + "@aws-sdk/client-s3" "3.782.0" "@aws-sdk/types" "3.775.0" "@aws-sdk/util-format-url" "3.775.0" "@smithy/middleware-endpoint" "^4.1.0" @@ -545,10 +545,10 @@ "@smithy/util-utf8" "^4.0.0" tslib "^2.6.2" -"@aws-sdk/s3-request-presigner@3.777.0": - version "3.777.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/s3-request-presigner/-/s3-request-presigner-3.777.0.tgz#8bceed861953545582c6a7141c0ce6a86c817f54" - integrity sha512-pmGXG51DFQ8cBpFJbZOkoXKScm+rGvBgfExxkUR35VCo7b7hbhpUcN1t8XSzpgkdK/nxpbnQ6qGAmbIMUCwqqQ== +"@aws-sdk/s3-request-presigner@3.782.0": + version "3.782.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/s3-request-presigner/-/s3-request-presigner-3.782.0.tgz#bc71d5b9377f5c9e4170368da56745bb5164e466" + integrity sha512-Er8hdjc9zkxTh15MjdnMYggtUrGknDiuD1FwdW035kn/kwWop587G9rnRa1crhmyKRjLMn0Ki3fsyFUm/943XA== dependencies: "@aws-sdk/signature-v4-multi-region" "3.775.0" "@aws-sdk/types" "3.775.0" @@ -559,12 +559,12 @@ "@smithy/types" "^4.2.0" tslib "^2.6.2" -"@aws-sdk/signature-v4-crt@^3.775.0": - version "3.775.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/signature-v4-crt/-/signature-v4-crt-3.775.0.tgz#61abb089cefd0fe7d87c96b5354824a2164e2a9e" - integrity sha512-3850y7mEE2ILYRJgLyi+sjXsjx2S+Lqqv/xw2rfIyB1H+1U1zd9A0sRGkj4JsKZHIvkI1XI8WVQk/1YR36NhPQ== +"@aws-sdk/signature-v4-crt@^3.782.0": + version "3.782.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/signature-v4-crt/-/signature-v4-crt-3.782.0.tgz#c90ef0f30bd73a0b9fcdaf31049a2adc7c15b405" + integrity sha512-QuVSoJITPZxK0lBA2uIDQFjvLdqEvjXrnLYGpRIvIoHdL4RtcDoad9NRKP6Lb34AoB4tubVF6g85mNNOVsqVAw== dependencies: - "@aws-sdk/crt-loader" "3.775.0" + "@aws-sdk/crt-loader" "3.782.0" "@aws-sdk/signature-v4-multi-region" "3.775.0" "@aws-sdk/types" "3.775.0" "@smithy/querystring-parser" "^4.0.2" @@ -585,12 +585,12 @@ "@smithy/types" "^4.2.0" tslib "^2.6.2" -"@aws-sdk/token-providers@3.777.0": - version "3.777.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/token-providers/-/token-providers-3.777.0.tgz#aeaae6db96e7e00a4d5e3325d0436d5c52310adb" - integrity sha512-Yc2cDONsHOa4dTSGOev6Ng2QgTKQUEjaUnsyKd13pc/nLLz/WLqHiQ/o7PcnKERJxXGs1g1C6l3sNXiX+kbnFQ== +"@aws-sdk/token-providers@3.782.0": + version "3.782.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/token-providers/-/token-providers-3.782.0.tgz#a6a12f9358f8897f5d1af311da60f90a7d384eac" + integrity sha512-4tPuk/3+THPrzKaXW4jE2R67UyGwHLFizZ47pcjJWbhb78IIJAy94vbeqEQ+veS84KF5TXcU7g5jGTXC0D70Wg== dependencies: - "@aws-sdk/nested-clients" "3.777.0" + "@aws-sdk/nested-clients" "3.782.0" "@aws-sdk/types" "3.775.0" "@smithy/property-provider" "^4.0.2" "@smithy/shared-ini-file-loader" "^4.0.2" @@ -612,10 +612,10 @@ dependencies: tslib "^2.6.2" -"@aws-sdk/util-endpoints@3.775.0": - version "3.775.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-endpoints/-/util-endpoints-3.775.0.tgz#2f6fd728c86aeb1fba38506161b2eb024de17c19" - integrity sha512-yjWmUgZC9tUxAo8Uaplqmq0eUh0zrbZJdwxGRKdYxfm4RG6fMw1tj52+KkatH7o+mNZvg1GDcVp/INktxonJLw== +"@aws-sdk/util-endpoints@3.782.0": + version "3.782.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/util-endpoints/-/util-endpoints-3.782.0.tgz#3b8de42c5fe951337d070432d4a5eba166c07bb7" + integrity sha512-/RJOAO7o7HI6lEa4ASbFFLHGU9iPK876BhsVfnl54MvApPVYWQ9sHO0anOUim2S5lQTwd/6ghuH3rFYSq/+rdw== dependencies: "@aws-sdk/types" "3.775.0" "@smithy/types" "^4.2.0" @@ -649,12 +649,12 @@ bowser "^2.11.0" tslib "^2.6.2" -"@aws-sdk/util-user-agent-node@3.775.0": - version "3.775.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.775.0.tgz#dbc34ff2d84e2c3d10466081cad005d49c3d9740" - integrity sha512-N9yhTevbizTOMo3drH7Eoy6OkJ3iVPxhV7dwb6CMAObbLneS36CSfA6xQXupmHWcRvZPTz8rd1JGG3HzFOau+g== +"@aws-sdk/util-user-agent-node@3.782.0": + version "3.782.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.782.0.tgz#795f2c22882f1ddbbe83bd324f0ceac1c4b07c89" + integrity sha512-dMFkUBgh2Bxuw8fYZQoH/u3H4afQ12VSkzEi//qFiDTwbKYq+u+RYjc8GLDM6JSK1BShMu5AVR7HD4ap1TYUnA== dependencies: - "@aws-sdk/middleware-user-agent" "3.775.0" + "@aws-sdk/middleware-user-agent" "3.782.0" "@aws-sdk/types" "3.775.0" "@smithy/node-config-provider" "^4.0.2" "@smithy/types" "^4.2.0" @@ -15120,16 +15120,11 @@ tslib@2.4.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" integrity "sha1-fOyqfwc85oCgWEeqd76UEJjzbcM= sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" -tslib@2.8.1: +tslib@2.8.1, tslib@^2.0.0, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.1, tslib@^2.5.0, tslib@^2.6.2: version "2.8.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== -tslib@^2.0.0, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.1, tslib@^2.5.0, tslib@^2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" - integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== - tsscmp@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.6.tgz#85b99583ac3589ec4bfef825b5000aa911d605eb" From f9919e90cfd7be5334a1e549d86d6c89984d0051 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Tue, 8 Apr 2025 22:10:07 -0400 Subject: [PATCH 08/59] fix: Allow OIDC without team name (#8911) --- plugins/discord/server/auth/discord.ts | 2 +- server/commands/accountProvisioner.test.ts | 2 -- server/commands/accountProvisioner.ts | 3 ++- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/discord/server/auth/discord.ts b/plugins/discord/server/auth/discord.ts index 68ca804c3f..868b1065bb 100644 --- a/plugins/discord/server/auth/discord.ts +++ b/plugins/discord/server/auth/discord.ts @@ -94,7 +94,7 @@ if (env.DISCORD_CLIENT_ID && env.DISCORD_CLIENT_SECRET) { /** Default user and team names metadata */ let userName = profile.username; - let teamName = "Wiki"; + let teamName; let userAvatarUrl: string = `https://cdn.discordapp.com/avatars/${profile.id}/${profile.avatar}.png`; let teamAvatarUrl: string | undefined = undefined; let subdomain = slugifyDomain(domain); diff --git a/server/commands/accountProvisioner.test.ts b/server/commands/accountProvisioner.test.ts index 6adc22e9a0..eac8bd16fa 100644 --- a/server/commands/accountProvisioner.test.ts +++ b/server/commands/accountProvisioner.test.ts @@ -264,7 +264,6 @@ describe("accountProvisioner", () => { avatarUrl: faker.internet.avatar(), }, team: { - name: existingTeam.name, avatarUrl: existingTeam.avatarUrl, subdomain: faker.internet.domainWord(), }, @@ -308,7 +307,6 @@ describe("accountProvisioner", () => { avatarUrl: faker.internet.avatar(), }, team: { - name: team.name, avatarUrl: team.avatarUrl, subdomain: faker.internet.domainWord(), }, diff --git a/server/commands/accountProvisioner.ts b/server/commands/accountProvisioner.ts index 0e02f03bcf..5668265939 100644 --- a/server/commands/accountProvisioner.ts +++ b/server/commands/accountProvisioner.ts @@ -43,7 +43,7 @@ type Props = { */ teamId?: string; /** The displayed name of the team */ - name: string; + name?: string; /** The domain name from the email of the user logging in */ domain?: string; /** The preferred subdomain to provision for the team if not yet created */ @@ -92,6 +92,7 @@ async function accountProvisioner({ try { result = await teamProvisioner({ + name: "Wiki", ...teamParams, authenticationProvider: authenticationProviderParams, ip, From 1ea40c03c5caa654ec17094f95f9d9815235fdda Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Tue, 8 Apr 2025 22:31:34 -0400 Subject: [PATCH 09/59] Add option to copy as plain text (#8913) --- app/actions/definitions/documents.tsx | 28 +++++++++++++++++++++- app/models/Document.ts | 19 +++++++++++++++ shared/i18n/locales/en_US/translation.json | 2 ++ 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/app/actions/definitions/documents.tsx b/app/actions/definitions/documents.tsx index 911a466ed5..867fdb2b7d 100644 --- a/app/actions/definitions/documents.tsx +++ b/app/actions/definitions/documents.tsx @@ -29,6 +29,7 @@ import { PadlockIcon, GlobeIcon, LogoutIcon, + CaseSensitiveIcon, } from "outline-icons"; import * as React from "react"; import { toast } from "sonner"; @@ -510,6 +511,25 @@ export const copyDocumentAsMarkdown = createAction({ }, }); +export const copyDocumentAsPlainText = createAction({ + name: ({ t }) => t("Copy as text"), + section: ActiveDocumentSection, + keywords: "clipboard", + icon: , + iconInContextMenu: false, + visible: ({ activeDocumentId, stores }) => + !!activeDocumentId && stores.policies.abilities(activeDocumentId).download, + perform: ({ stores, activeDocumentId, t }) => { + const document = activeDocumentId + ? stores.documents.get(activeDocumentId) + : undefined; + if (document) { + copy(document.toPlainText()); + toast.success(t("Text copied to clipboard")); + } + }, +}); + export const copyDocumentShareLink = createAction({ name: ({ t }) => t("Copy public link"), section: ActiveDocumentSection, @@ -555,7 +575,12 @@ export const copyDocument = createAction({ section: ActiveDocumentSection, icon: , keywords: "clipboard", - children: [copyDocumentLink, copyDocumentShareLink, copyDocumentAsMarkdown], + children: [ + copyDocumentLink, + copyDocumentShareLink, + copyDocumentAsMarkdown, + copyDocumentAsPlainText, + ], }); export const duplicateDocument = createAction({ @@ -1205,6 +1230,7 @@ export const rootDocumentActions = [ copyDocumentLink, copyDocumentShareLink, copyDocumentAsMarkdown, + copyDocumentAsPlainText, starDocument, unstarDocument, publishDocument, diff --git a/app/models/Document.ts b/app/models/Document.ts index 78be2fe01a..0e4a4d0a64 100644 --- a/app/models/Document.ts +++ b/app/models/Document.ts @@ -17,6 +17,7 @@ import { NavigationNodeType, NotificationEventType, } from "@shared/types"; +import { ProsemirrorHelper } from "@shared/utils/ProsemirrorHelper"; import Storage from "@shared/utils/Storage"; import { isRTL } from "@shared/utils/rtl"; import slugify from "@shared/utils/slugify"; @@ -663,6 +664,24 @@ export default class Document extends ArchivableModel implements Searchable { return markdown; }; + /** + * Returns the plain text representation of the document derived from the ProseMirror data. + * + * @returns The plain text representation of the document as a string. + */ + toPlainText = () => { + const extensionManager = new ExtensionManager(withComments(richExtensions)); + const schema = new Schema({ + nodes: extensionManager.nodes, + marks: extensionManager.marks, + }); + const text = ProsemirrorHelper.toPlainText( + Node.fromJSON(schema, this.data), + schema + ); + return text; + }; + download = (contentType: ExportContentType) => client.post( `/documents.export`, diff --git a/shared/i18n/locales/en_US/translation.json b/shared/i18n/locales/en_US/translation.json index 019dadf4fe..209eb76c0c 100644 --- a/shared/i18n/locales/en_US/translation.json +++ b/shared/i18n/locales/en_US/translation.json @@ -57,6 +57,8 @@ "Download document": "Download document", "Copy as Markdown": "Copy as Markdown", "Markdown copied to clipboard": "Markdown copied to clipboard", + "Copy as text": "Copy as text", + "Text copied to clipboard": "Text copied to clipboard", "Copy public link": "Copy public link", "Link copied to clipboard": "Link copied to clipboard", "Copy link": "Copy link", From 59c611b24f9918cdda103ec352f358fd92418356 Mon Sep 17 00:00:00 2001 From: Rahma-sbei <115249330+Rahma-sbei@users.noreply.github.com> Date: Wed, 9 Apr 2025 03:44:59 +0100 Subject: [PATCH 10/59] Added delay on sidebar exit (#8888) * added delay on sidebar exit * Fix typos in Sidebar component comments --------- Co-authored-by: Tom Moor --- app/components/Sidebar/Sidebar.tsx | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/app/components/Sidebar/Sidebar.tsx b/app/components/Sidebar/Sidebar.tsx index 49f6b16bd2..b475e10de1 100644 --- a/app/components/Sidebar/Sidebar.tsx +++ b/app/components/Sidebar/Sidebar.tsx @@ -54,6 +54,8 @@ const Sidebar = React.forwardRef(function _Sidebar( const [hasPointerMoved, setPointerMoved] = React.useState(false); const isSmallerThanMinimum = width < minWidth; + const hoverTimeoutRef = React.useRef(null); + const handleDrag = React.useCallback( (event: MouseEvent) => { // suppresses text selection @@ -114,6 +116,10 @@ const Sidebar = React.forwardRef(function _Sidebar( const handlePointerActivity = React.useCallback(() => { if (ui.sidebarIsClosed) { + // clear the timeout when mouse exits + if (hoverTimeoutRef.current) { + clearTimeout(hoverTimeoutRef.current); + } setHovering(document.hasFocus()); setPointerMoved(true); } @@ -122,12 +128,20 @@ const Sidebar = React.forwardRef(function _Sidebar( const handlePointerLeave = React.useCallback( (ev) => { if (hasPointerMoved) { - setHovering( - document.hasFocus() && - ev.pageX < width && - ev.pageY < window.innerHeight && - ev.pageY > 0 - ); + // clear any previous timeout + if (hoverTimeoutRef.current) { + clearTimeout(hoverTimeoutRef.current); + } + + // add a short delay when mouse exits the sidebar before closing + hoverTimeoutRef.current = setTimeout(() => { + setHovering( + document.hasFocus() && + ev.pageX < width && + ev.pageY < window.innerHeight && + ev.pageY > 0 + ); + }, 500); } }, [width, hasPointerMoved] From 4d435cd5ecfec6417025b7717cf1b9531bacd773 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Apr 2025 07:12:15 -0700 Subject: [PATCH 11/59] chore(deps): bump koa from 2.16.0 to 2.16.1 (#8917) Bumps [koa](https://github.com/koajs/koa) from 2.16.0 to 2.16.1. - [Release notes](https://github.com/koajs/koa/releases) - [Changelog](https://github.com/koajs/koa/blob/master/History.md) - [Commits](https://github.com/koajs/koa/compare/2.16.0...v2.16.1) --- updated-dependencies: - dependency-name: koa dependency-version: 2.16.1 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 2108e971bb..af71285cbf 100644 --- a/package.json +++ b/package.json @@ -141,7 +141,7 @@ "jszip": "^3.10.1", "katex": "^0.16.21", "kbar": "0.1.0-beta.41", - "koa": "^2.15.4", + "koa": "^2.16.1", "koa-body": "^6.0.1", "koa-compress": "^5.1.1", "koa-helmet": "^6.1.0", diff --git a/yarn.lock b/yarn.lock index bac8c0446f..7870bdc17c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11215,10 +11215,10 @@ koa-useragent@*, koa-useragent@^4.1.0: dependencies: express-useragent "^1.0.15" -koa@^2.15.3, koa@^2.15.4: - version "2.16.0" - resolved "https://registry.yarnpkg.com/koa/-/koa-2.16.0.tgz#0a82ed4d460774ff0b444e361cd6e4bd5c767ee3" - integrity sha512-Afhqq0Vq3W7C+/rW6IqHVBDLzqObwZ07JaUNUEF8yCQ6afiyFE3RAy+i7V0E46XOWlH7vPWn/x0vsZwNy6PWxw== +koa@^2.15.3, koa@^2.16.1: + version "2.16.1" + resolved "https://registry.yarnpkg.com/koa/-/koa-2.16.1.tgz#ba1aae04d8319d7dac4a17a0d289d7482501e194" + integrity sha512-umfX9d3iuSxTQP4pnzLOz0HKnPg0FaUUIKcye2lOiz3KPu1Y3M3xlz76dISdFPQs37P9eJz1wUpcTS6KDPn9fA== dependencies: accepts "^1.3.5" cache-content-type "^1.0.0" From d4bc189e128259ea0f4b108cc532ca27046ef64d Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 9 Apr 2025 10:12:48 -0400 Subject: [PATCH 12/59] fix: collectionIndexing results in teamId undefined error due to Sequelize bug (#8918) --- server/utils/indexing.test.ts | 87 +++++++++++++++++++++++++++++++++++ server/utils/indexing.ts | 10 ++-- 2 files changed, 92 insertions(+), 5 deletions(-) create mode 100644 server/utils/indexing.test.ts diff --git a/server/utils/indexing.test.ts b/server/utils/indexing.test.ts new file mode 100644 index 0000000000..7aed6737b9 --- /dev/null +++ b/server/utils/indexing.test.ts @@ -0,0 +1,87 @@ +import { + buildCollection, + buildDocument, + buildStar, + buildTeam, + buildUser, +} from "@server/test/factories"; +import { collectionIndexing, starIndexing } from "./indexing"; + +describe("collectionIndexing", () => { + it("should generate index for collections without index", async () => { + const team = await buildTeam(); + const collections = await Promise.all([ + buildCollection({ + teamId: team.id, + }), + buildCollection({ + teamId: team.id, + }), + ]); + + // Set index to null to simulate no index + collections[0].index = null; + collections[1].index = null; + await collections[0].save({ hooks: false }); + await collections[1].save({ hooks: false }); + + const result = await collectionIndexing(team.id, {}); + expect(Object.keys(result).length).toBe(2); + expect(result[collections[0].id]).toBeTruthy(); + expect(result[collections[1].id]).toBeTruthy(); + }); + + it("should maintain existing indices", async () => { + const team = await buildTeam(); + const collection = await buildCollection({ + teamId: team.id, + index: "a1", + }); + + const result = await collectionIndexing(team.id, {}); + expect(result[collection.id]).toBe("a1"); + }); +}); + +describe("starIndexing", () => { + it("should generate index for stars without index", async () => { + const team = await buildTeam(); + const user = await buildUser({ teamId: team.id }); + const document = await buildDocument(); + const stars = await Promise.all([ + buildStar({ + userId: user.id, + documentId: document.id, + }), + buildStar({ + userId: user.id, + documentId: document.id, + }), + ]); + + // Set index to null to simulate no index + stars[0].index = null; + stars[1].index = null; + await stars[0].save({ hooks: false }); + await stars[1].save({ hooks: false }); + + const result = await starIndexing(user.id); + expect(Object.keys(result).length).toBe(2); + expect(result[stars[0].id]).toBeTruthy(); + expect(result[stars[1].id]).toBeTruthy(); + }); + + it("should maintain existing indices", async () => { + const team = await buildTeam(); + const user = await buildUser({ teamId: team.id }); + const document = await buildDocument(); + const star = await buildStar({ + userId: user.id, + documentId: document.id, + index: "a1", + }); + + const result = await starIndexing(user.id); + expect(result[star.id]).toBe("a1"); + }); +}); diff --git a/server/utils/indexing.ts b/server/utils/indexing.ts index 48e9ab4728..e464a46419 100644 --- a/server/utils/indexing.ts +++ b/server/utils/indexing.ts @@ -10,10 +10,8 @@ export async function collectionIndexing( const collections = await Collection.findAll({ where: { teamId, - // no point in maintaining index of deleted collections. - deletedAt: null, }, - attributes: ["id", "index", "name"], + attributes: ["id", "index", "name", "teamId"], transaction, }); @@ -26,7 +24,9 @@ export async function collectionIndexing( for (const collection of sortable) { if (collection.index === null) { collection.index = fractionalIndex(previousIndex, null); - promises.push(collection.save({ fields: ["index"], transaction })); // save only index to prevent overwriting other unfetched fields. + promises.push( + collection.save({ fields: ["index"], silent: true, transaction }) + ); } previousIndex = collection.index; @@ -67,7 +67,7 @@ export async function starIndexing(userId: string) { for (const star of sortable) { if (star.index === null) { star.index = fractionalIndex(previousIndex, null); - promises.push(star.save()); + promises.push(star.save({ silent: true })); } previousIndex = star.index; From 016c8c802c5b70baf1cb4cd5fc1e70e7144ae997 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Thu, 10 Apr 2025 21:10:10 -0400 Subject: [PATCH 13/59] Finalize moving docker publish to GH actions (#8927) --- .github/workflows/ci.yml | 2 +- .github/workflows/docker.yml | 198 +++++++++++++++++++++++++++++++---- Dockerfile | 5 +- Dockerfile.base | 5 +- 4 files changed, 187 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff2eb0afcd..82f831b838 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ env: DATABASE_URL: postgres://postgres:password@localhost:5432/outline_test REDIS_URL: redis://127.0.0.1:6379 URL: http://localhost:3000 - NODE_OPTIONS: --max-old-space-size=8000 + NODE_OPTIONS: --max-old-space-size=8192 SECRET_KEY: F0E5AD933D7F6FD8F4DBB3E038C501C052DC0593C686D21ACB30AE205D2F634B UTILS_SECRET: 123456 SLACK_VERIFICATION_TOKEN: 123456 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0d58a68228..478a0aaaf9 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -3,25 +3,32 @@ name: Docker on: push: tags: - - 'v*' + - "v*" env: IMAGE_NAME: outlinewiki/outline BASE_IMAGE_NAME: outlinewiki/outline-base jobs: - build-and-push: - runs-on: ubuntu-latest + build-arm: + runs-on: ubicloud-standard-8-arm steps: - name: Checkout uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Docker base meta + id: base_meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.BASE_IMAGE_NAME }} + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + - name: Login to Docker Hub uses: docker/login-action@v3 with: @@ -29,24 +36,177 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push base image - uses: docker/build-push-action@v5 + id: base_build + uses: docker/build-push-action@v6 with: context: . file: Dockerfile.base - push: true - tags: ${{ env.BASE_IMAGE_NAME }}:latest - platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x + labels: ${{ steps.base_meta.outputs.labels }} + tags: ${{ env.BASE_IMAGE_NAME }} + outputs: type=image,push-by-digest=true,name-canonical=true,push=true + platforms: linux/arm64 + cache-from: type=gha + cache-to: type=gha,mode=max + pull: false - - name: Extract version - id: version - run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.IMAGE_NAME }} + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} - - name: Build and push main image - uses: docker/build-push-action@v5 + - name: Build and push + id: build + uses: docker/build-push-action@v6 with: context: . - push: true - platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x + file: Dockerfile + labels: ${{ steps.meta.outputs.labels }} + tags: ${{ env.IMAGE_NAME }} + outputs: type=image,push-by-digest=true,name-canonical=true,push=true + platforms: linux/arm64 + cache-from: type=gha + cache-to: type=gha,mode=max + pull: false + build-args: | + BASE_IMAGE=${{ env.BASE_IMAGE_NAME }}@${{ steps.base_build.outputs.digest }} + + - name: Export digest + run: | + mkdir -p ${{ runner.temp }}/digests + digest="${{ steps.build.outputs.digest }}" + touch "${{ runner.temp }}/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v4 + with: + name: digests-linux-arm64 + path: ${{ runner.temp }}/digests/* + if-no-files-found: error + retention-days: 1 + + build-amd: + runs-on: ubicloud-standard-8 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker base meta + id: base_meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.BASE_IMAGE_NAME }} tags: | - ${{ env.IMAGE_NAME }}:latest - ${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }} + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push base image + id: base_build + uses: docker/build-push-action@v6 + with: + context: . + file: Dockerfile.base + labels: ${{ steps.base_meta.outputs.labels }} + tags: ${{ env.BASE_IMAGE_NAME }} + outputs: type=image,push-by-digest=true,name-canonical=true,push=true + platforms: linux/amd64 + cache-from: type=gha + cache-to: type=gha,mode=max + pull: false + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.IMAGE_NAME }} + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + + - name: Build and push + id: build + uses: docker/build-push-action@v6 + with: + context: . + file: Dockerfile + labels: ${{ steps.meta.outputs.labels }} + tags: ${{ env.IMAGE_NAME }} + outputs: type=image,push-by-digest=true,name-canonical=true,push=true + platforms: linux/amd64 + cache-from: type=gha + cache-to: type=gha,mode=max + pull: false + build-args: | + BASE_IMAGE=${{ env.BASE_IMAGE_NAME }}@${{ steps.base_build.outputs.digest }} + + - name: Export digest + run: | + mkdir -p ${{ runner.temp }}/digests + digest="${{ steps.build.outputs.digest }}" + touch "${{ runner.temp }}/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v4 + with: + name: digests-linux-amd64 + path: ${{ runner.temp }}/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubicloud-standard-8 + needs: + - build-amd + - build-arm + steps: + - name: Download digests + uses: actions/download-artifact@v4 + with: + path: ${{ runner.temp }}/digests + pattern: digests-* + merge-multiple: true + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.IMAGE_NAME }} + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + + - name: Create manifest list and push + working-directory: ${{ runner.temp }}/digests + run: | + docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ + $(printf '${{ env.IMAGE_NAME }}@sha256:%s ' *) + + - name: Inspect image + run: | + docker buildx imagetools inspect ${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index a0393b6b93..fcc6d08168 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ ARG APP_PATH=/opt/outline -FROM outlinewiki/outline-base AS base +ARG BASE_IMAGE=outlinewiki/outline-base +FROM ${BASE_IMAGE} AS base ARG APP_PATH WORKDIR $APP_PATH @@ -30,7 +31,7 @@ RUN addgroup --gid 1001 nodejs && \ adduser --uid 1001 --ingroup nodejs nodejs && \ chown -R nodejs:nodejs $APP_PATH/build && \ mkdir -p /var/lib/outline && \ - chown -R nodejs:nodejs /var/lib/outline + chown -R nodejs:nodejs /var/lib/outline ENV FILE_STORAGE_LOCAL_ROOT_DIR=/var/lib/outline/data RUN mkdir -p "$FILE_STORAGE_LOCAL_ROOT_DIR" && \ diff --git a/Dockerfile.base b/Dockerfile.base index 13378f1caa..91f90f3c2a 100644 --- a/Dockerfile.base +++ b/Dockerfile.base @@ -1,11 +1,14 @@ ARG APP_PATH=/opt/outline -FROM node:20-slim AS deps +FROM node:20 AS deps ARG APP_PATH WORKDIR $APP_PATH COPY ./package.json ./yarn.lock ./ COPY ./patches ./patches +RUN apt-get update && apt-get install -y cmake +ENV NODE_OPTIONS="--max-old-space-size=24000" + RUN yarn install --no-optional --frozen-lockfile --network-timeout 1000000 && \ yarn cache clean From e499881110fd04f9b07093149d415d5dc5b992bf Mon Sep 17 00:00:00 2001 From: Hemachandar <132386067+hmacr@users.noreply.github.com> Date: Fri, 11 Apr 2025 06:41:30 +0530 Subject: [PATCH 14/59] fix: Update collection 'documentStructure' when archived document is deleted (#8922) --- server/models/Document.test.ts | 29 +++++++++++++++++++++++++++++ server/models/Document.ts | 18 +++++++++++++----- 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/server/models/Document.test.ts b/server/models/Document.test.ts index 7d5e2f9ffd..1a58e7d502 100644 --- a/server/models/Document.test.ts +++ b/server/models/Document.test.ts @@ -11,6 +11,7 @@ import { buildUser, buildGuestUser, } from "@server/test/factories"; +import Collection from "./Collection"; import UserMembership from "./UserMembership"; beforeEach(() => { @@ -78,6 +79,34 @@ describe("#delete", () => { expect(newDocument?.deletedAt).toBeTruthy(); }); + test("should soft delete archived document in an archived collection", async () => { + const user = await buildUser(); + const collection = await buildCollection({ + archivedAt: new Date(), + createdById: user.id, + teamId: user.teamId, + }); + const document = await buildDocument({ + archivedAt: new Date(), + collectionId: collection.id, + userId: user.id, + teamId: user.teamId, + }); + await collection.addDocumentToStructure(document, 0); + + await document.delete(user); + const [newDocument, newCollection] = await Promise.all([ + Document.findByPk(document.id, { + paranoid: false, + }), + Collection.findByPk(collection.id), + ]); + + expect(newDocument?.lastModifiedById).toEqual(user.id); + expect(newDocument?.deletedAt).toBeTruthy(); + expect(newCollection?.documentStructure).toEqual([]); + }); + it("should delete draft without collection", async () => { const user = await buildUser(); const document = await buildDraftDocument(); diff --git a/server/models/Document.ts b/server/models/Document.ts index bc25fdabb4..719c528df8 100644 --- a/server/models/Document.ts +++ b/server/models/Document.ts @@ -1112,18 +1112,26 @@ class Document extends ArchivableModel< // Delete a document, archived or otherwise. delete = (user: User) => this.sequelize.transaction(async (transaction: Transaction) => { - if (!this.archivedAt && !this.template && this.collectionId) { - // delete any children and remove from the document structure - const collection = await Collection.findByPk(this.collectionId, { + let deleted = false; + + if (!this.template && this.collectionId) { + const collection = await Collection.findByPk(this.collectionId!, { transaction, lock: transaction.LOCK.UPDATE, paranoid: false, }); - await collection?.deleteDocument(this, { transaction }); - } else { + + if (!this.archivedAt || (this.archivedAt && collection?.archivedAt)) { + await collection?.deleteDocument(this, { transaction }); + deleted = true; + } + } + + if (!deleted) { await this.destroy({ transaction, }); + deleted = true; } this.lastModifiedById = user.id; From f7b00e72f15a5bf69cd2e334cd3e26a85fb228c9 Mon Sep 17 00:00:00 2001 From: Hemachandar <132386067+hmacr@users.noreply.github.com> Date: Fri, 11 Apr 2025 06:54:32 +0530 Subject: [PATCH 15/59] Implement UnfurlsStore (#8920) * Implement UnfurlsStore * simplify lookup * refetch unfurl after X elapsed time * compute fetchedAt in client --- app/components/HoverPreview/HoverPreview.tsx | 286 ++++++++++--------- app/editor/extensions/HoverPreviews.tsx | 33 ++- app/models/Unfurl.ts | 18 ++ app/stores/RootStore.ts | 3 + app/stores/UnfurlsStore.ts | 85 ++++++ 5 files changed, 272 insertions(+), 153 deletions(-) create mode 100644 app/models/Unfurl.ts create mode 100644 app/stores/UnfurlsStore.ts diff --git a/app/components/HoverPreview/HoverPreview.tsx b/app/components/HoverPreview/HoverPreview.tsx index c6a79d8f6e..f57527e483 100644 --- a/app/components/HoverPreview/HoverPreview.tsx +++ b/app/components/HoverPreview/HoverPreview.tsx @@ -1,4 +1,5 @@ import { m } from "framer-motion"; +import { observer } from "mobx-react"; import * as React from "react"; import { Portal } from "react-portal"; import styled from "styled-components"; @@ -8,6 +9,7 @@ import useEventListener from "~/hooks/useEventListener"; import useKeyDown from "~/hooks/useKeyDown"; import useMobile from "~/hooks/useMobile"; import useOnClickOutside from "~/hooks/useOnClickOutside"; +import useStores from "~/hooks/useStores"; import LoadingIndicator from "../LoadingIndicator"; import { CARD_MARGIN } from "./Components"; import HoverPreviewDocument from "./HoverPreviewDocument"; @@ -23,9 +25,9 @@ const POINTER_WIDTH = 22; type Props = { /** The HTML element that is being hovered over, or null if none. */ element: HTMLElement | null; - /** Data to be previewed */ - data: Record | null; - /** Whether the preview data is being loaded */ + /** ID of the unfurl that will be shown in the hover preview. */ + unfurlId: string | null; + /** Whether the preview data is being loaded. */ dataLoading: boolean; /** A callback on close of the hover preview. */ onClose: () => void; @@ -36,151 +38,155 @@ enum Direction { DOWN, } -function HoverPreviewDesktop({ element, data, dataLoading, onClose }: Props) { - const [isVisible, setVisible] = React.useState(false); - const timerClose = React.useRef>(); - const cardRef = React.useRef(null); - const { cardLeft, cardTop, pointerLeft, pointerTop, pointerDir } = - useHoverPosition({ - cardRef, - element, - isVisible, - }); +const HoverPreviewDesktop = observer( + ({ element, unfurlId, dataLoading, onClose }: Props) => { + const { unfurls } = useStores(); + const [isVisible, setVisible] = React.useState(false); + const timerClose = React.useRef>(); + const cardRef = React.useRef(null); + const { cardLeft, cardTop, pointerLeft, pointerTop, pointerDir } = + useHoverPosition({ + cardRef, + element, + isVisible, + }); + const data = unfurlId ? unfurls.get(unfurlId)?.data : undefined; - const closePreview = React.useCallback(() => { - setVisible(false); - onClose(); - }, [onClose]); + const closePreview = React.useCallback(() => { + setVisible(false); + onClose(); + }, [onClose]); - const stopCloseTimer = React.useCallback(() => { - if (timerClose.current) { - clearTimeout(timerClose.current); - timerClose.current = undefined; - } - }, []); - - const startCloseTimer = React.useCallback(() => { - timerClose.current = setTimeout(closePreview, DELAY_CLOSE); - }, [closePreview]); - - // Open and close the preview when the element changes. - React.useEffect(() => { - if (element && data && !dataLoading) { - setVisible(true); - } else { - startCloseTimer(); - } - }, [startCloseTimer, element, data, dataLoading]); - - // Close the preview on Escape, scroll, or click outside. - useOnClickOutside(cardRef, closePreview); - useKeyDown("Escape", closePreview); - useEventListener("scroll", closePreview, window, { capture: true }); - - // Ensure that the preview stays open while the user is hovering over the card. - React.useEffect(() => { - const card = cardRef.current; - - if (isVisible) { - if (card) { - card.addEventListener("mouseenter", stopCloseTimer); - card.addEventListener("mouseleave", startCloseTimer); + const stopCloseTimer = React.useCallback(() => { + if (timerClose.current) { + clearTimeout(timerClose.current); + timerClose.current = undefined; } - } + }, []); - return () => { - if (card) { - card.removeEventListener("mouseenter", stopCloseTimer); - card.removeEventListener("mouseleave", startCloseTimer); + const startCloseTimer = React.useCallback(() => { + timerClose.current = setTimeout(closePreview, DELAY_CLOSE); + }, [closePreview]); + + // Open and close the preview when the element changes. + React.useEffect(() => { + if (element && data && !dataLoading) { + setVisible(true); + } else { + startCloseTimer(); + } + }, [startCloseTimer, element, data, dataLoading]); + + // Close the preview on Escape, scroll, or click outside. + useOnClickOutside(cardRef, closePreview); + useKeyDown("Escape", closePreview); + useEventListener("scroll", closePreview, window, { capture: true }); + + // Ensure that the preview stays open while the user is hovering over the card. + React.useEffect(() => { + const card = cardRef.current; + + if (isVisible) { + if (card) { + card.addEventListener("mouseenter", stopCloseTimer); + card.addEventListener("mouseleave", startCloseTimer); + } } - stopCloseTimer(); - }; - }, [element, startCloseTimer, isVisible, stopCloseTimer]); + return () => { + if (card) { + card.removeEventListener("mouseenter", stopCloseTimer); + card.removeEventListener("mouseleave", startCloseTimer); + } - if (dataLoading) { - return ; + stopCloseTimer(); + }; + }, [element, startCloseTimer, isVisible, stopCloseTimer]); + + if (dataLoading) { + return ; + } + + if (!data) { + return null; + } + + return ( + + + {isVisible ? ( + + {data.type === UnfurlResourceType.Mention ? ( + + ) : data.type === UnfurlResourceType.Document ? ( + + ) : data.type === UnfurlResourceType.Issue ? ( + + ) : data.type === UnfurlResourceType.PR ? ( + + ) : ( + + )} + + + ) : null} + + + ); } +); - if (!data) { - return null; - } - - return ( - - - {isVisible ? ( - - {data.type === UnfurlResourceType.Mention ? ( - - ) : data.type === UnfurlResourceType.Document ? ( - - ) : data.type === UnfurlResourceType.Issue ? ( - - ) : data.type === UnfurlResourceType.PR ? ( - - ) : ( - - )} - - - ) : null} - - - ); -} - -function HoverPreview({ element, data, dataLoading, ...rest }: Props) { +function HoverPreview({ element, unfurlId, dataLoading, ...rest }: Props) { const isMobile = useMobile(); if (isMobile) { return null; @@ -190,7 +196,7 @@ function HoverPreview({ element, data, dataLoading, ...rest }: Props) { ); diff --git a/app/editor/extensions/HoverPreviews.tsx b/app/editor/extensions/HoverPreviews.tsx index fff2eeef88..3a23d92473 100644 --- a/app/editor/extensions/HoverPreviews.tsx +++ b/app/editor/extensions/HoverPreviews.tsx @@ -4,9 +4,9 @@ import { EditorView } from "prosemirror-view"; import * as React from "react"; import Extension from "@shared/editor/lib/Extension"; import parseDocumentSlug from "@shared/utils/parseDocumentSlug"; +import stores from "~/stores"; import HoverPreview from "~/components/HoverPreview"; import env from "~/env"; -import { client } from "~/utils/ApiClient"; interface HoverPreviewsOptions { /** Delay before the target is considered "hovered" and callback is triggered. */ @@ -16,11 +16,11 @@ interface HoverPreviewsOptions { export default class HoverPreviews extends Extension { state: { activeLinkElement: HTMLElement | null; - data: Record | null; + unfurlId: string | null; dataLoading: boolean; } = observable({ activeLinkElement: null, - data: null, + unfurlId: null, dataLoading: false, }); @@ -62,19 +62,25 @@ export default class HoverPreviews extends Extension { ); if (url) { + const transformedUrl = url.startsWith("/") + ? env.URL + url + : url; + this.state.dataLoading = true; - try { - const data = await client.post("/urls.unfurl", { - url: url.startsWith("/") ? env.URL + url : url, - documentId, - }); + + const unfurl = await stores.unfurls.fetchUnfurl({ + url: transformedUrl, + documentId, + }); + + if (unfurl) { this.state.activeLinkElement = element; - this.state.data = data; - } catch (err) { + this.state.unfurlId = transformedUrl; + } else { this.state.activeLinkElement = null; - } finally { - this.state.dataLoading = false; } + + this.state.dataLoading = false; } }), this.options.delay @@ -101,10 +107,11 @@ export default class HoverPreviews extends Extension { widget = () => ( { this.state.activeLinkElement = null; + this.state.unfurlId = null; })} /> ); diff --git a/app/models/Unfurl.ts b/app/models/Unfurl.ts new file mode 100644 index 0000000000..23f3b9fd0c --- /dev/null +++ b/app/models/Unfurl.ts @@ -0,0 +1,18 @@ +import { observable } from "mobx"; +import { UnfurlResourceType, UnfurlResponse } from "@shared/types"; +import Model from "./base/Model"; + +class Unfurl extends Model { + static modelName = "Unfurl"; + + @observable + type: UnfurlType; + + @observable + data: UnfurlResponse[UnfurlType]; + + @observable + fetchedAt: string; +} + +export default Unfurl; diff --git a/app/stores/RootStore.ts b/app/stores/RootStore.ts index f874340763..32b80b0162 100644 --- a/app/stores/RootStore.ts +++ b/app/stores/RootStore.ts @@ -26,6 +26,7 @@ import SharesStore from "./SharesStore"; import StarsStore from "./StarsStore"; import SubscriptionsStore from "./SubscriptionsStore"; import UiStore from "./UiStore"; +import UnfurlsStore from "./UnfurlsStore"; import UserMembershipsStore from "./UserMembershipsStore"; import UsersStore from "./UsersStore"; import ViewsStore from "./ViewsStore"; @@ -55,6 +56,7 @@ export default class RootStore { searches: SearchesStore; shares: SharesStore; ui: UiStore; + unfurls: UnfurlsStore; stars: StarsStore; subscriptions: SubscriptionsStore; users: UsersStore; @@ -85,6 +87,7 @@ export default class RootStore { this.registerStore(SharesStore); this.registerStore(StarsStore); this.registerStore(SubscriptionsStore); + this.registerStore(UnfurlsStore); this.registerStore(UsersStore); this.registerStore(ViewsStore); this.registerStore(FileOperationsStore); diff --git a/app/stores/UnfurlsStore.ts b/app/stores/UnfurlsStore.ts new file mode 100644 index 0000000000..42692e90c9 --- /dev/null +++ b/app/stores/UnfurlsStore.ts @@ -0,0 +1,85 @@ +import { subMinutes } from "date-fns"; +import { action } from "mobx"; +import { UnfurlResourceType } from "@shared/types"; +import Unfurl from "~/models/Unfurl"; +import { client } from "~/utils/ApiClient"; +import Logger from "~/utils/Logger"; +import RootStore from "./RootStore"; +import Store from "./base/Store"; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +class UnfurlsStore extends Store> { + actions = []; // no default actions allowed for unfurls. + + constructor(rootStore: RootStore) { + super(rootStore, Unfurl); + } + + fetchUnfurl = async ({ + url, + documentId, + }: { + url: string; + documentId?: string; + }): Promise | undefined> => { + const unfurl = this.get(url); + + if (unfurl) { + this.refetch({ unfurl: unfurl as Unfurl, documentId }); + return unfurl; + } + + return this.unfurl({ url, documentId }); + }; + + private refetch = ({ + unfurl, + documentId, + }: { + unfurl: Unfurl; + documentId?: string; + }) => { + const fiveMinutesAgo = subMinutes(new Date(), 5); + + if (new Date(unfurl.fetchedAt) < fiveMinutesAgo) { + void this.unfurl({ url: unfurl.id, documentId }); + } + }; + + @action + private unfurl = async ({ + url, + documentId, + }: { + url: string; + documentId?: string; + }): Promise | undefined> => { + try { + this.isFetching = true; + + const data = await client.post("/urls.unfurl", { + url, + documentId, + }); + + // unfurls can succeed with no data. + if (!data) { + return; + } + + return this.add({ + id: url, + type: data.type, + fetchedAt: new Date().toISOString(), + data, + } as Unfurl); + } catch (err) { + Logger.error(`Failed to unfurl url ${url}`, err); + return; + } finally { + this.isFetching = false; + } + }; +} + +export default UnfurlsStore; From c3de0cf0ec047571956e65ff8fd0c3f14a5bb3d3 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Thu, 10 Apr 2025 22:53:08 -0400 Subject: [PATCH 16/59] v0.83.0 (#8928) --- LICENSE | 4 ++-- package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/LICENSE b/LICENSE index 3eeb03aa9a..a53c10886f 100644 --- a/LICENSE +++ b/LICENSE @@ -3,7 +3,7 @@ Business Source License 1.1 Parameters Licensor: General Outline, Inc. -Licensed Work: Outline 0.82.0 +Licensed Work: Outline 0.83.0 The Licensed Work is (c) 2025 General Outline, Inc. Additional Use Grant: You may make use of the Licensed Work, provided that you may not use the Licensed Work for a Document @@ -15,7 +15,7 @@ Additional Use Grant: You may make use of the Licensed Work, provided that Licensed Work by creating teams and documents controlled by such third parties. -Change Date: 2029-02-15 +Change Date: 2029-04-11 Change License: Apache License, Version 2.0 diff --git a/package.json b/package.json index af71285cbf..c223ff2282 100644 --- a/package.json +++ b/package.json @@ -377,5 +377,5 @@ "rollup": "^4.5.1", "prismjs": "1.30.0" }, - "version": "0.82.0" -} \ No newline at end of file + "version": "0.83.0" +} From 9c9657f4cc528464397e9c68e47182f2e9c77f68 Mon Sep 17 00:00:00 2001 From: Hemachandar <132386067+hmacr@users.noreply.github.com> Date: Sat, 12 Apr 2025 06:26:28 +0530 Subject: [PATCH 17/59] eslint: Increase severity to error for lodash imports (#8932) --- .eslintrc | 2 +- app/stores/base/Store.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index fcc8e7b8f7..38207533d4 100644 --- a/.eslintrc +++ b/.eslintrc @@ -65,7 +65,7 @@ ], "padding-line-between-statements": ["error", { "blankLine": "always", "prev": "*", "next": "export" }], "lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }], - "lodash/import-scope": ["warn", "method"], + "lodash/import-scope": ["error", "method"], "import/no-named-as-default": "off", "import/no-named-as-default-member": "off", "import/newline-after-import": 2, diff --git a/app/stores/base/Store.ts b/app/stores/base/Store.ts index 498e783c41..9bce939270 100644 --- a/app/stores/base/Store.ts +++ b/app/stores/base/Store.ts @@ -1,5 +1,6 @@ import commandScore from "command-score"; import invariant from "invariant"; +// eslint-disable-next-line lodash/import-scope import type { ObjectIterateeCustom } from "lodash"; import deburr from "lodash/deburr"; import filter from "lodash/filter"; From 45f08855338855b82004c9eff70461a3f09fc1d3 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 12 Apr 2025 13:07:48 -0400 Subject: [PATCH 18/59] fix: bundle-size CI (#8940) --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 82f831b838..8984265c1a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,6 +63,7 @@ jobs: runs-on: ubuntu-latest outputs: server: ${{ steps.filter.outputs.server }} + app: ${{ steps.filter.outputs.app }} steps: - uses: actions/checkout@v4 - uses: dorny/paths-filter@v2 @@ -81,7 +82,7 @@ jobs: - 'yarn.lock' test: - needs: build + needs: [build, changes] if: ${{ needs.changes.outputs.app == 'true' }} runs-on: ubuntu-latest strategy: @@ -143,7 +144,7 @@ jobs: yarn test --maxWorkers=2 $TESTFILES bundle-size: - needs: [build, types] + needs: [build, types, changes] if: ${{ needs.changes.outputs.app == 'true' }} runs-on: ubuntu-latest steps: @@ -161,3 +162,4 @@ jobs: with: key: ${{ secrets.RELATIVE_CI_KEY }} token: ${{ secrets.GITHUB_TOKEN }} + webpackStatsFile: ./build/app/webpack-stats.json From a61b53aa7496aa1deedd71d10b1c9f2879aa229c Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 12 Apr 2025 13:55:15 -0400 Subject: [PATCH 19/59] Require collection manage permissions to export (#8942) --- server/policies/collection.ts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/server/policies/collection.ts b/server/policies/collection.ts index 132bfdd68a..5d4668958c 100644 --- a/server/policies/collection.ts +++ b/server/policies/collection.ts @@ -2,7 +2,7 @@ import invariant from "invariant"; import filter from "lodash/filter"; import { CollectionPermission } from "@shared/types"; import { Collection, User, Team } from "@server/models"; -import { allow, can } from "./cancan"; +import { allow } from "./cancan"; import { and, isTeamAdmin, isTeamModel, isTeamMutable, or } from "./utils"; allow(User, "createCollection", Team, (actor, team) => @@ -67,15 +67,6 @@ allow( } ); -allow(User, "export", Collection, (actor, collection) => - and( - // - can(actor, "read", collection), - !actor.isViewer, - !actor.isGuest - ) -); - allow(User, "share", Collection, (user, collection) => { if ( !collection || @@ -161,7 +152,7 @@ allow( } ); -allow(User, ["update", "archive"], Collection, (user, collection) => +allow(User, ["update", "export", "archive"], Collection, (user, collection) => and( !!collection, !!collection?.isActive, From a71381785ccf7437a14a2c2ea29e43213ee0f366 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 12 Apr 2025 10:55:27 -0700 Subject: [PATCH 20/59] chore(deps): bump vite from 5.4.17 to 5.4.18 (#8941) Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.17 to 5.4.18. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/v5.4.18/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v5.4.18/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-version: 5.4.18 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index c223ff2282..b414f4338a 100644 --- a/package.json +++ b/package.json @@ -248,7 +248,7 @@ "uuid": "^8.3.2", "validator": "13.12.0", "vaul": "^1.1.2", - "vite": "^5.4.17", + "vite": "^5.4.18", "vite-plugin-pwa": "^0.20.3", "winston": "^3.17.0", "ws": "^7.5.10", diff --git a/yarn.lock b/yarn.lock index 7870bdc17c..8bca9496be 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15605,10 +15605,10 @@ vite-plugin-static-copy@^0.17.0: fs-extra "^11.1.0" picocolors "^1.0.0" -vite@^5.4.17: - version "5.4.17" - resolved "https://registry.yarnpkg.com/vite/-/vite-5.4.17.tgz#4bf61dd4cdbf64b0d6661f5dba76954cc81d5082" - integrity sha512-5+VqZryDj4wgCs55o9Lp+p8GE78TLVg0lasCH5xFZ4jacZjtqZa6JUw9/p0WeAojaOfncSM6v77InkFPGnvPvg== +vite@^5.4.18: + version "5.4.18" + resolved "https://registry.yarnpkg.com/vite/-/vite-5.4.18.tgz#b5af357f9d5ebb2e0c085779b7a37a77f09168a4" + integrity sha512-1oDcnEp3lVyHCuQ2YFelM4Alm2o91xNoMncRm1U7S+JdYfYOvbiGZ3/CxGttrOu2M/KcGz7cRC2DoNUA6urmMA== dependencies: esbuild "^0.21.3" postcss "^8.4.43" From f22780e944eaa0630f78d33674e43744fe50e958 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 12 Apr 2025 13:55:47 -0400 Subject: [PATCH 21/59] Move editor syntax highlighting to async (#8934) * Move editor syntax highlighting to async, add a bunch more languages * Remove vestigial referenecs to Prism * fix: bundle-size job not triggering * Add webpackStatsFile --- .../{Prism.ts => CodeHighlighting.ts} | 77 ++++++++++-- shared/editor/lib/code.test.ts | 16 +-- shared/editor/lib/code.ts | 31 +++-- shared/editor/nodes/CodeFence.ts | 119 ++---------------- 4 files changed, 104 insertions(+), 139 deletions(-) rename shared/editor/extensions/{Prism.ts => CodeHighlighting.ts} (69%) diff --git a/shared/editor/extensions/Prism.ts b/shared/editor/extensions/CodeHighlighting.ts similarity index 69% rename from shared/editor/extensions/Prism.ts rename to shared/editor/extensions/CodeHighlighting.ts index b5f939fb9f..de11411591 100644 --- a/shared/editor/extensions/Prism.ts +++ b/shared/editor/extensions/CodeHighlighting.ts @@ -4,7 +4,7 @@ import { Node } from "prosemirror-model"; import { Plugin, PluginKey, Transaction } from "prosemirror-state"; import { Decoration, DecorationSet } from "prosemirror-view"; import refractor from "refractor/core"; -import { getPrismLangForLanguage } from "../lib/code"; +import { getRefractorLangForLanguage } from "../lib/code"; import { isRemoteTransaction } from "../lib/multiplayer"; import { findBlockNodes } from "../queries/findChildren"; @@ -14,6 +14,34 @@ type ParsedNode = { }; const cache: Record = {}; +const languagesToImport = new Set(); + +async function loadLanguage(language: string) { + if (!language || refractor.registered(language)) { + return; + } + try { + // @ts-expect-error we are adding a module to the window object to work + // around the fact that refractor doesn't export ESM but import expects it. + // See the rules of dynamic imports: + // https://github.com/rollup/plugins/blob/e1a5ef99f1578eb38a8c87563cb9651db228f3bd/packages/dynamic-import-vars/README.md#limitations + window.module ??= {}; + return import(`../../../node_modules/refractor/lang/${language}.js`).then( + () => { + refractor.register(window.module.exports); + return language; + } + ); + } catch (err) { + // It will retry loading the language on the next render + // eslint-disable-next-line no-console + console.error( + `Failed to load language ${language} for code highlighting`, + err + ); + } + return; +} function getDecorations({ doc, @@ -57,12 +85,20 @@ function getDecorations({ blocks.forEach((block) => { let startPos = block.pos + 1; - const language = getPrismLangForLanguage(block.node.attrs.language); + const language = getRefractorLangForLanguage(block.node.attrs.language); - if (!language || !refractor.registered(language)) { + if (!language) { return; } + // If the language isn't registered yet, trigger loading it + if (!refractor.registered(language)) { + languagesToImport.add(language); + return; + } else { + languagesToImport.delete(language); + } + const lineDecorations = []; if (!cache[block.pos] || !cache[block.pos].node.eq(block.node)) { @@ -133,7 +169,7 @@ function getDecorations({ return DecorationSet.create(doc, decorations); } -export default function Prism({ +export function CodeHighlighting({ name, lineNumbers, }: { @@ -145,7 +181,7 @@ export default function Prism({ let highlighted = false; return new Plugin({ - key: new PluginKey("prism"), + key: new PluginKey("codeHighlighting"), state: { init: (_, { doc }) => DecorationSet.create(doc, []), apply: (transaction: Transaction, decorationSet, oldState, state) => { @@ -156,11 +192,13 @@ export default function Prism({ // @ts-expect-error accessing private field. const isPaste = transaction.meta?.paste; + const langLoaded = transaction.getMeta("codeHighlighting")?.langLoaded; if ( !highlighted || codeBlockChanged || isPaste || + langLoaded || isRemoteTransaction(transaction) ) { highlighted = true; @@ -174,15 +212,34 @@ export default function Prism({ if (!highlighted) { // we don't highlight code blocks on the first render as part of mounting // as it's expensive (relative to the rest of the document). Instead let - // it render un-highlighted and then trigger a defered render of Prism + // it render un-highlighted and then trigger a defered render of highlighting // by updating the plugins metadata - setTimeout(() => { + requestAnimationFrame(() => { if (!view.isDestroyed) { - view.dispatch(view.state.tr.setMeta("prism", { loaded: true })); + view.dispatch( + view.state.tr.setMeta("codeHighlighting", { loaded: true }) + ); } - }, 10); + }); } - return {}; + return { + update: () => { + if (!languagesToImport.size) { + return; + } + + void Promise.all([...languagesToImport].map(loadLanguage)).then( + (language) => + languagesToImport.size + ? view.dispatch( + view.state.tr.setMeta("codeHighlighting", { + langLoaded: language, + }) + ) + : null + ); + }, + }; }, props: { decorations(state) { diff --git a/shared/editor/lib/code.test.ts b/shared/editor/lib/code.test.ts index 4e058b1768..369f82854d 100644 --- a/shared/editor/lib/code.test.ts +++ b/shared/editor/lib/code.test.ts @@ -1,12 +1,12 @@ -import { getPrismLangForLanguage, getLabelForLanguage } from "./code"; +import { getRefractorLangForLanguage, getLabelForLanguage } from "./code"; -describe("getPrismLangForLanguage", () => { - it("should return the correct Prism language identifier for a given language", () => { - expect(getPrismLangForLanguage("javascript")).toBe("javascript"); - expect(getPrismLangForLanguage("mermaidjs")).toBe("mermaid"); - expect(getPrismLangForLanguage("xml")).toBe("markup"); - expect(getPrismLangForLanguage("unknown")).toBeUndefined(); - expect(getPrismLangForLanguage("")).toBeUndefined(); +describe("getRefractorLangForLanguage", () => { + it("should return the correct lang identifier for a given language", () => { + expect(getRefractorLangForLanguage("javascript")).toBe("javascript"); + expect(getRefractorLangForLanguage("mermaidjs")).toBe("mermaid"); + expect(getRefractorLangForLanguage("xml")).toBe("markup"); + expect(getRefractorLangForLanguage("unknown")).toBeUndefined(); + expect(getRefractorLangForLanguage("")).toBeUndefined(); }); }); diff --git a/shared/editor/lib/code.ts b/shared/editor/lib/code.ts index 38cc3e3fd4..e87ae1e6b0 100644 --- a/shared/editor/lib/code.ts +++ b/shared/editor/lib/code.ts @@ -1,6 +1,6 @@ import Storage from "../../utils/Storage"; -const RecentStorageKey = "rme-code-language"; +const RecentlyUsedStorageKey = "rme-code-language"; const StorageKey = "frequent-code-languages"; const frequentLanguagesToGet = 5; const frequentLanguagesToTrack = 10; @@ -9,7 +9,7 @@ const frequentLanguagesToTrack = 10; * List of supported code languages. * * Object key is the language identifier used in the editor, lang is the - * language identifier used by Prism. Note mismatches such as `markup` and + * language identifier used by Refractor. Note mismatches such as `markup` and * `mermaid`. */ export const codeLanguages = { @@ -19,8 +19,10 @@ export const codeLanguages = { cpp: { lang: "cpp", label: "C++" }, csharp: { lang: "csharp", label: "C#" }, css: { lang: "css", label: "CSS" }, + csv: { lang: "csv", label: "CSV" }, docker: { lang: "docker", label: "Docker" }, elixir: { lang: "elixir", label: "Elixir" }, + erb: { lang: "erb", label: "ERB" }, erlang: { lang: "erlang", label: "Erlang" }, go: { lang: "go", label: "Go" }, graphql: { lang: "graphql", label: "GraphQL" }, @@ -34,8 +36,11 @@ export const codeLanguages = { json: { lang: "json", label: "JSON" }, jsx: { lang: "jsx", label: "JSX" }, kotlin: { lang: "kotlin", label: "Kotlin" }, + kusto: { lang: "kusto", label: "Kusto" }, lisp: { lang: "lisp", label: "Lisp" }, lua: { lang: "lua", label: "Lua" }, + makefile: { lang: "makefile", label: "Makefile" }, + markdown: { lang: "markdown", label: "Markdown" }, mermaidjs: { lang: "mermaid", label: "Mermaid Diagram" }, nginx: { lang: "nginx", label: "Nginx" }, nix: { lang: "nix", label: "Nix" }, @@ -47,11 +52,13 @@ export const codeLanguages = { protobuf: { lang: "protobuf", label: "Protobuf" }, python: { lang: "python", label: "Python" }, r: { lang: "r", label: "R" }, + regex: { lang: "regex", label: "Regex" }, ruby: { lang: "ruby", label: "Ruby" }, rust: { lang: "rust", label: "Rust" }, scala: { lang: "scala", label: "Scala" }, sass: { lang: "sass", label: "Sass" }, scss: { lang: "scss", label: "SCSS" }, + "splunk-spl": { lang: "splunk-spl", label: "Splunk SPL" }, sql: { lang: "sql", label: "SQL" }, solidity: { lang: "solidity", label: "Solidity" }, swift: { lang: "swift", label: "Swift" }, @@ -79,12 +86,14 @@ export const getLabelForLanguage = (language: string) => { }; /** - * Get the Prism language identifier for a given language. + * Get the Refractor language identifier for a given language. * * @param language The language identifier. - * @returns The Prism language identifier for the language. + * @returns The Refractor language identifier for the language. */ -export const getPrismLangForLanguage = (language: string): string | undefined => +export const getRefractorLangForLanguage = ( + language: string +): string | undefined => codeLanguages[language as keyof typeof codeLanguages]?.lang; /** @@ -92,14 +101,14 @@ export const getPrismLangForLanguage = (language: string): string | undefined => * * @param language The language identifier. */ -export const setRecentCodeLanguage = (language: string) => { +export const setRecentlyUsedCodeLanguage = (language: string) => { const frequentLangs = (Storage.get(StorageKey) ?? {}) as Record< string, number >; if (Object.keys(frequentLangs).length === 0) { - const lastUsedLang = Storage.get(RecentStorageKey); + const lastUsedLang = Storage.get(RecentlyUsedStorageKey); if (lastUsedLang) { frequentLangs[lastUsedLang] = 1; } @@ -121,7 +130,7 @@ export const setRecentCodeLanguage = (language: string) => { } Storage.set(StorageKey, Object.fromEntries(frequentLangEntries)); - Storage.set(RecentStorageKey, language); + Storage.set(RecentlyUsedStorageKey, language); }; /** @@ -129,8 +138,8 @@ export const setRecentCodeLanguage = (language: string) => { * * @returns The most recent code language used, or undefined if none is set. */ -export const getRecentCodeLanguage = () => - Storage.get(RecentStorageKey) as keyof typeof codeLanguages | undefined; +export const getRecentlyUsedCodeLanguage = () => + Storage.get(RecentlyUsedStorageKey) as keyof typeof codeLanguages | undefined; /** * Get the most frequent code languages used. @@ -138,7 +147,7 @@ export const getRecentCodeLanguage = () => * @returns An array of the most frequent code languages used. */ export const getFrequentCodeLanguages = () => { - const recentLang = Storage.get(RecentStorageKey); + const recentLang = Storage.get(RecentlyUsedStorageKey); const frequentLangEntries = Object.entries(Storage.get(StorageKey) ?? {}) as [ keyof typeof codeLanguages, number diff --git a/shared/editor/nodes/CodeFence.ts b/shared/editor/nodes/CodeFence.ts index db26dd53a2..e6931184b7 100644 --- a/shared/editor/nodes/CodeFence.ts +++ b/shared/editor/nodes/CodeFence.ts @@ -9,58 +9,6 @@ import { } from "prosemirror-model"; import { Command, Plugin, PluginKey, TextSelection } from "prosemirror-state"; import { Decoration, DecorationSet } from "prosemirror-view"; -import refractor from "refractor/core"; -import bash from "refractor/lang/bash"; -import clike from "refractor/lang/clike"; -import cpp from "refractor/lang/cpp"; -import csharp from "refractor/lang/csharp"; -import css from "refractor/lang/css"; -import docker from "refractor/lang/docker"; -import elixir from "refractor/lang/elixir"; -import erlang from "refractor/lang/erlang"; -import go from "refractor/lang/go"; -import graphql from "refractor/lang/graphql"; -import groovy from "refractor/lang/groovy"; -import haskell from "refractor/lang/haskell"; -import hcl from "refractor/lang/hcl"; -import ini from "refractor/lang/ini"; -import java from "refractor/lang/java"; -import javascript from "refractor/lang/javascript"; -import json from "refractor/lang/json"; -import jsx from "refractor/lang/jsx"; -import kotlin from "refractor/lang/kotlin"; -import lisp from "refractor/lang/lisp"; -import lua from "refractor/lang/lua"; -import markup from "refractor/lang/markup"; -// @ts-expect-error type definition is missing, but package exists -import mermaid from "refractor/lang/mermaid"; -import nginx from "refractor/lang/nginx"; -import nix from "refractor/lang/nix"; -import objectivec from "refractor/lang/objectivec"; -import ocaml from "refractor/lang/ocaml"; -import perl from "refractor/lang/perl"; -import php from "refractor/lang/php"; -import powershell from "refractor/lang/powershell"; -import protobuf from "refractor/lang/protobuf"; -import python from "refractor/lang/python"; -import r from "refractor/lang/r"; -import ruby from "refractor/lang/ruby"; -import rust from "refractor/lang/rust"; -import sass from "refractor/lang/sass"; -import scala from "refractor/lang/scala"; -import scss from "refractor/lang/scss"; -import solidity from "refractor/lang/solidity"; -import sql from "refractor/lang/sql"; -import swift from "refractor/lang/swift"; -import toml from "refractor/lang/toml"; -import tsx from "refractor/lang/tsx"; -import typescript from "refractor/lang/typescript"; -import verilog from "refractor/lang/verilog"; -import vhdl from "refractor/lang/vhdl"; -import visualbasic from "refractor/lang/visual-basic"; -import yaml from "refractor/lang/yaml"; -import zig from "refractor/lang/zig"; - import { toast } from "sonner"; import { Primitive } from "utility-types"; import type { Dictionary } from "~/hooks/useDictionary"; @@ -77,9 +25,12 @@ import { } from "../commands/codeFence"; import { selectAll } from "../commands/selectAll"; import toggleBlockType from "../commands/toggleBlockType"; +import { CodeHighlighting } from "../extensions/CodeHighlighting"; import Mermaid from "../extensions/Mermaid"; -import Prism from "../extensions/Prism"; -import { getRecentCodeLanguage, setRecentCodeLanguage } from "../lib/code"; +import { + getRecentlyUsedCodeLanguage, + setRecentlyUsedCodeLanguage, +} from "../lib/code"; import { isCode } from "../lib/isCode"; import { MarkdownSerializerState } from "../lib/markdown/serializer"; import { findNextNewline, findPreviousNewline } from "../queries/findNewlines"; @@ -90,58 +41,6 @@ import Node from "./Node"; const DEFAULT_LANGUAGE = "javascript"; -[ - bash, - cpp, - css, - clike, - csharp, - docker, - elixir, - erlang, - go, - graphql, - groovy, - haskell, - hcl, - ini, - java, - javascript, - jsx, - json, - kotlin, - lisp, - lua, - markup, - mermaid, - nginx, - nix, - objectivec, - ocaml, - perl, - php, - python, - powershell, - protobuf, - r, - ruby, - rust, - scala, - sql, - solidity, - sass, - scss, - swift, - toml, - typescript, - tsx, - verilog, - vhdl, - visualbasic, - yaml, - zig, -].forEach(refractor.register); - export default class CodeFence extends Node { constructor(options: { dictionary: Dictionary; @@ -212,10 +111,10 @@ export default class CodeFence extends Node { return { code_block: (attrs: Record) => { if (attrs?.language) { - setRecentCodeLanguage(attrs.language as string); + setRecentlyUsedCodeLanguage(attrs.language as string); } return toggleBlockType(type, schema.nodes.paragraph, { - language: getRecentCodeLanguage() ?? DEFAULT_LANGUAGE, + language: getRecentlyUsedCodeLanguage() ?? DEFAULT_LANGUAGE, ...attrs, }); }, @@ -286,7 +185,7 @@ export default class CodeFence extends Node { get plugins() { return [ - Prism({ + CodeHighlighting({ name: this.name, lineNumbers: this.showLineNumbers, }), @@ -353,7 +252,7 @@ export default class CodeFence extends Node { inputRules({ type }: { type: NodeType }) { return [ textblockTypeInputRule(/^```$/, type, () => ({ - language: getRecentCodeLanguage() ?? DEFAULT_LANGUAGE, + language: getRecentlyUsedCodeLanguage() ?? DEFAULT_LANGUAGE, })), ]; } From 199584428a54d7180c3a43defd1b91e9634b74d7 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 12 Apr 2025 15:15:52 -0400 Subject: [PATCH 22/59] fix: Markdown copy should not occur for single node situations (#8946) --- .../extensions/ClipboardTextSerializer.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/app/editor/extensions/ClipboardTextSerializer.ts b/app/editor/extensions/ClipboardTextSerializer.ts index 5fb3a90550..44e0f983ce 100644 --- a/app/editor/extensions/ClipboardTextSerializer.ts +++ b/app/editor/extensions/ClipboardTextSerializer.ts @@ -1,5 +1,6 @@ import { Plugin, PluginKey } from "prosemirror-state"; import Extension from "@shared/editor/lib/Extension"; +import { isList } from "@shared/editor/queries/isList"; import { ProsemirrorHelper } from "@shared/utils/ProsemirrorHelper"; /** @@ -18,17 +19,25 @@ export default class ClipboardTextSerializer extends Extension { new Plugin({ key: new PluginKey("clipboardTextSerializer"), props: { - clipboardTextSerializer: (slice) => { + clipboardTextSerializer: (slice, view) => { const isMultiline = slice.content.childCount > 1; // This is a cheap way to determine if the content is "complex", // aka it has multiple marks or formatting. In which case we'll use // markdown formatting + const hasMultipleListItems = slice.content.content + .filter((node) => node.content.content.length > 1) + .some((node) => isList(node, view.state.schema)); + const hasMultipleBlockTypes = + [ + ...new Set( + slice.content.content + .filter((node) => node.content.content.length > 1) + .map((node) => node.type.name) + ), + ].length > 1; const copyAsMarkdown = - isMultiline || - slice.content.content.some( - (node) => node.content.content.length > 1 - ); + isMultiline || hasMultipleBlockTypes || hasMultipleListItems; return copyAsMarkdown ? mdSerializer.serialize(slice.content, { From 31c412b4a6cea09c3b188d395c5f978ab77264ce Mon Sep 17 00:00:00 2001 From: "codegen-sh[bot]" <131295404+codegen-sh[bot]@users.noreply.github.com> Date: Sat, 12 Apr 2025 19:26:38 +0000 Subject: [PATCH 23/59] refactor: Convert ImageUpload component to functional (#8944) * refactor: Convert ImageUpload component to functional * fix: Fix linting issues by removing trailing whitespace and unused imports * Applied automatic fixes * translations --------- Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com> Co-authored-by: Tom Moor --- .../Settings/components/ImageUpload.tsx | 195 ++++++++---------- shared/i18n/locales/en_US/translation.json | 5 +- 2 files changed, 93 insertions(+), 107 deletions(-) diff --git a/app/scenes/Settings/components/ImageUpload.tsx b/app/scenes/Settings/components/ImageUpload.tsx index 50c43f54ec..c703ae3c91 100644 --- a/app/scenes/Settings/components/ImageUpload.tsx +++ b/app/scenes/Settings/components/ImageUpload.tsx @@ -1,19 +1,19 @@ import invariant from "invariant"; -import { observable } from "mobx"; import { observer } from "mobx-react"; import * as React from "react"; +import { useState, useRef } from "react"; import AvatarEditor from "react-avatar-editor"; import Dropzone from "react-dropzone"; +import { useTranslation } from "react-i18next"; import styled from "styled-components"; import { s } from "@shared/styles"; import { AttachmentPreset } from "@shared/types"; import { AttachmentValidation } from "@shared/validations"; -import RootStore from "~/stores/RootStore"; import ButtonLarge from "~/components/ButtonLarge"; import Flex from "~/components/Flex"; import LoadingIndicator from "~/components/LoadingIndicator"; import Modal from "~/components/Modal"; -import withStores from "~/components/withStores"; +import useStores from "~/hooks/useStores"; import { compressImage } from "~/utils/compressImage"; import { uploadFile, dataUrlToBlob } from "~/utils/files"; @@ -24,41 +24,38 @@ export type Props = { borderRadius?: number; }; -@observer -class ImageUpload extends React.Component { - @observable - isUploading = false; +const ImageUpload: React.FC = ({ + onSuccess, + onError, + submitText, + borderRadius = 150, + children, +}) => { + const { ui } = useStores(); + const { t } = useTranslation(); + submitText || t("Crop image"); - @observable - isCropping = false; + const [isUploading, setIsUploading] = useState(false); + const [isCropping, setIsCropping] = useState(false); + const [zoom, setZoom] = useState(1); + const [file, setFile] = useState(null); - @observable - zoom = 1; + const avatarEditorRef = useRef(null); - @observable - file: File; - - avatarEditorRef = React.createRef(); - - static defaultProps = { - submitText: "Crop Image", - borderRadius: 150, + const onDropAccepted = async (files: File[]) => { + setIsCropping(true); + setFile(files[0]); }; - onDropAccepted = async (files: File[]) => { - this.isCropping = true; - this.file = files[0]; - }; - - handleCrop = () => { - this.isUploading = true; + const handleCrop = () => { + setIsUploading(true); // allow the UI to update before converting the canvas to a Blob // for large images this can cause the page rendering to hang. - setTimeout(this.uploadImage, 0); + setTimeout(uploadImage, 0); }; - uploadImage = async () => { - const canvas = this.avatarEditorRef.current?.getImage(); + const uploadImage = async () => { + const canvas = avatarEditorRef.current?.getImage(); invariant(canvas, "canvas is not defined"); const imageBlob = dataUrlToBlob(canvas.toDataURL()); @@ -68,99 +65,87 @@ class ImageUpload extends React.Component { maxWidth: 512, }); const attachment = await uploadFile(compressed, { - name: this.file.name, + name: file!.name, preset: AttachmentPreset.Avatar, }); - void this.props.onSuccess(attachment.url); + void onSuccess(attachment.url); } catch (err) { - this.props.onError(err.message); + onError(err.message); } finally { - this.isUploading = false; - this.isCropping = false; + setIsUploading(false); + setIsCropping(false); } }; - handleClose = () => { - this.isUploading = false; - this.isCropping = false; + const handleClose = () => { + setIsUploading(false); + setIsCropping(false); }; - handleZoom = (event: React.ChangeEvent) => { + const handleZoom = (event: React.ChangeEvent) => { const target = event.target; if (target instanceof HTMLInputElement) { - this.zoom = parseFloat(target.value); + setZoom(parseFloat(target.value)); } }; - renderCropping() { - const { ui, submitText } = this.props; - - return ( -  } - isOpen - > - - {this.isUploading && } - - - - ( +  } + isOpen + > + + {isUploading && } + + -
- - {this.isUploading ? "Uploading…" : submitText} - -
-
- ); + + +
+ + {isUploading ? `${t(`Uploading`)}…` : submitText} + +
+
+ ); + + if (isCropping && file) { + return renderCropping(); } - render() { - if (this.isCropping) { - return this.renderCropping(); - } - - return ( - - {({ getRootProps, getInputProps }) => ( -
- - {this.props.children} -
- )} -
- ); - } -} + return ( + + {({ getRootProps, getInputProps }) => ( +
+ + {children} +
+ )} +
+ ); +}; const AvatarEditorContainer = styled(Flex)` margin-bottom: 30px; @@ -191,4 +176,4 @@ const RangeInput = styled.input` } `; -export default withStores(ImageUpload); +export default observer(ImageUpload); diff --git a/shared/i18n/locales/en_US/translation.json b/shared/i18n/locales/en_US/translation.json index 209eb76c0c..f6beb85df4 100644 --- a/shared/i18n/locales/en_US/translation.json +++ b/shared/i18n/locales/en_US/translation.json @@ -893,6 +893,8 @@ "No people left to add": "No people left to add", "Date created": "Date created", "Upload": "Upload", + "Crop image": "Crop image", + "Uploading": "Uploading", "How does this work?": "How does this work?", "You can import a zip file that was previously exported from the JSON option in another instance. In {{ appName }}, open Export in the Settings sidebar and click on Export Data.": "You can import a zip file that was previously exported from the JSON option in another instance. In {{ appName }}, open Export in the Settings sidebar and click on Export Data.", "Drag and drop the zip file from the JSON export option in {{appName}}, or click to upload": "Drag and drop the zip file from the JSON export option in {{appName}}, or click to upload", @@ -1153,6 +1155,5 @@ "You updated {{ timeAgo }}": "You updated {{ timeAgo }}", "{{ user }} updated {{ timeAgo }}": "{{ user }} updated {{ timeAgo }}", "You created {{ timeAgo }}": "You created {{ timeAgo }}", - "{{ user }} created {{ timeAgo }}": "{{ user }} created {{ timeAgo }}", - "Uploading": "Uploading" + "{{ user }} created {{ timeAgo }}": "{{ user }} created {{ timeAgo }}" } From 89db519b7209a99e5ac23fdb5ecae4fb9f319072 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 12 Apr 2025 15:40:08 -0400 Subject: [PATCH 24/59] Replace embed icon (#8947) --- public/images/embed.png | Bin 1054 -> 0 bytes shared/editor/embeds/index.tsx | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) delete mode 100644 public/images/embed.png diff --git a/public/images/embed.png b/public/images/embed.png deleted file mode 100644 index 2dee0f9a262cb1ec9a3f9e50442dd7e3289f53fc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1054 zcmeAS@N?(olHy`uVBq!ia0vp^6(G#P1|%(0%q{^b&H|6fVg?3oVGw3ym^DX&fr0sg zr;B4q#jUq<_vcAD3bcQp*)%7>%`5kzm}O8*s08^q>9eipQs1pIpq4elh9U z_hV;`{(gL7{QYPW+k+?jmpFg?8NBQ9+4S~)_2(=PSSBeJTC40AF{)W+_3Zue!^bBV zZ!(Cnep}GL^TzER7XHO&lAX`_TBmGnxWCtyH*Zzq=NbE(??!z8e@^s(`m5*s^+i`0 zbQGU+J#aC;F+C}$qT^og`}+)YMAz{=UwJO^b*+D|Oxaq^1M&NRJn)$LLEyBg)GeD$ zQU|7A{?L6Z^~ckaM&-^M%fAORxZhlOH)8FlxzlUPG*WcGos4XoeS6V~^zXGl<~T5? zgx`L>Zfd;4S@Q)|2g{zSA#on#ZL{VK$pKC$yWWeRjS)bE$fVpLI;- z{9{jdMD)kJvKD3BV>VCcMB(FQYaCW`Sv>oH%E_~*tpClHTZ-DQxeHyHmf94V9WeB+ z-)fWGegAsq?!~*8+V0S_DOx9ZI&)SLO?FyS%!l-m4~sq(-mYy>MyT+-Fx}U!QJO4chEi{A%4(*8f2( zBbQs2F0W*-JyWh#`FNJbuFEebI$H^tM3+oYDsNb}^vLX`b1Pjx9{N7xE~Au9QO|YX zo2R|MUYja$KBAcYZ_={sd@FC)q~)^j-NwhFwyi(vzopr0BAes8~^|S diff --git a/shared/editor/embeds/index.tsx b/shared/editor/embeds/index.tsx index 5ca822d026..11234fda8f 100644 --- a/shared/editor/embeds/index.tsx +++ b/shared/editor/embeds/index.tsx @@ -1,3 +1,4 @@ +import { BrowserIcon } from "outline-icons"; import * as React from "react"; import styled from "styled-components"; import { Primitive } from "utility-types"; @@ -665,7 +666,7 @@ const embeds: EmbedDescriptor[] = [ title: "Embed", keywords: "iframe webpage", placeholder: "Paste a URL to embed", - icon: Embed, + icon: , defaultHidden: false, matchOnInput: false, regexMatch: [new RegExp("^https?://(.*)$")], From 68e8b2791affd048ff742d2d7e44fdcf316b6b7e Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 12 Apr 2025 21:25:15 -0400 Subject: [PATCH 25/59] fix: Line numbers flash in on load (#8948) fix: Text color of plain text and markdown code blocks --- shared/editor/components/Styles.ts | 7 ++ shared/editor/extensions/CodeHighlighting.ts | 74 ++++++++++---------- 2 files changed, 44 insertions(+), 37 deletions(-) diff --git a/shared/editor/components/Styles.ts b/shared/editor/components/Styles.ts index bb636b9d23..b8f2e375ca 100644 --- a/shared/editor/components/Styles.ts +++ b/shared/editor/components/Styles.ts @@ -1335,6 +1335,13 @@ mark { position: relative; } +.code-block[data-language=none], +.code-block[data-language=markdown] { + pre code { + color: ${props.theme.text}; + } +} + .code-block[data-language=mermaidjs] { margin: 0.75em 0; diff --git a/shared/editor/extensions/CodeHighlighting.ts b/shared/editor/extensions/CodeHighlighting.ts index de11411591..99ceb76a60 100644 --- a/shared/editor/extensions/CodeHighlighting.ts +++ b/shared/editor/extensions/CodeHighlighting.ts @@ -86,19 +86,6 @@ function getDecorations({ blocks.forEach((block) => { let startPos = block.pos + 1; const language = getRefractorLangForLanguage(block.node.attrs.language); - - if (!language) { - return; - } - - // If the language isn't registered yet, trigger loading it - if (!refractor.registered(language)) { - languagesToImport.add(language); - return; - } else { - languagesToImport.delete(language); - } - const lineDecorations = []; if (!cache[block.pos] || !cache[block.pos].node.eq(block.node)) { @@ -127,35 +114,48 @@ function getDecorations({ ); } - const nodes = refractor.highlight(block.node.textContent, language); - const newDecorations = parseNodes(nodes) - .map((node: ParsedNode) => { - const from = startPos; - const to = from + node.text.length; - - startPos = to; - - return { - ...node, - from, - to, - }; - }) - .filter((node) => node.classes && node.classes.length) - .map((node) => - Decoration.inline(node.from, node.to, { - class: node.classes.join(" "), - }) - ) - .concat(lineDecorations); - cache[block.pos] = { node: block.node, - decorations: newDecorations, + decorations: lineDecorations, }; + + if (!language) { + // do nothing + } else if (refractor.registered(language)) { + languagesToImport.delete(language); + + const nodes = refractor.highlight(block.node.textContent, language); + const newDecorations = parseNodes(nodes) + .map((node: ParsedNode) => { + const from = startPos; + const to = from + node.text.length; + + startPos = to; + + return { + ...node, + from, + to, + }; + }) + .filter((node) => node.classes && node.classes.length) + .map((node) => + Decoration.inline(node.from, node.to, { + class: node.classes.join(" "), + }) + ) + .concat(lineDecorations); + + cache[block.pos] = { + node: block.node, + decorations: newDecorations, + }; + } else { + languagesToImport.add(language); + } } - cache[block.pos].decorations.forEach((decoration) => { + cache[block.pos]?.decorations.forEach((decoration) => { decorations.push(decoration); }); }); From bf6a56849e70d9a2b975f4bbcd52fe43a54d8f79 Mon Sep 17 00:00:00 2001 From: Hemachandar <132386067+hmacr@users.noreply.github.com> Date: Sun, 13 Apr 2025 18:39:13 +0530 Subject: [PATCH 26/59] Show GitHub issues and pull requests as mentions (#8870) * mention issue works * pr and loading works * error node * tweak mention display * handle multiple creation error * tidy * store unfurl in mention attrs * simplify mention code creation * test fix * base feedback * update node when pos is available * delete local UnfurlsStore * use unfurl from store * Optimize lodash isMatch import statement * fix: Copy/paste of issue mentions fix: Icon alignment fix: Error and loading mentions are unselectable * Switch order in paste menu --------- Co-authored-by: Tom Moor --- .../HoverPreview/HoverPreviewIssue.tsx | 2 +- .../HoverPreview/HoverPreviewPullRequest.tsx | 2 +- app/components/Text.ts | 72 +----- app/editor/components/PasteMenu.tsx | 83 +++++-- app/editor/extensions/PasteHandler.tsx | 22 +- app/hooks/useIsMounted.ts | 20 +- app/models/Integration.ts | 6 +- .../components/FileOperationListItem.tsx | 2 +- .../Settings/components/ImportListItem.tsx | 2 +- app/utils/mention.ts | 58 +++++ server/models/helpers/ProsemirrorHelper.tsx | 8 +- .../components}/IssueStatusIcon.tsx | 0 .../components}/PullRequestIcon.tsx | 0 {app => shared}/components/Spinner.tsx | 0 shared/components/Text.tsx | 73 ++++++ shared/editor/components/Mentions.tsx | 228 +++++++++++++++++- shared/editor/nodes/Mention.tsx | 103 ++++++-- shared/hooks/useIsMounted.ts | 19 ++ shared/i18n/locales/en_US/translation.json | 4 +- shared/types.ts | 6 +- 20 files changed, 560 insertions(+), 150 deletions(-) create mode 100644 app/utils/mention.ts rename {app/components/Icons => shared/components}/IssueStatusIcon.tsx (100%) rename {app/components/Icons => shared/components}/PullRequestIcon.tsx (100%) rename {app => shared}/components/Spinner.tsx (100%) create mode 100644 shared/components/Text.tsx create mode 100644 shared/hooks/useIsMounted.ts diff --git a/app/components/HoverPreview/HoverPreviewIssue.tsx b/app/components/HoverPreview/HoverPreviewIssue.tsx index 032328ffa0..bf71e62ac4 100644 --- a/app/components/HoverPreview/HoverPreviewIssue.tsx +++ b/app/components/HoverPreview/HoverPreviewIssue.tsx @@ -1,9 +1,9 @@ import * as React from "react"; import { Trans } from "react-i18next"; +import { IssueStatusIcon } from "@shared/components/IssueStatusIcon"; import { UnfurlResourceType, UnfurlResponse } from "@shared/types"; import { Avatar } from "~/components/Avatar"; import Flex from "~/components/Flex"; -import { IssueStatusIcon } from "../Icons/IssueStatusIcon"; import Text from "../Text"; import Time from "../Time"; import { diff --git a/app/components/HoverPreview/HoverPreviewPullRequest.tsx b/app/components/HoverPreview/HoverPreviewPullRequest.tsx index 6393695134..c4165e4bf9 100644 --- a/app/components/HoverPreview/HoverPreviewPullRequest.tsx +++ b/app/components/HoverPreview/HoverPreviewPullRequest.tsx @@ -1,9 +1,9 @@ import * as React from "react"; import { Trans } from "react-i18next"; +import { PullRequestIcon } from "@shared/components/PullRequestIcon"; import { UnfurlResourceType, UnfurlResponse } from "@shared/types"; import { Avatar } from "~/components/Avatar"; import Flex from "~/components/Flex"; -import { PullRequestIcon } from "../Icons/PullRequestIcon"; import Text from "../Text"; import Time from "../Time"; import { diff --git a/app/components/Text.ts b/app/components/Text.ts index 2598b71744..33e6f02816 100644 --- a/app/components/Text.ts +++ b/app/components/Text.ts @@ -1,73 +1,3 @@ -import styled, { css } from "styled-components"; -import { ellipsis } from "@shared/styles"; - -type Props = { - /** The type of text to render */ - type?: "secondary" | "tertiary" | "danger"; - /** The size of the text */ - size?: "xlarge" | "large" | "medium" | "small" | "xsmall"; - /** The direction of the text (defaults to ltr) */ - dir?: "ltr" | "rtl" | "auto"; - /** Whether the text should be selectable (defaults to false) */ - selectable?: boolean; - /** The font weight of the text */ - weight?: "xbold" | "bold" | "normal"; - /** Whether the text should be italic */ - italic?: boolean; - /** Whether the text should be truncated with an ellipsis */ - ellipsis?: boolean; - /** Whether the text should be monospaced */ - monospace?: boolean; -}; - -/** - * Use this component for all interface text that should not be selectable - * by the user, this is the majority of UI text explainers, notes, headings. - */ -const Text = styled.span` - margin-top: 0; - text-align: ${(props) => (props.dir ? props.dir : "inherit")}; - color: ${(props) => - props.type === "secondary" - ? props.theme.textSecondary - : props.type === "tertiary" - ? props.theme.textTertiary - : props.type === "danger" - ? props.theme.brand.red - : props.theme.text}; - font-size: ${(props) => - props.size === "xlarge" - ? "26px" - : props.size === "large" - ? "18px" - : props.size === "medium" - ? "16px" - : props.size === "small" - ? "14px" - : props.size === "xsmall" - ? "13px" - : "inherit"}; - - ${(props) => - props.weight && - css` - font-weight: ${props.weight === "xbold" - ? 600 - : props.weight === "bold" - ? 500 - : props.weight === "normal" - ? 400 - : "inherit"}; - `} - - font-style: ${(props) => (props.italic ? "italic" : "normal")}; - font-family: ${(props) => - props.monospace ? props.theme.fontFamilyMono : "inherit"}; - - white-space: normal; - user-select: ${(props) => (props.selectable ? "text" : "none")}; - - ${(props) => props.ellipsis && ellipsis()} -`; +import Text from "@shared/components/Text"; export default Text; diff --git a/app/editor/components/PasteMenu.tsx b/app/editor/components/PasteMenu.tsx index 883d06c3ca..a0015a7163 100644 --- a/app/editor/components/PasteMenu.tsx +++ b/app/editor/components/PasteMenu.tsx @@ -1,7 +1,15 @@ -import { LinkIcon } from "outline-icons"; +import { observer } from "mobx-react"; +import { EmailIcon, LinkIcon } from "outline-icons"; import React from "react"; import { useTranslation } from "react-i18next"; +import { v4 } from "uuid"; import { EmbedDescriptor } from "@shared/editor/embeds"; +import { MenuItem } from "@shared/editor/types"; +import { MentionType } from "@shared/types"; +import Integration from "~/models/Integration"; +import useCurrentUser from "~/hooks/useCurrentUser"; +import useStores from "~/hooks/useStores"; +import { determineMentionType, isURLMentionable } from "~/utils/mention"; import SuggestionsMenu, { Props as SuggestionsMenuProps, } from "./SuggestionsMenu"; @@ -15,34 +23,65 @@ type Props = Omit< embeds: EmbedDescriptor[]; }; -const PasteMenu = ({ embeds, ...props }: Props) => { +export const PasteMenu = observer(({ pastedText, embeds, ...props }: Props) => { const { t } = useTranslation(); + const { integrations } = useStores(); + const user = useCurrentUser(); + + let mentionType: MentionType | undefined; + const url = pastedText ? new URL(pastedText) : undefined; + + if (url) { + const integration = integrations.find((intg: Integration) => + isURLMentionable({ url, integration: intg }) + ); + + mentionType = integration + ? determineMentionType({ url, integration }) + : undefined; + } const embed = React.useMemo(() => { for (const e of embeds) { - const matches = e.matcher(props.pastedText); + const matches = e.matcher(pastedText); if (matches) { return e; } } return; - }, [embeds, props.pastedText]); + }, [embeds, pastedText]); const items = React.useMemo( - () => [ - { - name: "noop", - title: t("Keep as link"), - icon: , - }, - { - name: "embed", - title: t("Embed"), - icon: embed?.icon, - keywords: embed?.keywords, - }, - ], - [embed, t] + () => + [ + { + name: "noop", + title: t("Keep as link"), + icon: , + }, + { + name: "mention", + title: t("Mention"), + icon: , + visible: !!mentionType, + attrs: { + id: v4(), + type: mentionType, + label: pastedText, + href: pastedText, + modelId: v4(), + actorId: user.id, + }, + appendSpace: true, + }, + { + name: "embed", + title: t("Embed"), + icon: embed?.icon, + keywords: embed?.keywords, + }, + ] satisfies MenuItem[], + [t, embed, mentionType, pastedText, user] ); return ( @@ -52,9 +91,7 @@ const PasteMenu = ({ embeds, ...props }: Props) => { filterable={false} renderMenuItem={(item, _index, options) => ( { - props.onSelect?.(item); - }} + onClick={options.onClick} selected={options.selected} title={item.title} icon={item.icon} @@ -63,6 +100,4 @@ const PasteMenu = ({ embeds, ...props }: Props) => { items={items} /> ); -}; - -export default PasteMenu; +}); diff --git a/app/editor/extensions/PasteHandler.tsx b/app/editor/extensions/PasteHandler.tsx index 7311749f8b..79504fc05c 100644 --- a/app/editor/extensions/PasteHandler.tsx +++ b/app/editor/extensions/PasteHandler.tsx @@ -24,7 +24,7 @@ import parseCollectionSlug from "@shared/utils/parseCollectionSlug"; import parseDocumentSlug from "@shared/utils/parseDocumentSlug"; import { isCollectionUrl, isDocumentUrl, isUrl } from "@shared/utils/urls"; import stores from "~/stores"; -import PasteMenu from "../components/PasteMenu"; +import { PasteMenu } from "../components/PasteMenu"; export default class PasteHandler extends Extension { state: { @@ -415,6 +415,21 @@ export default class PasteHandler extends Extension { }); }; + private insertMention = () => { + const { view } = this.editor; + const { state } = view; + const result = this.findPlaceholder(state, this.state.pastedText); + + // Remove just the placeholder here. + // Mention node will be created by SuggestionsMenu. + if (result) { + const tr = state.tr.deleteRange(result[0], result[1]); + view.dispatch( + tr.setSelection(TextSelection.near(tr.doc.resolve(result[0]))) + ); + } + }; + private removePlaceholder = () => { const { view } = this.editor; const { state } = view; @@ -450,6 +465,11 @@ export default class PasteHandler extends Extension { this.insertEmbed(); break; } + case "mention": { + this.hidePasteMenu(); + this.insertMention(); + break; + } default: break; } diff --git a/app/hooks/useIsMounted.ts b/app/hooks/useIsMounted.ts index c1b6f141b2..3770b66a58 100644 --- a/app/hooks/useIsMounted.ts +++ b/app/hooks/useIsMounted.ts @@ -1,19 +1,3 @@ -import * as React from "react"; +import useIsMounted from "@shared/hooks/useIsMounted"; -/** - * Hook to check if component is still mounted - * - * @returns {boolean} true if the component is mounted, false otherwise - */ -export default function useIsMounted() { - const isMounted = React.useRef(false); - - React.useEffect(() => { - isMounted.current = true; - return () => { - isMounted.current = false; - }; - }, []); - - return React.useCallback(() => isMounted.current, []); -} +export default useIsMounted; diff --git a/app/models/Integration.ts b/app/models/Integration.ts index 7338e36afa..2e8f05123d 100644 --- a/app/models/Integration.ts +++ b/app/models/Integration.ts @@ -1,8 +1,8 @@ import { observable } from "mobx"; -import type { +import { IntegrationService, - IntegrationSettings, - IntegrationType, + type IntegrationSettings, + type IntegrationType, } from "@shared/types"; import User from "~/models/User"; import Model from "~/models/base/Model"; diff --git a/app/scenes/Settings/components/FileOperationListItem.tsx b/app/scenes/Settings/components/FileOperationListItem.tsx index 8e5e932276..19f6101f60 100644 --- a/app/scenes/Settings/components/FileOperationListItem.tsx +++ b/app/scenes/Settings/components/FileOperationListItem.tsx @@ -4,6 +4,7 @@ import * as React from "react"; import { useTranslation } from "react-i18next"; import { toast } from "sonner"; import { useTheme } from "styled-components"; +import Spinner from "@shared/components/Spinner"; import { FileOperationFormat, FileOperationState, @@ -13,7 +14,6 @@ import FileOperation from "~/models/FileOperation"; import { Action } from "~/components/Actions"; import ConfirmationDialog from "~/components/ConfirmationDialog"; import ListItem from "~/components/List/Item"; -import Spinner from "~/components/Spinner"; import Time from "~/components/Time"; import useCurrentUser from "~/hooks/useCurrentUser"; import useStores from "~/hooks/useStores"; diff --git a/app/scenes/Settings/components/ImportListItem.tsx b/app/scenes/Settings/components/ImportListItem.tsx index 2cc8d8f2b0..ce88d822b9 100644 --- a/app/scenes/Settings/components/ImportListItem.tsx +++ b/app/scenes/Settings/components/ImportListItem.tsx @@ -5,12 +5,12 @@ import React from "react"; import { useTranslation } from "react-i18next"; import { toast } from "sonner"; import { useTheme } from "styled-components"; +import Spinner from "@shared/components/Spinner"; import { ImportState } from "@shared/types"; import Import from "~/models/Import"; import { Action } from "~/components/Actions"; import ConfirmationDialog from "~/components/ConfirmationDialog"; import ListItem from "~/components/List/Item"; -import Spinner from "~/components/Spinner"; import Time from "~/components/Time"; import useCurrentUser from "~/hooks/useCurrentUser"; import useStores from "~/hooks/useStores"; diff --git a/app/utils/mention.ts b/app/utils/mention.ts new file mode 100644 index 0000000000..303573e22d --- /dev/null +++ b/app/utils/mention.ts @@ -0,0 +1,58 @@ +import { + IntegrationService, + IntegrationSettings, + IntegrationType, + MentionType, +} from "@shared/types"; +import Integration from "~/models/Integration"; + +export const isURLMentionable = ({ + url, + integration, +}: { + url: URL; + integration: Integration; +}): boolean => { + const { hostname, pathname } = url; + const pathParts = pathname.split("/"); + + switch (integration.service) { + case IntegrationService.GitHub: { + const settings = + integration.settings as IntegrationSettings; + + return ( + hostname === "github.com" && + settings.github?.installation.account.name === pathParts[1] // ensure installed org/account name matches with the provided url. + ); + } + + default: + return false; + } +}; + +export const determineMentionType = ({ + url, + integration, +}: { + url: URL; + integration: Integration; +}): MentionType | undefined => { + const { pathname } = url; + const pathParts = pathname.split("/"); + + switch (integration.service) { + case IntegrationService.GitHub: { + const type = pathParts[3]; + return type === "pull" + ? MentionType.PullRequest + : type === "issues" + ? MentionType.Issue + : undefined; + } + + default: + return; + } +}; diff --git a/server/models/helpers/ProsemirrorHelper.tsx b/server/models/helpers/ProsemirrorHelper.tsx index e8704c9214..90bb3620b3 100644 --- a/server/models/helpers/ProsemirrorHelper.tsx +++ b/server/models/helpers/ProsemirrorHelper.tsx @@ -1,7 +1,7 @@ import { JSDOM } from "jsdom"; import compact from "lodash/compact"; import flatten from "lodash/flatten"; -import isEqual from "lodash/isEqual"; +import isMatch from "lodash/isMatch"; import uniq from "lodash/uniq"; import { Node, DOMSerializer, Fragment } from "prosemirror-model"; import * as React from "react"; @@ -12,7 +12,7 @@ import * as Y from "yjs"; import EditorContainer from "@shared/editor/components/Styles"; import GlobalStyles from "@shared/styles/globals"; import light from "@shared/styles/theme"; -import { MentionType, ProsemirrorData } from "@shared/types"; +import { MentionType, ProsemirrorData, UnfurlResponse } from "@shared/types"; import { attachmentRedirectRegex } from "@shared/utils/ProsemirrorHelper"; import parseDocumentSlug from "@shared/utils/parseDocumentSlug"; import { isRTL } from "@shared/utils/rtl"; @@ -42,6 +42,8 @@ export type MentionAttrs = { modelId: string; actorId: string | undefined; id: string; + href?: string; + unfurl?: UnfurlResponse[keyof UnfurlResponse]; }; @trace() @@ -194,7 +196,7 @@ export class ProsemirrorHelper { node.descendants((childNode: Node) => { if ( childNode.type.name === "mention" && - isEqual(childNode.attrs, mention) + isMatch(childNode.attrs, mention) ) { foundMention = true; return false; diff --git a/app/components/Icons/IssueStatusIcon.tsx b/shared/components/IssueStatusIcon.tsx similarity index 100% rename from app/components/Icons/IssueStatusIcon.tsx rename to shared/components/IssueStatusIcon.tsx diff --git a/app/components/Icons/PullRequestIcon.tsx b/shared/components/PullRequestIcon.tsx similarity index 100% rename from app/components/Icons/PullRequestIcon.tsx rename to shared/components/PullRequestIcon.tsx diff --git a/app/components/Spinner.tsx b/shared/components/Spinner.tsx similarity index 100% rename from app/components/Spinner.tsx rename to shared/components/Spinner.tsx diff --git a/shared/components/Text.tsx b/shared/components/Text.tsx new file mode 100644 index 0000000000..812eeb6a48 --- /dev/null +++ b/shared/components/Text.tsx @@ -0,0 +1,73 @@ +import styled, { css } from "styled-components"; +import { ellipsis } from "../styles"; + +type Props = { + /** The type of text to render */ + type?: "secondary" | "tertiary" | "danger"; + /** The size of the text */ + size?: "xlarge" | "large" | "medium" | "small" | "xsmall"; + /** The direction of the text (defaults to ltr) */ + dir?: "ltr" | "rtl" | "auto"; + /** Whether the text should be selectable (defaults to false) */ + selectable?: boolean; + /** The font weight of the text */ + weight?: "xbold" | "bold" | "normal"; + /** Whether the text should be italic */ + italic?: boolean; + /** Whether the text should be truncated with an ellipsis */ + ellipsis?: boolean; + /** Whether the text should be monospaced */ + monospace?: boolean; +}; + +/** + * Use this component for all interface text that should not be selectable + * by the user, this is the majority of UI text explainers, notes, headings. + */ +const Text = styled.span` + margin-top: 0; + text-align: ${(props) => (props.dir ? props.dir : "inherit")}; + color: ${(props) => + props.type === "secondary" + ? props.theme.textSecondary + : props.type === "tertiary" + ? props.theme.textTertiary + : props.type === "danger" + ? props.theme.brand.red + : props.theme.text}; + font-size: ${(props) => + props.size === "xlarge" + ? "26px" + : props.size === "large" + ? "18px" + : props.size === "medium" + ? "16px" + : props.size === "small" + ? "14px" + : props.size === "xsmall" + ? "13px" + : "inherit"}; + + ${(props) => + props.weight && + css` + font-weight: ${props.weight === "xbold" + ? 600 + : props.weight === "bold" + ? 500 + : props.weight === "normal" + ? 400 + : "inherit"}; + `} + + font-style: ${(props) => (props.italic ? "italic" : "normal")}; + font-family: ${(props) => + props.monospace ? props.theme.fontFamilyMono : "inherit"}; + + white-space: normal; + user-select: ${(props) => (props.selectable ? "text" : "none")}; + + ${(props) => props.ellipsis && ellipsis()} +`; + +export default Text; diff --git a/shared/editor/components/Mentions.tsx b/shared/editor/components/Mentions.tsx index 6c85c4880c..0ec427b553 100644 --- a/shared/editor/components/Mentions.tsx +++ b/shared/editor/components/Mentions.tsx @@ -1,17 +1,49 @@ import { observer } from "mobx-react"; -import { DocumentIcon, EmailIcon, CollectionIcon } from "outline-icons"; +import { + DocumentIcon, + EmailIcon, + CollectionIcon, + WarningIcon, +} from "outline-icons"; import { Node } from "prosemirror-model"; import * as React from "react"; +import { useTranslation } from "react-i18next"; import { Link } from "react-router-dom"; +import styled from "styled-components"; +import Flex from "../../components/Flex"; import Icon from "../../components/Icon"; +import { IssueStatusIcon } from "../../components/IssueStatusIcon"; +import { PullRequestIcon } from "../../components/PullRequestIcon"; +import Spinner from "../../components/Spinner"; +import Text from "../../components/Text"; +import useIsMounted from "../../hooks/useIsMounted"; import useStores from "../../hooks/useStores"; +import theme from "../../styles/theme"; +import type { + JSONValue, + UnfurlResourceType, + UnfurlResponse, +} from "../../types"; import { cn } from "../styles/utils"; import { ComponentProps } from "../types"; -const getAttributesFromNode = (node: Node) => { - const spec = node.type.spec.toDOM?.(node) as any as Record[]; - const { class: className, ...attrs } = spec[1]; - return { className, ...attrs }; +type Attrs = { + className: string; + unfurl?: UnfurlResponse[keyof UnfurlResponse]; +} & Record; + +const getAttributesFromNode = (node: Node): Attrs => { + const spec = node.type.spec.toDOM?.(node) as any as Record< + string, + JSONValue + >[]; + const { class: className, "data-unfurl": unfurl, ...attrs } = spec[1]; + + return { + className: className as Attrs["className"], + unfurl: unfurl ? (JSON.parse(unfurl as any) as Attrs["unfurl"]) : undefined, + ...attrs, + }; }; export const MentionUser = observer(function MentionUser_( @@ -20,7 +52,7 @@ export const MentionUser = observer(function MentionUser_( const { isSelected, node } = props; const { users } = useStores(); const user = users.get(node.attrs.modelId); - const { className, ...attrs } = getAttributesFromNode(node); + const { className, unfurl, ...attrs } = getAttributesFromNode(node); return ( { if (modelId) { @@ -75,7 +107,7 @@ export const MentionCollection = observer(function MentionCollection_( const { collections } = useStores(); const collection = collections.get(node.attrs.modelId); const modelId = node.attrs.modelId; - const { className, ...attrs } = getAttributesFromNode(node); + const { className, unfurl, ...attrs } = getAttributesFromNode(node); React.useEffect(() => { if (modelId) { @@ -100,3 +132,183 @@ export const MentionCollection = observer(function MentionCollection_( ); }); + +type IssuePrProps = ComponentProps & { + onChangeUnfurl: ( + unfurl: + | UnfurlResponse[UnfurlResourceType.Issue] + | UnfurlResponse[UnfurlResourceType.PR] + ) => void; +}; + +export const MentionIssue = observer((props: IssuePrProps) => { + const { unfurls } = useStores(); + const isMounted = useIsMounted(); + const [loaded, setLoaded] = React.useState(false); + const onChangeUnfurl = React.useRef(props.onChangeUnfurl).current; // stable reference to callback function. + + const { isSelected, node } = props; + const { + className, + unfurl: unfurlAttr, + ...attrs + } = getAttributesFromNode(node); + + const unfurl = unfurls.get(attrs.href)?.data ?? unfurlAttr; + + React.useEffect(() => { + const fetchIssue = async () => { + const unfurlModel = await unfurls.fetchUnfurl({ url: attrs.href }); + + if (!isMounted()) { + return; + } + + if (unfurlModel) { + onChangeUnfurl({ + ...unfurlModel.data, + description: null, + } satisfies UnfurlResponse[UnfurlResourceType.Issue]); + } + + setLoaded(true); + }; + + void fetchIssue(); + }, [unfurls, attrs.href, isMounted, onChangeUnfurl]); + + if (!unfurl) { + return !loaded ? ( + + ) : ( + + ); + } + + const issue = unfurl as UnfurlResponse[UnfurlResourceType.Issue]; + + return ( + + + + + {issue.title} + {issue.id} + + + + ); +}); + +export const MentionPullRequest = observer((props: IssuePrProps) => { + const { unfurls } = useStores(); + const isMounted = useIsMounted(); + const [loaded, setLoaded] = React.useState(false); + const onChangeUnfurl = React.useRef(props.onChangeUnfurl).current; // stable reference to callback function. + + const { isSelected, node } = props; + const { + className, + unfurl: unfurlAttr, + ...attrs + } = getAttributesFromNode(node); + + const unfurl = unfurls.get(attrs.href)?.data ?? unfurlAttr; + + React.useEffect(() => { + const fetchPR = async () => { + const unfurlModel = await unfurls.fetchUnfurl({ url: attrs.href }); + + if (!isMounted()) { + return; + } + + if (unfurlModel) { + onChangeUnfurl({ + ...unfurlModel.data, + description: null, + } satisfies UnfurlResponse[UnfurlResourceType.PR]); + } + + setLoaded(true); + }; + + void fetchPR(); + }, [unfurls, attrs.href, isMounted, onChangeUnfurl]); + + const sharedProps = { + className: cn(className, { + "ProseMirror-selectednode": isSelected, + }), + }; + + if (!unfurl) { + return !loaded ? ( + + ) : ( + + ); + } + + const pullRequest = unfurl as UnfurlResponse[UnfurlResourceType.PR]; + + return ( + + + + + {pullRequest.title} + {pullRequest.id} + + + + ); +}); + +const MentionLoading = ({ className }: { className: string }) => { + const { t } = useTranslation(); + + return ( + + + {`${t("Loading")}…`} + + ); +}; + +const MentionError = ({ className }: { className: string }) => { + const { t } = useTranslation(); + + return ( + + + {`${t("Error loading data")}`} + + ); +}; + +const StyledWarningIcon = styled(WarningIcon)` + margin: 0 -2px; +`; diff --git a/shared/editor/nodes/Mention.tsx b/shared/editor/nodes/Mention.tsx index 2babdcf65d..d2bea3cb64 100644 --- a/shared/editor/nodes/Mention.tsx +++ b/shared/editor/nodes/Mention.tsx @@ -1,3 +1,4 @@ +import isMatch from "lodash/isMatch"; import { Token } from "markdown-it"; import { NodeSpec, @@ -15,10 +16,12 @@ import * as React from "react"; import { Primitive } from "utility-types"; import { v4 as uuidv4 } from "uuid"; import env from "../../env"; -import { MentionType } from "../../types"; +import { MentionType, UnfurlResourceType, UnfurlResponse } from "../../types"; import { MentionCollection, MentionDocument, + MentionIssue, + MentionPullRequest, MentionUser, } from "../components/Mentions"; import { MarkdownSerializerState } from "../lib/markdown/serializer"; @@ -50,6 +53,12 @@ export default class Mention extends Node { id: { default: undefined, }, + href: { + default: undefined, + }, + unfurl: { + default: undefined, + }, }, inline: true, marks: "", @@ -73,6 +82,10 @@ export default class Mention extends Node { actorId: dom.dataset.actorid, label: dom.innerText, id: dom.id, + href: dom.getAttribute("href"), + unfurl: dom.dataset.unfurl + ? JSON.parse(dom.dataset.unfurl) + : undefined, }; }, }, @@ -87,11 +100,18 @@ export default class Mention extends Node { ? undefined : node.attrs.type === MentionType.Document ? `${env.URL}/doc/${node.attrs.modelId}` - : `${env.URL}/collection/${node.attrs.modelId}`, + : node.attrs.type === MentionType.Collection + ? `${env.URL}/collection/${node.attrs.modelId}` + : node.attrs.href, "data-type": node.attrs.type, "data-id": node.attrs.modelId, "data-actorid": node.attrs.actorId, - "data-url": `mention://${node.attrs.id}/${node.attrs.type}/${node.attrs.modelId}`, + "data-url": + node.attrs.type === MentionType.PullRequest || + node.attrs.type === MentionType.Issue + ? node.attrs.href + : `mention://${node.attrs.id}/${node.attrs.type}/${node.attrs.modelId}`, + "data-unfurl": JSON.stringify(node.attrs.unfurl), }, toPlainText(node), ], @@ -107,6 +127,20 @@ export default class Mention extends Node { return ; case MentionType.Collection: return ; + case MentionType.Issue: + return ( + + ); + case MentionType.PullRequest: + return ( + + ); default: return null; } @@ -149,29 +183,42 @@ export default class Mention extends Node { } keys(): Record { + const NavigableMention = [ + MentionType.Collection, + MentionType.Document, + MentionType.Issue, + MentionType.PullRequest, + ]; + return { Enter: (state) => { const { selection } = state; if ( selection instanceof NodeSelection && selection.node.type.name === this.name && - (selection.node.attrs.type === MentionType.Document || - selection.node.attrs.type === MentionType.Collection) + NavigableMention.includes(selection.node.attrs.type) ) { - const { modelId } = selection.node.attrs; + const mentionType = selection.node.attrs.type; - const linkType = - selection.node.attrs.type === MentionType.Document - ? "doc" - : selection.node.attrs.type === MentionType.Collection - ? "collection" - : undefined; + let link: string; - if (!linkType) { - return false; + if ( + mentionType === MentionType.Issue || + mentionType === MentionType.PullRequest + ) { + link = selection.node.attrs.href; + } else { + const { modelId } = selection.node.attrs; + + const linkType = + selection.node.attrs.type === MentionType.Document + ? "doc" + : "collection"; + + link = `/${linkType}/${modelId}`; } - this.editor.props.onClickLink?.(`/${linkType}/${modelId}`); + this.editor.props.onClickLink?.(link); return true; } return false; @@ -218,4 +265,30 @@ export default class Mention extends Node { }), }; } + + handleChangeUnfurl = + ({ node, getPos }: { node: ProsemirrorNode; getPos: () => number }) => + (unfurl: UnfurlResponse[keyof UnfurlResponse]) => { + const { view } = this.editor; + const { tr } = view.state; + + const label = + unfurl.type === UnfurlResourceType.Issue || + unfurl.type === UnfurlResourceType.PR + ? unfurl.title + : undefined; + + const overrides: Record = label ? { label } : {}; + overrides.unfurl = unfurl; + + const pos = getPos(); + + if (!isMatch(node.attrs, overrides)) { + const transaction = tr.setNodeMarkup(pos, undefined, { + ...node.attrs, + ...overrides, + }); + view.dispatch(transaction); + } + }; } diff --git a/shared/hooks/useIsMounted.ts b/shared/hooks/useIsMounted.ts new file mode 100644 index 0000000000..c1b6f141b2 --- /dev/null +++ b/shared/hooks/useIsMounted.ts @@ -0,0 +1,19 @@ +import * as React from "react"; + +/** + * Hook to check if component is still mounted + * + * @returns {boolean} true if the component is mounted, false otherwise + */ +export default function useIsMounted() { + const isMounted = React.useRef(false); + + React.useEffect(() => { + isMounted.current = true; + return () => { + isMounted.current = false; + }; + }, []); + + return React.useCallback(() => isMounted.current, []); +} diff --git a/shared/i18n/locales/en_US/translation.json b/shared/i18n/locales/en_US/translation.json index f6beb85df4..8fbf8b128e 100644 --- a/shared/i18n/locales/en_US/translation.json +++ b/shared/i18n/locales/en_US/translation.json @@ -428,6 +428,7 @@ "Create a new doc": "Create a new doc", "{{ userName }} won't be notified, as they do not have access to this document": "{{ userName }} won't be notified, as they do not have access to this document", "Keep as link": "Keep as link", + "Mention": "Mention", "Embed": "Embed", "Add column after": "Add column after", "Add column before": "Add column before", @@ -1155,5 +1156,6 @@ "You updated {{ timeAgo }}": "You updated {{ timeAgo }}", "{{ user }} updated {{ timeAgo }}": "{{ user }} updated {{ timeAgo }}", "You created {{ timeAgo }}": "You created {{ timeAgo }}", - "{{ user }} created {{ timeAgo }}": "{{ user }} created {{ timeAgo }}" + "{{ user }} created {{ timeAgo }}": "{{ user }} created {{ timeAgo }}", + "Error loading data": "Error loading data" } diff --git a/shared/types.ts b/shared/types.ts index 15d0ab4e61..135d22fd91 100644 --- a/shared/types.ts +++ b/shared/types.ts @@ -75,6 +75,8 @@ export enum MentionType { User = "user", Document = "document", Collection = "collection", + Issue = "issue", + PullRequest = "pull_request", } export type PublicEnv = { @@ -416,7 +418,7 @@ export type UnfurlResponse = { /** Issue title */ title: string; /** Issue description */ - description: string; + description: string | null; /** Issue's author */ author: { name: string; avatarUrl: string }; /** Issue's labels */ @@ -436,7 +438,7 @@ export type UnfurlResponse = { /** Pull Request title */ title: string; /** Pull Request description */ - description: string; + description: string | null; /** Pull Request author */ author: { name: string; avatarUrl: string }; /** Pull Request status */ From 9c85b26d430c3025898122ff390709853a67bc58 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 13 Apr 2025 17:48:08 -0400 Subject: [PATCH 27/59] fix: Editor crashes on shared page with no user (#8956) --- app/editor/components/PasteMenu.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/editor/components/PasteMenu.tsx b/app/editor/components/PasteMenu.tsx index a0015a7163..9042f50a4f 100644 --- a/app/editor/components/PasteMenu.tsx +++ b/app/editor/components/PasteMenu.tsx @@ -26,7 +26,7 @@ type Props = Omit< export const PasteMenu = observer(({ pastedText, embeds, ...props }: Props) => { const { t } = useTranslation(); const { integrations } = useStores(); - const user = useCurrentUser(); + const user = useCurrentUser({ rejectOnEmpty: false }); let mentionType: MentionType | undefined; const url = pastedText ? new URL(pastedText) : undefined; @@ -70,7 +70,7 @@ export const PasteMenu = observer(({ pastedText, embeds, ...props }: Props) => { label: pastedText, href: pastedText, modelId: v4(), - actorId: user.id, + actorId: user?.id, }, appendSpace: true, }, From ad722107143ee657249587538e2a65b6d5bdde8b Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 13 Apr 2025 22:07:47 -0400 Subject: [PATCH 28/59] fix: Hardcode dynamic imports to avoid production issues (#8958) * fix: Hardcode dynamic imports to avoid production issues * tsc --- shared/editor/extensions/CodeHighlighting.ts | 24 +- shared/editor/lib/code.ts | 362 ++++++++++++++++--- 2 files changed, 315 insertions(+), 71 deletions(-) diff --git a/shared/editor/extensions/CodeHighlighting.ts b/shared/editor/extensions/CodeHighlighting.ts index 99ceb76a60..435b1d6bab 100644 --- a/shared/editor/extensions/CodeHighlighting.ts +++ b/shared/editor/extensions/CodeHighlighting.ts @@ -4,7 +4,7 @@ import { Node } from "prosemirror-model"; import { Plugin, PluginKey, Transaction } from "prosemirror-state"; import { Decoration, DecorationSet } from "prosemirror-view"; import refractor from "refractor/core"; -import { getRefractorLangForLanguage } from "../lib/code"; +import { getLoaderForLanguage, getRefractorLangForLanguage } from "../lib/code"; import { isRemoteTransaction } from "../lib/multiplayer"; import { findBlockNodes } from "../queries/findChildren"; @@ -21,17 +21,15 @@ async function loadLanguage(language: string) { return; } try { - // @ts-expect-error we are adding a module to the window object to work - // around the fact that refractor doesn't export ESM but import expects it. - // See the rules of dynamic imports: - // https://github.com/rollup/plugins/blob/e1a5ef99f1578eb38a8c87563cb9651db228f3bd/packages/dynamic-import-vars/README.md#limitations - window.module ??= {}; - return import(`../../../node_modules/refractor/lang/${language}.js`).then( - () => { - refractor.register(window.module.exports); - return language; - } - ); + const loader = getLoaderForLanguage(language); + if (!loader) { + return; + } + + return loader().then((syntax) => { + refractor.register(syntax); + return language; + }); } catch (err) { // It will retry loading the language on the next render // eslint-disable-next-line no-console @@ -230,7 +228,7 @@ export function CodeHighlighting({ void Promise.all([...languagesToImport].map(loadLanguage)).then( (language) => - languagesToImport.size + language && languagesToImport.size ? view.dispatch( view.state.tr.setMeta("codeHighlighting", { langLoaded: language, diff --git a/shared/editor/lib/code.ts b/shared/editor/lib/code.ts index e87ae1e6b0..f114227b38 100644 --- a/shared/editor/lib/code.ts +++ b/shared/editor/lib/code.ts @@ -1,3 +1,4 @@ +import type { RefractorSyntax } from "refractor"; import Storage from "../../utils/Storage"; const RecentlyUsedStorageKey = "rme-code-language"; @@ -5,6 +6,12 @@ const StorageKey = "frequent-code-languages"; const frequentLanguagesToGet = 5; const frequentLanguagesToTrack = 10; +type CodeLanguage = { + lang: string; + label: string; + loader?: () => Promise; +}; + /** * List of supported code languages. * @@ -12,65 +19,295 @@ const frequentLanguagesToTrack = 10; * language identifier used by Refractor. Note mismatches such as `markup` and * `mermaid`. */ -export const codeLanguages = { +export const codeLanguages: Record = { none: { lang: "", label: "Plain text" }, - bash: { lang: "bash", label: "Bash" }, - clike: { lang: "clike", label: "C" }, - cpp: { lang: "cpp", label: "C++" }, - csharp: { lang: "csharp", label: "C#" }, - css: { lang: "css", label: "CSS" }, - csv: { lang: "csv", label: "CSV" }, - docker: { lang: "docker", label: "Docker" }, - elixir: { lang: "elixir", label: "Elixir" }, - erb: { lang: "erb", label: "ERB" }, - erlang: { lang: "erlang", label: "Erlang" }, - go: { lang: "go", label: "Go" }, - graphql: { lang: "graphql", label: "GraphQL" }, - groovy: { lang: "groovy", label: "Groovy" }, - haskell: { lang: "haskell", label: "Haskell" }, - hcl: { lang: "hcl", label: "HCL" }, - markup: { lang: "markup", label: "HTML" }, - ini: { lang: "ini", label: "INI" }, - java: { lang: "java", label: "Java" }, - javascript: { lang: "javascript", label: "JavaScript" }, - json: { lang: "json", label: "JSON" }, - jsx: { lang: "jsx", label: "JSX" }, - kotlin: { lang: "kotlin", label: "Kotlin" }, - kusto: { lang: "kusto", label: "Kusto" }, - lisp: { lang: "lisp", label: "Lisp" }, - lua: { lang: "lua", label: "Lua" }, - makefile: { lang: "makefile", label: "Makefile" }, - markdown: { lang: "markdown", label: "Markdown" }, - mermaidjs: { lang: "mermaid", label: "Mermaid Diagram" }, - nginx: { lang: "nginx", label: "Nginx" }, - nix: { lang: "nix", label: "Nix" }, - objectivec: { lang: "objectivec", label: "Objective-C" }, - ocaml: { lang: "ocaml", label: "OCaml" }, - perl: { lang: "perl", label: "Perl" }, - php: { lang: "php", label: "PHP" }, - powershell: { lang: "powershell", label: "Powershell" }, - protobuf: { lang: "protobuf", label: "Protobuf" }, - python: { lang: "python", label: "Python" }, - r: { lang: "r", label: "R" }, - regex: { lang: "regex", label: "Regex" }, - ruby: { lang: "ruby", label: "Ruby" }, - rust: { lang: "rust", label: "Rust" }, - scala: { lang: "scala", label: "Scala" }, - sass: { lang: "sass", label: "Sass" }, - scss: { lang: "scss", label: "SCSS" }, - "splunk-spl": { lang: "splunk-spl", label: "Splunk SPL" }, - sql: { lang: "sql", label: "SQL" }, - solidity: { lang: "solidity", label: "Solidity" }, - swift: { lang: "swift", label: "Swift" }, - toml: { lang: "toml", label: "TOML" }, - tsx: { lang: "tsx", label: "TSX" }, - typescript: { lang: "typescript", label: "TypeScript" }, - vb: { lang: "vb", label: "Visual Basic" }, - verilog: { lang: "verilog", label: "Verilog" }, - vhdl: { lang: "vhdl", label: "VHDL" }, - yaml: { lang: "yaml", label: "YAML" }, - xml: { lang: "markup", label: "XML" }, - zig: { lang: "zig", label: "Zig" }, + bash: { + lang: "bash", + label: "Bash", + loader: () => import("refractor/lang/bash").then((m) => m.default), + }, + clike: { + lang: "clike", + label: "C", + loader: () => import("refractor/lang/clike").then((m) => m.default), + }, + cpp: { + lang: "cpp", + label: "C++", + loader: () => import("refractor/lang/cpp").then((m) => m.default), + }, + csharp: { + lang: "csharp", + label: "C#", + loader: () => import("refractor/lang/csharp").then((m) => m.default), + }, + css: { + lang: "css", + label: "CSS", + loader: () => import("refractor/lang/css").then((m) => m.default), + }, + csv: { + lang: "csv", + label: "CSV", + loader: () => import("refractor/lang/csv").then((m) => m.default), + }, + docker: { + lang: "docker", + label: "Docker", + loader: () => import("refractor/lang/docker").then((m) => m.default), + }, + elixir: { + lang: "elixir", + label: "Elixir", + loader: () => import("refractor/lang/elixir").then((m) => m.default), + }, + erb: { + lang: "erb", + label: "ERB", + loader: () => import("refractor/lang/erb").then((m) => m.default), + }, + erlang: { + lang: "erlang", + label: "Erlang", + loader: () => import("refractor/lang/erlang").then((m) => m.default), + }, + go: { + lang: "go", + label: "Go", + loader: () => import("refractor/lang/go").then((m) => m.default), + }, + graphql: { + lang: "graphql", + label: "GraphQL", + loader: () => import("refractor/lang/graphql").then((m) => m.default), + }, + groovy: { + lang: "groovy", + label: "Groovy", + loader: () => import("refractor/lang/groovy").then((m) => m.default), + }, + haskell: { + lang: "haskell", + label: "Haskell", + loader: () => import("refractor/lang/haskell").then((m) => m.default), + }, + hcl: { + lang: "hcl", + label: "HCL", + loader: () => import("refractor/lang/hcl").then((m) => m.default), + }, + markup: { + lang: "markup", + label: "HTML", + loader: () => import("refractor/lang/markup").then((m) => m.default), + }, + ini: { + lang: "ini", + label: "INI", + loader: () => import("refractor/lang/ini").then((m) => m.default), + }, + java: { + lang: "java", + label: "Java", + loader: () => import("refractor/lang/java").then((m) => m.default), + }, + javascript: { + lang: "javascript", + label: "JavaScript", + loader: () => import("refractor/lang/javascript").then((m) => m.default), + }, + json: { + lang: "json", + label: "JSON", + loader: () => import("refractor/lang/json").then((m) => m.default), + }, + jsx: { + lang: "jsx", + label: "JSX", + loader: () => import("refractor/lang/jsx").then((m) => m.default), + }, + kotlin: { + lang: "kotlin", + label: "Kotlin", + loader: () => import("refractor/lang/kotlin").then((m) => m.default), + }, + kusto: { + lang: "kusto", + label: "Kusto", + // @ts-expect-error Mermaid is not in types but exists + loader: () => import("refractor/lang/kusto").then((m) => m.default), + }, + lisp: { + lang: "lisp", + label: "Lisp", + loader: () => import("refractor/lang/lisp").then((m) => m.default), + }, + lua: { + lang: "lua", + label: "Lua", + loader: () => import("refractor/lang/lua").then((m) => m.default), + }, + makefile: { + lang: "makefile", + label: "Makefile", + loader: () => import("refractor/lang/makefile").then((m) => m.default), + }, + markdown: { + lang: "markdown", + label: "Markdown", + loader: () => import("refractor/lang/markdown").then((m) => m.default), + }, + mermaidjs: { + lang: "mermaid", + label: "Mermaid Diagram", + // @ts-expect-error Mermaid is not in types but exists + loader: () => import("refractor/lang/mermaid").then((m) => m.default), + }, + nginx: { + lang: "nginx", + label: "Nginx", + loader: () => import("refractor/lang/nginx").then((m) => m.default), + }, + nix: { + lang: "nix", + label: "Nix", + loader: () => import("refractor/lang/nix").then((m) => m.default), + }, + objectivec: { + lang: "objectivec", + label: "Objective-C", + loader: () => import("refractor/lang/objectivec").then((m) => m.default), + }, + ocaml: { + lang: "ocaml", + label: "OCaml", + loader: () => import("refractor/lang/ocaml").then((m) => m.default), + }, + perl: { + lang: "perl", + label: "Perl", + loader: () => import("refractor/lang/perl").then((m) => m.default), + }, + php: { + lang: "php", + label: "PHP", + loader: () => import("refractor/lang/php").then((m) => m.default), + }, + powershell: { + lang: "powershell", + label: "Powershell", + loader: () => import("refractor/lang/powershell").then((m) => m.default), + }, + protobuf: { + lang: "protobuf", + label: "Protobuf", + loader: () => import("refractor/lang/protobuf").then((m) => m.default), + }, + python: { + lang: "python", + label: "Python", + loader: () => import("refractor/lang/python").then((m) => m.default), + }, + r: { + lang: "r", + label: "R", + loader: () => import("refractor/lang/r").then((m) => m.default), + }, + regex: { + lang: "regex", + label: "Regex", + loader: () => import("refractor/lang/regex").then((m) => m.default), + }, + ruby: { + lang: "ruby", + label: "Ruby", + loader: () => import("refractor/lang/ruby").then((m) => m.default), + }, + rust: { + lang: "rust", + label: "Rust", + loader: () => import("refractor/lang/rust").then((m) => m.default), + }, + scala: { + lang: "scala", + label: "Scala", + loader: () => import("refractor/lang/scala").then((m) => m.default), + }, + sass: { + lang: "sass", + label: "Sass", + loader: () => import("refractor/lang/sass").then((m) => m.default), + }, + scss: { + lang: "scss", + label: "SCSS", + loader: () => import("refractor/lang/scss").then((m) => m.default), + }, + "splunk-spl": { + lang: "splunk-spl", + label: "Splunk SPL", + loader: () => import("refractor/lang/splunk-spl").then((m) => m.default), + }, + sql: { + lang: "sql", + label: "SQL", + loader: () => import("refractor/lang/sql").then((m) => m.default), + }, + solidity: { + lang: "solidity", + label: "Solidity", + loader: () => import("refractor/lang/solidity").then((m) => m.default), + }, + swift: { + lang: "swift", + label: "Swift", + loader: () => import("refractor/lang/swift").then((m) => m.default), + }, + toml: { + lang: "toml", + label: "TOML", + loader: () => import("refractor/lang/toml").then((m) => m.default), + }, + tsx: { + lang: "tsx", + label: "TSX", + loader: () => import("refractor/lang/tsx").then((m) => m.default), + }, + typescript: { + lang: "typescript", + label: "TypeScript", + loader: () => import("refractor/lang/typescript").then((m) => m.default), + }, + vb: { + lang: "vb", + label: "Visual Basic", + loader: () => import("refractor/lang/vbnet").then((m) => m.default), + }, + verilog: { + lang: "verilog", + label: "Verilog", + loader: () => import("refractor/lang/verilog").then((m) => m.default), + }, + vhdl: { + lang: "vhdl", + label: "VHDL", + loader: () => import("refractor/lang/vhdl").then((m) => m.default), + }, + yaml: { + lang: "yaml", + label: "YAML", + loader: () => import("refractor/lang/yaml").then((m) => m.default), + }, + xml: { + lang: "markup", + label: "XML", + loader: () => import("refractor/lang/markup").then((m) => m.default), + }, + zig: { + lang: "zig", + label: "Zig", + loader: () => import("refractor/lang/zig").then((m) => m.default), + }, }; /** @@ -96,6 +333,15 @@ export const getRefractorLangForLanguage = ( ): string | undefined => codeLanguages[language as keyof typeof codeLanguages]?.lang; +/** + * Get the loader function for a given language. + * + * @param language The language identifier. + * @returns The loader function for the language, or undefined if not available. + */ +export const getLoaderForLanguage = (language: string) => + codeLanguages[language as keyof typeof codeLanguages]?.loader; + /** * Set the most recent code language used. * From f082da645615b4c082424d1aa423860d24092206 Mon Sep 17 00:00:00 2001 From: Hemachandar <132386067+hmacr@users.noreply.github.com> Date: Mon, 14 Apr 2025 07:45:15 +0530 Subject: [PATCH 29/59] fix: Reset avatar zoom, set missing text in upload button (#8949) * fix: Reset avatar zoom, set missing text in upload button * tiny --- .../Settings/components/ImageUpload.tsx | 196 +++++++++++------- 1 file changed, 117 insertions(+), 79 deletions(-) diff --git a/app/scenes/Settings/components/ImageUpload.tsx b/app/scenes/Settings/components/ImageUpload.tsx index c703ae3c91..d5e1db53ea 100644 --- a/app/scenes/Settings/components/ImageUpload.tsx +++ b/app/scenes/Settings/components/ImageUpload.tsx @@ -3,7 +3,7 @@ import { observer } from "mobx-react"; import * as React from "react"; import { useState, useRef } from "react"; import AvatarEditor from "react-avatar-editor"; -import Dropzone from "react-dropzone"; +import { useDropzone } from "react-dropzone"; import { useTranslation } from "react-i18next"; import styled from "styled-components"; import { s } from "@shared/styles"; @@ -12,7 +12,6 @@ import { AttachmentValidation } from "@shared/validations"; import ButtonLarge from "~/components/ButtonLarge"; import Flex from "~/components/Flex"; import LoadingIndicator from "~/components/LoadingIndicator"; -import Modal from "~/components/Modal"; import useStores from "~/hooks/useStores"; import { compressImage } from "~/utils/compressImage"; import { uploadFile, dataUrlToBlob } from "~/utils/files"; @@ -28,81 +27,138 @@ const ImageUpload: React.FC = ({ onSuccess, onError, submitText, - borderRadius = 150, + borderRadius, children, }) => { - const { ui } = useStores(); + const { dialogs } = useStores(); const { t } = useTranslation(); - submitText || t("Crop image"); const [isUploading, setIsUploading] = useState(false); const [isCropping, setIsCropping] = useState(false); - const [zoom, setZoom] = useState(1); - const [file, setFile] = useState(null); - const avatarEditorRef = useRef(null); + const uploadImage = React.useCallback( + async (blob: Blob, file: File) => { + try { + const compressed = await compressImage(blob, { + maxHeight: 512, + maxWidth: 512, + }); + const attachment = await uploadFile(compressed, { + name: file.name, + preset: AttachmentPreset.Avatar, + }); + void onSuccess(attachment.url); + } catch (err) { + onError(err.message); + } finally { + setIsUploading(false); + setIsCropping(false); + dialogs.closeAllModals(); + } + }, + [dialogs, onSuccess, onError] + ); - const onDropAccepted = async (files: File[]) => { - setIsCropping(true); - setFile(files[0]); - }; + const handleUpload = React.useCallback( + (blob: Blob, file: File) => { + setIsUploading(true); + // allow the UI to update before converting the canvas to a Blob + // for large images this can cause the page rendering to hang. + setTimeout(() => uploadImage(blob, file), 0); + }, + [uploadImage] + ); - const handleCrop = () => { - setIsUploading(true); - // allow the UI to update before converting the canvas to a Blob - // for large images this can cause the page rendering to hang. - setTimeout(uploadImage, 0); - }; - - const uploadImage = async () => { - const canvas = avatarEditorRef.current?.getImage(); - invariant(canvas, "canvas is not defined"); - const imageBlob = dataUrlToBlob(canvas.toDataURL()); - - try { - const compressed = await compressImage(imageBlob, { - maxHeight: 512, - maxWidth: 512, - }); - const attachment = await uploadFile(compressed, { - name: file!.name, - preset: AttachmentPreset.Avatar, - }); - void onSuccess(attachment.url); - } catch (err) { - onError(err.message); - } finally { - setIsUploading(false); - setIsCropping(false); - } - }; - - const handleClose = () => { + const handleClose = React.useCallback(() => { setIsUploading(false); setIsCropping(false); - }; + }, []); - const handleZoom = (event: React.ChangeEvent) => { - const target = event.target; + const onDropAccepted = React.useCallback( + async (files: File[]) => { + setIsCropping(true); + dialogs.openModal({ + title: "", + content: ( + + ), + onClose: handleClose, + }); + }, + [ + t, + dialogs, + handleUpload, + handleClose, + isUploading, + borderRadius, + submitText, + ] + ); - if (target instanceof HTMLInputElement) { - setZoom(parseFloat(target.value)); - } - }; + const { getRootProps, getInputProps } = useDropzone({ + accept: AttachmentValidation.avatarContentTypes.join(", "), + onDropAccepted, + }); - const renderCropping = () => ( -  } - isOpen - > + if (isCropping) { + return null; // onDropAccepted would have opened a modal for cropping the image. + } + + return ( +
+ + {children} +
+ ); +}; + +type AvatarEditorDialogProps = { + file: File; + onUpload: (blob: Blob, file: File) => void; + isUploading: boolean; + borderRadius: number; + submitText: string; +}; + +const AvatarEditorDialog: React.FC = observer( + ({ file, onUpload, isUploading, borderRadius, submitText }) => { + const { ui } = useStores(); + const { t } = useTranslation(); + const [zoom, setZoom] = useState(1); + const avatarEditorRef = useRef(null); + + const handleUpload = React.useCallback(() => { + const canvas = avatarEditorRef.current?.getImage(); + invariant(canvas, "canvas is not defined"); + const blob = dataUrlToBlob(canvas.toDataURL()); + onUpload(blob, file); + }, [file, onUpload]); + + const handleZoom = React.useCallback( + (event: React.ChangeEvent) => { + const target = event.target; + + if (target instanceof HTMLInputElement) { + setZoom(parseFloat(target.value)); + } + }, + [] + ); + + return ( {isUploading && } = ({ onChange={handleZoom} />
- + {isUploading ? `${t(`Uploading`)}…` : submitText}
-
- ); - - if (isCropping && file) { - return renderCropping(); + ); } - - return ( - - {({ getRootProps, getInputProps }) => ( -
- - {children} -
- )} -
- ); -}; +); const AvatarEditorContainer = styled(Flex)` margin-bottom: 30px; From d183dab063673a068c1d104d5a088617707d9916 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Mon, 14 Apr 2025 08:47:57 -0400 Subject: [PATCH 30/59] fix: Mermaid diagrams hanging (#8961) --- shared/editor/extensions/CodeHighlighting.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/shared/editor/extensions/CodeHighlighting.ts b/shared/editor/extensions/CodeHighlighting.ts index 435b1d6bab..5d5de39d1f 100644 --- a/shared/editor/extensions/CodeHighlighting.ts +++ b/shared/editor/extensions/CodeHighlighting.ts @@ -83,7 +83,8 @@ function getDecorations({ blocks.forEach((block) => { let startPos = block.pos + 1; - const language = getRefractorLangForLanguage(block.node.attrs.language); + const language = block.node.attrs.language; + const lang = getRefractorLangForLanguage(language); const lineDecorations = []; if (!cache[block.pos] || !cache[block.pos].node.eq(block.node)) { @@ -117,12 +118,12 @@ function getDecorations({ decorations: lineDecorations, }; - if (!language) { + if (!lang) { // do nothing - } else if (refractor.registered(language)) { + } else if (refractor.registered(lang)) { languagesToImport.delete(language); - const nodes = refractor.highlight(block.node.textContent, language); + const nodes = refractor.highlight(block.node.textContent, lang); const newDecorations = parseNodes(nodes) .map((node: ParsedNode) => { const from = startPos; From 631b75def4204a89082b6ce32cf8f4b9b3e6fb69 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Apr 2025 22:28:05 -0400 Subject: [PATCH 31/59] chore(deps-dev): bump typescript from 5.8.2 to 5.8.3 (#8972) Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.8.2 to 5.8.3. - [Release notes](https://github.com/microsoft/TypeScript/releases) - [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release-publish.yml) - [Commits](https://github.com/microsoft/TypeScript/compare/v5.8.2...v5.8.3) --- updated-dependencies: - dependency-name: typescript dependency-version: 5.8.3 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index b414f4338a..5d5d7f12fd 100644 --- a/package.json +++ b/package.json @@ -362,7 +362,7 @@ "rimraf": "^2.5.4", "rollup-plugin-webpack-stats": "^2.0.3", "terser": "^5.39.0", - "typescript": "^5.7.3", + "typescript": "^5.8.3", "vite-plugin-static-copy": "^0.17.0", "yarn-deduplicate": "^6.0.2" }, diff --git a/yarn.lock b/yarn.lock index 8bca9496be..3b1fe50020 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15263,10 +15263,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" -typescript@^5.0.4, typescript@^5.7.3: - version "5.8.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.8.2.tgz#8170b3702f74b79db2e5a96207c15e65807999e4" - integrity sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ== +typescript@^5.0.4, typescript@^5.8.3: + version "5.8.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.8.3.tgz#92f8a3e5e3cf497356f4178c34cd65a7f5e8440e" + integrity sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ== uc.micro@^1.0.1, uc.micro@^1.0.5: version "1.0.6" From b3ca434c5142ff70876671129d9cd4e2ec8d1c0c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Apr 2025 22:28:31 -0400 Subject: [PATCH 32/59] chore(deps): bump prosemirror-schema-list from 1.4.1 to 1.5.1 (#8970) Bumps [prosemirror-schema-list](https://github.com/prosemirror/prosemirror-schema-list) from 1.4.1 to 1.5.1. - [Changelog](https://github.com/ProseMirror/prosemirror-schema-list/blob/master/CHANGELOG.md) - [Commits](https://github.com/prosemirror/prosemirror-schema-list/compare/1.4.1...1.5.1) --- updated-dependencies: - dependency-name: prosemirror-schema-list dependency-version: 1.5.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 5d5d7f12fd..1d89696123 100644 --- a/package.json +++ b/package.json @@ -187,7 +187,7 @@ "prosemirror-keymap": "^1.2.2", "prosemirror-markdown": "^1.13.2", "prosemirror-model": "^1.25.0", - "prosemirror-schema-list": "^1.4.1", + "prosemirror-schema-list": "^1.5.1", "prosemirror-state": "^1.4.3", "prosemirror-tables": "^1.6.4", "prosemirror-transform": "1.10.0", diff --git a/yarn.lock b/yarn.lock index 3b1fe50020..4524639d35 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13122,10 +13122,10 @@ prosemirror-model@^1.0.0, prosemirror-model@^1.20.0, prosemirror-model@^1.21.0, dependencies: orderedmap "^2.0.0" -prosemirror-schema-list@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/prosemirror-schema-list/-/prosemirror-schema-list-1.4.1.tgz#78b8d25531db48ca9688836dbde50e13ac19a4a1" - integrity sha512-jbDyaP/6AFfDfu70VzySsD75Om2t3sXTOdl5+31Wlxlg62td1haUpty/ybajSfJ1pkGadlOfwQq9kgW5IMo1Rg== +prosemirror-schema-list@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/prosemirror-schema-list/-/prosemirror-schema-list-1.5.1.tgz#5869c8f749e8745c394548bb11820b0feb1e32f5" + integrity sha512-927lFx/uwyQaGwJxLWCZRkjXG0p48KpMj6ueoYiu4JX05GGuGcgzAy62dfiV8eFZftgyBUvLx76RsMe20fJl+Q== dependencies: prosemirror-model "^1.0.0" prosemirror-state "^1.0.0" From d6640445795268f47a8de066d3dd8f5f7b2c6bce Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Mon, 14 Apr 2025 22:31:08 -0400 Subject: [PATCH 33/59] perf: Cache promise when loading code languages (#8975) --- shared/editor/extensions/CodeHighlighting.ts | 59 ++++++++++++-------- 1 file changed, 36 insertions(+), 23 deletions(-) diff --git a/shared/editor/extensions/CodeHighlighting.ts b/shared/editor/extensions/CodeHighlighting.ts index 5d5de39d1f..d76a6b18b6 100644 --- a/shared/editor/extensions/CodeHighlighting.ts +++ b/shared/editor/extensions/CodeHighlighting.ts @@ -15,30 +15,42 @@ type ParsedNode = { const cache: Record = {}; const languagesToImport = new Set(); +const languagePromises: Record< + string, + Promise | undefined +> = {}; async function loadLanguage(language: string) { if (!language || refractor.registered(language)) { return; } - try { - const loader = getLoaderForLanguage(language); - if (!loader) { - return; - } - return loader().then((syntax) => { + if (languagePromises[language]) { + return languagePromises[language]; + } + + const loader = getLoaderForLanguage(language); + if (!loader) { + return; + } + + languagePromises[language] = loader() + .then((syntax) => { refractor.register(syntax); return language; + }) + .catch((err) => { + // It will retry loading the language on the next render + // eslint-disable-next-line no-console + console.error( + `Failed to load language ${language} for code highlighting`, + err + ); + delete languagePromises[language]; // Remove failed promise from cache + return undefined; }); - } catch (err) { - // It will retry loading the language on the next render - // eslint-disable-next-line no-console - console.error( - `Failed to load language ${language} for code highlighting`, - err - ); - } - return; + + return languagePromises[language]; } function getDecorations({ @@ -228,14 +240,15 @@ export function CodeHighlighting({ } void Promise.all([...languagesToImport].map(loadLanguage)).then( - (language) => - language && languagesToImport.size - ? view.dispatch( - view.state.tr.setMeta("codeHighlighting", { - langLoaded: language, - }) - ) - : null + (language) => { + if (language && languagesToImport.size) { + view.dispatch( + view.state.tr.setMeta("codeHighlighting", { + langLoaded: language, + }) + ); + } + } ); }, }; From 0c6b37cb608184e586864a995a470329564f6732 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Apr 2025 22:32:45 -0400 Subject: [PATCH 34/59] chore(deps): bump react-virtualized-auto-sizer from 1.0.25 to 1.0.26 (#8969) Bumps [react-virtualized-auto-sizer](https://github.com/bvaughn/react-virtualized-auto-sizer) from 1.0.25 to 1.0.26. - [Release notes](https://github.com/bvaughn/react-virtualized-auto-sizer/releases) - [Changelog](https://github.com/bvaughn/react-virtualized-auto-sizer/blob/master/CHANGELOG.md) - [Commits](https://github.com/bvaughn/react-virtualized-auto-sizer/compare/1.0.25...1.0.26) --- updated-dependencies: - dependency-name: react-virtualized-auto-sizer dependency-version: 1.0.26 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 1d89696123..474b972aee 100644 --- a/package.json +++ b/package.json @@ -210,7 +210,7 @@ "react-merge-refs": "^2.1.1", "react-portal": "^4.2.2", "react-router-dom": "^5.3.4", - "react-virtualized-auto-sizer": "^1.0.21", + "react-virtualized-auto-sizer": "^1.0.26", "react-waypoint": "^10.3.0", "react-window": "^1.8.11", "reakit": "^1.3.11", diff --git a/yarn.lock b/yarn.lock index 4524639d35..14477843c5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13492,10 +13492,10 @@ react-virtual@^2.8.2: dependencies: "@reach/observe-rect" "^1.1.0" -react-virtualized-auto-sizer@^1.0.21: - version "1.0.25" - resolved "https://registry.yarnpkg.com/react-virtualized-auto-sizer/-/react-virtualized-auto-sizer-1.0.25.tgz#b13cbc528ac200be2bd1ffa40c8bb19bcc60ac3f" - integrity sha512-YHsksEGDfsHbHuaBVDYwJmcktblcHGafz4ZVuYPQYuSHMUGjpwmUCrAOcvMSGMwwk1eFWj1M/1GwYpNPuyhaBg== +react-virtualized-auto-sizer@^1.0.26: + version "1.0.26" + resolved "https://registry.yarnpkg.com/react-virtualized-auto-sizer/-/react-virtualized-auto-sizer-1.0.26.tgz#e9470ef6a778dc4f1d5fd76305fa2d8b610c357a" + integrity sha512-CblNyiNVw2o+hsa5/49NH2ogGxZ+t+3aweRvNSq7TVjDIlwk7ir4lencEg5HxHeSzwNarSkNkiu0qJSOXtxm5A== react-waypoint@^10.3.0: version "10.3.0" From 1776aad8330bf30f3223ed8a3fe649e001c76f61 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Apr 2025 22:40:15 -0400 Subject: [PATCH 35/59] chore(deps): bump the aws group with 5 updates (#8968) Bumps the aws group with 5 updates: | Package | From | To | | --- | --- | --- | | [@aws-sdk/client-s3](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-s3) | `3.782.0` | `3.787.0` | | [@aws-sdk/lib-storage](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/lib/lib-storage) | `3.782.0` | `3.787.0` | | [@aws-sdk/s3-presigned-post](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/packages/s3-presigned-post) | `3.782.0` | `3.787.0` | | [@aws-sdk/s3-request-presigner](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/packages/s3-request-presigner) | `3.782.0` | `3.787.0` | | [@aws-sdk/signature-v4-crt](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/packages/signature-v4-crt) | `3.782.0` | `3.787.0` | Updates `@aws-sdk/client-s3` from 3.782.0 to 3.787.0 - [Release notes](https://github.com/aws/aws-sdk-js-v3/releases) - [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-s3/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.787.0/clients/client-s3) Updates `@aws-sdk/lib-storage` from 3.782.0 to 3.787.0 - [Release notes](https://github.com/aws/aws-sdk-js-v3/releases) - [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/lib/lib-storage/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.787.0/lib/lib-storage) Updates `@aws-sdk/s3-presigned-post` from 3.782.0 to 3.787.0 - [Release notes](https://github.com/aws/aws-sdk-js-v3/releases) - [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/s3-presigned-post/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.787.0/packages/s3-presigned-post) Updates `@aws-sdk/s3-request-presigner` from 3.782.0 to 3.787.0 - [Release notes](https://github.com/aws/aws-sdk-js-v3/releases) - [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/s3-request-presigner/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.787.0/packages/s3-request-presigner) Updates `@aws-sdk/signature-v4-crt` from 3.782.0 to 3.787.0 - [Release notes](https://github.com/aws/aws-sdk-js-v3/releases) - [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/signature-v4-crt/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.787.0/packages/signature-v4-crt) --- updated-dependencies: - dependency-name: "@aws-sdk/client-s3" dependency-version: 3.787.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: aws - dependency-name: "@aws-sdk/lib-storage" dependency-version: 3.787.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: aws - dependency-name: "@aws-sdk/s3-presigned-post" dependency-version: 3.787.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: aws - dependency-name: "@aws-sdk/s3-request-presigner" dependency-version: 3.787.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: aws - dependency-name: "@aws-sdk/signature-v4-crt" dependency-version: 3.787.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: aws ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 10 +-- yarn.lock | 188 +++++++++++++++++++++++++-------------------------- 2 files changed, 99 insertions(+), 99 deletions(-) diff --git a/package.json b/package.json index 474b972aee..d6f7eacb6d 100644 --- a/package.json +++ b/package.json @@ -48,11 +48,11 @@ "> 0.25%, not dead" ], "dependencies": { - "@aws-sdk/client-s3": "3.782.0", - "@aws-sdk/lib-storage": "3.782.0", - "@aws-sdk/s3-presigned-post": "3.782.0", - "@aws-sdk/s3-request-presigner": "3.782.0", - "@aws-sdk/signature-v4-crt": "^3.782.0", + "@aws-sdk/client-s3": "3.787.0", + "@aws-sdk/lib-storage": "3.787.0", + "@aws-sdk/s3-presigned-post": "3.787.0", + "@aws-sdk/s3-request-presigner": "3.787.0", + "@aws-sdk/signature-v4-crt": "^3.787.0", "@babel/core": "^7.26.10", "@babel/plugin-proposal-decorators": "^7.25.9", "@babel/plugin-transform-class-properties": "^7.25.9", diff --git a/yarn.lock b/yarn.lock index 14477843c5..a2096dc9f2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -105,32 +105,32 @@ "@smithy/util-utf8" "^2.0.0" tslib "^2.6.2" -"@aws-sdk/client-s3@3.782.0": - version "3.782.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/client-s3/-/client-s3-3.782.0.tgz#ed807a1cd9a3e7a55bf41dfb486da0bbd1f4852d" - integrity sha512-V6JR2JAGYQY7J8wk5un5n/ja2nfCUyyoRCF8Du8JL91NGI8i41Mdr/TzuOGwTgFl6RSXb/ge1K1jk30OH4MugQ== +"@aws-sdk/client-s3@3.787.0": + version "3.787.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/client-s3/-/client-s3-3.787.0.tgz#ebb55ec36cd8f0b7e5e89e48c4d1b6ed1f6156dc" + integrity sha512-eGLCWkN0NlntJ9yPU6OKUggVS4cFvuZJog+cFg1KD5hniLqz7Y0YRtB4uBxW212fK3XCfddgyscEOEeHaTQQTw== dependencies: "@aws-crypto/sha1-browser" "5.2.0" "@aws-crypto/sha256-browser" "5.2.0" "@aws-crypto/sha256-js" "5.2.0" "@aws-sdk/core" "3.775.0" - "@aws-sdk/credential-provider-node" "3.782.0" + "@aws-sdk/credential-provider-node" "3.787.0" "@aws-sdk/middleware-bucket-endpoint" "3.775.0" "@aws-sdk/middleware-expect-continue" "3.775.0" - "@aws-sdk/middleware-flexible-checksums" "3.775.0" + "@aws-sdk/middleware-flexible-checksums" "3.787.0" "@aws-sdk/middleware-host-header" "3.775.0" "@aws-sdk/middleware-location-constraint" "3.775.0" "@aws-sdk/middleware-logger" "3.775.0" "@aws-sdk/middleware-recursion-detection" "3.775.0" "@aws-sdk/middleware-sdk-s3" "3.775.0" "@aws-sdk/middleware-ssec" "3.775.0" - "@aws-sdk/middleware-user-agent" "3.782.0" + "@aws-sdk/middleware-user-agent" "3.787.0" "@aws-sdk/region-config-resolver" "3.775.0" "@aws-sdk/signature-v4-multi-region" "3.775.0" "@aws-sdk/types" "3.775.0" - "@aws-sdk/util-endpoints" "3.782.0" + "@aws-sdk/util-endpoints" "3.787.0" "@aws-sdk/util-user-agent-browser" "3.775.0" - "@aws-sdk/util-user-agent-node" "3.782.0" + "@aws-sdk/util-user-agent-node" "3.787.0" "@aws-sdk/xml-builder" "3.775.0" "@smithy/config-resolver" "^4.1.0" "@smithy/core" "^3.2.0" @@ -167,10 +167,10 @@ "@smithy/util-waiter" "^4.0.3" tslib "^2.6.2" -"@aws-sdk/client-sso@3.782.0": - version "3.782.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/client-sso/-/client-sso-3.782.0.tgz#072cbb23a90ec6fd53145ff75bef8329a857f362" - integrity sha512-5GlJBejo8wqMpSSEKb45WE82YxI2k73YuebjLH/eWDNQeE6VI5Bh9lA1YQ7xNkLLH8hIsb0pSfKVuwh0VEzVrg== +"@aws-sdk/client-sso@3.787.0": + version "3.787.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/client-sso/-/client-sso-3.787.0.tgz#39f1182296b586cb957b449b5f0dabd8f378cf1a" + integrity sha512-L8R+Mh258G0DC73ktpSVrG4TT9i2vmDLecARTDR/4q5sRivdDQSL5bUp3LKcK80Bx+FRw3UETIlX6mYMLL9PJQ== dependencies: "@aws-crypto/sha256-browser" "5.2.0" "@aws-crypto/sha256-js" "5.2.0" @@ -178,12 +178,12 @@ "@aws-sdk/middleware-host-header" "3.775.0" "@aws-sdk/middleware-logger" "3.775.0" "@aws-sdk/middleware-recursion-detection" "3.775.0" - "@aws-sdk/middleware-user-agent" "3.782.0" + "@aws-sdk/middleware-user-agent" "3.787.0" "@aws-sdk/region-config-resolver" "3.775.0" "@aws-sdk/types" "3.775.0" - "@aws-sdk/util-endpoints" "3.782.0" + "@aws-sdk/util-endpoints" "3.787.0" "@aws-sdk/util-user-agent-browser" "3.775.0" - "@aws-sdk/util-user-agent-node" "3.782.0" + "@aws-sdk/util-user-agent-node" "3.787.0" "@smithy/config-resolver" "^4.1.0" "@smithy/core" "^3.2.0" "@smithy/fetch-http-handler" "^5.0.2" @@ -255,18 +255,18 @@ "@smithy/util-stream" "^4.2.0" tslib "^2.6.2" -"@aws-sdk/credential-provider-ini@3.782.0": - version "3.782.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.782.0.tgz#4ffd90f6b3b6b34d1dabcba875e5d00fc5da23f1" - integrity sha512-wd4KdRy2YjLsE4Y7pz00470Iip06GlRHkG4dyLW7/hFMzEO2o7ixswCWp6J2VGZVAX64acknlv2Q0z02ebjmhw== +"@aws-sdk/credential-provider-ini@3.787.0": + version "3.787.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.787.0.tgz#906ece004141462ae695504b6c07d1200688fd6c" + integrity sha512-hc2taRoDlXn2uuNuHWDJljVWYrp3r9JF1a/8XmOAZhVUNY+ImeeStylHXhXXKEA4JOjW+5PdJj0f1UDkVCHJiQ== dependencies: "@aws-sdk/core" "3.775.0" "@aws-sdk/credential-provider-env" "3.775.0" "@aws-sdk/credential-provider-http" "3.775.0" "@aws-sdk/credential-provider-process" "3.775.0" - "@aws-sdk/credential-provider-sso" "3.782.0" - "@aws-sdk/credential-provider-web-identity" "3.782.0" - "@aws-sdk/nested-clients" "3.782.0" + "@aws-sdk/credential-provider-sso" "3.787.0" + "@aws-sdk/credential-provider-web-identity" "3.787.0" + "@aws-sdk/nested-clients" "3.787.0" "@aws-sdk/types" "3.775.0" "@smithy/credential-provider-imds" "^4.0.2" "@smithy/property-provider" "^4.0.2" @@ -274,17 +274,17 @@ "@smithy/types" "^4.2.0" tslib "^2.6.2" -"@aws-sdk/credential-provider-node@3.782.0": - version "3.782.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-node/-/credential-provider-node-3.782.0.tgz#81a798710d0567b26cd20a105790b49586e68d40" - integrity sha512-HZiAF+TCEyKjju9dgysjiPIWgt/+VerGaeEp18mvKLNfgKz1d+/82A2USEpNKTze7v3cMFASx3CvL8yYyF7mJw== +"@aws-sdk/credential-provider-node@3.787.0": + version "3.787.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-node/-/credential-provider-node-3.787.0.tgz#3e5cdafb0fecca25b7430f848cbca85000b25c33" + integrity sha512-JioVi44B1vDMaK2CdzqimwvJD3uzvzbQhaEWXsGMBcMcNHajXAXf08EF50JG3ZhLrhhUsT1ObXpbTaPINOhh+g== dependencies: "@aws-sdk/credential-provider-env" "3.775.0" "@aws-sdk/credential-provider-http" "3.775.0" - "@aws-sdk/credential-provider-ini" "3.782.0" + "@aws-sdk/credential-provider-ini" "3.787.0" "@aws-sdk/credential-provider-process" "3.775.0" - "@aws-sdk/credential-provider-sso" "3.782.0" - "@aws-sdk/credential-provider-web-identity" "3.782.0" + "@aws-sdk/credential-provider-sso" "3.787.0" + "@aws-sdk/credential-provider-web-identity" "3.787.0" "@aws-sdk/types" "3.775.0" "@smithy/credential-provider-imds" "^4.0.2" "@smithy/property-provider" "^4.0.2" @@ -304,45 +304,45 @@ "@smithy/types" "^4.2.0" tslib "^2.6.2" -"@aws-sdk/credential-provider-sso@3.782.0": - version "3.782.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.782.0.tgz#f644884cae368204f750c35d8a61a04d77c02674" - integrity sha512-1y1ucxTtTIGDSNSNxriQY8msinilhe9gGvQpUDYW9gboyC7WQJPDw66imy258V6osdtdi+xoHzVCbCz3WhosMQ== +"@aws-sdk/credential-provider-sso@3.787.0": + version "3.787.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.787.0.tgz#77ab6c01e4497d7ff2e6c7f081f3d8695744884b" + integrity sha512-fHc08bsvwm4+dEMEQKnQ7c1irEQmmxbgS+Fq41y09pPvPh31nAhoMcjBSTWAaPHvvsRbTYvmP4Mf12ZGr8/nfg== dependencies: - "@aws-sdk/client-sso" "3.782.0" + "@aws-sdk/client-sso" "3.787.0" "@aws-sdk/core" "3.775.0" - "@aws-sdk/token-providers" "3.782.0" + "@aws-sdk/token-providers" "3.787.0" "@aws-sdk/types" "3.775.0" "@smithy/property-provider" "^4.0.2" "@smithy/shared-ini-file-loader" "^4.0.2" "@smithy/types" "^4.2.0" tslib "^2.6.2" -"@aws-sdk/credential-provider-web-identity@3.782.0": - version "3.782.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.782.0.tgz#5dbab53a7b49dcf8390d71415855e78b911a4742" - integrity sha512-xCna0opVPaueEbJoclj5C6OpDNi0Gynj+4d7tnuXGgQhTHPyAz8ZyClkVqpi5qvHTgxROdUEDxWqEO5jqRHZHQ== +"@aws-sdk/credential-provider-web-identity@3.787.0": + version "3.787.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.787.0.tgz#d492d1f4a90b70f3a71a65f11b8d3ef79fb2759e" + integrity sha512-SobmCwNbk6TfEsF283mZPQEI5vV2j6eY5tOCj8Er4Lzraxu9fBPADV+Bib2A8F6jlB1lMPJzOuDCbEasSt/RIw== dependencies: "@aws-sdk/core" "3.775.0" - "@aws-sdk/nested-clients" "3.782.0" + "@aws-sdk/nested-clients" "3.787.0" "@aws-sdk/types" "3.775.0" "@smithy/property-provider" "^4.0.2" "@smithy/types" "^4.2.0" tslib "^2.6.2" -"@aws-sdk/crt-loader@3.782.0": - version "3.782.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/crt-loader/-/crt-loader-3.782.0.tgz#a2f8d34a22155d9730426cb727694c54dc0299c4" - integrity sha512-S3fDfZfVhGBvyseJEIcVwa7pumyjqhMKIGHYzcxpthBptJ9gcpYgyHSC6Z7hguQfsfurawe7MNvFnx8O6oLFLA== +"@aws-sdk/crt-loader@3.787.0": + version "3.787.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/crt-loader/-/crt-loader-3.787.0.tgz#570c7e3cc79d20b2391beb1dafe2215343a9ac29" + integrity sha512-NQWFDkYF/lzz2m3icdVr+a0Ua/fN4dij3GPwU+Hr/nzrFR6z7txG3U4m2zkSELJ0PDT4k/1NsgmnQlpyxg0NDg== dependencies: - "@aws-sdk/util-user-agent-node" "3.782.0" + "@aws-sdk/util-user-agent-node" "3.787.0" aws-crt "^1.24.0" tslib "^2.6.2" -"@aws-sdk/lib-storage@3.782.0": - version "3.782.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/lib-storage/-/lib-storage-3.782.0.tgz#721fd62f01805a9eed661f19f556dc7c6f17a70e" - integrity sha512-UQYnIzpBReLko2XhDgG/rWpoHTWv4/zqUNl4XJXZRo9akLzrxGKtPrp5nJ4OLUkH3tIm1cvmI3XlSjHUW/OxWw== +"@aws-sdk/lib-storage@3.787.0": + version "3.787.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/lib-storage/-/lib-storage-3.787.0.tgz#fb7af2a869c31948073e7480ed1003c9755d35c4" + integrity sha512-iIMbmd9uASD3KFfGeH/OeVo4oxAeqbuXDmhoVEJb4M0hZ4yJ2o9v1V0TEaHwIXcrdlc0H8rCpd9opmV74MBxrA== dependencies: "@smithy/abort-controller" "^4.0.2" "@smithy/middleware-endpoint" "^4.1.0" @@ -375,10 +375,10 @@ "@smithy/types" "^4.2.0" tslib "^2.6.2" -"@aws-sdk/middleware-flexible-checksums@3.775.0": - version "3.775.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-flexible-checksums/-/middleware-flexible-checksums-3.775.0.tgz#d76a5eabb13ddc3d29b834335387ebe321e0291e" - integrity sha512-OmHLfRIb7IIXsf9/X/pMOlcSV3gzW/MmtPSZTkrz5jCTKzWXd7eRoyOJqewjsaC6KMAxIpNU77FoAd16jOZ21A== +"@aws-sdk/middleware-flexible-checksums@3.787.0": + version "3.787.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-flexible-checksums/-/middleware-flexible-checksums-3.787.0.tgz#bc887dcfd0193a41eef6b58c18c682478a108b07" + integrity sha512-X71qEwWoixFmwowWzlPoZUR3u1CWJ7iAzU0EzIxqmPhQpQJLFmdL1+SRjqATynDPZQzLs1a5HBtPT++EnZ+Quw== dependencies: "@aws-crypto/crc32" "5.2.0" "@aws-crypto/crc32c" "5.2.0" @@ -461,23 +461,23 @@ "@smithy/types" "^4.2.0" tslib "^2.6.2" -"@aws-sdk/middleware-user-agent@3.782.0": - version "3.782.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.782.0.tgz#60e47e365a39cfa64aa81c3c881896face74da45" - integrity sha512-i32H2R6IItX+bQ2p4+v2gGO2jA80jQoJO2m1xjU9rYWQW3+ErWy4I5YIuQHTBfb6hSdAHbaRfqPDgbv9J2rjEg== +"@aws-sdk/middleware-user-agent@3.787.0": + version "3.787.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.787.0.tgz#3d657c0ba1aec72bca079f4691ba20f25569fcfc" + integrity sha512-Lnfj8SmPLYtrDFthNIaNj66zZsBCam+E4XiUDr55DIHTGstH6qZ/q6vg0GfbukxwSmUcGMwSR4Qbn8rb8yd77g== dependencies: "@aws-sdk/core" "3.775.0" "@aws-sdk/types" "3.775.0" - "@aws-sdk/util-endpoints" "3.782.0" + "@aws-sdk/util-endpoints" "3.787.0" "@smithy/core" "^3.2.0" "@smithy/protocol-http" "^5.1.0" "@smithy/types" "^4.2.0" tslib "^2.6.2" -"@aws-sdk/nested-clients@3.782.0": - version "3.782.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/nested-clients/-/nested-clients-3.782.0.tgz#73f56fc4d22e1be342e00b7eba9de4d192521a05" - integrity sha512-QOYC8q7luzHFXrP0xYAqBctoPkynjfV0r9dqntFu4/IWMTyC1vlo1UTxFAjIPyclYw92XJyEkVCVg9v/nQnsUA== +"@aws-sdk/nested-clients@3.787.0": + version "3.787.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/nested-clients/-/nested-clients-3.787.0.tgz#e8a5a6e7d0b599a7f9f15b900d3223ad080b0a81" + integrity sha512-xk03q1xpKNHgbuo+trEf1dFrI239kuMmjKKsqLEsHlAZbuFq4yRGMlHBrVMnKYOPBhVFDS/VineM991XI52fKg== dependencies: "@aws-crypto/sha256-browser" "5.2.0" "@aws-crypto/sha256-js" "5.2.0" @@ -485,12 +485,12 @@ "@aws-sdk/middleware-host-header" "3.775.0" "@aws-sdk/middleware-logger" "3.775.0" "@aws-sdk/middleware-recursion-detection" "3.775.0" - "@aws-sdk/middleware-user-agent" "3.782.0" + "@aws-sdk/middleware-user-agent" "3.787.0" "@aws-sdk/region-config-resolver" "3.775.0" "@aws-sdk/types" "3.775.0" - "@aws-sdk/util-endpoints" "3.782.0" + "@aws-sdk/util-endpoints" "3.787.0" "@aws-sdk/util-user-agent-browser" "3.775.0" - "@aws-sdk/util-user-agent-node" "3.782.0" + "@aws-sdk/util-user-agent-node" "3.787.0" "@smithy/config-resolver" "^4.1.0" "@smithy/core" "^3.2.0" "@smithy/fetch-http-handler" "^5.0.2" @@ -530,12 +530,12 @@ "@smithy/util-middleware" "^4.0.2" tslib "^2.6.2" -"@aws-sdk/s3-presigned-post@3.782.0": - version "3.782.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/s3-presigned-post/-/s3-presigned-post-3.782.0.tgz#bf6fd60c20a511e6e039c6740f1a80a078d2469e" - integrity sha512-JlgZ3wZ3wId0zT0hiEkL6GapAWWh6m4P3uJsDWpcSv1yOA+9bqA3fLcxofnNodL2/7fxam2elI+jVvx/wXIqlQ== +"@aws-sdk/s3-presigned-post@3.787.0": + version "3.787.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/s3-presigned-post/-/s3-presigned-post-3.787.0.tgz#06b73ff35afc165a3208fc9a858b12a1e53d5148" + integrity sha512-/mM9VvdjC5fBa1WqlygmjTZ4R2fNsMjSc03JfdtcLWDShFZ61gungGZVSvsBbwh/YcVe1sKOnJz4qBQxl/ey8g== dependencies: - "@aws-sdk/client-s3" "3.782.0" + "@aws-sdk/client-s3" "3.787.0" "@aws-sdk/types" "3.775.0" "@aws-sdk/util-format-url" "3.775.0" "@smithy/middleware-endpoint" "^4.1.0" @@ -545,10 +545,10 @@ "@smithy/util-utf8" "^4.0.0" tslib "^2.6.2" -"@aws-sdk/s3-request-presigner@3.782.0": - version "3.782.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/s3-request-presigner/-/s3-request-presigner-3.782.0.tgz#bc71d5b9377f5c9e4170368da56745bb5164e466" - integrity sha512-Er8hdjc9zkxTh15MjdnMYggtUrGknDiuD1FwdW035kn/kwWop587G9rnRa1crhmyKRjLMn0Ki3fsyFUm/943XA== +"@aws-sdk/s3-request-presigner@3.787.0": + version "3.787.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/s3-request-presigner/-/s3-request-presigner-3.787.0.tgz#1a8eadf330446e53cdca11fa0c08ae3d45a00f9c" + integrity sha512-WBm0AS3RRURNN0yjYXHaiI692boVwWXGt3RLdI7tYBX58E1Zb5nzC8rlk81O9Xe7ZTgTC1KCr8y4+jcBD+zwJg== dependencies: "@aws-sdk/signature-v4-multi-region" "3.775.0" "@aws-sdk/types" "3.775.0" @@ -559,12 +559,12 @@ "@smithy/types" "^4.2.0" tslib "^2.6.2" -"@aws-sdk/signature-v4-crt@^3.782.0": - version "3.782.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/signature-v4-crt/-/signature-v4-crt-3.782.0.tgz#c90ef0f30bd73a0b9fcdaf31049a2adc7c15b405" - integrity sha512-QuVSoJITPZxK0lBA2uIDQFjvLdqEvjXrnLYGpRIvIoHdL4RtcDoad9NRKP6Lb34AoB4tubVF6g85mNNOVsqVAw== +"@aws-sdk/signature-v4-crt@^3.787.0": + version "3.787.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/signature-v4-crt/-/signature-v4-crt-3.787.0.tgz#6932f0f437536fc528d4cc45a79daf08819d64a3" + integrity sha512-TATbx7B/54UIyLawAM0eTkQfnfn9KlEXV1jymniEHQtsfL68VND9/uFdOp51Ob9eTo5Q3qghH0RMHZaOpRVuGA== dependencies: - "@aws-sdk/crt-loader" "3.782.0" + "@aws-sdk/crt-loader" "3.787.0" "@aws-sdk/signature-v4-multi-region" "3.775.0" "@aws-sdk/types" "3.775.0" "@smithy/querystring-parser" "^4.0.2" @@ -585,12 +585,12 @@ "@smithy/types" "^4.2.0" tslib "^2.6.2" -"@aws-sdk/token-providers@3.782.0": - version "3.782.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/token-providers/-/token-providers-3.782.0.tgz#a6a12f9358f8897f5d1af311da60f90a7d384eac" - integrity sha512-4tPuk/3+THPrzKaXW4jE2R67UyGwHLFizZ47pcjJWbhb78IIJAy94vbeqEQ+veS84KF5TXcU7g5jGTXC0D70Wg== +"@aws-sdk/token-providers@3.787.0": + version "3.787.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/token-providers/-/token-providers-3.787.0.tgz#18c761fb21ee25c8c3a35703876f0c733b4ae743" + integrity sha512-d7/NIqxq308Zg0RPMNrmn0QvzniL4Hx8Qdwzr6YZWLYAbUSvZYS2ppLR3BFWSkV6SsTJUx8BuDaj3P8vttkrog== dependencies: - "@aws-sdk/nested-clients" "3.782.0" + "@aws-sdk/nested-clients" "3.787.0" "@aws-sdk/types" "3.775.0" "@smithy/property-provider" "^4.0.2" "@smithy/shared-ini-file-loader" "^4.0.2" @@ -612,10 +612,10 @@ dependencies: tslib "^2.6.2" -"@aws-sdk/util-endpoints@3.782.0": - version "3.782.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-endpoints/-/util-endpoints-3.782.0.tgz#3b8de42c5fe951337d070432d4a5eba166c07bb7" - integrity sha512-/RJOAO7o7HI6lEa4ASbFFLHGU9iPK876BhsVfnl54MvApPVYWQ9sHO0anOUim2S5lQTwd/6ghuH3rFYSq/+rdw== +"@aws-sdk/util-endpoints@3.787.0": + version "3.787.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/util-endpoints/-/util-endpoints-3.787.0.tgz#1398f0bd87f19e615ae920c73e16d9d5e5cb76d1" + integrity sha512-fd3zkiOkwnbdbN0Xp9TsP5SWrmv0SpT70YEdbb8wAj2DWQwiCmFszaSs+YCvhoCdmlR3Wl9Spu0pGpSAGKeYvQ== dependencies: "@aws-sdk/types" "3.775.0" "@smithy/types" "^4.2.0" @@ -649,12 +649,12 @@ bowser "^2.11.0" tslib "^2.6.2" -"@aws-sdk/util-user-agent-node@3.782.0": - version "3.782.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.782.0.tgz#795f2c22882f1ddbbe83bd324f0ceac1c4b07c89" - integrity sha512-dMFkUBgh2Bxuw8fYZQoH/u3H4afQ12VSkzEi//qFiDTwbKYq+u+RYjc8GLDM6JSK1BShMu5AVR7HD4ap1TYUnA== +"@aws-sdk/util-user-agent-node@3.787.0": + version "3.787.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.787.0.tgz#58e63e99586cde1c1314f74b94596780321442f5" + integrity sha512-mG7Lz8ydfG4SF9e8WSXiPQ/Lsn3n8A5B5jtPROidafi06I3ckV2WxyMLdwG14m919NoS6IOfWHyRGSqWIwbVKA== dependencies: - "@aws-sdk/middleware-user-agent" "3.782.0" + "@aws-sdk/middleware-user-agent" "3.787.0" "@aws-sdk/types" "3.775.0" "@smithy/node-config-provider" "^4.0.2" "@smithy/types" "^4.2.0" From 6393bd02f4809f5d786e5e6714bcee9e33c52ed5 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Tue, 15 Apr 2025 08:13:45 -0400 Subject: [PATCH 36/59] fix: Cannot select divider, closes #8964 (#8979) --- app/editor/components/SelectionToolbar.tsx | 2 +- shared/editor/queries/isNodeActive.ts | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/app/editor/components/SelectionToolbar.tsx b/app/editor/components/SelectionToolbar.tsx index a263317ba5..bea7956d6b 100644 --- a/app/editor/components/SelectionToolbar.tsx +++ b/app/editor/components/SelectionToolbar.tsx @@ -174,12 +174,12 @@ export default function SelectionToolbar(props: Props) { const { isTemplate, rtl, canComment, canUpdate, ...rest } = props; const { state } = view; const { selection } = state; - const isDividerSelection = isNodeActive(state.schema.nodes.hr)(state); if ((readOnly && !canComment) || isDragging) { return null; } + const isDividerSelection = isNodeActive(state.schema.nodes.hr)(state); const colIndex = getColumnIndex(state); const rowIndex = getRowIndex(state); const isTableSelection = colIndex !== undefined && rowIndex !== undefined; diff --git a/shared/editor/queries/isNodeActive.ts b/shared/editor/queries/isNodeActive.ts index c8ec7776b1..b20eed8dc0 100644 --- a/shared/editor/queries/isNodeActive.ts +++ b/shared/editor/queries/isNodeActive.ts @@ -1,5 +1,5 @@ import { NodeType } from "prosemirror-model"; -import { EditorState } from "prosemirror-state"; +import { EditorState, NodeSelection } from "prosemirror-state"; import { Primitive } from "utility-types"; import { findParentNode } from "./findParentNode"; @@ -25,12 +25,24 @@ export const isNodeActive = return false; } + let nodeWithPos; const { from, to } = state.selection; - const nodeWithPos = findParentNode( + + if ( + state.selection instanceof NodeSelection && + state.selection.node.type === type && + state.selection.node.hasMarkup(type, { + ...state.selection.node.attrs, + ...attrs, + }) + ) { + nodeWithPos = { pos: from, node: state.selection.node }; + } + + nodeWithPos ??= findParentNode( (node) => node.type === type && - (!attrs || - Object.keys(attrs).every((key) => node.attrs[key] === attrs[key])) + (!attrs || node.hasMarkup(type, { ...node.attrs, ...attrs })) )(state.selection); if (!nodeWithPos) { From 4b209a79137b9b111e26dbc38e21a4572acf982a Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Tue, 15 Apr 2025 08:22:14 -0400 Subject: [PATCH 37/59] fix: Full-width image control should act as toggle (#8980) closes #8954 --- shared/editor/nodes/Image.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shared/editor/nodes/Image.tsx b/shared/editor/nodes/Image.tsx index 16839779f8..c122fa5ee9 100644 --- a/shared/editor/nodes/Image.tsx +++ b/shared/editor/nodes/Image.tsx @@ -408,10 +408,14 @@ export default class Image extends SimpleImage { if (!(state.selection instanceof NodeSelection)) { return false; } + let layoutClass: string | null = "full-width"; + if (state.selection.node.attrs.layoutClass === layoutClass) { + layoutClass = null; + } const attrs = { ...state.selection.node.attrs, title: null, - layoutClass: "full-width", + layoutClass, }; const { selection } = state; dispatch?.(state.tr.setNodeMarkup(selection.from, undefined, attrs)); From 0702570b0d35e60abb8470abb86b669bf785e295 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Tue, 15 Apr 2025 09:35:33 -0400 Subject: [PATCH 38/59] fix: Small modal overflow scrolling behavior (#8981) closes #8966 --- app/components/Modal.tsx | 3 +++ app/scenes/Invite.tsx | 2 ++ 2 files changed, 5 insertions(+) diff --git a/app/components/Modal.tsx b/app/components/Modal.tsx index 45e3105ee1..35cf5dc995 100644 --- a/app/components/Modal.tsx +++ b/app/components/Modal.tsx @@ -114,6 +114,8 @@ const Modal: React.FC = ({ ev.stopPropagation()} + // maxHeight needed for proper overflow behavior in Safari + style={{ maxHeight: "65vh" }} column reverse > @@ -259,6 +261,7 @@ const Small = styled.div` width: 75vw; min-width: 350px; max-width: 450px; + max-height: 65vh; z-index: ${depths.modal}; display: flex; justify-content: center; diff --git a/app/scenes/Invite.tsx b/app/scenes/Invite.tsx index 8cb13d9c1b..4c22b2824d 100644 --- a/app/scenes/Invite.tsx +++ b/app/scenes/Invite.tsx @@ -209,7 +209,9 @@ function Invite({ onSubmit }: Props) { placeholder={`name@${predictedDomain}`} value={invite.email} required={index === 0} + autoComplete="off" autoFocus + data-1p-ignore flex /> Date: Tue, 15 Apr 2025 21:31:25 -0400 Subject: [PATCH 39/59] chore: Disable bundle-size job on forks (#8986) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8984265c1a..fad0be731a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -145,7 +145,7 @@ jobs: bundle-size: needs: [build, types, changes] - if: ${{ needs.changes.outputs.app == 'true' }} + if: ${{ needs.changes.outputs.app == 'true' && github.repository == 'outline/outline' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From 1e7244c737c2a57b3e89832df1fac64585b5d3fc Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Tue, 15 Apr 2025 21:51:57 -0400 Subject: [PATCH 40/59] fix: Infinite loop loading page with vbnet code embed (#8987) --- shared/editor/lib/code.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/editor/lib/code.ts b/shared/editor/lib/code.ts index f114227b38..9e9404d19b 100644 --- a/shared/editor/lib/code.ts +++ b/shared/editor/lib/code.ts @@ -279,7 +279,7 @@ export const codeLanguages: Record = { loader: () => import("refractor/lang/typescript").then((m) => m.default), }, vb: { - lang: "vb", + lang: "vbnet", label: "Visual Basic", loader: () => import("refractor/lang/vbnet").then((m) => m.default), }, From 03a0f54236045215c75899503e58896cbe02a1d7 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 16 Apr 2025 18:22:43 -0400 Subject: [PATCH 41/59] fix: Cannot drag-select text while editing document title in sidebar (#8991) * fix: Cannot drag-select text while editing document title in sidebar * Clarify isEditing parameter description --- .../Sidebar/components/DocumentLink.tsx | 10 +++++++++- app/components/Sidebar/components/NavLink.tsx | 18 ++++++++++++------ .../Sidebar/hooks/useDragAndDrop.tsx | 6 ++++-- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/app/components/Sidebar/components/DocumentLink.tsx b/app/components/Sidebar/components/DocumentLink.tsx index 122c87ab53..d1050bd34c 100644 --- a/app/components/Sidebar/components/DocumentLink.tsx +++ b/app/components/Sidebar/components/DocumentLink.tsx @@ -148,7 +148,12 @@ function InnerDocumentLink( const color = document?.color || node.color; // Draggable - const [{ isDragging }, drag] = useDragDocument(node, depth, document); + const [{ isDragging }, drag] = useDragDocument( + node, + depth, + document, + isEditing + ); // Drop to re-parent const parentRef = React.useRef(null); @@ -270,6 +275,8 @@ function InnerDocumentLink(
{ location?: Location; strict?: boolean; to: LocationDescriptor; + component?: React.ComponentType; onBeforeClick?: () => void; } @@ -146,17 +147,22 @@ const NavLink = ({ setPreActive(undefined); }, [currentLocation]); + const handleKeyDown = React.useCallback( + (event: React.KeyboardEvent) => { + if (["Enter", " "].includes(event.key)) { + navigateTo(); + event.currentTarget?.blur(); + } + }, + [navigateTo] + ); + return ( { - if (["Enter", " "].includes(event.key)) { - navigateTo(); - event.currentTarget?.blur(); - } - }} + onKeyDown={handleKeyDown} aria-current={(isActive && ariaCurrent) || undefined} className={className} style={style} diff --git a/app/components/Sidebar/hooks/useDragAndDrop.tsx b/app/components/Sidebar/hooks/useDragAndDrop.tsx index 4d1867c7ca..58ade6c59c 100644 --- a/app/components/Sidebar/hooks/useDragAndDrop.tsx +++ b/app/components/Sidebar/hooks/useDragAndDrop.tsx @@ -166,11 +166,13 @@ export function useDropToReorderStar(getIndex?: () => string) { * @param node The NavigationNode model to drag. * @param depth The depth of the node in the sidebar. * @param document The related Document model. + * @param isEditing Whether the sidebar item is currently being edited. */ export function useDragDocument( node: NavigationNode, depth: number, - document?: Document + document?: Document, + isEditing?: boolean ) { const icon = document?.icon || node.icon || node.emoji; const color = document?.color || node.color; @@ -188,7 +190,7 @@ export function useDragDocument( icon: icon ? : undefined, collectionId: document?.collectionId || "", } as DragObject), - canDrag: () => !!document?.isActive, + canDrag: () => !!document?.isActive && !isEditing, collect: (monitor) => ({ isDragging: monitor.isDragging(), }), From 5789d65bf5b526eb554b45d9f2ab06d2bbc61ab0 Mon Sep 17 00:00:00 2001 From: Hemachandar <132386067+hmacr@users.noreply.github.com> Date: Thu, 17 Apr 2025 03:52:51 +0530 Subject: [PATCH 42/59] Ensure iframely fallback is not executed for connected unfurl integration (#8995) * Ensure iframely fallback is not executed for connected unfurl integration * tsc --- plugins/github/server/github.ts | 4 ++-- plugins/iframely/server/iframely.ts | 10 ++++++---- server/routes/api/urls/urls.test.ts | 2 +- server/routes/api/urls/urls.ts | 7 ++++--- server/types.ts | 4 +++- 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/plugins/github/server/github.ts b/plugins/github/server/github.ts index 0604488c7e..e7e03b6250 100644 --- a/plugins/github/server/github.ts +++ b/plugins/github/server/github.ts @@ -206,12 +206,12 @@ export class GitHub { ); const { data } = await client.requestResource(resource); if (!data) { - return; + return { error: "Resource not found" }; } return { ...data, type: resource.type }; } catch (err) { Logger.warn("Failed to fetch resource from GitHub", err); - return; + return { error: err.message || "Unknown error" }; } }; } diff --git a/plugins/iframely/server/iframely.ts b/plugins/iframely/server/iframely.ts index 3d5328fcf7..6ca473c6e7 100644 --- a/plugins/iframely/server/iframely.ts +++ b/plugins/iframely/server/iframely.ts @@ -1,6 +1,6 @@ import { JSONObject, UnfurlResourceType } from "@shared/types"; import Logger from "@server/logging/Logger"; -import { UnfurlSignature } from "@server/types"; +import { UnfurlError, UnfurlSignature } from "@server/types"; import fetch from "@server/utils/fetch"; import env from "./env"; @@ -10,7 +10,7 @@ class Iframely { public static async requestResource( url: string, type = "oembed" - ): Promise { + ): Promise { const isDefaultHost = env.IFRAMELY_URL === this.defaultUrl; // Cloud Iframely requires /api path, while self-hosted does not. @@ -25,7 +25,7 @@ class Iframely { return await res.json(); } catch (err) { Logger.error(`Error fetching data from Iframely for url: ${url}`, err); - return; + return { error: err.message || "Unknown error" }; } } @@ -36,7 +36,9 @@ class Iframely { */ public static unfurl: UnfurlSignature = async (url: string) => { const data = await Iframely.requestResource(url); - return { ...data, type: UnfurlResourceType.OEmbed }; + return "error" in data // In addition to our custom UnfurlError, sometimes iframely returns error in the response body. + ? ({ error: data.error } as UnfurlError) + : { ...data, type: UnfurlResourceType.OEmbed }; }; } diff --git a/server/routes/api/urls/urls.test.ts b/server/routes/api/urls/urls.test.ts index 6f7f1b96f7..17a6a94d2e 100644 --- a/server/routes/api/urls/urls.test.ts +++ b/server/routes/api/urls/urls.test.ts @@ -20,7 +20,7 @@ jest.mock("dns", () => ({ jest .spyOn(Iframely, "requestResource") - .mockImplementation(() => Promise.resolve(undefined)); + .mockImplementation(() => Promise.resolve({})); const server = getTestServer(); diff --git a/server/routes/api/urls/urls.ts b/server/routes/api/urls/urls.ts index f730f1a0bd..f1e06d725d 100644 --- a/server/routes/api/urls/urls.ts +++ b/server/routes/api/urls/urls.ts @@ -98,11 +98,12 @@ router.post( } for (const plugin of plugins) { - const data = await plugin.value.unfurl(url, actor); - if (data) { - if ("error" in data) { + const unfurl = await plugin.value.unfurl(url, actor); + if (unfurl) { + if (unfurl.error) { return (ctx.response.status = 204); } else { + const data = unfurl as Unfurl; await CacheHelper.setData( CacheHelper.getUnfurlKey(actor.teamId, url), data, diff --git a/server/types.ts b/server/types.ts index a0d1c44493..f5952b4e01 100644 --- a/server/types.ts +++ b/server/types.ts @@ -578,10 +578,12 @@ export type CollectionJSONExport = { export type Unfurl = { [x: string]: JSONValue; type: UnfurlResourceType }; +export type UnfurlError = { error: string }; + export type UnfurlSignature = ( url: string, actor?: User -) => Promise; +) => Promise; export type UninstallSignature = (integration: Integration) => Promise; From 09a4b76aaed749bab9dd5c6270b49ce9adc913bd Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Thu, 17 Apr 2025 08:08:09 -0400 Subject: [PATCH 43/59] fix: Users subscribed to document and collection may be notified twice (#8997) fix: Create notifications in transaction --- .../models/helpers/NotificationHelper.test.ts | 4 +++ server/models/helpers/NotificationHelper.ts | 16 ++++++------ .../tasks/CommentCreatedNotificationsTask.ts | 25 +++++++++++-------- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/server/models/helpers/NotificationHelper.test.ts b/server/models/helpers/NotificationHelper.test.ts index 45ad954714..71b624efa8 100644 --- a/server/models/helpers/NotificationHelper.test.ts +++ b/server/models/helpers/NotificationHelper.test.ts @@ -251,6 +251,10 @@ describe("NotificationHelper", () => { userId: subscribedUser.id, collectionId: document.collectionId!, }); + await buildSubscription({ + userId: subscribedUser.id, + documentId: document.id, + }); const recipients = await NotificationHelper.getDocumentNotificationRecipients({ diff --git a/server/models/helpers/NotificationHelper.ts b/server/models/helpers/NotificationHelper.ts index 962a71fe56..7f33e8a296 100644 --- a/server/models/helpers/NotificationHelper.ts +++ b/server/models/helpers/NotificationHelper.ts @@ -1,4 +1,5 @@ import uniq from "lodash/uniq"; +import uniqBy from "lodash/uniqBy"; import { Op } from "sequelize"; import { NotificationEventType, @@ -187,7 +188,6 @@ export default class NotificationHelper { }); } else { const subscriptions = await Subscription.findAll({ - attributes: ["userId"], where: { userId: { [Op.ne]: actorId, @@ -206,17 +206,19 @@ export default class NotificationHelper { ], }); - recipients = subscriptions.map((s) => s.user); + recipients = uniqBy( + subscriptions.map((s) => s.user), + (user) => user.id + ); } - recipients = recipients.filter((recipient) => - recipient.subscribedToEventType(notificationType) - ); - const filtered = []; for (const recipient of recipients) { - if (recipient.isSuspended) { + if ( + recipient.isSuspended || + !recipient.subscribedToEventType(notificationType) + ) { continue; } diff --git a/server/queues/tasks/CommentCreatedNotificationsTask.ts b/server/queues/tasks/CommentCreatedNotificationsTask.ts index 7e6f86ee30..043ac32f33 100644 --- a/server/queues/tasks/CommentCreatedNotificationsTask.ts +++ b/server/queues/tasks/CommentCreatedNotificationsTask.ts @@ -85,16 +85,21 @@ export default class CommentCreatedNotificationsTask extends BaseTask !userIdsMentioned.includes(recipient.id)); - for (const recipient of recipients) { - await Notification.create({ - event: NotificationEventType.CreateComment, - userId: recipient.id, - actorId: comment.createdById, - teamId: document.teamId, - commentId: comment.id, - documentId: document.id, - }); - } + await sequelize.transaction(async (transaction) => { + for (const recipient of recipients) { + await Notification.create( + { + event: NotificationEventType.CreateComment, + userId: recipient.id, + actorId: comment.createdById, + teamId: document.teamId, + commentId: comment.id, + documentId: document.id, + }, + { transaction } + ); + } + }); } public get options() { From 6e9092bcaf3ccce227a116657c8e347ad745b80c Mon Sep 17 00:00:00 2001 From: "codegen-sh[bot]" <131295404+codegen-sh[bot]@users.noreply.github.com> Date: Thu, 17 Apr 2025 08:34:08 -0400 Subject: [PATCH 44/59] #8962: Remove "Self hosted" integrations page (#9001) * #8962: Remove "Self hosted" integrations page * Remove unused BuildingBlocksIcon import --------- Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com> Co-authored-by: Tom Moor --- app/hooks/useSettingsConfig.ts | 10 --- app/scenes/Settings/SelfHosted.tsx | 140 ----------------------------- package.json | 3 +- 3 files changed, 2 insertions(+), 151 deletions(-) delete mode 100644 app/scenes/Settings/SelfHosted.tsx diff --git a/app/hooks/useSettingsConfig.ts b/app/hooks/useSettingsConfig.ts index 89935f8c80..e564103dc7 100644 --- a/app/hooks/useSettingsConfig.ts +++ b/app/hooks/useSettingsConfig.ts @@ -8,7 +8,6 @@ import { GlobeIcon, TeamIcon, BeakerIcon, - BuildingBlocksIcon, SettingsIcon, ExportIcon, ImportIcon, @@ -40,7 +39,6 @@ const Notifications = lazy(() => import("~/scenes/Settings/Notifications")); const Preferences = lazy(() => import("~/scenes/Settings/Preferences")); const Profile = lazy(() => import("~/scenes/Settings/Profile")); const Security = lazy(() => import("~/scenes/Settings/Security")); -const SelfHosted = lazy(() => import("~/scenes/Settings/SelfHosted")); const Shares = lazy(() => import("~/scenes/Settings/Shares")); const Templates = lazy(() => import("~/scenes/Settings/Templates")); const Zapier = lazy(() => import("~/scenes/Settings/Zapier")); @@ -177,14 +175,6 @@ const useSettingsConfig = () => { icon: ExportIcon, }, // Integrations - { - name: t("Self Hosted"), - path: integrationSettingsPath("self-hosted"), - component: SelfHosted, - enabled: can.update && !isCloudHosted, - group: t("Integrations"), - icon: BuildingBlocksIcon, - }, { name: "Zapier", path: integrationSettingsPath("zapier"), diff --git a/app/scenes/Settings/SelfHosted.tsx b/app/scenes/Settings/SelfHosted.tsx deleted file mode 100644 index bc836d218d..0000000000 --- a/app/scenes/Settings/SelfHosted.tsx +++ /dev/null @@ -1,140 +0,0 @@ -import find from "lodash/find"; -import { observer } from "mobx-react"; -import { BuildingBlocksIcon } from "outline-icons"; -import * as React from "react"; -import { useForm } from "react-hook-form"; -import { useTranslation } from "react-i18next"; -import { toast } from "sonner"; -import { IntegrationService, IntegrationType } from "@shared/types"; -import Integration from "~/models/Integration"; -import Button from "~/components/Button"; -import Heading from "~/components/Heading"; -import Input from "~/components/Input"; -import Scene from "~/components/Scene"; -import useStores from "~/hooks/useStores"; -import SettingRow from "./components/SettingRow"; - -type FormData = { - drawIoUrl: string; - gristUrl: string; -}; - -function SelfHosted() { - const { integrations } = useStores(); - const { t } = useTranslation(); - - const integrationDiagrams = find(integrations.orderedData, { - type: IntegrationType.Embed, - service: IntegrationService.Diagrams, - }) as Integration | undefined; - - const integrationGrist = find(integrations.orderedData, { - type: IntegrationType.Embed, - service: IntegrationService.Grist, - }) as Integration | undefined; - - const { - register, - reset, - handleSubmit: formHandleSubmit, - formState, - } = useForm({ - mode: "all", - defaultValues: { - drawIoUrl: integrationDiagrams?.settings.url, - gristUrl: integrationGrist?.settings.url, - }, - }); - - React.useEffect(() => { - void integrations.fetchPage({ - type: IntegrationType.Embed, - }); - }, [integrations]); - - React.useEffect(() => { - reset({ - drawIoUrl: integrationDiagrams?.settings.url, - gristUrl: integrationGrist?.settings.url, - }); - }, [integrationDiagrams, integrationGrist, reset]); - - const handleSubmit = React.useCallback( - async (data: FormData) => { - try { - if (data.drawIoUrl) { - await integrations.save({ - id: integrationDiagrams?.id, - type: IntegrationType.Embed, - service: IntegrationService.Diagrams, - settings: { - url: data.drawIoUrl, - }, - }); - } else { - await integrationDiagrams?.delete(); - } - - if (data.gristUrl) { - await integrations.save({ - id: integrationGrist?.id, - type: IntegrationType.Embed, - service: IntegrationService.Grist, - settings: { - url: data.gristUrl, - }, - }); - } else { - await integrationGrist?.delete(); - } - - toast.success(t("Settings saved")); - } catch (err) { - toast.error(err.message); - } - }, - [integrations, integrationDiagrams, integrationGrist, t] - ); - - return ( - }> - {t("Self Hosted")} - -
- - - - - - - - - -
-
- ); -} - -export default observer(SelfHosted); diff --git a/package.json b/package.json index d6f7eacb6d..6c9513b8d1 100644 --- a/package.json +++ b/package.json @@ -377,5 +377,6 @@ "rollup": "^4.5.1", "prismjs": "1.30.0" }, - "version": "0.83.0" + "version": "0.83.0", + "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } From e1e334dd5fcb8a4446ec34671c4fe9fd736fbca8 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Thu, 17 Apr 2025 22:57:43 -0400 Subject: [PATCH 45/59] fix: Deleted users appear in mention menu before search query (#9003) --- app/stores/base/Store.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/stores/base/Store.ts b/app/stores/base/Store.ts index 9bce939270..048ecb5ddb 100644 --- a/app/stores/base/Store.ts +++ b/app/stores/base/Store.ts @@ -99,7 +99,14 @@ export default abstract class Store { const normalized = deburr((query ?? "").trim().toLocaleLowerCase()); if (!normalized) { - return this.orderedData.slice(0, options?.maxResults); + return this.orderedData + .filter((item) => { + if ("deletedAt" in item && item.deletedAt) { + return false; + } + return true; + }) + .slice(0, options?.maxResults); } return this.orderedData From 65bb3b11f3c6fd7fef4fc40cb8fa1b68ebd9b408 Mon Sep 17 00:00:00 2001 From: Hemachandar <132386067+hmacr@users.noreply.github.com> Date: Fri, 18 Apr 2025 20:15:17 +0530 Subject: [PATCH 46/59] fix: Parse emoji and url only as workspace icon (#9009) * fix: Parse emoji and url only as workspace icon * scope emoji regex to transform function --- plugins/notion/server/notion.ts | 13 ++++++++++++- shared/i18n/locales/en_US/translation.json | 5 ----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/plugins/notion/server/notion.ts b/plugins/notion/server/notion.ts index f2bf11d170..22a7783517 100644 --- a/plugins/notion/server/notion.ts +++ b/plugins/notion/server/notion.ts @@ -13,9 +13,11 @@ import { RichTextItemResponse, } from "@notionhq/client/build/src/api-endpoints"; import { RateLimit } from "async-sema"; +import emojiRegex from "emoji-regex"; import compact from "lodash/compact"; import { z } from "zod"; import { Second } from "@shared/utils/time"; +import { isUrl } from "@shared/utils/urls"; import { NotionUtils } from "../shared/NotionUtils"; import { Block, Page, PageType } from "../shared/types"; import env from "./env"; @@ -37,7 +39,16 @@ const AccessTokenResponseSchema = z.object({ bot_id: z.string(), workspace_id: z.string(), workspace_name: z.string().nullish(), - workspace_icon: z.string().url().nullish(), + workspace_icon: z + .string() + .nullish() + .transform((val) => { + const emojiRegexp = emojiRegex(); + if (val && (isUrl(val) || emojiRegexp.test(val))) { + return val; + } + return undefined; + }), }); export class NotionClient { diff --git a/shared/i18n/locales/en_US/translation.json b/shared/i18n/locales/en_US/translation.json index 8fbf8b128e..69080e8369 100644 --- a/shared/i18n/locales/en_US/translation.json +++ b/shared/i18n/locales/en_US/translation.json @@ -520,7 +520,6 @@ "Groups": "Groups", "Shared Links": "Shared Links", "Import": "Import", - "Self Hosted": "Self Hosted", "Integrations": "Integrations", "Revoke token": "Revoke token", "Revoke": "Revoke", @@ -1045,10 +1044,6 @@ "Allow editors to create new collections within the workspace": "Allow editors to create new collections within the workspace", "Workspace creation": "Workspace creation", "Allow editors to create new workspaces": "Allow editors to create new workspaces", - "Draw.io deployment": "Draw.io deployment", - "Add your self-hosted draw.io installation url here to enable automatic embedding of diagrams within documents.": "Add your self-hosted draw.io installation url here to enable automatic embedding of diagrams within documents.", - "Grist deployment": "Grist deployment", - "Add your self-hosted grist installation URL here.": "Add your self-hosted grist installation URL here.", "Could not load shares": "Could not load shares", "Sharing is currently disabled.": "Sharing is currently disabled.", "You can globally enable and disable public document sharing in the security settings.": "You can globally enable and disable public document sharing in the security settings.", From 2b07f412e28795e1bd11a95401c89ff93bbd0d5e Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Fri, 18 Apr 2025 19:31:36 -0400 Subject: [PATCH 47/59] fix: Image caption is not correctly centered on full-width image (#9013) --- shared/editor/components/Styles.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/shared/editor/components/Styles.ts b/shared/editor/components/Styles.ts index b8f2e375ca..7c3d8cf3ff 100644 --- a/shared/editor/components/Styles.ts +++ b/shared/editor/components/Styles.ts @@ -707,6 +707,7 @@ img.ProseMirror-separator { resize: none; user-select: text; margin: 0 auto !important; + max-width: 100vw; } .ProseMirror[contenteditable="false"] { From 05a61927af8479ec754810562fdff4e6ff7a717d Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 19 Apr 2025 16:24:14 -0400 Subject: [PATCH 48/59] fix: Improve settings table layout on mobile (#9012) --- app/components/Table.tsx | 4 +- .../Settings/components/MembersTable.tsx | 44 ++++++++++++------- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/app/components/Table.tsx b/app/components/Table.tsx index d1b9c25e74..b92d3effa1 100644 --- a/app/components/Table.tsx +++ b/app/components/Table.tsx @@ -335,6 +335,7 @@ const TR = styled.div<{ $columns: string }>` grid-template-columns: ${({ $columns }) => `${$columns}`}; align-items: center; border-bottom: 1px solid ${s("divider")}; + overflow: hidden; &:last-child { border-bottom: 0; @@ -357,7 +358,8 @@ const TD = styled.span` padding: 10px 6px; font-size: 14px; text-wrap: wrap; - word-break: break-word; + overflow: hidden; + text-overflow: ellipsis; &:first-child { font-size: 15px; diff --git a/app/scenes/Settings/components/MembersTable.tsx b/app/scenes/Settings/components/MembersTable.tsx index 962eb8ca68..690360c430 100644 --- a/app/scenes/Settings/components/MembersTable.tsx +++ b/app/scenes/Settings/components/MembersTable.tsx @@ -2,6 +2,7 @@ import compact from "lodash/compact"; import * as React from "react"; import { useTranslation } from "react-i18next"; import styled from "styled-components"; +import Text from "@shared/components/Text"; import User from "~/models/User"; import { Avatar, AvatarSize } from "~/components/Avatar"; import Badge from "~/components/Badge"; @@ -14,6 +15,7 @@ import { import { type Column as TableColumn } from "~/components/Table"; import Time from "~/components/Time"; import useCurrentUser from "~/hooks/useCurrentUser"; +import useMobile from "~/hooks/useMobile"; import UserMenu from "~/menus/UserMenu"; import { FILTER_HEIGHT } from "./StickyFilters"; @@ -27,6 +29,7 @@ type Props = Omit, "columns" | "rowHeight"> & { export function MembersTable({ canManage, ...rest }: Props) { const { t } = useTranslation(); const currentUser = useCurrentUser(); + const isMobile = useMobile(); const columns = React.useMemo[]>( () => @@ -38,13 +41,20 @@ export function MembersTable({ canManage, ...rest }: Props) { accessor: (user) => user.name, component: (user) => ( - {user.name}{" "} - {currentUser.id === user.id && `(${t("You")})`} + {" "} + + + {user.name} {currentUser.id === user.id && `(${t("You")})`} + + {isMobile && canManage && ( + {user.email} + )} + ), width: "4fr", }, - canManage + canManage && !isMobile ? { type: "data", id: "email", @@ -54,17 +64,19 @@ export function MembersTable({ canManage, ...rest }: Props) { width: "4fr", } : undefined, - { - type: "data", - id: "lastActiveAt", - header: t("Last active"), - accessor: (user) => user.lastActiveAt, - component: (user) => - user.lastActiveAt ? ( -