@g1cloud/page-builder-editor 1.0.0-alpha.101 → 1.0.0-alpha.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{PbPropertyEditorColor-BsPFj_3N.js → PbPropertyEditorColor-0zFwhnJp.js} +1 -1
- package/dist/{PbPropertyEditorCssLength-s--C0dHZ.js → PbPropertyEditorCssLength-7sBhgyiM.js} +1 -1
- package/dist/{PbPropertyEditorHtml-WoyBfORQ.js → PbPropertyEditorHtml-Cz33ZrZp.js} +1 -1
- package/dist/{PbPropertyEditorImage-DbbK_0WV.js → PbPropertyEditorImage-DCOGVu0_.js} +1 -1
- package/dist/{PbPropertyEditorMultilineText-Bp2vUVha.js → PbPropertyEditorMultilineText-705l-6cb.js} +1 -1
- package/dist/{PbPropertyEditorSelect-B5sfulvx.js → PbPropertyEditorSelect-DkXgwpK8.js} +2 -1
- package/dist/{PbPropertyEditorText-mWOJ1KrX.js → PbPropertyEditorText-C1ktcMVa.js} +1 -1
- package/dist/{PbPropertyEditorYoutube-BCiZmiWV.js → PbPropertyEditorYoutube-R2dUexOc.js} +1 -1
- package/dist/{PbWidgetAddModal-0p7a4pVO.js → PbWidgetAddModal-CNblLmnp.js} +1 -1
- package/dist/PbYoutubeModal-BJuyyip-.js +148 -0
- package/dist/{index-SyHEuk0H.js → index-BsMUbVZy.js} +125 -145
- package/dist/model/part-property.d.ts +1 -0
- package/dist/page-builder-editor.js +1 -1
- package/dist/page-builder-editor.umd.cjs +232 -218
- package/dist/style.css +4 -3
- package/package.json +2 -2
- package/dist/PbYoutubeModal-BaL5gsKK.js +0 -117
|
@@ -3,7 +3,6 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
|
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import { ref, defineComponent, computed, openBlock, createElementBlock, Fragment, createBlock as createBlock$1, resolveDynamicComponent, withCtx, createElementVNode, normalizeStyle, createCommentVNode, toDisplayString, watch, onMounted, onBeforeUnmount, provide, inject, unref, renderList, normalizeProps, mergeProps, normalizeClass, withDirectives, vShow, reactive, defineAsyncComponent, createVNode, resolveComponent, vModelText, resolveDirective, withModifiers, renderSlot, guardReactiveProps, createTextVNode, markRaw, toHandlers, Teleport } from "vue";
|
|
5
5
|
import { notNull, vT, BSTextInput, vClickOutside, useModal, BSButton, BSMultiLangTextInput, BSSelect, showNotification, BSTree, useContextMenu, i18n, BSHorizontalLayoutResizer } from "@g1cloud/bluesea";
|
|
6
|
-
import YouTube from "vue3-youtube";
|
|
7
6
|
const create$5 = () => /* @__PURE__ */ new Map();
|
|
8
7
|
const copy = (m) => {
|
|
9
8
|
const r = create$5();
|
|
@@ -7132,8 +7131,8 @@ const _sfc_main$9$1 = /* @__PURE__ */ defineComponent({
|
|
|
7132
7131
|
}
|
|
7133
7132
|
});
|
|
7134
7133
|
const _hoisted_1$7$1 = ["href", "target"];
|
|
7135
|
-
const _hoisted_2$
|
|
7136
|
-
const _hoisted_3$
|
|
7134
|
+
const _hoisted_2$4$1 = ["alt", "src"];
|
|
7135
|
+
const _hoisted_3$1$1 = ["alt", "src"];
|
|
7137
7136
|
const _hoisted_4$b = ["alt", "src"];
|
|
7138
7137
|
const _hoisted_5$8 = ["alt", "src"];
|
|
7139
7138
|
const _hoisted_6$8 = ["poster"];
|
|
@@ -7206,7 +7205,7 @@ const _sfc_main$8$1 = /* @__PURE__ */ defineComponent({
|
|
|
7206
7205
|
src: ((_a2 = _ctx.part.properties) == null ? void 0 : _a2.media).fileUrl,
|
|
7207
7206
|
style: normalizeStyle(style.value),
|
|
7208
7207
|
class: "image"
|
|
7209
|
-
}, null, 12, _hoisted_2$
|
|
7208
|
+
}, null, 12, _hoisted_2$4$1)
|
|
7210
7209
|
];
|
|
7211
7210
|
}),
|
|
7212
7211
|
_: 1
|
|
@@ -7216,7 +7215,7 @@ const _sfc_main$8$1 = /* @__PURE__ */ defineComponent({
|
|
|
7216
7215
|
src: ((_d = _ctx.part.properties) == null ? void 0 : _d.media).fileUrl,
|
|
7217
7216
|
style: normalizeStyle(style.value),
|
|
7218
7217
|
class: "image"
|
|
7219
|
-
}, null, 12, _hoisted_3$
|
|
7218
|
+
}, null, 12, _hoisted_3$1$1))
|
|
7220
7219
|
], 8, _hoisted_1$7$1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
7221
7220
|
tag.value ? (openBlock(), createBlock$1(resolveDynamicComponent(tag.value), {
|
|
7222
7221
|
key: 0,
|
|
@@ -7310,7 +7309,7 @@ const _sfc_main$7$1 = /* @__PURE__ */ defineComponent({
|
|
|
7310
7309
|
}
|
|
7311
7310
|
});
|
|
7312
7311
|
const _hoisted_1$5$1 = ["innerHTML"];
|
|
7313
|
-
const _hoisted_2$
|
|
7312
|
+
const _hoisted_2$3$1 = {
|
|
7314
7313
|
key: 1,
|
|
7315
7314
|
class: "placeholder",
|
|
7316
7315
|
textContent: "Empty HTML"
|
|
@@ -7399,12 +7398,12 @@ const _sfc_main$6$1 = /* @__PURE__ */ defineComponent({
|
|
|
7399
7398
|
ref: partRef,
|
|
7400
7399
|
class: "html",
|
|
7401
7400
|
innerHTML: (_b = html.value) == null ? void 0 : _b.tags
|
|
7402
|
-
}, null, 8, _hoisted_1$5$1)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
7401
|
+
}, null, 8, _hoisted_1$5$1)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_2$3$1)) : createCommentVNode("", true);
|
|
7403
7402
|
};
|
|
7404
7403
|
}
|
|
7405
7404
|
});
|
|
7406
7405
|
const _hoisted_1$4$1 = ["src"];
|
|
7407
|
-
const _hoisted_2$
|
|
7406
|
+
const _hoisted_2$2$1 = {
|
|
7408
7407
|
key: 1,
|
|
7409
7408
|
class: "placeholder",
|
|
7410
7409
|
textContent: "Empty URL"
|
|
@@ -7552,11 +7551,17 @@ const _sfc_main$5$1 = /* @__PURE__ */ defineComponent({
|
|
|
7552
7551
|
ref: iframeRef,
|
|
7553
7552
|
src: url.value,
|
|
7554
7553
|
style: normalizeStyle(style.value)
|
|
7555
|
-
}, null, 12, _hoisted_1$4$1)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
7554
|
+
}, null, 12, _hoisted_1$4$1)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_2$2$1)) : createCommentVNode("", true);
|
|
7556
7555
|
};
|
|
7557
7556
|
}
|
|
7558
7557
|
});
|
|
7559
7558
|
const _hoisted_1$3$1 = {
|
|
7559
|
+
key: 0,
|
|
7560
|
+
class: "youtube-container",
|
|
7561
|
+
style: { width: "100%" }
|
|
7562
|
+
};
|
|
7563
|
+
const _hoisted_2$1$1 = ["src"];
|
|
7564
|
+
const _hoisted_3$d = {
|
|
7560
7565
|
key: 1,
|
|
7561
7566
|
class: "placeholder"
|
|
7562
7567
|
};
|
|
@@ -7568,87 +7573,72 @@ const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
|
|
|
7568
7573
|
},
|
|
7569
7574
|
setup(__props) {
|
|
7570
7575
|
const props = __props;
|
|
7571
|
-
const
|
|
7572
|
-
|
|
7573
|
-
|
|
7574
|
-
|
|
7575
|
-
|
|
7576
|
-
|
|
7577
|
-
|
|
7578
|
-
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
|
|
7582
|
-
|
|
7583
|
-
|
|
7584
|
-
|
|
7585
|
-
|
|
7586
|
-
|
|
7587
|
-
|
|
7588
|
-
|
|
7576
|
+
const extractVideoId = (raw) => {
|
|
7577
|
+
const value = raw.trim();
|
|
7578
|
+
if (!value) return void 0;
|
|
7579
|
+
if (/^[\w-]{11}$/.test(value)) return value;
|
|
7580
|
+
try {
|
|
7581
|
+
const u = new URL(value);
|
|
7582
|
+
const host = u.hostname.replace(/^www\./, "");
|
|
7583
|
+
if (host === "youtu.be") {
|
|
7584
|
+
const id = u.pathname.slice(1).split("/")[0];
|
|
7585
|
+
return id || void 0;
|
|
7586
|
+
}
|
|
7587
|
+
if (host === "youtube.com" || host === "youtube-nocookie.com" || host === "m.youtube.com") {
|
|
7588
|
+
const v = u.searchParams.get("v");
|
|
7589
|
+
if (v) return v;
|
|
7590
|
+
const segs = u.pathname.split("/").filter(Boolean);
|
|
7591
|
+
const idx = segs.findIndex((s) => s === "embed" || s === "shorts" || s === "live" || s === "v");
|
|
7592
|
+
if (idx >= 0 && segs[idx + 1]) return segs[idx + 1];
|
|
7593
|
+
}
|
|
7594
|
+
} catch {
|
|
7589
7595
|
}
|
|
7596
|
+
return void 0;
|
|
7590
7597
|
};
|
|
7591
|
-
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
|
|
7596
|
-
if (
|
|
7597
|
-
|
|
7598
|
-
resizeObserver = new ResizeObserver(updateWidth);
|
|
7599
|
-
resizeObserver.observe(container.value);
|
|
7600
|
-
}
|
|
7601
|
-
const interval = setInterval(() => {
|
|
7602
|
-
try {
|
|
7603
|
-
if (window && window.YT && window.YT.Player) {
|
|
7604
|
-
isYTReady.value = true;
|
|
7605
|
-
clearInterval(interval);
|
|
7606
|
-
}
|
|
7607
|
-
} catch (e) {
|
|
7608
|
-
}
|
|
7609
|
-
}, 500);
|
|
7598
|
+
const embedSrc = computed(() => {
|
|
7599
|
+
var _a;
|
|
7600
|
+
const raw = (_a = props.part.properties) == null ? void 0 : _a.url;
|
|
7601
|
+
if (!raw) return void 0;
|
|
7602
|
+
const id = extractVideoId(raw);
|
|
7603
|
+
if (!id) return void 0;
|
|
7604
|
+
return `https://www.youtube-nocookie.com/embed/${id}`;
|
|
7610
7605
|
});
|
|
7611
|
-
|
|
7612
|
-
|
|
7606
|
+
const aspectRatioCss = computed(() => {
|
|
7607
|
+
var _a;
|
|
7608
|
+
const raw = (_a = props.part.properties) == null ? void 0 : _a.aspectRatio;
|
|
7609
|
+
if (raw) {
|
|
7610
|
+
const parts = raw.split("/");
|
|
7611
|
+
if (parts.length === 2) {
|
|
7612
|
+
const w = Number(parts[0]);
|
|
7613
|
+
const h = Number(parts[1]);
|
|
7614
|
+
if (w > 0 && h > 0) return `${w} / ${h}`;
|
|
7615
|
+
}
|
|
7616
|
+
}
|
|
7617
|
+
return "16 / 9";
|
|
7613
7618
|
});
|
|
7619
|
+
const iframeStyle = computed(() => ({
|
|
7620
|
+
width: "100%",
|
|
7621
|
+
aspectRatio: aspectRatioCss.value,
|
|
7622
|
+
border: "0",
|
|
7623
|
+
display: "block"
|
|
7624
|
+
}));
|
|
7614
7625
|
return (_ctx, _cache) => {
|
|
7615
|
-
|
|
7616
|
-
|
|
7617
|
-
|
|
7618
|
-
|
|
7619
|
-
|
|
7620
|
-
|
|
7621
|
-
|
|
7622
|
-
|
|
7623
|
-
|
|
7624
|
-
|
|
7625
|
-
|
|
7626
|
-
|
|
7627
|
-
|
|
7628
|
-
isYTReady.value ? (openBlock(), createBlock$1(unref(YouTube), {
|
|
7629
|
-
key: 0,
|
|
7630
|
-
ref: "youtube",
|
|
7631
|
-
host: "https://www.youtube-nocookie.com",
|
|
7632
|
-
src: ((_b = _ctx.part.properties) == null ? void 0 : _b.url) || "",
|
|
7633
|
-
width: containerWidth.value,
|
|
7634
|
-
height: playerHeight.value,
|
|
7635
|
-
onReady
|
|
7636
|
-
}, null, 8, ["src", "width", "height"])) : createCommentVNode("", true)
|
|
7637
|
-
], 512)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_1$3$1, _cache[0] || (_cache[0] = [
|
|
7638
|
-
createElementVNode("span", { class: "font-icon" }, "live_tv", -1)
|
|
7639
|
-
]))) : createCommentVNode("", true)
|
|
7640
|
-
], 64);
|
|
7626
|
+
return embedSrc.value ? (openBlock(), createElementBlock("div", _hoisted_1$3$1, [
|
|
7627
|
+
createElementVNode("iframe", {
|
|
7628
|
+
src: embedSrc.value,
|
|
7629
|
+
style: normalizeStyle(iframeStyle.value),
|
|
7630
|
+
frameborder: "0",
|
|
7631
|
+
allow: "accelerometer; encrypted-media; gyroscope; picture-in-picture; web-share",
|
|
7632
|
+
allowfullscreen: "",
|
|
7633
|
+
loading: "lazy",
|
|
7634
|
+
title: "YouTube video"
|
|
7635
|
+
}, null, 12, _hoisted_2$1$1)
|
|
7636
|
+
])) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_3$d, _cache[0] || (_cache[0] = [
|
|
7637
|
+
createElementVNode("span", { class: "font-icon" }, "live_tv", -1)
|
|
7638
|
+
]))) : createCommentVNode("", true);
|
|
7641
7639
|
};
|
|
7642
7640
|
}
|
|
7643
7641
|
});
|
|
7644
|
-
const _export_sfc$1 = (sfc, props) => {
|
|
7645
|
-
const target = sfc.__vccOpts || sfc;
|
|
7646
|
-
for (const [key, val] of props) {
|
|
7647
|
-
target[key] = val;
|
|
7648
|
-
}
|
|
7649
|
-
return target;
|
|
7650
|
-
};
|
|
7651
|
-
const PbYoutubeWidget = /* @__PURE__ */ _export_sfc$1(_sfc_main$4$1, [["__scopeId", "data-v-675477df"]]);
|
|
7652
7642
|
const defaultPartDefinitions = {
|
|
7653
7643
|
"Section": {
|
|
7654
7644
|
partType: "Section",
|
|
@@ -7690,7 +7680,7 @@ const defaultPartDefinitions = {
|
|
|
7690
7680
|
partType: "Widget",
|
|
7691
7681
|
partName: "YoutubeWidget",
|
|
7692
7682
|
className: "pb-youtube-widget",
|
|
7693
|
-
creator: () =>
|
|
7683
|
+
creator: () => _sfc_main$4$1
|
|
7694
7684
|
}
|
|
7695
7685
|
/*
|
|
7696
7686
|
* BSP에서 사용안함
|
|
@@ -8628,16 +8618,16 @@ class PartManager {
|
|
|
8628
8618
|
const defaultPartPropertyEditors = () => {
|
|
8629
8619
|
return {
|
|
8630
8620
|
"readonly-text": () => defineAsyncComponent(() => import("./PbPropertyEditorReadonlyText-BJ5qx69O.js")),
|
|
8631
|
-
"text": () => defineAsyncComponent(() => import("./PbPropertyEditorText-
|
|
8621
|
+
"text": () => defineAsyncComponent(() => import("./PbPropertyEditorText-C1ktcMVa.js")),
|
|
8632
8622
|
"number": () => defineAsyncComponent(() => import("./PbPropertyEditorNumber-B76ArSb5.js")),
|
|
8633
8623
|
"boolean": () => defineAsyncComponent(() => import("./PbPropertyEditorBoolean-c5CNiTpt.js")),
|
|
8634
|
-
"multiline-text": () => defineAsyncComponent(() => import("./PbPropertyEditorMultilineText-
|
|
8635
|
-
"select": () => defineAsyncComponent(() => import("./PbPropertyEditorSelect-
|
|
8636
|
-
"css-length": () => defineAsyncComponent(() => import("./PbPropertyEditorCssLength-
|
|
8637
|
-
"color": () => defineAsyncComponent(() => import("./PbPropertyEditorColor-
|
|
8638
|
-
"image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-
|
|
8639
|
-
"html": () => defineAsyncComponent(() => import("./PbPropertyEditorHtml-
|
|
8640
|
-
"youtube": () => defineAsyncComponent(() => import("./PbPropertyEditorYoutube-
|
|
8624
|
+
"multiline-text": () => defineAsyncComponent(() => import("./PbPropertyEditorMultilineText-705l-6cb.js")),
|
|
8625
|
+
"select": () => defineAsyncComponent(() => import("./PbPropertyEditorSelect-DkXgwpK8.js")),
|
|
8626
|
+
"css-length": () => defineAsyncComponent(() => import("./PbPropertyEditorCssLength-7sBhgyiM.js")),
|
|
8627
|
+
"color": () => defineAsyncComponent(() => import("./PbPropertyEditorColor-0zFwhnJp.js")),
|
|
8628
|
+
"image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-DCOGVu0_.js")),
|
|
8629
|
+
"html": () => defineAsyncComponent(() => import("./PbPropertyEditorHtml-Cz33ZrZp.js")),
|
|
8630
|
+
"youtube": () => defineAsyncComponent(() => import("./PbPropertyEditorYoutube-R2dUexOc.js"))
|
|
8641
8631
|
};
|
|
8642
8632
|
};
|
|
8643
8633
|
const getPropertyValueOfParts = (parts, propertyName) => {
|
|
@@ -8657,7 +8647,7 @@ const isCursorInElement = (event, element) => {
|
|
|
8657
8647
|
};
|
|
8658
8648
|
const selectYoutubeVideo = (modal, url, callback) => {
|
|
8659
8649
|
modal.openModal({
|
|
8660
|
-
component: defineAsyncComponent(() => import("./PbYoutubeModal-
|
|
8650
|
+
component: defineAsyncComponent(() => import("./PbYoutubeModal-BJuyyip-.js")),
|
|
8661
8651
|
style: {
|
|
8662
8652
|
minWidth: "500px",
|
|
8663
8653
|
minHeight: "400px"
|
|
@@ -13324,7 +13314,7 @@ const widgets = [
|
|
|
13324
13314
|
],
|
|
13325
13315
|
initialProperties: {},
|
|
13326
13316
|
allowsChild: () => false,
|
|
13327
|
-
creator: () =>
|
|
13317
|
+
creator: () => _sfc_main$4$1
|
|
13328
13318
|
}
|
|
13329
13319
|
/*
|
|
13330
13320
|
* BSP에서 사용안함
|
|
@@ -13435,7 +13425,7 @@ __publicField(_OpenAddWidgetModalCommand, "COMMAND_ID", "OpenAddWidgetModal");
|
|
|
13435
13425
|
let OpenAddWidgetModalCommand = _OpenAddWidgetModalCommand;
|
|
13436
13426
|
const openWidgetAddModal = (modal, args, callback) => {
|
|
13437
13427
|
modal.openModal({
|
|
13438
|
-
component: defineAsyncComponent(() => import("./PbWidgetAddModal-
|
|
13428
|
+
component: defineAsyncComponent(() => import("./PbWidgetAddModal-CNblLmnp.js")),
|
|
13439
13429
|
style: {
|
|
13440
13430
|
width: "80%",
|
|
13441
13431
|
height: "80%",
|
|
@@ -15609,6 +15599,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
15609
15599
|
});
|
|
15610
15600
|
const canvasStyle = '.pb-page {\n display: flex;\n flex-direction: column;\n width: 100%;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n overflow-x: hidden;\n}\n.pb-page .pb-section {\n display: flex;\n position: relative;\n width: 100%;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n}\n.pb-page .pb-section .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}\n.pb-page .pb-section .pb-block .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-page .pb-section .pb-block .pb-widget .children {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n.pb-page .pb-section .pb-block .pb-text-widget {\n width: 100%;\n height: fit-content;\n}\n.pb-page .pb-section .pb-block .pb-text-widget .text {\n display: block;\n color: #333;\n}\n.pb-page .pb-section .pb-block .pb-text-widget .placeholder {\n padding: 4px 0;\n font-size: 18px;\n text-align: center;\n color: #999;\n}\n.pb-page .pb-section .pb-block .pb-media-widget {\n width: 100%;\n}\n.pb-page .pb-section .pb-block .pb-media-widget .image-container {\n margin: 0;\n padding: 0;\n}\n.pb-page .pb-section .pb-block .pb-media-widget .image {\n width: 100%;\n}\n.pb-page .pb-section .pb-block .pb-media-widget .video {\n width: 100%;\n}\n.pb-page .pb-section .pb-block .pb-media-widget .placeholder {\n height: 100px;\n background-color: #eee;\n text-align: center;\n}\n.pb-page .pb-section .pb-block .pb-media-widget .placeholder span {\n font-size: 40px;\n color: #999;\n line-height: 100px;\n vertical-align: middle;\n}\n.pb-page .pb-section .pb-block .pb-html-widget {\n width: 100%;\n height: fit-content;\n}\n.pb-page .pb-section .pb-block .pb-html-widget .placeholder {\n padding: 4px 0;\n font-size: 18px;\n text-align: center;\n color: #999;\n}\n.pb-page .pb-section .pb-block .pb-iframe-widget {\n width: 100%;\n height: fit-content;\n}\n.pb-page .pb-section .pb-block .pb-iframe-widget .placeholder {\n padding: 4px 0;\n font-size: 18px;\n text-align: center;\n color: #999;\n}\n.pb-page .pb-section .pb-block .pb-youtube-widget {\n width: 100%;\n}\n.pb-page .pb-section .pb-block .pb-youtube-widget .youtube {\n width: 100%;\n height: 100%;\n}\n.pb-page .pb-section .pb-block .pb-youtube-widget .placeholder {\n height: 100px;\n background-color: #eee;\n text-align: center;\n}\n.pb-page .pb-section .pb-block .pb-youtube-widget .placeholder span {\n font-size: 40px;\n color: #999;\n line-height: 100px;\n vertical-align: middle;\n}\n.pb-page .pb-section .pb-block .pb-container-widget {\n width: 100%;\n}\n.pb-page .pb-section .pb-block .pb-container-widget .placeholder {\n height: 100px;\n background-color: #eee;\n text-align: center;\n}\n.pb-page .pb-section .pb-block .pb-container-widget .placeholder span {\n font-size: 40px;\n color: #999;\n line-height: 100px;\n vertical-align: middle;\n}\n.pb-page .pb-section .pb-block .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-page .pb-section .pb-block .pb-product-list-widget .product-wrapper {\n width: 25%;\n}\n.pb-page .pb-section .pb-block .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-page .pb-section .pb-block .pb-product-list-widget .product-wrapper img {\n width: 100%;\n}\n.pb-page .pb-section .pb-block .pb-product-list-widget .product-wrapper .name {\n margin-top: 8px;\n font-size: 14px;\n}\n.pb-page .pb-section .pb-block .pb-product-list-widget .product-wrapper .price {\n margin-top: 8px;\n font-size: 14px;\n font-weight: bold;\n}\n.pb-page .pb-section .pb-block .pb-product-list-widget .product-wrapper .empty {\n height: 200px;\n background-color: #eee;\n text-align: center;\n}\n.pb-page .pb-section .pb-block .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-page .pb-section .pb-block .pb-product-list-widget .product-wrapper {\n width: 50%;\n }\n}\n.pb-page .pb-section .pb-block .mobile .pb-product-list-widget .product-wrapper {\n width: 50%;\n}\n.pb-page .pb-section .pb-block .pb-login-widget {\n height: 200px;\n text-align: center;\n}\n.pb-page .pb-section .pb-block .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.pb-page * {\n box-sizing: border-box;\n}\n.pb-viewer {\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n overflow-y: auto;\n}\n.pb-page-wrapper {\n margin: 0 auto;\n padding: 0;\n}\n.pb-page {\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n padding-bottom: 100px;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n}\n.pb-page .pb-page-content {\n display: flex;\n flex-direction: column;\n width: 100%;\n background-color: #fff;\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.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 display: flex;\n position: relative;\n width: 100%;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n outline: 1px dashed #ccc;\n}\n.pb-section:empty {\n background-color: #fff;\n}\n.pb-section:hover:not(:has(.pb-block:hover)) {\n background-color: #f0f0f0;\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.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::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.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 pointer-events: auto !important;\n min-height: 50px;\n}\n.pb-widget * {\n pointer-events: none;\n}\n.pb-widget > .invalid-widget {\n display: flex;\n height: 50px;\n justify-content: center;\n align-items: center;\n width: 100%;\n font-size: 18px;\n text-align: center;\n color: #999;\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.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 pointer-events: auto !important;\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 pointer-events: auto !important;\n}\nbody {\n margin: 0;\n padding: 0;\n background-color: var(--color-canvas-frame-bg);\n overflow: hidden;\n}\n.font-icon, .material-icons-outlined {\n font-family: "Material Symbols Outlined", monospace;\n font-size: 1rem;\n max-width: 1em;\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 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 font-style: normal;\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}';
|
|
15611
15601
|
const _hoisted_1$2 = ["width"];
|
|
15602
|
+
const iframeSrcdoc = "<!doctype html><html><head></head><body></body></html>";
|
|
15612
15603
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
15613
15604
|
__name: "PbPageFrame",
|
|
15614
15605
|
props: {
|
|
@@ -15619,41 +15610,41 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
15619
15610
|
const props = __props;
|
|
15620
15611
|
const pageBuilderEditor = usePageBuilderEditor();
|
|
15621
15612
|
const iframeRef = ref();
|
|
15613
|
+
const ready = ref(false);
|
|
15622
15614
|
provideMouseTracker(iframeRef);
|
|
15623
|
-
const
|
|
15624
|
-
|
|
15625
|
-
|
|
15626
|
-
|
|
15627
|
-
|
|
15628
|
-
()
|
|
15629
|
-
|
|
15630
|
-
|
|
15631
|
-
|
|
15632
|
-
|
|
15633
|
-
|
|
15634
|
-
|
|
15635
|
-
|
|
15636
|
-
|
|
15637
|
-
|
|
15638
|
-
|
|
15639
|
-
|
|
15640
|
-
|
|
15641
|
-
|
|
15642
|
-
|
|
15643
|
-
|
|
15644
|
-
|
|
15645
|
-
|
|
15646
|
-
|
|
15647
|
-
|
|
15648
|
-
|
|
15649
|
-
|
|
15650
|
-
|
|
15651
|
-
|
|
15652
|
-
|
|
15653
|
-
|
|
15654
|
-
|
|
15655
|
-
|
|
15656
|
-
);
|
|
15615
|
+
const onIframeLoad = () => {
|
|
15616
|
+
var _a, _b;
|
|
15617
|
+
if (ready.value) return;
|
|
15618
|
+
const doc = (_b = (_a = iframeRef.value) == null ? void 0 : _a.contentWindow) == null ? void 0 : _b.document;
|
|
15619
|
+
if (!(doc == null ? void 0 : doc.head)) return;
|
|
15620
|
+
const externalCss = pageBuilderEditor.getExternalCss();
|
|
15621
|
+
doc.head.innerHTML = `
|
|
15622
|
+
<meta charset="UTF-8"/>
|
|
15623
|
+
<link
|
|
15624
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=block"
|
|
15625
|
+
rel="stylesheet"/>
|
|
15626
|
+
${externalCss}
|
|
15627
|
+
<style>${canvasStyle}</style>
|
|
15628
|
+
`;
|
|
15629
|
+
const script2 = doc.createElement("script");
|
|
15630
|
+
script2.innerHTML = `
|
|
15631
|
+
function forwardPostMessage(event) {
|
|
15632
|
+
if (event.data) {
|
|
15633
|
+
console.log(event)
|
|
15634
|
+
window.parent.postMessage(event.data, '*');
|
|
15635
|
+
}
|
|
15636
|
+
}
|
|
15637
|
+
window.addEventListener('message', forwardPostMessage);
|
|
15638
|
+
`;
|
|
15639
|
+
doc.head.appendChild(script2);
|
|
15640
|
+
pageBuilderEditor.keyHandlers.addDocumentKeyEventListener(doc.body);
|
|
15641
|
+
ready.value = true;
|
|
15642
|
+
resizeObserver = new ResizeObserver(updateIframeHeight);
|
|
15643
|
+
resizeObserver.observe(doc.body, {});
|
|
15644
|
+
mutationObserver = new MutationObserver(updateIframeHeight);
|
|
15645
|
+
mutationObserver.observe(doc.body, { childList: true, subtree: true });
|
|
15646
|
+
updateIframeHeight();
|
|
15647
|
+
};
|
|
15657
15648
|
const width = ref(props.width);
|
|
15658
15649
|
ref(200);
|
|
15659
15650
|
const isMobilePage = computed(() => width.value <= 768);
|
|
@@ -15678,15 +15669,6 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
15678
15669
|
}
|
|
15679
15670
|
});
|
|
15680
15671
|
};
|
|
15681
|
-
onMounted(() => {
|
|
15682
|
-
if (!iframeRef.value || !iframeRef.value.contentDocument) return;
|
|
15683
|
-
const iframeBody = iframeRef.value.contentDocument.body;
|
|
15684
|
-
resizeObserver = new ResizeObserver(updateIframeHeight);
|
|
15685
|
-
resizeObserver.observe(iframeBody, {});
|
|
15686
|
-
mutationObserver = new MutationObserver(updateIframeHeight);
|
|
15687
|
-
mutationObserver.observe(iframeBody, { childList: true, subtree: true });
|
|
15688
|
-
iframeRef.value.onload = updateIframeHeight;
|
|
15689
|
-
});
|
|
15690
15672
|
onBeforeUnmount(() => {
|
|
15691
15673
|
if (resizeObserver) {
|
|
15692
15674
|
resizeObserver.disconnect();
|
|
@@ -15715,11 +15697,13 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
15715
15697
|
createElementVNode("iframe", {
|
|
15716
15698
|
ref_key: "iframeRef",
|
|
15717
15699
|
ref: iframeRef,
|
|
15700
|
+
srcdoc: iframeSrcdoc,
|
|
15718
15701
|
style: normalizeStyle(style.value),
|
|
15719
15702
|
width: `${width.value}px`,
|
|
15720
|
-
class: "page-frame mt-12"
|
|
15721
|
-
|
|
15722
|
-
|
|
15703
|
+
class: "page-frame mt-12",
|
|
15704
|
+
onLoad: onIframeLoad
|
|
15705
|
+
}, null, 44, _hoisted_1$2),
|
|
15706
|
+
ready.value && ((_b = (_a = iframeRef.value) == null ? void 0 : _a.contentWindow) == null ? void 0 : _b.document.body) ? (openBlock(), createBlock$1(Teleport, {
|
|
15723
15707
|
key: 0,
|
|
15724
15708
|
to: (_d = (_c = iframeRef.value) == null ? void 0 : _c.contentWindow) == null ? void 0 : _d.document.body
|
|
15725
15709
|
}, [
|
|
@@ -17577,10 +17561,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
17577
17561
|
});
|
|
17578
17562
|
return (_ctx, _cache) => {
|
|
17579
17563
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
17580
|
-
(openBlock(), createBlock$1(resolveDynamicComponent("script"), {
|
|
17581
|
-
id: "youtube-iframe-js-api-script",
|
|
17582
|
-
src: "https://www.youtube.com/iframe_api"
|
|
17583
|
-
})),
|
|
17584
17564
|
createVNode(_sfc_main$9, { "toolbar-plugin": _ctx.toolbarPlugin }, null, 8, ["toolbar-plugin"]),
|
|
17585
17565
|
createElementVNode("div", _hoisted_2, [
|
|
17586
17566
|
createVNode(_sfc_main$8, { class: "w-240 min-w-120" }),
|
|
@@ -17620,7 +17600,7 @@ export {
|
|
|
17620
17600
|
_sfc_main$5$1 as l,
|
|
17621
17601
|
_sfc_main$8$1 as m,
|
|
17622
17602
|
_sfc_main$7$1 as n,
|
|
17623
|
-
|
|
17603
|
+
_sfc_main$4$1 as o,
|
|
17624
17604
|
RootPart as p,
|
|
17625
17605
|
Section as q,
|
|
17626
17606
|
Widget as r,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B, c, M, d, e, f, a, b, g, h, i, j, k, l, m, n, o, R, p, S, q, W, r, v, x, y, z, A, D, E, F } from "./index-
|
|
1
|
+
import { B, c, M, d, e, f, a, b, g, h, i, j, k, l, m, n, o, R, p, S, q, W, r, v, x, y, z, A, D, E, F } from "./index-BsMUbVZy.js";
|
|
2
2
|
export {
|
|
3
3
|
B as BLOCK_TYPE,
|
|
4
4
|
c as Block,
|