@feedmepos/mf-brand-app-builder 0.5.6 → 0.5.7-beta.1

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.
@@ -0,0 +1,25 @@
1
+ import { defineComponent as r, computed as c, resolveComponent as l, openBlock as s, createBlock as m } from "vue";
2
+ const i = /* @__PURE__ */ r({
3
+ __name: "ButtonGroup",
4
+ props: {
5
+ context: {}
6
+ },
7
+ setup(o) {
8
+ const t = o, n = (e) => {
9
+ t.context.node.input(e.value);
10
+ }, u = c(() => t.context.groupItems.find(
11
+ (e) => JSON.stringify(e.value) === JSON.stringify(t.context._value)
12
+ ));
13
+ return (e, a) => {
14
+ const p = l("FmButtonGroup");
15
+ return s(), m(p, {
16
+ "model-value": u.value,
17
+ "onUpdate:modelValue": n,
18
+ items: e.context.groupItems
19
+ }, null, 8, ["model-value", "items"]);
20
+ };
21
+ }
22
+ });
23
+ export {
24
+ i as default
25
+ };
@@ -0,0 +1,43 @@
1
+ import { openBlock as s, createElementBlock as o, defineComponent as l, createElementVNode as r } from "vue";
2
+ import { _ as n } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
+ const a = {}, _ = { class: "border-b border-fm-color-neutral-gray-100" };
4
+ function d(e, t) {
5
+ return s(), o("div", _);
6
+ }
7
+ const g = /* @__PURE__ */ n(a, [["render", d]]), f = { class: "relative" }, i = { class: "h-[18px] w-[18px] flex items-center justify-center" }, p = {
8
+ class: "absolute h-full left-0 top-0 w-full text-fm-color-primary",
9
+ viewBox: "0 0 18 18"
10
+ }, m = ["stroke-width"];
11
+ var c = /* @__PURE__ */ ((e) => (e[e.md = 2.5] = "md", e[e.lg = 2] = "lg", e[e.xl = 1.75] = "xl", e[e.xxl = 1.5] = "xxl", e))(c || {});
12
+ const x = /* @__PURE__ */ l({
13
+ __name: "CircularProgress",
14
+ props: {
15
+ indeterminate: { type: Boolean, default: void 0 },
16
+ size: { default: "xxl" },
17
+ color: { default: "primary" }
18
+ },
19
+ setup(e) {
20
+ return (t, u) => (s(), o("div", f, [
21
+ r("div", i, [
22
+ (s(), o("svg", p, [
23
+ r("circle", {
24
+ class: "spinner",
25
+ "stroke-width": c[t.size],
26
+ fill: "none",
27
+ stroke: "currentColor",
28
+ cx: "50%",
29
+ cy: "50%",
30
+ r: 7.75,
31
+ "stroke-linecap": "round",
32
+ "stroke-dasharray": "10 200",
33
+ "stroke-dashoffset": "0"
34
+ }, null, 8, m)
35
+ ]))
36
+ ])
37
+ ]));
38
+ }
39
+ }), h = /* @__PURE__ */ n(x, [["__scopeId", "data-v-3c8691e9"]]);
40
+ export {
41
+ h as C,
42
+ g as D
43
+ };
@@ -0,0 +1,22 @@
1
+ import { defineComponent as c, openBlock as l, createElementBlock as a, createElementVNode as r } from "vue";
2
+ const s = { class: "flex justify-between items-center gap-8" }, p = ["value"], _ = /* @__PURE__ */ c({
3
+ __name: "ColorPicker",
4
+ props: {
5
+ context: {}
6
+ },
7
+ setup(t) {
8
+ const n = t, o = (e) => {
9
+ n.context.node.input(e.target.value);
10
+ };
11
+ return (e, u) => (l(), a("label", s, [
12
+ r("input", {
13
+ type: "color",
14
+ value: e.context._value,
15
+ onInput: o
16
+ }, null, 40, p)
17
+ ]));
18
+ }
19
+ });
20
+ export {
21
+ _ as default
22
+ };
@@ -0,0 +1,16 @@
1
+ import { defineComponent as n, openBlock as o, createElementBlock as l, normalizeClass as a, toDisplayString as r } from "vue";
2
+ const i = /* @__PURE__ */ n({
3
+ __name: "Icon",
4
+ props: {
5
+ name: {},
6
+ filled: { type: Boolean, default: !1 }
7
+ },
8
+ setup(s) {
9
+ return (e, t) => (o(), l("span", {
10
+ class: a(["material-symbols-rounded", `icon-${e.filled ? "filled" : "rounded"}`])
11
+ }, r(e.name), 3));
12
+ }
13
+ });
14
+ export {
15
+ i as _
16
+ };
@@ -0,0 +1,72 @@
1
+ import { defineComponent as x, ref as y, resolveComponent as b, openBlock as r, createElementBlock as s, createVNode as c, Fragment as w, createElementVNode as i, unref as u, createCommentVNode as d } from "vue";
2
+ import { r as f, I as h } from "./image-DZ7CZVU8.js";
3
+ import { useCoreStore as C } from "@feedmepos/mf-common";
4
+ import "./main-BUI2Mmvv.js";
5
+ import { _ as I } from "./Icon.vue_vue_type_style_index_0_lang-CVCHCcWR.js";
6
+ import { C as $ } from "./CircularProgress-h90pbjU3.js";
7
+ import { v as k } from "./v4-ANoOI1Qw.js";
8
+ const F = { class: "w-full h-[210px] relative" }, B = { class: "absolute z-[1] top-0 left-0 h-full w-full bg-fm-color-neutral-white border border-dashed border-fm-color-neutral-gray-200" }, P = ["src"], j = {
9
+ key: 1,
10
+ class: "absolute z-[3] top-0 left-0 rounded-md bg-fm-color-neutral-gray-100 bg-opacity-80 w-full h-full flex justify-center items-center"
11
+ }, A = /* @__PURE__ */ x({
12
+ __name: "ImageUpload",
13
+ props: {
14
+ context: {}
15
+ },
16
+ setup(_) {
17
+ const e = _, a = C(), t = y(!1);
18
+ async function g(o) {
19
+ t.value = !0, await h.uploadImage(
20
+ a.currentBusiness.value._id,
21
+ `${k()}.${o.name.split(".").pop()}`,
22
+ o
23
+ ).then((m) => {
24
+ const l = `https://image.feedmedev.cc/business/${a.currentBusiness.value._id}/${m.imagePath}`;
25
+ e.context.node.input(l);
26
+ const n = new Image();
27
+ n.onload = () => {
28
+ var p;
29
+ ((p = e.context.node.at("$root")) == null ? void 0 : p._value).containerStyles.height = `${Math.min(n.height, 400)}px`;
30
+ }, n.src = f(l);
31
+ }).finally(() => t.value = !1);
32
+ }
33
+ async function v() {
34
+ t.value = !0;
35
+ const o = e.context._value.split("/").pop();
36
+ await h.deleteImage(a.currentBusiness.value._id, o).then(() => e.context.node.input("")).finally(() => t.value = !1);
37
+ }
38
+ return (o, m) => {
39
+ const l = b("FmDropField");
40
+ return r(), s("div", F, [
41
+ c(l, {
42
+ class: "w-full h-full",
43
+ onFileUpload: g
44
+ }),
45
+ e.context._value && !t.value ? (r(), s(w, { key: 0 }, [
46
+ i("div", B, [
47
+ i("img", {
48
+ class: "w-full h-full object-contain",
49
+ src: u(f)(e.context._value)
50
+ }, null, 8, P)
51
+ ]),
52
+ i("button", {
53
+ type: "button",
54
+ class: "absolute z-[2] -right-8 -top-8 w-24 h-24 bg-fm-color-system-error-300 rounded-full flex items-center justify-center",
55
+ onClick: v
56
+ }, [
57
+ c(u(I), {
58
+ name: "close",
59
+ class: "!text-[16px] text-fm-color-typo-white"
60
+ })
61
+ ])
62
+ ], 64)) : d("", !0),
63
+ t.value ? (r(), s("div", j, [
64
+ c(u($))
65
+ ])) : d("", !0)
66
+ ]);
67
+ };
68
+ }
69
+ });
70
+ export {
71
+ A as default
72
+ };
@@ -0,0 +1,169 @@
1
+ import { defineComponent as L, ref as f, computed as k, onBeforeMount as P, resolveComponent as c, openBlock as p, createBlock as v, withCtx as m, createElementBlock as x, createElementVNode as o, toDisplayString as I, createVNode as r, withModifiers as R, Fragment as C, renderList as F } from "vue";
2
+ import { u as $, B as y } from "./index-0MncaVY7.js";
3
+ import { _ as j } from "./Icon.vue_vue_type_style_index_0_lang-CVCHCcWR.js";
4
+ import { useCoreStore as z } from "@feedmepos/mf-common";
5
+ const A = {
6
+ key: 1,
7
+ type: "button",
8
+ class: "min-w-[162px] py-[6px] px-8 flex justify-between items-center bg-fm-color-system-warning-100 rounded-lg"
9
+ }, G = { class: "w-[113px] h-full fm-typo-en-body-md-600 text-fm-color-primary line-clamp-1" }, H = { class: "w-full flex flex-col gap-16" }, N = { class: "w-full flex gap-8 flex-wrap" }, O = { class: "w-full flex gap-8 flex-wrap" }, W = { class: "w-full flex items-center" }, q = { class: "w-full flex justify-end items-center gap-12" }, Y = /* @__PURE__ */ L({
10
+ __name: "LinkButton",
11
+ props: {
12
+ context: {}
13
+ },
14
+ setup(E) {
15
+ const l = E, s = f(""), i = f(""), d = f(!1);
16
+ z();
17
+ const b = $(), h = k(
18
+ () => b.state.allTemplates.filter(
19
+ (t) => {
20
+ var e;
21
+ return t.templateId !== ((e = b.state.selectedTemplate) == null ? void 0 : e.templateId);
22
+ }
23
+ )
24
+ ), _ = [
25
+ { title: "Homepage", path: "Member::Homepage" },
26
+ { title: "Credit", path: "Member::Credit" },
27
+ { title: "Points", path: "Member::Points" },
28
+ { title: "Voucher", path: "Member::Voucher" },
29
+ { title: "Game", path: "Member::Game" },
30
+ { title: "Store", path: "Member::Store" }
31
+ ];
32
+ function M() {
33
+ i.value ? l.context.node.input({
34
+ path: i.value ? `https://${i.value}` : "",
35
+ isExternal: !0
36
+ }) : l.context.node.input({
37
+ path: s.value ? s.value : "",
38
+ isExternal: !1
39
+ }), d.value = !1;
40
+ }
41
+ function V() {
42
+ l.context.node.input({
43
+ path: "",
44
+ isExternal: !1
45
+ });
46
+ }
47
+ function B(t) {
48
+ s.value = "", i.value = t;
49
+ }
50
+ function g(t) {
51
+ i.value = "", s.value = t;
52
+ }
53
+ function w() {
54
+ var t, e, n;
55
+ (t = l.context._value) != null && t.isExternal ? (i.value = ((e = l.context._value) == null ? void 0 : e.path.replace("https://", "")) || "", s.value = "") : (s.value = ((n = l.context._value) == null ? void 0 : n.path) || "", i.value = "");
56
+ }
57
+ function S() {
58
+ d.value = !1, w();
59
+ }
60
+ const T = k(() => {
61
+ var t, e, n;
62
+ if ((t = l.context._value) != null && t.isExternal)
63
+ return l.context._value.path;
64
+ if (l.context._value.path.startsWith("Template::"))
65
+ return (e = h.value.find(
66
+ (u) => u.templateId === l.context._value.path.split("::").pop()
67
+ )) == null ? void 0 : e.templateAlias;
68
+ if (l.context._value.path.startsWith("Member::"))
69
+ return (n = _.find((u) => u.path === l.context._value.path)) == null ? void 0 : n.title;
70
+ });
71
+ return P(() => {
72
+ w();
73
+ }), (t, e) => {
74
+ const n = c("FmButton"), u = c("FmRadio"), U = c("FmTextField"), D = c("FmDialog");
75
+ return p(), v(D, {
76
+ modelValue: d.value,
77
+ "onUpdate:modelValue": e[0] || (e[0] = (a) => d.value = a),
78
+ "min-width": 500
79
+ }, {
80
+ "dialog-button": m(() => {
81
+ var a;
82
+ return [
83
+ (a = t.context._value) != null && a.path ? (p(), x("button", A, [
84
+ o("p", G, I(T.value), 1),
85
+ r(j, {
86
+ name: "close",
87
+ class: "text-[24px] text-fm-color-primary",
88
+ onClick: R(V, ["stop"])
89
+ })
90
+ ])) : (p(), v(n, {
91
+ key: 0,
92
+ variant: "secondary",
93
+ "prepend-icon": "link",
94
+ class: "min-w-[162px]",
95
+ label: "Select",
96
+ type: "button"
97
+ }))
98
+ ];
99
+ }),
100
+ "dialog-header": m(() => e[1] || (e[1] = [
101
+ o("div", null, "Link Destination", -1)
102
+ ])),
103
+ "dialog-footer": m(() => [
104
+ o("div", q, [
105
+ r(n, {
106
+ type: "button",
107
+ variant: "secondary",
108
+ label: "Cancel",
109
+ size: "md",
110
+ onClick: S
111
+ }),
112
+ r(n, {
113
+ type: "button",
114
+ variant: "primary",
115
+ label: "Save",
116
+ size: "md",
117
+ onClick: M
118
+ })
119
+ ])
120
+ ]),
121
+ default: m(() => [
122
+ o("div", H, [
123
+ e[4] || (e[4] = o("div", { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, " Member ", -1)),
124
+ r(y),
125
+ o("div", N, [
126
+ (p(), x(C, null, F(_, (a) => r(u, {
127
+ "model-value": s.value,
128
+ "onUpdate:modelValue": g,
129
+ rules: () => [],
130
+ label: a.title,
131
+ value: a.path
132
+ }, null, 8, ["model-value", "label", "value"])), 64))
133
+ ]),
134
+ e[5] || (e[5] = o("div", { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, " Other template ", -1)),
135
+ r(y),
136
+ o("div", O, [
137
+ (p(!0), x(C, null, F(h.value, (a) => (p(), v(u, {
138
+ "model-value": s.value,
139
+ "onUpdate:modelValue": g,
140
+ rules: () => [],
141
+ label: a.templateAlias,
142
+ value: `Template::${a.templateId}`
143
+ }, null, 8, ["model-value", "label", "value"]))), 256))
144
+ ]),
145
+ e[6] || (e[6] = o("div", { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, " External URL ", -1)),
146
+ r(y),
147
+ o("div", W, [
148
+ e[3] || (e[3] = o("div", { class: "w-120 shrink-0" }, "Enter URL", -1)),
149
+ r(U, {
150
+ class: "w-full",
151
+ "model-value": i.value,
152
+ "onUpdate:modelValue": B
153
+ }, {
154
+ prepend: m(() => e[2] || (e[2] = [
155
+ o("div", { class: "text-fm-color-typo-tertiary" }, "https://", -1)
156
+ ])),
157
+ _: 1
158
+ }, 8, ["model-value"])
159
+ ])
160
+ ])
161
+ ]),
162
+ _: 1
163
+ }, 8, ["modelValue"]);
164
+ };
165
+ }
166
+ });
167
+ export {
168
+ Y as default
169
+ };
@@ -0,0 +1,86 @@
1
+ import { defineComponent as b, resolveComponent as y, openBlock as c, createBlock as s, unref as u, withCtx as i, createElementBlock as m, Fragment as x, renderList as g, createElementVNode as p, createVNode as n, resolveDynamicComponent as F } from "vue";
2
+ import { F as f } from "./app-C_qReIun.js";
3
+ const h = { class: "flex justify-end gap-4 items-center w-full py-16 px-12 border-b" }, z = { class: "flex flex-col gap-4 w-full p-12" }, I = /* @__PURE__ */ b({
4
+ __name: "ListRepeater",
5
+ props: {
6
+ context: {}
7
+ },
8
+ setup($) {
9
+ function d(l, t) {
10
+ const e = l.value;
11
+ e.splice(t - 1, 0, e.splice(t, 1)[0]), l.input(e, !1);
12
+ }
13
+ function v(l, t) {
14
+ const e = l.value;
15
+ e.splice(t + 1, 0, e.splice(t, 1)[0]), l.input(e, !1);
16
+ }
17
+ function k(l, t) {
18
+ const e = l.value;
19
+ e.splice(t + 1, 0, {}), l.input(e, !1);
20
+ }
21
+ function _(l, t) {
22
+ const e = l.value;
23
+ e.splice(t, 1), l.input(e, !1);
24
+ }
25
+ return (l, t) => {
26
+ const e = y("FmIcon");
27
+ return c(), s(u(f), {
28
+ class: "w-full",
29
+ type: "list",
30
+ value: l.context.value,
31
+ sync: !0,
32
+ name: l.context.node.name,
33
+ dynamic: !0
34
+ }, {
35
+ default: i(({ items: C, node: r }) => [
36
+ (c(!0), m(x, null, g(C, (w, o) => (c(), m("div", {
37
+ key: w,
38
+ class: "mb-8 border border-fm-color-neutral-gray-100 rounded-lg"
39
+ }, [
40
+ p("div", h, [
41
+ n(e, {
42
+ size: "md",
43
+ name: "add",
44
+ onClick: (a) => k(r, o),
45
+ class: "cursor-pointer text-fm-color-neutral-black"
46
+ }, null, 8, ["onClick"]),
47
+ n(e, {
48
+ size: "md",
49
+ name: "remove",
50
+ onClick: (a) => _(r, o),
51
+ class: "cursor-pointer text-fm-color-neutral-black"
52
+ }, null, 8, ["onClick"]),
53
+ n(e, {
54
+ size: "md",
55
+ name: "arrow_upward",
56
+ onClick: (a) => d(r, o),
57
+ class: "cursor-pointer text-fm-color-neutral-black"
58
+ }, null, 8, ["onClick"]),
59
+ n(e, {
60
+ size: "md",
61
+ name: "arrow_downward",
62
+ onClick: (a) => v(r, o),
63
+ class: "cursor-pointer text-fm-color-neutral-black"
64
+ }, null, 8, ["onClick"])
65
+ ]),
66
+ n(u(f), {
67
+ index: o,
68
+ type: "group"
69
+ }, {
70
+ default: i(() => [
71
+ p("div", z, [
72
+ (c(), s(F(l.context.slots.default)))
73
+ ])
74
+ ]),
75
+ _: 2
76
+ }, 1032, ["index"])
77
+ ]))), 128))
78
+ ]),
79
+ _: 1
80
+ }, 8, ["value", "name"]);
81
+ };
82
+ }
83
+ });
84
+ export {
85
+ I as default
86
+ };