From 3a2e468d32effa418f9c33fac0eda728a8377bf5 Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Fri, 8 Mar 2024 12:19:07 +0100 Subject: [PATCH] Update d.ts dependency Add an event to update the counter --- .../Ui/User/Menu/Data/Conversation.js | 4 ++ package-lock.json | 72 +++++++++---------- package.json | 2 +- .../Ui/User/Menu/Data/Conversation.ts | 6 ++ 4 files changed, 47 insertions(+), 37 deletions(-) diff --git a/files/js/WoltLabSuite/Core/Conversation/Ui/User/Menu/Data/Conversation.js b/files/js/WoltLabSuite/Core/Conversation/Ui/User/Menu/Data/Conversation.js index 08a604b..45ce9d2 100644 --- a/files/js/WoltLabSuite/Core/Conversation/Ui/User/Menu/Data/Conversation.js +++ b/files/js/WoltLabSuite/Core/Conversation/Ui/User/Menu/Data/Conversation.js @@ -27,6 +27,10 @@ define(["require", "exports", "tslib", "WoltLabSuite/Core/Ajax", "WoltLabSuite/C this.counter = counter; } } + this.button.addEventListener("updateCounter", (event) => { + this.updateCounter(event.detail.counter); + this.stale = true; + }); } getPanelButton() { return this.button; diff --git a/package-lock.json b/package-lock.json index a83f35f..33791dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,7 +5,7 @@ "packages": { "": { "dependencies": { - "@woltlab/d.ts": "https://github.com/WoltLab/d.ts.git#c08648e9f82c381bd18b91ac1072c430e58e71f1" + "@woltlab/d.ts": "https://github.com/WoltLab/d.ts.git#4e9d0e4825110d3fd140cbdcecac6f1bcd7a1840" }, "devDependencies": { "@typescript-eslint/eslint-plugin": "^6.5.0", @@ -481,9 +481,9 @@ } }, "node_modules/@types/facebook-js-sdk": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/@types/facebook-js-sdk/-/facebook-js-sdk-3.3.6.tgz", - "integrity": "sha512-CxTLMVtZsgrj9Ven5Pn1vcFumCFs+CG8Jfc63xWq/8b9e6uWjGyZlMnvQk7lIVn97Zd1vpu0ZK/OFWAoap0RCw==" + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/@types/facebook-js-sdk/-/facebook-js-sdk-3.3.10.tgz", + "integrity": "sha512-85YWoOkYD1N8yCKRjxcjaroK73UnE3pIEG6zPRIPrb8D4HFceqNp60EQ7SZlu7vHpWGD+yCRumBH606vRUuMLw==" }, "node_modules/@types/google.maps": { "version": "3.54.0", @@ -491,9 +491,9 @@ "integrity": "sha512-b1MBy2eGrZoEFLnzq1RrlHbfzuWHz+Nitgqbb5N+MFA0kAUv0kYPmAXtczpb4dHlFZyu58EYzcKXtWNqSInyXg==" }, "node_modules/@types/jquery": { - "version": "3.5.16", - "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.16.tgz", - "integrity": "sha512-bsI7y4ZgeMkmpG9OM710RRzDFp+w4P1RGiIt30C1mSBT+ExCleeh4HObwgArnDFELmRrOpXgSYN9VF1hj+f1lw==", + "version": "3.5.29", + "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.29.tgz", + "integrity": "sha512-oXQQC9X9MOPRrMhPHHOsXqeQDnWeCDT3PelUIg/Oy8FAbzSZtFHRjc7IpbfFVmpLtJ+UOoywpRsuO5Jxjybyeg==", "dependencies": { "@types/sizzle": "*" } @@ -521,14 +521,14 @@ "dev": true }, "node_modules/@types/sizzle": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.3.tgz", - "integrity": "sha512-JYM8x9EGF163bEyhdJBpR2QX1R5naCJHC8ucJylJ3w9/CVBaskdQ8WqBf8MmQrd1kRvp/a4TS8HJ+bxzR7ZJYQ==" + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.8.tgz", + "integrity": "sha512-0vWLNK2D5MT9dg0iOo8GlKguPAU02QjmZitPEsXRuJXU/OGIOt9vT9Fc26wtYuavLxtO45v9PGleoL9Z0k1LHg==" }, "node_modules/@types/twitter-for-web": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@types/twitter-for-web/-/twitter-for-web-0.0.2.tgz", - "integrity": "sha512-fDg882G9KHOkVxyJFkZ1hIOHxgj1vHLZnMJshF9W+8C2f9lzkIc/DeD1Ed2q1SWaHD/hdooaFIWTDhgL8zzpYg==" + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/@types/twitter-for-web/-/twitter-for-web-0.0.3.tgz", + "integrity": "sha512-ty80ZBqE5B5+Jyre2tAdfBDrurLwWYlg1oqyKV91GpxU6e3rjHo2bxZb7ivgfZAOPDYsgzHfg/cbHgsx6ruhmg==" }, "node_modules/@types/zxcvbn": { "version": "4.4.2", @@ -725,17 +725,17 @@ } }, "node_modules/@woltlab/d.ts": { - "resolved": "git+ssh://git@github.com/WoltLab/d.ts.git#c08648e9f82c381bd18b91ac1072c430e58e71f1", - "integrity": "sha512-cqNfrQOmIb3rX7qc/NtLQ/abvV5nxY8IS5ybE2h15q0X/jskjwdnSdGfX44bAbNKmjC9bQvi8LdZSzY0PNGHMw==", + "resolved": "git+ssh://git@github.com/WoltLab/d.ts.git#4e9d0e4825110d3fd140cbdcecac6f1bcd7a1840", + "integrity": "sha512-dsat3LZeU0bKYe89UA0e0jTjqU8gn5LaN7PK8OvXblx1TG24Ge/Nwj1CWbaqXTuTdRCXJ6TcLQ0yDJ0BTnk4qw==", "dependencies": { "@ckeditor/ckeditor5-inspector": "^4.1.0", "@googlemaps/markerclusterer": "^2.0.15", - "@types/facebook-js-sdk": "^3.3.6", + "@types/facebook-js-sdk": "^3.3.7", "@types/google.maps": "^3.54.0", - "@types/jquery": "^3.5.16", + "@types/jquery": "^3.5.18", "@types/pica": "^5.1.3", "@types/prismjs": "^1.26.0", - "@types/twitter-for-web": "0.0.2", + "@types/twitter-for-web": "0.0.3", "@woltlab/editor": "git+https://github.com/WoltLab/editor.git#c407a8efe4f3ad08d7777cd71dce30b4dd2a523a", "@woltlab/zxcvbn": "git+https://github.com/WoltLab/zxcvbn.git#5b582b24e437f1883ccad3c37dae7c3c5f1e7da3", "focus-trap": "^7.5.2", @@ -2512,9 +2512,9 @@ } }, "@types/facebook-js-sdk": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/@types/facebook-js-sdk/-/facebook-js-sdk-3.3.6.tgz", - "integrity": "sha512-CxTLMVtZsgrj9Ven5Pn1vcFumCFs+CG8Jfc63xWq/8b9e6uWjGyZlMnvQk7lIVn97Zd1vpu0ZK/OFWAoap0RCw==" + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/@types/facebook-js-sdk/-/facebook-js-sdk-3.3.10.tgz", + "integrity": "sha512-85YWoOkYD1N8yCKRjxcjaroK73UnE3pIEG6zPRIPrb8D4HFceqNp60EQ7SZlu7vHpWGD+yCRumBH606vRUuMLw==" }, "@types/google.maps": { "version": "3.54.0", @@ -2522,9 +2522,9 @@ "integrity": "sha512-b1MBy2eGrZoEFLnzq1RrlHbfzuWHz+Nitgqbb5N+MFA0kAUv0kYPmAXtczpb4dHlFZyu58EYzcKXtWNqSInyXg==" }, "@types/jquery": { - "version": "3.5.16", - "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.16.tgz", - "integrity": "sha512-bsI7y4ZgeMkmpG9OM710RRzDFp+w4P1RGiIt30C1mSBT+ExCleeh4HObwgArnDFELmRrOpXgSYN9VF1hj+f1lw==", + "version": "3.5.29", + "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.29.tgz", + "integrity": "sha512-oXQQC9X9MOPRrMhPHHOsXqeQDnWeCDT3PelUIg/Oy8FAbzSZtFHRjc7IpbfFVmpLtJ+UOoywpRsuO5Jxjybyeg==", "requires": { "@types/sizzle": "*" } @@ -2552,14 +2552,14 @@ "dev": true }, "@types/sizzle": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.3.tgz", - "integrity": "sha512-JYM8x9EGF163bEyhdJBpR2QX1R5naCJHC8ucJylJ3w9/CVBaskdQ8WqBf8MmQrd1kRvp/a4TS8HJ+bxzR7ZJYQ==" + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.8.tgz", + "integrity": "sha512-0vWLNK2D5MT9dg0iOo8GlKguPAU02QjmZitPEsXRuJXU/OGIOt9vT9Fc26wtYuavLxtO45v9PGleoL9Z0k1LHg==" }, "@types/twitter-for-web": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@types/twitter-for-web/-/twitter-for-web-0.0.2.tgz", - "integrity": "sha512-fDg882G9KHOkVxyJFkZ1hIOHxgj1vHLZnMJshF9W+8C2f9lzkIc/DeD1Ed2q1SWaHD/hdooaFIWTDhgL8zzpYg==" + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/@types/twitter-for-web/-/twitter-for-web-0.0.3.tgz", + "integrity": "sha512-ty80ZBqE5B5+Jyre2tAdfBDrurLwWYlg1oqyKV91GpxU6e3rjHo2bxZb7ivgfZAOPDYsgzHfg/cbHgsx6ruhmg==" }, "@types/zxcvbn": { "version": "4.4.2", @@ -2667,18 +2667,18 @@ } }, "@woltlab/d.ts": { - "version": "git+ssh://git@github.com/WoltLab/d.ts.git#c08648e9f82c381bd18b91ac1072c430e58e71f1", - "integrity": "sha512-cqNfrQOmIb3rX7qc/NtLQ/abvV5nxY8IS5ybE2h15q0X/jskjwdnSdGfX44bAbNKmjC9bQvi8LdZSzY0PNGHMw==", - "from": "@woltlab/d.ts@https://github.com/WoltLab/d.ts.git#c08648e9f82c381bd18b91ac1072c430e58e71f1", + "version": "git+ssh://git@github.com/WoltLab/d.ts.git#4e9d0e4825110d3fd140cbdcecac6f1bcd7a1840", + "integrity": "sha512-dsat3LZeU0bKYe89UA0e0jTjqU8gn5LaN7PK8OvXblx1TG24Ge/Nwj1CWbaqXTuTdRCXJ6TcLQ0yDJ0BTnk4qw==", + "from": "@woltlab/d.ts@https://github.com/WoltLab/d.ts.git#4e9d0e4825110d3fd140cbdcecac6f1bcd7a1840", "requires": { "@ckeditor/ckeditor5-inspector": "^4.1.0", "@googlemaps/markerclusterer": "^2.0.15", - "@types/facebook-js-sdk": "^3.3.6", + "@types/facebook-js-sdk": "^3.3.7", "@types/google.maps": "^3.54.0", - "@types/jquery": "^3.5.16", + "@types/jquery": "^3.5.18", "@types/pica": "^5.1.3", "@types/prismjs": "^1.26.0", - "@types/twitter-for-web": "0.0.2", + "@types/twitter-for-web": "0.0.3", "@woltlab/editor": "git+https://github.com/WoltLab/editor.git#c407a8efe4f3ad08d7777cd71dce30b4dd2a523a", "@woltlab/zxcvbn": "git+https://github.com/WoltLab/zxcvbn.git#5b582b24e437f1883ccad3c37dae7c3c5f1e7da3", "focus-trap": "^7.5.2", diff --git a/package.json b/package.json index 8e4bccb..737f8fd 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,6 @@ "typescript": "^5.2.2" }, "dependencies": { - "@woltlab/d.ts": "https://github.com/WoltLab/d.ts.git#c08648e9f82c381bd18b91ac1072c430e58e71f1" + "@woltlab/d.ts": "https://github.com/WoltLab/d.ts.git#4e9d0e4825110d3fd140cbdcecac6f1bcd7a1840" } } diff --git a/ts/WoltLabSuite/Core/Conversation/Ui/User/Menu/Data/Conversation.ts b/ts/WoltLabSuite/Core/Conversation/Ui/User/Menu/Data/Conversation.ts index 6c2b7de..e05065f 100644 --- a/ts/WoltLabSuite/Core/Conversation/Ui/User/Menu/Data/Conversation.ts +++ b/ts/WoltLabSuite/Core/Conversation/Ui/User/Menu/Data/Conversation.ts @@ -10,6 +10,7 @@ import { dboAction } from "WoltLabSuite/Core/Ajax"; import UserMenuView from "WoltLabSuite/Core/Ui/User/Menu/View"; import { + EventUpdateCounter, UserMenuButton, UserMenuData, UserMenuFooter, @@ -55,6 +56,11 @@ class UserMenuDataConversation implements UserMenuProvider { this.counter = counter; } } + this.button.addEventListener("updateCounter", (event: CustomEvent) => { + this.updateCounter(event.detail.counter); + + this.stale = true; + }); } getPanelButton(): HTMLElement { -- 2.20.1