@myissue/vue-website-page-builder 3.3.90 → 3.3.91
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 +5 -5
- package/dist/style.css +1 -1
- package/dist/vue-website-page-builder.js +929 -605
- package/dist/vue-website-page-builder.umd.cjs +23 -23
- package/package.json +1 -1
- package/src/Components/TipTap/TipTap.vue +1 -1
- package/src/PageBuilder/PageBuilder.vue +7 -14
- package/src/composables/builderInstance.ts +30 -5
- package/src/services/PageBuilderService.ts +397 -74
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@ const pageBuilderService = getPageBuilder()
|
|
|
12
12
|
<div class="pbx-flex pbx-flex-col pbx-border-solid pbx-border pbx-border-gray-400">
|
|
13
13
|
<div
|
|
14
14
|
@click="pageBuilderService.toggleTipTapModal(true)"
|
|
15
|
-
class="pbx-flex pbx-flex-row pbx-justify-between pbx-items-center pbx-pl-3 pbx-pr-3 pbx-py-5 pbx-cursor-pointer pbx-duration-200 hover:pbx-bg-myPrimaryLightGrayColor"
|
|
15
|
+
class="pbx-flex pbx-flex-row pbx-justify-between pbx-items-center pbx-pl-3 pbx-pr-3 pbx-py-5 pbx-cursor-pointer pbx-duration-200 hover:pbx-bg-myPrimaryLightGrayColor pbx-bg-white"
|
|
16
16
|
>
|
|
17
17
|
<p class="pbx-myPrimaryParagraph pbx-font-medium pbx-my-0 pbx-py-0">
|
|
18
18
|
{{ translate('Text') }}
|
|
@@ -514,7 +514,7 @@ onMounted(async () => {
|
|
|
514
514
|
|
|
515
515
|
<div
|
|
516
516
|
id="pagebuilder-navbar"
|
|
517
|
-
class="lg:pbx-min-w-full lg:pbx-max-w-full lg:pbx-w-full pbx-min-w-[
|
|
517
|
+
class="lg:pbx-min-w-full lg:pbx-max-w-full lg:pbx-w-full pbx-min-w-[64rem] pbx-max-w-[64rem] pbx-w-[64rem] pbx-flex-1 pbx-bg-myPrimaryLightGrayColor pbx-flex pbx-items-center pbx-justify-between pbx-border-0 pbx-border-solid pbx-border-b pbx-border-gray-200 pbx-mb-2 pbx-font-sans pbx-min-h-20"
|
|
518
518
|
>
|
|
519
519
|
<template
|
|
520
520
|
v-if="
|
|
@@ -530,7 +530,7 @@ onMounted(async () => {
|
|
|
530
530
|
await pageBuilderService.clearHtmlSelection()
|
|
531
531
|
}
|
|
532
532
|
"
|
|
533
|
-
class="pbx-flex pbx-justify-start pbx-py-2"
|
|
533
|
+
class="pbx-flex pbx-justify-start pbx-py-2 lg:pbx-ml-4 pbx-ml-2"
|
|
534
534
|
>
|
|
535
535
|
<img class="pbx-h-6" :src="getPageBuilderConfig.pageBuilderLogo.src" alt="Logo" />
|
|
536
536
|
</div>
|
|
@@ -742,15 +742,6 @@ onMounted(async () => {
|
|
|
742
742
|
</button>
|
|
743
743
|
</div>
|
|
744
744
|
</template>
|
|
745
|
-
<template
|
|
746
|
-
v-if="
|
|
747
|
-
getPageBuilderConfig &&
|
|
748
|
-
getPageBuilderConfig.userSettings &&
|
|
749
|
-
getPageBuilderConfig.userSettings.language
|
|
750
|
-
"
|
|
751
|
-
>
|
|
752
|
-
</template>
|
|
753
|
-
|
|
754
745
|
<!-- Publish buttons end -->
|
|
755
746
|
|
|
756
747
|
<template
|
|
@@ -768,7 +759,9 @@ onMounted(async () => {
|
|
|
768
759
|
getPageBuilderConfig.userSettings.language
|
|
769
760
|
"
|
|
770
761
|
>
|
|
771
|
-
<div
|
|
762
|
+
<div
|
|
763
|
+
class="pbx-flex-1 pbx-flex pbx-justify-end pbx-items-center pbx-ml-2 lg:pbx-mr-4 pbx-mr-2"
|
|
764
|
+
>
|
|
772
765
|
<select
|
|
773
766
|
id="pbx-lang"
|
|
774
767
|
class="pbx-myPrimarySelect pbx-min-w-20 pbx-max-w-2pbx-min-w-20 pbx-w-max"
|
|
@@ -831,7 +824,7 @@ onMounted(async () => {
|
|
|
831
824
|
<!-- Page Builder Main Start -->
|
|
832
825
|
<div
|
|
833
826
|
id="pagebuilder-main"
|
|
834
|
-
class="lg:pbx-min-w-full lg:pbx-max-w-full lg:pbx-w-full pbx-min-w-[
|
|
827
|
+
class="lg:pbx-min-w-full lg:pbx-max-w-full lg:pbx-w-full pbx-min-w-[64rem] pbx-max-w-[64rem] pbx-w-[64rem] pbx-flex-1 pbx-relative pbx-h-full pbx-flex pbx-pb-2 pbx-gap-2"
|
|
835
828
|
>
|
|
836
829
|
<!-- Left Menu Start -->
|
|
837
830
|
<div
|
|
@@ -959,7 +952,7 @@ onMounted(async () => {
|
|
|
959
952
|
<!-- Footer Start -->
|
|
960
953
|
<div
|
|
961
954
|
id="pagebuilder-footer"
|
|
962
|
-
class="lg:pbx-min-w-full lg:pbx-max-w-full lg:pbx-w-full pbx-min-w-[
|
|
955
|
+
class="lg:pbx-min-w-full lg:pbx-max-w-full lg:pbx-w-full pbx-min-w-[64rem] pbx-max-w-[64rem] pbx-w-[64rem] pbx-flex-1 pbx-flex pbx-items-center pbx-justify-center pbx-border-0 pbx-border-t pbx-border-t-gray-200 pbx-border-solid pbx-bg-myPrimaryLightGrayColor pbx-py-4"
|
|
963
956
|
>
|
|
964
957
|
<div
|
|
965
958
|
@click="
|
|
@@ -1,17 +1,42 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @file This file manages the singleton instance of the PageBuilderService.
|
|
3
|
+
* This pattern ensures that there is only one instance of the service throughout the application,
|
|
4
|
+
* providing a single source of truth for the page builder's state and logic.
|
|
5
|
+
* @author Qais Wardag
|
|
6
|
+
*/
|
|
7
|
+
|
|
2
8
|
import { PageBuilderService } from '../services/PageBuilderService'
|
|
3
9
|
|
|
4
|
-
|
|
10
|
+
/**
|
|
11
|
+
* The singleton instance of the PageBuilderService.
|
|
12
|
+
* It is initialized to null and will be set by the `setBuilderInstance` function.
|
|
13
|
+
* @type {PageBuilderService | null}
|
|
14
|
+
*/
|
|
5
15
|
let instance: PageBuilderService | null = null
|
|
6
16
|
|
|
7
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Sets the singleton instance of the PageBuilderService.
|
|
19
|
+
* This function is called by the Vue plugin to initialize the service.
|
|
20
|
+
* It ensures that the instance is only set once.
|
|
21
|
+
*
|
|
22
|
+
* @param {PageBuilderService} newInstance - The new instance of the PageBuilderService to set.
|
|
23
|
+
* @returns {void}
|
|
24
|
+
*/
|
|
8
25
|
export function setBuilderInstance(newInstance: PageBuilderService): void {
|
|
9
26
|
if (!instance) {
|
|
10
27
|
instance = newInstance
|
|
11
28
|
}
|
|
12
29
|
}
|
|
13
30
|
|
|
14
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Retrieves the singleton instance of the PageBuilderService.
|
|
33
|
+
* This function is used throughout the application to access the service.
|
|
34
|
+
* It throws an error if the service has not been initialized, ensuring that
|
|
35
|
+
* the plugin has been correctly installed.
|
|
36
|
+
*
|
|
37
|
+
* @throws {Error} If the PageBuilderService has not been initialized.
|
|
38
|
+
* @returns {PageBuilderService} The singleton instance of the PageBuilderService.
|
|
39
|
+
*/
|
|
15
40
|
export function getPageBuilder(): PageBuilderService {
|
|
16
41
|
if (!instance) {
|
|
17
42
|
throw new Error(
|
|
@@ -19,4 +44,4 @@ export function getPageBuilder(): PageBuilderService {
|
|
|
19
44
|
)
|
|
20
45
|
}
|
|
21
46
|
return instance
|
|
22
|
-
}
|
|
47
|
+
}
|