@g1cloud/page-builder-editor 1.0.0-alpha.81 → 1.0.0-alpha.83
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/page-builder-editor.css +14 -9
- package/dist/{PbPropertyEditorColor-D1Et94Ef.js → PbPropertyEditorColor-B2whCX1d.js} +1 -1
- package/dist/{PbPropertyEditorCssLength-vEqAkXLy.js → PbPropertyEditorCssLength-Cq5y3hp5.js} +1 -1
- package/dist/{PbPropertyEditorHtml-BD1ir-xW.js → PbPropertyEditorHtml-DunmjOZP.js} +1 -1
- package/dist/{PbPropertyEditorImage-CrtSHsie.js → PbPropertyEditorImage-CAULnDMs.js} +1 -1
- package/dist/{PbPropertyEditorMultilineText-v01RFbU-.js → PbPropertyEditorMultilineText-CP-gnrl0.js} +1 -1
- package/dist/{PbPropertyEditorText-CDohV0Yq.js → PbPropertyEditorText-BqXqhBvc.js} +1 -1
- package/dist/{PbPropertyEditorYoutube-gZIWmCbS.js → PbPropertyEditorYoutube-BM-3CS85.js} +1 -1
- package/dist/{PbWidgetAddModal-CetSlzPe.js → PbWidgetAddModal-B0EJiVqs.js} +1 -1
- package/dist/{index-tTR7GhuX.js → index-CzWzYmyG.js} +453 -253
- package/dist/page-builder-editor.js +1 -1
- package/dist/page-builder-editor.umd.cjs +445 -245
- package/dist/style.css +14 -9
- package/package.json +3 -3
- package/scss/canvas.scss +1 -0
- package/scss/page-builder-editor.scss +7 -7
- package/scss/property-editor-youtube.scss +2 -2
- package/scss/property-group-editor-media.scss +5 -0
- package/scss/property-localpart.scss +2 -2
|
@@ -6816,7 +6816,7 @@ class Part {
|
|
|
6816
6816
|
return match;
|
|
6817
6817
|
}
|
|
6818
6818
|
const selectors = match.split(",").map((selector) => selector.trim());
|
|
6819
|
-
const modifiedSelectors = selectors.map((selector) => `[data-part-id
|
|
6819
|
+
const modifiedSelectors = selectors.map((selector) => `[data-part-id="${this.partId}"] ${selector}`).join(", ");
|
|
6820
6820
|
return `${modifiedSelectors} `;
|
|
6821
6821
|
});
|
|
6822
6822
|
}
|
|
@@ -6897,32 +6897,52 @@ const _sfc_main$b$1 = /* @__PURE__ */ defineComponent({
|
|
|
6897
6897
|
emit("update:visible", value, !!((_a = props.part.properties) == null ? void 0 : _a.hideParentWhenInvisible));
|
|
6898
6898
|
};
|
|
6899
6899
|
const classNames = computed(() => [getPartClassName(props.part), props.part.getClassNames()]);
|
|
6900
|
-
const styleTag = computed(() => props.part.getStyleTag());
|
|
6901
6900
|
const style = computed(() => ({
|
|
6902
6901
|
...props.part.getStyles(),
|
|
6903
6902
|
...props.part.getInlineStyles()
|
|
6904
6903
|
}));
|
|
6905
6904
|
const thisComponent = computed(() => createPartComponent(props.part));
|
|
6905
|
+
const styleTag = computed(() => props.part.getStyleTag());
|
|
6906
|
+
function ensureStyleTag() {
|
|
6907
|
+
removeStyleTag();
|
|
6908
|
+
if (!styleTag.value) return;
|
|
6909
|
+
let styleEl = document.head.querySelector(`style[data-part-style-id="${props.part.partId}"]`);
|
|
6910
|
+
if (!styleEl) {
|
|
6911
|
+
styleEl = document.createElement("style");
|
|
6912
|
+
styleEl.setAttribute("data-part-style-id", props.part.partId);
|
|
6913
|
+
document.head.appendChild(styleEl);
|
|
6914
|
+
}
|
|
6915
|
+
styleEl.textContent = styleTag.value;
|
|
6916
|
+
}
|
|
6917
|
+
function removeStyleTag() {
|
|
6918
|
+
const styleEl = document.head.querySelector(`style[data-part-style-id="${props.part.partId}"]`);
|
|
6919
|
+
if (styleEl) {
|
|
6920
|
+
document.head.removeChild(styleEl);
|
|
6921
|
+
}
|
|
6922
|
+
}
|
|
6923
|
+
watch(styleTag, () => {
|
|
6924
|
+
ensureStyleTag();
|
|
6925
|
+
});
|
|
6926
|
+
onMounted(() => {
|
|
6927
|
+
ensureStyleTag();
|
|
6928
|
+
});
|
|
6929
|
+
onBeforeUnmount(() => {
|
|
6930
|
+
removeStyleTag();
|
|
6931
|
+
});
|
|
6906
6932
|
return (_ctx, _cache) => {
|
|
6907
|
-
return openBlock(), createElementBlock(
|
|
6908
|
-
|
|
6933
|
+
return withDirectives((openBlock(), createElementBlock("div", {
|
|
6934
|
+
class: normalizeClass([classNames.value, "pb-widget"]),
|
|
6935
|
+
"data-part-id": _ctx.part.partId,
|
|
6936
|
+
style: normalizeStyle(style.value)
|
|
6937
|
+
}, [
|
|
6938
|
+
thisComponent.value ? (openBlock(), createBlock$1(resolveDynamicComponent(thisComponent.value), {
|
|
6909
6939
|
key: 0,
|
|
6910
|
-
|
|
6911
|
-
|
|
6912
|
-
|
|
6913
|
-
|
|
6914
|
-
|
|
6915
|
-
|
|
6916
|
-
}, [
|
|
6917
|
-
thisComponent.value ? (openBlock(), createBlock$1(resolveDynamicComponent(thisComponent.value), {
|
|
6918
|
-
key: 0,
|
|
6919
|
-
part: _ctx.part,
|
|
6920
|
-
"onUpdate:visible": updateVisible
|
|
6921
|
-
}, null, 40, ["part"])) : createCommentVNode("", true)
|
|
6922
|
-
], 14, _hoisted_1$a$1), [
|
|
6923
|
-
[vShow, visible.value]
|
|
6924
|
-
])
|
|
6925
|
-
], 64);
|
|
6940
|
+
part: _ctx.part,
|
|
6941
|
+
"onUpdate:visible": updateVisible
|
|
6942
|
+
}, null, 40, ["part"])) : createCommentVNode("", true)
|
|
6943
|
+
], 14, _hoisted_1$a$1)), [
|
|
6944
|
+
[vShow, visible.value]
|
|
6945
|
+
]);
|
|
6926
6946
|
};
|
|
6927
6947
|
}
|
|
6928
6948
|
});
|
|
@@ -6945,33 +6965,53 @@ const _sfc_main$a$1 = /* @__PURE__ */ defineComponent({
|
|
|
6945
6965
|
emit("update:visible", visible.value, hideParentWhenInvisible);
|
|
6946
6966
|
};
|
|
6947
6967
|
const classNames = computed(() => [getPartClassName(props.part), props.part.getClassNames()]);
|
|
6948
|
-
const styleTag = computed(() => props.part.getStyleTag());
|
|
6949
6968
|
const style = computed(() => ({
|
|
6950
6969
|
...props.part.getStyles(props.isMobilePage),
|
|
6951
6970
|
...props.part.getInlineStyles()
|
|
6952
6971
|
}));
|
|
6972
|
+
const styleTag = computed(() => props.part.getStyleTag());
|
|
6973
|
+
function ensureStyleTag() {
|
|
6974
|
+
removeStyleTag();
|
|
6975
|
+
if (!styleTag.value) return;
|
|
6976
|
+
let styleEl = document.head.querySelector(`style[data-part-style-id="${props.part.partId}"]`);
|
|
6977
|
+
if (!styleEl) {
|
|
6978
|
+
styleEl = document.createElement("style");
|
|
6979
|
+
styleEl.setAttribute("data-part-style-id", props.part.partId);
|
|
6980
|
+
document.head.appendChild(styleEl);
|
|
6981
|
+
}
|
|
6982
|
+
styleEl.textContent = styleTag.value;
|
|
6983
|
+
}
|
|
6984
|
+
function removeStyleTag() {
|
|
6985
|
+
const styleEl = document.head.querySelector(`style[data-part-style-id="${props.part.partId}"]`);
|
|
6986
|
+
if (styleEl) {
|
|
6987
|
+
document.head.removeChild(styleEl);
|
|
6988
|
+
}
|
|
6989
|
+
}
|
|
6990
|
+
watch(styleTag, () => {
|
|
6991
|
+
ensureStyleTag();
|
|
6992
|
+
});
|
|
6993
|
+
onMounted(() => {
|
|
6994
|
+
ensureStyleTag();
|
|
6995
|
+
});
|
|
6996
|
+
onBeforeUnmount(() => {
|
|
6997
|
+
removeStyleTag();
|
|
6998
|
+
});
|
|
6953
6999
|
return (_ctx, _cache) => {
|
|
6954
|
-
return openBlock(), createElementBlock(
|
|
6955
|
-
|
|
6956
|
-
|
|
6957
|
-
|
|
6958
|
-
|
|
6959
|
-
|
|
6960
|
-
|
|
6961
|
-
|
|
6962
|
-
|
|
6963
|
-
|
|
6964
|
-
|
|
6965
|
-
|
|
6966
|
-
|
|
6967
|
-
|
|
6968
|
-
|
|
6969
|
-
}, null, 8, ["part"]);
|
|
6970
|
-
}), 128)) : createCommentVNode("", true)
|
|
6971
|
-
], 14, _hoisted_1$9$1), [
|
|
6972
|
-
[vShow, visible.value]
|
|
6973
|
-
])
|
|
6974
|
-
], 64);
|
|
7000
|
+
return withDirectives((openBlock(), createElementBlock("div", {
|
|
7001
|
+
class: normalizeClass(classNames.value),
|
|
7002
|
+
"data-part-id": _ctx.part.partId,
|
|
7003
|
+
style: normalizeStyle(style.value)
|
|
7004
|
+
}, [
|
|
7005
|
+
_ctx.part.children && _ctx.part.children.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.part.children, (child) => {
|
|
7006
|
+
return openBlock(), createBlock$1(_sfc_main$b$1, {
|
|
7007
|
+
key: child.partId,
|
|
7008
|
+
part: child,
|
|
7009
|
+
"onUpdate:visible": _cache[0] || (_cache[0] = (value, hideParentWhenInvisible) => updateVisible(value, hideParentWhenInvisible))
|
|
7010
|
+
}, null, 8, ["part"]);
|
|
7011
|
+
}), 128)) : createCommentVNode("", true)
|
|
7012
|
+
], 14, _hoisted_1$9$1)), [
|
|
7013
|
+
[vShow, visible.value]
|
|
7014
|
+
]);
|
|
6975
7015
|
};
|
|
6976
7016
|
}
|
|
6977
7017
|
});
|
|
@@ -6991,34 +7031,54 @@ const _sfc_main$9$1 = /* @__PURE__ */ defineComponent({
|
|
|
6991
7031
|
}
|
|
6992
7032
|
};
|
|
6993
7033
|
const classNames = computed(() => [getPartClassName(props.part), props.part.getClassNames()]);
|
|
6994
|
-
const styleTag = computed(() => props.part.getStyleTag());
|
|
6995
7034
|
const style = computed(() => ({
|
|
6996
7035
|
...props.part.getStyles(props.isMobilePage),
|
|
6997
7036
|
...props.part.getInlineStyles()
|
|
6998
7037
|
}));
|
|
7038
|
+
const styleTag = computed(() => props.part.getStyleTag());
|
|
7039
|
+
function ensureStyleTag() {
|
|
7040
|
+
removeStyleTag();
|
|
7041
|
+
if (!styleTag.value) return;
|
|
7042
|
+
let styleEl = document.head.querySelector(`style[data-part-style-id="${props.part.partId}"]`);
|
|
7043
|
+
if (!styleEl) {
|
|
7044
|
+
styleEl = document.createElement("style");
|
|
7045
|
+
styleEl.setAttribute("data-part-style-id", props.part.partId);
|
|
7046
|
+
document.head.appendChild(styleEl);
|
|
7047
|
+
}
|
|
7048
|
+
styleEl.textContent = styleTag.value;
|
|
7049
|
+
}
|
|
7050
|
+
function removeStyleTag() {
|
|
7051
|
+
const styleEl = document.head.querySelector(`style[data-part-style-id="${props.part.partId}"]`);
|
|
7052
|
+
if (styleEl) {
|
|
7053
|
+
document.head.removeChild(styleEl);
|
|
7054
|
+
}
|
|
7055
|
+
}
|
|
7056
|
+
watch(styleTag, () => {
|
|
7057
|
+
ensureStyleTag();
|
|
7058
|
+
});
|
|
7059
|
+
onMounted(() => {
|
|
7060
|
+
ensureStyleTag();
|
|
7061
|
+
});
|
|
7062
|
+
onBeforeUnmount(() => {
|
|
7063
|
+
removeStyleTag();
|
|
7064
|
+
});
|
|
6999
7065
|
return (_ctx, _cache) => {
|
|
7000
|
-
return openBlock(), createElementBlock(
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
7008
|
-
|
|
7009
|
-
|
|
7010
|
-
|
|
7011
|
-
|
|
7012
|
-
|
|
7013
|
-
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
}, null, 8, ["is-mobile-page", "part"]);
|
|
7017
|
-
}), 128)) : createCommentVNode("", true)
|
|
7018
|
-
], 14, _hoisted_1$8$1), [
|
|
7019
|
-
[vShow, visible.value]
|
|
7020
|
-
])
|
|
7021
|
-
], 64);
|
|
7066
|
+
return withDirectives((openBlock(), createElementBlock("div", {
|
|
7067
|
+
class: normalizeClass(classNames.value),
|
|
7068
|
+
"data-part-id": _ctx.part.partId,
|
|
7069
|
+
style: normalizeStyle(style.value)
|
|
7070
|
+
}, [
|
|
7071
|
+
_ctx.part.children && _ctx.part.children.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.part.children, (child) => {
|
|
7072
|
+
return openBlock(), createBlock$1(_sfc_main$a$1, {
|
|
7073
|
+
key: child.partId,
|
|
7074
|
+
"is-mobile-page": _ctx.isMobilePage,
|
|
7075
|
+
part: child,
|
|
7076
|
+
"onUpdate:visible": _cache[0] || (_cache[0] = (value, hideParentWhenInvisible) => updateVisible(value, hideParentWhenInvisible))
|
|
7077
|
+
}, null, 8, ["is-mobile-page", "part"]);
|
|
7078
|
+
}), 128)) : createCommentVNode("", true)
|
|
7079
|
+
], 14, _hoisted_1$8$1)), [
|
|
7080
|
+
[vShow, visible.value]
|
|
7081
|
+
]);
|
|
7022
7082
|
};
|
|
7023
7083
|
}
|
|
7024
7084
|
});
|
|
@@ -7046,9 +7106,11 @@ const _sfc_main$8$1 = /* @__PURE__ */ defineComponent({
|
|
|
7046
7106
|
return (_a = props.part.properties) == null ? void 0 : _a.media;
|
|
7047
7107
|
});
|
|
7048
7108
|
const altText = computed(() => {
|
|
7049
|
-
|
|
7109
|
+
var _a, _b;
|
|
7110
|
+
const _altText = (_b = (_a = props.part.properties) == null ? void 0 : _a.media) == null ? void 0 : _b.altText;
|
|
7111
|
+
if (media.value && _altText) {
|
|
7050
7112
|
const locale = pageBuilder.getLocale();
|
|
7051
|
-
return
|
|
7113
|
+
return _altText[locale] || "";
|
|
7052
7114
|
}
|
|
7053
7115
|
return "";
|
|
7054
7116
|
});
|
|
@@ -7607,32 +7669,56 @@ const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
|
|
|
7607
7669
|
},
|
|
7608
7670
|
setup(__props) {
|
|
7609
7671
|
const props = __props;
|
|
7610
|
-
const classNames = computed(() => [
|
|
7611
|
-
|
|
7672
|
+
const classNames = computed(() => [
|
|
7673
|
+
getPartClassName(props.part),
|
|
7674
|
+
props.part.getClassNames(),
|
|
7675
|
+
props.isMobilePage ? "mobile" : "pc"
|
|
7676
|
+
]);
|
|
7612
7677
|
const style = computed(() => ({
|
|
7613
7678
|
...props.part.getStyles(props.isMobilePage),
|
|
7614
7679
|
...props.part.getInlineStyles()
|
|
7615
7680
|
}));
|
|
7681
|
+
const styleTag = computed(() => props.part.getStyleTag());
|
|
7682
|
+
function ensureStyleTag() {
|
|
7683
|
+
removeStyleTag();
|
|
7684
|
+
if (!styleTag.value) return;
|
|
7685
|
+
let styleEl = document.head.querySelector(`style[data-part-style-id="${props.part.partId}"]`);
|
|
7686
|
+
if (!styleEl) {
|
|
7687
|
+
styleEl = document.createElement("style");
|
|
7688
|
+
styleEl.setAttribute("data-part-style-id", props.part.partId);
|
|
7689
|
+
document.head.appendChild(styleEl);
|
|
7690
|
+
}
|
|
7691
|
+
styleEl.textContent = styleTag.value;
|
|
7692
|
+
}
|
|
7693
|
+
function removeStyleTag() {
|
|
7694
|
+
const styleEl = document.head.querySelector(`style[data-part-style-id="${props.part.partId}"]`);
|
|
7695
|
+
if (styleEl) {
|
|
7696
|
+
document.head.removeChild(styleEl);
|
|
7697
|
+
}
|
|
7698
|
+
}
|
|
7699
|
+
watch(styleTag, () => {
|
|
7700
|
+
ensureStyleTag();
|
|
7701
|
+
});
|
|
7702
|
+
onMounted(() => {
|
|
7703
|
+
ensureStyleTag();
|
|
7704
|
+
});
|
|
7705
|
+
onBeforeUnmount(() => {
|
|
7706
|
+
removeStyleTag();
|
|
7707
|
+
});
|
|
7616
7708
|
return (_ctx, _cache) => {
|
|
7617
|
-
return openBlock(), createElementBlock(
|
|
7618
|
-
|
|
7619
|
-
|
|
7620
|
-
|
|
7621
|
-
|
|
7622
|
-
|
|
7623
|
-
|
|
7624
|
-
|
|
7625
|
-
|
|
7626
|
-
|
|
7627
|
-
|
|
7628
|
-
|
|
7629
|
-
|
|
7630
|
-
"is-mobile-page": _ctx.isMobilePage,
|
|
7631
|
-
part: section
|
|
7632
|
-
}, null, 8, ["is-mobile-page", "part"]);
|
|
7633
|
-
}), 128))
|
|
7634
|
-
], 14, _hoisted_1$2$1)
|
|
7635
|
-
], 64);
|
|
7709
|
+
return openBlock(), createElementBlock("div", {
|
|
7710
|
+
class: normalizeClass([classNames.value, "pb-page"]),
|
|
7711
|
+
"data-part-id": _ctx.part.partId,
|
|
7712
|
+
style: normalizeStyle(style.value)
|
|
7713
|
+
}, [
|
|
7714
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.part.children, (section) => {
|
|
7715
|
+
return openBlock(), createBlock$1(_sfc_main$9$1, {
|
|
7716
|
+
key: section.partId,
|
|
7717
|
+
"is-mobile-page": _ctx.isMobilePage,
|
|
7718
|
+
part: section
|
|
7719
|
+
}, null, 8, ["is-mobile-page", "part"]);
|
|
7720
|
+
}), 128))
|
|
7721
|
+
], 14, _hoisted_1$2$1);
|
|
7636
7722
|
};
|
|
7637
7723
|
}
|
|
7638
7724
|
});
|
|
@@ -8318,16 +8404,16 @@ class PartManager {
|
|
|
8318
8404
|
const defaultPartPropertyEditors = () => {
|
|
8319
8405
|
return {
|
|
8320
8406
|
"readonly-text": () => defineAsyncComponent(() => import("./PbPropertyEditorReadonlyText-BJ5qx69O.js")),
|
|
8321
|
-
"text": () => defineAsyncComponent(() => import("./PbPropertyEditorText-
|
|
8407
|
+
"text": () => defineAsyncComponent(() => import("./PbPropertyEditorText-BqXqhBvc.js")),
|
|
8322
8408
|
"number": () => defineAsyncComponent(() => import("./PbPropertyEditorNumber-B76ArSb5.js")),
|
|
8323
8409
|
"boolean": () => defineAsyncComponent(() => import("./PbPropertyEditorBoolean-c5CNiTpt.js")),
|
|
8324
|
-
"multiline-text": () => defineAsyncComponent(() => import("./PbPropertyEditorMultilineText-
|
|
8410
|
+
"multiline-text": () => defineAsyncComponent(() => import("./PbPropertyEditorMultilineText-CP-gnrl0.js")),
|
|
8325
8411
|
"select": () => defineAsyncComponent(() => import("./PbPropertyEditorSelect-B5sfulvx.js")),
|
|
8326
|
-
"css-length": () => defineAsyncComponent(() => import("./PbPropertyEditorCssLength-
|
|
8327
|
-
"color": () => defineAsyncComponent(() => import("./PbPropertyEditorColor-
|
|
8328
|
-
"image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-
|
|
8329
|
-
"html": () => defineAsyncComponent(() => import("./PbPropertyEditorHtml-
|
|
8330
|
-
"youtube": () => defineAsyncComponent(() => import("./PbPropertyEditorYoutube-
|
|
8412
|
+
"css-length": () => defineAsyncComponent(() => import("./PbPropertyEditorCssLength-Cq5y3hp5.js")),
|
|
8413
|
+
"color": () => defineAsyncComponent(() => import("./PbPropertyEditorColor-B2whCX1d.js")),
|
|
8414
|
+
"image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-CAULnDMs.js")),
|
|
8415
|
+
"html": () => defineAsyncComponent(() => import("./PbPropertyEditorHtml-DunmjOZP.js")),
|
|
8416
|
+
"youtube": () => defineAsyncComponent(() => import("./PbPropertyEditorYoutube-BM-3CS85.js"))
|
|
8331
8417
|
};
|
|
8332
8418
|
};
|
|
8333
8419
|
const getPropertyValueOfParts = (parts, propertyName) => {
|
|
@@ -8630,18 +8716,17 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
8630
8716
|
},
|
|
8631
8717
|
setup(__props) {
|
|
8632
8718
|
const mouseTracker = useMouseTracker();
|
|
8633
|
-
const widget = ref(null);
|
|
8634
8719
|
const draggable = ref(true);
|
|
8635
8720
|
let dragStartX, dragStartY, initX, initY, initWidth, initHeight;
|
|
8636
8721
|
const panChild = (event) => {
|
|
8637
8722
|
draggable.value = false;
|
|
8638
8723
|
event.stopPropagation();
|
|
8639
8724
|
event.preventDefault();
|
|
8640
|
-
if (!
|
|
8725
|
+
if (!partRef.value) return;
|
|
8641
8726
|
dragStartX = event.clientX;
|
|
8642
8727
|
dragStartY = event.clientY;
|
|
8643
|
-
initX =
|
|
8644
|
-
initY =
|
|
8728
|
+
initX = partRef.value.offsetLeft;
|
|
8729
|
+
initY = partRef.value.offsetTop;
|
|
8645
8730
|
const _mousemove = (event2) => {
|
|
8646
8731
|
const dx = event2.clientX - dragStartX;
|
|
8647
8732
|
const dy = event2.clientY - dragStartY;
|
|
@@ -8657,8 +8742,8 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
8657
8742
|
draggable.value = false;
|
|
8658
8743
|
event.stopPropagation();
|
|
8659
8744
|
event.preventDefault();
|
|
8660
|
-
if (!
|
|
8661
|
-
const rect =
|
|
8745
|
+
if (!partRef.value) return;
|
|
8746
|
+
const rect = partRef.value.getBoundingClientRect();
|
|
8662
8747
|
dragStartX = event.clientX;
|
|
8663
8748
|
dragStartY = event.clientY;
|
|
8664
8749
|
initWidth = rect.width;
|
|
@@ -8685,7 +8770,6 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
8685
8770
|
selected.value ? "selected" : "",
|
|
8686
8771
|
props.part.getClassNames()
|
|
8687
8772
|
]);
|
|
8688
|
-
const styleTag = computed(() => props.part.getStyleTag());
|
|
8689
8773
|
const style = computed(() => {
|
|
8690
8774
|
var _a, _b, _c, _d;
|
|
8691
8775
|
let style2 = {
|
|
@@ -8711,6 +8795,41 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
8711
8795
|
};
|
|
8712
8796
|
});
|
|
8713
8797
|
const component = computed(() => pageBuilder.partManager.createPartComponent(props.part));
|
|
8798
|
+
const styleTag = computed(() => props.part.getStyleTag());
|
|
8799
|
+
const partRef = ref(null);
|
|
8800
|
+
function ensureStyleTag() {
|
|
8801
|
+
removeStyleTag();
|
|
8802
|
+
if (!partRef.value) return;
|
|
8803
|
+
const doc = partRef.value.ownerDocument;
|
|
8804
|
+
if (!doc || !styleTag.value) return;
|
|
8805
|
+
let styleEl = doc.head.querySelector(`style[data-part-style-id="${props.part.partId}"]`);
|
|
8806
|
+
if (!styleEl) {
|
|
8807
|
+
styleEl = document.createElement("style");
|
|
8808
|
+
styleEl.setAttribute("data-part-style-id", props.part.partId);
|
|
8809
|
+
doc.head.appendChild(styleEl);
|
|
8810
|
+
}
|
|
8811
|
+
styleEl.textContent = styleTag.value;
|
|
8812
|
+
}
|
|
8813
|
+
function removeStyleTag() {
|
|
8814
|
+
if (!partRef.value) return;
|
|
8815
|
+
const doc = partRef.value.ownerDocument;
|
|
8816
|
+
if (!doc) return;
|
|
8817
|
+
const styleEl = doc.head.querySelector(`style[data-part-style-id="${props.part.partId}"]`);
|
|
8818
|
+
if (styleEl) {
|
|
8819
|
+
doc.head.removeChild(styleEl);
|
|
8820
|
+
}
|
|
8821
|
+
}
|
|
8822
|
+
watch(styleTag, () => {
|
|
8823
|
+
ensureStyleTag();
|
|
8824
|
+
});
|
|
8825
|
+
onMounted(() => {
|
|
8826
|
+
if (partRef.value) {
|
|
8827
|
+
ensureStyleTag();
|
|
8828
|
+
}
|
|
8829
|
+
});
|
|
8830
|
+
onBeforeUnmount(() => {
|
|
8831
|
+
removeStyleTag();
|
|
8832
|
+
});
|
|
8714
8833
|
const locatePositionMark = (mark, target, mouseOffsetX, mouseOffsetY, draggingPart2, event) => {
|
|
8715
8834
|
if (props.part.isNestedWidget()) {
|
|
8716
8835
|
if (draggingPart2.isWidget())
|
|
@@ -8726,11 +8845,11 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
8726
8845
|
};
|
|
8727
8846
|
const locateSection = (mark, target, mouseOffsetX, mouseOffsetY, draggingPart2, event) => {
|
|
8728
8847
|
mark.style.background = "#e67e22";
|
|
8729
|
-
const
|
|
8848
|
+
const widget = props.part;
|
|
8730
8849
|
const widgetElement = target;
|
|
8731
|
-
const block =
|
|
8850
|
+
const block = widget.parent;
|
|
8732
8851
|
const blockElement = widgetElement.parentElement;
|
|
8733
|
-
const widgetIndex = block.children.indexOf(
|
|
8852
|
+
const widgetIndex = block.children.indexOf(widget);
|
|
8734
8853
|
const isFirstWidget = widgetIndex === 0;
|
|
8735
8854
|
const isLastWidget = widgetIndex === block.children.length - 1;
|
|
8736
8855
|
const section = block.parent;
|
|
@@ -8825,9 +8944,9 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
8825
8944
|
}
|
|
8826
8945
|
mark.style.background = "#27ae60";
|
|
8827
8946
|
const isNestedWidget = props.part.isNestedWidget();
|
|
8828
|
-
const
|
|
8947
|
+
const widget = isNestedWidget ? props.part.parent : props.part;
|
|
8829
8948
|
const widgetElement = isNestedWidget ? target.parentElement.parentElement : target;
|
|
8830
|
-
const block =
|
|
8949
|
+
const block = widget.parent;
|
|
8831
8950
|
const centerX = widgetElement.offsetWidth / 2;
|
|
8832
8951
|
const centerY = widgetElement.offsetHeight / 2;
|
|
8833
8952
|
const quaterX = centerX / 2;
|
|
@@ -8880,10 +8999,10 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
8880
8999
|
};
|
|
8881
9000
|
const acceptSection = (pageBuilder2, target, droppedPart, mouseOffsetX, mouseOffsetY) => {
|
|
8882
9001
|
var _a;
|
|
8883
|
-
const
|
|
9002
|
+
const widget = props.part;
|
|
8884
9003
|
const widgetElement = target;
|
|
8885
|
-
const block =
|
|
8886
|
-
const widgetIndex = block.children.indexOf(
|
|
9004
|
+
const block = widget.parent;
|
|
9005
|
+
const widgetIndex = block.children.indexOf(widget);
|
|
8887
9006
|
const isFirstWidget = widgetIndex === 0;
|
|
8888
9007
|
const isLastWidget = widgetIndex === block.children.length - 1;
|
|
8889
9008
|
const section = block.parent;
|
|
@@ -8920,10 +9039,10 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
8920
9039
|
};
|
|
8921
9040
|
const acceptBlock = (pageBuilder2, target, droppedPart, mouseOffsetX, mouseOffsetY) => {
|
|
8922
9041
|
var _a;
|
|
8923
|
-
const
|
|
9042
|
+
const widget = props.part;
|
|
8924
9043
|
const widgetElement = target;
|
|
8925
|
-
const block =
|
|
8926
|
-
const widgetIndex = block.children.indexOf(
|
|
9044
|
+
const block = widget.parent;
|
|
9045
|
+
const widgetIndex = block.children.indexOf(widget);
|
|
8927
9046
|
const isFirstWidget = widgetIndex === 0;
|
|
8928
9047
|
const isLastWidget = widgetIndex === block.children.length - 1;
|
|
8929
9048
|
const section = block.parent;
|
|
@@ -8957,9 +9076,9 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
8957
9076
|
};
|
|
8958
9077
|
const acceptWidget = (pageBuilder2, target, droppedPart, mouseOffsetX, mouseOffsetY) => {
|
|
8959
9078
|
const isNestedWidget = props.part.isNestedWidget();
|
|
8960
|
-
const
|
|
8961
|
-
const block =
|
|
8962
|
-
const widgetIndex = block.children.indexOf(
|
|
9079
|
+
const widget = isNestedWidget ? props.part.parent : props.part;
|
|
9080
|
+
const block = widget.parent;
|
|
9081
|
+
const widgetIndex = block.children.indexOf(widget) || 0;
|
|
8963
9082
|
const centerY = target.offsetHeight / 2;
|
|
8964
9083
|
const centerX = target.offsetWidth / 2;
|
|
8965
9084
|
const quaterX = centerX / 2;
|
|
@@ -8973,7 +9092,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
8973
9092
|
index = widgetIndex + 1;
|
|
8974
9093
|
} else {
|
|
8975
9094
|
if (pageBuilder2.partManager.isChildAllowed(props.part)) {
|
|
8976
|
-
acceptWidgetInside(
|
|
9095
|
+
acceptWidgetInside(widget, droppedPart, pageBuilder2);
|
|
8977
9096
|
}
|
|
8978
9097
|
return;
|
|
8979
9098
|
}
|
|
@@ -8984,7 +9103,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
8984
9103
|
index = widgetIndex + 1;
|
|
8985
9104
|
} else {
|
|
8986
9105
|
if (pageBuilder2.partManager.isChildAllowed(props.part)) {
|
|
8987
|
-
acceptWidgetInside(
|
|
9106
|
+
acceptWidgetInside(widget, droppedPart, pageBuilder2);
|
|
8988
9107
|
}
|
|
8989
9108
|
return;
|
|
8990
9109
|
}
|
|
@@ -9001,10 +9120,10 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
9001
9120
|
}];
|
|
9002
9121
|
pageBuilder2.model.moveElements(droppedPart.partId, block.partId, index, update);
|
|
9003
9122
|
};
|
|
9004
|
-
const acceptWidgetInside = (
|
|
9123
|
+
const acceptWidgetInside = (widget, droppedPart, pageBuilder2) => {
|
|
9005
9124
|
var _a, _b;
|
|
9006
|
-
const index = ((_a =
|
|
9007
|
-
if (((_b =
|
|
9125
|
+
const index = ((_a = widget.children) == null ? void 0 : _a.length) || 0;
|
|
9126
|
+
if (((_b = widget.children) == null ? void 0 : _b.indexOf(droppedPart)) !== index) {
|
|
9008
9127
|
const update = [{
|
|
9009
9128
|
partId: droppedPart.partId,
|
|
9010
9129
|
properties: {
|
|
@@ -9013,7 +9132,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
9013
9132
|
width: "50%"
|
|
9014
9133
|
}
|
|
9015
9134
|
}];
|
|
9016
|
-
pageBuilder2.model.moveElements(droppedPart.partId,
|
|
9135
|
+
pageBuilder2.model.moveElements(droppedPart.partId, widget.partId, index, update);
|
|
9017
9136
|
}
|
|
9018
9137
|
};
|
|
9019
9138
|
const calculateDropIndex = (part, target, mouseOffsetX, mouseOffsetY, _event) => {
|
|
@@ -9034,34 +9153,28 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
9034
9153
|
return index;
|
|
9035
9154
|
};
|
|
9036
9155
|
return (_ctx, _cache) => {
|
|
9037
|
-
return openBlock(), createElementBlock(
|
|
9038
|
-
|
|
9039
|
-
|
|
9040
|
-
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
9044
|
-
|
|
9045
|
-
|
|
9046
|
-
|
|
9047
|
-
|
|
9048
|
-
|
|
9049
|
-
|
|
9050
|
-
|
|
9051
|
-
|
|
9052
|
-
|
|
9053
|
-
|
|
9054
|
-
|
|
9055
|
-
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
9059
|
-
onMousedown: resizeChild
|
|
9060
|
-
}, null, 32)) : createCommentVNode("", true)
|
|
9061
|
-
], 14, _hoisted_1$s)), [
|
|
9062
|
-
[unref(vPartHandler), { pageBuilder: unref(pageBuilder), part: _ctx.part, droppable: true, locatePositionMark, calculateDropIndex, acceptChildPart }]
|
|
9063
|
-
])
|
|
9064
|
-
], 64);
|
|
9156
|
+
return withDirectives((openBlock(), createElementBlock("div", {
|
|
9157
|
+
ref_key: "partRef",
|
|
9158
|
+
ref: partRef,
|
|
9159
|
+
class: normalizeClass([classNames.value, "pb-widget"]),
|
|
9160
|
+
"data-part-id": _ctx.part.partId,
|
|
9161
|
+
draggable: draggable.value,
|
|
9162
|
+
style: normalizeStyle(style.value)
|
|
9163
|
+
}, [
|
|
9164
|
+
component.value ? (openBlock(), createBlock$1(resolveDynamicComponent(component.value), normalizeProps(mergeProps({ key: 0 }, bind.value)), null, 16)) : (openBlock(), createElementBlock("div", _hoisted_2$h)),
|
|
9165
|
+
selected.value && _ctx.part.isNestedWidget() ? (openBlock(), createElementBlock("div", {
|
|
9166
|
+
key: 2,
|
|
9167
|
+
class: "pan-handle",
|
|
9168
|
+
onMousedown: panChild
|
|
9169
|
+
}, null, 32)) : createCommentVNode("", true),
|
|
9170
|
+
selected.value && _ctx.part.isNestedWidget() ? (openBlock(), createElementBlock("div", {
|
|
9171
|
+
key: 3,
|
|
9172
|
+
class: "resize-handle",
|
|
9173
|
+
onMousedown: resizeChild
|
|
9174
|
+
}, null, 32)) : createCommentVNode("", true)
|
|
9175
|
+
], 14, _hoisted_1$s)), [
|
|
9176
|
+
[unref(vPartHandler), { pageBuilder: unref(pageBuilder), part: _ctx.part, droppable: true, locatePositionMark, calculateDropIndex, acceptChildPart }]
|
|
9177
|
+
]);
|
|
9065
9178
|
};
|
|
9066
9179
|
}
|
|
9067
9180
|
});
|
|
@@ -9082,6 +9195,40 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
9082
9195
|
props.part.getClassNames()
|
|
9083
9196
|
]);
|
|
9084
9197
|
const styleTag = computed(() => props.part.getStyleTag());
|
|
9198
|
+
const partRef = ref(null);
|
|
9199
|
+
function ensureStyleTag() {
|
|
9200
|
+
removeStyleTag();
|
|
9201
|
+
if (!partRef.value) return;
|
|
9202
|
+
const doc = partRef.value.ownerDocument;
|
|
9203
|
+
if (!doc || !styleTag.value) return;
|
|
9204
|
+
let styleEl = doc.head.querySelector(`style[data-part-style-id="${props.part.partId}"]`);
|
|
9205
|
+
if (!styleEl) {
|
|
9206
|
+
styleEl = document.createElement("style");
|
|
9207
|
+
styleEl.setAttribute("data-part-style-id", props.part.partId);
|
|
9208
|
+
doc.head.appendChild(styleEl);
|
|
9209
|
+
}
|
|
9210
|
+
styleEl.textContent = styleTag.value;
|
|
9211
|
+
}
|
|
9212
|
+
function removeStyleTag() {
|
|
9213
|
+
if (!partRef.value) return;
|
|
9214
|
+
const doc = partRef.value.ownerDocument;
|
|
9215
|
+
if (!doc) return;
|
|
9216
|
+
const styleEl = doc.head.querySelector(`style[data-part-style-id="${props.part.partId}"]`);
|
|
9217
|
+
if (styleEl) {
|
|
9218
|
+
doc.head.removeChild(styleEl);
|
|
9219
|
+
}
|
|
9220
|
+
}
|
|
9221
|
+
watch(styleTag, () => {
|
|
9222
|
+
ensureStyleTag();
|
|
9223
|
+
});
|
|
9224
|
+
onMounted(() => {
|
|
9225
|
+
if (partRef.value) {
|
|
9226
|
+
ensureStyleTag();
|
|
9227
|
+
}
|
|
9228
|
+
});
|
|
9229
|
+
onBeforeUnmount(() => {
|
|
9230
|
+
removeStyleTag();
|
|
9231
|
+
});
|
|
9085
9232
|
const properties = computed(() => ({
|
|
9086
9233
|
style: {
|
|
9087
9234
|
...props.part.getStyles(props.isMobilePage),
|
|
@@ -9242,30 +9389,26 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
9242
9389
|
};
|
|
9243
9390
|
return (_ctx, _cache) => {
|
|
9244
9391
|
var _a, _b;
|
|
9245
|
-
return openBlock(), createElementBlock(
|
|
9246
|
-
|
|
9392
|
+
return withDirectives((openBlock(), createElementBlock("div", mergeProps({
|
|
9393
|
+
ref_key: "partRef",
|
|
9394
|
+
ref: partRef,
|
|
9395
|
+
class: [classNames.value, "pb-block"],
|
|
9396
|
+
"data-part-id": _ctx.part.partId,
|
|
9397
|
+
style: (_a = _ctx.part.properties) == null ? void 0 : _a.css
|
|
9398
|
+
}, properties.value), [
|
|
9399
|
+
!_ctx.part.children || ((_b = _ctx.part.children) == null ? void 0 : _b.length) === 0 ? (openBlock(), createBlock$1(PbAddWidgetButton, {
|
|
9247
9400
|
key: 0,
|
|
9248
|
-
|
|
9249
|
-
}
|
|
9250
|
-
|
|
9251
|
-
|
|
9252
|
-
|
|
9253
|
-
|
|
9254
|
-
|
|
9255
|
-
|
|
9256
|
-
|
|
9257
|
-
|
|
9258
|
-
|
|
9259
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.part.children, (child) => {
|
|
9260
|
-
return openBlock(), createBlock$1(_sfc_main$o, {
|
|
9261
|
-
key: child.partId,
|
|
9262
|
-
part: child
|
|
9263
|
-
}, null, 8, ["part"]);
|
|
9264
|
-
}), 128))
|
|
9265
|
-
], 16, _hoisted_1$r)), [
|
|
9266
|
-
[unref(vPartHandler), { pageBuilder: unref(pageBuilder), part: _ctx.part, droppable: true, locatePositionMark, calculateDropIndex, acceptChildPart }]
|
|
9267
|
-
])
|
|
9268
|
-
], 64);
|
|
9401
|
+
onAddWidget: addWidget
|
|
9402
|
+
})) : createCommentVNode("", true),
|
|
9403
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.part.children, (child) => {
|
|
9404
|
+
return openBlock(), createBlock$1(_sfc_main$o, {
|
|
9405
|
+
key: child.partId,
|
|
9406
|
+
part: child
|
|
9407
|
+
}, null, 8, ["part"]);
|
|
9408
|
+
}), 128))
|
|
9409
|
+
], 16, _hoisted_1$r)), [
|
|
9410
|
+
[unref(vPartHandler), { pageBuilder: unref(pageBuilder), part: _ctx.part, droppable: true, locatePositionMark, calculateDropIndex, acceptChildPart }]
|
|
9411
|
+
]);
|
|
9269
9412
|
};
|
|
9270
9413
|
}
|
|
9271
9414
|
});
|
|
@@ -9310,6 +9453,40 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
9310
9453
|
];
|
|
9311
9454
|
});
|
|
9312
9455
|
const styleTag = computed(() => props.part.getStyleTag());
|
|
9456
|
+
const partRef = ref(null);
|
|
9457
|
+
function ensureStyleTag() {
|
|
9458
|
+
removeStyleTag();
|
|
9459
|
+
if (!partRef.value) return;
|
|
9460
|
+
const doc = partRef.value.ownerDocument;
|
|
9461
|
+
if (!doc || !styleTag.value) return;
|
|
9462
|
+
let styleEl = doc.head.querySelector(`style[data-part-style-id="${props.part.partId}"]`);
|
|
9463
|
+
if (!styleEl) {
|
|
9464
|
+
styleEl = document.createElement("style");
|
|
9465
|
+
styleEl.setAttribute("data-part-style-id", props.part.partId);
|
|
9466
|
+
doc.head.appendChild(styleEl);
|
|
9467
|
+
}
|
|
9468
|
+
styleEl.textContent = styleTag.value;
|
|
9469
|
+
}
|
|
9470
|
+
function removeStyleTag() {
|
|
9471
|
+
if (!partRef.value) return;
|
|
9472
|
+
const doc = partRef.value.ownerDocument;
|
|
9473
|
+
if (!doc) return;
|
|
9474
|
+
const styleEl = doc.head.querySelector(`style[data-part-style-id="${props.part.partId}"]`);
|
|
9475
|
+
if (styleEl) {
|
|
9476
|
+
doc.head.removeChild(styleEl);
|
|
9477
|
+
}
|
|
9478
|
+
}
|
|
9479
|
+
watch(styleTag, () => {
|
|
9480
|
+
ensureStyleTag();
|
|
9481
|
+
});
|
|
9482
|
+
onMounted(() => {
|
|
9483
|
+
if (partRef.value) {
|
|
9484
|
+
ensureStyleTag();
|
|
9485
|
+
}
|
|
9486
|
+
});
|
|
9487
|
+
onBeforeUnmount(() => {
|
|
9488
|
+
removeStyleTag();
|
|
9489
|
+
});
|
|
9313
9490
|
const properties = computed(() => ({
|
|
9314
9491
|
style: {
|
|
9315
9492
|
...props.part.getStyles(props.isMobilePage),
|
|
@@ -9391,37 +9568,33 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
9391
9568
|
};
|
|
9392
9569
|
return (_ctx, _cache) => {
|
|
9393
9570
|
var _a, _b, _c;
|
|
9394
|
-
return openBlock(), createElementBlock(
|
|
9395
|
-
|
|
9396
|
-
|
|
9397
|
-
|
|
9398
|
-
|
|
9399
|
-
|
|
9400
|
-
|
|
9401
|
-
|
|
9402
|
-
|
|
9403
|
-
|
|
9404
|
-
|
|
9405
|
-
|
|
9406
|
-
|
|
9407
|
-
|
|
9408
|
-
|
|
9409
|
-
|
|
9410
|
-
|
|
9411
|
-
|
|
9412
|
-
|
|
9413
|
-
|
|
9414
|
-
|
|
9415
|
-
|
|
9416
|
-
|
|
9417
|
-
|
|
9418
|
-
|
|
9419
|
-
|
|
9420
|
-
|
|
9421
|
-
], 16, _hoisted_1$p)), [
|
|
9422
|
-
[unref(vPartHandler), { pageBuilder: unref(pageBuilder), part: _ctx.part, droppable: true, locatePositionMark, calculateDropIndex, acceptChildPart }]
|
|
9423
|
-
])
|
|
9424
|
-
], 64);
|
|
9571
|
+
return withDirectives((openBlock(), createElementBlock("div", mergeProps({
|
|
9572
|
+
ref_key: "partRef",
|
|
9573
|
+
ref: partRef,
|
|
9574
|
+
class: [classNames.value, "pb-section"],
|
|
9575
|
+
"data-part-id": _ctx.part.partId,
|
|
9576
|
+
style: (_a = _ctx.part.properties) == null ? void 0 : _a.css
|
|
9577
|
+
}, properties.value), [
|
|
9578
|
+
((_b = _ctx.part.properties) == null ? void 0 : _b.sectionType) === "static" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
9579
|
+
((_c = _ctx.part.properties) == null ? void 0 : _c.name) === "Login Design Part" ? (openBlock(), createBlock$1(_sfc_main$m, {
|
|
9580
|
+
key: 0,
|
|
9581
|
+
part: _ctx.part
|
|
9582
|
+
}, null, 8, ["part"])) : createCommentVNode("", true)
|
|
9583
|
+
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
9584
|
+
_ctx.part.children && _ctx.part.children.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.part.children, (block) => {
|
|
9585
|
+
return openBlock(), createBlock$1(_sfc_main$n, {
|
|
9586
|
+
key: block.partId,
|
|
9587
|
+
"is-mobile-page": _ctx.isMobilePage,
|
|
9588
|
+
part: block
|
|
9589
|
+
}, null, 8, ["is-mobile-page", "part"]);
|
|
9590
|
+
}), 128)) : (openBlock(), createBlock$1(PbAddWidgetButton, {
|
|
9591
|
+
key: 1,
|
|
9592
|
+
onAddWidget: addWidget
|
|
9593
|
+
}))
|
|
9594
|
+
], 64))
|
|
9595
|
+
], 16, _hoisted_1$p)), [
|
|
9596
|
+
[unref(vPartHandler), { pageBuilder: unref(pageBuilder), part: _ctx.part, droppable: true, locatePositionMark, calculateDropIndex, acceptChildPart }]
|
|
9597
|
+
]);
|
|
9425
9598
|
};
|
|
9426
9599
|
}
|
|
9427
9600
|
});
|
|
@@ -12366,7 +12539,7 @@ const _hoisted_3$1 = {
|
|
|
12366
12539
|
key: 0,
|
|
12367
12540
|
class: "title mt-12"
|
|
12368
12541
|
};
|
|
12369
|
-
const _hoisted_4 = { class: "mt-8" };
|
|
12542
|
+
const _hoisted_4 = { class: "url mt-8" };
|
|
12370
12543
|
const _hoisted_5 = { class: "title mt-12" };
|
|
12371
12544
|
const _hoisted_6 = { class: "title mt-12" };
|
|
12372
12545
|
const _hoisted_7 = { class: "title mt-12" };
|
|
@@ -12386,13 +12559,16 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
12386
12559
|
if (imageProvider) {
|
|
12387
12560
|
imageProvider({ modal }, (media2) => {
|
|
12388
12561
|
if (media2.mediaType === "Image") {
|
|
12389
|
-
updateProperty({ media: media2,
|
|
12562
|
+
updateProperty({ media: media2, thumbnail: "" });
|
|
12390
12563
|
} else if (media2.mediaType === "Video") {
|
|
12391
|
-
updateProperty({ media: media2,
|
|
12564
|
+
updateProperty({ media: media2, link: "", linkTarget: "" });
|
|
12392
12565
|
}
|
|
12393
12566
|
});
|
|
12394
12567
|
}
|
|
12395
12568
|
};
|
|
12569
|
+
const updateAltText = (value) => {
|
|
12570
|
+
updateProperty({ media: { ...media.value, altText: value } });
|
|
12571
|
+
};
|
|
12396
12572
|
const updateProperty = (properties) => {
|
|
12397
12573
|
pageBuilder.commandRegistry.executeCommand(ChangePropertyCommand.COMMAND_ID, { properties, targetParts: part });
|
|
12398
12574
|
};
|
|
@@ -12402,8 +12578,8 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
12402
12578
|
return (_b = (_a = part == null ? void 0 : part[0]) == null ? void 0 : _a.properties) == null ? void 0 : _b.media;
|
|
12403
12579
|
});
|
|
12404
12580
|
const altText = computed(() => {
|
|
12405
|
-
var _a, _b;
|
|
12406
|
-
return (_b = (_a = part == null ? void 0 : part[0]) == null ? void 0 : _a.properties) == null ? void 0 : _b.altText;
|
|
12581
|
+
var _a, _b, _c;
|
|
12582
|
+
return (_c = (_b = (_a = part == null ? void 0 : part[0]) == null ? void 0 : _a.properties) == null ? void 0 : _b.media) == null ? void 0 : _c.altText;
|
|
12407
12583
|
});
|
|
12408
12584
|
const link = computed(() => {
|
|
12409
12585
|
var _a, _b;
|
|
@@ -12439,7 +12615,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
12439
12615
|
])
|
|
12440
12616
|
]),
|
|
12441
12617
|
((_a = media.value) == null ? void 0 : _a.fileUrl) ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
|
|
12442
|
-
_cache[
|
|
12618
|
+
_cache[3] || (_cache[3] = createElementVNode("label", null, "URL", -1)),
|
|
12443
12619
|
createElementVNode("div", _hoisted_4, [
|
|
12444
12620
|
createTextVNode(toDisplayString((_b = media.value) == null ? void 0 : _b.fileUrl) + " ", 1),
|
|
12445
12621
|
withDirectives(createVNode(unref(BSButton), {
|
|
@@ -12467,7 +12643,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
12467
12643
|
locales: locales.value,
|
|
12468
12644
|
"model-value": altText.value,
|
|
12469
12645
|
width: "100%",
|
|
12470
|
-
"onUpdate:modelValue":
|
|
12646
|
+
"onUpdate:modelValue": updateAltText
|
|
12471
12647
|
}, null, 8, ["locales", "model-value"])
|
|
12472
12648
|
]),
|
|
12473
12649
|
createElementVNode("div", _hoisted_6, [
|
|
@@ -12479,7 +12655,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
12479
12655
|
createVNode(unref(BSTextInput), {
|
|
12480
12656
|
"model-value": link.value,
|
|
12481
12657
|
width: "100%",
|
|
12482
|
-
"onUpdate:modelValue": _cache[
|
|
12658
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = (value) => updateProperty({ link: value }))
|
|
12483
12659
|
}, null, 8, ["model-value"])
|
|
12484
12660
|
]),
|
|
12485
12661
|
createElementVNode("div", _hoisted_7, [
|
|
@@ -12491,7 +12667,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
12491
12667
|
createVNode(unref(BSTextInput), {
|
|
12492
12668
|
"model-value": linkTarget.value,
|
|
12493
12669
|
width: "100%",
|
|
12494
|
-
"onUpdate:modelValue": _cache[
|
|
12670
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = (value) => updateProperty({ linkTarget: value }))
|
|
12495
12671
|
}, null, 8, ["model-value"])
|
|
12496
12672
|
])
|
|
12497
12673
|
], 64)) : createCommentVNode("", true),
|
|
@@ -12505,7 +12681,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
12505
12681
|
createVNode(unref(BSTextInput), {
|
|
12506
12682
|
"model-value": thumbnail.value,
|
|
12507
12683
|
width: "100%",
|
|
12508
|
-
"onUpdate:modelValue": _cache[
|
|
12684
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = (value) => updateProperty({ thumbnail: value }))
|
|
12509
12685
|
}, null, 8, ["model-value"])
|
|
12510
12686
|
])
|
|
12511
12687
|
], 64)) : createCommentVNode("", true)
|
|
@@ -12658,12 +12834,6 @@ const widgets = [
|
|
|
12658
12834
|
caption: "Media",
|
|
12659
12835
|
propertyType: "media"
|
|
12660
12836
|
},
|
|
12661
|
-
{
|
|
12662
|
-
propertyName: "altText",
|
|
12663
|
-
caption: "Alt Text",
|
|
12664
|
-
propertyType: "text",
|
|
12665
|
-
multiLang: true
|
|
12666
|
-
},
|
|
12667
12837
|
{
|
|
12668
12838
|
propertyName: "link",
|
|
12669
12839
|
caption: "Link",
|
|
@@ -12883,7 +13053,7 @@ __publicField(_OpenAddWidgetModalCommand, "COMMAND_ID", "OpenAddWidgetModal");
|
|
|
12883
13053
|
let OpenAddWidgetModalCommand = _OpenAddWidgetModalCommand;
|
|
12884
13054
|
const openWidgetAddModal = (modal, args, callback) => {
|
|
12885
13055
|
modal.openModal({
|
|
12886
|
-
component: defineAsyncComponent(() => import("./PbWidgetAddModal-
|
|
13056
|
+
component: defineAsyncComponent(() => import("./PbWidgetAddModal-B0EJiVqs.js")),
|
|
12887
13057
|
style: {
|
|
12888
13058
|
width: "80%",
|
|
12889
13059
|
height: "80%",
|
|
@@ -14946,7 +15116,6 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
14946
15116
|
props.part.getClassNames()
|
|
14947
15117
|
];
|
|
14948
15118
|
});
|
|
14949
|
-
const styleTag = computed(() => props.part.getStyleTag());
|
|
14950
15119
|
const style = computed(() => {
|
|
14951
15120
|
var _a, _b;
|
|
14952
15121
|
return {
|
|
@@ -14960,6 +15129,41 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
14960
15129
|
...(_b = props.part) == null ? void 0 : _b.getInlineStyles()
|
|
14961
15130
|
};
|
|
14962
15131
|
});
|
|
15132
|
+
const styleTag = computed(() => props.part.getStyleTag());
|
|
15133
|
+
const partRef = ref(null);
|
|
15134
|
+
function ensureStyleTag() {
|
|
15135
|
+
removeStyleTag();
|
|
15136
|
+
if (!partRef.value) return;
|
|
15137
|
+
const doc = partRef.value.ownerDocument;
|
|
15138
|
+
if (!doc || !styleTag.value) return;
|
|
15139
|
+
let styleEl = doc.head.querySelector(`style[data-part-style-id="${props.part.partId}"]`);
|
|
15140
|
+
if (!styleEl) {
|
|
15141
|
+
styleEl = document.createElement("style");
|
|
15142
|
+
styleEl.setAttribute("data-part-style-id", props.part.partId);
|
|
15143
|
+
doc.head.appendChild(styleEl);
|
|
15144
|
+
}
|
|
15145
|
+
styleEl.textContent = styleTag.value;
|
|
15146
|
+
}
|
|
15147
|
+
function removeStyleTag() {
|
|
15148
|
+
if (!partRef.value) return;
|
|
15149
|
+
const doc = partRef.value.ownerDocument;
|
|
15150
|
+
if (!doc) return;
|
|
15151
|
+
const styleEl = doc.head.querySelector(`style[data-part-style-id="${props.part.partId}"]`);
|
|
15152
|
+
if (styleEl) {
|
|
15153
|
+
doc.head.removeChild(styleEl);
|
|
15154
|
+
}
|
|
15155
|
+
}
|
|
15156
|
+
watch(styleTag, () => {
|
|
15157
|
+
ensureStyleTag();
|
|
15158
|
+
});
|
|
15159
|
+
onMounted(() => {
|
|
15160
|
+
if (partRef.value) {
|
|
15161
|
+
ensureStyleTag();
|
|
15162
|
+
}
|
|
15163
|
+
});
|
|
15164
|
+
onBeforeUnmount(() => {
|
|
15165
|
+
removeStyleTag();
|
|
15166
|
+
});
|
|
14963
15167
|
const selected = computed(() => !!props.part && editor.context.isSelected(props.part));
|
|
14964
15168
|
const addSection = () => {
|
|
14965
15169
|
editor.commandRegistry.executeCommand(AddSectionCommand.COMMAND_ID, { page: props.part });
|
|
@@ -14989,39 +15193,35 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
14989
15193
|
};
|
|
14990
15194
|
return (_ctx, _cache) => {
|
|
14991
15195
|
var _a, _b;
|
|
14992
|
-
return openBlock(), createElementBlock(
|
|
14993
|
-
|
|
14994
|
-
|
|
14995
|
-
|
|
14996
|
-
|
|
15196
|
+
return openBlock(), createElementBlock("div", {
|
|
15197
|
+
ref_key: "partRef",
|
|
15198
|
+
ref: partRef,
|
|
15199
|
+
class: normalizeClass([classNames.value, "pb-page"]),
|
|
15200
|
+
"data-part-id": (_a = _ctx.part) == null ? void 0 : _a.partId,
|
|
15201
|
+
style: normalizeStyle(style.value),
|
|
15202
|
+
onContextmenu: showContextMenu,
|
|
15203
|
+
onMousedown: withModifiers(handleClick, ["stop"])
|
|
15204
|
+
}, [
|
|
14997
15205
|
createElementVNode("div", {
|
|
14998
|
-
class: normalizeClass([
|
|
14999
|
-
|
|
15000
|
-
style: normalizeStyle(style.value),
|
|
15001
|
-
onContextmenu: showContextMenu,
|
|
15002
|
-
onMousedown: withModifiers(handleClick, ["stop"])
|
|
15206
|
+
class: normalizeClass([selected.value && "selected", _ctx.isMobilePage ? "mobile" : "pc", "pb-page-content"]),
|
|
15207
|
+
style: normalizeStyle(contentStyle.value)
|
|
15003
15208
|
}, [
|
|
15004
|
-
|
|
15005
|
-
|
|
15006
|
-
|
|
15007
|
-
|
|
15008
|
-
|
|
15009
|
-
|
|
15010
|
-
|
|
15011
|
-
|
|
15012
|
-
|
|
15013
|
-
|
|
15014
|
-
|
|
15015
|
-
|
|
15016
|
-
|
|
15017
|
-
|
|
15018
|
-
|
|
15019
|
-
|
|
15020
|
-
}, _cache[0] || (_cache[0] = [
|
|
15021
|
-
createElementVNode("i", { class: "material-icons-outlined" }, "add_circle_outline", -1)
|
|
15022
|
-
]))
|
|
15023
|
-
], 46, _hoisted_1$3)
|
|
15024
|
-
], 64);
|
|
15209
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList((_b = _ctx.part) == null ? void 0 : _b.children, (section, index) => {
|
|
15210
|
+
return openBlock(), createBlock$1(_sfc_main$l, {
|
|
15211
|
+
key: section.partId,
|
|
15212
|
+
"is-mobile-page": _ctx.isMobilePage,
|
|
15213
|
+
part: section
|
|
15214
|
+
}, null, 8, ["is-mobile-page", "part"]);
|
|
15215
|
+
}), 128))
|
|
15216
|
+
], 6),
|
|
15217
|
+
createElementVNode("div", {
|
|
15218
|
+
title: "Add Section",
|
|
15219
|
+
class: "pb-add-section-handle bottom",
|
|
15220
|
+
onClick: addSection
|
|
15221
|
+
}, _cache[0] || (_cache[0] = [
|
|
15222
|
+
createElementVNode("i", { class: "material-icons-outlined" }, "add_circle_outline", -1)
|
|
15223
|
+
]))
|
|
15224
|
+
], 46, _hoisted_1$3);
|
|
15025
15225
|
};
|
|
15026
15226
|
}
|
|
15027
15227
|
});
|