@myissue/vue-website-page-builder 3.2.91 → 3.2.93
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 +5221 -5286
- 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 +11 -12
- package/src/DemoComponents/HomeSection.vue +9 -30
- package/src/PageBuilder/PageBuilder.vue +194 -96
- package/src/composables/{PageBuilderClass.ts → PageBuilderService.ts} +292 -112
- 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 +39 -10
- package/src/types/index.ts +100 -10
- package/src/helpers/passedPageBuilderConfig.ts +0 -71
package/src/css/dev-global.css
CHANGED
|
@@ -14,8 +14,15 @@ These styles affect all HTML elements (like input, button, h1, etc.) in the cons
|
|
|
14
14
|
}
|
|
15
15
|
/* CSS for content inside page builder # start */
|
|
16
16
|
#page-builder-editor .tiptap {
|
|
17
|
+
outline: none !important;
|
|
18
|
+
box-shadow: none !important;
|
|
17
19
|
background: #fff;
|
|
18
20
|
min-height: 25rem;
|
|
21
|
+
border: 1px solid #aaa;
|
|
22
|
+
border-radius: 10px;
|
|
23
|
+
padding: 6px;
|
|
24
|
+
margin-bottom: 20px;
|
|
25
|
+
padding-bottom: 100px;
|
|
19
26
|
}
|
|
20
27
|
|
|
21
28
|
#pagebuilder #youtube-video::before {
|
package/src/index.ts
CHANGED
|
@@ -5,8 +5,6 @@ export { default as Preview } from './PageBuilder/Preview.vue'
|
|
|
5
5
|
// Export stores (consolidated into single store)
|
|
6
6
|
export { usePageBuilderStateStore } from './stores/page-builder-state'
|
|
7
7
|
|
|
8
|
-
export { default as PageBuilderClass } from './composables/PageBuilderClass.ts'
|
|
9
|
-
|
|
10
8
|
// Export composables
|
|
11
9
|
export { usePageBuilderModal } from './composables/usePageBuilderModal'
|
|
12
10
|
|
|
@@ -21,3 +19,7 @@ import './css/app.css'
|
|
|
21
19
|
|
|
22
20
|
// Export shared store instances for external access
|
|
23
21
|
export { sharedPageBuilderPinia, sharedPageBuilderStore } from './stores/shared-store'
|
|
22
|
+
|
|
23
|
+
// export { PageBuilderService } from './composables/PageBuilderService.ts'
|
|
24
|
+
|
|
25
|
+
export { initPageBuilder, getPageBuilder } from './composables/builderInstance'
|
package/src/main.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import './css/dev-global.css'
|
|
2
2
|
import './css/app.css'
|
|
3
|
+
import { initPageBuilder } from './composables/builderInstance'
|
|
3
4
|
|
|
4
5
|
import { createApp } from 'vue'
|
|
5
6
|
import { createPinia } from 'pinia'
|
|
6
7
|
import App from './App.vue'
|
|
7
8
|
|
|
9
|
+
initPageBuilder()
|
|
10
|
+
|
|
8
11
|
const app = createApp(App)
|
|
9
12
|
|
|
10
13
|
app.use(createPinia())
|
|
@@ -56,11 +56,16 @@ interface PageBuilderState {
|
|
|
56
56
|
configPageBuilder: PageBuilderConfig | null
|
|
57
57
|
|
|
58
58
|
// Media Library State
|
|
59
|
-
|
|
59
|
+
applyImageToSelection: ImageObject
|
|
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', {
|
|
@@ -112,11 +117,16 @@ export const usePageBuilderStateStore = defineStore('pageBuilderState', {
|
|
|
112
117
|
configPageBuilder: null,
|
|
113
118
|
|
|
114
119
|
// Media Library State
|
|
115
|
-
|
|
120
|
+
applyImageToSelection: { src: '' },
|
|
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,20 +260,25 @@ 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
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
return state.currentImage
|
|
267
|
+
getApplyImageToSelection(state: PageBuilderState): ImageObject {
|
|
268
|
+
return state.applyImageToSelection
|
|
260
269
|
},
|
|
270
|
+
|
|
261
271
|
getCurrentPreviewImage(state: PageBuilderState): string | null {
|
|
262
272
|
return state.currentPreviewImage
|
|
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,21 +451,35 @@ 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
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
this.currentImage = payload
|
|
458
|
+
setApplyImageToSelection(payload: ImageObject): void {
|
|
459
|
+
this.applyImageToSelection = payload
|
|
446
460
|
},
|
|
447
461
|
setCurrentPreviewImage(payload: string | null): void {
|
|
448
462
|
this.currentPreviewImage = payload
|
|
449
463
|
},
|
|
450
464
|
|
|
451
465
|
// User Actions
|
|
466
|
+
setBuilderStarted(payload: boolean): void {
|
|
467
|
+
this.builderStarted = payload
|
|
468
|
+
},
|
|
469
|
+
setIsLoadingGlobal(payload: boolean): void {
|
|
470
|
+
this.isLoadingGlobal = payload
|
|
471
|
+
},
|
|
452
472
|
setIsSaving(payload: boolean): void {
|
|
453
473
|
this.isSaving = payload
|
|
454
474
|
},
|
|
475
|
+
setHasLocalDraftForUpdate(payload: boolean): void {
|
|
476
|
+
this.hasLocalDraftForUpdate = payload
|
|
477
|
+
},
|
|
478
|
+
setIsResumeEditing(payload: boolean): void {
|
|
479
|
+
this.isResumeEditing = payload
|
|
480
|
+
},
|
|
481
|
+
setIsRestoring(payload: boolean): void {
|
|
482
|
+
this.isRestoring = payload
|
|
483
|
+
},
|
|
455
484
|
},
|
|
456
485
|
})
|
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
|
}
|
|
@@ -83,13 +83,103 @@ export interface PageBuilderStateStore {
|
|
|
83
83
|
setTextColor: (color: string) => void
|
|
84
84
|
setBackgroundOpacity: (opacity: string) => void
|
|
85
85
|
setOpacity: (opacity: string) => void
|
|
86
|
-
|
|
86
|
+
getApplyImageToSelection: ImageObject | null
|
|
87
87
|
setCurrentImage: (image: ImageObject) => void
|
|
88
88
|
getCurrentPreviewImage: string | null
|
|
89
89
|
setCurrentPreviewImage: (url: string | null) => void
|
|
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
|
-
}
|