@feedmepos/mf-miniprogram-v2 0.2.8-dev.2 → 0.2.8-dev.20
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-C8Vn8LvE.js → App-dgkwfArX.js} +337 -338
- package/dist/{BrandFontPicker-JHyoGusq.js → BrandFontPicker-CF3O3meB.js} +1 -1
- package/dist/BrandKitView-CdLMBZKd.js +276 -0
- package/dist/ControlPlaneView-fc2wIqfk.js +27162 -0
- package/dist/{EcosystemView-XP9IZ9wn.js → EcosystemView-DHtS5IDN.js} +115 -93
- package/dist/MobileProjectDialog-Bt6r-bHC.js +446 -0
- package/dist/MobileProjectsView-Dvj7YKlO.js +237 -0
- package/dist/ModuleCenterView-t8rhd419.js +283 -0
- package/dist/ModuleDetailView-CcqJ4Hfu.js +296 -0
- package/dist/{PagesView-DzDqCd8N.js → PagesView-D0RMTyqw.js} +2 -2
- package/dist/{PlatformUnavailableView-CdHjkolw.js → PlatformUnavailableView-OHEJAztd.js} +1 -1
- package/dist/{PortalSettingsView-Df5jChmi.js → PortalSettingsView-B68s6fiS.js} +3 -3
- package/dist/StatusBadge.vue_vue_type_script_setup_true_lang-DMm_s9ua.js +41 -0
- package/dist/TemplateCenterView-Cpr39Y5S.js +515 -0
- package/dist/{WorkspaceEntryView-DQkYJWdf.js → WorkspaceEntryView-gM7RX5BV.js} +2 -2
- package/dist/app.js +15 -15
- package/dist/{controlPlane-sXaC6pAh.js → controlPlane-DR5ykj4d.js} +8 -8
- package/dist/{adminAccess-D2K-L-Vt.js → localPreference-Do4VKtxT.js} +35 -35
- package/dist/package.json +1 -1
- package/dist/{portalContext-DV-6uUwp.js → portalContext-BeKN8Bcx.js} +2 -2
- package/dist/portalNavigation-DLcC7Koh.js +43 -0
- package/dist/{routes-CeuodIgg.js → routes-B9oMJsaM.js} +45 -27
- package/dist/style.css +1 -1
- package/dist/{useBrandKit-CXLIXo5j.js → useBrandKit-MkgkEuIX.js} +265 -233
- package/dist/useModuleCatalog-Daw8KA--.js +147 -0
- package/package.json +1 -1
- package/dist/AppTemplatePicker.vue_vue_type_script_setup_true_lang-LE_aKvfg.js +0 -198
- package/dist/BrandKitView-Dlt_ifI0.js +0 -249
- package/dist/ControlPlaneView-qDA8RgiR.js +0 -25317
- package/dist/MobileProjectsView-aAyHV5G-.js +0 -333
- package/dist/ModuleCenterView-C6mCPATr.js +0 -147
- package/dist/ModuleDetailView-CSfMF0Uo.js +0 -189
- package/dist/StatusBadge.vue_vue_type_script_setup_true_lang-CMgQ0bd_.js +0 -30
- package/dist/TemplateCenterView-DrWImUYO.js +0 -425
- package/dist/portalNavigation-C29ihtq_.js +0 -38
- package/dist/useModuleCatalog-Cep-pzWO.js +0 -124
|
@@ -1,333 +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-sXaC6pAh.js";
|
|
6
|
-
import { u as W } from "./portalContext-DV-6uUwp.js";
|
|
7
|
-
import { w as F } from "./portalNavigation-C29ihtq_.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), {
|
|
145
|
-
signal: n.signal
|
|
146
|
-
});
|
|
147
|
-
d.value = t.projects;
|
|
148
|
-
} catch (t) {
|
|
149
|
-
n.signal.aborted || (c.value = z(t));
|
|
150
|
-
} finally {
|
|
151
|
-
l.value = !1;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
function _(t) {
|
|
155
|
-
u.open({
|
|
156
|
-
title: t ? "Rename project" : "New Mobile project",
|
|
157
|
-
dialogComponent: re,
|
|
158
|
-
dialogComponentProps: {
|
|
159
|
-
businessId: s.businessId.value,
|
|
160
|
-
projectId: t == null ? void 0 : t.projectId,
|
|
161
|
-
initialName: t == null ? void 0 : t.name,
|
|
162
|
-
onClose: () => u.close(),
|
|
163
|
-
onSaved: (e) => {
|
|
164
|
-
u.close(), t ? p() : o.push(F(e.projectId, "workspace", m.query, { setup: !0 }));
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
function x(t) {
|
|
170
|
-
return new Intl.DateTimeFormat(void 0, { dateStyle: "medium", timeStyle: "short" }).format(new Date(t));
|
|
171
|
-
}
|
|
172
|
-
const N = D(() => [
|
|
173
|
-
{
|
|
174
|
-
id: "project",
|
|
175
|
-
header: () => "Project",
|
|
176
|
-
cell: (t) => {
|
|
177
|
-
const e = t.row.original;
|
|
178
|
-
return r("div", { class: "flex min-w-0 flex-col gap-2" }, [
|
|
179
|
-
r("span", { class: "truncate fm-typo-en-body-md-600 text-portal-text-primary" }, e.name),
|
|
180
|
-
r(
|
|
181
|
-
"span",
|
|
182
|
-
{ class: "fm-typo-en-body-sm-400 text-portal-text-muted", title: e.projectId },
|
|
183
|
-
`…${e.projectId.slice(-6)}`
|
|
184
|
-
)
|
|
185
|
-
]);
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
id: "setup",
|
|
190
|
-
header: () => "Setup",
|
|
191
|
-
size: 130,
|
|
192
|
-
enableSorting: !1,
|
|
193
|
-
cell: (t) => r(
|
|
194
|
-
R,
|
|
195
|
-
{ variant: t.row.original.provisioningStatus === "failed" ? "error" : "neutral", size: "sm" },
|
|
196
|
-
() => Z(t.row.original.provisioningStatus)
|
|
197
|
-
)
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
id: "live",
|
|
201
|
-
header: () => "Live",
|
|
202
|
-
size: 200,
|
|
203
|
-
enableSorting: !1,
|
|
204
|
-
// Badges only. The muted sentence this replaces ("Unpublished release
|
|
205
|
-
// available") was the one thing in the row set in prose, and prose in a 200px
|
|
206
|
-
// column wraps — which is what made the cell look crowded. The state it
|
|
207
|
-
// carried is worth keeping, so it becomes a second tag rather than going away:
|
|
208
|
-
// it is the only place in this list that shows a merchant they have work built
|
|
209
|
-
// and waiting to go live.
|
|
210
|
-
//
|
|
211
|
-
// Nothing is rendered for a project with no pending release. That is the
|
|
212
|
-
// resting state of most rows, and a tag saying so would be back to filling the
|
|
213
|
-
// column with "nothing happened".
|
|
214
|
-
cell: (t) => {
|
|
215
|
-
const e = t.row.original;
|
|
216
|
-
return r("div", { class: "flex flex-wrap items-center gap-4" }, [
|
|
217
|
-
// "Live project" in a column headed Live said the word twice, and cost the
|
|
218
|
-
// width that made the line below it wrap.
|
|
219
|
-
r(
|
|
220
|
-
R,
|
|
221
|
-
{ variant: e.isLive ? "success" : "neutral", size: "sm" },
|
|
222
|
-
() => e.isLive ? "Live" : "Not live"
|
|
223
|
-
),
|
|
224
|
-
// `=== true` rather than truthiness: the field is optional in the contract,
|
|
225
|
-
// and an absent value means the state is unknown, not that it is false.
|
|
226
|
-
// This endpoint always sends a boolean, so that is a contract-level
|
|
227
|
-
// possibility rather than one a merchant meets.
|
|
228
|
-
e.hasUnpublishedRelease === !0 ? r(
|
|
229
|
-
R,
|
|
230
|
-
{ variant: "warning", size: "sm", title: "A release is built and waiting to be published" },
|
|
231
|
-
() => "Unpublished"
|
|
232
|
-
) : null
|
|
233
|
-
]);
|
|
234
|
-
}
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
id: "updatedAt",
|
|
238
|
-
header: () => "Last edited",
|
|
239
|
-
size: 170,
|
|
240
|
-
enableSorting: !1,
|
|
241
|
-
cell: (t) => r("span", { class: "fm-typo-en-body-sm-400 text-portal-text-muted" }, x(t.row.original.updatedAt))
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
id: "actions",
|
|
245
|
-
header: () => "",
|
|
246
|
-
size: 340,
|
|
247
|
-
enableSorting: !1,
|
|
248
|
-
cell: (t) => {
|
|
249
|
-
const e = t.row.original;
|
|
250
|
-
return r("div", { class: "flex flex-wrap items-center justify-end gap-4" }, [
|
|
251
|
-
e.provisioningStatus === "ready" ? r(h, {
|
|
252
|
-
icon: "deployed_code",
|
|
253
|
-
variant: "tertiary",
|
|
254
|
-
title: "View releases",
|
|
255
|
-
onClick: T(
|
|
256
|
-
() => o.push(F(e.projectId, "releases", m.query)),
|
|
257
|
-
["stop"]
|
|
258
|
-
)
|
|
259
|
-
}) : null,
|
|
260
|
-
r(h, {
|
|
261
|
-
label: "Rename",
|
|
262
|
-
variant: "tertiary",
|
|
263
|
-
onClick: T(() => _(e), ["stop"])
|
|
264
|
-
}),
|
|
265
|
-
r(h, {
|
|
266
|
-
label: e.provisioningStatus === "ready" ? "Open editor" : "Continue setup",
|
|
267
|
-
variant: "secondary",
|
|
268
|
-
onClick: T(
|
|
269
|
-
() => o.push(F(e.projectId, "workspace", m.query)),
|
|
270
|
-
["stop"]
|
|
271
|
-
)
|
|
272
|
-
})
|
|
273
|
-
]);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
]), v = D(() => !l.value && d.value.length > 0);
|
|
277
|
-
return O(() => {
|
|
278
|
-
if (p(), m.query.create === "1") {
|
|
279
|
-
const { create: t, ...e } = m.query;
|
|
280
|
-
o.replace({ query: e }), _();
|
|
281
|
-
}
|
|
282
|
-
}), Y(() => n.abort()), (t, e) => {
|
|
283
|
-
const f = w("FmButton"), M = w("FmTable");
|
|
284
|
-
return a(), b("div", se, [
|
|
285
|
-
i("div", ne, [
|
|
286
|
-
i("header", ie, [
|
|
287
|
-
i("div", null, [
|
|
288
|
-
e[4] || (e[4] = i("p", { class: "portal-eyebrow" }, "Mobile Ordering", -1)),
|
|
289
|
-
i("h1", null, [
|
|
290
|
-
e[3] || (e[3] = q("Projects ", -1)),
|
|
291
|
-
l.value ? I("", !0) : (a(), b("span", ue, V(d.value.length), 1))
|
|
292
|
-
])
|
|
293
|
-
]),
|
|
294
|
-
v.value ? (a(), S(f, {
|
|
295
|
-
key: 0,
|
|
296
|
-
label: "New project",
|
|
297
|
-
icon: "add",
|
|
298
|
-
onClick: e[0] || (e[0] = (k) => _())
|
|
299
|
-
})) : I("", !0)
|
|
300
|
-
]),
|
|
301
|
-
c.value ? (a(), b("p", de, [
|
|
302
|
-
q(V(c.value) + " ", 1),
|
|
303
|
-
j(f, {
|
|
304
|
-
label: "Retry",
|
|
305
|
-
variant: "tertiary",
|
|
306
|
-
onClick: p
|
|
307
|
-
})
|
|
308
|
-
])) : l.value ? (a(), b("p", ce, "Loading projects…")) : d.value.length ? (a(), b("section", me, [
|
|
309
|
-
j(M, {
|
|
310
|
-
"column-defs": N.value,
|
|
311
|
-
"row-data": d.value,
|
|
312
|
-
"page-size": d.value.length,
|
|
313
|
-
"hide-footer": "",
|
|
314
|
-
"pin-header-row": "",
|
|
315
|
-
onRowClick: e[2] || (e[2] = (k) => B(o).push(B(F)(k.original.projectId, "workspace", B(m).query)))
|
|
316
|
-
}, null, 8, ["column-defs", "row-data", "page-size"])
|
|
317
|
-
])) : (a(), b("section", pe, [
|
|
318
|
-
e[5] || (e[5] = i("h2", null, "Your first Mobile project", -1)),
|
|
319
|
-
e[6] || (e[6] = i("p", null, "Create an app from a template to start editing.", -1)),
|
|
320
|
-
j(f, {
|
|
321
|
-
label: "New project",
|
|
322
|
-
icon: "add",
|
|
323
|
-
onClick: e[1] || (e[1] = (k) => _())
|
|
324
|
-
})
|
|
325
|
-
]))
|
|
326
|
-
])
|
|
327
|
-
]);
|
|
328
|
-
};
|
|
329
|
-
}
|
|
330
|
-
}), xe = /* @__PURE__ */ U(ve, [["__scopeId", "data-v-e7f1f8c0"]]);
|
|
331
|
-
export {
|
|
332
|
-
xe as default
|
|
333
|
-
};
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { defineComponent as F, openBlock as e, createElementBlock as n, createElementVNode as o, toDisplayString as d, createCommentVNode as k, ref as w, computed as m, onMounted as q, resolveComponent as f, createVNode as p, unref as i, Fragment as v, renderList as b, normalizeClass as A, createBlock as y, withCtx as R } from "vue";
|
|
2
|
-
import { useRoute as z } from "vue-router";
|
|
3
|
-
import { _ as T } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
-
import { u as D, c as G, f as K, _ as h, t as O } from "./useModuleCatalog-Cep-pzWO.js";
|
|
5
|
-
const P = { class: "card" }, U = { class: "card__head" }, j = { class: "card__name fm-typo-en-body-md-600 text-portal-text-primary" }, H = { class: "card__version fm-typo-en-body-sm-400 text-portal-text-muted" }, J = { class: "card__description fm-typo-en-body-sm-400 text-portal-text-muted" }, Q = { class: "card__tags" }, W = { class: "card__tag card__tag--tier fm-typo-en-body-sm-600" }, X = {
|
|
6
|
-
key: 0,
|
|
7
|
-
class: "card__tag card__tag--slot fm-typo-en-body-sm-400"
|
|
8
|
-
}, Y = /* @__PURE__ */ F({
|
|
9
|
-
__name: "ModuleCard",
|
|
10
|
-
props: {
|
|
11
|
-
entry: {}
|
|
12
|
-
},
|
|
13
|
-
setup(l) {
|
|
14
|
-
return (s, g) => (e(), n("article", P, [
|
|
15
|
-
o("header", U, [
|
|
16
|
-
o("h3", j, d(l.entry.name), 1),
|
|
17
|
-
o("span", H, d(l.entry.version), 1)
|
|
18
|
-
]),
|
|
19
|
-
o("p", J, d(l.entry.description || l.entry.id), 1),
|
|
20
|
-
o("footer", Q, [
|
|
21
|
-
o("span", W, d(l.entry.category), 1),
|
|
22
|
-
l.entry.slot ? (e(), n("span", X, d(l.entry.slot), 1)) : k("", !0)
|
|
23
|
-
])
|
|
24
|
-
]));
|
|
25
|
-
}
|
|
26
|
-
}), Z = /* @__PURE__ */ T(Y, [["__scopeId", "data-v-2fbfd7b3"]]), ee = { class: "shell" }, te = { class: "centre" }, oe = { class: "centre__inner" }, ne = { class: "centre__head" }, se = {
|
|
27
|
-
key: 0,
|
|
28
|
-
class: "centre__filters"
|
|
29
|
-
}, ae = { class: "centre__facet-label fm-typo-en-body-sm-600 text-portal-text-muted" }, le = { class: "centre__chips" }, re = ["aria-pressed", "onClick"], ie = {
|
|
30
|
-
key: 1,
|
|
31
|
-
class: "centre__note fm-typo-en-body-md-400"
|
|
32
|
-
}, de = {
|
|
33
|
-
key: 6,
|
|
34
|
-
class: "centre__grid"
|
|
35
|
-
}, ce = /* @__PURE__ */ F({
|
|
36
|
-
__name: "ModuleCenterView",
|
|
37
|
-
setup(l) {
|
|
38
|
-
const s = D(), g = z(), u = w(""), c = w([]), V = m(() => G(s.entries.value ?? [])), x = m(() => K(s.entries.value ?? [], u.value, c.value)), N = m(() => u.value.trim().length > 0 || c.value.length > 0), C = m(() => {
|
|
39
|
-
var r;
|
|
40
|
-
return (((r = s.entries.value) == null ? void 0 : r.length) ?? 0) > 0;
|
|
41
|
-
}), B = {
|
|
42
|
-
tier: "Type",
|
|
43
|
-
slot: "Slot"
|
|
44
|
-
};
|
|
45
|
-
function $(r) {
|
|
46
|
-
return c.value.some((a) => a.kind === r.kind && a.value === r.value);
|
|
47
|
-
}
|
|
48
|
-
function L(r) {
|
|
49
|
-
c.value = O(c.value, r);
|
|
50
|
-
}
|
|
51
|
-
function M() {
|
|
52
|
-
u.value = "", c.value = [];
|
|
53
|
-
}
|
|
54
|
-
return q(() => s.load()), (r, a) => {
|
|
55
|
-
const E = f("FmButton"), S = f("FmTextField"), I = f("RouterLink");
|
|
56
|
-
return e(), n("div", ee, [
|
|
57
|
-
o("div", te, [
|
|
58
|
-
o("div", oe, [
|
|
59
|
-
o("header", ne, [
|
|
60
|
-
a[3] || (a[3] = o("div", null, [
|
|
61
|
-
o("h2", { class: "centre__title fm-typo-en-title-sm-600 text-portal-text-primary" }, "Module library"),
|
|
62
|
-
o("p", { class: "centre__subtitle fm-typo-en-body-md-400 text-portal-text-muted" }, " Modules the agent can put on a page. Published from the platform, not from your app. ")
|
|
63
|
-
], -1)),
|
|
64
|
-
p(E, {
|
|
65
|
-
size: "md",
|
|
66
|
-
variant: "tertiary",
|
|
67
|
-
icon: "refresh",
|
|
68
|
-
onClick: a[0] || (a[0] = (t) => i(s).load(!0))
|
|
69
|
-
})
|
|
70
|
-
]),
|
|
71
|
-
C.value ? (e(), n("div", se, [
|
|
72
|
-
p(S, {
|
|
73
|
-
modelValue: u.value,
|
|
74
|
-
"onUpdate:modelValue": a[1] || (a[1] = (t) => u.value = t),
|
|
75
|
-
label: "Search",
|
|
76
|
-
placeholder: "name, slot, or label"
|
|
77
|
-
}, null, 8, ["modelValue"]),
|
|
78
|
-
(e(!0), n(v, null, b(V.value, (t) => (e(), n("div", {
|
|
79
|
-
key: t.kind,
|
|
80
|
-
class: "centre__facet"
|
|
81
|
-
}, [
|
|
82
|
-
o("span", ae, d(B[t.kind]), 1),
|
|
83
|
-
o("div", le, [
|
|
84
|
-
(e(!0), n(v, null, b(t.values, (_) => (e(), n("button", {
|
|
85
|
-
key: _,
|
|
86
|
-
type: "button",
|
|
87
|
-
class: A(["centre__chip fm-typo-en-body-sm-400", { "centre__chip--on": $({ kind: t.kind, value: _ }) }]),
|
|
88
|
-
"aria-pressed": $({ kind: t.kind, value: _ }),
|
|
89
|
-
onClick: (ue) => L({ kind: t.kind, value: _ })
|
|
90
|
-
}, d(_), 11, re))), 128))
|
|
91
|
-
])
|
|
92
|
-
]))), 128)),
|
|
93
|
-
N.value ? (e(), n("button", {
|
|
94
|
-
key: 0,
|
|
95
|
-
type: "button",
|
|
96
|
-
class: "centre__clear fm-typo-en-body-sm-600",
|
|
97
|
-
onClick: M
|
|
98
|
-
}, " Clear filters ")) : k("", !0)
|
|
99
|
-
])) : k("", !0),
|
|
100
|
-
i(s).entries.value === null ? (e(), n("p", ie, "Loading…")) : i(s).loadError.value ? (e(), y(h, {
|
|
101
|
-
key: 2,
|
|
102
|
-
icon: "error_outline",
|
|
103
|
-
tone: "error",
|
|
104
|
-
title: "Could not load the module library",
|
|
105
|
-
message: i(s).loadError.value,
|
|
106
|
-
"action-label": "Try again",
|
|
107
|
-
onAction: a[2] || (a[2] = (t) => i(s).load(!0))
|
|
108
|
-
}, null, 8, ["message"])) : i(s).unpublished.value ? (e(), y(h, {
|
|
109
|
-
key: 3,
|
|
110
|
-
icon: "widgets",
|
|
111
|
-
title: "No module library has been published yet",
|
|
112
|
-
message: "Modules are published from the platform, separately from merging them. Once one is published it appears here, and every workspace started afterwards receives it."
|
|
113
|
-
})) : C.value ? x.value.length ? (e(), n("ul", de, [
|
|
114
|
-
(e(!0), n(v, null, b(x.value, (t) => (e(), n("li", {
|
|
115
|
-
key: t.id
|
|
116
|
-
}, [
|
|
117
|
-
p(I, {
|
|
118
|
-
class: "centre__link",
|
|
119
|
-
to: { name: "miniprogram-v2-module-detail", params: { name: t.name }, query: i(g).query }
|
|
120
|
-
}, {
|
|
121
|
-
default: R(() => [
|
|
122
|
-
p(Z, { entry: t }, null, 8, ["entry"])
|
|
123
|
-
]),
|
|
124
|
-
_: 2
|
|
125
|
-
}, 1032, ["to"])
|
|
126
|
-
]))), 128))
|
|
127
|
-
])) : (e(), y(h, {
|
|
128
|
-
key: 5,
|
|
129
|
-
icon: "search_off",
|
|
130
|
-
title: "No module matches these filters",
|
|
131
|
-
"action-label": "Clear filters",
|
|
132
|
-
onAction: M
|
|
133
|
-
})) : (e(), y(h, {
|
|
134
|
-
key: 4,
|
|
135
|
-
icon: "widgets",
|
|
136
|
-
title: "The module library is empty",
|
|
137
|
-
message: "It has been published, but holds no modules. Nothing here is available to put on a page yet."
|
|
138
|
-
}))
|
|
139
|
-
])
|
|
140
|
-
])
|
|
141
|
-
]);
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
}), he = /* @__PURE__ */ T(ce, [["__scopeId", "data-v-644d1ae5"]]);
|
|
145
|
-
export {
|
|
146
|
-
he as default
|
|
147
|
-
};
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import { defineComponent as C, ref as M, computed as u, watch as T, resolveComponent as g, openBlock as n, createElementBlock as l, createElementVNode as e, toDisplayString as i, createCommentVNode as _, Fragment as I, renderList as S, createVNode as k, onMounted as B, unref as d, withCtx as L, createBlock as v } from "vue";
|
|
2
|
-
import { useRoute as N, useRouter as P } from "vue-router";
|
|
3
|
-
import { m as q, i as A, u as F, _ as w } from "./useModuleCatalog-Cep-pzWO.js";
|
|
4
|
-
import { useDialog as V } from "@feedmepos/ui-library";
|
|
5
|
-
import { _ as E } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
|
-
const R = { class: "detail" }, j = { class: "detail__head" }, z = { class: "detail__name fm-typo-en-title-sm-600 text-portal-text-primary" }, K = { class: "detail__version fm-typo-en-body-md-400 text-portal-text-muted" }, O = {
|
|
7
|
-
key: 0,
|
|
8
|
-
class: "detail__description fm-typo-en-body-md-400 text-portal-text-muted"
|
|
9
|
-
}, Y = { class: "detail__columns" }, G = { class: "detail__preview" }, H = {
|
|
10
|
-
key: 0,
|
|
11
|
-
class: "detail__note detail__note--error fm-typo-en-body-md-400"
|
|
12
|
-
}, J = {
|
|
13
|
-
key: 1,
|
|
14
|
-
class: "detail__note fm-typo-en-body-md-400"
|
|
15
|
-
}, Q = ["srcdoc"], U = { class: "detail__facts" }, W = { class: "detail__section" }, X = { class: "detail__list fm-typo-en-body-md-400" }, Z = { key: 0 }, ee = { key: 1 }, te = { class: "detail__section" }, oe = {
|
|
16
|
-
key: 0,
|
|
17
|
-
class: "detail__note fm-typo-en-body-md-400"
|
|
18
|
-
}, ne = {
|
|
19
|
-
key: 1,
|
|
20
|
-
class: "detail__props"
|
|
21
|
-
}, se = {
|
|
22
|
-
key: 0,
|
|
23
|
-
class: "detail__optional fm-typo-en-body-sm-400"
|
|
24
|
-
}, le = { class: "detail__section" }, ae = ["value"], ie = /* @__PURE__ */ C({
|
|
25
|
-
__name: "ModuleDetail",
|
|
26
|
-
props: {
|
|
27
|
-
entry: {},
|
|
28
|
-
previewDocument: {},
|
|
29
|
-
previewError: {}
|
|
30
|
-
},
|
|
31
|
-
setup(o) {
|
|
32
|
-
const r = o, b = V(), s = M(!1);
|
|
33
|
-
let m;
|
|
34
|
-
const c = u(() => q(r.entry)), p = u(
|
|
35
|
-
() => r.previewDocument ? A(r.previewDocument, r.entry.name) : null
|
|
36
|
-
);
|
|
37
|
-
T(
|
|
38
|
-
() => r.entry.name,
|
|
39
|
-
() => {
|
|
40
|
-
s.value = !1;
|
|
41
|
-
}
|
|
42
|
-
);
|
|
43
|
-
async function x() {
|
|
44
|
-
try {
|
|
45
|
-
await navigator.clipboard.writeText(c.value), s.value = !0, window.clearTimeout(m), m = window.setTimeout(() => {
|
|
46
|
-
s.value = !1;
|
|
47
|
-
}, 2e3);
|
|
48
|
-
} catch (a) {
|
|
49
|
-
b.open({
|
|
50
|
-
title: "Could not copy",
|
|
51
|
-
message: `${a instanceof Error ? a.message : String(a)}. Select the text below and copy it manually.`,
|
|
52
|
-
dismissAway: !0,
|
|
53
|
-
primaryActions: { close: !0, text: "OK" }
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return (a, t) => {
|
|
58
|
-
var y, D, $;
|
|
59
|
-
const f = g("FmButton");
|
|
60
|
-
return n(), l("div", R, [
|
|
61
|
-
e("header", j, [
|
|
62
|
-
e("h3", z, i(o.entry.name), 1),
|
|
63
|
-
e("span", K, i(o.entry.version), 1),
|
|
64
|
-
o.entry.description ? (n(), l("p", O, i(o.entry.description), 1)) : _("", !0)
|
|
65
|
-
]),
|
|
66
|
-
e("div", Y, [
|
|
67
|
-
e("section", G, [
|
|
68
|
-
t[0] || (t[0] = e("h4", { class: "detail__label fm-typo-en-body-sm-600 text-portal-text-muted" }, "Preview", -1)),
|
|
69
|
-
o.previewError ? (n(), l("p", H, i(o.previewError), 1)) : p.value ? (n(), l("iframe", {
|
|
70
|
-
key: o.entry.name,
|
|
71
|
-
class: "detail__frame",
|
|
72
|
-
title: "module preview",
|
|
73
|
-
sandbox: "allow-scripts",
|
|
74
|
-
srcdoc: p.value
|
|
75
|
-
}, null, 8, Q)) : (n(), l("p", J, "Loading preview…")),
|
|
76
|
-
t[1] || (t[1] = e("p", { class: "detail__hint fm-typo-en-body-sm-400 text-portal-text-muted" }, " Stand-in brand colours. Your business's own palette applies in the workspace preview. ", -1))
|
|
77
|
-
]),
|
|
78
|
-
e("div", U, [
|
|
79
|
-
e("section", W, [
|
|
80
|
-
t[6] || (t[6] = e("h4", { class: "detail__label fm-typo-en-body-sm-600 text-portal-text-muted" }, "Details", -1)),
|
|
81
|
-
e("dl", X, [
|
|
82
|
-
t[2] || (t[2] = e("dt", null, "Id", -1)),
|
|
83
|
-
e("dd", null, i(o.entry.id), 1),
|
|
84
|
-
t[3] || (t[3] = e("dt", null, "Slot", -1)),
|
|
85
|
-
e("dd", null, i(o.entry.slot ?? "—"), 1),
|
|
86
|
-
t[4] || (t[4] = e("dt", null, "Data shape", -1)),
|
|
87
|
-
e("dd", null, i(o.entry.dataShape ?? "—"), 1),
|
|
88
|
-
t[5] || (t[5] = e("dt", null, "Type", -1)),
|
|
89
|
-
e("dd", null, i(o.entry.category), 1),
|
|
90
|
-
(y = o.entry.labels) != null && y.length ? (n(), l("dt", Z, "Labels")) : _("", !0),
|
|
91
|
-
(D = o.entry.labels) != null && D.length ? (n(), l("dd", ee, i(o.entry.labels.join(", ")), 1)) : _("", !0)
|
|
92
|
-
])
|
|
93
|
-
]),
|
|
94
|
-
e("section", te, [
|
|
95
|
-
t[7] || (t[7] = e("h4", { class: "detail__label fm-typo-en-body-sm-600 text-portal-text-muted" }, "Props", -1)),
|
|
96
|
-
($ = o.entry.props) != null && $.length ? (n(), l("ul", ne, [
|
|
97
|
-
(n(!0), l(I, null, S(o.entry.props, (h) => (n(), l("li", {
|
|
98
|
-
key: h.name
|
|
99
|
-
}, [
|
|
100
|
-
e("code", null, i(h.name), 1),
|
|
101
|
-
h.required ? _("", !0) : (n(), l("span", se, "optional"))
|
|
102
|
-
]))), 128))
|
|
103
|
-
])) : (n(), l("p", oe, " This module declares no props interface, so it can only be offered as a like-for-like swap. "))
|
|
104
|
-
]),
|
|
105
|
-
e("section", le, [
|
|
106
|
-
t[8] || (t[8] = e("h4", { class: "detail__label fm-typo-en-body-sm-600 text-portal-text-muted" }, "Ask the agent for it", -1)),
|
|
107
|
-
t[9] || (t[9] = e("p", { class: "detail__hint fm-typo-en-body-sm-400 text-portal-text-muted" }, " Paste this into a workspace chat. The agent copies the module into your app's own code. ", -1)),
|
|
108
|
-
e("textarea", {
|
|
109
|
-
class: "detail__prompt",
|
|
110
|
-
readonly: "",
|
|
111
|
-
value: c.value
|
|
112
|
-
}, null, 8, ae),
|
|
113
|
-
k(f, {
|
|
114
|
-
class: "detail__copy",
|
|
115
|
-
size: "md",
|
|
116
|
-
variant: s.value ? "secondary" : "primary",
|
|
117
|
-
icon: s.value ? "check" : "content_copy",
|
|
118
|
-
label: s.value ? "Copied" : "Copy prompt",
|
|
119
|
-
onClick: x
|
|
120
|
-
}, null, 8, ["variant", "icon", "label"])
|
|
121
|
-
])
|
|
122
|
-
])
|
|
123
|
-
])
|
|
124
|
-
]);
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
}), re = /* @__PURE__ */ E(ie, [["__scopeId", "data-v-dc44acc5"]]), de = { class: "shell" }, me = { class: "page" }, ce = { class: "page__inner" }, ue = { class: "page__head" }, pe = {
|
|
128
|
-
key: 0,
|
|
129
|
-
class: "page__note fm-typo-en-body-md-400"
|
|
130
|
-
}, ye = /* @__PURE__ */ C({
|
|
131
|
-
__name: "ModuleDetailView",
|
|
132
|
-
setup(o) {
|
|
133
|
-
const r = N(), b = P(), s = F(), m = u(() => String(r.params.name ?? "")), c = u(() => s.find(m.value)), p = u(() => s.entries.value === null);
|
|
134
|
-
return B(() => s.load()), (x, a) => {
|
|
135
|
-
const t = g("FmIcon"), f = g("RouterLink");
|
|
136
|
-
return n(), l("div", de, [
|
|
137
|
-
e("div", me, [
|
|
138
|
-
e("div", ce, [
|
|
139
|
-
e("header", ue, [
|
|
140
|
-
k(f, {
|
|
141
|
-
class: "page__back",
|
|
142
|
-
to: { name: "miniprogram-v2-module-center", query: d(r).query }
|
|
143
|
-
}, {
|
|
144
|
-
default: L(() => [
|
|
145
|
-
k(t, {
|
|
146
|
-
name: "arrow_back",
|
|
147
|
-
size: "sm",
|
|
148
|
-
color: "typo-secondary"
|
|
149
|
-
}),
|
|
150
|
-
a[2] || (a[2] = e("span", { class: "fm-typo-en-body-sm-600" }, "Module library", -1))
|
|
151
|
-
]),
|
|
152
|
-
_: 1
|
|
153
|
-
}, 8, ["to"])
|
|
154
|
-
]),
|
|
155
|
-
p.value ? (n(), l("p", pe, "Loading…")) : d(s).loadError.value ? (n(), v(w, {
|
|
156
|
-
key: 1,
|
|
157
|
-
icon: "error_outline",
|
|
158
|
-
tone: "error",
|
|
159
|
-
title: "Could not load the module library",
|
|
160
|
-
message: d(s).loadError.value,
|
|
161
|
-
"action-label": "Try again",
|
|
162
|
-
onAction: a[0] || (a[0] = (y) => d(s).load(!0))
|
|
163
|
-
}, null, 8, ["message"])) : d(s).unpublished.value ? (n(), v(w, {
|
|
164
|
-
key: 2,
|
|
165
|
-
icon: "widgets",
|
|
166
|
-
title: "No module library has been published yet",
|
|
167
|
-
message: "Nothing has been published for this page to show."
|
|
168
|
-
})) : c.value ? (n(), v(re, {
|
|
169
|
-
key: 4,
|
|
170
|
-
entry: c.value,
|
|
171
|
-
"preview-document": d(s).previewDocument.value,
|
|
172
|
-
"preview-error": d(s).previewError.value
|
|
173
|
-
}, null, 8, ["entry", "preview-document", "preview-error"])) : (n(), v(w, {
|
|
174
|
-
key: 3,
|
|
175
|
-
icon: "search_off",
|
|
176
|
-
title: `No module named “${m.value}”`,
|
|
177
|
-
message: "It is not in the published library. It may have been renamed, withdrawn, or never published.",
|
|
178
|
-
"action-label": "Back to the library",
|
|
179
|
-
onAction: a[1] || (a[1] = (y) => d(b).push({ name: "miniprogram-v2-module-center", query: d(r).query }))
|
|
180
|
-
}, null, 8, ["title"]))
|
|
181
|
-
])
|
|
182
|
-
])
|
|
183
|
-
]);
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
}), we = /* @__PURE__ */ E(ye, [["__scopeId", "data-v-70b1bf30"]]);
|
|
187
|
-
export {
|
|
188
|
-
we as default
|
|
189
|
-
};
|