mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-26 06:44:58 +00:00
feat: add new icon components including Envelope, ChatCircle, HardDrives, WarningCircle, CheckCircle, XCircle, TrendUp, ShieldWarning, LockKey, Crown, Sparkle, BookOpen, Tree, Broom, Export, UploadSimple, Funnel, FunnelSimple, MapTrifold, PushPinSimple, Buildings, GithubLogo, and GoogleLogo
This commit is contained in:
@@ -1,60 +1,60 @@
|
||||
-- Lua Editor utilities
|
||||
|
||||
---@class LuaEditor
|
||||
local M = {}
|
||||
|
||||
---@class EditorOptions
|
||||
---@field read_only? boolean
|
||||
|
||||
---@class UIComponent
|
||||
---@field type string
|
||||
---@field props? table
|
||||
---@field children? table
|
||||
|
||||
---@class ValidationResult
|
||||
---@field valid boolean
|
||||
---@field errors table
|
||||
|
||||
---@class SandboxAction
|
||||
---@field action string
|
||||
---@field sandbox boolean
|
||||
---@field context table
|
||||
|
||||
---@param value? string
|
||||
---@param options? EditorOptions
|
||||
---@return UIComponent
|
||||
function M.render(value, options)
|
||||
return {
|
||||
type = "code_editor",
|
||||
props = {
|
||||
language = "lua",
|
||||
value = value or "",
|
||||
read_only = options and options.read_only or false,
|
||||
line_numbers = true,
|
||||
show_snippets = true
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
---@param lua_code string
|
||||
---@return ValidationResult
|
||||
function M.validate(lua_code)
|
||||
-- Lua syntax validation placeholder
|
||||
return {
|
||||
valid = true,
|
||||
errors = {}
|
||||
}
|
||||
end
|
||||
|
||||
---@param lua_code string
|
||||
---@param context? table
|
||||
---@return SandboxAction
|
||||
function M.run_sandbox(lua_code, context)
|
||||
return {
|
||||
action = "execute",
|
||||
sandbox = true,
|
||||
context = context or {}
|
||||
}
|
||||
end
|
||||
|
||||
return M
|
||||
-- Lua Editor utilities
|
||||
|
||||
---@class LuaEditor
|
||||
local M = {}
|
||||
|
||||
---@class EditorOptions
|
||||
---@field read_only? boolean
|
||||
|
||||
---@class UIComponent
|
||||
---@field type string
|
||||
---@field props? table
|
||||
---@field children? table
|
||||
|
||||
---@class ValidationResult
|
||||
---@field valid boolean
|
||||
---@field errors table
|
||||
|
||||
---@class SandboxAction
|
||||
---@field action string
|
||||
---@field sandbox boolean
|
||||
---@field context table
|
||||
|
||||
---@param value? string
|
||||
---@param options? EditorOptions
|
||||
---@return UIComponent
|
||||
function M.render(value, options)
|
||||
return {
|
||||
type = "code_editor",
|
||||
props = {
|
||||
language = "lua",
|
||||
value = value or "",
|
||||
read_only = options and options.read_only or false,
|
||||
line_numbers = true,
|
||||
show_snippets = true
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
---@param lua_code string
|
||||
---@return ValidationResult
|
||||
function M.validate(lua_code)
|
||||
-- Lua syntax validation placeholder
|
||||
return {
|
||||
valid = true,
|
||||
errors = {}
|
||||
}
|
||||
end
|
||||
|
||||
---@param lua_code string
|
||||
---@param context? table
|
||||
---@return SandboxAction
|
||||
function M.run_sandbox(lua_code, context)
|
||||
return {
|
||||
action = "execute",
|
||||
sandbox = true,
|
||||
context = context or {}
|
||||
}
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user