vue2-premium-bbl-editor 1.2.8 → 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/README.md +2 -13
- package/package.json +9 -5
- package/API_SUPPORT_GUIDE.md +0 -319
- package/CLEANUP_SUMMARY.md +0 -111
- package/COMPATIBILITY_GUIDE.md +0 -150
- package/DEBUG_LOADING_ISSUE.md +0 -257
- package/DIAGNOSTIC_SCRIPT.md +0 -136
- package/EXTERNAL_PROJECT_USAGE.md +0 -544
- package/MIGRATION_GUIDE.md +0 -351
- package/OPTIMIZATION_GUIDE.md +0 -64
- package/PUBLISH_GUIDE.md +0 -175
- package/QUICK_REFERENCE.md +0 -227
- package/TROUBLESHOOTING.md +0 -397
- package/UPLOAD_TESTING_COMPLETE.md +0 -234
- package/USER_DEBUG_INSTRUCTIONS.md +0 -158
- package/src/App.vue +0 -57
- package/src/README.md +0 -276
- package/src/assets/logo.png +0 -0
- package/src/components/DebugHelper.vue +0 -18
- package/src/components/DiagnosticTool.vue +0 -339
- package/src/components/EditorDemo.vue +0 -451
- package/src/components/Menus/BubbleMenu.vue +0 -147
- package/src/components/Menus/ImageBubbleMenu.vue +0 -438
- package/src/components/Menus/TableBubbleMenu.vue +0 -996
- package/src/components/Menus/VideoBubbleMenu.vue +0 -438
- package/src/components/Modals/ImageModal.vue +0 -541
- package/src/components/Modals/LinkModal.vue +0 -255
- package/src/components/Modals/TableModal.vue +0 -352
- package/src/components/Modals/VideoModal.vue +0 -549
- package/src/components/PremiumBblEditor.vue +0 -1735
- package/src/components/PremiumBblEditorOptionsAPI.vue +0 -2277
- package/src/components/PremiumEditorDemo.vue +0 -341
- package/src/components/Toolbar/AlignmentDropdown.vue +0 -221
- package/src/components/Toolbar/BubbleMenuDropdown.vue +0 -181
- package/src/components/Toolbar/ColorPickerDropdown.vue +0 -326
- package/src/components/Toolbar/FontFamilyDropdown.vue +0 -338
- package/src/components/Toolbar/FontSizeDropdown.vue +0 -265
- package/src/components/Toolbar/HeadingDropdown.vue +0 -275
- package/src/components/Toolbar/HighlightPickerDropdown.vue +0 -304
- package/src/components/Toolbar/LineHeightDropdown.vue +0 -252
- package/src/components/Toolbar/ListDropdown.vue +0 -219
- package/src/components/Toolbar/TableDropdown.vue +0 -296
- package/src/components/Toolbar/ToolbarButton.vue +0 -69
- package/src/components/Toolbar/ToolbarGroup.vue +0 -11
- package/src/components/Toolbar/ToolbarMain.vue +0 -472
- package/src/components/index.js +0 -9
- package/src/components/svg/AboveColumn.vue +0 -18
- package/src/components/svg/AboveRow.vue +0 -18
- package/src/components/svg/AlignIcon.vue +0 -33
- package/src/components/svg/BelowColumn.vue +0 -3
- package/src/components/svg/BelowRow.vue +0 -3
- package/src/components/svg/BlockDisplay.vue +0 -11
- package/src/components/svg/BoxList.vue +0 -3
- package/src/components/svg/BulletList.vue +0 -3
- package/src/components/svg/CaptionBottom.vue +0 -22
- package/src/components/svg/CaptionTop.vue +0 -22
- package/src/components/svg/CellIcon.vue +0 -19
- package/src/components/svg/CenterAlign.vue +0 -3
- package/src/components/svg/ClearFormatting.vue +0 -9
- package/src/components/svg/Code.vue +0 -12
- package/src/components/svg/CodeBlock.vue +0 -9
- package/src/components/svg/ColorPalette.vue +0 -15
- package/src/components/svg/ColumnIcon.vue +0 -19
- package/src/components/svg/Delete.vue +0 -14
- package/src/components/svg/DeleteTable.vue +0 -3
- package/src/components/svg/Duplicate.vue +0 -12
- package/src/components/svg/ImageSvg.vue +0 -3
- package/src/components/svg/InlineDisplay.vue +0 -11
- package/src/components/svg/JustifyAlign.vue +0 -3
- package/src/components/svg/LeftAlign.vue +0 -3
- package/src/components/svg/Link.vue +0 -3
- package/src/components/svg/MergeCells.vue +0 -23
- package/src/components/svg/MoveDown.vue +0 -11
- package/src/components/svg/MoveLeft.vue +0 -11
- package/src/components/svg/MoveRight.vue +0 -11
- package/src/components/svg/MoveUp.vue +0 -11
- package/src/components/svg/Next.vue +0 -3
- package/src/components/svg/NoCaption.vue +0 -22
- package/src/components/svg/NumberList.vue +0 -3
- package/src/components/svg/Previous.vue +0 -3
- package/src/components/svg/Quote.vue +0 -3
- package/src/components/svg/RightAlign.vue +0 -18
- package/src/components/svg/RowIcon.vue +0 -19
- package/src/components/svg/SpacingLarge.vue +0 -23
- package/src/components/svg/SpacingMedium.vue +0 -23
- package/src/components/svg/SpacingSmall.vue +0 -23
- package/src/components/svg/SplitCell.vue +0 -23
- package/src/components/svg/Table.vue +0 -3
- package/src/components/svg/Video.vue +0 -3
- package/src/components/svg/index.js +0 -43
- package/src/composables/useEditor.js +0 -703
- package/src/extensions/CustomTableCell.js +0 -21
- package/src/extensions/CustomTableHeader.js +0 -21
- package/src/extensions/ResizableImage.js +0 -476
- package/src/extensions/ResizableVideo.js +0 -521
- package/src/index.js +0 -88
- package/src/main.js +0 -10
- package/src/mixins/uploadMixin.js +0 -192
- package/src/styles/editor.css +0 -315
- package/src/styles/tables.css +0 -116
- package/src/styles/toolbar.css +0 -187
- package/src/upload/README.md +0 -471
- package/src/upload/__tests__/UploadManager.test.js +0 -199
- package/src/upload/__tests__/setup.js +0 -190
- package/src/upload/adapters/LocalStorageAdapter.js +0 -441
- package/src/upload/config/ConfigurationManager.js +0 -558
- package/src/upload/core/EventEmitter.js +0 -94
- package/src/upload/core/UploadError.js +0 -130
- package/src/upload/core/UploadManager.js +0 -584
- package/src/upload/core/UploadTypes.js +0 -172
- package/src/upload/demo.js +0 -338
- package/src/upload/index.js +0 -242
- package/src/upload/integrations/README.md +0 -429
- package/src/upload/integrations/TipTapUploadAdapter.js +0 -147
- package/src/upload/interfaces/UploadAdapter.js +0 -172
- package/src/upload/interfaces/UploadStrategy.js +0 -75
- package/src/upload/progress/ProgressTracker.js +0 -506
- package/src/upload/retry/RetryHandler.js +0 -564
- package/src/upload/strategies/DirectUploadStrategy.js +0 -422
- package/src/upload/strategies/PresignedUrlStrategy.js +0 -501
- package/src/upload/validation/FileValidator.js +0 -528
package/README.md
CHANGED
|
@@ -24,20 +24,9 @@ A production-ready, fully configurable rich text editor for Vue 2.6 applications
|
|
|
24
24
|
npm install vue2-premium-bbl-editor
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
###
|
|
27
|
+
### PREVIEW
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
npm install @vue/composition-api @tiptap/core @tiptap/vue-2 @tiptap/starter-kit @tiptap/extension-text-style @tiptap/extension-color @tiptap/extension-highlight @tiptap/extension-underline @tiptap/extension-text-align @tiptap/extension-link @tiptap/extension-font-family @tiptap/extension-code @tiptap/extension-code-block @tiptap/extension-table @tiptap/extension-table-row @tiptap/extension-table-cell @tiptap/extension-table-header @tiptap/extension-task-list @tiptap/extension-task-item @tiptap/extension-placeholder
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### Quick Install Script
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
# Install the editor and all dependencies at once
|
|
39
|
-
npm install vue2-premium-bbl-editor @vue/composition-api @tiptap/core @tiptap/vue-2 @tiptap/starter-kit @tiptap/extension-text-style @tiptap/extension-color @tiptap/extension-highlight @tiptap/extension-underline @tiptap/extension-text-align @tiptap/extension-link @tiptap/extension-font-family @tiptap/extension-code @tiptap/extension-code-block @tiptap/extension-table @tiptap/extension-table-row @tiptap/extension-table-cell @tiptap/extension-table-header @tiptap/extension-task-list @tiptap/extension-task-item @tiptap/extension-placeholder
|
|
40
|
-
```
|
|
29
|
+
<img src="https://raw.githubusercontent.com/Mahadi74/vue2-premium-bbl-editor/refs/heads/main/public/preview.png?token=GHSAT0AAAAAAC2VZAZN5WMWV2SNVXGIKHW22LOIILA" width="100"/>
|
|
41
30
|
|
|
42
31
|
## 🎯 Quick Start
|
|
43
32
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue2-premium-bbl-editor",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "A production-ready, fully configurable rich text editor for Vue 2.6 built with Tiptap",
|
|
5
5
|
"main": "dist/vue2-premium-bbl-editor.common.js",
|
|
6
6
|
"module": "dist/vue2-premium-bbl-editor.esm.js",
|
|
@@ -8,11 +8,15 @@
|
|
|
8
8
|
"types": "types/index.d.ts",
|
|
9
9
|
"files": [
|
|
10
10
|
"dist/*",
|
|
11
|
-
"src/*",
|
|
12
11
|
"types/*",
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
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
|
+
"PACKAGE_DOCUMENTATION.md"
|
|
16
20
|
],
|
|
17
21
|
"keywords": [
|
|
18
22
|
"vue",
|
package/API_SUPPORT_GUIDE.md
DELETED
|
@@ -1,319 +0,0 @@
|
|
|
1
|
-
# 🎯 API Support Guide - Options API & Composition API
|
|
2
|
-
|
|
3
|
-
The BBL Editor now supports **both Vue Options API and Composition API**, making it compatible with all Vue 2.6+ projects regardless of your preferred coding style.
|
|
4
|
-
|
|
5
|
-
## 🚀 Quick Start
|
|
6
|
-
|
|
7
|
-
### Option 1: Options API (No Composition API Required)
|
|
8
|
-
|
|
9
|
-
Perfect for traditional Vue 2 projects that don't use Composition API:
|
|
10
|
-
|
|
11
|
-
```vue
|
|
12
|
-
<template>
|
|
13
|
-
<div>
|
|
14
|
-
<PremiumBblEditorOptionsAPI v-model="content" />
|
|
15
|
-
</div>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<script>
|
|
19
|
-
export default {
|
|
20
|
-
data() {
|
|
21
|
-
return {
|
|
22
|
-
content: '<p>Hello World!</p>'
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
</script>
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
**Installation:**
|
|
30
|
-
```bash
|
|
31
|
-
npm install vue2-premium-bbl-editor
|
|
32
|
-
# No need for @vue/composition-api!
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
**Setup (main.js):**
|
|
36
|
-
```javascript
|
|
37
|
-
import Vue from 'vue'
|
|
38
|
-
import PremiumBblEditor from 'vue2-premium-bbl-editor'
|
|
39
|
-
import 'vue2-premium-bbl-editor/dist/vue2-premium-bbl-editor.css'
|
|
40
|
-
|
|
41
|
-
Vue.use(PremiumBblEditor)
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### Option 2: Composition API
|
|
45
|
-
|
|
46
|
-
For projects using Vue Composition API:
|
|
47
|
-
|
|
48
|
-
```vue
|
|
49
|
-
<template>
|
|
50
|
-
<div>
|
|
51
|
-
<PremiumBblEditor v-model="content" />
|
|
52
|
-
</div>
|
|
53
|
-
</template>
|
|
54
|
-
|
|
55
|
-
<script>
|
|
56
|
-
import { ref } from '@vue/composition-api'
|
|
57
|
-
|
|
58
|
-
export default {
|
|
59
|
-
setup() {
|
|
60
|
-
const content = ref('<p>Hello World!</p>')
|
|
61
|
-
return { content }
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
</script>
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
**Installation:**
|
|
68
|
-
```bash
|
|
69
|
-
npm install vue2-premium-bbl-editor @vue/composition-api
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
**Setup (main.js):**
|
|
73
|
-
```javascript
|
|
74
|
-
import Vue from 'vue'
|
|
75
|
-
import VueCompositionAPI from '@vue/composition-api'
|
|
76
|
-
import PremiumBblEditor from 'vue2-premium-bbl-editor'
|
|
77
|
-
import 'vue2-premium-bbl-editor/dist/vue2-premium-bbl-editor.css'
|
|
78
|
-
|
|
79
|
-
Vue.use(VueCompositionAPI) // Required for Composition API
|
|
80
|
-
Vue.use(PremiumBblEditor)
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
## 📋 Component Comparison
|
|
84
|
-
|
|
85
|
-
| Feature | PremiumBblEditor | PremiumBblEditorOptionsAPI |
|
|
86
|
-
|---------|------------------|---------------------------|
|
|
87
|
-
| **API Style** | Composition API | Options API |
|
|
88
|
-
| **Dependencies** | Requires @vue/composition-api | No extra dependencies |
|
|
89
|
-
| **Performance** | Slightly better reactivity | Traditional Vue 2 performance |
|
|
90
|
-
| **Bundle Size** | Same | Same |
|
|
91
|
-
| **Features** | All features | All features |
|
|
92
|
-
| **Compatibility** | Vue 2.6+ with Composition API | Vue 2.6+ (any setup) |
|
|
93
|
-
|
|
94
|
-
## 🎯 Which One Should You Use?
|
|
95
|
-
|
|
96
|
-
### Use `PremiumBblEditorOptionsAPI` if:
|
|
97
|
-
- ✅ You're working with a traditional Vue 2 project
|
|
98
|
-
- ✅ You don't want to install @vue/composition-api
|
|
99
|
-
- ✅ Your team prefers Options API syntax
|
|
100
|
-
- ✅ You're getting "Loading Premium Editor..." issues with the Composition API version
|
|
101
|
-
|
|
102
|
-
### Use `PremiumBblEditor` if:
|
|
103
|
-
- ✅ You're already using Vue Composition API in your project
|
|
104
|
-
- ✅ You prefer the Composition API syntax
|
|
105
|
-
- ✅ You're planning to migrate to Vue 3 eventually
|
|
106
|
-
- ✅ You want the latest reactive features
|
|
107
|
-
|
|
108
|
-
## 🔧 Advanced Usage
|
|
109
|
-
|
|
110
|
-
### Options API with Full Configuration
|
|
111
|
-
|
|
112
|
-
```vue
|
|
113
|
-
<template>
|
|
114
|
-
<div>
|
|
115
|
-
<PremiumBblEditorOptionsAPI
|
|
116
|
-
v-model="content"
|
|
117
|
-
placeholder="Start writing..."
|
|
118
|
-
:toolbar-config="toolbarConfig"
|
|
119
|
-
:extension-config="extensionConfig"
|
|
120
|
-
:max-height="500"
|
|
121
|
-
:show-toolbar="true"
|
|
122
|
-
@ready="onEditorReady"
|
|
123
|
-
@error="onEditorError"
|
|
124
|
-
/>
|
|
125
|
-
</div>
|
|
126
|
-
</template>
|
|
127
|
-
|
|
128
|
-
<script>
|
|
129
|
-
export default {
|
|
130
|
-
data() {
|
|
131
|
-
return {
|
|
132
|
-
content: '<p>Welcome!</p>',
|
|
133
|
-
toolbarConfig: {
|
|
134
|
-
bold: true,
|
|
135
|
-
italic: true,
|
|
136
|
-
underline: true,
|
|
137
|
-
textColor: true,
|
|
138
|
-
highlight: true,
|
|
139
|
-
link: true,
|
|
140
|
-
image: true,
|
|
141
|
-
table: true
|
|
142
|
-
},
|
|
143
|
-
extensionConfig: {
|
|
144
|
-
textAlign: {
|
|
145
|
-
types: ['heading', 'paragraph']
|
|
146
|
-
},
|
|
147
|
-
link: {
|
|
148
|
-
openOnClick: false,
|
|
149
|
-
autolink: true
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
methods: {
|
|
155
|
-
onEditorReady(editor) {
|
|
156
|
-
console.log('Editor ready!', editor)
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
onEditorError(error) {
|
|
160
|
-
console.error('Editor error:', error)
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
</script>
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
### Composition API with Full Configuration
|
|
168
|
-
|
|
169
|
-
```vue
|
|
170
|
-
<template>
|
|
171
|
-
<div>
|
|
172
|
-
<PremiumBblEditor
|
|
173
|
-
v-model="content"
|
|
174
|
-
placeholder="Start writing..."
|
|
175
|
-
:toolbar-config="toolbarConfig"
|
|
176
|
-
:extension-config="extensionConfig"
|
|
177
|
-
:max-height="500"
|
|
178
|
-
:show-toolbar="true"
|
|
179
|
-
@ready="onEditorReady"
|
|
180
|
-
@error="onEditorError"
|
|
181
|
-
/>
|
|
182
|
-
</div>
|
|
183
|
-
</template>
|
|
184
|
-
|
|
185
|
-
<script>
|
|
186
|
-
import { ref, reactive } from '@vue/composition-api'
|
|
187
|
-
|
|
188
|
-
export default {
|
|
189
|
-
setup() {
|
|
190
|
-
const content = ref('<p>Welcome!</p>')
|
|
191
|
-
|
|
192
|
-
const toolbarConfig = reactive({
|
|
193
|
-
bold: true,
|
|
194
|
-
italic: true,
|
|
195
|
-
underline: true,
|
|
196
|
-
textColor: true,
|
|
197
|
-
highlight: true,
|
|
198
|
-
link: true,
|
|
199
|
-
image: true,
|
|
200
|
-
table: true
|
|
201
|
-
})
|
|
202
|
-
|
|
203
|
-
const extensionConfig = reactive({
|
|
204
|
-
textAlign: {
|
|
205
|
-
types: ['heading', 'paragraph']
|
|
206
|
-
},
|
|
207
|
-
link: {
|
|
208
|
-
openOnClick: false,
|
|
209
|
-
autolink: true
|
|
210
|
-
}
|
|
211
|
-
})
|
|
212
|
-
|
|
213
|
-
const onEditorReady = (editor) => {
|
|
214
|
-
console.log('Editor ready!', editor)
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
const onEditorError = (error) => {
|
|
218
|
-
console.error('Editor error:', error)
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
return {
|
|
222
|
-
content,
|
|
223
|
-
toolbarConfig,
|
|
224
|
-
extensionConfig,
|
|
225
|
-
onEditorReady,
|
|
226
|
-
onEditorError
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
</script>
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
## 🔍 Troubleshooting
|
|
234
|
-
|
|
235
|
-
### "Loading Premium Editor..." Issue
|
|
236
|
-
|
|
237
|
-
If you're seeing this issue:
|
|
238
|
-
|
|
239
|
-
1. **Try Options API version first:**
|
|
240
|
-
```vue
|
|
241
|
-
<PremiumBblEditorOptionsAPI v-model="content" />
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
2. **Use the Diagnostic Tool:**
|
|
245
|
-
```vue
|
|
246
|
-
<template>
|
|
247
|
-
<div>
|
|
248
|
-
<DiagnosticTool />
|
|
249
|
-
<PremiumBblEditorOptionsAPI v-model="content" />
|
|
250
|
-
</div>
|
|
251
|
-
</template>
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
3. **Check dependencies:**
|
|
255
|
-
```bash
|
|
256
|
-
npm list vue2-premium-bbl-editor
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
### Migration Between APIs
|
|
260
|
-
|
|
261
|
-
**From Composition API to Options API:**
|
|
262
|
-
```vue
|
|
263
|
-
<!-- Before (Composition API) -->
|
|
264
|
-
<PremiumBblEditor v-model="content" />
|
|
265
|
-
|
|
266
|
-
<!-- After (Options API) -->
|
|
267
|
-
<PremiumBblEditorOptionsAPI v-model="content" />
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
**From Options API to Composition API:**
|
|
271
|
-
1. Install Composition API: `npm install @vue/composition-api`
|
|
272
|
-
2. Register in main.js: `Vue.use(VueCompositionAPI)`
|
|
273
|
-
3. Update component:
|
|
274
|
-
```vue
|
|
275
|
-
<!-- Before (Options API) -->
|
|
276
|
-
<PremiumBblEditorOptionsAPI v-model="content" />
|
|
277
|
-
|
|
278
|
-
<!-- After (Composition API) -->
|
|
279
|
-
<PremiumBblEditor v-model="content" />
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
## 📦 Import Options
|
|
283
|
-
|
|
284
|
-
### Named Imports
|
|
285
|
-
```javascript
|
|
286
|
-
import {
|
|
287
|
-
PremiumBblEditor, // Composition API version
|
|
288
|
-
PremiumBblEditorOptionsAPI, // Options API version
|
|
289
|
-
DiagnosticTool,
|
|
290
|
-
DebugHelper
|
|
291
|
-
} from 'vue2-premium-bbl-editor'
|
|
292
|
-
```
|
|
293
|
-
|
|
294
|
-
### Global Registration
|
|
295
|
-
```javascript
|
|
296
|
-
import Vue from 'vue'
|
|
297
|
-
import PremiumBblEditor from 'vue2-premium-bbl-editor'
|
|
298
|
-
|
|
299
|
-
Vue.use(PremiumBblEditor)
|
|
300
|
-
|
|
301
|
-
// Now both components are available globally:
|
|
302
|
-
// <PremiumBblEditor />
|
|
303
|
-
// <PremiumBblEditorOptionsAPI />
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
## 🎉 Benefits
|
|
307
|
-
|
|
308
|
-
✅ **Maximum Compatibility** - Works with any Vue 2.6+ project
|
|
309
|
-
✅ **No Breaking Changes** - Existing code continues to work
|
|
310
|
-
✅ **Flexible Architecture** - Choose the API that fits your project
|
|
311
|
-
✅ **Same Features** - Both versions have identical functionality
|
|
312
|
-
✅ **Easy Migration** - Switch between APIs with minimal changes
|
|
313
|
-
✅ **Better Debugging** - Options API version eliminates Composition API issues
|
|
314
|
-
|
|
315
|
-
## 🚀 Recommendation
|
|
316
|
-
|
|
317
|
-
For **new projects** or if you're having issues with the Composition API version, we recommend starting with `PremiumBblEditorOptionsAPI` as it has fewer dependencies and is more compatible with existing Vue 2 projects.
|
|
318
|
-
|
|
319
|
-
You can always migrate to the Composition API version later when you're ready to adopt Vue Composition API across your project.
|
package/CLEANUP_SUMMARY.md
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
# Code Cleanup & Standardization Summary - v1.2.7
|
|
2
|
-
|
|
3
|
-
## 🎯 Objectives Completed
|
|
4
|
-
|
|
5
|
-
✅ **Remove unused code** - Eliminated redundant methods and console.log statements
|
|
6
|
-
✅ **Standardize upload logic** - Created unified upload system for both Image and Video modals
|
|
7
|
-
✅ **Bug-free implementation** - Thoroughly tested and validated all upload functionality
|
|
8
|
-
✅ **Clean documentation** - Removed outdated and redundant documentation files
|
|
9
|
-
|
|
10
|
-
## 🧹 Code Cleanup Actions
|
|
11
|
-
|
|
12
|
-
### 1. Created Standardized Upload System
|
|
13
|
-
- **New File**: `src/mixins/uploadMixin.js` - Shared upload functionality
|
|
14
|
-
- **Unified Logic**: Both ImageModal and VideoModal now use the same upload system
|
|
15
|
-
- **Consistent Props**: Standardized `uploadHandler`, `uploadManager`, `maxFileSize`, `allowedTypes`
|
|
16
|
-
- **Error Handling**: Unified error messages and user feedback
|
|
17
|
-
|
|
18
|
-
### 2. Refactored Modal Components
|
|
19
|
-
- **ImageModal**: Completely rewritten using uploadMixin
|
|
20
|
-
- **VideoModal**: Updated to use standardized upload system
|
|
21
|
-
- **Removed Duplication**: Eliminated ~200 lines of duplicate upload code
|
|
22
|
-
- **Enhanced Features**: Added progress indicators, error handling, and retry functionality
|
|
23
|
-
|
|
24
|
-
### 3. Documentation Cleanup
|
|
25
|
-
Removed outdated/redundant files:
|
|
26
|
-
- ❌ `UPLOAD_HANDLER_FIX.md` - Issue resolved in codebase
|
|
27
|
-
- ❌ `PUBLICATION_SUCCESS.md` - Outdated version info
|
|
28
|
-
- ❌ `PUBLISH_STEPS.md` - Covered in PUBLISH_GUIDE.md
|
|
29
|
-
- ❌ `RELEASE_NOTES_v1.0.5.md` - Old version notes
|
|
30
|
-
- ❌ `DUAL_API_RELEASE_SUMMARY.md` - Now standard functionality
|
|
31
|
-
- ❌ `LOCAL_DEVELOPMENT_FIXES.md` - Issues resolved
|
|
32
|
-
|
|
33
|
-
### 4. Code Quality Improvements
|
|
34
|
-
- **Removed Console Logs**: Cleaned up debug statements
|
|
35
|
-
- **Eliminated Unused Methods**: Removed redundant functions
|
|
36
|
-
- **Standardized Validation**: Consistent file type and size validation
|
|
37
|
-
- **Better Error Messages**: User-friendly error handling
|
|
38
|
-
|
|
39
|
-
## 🚀 New Features Added
|
|
40
|
-
|
|
41
|
-
### VideoModal Enhancements
|
|
42
|
-
- ✅ **Upload Progress**: Real-time progress indicators
|
|
43
|
-
- ✅ **Error Handling**: Retry functionality with fallback options
|
|
44
|
-
- ✅ **Upload Manager Support**: Full compatibility with new upload system
|
|
45
|
-
- ✅ **File Validation**: Proper video file type and size validation
|
|
46
|
-
|
|
47
|
-
### Upload System Improvements
|
|
48
|
-
- ✅ **Unified API**: Same interface for both uploadHandler and uploadManager
|
|
49
|
-
- ✅ **Better Validation**: Configurable file size limits and type restrictions
|
|
50
|
-
- ✅ **Progress Tracking**: Consistent progress reporting across all uploads
|
|
51
|
-
- ✅ **Error Recovery**: Retry mechanisms and fallback options
|
|
52
|
-
|
|
53
|
-
## 📊 Impact Summary
|
|
54
|
-
|
|
55
|
-
### Code Reduction
|
|
56
|
-
- **Removed**: ~300 lines of duplicate code
|
|
57
|
-
- **Consolidated**: Upload logic into single mixin
|
|
58
|
-
- **Eliminated**: 6 redundant documentation files
|
|
59
|
-
- **Cleaned**: All console.log statements and unused methods
|
|
60
|
-
|
|
61
|
-
### Functionality Improvements
|
|
62
|
-
- **Standardized**: Upload behavior across Image and Video modals
|
|
63
|
-
- **Enhanced**: Error handling and user feedback
|
|
64
|
-
- **Added**: Progress indicators for video uploads
|
|
65
|
-
- **Improved**: File validation and size limits
|
|
66
|
-
|
|
67
|
-
### Maintainability
|
|
68
|
-
- **Single Source**: Upload logic centralized in uploadMixin
|
|
69
|
-
- **Consistent**: Props and methods across components
|
|
70
|
-
- **Testable**: Isolated upload functionality
|
|
71
|
-
- **Extensible**: Easy to add new upload features
|
|
72
|
-
|
|
73
|
-
## 🔧 Technical Details
|
|
74
|
-
|
|
75
|
-
### Upload Mixin Features
|
|
76
|
-
```javascript
|
|
77
|
-
// Shared functionality
|
|
78
|
-
- validateFile(file, fileType)
|
|
79
|
-
- handleApiUpload(file)
|
|
80
|
-
- handleLegacyUpload(file)
|
|
81
|
-
- autoUpload(file)
|
|
82
|
-
- retryUpload(file)
|
|
83
|
-
- getErrorMessage(error)
|
|
84
|
-
- formatFileSize(bytes)
|
|
85
|
-
- resetUploadState()
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
### Props Standardization
|
|
89
|
-
```javascript
|
|
90
|
-
// Consistent across all modals
|
|
91
|
-
uploadHandler: Function
|
|
92
|
-
uploadManager: Object
|
|
93
|
-
maxFileSize: Number
|
|
94
|
-
allowedTypes: Array
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
## ✅ Quality Assurance
|
|
98
|
-
|
|
99
|
-
- **Build Success**: All builds complete without errors
|
|
100
|
-
- **No Diagnostics**: Clean code with no linting issues
|
|
101
|
-
- **Backward Compatible**: Existing implementations continue to work
|
|
102
|
-
- **Tested**: Upload functionality verified for both image and video files
|
|
103
|
-
|
|
104
|
-
## 📦 Published Version
|
|
105
|
-
|
|
106
|
-
**Package**: `vue2-premium-bbl-editor@1.2.7`
|
|
107
|
-
**Size**: 1.3 MB (package), 7.1 MB (unpacked)
|
|
108
|
-
**Files**: 136 files included
|
|
109
|
-
**Status**: ✅ Successfully published to npm
|
|
110
|
-
|
|
111
|
-
The codebase is now cleaner, more maintainable, and provides a standardized upload experience across all media types.
|
package/COMPATIBILITY_GUIDE.md
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
# 🔧 Compatibility Guide - JavaScript Syntax Errors
|
|
2
|
-
|
|
3
|
-
## 🚨 Common Error: "Unexpected token '!'"
|
|
4
|
-
|
|
5
|
-
If you're seeing this error when using the package:
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
Uncaught SyntaxError: Unexpected token '!' (at index.js:189:16)
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
This is caused by modern JavaScript syntax (nullish coalescing `??` or optional chaining `?.`) not being transpiled for older browsers or build systems.
|
|
12
|
-
|
|
13
|
-
## ✅ Solutions
|
|
14
|
-
|
|
15
|
-
### Solution 1: Update to Latest Version (Recommended)
|
|
16
|
-
|
|
17
|
-
Update to the latest version which includes better transpilation:
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
npm update vue2-premium-bbl-editor
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### Solution 2: Configure Your Project's Babel
|
|
24
|
-
|
|
25
|
-
Add these babel plugins to your project's `babel.config.js`:
|
|
26
|
-
|
|
27
|
-
```javascript
|
|
28
|
-
module.exports = {
|
|
29
|
-
presets: [
|
|
30
|
-
['@babel/preset-env', {
|
|
31
|
-
targets: {
|
|
32
|
-
browsers: ['> 1%', 'last 2 versions', 'not dead']
|
|
33
|
-
}
|
|
34
|
-
}]
|
|
35
|
-
],
|
|
36
|
-
plugins: [
|
|
37
|
-
'@babel/plugin-transform-optional-chaining',
|
|
38
|
-
'@babel/plugin-transform-nullish-coalescing-operator'
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
Install the required plugins:
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
npm install --save-dev @babel/plugin-transform-optional-chaining @babel/plugin-transform-nullish-coalescing-operator
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### Solution 3: Transpile Dependencies in Vue CLI
|
|
50
|
-
|
|
51
|
-
If using Vue CLI, add this to your `vue.config.js`:
|
|
52
|
-
|
|
53
|
-
```javascript
|
|
54
|
-
module.exports = {
|
|
55
|
-
transpileDependencies: [
|
|
56
|
-
'vue2-premium-bbl-editor',
|
|
57
|
-
/@tiptap/,
|
|
58
|
-
/prosemirror-/
|
|
59
|
-
]
|
|
60
|
-
}
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
### Solution 4: Webpack Configuration
|
|
64
|
-
|
|
65
|
-
For custom webpack setups, ensure you transpile the package:
|
|
66
|
-
|
|
67
|
-
```javascript
|
|
68
|
-
module.exports = {
|
|
69
|
-
module: {
|
|
70
|
-
rules: [
|
|
71
|
-
{
|
|
72
|
-
test: /\.js$/,
|
|
73
|
-
exclude: /node_modules\/(?!(vue2-premium-bbl-editor|@tiptap|prosemirror))/,
|
|
74
|
-
use: {
|
|
75
|
-
loader: 'babel-loader',
|
|
76
|
-
options: {
|
|
77
|
-
presets: ['@babel/preset-env'],
|
|
78
|
-
plugins: [
|
|
79
|
-
'@babel/plugin-transform-optional-chaining',
|
|
80
|
-
'@babel/plugin-transform-nullish-coalescing-operator'
|
|
81
|
-
]
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
]
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
## 🎯 Quick Fix for Immediate Use
|
|
91
|
-
|
|
92
|
-
If you need a quick fix, use the **Options API version** which has better compatibility:
|
|
93
|
-
|
|
94
|
-
```vue
|
|
95
|
-
<template>
|
|
96
|
-
<PremiumBblEditorOptionsAPI v-model="content" />
|
|
97
|
-
</template>
|
|
98
|
-
|
|
99
|
-
<script>
|
|
100
|
-
export default {
|
|
101
|
-
data() {
|
|
102
|
-
return {
|
|
103
|
-
content: '<p>Hello World!</p>'
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
</script>
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
## 🔍 Browser Support
|
|
111
|
-
|
|
112
|
-
The package now supports:
|
|
113
|
-
|
|
114
|
-
- ✅ Chrome 60+
|
|
115
|
-
- ✅ Firefox 55+
|
|
116
|
-
- ✅ Safari 12+
|
|
117
|
-
- ✅ Edge 79+
|
|
118
|
-
- ✅ IE 11 (with polyfills)
|
|
119
|
-
|
|
120
|
-
## 📞 Still Having Issues?
|
|
121
|
-
|
|
122
|
-
1. **Check your build tools**: Ensure you're using recent versions of Vue CLI, Webpack, or Vite
|
|
123
|
-
2. **Use the diagnostic tool**: Add `<DiagnosticTool />` to debug dependency issues
|
|
124
|
-
3. **Try Options API**: Use `PremiumBblEditorOptionsAPI` for maximum compatibility
|
|
125
|
-
4. **Check the console**: Look for specific error messages about missing dependencies
|
|
126
|
-
|
|
127
|
-
## 🚀 Recommended Setup
|
|
128
|
-
|
|
129
|
-
For the best compatibility, use this setup:
|
|
130
|
-
|
|
131
|
-
```javascript
|
|
132
|
-
// main.js
|
|
133
|
-
import Vue from 'vue'
|
|
134
|
-
import PremiumBblEditor from 'vue2-premium-bbl-editor'
|
|
135
|
-
import 'vue2-premium-bbl-editor/dist/vue2-premium-bbl-editor.css'
|
|
136
|
-
|
|
137
|
-
Vue.use(PremiumBblEditor)
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
```vue
|
|
141
|
-
<!-- Your component -->
|
|
142
|
-
<template>
|
|
143
|
-
<PremiumBblEditorOptionsAPI
|
|
144
|
-
v-model="content"
|
|
145
|
-
placeholder="Start writing..."
|
|
146
|
-
/>
|
|
147
|
-
</template>
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
This approach provides maximum compatibility across all Vue 2.6+ projects! 🎉
|