diff --git a/fontello.config.json b/fontello.config.json index 28cc0f55..4e800df2 100644 --- a/fontello.config.json +++ b/fontello.config.json @@ -785,6 +785,26 @@ "css": "list-bullet", "code": 61642, "src": "fontawesome" + }, + { + "uid": "7655b7161cf9660beeb1af4036db1198", + "css": "mastodon", + "code": 59463, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M932.9 220.7C918.5 114.6 825 31 714.2 14.8 695.5 12 624.7 2.1 460.6 2.1H459.4C295.3 2.1 260.1 12 241.4 14.8 133.7 30.5 35.3 105.6 11.4 213 0 265.9-1.3 324.5 0.9 378.2 3.9 455.3 4.5 532.3 11.6 609.1 16.5 660.1 25 710.7 37.1 760.5 59.8 852.5 151.6 929 241.6 960.3 337.9 992.8 441.5 998.2 540.8 975.9 551.7 973.4 562.5 970.4 573.2 967.1 597.3 959.5 625.6 951.1 646.3 936.2 646.6 935.9 646.9 935.7 647 935.4 647.2 935.1 647.3 934.7 647.3 934.4V860C647.3 859.6 647.2 859.3 647.1 859 646.9 858.7 646.7 858.5 646.4 858.3 646.2 858.1 645.9 857.9 645.6 857.8 645.2 857.8 644.9 857.8 644.6 857.8 581 872.9 515.8 880.4 450.4 880.3 337.9 880.3 307.6 827.5 299 805.5 292 786.5 287.6 766.7 285.8 746.5 285.8 746.2 285.9 745.8 286 745.5 286.1 745.2 286.3 744.9 286.6 744.7 286.9 744.5 287.2 744.4 287.5 744.3 287.9 744.2 288.2 744.2 288.5 744.3 351.1 759.2 415.2 766.8 479.5 766.8 495 766.8 510.4 766.8 525.9 766.3 590.6 764.6 658.8 761.3 722.4 749 724 748.7 725.6 748.4 727 748 827.4 728.9 922.9 669.1 932.7 517.5 933 511.5 933.9 455 933.9 448.8 934 427.7 940.8 299.5 932.9 220.7ZM778.4 598.9H672.8V343.1C672.8 289.3 650.1 261.8 604 261.8 553.2 261.8 527.8 294.3 527.8 358.5V498.5H422.9V358.5C422.9 294.3 397.4 261.8 346.7 261.8 300.8 261.8 277.9 289.3 277.9 343.1V598.9H172.4V335.4C172.4 281.5 186.3 238.7 214.1 207 242.7 175.4 280.4 159.1 327.1 159.1 381.1 159.1 421.9 179.7 449.2 220.8L475.4 264.4 501.7 220.8C529 179.7 569.8 159.1 623.8 159.1 670.4 159.1 708 175.4 736.8 207 764.6 238.7 778.5 281.5 778.5 335.4L778.4 598.9Z", + "width": 937 + }, + "search": [ + "logo-black" + ] + }, + { + "uid": "012ff5762ccb18c16bdfdd6baf187406", + "css": "volume-up", + "code": 59464, + "src": "elusive" } ] } \ No newline at end of file diff --git a/package.json b/package.json index 7be8243c..8bc3e3e1 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "frankerfacez", "author": "Dan Salvato LLC", - "version": "4.37.1", + "version": "4.38.0", "description": "FrankerFaceZ is a Twitch enhancement suite.", "private": true, "license": "Apache-2.0", diff --git a/res/font/ffz-fontello.eot b/res/font/ffz-fontello.eot index b84fe1d0..f14c114d 100644 Binary files a/res/font/ffz-fontello.eot and b/res/font/ffz-fontello.eot differ diff --git a/res/font/ffz-fontello.svg b/res/font/ffz-fontello.svg index 029fe910..0e2424a3 100644 --- a/res/font/ffz-fontello.svg +++ b/res/font/ffz-fontello.svg @@ -1,7 +1,7 @@ -Copyright (C) 2021 by original authors @ fontello.com +Copyright (C) 2022 by original authors @ fontello.com @@ -148,6 +148,10 @@ + + + + diff --git a/res/font/ffz-fontello.ttf b/res/font/ffz-fontello.ttf index b65ee43f..ef0757ae 100644 Binary files a/res/font/ffz-fontello.ttf and b/res/font/ffz-fontello.ttf differ diff --git a/res/font/ffz-fontello.woff b/res/font/ffz-fontello.woff index d3da1da1..e77f24ad 100644 Binary files a/res/font/ffz-fontello.woff and b/res/font/ffz-fontello.woff differ diff --git a/res/font/ffz-fontello.woff2 b/res/font/ffz-fontello.woff2 index 91a234aa..b64c1021 100644 Binary files a/res/font/ffz-fontello.woff2 and b/res/font/ffz-fontello.woff2 differ diff --git a/src/modules/chat/actions/index.jsx b/src/modules/chat/actions/index.jsx index 4ed509df..9497e487 100644 --- a/src/modules/chat/actions/index.jsx +++ b/src/modules/chat/actions/index.jsx @@ -67,6 +67,42 @@ export default class Actions extends Module { } }); + this.settings.add('chat.actions.hover', { + process: (ctx, val) => + val.filter(x => x.appearance && + this.renderers[x.appearance.type] && + (! this.renderers[x.appearance.type].load || this.renderers[x.appearance.type].load(x.appearance)) && + (! x.action || this.actions[x.action]) + ), + + default: [ + {v: {action: 'pin', appearance: {type: 'icon', icon: 'ffz-i-pin'}, options: {}, display: {mod_icons: true}}}, + {v: {action: 'reply', appearance: {type: 'dynamic'}, options: {}, display: {}}} + ], + + type: 'array_merge', + inherit_default: true, + + ui: { + path: 'Chat > Actions > Message Hover @{"description": "Here, you can define custom actions that will appear on top of messages in chat when you hover over them. If you aren\'t seeing an action you\'ve defined here in chat, please make sure that you have enabled Mod Icons in the chat settings menu."}', + component: 'chat-actions', + context: ['user', 'room', 'message'], + inline: true, + modifiers: true, + hover_modifier: false, + + data: () => { + const chat = this.resolve('site.chat'); + + return { + color: val => chat && chat.colors ? chat.colors.process(val) : val, + actions: deep_copy(this.actions), + renderers: deep_copy(this.renderers) + } + } + } + }); + this.settings.add('chat.actions.inline', { // Filter out actions process: (ctx, val) => @@ -80,8 +116,7 @@ export default class Actions extends Module { {v: {action: 'ban', appearance: {type: 'icon', icon: 'ffz-i-block'}, options: {}, display: {mod: true, mod_icons: true, deleted: false}}}, {v: {action: 'unban', appearance: {type: 'icon', icon: 'ffz-i-ok'}, options: {}, display: {mod: true, mod_icons: true, deleted: true}}}, {v: {action: 'timeout', appearance: {type: 'icon', icon: 'ffz-i-clock'}, display: {mod: true, mod_icons: true}}}, - {v: {action: 'msg_delete', appearance: {type: 'icon', icon: 'ffz-i-trash'}, options: {}, display: {mod: true, mod_icons: true}}}, - {v: {action: 'reply', appearance: {type: 'icon', icon: 'ffz-i-reply'}, options: {}, display: {}}} + {v: {action: 'msg_delete', appearance: {type: 'icon', icon: 'ffz-i-trash'}, options: {}, display: {mod: true, mod_icons: true}}} ], type: 'array_merge', @@ -501,6 +536,8 @@ export default class Actions extends Module { if ( ! data ) continue; + data.ctx = 'room'; + const type = data.type; if ( type ) { if ( type === 'new-line' ) { @@ -545,6 +582,12 @@ export default class Actions extends Module { if ( maybe_call(act.hidden, this, data, null, current_room, current_user, mod_icons) ) continue; + if ( ap.type === 'dynamic' ) { + const out = act.dynamicAppearance && act.dynamicAppearance.call(this, Object.assign({}, ap), data, null, current_room, current_user, mod_icons); + if ( out ) + ap = out; + } + if ( act.override_appearance ) { const out = act.override_appearance.call(this, Object.assign({}, ap), data, null, current_room, current_user, mod_icons); if ( out ) @@ -649,6 +692,8 @@ export default class Actions extends Module { if ( ! data ) continue; + data.ctx = 'user_context'; + if ( data.type === 'new-line' ) { line = null; continue; @@ -684,6 +729,12 @@ export default class Actions extends Module { if ( maybe_call(act.hidden, this, data, msg, r, u, mod_icons) ) continue; + if ( ap.type === 'dynamic' ) { + const out = act.dynamicAppearance && act.dynamicAppearance.call(this, Object.assign({}, ap), data, msg, r, u, mod_icons); + if ( out ) + ap = out; + } + if ( act.override_appearance ) { const out = act.override_appearance.call(this, Object.assign({}, ap), data, msg, r, u, mod_icons); if ( out ) @@ -704,7 +755,7 @@ export default class Actions extends Module { const btn = (
+ +
); + } + + if ( ! had_action ) + return null; + + return (
+ {actions} +
); + } + + renderInline(msg, mod_icons, current_user, current_room, createElement, instance = null) { const actions = []; @@ -762,6 +901,8 @@ export default class Actions extends Module { if ( ! data.action || ! data.appearance ) continue; + data.ctx = 'inline'; + let ap = data.appearance || {}; const disp = data.display || {}, keys = disp.keys, @@ -781,6 +922,12 @@ export default class Actions extends Module { if ( maybe_call(act.hidden, this, data, msg, current_room, current_user, mod_icons, instance) ) continue; + if ( ap.type === 'dynamic' ) { + const out = act.dynamicAppearance && act.dynamicAppearance.call(this, Object.assign({}, ap), data, msg, current_room, current_user, mod_icons, instance); + if ( out ) + ap = out; + } + if ( act.override_appearance ) { const out = act.override_appearance.call(this, Object.assign({}, ap), data, msg, current_room, current_user, mod_icons, instance); if ( out ) @@ -804,7 +951,7 @@ export default class Actions extends Module { had_action = true; list.push(