diff --git a/app/gui2/package.json b/app/gui2/package.json index f2fc9cbff9..c148cd19cd 100644 --- a/app/gui2/package.json +++ b/app/gui2/package.json @@ -82,7 +82,7 @@ "react-toastify": "^9.1.3", "sucrase": "^3.34.0", "veaury": "^2.3.18", - "vue": "^3.4.19", + "vue": "^3.5.2", "vue-component-type-helpers": "^2.0.29", "y-codemirror.next": "^0.3.2", "y-protocols": "^1.0.5", diff --git a/app/gui2/src/components/GraphEditor/widgets/WidgetSelection.vue b/app/gui2/src/components/GraphEditor/widgets/WidgetSelection.vue index ae82c71b8e..22b569c862 100644 --- a/app/gui2/src/components/GraphEditor/widgets/WidgetSelection.vue +++ b/app/gui2/src/components/GraphEditor/widgets/WidgetSelection.vue @@ -467,15 +467,9 @@ declare module '@/providers/widgetRegistry' { @pointerout="isHovered = false" > - + + +
diff --git a/app/gui2/src/components/WithFullscreenMode.vue b/app/gui2/src/components/WithFullscreenMode.vue index bd1558b355..eb3eb8dc7c 100644 --- a/app/gui2/src/components/WithFullscreenMode.vue +++ b/app/gui2/src/components/WithFullscreenMode.vue @@ -99,15 +99,11 @@ export type SavedSize = Keyframe or used with `unrefElement`. --> diff --git a/app/gui2/src/util/reactivity.ts b/app/gui2/src/util/reactivity.ts index bb90195f9a..7ea2bcd7b8 100644 --- a/app/gui2/src/util/reactivity.ts +++ b/app/gui2/src/util/reactivity.ts @@ -14,6 +14,9 @@ import { MaybeRefOrGetter, queuePostFlushCb, reactive, + ReactiveEffect, + ReactiveEffectOptions, + ReactiveEffectRunner, Ref, shallowReactive, shallowRef, @@ -35,6 +38,26 @@ export function evalWatchSource(src: WatchSource): T { return isRef(src) ? src.value : src() } +/** + * Create a `ReactiveEffect`. This is similar to the `effect` function, but doesn't immediately run the created effect. + */ +export function lazyEffect( + fn: () => T, + options?: ReactiveEffectOptions, +): ReactiveEffectRunner { + if ((fn as ReactiveEffectRunner).effect instanceof ReactiveEffect) { + fn = (fn as ReactiveEffectRunner).effect.fn + } + + const e = new ReactiveEffect(fn) + if (options) { + Object.assign(e, options) + } + const runner = e.run.bind(e) as ReactiveEffectRunner + runner.effect = e + return runner +} + export type OnCleanup = (fn: () => void) => void export type StopEffect = () => void @@ -71,13 +94,12 @@ export class LazySyncEffectSet { cleanup = fn } - const runner = effect( + const runner = lazyEffect( () => { callCleanup() fn(onCleanup) }, { - lazy: true, scheduler: () => { if (this._dirtyRunners.size === 0) queuePostFlushCb(this._boundFlush) this._dirtyRunners.add(runner) diff --git a/app/gui2/stories/histoire/HstWrapper.vue b/app/gui2/stories/histoire/HstWrapper.vue index a320b94366..979470fca5 100644 --- a/app/gui2/stories/histoire/HstWrapper.vue +++ b/app/gui2/stories/histoire/HstWrapper.vue @@ -30,18 +30,11 @@ export default {