vue2-premium-bbl-editor 1.0.1 → 1.0.4

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/CHANGELOG.md CHANGED
@@ -5,6 +5,75 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.0.4] - 2024-01-18
9
+
10
+ ### Fixed
11
+ - **Critical**: Resolved Vue version mismatch between vue@2.6.14 and vue-template-compiler@2.7.16
12
+ - **Syntax**: Fixed optional chaining operators (`?.`) causing compilation errors in older Babel setups
13
+ - **Composition API**: Fixed imports to use `@vue/composition-api` instead of `vue` for Vue 2.6 compatibility
14
+ - **Development**: Added proper Vue Composition API setup in main.js for local development
15
+
16
+ ### Improved
17
+ - Better compatibility with Vue 2.6 projects
18
+ - Resolved all compilation errors in development and production builds
19
+ - Enhanced local development experience with proper error handling
20
+ - All linting issues resolved
21
+
22
+ ### Technical
23
+ - Updated vue-template-compiler to match Vue version (2.6.14)
24
+ - Replaced optional chaining with compatible syntax across all components
25
+ - Fixed Composition API imports in useEditor composable
26
+ - Added comprehensive local development fixes documentation
27
+
28
+ ## [1.0.3] - 2024-01-18
29
+
30
+ ### Fixed
31
+ - **Critical**: Added missing ProseMirror peer dependencies to resolve `Can't resolve '@tiptap/pm/dropcursor'` errors
32
+ - Updated installation commands to include all required ProseMirror packages
33
+ - Enhanced troubleshooting guide with ProseMirror-specific error solutions
34
+
35
+ ### Added
36
+ - Complete ProseMirror dependencies list in package.json peer dependencies
37
+ - Step-by-step installation guide as alternative to one-command install
38
+ - Specific error resolution for ProseMirror module resolution issues
39
+
40
+ ### Improved
41
+ - More comprehensive dependency installation instructions
42
+ - Better error handling documentation for missing dependencies
43
+
44
+ ## [1.0.2] - 2024-01-18
45
+
46
+ ### Added
47
+ - **Documentation**: Comprehensive troubleshooting guide for "Loading Premium Editor..." issue
48
+ - **Setup Guide**: Quick setup instructions with one-command installation
49
+ - **Peer Dependencies**: Complete list of required Tiptap dependencies in package.json
50
+
51
+ ### Improved
52
+ - Better error handling documentation
53
+ - Step-by-step setup instructions for Vue 2.6 projects
54
+ - Nuxt.js specific setup instructions
55
+
56
+ ### Fixed
57
+ - Documentation for Vue Composition API requirement in Vue 2.6
58
+ - Clear instructions for resolving loading state issues
59
+
60
+ ## [1.0.1] - 2024-01-18
61
+
62
+ ### Fixed
63
+ - **Critical**: Resolved Vue case sensitivity issue in CommonJS build that caused `CaseSensitivePathsPlugin` errors when importing in other projects
64
+ - Fixed externals configuration to properly handle Vue module resolution across different build formats
65
+ - Updated repository URLs to correct GitHub path (Mahadi74/vue2-premium-bbl-editor)
66
+
67
+ ### Improved
68
+ - **Bundle Size**: Reduced minified bundle size from 440KB to 213KB (51KB gzipped)
69
+ - Better externals configuration for Tiptap dependencies
70
+ - Added proper Vue runtime alias for consistent module resolution
71
+
72
+ ### Technical
73
+ - Fixed webpack externals to use proper format for different module systems (CommonJS, UMD, AMD)
74
+ - Added comprehensive externals list for all Tiptap extensions
75
+ - Improved build configuration for library distribution
76
+
8
77
  ## [1.0.0] - 2024-01-18
9
78
 
10
79
  ### Added
@@ -0,0 +1,137 @@
1
+ # Local Development Fixes Applied
2
+
3
+ ## 🎯 Issues Resolved
4
+
5
+ ### 1. ✅ Vue Version Mismatch
6
+ **Problem:** Vue packages version mismatch between vue@2.6.14 and vue-template-compiler@2.7.16
7
+
8
+ **Solution:**
9
+ ```bash
10
+ npm install vue-template-compiler@2.6.14 --save-dev
11
+ ```
12
+
13
+ ### 2. ✅ Vue Composition API Setup
14
+ **Problem:** Missing Vue Composition API setup for Vue 2.6
15
+
16
+ **Solution:** Updated `src/main.js`:
17
+ ```javascript
18
+ import Vue from 'vue'
19
+ import VueCompositionAPI from '@vue/composition-api'
20
+ import EditorDemo from './components/EditorDemo.vue'
21
+
22
+ Vue.use(VueCompositionAPI) // Required for Vue 2.6
23
+ Vue.config.productionTip = false
24
+
25
+ new Vue({
26
+ render: h => h(EditorDemo),
27
+ }).$mount('#app')
28
+ ```
29
+
30
+ ### 3. ✅ Optional Chaining Syntax Errors
31
+ **Problem:** Babel not supporting optional chaining operators (`?.`) in templates
32
+
33
+ **Files Fixed:**
34
+ - `src/components/Modals/ImageModal.vue`
35
+ - `src/components/PremiumBblEditor.vue`
36
+ - `src/components/Menus/VideoBubbleMenu.vue`
37
+ - `src/components/Menus/ImageBubbleMenu.vue`
38
+
39
+ **Changes:**
40
+ ```javascript
41
+ // Before (causing errors)
42
+ selectedFile?.name
43
+ event.relatedTarget?.closest('.menu')
44
+ domNode?.contains(container)
45
+
46
+ // After (compatible)
47
+ selectedFile && selectedFile.name
48
+ event.relatedTarget && event.relatedTarget.closest('.menu')
49
+ domNode && domNode.contains(container)
50
+ ```
51
+
52
+ ### 4. ✅ Composition API Import Errors
53
+ **Problem:** Importing Composition API functions from 'vue' instead of '@vue/composition-api'
54
+
55
+ **Solution:** Updated `src/composables/useEditor.js`:
56
+ ```javascript
57
+ // Before
58
+ import { ref, computed, watch, onMounted, onBeforeUnmount } from 'vue'
59
+
60
+ // After
61
+ import { ref, computed, watch, onMounted, onBeforeUnmount } from '@vue/composition-api'
62
+ ```
63
+
64
+ ## 🚀 Current Status
65
+
66
+ ### ✅ Development Server
67
+ - **Status:** Running successfully at http://localhost:8082
68
+ - **Compilation:** No errors
69
+ - **Hot reload:** Working properly
70
+
71
+ ### ✅ Linting
72
+ - **Status:** All lint checks pass
73
+ - **Command:** `npm run lint` - No errors found
74
+
75
+ ### ✅ Production Build
76
+ - **Status:** Builds successfully
77
+ - **Size:** 230KB minified (56KB gzipped)
78
+ - **Command:** `npm run build:lib` - No errors
79
+
80
+ ### ✅ All Features Working
81
+ - Editor loads properly
82
+ - All toolbar functions work
83
+ - Bubble menus functional
84
+ - Image/video upload modals work
85
+ - Table editing works
86
+ - No console errors
87
+
88
+ ## 📋 Commands That Now Work
89
+
90
+ ```bash
91
+ # Development
92
+ npm run serve # ✅ Works - starts dev server
93
+
94
+ # Building
95
+ npm run build # ✅ Works - builds demo app
96
+ npm run build:lib # ✅ Works - builds library
97
+
98
+ # Quality
99
+ npm run lint # ✅ Works - no errors
100
+ npm test # ✅ Available for testing
101
+
102
+ # Package
103
+ npm publish # ✅ Ready for publishing
104
+ ```
105
+
106
+ ## 🎯 For Other Developers
107
+
108
+ If you encounter similar issues in other projects:
109
+
110
+ 1. **Check Vue versions match:**
111
+ ```bash
112
+ npm list vue vue-template-compiler
113
+ ```
114
+
115
+ 2. **Install Composition API for Vue 2.6:**
116
+ ```bash
117
+ npm install @vue/composition-api
118
+ ```
119
+
120
+ 3. **Add to main.js:**
121
+ ```javascript
122
+ import VueCompositionAPI from '@vue/composition-api'
123
+ Vue.use(VueCompositionAPI)
124
+ ```
125
+
126
+ 4. **Use compatible syntax:**
127
+ - Avoid optional chaining (`?.`) in templates
128
+ - Import Composition API from correct package
129
+ - Ensure Babel plugins are configured
130
+
131
+ ## 🎉 Result
132
+
133
+ The Vue 2 Premium BBL Editor now runs perfectly in local development with:
134
+ - No compilation errors
135
+ - No runtime errors
136
+ - All features functional
137
+ - Ready for production use
package/QUICK_SETUP.md ADDED
@@ -0,0 +1,70 @@
1
+ # Quick Setup Guide
2
+
3
+ ## 🚀 One-Command Installation
4
+
5
+ Copy and paste this command to install everything you need:
6
+
7
+ ```bash
8
+ 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
9
+ ```
10
+
11
+ ## 📝 Setup Code
12
+
13
+ **1. Update your main.js:**
14
+ ```javascript
15
+ import Vue from 'vue'
16
+ import VueCompositionAPI from '@vue/composition-api'
17
+ import PremiumBblEditor from 'vue2-premium-bbl-editor'
18
+ import 'vue2-premium-bbl-editor/dist/vue2-premium-bbl-editor.css'
19
+ import App from './App.vue'
20
+
21
+ // Required for Vue 2.6
22
+ Vue.use(VueCompositionAPI)
23
+
24
+ // Register the editor
25
+ Vue.use(PremiumBblEditor)
26
+
27
+ new Vue({
28
+ render: h => h(App),
29
+ }).$mount('#app')
30
+ ```
31
+
32
+ **2. Use in your component:**
33
+ ```vue
34
+ <template>
35
+ <div>
36
+ <PremiumBblEditor
37
+ v-model="content"
38
+ placeholder="Start writing..."
39
+ />
40
+ </div>
41
+ </template>
42
+
43
+ <script>
44
+ export default {
45
+ data() {
46
+ return {
47
+ content: '<p>Hello World!</p>'
48
+ }
49
+ }
50
+ }
51
+ </script>
52
+ ```
53
+
54
+ ## ✅ That's it!
55
+
56
+ Your editor should now load properly without the "Loading Premium Editor..." message.
57
+
58
+ ## 🔧 If Still Having Issues
59
+
60
+ 1. **Clear node_modules and reinstall:**
61
+ ```bash
62
+ rm -rf node_modules package-lock.json
63
+ npm install
64
+ ```
65
+
66
+ 2. **Check for console errors** in browser DevTools
67
+
68
+ 3. **See TROUBLESHOOTING.md** for detailed solutions
69
+
70
+ 4. **Create an issue:** https://github.com/Mahadi74/vue2-premium-bbl-editor/issues
@@ -0,0 +1,397 @@
1
+ # Troubleshooting Guide
2
+
3
+ # Troubleshooting Guide
4
+
5
+ ## Common Issues and Solutions
6
+
7
+ ### 🔄 "Loading Premium Editor..." Stuck Issue
8
+
9
+ **Problem:** Editor shows "Loading Premium Editor..." and never loads
10
+
11
+ **Root Causes & Solutions:**
12
+
13
+ #### 1. Missing Peer Dependencies
14
+ The most common cause is missing Tiptap dependencies.
15
+
16
+ **Solution:**
17
+ ```bash
18
+ # Install all required peer dependencies
19
+ npm install @tiptap/core @tiptap/vue-2 @tiptap/starter-kit
20
+ npm install @tiptap/extension-text-style @tiptap/extension-color
21
+ npm install @tiptap/extension-highlight @tiptap/extension-underline
22
+ npm install @tiptap/extension-text-align @tiptap/extension-link
23
+ npm install @tiptap/extension-font-family @tiptap/extension-code
24
+ npm install @tiptap/extension-code-block @tiptap/extension-table
25
+ npm install @tiptap/extension-table-row @tiptap/extension-table-cell
26
+ npm install @tiptap/extension-table-header @tiptap/extension-task-list
27
+ npm install @tiptap/extension-task-item @tiptap/extension-placeholder
28
+
29
+ # Or install all at once
30
+ npm install @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
31
+ ```
32
+
33
+ #### 2. Vue Composition API Missing (Vue 2.6)
34
+ The editor uses Vue Composition API which needs to be installed for Vue 2.6.
35
+
36
+ **Solution:**
37
+ ```bash
38
+ npm install @vue/composition-api
39
+ ```
40
+
41
+ Then in your main.js:
42
+ ```javascript
43
+ import Vue from 'vue'
44
+ import VueCompositionAPI from '@vue/composition-api'
45
+
46
+ Vue.use(VueCompositionAPI)
47
+ ```
48
+
49
+ #### 3. Incorrect Import/Registration
50
+
51
+ **Problem:** Component not properly registered
52
+
53
+ **Solution:**
54
+ ```javascript
55
+ // Method 1: Global Registration (Recommended)
56
+ import Vue from 'vue'
57
+ import PremiumBblEditor from 'vue2-premium-bbl-editor'
58
+
59
+ Vue.use(PremiumBblEditor)
60
+
61
+ // Method 2: Component Registration
62
+ import { PremiumBblEditor } from 'vue2-premium-bbl-editor'
63
+
64
+ export default {
65
+ components: {
66
+ PremiumBblEditor
67
+ }
68
+ }
69
+ ```
70
+
71
+ #### 4. CSS Not Loaded
72
+
73
+ **Problem:** Missing styles cause layout issues
74
+
75
+ **Solution:**
76
+ ```javascript
77
+ // Import CSS in main.js
78
+ import 'vue2-premium-bbl-editor/dist/vue2-premium-bbl-editor.css'
79
+ ```
80
+
81
+ #### 5. Build Configuration Issues
82
+
83
+ **Problem:** Webpack/build tools not handling the package correctly
84
+
85
+ **Solution for Vue CLI:**
86
+ ```javascript
87
+ // vue.config.js
88
+ module.exports = {
89
+ transpileDependencies: [
90
+ 'vue2-premium-bbl-editor',
91
+ '@tiptap/core',
92
+ '@tiptap/vue-2'
93
+ ]
94
+ }
95
+ ```
96
+
97
+ **Solution for Nuxt.js:**
98
+ ```javascript
99
+ // nuxt.config.js
100
+ export default {
101
+ plugins: [
102
+ { src: '~/plugins/editor.js', mode: 'client' }
103
+ ],
104
+ css: [
105
+ 'vue2-premium-bbl-editor/dist/vue2-premium-bbl-editor.css'
106
+ ]
107
+ }
108
+ ```
109
+
110
+ ```javascript
111
+ // plugins/editor.js
112
+ import Vue from 'vue'
113
+ import PremiumBblEditor from 'vue2-premium-bbl-editor'
114
+
115
+ Vue.use(PremiumBblEditor)
116
+ ```
117
+
118
+ ### 🔧 Quick Debug Steps
119
+
120
+ 1. **Check Console Errors:**
121
+ Open browser DevTools and look for JavaScript errors
122
+
123
+ 2. **Verify Dependencies:**
124
+ ```bash
125
+ npm list @tiptap/core @tiptap/vue-2
126
+ ```
127
+
128
+ 3. **Test Minimal Setup:**
129
+ ```vue
130
+ <template>
131
+ <div>
132
+ <PremiumBblEditor
133
+ v-model="content"
134
+ placeholder="Test editor..."
135
+ />
136
+ </div>
137
+ </template>
138
+
139
+ <script>
140
+ export default {
141
+ data() {
142
+ return {
143
+ content: '<p>Hello World!</p>'
144
+ }
145
+ }
146
+ }
147
+ </script>
148
+ ```
149
+
150
+ 4. **Check Network Tab:**
151
+ Ensure all assets are loading correctly
152
+
153
+ ### 📋 Complete Working Setup Example
154
+
155
+ **main.js:**
156
+ ```javascript
157
+ import Vue from 'vue'
158
+ import VueCompositionAPI from '@vue/composition-api'
159
+ import PremiumBblEditor from 'vue2-premium-bbl-editor'
160
+ import 'vue2-premium-bbl-editor/dist/vue2-premium-bbl-editor.css'
161
+ import App from './App.vue'
162
+
163
+ Vue.use(VueCompositionAPI)
164
+ Vue.use(PremiumBblEditor)
165
+
166
+ new Vue({
167
+ render: h => h(App),
168
+ }).$mount('#app')
169
+ ```
170
+
171
+ **Component:**
172
+ ```vue
173
+ <template>
174
+ <div class="editor-container">
175
+ <PremiumBblEditor
176
+ v-model="content"
177
+ placeholder="Start writing..."
178
+ @ready="onEditorReady"
179
+ />
180
+ </div>
181
+ </template>
182
+
183
+ <script>
184
+ export default {
185
+ data() {
186
+ return {
187
+ content: '<p>Welcome to the editor!</p>'
188
+ }
189
+ },
190
+ methods: {
191
+ onEditorReady(editor) {
192
+ console.log('Editor is ready!', editor)
193
+ }
194
+ }
195
+ }
196
+ </script>
197
+ ```
198
+
199
+ ---
200
+
201
+ ## ✅ Fixed in v1.0.1: Case Sensitivity Error
202
+
203
+ **Error:**
204
+ ```
205
+ Module not found: Error: [CaseSensitivePathsPlugin] `/path/to/node_modules/Vue/dist/vue.runtime.esm.js` does not match the corresponding path on disk `vue`.
206
+ ```
207
+
208
+ **Solution:**
209
+ Update to version 1.0.1 or later:
210
+ ```bash
211
+ npm update vue2-premium-bbl-editor
212
+ ```
213
+
214
+ This issue was caused by incorrect externals configuration in the webpack build and has been completely resolved.
215
+
216
+ ---
217
+
218
+ ## Installation Issues
219
+
220
+ ### 1. Peer Dependency Warnings
221
+
222
+ **Issue:** Warnings about Vue 2 peer dependencies
223
+
224
+ **Solution:**
225
+ ```bash
226
+ npm install vue@^2.6.0 --save
227
+ npm install vue2-premium-bbl-editor
228
+ ```
229
+
230
+ ### 2. TypeScript Errors
231
+
232
+ **Issue:** TypeScript cannot find module declarations
233
+
234
+ **Solution:**
235
+ The package includes TypeScript definitions. If you're still getting errors:
236
+
237
+ ```typescript
238
+ // Add to your types or declarations file
239
+ declare module 'vue2-premium-bbl-editor'
240
+ ```
241
+
242
+ ### 3. CSS Not Loading
243
+
244
+ **Issue:** Editor appears unstyled
245
+
246
+ **Solution:**
247
+ Import the CSS manually:
248
+ ```javascript
249
+ import 'vue2-premium-bbl-editor/dist/vue2-premium-bbl-editor.css'
250
+ ```
251
+
252
+ Or use the CDN:
253
+ ```html
254
+ <link rel="stylesheet" href="https://unpkg.com/vue2-premium-bbl-editor/dist/vue2-premium-bbl-editor.css">
255
+ ```
256
+
257
+ ---
258
+
259
+ ## Build Issues
260
+
261
+ ### 1. Bundle Size Warnings
262
+
263
+ **Issue:** Webpack warnings about large bundle size
264
+
265
+ **Solution:**
266
+ These warnings are normal for rich text editors. The gzipped size is only 51KB, which is excellent. To reduce warnings:
267
+
268
+ ```javascript
269
+ // vue.config.js
270
+ module.exports = {
271
+ configureWebpack: {
272
+ performance: {
273
+ maxAssetSize: 1000000,
274
+ maxEntrypointSize: 1000000
275
+ }
276
+ }
277
+ }
278
+ ```
279
+
280
+ ### 2. Transpilation Issues
281
+
282
+ **Issue:** Build errors with older browsers
283
+
284
+ **Solution:**
285
+ Add to your `vue.config.js`:
286
+ ```javascript
287
+ module.exports = {
288
+ transpileDependencies: [
289
+ 'vue2-premium-bbl-editor'
290
+ ]
291
+ }
292
+ ```
293
+
294
+ ---
295
+
296
+ ## Runtime Issues
297
+
298
+ ### 1. Editor Not Rendering
299
+
300
+ **Issue:** Component doesn't appear
301
+
302
+ **Solution:**
303
+ 1. Ensure Vue 2.6+ is installed
304
+ 2. Check that the component is properly registered:
305
+ ```javascript
306
+ import PremiumBblEditor from 'vue2-premium-bbl-editor'
307
+ Vue.use(PremiumBblEditor)
308
+ ```
309
+
310
+ ### 2. Content Not Updating
311
+
312
+ **Issue:** v-model not working
313
+
314
+ **Solution:**
315
+ Use the correct event handling:
316
+ ```vue
317
+ <template>
318
+ <PremiumBblEditor
319
+ v-model="content"
320
+ @input="handleInput"
321
+ />
322
+ </template>
323
+
324
+ <script>
325
+ export default {
326
+ data() {
327
+ return {
328
+ content: '<p>Initial content</p>'
329
+ }
330
+ },
331
+ methods: {
332
+ handleInput(newContent) {
333
+ console.log('Content updated:', newContent)
334
+ }
335
+ }
336
+ }
337
+ </script>
338
+ ```
339
+
340
+ ---
341
+
342
+ ## Performance Issues
343
+
344
+ ### 1. Slow Loading
345
+
346
+ **Issue:** Editor takes time to load
347
+
348
+ **Solution:**
349
+ Use dynamic imports for better performance:
350
+ ```javascript
351
+ const PremiumBblEditor = () => import('vue2-premium-bbl-editor')
352
+
353
+ export default {
354
+ components: {
355
+ PremiumBblEditor
356
+ }
357
+ }
358
+ ```
359
+
360
+ ### 2. Memory Leaks
361
+
362
+ **Issue:** Memory usage increases over time
363
+
364
+ **Solution:**
365
+ Ensure proper cleanup:
366
+ ```javascript
367
+ beforeDestroy() {
368
+ // Editor cleanup is handled automatically
369
+ // But you can add custom cleanup here
370
+ }
371
+ ```
372
+
373
+ ---
374
+
375
+ ## Getting Help
376
+
377
+ If you encounter issues not covered here:
378
+
379
+ 1. **Check the version**: Make sure you're using the latest version
380
+ ```bash
381
+ npm list vue2-premium-bbl-editor
382
+ ```
383
+
384
+ 2. **GitHub Issues**: https://github.com/Mahadi74/vue2-premium-bbl-editor/issues
385
+
386
+ 3. **NPM Package**: https://www.npmjs.com/package/vue2-premium-bbl-editor
387
+
388
+ 4. **Documentation**: See README.md for full API documentation
389
+
390
+ ---
391
+
392
+ ## Version History
393
+
394
+ - **v1.0.1**: Fixed case sensitivity issue, reduced bundle size
395
+ - **v1.0.0**: Initial release
396
+
397
+ Always use the latest version for the best experience and latest fixes.