2025-02-26 15:12:15 +01:00
|
|
|
import { defineStore, storeToRefs } from 'pinia';
|
|
|
|
|
import { ref, watch } from 'vue';
|
|
|
|
|
import { usePageStore } from './page';
|
|
|
|
|
import { useDialogStore } from './dialog';
|
2024-11-21 10:08:37 +01:00
|
|
|
|
2025-02-26 15:12:15 +01:00
|
|
|
export const useVirtualSampleStore = defineStore('virtual-sample', () => {
|
2024-11-21 13:20:57 +01:00
|
|
|
const { page } = usePageStore();
|
2025-02-26 15:12:15 +01:00
|
|
|
const { openedFile } = storeToRefs(useDialogStore());
|
|
|
|
|
const step = page.steps.find((step) => step.id === 'virtualSample');
|
2024-12-20 15:52:42 +01:00
|
|
|
const isCompareModeEnabled = ref(false);
|
2024-11-21 13:20:57 +01:00
|
|
|
|
2025-02-26 15:12:15 +01:00
|
|
|
const activeTab = ref(step.files.dynamic ? 'dynamic' : 'static');
|
2024-12-20 09:26:48 +01:00
|
|
|
const currentFile = ref(null);
|
|
|
|
|
const isLoopAnimationEnabled = ref(false);
|
2025-01-07 16:54:08 +01:00
|
|
|
const isDownloadTriggered = ref(false);
|
2024-12-20 09:26:48 +01:00
|
|
|
|
2024-11-21 10:08:37 +01:00
|
|
|
watch(activeTab, () => (currentFile.value = null));
|
|
|
|
|
|
2024-12-20 15:52:42 +01:00
|
|
|
return {
|
|
|
|
|
activeTab,
|
|
|
|
|
currentFile,
|
|
|
|
|
step,
|
|
|
|
|
isLoopAnimationEnabled,
|
|
|
|
|
isCompareModeEnabled,
|
2025-01-07 16:54:08 +01:00
|
|
|
isDownloadTriggered,
|
2024-12-20 15:52:42 +01:00
|
|
|
};
|
2024-11-21 10:08:37 +01:00
|
|
|
});
|