@feedmepos/mf-miniprogram-v2 0.2.2-dev.21 → 0.2.2-dev.23

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.
@@ -0,0 +1,395 @@
1
+ import { defineComponent as S, ref as r, computed as B, resolveComponent as R, openBlock as o, createBlock as E, withCtx as L, createElementVNode as t, createElementBlock as i, Fragment as A, createTextVNode as w, toDisplayString as c, createVNode as p, createCommentVNode as b, onMounted as U, renderList as j, unref as z } from "vue";
2
+ import { a as C } from "./routes-DPGrYgQQ.js";
3
+ import { useDialog as G } from "@feedmepos/ui-library";
4
+ import { useRouter as H } from "vue-router";
5
+ import { c as T, e as P } from "./controlPlane-sXaC6pAh.js";
6
+ import { _ as O } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
+ const J = [
8
+ // `label` and `description` are MERCHANT-FACING: the portal's picker renders
9
+ // them, and they are the only thing a merchant chooses on. Say what the app does
10
+ // for their customers, never which package it is built from — the SDK is real and
11
+ // load-bearing and means nothing to the person making this decision. These are
12
+ // the exact texts merchants were already seeing via the old choice layer's own
13
+ // label/description (kept verbatim across its removal — a refactor is not the
14
+ // moment to also silently change picker copy).
15
+ {
16
+ id: "miniprogram-vue",
17
+ label: "V1 · Phone ordering",
18
+ description: "The established phone ordering experience with menu, checkout, membership, rewards and order history.",
19
+ industries: [],
20
+ environments: ["dev", "prod"],
21
+ default: !0
22
+ },
23
+ {
24
+ id: "miniprogram-vue-v2",
25
+ label: "V2 · Baseline",
26
+ description: "The FeedMe v1 customer app's interface, on the v2 kernel: order medallions, the order-history rail, a category rail beside a continuous menu, and the round reviewed in a sheet. The baseline every other v2 style departs from.",
27
+ industries: ["Food & beverage"],
28
+ // Dev only, deliberately. It has never been provisioned end-to-end: the
29
+ // preview proxy, the component-library unpack and the release build have
30
+ // only been exercised locally. Add 'prod' after a real merchant has run
31
+ // through all three.
32
+ environments: ["dev"],
33
+ restaurantStyle: "qsr"
34
+ },
35
+ // Forked from miniprogram-vue-v2 (2026-09): the coffee and tea styles used
36
+ // to be a `restaurantStyle` sharing that one directory, which meant editing
37
+ // one style's components risked changing what the other two rendered. Each
38
+ // now has its own independent directory; only `templates/block-library/` is
39
+ // still shared across all three.
40
+ {
41
+ id: "miniprogram-vue-v2-coffee",
42
+ label: "V2 · Coffee house",
43
+ description: "A calm, image-led experience for habitual pickup, premium drinks and considered customisation.",
44
+ industries: ["Food & beverage"],
45
+ environments: ["dev"],
46
+ restaurantStyle: "coffee"
47
+ },
48
+ {
49
+ id: "miniprogram-vue-v2-tea",
50
+ label: "V2 · Tea & beverage",
51
+ description: "A light, compact and option-forward experience for repeat beverage orders with many customisations.",
52
+ industries: ["Food & beverage"],
53
+ environments: ["dev"],
54
+ restaurantStyle: "tea"
55
+ }
56
+ ], W = ["href"], K = {
57
+ key: 0,
58
+ class: "portal-error",
59
+ role: "alert"
60
+ }, Q = "miniprogram-vue-v2", X = /* @__PURE__ */ S({
61
+ __name: "ForkTemplateDialog",
62
+ emits: ["close", "created"],
63
+ setup(M, { emit: V }) {
64
+ const g = V, d = r(""), v = r(""), _ = r(""), u = r(!1), s = r(""), m = r(""), x = r(0), h = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/, F = B(
65
+ () => !u.value && h.test(d.value.trim()) && v.value.trim().length > 0 && _.value.trim().length > 0
66
+ );
67
+ async function $() {
68
+ if (F.value) {
69
+ u.value = !0, s.value = "";
70
+ try {
71
+ const y = await T(C.forkAppTemplate(), {
72
+ method: "POST",
73
+ body: JSON.stringify({
74
+ sourceAppTemplateId: Q,
75
+ newAppTemplateId: d.value.trim(),
76
+ label: v.value.trim(),
77
+ description: _.value.trim()
78
+ })
79
+ });
80
+ m.value = y.pullRequestUrl, x.value = y.fileCount, g("created");
81
+ } catch (y) {
82
+ s.value = P(y);
83
+ } finally {
84
+ u.value = !1;
85
+ }
86
+ }
87
+ }
88
+ return (y, n) => {
89
+ const f = R("FmButton"), q = R("FmTextField"), D = R("FmTextarea"), I = R("FmCard");
90
+ return o(), E(I, { class: "fork-template-dialog" }, {
91
+ default: L(() => [
92
+ n[7] || (n[7] = t("h2", null, "Create template", -1)),
93
+ m.value ? (o(), i(A, { key: 0 }, [
94
+ t("p", null, [
95
+ w(" Opened a pull request copying " + c(x.value) + " file(s) into a brand-new ", 1),
96
+ t("code", null, "templates/" + c(d.value) + "/", 1),
97
+ n[5] || (n[5] = w(" directory, and registering it in the template catalog. It needs human review and merge — once merged and deployed, it appears here and in the merchant picker automatically; there is no separate step to enable it. ", -1))
98
+ ]),
99
+ t("footer", null, [
100
+ t("a", {
101
+ class: "fork-template-dialog__review-link",
102
+ href: m.value,
103
+ target: "_blank",
104
+ rel: "noopener"
105
+ }, "Review PR", 8, W),
106
+ p(f, {
107
+ label: "Done",
108
+ onClick: n[0] || (n[0] = (e) => g("close"))
109
+ })
110
+ ])
111
+ ], 64)) : (o(), i(A, { key: 1 }, [
112
+ n[6] || (n[6] = t("p", { class: "fork-template-dialog__note" }, " Copies the v2 baseline template's whole directory into a brand-new, independent one — editing the new one can never affect the baseline or any other template. Use this to start a new restaurant style rather than editing a style that other merchants already share. ", -1)),
113
+ p(q, {
114
+ modelValue: d.value,
115
+ "onUpdate:modelValue": n[1] || (n[1] = (e) => d.value = e),
116
+ label: "New template id",
117
+ placeholder: "e.g. miniprogram-vue-v2-bakery",
118
+ "helper-text": "Lowercase, kebab-case. Also becomes the directory name and GitHub repository name.",
119
+ disabled: u.value,
120
+ rules: [(e) => h.test(e.trim()) || "Lowercase kebab-case, e.g. miniprogram-vue-v2-bakery"]
121
+ }, null, 8, ["modelValue", "disabled", "rules"]),
122
+ p(q, {
123
+ modelValue: v.value,
124
+ "onUpdate:modelValue": n[2] || (n[2] = (e) => v.value = e),
125
+ label: "Label",
126
+ placeholder: "Shown to merchants in the picker",
127
+ disabled: u.value
128
+ }, null, 8, ["modelValue", "disabled"]),
129
+ p(D, {
130
+ modelValue: _.value,
131
+ "onUpdate:modelValue": n[3] || (n[3] = (e) => _.value = e),
132
+ label: "Description",
133
+ placeholder: "One or two sentences on what the merchant gets",
134
+ disabled: u.value
135
+ }, null, 8, ["modelValue", "disabled"]),
136
+ s.value ? (o(), i("p", K, c(s.value), 1)) : b("", !0),
137
+ t("footer", null, [
138
+ p(f, {
139
+ label: "Cancel",
140
+ variant: "tertiary",
141
+ disabled: u.value,
142
+ onClick: n[4] || (n[4] = (e) => g("close"))
143
+ }, null, 8, ["disabled"]),
144
+ p(f, {
145
+ label: "Open pull request",
146
+ loading: u.value,
147
+ disabled: !F.value,
148
+ onClick: $
149
+ }, null, 8, ["loading", "disabled"])
150
+ ])
151
+ ], 64))
152
+ ]),
153
+ _: 1
154
+ });
155
+ };
156
+ }
157
+ }), Y = /* @__PURE__ */ O(X, [["__scopeId", "data-v-5a38928f"]]), Z = { class: "portal-page" }, ee = { class: "portal-page-inner" }, te = { class: "portal-page-heading" }, ae = { class: "portal-page-heading__actions" }, le = {
158
+ key: 0,
159
+ class: "portal-error",
160
+ role: "alert"
161
+ }, ne = {
162
+ key: 1,
163
+ "aria-label": "Templates in review"
164
+ }, oe = { class: "template-section-heading" }, ie = {
165
+ key: 0,
166
+ class: "portal-error",
167
+ role: "alert"
168
+ }, se = {
169
+ key: 1,
170
+ class: "template-choices__list",
171
+ "aria-label": "Templates in review"
172
+ }, re = { class: "template-choices__name" }, de = { class: "template-choices__label" }, ue = { key: 0 }, ce = { class: "template-choices__id" }, pe = { class: "template-choices__actions" }, me = ["href"], ve = {
173
+ class: "template-choices__list",
174
+ "aria-label": "Physical templates"
175
+ }, he = { class: "template-choices__name" }, ge = { class: "template-choices__label" }, _e = { key: 0 }, be = { class: "template-choices__id" }, fe = { class: "template-choices__meta" }, ye = { class: "template-choices__actions" }, ke = /* @__PURE__ */ S({
176
+ __name: "TemplateCenterView",
177
+ setup(M) {
178
+ const V = H(), g = G(), d = r(""), v = r(null), _ = r([]), u = r(!1), s = r("");
179
+ async function m() {
180
+ u.value = !0, s.value = "";
181
+ try {
182
+ const e = await T(C.pendingTemplateChanges());
183
+ _.value = e.changes;
184
+ } catch (e) {
185
+ s.value = P(e);
186
+ } finally {
187
+ u.value = !1;
188
+ }
189
+ }
190
+ function x() {
191
+ g.open({
192
+ title: "Create template",
193
+ dialogComponent: Y,
194
+ dialogComponentProps: { onClose: () => g.close(), onCreated: () => void m() }
195
+ });
196
+ }
197
+ const h = r(null);
198
+ async function F(e) {
199
+ h.value = e.pullRequestNumber, s.value = "";
200
+ try {
201
+ await T(C.mergePendingTemplateChange(e.pullRequestNumber), { method: "POST" }), await m();
202
+ } catch (a) {
203
+ s.value = P(a);
204
+ } finally {
205
+ h.value = null;
206
+ }
207
+ }
208
+ async function $(e) {
209
+ h.value = e.pullRequestNumber, s.value = "";
210
+ try {
211
+ await T(C.rejectPendingTemplateChange(e.pullRequestNumber), { method: "POST" }), await m();
212
+ } catch (a) {
213
+ s.value = P(a);
214
+ } finally {
215
+ h.value = null;
216
+ }
217
+ }
218
+ function y(e) {
219
+ const a = e.kind === "delete" ? "delete" : "create";
220
+ g.open({
221
+ title: `Merge — ${a} ${e.appTemplateId}?`,
222
+ message: e.kind === "delete" ? `Merges the pull request into main as-is, without a code review step here. templates/${e.appTemplateId}/ is gone from this repo once this lands and the next control-plane deploy picks up the updated catalog.` : "Merges the pull request into main as-is, without a code review step here. The new template takes effect on the next control-plane deploy.",
223
+ primaryActions: { text: "Merge", close: !0, variant: "primary" },
224
+ secondaryActions: { text: "Cancel", close: !0, variant: "tertiary" }
225
+ }).onPrimary(() => void F(e));
226
+ }
227
+ function n(e) {
228
+ g.open({
229
+ title: `Reject — ${e.kind === "delete" ? "delete" : "create"} ${e.appTemplateId}?`,
230
+ message: "Closes the pull request without merging and deletes its branch. Nothing of this change is kept.",
231
+ primaryActions: { text: "Reject", close: !0, variant: "destructive" },
232
+ secondaryActions: { text: "Cancel", close: !0, variant: "tertiary" }
233
+ }).onPrimary(() => void $(e));
234
+ }
235
+ const f = r(null);
236
+ async function q(e) {
237
+ f.value = e, d.value = "";
238
+ try {
239
+ await T(C.deleteAppTemplate(e), { method: "POST" }), await m();
240
+ } catch (a) {
241
+ d.value = P(a);
242
+ } finally {
243
+ f.value = null;
244
+ }
245
+ }
246
+ function D(e) {
247
+ g.open({
248
+ title: `Delete ${e}?`,
249
+ message: `Opens a pull request removing templates/${e}/ and its catalog entry. Nothing is deleted until that PR is reviewed and merged — refused outright if any project still uses this template.`,
250
+ primaryActions: { text: "Delete", close: !0, variant: "destructive" },
251
+ secondaryActions: { text: "Cancel", close: !0, variant: "tertiary" }
252
+ }).onPrimary(() => void q(e));
253
+ }
254
+ U(() => void m());
255
+ async function I(e) {
256
+ if (!v.value) {
257
+ v.value = e, d.value = "";
258
+ try {
259
+ const a = await T(
260
+ C.appTemplateEditingProject(e),
261
+ { method: "POST" }
262
+ );
263
+ await V.push({
264
+ name: "miniprogram-v2-project",
265
+ params: { projectId: a.projectId, view: "workspace" },
266
+ query: { tpl: "1" }
267
+ });
268
+ } catch (a) {
269
+ d.value = P(a);
270
+ } finally {
271
+ v.value = null;
272
+ }
273
+ }
274
+ }
275
+ return (e, a) => {
276
+ const k = R("FmButton");
277
+ return o(), i("div", Z, [
278
+ t("div", ee, [
279
+ t("header", te, [
280
+ a[1] || (a[1] = t("div", null, [
281
+ t("p", { class: "portal-eyebrow" }, "Internal"),
282
+ t("h1", null, "Template library")
283
+ ], -1)),
284
+ t("div", ae, [
285
+ p(k, {
286
+ label: "Create template",
287
+ variant: "primary",
288
+ onClick: a[0] || (a[0] = (l) => x())
289
+ })
290
+ ])
291
+ ]),
292
+ d.value ? (o(), i("p", le, c(d.value), 1)) : b("", !0),
293
+ s.value || _.value.length > 0 ? (o(), i("section", ne, [
294
+ t("div", oe, [
295
+ a[2] || (a[2] = t("h2", { class: "template-section-title" }, "In review", -1)),
296
+ p(k, {
297
+ label: "Refresh",
298
+ variant: "tertiary",
299
+ size: "md",
300
+ loading: u.value,
301
+ onClick: m
302
+ }, null, 8, ["loading"])
303
+ ]),
304
+ a[3] || (a[3] = t("p", { class: "template-section-note" }, " Waiting on PR review and merge. A row disappears on its own once its pull request merges or is closed — click Refresh to check. ", -1)),
305
+ s.value ? (o(), i("p", ie, [
306
+ w(c(s.value) + " ", 1),
307
+ p(k, {
308
+ label: "Retry",
309
+ variant: "tertiary",
310
+ onClick: m
311
+ })
312
+ ])) : b("", !0),
313
+ _.value.length > 0 ? (o(), i("section", se, [
314
+ (o(!0), i(A, null, j(_.value, (l) => (o(), i("article", {
315
+ key: l.pullRequestNumber,
316
+ class: "template-choices__row"
317
+ }, [
318
+ t("div", re, [
319
+ t("span", de, [
320
+ w(c(l.appTemplateId), 1),
321
+ l.kind === "delete" ? (o(), i("span", ue, " · Delete")) : b("", !0)
322
+ ]),
323
+ t("span", ce, "Awaiting review — PR #" + c(l.pullRequestNumber), 1)
324
+ ]),
325
+ t("div", pe, [
326
+ t("a", {
327
+ class: "template-review-link",
328
+ href: l.pullRequestUrl,
329
+ target: "_blank",
330
+ rel: "noopener"
331
+ }, "Review PR", 8, me),
332
+ p(k, {
333
+ label: "Merge",
334
+ variant: "primary",
335
+ loading: h.value === l.pullRequestNumber,
336
+ disabled: h.value !== null,
337
+ onClick: (N) => y(l)
338
+ }, null, 8, ["loading", "disabled", "onClick"]),
339
+ p(k, {
340
+ label: "Reject",
341
+ variant: "destructive",
342
+ disabled: h.value !== null,
343
+ onClick: (N) => n(l)
344
+ }, null, 8, ["disabled", "onClick"])
345
+ ])
346
+ ]))), 128))
347
+ ])) : b("", !0)
348
+ ])) : b("", !0),
349
+ a[4] || (a[4] = t("h2", { class: "template-section-title" }, "Physical templates", -1)),
350
+ a[5] || (a[5] = t("p", { class: "template-section-note" }, ' "Edit code" opens the physical template directly — the same chat + live preview a merchant project gets, saving straight to a pull request against this repo instead of a merchant repo. "Delete" opens a PR removing it instead — refused outright for the default template or one any project still uses. ', -1)),
351
+ t("section", ve, [
352
+ (o(!0), i(A, null, j(z(J), (l) => (o(), i("article", {
353
+ key: l.id,
354
+ class: "template-choices__row"
355
+ }, [
356
+ t("div", he, [
357
+ t("span", ge, [
358
+ w(c(l.label), 1),
359
+ l.default ? (o(), i("span", _e, " · Default")) : b("", !0)
360
+ ]),
361
+ t("span", be, c(l.id), 1),
362
+ t("span", fe, [
363
+ l.restaurantStyle ? (o(), i(A, { key: 0 }, [
364
+ w(c(l.restaurantStyle) + " · ", 1)
365
+ ], 64)) : b("", !0),
366
+ w(c(l.industries.join(", ") || "General-purpose") + " · " + c(l.environments.join(", ")), 1)
367
+ ])
368
+ ]),
369
+ t("div", ye, [
370
+ p(k, {
371
+ label: "Edit code",
372
+ variant: "secondary",
373
+ loading: v.value === l.id,
374
+ disabled: v.value !== null,
375
+ onClick: (N) => I(l.id)
376
+ }, null, 8, ["loading", "disabled", "onClick"]),
377
+ l.default ? b("", !0) : (o(), E(k, {
378
+ key: 0,
379
+ label: "Delete",
380
+ variant: "destructive",
381
+ loading: f.value === l.id,
382
+ disabled: f.value !== null,
383
+ onClick: (N) => D(l.id)
384
+ }, null, 8, ["loading", "disabled", "onClick"]))
385
+ ])
386
+ ]))), 128))
387
+ ])
388
+ ])
389
+ ]);
390
+ };
391
+ }
392
+ }), xe = /* @__PURE__ */ O(ke, [["__scopeId", "data-v-556dfe7b"]]);
393
+ export {
394
+ xe as default
395
+ };
@@ -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-BFTX5VVx.js";
3
+ import { u as l } from "./portalContext-Bhp7NA0c.js";
4
4
  import { w as m, a as f } from "./portalNavigation-DKCfwTH8.js";
5
5
  const _ = {
6
6
  class: "portal-loading",
@@ -0,0 +1,48 @@
1
+ import { a as o } from "./routes-DPGrYgQQ.js";
2
+ import { ref as i } from "vue";
3
+ import { c as u } from "./controlPlane-sXaC6pAh.js";
4
+ function s(t, e) {
5
+ if (typeof window > "u") return e;
6
+ try {
7
+ const n = window.localStorage.getItem(t);
8
+ return n === null ? e : n === "1";
9
+ } catch {
10
+ return e;
11
+ }
12
+ }
13
+ function l(t, e) {
14
+ if (typeof window > "u") return e;
15
+ try {
16
+ const n = Number(window.localStorage.getItem(t));
17
+ return Number.isFinite(n) ? n : e;
18
+ } catch {
19
+ return e;
20
+ }
21
+ }
22
+ function a(t, e) {
23
+ if (!(typeof window > "u"))
24
+ try {
25
+ window.localStorage.setItem(t, e);
26
+ } catch {
27
+ }
28
+ }
29
+ function w(t, e) {
30
+ a(t, e ? "1" : "0");
31
+ }
32
+ let r = null;
33
+ function d() {
34
+ return r || (r = u(o.adminWhoami()).then((t) => t.isAdmin).catch(() => !1)), r;
35
+ }
36
+ function h() {
37
+ const t = i(!1);
38
+ return d().then((e) => {
39
+ t.value = e;
40
+ }), t;
41
+ }
42
+ export {
43
+ l as a,
44
+ a as b,
45
+ s as r,
46
+ h as u,
47
+ w
48
+ };
package/dist/app.js CHANGED
@@ -4,24 +4,24 @@ const o = [
4
4
  path: "/platforms/mobile",
5
5
  name: "miniprogram-v2-mobile-projects",
6
6
  meta: { title: "Mobile" },
7
- component: () => import("./MobileProjectsView-BruZHfdq.js")
7
+ component: () => import("./MobileProjectsView-DaFYj3UE.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-CBEL5PT2.js")
14
+ component: () => import("./EcosystemView-Drggj4cB.js")
15
15
  },
16
16
  {
17
17
  path: "/workspace",
18
18
  name: "miniprogram-v2-control",
19
- component: () => import("./WorkspaceEntryView-BIumdrty.js")
19
+ component: () => import("./WorkspaceEntryView-C5SWhNI5.js")
20
20
  },
21
21
  {
22
22
  path: "/p/:projectId/:view(workspace|releases|sessions)?",
23
23
  name: "miniprogram-v2-project",
24
- component: () => import("./ControlPlaneView-l_gDDBtb.js")
24
+ component: () => import("./ControlPlaneView-BPaHROu_.js")
25
25
  },
26
26
  {
27
27
  path: "/brand-kit",
@@ -33,13 +33,13 @@ const o = [
33
33
  path: "/pages",
34
34
  name: "miniprogram-v2-pages",
35
35
  meta: { title: "Pages" },
36
- component: () => import("./PagesView-BYzldeqE.js")
36
+ component: () => import("./PagesView-B9YEpCbi.js")
37
37
  },
38
38
  {
39
39
  path: "/settings",
40
40
  name: "miniprogram-v2-settings",
41
41
  meta: { title: "Settings" },
42
- component: () => import("./PortalSettingsView-Bl4z9cFG.js")
42
+ component: () => import("./PortalSettingsView-C3uVMGH5.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: "Module library" },
56
- component: () => import("./ModuleCenterView-DI6Pakkr.js")
56
+ component: () => import("./ModuleCenterView-BI0Vbkcu.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: "Module library" },
64
- component: () => import("./ModuleDetailView-DteTTb-3.js")
64
+ component: () => import("./ModuleDetailView-DKmc4Hp2.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-DNjVytwE.js")
75
+ component: () => import("./TemplateCenterView-DcVMSYU0.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-BdvPLQMC.js")), i = t(() => import("./LegacyWorkspaceEntry-lEMtmdIe.js"));
81
+ ], r = {}, a = t(() => import("./App-BVQ9oPjV.js")), i = t(() => import("./LegacyWorkspaceEntry-lEMtmdIe.js"));
82
82
  export {
83
83
  a as FmApp,
84
84
  i as MiniprogramWorkspace,
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-miniprogram-v2",
3
- "version": "0.2.2-dev.21",
3
+ "version": "0.2.2-dev.23",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -1,4 +1,4 @@
1
- import { a as b } from "./routes-D6BQSP4i.js";
1
+ import { a as b } from "./routes-DPGrYgQQ.js";
2
2
  import { useCoreStore as d } from "@feedmepos/mf-common";
3
3
  import { c as g, e as h } from "./controlPlane-sXaC6pAh.js";
4
4
  import { provide as y, computed as f, ref as c, watch as C, onScopeDispose as w, inject as x } from "vue";
@@ -0,0 +1,85 @@
1
+ const r = (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) => r(e, s),
5
+ provision: (e, s) => `${r(e, s)}/provision`,
6
+ refreshSlug: (e, s) => `${r(e, s)}/refresh-slug`,
7
+ sessions: (e, s) => `${r(e, s)}/sessions`,
8
+ session: (e, s, a) => `${r(e, s)}/sessions/${a}`,
9
+ messages: (e, s, a) => `${i.session(e, s, a)}/messages`,
10
+ startStatus: (e, s, a) => `${i.session(e, s, a)}/start-status`,
11
+ changes: (e, s, a, t = !1) => `${i.session(e, s, a)}/changes${t ? "?refresh=1" : ""}`,
12
+ checkpoints: (e, s, a) => `${i.session(e, s, a)}/checkpoints`,
13
+ aiBillingPreflight: (e, s, a) => `${i.session(e, s, a)}/ai-billing/preflight`,
14
+ restoreCheckpoint: (e, s, a, t) => `${i.checkpoints(e, s, a)}/${t}/restore`,
15
+ previewBridgeTicket: (e, s, a) => `${i.session(e, s, a)}/preview-bridge/ticket`,
16
+ previewBridgeSocket: (e, s, a) => `${i.session(e, s, a)}/preview-bridge/socket`,
17
+ uploads: (e, s, a, t = "") => `${i.session(e, s, a)}/uploads${t ? `?${t}` : ""}`,
18
+ archive: (e, s, a) => `${i.session(e, s, a)}/archive`,
19
+ commit: (e, s, a) => `${i.session(e, s, a)}/commit`,
20
+ resume: (e, s, a) => `${i.session(e, s, a)}/resume`,
21
+ restartPreview: (e, s, a) => `${i.session(e, s, a)}/restart-preview`,
22
+ fork: (e, s, a) => `${i.session(e, s, a)}/fork`,
23
+ flushEvents: (e, s, a) => `${i.session(e, s, a)}/events/flush`,
24
+ revertTurn: (e, s, a) => `${i.session(e, s, a)}/turns/revert`,
25
+ unrevertTurn: (e, s, a) => `${i.session(e, s, a)}/turns/unrevert`,
26
+ releases: (e, s) => `${r(e, s)}/releases`,
27
+ /** Internal-admin only. Extracts a new restaurant style out of a session's
28
+ * verified checkpoint and, once confirmed, opens a PR against this repo. */
29
+ publishAsTemplate: (e, s) => `${r(e, s)}/publish-as-template`,
30
+ publishRelease: (e, s, a) => `${i.releases(e, s)}/${a}/publish`,
31
+ releasePreviewUrl: (e, s, a) => `${i.releases(e, s)}/${a}/preview-url`,
32
+ rollbackToRelease: (e, s, a) => `${r(e, s)}/rollback-to-release/${a}`,
33
+ rollbackToV1: (e, s) => `${r(e, s)}/rollback-to-v1`,
34
+ start: (e, s, a) => {
35
+ const t = new URLSearchParams();
36
+ e && t.set("businessId", e), s && t.set("projectId", s), a && t.set("sessionId", a);
37
+ const p = t.toString();
38
+ return `/api/start${p ? `?${p}` : ""}`;
39
+ },
40
+ opencode: (e = "") => `/api/opencode${e ? `/${e.replace(/^\/+/, "")}` : ""}`,
41
+ /** The shared component library's catalog. Deliberately not under a
42
+ * business/project path: the library belongs to no business, and the
43
+ * module centre is not inside a workspace. */
44
+ componentLibraryCatalog: () => "/api/component-library/catalog",
45
+ /** The self-contained preview document the module centre frames. Fetched with
46
+ * the portal's bearer and assigned to an iframe's `srcdoc`, never used as an
47
+ * `<iframe src>` — a navigation request carries no Authorization header,
48
+ * which is what a signed URL would otherwise exist to work around. */
49
+ componentLibraryPreview: () => "/api/component-library/preview",
50
+ /** The application templates this environment can provision, for the portal's
51
+ * picker. Not under a business/project path: the answer is a property of
52
+ * the environment, and it is needed BEFORE a project exists. */
53
+ appTemplates: () => "/api/app-templates",
54
+ /** Whether the caller is an internal admin — for the portal to decide whether to
55
+ * show internal-only entry points such as the Template Center. The real
56
+ * enforcement is on every admin route itself; this is a UI convenience. */
57
+ adminWhoami: () => "/api/admin/whoami",
58
+ /** Template Center: fork an existing physical template directory into a
59
+ * brand-new one, as a PR against this repo (see `template-fork.ts`). Not
60
+ * project-scoped — a physical template belongs to no business. */
61
+ forkAppTemplate: () => "/api/admin/app-templates/fork",
62
+ /** Template Center: delete an existing physical template directory, as a PR
63
+ * against this repo. Refused for the default template or one any project
64
+ * still references — see the endpoint's own doc comment. */
65
+ deleteAppTemplate: (e) => `/api/admin/app-templates/${e}/delete`,
66
+ /** Template Center: physical templates whose "create template" or "delete
67
+ * template" PR is still open — read live from GitHub, not a stored list,
68
+ * so a row disappears the moment its PR merges or is closed. */
69
+ pendingTemplateChanges: () => "/api/admin/app-templates/pending-changes",
70
+ /** Template Center: merge a pending template change's PR directly from the
71
+ * "In review" list, without leaving the portal. Refuses to act on
72
+ * anything that is not itself a pending template create/delete PR. */
73
+ mergePendingTemplateChange: (e) => `/api/admin/app-templates/pending-changes/${e}/merge`,
74
+ /** Template Center: close a pending template change's PR without merging
75
+ * and delete its branch — the "In review" list's reject action. */
76
+ rejectPendingTemplateChange: (e) => `/api/admin/app-templates/pending-changes/${e}/reject`,
77
+ /** Template Center: find-or-create the template-editing project a
78
+ * physical template edits through — the same chat/preview/checkpoint
79
+ * workspace a merchant project gets, pointed at `templates/<id>/` in this
80
+ * repo instead. Internal-admin only. */
81
+ appTemplateEditingProject: (e) => `/api/admin/app-templates/${e}/editing-project`
82
+ };
83
+ export {
84
+ i as a
85
+ };