You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
v0.12.87: fix ContextMenu, Terminal bugs; add dynamic items support
ContextMenu:
- Remove inline-block wrapper div, use cloneElement instead (fixes layout breaking on flex/block triggers)
- Divider uses <hr> instead of DaisyUI divider class (excessive padding)
- items prop now accepts a function (e) => ContextMenuItem[] for dynamic menus
- Add DynamicItems demo to docs
Terminal:
- Cursor defaults to foreground color instead of primary (purple)
- User options.theme is now deep-merged with auto-generated theme instead of replacing it
Icons:
- Fix unused props destructuring in createIcon (TS error)
Build:
- Replace sed with cross-platform tsx script in sync-icons-prefixed
- Sync prefixed packages
Copy file name to clipboardExpand all lines: packages/asterui/CHANGELOG.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,19 @@ description: All notable changes to AsterUI
7
7
8
8
All notable changes to AsterUI are documented here.
9
9
10
+
## v0.12.87 (2026-03-21)
11
+
12
+
### Bug Fixes
13
+
14
+
-**ContextMenu**: Removed `inline-block` wrapper div that broke flex/block layout on trigger elements. Now uses `cloneElement` to attach the context menu handler directly to the trigger child.
15
+
-**ContextMenu**: Divider now uses `<hr>` instead of DaisyUI `divider` class which had excessive padding.
16
+
-**Terminal**: Cursor color now defaults to foreground (`base-content`) instead of primary color.
17
+
-**Terminal**: User `options.theme` is now deep-merged with the auto-generated theme instead of replacing it, allowing individual color overrides without losing other theme colors.
18
+
19
+
### Features
20
+
21
+
-**ContextMenu**: `items` prop now accepts a function `(e: React.MouseEvent) => ContextMenuItem[]` for dynamic menu items based on the click event.
@@ -47,6 +48,10 @@ import { ContextMenu } from 'asterui'
47
48
<SubmenuDemoclient:loadslot="demo" />
48
49
</Example>
49
50
51
+
<Exampletitle="Dynamic Items"description="Use a function for items to generate menu items based on the click event."source={ContextMenuDemoSource}fn="DynamicItemsDemo">
52
+
<DynamicItemsDemoclient:loadslot="demo" />
53
+
</Example>
54
+
50
55
<Exampletitle="Disabled Items"description="Some menu items can be disabled."source={ContextMenuDemoSource}fn="DisabledDemo">
51
56
<DisabledDemoclient:loadslot="demo" />
52
57
</Example>
@@ -60,7 +65,7 @@ import { ContextMenu } from 'asterui'
60
65
| Property | Description | Type | Default |
61
66
|----------|-------------|------|---------|
62
67
|`children`| Element that triggers the context menu on right-click |`React.ReactNode`| - |
63
-
|`items`| Menu items |`ContextMenuItem[]`| - |
68
+
|`items`| Menu items (static array or function for dynamic items) |`ContextMenuItem[] \| ((e: React.MouseEvent) => ContextMenuItem[])`| - |
64
69
|`onSelect`| Callback when an item is selected |`(key: string) => void`| - |
65
70
|`disabled`| Whether the context menu is disabled |`boolean`|`false`|
66
71
|`className`| Additional CSS classes for the menu |`string`| - |
Copy file name to clipboardExpand all lines: packages/docs/src/content/docs/components/terminal.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,7 @@ import { Terminal } from 'asterui/terminal'
67
67
|`onLine`| Callback when user submits a line in readline mode. Return a Promise to defer the next prompt. |`(line: string) => void \| Promise<void>`| - |
68
68
|`onData`| Callback for raw input (not used in readline mode) |`(data: string) => void`| - |
69
69
|`onReady`| Callback when terminal is initialized |`(terminal: XTerm) => void`| - |
70
-
|`options`| xterm.js options (theme is auto-applied) |`ITerminalOptions`| - |
70
+
|`options`| xterm.js options (theme is auto-generated and merged with any user theme overrides) |`ITerminalOptions`| - |
0 commit comments