@myissue/vue-website-page-builder 3.3.18 → 3.3.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myissue/vue-website-page-builder",
3
- "version": "3.3.18",
3
+ "version": "3.3.21",
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",
@@ -27,19 +27,22 @@ watch(
27
27
  <template>
28
28
  <Listbox as="div" v-model="backgroundColor">
29
29
  <div class="pbx-relative">
30
- <ListboxButton class="pbx-w-max pbx-flex pbx-items-center pbx-myPrimaryTag">
31
- <div v-if="getBackgroundColor === 'none'" class="pbx-flex pbx-gap-2 pbx-items-center">
32
- <span class="material-symbols-outlined"> colors </span>
33
- <span class="pbx-block pbx-truncate pbx-text-[12.5px]">Background color </span>
34
- </div>
35
- <div v-if="backgroundColor !== 'none'" class="pbx-flex pbx-items-center pbx-gap-2">
36
- <div
37
- class="pbx-aspect-square pbx-w-6 pbx-h-6 pbx-border pbx-border-gray-800 pbx-rounded-sm"
38
- :class="`pbx-bg-${backgroundColor?.replace('pbx-bg-', '')}`"
39
- ></div>
40
- <span class="pbx-block pbx-truncate">{{ backgroundColor }}</span>
41
- </div>
42
- </ListboxButton>
30
+ <div class="pbx-flex pbx-gap-2 pbx-items-center">
31
+ <ListboxButton
32
+ 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-50 pbx-aspect-square hover:pbx-bg-gray-100 hover:pbx-fill-white pbx-bg-gray-300 focus-visible:pbx-ring-0"
33
+ >
34
+ <div class="pbx-flex pbx-flex-col">
35
+ <div class="pbx-flex pbx-gap-2 pbx-items-center">
36
+ <span
37
+ class="material-symbols-outlined"
38
+ :class="`pbx-text-${backgroundColor?.replace('pbx-bg-', '')}`"
39
+ >
40
+ format_color_fill
41
+ </span>
42
+ </div>
43
+ </div>
44
+ </ListboxButton>
45
+ </div>
43
46
 
44
47
  <transition
45
48
  leave-active-class="pbx-transition pbx-ease-in pbx-duration-100"
@@ -17,6 +17,11 @@ const getElement = computed(() => {
17
17
  return pageBuilderStateStore.getElement
18
18
  })
19
19
 
20
+ // Get tagName of element
21
+ const elementTag = computed(() => {
22
+ return getElement.value?.tagName
23
+ })
24
+
20
25
  const getShowModalTipTap = computed(() => {
21
26
  const result = pageBuilderStateStore.getShowModalTipTap
22
27
 
@@ -185,13 +190,11 @@ const handleModalIframeSrc = function () {
185
190
  }
186
191
  }
187
192
 
188
- // const pagebuilder = ref(null)
189
- // const videoElement = ref(null)
190
-
191
- // videoElement.value = pagebuilder.value.querySelector('#youtube-video')
192
- // pagebuilder.value = document.querySelector('#pagebuilder')
193
+ const getRestoredElement = computed(() => {
194
+ return pageBuilderStateStore.getRestoredElement
195
+ })
193
196
  </script>
194
- <template>
197
+ <template v-if="getElement">
195
198
  <div>
196
199
  <DynamicModalBuilder
197
200
  :showDynamicModalBuilder="showModalIframeSrc"
@@ -260,67 +263,87 @@ const handleModalIframeSrc = function () {
260
263
  >
261
264
  </MediaLibraryModal>
262
265
 
263
- <div
264
- class="pbx-z-20 pbx-px-2 pbx-py-1 pbx-h-24 pbx-flex pbx-items-center pbx-justify-center pbx-mt-2 pbx-mx-2 pbx-border-b pbx-border-myPrimaryLightGrayColor"
265
- >
266
- <div
267
- class="pbx-flex pbx-items-center pbx-justify-center"
268
- :class="{ 'pbx-rounded-full pbx-border pbx-border-gray-200 pbx-shadow-sm': getElement }"
269
- >
270
- <template v-if="pageBuilderService.ElOrFirstChildIsIframe()">
271
- <div class="pbx-px-2 pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-w-max">
272
- <button @click="handleModalIframeSrc" type="button" class="pbx-myPrimaryTag">
273
- <span class="material-symbols-outlined"> play_circle </span>
274
- <span>Add YouTube</span>
275
- </button>
276
- </div>
277
- </template>
266
+ <p v-if="false" class="pbx-font-medium pbx-text-[10px] pbx-w-max lg:pbx-block pbx-hidden">
267
+ Editing
268
+ <span class="pbx-lowercase">&lt;{{ elementTag }}&gt;</span>
269
+ </p>
270
+ <div class="pbx-flex pbx-items-center pbx-justify-center pbx-gap-2" :class="{ '': getElement }">
271
+ <template v-if="pageBuilderService.ElOrFirstChildIsIframe()">
272
+ <div class="pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-w-max">
273
+ <button
274
+ @click="handleModalIframeSrc"
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-50 pbx-aspect-square hover:pbx-bg-gray-100 hover:pbx-fill-white pbx-bg-gray-300 focus-visible:pbx-ring-0"
277
+ >
278
+ <span class="material-symbols-outlined"> play_circle </span>
279
+ </button>
280
+ </div>
281
+ </template>
278
282
 
279
- <template
280
- v-if="
281
- pageBuilderService.isSelectedElementValidText() &&
282
- !pageBuilderService.ElOrFirstChildIsIframe()
283
- "
284
- >
285
- <div class="pbx-px-2 pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-w-max">
286
- <button @click="handleModalPreviewTiptap" type="button" class="pbx-myPrimaryTag">
287
- <span class="material-symbols-outlined"> edit </span>
288
- <span>Edit text and links</span>
289
- </button>
290
- </div>
291
- <div class="pbx-px-2">
292
- <TextColorEditor></TextColorEditor>
293
- </div>
294
- </template>
295
-
296
- <template
297
- v-if="
298
- getElement &&
299
- getComponent &&
300
- getBasePrimaryImage !== null &&
301
- !pageBuilderService.ElOrFirstChildIsIframe()
302
- "
303
- >
304
- <div class="pbx-px-2 pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-w-max">
305
- <button @click="handleAddImage" type="button" class="pbx-myPrimaryTag">
306
- <span class="material-symbols-outlined"> add_photo_alternate </span>
307
- <span>Update image</span>
308
- </button>
309
- </div>
310
- </template>
311
-
312
- <template
313
- v-if="
314
- getElement &&
315
- getElement.nodeType === 1 &&
316
- !getBasePrimaryImage &&
317
- !pageBuilderService.ElOrFirstChildIsIframe()
318
- "
283
+ <template
284
+ v-if="
285
+ pageBuilderService.isSelectedElementValidText() &&
286
+ !pageBuilderService.ElOrFirstChildIsIframe()
287
+ "
288
+ >
289
+ <div class="pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-w-max">
290
+ <button
291
+ @click="handleModalPreviewTiptap"
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-50 pbx-aspect-square hover:pbx-bg-gray-100 hover:pbx-fill-white pbx-bg-gray-300 focus-visible:pbx-ring-0"
294
+ >
295
+ <span class="material-symbols-outlined"> edit </span>
296
+ </button>
297
+ </div>
298
+ <TextColorEditor></TextColorEditor>
299
+ </template>
300
+
301
+ <template
302
+ v-if="
303
+ getElement &&
304
+ getComponent &&
305
+ getBasePrimaryImage !== null &&
306
+ !pageBuilderService.ElOrFirstChildIsIframe()
307
+ "
308
+ >
309
+ <div class="pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-w-max">
310
+ <button
311
+ @click="handleAddImage"
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-50 pbx-aspect-square hover:pbx-bg-gray-100 hover:pbx-fill-white pbx-bg-gray-300 focus-visible:pbx-ring-0"
314
+ >
315
+ <span class="material-symbols-outlined"> add_photo_alternate </span>
316
+ </button>
317
+ </div>
318
+ </template>
319
+
320
+ <template
321
+ v-if="
322
+ getElement &&
323
+ getElement.nodeType === 1 &&
324
+ !getBasePrimaryImage &&
325
+ !pageBuilderService.ElOrFirstChildIsIframe()
326
+ "
327
+ >
328
+ <BackgroundColorEditor></BackgroundColorEditor>
329
+ </template>
330
+
331
+ <template v-if="getElement">
332
+ <button
333
+ @click="pageBuilderService.deleteElementFromDOM"
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-50 pbx-aspect-square hover:pbx-bg-gray-100 hover:pbx-fill-white pbx-bg-gray-300 focus-visible:pbx-ring-0"
319
336
  >
320
- <div class="pbx-px-2">
321
- <BackgroundColorEditor></BackgroundColorEditor>
322
- </div>
323
- </template>
337
+ <span class="material-symbols-outlined"> delete </span>
338
+ </button>
339
+ </template>
340
+
341
+ <div
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-50 pbx-aspect-square hover:pbx-bg-gray-100 hover:pbx-fill-white pbx-bg-gray-300 focus-visible:pbx-ring-0"
344
+ @click="pageBuilderService.clearHtmlSelection()"
345
+ >
346
+ <span class="material-symbols-outlined"> close </span>
324
347
  </div>
325
348
  </div>
326
349
  </div>
@@ -26,19 +26,22 @@ watch(
26
26
  <template>
27
27
  <Listbox as="div" v-model="textColor">
28
28
  <div class="pbx-relative">
29
- <ListboxButton class="pbx-w-max pbx-flex pbx-items-center pbx-myPrimaryTag">
30
- <div v-if="getTextColor === 'none'" class="pbx-flex pbx-gap-2 pbx-items-center">
31
- <span class="material-symbols-outlined"> format_color_text </span>
32
- <span class="pbx-block pbx-truncate pbx-text-[12.5px]">Text color</span>
33
- </div>
34
- <div v-if="textColor !== 'none'" class="pbx-flex pbx-items-center pbx-gap-2">
35
- <div
36
- class="pbx-aspect-square pbx-w-6 pbx-h-6 pbx-border pbx-border-gray-800 pbx-rounded-sm"
37
- :class="`pbx-bg-${textColor?.replace('pbx-text-', '')}`"
38
- ></div>
39
- <span class="pbx-block pbx-truncate pbx-text-[12.5px]">{{ textColor }}</span>
40
- </div>
41
- </ListboxButton>
29
+ <div class="pbx-flex pbx-gap-2 pbx-items-center">
30
+ <ListboxButton
31
+ 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-50 pbx-aspect-square hover:pbx-bg-gray-100 hover:pbx-fill-white pbx-bg-gray-300 focus-visible:pbx-ring-0"
32
+ >
33
+ <div class="pbx-flex pbx-flex-col">
34
+ <div class="pbx-flex pbx-gap-2 pbx-items-center">
35
+ <span
36
+ class="material-symbols-outlined"
37
+ :class="`pbx-text-${textColor?.replace('pbx-text-', '')}`"
38
+ >
39
+ format_color_text
40
+ </span>
41
+ </div>
42
+ </div>
43
+ </ListboxButton>
44
+ </div>
42
45
 
43
46
  <transition
44
47
  leave-active-class="pbx-transition pbx-ease-in pbx-duration-100"
@@ -91,70 +91,70 @@ const openHTMLSettings = function () {
91
91
 
92
92
  <template>
93
93
  <div>
94
- <div
95
- class="pbx-flex pbx-gap-2 pbx-items-center pbx-myPrimaryParagraph pbx-font-medium pbx-text-xs pbx-py-1 pbx-px-2 pbx-rounded-full lg:pbx-border lg:pbx-border-gray-200 lg:pbx-shadow-sm lg:pbx-mr-10"
96
- >
97
- <!-- User No image Start-->
98
- <div
99
- class="pbx-flex pbx-items-center pbx-myPrimaryTag pbx-py-0"
100
- v-if="
101
- getPageBuilderConfig &&
102
- getPageBuilderConfig.userForPageBuilder &&
103
- getPageBuilderConfig.userForPageBuilder.name &&
104
- (!getPageBuilderConfig.userForPageBuilder.image ||
105
- (typeof getPageBuilderConfig.userForPageBuilder.image === 'string' &&
106
- getPageBuilderConfig.userForPageBuilder.image?.length < 2))
107
- "
108
- >
94
+ <div class="pbx-flex pbx-items-center pbx-justify-center">
95
+ <div class="pbx-mr-2">
96
+ <!-- User No image Start-->
109
97
  <div
110
- class="pbx-text-white pbx-rounded-full pbx-bg-myPrimaryBrandColor pbx-flex pbx-justify-center pbx-items-center pbx-text-xs pbx-h-8 pbx-min-h-8 pbx-max-h-8 pbx-w-8 pbx-min-w-8 pbx-max-w-8 pbx-font-normal"
98
+ class="pbx-flex pbx-items-center pbx-myPrimaryTag pbx-whitespace-nowrappbx-py-0"
99
+ v-if="
100
+ getPageBuilderConfig &&
101
+ getPageBuilderConfig.userForPageBuilder &&
102
+ getPageBuilderConfig.userForPageBuilder.name &&
103
+ (!getPageBuilderConfig.userForPageBuilder.image ||
104
+ (typeof getPageBuilderConfig.userForPageBuilder.image === 'string' &&
105
+ getPageBuilderConfig.userForPageBuilder.image?.length < 2))
106
+ "
111
107
  >
112
- {{
113
- typeof getPageBuilderConfig.userForPageBuilder.name === 'string' &&
114
- getPageBuilderConfig.userForPageBuilder.name[0]
115
- }}
116
- </div>
117
- <div class="pbx-hidden pbx-text-xs pbx-h-8 lg:pbx-flex pbx-items-center pbx-font-normal">
118
- {{ getPageBuilderConfig.userForPageBuilder.name }}
108
+ <div
109
+ class="pbx-text-white pbx-rounded-full pbx-bg-myPrimaryBrandColor pbx-flex pbx-justify-center pbx-items-center pbx-text-xs pbx-h-8 pbx-min-h-8 pbx-max-h-8 pbx-w-8 pbx-min-w-8 pbx-max-w-8 pbx-font-normal"
110
+ >
111
+ {{
112
+ typeof getPageBuilderConfig.userForPageBuilder.name === 'string' &&
113
+ getPageBuilderConfig.userForPageBuilder.name[0]
114
+ }}
115
+ </div>
116
+ <div class="pbx-hidden pbx-text-xs pbx-h-8 lg:pbx-flex pbx-items-center pbx-font-normal">
117
+ {{ getPageBuilderConfig.userForPageBuilder.name }}
118
+ </div>
119
119
  </div>
120
- </div>
121
120
 
122
- <!-- User No image End -->
123
-
124
- <!-- User With image Start-->
125
- <div
126
- class="pbx-flex pbx-items-center lg:pbx-myPrimaryTag pbx-py-0 pbx-gap-4 pbx-w-max"
127
- v-if="
128
- getPageBuilderConfig &&
129
- getPageBuilderConfig.userForPageBuilder &&
130
- getPageBuilderConfig.userForPageBuilder.name &&
131
- getPageBuilderConfig.userForPageBuilder.image &&
132
- typeof getPageBuilderConfig.userForPageBuilder.image === 'string' &&
133
- getPageBuilderConfig.userForPageBuilder.image.length > 2
134
- "
135
- >
121
+ <!-- User No image End -->
122
+
123
+ <!-- User With image Start-->
136
124
  <div
137
- class="pbx-text-white pbx-flex-shrink-0 pbx-h-8 pbx-w-8 pbx-rounded-full pbx-flex pbx-justify-center pbx-items-center pbx-text-xs pbx-rounded-l-full"
125
+ class="pbx-flex pbx-items-center lg:pbx-myPrimaryTag pbx-whitespace-nowrap pbx-py-0 pbx-gap-4 pbx-w-max"
126
+ v-if="
127
+ getPageBuilderConfig &&
128
+ getPageBuilderConfig.userForPageBuilder &&
129
+ getPageBuilderConfig.userForPageBuilder.name &&
130
+ getPageBuilderConfig.userForPageBuilder.image &&
131
+ typeof getPageBuilderConfig.userForPageBuilder.image === 'string' &&
132
+ getPageBuilderConfig.userForPageBuilder.image.length > 2
133
+ "
138
134
  >
139
- <img
140
- alt="avatar"
141
- :src="`${getPageBuilderConfig.userForPageBuilder.image}`"
142
- class="pbx-block pbx-inset-0 pbx-object-top pbx-h-8 pbx-min-h-8 pbx-max-h-8 pbx-w-8 pbx-min-w-8 pbx-max-w-8 pbx-object-cover pbx-rounded-full"
143
- />
144
- </div>
145
- <div class="pbx-hidden pbx-text-xs pbx-h-8 lg:pbx-flex pbx-items-center pbx-font-normal">
146
- {{ getPageBuilderConfig.userForPageBuilder.name }}
135
+ <div
136
+ class="pbx-text-white pbx-flex-shrink-0 pbx-h-8 pbx-w-8 pbx-rounded-full pbx-flex pbx-justify-center pbx-items-center pbx-text-xs pbx-rounded-l-full"
137
+ >
138
+ <img
139
+ alt="avatar"
140
+ :src="`${getPageBuilderConfig.userForPageBuilder.image}`"
141
+ class="pbx-block pbx-inset-0 pbx-object-top pbx-h-8 pbx-min-h-8 pbx-max-h-8 pbx-w-8 pbx-min-w-8 pbx-max-w-8 pbx-object-cover pbx-rounded-full"
142
+ />
143
+ </div>
144
+ <div class="pbx-hidden pbx-text-xs pbx-h-8 lg:pbx-flex pbx-items-center pbx-font-normal">
145
+ {{ getPageBuilderConfig.userForPageBuilder.name }}
146
+ </div>
147
147
  </div>
148
148
  </div>
149
149
 
150
150
  <!-- User With image End -->
151
151
 
152
- <div>
152
+ <div class="pbx-hidden lg:pbx-block">
153
153
  <!-- Component Start -->
154
154
  <div class="pbx-relative pbx-group">
155
155
  <button
156
156
  type="button"
157
- class="pbx-cursor-pointer lg:pbx-flex pbx-myPrimaryTag pbx-font-normal pbx-w-max pbx-text-xs"
157
+ class="pbx-cursor-pointer lg:pbx-flex pbx-myPrimaryTag pbx-whitespace-nowrap pbx-font-normal pbx-w-max pbx-text-xs"
158
158
  >
159
159
  <span> Options </span>
160
160
  </button>
@@ -169,7 +169,7 @@ const openHTMLSettings = function () {
169
169
  openMainSettings()
170
170
  }
171
171
  "
172
- class="pbx-cursor-pointer lg:pbx-flex pbx-myPrimaryTag pbx-font-normal pbx-w-max pbx-border-none pbx-m-0"
172
+ class="pbx-cursor-pointer lg:pbx-flex pbx-myPrimaryTag pbx-whitespace-nowrappbx-font-normal pbx-w-max pbx-border-none pbx-m-0"
173
173
  type="button"
174
174
  >
175
175
  Config Overview
@@ -179,7 +179,7 @@ const openHTMLSettings = function () {
179
179
  <!-- HTML Settings Start -->
180
180
  <button
181
181
  @click="openHTMLSettings"
182
- class="pbx-cursor-pointer lg:pbx-flex pbx-myPrimaryTag pbx-font-normal pbx-w-max pbx-border-none pbx-m-0"
182
+ class="pbx-cursor-pointer lg:pbx-flex pbx-myPrimaryTag pbx-whitespace-nowrap pbx-font-normal pbx-w-max pbx-border-none pbx-m-0"
183
183
  type="button"
184
184
  >
185
185
  HTML Overview
@@ -189,7 +189,7 @@ const openHTMLSettings = function () {
189
189
  <!-- Delete Layout Start -->
190
190
  <button
191
191
  @click="deleteAllComponentsFromDOM"
192
- class="pbx-cursor-pointer lg:pbx-flex pbx-myPrimaryTag pbx-font-normal pbx-w-max pbx-border-none pbx-m-0 pbx-bg-myPrimaryErrorColor pbx-text-white"
192
+ class="pbx-cursor-pointer lg:pbx-flex pbx-myPrimaryTag pbx-whitespace-nowrap pbx-font-normal pbx-w-max pbx-border-none pbx-m-0 pbx-bg-myPrimaryErrorColor pbx-text-white"
193
193
  type="button"
194
194
  >
195
195
  Delete Layout