@myissue/vue-website-page-builder 3.4.68 → 3.4.73
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 +56 -47
- package/dist/style.css +1 -1
- package/dist/vue-website-page-builder.js +4504 -4247
- package/dist/vue-website-page-builder.umd.cjs +34 -34
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,23 +19,21 @@
|
|
|
19
19
|
- [Installation](#installation)
|
|
20
20
|
- [Quick Start](#quick-start)
|
|
21
21
|
- [Nuxt Integration](#nuxt-integration)
|
|
22
|
-
- [1.
|
|
23
|
-
- [2.
|
|
24
|
-
- [3. Register the Plugin in `nuxt.config.ts`](#3-register-the-plugin-in-nuxtconfigts)
|
|
25
|
-
- [4. Using the Page Builder Component](#4-using-the-page-builder-component)
|
|
26
|
-
- [5. Why Initialize the Page Builder with `onMounted` in Nuxt?](#5-why-initialize-the-page-builder-with-onmounted-in-nuxt)
|
|
27
|
-
- [Vue Integration](#vue-integration)
|
|
28
|
-
- [1. Install the Package](#1-install-the-package-1)
|
|
29
|
-
- [2. Import and use the Page Builder Plugin](#2-import-and-use-the-page-builder-plugin)
|
|
22
|
+
- [1. Create a Nuxt Plugin](#1-create-a-nuxt-plugin)
|
|
23
|
+
- [2. Register the Plugin in `nuxt.config.ts`](#2-register-the-plugin-in-nuxtconfigts)
|
|
30
24
|
- [3. Using the Page Builder Component](#3-using-the-page-builder-component)
|
|
31
|
-
- [4. Initialize Page Builder with `onMounted`
|
|
25
|
+
- [4. Why Initialize the Page Builder with `onMounted` in Nuxt?](#4-why-initialize-the-page-builder-with-onmounted-in-nuxt)
|
|
26
|
+
- [Vue Integration](#vue-integration)
|
|
27
|
+
- [1. Import and use the Page Builder Plugin](#1-import-and-use-the-page-builder-plugin)
|
|
28
|
+
- [2. Using the Page Builder Component](#2-using-the-page-builder-component)
|
|
29
|
+
- [3. Initialize Page Builder with `onMounted` Troubleshooting](#3-initialize-page-builder-with-onmounted-troubleshooting)
|
|
32
30
|
- [Why Use the Shared Instance?](#why-use-the-shared-instance)
|
|
33
31
|
- [Important: CSS Prefixing (`pbx-`)](#important-css-prefixing-pbx-)
|
|
34
32
|
- [Rendering HTML Output in Other Frameworks (React, Nuxt, etc.)](#rendering-html-output-in-other-frameworks-react-nuxt-etc)
|
|
35
33
|
- [Providing Configuration to the Page Builder](#providing-configuration-to-the-page-builder)
|
|
36
34
|
- [Comprehensive Language Support in the Page Builder](#comprehensive-language-support-in-the-page-builder)
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
- [Default language](#default-language)
|
|
36
|
+
- [Disabling the Language Dropdown](#disabling-the-language-dropdown)
|
|
39
37
|
- [Local Storage \& Auto-Save](#local-storage--auto-save)
|
|
40
38
|
- [Retrieving the Latest HTML Content for Form Submission](#retrieving-the-latest-html-content-for-form-submission)
|
|
41
39
|
- [Resetting the Builder After Successful Resource Creation or Update](#resetting-the-builder-after-successful-resource-creation-or-update)
|
|
@@ -65,7 +63,7 @@
|
|
|
65
63
|
|
|
66
64
|
## Demo
|
|
67
65
|
|
|
68
|
-
|
|
66
|
+
Vue 3 Page Builder component with drag-and-drop functionality for creating dynamic web pages.
|
|
69
67
|
|
|
70
68
|
Try the live demo to explore real-time visual updates and smooth content management.
|
|
71
69
|
<br>
|
|
@@ -230,13 +228,7 @@ To use `@myissue/vue-website-page-builder` in your Nuxt 3 or Nuxt 4 project, fol
|
|
|
230
228
|
> **🎉 Great news:** The Page Builder now works with Nuxt 3 and Nuxt 4.
|
|
231
229
|
> Follow the steps below to get started in your Nuxt project.
|
|
232
230
|
|
|
233
|
-
### 1.
|
|
234
|
-
|
|
235
|
-
```bash
|
|
236
|
-
npm install @myissue/vue-website-page-builder
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
### 2. Create a Nuxt Plugin
|
|
231
|
+
### 1. Create a Nuxt Plugin
|
|
240
232
|
|
|
241
233
|
In the root, create a file named:
|
|
242
234
|
|
|
@@ -256,7 +248,7 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
256
248
|
})
|
|
257
249
|
```
|
|
258
250
|
|
|
259
|
-
###
|
|
251
|
+
### 2. Register the Plugin in `nuxt.config.ts`
|
|
260
252
|
|
|
261
253
|
Make sure Nuxt knows about your new Plugin by adding it to your config:
|
|
262
254
|
|
|
@@ -270,7 +262,7 @@ export default defineNuxtConfig({
|
|
|
270
262
|
})
|
|
271
263
|
```
|
|
272
264
|
|
|
273
|
-
###
|
|
265
|
+
### 3. Using the Page Builder Component
|
|
274
266
|
|
|
275
267
|
Now anywhere in your application, use the `getPageBuilder()` composable to interact with the Page Builder’s shared instance.
|
|
276
268
|
|
|
@@ -310,7 +302,7 @@ onMounted(async () => {
|
|
|
310
302
|
> **Tip:**
|
|
311
303
|
> By initializing the builder inside `onMounted`, you ensure everything is ready and avoid hydration errors.
|
|
312
304
|
|
|
313
|
-
###
|
|
305
|
+
### 4. Why Initialize the Page Builder with `onMounted` in Nuxt?
|
|
314
306
|
|
|
315
307
|
In a Server-Side Rendering (SSR) framework like Nuxt, any code that depends on the browser (`DOM`, `window`, `localStorage`, etc.) should only run on the client. Using `onMounted` ensures the Page Builder initializes safely after the component is mounted, avoiding SSR errors. Many popular packages follow this pattern.
|
|
316
308
|
|
|
@@ -318,13 +310,7 @@ In a Server-Side Rendering (SSR) framework like Nuxt, any code that depends on t
|
|
|
318
310
|
|
|
319
311
|
To use `@myissue/vue-website-page-builder` in your Vue project, follow these steps:
|
|
320
312
|
|
|
321
|
-
### 1.
|
|
322
|
-
|
|
323
|
-
```bash
|
|
324
|
-
npm install @myissue/vue-website-page-builder
|
|
325
|
-
```
|
|
326
|
-
|
|
327
|
-
### 2. Import and use the Page Builder Plugin
|
|
313
|
+
### 1. Import and use the Page Builder Plugin
|
|
328
314
|
|
|
329
315
|
Import the `pageBuilder` Plugin and register it in your application entry point (e.g., `main.ts` or `main.js`). This sets up a single, shared Page Builder instance for your entire app.
|
|
330
316
|
|
|
@@ -341,7 +327,7 @@ app.use(pageBuilder)
|
|
|
341
327
|
app.mount('#app')
|
|
342
328
|
```
|
|
343
329
|
|
|
344
|
-
###
|
|
330
|
+
### 2. Using the Page Builder Component
|
|
345
331
|
|
|
346
332
|
Now anywhere in your application, use the `getPageBuilder()` composable to interact with the Page Builder’s shared instance.
|
|
347
333
|
|
|
@@ -349,6 +335,7 @@ You’re now ready to use the Page Builder in your Vue pages or components with
|
|
|
349
335
|
|
|
350
336
|
```vue
|
|
351
337
|
<script setup>
|
|
338
|
+
import { onMounted } from 'vue'
|
|
352
339
|
import { PageBuilder, getPageBuilder } from '@myissue/vue-website-page-builder'
|
|
353
340
|
|
|
354
341
|
const configPageBuilder = {
|
|
@@ -358,10 +345,12 @@ const configPageBuilder = {
|
|
|
358
345
|
},
|
|
359
346
|
}
|
|
360
347
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
348
|
+
// Initialize the Page Builder with `onMounted`
|
|
349
|
+
onMounted(async () => {
|
|
350
|
+
const pageBuilderService = getPageBuilder()
|
|
351
|
+
const result = await pageBuilderService.startBuilder(configPageBuilder)
|
|
352
|
+
console.info('You may inspect this result for message, status, or error:', result)
|
|
353
|
+
})
|
|
365
354
|
</script>
|
|
366
355
|
|
|
367
356
|
<template>
|
|
@@ -369,7 +358,7 @@ console.info('You may inspect this result for message, status, or error:', resul
|
|
|
369
358
|
</template>
|
|
370
359
|
```
|
|
371
360
|
|
|
372
|
-
###
|
|
361
|
+
### 3. Initialize Page Builder with `onMounted` Troubleshooting
|
|
373
362
|
|
|
374
363
|
If you encounter issues with the component not fully mounting, you can initialize the Page Builder inside Vue's `onMounted` lifecycle hook. This ensures it runs safely after the component is mounted.
|
|
375
364
|
|
|
@@ -481,6 +470,7 @@ Your `configPageBuilder` object can include:
|
|
|
481
470
|
|
|
482
471
|
```vue
|
|
483
472
|
<script setup>
|
|
473
|
+
import { onMounted } from 'vue'
|
|
484
474
|
import { getPageBuilder } from '@myissue/vue-website-page-builder'
|
|
485
475
|
|
|
486
476
|
const configPageBuilder = {
|
|
@@ -507,11 +497,12 @@ const configPageBuilder = {
|
|
|
507
497
|
},
|
|
508
498
|
}
|
|
509
499
|
|
|
510
|
-
// Retrieve Page Builder service instance
|
|
511
500
|
const pageBuilderService = getPageBuilder()
|
|
512
|
-
const result = await pageBuilderService.startBuilder(configPageBuilder)
|
|
513
501
|
|
|
514
|
-
|
|
502
|
+
onMounted(async () => {
|
|
503
|
+
const result = await pageBuilderService.startBuilder(configPageBuilder)
|
|
504
|
+
console.info('You may inspect this result for message, status, or error:', result)
|
|
505
|
+
})
|
|
515
506
|
</script>
|
|
516
507
|
|
|
517
508
|
<template>
|
|
@@ -535,6 +526,7 @@ The Page Builder offers robust multilingual support, enabling you to reach a glo
|
|
|
535
526
|
| German | de |
|
|
536
527
|
| Arabic | ar |
|
|
537
528
|
| Hindi | hi |
|
|
529
|
+
| Danish | da |
|
|
538
530
|
|
|
539
531
|
#### Default language
|
|
540
532
|
|
|
@@ -607,6 +599,7 @@ Call this logic when you need to submit or save the builder’s output—for exa
|
|
|
607
599
|
|
|
608
600
|
```vue
|
|
609
601
|
<script setup>
|
|
602
|
+
import { onMounted } from 'vue'
|
|
610
603
|
import { getPageBuilder } from '@myissue/vue-website-page-builder'
|
|
611
604
|
|
|
612
605
|
const configPageBuilder = {
|
|
@@ -616,12 +609,19 @@ const configPageBuilder = {
|
|
|
616
609
|
},
|
|
617
610
|
}
|
|
618
611
|
|
|
619
|
-
// Retrieve Page Builder service instance
|
|
620
612
|
const pageBuilderService = getPageBuilder()
|
|
621
|
-
await pageBuilderService.startBuilder(configPageBuilder)
|
|
622
613
|
|
|
623
|
-
|
|
624
|
-
|
|
614
|
+
onMounted(async () => {
|
|
615
|
+
const result = await pageBuilderService.startBuilder(configPageBuilder)
|
|
616
|
+
console.info('You may inspect this result for message, status, or error:', result)
|
|
617
|
+
})
|
|
618
|
+
|
|
619
|
+
const getComponents = function () {
|
|
620
|
+
const storedComponents = pageBuilderService.getSavedPageHtml()
|
|
621
|
+
yourForm.content = storedComponents
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
// Call getComponents when needed.
|
|
625
625
|
</script>
|
|
626
626
|
```
|
|
627
627
|
|
|
@@ -658,6 +658,7 @@ If you have previously saved or published HTML content (for example, from your d
|
|
|
658
658
|
|
|
659
659
|
```vue
|
|
660
660
|
<script setup>
|
|
661
|
+
import { onMounted } from 'vue'
|
|
661
662
|
import { getPageBuilder } from '@myissue/vue-website-page-builder'
|
|
662
663
|
|
|
663
664
|
// Retrieve the Page Builder service instance
|
|
@@ -676,10 +677,13 @@ If you have previously saved or published HTML content (for example, from your d
|
|
|
676
677
|
pageSettings: pageSettings,
|
|
677
678
|
}
|
|
678
679
|
|
|
679
|
-
|
|
680
|
-
const result = await pageBuilderService.startBuilder(configPageBuilder, components)
|
|
680
|
+
const pageBuilderService = getPageBuilder()
|
|
681
681
|
|
|
682
|
-
|
|
682
|
+
// Initialize the Page Builder with `onMounted`
|
|
683
|
+
onMounted(async () => {
|
|
684
|
+
const result = await pageBuilderService.startBuilder(configPageBuilder)
|
|
685
|
+
console.info('You may inspect this result for message, status, or error:', result)
|
|
686
|
+
})
|
|
683
687
|
</script>
|
|
684
688
|
|
|
685
689
|
<template>
|
|
@@ -707,6 +711,7 @@ If a draft is found, users are prompted to either continue where they left off o
|
|
|
707
711
|
|
|
708
712
|
```vue
|
|
709
713
|
<script setup>
|
|
714
|
+
import { onMounted } from 'vue'
|
|
710
715
|
import { getPageBuilder } from '@myissue/vue-website-page-builder'
|
|
711
716
|
|
|
712
717
|
const configPageBuilder = {
|
|
@@ -716,9 +721,13 @@ const configPageBuilder = {
|
|
|
716
721
|
},
|
|
717
722
|
}
|
|
718
723
|
|
|
719
|
-
const
|
|
724
|
+
const pageBuilderService = getPageBuilder()
|
|
720
725
|
|
|
721
|
-
|
|
726
|
+
// Initialize the Page Builder with `onMounted`
|
|
727
|
+
onMounted(async () => {
|
|
728
|
+
const result = await pageBuilderService.startBuilder(configPageBuilder)
|
|
729
|
+
console.info('You may inspect this result for message, status, or error:', result)
|
|
730
|
+
})
|
|
722
731
|
</script>
|
|
723
732
|
|
|
724
733
|
<template>
|