@feedmepos/mf-miniprogram-v2 0.2.2-dev.9 → 0.2.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 (38) hide show
  1. package/dist/App-KzUdmcX4.js +214 -0
  2. package/dist/{AppTemplatePicker-eKlQ0c54.js → AppTemplatePicker-CNJ6kIJk.js} +158 -105
  3. package/dist/BrandFontPicker-Bd30BHsN.js +241 -0
  4. package/dist/BrandKitView-z2Pu8wAQ.js +249 -0
  5. package/dist/{ControlPlaneView-DGDA8EFh.js → ControlPlaneView-Bd_Fl_3b.js} +7751 -7323
  6. package/dist/{EcosystemView-Cx-3k7lB.js → EcosystemView-BDXgMQN_.js} +7 -7
  7. package/dist/{LegacyWorkspaceEntry-opz_kWz9.js → LegacyWorkspaceEntry-CADRpDkg.js} +2 -2
  8. package/dist/MobileProjectsView-CvCPtFAF.js +313 -0
  9. package/dist/{ModuleCenterView-DEShxy_e.js → ModuleCenterView-B08oZqQw.js} +34 -34
  10. package/dist/{ModuleDetailView-BSndm4ov.js → ModuleDetailView-lROTkaR7.js} +49 -49
  11. package/dist/{PagesView-CegMd6GC.js → PagesView-DOG8RSen.js} +2 -2
  12. package/dist/{PlatformUnavailableView-j0_2YBKm.js → PlatformUnavailableView-C1RltAIw.js} +1 -1
  13. package/dist/{PortalSettingsView-DFz6FUd9.js → PortalSettingsView-BK6kRgtf.js} +7 -7
  14. package/dist/StatusBadge.vue_vue_type_script_setup_true_lang-CMgQ0bd_.js +30 -0
  15. package/dist/TemplateCenterView-niXTXw9y.js +426 -0
  16. package/dist/WorkspaceEntryView-DzR8DQC5.js +21 -0
  17. package/dist/adminAccess-CDxAuQ-M.js +48 -0
  18. package/dist/app.js +22 -11
  19. package/dist/{controlPlane-CoEgf9BA.js → controlPlane-DT3t_ftg.js} +11 -11
  20. package/dist/{index-D5qXvcfE.js → index-CIJWcl_6.js} +10 -9
  21. package/dist/package.json +2 -1
  22. package/dist/{portalContext-C4HL_0kl.js → portalContext-B2pXdNtB.js} +2 -2
  23. package/dist/portalNavigation-DKCfwTH8.js +28 -0
  24. package/dist/routes-CeuodIgg.js +95 -0
  25. package/dist/style.css +1 -1
  26. package/dist/templatePickerFlag-CosY_15R.js +13 -0
  27. package/dist/{useBrandKit-BlKlqpo2.js → useBrandKit-CKN2zLC8.js} +3 -3
  28. package/dist/{useModuleCatalog-CkNuZzNM.js → useModuleCatalog-B9HXHA-e.js} +3 -3
  29. package/package.json +2 -1
  30. package/dist/App-BtDqnBq4.js +0 -193
  31. package/dist/BrandFontPicker-CyLbp5nr.js +0 -240
  32. package/dist/BrandKitView-CaxS1T-W.js +0 -217
  33. package/dist/MobileProjectsView-DEQ6q6Si.js +0 -279
  34. package/dist/StatusBadge.vue_vue_type_script_setup_true_lang-Bh9Eoe_H.js +0 -26
  35. package/dist/WorkspaceEntryView-e2EUnq9A.js +0 -21
  36. package/dist/localPreference-DneUpUrQ.js +0 -34
  37. package/dist/portalNavigation-DOF4Ah49.js +0 -28
  38. package/dist/routes-Boz_WlNM.js +0 -54
@@ -0,0 +1,426 @@
1
+ import { defineComponent as B, ref as o, computed as K, resolveComponent as F, openBlock as s, createBlock as V, withCtx as Q, createElementVNode as a, createElementBlock as i, Fragment as x, createTextVNode as R, toDisplayString as u, createVNode as c, createCommentVNode as v, onMounted as X, renderList as M, normalizeClass as Y } from "vue";
2
+ import { a as k } from "./routes-CeuodIgg.js";
3
+ import { useDialog as Z } from "@feedmepos/ui-library";
4
+ import { useRouter as ee } from "vue-router";
5
+ import { c as C, e as T } from "./controlPlane-DT3t_ftg.js";
6
+ import { _ as L } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
+ const te = ["href"], ae = {
8
+ key: 0,
9
+ class: "portal-error",
10
+ role: "alert"
11
+ }, le = "miniprogram-vue-v2", se = /* @__PURE__ */ B({
12
+ __name: "ForkTemplateDialog",
13
+ emits: ["close", "created"],
14
+ setup(z, { emit: E }) {
15
+ const b = E, d = o(""), _ = o(""), P = o(""), p = o(!1), y = o(""), w = o(""), A = o(0), q = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/, m = K(
16
+ () => !p.value && q.test(d.value.trim()) && _.value.trim().length > 0 && P.value.trim().length > 0
17
+ );
18
+ async function $() {
19
+ if (m.value) {
20
+ p.value = !0, y.value = "";
21
+ try {
22
+ const f = await C(k.forkAppTemplate(), {
23
+ method: "POST",
24
+ body: JSON.stringify({
25
+ sourceAppTemplateId: le,
26
+ newAppTemplateId: d.value.trim(),
27
+ label: _.value.trim(),
28
+ description: P.value.trim()
29
+ })
30
+ });
31
+ w.value = f.pullRequestUrl, A.value = f.fileCount, b("created");
32
+ } catch (f) {
33
+ y.value = T(f);
34
+ } finally {
35
+ p.value = !1;
36
+ }
37
+ }
38
+ }
39
+ return (f, n) => {
40
+ const h = F("FmButton"), I = F("FmTextField"), S = F("FmTextarea"), O = F("FmCard");
41
+ return s(), V(O, { class: "fork-template-dialog" }, {
42
+ default: Q(() => [
43
+ n[7] || (n[7] = a("h2", null, "Create template", -1)),
44
+ w.value ? (s(), i(x, { key: 0 }, [
45
+ a("p", null, [
46
+ R(" Opened a pull request copying " + u(A.value) + " file(s) into a brand-new ", 1),
47
+ a("code", null, "templates/" + u(d.value) + "/", 1),
48
+ n[5] || (n[5] = R(" 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))
49
+ ]),
50
+ a("footer", null, [
51
+ a("a", {
52
+ class: "fork-template-dialog__review-link",
53
+ href: w.value,
54
+ target: "_blank",
55
+ rel: "noopener"
56
+ }, "Review PR", 8, te),
57
+ c(h, {
58
+ label: "Done",
59
+ onClick: n[0] || (n[0] = (g) => b("close"))
60
+ })
61
+ ])
62
+ ], 64)) : (s(), i(x, { key: 1 }, [
63
+ n[6] || (n[6] = a("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)),
64
+ c(I, {
65
+ modelValue: d.value,
66
+ "onUpdate:modelValue": n[1] || (n[1] = (g) => d.value = g),
67
+ label: "New template id",
68
+ placeholder: "e.g. miniprogram-vue-v2-bakery",
69
+ "helper-text": "Lowercase, kebab-case. Also becomes the directory name and GitHub repository name.",
70
+ disabled: p.value,
71
+ rules: [(g) => q.test(g.trim()) || "Lowercase kebab-case, e.g. miniprogram-vue-v2-bakery"]
72
+ }, null, 8, ["modelValue", "disabled", "rules"]),
73
+ c(I, {
74
+ modelValue: _.value,
75
+ "onUpdate:modelValue": n[2] || (n[2] = (g) => _.value = g),
76
+ label: "Label",
77
+ placeholder: "Shown to merchants in the picker",
78
+ disabled: p.value
79
+ }, null, 8, ["modelValue", "disabled"]),
80
+ c(S, {
81
+ modelValue: P.value,
82
+ "onUpdate:modelValue": n[3] || (n[3] = (g) => P.value = g),
83
+ label: "Description",
84
+ placeholder: "One or two sentences on what the merchant gets",
85
+ disabled: p.value
86
+ }, null, 8, ["modelValue", "disabled"]),
87
+ y.value ? (s(), i("p", ae, u(y.value), 1)) : v("", !0),
88
+ a("footer", null, [
89
+ c(h, {
90
+ label: "Cancel",
91
+ variant: "tertiary",
92
+ disabled: p.value,
93
+ onClick: n[4] || (n[4] = (g) => b("close"))
94
+ }, null, 8, ["disabled"]),
95
+ c(h, {
96
+ label: "Open pull request",
97
+ loading: p.value,
98
+ disabled: !m.value,
99
+ onClick: $
100
+ }, null, 8, ["loading", "disabled"])
101
+ ])
102
+ ], 64))
103
+ ]),
104
+ _: 1
105
+ });
106
+ };
107
+ }
108
+ }), ie = /* @__PURE__ */ L(se, [["__scopeId", "data-v-5a38928f"]]), ne = { class: "portal-page" }, oe = { class: "portal-page-inner" }, re = { class: "portal-page-heading" }, ue = { class: "portal-page-heading__actions" }, de = {
109
+ key: 0,
110
+ class: "portal-error",
111
+ role: "alert"
112
+ }, ce = {
113
+ key: 1,
114
+ "aria-label": "Templates in review"
115
+ }, pe = { class: "template-section-heading" }, me = {
116
+ key: 0,
117
+ class: "portal-error",
118
+ role: "alert"
119
+ }, ve = {
120
+ key: 1,
121
+ class: "template-choices__list",
122
+ "aria-label": "Templates in review"
123
+ }, he = { class: "template-choices__name" }, ge = { class: "template-choices__label" }, be = { key: 0 }, _e = { class: "template-choices__id" }, fe = { class: "template-choices__actions" }, ye = ["href"], ke = { class: "template-section-heading" }, we = {
124
+ key: 2,
125
+ class: "portal-error",
126
+ role: "alert"
127
+ }, Ce = {
128
+ class: "template-choices__list",
129
+ "aria-label": "Physical templates"
130
+ }, Te = { class: "template-choices__name" }, Re = { class: "template-choices__label" }, Pe = { key: 0 }, Ae = { class: "template-choices__id" }, qe = { class: "template-choices__meta" }, $e = {
131
+ key: 0,
132
+ class: "template-status-badge template-status-badge--draft"
133
+ }, Ne = { class: "template-choices__actions" }, xe = /* @__PURE__ */ B({
134
+ __name: "TemplateCenterView",
135
+ setup(z) {
136
+ const E = ee(), b = Z(), d = o(""), _ = o(null), P = o([]), p = o(!1), y = o("");
137
+ async function w() {
138
+ p.value = !0, y.value = "";
139
+ try {
140
+ const e = await C(k.appTemplateRegistry());
141
+ P.value = e.templates;
142
+ } catch (e) {
143
+ y.value = T(e);
144
+ } finally {
145
+ p.value = !1;
146
+ }
147
+ }
148
+ const A = o([]), q = o(!1), m = o("");
149
+ async function $() {
150
+ q.value = !0, m.value = "";
151
+ try {
152
+ const e = await C(k.pendingTemplateChanges());
153
+ A.value = e.changes;
154
+ } catch (e) {
155
+ m.value = T(e);
156
+ } finally {
157
+ q.value = !1;
158
+ }
159
+ }
160
+ async function f() {
161
+ await Promise.all([w(), $()]);
162
+ }
163
+ function n() {
164
+ b.open({
165
+ title: "Create template",
166
+ dialogComponent: ie,
167
+ dialogComponentProps: { onClose: () => b.close(), onCreated: () => void f() }
168
+ });
169
+ }
170
+ const h = o(null);
171
+ async function I(e) {
172
+ h.value = e.pullRequestNumber, m.value = "";
173
+ try {
174
+ await C(k.mergePendingTemplateChange(e.pullRequestNumber), { method: "POST" }), await f();
175
+ } catch (l) {
176
+ m.value = T(l);
177
+ } finally {
178
+ h.value = null;
179
+ }
180
+ }
181
+ async function S(e) {
182
+ h.value = e.pullRequestNumber, m.value = "";
183
+ try {
184
+ await C(k.rejectPendingTemplateChange(e.pullRequestNumber), { method: "POST" }), await f();
185
+ } catch (l) {
186
+ m.value = T(l);
187
+ } finally {
188
+ h.value = null;
189
+ }
190
+ }
191
+ function O(e) {
192
+ const l = e.kind === "delete" ? "delete" : "create";
193
+ b.open({
194
+ title: `Merge — ${l} ${e.appTemplateId}?`,
195
+ 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 and its registry row is removed immediately — no control-plane redeploy involved.` : 'Merges the pull request into main as-is, without a code review step here. "Edit code" becomes available for it right away — it stays a draft, invisible to merchants, until you publish it below.',
196
+ primaryActions: { text: "Merge", close: !0, variant: "primary" },
197
+ secondaryActions: { text: "Cancel", close: !0, variant: "tertiary" }
198
+ }).onPrimary(() => void I(e));
199
+ }
200
+ function g(e) {
201
+ b.open({
202
+ title: `Reject — ${e.kind === "delete" ? "delete" : "create"} ${e.appTemplateId}?`,
203
+ message: "Closes the pull request without merging and deletes its branch. Nothing of this change is kept.",
204
+ primaryActions: { text: "Reject", close: !0, variant: "destructive" },
205
+ secondaryActions: { text: "Cancel", close: !0, variant: "tertiary" }
206
+ }).onPrimary(() => void S(e));
207
+ }
208
+ const j = o(null);
209
+ async function G(e) {
210
+ j.value = e, d.value = "";
211
+ try {
212
+ await C(k.deleteAppTemplate(e), { method: "POST" }), await $();
213
+ } catch (l) {
214
+ d.value = T(l);
215
+ } finally {
216
+ j.value = null;
217
+ }
218
+ }
219
+ function H(e) {
220
+ b.open({
221
+ title: `Delete ${e}?`,
222
+ 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.`,
223
+ primaryActions: { text: "Delete", close: !0, variant: "destructive" },
224
+ secondaryActions: { text: "Cancel", close: !0, variant: "tertiary" }
225
+ }).onPrimary(() => void G(e));
226
+ }
227
+ const N = o(null);
228
+ async function U(e, l) {
229
+ N.value = e, d.value = "";
230
+ try {
231
+ const r = l ? k.publishAppTemplate(e) : k.unpublishAppTemplate(e);
232
+ await C(r, { method: "POST" }), await w();
233
+ } catch (r) {
234
+ d.value = T(r);
235
+ } finally {
236
+ N.value = null;
237
+ }
238
+ }
239
+ function J(e) {
240
+ b.open({
241
+ title: `Unpublish ${e.id}?`,
242
+ message: "Stops offering it to new merchants immediately. Merchants already provisioned from it are unaffected.",
243
+ primaryActions: { text: "Unpublish", close: !0, variant: "destructive" },
244
+ secondaryActions: { text: "Cancel", close: !0, variant: "tertiary" }
245
+ }).onPrimary(() => void U(e.id, !1));
246
+ }
247
+ X(() => void f());
248
+ async function W(e) {
249
+ if (!_.value) {
250
+ _.value = e, d.value = "";
251
+ try {
252
+ const l = await C(
253
+ k.appTemplateEditingProject(e),
254
+ { method: "POST" }
255
+ );
256
+ await E.push({
257
+ name: "miniprogram-v2-project",
258
+ params: { projectId: l.projectId, view: "workspace" },
259
+ query: { tpl: "1" }
260
+ });
261
+ } catch (l) {
262
+ d.value = T(l);
263
+ } finally {
264
+ _.value = null;
265
+ }
266
+ }
267
+ }
268
+ return (e, l) => {
269
+ const r = F("FmButton");
270
+ return s(), i("div", ne, [
271
+ a("div", oe, [
272
+ a("header", re, [
273
+ l[1] || (l[1] = a("div", null, [
274
+ a("p", { class: "portal-eyebrow" }, "Internal"),
275
+ a("h1", null, "Template library")
276
+ ], -1)),
277
+ a("div", ue, [
278
+ c(r, {
279
+ label: "Create template",
280
+ variant: "primary",
281
+ onClick: l[0] || (l[0] = (t) => n())
282
+ })
283
+ ])
284
+ ]),
285
+ d.value ? (s(), i("p", de, u(d.value), 1)) : v("", !0),
286
+ m.value || A.value.length > 0 ? (s(), i("section", ce, [
287
+ a("div", pe, [
288
+ l[2] || (l[2] = a("h2", { class: "template-section-title" }, "In review", -1)),
289
+ c(r, {
290
+ label: "Refresh",
291
+ variant: "tertiary",
292
+ size: "md",
293
+ loading: q.value,
294
+ onClick: $
295
+ }, null, 8, ["loading"])
296
+ ]),
297
+ l[3] || (l[3] = a("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)),
298
+ m.value ? (s(), i("p", me, [
299
+ R(u(m.value) + " ", 1),
300
+ c(r, {
301
+ label: "Retry",
302
+ variant: "tertiary",
303
+ onClick: $
304
+ })
305
+ ])) : v("", !0),
306
+ A.value.length > 0 ? (s(), i("section", ve, [
307
+ (s(!0), i(x, null, M(A.value, (t) => (s(), i("article", {
308
+ key: t.pullRequestNumber,
309
+ class: "template-choices__row"
310
+ }, [
311
+ a("div", he, [
312
+ a("span", ge, [
313
+ R(u(t.appTemplateId), 1),
314
+ t.kind === "delete" ? (s(), i("span", be, " · Delete")) : v("", !0)
315
+ ]),
316
+ a("span", _e, "Awaiting review — PR #" + u(t.pullRequestNumber), 1)
317
+ ]),
318
+ a("div", fe, [
319
+ a("a", {
320
+ class: "template-review-link",
321
+ href: t.pullRequestUrl,
322
+ target: "_blank",
323
+ rel: "noopener"
324
+ }, "Review PR", 8, ye),
325
+ c(r, {
326
+ label: "Merge",
327
+ variant: "primary",
328
+ loading: h.value === t.pullRequestNumber,
329
+ disabled: h.value !== null,
330
+ onClick: (D) => O(t)
331
+ }, null, 8, ["loading", "disabled", "onClick"]),
332
+ c(r, {
333
+ label: "Reject",
334
+ variant: "destructive",
335
+ disabled: h.value !== null,
336
+ onClick: (D) => g(t)
337
+ }, null, 8, ["disabled", "onClick"])
338
+ ])
339
+ ]))), 128))
340
+ ])) : v("", !0)
341
+ ])) : v("", !0),
342
+ a("div", ke, [
343
+ l[4] || (l[4] = a("h2", { class: "template-section-title" }, "Physical templates", -1)),
344
+ c(r, {
345
+ label: "Refresh",
346
+ variant: "tertiary",
347
+ size: "md",
348
+ loading: p.value,
349
+ onClick: w
350
+ }, null, 8, ["loading"])
351
+ ]),
352
+ l[5] || (l[5] = a("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. A draft is invisible to merchants until Published; "Delete" opens a PR removing it instead — refused outright for the default template or one any project still uses. ', -1)),
353
+ y.value ? (s(), i("p", we, [
354
+ R(u(y.value) + " ", 1),
355
+ c(r, {
356
+ label: "Retry",
357
+ variant: "tertiary",
358
+ onClick: w
359
+ })
360
+ ])) : v("", !0),
361
+ a("section", Ce, [
362
+ (s(!0), i(x, null, M(P.value, (t) => (s(), i("article", {
363
+ key: t.id,
364
+ class: "template-choices__row"
365
+ }, [
366
+ a("div", Te, [
367
+ a("span", Re, [
368
+ R(u(t.label), 1),
369
+ t.default ? (s(), i("span", Pe, " · Default")) : v("", !0)
370
+ ]),
371
+ a("span", Ae, u(t.id), 1),
372
+ a("span", qe, [
373
+ t.restaurantStyle ? (s(), i(x, { key: 0 }, [
374
+ R(u(t.restaurantStyle) + " · ", 1)
375
+ ], 64)) : v("", !0),
376
+ R(u(t.industries.join(", ") || "General-purpose") + " · " + u(t.environments.join(", ")), 1)
377
+ ])
378
+ ]),
379
+ t.pullRequestNumber ? (s(), i("span", $e, " Awaiting merge — PR #" + u(t.pullRequestNumber), 1)) : (s(), i("span", {
380
+ key: 1,
381
+ class: Y(["template-status-badge", `template-status-badge--${t.status}`])
382
+ }, u(t.status === "published" ? "Published" : "Draft"), 3)),
383
+ a("div", Ne, [
384
+ t.pullRequestNumber ? v("", !0) : (s(), i(x, { key: 0 }, [
385
+ t.status === "draft" ? (s(), V(r, {
386
+ key: 0,
387
+ label: "Publish",
388
+ variant: "primary",
389
+ loading: N.value === t.id,
390
+ disabled: N.value !== null,
391
+ onClick: (D) => U(t.id, !0)
392
+ }, null, 8, ["loading", "disabled", "onClick"])) : t.default ? v("", !0) : (s(), V(r, {
393
+ key: 1,
394
+ label: "Unpublish",
395
+ variant: "secondary",
396
+ loading: N.value === t.id,
397
+ disabled: N.value !== null,
398
+ onClick: (D) => J(t)
399
+ }, null, 8, ["loading", "disabled", "onClick"])),
400
+ c(r, {
401
+ label: "Edit code",
402
+ variant: "secondary",
403
+ loading: _.value === t.id,
404
+ disabled: _.value !== null,
405
+ onClick: (D) => W(t.id)
406
+ }, null, 8, ["loading", "disabled", "onClick"])
407
+ ], 64)),
408
+ !t.default && !t.pullRequestNumber ? (s(), V(r, {
409
+ key: 1,
410
+ label: "Delete",
411
+ variant: "destructive",
412
+ loading: j.value === t.id,
413
+ disabled: j.value !== null,
414
+ onClick: (D) => H(t.id)
415
+ }, null, 8, ["loading", "disabled", "onClick"])) : v("", !0)
416
+ ])
417
+ ]))), 128))
418
+ ])
419
+ ])
420
+ ]);
421
+ };
422
+ }
423
+ }), Se = /* @__PURE__ */ L(xe, [["__scopeId", "data-v-ebc2562e"]]);
424
+ export {
425
+ Se as default
426
+ };
@@ -0,0 +1,21 @@
1
+ import { defineComponent as s, watchEffect as a, openBlock as n, createElementBlock as p } from "vue";
2
+ import { useRoute as u, useRouter as i } from "vue-router";
3
+ import { u as l } from "./portalContext-B2pXdNtB.js";
4
+ import { w as m, a as f } from "./portalNavigation-DKCfwTH8.js";
5
+ const _ = {
6
+ class: "portal-loading",
7
+ role: "status"
8
+ }, h = /* @__PURE__ */ s({
9
+ __name: "WorkspaceEntryView",
10
+ setup(w) {
11
+ const r = l(), t = u(), c = i();
12
+ return a(() => {
13
+ var e;
14
+ const o = (e = r.context.value) == null ? void 0 : e.projectId;
15
+ o && c.replace(m(o, f(t.query.view), t.query));
16
+ }), (o, e) => (n(), p("p", _, "Opening your workspace…"));
17
+ }
18
+ });
19
+ export {
20
+ h as default
21
+ };
@@ -0,0 +1,48 @@
1
+ import { a as o } from "./routes-CeuodIgg.js";
2
+ import { ref as i } from "vue";
3
+ import { c as u } from "./controlPlane-DT3t_ftg.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,48 +4,48 @@ const o = [
4
4
  path: "/platforms/mobile",
5
5
  name: "miniprogram-v2-mobile-projects",
6
6
  meta: { title: "Mobile" },
7
- component: () => import("./MobileProjectsView-DEQ6q6Si.js")
7
+ component: () => import("./MobileProjectsView-CvCPtFAF.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-Cx-3k7lB.js")
14
+ component: () => import("./EcosystemView-BDXgMQN_.js")
15
15
  },
16
16
  {
17
17
  path: "/workspace",
18
18
  name: "miniprogram-v2-control",
19
- component: () => import("./WorkspaceEntryView-e2EUnq9A.js")
19
+ component: () => import("./WorkspaceEntryView-DzR8DQC5.js")
20
20
  },
21
21
  {
22
22
  path: "/p/:projectId/:view(workspace|releases|sessions)?",
23
23
  name: "miniprogram-v2-project",
24
- component: () => import("./ControlPlaneView-DGDA8EFh.js")
24
+ component: () => import("./ControlPlaneView-Bd_Fl_3b.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-CaxS1T-W.js")
30
+ component: () => import("./BrandKitView-z2Pu8wAQ.js")
31
31
  },
32
32
  {
33
33
  path: "/pages",
34
34
  name: "miniprogram-v2-pages",
35
35
  meta: { title: "Pages" },
36
- component: () => import("./PagesView-CegMd6GC.js")
36
+ component: () => import("./PagesView-DOG8RSen.js")
37
37
  },
38
38
  {
39
39
  path: "/settings",
40
40
  name: "miniprogram-v2-settings",
41
41
  meta: { title: "Settings" },
42
- component: () => import("./PortalSettingsView-DFz6FUd9.js")
42
+ component: () => import("./PortalSettingsView-BK6kRgtf.js")
43
43
  },
44
44
  ...["tablet", "kiosk"].map((e) => ({
45
45
  path: `/platforms/${e}`,
46
46
  name: `miniprogram-v2-${e}`,
47
47
  meta: { title: e === "tablet" ? "Tablet" : "Kiosk", kind: e },
48
- component: () => import("./PlatformUnavailableView-j0_2YBKm.js")
48
+ component: () => import("./PlatformUnavailableView-C1RltAIw.js")
49
49
  })),
50
50
  {
51
51
  // The shared component library, not this merchant's workspace — which is
@@ -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-DEShxy_e.js")
56
+ component: () => import("./ModuleCenterView-B08oZqQw.js")
57
57
  },
58
58
  {
59
59
  // Keyed by the module's directory name, which is what the catalog, the
@@ -61,13 +61,24 @@ const o = [
61
61
  path: "/modules/:name",
62
62
  name: "miniprogram-v2-module-detail",
63
63
  meta: { title: "Module library" },
64
- component: () => import("./ModuleDetailView-BSndm4ov.js")
64
+ component: () => import("./ModuleDetailView-lROTkaR7.js")
65
+ },
66
+ {
67
+ // Internal-only: linked from the main nav (App.vue), but only once
68
+ // `useIsPlatformAdmin()` resolves true — a non-admin who still guesses the
69
+ // URL is caught by the `beforeEach` guard in `./index.ts`, which checks
70
+ // `meta.requiresAdmin` and sends them to the same place an unmatched URL
71
+ // goes, below.
72
+ path: "/internal/template-center",
73
+ name: "miniprogram-v2-template-center",
74
+ meta: { title: "Template library", requiresAdmin: !0 },
75
+ component: () => import("./TemplateCenterView-niXTXw9y.js")
65
76
  },
66
77
  {
67
78
  path: "/:pathMatch(.*)*",
68
79
  redirect: (e) => ({ name: "miniprogram-v2-ecosystem", query: e.query, params: {} })
69
80
  }
70
- ], r = {}, a = t(() => import("./App-BtDqnBq4.js")), i = t(() => import("./LegacyWorkspaceEntry-opz_kWz9.js"));
81
+ ], r = {}, a = t(() => import("./App-KzUdmcX4.js")), i = t(() => import("./LegacyWorkspaceEntry-CADRpDkg.js"));
71
82
  export {
72
83
  a as FmApp,
73
84
  i as MiniprogramWorkspace,
@@ -1,5 +1,5 @@
1
- import { a as f, e as d, D as m } from "./index-D5qXvcfE.js";
2
- import { useCoreStore as a, FeedMeAuth as p } from "@feedmepos/mf-common";
1
+ import { a as f, e as d, D as p } from "./index-CIJWcl_6.js";
2
+ import { useCoreStore as a, FeedMeAuth as m } from "@feedmepos/mf-common";
3
3
  const h = [
4
4
  "AE",
5
5
  "AU",
@@ -42,11 +42,11 @@ function k(e, n, t) {
42
42
  function B(e) {
43
43
  return e.replace(/\/+$/, "");
44
44
  }
45
- function v() {
46
- return B("https://miniprogram-v2-api.feedmedev.vip");
45
+ function y() {
46
+ return B("https://miniprogram-v2-api.feedme.vip");
47
47
  }
48
- function y(e) {
49
- const n = v();
48
+ function v(e) {
49
+ const n = y();
50
50
  return n ? `${n}${e.startsWith("/") ? e : `/${e}`}` : e;
51
51
  }
52
52
  function i() {
@@ -54,7 +54,7 @@ function i() {
54
54
  }
55
55
  function u() {
56
56
  var e;
57
- return ((e = i()) == null ? void 0 : e._id) ?? m;
57
+ return ((e = i()) == null ? void 0 : e._id) ?? p;
58
58
  }
59
59
  function C() {
60
60
  var e;
@@ -69,7 +69,7 @@ function $() {
69
69
  }
70
70
  function x() {
71
71
  var r;
72
- const e = (r = C()) == null ? void 0 : r.trim().toLowerCase(), n = e && /^[a-z0-9-]+$/.test(e) ? e : u(), t = f(d("fmmf:dev")).liveDomain;
72
+ const e = (r = C()) == null ? void 0 : r.trim().toLowerCase(), n = e && /^[a-z0-9-]+$/.test(e) ? e : u(), t = f(d("fmmf:prod")).liveDomain;
73
73
  return `https://${n}.${t}`;
74
74
  }
75
75
  function S(e) {
@@ -85,7 +85,7 @@ class T extends Error {
85
85
  }
86
86
  function c() {
87
87
  var n;
88
- return ((n = a().sessionUser.value) == null ? void 0 : n.token) || p.token || "";
88
+ return ((n = a().sessionUser.value) == null ? void 0 : n.token) || m.token || "";
89
89
  }
90
90
  async function E() {
91
91
  let e = c();
@@ -105,7 +105,7 @@ async function l(e, n = {}) {
105
105
  n.body && !t.has("Content-Type") && t.set("Content-Type", "application/json");
106
106
  const r = new AbortController(), o = window.setTimeout(() => r.abort(), 15e3);
107
107
  try {
108
- const s = await P(y(e), {
108
+ const s = await P(v(e), {
109
109
  ...n,
110
110
  headers: t,
111
111
  signal: n.signal ?? r.signal
@@ -131,7 +131,7 @@ export {
131
131
  b as c,
132
132
  P as d,
133
133
  F as e,
134
- y as f,
134
+ v as f,
135
135
  E as g,
136
136
  u as h,
137
137
  C as i,