| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
feat(engine): named slots for custom components (collapsible-view demo) JS backend: implement setSlot/slotName, aggregate __slotMap on slot hosts, push via FlexUIBridge.updateNode (ComponentAdapter.slots drives it). C++: CustomTsView multi-slot containers, parse __slotMap, route children per slot name, whitelist __slotMap in UpdateCustomTsProps. ArkTS: pre-create NodeContent per slotDeclarations, inject slotContents, FRCollapsibleView struct renders ContentSlot per slot, onSlotMapParsed drives hasButtonSlot observable for re-render. Adds collapsibleview-demo card, Jest slot.test.ts, design docs, and build/check-env tooling updates. | 2 个月前 | |
fix(engine): forward named-slot taps to custom components (collapsible-view toggle) Declarative onClick on a custom component struct cannot receive taps on native NodeContent slot content (ContentSlot host consumes the touch, and ContentSlot does not support hitTestBehavior). Fix by capturing the tap on the named-slot container in C++: - CustomTsView: named slot containers get TRANSPARENT hit-test + a tap gesture (SlotClickDelegate) forwarding clicks via ts_render_provider_ref_ to a new onSlotClickedForCApi provider call - ArkTS: NativeRenderProvider -> NativeRenderImpl -> FRViewManager -> FlexUICustomComponentView.onSlotClicked(slotName) virtual hook; default slot containers keep NONE hit-test (zero impact on existing components) - collapsible-view: collapsed state moved into the @Observed view class, toggled by both the built-in header onClick and the slot click hook Verified on device: content with its own bindtap wins the gesture (no double-fire), content without handlers falls back to the component hook. Co-Authored-By: Claude <noreply@anthropic.com> | 2 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 2 个月前 | ||
| 2 个月前 |