@g1cloud/page-builder-editor 1.0.0-alpha.6 → 1.0.0-alpha.60

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.
Files changed (99) hide show
  1. package/css/canvas.scss +16 -137
  2. package/css/{canvas-block.scss → page-block.scss} +15 -3
  3. package/css/page-builder-editor.scss +108 -22
  4. package/css/{canvas-page.scss → page-page.scss} +24 -16
  5. package/css/{canvas-section.scss → page-section.scss} +17 -3
  6. package/css/{canvas-widget.scss → page-widget.scss} +28 -3
  7. package/css/page.scss +74 -0
  8. package/css/property-editor-color.scss +5 -0
  9. package/css/property-editor-html.scss +16 -0
  10. package/css/property-editor-image.scss +2 -2
  11. package/css/property-editor-number.scss +10 -0
  12. package/css/property-editor-youtube.scss +16 -0
  13. package/css/property-group-editor-background.scss +1 -13
  14. package/css/property-group-editor-border.scss +6 -12
  15. package/css/property-group-editor-margin.scss +0 -11
  16. package/css/property-group-editor-media.scss +16 -0
  17. package/css/property-group-editor-padding.scss +0 -11
  18. package/css/property-group-editor-position.scss +0 -11
  19. package/css/property-group-editor-size.scss +0 -11
  20. package/css/property-localpart.scss +2 -2
  21. package/dist/PageBuilderEditor.vue.d.ts +22 -11
  22. package/dist/PbHtmlEditorModal-C0MLYY66.js +193 -0
  23. package/dist/PbPropertyEditorBoolean-c5CNiTpt.js +38 -0
  24. package/dist/PbPropertyEditorColor-ecbXEcYN.js +56 -0
  25. package/dist/PbPropertyEditorHtml-CN43bcbD.js +62 -0
  26. package/dist/PbPropertyEditorImage-BrP5jFP2.js +106 -0
  27. package/dist/{PbPropertyEditorMultilineText-BFzT7dlG.js → PbPropertyEditorMultilineText-B5-0rW_W.js} +29 -28
  28. package/dist/PbPropertyEditorNumber-B76ArSb5.js +47 -0
  29. package/dist/{PbPropertyEditorReadonlyText-Bk0WJxA0.js → PbPropertyEditorReadonlyText-BJ5qx69O.js} +7 -7
  30. package/dist/{PbPropertyEditorSelect-BJovN1su.js → PbPropertyEditorSelect-B5sfulvx.js} +6 -7
  31. package/dist/PbPropertyEditorText-B_ZEAlMz.js +50 -0
  32. package/dist/PbPropertyEditorYoutube-CYWYEZe0.js +40 -0
  33. package/dist/PbScreenSelectModal-57LXAzjs.js +69 -0
  34. package/dist/PbWidgetAddModal-CDxfMi_c.js +79 -0
  35. package/dist/PbYoutubeModal-CU8sClMD.js +73 -0
  36. package/dist/components/canvas/PbCanvas.vue.d.ts +1 -1
  37. package/dist/components/depart/PbLoginDepart.vue.d.ts +3 -3
  38. package/dist/components/menu/PbMenu.vue.d.ts +16 -1
  39. package/dist/components/menu/PbToolbar.vue.d.ts +16 -1
  40. package/dist/components/menu/PbToolbarButton.vue.d.ts +3 -3
  41. package/dist/components/menu/PbToolbarButtonGroup.vue.d.ts +3 -3
  42. package/dist/components/modal/PbHtmlEditorModal.vue.d.ts +28 -0
  43. package/dist/components/modal/PbPartAddModal.vue.d.ts +4 -4
  44. package/dist/components/modal/PbScreenSelectModal.vue.d.ts +6 -0
  45. package/dist/components/modal/PbWidgetAddModal.vue.d.ts +4 -4
  46. package/dist/components/modal/PbYoutubeModal.vue.d.ts +19 -0
  47. package/dist/components/navigator/PbNavigator.vue.d.ts +1 -1
  48. package/dist/components/part/PbAddWidgetButton.vue.d.ts +1 -1
  49. package/dist/components/part/PbBlock.vue.d.ts +7 -3
  50. package/dist/components/part/PbPage.vue.d.ts +5 -5
  51. package/dist/components/part/PbPageFrame.vue.d.ts +19 -0
  52. package/dist/components/part/PbSection.vue.d.ts +7 -3
  53. package/dist/components/part/PbWidget.vue.d.ts +5 -3
  54. package/dist/components/sidebar/PbSidebar.vue.d.ts +1 -1
  55. package/dist/components/sidebar/PbSidebarProperties.vue.d.ts +1 -1
  56. package/dist/components/sidebar/PbSidebarPropertyEditor.vue.d.ts +3 -3
  57. package/dist/components/sidebar/PbSidebarPropertyGroupEditor.vue.d.ts +3 -3
  58. package/dist/components/sidebar/property/{PbPropertyEditorProduct.vue.d.ts → PbPropertyEditorBoolean.vue.d.ts} +4 -4
  59. package/dist/components/sidebar/property/{PbPropertyLocalMarketingPart.vue.d.ts → PbPropertyEditorColor.vue.d.ts} +9 -9
  60. package/dist/components/sidebar/property/PbPropertyEditorHtml.vue.d.ts +23 -0
  61. package/dist/components/sidebar/property/PbPropertyEditorImage.vue.d.ts +5 -9
  62. package/dist/components/sidebar/property/PbPropertyEditorMultilineText.vue.d.ts +7 -6
  63. package/dist/components/sidebar/property/PbPropertyEditorNumber.vue.d.ts +23 -0
  64. package/dist/components/sidebar/property/PbPropertyEditorReadonlyText.vue.d.ts +3 -3
  65. package/dist/components/sidebar/property/PbPropertyEditorSelect.vue.d.ts +4 -4
  66. package/dist/components/sidebar/property/PbPropertyEditorText.vue.d.ts +9 -8
  67. package/dist/components/sidebar/property/PbPropertyEditorYoutube.vue.d.ts +23 -0
  68. package/dist/components/sidebar/property/PbPropertyGroupEditorBackground.vue.d.ts +3 -3
  69. package/dist/components/sidebar/property/PbPropertyGroupEditorBorder.vue.d.ts +3 -3
  70. package/dist/components/sidebar/property/PbPropertyGroupEditorMargin.vue.d.ts +3 -3
  71. package/dist/components/sidebar/property/PbPropertyGroupEditorMedia.vue.d.ts +20 -0
  72. package/dist/components/sidebar/property/PbPropertyGroupEditorPadding.vue.d.ts +3 -3
  73. package/dist/components/sidebar/property/PbPropertyGroupEditorPosition.vue.d.ts +3 -3
  74. package/dist/components/sidebar/property/PbPropertyGroupEditorSize.vue.d.ts +3 -3
  75. package/dist/components/ui/PbColorPicker.vue.d.ts +17 -8
  76. package/dist/directives/vPartHandler.d.ts +1 -0
  77. package/dist/{index-DQLcq5fP.js → index-CSLr4i8b.js} +4542 -2157
  78. package/dist/index.d.ts +6 -0
  79. package/dist/model/command.d.ts +47 -34
  80. package/dist/model/context.d.ts +22 -22
  81. package/dist/model/default-part-property-group.d.ts +4 -0
  82. package/dist/model/event.d.ts +0 -56
  83. package/dist/model/model.d.ts +9 -5
  84. package/dist/model/page-builder-editor.d.ts +39 -10
  85. package/dist/model/page-builder-util.d.ts +2 -0
  86. package/dist/model/part-definintion.d.ts +3 -2
  87. package/dist/model/part-manager.d.ts +2 -1
  88. package/dist/model/part-property.d.ts +4 -3
  89. package/dist/model/plugin.d.ts +23 -0
  90. package/dist/page-builder-editor.js +25 -21
  91. package/dist/page-builder-editor.umd.cjs +5299 -2355
  92. package/dist/text/text.d.ts +1 -0
  93. package/package.json +9 -6
  94. package/dist/PbPartAddModal-DuLpnV4E.js +0 -50
  95. package/dist/PbPropertyEditorImage-D85hteOg.js +0 -42
  96. package/dist/PbPropertyEditorProduct-CUSpnV8o.js +0 -49
  97. package/dist/PbPropertyEditorText-DNdXl-Tr.js +0 -41
  98. package/dist/PbWidgetAddModal-CQvFYzfU.js +0 -55
  99. package/dist/components/canvas/PbCanvasFrame.vue.d.ts +0 -2
@@ -1,9 +1,8 @@
1
- import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, toDisplayString, createVNode, unref } from "vue";
2
- import { BSTextArea } from "@g1cloud/bluesea";
3
- import { u as usePageBuilderEditor } from "./index-DQLcq5fP.js";
1
+ import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, withDirectives, unref, createBlock } from "vue";
2
+ import { vT, BSMultiLangTextArea, BSTextArea } from "@g1cloud/bluesea";
3
+ import { u as usePageBuilderEditor } from "./index-CSLr4i8b.js";
4
4
  const _hoisted_1 = { class: "property-editor property-editor-multiline-text" };
5
- const _hoisted_2 = { class: "label" };
6
- const _hoisted_3 = ["textContent"];
5
+ const _hoisted_2 = { class: "title" };
7
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
8
7
  __name: "PbPropertyEditorMultilineText",
9
8
  props: {
@@ -14,47 +13,49 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
14
13
  setup(__props, { emit: __emit }) {
15
14
  const props = __props;
16
15
  const emit = __emit;
17
- const emitUpdatePropertyValue = (value) => {
18
- const properties = {};
19
- if (props.value && typeof props.value === "object") {
20
- properties[props.property.propertyName] = {
21
- ...props.value,
22
- [language.value]: value
23
- };
24
- } else {
25
- properties[props.property.propertyName] = {
26
- [language.value]: value
27
- };
28
- }
29
- emit("update-property-value", properties);
30
- };
31
16
  const pageBuilder = usePageBuilderEditor();
32
- const language = computed(() => pageBuilder.language.value);
17
+ const locales = computed(() => pageBuilder.getLocales());
33
18
  const text = computed({
34
19
  get() {
35
- return props.value && typeof props.value === "object" ? props.value[language.value] : "";
20
+ return props.value;
36
21
  },
37
- set() {
22
+ // @ts-ignore
23
+ set(value) {
38
24
  }
39
25
  });
26
+ const emitUpdatePropertyValue = (value) => {
27
+ const properties = {};
28
+ properties[props.property.propertyName] = value;
29
+ emit("update-property-value", properties);
30
+ };
40
31
  return (_ctx, _cache) => {
41
32
  return openBlock(), createElementBlock("div", _hoisted_1, [
42
33
  createElementVNode("div", _hoisted_2, [
43
- createElementVNode("label", {
44
- textContent: toDisplayString(_ctx.property.caption)
45
- }, null, 8, _hoisted_3)
34
+ withDirectives(createElementVNode("label", null, null, 512), [
35
+ [unref(vT), { key: _ctx.property.caption }]
36
+ ])
46
37
  ]),
47
38
  createElementVNode("div", null, [
48
- createVNode(unref(BSTextArea), {
39
+ _ctx.property.multiLang ? (openBlock(), createBlock(unref(BSMultiLangTextArea), {
40
+ key: 0,
49
41
  modelValue: text.value,
50
42
  "onUpdate:modelValue": [
51
43
  _cache[0] || (_cache[0] = ($event) => text.value = $event),
52
44
  emitUpdatePropertyValue
53
45
  ],
54
- prefix: language.value,
46
+ locales: locales.value,
47
+ height: "60px",
48
+ width: "100%"
49
+ }, null, 8, ["modelValue", "locales"])) : (openBlock(), createBlock(unref(BSTextArea), {
50
+ key: 1,
51
+ modelValue: text.value,
52
+ "onUpdate:modelValue": [
53
+ _cache[1] || (_cache[1] = ($event) => text.value = $event),
54
+ emitUpdatePropertyValue
55
+ ],
55
56
  height: "60px",
56
57
  width: "100%"
57
- }, null, 8, ["modelValue", "prefix"])
58
+ }, null, 8, ["modelValue"]))
58
59
  ])
59
60
  ]);
60
61
  };
@@ -0,0 +1,47 @@
1
+ import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, withDirectives, unref, createVNode } from "vue";
2
+ import { vT, BSNumberInput } from "@g1cloud/bluesea";
3
+ const _hoisted_1 = { class: "property-editor property-editor-number flex-align-center" };
4
+ const _hoisted_2 = { class: "title" };
5
+ const _sfc_main = /* @__PURE__ */ defineComponent({
6
+ __name: "PbPropertyEditorNumber",
7
+ props: {
8
+ property: {},
9
+ value: {}
10
+ },
11
+ emits: ["update-property-value"],
12
+ setup(__props, { emit: __emit }) {
13
+ const props = __props;
14
+ const emit = __emit;
15
+ const modelValue = computed(() => {
16
+ if (props.value && !isNaN(Number(props.value))) {
17
+ return Number(props.value);
18
+ } else {
19
+ return void 0;
20
+ }
21
+ });
22
+ const emitUpdatePropertyValue = (value) => {
23
+ const properties = {};
24
+ properties[props.property.propertyName] = `${value}`;
25
+ emit("update-property-value", properties);
26
+ };
27
+ return (_ctx, _cache) => {
28
+ return openBlock(), createElementBlock("div", _hoisted_1, [
29
+ createElementVNode("div", _hoisted_2, [
30
+ withDirectives(createElementVNode("label", null, null, 512), [
31
+ [unref(vT), { key: _ctx.property.caption }]
32
+ ])
33
+ ]),
34
+ createElementVNode("div", null, [
35
+ createVNode(unref(BSNumberInput), {
36
+ "model-value": modelValue.value,
37
+ width: "100%",
38
+ "onUpdate:modelValue": emitUpdatePropertyValue
39
+ }, null, 8, ["model-value"])
40
+ ])
41
+ ]);
42
+ };
43
+ }
44
+ });
45
+ export {
46
+ _sfc_main as default
47
+ };
@@ -1,8 +1,8 @@
1
- import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString } from "vue";
1
+ import { defineComponent, openBlock, createElementBlock, createElementVNode, withDirectives, unref, toDisplayString } from "vue";
2
+ import { vT } from "@g1cloud/bluesea";
2
3
  const _hoisted_1 = { class: "property-editor property-editor-readonly-text" };
3
- const _hoisted_2 = { class: "label" };
4
+ const _hoisted_2 = { class: "title" };
4
5
  const _hoisted_3 = ["textContent"];
5
- const _hoisted_4 = ["textContent"];
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  __name: "PbPropertyEditorReadonlyText",
8
8
  props: {
@@ -13,14 +13,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
13
13
  return (_ctx, _cache) => {
14
14
  return openBlock(), createElementBlock("div", _hoisted_1, [
15
15
  createElementVNode("div", _hoisted_2, [
16
- createElementVNode("label", {
17
- textContent: toDisplayString(_ctx.property.caption)
18
- }, null, 8, _hoisted_3)
16
+ withDirectives(createElementVNode("label", null, null, 512), [
17
+ [unref(vT), { key: _ctx.property.caption }]
18
+ ])
19
19
  ]),
20
20
  createElementVNode("div", null, [
21
21
  createElementVNode("div", {
22
22
  textContent: toDisplayString(_ctx.value)
23
- }, null, 8, _hoisted_4)
23
+ }, null, 8, _hoisted_3)
24
24
  ])
25
25
  ]);
26
26
  };
@@ -1,8 +1,7 @@
1
- import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, toDisplayString, createVNode, unref } from "vue";
2
- import { BSSelect } from "@g1cloud/bluesea";
1
+ import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, withDirectives, unref, createVNode } from "vue";
2
+ import { vT, BSSelect } from "@g1cloud/bluesea";
3
3
  const _hoisted_1 = { class: "property-editor property-editor-select flex-align-center" };
4
- const _hoisted_2 = { class: "label" };
5
- const _hoisted_3 = ["textContent"];
4
+ const _hoisted_2 = { class: "title" };
6
5
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
6
  __name: "PbPropertyEditorSelect",
8
7
  props: {
@@ -24,9 +23,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
24
23
  return (_ctx, _cache) => {
25
24
  return openBlock(), createElementBlock("div", _hoisted_1, [
26
25
  createElementVNode("div", _hoisted_2, [
27
- createElementVNode("label", {
28
- textContent: toDisplayString(_ctx.property.caption)
29
- }, null, 8, _hoisted_3)
26
+ withDirectives(createElementVNode("label", null, null, 512), [
27
+ [unref(vT), { key: _ctx.property.caption }]
28
+ ])
30
29
  ]),
31
30
  createElementVNode("div", null, [
32
31
  createVNode(unref(BSSelect), {
@@ -0,0 +1,50 @@
1
+ import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, withDirectives, unref, createBlock } from "vue";
2
+ import { vT, BSMultiLangTextInput, BSTextInput } from "@g1cloud/bluesea";
3
+ import { u as usePageBuilderEditor } from "./index-CSLr4i8b.js";
4
+ const _hoisted_1 = { class: "property-editor property-editor-text flex-align-center" };
5
+ const _hoisted_2 = { class: "title" };
6
+ const _sfc_main = /* @__PURE__ */ defineComponent({
7
+ __name: "PbPropertyEditorText",
8
+ props: {
9
+ property: {},
10
+ value: {}
11
+ },
12
+ emits: ["update-property-value"],
13
+ setup(__props, { emit: __emit }) {
14
+ const props = __props;
15
+ const emit = __emit;
16
+ const pageBuilder = usePageBuilderEditor();
17
+ const locales = computed(() => pageBuilder.getLocales());
18
+ const emitUpdatePropertyValue = (value) => {
19
+ const properties = {};
20
+ properties[props.property.propertyName] = value;
21
+ emit("update-property-value", properties);
22
+ };
23
+ return (_ctx, _cache) => {
24
+ return openBlock(), createElementBlock("div", _hoisted_1, [
25
+ createElementVNode("div", _hoisted_2, [
26
+ withDirectives(createElementVNode("label", null, null, 512), [
27
+ [unref(vT), { key: _ctx.property.caption }]
28
+ ])
29
+ ]),
30
+ createElementVNode("div", null, [
31
+ _ctx.property.multiLang ? (openBlock(), createBlock(unref(BSMultiLangTextInput), {
32
+ key: 0,
33
+ locales: locales.value,
34
+ "model-value": _ctx.value,
35
+ width: "100%",
36
+ "onUpdate:modelValue": emitUpdatePropertyValue
37
+ }, null, 8, ["locales", "model-value"])) : (openBlock(), createBlock(unref(BSTextInput), {
38
+ key: 1,
39
+ "model-value": _ctx.value,
40
+ width: "100%",
41
+ "onUpdate:modelValue": emitUpdatePropertyValue
42
+ }, null, 8, ["model-value"]))
43
+ ])
44
+ ]);
45
+ };
46
+ }
47
+ });
48
+ export {
49
+ _sfc_main as default
50
+ };
@@ -0,0 +1,40 @@
1
+ import { defineComponent, openBlock, createElementBlock, createElementVNode, withDirectives, unref } from "vue";
2
+ import { useModal, vT } from "@g1cloud/bluesea";
3
+ import { s as selectYoutubeVideo } from "./index-CSLr4i8b.js";
4
+ const _hoisted_1 = { class: "property-editor property-editor-image flex-align-center" };
5
+ const _hoisted_2 = { class: "title" };
6
+ const _sfc_main = /* @__PURE__ */ defineComponent({
7
+ __name: "PbPropertyEditorYoutube",
8
+ props: {
9
+ property: {},
10
+ value: {}
11
+ },
12
+ emits: ["update-property-value"],
13
+ setup(__props, { emit: __emit }) {
14
+ const props = __props;
15
+ const modal = useModal();
16
+ const emit = __emit;
17
+ const selectVideo = () => {
18
+ selectYoutubeVideo(modal, props.value, (url) => {
19
+ emit("update-property-value", { url: url || "" });
20
+ });
21
+ };
22
+ return (_ctx, _cache) => {
23
+ return openBlock(), createElementBlock("div", _hoisted_1, [
24
+ createElementVNode("div", _hoisted_2, [
25
+ withDirectives(createElementVNode("label", null, null, 512), [
26
+ [unref(vT), { key: _ctx.property.caption }]
27
+ ])
28
+ ]),
29
+ createElementVNode("div", null, [
30
+ withDirectives(createElementVNode("button", { onClick: selectVideo }, null, 512), [
31
+ [unref(vT), { key: "pb.prop.selectVideo" }]
32
+ ])
33
+ ])
34
+ ]);
35
+ };
36
+ }
37
+ });
38
+ export {
39
+ _sfc_main as default
40
+ };
@@ -0,0 +1,69 @@
1
+ import { defineComponent, ref, openBlock, createBlock, unref, withCtx, createElementVNode, withDirectives, createVNode } from "vue";
2
+ import { useModalHandle, BSModalFrame, vT, BSRadioButton, BSButton } from "@g1cloud/bluesea";
3
+ const _hoisted_1 = { class: "mb-16" };
4
+ const _hoisted_2 = { class: "mr-8" };
5
+ const _hoisted_3 = { class: "text-right" };
6
+ const _sfc_main = /* @__PURE__ */ defineComponent({
7
+ __name: "PbScreenSelectModal",
8
+ emits: ["select"],
9
+ setup(__props, { emit: __emit }) {
10
+ const emit = __emit;
11
+ const selection = ref("0");
12
+ const modalHandle = useModalHandle();
13
+ const close = () => {
14
+ modalHandle.close();
15
+ };
16
+ const ok = () => {
17
+ emit("select", parseInt(selection.value));
18
+ modalHandle.close();
19
+ };
20
+ return (_ctx, _cache) => {
21
+ return openBlock(), createBlock(unref(BSModalFrame), { title: { key: "pb.modal.screenSelect.title" } }, {
22
+ default: withCtx(() => [
23
+ createElementVNode("div", null, [
24
+ createElementVNode("div", _hoisted_1, [
25
+ withDirectives(createElementVNode("label", _hoisted_2, null, 512), [
26
+ [unref(vT), { key: "pb.modal.screenSelect.message" }]
27
+ ]),
28
+ createElementVNode("div", null, [
29
+ createVNode(unref(BSRadioButton), {
30
+ modelValue: selection.value,
31
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selection.value = $event),
32
+ "item-value": "0",
33
+ label: { key: "pb.modal.screenSelect.mobile" },
34
+ name: "mobile"
35
+ }, null, 8, ["modelValue"]),
36
+ createVNode(unref(BSRadioButton), {
37
+ modelValue: selection.value,
38
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => selection.value = $event),
39
+ "item-value": "1",
40
+ label: { key: "pb.modal.screenSelect.pc" },
41
+ class: "ml-8",
42
+ name: "pc"
43
+ }, null, 8, ["modelValue"])
44
+ ])
45
+ ])
46
+ ])
47
+ ]),
48
+ buttons: withCtx(() => [
49
+ createElementVNode("div", _hoisted_3, [
50
+ createVNode(unref(BSButton), {
51
+ caption: { key: "pb.button.ok" },
52
+ "button-color": "blue",
53
+ onClick: ok
54
+ }),
55
+ createVNode(unref(BSButton), {
56
+ caption: { key: "pb.button.cancel" },
57
+ class: "ml-8",
58
+ onClick: close
59
+ })
60
+ ])
61
+ ]),
62
+ _: 1
63
+ });
64
+ };
65
+ }
66
+ });
67
+ export {
68
+ _sfc_main as default
69
+ };
@@ -0,0 +1,79 @@
1
+ import { defineComponent, computed, openBlock, createBlock, unref, withCtx, createElementVNode, createElementBlock, Fragment, renderList, toDisplayString } from "vue";
2
+ import { useModalHandle, BSModalFrame } from "@g1cloud/bluesea";
3
+ import { w as widgetPartDefinitions } from "./index-CSLr4i8b.js";
4
+ const _hoisted_1 = { class: "bs-layout-vertical pb-part-add-modal" };
5
+ const _hoisted_2 = { class: "bs-layout-horizontal-wrap ml-16 mb-8 gap-8" };
6
+ const _hoisted_3 = ["onClick", "textContent"];
7
+ const _hoisted_4 = { class: "group mb-16" };
8
+ const _hoisted_5 = ["textContent"];
9
+ const _hoisted_6 = { class: "bs-layout-horizontal-wrap ml-16 mb-8 gap-8" };
10
+ const _hoisted_7 = ["onClick", "textContent"];
11
+ const _sfc_main = /* @__PURE__ */ defineComponent({
12
+ __name: "PbWidgetAddModal",
13
+ props: {
14
+ pageBuilder: {},
15
+ partDefinitionGroups: {}
16
+ },
17
+ emits: ["selectHandler"],
18
+ setup(__props, { emit: __emit }) {
19
+ const props = __props;
20
+ const emit = __emit;
21
+ const modalHandle = useModalHandle();
22
+ const customWidgets = computed(() => props.pageBuilder.getCustomWidgets());
23
+ const select = (partDefinition) => {
24
+ emit("selectHandler", partDefinition);
25
+ modalHandle.close();
26
+ };
27
+ return (_ctx, _cache) => {
28
+ return openBlock(), createBlock(unref(BSModalFrame), { title: { key: "pb.modal.addWidget.title" } }, {
29
+ default: withCtx(() => [
30
+ createElementVNode("div", _hoisted_1, [
31
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(widgetPartDefinitions), (group) => {
32
+ return openBlock(), createElementBlock("div", {
33
+ key: group.groupName,
34
+ class: "group mb-16"
35
+ }, [
36
+ _cache[0] || (_cache[0] = createElementVNode("div", {
37
+ class: "mb-8 section-title",
38
+ textContent: "Basic Widgets"
39
+ }, null, -1)),
40
+ createElementVNode("div", _hoisted_2, [
41
+ (openBlock(true), createElementBlock(Fragment, null, renderList(group.partDefinitions, (part) => {
42
+ return openBlock(), createElementBlock("div", {
43
+ key: part.partName,
44
+ class: "part w-200",
45
+ onClick: ($event) => select(part),
46
+ textContent: toDisplayString(part.caption)
47
+ }, null, 8, _hoisted_3);
48
+ }), 128))
49
+ ])
50
+ ]);
51
+ }), 128)),
52
+ (openBlock(true), createElementBlock(Fragment, null, renderList(customWidgets.value, (group) => {
53
+ return openBlock(), createElementBlock("div", _hoisted_4, [
54
+ createElementVNode("div", {
55
+ class: "mb-8 section-title",
56
+ textContent: toDisplayString(group.caption)
57
+ }, null, 8, _hoisted_5),
58
+ createElementVNode("div", _hoisted_6, [
59
+ (openBlock(true), createElementBlock(Fragment, null, renderList(group.partDefinitions, (part) => {
60
+ return openBlock(), createElementBlock("div", {
61
+ key: part.partName,
62
+ class: "part w-200",
63
+ onClick: ($event) => select(part),
64
+ textContent: toDisplayString(part.caption)
65
+ }, null, 8, _hoisted_7);
66
+ }), 128))
67
+ ])
68
+ ]);
69
+ }), 256))
70
+ ])
71
+ ]),
72
+ _: 1
73
+ });
74
+ };
75
+ }
76
+ });
77
+ export {
78
+ _sfc_main as default
79
+ };
@@ -0,0 +1,73 @@
1
+ import { defineComponent, ref, openBlock, createBlock, unref, withCtx, createElementVNode, withDirectives, createVNode, createCommentVNode } from "vue";
2
+ import { useModalHandle, BSModalFrame, vT, BSTextInput } from "@g1cloud/bluesea";
3
+ import YouTube from "vue3-youtube";
4
+ const _hoisted_1 = { class: "bs-layout-vertical flex-grow-1 h-full" };
5
+ const _hoisted_2 = { class: "pt-8" };
6
+ const _hoisted_3 = { class: "w-480 h-360 border-w-1 border border-gray" };
7
+ const _hoisted_4 = { class: "bs-layout-horizontal justify-content-center" };
8
+ const _sfc_main = /* @__PURE__ */ defineComponent({
9
+ __name: "PbYoutubeModal",
10
+ props: {
11
+ url: {}
12
+ },
13
+ emits: ["selectUrl"],
14
+ setup(__props, { emit: __emit }) {
15
+ const props = __props;
16
+ const emit = __emit;
17
+ const modalHandle = useModalHandle();
18
+ const url = ref(props.url);
19
+ const updateUrl = (value) => {
20
+ url.value = value;
21
+ };
22
+ const ok = () => {
23
+ emit("selectUrl", url.value);
24
+ modalHandle.close();
25
+ };
26
+ return (_ctx, _cache) => {
27
+ return openBlock(), createBlock(unref(BSModalFrame), {
28
+ title: { key: "pb.modal.youtube.title" },
29
+ class: "pb-youtube-modal"
30
+ }, {
31
+ default: withCtx(() => [
32
+ createElementVNode("div", _hoisted_1, [
33
+ withDirectives(createElementVNode("div", null, null, 512), [
34
+ [unref(vT), { key: "pb.modal.youtube.url" }]
35
+ ]),
36
+ createVNode(unref(BSTextInput), {
37
+ "model-value": url.value,
38
+ width: "100%",
39
+ "onUpdate:modelValue": updateUrl
40
+ }, null, 8, ["model-value"]),
41
+ withDirectives(createElementVNode("div", _hoisted_2, null, 512), [
42
+ [unref(vT), { key: "pb.modal.youtube.preview" }]
43
+ ]),
44
+ createElementVNode("div", _hoisted_3, [
45
+ url.value ? (openBlock(), createBlock(unref(YouTube), {
46
+ key: 0,
47
+ ref: "youtube",
48
+ src: url.value,
49
+ class: "youtube",
50
+ height: "360",
51
+ width: "480"
52
+ }, null, 8, ["src"])) : createCommentVNode("", true)
53
+ ])
54
+ ])
55
+ ]),
56
+ buttons: withCtx(() => [
57
+ createElementVNode("div", _hoisted_4, [
58
+ withDirectives(createElementVNode("button", {
59
+ class: "mr-4",
60
+ onClick: ok
61
+ }, null, 512), [
62
+ [unref(vT), { key: "pb.button.ok" }]
63
+ ])
64
+ ])
65
+ ]),
66
+ _: 1
67
+ });
68
+ };
69
+ }
70
+ });
71
+ export {
72
+ _sfc_main as default
73
+ };
@@ -1,2 +1,2 @@
1
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{}>>, {}, {}>;
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
2
  export default _default;
@@ -1,10 +1,10 @@
1
1
  import { IPart } from '@g1cloud/page-builder-viewer';
2
2
 
3
- declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<{
3
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
4
4
  part: IPart;
5
- }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
5
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
6
6
  part: IPart;
7
- }>>>, {}, {}>;
7
+ }>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
8
8
  export default _default;
9
9
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
10
10
  type __VLS_TypePropsToRuntimeProps<T> = {
@@ -1,2 +1,17 @@
1
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{}>>, {}, {}>;
1
+ import { PageBuilderToolbarPlugin } from '../../model/plugin.ts';
2
+
3
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
4
+ toolbarPlugin?: PageBuilderToolbarPlugin | undefined;
5
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
6
+ toolbarPlugin?: PageBuilderToolbarPlugin | undefined;
7
+ }>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
8
  export default _default;
9
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
10
+ type __VLS_TypePropsToRuntimeProps<T> = {
11
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
12
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
13
+ } : {
14
+ type: import('vue').PropType<T[K]>;
15
+ required: true;
16
+ };
17
+ };
@@ -1,2 +1,17 @@
1
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{}>>, {}, {}>;
1
+ import { PageBuilderToolbarPlugin } from '../../model/plugin.ts';
2
+
3
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
4
+ plugin?: PageBuilderToolbarPlugin | undefined;
5
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
6
+ plugin?: PageBuilderToolbarPlugin | undefined;
7
+ }>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
8
  export default _default;
9
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
10
+ type __VLS_TypePropsToRuntimeProps<T> = {
11
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
12
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
13
+ } : {
14
+ type: import('vue').PropType<T[K]>;
15
+ required: true;
16
+ };
17
+ };
@@ -1,10 +1,10 @@
1
1
  import { ToolButton } from '../../model/toolbar.ts';
2
2
 
3
- declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<{
3
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
4
4
  button: ToolButton;
5
- }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
5
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
6
6
  button: ToolButton;
7
- }>>>, {}, {}>;
7
+ }>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
8
8
  export default _default;
9
9
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
10
10
  type __VLS_TypePropsToRuntimeProps<T> = {
@@ -1,10 +1,10 @@
1
1
  import { ToolButtonGroup } from '../../model/toolbar.ts';
2
2
 
3
- declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<{
3
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
4
4
  group: ToolButtonGroup;
5
- }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
5
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
6
6
  group: ToolButtonGroup;
7
- }>>>, {}, {}>;
7
+ }>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
8
8
  export default _default;
9
9
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
10
10
  type __VLS_TypePropsToRuntimeProps<T> = {
@@ -0,0 +1,28 @@
1
+ import { PageBuilderEditor } from '../../model/page-builder-editor.ts';
2
+ import { TabEntry } from '@g1cloud/bluesea';
3
+
4
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
5
+ html?: Record<string, unknown> | undefined;
6
+ locales?: string[] | undefined;
7
+ localeTabs?: TabEntry[] | undefined;
8
+ pageBuilder: PageBuilderEditor;
9
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
10
+ updateHtml: (html: Record<string, unknown>) => void;
11
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
12
+ html?: Record<string, unknown> | undefined;
13
+ locales?: string[] | undefined;
14
+ localeTabs?: TabEntry[] | undefined;
15
+ pageBuilder: PageBuilderEditor;
16
+ }>>> & Readonly<{
17
+ onUpdateHtml?: ((html: Record<string, unknown>) => any) | undefined;
18
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
19
+ export default _default;
20
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
21
+ type __VLS_TypePropsToRuntimeProps<T> = {
22
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
23
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
24
+ } : {
25
+ type: import('vue').PropType<T[K]>;
26
+ required: true;
27
+ };
28
+ };
@@ -1,17 +1,17 @@
1
1
  import { PartDefinition, PartDefinitionGroup } from '../../model/part-definintion.ts';
2
2
  import { PageBuilderEditor } from '../../model/page-builder-editor.ts';
3
3
 
4
- declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<{
4
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
5
5
  pageBuilder: PageBuilderEditor;
6
6
  partDefinitionGroups: PartDefinitionGroup[];
7
- }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
8
8
  selectHandler: (partDefinition: PartDefinition) => void;
9
9
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
10
10
  pageBuilder: PageBuilderEditor;
11
11
  partDefinitionGroups: PartDefinitionGroup[];
12
- }>>> & {
12
+ }>>> & Readonly<{
13
13
  onSelectHandler?: ((partDefinition: PartDefinition) => any) | undefined;
14
- }, {}, {}>;
14
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
15
15
  export default _default;
16
16
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
17
17
  type __VLS_TypePropsToRuntimeProps<T> = {