@feedmepos/mf-miniprogram-v2 0.2.10 → 0.2.11-dev.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.
Files changed (26) hide show
  1. package/dist/{App-DDgjAONU.js → App-C0WpITly.js} +3 -3
  2. package/dist/{BrandFontPicker-BVfiQBLP.js → BrandFontPicker-CixDQhv-.js} +1 -1
  3. package/dist/{BrandKitView-BLH-bglF.js → BrandKitView-C0s8XmOA.js} +2 -2
  4. package/dist/{ControlPlaneView-C3wvdkj9.js → ControlPlaneView-BUzkjvFu.js} +9 -9
  5. package/dist/{EcosystemView-BY2B_LEL.js → EcosystemView-Bp52MYSA.js} +5 -5
  6. package/dist/{LegacyWorkspaceEntry-DrL-C0xx.js → LegacyWorkspaceEntry-IRMa-8U4.js} +2 -2
  7. package/dist/{MobileProjectDialog-DsXmMUHH.js → MobileProjectDialog-CsezBOzx.js} +2 -2
  8. package/dist/{MobileProjectsView-CMj0mnZh.js → MobileProjectsView-BX7HZv_b.js} +4 -4
  9. package/dist/{ModuleCenterView-DG7ea0p5.js → ModuleCenterView-Bus9dN9-.js} +1 -1
  10. package/dist/{ModuleDetailView-DweKadjB.js → ModuleDetailView-C0IVjslg.js} +1 -1
  11. package/dist/{PagesView-W8d-G5HZ.js → PagesView-BYyOLtCz.js} +1 -1
  12. package/dist/PortalSettingsView-fR4yOFsv.js +1847 -0
  13. package/dist/{TemplateCenterView-BH3C5h50.js → TemplateCenterView-BYb1WIgm.js} +2 -2
  14. package/dist/{WorkspaceEntryView-Dx8stquZ.js → WorkspaceEntryView-CcohqnAX.js} +1 -1
  15. package/dist/app.js +11 -11
  16. package/dist/{controlPlane-CiuLVd7s.js → controlPlane-DffMY39e.js} +51 -52
  17. package/dist/index-DB33ug2V.js +125 -0
  18. package/dist/{localPreference-Cdti49bE.js → localPreference-DJ1WUOiz.js} +2 -2
  19. package/dist/package.json +2 -1
  20. package/dist/{portalContext-CCW6O5KF.js → portalContext-MKst4jC0.js} +2 -2
  21. package/dist/style.css +1 -1
  22. package/dist/{useBrandKit-fmzepsFY.js → useBrandKit-ChIpWVpr.js} +3 -3
  23. package/dist/{useModuleCatalog-C7kO_Rjg.js → useModuleCatalog-CS56tCMs.js} +2 -2
  24. package/package.json +2 -1
  25. package/dist/PortalSettingsView-DFsXYy48.js +0 -123
  26. package/dist/index-BnE-gQP_.js +0 -81
@@ -1,6 +1,6 @@
1
- import { f as Ct, e as Nt } from "./index-BnE-gQP_.js";
1
+ import { f as Ct, e as Nt } from "./index-DB33ug2V.js";
2
2
  import { computed as B, reactive as Mt } from "vue";
3
- import { k as _, e as st, h as kt } from "./controlPlane-CiuLVd7s.js";
3
+ import { k as _, e as st, h as kt } from "./controlPlane-DffMY39e.js";
4
4
  import { useCoreStore as Dt } from "@feedmepos/mf-common";
5
5
  import { g as Bt, c as Ut } from "./_commonjsHelpers-DaMA6jEr.js";
6
6
  const ut = [
@@ -833,7 +833,7 @@ function mt(t) {
833
833
  return `#${s}${s}${e}${e}${n}${n}`;
834
834
  }
835
835
  function ye() {
836
- return Ct(Nt("fmmf:prod")).apiOrigin;
836
+ return Ct(Nt("fmmf:dev")).apiOrigin;
837
837
  }
838
838
  function lt(t) {
839
839
  return `${ye()}/metadata/${t}/brandkit`;
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as E, resolveComponent as g, openBlock as p, createElementBlock as v, createVNode as M, createElementVNode as x, normalizeClass as P, toDisplayString as w, createCommentVNode as b, createBlock as _, shallowReadonly as c, ref as m } from "vue";
2
- import "./index-BnE-gQP_.js";
2
+ import "./index-DB33ug2V.js";
3
3
  import { a as C } from "./routes-W8KfuhWL.js";
4
- import { c as F, e as $, f as L } from "./controlPlane-CiuLVd7s.js";
4
+ import { c as F, e as $, f as L } from "./controlPlane-DffMY39e.js";
5
5
  function U(e, t) {
6
6
  const n = t.trim().toLowerCase();
7
7
  return e.filter((r) => n ? [r.name, r.description ?? "", r.slot ?? "", ...r.labels ?? []].join(" ").toLowerCase().includes(n) : !0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-miniprogram-v2",
3
- "version": "0.2.10",
3
+ "version": "0.2.11-dev.1",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -49,6 +49,7 @@
49
49
  "marked": "^18.0.5",
50
50
  "marked-highlight": "^2.2.4",
51
51
  "pinia": "^2.1.7",
52
+ "qrcode": "1.5.4",
52
53
  "vue": "^3.5.39",
53
54
  "vue-router": "^4.6.4"
54
55
  },
@@ -1,123 +0,0 @@
1
- import { defineComponent as k, computed as p, ref as l, onMounted as P, onScopeDispose as S, resolveComponent as x, openBlock as o, createElementBlock as n, createElementVNode as s, toDisplayString as d, createCommentVNode as h, Fragment as I, createVNode as A, unref as M } from "vue";
2
- import { useRoute as N } from "vue-router";
3
- import { e as _, f as $ } from "./index-BnE-gQP_.js";
4
- import { j as B, e as E } from "./controlPlane-CiuLVd7s.js";
5
- import { useCoreStore as F } from "@feedmepos/mf-common";
6
- import { u as U } from "./portalContext-CCW6O5KF.js";
7
- import { l as V } from "./portalNavigation-DLcC7Koh.js";
8
- import { _ as q } from "./_plugin-vue_export-helper-CHgC5LLL.js";
9
- const L = { class: "portal-page" }, R = { class: "portal-page-inner settings-page" }, T = { class: "portal-page-heading" }, j = ["href"], D = {
10
- key: 0,
11
- class: "portal-error",
12
- role: "alert"
13
- }, H = { class: "portal-section" }, O = { class: "settings-value" }, z = { class: "portal-section" }, K = { class: "settings-icon-row" }, Y = { class: "settings-icon" }, G = ["src"], J = { class: "portal-section" }, Q = { class: "settings-logo" }, W = ["src"], X = /* @__PURE__ */ k({
14
- __name: "PortalSettingsView",
15
- setup(Z) {
16
- const a = U(), y = N(), c = F(), w = p(
17
- () => {
18
- var t;
19
- return new URL(
20
- V({
21
- ...y.query,
22
- businessId: a.businessId.value,
23
- country: c.currentCountry.value ?? null,
24
- restaurantId: ((t = c.currentRestaurant.value) == null ? void 0 : t._id) ?? null
25
- }),
26
- _("fmmf:prod") === "dev" ? "https://portal.feedmedev.cc" : "https://portal.feedme.cc"
27
- ).href;
28
- }
29
- ), m = l(null), g = l(!0), r = l(null), v = l(!1), f = $(_("fmmf:prod")).apiOrigin, C = p(() => `${f}/metadata/${a.businessId.value}/pwa-512x512.png`), b = p(() => {
30
- var t;
31
- return (t = B()) == null ? void 0 : t.thumbnail;
32
- }), i = new AbortController();
33
- return P(async () => {
34
- var t;
35
- try {
36
- const e = await fetch(`${f}/metadata/${a.businessId.value}/config`, {
37
- signal: AbortSignal.any([i.signal, AbortSignal.timeout(15e3)])
38
- });
39
- if (e.status === 404) return;
40
- if (!e.ok) throw new Error(`Could not load app assets (HTTP ${e.status})`);
41
- const u = await e.json();
42
- m.value = ((t = u.pwaConfig) == null ? void 0 : t.name) ?? null;
43
- } catch (e) {
44
- i.signal.aborted || (r.value = E(e));
45
- } finally {
46
- g.value = !1;
47
- }
48
- }), S(() => i.abort()), (t, e) => {
49
- const u = x("FmIcon");
50
- return o(), n("div", L, [
51
- s("div", R, [
52
- s("header", T, [
53
- e[1] || (e[1] = s("div", null, [
54
- s("p", { class: "portal-eyebrow" }, "Your app identity"),
55
- s("h1", null, "Settings")
56
- ], -1)),
57
- s("a", {
58
- href: w.value,
59
- class: "portal-link-button",
60
- target: "_blank",
61
- rel: "noopener"
62
- }, "Manage assets in original Portal ↗", 8, j)
63
- ]),
64
- e[10] || (e[10] = s("div", { class: "settings-tabs" }, [
65
- s("span", null, "Assets")
66
- ], -1)),
67
- e[11] || (e[11] = s("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)),
68
- r.value ? (o(), n("p", D, d(r.value), 1)) : h("", !0),
69
- s("section", H, [
70
- e[2] || (e[2] = s("h2", null, "App name", -1)),
71
- e[3] || (e[3] = s("p", { class: "portal-description" }, "Shown under the icon on your customer’s home screen.", -1)),
72
- s("p", O, d(g.value ? "Loading…" : r.value ? "Unavailable" : m.value || "Not configured"), 1),
73
- e[4] || (e[4] = s("p", { class: "portal-description" }, " The original Portal applies the “FeedMe x” naming rule for non-Premium businesses. ", -1))
74
- ]),
75
- s("section", z, [
76
- e[7] || (e[7] = s("div", { class: "portal-section-head" }, [
77
- s("div", null, [
78
- s("h2", null, "App icon"),
79
- s("p", { class: "portal-description" }, "One square image for the home screen.")
80
- ])
81
- ], -1)),
82
- s("div", K, [
83
- s("div", Y, [
84
- v.value ? (o(), n(I, { key: 1 }, [
85
- A(u, {
86
- name: "image",
87
- size: "xl"
88
- }),
89
- e[5] || (e[5] = s("span", null, "No icon available", -1))
90
- ], 64)) : (o(), n("img", {
91
- key: 0,
92
- src: C.value,
93
- alt: "Current app icon",
94
- onError: e[0] || (e[0] = (ee) => v.value = !0)
95
- }, null, 40, G))
96
- ]),
97
- e[6] || (e[6] = s("div", null, [
98
- s("h3", null, "Icon guidelines"),
99
- s("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. "),
100
- s("p", { class: "portal-description" }, "Changes to this shared icon are not part of a release build.")
101
- ], -1))
102
- ])
103
- ]),
104
- s("section", J, [
105
- e[8] || (e[8] = s("h2", null, "Business branding", -1)),
106
- s("div", Q, [
107
- b.value ? (o(), n("img", {
108
- key: 0,
109
- src: b.value,
110
- alt: "Business logo"
111
- }, null, 8, W)) : h("", !0),
112
- s("p", null, d(M(a).businessName.value), 1)
113
- ]),
114
- e[9] || (e[9] = s("p", { class: "portal-description" }, " Cover images and other shared business assets remain available in the original Portal. ", -1))
115
- ])
116
- ])
117
- ]);
118
- };
119
- }
120
- }), ue = /* @__PURE__ */ q(X, [["__scopeId", "data-v-6c0e4447"]]);
121
- export {
122
- ue as default
123
- };
@@ -1,81 +0,0 @@
1
- const g = 10, f = 5242880, a = /* @__PURE__ */ new Set(["image/png", "image/jpeg", "image/webp", "image/gif"]), o = {
2
- "image/png": "png",
3
- "image/jpeg": "jpg",
4
- "image/webp": "webp",
5
- "image/gif": "gif",
6
- "image/svg+xml": "svg",
7
- "text/markdown": "md",
8
- "application/json": "json",
9
- "application/zip+dotlottie": "lottie"
10
- }, v = `${Object.keys(o).join(",")},.svg,.md,.markdown,.json,.lottie,.dotlottie`;
11
- function l(e, t) {
12
- var r;
13
- const n = t.split(";")[0].trim().toLowerCase(), i = (r = e.split(".").pop()) == null ? void 0 : r.toLowerCase();
14
- return i === "svg" ? "image/svg+xml" : i === "md" || i === "markdown" ? "text/markdown" : i === "json" ? "application/json" : i === "lottie" || i === "dotlottie" ? "application/zip+dotlottie" : Object.hasOwn(o, n) ? n : null;
15
- }
16
- function T(e) {
17
- return a.has(e);
18
- }
19
- const u = "69cde0740c0106001ca83dff", E = "0000000074656d706c617465", m = {
20
- dev: {
21
- env: "dev",
22
- liveDomain: "feedmedev.vip",
23
- apiOrigin: "https://api.feedmedev.vip",
24
- workerNamePrefix: "miniprogram-v2-dev",
25
- d1DatabaseName: "miniprogram-v2-dev-metadata",
26
- r2BucketName: "miniprogram-v2-dev-artifacts",
27
- v1Origin: "https://brand.feedmedev.vip"
28
- },
29
- prod: {
30
- env: "prod",
31
- liveDomain: "feedme.vip",
32
- apiOrigin: "https://api.feedme.vip",
33
- workerNamePrefix: "miniprogram-v2-prod",
34
- d1DatabaseName: "miniprogram-v2-prod-metadata",
35
- r2BucketName: "miniprogram-v2-prod-artifacts",
36
- v1Origin: "https://brand.feedme.vip"
37
- }
38
- };
39
- function s(e) {
40
- return e === "dev" || e === "prod";
41
- }
42
- function A(e) {
43
- if (!s(e))
44
- throw new Error(`MINIPROGRAM_ENV must be 'dev' or 'prod', got ${JSON.stringify(e)}`);
45
- return m[e];
46
- }
47
- function N(e) {
48
- const t = e.toLowerCase().replace(/^fmmf:/, "");
49
- return t === "prod" || t === "production" ? "prod" : "dev";
50
- }
51
- const p = /^[a-f0-9]{24}$/;
52
- function d(e) {
53
- return p.test(e);
54
- }
55
- function w(e = crypto.randomUUID()) {
56
- const t = c("prj", e, 24);
57
- return t.length === 27 ? t : t.padEnd(27, "0");
58
- }
59
- function C(e) {
60
- if (!d(e)) throw new Error(`Invalid business id: ${e}`);
61
- return `prj${e}`;
62
- }
63
- function c(e, t, n) {
64
- const r = t.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").replaceAll("-", "").slice(0, n);
65
- return `${e}${r || Date.now().toString(36)}`;
66
- }
67
- export {
68
- a as C,
69
- u as D,
70
- g as M,
71
- E as T,
72
- f as a,
73
- v as b,
74
- l as c,
75
- d,
76
- N as e,
77
- A as f,
78
- T as i,
79
- C as l,
80
- w as m
81
- };