Skip to content

Commit 5b21aef

Browse files
committed
fix lint and actions
1 parent cf72358 commit 5b21aef

File tree

10 files changed

+22
-20
lines changed

10 files changed

+22
-20
lines changed

src/app/src/components/content/ContentEditor.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const props = defineProps({
1717
},
1818
})
1919
20-
const { draftDocuments } = useStudio()
20+
const { documentTree } = useStudio()
2121
2222
const document = computed<DatabasePageItem>({
2323
get() {
@@ -47,7 +47,7 @@ const document = computed<DatabasePageItem>({
4747
return
4848
}
4949
50-
draftDocuments.update(props.draftItem.id, {
50+
documentTree.draft.update(props.draftItem.id, {
5151
...toRaw(document.value as DatabasePageItem),
5252
...toRaw(value),
5353
})

src/app/src/components/content/ContentEditorCode.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ function setContent(document: DatabasePageItem) {
9999
const position = editor.value.getPosition()
100100
editor.value.getModel()?.setValue(md || '')
101101
// Restore the cursor position
102-
position && editor.value.setPosition(position)
102+
if (position) {
103+
editor.value.setPosition(position)
104+
}
103105
}
104106
105107
currentDocumentId.value = document.id

src/app/src/composables/useContext.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { createSharedComposable } from '@vueuse/core'
22
import { computed, ref } from 'vue'
3-
import { type UploadMediaParams, type CreateFileParams, type StudioHost, type StudioAction, type TreeItem, StudioItemActionId, type ActionHandlerParams, StudioFeature } from '../types'
3+
import { type UploadMediaParams, type CreateFileParams, type StudioHost, type StudioAction, type TreeItem, StudioItemActionId, type ActionHandlerParams } from '../types'
44
import { oneStepActions, STUDIO_ITEM_ACTION_DEFINITIONS, twoStepActions } from '../utils/context'
55
import { useModal } from './useModal'
66
import type { useTree } from './useTree'
77
import { useRoute } from 'vue-router'
88
import { findDescendantsFileItemsFromId } from '../utils/tree'
9-
import { useDraftMedias } from './useDraftMedias'
9+
import type { useDraftMedias } from './useDraftMedias'
1010

1111
export const useContext = createSharedComposable((
1212
host: StudioHost,

src/app/src/composables/useStudio.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ export const useStudio = createSharedComposable(() => {
4848
})
4949
})
5050

51-
5251
return {
5352
isReady,
5453
host,

src/app/src/composables/useTree.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ export const useTree = (type: StudioFeature, host: StudioHost, draft: ReturnType
9393
hooks.hook('studio:draft:document:updated', async () => {
9494
await handleDraftUpdate()
9595
})
96-
} else {
96+
}
97+
else {
9798
hooks.hook('studio:draft:media:updated', async () => {
9899
await handleDraftUpdate()
99100
})
@@ -109,6 +110,6 @@ export const useTree = (type: StudioFeature, host: StudioHost, draft: ReturnType
109110
selectItemById,
110111
selectParentById,
111112
type,
112-
draft
113+
draft,
113114
}
114115
}

src/app/src/composables/useUI.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,12 @@ export const useUI = createSharedComposable((host: StudioHost) => {
1818
}
1919
})
2020

21-
2221
return {
2322
config,
2423
sidebar,
2524
isOpen,
2625
currentPanel,
27-
open(panel?: StudioFeature){
26+
open(panel?: StudioFeature) {
2827
currentPanel.value = panel || currentPanel.value || StudioFeature.Content
2928
isOpen.value = true
3029
},

src/app/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { VueElementConstructor } from 'vue'
22
import { defineCustomElement } from 'vue'
33
import { createRouter, createMemoryHistory } from 'vue-router'
44

5-
// @ts-ignore
5+
// @ts-expect-error -- inline css
66
import styles from './assets/css/main.css?inline'
77

88
import { createHead } from '@unhead/vue/client'

src/app/src/types/components.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import type { ComponentData } from 'nuxt-component-meta'
22

33
export interface ComponentMeta {
4-
name: string,
5-
path: string,
4+
name: string
5+
path: string
66
meta: {
7-
props: ComponentData['meta']['props'],
8-
slots: ComponentData['meta']['slots'],
9-
events: ComponentData['meta']['events'],
10-
},
7+
props: ComponentData['meta']['props']
8+
slots: ComponentData['meta']['slots']
9+
events: ComponentData['meta']['events']
10+
}
1111
}

src/app/vite.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ export default defineConfig({
1818
ui({
1919
theme: {
2020
defaultVariants: {
21-
size: 'sm'
22-
}
21+
size: 'sm',
22+
},
2323
},
2424
ui: {
2525
colors: {

src/module/src/runtime/utils/activation.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ export async function defineStudioActivationPlugin(onStudioActivation: (user: St
1919
}
2020
else if (mounted) {
2121
window.location.reload()
22-
} else {
22+
}
23+
else {
2324
// Listen to CMD + . to toggle the studio or redirect to the login page
2425
document.addEventListener('keydown', (event) => {
2526
if (event.metaKey && event.key === '.') {

0 commit comments

Comments
 (0)