@g1cloud/page-builder-editor 1.0.0-alpha.52 → 1.0.0-alpha.54
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/property-editor-image.scss +1 -1
- package/css/property-group-editor-media.scss +1 -1
- package/dist/{PbPropertyEditorColor-Db3UUuLc.js → PbPropertyEditorColor-kyvEt6xI.js} +1 -1
- package/dist/{PbPropertyEditorHtml-CoxUtACW.js → PbPropertyEditorHtml-BuKh8j3Z.js} +1 -1
- package/dist/PbPropertyEditorImage-CMomDUUw.js +106 -0
- package/dist/{PbPropertyEditorMultilineText-C43eDCgk.js → PbPropertyEditorMultilineText-Cpz6njhD.js} +1 -1
- package/dist/{PbPropertyEditorText-DmTjpx6J.js → PbPropertyEditorText-BPFRUHyB.js} +1 -1
- package/dist/{PbPropertyEditorYoutube-DPX-k3c5.js → PbPropertyEditorYoutube-D88m-cfy.js} +1 -1
- package/dist/{PbWidgetAddModal-CoT-pyXr.js → PbWidgetAddModal-3npSogG0.js} +1 -1
- package/dist/components/sidebar/property/PbPropertyEditorImage.vue.d.ts +4 -8
- package/dist/{index-DkU6TZPE.js → index-BrJ6BLmW.js} +124 -189
- package/dist/model/part-property.d.ts +1 -0
- package/dist/page-builder-editor.js +14 -15
- package/dist/page-builder-editor.umd.cjs +244 -247
- package/package.json +2 -2
- package/dist/PbPropertyEditorImage-B73oOweb.js +0 -43
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createElementBlock, createElementVNode, withDirectives, unref, createVNode } from "vue";
|
|
2
2
|
import { vT, BSTextInput } from "@g1cloud/bluesea";
|
|
3
|
-
import { P as PbColorPicker } from "./index-
|
|
3
|
+
import { P as PbColorPicker } from "./index-BrJ6BLmW.js";
|
|
4
4
|
const _hoisted_1 = { class: "property-editor property-editor-color" };
|
|
5
5
|
const _hoisted_2 = { class: "title" };
|
|
6
6
|
const _hoisted_3 = { class: "bs-layout-horizontal flex-align-center color" };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createElementBlock, createElementVNode, withDirectives, unref, createTextVNode, defineAsyncComponent } from "vue";
|
|
2
2
|
import { useModal, vT } from "@g1cloud/bluesea";
|
|
3
|
-
import { u as usePageBuilderEditor } from "./index-
|
|
3
|
+
import { u as usePageBuilderEditor } from "./index-BrJ6BLmW.js";
|
|
4
4
|
const _hoisted_1 = { class: "property-editor property-editor-image flex-align-center" };
|
|
5
5
|
const _hoisted_2 = { class: "title" };
|
|
6
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, withDirectives, unref, createTextVNode, toDisplayString, createVNode, createCommentVNode, Fragment } from "vue";
|
|
2
|
+
import { u as usePageBuilderEditor, C as ChangePropertyCommand } from "./index-BrJ6BLmW.js";
|
|
3
|
+
import { useModal, vT, BSButton, BSMultiLangTextInput, showNotification } from "@g1cloud/bluesea";
|
|
4
|
+
const _hoisted_1 = { class: "property-editor property-editor-image" };
|
|
5
|
+
const _hoisted_2 = { class: "title" };
|
|
6
|
+
const _hoisted_3 = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "title mt-12"
|
|
9
|
+
};
|
|
10
|
+
const _hoisted_4 = { class: "mt-8" };
|
|
11
|
+
const _hoisted_5 = { class: "title mt-12" };
|
|
12
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
13
|
+
__name: "PbPropertyEditorImage",
|
|
14
|
+
props: {
|
|
15
|
+
property: {},
|
|
16
|
+
value: {}
|
|
17
|
+
},
|
|
18
|
+
setup(__props) {
|
|
19
|
+
const props = __props;
|
|
20
|
+
const pageBuilder = usePageBuilderEditor();
|
|
21
|
+
const part = pageBuilder.context.getSelectedParts();
|
|
22
|
+
const modal = useModal();
|
|
23
|
+
const selectMedia = () => {
|
|
24
|
+
const imageProvider = pageBuilder.getProvider("imageProvider");
|
|
25
|
+
if (imageProvider) {
|
|
26
|
+
imageProvider({ modal, mediaTypes: ["Image"] }, (media2) => {
|
|
27
|
+
updateProperty({ [props.property.propertyName]: media2 });
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const updateProperty = (properties) => {
|
|
32
|
+
pageBuilder.commandRegistry.executeCommand(ChangePropertyCommand.COMMAND_ID, { properties, targetParts: part });
|
|
33
|
+
};
|
|
34
|
+
const updateAltText = (value) => {
|
|
35
|
+
updateProperty({ [props.property.propertyName]: { ...media.value, altText: value } });
|
|
36
|
+
};
|
|
37
|
+
const locales = computed(() => pageBuilder.getLocales());
|
|
38
|
+
const media = computed(() => {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
return (_b = (_a = part == null ? void 0 : part[0]) == null ? void 0 : _a.properties) == null ? void 0 : _b[props.property.propertyName];
|
|
41
|
+
});
|
|
42
|
+
const altText = computed(() => {
|
|
43
|
+
var _a;
|
|
44
|
+
return (_a = media.value) == null ? void 0 : _a.altText;
|
|
45
|
+
});
|
|
46
|
+
const copyUrl = () => {
|
|
47
|
+
if (!media.value || !media.value.url) return;
|
|
48
|
+
navigator.clipboard.writeText(media.value.url);
|
|
49
|
+
showNotification({ key: "pb.prop.copied" });
|
|
50
|
+
};
|
|
51
|
+
return (_ctx, _cache) => {
|
|
52
|
+
var _a, _b, _c;
|
|
53
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
54
|
+
createElementVNode("div", _hoisted_2, [
|
|
55
|
+
withDirectives(createElementVNode("label", null, null, 512), [
|
|
56
|
+
[unref(vT), { key: _ctx.property.caption || "pb.prop.image" }]
|
|
57
|
+
])
|
|
58
|
+
]),
|
|
59
|
+
createElementVNode("div", null, [
|
|
60
|
+
withDirectives(createElementVNode("button", {
|
|
61
|
+
class: "select-button",
|
|
62
|
+
onClick: selectMedia
|
|
63
|
+
}, null, 512), [
|
|
64
|
+
[unref(vT), { key: "pb.prop.selectMedia" }]
|
|
65
|
+
])
|
|
66
|
+
]),
|
|
67
|
+
((_a = media.value) == null ? void 0 : _a.url) ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
68
|
+
_cache[0] || (_cache[0] = createElementVNode("label", null, "URL", -1)),
|
|
69
|
+
createElementVNode("div", _hoisted_4, [
|
|
70
|
+
createTextVNode(toDisplayString((_b = media.value) == null ? void 0 : _b.url) + " ", 1),
|
|
71
|
+
withDirectives(createVNode(unref(BSButton), {
|
|
72
|
+
class: "border-0 mb-2 pl-0",
|
|
73
|
+
"left-icon": "content_copy",
|
|
74
|
+
onClick: copyUrl
|
|
75
|
+
}, null, 512), [
|
|
76
|
+
[
|
|
77
|
+
unref(vT),
|
|
78
|
+
{ key: "pb.menu.copy" },
|
|
79
|
+
void 0,
|
|
80
|
+
{ title: true }
|
|
81
|
+
]
|
|
82
|
+
])
|
|
83
|
+
])
|
|
84
|
+
])) : createCommentVNode("", true),
|
|
85
|
+
((_c = media.value) == null ? void 0 : _c.mediaType) === "Image" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
86
|
+
createElementVNode("div", _hoisted_5, [
|
|
87
|
+
withDirectives(createElementVNode("label", null, null, 512), [
|
|
88
|
+
[unref(vT), { key: "pb.prop.altText" }]
|
|
89
|
+
])
|
|
90
|
+
]),
|
|
91
|
+
createElementVNode("div", null, [
|
|
92
|
+
createVNode(unref(BSMultiLangTextInput), {
|
|
93
|
+
locales: locales.value,
|
|
94
|
+
"model-value": altText.value,
|
|
95
|
+
width: "100%",
|
|
96
|
+
"onUpdate:modelValue": updateAltText
|
|
97
|
+
}, null, 8, ["locales", "model-value"])
|
|
98
|
+
])
|
|
99
|
+
], 64)) : createCommentVNode("", true)
|
|
100
|
+
]);
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
export {
|
|
105
|
+
_sfc_main as default
|
|
106
|
+
};
|
package/dist/{PbPropertyEditorMultilineText-C43eDCgk.js → PbPropertyEditorMultilineText-Cpz6njhD.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, withDirectives, unref, createBlock } from "vue";
|
|
2
2
|
import { vT, BSMultiLangTextArea, BSTextArea } from "@g1cloud/bluesea";
|
|
3
|
-
import { u as usePageBuilderEditor } from "./index-
|
|
3
|
+
import { u as usePageBuilderEditor } from "./index-BrJ6BLmW.js";
|
|
4
4
|
const _hoisted_1 = { class: "property-editor property-editor-multiline-text" };
|
|
5
5
|
const _hoisted_2 = { class: "title" };
|
|
6
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, withDirectives, unref, createBlock } from "vue";
|
|
2
2
|
import { vT, BSMultiLangTextInput, BSTextInput } from "@g1cloud/bluesea";
|
|
3
|
-
import { u as usePageBuilderEditor } from "./index-
|
|
3
|
+
import { u as usePageBuilderEditor } from "./index-BrJ6BLmW.js";
|
|
4
4
|
const _hoisted_1 = { class: "property-editor property-editor-text flex-align-center" };
|
|
5
5
|
const _hoisted_2 = { class: "title" };
|
|
6
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createElementBlock, createElementVNode, withDirectives, unref } from "vue";
|
|
2
2
|
import { useModal, vT } from "@g1cloud/bluesea";
|
|
3
|
-
import { s as selectYoutubeVideo } from "./index-
|
|
3
|
+
import { s as selectYoutubeVideo } from "./index-BrJ6BLmW.js";
|
|
4
4
|
const _hoisted_1 = { class: "property-editor property-editor-image flex-align-center" };
|
|
5
5
|
const _hoisted_2 = { class: "title" };
|
|
6
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createBlock, unref, withCtx, createElementVNode, createElementBlock, Fragment, renderList, toDisplayString } from "vue";
|
|
2
2
|
import { useModalHandle, BSModalFrame } from "@g1cloud/bluesea";
|
|
3
|
-
import { w as widgetPartDefinitions } from "./index-
|
|
3
|
+
import { w as widgetPartDefinitions } from "./index-BrJ6BLmW.js";
|
|
4
4
|
const _hoisted_1 = { class: "bs-layout-vertical pb-part-add-modal" };
|
|
5
5
|
const _hoisted_2 = { class: "bs-layout-horizontal-wrap ml-16 mb-8 gap-8" };
|
|
6
6
|
const _hoisted_3 = ["onClick", "textContent"];
|
|
@@ -2,15 +2,11 @@ import { PartProperty } from '../../../model/part-property.ts';
|
|
|
2
2
|
|
|
3
3
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
4
4
|
property: PartProperty;
|
|
5
|
-
value?:
|
|
6
|
-
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
-
"update-property-value": (properties: Record<string, unknown>) => void;
|
|
8
|
-
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
5
|
+
value?: unknown;
|
|
6
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
9
7
|
property: PartProperty;
|
|
10
|
-
value?:
|
|
11
|
-
}>>> & Readonly<{
|
|
12
|
-
"onUpdate-property-value"?: ((properties: Record<string, unknown>) => any) | undefined;
|
|
13
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
8
|
+
value?: unknown;
|
|
9
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
14
10
|
export default _default;
|
|
15
11
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
16
12
|
type __VLS_TypePropsToRuntimeProps<T> = {
|