forked from yikoyu/vuetify-pro-tiptap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfullscreen.ts
33 lines (29 loc) · 832 Bytes
/
fullscreen.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import type { GeneralOptions } from '@/type'
import { Extension } from '@tiptap/core'
import FullscreenActionButton from './components/FullscreenActionButton.vue'
/**
* Represents the interface for fullscreen options, extending GeneralOptions.
*/
export interface FullscreenOptions extends GeneralOptions<FullscreenOptions> {
/**
* Indicates whether to use window fullscreen mode
*
* @default false
*/
useWindow: boolean
}
export const Fullscreen = /* @__PURE__*/ Extension.create<FullscreenOptions>({
name: 'fullscreen',
addOptions() {
return {
...this.parent?.(),
useWindow: false,
button: ({ editor, extension, t }) => ({
component: FullscreenActionButton,
componentProps: {
useWindow: extension.options.useWindow ?? false
}
})
}
}
})