@feedmepos/mf-miniprogram-v2 0.2.2-dev.19 → 0.2.2-dev.20

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 (27) hide show
  1. package/dist/App-BWnR2QQN.js +213 -0
  2. package/dist/{BrandFontPicker-BFjp8k2W.js → BrandFontPicker-kQKWf1hL.js} +1 -1
  3. package/dist/{BrandKitView-DUbIT3c8.js → BrandKitView-RaUWE69b.js} +2 -2
  4. package/dist/{ControlPlaneView-DZ-hNfCQ.js → ControlPlaneView-H-hlL2ND.js} +7825 -7554
  5. package/dist/{EcosystemView-B359jaNI.js → EcosystemView-MvrxhO3T.js} +4 -4
  6. package/dist/{LegacyWorkspaceEntry-opz_kWz9.js → LegacyWorkspaceEntry-lEMtmdIe.js} +1 -1
  7. package/dist/{MobileProjectsView-lV5bkuns.js → MobileProjectsView-BfFS_47C.js} +4 -4
  8. package/dist/{ModuleCenterView-DyMr3iWV.js → ModuleCenterView-ujyL9wW3.js} +1 -1
  9. package/dist/{ModuleDetailView-BeXK89Cs.js → ModuleDetailView-DFXFxSIN.js} +1 -1
  10. package/dist/{PagesView-VqFkmYxN.js → PagesView-DOSrArQb.js} +1 -1
  11. package/dist/{PortalSettingsView-BmmMJ5Zm.js → PortalSettingsView-DjFh8IRa.js} +3 -3
  12. package/dist/TemplateCenterView-BOS6FDQ0.js +475 -0
  13. package/dist/{WorkspaceEntryView-BTYo51RE.js → WorkspaceEntryView-CkTnQH9g.js} +1 -1
  14. package/dist/app.js +21 -10
  15. package/dist/{controlPlane-CoEgf9BA.js → controlPlane-sXaC6pAh.js} +1 -1
  16. package/dist/{index-D5qXvcfE.js → index-CIJWcl_6.js} +10 -9
  17. package/dist/package.json +1 -1
  18. package/dist/{portalContext-C4HL_0kl.js → portalContext-6164Gyod.js} +2 -2
  19. package/dist/routes-Cay_S88s.js +75 -0
  20. package/dist/style.css +1 -1
  21. package/dist/templatePickerFlag-nLdZY-yh.js +59 -0
  22. package/dist/{useBrandKit-BlKlqpo2.js → useBrandKit-CkdPQRE-.js} +2 -2
  23. package/dist/{useModuleCatalog-DqECds3F.js → useModuleCatalog-Cd13YPg6.js} +2 -2
  24. package/package.json +1 -1
  25. package/dist/App-Dj20Jl8B.js +0 -197
  26. package/dist/localPreference-DneUpUrQ.js +0 -34
  27. package/dist/routes-Boz_WlNM.js +0 -54
@@ -0,0 +1,59 @@
1
+ import { a as o } from "./routes-Cay_S88s.js";
2
+ import { ref as i } from "vue";
3
+ import { c as a } from "./controlPlane-sXaC6pAh.js";
4
+ function m(e, t) {
5
+ if (typeof window > "u") return t;
6
+ try {
7
+ const n = window.localStorage.getItem(e);
8
+ return n === null ? t : n === "1";
9
+ } catch {
10
+ return t;
11
+ }
12
+ }
13
+ function w(e, t) {
14
+ if (typeof window > "u") return t;
15
+ try {
16
+ const n = Number(window.localStorage.getItem(e));
17
+ return Number.isFinite(n) ? n : t;
18
+ } catch {
19
+ return t;
20
+ }
21
+ }
22
+ function u(e, t) {
23
+ if (!(typeof window > "u"))
24
+ try {
25
+ window.localStorage.setItem(e, t);
26
+ } catch {
27
+ }
28
+ }
29
+ function h(e, t) {
30
+ u(e, t ? "1" : "0");
31
+ }
32
+ let r = null;
33
+ function c() {
34
+ return r || (r = a(o.adminWhoami()).then((e) => e.isAdmin).catch(() => !1)), r;
35
+ }
36
+ function p() {
37
+ const e = i(!1);
38
+ return c().then((t) => {
39
+ e.value = t;
40
+ }), e;
41
+ }
42
+ const d = "templatePicker";
43
+ function y() {
44
+ if (typeof window > "u") return !1;
45
+ try {
46
+ const e = new URLSearchParams(window.location.search).get(d);
47
+ return e !== null && e !== "0" && e !== "false";
48
+ } catch {
49
+ return !1;
50
+ }
51
+ }
52
+ export {
53
+ w as a,
54
+ u as b,
55
+ m as r,
56
+ y as t,
57
+ p as u,
58
+ h as w
59
+ };
@@ -1,6 +1,6 @@
1
- import { a as jt, e as xt } from "./index-D5qXvcfE.js";
1
+ import { a as jt, e as xt } from "./index-CIJWcl_6.js";
2
2
  import { computed as nt, reactive as Et } from "vue";
3
- import { h as x, e as ot } from "./controlPlane-CoEgf9BA.js";
3
+ import { h as x, e as ot } from "./controlPlane-sXaC6pAh.js";
4
4
  import { useCoreStore as At } from "@feedmepos/mf-common";
5
5
  const it = [
6
6
  "Inter",
@@ -1,6 +1,6 @@
1
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-Boz_WlNM.js";
3
- import { c as M, e as y, m as $ } from "./controlPlane-CoEgf9BA.js";
2
+ import { a as w } from "./routes-Cay_S88s.js";
3
+ import { c as M, e as y, m as $ } from "./controlPlane-sXaC6pAh.js";
4
4
  const I = { class: "flex min-h-0 flex-1 flex-col items-center justify-center gap-8 p-24 text-center" }, T = {
5
5
  key: 0,
6
6
  class: "m-0 max-w-[46ch] fm-typo-en-body-sm-400 text-portal-text-muted"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-miniprogram-v2",
3
- "version": "0.2.2-dev.19",
3
+ "version": "0.2.2-dev.20",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -1,197 +0,0 @@
1
- import { defineComponent as j, computed as y, ref as P, onMounted as z, onBeforeUnmount as K, resolveComponent as f, openBlock as s, createElementBlock as i, Fragment as S, createElementVNode as a, normalizeClass as M, createVNode as t, renderList as w, unref as l, withCtx as u, toDisplayString as d, createCommentVNode as N, createBlock as V } from "vue";
2
- import { useRoute as A, RouterView as O } from "vue-router";
3
- import { useCoreStore as $ } from "@feedmepos/mf-common";
4
- import { P as v } from "./PortalIcon-DO0VrIoY.js";
5
- import { p as D } from "./portalContext-C4HL_0kl.js";
6
- import { p as c } from "./portalNavigation-DKCfwTH8.js";
7
- import { r as q, w as B } from "./localPreference-DneUpUrQ.js";
8
- import { _ as G } from "./_plugin-vue_export-helper-CHgC5LLL.js";
9
- const Q = {
10
- class: "portal-sidebar",
11
- "aria-label": "Mini Program navigation"
12
- }, U = ["aria-expanded", "aria-label"], H = {
13
- id: "miniprogram-navigation",
14
- class: "portal-nav"
15
- }, J = { class: "portal-nav-label" }, W = { class: "portal-nav-label" }, X = { class: "portal-main" }, Y = {
16
- key: 0,
17
- class: "portal-breadcrumb",
18
- "aria-label": "Breadcrumb"
19
- }, Z = {
20
- id: "miniprogram-content",
21
- class: "portal-content",
22
- tabindex: "-1"
23
- }, ee = {
24
- key: 0,
25
- class: "portal-empty"
26
- }, ae = {
27
- key: 1,
28
- class: "portal-loading",
29
- role: "status"
30
- }, le = {
31
- key: 2,
32
- class: "portal-empty",
33
- role: "alert"
34
- }, oe = /* @__PURE__ */ j({
35
- __name: "App",
36
- setup(te) {
37
- const r = A(), k = $(), n = D(), p = y(() => r.name === "miniprogram-v2-project"), b = P(
38
- q(
39
- "mpv2:portal-collapsed",
40
- typeof window < "u" && window.matchMedia("(max-width: 1000px)").matches
41
- )
42
- ), g = P(q("mpv2:editor-collapsed", !0)), _ = y(() => p.value ? g.value : b.value), h = y(
43
- () => {
44
- var C;
45
- return p.value ? (C = n.context.value) == null ? void 0 : C.project.name : String(r.meta.title ?? "Ecosystem");
46
- }
47
- ), F = [
48
- { name: "miniprogram-v2-ecosystem", label: "Ecosystem", icon: "ecosystem" },
49
- { name: "miniprogram-v2-brand-kit", label: "Brand Kit", icon: "brand" },
50
- { name: "miniprogram-v2-pages", label: "Pages", icon: "pages" }
51
- ], I = y(() => ({ name: "miniprogram-v2-mobile-projects", query: c(r.query) }));
52
- let x = !1;
53
- z(() => {
54
- x = k.hideSidebar.value, k.hideSidebar.value = !0;
55
- }), K(() => {
56
- k.hideSidebar.value = x;
57
- });
58
- function L() {
59
- p.value ? (g.value = !g.value, B("mpv2:editor-collapsed", g.value)) : (b.value = !b.value, B("mpv2:portal-collapsed", b.value));
60
- }
61
- return (C, e) => {
62
- const m = f("RouterLink"), R = f("FmIcon"), E = f("FmCircularProgress"), T = f("FmButton");
63
- return s(), i(S, null, [
64
- e[12] || (e[12] = a("link", {
65
- href: "https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,400,0..1,0",
66
- rel: "stylesheet"
67
- }, null, -1)),
68
- a("div", {
69
- class: M(["mpv2-app portal-shell", { "portal-shell--collapsed": _.value }])
70
- }, [
71
- e[11] || (e[11] = a("a", {
72
- class: "portal-skip",
73
- href: "#miniprogram-content"
74
- }, "Skip to content", -1)),
75
- a("aside", Q, [
76
- a("button", {
77
- class: "portal-sidebar-toggle",
78
- type: "button",
79
- "aria-expanded": !_.value,
80
- "aria-controls": "miniprogram-navigation",
81
- "aria-label": _.value ? "Expand navigation" : "Collapse navigation",
82
- onClick: L
83
- }, [
84
- t(v, { name: "collapse" }),
85
- e[0] || (e[0] = a("span", { class: "portal-nav-label" }, "Mini Program", -1))
86
- ], 8, U),
87
- a("nav", H, [
88
- (s(), i(S, null, w(F, (o) => t(m, {
89
- key: o.name,
90
- to: { name: o.name, query: l(c)(l(r).query) },
91
- class: "portal-nav-item",
92
- title: o.label,
93
- "aria-label": o.label,
94
- "aria-current": l(r).name === o.name ? "page" : void 0
95
- }, {
96
- default: u(() => [
97
- t(v, {
98
- name: o.icon
99
- }, null, 8, ["name"]),
100
- a("span", J, d(o.label), 1)
101
- ]),
102
- _: 2
103
- }, 1032, ["to", "title", "aria-label", "aria-current"])), 64)),
104
- e[3] || (e[3] = a("p", { class: "portal-nav-caption" }, "Platforms", -1)),
105
- t(m, {
106
- to: I.value,
107
- class: M(["portal-nav-item", { "router-link-active": p.value }]),
108
- title: "Mobile Ordering",
109
- "aria-label": "Mobile Ordering",
110
- "aria-current": p.value ? "page" : void 0
111
- }, {
112
- default: u(() => [
113
- t(v, { name: "mobile" }),
114
- e[1] || (e[1] = a("span", { class: "portal-nav-label" }, "Mobile Ordering", -1))
115
- ]),
116
- _: 1
117
- }, 8, ["to", "class", "aria-current"]),
118
- (s(), i(S, null, w(["tablet", "kiosk"], (o) => t(m, {
119
- key: o,
120
- to: { name: `miniprogram-v2-${o}`, query: l(c)(l(r).query) },
121
- class: "portal-nav-item",
122
- title: o === "tablet" ? "Tablet" : "Kiosk",
123
- "aria-label": o === "tablet" ? "Tablet" : "Kiosk"
124
- }, {
125
- default: u(() => [
126
- t(v, { name: o }, null, 8, ["name"]),
127
- a("span", W, d(o === "tablet" ? "Tablet" : "Kiosk"), 1)
128
- ]),
129
- _: 2
130
- }, 1032, ["to", "title", "aria-label"])), 64)),
131
- e[4] || (e[4] = a("div", { class: "portal-nav-divider" }, null, -1)),
132
- t(m, {
133
- to: { name: "miniprogram-v2-module-center", query: l(c)(l(r).query) },
134
- class: M(["portal-nav-item", { "router-link-active": l(r).name === "miniprogram-v2-module-detail" }]),
135
- title: "Module library",
136
- "aria-label": "Module library"
137
- }, {
138
- default: u(() => [
139
- t(R, {
140
- name: "widgets",
141
- size: "md"
142
- }),
143
- e[2] || (e[2] = a("span", { class: "portal-nav-label" }, "Module library", -1))
144
- ]),
145
- _: 1
146
- }, 8, ["to", "class"])
147
- ]),
148
- t(m, {
149
- to: { name: "miniprogram-v2-settings", query: l(c)(l(r).query) },
150
- class: "portal-nav-item portal-settings-link",
151
- title: "Settings",
152
- "aria-label": "Settings"
153
- }, {
154
- default: u(() => [
155
- t(v, { name: "settings" }),
156
- e[5] || (e[5] = a("span", { class: "portal-nav-label" }, "Settings", -1))
157
- ]),
158
- _: 1
159
- }, 8, ["to"])
160
- ]),
161
- a("div", X, [
162
- p.value ? N("", !0) : (s(), i("header", Y, [
163
- a("span", null, d(l(n).businessName.value), 1),
164
- e[6] || (e[6] = a("span", { "aria-hidden": "true" }, "/", -1)),
165
- a("span", null, d(h.value), 1),
166
- e[7] || (e[7] = a("div", {
167
- id: "portal-page-actions",
168
- class: "portal-page-actions"
169
- }, null, -1))
170
- ])),
171
- a("div", Z, [
172
- l(n).businessId.value ? l(n).loading.value ? (s(), i("div", ae, [
173
- t(E, { size: "xl" }),
174
- e[9] || (e[9] = a("span", null, "Loading your Mini Program…", -1))
175
- ])) : l(n).error.value ? (s(), i("section", le, [
176
- e[10] || (e[10] = a("h1", null, "Could not open this Mini Program", -1)),
177
- a("p", null, d(l(n).error.value), 1),
178
- t(T, {
179
- label: "Try again",
180
- onClick: l(n).refresh
181
- }, null, 8, ["onClick"])
182
- ])) : (s(), V(l(O), {
183
- key: `${l(n).businessId.value}:${l(r).params.projectId ?? String(l(r).name)}`
184
- })) : (s(), i("section", ee, [...e[8] || (e[8] = [
185
- a("h1", null, "Select a business", -1),
186
- a("p", null, "Choose a business in the Portal header to open its Mini Program.", -1)
187
- ])]))
188
- ])
189
- ])
190
- ], 2)
191
- ], 64);
192
- };
193
- }
194
- }), ve = /* @__PURE__ */ G(oe, [["__scopeId", "data-v-4e1d3418"]]);
195
- export {
196
- ve as default
197
- };
@@ -1,34 +0,0 @@
1
- function o(t, e) {
2
- if (typeof window > "u") return e;
3
- try {
4
- const r = window.localStorage.getItem(t);
5
- return r === null ? e : r === "1";
6
- } catch {
7
- return e;
8
- }
9
- }
10
- function i(t, e) {
11
- if (typeof window > "u") return e;
12
- try {
13
- const r = Number(window.localStorage.getItem(t));
14
- return Number.isFinite(r) ? r : e;
15
- } catch {
16
- return e;
17
- }
18
- }
19
- function n(t, e) {
20
- if (!(typeof window > "u"))
21
- try {
22
- window.localStorage.setItem(t, e);
23
- } catch {
24
- }
25
- }
26
- function u(t, e) {
27
- n(t, e ? "1" : "0");
28
- }
29
- export {
30
- i as a,
31
- n as b,
32
- o as r,
33
- u as w
34
- };
@@ -1,54 +0,0 @@
1
- const t = (e, s) => `/api/businesses/${e}/projects/${s}`, i = {
2
- projects: (e) => `/api/businesses/${e}/projects`,
3
- portalContext: (e) => `/api/businesses/${e}/portal-context`,
4
- project: (e, s) => t(e, s),
5
- provision: (e, s) => `${t(e, s)}/provision`,
6
- refreshSlug: (e, s) => `${t(e, s)}/refresh-slug`,
7
- sessions: (e, s) => `${t(e, s)}/sessions`,
8
- session: (e, s, r) => `${t(e, s)}/sessions/${r}`,
9
- messages: (e, s, r) => `${i.session(e, s, r)}/messages`,
10
- startStatus: (e, s, r) => `${i.session(e, s, r)}/start-status`,
11
- changes: (e, s, r, o = !1) => `${i.session(e, s, r)}/changes${o ? "?refresh=1" : ""}`,
12
- checkpoints: (e, s, r) => `${i.session(e, s, r)}/checkpoints`,
13
- aiBillingPreflight: (e, s, r) => `${i.session(e, s, r)}/ai-billing/preflight`,
14
- restoreCheckpoint: (e, s, r, o) => `${i.checkpoints(e, s, r)}/${o}/restore`,
15
- previewBridgeTicket: (e, s, r) => `${i.session(e, s, r)}/preview-bridge/ticket`,
16
- previewBridgeSocket: (e, s, r) => `${i.session(e, s, r)}/preview-bridge/socket`,
17
- uploads: (e, s, r, o = "") => `${i.session(e, s, r)}/uploads${o ? `?${o}` : ""}`,
18
- archive: (e, s, r) => `${i.session(e, s, r)}/archive`,
19
- commit: (e, s, r) => `${i.session(e, s, r)}/commit`,
20
- resume: (e, s, r) => `${i.session(e, s, r)}/resume`,
21
- restartPreview: (e, s, r) => `${i.session(e, s, r)}/restart-preview`,
22
- fork: (e, s, r) => `${i.session(e, s, r)}/fork`,
23
- flushEvents: (e, s, r) => `${i.session(e, s, r)}/events/flush`,
24
- revertTurn: (e, s, r) => `${i.session(e, s, r)}/turns/revert`,
25
- unrevertTurn: (e, s, r) => `${i.session(e, s, r)}/turns/unrevert`,
26
- releases: (e, s) => `${t(e, s)}/releases`,
27
- publishRelease: (e, s, r) => `${i.releases(e, s)}/${r}/publish`,
28
- releasePreviewUrl: (e, s, r) => `${i.releases(e, s)}/${r}/preview-url`,
29
- rollbackToRelease: (e, s, r) => `${t(e, s)}/rollback-to-release/${r}`,
30
- rollbackToV1: (e, s) => `${t(e, s)}/rollback-to-v1`,
31
- start: (e, s, r) => {
32
- const o = new URLSearchParams();
33
- e && o.set("businessId", e), s && o.set("projectId", s), r && o.set("sessionId", r);
34
- const a = o.toString();
35
- return `/api/start${a ? `?${a}` : ""}`;
36
- },
37
- opencode: (e = "") => `/api/opencode${e ? `/${e.replace(/^\/+/, "")}` : ""}`,
38
- /** The shared component library's catalog. Deliberately not under a
39
- * business/project path: the library belongs to no business, and the
40
- * module centre is not inside a workspace. */
41
- componentLibraryCatalog: () => "/api/component-library/catalog",
42
- /** The self-contained preview document the module centre frames. Fetched with
43
- * the portal's bearer and assigned to an iframe's `srcdoc`, never used as an
44
- * `<iframe src>` — a navigation request carries no Authorization header,
45
- * which is what a signed URL would otherwise exist to work around. */
46
- componentLibraryPreview: () => "/api/component-library/preview",
47
- /** The application templates this environment can provision, for the portal's
48
- * picker. Not under a business/project path: the answer is a property of
49
- * the environment, and it is needed BEFORE a project exists. */
50
- appTemplates: () => "/api/app-templates"
51
- };
52
- export {
53
- i as a
54
- };