@g1cloud/page-builder-editor 1.0.0-alpha.1 → 1.0.0-alpha.11

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 (41) hide show
  1. package/README.md +31 -6
  2. package/css/canvas.scss +1 -0
  3. package/css/page-builder-editor.scss +109 -19
  4. package/css/property-editor-color.scss +5 -0
  5. package/css/property-editor-html.scss +16 -0
  6. package/css/property-group-editor-background.scss +0 -12
  7. package/css/property-group-editor-border.scss +6 -12
  8. package/css/property-group-editor-margin.scss +0 -11
  9. package/css/property-group-editor-padding.scss +0 -11
  10. package/css/property-group-editor-position.scss +0 -11
  11. package/css/property-group-editor-size.scss +0 -11
  12. package/css/property-localpart.scss +2 -2
  13. package/dist/HtmlEditorModal-B2wOdZTD.js +98 -0
  14. package/dist/PageBuilderEditor.vue.d.ts +5 -1
  15. package/dist/PbPropertyEditorColor-D3brNT4U.js +57 -0
  16. package/dist/PbPropertyEditorHtml-D--QgdEp.js +64 -0
  17. package/dist/{PbPropertyEditorImage-BFIqG-bL.js → PbPropertyEditorImage-BB25lcTu.js} +2 -2
  18. package/dist/PbPropertyEditorMultilineText-BN2Q1P1o.js +65 -0
  19. package/dist/{PbPropertyEditorProduct--cf9LI2Z.js → PbPropertyEditorProduct-CBk2DLhW.js} +2 -2
  20. package/dist/{PbPropertyEditorReadonlyText-Bk0WJxA0.js → PbPropertyEditorReadonlyText-Dgp_AVOD.js} +1 -1
  21. package/dist/{PbPropertyEditorSelect-BJovN1su.js → PbPropertyEditorSelect-CWedbXJI.js} +1 -1
  22. package/dist/{PbPropertyEditorText-DNdXl-Tr.js → PbPropertyEditorText-BWOKvwD9.js} +1 -1
  23. package/dist/components/modal/HtmlEditorModal.vue.d.ts +23 -0
  24. package/dist/components/sidebar/property/PbPropertyEditorColor.vue.d.ts +23 -0
  25. package/dist/components/sidebar/property/PbPropertyEditorHtml.vue.d.ts +23 -0
  26. package/dist/components/sidebar/property/PbPropertyEditorMultilineText.vue.d.ts +5 -4
  27. package/dist/components/ui/PbColorPicker.vue.d.ts +2 -2
  28. package/dist/{index-BtILenNo.js → index-DdC6jCrv.js} +987 -535
  29. package/dist/model/context.d.ts +19 -10
  30. package/dist/model/event.d.ts +9 -4
  31. package/dist/model/model.d.ts +6 -4
  32. package/dist/model/page-builder-editor.d.ts +8 -2
  33. package/dist/model/page-builder-util.d.ts +2 -2
  34. package/dist/model/part-definintion.d.ts +1 -0
  35. package/dist/model/part-manager.d.ts +1 -0
  36. package/dist/page-builder-editor.js +23 -19
  37. package/dist/page-builder-editor.umd.cjs +1368 -681
  38. package/dist/style.css +0 -167
  39. package/package.json +4 -3
  40. package/dist/PbPropertyEditorMultilineText-BMeNUGm8.js +0 -42
  41. /package/dist/components/sidebar/property/{PbPropertyLocalPart.vue.d.ts → PbPropertyLocalMarketingPart.vue.d.ts} +0 -0
@@ -0,0 +1,65 @@
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-DdC6jCrv.js";
4
+ const _hoisted_1 = { class: "property-editor property-editor-multiline-text" };
5
+ const _hoisted_2 = { class: "title" };
6
+ const _hoisted_3 = ["textContent"];
7
+ const _sfc_main = /* @__PURE__ */ defineComponent({
8
+ __name: "PbPropertyEditorMultilineText",
9
+ props: {
10
+ property: {},
11
+ value: {}
12
+ },
13
+ emits: ["update-property-value"],
14
+ setup(__props, { emit: __emit }) {
15
+ const props = __props;
16
+ 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
+ const pageBuilder = usePageBuilderEditor();
32
+ const language = computed(() => pageBuilder.language.value);
33
+ const text = computed({
34
+ get() {
35
+ return props.value && typeof props.value === "object" ? props.value[language.value] : "";
36
+ },
37
+ set() {
38
+ }
39
+ });
40
+ return (_ctx, _cache) => {
41
+ return openBlock(), createElementBlock("div", _hoisted_1, [
42
+ createElementVNode("div", _hoisted_2, [
43
+ createElementVNode("label", {
44
+ textContent: toDisplayString(_ctx.property.caption)
45
+ }, null, 8, _hoisted_3)
46
+ ]),
47
+ createElementVNode("div", null, [
48
+ createVNode(unref(BSTextArea), {
49
+ modelValue: text.value,
50
+ "onUpdate:modelValue": [
51
+ _cache[0] || (_cache[0] = ($event) => text.value = $event),
52
+ emitUpdatePropertyValue
53
+ ],
54
+ prefix: language.value,
55
+ height: "60px",
56
+ width: "100%"
57
+ }, null, 8, ["modelValue", "prefix"])
58
+ ])
59
+ ]);
60
+ };
61
+ }
62
+ });
63
+ export {
64
+ _sfc_main as default
65
+ };
@@ -1,8 +1,8 @@
1
1
  import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString } from "vue";
2
2
  import { useModal } from "@g1cloud/bluesea";
3
- import { u as usePageBuilderEditor, P as PageBuilderEditorEvent } from "./index-BtILenNo.js";
3
+ import { u as usePageBuilderEditor, a as PageBuilderEditorEvent } from "./index-DdC6jCrv.js";
4
4
  const _hoisted_1 = { class: "property-editor property-editor-product flex-align-center" };
5
- const _hoisted_2 = { class: "label" };
5
+ const _hoisted_2 = { class: "title" };
6
6
  const _hoisted_3 = ["textContent"];
7
7
  const _sfc_main = /* @__PURE__ */ defineComponent({
8
8
  __name: "PbPropertyEditorProduct",
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString } from "vue";
2
2
  const _hoisted_1 = { class: "property-editor property-editor-readonly-text" };
3
- const _hoisted_2 = { class: "label" };
3
+ const _hoisted_2 = { class: "title" };
4
4
  const _hoisted_3 = ["textContent"];
5
5
  const _hoisted_4 = ["textContent"];
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, toDisplayString, createVNode, unref } from "vue";
2
2
  import { BSSelect } from "@g1cloud/bluesea";
3
3
  const _hoisted_1 = { class: "property-editor property-editor-select flex-align-center" };
4
- const _hoisted_2 = { class: "label" };
4
+ const _hoisted_2 = { class: "title" };
5
5
  const _hoisted_3 = ["textContent"];
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  __name: "PbPropertyEditorSelect",
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, createVNode, unref } from "vue";
2
2
  import { BSTextInput } from "@g1cloud/bluesea";
3
3
  const _hoisted_1 = { class: "property-editor property-editor-text flex-align-center" };
4
- const _hoisted_2 = { class: "label" };
4
+ const _hoisted_2 = { class: "title" };
5
5
  const _hoisted_3 = ["textContent"];
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  __name: "PbPropertyEditorText",
@@ -0,0 +1,23 @@
1
+ type Html = {
2
+ tags: string;
3
+ style: string;
4
+ };
5
+ declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<{
6
+ html?: Html | undefined;
7
+ }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
8
+ updateHtml: (html: Html) => void;
9
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
10
+ html?: Html | undefined;
11
+ }>>> & {
12
+ onUpdateHtml?: ((html: Html) => any) | undefined;
13
+ }, {}, {}>;
14
+ export default _default;
15
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
16
+ type __VLS_TypePropsToRuntimeProps<T> = {
17
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
18
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
19
+ } : {
20
+ type: import('vue').PropType<T[K]>;
21
+ required: true;
22
+ };
23
+ };
@@ -0,0 +1,23 @@
1
+ import { PartProperty } from '../../../model/part-property.ts';
2
+
3
+ declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<{
4
+ property: PartProperty;
5
+ value?: string | undefined;
6
+ }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
+ "update-property-value": (properties: Record<string, string>) => void;
8
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
9
+ property: PartProperty;
10
+ value?: string | undefined;
11
+ }>>> & {
12
+ "onUpdate-property-value"?: ((properties: Record<string, string>) => any) | undefined;
13
+ }, {}, {}>;
14
+ export default _default;
15
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
16
+ type __VLS_TypePropsToRuntimeProps<T> = {
17
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
18
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
19
+ } : {
20
+ type: import('vue').PropType<T[K]>;
21
+ required: true;
22
+ };
23
+ };
@@ -0,0 +1,23 @@
1
+ import { PartProperty } from '../../../model/part-property.ts';
2
+
3
+ declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<{
4
+ property: PartProperty;
5
+ value?: unknown;
6
+ }>, {}, unknown, {}, {}, 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<{
9
+ property: PartProperty;
10
+ value?: unknown;
11
+ }>>> & {
12
+ "onUpdate-property-value"?: ((properties: Record<string, unknown>) => any) | undefined;
13
+ }, {}, {}>;
14
+ export default _default;
15
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
16
+ type __VLS_TypePropsToRuntimeProps<T> = {
17
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
18
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
19
+ } : {
20
+ type: import('vue').PropType<T[K]>;
21
+ required: true;
22
+ };
23
+ };
@@ -1,15 +1,16 @@
1
+ import { MultiLangText } from '@g1cloud/page-builder-viewer';
1
2
  import { PartProperty } from '../../../model/part-property.ts';
2
3
 
3
4
  declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<{
4
5
  property: PartProperty;
5
- value?: string | undefined;
6
+ value?: MultiLangText | undefined;
6
7
  }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
- "update-property-value": (properties: Record<string, string>) => void;
8
+ "update-property-value": (properties: Record<string, MultiLangText>) => void;
8
9
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
9
10
  property: PartProperty;
10
- value?: string | undefined;
11
+ value?: MultiLangText | undefined;
11
12
  }>>> & {
12
- "onUpdate-property-value"?: ((properties: Record<string, string>) => any) | undefined;
13
+ "onUpdate-property-value"?: ((properties: Record<string, MultiLangText>) => any) | undefined;
13
14
  }, {}, {}>;
14
15
  export default _default;
15
16
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -5,10 +5,10 @@ declare const _default: import('vue').DefineComponent<{
5
5
  default: string;
6
6
  };
7
7
  }, {
8
- appliedColor: import('vue').ComputedRef<string>;
8
+ appliedColor: import('vue').ComputedRef<any>;
9
9
  isShowColorPicker: import('vue').Ref<boolean>;
10
10
  toggle: (value?: boolean) => void;
11
- color: import('vue').Ref<string>;
11
+ color: import('vue').Ref<any>;
12
12
  emptyColor: () => void;
13
13
  colorHistory: string[] | undefined;
14
14
  }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{