summaryrefslogtreecommitdiff
path: root/apps/web/src/components/editor/panels/properties/stores
diff options
context:
space:
mode:
Diffstat (limited to 'apps/web/src/components/editor/panels/properties/stores')
-rw-r--r--apps/web/src/components/editor/panels/properties/stores/properties-store.ts44
1 files changed, 25 insertions, 19 deletions
diff --git a/apps/web/src/components/editor/panels/properties/stores/properties-store.ts b/apps/web/src/components/editor/panels/properties/stores/properties-store.ts
index f6304349..3303dae2 100644
--- a/apps/web/src/components/editor/panels/properties/stores/properties-store.ts
+++ b/apps/web/src/components/editor/panels/properties/stores/properties-store.ts
@@ -1,19 +1,25 @@
-import { create } from "zustand";
-
-interface PropertiesState {
- activeTabPerType: Record<string, string>;
- setActiveTab: (args: { elementType: string; tabId: string }) => void;
- isTransformScaleLocked: boolean;
- setTransformScaleLocked: (args: { locked: boolean }) => void;
-}
-
-export const usePropertiesStore = create<PropertiesState>()((set) => ({
- activeTabPerType: {},
- setActiveTab: ({ elementType, tabId }) =>
- set((state) => ({
- activeTabPerType: { ...state.activeTabPerType, [elementType]: tabId },
- })),
- isTransformScaleLocked: false,
- setTransformScaleLocked: ({ locked }) =>
- set({ isTransformScaleLocked: locked }),
-}));
+import { create } from "zustand";
+
+interface PropertiesState {
+ activeTabPerType: Record<string, string>;
+ setActiveTab: (args: { elementType: string; tabId: string }) => void;
+ isTransformScaleLocked: boolean;
+ setTransformScaleLocked: (args: { locked: boolean }) => void;
+ selectedTrackId: string | null;
+ selectTrack: ({ trackId }: { trackId: string }) => void;
+ clearTrackSelection: () => void;
+}
+
+export const usePropertiesStore = create<PropertiesState>()((set) => ({
+ activeTabPerType: {},
+ setActiveTab: ({ elementType, tabId }) =>
+ set((state) => ({
+ activeTabPerType: { ...state.activeTabPerType, [elementType]: tabId },
+ })),
+ isTransformScaleLocked: false,
+ setTransformScaleLocked: ({ locked }) =>
+ set({ isTransformScaleLocked: locked }),
+ selectedTrackId: null,
+ selectTrack: ({ trackId }) => set({ selectedTrackId: trackId }),
+ clearTrackSelection: () => set({ selectedTrackId: null }),
+}));