From a7e131070eb979884d38394354a4f5fe2757c032 Mon Sep 17 00:00:00 2001 From: SirStendec Date: Sun, 5 Nov 2023 14:49:39 -0500 Subject: [PATCH] 4.59.0 * Fixed: Appearance of the page when viewing a Watch Party. * Fixed: During the initial load, some CSS blocks could be incorrectly injected into the page due to a race condition. * Fixed: The sample embed in Chat > Appearance >> Rich Content not appearing correctly. * API Added: New event class `FFZWaitableEvent`, a subclass of `FFZEvent` providing a framework for asynchronous event handlers. * API Added: `site.channel:update-bar` event, fired whenever the channel info bar is updated. * API Fixed: `chat.removeTokenizer()`, `chat.removeLinkProvider()`, and `chat.removeRichProvider()` failing to fully remove their respective items. * API Removed: The `emitAsync` method has been removed from modules. Nothing was using it, and it was problematic due to the concurrent access protection on events. Instead, `FFZWaitableEvent` should be used if asynchronous waiting is necessary. --- package.json | 2 +- src/modules/chat/components/chat-rich.vue | 10 +- src/modules/chat/index.js | 6 + .../components/chat-rich-example.vue | 13 +- src/sites/twitch-twilight/modules/channel.jsx | 2 + .../twitch-twilight/modules/chat/index.js | 1 + .../modules/css_tweaks/index.js | 30 ++++- .../styles/chat-fix--watch-party.scss | 19 +++ .../modules/css_tweaks/styles/chat-fix.scss | 5 +- .../modules/css_tweaks/styles/chat-width.scss | 2 +- src/sites/twitch-twilight/modules/layout.js | 27 ++-- src/utilities/css-tweaks.js | 26 +++- src/utilities/events.js | 125 ++++++------------ 13 files changed, 156 insertions(+), 112 deletions(-) create mode 100644 src/sites/twitch-twilight/modules/css_tweaks/styles/chat-fix--watch-party.scss diff --git a/package.json b/package.json index a9d99610..93a7d97b 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "frankerfacez", "author": "Dan Salvato LLC", - "version": "4.58.0", + "version": "4.59.0", "description": "FrankerFaceZ is a Twitch enhancement suite.", "private": true, "license": "Apache-2.0", diff --git a/src/modules/chat/components/chat-rich.vue b/src/modules/chat/components/chat-rich.vue index dab22448..2cbc3222 100644 --- a/src/modules/chat/components/chat-rich.vue +++ b/src/modules/chat/components/chat-rich.vue @@ -9,7 +9,7 @@ let tokenizer; export default { - props: ['data', 'url', 'events', 'forceFull', 'forceUnsafe', 'forceMedia', 'forceMid', 'noLink', 'noTooltip', 'noElevation', 'noUnsafe'], + props: ['data', 'url', 'events', 'forceFull', 'forceUnsafe', 'forceMedia', 'forceShort', 'forceMid', 'noLink', 'noTooltip', 'noElevation', 'noUnsafe'], data() { return { @@ -256,9 +256,13 @@ export default { renderBody(h) { let body; - if ( this.forceFull === true || (this.forceFull !== false && this.full) ) + if ( this.forceShort ) + body = this.short; + else if ( this.forceMid ) + body = this.mid; + else if ( this.forceFull || (this.forceFull !== false && this.full) ) body = this.full; - else if ( this.forceMid === true || (this.forceMid !== false && this.mid) ) + else if ( this.forceMid || (this.forceMid !== false && this.mid) ) body = this.mid; else body = this.short; diff --git a/src/modules/chat/index.js b/src/modules/chat/index.js index 5032239d..987e8010 100644 --- a/src/modules/chat/index.js +++ b/src/modules/chat/index.js @@ -2316,6 +2316,8 @@ export default class Chat extends Module { if ( ! tokenizer ) return null; + delete this.tokenizers[type]; + if ( tokenizer.tooltip ) delete this.tooltips.types[type]; @@ -2354,6 +2356,8 @@ export default class Chat extends Module { if ( ! provider ) return null; + delete this.link_providers[type]; + const idx = this.__link_providers.indexOf(provider); if ( idx !== -1 ) this.__link_providers.splice(idx, 1); @@ -2389,6 +2393,8 @@ export default class Chat extends Module { if ( ! provider ) return null; + delete this.rich_providers[type]; + const idx = this.__rich_providers.indexOf(provider); if ( idx !== -1 ) this.__rich_providers.splice(idx, 1); diff --git a/src/modules/main_menu/components/chat-rich-example.vue b/src/modules/main_menu/components/chat-rich-example.vue index 10e7f32f..b02d2789 100644 --- a/src/modules/main_menu/components/chat-rich-example.vue +++ b/src/modules/main_menu/components/chat-rich-example.vue @@ -6,16 +6,19 @@