From 5c0f25876ab9bd7e7bbbce28133de1f7795d1fdf Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Wed, 1 Apr 2026 13:50:25 +0200 Subject: [PATCH 01/25] feat: add location support to IMage Widget --- lua/wikis/commons/Widget/Image/Icon/Image.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/wikis/commons/Widget/Image/Icon/Image.lua b/lua/wikis/commons/Widget/Image/Icon/Image.lua index 306dbe87201..36e4e531612 100644 --- a/lua/wikis/commons/Widget/Image/Icon/Image.lua +++ b/lua/wikis/commons/Widget/Image/Icon/Image.lua @@ -20,6 +20,7 @@ local WidgetIcon = Lua.import('Module:Widget/Image/Icon') ---@field caption string? ---@field alt string? ---@field alignment string? +---@field location string? ---@class IconImageWidget: IconWidget ---@operator call(IconImageWidgetParameters): IconImageWidget @@ -41,6 +42,7 @@ function Icon:render() caption = self.props.caption, alt = self.props.alt, alignment = self.props.alignment, + location = self.props.location, } ) end From 7c5005607ee90c3fdad3f3ad0f1748765cda5545 Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Wed, 1 Apr 2026 15:11:59 +0200 Subject: [PATCH 02/25] as per review --- lua/wikis/commons/Widget/Image/Icon/Image.lua | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/lua/wikis/commons/Widget/Image/Icon/Image.lua b/lua/wikis/commons/Widget/Image/Icon/Image.lua index 36e4e531612..659f3bf6e3b 100644 --- a/lua/wikis/commons/Widget/Image/Icon/Image.lua +++ b/lua/wikis/commons/Widget/Image/Icon/Image.lua @@ -9,18 +9,13 @@ local Lua = require('Module:Lua') local Class = Lua.import('Module:Class') local Image = Lua.import('Module:Image') +local Table = Lua.import('Module:Table') local WidgetIcon = Lua.import('Module:Widget/Image/Icon') ----@class IconImageWidgetParameters +---@class IconImageWidgetParameters: ImageOptions ---@field imageLight string? ---@field imageDark string? ----@field link string? ----@field size string? ----@field caption string? ----@field alt string? ----@field alignment string? ----@field location string? ---@class IconImageWidget: IconWidget ---@operator call(IconImageWidgetParameters): IconImageWidget @@ -34,16 +29,9 @@ Icon.defaultProps = { ---@return string? function Icon:render() return Image.display( - self.props.imageLight, - self.props.imageDark, - { - link = self.props.link, - size = self.props.size, - caption = self.props.caption, - alt = self.props.alt, - alignment = self.props.alignment, - location = self.props.location, - } + Table.extract(self.props, 'imageLight'), + Table.extract(self.props, 'imageDark'), + self.props ) end From 41488680f333fac2f2bea06524a21e6ddf40b75e Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 3 Apr 2026 02:11:34 +0200 Subject: [PATCH 03/25] Update Image.lua --- lua/wikis/commons/Widget/Image/Icon/Image.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lua/wikis/commons/Widget/Image/Icon/Image.lua b/lua/wikis/commons/Widget/Image/Icon/Image.lua index 659f3bf6e3b..e363fd48a89 100644 --- a/lua/wikis/commons/Widget/Image/Icon/Image.lua +++ b/lua/wikis/commons/Widget/Image/Icon/Image.lua @@ -13,9 +13,16 @@ local Table = Lua.import('Module:Table') local WidgetIcon = Lua.import('Module:Widget/Image/Icon') ----@class IconImageWidgetParameters: ImageOptions +---@class IconImageWidgetParameters: IconImageWidgetParameters ---@field imageLight string? ---@field imageDark string? +---@field link string +---@field alt string? +---@field class string? +---@field format 'border'|'frameless'|'border|frameless'|'frame'|'thumb'? +---@field size string? # '{width}px'|'x{height}px'|'{width}x{height}px' +---@field horizontalAlignment 'left'|'right'|'center'|'none'? +---@field verticalAlignment 'baseline'|'sub'|'super'|'top'|text-top'|'middle'|'bottom'|'text-bottom' ---@class IconImageWidget: IconWidget ---@operator call(IconImageWidgetParameters): IconImageWidget From 9d76b3241e00d1897908af0bc57d377ba40bad7e Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 3 Apr 2026 02:13:05 +0200 Subject: [PATCH 04/25] Update Image.lua --- lua/wikis/commons/Widget/Image/Icon/Image.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/wikis/commons/Widget/Image/Icon/Image.lua b/lua/wikis/commons/Widget/Image/Icon/Image.lua index e363fd48a89..35710ca2d6b 100644 --- a/lua/wikis/commons/Widget/Image/Icon/Image.lua +++ b/lua/wikis/commons/Widget/Image/Icon/Image.lua @@ -30,7 +30,8 @@ local WidgetIcon = Lua.import('Module:Widget/Image/Icon') local Icon = Class.new(WidgetIcon) Icon.defaultProps = { link = '', - size = 'x20px' + size = 'x20px', + verticalAlignment = 'middle', -- make the implicit mw default explicit } ---@return string? From aaa13b3df17c0cc0921d9564108e65ce7791ffff Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 3 Apr 2026 02:20:33 +0200 Subject: [PATCH 05/25] Update Image.lua --- lua/wikis/commons/Widget/Image/Icon/Image.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lua/wikis/commons/Widget/Image/Icon/Image.lua b/lua/wikis/commons/Widget/Image/Icon/Image.lua index 35710ca2d6b..b1df01a0806 100644 --- a/lua/wikis/commons/Widget/Image/Icon/Image.lua +++ b/lua/wikis/commons/Widget/Image/Icon/Image.lua @@ -36,11 +36,14 @@ Icon.defaultProps = { ---@return string? function Icon:render() - return Image.display( - Table.extract(self.props, 'imageLight'), - Table.extract(self.props, 'imageDark'), - self.props - ) + local imageLight = self.props.imageLight + local imageDark = self.props.imageDark + if Logic.isEmpty(imageLight) or Logic.isEmpty(imageDark) or imageLight == imageDark then + return self:_make(Logic.nilIfEmpty(imageLight) or imageDark) + end + + return Image._make(imageLight, 'show-when-light-mode') + .. Image._make(imageDark, 'show-when-dark-mode') end return Icon From 4aebd7d2c9f1a099f207bb458a5d713a187b677d Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 3 Apr 2026 02:21:38 +0200 Subject: [PATCH 06/25] Update Image.lua --- lua/wikis/commons/Widget/Image/Icon/Image.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/wikis/commons/Widget/Image/Icon/Image.lua b/lua/wikis/commons/Widget/Image/Icon/Image.lua index b1df01a0806..d0567e42ec5 100644 --- a/lua/wikis/commons/Widget/Image/Icon/Image.lua +++ b/lua/wikis/commons/Widget/Image/Icon/Image.lua @@ -7,9 +7,9 @@ local Lua = require('Module:Lua') +local Array = Lua.import('Module:Array') local Class = Lua.import('Module:Class') -local Image = Lua.import('Module:Image') -local Table = Lua.import('Module:Table') +local Logic = Lua.import('Module:Logic') local WidgetIcon = Lua.import('Module:Widget/Image/Icon') From a8b198c11f6492f987c6250f35c10dec4f71290d Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 3 Apr 2026 02:39:07 +0200 Subject: [PATCH 07/25] Update Image.lua --- lua/wikis/commons/Widget/Image/Icon/Image.lua | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/lua/wikis/commons/Widget/Image/Icon/Image.lua b/lua/wikis/commons/Widget/Image/Icon/Image.lua index d0567e42ec5..8b29fc1ceba 100644 --- a/lua/wikis/commons/Widget/Image/Icon/Image.lua +++ b/lua/wikis/commons/Widget/Image/Icon/Image.lua @@ -46,4 +46,32 @@ function Icon:render() .. Image._make(imageDark, 'show-when-dark-mode') end +---@param image string? +---@param themeClass string? +---@return string +---@overload fun(nil): nil +function Icon:_make(image, themeClass) + local class = table.concat(Array.append({Logic.nilIfEmpty(self.props.class)}, themeClass), ' ') + + local border = Logic.nilIfEmpty(self.props.border) + assert((self.props.format == 'frameless' or not self.props.format) or not border, 'border can only used for frameless images') + + local size + + local parts = Array.append({}, + 'File:' .. image, + Logic.nilIfEmpty(self.props.border), + Logic.nilIfEmpty(self.props.format), + size, + Logic.nilIfEmpty(self.props.horizontalAlignment), + self.props.verticalAlignment, + '|link=' .. self.props.link, + Logic.isNotEmpty(options.alt) and ('alt=' .. self.props.alt) or nil, + Logic.isNotEmpty(class) and ('class=' .. class) or nil, + Logic.nilIfEmpty(self.props.caption), + ) + + return '[[' .. table.concat(parts, '|') .. ']]' +end + return Icon From 357a5d289c48b4cc15c7400bb248997c1ca76bac Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 3 Apr 2026 02:39:50 +0200 Subject: [PATCH 08/25] Update Image.lua --- lua/wikis/commons/Widget/Image/Icon/Image.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/wikis/commons/Widget/Image/Icon/Image.lua b/lua/wikis/commons/Widget/Image/Icon/Image.lua index 8b29fc1ceba..1abe3a9b4d6 100644 --- a/lua/wikis/commons/Widget/Image/Icon/Image.lua +++ b/lua/wikis/commons/Widget/Image/Icon/Image.lua @@ -42,8 +42,8 @@ function Icon:render() return self:_make(Logic.nilIfEmpty(imageLight) or imageDark) end - return Image._make(imageLight, 'show-when-light-mode') - .. Image._make(imageDark, 'show-when-dark-mode') + return self:_make(imageLight, 'show-when-light-mode') + .. self:_make(imageDark, 'show-when-dark-mode') end ---@param image string? From 6208a4a098a2db953a3349d6874242ebd413a278 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 3 Apr 2026 02:40:46 +0200 Subject: [PATCH 09/25] Update Image.lua --- lua/wikis/commons/Widget/Image/Icon/Image.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/wikis/commons/Widget/Image/Icon/Image.lua b/lua/wikis/commons/Widget/Image/Icon/Image.lua index 1abe3a9b4d6..fdf8230abd1 100644 --- a/lua/wikis/commons/Widget/Image/Icon/Image.lua +++ b/lua/wikis/commons/Widget/Image/Icon/Image.lua @@ -13,16 +13,18 @@ local Logic = Lua.import('Module:Logic') local WidgetIcon = Lua.import('Module:Widget/Image/Icon') ----@class IconImageWidgetParameters: IconImageWidgetParameters +---@class IconImageWidgetParameters: ---@field imageLight string? ---@field imageDark string? ---@field link string ---@field alt string? ---@field class string? ----@field format 'border'|'frameless'|'border|frameless'|'frame'|'thumb'? +---@field border string? # only available if `format: 'frameless'?` +---@field format 'border'|'frameless'|'frame'|'thumb'? ---@field size string? # '{width}px'|'x{height}px'|'{width}x{height}px' ---@field horizontalAlignment 'left'|'right'|'center'|'none'? ---@field verticalAlignment 'baseline'|'sub'|'super'|'top'|text-top'|'middle'|'bottom'|'text-bottom' +---@field caption string? ---@class IconImageWidget: IconWidget ---@operator call(IconImageWidgetParameters): IconImageWidget From 3c1dc815f9946c143c493f7f34351b3ea351834b Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 3 Apr 2026 02:46:52 +0200 Subject: [PATCH 10/25] Update Image.lua --- lua/wikis/commons/Widget/Image/Icon/Image.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lua/wikis/commons/Widget/Image/Icon/Image.lua b/lua/wikis/commons/Widget/Image/Icon/Image.lua index fdf8230abd1..32e876d7bd7 100644 --- a/lua/wikis/commons/Widget/Image/Icon/Image.lua +++ b/lua/wikis/commons/Widget/Image/Icon/Image.lua @@ -58,13 +58,11 @@ function Icon:_make(image, themeClass) local border = Logic.nilIfEmpty(self.props.border) assert((self.props.format == 'frameless' or not self.props.format) or not border, 'border can only used for frameless images') - local size - local parts = Array.append({}, 'File:' .. image, Logic.nilIfEmpty(self.props.border), Logic.nilIfEmpty(self.props.format), - size, + Logic.isNumeric(self.props.size) and (self.props.size .. 'px') or Logic.nilIfEmpty(self.props.size), Logic.nilIfEmpty(self.props.horizontalAlignment), self.props.verticalAlignment, '|link=' .. self.props.link, From c9dda34b57b8d615c39aa2ce5714ddf0c6474116 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 3 Apr 2026 02:51:25 +0200 Subject: [PATCH 11/25] Update Image.lua --- lua/wikis/commons/Widget/Image/Icon/Image.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/Widget/Image/Icon/Image.lua b/lua/wikis/commons/Widget/Image/Icon/Image.lua index 32e876d7bd7..7173f808c33 100644 --- a/lua/wikis/commons/Widget/Image/Icon/Image.lua +++ b/lua/wikis/commons/Widget/Image/Icon/Image.lua @@ -68,7 +68,7 @@ function Icon:_make(image, themeClass) '|link=' .. self.props.link, Logic.isNotEmpty(options.alt) and ('alt=' .. self.props.alt) or nil, Logic.isNotEmpty(class) and ('class=' .. class) or nil, - Logic.nilIfEmpty(self.props.caption), + Logic.nilIfEmpty(self.props.caption) ) return '[[' .. table.concat(parts, '|') .. ']]' From a75e9c6914d109a99b8411cccf7c027326aaebce Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 3 Apr 2026 02:54:04 +0200 Subject: [PATCH 12/25] Update Image.lua --- lua/wikis/commons/Widget/Image/Icon/Image.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/Widget/Image/Icon/Image.lua b/lua/wikis/commons/Widget/Image/Icon/Image.lua index 7173f808c33..23a96fb11f8 100644 --- a/lua/wikis/commons/Widget/Image/Icon/Image.lua +++ b/lua/wikis/commons/Widget/Image/Icon/Image.lua @@ -66,7 +66,7 @@ function Icon:_make(image, themeClass) Logic.nilIfEmpty(self.props.horizontalAlignment), self.props.verticalAlignment, '|link=' .. self.props.link, - Logic.isNotEmpty(options.alt) and ('alt=' .. self.props.alt) or nil, + Logic.isNotEmpty(self.props.alt) and ('alt=' .. self.props.alt) or nil, Logic.isNotEmpty(class) and ('class=' .. class) or nil, Logic.nilIfEmpty(self.props.caption) ) From c70424607a7729521e72ab34fe96798395846709 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 3 Apr 2026 02:56:11 +0200 Subject: [PATCH 13/25] Update Image.lua --- lua/wikis/commons/Widget/Image/Icon/Image.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/Widget/Image/Icon/Image.lua b/lua/wikis/commons/Widget/Image/Icon/Image.lua index 23a96fb11f8..546f5b54069 100644 --- a/lua/wikis/commons/Widget/Image/Icon/Image.lua +++ b/lua/wikis/commons/Widget/Image/Icon/Image.lua @@ -64,7 +64,7 @@ function Icon:_make(image, themeClass) Logic.nilIfEmpty(self.props.format), Logic.isNumeric(self.props.size) and (self.props.size .. 'px') or Logic.nilIfEmpty(self.props.size), Logic.nilIfEmpty(self.props.horizontalAlignment), - self.props.verticalAlignment, + self.props.verticalAlignment ~= 'middle' and self.props.verticalAlignment or nil, '|link=' .. self.props.link, Logic.isNotEmpty(self.props.alt) and ('alt=' .. self.props.alt) or nil, Logic.isNotEmpty(class) and ('class=' .. class) or nil, From 033cca3fad64b2881775c45bb69daa1b4de23999 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 3 Apr 2026 02:58:37 +0200 Subject: [PATCH 14/25] Update Image.lua --- lua/wikis/commons/Widget/Image/Icon/Image.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/wikis/commons/Widget/Image/Icon/Image.lua b/lua/wikis/commons/Widget/Image/Icon/Image.lua index 546f5b54069..17da7023707 100644 --- a/lua/wikis/commons/Widget/Image/Icon/Image.lua +++ b/lua/wikis/commons/Widget/Image/Icon/Image.lua @@ -56,7 +56,8 @@ function Icon:_make(image, themeClass) local class = table.concat(Array.append({Logic.nilIfEmpty(self.props.class)}, themeClass), ' ') local border = Logic.nilIfEmpty(self.props.border) - assert((self.props.format == 'frameless' or not self.props.format) or not border, 'border can only used for frameless images') + assert((self.props.format == 'frameless' or not self.props.format) or not border, + 'border can only used for frameless images') local parts = Array.append({}, 'File:' .. image, From 253705e49953c21c3e139462eeb28ab3bcff3849 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 3 Apr 2026 03:01:46 +0200 Subject: [PATCH 15/25] Update Image.lua --- lua/wikis/commons/Widget/Image/Icon/Image.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/Widget/Image/Icon/Image.lua b/lua/wikis/commons/Widget/Image/Icon/Image.lua index 17da7023707..8e6b22ee140 100644 --- a/lua/wikis/commons/Widget/Image/Icon/Image.lua +++ b/lua/wikis/commons/Widget/Image/Icon/Image.lua @@ -66,7 +66,7 @@ function Icon:_make(image, themeClass) Logic.isNumeric(self.props.size) and (self.props.size .. 'px') or Logic.nilIfEmpty(self.props.size), Logic.nilIfEmpty(self.props.horizontalAlignment), self.props.verticalAlignment ~= 'middle' and self.props.verticalAlignment or nil, - '|link=' .. self.props.link, + 'link=' .. self.props.link, Logic.isNotEmpty(self.props.alt) and ('alt=' .. self.props.alt) or nil, Logic.isNotEmpty(class) and ('class=' .. class) or nil, Logic.nilIfEmpty(self.props.caption) From 7086f05bdab61869e6d1aafee2eec52bca284b26 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 3 Apr 2026 03:05:06 +0200 Subject: [PATCH 16/25] Update Image.lua --- lua/wikis/commons/Widget/Image/Icon/Image.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/Widget/Image/Icon/Image.lua b/lua/wikis/commons/Widget/Image/Icon/Image.lua index 8e6b22ee140..50fc752562a 100644 --- a/lua/wikis/commons/Widget/Image/Icon/Image.lua +++ b/lua/wikis/commons/Widget/Image/Icon/Image.lua @@ -23,7 +23,7 @@ local WidgetIcon = Lua.import('Module:Widget/Image/Icon') ---@field format 'border'|'frameless'|'frame'|'thumb'? ---@field size string? # '{width}px'|'x{height}px'|'{width}x{height}px' ---@field horizontalAlignment 'left'|'right'|'center'|'none'? ----@field verticalAlignment 'baseline'|'sub'|'super'|'top'|text-top'|'middle'|'bottom'|'text-bottom' +---@field verticalAlignment 'baseline'|'sub'|'super'|'top'|'text-top'|'middle'|'bottom'|'text-bottom' ---@field caption string? ---@class IconImageWidget: IconWidget From 79b4ead7139fff1c03ea3883e5db055e39f1d0fa Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 3 Apr 2026 03:07:53 +0200 Subject: [PATCH 17/25] Update Image.lua --- lua/wikis/commons/Widget/Image/Icon/Image.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/wikis/commons/Widget/Image/Icon/Image.lua b/lua/wikis/commons/Widget/Image/Icon/Image.lua index 50fc752562a..bc45d6cfbdd 100644 --- a/lua/wikis/commons/Widget/Image/Icon/Image.lua +++ b/lua/wikis/commons/Widget/Image/Icon/Image.lua @@ -41,7 +41,7 @@ function Icon:render() local imageLight = self.props.imageLight local imageDark = self.props.imageDark if Logic.isEmpty(imageLight) or Logic.isEmpty(imageDark) or imageLight == imageDark then - return self:_make(Logic.nilIfEmpty(imageLight) or imageDark) + return self:_make(Logic.nilIfEmpty(imageLight) or Logic.nilIfEmpty(imageDark)) end return self:_make(imageLight, 'show-when-light-mode') @@ -53,6 +53,9 @@ end ---@return string ---@overload fun(nil): nil function Icon:_make(image, themeClass) + if not image then + return + end local class = table.concat(Array.append({Logic.nilIfEmpty(self.props.class)}, themeClass), ' ') local border = Logic.nilIfEmpty(self.props.border) From 29c49853fadbfd55d251bdcc84cf798e4e206299 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 3 Apr 2026 03:09:39 +0200 Subject: [PATCH 18/25] Update Image.lua --- lua/wikis/commons/Widget/Image/Icon/Image.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/Widget/Image/Icon/Image.lua b/lua/wikis/commons/Widget/Image/Icon/Image.lua index bc45d6cfbdd..25ef89f6797 100644 --- a/lua/wikis/commons/Widget/Image/Icon/Image.lua +++ b/lua/wikis/commons/Widget/Image/Icon/Image.lua @@ -19,7 +19,7 @@ local WidgetIcon = Lua.import('Module:Widget/Image/Icon') ---@field link string ---@field alt string? ---@field class string? ----@field border string? # only available if `format: 'frameless'?` +---@field border 'border'? # only available if `format: 'frameless'?` ---@field format 'border'|'frameless'|'frame'|'thumb'? ---@field size string? # '{width}px'|'x{height}px'|'{width}x{height}px' ---@field horizontalAlignment 'left'|'right'|'center'|'none'? From 5fc9b2d170ec242163bb65f6e6fcafd38cbf410c Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 3 Apr 2026 03:10:38 +0200 Subject: [PATCH 19/25] Update Image.lua --- lua/wikis/commons/Widget/Image/Icon/Image.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/Widget/Image/Icon/Image.lua b/lua/wikis/commons/Widget/Image/Icon/Image.lua index 25ef89f6797..5f78dfb0d46 100644 --- a/lua/wikis/commons/Widget/Image/Icon/Image.lua +++ b/lua/wikis/commons/Widget/Image/Icon/Image.lua @@ -20,7 +20,7 @@ local WidgetIcon = Lua.import('Module:Widget/Image/Icon') ---@field alt string? ---@field class string? ---@field border 'border'? # only available if `format: 'frameless'?` ----@field format 'border'|'frameless'|'frame'|'thumb'? +---@field format 'frameless'|'frame'|'thumb'? ---@field size string? # '{width}px'|'x{height}px'|'{width}x{height}px' ---@field horizontalAlignment 'left'|'right'|'center'|'none'? ---@field verticalAlignment 'baseline'|'sub'|'super'|'top'|'text-top'|'middle'|'bottom'|'text-bottom' From 41fc7bc1a936b7bf7a23fdbc8990e1a51fa70d16 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 3 Apr 2026 03:15:09 +0200 Subject: [PATCH 20/25] Update Image.lua --- lua/wikis/commons/Widget/Image/Icon/Image.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/wikis/commons/Widget/Image/Icon/Image.lua b/lua/wikis/commons/Widget/Image/Icon/Image.lua index 5f78dfb0d46..058c424462e 100644 --- a/lua/wikis/commons/Widget/Image/Icon/Image.lua +++ b/lua/wikis/commons/Widget/Image/Icon/Image.lua @@ -25,6 +25,7 @@ local WidgetIcon = Lua.import('Module:Widget/Image/Icon') ---@field horizontalAlignment 'left'|'right'|'center'|'none'? ---@field verticalAlignment 'baseline'|'sub'|'super'|'top'|'text-top'|'middle'|'bottom'|'text-bottom' ---@field caption string? +---@field alignment string? # legacy for during conversion ---@class IconImageWidget: IconWidget ---@operator call(IconImageWidgetParameters): IconImageWidget From 1ca5fdfe5321d9c3c05bc1ce51f72f9d3f5c583d Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 3 Apr 2026 03:18:04 +0200 Subject: [PATCH 21/25] Update Image.lua --- lua/wikis/commons/Widget/Image/Icon/Image.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/wikis/commons/Widget/Image/Icon/Image.lua b/lua/wikis/commons/Widget/Image/Icon/Image.lua index 058c424462e..7832fa70e82 100644 --- a/lua/wikis/commons/Widget/Image/Icon/Image.lua +++ b/lua/wikis/commons/Widget/Image/Icon/Image.lua @@ -39,6 +39,9 @@ Icon.defaultProps = { ---@return string? function Icon:render() + -- legacy, only for conversion outside of git ... + self.props.horizontalAlignment = self.props.horizontalAlignment or self.props.alignment + local imageLight = self.props.imageLight local imageDark = self.props.imageDark if Logic.isEmpty(imageLight) or Logic.isEmpty(imageDark) or imageLight == imageDark then From be6a986b5c8fe4fc8ad260b6f260ddf949453463 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 3 Apr 2026 03:20:55 +0200 Subject: [PATCH 22/25] Update Image.lua --- lua/wikis/commons/Widget/Image/Icon/Image.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/Widget/Image/Icon/Image.lua b/lua/wikis/commons/Widget/Image/Icon/Image.lua index 7832fa70e82..be43d6cce9f 100644 --- a/lua/wikis/commons/Widget/Image/Icon/Image.lua +++ b/lua/wikis/commons/Widget/Image/Icon/Image.lua @@ -23,7 +23,7 @@ local WidgetIcon = Lua.import('Module:Widget/Image/Icon') ---@field format 'frameless'|'frame'|'thumb'? ---@field size string? # '{width}px'|'x{height}px'|'{width}x{height}px' ---@field horizontalAlignment 'left'|'right'|'center'|'none'? ----@field verticalAlignment 'baseline'|'sub'|'super'|'top'|'text-top'|'middle'|'bottom'|'text-bottom' +---@field verticalAlignment 'baseline'|'sub'|'super'|'top'|'text-top'|'middle'|'bottom'|'text-bottom'? ---@field caption string? ---@field alignment string? # legacy for during conversion From 1f961ba48b52be8ca12bfccd375bced11ad19e9a Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 3 Apr 2026 03:22:10 +0200 Subject: [PATCH 23/25] Update Image.lua --- lua/wikis/commons/Widget/Image/Icon/Image.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/Widget/Image/Icon/Image.lua b/lua/wikis/commons/Widget/Image/Icon/Image.lua index be43d6cce9f..7fa7357ac4e 100644 --- a/lua/wikis/commons/Widget/Image/Icon/Image.lua +++ b/lua/wikis/commons/Widget/Image/Icon/Image.lua @@ -64,7 +64,7 @@ function Icon:_make(image, themeClass) local border = Logic.nilIfEmpty(self.props.border) assert((self.props.format == 'frameless' or not self.props.format) or not border, - 'border can only used for frameless images') + 'border can only be used for frameless images') local parts = Array.append({}, 'File:' .. image, From 2854dc48c067d92ca0e1fdd2bc59c710ff0564fc Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Fri, 3 Apr 2026 18:00:26 +0200 Subject: [PATCH 24/25] consumers --- lua/wikis/arenafps/Infobox/Map/Custom.lua | 2 +- lua/wikis/commons/Widget/Image/Icon/TeamIcon.lua | 2 +- lua/wikis/hearthstone/Infobox/Unit/Custom.lua | 2 +- lua/wikis/heroes/Infobox/Map/Custom.lua | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/wikis/arenafps/Infobox/Map/Custom.lua b/lua/wikis/arenafps/Infobox/Map/Custom.lua index b828380d26e..325f5431e75 100644 --- a/lua/wikis/arenafps/Infobox/Map/Custom.lua +++ b/lua/wikis/arenafps/Infobox/Map/Custom.lua @@ -54,7 +54,7 @@ function CustomInjector:parse(widgetId, widgets) children = {WidgetImage{ imageLight = args.minimap, size = '350px', - alignment = 'center', + horizontalAlignment = 'center', }} } or nil ) diff --git a/lua/wikis/commons/Widget/Image/Icon/TeamIcon.lua b/lua/wikis/commons/Widget/Image/Icon/TeamIcon.lua index a27869c3def..8b38286f1a5 100644 --- a/lua/wikis/commons/Widget/Image/Icon/TeamIcon.lua +++ b/lua/wikis/commons/Widget/Image/Icon/TeamIcon.lua @@ -55,7 +55,7 @@ function TeamIcon:_getIcon(image, size, link) return WidgetIconImage{ imageLight = image, size = size, - alignment = 'middle', + verticalAlignment = 'middle', caption = self.props.name, link = link, } diff --git a/lua/wikis/hearthstone/Infobox/Unit/Custom.lua b/lua/wikis/hearthstone/Infobox/Unit/Custom.lua index b9a4fa328d7..b66733e78e9 100644 --- a/lua/wikis/hearthstone/Infobox/Unit/Custom.lua +++ b/lua/wikis/hearthstone/Infobox/Unit/Custom.lua @@ -76,7 +76,7 @@ function CustomInjector:parse(id, widgets) -- returning Fragment is needed to have placeholders where necessary if not value then return HtmlWidgets.Fragment{} end return HtmlWidgets.Fragment{children = { - Image{size = 'x32px', alignment = 'text-top', link = link, imageLight = image}, + Image{size = 'x32px', verticalAlignment = 'text-top', link = link, imageLight = image}, HtmlWidgets.Br{}, value, }} diff --git a/lua/wikis/heroes/Infobox/Map/Custom.lua b/lua/wikis/heroes/Infobox/Map/Custom.lua index 56af1596c26..8bee62ccb4f 100644 --- a/lua/wikis/heroes/Infobox/Map/Custom.lua +++ b/lua/wikis/heroes/Infobox/Map/Custom.lua @@ -86,7 +86,7 @@ function CustomMap:_image2() children = {Image{ imageLight = self.args.image2, size = '294px', - alignment = 'center', + horizontalAlignment = 'center', }} } end From 3352722f0d09c0cc3fb963ee18652340c4783a16 Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Fri, 3 Apr 2026 18:00:38 +0200 Subject: [PATCH 25/25] fix anno --- lua/wikis/commons/Widget/Image/Icon/Image.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/Widget/Image/Icon/Image.lua b/lua/wikis/commons/Widget/Image/Icon/Image.lua index 7fa7357ac4e..45d16915778 100644 --- a/lua/wikis/commons/Widget/Image/Icon/Image.lua +++ b/lua/wikis/commons/Widget/Image/Icon/Image.lua @@ -13,7 +13,7 @@ local Logic = Lua.import('Module:Logic') local WidgetIcon = Lua.import('Module:Widget/Image/Icon') ----@class IconImageWidgetParameters: +---@class IconImageWidgetParameters ---@field imageLight string? ---@field imageDark string? ---@field link string