refactor(*): generalize events
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { OnboardingDialog, OnboardingStepAnalyticsNotice, ToasterRoot } from '@proj-airi/stage-ui/components'
|
||||
import { useAuthProviderSync } from '@proj-airi/stage-ui/composables/use-auth-provider-sync'
|
||||
import { isAnalyticsAvailableInBuild, useSharedAnalyticsStore } from '@proj-airi/stage-ui/stores/analytics'
|
||||
import { initializeAnalytics, isAnalyticsAvailableInBuild } from '@proj-airi/stage-ui/libs/analytics'
|
||||
import { useCharacterOrchestratorStore } from '@proj-airi/stage-ui/stores/character'
|
||||
import { useDisplayModelsStore } from '@proj-airi/stage-ui/stores/display-models'
|
||||
import { useModsServerChannelStore } from '@proj-airi/stage-ui/stores/mods/api/channel-server'
|
||||
@@ -35,7 +35,6 @@ const settingsAudioDeviceStore = useSettingsAudioDevice()
|
||||
const { showingSetup } = storeToRefs(onboardingStore)
|
||||
const { isDark } = useTheme()
|
||||
const cardStore = useAiriCardStore()
|
||||
const analyticsStore = useSharedAnalyticsStore()
|
||||
|
||||
const primaryColor = computed(() => {
|
||||
return isDark.value
|
||||
@@ -73,7 +72,7 @@ watch(settings.themeColorsHueDynamic, () => {
|
||||
|
||||
// Initialize first-time setup check when app mounts
|
||||
onMounted(async () => {
|
||||
analyticsStore.initialize()
|
||||
initializeAnalytics()
|
||||
await displayModelsStore.initialize()
|
||||
cardStore.initialize()
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import NProgress from 'nprogress'
|
||||
import { autoAnimatePlugin } from '@formkit/auto-animate/vue'
|
||||
import { isEnvTruthy } from '@proj-airi/stage-shared'
|
||||
import { trackButtonPlugin } from '@proj-airi/stage-ui/directives/track-button'
|
||||
import { configureAnalyticsAdapter } from '@proj-airi/stage-ui/stores/analytics/client'
|
||||
import { configureAnalyticsAdapter } from '@proj-airi/stage-ui/libs/analytics'
|
||||
import { MotionPlugin } from '@vueuse/motion'
|
||||
import { createPinia } from 'pinia'
|
||||
import { setupLayouts } from 'virtual:generated-layouts'
|
||||
@@ -29,7 +29,7 @@ import './styles/main.css'
|
||||
import 'uno.css'
|
||||
|
||||
configureAnalyticsAdapter(async (options) => {
|
||||
const { createPosthogAdapter } = await import('@proj-airi/stage-ui/stores/analytics/posthog')
|
||||
const { createPosthogAdapter } = await import('@proj-airi/stage-ui/libs/analytics/posthog')
|
||||
return createPosthogAdapter(options)
|
||||
})
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ import { artistrySyncConfig } from '@proj-airi/stage-shared'
|
||||
import { ToasterRoot } from '@proj-airi/stage-ui/components'
|
||||
import { useInferencePreload } from '@proj-airi/stage-ui/composables'
|
||||
import { useAuthProviderSync } from '@proj-airi/stage-ui/composables/use-auth-provider-sync'
|
||||
import { initializeAnalytics } from '@proj-airi/stage-ui/libs/analytics'
|
||||
import { usePiniaSynced } from '@proj-airi/stage-ui/libs/pinia'
|
||||
import { useSharedAnalyticsStore } from '@proj-airi/stage-ui/stores/analytics'
|
||||
import { useCharacterOrchestratorStore } from '@proj-airi/stage-ui/stores/character'
|
||||
import { useChatStore } from '@proj-airi/stage-ui/stores/chat'
|
||||
import { useChatSessionStore } from '@proj-airi/stage-ui/stores/chat/session-store'
|
||||
@@ -119,7 +119,6 @@ function createFullStageRuntime() {
|
||||
const cardStore = useAiriCardStore()
|
||||
const serverChannelStore = useModsServerChannelStore()
|
||||
const characterOrchestratorStore = useCharacterOrchestratorStore()
|
||||
const analyticsStore = useSharedAnalyticsStore()
|
||||
const inferencePreload = useInferencePreload()
|
||||
const pluginHostInspectorStore = usePluginHostInspectorStore()
|
||||
const stageWindowLifecycleStore = useStageWindowLifecycleStore()
|
||||
@@ -214,7 +213,7 @@ function createFullStageRuntime() {
|
||||
|
||||
return {
|
||||
async initialize() {
|
||||
analyticsStore.initialize()
|
||||
initializeAnalytics()
|
||||
await displayModelsStore.initialize()
|
||||
cardStore.initialize()
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ import Tres from '@tresjs/core'
|
||||
import { autoAnimatePlugin } from '@formkit/auto-animate/vue'
|
||||
import { PiniaColada } from '@pinia/colada'
|
||||
import { trackButtonPlugin } from '@proj-airi/stage-ui/directives/track-button'
|
||||
import { configureAnalyticsAdapter } from '@proj-airi/stage-ui/libs/analytics'
|
||||
import { setupSynced } from '@proj-airi/stage-ui/libs/pinia'
|
||||
import { configureAnalyticsAdapter } from '@proj-airi/stage-ui/stores/analytics/client'
|
||||
import { MotionPlugin } from '@vueuse/motion'
|
||||
import { createPinia } from 'pinia'
|
||||
import { setupLayouts } from 'virtual:generated-layouts'
|
||||
@@ -40,7 +40,7 @@ import '@fontsource/m-plus-rounded-1c/index.css'
|
||||
import '@fontsource-variable/nunito/index.css'
|
||||
|
||||
configureAnalyticsAdapter(async (options) => {
|
||||
const { createPosthogAdapter } = await import('@proj-airi/stage-ui/stores/analytics/posthog')
|
||||
const { createPosthogAdapter } = await import('@proj-airi/stage-ui/libs/analytics/posthog')
|
||||
return createPosthogAdapter(options)
|
||||
})
|
||||
|
||||
|
||||
@@ -7,11 +7,9 @@ import semver from 'semver'
|
||||
|
||||
import { useElectronAutoUpdater, useElectronEventaInvoke } from '@proj-airi/electron-vueuse'
|
||||
import { AboutContent, BugReportDialog, createBugReportPageContext, MarkdownRenderer } from '@proj-airi/stage-ui/components'
|
||||
import { useAnalytics, useBreakpoints } from '@proj-airi/stage-ui/composables'
|
||||
import { useSharedAnalyticsStore } from '@proj-airi/stage-ui/stores/analytics'
|
||||
import { useAnalytics, useBreakpoints, useBuildInfo } from '@proj-airi/stage-ui/composables'
|
||||
import { Button, ContainerError, DoubleCheckButton, FieldSelect, Progress } from '@proj-airi/ui'
|
||||
import { useClipboard } from '@vueuse/core'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { DialogContent, DialogDescription, DialogOverlay, DialogPortal, DialogRoot, DialogTitle } from 'reka-ui'
|
||||
import { DrawerContent, DrawerDescription, DrawerHandle, DrawerOverlay, DrawerPortal, DrawerRoot, DrawerTitle } from 'vaul-vue'
|
||||
import { computed, onMounted, ref, watch } from 'vue'
|
||||
@@ -19,8 +17,7 @@ import { useI18n } from 'vue-i18n'
|
||||
|
||||
import { electronGetUpdaterPreferences, electronSetUpdaterPreferences } from '../../shared/eventa'
|
||||
|
||||
const analyticsStore = useSharedAnalyticsStore()
|
||||
const { buildInfo } = storeToRefs(analyticsStore)
|
||||
const buildInfo = useBuildInfo()
|
||||
const { t } = useI18n()
|
||||
const { copy: copyToClipboard, isSupported: isClipboardSupported } = useClipboard()
|
||||
|
||||
@@ -115,7 +112,7 @@ function normalizeSemver(version: string | undefined) {
|
||||
}
|
||||
|
||||
const isDowngradeUpdate = computed(() => {
|
||||
const currentVersion = normalizeSemver(buildInfo.value.version)
|
||||
const currentVersion = normalizeSemver(buildInfo.version)
|
||||
const targetVersion = normalizeSemver(updateState.value.info?.version)
|
||||
if (!currentVersion || !targetVersion)
|
||||
return false
|
||||
@@ -152,7 +149,7 @@ function confirmDownload() {
|
||||
|
||||
function openBugReportDialog() {
|
||||
const details = [
|
||||
`Current version: ${buildInfo.value.version}`,
|
||||
`Current version: ${buildInfo.version}`,
|
||||
`Update status: ${updateState.value.status}`,
|
||||
updaterErrorMessage.value ? `Error: ${updaterErrorMessage.value}` : '',
|
||||
]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { useElectronEventaInvoke } from '@proj-airi/electron-vueuse'
|
||||
import { OnboardingScreen, OnboardingStepAnalyticsNotice } from '@proj-airi/stage-ui/components'
|
||||
import { isAnalyticsAvailableInBuild } from '@proj-airi/stage-ui/stores/analytics'
|
||||
import { isAnalyticsAvailableInBuild } from '@proj-airi/stage-ui/libs/analytics'
|
||||
import { useAuthStore } from '@proj-airi/stage-ui/stores/auth'
|
||||
import { useOnboardingStore } from '@proj-airi/stage-ui/stores/onboarding'
|
||||
import { useTheme } from '@proj-airi/ui'
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { OnboardingDialog, OnboardingStepAnalyticsNotice, ToasterRoot } from '@proj-airi/stage-ui/components'
|
||||
import { useInferencePreload } from '@proj-airi/stage-ui/composables'
|
||||
import { useAuthProviderSync } from '@proj-airi/stage-ui/composables/use-auth-provider-sync'
|
||||
import { isAnalyticsAvailableInBuild, useSharedAnalyticsStore } from '@proj-airi/stage-ui/stores/analytics'
|
||||
import { initializeAnalytics, isAnalyticsAvailableInBuild } from '@proj-airi/stage-ui/libs/analytics'
|
||||
import { useCharacterOrchestratorStore } from '@proj-airi/stage-ui/stores/character'
|
||||
import { useChatSessionStore } from '@proj-airi/stage-ui/stores/chat/session-store'
|
||||
import { useDisplayModelsStore } from '@proj-airi/stage-ui/stores/display-models'
|
||||
@@ -39,7 +39,6 @@ const settingsAudioDeviceStore = useSettingsAudioDevice()
|
||||
const { showingSetup } = storeToRefs(onboardingStore)
|
||||
const { isDark } = useTheme()
|
||||
const cardStore = useAiriCardStore()
|
||||
const analyticsStore = useSharedAnalyticsStore()
|
||||
const inferencePreload = useInferencePreload()
|
||||
|
||||
const primaryColor = computed(() => {
|
||||
@@ -84,7 +83,7 @@ watch(settings.themeColorsHueDynamic, () => {
|
||||
|
||||
// Initialize first-time setup check when app mounts
|
||||
onMounted(async () => {
|
||||
analyticsStore.initialize()
|
||||
initializeAnalytics()
|
||||
await displayModelsStore.initialize()
|
||||
cardStore.initialize()
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ import { autoAnimatePlugin } from '@formkit/auto-animate/vue'
|
||||
import { PiniaColada } from '@pinia/colada'
|
||||
import { isEnvTruthy } from '@proj-airi/stage-shared'
|
||||
import { trackButtonPlugin } from '@proj-airi/stage-ui/directives/track-button'
|
||||
import { configureAnalyticsAdapter } from '@proj-airi/stage-ui/libs/analytics'
|
||||
import { setupSynced } from '@proj-airi/stage-ui/libs/pinia'
|
||||
import { configureAnalyticsAdapter } from '@proj-airi/stage-ui/stores/analytics/client'
|
||||
import { MotionPlugin } from '@vueuse/motion'
|
||||
import { createPinia } from 'pinia'
|
||||
import { setupLayouts } from 'virtual:generated-layouts'
|
||||
@@ -30,7 +30,7 @@ import './styles/main.css'
|
||||
import 'uno.css'
|
||||
|
||||
configureAnalyticsAdapter(async (options) => {
|
||||
const { createPosthogAdapter } = await import('@proj-airi/stage-ui/stores/analytics/posthog')
|
||||
const { createPosthogAdapter } = await import('@proj-airi/stage-ui/libs/analytics/posthog')
|
||||
return createPosthogAdapter(options)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user