@myissue/vue-website-page-builder 3.0.18 → 3.0.19
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 +79 -76
- package/dist/page-builder/2-images-text.png +0 -0
- package/dist/page-builder/3-images-text.png +0 -0
- package/dist/page-builder/3-vertical-images.png +0 -0
- package/dist/page-builder/4-images-text.png +0 -0
- package/dist/vue-website-page-builder.css +1 -1
- package/dist/vue-website-page-builder.js +7168 -7261
- package/dist/vue-website-page-builder.umd.cjs +146 -81
- package/package.json +4 -3
- package/src/App.vue +4 -115
- package/src/Components/Homepage/HomeSection.vue +70 -162
- package/src/Components/MediaLibrary/SidebarUnsplash.vue +9 -16
- package/src/Components/MediaLibrary/Unsplash.vue +51 -91
- package/src/Components/Modals/MediaLibraryModal.vue +56 -318
- package/src/Components/Modals/PageBuilderPreviewModal.vue +22 -40
- package/src/Components/PageBuilder/AdvancedPageBuilderSettings.vue +7 -0
- package/src/Components/PageBuilder/DropdownsPlusToggles/OptionsDropdown.vue +165 -110
- package/src/Components/PageBuilder/EditorMenu/Editables/BackgroundColorEditor.vue +9 -16
- package/src/Components/PageBuilder/EditorMenu/Editables/BorderRadius.vue +18 -18
- package/src/Components/PageBuilder/EditorMenu/Editables/Borders.vue +16 -21
- package/src/Components/PageBuilder/EditorMenu/Editables/ClassEditor.vue +12 -12
- package/src/Components/PageBuilder/EditorMenu/Editables/ComponentTopMenu.vue +10 -9
- package/src/Components/PageBuilder/EditorMenu/Editables/DeleteElement.vue +9 -9
- package/src/Components/PageBuilder/EditorMenu/Editables/EditGetElement.vue +144 -136
- package/src/Components/PageBuilder/EditorMenu/Editables/ElementEditor.vue +9 -10
- package/src/Components/PageBuilder/EditorMenu/Editables/ImageEditor.vue +31 -27
- package/src/Components/PageBuilder/EditorMenu/Editables/LinkEditor.vue +20 -14
- package/src/Components/PageBuilder/EditorMenu/Editables/ManageBackgroundOpacity.vue +9 -10
- package/src/Components/PageBuilder/EditorMenu/Editables/ManageOpacity.vue +9 -10
- package/src/Components/PageBuilder/EditorMenu/Editables/PaddingPlusMargin.vue +16 -16
- package/src/Components/PageBuilder/EditorMenu/Editables/TextColorEditor.vue +9 -16
- package/src/Components/PageBuilder/EditorMenu/Editables/Typography.vue +22 -20
- package/src/Components/PageBuilder/EditorMenu/RightSidebarEditor.vue +25 -27
- package/src/Components/PageBuilder/NoneCustomMediaLibraryComponent.vue +3 -0
- package/src/Components/PageBuilder/NoneCustomSearchComponent.vue +91 -0
- package/src/Components/PageBuilder/PageBuilderSettings.vue +8 -0
- package/src/Components/PageBuilder/Settings/AdvancedPageBuilderSettings.vue +31 -72
- package/src/Components/PageBuilder/Settings/PageBuilderSettings.vue +32 -36
- package/src/Components/Search/SearchComponents.vue +11 -199
- package/src/Components/TipTap/TipTap.vue +8 -7
- package/src/Components/TipTap/TipTapInput.vue +136 -134
- package/src/PageBuilder/PageBuilder.vue +220 -32
- package/src/composables/{PageBuilder.ts → PageBuilderClass.ts} +223 -142
- package/src/composables/usePageBuilderModal.ts +25 -0
- package/src/index.ts +8 -2
- package/src/stores/media-library.ts +1 -5
- package/src/stores/page-builder-state.ts +52 -36
- package/src/stores/user.ts +8 -6
- package/src/types/global.d.ts +6 -44
- package/src/types/index.ts +169 -0
- package/src/utils/html-elements/component.ts +88 -0
- package/src/utils/html-elements/componentHelpers.ts +101 -0
- package/src/Components/Modals/PageBuilderModal.vue +0 -233
- package/src/utils/builder/html-elements/componentHelpers.ts +0 -101
package/src/index.ts
CHANGED
|
@@ -5,9 +5,15 @@ export { default as Preview } from './PageBuilder/Preview.vue'
|
|
|
5
5
|
// Export stores
|
|
6
6
|
export { usePageBuilderStateStore } from './stores/page-builder-state'
|
|
7
7
|
export { useMediaLibraryStore } from './stores/media-library'
|
|
8
|
+
export { useUserStore } from './stores/user'
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
export { default as PageBuilderClass } from './composables/PageBuilderClass'
|
|
11
|
+
|
|
12
|
+
// Export composables
|
|
13
|
+
export { usePageBuilderModal } from './composables/usePageBuilderModal'
|
|
14
|
+
|
|
15
|
+
// Export types
|
|
16
|
+
export type { PageBuilderUser, ComponentObject, ImageObject } from './types'
|
|
11
17
|
|
|
12
18
|
// Export Pinia for convenience (same version as package uses)
|
|
13
19
|
export { createPinia } from 'pinia'
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import { defineStore } from 'pinia'
|
|
2
|
+
import type { ImageObject } from '@/types'
|
|
2
3
|
|
|
3
4
|
interface MediaLibraryState {
|
|
4
5
|
currentImage: ImageObject
|
|
5
6
|
currentPreviewImage: string | null
|
|
6
7
|
}
|
|
7
8
|
|
|
8
|
-
interface ImageObject {
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
-
[key: string]: any
|
|
11
|
-
}
|
|
12
|
-
|
|
13
9
|
export const useMediaLibraryStore = defineStore('mediaLibrary', {
|
|
14
10
|
state: (): MediaLibraryState => ({
|
|
15
11
|
currentImage: {},
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
import { defineStore } from 'pinia'
|
|
2
|
+
import { nextTick } from 'vue'
|
|
2
3
|
import { vueFetch } from '@/composables/vueFetch'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
interface FetchedComponentsResponse {
|
|
10
|
-
components: ComponentObject[]
|
|
11
|
-
// Add other properties that might exist in the response
|
|
12
|
-
[key: string]: unknown
|
|
13
|
-
}
|
|
4
|
+
import type {
|
|
5
|
+
ComponentObject,
|
|
6
|
+
FetchedComponentsResponse,
|
|
7
|
+
SetPushComponentsPayload,
|
|
8
|
+
LoadComponentsData,
|
|
9
|
+
} from '@/types'
|
|
14
10
|
|
|
15
11
|
interface PageBuilderState {
|
|
12
|
+
pageBuilderLogo: string | null
|
|
16
13
|
componentArrayAddMethod: string | null
|
|
17
14
|
localStorageItemName: string | null
|
|
18
|
-
localStorageItemNameUpdate: string | null
|
|
19
15
|
showModalTipTap: boolean
|
|
20
16
|
menuRight: boolean
|
|
21
17
|
borderStyle: string | null
|
|
@@ -53,21 +49,13 @@ interface PageBuilderState {
|
|
|
53
49
|
fontMobile: string | null
|
|
54
50
|
backgroundColor: string | null
|
|
55
51
|
textColor: string | null
|
|
56
|
-
element: HTMLElement | null
|
|
52
|
+
element: (HTMLElement & { src?: string }) | null
|
|
57
53
|
component: ComponentObject | null
|
|
58
54
|
components: ComponentObject[]
|
|
59
55
|
basePrimaryImage: string | null
|
|
60
56
|
fetchedComponents: FetchedComponentsResponse | null
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
interface SetPushComponentsPayload {
|
|
64
|
-
componentArrayAddMethod?: string
|
|
65
|
-
component: ComponentObject
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
interface LoadComponentsData {
|
|
69
|
-
search_query?: string
|
|
70
|
-
page?: string | number
|
|
57
|
+
currentResourceData: { title: string; id: number } | null
|
|
58
|
+
updateOrCreate: string
|
|
71
59
|
}
|
|
72
60
|
|
|
73
61
|
// get components
|
|
@@ -81,9 +69,9 @@ const {
|
|
|
81
69
|
|
|
82
70
|
export const usePageBuilderStateStore = defineStore('pageBuilderState', {
|
|
83
71
|
state: (): PageBuilderState => ({
|
|
72
|
+
pageBuilderLogo: null,
|
|
84
73
|
componentArrayAddMethod: null,
|
|
85
74
|
localStorageItemName: null,
|
|
86
|
-
localStorageItemNameUpdate: null,
|
|
87
75
|
showModalTipTap: false,
|
|
88
76
|
menuRight: true,
|
|
89
77
|
borderStyle: null,
|
|
@@ -126,17 +114,19 @@ export const usePageBuilderStateStore = defineStore('pageBuilderState', {
|
|
|
126
114
|
components: [],
|
|
127
115
|
basePrimaryImage: null,
|
|
128
116
|
fetchedComponents: null,
|
|
117
|
+
currentResourceData: null,
|
|
118
|
+
updateOrCreate: '',
|
|
129
119
|
}),
|
|
130
120
|
getters: {
|
|
121
|
+
getPageBuilderLogo(state: PageBuilderState): string | null {
|
|
122
|
+
return state.pageBuilderLogo
|
|
123
|
+
},
|
|
131
124
|
getComponentArrayAddMethod(state: PageBuilderState): string | null {
|
|
132
125
|
return state.componentArrayAddMethod
|
|
133
126
|
},
|
|
134
127
|
getLocalStorageItemName(state: PageBuilderState): string | null {
|
|
135
128
|
return state.localStorageItemName
|
|
136
129
|
},
|
|
137
|
-
getLocalStorageItemNameUpdate(state: PageBuilderState): string | null {
|
|
138
|
-
return state.localStorageItemNameUpdate
|
|
139
|
-
},
|
|
140
130
|
getShowModalTipTap(state: PageBuilderState): boolean {
|
|
141
131
|
return state.showModalTipTap
|
|
142
132
|
},
|
|
@@ -276,17 +266,23 @@ export const usePageBuilderStateStore = defineStore('pageBuilderState', {
|
|
|
276
266
|
getFetchedComponentsData(state: PageBuilderState): FetchedComponentsResponse | null {
|
|
277
267
|
return state.fetchedComponents
|
|
278
268
|
},
|
|
269
|
+
getCurrentResourceData(state: PageBuilderState): { title: string; id: number } | null {
|
|
270
|
+
return state.currentResourceData
|
|
271
|
+
},
|
|
272
|
+
getUpdateOrCreate(state: PageBuilderState): string {
|
|
273
|
+
return state.updateOrCreate
|
|
274
|
+
},
|
|
279
275
|
},
|
|
280
276
|
actions: {
|
|
277
|
+
setPageBuilderLogo(payload: string | null): void {
|
|
278
|
+
this.pageBuilderLogo = payload
|
|
279
|
+
},
|
|
281
280
|
setComponentArrayAddMethod(payload: string | null): void {
|
|
282
281
|
this.componentArrayAddMethod = payload
|
|
283
282
|
},
|
|
284
283
|
setLocalStorageItemName(payload: string | null): void {
|
|
285
284
|
this.localStorageItemName = payload
|
|
286
285
|
},
|
|
287
|
-
setLocalStorageItemNameUpdate(payload: string | null): void {
|
|
288
|
-
this.localStorageItemNameUpdate = payload
|
|
289
|
-
},
|
|
290
286
|
setShowModalTipTap(payload: boolean): void {
|
|
291
287
|
this.showModalTipTap = payload
|
|
292
288
|
},
|
|
@@ -405,30 +401,44 @@ export const usePageBuilderStateStore = defineStore('pageBuilderState', {
|
|
|
405
401
|
this.textColor = payload
|
|
406
402
|
},
|
|
407
403
|
setElement(payload: HTMLElement | null): void {
|
|
408
|
-
this.element =
|
|
404
|
+
this.element = {} as HTMLElement
|
|
405
|
+
nextTick(() => {
|
|
406
|
+
this.element = payload
|
|
407
|
+
})
|
|
409
408
|
},
|
|
410
409
|
setComponent(payload: ComponentObject | null): void {
|
|
410
|
+
console.log('setComponent called:', payload)
|
|
411
411
|
if (!payload) {
|
|
412
412
|
this.element = null
|
|
413
413
|
this.component = null
|
|
414
|
-
// Note: pageBuilder.removeHoveredAndSelected(null) removed as pageBuilder is not available in store scope
|
|
415
414
|
return
|
|
416
415
|
}
|
|
417
|
-
this.component =
|
|
416
|
+
this.component = {} as ComponentObject
|
|
417
|
+
nextTick(() => {
|
|
418
|
+
this.component = payload
|
|
419
|
+
})
|
|
418
420
|
},
|
|
421
|
+
|
|
419
422
|
setComponents(payload: ComponentObject[] | null): void {
|
|
420
|
-
this.components =
|
|
423
|
+
this.components = {} as ComponentObject[]
|
|
424
|
+
nextTick(() => {
|
|
425
|
+
this.components = payload || []
|
|
426
|
+
})
|
|
421
427
|
},
|
|
422
428
|
setPushComponents(payload: SetPushComponentsPayload): void {
|
|
423
|
-
const method = payload.componentArrayAddMethod
|
|
429
|
+
const method = payload.componentArrayAddMethod ?? 'push'
|
|
424
430
|
if (method === 'push') {
|
|
425
431
|
this.components.push(payload.component)
|
|
426
432
|
} else if (method === 'unshift') {
|
|
427
433
|
this.components.unshift(payload.component)
|
|
428
434
|
}
|
|
429
435
|
},
|
|
436
|
+
|
|
430
437
|
setBasePrimaryImage(payload: string | null): void {
|
|
431
|
-
|
|
438
|
+
if (this.element) {
|
|
439
|
+
this.element.src = payload ?? undefined
|
|
440
|
+
}
|
|
441
|
+
|
|
432
442
|
this.basePrimaryImage = payload
|
|
433
443
|
},
|
|
434
444
|
setCurrentLayoutPreview(payload: string): void {
|
|
@@ -457,5 +467,11 @@ export const usePageBuilderStateStore = defineStore('pageBuilderState', {
|
|
|
457
467
|
: null,
|
|
458
468
|
)
|
|
459
469
|
},
|
|
470
|
+
setCurrentResourceData(payload: { title: string; id: number } | null): void {
|
|
471
|
+
this.currentResourceData = payload
|
|
472
|
+
},
|
|
473
|
+
setUpdateOrCreate(payload: string): void {
|
|
474
|
+
this.updateOrCreate = payload
|
|
475
|
+
},
|
|
460
476
|
},
|
|
461
477
|
})
|
package/src/stores/user.ts
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import { defineStore } from 'pinia'
|
|
2
|
+
import type { UserSettings, User } from '@/types'
|
|
2
3
|
|
|
3
4
|
interface UserState {
|
|
4
5
|
isLoading: boolean
|
|
5
|
-
userSettings:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
interface UserSettings {
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
-
[key: string]: any
|
|
6
|
+
userSettings: UserSettings | null
|
|
7
|
+
currentUser: User | null
|
|
11
8
|
}
|
|
12
9
|
|
|
13
10
|
export const useUserStore = defineStore('user', {
|
|
14
11
|
state: (): UserState => ({
|
|
15
12
|
isLoading: false,
|
|
16
13
|
userSettings: null,
|
|
14
|
+
currentUser: null,
|
|
17
15
|
}),
|
|
18
16
|
getters: {
|
|
19
17
|
getIsLoading: (state: UserState): boolean => state.isLoading,
|
|
20
18
|
getUserSettings: (state: UserState): UserSettings | null => state.userSettings,
|
|
19
|
+
getCurrentUser: (state: UserState): User | null => state.currentUser,
|
|
21
20
|
},
|
|
22
21
|
actions: {
|
|
23
22
|
setIsLoading(payload: boolean): void {
|
|
@@ -26,5 +25,8 @@ export const useUserStore = defineStore('user', {
|
|
|
26
25
|
setUserSettings(payload: UserSettings | null): void {
|
|
27
26
|
this.userSettings = payload
|
|
28
27
|
},
|
|
28
|
+
setCurrentUser(payload: User | null): void {
|
|
29
|
+
this.currentUser = payload
|
|
30
|
+
},
|
|
29
31
|
},
|
|
30
32
|
})
|
package/src/types/global.d.ts
CHANGED
|
@@ -1,49 +1,11 @@
|
|
|
1
|
-
// Global type declarations
|
|
2
|
-
declare module '@/utils/builder/tailwaind-colors' {
|
|
3
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4
|
-
const tailwindColors: any
|
|
5
|
-
export default tailwindColors
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
declare module '@/utils/builder/tailwind-opacities' {
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
-
const tailwindOpacities: any
|
|
11
|
-
export default tailwindOpacities
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
declare module '@/utils/builder/tailwind-font-sizes' {
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
|
-
const tailwindFontSizes: any
|
|
17
|
-
export default tailwindFontSizes
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
declare module '@/utils/builder/tailwind-font-styles' {
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
|
-
const tailwindFontStyles: any
|
|
23
|
-
export default tailwindFontStyles
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
declare module '@/utils/builder/tailwind-padding-margin' {
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
|
-
const tailwindPaddingAndMargin: any
|
|
29
|
-
export default tailwindPaddingAndMargin
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
declare module '@/utils/builder/tailwind-border-radius' {
|
|
33
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
|
-
const tailwindBorderRadius: any
|
|
35
|
-
export default tailwindBorderRadius
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
declare module '@/utils/builder/tailwind-border-style-width-color' {
|
|
39
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
|
-
const tailwindBorderStyleWidthPlusColor: any
|
|
41
|
-
export default tailwindBorderStyleWidthPlusColor
|
|
42
|
-
}
|
|
1
|
+
// Global type declarations
|
|
43
2
|
|
|
44
3
|
declare module '*.vue' {
|
|
45
4
|
import type { DefineComponent } from 'vue'
|
|
46
|
-
|
|
47
|
-
|
|
5
|
+
const component: DefineComponent<
|
|
6
|
+
Record<string, unknown>,
|
|
7
|
+
Record<string, unknown>,
|
|
8
|
+
Record<string, unknown>
|
|
9
|
+
>
|
|
48
10
|
export default component
|
|
49
11
|
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
// Central type definitions for the Vue Page Builder project
|
|
2
|
+
|
|
3
|
+
// Component and Image interfaces
|
|
4
|
+
export interface ComponentObject {
|
|
5
|
+
id: string | number | null
|
|
6
|
+
html_code: string
|
|
7
|
+
title: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface ImageObject {
|
|
11
|
+
src: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Store interfaces for better type safety
|
|
15
|
+
export interface PageBuilderStateStore {
|
|
16
|
+
getTextAreaVueModel: string | null
|
|
17
|
+
LocalStorageItemName: string | null
|
|
18
|
+
getHyberlinkEnable: boolean
|
|
19
|
+
getComponents: ComponentObject[] | null
|
|
20
|
+
getComponent: ComponentObject | null
|
|
21
|
+
getElement: HTMLElement | null
|
|
22
|
+
getNextSibling: HTMLElement | null
|
|
23
|
+
getParentElement: HTMLElement | null
|
|
24
|
+
getRestoredElement: string | null
|
|
25
|
+
getComponentArrayAddMethod: string | null
|
|
26
|
+
getFontBase: string | null
|
|
27
|
+
getFontDesktop: string | null
|
|
28
|
+
getFontTablet: string | null
|
|
29
|
+
getFontMobile: string | null
|
|
30
|
+
getUpdateOrCreate: string
|
|
31
|
+
getCurrentResourceData: { title: string; id: number } | null
|
|
32
|
+
setElement: (element: HTMLElement | null) => void
|
|
33
|
+
setMenuRight: (value: boolean) => void
|
|
34
|
+
setComponent: (component: ComponentObject | null) => void
|
|
35
|
+
setComponents: (components: ComponentObject[] | null) => void
|
|
36
|
+
setComponentArrayAddMethod: (method: string) => void
|
|
37
|
+
setCurrentClasses: (classes: string[] | ArrayLike<string>) => void
|
|
38
|
+
setClass: (className: string) => void
|
|
39
|
+
removeClass: (className: string) => void
|
|
40
|
+
setParentElement: (element: HTMLElement | Node | null) => void
|
|
41
|
+
setRestoredElement: (html: string | null) => void
|
|
42
|
+
setNextSibling: (element: HTMLElement | Node | null) => void
|
|
43
|
+
setTextAreaVueModel: (html: string | null) => void
|
|
44
|
+
setFontBase: (size: string | null) => void
|
|
45
|
+
setFontDesktop: (size: string | null) => void
|
|
46
|
+
setFontTablet: (size: string | null) => void
|
|
47
|
+
setFontMobile: (size: string | null) => void
|
|
48
|
+
setBasePrimaryImage: (url: string | null) => void
|
|
49
|
+
setCurrentLayoutPreview: (html: string) => void
|
|
50
|
+
setHyperlinkError: (error: string | null) => void
|
|
51
|
+
setHyperlinkMessage: (message: string | null) => void
|
|
52
|
+
setElementContainsHyperlink: (contains: boolean) => void
|
|
53
|
+
setHyberlinkEnable: (enable: boolean) => void
|
|
54
|
+
setHyperlinkInput: (input: string) => void
|
|
55
|
+
setOpenHyperlinkInNewTab: (newTab: boolean) => void
|
|
56
|
+
setHyperlinkAbility: (ability: boolean) => void
|
|
57
|
+
setPushComponents: (payload: SetPushComponentsPayload) => void
|
|
58
|
+
setLocalStorageItemName: (name: string | null) => void
|
|
59
|
+
setUpdateOrCreate: (mode: string) => void
|
|
60
|
+
setCurrentResourceData: (data: { title: string; id: number } | null) => void
|
|
61
|
+
setFontWeight: (weight: string) => void
|
|
62
|
+
setFontFamily: (family: string) => void
|
|
63
|
+
setFontStyle: (style: string) => void
|
|
64
|
+
setFontVerticalPadding: (padding: string) => void
|
|
65
|
+
setFontHorizontalPadding: (padding: string) => void
|
|
66
|
+
setFontVerticalMargin: (margin: string) => void
|
|
67
|
+
setFontHorizontalMargin: (margin: string) => void
|
|
68
|
+
setBorderStyle: (style: string) => void
|
|
69
|
+
setBorderWidth: (width: string) => void
|
|
70
|
+
setBorderColor: (color: string) => void
|
|
71
|
+
setBorderRadiusGlobal: (radius: string) => void
|
|
72
|
+
setBorderRadiusTopLeft: (radius: string) => void
|
|
73
|
+
setBorderRadiusTopRight: (radius: string) => void
|
|
74
|
+
setBorderRadiusBottomleft: (radius: string) => void
|
|
75
|
+
setBorderRadiusBottomRight: (radius: string) => void
|
|
76
|
+
setBackgroundColor: (color: string) => void
|
|
77
|
+
setTextColor: (color: string) => void
|
|
78
|
+
setBackgroundOpacity: (opacity: string) => void
|
|
79
|
+
setOpacity: (opacity: string) => void
|
|
80
|
+
[key: string]: unknown
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface MediaLibraryStore {
|
|
84
|
+
getCurrentImage: ImageObject | null
|
|
85
|
+
setCurrentImage: (image: ImageObject) => void
|
|
86
|
+
getCurrentPreviewImage: string | null
|
|
87
|
+
setCurrentPreviewImage: (url: string | null) => void
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// User interfaces
|
|
91
|
+
export interface User {
|
|
92
|
+
name: string
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Specific user interface for page builder usage
|
|
96
|
+
export interface PageBuilderUser {
|
|
97
|
+
name: string
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// User settings interface
|
|
101
|
+
export interface UserSettings {
|
|
102
|
+
theme?: 'light' | 'dark' | 'auto'
|
|
103
|
+
language?: string
|
|
104
|
+
notifications?: boolean
|
|
105
|
+
autoSave?: boolean
|
|
106
|
+
[key: string]: unknown
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Tailwind utility interfaces
|
|
110
|
+
export interface TailwindColors {
|
|
111
|
+
backgroundColorVariables: string[]
|
|
112
|
+
textColorVariables: string[]
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface TailwindOpacities {
|
|
116
|
+
opacities: string[]
|
|
117
|
+
backgroundOpacities: string[]
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface TailwindFontSizes {
|
|
121
|
+
fontBase: string[]
|
|
122
|
+
fontDesktop: string[]
|
|
123
|
+
fontTablet: string[]
|
|
124
|
+
fontMobile: string[]
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface TailwindFontStyles {
|
|
128
|
+
fontStyles: string[]
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface TailwindPaddingAndMargin {
|
|
132
|
+
paddingAndMargin: string[]
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface TailwindBorderRadius {
|
|
136
|
+
borderRadius: string[]
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export interface TailwindBorderStyleWidthColor {
|
|
140
|
+
borderStyles: string[]
|
|
141
|
+
borderWidths: string[]
|
|
142
|
+
borderColors: string[]
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Utility types
|
|
146
|
+
export type TimerHandle = ReturnType<typeof setTimeout>
|
|
147
|
+
export type MutationObserver = globalThis.MutationObserver
|
|
148
|
+
|
|
149
|
+
// Fetch response interfaces
|
|
150
|
+
export interface FetchedComponentsResponse {
|
|
151
|
+
components: ComponentObject[]
|
|
152
|
+
pagination?: {
|
|
153
|
+
current_page: number
|
|
154
|
+
last_page: number
|
|
155
|
+
per_page: number
|
|
156
|
+
total: number
|
|
157
|
+
}
|
|
158
|
+
[key: string]: unknown
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export interface SetPushComponentsPayload {
|
|
162
|
+
componentArrayAddMethod?: string
|
|
163
|
+
component: ComponentObject
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export interface LoadComponentsData {
|
|
167
|
+
search_query?: string
|
|
168
|
+
page?: string | number
|
|
169
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
interface ComponentData {
|
|
2
|
+
title: string
|
|
3
|
+
html_code: string
|
|
4
|
+
cover_image: string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
interface Components {
|
|
8
|
+
components: {
|
|
9
|
+
data: ComponentData[]
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const component: Components[] = [
|
|
14
|
+
{
|
|
15
|
+
components: {
|
|
16
|
+
data: [
|
|
17
|
+
{
|
|
18
|
+
title: 'Single Image',
|
|
19
|
+
html_code:
|
|
20
|
+
'<section>\n<div class="w-full md:pt-12 md:pb-12 pt-4 pb-4 lg:px-4 px-2"><div class="mx-auto max-w-7xl"><div class="myPrimaryGap grid grid-cols-1 sm:grid-cols-1 lg:grid-cols-1"> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square smooth-transition" src="/page-builder/placeholder.jpg" alt="provider"></div></div></div></div>\n</section>',
|
|
21
|
+
cover_image: '/page-builder/image.png',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
title: '2 vertical images',
|
|
25
|
+
html_code:
|
|
26
|
+
'<section>\n<div class="w-full md:pt-12 md:pb-12 pt-4 pb-4 lg:px-4 px-2"><div class="mx-auto max-w-7xl"><div class="myPrimaryGap grid grid-cols-2 sm:grid-cols-2 lg:grid-cols-2"> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-[9/16] smooth-transition" src="/page-builder/placeholder.jpg" alt="provider"> </div> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-[9/16] smooth-transition" src="/page-builder/placeholder.jpg" alt="provider"> </div> </div> </div> </div>\n</section>',
|
|
27
|
+
cover_image: '/page-builder/two-vertical-images.png',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
title: '2 images',
|
|
31
|
+
html_code:
|
|
32
|
+
'<section>\n<div class="w-full md:pt-12 md:pb-12 pt-4 pb-4 lg:px-4 px-2"><div class="mx-auto max-w-7xl"><div class="myPrimaryGap grid grid-cols-1 sm:grid-cols-3 lg:grid-cols-3"> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square smooth-transition" src="/page-builder/placeholder.jpg" alt="provider"> </div> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square smooth-transition" src="/page-builder/placeholder.jpg" alt="provider"> </div> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square smooth-transition" src="/page-builder/placeholder.jpg" alt="provider"></div></div> </div></div>\n</section>',
|
|
33
|
+
cover_image: '/page-builder/3-images.png',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
title: '3 images',
|
|
37
|
+
html_code:
|
|
38
|
+
'<section>\n<div class="w-full md:pt-12 md:pb-12 pt-4 pb-4 lg:px-4 px-2"><div class="mx-auto max-w-7xl"><div class="myPrimaryGap grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-2"> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square smooth-transition" src="/page-builder/placeholder.jpg" alt="provider"> </div> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square smooth-transition" src="/page-builder/placeholder.jpg" alt="provider"></div></div> </div></div>\n</section>',
|
|
39
|
+
cover_image: '/page-builder/2-images.png',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
title: '6 Images Grid',
|
|
43
|
+
html_code:
|
|
44
|
+
'<section>\n<div class="w-full md:pt-12 md:pb-12 pt-4 pb-4 lg:px-4 px-2">\n<div class="mx-auto max-w-7xl">\n<div class="grid grid-cols-2 md:grid-cols-3 myPrimaryGap">\n\n<div>\n<img class="object-cover w-full object-top aspect-square smooth-transition" src="/page-builder/placeholder.jpg" alt="image">\n</div>\n\n<div>\n<img class="object-cover w-full object-top aspect-square smooth-transition" src="/page-builder/placeholder.jpg" alt="image">\n</div>\n\n<div>\n<img class="object-cover w-full object-top aspect-square smooth-transition" src="/page-builder/placeholder.jpg" alt="image">\n</div>\n\n<div>\n<img class="object-cover w-full object-top aspect-square smooth-transition" src="/page-builder/placeholder.jpg" alt="image">\n</div>\n\n<div>\n<img class="object-cover w-full object-top aspect-square smooth-transition" src="/page-builder/placeholder.jpg" alt="image">\n</div>\n\n<div>\n<img class="object-cover w-full object-top aspect-square smooth-transition" src="/page-builder/placeholder.jpg" alt="image">\n</div>\n\n</div>\n</div>\n</div>\n</section>',
|
|
45
|
+
cover_image: '/page-builder/6-images.png',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
title: 'Two Images With Right Text Top',
|
|
49
|
+
html_code:
|
|
50
|
+
'<section>\n<div class="w-full md:pt-12 md:pb-12 pt-4 pb-4 lg:px-4 px-2"><div class="mx-auto max-w-7xl">\n<div class="myPrimaryGap lg:flex lg:justify-center"><div class="flex-1 py-2">\n<div class="grid myPrimaryGap grid-cols-1 lg:grid-cols-2"> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square smooth-transition" src="/page-builder/placeholder.jpg" alt="provider"> </div> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square smooth-transition" src="/page-builder/placeholder.jpg" alt="provider"> </div> </div> </div>\n\n<div class="flex-1 py-2"> <div class="break-words py-2"><p><strong>Title</strong></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p></div></div> \n</div></div></div>\n</section>',
|
|
51
|
+
cover_image: '/page-builder/2-images-text-top.png',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
title: '3 Vertical Images',
|
|
55
|
+
html_code:
|
|
56
|
+
'<section>\n<div class="w-full md:pt-12 md:pb-12 pt-4 pb-4 lg:px-4 px-2"><div class="mx-auto max-w-7xl"><div class="myPrimaryGap grid grid-cols-1 sm:grid-cols-3 lg:grid-cols-3"> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-[9/16] smooth-transition" src="/page-builder/placeholder.jpg" alt="provider"> </div> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-[9/16] smooth-transition" src="/page-builder/placeholder.jpg" alt="provider"> </div> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-[9/16] smooth-transition" src="/page-builder/placeholder.jpg" alt="provider"></div></div> </div></div>\n</section>',
|
|
57
|
+
cover_image: '/page-builder/3-vertical-images.png',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
title: 'Link Button',
|
|
61
|
+
html_code:
|
|
62
|
+
'<section>\n<div class="w-full md:pt-2 md:pb-2 pt-4 pb-4 lg:px-4 px-2">\n<div class="mx-auto max-w-7xl">\n<div id="linktree" class="border-2 border-gray-600 flex items-centre justify-start rounded-md font-medium text-black">\n<p>\n<a target="_blank" rel="noopener noreferrer nofollow" href="https://www.example.com">Link to landing page</a>\n</p>\n</div>\n</div>\n</div>\n</section>',
|
|
63
|
+
cover_image: '/page-builder/image.png',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
title: '4 Images With Text',
|
|
67
|
+
html_code:
|
|
68
|
+
'<section>\n<div class="w-full md:pt-12 md:pb-12 pt-4 pb-4 lg:px-4 px-2"><div class="mx-auto max-w-7xl"><div class="myPrimaryGap grid grid-cols-2 sm:grid-cols-2 lg:grid-cols-4"> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square smooth-transition" src="/page-builder/placeholder.jpg" alt="provider"> <div class="break-words py-2"><p>Layouts and visual.</p><p>Ullamcorper dignissim cras tincidunt.</p></div> </div> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square smooth-transition" src="/page-builder/placeholder.jpg" alt="provider"> <div class="break-words py-2"><p>Layouts and visual.</p><p>Ullamcorper dignissim cras tincidunt.</p></div> </div> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square smooth-transition" src="/page-builder/placeholder.jpg" alt="provider"> <div class="break-words py-2"><p>Layouts and visual.</p><p>Ullamcorper dignissim cras tincidunt.</p></div> </div> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square smooth-transition" src="/page-builder/placeholder.jpg" alt="provider"><div class="break-words py-2"><p>Layouts and visual.</p><p>Ullamcorper dignissim cras tincidunt.</p></div> </div> </div> </div> </div>\n</section>',
|
|
69
|
+
cover_image: '/page-builder/4-images-text.png',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
title: '3 Images With Text',
|
|
73
|
+
html_code:
|
|
74
|
+
'<section>\n<div class="w-full md:pt-12 md:pb-12 pt-4 pb-4 lg:px-4 px-2"><div class="mx-auto max-w-7xl"><div class="myPrimaryGap grid grid-cols-1 sm:grid-cols-3 lg:grid-cols-3"> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square smooth-transition" src="/page-builder/placeholder.jpg" alt="provider"> <div class="break-words py-2"><p>Layouts and visual.</p><p>Ullamcorper dignissim cras tincidunt.</p></div> </div> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square smooth-transition" src="/page-builder/placeholder.jpg" alt="provider"> <div class="break-words py-2"><p>Layouts and visual.</p><p>Ullamcorper dignissim cras tincidunt.</p></div> </div> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square smooth-transition" src="/page-builder/placeholder.jpg" alt="provider"> <div class="break-words py-2"><p>Layouts and visual.</p><p>Ullamcorper dignissim cras tincidunt.</p></div> </div> </div> </div> </div>\n</section>',
|
|
75
|
+
cover_image: '/page-builder/3-images-text.png',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
title: '2 Images With Text',
|
|
79
|
+
html_code:
|
|
80
|
+
'<section>\n<div class="w-full md:pt-12 md:pb-12 pt-4 pb-4 lg:px-4 px-2"><div class="mx-auto max-w-7xl"><div class="myPrimaryGap grid grid-cols-2 sm:grid-cols-2 lg:grid-cols-2"> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square smooth-transition" src="/page-builder/placeholder.jpg" alt="provider"> <div class="break-words py-2"><p>Layouts and visual.</p><p>Ullamcorper dignissim cras tincidunt.</p></div> </div> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square smooth-transition" src="/page-builder/placeholder.jpg" alt="provider"> <div class="break-words py-2"><p>Layouts and visual.</p><p>Ullamcorper dignissim cras tincidunt.</p></div> </div> </div> </div> </div>\n</section>',
|
|
81
|
+
cover_image: '/page-builder/2-images-text.png',
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
]
|
|
87
|
+
|
|
88
|
+
export default component
|