@myissue/vue-website-page-builder 3.2.13 → 3.2.16
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 +21 -86
- package/dist/vue-website-page-builder.js +7869 -8022
- package/dist/vue-website-page-builder.umd.cjs +36 -36
- package/package.json +1 -1
- package/src/Components/Homepage/HomeSection.vue +15 -32
- package/src/Components/Homepage/Navbar.vue +3 -6
- package/src/Components/PageBuilder/EditorMenu/Editables/EditGetElement.vue +5 -20
- package/src/Components/PageBuilder/Settings/PageBuilderSettings.vue +3 -3
- package/src/Components/Search/SearchComponents.vue +5 -5
- package/src/PageBuilder/PageBuilder.vue +8 -58
- package/src/composables/PageBuilderClass.ts +6 -1
- package/src/helpers/passedPageBuilderConfig.ts +15 -297
- package/src/types/index.ts +5 -1
- /package/src/Components/PageBuilder/DemoContent/{NoneCustomSearchComponent.vue → NoneCustomBuilderComponents.vue} +0 -0
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
|
|
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,8 @@ 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
|
-
- `
|
|
148
|
+
- `brandColor` set brand’s primary color, which will be used for key UI elements in the builder in the `settings` config
|
|
149
|
+
- `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
150
|
|
|
162
151
|
```vue
|
|
163
152
|
<script setup>
|
|
@@ -171,7 +160,7 @@ import '@myissue/vue-website-page-builder/style.css'
|
|
|
171
160
|
const configPageBuilder = {
|
|
172
161
|
updateOrCreate: {
|
|
173
162
|
// Set the resource type for better local storage and multi-resource support
|
|
174
|
-
|
|
163
|
+
formName: 'article',
|
|
175
164
|
},
|
|
176
165
|
pageBuilderLogo: {
|
|
177
166
|
src: '/logo/logo.svg',
|
|
@@ -186,13 +175,16 @@ const configPageBuilder = {
|
|
|
186
175
|
language: 'en',
|
|
187
176
|
autoSave: true,
|
|
188
177
|
},
|
|
178
|
+
settings: {
|
|
179
|
+
brandColor: '#DB93B0',
|
|
180
|
+
},
|
|
189
181
|
}
|
|
190
182
|
|
|
191
183
|
// Use sharedPageBuilderStore for shared state between PageBuilderClass and PageBuilder component
|
|
192
184
|
const pageBuilderStateStore = sharedPageBuilderStore
|
|
193
185
|
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
|
|
194
186
|
|
|
195
|
-
// Initializing
|
|
187
|
+
// Initializing with essential configuration
|
|
196
188
|
pageBuilderClass.setConfigPageBuilder(configPageBuilder)
|
|
197
189
|
</script>
|
|
198
190
|
|
|
@@ -234,7 +226,7 @@ const configPageBuilder = {
|
|
|
234
226
|
const pageBuilderStateStore = sharedPageBuilderStore
|
|
235
227
|
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
|
|
236
228
|
|
|
237
|
-
// Initializing
|
|
229
|
+
// Initializing with essential configuration
|
|
238
230
|
pageBuilderClass.setConfigPageBuilder(configPageBuilder)
|
|
239
231
|
</script>
|
|
240
232
|
|
|
@@ -249,8 +241,6 @@ Configuration Options
|
|
|
249
241
|
| ----------------- | -------- | ------- | ----------------------------------- |
|
|
250
242
|
| `PageBuilderLogo` | `String` | `null` | URL path to your company logo image |
|
|
251
243
|
|
|
252
|
-
---
|
|
253
|
-
|
|
254
244
|
### Local Storage
|
|
255
245
|
|
|
256
246
|
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 +255,7 @@ Each save is stored in local storage using a unique key. The key is determined b
|
|
|
265
255
|
- **New Resource:** The key will be prefixed with `page-builder-create-resource`.
|
|
266
256
|
- **Updating Resource:** The key will be prefixed with `page-builder-update-resource`.
|
|
267
257
|
|
|
268
|
-
You can further customize and uniquely identify the storage key by providing a `
|
|
258
|
+
You can further customize and uniquely identify the storage key by providing a `formName` in your `configPageBuilder`:
|
|
269
259
|
|
|
270
260
|
```js
|
|
271
261
|
<script setup>
|
|
@@ -280,17 +270,19 @@ import '@myissue/vue-website-page-builder/style.css'
|
|
|
280
270
|
const configPageBuilder = {
|
|
281
271
|
updateOrCreate: {
|
|
282
272
|
// Set the resource type for better local storage and multi-resource support
|
|
283
|
-
|
|
273
|
+
formName: 'article',
|
|
284
274
|
},
|
|
285
275
|
// ...other config options
|
|
286
276
|
}
|
|
287
277
|
|
|
288
278
|
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
|
|
289
279
|
|
|
290
|
-
// Initializing
|
|
280
|
+
// Initializing with essential configuration
|
|
291
281
|
pageBuilderClass.setConfigPageBuilder(configPageBuilder)
|
|
292
282
|
// Populating page builder with existing resource content
|
|
293
283
|
pageBuilderClass.loadExistingContent(existingResourceFromBackend)
|
|
284
|
+
</script>
|
|
285
|
+
|
|
294
286
|
|
|
295
287
|
|
|
296
288
|
<template>
|
|
@@ -300,7 +292,7 @@ pageBuilderClass.loadExistingContent(existingResourceFromBackend)
|
|
|
300
292
|
|
|
301
293
|
This allows you to manage drafts for multiple resource types (e.g., articles, jobs, stores) independently in local storage.
|
|
302
294
|
|
|
303
|
-
> **Tip:** The local storage key will automatically include the resource type if `
|
|
295
|
+
> **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
296
|
|
|
305
297
|
### Restoring Unfinished Drafts for New Resources
|
|
306
298
|
|
|
@@ -325,13 +317,13 @@ const pageBuilderStateStore = sharedPageBuilderStore
|
|
|
325
317
|
const configPageBuilder = {
|
|
326
318
|
updateOrCreate: {
|
|
327
319
|
formType: 'create',
|
|
328
|
-
|
|
320
|
+
formName: 'article',
|
|
329
321
|
},
|
|
330
322
|
}
|
|
331
323
|
|
|
332
324
|
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
|
|
333
325
|
|
|
334
|
-
// Initializing
|
|
326
|
+
// Initializing with essential configuration
|
|
335
327
|
pageBuilderClass.setConfigPageBuilder(configPageBuilder)
|
|
336
328
|
// No need to call loadExistingContent; the builder will auto-restore from local storage if available
|
|
337
329
|
</script>
|
|
@@ -368,13 +360,13 @@ const pageBuilderStateStore = sharedPageBuilderStore
|
|
|
368
360
|
const configPageBuilder = {
|
|
369
361
|
updateOrCreate: {
|
|
370
362
|
formType: 'update',
|
|
371
|
-
|
|
363
|
+
formName: 'article',
|
|
372
364
|
},
|
|
373
365
|
}
|
|
374
366
|
|
|
375
367
|
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
|
|
376
368
|
|
|
377
|
-
// Initializing
|
|
369
|
+
// Initializing with essential configuration
|
|
378
370
|
pageBuilderClass.setConfigPageBuilder(configPageBuilder)
|
|
379
371
|
// Populating page builder with existing resource content from backend
|
|
380
372
|
pageBuilderClass.loadExistingContent(existingResourceFromBackend)
|
|
@@ -385,72 +377,17 @@ pageBuilderClass.loadExistingContent(existingResourceFromBackend)
|
|
|
385
377
|
</template>
|
|
386
378
|
```
|
|
387
379
|
|
|
388
|
-
---
|
|
389
|
-
|
|
390
380
|
#### How should `existingResourceFromBackend` look?
|
|
391
381
|
|
|
392
|
-
When loading an existing resource, each component object will have an `id` assigned by the page builder.
|
|
393
382
|
The example below shows the structure as it would appear when loaded from local storage after components have been added in the builder.
|
|
394
383
|
|
|
395
384
|
- Example JSON string (from localStorage or backend)
|
|
396
385
|
- For existing resources, id will always be present and set by the page builder.
|
|
397
386
|
|
|
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
387
|
### Customization
|
|
445
388
|
|
|
446
389
|
Customizing the page builder is made simple since all the logic resides in the PageBuilder Class.
|
|
447
390
|
|
|
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
391
|
### Custom Components
|
|
455
392
|
|
|
456
393
|
Want to add your own media library or Create custom components that can be injected into the page builder:
|
|
@@ -463,18 +400,16 @@ Example integration:
|
|
|
463
400
|
<script setup>
|
|
464
401
|
import { PageBuilder } from '@myissue/vue-website-page-builder'
|
|
465
402
|
import YourMediaLibraryComponent from './ComponentsPageBuilder/YourMediaLibraryComponent.vue'
|
|
466
|
-
import
|
|
403
|
+
import YourCustomBuilderComponents from './ComponentsPageBuilder/YourCustomBuilderComponents.vue'
|
|
467
404
|
</script>
|
|
468
405
|
|
|
469
406
|
<template>
|
|
470
|
-
<PageBuilder :CustomMediaLibraryComponent="YourMediaLibraryComponent" :
|
|
407
|
+
<PageBuilder :CustomMediaLibraryComponent="YourMediaLibraryComponent" :CustomBuilderComponents="YourCustomBuilderComponents" />
|
|
471
408
|
</template>
|
|
472
409
|
```
|
|
473
410
|
|
|
474
411
|
## Troubleshooting
|
|
475
412
|
|
|
476
|
-
---
|
|
477
|
-
|
|
478
413
|
### Fonts or Icons Not Displaying
|
|
479
414
|
|
|
480
415
|
If fonts (Jost, Cormorant) or Material Icons are not displaying correctly, verify that:
|