Merge branch 'dependabot/npm_and_yarn/minor-and-patch-74f704f9c9'

This commit is contained in:
John Livingston 2025-05-12 13:09:51 +02:00
commit 38cfc05962
No known key found for this signature in database
GPG Key ID: B17B5640CE66CDBC
6 changed files with 1115 additions and 849 deletions

View File

@ -39,9 +39,7 @@ export class PtContext {
* Keep them in cache after first request. * Keep them in cache after first request.
*/ */
public async getSettings (): Promise<LiveChatSettings> { public async getSettings (): Promise<LiveChatSettings> {
if (!this._settings) { this._settings ??= await this.ptOptions.peertubeHelpers.getSettings() as LiveChatSettings
this._settings = await this.ptOptions.peertubeHelpers.getSettings() as LiveChatSettings
}
return this._settings return this._settings
} }
} }

View File

@ -54,7 +54,7 @@ function overrideMUCMessageForm (_converse: any, current: Current): void {
class MUCMessageFormloaded extends MUCMessageForm { class MUCMessageFormloaded extends MUCMessageForm {
async onFormSubmitted (ev?: Event): Promise<void> { async onFormSubmitted (ev?: Event): Promise<void> {
const announcementSelect = this.querySelector('[name=livechat-announcements]') const announcementSelect = this.querySelector('[name=livechat-announcements]')
current.announcementType = announcementSelect?.selectedOptions?.[0]?.value || undefined current.announcementType = announcementSelect?.selectedOptions?.[0]?.value ?? undefined
try { try {
await super.onFormSubmitted(ev) await super.onFormSubmitted(ev)
if (announcementSelect) { announcementSelect.selectedIndex = 0 } // set back to default if (announcementSelect) { announcementSelect.selectedIndex = 0 } // set back to default
@ -173,7 +173,7 @@ function onGetOutgoingMessageAttributes (
chatbox: any, chatbox: any,
attrs: any attrs: any
): Parameters<typeof onGetOutgoingMessageAttributes>[3] { ): Parameters<typeof onGetOutgoingMessageAttributes>[3] {
if (!current.announcementType) { return attrs } if (!current.announcementType) { return attrs } // undefined or ""
const { __ } = _converse const { __ } = _converse
attrs.livechat_announcement_type = current.announcementType attrs.livechat_announcement_type = current.announcementType

View File

@ -78,7 +78,7 @@ export default tseslint.config(
'@typescript-eslint/no-unsafe-call': 'off', // FIXME: comes with eslint-config-love 84 update, and should be used. '@typescript-eslint/no-unsafe-call': 'off', // FIXME: comes with eslint-config-love 84 update, and should be used.
'@typescript-eslint/no-unnecessary-condition': 'off', // FIXME: comes with eslint-config-love 84 update, but seems buggy (false positive). '@typescript-eslint/no-unnecessary-condition': 'off', // FIXME: comes with eslint-config-love 84 update, but seems buggy (false positive).
'@typescript-eslint/prefer-nullish-coalescing': 'off', // disabling, because many false positive (where i want "" to act as false)
'max-len': [ 'max-len': [
'error', 'error',
{ {

1910
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -26,7 +26,7 @@
"dist/assets/styles/style.css" "dist/assets/styles/style.css"
], ],
"dependencies": { "dependencies": {
"@xmpp/jid": "^0.13.1", "@xmpp/jid": "^0.13.2",
"async": "^3.2.6", "async": "^3.2.6",
"decache": "^4.6.2", "decache": "^4.6.2",
"escape-html": "^1.0.3", "escape-html": "^1.0.3",
@ -38,42 +38,42 @@
"xmppjs-chat-bot": "^0.5.0" "xmppjs-chat-bot": "^0.5.0"
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.16.0", "@eslint/js": "^9.26.0",
"@lit-labs/motion": "^1.0.7", "@lit-labs/motion": "^1.0.8",
"@lit/context": "^1.1.3", "@lit/context": "^1.1.5",
"@lit/task": "^1.0.1", "@lit/task": "^1.0.2",
"@peertube/feed": "^5.1.3", "@peertube/feed": "^5.4.1",
"@peertube/peertube-types": "^5.2.0", "@peertube/peertube-types": "^5.2.0",
"@stylistic/eslint-plugin": "^2.11.0", "@stylistic/eslint-plugin": "^2.11.0",
"@tsconfig/node16": "^16.1.3", "@tsconfig/node16": "^16.1.3",
"@types/async": "^3.2.24", "@types/async": "^3.2.24",
"@types/escape-html": "^1.0.4", "@types/escape-html": "^1.0.4",
"@types/eslint__js": "^8.42.3", "@types/eslint__js": "^8.42.3",
"@types/express": "^5.0.0", "@types/express": "^5.0.1",
"@types/got": "^9.6.12", "@types/got": "^9.6.12",
"@types/http-proxy": "^1.17.15", "@types/http-proxy": "^1.17.16",
"@types/node": "^16.18.121", "@types/node": "^16.18.126",
"@types/winston": "^2.4.4", "@types/winston": "^2.4.4",
"@types/xmpp__jid": "^1.3.5", "@types/xmpp__jid": "^1.3.5",
"@typescript-eslint/parser": "^8.4.0", "@typescript-eslint/parser": "^8.4.0",
"commander": "^13.1.0", "commander": "^13.1.0",
"esbuild": "^0.25.0", "esbuild": "^0.25.4",
"eslint": "^8.57.1", "eslint": "^8.57.1",
"eslint-config-love": "^84.1.1", "eslint-config-love": "^84.1.1",
"eslint-plugin-lit": "^1.15.0", "eslint-plugin-lit": "^1.15.0",
"globals": "^15.13.0", "globals": "^15.13.0",
"lit": "^3.2.1", "lit": "^3.3.0",
"lit-analyzer": "^2.0.3", "lit-analyzer": "^2.0.3",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"sass": "^1.81.1", "sass": "^1.88.0",
"sharp": "^0.33.5", "sharp": "^0.34.1",
"stylelint": "^16.11.0", "stylelint": "^16.19.1",
"stylelint-config-recommended-scss": "^14.1.0", "stylelint-config-recommended-scss": "^14.1.0",
"stylelint-config-standard-scss": "^14.0.0", "stylelint-config-standard-scss": "^14.0.0",
"svgo": "^3.3.2", "svgo": "^3.3.2",
"typescript": "^5.5.4", "typescript": "^5.5.4",
"typescript-eslint": "^8.17.0", "typescript-eslint": "^8.32.0",
"yaml": "^2.6.1" "yaml": "^2.7.1"
}, },
"engine": { "engine": {
"peertube": ">=5.2.0" "peertube": ">=5.2.0"

View File

@ -89,17 +89,29 @@ async function initWebchatRouter (options: RegisterServerOptionsV5): Promise<Rou
) { ) {
peertubeHelpers.logger.debug('Trying to load AutoColors...') peertubeHelpers.logger.debug('Trying to load AutoColors...')
const autocolors: AutoColors = { const autocolors: AutoColors = {
// eslint-disable-next-line @typescript-eslint/no-base-to-string
mainForeground: req.query._ac_mainForeground?.toString() ?? '', mainForeground: req.query._ac_mainForeground?.toString() ?? '',
// eslint-disable-next-line @typescript-eslint/no-base-to-string
mainBackground: req.query._ac_mainBackground?.toString() ?? '', mainBackground: req.query._ac_mainBackground?.toString() ?? '',
// eslint-disable-next-line @typescript-eslint/no-base-to-string
greyForeground: req.query._ac_greyForeground?.toString() ?? '', greyForeground: req.query._ac_greyForeground?.toString() ?? '',
// eslint-disable-next-line @typescript-eslint/no-base-to-string
greyBackground: req.query._ac_greyBackground?.toString() ?? '', greyBackground: req.query._ac_greyBackground?.toString() ?? '',
// eslint-disable-next-line @typescript-eslint/no-base-to-string
menuForeground: req.query._ac_menuForeground?.toString() ?? '', menuForeground: req.query._ac_menuForeground?.toString() ?? '',
// eslint-disable-next-line @typescript-eslint/no-base-to-string
menuBackground: req.query._ac_menuBackground?.toString() ?? '', menuBackground: req.query._ac_menuBackground?.toString() ?? '',
// eslint-disable-next-line @typescript-eslint/no-base-to-string
inputForeground: req.query._ac_inputForeground?.toString() ?? '', inputForeground: req.query._ac_inputForeground?.toString() ?? '',
// eslint-disable-next-line @typescript-eslint/no-base-to-string
inputBackground: req.query._ac_inputBackground?.toString() ?? '', inputBackground: req.query._ac_inputBackground?.toString() ?? '',
// eslint-disable-next-line @typescript-eslint/no-base-to-string
buttonForeground: req.query._ac_buttonForeground?.toString() ?? '', buttonForeground: req.query._ac_buttonForeground?.toString() ?? '',
// eslint-disable-next-line @typescript-eslint/no-base-to-string
buttonBackground: req.query._ac_buttonBackground?.toString() ?? '', buttonBackground: req.query._ac_buttonBackground?.toString() ?? '',
// eslint-disable-next-line @typescript-eslint/no-base-to-string
link: req.query._ac_link?.toString() ?? '', link: req.query._ac_link?.toString() ?? '',
// eslint-disable-next-line @typescript-eslint/no-base-to-string
linkHover: req.query._ac_linkHover?.toString() ?? '' linkHover: req.query._ac_linkHover?.toString() ?? ''
} }
if (!Object.values(autocolors).find(c => c !== '')) { if (!Object.values(autocolors).find(c => c !== '')) {