@feedmepos/mf-brand-app-builder 0.5.5 → 0.5.7-alpha

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,640 @@
1
+ import { defineComponent as x, ref as b, computed as B, watch as j, resolveComponent as m, openBlock as p, createElementBlock as w, createElementVNode as r, createVNode as c, unref as l, createBlock as z, withCtx as S, toDisplayString as $ } from "vue";
2
+ import { useCoreStore as F } from "@feedmepos/mf-common";
3
+ import { B as g } from "./index-CjpUVE5b.js";
4
+ import { K as P } from "./vue-sonner-PX6Req0V.js";
5
+ import { r as U, I as V } from "./image-D5Lfw4dr.js";
6
+ const q = new RegExp(/^[a-z0-9][a-z0-9\-]{4,}[a-z0-9]$/), C = [
7
+ "brand",
8
+ "home",
9
+ "app",
10
+ "about",
11
+ "tnc",
12
+ "terms-and-conditions",
13
+ "redirection",
14
+ "redirect",
15
+ "auth",
16
+ "login",
17
+ "logout",
18
+ "register",
19
+ "user",
20
+ "discovery",
21
+ "discover",
22
+ "order",
23
+ "orders",
24
+ "membership",
25
+ "memberships",
26
+ "member",
27
+ "members",
28
+ "benefit",
29
+ "benefits",
30
+ "reward",
31
+ "rewards",
32
+ "voucher",
33
+ "vouchers",
34
+ "search",
35
+ "restaurant",
36
+ "restaurants",
37
+ "business",
38
+ "businesses",
39
+ "dine",
40
+ "profile",
41
+ "scan",
42
+ "scanner",
43
+ "menu",
44
+ "cart",
45
+ "me",
46
+ "v",
47
+ "active-orders",
48
+ "qr",
49
+ "setting",
50
+ "settings",
51
+ "error",
52
+ "supportdetails",
53
+ "support-details",
54
+ "stacks",
55
+ "imulus",
56
+ "github",
57
+ "twitter",
58
+ "facebook",
59
+ "google",
60
+ "apple",
61
+ "about",
62
+ "account",
63
+ "activate",
64
+ "add",
65
+ "admin",
66
+ "administrator",
67
+ "api",
68
+ "app",
69
+ "apps",
70
+ "archive",
71
+ "archives",
72
+ "auth",
73
+ "blog",
74
+ "cache",
75
+ "cancel",
76
+ "careers",
77
+ "cart",
78
+ "changelog",
79
+ "checkout",
80
+ "codereview",
81
+ "compare",
82
+ "config",
83
+ "configuration",
84
+ "connect",
85
+ "contact",
86
+ "create",
87
+ "delete",
88
+ "direct_messages",
89
+ "documentation",
90
+ "download",
91
+ "downloads",
92
+ "edit",
93
+ "email",
94
+ "employment",
95
+ "enterprise",
96
+ "faq",
97
+ "favorites",
98
+ "feed",
99
+ "feedback",
100
+ "feeds",
101
+ "fleet",
102
+ "fleets",
103
+ "follow",
104
+ "followers",
105
+ "following",
106
+ "friend",
107
+ "friends",
108
+ "gist",
109
+ "group",
110
+ "groups",
111
+ "help",
112
+ "home",
113
+ "hosting",
114
+ "hostmaster",
115
+ "idea",
116
+ "ideas",
117
+ "index",
118
+ "info",
119
+ "invitations",
120
+ "invite",
121
+ "is",
122
+ "it",
123
+ "job",
124
+ "jobs",
125
+ "json",
126
+ "language",
127
+ "languages",
128
+ "lists",
129
+ "login",
130
+ "logout",
131
+ "logs",
132
+ "mail",
133
+ "map",
134
+ "maps",
135
+ "mine",
136
+ "mis",
137
+ "news",
138
+ "oauth",
139
+ "oauth_clients",
140
+ "offers",
141
+ "openid",
142
+ "order",
143
+ "orders",
144
+ "organizations",
145
+ "plans",
146
+ "popular",
147
+ "post",
148
+ "postmaster",
149
+ "privacy",
150
+ "projects",
151
+ "put",
152
+ "recruitment",
153
+ "register",
154
+ "remove",
155
+ "replies",
156
+ "root",
157
+ "rss",
158
+ "sales",
159
+ "save",
160
+ "search",
161
+ "security",
162
+ "sessions",
163
+ "settings",
164
+ "shop",
165
+ "signup",
166
+ "sitemap",
167
+ "ssl",
168
+ "ssladmin",
169
+ "ssladministrator",
170
+ "sslwebmaster",
171
+ "status",
172
+ "stories",
173
+ "styleguide",
174
+ "subscribe",
175
+ "subscriptions",
176
+ "support",
177
+ "sysadmin",
178
+ "sysadministrator",
179
+ "terms",
180
+ "tour",
181
+ "translations",
182
+ "trends",
183
+ "unfollow",
184
+ "unsubscribe",
185
+ "update",
186
+ "url",
187
+ "user",
188
+ "weather",
189
+ "webmaster",
190
+ "widget",
191
+ "widgets",
192
+ "wiki",
193
+ "ww",
194
+ "www",
195
+ "wwww",
196
+ "xfn",
197
+ "xml",
198
+ "xmpp",
199
+ "yaml",
200
+ "yml",
201
+ "chinese",
202
+ "mandarin",
203
+ "spanish",
204
+ "english",
205
+ "bengali",
206
+ "hindi",
207
+ "portuguese",
208
+ "russian",
209
+ "japanese",
210
+ "german",
211
+ "wu",
212
+ "javanese",
213
+ "korean",
214
+ "french",
215
+ "vietnamese",
216
+ "telugu",
217
+ "chinese",
218
+ "marathi",
219
+ "tamil",
220
+ "turkish",
221
+ "urdu",
222
+ "min-nan",
223
+ "jinyu",
224
+ "gujarati",
225
+ "polish",
226
+ "arabic",
227
+ "ukrainian",
228
+ "italian",
229
+ "xiang",
230
+ "malayalam",
231
+ "hakka",
232
+ "kannada",
233
+ "oriya",
234
+ "panjabi",
235
+ "sunda",
236
+ "panjabi",
237
+ "romanian",
238
+ "bhojpuri",
239
+ "azerbaijani",
240
+ "farsi",
241
+ "maithili",
242
+ "hausa",
243
+ "arabic",
244
+ "burmese",
245
+ "serbo-croatian",
246
+ "gan",
247
+ "awadhi",
248
+ "thai",
249
+ "dutch",
250
+ "yoruba",
251
+ "sindhi",
252
+ "ac",
253
+ "ad",
254
+ "ae",
255
+ "af",
256
+ "ag",
257
+ "ai",
258
+ "al",
259
+ "am",
260
+ "an",
261
+ "ao",
262
+ "aq",
263
+ "ar",
264
+ "as",
265
+ "at",
266
+ "au",
267
+ "aw",
268
+ "ax",
269
+ "az",
270
+ "ba",
271
+ "bb",
272
+ "bd",
273
+ "be",
274
+ "bf",
275
+ "bg",
276
+ "bh",
277
+ "bi",
278
+ "bj",
279
+ "bm",
280
+ "bn",
281
+ "bo",
282
+ "br",
283
+ "bs",
284
+ "bt",
285
+ "bv",
286
+ "bw",
287
+ "by",
288
+ "bz",
289
+ "ca",
290
+ "cc",
291
+ "cd",
292
+ "cf",
293
+ "cg",
294
+ "ch",
295
+ "ci",
296
+ "ck",
297
+ "cl",
298
+ "cm",
299
+ "cn",
300
+ "co",
301
+ "cr",
302
+ "cs",
303
+ "cu",
304
+ "cv",
305
+ "cx",
306
+ "cy",
307
+ "cz",
308
+ "dd",
309
+ "de",
310
+ "dj",
311
+ "dk",
312
+ "dm",
313
+ "do",
314
+ "dz",
315
+ "ec",
316
+ "ee",
317
+ "eg",
318
+ "eh",
319
+ "er",
320
+ "es",
321
+ "et",
322
+ "eu",
323
+ "fi",
324
+ "fj",
325
+ "fk",
326
+ "fm",
327
+ "fo",
328
+ "fr",
329
+ "ga",
330
+ "gb",
331
+ "gd",
332
+ "ge",
333
+ "gf",
334
+ "gg",
335
+ "gh",
336
+ "gi",
337
+ "gl",
338
+ "gm",
339
+ "gn",
340
+ "gp",
341
+ "gq",
342
+ "gr",
343
+ "gs",
344
+ "gt",
345
+ "gu",
346
+ "gw",
347
+ "gy",
348
+ "hk",
349
+ "hm",
350
+ "hn",
351
+ "hr",
352
+ "ht",
353
+ "hu",
354
+ "id",
355
+ "ie",
356
+ "il",
357
+ "im",
358
+ "in",
359
+ "io",
360
+ "iq",
361
+ "ir",
362
+ "is",
363
+ "it",
364
+ "je",
365
+ "jm",
366
+ "jo",
367
+ "jp",
368
+ "ke",
369
+ "kg",
370
+ "kh",
371
+ "ki",
372
+ "km",
373
+ "kn",
374
+ "kp",
375
+ "kr",
376
+ "kw",
377
+ "ky",
378
+ "kz",
379
+ "la",
380
+ "lb",
381
+ "lc",
382
+ "li",
383
+ "lk",
384
+ "lr",
385
+ "ls",
386
+ "lt",
387
+ "lu",
388
+ "lv",
389
+ "ly",
390
+ "ma",
391
+ "mc",
392
+ "md",
393
+ "me",
394
+ "mg",
395
+ "mh",
396
+ "mk",
397
+ "ml",
398
+ "mm",
399
+ "mn",
400
+ "mo",
401
+ "mp",
402
+ "mq",
403
+ "mr",
404
+ "ms",
405
+ "mt",
406
+ "mu",
407
+ "mv",
408
+ "mw",
409
+ "mx",
410
+ "my",
411
+ "mz",
412
+ "na",
413
+ "nc",
414
+ "ne",
415
+ "nf",
416
+ "ng",
417
+ "ni",
418
+ "nl",
419
+ "no",
420
+ "np",
421
+ "nr",
422
+ "nu",
423
+ "nz",
424
+ "om",
425
+ "pa",
426
+ "pe",
427
+ "pf",
428
+ "pg",
429
+ "ph",
430
+ "pk",
431
+ "pl",
432
+ "pm",
433
+ "pn",
434
+ "pr",
435
+ "ps",
436
+ "pt",
437
+ "pw",
438
+ "py",
439
+ "qa",
440
+ "re",
441
+ "ro",
442
+ "rs",
443
+ "ru",
444
+ "rw",
445
+ "sa",
446
+ "sb",
447
+ "sc",
448
+ "sd",
449
+ "se",
450
+ "sg",
451
+ "sh",
452
+ "si",
453
+ "sj",
454
+ "sk",
455
+ "sl",
456
+ "sm",
457
+ "sn",
458
+ "so",
459
+ "sr",
460
+ "ss",
461
+ "st",
462
+ "su",
463
+ "sv",
464
+ "sy",
465
+ "sz",
466
+ "tc",
467
+ "td",
468
+ "tf",
469
+ "tg",
470
+ "th",
471
+ "tj",
472
+ "tk",
473
+ "tl",
474
+ "tm",
475
+ "tn",
476
+ "to",
477
+ "tp",
478
+ "tr",
479
+ "tt",
480
+ "tv",
481
+ "tw",
482
+ "tz",
483
+ "ua",
484
+ "ug",
485
+ "uk",
486
+ "us",
487
+ "uy",
488
+ "uz",
489
+ "va",
490
+ "vc",
491
+ "ve",
492
+ "vg",
493
+ "vi",
494
+ "vn",
495
+ "vu",
496
+ "wf",
497
+ "ws",
498
+ "ye",
499
+ "yt",
500
+ "yu",
501
+ "za",
502
+ "zm",
503
+ "zw"
504
+ ], A = { class: "w-full flex flex-col gap-40" }, I = { class: "flex flex-col gap-24" }, R = { class: "w-full flex items-center justify-between h-[36px]" }, T = { class: "w-full flex gap-32" }, E = { class: "relative shrink-0 h-[100px] w-[100px]" }, L = ["src"], D = { class: "absolute -top-8 -right-8 rounded-full h-32 w-32 border border-fm-color-neutral-gray-100 bg-fm-color-neutral-white flex justify-center items-center" }, K = { class: "w-full flex flex-col gap-24 max-w-[400px]" }, M = { class: "text-fm-color-typo-secondary" }, W = /* @__PURE__ */ x({
505
+ __name: "ManagementSettings",
506
+ setup(N) {
507
+ const s = F(), d = b(!0), a = b({
508
+ name: "",
509
+ url: "",
510
+ thumbnail: ""
511
+ }), y = B(
512
+ () => "https://{slug}.feedme.vip".replace("https://{slug}", "")
513
+ );
514
+ function k() {
515
+ P.promise(
516
+ g.setShortUrl(
517
+ a.value.url,
518
+ s.currentBusiness.value.url ?? "",
519
+ s.currentBusiness.value._id
520
+ ).then(async (t) => await g.updateBusinessProfile(
521
+ s.currentBusiness.value._id,
522
+ {
523
+ name: a.value.name,
524
+ url: a.value.url,
525
+ thumbnail: s.currentBusiness.value.thumbnail,
526
+ coverPhoto: s.currentBusiness.value.coverPhoto
527
+ }
528
+ ).then(() => t).catch((e) => {
529
+ throw { message: e.message };
530
+ })).catch((t) => {
531
+ throw { message: t.message };
532
+ }),
533
+ {
534
+ loading: "Saving your settings...",
535
+ success: () => "Settings saved",
536
+ error: (t) => t.message ?? "An error occured when saving your settings, please try again"
537
+ }
538
+ );
539
+ }
540
+ function _(t) {
541
+ var i, o;
542
+ const e = ((i = t.dataTransfer) == null ? void 0 : i.files[0]) ?? ((o = t.target) == null ? void 0 : o.files[0]);
543
+ V.uploadImage(
544
+ s.currentBusiness.value._id,
545
+ `thumbnail/${(/* @__PURE__ */ new Date()).toISOString()}.${e.name.split(".").pop()}`,
546
+ e
547
+ ).then(async (u) => {
548
+ await g.updateBusinessProfile(s.currentBusiness.value._id, {
549
+ name: a.value.name,
550
+ url: a.value.url,
551
+ thumbnail: `https://image.feedme.cc/business/${s.currentBusiness.value._id}/${u.imagePath}`,
552
+ coverPhoto: s.currentBusiness.value.coverPhoto
553
+ }), a.value.thumbnail = `https://image.feedme.cc/business/${s.currentBusiness.value._id}/${u.imagePath}`;
554
+ });
555
+ }
556
+ return j(
557
+ () => s.currentBusiness.value,
558
+ () => {
559
+ var t, e, i;
560
+ a.value.name = ((t = s.currentBusiness.value) == null ? void 0 : t.name) ?? "", a.value.url = ((e = s.currentBusiness.value) == null ? void 0 : e.url) ?? "", a.value.thumbnail = ((i = s.currentBusiness.value) == null ? void 0 : i.thumbnail) ?? "";
561
+ },
562
+ { immediate: !0 }
563
+ ), (t, e) => {
564
+ var f, v;
565
+ const i = m("FmButton"), o = m("FmAvatar"), u = m("FmIcon"), h = m("FmTextField");
566
+ return p(), w("div", A, [
567
+ r("div", I, [
568
+ r("div", R, [
569
+ e[4] || (e[4] = r("h2", { class: "fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, " Business details ", -1)),
570
+ c(i, {
571
+ disabled: d.value,
572
+ label: "Save",
573
+ onClick: k
574
+ }, null, 8, ["disabled"])
575
+ ]),
576
+ r("div", T, [
577
+ r("div", E, [
578
+ a.value.thumbnail ? (p(), w("img", {
579
+ key: 0,
580
+ class: "h-full w-full rounded-full",
581
+ src: l(U)(a.value.thumbnail)
582
+ }, null, 8, L)) : (p(), z(o, {
583
+ key: 1,
584
+ name: ((f = l(s).currentBusiness.value) == null ? void 0 : f.name) ?? "",
585
+ class: "h-full w-full !fm-typo-en-title-md-600 bg-fm-color-primary-oats text-fm-color-primary"
586
+ }, null, 8, ["name"])),
587
+ r("button", D, [
588
+ r("input", {
589
+ class: "absolute top-0 left-0 h-32 w-32 opacity-0 cursor-pointer",
590
+ type: "file",
591
+ accept: "image/*",
592
+ onChange: _
593
+ }, null, 32),
594
+ c(u, {
595
+ size: "md",
596
+ name: "edit",
597
+ color: "neutral-black",
598
+ outline: ""
599
+ })
600
+ ])
601
+ ]),
602
+ r("div", K, [
603
+ c(h, {
604
+ class: "w-full",
605
+ label: "Business name",
606
+ modelValue: a.value.name,
607
+ "onUpdate:modelValue": [
608
+ e[0] || (e[0] = (n) => a.value.name = n),
609
+ e[1] || (e[1] = (n) => d.value = !1)
610
+ ]
611
+ }, null, 8, ["modelValue"]),
612
+ c(h, {
613
+ class: "w-full",
614
+ label: "URL",
615
+ placeholder: (v = l(s).currentBusiness.value) == null ? void 0 : v._id,
616
+ modelValue: a.value.url,
617
+ "onUpdate:modelValue": [
618
+ e[2] || (e[2] = (n) => a.value.url = n),
619
+ e[3] || (e[3] = (n) => d.value = !1)
620
+ ],
621
+ rules: [
622
+ (n) => !n || l(q).test(n) || "Min 6 characters, alphanumeric only",
623
+ (n) => !n || !l(C).includes(n) || "Business URL is reserved"
624
+ ]
625
+ }, {
626
+ append: S(() => [
627
+ r("span", M, $(y.value), 1)
628
+ ]),
629
+ _: 1
630
+ }, 8, ["placeholder", "modelValue", "rules"])
631
+ ])
632
+ ])
633
+ ])
634
+ ]);
635
+ };
636
+ }
637
+ });
638
+ export {
639
+ W as default
640
+ };
@@ -0,0 +1,25 @@
1
+ import { defineComponent as l, resolveComponent as m, openBlock as s, createBlock as p } from "vue";
2
+ const u = /* @__PURE__ */ l({
3
+ __name: "Select",
4
+ props: {
5
+ context: {}
6
+ },
7
+ setup(t) {
8
+ const o = t;
9
+ function n(e) {
10
+ o.context.node.input(e);
11
+ }
12
+ return (e, a) => {
13
+ const c = m("FmSelect");
14
+ return s(), p(c, {
15
+ class: "w-[160px]",
16
+ items: e.context.selectItems,
17
+ "model-value": e.context._value,
18
+ "onUpdate:modelValue": n
19
+ }, null, 8, ["items", "model-value"]);
20
+ };
21
+ }
22
+ });
23
+ export {
24
+ u as default
25
+ };
@@ -0,0 +1,33 @@
1
+ import { defineComponent as m, resolveComponent as u, openBlock as f, createElementBlock as i, createElementVNode as p, createVNode as o, unref as t } from "vue";
2
+ import { useRoute as c, useRouter as d, RouterView as b } from "vue-router";
3
+ const g = { class: "h-full w-full p-24 bg-fm-color-neutral-white overflow-auto flex flex-col gap-24" }, R = /* @__PURE__ */ m({
4
+ __name: "SettingsView",
5
+ setup(_) {
6
+ const l = c(), s = d(), n = [
7
+ {
8
+ label: "Assets",
9
+ value: "settings-assets"
10
+ },
11
+ {
12
+ label: "Management",
13
+ value: "settings-management"
14
+ }
15
+ ];
16
+ return (v, e) => {
17
+ const a = u("FmTabs");
18
+ return f(), i("div", g, [
19
+ e[1] || (e[1] = p("h1", { class: "fm-typo-en-title-md-600 text-fm-color-typo-primary" }, "Settings", -1)),
20
+ o(a, {
21
+ class: "border-b border-fm-color-neutral-gray-100 w-full",
22
+ items: n,
23
+ "model-value": t(l).name,
24
+ "onUpdate:modelValue": e[0] || (e[0] = (r) => t(s).push({ name: r }))
25
+ }, null, 8, ["model-value"]),
26
+ o(t(b), { class: "w-fit" })
27
+ ]);
28
+ };
29
+ }
30
+ });
31
+ export {
32
+ R as default
33
+ };
@@ -0,0 +1,29 @@
1
+ import { defineComponent as l, computed as c, resolveComponent as d, openBlock as s, createBlock as u } from "vue";
2
+ const m = /* @__PURE__ */ l({
3
+ __name: "StepperField",
4
+ props: {
5
+ context: {}
6
+ },
7
+ setup(n) {
8
+ const e = n;
9
+ function o(t) {
10
+ e.context.node.input(`${t}${e.context.suffix}`);
11
+ }
12
+ const p = c(() => +e.context._value.replace(e.context.suffix, ""));
13
+ return (t, i) => {
14
+ const a = d("FmStepperField");
15
+ return s(), u(a, {
16
+ class: "max-w-[160px]",
17
+ "model-value": p.value,
18
+ disabled: t.context.disabled ?? !1,
19
+ "onUpdate:modelValue": o,
20
+ "append-text": t.context.suffix,
21
+ step: 1,
22
+ "max-fraction-digits": 0
23
+ }, null, 8, ["model-value", "disabled", "append-text"]);
24
+ };
25
+ }
26
+ });
27
+ export {
28
+ m as default
29
+ };