@myissue/vue-website-page-builder 3.3.20 → 3.3.21

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
@@ -464,6 +464,36 @@ console.info('You may inspect this result for message, status, or error:', resul
464
464
  </template>
465
465
  ```
466
466
 
467
+ ## Embedding Page Builder in a Modal or Dialog
468
+
469
+ You can easily use the Page Builder inside a modal or dialog.
470
+ To allow users to close the modal from inside the builder, use the `showCloseButton` prop and listen for the `@handleClosePageBuilder` event:
471
+
472
+ ```vue
473
+ <script setup>
474
+ import { ref } from 'vue'
475
+ import { PageBuilder } from '@myissue/vue-website-page-builder'
476
+
477
+ const showModal = ref(true)
478
+ function closePageBuilder() {
479
+ showModal.value = false
480
+ }
481
+ </script>
482
+
483
+ <template>
484
+ <Modal v-if="showModal" @close="showModal = false">
485
+ <PageBuilder :showCloseButton="true" @handleClosePageBuilder="closePageBuilder" />
486
+ </Modal>
487
+ </template>
488
+ ```
489
+
490
+ - `:showCloseButton="true"` — shows a close button in the Page Builder toolbar.
491
+ - `@handleClosePageBuilder="closePageBuilder"` — emits when the close button is clicked, so you can close your modal.
492
+
493
+ > **Tip:**
494
+ > You can name your handler function anything you like.
495
+ > This pattern makes it easy to embed the builder in modals, dialogs, or overlays in any Vue app.
496
+
467
497
  ### Custom Media Library Component or Custom Layout Builder Component
468
498
 
469
499
  You may extend the Page Builder by adding your own media library or custom layout builder Component.