refactor: extract useVariableList; properties add output variable

This commit is contained in:
zhaoying
2026-01-19 17:00:26 +08:00
parent ff6bdc1bed
commit 2d90b0c752
8 changed files with 562 additions and 835 deletions

View File

@@ -33,7 +33,8 @@ const InitialValuePlugin: React.FC<InitialValuePluginProps> = ({ value, options
useEffect(() => {
if (value !== prevValueRef.current && !isUserInputRef.current) {
editor.update(() => {
queueMicrotask(() => {
editor.update(() => {
const root = $getRoot();
root.clear();
@@ -98,7 +99,8 @@ const InitialValuePlugin: React.FC<InitialValuePluginProps> = ({ value, options
});
root.append(paragraph);
}
}, { discrete: true });
}, { discrete: true });
});
}
prevValueRef.current = value;