@myissue/vue-website-page-builder 3.2.85 → 3.2.86

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
@@ -108,6 +108,23 @@ yarn install
108
108
  bun install
109
109
  ```
110
110
 
111
+ ### Quick Start
112
+
113
+ Get up and running quickly and initializing the builder in your Vue project. The following example demonstrates the minimal setup required to start building pages.
114
+
115
+ - The Page Builder requires its CSS file to be imported for proper styling and automatic icon loading:
116
+
117
+ ```vue
118
+ <script setup>
119
+ import { PageBuilder } from '@myissue/vue-website-page-builder'
120
+ import '@myissue/vue-website-page-builder/style.css'
121
+ </script>
122
+
123
+ <template>
124
+ <PageBuilder />
125
+ </template>
126
+ ```
127
+
111
128
  ### Important: CSS Import Required
112
129
 
113
130
  The Page Builder requires its CSS file to be imported for proper styling and automatic icon loading:
@@ -123,23 +140,36 @@ This import automatically includes:
123
140
  - ✅ Google Material Icons (no additional setup needed)
124
141
  - ✅ Responsive design utilities
125
142
 
126
- ### Quick Start
143
+ ### Rendering Only the HTML Output from the Page Builder in Other Frameworks (React, Nuxt, etc.)
127
144
 
128
- Get up and running quickly and initializing the builder in your Vue project. The following example demonstrates the minimal setup required to start building pages.
145
+ If you use the Page Builder to generate HTML pages and want to render them in another application (such as React, Nuxt, or any server-side app), simply install the Page Builder package in your target project and import its CSS file. This ensures that all Tailwind and builder-specific styles are applied to the rendered HTML.
129
146
 
130
- - The Page Builder requires its CSS file to be imported for proper styling and automatic icon loading:
147
+ ```js
148
+ import '@myissue/vue-website-page-builder/style.css'
149
+ ```
131
150
 
132
- ```vue
133
- <script setup>
134
- import { PageBuilder } from '@myissue/vue-website-page-builder'
151
+ This will apply all the necessary styles to any HTML output from the builder, even if you render it with `dangerouslySetInnerHTML`, `v-html`, or similar methods.
152
+
153
+ **Example (React):**
154
+
155
+ ```jsx
135
156
  import '@myissue/vue-website-page-builder/style.css'
136
- </script>
137
157
 
138
- <template>
139
- <PageBuilder />
140
- </template>
158
+ function MyPage({ html }) {
159
+ return <div dangerouslySetInnerHTML={{ __html: html }} />
160
+ }
161
+ ```
162
+
163
+ **Example (Nuxt/Vue):**
164
+
165
+ ```js
166
+ import '@myissue/vue-website-page-builder/style.css'
141
167
  ```
142
168
 
169
+ Then use `v-html` to render the HTML.
170
+
171
+ > **Note:** You do not need to import any Vue components if you only want to render the HTML. Just import the CSS file.
172
+
143
173
  ### Optional: Provide Config to PageBuilder
144
174
 
145
175
  Get up and running quickly by importing the PageBuilder component, setting up your configuration, and initializing the builder in your Vue project. The following example demonstrates the minimal setup required to start building pages with your own config and logo.
@@ -563,11 +593,38 @@ Example `existingResourceFromBackend`:
563
593
  When you set `formType: 'update'` in your config, the Page Builder will automatically check for any unsaved draft in local storage for that resource.
564
594
  If a draft is found, the user will be prompted to either continue where they left off or use the version currently loaded from your backend.
565
595
 
566
- No extra setup is required—just set `formType: 'update'` and the feature is enabled by default.
596
+ - `formName` (recommended): Specify the resource type (e.g., `"article"`, `"jobPost"`, `"store"`, etc.) in the `updateOrCreate` config. This is especially useful if your platform supports multiple resource types. By providing a unique name, the Page Builder can correctly manage layouts and local storage for each resource type, allowing users to continue where they left off for different resources.
597
+ - Pass a `userForPageBuilder` object in your config to display or use the logged-in user's information within the builder (e.g., name and user image).
598
+ - No extra setup is required—just set `formType: 'update'` and the feature is enabled by default.
599
+
600
+ ```js
601
+ <script setup>
602
+ import {
603
+ PageBuilder,
604
+ PageBuilderClass,
605
+ sharedPageBuilderStore,
606
+ } from '@myissue/vue-website-page-builder'
607
+ import '@myissue/vue-website-page-builder/style.css'
608
+
609
+ const pageBuilderStateStore = sharedPageBuilderStore
567
610
 
568
- ### Customization
611
+ const configPageBuilder = {
612
+ updateOrCreate: {
613
+ formType: 'update',
614
+ formName: 'article',
615
+ },
616
+ }
617
+
618
+ const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
569
619
 
570
- Customizing the page builder is made simple since all the logic resides in the PageBuilder Class.
620
+ // Initializing with essential configuration
621
+ pageBuilderClass.applyPageBuilderConfig(configPageBuilder)
622
+ </script>
623
+
624
+ <template>
625
+ <PageBuilder />
626
+ </template>
627
+ ```
571
628
 
572
629
  ### Custom Components
573
630