fix: 修复工作流节点交互与旧浏览器兼容

- 修复 Tinyflow Vue wrapper 可选 boolean 默认关闭节点拖拽和连线的问题

- 为 Tinyflow 增加 structuredClone 兼容与 Chrome 90 构建目标

- 增加节点交互归一化与 Tab 空值防御
This commit is contained in:
2026-06-23 15:59:03 +08:00
parent 999a21e2d9
commit 03ad011f64
11 changed files with 183 additions and 14 deletions

View File

@@ -0,0 +1,22 @@
type StructuredCloneFallback = <T>(value: T) => T;
/**
* Installs browser compatibility shims required by Tinyflow.
*/
export function installTinyflowBrowserCompat() {
if (
typeof globalThis.structuredClone === 'function' ||
typeof JSON === 'undefined'
) {
return;
}
const fallback: StructuredCloneFallback = (value) =>
value == null ? value : JSON.parse(JSON.stringify(value));
Object.defineProperty(globalThis, 'structuredClone', {
configurable: true,
value: fallback,
writable: true,
});
}