@g1cloud/page-builder-editor 1.0.0-alpha.44 → 1.0.0-alpha.45
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/{PbPropertyEditorColor-B3xl9E3o.js → PbPropertyEditorColor-DHIK8xLM.js} +1 -1
- package/dist/{PbPropertyEditorHtml-EMisPKLD.js → PbPropertyEditorHtml-Jh4spLgs.js} +1 -1
- package/dist/{PbPropertyEditorImage-BVxHJlyq.js → PbPropertyEditorImage-DaQ6AzHk.js} +1 -1
- package/dist/{PbPropertyEditorMultilineText-P-U54Cz2.js → PbPropertyEditorMultilineText-DHqDdVCb.js} +1 -1
- package/dist/{PbPropertyEditorText-4FO396e0.js → PbPropertyEditorText-CLz-HW0c.js} +1 -1
- package/dist/{PbPropertyEditorYoutube-P8ajWtxn.js → PbPropertyEditorYoutube-Dqi0T67b.js} +1 -1
- package/dist/{PbWidgetAddModal-B0LCiyLg.js → PbWidgetAddModal-eVGTb1x1.js} +1 -1
- package/dist/{index-HSJAvXph.js → index-BtttVLpv.js} +80 -49
- package/dist/page-builder-editor.js +1 -1
- package/dist/page-builder-editor.umd.cjs +73 -42
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, createVNode, unref } from "vue";
|
|
2
2
|
import { BSTextInput } from "@g1cloud/bluesea";
|
|
3
|
-
import { P as PbColorPicker } from "./index-
|
|
3
|
+
import { P as PbColorPicker } from "./index-BtttVLpv.js";
|
|
4
4
|
const _hoisted_1 = { class: "property-editor property-editor-color" };
|
|
5
5
|
const _hoisted_2 = { class: "title" };
|
|
6
6
|
const _hoisted_3 = ["textContent"];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, defineAsyncComponent } from "vue";
|
|
2
2
|
import { useModal } from "@g1cloud/bluesea";
|
|
3
|
-
import { u as usePageBuilderEditor } from "./index-
|
|
3
|
+
import { u as usePageBuilderEditor } from "./index-BtttVLpv.js";
|
|
4
4
|
const _hoisted_1 = { class: "property-editor property-editor-image flex-align-center" };
|
|
5
5
|
const _hoisted_2 = { class: "title" };
|
|
6
6
|
const _hoisted_3 = ["textContent"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString } from "vue";
|
|
2
|
-
import { u as usePageBuilderEditor } from "./index-
|
|
2
|
+
import { u as usePageBuilderEditor } from "./index-BtttVLpv.js";
|
|
3
3
|
import { useModal } from "@g1cloud/bluesea";
|
|
4
4
|
const _hoisted_1 = { class: "property-editor property-editor-image flex-align-center" };
|
|
5
5
|
const _hoisted_2 = { class: "title" };
|
package/dist/{PbPropertyEditorMultilineText-P-U54Cz2.js → PbPropertyEditorMultilineText-DHqDdVCb.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, toDisplayString, createBlock, unref } from "vue";
|
|
2
2
|
import { BSMultiLangTextArea, BSTextArea } from "@g1cloud/bluesea";
|
|
3
|
-
import { u as usePageBuilderEditor } from "./index-
|
|
3
|
+
import { u as usePageBuilderEditor } from "./index-BtttVLpv.js";
|
|
4
4
|
const _hoisted_1 = { class: "property-editor property-editor-multiline-text" };
|
|
5
5
|
const _hoisted_2 = { class: "title" };
|
|
6
6
|
const _hoisted_3 = ["textContent"];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, toDisplayString, createBlock, unref } from "vue";
|
|
2
2
|
import { BSMultiLangTextInput, BSTextInput } from "@g1cloud/bluesea";
|
|
3
|
-
import { u as usePageBuilderEditor } from "./index-
|
|
3
|
+
import { u as usePageBuilderEditor } from "./index-BtttVLpv.js";
|
|
4
4
|
const _hoisted_1 = { class: "property-editor property-editor-text flex-align-center" };
|
|
5
5
|
const _hoisted_2 = { class: "title" };
|
|
6
6
|
const _hoisted_3 = ["textContent"];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString } from "vue";
|
|
2
2
|
import { useModal } from "@g1cloud/bluesea";
|
|
3
|
-
import { s as selectYoutubeVideo } from "./index-
|
|
3
|
+
import { s as selectYoutubeVideo } from "./index-BtttVLpv.js";
|
|
4
4
|
const _hoisted_1 = { class: "property-editor property-editor-image flex-align-center" };
|
|
5
5
|
const _hoisted_2 = { class: "title" };
|
|
6
6
|
const _hoisted_3 = ["textContent"];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createBlock, unref, withCtx, createElementVNode, createElementBlock, Fragment, renderList, toDisplayString } from "vue";
|
|
2
2
|
import { useModalHandle, BSModalFrame } from "@g1cloud/bluesea";
|
|
3
|
-
import { w as widgetPartDefinitions } from "./index-
|
|
3
|
+
import { w as widgetPartDefinitions } from "./index-BtttVLpv.js";
|
|
4
4
|
const _hoisted_1 = { class: "bs-layout-vertical pb-part-add-modal" };
|
|
5
5
|
const _hoisted_2 = { class: "bs-layout-horizontal-wrap ml-16 mb-8 gap-8" };
|
|
6
6
|
const _hoisted_3 = ["onClick", "textContent"];
|
|
@@ -8176,15 +8176,15 @@ class PartManager {
|
|
|
8176
8176
|
const defaultPartPropertyEditors = () => {
|
|
8177
8177
|
return {
|
|
8178
8178
|
"readonly-text": () => defineAsyncComponent(() => import("./PbPropertyEditorReadonlyText-Dgp_AVOD.js")),
|
|
8179
|
-
"text": () => defineAsyncComponent(() => import("./PbPropertyEditorText-
|
|
8179
|
+
"text": () => defineAsyncComponent(() => import("./PbPropertyEditorText-CLz-HW0c.js")),
|
|
8180
8180
|
"number": () => defineAsyncComponent(() => import("./PbPropertyEditorNumber-TTgo0zbQ.js")),
|
|
8181
8181
|
"boolean": () => defineAsyncComponent(() => import("./PbPropertyEditorBoolean-C7-iSAtn.js")),
|
|
8182
|
-
"multiline-text": () => defineAsyncComponent(() => import("./PbPropertyEditorMultilineText-
|
|
8182
|
+
"multiline-text": () => defineAsyncComponent(() => import("./PbPropertyEditorMultilineText-DHqDdVCb.js")),
|
|
8183
8183
|
"select": () => defineAsyncComponent(() => import("./PbPropertyEditorSelect-CWedbXJI.js")),
|
|
8184
|
-
"color": () => defineAsyncComponent(() => import("./PbPropertyEditorColor-
|
|
8185
|
-
"image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-
|
|
8186
|
-
"html": () => defineAsyncComponent(() => import("./PbPropertyEditorHtml-
|
|
8187
|
-
"youtube": () => defineAsyncComponent(() => import("./PbPropertyEditorYoutube-
|
|
8184
|
+
"color": () => defineAsyncComponent(() => import("./PbPropertyEditorColor-DHIK8xLM.js")),
|
|
8185
|
+
"image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-DaQ6AzHk.js")),
|
|
8186
|
+
"html": () => defineAsyncComponent(() => import("./PbPropertyEditorHtml-Jh4spLgs.js")),
|
|
8187
|
+
"youtube": () => defineAsyncComponent(() => import("./PbPropertyEditorYoutube-Dqi0T67b.js"))
|
|
8188
8188
|
};
|
|
8189
8189
|
};
|
|
8190
8190
|
const getPropertyValueOfParts = (parts, propertyName) => {
|
|
@@ -12538,7 +12538,7 @@ __publicField(_OpenAddWidgetModalCommand, "COMMAND_ID", "OpenAddWidgetModal");
|
|
|
12538
12538
|
let OpenAddWidgetModalCommand = _OpenAddWidgetModalCommand;
|
|
12539
12539
|
const openWidgetAddModal = (modal, args, callback) => {
|
|
12540
12540
|
modal.openModal({
|
|
12541
|
-
component: defineAsyncComponent(() => import("./PbWidgetAddModal-
|
|
12541
|
+
component: defineAsyncComponent(() => import("./PbWidgetAddModal-eVGTb1x1.js")),
|
|
12542
12542
|
style: {
|
|
12543
12543
|
width: "80%",
|
|
12544
12544
|
height: "80%",
|
|
@@ -12571,40 +12571,6 @@ const openWidgetAddModal = (modal, args, callback) => {
|
|
|
12571
12571
|
}
|
|
12572
12572
|
});
|
|
12573
12573
|
};
|
|
12574
|
-
const findInsertTargetAndIndex = (pageBuilder, partType) => {
|
|
12575
|
-
var _a, _b, _c;
|
|
12576
|
-
const selected = pageBuilder.context.getSelectedParts()[0];
|
|
12577
|
-
const page = pageBuilder.context.getSelectedPage();
|
|
12578
|
-
if (!page) return {};
|
|
12579
|
-
if (partType === SECTION_TYPE) {
|
|
12580
|
-
const section = pageBuilder.partManager.findNearestSection(selected);
|
|
12581
|
-
return {
|
|
12582
|
-
target: page,
|
|
12583
|
-
index: section ? page.children.indexOf(section) + 1 : (_a = page.children) == null ? void 0 : _a.length
|
|
12584
|
-
};
|
|
12585
|
-
} else if (partType === BLOCK_TYPE) {
|
|
12586
|
-
let section = pageBuilder.partManager.findNearestSection(selected);
|
|
12587
|
-
let block = pageBuilder.partManager.findNearestBlock(selected);
|
|
12588
|
-
if (!section) {
|
|
12589
|
-
section = page.children[page.children.length - 1];
|
|
12590
|
-
}
|
|
12591
|
-
return {
|
|
12592
|
-
target: section,
|
|
12593
|
-
index: block ? section.children.indexOf(block) + 1 : (_b = section.children) == null ? void 0 : _b.length
|
|
12594
|
-
};
|
|
12595
|
-
} else {
|
|
12596
|
-
let block = pageBuilder.partManager.findNearestBlock(selected);
|
|
12597
|
-
let widget = selected.parent.isWidget() ? selected.parent : selected;
|
|
12598
|
-
if (!block) {
|
|
12599
|
-
const section = page.children[page.children.length - 1];
|
|
12600
|
-
block = section.children[section.children.length - 1];
|
|
12601
|
-
}
|
|
12602
|
-
return {
|
|
12603
|
-
target: block,
|
|
12604
|
-
index: widget ? block.children.indexOf(widget) + 1 : (_c = block.children) == null ? void 0 : _c.length
|
|
12605
|
-
};
|
|
12606
|
-
}
|
|
12607
|
-
};
|
|
12608
12574
|
const createPartWithDefinition = (def, properties) => {
|
|
12609
12575
|
const part = createPart(def.partType, def.partName, def.initialProperties);
|
|
12610
12576
|
if (part && properties) {
|
|
@@ -13133,7 +13099,7 @@ const _PastePartCommand = class _PastePartCommand {
|
|
|
13133
13099
|
__publicField(this, "commandId", _PastePartCommand.COMMAND_ID);
|
|
13134
13100
|
}
|
|
13135
13101
|
async execute(pageBuilder) {
|
|
13136
|
-
var _a;
|
|
13102
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
13137
13103
|
const json = await navigator.clipboard.readText();
|
|
13138
13104
|
const object = JSON.parse(json);
|
|
13139
13105
|
if (object.partType === ROOT_TYPE) {
|
|
@@ -13201,7 +13167,7 @@ const _PastePartCommand = class _PastePartCommand {
|
|
|
13201
13167
|
else if (part.partType === WIDGET_TYPE && !pasteType) pasteType = WIDGET_TYPE;
|
|
13202
13168
|
});
|
|
13203
13169
|
if (!pasteType) return;
|
|
13204
|
-
const
|
|
13170
|
+
const partsToPaste = parts.map((part) => {
|
|
13205
13171
|
if (pasteType === SECTION_TYPE) {
|
|
13206
13172
|
if (part.partType === SECTION_TYPE) {
|
|
13207
13173
|
return part;
|
|
@@ -13232,11 +13198,76 @@ const _PastePartCommand = class _PastePartCommand {
|
|
|
13232
13198
|
return part;
|
|
13233
13199
|
}
|
|
13234
13200
|
}).filter(notNull);
|
|
13235
|
-
const
|
|
13236
|
-
const
|
|
13237
|
-
if (
|
|
13238
|
-
|
|
13201
|
+
const selectedPage = pageBuilder.context.getSelectedPage();
|
|
13202
|
+
const selected = pageBuilder.context.getSelectedParts()[0] || selectedPage;
|
|
13203
|
+
if (!selectedPage || !selected) return;
|
|
13204
|
+
let selectedWidget;
|
|
13205
|
+
if (selected && selected.isWidget()) selectedWidget = selected;
|
|
13206
|
+
if (selectedWidget && selectedWidget.isNestedWidget()) selectedWidget = selectedWidget.parent;
|
|
13207
|
+
let selectedBlock;
|
|
13208
|
+
if (selectedWidget) selectedBlock = selectedWidget.parent;
|
|
13209
|
+
else if (selected && selected.isBlock()) selectedBlock = selected;
|
|
13210
|
+
let selectedSection;
|
|
13211
|
+
if (selectedBlock) selectedSection = selectedBlock.parent;
|
|
13212
|
+
else if (selected && selected.isSection()) selectedSection = selected;
|
|
13213
|
+
let targetPartId;
|
|
13214
|
+
let targetIndex = -1;
|
|
13215
|
+
let partsToInsert;
|
|
13216
|
+
if (pasteType === SECTION_TYPE) {
|
|
13217
|
+
targetPartId = selectedPage.partId;
|
|
13218
|
+
targetIndex = selectedSection ? selectedPage.children.indexOf(selectedSection) + 1 : ((_b = selectedPage.children) == null ? void 0 : _b.length) || 0;
|
|
13219
|
+
partsToInsert = partsToPaste;
|
|
13220
|
+
} else if (pasteType === BLOCK_TYPE) {
|
|
13221
|
+
if (selectedSection) {
|
|
13222
|
+
targetPartId = selectedSection.partId;
|
|
13223
|
+
targetIndex = selectedBlock ? selectedSection.children.indexOf(selectedBlock) + 1 : ((_c = selectedSection.children) == null ? void 0 : _c.length) || 0;
|
|
13224
|
+
partsToInsert = partsToPaste;
|
|
13225
|
+
} else if ((_d = selectedPage.children) == null ? void 0 : _d.length) {
|
|
13226
|
+
selectedSection = selectedPage.children[selectedPage.children.length - 1];
|
|
13227
|
+
targetPartId = selectedSection.partId;
|
|
13228
|
+
targetIndex = ((_e = selectedSection.children) == null ? void 0 : _e.length) || 0;
|
|
13229
|
+
partsToInsert = partsToPaste;
|
|
13230
|
+
} else {
|
|
13231
|
+
const newSection = createSection(pageBuilder);
|
|
13232
|
+
if (!newSection) return;
|
|
13233
|
+
newSection.children = partsToPaste;
|
|
13234
|
+
targetPartId = selectedPage.partId;
|
|
13235
|
+
targetIndex = 0;
|
|
13236
|
+
partsToInsert = [newSection];
|
|
13237
|
+
}
|
|
13238
|
+
} else if (pasteType === WIDGET_TYPE) {
|
|
13239
|
+
if (selectedBlock) {
|
|
13240
|
+
targetPartId = selectedBlock.partId;
|
|
13241
|
+
targetIndex = selectedWidget ? selectedBlock.children.indexOf(selectedWidget) + 1 : ((_f = selectedBlock.children) == null ? void 0 : _f.length) || 0;
|
|
13242
|
+
partsToInsert = partsToPaste;
|
|
13243
|
+
} else if (selectedSection || ((_g = selectedPage.children) == null ? void 0 : _g.length)) {
|
|
13244
|
+
if (!selectedSection) selectedSection = selectedPage.children[selectedPage.children.length - 1];
|
|
13245
|
+
if ((_h = selectedSection.children) == null ? void 0 : _h.length) {
|
|
13246
|
+
selectedBlock = selectedSection.children[selectedSection.children.length - 1];
|
|
13247
|
+
targetPartId = selectedBlock.partId;
|
|
13248
|
+
targetIndex = ((_i = selectedBlock.children) == null ? void 0 : _i.length) || 0;
|
|
13249
|
+
partsToInsert = partsToPaste;
|
|
13250
|
+
} else {
|
|
13251
|
+
const newBlock = createBlock(pageBuilder);
|
|
13252
|
+
if (!newBlock) return;
|
|
13253
|
+
newBlock.children = partsToPaste;
|
|
13254
|
+
targetPartId = selectedSection.partId;
|
|
13255
|
+
targetIndex = 0;
|
|
13256
|
+
partsToInsert = [newBlock];
|
|
13257
|
+
}
|
|
13258
|
+
} else {
|
|
13259
|
+
const newBlock = createBlock(pageBuilder);
|
|
13260
|
+
const newSection = createSection(pageBuilder);
|
|
13261
|
+
if (!newBlock || !newSection) return;
|
|
13262
|
+
newSection.children = [newBlock];
|
|
13263
|
+
newBlock.children = partsToPaste;
|
|
13264
|
+
targetPartId = selectedPage.partId;
|
|
13265
|
+
targetIndex = 0;
|
|
13266
|
+
partsToInsert = [newSection];
|
|
13267
|
+
}
|
|
13239
13268
|
}
|
|
13269
|
+
if (!targetPartId || targetIndex < 0 || !partsToInsert) return;
|
|
13270
|
+
insertParts(pageBuilder, targetPartId, targetIndex, partsToInsert, false);
|
|
13240
13271
|
}
|
|
13241
13272
|
}
|
|
13242
13273
|
};
|
|
@@ -13641,8 +13672,8 @@ class PageBuilderContextImpl {
|
|
|
13641
13672
|
const pages = this.model.rootPart.children;
|
|
13642
13673
|
let part = this.selection[0];
|
|
13643
13674
|
if (!part) return pages && pages[0];
|
|
13644
|
-
while (part
|
|
13645
|
-
if (part.
|
|
13675
|
+
while (part) {
|
|
13676
|
+
if (part.isPage()) return part;
|
|
13646
13677
|
part = part.parent;
|
|
13647
13678
|
}
|
|
13648
13679
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B, b, M, c, d, e, _, a, f, g, h, i, j, k, l, m, n, R, o, S, p, W, q, r, t, v, x, y, z, A, C } from "./index-
|
|
1
|
+
import { B, b, M, c, d, e, _, a, f, g, h, i, j, k, l, m, n, R, o, S, p, W, q, r, t, v, x, y, z, A, C } from "./index-BtttVLpv.js";
|
|
2
2
|
export {
|
|
3
3
|
B as BLOCK_TYPE,
|
|
4
4
|
b as Block,
|
|
@@ -12572,40 +12572,6 @@ ${_html.style}
|
|
|
12572
12572
|
}
|
|
12573
12573
|
});
|
|
12574
12574
|
};
|
|
12575
|
-
const findInsertTargetAndIndex = (pageBuilder, partType) => {
|
|
12576
|
-
var _a, _b, _c;
|
|
12577
|
-
const selected = pageBuilder.context.getSelectedParts()[0];
|
|
12578
|
-
const page = pageBuilder.context.getSelectedPage();
|
|
12579
|
-
if (!page) return {};
|
|
12580
|
-
if (partType === SECTION_TYPE) {
|
|
12581
|
-
const section = pageBuilder.partManager.findNearestSection(selected);
|
|
12582
|
-
return {
|
|
12583
|
-
target: page,
|
|
12584
|
-
index: section ? page.children.indexOf(section) + 1 : (_a = page.children) == null ? void 0 : _a.length
|
|
12585
|
-
};
|
|
12586
|
-
} else if (partType === BLOCK_TYPE) {
|
|
12587
|
-
let section = pageBuilder.partManager.findNearestSection(selected);
|
|
12588
|
-
let block = pageBuilder.partManager.findNearestBlock(selected);
|
|
12589
|
-
if (!section) {
|
|
12590
|
-
section = page.children[page.children.length - 1];
|
|
12591
|
-
}
|
|
12592
|
-
return {
|
|
12593
|
-
target: section,
|
|
12594
|
-
index: block ? section.children.indexOf(block) + 1 : (_b = section.children) == null ? void 0 : _b.length
|
|
12595
|
-
};
|
|
12596
|
-
} else {
|
|
12597
|
-
let block = pageBuilder.partManager.findNearestBlock(selected);
|
|
12598
|
-
let widget = selected.parent.isWidget() ? selected.parent : selected;
|
|
12599
|
-
if (!block) {
|
|
12600
|
-
const section = page.children[page.children.length - 1];
|
|
12601
|
-
block = section.children[section.children.length - 1];
|
|
12602
|
-
}
|
|
12603
|
-
return {
|
|
12604
|
-
target: block,
|
|
12605
|
-
index: widget ? block.children.indexOf(widget) + 1 : (_c = block.children) == null ? void 0 : _c.length
|
|
12606
|
-
};
|
|
12607
|
-
}
|
|
12608
|
-
};
|
|
12609
12575
|
const createPartWithDefinition = (def, properties) => {
|
|
12610
12576
|
const part = createPart(def.partType, def.partName, def.initialProperties);
|
|
12611
12577
|
if (part && properties) {
|
|
@@ -13134,7 +13100,7 @@ ${_html.style}
|
|
|
13134
13100
|
__publicField(this, "commandId", _PastePartCommand.COMMAND_ID);
|
|
13135
13101
|
}
|
|
13136
13102
|
async execute(pageBuilder) {
|
|
13137
|
-
var _a;
|
|
13103
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
13138
13104
|
const json = await navigator.clipboard.readText();
|
|
13139
13105
|
const object = JSON.parse(json);
|
|
13140
13106
|
if (object.partType === ROOT_TYPE) {
|
|
@@ -13202,7 +13168,7 @@ ${_html.style}
|
|
|
13202
13168
|
else if (part.partType === WIDGET_TYPE && !pasteType) pasteType = WIDGET_TYPE;
|
|
13203
13169
|
});
|
|
13204
13170
|
if (!pasteType) return;
|
|
13205
|
-
const
|
|
13171
|
+
const partsToPaste = parts.map((part) => {
|
|
13206
13172
|
if (pasteType === SECTION_TYPE) {
|
|
13207
13173
|
if (part.partType === SECTION_TYPE) {
|
|
13208
13174
|
return part;
|
|
@@ -13233,11 +13199,76 @@ ${_html.style}
|
|
|
13233
13199
|
return part;
|
|
13234
13200
|
}
|
|
13235
13201
|
}).filter(bluesea.notNull);
|
|
13236
|
-
const
|
|
13237
|
-
const
|
|
13238
|
-
if (
|
|
13239
|
-
|
|
13202
|
+
const selectedPage = pageBuilder.context.getSelectedPage();
|
|
13203
|
+
const selected = pageBuilder.context.getSelectedParts()[0] || selectedPage;
|
|
13204
|
+
if (!selectedPage || !selected) return;
|
|
13205
|
+
let selectedWidget;
|
|
13206
|
+
if (selected && selected.isWidget()) selectedWidget = selected;
|
|
13207
|
+
if (selectedWidget && selectedWidget.isNestedWidget()) selectedWidget = selectedWidget.parent;
|
|
13208
|
+
let selectedBlock;
|
|
13209
|
+
if (selectedWidget) selectedBlock = selectedWidget.parent;
|
|
13210
|
+
else if (selected && selected.isBlock()) selectedBlock = selected;
|
|
13211
|
+
let selectedSection;
|
|
13212
|
+
if (selectedBlock) selectedSection = selectedBlock.parent;
|
|
13213
|
+
else if (selected && selected.isSection()) selectedSection = selected;
|
|
13214
|
+
let targetPartId;
|
|
13215
|
+
let targetIndex = -1;
|
|
13216
|
+
let partsToInsert;
|
|
13217
|
+
if (pasteType === SECTION_TYPE) {
|
|
13218
|
+
targetPartId = selectedPage.partId;
|
|
13219
|
+
targetIndex = selectedSection ? selectedPage.children.indexOf(selectedSection) + 1 : ((_b = selectedPage.children) == null ? void 0 : _b.length) || 0;
|
|
13220
|
+
partsToInsert = partsToPaste;
|
|
13221
|
+
} else if (pasteType === BLOCK_TYPE) {
|
|
13222
|
+
if (selectedSection) {
|
|
13223
|
+
targetPartId = selectedSection.partId;
|
|
13224
|
+
targetIndex = selectedBlock ? selectedSection.children.indexOf(selectedBlock) + 1 : ((_c = selectedSection.children) == null ? void 0 : _c.length) || 0;
|
|
13225
|
+
partsToInsert = partsToPaste;
|
|
13226
|
+
} else if ((_d = selectedPage.children) == null ? void 0 : _d.length) {
|
|
13227
|
+
selectedSection = selectedPage.children[selectedPage.children.length - 1];
|
|
13228
|
+
targetPartId = selectedSection.partId;
|
|
13229
|
+
targetIndex = ((_e = selectedSection.children) == null ? void 0 : _e.length) || 0;
|
|
13230
|
+
partsToInsert = partsToPaste;
|
|
13231
|
+
} else {
|
|
13232
|
+
const newSection = createSection(pageBuilder);
|
|
13233
|
+
if (!newSection) return;
|
|
13234
|
+
newSection.children = partsToPaste;
|
|
13235
|
+
targetPartId = selectedPage.partId;
|
|
13236
|
+
targetIndex = 0;
|
|
13237
|
+
partsToInsert = [newSection];
|
|
13238
|
+
}
|
|
13239
|
+
} else if (pasteType === WIDGET_TYPE) {
|
|
13240
|
+
if (selectedBlock) {
|
|
13241
|
+
targetPartId = selectedBlock.partId;
|
|
13242
|
+
targetIndex = selectedWidget ? selectedBlock.children.indexOf(selectedWidget) + 1 : ((_f = selectedBlock.children) == null ? void 0 : _f.length) || 0;
|
|
13243
|
+
partsToInsert = partsToPaste;
|
|
13244
|
+
} else if (selectedSection || ((_g = selectedPage.children) == null ? void 0 : _g.length)) {
|
|
13245
|
+
if (!selectedSection) selectedSection = selectedPage.children[selectedPage.children.length - 1];
|
|
13246
|
+
if ((_h = selectedSection.children) == null ? void 0 : _h.length) {
|
|
13247
|
+
selectedBlock = selectedSection.children[selectedSection.children.length - 1];
|
|
13248
|
+
targetPartId = selectedBlock.partId;
|
|
13249
|
+
targetIndex = ((_i = selectedBlock.children) == null ? void 0 : _i.length) || 0;
|
|
13250
|
+
partsToInsert = partsToPaste;
|
|
13251
|
+
} else {
|
|
13252
|
+
const newBlock = createBlock(pageBuilder);
|
|
13253
|
+
if (!newBlock) return;
|
|
13254
|
+
newBlock.children = partsToPaste;
|
|
13255
|
+
targetPartId = selectedSection.partId;
|
|
13256
|
+
targetIndex = 0;
|
|
13257
|
+
partsToInsert = [newBlock];
|
|
13258
|
+
}
|
|
13259
|
+
} else {
|
|
13260
|
+
const newBlock = createBlock(pageBuilder);
|
|
13261
|
+
const newSection = createSection(pageBuilder);
|
|
13262
|
+
if (!newBlock || !newSection) return;
|
|
13263
|
+
newSection.children = [newBlock];
|
|
13264
|
+
newBlock.children = partsToPaste;
|
|
13265
|
+
targetPartId = selectedPage.partId;
|
|
13266
|
+
targetIndex = 0;
|
|
13267
|
+
partsToInsert = [newSection];
|
|
13268
|
+
}
|
|
13240
13269
|
}
|
|
13270
|
+
if (!targetPartId || targetIndex < 0 || !partsToInsert) return;
|
|
13271
|
+
insertParts(pageBuilder, targetPartId, targetIndex, partsToInsert, false);
|
|
13241
13272
|
}
|
|
13242
13273
|
}
|
|
13243
13274
|
};
|
|
@@ -13642,8 +13673,8 @@ ${_html.style}
|
|
|
13642
13673
|
const pages = this.model.rootPart.children;
|
|
13643
13674
|
let part = this.selection[0];
|
|
13644
13675
|
if (!part) return pages && pages[0];
|
|
13645
|
-
while (part
|
|
13646
|
-
if (part.
|
|
13676
|
+
while (part) {
|
|
13677
|
+
if (part.isPage()) return part;
|
|
13647
13678
|
part = part.parent;
|
|
13648
13679
|
}
|
|
13649
13680
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@g1cloud/page-builder-editor",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.0-alpha.
|
|
4
|
+
"version": "1.0.0-alpha.45",
|
|
5
5
|
"engins": {
|
|
6
6
|
"node": ">= 20.0.0"
|
|
7
7
|
},
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"author": "zag@g1project.net",
|
|
17
17
|
"license": "LicenseRef-LICENSE",
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"@g1cloud/bluesea": "5.0.0-alpha.
|
|
19
|
+
"@g1cloud/bluesea": "5.0.0-alpha.84",
|
|
20
20
|
"vue3-youtube": "^0.1.9"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"vue-router": "^4.4.3",
|
|
31
31
|
"vue3-click-away": "^1.2.4",
|
|
32
32
|
"yjs": "^13.6.14",
|
|
33
|
-
"@g1cloud/page-builder-viewer": "1.0.0-alpha.
|
|
33
|
+
"@g1cloud/page-builder-viewer": "1.0.0-alpha.45"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/node": "^20.12.7",
|