@feedmepos/mf-miniprogram-v2 0.2.5 → 0.2.6-dev.0

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 (25) hide show
  1. package/dist/{App-qAELeU_7.js → App-B8Qhgf0V.js} +2 -2
  2. package/dist/{BrandFontPicker-BZyGrK3D.js → BrandFontPicker-BzsoYtYG.js} +1 -1
  3. package/dist/{BrandKitView-CzefaEEN.js → BrandKitView-HqIYrYNt.js} +2 -2
  4. package/dist/{ControlPlaneView-DmXe1Avx.js → ControlPlaneView-BGKGx1gE.js} +7436 -7242
  5. package/dist/{EcosystemView-C-y5cPOp.js → EcosystemView-BG3Gba74.js} +3 -3
  6. package/dist/{LegacyWorkspaceEntry-CADRpDkg.js → LegacyWorkspaceEntry-lEMtmdIe.js} +1 -1
  7. package/dist/MobileProjectDialog-mNUZfDy7.js +389 -0
  8. package/dist/MobileProjectsView-DW2BNTNc.js +224 -0
  9. package/dist/{ModuleCenterView-B08oZqQw.js → ModuleCenterView-BBaQu0Pm.js} +1 -1
  10. package/dist/{ModuleDetailView-lROTkaR7.js → ModuleDetailView-ChrsLmJa.js} +1 -1
  11. package/dist/{PagesView-DOG8RSen.js → PagesView-CPYtQtsx.js} +1 -1
  12. package/dist/{PortalSettingsView-BK6kRgtf.js → PortalSettingsView-C60zqwk0.js} +4 -4
  13. package/dist/{TemplateCenterView-niXTXw9y.js → TemplateCenterView-Da9HzssA.js} +1 -1
  14. package/dist/{WorkspaceEntryView-DzR8DQC5.js → WorkspaceEntryView-DE82gwZH.js} +1 -1
  15. package/dist/{adminAccess-CDxAuQ-M.js → adminAccess-Cy0P9Hg-.js} +1 -1
  16. package/dist/app.js +11 -11
  17. package/dist/{controlPlane-DT3t_ftg.js → controlPlane-CDopeXyb.js} +17 -17
  18. package/dist/package.json +1 -1
  19. package/dist/{portalContext-B2pXdNtB.js → portalContext-IOgByqvZ.js} +1 -1
  20. package/dist/style.css +1 -1
  21. package/dist/{useBrandKit-CQv08nyY.js → useBrandKit-C3CGmni1.js} +2 -2
  22. package/dist/{useModuleCatalog-B9HXHA-e.js → useModuleCatalog-B_6PWpER.js} +1 -1
  23. package/package.json +1 -1
  24. package/dist/AppTemplatePicker.vue_vue_type_script_setup_true_lang-LE_aKvfg.js +0 -198
  25. package/dist/MobileProjectsView-BCXdpVTc.js +0 -331
@@ -1,6 +1,6 @@
1
1
  import { a as xt, e as jt } from "./index-CIJWcl_6.js";
2
2
  import { computed as nt, reactive as Et } from "vue";
3
- import { h as j, e as ot } from "./controlPlane-DT3t_ftg.js";
3
+ import { g as j, e as ot } from "./controlPlane-CDopeXyb.js";
4
4
  import { useCoreStore as At } from "@feedmepos/mf-common";
5
5
  import { g as Nt, c as Tt } from "./_commonjsHelpers-DaMA6jEr.js";
6
6
  const it = [
@@ -793,7 +793,7 @@ function me(e) {
793
793
  return `#${s}${s}${r}${r}${n}${n}`;
794
794
  }
795
795
  function oe() {
796
- return xt(jt("fmmf:prod")).apiOrigin;
796
+ return xt(jt("fmmf:dev")).apiOrigin;
797
797
  }
798
798
  function st(e) {
799
799
  return `${oe()}/metadata/${e}/brandkit`;
@@ -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
2
  import { a as w } from "./routes-CeuodIgg.js";
3
- import { c as M, e as y, m as $ } from "./controlPlane-DT3t_ftg.js";
3
+ import { c as M, e as y, m as $ } from "./controlPlane-CDopeXyb.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.5",
3
+ "version": "0.2.6-dev.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -1,198 +0,0 @@
1
- import { defineComponent as k, computed as x, openBlock as a, createElementBlock as l, createStaticVNode as m, createCommentVNode as p, createElementVNode as e, createVNode as b, toDisplayString as h, Fragment as w, renderList as _, normalizeClass as y } from "vue";
2
- function K(t) {
3
- return t === "active" ? "success" : t === "needs_attention" ? "warning" : "neutral";
4
- }
5
- function O(t) {
6
- return t === "active" ? "Active" : t === "needs_attention" ? "Needs attention" : "Archived";
7
- }
8
- function X(t) {
9
- return t === "succeeded" ? "success" : t === "failed" ? "error" : t === "queued" || t === "running" ? "info" : "neutral";
10
- }
11
- function Y(t) {
12
- switch (t) {
13
- case "queued":
14
- return "Queued";
15
- case "running":
16
- return "Running";
17
- case "succeeded":
18
- return "Built";
19
- case "failed":
20
- return "Build failed";
21
- default:
22
- return "No build yet";
23
- }
24
- }
25
- function Z(t) {
26
- switch (t) {
27
- case "ready":
28
- return "Ready";
29
- case "provisioning":
30
- return "Setting up";
31
- case "failed":
32
- return "Setup failed";
33
- default:
34
- return "Not set up";
35
- }
36
- }
37
- const C = ["preview", "published", "rolled_back"];
38
- function tt(t) {
39
- return C.includes(t.status);
40
- }
41
- function et(t) {
42
- return t.is_live === 1 ? "Live" : t.build_status === "queued" || t.build_status === "running" ? "Building" : t.build_status === "failed" ? "Failed" : t.build_status === "succeeded" ? "Ready" : "Draft";
43
- }
44
- function rt(t) {
45
- return t.is_live === 1 ? "primary" : t.build_status === "succeeded" ? "success" : t.build_status === "queued" || t.build_status === "running" ? "info" : t.build_status === "failed" ? "error" : "neutral";
46
- }
47
- const A = {
48
- key: 0,
49
- viewBox: "0 0 56 96",
50
- class: "h-[72px] w-[42px] shrink-0 rounded-[6px] border border-portal-border-default bg-portal-bg-default",
51
- "aria-hidden": "true",
52
- focusable: "false"
53
- }, E = {
54
- key: 0,
55
- fill: "currentColor",
56
- class: "text-fm-color-neutral-gray-300"
57
- }, B = {
58
- key: 1,
59
- fill: "currentColor",
60
- class: "text-fm-color-neutral-gray-300"
61
- }, L = {
62
- key: 2,
63
- fill: "currentColor",
64
- class: "text-fm-color-neutral-gray-300"
65
- }, v = /* @__PURE__ */ k({
66
- __name: "AppTemplateThumbnail",
67
- props: {
68
- restaurantStyle: {}
69
- },
70
- setup(t) {
71
- const d = t, u = x(
72
- () => d.restaurantStyle === "qsr" || d.restaurantStyle === "coffee" || d.restaurantStyle === "tea"
73
- );
74
- return (g, o) => u.value ? (a(), l("svg", A, [
75
- t.restaurantStyle === "qsr" ? (a(), l("g", E, [...o[0] || (o[0] = [
76
- m('<rect x="6" y="7" width="44" height="6" rx="3"></rect><rect x="6" y="18" width="19" height="18" rx="2"></rect><rect x="31" y="18" width="19" height="18" rx="2"></rect><rect x="6" y="40" width="19" height="18" rx="2"></rect><rect x="31" y="40" width="19" height="18" rx="2"></rect><rect x="6" y="62" width="19" height="18" rx="2"></rect><rect x="31" y="62" width="19" height="18" rx="2"></rect><rect x="6" y="85" width="44" height="7" rx="3.5" class="text-fm-color-neutral-gray-400"></rect>', 8)
77
- ])])) : t.restaurantStyle === "coffee" ? (a(), l("g", B, [...o[1] || (o[1] = [
78
- m('<rect x="6" y="7" width="44" height="30" rx="3"></rect><rect x="6" y="43" width="26" height="4" rx="2"></rect><rect x="6" y="53" width="44" height="12" rx="2"></rect><rect x="6" y="69" width="44" height="12" rx="2"></rect><rect x="6" y="87" width="18" height="4" rx="2"></rect>', 5)
79
- ])])) : (a(), l("g", L, [...o[2] || (o[2] = [
80
- m('<rect x="6" y="7" width="44" height="5" rx="2.5"></rect><rect x="6" y="17" width="44" height="9" rx="2"></rect><rect x="6" y="28" width="9" height="4" rx="2" class="text-fm-color-neutral-gray-400"></rect><rect x="18" y="28" width="9" height="4" rx="2" class="text-fm-color-neutral-gray-400"></rect><rect x="30" y="28" width="9" height="4" rx="2" class="text-fm-color-neutral-gray-400"></rect><rect x="6" y="38" width="44" height="9" rx="2"></rect><rect x="6" y="49" width="9" height="4" rx="2" class="text-fm-color-neutral-gray-400"></rect><rect x="18" y="49" width="9" height="4" rx="2" class="text-fm-color-neutral-gray-400"></rect><rect x="6" y="59" width="44" height="9" rx="2"></rect><rect x="6" y="70" width="9" height="4" rx="2" class="text-fm-color-neutral-gray-400"></rect><rect x="18" y="70" width="9" height="4" rx="2" class="text-fm-color-neutral-gray-400"></rect><rect x="30" y="70" width="9" height="4" rx="2" class="text-fm-color-neutral-gray-400"></rect><rect x="6" y="80" width="44" height="9" rx="2"></rect>', 13)
81
- ])]))
82
- ])) : p("", !0);
83
- }
84
- }), N = {
85
- key: 0,
86
- class: "rounded-lg border border-portal-border-default bg-portal-bg-default p-16"
87
- }, T = { class: "mt-12 flex items-start gap-12" }, q = { class: "min-w-0 max-w-[640px] flex-1" }, $ = { class: "m-0 fm-typo-en-body-md-600 text-portal-text-primary" }, D = { class: "m-0 mt-4 fm-typo-en-body-sm-400 text-portal-text-muted" }, R = {
88
- key: 1,
89
- class: "rounded-lg border border-portal-border-default bg-portal-bg-default p-16"
90
- }, P = { class: "mt-12 max-w-[640px]" }, F = {
91
- key: 0,
92
- class: "m-0 mb-8 fm-typo-en-body-sm-600 uppercase tracking-wide text-portal-text-muted"
93
- }, I = { class: "flex flex-col gap-8" }, j = ["aria-checked", "disabled", "onClick"], z = {
94
- key: 0,
95
- class: "h-[6px] w-[6px] rounded-full bg-portal-bg-default"
96
- }, H = { class: "min-w-0 max-w-[640px] flex-1" }, M = { class: "flex flex-wrap items-center gap-8" }, Q = { class: "fm-typo-en-body-md-600 text-portal-text-primary" }, U = {
97
- key: 0,
98
- class: "rounded-full bg-portal-bg-canvas px-8 py-[2px] fm-typo-en-body-sm-400 text-portal-text-muted"
99
- }, W = { class: "mt-4 block fm-typo-en-body-sm-400 text-portal-text-muted" }, st = /* @__PURE__ */ k({
100
- __name: "AppTemplatePicker",
101
- props: {
102
- templates: {},
103
- modelValue: {},
104
- disabled: { type: Boolean }
105
- },
106
- emits: ["update:modelValue"],
107
- setup(t, { emit: d }) {
108
- const u = t, g = d, o = x(() => u.templates.length > 1), f = x(() => u.templates.length === 1 ? u.templates[0] : null), S = x(() => {
109
- const c = [], n = /* @__PURE__ */ new Map();
110
- for (const r of u.templates) {
111
- if (!r.industries.length) {
112
- c.push(r);
113
- continue;
114
- }
115
- for (const i of r.industries) {
116
- const s = n.get(i) ?? [];
117
- s.push(r), n.set(i, s);
118
- }
119
- }
120
- return [
121
- ...c.length ? [{ label: null, templates: c }] : [],
122
- ...[...n.entries()].sort(([r], [i]) => r.localeCompare(i)).map(([r, i]) => ({ label: r, templates: i }))
123
- ];
124
- });
125
- function V(c) {
126
- u.disabled || g("update:modelValue", c);
127
- }
128
- return (c, n) => f.value ? (a(), l("section", N, [
129
- n[0] || (n[0] = e("p", { class: "m-0 fm-typo-en-body-md-600 text-portal-text-primary" }, "App template", -1)),
130
- e("div", T, [
131
- b(v, {
132
- "restaurant-style": f.value.restaurantStyle
133
- }, null, 8, ["restaurant-style"]),
134
- e("div", q, [
135
- e("p", $, h(f.value.label), 1),
136
- e("p", D, h(f.value.description), 1)
137
- ])
138
- ])
139
- ])) : o.value ? (a(), l("section", R, [
140
- n[1] || (n[1] = e("p", { class: "m-0 fm-typo-en-body-md-600 text-portal-text-primary" }, "App template", -1)),
141
- n[2] || (n[2] = e("p", { class: "m-0 mt-4 fm-typo-en-body-sm-400 text-portal-text-muted" }, " Choose how this app looks and works for your customers. This cannot be changed after setup. ", -1)),
142
- e("div", P, [
143
- (a(!0), l(w, null, _(S.value, (r, i) => (a(), l("div", {
144
- key: r.label ?? "__general",
145
- role: "radiogroup",
146
- "aria-label": "App template",
147
- class: y(i === 0 ? "" : "mt-16")
148
- }, [
149
- r.label ? (a(), l("p", F, h(r.label), 1)) : p("", !0),
150
- e("div", I, [
151
- (a(!0), l(w, null, _(r.templates, (s) => (a(), l("button", {
152
- key: s.id,
153
- type: "button",
154
- role: "radio",
155
- "aria-checked": t.modelValue === s.id,
156
- disabled: t.disabled,
157
- class: y([
158
- "flex w-full cursor-pointer items-start gap-12 rounded-lg border p-12 text-left transition disabled:cursor-not-allowed disabled:opacity-60",
159
- t.modelValue === s.id ? "border-fm-color-primary bg-fm-color-primary-50" : "border-fm-color-neutral-gray-200 bg-fm-color-neutral-white hover:border-fm-color-neutral-gray-300"
160
- ]),
161
- onClick: (G) => V(s.id)
162
- }, [
163
- e("span", {
164
- class: y([
165
- "mt-[2px] flex h-16 w-16 shrink-0 items-center justify-center rounded-full border",
166
- t.modelValue === s.id ? "border-fm-color-primary bg-fm-color-primary" : "border-fm-color-neutral-gray-300 bg-fm-color-neutral-white"
167
- ])
168
- }, [
169
- t.modelValue === s.id ? (a(), l("span", z)) : p("", !0)
170
- ], 2),
171
- b(v, {
172
- "restaurant-style": s.restaurantStyle
173
- }, null, 8, ["restaurant-style"]),
174
- e("span", H, [
175
- e("span", M, [
176
- e("span", Q, h(s.label), 1),
177
- s.default ? (a(), l("span", U, " Default ")) : p("", !0)
178
- ]),
179
- e("span", W, h(s.description), 1)
180
- ])
181
- ], 10, j))), 128))
182
- ])
183
- ], 2))), 128))
184
- ])
185
- ])) : p("", !0);
186
- }
187
- });
188
- export {
189
- st as _,
190
- rt as a,
191
- et as b,
192
- O as c,
193
- X as d,
194
- Y as e,
195
- Z as p,
196
- tt as r,
197
- K as s
198
- };
@@ -1,331 +0,0 @@
1
- import { defineComponent as A, ref as g, onMounted as O, resolveComponent as w, openBlock as a, createBlock as S, withCtx as L, createVNode as j, createElementVNode as i, toDisplayString as V, createElementBlock as b, Fragment as E, createCommentVNode as I, computed as D, h as r, withModifiers as T, onScopeDispose as Y, createTextVNode as q, unref as B } from "vue";
2
- import { useRoute as H, useRouter as J } from "vue-router";
3
- import { components as G, useDialog as K } from "@feedmepos/ui-library";
4
- import { a as P } from "./routes-CeuodIgg.js";
5
- import { c as $, e as z, a as Q } from "./controlPlane-DT3t_ftg.js";
6
- import { u as W } from "./portalContext-B2pXdNtB.js";
7
- import { w as F } from "./portalNavigation-DKCfwTH8.js";
8
- import { _ as X, p as Z } from "./AppTemplatePicker.vue_vue_type_script_setup_true_lang-LE_aKvfg.js";
9
- import { m as ee } from "./index-CIJWcl_6.js";
10
- import { _ as U } from "./_plugin-vue_export-helper-CHgC5LLL.js";
11
- import { _ as R } from "./StatusBadge.vue_vue_type_script_setup_true_lang-CMgQ0bd_.js";
12
- const te = { class: "project-dialog__body" }, oe = {
13
- key: 0,
14
- role: "status"
15
- }, ae = {
16
- key: 1,
17
- class: "portal-error",
18
- role: "alert"
19
- }, le = /* @__PURE__ */ A({
20
- __name: "MobileProjectDialog",
21
- props: {
22
- businessId: {},
23
- projectId: {},
24
- initialName: {}
25
- },
26
- emits: ["saved", "close"],
27
- setup(C, { emit: h }) {
28
- const s = C, m = h, o = g(s.initialName ?? ""), u = g(null), d = g([]), l = !s.projectId, c = g(l), n = g(!1), p = g(""), _ = ee();
29
- async function x() {
30
- var v, t;
31
- c.value = !0, p.value = "";
32
- try {
33
- const e = await $(P.appTemplates());
34
- d.value = e.templates, u.value = ((v = e.templates.find((f) => f.default)) == null ? void 0 : v.id) ?? ((t = e.templates[0]) == null ? void 0 : t.id) ?? null;
35
- } catch (e) {
36
- p.value = z(e);
37
- } finally {
38
- c.value = !1;
39
- }
40
- }
41
- async function N() {
42
- if (!(n.value || !o.value.trim() || o.value.trim().length > 120 || l && !u.value)) {
43
- n.value = !0, p.value = "";
44
- try {
45
- const v = await $(s.projectId ? P.project(s.businessId, s.projectId) : P.projects(s.businessId), {
46
- method: s.projectId ? "PATCH" : "POST",
47
- body: JSON.stringify({ name: o.value.trim(), ...s.projectId ? {} : {
48
- projectId: _,
49
- kind: "mobile",
50
- appTemplate: u.value,
51
- country: Q()
52
- } })
53
- });
54
- m("saved", v);
55
- } catch (v) {
56
- p.value = z(v);
57
- } finally {
58
- n.value = !1;
59
- }
60
- }
61
- }
62
- return O(() => {
63
- l && x();
64
- }), (v, t) => {
65
- const e = w("FmTextField"), f = w("FmButton"), M = w("FmCard"), k = w("FmForm");
66
- return a(), S(k, { onValidationSuccess: N }, {
67
- default: L(() => [
68
- j(M, { class: "project-dialog" }, {
69
- default: L(() => [
70
- i("h2", null, V(C.projectId ? "Rename project" : "New Mobile project"), 1),
71
- i("div", te, [
72
- j(e, {
73
- modelValue: o.value,
74
- "onUpdate:modelValue": t[0] || (t[0] = (y) => o.value = y),
75
- label: "Project name",
76
- placeholder: "e.g. Summer ordering",
77
- disabled: n.value,
78
- rules: [(y) => y.trim().length > 0 && y.trim().length <= 120 || "Enter a name up to 120 characters"]
79
- }, null, 8, ["modelValue", "disabled", "rules"]),
80
- l ? (a(), b(E, { key: 0 }, [
81
- c.value ? (a(), b("p", oe, "Loading templates…")) : (a(), S(X, {
82
- key: 1,
83
- templates: d.value,
84
- modelValue: u.value,
85
- "onUpdate:modelValue": t[1] || (t[1] = (y) => u.value = y),
86
- disabled: n.value
87
- }, null, 8, ["templates", "modelValue", "disabled"])),
88
- t[3] || (t[3] = i("p", { class: "project-dialog__note" }, "Start a separate app from a template. Your live app stays as it is.", -1))
89
- ], 64)) : I("", !0),
90
- p.value ? (a(), b("p", ae, V(p.value), 1)) : I("", !0),
91
- l && !d.value.length && !c.value ? (a(), S(f, {
92
- key: 2,
93
- label: "Retry loading templates",
94
- variant: "secondary",
95
- onClick: x
96
- })) : I("", !0)
97
- ]),
98
- i("footer", null, [
99
- j(f, {
100
- label: "Cancel",
101
- variant: "tertiary",
102
- disabled: n.value,
103
- onClick: t[2] || (t[2] = (y) => m("close"))
104
- }, null, 8, ["disabled"]),
105
- j(f, {
106
- label: C.projectId ? "Save" : "Create project",
107
- type: "submit",
108
- loading: n.value,
109
- disabled: c.value || !o.value.trim() || o.value.trim().length > 120 || l && !u.value
110
- }, null, 8, ["label", "loading", "disabled"])
111
- ])
112
- ]),
113
- _: 1
114
- })
115
- ]),
116
- _: 1
117
- });
118
- };
119
- }
120
- }), re = /* @__PURE__ */ U(le, [["__scopeId", "data-v-0c7183bf"]]), se = { class: "portal-page" }, ne = { class: "portal-page-inner" }, ie = { class: "portal-page-heading" }, ue = {
121
- key: 0,
122
- class: "mobile-projects__count"
123
- }, de = {
124
- key: 0,
125
- class: "portal-error",
126
- role: "alert"
127
- }, ce = {
128
- key: 1,
129
- role: "status"
130
- }, pe = {
131
- key: 2,
132
- class: "portal-empty"
133
- }, me = {
134
- key: 3,
135
- class: "rounded-2xl border border-portal-border-default bg-portal-bg-default",
136
- "aria-label": "Mobile projects"
137
- }, ve = /* @__PURE__ */ A({
138
- __name: "MobileProjectsView",
139
- setup(C) {
140
- const { FmButton: h } = G, s = W(), m = H(), o = J(), u = K(), d = g([]), l = g(!0), c = g(""), n = new AbortController();
141
- async function p() {
142
- l.value = !0, c.value = "";
143
- try {
144
- const t = await $(P.projects(s.businessId.value), { signal: n.signal });
145
- d.value = t.projects;
146
- } catch (t) {
147
- n.signal.aborted || (c.value = z(t));
148
- } finally {
149
- l.value = !1;
150
- }
151
- }
152
- function _(t) {
153
- u.open({
154
- title: t ? "Rename project" : "New Mobile project",
155
- dialogComponent: re,
156
- dialogComponentProps: {
157
- businessId: s.businessId.value,
158
- projectId: t == null ? void 0 : t.projectId,
159
- initialName: t == null ? void 0 : t.name,
160
- onClose: () => u.close(),
161
- onSaved: (e) => {
162
- u.close(), t ? p() : o.push(F(e.projectId, "workspace", { ...m.query, setup: "1" }));
163
- }
164
- }
165
- });
166
- }
167
- function x(t) {
168
- return new Intl.DateTimeFormat(void 0, { dateStyle: "medium", timeStyle: "short" }).format(new Date(t));
169
- }
170
- const N = D(() => [
171
- {
172
- id: "project",
173
- header: () => "Project",
174
- cell: (t) => {
175
- const e = t.row.original;
176
- return r("div", { class: "flex min-w-0 flex-col gap-2" }, [
177
- r("span", { class: "truncate fm-typo-en-body-md-600 text-portal-text-primary" }, e.name),
178
- r(
179
- "span",
180
- { class: "fm-typo-en-body-sm-400 text-portal-text-muted", title: e.projectId },
181
- `…${e.projectId.slice(-6)}`
182
- )
183
- ]);
184
- }
185
- },
186
- {
187
- id: "setup",
188
- header: () => "Setup",
189
- size: 130,
190
- enableSorting: !1,
191
- cell: (t) => r(
192
- R,
193
- { variant: t.row.original.provisioningStatus === "failed" ? "error" : "neutral", size: "sm" },
194
- () => Z(t.row.original.provisioningStatus)
195
- )
196
- },
197
- {
198
- id: "live",
199
- header: () => "Live",
200
- size: 200,
201
- enableSorting: !1,
202
- // Badges only. The muted sentence this replaces ("Unpublished release
203
- // available") was the one thing in the row set in prose, and prose in a 200px
204
- // column wraps — which is what made the cell look crowded. The state it
205
- // carried is worth keeping, so it becomes a second tag rather than going away:
206
- // it is the only place in this list that shows a merchant they have work built
207
- // and waiting to go live.
208
- //
209
- // Nothing is rendered for a project with no pending release. That is the
210
- // resting state of most rows, and a tag saying so would be back to filling the
211
- // column with "nothing happened".
212
- cell: (t) => {
213
- const e = t.row.original;
214
- return r("div", { class: "flex flex-wrap items-center gap-4" }, [
215
- // "Live project" in a column headed Live said the word twice, and cost the
216
- // width that made the line below it wrap.
217
- r(
218
- R,
219
- { variant: e.isLive ? "success" : "neutral", size: "sm" },
220
- () => e.isLive ? "Live" : "Not live"
221
- ),
222
- // `=== true` rather than truthiness: the field is optional in the contract,
223
- // and an absent value means the state is unknown, not that it is false.
224
- // This endpoint always sends a boolean, so that is a contract-level
225
- // possibility rather than one a merchant meets.
226
- e.hasUnpublishedRelease === !0 ? r(
227
- R,
228
- { variant: "warning", size: "sm", title: "A release is built and waiting to be published" },
229
- () => "Unpublished"
230
- ) : null
231
- ]);
232
- }
233
- },
234
- {
235
- id: "updatedAt",
236
- header: () => "Last edited",
237
- size: 170,
238
- enableSorting: !1,
239
- cell: (t) => r("span", { class: "fm-typo-en-body-sm-400 text-portal-text-muted" }, x(t.row.original.updatedAt))
240
- },
241
- {
242
- id: "actions",
243
- header: () => "",
244
- size: 340,
245
- enableSorting: !1,
246
- cell: (t) => {
247
- const e = t.row.original;
248
- return r("div", { class: "flex flex-wrap items-center justify-end gap-4" }, [
249
- e.provisioningStatus === "ready" ? r(h, {
250
- icon: "deployed_code",
251
- variant: "tertiary",
252
- title: "View releases",
253
- onClick: T(
254
- () => o.push(F(e.projectId, "releases", m.query)),
255
- ["stop"]
256
- )
257
- }) : null,
258
- r(h, {
259
- label: "Rename",
260
- variant: "tertiary",
261
- onClick: T(() => _(e), ["stop"])
262
- }),
263
- r(h, {
264
- label: e.provisioningStatus === "ready" ? "Open editor" : "Continue setup",
265
- variant: "secondary",
266
- onClick: T(
267
- () => o.push(F(e.projectId, "workspace", m.query)),
268
- ["stop"]
269
- )
270
- })
271
- ]);
272
- }
273
- }
274
- ]), v = D(() => !l.value && d.value.length > 0);
275
- return O(() => {
276
- if (p(), m.query.create === "1") {
277
- const { create: t, ...e } = m.query;
278
- o.replace({ query: e }), _();
279
- }
280
- }), Y(() => n.abort()), (t, e) => {
281
- const f = w("FmButton"), M = w("FmTable");
282
- return a(), b("div", se, [
283
- i("div", ne, [
284
- i("header", ie, [
285
- i("div", null, [
286
- e[4] || (e[4] = i("p", { class: "portal-eyebrow" }, "Mobile Ordering", -1)),
287
- i("h1", null, [
288
- e[3] || (e[3] = q("Projects ", -1)),
289
- l.value ? I("", !0) : (a(), b("span", ue, V(d.value.length), 1))
290
- ])
291
- ]),
292
- v.value ? (a(), S(f, {
293
- key: 0,
294
- label: "New project",
295
- icon: "add",
296
- onClick: e[0] || (e[0] = (k) => _())
297
- })) : I("", !0)
298
- ]),
299
- c.value ? (a(), b("p", de, [
300
- q(V(c.value) + " ", 1),
301
- j(f, {
302
- label: "Retry",
303
- variant: "tertiary",
304
- onClick: p
305
- })
306
- ])) : l.value ? (a(), b("p", ce, "Loading projects…")) : d.value.length ? (a(), b("section", me, [
307
- j(M, {
308
- "column-defs": N.value,
309
- "row-data": d.value,
310
- "page-size": d.value.length,
311
- "hide-footer": "",
312
- "pin-header-row": "",
313
- onRowClick: e[2] || (e[2] = (k) => B(o).push(B(F)(k.original.projectId, "workspace", B(m).query)))
314
- }, null, 8, ["column-defs", "row-data", "page-size"])
315
- ])) : (a(), b("section", pe, [
316
- e[5] || (e[5] = i("h2", null, "Your first Mobile project", -1)),
317
- e[6] || (e[6] = i("p", null, "Create an app from a template to start editing.", -1)),
318
- j(f, {
319
- label: "New project",
320
- icon: "add",
321
- onClick: e[1] || (e[1] = (k) => _())
322
- })
323
- ]))
324
- ])
325
- ]);
326
- };
327
- }
328
- }), xe = /* @__PURE__ */ U(ve, [["__scopeId", "data-v-9020cd4c"]]);
329
- export {
330
- xe as default
331
- };