Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
60fc3fa
chore: update .gitignore to include compile_commands.json for clangd
sunnyswag Nov 11, 2025
69f2ddb
fix: update image paths in test components to use correct directory s…
sunnyswag Nov 12, 2025
b4817d7
chore: update txiki subproject to latest commit to support fetch blob
sunnyswag Nov 14, 2025
36cffee
refactor: replace getBinary functions with fetchBinary utility for GI…
sunnyswag Nov 14, 2025
1b8da28
Update .gitignore
sunnyswag Nov 14, 2025
ec284e1
fix: enhance fetchBinary function to handle HTTP errors and improve e…
sunnyswag Nov 14, 2025
e07f1be
build: add support for building static library and refactor main entr…
Jan 12, 2026
78c3560
build: add display resolution configuration to CMake and update devic…
Jan 13, 2026
a92a974
build: enhance CMake configuration with LVGLJS_CONF_DIR and display r…
Jan 13, 2026
04a6d88
feat: implement LVGL Group focus navigation support
Jan 13, 2026
053617d
refactor: extract init_input_devices for indev init
Jan 14, 2026
1b17f0c
demo: add flex ViewPager demo (ts)
sunnyswag Jan 14, 2026
41ed000
feat: add arc test code
Jan 14, 2026
90e252a
feat: enhance group management in React components
Jan 15, 2026
5a940ea
feat: add navigation demo with multiple pages and auto-focus function…
Jan 16, 2026
ae96c38
feat: update component registration to support refs
Jan 16, 2026
8532641
feat: enhance ViewPager component with debugging features and style u…
Jan 16, 2026
18af2f3
feat: update React dependencies and enhance reconciler functionality
Jan 16, 2026
559ebbb
feat: implement internationalization support in navigation demo
Jan 16, 2026
e37d270
fix: update i18n message handling and improve localization performance
sunnyswag Jan 18, 2026
6824574
feat: upgrade React and related dependencies, enhance component final…
Jan 19, 2026
dfd947a
feat: enhance navigation demo with React Router integration
Jan 19, 2026
e174731
refactor: remove useAutoFocus hook and enhance focus management in co…
Jan 19, 2026
b04cef2
refactor: remove GroupManager and streamline focus handling in compon…
Jan 19, 2026
4ec2817
refactor: simplify Header component by removing onBack prop and using…
sunnyswag Jan 19, 2026
05842af
refactor: remove LV_OBJ_FLAG_SCROLL_ON_FOCUS from multiple components…
Jan 20, 2026
f87334d
chore(deps): upgrade lvgl from v8.3.0-dev to v8.4.0
Jan 20, 2026
0905a98
feat: add addToFocusGroup prop to View component in ViewPager for imp…
Jan 20, 2026
416d8fa
refactor: update ViewPager styles and enhance scrollbar behavior
Jan 20, 2026
1390ac7
fix: compile warnings
Jan 20, 2026
189655c
feat: enhance child insertion logic in BasicComponent
Jan 20, 2026
cb5499a
refactor: simplify Window component by removing unused code
Jan 21, 2026
1b333c4
feat: implement new Page2Info component with enhanced navigation and …
Jan 21, 2026
60caf8a
style: add overflow hidden to navigation container for improved layou…
Jan 21, 2026
dd1992b
refactor: replace CommonComponentApi with setComponentProps in multip…
Jan 21, 2026
46fa7f9
chore(deps): update lvgl subproject to commit 74d0a81
Jan 22, 2026
7e19d37
refactor: style.cpp remove duplicate code
Jan 22, 2026
ef0daf4
refactor: rename style-transition-time to transition-time for consist…
Jan 23, 2026
c4a2f8f
refactor: simplify align logic in common component setters
Jan 23, 2026
2ac6b2d
fix: ts warnings
Jan 23, 2026
bc46d94
refactor: update setProps method to use UpdatePayload for Button, Tex…
sunnyswag Jan 25, 2026
dbf10bc
refactor: update setProps method to use UpdatePayload across multiple…
sunnyswag Jan 25, 2026
127a9ad
refactor: update setProps method to use type assertions for component…
sunnyswag Jan 25, 2026
b646680
feat: add gateway demo
Jan 26, 2026
f5e93d5
feat: enhance gateway demo with new icons and header updates
Jan 26, 2026
cbcbc35
refactor: streamline layout in DeviceStatusPage component
Jan 26, 2026
c0af941
feat: enhance device information display in gateway demo
Jan 26, 2026
49d0f83
feat: add Japanese language support and enhance localization in gatew…
Jan 26, 2026
5f7d864
fix: correct countdown angle calculation and update styles in Countdo…
Jan 27, 2026
b30d5eb
refactor: remove background-opacity property and update color styles …
Jan 27, 2026
65dd476
refactor: adjust layout and styling in HomePage component
Jan 27, 2026
60da914
refactor: replace Record<string, any> with CreateStyle for consistent…
Jan 27, 2026
10ece33
refactor: simplify color list animation logic in App component
Jan 27, 2026
23fd241
refactor: update padding and border-radius styles across multiple com…
Jan 27, 2026
7e3f477
refactor: enhance Header component with navigation functionality and …
Jan 28, 2026
76f75ac
fix: reorder the select items
Jan 30, 2026
b2ca22c
feat: add pagination navigation to LogDetailPage and update localizat…
Jan 30, 2026
40390ee
feat: integrate focus group functionality and enhance LogDetailPage p…
Jan 30, 2026
b4cb0ce
refactor: simplify LogDetailPage structure and enhance focus navigation
Jan 30, 2026
5d81355
refactor: rename checkIndex to loopIndex and simplify navigation logi…
Feb 2, 2026
5022770
update .gitignore
Feb 4, 2026
d34d458
chore: translate Chinese comments to English
sunnyswag Feb 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@

# Build folders
debug/
build*/
build/*
Comment thread
sunnyswag marked this conversation as resolved.
dev_*/
**/.cache/

# For clangd
compile_commands.json

# CMake files
CMakeFiles/
CMakeCache.txt
Expand All @@ -21,3 +24,6 @@ CMakeCache.txt
# NPM
node_modules/
src/render/react/index.js

# Cursor AI
.cursor/
28 changes: 26 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,23 @@ cmake_minimum_required(VERSION 3.16)
project(lvgljs LANGUAGES C CXX)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(LV_CONF_PATH ${CMAKE_CURRENT_SOURCE_DIR}/deps/lv_conf.h CACHE INTERNAL "LV_CONF_PATH")

if(NOT DEFINED LVGLJS_CONF_DIR)
set(LVGLJS_CONF_DIR ${CMAKE_CURRENT_SOURCE_DIR}/deps CACHE INTERNAL "LVGLJS_CONF_DIR")
endif()

set(LV_CONF_PATH ${LVGLJS_CONF_DIR}/lv_conf.h CACHE INTERNAL "LV_CONF_PATH")

set(BUILD_NATIVE OFF CACHE BOOL "Build wasm3 with native support")

option(BUILD_STATIC_LIB "Build as static library (.a) instead of executable" OFF)

set(DISP_HOR_RES 1024 CACHE STRING "Display horizontal resolution")
set(DISP_VER_RES 600 CACHE STRING "Display vertical resolution")

find_path(LVGL_PATH lvgl.h PATHS ${CMAKE_CURRENT_SOURCE_DIR}/deps PATH_SUFFIXES lvgl)

add_executable(lvgljs
set(LVGLJS_SOURCES
src/engine/engine.cpp
src/render/native/core/style/style.cpp
src/render/native/core/style/font/font.cpp
Expand All @@ -29,6 +39,7 @@ add_executable(lvgljs
src/render/native/core/img/img.cpp
src/render/native/core/utils/utils.hpp
src/render/native/core/animate/animate.cpp
src/render/native/core/focus_group/focus_group.cpp
src/render/native/components/arc/arc.cpp
src/render/native/components/arc/arc_wrap.cpp
src/render/native/components/mask/mask.cpp
Expand Down Expand Up @@ -74,6 +85,14 @@ add_executable(lvgljs
src/render/native/bootstrap/render_bootstrap.cpp
)

if(BUILD_STATIC_LIB)
add_library(lvgljs STATIC ${LVGLJS_SOURCES})
message(STATUS "Building lvgljs as static library (.a)")
else()
add_executable(lvgljs ${LVGLJS_SOURCES} src/engine/main.cpp)
message(STATUS "Building lvgljs as executable")
endif()

if(${CMAKE_BUILD_TYPE} MATCHES Simulator)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -Wall -g -ggdb -std=c++14")
set(BUILD_WITH_MIMALLOC OFF) # TODO: SDL and mimalloc don't play well together
Expand Down Expand Up @@ -108,6 +127,11 @@ target_include_directories(lvgljs PUBLIC
src/render/native/core
)

target_compile_definitions(lvgljs PRIVATE
DISP_HOR_RES=${DISP_HOR_RES}
DISP_VER_RES=${DISP_VER_RES}
)

target_link_libraries(lvgljs PUBLIC
tjs
lvgl
Expand Down
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
BUILD_SIM=build
BUILD_LIB=build_lib

.PHONY: setup simulator demo clean
.PHONY: setup simulator lib demo clean

setup:
git submodule update --recursive --init
npm install

simulator:
@mkdir -p $(BUILD_SIM)
cmake -B "$(BUILD_SIM)" -DCMAKE_BUILD_TYPE=Simulator
cmake -B "$(BUILD_SIM)" -DCMAKE_BUILD_TYPE=Simulator -DBUILD_STATIC_LIB=OFF
cmake --build $(BUILD_SIM) -j

# Set default project argument to 'widgets' if no project is provided
lib:
@mkdir -p $(BUILD_LIB)
cmake -B "$(BUILD_LIB)" -DCMAKE_BUILD_TYPE=Simulator -DBUILD_STATIC_LIB=ON
cmake --build $(BUILD_LIB) -j

demo: simulator
@PROJECT=$${PROJECT:-widgets}; \
echo "Running demo with project: $$PROJECT"; \
node build.js && \
./${BUILD_SIM}/lvgljs run demo/$$PROJECT/index.js

clean:
rm -rf $(BUILD_SIM)
rm -rf $(BUILD_SIM) $(BUILD_LIB)
1 change: 1 addition & 0 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function build(pattern){
entryPoints: [entry],
bundle: true,
platform: 'neutral',
mainFields: ['module', 'main'],
external: ['tjs:path'],
outfile: path.resolve(path.dirname(entry), 'index.js'),
define: {
Expand Down
Binary file added demo/gateway/assets/nav_icon/device_info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/gateway/assets/nav_icon/device_status.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/gateway/assets/nav_icon/event_log.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/gateway/assets/nav_icon/settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
99 changes: 99 additions & 0 deletions demo/gateway/components/ConfirmDialog.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import React from "react";
import { Button, Text, View, Dimensions, CreateStyle } from "lvgljs-ui";

const { width, height } = Dimensions.window;

interface ConfirmDialogProps {
title: string;
onConfirm: () => void;
onCancel: () => void;
confirmText?: string;
cancelText?: string;
}

export function ConfirmDialog({
title,
onConfirm,
onCancel,
confirmText = "Confirm",
cancelText = "Cancel",
}: ConfirmDialogProps) {
return (
<View style={style.overlay} onCancel={onCancel}>
<View style={style.dialog}>
<Text style={style.title}>{title}</Text>
<View style={style.buttons}>
<Button
autoFocus
style={style.button}
onFocusedStyle={style.buttonFocused}
onClick={onCancel}
addToFocusGroup
>
<Text style={style.buttonText}>✕</Text>
Comment thread
sunnyswag marked this conversation as resolved.
</Button>
<Button
style={style.button}
onFocusedStyle={style.buttonFocused}
onClick={onConfirm}
addToFocusGroup
>
<Text style={style.buttonText}>✓</Text>
</Button>
</View>
</View>
</View>
);
}

const style = CreateStyle({
overlay: {
position: "absolute",
width,
height,
"background-color": "rgba(0, 0, 0, 0.7)",
display: "flex",
"align-items": "center",
"justify-content": "center",
zIndex: 1000,
},
dialog: {
width: width - 80,
"background-color": "black",
"border-radius": 12,
padding: 24,
display: "flex",
"flex-direction": "column",
"align-items": "center",
},
title: {
"text-color": "white",
"font-size": 16,
"text-align": "center",
"margin-bottom": 24,
},
buttons: {
display: "flex",
"flex-direction": "row",
"justify-content": "space-between",
width: "100%",
gap: 16,
},
button: {
flex: 1,
height: 44,
"border-radius": 8,
"background-color": "0x404040",
display: "flex",
"align-items": "center",
"justify-content": "center",
},
buttonText: {
"text-color": "white",
"font-size": 18,
},
buttonFocused: {
"border-width": 3,
"border-color": "#4660FF",
},
});
41 changes: 41 additions & 0 deletions demo/gateway/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React from "react";
import { CreateStyle, Image, Text, View } from "lvgljs-ui";
import { useNavigate } from "react-router";

interface HeaderProps {
title: string;
backIcon?: string;
}

export function Header({ title, backIcon }: HeaderProps) {
const navigate = useNavigate();
return (
<View style={style.header}>
<Image src="left" style={style.headerIcon} onClick={() => navigate(-1)} />
{backIcon && <Image src={backIcon} style={style.headerIcon} />}
<Text style={style.headerTitle}>{title}</Text>
</View>
);
}

const style = CreateStyle({
header: {
width: "100%",
height: 52,
display: "flex",
"flex-direction": "row",
"align-items": "center",
"background-color": "0x202020",
padding: "0 16px",
},
headerIcon: {
width: 'auto',
height: 'auto',
"text-color": "white",
"font-size": 18,
},
headerTitle: {
"text-color": "white",
"font-size": 16,
},
});
94 changes: 94 additions & 0 deletions demo/gateway/components/ListItem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
import React from "react";
import { CreateStyle, Image, Text, useT, View } from "lvgljs-ui";

interface ListItemProps {
title: string;
badge?: string;
badgeColor?: string;
showArrow?: boolean;
onClick?: () => void;
autoFocus?: boolean;
}

export function ListItem({
title,
badge,
badgeColor = "0xFF0000",
showArrow = true,
onClick,
autoFocus = false,
}: ListItemProps) {
const t = useT();
return (
<View
autoFocus={autoFocus}
addToFocusGroup
onFocusedStyle={style.focused}
style={style.listItem}
onClick={onClick}
>
<View style={style.content}>
<Text style={style.title}>{t(title)}</Text>
{badge && (
<View style={[style.badge, { "background-color": badgeColor }]}>
<Text style={style.badgeText}>{badge}</Text>
</View>
)}
</View>
{showArrow && (
<Image src={"right"} style={style.arrow} />
)}
</View>
);
}

const style = CreateStyle({
listItem: {
width: "100%",
height: 60,
"background-color": "0x2a2a2a",
margin: "0 0 8px 0",
padding: "0 12px",
display: "flex",
"flex-direction": "row",
"align-items": "center",
"justify-content": "space-between",
"scroll-on-focus": 1,
},
content: {
display: "flex",
width: 'auto',
height: 'auto',
"flex-direction": "row",
"align-items": "center",
"flex": 1,
},
title: {
"text-color": "white",
"font-size": 16,
},
badge: {
"border-radius": 12,
padding: "2px 8px",
margin: "0 0 0 12px",
display: "flex",
"align-items": "center",
"justify-content": "center",
"min-width": 24,
height: 20,
},
badgeText: {
"text-color": "white",
"font-size": 12,
},
arrow: {
"text-color": "white",
"font-size": 18,
margin: "0 0 0 12px",
},
focused: {
padding: "0 12px",
"border-radius": 12,
"background-color": "#4660FF",
},
});
Loading