-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(widget): migrate remaining widgets to v2 & remove v1 backwar…
…ds compatability (#4863) * refactor(widget): migrate infobox widgets to v2 * fix deploy name * add flip * re-add missing div * linter * typo * remove self.children * hopefully fix customizable * as self.children is removed * simplify widget * ??? * fix headers * instead of hacking with the injector, let's use a context for it * fix typo * fix typo * fix typo * fix * fix error on links * fix instance * fix ppt * fully fix links * flip the correct one * fix display text * fix breakdown * fix center * respect annos
- Loading branch information
Showing
23 changed files
with
408 additions
and
471 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
components/widget/contexts/widget_contexts_customizable.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
-- @Liquipedia | ||
-- wiki=commons | ||
-- page=Module:Widget/Contexts/Customizable | ||
-- | ||
-- Please see https://github.com/Liquipedia/Lua-Modules to contribute | ||
-- | ||
|
||
local Class = require('Module:Class') | ||
local Lua = require('Module:Lua') | ||
local Context = Lua.import('Module:Widget/Context') | ||
|
||
-- Customizable backwards compatibility | ||
return { | ||
LegacyCustomizable = Class.new(Context), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
-- @Liquipedia | ||
-- wiki=commons | ||
-- page=Module:Widget/Html/Li | ||
-- | ||
-- Please see https://github.com/Liquipedia/Lua-Modules to contribute | ||
-- | ||
|
||
local Class = require('Module:Class') | ||
local Lua = require('Module:Lua') | ||
local Table = require('Module:Table') | ||
|
||
local WidgetHtml = Lua.import('Module:Widget/Html/Base') | ||
|
||
---@class WidgetLi: WidgetHtmlBase | ||
---@operator call(table): WidgetLi | ||
local Li = Class.new(WidgetHtml) | ||
|
||
---@return Html | ||
function Li:render() | ||
local attributes = Table.copy(self.props.attributes or {}) | ||
attributes.class = self.props.classes | ||
attributes.style = self.props.css | ||
return self:renderAs('li', self.props.children, attributes) | ||
end | ||
|
||
return Li |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
-- @Liquipedia | ||
-- wiki=commons | ||
-- page=Module:Widget/Html/Ul | ||
-- | ||
-- Please see https://github.com/Liquipedia/Lua-Modules to contribute | ||
-- | ||
|
||
local Class = require('Module:Class') | ||
local Lua = require('Module:Lua') | ||
local Table = require('Module:Table') | ||
|
||
local WidgetHtml = Lua.import('Module:Widget/Html/Base') | ||
|
||
---@class WidgetUl: WidgetHtmlBase | ||
---@operator call(table): WidgetUl | ||
local Ul = Class.new(WidgetHtml) | ||
|
||
---@return Html | ||
function Ul:render() | ||
local attributes = Table.copy(self.props.attributes or {}) | ||
attributes.class = self.props.classes | ||
attributes.style = self.props.css | ||
return self:renderAs('ul', self.props.children, attributes) | ||
end | ||
|
||
return Ul |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.