@feedmepos/mf-miniprogram-v2 0.2.2-dev.17 → 0.2.2-dev.19
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.
- package/dist/{App-CR0BBDaq.js → App-Dj20Jl8B.js} +2 -2
- package/dist/{AppTemplatePicker-C0lZyhK2.js → AppTemplatePicker-CNJ6kIJk.js} +149 -96
- package/dist/{ControlPlaneView-BJ1Rx2rm.js → ControlPlaneView-DZ-hNfCQ.js} +7260 -7446
- package/dist/{EcosystemView-sb7DUkNL.js → EcosystemView-B359jaNI.js} +4 -4
- package/dist/MobileProjectsView-lV5bkuns.js +312 -0
- package/dist/{ModuleCenterView-CQrJ9pyE.js → ModuleCenterView-DyMr3iWV.js} +1 -1
- package/dist/{ModuleDetailView-CpBktRqD.js → ModuleDetailView-BeXK89Cs.js} +1 -1
- package/dist/{PagesView-DTGhet9j.js → PagesView-VqFkmYxN.js} +2 -2
- package/dist/{PlatformUnavailableView-j0_2YBKm.js → PlatformUnavailableView-C1RltAIw.js} +1 -1
- package/dist/{PortalSettingsView-BrO2Yt65.js → PortalSettingsView-BmmMJ5Zm.js} +2 -2
- package/dist/StatusBadge.vue_vue_type_script_setup_true_lang-CMgQ0bd_.js +30 -0
- package/dist/WorkspaceEntryView-BTYo51RE.js +21 -0
- package/dist/app.js +11 -20
- package/dist/package.json +2 -1
- package/dist/{portalContext-DCwZcTKL.js → portalContext-C4HL_0kl.js} +1 -1
- package/dist/portalNavigation-DKCfwTH8.js +28 -0
- package/dist/routes-Boz_WlNM.js +54 -0
- package/dist/style.css +1 -1
- package/dist/{useModuleCatalog-CVi8031k.js → useModuleCatalog-DqECds3F.js} +1 -1
- package/package.json +2 -1
- package/dist/MobileProjectsView-BZw9pWnK.js +0 -296
- package/dist/StatusBadge.vue_vue_type_script_setup_true_lang-Bh9Eoe_H.js +0 -26
- package/dist/TemplateCenterView-B_Yvaeza.js +0 -299
- package/dist/WorkspaceEntryView-hNqYjBTr.js +0 -21
- package/dist/portalNavigation-DOF4Ah49.js +0 -28
- package/dist/routes-DXQSkGM7.js +0 -66
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as x, resolveComponent as p, openBlock as u, createElementBlock as h, createVNode as E, createElementVNode as P, normalizeClass as F, toDisplayString as v, createCommentVNode as g, createBlock as L, shallowReadonly as r, ref as s } from "vue";
|
|
2
|
-
import { a as w } from "./routes-
|
|
2
|
+
import { a as w } from "./routes-Boz_WlNM.js";
|
|
3
3
|
import { c as M, e as y, m as $ } from "./controlPlane-CoEgf9BA.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,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@feedmepos/mf-miniprogram-v2",
|
|
3
|
-
"version": "0.2.2-dev.
|
|
3
|
+
"version": "0.2.2-dev.19",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"vue-router": "^4.6.4"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
+
"@tanstack/vue-table": "8.21.3",
|
|
55
56
|
"@tsconfig/node20": "^20.1.6",
|
|
56
57
|
"@types/node": "^24.13.2",
|
|
57
58
|
"@vitejs/plugin-vue": "^5.0.4",
|
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
import { defineComponent as U, ref as j, onMounted as B, resolveComponent as I, openBlock as n, createBlock as P, withCtx as C, createVNode as r, createElementVNode as o, toDisplayString as _, createElementBlock as d, Fragment as D, createCommentVNode as S, onScopeDispose as A, createTextVNode as F, renderList as O, unref as g } from "vue";
|
|
2
|
-
import { useRoute as E, useRouter as Y } from "vue-router";
|
|
3
|
-
import { useDialog as z } from "@feedmepos/ui-library";
|
|
4
|
-
import { a as R } from "./routes-DXQSkGM7.js";
|
|
5
|
-
import { c as x, e as L, a as H } from "./controlPlane-CoEgf9BA.js";
|
|
6
|
-
import { u as J } from "./portalContext-DCwZcTKL.js";
|
|
7
|
-
import { w as N } from "./portalNavigation-DOF4Ah49.js";
|
|
8
|
-
import { m as G } from "./index-D5qXvcfE.js";
|
|
9
|
-
import { A as K } from "./AppTemplatePicker-C0lZyhK2.js";
|
|
10
|
-
import { _ as q } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
11
|
-
import { _ as T } from "./StatusBadge.vue_vue_type_script_setup_true_lang-Bh9Eoe_H.js";
|
|
12
|
-
const Q = {
|
|
13
|
-
key: 0,
|
|
14
|
-
role: "status"
|
|
15
|
-
}, W = {
|
|
16
|
-
key: 1,
|
|
17
|
-
class: "portal-error",
|
|
18
|
-
role: "alert"
|
|
19
|
-
}, X = /* @__PURE__ */ U({
|
|
20
|
-
__name: "MobileProjectDialog",
|
|
21
|
-
props: {
|
|
22
|
-
businessId: {},
|
|
23
|
-
projectId: {},
|
|
24
|
-
initialName: {}
|
|
25
|
-
},
|
|
26
|
-
emits: ["saved", "close"],
|
|
27
|
-
setup(k, { emit: V }) {
|
|
28
|
-
const l = k, h = V, i = j(l.initialName ?? ""), u = j(null), f = j([]), p = j(!l.projectId), c = j(!1), m = j(""), w = G();
|
|
29
|
-
async function M() {
|
|
30
|
-
var e, s;
|
|
31
|
-
p.value = !0, m.value = "";
|
|
32
|
-
try {
|
|
33
|
-
const b = await x(R.appTemplates());
|
|
34
|
-
f.value = b.templates, u.value = ((e = b.templates.find((y) => y.default)) == null ? void 0 : e.id) ?? ((s = b.templates[0]) == null ? void 0 : s.id) ?? null;
|
|
35
|
-
} catch (b) {
|
|
36
|
-
m.value = L(b);
|
|
37
|
-
} finally {
|
|
38
|
-
p.value = !1;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
async function a() {
|
|
42
|
-
if (!(c.value || !i.value.trim() || i.value.trim().length > 120 || !l.projectId && !u.value)) {
|
|
43
|
-
c.value = !0, m.value = "";
|
|
44
|
-
try {
|
|
45
|
-
const e = await x(l.projectId ? R.project(l.businessId, l.projectId) : R.projects(l.businessId), {
|
|
46
|
-
method: l.projectId ? "PATCH" : "POST",
|
|
47
|
-
body: JSON.stringify({ name: i.value.trim(), ...l.projectId ? {} : {
|
|
48
|
-
projectId: w,
|
|
49
|
-
kind: "mobile",
|
|
50
|
-
appTemplate: u.value,
|
|
51
|
-
country: H()
|
|
52
|
-
} })
|
|
53
|
-
});
|
|
54
|
-
h("saved", e);
|
|
55
|
-
} catch (e) {
|
|
56
|
-
m.value = L(e);
|
|
57
|
-
} finally {
|
|
58
|
-
c.value = !1;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return B(() => {
|
|
63
|
-
l.projectId || M();
|
|
64
|
-
}), (e, s) => {
|
|
65
|
-
const b = I("FmTextField"), y = I("FmButton"), $ = I("FmCard"), t = I("FmForm");
|
|
66
|
-
return n(), P(t, { onValidationSuccess: a }, {
|
|
67
|
-
default: C(() => [
|
|
68
|
-
r($, { class: "project-dialog" }, {
|
|
69
|
-
default: C(() => [
|
|
70
|
-
o("h2", null, _(k.projectId ? "Rename project" : "New Mobile project"), 1),
|
|
71
|
-
r(b, {
|
|
72
|
-
modelValue: i.value,
|
|
73
|
-
"onUpdate:modelValue": s[0] || (s[0] = (v) => i.value = v),
|
|
74
|
-
label: "Project name",
|
|
75
|
-
placeholder: "e.g. Summer ordering",
|
|
76
|
-
disabled: c.value,
|
|
77
|
-
rules: [(v) => v.trim().length > 0 && v.trim().length <= 120 || "Enter a name up to 120 characters"]
|
|
78
|
-
}, null, 8, ["modelValue", "disabled", "rules"]),
|
|
79
|
-
k.projectId ? S("", !0) : (n(), d(D, { key: 0 }, [
|
|
80
|
-
p.value ? (n(), d("p", Q, "Loading templates…")) : (n(), P(K, {
|
|
81
|
-
key: 1,
|
|
82
|
-
templates: f.value,
|
|
83
|
-
modelValue: u.value,
|
|
84
|
-
"onUpdate:modelValue": s[1] || (s[1] = (v) => u.value = v),
|
|
85
|
-
disabled: c.value
|
|
86
|
-
}, null, 8, ["templates", "modelValue", "disabled"])),
|
|
87
|
-
s[3] || (s[3] = o("p", { class: "project-dialog__note" }, "Start a separate app from a template. Your live app stays as it is.", -1))
|
|
88
|
-
], 64)),
|
|
89
|
-
m.value ? (n(), d("p", W, _(m.value), 1)) : S("", !0),
|
|
90
|
-
!k.projectId && !f.value.length && !p.value ? (n(), P(y, {
|
|
91
|
-
key: 2,
|
|
92
|
-
label: "Retry loading templates",
|
|
93
|
-
variant: "secondary",
|
|
94
|
-
onClick: M
|
|
95
|
-
})) : S("", !0),
|
|
96
|
-
o("footer", null, [
|
|
97
|
-
r(y, {
|
|
98
|
-
label: "Cancel",
|
|
99
|
-
variant: "tertiary",
|
|
100
|
-
disabled: c.value,
|
|
101
|
-
onClick: s[2] || (s[2] = (v) => h("close"))
|
|
102
|
-
}, null, 8, ["disabled"]),
|
|
103
|
-
r(y, {
|
|
104
|
-
label: k.projectId ? "Save" : "Create project",
|
|
105
|
-
type: "submit",
|
|
106
|
-
loading: c.value,
|
|
107
|
-
disabled: p.value || !i.value.trim() || i.value.trim().length > 120 || !k.projectId && !u.value
|
|
108
|
-
}, null, 8, ["label", "loading", "disabled"])
|
|
109
|
-
])
|
|
110
|
-
]),
|
|
111
|
-
_: 1
|
|
112
|
-
})
|
|
113
|
-
]),
|
|
114
|
-
_: 1
|
|
115
|
-
});
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
}), Z = /* @__PURE__ */ q(X, [["__scopeId", "data-v-c903cb52"]]), ee = { class: "portal-page" }, te = { class: "portal-page-inner" }, oe = { class: "portal-page-heading" }, ae = {
|
|
119
|
-
key: 0,
|
|
120
|
-
class: "mobile-projects__count"
|
|
121
|
-
}, le = {
|
|
122
|
-
key: 0,
|
|
123
|
-
class: "portal-error",
|
|
124
|
-
role: "alert"
|
|
125
|
-
}, se = {
|
|
126
|
-
key: 1,
|
|
127
|
-
role: "status"
|
|
128
|
-
}, ne = {
|
|
129
|
-
key: 2,
|
|
130
|
-
class: "portal-empty"
|
|
131
|
-
}, re = {
|
|
132
|
-
key: 3,
|
|
133
|
-
class: "mobile-projects__list",
|
|
134
|
-
"aria-label": "Mobile projects"
|
|
135
|
-
}, ie = { class: "mobile-projects__name" }, ue = ["title"], ce = { class: "mobile-projects__status" }, de = { class: "mobile-projects__status" }, pe = { class: "mobile-projects__label" }, me = { class: "mobile-projects__status" }, ve = ["datetime"], _e = { class: "mobile-projects__actions" }, be = { class: "w-[200px] py-4" }, je = /* @__PURE__ */ U({
|
|
136
|
-
__name: "MobileProjectsView",
|
|
137
|
-
setup(k) {
|
|
138
|
-
const V = J(), l = E(), h = Y(), i = z(), u = j([]), f = j(!0), p = j(""), c = new AbortController();
|
|
139
|
-
async function m() {
|
|
140
|
-
f.value = !0, p.value = "";
|
|
141
|
-
try {
|
|
142
|
-
const a = await x(R.projects(V.businessId.value), { signal: c.signal });
|
|
143
|
-
u.value = a.projects;
|
|
144
|
-
} catch (a) {
|
|
145
|
-
c.signal.aborted || (p.value = L(a));
|
|
146
|
-
} finally {
|
|
147
|
-
f.value = !1;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
function w(a) {
|
|
151
|
-
i.open({
|
|
152
|
-
title: a ? "Rename project" : "New Mobile project",
|
|
153
|
-
dialogComponent: Z,
|
|
154
|
-
dialogComponentProps: {
|
|
155
|
-
businessId: V.businessId.value,
|
|
156
|
-
projectId: a == null ? void 0 : a.projectId,
|
|
157
|
-
initialName: a == null ? void 0 : a.name,
|
|
158
|
-
onClose: () => i.close(),
|
|
159
|
-
onSaved: (e) => {
|
|
160
|
-
i.close(), a ? m() : h.push(N(e.projectId, "workspace", { ...l.query, setup: "1" }));
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
function M(a) {
|
|
166
|
-
return new Intl.DateTimeFormat(void 0, { dateStyle: "medium", timeStyle: "short" }).format(new Date(a));
|
|
167
|
-
}
|
|
168
|
-
return B(() => {
|
|
169
|
-
if (m(), l.query.create === "1") {
|
|
170
|
-
const { create: a, ...e } = l.query;
|
|
171
|
-
h.replace({ query: e }), w();
|
|
172
|
-
}
|
|
173
|
-
}), A(() => c.abort()), (a, e) => {
|
|
174
|
-
const s = I("FmButton"), b = I("RouterLink"), y = I("FmMenuItem"), $ = I("FmMenu");
|
|
175
|
-
return n(), d("div", ee, [
|
|
176
|
-
o("div", te, [
|
|
177
|
-
o("header", oe, [
|
|
178
|
-
o("div", null, [
|
|
179
|
-
e[3] || (e[3] = o("p", { class: "portal-eyebrow" }, "Mobile Ordering", -1)),
|
|
180
|
-
o("h1", null, [
|
|
181
|
-
e[2] || (e[2] = F("Projects ", -1)),
|
|
182
|
-
f.value ? S("", !0) : (n(), d("span", ae, _(u.value.length), 1))
|
|
183
|
-
])
|
|
184
|
-
]),
|
|
185
|
-
r(s, {
|
|
186
|
-
label: "New project",
|
|
187
|
-
icon: "add",
|
|
188
|
-
onClick: e[0] || (e[0] = (t) => w())
|
|
189
|
-
})
|
|
190
|
-
]),
|
|
191
|
-
p.value ? (n(), d("p", le, [
|
|
192
|
-
F(_(p.value) + " ", 1),
|
|
193
|
-
r(s, {
|
|
194
|
-
label: "Retry",
|
|
195
|
-
variant: "tertiary",
|
|
196
|
-
onClick: m
|
|
197
|
-
})
|
|
198
|
-
])) : f.value ? (n(), d("p", se, "Loading projects…")) : u.value.length ? (n(), d("section", re, [
|
|
199
|
-
(n(!0), d(D, null, O(u.value, (t) => (n(), d("article", {
|
|
200
|
-
key: t.projectId,
|
|
201
|
-
class: "mobile-projects__row"
|
|
202
|
-
}, [
|
|
203
|
-
o("div", ie, [
|
|
204
|
-
r(b, {
|
|
205
|
-
to: g(N)(t.projectId, "workspace", g(l).query)
|
|
206
|
-
}, {
|
|
207
|
-
default: C(() => [
|
|
208
|
-
F(_(t.name), 1)
|
|
209
|
-
]),
|
|
210
|
-
_: 2
|
|
211
|
-
}, 1032, ["to"]),
|
|
212
|
-
o("span", {
|
|
213
|
-
title: t.projectId
|
|
214
|
-
}, "…" + _(t.projectId.slice(-6)), 9, ue)
|
|
215
|
-
]),
|
|
216
|
-
o("div", ce, [
|
|
217
|
-
e[6] || (e[6] = o("span", { class: "mobile-projects__label" }, "Setup", -1)),
|
|
218
|
-
r(T, {
|
|
219
|
-
variant: t.provisioningStatus === "failed" ? "error" : "neutral"
|
|
220
|
-
}, {
|
|
221
|
-
default: C(() => [
|
|
222
|
-
F(_(t.provisioningStatus === "ready" ? "Ready" : t.provisioningStatus === "failed" ? "Setup failed" : t.provisioningStatus === "provisioning" ? "Setting up" : "Not set up"), 1)
|
|
223
|
-
]),
|
|
224
|
-
_: 2
|
|
225
|
-
}, 1032, ["variant"])
|
|
226
|
-
]),
|
|
227
|
-
o("div", de, [
|
|
228
|
-
r(T, {
|
|
229
|
-
variant: t.isLive ? "success" : "neutral"
|
|
230
|
-
}, {
|
|
231
|
-
default: C(() => [
|
|
232
|
-
F(_(t.isLive ? "Live project" : "Not live"), 1)
|
|
233
|
-
]),
|
|
234
|
-
_: 2
|
|
235
|
-
}, 1032, ["variant"]),
|
|
236
|
-
o("span", pe, _(t.hasUnpublishedRelease === void 0 ? "Release status unavailable" : t.hasUnpublishedRelease ? "Unpublished release available" : "No unpublished release"), 1)
|
|
237
|
-
]),
|
|
238
|
-
o("div", me, [
|
|
239
|
-
e[7] || (e[7] = o("span", { class: "mobile-projects__label" }, "Last edited", -1)),
|
|
240
|
-
o("time", {
|
|
241
|
-
datetime: t.updatedAt
|
|
242
|
-
}, _(M(t.updatedAt)), 9, ve)
|
|
243
|
-
]),
|
|
244
|
-
o("div", _e, [
|
|
245
|
-
r(s, {
|
|
246
|
-
label: t.provisioningStatus === "ready" ? "Open editor" : "Continue setup",
|
|
247
|
-
variant: "secondary",
|
|
248
|
-
onClick: (v) => g(h).push(g(N)(t.projectId, "workspace", g(l).query))
|
|
249
|
-
}, null, 8, ["label", "onClick"]),
|
|
250
|
-
r($, {
|
|
251
|
-
placement: "bottom-end",
|
|
252
|
-
"close-on-click": ""
|
|
253
|
-
}, {
|
|
254
|
-
"menu-button": C(() => [
|
|
255
|
-
r(s, {
|
|
256
|
-
icon: "more_horiz",
|
|
257
|
-
variant: "tertiary",
|
|
258
|
-
"aria-label": `Actions for ${t.name}`
|
|
259
|
-
}, null, 8, ["aria-label"])
|
|
260
|
-
]),
|
|
261
|
-
default: C(() => [
|
|
262
|
-
o("div", be, [
|
|
263
|
-
r(y, {
|
|
264
|
-
label: "Rename project",
|
|
265
|
-
icon: "edit",
|
|
266
|
-
"onUpdate:modelValue": (v) => w(t)
|
|
267
|
-
}, null, 8, ["onUpdate:modelValue"]),
|
|
268
|
-
t.provisioningStatus === "ready" ? (n(), P(y, {
|
|
269
|
-
key: 0,
|
|
270
|
-
label: "View releases",
|
|
271
|
-
icon: "deployed_code",
|
|
272
|
-
"onUpdate:modelValue": (v) => g(h).push(g(N)(t.projectId, "releases", g(l).query))
|
|
273
|
-
}, null, 8, ["onUpdate:modelValue"])) : S("", !0)
|
|
274
|
-
])
|
|
275
|
-
]),
|
|
276
|
-
_: 2
|
|
277
|
-
}, 1024)
|
|
278
|
-
])
|
|
279
|
-
]))), 128))
|
|
280
|
-
])) : (n(), d("section", ne, [
|
|
281
|
-
e[4] || (e[4] = o("h2", null, "Your first Mobile project", -1)),
|
|
282
|
-
e[5] || (e[5] = o("p", null, "Create an app from a template to start editing.", -1)),
|
|
283
|
-
r(s, {
|
|
284
|
-
label: "New project",
|
|
285
|
-
icon: "add",
|
|
286
|
-
onClick: e[1] || (e[1] = (t) => w())
|
|
287
|
-
})
|
|
288
|
-
]))
|
|
289
|
-
])
|
|
290
|
-
]);
|
|
291
|
-
};
|
|
292
|
-
}
|
|
293
|
-
}), Me = /* @__PURE__ */ q(je, [["__scopeId", "data-v-984161f0"]]);
|
|
294
|
-
export {
|
|
295
|
-
Me as default
|
|
296
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { defineComponent as n, computed as l, openBlock as a, createElementBlock as c, normalizeClass as m, renderSlot as p } from "vue";
|
|
2
|
-
const u = /* @__PURE__ */ n({
|
|
3
|
-
__name: "StatusBadge",
|
|
4
|
-
props: {
|
|
5
|
-
variant: { default: "neutral" },
|
|
6
|
-
size: { default: "md" }
|
|
7
|
-
},
|
|
8
|
-
setup(o) {
|
|
9
|
-
const e = o, r = {
|
|
10
|
-
success: "bg-fm-color-system-success-100 text-fm-color-typo-success",
|
|
11
|
-
warning: "bg-fm-color-system-warning-100 text-fm-color-typo-warning",
|
|
12
|
-
error: "bg-fm-color-system-error-100 text-fm-color-typo-error",
|
|
13
|
-
info: "bg-fm-color-system-info-100 text-fm-color-typo-info",
|
|
14
|
-
neutral: "bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary",
|
|
15
|
-
primary: "bg-fm-color-primary text-fm-color-typo-white"
|
|
16
|
-
}, t = l(() => e.size === "sm" ? "rounded-[4px] px-[6px] py-[1px]" : "rounded-full px-8 py-2");
|
|
17
|
-
return (s, f) => (a(), c("span", {
|
|
18
|
-
class: m(["inline-flex shrink-0 items-center gap-4 fm-typo-en-body-xs-600 leading-[16px]", [r[o.variant], t.value]])
|
|
19
|
-
}, [
|
|
20
|
-
p(s.$slots, "default")
|
|
21
|
-
], 2));
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
export {
|
|
25
|
-
u as _
|
|
26
|
-
};
|
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
import { defineComponent as W, ref as r, computed as E, resolveComponent as h, openBlock as n, createBlock as S, withCtx as I, createVNode as d, createElementVNode as s, toDisplayString as c, createCommentVNode as F, unref as le, createElementBlock as v, onMounted as oe, onScopeDispose as ne, createTextVNode as k, Fragment as H, renderList as se } from "vue";
|
|
2
|
-
import { a as A } from "./routes-DXQSkGM7.js";
|
|
3
|
-
import { useDialog as ie } from "@feedmepos/ui-library";
|
|
4
|
-
import { c as P, e as $ } from "./controlPlane-CoEgf9BA.js";
|
|
5
|
-
import { _ as re } from "./StatusBadge.vue_vue_type_script_setup_true_lang-Bh9Eoe_H.js";
|
|
6
|
-
import { _ as Y } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
|
-
const de = ["qsr", "coffee", "tea"], 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.
|
|
12
|
-
{
|
|
13
|
-
id: "miniprogram-vue",
|
|
14
|
-
label: "Phone ordering app",
|
|
15
|
-
description: "Menu browsing, cart and checkout, membership and rewards, and order history — for customers ordering on their own phone.",
|
|
16
|
-
industries: [],
|
|
17
|
-
environments: ["dev", "prod"],
|
|
18
|
-
default: !0
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
id: "miniprogram-vue-v2",
|
|
22
|
-
label: "Phone, kiosk and tablet",
|
|
23
|
-
description: "Everything in the phone app, plus self-order kiosk and in-store tablet surfaces sharing the same menu, cart and membership.",
|
|
24
|
-
industries: [],
|
|
25
|
-
// Dev only, deliberately. It has never been provisioned end-to-end: the
|
|
26
|
-
// preview proxy, the component-library unpack and the release build have
|
|
27
|
-
// only been exercised locally. Add 'prod' after a real merchant has run
|
|
28
|
-
// through all three.
|
|
29
|
-
environments: ["dev"]
|
|
30
|
-
}
|
|
31
|
-
], ue = {
|
|
32
|
-
key: 2,
|
|
33
|
-
class: "portal-error",
|
|
34
|
-
role: "alert"
|
|
35
|
-
}, K = "miniprogram-vue-v2", ce = /* @__PURE__ */ W({
|
|
36
|
-
__name: "TemplateChoiceDialog",
|
|
37
|
-
props: {
|
|
38
|
-
choice: {}
|
|
39
|
-
},
|
|
40
|
-
emits: ["saved", "close"],
|
|
41
|
-
setup(x, { emit: g }) {
|
|
42
|
-
var B, L, R, U, O, z, M;
|
|
43
|
-
const i = x, C = g, m = r(((B = i.choice) == null ? void 0 : B.id) ?? ""), b = r(((L = i.choice) == null ? void 0 : L.appTemplateId) ?? K), _ = r(((R = i.choice) == null ? void 0 : R.restaurantStyle) ?? "qsr"), f = r(((U = i.choice) == null ? void 0 : U.label) ?? ""), y = r(((O = i.choice) == null ? void 0 : O.description) ?? ""), T = r((((z = i.choice) == null ? void 0 : z.industries) ?? []).join(", ")), V = r(((M = i.choice) == null ? void 0 : M.default) ?? !1), e = r(!1), u = r(""), l = E(() => !!i.choice), t = E(
|
|
44
|
-
() => (l.value ? J : J.filter((p) => p.id === K)).map((p) => ({ label: p.label, value: p.id }))
|
|
45
|
-
), w = E(() => b.value === "miniprogram-vue-v2"), Q = de.map((p) => ({ label: p, value: p })), N = E(
|
|
46
|
-
() => !e.value && f.value.trim().length > 0 && y.value.trim().length > 0 && (l.value ? !0 : /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/.test(m.value.trim()))
|
|
47
|
-
);
|
|
48
|
-
async function X() {
|
|
49
|
-
if (!N.value) return;
|
|
50
|
-
e.value = !0, u.value = "";
|
|
51
|
-
const p = {
|
|
52
|
-
...l.value ? {} : { id: m.value.trim() },
|
|
53
|
-
appTemplateId: b.value,
|
|
54
|
-
label: f.value.trim(),
|
|
55
|
-
description: y.value.trim(),
|
|
56
|
-
industries: T.value.split(",").map((a) => a.trim()).filter(Boolean),
|
|
57
|
-
default: V.value,
|
|
58
|
-
...w.value ? { restaurantStyle: _.value } : {}
|
|
59
|
-
};
|
|
60
|
-
try {
|
|
61
|
-
await P(
|
|
62
|
-
l.value ? A.appTemplateChoice(i.choice.id) : A.appTemplateChoices(),
|
|
63
|
-
{ method: l.value ? "PATCH" : "POST", body: JSON.stringify(p) }
|
|
64
|
-
), C("saved");
|
|
65
|
-
} catch (a) {
|
|
66
|
-
u.value = $(a);
|
|
67
|
-
} finally {
|
|
68
|
-
e.value = !1;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return (p, a) => {
|
|
72
|
-
const D = h("FmTextField"), j = h("FmSelect"), Z = h("FmTextarea"), ee = h("FmSwitch"), q = h("FmButton"), te = h("FmCard"), ae = h("FmForm");
|
|
73
|
-
return n(), S(ae, { onValidationSuccess: X }, {
|
|
74
|
-
default: I(() => [
|
|
75
|
-
d(te, { class: "template-choice-dialog" }, {
|
|
76
|
-
default: I(() => {
|
|
77
|
-
var G;
|
|
78
|
-
return [
|
|
79
|
-
s("h2", null, c(l.value ? `Edit ${(G = x.choice) == null ? void 0 : G.label}` : "New template choice"), 1),
|
|
80
|
-
l.value ? F("", !0) : (n(), S(D, {
|
|
81
|
-
key: 0,
|
|
82
|
-
modelValue: m.value,
|
|
83
|
-
"onUpdate:modelValue": a[0] || (a[0] = (o) => m.value = o),
|
|
84
|
-
label: "Choice id",
|
|
85
|
-
placeholder: "e.g. miniprogram-vue-v2-bakery",
|
|
86
|
-
"helper-text": "Lowercase, kebab-case. Cannot be changed after creation.",
|
|
87
|
-
disabled: e.value,
|
|
88
|
-
rules: [(o) => /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/.test(o.trim()) || "Lowercase kebab-case, e.g. miniprogram-vue-v2-bakery"]
|
|
89
|
-
}, null, 8, ["modelValue", "disabled", "rules"])),
|
|
90
|
-
d(j, {
|
|
91
|
-
modelValue: b.value,
|
|
92
|
-
"onUpdate:modelValue": a[1] || (a[1] = (o) => b.value = o),
|
|
93
|
-
label: "Physical template",
|
|
94
|
-
items: t.value,
|
|
95
|
-
disabled: e.value || l.value || t.value.length <= 1
|
|
96
|
-
}, null, 8, ["modelValue", "items", "disabled"]),
|
|
97
|
-
w.value ? (n(), S(j, {
|
|
98
|
-
key: 1,
|
|
99
|
-
modelValue: _.value,
|
|
100
|
-
"onUpdate:modelValue": a[2] || (a[2] = (o) => _.value = o),
|
|
101
|
-
label: "Restaurant style",
|
|
102
|
-
"helper-text": "Only styles templates/miniprogram-vue-v2/src/brand/recipes.ts already implements.",
|
|
103
|
-
items: le(Q),
|
|
104
|
-
disabled: e.value
|
|
105
|
-
}, null, 8, ["modelValue", "items", "disabled"])) : F("", !0),
|
|
106
|
-
d(D, {
|
|
107
|
-
modelValue: f.value,
|
|
108
|
-
"onUpdate:modelValue": a[3] || (a[3] = (o) => f.value = o),
|
|
109
|
-
label: "Label",
|
|
110
|
-
placeholder: "Shown to merchants in the picker",
|
|
111
|
-
disabled: e.value
|
|
112
|
-
}, null, 8, ["modelValue", "disabled"]),
|
|
113
|
-
d(Z, {
|
|
114
|
-
modelValue: y.value,
|
|
115
|
-
"onUpdate:modelValue": a[4] || (a[4] = (o) => y.value = o),
|
|
116
|
-
label: "Description",
|
|
117
|
-
placeholder: "One or two sentences on what the merchant gets",
|
|
118
|
-
disabled: e.value
|
|
119
|
-
}, null, 8, ["modelValue", "disabled"]),
|
|
120
|
-
d(D, {
|
|
121
|
-
modelValue: T.value,
|
|
122
|
-
"onUpdate:modelValue": a[5] || (a[5] = (o) => T.value = o),
|
|
123
|
-
label: "Industries (comma-separated)",
|
|
124
|
-
placeholder: "e.g. Food & beverage",
|
|
125
|
-
disabled: e.value
|
|
126
|
-
}, null, 8, ["modelValue", "disabled"]),
|
|
127
|
-
d(ee, {
|
|
128
|
-
modelValue: V.value,
|
|
129
|
-
"onUpdate:modelValue": a[6] || (a[6] = (o) => V.value = o),
|
|
130
|
-
label: "Default choice",
|
|
131
|
-
sublabel: "Used when a provision request names none",
|
|
132
|
-
disabled: e.value
|
|
133
|
-
}, null, 8, ["modelValue", "disabled"]),
|
|
134
|
-
u.value ? (n(), v("p", ue, c(u.value), 1)) : F("", !0),
|
|
135
|
-
s("footer", null, [
|
|
136
|
-
d(q, {
|
|
137
|
-
label: "Cancel",
|
|
138
|
-
variant: "tertiary",
|
|
139
|
-
disabled: e.value,
|
|
140
|
-
onClick: a[7] || (a[7] = (o) => C("close"))
|
|
141
|
-
}, null, 8, ["disabled"]),
|
|
142
|
-
d(q, {
|
|
143
|
-
label: l.value ? "Save" : "Create",
|
|
144
|
-
type: "submit",
|
|
145
|
-
loading: e.value,
|
|
146
|
-
disabled: !N.value
|
|
147
|
-
}, null, 8, ["label", "loading", "disabled"])
|
|
148
|
-
])
|
|
149
|
-
];
|
|
150
|
-
}),
|
|
151
|
-
_: 1
|
|
152
|
-
})
|
|
153
|
-
]),
|
|
154
|
-
_: 1
|
|
155
|
-
});
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
}), me = /* @__PURE__ */ Y(ce, [["__scopeId", "data-v-9346a740"]]), pe = { class: "portal-page" }, ve = { class: "portal-page-inner" }, be = { class: "portal-page-heading" }, _e = {
|
|
159
|
-
key: 0,
|
|
160
|
-
class: "portal-error",
|
|
161
|
-
role: "alert"
|
|
162
|
-
}, he = {
|
|
163
|
-
key: 1,
|
|
164
|
-
role: "status"
|
|
165
|
-
}, fe = {
|
|
166
|
-
key: 2,
|
|
167
|
-
class: "template-choices__list",
|
|
168
|
-
"aria-label": "Template choices"
|
|
169
|
-
}, ye = { class: "template-choices__name" }, ge = { class: "template-choices__label" }, Ce = { key: 0 }, ke = { class: "template-choices__id" }, Te = { class: "template-choices__meta" }, Ve = ["datetime"], we = { class: "template-choices__actions" }, Se = /* @__PURE__ */ W({
|
|
170
|
-
__name: "TemplateCenterView",
|
|
171
|
-
setup(x) {
|
|
172
|
-
const g = ie(), i = r([]), C = r(!0), m = r(""), b = new AbortController();
|
|
173
|
-
async function _() {
|
|
174
|
-
C.value = !0, m.value = "";
|
|
175
|
-
try {
|
|
176
|
-
const e = await P(A.appTemplateChoices(), {
|
|
177
|
-
signal: b.signal
|
|
178
|
-
});
|
|
179
|
-
i.value = e.choices;
|
|
180
|
-
} catch (e) {
|
|
181
|
-
b.signal.aborted || (m.value = $(e));
|
|
182
|
-
} finally {
|
|
183
|
-
C.value = !1;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
function f(e) {
|
|
187
|
-
g.open({
|
|
188
|
-
title: e ? `Edit ${e.label}` : "New template choice",
|
|
189
|
-
dialogComponent: me,
|
|
190
|
-
dialogComponentProps: {
|
|
191
|
-
choice: e,
|
|
192
|
-
onClose: () => g.close(),
|
|
193
|
-
onSaved: () => {
|
|
194
|
-
g.close(), _();
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
async function y(e, u) {
|
|
200
|
-
try {
|
|
201
|
-
await P(
|
|
202
|
-
u === "archived" ? A.appTemplateChoiceArchive(e.id) : A.appTemplateChoiceRestore(e.id),
|
|
203
|
-
{ method: "POST" }
|
|
204
|
-
), await _();
|
|
205
|
-
} catch (l) {
|
|
206
|
-
m.value = $(l);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
function T(e) {
|
|
210
|
-
g.open({
|
|
211
|
-
title: `Archive ${e.label}?`,
|
|
212
|
-
message: "It stops appearing for new projects. Merchants already provisioned from it are unaffected — it is never consulted again after provisioning.",
|
|
213
|
-
primaryActions: { text: "Archive", close: !0, variant: "primary" },
|
|
214
|
-
secondaryActions: { text: "Cancel", close: !0, variant: "tertiary" }
|
|
215
|
-
}).onPrimary(() => void y(e, "archived"));
|
|
216
|
-
}
|
|
217
|
-
function V(e) {
|
|
218
|
-
return new Intl.DateTimeFormat(void 0, { dateStyle: "medium", timeStyle: "short" }).format(new Date(e));
|
|
219
|
-
}
|
|
220
|
-
return oe(() => void _()), ne(() => b.abort()), (e, u) => {
|
|
221
|
-
const l = h("FmButton");
|
|
222
|
-
return n(), v("div", pe, [
|
|
223
|
-
s("div", ve, [
|
|
224
|
-
s("header", be, [
|
|
225
|
-
u[1] || (u[1] = s("div", null, [
|
|
226
|
-
s("p", { class: "portal-eyebrow" }, "Internal"),
|
|
227
|
-
s("h1", null, "Template Center")
|
|
228
|
-
], -1)),
|
|
229
|
-
d(l, {
|
|
230
|
-
label: "New choice",
|
|
231
|
-
icon: "add",
|
|
232
|
-
onClick: u[0] || (u[0] = (t) => f())
|
|
233
|
-
})
|
|
234
|
-
]),
|
|
235
|
-
m.value ? (n(), v("p", _e, [
|
|
236
|
-
k(c(m.value) + " ", 1),
|
|
237
|
-
d(l, {
|
|
238
|
-
label: "Retry",
|
|
239
|
-
variant: "tertiary",
|
|
240
|
-
onClick: _
|
|
241
|
-
})
|
|
242
|
-
])) : C.value ? (n(), v("p", he, "Loading template choices…")) : (n(), v("section", fe, [
|
|
243
|
-
(n(!0), v(H, null, se(i.value, (t) => (n(), v("article", {
|
|
244
|
-
key: t.id,
|
|
245
|
-
class: "template-choices__row"
|
|
246
|
-
}, [
|
|
247
|
-
s("div", ye, [
|
|
248
|
-
s("span", ge, [
|
|
249
|
-
k(c(t.label), 1),
|
|
250
|
-
t.default ? (n(), v("span", Ce, " · Default")) : F("", !0)
|
|
251
|
-
]),
|
|
252
|
-
s("span", ke, c(t.id), 1),
|
|
253
|
-
s("span", Te, [
|
|
254
|
-
k(c(t.appTemplateId), 1),
|
|
255
|
-
t.restaurantStyle ? (n(), v(H, { key: 0 }, [
|
|
256
|
-
k(" · " + c(t.restaurantStyle), 1)
|
|
257
|
-
], 64)) : F("", !0),
|
|
258
|
-
k(" · " + c(t.industries.join(", ") || "General-purpose") + " · " + c((t.environments ?? []).join(", ")), 1)
|
|
259
|
-
])
|
|
260
|
-
]),
|
|
261
|
-
d(re, {
|
|
262
|
-
variant: t.status === "active" ? "success" : "neutral"
|
|
263
|
-
}, {
|
|
264
|
-
default: I(() => [
|
|
265
|
-
k(c(t.status === "active" ? "Active" : "Archived"), 1)
|
|
266
|
-
]),
|
|
267
|
-
_: 2
|
|
268
|
-
}, 1032, ["variant"]),
|
|
269
|
-
s("time", {
|
|
270
|
-
datetime: t.updatedAt
|
|
271
|
-
}, c(V(t.updatedAt)), 9, Ve),
|
|
272
|
-
s("div", we, [
|
|
273
|
-
d(l, {
|
|
274
|
-
label: "Edit",
|
|
275
|
-
variant: "secondary",
|
|
276
|
-
onClick: (w) => f(t)
|
|
277
|
-
}, null, 8, ["onClick"]),
|
|
278
|
-
t.status === "active" ? (n(), S(l, {
|
|
279
|
-
key: 0,
|
|
280
|
-
label: "Archive",
|
|
281
|
-
variant: "tertiary",
|
|
282
|
-
onClick: (w) => T(t)
|
|
283
|
-
}, null, 8, ["onClick"])) : (n(), S(l, {
|
|
284
|
-
key: 1,
|
|
285
|
-
label: "Restore",
|
|
286
|
-
variant: "tertiary",
|
|
287
|
-
onClick: (w) => y(t, "active")
|
|
288
|
-
}, null, 8, ["onClick"]))
|
|
289
|
-
])
|
|
290
|
-
]))), 128))
|
|
291
|
-
]))
|
|
292
|
-
])
|
|
293
|
-
]);
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
}), Pe = /* @__PURE__ */ Y(Se, [["__scopeId", "data-v-da7cd846"]]);
|
|
297
|
-
export {
|
|
298
|
-
Pe as default
|
|
299
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { defineComponent as c, watchEffect as a, openBlock as n, createElementBlock as p } from "vue";
|
|
2
|
-
import { useRoute as i, useRouter as u } from "vue-router";
|
|
3
|
-
import { u as l } from "./portalContext-DCwZcTKL.js";
|
|
4
|
-
import { w as m, a as f } from "./portalNavigation-DOF4Ah49.js";
|
|
5
|
-
const _ = {
|
|
6
|
-
class: "portal-loading",
|
|
7
|
-
role: "status"
|
|
8
|
-
}, x = /* @__PURE__ */ c({
|
|
9
|
-
__name: "WorkspaceEntryView",
|
|
10
|
-
setup(w) {
|
|
11
|
-
const r = l(), e = i(), s = u();
|
|
12
|
-
return a(() => {
|
|
13
|
-
var t;
|
|
14
|
-
const o = (t = r.context.value) == null ? void 0 : t.projectId;
|
|
15
|
-
o && s.replace(m(o, e.query.view === "sessions" ? "sessions" : f(e.query.view), e.query));
|
|
16
|
-
}), (o, t) => (n(), p("p", _, "Opening your workspace…"));
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
export {
|
|
20
|
-
x as default
|
|
21
|
-
};
|