v-notion-editor 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +371 -0
- package/components/Button.vue.d.ts +119 -0
- package/components/Dropdown.vue.d.ts +72 -0
- package/components/DropdownMenu.vue.d.ts +69 -0
- package/components/Icon.vue.d.ts +19 -0
- package/components/NotesEditor.vue.d.ts +33 -0
- package/components/NotesSlashMenu.vue.d.ts +21 -0
- package/components/NotesToolbar/AlignmentToolbar.vue.d.ts +19 -0
- package/components/NotesToolbar/BlockToolbar.vue.d.ts +19 -0
- package/components/NotesToolbar/ImageToolbar.vue.d.ts +17 -0
- package/components/NotesToolbar/InsertToolbar.vue.d.ts +19 -0
- package/components/NotesToolbar/LinkToolTip.vue.d.ts +17 -0
- package/components/NotesToolbar/ListToolbar.vue.d.ts +19 -0
- package/components/NotesToolbar/NotesBubleMenu.vue.d.ts +17 -0
- package/components/NotesToolbar/NotesColorPicker.vue.d.ts +17 -0
- package/components/NotesToolbar/NotesToolbar.vue.d.ts +15 -0
- package/components/NotesToolbar/TableToolbar.vue.d.ts +17 -0
- package/components/NotesToolbar/TextFormatToolbar.vue.d.ts +19 -0
- package/components/NotesToolbar/UndoRedoToolbar.vue.d.ts +19 -0
- package/composables/useNotesImageOptions.d.ts +9 -0
- package/composables/useNotesImageUpload.d.ts +42 -0
- package/composables/useNotesStates.d.ts +2 -0
- package/constants/icons.constants.d.ts +44 -0
- package/constants/notes.constants.d.ts +2 -0
- package/extensions/NotesLinkExtention/NotesLinkView.vue.d.ts +60 -0
- package/extensions/NotesSlashCommand.d.ts +10 -0
- package/index.d.ts +4 -0
- package/index.js +33556 -0
- package/package.json +91 -0
- package/style.css +1 -0
- package/types/index.d.ts +37 -0
package/README.md
ADDED
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
# Vue Notion Editor
|
|
2
|
+
|
|
3
|
+
A powerful, feature-rich Vue 3 rich text editor component inspired by Notion, It delivers a complete editing experience with slash commands, context menus, drag-and-drop support, advanced formatting, enhanced tables, and image upload capabilities.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Rich Text Formatting**: Bold, italic, underline, strikethrough, code, and color formatting
|
|
8
|
+
- **Advanced Block Types**: Headings, blockquotes, code blocks, lists, and task lists
|
|
9
|
+
- **Table Support**: Create, edit, and manipulate tables with advanced cell & row operations
|
|
10
|
+
- **Image Handling**: Drag-and-drop image uploads with customizable upload functions
|
|
11
|
+
- **Drag & Drop**: Reorder content blocks with visual drag handles
|
|
12
|
+
- **Slash Commands**: Quick content insertion with "/" command menu
|
|
13
|
+
- **Link Management**: Smart link insertion and editing with bubble menu
|
|
14
|
+
- **Text Alignment**: Left, center, right, and justify alignment options
|
|
15
|
+
- **Collaborative Ready**: Built with Yjs integration support for real-time collaboration
|
|
16
|
+
- **Bubble Menu**: Context-sensitive formatting toolbar
|
|
17
|
+
- **Undo/Redo**: Full history management with keyboard shortcuts
|
|
18
|
+
- **Task Lists**: Interactive checkboxes and task management
|
|
19
|
+
- **File Handler**: Smart paste handling for images and rich content
|
|
20
|
+
- **Customizable**: Flexible styling with CSS variables and custom themes
|
|
21
|
+
- **TypeScript Support**: Fully typed for enhanced developer experience
|
|
22
|
+
|
|
23
|
+
## Demo
|
|
24
|
+
|
|
25
|
+
[Live Demo](https://notes.builto.com)
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# npm
|
|
31
|
+
npm install v-notion-editor
|
|
32
|
+
|
|
33
|
+
# yarn
|
|
34
|
+
yarn add v-notion-editor
|
|
35
|
+
|
|
36
|
+
# pnpm
|
|
37
|
+
pnpm add v-notion-editor
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Basic Usage
|
|
41
|
+
|
|
42
|
+
```vue
|
|
43
|
+
<script setup>
|
|
44
|
+
import { ref } from 'vue'
|
|
45
|
+
import { NotesEditor, NotesToolbar } from 'v-notion-editor'
|
|
46
|
+
import 'v-notion-editor/style.css'
|
|
47
|
+
|
|
48
|
+
const content = ref('<p>Start writing your content here...</p>')
|
|
49
|
+
|
|
50
|
+
const handleImageUpload = async (files) => {
|
|
51
|
+
// Implement your image upload logic
|
|
52
|
+
const fileToBase64 = (file) => {
|
|
53
|
+
return new Promise((resolve, reject) => {
|
|
54
|
+
const reader = new FileReader()
|
|
55
|
+
reader.onload = () => resolve(reader.result)
|
|
56
|
+
reader.onerror = reject
|
|
57
|
+
reader.readAsDataURL(file)
|
|
58
|
+
})
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return await Promise.all(files.map(fileToBase64))
|
|
62
|
+
}
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<template>
|
|
66
|
+
<div>
|
|
67
|
+
<NotesToolbar />
|
|
68
|
+
<NotesEditor
|
|
69
|
+
v-model="content"
|
|
70
|
+
:image-upload-options="{
|
|
71
|
+
onUpload: handleImageUpload,
|
|
72
|
+
maxFileSize: 10 * 1024 * 1024, // 10MB
|
|
73
|
+
quality: 0.85,
|
|
74
|
+
}" />
|
|
75
|
+
</div>
|
|
76
|
+
</template>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## 📁 Importing Styles
|
|
80
|
+
|
|
81
|
+
You must import the CSS styles:
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
import 'v-notion-editor/style.css'
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Components
|
|
88
|
+
|
|
89
|
+
### NotesEditor
|
|
90
|
+
|
|
91
|
+
The main editor component that provides the rich text editing interface.
|
|
92
|
+
|
|
93
|
+
#### Props
|
|
94
|
+
|
|
95
|
+
| Prop | Type | Default | Description |
|
|
96
|
+
| -------------------- | -------------------- | ------- | --------------------------------------- |
|
|
97
|
+
| `modelValue` | `string` | `''` | The HTML content of the editor |
|
|
98
|
+
| `imageUploadOptions` | `ImageUploadOptions` | `{}` | Configuration for image upload handling |
|
|
99
|
+
|
|
100
|
+
#### Events
|
|
101
|
+
|
|
102
|
+
| Event | Parameters | Description |
|
|
103
|
+
| ------------------- | --------------- | ------------------------------- |
|
|
104
|
+
| `update:modelValue` | `value: string` | Emitted when content changes |
|
|
105
|
+
| `onFocus` | - | Emitted when editor gains focus |
|
|
106
|
+
| `onBlur` | - | Emitted when editor loses focus |
|
|
107
|
+
|
|
108
|
+
#### Image Upload Options
|
|
109
|
+
|
|
110
|
+
```typescript
|
|
111
|
+
interface ImageUploadOptions {
|
|
112
|
+
onUpload?: (files: File[]) => Promise<string[]>
|
|
113
|
+
maxFileSize?: number // in bytes, default: 10MB
|
|
114
|
+
quality?: number // 0-1, default: 0.85
|
|
115
|
+
allowedTypes?: string[] // default: ['image/png', 'image/jpeg', 'image/gif', 'image/webp']
|
|
116
|
+
onOpenFileDialog?: (multiple: boolean) => Promise<string[] | File[]> // custom file picker
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### NotesToolbar
|
|
121
|
+
|
|
122
|
+
A comprehensive toolbar component with formatting options.
|
|
123
|
+
|
|
124
|
+
#### Props
|
|
125
|
+
|
|
126
|
+
| Prop | Type | Default | Description |
|
|
127
|
+
| ----------------- | ---------- | --------- | --------------------------------- |
|
|
128
|
+
| `visibleToolbars` | `string[]` | All tools | Array of toolbar items to display |
|
|
129
|
+
|
|
130
|
+
#### Available Toolbar Items
|
|
131
|
+
|
|
132
|
+
`headings`, `bold`, `italic`, `underline`, `strike`, `code`, `color`, `link`, `bulletList`, `orderedList`, `taskList`, `blockquote`, `table`, `align`, `image`, `divider`, `undo`, `redo`
|
|
133
|
+
|
|
134
|
+
## Usage Examples
|
|
135
|
+
|
|
136
|
+
### 1. Custom Toolbar Configuration
|
|
137
|
+
|
|
138
|
+
```vue
|
|
139
|
+
<script setup>
|
|
140
|
+
import { NotesEditor, NotesToolbar } from 'v-notion-editor'
|
|
141
|
+
|
|
142
|
+
const customToolbars = ['headings', 'bold', 'italic', 'bulletList', 'orderedList', 'link', 'image']
|
|
143
|
+
</script>
|
|
144
|
+
|
|
145
|
+
<template>
|
|
146
|
+
<div>
|
|
147
|
+
<NotesToolbar :visible-toolbars="customToolbars" />
|
|
148
|
+
<NotesEditor v-model="content" />
|
|
149
|
+
</div>
|
|
150
|
+
</template>
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### 2. Editor Instance Access
|
|
154
|
+
|
|
155
|
+
```vue
|
|
156
|
+
<script setup>
|
|
157
|
+
import { ref, onMounted } from 'vue'
|
|
158
|
+
import { NotesEditor } from 'v-notion-editor'
|
|
159
|
+
|
|
160
|
+
const editorRef = ref(null)
|
|
161
|
+
|
|
162
|
+
const insertCustomContent = () => {
|
|
163
|
+
const editor = editorRef.value?.editor
|
|
164
|
+
if (editor) {
|
|
165
|
+
editor.chain().focus().insertContent('<p>Custom inserted content!</p>').run()
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const getEditorContent = () => {
|
|
170
|
+
const editor = editorRef.value?.editor
|
|
171
|
+
if (editor) {
|
|
172
|
+
console.log('HTML:', editor.getHTML())
|
|
173
|
+
console.log('JSON:', editor.getJSON())
|
|
174
|
+
console.log('Text:', editor.getText())
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
</script>
|
|
178
|
+
|
|
179
|
+
<template>
|
|
180
|
+
<div>
|
|
181
|
+
<button @click="insertCustomContent">Insert Content</button>
|
|
182
|
+
<button @click="getEditorContent">Get Content</button>
|
|
183
|
+
|
|
184
|
+
<NotesEditor ref="editorRef" v-model="content" />
|
|
185
|
+
</div>
|
|
186
|
+
</template>
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### 3. Read-Only Content Display
|
|
190
|
+
|
|
191
|
+
To display editor content with the same styling in read-only mode, wrap your content with the `v-notion-editor` class:
|
|
192
|
+
|
|
193
|
+
```vue
|
|
194
|
+
<script setup>
|
|
195
|
+
import 'v-notion-editor/style.css'
|
|
196
|
+
|
|
197
|
+
const savedContent = ref(`
|
|
198
|
+
<h1>My Document Title</h1>
|
|
199
|
+
<p>This content will have the same styling as in the editor.</p>
|
|
200
|
+
<blockquote>Important note with proper formatting</blockquote>
|
|
201
|
+
`)
|
|
202
|
+
</script>
|
|
203
|
+
|
|
204
|
+
<template>
|
|
205
|
+
<!-- Read-only content with editor styling -->
|
|
206
|
+
<div class="v-notion-editor">
|
|
207
|
+
<div v-html="savedContent" class="read-mode" />
|
|
208
|
+
</div>
|
|
209
|
+
</template>
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## Keyboard Shortcuts
|
|
213
|
+
|
|
214
|
+
| Shortcut | Action |
|
|
215
|
+
| ---------------------- | ------------------ |
|
|
216
|
+
| `Ctrl/Cmd + B` | Bold |
|
|
217
|
+
| `Ctrl/Cmd + I` | Italic |
|
|
218
|
+
| `Ctrl/Cmd + U` | Underline |
|
|
219
|
+
| `Ctrl/Cmd + Shift + S` | Strikethrough |
|
|
220
|
+
| `Ctrl/Cmd + E` | Code |
|
|
221
|
+
| `Ctrl/Cmd + K` | Link |
|
|
222
|
+
| `Ctrl/Cmd + Z` | Undo |
|
|
223
|
+
| `Ctrl/Cmd + Shift + Z` | Redo |
|
|
224
|
+
| `Ctrl/Cmd + Shift + L` | Bullet List |
|
|
225
|
+
| `Ctrl/Cmd + Shift + O` | Ordered List |
|
|
226
|
+
| `Ctrl/Cmd + Enter` | Hard Break |
|
|
227
|
+
| `/` | Slash command menu |
|
|
228
|
+
|
|
229
|
+
## Slash Commands
|
|
230
|
+
|
|
231
|
+
Type `/` to access quick content insertion:
|
|
232
|
+
|
|
233
|
+
## Styling
|
|
234
|
+
|
|
235
|
+
Customize the editor appearance using CSS variables:
|
|
236
|
+
|
|
237
|
+
```css
|
|
238
|
+
:root {
|
|
239
|
+
/* Editor Base */
|
|
240
|
+
--editor-bg: #ffffff;
|
|
241
|
+
--editor-color: #000000;
|
|
242
|
+
--editor-primary: #dbeafe;
|
|
243
|
+
--editor-primary-fg: #1d4ed8;
|
|
244
|
+
|
|
245
|
+
--editor-secondary: #f7f6f4;
|
|
246
|
+
--editor-secondary-dark: #c2c2bd;
|
|
247
|
+
--editor-border-color: #ececea;
|
|
248
|
+
--editor-btn-size: 1.7em;
|
|
249
|
+
--editor-btn-icon-size: calc(var(--editor-btn-size) - 0.7em);
|
|
250
|
+
--editor-border-radius: 0.5rem;
|
|
251
|
+
--editor-shadow: 0 4px 80px -4px rgba(0, 0, 0, 0.088);
|
|
252
|
+
--spacing-btn-size: var(--editor-btn-size);
|
|
253
|
+
--radius: var(--editor-border-radius);
|
|
254
|
+
|
|
255
|
+
/* Content Colors */
|
|
256
|
+
--editor-content-color-default: #37352f;
|
|
257
|
+
--editor-content-color-gray: #989898;
|
|
258
|
+
--editor-content-color-orange: #ea580c;
|
|
259
|
+
--editor-content-color-yellow: #ecb802;
|
|
260
|
+
--editor-content-color-green: #16a34a;
|
|
261
|
+
--editor-content-color-blue: #2563eb;
|
|
262
|
+
--editor-content-color-purple: #9333ea;
|
|
263
|
+
--editor-content-color-pink: #f64f9f;
|
|
264
|
+
--editor-content-color-red: #e0383e;
|
|
265
|
+
--editor-content-color-white: #ffffff;
|
|
266
|
+
--editor-content-color-heading: #292929;
|
|
267
|
+
--editor-content-color-text: #37352f;
|
|
268
|
+
--editor-content-color-text-secondary: #4f4f4f;
|
|
269
|
+
--editor-content-color-code: #e3342f;
|
|
270
|
+
--editor-content-color-code-block: #272727;
|
|
271
|
+
--editor-content-color-mark: #151413;
|
|
272
|
+
--editor-content-color-primary: #007bff;
|
|
273
|
+
--editor-content-color-primary-dark: #007bff;
|
|
274
|
+
--editor-content-color-primary-dark-light: #007bff;
|
|
275
|
+
--editor-content-color-border: #c8c8c6;
|
|
276
|
+
--editor-content-color-border-dark: #d0d0ce;
|
|
277
|
+
|
|
278
|
+
/* Content Background Colors */
|
|
279
|
+
--editor-content-bg-default: rgba(55, 53, 47, 0.12);
|
|
280
|
+
--editor-content-bg-gray: #d5d7d8;
|
|
281
|
+
--editor-content-bg-yellow: #ffebb4;
|
|
282
|
+
--editor-content-bg-yellow-light: #f3f1eb;
|
|
283
|
+
--editor-content-bg-green: #cbecbf;
|
|
284
|
+
--editor-content-bg-blue: #b4d6ff;
|
|
285
|
+
--editor-content-bg-purple: rgba(105, 64, 165, 0.4);
|
|
286
|
+
--editor-content-bg-pink: #fecbe2;
|
|
287
|
+
--editor-content-bg-red: #ff9898;
|
|
288
|
+
--editor-content-bg-black: #000000;
|
|
289
|
+
--editor-content-bg-secondary: #f7f6f4;
|
|
290
|
+
--editor-content-bg-mark: #fef08a;
|
|
291
|
+
--editor-content-bg-primary: #007bff;
|
|
292
|
+
--editor-content-bg-primary-dark: #0a77ec;
|
|
293
|
+
--editor-content-bg-primary-light: #eff5fd;
|
|
294
|
+
--editor-content-bg-primary-fg: #ffffff;
|
|
295
|
+
|
|
296
|
+
/* Headings */
|
|
297
|
+
--size-font-h1: 2.15em;
|
|
298
|
+
--size-font-h2: 1.65em;
|
|
299
|
+
--size-font-h3: 1.4em;
|
|
300
|
+
--size-font-h4: 1.35em;
|
|
301
|
+
--size-font-h5: 1.3em;
|
|
302
|
+
--size-font-h6: 1.125em;
|
|
303
|
+
--size-line-height-heading: 1.25;
|
|
304
|
+
|
|
305
|
+
/* Table */
|
|
306
|
+
--size-font-table: 1.1em;
|
|
307
|
+
--size-padding-table: 8px 12px;
|
|
308
|
+
--size-padding-table-cell: 0.5em 0.75em;
|
|
309
|
+
--size-table-cell-min-width: 100px;
|
|
310
|
+
--z-index-selected-cell: 2;
|
|
311
|
+
|
|
312
|
+
/* Code */
|
|
313
|
+
--size-font-code: 0.875em;
|
|
314
|
+
|
|
315
|
+
/* Fonts */
|
|
316
|
+
--font-family-base: 'Roboto', Arial, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
|
|
317
|
+
--font-weight-medium: 500;
|
|
318
|
+
--font-weight-semibold: 600;
|
|
319
|
+
--font-weight-bold: 700;
|
|
320
|
+
--size-font-base: 15px;
|
|
321
|
+
--size-font-sm: 0.875em;
|
|
322
|
+
--size-font-xs: 0.75em;
|
|
323
|
+
|
|
324
|
+
/* Spacing / Padding / Margin */
|
|
325
|
+
--size-spacing-sm: 0.25rem;
|
|
326
|
+
--size-spacing-md: 0.5rem;
|
|
327
|
+
--size-spacing-lg: 0.75rem;
|
|
328
|
+
--size-spacing-xl: 1rem;
|
|
329
|
+
--size-spacing-2xl: 1.5rem;
|
|
330
|
+
--size-spacing-3xl: 2rem;
|
|
331
|
+
|
|
332
|
+
--size-padding-sm: 0.125rem;
|
|
333
|
+
--size-padding-md: 0.375rem;
|
|
334
|
+
--size-padding-lg: 0.75rem;
|
|
335
|
+
--size-padding-xl: 1rem;
|
|
336
|
+
|
|
337
|
+
--size-margin-sm: 0.2em;
|
|
338
|
+
--size-margin-md: 0.58em;
|
|
339
|
+
--size-margin-lg: 0.88em;
|
|
340
|
+
--size-margin-xl: 1.18em;
|
|
341
|
+
--size-margin-2xl: 1.45em;
|
|
342
|
+
|
|
343
|
+
/* Borders */
|
|
344
|
+
--size-border-radius-sm: 0.25rem;
|
|
345
|
+
--size-border-radius-md: 0.375rem;
|
|
346
|
+
--size-border-radius-lg: 0.5rem;
|
|
347
|
+
--size-border-radius-xl: 1px;
|
|
348
|
+
--size-border-width-sm: 0.95px;
|
|
349
|
+
--size-border-width-md: 2px;
|
|
350
|
+
--size-border-width-lg: 3px;
|
|
351
|
+
|
|
352
|
+
/* Line Heights */
|
|
353
|
+
--size-line-height-base: 1.6;
|
|
354
|
+
--size-line-height-list: 1.6;
|
|
355
|
+
--size-line-height-list-marker: 1.4;
|
|
356
|
+
|
|
357
|
+
/* Misc Sizes */
|
|
358
|
+
--size-cursor-width: 20px;
|
|
359
|
+
--size-resize-handle: 4px;
|
|
360
|
+
--size-drag-handle-width: 1.03rem;
|
|
361
|
+
--size-drag-handle-height: 1.4rem;
|
|
362
|
+
}
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
## License
|
|
366
|
+
|
|
367
|
+
MIT
|
|
368
|
+
|
|
369
|
+
## Author
|
|
370
|
+
|
|
371
|
+
[safdar-azeem](https://github.com/safdar-azeem)
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
|
|
3
|
+
export type ButtonVariant = 'primary' | 'transparent';
|
|
4
|
+
declare function __VLS_template(): {
|
|
5
|
+
default?(_: {}): any;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
8
|
+
variant: {
|
|
9
|
+
type: PropType<ButtonVariant>;
|
|
10
|
+
default: string;
|
|
11
|
+
};
|
|
12
|
+
tooltip: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
className: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
20
|
+
disabled: {
|
|
21
|
+
type: BooleanConstructor;
|
|
22
|
+
default: boolean;
|
|
23
|
+
};
|
|
24
|
+
loading: {
|
|
25
|
+
type: BooleanConstructor;
|
|
26
|
+
default: boolean;
|
|
27
|
+
};
|
|
28
|
+
text: {
|
|
29
|
+
type: StringConstructor;
|
|
30
|
+
default: string;
|
|
31
|
+
};
|
|
32
|
+
type: {
|
|
33
|
+
type: PropType<"button" | "submit" | "reset">;
|
|
34
|
+
default: string;
|
|
35
|
+
};
|
|
36
|
+
icon: {
|
|
37
|
+
type: StringConstructor;
|
|
38
|
+
default: any;
|
|
39
|
+
};
|
|
40
|
+
rounded: {
|
|
41
|
+
type: PropType<"none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full">;
|
|
42
|
+
default: string;
|
|
43
|
+
};
|
|
44
|
+
iconRight: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
default: any;
|
|
47
|
+
};
|
|
48
|
+
iconSize: {
|
|
49
|
+
type: StringConstructor;
|
|
50
|
+
};
|
|
51
|
+
tabindex: {
|
|
52
|
+
type: NumberConstructor;
|
|
53
|
+
};
|
|
54
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
55
|
+
variant: {
|
|
56
|
+
type: PropType<ButtonVariant>;
|
|
57
|
+
default: string;
|
|
58
|
+
};
|
|
59
|
+
tooltip: {
|
|
60
|
+
type: StringConstructor;
|
|
61
|
+
default: string;
|
|
62
|
+
};
|
|
63
|
+
className: {
|
|
64
|
+
type: StringConstructor;
|
|
65
|
+
default: string;
|
|
66
|
+
};
|
|
67
|
+
disabled: {
|
|
68
|
+
type: BooleanConstructor;
|
|
69
|
+
default: boolean;
|
|
70
|
+
};
|
|
71
|
+
loading: {
|
|
72
|
+
type: BooleanConstructor;
|
|
73
|
+
default: boolean;
|
|
74
|
+
};
|
|
75
|
+
text: {
|
|
76
|
+
type: StringConstructor;
|
|
77
|
+
default: string;
|
|
78
|
+
};
|
|
79
|
+
type: {
|
|
80
|
+
type: PropType<"button" | "submit" | "reset">;
|
|
81
|
+
default: string;
|
|
82
|
+
};
|
|
83
|
+
icon: {
|
|
84
|
+
type: StringConstructor;
|
|
85
|
+
default: any;
|
|
86
|
+
};
|
|
87
|
+
rounded: {
|
|
88
|
+
type: PropType<"none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full">;
|
|
89
|
+
default: string;
|
|
90
|
+
};
|
|
91
|
+
iconRight: {
|
|
92
|
+
type: StringConstructor;
|
|
93
|
+
default: any;
|
|
94
|
+
};
|
|
95
|
+
iconSize: {
|
|
96
|
+
type: StringConstructor;
|
|
97
|
+
};
|
|
98
|
+
tabindex: {
|
|
99
|
+
type: NumberConstructor;
|
|
100
|
+
};
|
|
101
|
+
}>> & Readonly<{}>, {
|
|
102
|
+
type: "button" | "reset" | "submit";
|
|
103
|
+
disabled: boolean;
|
|
104
|
+
icon: string;
|
|
105
|
+
text: string;
|
|
106
|
+
className: string;
|
|
107
|
+
variant: ButtonVariant;
|
|
108
|
+
tooltip: string;
|
|
109
|
+
loading: boolean;
|
|
110
|
+
rounded: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full";
|
|
111
|
+
iconRight: string;
|
|
112
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
113
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
114
|
+
export default _default;
|
|
115
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
116
|
+
new (): {
|
|
117
|
+
$slots: S;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { IDropdownOptions, IPlacement } from '../types';
|
|
2
|
+
|
|
3
|
+
declare function __VLS_template(): {
|
|
4
|
+
trigger?(_: {
|
|
5
|
+
selectedLabel: string;
|
|
6
|
+
isOpen: boolean;
|
|
7
|
+
}): any;
|
|
8
|
+
default?(_: {}): any;
|
|
9
|
+
menu?(_: {}): any;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
12
|
+
selected?: string | number;
|
|
13
|
+
className?: string;
|
|
14
|
+
emptyMessage?: string;
|
|
15
|
+
position?: IPlacement;
|
|
16
|
+
caret?: boolean;
|
|
17
|
+
selectedIndex?: number | null;
|
|
18
|
+
options?: IDropdownOptions;
|
|
19
|
+
triggerVariant?: any;
|
|
20
|
+
offset?: [number, number];
|
|
21
|
+
}>, {
|
|
22
|
+
position: string;
|
|
23
|
+
emptyMessage: string;
|
|
24
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
25
|
+
onSelect: (...args: any[]) => void;
|
|
26
|
+
onOpen: (...args: any[]) => void;
|
|
27
|
+
onClose: (...args: any[]) => void;
|
|
28
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
29
|
+
selected?: string | number;
|
|
30
|
+
className?: string;
|
|
31
|
+
emptyMessage?: string;
|
|
32
|
+
position?: IPlacement;
|
|
33
|
+
caret?: boolean;
|
|
34
|
+
selectedIndex?: number | null;
|
|
35
|
+
options?: IDropdownOptions;
|
|
36
|
+
triggerVariant?: any;
|
|
37
|
+
offset?: [number, number];
|
|
38
|
+
}>, {
|
|
39
|
+
position: string;
|
|
40
|
+
emptyMessage: string;
|
|
41
|
+
}>>> & Readonly<{
|
|
42
|
+
onOnSelect?: (...args: any[]) => any;
|
|
43
|
+
onOnOpen?: (...args: any[]) => any;
|
|
44
|
+
onOnClose?: (...args: any[]) => any;
|
|
45
|
+
}>, {
|
|
46
|
+
emptyMessage: string;
|
|
47
|
+
position: IPlacement;
|
|
48
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
49
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
50
|
+
export default _default;
|
|
51
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
52
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
53
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
54
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
55
|
+
} : {
|
|
56
|
+
type: import('vue').PropType<T[K]>;
|
|
57
|
+
required: true;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
type __VLS_WithDefaults<P, D> = {
|
|
61
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
62
|
+
default: D[K];
|
|
63
|
+
}> : P[K];
|
|
64
|
+
};
|
|
65
|
+
type __VLS_Prettify<T> = {
|
|
66
|
+
[K in keyof T]: T[K];
|
|
67
|
+
} & {};
|
|
68
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
69
|
+
new (): {
|
|
70
|
+
$slots: S;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { IDropdownOption, IDropdownOptions } from '../types';
|
|
2
|
+
|
|
3
|
+
declare function __VLS_template(): {
|
|
4
|
+
menu?(_: {}): any;
|
|
5
|
+
option?(_: {
|
|
6
|
+
option: IDropdownOption;
|
|
7
|
+
index: number;
|
|
8
|
+
selectedIndex: number;
|
|
9
|
+
}): any;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
12
|
+
options?: IDropdownOptions;
|
|
13
|
+
emptyMessage?: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
closeOnSelect?: boolean;
|
|
16
|
+
hasSearch?: boolean;
|
|
17
|
+
selectedIndex?: number | null;
|
|
18
|
+
selected?: string | number;
|
|
19
|
+
}>, {
|
|
20
|
+
selectedIndex: any;
|
|
21
|
+
emptyMessage: string;
|
|
22
|
+
closeOnSelect: boolean;
|
|
23
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
24
|
+
onSelect: (...args: any[]) => void;
|
|
25
|
+
onNavigate: (...args: any[]) => void;
|
|
26
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
27
|
+
options?: IDropdownOptions;
|
|
28
|
+
emptyMessage?: string;
|
|
29
|
+
className?: string;
|
|
30
|
+
closeOnSelect?: boolean;
|
|
31
|
+
hasSearch?: boolean;
|
|
32
|
+
selectedIndex?: number | null;
|
|
33
|
+
selected?: string | number;
|
|
34
|
+
}>, {
|
|
35
|
+
selectedIndex: any;
|
|
36
|
+
emptyMessage: string;
|
|
37
|
+
closeOnSelect: boolean;
|
|
38
|
+
}>>> & Readonly<{
|
|
39
|
+
onOnSelect?: (...args: any[]) => any;
|
|
40
|
+
onOnNavigate?: (...args: any[]) => any;
|
|
41
|
+
}>, {
|
|
42
|
+
emptyMessage: string;
|
|
43
|
+
closeOnSelect: boolean;
|
|
44
|
+
selectedIndex: number | null;
|
|
45
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
46
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
47
|
+
export default _default;
|
|
48
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
49
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
50
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
51
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
52
|
+
} : {
|
|
53
|
+
type: import('vue').PropType<T[K]>;
|
|
54
|
+
required: true;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
type __VLS_WithDefaults<P, D> = {
|
|
58
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
59
|
+
default: D[K];
|
|
60
|
+
}> : P[K];
|
|
61
|
+
};
|
|
62
|
+
type __VLS_Prettify<T> = {
|
|
63
|
+
[K in keyof T]: T[K];
|
|
64
|
+
} & {};
|
|
65
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
66
|
+
new (): {
|
|
67
|
+
$slots: S;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
2
|
+
icon: string;
|
|
3
|
+
width?: string;
|
|
4
|
+
height?: string;
|
|
5
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
6
|
+
icon: string;
|
|
7
|
+
width?: string;
|
|
8
|
+
height?: string;
|
|
9
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
10
|
+
export default _default;
|
|
11
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
12
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
13
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
14
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
15
|
+
} : {
|
|
16
|
+
type: import('vue').PropType<T[K]>;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ImageUploadOptions } from '../composables/useNotesImageUpload';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
+
modelValue: string;
|
|
5
|
+
editClass?: string;
|
|
6
|
+
scrollClass?: string;
|
|
7
|
+
imageUploadOptions?: ImageUploadOptions;
|
|
8
|
+
}>>, {
|
|
9
|
+
editor: import('vue').ShallowRef<import('@tiptap/vue-3').Editor, import('@tiptap/vue-3').Editor>;
|
|
10
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
|
+
onFocus: () => void;
|
|
12
|
+
onBlur: () => void;
|
|
13
|
+
"update:modelValue": (value: string) => void;
|
|
14
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
15
|
+
modelValue: string;
|
|
16
|
+
editClass?: string;
|
|
17
|
+
scrollClass?: string;
|
|
18
|
+
imageUploadOptions?: ImageUploadOptions;
|
|
19
|
+
}>>> & Readonly<{
|
|
20
|
+
onOnFocus?: () => any;
|
|
21
|
+
onOnBlur?: () => any;
|
|
22
|
+
"onUpdate:modelValue"?: (value: string) => any;
|
|
23
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
24
|
+
export default _default;
|
|
25
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
26
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
27
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
28
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
29
|
+
} : {
|
|
30
|
+
type: import('vue').PropType<T[K]>;
|
|
31
|
+
required: true;
|
|
32
|
+
};
|
|
33
|
+
};
|