@myissue/vue-website-page-builder 3.2.13 → 3.2.15

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
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## **DEVELOPMENT VERSION - NOT READY FOR PRODUCTION**
6
6
 
7
- 🚀 **Official Launch Date: June 15, 2025**
7
+ 🚀 **Official Launch Date: June 16, 2025**
8
8
  We're working hard to bring you a production-ready page builder. Stay tuned for updates!
9
9
 
10
10
  You are welcome to test the builder and report any bugs or feedback before the official launch date.
@@ -76,12 +76,8 @@ agencies. Empower users to create the perfect content with the Page Builder.
76
76
  - **Technologies**: This Page Builder is developed using TypeScript, Vue 3, the Composition API, Pinia, CSS, Tailwind CSS, and HTML.
77
77
  - **Features**: Click & Drop Page Builder.
78
78
 
79
- ---
80
-
81
79
  ## Documentation
82
80
 
83
- ---
84
-
85
81
  ### Requirements
86
82
 
87
83
  Please note that these instructions assume you have Node.js installed.
@@ -90,8 +86,6 @@ Please note that these instructions assume you have Node.js installed.
90
86
  - Vue.js ≥ 3.0.0
91
87
  - Modern browser with ES6+ support
92
88
 
93
- ---
94
-
95
89
  ### Getting started & installation
96
90
 
97
91
  Make sure to install the dependencies:
@@ -110,8 +104,6 @@ yarn install
110
104
  bun install
111
105
  ```
112
106
 
113
- ---
114
-
115
107
  ### Important: CSS Import Required
116
108
 
117
109
  The Page Builder requires its CSS file to be imported for proper styling and automatic icon loading:
@@ -127,8 +119,6 @@ This import automatically includes:
127
119
  - ✅ Google Material Icons (no additional setup needed)
128
120
  - ✅ Responsive design utilities
129
121
 
130
- ---
131
-
132
122
  ### Quick Start
133
123
 
134
124
  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.
@@ -146,8 +136,6 @@ import '@myissue/vue-website-page-builder/style.css'
146
136
  </template>
147
137
  ```
148
138
 
149
- ---
150
-
151
139
  ### Optional: Provide Config to PageBuilder
152
140
 
153
141
  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.
@@ -157,7 +145,7 @@ Get up and running quickly by importing the PageBuilder component, setting up yo
157
145
  - `pageBuilderLogo` to display your company logo in the builder toolbar
158
146
  - `resourceData` to prefill the builder with initial data
159
147
  - `userSettings` to set user preferences such as theme, language, or autoSave
160
- - `createNewResourceFormName` (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.
148
+ - `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.
161
149
 
162
150
  ```vue
163
151
  <script setup>
@@ -171,7 +159,7 @@ import '@myissue/vue-website-page-builder/style.css'
171
159
  const configPageBuilder = {
172
160
  updateOrCreate: {
173
161
  // Set the resource type for better local storage and multi-resource support
174
- createNewResourceFormName: 'article',
162
+ formName: 'article',
175
163
  },
176
164
  pageBuilderLogo: {
177
165
  src: '/logo/logo.svg',
@@ -186,13 +174,16 @@ const configPageBuilder = {
186
174
  language: 'en',
187
175
  autoSave: true,
188
176
  },
177
+ settings: {
178
+ brandColor: '#DB93B0',
179
+ },
189
180
  }
190
181
 
191
182
  // Use sharedPageBuilderStore for shared state between PageBuilderClass and PageBuilder component
192
183
  const pageBuilderStateStore = sharedPageBuilderStore
193
184
  const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
194
185
 
195
- // Initializing Page Builder with essential configuration
186
+ // Initializing with essential configuration
196
187
  pageBuilderClass.setConfigPageBuilder(configPageBuilder)
197
188
  </script>
198
189
 
@@ -234,7 +225,7 @@ const configPageBuilder = {
234
225
  const pageBuilderStateStore = sharedPageBuilderStore
235
226
  const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
236
227
 
237
- // Initializing page builder with essential configuration
228
+ // Initializing with essential configuration
238
229
  pageBuilderClass.setConfigPageBuilder(configPageBuilder)
239
230
  </script>
240
231
 
@@ -249,8 +240,6 @@ Configuration Options
249
240
  | ----------------- | -------- | ------- | ----------------------------------- |
250
241
  | `PageBuilderLogo` | `String` | `null` | URL path to your company logo image |
251
242
 
252
- ---
253
-
254
243
  ### Local Storage
255
244
 
256
245
  The Page Builder automatically manages all changes using the browser's local storage. Every change you make—such as adding, editing, or deleting components—is saved in local storage. This ensures that your progress is not lost, even if you accidentally close the browser or navigate away.
@@ -265,7 +254,7 @@ Each save is stored in local storage using a unique key. The key is determined b
265
254
  - **New Resource:** The key will be prefixed with `page-builder-create-resource`.
266
255
  - **Updating Resource:** The key will be prefixed with `page-builder-update-resource`.
267
256
 
268
- You can further customize and uniquely identify the storage key by providing a `createNewResourceFormName` in your `configPageBuilder`:
257
+ You can further customize and uniquely identify the storage key by providing a `formName` in your `configPageBuilder`:
269
258
 
270
259
  ```js
271
260
  <script setup>
@@ -280,17 +269,19 @@ import '@myissue/vue-website-page-builder/style.css'
280
269
  const configPageBuilder = {
281
270
  updateOrCreate: {
282
271
  // Set the resource type for better local storage and multi-resource support
283
- createNewResourceFormName: 'article',
272
+ formName: 'article',
284
273
  },
285
274
  // ...other config options
286
275
  }
287
276
 
288
277
  const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
289
278
 
290
- // Initializing page builder with essential configuration
279
+ // Initializing with essential configuration
291
280
  pageBuilderClass.setConfigPageBuilder(configPageBuilder)
292
281
  // Populating page builder with existing resource content
293
282
  pageBuilderClass.loadExistingContent(existingResourceFromBackend)
283
+ </script>
284
+
294
285
 
295
286
 
296
287
  <template>
@@ -300,7 +291,7 @@ pageBuilderClass.loadExistingContent(existingResourceFromBackend)
300
291
 
301
292
  This allows you to manage drafts for multiple resource types (e.g., articles, jobs, stores) independently in local storage.
302
293
 
303
- > **Tip:** The local storage key will automatically include the resource type if `createNewResourceFormName` is provided, ensuring that drafts for different resource types do not overwrite each other.
294
+ > **Tip:** The local storage key will automatically include the resource type if `formName` is provided, ensuring that drafts for different resource types do not overwrite each other.
304
295
 
305
296
  ### Restoring Unfinished Drafts for New Resources
306
297
 
@@ -325,13 +316,13 @@ const pageBuilderStateStore = sharedPageBuilderStore
325
316
  const configPageBuilder = {
326
317
  updateOrCreate: {
327
318
  formType: 'create',
328
- createNewResourceFormName: 'article',
319
+ formName: 'article',
329
320
  },
330
321
  }
331
322
 
332
323
  const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
333
324
 
334
- // Initializing page builder with essential configuration
325
+ // Initializing with essential configuration
335
326
  pageBuilderClass.setConfigPageBuilder(configPageBuilder)
336
327
  // No need to call loadExistingContent; the builder will auto-restore from local storage if available
337
328
  </script>
@@ -368,13 +359,13 @@ const pageBuilderStateStore = sharedPageBuilderStore
368
359
  const configPageBuilder = {
369
360
  updateOrCreate: {
370
361
  formType: 'update',
371
- createNewResourceFormName: 'article',
362
+ formName: 'article',
372
363
  },
373
364
  }
374
365
 
375
366
  const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
376
367
 
377
- // Initializing page builder with essential configuration
368
+ // Initializing with essential configuration
378
369
  pageBuilderClass.setConfigPageBuilder(configPageBuilder)
379
370
  // Populating page builder with existing resource content from backend
380
371
  pageBuilderClass.loadExistingContent(existingResourceFromBackend)
@@ -385,72 +376,17 @@ pageBuilderClass.loadExistingContent(existingResourceFromBackend)
385
376
  </template>
386
377
  ```
387
378
 
388
- ---
389
-
390
379
  #### How should `existingResourceFromBackend` look?
391
380
 
392
- When loading an existing resource, each component object will have an `id` assigned by the page builder.
393
381
  The example below shows the structure as it would appear when loaded from local storage after components have been added in the builder.
394
382
 
395
383
  - Example JSON string (from localStorage or backend)
396
384
  - For existing resources, id will always be present and set by the page builder.
397
385
 
398
- TypeScript interface for reference
399
-
400
- ```javascript
401
- export interface ComponentObject {
402
- id: string | number | null
403
- html_code: string
404
- title?: string
405
- }
406
- ```
407
-
408
- ```javascript
409
- <script setup>
410
- // Example JSON string (from localStorage or backend)
411
- const existingResourceFromBackend = JSON.stringify([
412
- {
413
- html_code: `<section>
414
- <div>
415
- <h1>Article Title</h1>
416
- <p>Content</p>
417
- </div>
418
- </section>`,
419
- id: null,
420
- title: 'Component Title',
421
- },
422
- {
423
- html_code: `<section>
424
- <div>
425
- <h1>Article Title</h1>
426
- <p>Content</p>
427
- </div>
428
- </section>`,
429
- id: null,
430
- title: 'Component Title',
431
- },
432
- ])
433
- </script>
434
-
435
- <template>
436
- <PageBuilder />
437
- </template>
438
- ```
439
-
440
- Alternatively, you can provide a raw HTML string containing your `<section>` components:
441
-
442
- ---
443
-
444
386
  ### Customization
445
387
 
446
388
  Customizing the page builder is made simple since all the logic resides in the PageBuilder Class.
447
389
 
448
- - Google Fonts (Jost, Cormorant) and Material Icons are automatically loaded when you import the CSS file. No additional setup required for fonts or icons!
449
-
450
- ---
451
-
452
- ---
453
-
454
390
  ### Custom Components
455
391
 
456
392
  Want to add your own media library or Create custom components that can be injected into the page builder:
@@ -463,18 +399,16 @@ Example integration:
463
399
  <script setup>
464
400
  import { PageBuilder } from '@myissue/vue-website-page-builder'
465
401
  import YourMediaLibraryComponent from './ComponentsPageBuilder/YourMediaLibraryComponent.vue'
466
- import YourSearchComponent from './ComponentsPageBuilder/YourSearchComponent.vue'
402
+ import YourCustomBuilderComponents from './ComponentsPageBuilder/YourCustomBuilderComponents.vue'
467
403
  </script>
468
404
 
469
405
  <template>
470
- <PageBuilder :CustomMediaLibraryComponent="YourMediaLibraryComponent" :CustomSearchComponent="YourSearchComponent" />
406
+ <PageBuilder :CustomMediaLibraryComponent="YourMediaLibraryComponent" :CustomBuilderComponents="YourCustomBuilderComponents" />
471
407
  </template>
472
408
  ```
473
409
 
474
410
  ## Troubleshooting
475
411
 
476
- ---
477
-
478
412
  ### Fonts or Icons Not Displaying
479
413
 
480
414
  If fonts (Jost, Cormorant) or Material Icons are not displaying correctly, verify that: