From 0208e4b23280d6f96d48b3ea80c764bb27cc52f7 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Thu, 1 Aug 2024 15:08:18 +1000 Subject: [PATCH] feat(ui): expose subscribe method for nanostores --- .../controlLayers/konva/CanvasStateApi.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/invokeai/frontend/web/src/features/controlLayers/konva/CanvasStateApi.ts b/invokeai/frontend/web/src/features/controlLayers/konva/CanvasStateApi.ts index ff949645af..e463a0dbd8 100644 --- a/invokeai/frontend/web/src/features/controlLayers/konva/CanvasStateApi.ts +++ b/invokeai/frontend/web/src/features/controlLayers/konva/CanvasStateApi.ts @@ -257,30 +257,47 @@ export class CanvasStateApi { // Read-write state, ephemeral interaction state getIsDrawing = $isDrawing.get; setIsDrawing = $isDrawing.set; + onIsDrawingChanged = $isDrawing.subscribe; getIsMouseDown = $isMouseDown.get; setIsMouseDown = $isMouseDown.set; + onIsMouseDownChanged = $isMouseDown.subscribe; getLastAddedPoint = $lastAddedPoint.get; setLastAddedPoint = $lastAddedPoint.set; + onLastAddedPointChanged = $lastAddedPoint.subscribe; getLastMouseDownPos = $lastMouseDownPos.get; setLastMouseDownPos = $lastMouseDownPos.set; + onLastMouseDownPosChanged = $lastMouseDownPos.subscribe; getLastCursorPos = $lastCursorPos.get; setLastCursorPos = $lastCursorPos.set; + onLastCursorPosChanged = $lastCursorPos.subscribe; getSpaceKey = $spaceKey.get; setSpaceKey = $spaceKey.set; + onSpaceKeyChanged = $spaceKey.subscribe; getLastProgressEvent = $lastProgressEvent.get; setLastProgressEvent = $lastProgressEvent.set; + onLastProgressEventChanged = $lastProgressEvent.subscribe; getAltKey = $alt.get; + onAltChanged = $alt.subscribe; + getCtrlKey = $ctrl.get; + onCtrlChanged = $ctrl.subscribe; + getMetaKey = $meta.get; + onMetaChanged = $meta.subscribe; + getShiftKey = $shift.get; + onShiftChanged = $shift.subscribe; getShouldShowStagedImage = $shouldShowStagedImage.get; + onGetShouldShowStagedImageChanged = $shouldShowStagedImage.subscribe; + setStageAttrs = $stageAttrs.set; + onStageAttrsChanged = $stageAttrs.subscribe; }