swiftbricks/Sources/SwiftBricks/SwiftBricks.swift
Hermes Agent 36967370fd SwiftBricks: Bricks JSON UI framework native Swift/SwiftUI implementation
- Core: Schema (Codable), Store, EventBus, RPC, Engine, I18n
- Controls: Text, Title1-6, Label, Input, Textarea, Number, Date, Button, Select
  VBox, HBox, ScrollPanel, DynamicColumn, Tabular, Form, InlineForm,
  TabView, Menu, PopupWindow, Html, Image, UrlWidget
- Renderer: BricksView (main entry), ControlRenderer (recursive dispatch)
- 30+ widget types, 9 bind actiontypes
- Form validation (required/minlength/maxlength/min/max/email/number/pattern)
- i18n with multi-language JSON files
- 18 tests covering schema parsing, store, i18n, events
2026-06-21 12:12:03 +08:00

51 lines
1.6 KiB
Swift
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/// SwiftBricks BricksSwift/SwiftUI
///
/// :
/// - BricksEngine: schemabinds
/// - BricksStore: widget///
/// - BricksEventBus: /
/// - BricksRPC: GET/POST/Form
/// - BricksI18n:
/// - BricksView:
/// - ControlRenderer: JSONSwiftUI
///
/// Widget:
/// - : Text, Title1-6, Label
/// - : Input, Textarea, Select, UiCode, UiStr, UiNumber, UiDate, UiText
/// - : Button
/// - : VBox, HBox, VScrollPanel, HScrollPanel, Filler, DynamicColumn, Card
/// - : Tabular, DataViewer, Form, InlineForm
/// - : TabView, Menu
/// - : PopupWindow
/// - : Html, Image, urlwidget
///
/// Bind ActionType (9):
/// newwindow, iframe, urlwidget, urldata, bricks, registerfunction, method, script, event
///
/// :
/// ```swift
/// // 1.
/// let engine = BricksEngine()
/// engine.rpc.baseURL = "https://api.example.com"
///
/// // 2.
/// BricksView(json: jsonString, engine: engine)
/// BricksView(url: "/api/page.ui", engine: engine)
///
/// // 3. i18n
/// await engine.i18n.loadLocale("en")
/// ```
import SwiftUI
//
public typealias Schema = ControlSchema
public typealias Options = ControlOptions
public typealias Bind = BindSchema
public typealias Field = FieldSchema
public typealias Store = BricksStore
public typealias EventBus = BricksEventBus
public typealias RPC = BricksRPC
public typealias I18n = BricksI18n
public typealias Engine = BricksEngine