19 Commits

Author SHA1 Message Date
phranck 1db0e36bea Chore: Read TUIkit version from bundled VERSION file
- Add Sources/TUIkit/VERSION as single source of truth for version string
- Read version at runtime via Bundle.module instead of hardcoded string
- Remove unused TUIkitVersion constant from Package.swift
- Fix version mismatch (was 0.1.0, actual is 0.4.0)
2026-02-15 23:59:00 +01:00
phranck e103e8cbd5 Chore: Bump version to 0.4.0 2026-02-15 03:10:18 +01:00
phranck 978c15993e Feat: Phase 1 i18n Infrastructure - LocalizationService and translation files
- Add LocalizationService singleton for managing language selection
- Implement XDG-compatible persistent language storage (macOS/Linux)
- Create translation JSON files for 5 languages (EN, DE, FR, IT, ES)
- Add LocalizationService to EnvironmentValues
- Support dot-notation keys for string resolution
- Implement fallback to English for missing keys
- Update Package.swift to include translation resources
- All 1069 tests pass
2026-02-14 18:15:33 +01:00
phranck d0627bafdc Refactor: Extract TUIkitView module and organize sub-module directories
- Extract View system foundation into new TUIkitView module (Layer 1)
  - View, ViewBuilder, TupleViews, ViewModifier, PrimitiveViews, EquatableView
  - Renderable, RenderContext, RenderCache, ChildInfo, SpacerProtocol
  - State, StateStorage, StateRegistration, HydrationContext
  - EnvironmentValues, EnvironmentModifier, ViewServiceEnvironment
- Introduce SpacerProtocol to decouple ChildInfo from concrete Spacer type
- Split ServiceEnvironment.swift (StateStorageKey/RenderCacheKey to TUIkitView)
- Add @_exported import TUIkitView in Exports.swift for backward compatibility
- Make internal types public for cross-module visibility (Renderable, Layoutable,
  renderToBuffer, ChildView, ChildInfo, ModifiedView, StateStorage, RenderCache)
- Organize TUIkitCore into Rendering/, Environment/, Input/, Extensions/, Concurrency/
- Organize TUIkitStyling into Color/, Theme/, Styles/
2026-02-14 14:11:09 +01:00
phranck d39e02722b Refactor: Extract TUIkitCore micro-kernel module
- Move pure value types and protocols to new TUIkitCore target (zero deps)
- Move whole files: FrameBuffer, ViewIdentity, Lock, TerminalSymbols
- Split types from mixed files: LayoutTypes (from Renderable), KeyEvent
  (from KeyEventDispatcher), EnvironmentKey (from Environment),
  PreferenceKey (from Preferences), String+TerminalWidth (from String+ANSI)
- Inline ANSIRenderer.reset as private constant in FrameBuffer
- Promote internal types to public for cross-module visibility
- Add @_exported import TUIkitCore to Exports.swift
2026-02-14 04:23:50 +01:00
phranck ce850e1b29 Refactor: Extract TUIkitStyling and TUIkitImage modules
- Extract 12 pure type definitions (Color, Palette, Appearance, BorderStyle, etc.) into TUIkitStyling module with no dependencies
- Extract 3 image processing files (RGBAImage, ImageLoader, ASCIIConverter) into TUIkitImage module (deps: CSTBImage, TUIkitStyling)
- Split 6 mixed files into type definitions (TUIkitStyling) and environment glue (TUIkit/Styling/)
- Decouple ThemeManager from AppState via renderTrigger closure
- Decouple ASCIIConverter from ANSIRenderer via local ANSIEscape constants
- Add @_exported imports in Exports.swift for backward compatibility
- All 1064 tests pass, no breaking API changes
2026-02-14 03:14:14 +01:00
phranck b3d563040a Feat: Add Image view with ASCII art rendering, bracketed paste, and input filtering
- Add Image view rendering local files and URLs as colored ASCII art
- Add CSTBImage C target wrapping stb_image for cross-platform image decoding
- Add ASCIIConverter with block, ASCII, and braille character sets
- Support trueColor, ANSI-256, grayscale, and mono color modes
- Add Floyd-Steinberg dithering for improved visual quality
- Add async image loading with URLImageCache for URL sources
- Add bracketed paste mode for bulk text insertion in text fields
- Add TextContentType modifier for input character filtering
- Add ContentMode enum and aspectRatio(_:contentMode:) View modifier
- Add text-input priority in key dispatch to prevent shortcut conflicts
- Add Image (File) and Image (URL) demo pages to example app
- Update DocC documentation with new symbols and layout table
2026-02-14 00:43:22 +01:00
phranck 54aff891a0 Chore: Add TUIkitVersion constant (0.3.0) 2026-02-13 20:39:16 +01:00
phranck adc25b6b1c Chore: Remove SwiftLint build plugin from Package.swift
- SwiftLint runs via CLI only (swiftlint lint), same as CI
- Removes SwiftLintPlugins dependency and DISABLE_SWIFTLINT env logic
- Faster local builds, no discrepancy between local and CI linting
2026-01-30 21:51:59 +01:00
phranck 95029184e7 Chore: Rename TUIKit to TUIkit
- Rename module, targets and products in Package.swift
- Rename directories: Sources/TUIkit, TUIkitExample, Tests/TUIkitTests
- Rename files: TUIkit.swift, TUIkit.docc/TUIkit.md
- Update all import statements, module-qualified calls, file headers
- Update doc comments, string literals and DocC articles
- Update CI workflow, README, .swiftlint.yml and markdown docs
- Merge platform badges into single combined badge in README
- Add "Example App auslagern" task to to-dos.md
2026-01-30 20:29:29 +01:00
phranck 54d4abad28 fix: Disable SwiftLint build plugin in CI via DISABLE_SWIFTLINT env var
The SwiftLint prebuild plugin cannot execute binary artifacts on
GitHub Actions macOS runners. Package.swift now checks for
DISABLE_SWIFTLINT=1 to conditionally skip the plugin.
The DocC workflow sets this variable.
2026-01-30 15:58:33 +01:00
phranck 82ca9400b3 refactor: Parameter Packs, Container cleanup, precompiled ANSI Regex (A.8, A.10, H.7)
- Replace 9 TupleView structs with single generic TupleView<each V: View> using Swift Parameter Packs
- Replace 9 ViewBuilder.buildBlock overloads with single variadic buildBlock
- Replace 9 TupleView Renderable extensions with single extension using repeat-each
- Raise deployment target to macOS 14 (required for parameter packs in generic types)
- Simplify renderContainer() by eliminating if/else footer branching
- Remove redundant effectiveConfig construction in Alert.renderToBuffer()
- Fix Panel footer-less init setting showFooterSeparator: true (now false)
- Replace runtime-compiled ANSI regex string pattern with precompiled Regex literal
- Update to-dos.md with new component ideas and completed work summary

Net result: ~370 lines removed, 10-child limit lifted, hot-path regex overhead eliminated.
2026-01-30 15:10:55 +01:00
phranck 34cfa447b9 feat: Integrate SwiftLint as build plugin with project-wide autofix
- Add SwiftLintPlugins (v0.58.2+) dependency to Package.swift
- Add SwiftLintBuildToolPlugin to TUIKit and TUIKitExample targets
- Create .swiftlint.yml with ~30 opt-in rules and project-specific limits
- Apply swiftlint --fix across all sources (~200+ trailing whitespace,
  ~80 prefer_self_in_static_references, ~15 trailing_newline,
  ~10 trailing_comma, ~5 redundant_type_annotation, ~4 modifier_order,
  ~4 shorthand_optional_binding)
- Fix for_where violations in KeyEvent.swift and App.swift
- Fix empty_string violation in RenderingTests.swift
- Add targeted swiftlint:disable for ViewBuilder patterns (large_tuple,
  function_parameter_count) and StatusBarTests (file_length)
- Configure exclusions: discouraged_none_name, nesting, fatal_error_message
- Result: 0 warnings, 0 errors, 210/210 tests passing
2026-01-30 14:23:05 +01:00
phranck f118437092 refactor: Phase 1 code quality improvements and ANSI cleanup
- Remove dead code: legacy BorderModifier (70 lines), legacy FrameModifier (74 lines)
- Fix state-mismatch bug in Theme/Appearance setTheme()/setAppearance()
- Eliminate force unwraps in Panel.body and Menu.dividerLineIndex
- Remove anti-patterns: _ = self, pointless ternary, identical branches
- Rename all 1-2 char variables to self-descriptive names across 9 files
- Centralize ANSI constants: add dim, ansiPattern to ANSIRenderer
- Replace all hardcoded ANSI reset strings with ANSIRenderer.reset
- Replace raw ANSI regex with ANSIRenderer.ansiPattern in FrameBuffer
- Inline all local ANSIRenderer alias variables (13 removals)
- Replace manual CSI-building in BackgroundModifier with ANSIRenderer.backgroundCode()
- Migrate View.frame() to use FlexibleFrameView
- Update macOS deployment target from 10.15 to 13
- Remove redundant explicit raw values from DemoPage enum

22 files changed, 113 insertions(+), 310 deletions(-)
2026-01-30 10:51:44 +01:00
phranck c66a53de66 feat: Replace all documentation with DocC + GitHub Pages deployment
- Remove old VitePress, MkDocs, and legacy DocC workflows and files
- Add swift-docc-plugin dependency to Package.swift
- Create DocC catalog at Sources/TUIKit/TUIKit.docc/ with:
  - Main landing page with full API topic organization
  - Getting Started guide
  - Architecture overview
  - State Management guide
  - Theming guide
- Add GitHub Actions workflow for DocC → GitHub Pages (macos-15)
- CNAME for tuikit.layered.work injected during CI build
- Clean up .gitignore (remove MkDocs/VitePress entries, add docs-output/)
2026-01-30 07:41:53 +01:00
phranck 45e73faafb refactor: Rename package from SwiftTUI to TUIKit
BREAKING CHANGE: Package name changed due to name collision with
existing rensbreur/SwiftTUI package.

Changes:
- Rename package from SwiftTUI to TUIKit in Package.swift
- Rename Sources/SwiftTUI to Sources/TUIKit
- Rename Sources/SwiftTUIExample to Sources/TUIKitExample
- Rename Tests/SwiftTUITests to Tests/TUIKitTests
- Rename SwiftTUI.swift to TUIKit.swift
- Update all imports: import SwiftTUI -> import TUIKit
- Update all code references: SwiftTUI.renderToBuffer -> TUIKit.renderToBuffer
- Update documentation comments
- Rename swiftTUIVersion to tuiKitVersion

All 181 tests passing.
2026-01-28 19:32:09 +01:00
phranck 5a076dbf9b feat: Add lifecycle, storage, preferences and improve layout
- Add @AppStorage and @SceneStorage for persistent settings
- Add @onAppear, @onDisappear and .task() lifecycle modifiers
- Add Preferences system for bottom-up data flow (child → parent)
- Add UserDefaultsStorage with Linux-compatible implementation
- Add flexible .frame() with minWidth/maxWidth/maxHeight/.infinity
- Fix BorderModifier to reduce availableWidth for content
- Fix StatusBar .justified alignment for equal edge spacing
- Fix Alert vertical expansion by removing Spacer
- Fix q-quit not working when StatusBar item has no action
- Fix render loop caused by statusBarItems modifier
- Add Linux compatibility (Glibc, XDG paths)
2026-01-28 18:42:52 +01:00
phranck 7ddac7067d feat: Complete SwiftTUI foundation with overlay system and menu
Core Framework:
- TView protocol with TViewBuilder result builder (up to 10 children)
- Full ANSI rendering pipeline (Terminal, ANSIRenderer, FrameBuffer)
- TApp/TScene/WindowGroup app lifecycle with SIGWINCH handling
- Color system (ANSI, bright, 256-palette, RGB, hex, semantic colors)
- Text styling (bold, italic, underline, strikethrough, dim, blink, inverted)

Container Views:
- VStack, HStack, ZStack with alignment and spacing
- Card (bordered container with padding/background)
- Box (simple bordered container)
- Panel (titled container with title in border)
- ForEach for dynamic content

Modifiers:
- .padding(), .frame(), .border() (8 border styles), .background()
- .overlay() with alignment, .dimmed(), .modal() helper

Overlay System:
- Alert view with title, message, actions, and presets (warning/error/info/success)
- Dialog view for flexible modal content
- FrameBuffer character-level compositing

Menu View:
- Menu with items, selection indicator, shortcuts
- MenuItem model with id, label, shortcut
- AnyView type-erased wrapper

Example App:
- Menu-based navigation with multiple demo pages
- Text Styles, Colors, Containers, Overlays, Layout demos

Tests:
- 58 tests across 12 suites, all passing
2026-01-28 15:35:55 +01:00
phranck dac288a5e4 Initial Commit 2026-01-28 09:26:25 +01:00