@myissue/vue-website-page-builder 3.2.85 → 3.2.90
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 +116 -16
- package/dist/vue-website-page-builder.css +1 -1
- package/dist/vue-website-page-builder.js +9217 -9022
- package/dist/vue-website-page-builder.umd.cjs +38 -38
- package/package.json +2 -2
- package/src/Components/Homepage/Footer.vue +9 -7
- package/src/Components/Homepage/Navbar.vue +6 -4
- package/src/Components/Layouts/FullWidthElement.vue +6 -6
- package/src/Components/Modals/BuilderComponents.vue +12 -6
- package/src/Components/Modals/DynamicModalBuilder.vue +39 -47
- package/src/Components/Modals/MediaLibraryModal.vue +2 -2
- package/src/Components/Modals/ModalBuilder.vue +23 -19
- package/src/Components/PageBuilder/DefaultComponents/DefaultBuilderComponents.vue +29 -17
- package/src/Components/PageBuilder/DefaultComponents/DefaultMediaLibraryComponent.vue +2 -2
- package/src/Components/PageBuilder/EditorMenu/Editables/BackgroundColorEditor.vue +22 -20
- package/src/Components/PageBuilder/EditorMenu/Editables/BorderRadius.vue +17 -17
- package/src/Components/PageBuilder/EditorMenu/Editables/Borders.vue +28 -26
- package/src/Components/PageBuilder/EditorMenu/Editables/ClassEditor.vue +13 -11
- package/src/Components/PageBuilder/EditorMenu/Editables/ComponentTopMenu.vue +5 -5
- package/src/Components/PageBuilder/EditorMenu/Editables/DeleteElement.vue +4 -4
- package/src/Components/PageBuilder/EditorMenu/Editables/EditGetElement.vue +22 -19
- package/src/Components/PageBuilder/EditorMenu/Editables/ElementEditor.vue +11 -11
- package/src/Components/PageBuilder/EditorMenu/Editables/ImageEditor.vue +4 -4
- package/src/Components/PageBuilder/EditorMenu/Editables/LinkEditor.vue +74 -66
- package/src/Components/PageBuilder/EditorMenu/Editables/ManageBackgroundOpacity.vue +26 -21
- package/src/Components/PageBuilder/EditorMenu/Editables/ManageOpacity.vue +26 -21
- package/src/Components/PageBuilder/EditorMenu/Editables/Margin.vue +101 -0
- package/src/Components/PageBuilder/EditorMenu/Editables/OpacityEditor.vue +2 -3
- package/src/Components/PageBuilder/EditorMenu/Editables/{PaddingPlusMargin.vue → Padding.vue} +8 -41
- package/src/Components/PageBuilder/EditorMenu/Editables/TextColorEditor.vue +22 -20
- package/src/Components/PageBuilder/EditorMenu/Editables/Typography.vue +63 -58
- package/src/Components/PageBuilder/EditorMenu/EditorAccordion.vue +7 -4
- package/src/Components/PageBuilder/EditorMenu/RightSidebarEditor.vue +24 -19
- package/src/Components/PageBuilder/Settings/AdvancedPageBuilderSettings.vue +132 -98
- package/src/Components/PageBuilder/Settings/PageBuilderSettings.vue +216 -146
- package/src/Components/PageBuilder/ToolbarOption/ToolbarOption.vue +14 -14
- package/src/Components/TipTap/TipTap.vue +4 -4
- package/src/Components/TipTap/TipTapInput.vue +39 -33
- package/src/DemoComponents/DemoBuilderComponents.vue +1 -1
- package/src/DemoComponents/DemoUnsplash.vue +79 -56
- package/src/DemoComponents/HomeSection.vue +20 -16
- package/src/PageBuilder/PageBuilder.vue +62 -57
- package/src/PageBuilder/Preview.vue +4 -20
- package/src/composables/PageBuilderClass.ts +66 -120
- package/src/css/app.css +161 -448
- package/src/css/dev-global.css +137 -0
- package/src/main.ts +1 -0
- package/src/tailwind-safelist.html +1 -1
- package/src/utils/builder/tailwaind-colors.ts +488 -488
- package/src/utils/builder/tailwind-border-radius.ts +40 -40
- package/src/utils/builder/tailwind-border-style-width-color.ts +231 -231
- package/src/utils/builder/tailwind-font-sizes.ts +56 -57
- package/src/utils/builder/tailwind-font-styles.ts +44 -11
- package/src/utils/builder/tailwind-opacities.ts +30 -30
- package/src/utils/builder/tailwind-padding-margin.ts +136 -136
- package/dist/components.json +0 -36
- package/src/Components/Loaders/FullScreenSpinner.vue +0 -9
- package/src/Components/Loaders/SmallUniversalSpinner.vue +0 -26
package/README.md
CHANGED
|
@@ -60,7 +60,8 @@ The Page Builder is packed with features:
|
|
|
60
60
|
- **Click & Drop**: Easily rearrange elements on your page.
|
|
61
61
|
- **Reordering**: Change the order of your content without hassle.
|
|
62
62
|
- **True Visual Editing**: See your changes in real-time as you make them.
|
|
63
|
-
- **Media Library**:
|
|
63
|
+
- **Media Library**: Easily inject your own custom media library component.
|
|
64
|
+
-
|
|
64
65
|
- **Local Storage & Auto-Save**: Never lose your work - changes are saved as you go.
|
|
65
66
|
- **Unsplash**: Unsplash Integration.
|
|
66
67
|
- **Responsive Editing**: Ensure your site looks great on all devices.
|
|
@@ -69,9 +70,9 @@ The Page Builder is packed with features:
|
|
|
69
70
|
- **Undo & Redo**: Experiment confidently with the ability to revert changes.
|
|
70
71
|
- **Global Styles**: Global Styles for fonts, designs, & colors.
|
|
71
72
|
- **YouTube Videos**: Integrate video content smoothly.
|
|
73
|
+
- **Styles Prefixed**: No risk of style conflicts between the builder and your app.
|
|
72
74
|
|
|
73
|
-
Powerful Page Builder for any growing merchants, brands, &
|
|
74
|
-
agencies. Empower users to create the perfect content with the Page Builder.
|
|
75
|
+
Powerful Page Builder for any growing merchants, brands, & agencies. Empower users to create the perfect content with the Page Builder.
|
|
75
76
|
|
|
76
77
|
<img style="max-width: 100%;" src="./public/home/text_editor.jpg" alt="Vue Website Page Builder - the media library" />
|
|
77
78
|
|
|
@@ -108,6 +109,23 @@ yarn install
|
|
|
108
109
|
bun install
|
|
109
110
|
```
|
|
110
111
|
|
|
112
|
+
### Quick Start
|
|
113
|
+
|
|
114
|
+
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.
|
|
115
|
+
|
|
116
|
+
- The Page Builder requires its CSS file to be imported for proper styling and automatic icon loading:
|
|
117
|
+
|
|
118
|
+
```vue
|
|
119
|
+
<script setup>
|
|
120
|
+
import { PageBuilder } from '@myissue/vue-website-page-builder'
|
|
121
|
+
import '@myissue/vue-website-page-builder/style.css'
|
|
122
|
+
</script>
|
|
123
|
+
|
|
124
|
+
<template>
|
|
125
|
+
<PageBuilder />
|
|
126
|
+
</template>
|
|
127
|
+
```
|
|
128
|
+
|
|
111
129
|
### Important: CSS Import Required
|
|
112
130
|
|
|
113
131
|
The Page Builder requires its CSS file to be imported for proper styling and automatic icon loading:
|
|
@@ -123,23 +141,78 @@ This import automatically includes:
|
|
|
123
141
|
- ✅ Google Material Icons (no additional setup needed)
|
|
124
142
|
- ✅ Responsive design utilities
|
|
125
143
|
|
|
126
|
-
###
|
|
144
|
+
### Important: CSS Prefix (`pbx-`) for All Builder Styles
|
|
127
145
|
|
|
128
|
-
|
|
146
|
+
The Page Builder automatically adds a `pbx-` prefix to **all CSS classes** it generates or processes, including Tailwind utility classes and any custom classes you add through the builder interface. This namespacing ensures that the builder’s styles will **not conflict** with your application's existing CSS or Tailwind classes.
|
|
129
147
|
|
|
130
|
-
|
|
148
|
+
**What does this mean for you?**
|
|
131
149
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
150
|
+
- If you create your own custom components to use with the Page Builder (instead of the default ones), **remember that the builder will automatically add the `pbx-` prefix to every CSS class** in your component’s markup. This applies to both Tailwind utility classes and any custom classes you define.
|
|
151
|
+
- For example, if you use a custom class called `myCustomCSSClass` in your component, it will be rendered as `pbx-myCustomCSSClass` in the final HTML output.
|
|
152
|
+
- All Tailwind classes are also prefixed, e.g. `bg-red-100` becomes `pbx-bg-red-100`, `md:grid-cols-2` becomes `md:pbx-grid-cols-2`, etc.
|
|
153
|
+
|
|
154
|
+
**Why is this important?**
|
|
155
|
+
|
|
156
|
+
- The prefixing is done automatically by the builder to avoid style conflicts between the builder’s output and your own app’s CSS or Tailwind setup.
|
|
157
|
+
|
|
158
|
+
**Example:**
|
|
159
|
+
|
|
160
|
+
```html
|
|
161
|
+
<!-- Builder output -->
|
|
162
|
+
<div class="pbx-myCustomCSSClass pbx-bg-blue-100 md:pbx-grid-cols-2"></div>
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
```css
|
|
166
|
+
/* To style this element, use the pbx- prefix */
|
|
167
|
+
.pbx-myCustomCSSClass {
|
|
168
|
+
margin-bottom: 2rem;
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
**When** you import the builder’s CSS file:
|
|
173
|
+
|
|
174
|
+
```js
|
|
135
175
|
import '@myissue/vue-website-page-builder/style.css'
|
|
136
|
-
|
|
176
|
+
```
|
|
137
177
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
178
|
+
- ✅ **All styles included in this file are already prefixed with `pbx-`**.
|
|
179
|
+
- ✅ **All Tailwind and custom classes generated by the builder are automatically prefixed with `pbx-`**.
|
|
180
|
+
- ✅ **Any custom components you create for the builder will also have their classes prefixed automatically**.
|
|
181
|
+
|
|
182
|
+
**What does this mean for you?**
|
|
183
|
+
|
|
184
|
+
- There is no risk of style conflicts between the builder and your app, since all builder-related styles are namespaced.
|
|
185
|
+
|
|
186
|
+
### Rendering Only the HTML Output from the Page Builder in Other Frameworks (React, Nuxt, etc.)
|
|
187
|
+
|
|
188
|
+
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.
|
|
189
|
+
|
|
190
|
+
```js
|
|
191
|
+
import '@myissue/vue-website-page-builder/style.css'
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
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.
|
|
195
|
+
|
|
196
|
+
**Example (React):**
|
|
197
|
+
|
|
198
|
+
```jsx
|
|
199
|
+
import '@myissue/vue-website-page-builder/style.css'
|
|
200
|
+
|
|
201
|
+
function MyPage({ html }) {
|
|
202
|
+
return <div dangerouslySetInnerHTML={{ __html: html }} />
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
**Example (Nuxt/Vue):**
|
|
207
|
+
|
|
208
|
+
```js
|
|
209
|
+
import '@myissue/vue-website-page-builder/style.css'
|
|
141
210
|
```
|
|
142
211
|
|
|
212
|
+
Then use `v-html` to render the HTML.
|
|
213
|
+
|
|
214
|
+
> **Note:** You do not need to import any Vue components if you only want to render the HTML. Just import the CSS file.
|
|
215
|
+
|
|
143
216
|
### Optional: Provide Config to PageBuilder
|
|
144
217
|
|
|
145
218
|
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 +636,38 @@ Example `existingResourceFromBackend`:
|
|
|
563
636
|
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
637
|
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
638
|
|
|
566
|
-
|
|
639
|
+
- `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.
|
|
640
|
+
- 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).
|
|
641
|
+
- No extra setup is required—just set `formType: 'update'` and the feature is enabled by default.
|
|
642
|
+
|
|
643
|
+
```js
|
|
644
|
+
<script setup>
|
|
645
|
+
import {
|
|
646
|
+
PageBuilder,
|
|
647
|
+
PageBuilderClass,
|
|
648
|
+
sharedPageBuilderStore,
|
|
649
|
+
} from '@myissue/vue-website-page-builder'
|
|
650
|
+
import '@myissue/vue-website-page-builder/style.css'
|
|
651
|
+
|
|
652
|
+
const pageBuilderStateStore = sharedPageBuilderStore
|
|
653
|
+
|
|
654
|
+
const configPageBuilder = {
|
|
655
|
+
updateOrCreate: {
|
|
656
|
+
formType: 'update',
|
|
657
|
+
formName: 'article',
|
|
658
|
+
},
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
|
|
567
662
|
|
|
568
|
-
|
|
663
|
+
// Initializing with essential configuration
|
|
664
|
+
pageBuilderClass.applyPageBuilderConfig(configPageBuilder)
|
|
665
|
+
</script>
|
|
569
666
|
|
|
570
|
-
|
|
667
|
+
<template>
|
|
668
|
+
<PageBuilder />
|
|
669
|
+
</template>
|
|
670
|
+
```
|
|
571
671
|
|
|
572
672
|
### Custom Components
|
|
573
673
|
|