vue2-bbl-editor 1.3.0

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/package.json ADDED
@@ -0,0 +1,172 @@
1
+ {
2
+ "name": "vue2-bbl-editor",
3
+ "version": "1.3.0",
4
+ "description": "A production-ready, fully configurable rich text editor for Vue 2.6 built with Tiptap",
5
+ "main": "dist/vue2-bbl-editor.common.js",
6
+ "module": "dist/vue2-bbl-editor.esm.js",
7
+ "unpkg": "dist/vue2-bbl-editor.umd.min.js",
8
+ "types": "types/index.d.ts",
9
+ "files": [
10
+ "dist/*",
11
+ "types/*",
12
+ "README.md",
13
+ "LICENSE",
14
+ "CHANGELOG.md",
15
+ "INSTALLATION.md",
16
+ "QUICK_SETUP.md",
17
+ "COMPONENT_USAGE_GUIDE.md",
18
+ "EXTERNAL_INTEGRATION_GUIDE.md",
19
+ "EXTERNAL_HTML_RENDERING.md",
20
+ "CONTENT_WRAPPER_GUIDE.md",
21
+ "PACKAGE_DOCUMENTATION.md"
22
+ ],
23
+ "keywords": [
24
+ "vue",
25
+ "vue2",
26
+ "tiptap",
27
+ "editor",
28
+ "rich-text",
29
+ "wysiwyg",
30
+ "text-editor",
31
+ "prosemirror",
32
+ "upload",
33
+ "base64",
34
+ "image-compression",
35
+ "file-upload",
36
+ "media-management"
37
+ ],
38
+ "author": "Your Name",
39
+ "license": "MIT",
40
+ "repository": {
41
+ "type": "git",
42
+ "url": "git+https://github.com/Mahadi74/vue2-bbl-editor.git"
43
+ },
44
+ "bugs": {
45
+ "url": "https://github.com/Mahadi74/vue2-bbl-editor/issues"
46
+ },
47
+ "homepage": "https://github.com/Mahadi74/vue2-bbl-editor#readme",
48
+ "scripts": {
49
+ "serve": "vue-cli-service serve",
50
+ "build": "vue-cli-service build",
51
+ "build:lib": "vue-cli-service build --target lib --name vue2-bbl-editor src/index.js",
52
+ "lint": "vue-cli-service lint",
53
+ "test": "jest",
54
+ "test:watch": "jest --watch",
55
+ "prepublishOnly": "npm run build:lib"
56
+ },
57
+ "peerDependencies": {
58
+ "@tiptap/core": "^2.1.13",
59
+ "@tiptap/extension-code": "^2.1.13",
60
+ "@tiptap/extension-code-block": "^2.1.13",
61
+ "@tiptap/extension-color": "^2.1.13",
62
+ "@tiptap/extension-font-family": "^2.27.2",
63
+ "@tiptap/extension-highlight": "^2.1.13",
64
+ "@tiptap/extension-link": "^2.1.13",
65
+ "@tiptap/extension-placeholder": "^2.27.2",
66
+ "@tiptap/extension-table": "^2.1.13",
67
+ "@tiptap/extension-table-cell": "^2.1.13",
68
+ "@tiptap/extension-table-header": "^2.1.13",
69
+ "@tiptap/extension-table-row": "^2.1.13",
70
+ "@tiptap/extension-task-item": "^2.27.2",
71
+ "@tiptap/extension-task-list": "^2.27.2",
72
+ "@tiptap/extension-text-align": "^2.1.13",
73
+ "@tiptap/extension-text-style": "^2.1.13",
74
+ "@tiptap/extension-underline": "^2.1.13",
75
+ "@tiptap/starter-kit": "^2.1.13",
76
+ "@tiptap/vue-2": "^2.1.13",
77
+ "@vue/composition-api": "^1.7.2",
78
+ "vue": "^2.6.0"
79
+ },
80
+ "dependencies": {
81
+ "@tiptap/core": "^2.1.13",
82
+ "@tiptap/extension-blockquote": "^2.1.13",
83
+ "@tiptap/extension-bold": "^2.1.13",
84
+ "@tiptap/extension-bubble-menu": "^2.27.2",
85
+ "@tiptap/extension-bullet-list": "^2.1.13",
86
+ "@tiptap/extension-code": "^2.1.13",
87
+ "@tiptap/extension-code-block": "^2.1.13",
88
+ "@tiptap/extension-color": "^2.1.13",
89
+ "@tiptap/extension-document": "^2.1.13",
90
+ "@tiptap/extension-dropcursor": "^2.1.13",
91
+ "@tiptap/extension-font-family": "^2.27.2",
92
+ "@tiptap/extension-gapcursor": "^2.1.13",
93
+ "@tiptap/extension-hard-break": "^2.1.13",
94
+ "@tiptap/extension-heading": "^2.1.13",
95
+ "@tiptap/extension-highlight": "^2.1.13",
96
+ "@tiptap/extension-history": "^2.1.13",
97
+ "@tiptap/extension-horizontal-rule": "^2.1.13",
98
+ "@tiptap/extension-image": "^2.1.13",
99
+ "@tiptap/extension-italic": "^2.1.13",
100
+ "@tiptap/extension-link": "^2.1.13",
101
+ "@tiptap/extension-list-item": "^2.1.13",
102
+ "@tiptap/extension-ordered-list": "^2.1.13",
103
+ "@tiptap/extension-paragraph": "^2.1.13",
104
+ "@tiptap/extension-placeholder": "^2.27.2",
105
+ "@tiptap/extension-strike": "^2.1.13",
106
+ "@tiptap/extension-table": "^2.1.13",
107
+ "@tiptap/extension-table-cell": "^2.1.13",
108
+ "@tiptap/extension-table-header": "^2.1.13",
109
+ "@tiptap/extension-table-row": "^2.1.13",
110
+ "@tiptap/extension-task-item": "^2.27.2",
111
+ "@tiptap/extension-task-list": "^2.27.2",
112
+ "@tiptap/extension-text": "^2.1.13",
113
+ "@tiptap/extension-text-align": "^2.1.13",
114
+ "@tiptap/extension-text-style": "^2.1.13",
115
+ "@tiptap/extension-underline": "^2.1.13",
116
+ "@tiptap/starter-kit": "^2.1.13",
117
+ "@tiptap/vue-2": "^2.1.13",
118
+ "dompurify": "^3.3.1",
119
+ "prosemirror-commands": "^1.7.1",
120
+ "prosemirror-dropcursor": "^1.8.2",
121
+ "prosemirror-gapcursor": "^1.4.0",
122
+ "prosemirror-history": "^1.5.0",
123
+ "prosemirror-keymap": "^1.2.3",
124
+ "prosemirror-model": "^1.25.4",
125
+ "prosemirror-schema-list": "^1.5.1",
126
+ "prosemirror-state": "^1.4.4",
127
+ "prosemirror-tables": "^1.8.5",
128
+ "prosemirror-transform": "^1.10.5",
129
+ "prosemirror-view": "^1.41.4"
130
+ },
131
+ "devDependencies": {
132
+ "@babel/plugin-proposal-class-properties": "^7.18.6",
133
+ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
134
+ "@babel/plugin-proposal-optional-chaining": "^7.21.0",
135
+ "@babel/plugin-transform-nullish-coalescing-operator": "^7.27.1",
136
+ "@babel/plugin-transform-optional-chaining": "^7.28.5",
137
+ "@babel/plugin-transform-runtime": "^7.28.5",
138
+ "@babel/runtime": "^7.28.6",
139
+ "@vue/cli-plugin-babel": "~4.5.19",
140
+ "@vue/cli-plugin-eslint": "~4.5.19",
141
+ "@vue/cli-service": "~4.5.19",
142
+ "@vue/test-utils": "^1.3.6",
143
+ "babel-eslint": "^10.1.0",
144
+ "core-js": "^3.6.5",
145
+ "eslint": "^6.7.2",
146
+ "eslint-plugin-vue": "^6.2.2",
147
+ "fast-check": "^3.15.0",
148
+ "jest": "^27.5.1",
149
+ "vue": "^2.6.11",
150
+ "vue-jest": "^3.0.7",
151
+ "vue-template-compiler": "^2.6.14"
152
+ },
153
+ "eslintConfig": {
154
+ "root": true,
155
+ "env": {
156
+ "node": true
157
+ },
158
+ "extends": [
159
+ "plugin:vue/essential",
160
+ "eslint:recommended"
161
+ ],
162
+ "parserOptions": {
163
+ "parser": "babel-eslint"
164
+ },
165
+ "rules": {}
166
+ },
167
+ "browserslist": [
168
+ "> 1%",
169
+ "last 2 versions",
170
+ "not dead"
171
+ ]
172
+ }
@@ -0,0 +1,266 @@
1
+ import { VueConstructor } from 'vue'
2
+ import { Editor } from '@tiptap/core'
3
+
4
+ export interface ToolbarConfig {
5
+ bold?: boolean
6
+ italic?: boolean
7
+ underline?: boolean
8
+ strike?: boolean
9
+ code?: boolean
10
+ textColor?: boolean
11
+ highlight?: boolean
12
+ fontFamily?: boolean
13
+ fontSize?: boolean
14
+ textAlign?: boolean
15
+ lineHeight?: boolean
16
+ headings?: boolean
17
+ lists?: boolean
18
+ blockquote?: boolean
19
+ codeBlock?: boolean
20
+ horizontalRule?: boolean
21
+ link?: boolean
22
+ image?: boolean
23
+ video?: boolean
24
+ table?: boolean
25
+ clearFormatting?: boolean
26
+ sourceCode?: boolean
27
+ undo?: boolean
28
+ redo?: boolean
29
+ }
30
+
31
+ export interface ExtensionConfig {
32
+ image?: {
33
+ allowResize?: boolean
34
+ allowAlignment?: boolean
35
+ allowDelete?: boolean
36
+ maxWidth?: string
37
+ quality?: number
38
+ }
39
+ video?: {
40
+ allowResize?: boolean
41
+ allowAlignment?: boolean
42
+ allowDelete?: boolean
43
+ maxWidth?: string
44
+ autoplay?: boolean
45
+ }
46
+ table?: {
47
+ resizable?: boolean
48
+ allowRowControls?: boolean
49
+ allowColumnControls?: boolean
50
+ cellSelection?: boolean
51
+ }
52
+ link?: {
53
+ openOnClick?: boolean
54
+ autolink?: boolean
55
+ linkOnPaste?: boolean
56
+ }
57
+ textAlign?: {
58
+ types?: string[]
59
+ }
60
+ }
61
+
62
+ export interface UploadHandler {
63
+ (file: File): Promise<{ src: string; alt?: string; width?: number; height?: number; size?: number; originalSize?: number; type?: string; originalName?: string; compressed?: boolean }>
64
+ }
65
+
66
+ export interface ImageCompressionEvent {
67
+ originalSize: number
68
+ compressedSize: number
69
+ originalDimensions: { width: number; height: number }
70
+ compressedDimensions: { width: number; height: number }
71
+ compressionRatio: number
72
+ }
73
+
74
+ export interface PremiumBblEditorProps {
75
+ value?: string
76
+ placeholder?: string
77
+ editable?: boolean
78
+ outputFormat?: 'html' | 'json'
79
+ maxHeight?: string | number
80
+ minHeight?: string | number
81
+ theme?: 'default' | 'minimal' | 'dark'
82
+ showToolbar?: boolean
83
+ showBubbleMenu?: boolean
84
+ showTableBubbleMenu?: boolean
85
+ showImageBubbleMenu?: boolean
86
+ showVideoBubbleMenu?: boolean
87
+ toolbarConfig?: ToolbarConfig
88
+ extensionConfig?: ExtensionConfig
89
+ uploadHandler?: UploadHandler
90
+ imageUploadUrl?: string
91
+ videoUploadUrl?: string
92
+ maxFileSize?: number
93
+ allowedImageTypes?: string[]
94
+ allowedVideoTypes?: string[]
95
+ // Local file base64 management
96
+ useBase64Upload?: boolean
97
+ base64Quality?: number
98
+ base64MaxWidth?: number
99
+ base64MaxHeight?: number
100
+ enableImageCompression?: boolean
101
+ preserveOriginalFileName?: boolean
102
+ base64Prefix?: string
103
+ maxContentLength?: number
104
+ allowedHeadings?: number[]
105
+ fontFamilies?: string[]
106
+ fontSizes?: string[]
107
+ lineHeights?: string[]
108
+ autofocus?: boolean
109
+ spellcheck?: boolean
110
+ autoSave?: boolean
111
+ autoSaveInterval?: number
112
+ editorClass?: string | string[] | object
113
+ toolbarClass?: string | string[] | object
114
+ contentClass?: string | string[] | object
115
+ // HTML Output wrapper
116
+ wrapWithContentClass?: boolean
117
+ }
118
+
119
+ export interface PremiumBblEditorEvents {
120
+ input: (content: string) => void
121
+ update: (content: string) => void
122
+ ready: (editor: Editor) => void
123
+ created: (editor: Editor) => void
124
+ focus: () => void
125
+ blur: () => void
126
+ destroyed: () => void
127
+ 'auto-save': (content: string) => void
128
+ 'content-limit-exceeded': (data: { current: number; max: number }) => void
129
+ 'image-compressed': (data: ImageCompressionEvent) => void
130
+ error: (error: { type: string; message: string; [key: string]: any }) => void
131
+ }
132
+
133
+ export interface PremiumBblEditorMethods {
134
+ focus(): void
135
+ blur(): void
136
+ getContent(format?: 'html' | 'json', wrapContent?: boolean): string | object
137
+ setContent(content: string, emitUpdate?: boolean): void
138
+ executeCommand(command: string, options?: any): void
139
+ }
140
+
141
+ export declare class PremiumBblEditorComponent {
142
+ $props: PremiumBblEditorProps
143
+ $emit: PremiumBblEditorEvents
144
+ focus(): void
145
+ blur(): void
146
+ getContent(format?: 'html' | 'json', wrapContent?: boolean): string | object
147
+ setContent(content: string, emitUpdate?: boolean): void
148
+ executeCommand(command: string, options?: any): void
149
+ }
150
+
151
+ export declare class PremiumBblEditorOptionsAPIComponent {
152
+ $props: PremiumBblEditorProps
153
+ $emit: PremiumBblEditorEvents
154
+ focus(): void
155
+ blur(): void
156
+ getContent(format?: 'html' | 'json', wrapContent?: boolean): string | object
157
+ setContent(content: string, emitUpdate?: boolean): void
158
+ executeCommand(command: string, options?: any): void
159
+ }
160
+
161
+ export declare class DiagnosticToolComponent {
162
+ $props: {}
163
+ }
164
+
165
+ export declare class DebugHelperComponent {
166
+ $props: {}
167
+ }
168
+
169
+ export interface PluginOptions {
170
+ registerAllComponents?: boolean
171
+ }
172
+
173
+ export declare function install(Vue: VueConstructor, options?: PluginOptions): void
174
+
175
+ // Composable types
176
+ export interface UseEditorOptions {
177
+ content?: string
178
+ extensions?: any[]
179
+ editable?: boolean
180
+ autofocus?: boolean
181
+ onUpdate?: (props: { editor: Editor }) => void
182
+ onCreate?: (props: { editor: Editor }) => void
183
+ onFocus?: (props: { editor: Editor; event: FocusEvent }) => void
184
+ onBlur?: (props: { editor: Editor; event: FocusEvent }) => void
185
+ onDestroy?: () => void
186
+ }
187
+
188
+ export interface UseEditorReturn {
189
+ editor: Editor | null
190
+ }
191
+
192
+ export declare function useEditor(options?: UseEditorOptions): UseEditorReturn
193
+
194
+ // Component exports with proper names
195
+ export const PremiumBblEditor: typeof PremiumBblEditorComponent
196
+ export const PremiumBblEditorOptionsAPI: typeof PremiumBblEditorOptionsAPIComponent
197
+ export const DiagnosticTool: typeof DiagnosticToolComponent
198
+ export const DebugHelper: typeof DebugHelperComponent
199
+
200
+ // Upload system types
201
+ export interface UploadResult {
202
+ success: boolean
203
+ url: string
204
+ publicUrl?: string
205
+ uploadId: string
206
+ size: number
207
+ adapter: string
208
+ metadata?: {
209
+ fileName?: string
210
+ fileType?: string
211
+ uploadedAt?: string
212
+ [key: string]: any
213
+ }
214
+ }
215
+
216
+ export interface UploadConfig {
217
+ defaultAdapter: string
218
+ adapters: Record<string, any>
219
+ validation?: {
220
+ maxSize?: number
221
+ allowedTypes?: string[]
222
+ customValidator?: (file: File) => boolean
223
+ }
224
+ retry?: {
225
+ maxAttempts?: number
226
+ baseDelay?: number
227
+ maxDelay?: number
228
+ backoffFactor?: number
229
+ }
230
+ progress?: {
231
+ throttleMs?: number
232
+ }
233
+ debug?: boolean
234
+ }
235
+
236
+ export declare class UploadManager {
237
+ constructor(config: UploadConfig)
238
+ registerAdapter(adapter: any): void
239
+ setDefaultAdapter(name: string): void
240
+ upload(file: File, options?: any): Promise<UploadResult>
241
+ uploadWithAdapter(adapterName: string, file: File, options?: any): Promise<UploadResult>
242
+ cancelUpload(uploadId: string): Promise<void>
243
+ getStats(): any
244
+ destroy(): void
245
+ on(event: string, callback: Function): void
246
+ off(event: string, callback: Function): void
247
+ }
248
+
249
+ export declare class LocalStorageAdapter {
250
+ constructor(options?: any)
251
+ getName(): string
252
+ upload(file: File, options?: any): Promise<UploadResult>
253
+ }
254
+
255
+ export declare function createUploadConfig(preset: string, overrides?: Partial<UploadConfig>): UploadConfig
256
+ export declare function integrateTipTapUpload(editor: Editor, uploadManager: UploadManager, options?: any): void
257
+
258
+ declare const plugin: {
259
+ install: typeof install
260
+ PremiumBblEditor: typeof PremiumBblEditorComponent
261
+ PremiumBblEditorOptionsAPI: typeof PremiumBblEditorOptionsAPIComponent
262
+ DiagnosticTool: typeof DiagnosticToolComponent
263
+ DebugHelper: typeof DebugHelperComponent
264
+ }
265
+
266
+ export default plugin