build: 清理 tinyflow-ui 构建告警

- 收口 Svelte props 响应式引用与 custom element props 声明

- 清理局部未使用样式与类型告警并保持现有业务语义
This commit is contained in:
2026-05-06 19:22:33 +08:00
parent ba70fec9a5
commit 8d07b306e5
34 changed files with 288 additions and 151 deletions

View File

@@ -144,10 +144,16 @@ const nodeToOptions = (
}
};
export const useRefOptions: any = (useChildrenOnly: boolean = false) => {
export const useRefOptions: any = (
useChildrenOnly: boolean | (() => boolean) = false,
) => {
const currentNodeId = getCurrentNodeId();
const currentNode = useNodesData(currentNodeId);
const { nodes, edges, nodeLookup } = $derived(useStore());
const isChildrenOnly = () =>
typeof useChildrenOnly === 'function'
? useChildrenOnly()
: useChildrenOnly;
let selectItems = $derived.by(() => {
const resultOptions = [];
@@ -158,7 +164,7 @@ export const useRefOptions: any = (useChildrenOnly: boolean = false) => {
//通过 nodeLookup.get 才会得到有 parentId 的 node
const cNode = nodeLookup.get(currentNodeId)!;
if (useChildrenOnly) {
if (isChildrenOnly()) {
for (const node of nodes) {
const nodeIsChildren = node.parentId === currentNode.current.id;
if (nodeIsChildren) {