@myissue/vue-website-page-builder 3.1.53 → 3.2.13
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 +111 -15
- package/dist/vue-website-page-builder.css +1 -1
- package/dist/vue-website-page-builder.js +8544 -8297
- package/dist/vue-website-page-builder.umd.cjs +39 -39
- package/package.json +1 -1
- package/src/App.vue +2 -0
- package/src/Components/Homepage/HomeSection.vue +48 -317
- package/src/Components/Homepage/Navbar.vue +26 -0
- package/src/Components/PageBuilder/DropdownsPlusToggles/OptionsDropdown.vue +15 -11
- package/src/Components/PageBuilder/EditorMenu/Editables/EditGetElement.vue +22 -1
- package/src/Components/PageBuilder/EditorMenu/RightSidebarEditor.vue +1 -1
- package/src/Components/PageBuilder/Settings/PageBuilderSettings.vue +47 -14
- package/src/PageBuilder/PageBuilder.vue +168 -63
- package/src/composables/PageBuilderClass.ts +42 -29
- package/src/css/app.css +27 -4
- package/src/helpers/isEmptyObject.ts +5 -0
- package/src/helpers/passedPageBuilderConfig.ts +356 -0
- package/src/types/index.ts +4 -5
- package/src/utils/html-elements/componentHelpers.ts +3 -3
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center" dir="auto">
|
|
2
|
-
<img width="200" style="max-width: 100%;" src="./public/logo/logo.svg" alt="Logo" />
|
|
2
|
+
<img width="200" style="max-width: 100%;" src="./public/logo/logo.svg" alt="Vue Website Page Builder Logo" />
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
## **DEVELOPMENT VERSION - NOT READY FOR PRODUCTION**
|
|
@@ -43,10 +43,10 @@ create and enhance digital experiences with Vue on any backend.
|
|
|
43
43
|
|
|
44
44
|
## About
|
|
45
45
|
|
|
46
|
-
<img style="max-width: 100%;" src="./public/home/builder3.jpg" alt="Logo" />
|
|
47
|
-
|
|
48
46
|
A Page Builder designed for growth. Build your website pages with ready-made components that are fully customizable and always responsive, designed to fit every need. A powerful Page Builder for growing merchants, brands, and agencies.
|
|
49
47
|
|
|
48
|
+
<img style="max-width: 100%;" src="./public/home/builder3.jpg" alt="Vue Website Page Builder" />
|
|
49
|
+
|
|
50
50
|
## Features
|
|
51
51
|
|
|
52
52
|
Includes:
|
|
@@ -251,18 +251,110 @@ Configuration Options
|
|
|
251
251
|
|
|
252
252
|
---
|
|
253
253
|
|
|
254
|
-
###
|
|
254
|
+
### Local Storage
|
|
255
255
|
|
|
256
|
-
|
|
256
|
+
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.
|
|
257
257
|
|
|
258
|
-
-
|
|
259
|
-
-
|
|
260
|
-
|
|
258
|
+
- **Auto-Save:** The builder periodically auto-saves your changes to local storage, so you don't have to worry about losing your work.
|
|
259
|
+
- **Manual Save:** When the user clicks the Save button, the current state is also saved to local storage.
|
|
260
|
+
|
|
261
|
+
#### Resource-Specific Storage Keys
|
|
262
|
+
|
|
263
|
+
Each save is stored in local storage using a unique key. The key is determined by whether you are creating a new resource or updating an existing one:
|
|
264
|
+
|
|
265
|
+
- **New Resource:** The key will be prefixed with `page-builder-create-resource`.
|
|
266
|
+
- **Updating Resource:** The key will be prefixed with `page-builder-update-resource`.
|
|
267
|
+
|
|
268
|
+
You can further customize and uniquely identify the storage key by providing a `createNewResourceFormName` in your `configPageBuilder`:
|
|
269
|
+
|
|
270
|
+
```js
|
|
271
|
+
<script setup>
|
|
272
|
+
import {
|
|
273
|
+
PageBuilder,
|
|
274
|
+
PageBuilderClass,
|
|
275
|
+
sharedPageBuilderStore,
|
|
276
|
+
} from '@myissue/vue-website-page-builder'
|
|
277
|
+
import '@myissue/vue-website-page-builder/style.css'
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
const configPageBuilder = {
|
|
281
|
+
updateOrCreate: {
|
|
282
|
+
// Set the resource type for better local storage and multi-resource support
|
|
283
|
+
createNewResourceFormName: 'article',
|
|
284
|
+
},
|
|
285
|
+
// ...other config options
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
|
|
289
|
+
|
|
290
|
+
// Initializing page builder with essential configuration
|
|
291
|
+
pageBuilderClass.setConfigPageBuilder(configPageBuilder)
|
|
292
|
+
// Populating page builder with existing resource content
|
|
293
|
+
pageBuilderClass.loadExistingContent(existingResourceFromBackend)
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
<template>
|
|
297
|
+
<PageBuilder />
|
|
298
|
+
</template>
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
This allows you to manage drafts for multiple resource types (e.g., articles, jobs, stores) independently in local storage.
|
|
302
|
+
|
|
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.
|
|
304
|
+
|
|
305
|
+
### Restoring Unfinished Drafts for New Resources
|
|
306
|
+
|
|
307
|
+
If a user started creating a new resource but hasn't finished (e.g., they want to continue the next day), you can restore their draft from local storage:
|
|
308
|
+
|
|
309
|
+
- Set `formType` to `"create"` in your config object.
|
|
310
|
+
- The PageBuilder will automatically look for any saved draft in local storage (based on the resource type) and load it if available.
|
|
311
|
+
|
|
312
|
+
**Example: Set `formType` to "create" for continuing a new resource draft**
|
|
313
|
+
|
|
314
|
+
```js
|
|
315
|
+
<script setup>
|
|
316
|
+
import {
|
|
317
|
+
PageBuilder,
|
|
318
|
+
PageBuilderClass,
|
|
319
|
+
sharedPageBuilderStore,
|
|
320
|
+
} from '@myissue/vue-website-page-builder'
|
|
321
|
+
import '@myissue/vue-website-page-builder/style.css'
|
|
322
|
+
|
|
323
|
+
const pageBuilderStateStore = sharedPageBuilderStore
|
|
324
|
+
|
|
325
|
+
const configPageBuilder = {
|
|
326
|
+
updateOrCreate: {
|
|
327
|
+
formType: 'create',
|
|
328
|
+
createNewResourceFormName: 'article',
|
|
329
|
+
},
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
|
|
333
|
+
|
|
334
|
+
// Initializing page builder with essential configuration
|
|
335
|
+
pageBuilderClass.setConfigPageBuilder(configPageBuilder)
|
|
336
|
+
// No need to call loadExistingContent; the builder will auto-restore from local storage if available
|
|
337
|
+
</script>
|
|
338
|
+
|
|
339
|
+
<template>
|
|
340
|
+
<PageBuilder />
|
|
341
|
+
</template>
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
> **Tip:** Use `formType: 'create'` for new resources and `formType: 'update'` for editing existing resources. This ensures the correct local storage key is used and the right content is loaded.
|
|
345
|
+
|
|
346
|
+
### Loading Published Content from the Backend into the Page Builder
|
|
347
|
+
|
|
348
|
+
To load existing content that was created with this PageBuilder from any backend:
|
|
349
|
+
|
|
350
|
+
- Use `sharedPageBuilderStore` to ensure the external `PageBuilderClass` and internal `PageBuilder` component share the same state.
|
|
351
|
+
- Import `PageBuilderClass` which contains all methods to manipulate and control the page builder state. Use the `loadExistingContent()` method to load existing content into the page builder.
|
|
352
|
+
- The `PageBuilderClass` uses the shared store to maintain state consistency between external operations and the internal `PageBuilder` component, ensuring that when you load content externally it appears correctly in the PageBuilder interface.
|
|
261
353
|
- Set `formType` to `"update"` in your config object and pass it to the PageBuilder using `pageBuilderClass.setConfigPageBuilder(configPageBuilder)`. This tells the PageBuilder that you're editing an existing resource rather than creating a new one, which affects how the component handles data and interactions.
|
|
262
354
|
|
|
263
|
-
|
|
355
|
+
**Example: Set `formType` to "update" for editing an existing resource**
|
|
264
356
|
|
|
265
|
-
```
|
|
357
|
+
```js
|
|
266
358
|
<script setup>
|
|
267
359
|
import {
|
|
268
360
|
PageBuilder,
|
|
@@ -271,18 +363,20 @@ import {
|
|
|
271
363
|
} from '@myissue/vue-website-page-builder'
|
|
272
364
|
import '@myissue/vue-website-page-builder/style.css'
|
|
273
365
|
|
|
366
|
+
const pageBuilderStateStore = sharedPageBuilderStore
|
|
367
|
+
|
|
274
368
|
const configPageBuilder = {
|
|
275
369
|
updateOrCreate: {
|
|
276
370
|
formType: 'update',
|
|
371
|
+
createNewResourceFormName: 'article',
|
|
277
372
|
},
|
|
278
373
|
}
|
|
279
374
|
|
|
280
|
-
// Use sharedPageBuilderStore for shared state between PageBuilderClass and PageBuilder component
|
|
281
375
|
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
|
|
282
376
|
|
|
283
377
|
// Initializing page builder with essential configuration
|
|
284
378
|
pageBuilderClass.setConfigPageBuilder(configPageBuilder)
|
|
285
|
-
// Populating page builder with existing resource content
|
|
379
|
+
// Populating page builder with existing resource content from backend
|
|
286
380
|
pageBuilderClass.loadExistingContent(existingResourceFromBackend)
|
|
287
381
|
</script>
|
|
288
382
|
|
|
@@ -291,6 +385,8 @@ pageBuilderClass.loadExistingContent(existingResourceFromBackend)
|
|
|
291
385
|
</template>
|
|
292
386
|
```
|
|
293
387
|
|
|
388
|
+
---
|
|
389
|
+
|
|
294
390
|
#### How should `existingResourceFromBackend` look?
|
|
295
391
|
|
|
296
392
|
When loading an existing resource, each component object will have an `id` assigned by the page builder.
|
|
@@ -366,12 +462,12 @@ Example integration:
|
|
|
366
462
|
```javascript
|
|
367
463
|
<script setup>
|
|
368
464
|
import { PageBuilder } from '@myissue/vue-website-page-builder'
|
|
369
|
-
import
|
|
370
|
-
import
|
|
465
|
+
import YourMediaLibraryComponent from './ComponentsPageBuilder/YourMediaLibraryComponent.vue'
|
|
466
|
+
import YourSearchComponent from './ComponentsPageBuilder/YourSearchComponent.vue'
|
|
371
467
|
</script>
|
|
372
468
|
|
|
373
469
|
<template>
|
|
374
|
-
<PageBuilder :
|
|
470
|
+
<PageBuilder :CustomMediaLibraryComponent="YourMediaLibraryComponent" :CustomSearchComponent="YourSearchComponent" />
|
|
375
471
|
</template>
|
|
376
472
|
```
|
|
377
473
|
|