@myissue/vue-website-page-builder 3.2.90 → 3.2.92
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 +122 -84
- package/dist/vue-website-page-builder.css +1 -1
- package/dist/vue-website-page-builder.js +5191 -5273
- package/dist/vue-website-page-builder.umd.cjs +52 -52
- package/package.json +1 -1
- package/src/Components/Loaders/GlobalLoader.vue +11 -0
- package/src/Components/Modals/DynamicModalBuilder.vue +41 -245
- package/src/Components/Modals/ModalBuilder.vue +29 -4
- package/src/Components/PageBuilder/DefaultComponents/DefaultBuilderComponents.vue +3 -8
- package/src/Components/PageBuilder/EditorMenu/Editables/BackgroundColorEditor.vue +5 -4
- package/src/Components/PageBuilder/EditorMenu/Editables/BorderRadius.vue +12 -13
- package/src/Components/PageBuilder/EditorMenu/Editables/Borders.vue +8 -8
- package/src/Components/PageBuilder/EditorMenu/Editables/ClassEditor.vue +7 -6
- package/src/Components/PageBuilder/EditorMenu/Editables/ComponentTopMenu.vue +6 -10
- package/src/Components/PageBuilder/EditorMenu/Editables/DeleteElement.vue +4 -4
- package/src/Components/PageBuilder/EditorMenu/Editables/EditGetElement.vue +10 -11
- package/src/Components/PageBuilder/EditorMenu/Editables/ElementEditor.vue +4 -5
- package/src/Components/PageBuilder/EditorMenu/Editables/ImageEditor.vue +0 -9
- package/src/Components/PageBuilder/EditorMenu/Editables/LinkEditor.vue +5 -5
- package/src/Components/PageBuilder/EditorMenu/Editables/ManageBackgroundOpacity.vue +4 -4
- package/src/Components/PageBuilder/EditorMenu/Editables/ManageOpacity.vue +4 -4
- package/src/Components/PageBuilder/EditorMenu/Editables/Margin.vue +8 -8
- package/src/Components/PageBuilder/EditorMenu/Editables/Padding.vue +8 -8
- package/src/Components/PageBuilder/EditorMenu/Editables/TextColorEditor.vue +4 -4
- package/src/Components/PageBuilder/EditorMenu/Editables/Typography.vue +16 -16
- package/src/Components/PageBuilder/EditorMenu/RightSidebarEditor.vue +3 -7
- package/src/Components/PageBuilder/Settings/PageBuilderSettings.vue +55 -58
- package/src/Components/PageBuilder/ToolbarOption/ToolbarOption.vue +33 -40
- package/src/Components/TipTap/TipTap.vue +4 -9
- package/src/Components/TipTap/TipTapInput.vue +8 -8
- package/src/DemoComponents/DemoUnsplash.vue +4 -5
- package/src/DemoComponents/HomeSection.vue +9 -30
- package/src/DemoComponents/html.json +4 -4
- package/src/PageBuilder/PageBuilder.vue +194 -96
- package/src/composables/{PageBuilderClass.ts → PageBuilderService.ts} +258 -97
- package/src/composables/builderInstance.ts +25 -0
- package/src/css/app.css +15 -0
- package/src/css/dev-global.css +7 -0
- package/src/index.ts +4 -2
- package/src/main.ts +3 -0
- package/src/stores/page-builder-state.ts +32 -2
- package/src/types/index.ts +99 -9
- package/src/helpers/passedPageBuilderConfig.ts +0 -71
|
@@ -60,7 +60,12 @@ interface PageBuilderState {
|
|
|
60
60
|
currentPreviewImage: string | null
|
|
61
61
|
|
|
62
62
|
// User State
|
|
63
|
+
builderStarted: boolean
|
|
64
|
+
isLoadingGlobal: boolean
|
|
63
65
|
isSaving: boolean
|
|
66
|
+
hasLocalDraftForUpdate: boolean
|
|
67
|
+
isResumeEditing: boolean
|
|
68
|
+
isRestoring: boolean
|
|
64
69
|
}
|
|
65
70
|
|
|
66
71
|
export const usePageBuilderStateStore = defineStore('pageBuilderState', {
|
|
@@ -116,7 +121,12 @@ export const usePageBuilderStateStore = defineStore('pageBuilderState', {
|
|
|
116
121
|
currentPreviewImage: null,
|
|
117
122
|
|
|
118
123
|
// User State
|
|
124
|
+
builderStarted: false,
|
|
125
|
+
isLoadingGlobal: false,
|
|
119
126
|
isSaving: false,
|
|
127
|
+
hasLocalDraftForUpdate: false,
|
|
128
|
+
isResumeEditing: false,
|
|
129
|
+
isRestoring: false,
|
|
120
130
|
}),
|
|
121
131
|
getters: {
|
|
122
132
|
// Core Page Builder Getters
|
|
@@ -250,7 +260,7 @@ export const usePageBuilderStateStore = defineStore('pageBuilderState', {
|
|
|
250
260
|
return state.basePrimaryImage
|
|
251
261
|
},
|
|
252
262
|
|
|
253
|
-
|
|
263
|
+
getPageBuilderConfig(state: PageBuilderState): PageBuilderConfig | null {
|
|
254
264
|
return state.configPageBuilder
|
|
255
265
|
},
|
|
256
266
|
|
|
@@ -263,7 +273,12 @@ export const usePageBuilderStateStore = defineStore('pageBuilderState', {
|
|
|
263
273
|
},
|
|
264
274
|
|
|
265
275
|
// User Getters
|
|
276
|
+
getBuilderStarted: (state: PageBuilderState): boolean => state.builderStarted,
|
|
277
|
+
getIsLoadingGlobal: (state: PageBuilderState): boolean => state.isLoadingGlobal,
|
|
266
278
|
getIsSaving: (state: PageBuilderState): boolean => state.isSaving,
|
|
279
|
+
getHasLocalDraftForUpdate: (state: PageBuilderState): boolean => state.hasLocalDraftForUpdate,
|
|
280
|
+
getIsResumeEditing: (state: PageBuilderState): boolean => state.isResumeEditing,
|
|
281
|
+
getIsRestoring: (state: PageBuilderState): boolean => state.isRestoring,
|
|
267
282
|
},
|
|
268
283
|
actions: {
|
|
269
284
|
setComponentArrayAddMethod(payload: string | null): void {
|
|
@@ -436,7 +451,7 @@ export const usePageBuilderStateStore = defineStore('pageBuilderState', {
|
|
|
436
451
|
localStorage.setItem('preview', payload)
|
|
437
452
|
},
|
|
438
453
|
|
|
439
|
-
|
|
454
|
+
setPageBuilderConfig(payload: PageBuilderConfig | null): void {
|
|
440
455
|
this.configPageBuilder = payload
|
|
441
456
|
},
|
|
442
457
|
|
|
@@ -449,8 +464,23 @@ export const usePageBuilderStateStore = defineStore('pageBuilderState', {
|
|
|
449
464
|
},
|
|
450
465
|
|
|
451
466
|
// User Actions
|
|
467
|
+
setBuilderStarted(payload: boolean): void {
|
|
468
|
+
this.builderStarted = payload
|
|
469
|
+
},
|
|
470
|
+
setIsLoadingGlobal(payload: boolean): void {
|
|
471
|
+
this.isLoadingGlobal = payload
|
|
472
|
+
},
|
|
452
473
|
setIsSaving(payload: boolean): void {
|
|
453
474
|
this.isSaving = payload
|
|
454
475
|
},
|
|
476
|
+
setHasLocalDraftForUpdate(payload: boolean): void {
|
|
477
|
+
this.hasLocalDraftForUpdate = payload
|
|
478
|
+
},
|
|
479
|
+
setIsResumeEditing(payload: boolean): void {
|
|
480
|
+
this.isResumeEditing = payload
|
|
481
|
+
},
|
|
482
|
+
setIsRestoring(payload: boolean): void {
|
|
483
|
+
this.isRestoring = payload
|
|
484
|
+
},
|
|
455
485
|
},
|
|
456
486
|
})
|
package/src/types/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type PageBuilderService from '../composables/PageBuilderService.ts'
|
|
2
2
|
|
|
3
3
|
export interface PageBuilderState {
|
|
4
4
|
// ...other state properties...
|
|
5
|
-
|
|
5
|
+
PageBuilderService: PageBuilderService | null
|
|
6
6
|
isSaving: boolean
|
|
7
7
|
// etc.
|
|
8
8
|
}
|
|
@@ -90,6 +90,96 @@ export interface PageBuilderStateStore {
|
|
|
90
90
|
[key: string]: unknown
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
export type FormName =
|
|
94
|
+
// --- Content ---
|
|
95
|
+
| 'post'
|
|
96
|
+
| 'article'
|
|
97
|
+
| 'blog'
|
|
98
|
+
| 'news'
|
|
99
|
+
| 'page'
|
|
100
|
+
| 'faq'
|
|
101
|
+
| 'testimonial'
|
|
102
|
+
| 'case-study'
|
|
103
|
+
| 'press-release'
|
|
104
|
+
|
|
105
|
+
// --- Commerce ---
|
|
106
|
+
| 'product'
|
|
107
|
+
| 'products'
|
|
108
|
+
| 'category'
|
|
109
|
+
| 'collection'
|
|
110
|
+
| 'brand'
|
|
111
|
+
| 'coupon'
|
|
112
|
+
| 'discount'
|
|
113
|
+
| 'shop'
|
|
114
|
+
| 'cart'
|
|
115
|
+
| 'checkout'
|
|
116
|
+
|
|
117
|
+
// --- User / Team ---
|
|
118
|
+
| 'profile'
|
|
119
|
+
| 'account'
|
|
120
|
+
| 'team'
|
|
121
|
+
| 'team-member'
|
|
122
|
+
| 'author'
|
|
123
|
+
| 'customer'
|
|
124
|
+
| 'user'
|
|
125
|
+
|
|
126
|
+
// --- Business / Services ---
|
|
127
|
+
| 'service'
|
|
128
|
+
| 'services'
|
|
129
|
+
| 'package'
|
|
130
|
+
| 'plan'
|
|
131
|
+
| 'pricing'
|
|
132
|
+
| 'subscription'
|
|
133
|
+
|
|
134
|
+
// --- Job / Careers ---
|
|
135
|
+
| 'job'
|
|
136
|
+
| 'job-listing'
|
|
137
|
+
| 'career'
|
|
138
|
+
| 'applicant'
|
|
139
|
+
|
|
140
|
+
// --- Events / Scheduling ---
|
|
141
|
+
| 'event'
|
|
142
|
+
| 'events'
|
|
143
|
+
| 'webinar'
|
|
144
|
+
| 'appointment'
|
|
145
|
+
| 'reservation'
|
|
146
|
+
| 'schedule'
|
|
147
|
+
|
|
148
|
+
// --- Directory / Listings ---
|
|
149
|
+
| 'listing'
|
|
150
|
+
| 'directory'
|
|
151
|
+
| 'location'
|
|
152
|
+
| 'vendor'
|
|
153
|
+
| 'company'
|
|
154
|
+
|
|
155
|
+
// --- Media ---
|
|
156
|
+
| 'gallery'
|
|
157
|
+
| 'image'
|
|
158
|
+
| 'video'
|
|
159
|
+
| 'media'
|
|
160
|
+
| 'audio'
|
|
161
|
+
| 'file'
|
|
162
|
+
|
|
163
|
+
// --- Support / Feedback ---
|
|
164
|
+
| 'contact'
|
|
165
|
+
| 'support'
|
|
166
|
+
| 'ticket'
|
|
167
|
+
| 'feedback'
|
|
168
|
+
| 'review'
|
|
169
|
+
| 'inquiry'
|
|
170
|
+
| 'report'
|
|
171
|
+
|
|
172
|
+
// --- Misc ---
|
|
173
|
+
| 'setting'
|
|
174
|
+
| 'configuration'
|
|
175
|
+
| 'integration'
|
|
176
|
+
| 'theme'
|
|
177
|
+
| 'language'
|
|
178
|
+
| 'menu'
|
|
179
|
+
| 'navigation'
|
|
180
|
+
| 'tag'
|
|
181
|
+
| 'meta'
|
|
182
|
+
|
|
93
183
|
// User interfaces
|
|
94
184
|
export interface User {
|
|
95
185
|
name: string
|
|
@@ -103,22 +193,22 @@ export interface PageBuilderUser {
|
|
|
103
193
|
|
|
104
194
|
// Page Builder Configuration interface
|
|
105
195
|
export interface PageBuilderConfig {
|
|
106
|
-
updateOrCreate
|
|
196
|
+
updateOrCreate: {
|
|
107
197
|
formType: 'create' | 'update'
|
|
108
|
-
formName
|
|
198
|
+
formName: FormName
|
|
109
199
|
}
|
|
110
200
|
pageBuilderLogo?: { src: string } | null
|
|
111
|
-
resourceData?: { title: string; id
|
|
201
|
+
resourceData?: { title: string; id?: number } | null
|
|
112
202
|
userForPageBuilder?: { name: string } | null
|
|
113
203
|
[key: string]: unknown
|
|
114
204
|
userSettings?: {
|
|
115
|
-
theme
|
|
116
|
-
language
|
|
117
|
-
autoSave
|
|
205
|
+
theme?: 'light' | 'dark' | 'auto'
|
|
206
|
+
language?: string
|
|
207
|
+
autoSave?: boolean
|
|
118
208
|
[key: string]: unknown
|
|
119
209
|
} | null
|
|
120
210
|
settings?: {
|
|
121
|
-
brandColor
|
|
211
|
+
brandColor?: string
|
|
122
212
|
[key: string]: unknown
|
|
123
213
|
} | null
|
|
124
214
|
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import type { PageBuilderConfig } from '../types'
|
|
2
|
-
import { sharedPageBuilderStore } from '../stores/shared-store'
|
|
3
|
-
import PageBuilderClass from '../composables/PageBuilderClass.ts'
|
|
4
|
-
import { isEmptyObject } from './isEmptyObject.ts'
|
|
5
|
-
|
|
6
|
-
const pageBuilderStateStore = sharedPageBuilderStore
|
|
7
|
-
|
|
8
|
-
// Initialize PageBuilder with store
|
|
9
|
-
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
|
|
10
|
-
|
|
11
|
-
export const updateOrCreateIsFalsy = function (config: PageBuilderConfig) {
|
|
12
|
-
// Case A: updateOrCreate is missing, not an object, has an invalid formType, or is an empty object
|
|
13
|
-
if (
|
|
14
|
-
!config.updateOrCreate ||
|
|
15
|
-
(config.updateOrCreate && typeof config.updateOrCreate.formType !== 'string') ||
|
|
16
|
-
(config.updateOrCreate && isEmptyObject(config.updateOrCreate))
|
|
17
|
-
) {
|
|
18
|
-
const updatedConfig = {
|
|
19
|
-
...config,
|
|
20
|
-
updateOrCreate: {
|
|
21
|
-
formType: 'create' as 'create',
|
|
22
|
-
formName: 'post',
|
|
23
|
-
},
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
pageBuilderClass.applyPageBuilderConfig(updatedConfig)
|
|
27
|
-
return true
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Case B: formType exists but is not 'create' or 'update', and formName is missing or invalid
|
|
31
|
-
if (
|
|
32
|
-
config.updateOrCreate &&
|
|
33
|
-
typeof config.updateOrCreate.formType === 'string' &&
|
|
34
|
-
config.updateOrCreate.formType !== 'create' &&
|
|
35
|
-
config.updateOrCreate.formType !== 'update' &&
|
|
36
|
-
typeof config.formName !== 'string'
|
|
37
|
-
) {
|
|
38
|
-
const updatedConfig = {
|
|
39
|
-
...config,
|
|
40
|
-
updateOrCreate: {
|
|
41
|
-
formType: 'create',
|
|
42
|
-
formName: 'post',
|
|
43
|
-
},
|
|
44
|
-
} as const
|
|
45
|
-
|
|
46
|
-
pageBuilderClass.applyPageBuilderConfig(updatedConfig)
|
|
47
|
-
return true
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Case C: formType is valid ('create' or 'update'), but formName is missing or an empty string
|
|
51
|
-
if (
|
|
52
|
-
(config.updateOrCreate &&
|
|
53
|
-
typeof config.updateOrCreate.formType === 'string' &&
|
|
54
|
-
(config.updateOrCreate.formType === 'create' ||
|
|
55
|
-
config.updateOrCreate.formType === 'update') &&
|
|
56
|
-
typeof config.updateOrCreate.formName !== 'string') ||
|
|
57
|
-
(typeof config.updateOrCreate.formName === 'string' &&
|
|
58
|
-
config.updateOrCreate.formName.length === 0)
|
|
59
|
-
) {
|
|
60
|
-
const updatedConfig = {
|
|
61
|
-
...config,
|
|
62
|
-
updateOrCreate: {
|
|
63
|
-
formType: config.updateOrCreate.formType,
|
|
64
|
-
formName: 'post',
|
|
65
|
-
},
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
pageBuilderClass.applyPageBuilderConfig(updatedConfig)
|
|
69
|
-
return true
|
|
70
|
-
}
|
|
71
|
-
}
|