@myissue/vue-website-page-builder 3.3.1 → 3.3.11
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 +892 -886
- package/dist/vue-website-page-builder.umd.cjs +3 -3
- package/package.json +1 -1
- package/src/Components/PageBuilder/EditorMenu/EditorAccordion.vue +1 -1
- package/src/PageBuilder/PageBuilder.vue +1 -4
- package/src/composables/PageBuilderService.ts +37 -7
package/package.json
CHANGED
|
@@ -260,10 +260,7 @@ const ensureBuilderInitialized = function () {
|
|
|
260
260
|
}
|
|
261
261
|
|
|
262
262
|
onMounted(async () => {
|
|
263
|
-
|
|
264
|
-
if (pageBuilderService.statuspendingMountData()) {
|
|
265
|
-
await pageBuilderService.tryMountPendingData()
|
|
266
|
-
}
|
|
263
|
+
await pageBuilderService.tryMountPendingData()
|
|
267
264
|
|
|
268
265
|
// Check if Builder started
|
|
269
266
|
await delay(10000)
|
|
@@ -224,6 +224,11 @@ export class PageBuilderService {
|
|
|
224
224
|
this.#updateLocalStorageItemName()
|
|
225
225
|
|
|
226
226
|
this.completeBuilderInitialization()
|
|
227
|
+
|
|
228
|
+
const formType = config.updateOrCreate && config.updateOrCreate.formType
|
|
229
|
+
if (formType === 'create') {
|
|
230
|
+
await this.mountComponentsToDOM('')
|
|
231
|
+
}
|
|
227
232
|
}
|
|
228
233
|
|
|
229
234
|
async completeBuilderInitialization() {
|
|
@@ -1836,7 +1841,14 @@ export class PageBuilderService {
|
|
|
1836
1841
|
|
|
1837
1842
|
// If #pagebuilder is not present, cache the data and exit
|
|
1838
1843
|
if (!pagebuilder) {
|
|
1839
|
-
|
|
1844
|
+
// For 'create', set pendingMountData to '' (empty string)
|
|
1845
|
+
const config = this.pageBuilderStateStore.getPageBuilderConfig
|
|
1846
|
+
const formType = config && config.updateOrCreate && config.updateOrCreate.formType
|
|
1847
|
+
if (formType === 'create') {
|
|
1848
|
+
this.pendingMountData = ''
|
|
1849
|
+
} else {
|
|
1850
|
+
this.pendingMountData = passedData
|
|
1851
|
+
}
|
|
1840
1852
|
return
|
|
1841
1853
|
}
|
|
1842
1854
|
|
|
@@ -1892,16 +1904,34 @@ export class PageBuilderService {
|
|
|
1892
1904
|
}
|
|
1893
1905
|
}
|
|
1894
1906
|
|
|
1895
|
-
statuspendingMountData(): string | null {
|
|
1896
|
-
return this.pendingMountData
|
|
1897
|
-
}
|
|
1898
|
-
|
|
1899
|
-
// Try re-mounting
|
|
1900
1907
|
async tryMountPendingData() {
|
|
1901
|
-
|
|
1908
|
+
const pagebuilder = document.querySelector('#pagebuilder')
|
|
1909
|
+
|
|
1910
|
+
// Only run if #pagebuilder exists
|
|
1911
|
+
if (!pagebuilder) return
|
|
1912
|
+
|
|
1913
|
+
// If pendingMountData is a non-empty string (update or demo), always mount
|
|
1914
|
+
if (this.pendingMountData && typeof this.pendingMountData === 'string') {
|
|
1902
1915
|
await this.mountComponentsToDOM(this.pendingMountData)
|
|
1903
1916
|
this.pendingMountData = null
|
|
1904
1917
|
this.completeBuilderInitialization()
|
|
1918
|
+
return
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1921
|
+
// If pendingMountData is exactly '', and formType is 'create', and no components are mounted, mount for create
|
|
1922
|
+
const config = this.pageBuilderStateStore.getPageBuilderConfig
|
|
1923
|
+
const formType = config && config.updateOrCreate && config.updateOrCreate.formType
|
|
1924
|
+
const components = this.pageBuilderStateStore.getComponents
|
|
1925
|
+
|
|
1926
|
+
if (
|
|
1927
|
+
this.pendingMountData === '' &&
|
|
1928
|
+
formType === 'create' &&
|
|
1929
|
+
(!components || (Array.isArray(components) && components.length === 0))
|
|
1930
|
+
) {
|
|
1931
|
+
await this.mountComponentsToDOM('')
|
|
1932
|
+
this.pendingMountData = null
|
|
1933
|
+
this.completeBuilderInitialization()
|
|
1934
|
+
return
|
|
1905
1935
|
}
|
|
1906
1936
|
}
|
|
1907
1937
|
|