@feedmepos/mf-miniprogram-v2 0.2.2-dev.27 → 0.2.2-dev.28

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.
@@ -1,32 +1,32 @@
1
- import { defineComponent as O, ref as m, onMounted as E, resolveComponent as I, openBlock as a, createBlock as P, withCtx as D, createVNode as v, normalizeClass as G, createElementBlock as s, createElementVNode as g, toDisplayString as V, Fragment as q, createCommentVNode as C, computed as K, h as d, withModifiers as R, onScopeDispose as Q, createTextVNode as U, unref as M } from "vue";
1
+ import { defineComponent as U, ref as m, onMounted as O, resolveComponent as I, openBlock as a, createBlock as V, withCtx as D, createVNode as v, normalizeClass as J, createElementBlock as s, createElementVNode as y, toDisplayString as P, Fragment as q, createCommentVNode as C, computed as K, h as d, withModifiers as M, onScopeDispose as Q, createTextVNode as A, unref as R } from "vue";
2
2
  import { useRoute as W, useRouter as X } from "vue-router";
3
3
  import { components as Z, useDialog as ee } from "@feedmepos/ui-library";
4
4
  import { a as $ } from "./routes-CTQTYdcO.js";
5
- import { c as z, e as L, a as te } from "./controlPlane--Q2ulw38.js";
5
+ import { c as L, e as z, a as te } from "./controlPlane--Q2ulw38.js";
6
6
  import { u as ae } from "./portalContext-Bx02hCyg.js";
7
- import { w as T } from "./portalNavigation-DKCfwTH8.js";
7
+ import { w as N } from "./portalNavigation-DKCfwTH8.js";
8
8
  import { _ as oe, p as le } from "./AppTemplatePicker.vue_vue_type_script_setup_true_lang-DlQnLlND.js";
9
9
  import { m as se } from "./index-CIJWcl_6.js";
10
10
  import { _ as Y } from "./_plugin-vue_export-helper-CHgC5LLL.js";
11
- import { _ as A } from "./StatusBadge.vue_vue_type_script_setup_true_lang-CMgQ0bd_.js";
12
- const re = {
11
+ import { _ as E } from "./StatusBadge.vue_vue_type_script_setup_true_lang-CMgQ0bd_.js";
12
+ const re = ["miniprogram-vue"], ne = {
13
13
  key: 0,
14
14
  class: "project-dialog__head"
15
- }, ne = { key: 1 }, ie = {
15
+ }, ie = { key: 1 }, ue = {
16
16
  key: 0,
17
17
  role: "status"
18
- }, ue = {
18
+ }, de = {
19
19
  key: 2,
20
20
  class: "portal-error",
21
21
  role: "alert"
22
- }, de = {
22
+ }, ce = {
23
23
  key: 0,
24
24
  class: "project-dialog__note"
25
- }, ce = {
25
+ }, pe = {
26
26
  key: 1,
27
27
  class: "portal-error",
28
28
  role: "alert"
29
- }, pe = /* @__PURE__ */ O({
29
+ }, me = /* @__PURE__ */ U({
30
30
  __name: "MobileProjectDialog",
31
31
  props: {
32
32
  businessId: {},
@@ -34,16 +34,16 @@ const re = {
34
34
  initialName: {}
35
35
  },
36
36
  emits: ["saved", "close"],
37
- setup(N, { emit: x }) {
38
- const c = N, b = x, r = m(c.initialName ?? ""), n = m(null), j = m([]), i = !c.projectId, f = m(i), l = m(!1), u = m(""), w = se(), k = m(i ? "template" : "name"), S = m("");
37
+ setup(T, { emit: x }) {
38
+ const c = T, b = x, r = m(c.initialName ?? ""), n = m(null), _ = m([]), i = !c.projectId, f = m(i), l = m(!1), u = m(""), w = se(), k = m(i ? "template" : "name"), S = m("");
39
39
  async function t() {
40
40
  var p, o;
41
41
  f.value = !0, u.value = "";
42
42
  try {
43
- const _ = await z($.appTemplates());
44
- j.value = _.templates, n.value = ((p = _.templates.find((h) => h.default)) == null ? void 0 : p.id) ?? ((o = _.templates[0]) == null ? void 0 : o.id) ?? null;
45
- } catch (_) {
46
- u.value = L(_);
43
+ const j = await L($.appTemplates());
44
+ _.value = j.templates, n.value = ((p = j.templates.find((h) => !re.includes(h.id))) == null ? void 0 : p.id) ?? ((o = j.templates[0]) == null ? void 0 : o.id) ?? null;
45
+ } catch (j) {
46
+ u.value = z(j);
47
47
  } finally {
48
48
  f.value = !1;
49
49
  }
@@ -58,7 +58,7 @@ const re = {
58
58
  if (!(l.value || !r.value.trim() || r.value.trim().length > 120 || i && !n.value)) {
59
59
  l.value = !0, u.value = "";
60
60
  try {
61
- const p = await z(c.projectId ? $.project(c.businessId, c.projectId) : $.projects(c.businessId), {
61
+ const p = await L(c.projectId ? $.project(c.businessId, c.projectId) : $.projects(c.businessId), {
62
62
  method: c.projectId ? "PATCH" : "POST",
63
63
  body: JSON.stringify({ name: r.value.trim(), ...c.projectId ? {} : {
64
64
  projectId: w,
@@ -69,54 +69,54 @@ const re = {
69
69
  });
70
70
  b("saved", p);
71
71
  } catch (p) {
72
- u.value = L(p);
72
+ u.value = z(p);
73
73
  } finally {
74
74
  l.value = !1;
75
75
  }
76
76
  }
77
77
  }
78
- return E(() => {
78
+ return O(() => {
79
79
  i && t();
80
80
  }), (p, o) => {
81
- const _ = I("FmTextField"), h = I("FmButton"), H = I("FmCard"), J = I("FmForm");
82
- return a(), P(J, { onValidationSuccess: B }, {
81
+ const j = I("FmTextField"), h = I("FmButton"), G = I("FmCard"), H = I("FmForm");
82
+ return a(), V(H, { onValidationSuccess: B }, {
83
83
  default: D(() => [
84
- v(H, {
85
- class: G(["project-dialog", k.value === "template" ? "project-dialog--wide" : ""])
84
+ v(G, {
85
+ class: J(["project-dialog", k.value === "template" ? "project-dialog--wide" : ""])
86
86
  }, {
87
87
  default: D(() => [
88
- k.value === "template" ? (a(), s("div", re, [
89
- o[5] || (o[5] = g("h2", null, "Choose a template", -1)),
90
- v(_, {
88
+ k.value === "template" ? (a(), s("div", ne, [
89
+ o[5] || (o[5] = y("h2", null, "Choose a template", -1)),
90
+ v(j, {
91
91
  modelValue: S.value,
92
- "onUpdate:modelValue": o[0] || (o[0] = (y) => S.value = y),
92
+ "onUpdate:modelValue": o[0] || (o[0] = (g) => S.value = g),
93
93
  placeholder: "Search",
94
94
  disabled: l.value,
95
95
  class: "project-dialog__search"
96
96
  }, null, 8, ["modelValue", "disabled"])
97
- ])) : (a(), s("h2", ne, V(N.projectId ? "Rename project" : "Name your project"), 1)),
97
+ ])) : (a(), s("h2", ie, P(T.projectId ? "Rename project" : "Name your project"), 1)),
98
98
  k.value === "template" ? (a(), s(q, { key: 2 }, [
99
- f.value ? (a(), s("p", ie, "Loading templates…")) : (a(), P(oe, {
99
+ f.value ? (a(), s("p", ue, "Loading templates…")) : (a(), V(oe, {
100
100
  key: 1,
101
- templates: j.value,
101
+ templates: _.value,
102
102
  modelValue: n.value,
103
- "onUpdate:modelValue": o[1] || (o[1] = (y) => n.value = y),
103
+ "onUpdate:modelValue": o[1] || (o[1] = (g) => n.value = g),
104
104
  search: S.value,
105
105
  disabled: l.value
106
106
  }, null, 8, ["templates", "modelValue", "search", "disabled"])),
107
- u.value ? (a(), s("p", ue, V(u.value), 1)) : C("", !0),
108
- !j.value.length && !f.value ? (a(), P(h, {
107
+ u.value ? (a(), s("p", de, P(u.value), 1)) : C("", !0),
108
+ !_.value.length && !f.value ? (a(), V(h, {
109
109
  key: 3,
110
110
  label: "Retry loading templates",
111
111
  variant: "secondary",
112
112
  onClick: t
113
113
  })) : C("", !0),
114
- g("footer", null, [
114
+ y("footer", null, [
115
115
  v(h, {
116
116
  label: "Cancel",
117
117
  variant: "tertiary",
118
118
  disabled: l.value,
119
- onClick: o[2] || (o[2] = (y) => b("close"))
119
+ onClick: o[2] || (o[2] = (g) => b("close"))
120
120
  }, null, 8, ["disabled"]),
121
121
  v(h, {
122
122
  label: "Next",
@@ -126,18 +126,18 @@ const re = {
126
126
  }, null, 8, ["disabled"])
127
127
  ])
128
128
  ], 64)) : (a(), s(q, { key: 3 }, [
129
- v(_, {
129
+ v(j, {
130
130
  modelValue: r.value,
131
- "onUpdate:modelValue": o[3] || (o[3] = (y) => r.value = y),
131
+ "onUpdate:modelValue": o[3] || (o[3] = (g) => r.value = g),
132
132
  label: "Project name",
133
133
  placeholder: "e.g. Summer ordering",
134
134
  disabled: l.value,
135
- rules: [(y) => y.trim().length > 0 && y.trim().length <= 120 || "Enter a name up to 120 characters"]
135
+ rules: [(g) => g.trim().length > 0 && g.trim().length <= 120 || "Enter a name up to 120 characters"]
136
136
  }, null, 8, ["modelValue", "disabled", "rules"]),
137
- i ? (a(), s("p", de, "Start a separate app from a template. Your live app stays as it is.")) : C("", !0),
138
- u.value ? (a(), s("p", ce, V(u.value), 1)) : C("", !0),
139
- g("footer", null, [
140
- i ? (a(), P(h, {
137
+ i ? (a(), s("p", ce, "Start a separate app from a template. Your live app stays as it is.")) : C("", !0),
138
+ u.value ? (a(), s("p", pe, P(u.value), 1)) : C("", !0),
139
+ y("footer", null, [
140
+ i ? (a(), V(h, {
141
141
  key: 0,
142
142
  label: "Back",
143
143
  variant: "tertiary",
@@ -148,10 +148,10 @@ const re = {
148
148
  label: "Cancel",
149
149
  variant: "tertiary",
150
150
  disabled: l.value,
151
- onClick: o[4] || (o[4] = (y) => b("close"))
151
+ onClick: o[4] || (o[4] = (g) => b("close"))
152
152
  }, null, 8, ["disabled"]),
153
153
  v(h, {
154
- label: N.projectId ? "Save" : "Create project",
154
+ label: T.projectId ? "Save" : "Create project",
155
155
  type: "submit",
156
156
  loading: l.value,
157
157
  disabled: !r.value.trim() || r.value.trim().length > 120 || i && !n.value
@@ -166,34 +166,34 @@ const re = {
166
166
  });
167
167
  };
168
168
  }
169
- }), me = /* @__PURE__ */ Y(pe, [["__scopeId", "data-v-aa910c40"]]), ve = { class: "portal-page" }, be = { class: "portal-page-inner" }, fe = { class: "portal-page-heading" }, ye = {
169
+ }), ve = /* @__PURE__ */ Y(me, [["__scopeId", "data-v-bea0508b"]]), be = { class: "portal-page" }, fe = { class: "portal-page-inner" }, ge = { class: "portal-page-heading" }, ye = {
170
170
  key: 0,
171
171
  class: "mobile-projects__count"
172
- }, ge = {
172
+ }, _e = {
173
173
  key: 0,
174
174
  class: "portal-error",
175
175
  role: "alert"
176
176
  }, je = {
177
177
  key: 1,
178
178
  role: "status"
179
- }, _e = {
179
+ }, he = {
180
180
  key: 2,
181
181
  class: "portal-empty"
182
- }, he = {
182
+ }, ke = {
183
183
  key: 3,
184
184
  class: "rounded-2xl border border-portal-border-default bg-portal-bg-default",
185
185
  "aria-label": "Mobile projects"
186
- }, ke = /* @__PURE__ */ O({
186
+ }, we = /* @__PURE__ */ U({
187
187
  __name: "MobileProjectsView",
188
- setup(N) {
189
- const { FmButton: x } = Z, c = ae(), b = W(), r = X(), n = ee(), j = m([]), i = m(!0), f = m(""), l = new AbortController();
188
+ setup(T) {
189
+ const { FmButton: x } = Z, c = ae(), b = W(), r = X(), n = ee(), _ = m([]), i = m(!0), f = m(""), l = new AbortController();
190
190
  async function u() {
191
191
  i.value = !0, f.value = "";
192
192
  try {
193
- const t = await z($.projects(c.businessId.value), { signal: l.signal });
194
- j.value = t.projects;
193
+ const t = await L($.projects(c.businessId.value), { signal: l.signal });
194
+ _.value = t.projects;
195
195
  } catch (t) {
196
- l.signal.aborted || (f.value = L(t));
196
+ l.signal.aborted || (f.value = z(t));
197
197
  } finally {
198
198
  i.value = !1;
199
199
  }
@@ -209,14 +209,14 @@ const re = {
209
209
  // box instead of a page area with room reserved for it (same fix as
210
210
  // PreviewPanel.vue's openLibraryExpandDialog).
211
211
  closeButton: !1,
212
- dialogComponent: me,
212
+ dialogComponent: ve,
213
213
  dialogComponentProps: {
214
214
  businessId: c.businessId.value,
215
215
  projectId: t == null ? void 0 : t.projectId,
216
216
  initialName: t == null ? void 0 : t.name,
217
217
  onClose: () => n.close(),
218
218
  onSaved: (e) => {
219
- n.close(), t ? u() : r.push(T(e.projectId, "workspace", { ...b.query, setup: "1" }));
219
+ n.close(), t ? u() : r.push(N(e.projectId, "workspace", { ...b.query, setup: "1" }));
220
220
  }
221
221
  }
222
222
  });
@@ -246,7 +246,7 @@ const re = {
246
246
  size: 130,
247
247
  enableSorting: !1,
248
248
  cell: (t) => d(
249
- A,
249
+ E,
250
250
  { variant: t.row.original.provisioningStatus === "failed" ? "error" : "neutral", size: "sm" },
251
251
  () => le(t.row.original.provisioningStatus)
252
252
  )
@@ -260,7 +260,7 @@ const re = {
260
260
  const e = t.row.original;
261
261
  return d("div", { class: "flex flex-col items-start gap-2" }, [
262
262
  d(
263
- A,
263
+ E,
264
264
  { variant: e.isLive ? "success" : "neutral", size: "sm" },
265
265
  () => e.isLive ? "Live project" : "Not live"
266
266
  ),
@@ -291,21 +291,21 @@ const re = {
291
291
  icon: "deployed_code",
292
292
  variant: "tertiary",
293
293
  title: "View releases",
294
- onClick: R(
295
- () => r.push(T(e.projectId, "releases", b.query)),
294
+ onClick: M(
295
+ () => r.push(N(e.projectId, "releases", b.query)),
296
296
  ["stop"]
297
297
  )
298
298
  }) : null,
299
299
  d(x, {
300
300
  label: "Rename",
301
301
  variant: "tertiary",
302
- onClick: R(() => w(e), ["stop"])
302
+ onClick: M(() => w(e), ["stop"])
303
303
  }),
304
304
  d(x, {
305
305
  label: e.provisioningStatus === "ready" ? "Open editor" : "Continue setup",
306
306
  variant: "secondary",
307
- onClick: R(
308
- () => r.push(T(e.projectId, "workspace", b.query)),
307
+ onClick: M(
308
+ () => r.push(N(e.projectId, "workspace", b.query)),
309
309
  ["stop"]
310
310
  )
311
311
  })
@@ -313,21 +313,21 @@ const re = {
313
313
  }
314
314
  }
315
315
  ]);
316
- return E(() => {
316
+ return O(() => {
317
317
  if (u(), b.query.create === "1") {
318
318
  const { create: t, ...e } = b.query;
319
319
  r.replace({ query: e }), w();
320
320
  }
321
321
  }), Q(() => l.abort()), (t, e) => {
322
322
  const F = I("FmButton"), B = I("FmTable");
323
- return a(), s("div", ve, [
324
- g("div", be, [
325
- g("header", fe, [
326
- g("div", null, [
327
- e[4] || (e[4] = g("p", { class: "portal-eyebrow" }, "Mobile Ordering", -1)),
328
- g("h1", null, [
329
- e[3] || (e[3] = U("Projects ", -1)),
330
- i.value ? C("", !0) : (a(), s("span", ye, V(j.value.length), 1))
323
+ return a(), s("div", be, [
324
+ y("div", fe, [
325
+ y("header", ge, [
326
+ y("div", null, [
327
+ e[4] || (e[4] = y("p", { class: "portal-eyebrow" }, "Mobile Ordering", -1)),
328
+ y("h1", null, [
329
+ e[3] || (e[3] = A("Projects ", -1)),
330
+ i.value ? C("", !0) : (a(), s("span", ye, P(_.value.length), 1))
331
331
  ])
332
332
  ]),
333
333
  v(F, {
@@ -336,25 +336,25 @@ const re = {
336
336
  onClick: e[0] || (e[0] = (p) => w())
337
337
  })
338
338
  ]),
339
- f.value ? (a(), s("p", ge, [
340
- U(V(f.value) + " ", 1),
339
+ f.value ? (a(), s("p", _e, [
340
+ A(P(f.value) + " ", 1),
341
341
  v(F, {
342
342
  label: "Retry",
343
343
  variant: "tertiary",
344
344
  onClick: u
345
345
  })
346
- ])) : i.value ? (a(), s("p", je, "Loading projects…")) : j.value.length ? (a(), s("section", he, [
346
+ ])) : i.value ? (a(), s("p", je, "Loading projects…")) : _.value.length ? (a(), s("section", ke, [
347
347
  v(B, {
348
348
  "column-defs": S.value,
349
- "row-data": j.value,
350
- "page-size": j.value.length,
349
+ "row-data": _.value,
350
+ "page-size": _.value.length,
351
351
  "hide-footer": "",
352
352
  "pin-header-row": "",
353
- onRowClick: e[2] || (e[2] = (p) => M(r).push(M(T)(p.original.projectId, "workspace", M(b).query)))
353
+ onRowClick: e[2] || (e[2] = (p) => R(r).push(R(N)(p.original.projectId, "workspace", R(b).query)))
354
354
  }, null, 8, ["column-defs", "row-data", "page-size"])
355
- ])) : (a(), s("section", _e, [
356
- e[5] || (e[5] = g("h2", null, "Your first Mobile project", -1)),
357
- e[6] || (e[6] = g("p", null, "Create an app from a template to start editing.", -1)),
355
+ ])) : (a(), s("section", he, [
356
+ e[5] || (e[5] = y("h2", null, "Your first Mobile project", -1)),
357
+ e[6] || (e[6] = y("p", null, "Create an app from a template to start editing.", -1)),
358
358
  v(F, {
359
359
  label: "New project",
360
360
  icon: "add",
@@ -365,7 +365,7 @@ const re = {
365
365
  ]);
366
366
  };
367
367
  }
368
- }), Be = /* @__PURE__ */ Y(ke, [["__scopeId", "data-v-b0ffdaaa"]]);
368
+ }), Me = /* @__PURE__ */ Y(we, [["__scopeId", "data-v-b0ffdaaa"]]);
369
369
  export {
370
- Be as default
370
+ Me as default
371
371
  };
package/dist/app.js CHANGED
@@ -4,7 +4,7 @@ const o = [
4
4
  path: "/platforms/mobile",
5
5
  name: "miniprogram-v2-mobile-projects",
6
6
  meta: { title: "Mobile" },
7
- component: () => import("./MobileProjectsView-DU2qBDZy.js")
7
+ component: () => import("./MobileProjectsView-C9o2BHfM.js")
8
8
  },
9
9
  {
10
10
  path: "/",
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-miniprogram-v2",
3
- "version": "0.2.2-dev.27",
3
+ "version": "0.2.2-dev.28",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",