vue2-premium-bbl-editor 1.0.0 → 1.0.2

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,39 @@ 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.2] - 2024-01-18
9
+
10
+ ### Added
11
+ - **Documentation**: Comprehensive troubleshooting guide for "Loading Premium Editor..." issue
12
+ - **Setup Guide**: Quick setup instructions with one-command installation
13
+ - **Peer Dependencies**: Complete list of required Tiptap dependencies in package.json
14
+
15
+ ### Improved
16
+ - Better error handling documentation
17
+ - Step-by-step setup instructions for Vue 2.6 projects
18
+ - Nuxt.js specific setup instructions
19
+
20
+ ### Fixed
21
+ - Documentation for Vue Composition API requirement in Vue 2.6
22
+ - Clear instructions for resolving loading state issues
23
+
24
+ ## [1.0.1] - 2024-01-18
25
+
26
+ ### Fixed
27
+ - **Critical**: Resolved Vue case sensitivity issue in CommonJS build that caused `CaseSensitivePathsPlugin` errors when importing in other projects
28
+ - Fixed externals configuration to properly handle Vue module resolution across different build formats
29
+ - Updated repository URLs to correct GitHub path (Mahadi74/vue2-premium-bbl-editor)
30
+
31
+ ### Improved
32
+ - **Bundle Size**: Reduced minified bundle size from 440KB to 213KB (51KB gzipped)
33
+ - Better externals configuration for Tiptap dependencies
34
+ - Added proper Vue runtime alias for consistent module resolution
35
+
36
+ ### Technical
37
+ - Fixed webpack externals to use proper format for different module systems (CommonJS, UMD, AMD)
38
+ - Added comprehensive externals list for all Tiptap extensions
39
+ - Improved build configuration for library distribution
40
+
8
41
  ## [1.0.0] - 2024-01-18
9
42
 
10
43
  ### Added
@@ -0,0 +1,64 @@
1
+ # Bundle Size Optimization Guide
2
+
3
+ ## Current Status: ✅ Published Successfully!
4
+ - Package: vue2-premium-bbl-editor@1.0.0
5
+ - Size: 440 KiB minified (124 KiB gzipped)
6
+ - Status: **Acceptable for a full-featured editor**
7
+
8
+ ## Size Comparison with Popular Editors:
9
+ - **CKEditor 5**: ~200-300 KB gzipped
10
+ - **TinyMCE**: ~150-250 KB gzipped
11
+ - **Quill**: ~100-150 KB gzipped
12
+ - **Your Editor**: ~124 KB gzipped ✅ **Competitive!**
13
+
14
+ ## Future Optimization Options (v2.0+):
15
+
16
+ ### 1. Tree Shaking Improvements
17
+ ```javascript
18
+ // Allow users to import only what they need
19
+ import { PremiumBblEditor, BasicToolbar } from 'vue2-premium-bbl-editor/lite'
20
+ ```
21
+
22
+ ### 2. Extension Splitting
23
+ ```javascript
24
+ // Separate heavy extensions
25
+ import ImageExtension from 'vue2-premium-bbl-editor/extensions/image'
26
+ import TableExtension from 'vue2-premium-bbl-editor/extensions/table'
27
+ ```
28
+
29
+ ### 3. Dynamic Imports
30
+ ```javascript
31
+ // Lazy load heavy features
32
+ const TableExtension = () => import('./extensions/table')
33
+ ```
34
+
35
+ ### 4. Build Variants
36
+ - `vue2-premium-bbl-editor/lite` - Basic editor (50KB)
37
+ - `vue2-premium-bbl-editor/standard` - Current version (124KB)
38
+ - `vue2-premium-bbl-editor/full` - All features (200KB)
39
+
40
+ ## Current Bundle Analysis:
41
+ - **Tiptap Core**: ~40KB
42
+ - **ProseMirror**: ~60KB
43
+ - **Extensions**: ~20KB
44
+ - **Your Components**: ~4KB
45
+
46
+ ## Recommendations:
47
+ 1. **Keep current size** - It's competitive and feature-complete
48
+ 2. **Monitor usage** - See which features users actually use
49
+ 3. **Consider lite version** - For users who need basic editing only
50
+ 4. **External dependencies** - Let users provide their own Tiptap if needed
51
+
52
+ ## Performance Tips for Users:
53
+ ```javascript
54
+ // Code splitting
55
+ const Editor = () => import('vue2-premium-bbl-editor')
56
+
57
+ // Lazy loading
58
+ Vue.component('PremiumBblEditor', () => import('vue2-premium-bbl-editor'))
59
+
60
+ // CDN usage
61
+ <script src="https://unpkg.com/vue2-premium-bbl-editor"></script>
62
+ ```
63
+
64
+ Your current bundle size is **excellent** for a production-ready editor! 🎉
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.