@myissue/vue-website-page-builder 3.3.63 → 3.3.65
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 +147 -126
- package/dist/logo/mybuilder_new_lowercase.svg +17558 -0
- package/dist/vue-website-page-builder.css +1 -1
- package/dist/vue-website-page-builder.js +7326 -6943
- package/dist/vue-website-page-builder.umd.cjs +54 -51
- package/package.json +2 -2
- package/src/Components/DemoUnsplash.vue +1 -4
- package/src/Components/PageBuilder/EditorMenu/Editables/BackgroundColorEditor.vue +2 -1
- package/src/Components/PageBuilder/EditorMenu/Editables/BorderRadius.vue +18 -5
- package/src/Components/PageBuilder/EditorMenu/Editables/Borders.vue +6 -4
- package/src/Components/PageBuilder/EditorMenu/Editables/ClassEditor.vue +2 -1
- package/src/Components/PageBuilder/EditorMenu/Editables/EditGetElement.vue +5 -5
- package/src/Components/PageBuilder/EditorMenu/Editables/ManageBackgroundOpacity.vue +7 -8
- package/src/Components/PageBuilder/EditorMenu/Editables/ManageOpacity.vue +2 -2
- package/src/Components/PageBuilder/EditorMenu/Editables/Margin.vue +4 -2
- package/src/Components/PageBuilder/EditorMenu/Editables/Padding.vue +4 -2
- package/src/Components/PageBuilder/EditorMenu/Editables/StyleEditor.vue +115 -0
- package/src/Components/PageBuilder/EditorMenu/Editables/TextColorEditor.vue +2 -1
- package/src/Components/PageBuilder/EditorMenu/Editables/Typography.vue +14 -7
- package/src/Components/PageBuilder/EditorMenu/RightSidebarEditor.vue +56 -64
- package/src/Components/PageBuilder/ToolbarOption/ToolbarOption.vue +10 -7
- package/src/PageBuilder/PageBuilder.vue +89 -63
- package/src/PageBuilder/Preview.vue +25 -9
- package/src/composables/extractCleanHTMLFromPageBuilder.ts +4 -3
- package/src/css/app.css +10 -70
- package/src/services/LocalStorageManager.ts +1 -162
- package/src/services/PageBuilderService.ts +586 -265
- package/src/stores/page-builder-state.ts +8 -0
- package/src/tests/PageBuilderTest.vue +20 -19
- package/src/tests/componentsArray.test.json +3 -3
- package/src/types/index.ts +10 -2
- package/src/utils/html-elements/component.ts +10 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myissue/vue-website-page-builder",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.65",
|
|
4
4
|
"description": "Vue 3 page builder component with drag & drop functionality.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/vue-website-page-builder.umd.cjs",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"bugs": {
|
|
51
51
|
"url": "https://github.com/qaiswardag/vue-website-page-builder/issues"
|
|
52
52
|
},
|
|
53
|
-
"homepage": "https://
|
|
53
|
+
"homepage": "https://mybuilder.dev",
|
|
54
54
|
"engines": {
|
|
55
55
|
"node": ">=18.0.0",
|
|
56
56
|
"npm": ">=8.0.0"
|
|
@@ -96,13 +96,10 @@ const nextPage = async function () {
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
const applySelectedImage = async function (imageURL) {
|
|
99
|
-
|
|
100
|
-
pageBuilderService.stageImageForSelectedElement({
|
|
99
|
+
await pageBuilderService.applySelectedImage({
|
|
101
100
|
src: `${imageURL}`,
|
|
102
101
|
})
|
|
103
102
|
|
|
104
|
-
await pageBuilderService.applyPendingImageToSelectedElement()
|
|
105
|
-
|
|
106
103
|
closeMediaLibraryModal()
|
|
107
104
|
}
|
|
108
105
|
|
|
@@ -57,12 +57,13 @@ watch(
|
|
|
57
57
|
|
|
58
58
|
<ListboxButton
|
|
59
59
|
v-if="!globalPageLayout"
|
|
60
|
-
class="pbx-h-10 pbx-w-10 pbx-flex-end pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-
|
|
60
|
+
class="pbx-h-10 pbx-w-10 pbx-flex-end pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-200 pbx-aspect-square hover:pbx-bg-gray-100 hover:pbx-fill-white focus-visible:pbx-ring-0"
|
|
61
61
|
>
|
|
62
62
|
<div class="pbx-flex pbx-flex-col">
|
|
63
63
|
<div class="pbx-flex pbx-gap-2 pbx-items-center">
|
|
64
64
|
<span
|
|
65
65
|
class="material-symbols-outlined"
|
|
66
|
+
style="text-shadow: rgb(0 0 0 / 10%) 1.5px 1.5px 0px"
|
|
66
67
|
:class="`pbx-text-${backgroundColor?.replace('pbx-bg-', '')}`"
|
|
67
68
|
>
|
|
68
69
|
format_color_fill
|
|
@@ -77,8 +77,9 @@ watch(
|
|
|
77
77
|
<template #content>
|
|
78
78
|
<p class="pbx-myPrimaryParagraph pbx-font-medium pbx-py-0 pbx-my-4">Global</p>
|
|
79
79
|
<div class="pbx-my-2 pbx-py-2">
|
|
80
|
-
<label class="pbx-myPrimaryInputLabel"> Border Radius </label>
|
|
80
|
+
<label for="global-border-radius" class="pbx-myPrimaryInputLabel"> Border Radius </label>
|
|
81
81
|
<select
|
|
82
|
+
id="global-border-radius"
|
|
82
83
|
v-model="borderRadiusGlobal"
|
|
83
84
|
class="pbx-myPrimarySelect"
|
|
84
85
|
@change="pageBuilderService.handleBorderRadiusGlobal(borderRadiusGlobal)"
|
|
@@ -94,8 +95,11 @@ watch(
|
|
|
94
95
|
</div>
|
|
95
96
|
<p class="pbx-myPrimaryParagraph pbx-font-medium pbx-py-0 pbx-my-4">Specific</p>
|
|
96
97
|
<div class="pbx-my-2 pbx-py-2">
|
|
97
|
-
<label class="pbx-myPrimaryInputLabel">
|
|
98
|
+
<label for="border-radius-top-left" class="pbx-myPrimaryInputLabel">
|
|
99
|
+
Border Radius top left
|
|
100
|
+
</label>
|
|
98
101
|
<select
|
|
102
|
+
id="border-radius-top-left"
|
|
99
103
|
v-model="borderRadiusTopLeft"
|
|
100
104
|
class="pbx-myPrimarySelect"
|
|
101
105
|
@change="pageBuilderService.handleBorderRadiusTopLeft(borderRadiusTopLeft)"
|
|
@@ -110,8 +114,11 @@ watch(
|
|
|
110
114
|
</select>
|
|
111
115
|
</div>
|
|
112
116
|
<div class="pbx-my-2 pbx-py-2">
|
|
113
|
-
<label class="pbx-myPrimaryInputLabel">
|
|
117
|
+
<label for="border-radius-top-right" class="pbx-myPrimaryInputLabel">
|
|
118
|
+
Border Radius top right
|
|
119
|
+
</label>
|
|
114
120
|
<select
|
|
121
|
+
id="border-radius-top-right"
|
|
115
122
|
v-model="borderRadiusTopRight"
|
|
116
123
|
class="pbx-myPrimarySelect"
|
|
117
124
|
@change="pageBuilderService.handleBorderRadiusTopRight(borderRadiusTopRight)"
|
|
@@ -126,8 +133,11 @@ watch(
|
|
|
126
133
|
</select>
|
|
127
134
|
</div>
|
|
128
135
|
<div class="pbx-my-2 pbx-py-2">
|
|
129
|
-
<label class="pbx-myPrimaryInputLabel">
|
|
136
|
+
<label for="border-radius-bottom-left" class="pbx-myPrimaryInputLabel">
|
|
137
|
+
Border Radius bottom left
|
|
138
|
+
</label>
|
|
130
139
|
<select
|
|
140
|
+
id="border-radius-bottom-left"
|
|
131
141
|
v-model="borderRadiusBottomleft"
|
|
132
142
|
class="pbx-myPrimarySelect"
|
|
133
143
|
@change="pageBuilderService.handleBorderRadiusBottomleft(borderRadiusBottomleft)"
|
|
@@ -142,8 +152,11 @@ watch(
|
|
|
142
152
|
</select>
|
|
143
153
|
</div>
|
|
144
154
|
<div class="pbx-my-2 pbx-py-2">
|
|
145
|
-
<label class="pbx-myPrimaryInputLabel">
|
|
155
|
+
<label for="border-radius-bottom-right" class="pbx-myPrimaryInputLabel">
|
|
156
|
+
Border Radius bottom right
|
|
157
|
+
</label>
|
|
146
158
|
<select
|
|
159
|
+
id="border-radius-bottom-right"
|
|
147
160
|
v-model="borderRadiusBottomRight"
|
|
148
161
|
class="pbx-myPrimarySelect"
|
|
149
162
|
@change="pageBuilderService.handleBorderRadiusBottomRight(borderRadiusBottomRight)"
|
|
@@ -57,8 +57,9 @@ watch(
|
|
|
57
57
|
<p class="pbx-myPrimaryParagraph pbx-font-medium pbx-py-0 pbx-my-4">Border</p>
|
|
58
58
|
|
|
59
59
|
<div class="pbx-my-2 pbx-py-2">
|
|
60
|
-
<label class="pbx-myPrimaryInputLabel"> Border Style </label>
|
|
60
|
+
<label for="border-style" class="pbx-myPrimaryInputLabel"> Border Style </label>
|
|
61
61
|
<select
|
|
62
|
+
id="border-style"
|
|
62
63
|
v-model="borderStyle"
|
|
63
64
|
class="pbx-myPrimarySelect"
|
|
64
65
|
@change="pageBuilderService.handleBorderStyle(borderStyle)"
|
|
@@ -73,8 +74,9 @@ watch(
|
|
|
73
74
|
</select>
|
|
74
75
|
</div>
|
|
75
76
|
<div class="pbx-my-2 pbx-py-2">
|
|
76
|
-
<label class="pbx-myPrimaryInputLabel"> Border Width </label>
|
|
77
|
+
<label for="border-width" class="pbx-myPrimaryInputLabel"> Border Width </label>
|
|
77
78
|
<select
|
|
79
|
+
id="border-width"
|
|
78
80
|
v-model="borderWidth"
|
|
79
81
|
class="pbx-myPrimarySelect"
|
|
80
82
|
@change="pageBuilderService.handleBorderWidth(borderWidth)"
|
|
@@ -89,10 +91,10 @@ watch(
|
|
|
89
91
|
</select>
|
|
90
92
|
</div>
|
|
91
93
|
|
|
92
|
-
<label class="pbx-myPrimaryInputLabel"> Border Color </label>
|
|
94
|
+
<label for="border-color" class="pbx-myPrimaryInputLabel"> Border Color </label>
|
|
93
95
|
<Listbox as="div" v-model="borderColor">
|
|
94
96
|
<div class="pbx-relative pbx-mt-2">
|
|
95
|
-
<ListboxButton class="pbx-myPrimarySelect">
|
|
97
|
+
<ListboxButton class="pbx-myPrimarySelect" id="border-color">
|
|
96
98
|
<span class="pbx-flex pbx-items-center pbx-gap-2">
|
|
97
99
|
<div v-if="getBorderColor === 'none'">
|
|
98
100
|
<div class="pbx-myPrimaryColorPreview pbx-border-none">
|
|
@@ -78,13 +78,14 @@ const handleAddClasses = async () => {
|
|
|
78
78
|
</div>
|
|
79
79
|
|
|
80
80
|
<div>
|
|
81
|
-
<label class="pbx-myPrimaryInputLabel">
|
|
81
|
+
<label for="custom-css" class="pbx-myPrimaryInputLabel">
|
|
82
82
|
Add your CSS.
|
|
83
83
|
<br />
|
|
84
84
|
The pbx- prefix is added automatically.
|
|
85
85
|
</label>
|
|
86
86
|
<div class="pbx-flex pbx-gap-2 pbx-item-center">
|
|
87
87
|
<input
|
|
88
|
+
id="custom-css"
|
|
88
89
|
v-model="inputClass"
|
|
89
90
|
type="text"
|
|
90
91
|
placeholder="Type class"
|
|
@@ -273,7 +273,7 @@ const getRestoredElement = computed(() => {
|
|
|
273
273
|
<button
|
|
274
274
|
@click="handleModalIframeSrc"
|
|
275
275
|
type="button"
|
|
276
|
-
class="pbx-h-10 pbx-w-10 pbx-flex-end pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-
|
|
276
|
+
class="pbx-h-10 pbx-w-10 pbx-flex-end pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-200 pbx-aspect-square hover:pbx-bg-gray-100 hover:pbx-fill-white focus-visible:pbx-ring-0"
|
|
277
277
|
>
|
|
278
278
|
<span class="material-symbols-outlined"> play_circle </span>
|
|
279
279
|
</button>
|
|
@@ -290,7 +290,7 @@ const getRestoredElement = computed(() => {
|
|
|
290
290
|
<button
|
|
291
291
|
@click="handleModalPreviewTiptap"
|
|
292
292
|
type="button"
|
|
293
|
-
class="pbx-h-10 pbx-w-10 pbx-flex-end pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-
|
|
293
|
+
class="pbx-h-10 pbx-w-10 pbx-flex-end pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-200 pbx-aspect-square hover:pbx-bg-gray-100 hover:pbx-fill-white focus-visible:pbx-ring-0"
|
|
294
294
|
>
|
|
295
295
|
<span class="material-symbols-outlined"> edit </span>
|
|
296
296
|
</button>
|
|
@@ -310,7 +310,7 @@ const getRestoredElement = computed(() => {
|
|
|
310
310
|
<button
|
|
311
311
|
@click="handleAddImage"
|
|
312
312
|
type="button"
|
|
313
|
-
class="pbx-h-10 pbx-w-10 pbx-flex-end pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-
|
|
313
|
+
class="pbx-h-10 pbx-w-10 pbx-flex-end pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-200 pbx-aspect-square hover:pbx-bg-gray-100 hover:pbx-fill-white focus-visible:pbx-ring-0"
|
|
314
314
|
>
|
|
315
315
|
<span class="material-symbols-outlined"> add_photo_alternate </span>
|
|
316
316
|
</button>
|
|
@@ -332,7 +332,7 @@ const getRestoredElement = computed(() => {
|
|
|
332
332
|
<button
|
|
333
333
|
@click="pageBuilderService.deleteElementFromDOM"
|
|
334
334
|
type="button"
|
|
335
|
-
class="pbx-h-10 pbx-w-10 pbx-flex-end pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-
|
|
335
|
+
class="pbx-h-10 pbx-w-10 pbx-flex-end pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-200 pbx-aspect-square hover:pbx-bg-gray-100 hover:pbx-fill-white focus-visible:pbx-ring-0"
|
|
336
336
|
>
|
|
337
337
|
<span class="material-symbols-outlined"> delete </span>
|
|
338
338
|
</button>
|
|
@@ -340,7 +340,7 @@ const getRestoredElement = computed(() => {
|
|
|
340
340
|
|
|
341
341
|
<div
|
|
342
342
|
v-if="getElement && getComponent"
|
|
343
|
-
class="pbx-h-10 pbx-w-10 pbx-flex-end pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-
|
|
343
|
+
class="pbx-h-10 pbx-w-10 pbx-flex-end pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-200 pbx-aspect-square hover:pbx-bg-gray-100 hover:pbx-fill-white focus-visible:pbx-ring-0"
|
|
344
344
|
@click="pageBuilderService.clearHtmlSelection()"
|
|
345
345
|
>
|
|
346
346
|
<span class="material-symbols-outlined"> close </span>
|
|
@@ -32,11 +32,11 @@ watch(
|
|
|
32
32
|
|
|
33
33
|
<template>
|
|
34
34
|
<div class="pbx-my-2 pbx-py-2">
|
|
35
|
-
<label class="pbx-myPrimaryInputLabel"> Background
|
|
35
|
+
<label for="bg-opacity" class="pbx-myPrimaryInputLabel"> Background Opacity</label>
|
|
36
36
|
|
|
37
37
|
<Listbox as="div" v-model="opacityVueModel">
|
|
38
38
|
<div class="pbx-relative">
|
|
39
|
-
<ListboxButton class="pbx-myPrimarySelect">
|
|
39
|
+
<ListboxButton class="pbx-myPrimarySelect" id="bg-opacity">
|
|
40
40
|
<span class="pbx-flex pbx-items-center pbx-gap-2">
|
|
41
41
|
<div v-if="opacityVueModel === 'none'">
|
|
42
42
|
<div class="pbx-myPrimaryColorPreview pbx-border-none">
|
|
@@ -79,15 +79,14 @@ watch(
|
|
|
79
79
|
>
|
|
80
80
|
<li
|
|
81
81
|
:class="[
|
|
82
|
-
active
|
|
82
|
+
active
|
|
83
|
+
? 'pbx-bg-myPrimaryLinkColor text-white'
|
|
84
|
+
: 'pbx-text-myPrimaryDarkGrayColor',
|
|
83
85
|
'pbx-relative pbx-cursor-default pbx-select-none pbx-py-2 pbx-pl-3 pbx-pr-9',
|
|
84
86
|
]"
|
|
85
87
|
>
|
|
86
88
|
<div class="pbx-flex pbx-items-center">
|
|
87
|
-
<div
|
|
88
|
-
v-if="backgroundOpacity === 'none'"
|
|
89
|
-
class="pbx-aspect-square pbx-w-6 pbx-h-6"
|
|
90
|
-
>
|
|
89
|
+
<div v-if="backgroundOpacity === 'none'">
|
|
91
90
|
<div class="pbx-myPrimaryColorPreview pbx-border-none">
|
|
92
91
|
<span class="material-symbols-outlined"> ev_shadow </span>
|
|
93
92
|
</div>
|
|
@@ -98,10 +97,10 @@ watch(
|
|
|
98
97
|
class="pbx-aspect-square pbx-w-6 pbx-h-6 pbx-bg-gray-950"
|
|
99
98
|
:class="`${backgroundOpacity}`"
|
|
100
99
|
></div>
|
|
100
|
+
<span v-if="backgroundOpacity === 'none'" class="pbx-ml-3">Transparent</span>
|
|
101
101
|
<span v-if="backgroundOpacity !== 'none'" class="pbx-ml-3">{{
|
|
102
102
|
backgroundOpacity
|
|
103
103
|
}}</span>
|
|
104
|
-
<span v-if="backgroundOpacity === 'none'" class="pbx-ml-3">Transparent</span>
|
|
105
104
|
</div>
|
|
106
105
|
</li>
|
|
107
106
|
</ListboxOption>
|
|
@@ -31,11 +31,11 @@ watch(
|
|
|
31
31
|
|
|
32
32
|
<template>
|
|
33
33
|
<div class="pbx-my-2 pbx-py-2">
|
|
34
|
-
<label class="pbx-myPrimaryInputLabel"> Opacity</label>
|
|
34
|
+
<label for="default-opacity" class="pbx-myPrimaryInputLabel"> Opacity</label>
|
|
35
35
|
|
|
36
36
|
<Listbox as="div" v-model="opacityVueModel">
|
|
37
37
|
<div class="pbx-relative">
|
|
38
|
-
<ListboxButton class="pbx-myPrimarySelect">
|
|
38
|
+
<ListboxButton class="pbx-myPrimarySelect" id="default-opacity">
|
|
39
39
|
<span class="pbx-flex pbx-items-center pbx-gap-2">
|
|
40
40
|
<div v-if="opacityVueModel === 'none'">
|
|
41
41
|
<div class="pbx-myPrimaryColorPreview pbx-border-none">
|
|
@@ -64,8 +64,9 @@ watch(
|
|
|
64
64
|
<template #title>Margin</template>
|
|
65
65
|
<template #content>
|
|
66
66
|
<div class="pbx-my-2 pbx-py-2">
|
|
67
|
-
<label class="pbx-myPrimaryInputLabel"> Vertical Margin </label>
|
|
67
|
+
<label for="vertical-margin" class="pbx-myPrimaryInputLabel"> Vertical Margin </label>
|
|
68
68
|
<select
|
|
69
|
+
id="vertical-margin"
|
|
69
70
|
v-model="fontVerticalMargin"
|
|
70
71
|
class="pbx-myPrimarySelect"
|
|
71
72
|
@change="pageBuilderService.handleVerticalMargin(fontVerticalMargin)"
|
|
@@ -81,8 +82,9 @@ watch(
|
|
|
81
82
|
</div>
|
|
82
83
|
<hr />
|
|
83
84
|
<div class="pbx-my-2 pbx-py-2">
|
|
84
|
-
<label class="pbx-myPrimaryInputLabel"> Horizontal Margin </label>
|
|
85
|
+
<label for="horizontal-margin" class="pbx-myPrimaryInputLabel"> Horizontal Margin </label>
|
|
85
86
|
<select
|
|
87
|
+
id="horizontal-margin"
|
|
86
88
|
v-model="fontHorizontalMargin"
|
|
87
89
|
class="pbx-myPrimarySelect"
|
|
88
90
|
@change="pageBuilderService.handleHorizontalMargin(fontHorizontalMargin)"
|
|
@@ -64,8 +64,9 @@ watch(
|
|
|
64
64
|
<template #title>Padding</template>
|
|
65
65
|
<template #content>
|
|
66
66
|
<div class="pbx-my-2 pbx-py-2">
|
|
67
|
-
<label class="pbx-myPrimaryInputLabel"> Vertical Padding </label>
|
|
67
|
+
<label for="vertical-padding" class="pbx-myPrimaryInputLabel"> Vertical Padding </label>
|
|
68
68
|
<select
|
|
69
|
+
id="vertical-padding"
|
|
69
70
|
v-model="fontVerticalPadding"
|
|
70
71
|
class="pbx-myPrimarySelect"
|
|
71
72
|
@change="pageBuilderService.handleVerticalPadding(fontVerticalPadding)"
|
|
@@ -81,8 +82,9 @@ watch(
|
|
|
81
82
|
</div>
|
|
82
83
|
<hr />
|
|
83
84
|
<div class="pbx-my-2 pbx-py-2">
|
|
84
|
-
<label class="pbx-myPrimaryInputLabel"> Horizontal Padding </label>
|
|
85
|
+
<label for="horizontal-padding" class="pbx-myPrimaryInputLabel"> Horizontal Padding </label>
|
|
85
86
|
<select
|
|
87
|
+
id="horizontal-padding"
|
|
86
88
|
v-model="fontHorizontalPadding"
|
|
87
89
|
class="pbx-myPrimarySelect"
|
|
88
90
|
@change="pageBuilderService.handleHorizontalPadding(fontHorizontalPadding)"
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref, computed, watch, nextTick } from 'vue'
|
|
3
|
+
import { sharedPageBuilderStore } from '../../../../stores/shared-store'
|
|
4
|
+
import EditorAccordion from '../EditorAccordion.vue'
|
|
5
|
+
import { getPageBuilder } from '../../../../composables/builderInstance'
|
|
6
|
+
|
|
7
|
+
const pageBuilderService = getPageBuilder()
|
|
8
|
+
|
|
9
|
+
const pageBuilderStateStore = sharedPageBuilderStore
|
|
10
|
+
|
|
11
|
+
const currentStyles = ref(null)
|
|
12
|
+
const getCurrentStyles = computed(() => pageBuilderStateStore.getCurrentStyles)
|
|
13
|
+
|
|
14
|
+
watch(
|
|
15
|
+
getCurrentStyles,
|
|
16
|
+
(newValue) => {
|
|
17
|
+
currentStyles.value = newValue
|
|
18
|
+
},
|
|
19
|
+
{ immediate: true },
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
const inputProperty = ref('')
|
|
23
|
+
const inputValue = ref('')
|
|
24
|
+
const errorMessage = ref('')
|
|
25
|
+
const valueInputRef = ref(null)
|
|
26
|
+
|
|
27
|
+
const handleEnterOnProperty = () => {
|
|
28
|
+
if (valueInputRef.value) {
|
|
29
|
+
valueInputRef.value.focus()
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const handleAddStyle = async () => {
|
|
34
|
+
const property = inputProperty.value.trim()
|
|
35
|
+
const value = inputValue.value.trim()
|
|
36
|
+
|
|
37
|
+
if (!property || !value) {
|
|
38
|
+
errorMessage.value = 'Please enter a property and a value.'
|
|
39
|
+
return
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (currentStyles.value && currentStyles.value[property]) {
|
|
43
|
+
errorMessage.value = `Property "${property}" already exists. Remove it first to add a new one.`
|
|
44
|
+
return
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
errorMessage.value = '' // Clear error
|
|
48
|
+
|
|
49
|
+
pageBuilderService.handleAddStyle(property, value)
|
|
50
|
+
await pageBuilderService.initializeElementStyles()
|
|
51
|
+
|
|
52
|
+
inputProperty.value = ''
|
|
53
|
+
inputValue.value = ''
|
|
54
|
+
}
|
|
55
|
+
</script>
|
|
56
|
+
|
|
57
|
+
<template>
|
|
58
|
+
<EditorAccordion>
|
|
59
|
+
<template #title>Inline Styles</template>
|
|
60
|
+
<template #content>
|
|
61
|
+
<label class="pbx-myPrimaryInputLabel pbx-my-4">
|
|
62
|
+
These are the inline styles applied by the builder. Add your own styles and press Enter to
|
|
63
|
+
apply them to the selected element.
|
|
64
|
+
</label>
|
|
65
|
+
|
|
66
|
+
<div class="pbx-flex pbx-flex-row pbx-flex-wrap pbx-gap-2 pbx-mt-2 pbx-mb-4">
|
|
67
|
+
<div
|
|
68
|
+
v-for="(value, key) in currentStyles"
|
|
69
|
+
:key="key"
|
|
70
|
+
class="pbx-myPrimaryTag pbx-cursor-pointer hover:pbx-bg-myPrimaryErrorColor hover:pbx-text-white pbx-text-xs pbx-py-2 pbx-font-medium"
|
|
71
|
+
@click="
|
|
72
|
+
async () => {
|
|
73
|
+
pageBuilderService.handleRemoveStyle(key)
|
|
74
|
+
await pageBuilderService.initializeElementStyles()
|
|
75
|
+
}
|
|
76
|
+
"
|
|
77
|
+
>
|
|
78
|
+
<div class="pbx-flex pbx-items-center pbx-gap-1">
|
|
79
|
+
<span class="pbx-mr-1"> {{ key }}: {{ value }}; </span>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
<div>
|
|
85
|
+
<label for="custom-style-property" class="pbx-myPrimaryInputLabel">
|
|
86
|
+
Add your own style.
|
|
87
|
+
</label>
|
|
88
|
+
<div class="pbx-flex pbx-gap-2 pbx-flex-col pbx-item-center">
|
|
89
|
+
<input
|
|
90
|
+
id="custom-style-property"
|
|
91
|
+
v-model="inputProperty"
|
|
92
|
+
type="text"
|
|
93
|
+
placeholder="property"
|
|
94
|
+
@keydown.enter.prevent="handleEnterOnProperty"
|
|
95
|
+
autocomplete="off"
|
|
96
|
+
class="pbx-myPrimaryInput"
|
|
97
|
+
/>
|
|
98
|
+
<input
|
|
99
|
+
id="custom-style-value"
|
|
100
|
+
ref="valueInputRef"
|
|
101
|
+
v-model="inputValue"
|
|
102
|
+
type="text"
|
|
103
|
+
placeholder="value"
|
|
104
|
+
@keydown.enter="handleAddStyle"
|
|
105
|
+
autocomplete="off"
|
|
106
|
+
class="pbx-myPrimaryInput"
|
|
107
|
+
/>
|
|
108
|
+
|
|
109
|
+
<button @click="handleAddStyle" type="button" class="pbx-myPrimaryButton">Add</button>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
<p v-if="errorMessage" class="pbx-myPrimaryInputError">{{ errorMessage }}</p>
|
|
113
|
+
</template>
|
|
114
|
+
</EditorAccordion>
|
|
115
|
+
</template>
|
|
@@ -57,12 +57,13 @@ watch(
|
|
|
57
57
|
|
|
58
58
|
<ListboxButton
|
|
59
59
|
v-if="!globalPageLayout"
|
|
60
|
-
class="pbx-h-10 pbx-w-10 pbx-flex-end pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-
|
|
60
|
+
class="pbx-h-10 pbx-w-10 pbx-flex-end pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-200 pbx-aspect-square hover:pbx-bg-gray-100 hover:pbx-fill-white focus-visible:pbx-ring-0"
|
|
61
61
|
>
|
|
62
62
|
<div class="pbx-flex pbx-flex-col">
|
|
63
63
|
<div class="pbx-flex pbx-gap-2 pbx-items-center">
|
|
64
64
|
<span
|
|
65
65
|
class="material-symbols-outlined"
|
|
66
|
+
style="text-shadow: rgb(0 0 0 / 10%) 1.5px 1.5px 0px"
|
|
66
67
|
:class="`pbx-text-${textColor?.replace('pbx-text-', '')}`"
|
|
67
68
|
>
|
|
68
69
|
format_color_text
|
|
@@ -105,8 +105,9 @@ watch(
|
|
|
105
105
|
<p class="pbx-myPrimaryParagraph pbx-font-medium pbx-py-0 pbx-my-4">Font Appearance</p>
|
|
106
106
|
<template v-if="false">
|
|
107
107
|
<div class="pbx-my-2 pbx-py-2">
|
|
108
|
-
<label class="pbx-myPrimaryInputLabel"> Font Size </label>
|
|
108
|
+
<label for="font-base" class="pbx-myPrimaryInputLabel"> Font Size </label>
|
|
109
109
|
<select
|
|
110
|
+
id="font-base"
|
|
110
111
|
v-model="fontBase"
|
|
111
112
|
class="pbx-myPrimarySelect"
|
|
112
113
|
@change="pageBuilderService.handleFontSizeBase(fontBase)"
|
|
@@ -119,8 +120,9 @@ watch(
|
|
|
119
120
|
</div>
|
|
120
121
|
</template>
|
|
121
122
|
<div class="pbx-my-2 pbx-py-2">
|
|
122
|
-
<label class="pbx-myPrimaryInputLabel"> Font size </label>
|
|
123
|
+
<label for="font-desktop" class="pbx-myPrimaryInputLabel"> Font size </label>
|
|
123
124
|
<select
|
|
125
|
+
id="font-desktop"
|
|
124
126
|
v-model="fontDesktop"
|
|
125
127
|
class="pbx-myPrimarySelect"
|
|
126
128
|
@change="pageBuilderService.handleFontSizeDesktop(fontDesktop)"
|
|
@@ -133,8 +135,9 @@ watch(
|
|
|
133
135
|
</div>
|
|
134
136
|
<template v-if="false">
|
|
135
137
|
<div class="pbx-my-2 pbx-py-2">
|
|
136
|
-
<label class="pbx-myPrimaryInputLabel"> Font tablet size </label>
|
|
138
|
+
<label for="font-tablet" class="pbx-myPrimaryInputLabel"> Font tablet size </label>
|
|
137
139
|
<select
|
|
140
|
+
id="font-tablet"
|
|
138
141
|
v-model="fontTablet"
|
|
139
142
|
class="pbx-myPrimarySelect"
|
|
140
143
|
@change="pageBuilderService.handleFontSizeTablet(fontTablet)"
|
|
@@ -146,8 +149,9 @@ watch(
|
|
|
146
149
|
</select>
|
|
147
150
|
</div>
|
|
148
151
|
<div class="pbx-my-2 pbx-py-2">
|
|
149
|
-
<label class="pbx-myPrimaryInputLabel"> Font small screens </label>
|
|
152
|
+
<label for="font-mobile" class="pbx-myPrimaryInputLabel"> Font small screens </label>
|
|
150
153
|
<select
|
|
154
|
+
id="font-mobile"
|
|
151
155
|
v-model="fontMobile"
|
|
152
156
|
class="pbx-myPrimarySelect"
|
|
153
157
|
@change="pageBuilderService.handleFontSizeMobile(fontMobile)"
|
|
@@ -162,8 +166,9 @@ watch(
|
|
|
162
166
|
<hr />
|
|
163
167
|
|
|
164
168
|
<div class="pbx-my-2 pbx-py-2">
|
|
165
|
-
<label class="pbx-myPrimaryInputLabel"> Font weight </label>
|
|
169
|
+
<label for="font-weight" class="pbx-myPrimaryInputLabel"> Font weight </label>
|
|
166
170
|
<select
|
|
171
|
+
id="font-weight"
|
|
167
172
|
v-model="fontWeight"
|
|
168
173
|
class="pbx-myPrimarySelect"
|
|
169
174
|
@change="pageBuilderService.handleFontWeight(fontWeight)"
|
|
@@ -178,8 +183,9 @@ watch(
|
|
|
178
183
|
|
|
179
184
|
<!-- FONT FAMILY -->
|
|
180
185
|
<div class="pbx-my-2 pbx-py-2">
|
|
181
|
-
<label class="pbx-myPrimaryInputLabel"> Font family </label>
|
|
186
|
+
<label for="font-family" class="pbx-myPrimaryInputLabel"> Font family </label>
|
|
182
187
|
<select
|
|
188
|
+
id="font-family"
|
|
183
189
|
v-model="fontFamily"
|
|
184
190
|
class="pbx-myPrimarySelect"
|
|
185
191
|
@change="pageBuilderService.handleFontFamily(fontFamily)"
|
|
@@ -193,8 +199,9 @@ watch(
|
|
|
193
199
|
<hr />
|
|
194
200
|
|
|
195
201
|
<div class="pbx-my-2 pbx-py-2">
|
|
196
|
-
<label class="pbx-myPrimaryInputLabel"> Font Style </label>
|
|
202
|
+
<label for="font-style" class="pbx-myPrimaryInputLabel"> Font Style </label>
|
|
197
203
|
<select
|
|
204
|
+
id="font-style"
|
|
198
205
|
v-model="fontStyle"
|
|
199
206
|
class="pbx-myPrimarySelect"
|
|
200
207
|
@change="pageBuilderService.handleFontStyle(fontStyle)"
|