@myissue/vue-website-page-builder 3.0.29 → 3.0.31
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/dist/vue-website-page-builder.js +20905 -20846
- package/dist/vue-website-page-builder.umd.cjs +49 -49
- package/package.json +1 -1
- package/src/Components/MediaLibrary/SidebarUnsplash.vue +3 -3
- package/src/Components/MediaLibrary/Unsplash.vue +2 -3
- package/src/Components/Modals/MediaLibraryModal.vue +1 -1
- package/src/Components/Modals/PageBuilderPreviewModal.vue +27 -9
- package/src/Components/PageBuilder/DropdownsPlusToggles/OptionsDropdown.vue +3 -5
- package/src/Components/PageBuilder/EditorMenu/Editables/BackgroundColorEditor.vue +1 -2
- package/src/Components/PageBuilder/EditorMenu/Editables/BorderRadius.vue +1 -2
- package/src/Components/PageBuilder/EditorMenu/Editables/Borders.vue +1 -2
- package/src/Components/PageBuilder/EditorMenu/Editables/ClassEditor.vue +1 -2
- package/src/Components/PageBuilder/EditorMenu/Editables/ComponentTopMenu.vue +1 -2
- package/src/Components/PageBuilder/EditorMenu/Editables/DeleteElement.vue +1 -2
- package/src/Components/PageBuilder/EditorMenu/Editables/EditGetElement.vue +1 -2
- package/src/Components/PageBuilder/EditorMenu/Editables/ElementEditor.vue +1 -2
- package/src/Components/PageBuilder/EditorMenu/Editables/ImageEditor.vue +1 -2
- package/src/Components/PageBuilder/EditorMenu/Editables/LinkEditor.vue +1 -2
- package/src/Components/PageBuilder/EditorMenu/Editables/ManageBackgroundOpacity.vue +1 -2
- package/src/Components/PageBuilder/EditorMenu/Editables/ManageOpacity.vue +1 -2
- package/src/Components/PageBuilder/EditorMenu/Editables/PaddingPlusMargin.vue +1 -2
- package/src/Components/PageBuilder/EditorMenu/Editables/TextColorEditor.vue +1 -2
- package/src/Components/PageBuilder/EditorMenu/Editables/Typography.vue +1 -2
- package/src/Components/PageBuilder/NoneCustomMediaLibraryComponent.vue +1 -3
- package/src/Components/PageBuilder/NoneCustomSearchComponent.vue +3 -4
- package/src/Components/TipTap/TipTap.vue +1 -2
- package/src/Components/TipTap/TipTapInput.vue +1 -2
- package/src/PageBuilder/PageBuilder.vue +5 -11
- package/src/composables/PageBuilderClass.ts +8 -12
- package/src/index.ts +1 -3
- package/src/stores/page-builder-state.ts +159 -0
- package/src/types/index.ts +4 -7
- package/src/stores/media-library.ts +0 -30
- package/src/stores/unsplash.ts +0 -107
- package/src/stores/user.ts +0 -32
|
@@ -6,9 +6,29 @@ import type {
|
|
|
6
6
|
FetchedComponentsResponse,
|
|
7
7
|
SetPushComponentsPayload,
|
|
8
8
|
LoadComponentsData,
|
|
9
|
+
ImageObject,
|
|
10
|
+
UserSettings,
|
|
11
|
+
User,
|
|
9
12
|
} from '@/types'
|
|
10
13
|
|
|
14
|
+
// Media Library interfaces
|
|
15
|
+
interface UnsplashImagesData {
|
|
16
|
+
fetchedMedia: unknown
|
|
17
|
+
isError: boolean | null
|
|
18
|
+
error: unknown
|
|
19
|
+
errors: unknown
|
|
20
|
+
isLoading: boolean | null
|
|
21
|
+
isSuccess: boolean | null
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface LoadUnsplashImagesPayload {
|
|
25
|
+
orientation?: string
|
|
26
|
+
currentPage: number
|
|
27
|
+
searchTerm?: string
|
|
28
|
+
}
|
|
29
|
+
|
|
11
30
|
interface PageBuilderState {
|
|
31
|
+
// Core Page Builder State
|
|
12
32
|
pageBuilderLogo: string | null
|
|
13
33
|
componentArrayAddMethod: string | null
|
|
14
34
|
localStorageItemName: string | null
|
|
@@ -56,6 +76,21 @@ interface PageBuilderState {
|
|
|
56
76
|
fetchedComponents: FetchedComponentsResponse | null
|
|
57
77
|
currentResourceData: { title: string; id: number } | null
|
|
58
78
|
updateOrCreate: string
|
|
79
|
+
|
|
80
|
+
// Media Library State
|
|
81
|
+
currentImage: ImageObject
|
|
82
|
+
currentPreviewImage: string | null
|
|
83
|
+
|
|
84
|
+
// User State
|
|
85
|
+
isLoading: boolean
|
|
86
|
+
userSettings: UserSettings | null
|
|
87
|
+
currentUser: User | null
|
|
88
|
+
|
|
89
|
+
// Unsplash State
|
|
90
|
+
unsplashImages: UnsplashImagesData | null
|
|
91
|
+
searchTerm: string
|
|
92
|
+
currentPageNumber: number
|
|
93
|
+
orientationValue: string | null
|
|
59
94
|
}
|
|
60
95
|
|
|
61
96
|
// get components
|
|
@@ -67,8 +102,20 @@ const {
|
|
|
67
102
|
error,
|
|
68
103
|
} = vueFetch()
|
|
69
104
|
|
|
105
|
+
// get unsplash images
|
|
106
|
+
const {
|
|
107
|
+
handleData: handleGetImages,
|
|
108
|
+
fetchedData: fetchedMedia,
|
|
109
|
+
isError: isErrorImages,
|
|
110
|
+
error: errorImages,
|
|
111
|
+
errors: errorsImages,
|
|
112
|
+
isLoading: isLoadingImages,
|
|
113
|
+
isSuccess: isSuccessImages,
|
|
114
|
+
} = vueFetch()
|
|
115
|
+
|
|
70
116
|
export const usePageBuilderStateStore = defineStore('pageBuilderState', {
|
|
71
117
|
state: (): PageBuilderState => ({
|
|
118
|
+
// Core Page Builder State
|
|
72
119
|
pageBuilderLogo: null,
|
|
73
120
|
componentArrayAddMethod: null,
|
|
74
121
|
localStorageItemName: null,
|
|
@@ -116,8 +163,24 @@ export const usePageBuilderStateStore = defineStore('pageBuilderState', {
|
|
|
116
163
|
fetchedComponents: null,
|
|
117
164
|
currentResourceData: null,
|
|
118
165
|
updateOrCreate: '',
|
|
166
|
+
|
|
167
|
+
// Media Library State
|
|
168
|
+
currentImage: { src: '' },
|
|
169
|
+
currentPreviewImage: null,
|
|
170
|
+
|
|
171
|
+
// User State
|
|
172
|
+
isLoading: false,
|
|
173
|
+
userSettings: null,
|
|
174
|
+
currentUser: null,
|
|
175
|
+
|
|
176
|
+
// Unsplash State
|
|
177
|
+
unsplashImages: null,
|
|
178
|
+
searchTerm: '',
|
|
179
|
+
currentPageNumber: 1,
|
|
180
|
+
orientationValue: null,
|
|
119
181
|
}),
|
|
120
182
|
getters: {
|
|
183
|
+
// Core Page Builder Getters
|
|
121
184
|
getPageBuilderLogo(state: PageBuilderState): string | null {
|
|
122
185
|
return state.pageBuilderLogo
|
|
123
186
|
},
|
|
@@ -272,8 +335,30 @@ export const usePageBuilderStateStore = defineStore('pageBuilderState', {
|
|
|
272
335
|
getUpdateOrCreate(state: PageBuilderState): string {
|
|
273
336
|
return state.updateOrCreate
|
|
274
337
|
},
|
|
338
|
+
|
|
339
|
+
// Media Library Getters
|
|
340
|
+
getCurrentImage(state: PageBuilderState): ImageObject {
|
|
341
|
+
return state.currentImage
|
|
342
|
+
},
|
|
343
|
+
getCurrentPreviewImage(state: PageBuilderState): string | null {
|
|
344
|
+
return state.currentPreviewImage
|
|
345
|
+
},
|
|
346
|
+
|
|
347
|
+
// User Getters
|
|
348
|
+
getIsLoading: (state: PageBuilderState): boolean => state.isLoading,
|
|
349
|
+
getUserSettings: (state: PageBuilderState): UserSettings | null => state.userSettings,
|
|
350
|
+
getCurrentUser: (state: PageBuilderState): User | null => state.currentUser,
|
|
351
|
+
|
|
352
|
+
// Unsplash Getters
|
|
353
|
+
getUnsplashImages: (state: PageBuilderState): UnsplashImagesData | null => {
|
|
354
|
+
return state.unsplashImages
|
|
355
|
+
},
|
|
356
|
+
getSearchTerm: (state: PageBuilderState): string => state.searchTerm,
|
|
357
|
+
getCurrentPageNumber: (state: PageBuilderState): number => state.currentPageNumber,
|
|
358
|
+
getOrientationValue: (state: PageBuilderState): string | null => state.orientationValue,
|
|
275
359
|
},
|
|
276
360
|
actions: {
|
|
361
|
+
// Core Page Builder Actions
|
|
277
362
|
setPageBuilderLogo(payload: string | null): void {
|
|
278
363
|
this.pageBuilderLogo = payload
|
|
279
364
|
},
|
|
@@ -473,5 +558,79 @@ export const usePageBuilderStateStore = defineStore('pageBuilderState', {
|
|
|
473
558
|
setUpdateOrCreate(payload: string): void {
|
|
474
559
|
this.updateOrCreate = payload
|
|
475
560
|
},
|
|
561
|
+
|
|
562
|
+
// Media Library Actions
|
|
563
|
+
setCurrentImage(payload: ImageObject): void {
|
|
564
|
+
this.currentImage = payload
|
|
565
|
+
},
|
|
566
|
+
setCurrentPreviewImage(payload: string | null): void {
|
|
567
|
+
this.currentPreviewImage = payload
|
|
568
|
+
},
|
|
569
|
+
|
|
570
|
+
// User Actions
|
|
571
|
+
setIsLoading(payload: boolean): void {
|
|
572
|
+
this.isLoading = payload
|
|
573
|
+
},
|
|
574
|
+
setUserSettings(payload: UserSettings | null): void {
|
|
575
|
+
this.userSettings = payload
|
|
576
|
+
},
|
|
577
|
+
setCurrentUser(payload: User | null): void {
|
|
578
|
+
this.currentUser = payload
|
|
579
|
+
},
|
|
580
|
+
|
|
581
|
+
// Unsplash Actions
|
|
582
|
+
setUnsplashImages(payload: UnsplashImagesData | null): void {
|
|
583
|
+
this.unsplashImages = payload
|
|
584
|
+
},
|
|
585
|
+
setSearchTerm(payload: string): void {
|
|
586
|
+
this.searchTerm = payload
|
|
587
|
+
},
|
|
588
|
+
setCurrentPageNumber(payload: number): void {
|
|
589
|
+
this.currentPageNumber = payload
|
|
590
|
+
},
|
|
591
|
+
setOrientationValue(payload: string | null): void {
|
|
592
|
+
this.orientationValue = payload
|
|
593
|
+
},
|
|
594
|
+
|
|
595
|
+
// Load Unsplash images
|
|
596
|
+
async setLoadUnsplashImages(payload: LoadUnsplashImagesPayload): Promise<void> {
|
|
597
|
+
this.setUnsplashImages({
|
|
598
|
+
fetchedMedia: null,
|
|
599
|
+
isError: null,
|
|
600
|
+
error: null,
|
|
601
|
+
errors: null,
|
|
602
|
+
isLoading: true,
|
|
603
|
+
isSuccess: null,
|
|
604
|
+
})
|
|
605
|
+
|
|
606
|
+
const orientationType = payload.orientation ? `&orientation=${payload.orientation}` : ''
|
|
607
|
+
|
|
608
|
+
const unsplashKey = import.meta.env.VITE_UNSPLASH_KEY as string
|
|
609
|
+
|
|
610
|
+
try {
|
|
611
|
+
await handleGetImages(
|
|
612
|
+
`https://api.unsplash.com/search/photos?page=${payload.currentPage}&per_page=24&query=${payload.searchTerm || 'a'}${orientationType}`,
|
|
613
|
+
{
|
|
614
|
+
headers: {
|
|
615
|
+
'Accept-Version': 'v1',
|
|
616
|
+
Authorization: unsplashKey,
|
|
617
|
+
},
|
|
618
|
+
},
|
|
619
|
+
{ additionalCallTime: 500 },
|
|
620
|
+
)
|
|
621
|
+
} catch (err) {
|
|
622
|
+
console.log(`Error: ${err}`)
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
// Update state directly instead of committing mutations
|
|
626
|
+
this.setUnsplashImages({
|
|
627
|
+
fetchedMedia: fetchedMedia.value,
|
|
628
|
+
isError: isErrorImages.value,
|
|
629
|
+
error: errorImages.value,
|
|
630
|
+
errors: errorsImages.value,
|
|
631
|
+
isLoading: isLoadingImages.value,
|
|
632
|
+
isSuccess: isSuccessImages.value,
|
|
633
|
+
})
|
|
634
|
+
},
|
|
476
635
|
},
|
|
477
636
|
})
|
package/src/types/index.ts
CHANGED
|
@@ -77,14 +77,11 @@ export interface PageBuilderStateStore {
|
|
|
77
77
|
setTextColor: (color: string) => void
|
|
78
78
|
setBackgroundOpacity: (opacity: string) => void
|
|
79
79
|
setOpacity: (opacity: string) => void
|
|
80
|
-
[key: string]: unknown
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export interface MediaLibraryStore {
|
|
84
80
|
getCurrentImage: ImageObject | null
|
|
85
81
|
setCurrentImage: (image: ImageObject) => void
|
|
86
82
|
getCurrentPreviewImage: string | null
|
|
87
83
|
setCurrentPreviewImage: (url: string | null) => void
|
|
84
|
+
[key: string]: unknown
|
|
88
85
|
}
|
|
89
86
|
|
|
90
87
|
// User interfaces
|
|
@@ -99,10 +96,10 @@ export interface PageBuilderUser {
|
|
|
99
96
|
|
|
100
97
|
// User settings interface
|
|
101
98
|
export interface UserSettings {
|
|
102
|
-
theme
|
|
103
|
-
language
|
|
99
|
+
theme: 'light' | 'dark' | 'auto'
|
|
100
|
+
language: string
|
|
104
101
|
notifications?: boolean
|
|
105
|
-
autoSave
|
|
102
|
+
autoSave: boolean
|
|
106
103
|
[key: string]: unknown
|
|
107
104
|
}
|
|
108
105
|
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { defineStore } from 'pinia'
|
|
2
|
-
import type { ImageObject } from '@/types'
|
|
3
|
-
|
|
4
|
-
interface MediaLibraryState {
|
|
5
|
-
currentImage: ImageObject
|
|
6
|
-
currentPreviewImage: string | null
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const useMediaLibraryStore = defineStore('mediaLibrary', {
|
|
10
|
-
state: (): MediaLibraryState => ({
|
|
11
|
-
currentImage: {},
|
|
12
|
-
currentPreviewImage: null,
|
|
13
|
-
}),
|
|
14
|
-
getters: {
|
|
15
|
-
getCurrentImage(state: MediaLibraryState): ImageObject {
|
|
16
|
-
return state.currentImage
|
|
17
|
-
},
|
|
18
|
-
getCurrentPreviewImage(state: MediaLibraryState): string | null {
|
|
19
|
-
return state.currentPreviewImage
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
actions: {
|
|
23
|
-
setCurrentImage(payload: ImageObject): void {
|
|
24
|
-
this.currentImage = payload
|
|
25
|
-
},
|
|
26
|
-
setCurrentPreviewImage(payload: string | null): void {
|
|
27
|
-
this.currentPreviewImage = payload
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
})
|
package/src/stores/unsplash.ts
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { defineStore } from 'pinia'
|
|
2
|
-
import { vueFetch } from '@/composables/vueFetch.ts'
|
|
3
|
-
|
|
4
|
-
interface UnsplashState {
|
|
5
|
-
unsplashImages: UnsplashImagesData | null
|
|
6
|
-
searchTerm: string
|
|
7
|
-
currentPageNumber: number
|
|
8
|
-
orientationValue: string | null
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
interface UnsplashImagesData {
|
|
12
|
-
fetchedMedia: unknown
|
|
13
|
-
isError: boolean | null
|
|
14
|
-
error: unknown
|
|
15
|
-
errors: unknown
|
|
16
|
-
isLoading: boolean | null
|
|
17
|
-
isSuccess: boolean | null
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
interface LoadUnsplashImagesPayload {
|
|
21
|
-
orientation?: string
|
|
22
|
-
currentPage: number
|
|
23
|
-
searchTerm?: string
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// get images
|
|
27
|
-
const {
|
|
28
|
-
handleData: handleGetImages,
|
|
29
|
-
fetchedData: fetchedMedia,
|
|
30
|
-
isError: isErrorImages,
|
|
31
|
-
error: errorImages,
|
|
32
|
-
errors: errorsImages,
|
|
33
|
-
isLoading: isLoadingImages,
|
|
34
|
-
isSuccess: isSuccessImages,
|
|
35
|
-
} = vueFetch()
|
|
36
|
-
|
|
37
|
-
export const useUnsplashStore = defineStore('unsplash', {
|
|
38
|
-
state: (): UnsplashState => ({
|
|
39
|
-
unsplashImages: null,
|
|
40
|
-
searchTerm: '',
|
|
41
|
-
currentPageNumber: 1,
|
|
42
|
-
orientationValue: null,
|
|
43
|
-
}),
|
|
44
|
-
getters: {
|
|
45
|
-
getUnsplashImages: (state: UnsplashState): UnsplashImagesData | null => {
|
|
46
|
-
return state.unsplashImages
|
|
47
|
-
},
|
|
48
|
-
getSearchTerm: (state: UnsplashState): string => state.searchTerm,
|
|
49
|
-
getCurrentPageNumber: (state: UnsplashState): number => state.currentPageNumber,
|
|
50
|
-
getOrientationValue: (state: UnsplashState): string | null => state.orientationValue,
|
|
51
|
-
},
|
|
52
|
-
actions: {
|
|
53
|
-
setUnsplashImages(payload: UnsplashImagesData | null): void {
|
|
54
|
-
this.unsplashImages = payload
|
|
55
|
-
},
|
|
56
|
-
setSearchTerm(payload: string): void {
|
|
57
|
-
this.searchTerm = payload
|
|
58
|
-
},
|
|
59
|
-
setCurrentPageNumber(payload: number): void {
|
|
60
|
-
this.currentPageNumber = payload
|
|
61
|
-
},
|
|
62
|
-
setOrientationValue(payload: string | null): void {
|
|
63
|
-
this.orientationValue = payload
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
// Load Unsplash images
|
|
67
|
-
async setLoadUnsplashImages(payload: LoadUnsplashImagesPayload): Promise<void> {
|
|
68
|
-
this.setUnsplashImages({
|
|
69
|
-
fetchedMedia: null,
|
|
70
|
-
isError: null,
|
|
71
|
-
error: null,
|
|
72
|
-
errors: null,
|
|
73
|
-
isLoading: true,
|
|
74
|
-
isSuccess: null,
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
const orientationType = payload.orientation ? `&orientation=${payload.orientation}` : ''
|
|
78
|
-
|
|
79
|
-
const unsplashKey = import.meta.env.VITE_UNSPLASH_KEY as string
|
|
80
|
-
|
|
81
|
-
try {
|
|
82
|
-
await handleGetImages(
|
|
83
|
-
`https://api.unsplash.com/search/photos?page=${payload.currentPage}&per_page=24&query=${payload.searchTerm || 'a'}${orientationType}`,
|
|
84
|
-
{
|
|
85
|
-
headers: {
|
|
86
|
-
'Accept-Version': 'v1',
|
|
87
|
-
Authorization: unsplashKey,
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
{ additionalCallTime: 500 },
|
|
91
|
-
)
|
|
92
|
-
} catch (err) {
|
|
93
|
-
console.log(`Error: ${err}`)
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// Update state directly instead of committing mutations
|
|
97
|
-
this.setUnsplashImages({
|
|
98
|
-
fetchedMedia: fetchedMedia.value,
|
|
99
|
-
isError: isErrorImages.value,
|
|
100
|
-
error: errorImages.value,
|
|
101
|
-
errors: errorsImages.value,
|
|
102
|
-
isLoading: isLoadingImages.value,
|
|
103
|
-
isSuccess: isSuccessImages.value,
|
|
104
|
-
})
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
})
|
package/src/stores/user.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { defineStore } from 'pinia'
|
|
2
|
-
import type { UserSettings, User } from '@/types'
|
|
3
|
-
|
|
4
|
-
interface UserState {
|
|
5
|
-
isLoading: boolean
|
|
6
|
-
userSettings: UserSettings | null
|
|
7
|
-
currentUser: User | null
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const useUserStore = defineStore('user', {
|
|
11
|
-
state: (): UserState => ({
|
|
12
|
-
isLoading: false,
|
|
13
|
-
userSettings: null,
|
|
14
|
-
currentUser: null,
|
|
15
|
-
}),
|
|
16
|
-
getters: {
|
|
17
|
-
getIsLoading: (state: UserState): boolean => state.isLoading,
|
|
18
|
-
getUserSettings: (state: UserState): UserSettings | null => state.userSettings,
|
|
19
|
-
getCurrentUser: (state: UserState): User | null => state.currentUser,
|
|
20
|
-
},
|
|
21
|
-
actions: {
|
|
22
|
-
setIsLoading(payload: boolean): void {
|
|
23
|
-
this.isLoading = payload
|
|
24
|
-
},
|
|
25
|
-
setUserSettings(payload: UserSettings | null): void {
|
|
26
|
-
this.userSettings = payload
|
|
27
|
-
},
|
|
28
|
-
setCurrentUser(payload: User | null): void {
|
|
29
|
-
this.currentUser = payload
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
})
|