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.
@@ -0,0 +1,282 @@
1
+ # Installation Guide
2
+
3
+ ## Prerequisites
4
+
5
+ - Vue 2.6 or higher
6
+ - Node.js 12 or higher
7
+ - npm or yarn package manager
8
+
9
+ ## Installation Methods
10
+
11
+ ### 1. NPM Installation (Recommended)
12
+
13
+ ```bash
14
+ npm install vue2-bbl-editor
15
+ ```
16
+
17
+ ### 2. Yarn Installation
18
+
19
+ ```bash
20
+ yarn add vue2-bbl-editor
21
+ ```
22
+
23
+ ### 3. CDN Installation
24
+
25
+ ```html
26
+ <!-- Vue 2 -->
27
+ <script src="https://unpkg.com/vue@2"></script>
28
+
29
+ <!-- Editor -->
30
+ <script src="https://unpkg.com/vue2-bbl-editor"></script>
31
+ <link rel="stylesheet" href="https://unpkg.com/vue2-bbl-editor/dist/vue2-bbl-editor.css">
32
+ ```
33
+
34
+ ## Setup Methods
35
+
36
+ ### Method 1: Global Registration (Recommended)
37
+
38
+ ```javascript
39
+ // main.js
40
+ import Vue from 'vue'
41
+ import PremiumBblEditor from 'vue2-bbl-editor'
42
+
43
+ // Register the plugin
44
+ Vue.use(PremiumBblEditor)
45
+
46
+ // Or with options
47
+ Vue.use(PremiumBblEditor, {
48
+ registerAllComponents: true // Registers all sub-components globally
49
+ })
50
+
51
+ new Vue({
52
+ render: h => h(App),
53
+ }).$mount('#app')
54
+ ```
55
+
56
+ ### Method 2: Component Registration
57
+
58
+ ```javascript
59
+ // In your component
60
+ import { PremiumBblEditor } from 'vue2-bbl-editor'
61
+
62
+ export default {
63
+ components: {
64
+ PremiumBblEditor
65
+ }
66
+ }
67
+ ```
68
+
69
+ ### Method 3: Individual Component Imports
70
+
71
+ ```javascript
72
+ import {
73
+ PremiumBblEditor,
74
+ ToolbarMain,
75
+ ImageModal,
76
+ useEditor
77
+ } from 'vue2-bbl-editor'
78
+ ```
79
+
80
+ ## Basic Usage
81
+
82
+ ```vue
83
+ <template>
84
+ <div>
85
+ <PremiumBblEditor
86
+ v-model="content"
87
+ placeholder="Start writing..."
88
+ @input="handleInput"
89
+ />
90
+ </div>
91
+ </template>
92
+
93
+ <script>
94
+ export default {
95
+ data() {
96
+ return {
97
+ content: '<p>Hello World!</p>'
98
+ }
99
+ },
100
+ methods: {
101
+ handleInput(content) {
102
+ console.log('Content updated:', content)
103
+ }
104
+ }
105
+ }
106
+ </script>
107
+ ```
108
+
109
+ ## TypeScript Setup
110
+
111
+ If you're using TypeScript, the package includes full type definitions:
112
+
113
+ ```typescript
114
+ // types are automatically imported
115
+ import { PremiumBblEditor, ToolbarConfig } from 'vue2-bbl-editor'
116
+
117
+ interface ComponentData {
118
+ content: string
119
+ config: ToolbarConfig
120
+ }
121
+
122
+ export default Vue.extend({
123
+ data(): ComponentData {
124
+ return {
125
+ content: '',
126
+ config: {
127
+ bold: true,
128
+ italic: true,
129
+ // ... other options
130
+ }
131
+ }
132
+ }
133
+ })
134
+ ```
135
+
136
+ ## CSS Import
137
+
138
+ The package includes CSS that needs to be imported:
139
+
140
+ ### Method 1: Automatic (when using Vue plugin)
141
+ CSS is automatically imported when you use `Vue.use(PremiumBblEditor)`
142
+
143
+ ### Method 2: Manual Import
144
+ ```javascript
145
+ import 'vue2-bbl-editor/dist/vue2-bbl-editor.css'
146
+ ```
147
+
148
+ ### Method 3: CSS in HTML
149
+ ```html
150
+ <link rel="stylesheet" href="https://unpkg.com/vue2-bbl-editor/dist/vue2-bbl-editor.css">
151
+ ```
152
+
153
+ ## Build Configuration
154
+
155
+ ### Webpack Configuration
156
+
157
+ If you're using a custom webpack setup, you may need to configure it to handle the package:
158
+
159
+ ```javascript
160
+ // webpack.config.js
161
+ module.exports = {
162
+ resolve: {
163
+ alias: {
164
+ 'vue$': 'vue/dist/vue.esm.js'
165
+ }
166
+ },
167
+ module: {
168
+ rules: [
169
+ {
170
+ test: /\.vue$/,
171
+ loader: 'vue-loader'
172
+ },
173
+ {
174
+ test: /\.css$/,
175
+ use: ['style-loader', 'css-loader']
176
+ }
177
+ ]
178
+ }
179
+ }
180
+ ```
181
+
182
+ ### Vue CLI Configuration
183
+
184
+ For Vue CLI projects, add this to your `vue.config.js`:
185
+
186
+ ```javascript
187
+ // vue.config.js
188
+ module.exports = {
189
+ transpileDependencies: [
190
+ 'vue2-bbl-editor'
191
+ ]
192
+ }
193
+ ```
194
+
195
+ ## Nuxt.js Setup
196
+
197
+ For Nuxt.js applications:
198
+
199
+ ```javascript
200
+ // nuxt.config.js
201
+ export default {
202
+ plugins: [
203
+ { src: '~/plugins/tiptap-editor.js', mode: 'client' }
204
+ ],
205
+ css: [
206
+ 'vue2-bbl-editor/dist/vue2-bbl-editor.css'
207
+ ]
208
+ }
209
+ ```
210
+
211
+ ```javascript
212
+ // plugins/tiptap-editor.js
213
+ import Vue from 'vue'
214
+ import PremiumBblEditor from 'vue2-bbl-editor'
215
+
216
+ Vue.use(PremiumBblEditor)
217
+ ```
218
+
219
+ ## Troubleshooting
220
+
221
+ ### Common Issues
222
+
223
+ 1. **"Cannot resolve module" error**
224
+ - Make sure you've installed the package: `npm install vue2-bbl-editor`
225
+ - Check that your Node.js version is 12 or higher
226
+
227
+ 2. **CSS not loading**
228
+ - Import the CSS manually: `import 'vue2-bbl-editor/dist/vue2-bbl-editor.css'`
229
+ - Or use the CDN link in your HTML
230
+
231
+ 3. **TypeScript errors**
232
+ - Make sure you have the latest version of the package
233
+ - Check that your `tsconfig.json` includes the package in `types`
234
+
235
+ 4. **Build errors with Vue CLI**
236
+ - Add the package to `transpileDependencies` in `vue.config.js`
237
+
238
+ 5. **SSR issues with Nuxt.js**
239
+ - Use client-side only plugin: `{ src: '~/plugins/tiptap-editor.js', mode: 'client' }`
240
+
241
+ ### Browser Compatibility
242
+
243
+ The editor supports:
244
+ - Chrome 60+
245
+ - Firefox 55+
246
+ - Safari 11+
247
+ - Edge 79+
248
+
249
+ For older browsers, you may need additional polyfills.
250
+
251
+ ### Performance Optimization
252
+
253
+ For better performance in production:
254
+
255
+ 1. **Tree Shaking**: Import only the components you need
256
+ 2. **Code Splitting**: Use dynamic imports for the editor
257
+ 3. **CSS Optimization**: Use PurgeCSS to remove unused styles
258
+
259
+ ```javascript
260
+ // Dynamic import example
261
+ const PremiumBblEditor = () => import('vue2-bbl-editor')
262
+
263
+ export default {
264
+ components: {
265
+ PremiumBblEditor
266
+ }
267
+ }
268
+ ```
269
+
270
+ ## Next Steps
271
+
272
+ - Check out the [README.md](README.md) for full API documentation
273
+ - See [examples/](examples/) for usage examples
274
+ - Read the [CHANGELOG.md](CHANGELOG.md) for version history
275
+
276
+ ## Support
277
+
278
+ If you encounter any issues during installation:
279
+
280
+ 1. Check the [GitHub Issues](https://github.com/kazi-shahin/vue2-bbl-editor/issues)
281
+ 2. Make sure you're using compatible versions of Vue and Node.js
282
+ 3. Try clearing your node_modules and reinstalling: `rm -rf node_modules package-lock.json && npm install`
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Vue 2 Premium Tiptap Editor
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.