@g1cloud/page-builder-editor 1.0.0-alpha.21 → 1.0.0-alpha.23
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/css/canvas.scss +16 -136
- package/css/{canvas-block.scss → page-block.scss} +15 -3
- package/css/page-builder-editor.scss +6 -14
- package/css/{canvas-page.scss → page-page.scss} +23 -16
- package/css/{canvas-section.scss → page-section.scss} +15 -3
- package/css/{canvas-widget.scss → page-widget.scss} +15 -3
- package/css/page.scss +79 -0
- package/css/property-editor-youtube.scss +16 -0
- package/dist/PageBuilderEditor.vue.d.ts +4 -4
- package/dist/PbHtmlEditorModal-dDR38rNy.js +187 -0
- package/dist/{PbPropertyEditorColor-BFMkFOYX.js → PbPropertyEditorColor-B6yhXmGL.js} +1 -1
- package/dist/{PbPropertyEditorHtml-DZw8qbJH.js → PbPropertyEditorHtml-fgIO3jaY.js} +4 -3
- package/dist/{PbPropertyEditorImage-BQhiQyNM.js → PbPropertyEditorImage-6WNkin_o.js} +3 -3
- package/dist/{PbPropertyEditorMultilineText-CT3vTbYY.js → PbPropertyEditorMultilineText-3hJVRryR.js} +1 -1
- package/dist/{PbPropertyEditorText-DmM_LMjC.js → PbPropertyEditorText-DZA84Sn1.js} +1 -1
- package/dist/PbPropertyEditorYoutube-DtcxO2uZ.js +39 -0
- package/dist/{PbScreenSelectModal-DDATc9n1.js → PbScreenSelectModal-CnI1IsvW.js} +3 -4
- package/dist/{PbWidgetAddModal-BoYfb0dm.js → PbWidgetAddModal-DO1t-xsl.js} +19 -21
- package/dist/PbYoutubeModal-DFb6CQyW.js +68 -0
- package/dist/components/canvas/PbCanvas.vue.d.ts +1 -1
- package/dist/components/depart/PbLoginDepart.vue.d.ts +3 -3
- package/dist/components/menu/PbMenu.vue.d.ts +3 -3
- package/dist/components/menu/PbToolbar.vue.d.ts +3 -3
- package/dist/components/menu/PbToolbarButton.vue.d.ts +3 -3
- package/dist/components/menu/PbToolbarButtonGroup.vue.d.ts +3 -3
- package/dist/components/modal/PbHtmlEditorModal.vue.d.ts +7 -4
- package/dist/components/modal/PbPartAddModal.vue.d.ts +4 -4
- package/dist/components/modal/PbScreenSelectModal.vue.d.ts +2 -2
- package/dist/components/modal/PbWidgetAddModal.vue.d.ts +4 -4
- package/dist/components/modal/PbYoutubeModal.vue.d.ts +19 -0
- package/dist/components/navigator/PbNavigator.vue.d.ts +1 -1
- package/dist/components/part/PbAddWidgetButton.vue.d.ts +1 -1
- package/dist/components/part/PbBlock.vue.d.ts +3 -3
- package/dist/components/part/PbContainerWidget.vue.d.ts +19 -0
- package/dist/components/part/PbPage.vue.d.ts +5 -5
- package/dist/components/part/PbPageFrame.vue.d.ts +21 -0
- package/dist/components/part/PbSection.vue.d.ts +3 -3
- package/dist/components/part/PbWidget.vue.d.ts +3 -3
- package/dist/components/sidebar/PbSidebar.vue.d.ts +1 -1
- package/dist/components/sidebar/PbSidebarProperties.vue.d.ts +1 -1
- package/dist/components/sidebar/PbSidebarPropertyEditor.vue.d.ts +3 -3
- package/dist/components/sidebar/PbSidebarPropertyGroupEditor.vue.d.ts +3 -3
- package/dist/components/sidebar/property/PbPropertyEditorColor.vue.d.ts +4 -4
- package/dist/components/sidebar/property/PbPropertyEditorHtml.vue.d.ts +4 -4
- package/dist/components/sidebar/property/PbPropertyEditorImage.vue.d.ts +7 -6
- package/dist/components/sidebar/property/PbPropertyEditorMultilineText.vue.d.ts +4 -4
- package/dist/components/sidebar/property/PbPropertyEditorReadonlyText.vue.d.ts +3 -3
- package/dist/components/sidebar/property/PbPropertyEditorSelect.vue.d.ts +4 -4
- package/dist/components/sidebar/property/PbPropertyEditorText.vue.d.ts +4 -4
- package/dist/components/sidebar/property/PbPropertyEditorYoutube.vue.d.ts +23 -0
- package/dist/components/sidebar/property/PbPropertyGroupEditorBackground.vue.d.ts +3 -3
- package/dist/components/sidebar/property/PbPropertyGroupEditorBorder.vue.d.ts +3 -3
- package/dist/components/sidebar/property/PbPropertyGroupEditorMargin.vue.d.ts +3 -3
- package/dist/components/sidebar/property/PbPropertyGroupEditorPadding.vue.d.ts +3 -3
- package/dist/components/sidebar/property/PbPropertyGroupEditorPosition.vue.d.ts +3 -3
- package/dist/components/sidebar/property/PbPropertyGroupEditorSize.vue.d.ts +3 -3
- package/dist/components/ui/PbColorPicker.vue.d.ts +20 -7
- package/dist/{index-Cr-_-n9T.js → index-JVyoOgGq.js} +1530 -1262
- package/dist/model/context.d.ts +6 -0
- package/dist/model/default-part-property-group.d.ts +1 -0
- package/dist/model/page-builder-editor.d.ts +4 -0
- package/dist/model/page-builder-util.d.ts +2 -0
- package/dist/model/part-definintion.d.ts +1 -1
- package/dist/model/part-manager.d.ts +2 -0
- package/dist/model/part-property.d.ts +0 -2
- package/dist/page-builder-editor.js +19 -16
- package/dist/page-builder-editor.umd.cjs +1831 -1408
- package/package.json +8 -6
- package/dist/PbHtmlEditorModal-aaecwH7V.js +0 -131
- package/dist/components/canvas/PbCanvasFrame.vue.d.ts +0 -2
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
-
var __publicField = (obj, key, value) =>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import { ref, defineComponent, openBlock, createElementBlock, createCommentVNode, computed, mergeProps, toDisplayString, onMounted, onBeforeUnmount, provide, inject, watch, createBlock as createBlock$1, resolveDynamicComponent, normalizeProps, createElementVNode, normalizeClass, Fragment, renderList, reactive, defineAsyncComponent, withDirectives, unref, createVNode, normalizeStyle, resolveComponent, vModelText, resolveDirective, withModifiers, renderSlot, guardReactiveProps, markRaw, Teleport, toHandlers } from "vue";
|
|
8
|
-
import { notNull, BSTextInput, vClickOutside, useModal, useContextMenu, BSSelect, BSTree } from "@g1cloud/bluesea";
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
+
import { ref, defineComponent, computed, openBlock, createElementBlock, normalizeStyle, createElementVNode, createCommentVNode, toDisplayString, onMounted, onBeforeUnmount, createBlock as createBlock$1, unref, provide, inject, watch, Fragment, renderList, resolveDynamicComponent, normalizeProps, mergeProps, normalizeClass, reactive, defineAsyncComponent, withDirectives, createVNode, resolveComponent, vModelText, resolveDirective, withModifiers, renderSlot, guardReactiveProps, markRaw, toHandlers, Teleport } from "vue";
|
|
5
|
+
import { notNull, BSTextInput, vClickOutside, useModal, BSSelect, BSTree, useContextMenu } from "@g1cloud/bluesea";
|
|
6
|
+
import YouTube from "vue3-youtube";
|
|
9
7
|
const create$5 = () => /* @__PURE__ */ new Map();
|
|
10
8
|
const copy = (m) => {
|
|
11
9
|
const r = create$5();
|
|
@@ -635,10 +633,8 @@ const computeNoColorLoggingArgs = (args) => {
|
|
|
635
633
|
let i = 0;
|
|
636
634
|
for (; i < args.length; i++) {
|
|
637
635
|
const arg = args[i];
|
|
638
|
-
if (arg === void 0)
|
|
639
|
-
|
|
640
|
-
else if (arg.constructor === String || arg.constructor === Number)
|
|
641
|
-
;
|
|
636
|
+
if (arg === void 0) ;
|
|
637
|
+
else if (arg.constructor === String || arg.constructor === Number) ;
|
|
642
638
|
else if (arg.constructor === Object) {
|
|
643
639
|
logArgs.push(JSON.stringify(arg));
|
|
644
640
|
}
|
|
@@ -1984,8 +1980,7 @@ class UndoManager extends ObservableV2 {
|
|
|
1984
1980
|
ytypes = isArray(ytypes) ? ytypes : [ytypes];
|
|
1985
1981
|
ytypes.forEach((ytype) => {
|
|
1986
1982
|
if (this.scope.every((yt) => yt !== ytype)) {
|
|
1987
|
-
if (ytype.doc !== this.doc)
|
|
1988
|
-
warn("[yjs#509] Not same Y.Doc");
|
|
1983
|
+
if (ytype.doc !== this.doc) warn("[yjs#509] Not same Y.Doc");
|
|
1989
1984
|
this.scope.push(ytype);
|
|
1990
1985
|
}
|
|
1991
1986
|
});
|
|
@@ -3460,8 +3455,7 @@ const minimizeAttributeChanges = (currPos, attributes) => {
|
|
|
3460
3455
|
] ?? null,
|
|
3461
3456
|
/** @type {ContentFormat} */
|
|
3462
3457
|
currPos.right.content.value
|
|
3463
|
-
))
|
|
3464
|
-
;
|
|
3458
|
+
)) ;
|
|
3465
3459
|
else {
|
|
3466
3460
|
break;
|
|
3467
3461
|
}
|
|
@@ -3515,41 +3509,40 @@ const formatText = (transaction, parent, currPos, length2, attributes) => {
|
|
|
3515
3509
|
const ownClientId = doc.clientID;
|
|
3516
3510
|
minimizeAttributeChanges(currPos, attributes);
|
|
3517
3511
|
const negatedAttributes = insertAttributes(transaction, parent, currPos, attributes);
|
|
3518
|
-
iterationLoop:
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
if (attr
|
|
3529
|
-
|
|
3530
|
-
negatedAttributes.delete(key);
|
|
3531
|
-
} else {
|
|
3532
|
-
if (length2 === 0) {
|
|
3533
|
-
break iterationLoop;
|
|
3534
|
-
}
|
|
3535
|
-
negatedAttributes.set(key, value);
|
|
3536
|
-
}
|
|
3537
|
-
currPos.right.delete(transaction);
|
|
3512
|
+
iterationLoop: while (currPos.right !== null && (length2 > 0 || negatedAttributes.size > 0 && (currPos.right.deleted || currPos.right.content.constructor === ContentFormat))) {
|
|
3513
|
+
if (!currPos.right.deleted) {
|
|
3514
|
+
switch (currPos.right.content.constructor) {
|
|
3515
|
+
case ContentFormat: {
|
|
3516
|
+
const { key, value } = (
|
|
3517
|
+
/** @type {ContentFormat} */
|
|
3518
|
+
currPos.right.content
|
|
3519
|
+
);
|
|
3520
|
+
const attr = attributes[key];
|
|
3521
|
+
if (attr !== void 0) {
|
|
3522
|
+
if (equalAttrs(attr, value)) {
|
|
3523
|
+
negatedAttributes.delete(key);
|
|
3538
3524
|
} else {
|
|
3539
|
-
|
|
3525
|
+
if (length2 === 0) {
|
|
3526
|
+
break iterationLoop;
|
|
3527
|
+
}
|
|
3528
|
+
negatedAttributes.set(key, value);
|
|
3540
3529
|
}
|
|
3541
|
-
|
|
3530
|
+
currPos.right.delete(transaction);
|
|
3531
|
+
} else {
|
|
3532
|
+
currPos.currentAttributes.set(key, value);
|
|
3542
3533
|
}
|
|
3543
|
-
|
|
3544
|
-
if (length2 < currPos.right.length) {
|
|
3545
|
-
getItemCleanStart(transaction, createID(currPos.right.id.client, currPos.right.id.clock + length2));
|
|
3546
|
-
}
|
|
3547
|
-
length2 -= currPos.right.length;
|
|
3548
|
-
break;
|
|
3534
|
+
break;
|
|
3549
3535
|
}
|
|
3536
|
+
default:
|
|
3537
|
+
if (length2 < currPos.right.length) {
|
|
3538
|
+
getItemCleanStart(transaction, createID(currPos.right.id.client, currPos.right.id.clock + length2));
|
|
3539
|
+
}
|
|
3540
|
+
length2 -= currPos.right.length;
|
|
3541
|
+
break;
|
|
3550
3542
|
}
|
|
3551
|
-
currPos.forward();
|
|
3552
3543
|
}
|
|
3544
|
+
currPos.forward();
|
|
3545
|
+
}
|
|
3553
3546
|
if (length2 > 0) {
|
|
3554
3547
|
let newlines = "";
|
|
3555
3548
|
for (; length2 > 0; length2--) {
|
|
@@ -3848,8 +3841,7 @@ class YTextEvent extends YEvent {
|
|
|
3848
3841
|
retain = 0;
|
|
3849
3842
|
break;
|
|
3850
3843
|
}
|
|
3851
|
-
if (op)
|
|
3852
|
-
delta.push(op);
|
|
3844
|
+
if (op) delta.push(op);
|
|
3853
3845
|
action = null;
|
|
3854
3846
|
}
|
|
3855
3847
|
};
|
|
@@ -5864,8 +5856,7 @@ const redoItem = (transaction, item, redoitems, itemsToDelete, ignoreRemoteMapCh
|
|
|
5864
5856
|
left = item;
|
|
5865
5857
|
while (left !== null && left.right !== null && (left.right.redone || isDeleted(itemsToDelete, left.right.id) || isDeletedByUndoStack(um.undoStack, left.right.id) || isDeletedByUndoStack(um.redoStack, left.right.id))) {
|
|
5866
5858
|
left = left.right;
|
|
5867
|
-
while (left.redone)
|
|
5868
|
-
left = getItemCleanStart(transaction, left.redone);
|
|
5859
|
+
while (left.redone) left = getItemCleanStart(transaction, left.redone);
|
|
5869
5860
|
}
|
|
5870
5861
|
if (left && left.right !== null) {
|
|
5871
5862
|
return null;
|
|
@@ -6642,10 +6633,7 @@ const PageBuilderEditorEvent = {
|
|
|
6642
6633
|
};
|
|
6643
6634
|
var __defProp2 = Object.defineProperty;
|
|
6644
6635
|
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6645
|
-
var __publicField2 = (obj, key, value) =>
|
|
6646
|
-
__defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6647
|
-
return value;
|
|
6648
|
-
};
|
|
6636
|
+
var __publicField2 = (obj, key, value) => __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6649
6637
|
const PART_ID_KEY$1 = "partId";
|
|
6650
6638
|
const ROOT_TYPE$1 = "Root";
|
|
6651
6639
|
const PAGE_TYPE$1 = "Page";
|
|
@@ -6691,89 +6679,111 @@ class Part {
|
|
|
6691
6679
|
return propertyName === PART_ID_KEY$1 ? this.partId : (_a = this.properties) == null ? void 0 : _a[propertyName];
|
|
6692
6680
|
}
|
|
6693
6681
|
getClassNames() {
|
|
6694
|
-
|
|
6682
|
+
var _a;
|
|
6683
|
+
return ((_a = this.properties) == null ? void 0 : _a.classNames) || "";
|
|
6684
|
+
}
|
|
6685
|
+
getAlignStyleValue(align) {
|
|
6686
|
+
if (align === "left") return "flex-start";
|
|
6687
|
+
if (align === "right") return "flex-end";
|
|
6688
|
+
return "center";
|
|
6695
6689
|
}
|
|
6696
6690
|
getStyles() {
|
|
6697
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J;
|
|
6691
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P;
|
|
6698
6692
|
const style = {};
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
style.
|
|
6702
|
-
} else
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
|
|
6693
|
+
const align = ((_a = this.properties) == null ? void 0 : _a.align) || "center";
|
|
6694
|
+
if (this.isWidget()) {
|
|
6695
|
+
style.alignSelf = this.getAlignStyleValue(align);
|
|
6696
|
+
} else {
|
|
6697
|
+
if (((_b = this.properties) == null ? void 0 : _b.direction) === "horizontal") {
|
|
6698
|
+
style.display = "flex";
|
|
6699
|
+
style.flexDirection = "row";
|
|
6700
|
+
style.justifyContent = this.getAlignStyleValue(align);
|
|
6701
|
+
} else if (((_c = this.properties) == null ? void 0 : _c.direction) === "vertical") {
|
|
6702
|
+
style.display = "flex";
|
|
6703
|
+
style.flexDirection = "column";
|
|
6704
|
+
style.alignItems = this.getAlignStyleValue(align);
|
|
6705
|
+
}
|
|
6706
|
+
}
|
|
6707
|
+
if (((_d = this.properties) == null ? void 0 : _d.wrap) === "wrap") {
|
|
6707
6708
|
style.flexWrap = "wrap";
|
|
6708
6709
|
}
|
|
6709
|
-
if ((
|
|
6710
|
-
|
|
6711
|
-
if ((
|
|
6712
|
-
|
|
6713
|
-
if ((
|
|
6714
|
-
|
|
6715
|
-
if ((
|
|
6716
|
-
|
|
6717
|
-
if ((
|
|
6718
|
-
|
|
6719
|
-
if ((
|
|
6720
|
-
|
|
6721
|
-
if ((
|
|
6722
|
-
|
|
6723
|
-
if ((
|
|
6724
|
-
|
|
6725
|
-
if ((
|
|
6726
|
-
|
|
6727
|
-
if ((
|
|
6728
|
-
|
|
6729
|
-
if ((
|
|
6730
|
-
|
|
6731
|
-
if ((
|
|
6732
|
-
|
|
6733
|
-
if ((
|
|
6734
|
-
|
|
6735
|
-
if ((
|
|
6736
|
-
|
|
6737
|
-
if ((
|
|
6738
|
-
|
|
6739
|
-
if ((
|
|
6740
|
-
style.height = this.properties.height;
|
|
6741
|
-
if ((_t = this.properties) == null ? void 0 : _t.backgroundColor)
|
|
6742
|
-
style.backgroundColor = this.properties.backgroundColor;
|
|
6743
|
-
if ((_u = this.properties) == null ? void 0 : _u.borderLeftWidth)
|
|
6744
|
-
style.borderLeftWidth = this.properties.borderLeftWidth;
|
|
6745
|
-
if ((_v = this.properties) == null ? void 0 : _v.borderRightWidth)
|
|
6746
|
-
style.borderRightWidth = this.properties.borderRightWidth;
|
|
6747
|
-
if ((_w = this.properties) == null ? void 0 : _w.borderTopWidth)
|
|
6748
|
-
style.borderTopWidth = this.properties.borderTopWidth;
|
|
6749
|
-
if ((_x = this.properties) == null ? void 0 : _x.borderBottomWidth)
|
|
6750
|
-
style.borderBottomWidth = this.properties.borderBottomWidth;
|
|
6751
|
-
if ((_y = this.properties) == null ? void 0 : _y.borderTopLeftRadius)
|
|
6752
|
-
style.borderTopLeftRadius = this.properties.borderTopLeftRadius;
|
|
6753
|
-
if ((_z = this.properties) == null ? void 0 : _z.borderTopRightRadius)
|
|
6754
|
-
style.borderTopRightRadius = this.properties.borderTopRightRadius;
|
|
6755
|
-
if ((_A = this.properties) == null ? void 0 : _A.borderBottomLeftRadius)
|
|
6756
|
-
style.borderBottomLeftRadius = this.properties.borderBottomLeftRadius;
|
|
6757
|
-
if ((_B = this.properties) == null ? void 0 : _B.borderBottomRightRadius)
|
|
6758
|
-
style.borderBottomRightRadius = this.properties.borderBottomRightRadius;
|
|
6759
|
-
if (((_C = this.properties) == null ? void 0 : _C.borderColor) && style.borderLeftWidth) {
|
|
6710
|
+
if ((_e = this.properties) == null ? void 0 : _e.margin) style.margin = this.properties.margin;
|
|
6711
|
+
if ((_f = this.properties) == null ? void 0 : _f.marginLeft) style.marginLeft = this.properties.marginLeft;
|
|
6712
|
+
if ((_g = this.properties) == null ? void 0 : _g.marginRight) style.marginRight = this.properties.marginRight;
|
|
6713
|
+
if ((_h = this.properties) == null ? void 0 : _h.marginTop) style.marginTop = this.properties.marginTop;
|
|
6714
|
+
if ((_i = this.properties) == null ? void 0 : _i.marginBottom) style.marginBottom = this.properties.marginBottom;
|
|
6715
|
+
if ((_j = this.properties) == null ? void 0 : _j.padding) style.padding = this.properties.padding;
|
|
6716
|
+
if ((_k = this.properties) == null ? void 0 : _k.paddingLeft) style.paddingLeft = this.properties.paddingLeft;
|
|
6717
|
+
if ((_l = this.properties) == null ? void 0 : _l.paddingRight) style.paddingRight = this.properties.paddingRight;
|
|
6718
|
+
if ((_m = this.properties) == null ? void 0 : _m.paddingTop) style.paddingTop = this.properties.paddingTop;
|
|
6719
|
+
if ((_n = this.properties) == null ? void 0 : _n.paddingBottom) style.paddingBottom = this.properties.paddingBottom;
|
|
6720
|
+
if ((_o = this.properties) == null ? void 0 : _o.left) style.left = this.properties.left;
|
|
6721
|
+
if ((_p = this.properties) == null ? void 0 : _p.right) style.right = this.properties.right;
|
|
6722
|
+
if ((_q = this.properties) == null ? void 0 : _q.top) style.top = this.properties.top;
|
|
6723
|
+
if ((_r = this.properties) == null ? void 0 : _r.bottom) style.bottom = this.properties.bottom;
|
|
6724
|
+
if ((_s = this.properties) == null ? void 0 : _s.width) style.width = this.properties.width;
|
|
6725
|
+
if ((_t = this.properties) == null ? void 0 : _t.height) style.height = this.properties.height;
|
|
6726
|
+
if ((_u = this.properties) == null ? void 0 : _u.maxWidth) style.width = this.properties.maxWidth;
|
|
6727
|
+
if ((_v = this.properties) == null ? void 0 : _v.maxHeight) style.height = this.properties.maxHeight;
|
|
6728
|
+
if ((_w = this.properties) == null ? void 0 : _w.minWidth) style.width = this.properties.minWidth;
|
|
6729
|
+
if ((_x = this.properties) == null ? void 0 : _x.minHeight) style.height = this.properties.minHeight;
|
|
6730
|
+
if ((_y = this.properties) == null ? void 0 : _y.textAlign) style.textAlign = this.properties.textAlign;
|
|
6731
|
+
if ((_z = this.properties) == null ? void 0 : _z.backgroundColor) style.backgroundColor = this.properties.backgroundColor;
|
|
6732
|
+
if ((_A = this.properties) == null ? void 0 : _A.borderLeftWidth) style.borderLeftWidth = this.properties.borderLeftWidth;
|
|
6733
|
+
if ((_B = this.properties) == null ? void 0 : _B.borderRightWidth) style.borderRightWidth = this.properties.borderRightWidth;
|
|
6734
|
+
if ((_C = this.properties) == null ? void 0 : _C.borderTopWidth) style.borderTopWidth = this.properties.borderTopWidth;
|
|
6735
|
+
if ((_D = this.properties) == null ? void 0 : _D.borderBottomWidth) style.borderBottomWidth = this.properties.borderBottomWidth;
|
|
6736
|
+
if ((_E = this.properties) == null ? void 0 : _E.borderTopLeftRadius) style.borderTopLeftRadius = this.properties.borderTopLeftRadius;
|
|
6737
|
+
if ((_F = this.properties) == null ? void 0 : _F.borderTopRightRadius) style.borderTopRightRadius = this.properties.borderTopRightRadius;
|
|
6738
|
+
if ((_G = this.properties) == null ? void 0 : _G.borderBottomLeftRadius) style.borderBottomLeftRadius = this.properties.borderBottomLeftRadius;
|
|
6739
|
+
if ((_H = this.properties) == null ? void 0 : _H.borderBottomRightRadius) style.borderBottomRightRadius = this.properties.borderBottomRightRadius;
|
|
6740
|
+
if (((_I = this.properties) == null ? void 0 : _I.borderColor) && style.borderLeftWidth) {
|
|
6760
6741
|
style.borderLeftStyle = "solid";
|
|
6761
|
-
style.borderLeftColor = (
|
|
6742
|
+
style.borderLeftColor = (_J = this.properties) == null ? void 0 : _J.borderColor;
|
|
6762
6743
|
}
|
|
6763
|
-
if (((
|
|
6744
|
+
if (((_K = this.properties) == null ? void 0 : _K.borderColor) && style.borderRightWidth) {
|
|
6764
6745
|
style.borderRightStyle = "solid";
|
|
6765
|
-
style.borderRightColor = (
|
|
6746
|
+
style.borderRightColor = (_L = this.properties) == null ? void 0 : _L.borderColor;
|
|
6766
6747
|
}
|
|
6767
|
-
if (((
|
|
6748
|
+
if (((_M = this.properties) == null ? void 0 : _M.borderColor) && style.borderTopWidth) {
|
|
6768
6749
|
style.borderTopStyle = "solid";
|
|
6769
|
-
style.borderTopColor = (
|
|
6750
|
+
style.borderTopColor = (_N = this.properties) == null ? void 0 : _N.borderColor;
|
|
6770
6751
|
}
|
|
6771
|
-
if (((
|
|
6752
|
+
if (((_O = this.properties) == null ? void 0 : _O.borderColor) && style.borderBottomWidth) {
|
|
6772
6753
|
style.borderBottomStyle = "solid";
|
|
6773
|
-
style.borderBottomColor = (
|
|
6754
|
+
style.borderBottomColor = (_P = this.properties) == null ? void 0 : _P.borderColor;
|
|
6774
6755
|
}
|
|
6775
6756
|
return style;
|
|
6776
6757
|
}
|
|
6758
|
+
getInlineStyles() {
|
|
6759
|
+
var _a;
|
|
6760
|
+
const styleObject = {};
|
|
6761
|
+
const inlineStyle = (_a = this.properties) == null ? void 0 : _a.inlineStyle;
|
|
6762
|
+
if (!inlineStyle) return styleObject;
|
|
6763
|
+
inlineStyle.split(";").forEach((rule) => {
|
|
6764
|
+
if (rule.trim()) {
|
|
6765
|
+
const [property, value] = rule.split(":").map((part) => part.trim());
|
|
6766
|
+
if (property && value) {
|
|
6767
|
+
const camelCasedProperty = property.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
6768
|
+
styleObject[camelCasedProperty] = value;
|
|
6769
|
+
}
|
|
6770
|
+
}
|
|
6771
|
+
});
|
|
6772
|
+
return styleObject;
|
|
6773
|
+
}
|
|
6774
|
+
getStyleTag() {
|
|
6775
|
+
var _a;
|
|
6776
|
+
const css = (_a = this.properties) == null ? void 0 : _a.style;
|
|
6777
|
+
if (!css) return "";
|
|
6778
|
+
return css.replace(/([^{]+){/g, (match) => {
|
|
6779
|
+
if (match.trim().startsWith("@")) {
|
|
6780
|
+
return match;
|
|
6781
|
+
}
|
|
6782
|
+
const selectors = match.split(",").map((selector) => selector.trim());
|
|
6783
|
+
const modifiedSelectors = selectors.map((selector) => `[data-part-id=${this.partId}] ${selector}`).join(", ");
|
|
6784
|
+
return `${modifiedSelectors} `;
|
|
6785
|
+
});
|
|
6786
|
+
}
|
|
6777
6787
|
}
|
|
6778
6788
|
class RootPart extends Part {
|
|
6779
6789
|
constructor() {
|
|
@@ -6834,47 +6844,43 @@ let Model$1 = class Model {
|
|
|
6834
6844
|
this.rootPart = ref(new RootPart());
|
|
6835
6845
|
}
|
|
6836
6846
|
};
|
|
6837
|
-
const _hoisted_1$
|
|
6838
|
-
const
|
|
6839
|
-
key: 1,
|
|
6840
|
-
class: "pb-nested-widget"
|
|
6841
|
-
};
|
|
6842
|
-
const _sfc_main$a$1 = /* @__PURE__ */ defineComponent({
|
|
6847
|
+
const _hoisted_1$b$1 = ["data-part-id"];
|
|
6848
|
+
const _sfc_main$c$1 = /* @__PURE__ */ defineComponent({
|
|
6843
6849
|
__name: "PbWidget",
|
|
6844
6850
|
props: {
|
|
6845
6851
|
part: {}
|
|
6846
6852
|
},
|
|
6847
6853
|
setup(__props) {
|
|
6848
6854
|
const props = __props;
|
|
6849
|
-
const
|
|
6850
|
-
const
|
|
6855
|
+
const className = computed(() => getPartClassName(props.part));
|
|
6856
|
+
const styleTag = computed(() => props.part.getStyleTag());
|
|
6857
|
+
const style = computed(() => ({
|
|
6858
|
+
...props.part.getStyles(),
|
|
6859
|
+
...props.part.getInlineStyles()
|
|
6860
|
+
}));
|
|
6851
6861
|
const thisComponent = computed(() => createPartComponent(props.part));
|
|
6852
|
-
const childComponents = computed(() => createPartComponents(props.part.children));
|
|
6853
6862
|
return (_ctx, _cache) => {
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
class: [classNames.value, "pb-widget"],
|
|
6857
|
-
"data-model-id": _ctx.part.partId,
|
|
6858
|
-
style: (_a = _ctx.part.properties) == null ? void 0 : _a.css
|
|
6859
|
-
}, properties.value), [
|
|
6860
|
-
thisComponent.value ? (openBlock(), createBlock$1(resolveDynamicComponent(thisComponent.value), {
|
|
6863
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
6864
|
+
styleTag.value ? (openBlock(), createBlock$1(resolveDynamicComponent("style"), {
|
|
6861
6865
|
key: 0,
|
|
6862
|
-
|
|
6863
|
-
}, null, 8, ["
|
|
6864
|
-
|
|
6865
|
-
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
6866
|
+
innerHTML: styleTag.value
|
|
6867
|
+
}, null, 8, ["innerHTML"])) : createCommentVNode("", true),
|
|
6868
|
+
createElementVNode("div", {
|
|
6869
|
+
class: normalizeClass([className.value, "pb-widget"]),
|
|
6870
|
+
"data-part-id": _ctx.part.partId,
|
|
6871
|
+
style: normalizeStyle(style.value)
|
|
6872
|
+
}, [
|
|
6873
|
+
thisComponent.value ? (openBlock(), createBlock$1(resolveDynamicComponent(thisComponent.value), {
|
|
6874
|
+
key: 0,
|
|
6875
|
+
part: _ctx.part
|
|
6876
|
+
}, null, 8, ["part"])) : createCommentVNode("", true)
|
|
6877
|
+
], 14, _hoisted_1$b$1)
|
|
6878
|
+
], 64);
|
|
6873
6879
|
};
|
|
6874
6880
|
}
|
|
6875
6881
|
});
|
|
6876
|
-
const _hoisted_1$
|
|
6877
|
-
const _sfc_main$
|
|
6882
|
+
const _hoisted_1$a$1 = ["data-part-id"];
|
|
6883
|
+
const _sfc_main$b$1 = /* @__PURE__ */ defineComponent({
|
|
6878
6884
|
__name: "PbBlock",
|
|
6879
6885
|
props: {
|
|
6880
6886
|
part: {}
|
|
@@ -6882,50 +6888,57 @@ const _sfc_main$9$1 = /* @__PURE__ */ defineComponent({
|
|
|
6882
6888
|
setup(__props) {
|
|
6883
6889
|
const props = __props;
|
|
6884
6890
|
const classNames = computed(() => props.part.getClassNames());
|
|
6885
|
-
const
|
|
6891
|
+
const styleTag = computed(() => props.part.getStyleTag());
|
|
6892
|
+
const style = computed(() => ({
|
|
6893
|
+
...props.part.getStyles(),
|
|
6894
|
+
...props.part.getInlineStyles()
|
|
6895
|
+
}));
|
|
6886
6896
|
computed(() => createPartComponents(props.part.children));
|
|
6887
6897
|
return (_ctx, _cache) => {
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
|
|
6895
|
-
|
|
6896
|
-
|
|
6897
|
-
|
|
6898
|
-
|
|
6899
|
-
|
|
6900
|
-
|
|
6898
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
6899
|
+
styleTag.value ? (openBlock(), createBlock$1(resolveDynamicComponent("style"), {
|
|
6900
|
+
key: 0,
|
|
6901
|
+
innerHTML: styleTag.value
|
|
6902
|
+
}, null, 8, ["innerHTML"])) : createCommentVNode("", true),
|
|
6903
|
+
createElementVNode("div", {
|
|
6904
|
+
class: normalizeClass([classNames.value, "pb-block"]),
|
|
6905
|
+
"data-part-id": _ctx.part.partId,
|
|
6906
|
+
style: normalizeStyle(style.value)
|
|
6907
|
+
}, [
|
|
6908
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.part.children, (child) => {
|
|
6909
|
+
return openBlock(), createBlock$1(_sfc_main$c$1, {
|
|
6910
|
+
key: child.partId,
|
|
6911
|
+
part: child
|
|
6912
|
+
}, null, 8, ["part"]);
|
|
6913
|
+
}), 128))
|
|
6914
|
+
], 14, _hoisted_1$a$1)
|
|
6915
|
+
], 64);
|
|
6901
6916
|
};
|
|
6902
6917
|
}
|
|
6903
6918
|
});
|
|
6904
|
-
const _hoisted_1$
|
|
6905
|
-
const
|
|
6906
|
-
class: "pb-widget",
|
|
6907
|
-
style: { "margin": "0 auto" }
|
|
6908
|
-
}, [
|
|
6909
|
-
/* @__PURE__ */ createElementVNode("div", { class: "pb-login-widget" }, [
|
|
6910
|
-
/* @__PURE__ */ createElementVNode("h3", null, "Login Design Part")
|
|
6911
|
-
])
|
|
6912
|
-
], -1);
|
|
6913
|
-
const _hoisted_3$4$1 = [
|
|
6914
|
-
_hoisted_2$4$1
|
|
6915
|
-
];
|
|
6916
|
-
const _sfc_main$8$1 = /* @__PURE__ */ defineComponent({
|
|
6919
|
+
const _hoisted_1$9$1 = { class: "pb-block" };
|
|
6920
|
+
const _sfc_main$a$1 = /* @__PURE__ */ defineComponent({
|
|
6917
6921
|
__name: "PbLoginDepart",
|
|
6918
6922
|
props: {
|
|
6919
6923
|
part: {}
|
|
6920
6924
|
},
|
|
6921
6925
|
setup(__props) {
|
|
6922
6926
|
return (_ctx, _cache) => {
|
|
6923
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
6927
|
+
return openBlock(), createElementBlock("div", _hoisted_1$9$1, _cache[0] || (_cache[0] = [
|
|
6928
|
+
createElementVNode("div", {
|
|
6929
|
+
class: "pb-widget",
|
|
6930
|
+
style: { "margin": "0 auto" }
|
|
6931
|
+
}, [
|
|
6932
|
+
createElementVNode("div", { class: "pb-login-widget" }, [
|
|
6933
|
+
createElementVNode("h3", null, "Login Design Part")
|
|
6934
|
+
])
|
|
6935
|
+
], -1)
|
|
6936
|
+
]));
|
|
6924
6937
|
};
|
|
6925
6938
|
}
|
|
6926
6939
|
});
|
|
6927
|
-
const _hoisted_1$
|
|
6928
|
-
const _sfc_main$
|
|
6940
|
+
const _hoisted_1$8$1 = ["data-part-id"];
|
|
6941
|
+
const _sfc_main$9$1 = /* @__PURE__ */ defineComponent({
|
|
6929
6942
|
__name: "PbSection",
|
|
6930
6943
|
props: {
|
|
6931
6944
|
part: {}
|
|
@@ -6933,65 +6946,91 @@ const _sfc_main$7$1 = /* @__PURE__ */ defineComponent({
|
|
|
6933
6946
|
setup(__props) {
|
|
6934
6947
|
const props = __props;
|
|
6935
6948
|
const classNames = computed(() => props.part.getClassNames());
|
|
6936
|
-
const
|
|
6949
|
+
const styleTag = computed(() => props.part.getStyleTag());
|
|
6950
|
+
const style = computed(() => ({
|
|
6951
|
+
...props.part.getStyles(),
|
|
6952
|
+
...props.part.getInlineStyles()
|
|
6953
|
+
}));
|
|
6937
6954
|
return (_ctx, _cache) => {
|
|
6938
|
-
var _a
|
|
6939
|
-
return openBlock(), createElementBlock(
|
|
6940
|
-
|
|
6941
|
-
"data-model-id": _ctx.part.partId,
|
|
6942
|
-
style: (_a = _ctx.part.properties) == null ? void 0 : _a.css
|
|
6943
|
-
}, properties.value), [
|
|
6944
|
-
((_b = _ctx.part.properties) == null ? void 0 : _b.name) === "Login Design Part" ? (openBlock(), createBlock$1(_sfc_main$8$1, {
|
|
6955
|
+
var _a;
|
|
6956
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
6957
|
+
styleTag.value ? (openBlock(), createBlock$1(resolveDynamicComponent("style"), {
|
|
6945
6958
|
key: 0,
|
|
6946
|
-
|
|
6947
|
-
}, null, 8, ["
|
|
6948
|
-
|
|
6949
|
-
|
|
6950
|
-
|
|
6951
|
-
|
|
6952
|
-
}
|
|
6953
|
-
|
|
6959
|
+
innerHTML: styleTag.value
|
|
6960
|
+
}, null, 8, ["innerHTML"])) : createCommentVNode("", true),
|
|
6961
|
+
createElementVNode("div", {
|
|
6962
|
+
class: normalizeClass([classNames.value, "pb-section"]),
|
|
6963
|
+
"data-part-id": _ctx.part.partId,
|
|
6964
|
+
style: normalizeStyle(style.value)
|
|
6965
|
+
}, [
|
|
6966
|
+
((_a = _ctx.part.properties) == null ? void 0 : _a.name) === "Login Design Part" ? (openBlock(), createBlock$1(_sfc_main$a$1, {
|
|
6967
|
+
key: 0,
|
|
6968
|
+
part: _ctx.part
|
|
6969
|
+
}, null, 8, ["part"])) : _ctx.part.children && _ctx.part.children.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.part.children, (block) => {
|
|
6970
|
+
return openBlock(), createBlock$1(_sfc_main$b$1, {
|
|
6971
|
+
key: block.partId,
|
|
6972
|
+
part: block
|
|
6973
|
+
}, null, 8, ["part"]);
|
|
6974
|
+
}), 128)) : createCommentVNode("", true)
|
|
6975
|
+
], 14, _hoisted_1$8$1)
|
|
6976
|
+
], 64);
|
|
6954
6977
|
};
|
|
6955
6978
|
}
|
|
6956
6979
|
});
|
|
6957
|
-
const _hoisted_1$
|
|
6958
|
-
const _hoisted_2$
|
|
6959
|
-
const _hoisted_3$3$1 = {
|
|
6980
|
+
const _hoisted_1$7$1 = ["alt", "src"];
|
|
6981
|
+
const _hoisted_2$4$1 = {
|
|
6960
6982
|
key: 1,
|
|
6961
6983
|
class: "placeholder"
|
|
6962
6984
|
};
|
|
6963
|
-
const
|
|
6964
|
-
const _hoisted_5$6 = [
|
|
6965
|
-
_hoisted_4$d
|
|
6966
|
-
];
|
|
6967
|
-
const _sfc_main$6$1 = /* @__PURE__ */ defineComponent({
|
|
6985
|
+
const _sfc_main$8$1 = /* @__PURE__ */ defineComponent({
|
|
6968
6986
|
__name: "PbImageWidget",
|
|
6969
6987
|
props: {
|
|
6970
6988
|
part: {},
|
|
6971
6989
|
placeholder: { type: Boolean }
|
|
6972
6990
|
},
|
|
6973
6991
|
setup(__props) {
|
|
6992
|
+
const props = __props;
|
|
6993
|
+
const pageBuilder = usePageBuilder();
|
|
6994
|
+
const altText = computed(() => {
|
|
6995
|
+
var _a;
|
|
6996
|
+
const media = (_a = props.part.properties) == null ? void 0 : _a.media;
|
|
6997
|
+
if (media && media.altText) {
|
|
6998
|
+
const locale = pageBuilder.getLocale();
|
|
6999
|
+
return media.altText[locale] || "";
|
|
7000
|
+
}
|
|
7001
|
+
return "";
|
|
7002
|
+
});
|
|
7003
|
+
const style = computed(() => {
|
|
7004
|
+
var _a;
|
|
7005
|
+
const media = (_a = props.part.properties) == null ? void 0 : _a.media;
|
|
7006
|
+
if (media.width && media.height) {
|
|
7007
|
+
return {
|
|
7008
|
+
aspectRatio: media.width / media.height
|
|
7009
|
+
};
|
|
7010
|
+
}
|
|
7011
|
+
return {};
|
|
7012
|
+
});
|
|
6974
7013
|
return (_ctx, _cache) => {
|
|
6975
7014
|
var _a, _b;
|
|
6976
|
-
return openBlock(), createElementBlock("
|
|
6977
|
-
|
|
6978
|
-
|
|
6979
|
-
|
|
6980
|
-
|
|
6981
|
-
|
|
6982
|
-
|
|
6983
|
-
|
|
7015
|
+
return ((_a = _ctx.part.properties) == null ? void 0 : _a.media) ? (openBlock(), createElementBlock("img", {
|
|
7016
|
+
key: 0,
|
|
7017
|
+
alt: altText.value,
|
|
7018
|
+
src: ((_b = _ctx.part.properties) == null ? void 0 : _b.media).url,
|
|
7019
|
+
style: normalizeStyle(style.value),
|
|
7020
|
+
class: "image"
|
|
7021
|
+
}, null, 12, _hoisted_1$7$1)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_2$4$1, _cache[0] || (_cache[0] = [
|
|
7022
|
+
createElementVNode("span", { class: "font-icon" }, "image", -1)
|
|
7023
|
+
]))) : createCommentVNode("", true);
|
|
6984
7024
|
};
|
|
6985
7025
|
}
|
|
6986
7026
|
});
|
|
6987
|
-
const _hoisted_1$
|
|
6988
|
-
const _hoisted_2$
|
|
6989
|
-
const _hoisted_3$2$1 = {
|
|
7027
|
+
const _hoisted_1$6$1 = ["textContent"];
|
|
7028
|
+
const _hoisted_2$3$1 = {
|
|
6990
7029
|
key: 1,
|
|
6991
7030
|
class: "placeholder",
|
|
6992
7031
|
textContent: "Empty Text"
|
|
6993
7032
|
};
|
|
6994
|
-
const _sfc_main$
|
|
7033
|
+
const _sfc_main$7$1 = /* @__PURE__ */ defineComponent({
|
|
6995
7034
|
__name: "PbTextWidget",
|
|
6996
7035
|
props: {
|
|
6997
7036
|
part: {},
|
|
@@ -7012,34 +7051,31 @@ const _sfc_main$5$1 = /* @__PURE__ */ defineComponent({
|
|
|
7012
7051
|
}
|
|
7013
7052
|
});
|
|
7014
7053
|
const style = computed(() => {
|
|
7015
|
-
var _a, _b;
|
|
7054
|
+
var _a, _b, _c, _d;
|
|
7016
7055
|
return {
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7020
|
-
|
|
7056
|
+
fontSize: (_a = props.part.properties) == null ? void 0 : _a.fontSize,
|
|
7057
|
+
fontWeight: (_b = props.part.properties) == null ? void 0 : _b.fontWeight,
|
|
7058
|
+
textAlign: (_c = props.part.properties) == null ? void 0 : _c.textAlign,
|
|
7059
|
+
color: (_d = props.part.properties) == null ? void 0 : _d.color
|
|
7021
7060
|
};
|
|
7022
7061
|
});
|
|
7023
7062
|
return (_ctx, _cache) => {
|
|
7024
|
-
return openBlock(), createElementBlock("div",
|
|
7025
|
-
|
|
7026
|
-
|
|
7027
|
-
|
|
7028
|
-
|
|
7029
|
-
|
|
7030
|
-
}), null, 16, _hoisted_2$2$1)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_3$2$1)) : createCommentVNode("", true)
|
|
7031
|
-
]);
|
|
7063
|
+
return text.value ? (openBlock(), createElementBlock("div", {
|
|
7064
|
+
key: 0,
|
|
7065
|
+
style: normalizeStyle(style.value),
|
|
7066
|
+
class: "text",
|
|
7067
|
+
textContent: toDisplayString(text.value)
|
|
7068
|
+
}, null, 12, _hoisted_1$6$1)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_2$3$1)) : createCommentVNode("", true);
|
|
7032
7069
|
};
|
|
7033
7070
|
}
|
|
7034
7071
|
});
|
|
7035
|
-
const _hoisted_1$
|
|
7036
|
-
const _hoisted_2$
|
|
7037
|
-
const _hoisted_3$1$1 = {
|
|
7072
|
+
const _hoisted_1$5$1 = ["innerHTML"];
|
|
7073
|
+
const _hoisted_2$2$1 = {
|
|
7038
7074
|
key: 1,
|
|
7039
7075
|
class: "placeholder",
|
|
7040
7076
|
textContent: "Empty HTML"
|
|
7041
7077
|
};
|
|
7042
|
-
const _sfc_main$
|
|
7078
|
+
const _sfc_main$6$1 = /* @__PURE__ */ defineComponent({
|
|
7043
7079
|
__name: "PbHtmlWidget",
|
|
7044
7080
|
props: {
|
|
7045
7081
|
part: {},
|
|
@@ -7049,11 +7085,9 @@ const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
|
|
|
7049
7085
|
const props = __props;
|
|
7050
7086
|
const pageBuilder = usePageBuilder();
|
|
7051
7087
|
const getHtml = (html2) => {
|
|
7052
|
-
if (!html2)
|
|
7053
|
-
|
|
7054
|
-
|
|
7055
|
-
return;
|
|
7056
|
-
const locale = pageBuilder.locale.value;
|
|
7088
|
+
if (!html2) return;
|
|
7089
|
+
if (typeof html2 !== "object") return;
|
|
7090
|
+
const locale = pageBuilder.getLocale();
|
|
7057
7091
|
let _html = html2[locale];
|
|
7058
7092
|
if (!_html && html2.tags) {
|
|
7059
7093
|
_html = html2;
|
|
@@ -7070,26 +7104,22 @@ ${_html.style}
|
|
|
7070
7104
|
var _a;
|
|
7071
7105
|
return getHtml((_a = props.part.properties) == null ? void 0 : _a.html);
|
|
7072
7106
|
});
|
|
7073
|
-
computed(() => props.placeholder ? !html.value : false);
|
|
7074
7107
|
return (_ctx, _cache) => {
|
|
7075
|
-
return openBlock(), createElementBlock("div",
|
|
7076
|
-
|
|
7077
|
-
|
|
7078
|
-
|
|
7079
|
-
|
|
7080
|
-
}, null, 8, _hoisted_2$1$1)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_3$1$1)) : createCommentVNode("", true)
|
|
7081
|
-
]);
|
|
7108
|
+
return html.value ? (openBlock(), createElementBlock("div", {
|
|
7109
|
+
key: 0,
|
|
7110
|
+
class: "html",
|
|
7111
|
+
innerHTML: html.value
|
|
7112
|
+
}, null, 8, _hoisted_1$5$1)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_2$2$1)) : createCommentVNode("", true);
|
|
7082
7113
|
};
|
|
7083
7114
|
}
|
|
7084
7115
|
});
|
|
7085
|
-
const _hoisted_1$
|
|
7086
|
-
const _hoisted_2$
|
|
7087
|
-
const _hoisted_3$g = {
|
|
7116
|
+
const _hoisted_1$4$1 = ["src"];
|
|
7117
|
+
const _hoisted_2$1$1 = {
|
|
7088
7118
|
key: 1,
|
|
7089
7119
|
class: "placeholder",
|
|
7090
7120
|
textContent: "Empty URL"
|
|
7091
7121
|
};
|
|
7092
|
-
const _sfc_main$
|
|
7122
|
+
const _sfc_main$5$1 = /* @__PURE__ */ defineComponent({
|
|
7093
7123
|
__name: "PbIframeWidget",
|
|
7094
7124
|
props: {
|
|
7095
7125
|
part: {},
|
|
@@ -7101,21 +7131,18 @@ const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
|
|
|
7101
7131
|
const url = computed(() => {
|
|
7102
7132
|
var _a;
|
|
7103
7133
|
const url2 = (_a = props.part.properties) == null ? void 0 : _a.url;
|
|
7104
|
-
if (!url2)
|
|
7105
|
-
|
|
7106
|
-
if (typeof url2 !== "object")
|
|
7107
|
-
return;
|
|
7134
|
+
if (!url2) return;
|
|
7135
|
+
if (typeof url2 !== "object") return;
|
|
7108
7136
|
const locale = pageBuilder.getLocale();
|
|
7109
7137
|
return url2[locale];
|
|
7110
7138
|
});
|
|
7111
7139
|
const style = computed(() => ({
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
|
-
height: `${height.value}px`
|
|
7115
|
-
}
|
|
7140
|
+
width: "100%",
|
|
7141
|
+
height: `${height.value}px`
|
|
7116
7142
|
}));
|
|
7117
7143
|
const height = ref(200);
|
|
7118
7144
|
const updateHeight = (event) => {
|
|
7145
|
+
console.log(event);
|
|
7119
7146
|
if (event.data && event.data.height) {
|
|
7120
7147
|
height.value = event.data.height;
|
|
7121
7148
|
}
|
|
@@ -7127,12 +7154,40 @@ const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
|
|
|
7127
7154
|
window.removeEventListener("message", updateHeight);
|
|
7128
7155
|
});
|
|
7129
7156
|
return (_ctx, _cache) => {
|
|
7130
|
-
return openBlock(), createElementBlock("
|
|
7131
|
-
|
|
7132
|
-
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
|
|
7157
|
+
return url.value ? (openBlock(), createElementBlock("iframe", {
|
|
7158
|
+
key: 0,
|
|
7159
|
+
src: url.value,
|
|
7160
|
+
style: normalizeStyle(style.value)
|
|
7161
|
+
}, null, 12, _hoisted_1$4$1)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_2$1$1)) : createCommentVNode("", true);
|
|
7162
|
+
};
|
|
7163
|
+
}
|
|
7164
|
+
});
|
|
7165
|
+
const _hoisted_1$3$1 = {
|
|
7166
|
+
key: 1,
|
|
7167
|
+
class: "placeholder"
|
|
7168
|
+
};
|
|
7169
|
+
const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
|
|
7170
|
+
__name: "PbYoutubeWidget",
|
|
7171
|
+
props: {
|
|
7172
|
+
part: {},
|
|
7173
|
+
placeholder: { type: Boolean }
|
|
7174
|
+
},
|
|
7175
|
+
setup(__props) {
|
|
7176
|
+
const onReady = () => {
|
|
7177
|
+
};
|
|
7178
|
+
return (_ctx, _cache) => {
|
|
7179
|
+
var _a, _b;
|
|
7180
|
+
return ((_a = _ctx.part.properties) == null ? void 0 : _a.url) ? (openBlock(), createBlock$1(unref(YouTube), {
|
|
7181
|
+
key: 0,
|
|
7182
|
+
ref: "youtube",
|
|
7183
|
+
src: ((_b = _ctx.part.properties) == null ? void 0 : _b.url) || "",
|
|
7184
|
+
class: "youtube",
|
|
7185
|
+
height: "100%",
|
|
7186
|
+
width: "100%",
|
|
7187
|
+
onReady
|
|
7188
|
+
}, null, 8, ["src"])) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_1$3$1, _cache[0] || (_cache[0] = [
|
|
7189
|
+
createElementVNode("span", { class: "font-icon" }, "live_tv", -1)
|
|
7190
|
+
]))) : createCommentVNode("", true);
|
|
7136
7191
|
};
|
|
7137
7192
|
}
|
|
7138
7193
|
});
|
|
@@ -7140,32 +7195,50 @@ const defaultPartDefinitions = {
|
|
|
7140
7195
|
"Section": {
|
|
7141
7196
|
partType: "Section",
|
|
7142
7197
|
partName: "Section",
|
|
7143
|
-
|
|
7198
|
+
className: "pb-section",
|
|
7199
|
+
creator: () => _sfc_main$9$1
|
|
7144
7200
|
},
|
|
7145
7201
|
"Block": {
|
|
7146
7202
|
partType: "Block",
|
|
7147
7203
|
partName: "Block",
|
|
7148
|
-
|
|
7204
|
+
className: "pb-block",
|
|
7205
|
+
creator: () => _sfc_main$b$1
|
|
7149
7206
|
},
|
|
7150
7207
|
"TextWidget": {
|
|
7151
7208
|
partType: "Widget",
|
|
7152
7209
|
partName: "TextWidget",
|
|
7153
|
-
|
|
7210
|
+
className: "pb-text-widget",
|
|
7211
|
+
creator: () => _sfc_main$7$1
|
|
7154
7212
|
},
|
|
7155
7213
|
"ImageWidget": {
|
|
7156
7214
|
partType: "Widget",
|
|
7157
7215
|
partName: "ImageWidget",
|
|
7158
|
-
|
|
7216
|
+
className: "pb-image-widget",
|
|
7217
|
+
creator: () => _sfc_main$8$1
|
|
7159
7218
|
},
|
|
7160
7219
|
"HtmlWidget": {
|
|
7161
7220
|
partType: "Widget",
|
|
7162
7221
|
partName: "HtmlWidget",
|
|
7163
|
-
|
|
7222
|
+
className: "pb-html-widget",
|
|
7223
|
+
creator: () => _sfc_main$6$1
|
|
7164
7224
|
},
|
|
7165
7225
|
"IframeWidget": {
|
|
7166
7226
|
partType: "Widget",
|
|
7167
7227
|
partName: "IframeWidget",
|
|
7168
|
-
|
|
7228
|
+
className: "pb-iframe-widget",
|
|
7229
|
+
creator: () => _sfc_main$5$1
|
|
7230
|
+
},
|
|
7231
|
+
"YoutubeWidget": {
|
|
7232
|
+
partType: "Widget",
|
|
7233
|
+
partName: "YoutubeWidget",
|
|
7234
|
+
className: "pb-youtube-widget",
|
|
7235
|
+
creator: () => _sfc_main$4$1
|
|
7236
|
+
},
|
|
7237
|
+
"ContainerWidget": {
|
|
7238
|
+
partType: "Widget",
|
|
7239
|
+
partName: "ContainerWidget",
|
|
7240
|
+
className: "pb-container-widget",
|
|
7241
|
+
creator: () => _sfc_main$4$1
|
|
7169
7242
|
}
|
|
7170
7243
|
};
|
|
7171
7244
|
const PAGE_BUILDER_KEY = "PageBuilder";
|
|
@@ -7177,6 +7250,8 @@ class PageBuilderViewerImpl {
|
|
|
7177
7250
|
__publicField2(this, "locale", ref("en"));
|
|
7178
7251
|
__publicField2(this, "watchers", {});
|
|
7179
7252
|
__publicField2(this, "providers", {});
|
|
7253
|
+
__publicField2(this, "externalCssLinks", []);
|
|
7254
|
+
__publicField2(this, "externalCssContent", "");
|
|
7180
7255
|
this.model = new Model$1();
|
|
7181
7256
|
}
|
|
7182
7257
|
getLocale() {
|
|
@@ -7190,7 +7265,7 @@ class PageBuilderViewerImpl {
|
|
|
7190
7265
|
plugin.widgets.forEach((v) => {
|
|
7191
7266
|
const w = { ...v };
|
|
7192
7267
|
w.partType = "Widget";
|
|
7193
|
-
w.creator = () => _sfc_main$
|
|
7268
|
+
w.creator = () => _sfc_main$q;
|
|
7194
7269
|
partDefinitions$1[v.partName] = w;
|
|
7195
7270
|
});
|
|
7196
7271
|
}
|
|
@@ -7200,23 +7275,27 @@ class PageBuilderViewerImpl {
|
|
|
7200
7275
|
if (plugin.providers) {
|
|
7201
7276
|
this.providers = { ...this.providers, ...plugin.providers };
|
|
7202
7277
|
}
|
|
7278
|
+
if (plugin.css) {
|
|
7279
|
+
if (plugin.css.links) {
|
|
7280
|
+
this.externalCssLinks = plugin.css.links;
|
|
7281
|
+
}
|
|
7282
|
+
if (plugin.css.content) {
|
|
7283
|
+
this.externalCssContent = plugin.css.content;
|
|
7284
|
+
}
|
|
7285
|
+
}
|
|
7203
7286
|
}
|
|
7204
7287
|
watchCustomWidgetData(part) {
|
|
7205
7288
|
const def = partDefinitions$1[part.partName];
|
|
7206
|
-
if (!def || !def.dataWatcher)
|
|
7207
|
-
return false;
|
|
7289
|
+
if (!def || !def.dataWatcher) return false;
|
|
7208
7290
|
const watcher = this.watchers[def.dataWatcher];
|
|
7209
|
-
if (!watcher)
|
|
7210
|
-
return false;
|
|
7291
|
+
if (!watcher) return false;
|
|
7211
7292
|
return watcher(part.properties);
|
|
7212
7293
|
}
|
|
7213
7294
|
provideCustomWidgetData(part) {
|
|
7214
7295
|
const def = partDefinitions$1[part.partName];
|
|
7215
|
-
if (!def || !def.dataProvider)
|
|
7216
|
-
return Promise.resolve();
|
|
7296
|
+
if (!def || !def.dataProvider) return Promise.resolve();
|
|
7217
7297
|
const provider = this.providers[def.dataProvider];
|
|
7218
|
-
if (!provider)
|
|
7219
|
-
return Promise.resolve();
|
|
7298
|
+
if (!provider) return Promise.resolve();
|
|
7220
7299
|
return provider(part.properties);
|
|
7221
7300
|
}
|
|
7222
7301
|
render(data) {
|
|
@@ -7236,15 +7315,13 @@ class PageBuilderViewerImpl {
|
|
|
7236
7315
|
}
|
|
7237
7316
|
parsePartContent(partContent) {
|
|
7238
7317
|
const part = this.createPart(partContent.partType);
|
|
7239
|
-
if (!part)
|
|
7240
|
-
return;
|
|
7318
|
+
if (!part) return;
|
|
7241
7319
|
part.partType = partContent.partType;
|
|
7242
7320
|
part.partName = partContent.partName;
|
|
7243
7321
|
part.properties = partContent.properties ? JSON.parse(JSON.stringify(partContent.properties)) : null;
|
|
7244
7322
|
part.children = (partContent.children || []).map((child) => {
|
|
7245
7323
|
const childPart = this.parsePartContent(child);
|
|
7246
|
-
if (childPart)
|
|
7247
|
-
childPart.parent = part;
|
|
7324
|
+
if (childPart) childPart.parent = part;
|
|
7248
7325
|
return childPart;
|
|
7249
7326
|
}).filter((part2) => !!part2);
|
|
7250
7327
|
return part;
|
|
@@ -7269,6 +7346,10 @@ class PageBuilderViewerImpl {
|
|
|
7269
7346
|
return def.component;
|
|
7270
7347
|
}
|
|
7271
7348
|
}
|
|
7349
|
+
getExternalCss() {
|
|
7350
|
+
return `${this.externalCssLinks}
|
|
7351
|
+
<style>${this.externalCssContent}</style>`;
|
|
7352
|
+
}
|
|
7272
7353
|
}
|
|
7273
7354
|
const createPageBuilderViewer = () => {
|
|
7274
7355
|
const viewer = new PageBuilderViewerImpl();
|
|
@@ -7282,14 +7363,12 @@ const providePageBuilderViewer = (pageBuilderViewer) => {
|
|
|
7282
7363
|
};
|
|
7283
7364
|
const usePageBuilder = () => {
|
|
7284
7365
|
const pageBuilder = inject(PAGE_BUILDER_KEY);
|
|
7285
|
-
if (!pageBuilder)
|
|
7286
|
-
throw Error("PageBuilder not found");
|
|
7366
|
+
if (!pageBuilder) throw Error("PageBuilder not found");
|
|
7287
7367
|
return pageBuilder;
|
|
7288
7368
|
};
|
|
7289
7369
|
const usePageBuilderViewer = () => {
|
|
7290
7370
|
const pageBuilderViewer = inject(PAGE_BUILDER_VIEWER_KEY);
|
|
7291
|
-
if (!pageBuilderViewer)
|
|
7292
|
-
throw Error("PageBuilderViewer not found");
|
|
7371
|
+
if (!pageBuilderViewer) throw Error("PageBuilderViewer not found");
|
|
7293
7372
|
return pageBuilderViewer;
|
|
7294
7373
|
};
|
|
7295
7374
|
const createPartComponents = (parts) => {
|
|
@@ -7306,38 +7385,62 @@ const createPartComponent = (part) => {
|
|
|
7306
7385
|
}
|
|
7307
7386
|
}
|
|
7308
7387
|
};
|
|
7388
|
+
const getPartClassName = (part) => {
|
|
7389
|
+
if (part) {
|
|
7390
|
+
const def = getPartDefinition(part.partName);
|
|
7391
|
+
if (def) {
|
|
7392
|
+
return def.className;
|
|
7393
|
+
}
|
|
7394
|
+
}
|
|
7395
|
+
};
|
|
7309
7396
|
const getPartDefinition = (partName) => partDefinitions$1[partName];
|
|
7310
|
-
const
|
|
7397
|
+
const _hoisted_1$2$1 = ["data-part-id"];
|
|
7398
|
+
const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
|
|
7311
7399
|
__name: "PbPage",
|
|
7312
7400
|
props: {
|
|
7313
|
-
|
|
7401
|
+
part: {},
|
|
7314
7402
|
isMobilePage: { type: Boolean }
|
|
7315
7403
|
},
|
|
7316
7404
|
setup(__props) {
|
|
7317
|
-
const
|
|
7318
|
-
|
|
7319
|
-
|
|
7320
|
-
}
|
|
7405
|
+
const props = __props;
|
|
7406
|
+
const classNames = computed(() => {
|
|
7407
|
+
var _a;
|
|
7408
|
+
return `${(_a = props.part) == null ? void 0 : _a.getClassNames()} ${props.isMobilePage ? "mobile" : "pc"}`;
|
|
7409
|
+
});
|
|
7410
|
+
const styleTag = computed(() => props.part.getStyleTag());
|
|
7411
|
+
const style = computed(() => ({
|
|
7412
|
+
...props.part.getStyles(),
|
|
7413
|
+
...props.part.getInlineStyles()
|
|
7321
7414
|
}));
|
|
7322
7415
|
return (_ctx, _cache) => {
|
|
7323
|
-
|
|
7324
|
-
|
|
7416
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
7417
|
+
styleTag.value ? (openBlock(), createBlock$1(resolveDynamicComponent("style"), {
|
|
7418
|
+
key: 0,
|
|
7419
|
+
innerHTML: styleTag.value
|
|
7420
|
+
}, null, 8, ["innerHTML"])) : createCommentVNode("", true),
|
|
7325
7421
|
createElementVNode("div", {
|
|
7326
|
-
class: normalizeClass([
|
|
7422
|
+
class: normalizeClass([classNames.value, "pb-page"]),
|
|
7423
|
+
"data-part-id": _ctx.part.partId,
|
|
7424
|
+
style: normalizeStyle(style.value)
|
|
7327
7425
|
}, [
|
|
7328
|
-
(
|
|
7329
|
-
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
|
|
7426
|
+
createElementVNode("div", {
|
|
7427
|
+
class: normalizeClass([[_ctx.isMobilePage ? "mobile" : "pc"], "pb-page-content"])
|
|
7428
|
+
}, [
|
|
7429
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.part.children, (section) => {
|
|
7430
|
+
return openBlock(), createBlock$1(_sfc_main$9$1, {
|
|
7431
|
+
key: section.partId,
|
|
7432
|
+
part: section
|
|
7433
|
+
}, null, 8, ["part"]);
|
|
7434
|
+
}), 128))
|
|
7435
|
+
], 2)
|
|
7436
|
+
], 14, _hoisted_1$2$1)
|
|
7437
|
+
], 64);
|
|
7336
7438
|
};
|
|
7337
7439
|
}
|
|
7338
7440
|
});
|
|
7339
|
-
const _hoisted_1$
|
|
7340
|
-
const
|
|
7441
|
+
const _hoisted_1$1$1 = ["innerHTML"];
|
|
7442
|
+
const _hoisted_2$g = { class: "pb-viewer" };
|
|
7443
|
+
const _sfc_main$2$1 = /* @__PURE__ */ defineComponent({
|
|
7341
7444
|
__name: "PageBuilderViewer",
|
|
7342
7445
|
props: {
|
|
7343
7446
|
pageContent: {},
|
|
@@ -7347,46 +7450,77 @@ const _sfc_main$1$1 = /* @__PURE__ */ defineComponent({
|
|
|
7347
7450
|
},
|
|
7348
7451
|
setup(__props) {
|
|
7349
7452
|
const props = __props;
|
|
7350
|
-
const
|
|
7351
|
-
|
|
7352
|
-
if (props.plugin)
|
|
7353
|
-
|
|
7354
|
-
|
|
7355
|
-
|
|
7356
|
-
const
|
|
7357
|
-
const
|
|
7358
|
-
if (!
|
|
7359
|
-
|
|
7360
|
-
return pages[pages.length === 1 || props.isMobilePage ? 0 : 1];
|
|
7453
|
+
const viewer = createPageBuilderViewer();
|
|
7454
|
+
viewer.setLocale(props.locale);
|
|
7455
|
+
if (props.plugin) viewer.registerCustomPlugin(props.plugin);
|
|
7456
|
+
providePageBuilderViewer(viewer);
|
|
7457
|
+
providePageBuilder(viewer);
|
|
7458
|
+
const externalCss = viewer.getExternalCss();
|
|
7459
|
+
const part = computed(() => {
|
|
7460
|
+
const parts = viewer.model.rootPart.value.children;
|
|
7461
|
+
if (!parts || !parts.length) return;
|
|
7462
|
+
return parts[parts.length === 1 || props.isMobilePage ? 0 : 1];
|
|
7361
7463
|
});
|
|
7362
7464
|
onMounted(() => {
|
|
7363
7465
|
if (props.pageContent) {
|
|
7364
|
-
|
|
7466
|
+
viewer.render(props.pageContent);
|
|
7365
7467
|
}
|
|
7366
7468
|
});
|
|
7367
7469
|
watch(
|
|
7368
7470
|
() => props.pageContent,
|
|
7369
7471
|
(pageContent) => {
|
|
7370
7472
|
if (pageContent) {
|
|
7371
|
-
|
|
7473
|
+
viewer.render(pageContent);
|
|
7372
7474
|
}
|
|
7373
7475
|
}
|
|
7374
7476
|
);
|
|
7375
7477
|
return (_ctx, _cache) => {
|
|
7376
|
-
return openBlock(), createElementBlock(
|
|
7377
|
-
|
|
7478
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
7479
|
+
unref(externalCss) ? (openBlock(), createElementBlock("div", {
|
|
7378
7480
|
key: 0,
|
|
7379
|
-
|
|
7380
|
-
|
|
7381
|
-
|
|
7382
|
-
|
|
7481
|
+
innerHTML: unref(externalCss)
|
|
7482
|
+
}, null, 8, _hoisted_1$1$1)) : createCommentVNode("", true),
|
|
7483
|
+
createElementVNode("div", _hoisted_2$g, [
|
|
7484
|
+
part.value ? (openBlock(), createBlock$1(_sfc_main$3$1, {
|
|
7485
|
+
key: 0,
|
|
7486
|
+
"is-mobile-page": _ctx.isMobilePage,
|
|
7487
|
+
part: part.value
|
|
7488
|
+
}, null, 8, ["is-mobile-page", "part"])) : createCommentVNode("", true)
|
|
7489
|
+
])
|
|
7490
|
+
], 64);
|
|
7491
|
+
};
|
|
7492
|
+
}
|
|
7493
|
+
});
|
|
7494
|
+
const _hoisted_1$t = {
|
|
7495
|
+
key: 1,
|
|
7496
|
+
class: "placeholder",
|
|
7497
|
+
textContent: "Empty Widget"
|
|
7498
|
+
};
|
|
7499
|
+
const _sfc_main$1$1 = /* @__PURE__ */ defineComponent({
|
|
7500
|
+
__name: "PbContainerWidget",
|
|
7501
|
+
props: {
|
|
7502
|
+
part: {},
|
|
7503
|
+
placeholder: { type: Boolean }
|
|
7504
|
+
},
|
|
7505
|
+
setup(__props) {
|
|
7506
|
+
const props = __props;
|
|
7507
|
+
usePageBuilder();
|
|
7508
|
+
const childComponents = computed(() => createPartComponents(props.part.children));
|
|
7509
|
+
return (_ctx, _cache) => {
|
|
7510
|
+
return childComponents.value ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(childComponents.value, (child) => {
|
|
7511
|
+
return openBlock(), createBlock$1(resolveDynamicComponent(child.component), {
|
|
7512
|
+
key: child.part.partId,
|
|
7513
|
+
part: child.part
|
|
7514
|
+
}, null, 8, ["part"]);
|
|
7515
|
+
}), 128)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_1$t)) : createCommentVNode("", true);
|
|
7383
7516
|
};
|
|
7384
7517
|
}
|
|
7385
7518
|
});
|
|
7386
|
-
const _sfc_main$
|
|
7519
|
+
const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
7387
7520
|
__name: "PbCustomWidget",
|
|
7388
7521
|
props: {
|
|
7389
7522
|
part: {},
|
|
7523
|
+
placeholder: { type: Boolean },
|
|
7390
7524
|
dataWatcher: { type: Function },
|
|
7391
7525
|
dataProvider: { type: Function }
|
|
7392
7526
|
},
|
|
@@ -7397,8 +7531,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
7397
7531
|
const data = ref({});
|
|
7398
7532
|
const bind = computed(() => ({
|
|
7399
7533
|
...props.part.properties || {},
|
|
7400
|
-
|
|
7401
|
-
|
|
7534
|
+
...data.value || {},
|
|
7535
|
+
placeholder: props.placeholder
|
|
7402
7536
|
}));
|
|
7403
7537
|
const updateData = async () => {
|
|
7404
7538
|
data.value = await pageBuilder.provideCustomWidgetData(props.part);
|
|
@@ -7427,25 +7561,21 @@ const shortUniqueId = new ShortUniqueId({
|
|
|
7427
7561
|
});
|
|
7428
7562
|
const getNewPartId = () => shortUniqueId.rnd();
|
|
7429
7563
|
const findPartById = (part, partId) => {
|
|
7430
|
-
if (part.partId === partId)
|
|
7431
|
-
return part;
|
|
7564
|
+
if (part.partId === partId) return part;
|
|
7432
7565
|
if (part.children) {
|
|
7433
7566
|
for (const child of part.children) {
|
|
7434
7567
|
const found = findPartById(child, partId);
|
|
7435
|
-
if (found)
|
|
7436
|
-
return found;
|
|
7568
|
+
if (found) return found;
|
|
7437
7569
|
}
|
|
7438
7570
|
}
|
|
7439
7571
|
};
|
|
7440
7572
|
const findElementById = (element, partId) => {
|
|
7441
|
-
if (element.getAttribute(PART_ID_KEY) === partId)
|
|
7442
|
-
return element;
|
|
7573
|
+
if (element.getAttribute(PART_ID_KEY) === partId) return element;
|
|
7443
7574
|
let child = element.firstChild;
|
|
7444
7575
|
while (child) {
|
|
7445
7576
|
if (child instanceof YXmlElement) {
|
|
7446
7577
|
const found = findElementById(child, partId);
|
|
7447
|
-
if (found)
|
|
7448
|
-
return found;
|
|
7578
|
+
if (found) return found;
|
|
7449
7579
|
}
|
|
7450
7580
|
child = child.nextSibling;
|
|
7451
7581
|
}
|
|
@@ -7485,8 +7615,7 @@ const partsFromJsonString = (jsonString, keepPartId = false) => {
|
|
|
7485
7615
|
};
|
|
7486
7616
|
const partFromJsonObject = (object, keepPartId = false) => {
|
|
7487
7617
|
const part = createPart(object.partType, object.partName);
|
|
7488
|
-
if (!part)
|
|
7489
|
-
return;
|
|
7618
|
+
if (!part) return;
|
|
7490
7619
|
if (keepPartId && object.partId) {
|
|
7491
7620
|
part.partId = object.partId;
|
|
7492
7621
|
}
|
|
@@ -7527,8 +7656,7 @@ const syncPart = (part, element) => {
|
|
|
7527
7656
|
const syncProperties = (part, element) => {
|
|
7528
7657
|
const attrs = element.getAttributes();
|
|
7529
7658
|
if (attrs) {
|
|
7530
|
-
if (!part.properties)
|
|
7531
|
-
part.properties = {};
|
|
7659
|
+
if (!part.properties) part.properties = {};
|
|
7532
7660
|
for (const name in attrs) {
|
|
7533
7661
|
if (!RESERVED_ATTRIBUTES.includes(name)) {
|
|
7534
7662
|
const value = attrs[name];
|
|
@@ -7545,8 +7673,7 @@ const syncProperties = (part, element) => {
|
|
|
7545
7673
|
}
|
|
7546
7674
|
}
|
|
7547
7675
|
for (const name in part.properties) {
|
|
7548
|
-
if (!attrs[name] && !attrs[`${name}.object`])
|
|
7549
|
-
delete part.properties[name];
|
|
7676
|
+
if (!attrs[name] && !attrs[`${name}.object`]) delete part.properties[name];
|
|
7550
7677
|
}
|
|
7551
7678
|
if (Object.keys(part.properties).length === 0) {
|
|
7552
7679
|
part.properties = void 0;
|
|
@@ -7559,8 +7686,7 @@ const syncChildren = (part, element) => {
|
|
|
7559
7686
|
const elementChildren = [];
|
|
7560
7687
|
let elementChild = element.firstChild;
|
|
7561
7688
|
while (elementChild) {
|
|
7562
|
-
if (elementChild instanceof YXmlElement)
|
|
7563
|
-
elementChildren.push(elementChild);
|
|
7689
|
+
if (elementChild instanceof YXmlElement) elementChildren.push(elementChild);
|
|
7564
7690
|
elementChild = elementChild.nextSibling;
|
|
7565
7691
|
}
|
|
7566
7692
|
if (elementChildren.length === 0) {
|
|
@@ -7599,11 +7725,9 @@ const createPart = (partType, partName, properties) => {
|
|
|
7599
7725
|
part = new Widget();
|
|
7600
7726
|
break;
|
|
7601
7727
|
}
|
|
7602
|
-
if (!part)
|
|
7603
|
-
return;
|
|
7728
|
+
if (!part) return;
|
|
7604
7729
|
part.partName = partName;
|
|
7605
|
-
if (!properties)
|
|
7606
|
-
return part;
|
|
7730
|
+
if (!properties) return part;
|
|
7607
7731
|
part.properties = {};
|
|
7608
7732
|
for (const name in properties) {
|
|
7609
7733
|
if (!RESERVED_ATTRIBUTES.includes(name)) {
|
|
@@ -7613,15 +7737,12 @@ const createPart = (partType, partName, properties) => {
|
|
|
7613
7737
|
return part;
|
|
7614
7738
|
};
|
|
7615
7739
|
const createPartWithElement = (element) => {
|
|
7616
|
-
if (!element)
|
|
7617
|
-
return;
|
|
7740
|
+
if (!element) return;
|
|
7618
7741
|
const partType = element.nodeName;
|
|
7619
7742
|
const partName = element.getAttribute(PART_NAME_KEY);
|
|
7620
|
-
if (!partName)
|
|
7621
|
-
return;
|
|
7743
|
+
if (!partName) return;
|
|
7622
7744
|
const part = createPart(partType, partName);
|
|
7623
|
-
if (!part)
|
|
7624
|
-
return;
|
|
7745
|
+
if (!part) return;
|
|
7625
7746
|
part.partId = element.getAttribute(PART_ID_KEY) || "";
|
|
7626
7747
|
return part;
|
|
7627
7748
|
};
|
|
@@ -7660,19 +7781,15 @@ class Model2 {
|
|
|
7660
7781
|
}
|
|
7661
7782
|
getRootPartId() {
|
|
7662
7783
|
const partId = this.yjsRoot.getAttribute(PART_ID_KEY);
|
|
7663
|
-
if (!partId)
|
|
7664
|
-
throw new Error("root id not found");
|
|
7784
|
+
if (!partId) throw new Error("root id not found");
|
|
7665
7785
|
return partId;
|
|
7666
7786
|
}
|
|
7667
7787
|
updateModel(param) {
|
|
7668
7788
|
const result = {};
|
|
7669
7789
|
this.yjsDoc.transact(() => {
|
|
7670
|
-
if (param.delete)
|
|
7671
|
-
|
|
7672
|
-
if (param.
|
|
7673
|
-
result.inserted = this.insertParts(param.insert);
|
|
7674
|
-
if (param.update)
|
|
7675
|
-
result.updated = this.updateParts(param.update);
|
|
7790
|
+
if (param.delete) result.deleted = this.deleteParts(param.delete);
|
|
7791
|
+
if (param.insert) result.inserted = this.insertParts(param.insert);
|
|
7792
|
+
if (param.update) result.updated = this.updateParts(param.update);
|
|
7676
7793
|
});
|
|
7677
7794
|
this.undoManager.stopCapturing();
|
|
7678
7795
|
PageBuilderEditorEvent.emit.modelUpdatedByUI(result);
|
|
@@ -7703,11 +7820,9 @@ class Model2 {
|
|
|
7703
7820
|
}
|
|
7704
7821
|
parseModel(json, keepPartId = false) {
|
|
7705
7822
|
const root = JSON.parse(json);
|
|
7706
|
-
if (root.partType !== ROOT_TYPE)
|
|
7707
|
-
throw Error("Invalid data format");
|
|
7823
|
+
if (root.partType !== ROOT_TYPE) throw Error("Invalid data format");
|
|
7708
7824
|
const rootPart = partFromJsonObject(root, keepPartId);
|
|
7709
|
-
if (!rootPart)
|
|
7710
|
-
throw new Error("Invalid data format");
|
|
7825
|
+
if (!rootPart) throw new Error("Invalid data format");
|
|
7711
7826
|
return rootPart;
|
|
7712
7827
|
}
|
|
7713
7828
|
serializeParts(partIds) {
|
|
@@ -7719,14 +7834,12 @@ class Model2 {
|
|
|
7719
7834
|
}
|
|
7720
7835
|
moveElements(partId, destPartId, destIndex, update, doNotChangeIndex) {
|
|
7721
7836
|
var _a;
|
|
7722
|
-
if (partId === destPartId)
|
|
7723
|
-
return;
|
|
7837
|
+
if (partId === destPartId) return;
|
|
7724
7838
|
const element = findElementById(this.yjsRoot, partId);
|
|
7725
7839
|
if (element) {
|
|
7726
7840
|
if (((_a = element.parent) == null ? void 0 : _a.getAttribute(PART_ID_KEY)) === destPartId) {
|
|
7727
7841
|
const index = this.getIndexOfElement(element);
|
|
7728
|
-
if (!doNotChangeIndex && index !== void 0 && index < destIndex)
|
|
7729
|
-
destIndex--;
|
|
7842
|
+
if (!doNotChangeIndex && index !== void 0 && index < destIndex) destIndex--;
|
|
7730
7843
|
}
|
|
7731
7844
|
const parts = this.findPartsByIds([partId]);
|
|
7732
7845
|
const param = {
|
|
@@ -7746,8 +7859,7 @@ class Model2 {
|
|
|
7746
7859
|
isMobilePart(part) {
|
|
7747
7860
|
let curPart = part;
|
|
7748
7861
|
while (curPart) {
|
|
7749
|
-
if (curPart.isPage() && this.rootPart.children && this.rootPart.children[0] === curPart)
|
|
7750
|
-
return true;
|
|
7862
|
+
if (curPart.isPage() && this.rootPart.children && this.rootPart.children[0] === curPart) return true;
|
|
7751
7863
|
curPart = curPart.parent;
|
|
7752
7864
|
}
|
|
7753
7865
|
return false;
|
|
@@ -7755,8 +7867,7 @@ class Model2 {
|
|
|
7755
7867
|
isPcPart(part) {
|
|
7756
7868
|
let curPart = part;
|
|
7757
7869
|
while (curPart) {
|
|
7758
|
-
if (curPart.isPage() && this.rootPart.children && this.rootPart.children[1] === curPart)
|
|
7759
|
-
return true;
|
|
7870
|
+
if (curPart.isPage() && this.rootPart.children && this.rootPart.children[1] === curPart) return true;
|
|
7760
7871
|
curPart = curPart.parent;
|
|
7761
7872
|
}
|
|
7762
7873
|
return false;
|
|
@@ -7844,19 +7955,16 @@ class Model2 {
|
|
|
7844
7955
|
}
|
|
7845
7956
|
getElementAttribute(node, name) {
|
|
7846
7957
|
let value = node.getAttribute(name);
|
|
7847
|
-
if (value)
|
|
7848
|
-
return value;
|
|
7958
|
+
if (value) return value;
|
|
7849
7959
|
value = node.getAttribute(`${name}.object`);
|
|
7850
|
-
if (value)
|
|
7851
|
-
return JSON.parse(value);
|
|
7960
|
+
if (value) return JSON.parse(value);
|
|
7852
7961
|
}
|
|
7853
7962
|
getIndexOfElement(element) {
|
|
7854
7963
|
if (element.parent instanceof YXmlElement) {
|
|
7855
7964
|
let index = 0;
|
|
7856
7965
|
let child = element.parent.firstChild;
|
|
7857
7966
|
while (child) {
|
|
7858
|
-
if (element === child)
|
|
7859
|
-
return index;
|
|
7967
|
+
if (element === child) return index;
|
|
7860
7968
|
child = child.nextSibling;
|
|
7861
7969
|
++index;
|
|
7862
7970
|
}
|
|
@@ -7917,8 +8025,7 @@ class PartManager {
|
|
|
7917
8025
|
}
|
|
7918
8026
|
getPropertyDefinition(partName, propertyName) {
|
|
7919
8027
|
const partDef = this.getPartDefinition(partName);
|
|
7920
|
-
if (!partDef || !partDef.propertyGroups)
|
|
7921
|
-
return;
|
|
8028
|
+
if (!partDef || !partDef.propertyGroups) return;
|
|
7922
8029
|
for (const group of partDef.propertyGroups) {
|
|
7923
8030
|
for (const property of group.properties) {
|
|
7924
8031
|
if (property.propertyName === propertyName) {
|
|
@@ -7941,6 +8048,23 @@ class PartManager {
|
|
|
7941
8048
|
return component ? { part, component } : void 0;
|
|
7942
8049
|
}).filter(notNull)) || [];
|
|
7943
8050
|
}
|
|
8051
|
+
getPartClassName(part) {
|
|
8052
|
+
if (part) {
|
|
8053
|
+
const def = this.getPartDefinition(part.partName);
|
|
8054
|
+
if (def) {
|
|
8055
|
+
return def.className;
|
|
8056
|
+
}
|
|
8057
|
+
}
|
|
8058
|
+
}
|
|
8059
|
+
isChildAllowed(part) {
|
|
8060
|
+
if (part) {
|
|
8061
|
+
const def = this.getPartDefinition(part.partName);
|
|
8062
|
+
if (def) {
|
|
8063
|
+
return def.allowsChild();
|
|
8064
|
+
}
|
|
8065
|
+
}
|
|
8066
|
+
return false;
|
|
8067
|
+
}
|
|
7944
8068
|
registerPartPropertyGroupEditors(editors) {
|
|
7945
8069
|
for (const name in editors) {
|
|
7946
8070
|
this.partPropertyGroupEditors.set(name, editors[name]);
|
|
@@ -8005,12 +8129,13 @@ class PartManager {
|
|
|
8005
8129
|
const defaultPartPropertyEditors = () => {
|
|
8006
8130
|
return {
|
|
8007
8131
|
"readonly-text": () => defineAsyncComponent(() => import("./PbPropertyEditorReadonlyText-Dgp_AVOD.js")),
|
|
8008
|
-
"text": () => defineAsyncComponent(() => import("./PbPropertyEditorText-
|
|
8009
|
-
"multiline-text": () => defineAsyncComponent(() => import("./PbPropertyEditorMultilineText-
|
|
8132
|
+
"text": () => defineAsyncComponent(() => import("./PbPropertyEditorText-DZA84Sn1.js")),
|
|
8133
|
+
"multiline-text": () => defineAsyncComponent(() => import("./PbPropertyEditorMultilineText-3hJVRryR.js")),
|
|
8010
8134
|
"select": () => defineAsyncComponent(() => import("./PbPropertyEditorSelect-CWedbXJI.js")),
|
|
8011
|
-
"color": () => defineAsyncComponent(() => import("./PbPropertyEditorColor-
|
|
8012
|
-
"image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-
|
|
8013
|
-
"html": () => defineAsyncComponent(() => import("./PbPropertyEditorHtml-
|
|
8135
|
+
"color": () => defineAsyncComponent(() => import("./PbPropertyEditorColor-B6yhXmGL.js")),
|
|
8136
|
+
"image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-6WNkin_o.js")),
|
|
8137
|
+
"html": () => defineAsyncComponent(() => import("./PbPropertyEditorHtml-fgIO3jaY.js")),
|
|
8138
|
+
"youtube": () => defineAsyncComponent(() => import("./PbPropertyEditorYoutube-DtcxO2uZ.js"))
|
|
8014
8139
|
};
|
|
8015
8140
|
};
|
|
8016
8141
|
const getPropertyValueOfParts = (parts, propertyName) => {
|
|
@@ -8028,6 +8153,25 @@ const isCursorInElement = (event, element) => {
|
|
|
8028
8153
|
const rect = element.getBoundingClientRect();
|
|
8029
8154
|
return event.clientX >= rect.left && event.clientX <= rect.right && event.clientY >= rect.top && event.clientY <= rect.bottom;
|
|
8030
8155
|
};
|
|
8156
|
+
const selectYoutubeVideo = (modal, url, callback) => {
|
|
8157
|
+
modal.openModal({
|
|
8158
|
+
component: defineAsyncComponent(() => import("./PbYoutubeModal-DFb6CQyW.js")),
|
|
8159
|
+
style: {
|
|
8160
|
+
minWidth: "500px",
|
|
8161
|
+
minHeight: "400px"
|
|
8162
|
+
},
|
|
8163
|
+
bind: {
|
|
8164
|
+
url
|
|
8165
|
+
},
|
|
8166
|
+
on: {
|
|
8167
|
+
selectUrl: (url2) => {
|
|
8168
|
+
if (callback) {
|
|
8169
|
+
callback(url2);
|
|
8170
|
+
}
|
|
8171
|
+
}
|
|
8172
|
+
}
|
|
8173
|
+
});
|
|
8174
|
+
};
|
|
8031
8175
|
let draggingPart;
|
|
8032
8176
|
const vPartHandler = {
|
|
8033
8177
|
mounted: (el, binding) => {
|
|
@@ -8056,13 +8200,10 @@ const setContextMenuHandler = (el, binding) => {
|
|
|
8056
8200
|
const pageBuilder = binding.value.pageBuilder;
|
|
8057
8201
|
const part = binding.value.part;
|
|
8058
8202
|
el.oncontextmenu = (event) => {
|
|
8059
|
-
if (event.altKey || event.ctrlKey || event.shiftKey)
|
|
8060
|
-
return;
|
|
8203
|
+
if (event.altKey || event.ctrlKey || event.shiftKey) return;
|
|
8061
8204
|
const eventAny = event;
|
|
8062
|
-
if (eventAny._partContextMenuHandled)
|
|
8063
|
-
|
|
8064
|
-
else
|
|
8065
|
-
eventAny._partContextMenuHandled = true;
|
|
8205
|
+
if (eventAny._partContextMenuHandled) return;
|
|
8206
|
+
else eventAny._partContextMenuHandled = true;
|
|
8066
8207
|
if (!pageBuilder.context.isSelected(part)) {
|
|
8067
8208
|
pageBuilder.context.setSelection([part]);
|
|
8068
8209
|
}
|
|
@@ -8240,22 +8381,19 @@ const _export_sfc = (sfc, props) => {
|
|
|
8240
8381
|
}
|
|
8241
8382
|
return target;
|
|
8242
8383
|
};
|
|
8243
|
-
const _sfc_main$
|
|
8384
|
+
const _sfc_main$p = {};
|
|
8244
8385
|
const _hoisted_1$s = { class: "pb-add-widget-button" };
|
|
8245
|
-
const _hoisted_2$i = /* @__PURE__ */ createElementVNode("span", { class: "icon material-icons-outlined" }, "add_box", -1);
|
|
8246
|
-
const _hoisted_3$f = /* @__PURE__ */ createElementVNode("span", { class: "text" }, "Add Widget", -1);
|
|
8247
|
-
const _hoisted_4$c = [
|
|
8248
|
-
_hoisted_2$i,
|
|
8249
|
-
_hoisted_3$f
|
|
8250
|
-
];
|
|
8251
8386
|
function _sfc_render$1(_ctx, _cache) {
|
|
8252
8387
|
return openBlock(), createElementBlock("div", _hoisted_1$s, [
|
|
8253
8388
|
createElementVNode("button", {
|
|
8254
8389
|
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("add-widget", $event))
|
|
8255
|
-
},
|
|
8390
|
+
}, _cache[1] || (_cache[1] = [
|
|
8391
|
+
createElementVNode("span", { class: "icon material-icons-outlined" }, "add_box", -1),
|
|
8392
|
+
createElementVNode("span", { class: "text" }, "Add Widget", -1)
|
|
8393
|
+
]))
|
|
8256
8394
|
]);
|
|
8257
8395
|
}
|
|
8258
|
-
const PbAddWidgetButton = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
8396
|
+
const PbAddWidgetButton = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$1]]);
|
|
8259
8397
|
const MOUSE_TRACKER_KEY = "mouseTracker";
|
|
8260
8398
|
const MOUSE_TRACKER_NOT_FOUND = "MouseTracker not found";
|
|
8261
8399
|
class MouseTracker {
|
|
@@ -8265,11 +8403,9 @@ class MouseTracker {
|
|
|
8265
8403
|
}
|
|
8266
8404
|
capture(callback) {
|
|
8267
8405
|
var _a;
|
|
8268
|
-
if (!this.iframe.value)
|
|
8269
|
-
return;
|
|
8406
|
+
if (!this.iframe.value) return;
|
|
8270
8407
|
const _document = (_a = this.iframe.value.contentWindow) == null ? void 0 : _a.document;
|
|
8271
|
-
if (!_document)
|
|
8272
|
-
return;
|
|
8408
|
+
if (!_document) return;
|
|
8273
8409
|
_document.addEventListener("mousemove", callback);
|
|
8274
8410
|
_document.addEventListener("mouseup", () => _document.removeEventListener("mousemove", callback), {
|
|
8275
8411
|
once: true
|
|
@@ -8282,16 +8418,11 @@ const provideMouseTracker = (iframe) => {
|
|
|
8282
8418
|
};
|
|
8283
8419
|
const useMouseTracker = () => {
|
|
8284
8420
|
const mouseTracker = inject(MOUSE_TRACKER_KEY);
|
|
8285
|
-
if (!mouseTracker)
|
|
8286
|
-
throw Error(MOUSE_TRACKER_NOT_FOUND);
|
|
8421
|
+
if (!mouseTracker) throw Error(MOUSE_TRACKER_NOT_FOUND);
|
|
8287
8422
|
return mouseTracker;
|
|
8288
8423
|
};
|
|
8289
|
-
const _hoisted_1$r = ["data-
|
|
8290
|
-
const
|
|
8291
|
-
key: 1,
|
|
8292
|
-
class: "children"
|
|
8293
|
-
};
|
|
8294
|
-
const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
8424
|
+
const _hoisted_1$r = ["data-part-id", "draggable"];
|
|
8425
|
+
const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
8295
8426
|
__name: "PbWidget",
|
|
8296
8427
|
props: {
|
|
8297
8428
|
part: {}
|
|
@@ -8301,12 +8432,11 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
8301
8432
|
const widget = ref(null);
|
|
8302
8433
|
const draggable = ref(true);
|
|
8303
8434
|
let dragStartX, dragStartY, initX, initY, initWidth, initHeight;
|
|
8304
|
-
const
|
|
8435
|
+
const panChild = (event) => {
|
|
8305
8436
|
draggable.value = false;
|
|
8306
8437
|
event.stopPropagation();
|
|
8307
8438
|
event.preventDefault();
|
|
8308
|
-
if (!widget.value)
|
|
8309
|
-
return;
|
|
8439
|
+
if (!widget.value) return;
|
|
8310
8440
|
dragStartX = event.clientX;
|
|
8311
8441
|
dragStartY = event.clientY;
|
|
8312
8442
|
initX = widget.value.offsetLeft;
|
|
@@ -8322,12 +8452,11 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
8322
8452
|
props.part.properties.left = `${left}px`;
|
|
8323
8453
|
props.part.properties.top = `${top}px`;
|
|
8324
8454
|
};
|
|
8325
|
-
const
|
|
8455
|
+
const resizeChild = (event) => {
|
|
8326
8456
|
draggable.value = false;
|
|
8327
8457
|
event.stopPropagation();
|
|
8328
8458
|
event.preventDefault();
|
|
8329
|
-
if (!widget.value)
|
|
8330
|
-
return;
|
|
8459
|
+
if (!widget.value) return;
|
|
8331
8460
|
const rect = widget.value.getBoundingClientRect();
|
|
8332
8461
|
dragStartX = event.clientX;
|
|
8333
8462
|
dragStartY = event.clientY;
|
|
@@ -8350,13 +8479,21 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
8350
8479
|
const props = __props;
|
|
8351
8480
|
const pageBuilder = usePageBuilderEditor();
|
|
8352
8481
|
const selected = computed(() => pageBuilder.context.isSelected(props.part));
|
|
8353
|
-
const classNames = computed(() => [
|
|
8354
|
-
|
|
8482
|
+
const classNames = computed(() => [
|
|
8483
|
+
pageBuilder.partManager.getPartClassName(props.part),
|
|
8484
|
+
selected.value ? "selected" : "",
|
|
8485
|
+
props.part.getClassNames()
|
|
8486
|
+
]);
|
|
8487
|
+
const styleTag = computed(() => props.part.getStyleTag());
|
|
8488
|
+
const style = computed(() => {
|
|
8355
8489
|
var _a, _b, _c, _d;
|
|
8356
|
-
let
|
|
8490
|
+
let style2 = {
|
|
8491
|
+
...props.part.getStyles(),
|
|
8492
|
+
...props.part.getInlineStyles() || {}
|
|
8493
|
+
};
|
|
8357
8494
|
if (props.part.isNestedWidget()) {
|
|
8358
|
-
|
|
8359
|
-
...
|
|
8495
|
+
style2 = {
|
|
8496
|
+
...style2,
|
|
8360
8497
|
position: "absolute",
|
|
8361
8498
|
left: ((_a = props.part.properties) == null ? void 0 : _a.left) || "",
|
|
8362
8499
|
right: ((_b = props.part.properties) == null ? void 0 : _b.right) || "",
|
|
@@ -8364,10 +8501,19 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
8364
8501
|
bottom: ((_d = props.part.properties) == null ? void 0 : _d.bottom) || ""
|
|
8365
8502
|
};
|
|
8366
8503
|
}
|
|
8367
|
-
return
|
|
8504
|
+
return style2;
|
|
8505
|
+
});
|
|
8506
|
+
const bind = computed(() => {
|
|
8507
|
+
return {
|
|
8508
|
+
part: props.part,
|
|
8509
|
+
placeholder: true
|
|
8510
|
+
};
|
|
8368
8511
|
});
|
|
8369
8512
|
const thisComponent = computed(() => pageBuilder.partManager.createPartComponent(props.part));
|
|
8370
|
-
|
|
8513
|
+
computed(() => pageBuilder.partManager.createPartComponents(props.part.children));
|
|
8514
|
+
const droppable = computed(() => {
|
|
8515
|
+
return pageBuilder.partManager.isChildAllowed(props.part);
|
|
8516
|
+
});
|
|
8371
8517
|
const locatePositionMark = (mark, target, mouseOffsetX, mouseOffsetY, draggingPart2, event) => {
|
|
8372
8518
|
if (props.part.isNestedWidget()) {
|
|
8373
8519
|
if (draggingPart2.isWidget())
|
|
@@ -8473,8 +8619,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
8473
8619
|
};
|
|
8474
8620
|
const locateWidget = (mark, target, mouseOffsetX, mouseOffsetY, draggingPart2, event) => {
|
|
8475
8621
|
var _a, _b, _c;
|
|
8476
|
-
if (draggingPart2.partId === props.part.partId && !props.part.isNestedWidget())
|
|
8477
|
-
return;
|
|
8622
|
+
if (draggingPart2.partId === props.part.partId && !props.part.isNestedWidget()) return;
|
|
8478
8623
|
mark.style.background = "#27ae60";
|
|
8479
8624
|
const isNestedWidget = props.part.isNestedWidget();
|
|
8480
8625
|
const widget2 = isNestedWidget ? props.part.parent : props.part;
|
|
@@ -8515,11 +8660,9 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
8515
8660
|
}
|
|
8516
8661
|
};
|
|
8517
8662
|
const acceptChildPart = (pageBuilder2, part, target, _index, partId, event) => {
|
|
8518
|
-
if (partId === props.part.partId && !props.part.isNestedWidget())
|
|
8519
|
-
return;
|
|
8663
|
+
if (partId === props.part.partId && !props.part.isNestedWidget()) return;
|
|
8520
8664
|
const droppedPart = pageBuilder2.model.findPartById(partId);
|
|
8521
|
-
if (!droppedPart)
|
|
8522
|
-
return;
|
|
8665
|
+
if (!droppedPart) return;
|
|
8523
8666
|
const targetRect = target.getBoundingClientRect();
|
|
8524
8667
|
const mouseOffsetX = event.clientX - targetRect.left;
|
|
8525
8668
|
const mouseOffsetY = event.clientY - targetRect.top;
|
|
@@ -8552,37 +8695,25 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
8552
8695
|
let index;
|
|
8553
8696
|
if (((_a = section.properties) == null ? void 0 : _a.direction) === "vertical") {
|
|
8554
8697
|
if (((_b = block.properties) == null ? void 0 : _b.direction) === "vertical") {
|
|
8555
|
-
if (isFirstBlock && isFirstWidget && mouseOffsetY <= centerY)
|
|
8556
|
-
|
|
8557
|
-
else
|
|
8558
|
-
index = blockIndex + 1;
|
|
8559
|
-
else
|
|
8560
|
-
return;
|
|
8698
|
+
if (isFirstBlock && isFirstWidget && mouseOffsetY <= centerY) index = blockIndex;
|
|
8699
|
+
else if (isLastBlock && isLastWidget && mouseOffsetY > centerY) index = blockIndex + 1;
|
|
8700
|
+
else return;
|
|
8561
8701
|
} else {
|
|
8562
|
-
if (isFirstBlock && mouseOffsetY <= centerY)
|
|
8563
|
-
|
|
8564
|
-
else
|
|
8565
|
-
index = blockIndex + 1;
|
|
8566
|
-
else
|
|
8567
|
-
return;
|
|
8702
|
+
if (isFirstBlock && mouseOffsetY <= centerY) index = blockIndex;
|
|
8703
|
+
else if (isLastBlock && mouseOffsetY > centerY) index = blockIndex + 1;
|
|
8704
|
+
else return;
|
|
8568
8705
|
}
|
|
8569
8706
|
} else {
|
|
8570
8707
|
if (((_c = block.properties) == null ? void 0 : _c.direction) === "vertical") {
|
|
8571
|
-
if (isFirstWidget && mouseOffsetY <= centerY)
|
|
8572
|
-
|
|
8573
|
-
else
|
|
8574
|
-
index = blockIndex + 1;
|
|
8575
|
-
else
|
|
8576
|
-
return;
|
|
8708
|
+
if (isFirstWidget && mouseOffsetY <= centerY) index = blockIndex;
|
|
8709
|
+
else if (isLastWidget && mouseOffsetY > centerY) index = blockIndex + 1;
|
|
8710
|
+
else return;
|
|
8577
8711
|
} else {
|
|
8578
|
-
if (mouseOffsetY <= centerY)
|
|
8579
|
-
|
|
8580
|
-
else
|
|
8581
|
-
index = blockIndex + 1;
|
|
8712
|
+
if (mouseOffsetY <= centerY) index = blockIndex;
|
|
8713
|
+
else index = blockIndex + 1;
|
|
8582
8714
|
}
|
|
8583
8715
|
}
|
|
8584
|
-
if (((_d = page.children) == null ? void 0 : _d.indexOf(droppedPart)) === index)
|
|
8585
|
-
return;
|
|
8716
|
+
if (((_d = page.children) == null ? void 0 : _d.indexOf(droppedPart)) === index) return;
|
|
8586
8717
|
pageBuilder2.model.moveElements(droppedPart.partId, section.partId, index);
|
|
8587
8718
|
};
|
|
8588
8719
|
const acceptBlock = (pageBuilder2, target, droppedPart, mouseOffsetX, mouseOffsetY) => {
|
|
@@ -8599,36 +8730,25 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
8599
8730
|
if (((_a = section.properties) == null ? void 0 : _a.direction) === "vertical") {
|
|
8600
8731
|
const centerY = widgetElement.offsetHeight / 2;
|
|
8601
8732
|
if (((_b = block.properties) == null ? void 0 : _b.direction) === "vertical") {
|
|
8602
|
-
if (isFirstWidget && mouseOffsetY <= centerY)
|
|
8603
|
-
|
|
8604
|
-
else
|
|
8605
|
-
index = blockIndex + 1;
|
|
8606
|
-
else
|
|
8607
|
-
return;
|
|
8733
|
+
if (isFirstWidget && mouseOffsetY <= centerY) index = blockIndex;
|
|
8734
|
+
else if (isLastWidget && mouseOffsetY > centerY) index = blockIndex + 1;
|
|
8735
|
+
else return;
|
|
8608
8736
|
} else {
|
|
8609
|
-
if (mouseOffsetY <= centerY)
|
|
8610
|
-
|
|
8611
|
-
else
|
|
8612
|
-
index = blockIndex + 1;
|
|
8737
|
+
if (mouseOffsetY <= centerY) index = blockIndex;
|
|
8738
|
+
else index = blockIndex + 1;
|
|
8613
8739
|
}
|
|
8614
8740
|
} else {
|
|
8615
8741
|
const centerX = widgetElement.offsetWidth / 2;
|
|
8616
8742
|
if (((_c = block.properties) == null ? void 0 : _c.direction) === "vertical") {
|
|
8617
|
-
if (mouseOffsetX <= centerX)
|
|
8618
|
-
|
|
8619
|
-
else
|
|
8620
|
-
index = blockIndex + 1;
|
|
8743
|
+
if (mouseOffsetX <= centerX) index = blockIndex;
|
|
8744
|
+
else index = blockIndex + 1;
|
|
8621
8745
|
} else {
|
|
8622
|
-
if (isFirstWidget && mouseOffsetX <= centerX)
|
|
8623
|
-
|
|
8624
|
-
else
|
|
8625
|
-
index = blockIndex + 1;
|
|
8626
|
-
else
|
|
8627
|
-
return;
|
|
8746
|
+
if (isFirstWidget && mouseOffsetX <= centerX) index = blockIndex;
|
|
8747
|
+
else if (isLastWidget && mouseOffsetX > centerX) index = blockIndex + 1;
|
|
8748
|
+
else return;
|
|
8628
8749
|
}
|
|
8629
8750
|
}
|
|
8630
|
-
if (((_d = section.children) == null ? void 0 : _d.indexOf(droppedPart)) === index)
|
|
8631
|
-
return;
|
|
8751
|
+
if (((_d = section.children) == null ? void 0 : _d.indexOf(droppedPart)) === index) return;
|
|
8632
8752
|
pageBuilder2.model.moveElements(droppedPart.partId, section.partId, index);
|
|
8633
8753
|
};
|
|
8634
8754
|
const acceptWidget = (pageBuilder2, target, droppedPart, mouseOffsetX, mouseOffsetY) => {
|
|
@@ -8650,8 +8770,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
8650
8770
|
index = widgetIndex + 1;
|
|
8651
8771
|
} else {
|
|
8652
8772
|
index = ((_c = widget2.children) == null ? void 0 : _c.length) || 0;
|
|
8653
|
-
if (((_d = widget2.children) == null ? void 0 : _d.indexOf(droppedPart)) === index)
|
|
8654
|
-
return;
|
|
8773
|
+
if (((_d = widget2.children) == null ? void 0 : _d.indexOf(droppedPart)) === index) return;
|
|
8655
8774
|
const update2 = [{
|
|
8656
8775
|
partId: droppedPart.partId,
|
|
8657
8776
|
properties: {
|
|
@@ -8670,8 +8789,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
8670
8789
|
index = widgetIndex + 1;
|
|
8671
8790
|
} else {
|
|
8672
8791
|
index = ((_e = widget2.children) == null ? void 0 : _e.length) || 0;
|
|
8673
|
-
if (((_f = widget2.children) == null ? void 0 : _f.indexOf(droppedPart)) === index)
|
|
8674
|
-
return;
|
|
8792
|
+
if (((_f = widget2.children) == null ? void 0 : _f.indexOf(droppedPart)) === index) return;
|
|
8675
8793
|
const update2 = [{
|
|
8676
8794
|
partId: droppedPart.partId,
|
|
8677
8795
|
properties: {
|
|
@@ -8691,8 +8809,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
8691
8809
|
index = mouseOffsetX <= centerX ? widgetIndex : widgetIndex + 1;
|
|
8692
8810
|
}
|
|
8693
8811
|
}
|
|
8694
|
-
if (block.children.indexOf(droppedPart) === index)
|
|
8695
|
-
return;
|
|
8812
|
+
if (block.children.indexOf(droppedPart) === index) return;
|
|
8696
8813
|
const update = [{
|
|
8697
8814
|
partId: droppedPart.partId,
|
|
8698
8815
|
properties: {
|
|
@@ -8706,65 +8823,56 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
8706
8823
|
};
|
|
8707
8824
|
const calculateDropIndex = (part, target, mouseOffsetX, mouseOffsetY, _event) => {
|
|
8708
8825
|
var _a;
|
|
8709
|
-
if (!part.children || part.children.length === 0)
|
|
8710
|
-
return 0;
|
|
8826
|
+
if (!part.children || part.children.length === 0) return 0;
|
|
8711
8827
|
const children = Array.from(target.children).filter((child) => !isPositionMark(child)).map((child) => child);
|
|
8712
8828
|
const dir = ((_a = props.part.properties) == null ? void 0 : _a.direction) || "vertical";
|
|
8713
8829
|
let index = 0;
|
|
8714
8830
|
for (const child of children) {
|
|
8715
8831
|
if (dir === "horizontal") {
|
|
8716
8832
|
const centerX = child.offsetLeft + child.offsetWidth / 2;
|
|
8717
|
-
if (mouseOffsetX <= centerX)
|
|
8718
|
-
return index;
|
|
8833
|
+
if (mouseOffsetX <= centerX) return index;
|
|
8719
8834
|
} else {
|
|
8720
8835
|
const centerY = child.offsetTop + child.offsetHeight / 2;
|
|
8721
|
-
if (mouseOffsetY <= centerY)
|
|
8722
|
-
return index;
|
|
8836
|
+
if (mouseOffsetY <= centerY) return index;
|
|
8723
8837
|
}
|
|
8724
8838
|
++index;
|
|
8725
8839
|
}
|
|
8726
8840
|
return index;
|
|
8727
8841
|
};
|
|
8728
8842
|
return (_ctx, _cache) => {
|
|
8729
|
-
return
|
|
8730
|
-
|
|
8731
|
-
ref: widget,
|
|
8732
|
-
class: [classNames.value, "pb-widget"],
|
|
8733
|
-
"data-model-id": _ctx.part.partId,
|
|
8734
|
-
draggable: draggable.value
|
|
8735
|
-
}, properties.value), [
|
|
8736
|
-
thisComponent.value ? (openBlock(), createBlock$1(resolveDynamicComponent(thisComponent.value), {
|
|
8843
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
8844
|
+
styleTag.value ? (openBlock(), createBlock$1(resolveDynamicComponent("style"), {
|
|
8737
8845
|
key: 0,
|
|
8738
|
-
|
|
8739
|
-
|
|
8740
|
-
|
|
8741
|
-
|
|
8742
|
-
|
|
8743
|
-
|
|
8744
|
-
|
|
8745
|
-
|
|
8746
|
-
|
|
8747
|
-
|
|
8748
|
-
}),
|
|
8749
|
-
|
|
8750
|
-
|
|
8751
|
-
|
|
8752
|
-
|
|
8753
|
-
|
|
8754
|
-
|
|
8755
|
-
|
|
8756
|
-
|
|
8757
|
-
|
|
8758
|
-
|
|
8759
|
-
|
|
8760
|
-
|
|
8761
|
-
|
|
8762
|
-
]);
|
|
8846
|
+
innerHTML: styleTag.value
|
|
8847
|
+
}, null, 8, ["innerHTML"])) : createCommentVNode("", true),
|
|
8848
|
+
withDirectives((openBlock(), createElementBlock("div", {
|
|
8849
|
+
ref_key: "widget",
|
|
8850
|
+
ref: widget,
|
|
8851
|
+
class: normalizeClass([classNames.value, "pb-widget"]),
|
|
8852
|
+
"data-part-id": _ctx.part.partId,
|
|
8853
|
+
draggable: draggable.value,
|
|
8854
|
+
style: normalizeStyle(style.value)
|
|
8855
|
+
}, [
|
|
8856
|
+
thisComponent.value ? (openBlock(), createBlock$1(resolveDynamicComponent(thisComponent.value), normalizeProps(mergeProps({ key: 0 }, bind.value)), null, 16)) : createCommentVNode("", true),
|
|
8857
|
+
selected.value && _ctx.part.isNestedWidget() ? (openBlock(), createElementBlock("div", {
|
|
8858
|
+
key: 1,
|
|
8859
|
+
class: "pan-handle",
|
|
8860
|
+
onMousedown: panChild
|
|
8861
|
+
}, null, 32)) : createCommentVNode("", true),
|
|
8862
|
+
selected.value && _ctx.part.isNestedWidget() ? (openBlock(), createElementBlock("div", {
|
|
8863
|
+
key: 2,
|
|
8864
|
+
class: "resize-handle",
|
|
8865
|
+
onMousedown: resizeChild
|
|
8866
|
+
}, null, 32)) : createCommentVNode("", true)
|
|
8867
|
+
], 14, _hoisted_1$r)), [
|
|
8868
|
+
[unref(vPartHandler), { pageBuilder: unref(pageBuilder), part: _ctx.part, droppable: droppable.value, locatePositionMark, calculateDropIndex, acceptChildPart }]
|
|
8869
|
+
])
|
|
8870
|
+
], 64);
|
|
8763
8871
|
};
|
|
8764
8872
|
}
|
|
8765
8873
|
});
|
|
8766
|
-
const _hoisted_1$q = ["data-
|
|
8767
|
-
const _sfc_main$
|
|
8874
|
+
const _hoisted_1$q = ["data-part-id"];
|
|
8875
|
+
const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
8768
8876
|
__name: "PbBlock",
|
|
8769
8877
|
props: {
|
|
8770
8878
|
part: {}
|
|
@@ -8777,7 +8885,13 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
8777
8885
|
selected.value ? "selected" : "",
|
|
8778
8886
|
props.part.getClassNames()
|
|
8779
8887
|
]);
|
|
8780
|
-
const
|
|
8888
|
+
const styleTag = computed(() => props.part.getStyleTag());
|
|
8889
|
+
const properties = computed(() => ({
|
|
8890
|
+
style: {
|
|
8891
|
+
...props.part.getStyles(),
|
|
8892
|
+
...props.part.getInlineStyles()
|
|
8893
|
+
}
|
|
8894
|
+
}));
|
|
8781
8895
|
computed(() => pageBuilder.partManager.createPartComponents(props.part.children));
|
|
8782
8896
|
const addWidget = () => {
|
|
8783
8897
|
pageBuilder.commandRegistry.executeCommand(OpenAddWidgetModalCommand.COMMAND_ID);
|
|
@@ -8844,11 +8958,9 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
8844
8958
|
locateNone(mark.style);
|
|
8845
8959
|
};
|
|
8846
8960
|
const acceptChildPart = (pageBuilder2, part, target, _index, partId, event) => {
|
|
8847
|
-
if (partId === props.part.partId)
|
|
8848
|
-
return;
|
|
8961
|
+
if (partId === props.part.partId) return;
|
|
8849
8962
|
const droppedPart = pageBuilder2.model.findPartById(partId);
|
|
8850
|
-
if (!droppedPart)
|
|
8851
|
-
return;
|
|
8963
|
+
if (!droppedPart) return;
|
|
8852
8964
|
const targetRect = target.getBoundingClientRect();
|
|
8853
8965
|
const mouseOffsetX = event.clientX - targetRect.left;
|
|
8854
8966
|
const mouseOffsetY = event.clientY - targetRect.top;
|
|
@@ -8872,20 +8984,14 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
8872
8984
|
let index;
|
|
8873
8985
|
const centerY = blockElement.offsetHeight / 2;
|
|
8874
8986
|
if (((_a = section.properties) == null ? void 0 : _a.direction) === "vertical") {
|
|
8875
|
-
if (isFirstBlock && mouseOffsetY <= centerY)
|
|
8876
|
-
|
|
8877
|
-
else
|
|
8878
|
-
index = sectionIndex + 1;
|
|
8879
|
-
else
|
|
8880
|
-
return;
|
|
8987
|
+
if (isFirstBlock && mouseOffsetY <= centerY) index = sectionIndex;
|
|
8988
|
+
else if (isLastBlock && mouseOffsetY > centerY) index = sectionIndex + 1;
|
|
8989
|
+
else return;
|
|
8881
8990
|
} else {
|
|
8882
|
-
if (mouseOffsetY <= centerY)
|
|
8883
|
-
|
|
8884
|
-
else
|
|
8885
|
-
index = sectionIndex + 1;
|
|
8991
|
+
if (mouseOffsetY <= centerY) index = sectionIndex;
|
|
8992
|
+
else index = sectionIndex + 1;
|
|
8886
8993
|
}
|
|
8887
|
-
if (((_b = page.children) == null ? void 0 : _b.indexOf(droppedPart)) === index)
|
|
8888
|
-
return;
|
|
8994
|
+
if (((_b = page.children) == null ? void 0 : _b.indexOf(droppedPart)) === index) return;
|
|
8889
8995
|
pageBuilder2.model.moveElements(droppedPart.partId, page.partId, index);
|
|
8890
8996
|
};
|
|
8891
8997
|
const acceptBlock = (pageBuilder2, target, droppedPart, mouseOffsetX, mouseOffsetY) => {
|
|
@@ -8901,8 +9007,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
8901
9007
|
const centerX = target.offsetWidth / 2;
|
|
8902
9008
|
index = mouseOffsetX <= centerX ? blockIndex : blockIndex + 1;
|
|
8903
9009
|
}
|
|
8904
|
-
if (section.children.indexOf(droppedPart) === index)
|
|
8905
|
-
return;
|
|
9010
|
+
if (section.children.indexOf(droppedPart) === index) return;
|
|
8906
9011
|
pageBuilder2.model.moveElements(droppedPart.partId, section.partId, index);
|
|
8907
9012
|
};
|
|
8908
9013
|
const acceptWidget = (pageBuilder2, target, droppedPart, mouseOffsetX, mouseOffsetY) => {
|
|
@@ -8923,20 +9028,17 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
8923
9028
|
};
|
|
8924
9029
|
const calculateDropIndex = (part, target, mouseOffsetX, mouseOffsetY, _event) => {
|
|
8925
9030
|
var _a;
|
|
8926
|
-
if (!part.children || part.children.length === 0)
|
|
8927
|
-
return 0;
|
|
9031
|
+
if (!part.children || part.children.length === 0) return 0;
|
|
8928
9032
|
const children = Array.from(target.children).filter((child) => !isPositionMark(child)).map((child) => child);
|
|
8929
9033
|
const dir = ((_a = props.part.properties) == null ? void 0 : _a.direction) || "vertical";
|
|
8930
9034
|
let index = 0;
|
|
8931
9035
|
for (const child of children) {
|
|
8932
9036
|
if (dir === "horizontal") {
|
|
8933
9037
|
const centerX = child.offsetLeft + child.offsetWidth / 2;
|
|
8934
|
-
if (mouseOffsetX <= centerX)
|
|
8935
|
-
return index;
|
|
9038
|
+
if (mouseOffsetX <= centerX) return index;
|
|
8936
9039
|
} else {
|
|
8937
9040
|
const centerY = child.offsetTop + child.offsetHeight / 2;
|
|
8938
|
-
if (mouseOffsetY <= centerY)
|
|
8939
|
-
return index;
|
|
9041
|
+
if (mouseOffsetY <= centerY) return index;
|
|
8940
9042
|
}
|
|
8941
9043
|
++index;
|
|
8942
9044
|
}
|
|
@@ -8944,52 +9046,56 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
8944
9046
|
};
|
|
8945
9047
|
return (_ctx, _cache) => {
|
|
8946
9048
|
var _a, _b;
|
|
8947
|
-
return
|
|
8948
|
-
|
|
8949
|
-
"data-model-id": _ctx.part.partId,
|
|
8950
|
-
style: (_a = _ctx.part.properties) == null ? void 0 : _a.css
|
|
8951
|
-
}, properties.value), [
|
|
8952
|
-
!_ctx.part.children || ((_b = _ctx.part.children) == null ? void 0 : _b.length) === 0 ? (openBlock(), createBlock$1(PbAddWidgetButton, {
|
|
9049
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
9050
|
+
styleTag.value ? (openBlock(), createBlock$1(resolveDynamicComponent("style"), {
|
|
8953
9051
|
key: 0,
|
|
8954
|
-
|
|
8955
|
-
})) : createCommentVNode("", true),
|
|
8956
|
-
(openBlock(
|
|
8957
|
-
|
|
8958
|
-
|
|
8959
|
-
|
|
8960
|
-
|
|
8961
|
-
|
|
8962
|
-
|
|
8963
|
-
|
|
8964
|
-
|
|
9052
|
+
innerHTML: styleTag.value
|
|
9053
|
+
}, null, 8, ["innerHTML"])) : createCommentVNode("", true),
|
|
9054
|
+
withDirectives((openBlock(), createElementBlock("div", mergeProps({
|
|
9055
|
+
class: [classNames.value, "pb-block"],
|
|
9056
|
+
"data-part-id": _ctx.part.partId,
|
|
9057
|
+
style: (_a = _ctx.part.properties) == null ? void 0 : _a.css
|
|
9058
|
+
}, properties.value), [
|
|
9059
|
+
!_ctx.part.children || ((_b = _ctx.part.children) == null ? void 0 : _b.length) === 0 ? (openBlock(), createBlock$1(PbAddWidgetButton, {
|
|
9060
|
+
key: 0,
|
|
9061
|
+
onAddWidget: addWidget
|
|
9062
|
+
})) : createCommentVNode("", true),
|
|
9063
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.part.children, (child) => {
|
|
9064
|
+
return openBlock(), createBlock$1(_sfc_main$o, {
|
|
9065
|
+
key: child.partId,
|
|
9066
|
+
part: child
|
|
9067
|
+
}, null, 8, ["part"]);
|
|
9068
|
+
}), 128))
|
|
9069
|
+
], 16, _hoisted_1$q)), [
|
|
9070
|
+
[unref(vPartHandler), { pageBuilder: unref(pageBuilder), part: _ctx.part, droppable: true, locatePositionMark, calculateDropIndex, acceptChildPart }]
|
|
9071
|
+
])
|
|
9072
|
+
], 64);
|
|
8965
9073
|
};
|
|
8966
9074
|
}
|
|
8967
9075
|
});
|
|
8968
9076
|
const _hoisted_1$p = { class: "pb-block" };
|
|
8969
|
-
const
|
|
8970
|
-
class: "pb-widget",
|
|
8971
|
-
style: { "margin": "0 auto" }
|
|
8972
|
-
}, [
|
|
8973
|
-
/* @__PURE__ */ createElementVNode("div", { class: "pb-login-widget" }, [
|
|
8974
|
-
/* @__PURE__ */ createElementVNode("h3", null, "Login Design Part")
|
|
8975
|
-
])
|
|
8976
|
-
], -1);
|
|
8977
|
-
const _hoisted_3$e = [
|
|
8978
|
-
_hoisted_2$g
|
|
8979
|
-
];
|
|
8980
|
-
const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
9077
|
+
const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
8981
9078
|
__name: "PbLoginDepart",
|
|
8982
9079
|
props: {
|
|
8983
9080
|
part: {}
|
|
8984
9081
|
},
|
|
8985
9082
|
setup(__props) {
|
|
8986
9083
|
return (_ctx, _cache) => {
|
|
8987
|
-
return openBlock(), createElementBlock("div", _hoisted_1$p,
|
|
9084
|
+
return openBlock(), createElementBlock("div", _hoisted_1$p, _cache[0] || (_cache[0] = [
|
|
9085
|
+
createElementVNode("div", {
|
|
9086
|
+
class: "pb-widget",
|
|
9087
|
+
style: { "margin": "0 auto" }
|
|
9088
|
+
}, [
|
|
9089
|
+
createElementVNode("div", { class: "pb-login-widget" }, [
|
|
9090
|
+
createElementVNode("h3", null, "Login Design Part")
|
|
9091
|
+
])
|
|
9092
|
+
], -1)
|
|
9093
|
+
]));
|
|
8988
9094
|
};
|
|
8989
9095
|
}
|
|
8990
9096
|
});
|
|
8991
|
-
const _hoisted_1$o = ["data-
|
|
8992
|
-
const _sfc_main$
|
|
9097
|
+
const _hoisted_1$o = ["data-part-id"];
|
|
9098
|
+
const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
8993
9099
|
__name: "PbSection",
|
|
8994
9100
|
props: {
|
|
8995
9101
|
part: {}
|
|
@@ -9005,7 +9111,13 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
9005
9111
|
props.part.getClassNames()
|
|
9006
9112
|
];
|
|
9007
9113
|
});
|
|
9008
|
-
const
|
|
9114
|
+
const styleTag = computed(() => props.part.getStyleTag());
|
|
9115
|
+
const properties = computed(() => ({
|
|
9116
|
+
style: {
|
|
9117
|
+
...props.part.getStyles(),
|
|
9118
|
+
...props.part.getInlineStyles()
|
|
9119
|
+
}
|
|
9120
|
+
}));
|
|
9009
9121
|
const disabled = computed(() => {
|
|
9010
9122
|
var _a;
|
|
9011
9123
|
return ["static"].includes(((_a = props.part.properties) == null ? void 0 : _a.sectionType) || "");
|
|
@@ -9037,11 +9149,9 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
9037
9149
|
locateNone(mark.style);
|
|
9038
9150
|
};
|
|
9039
9151
|
const acceptChildPart = (pageBuilder2, part, target, _index, partId, event) => {
|
|
9040
|
-
if (partId === props.part.partId)
|
|
9041
|
-
return;
|
|
9152
|
+
if (partId === props.part.partId) return;
|
|
9042
9153
|
const droppedPart = pageBuilder2.model.findPartById(partId);
|
|
9043
|
-
if (!droppedPart)
|
|
9044
|
-
return;
|
|
9154
|
+
if (!droppedPart) return;
|
|
9045
9155
|
const targetRect = target.getBoundingClientRect();
|
|
9046
9156
|
const mouseOffsetX = event.clientX - targetRect.left;
|
|
9047
9157
|
const mouseOffsetY = event.clientY - targetRect.top;
|
|
@@ -9057,8 +9167,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
9057
9167
|
const sectionIndex = page.children.indexOf(section) || 0;
|
|
9058
9168
|
const centerY = sectionElement.offsetHeight / 2;
|
|
9059
9169
|
const index = mouseOffsetY <= centerY ? sectionIndex : sectionIndex + 1;
|
|
9060
|
-
if (page.children.indexOf(droppedPart) === index)
|
|
9061
|
-
return;
|
|
9170
|
+
if (page.children.indexOf(droppedPart) === index) return;
|
|
9062
9171
|
pageBuilder2.model.moveElements(droppedPart.partId, page.partId, index);
|
|
9063
9172
|
};
|
|
9064
9173
|
const acceptBlock = (pageBuilder2, target, droppedPart, mouseOffsetX, mouseOffsetY) => {
|
|
@@ -9067,20 +9176,17 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
9067
9176
|
};
|
|
9068
9177
|
const calculateDropIndex = (part, target, mouseOffsetX, mouseOffsetY, _event) => {
|
|
9069
9178
|
var _a;
|
|
9070
|
-
if (!part.children || part.children.length === 0)
|
|
9071
|
-
return 0;
|
|
9179
|
+
if (!part.children || part.children.length === 0) return 0;
|
|
9072
9180
|
const children = Array.from(target.children).filter((child) => !isPositionMark(child)).map((child) => child);
|
|
9073
9181
|
const dir = ((_a = props.part.properties) == null ? void 0 : _a.direction) || "vertical";
|
|
9074
9182
|
let index = 0;
|
|
9075
9183
|
for (const child of children) {
|
|
9076
9184
|
if (dir === "horizontal") {
|
|
9077
9185
|
const centerX = child.offsetLeft + child.offsetWidth / 2;
|
|
9078
|
-
if (mouseOffsetX <= centerX)
|
|
9079
|
-
return index;
|
|
9186
|
+
if (mouseOffsetX <= centerX) return index;
|
|
9080
9187
|
} else {
|
|
9081
9188
|
const centerY = child.offsetTop + child.offsetHeight / 2;
|
|
9082
|
-
if (mouseOffsetY <= centerY)
|
|
9083
|
-
return index;
|
|
9189
|
+
if (mouseOffsetY <= centerY) return index;
|
|
9084
9190
|
}
|
|
9085
9191
|
++index;
|
|
9086
9192
|
}
|
|
@@ -9088,50 +9194,47 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
9088
9194
|
};
|
|
9089
9195
|
return (_ctx, _cache) => {
|
|
9090
9196
|
var _a, _b, _c;
|
|
9091
|
-
return
|
|
9092
|
-
|
|
9093
|
-
|
|
9094
|
-
|
|
9095
|
-
|
|
9096
|
-
((
|
|
9097
|
-
|
|
9098
|
-
|
|
9099
|
-
|
|
9100
|
-
|
|
9101
|
-
|
|
9102
|
-
|
|
9103
|
-
|
|
9104
|
-
|
|
9105
|
-
|
|
9106
|
-
|
|
9107
|
-
|
|
9108
|
-
|
|
9109
|
-
|
|
9110
|
-
|
|
9111
|
-
|
|
9112
|
-
|
|
9113
|
-
|
|
9114
|
-
|
|
9197
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
9198
|
+
styleTag.value ? (openBlock(), createBlock$1(resolveDynamicComponent("style"), {
|
|
9199
|
+
key: 0,
|
|
9200
|
+
innerHTML: styleTag.value
|
|
9201
|
+
}, null, 8, ["innerHTML"])) : createCommentVNode("", true),
|
|
9202
|
+
withDirectives((openBlock(), createElementBlock("div", mergeProps({
|
|
9203
|
+
class: [classNames.value, "pb-section"],
|
|
9204
|
+
"data-part-id": _ctx.part.partId,
|
|
9205
|
+
style: (_a = _ctx.part.properties) == null ? void 0 : _a.css
|
|
9206
|
+
}, properties.value), [
|
|
9207
|
+
((_b = _ctx.part.properties) == null ? void 0 : _b.sectionType) === "static" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
9208
|
+
((_c = _ctx.part.properties) == null ? void 0 : _c.name) === "Login Design Part" ? (openBlock(), createBlock$1(_sfc_main$m, {
|
|
9209
|
+
key: 0,
|
|
9210
|
+
part: _ctx.part
|
|
9211
|
+
}, null, 8, ["part"])) : createCommentVNode("", true)
|
|
9212
|
+
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
9213
|
+
_ctx.part.children && _ctx.part.children.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.part.children, (block) => {
|
|
9214
|
+
return openBlock(), createBlock$1(_sfc_main$n, {
|
|
9215
|
+
key: block.partId,
|
|
9216
|
+
part: block
|
|
9217
|
+
}, null, 8, ["part"]);
|
|
9218
|
+
}), 128)) : (openBlock(), createBlock$1(PbAddWidgetButton, {
|
|
9219
|
+
key: 1,
|
|
9220
|
+
onAddWidget: addWidget
|
|
9221
|
+
}))
|
|
9222
|
+
], 64))
|
|
9223
|
+
], 16, _hoisted_1$o)), [
|
|
9224
|
+
[unref(vPartHandler), { pageBuilder: unref(pageBuilder), part: _ctx.part, droppable: true, locatePositionMark, calculateDropIndex, acceptChildPart }]
|
|
9225
|
+
])
|
|
9226
|
+
], 64);
|
|
9115
9227
|
};
|
|
9116
9228
|
}
|
|
9117
9229
|
});
|
|
9118
9230
|
const _hoisted_1$n = { class: "group-editor group-editor-position" };
|
|
9119
9231
|
const _hoisted_2$f = { class: "flex-align-center" };
|
|
9120
|
-
const _hoisted_3$
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
const
|
|
9124
|
-
const
|
|
9125
|
-
const
|
|
9126
|
-
const _hoisted_7$4 = { class: "bs-layout-horizontal justify-content-center align-items-center" };
|
|
9127
|
-
const _hoisted_8$4 = /* @__PURE__ */ createElementVNode("div", {
|
|
9128
|
-
class: "d-inline-block text-center text-gray-300",
|
|
9129
|
-
style: { "width": "30%", "font-size": "12px" }
|
|
9130
|
-
}, [
|
|
9131
|
-
/* @__PURE__ */ createElementVNode("span", { class: "font-icon" }, "add")
|
|
9132
|
-
], -1);
|
|
9133
|
-
const _hoisted_9$4 = { class: "text-center" };
|
|
9134
|
-
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
9232
|
+
const _hoisted_3$c = { class: "flex-grow-1" };
|
|
9233
|
+
const _hoisted_4$9 = { class: "bg-gray-100 py-5 rounded-8" };
|
|
9234
|
+
const _hoisted_5$5 = { class: "text-center" };
|
|
9235
|
+
const _hoisted_6$5 = { class: "bs-layout-horizontal justify-content-center align-items-center" };
|
|
9236
|
+
const _hoisted_7$5 = { class: "text-center" };
|
|
9237
|
+
const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
9135
9238
|
__name: "PbPropertyGroupEditorPosition",
|
|
9136
9239
|
props: {
|
|
9137
9240
|
group: {},
|
|
@@ -9157,10 +9260,12 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
9157
9260
|
return (_ctx, _cache) => {
|
|
9158
9261
|
return openBlock(), createElementBlock("div", _hoisted_1$n, [
|
|
9159
9262
|
createElementVNode("div", _hoisted_2$f, [
|
|
9160
|
-
|
|
9161
|
-
|
|
9162
|
-
|
|
9163
|
-
|
|
9263
|
+
_cache[1] || (_cache[1] = createElementVNode("div", { class: "title" }, [
|
|
9264
|
+
createElementVNode("label", { textContent: "Position" })
|
|
9265
|
+
], -1)),
|
|
9266
|
+
createElementVNode("div", _hoisted_3$c, [
|
|
9267
|
+
createElementVNode("div", _hoisted_4$9, [
|
|
9268
|
+
createElementVNode("div", _hoisted_5$5, [
|
|
9164
9269
|
createVNode(unref(BSTextInput), {
|
|
9165
9270
|
"model-value": top.value,
|
|
9166
9271
|
class: "ml-4",
|
|
@@ -9169,7 +9274,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
9169
9274
|
"onUpdate:modelValue": updateTop
|
|
9170
9275
|
}, null, 8, ["model-value"])
|
|
9171
9276
|
]),
|
|
9172
|
-
createElementVNode("div",
|
|
9277
|
+
createElementVNode("div", _hoisted_6$5, [
|
|
9173
9278
|
createVNode(unref(BSTextInput), {
|
|
9174
9279
|
"model-value": left.value,
|
|
9175
9280
|
class: "ml-4",
|
|
@@ -9177,7 +9282,12 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
9177
9282
|
width: "30%",
|
|
9178
9283
|
"onUpdate:modelValue": updateLeft
|
|
9179
9284
|
}, null, 8, ["model-value"]),
|
|
9180
|
-
|
|
9285
|
+
_cache[0] || (_cache[0] = createElementVNode("div", {
|
|
9286
|
+
class: "d-inline-block text-center text-gray-300",
|
|
9287
|
+
style: { "width": "30%", "font-size": "12px" }
|
|
9288
|
+
}, [
|
|
9289
|
+
createElementVNode("span", { class: "font-icon" }, "add")
|
|
9290
|
+
], -1)),
|
|
9181
9291
|
createVNode(unref(BSTextInput), {
|
|
9182
9292
|
"model-value": right.value,
|
|
9183
9293
|
class: "ml-4",
|
|
@@ -9186,7 +9296,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
9186
9296
|
"onUpdate:modelValue": updateRight
|
|
9187
9297
|
}, null, 8, ["model-value"])
|
|
9188
9298
|
]),
|
|
9189
|
-
createElementVNode("div",
|
|
9299
|
+
createElementVNode("div", _hoisted_7$5, [
|
|
9190
9300
|
createVNode(unref(BSTextInput), {
|
|
9191
9301
|
"model-value": bottom.value,
|
|
9192
9302
|
class: "ml-4",
|
|
@@ -9204,11 +9314,12 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
9204
9314
|
});
|
|
9205
9315
|
const _hoisted_1$m = { class: "group-editor group-editor-size" };
|
|
9206
9316
|
const _hoisted_2$e = { class: "flex-align-center" };
|
|
9207
|
-
const _hoisted_3$
|
|
9208
|
-
|
|
9209
|
-
|
|
9210
|
-
const
|
|
9211
|
-
const
|
|
9317
|
+
const _hoisted_3$b = { class: "flex-grow-1 bs-layout-horizontal" };
|
|
9318
|
+
const _hoisted_4$8 = { class: "flex-align-center mt-12" };
|
|
9319
|
+
const _hoisted_5$4 = { class: "flex-grow-1 bs-layout-horizontal" };
|
|
9320
|
+
const _hoisted_6$4 = { class: "flex-align-center mt-12" };
|
|
9321
|
+
const _hoisted_7$4 = { class: "flex-grow-1 bs-layout-horizontal" };
|
|
9322
|
+
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
9212
9323
|
__name: "PbPropertyGroupEditorSize",
|
|
9213
9324
|
props: {
|
|
9214
9325
|
group: {},
|
|
@@ -9219,6 +9330,10 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
9219
9330
|
const pageBuilder = usePageBuilderEditor();
|
|
9220
9331
|
const width = computed(() => getPropertyValueOfParts(props.selectedParts, "width"));
|
|
9221
9332
|
const height = computed(() => getPropertyValueOfParts(props.selectedParts, "height"));
|
|
9333
|
+
const maxWidth = computed(() => getPropertyValueOfParts(props.selectedParts, "maxWidth"));
|
|
9334
|
+
const maxHeight = computed(() => getPropertyValueOfParts(props.selectedParts, "maxHeight"));
|
|
9335
|
+
const minWidth = computed(() => getPropertyValueOfParts(props.selectedParts, "minWidth"));
|
|
9336
|
+
const minHeight = computed(() => getPropertyValueOfParts(props.selectedParts, "minHeight"));
|
|
9222
9337
|
const updatePropertyValue = (properties) => {
|
|
9223
9338
|
pageBuilder.commandRegistry.executeCommand(
|
|
9224
9339
|
ChangePropertyCommand.COMMAND_ID,
|
|
@@ -9227,11 +9342,17 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
9227
9342
|
};
|
|
9228
9343
|
const updateWidth = (value) => updatePropertyValue({ width: value });
|
|
9229
9344
|
const updateHeight = (value) => updatePropertyValue({ height: value });
|
|
9345
|
+
const updateMaxWidth = (value) => updatePropertyValue({ maxWidth: value });
|
|
9346
|
+
const updateMaxHeight = (value) => updatePropertyValue({ maxWeight: value });
|
|
9347
|
+
const updateMinWidth = (value) => updatePropertyValue({ minWidth: value });
|
|
9348
|
+
const updateMinHeight = (value) => updatePropertyValue({ minHeight: value });
|
|
9230
9349
|
return (_ctx, _cache) => {
|
|
9231
9350
|
return openBlock(), createElementBlock("div", _hoisted_1$m, [
|
|
9232
9351
|
createElementVNode("div", _hoisted_2$e, [
|
|
9233
|
-
|
|
9234
|
-
|
|
9352
|
+
_cache[0] || (_cache[0] = createElementVNode("div", { class: "title" }, [
|
|
9353
|
+
createElementVNode("label", { textContent: "Size" })
|
|
9354
|
+
], -1)),
|
|
9355
|
+
createElementVNode("div", _hoisted_3$b, [
|
|
9235
9356
|
createVNode(unref(BSTextInput), {
|
|
9236
9357
|
"model-value": width.value,
|
|
9237
9358
|
class: "flex-grow-1 mr-2",
|
|
@@ -9245,6 +9366,44 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
9245
9366
|
"onUpdate:modelValue": updateHeight
|
|
9246
9367
|
}, null, 8, ["model-value"])
|
|
9247
9368
|
])
|
|
9369
|
+
]),
|
|
9370
|
+
createElementVNode("div", _hoisted_4$8, [
|
|
9371
|
+
_cache[1] || (_cache[1] = createElementVNode("div", { class: "title" }, [
|
|
9372
|
+
createElementVNode("label", { textContent: "Max Size" })
|
|
9373
|
+
], -1)),
|
|
9374
|
+
createElementVNode("div", _hoisted_5$4, [
|
|
9375
|
+
createVNode(unref(BSTextInput), {
|
|
9376
|
+
"model-value": maxWidth.value,
|
|
9377
|
+
class: "flex-grow-1 mr-2",
|
|
9378
|
+
prefix: "W",
|
|
9379
|
+
"onUpdate:modelValue": updateMaxWidth
|
|
9380
|
+
}, null, 8, ["model-value"]),
|
|
9381
|
+
createVNode(unref(BSTextInput), {
|
|
9382
|
+
"model-value": maxHeight.value,
|
|
9383
|
+
class: "flex-grow-1 ml-2",
|
|
9384
|
+
prefix: "H",
|
|
9385
|
+
"onUpdate:modelValue": updateMaxHeight
|
|
9386
|
+
}, null, 8, ["model-value"])
|
|
9387
|
+
])
|
|
9388
|
+
]),
|
|
9389
|
+
createElementVNode("div", _hoisted_6$4, [
|
|
9390
|
+
_cache[2] || (_cache[2] = createElementVNode("div", { class: "title" }, [
|
|
9391
|
+
createElementVNode("label", { textContent: "Min Size" })
|
|
9392
|
+
], -1)),
|
|
9393
|
+
createElementVNode("div", _hoisted_7$4, [
|
|
9394
|
+
createVNode(unref(BSTextInput), {
|
|
9395
|
+
"model-value": minWidth.value,
|
|
9396
|
+
class: "flex-grow-1 mr-2",
|
|
9397
|
+
prefix: "W",
|
|
9398
|
+
"onUpdate:modelValue": updateMinWidth
|
|
9399
|
+
}, null, 8, ["model-value"]),
|
|
9400
|
+
createVNode(unref(BSTextInput), {
|
|
9401
|
+
"model-value": minHeight.value,
|
|
9402
|
+
class: "flex-grow-1 ml-2",
|
|
9403
|
+
prefix: "H",
|
|
9404
|
+
"onUpdate:modelValue": updateMinHeight
|
|
9405
|
+
}, null, 8, ["model-value"])
|
|
9406
|
+
])
|
|
9248
9407
|
])
|
|
9249
9408
|
]);
|
|
9250
9409
|
};
|
|
@@ -9252,8 +9411,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
9252
9411
|
});
|
|
9253
9412
|
const prefix = "";
|
|
9254
9413
|
function styleInject(css, ref2) {
|
|
9255
|
-
if (ref2 === void 0)
|
|
9256
|
-
ref2 = {};
|
|
9414
|
+
if (ref2 === void 0) ref2 = {};
|
|
9257
9415
|
var insertAt = ref2.insertAt;
|
|
9258
9416
|
if (!css || typeof document === "undefined") {
|
|
9259
9417
|
return;
|
|
@@ -9409,15 +9567,15 @@ var script$4 = {
|
|
|
9409
9567
|
};
|
|
9410
9568
|
const _hoisted_1$l = { class: "vc-alpha" };
|
|
9411
9569
|
const _hoisted_2$d = { class: "vc-alpha-checkboard-wrap" };
|
|
9412
|
-
const _hoisted_3$
|
|
9570
|
+
const _hoisted_3$a = /* @__PURE__ */ createElementVNode(
|
|
9413
9571
|
"div",
|
|
9414
9572
|
{ class: "vc-alpha-picker" },
|
|
9415
9573
|
null,
|
|
9416
9574
|
-1
|
|
9417
9575
|
/* HOISTED */
|
|
9418
9576
|
);
|
|
9419
|
-
const _hoisted_4$
|
|
9420
|
-
_hoisted_3$
|
|
9577
|
+
const _hoisted_4$7 = [
|
|
9578
|
+
_hoisted_3$a
|
|
9421
9579
|
];
|
|
9422
9580
|
function render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
9423
9581
|
const _component_Checkboard = resolveComponent("Checkboard");
|
|
@@ -9451,7 +9609,7 @@ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
9451
9609
|
class: "vc-alpha-pointer",
|
|
9452
9610
|
style: normalizeStyle({ left: `${$options.colors.a * 100}%` })
|
|
9453
9611
|
},
|
|
9454
|
-
_hoisted_4$
|
|
9612
|
+
_hoisted_4$7,
|
|
9455
9613
|
4
|
|
9456
9614
|
/* STYLE */
|
|
9457
9615
|
)
|
|
@@ -10527,8 +10685,8 @@ var script$3 = {
|
|
|
10527
10685
|
};
|
|
10528
10686
|
const _hoisted_1$k = { class: "vc-editable-input" };
|
|
10529
10687
|
const _hoisted_2$c = ["aria-labelledby"];
|
|
10530
|
-
const _hoisted_3$
|
|
10531
|
-
const _hoisted_4$
|
|
10688
|
+
const _hoisted_3$9 = ["id", "for"];
|
|
10689
|
+
const _hoisted_4$6 = { class: "vc-input__desc" };
|
|
10532
10690
|
function render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
10533
10691
|
return openBlock(), createElementBlock("div", _hoisted_1$k, [
|
|
10534
10692
|
withDirectives(createElementVNode("input", {
|
|
@@ -10545,10 +10703,10 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
10545
10703
|
id: $options.labelId,
|
|
10546
10704
|
for: $props.label,
|
|
10547
10705
|
class: "vc-input__label"
|
|
10548
|
-
}, toDisplayString($options.labelSpanText), 9, _hoisted_3$
|
|
10706
|
+
}, toDisplayString($options.labelSpanText), 9, _hoisted_3$9),
|
|
10549
10707
|
createElementVNode(
|
|
10550
10708
|
"span",
|
|
10551
|
-
_hoisted_4$
|
|
10709
|
+
_hoisted_4$6,
|
|
10552
10710
|
toDisplayString($props.desc),
|
|
10553
10711
|
1
|
|
10554
10712
|
/* TEXT */
|
|
@@ -10639,15 +10797,15 @@ const _hoisted_2$b = /* @__PURE__ */ createElementVNode(
|
|
|
10639
10797
|
-1
|
|
10640
10798
|
/* HOISTED */
|
|
10641
10799
|
);
|
|
10642
|
-
const _hoisted_3$
|
|
10800
|
+
const _hoisted_3$8 = /* @__PURE__ */ createElementVNode(
|
|
10643
10801
|
"div",
|
|
10644
10802
|
{ class: "vc-saturation-circle" },
|
|
10645
10803
|
null,
|
|
10646
10804
|
-1
|
|
10647
10805
|
/* HOISTED */
|
|
10648
10806
|
);
|
|
10649
|
-
const _hoisted_4$
|
|
10650
|
-
_hoisted_3$
|
|
10807
|
+
const _hoisted_4$5 = [
|
|
10808
|
+
_hoisted_3$8
|
|
10651
10809
|
];
|
|
10652
10810
|
function render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
10653
10811
|
return openBlock(), createElementBlock(
|
|
@@ -10669,7 +10827,7 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
10669
10827
|
class: "vc-saturation-pointer",
|
|
10670
10828
|
style: normalizeStyle({ top: $options.pointerTop, left: $options.pointerLeft })
|
|
10671
10829
|
},
|
|
10672
|
-
_hoisted_4$
|
|
10830
|
+
_hoisted_4$5,
|
|
10673
10831
|
4
|
|
10674
10832
|
/* STYLE */
|
|
10675
10833
|
)
|
|
@@ -10818,7 +10976,7 @@ const _hoisted_2$a = /* @__PURE__ */ createElementVNode(
|
|
|
10818
10976
|
-1
|
|
10819
10977
|
/* HOISTED */
|
|
10820
10978
|
);
|
|
10821
|
-
const _hoisted_3$
|
|
10979
|
+
const _hoisted_3$7 = [
|
|
10822
10980
|
_hoisted_2$a
|
|
10823
10981
|
];
|
|
10824
10982
|
function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
@@ -10846,7 +11004,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
10846
11004
|
style: normalizeStyle({ top: $options.pointerTop, left: $options.pointerLeft }),
|
|
10847
11005
|
role: "presentation"
|
|
10848
11006
|
},
|
|
10849
|
-
_hoisted_3$
|
|
11007
|
+
_hoisted_3$7,
|
|
10850
11008
|
4
|
|
10851
11009
|
/* STYLE */
|
|
10852
11010
|
)
|
|
@@ -10948,19 +11106,19 @@ var script = {
|
|
|
10948
11106
|
};
|
|
10949
11107
|
const _hoisted_1$h = { class: "vc-sketch-saturation-wrap" };
|
|
10950
11108
|
const _hoisted_2$9 = { class: "vc-sketch-controls" };
|
|
10951
|
-
const _hoisted_3$
|
|
10952
|
-
const _hoisted_4$
|
|
10953
|
-
const _hoisted_5$
|
|
11109
|
+
const _hoisted_3$6 = { class: "vc-sketch-sliders" };
|
|
11110
|
+
const _hoisted_4$4 = { class: "vc-sketch-hue-wrap" };
|
|
11111
|
+
const _hoisted_5$3 = {
|
|
10954
11112
|
key: 0,
|
|
10955
11113
|
class: "vc-sketch-alpha-wrap"
|
|
10956
11114
|
};
|
|
10957
11115
|
const _hoisted_6$3 = { class: "vc-sketch-color-wrap" };
|
|
10958
11116
|
const _hoisted_7$3 = ["aria-label"];
|
|
10959
|
-
const _hoisted_8$
|
|
11117
|
+
const _hoisted_8$1 = {
|
|
10960
11118
|
key: 0,
|
|
10961
11119
|
class: "vc-sketch-field"
|
|
10962
11120
|
};
|
|
10963
|
-
const _hoisted_9$
|
|
11121
|
+
const _hoisted_9$1 = { class: "vc-sketch-field--double" };
|
|
10964
11122
|
const _hoisted_10$1 = { class: "vc-sketch-field--single" };
|
|
10965
11123
|
const _hoisted_11$1 = { class: "vc-sketch-field--single" };
|
|
10966
11124
|
const _hoisted_12$1 = { class: "vc-sketch-field--single" };
|
|
@@ -10974,7 +11132,7 @@ const _hoisted_14$1 = {
|
|
|
10974
11132
|
"aria-label": "A color preset, pick one to set as current color"
|
|
10975
11133
|
};
|
|
10976
11134
|
const _hoisted_15$1 = ["aria-label", "onClick"];
|
|
10977
|
-
const _hoisted_16
|
|
11135
|
+
const _hoisted_16 = ["aria-label", "onClick"];
|
|
10978
11136
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
10979
11137
|
const _component_Saturation = resolveComponent("Saturation");
|
|
10980
11138
|
const _component_Hue = resolveComponent("Hue");
|
|
@@ -10996,14 +11154,14 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
10996
11154
|
}, null, 8, ["value", "onChange"])
|
|
10997
11155
|
]),
|
|
10998
11156
|
createElementVNode("div", _hoisted_2$9, [
|
|
10999
|
-
createElementVNode("div", _hoisted_3$
|
|
11000
|
-
createElementVNode("div", _hoisted_4$
|
|
11157
|
+
createElementVNode("div", _hoisted_3$6, [
|
|
11158
|
+
createElementVNode("div", _hoisted_4$4, [
|
|
11001
11159
|
createVNode(_component_Hue, {
|
|
11002
11160
|
value: _ctx.colors,
|
|
11003
11161
|
onChange: $options.childChange
|
|
11004
11162
|
}, null, 8, ["value", "onChange"])
|
|
11005
11163
|
]),
|
|
11006
|
-
!$props.disableAlpha ? (openBlock(), createElementBlock("div", _hoisted_5$
|
|
11164
|
+
!$props.disableAlpha ? (openBlock(), createElementBlock("div", _hoisted_5$3, [
|
|
11007
11165
|
createVNode(_component_Alpha, {
|
|
11008
11166
|
value: _ctx.colors,
|
|
11009
11167
|
onChange: $options.childChange
|
|
@@ -11019,9 +11177,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
11019
11177
|
createVNode(_component_Checkboard)
|
|
11020
11178
|
])
|
|
11021
11179
|
]),
|
|
11022
|
-
!$props.disableFields ? (openBlock(), createElementBlock("div", _hoisted_8$
|
|
11180
|
+
!$props.disableFields ? (openBlock(), createElementBlock("div", _hoisted_8$1, [
|
|
11023
11181
|
createCommentVNode(" rgba "),
|
|
11024
|
-
createElementVNode("div", _hoisted_9$
|
|
11182
|
+
createElementVNode("div", _hoisted_9$1, [
|
|
11025
11183
|
createVNode(_component_EdIn, {
|
|
11026
11184
|
label: "hex",
|
|
11027
11185
|
value: $options.hex,
|
|
@@ -11081,7 +11239,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
11081
11239
|
onClick: ($event) => $options.handlePreset(c)
|
|
11082
11240
|
}, [
|
|
11083
11241
|
createVNode(_component_Checkboard)
|
|
11084
|
-
], 8, _hoisted_16
|
|
11242
|
+
], 8, _hoisted_16))
|
|
11085
11243
|
],
|
|
11086
11244
|
64
|
|
11087
11245
|
/* STABLE_FRAGMENT */
|
|
@@ -11101,7 +11259,7 @@ styleInject(css_248z);
|
|
|
11101
11259
|
script.render = render;
|
|
11102
11260
|
script.__file = "src/components/sketch/sketch.vue";
|
|
11103
11261
|
script.install = install;
|
|
11104
|
-
const _sfc_main$
|
|
11262
|
+
const _sfc_main$i = defineComponent({
|
|
11105
11263
|
name: "PbColorPicker",
|
|
11106
11264
|
components: {
|
|
11107
11265
|
Sketch: script
|
|
@@ -11119,12 +11277,9 @@ const _sfc_main$h = defineComponent({
|
|
|
11119
11277
|
setup(props, { emit }) {
|
|
11120
11278
|
const color = ref(props.value);
|
|
11121
11279
|
const appliedColor = computed(() => {
|
|
11122
|
-
if (typeof color.value === "string")
|
|
11123
|
-
|
|
11124
|
-
else
|
|
11125
|
-
return color.value.hex;
|
|
11126
|
-
else
|
|
11127
|
-
return;
|
|
11280
|
+
if (typeof color.value === "string") return color.value;
|
|
11281
|
+
else if (typeof color.value === "object" && color.value.hasOwnProperty("hex")) return color.value.hex;
|
|
11282
|
+
else return;
|
|
11128
11283
|
});
|
|
11129
11284
|
const isShowColorPicker = ref(false);
|
|
11130
11285
|
const toggle = (value) => {
|
|
@@ -11140,8 +11295,7 @@ const _sfc_main$h = defineComponent({
|
|
|
11140
11295
|
watch(
|
|
11141
11296
|
() => color.value,
|
|
11142
11297
|
() => setTimeout(() => {
|
|
11143
|
-
if (appliedColor.value)
|
|
11144
|
-
emit("change-color", appliedColor.value);
|
|
11298
|
+
if (appliedColor.value) emit("change-color", appliedColor.value);
|
|
11145
11299
|
}, 100),
|
|
11146
11300
|
{ deep: true }
|
|
11147
11301
|
);
|
|
@@ -11166,11 +11320,7 @@ const _sfc_main$h = defineComponent({
|
|
|
11166
11320
|
}
|
|
11167
11321
|
});
|
|
11168
11322
|
const _hoisted_1$g = { class: "buttons" };
|
|
11169
|
-
const _hoisted_2$8 =
|
|
11170
|
-
const _hoisted_3$6 = [
|
|
11171
|
-
_hoisted_2$8
|
|
11172
|
-
];
|
|
11173
|
-
const _hoisted_4$5 = { class: "sketch-wrap" };
|
|
11323
|
+
const _hoisted_2$8 = { class: "sketch-wrap" };
|
|
11174
11324
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
11175
11325
|
const _component_Sketch = resolveComponent("Sketch");
|
|
11176
11326
|
const _directive_click_outside = resolveDirective("click-outside");
|
|
@@ -11182,18 +11332,19 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
11182
11332
|
createElementVNode("div", _hoisted_1$g, [
|
|
11183
11333
|
renderSlot(_ctx.$slots, "button", normalizeProps(guardReactiveProps({ toggle: _ctx.toggle, color: _ctx.color })), () => [
|
|
11184
11334
|
createElementVNode("button", {
|
|
11185
|
-
class: normalizeClass([{ none: !_ctx.color }, "
|
|
11335
|
+
class: normalizeClass([{ none: !_ctx.color }, "picker-button"]),
|
|
11186
11336
|
style: normalizeStyle({ background: _ctx.appliedColor }),
|
|
11187
11337
|
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.toggle())
|
|
11188
11338
|
}, null, 6)
|
|
11189
11339
|
]),
|
|
11190
11340
|
!_ctx.hideDelete && _ctx.color ? (openBlock(), createElementBlock("button", {
|
|
11191
11341
|
key: 0,
|
|
11192
|
-
class: "pb-button",
|
|
11193
11342
|
onClick: _cache[1] || (_cache[1] = (...args) => _ctx.emptyColor && _ctx.emptyColor(...args))
|
|
11194
|
-
},
|
|
11343
|
+
}, _cache[4] || (_cache[4] = [
|
|
11344
|
+
createElementVNode("i", { class: "material-icons-outlined" }, "delete", -1)
|
|
11345
|
+
]))) : createCommentVNode("", true)
|
|
11195
11346
|
]),
|
|
11196
|
-
createElementVNode("div",
|
|
11347
|
+
createElementVNode("div", _hoisted_2$8, [
|
|
11197
11348
|
_ctx.isShowColorPicker ? (openBlock(), createBlock$1(_component_Sketch, {
|
|
11198
11349
|
key: 0,
|
|
11199
11350
|
modelValue: _ctx.color,
|
|
@@ -11205,15 +11356,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
11205
11356
|
[_directive_click_outside, () => _ctx.toggle(false)]
|
|
11206
11357
|
]);
|
|
11207
11358
|
}
|
|
11208
|
-
const PbColorPicker = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
11359
|
+
const PbColorPicker = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render]]);
|
|
11209
11360
|
const _hoisted_1$f = { class: "group-editor group-editor-background" };
|
|
11210
11361
|
const _hoisted_2$7 = { class: "flex-align-center" };
|
|
11211
|
-
const _hoisted_3$5 =
|
|
11212
|
-
|
|
11213
|
-
|
|
11214
|
-
const _hoisted_4$4 = { class: "bs-layout-horizontal" };
|
|
11215
|
-
const _hoisted_5$3 = { class: "color" };
|
|
11216
|
-
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
11362
|
+
const _hoisted_3$5 = { class: "bs-layout-horizontal" };
|
|
11363
|
+
const _hoisted_4$3 = { class: "color" };
|
|
11364
|
+
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
11217
11365
|
__name: "PbPropertyGroupEditorBackground",
|
|
11218
11366
|
props: {
|
|
11219
11367
|
group: {},
|
|
@@ -11238,17 +11386,21 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
11238
11386
|
const selectImage = () => {
|
|
11239
11387
|
const imageProvider = pageBuilder.getProvider("imageProvider");
|
|
11240
11388
|
if (imageProvider) {
|
|
11241
|
-
imageProvider({ modal }, (
|
|
11242
|
-
|
|
11389
|
+
imageProvider({ modal }, (media) => {
|
|
11390
|
+
if (media.mediaType === "Image") {
|
|
11391
|
+
updatePropertyValue({ backgroundImage: media.url });
|
|
11392
|
+
}
|
|
11243
11393
|
});
|
|
11244
11394
|
}
|
|
11245
11395
|
};
|
|
11246
11396
|
return (_ctx, _cache) => {
|
|
11247
11397
|
return openBlock(), createElementBlock("div", _hoisted_1$f, [
|
|
11248
11398
|
createElementVNode("div", _hoisted_2$7, [
|
|
11249
|
-
|
|
11250
|
-
|
|
11251
|
-
|
|
11399
|
+
_cache[3] || (_cache[3] = createElementVNode("div", { class: "title" }, [
|
|
11400
|
+
createElementVNode("label", { textContent: "Background" })
|
|
11401
|
+
], -1)),
|
|
11402
|
+
createElementVNode("div", _hoisted_3$5, [
|
|
11403
|
+
createElementVNode("div", _hoisted_4$3, [
|
|
11252
11404
|
createVNode(PbColorPicker, {
|
|
11253
11405
|
value: color.value,
|
|
11254
11406
|
"hide-delete": "",
|
|
@@ -11279,38 +11431,20 @@ const BottomLeftCornerIcon = "data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-
|
|
|
11279
11431
|
const BottomRightCornerIcon = "data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Transformed%20by:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23000000'%20transform='rotate(90)'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'/%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3cg%3e%3cpath%20fill='none'%20d='M0%200H24V24H0z'/%3e%3cpath%20d='M21%2019v2h-2v-2h2zm-4%200v2h-2v-2h2zm-4%200v2h-2v-2h2zm-4%200v2H7v-2h2zm-4%200v2H3v-2h2zm16-4v2h-2v-2h2zM5%2015v2H3v-2h2zm0-4v2H3v-2h2zm11-8c2.687%200%204.882%202.124%204.995%204.783L21%208v5h-2V8c0-1.591-1.255-2.903-2.824-2.995L16%205h-5V3h5zM5%207v2H3V7h2zm0-4v2H3V3h2zm4%200v2H7V3h2z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e";
|
|
11280
11432
|
const _hoisted_1$e = { class: "group-editor group-editor-border" };
|
|
11281
11433
|
const _hoisted_2$6 = { class: "flex-align-center" };
|
|
11282
|
-
const _hoisted_3$4 =
|
|
11283
|
-
|
|
11284
|
-
|
|
11285
|
-
const
|
|
11286
|
-
const
|
|
11287
|
-
|
|
11288
|
-
|
|
11289
|
-
const
|
|
11290
|
-
const
|
|
11291
|
-
const
|
|
11292
|
-
|
|
11293
|
-
|
|
11294
|
-
const
|
|
11295
|
-
const
|
|
11296
|
-
const _hoisted_11 = { class: "text-center" };
|
|
11297
|
-
const _hoisted_12 = { class: "bs-layout-horizontal justify-content-center align-items-center" };
|
|
11298
|
-
const _hoisted_13 = /* @__PURE__ */ createElementVNode("div", {
|
|
11299
|
-
class: "d-inline-block text-center text-gray-300",
|
|
11300
|
-
style: { "width": "30%", "font-size": "12px" }
|
|
11301
|
-
}, [
|
|
11302
|
-
/* @__PURE__ */ createElementVNode("span", { class: "font-icon" }, "add")
|
|
11303
|
-
], -1);
|
|
11304
|
-
const _hoisted_14 = { class: "text-center" };
|
|
11305
|
-
const _hoisted_15 = { class: "mt-8" };
|
|
11306
|
-
const _hoisted_16 = /* @__PURE__ */ createElementVNode("div", { class: "sub-title" }, [
|
|
11307
|
-
/* @__PURE__ */ createElementVNode("label", { textContent: "Border Radius" })
|
|
11308
|
-
], -1);
|
|
11309
|
-
const _hoisted_17 = { class: "flex-grow-1 mt-4" };
|
|
11310
|
-
const _hoisted_18 = { class: "bg-gray-100 py-5 rounded-8" };
|
|
11311
|
-
const _hoisted_19 = { class: "" };
|
|
11312
|
-
const _hoisted_20 = { class: "mt-2" };
|
|
11313
|
-
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
11434
|
+
const _hoisted_3$4 = { class: "" };
|
|
11435
|
+
const _hoisted_4$2 = { class: "color" };
|
|
11436
|
+
const _hoisted_5$2 = { class: "mt-8" };
|
|
11437
|
+
const _hoisted_6$2 = { class: "flex-grow-1 mt-4" };
|
|
11438
|
+
const _hoisted_7$2 = { class: "bg-gray-100 py-5 rounded-8" };
|
|
11439
|
+
const _hoisted_8 = { class: "text-center" };
|
|
11440
|
+
const _hoisted_9 = { class: "bs-layout-horizontal justify-content-center align-items-center" };
|
|
11441
|
+
const _hoisted_10 = { class: "text-center" };
|
|
11442
|
+
const _hoisted_11 = { class: "mt-8" };
|
|
11443
|
+
const _hoisted_12 = { class: "flex-grow-1 mt-4" };
|
|
11444
|
+
const _hoisted_13 = { class: "bg-gray-100 py-5 rounded-8" };
|
|
11445
|
+
const _hoisted_14 = { class: "" };
|
|
11446
|
+
const _hoisted_15 = { class: "mt-2" };
|
|
11447
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
11314
11448
|
__name: "PbPropertyGroupEditorBorder",
|
|
11315
11449
|
props: {
|
|
11316
11450
|
group: {},
|
|
@@ -11350,10 +11484,14 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
11350
11484
|
return (_ctx, _cache) => {
|
|
11351
11485
|
return openBlock(), createElementBlock("div", _hoisted_1$e, [
|
|
11352
11486
|
createElementVNode("div", _hoisted_2$6, [
|
|
11353
|
-
|
|
11354
|
-
|
|
11355
|
-
|
|
11356
|
-
|
|
11487
|
+
_cache[7] || (_cache[7] = createElementVNode("div", { class: "title" }, [
|
|
11488
|
+
createElementVNode("label", { textContent: "Border" })
|
|
11489
|
+
], -1)),
|
|
11490
|
+
createElementVNode("div", _hoisted_3$4, [
|
|
11491
|
+
_cache[3] || (_cache[3] = createElementVNode("div", { class: "sub-title" }, [
|
|
11492
|
+
createElementVNode("label", { textContent: "Color" })
|
|
11493
|
+
], -1)),
|
|
11494
|
+
createElementVNode("div", _hoisted_4$2, [
|
|
11357
11495
|
createVNode(PbColorPicker, {
|
|
11358
11496
|
value: color.value,
|
|
11359
11497
|
"hide-delete": "",
|
|
@@ -11371,11 +11509,13 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
11371
11509
|
}, null, 8, ["model-value"])
|
|
11372
11510
|
])
|
|
11373
11511
|
]),
|
|
11374
|
-
createElementVNode("div",
|
|
11375
|
-
|
|
11376
|
-
|
|
11377
|
-
|
|
11378
|
-
|
|
11512
|
+
createElementVNode("div", _hoisted_5$2, [
|
|
11513
|
+
_cache[5] || (_cache[5] = createElementVNode("div", { class: "sub-title" }, [
|
|
11514
|
+
createElementVNode("label", { textContent: "Border Width" })
|
|
11515
|
+
], -1)),
|
|
11516
|
+
createElementVNode("div", _hoisted_6$2, [
|
|
11517
|
+
createElementVNode("div", _hoisted_7$2, [
|
|
11518
|
+
createElementVNode("div", _hoisted_8, [
|
|
11379
11519
|
createVNode(unref(BSTextInput), {
|
|
11380
11520
|
"model-value": borderTopWidth.value,
|
|
11381
11521
|
class: "ml-4",
|
|
@@ -11384,7 +11524,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
11384
11524
|
"onUpdate:modelValue": updateBorderTopWidth
|
|
11385
11525
|
}, null, 8, ["model-value"])
|
|
11386
11526
|
]),
|
|
11387
|
-
createElementVNode("div",
|
|
11527
|
+
createElementVNode("div", _hoisted_9, [
|
|
11388
11528
|
createVNode(unref(BSTextInput), {
|
|
11389
11529
|
"model-value": borderLeftWidth.value,
|
|
11390
11530
|
class: "ml-4",
|
|
@@ -11392,7 +11532,12 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
11392
11532
|
width: "30%",
|
|
11393
11533
|
"onUpdate:modelValue": updateBorderLeftWidth
|
|
11394
11534
|
}, null, 8, ["model-value"]),
|
|
11395
|
-
|
|
11535
|
+
_cache[4] || (_cache[4] = createElementVNode("div", {
|
|
11536
|
+
class: "d-inline-block text-center text-gray-300",
|
|
11537
|
+
style: { "width": "30%", "font-size": "12px" }
|
|
11538
|
+
}, [
|
|
11539
|
+
createElementVNode("span", { class: "font-icon" }, "add")
|
|
11540
|
+
], -1)),
|
|
11396
11541
|
createVNode(unref(BSTextInput), {
|
|
11397
11542
|
"model-value": borderRightWidth.value,
|
|
11398
11543
|
class: "ml-4",
|
|
@@ -11401,7 +11546,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
11401
11546
|
"onUpdate:modelValue": updateBorderRightWidth
|
|
11402
11547
|
}, null, 8, ["model-value"])
|
|
11403
11548
|
]),
|
|
11404
|
-
createElementVNode("div",
|
|
11549
|
+
createElementVNode("div", _hoisted_10, [
|
|
11405
11550
|
createVNode(unref(BSTextInput), {
|
|
11406
11551
|
"model-value": borderBottomWidth.value,
|
|
11407
11552
|
class: "ml-4",
|
|
@@ -11413,11 +11558,13 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
11413
11558
|
])
|
|
11414
11559
|
])
|
|
11415
11560
|
]),
|
|
11416
|
-
createElementVNode("div",
|
|
11417
|
-
|
|
11418
|
-
|
|
11419
|
-
|
|
11420
|
-
|
|
11561
|
+
createElementVNode("div", _hoisted_11, [
|
|
11562
|
+
_cache[6] || (_cache[6] = createElementVNode("div", { class: "sub-title" }, [
|
|
11563
|
+
createElementVNode("label", { textContent: "Border Radius" })
|
|
11564
|
+
], -1)),
|
|
11565
|
+
createElementVNode("div", _hoisted_12, [
|
|
11566
|
+
createElementVNode("div", _hoisted_13, [
|
|
11567
|
+
createElementVNode("div", _hoisted_14, [
|
|
11421
11568
|
createVNode(unref(BSTextInput), {
|
|
11422
11569
|
"model-value": borderTopLeftRadius.value,
|
|
11423
11570
|
prefix: { type: "image-url", value: unref(TopLeftCornerIcon) },
|
|
@@ -11433,7 +11580,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
11433
11580
|
"onUpdate:modelValue": updateBorderTopRightRadius
|
|
11434
11581
|
}, null, 8, ["model-value", "prefix"])
|
|
11435
11582
|
]),
|
|
11436
|
-
createElementVNode("div",
|
|
11583
|
+
createElementVNode("div", _hoisted_15, [
|
|
11437
11584
|
createVNode(unref(BSTextInput), {
|
|
11438
11585
|
"model-value": borderBottomLeftRadius.value,
|
|
11439
11586
|
prefix: { type: "image-url", value: unref(BottomLeftCornerIcon) },
|
|
@@ -11459,21 +11606,12 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
11459
11606
|
});
|
|
11460
11607
|
const _hoisted_1$d = { class: "group-editor group-editor-margin" };
|
|
11461
11608
|
const _hoisted_2$5 = { class: "flex-align-center" };
|
|
11462
|
-
const _hoisted_3$3 =
|
|
11463
|
-
|
|
11464
|
-
|
|
11465
|
-
const
|
|
11466
|
-
const
|
|
11467
|
-
const
|
|
11468
|
-
const _hoisted_7$1 = { class: "bs-layout-horizontal justify-content-center align-items-center" };
|
|
11469
|
-
const _hoisted_8$1 = /* @__PURE__ */ createElementVNode("div", {
|
|
11470
|
-
class: "d-inline-block text-center text-gray-300",
|
|
11471
|
-
style: { "width": "30%", "font-size": "12px" }
|
|
11472
|
-
}, [
|
|
11473
|
-
/* @__PURE__ */ createElementVNode("span", { class: "font-icon" }, "add")
|
|
11474
|
-
], -1);
|
|
11475
|
-
const _hoisted_9$1 = { class: "text-center" };
|
|
11476
|
-
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
11609
|
+
const _hoisted_3$3 = { class: "flex-grow-1" };
|
|
11610
|
+
const _hoisted_4$1 = { class: "bg-gray-100 py-5 rounded-8" };
|
|
11611
|
+
const _hoisted_5$1 = { class: "text-center" };
|
|
11612
|
+
const _hoisted_6$1 = { class: "bs-layout-horizontal justify-content-center align-items-center" };
|
|
11613
|
+
const _hoisted_7$1 = { class: "text-center" };
|
|
11614
|
+
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
11477
11615
|
__name: "PbPropertyGroupEditorMargin",
|
|
11478
11616
|
props: {
|
|
11479
11617
|
group: {},
|
|
@@ -11499,10 +11637,12 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
11499
11637
|
return (_ctx, _cache) => {
|
|
11500
11638
|
return openBlock(), createElementBlock("div", _hoisted_1$d, [
|
|
11501
11639
|
createElementVNode("div", _hoisted_2$5, [
|
|
11502
|
-
|
|
11503
|
-
|
|
11504
|
-
|
|
11505
|
-
|
|
11640
|
+
_cache[1] || (_cache[1] = createElementVNode("div", { class: "title" }, [
|
|
11641
|
+
createElementVNode("label", { textContent: "Margin" })
|
|
11642
|
+
], -1)),
|
|
11643
|
+
createElementVNode("div", _hoisted_3$3, [
|
|
11644
|
+
createElementVNode("div", _hoisted_4$1, [
|
|
11645
|
+
createElementVNode("div", _hoisted_5$1, [
|
|
11506
11646
|
createVNode(unref(BSTextInput), {
|
|
11507
11647
|
"model-value": top.value,
|
|
11508
11648
|
class: "ml-4",
|
|
@@ -11511,7 +11651,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
11511
11651
|
"onUpdate:modelValue": updateTop
|
|
11512
11652
|
}, null, 8, ["model-value"])
|
|
11513
11653
|
]),
|
|
11514
|
-
createElementVNode("div",
|
|
11654
|
+
createElementVNode("div", _hoisted_6$1, [
|
|
11515
11655
|
createVNode(unref(BSTextInput), {
|
|
11516
11656
|
"model-value": left.value,
|
|
11517
11657
|
class: "ml-4",
|
|
@@ -11519,7 +11659,12 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
11519
11659
|
width: "30%",
|
|
11520
11660
|
"onUpdate:modelValue": updateLeft
|
|
11521
11661
|
}, null, 8, ["model-value"]),
|
|
11522
|
-
|
|
11662
|
+
_cache[0] || (_cache[0] = createElementVNode("div", {
|
|
11663
|
+
class: "d-inline-block text-center text-gray-300",
|
|
11664
|
+
style: { "width": "30%", "font-size": "12px" }
|
|
11665
|
+
}, [
|
|
11666
|
+
createElementVNode("span", { class: "font-icon" }, "add")
|
|
11667
|
+
], -1)),
|
|
11523
11668
|
createVNode(unref(BSTextInput), {
|
|
11524
11669
|
"model-value": right.value,
|
|
11525
11670
|
class: "ml-4",
|
|
@@ -11528,7 +11673,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
11528
11673
|
"onUpdate:modelValue": updateRight
|
|
11529
11674
|
}, null, 8, ["model-value"])
|
|
11530
11675
|
]),
|
|
11531
|
-
createElementVNode("div",
|
|
11676
|
+
createElementVNode("div", _hoisted_7$1, [
|
|
11532
11677
|
createVNode(unref(BSTextInput), {
|
|
11533
11678
|
"model-value": bottom.value,
|
|
11534
11679
|
class: "ml-4",
|
|
@@ -11546,21 +11691,12 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
11546
11691
|
});
|
|
11547
11692
|
const _hoisted_1$c = { class: "group-editor group-editor-padding" };
|
|
11548
11693
|
const _hoisted_2$4 = { class: "flex-align-center" };
|
|
11549
|
-
const _hoisted_3$2 =
|
|
11550
|
-
|
|
11551
|
-
|
|
11552
|
-
const
|
|
11553
|
-
const
|
|
11554
|
-
const
|
|
11555
|
-
const _hoisted_7 = { class: "bs-layout-horizontal justify-content-center align-items-center" };
|
|
11556
|
-
const _hoisted_8 = /* @__PURE__ */ createElementVNode("div", {
|
|
11557
|
-
class: "d-inline-block text-center text-gray-300",
|
|
11558
|
-
style: { "width": "30%", "font-size": "12px" }
|
|
11559
|
-
}, [
|
|
11560
|
-
/* @__PURE__ */ createElementVNode("span", { class: "font-icon" }, "add")
|
|
11561
|
-
], -1);
|
|
11562
|
-
const _hoisted_9 = { class: "text-center" };
|
|
11563
|
-
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
11694
|
+
const _hoisted_3$2 = { class: "flex-grow-1" };
|
|
11695
|
+
const _hoisted_4 = { class: "bg-gray-100 py-5 rounded-8" };
|
|
11696
|
+
const _hoisted_5 = { class: "text-center" };
|
|
11697
|
+
const _hoisted_6 = { class: "bs-layout-horizontal justify-content-center align-items-center" };
|
|
11698
|
+
const _hoisted_7 = { class: "text-center" };
|
|
11699
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
11564
11700
|
__name: "PbPropertyGroupEditorPadding",
|
|
11565
11701
|
props: {
|
|
11566
11702
|
group: {},
|
|
@@ -11586,10 +11722,12 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
11586
11722
|
return (_ctx, _cache) => {
|
|
11587
11723
|
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
11588
11724
|
createElementVNode("div", _hoisted_2$4, [
|
|
11589
|
-
|
|
11590
|
-
|
|
11591
|
-
|
|
11592
|
-
|
|
11725
|
+
_cache[1] || (_cache[1] = createElementVNode("div", { class: "title" }, [
|
|
11726
|
+
createElementVNode("label", { textContent: "Padding" })
|
|
11727
|
+
], -1)),
|
|
11728
|
+
createElementVNode("div", _hoisted_3$2, [
|
|
11729
|
+
createElementVNode("div", _hoisted_4, [
|
|
11730
|
+
createElementVNode("div", _hoisted_5, [
|
|
11593
11731
|
createVNode(unref(BSTextInput), {
|
|
11594
11732
|
"model-value": top.value,
|
|
11595
11733
|
class: "ml-4",
|
|
@@ -11598,7 +11736,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
11598
11736
|
"onUpdate:modelValue": updateTop
|
|
11599
11737
|
}, null, 8, ["model-value"])
|
|
11600
11738
|
]),
|
|
11601
|
-
createElementVNode("div",
|
|
11739
|
+
createElementVNode("div", _hoisted_6, [
|
|
11602
11740
|
createVNode(unref(BSTextInput), {
|
|
11603
11741
|
"model-value": left.value,
|
|
11604
11742
|
class: "ml-4",
|
|
@@ -11606,7 +11744,12 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
11606
11744
|
width: "30%",
|
|
11607
11745
|
"onUpdate:modelValue": updateLeft
|
|
11608
11746
|
}, null, 8, ["model-value"]),
|
|
11609
|
-
|
|
11747
|
+
_cache[0] || (_cache[0] = createElementVNode("div", {
|
|
11748
|
+
class: "d-inline-block text-center text-gray-300",
|
|
11749
|
+
style: { "width": "30%", "font-size": "12px" }
|
|
11750
|
+
}, [
|
|
11751
|
+
createElementVNode("span", { class: "font-icon" }, "add")
|
|
11752
|
+
], -1)),
|
|
11610
11753
|
createVNode(unref(BSTextInput), {
|
|
11611
11754
|
"model-value": right.value,
|
|
11612
11755
|
class: "ml-4",
|
|
@@ -11615,7 +11758,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
11615
11758
|
"onUpdate:modelValue": updateRight
|
|
11616
11759
|
}, null, 8, ["model-value"])
|
|
11617
11760
|
]),
|
|
11618
|
-
createElementVNode("div",
|
|
11761
|
+
createElementVNode("div", _hoisted_7, [
|
|
11619
11762
|
createVNode(unref(BSTextInput), {
|
|
11620
11763
|
"model-value": bottom.value,
|
|
11621
11764
|
class: "ml-4",
|
|
@@ -11657,7 +11800,7 @@ const positionGroup = () => {
|
|
|
11657
11800
|
propertyType: "text"
|
|
11658
11801
|
}
|
|
11659
11802
|
],
|
|
11660
|
-
propertyGroupEditor: () => _sfc_main$
|
|
11803
|
+
propertyGroupEditor: () => _sfc_main$k
|
|
11661
11804
|
};
|
|
11662
11805
|
};
|
|
11663
11806
|
const sizeGroup = () => {
|
|
@@ -11696,7 +11839,7 @@ const sizeGroup = () => {
|
|
|
11696
11839
|
propertyType: "text"
|
|
11697
11840
|
}
|
|
11698
11841
|
],
|
|
11699
|
-
propertyGroupEditor: () => _sfc_main$
|
|
11842
|
+
propertyGroupEditor: () => _sfc_main$j
|
|
11700
11843
|
};
|
|
11701
11844
|
};
|
|
11702
11845
|
const marginGroup = () => {
|
|
@@ -11725,7 +11868,7 @@ const marginGroup = () => {
|
|
|
11725
11868
|
propertyType: "text"
|
|
11726
11869
|
}
|
|
11727
11870
|
],
|
|
11728
|
-
propertyGroupEditor: () => _sfc_main$
|
|
11871
|
+
propertyGroupEditor: () => _sfc_main$f
|
|
11729
11872
|
};
|
|
11730
11873
|
};
|
|
11731
11874
|
const paddingGroup = () => {
|
|
@@ -11754,7 +11897,7 @@ const paddingGroup = () => {
|
|
|
11754
11897
|
propertyType: "text"
|
|
11755
11898
|
}
|
|
11756
11899
|
],
|
|
11757
|
-
propertyGroupEditor: () => _sfc_main$
|
|
11900
|
+
propertyGroupEditor: () => _sfc_main$e
|
|
11758
11901
|
};
|
|
11759
11902
|
};
|
|
11760
11903
|
const commonGroup = () => {
|
|
@@ -11773,8 +11916,18 @@ const commonGroup = () => {
|
|
|
11773
11916
|
propertyType: "text"
|
|
11774
11917
|
},
|
|
11775
11918
|
{
|
|
11776
|
-
propertyName: "
|
|
11777
|
-
caption: "
|
|
11919
|
+
propertyName: "classNames",
|
|
11920
|
+
caption: "Class Names",
|
|
11921
|
+
propertyType: "text"
|
|
11922
|
+
},
|
|
11923
|
+
{
|
|
11924
|
+
propertyName: "inlineStyle",
|
|
11925
|
+
caption: "Inline Style",
|
|
11926
|
+
propertyType: "multiline-text"
|
|
11927
|
+
},
|
|
11928
|
+
{
|
|
11929
|
+
propertyName: "style",
|
|
11930
|
+
caption: "Style",
|
|
11778
11931
|
propertyType: "multiline-text"
|
|
11779
11932
|
},
|
|
11780
11933
|
{
|
|
@@ -11805,6 +11958,20 @@ const layoutGroup = () => {
|
|
|
11805
11958
|
]
|
|
11806
11959
|
};
|
|
11807
11960
|
};
|
|
11961
|
+
const alignGroup = () => {
|
|
11962
|
+
return {
|
|
11963
|
+
groupName: "align",
|
|
11964
|
+
caption: "Align",
|
|
11965
|
+
properties: [
|
|
11966
|
+
{
|
|
11967
|
+
propertyName: "align",
|
|
11968
|
+
caption: "Align",
|
|
11969
|
+
propertyType: "select",
|
|
11970
|
+
params: "left,center,right"
|
|
11971
|
+
}
|
|
11972
|
+
]
|
|
11973
|
+
};
|
|
11974
|
+
};
|
|
11808
11975
|
const backgroundGroup = () => {
|
|
11809
11976
|
return {
|
|
11810
11977
|
groupName: "background",
|
|
@@ -11821,7 +11988,7 @@ const backgroundGroup = () => {
|
|
|
11821
11988
|
propertyType: "image"
|
|
11822
11989
|
}
|
|
11823
11990
|
],
|
|
11824
|
-
propertyGroupEditor: () => _sfc_main$
|
|
11991
|
+
propertyGroupEditor: () => _sfc_main$h
|
|
11825
11992
|
};
|
|
11826
11993
|
};
|
|
11827
11994
|
const borderGroup = () => {
|
|
@@ -11875,30 +12042,61 @@ const borderGroup = () => {
|
|
|
11875
12042
|
propertyType: "text"
|
|
11876
12043
|
}
|
|
11877
12044
|
],
|
|
11878
|
-
propertyGroupEditor: () => _sfc_main$
|
|
12045
|
+
propertyGroupEditor: () => _sfc_main$g
|
|
11879
12046
|
};
|
|
11880
12047
|
};
|
|
11881
12048
|
const defaultPropertyGroups = () => {
|
|
11882
|
-
return [layoutGroup(), sizeGroup(), marginGroup(), paddingGroup(), backgroundGroup(), commonGroup()];
|
|
12049
|
+
return [layoutGroup(), alignGroup(), sizeGroup(), marginGroup(), paddingGroup(), backgroundGroup(), commonGroup()];
|
|
11883
12050
|
};
|
|
11884
12051
|
const defaultWidgetPropertyGroups = () => {
|
|
11885
|
-
return [positionGroup(), sizeGroup(), marginGroup(), paddingGroup(), borderGroup(), backgroundGroup(), commonGroup()];
|
|
12052
|
+
return [alignGroup(), positionGroup(), sizeGroup(), marginGroup(), paddingGroup(), borderGroup(), backgroundGroup(), commonGroup()];
|
|
11886
12053
|
};
|
|
12054
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
12055
|
+
__name: "PbContainerWidget",
|
|
12056
|
+
props: {
|
|
12057
|
+
part: {},
|
|
12058
|
+
placeholder: { type: Boolean }
|
|
12059
|
+
},
|
|
12060
|
+
setup(__props) {
|
|
12061
|
+
const pageBuilder = usePageBuilderEditor();
|
|
12062
|
+
const addWidget = () => {
|
|
12063
|
+
pageBuilder.commandRegistry.executeCommand(OpenAddWidgetModalCommand.COMMAND_ID);
|
|
12064
|
+
};
|
|
12065
|
+
return (_ctx, _cache) => {
|
|
12066
|
+
var _a;
|
|
12067
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
12068
|
+
_ctx.part.children ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.part.children, (child) => {
|
|
12069
|
+
return openBlock(), createBlock$1(_sfc_main$o, {
|
|
12070
|
+
key: child.partId,
|
|
12071
|
+
part: child
|
|
12072
|
+
}, null, 8, ["part"]);
|
|
12073
|
+
}), 128)) : createCommentVNode("", true),
|
|
12074
|
+
!_ctx.part.children || ((_a = _ctx.part.children) == null ? void 0 : _a.length) === 0 ? (openBlock(), createBlock$1(PbAddWidgetButton, {
|
|
12075
|
+
key: 1,
|
|
12076
|
+
onAddWidget: addWidget
|
|
12077
|
+
})) : createCommentVNode("", true)
|
|
12078
|
+
], 64);
|
|
12079
|
+
};
|
|
12080
|
+
}
|
|
12081
|
+
});
|
|
11887
12082
|
const pageParts = [
|
|
11888
12083
|
{
|
|
11889
12084
|
partType: "Page",
|
|
11890
12085
|
partName: "Page",
|
|
11891
12086
|
caption: "Page",
|
|
11892
12087
|
icon: "draft",
|
|
12088
|
+
className: "pb-page",
|
|
11893
12089
|
propertyGroups: [
|
|
12090
|
+
alignGroup(),
|
|
11894
12091
|
paddingGroup(),
|
|
11895
12092
|
backgroundGroup(),
|
|
11896
12093
|
commonGroup()
|
|
11897
12094
|
],
|
|
11898
|
-
initialProperties: {
|
|
11899
|
-
|
|
12095
|
+
initialProperties: {
|
|
12096
|
+
align: "center"
|
|
12097
|
+
},
|
|
11900
12098
|
allowsChild: () => true,
|
|
11901
|
-
creator: () => _sfc_main$
|
|
12099
|
+
creator: () => _sfc_main$l
|
|
11902
12100
|
}
|
|
11903
12101
|
];
|
|
11904
12102
|
const sectionParts = [
|
|
@@ -11907,15 +12105,16 @@ const sectionParts = [
|
|
|
11907
12105
|
partName: "Section",
|
|
11908
12106
|
caption: "Section",
|
|
11909
12107
|
icon: "rectangle",
|
|
12108
|
+
className: "pb-section",
|
|
11910
12109
|
propertyGroups: [
|
|
11911
12110
|
...defaultPropertyGroups()
|
|
11912
12111
|
],
|
|
11913
12112
|
initialProperties: {
|
|
11914
|
-
direction: "horizontal"
|
|
12113
|
+
direction: "horizontal",
|
|
12114
|
+
align: "center"
|
|
11915
12115
|
},
|
|
11916
|
-
localized: false,
|
|
11917
12116
|
allowsChild: () => true,
|
|
11918
|
-
creator: () => _sfc_main$
|
|
12117
|
+
creator: () => _sfc_main$l
|
|
11919
12118
|
}
|
|
11920
12119
|
];
|
|
11921
12120
|
const blockParts = [
|
|
@@ -11924,13 +12123,15 @@ const blockParts = [
|
|
|
11924
12123
|
partName: "Block",
|
|
11925
12124
|
caption: "Block",
|
|
11926
12125
|
icon: "space_dashboard",
|
|
12126
|
+
className: "pb-block",
|
|
11927
12127
|
propertyGroups: [
|
|
11928
12128
|
...defaultPropertyGroups()
|
|
11929
12129
|
],
|
|
11930
|
-
initialProperties: {
|
|
11931
|
-
|
|
12130
|
+
initialProperties: {
|
|
12131
|
+
align: "center"
|
|
12132
|
+
},
|
|
11932
12133
|
allowsChild: () => true,
|
|
11933
|
-
creator: () => _sfc_main$
|
|
12134
|
+
creator: () => _sfc_main$n
|
|
11934
12135
|
}
|
|
11935
12136
|
];
|
|
11936
12137
|
const widgets = [
|
|
@@ -11939,6 +12140,7 @@ const widgets = [
|
|
|
11939
12140
|
partName: "TextWidget",
|
|
11940
12141
|
caption: "Text",
|
|
11941
12142
|
icon: "insert_text",
|
|
12143
|
+
className: "pb-text-widget",
|
|
11942
12144
|
propertyGroups: [
|
|
11943
12145
|
{
|
|
11944
12146
|
groupName: "text",
|
|
@@ -11949,7 +12151,6 @@ const widgets = [
|
|
|
11949
12151
|
caption: "Text",
|
|
11950
12152
|
propertyType: "multiline-text",
|
|
11951
12153
|
params: "",
|
|
11952
|
-
localized: true,
|
|
11953
12154
|
multiLang: true
|
|
11954
12155
|
},
|
|
11955
12156
|
{
|
|
@@ -11958,6 +12159,18 @@ const widgets = [
|
|
|
11958
12159
|
propertyType: "text",
|
|
11959
12160
|
params: ""
|
|
11960
12161
|
},
|
|
12162
|
+
{
|
|
12163
|
+
propertyName: "fontWeight",
|
|
12164
|
+
caption: "Weight",
|
|
12165
|
+
propertyType: "text",
|
|
12166
|
+
params: ""
|
|
12167
|
+
},
|
|
12168
|
+
{
|
|
12169
|
+
propertyName: "textAlign",
|
|
12170
|
+
caption: "Text Align",
|
|
12171
|
+
propertyType: "select",
|
|
12172
|
+
params: "left,center,right"
|
|
12173
|
+
},
|
|
11961
12174
|
{
|
|
11962
12175
|
propertyName: "color",
|
|
11963
12176
|
caption: "Font Color",
|
|
@@ -11970,18 +12183,22 @@ const widgets = [
|
|
|
11970
12183
|
],
|
|
11971
12184
|
initialProperties: {
|
|
11972
12185
|
fontSize: "20px",
|
|
12186
|
+
textAlign: "center",
|
|
11973
12187
|
paddingTop: "12px",
|
|
11974
|
-
paddingBottom: "12px"
|
|
12188
|
+
paddingBottom: "12px",
|
|
12189
|
+
paddingLeft: "12px",
|
|
12190
|
+
paddingRight: "12px",
|
|
12191
|
+
align: "center"
|
|
11975
12192
|
},
|
|
11976
|
-
localized: true,
|
|
11977
12193
|
allowsChild: () => false,
|
|
11978
|
-
creator: () => _sfc_main$
|
|
12194
|
+
creator: () => _sfc_main$7$1
|
|
11979
12195
|
},
|
|
11980
12196
|
{
|
|
11981
12197
|
partType: "Widget",
|
|
11982
12198
|
partName: "ImageWidget",
|
|
11983
12199
|
caption: "Image",
|
|
11984
12200
|
icon: "imagesmode",
|
|
12201
|
+
className: "pb-image-widget",
|
|
11985
12202
|
propertyGroups: [
|
|
11986
12203
|
{
|
|
11987
12204
|
groupName: "image",
|
|
@@ -11991,23 +12208,22 @@ const widgets = [
|
|
|
11991
12208
|
propertyName: "image",
|
|
11992
12209
|
caption: "Image",
|
|
11993
12210
|
propertyType: "image",
|
|
11994
|
-
params: ""
|
|
11995
|
-
localized: true
|
|
12211
|
+
params: ""
|
|
11996
12212
|
}
|
|
11997
12213
|
]
|
|
11998
12214
|
},
|
|
11999
12215
|
...defaultWidgetPropertyGroups()
|
|
12000
12216
|
],
|
|
12001
12217
|
initialProperties: {},
|
|
12002
|
-
localized: true,
|
|
12003
12218
|
allowsChild: () => false,
|
|
12004
|
-
creator: () => _sfc_main$
|
|
12219
|
+
creator: () => _sfc_main$8$1
|
|
12005
12220
|
},
|
|
12006
12221
|
{
|
|
12007
12222
|
partType: "Widget",
|
|
12008
12223
|
partName: "HtmlWidget",
|
|
12009
12224
|
caption: "HTML",
|
|
12010
12225
|
icon: "code",
|
|
12226
|
+
className: "pb-html-widget",
|
|
12011
12227
|
propertyGroups: [
|
|
12012
12228
|
{
|
|
12013
12229
|
groupName: "html",
|
|
@@ -12018,7 +12234,6 @@ const widgets = [
|
|
|
12018
12234
|
caption: "HTML",
|
|
12019
12235
|
propertyType: "html",
|
|
12020
12236
|
params: "",
|
|
12021
|
-
localized: true,
|
|
12022
12237
|
multiLang: true
|
|
12023
12238
|
}
|
|
12024
12239
|
]
|
|
@@ -12026,15 +12241,15 @@ const widgets = [
|
|
|
12026
12241
|
...defaultWidgetPropertyGroups()
|
|
12027
12242
|
],
|
|
12028
12243
|
initialProperties: {},
|
|
12029
|
-
localized: true,
|
|
12030
12244
|
allowsChild: () => false,
|
|
12031
|
-
creator: () => _sfc_main$
|
|
12245
|
+
creator: () => _sfc_main$6$1
|
|
12032
12246
|
},
|
|
12033
12247
|
{
|
|
12034
12248
|
partType: "Widget",
|
|
12035
12249
|
partName: "IframeWidget",
|
|
12036
12250
|
caption: "IFrame",
|
|
12037
12251
|
icon: "code",
|
|
12252
|
+
className: "pb-iframe-widget",
|
|
12038
12253
|
propertyGroups: [
|
|
12039
12254
|
{
|
|
12040
12255
|
groupName: "iframe",
|
|
@@ -12045,7 +12260,6 @@ const widgets = [
|
|
|
12045
12260
|
caption: "URL",
|
|
12046
12261
|
propertyType: "text",
|
|
12047
12262
|
params: "",
|
|
12048
|
-
localized: true,
|
|
12049
12263
|
multiLang: true
|
|
12050
12264
|
}
|
|
12051
12265
|
]
|
|
@@ -12053,30 +12267,74 @@ const widgets = [
|
|
|
12053
12267
|
...defaultWidgetPropertyGroups()
|
|
12054
12268
|
],
|
|
12055
12269
|
initialProperties: {},
|
|
12056
|
-
localized: true,
|
|
12057
12270
|
allowsChild: () => false,
|
|
12058
|
-
creator: () => _sfc_main$
|
|
12059
|
-
}
|
|
12060
|
-
];
|
|
12061
|
-
const partDefinitions = {};
|
|
12062
|
-
for (const part of pageParts) {
|
|
12063
|
-
partDefinitions[part.partName] = part;
|
|
12064
|
-
}
|
|
12065
|
-
for (const part of sectionParts) {
|
|
12066
|
-
partDefinitions[part.partName] = part;
|
|
12067
|
-
}
|
|
12068
|
-
for (const part of blockParts) {
|
|
12069
|
-
partDefinitions[part.partName] = part;
|
|
12070
|
-
}
|
|
12071
|
-
for (const part of widgets) {
|
|
12072
|
-
partDefinitions[part.partName] = part;
|
|
12073
|
-
}
|
|
12074
|
-
[
|
|
12271
|
+
creator: () => _sfc_main$5$1
|
|
12272
|
+
},
|
|
12075
12273
|
{
|
|
12076
|
-
|
|
12077
|
-
|
|
12078
|
-
|
|
12079
|
-
|
|
12274
|
+
partType: "Widget",
|
|
12275
|
+
partName: "YoutubeWidget",
|
|
12276
|
+
caption: "Youtube",
|
|
12277
|
+
icon: "live_tv",
|
|
12278
|
+
className: "pb-youtube-widget",
|
|
12279
|
+
propertyGroups: [
|
|
12280
|
+
{
|
|
12281
|
+
groupName: "youtube",
|
|
12282
|
+
caption: "Youtube",
|
|
12283
|
+
properties: [
|
|
12284
|
+
{
|
|
12285
|
+
propertyName: "url",
|
|
12286
|
+
caption: "URL",
|
|
12287
|
+
propertyType: "youtube",
|
|
12288
|
+
params: ""
|
|
12289
|
+
}
|
|
12290
|
+
]
|
|
12291
|
+
},
|
|
12292
|
+
...defaultWidgetPropertyGroups()
|
|
12293
|
+
],
|
|
12294
|
+
initialProperties: {},
|
|
12295
|
+
allowsChild: () => false,
|
|
12296
|
+
creator: () => _sfc_main$4$1
|
|
12297
|
+
},
|
|
12298
|
+
{
|
|
12299
|
+
partType: "Widget",
|
|
12300
|
+
partName: "ContainerWidget",
|
|
12301
|
+
caption: "Container",
|
|
12302
|
+
icon: "widgets",
|
|
12303
|
+
className: "pb-container-widget",
|
|
12304
|
+
propertyGroups: [
|
|
12305
|
+
{
|
|
12306
|
+
groupName: "container",
|
|
12307
|
+
caption: "Container",
|
|
12308
|
+
properties: []
|
|
12309
|
+
},
|
|
12310
|
+
...defaultWidgetPropertyGroups()
|
|
12311
|
+
],
|
|
12312
|
+
initialProperties: {
|
|
12313
|
+
height: "200px"
|
|
12314
|
+
},
|
|
12315
|
+
allowsChild: () => true,
|
|
12316
|
+
creator: () => _sfc_main$d
|
|
12317
|
+
}
|
|
12318
|
+
];
|
|
12319
|
+
const partDefinitions = {};
|
|
12320
|
+
for (const part of pageParts) {
|
|
12321
|
+
partDefinitions[part.partName] = part;
|
|
12322
|
+
}
|
|
12323
|
+
for (const part of sectionParts) {
|
|
12324
|
+
partDefinitions[part.partName] = part;
|
|
12325
|
+
}
|
|
12326
|
+
for (const part of blockParts) {
|
|
12327
|
+
partDefinitions[part.partName] = part;
|
|
12328
|
+
}
|
|
12329
|
+
for (const part of widgets) {
|
|
12330
|
+
partDefinitions[part.partName] = part;
|
|
12331
|
+
}
|
|
12332
|
+
[
|
|
12333
|
+
{
|
|
12334
|
+
groupName: "Layout",
|
|
12335
|
+
caption: "Layout",
|
|
12336
|
+
partDefinitions: [
|
|
12337
|
+
...sectionParts,
|
|
12080
12338
|
...blockParts
|
|
12081
12339
|
]
|
|
12082
12340
|
}
|
|
@@ -12142,7 +12400,7 @@ __publicField(_OpenAddWidgetModalCommand, "COMMAND_ID", "OpenAddWidgetModal");
|
|
|
12142
12400
|
let OpenAddWidgetModalCommand = _OpenAddWidgetModalCommand;
|
|
12143
12401
|
const openWidgetAddModal = (modal, args, callback) => {
|
|
12144
12402
|
modal.openModal({
|
|
12145
|
-
component: defineAsyncComponent(() => import("./PbWidgetAddModal-
|
|
12403
|
+
component: defineAsyncComponent(() => import("./PbWidgetAddModal-DO1t-xsl.js")),
|
|
12146
12404
|
style: {
|
|
12147
12405
|
width: "80%",
|
|
12148
12406
|
height: "80%",
|
|
@@ -12160,6 +12418,10 @@ const openWidgetAddModal = (modal, args, callback) => {
|
|
|
12160
12418
|
addPart(args.pageBuilder, part, { image: url });
|
|
12161
12419
|
});
|
|
12162
12420
|
}
|
|
12421
|
+
} else if (["YoutubeWidget"].includes(part.partName)) {
|
|
12422
|
+
selectYoutubeVideo(modal, "", (url) => {
|
|
12423
|
+
addPart(args.pageBuilder, part, { url });
|
|
12424
|
+
});
|
|
12163
12425
|
} else {
|
|
12164
12426
|
if (callback) {
|
|
12165
12427
|
callback(part);
|
|
@@ -12172,20 +12434,11 @@ const openWidgetAddModal = (modal, args, callback) => {
|
|
|
12172
12434
|
});
|
|
12173
12435
|
};
|
|
12174
12436
|
const findInsertTargetAndIndex = (pageBuilder, partType) => {
|
|
12175
|
-
var _a
|
|
12437
|
+
var _a;
|
|
12176
12438
|
const selected = pageBuilder.context.getSelectedParts()[0];
|
|
12177
|
-
|
|
12178
|
-
if (partType === SECTION_TYPE) {
|
|
12179
|
-
const section = pageBuilder.partManager.findNearestSection(selected);
|
|
12180
|
-
return {
|
|
12181
|
-
target: page,
|
|
12182
|
-
index: section ? page.children.indexOf(section) + 1 : (_a = page.children) == null ? void 0 : _a.length
|
|
12183
|
-
};
|
|
12184
|
-
} else if (partType === WIDGET_TYPE) {
|
|
12185
|
-
pageBuilder.partManager.findNearestBlock(selected);
|
|
12186
|
-
}
|
|
12439
|
+
pageBuilder.context.getSelectedPage();
|
|
12187
12440
|
const target = pageBuilder.partManager.findNearestAvailableParentPart(selected, partType);
|
|
12188
|
-
const index = selected === target || !(target == null ? void 0 : target.children) ? ((
|
|
12441
|
+
const index = selected === target || !(target == null ? void 0 : target.children) ? ((_a = target == null ? void 0 : target.children) == null ? void 0 : _a.length) || 0 : target.children.indexOf(selected) + 1;
|
|
12189
12442
|
return { target, index };
|
|
12190
12443
|
};
|
|
12191
12444
|
const createPartWithDefinition = (def, properties) => {
|
|
@@ -12200,14 +12453,12 @@ const createPartWithDefinition = (def, properties) => {
|
|
|
12200
12453
|
};
|
|
12201
12454
|
const createSection = (pageBuilder) => {
|
|
12202
12455
|
const def = pageBuilder.partManager.getSectionDefinition();
|
|
12203
|
-
if (!def)
|
|
12204
|
-
return;
|
|
12456
|
+
if (!def) return;
|
|
12205
12457
|
return createPartWithDefinition(def);
|
|
12206
12458
|
};
|
|
12207
12459
|
const createBlock = (pageBuilder) => {
|
|
12208
12460
|
const def = pageBuilder.partManager.getBlockDefinition();
|
|
12209
|
-
if (!def)
|
|
12210
|
-
return;
|
|
12461
|
+
if (!def) return;
|
|
12211
12462
|
return createPartWithDefinition(def);
|
|
12212
12463
|
};
|
|
12213
12464
|
const findLeafPart = (part) => {
|
|
@@ -12230,8 +12481,7 @@ const insertParts = (pageBuilder, partId, index, parts, selectAfterInsert) => {
|
|
|
12230
12481
|
if (selectAfterInsert && result.inserted) {
|
|
12231
12482
|
const partId2 = result.inserted[0].partId;
|
|
12232
12483
|
const part = pageBuilder.model.findPartById(partId2);
|
|
12233
|
-
if (part)
|
|
12234
|
-
pageBuilder.context.setSelection([part]);
|
|
12484
|
+
if (part) pageBuilder.context.setSelection([part]);
|
|
12235
12485
|
}
|
|
12236
12486
|
};
|
|
12237
12487
|
const _AddPartCommand = class _AddPartCommand {
|
|
@@ -12254,8 +12504,7 @@ const _AddSectionCommand = class _AddSectionCommand {
|
|
|
12254
12504
|
}
|
|
12255
12505
|
execute(pageBuilder, args) {
|
|
12256
12506
|
const def = pageBuilder.partManager.getSectionDefinition();
|
|
12257
|
-
if (!def)
|
|
12258
|
-
return;
|
|
12507
|
+
if (!def) return;
|
|
12259
12508
|
addPart(pageBuilder, def);
|
|
12260
12509
|
}
|
|
12261
12510
|
};
|
|
@@ -12269,8 +12518,7 @@ const _AddBlockCommand = class _AddBlockCommand {
|
|
|
12269
12518
|
}
|
|
12270
12519
|
execute(pageBuilder, args) {
|
|
12271
12520
|
const def = pageBuilder.partManager.getBlockDefinition();
|
|
12272
|
-
if (!def)
|
|
12273
|
-
return;
|
|
12521
|
+
if (!def) return;
|
|
12274
12522
|
addPart(pageBuilder, def);
|
|
12275
12523
|
}
|
|
12276
12524
|
};
|
|
@@ -12285,8 +12533,7 @@ const addPart = (pageBuilder, def, attrs) => {
|
|
|
12285
12533
|
const target = page;
|
|
12286
12534
|
const index = section ? page.children.indexOf(section) + 1 : ((_a = page.children) == null ? void 0 : _a.length) || 0;
|
|
12287
12535
|
const newSection = createPartWithDefinition(def);
|
|
12288
|
-
if (!newSection)
|
|
12289
|
-
return;
|
|
12536
|
+
if (!newSection) return;
|
|
12290
12537
|
if (((_b = def.initialProperties) == null ? void 0 : _b.sectionType) !== "static") {
|
|
12291
12538
|
const block = createBlock(pageBuilder);
|
|
12292
12539
|
newSection.children = [block];
|
|
@@ -12296,42 +12543,36 @@ const addPart = (pageBuilder, def, attrs) => {
|
|
|
12296
12543
|
if (!selected) {
|
|
12297
12544
|
const newSection = createSection(pageBuilder);
|
|
12298
12545
|
const newBlock = createPartWithDefinition(def);
|
|
12299
|
-
if (!newSection || !newBlock)
|
|
12300
|
-
return;
|
|
12546
|
+
if (!newSection || !newBlock) return;
|
|
12301
12547
|
newSection.children = [newBlock];
|
|
12302
12548
|
insertParts(pageBuilder, page.partId, ((_c = page.children) == null ? void 0 : _c.length) || 0, [newSection], true);
|
|
12303
12549
|
} else if (selected.isSection()) {
|
|
12304
12550
|
const target = selected;
|
|
12305
12551
|
const index = ((_d = target == null ? void 0 : target.children) == null ? void 0 : _d.length) || 0;
|
|
12306
12552
|
const newBlock = createPartWithDefinition(def);
|
|
12307
|
-
if (!newBlock)
|
|
12308
|
-
return;
|
|
12553
|
+
if (!newBlock) return;
|
|
12309
12554
|
insertParts(pageBuilder, target.partId, index, [newBlock], true);
|
|
12310
12555
|
} else {
|
|
12311
12556
|
const block = pageBuilder.partManager.findNearestBlock(selected);
|
|
12312
12557
|
const target = block == null ? void 0 : block.parent;
|
|
12313
12558
|
const index = target.children.indexOf(block) + 1;
|
|
12314
12559
|
const newBlock = createPartWithDefinition(def);
|
|
12315
|
-
if (!newBlock)
|
|
12316
|
-
return;
|
|
12560
|
+
if (!newBlock) return;
|
|
12317
12561
|
insertParts(pageBuilder, target.partId, index, [newBlock], true);
|
|
12318
12562
|
}
|
|
12319
12563
|
} else {
|
|
12320
12564
|
const newWidget = createPartWithDefinition(def, attrs);
|
|
12321
|
-
if (!newWidget)
|
|
12322
|
-
return;
|
|
12565
|
+
if (!newWidget) return;
|
|
12323
12566
|
if (!selected) {
|
|
12324
12567
|
const newSection = createSection(pageBuilder);
|
|
12325
12568
|
const newBlock = createBlock(pageBuilder);
|
|
12326
|
-
if (!newSection || !newBlock)
|
|
12327
|
-
return;
|
|
12569
|
+
if (!newSection || !newBlock) return;
|
|
12328
12570
|
newSection.children = [newBlock];
|
|
12329
12571
|
newBlock.children = [newWidget];
|
|
12330
12572
|
insertParts(pageBuilder, page.partId, ((_e = page.children) == null ? void 0 : _e.length) || 0, [newSection], true);
|
|
12331
12573
|
} else if (selected.isSection()) {
|
|
12332
12574
|
const newBlock = createBlock(pageBuilder);
|
|
12333
|
-
if (!newBlock)
|
|
12334
|
-
return;
|
|
12575
|
+
if (!newBlock) return;
|
|
12335
12576
|
newBlock.children = [newWidget];
|
|
12336
12577
|
insertParts(pageBuilder, selected.partId, ((_f = selected.children) == null ? void 0 : _f.length) || 0, [newBlock], true);
|
|
12337
12578
|
} else if (selected.isBlock()) {
|
|
@@ -12343,12 +12584,11 @@ const addPart = (pageBuilder, def, attrs) => {
|
|
|
12343
12584
|
if (def2 && def2.allowsChild && def2.allowsChild(def2.partName)) {
|
|
12344
12585
|
const target = selected;
|
|
12345
12586
|
const index = ((_i = target.children) == null ? void 0 : _i.length) || 0;
|
|
12346
|
-
if (def2.partName === "
|
|
12347
|
-
if (!newWidget.properties)
|
|
12348
|
-
newWidget.properties = {};
|
|
12587
|
+
if (def2.partName === "ContainerWidget") {
|
|
12588
|
+
if (!newWidget.properties) newWidget.properties = {};
|
|
12349
12589
|
newWidget.properties.left = "25%";
|
|
12350
12590
|
newWidget.properties.top = "25%";
|
|
12351
|
-
newWidget.properties.width = "
|
|
12591
|
+
newWidget.properties.width = "40%";
|
|
12352
12592
|
}
|
|
12353
12593
|
insertParts(pageBuilder, target.partId, index, [newWidget], true);
|
|
12354
12594
|
} else {
|
|
@@ -12365,14 +12605,11 @@ const addPart = (pageBuilder, def, attrs) => {
|
|
|
12365
12605
|
};
|
|
12366
12606
|
const addSectionBefore = (pageBuilder, modal, args) => {
|
|
12367
12607
|
const selected = pageBuilder.context.getSelectedParts()[0];
|
|
12368
|
-
if (!selected)
|
|
12369
|
-
return;
|
|
12608
|
+
if (!selected) return;
|
|
12370
12609
|
const section = pageBuilder.partManager.findNearestSection(selected);
|
|
12371
|
-
if (!section || !section.parent || !section.parent.children)
|
|
12372
|
-
return;
|
|
12610
|
+
if (!section || !section.parent || !section.parent.children) return;
|
|
12373
12611
|
const newSection = createSection(pageBuilder);
|
|
12374
|
-
if (!newSection)
|
|
12375
|
-
return;
|
|
12612
|
+
if (!newSection) return;
|
|
12376
12613
|
const child = createBlock(pageBuilder);
|
|
12377
12614
|
newSection.children = [child];
|
|
12378
12615
|
const index = section.parent.children.indexOf(section);
|
|
@@ -12380,14 +12617,11 @@ const addSectionBefore = (pageBuilder, modal, args) => {
|
|
|
12380
12617
|
};
|
|
12381
12618
|
const addSectionAfter = (pageBuilder, modal, args) => {
|
|
12382
12619
|
const selected = pageBuilder.context.getSelectedParts()[0];
|
|
12383
|
-
if (!selected)
|
|
12384
|
-
return;
|
|
12620
|
+
if (!selected) return;
|
|
12385
12621
|
const section = pageBuilder.partManager.findNearestSection(selected);
|
|
12386
|
-
if (!section || !section.parent || !section.parent.children)
|
|
12387
|
-
return;
|
|
12622
|
+
if (!section || !section.parent || !section.parent.children) return;
|
|
12388
12623
|
const newSection = createSection(pageBuilder);
|
|
12389
|
-
if (!newSection)
|
|
12390
|
-
return;
|
|
12624
|
+
if (!newSection) return;
|
|
12391
12625
|
const child = createBlock(pageBuilder);
|
|
12392
12626
|
newSection.children = [child];
|
|
12393
12627
|
const index = section.parent.children.indexOf(section) + 1;
|
|
@@ -12395,22 +12629,18 @@ const addSectionAfter = (pageBuilder, modal, args) => {
|
|
|
12395
12629
|
};
|
|
12396
12630
|
const addBlockBefore = (pageBuilder) => {
|
|
12397
12631
|
const selected = pageBuilder.context.getSelectedParts()[0];
|
|
12398
|
-
if (!selected)
|
|
12399
|
-
return;
|
|
12632
|
+
if (!selected) return;
|
|
12400
12633
|
const block = pageBuilder.partManager.findNearestBlock(selected);
|
|
12401
|
-
if (!block || !block.parent || !block.parent.children)
|
|
12402
|
-
return;
|
|
12634
|
+
if (!block || !block.parent || !block.parent.children) return;
|
|
12403
12635
|
const newBlock = createBlock(pageBuilder);
|
|
12404
12636
|
const index = block.parent.children.indexOf(block);
|
|
12405
12637
|
insertParts(pageBuilder, block.parent.partId, index, [newBlock], true);
|
|
12406
12638
|
};
|
|
12407
12639
|
const addBlockAfter = (pageBuilder) => {
|
|
12408
12640
|
const selected = pageBuilder.context.getSelectedParts()[0];
|
|
12409
|
-
if (!selected)
|
|
12410
|
-
return;
|
|
12641
|
+
if (!selected) return;
|
|
12411
12642
|
const block = pageBuilder.partManager.findNearestBlock(selected);
|
|
12412
|
-
if (!block || !block.parent || !block.parent.children)
|
|
12413
|
-
return;
|
|
12643
|
+
if (!block || !block.parent || !block.parent.children) return;
|
|
12414
12644
|
const newBlock = createBlock(pageBuilder);
|
|
12415
12645
|
const index = block.parent.children.indexOf(block) + 1;
|
|
12416
12646
|
insertParts(pageBuilder, block.parent.partId, index, [newBlock], true);
|
|
@@ -12433,11 +12663,9 @@ const addWidgetBefore = (command, pageBuilder, modal, args) => {
|
|
|
12433
12663
|
return;
|
|
12434
12664
|
}
|
|
12435
12665
|
const widget = pageBuilder.context.getSingleSelectedWidget();
|
|
12436
|
-
if (!widget || !widget.parent || !widget.parent.children)
|
|
12437
|
-
return;
|
|
12666
|
+
if (!widget || !widget.parent || !widget.parent.children) return;
|
|
12438
12667
|
const newWidget = createPartWithDefinition(def, { image: args.image });
|
|
12439
|
-
if (!newWidget)
|
|
12440
|
-
return;
|
|
12668
|
+
if (!newWidget) return;
|
|
12441
12669
|
const index = widget.parent.children.indexOf(widget);
|
|
12442
12670
|
insertParts(pageBuilder, widget.parent.partId, index, [newWidget], true);
|
|
12443
12671
|
};
|
|
@@ -12459,11 +12687,9 @@ const addWidgetAfter = (command, pageBuilder, modal, args) => {
|
|
|
12459
12687
|
return;
|
|
12460
12688
|
}
|
|
12461
12689
|
const widget = pageBuilder.context.getSingleSelectedWidget();
|
|
12462
|
-
if (!widget || !widget.parent || !widget.parent.children)
|
|
12463
|
-
return;
|
|
12690
|
+
if (!widget || !widget.parent || !widget.parent.children) return;
|
|
12464
12691
|
const newWidget = createPartWithDefinition(def, { image: args.image });
|
|
12465
|
-
if (!newWidget)
|
|
12466
|
-
return;
|
|
12692
|
+
if (!newWidget) return;
|
|
12467
12693
|
const index = widget.parent.children.indexOf(widget) + 1;
|
|
12468
12694
|
insertParts(pageBuilder, widget.parent.partId, index, [newWidget], true);
|
|
12469
12695
|
};
|
|
@@ -12486,14 +12712,11 @@ const addWidgetInside = (command, pageBuilder, modal, args) => {
|
|
|
12486
12712
|
return;
|
|
12487
12713
|
}
|
|
12488
12714
|
let selected = pageBuilder.context.getSingleSelectedWidget() || pageBuilder.context.getSingleSelectedBlock();
|
|
12489
|
-
if (!selected)
|
|
12490
|
-
return;
|
|
12715
|
+
if (!selected) return;
|
|
12491
12716
|
const newWidget = createPartWithDefinition(def, { image: args.image });
|
|
12492
|
-
if (!newWidget)
|
|
12493
|
-
return;
|
|
12717
|
+
if (!newWidget) return;
|
|
12494
12718
|
if (selected.isWidget() && def.partName === "ImageWidget") {
|
|
12495
|
-
if (!newWidget.properties)
|
|
12496
|
-
newWidget.properties = {};
|
|
12719
|
+
if (!newWidget.properties) newWidget.properties = {};
|
|
12497
12720
|
newWidget.properties.left = "25%";
|
|
12498
12721
|
newWidget.properties.top = "25%";
|
|
12499
12722
|
newWidget.properties.width = "50%";
|
|
@@ -12722,8 +12945,7 @@ const _PastePartCommand = class _PastePartCommand {
|
|
|
12722
12945
|
const object = JSON.parse(json);
|
|
12723
12946
|
if (object.partType === ROOT_TYPE) {
|
|
12724
12947
|
const rootPart = partFromJsonObject(object, true);
|
|
12725
|
-
if (!rootPart)
|
|
12726
|
-
throw new Error("Invalid data format");
|
|
12948
|
+
if (!rootPart) throw new Error("Invalid data format");
|
|
12727
12949
|
let partIdsToDelete = void 0;
|
|
12728
12950
|
if (pageBuilder.model.rootPart.children && pageBuilder.model.rootPart.children.length) {
|
|
12729
12951
|
partIdsToDelete = pageBuilder.model.rootPart.children.map((v) => v.partId);
|
|
@@ -12758,8 +12980,7 @@ const _SelectAllPartsCommand = class _SelectAllPartsCommand {
|
|
|
12758
12980
|
}
|
|
12759
12981
|
execute(pageBuilder) {
|
|
12760
12982
|
const page = pageBuilder.context.getSelectedPage();
|
|
12761
|
-
if (page)
|
|
12762
|
-
pageBuilder.context.setSelection([page]);
|
|
12983
|
+
if (page) pageBuilder.context.setSelection([page]);
|
|
12763
12984
|
}
|
|
12764
12985
|
};
|
|
12765
12986
|
__publicField(_SelectAllPartsCommand, "COMMAND_ID", "SelectAllParts");
|
|
@@ -13091,15 +13312,12 @@ class ToolButtonRegistryImpl {
|
|
|
13091
13312
|
}
|
|
13092
13313
|
registerToolButtonGroup(group) {
|
|
13093
13314
|
const found = this.groups.find((g) => g.groupId === group.groupId);
|
|
13094
|
-
if (found)
|
|
13095
|
-
|
|
13096
|
-
else
|
|
13097
|
-
this.groups.push(group);
|
|
13315
|
+
if (found) group.buttons.forEach((btn) => found.buttons.push(btn));
|
|
13316
|
+
else this.groups.push(group);
|
|
13098
13317
|
}
|
|
13099
13318
|
registerToolButtons(groupId, buttons) {
|
|
13100
13319
|
const group = this.groups.find((g) => g.groupId === groupId);
|
|
13101
|
-
if (group)
|
|
13102
|
-
buttons.forEach((btn) => group.buttons.push(btn));
|
|
13320
|
+
if (group) buttons.forEach((btn) => group.buttons.push(btn));
|
|
13103
13321
|
}
|
|
13104
13322
|
getToolButtonGroups() {
|
|
13105
13323
|
return this.groups;
|
|
@@ -13113,8 +13331,7 @@ class PageBuilderContextImpl {
|
|
|
13113
13331
|
PageBuilderEditorEvent.on.modelUpdated((changes) => {
|
|
13114
13332
|
var _a;
|
|
13115
13333
|
const partIds = (_a = changes.deleted) == null ? void 0 : _a.map((result) => result.partId);
|
|
13116
|
-
if (partIds)
|
|
13117
|
-
this.removeSelection(partIds);
|
|
13334
|
+
if (partIds) this.removeSelection(partIds);
|
|
13118
13335
|
});
|
|
13119
13336
|
}
|
|
13120
13337
|
setSelection(parts) {
|
|
@@ -13136,8 +13353,7 @@ class PageBuilderContextImpl {
|
|
|
13136
13353
|
} else {
|
|
13137
13354
|
index = this.selection.findIndex((sel) => sel === part);
|
|
13138
13355
|
}
|
|
13139
|
-
if (index >= 0)
|
|
13140
|
-
this.selection.splice(index, 1);
|
|
13356
|
+
if (index >= 0) this.selection.splice(index, 1);
|
|
13141
13357
|
});
|
|
13142
13358
|
}
|
|
13143
13359
|
isSelected(part) {
|
|
@@ -13155,11 +13371,9 @@ class PageBuilderContextImpl {
|
|
|
13155
13371
|
getSelectedPage() {
|
|
13156
13372
|
const pages = this.model.rootPart.children;
|
|
13157
13373
|
let part = this.selection[0];
|
|
13158
|
-
if (!part)
|
|
13159
|
-
return pages && pages[0];
|
|
13374
|
+
if (!part) return pages && pages[0];
|
|
13160
13375
|
while (part.parent) {
|
|
13161
|
-
if (part.parent.isPage())
|
|
13162
|
-
return part.parent;
|
|
13376
|
+
if (part.parent.isPage()) return part.parent;
|
|
13163
13377
|
part = part.parent;
|
|
13164
13378
|
}
|
|
13165
13379
|
}
|
|
@@ -13236,8 +13450,7 @@ class KeyHandlersImpl {
|
|
|
13236
13450
|
}
|
|
13237
13451
|
removeKeyHandler(handler) {
|
|
13238
13452
|
const index = this.handlers.indexOf(handler);
|
|
13239
|
-
if (index >= 0)
|
|
13240
|
-
this.handlers.splice(index, 1);
|
|
13453
|
+
if (index >= 0) this.handlers.splice(index, 1);
|
|
13241
13454
|
}
|
|
13242
13455
|
handleKeyDownEvent(event) {
|
|
13243
13456
|
for (const handler of this.handlers) {
|
|
@@ -13264,8 +13477,7 @@ const providePageBuilderEditor = (pageBuilderEditor) => {
|
|
|
13264
13477
|
};
|
|
13265
13478
|
const usePageBuilderEditor = () => {
|
|
13266
13479
|
const pageBuilderEditor = inject(PAGE_BUILDER_EDITOR_KEY);
|
|
13267
|
-
if (!pageBuilderEditor)
|
|
13268
|
-
throw Error("PageBuilderEditor not found");
|
|
13480
|
+
if (!pageBuilderEditor) throw Error("PageBuilderEditor not found");
|
|
13269
13481
|
return pageBuilderEditor;
|
|
13270
13482
|
};
|
|
13271
13483
|
class PageBuilderEditorImpl {
|
|
@@ -13285,6 +13497,8 @@ class PageBuilderEditorImpl {
|
|
|
13285
13497
|
__publicField(this, "customWidgets", []);
|
|
13286
13498
|
__publicField(this, "watchers", {});
|
|
13287
13499
|
__publicField(this, "providers", {});
|
|
13500
|
+
__publicField(this, "externalCssLinks", []);
|
|
13501
|
+
__publicField(this, "externalCssContent", "");
|
|
13288
13502
|
this.model = new Model2();
|
|
13289
13503
|
this.context = new PageBuilderContextImpl(this);
|
|
13290
13504
|
this.scale.value = 1;
|
|
@@ -13313,37 +13527,26 @@ class PageBuilderEditorImpl {
|
|
|
13313
13527
|
}
|
|
13314
13528
|
watchCustomWidgetData(part) {
|
|
13315
13529
|
const def = this.partManager.getPartDefinition(part.partName);
|
|
13316
|
-
if (!def || !def.dataWatcher)
|
|
13317
|
-
return false;
|
|
13530
|
+
if (!def || !def.dataWatcher) return false;
|
|
13318
13531
|
const watcher = this.watchers[def.dataWatcher];
|
|
13319
|
-
if (!watcher)
|
|
13320
|
-
return false;
|
|
13532
|
+
if (!watcher) return false;
|
|
13321
13533
|
return watcher(part.properties);
|
|
13322
13534
|
}
|
|
13323
13535
|
provideCustomWidgetData(part) {
|
|
13324
13536
|
const def = this.partManager.getPartDefinition(part.partName);
|
|
13325
|
-
if (!def || !def.dataProvider)
|
|
13326
|
-
return Promise.resolve();
|
|
13537
|
+
if (!def || !def.dataProvider) return Promise.resolve();
|
|
13327
13538
|
const provider = this.providers[def.dataProvider];
|
|
13328
|
-
if (!provider)
|
|
13329
|
-
return Promise.resolve();
|
|
13539
|
+
if (!provider) return Promise.resolve();
|
|
13330
13540
|
return provider(part.properties);
|
|
13331
13541
|
}
|
|
13332
13542
|
registerPlugin(plugin) {
|
|
13333
|
-
if (plugin.partDefinitions)
|
|
13334
|
-
|
|
13335
|
-
if (plugin.
|
|
13336
|
-
|
|
13337
|
-
if (plugin.
|
|
13338
|
-
|
|
13339
|
-
if (plugin.
|
|
13340
|
-
this.commandRegistry.registerCommands(plugin.commands);
|
|
13341
|
-
if (plugin.contextMenus)
|
|
13342
|
-
this.contextMenuRegistry.registerContextMenus(plugin.contextMenus);
|
|
13343
|
-
if (plugin.keyHandlers)
|
|
13344
|
-
this.keyHandlers.appendKeyHandlers(plugin.keyHandlers);
|
|
13345
|
-
if (plugin.toolButtonGroups)
|
|
13346
|
-
this.toolButtonRegistry.registerToolButtonGroups(plugin.toolButtonGroups);
|
|
13543
|
+
if (plugin.partDefinitions) this.partManager.registerPartDefinitions(plugin.partDefinitions);
|
|
13544
|
+
if (plugin.partPropertyGroupEditors) this.partManager.registerPartPropertyGroupEditors(plugin.partPropertyGroupEditors);
|
|
13545
|
+
if (plugin.partPropertyEditors) this.partManager.registerPartPropertyEditors(plugin.partPropertyEditors);
|
|
13546
|
+
if (plugin.commands) this.commandRegistry.registerCommands(plugin.commands);
|
|
13547
|
+
if (plugin.contextMenus) this.contextMenuRegistry.registerContextMenus(plugin.contextMenus);
|
|
13548
|
+
if (plugin.keyHandlers) this.keyHandlers.appendKeyHandlers(plugin.keyHandlers);
|
|
13549
|
+
if (plugin.toolButtonGroups) this.toolButtonRegistry.registerToolButtonGroups(plugin.toolButtonGroups);
|
|
13347
13550
|
}
|
|
13348
13551
|
registerCustomPlugin(plugin) {
|
|
13349
13552
|
if (plugin.widgets) {
|
|
@@ -13351,7 +13554,7 @@ class PageBuilderEditorImpl {
|
|
|
13351
13554
|
plugin.widgets.forEach((v) => {
|
|
13352
13555
|
const w = { ...v };
|
|
13353
13556
|
w.partType = "Widget";
|
|
13354
|
-
w.creator = () => _sfc_main$
|
|
13557
|
+
w.creator = () => _sfc_main$q;
|
|
13355
13558
|
w.propertyGroups = [...w.propertyGroups, ...defaultWidgetPropertyGroups()];
|
|
13356
13559
|
partDefinitions2[v.partName] = w;
|
|
13357
13560
|
const found = this.customWidgets.find((x) => x.partName === v.partName);
|
|
@@ -13370,15 +13573,21 @@ class PageBuilderEditorImpl {
|
|
|
13370
13573
|
if (plugin.propertyEditors) {
|
|
13371
13574
|
this.partManager.registerPartPropertyEditors(plugin.propertyEditors);
|
|
13372
13575
|
}
|
|
13576
|
+
if (plugin.css) {
|
|
13577
|
+
if (plugin.css.links) {
|
|
13578
|
+
this.externalCssLinks = plugin.css.links;
|
|
13579
|
+
}
|
|
13580
|
+
if (plugin.css.content) {
|
|
13581
|
+
this.externalCssContent = plugin.css.content;
|
|
13582
|
+
}
|
|
13583
|
+
}
|
|
13373
13584
|
}
|
|
13374
13585
|
initData(data) {
|
|
13375
13586
|
const _data = JSON.parse(data || "{}") || {};
|
|
13376
13587
|
let rootPart = partFromJsonObject(_data, true);
|
|
13377
|
-
if (!rootPart)
|
|
13378
|
-
rootPart = new RootPart();
|
|
13588
|
+
if (!rootPart) rootPart = new RootPart();
|
|
13379
13589
|
let parts = rootPart.children;
|
|
13380
|
-
if (!parts)
|
|
13381
|
-
parts = [this.getEmptyPageContent(), this.getEmptyPageContent()];
|
|
13590
|
+
if (!parts) parts = [this.getEmptyPageContent(), this.getEmptyPageContent()];
|
|
13382
13591
|
if (parts.length === 1) {
|
|
13383
13592
|
parts[0].properties = {
|
|
13384
13593
|
...parts[0].properties || {},
|
|
@@ -13421,11 +13630,9 @@ class PageBuilderEditorImpl {
|
|
|
13421
13630
|
}
|
|
13422
13631
|
makeSingleScreen(screenToKeep) {
|
|
13423
13632
|
var _a;
|
|
13424
|
-
if (!this.model.rootPart.children)
|
|
13425
|
-
return;
|
|
13633
|
+
if (!this.model.rootPart.children) return;
|
|
13426
13634
|
const screenCount = ((_a = this.model.rootPart.children) == null ? void 0 : _a.length) || 0;
|
|
13427
|
-
if (screenCount !== 2)
|
|
13428
|
-
return;
|
|
13635
|
+
if (screenCount !== 2) return;
|
|
13429
13636
|
const remaining = this.model.rootPart.children[screenToKeep === 0 ? 0 : 1];
|
|
13430
13637
|
const deleting = this.model.rootPart.children[screenToKeep === 0 ? 1 : 0];
|
|
13431
13638
|
this.model.updateModel({
|
|
@@ -13442,16 +13649,13 @@ class PageBuilderEditorImpl {
|
|
|
13442
13649
|
}
|
|
13443
13650
|
makeMultipleScreen() {
|
|
13444
13651
|
var _a;
|
|
13445
|
-
if (!this.model.rootPart.children)
|
|
13446
|
-
return;
|
|
13652
|
+
if (!this.model.rootPart.children) return;
|
|
13447
13653
|
const screenCount = ((_a = this.model.rootPart.children) == null ? void 0 : _a.length) || 0;
|
|
13448
|
-
if (screenCount !== 1)
|
|
13449
|
-
return;
|
|
13654
|
+
if (screenCount !== 1) return;
|
|
13450
13655
|
const part = this.model.rootPart.children[0];
|
|
13451
13656
|
const json = this.model.serializeParts([part.partId]);
|
|
13452
13657
|
const copied = this.model.parseParts(json);
|
|
13453
|
-
if (!copied)
|
|
13454
|
-
return;
|
|
13658
|
+
if (!copied) return;
|
|
13455
13659
|
copied[0].properties = {
|
|
13456
13660
|
...copied[0].properties || {},
|
|
13457
13661
|
name: "Page (PC)"
|
|
@@ -13493,6 +13697,10 @@ class PageBuilderEditorImpl {
|
|
|
13493
13697
|
}
|
|
13494
13698
|
}
|
|
13495
13699
|
}
|
|
13700
|
+
getExternalCss() {
|
|
13701
|
+
return `${this.externalCssLinks}
|
|
13702
|
+
<style>${this.externalCssContent}</style>`;
|
|
13703
|
+
}
|
|
13496
13704
|
extractMediaFromPart(part, urls) {
|
|
13497
13705
|
if (part.properties) {
|
|
13498
13706
|
for (const name in part.properties) {
|
|
@@ -13510,10 +13718,8 @@ class PageBuilderEditorImpl {
|
|
|
13510
13718
|
if (part.partName === "HtmlWidget" && part.properties.html) {
|
|
13511
13719
|
for (const locale in part.properties.html) {
|
|
13512
13720
|
const html = part.properties.html[locale];
|
|
13513
|
-
if (html.tags)
|
|
13514
|
-
|
|
13515
|
-
if (html.style)
|
|
13516
|
-
this.extractMediaFromHtml(html.style, urls);
|
|
13721
|
+
if (html.tags) this.extractMediaFromHtml(html.tags, urls);
|
|
13722
|
+
if (html.style) this.extractMediaFromHtml(html.style, urls);
|
|
13517
13723
|
}
|
|
13518
13724
|
}
|
|
13519
13725
|
}
|
|
@@ -13591,200 +13797,8 @@ class PageBuilderEditorImpl {
|
|
|
13591
13797
|
});
|
|
13592
13798
|
}
|
|
13593
13799
|
}
|
|
13594
|
-
const _hoisted_1$b =
|
|
13595
|
-
const _hoisted_2$3 = [
|
|
13596
|
-
_hoisted_1$b
|
|
13597
|
-
];
|
|
13800
|
+
const _hoisted_1$b = { class: "pb-tool-button bs-layout-horizontal flex-align-center" };
|
|
13598
13801
|
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
13599
|
-
__name: "PbPage",
|
|
13600
|
-
props: {
|
|
13601
|
-
page: {},
|
|
13602
|
-
width: {},
|
|
13603
|
-
isMobilePage: { type: Boolean }
|
|
13604
|
-
},
|
|
13605
|
-
setup(__props) {
|
|
13606
|
-
const props = __props;
|
|
13607
|
-
const editor = usePageBuilderEditor();
|
|
13608
|
-
const style = computed(() => {
|
|
13609
|
-
var _a, _b;
|
|
13610
|
-
return {
|
|
13611
|
-
width: `${props.width || 420}px`,
|
|
13612
|
-
minHeight: ((_b = (_a = props.page) == null ? void 0 : _a.children) == null ? void 0 : _b.length) ? void 0 : "200px"
|
|
13613
|
-
};
|
|
13614
|
-
});
|
|
13615
|
-
const properties = computed(() => {
|
|
13616
|
-
var _a;
|
|
13617
|
-
return { style: ((_a = props.page) == null ? void 0 : _a.getStyles()) || {} };
|
|
13618
|
-
});
|
|
13619
|
-
const selected = computed(() => !!props.page && editor.context.isSelected(props.page));
|
|
13620
|
-
const insertSection = (index) => {
|
|
13621
|
-
if (!props.page)
|
|
13622
|
-
return;
|
|
13623
|
-
editor.commandRegistry.executeCommand(AddSectionCommand.COMMAND_ID);
|
|
13624
|
-
};
|
|
13625
|
-
return (_ctx, _cache) => {
|
|
13626
|
-
var _a;
|
|
13627
|
-
return openBlock(), createElementBlock("div", {
|
|
13628
|
-
style: normalizeStyle(style.value),
|
|
13629
|
-
class: "pb-page"
|
|
13630
|
-
}, [
|
|
13631
|
-
createElementVNode("div", mergeProps({
|
|
13632
|
-
class: [selected.value && "selected", _ctx.isMobilePage ? "mobile" : "pc", "pb-page-content"]
|
|
13633
|
-
}, properties.value), [
|
|
13634
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList((_a = _ctx.page) == null ? void 0 : _a.children, (section, index) => {
|
|
13635
|
-
return openBlock(), createBlock$1(_sfc_main$k, {
|
|
13636
|
-
key: section.partId,
|
|
13637
|
-
part: section
|
|
13638
|
-
}, null, 8, ["part"]);
|
|
13639
|
-
}), 128))
|
|
13640
|
-
], 16),
|
|
13641
|
-
createElementVNode("div", {
|
|
13642
|
-
class: "pb-add-section-handle bottom",
|
|
13643
|
-
onClick: _cache[0] || (_cache[0] = ($event) => {
|
|
13644
|
-
var _a2, _b;
|
|
13645
|
-
return insertSection(((_b = (_a2 = _ctx.page) == null ? void 0 : _a2.children) == null ? void 0 : _b.length) || 0);
|
|
13646
|
-
})
|
|
13647
|
-
}, _hoisted_2$3)
|
|
13648
|
-
], 4);
|
|
13649
|
-
};
|
|
13650
|
-
}
|
|
13651
|
-
});
|
|
13652
|
-
const _hoisted_1$a = /* @__PURE__ */ createElementVNode("div", { style: { "width": "20px" } }, null, -1);
|
|
13653
|
-
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
13654
|
-
__name: "PbCanvas",
|
|
13655
|
-
setup(__props) {
|
|
13656
|
-
const pageBuilder = usePageBuilderEditor();
|
|
13657
|
-
const pageS = computed(() => {
|
|
13658
|
-
var _a;
|
|
13659
|
-
return (_a = pageBuilder.model.rootPart.children) == null ? void 0 : _a[0];
|
|
13660
|
-
});
|
|
13661
|
-
const pageL = computed(() => {
|
|
13662
|
-
var _a;
|
|
13663
|
-
return (_a = pageBuilder.model.rootPart.children) == null ? void 0 : _a[1];
|
|
13664
|
-
});
|
|
13665
|
-
const handleClick = (event) => {
|
|
13666
|
-
if (event.button === 0) {
|
|
13667
|
-
pageBuilder.context.clearSelection();
|
|
13668
|
-
}
|
|
13669
|
-
};
|
|
13670
|
-
const contextMenu = useContextMenu();
|
|
13671
|
-
const style = computed(() => {
|
|
13672
|
-
const scale = pageBuilder.scale.value;
|
|
13673
|
-
return `transform: scale(${scale}); flex-grow: 1;`;
|
|
13674
|
-
});
|
|
13675
|
-
const showContextMenu = (event) => {
|
|
13676
|
-
var _a, _b;
|
|
13677
|
-
if (event.altKey || event.ctrlKey || event.shiftKey)
|
|
13678
|
-
return;
|
|
13679
|
-
event.preventDefault();
|
|
13680
|
-
const frame = ((_b = (_a = event.target) == null ? void 0 : _a.ownerDocument.defaultView) == null ? void 0 : _b.frameElement) || void 0;
|
|
13681
|
-
const frameLeft = (frame == null ? void 0 : frame.offsetLeft) || 0;
|
|
13682
|
-
const frameTop = (frame == null ? void 0 : frame.offsetTop) || 0;
|
|
13683
|
-
const fakeEvent = {
|
|
13684
|
-
clientX: event.clientX + frameLeft,
|
|
13685
|
-
clientY: event.clientY + frameTop
|
|
13686
|
-
};
|
|
13687
|
-
const contextMenus = pageBuilder.contextMenuRegistry.composeContextMenuItems(pageBuilder);
|
|
13688
|
-
contextMenu.showContextMenu(fakeEvent, contextMenus);
|
|
13689
|
-
};
|
|
13690
|
-
return (_ctx, _cache) => {
|
|
13691
|
-
return openBlock(), createElementBlock("div", {
|
|
13692
|
-
class: "pb-canvas-wrapper",
|
|
13693
|
-
onContextmenu: showContextMenu,
|
|
13694
|
-
onMousedown: withModifiers(handleClick, ["stop"])
|
|
13695
|
-
}, [
|
|
13696
|
-
createElementVNode("div", {
|
|
13697
|
-
style: normalizeStyle(style.value),
|
|
13698
|
-
class: "pb-canvas"
|
|
13699
|
-
}, [
|
|
13700
|
-
createVNode(_sfc_main$c, {
|
|
13701
|
-
"is-mobile-page": true,
|
|
13702
|
-
page: pageS.value,
|
|
13703
|
-
width: 420
|
|
13704
|
-
}, null, 8, ["page"]),
|
|
13705
|
-
_hoisted_1$a,
|
|
13706
|
-
createVNode(_sfc_main$c, {
|
|
13707
|
-
"is-mobile-page": false,
|
|
13708
|
-
page: pageL.value,
|
|
13709
|
-
width: 1024
|
|
13710
|
-
}, null, 8, ["page"])
|
|
13711
|
-
], 4)
|
|
13712
|
-
], 32);
|
|
13713
|
-
};
|
|
13714
|
-
}
|
|
13715
|
-
});
|
|
13716
|
-
const canvasStyle = '.pb-page {\n margin: 0 auto;\n margin-top: 20px;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n}\n.pb-page .pb-page-content.selected {\n outline: 2px solid #4998f8;\n outline-offset: 5px;\n}\n.pb-page * {\n box-sizing: border-box;\n}\n.pb-add-widget-button {\n width: 100%;\n height: 100%;\n min-height: 200px;\n position: relative;\n}\n.pb-add-widget-button button {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n padding: 8px;\n background: none;\n border: none;\n cursor: pointer;\n}\n.pb-add-widget-button button:hover {\n background-color: #eeeeee;\n}\n.pb-add-widget-button .icon {\n font-size: 1rem;\n vertical-align: middle;\n}\n.pb-add-widget-button .text {\n font-size: 1rem;\n vertical-align: middle;\n margin-left: 0.4rem;\n}\n.pb-section {\n position: relative;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n outline: 1px dashed #ccc;\n background-color: #fff;\n}\n.pb-section:hover:not(:has(.pb-block:hover)) {\n background-color: #f0f0f0;\n}\n.pb-section.selected {\n outline: 2px solid #4998f8;\n outline-offset: 1px;\n z-index: 999;\n}\n.pb-section.pb-section-static {\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n.pb-section.pb-section-static:after {\n content: "";\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n background-color: rgba(0, 0, 0, 0.2);\n}\n.pb-section-static .pb-widget {\n outline: none;\n}\n.pb-block {\n display: flex;\n min-width: 1px;\n position: relative;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n width: 100%;\n outline: 1px dashed #ccc;\n}\n.pb-block:hover:not(:has(.pb-widget:hover)) {\n background-color: #f0f0f0;\n}\n.pb-block.selected {\n outline: 2px solid #4998f8;\n outline-offset: 1px;\n z-index: 999;\n}\n.pb-widget {\n position: relative;\n outline: 1px dashed #ccc;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n}\n.pb-widget.selected {\n outline: 2px solid #4998f8;\n outline-offset: 1px;\n z-index: 999;\n}\n.pb-widget .children {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n.pb-widget .pan-handle {\n position: absolute;\n left: -6px;\n top: -6px;\n width: 12px;\n height: 12px;\n background-color: #27ae60;\n cursor: move;\n}\n.pb-widget .resize-handle {\n position: absolute;\n right: -6px;\n bottom: -6px;\n width: 12px;\n height: 12px;\n background-color: #27ae60;\n cursor: nwse-resize;\n}\n.pb-widget {\n position: relative;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n width: 100%;\n}\n.pb-widget .children {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n.pb-text-widget {\n width: 100%;\n height: fit-content;\n}\n.pb-text-widget .text {\n color: #333;\n}\n.pb-text-widget .placeholder {\n padding: 4px 0;\n font-size: 18px;\n text-align: center;\n color: #999;\n}\n.pb-image-widget {\n width: 100%;\n}\n.pb-image-widget .image {\n width: 100%;\n}\n.pb-image-widget .empty {\n height: 100px;\n background-color: #eee;\n text-align: center;\n}\n.pb-image-widget .empty span {\n font-size: 40px;\n color: #999;\n line-height: 100px;\n vertical-align: middle;\n}\n.pb-html-widget {\n width: 100%;\n height: fit-content;\n}\n.pb-html-widget .placeholder {\n padding: 4px 0;\n font-size: 18px;\n text-align: center;\n color: #999;\n}\n.pb-iframe-widget {\n width: 100%;\n height: fit-content;\n}\n.pb-iframe-widget .placeholder {\n padding: 4px 0;\n font-size: 18px;\n text-align: center;\n color: #999;\n}\n.pb-product-list-widget {\n width: 100%;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: center;\n}\n.pb-product-list-widget .product-wrapper {\n width: 25%;\n}\n.pb-product-list-widget .product-wrapper .product {\n width: 95%;\n margin: 0 auto;\n padding-top: 8px;\n padding-bottom: 8px;\n}\n.pb-product-list-widget .product-wrapper img {\n width: 100%;\n}\n.pb-product-list-widget .product-wrapper .name {\n margin-top: 8px;\n font-size: 14px;\n}\n.pb-product-list-widget .product-wrapper .price {\n margin-top: 8px;\n font-size: 14px;\n font-weight: bold;\n}\n.pb-product-list-widget .product-wrapper .empty {\n height: 200px;\n background-color: #eee;\n text-align: center;\n}\n.pb-product-list-widget .product-wrapper .empty span {\n font-size: 40px;\n color: #999;\n line-height: 200px;\n vertical-align: middle;\n}\n@media (max-width: 768px) {\n .pb-product-list-widget .product-wrapper {\n width: 50%;\n }\n}\n.mobile .pb-product-list-widget .product-wrapper {\n width: 50%;\n}\n.pb-login-widget {\n height: 200px;\n text-align: center;\n}\n.pb-login-widget h3 {\n padding: 0;\n margin: 0;\n font-size: 32px;\n font-weight: bold;\n color: #ccc;\n line-height: 200px;\n vertical-align: middle;\n}\n.font-icon {\n font-family: Material Symbols Outlined, monospace;\n font-size: 1rem;\n max-width: 1em;\n}\nhtml, body {\n font-family: Noto Sans, Noto Sans KR, Noto Sans JP, Arial, sans-serif;\n font-size: 12px;\n}\nbody {\n background-color: white;\n height: 100%;\n margin: 0;\n}\n.pb-canvas-wrapper {\n padding: 32px 40px 56px 40px;\n height: 100%;\n background-color: #aaa;\n overflow: auto;\n}\n.pb-canvas-wrapper .pb-canvas {\n display: flex;\n flex-direction: row;\n transform-origin: top left;\n width: fit-content;\n min-width: 40px;\n min-height: 40px;\n margin: 0 auto;\n}\n.pb-position-mark {\n background-color: #ff3333;\n opacity: 0.5;\n border-radius: 2px;\n}\n.pb-add-section-handle {\n position: relative;\n text-align: center;\n cursor: pointer;\n z-index: 5;\n height: 0;\n}\n.pb-add-section-handle.top::before, .pb-add-section-handle.bottom::before, .pb-add-section-handle.middle::before {\n content: "";\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n opacity: 0;\n pointer-events: none;\n}\n.pb-add-section-handle.bottom {\n left: 50%;\n bottom: -32px;\n}\n.pb-add-section-handle:hover.top::before, .pb-add-section-handle:hover.bottom::before, .pb-add-section-handle:hover.middle::before,\n.pb-add-section-handle:hover > i {\n opacity: 1;\n}\n.pb-add-section-handle > i {\n vertical-align: middle;\n position: absolute;\n top: 50%;\n left: 0;\n font-size: 2rem;\n transform: translate(-50%, -50%);\n opacity: 0.2;\n}\n.pb-button {\n background: none;\n border: none;\n cursor: pointer;\n vertical-align: middle;\n}\n.pb-guideline {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n.pb-guideline.selected {\n z-index: 3;\n}\n.pb-guideline.preselect {\n z-index: 4;\n}';
|
|
13717
|
-
const _hoisted_1$9 = { class: "pb-canvas-frame" };
|
|
13718
|
-
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
13719
|
-
__name: "PbCanvasFrame",
|
|
13720
|
-
setup(__props) {
|
|
13721
|
-
const pageBuilderEditor = usePageBuilderEditor();
|
|
13722
|
-
const iframeRef = ref();
|
|
13723
|
-
provideMouseTracker(iframeRef);
|
|
13724
|
-
const stopIframeWatch = watch(
|
|
13725
|
-
() => {
|
|
13726
|
-
var _a, _b;
|
|
13727
|
-
return (_b = (_a = iframeRef.value) == null ? void 0 : _a.contentWindow) == null ? void 0 : _b.document;
|
|
13728
|
-
},
|
|
13729
|
-
() => {
|
|
13730
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
13731
|
-
if ((_c = (_b = (_a = iframeRef.value) == null ? void 0 : _a.contentWindow) == null ? void 0 : _b.document) == null ? void 0 : _c.head) {
|
|
13732
|
-
const head = (_e = (_d = iframeRef.value) == null ? void 0 : _d.contentWindow) == null ? void 0 : _e.document.head;
|
|
13733
|
-
head.innerHTML = `
|
|
13734
|
-
<meta charset="UTF-8"/>
|
|
13735
|
-
<link href="https://fonts.googleapis.com" rel="preconnect">
|
|
13736
|
-
<link crossorigin href="https://fonts.gstatic.com" rel="preconnect">
|
|
13737
|
-
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500&display=swap" rel="stylesheet">
|
|
13738
|
-
<link
|
|
13739
|
-
href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500&family=Noto+Sans:wght@400;500&display=swap"
|
|
13740
|
-
rel="stylesheet">
|
|
13741
|
-
<link
|
|
13742
|
-
href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500&family=Noto+Sans+KR:wght@400;500&family=Noto+Sans:wght@400;500&display=swap"
|
|
13743
|
-
rel="stylesheet">
|
|
13744
|
-
<link
|
|
13745
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=block"
|
|
13746
|
-
rel="stylesheet"/>
|
|
13747
|
-
<!--
|
|
13748
|
-
<link href="https://bluesea5.g1project.net/assets/index-j48PwPDr.css" rel="stylesheet">
|
|
13749
|
-
-->
|
|
13750
|
-
<link href="https://fonts.googleapis.com/css2?family=Material+Icons+Outlined" rel="stylesheet" />
|
|
13751
|
-
<style>${canvasStyle}</style>
|
|
13752
|
-
`;
|
|
13753
|
-
const script2 = (_g = (_f = iframeRef.value) == null ? void 0 : _f.contentWindow) == null ? void 0 : _g.document.createElement("script");
|
|
13754
|
-
script2.innerHTML = `
|
|
13755
|
-
function forwardPostMessage(event) {
|
|
13756
|
-
if (event.data) {
|
|
13757
|
-
window.parent.postMessage(event.data, '*');
|
|
13758
|
-
}
|
|
13759
|
-
}
|
|
13760
|
-
window.addEventListener('message', forwardPostMessage);
|
|
13761
|
-
`;
|
|
13762
|
-
(_h = iframeRef.value) == null ? void 0 : _h.contentWindow.document.head.appendChild(script2);
|
|
13763
|
-
pageBuilderEditor.keyHandlers.addDocumentKeyEventListener(iframeRef.value.contentWindow.document.body);
|
|
13764
|
-
stopIframeWatch();
|
|
13765
|
-
}
|
|
13766
|
-
}
|
|
13767
|
-
);
|
|
13768
|
-
return (_ctx, _cache) => {
|
|
13769
|
-
var _a, _b, _c, _d;
|
|
13770
|
-
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
13771
|
-
createElementVNode("iframe", {
|
|
13772
|
-
ref_key: "iframeRef",
|
|
13773
|
-
ref: iframeRef,
|
|
13774
|
-
class: "canvas-frame"
|
|
13775
|
-
}, null, 512),
|
|
13776
|
-
((_b = (_a = iframeRef.value) == null ? void 0 : _a.contentWindow) == null ? void 0 : _b.document.body) ? (openBlock(), createBlock$1(Teleport, {
|
|
13777
|
-
key: 0,
|
|
13778
|
-
to: (_d = (_c = iframeRef.value) == null ? void 0 : _c.contentWindow) == null ? void 0 : _d.document.body
|
|
13779
|
-
}, [
|
|
13780
|
-
createVNode(_sfc_main$b)
|
|
13781
|
-
], 8, ["to"])) : createCommentVNode("", true)
|
|
13782
|
-
]);
|
|
13783
|
-
};
|
|
13784
|
-
}
|
|
13785
|
-
});
|
|
13786
|
-
const _hoisted_1$8 = { class: "pb-tool-button bs-layout-horizontal flex-align-center" };
|
|
13787
|
-
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
13788
13802
|
__name: "PbToolbarButton",
|
|
13789
13803
|
props: {
|
|
13790
13804
|
button: {}
|
|
@@ -13797,7 +13811,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
13797
13811
|
(_b = (_a = props.button).handler) == null ? void 0 : _b.call(_a, pageBuilder);
|
|
13798
13812
|
};
|
|
13799
13813
|
return (_ctx, _cache) => {
|
|
13800
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
13814
|
+
return openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
13801
13815
|
createElementVNode("div", {
|
|
13802
13816
|
class: "tool-button bs-clickable",
|
|
13803
13817
|
onClick: handleClick
|
|
@@ -13812,17 +13826,17 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
13812
13826
|
};
|
|
13813
13827
|
}
|
|
13814
13828
|
});
|
|
13815
|
-
const _hoisted_1$
|
|
13816
|
-
const _sfc_main$
|
|
13829
|
+
const _hoisted_1$a = { class: "pb-tool-button-group bs-layout-horizontal flex-align-center" };
|
|
13830
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
13817
13831
|
__name: "PbToolbarButtonGroup",
|
|
13818
13832
|
props: {
|
|
13819
13833
|
group: {}
|
|
13820
13834
|
},
|
|
13821
13835
|
setup(__props) {
|
|
13822
13836
|
return (_ctx, _cache) => {
|
|
13823
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
13837
|
+
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
13824
13838
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.group.buttons, (button) => {
|
|
13825
|
-
return openBlock(), createBlock$1(_sfc_main$
|
|
13839
|
+
return openBlock(), createBlock$1(_sfc_main$c, {
|
|
13826
13840
|
key: button.buttonId,
|
|
13827
13841
|
button
|
|
13828
13842
|
}, null, 8, ["button"]);
|
|
@@ -13831,11 +13845,10 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
13831
13845
|
};
|
|
13832
13846
|
}
|
|
13833
13847
|
});
|
|
13834
|
-
const _hoisted_1$
|
|
13835
|
-
const _hoisted_2$
|
|
13836
|
-
const _hoisted_3$1 =
|
|
13837
|
-
const
|
|
13838
|
-
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
13848
|
+
const _hoisted_1$9 = { class: "pb-toolbar bs-layout-horizontal align-items-center" };
|
|
13849
|
+
const _hoisted_2$3 = { class: "bs-layout-horizontal align-items-center" };
|
|
13850
|
+
const _hoisted_3$1 = { class: "mr-8" };
|
|
13851
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
13839
13852
|
__name: "PbToolbar",
|
|
13840
13853
|
props: {
|
|
13841
13854
|
plugin: {}
|
|
@@ -13851,11 +13864,9 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
13851
13864
|
},
|
|
13852
13865
|
set: (count) => {
|
|
13853
13866
|
var _a;
|
|
13854
|
-
if (!count)
|
|
13855
|
-
return;
|
|
13867
|
+
if (!count) return;
|
|
13856
13868
|
console.log(count);
|
|
13857
|
-
if (count === (((_a = pageBuilder.model.rootPart.children) == null ? void 0 : _a.length) || 0))
|
|
13858
|
-
return;
|
|
13869
|
+
if (count === (((_a = pageBuilder.model.rootPart.children) == null ? void 0 : _a.length) || 0)) return;
|
|
13859
13870
|
if (count >= 2) {
|
|
13860
13871
|
makeMultipleScreen();
|
|
13861
13872
|
} else {
|
|
@@ -13868,7 +13879,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
13868
13879
|
};
|
|
13869
13880
|
const makeSingleScreen = () => {
|
|
13870
13881
|
modal.openModal({
|
|
13871
|
-
component: defineAsyncComponent(() => import("./PbScreenSelectModal-
|
|
13882
|
+
component: defineAsyncComponent(() => import("./PbScreenSelectModal-CnI1IsvW.js")),
|
|
13872
13883
|
bind: {},
|
|
13873
13884
|
on: {
|
|
13874
13885
|
select: (selection) => {
|
|
@@ -13886,10 +13897,10 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
13886
13897
|
});
|
|
13887
13898
|
return (_ctx, _cache) => {
|
|
13888
13899
|
var _a, _b, _c;
|
|
13889
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
13890
|
-
createElementVNode("div", _hoisted_2$
|
|
13900
|
+
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
13901
|
+
createElementVNode("div", _hoisted_2$3, [
|
|
13891
13902
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(buttonGroups), (group) => {
|
|
13892
|
-
return openBlock(), createBlock$1(_sfc_main$
|
|
13903
|
+
return openBlock(), createBlock$1(_sfc_main$b, {
|
|
13893
13904
|
key: group.groupId,
|
|
13894
13905
|
group
|
|
13895
13906
|
}, null, 8, ["group"]);
|
|
@@ -13911,30 +13922,30 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
13911
13922
|
placeholder: "Scale"
|
|
13912
13923
|
}, null, 8, ["modelValue"])
|
|
13913
13924
|
]),
|
|
13914
|
-
|
|
13915
|
-
createElementVNode("div",
|
|
13925
|
+
_cache[2] || (_cache[2] = createElementVNode("div", { class: "flex-grow-1" }, null, -1)),
|
|
13926
|
+
createElementVNode("div", _hoisted_3$1, [
|
|
13916
13927
|
_ctx.plugin ? (openBlock(), createBlock$1(resolveDynamicComponent((_a = _ctx.plugin) == null ? void 0 : _a.component), mergeProps({ key: 0 }, (_b = _ctx.plugin) == null ? void 0 : _b.bind, toHandlers((_c = _ctx.plugin) == null ? void 0 : _c.on)), null, 16)) : createCommentVNode("", true)
|
|
13917
13928
|
])
|
|
13918
13929
|
]);
|
|
13919
13930
|
};
|
|
13920
13931
|
}
|
|
13921
13932
|
});
|
|
13922
|
-
const _hoisted_1$
|
|
13923
|
-
const _sfc_main$
|
|
13933
|
+
const _hoisted_1$8 = { class: "pb-menu bs-layout-vertical" };
|
|
13934
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
13924
13935
|
__name: "PbMenu",
|
|
13925
13936
|
props: {
|
|
13926
13937
|
toolbarPlugin: {}
|
|
13927
13938
|
},
|
|
13928
13939
|
setup(__props) {
|
|
13929
13940
|
return (_ctx, _cache) => {
|
|
13930
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
13931
|
-
createVNode(_sfc_main$
|
|
13941
|
+
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
13942
|
+
createVNode(_sfc_main$a, { plugin: _ctx.toolbarPlugin }, null, 8, ["plugin"])
|
|
13932
13943
|
]);
|
|
13933
13944
|
};
|
|
13934
13945
|
}
|
|
13935
13946
|
});
|
|
13936
|
-
const _hoisted_1$
|
|
13937
|
-
const _sfc_main$
|
|
13947
|
+
const _hoisted_1$7 = { class: "bs-layout-vertical border" };
|
|
13948
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
13938
13949
|
__name: "PbNavigator",
|
|
13939
13950
|
setup(__props) {
|
|
13940
13951
|
const pageBuilder = usePageBuilderEditor();
|
|
@@ -13976,21 +13987,17 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
13976
13987
|
var _a, _b, _c, _d, _e, _f;
|
|
13977
13988
|
let page2 = pageBuilder.context.getSelectedPage();
|
|
13978
13989
|
const parentPartId = ((_a = event.destParent) == null ? void 0 : _a.partId) || (page2 == null ? void 0 : page2.partId);
|
|
13979
|
-
if (!parentPartId)
|
|
13980
|
-
return;
|
|
13990
|
+
if (!parentPartId) return;
|
|
13981
13991
|
let ok = false;
|
|
13982
13992
|
if (event.row.isSection()) {
|
|
13983
|
-
if ((_b = event.destParent) == null ? void 0 : _b.isPage())
|
|
13984
|
-
ok = true;
|
|
13993
|
+
if ((_b = event.destParent) == null ? void 0 : _b.isPage()) ok = true;
|
|
13985
13994
|
} else if (event.row.isBlock()) {
|
|
13986
|
-
if ((_c = event.destParent) == null ? void 0 : _c.isSection())
|
|
13987
|
-
ok = true;
|
|
13995
|
+
if ((_c = event.destParent) == null ? void 0 : _c.isSection()) ok = true;
|
|
13988
13996
|
} else if (event.row.isWidget()) {
|
|
13989
13997
|
if ((_d = event.destParent) == null ? void 0 : _d.isBlock()) {
|
|
13990
13998
|
ok = true;
|
|
13991
13999
|
} else if (((_e = event.destParent) == null ? void 0 : _e.isWidget()) && !event.destParent.isNestedWidget()) {
|
|
13992
|
-
if (!((_f = event.row.children) == null ? void 0 : _f.length))
|
|
13993
|
-
ok = true;
|
|
14000
|
+
if (!((_f = event.row.children) == null ? void 0 : _f.length)) ok = true;
|
|
13994
14001
|
}
|
|
13995
14002
|
}
|
|
13996
14003
|
if (ok) {
|
|
@@ -14027,8 +14034,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
14027
14034
|
},
|
|
14028
14035
|
() => {
|
|
14029
14036
|
const selected = pageBuilder.context.getSelectedParts();
|
|
14030
|
-
if (!selected || !selected[0])
|
|
14031
|
-
return;
|
|
14037
|
+
if (!selected || !selected[0]) return;
|
|
14032
14038
|
expandParent(selected[0]);
|
|
14033
14039
|
}
|
|
14034
14040
|
);
|
|
@@ -14061,7 +14067,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
14061
14067
|
PageBuilderEditorEvent.off.modelUpdatedByUI(modelUpdateHandler);
|
|
14062
14068
|
});
|
|
14063
14069
|
return (_ctx, _cache) => {
|
|
14064
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
14070
|
+
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
14065
14071
|
createElementVNode("div", {
|
|
14066
14072
|
ref_key: "tree",
|
|
14067
14073
|
ref: tree,
|
|
@@ -14094,7 +14100,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
14094
14100
|
};
|
|
14095
14101
|
}
|
|
14096
14102
|
});
|
|
14097
|
-
const _sfc_main$
|
|
14103
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
14098
14104
|
__name: "PbSidebarPropertyEditor",
|
|
14099
14105
|
props: {
|
|
14100
14106
|
property: {},
|
|
@@ -14107,8 +14113,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
14107
14113
|
var _a;
|
|
14108
14114
|
if (props.property.propertyEditor) {
|
|
14109
14115
|
const editor = props.property.propertyEditor(props.property, props.selectedParts);
|
|
14110
|
-
if (editor)
|
|
14111
|
-
return editor;
|
|
14116
|
+
if (editor) return editor;
|
|
14112
14117
|
}
|
|
14113
14118
|
return (_a = pageBuilder.partManager.getPartPropertyEditor(props.property.propertyType)) == null ? void 0 : _a(props.property, props.selectedParts);
|
|
14114
14119
|
});
|
|
@@ -14130,13 +14135,13 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
14130
14135
|
};
|
|
14131
14136
|
}
|
|
14132
14137
|
});
|
|
14133
|
-
const _hoisted_1$
|
|
14134
|
-
const _hoisted_2$
|
|
14138
|
+
const _hoisted_1$6 = { class: "pb-sidebar-property-group" };
|
|
14139
|
+
const _hoisted_2$2 = {
|
|
14135
14140
|
key: 0,
|
|
14136
14141
|
class: "group-title"
|
|
14137
14142
|
};
|
|
14138
14143
|
const _hoisted_3 = ["textContent"];
|
|
14139
|
-
const _sfc_main$
|
|
14144
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
14140
14145
|
__name: "PbSidebarPropertyGroupEditor",
|
|
14141
14146
|
props: {
|
|
14142
14147
|
group: {},
|
|
@@ -14150,8 +14155,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
14150
14155
|
return (_b = (_a = props.group).propertyGroupEditor) == null ? void 0 : _b.call(_a, props.group, props.selectedParts);
|
|
14151
14156
|
});
|
|
14152
14157
|
return (_ctx, _cache) => {
|
|
14153
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
14154
|
-
_ctx.group.showGroupName ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
14158
|
+
return openBlock(), createElementBlock("div", _hoisted_1$6, [
|
|
14159
|
+
_ctx.group.showGroupName ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
|
|
14155
14160
|
createElementVNode("label", {
|
|
14156
14161
|
textContent: toDisplayString(_ctx.group.caption)
|
|
14157
14162
|
}, null, 8, _hoisted_3)
|
|
@@ -14162,7 +14167,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
14162
14167
|
group: _ctx.group,
|
|
14163
14168
|
"selected-parts": _ctx.selectedParts
|
|
14164
14169
|
}, null, 8, ["group", "selected-parts"])) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.group.properties, (property) => {
|
|
14165
|
-
return openBlock(), createBlock$1(_sfc_main$
|
|
14170
|
+
return openBlock(), createBlock$1(_sfc_main$7, {
|
|
14166
14171
|
key: `${_ctx.partsKey}_${property.propertyName}`,
|
|
14167
14172
|
property,
|
|
14168
14173
|
"selected-parts": _ctx.selectedParts
|
|
@@ -14173,8 +14178,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
14173
14178
|
};
|
|
14174
14179
|
}
|
|
14175
14180
|
});
|
|
14176
|
-
const _hoisted_1$
|
|
14177
|
-
const _sfc_main$
|
|
14181
|
+
const _hoisted_1$5 = { class: "pb-sidebar-properties" };
|
|
14182
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
14178
14183
|
__name: "PbSidebarProperties",
|
|
14179
14184
|
setup(__props) {
|
|
14180
14185
|
const pageBuilder = usePageBuilderEditor();
|
|
@@ -14192,12 +14197,12 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
14192
14197
|
}
|
|
14193
14198
|
});
|
|
14194
14199
|
return (_ctx, _cache) => {
|
|
14195
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
14200
|
+
return openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
14196
14201
|
(openBlock(true), createElementBlock(Fragment, null, renderList(properties.value, (group) => {
|
|
14197
14202
|
return openBlock(), createElementBlock("div", {
|
|
14198
14203
|
key: `${partsKey.value}_${group.groupName}`
|
|
14199
14204
|
}, [
|
|
14200
|
-
createVNode(_sfc_main$
|
|
14205
|
+
createVNode(_sfc_main$6, {
|
|
14201
14206
|
group,
|
|
14202
14207
|
partsKey: partsKey.value,
|
|
14203
14208
|
"selected-parts": unref(selectedParts)
|
|
@@ -14208,13 +14213,275 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
14208
14213
|
};
|
|
14209
14214
|
}
|
|
14210
14215
|
});
|
|
14211
|
-
const _hoisted_1$
|
|
14212
|
-
const _sfc_main$
|
|
14216
|
+
const _hoisted_1$4 = { class: "pb-sidebar" };
|
|
14217
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
14213
14218
|
__name: "PbSidebar",
|
|
14214
14219
|
setup(__props) {
|
|
14220
|
+
return (_ctx, _cache) => {
|
|
14221
|
+
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
14222
|
+
createVNode(_sfc_main$5)
|
|
14223
|
+
]);
|
|
14224
|
+
};
|
|
14225
|
+
}
|
|
14226
|
+
});
|
|
14227
|
+
const _hoisted_1$3 = ["data-part-id"];
|
|
14228
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
14229
|
+
__name: "PbPage",
|
|
14230
|
+
props: {
|
|
14231
|
+
part: {},
|
|
14232
|
+
width: {},
|
|
14233
|
+
isMobilePage: { type: Boolean }
|
|
14234
|
+
},
|
|
14235
|
+
setup(__props) {
|
|
14236
|
+
const props = __props;
|
|
14237
|
+
const editor = usePageBuilderEditor();
|
|
14238
|
+
const styleTag = computed(() => props.part.getStyleTag());
|
|
14239
|
+
const style = computed(() => {
|
|
14240
|
+
var _a, _b;
|
|
14241
|
+
return {
|
|
14242
|
+
// width: `${props.width || 420}px`,
|
|
14243
|
+
minHeight: ((_b = (_a = props.part) == null ? void 0 : _a.children) == null ? void 0 : _b.length) ? void 0 : "200px"
|
|
14244
|
+
};
|
|
14245
|
+
});
|
|
14246
|
+
const properties = computed(() => {
|
|
14247
|
+
var _a, _b;
|
|
14248
|
+
return {
|
|
14249
|
+
style: {
|
|
14250
|
+
...(_a = props.part) == null ? void 0 : _a.getStyles(),
|
|
14251
|
+
...(_b = props.part) == null ? void 0 : _b.getInlineStyles()
|
|
14252
|
+
}
|
|
14253
|
+
};
|
|
14254
|
+
});
|
|
14255
|
+
const selected = computed(() => !!props.part && editor.context.isSelected(props.part));
|
|
14256
|
+
const insertSection = (index) => {
|
|
14257
|
+
editor.commandRegistry.executeCommand(AddSectionCommand.COMMAND_ID);
|
|
14258
|
+
};
|
|
14259
|
+
const pageBuilder = usePageBuilderEditor();
|
|
14260
|
+
const contextMenu = useContextMenu();
|
|
14261
|
+
const handleClick = (event) => {
|
|
14262
|
+
if (event.button === 0) {
|
|
14263
|
+
pageBuilder.context.clearSelection();
|
|
14264
|
+
}
|
|
14265
|
+
};
|
|
14266
|
+
const showContextMenu = (event) => {
|
|
14267
|
+
var _a, _b;
|
|
14268
|
+
if (event.altKey || event.ctrlKey || event.shiftKey) return;
|
|
14269
|
+
event.preventDefault();
|
|
14270
|
+
const frame = ((_b = (_a = event.target) == null ? void 0 : _a.ownerDocument.defaultView) == null ? void 0 : _b.frameElement) || void 0;
|
|
14271
|
+
const frameRect = frame == null ? void 0 : frame.getBoundingClientRect();
|
|
14272
|
+
const fakeEvent = {
|
|
14273
|
+
clientX: event.clientX + frameRect.left,
|
|
14274
|
+
clientY: event.clientY + frameRect.top
|
|
14275
|
+
};
|
|
14276
|
+
const contextMenus = pageBuilder.contextMenuRegistry.composeContextMenuItems(pageBuilder);
|
|
14277
|
+
contextMenu.showContextMenu(fakeEvent, contextMenus);
|
|
14278
|
+
};
|
|
14279
|
+
return (_ctx, _cache) => {
|
|
14280
|
+
var _a, _b;
|
|
14281
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
14282
|
+
styleTag.value ? (openBlock(), createBlock$1(resolveDynamicComponent("style"), {
|
|
14283
|
+
key: 0,
|
|
14284
|
+
innerHTML: styleTag.value
|
|
14285
|
+
}, null, 8, ["innerHTML"])) : createCommentVNode("", true),
|
|
14286
|
+
createElementVNode("div", {
|
|
14287
|
+
"data-part-id": (_a = _ctx.part) == null ? void 0 : _a.partId,
|
|
14288
|
+
style: normalizeStyle(style.value),
|
|
14289
|
+
class: "pb-page",
|
|
14290
|
+
onContextmenu: showContextMenu,
|
|
14291
|
+
onMousedown: withModifiers(handleClick, ["stop"])
|
|
14292
|
+
}, [
|
|
14293
|
+
createElementVNode("div", mergeProps({
|
|
14294
|
+
class: [selected.value && "selected", _ctx.isMobilePage ? "mobile" : "pc", "pb-page-content"]
|
|
14295
|
+
}, properties.value), [
|
|
14296
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList((_b = _ctx.part) == null ? void 0 : _b.children, (section, index) => {
|
|
14297
|
+
return openBlock(), createBlock$1(_sfc_main$l, {
|
|
14298
|
+
key: section.partId,
|
|
14299
|
+
part: section
|
|
14300
|
+
}, null, 8, ["part"]);
|
|
14301
|
+
}), 128))
|
|
14302
|
+
], 16),
|
|
14303
|
+
createElementVNode("div", {
|
|
14304
|
+
class: "pb-add-section-handle bottom",
|
|
14305
|
+
onClick: _cache[0] || (_cache[0] = ($event) => {
|
|
14306
|
+
var _a2, _b2;
|
|
14307
|
+
return insertSection(((_b2 = (_a2 = _ctx.part) == null ? void 0 : _a2.children) == null ? void 0 : _b2.length) || 0);
|
|
14308
|
+
})
|
|
14309
|
+
}, _cache[1] || (_cache[1] = [
|
|
14310
|
+
createElementVNode("i", { class: "material-icons-outlined" }, "add_circle_outline", -1)
|
|
14311
|
+
]))
|
|
14312
|
+
], 44, _hoisted_1$3),
|
|
14313
|
+
_cache[2] || (_cache[2] = createElementVNode("div", { style: { "height": "100px" } }, null, -1))
|
|
14314
|
+
], 64);
|
|
14315
|
+
};
|
|
14316
|
+
}
|
|
14317
|
+
});
|
|
14318
|
+
const canvasStyle = '.pb-page-wrapper {\n margin: 0 auto;\n padding: 0;\n}\n\n.pb-page {\n width: 100%;\n margin: 0;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n}\n\n.pb-page .pb-page-content.selected::before {\n content: "";\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid #4998f8;\n z-index: 999;\n pointer-events: none;\n}\n\n.pb-page * {\n box-sizing: border-box;\n}\n\n.pb-add-widget-button {\n width: 100%;\n height: 100%;\n min-height: 200px;\n position: relative;\n}\n\n.pb-add-widget-button button {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n padding: 8px;\n background: none;\n border: none;\n cursor: pointer;\n}\n\n.pb-add-widget-button button:hover {\n background-color: #eeeeee;\n}\n\n.pb-add-widget-button .icon {\n font-size: 1rem;\n vertical-align: middle;\n}\n\n.pb-add-widget-button .text {\n font-size: 1rem;\n vertical-align: middle;\n margin-left: 0.4rem;\n}\n\n.pb-section {\n position: relative;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n outline: 1px dashed #ccc;\n background-color: #fff;\n}\n\n.pb-section:hover:not(:has(.pb-block:hover)) {\n background-color: #f0f0f0;\n}\n\n.pb-section.selected::before {\n content: "";\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid #4998f8;\n z-index: 999;\n pointer-events: none;\n}\n\n.pb-section.pb-section-static {\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n\n.pb-section.pb-section-static:after {\n content: "";\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n background-color: rgba(0, 0, 0, 0.2);\n}\n\n.pb-section-static .pb-widget {\n outline: none;\n}\n\n.pb-block {\n display: flex;\n min-width: 1px;\n position: relative;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n width: 100%;\n outline: 1px dashed #ccc;\n}\n\n.pb-block:hover:not(:has(.pb-widget:hover)) {\n background-color: #f0f0f0;\n}\n\n.pb-block.selected::before {\n content: "";\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid #4998f8;\n z-index: 999;\n pointer-events: none;\n}\n\n.pb-widget {\n position: relative;\n outline: 1px dashed #ccc;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n}\n\n.pb-widget.selected::before {\n content: "";\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid #4998f8;\n z-index: 999;\n pointer-events: none;\n}\n\n.pb-widget .children {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n\n.pb-widget .pan-handle {\n position: absolute;\n left: -6px;\n top: -6px;\n width: 12px;\n height: 12px;\n background-color: #27ae60;\n cursor: move;\n}\n\n.pb-widget .resize-handle {\n position: absolute;\n right: -6px;\n bottom: -6px;\n width: 12px;\n height: 12px;\n background-color: #27ae60;\n cursor: nwse-resize;\n}\n\n.pb-widget {\n position: relative;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n width: 100%;\n}\n\n.pb-widget .children {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n\n.pb-text-widget {\n width: 100%;\n height: fit-content;\n}\n\n.pb-text-widget .text {\n color: #333;\n}\n\n.pb-text-widget .placeholder {\n padding: 4px 0;\n font-size: 18px;\n text-align: center;\n color: #999;\n}\n\n.pb-image-widget {\n width: 100%;\n}\n\n.pb-image-widget .image {\n width: 100%;\n}\n\n.pb-image-widget .placeholder {\n height: 100px;\n background-color: #eee;\n text-align: center;\n}\n\n.pb-image-widget .placeholder span {\n font-size: 40px;\n color: #999;\n line-height: 100px;\n vertical-align: middle;\n}\n\n.pb-html-widget {\n width: 100%;\n height: fit-content;\n}\n\n.pb-html-widget .placeholder {\n padding: 4px 0;\n font-size: 18px;\n text-align: center;\n color: #999;\n}\n\n.pb-iframe-widget {\n width: 100%;\n height: fit-content;\n}\n\n.pb-iframe-widget .placeholder {\n padding: 4px 0;\n font-size: 18px;\n text-align: center;\n color: #999;\n}\n\n.pb-youtube-widget {\n width: 100%;\n}\n\n.pb-youtube-widget .youtube {\n width: 100%;\n height: 100%;\n}\n\n.pb-youtube-widget .placeholder {\n height: 100px;\n background-color: #eee;\n text-align: center;\n}\n\n.pb-youtube-widget .placeholder span {\n font-size: 40px;\n color: #999;\n line-height: 100px;\n vertical-align: middle;\n}\n\n.pb-container-widget {\n width: 100%;\n}\n\n.pb-container-widget .placeholder {\n height: 100px;\n background-color: #eee;\n text-align: center;\n}\n\n.pb-container-widget .placeholder span {\n font-size: 40px;\n color: #999;\n line-height: 100px;\n vertical-align: middle;\n}\n\n.pb-product-list-widget {\n width: 100%;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: center;\n}\n\n.pb-product-list-widget .product-wrapper {\n width: 25%;\n}\n\n.pb-product-list-widget .product-wrapper .product {\n width: 95%;\n margin: 0 auto;\n padding-top: 8px;\n padding-bottom: 8px;\n}\n\n.pb-product-list-widget .product-wrapper img {\n width: 100%;\n}\n\n.pb-product-list-widget .product-wrapper .name {\n margin-top: 8px;\n font-size: 14px;\n}\n\n.pb-product-list-widget .product-wrapper .price {\n margin-top: 8px;\n font-size: 14px;\n font-weight: bold;\n}\n\n.pb-product-list-widget .product-wrapper .empty {\n height: 200px;\n background-color: #eee;\n text-align: center;\n}\n\n.pb-product-list-widget .product-wrapper .empty span {\n font-size: 40px;\n color: #999;\n line-height: 200px;\n vertical-align: middle;\n}\n\n@media (max-width: 768px) {\n .pb-product-list-widget .product-wrapper {\n width: 50%;\n }\n}\n\n.mobile .pb-product-list-widget .product-wrapper {\n width: 50%;\n}\n\n.pb-login-widget {\n height: 200px;\n text-align: center;\n}\n\n.pb-login-widget h3 {\n padding: 0;\n margin: 0;\n font-size: 32px;\n font-weight: bold;\n color: #ccc;\n line-height: 200px;\n vertical-align: middle;\n}\n\n.font-icon {\n font-family: Material Symbols Outlined, monospace;\n font-size: 1rem;\n max-width: 1em;\n}\n\nhtml, body {\n font-family: Noto Sans, Noto Sans KR, Noto Sans JP, Arial, sans-serif;\n font-size: 12px;\n}\n\nbody {\n margin: 0;\n padding: 0;\n background-color: #aaa;\n overflow: hidden;\n}\n\n.pb-position-mark {\n background-color: #ff3333;\n opacity: 0.5;\n border-radius: 2px;\n}\n\n.pb-add-section-handle {\n position: relative;\n text-align: center;\n cursor: pointer;\n z-index: 5;\n height: 0;\n}\n\n.pb-add-section-handle.top::before, .pb-add-section-handle.bottom::before, .pb-add-section-handle.middle::before {\n content: "";\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n opacity: 0;\n pointer-events: none;\n}\n\n.pb-add-section-handle.bottom {\n left: 50%;\n bottom: -32px;\n}\n\n.pb-add-section-handle:hover.top::before, .pb-add-section-handle:hover.bottom::before, .pb-add-section-handle:hover.middle::before,\n.pb-add-section-handle:hover > i {\n opacity: 1;\n}\n\n.pb-add-section-handle > i {\n vertical-align: middle;\n position: absolute;\n top: 50%;\n left: 0;\n font-size: 2rem;\n transform: translate(-50%, -50%);\n opacity: 0.2;\n}';
|
|
14319
|
+
const _hoisted_1$2 = ["height", "width"];
|
|
14320
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
14321
|
+
__name: "PbPageFrame",
|
|
14322
|
+
props: {
|
|
14323
|
+
part: {},
|
|
14324
|
+
width: {},
|
|
14325
|
+
isMobilePage: { type: Boolean }
|
|
14326
|
+
},
|
|
14327
|
+
setup(__props) {
|
|
14328
|
+
const props = __props;
|
|
14329
|
+
const pageBuilderEditor = usePageBuilderEditor();
|
|
14330
|
+
const iframeRef = ref();
|
|
14331
|
+
provideMouseTracker(iframeRef);
|
|
14332
|
+
const stopIframeWatch = watch(
|
|
14333
|
+
() => {
|
|
14334
|
+
var _a, _b;
|
|
14335
|
+
return (_b = (_a = iframeRef.value) == null ? void 0 : _a.contentWindow) == null ? void 0 : _b.document;
|
|
14336
|
+
},
|
|
14337
|
+
() => {
|
|
14338
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
14339
|
+
if ((_c = (_b = (_a = iframeRef.value) == null ? void 0 : _a.contentWindow) == null ? void 0 : _b.document) == null ? void 0 : _c.head) {
|
|
14340
|
+
const externalCss = pageBuilderEditor.getExternalCss();
|
|
14341
|
+
const head = (_e = (_d = iframeRef.value) == null ? void 0 : _d.contentWindow) == null ? void 0 : _e.document.head;
|
|
14342
|
+
head.innerHTML = `
|
|
14343
|
+
<meta charset="UTF-8"/>
|
|
14344
|
+
<link href="https://fonts.googleapis.com" rel="preconnect">
|
|
14345
|
+
<link crossorigin href="https://fonts.gstatic.com" rel="preconnect">
|
|
14346
|
+
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500&display=swap" rel="stylesheet">
|
|
14347
|
+
<link
|
|
14348
|
+
href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500&family=Noto+Sans:wght@400;500&display=swap"
|
|
14349
|
+
rel="stylesheet">
|
|
14350
|
+
<link
|
|
14351
|
+
href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500&family=Noto+Sans+KR:wght@400;500&family=Noto+Sans:wght@400;500&display=swap"
|
|
14352
|
+
rel="stylesheet">
|
|
14353
|
+
<link
|
|
14354
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=block"
|
|
14355
|
+
rel="stylesheet"/>
|
|
14356
|
+
<link href="https://fonts.googleapis.com/css2?family=Material+Icons+Outlined" rel="stylesheet" />
|
|
14357
|
+
|
|
14358
|
+
<link href="https://bluesea5.g1project.net/assets/index-DjQFWKLW.css" rel="stylesheet" />
|
|
14359
|
+
|
|
14360
|
+
${externalCss}
|
|
14361
|
+
|
|
14362
|
+
<style>${canvasStyle}</style>
|
|
14363
|
+
`;
|
|
14364
|
+
const script2 = (_g = (_f = iframeRef.value) == null ? void 0 : _f.contentWindow) == null ? void 0 : _g.document.createElement("script");
|
|
14365
|
+
script2.innerHTML = `
|
|
14366
|
+
function forwardPostMessage(event) {
|
|
14367
|
+
if (event.data) {
|
|
14368
|
+
console.log(event)
|
|
14369
|
+
window.parent.postMessage(event.data, '*');
|
|
14370
|
+
}
|
|
14371
|
+
}
|
|
14372
|
+
window.addEventListener('message', forwardPostMessage);
|
|
14373
|
+
`;
|
|
14374
|
+
(_h = iframeRef.value) == null ? void 0 : _h.contentWindow.document.head.appendChild(script2);
|
|
14375
|
+
pageBuilderEditor.keyHandlers.addDocumentKeyEventListener(iframeRef.value.contentWindow.document.body);
|
|
14376
|
+
stopIframeWatch();
|
|
14377
|
+
}
|
|
14378
|
+
}
|
|
14379
|
+
);
|
|
14380
|
+
const width = ref(props.width);
|
|
14381
|
+
const height = ref(200);
|
|
14382
|
+
const style = computed(() => ({
|
|
14383
|
+
// width: `${width.value}px`,
|
|
14384
|
+
// height: `${height.value}px`,
|
|
14385
|
+
}));
|
|
14386
|
+
let iframeObserver;
|
|
14387
|
+
const updateIframeHeight = () => {
|
|
14388
|
+
if (!iframeRef.value || !iframeRef.value.contentDocument) return;
|
|
14389
|
+
const iframeBody = iframeRef.value.contentDocument.body;
|
|
14390
|
+
if (iframeBody) {
|
|
14391
|
+
height.value = iframeBody.scrollHeight;
|
|
14392
|
+
}
|
|
14393
|
+
};
|
|
14394
|
+
onMounted(() => {
|
|
14395
|
+
if (!iframeRef.value || !iframeRef.value.contentDocument) return;
|
|
14396
|
+
const iframeBody = iframeRef.value.contentDocument.body;
|
|
14397
|
+
iframeObserver = new MutationObserver(updateIframeHeight);
|
|
14398
|
+
iframeObserver.observe(iframeBody, { childList: true, subtree: true });
|
|
14399
|
+
iframeRef.value.onload = updateIframeHeight;
|
|
14400
|
+
});
|
|
14401
|
+
onBeforeUnmount(() => {
|
|
14402
|
+
if (iframeObserver) {
|
|
14403
|
+
iframeObserver.disconnect();
|
|
14404
|
+
}
|
|
14405
|
+
});
|
|
14406
|
+
return (_ctx, _cache) => {
|
|
14407
|
+
var _a, _b, _c, _d;
|
|
14408
|
+
return openBlock(), createElementBlock("div", {
|
|
14409
|
+
style: normalizeStyle({ width: `${width.value}px` }),
|
|
14410
|
+
class: "pb-page-frame"
|
|
14411
|
+
}, [
|
|
14412
|
+
createVNode(unref(BSSelect), {
|
|
14413
|
+
modelValue: width.value,
|
|
14414
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => width.value = $event),
|
|
14415
|
+
items: [480, 768, 1024, 1280],
|
|
14416
|
+
"label-provider": (v) => `Screen Size: ${v}px`,
|
|
14417
|
+
"value-provider": (v) => v,
|
|
14418
|
+
"view-model": false
|
|
14419
|
+
}, null, 8, ["modelValue", "label-provider", "value-provider"]),
|
|
14420
|
+
createElementVNode("iframe", {
|
|
14421
|
+
ref_key: "iframeRef",
|
|
14422
|
+
ref: iframeRef,
|
|
14423
|
+
height: `${height.value}px`,
|
|
14424
|
+
style: normalizeStyle(style.value),
|
|
14425
|
+
width: `${width.value}px`,
|
|
14426
|
+
class: "page-frame mt-12"
|
|
14427
|
+
}, null, 12, _hoisted_1$2),
|
|
14428
|
+
((_b = (_a = iframeRef.value) == null ? void 0 : _a.contentWindow) == null ? void 0 : _b.document.body) ? (openBlock(), createBlock$1(Teleport, {
|
|
14429
|
+
key: 0,
|
|
14430
|
+
to: (_d = (_c = iframeRef.value) == null ? void 0 : _c.contentWindow) == null ? void 0 : _d.document.body
|
|
14431
|
+
}, [
|
|
14432
|
+
createVNode(_sfc_main$3, {
|
|
14433
|
+
"is-mobile-page": _ctx.isMobilePage,
|
|
14434
|
+
part: _ctx.part,
|
|
14435
|
+
width: width.value
|
|
14436
|
+
}, null, 8, ["is-mobile-page", "part", "width"])
|
|
14437
|
+
], 8, ["to"])) : createCommentVNode("", true)
|
|
14438
|
+
], 4);
|
|
14439
|
+
};
|
|
14440
|
+
}
|
|
14441
|
+
});
|
|
14442
|
+
const _hoisted_1$1 = { class: "pb-canvas-wrapper" };
|
|
14443
|
+
const _hoisted_2$1 = {
|
|
14444
|
+
key: 1,
|
|
14445
|
+
style: { "width": "20px" }
|
|
14446
|
+
};
|
|
14447
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
14448
|
+
__name: "PbCanvas",
|
|
14449
|
+
setup(__props) {
|
|
14450
|
+
const pageBuilder = usePageBuilderEditor();
|
|
14451
|
+
const partS = computed(() => {
|
|
14452
|
+
var _a;
|
|
14453
|
+
return (_a = pageBuilder.model.rootPart.children) == null ? void 0 : _a[0];
|
|
14454
|
+
});
|
|
14455
|
+
const partL = computed(() => {
|
|
14456
|
+
var _a;
|
|
14457
|
+
return (_a = pageBuilder.model.rootPart.children) == null ? void 0 : _a[1];
|
|
14458
|
+
});
|
|
14459
|
+
useContextMenu();
|
|
14460
|
+
const style = computed(() => {
|
|
14461
|
+
const scale = pageBuilder.scale.value;
|
|
14462
|
+
return {
|
|
14463
|
+
style: {
|
|
14464
|
+
transform: `scale(${scale})`
|
|
14465
|
+
}
|
|
14466
|
+
};
|
|
14467
|
+
});
|
|
14215
14468
|
return (_ctx, _cache) => {
|
|
14216
14469
|
return openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
14217
|
-
|
|
14470
|
+
createElementVNode("div", mergeProps({ class: "pb-canvas" }, style.value), [
|
|
14471
|
+
partS.value ? (openBlock(), createBlock$1(_sfc_main$2, {
|
|
14472
|
+
key: 0,
|
|
14473
|
+
"is-mobile-page": true,
|
|
14474
|
+
part: partS.value,
|
|
14475
|
+
width: 480
|
|
14476
|
+
}, null, 8, ["part"])) : createCommentVNode("", true),
|
|
14477
|
+
partL.value ? (openBlock(), createElementBlock("div", _hoisted_2$1)) : createCommentVNode("", true),
|
|
14478
|
+
partL.value ? (openBlock(), createBlock$1(_sfc_main$2, {
|
|
14479
|
+
key: 2,
|
|
14480
|
+
"is-mobile-page": false,
|
|
14481
|
+
part: partL.value,
|
|
14482
|
+
width: 1024
|
|
14483
|
+
}, null, 8, ["part"])) : createCommentVNode("", true)
|
|
14484
|
+
], 16)
|
|
14218
14485
|
]);
|
|
14219
14486
|
};
|
|
14220
14487
|
}
|
|
@@ -14238,12 +14505,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
14238
14505
|
const pageBuilderEditor = createPageBuilderEditor();
|
|
14239
14506
|
pageBuilderEditor.instanceId = props.instanceId;
|
|
14240
14507
|
pageBuilderEditor.title = props.title;
|
|
14241
|
-
if (props.locales)
|
|
14242
|
-
|
|
14243
|
-
if (props.
|
|
14244
|
-
pageBuilderEditor.setLocale(props.locale);
|
|
14245
|
-
if (props.plugin)
|
|
14246
|
-
pageBuilderEditor.registerCustomPlugin(props.plugin);
|
|
14508
|
+
if (props.locales) pageBuilderEditor.setLocales(props.locales);
|
|
14509
|
+
if (props.locale) pageBuilderEditor.setLocale(props.locale);
|
|
14510
|
+
if (props.plugin) pageBuilderEditor.registerCustomPlugin(props.plugin);
|
|
14247
14511
|
pageBuilderEditor.registerPlugin({
|
|
14248
14512
|
// TODO
|
|
14249
14513
|
commands: createDefaultCommands(modal)
|
|
@@ -14271,18 +14535,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
14271
14535
|
});
|
|
14272
14536
|
return (_ctx, _cache) => {
|
|
14273
14537
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
14274
|
-
createVNode(_sfc_main$
|
|
14538
|
+
createVNode(_sfc_main$9, { "toolbar-plugin": _ctx.toolbarPlugin }, null, 8, ["toolbar-plugin"]),
|
|
14275
14539
|
createElementVNode("div", _hoisted_2, [
|
|
14276
|
-
createVNode(_sfc_main$
|
|
14277
|
-
createVNode(_sfc_main$
|
|
14278
|
-
createVNode(_sfc_main$
|
|
14540
|
+
createVNode(_sfc_main$8),
|
|
14541
|
+
createVNode(_sfc_main$1),
|
|
14542
|
+
createVNode(_sfc_main$4)
|
|
14279
14543
|
])
|
|
14280
14544
|
]);
|
|
14281
14545
|
};
|
|
14282
14546
|
}
|
|
14283
14547
|
});
|
|
14284
14548
|
export {
|
|
14549
|
+
usePageBuilder as A,
|
|
14285
14550
|
BLOCK_TYPE$1 as B,
|
|
14551
|
+
usePageBuilderViewer as C,
|
|
14286
14552
|
Model$1 as M,
|
|
14287
14553
|
PbColorPicker as P,
|
|
14288
14554
|
ROOT_TYPE$1 as R,
|
|
@@ -14294,23 +14560,25 @@ export {
|
|
|
14294
14560
|
PAGE_BUILDER_KEY as c,
|
|
14295
14561
|
PAGE_TYPE$1 as d,
|
|
14296
14562
|
Page as e,
|
|
14297
|
-
_sfc_main$
|
|
14563
|
+
_sfc_main$2$1 as f,
|
|
14298
14564
|
Part as g,
|
|
14299
|
-
_sfc_main$
|
|
14300
|
-
_sfc_main$
|
|
14301
|
-
_sfc_main$
|
|
14302
|
-
_sfc_main$
|
|
14303
|
-
_sfc_main$
|
|
14304
|
-
|
|
14305
|
-
|
|
14306
|
-
|
|
14307
|
-
|
|
14308
|
-
|
|
14309
|
-
|
|
14310
|
-
|
|
14311
|
-
|
|
14565
|
+
_sfc_main$1$1 as h,
|
|
14566
|
+
_sfc_main$q as i,
|
|
14567
|
+
_sfc_main$6$1 as j,
|
|
14568
|
+
_sfc_main$5$1 as k,
|
|
14569
|
+
_sfc_main$8$1 as l,
|
|
14570
|
+
_sfc_main$7$1 as m,
|
|
14571
|
+
_sfc_main$4$1 as n,
|
|
14572
|
+
RootPart as o,
|
|
14573
|
+
Section as p,
|
|
14574
|
+
Widget as q,
|
|
14575
|
+
createPageBuilderViewer as r,
|
|
14576
|
+
selectYoutubeVideo as s,
|
|
14577
|
+
createPartComponent as t,
|
|
14312
14578
|
usePageBuilderEditor as u,
|
|
14313
|
-
|
|
14579
|
+
createPartComponents as v,
|
|
14314
14580
|
widgetPartDefinitions as w,
|
|
14315
|
-
|
|
14581
|
+
getPartClassName as x,
|
|
14582
|
+
providePageBuilder as y,
|
|
14583
|
+
providePageBuilderViewer as z
|
|
14316
14584
|
};
|