@feedmepos/mf-miniprogram-v2 0.2.8-dev.8 → 0.2.8-dev.9

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 (26) hide show
  1. package/dist/{App-CulUM6bp.js → App-Ck_p8Anr.js} +256 -253
  2. package/dist/{ControlPlaneView-BrIrCpIX.js → ControlPlaneView-CqTLqklv.js} +8158 -7868
  3. package/dist/{EcosystemView-CVunQHEs.js → EcosystemView-Bt-UdWfQ.js} +3 -3
  4. package/dist/{MobileProjectDialog-C4wvWZ95.js → MobileProjectDialog-DAYQdrCY.js} +247 -236
  5. package/dist/{MobileProjectsView-CZVTbgqX.js → MobileProjectsView-z7GucfWB.js} +63 -60
  6. package/dist/ModuleCenterView-t8rhd419.js +283 -0
  7. package/dist/ModuleDetailView-C2TJToR7.js +296 -0
  8. package/dist/{PagesView-DgfNxkGp.js → PagesView-bXfOrylf.js} +2 -2
  9. package/dist/{PlatformUnavailableView-ChSD6P3O.js → PlatformUnavailableView-CkKpF-bi.js} +1 -1
  10. package/dist/PortalSettingsView-D_2Gd3-Y.js +123 -0
  11. package/dist/{TemplateCenterView-BPJSWb12.js → TemplateCenterView-DEN51nfK.js} +2 -2
  12. package/dist/{WorkspaceEntryView-C4MViyFH.js → WorkspaceEntryView-SLqO3Mi4.js} +2 -2
  13. package/dist/app.js +14 -14
  14. package/dist/{adminAccess-DdZ2qPdx.js → localPreference-Do4VKtxT.js} +34 -34
  15. package/dist/package.json +1 -1
  16. package/dist/{portalContext-DuVkhksq.js → portalContext-BeKN8Bcx.js} +1 -1
  17. package/dist/portalNavigation-DDMi3QTt.js +43 -0
  18. package/dist/{routes-CK4kOaoY.js → routes-B9oMJsaM.js} +2 -4
  19. package/dist/style.css +1 -1
  20. package/dist/useModuleCatalog-Daw8KA--.js +147 -0
  21. package/package.json +1 -1
  22. package/dist/ModuleCenterView-D0Bv4sKT.js +0 -165
  23. package/dist/ModuleDetailView-Ue3oCNxk.js +0 -189
  24. package/dist/PortalSettingsView-DBrKVWjp.js +0 -233
  25. package/dist/portalNavigation-L5VwKlps.js +0 -42
  26. package/dist/useModuleCatalog-a4dKLnlS.js +0 -124
@@ -1,233 +0,0 @@
1
- import { defineComponent as P, ref as l, onMounted as x, resolveComponent as F, openBlock as o, createElementBlock as r, createElementVNode as e, Fragment as M, renderList as B, withDirectives as A, vModelRadio as N, toDisplayString as f, createCommentVNode as b, createBlock as R, computed as w, onScopeDispose as U, createVNode as V, unref as k } from "vue";
2
- import { useRoute as E } from "vue-router";
3
- import { e as T, a as L } from "./index-CIJWcl_6.js";
4
- import { c as $, e as C, m as D } from "./controlPlane-DR5ykj4d.js";
5
- import { useCoreStore as O } from "@feedmepos/mf-common";
6
- import { u as H } from "./portalContext-DuVkhksq.js";
7
- import { b as j } from "./portalNavigation-L5VwKlps.js";
8
- import { a as q } from "./routes-CK4kOaoY.js";
9
- import { _ as Q } from "./_plugin-vue_export-helper-CHgC5LLL.js";
10
- const z = { class: "portal-section qr-routing" }, J = {
11
- key: 0,
12
- role: "status"
13
- }, K = ["disabled"], Y = ["value"], G = { class: "portal-description" }, W = {
14
- key: 2,
15
- class: "portal-error",
16
- role: "alert"
17
- }, X = {
18
- key: 3,
19
- class: "portal-notice",
20
- role: "status"
21
- }, Z = { class: "qr-routing__actions" }, ee = /* @__PURE__ */ P({
22
- __name: "QrRoutingSetting",
23
- props: {
24
- businessId: {}
25
- },
26
- setup(I) {
27
- const u = I, i = l("default"), v = l("default"), g = l(!0), d = l(!1), c = l(!1), n = l(""), m = l(""), h = [
28
- {
29
- value: "default",
30
- label: "Follow FeedMe’s rollout",
31
- description: "Table QR codes move to this app when FeedMe switches your region over."
32
- },
33
- { value: "app", label: "This app", description: "Table QR codes open this app at your business link." },
34
- {
35
- value: "v3",
36
- label: "The current ordering page",
37
- description: "Table QR codes keep opening the ordering page customers use today."
38
- }
39
- ];
40
- async function _() {
41
- g.value = !0, n.value = "";
42
- try {
43
- const a = await $(q.qrRouting(u.businessId));
44
- i.value = v.value = a.qrTarget ?? "default", d.value = !0;
45
- } catch (a) {
46
- n.value = C(a);
47
- } finally {
48
- g.value = !1;
49
- }
50
- }
51
- async function y() {
52
- if (!(!d.value || c.value || i.value === v.value)) {
53
- c.value = !0, n.value = "", m.value = "";
54
- try {
55
- const a = await $(q.qrRouting(u.businessId), {
56
- method: "PUT",
57
- body: JSON.stringify({ qrTarget: i.value === "default" ? null : i.value })
58
- });
59
- i.value = v.value = a.qrTarget ?? "default", m.value = "Saved. Table QR codes follow the new setting within about five minutes.";
60
- } catch (a) {
61
- n.value = C(a);
62
- } finally {
63
- c.value = !1;
64
- }
65
- }
66
- }
67
- return x(() => void _()), (a, t) => {
68
- const s = F("FmButton");
69
- return o(), r("section", z, [
70
- t[2] || (t[2] = e("h2", null, "Table QR codes", -1)),
71
- t[3] || (t[3] = e("p", { class: "portal-description" }, "Choose where customers land when they scan a table QR code.", -1)),
72
- g.value ? (o(), r("p", J, "Loading…")) : d.value ? (o(), r("fieldset", {
73
- key: 1,
74
- class: "qr-routing__options",
75
- disabled: c.value
76
- }, [
77
- t[1] || (t[1] = e("legend", { class: "qr-routing__legend" }, "Table QR codes open", -1)),
78
- (o(), r(M, null, B(h, (p) => e("label", {
79
- key: p.value,
80
- class: "qr-routing__option"
81
- }, [
82
- A(e("input", {
83
- "onUpdate:modelValue": t[0] || (t[0] = (S) => i.value = S),
84
- type: "radio",
85
- name: "qr-routing",
86
- value: p.value
87
- }, null, 8, Y), [
88
- [N, i.value]
89
- ]),
90
- e("span", null, [
91
- e("strong", null, f(p.label), 1),
92
- e("span", G, f(p.description), 1)
93
- ])
94
- ])), 64))
95
- ], 8, K)) : b("", !0),
96
- n.value ? (o(), r("p", W, f(n.value), 1)) : b("", !0),
97
- m.value ? (o(), r("p", X, f(m.value), 1)) : b("", !0),
98
- e("footer", Z, [
99
- !d.value && !g.value ? (o(), R(s, {
100
- key: 0,
101
- label: "Retry",
102
- variant: "secondary",
103
- onClick: _
104
- })) : (o(), R(s, {
105
- key: 1,
106
- label: "Save",
107
- loading: c.value,
108
- disabled: g.value || !d.value || i.value === v.value,
109
- onClick: y
110
- }, null, 8, ["loading", "disabled"]))
111
- ])
112
- ]);
113
- };
114
- }
115
- }), se = /* @__PURE__ */ Q(ee, [["__scopeId", "data-v-5fbd8580"]]), te = { class: "portal-page" }, oe = { class: "portal-page-inner settings-page" }, ae = { class: "portal-page-heading" }, ne = ["href"], le = {
116
- key: 0,
117
- class: "portal-error",
118
- role: "alert"
119
- }, re = { class: "portal-section" }, ie = { class: "settings-value" }, ue = { class: "portal-section" }, de = { class: "settings-icon-row" }, ce = { class: "settings-icon" }, pe = ["src"], ve = { class: "portal-section" }, ge = { class: "settings-logo" }, me = ["src"], fe = /* @__PURE__ */ P({
120
- __name: "PortalSettingsView",
121
- setup(I) {
122
- const u = H(), i = E(), v = O(), g = w(
123
- () => {
124
- var t;
125
- return new URL(
126
- j({
127
- ...i.query,
128
- businessId: u.businessId.value,
129
- country: v.currentCountry.value ?? null,
130
- restaurantId: ((t = v.currentRestaurant.value) == null ? void 0 : t._id) ?? null
131
- }),
132
- T("fmmf:dev") === "dev" ? "https://portal.feedmedev.cc" : "https://portal.feedme.cc"
133
- ).href;
134
- }
135
- ), d = l(null), c = l(!0), n = l(null), m = l(!1), h = L(T("fmmf:dev")).apiOrigin, _ = w(() => `${h}/metadata/${u.businessId.value}/pwa-512x512.png`), y = w(() => {
136
- var t;
137
- return (t = D()) == null ? void 0 : t.thumbnail;
138
- }), a = new AbortController();
139
- return x(async () => {
140
- var t;
141
- try {
142
- const s = await fetch(`${h}/metadata/${u.businessId.value}/config`, {
143
- signal: AbortSignal.any([a.signal, AbortSignal.timeout(15e3)])
144
- });
145
- if (s.status === 404) return;
146
- if (!s.ok) throw new Error(`Could not load app assets (HTTP ${s.status})`);
147
- const p = await s.json();
148
- d.value = ((t = p.pwaConfig) == null ? void 0 : t.name) ?? null;
149
- } catch (s) {
150
- a.signal.aborted || (n.value = C(s));
151
- } finally {
152
- c.value = !1;
153
- }
154
- }), U(() => a.abort()), (t, s) => {
155
- const p = F("FmIcon");
156
- return o(), r("div", te, [
157
- e("div", oe, [
158
- e("header", ae, [
159
- s[1] || (s[1] = e("div", null, [
160
- e("p", { class: "portal-eyebrow" }, "Your app identity"),
161
- e("h1", null, "Settings")
162
- ], -1)),
163
- e("a", {
164
- href: g.value,
165
- class: "portal-link-button",
166
- target: "_blank",
167
- rel: "noopener"
168
- }, "Manage assets in original Portal ↗", 8, ne)
169
- ]),
170
- s[10] || (s[10] = e("div", { class: "settings-tabs" }, [
171
- e("span", null, "Assets")
172
- ], -1)),
173
- s[11] || (s[11] = e("p", { class: "portal-notice" }, " App assets are still managed by the original Mini Program. Edit them there to preserve existing subscription rules and shared business settings. ", -1)),
174
- n.value ? (o(), r("p", le, f(n.value), 1)) : b("", !0),
175
- e("section", re, [
176
- s[2] || (s[2] = e("h2", null, "App name", -1)),
177
- s[3] || (s[3] = e("p", { class: "portal-description" }, "Shown under the icon on your customer’s home screen.", -1)),
178
- e("p", ie, f(c.value ? "Loading…" : n.value ? "Unavailable" : d.value || "Not configured"), 1),
179
- s[4] || (s[4] = e("p", { class: "portal-description" }, " The original Portal applies the “FeedMe x” naming rule for non-Premium businesses. ", -1))
180
- ]),
181
- e("section", ue, [
182
- s[7] || (s[7] = e("div", { class: "portal-section-head" }, [
183
- e("div", null, [
184
- e("h2", null, "App icon"),
185
- e("p", { class: "portal-description" }, "One square image for the home screen.")
186
- ])
187
- ], -1)),
188
- e("div", de, [
189
- e("div", ce, [
190
- m.value ? (o(), r(M, { key: 1 }, [
191
- V(p, {
192
- name: "image",
193
- size: "xl"
194
- }),
195
- s[5] || (s[5] = e("span", null, "No icon available", -1))
196
- ], 64)) : (o(), r("img", {
197
- key: 0,
198
- src: _.value,
199
- alt: "Current app icon",
200
- onError: s[0] || (s[0] = (S) => m.value = !0)
201
- }, null, 40, pe))
202
- ]),
203
- s[6] || (s[6] = e("div", null, [
204
- e("h3", null, "Icon guidelines"),
205
- e("p", { class: "portal-description" }, " Use a square image, ideally at least 1024 × 1024 pixels. Keep the important artwork inside the central 4/5 safe area. "),
206
- e("p", { class: "portal-description" }, "Changes to this shared icon are not part of a release build.")
207
- ], -1))
208
- ])
209
- ]),
210
- e("section", ve, [
211
- s[8] || (s[8] = e("h2", null, "Business branding", -1)),
212
- e("div", ge, [
213
- y.value ? (o(), r("img", {
214
- key: 0,
215
- src: y.value,
216
- alt: "Business logo"
217
- }, null, 8, me)) : b("", !0),
218
- e("p", null, f(k(u).businessName.value), 1)
219
- ]),
220
- s[9] || (s[9] = e("p", { class: "portal-description" }, " Cover images and other shared business assets remain available in the original Portal. ", -1))
221
- ]),
222
- k(u).businessId.value ? (o(), R(se, {
223
- key: 1,
224
- "business-id": k(u).businessId.value
225
- }, null, 8, ["business-id"])) : b("", !0)
226
- ])
227
- ]);
228
- };
229
- }
230
- }), Se = /* @__PURE__ */ Q(fe, [["__scopeId", "data-v-8ba9debf"]]);
231
- export {
232
- Se as default
233
- };
@@ -1,42 +0,0 @@
1
- function a(r) {
2
- return r === "releases" || r === "sessions" ? r : "workspace";
3
- }
4
- function o(r) {
5
- const { view: e, tpl: t, setup: n, ...s } = r;
6
- return s;
7
- }
8
- function i(r, e, t, n = {}) {
9
- return {
10
- name: "miniprogram-v2-project",
11
- params: { projectId: r, view: e === "workspace" ? void 0 : e },
12
- query: {
13
- ...o(t),
14
- ...n.templateEditing ? { tpl: "1" } : {},
15
- ...n.setup ? { setup: "1" } : {}
16
- }
17
- };
18
- }
19
- function c(r, e, t) {
20
- if (!e || !t || e === t || r.name !== "miniprogram-v2-project" || r.query.tpl === "1") return null;
21
- const n = o(r.query);
22
- return typeof n.businessId == "string" && (n.businessId = t), { name: "miniprogram-v2-mobile-projects", query: n };
23
- }
24
- function p(r, e) {
25
- return e ? i(String(r.params.projectId), a(r.params.view), r.query) : { name: "miniprogram-v2-mobile-projects", query: o(r.query) };
26
- }
27
- function u(r, e = "settings") {
28
- const t = new URLSearchParams();
29
- for (const n of ["businessId", "country", "restaurantId"]) {
30
- const s = r[n];
31
- typeof s == "string" && t.set(n, s);
32
- }
33
- return `/brand/${e}${t.size ? `?${t}` : ""}`;
34
- }
35
- export {
36
- a,
37
- u as b,
38
- c as e,
39
- p as l,
40
- o as p,
41
- i as w
42
- };
@@ -1,124 +0,0 @@
1
- import { defineComponent as x, resolveComponent as p, openBlock as u, createElementBlock as h, createVNode as E, createElementVNode as P, normalizeClass as F, toDisplayString as v, createCommentVNode as g, createBlock as L, shallowReadonly as r, ref as s } from "vue";
2
- import { a as w } from "./routes-CK4kOaoY.js";
3
- import { c as M, e as y, f as $ } from "./controlPlane-DR5ykj4d.js";
4
- const I = { class: "flex min-h-0 flex-1 flex-col items-center justify-center gap-8 p-24 text-center" }, T = {
5
- key: 0,
6
- class: "m-0 max-w-[46ch] fm-typo-en-body-sm-400 text-portal-text-muted"
7
- }, j = /* @__PURE__ */ x({
8
- __name: "ModuleEmptyState",
9
- props: {
10
- icon: {},
11
- title: {},
12
- message: {},
13
- actionLabel: {},
14
- tone: {}
15
- },
16
- emits: ["action"],
17
- setup(e) {
18
- return (t, o) => {
19
- const n = p("FmIcon"), l = p("FmButton");
20
- return u(), h("div", I, [
21
- E(n, {
22
- name: e.icon,
23
- size: "xl",
24
- color: e.tone === "error" ? "typo-warning" : "neutral-gray-300"
25
- }, null, 8, ["name", "color"]),
26
- P("p", {
27
- class: F(["m-0 fm-typo-en-body-md-600", e.tone === "error" ? "text-fm-color-typo-warning" : "text-fm-color-typo-secondary"])
28
- }, v(e.title), 3),
29
- e.message ? (u(), h("p", T, v(e.message), 1)) : g("", !0),
30
- e.actionLabel ? (u(), L(l, {
31
- key: 1,
32
- size: "md",
33
- variant: "secondary",
34
- label: e.actionLabel,
35
- onClick: o[0] || (o[0] = (c) => t.$emit("action"))
36
- }, null, 8, ["label"])) : g("", !0)
37
- ]);
38
- };
39
- }
40
- }), b = ["tier", "slot"];
41
- function C(e, t) {
42
- return t === "tier" ? [e.category] : e.slot ? [e.slot] : [];
43
- }
44
- function z(e) {
45
- return b.map((t) => ({
46
- kind: t,
47
- values: [...new Set(e.flatMap((o) => C(o, t)))].sort((o, n) => o.localeCompare(n))
48
- })).filter((t) => t.values.length > 0);
49
- }
50
- function R(e, t) {
51
- const o = e.filter((n) => !(n.kind === t.kind && n.value === t.value));
52
- return o.length === e.length ? [...e, t] : o;
53
- }
54
- function B(e, t) {
55
- return b.every((o) => {
56
- const n = t.filter((c) => c.kind === o);
57
- if (!n.length) return !0;
58
- const l = C(e, o);
59
- return n.some((c) => l.includes(c.value));
60
- });
61
- }
62
- function G(e, t, o = []) {
63
- const n = t.trim().toLowerCase();
64
- return e.filter((l) => B(l, o) ? n ? [l.name, l.description ?? "", l.slot ?? "", ...l.labels ?? []].join(" ").toLowerCase().includes(n) : !0 : !1);
65
- }
66
- function O(e) {
67
- const t = e.slot ? ` It is published to fill the ${e.slot} slot.` : "";
68
- return `Use the block-swap skill. Put the library module ${e.id} on the page, replacing whatever currently fills its slot.${t} Its source is already in this workspace at src/components/library/${e.name}/. Copy that directory to src/components/blocks/${e.name}/ and point the view there — the library directory is delivered per workspace and is not committed, so a view importing from it builds in the workspace and fails the release build. Tell me which page you changed.`;
69
- }
70
- function U(e, t) {
71
- if (!e.includes("</head>")) return e;
72
- const o = JSON.stringify(t).replace(/</g, "\\u003c");
73
- return e.replace("</head>", `<script>window.__FM_PREVIEW_MODULE__=${o}<\/script></head>`);
74
- }
75
- const i = s(null), m = s(null), d = s(!1), k = s(null), f = s(null);
76
- let a = null;
77
- async function D() {
78
- m.value = null, d.value = !1;
79
- try {
80
- const e = await M(w.componentLibraryCatalog());
81
- i.value = e.components ?? [];
82
- } catch (e) {
83
- const t = y(e);
84
- i.value = [], t.includes("no component library has been published") ? d.value = !0 : m.value = t || "Could not load the module library.";
85
- }
86
- }
87
- async function N() {
88
- f.value = null;
89
- try {
90
- k.value = await $(w.componentLibraryPreview());
91
- } catch (e) {
92
- f.value = y(e) || "Could not load the preview document.";
93
- }
94
- }
95
- function A() {
96
- function e(o = !1) {
97
- return !o && (i.value !== null || a) ? a ?? Promise.resolve() : (a = Promise.all([D(), N()]).then(() => {
98
- }).finally(() => {
99
- a = null;
100
- }), a);
101
- }
102
- function t(o) {
103
- var n;
104
- return ((n = i.value) == null ? void 0 : n.find((l) => l.name === o)) ?? null;
105
- }
106
- return {
107
- entries: r(i),
108
- loadError: r(m),
109
- unpublished: r(d),
110
- previewDocument: r(k),
111
- previewError: r(f),
112
- load: e,
113
- find: t
114
- };
115
- }
116
- export {
117
- j as _,
118
- z as c,
119
- G as f,
120
- U as i,
121
- O as m,
122
- R as t,
123
- A as u
124
- };