diff --git a/app/frontend/src/common/hook.ts b/app/frontend/src/common/hook.ts index 672e63a..5af03c3 100644 --- a/app/frontend/src/common/hook.ts +++ b/app/frontend/src/common/hook.ts @@ -3,7 +3,7 @@ import {v4 as uuidv4} from 'uuid'; import {deepEqual} from 'common/util'; import {EntityComponentId, useStore as useRenderStore} from 'state/annotate/render'; -import {useStore as useAnnoStore, getComponent, getSlice} from 'state/annotate/annotation'; +import {useAnnoStore, getComponent, getSlice} from 'state/annotate/annotation'; import {useStore as useUIStore} from 'state/annotate/ui'; import {useStore as useDrawPolyStore} from 'state/annotate/polychain/draw'; import {useStore as useDrawRectStore} from 'state/annotate/rectangle/draw'; diff --git a/app/frontend/src/common/render.ts b/app/frontend/src/common/render.ts index a27f99f..1a60314 100644 --- a/app/frontend/src/common/render.ts +++ b/app/frontend/src/common/render.ts @@ -1,6 +1,6 @@ import {useCallback} from 'react'; -import {useStore as useAnnoStore} from 'state/annotate/annotation'; +import {useAnnoStore} from 'state/annotate/annotation'; import {useStore as useRenderStore} from 'state/annotate/render'; import {ViewportTransform} from 'state/annotate/render/viewport'; diff --git a/app/frontend/src/component/Testing.tsx b/app/frontend/src/component/Testing.tsx index 5863b5c..087d5cb 100644 --- a/app/frontend/src/component/Testing.tsx +++ b/app/frontend/src/component/Testing.tsx @@ -1,7 +1,7 @@ import {FC, useEffect} from 'react'; import {useStore as useRenderStore} from 'state/annotate/render'; -import {useStore as useAnnoStore} from 'state/annotate/annotation'; +import {useAnnoStore} from 'state/annotate/annotation'; export const Testing: FC = () => { useEffect(() => { const annoState = useAnnoStore.getState(); diff --git a/app/frontend/src/component/panel/ActionBar.tsx b/app/frontend/src/component/panel/ActionBar.tsx index b963fbf..a9026f5 100644 --- a/app/frontend/src/component/panel/ActionBar.tsx +++ b/app/frontend/src/component/panel/ActionBar.tsx @@ -23,7 +23,7 @@ import { faChessBoard, } from '@fortawesome/free-solid-svg-icons'; import {useStore as useRenderStore} from 'state/annotate/render'; -import {useTemporalStore as useTemporalAnnoStore} from 'state/annotate/annotation'; +import {useTemporalAnnoStore} from 'state/annotate/annotation'; import {useStore as useUIStore} from 'state/annotate/ui'; import {ConfigContext} from 'common/context'; import {rectFitTransform} from 'common/geometry'; diff --git a/app/frontend/src/component/panel/AnnotateLayer.tsx b/app/frontend/src/component/panel/AnnotateLayer.tsx index 7abf872..dc86218 100644 --- a/app/frontend/src/component/panel/AnnotateLayer.tsx +++ b/app/frontend/src/component/panel/AnnotateLayer.tsx @@ -2,7 +2,7 @@ import {FC, useEffect, CSSProperties, useState, HTMLAttributes, useContext} from import shallow from 'zustand/shallow'; import intl from 'react-intl-universal'; -import {useTemporalStore as useTemporalAnnoStore} from 'state/annotate/annotation'; +import {useTemporalAnnoStore} from 'state/annotate/annotation'; import {useStore as useRenderStore} from 'state/annotate/render'; import {useStore as useUIStore} from 'state/annotate/ui'; diff --git a/app/frontend/src/component/panel/ContextMenuMask.tsx b/app/frontend/src/component/panel/ContextMenuMask.tsx index 696bc0a..b551181 100644 --- a/app/frontend/src/component/panel/ContextMenuMask.tsx +++ b/app/frontend/src/component/panel/ContextMenuMask.tsx @@ -5,7 +5,7 @@ import intl from 'react-intl-universal'; import {Dropdown, DropdownProps, App, Space, Tag, MenuProps} from 'antd'; import {ExclamationCircleOutlined} from '@ant-design/icons'; import {css} from '@emotion/react'; -import {getComponent, useStore as useAnnoStore} from 'state/annotate/annotation'; +import {getComponent, useAnnoStore} from 'state/annotate/annotation'; import {useStore as useRenderStore} from 'state/annotate/render'; import {ComponentId, EntityId, MaskComponent, PolychainComponent} from 'type/annotation'; diff --git a/app/frontend/src/component/panel/entity/Card.tsx b/app/frontend/src/component/panel/entity/Card.tsx index 2cdfd47..59a3649 100644 --- a/app/frontend/src/component/panel/entity/Card.tsx +++ b/app/frontend/src/component/panel/entity/Card.tsx @@ -8,7 +8,7 @@ import {css} from '@emotion/react'; import {Space, Card, Typography, Button, Popconfirm, Progress, Spin} from 'antd'; import {EditOutlined, DeleteOutlined} from '@ant-design/icons'; -import {useStore as useAnnoStore} from 'state/annotate/annotation'; +import {useAnnoStore} from 'state/annotate/annotation'; import {useStore as useRenderStore} from 'state/annotate/render'; import {useStore as useUIStore} from 'state/annotate/ui'; diff --git a/app/frontend/src/component/panel/entity/Form.tsx b/app/frontend/src/component/panel/entity/Form.tsx index 6497fc6..994d4ff 100644 --- a/app/frontend/src/component/panel/entity/Form.tsx +++ b/app/frontend/src/component/panel/entity/Form.tsx @@ -2,7 +2,7 @@ import {FC} from 'react'; import intl from 'react-intl-universal'; import {Form, TreeSelect, TreeSelectProps, Space, Tag} from 'antd'; -import {useStore as useAnnoStore} from 'state/annotate/annotation'; +import {useAnnoStore} from 'state/annotate/annotation'; import {useStore as useRenderStore} from 'state/annotate/render'; import {CategoryAbbreviation} from 'component/panel/entity/display'; diff --git a/app/frontend/src/component/panel/entity/List.tsx b/app/frontend/src/component/panel/entity/List.tsx index d6a0979..dbc44e4 100644 --- a/app/frontend/src/component/panel/entity/List.tsx +++ b/app/frontend/src/component/panel/entity/List.tsx @@ -5,7 +5,7 @@ import {produce} from 'immer'; import {Alert, Empty, Space, Tag, Tooltip} from 'antd'; -import {useStore as useAnnoStore, State} from 'state/annotate/annotation'; +import {useAnnoStore, State} from 'state/annotate/annotation'; import {useStore as useRenderStore} from 'state/annotate/render'; import {deepEqual} from 'common/util'; diff --git a/app/frontend/src/component/panel/layer/Hover.tsx b/app/frontend/src/component/panel/layer/Hover.tsx index 109e0ef..b6b59be 100644 --- a/app/frontend/src/component/panel/layer/Hover.tsx +++ b/app/frontend/src/component/panel/layer/Hover.tsx @@ -6,7 +6,7 @@ import shallow from 'zustand/shallow'; import {Key} from 'ts-key-enum'; import {isHotkeyPressed, useHotkeys} from 'react-hotkeys-hook'; -import {useStore as useAnnoStore, getComponent} from 'state/annotate/annotation'; +import {useAnnoStore, getComponent} from 'state/annotate/annotation'; import {useStore as useRenderStore} from 'state/annotate/render'; import {useStore as useUIStore} from 'state/annotate/ui'; diff --git a/app/frontend/src/component/panel/layer/Idle.tsx b/app/frontend/src/component/panel/layer/Idle.tsx index 0bde594..ec1fa29 100644 --- a/app/frontend/src/component/panel/layer/Idle.tsx +++ b/app/frontend/src/component/panel/layer/Idle.tsx @@ -4,10 +4,10 @@ import intl from 'react-intl-universal'; import {v4 as uuidv4} from 'uuid'; import {message} from 'antd'; -import {useTemporalStore as useTemporalAnnoStore} from 'state/annotate/annotation'; +import {useTemporalAnnoStore} from 'state/annotate/annotation'; import {EntityComponentId, useStore as useRenderStore} from 'state/annotate/render'; import {useStore as useUIStore} from 'state/annotate/ui'; -import {useStore as useAnnoStore} from 'state/annotate/annotation'; +import {useAnnoStore} from 'state/annotate/annotation'; import {useStore as useEditPolyStore} from 'state/annotate/polychain/edit'; import {useStore as useEditRectStore} from 'state/annotate/rectangle/edit'; diff --git a/app/frontend/src/component/panel/layer/Surround.tsx b/app/frontend/src/component/panel/layer/Surround.tsx index 9bd025d..36beb98 100644 --- a/app/frontend/src/component/panel/layer/Surround.tsx +++ b/app/frontend/src/component/panel/layer/Surround.tsx @@ -1,6 +1,6 @@ import {FC, CanvasHTMLAttributes, useCallback} from 'react'; -import {useStore as useAnnoStore} from 'state/annotate/annotation'; +import {useAnnoStore} from 'state/annotate/annotation'; import {useStore as useRenderStore} from 'state/annotate/render'; import {useKeyPressed} from 'common/keyboard'; diff --git a/app/frontend/src/component/panel/layer/Translate.tsx b/app/frontend/src/component/panel/layer/Translate.tsx index d7c7773..b525367 100644 --- a/app/frontend/src/component/panel/layer/Translate.tsx +++ b/app/frontend/src/component/panel/layer/Translate.tsx @@ -1,7 +1,7 @@ import {FC, useCallback, useState, HTMLAttributes, useMemo, useRef} from 'react'; import shallow from 'zustand/shallow'; -import {getComponent, useStore as useAnnoStore} from 'state/annotate/annotation'; +import {getComponent, useAnnoStore} from 'state/annotate/annotation'; import {useStore as useRenderStore} from 'state/annotate/render'; import {TranslateData} from 'state/annotate/render/translate'; diff --git a/app/frontend/src/component/panel/layer/mask/common.ts b/app/frontend/src/component/panel/layer/mask/common.ts index d76917f..c32f5a7 100644 --- a/app/frontend/src/component/panel/layer/mask/common.ts +++ b/app/frontend/src/component/panel/layer/mask/common.ts @@ -4,7 +4,7 @@ import shallow from 'zustand/shallow'; import {coordinatesImageToCanvas} from 'common/geometry'; import {ViewportTransform} from 'state/annotate/render/viewport'; import {useStore as useRenderStore} from 'state/annotate/render'; -import {UpdateSliceMasksInput, useStore as useAnnoStore} from 'state/annotate/annotation'; +import {UpdateSliceMasksInput, useAnnoStore} from 'state/annotate/annotation'; import {ComponentId, EntityId, MaskComponent} from 'type/annotation'; import {editStyle} from 'common/constant'; import {ColorPalette} from 'component/panel/entity/display'; diff --git a/app/frontend/src/component/panel/layer/polychain/Draw.tsx b/app/frontend/src/component/panel/layer/polychain/Draw.tsx index e1f4ac1..5e69622 100644 --- a/app/frontend/src/component/panel/layer/polychain/Draw.tsx +++ b/app/frontend/src/component/panel/layer/polychain/Draw.tsx @@ -7,7 +7,7 @@ import intl from 'react-intl-universal'; import shallow from 'zustand/shallow'; import {v4 as uuidv4} from 'uuid'; -import {getComponent, useStore as useAnnoStore} from 'state/annotate/annotation'; +import {getComponent, useAnnoStore} from 'state/annotate/annotation'; import {useStore as useUIStore} from 'state/annotate/ui'; import {useStore as useRenderStore} from 'state/annotate/render'; import {useStore as useDrawStore, useTemporalStore as useTemporalDrawStore} from 'state/annotate/polychain/draw'; diff --git a/app/frontend/src/component/panel/layer/polychain/Edit.tsx b/app/frontend/src/component/panel/layer/polychain/Edit.tsx index 8e248a1..5fd7e1e 100644 --- a/app/frontend/src/component/panel/layer/polychain/Edit.tsx +++ b/app/frontend/src/component/panel/layer/polychain/Edit.tsx @@ -1,7 +1,7 @@ import {FC, useCallback, CanvasHTMLAttributes, useState} from 'react'; import shallow from 'zustand/shallow'; -import {useStore as useAnnoStore} from 'state/annotate/annotation'; +import {useAnnoStore} from 'state/annotate/annotation'; import {useStore as useRenderStore} from 'state/annotate/render'; import {useStore as useEditStore} from 'state/annotate/polychain/edit'; diff --git a/app/frontend/src/component/panel/layer/rectangle/Draw.tsx b/app/frontend/src/component/panel/layer/rectangle/Draw.tsx index 12d4c49..33077e3 100644 --- a/app/frontend/src/component/panel/layer/rectangle/Draw.tsx +++ b/app/frontend/src/component/panel/layer/rectangle/Draw.tsx @@ -7,7 +7,7 @@ import {editStyle} from 'common/constant'; import {useDrawRect} from 'common/render'; import {coordinatesCanvasToImage, limitCoordinates} from 'common/geometry'; -import {useStore as useAnnoStore} from 'state/annotate/annotation'; +import {useAnnoStore} from 'state/annotate/annotation'; import {useStore as useRenderStore} from 'state/annotate/render'; import {useStore as useDrawStore} from 'state/annotate/rectangle/draw'; import {ColorPalette} from 'component/panel/entity/display'; diff --git a/app/frontend/src/component/panel/layer/rectangle/Edit.tsx b/app/frontend/src/component/panel/layer/rectangle/Edit.tsx index 4182e77..b45c1ba 100644 --- a/app/frontend/src/component/panel/layer/rectangle/Edit.tsx +++ b/app/frontend/src/component/panel/layer/rectangle/Edit.tsx @@ -6,7 +6,7 @@ import {useDrawRect} from 'common/render'; import {editStyle} from 'common/constant'; import {coordinatesCanvasToImage, limitCoordinates} from 'common/geometry'; -import {useStore as useAnnoStore} from 'state/annotate/annotation'; +import {useAnnoStore} from 'state/annotate/annotation'; import {useStore as useRenderStore} from 'state/annotate/render'; import {useStore as useEditStore, Data} from 'state/annotate/rectangle/edit'; import {ColorPalette} from 'component/panel/entity/display'; diff --git a/app/frontend/src/component/panel/menu/common.ts b/app/frontend/src/component/panel/menu/common.ts index 6cec3d9..2558369 100644 --- a/app/frontend/src/component/panel/menu/common.ts +++ b/app/frontend/src/component/panel/menu/common.ts @@ -3,7 +3,7 @@ import {App} from 'antd'; import intl from 'react-intl-universal'; import {v4 as uuidv4} from 'uuid'; -import {getSlice, useStore as useAnnoStore} from 'state/annotate/annotation'; +import {getSlice, useAnnoStore} from 'state/annotate/annotation'; import {useStore as useRenderStore} from 'state/annotate/render'; import type {EntityId, ComponentId} from 'type/annotation'; diff --git a/app/frontend/src/component/panel/menu/mask.ts b/app/frontend/src/component/panel/menu/mask.ts index 16b36c6..0a40ca5 100644 --- a/app/frontend/src/component/panel/menu/mask.ts +++ b/app/frontend/src/component/panel/menu/mask.ts @@ -3,7 +3,7 @@ import {v4 as uuidv4} from 'uuid'; import {Component, EntityId, MaskComponent, SliceIndex} from 'type/annotation'; import {useStore as useUIStore} from 'state/annotate/ui'; import {useStore as useRenderStore} from 'state/annotate/render'; -import {useStore as useAnnoStore} from 'state/annotate/annotation'; +import {useAnnoStore} from 'state/annotate/annotation'; import {Action} from './common'; import {useCallback, useContext} from 'react'; import {ConfigContext} from 'common/context'; diff --git a/app/frontend/src/component/panel/menu/polychain.ts b/app/frontend/src/component/panel/menu/polychain.ts index 865f5fc..da5bef8 100644 --- a/app/frontend/src/component/panel/menu/polychain.ts +++ b/app/frontend/src/component/panel/menu/polychain.ts @@ -1,7 +1,7 @@ import intl from 'react-intl-universal'; import shallow from 'zustand/shallow'; import {useStore as useRenderStore} from 'state/annotate/render'; -import {useStore as useAnnoStore} from 'state/annotate/annotation'; +import {useAnnoStore} from 'state/annotate/annotation'; import {PolychainComponent} from 'type/annotation'; import {Action} from './common'; diff --git a/app/frontend/src/page/annotate/Panel/Load.tsx b/app/frontend/src/page/annotate/Panel/Load.tsx index 2251571..8ceab1b 100644 --- a/app/frontend/src/page/annotate/Panel/Load.tsx +++ b/app/frontend/src/page/annotate/Panel/Load.tsx @@ -2,7 +2,7 @@ import {FC, useContext, useEffect, useState} from 'react'; import intl from 'react-intl-universal'; import {Alert} from 'antd'; import {useStore as useRenderStore} from 'state/annotate/render'; -import {useStore as useAnnoStore} from 'state/annotate/annotation'; +import {useAnnoStore} from 'state/annotate/annotation'; import {useGetVideoAnnotationYjs} from 'state/server/annotation'; import {useGetVideo} from 'state/server/video'; import {NutshClientContext} from 'common/context'; diff --git a/app/frontend/src/state/annotate/annotation-broadcast.ts b/app/frontend/src/state/annotate/annotation-broadcast.ts index 68ac4a2..18b2fd4 100644 --- a/app/frontend/src/state/annotate/annotation-broadcast.ts +++ b/app/frontend/src/state/annotate/annotation-broadcast.ts @@ -26,7 +26,7 @@ import { UpdatePolychainVerticesInput, UpdateRectangleAnchorsInput, UpdateSliceMasksInput, - useStore, + useAnnoStore, } from './annotation'; import {encodeEntityCategoryMapKey, yjsEntityCategoriesMap} from 'common/yjs/docs/entity'; import {useYjsContext} from 'common/yjs/context'; @@ -36,7 +36,7 @@ import {yjsPolychainVerticesMap} from 'common/yjs/docs/polychain'; import {yjsMaskMap} from 'common/yjs/docs/mask'; export function useAnnoBroadcastStore(key: K): StateManipulation[K] { - const fn1 = useStore(s => s[key]); + const fn1 = useAnnoStore(s => s[key]); const fn2 = useAnnoBroadcast()[key]; // eslint-disable-next-line @typescript-eslint/no-explicit-any -- the input is indeed known byt ts fails to infer diff --git a/app/frontend/src/state/annotate/annotation.ts b/app/frontend/src/state/annotate/annotation.ts index f510808..d9faf96 100644 --- a/app/frontend/src/state/annotate/annotation.ts +++ b/app/frontend/src/state/annotate/annotation.ts @@ -166,7 +166,7 @@ export type UpdateSliceMasksInput = { const emptyAnnotation: Annotation = {entities: {}}; -export const useStore = create()( +export const useAnnoStore = create()( temporal( subscribeWithSelector( immer(set => ({ @@ -418,7 +418,7 @@ export const useStore = create()( ) ); -export const useTemporalStore = create(useStore.temporal); +export const useTemporalAnnoStore = create(useAnnoStore.temporal); function addComponent(s: State, sliceIndex: SliceIndex, entityId: EntityId, component: Component) { addAnnotationComponent(s.annotation, sliceIndex, entityId, component);