@feedmepos/mf-brand-app-builder 0.5.46-prod → 0.5.47-dev.0
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/README.md +14 -0
- package/dist/App-CscQqcFq.js +163 -0
- package/dist/{AssetsSettings-Do8rt2sU.js → AssetsSettings-DtZ6goQl.js} +22 -22
- package/dist/{BrandkitView-nfDiG0HS.js → BrandkitView-DUlf5K3i.js} +8 -8
- package/dist/{BuilderView-D6aesdSu.js → BuilderView-DLcKTOoe.js} +7 -7
- package/dist/{CredentialSettings-BB_Yroul.js → CredentialSettings-3eVBw1x8.js} +1 -1
- package/dist/{ImageUpload-BZj85a8g.js → ImageUpload-Bm2BY6Y1.js} +8 -8
- package/dist/{LinkButton-DNXBKGCn.js → LinkButton-De-YNclu.js} +1 -1
- package/dist/{ListRepeater-tz5QcoGP.js → ListRepeater-Cuo0XXKs.js} +1 -1
- package/dist/{ManagementSettings-CjsGetkI.js → ManagementSettings-CWAKkmbz.js} +6 -6
- package/dist/{ProjectView-Dc-furGA.js → ProjectView-DrgxaTFz.js} +3 -3
- package/dist/{app-MFB1wiue.js → app-Doep9hzN.js} +26 -15
- package/dist/app.js +1 -1
- package/dist/client/components/src/components/atoms/CircularProgress.vue.d.ts +1 -1
- package/dist/client/merchant/src/app.d.ts +11 -0
- package/dist/client/merchant/src/composables/miniprogramPortalEntry.d.ts +12 -0
- package/dist/{dayjs.min-Ctmrwhx3.js → dayjs.min-CKlJsMOX.js} +1 -1
- package/dist/{image-S7-2rbQS.js → image-D_Djf1PS.js} +7 -7
- package/dist/{index-BpYD24Jn.js → index-BA2J-Ffh.js} +1 -1
- package/dist/{index-CPs0rWCO.js → index-Bk6TOZrx.js} +15 -15
- package/dist/index-CVVQJJYY.js +134 -0
- package/dist/{index-C6_vWPi0.js → index-D0LOMBBD.js} +27 -27
- package/dist/{main-LDiBfnFA.js → main-CiLAou6A.js} +4 -4
- package/dist/package.json +1 -1
- package/dist/style.css +1 -1
- package/dist/{useBusinessFeatureFlag-Dw4hpcYo.js → useBusinessFeatureFlag-CEkj13Xd.js} +1 -1
- package/package.json +1 -1
- package/dist/App-DD3xAvwR.js +0 -121
- package/dist/index-CP6_oC8N.js +0 -134
package/README.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
This project is a Vue 3-based application for merchants to manage their business mini-programs.
|
|
4
4
|
|
|
5
|
+
## Independent Mini Program v2 entry
|
|
6
|
+
|
|
7
|
+
The `order_miniprogram_v2` environment flag still controls visibility of the
|
|
8
|
+
Mini Program v2 menu item. It opens the independent `/miniprogram-v2` ecosystem
|
|
9
|
+
in the same tab, preserving the selected business, country and restaurant.
|
|
10
|
+
Standalone merchant development falls back to the matching environment's
|
|
11
|
+
Portal URL when the host route is absent.
|
|
12
|
+
|
|
13
|
+
Keep `/brand/miniprogram-workspace` as a permission-gated compatibility route:
|
|
14
|
+
the runtime `MiniprogramWorkspace` export redirects historical links to the new
|
|
15
|
+
workspace. The v2 microfrontend owns this redirect and its own sidebar, while
|
|
16
|
+
the Portal host continues to own authentication, merchant selection and the
|
|
17
|
+
top bar. Brand Kit, v1 Builder and legacy settings remain available here.
|
|
18
|
+
|
|
5
19
|
## Recommended IDE Setup
|
|
6
20
|
|
|
7
21
|
[VSCode](https://code.visualstudio.com/) + [Vue - Official](https://marketplace.visualstudio.com/items?itemName=Vue.volar) + [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { defineComponent as w, computed as v, resolveComponent as h, createElementBlock as p, openBlock as l, Fragment as b, renderList as F, createBlock as k, unref as f, createVNode as c, withCtx as x, ref as P, onMounted as R, onBeforeMount as S, watch as C, createElementVNode as _, createCommentVNode as N } from "vue";
|
|
2
|
+
import { useCoreStore as B } from "@feedmepos/mf-common";
|
|
3
|
+
import { V as M } from "./vue-sonner-CBFYmm8_.js";
|
|
4
|
+
import { useRoute as $, useRouter as V, RouterLink as E, RouterView as L } from "vue-router";
|
|
5
|
+
import { u as I, i as q } from "./useBusinessFeatureFlag-CEkj13Xd.js";
|
|
6
|
+
import { g as z } from "./index-D0LOMBBD.js";
|
|
7
|
+
import { u as A } from "./index-BA2J-Ffh.js";
|
|
8
|
+
function O(g, e, u) {
|
|
9
|
+
const r = {};
|
|
10
|
+
for (const o of ["businessId", "country", "restaurantId"]) {
|
|
11
|
+
const i = e[o] ?? g[o];
|
|
12
|
+
typeof i == "string" && i && (r[o] = i);
|
|
13
|
+
}
|
|
14
|
+
const a = u === "prod" ? "https://portal.feedme.cc" : "https://portal.feedmedev.cc", t = new URLSearchParams(r).toString();
|
|
15
|
+
return {
|
|
16
|
+
name: "miniprogram-v2-ecosystem",
|
|
17
|
+
query: r,
|
|
18
|
+
href: `${a}/miniprogram-v2${t ? `?${t}` : ""}`
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
const U = { class: "shrink-0 w-64 h-full bg-fm-color-neutral-white border-r border-fm-color-neutral-gray-100 p-[10px] flex flex-col gap-12" }, j = ["href"], D = /* @__PURE__ */ w({
|
|
22
|
+
__name: "NavigationSidebar",
|
|
23
|
+
setup(g) {
|
|
24
|
+
const e = $(), u = V(), r = B(), a = v(
|
|
25
|
+
() => {
|
|
26
|
+
var s, m;
|
|
27
|
+
return O(
|
|
28
|
+
e.query,
|
|
29
|
+
{
|
|
30
|
+
businessId: (s = r.currentBusiness.value) == null ? void 0 : s._id,
|
|
31
|
+
country: r.currentCountry.value,
|
|
32
|
+
restaurantId: (m = r.currentRestaurant.value) == null ? void 0 : m._id
|
|
33
|
+
},
|
|
34
|
+
r.namespace.value
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
), t = I(
|
|
38
|
+
"order_miniprogram_v2"
|
|
39
|
+
), o = [
|
|
40
|
+
{
|
|
41
|
+
name: "brandkit",
|
|
42
|
+
icon: "style"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "projects",
|
|
46
|
+
icon: "folder"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: "builder",
|
|
50
|
+
icon: "build"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "miniprogram-workspace",
|
|
54
|
+
icon: "open_in_new",
|
|
55
|
+
flag: t
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "settings",
|
|
59
|
+
icon: "settings"
|
|
60
|
+
}
|
|
61
|
+
], i = v(
|
|
62
|
+
() => o.filter((s) => !s.flag || s.flag.value)
|
|
63
|
+
), d = v(
|
|
64
|
+
() => (s) => e.matched.map((m) => m.name).includes(s)
|
|
65
|
+
);
|
|
66
|
+
return (s, m) => {
|
|
67
|
+
const y = h("FmButton");
|
|
68
|
+
return l(), p("div", U, [
|
|
69
|
+
(l(!0), p(b, null, F(i.value, (n) => (l(), p("div", {
|
|
70
|
+
key: n.name
|
|
71
|
+
}, [
|
|
72
|
+
n.name === "miniprogram-workspace" && !f(u).hasRoute(a.value.name) ? (l(), p("a", {
|
|
73
|
+
key: 0,
|
|
74
|
+
href: a.value.href,
|
|
75
|
+
title: "New Mini Program ↗",
|
|
76
|
+
"aria-label": "New Mini Program"
|
|
77
|
+
}, [
|
|
78
|
+
c(y, {
|
|
79
|
+
class: "w-[44px] !h-[44px]",
|
|
80
|
+
size: "lg",
|
|
81
|
+
icon: n.icon
|
|
82
|
+
}, null, 8, ["icon"])
|
|
83
|
+
], 8, j)) : (l(), k(f(E), {
|
|
84
|
+
key: 1,
|
|
85
|
+
to: n.name === "miniprogram-workspace" ? { name: a.value.name, query: a.value.query } : { name: n.name },
|
|
86
|
+
title: n.name === "miniprogram-workspace" ? "New Mini Program ↗" : void 0,
|
|
87
|
+
"aria-label": n.name === "miniprogram-workspace" ? "New Mini Program" : void 0
|
|
88
|
+
}, {
|
|
89
|
+
default: x(() => [
|
|
90
|
+
c(y, {
|
|
91
|
+
class: "w-[44px] !h-[44px]",
|
|
92
|
+
size: "lg",
|
|
93
|
+
icon: n.icon,
|
|
94
|
+
"icon-color": d.value(n.name) ? "primary" : "neutral-gray-400",
|
|
95
|
+
"bg-color": d.value(n.name) ? "system-warning-100" : "neutral-white"
|
|
96
|
+
}, null, 8, ["icon", "icon-color", "bg-color"])
|
|
97
|
+
]),
|
|
98
|
+
_: 2
|
|
99
|
+
}, 1032, ["to", "title", "aria-label"]))
|
|
100
|
+
]))), 128))
|
|
101
|
+
]);
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
}), G = { class: "relative h-[calc(100vh-56px)] w-screen" }, H = { class: "flex w-full h-full" }, Z = /* @__PURE__ */ w({
|
|
105
|
+
__name: "App",
|
|
106
|
+
setup(g) {
|
|
107
|
+
const e = B(), u = A(), r = P(!0);
|
|
108
|
+
async function a() {
|
|
109
|
+
var t;
|
|
110
|
+
r.value = !0, (t = e.currentBusiness.value) != null && t._id && (await z(), await u.getPremiumStatus(e.currentBusiness.value._id), r.value = !1);
|
|
111
|
+
}
|
|
112
|
+
return R(async () => {
|
|
113
|
+
console.log(
|
|
114
|
+
`Running v0.5.47-dev.0 on ${e.namespace.value}`
|
|
115
|
+
), e.hideSidebar.value = !0;
|
|
116
|
+
const t = e.namespace.value === "prod" ? "prod" : "dev";
|
|
117
|
+
q(t).catch(
|
|
118
|
+
(o) => console.warn("[FeatureFlag] init failed:", o)
|
|
119
|
+
);
|
|
120
|
+
}), S(() => {
|
|
121
|
+
e.hideSidebar.value = !1;
|
|
122
|
+
}), C(
|
|
123
|
+
() => e.currentBusiness.value,
|
|
124
|
+
() => a(),
|
|
125
|
+
{ immediate: !0 }
|
|
126
|
+
), (t, o) => {
|
|
127
|
+
const i = h("FmCircularProgress"), d = h("FmOverlay");
|
|
128
|
+
return l(), p(b, null, [
|
|
129
|
+
o[0] || (o[0] = _("link", {
|
|
130
|
+
href: "https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,400,0..1,0",
|
|
131
|
+
rel: "stylesheet"
|
|
132
|
+
}, null, -1)),
|
|
133
|
+
_("div", G, [
|
|
134
|
+
c(f(M), {
|
|
135
|
+
position: "top-right",
|
|
136
|
+
"rich-colors": "",
|
|
137
|
+
"close-button": "",
|
|
138
|
+
duration: 3e3
|
|
139
|
+
}),
|
|
140
|
+
r.value ? (l(), k(d, {
|
|
141
|
+
key: 0,
|
|
142
|
+
"dismiss-away": !1,
|
|
143
|
+
"prevent-backdrop-event": !1,
|
|
144
|
+
transparent: !1,
|
|
145
|
+
"center-content": ""
|
|
146
|
+
}, {
|
|
147
|
+
default: x(() => [
|
|
148
|
+
c(i, { size: "xxl" })
|
|
149
|
+
]),
|
|
150
|
+
_: 1
|
|
151
|
+
})) : N("", !0),
|
|
152
|
+
_("div", H, [
|
|
153
|
+
c(D),
|
|
154
|
+
c(f(L), { class: "flex-1" })
|
|
155
|
+
])
|
|
156
|
+
])
|
|
157
|
+
], 64);
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
export {
|
|
162
|
+
Z as default
|
|
163
|
+
};
|