@feedmepos/mf-miniprogram-v2 0.2.10 → 0.2.11-dev.2

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 (30) hide show
  1. package/dist/App-B0BXsVum.js +235 -0
  2. package/dist/{BrandFontPicker-BVfiQBLP.js → BrandFontPicker-D_MntcD2.js} +1 -1
  3. package/dist/{BrandKitView-BLH-bglF.js → BrandKitView-DHV0PUus.js} +2 -2
  4. package/dist/{ControlPlaneView-C3wvdkj9.js → ControlPlaneView-CPGMj9dc.js} +8269 -8167
  5. package/dist/{EcosystemView-BY2B_LEL.js → EcosystemView-Blo9u-dq.js} +5 -5
  6. package/dist/{LegacyWorkspaceEntry-DrL-C0xx.js → LegacyWorkspaceEntry-IRMa-8U4.js} +2 -2
  7. package/dist/{MobileProjectDialog-DsXmMUHH.js → MobileProjectDialog-QfVNJfyE.js} +2 -2
  8. package/dist/{MobileProjectsView-CMj0mnZh.js → MobileProjectsView-DVjw5R18.js} +4 -4
  9. package/dist/{ModuleCenterView-DG7ea0p5.js → ModuleCenterView-D_5TWuln.js} +1 -1
  10. package/dist/{ModuleDetailView-DweKadjB.js → ModuleDetailView-U8M_-5qs.js} +1 -1
  11. package/dist/{PagesView-W8d-G5HZ.js → PagesView-Bz5aN_A-.js} +1 -1
  12. package/dist/PortalSettingsView-C-5ahh8D.js +1847 -0
  13. package/dist/{TemplateCenterView-BH3C5h50.js → TemplateCenterView-Bd5haOtu.js} +2 -2
  14. package/dist/{WorkspaceEntryView-Dx8stquZ.js → WorkspaceEntryView-V-Tu9Iiy.js} +1 -1
  15. package/dist/app.js +11 -11
  16. package/dist/controlPlane-Bn-uDXG_.js +145 -0
  17. package/dist/index-DB33ug2V.js +125 -0
  18. package/dist/localPreference-CaizsY6G.js +972 -0
  19. package/dist/package.json +2 -1
  20. package/dist/{portalContext-CCW6O5KF.js → portalContext-FZ8_SePb.js} +2 -2
  21. package/dist/style.css +1 -1
  22. package/dist/useBrandKit-Dl8N-9UZ.js +1110 -0
  23. package/dist/{useModuleCatalog-C7kO_Rjg.js → useModuleCatalog-CNvI4aSK.js} +2 -2
  24. package/package.json +2 -1
  25. package/dist/App-DDgjAONU.js +0 -1129
  26. package/dist/PortalSettingsView-DFsXYy48.js +0 -123
  27. package/dist/controlPlane-CiuLVd7s.js +0 -145
  28. package/dist/index-BnE-gQP_.js +0 -81
  29. package/dist/localPreference-Cdti49bE.js +0 -62
  30. package/dist/useBrandKit-fmzepsFY.js +0 -1096
@@ -1,9 +1,9 @@
1
1
  import { defineComponent as B, ref as n, resolveComponent as A, openBlock as s, createBlock as S, withCtx as J, createElementVNode as a, toDisplayString as p, createVNode as u, createElementBlock as o, createCommentVNode as y, computed as X, Fragment as D, createTextVNode as x, onMounted as Y, renderList as G, normalizeClass as Z } from "vue";
2
- import "./index-BnE-gQP_.js";
2
+ import "./index-DB33ug2V.js";
3
3
  import { a as T } from "./routes-W8KfuhWL.js";
4
4
  import { useDialog as ee } from "@feedmepos/ui-library";
5
5
  import { useRouter as te } from "vue-router";
6
- import { c as F, e as I } from "./controlPlane-CiuLVd7s.js";
6
+ import { c as F, e as I } from "./controlPlane-Bn-uDXG_.js";
7
7
  import { _ as L } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  import { w as ae } from "./portalNavigation-DLcC7Koh.js";
9
9
  const le = {
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as s, watchEffect as a, openBlock as n, createElementBlock as p } from "vue";
2
2
  import { useRoute as u, useRouter as i } from "vue-router";
3
- import { u as l } from "./portalContext-CCW6O5KF.js";
3
+ import { u as l } from "./portalContext-FZ8_SePb.js";
4
4
  import { w as m, a as f } from "./portalNavigation-DLcC7Koh.js";
5
5
  const _ = {
6
6
  class: "portal-loading",
package/dist/app.js CHANGED
@@ -4,42 +4,42 @@ const o = [
4
4
  path: "/platforms/mobile",
5
5
  name: "miniprogram-v2-mobile-projects",
6
6
  meta: { title: "Mobile" },
7
- component: () => import("./MobileProjectsView-CMj0mnZh.js")
7
+ component: () => import("./MobileProjectsView-DVjw5R18.js")
8
8
  },
9
9
  {
10
10
  path: "/",
11
11
  name: "miniprogram-v2-ecosystem",
12
12
  meta: { title: "Ecosystem" },
13
13
  beforeEnter: (e) => ["workspace", "releases", "sessions"].includes(String(e.query.view)) ? { name: "miniprogram-v2-control", query: e.query } : !0,
14
- component: () => import("./EcosystemView-BY2B_LEL.js")
14
+ component: () => import("./EcosystemView-Blo9u-dq.js")
15
15
  },
16
16
  {
17
17
  path: "/workspace",
18
18
  name: "miniprogram-v2-control",
19
- component: () => import("./WorkspaceEntryView-Dx8stquZ.js")
19
+ component: () => import("./WorkspaceEntryView-V-Tu9Iiy.js")
20
20
  },
21
21
  {
22
22
  path: "/p/:projectId/:view(workspace|releases|sessions)?",
23
23
  name: "miniprogram-v2-project",
24
- component: () => import("./ControlPlaneView-C3wvdkj9.js")
24
+ component: () => import("./ControlPlaneView-CPGMj9dc.js")
25
25
  },
26
26
  {
27
27
  path: "/brand-kit",
28
28
  name: "miniprogram-v2-brand-kit",
29
29
  meta: { title: "Brand Kit" },
30
- component: () => import("./BrandKitView-BLH-bglF.js")
30
+ component: () => import("./BrandKitView-DHV0PUus.js")
31
31
  },
32
32
  {
33
33
  path: "/pages",
34
34
  name: "miniprogram-v2-pages",
35
35
  meta: { title: "Pages" },
36
- component: () => import("./PagesView-W8d-G5HZ.js")
36
+ component: () => import("./PagesView-Bz5aN_A-.js")
37
37
  },
38
38
  {
39
39
  path: "/settings",
40
40
  name: "miniprogram-v2-settings",
41
41
  meta: { title: "Settings" },
42
- component: () => import("./PortalSettingsView-DFsXYy48.js")
42
+ component: () => import("./PortalSettingsView-C-5ahh8D.js")
43
43
  },
44
44
  ...["tablet", "kiosk"].map((e) => ({
45
45
  path: `/platforms/${e}`,
@@ -53,7 +53,7 @@ const o = [
53
53
  path: "/modules",
54
54
  name: "miniprogram-v2-module-center",
55
55
  meta: { title: "Component Library" },
56
- component: () => import("./ModuleCenterView-DG7ea0p5.js")
56
+ component: () => import("./ModuleCenterView-D_5TWuln.js")
57
57
  },
58
58
  {
59
59
  // Keyed by the module's directory name, which is what the catalog, the
@@ -61,7 +61,7 @@ const o = [
61
61
  path: "/modules/:name",
62
62
  name: "miniprogram-v2-module-detail",
63
63
  meta: { title: "Component Library" },
64
- component: () => import("./ModuleDetailView-DweKadjB.js")
64
+ component: () => import("./ModuleDetailView-U8M_-5qs.js")
65
65
  },
66
66
  {
67
67
  // Internal-only: linked from the main nav (App.vue), but only once
@@ -72,13 +72,13 @@ const o = [
72
72
  path: "/internal/template-center",
73
73
  name: "miniprogram-v2-template-center",
74
74
  meta: { title: "Template library", requiresAdmin: !0 },
75
- component: () => import("./TemplateCenterView-BH3C5h50.js")
75
+ component: () => import("./TemplateCenterView-Bd5haOtu.js")
76
76
  },
77
77
  {
78
78
  path: "/:pathMatch(.*)*",
79
79
  redirect: (e) => ({ name: "miniprogram-v2-ecosystem", query: e.query, params: {} })
80
80
  }
81
- ], r = {}, a = t(() => import("./App-DDgjAONU.js")), n = t(() => import("./LegacyWorkspaceEntry-DrL-C0xx.js"));
81
+ ], r = {}, a = t(() => import("./App-B0BXsVum.js")), n = t(() => import("./LegacyWorkspaceEntry-IRMa-8U4.js"));
82
82
  export {
83
83
  a as FmApp,
84
84
  n as MiniprogramWorkspace,
@@ -0,0 +1,145 @@
1
+ import { f, e as d, g as m, D as p } from "./index-DB33ug2V.js";
2
+ import { useCoreStore as i, FeedMeAuth as h } from "@feedmepos/mf-common";
3
+ const w = [
4
+ "AE",
5
+ "AU",
6
+ "BN",
7
+ "GB",
8
+ "ID",
9
+ "JP",
10
+ "MA",
11
+ "MO",
12
+ "MV",
13
+ "MY",
14
+ "PK",
15
+ "SG",
16
+ "TH",
17
+ "VN"
18
+ ];
19
+ function g(e) {
20
+ return typeof e == "string" && w.includes(e);
21
+ }
22
+ function U(e) {
23
+ if (typeof e != "string") return null;
24
+ const n = e.trim().toUpperCase();
25
+ return g(n) ? n : null;
26
+ }
27
+ function y(e, n) {
28
+ const t = n === "MY" ? "" : `.${n.toLowerCase()}`, r = e === "dev" ? "-dev" : "", s = e === "dev" ? "https://license.feedmedev.cc" : "https://license.feedme.cc";
29
+ return {
30
+ country: n,
31
+ portalApiBaseUrl: `https://portal-v2${r}${t}.feedmeapi.com`,
32
+ licenseApiBaseUrl: `https://license-v2${r}${t}.feedmeapi.com/api`,
33
+ // Miniprogram Premium is sold among License's business features.
34
+ purchaseUrl: `${s}/purchase?type=business-features`,
35
+ aiTokenPurchaseUrl: `${s}/purchase`,
36
+ usageUrl: `${s}/token`
37
+ };
38
+ }
39
+ function D(e, n, t) {
40
+ const r = new URL(y(e, n).usageUrl);
41
+ return r.searchParams.set("businessId", t), r.searchParams.set("country", n), r.toString();
42
+ }
43
+ function v(e) {
44
+ return e.replace(/\/+$/, "");
45
+ }
46
+ function B() {
47
+ return v("https://miniprogram-v2-api.feedmedev.vip");
48
+ }
49
+ function C(e) {
50
+ const n = B();
51
+ return n ? `${n}${e.startsWith("/") ? e : `/${e}`}` : e;
52
+ }
53
+ function a() {
54
+ return i().currentBusiness.value;
55
+ }
56
+ function c() {
57
+ var e;
58
+ return ((e = a()) == null ? void 0 : e._id) ?? p;
59
+ }
60
+ function T() {
61
+ var e;
62
+ return ((e = a()) == null ? void 0 : e.url) ?? void 0;
63
+ }
64
+ function b() {
65
+ var e;
66
+ return ((e = a()) == null ? void 0 : e.name) ?? c();
67
+ }
68
+ function E() {
69
+ return i().currentCountry.value;
70
+ }
71
+ function x() {
72
+ const e = f(d("fmmf:dev")).liveDomain;
73
+ return m(c(), T(), e);
74
+ }
75
+ function P(e) {
76
+ return new Promise((n) => window.setTimeout(n, e));
77
+ }
78
+ function F(e) {
79
+ return e instanceof Error ? e.message : String(e);
80
+ }
81
+ class S extends Error {
82
+ constructor(n, t) {
83
+ super(t), this.status = n, this.body = t;
84
+ }
85
+ }
86
+ function u() {
87
+ var n;
88
+ return ((n = i().sessionUser.value) == null ? void 0 : n.token) || h.token || "";
89
+ }
90
+ async function $() {
91
+ let e = u();
92
+ const n = Date.now() + 5e3;
93
+ for (; !e && Date.now() < n; )
94
+ await P(100), e = u();
95
+ return e ? `Bearer ${e}` : null;
96
+ }
97
+ async function M(e, n = {}) {
98
+ const t = new Request(e, n), r = await $();
99
+ r && t.headers.set("Authorization", r);
100
+ const s = U(E());
101
+ return s && t.headers.set("x-feedme-country", s), fetch(t);
102
+ }
103
+ async function l(e, n = {}) {
104
+ const t = new Headers(n.headers);
105
+ n.body && !t.has("Content-Type") && t.set("Content-Type", "application/json");
106
+ const r = new AbortController(), s = window.setTimeout(() => r.abort(), 15e3);
107
+ try {
108
+ const o = await M(C(e), {
109
+ ...n,
110
+ headers: t,
111
+ signal: n.signal ?? r.signal
112
+ });
113
+ if (!o.ok) throw new S(o.status, await o.text());
114
+ return o;
115
+ } catch (o) {
116
+ throw o instanceof DOMException && o.name === "AbortError" ? new Error("Control-plane request timed out") : o;
117
+ } finally {
118
+ window.clearTimeout(s);
119
+ }
120
+ }
121
+ async function I(e, n = {}) {
122
+ return (await l(e, n)).json();
123
+ }
124
+ async function L(e, n = {}) {
125
+ return (await l(e, n)).text();
126
+ }
127
+ export {
128
+ S as C,
129
+ x as a,
130
+ M as b,
131
+ I as c,
132
+ C as d,
133
+ F as e,
134
+ L as f,
135
+ y as g,
136
+ $ as h,
137
+ E as i,
138
+ a as j,
139
+ c as k,
140
+ T as l,
141
+ b as m,
142
+ U as n,
143
+ D as o,
144
+ P as s
145
+ };
@@ -0,0 +1,125 @@
1
+ const b = 10, v = 5242880, c = /* @__PURE__ */ new Set(["image/png", "image/jpeg", "image/webp", "image/gif"]), m = {
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
+ }, w = `${Object.keys(m).join(",")},.svg,.md,.markdown,.json,.lottie,.dotlottie`;
11
+ function k(e, t) {
12
+ var r;
13
+ const i = t.split(";")[0].trim().toLowerCase(), a = (r = e.split(".").pop()) == null ? void 0 : r.toLowerCase();
14
+ return a === "svg" ? "image/svg+xml" : a === "md" || a === "markdown" ? "text/markdown" : a === "json" ? "application/json" : a === "lottie" || a === "dotlottie" ? "application/zip+dotlottie" : Object.hasOwn(m, i) ? i : null;
15
+ }
16
+ function j(e) {
17
+ return c.has(e);
18
+ }
19
+ const d = /^[a-z0-9][a-z0-9-]{4,}[a-z0-9]$/, p = new Set(
20
+ `brand home app about tnc terms-and-conditions redirection redirect auth login logout register user discovery
21
+ discover order orders membership memberships member members benefit benefits reward rewards voucher vouchers search
22
+ restaurant restaurants business businesses dine profile scan scanner menu cart me v active-orders qr setting settings
23
+ error supportdetails support-details stacks imulus github twitter facebook google apple account activate add admin
24
+ administrator api apps archive archives blog cache cancel careers changelog checkout codereview compare config
25
+ configuration connect contact create delete direct_messages documentation download downloads edit email employment
26
+ enterprise faq favorites feed feedback feeds fleet fleets follow followers following friend friends gist group groups
27
+ help hosting hostmaster idea ideas index info invitations invite is it job jobs json language languages lists logs mail
28
+ map maps mine mis news oauth oauth_clients offers openid organizations plans popular post postmaster privacy projects
29
+ put recruitment remove replies root rss sales save security sessions shop signup sitemap ssl ssladmin
30
+ ssladministrator sslwebmaster status stories styleguide subscribe subscriptions support sysadmin sysadministrator
31
+ terms tour translations trends unfollow unsubscribe update url weather webmaster widget widgets wiki ww www wwww xfn
32
+ xml xmpp yaml yml chinese mandarin spanish english bengali hindi portuguese russian japanese german wu javanese korean
33
+ french vietnamese telugu marathi tamil turkish urdu min-nan jinyu gujarati polish arabic ukrainian italian xiang
34
+ malayalam hakka kannada oriya panjabi sunda romanian bhojpuri azerbaijani farsi maithili hausa burmese serbo-croatian
35
+ gan awadhi thai dutch yoruba sindhi ac ad ae af ag ai al am an ao aq ar as at au aw ax az ba bb bd be bf bg bh bi bj bm
36
+ bn bo br bs bt bv bw by bz ca cc cd cf cg ch ci ck cl cm cn co cr cs cu cv cx cy cz dd de dj dk dm do dz ec ee eg eh er
37
+ es et eu fi fj fk fm fo fr ga gb gd ge gf gg gh gi gl gm gn gp gq gr gs gt gu gw gy hk hm hn hr ht hu id ie il im in io
38
+ iq ir je jm jo jp ke kg kh ki km kn kp kr kw ky kz la lb lc li lk lr ls lt lu lv ly ma mc md mg mh mk ml mm mn mo mp mq
39
+ mr ms mt mu mv mw mx my mz na nc ne nf ng ni nl no np nr nu nz om pa pe pf pg ph pk pl pm pn pr ps pt pw py qa re ro rs
40
+ ru rw sa sb sc sd se sg sh si sj sk sl sm sn so sr ss st su sv sy sz tc td tf tg th tj tk tl tm tn to tp tr tt tv tw
41
+ tz ua ug uk us uy uz va vc ve vg vi vn vu wf ws ye yt yu za zm zw`.split(/\s+/)
42
+ );
43
+ function y(e) {
44
+ return e ? d.test(e) ? p.has(e) ? "reserved" : null : "format" : null;
45
+ }
46
+ function E(e, t, i) {
47
+ const a = t == null ? void 0 : t.trim().toLowerCase();
48
+ return `https://${a && /^[a-z0-9-]+$/.test(a) ? a : e}.${i}`;
49
+ }
50
+ function T(e, t, i) {
51
+ var o;
52
+ if (!e) return { status: "available" };
53
+ const a = Object.entries(e).filter(([s]) => s !== "type" && s !== "restaurantId");
54
+ if (a.length === 0) return { status: "taken" };
55
+ const r = (o = a.find(([s]) => s === i)) == null ? void 0 : o[1];
56
+ if (r !== void 0 && r !== t) return { status: "taken" };
57
+ const n = a.filter(([, s]) => s !== t).map(([s]) => s);
58
+ return n.length ? { status: "shared", countries: n } : { status: "yours" };
59
+ }
60
+ const S = "69cde0740c0106001ca83dff", z = "0000000074656d706c617465", u = {
61
+ dev: {
62
+ env: "dev",
63
+ liveDomain: "feedmedev.vip",
64
+ apiOrigin: "https://api.feedmedev.vip",
65
+ workerNamePrefix: "miniprogram-v2-dev",
66
+ d1DatabaseName: "miniprogram-v2-dev-metadata",
67
+ r2BucketName: "miniprogram-v2-dev-artifacts",
68
+ v1Origin: "https://brand.feedmedev.vip"
69
+ },
70
+ prod: {
71
+ env: "prod",
72
+ liveDomain: "feedme.vip",
73
+ apiOrigin: "https://api.feedme.vip",
74
+ workerNamePrefix: "miniprogram-v2-prod",
75
+ d1DatabaseName: "miniprogram-v2-prod-metadata",
76
+ r2BucketName: "miniprogram-v2-prod-artifacts",
77
+ v1Origin: "https://brand.feedme.vip"
78
+ }
79
+ };
80
+ function l(e) {
81
+ return e === "dev" || e === "prod";
82
+ }
83
+ function N(e) {
84
+ if (!l(e))
85
+ throw new Error(`MINIPROGRAM_ENV must be 'dev' or 'prod', got ${JSON.stringify(e)}`);
86
+ return u[e];
87
+ }
88
+ function _(e) {
89
+ const t = e.toLowerCase().replace(/^fmmf:/, "");
90
+ return t === "prod" || t === "production" ? "prod" : "dev";
91
+ }
92
+ const g = /^[a-f0-9]{24}$/;
93
+ function f(e) {
94
+ return g.test(e);
95
+ }
96
+ function A(e = crypto.randomUUID()) {
97
+ const t = h("prj", e, 24);
98
+ return t.length === 27 ? t : t.padEnd(27, "0");
99
+ }
100
+ function C(e) {
101
+ if (!f(e)) throw new Error(`Invalid business id: ${e}`);
102
+ return `prj${e}`;
103
+ }
104
+ function h(e, t, i) {
105
+ const r = t.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").replaceAll("-", "").slice(0, i);
106
+ return `${e}${r || Date.now().toString(36)}`;
107
+ }
108
+ export {
109
+ c as C,
110
+ S as D,
111
+ b as M,
112
+ z as T,
113
+ v as a,
114
+ w as b,
115
+ k as c,
116
+ f as d,
117
+ _ as e,
118
+ N as f,
119
+ E as g,
120
+ y as h,
121
+ j as i,
122
+ T as j,
123
+ C as l,
124
+ A as m
125
+ };