@myissue/vue-website-page-builder 3.4.69 → 3.4.76

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 CHANGED
@@ -19,23 +19,21 @@
19
19
  - [Installation](#installation)
20
20
  - [Quick Start](#quick-start)
21
21
  - [Nuxt Integration](#nuxt-integration)
22
- - [1. Install the Package](#1-install-the-package)
23
- - [2. Create a Nuxt Plugin](#2-create-a-nuxt-plugin)
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` Troubleshooting](#4-initialize-page-builder-with-onmounted-troubleshooting)
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
- - [Default language](#default-language)
38
- - [Disabling the Language Dropdown](#disabling-the-language-dropdown)
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
- A Vue 3 Page Builder component with drag-and-drop functionality for creating dynamic web pages.
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. Install the Package
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
- ### 3. Register the Plugin in `nuxt.config.ts`
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
- ### 4. Using the Page Builder Component
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
- ### 5. Why Initialize the Page Builder with `onMounted` in Nuxt?
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. Install the Package
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
- ### 3. Using the Page Builder Component
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
- const pageBuilderService = getPageBuilder()
362
- const result = await pageBuilderService.startBuilder(configPageBuilder)
363
-
364
- console.info('You may inspect this result for message, status, or error:', result)
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
- ### 4. Initialize Page Builder with `onMounted` Troubleshooting
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
- console.info('You may inspect this result for message, status, or error:', result)
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,8 @@ 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 |
530
+ | Italian | it |
538
531
 
539
532
  #### Default language
540
533
 
@@ -607,6 +600,7 @@ Call this logic when you need to submit or save the builder’s output—for exa
607
600
 
608
601
  ```vue
609
602
  <script setup>
603
+ import { onMounted } from 'vue'
610
604
  import { getPageBuilder } from '@myissue/vue-website-page-builder'
611
605
 
612
606
  const configPageBuilder = {
@@ -616,12 +610,19 @@ const configPageBuilder = {
616
610
  },
617
611
  }
618
612
 
619
- // Retrieve Page Builder service instance
620
613
  const pageBuilderService = getPageBuilder()
621
- await pageBuilderService.startBuilder(configPageBuilder)
622
614
 
623
- const storedComponents = pageBuilderService.getSavedPageHtml()
624
- yourForm.content = storedComponents
615
+ onMounted(async () => {
616
+ const result = await pageBuilderService.startBuilder(configPageBuilder)
617
+ console.info('You may inspect this result for message, status, or error:', result)
618
+ })
619
+
620
+ const getComponents = function () {
621
+ const storedComponents = pageBuilderService.getSavedPageHtml()
622
+ yourForm.content = storedComponents
623
+ }
624
+
625
+ // Call getComponents when needed.
625
626
  </script>
626
627
  ```
627
628
 
@@ -658,6 +659,7 @@ If you have previously saved or published HTML content (for example, from your d
658
659
 
659
660
  ```vue
660
661
  <script setup>
662
+ import { onMounted } from 'vue'
661
663
  import { getPageBuilder } from '@myissue/vue-website-page-builder'
662
664
 
663
665
  // Retrieve the Page Builder service instance
@@ -676,10 +678,13 @@ If you have previously saved or published HTML content (for example, from your d
676
678
  pageSettings: pageSettings,
677
679
  }
678
680
 
679
- // Start the builder with both config and components
680
- const result = await pageBuilderService.startBuilder(configPageBuilder, components)
681
+ const pageBuilderService = getPageBuilder()
681
682
 
682
- console.info('You may inspect this result for message, status, or error:', result)
683
+ // Initialize the Page Builder with `onMounted`
684
+ onMounted(async () => {
685
+ const result = await pageBuilderService.startBuilder(configPageBuilder)
686
+ console.info('You may inspect this result for message, status, or error:', result)
687
+ })
683
688
  </script>
684
689
 
685
690
  <template>
@@ -707,6 +712,7 @@ If a draft is found, users are prompted to either continue where they left off o
707
712
 
708
713
  ```vue
709
714
  <script setup>
715
+ import { onMounted } from 'vue'
710
716
  import { getPageBuilder } from '@myissue/vue-website-page-builder'
711
717
 
712
718
  const configPageBuilder = {
@@ -716,9 +722,13 @@ const configPageBuilder = {
716
722
  },
717
723
  }
718
724
 
719
- const result = await pageBuilderService.startBuilder(configPageBuilder)
725
+ const pageBuilderService = getPageBuilder()
720
726
 
721
- console.info('You may inspect this result for message, status, or error:', result)
727
+ // Initialize the Page Builder with `onMounted`
728
+ onMounted(async () => {
729
+ const result = await pageBuilderService.startBuilder(configPageBuilder)
730
+ console.info('You may inspect this result for message, status, or error:', result)
731
+ })
722
732
  </script>
723
733
 
724
734
  <template>