@feedmepos/mf-miniprogram-v2 0.2.8-dev.1 → 0.2.8-dev.11
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-B7Mai_6F.js → App-Ck_p8Anr.js} +261 -268
- package/dist/{BrandFontPicker-JHyoGusq.js → BrandFontPicker-VX2LAN2w.js} +1 -1
- package/dist/{BrandKitView-Dlt_ifI0.js → BrandKitView-CB7kcVy2.js} +2 -2
- package/dist/ControlPlaneView-C7qDBALE.js +27019 -0
- package/dist/{EcosystemView-Cy0N2qNK.js → EcosystemView-Bt-UdWfQ.js} +6 -6
- package/dist/MobileProjectDialog-DAYQdrCY.js +452 -0
- package/dist/MobileProjectsView-z7GucfWB.js +235 -0
- package/dist/ModuleCenterView-t8rhd419.js +283 -0
- package/dist/ModuleDetailView-C2TJToR7.js +296 -0
- package/dist/{PagesView-DQCIwpnL.js → PagesView-bXfOrylf.js} +2 -2
- package/dist/{PlatformUnavailableView-DY2ntpNw.js → PlatformUnavailableView-CkKpF-bi.js} +1 -1
- package/dist/{PortalSettingsView-Cz566Ccd.js → PortalSettingsView-D_2Gd3-Y.js} +9 -9
- package/dist/StatusBadge.vue_vue_type_script_setup_true_lang-DMm_s9ua.js +41 -0
- package/dist/TemplateCenterView-DEN51nfK.js +515 -0
- package/dist/{WorkspaceEntryView-B28ASSit.js → WorkspaceEntryView-SLqO3Mi4.js} +2 -2
- package/dist/app.js +15 -15
- package/dist/{controlPlane-sXaC6pAh.js → controlPlane-DR5ykj4d.js} +8 -8
- package/dist/localPreference-Do4VKtxT.js +61 -0
- package/dist/package.json +1 -1
- package/dist/{portalContext-DV-6uUwp.js → portalContext-BeKN8Bcx.js} +2 -2
- package/dist/portalNavigation-DDMi3QTt.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-CKn1fm2o.js} +1 -1
- 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/ControlPlaneView-CBGNMsPT.js +0 -25317
- package/dist/MobileProjectsView-CvMvePvm.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-DqZLthqh.js +0 -426
- package/dist/adminAccess-oXC0xjvK.js +0 -48
- package/dist/portalNavigation-BBORm5cp.js +0 -34
- package/dist/useModuleCatalog-Cep-pzWO.js +0 -124
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { defineComponent as L, ref as j, computed as S, h as o, withModifiers as _, onMounted as R, onScopeDispose as V, resolveComponent as I, openBlock as a, createElementBlock as n, createElementVNode as s, createTextVNode as M, toDisplayString as q, createCommentVNode as z, createBlock as D, createVNode as h, unref as k } from "vue";
|
|
2
|
+
import { useRoute as A, useRouter as T } from "vue-router";
|
|
3
|
+
import { components as $, useDialog as E } from "@feedmepos/ui-library";
|
|
4
|
+
import { a as O } from "./routes-B9oMJsaM.js";
|
|
5
|
+
import { c as U, e as Y } from "./controlPlane-DR5ykj4d.js";
|
|
6
|
+
import { u as G } from "./portalContext-BeKN8Bcx.js";
|
|
7
|
+
import { w as d } from "./portalNavigation-DDMi3QTt.js";
|
|
8
|
+
import { p as H, M as J } from "./MobileProjectDialog-DAYQdrCY.js";
|
|
9
|
+
import { _ as x } from "./StatusBadge.vue_vue_type_script_setup_true_lang-DMm_s9ua.js";
|
|
10
|
+
import { _ as K } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
11
|
+
const Q = { class: "portal-page" }, W = { class: "portal-page-inner" }, X = { class: "portal-page-heading" }, Z = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "mobile-projects__count"
|
|
14
|
+
}, ee = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "portal-error",
|
|
17
|
+
role: "alert"
|
|
18
|
+
}, te = {
|
|
19
|
+
key: 1,
|
|
20
|
+
role: "status"
|
|
21
|
+
}, oe = {
|
|
22
|
+
key: 2,
|
|
23
|
+
class: "portal-empty"
|
|
24
|
+
}, re = {
|
|
25
|
+
key: 3,
|
|
26
|
+
class: "rounded-2xl border border-portal-border-default bg-portal-bg-default",
|
|
27
|
+
"aria-label": "Mobile projects"
|
|
28
|
+
}, ae = /* @__PURE__ */ L({
|
|
29
|
+
__name: "MobileProjectsView",
|
|
30
|
+
setup(se) {
|
|
31
|
+
const { FmButton: m } = $, C = G(), r = A(), i = T(), v = E(), l = j([]), p = j(!0), c = j(""), f = new AbortController();
|
|
32
|
+
async function g() {
|
|
33
|
+
p.value = !0, c.value = "";
|
|
34
|
+
try {
|
|
35
|
+
const t = await U(O.projects(C.businessId.value), {
|
|
36
|
+
signal: f.signal
|
|
37
|
+
});
|
|
38
|
+
l.value = t.projects;
|
|
39
|
+
} catch (t) {
|
|
40
|
+
f.signal.aborted || (c.value = Y(t));
|
|
41
|
+
} finally {
|
|
42
|
+
p.value = !1;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function u(t) {
|
|
46
|
+
v.open({
|
|
47
|
+
title: t ? "Rename project" : "New Mobile project",
|
|
48
|
+
// MobileProjectDialog draws its own header (a step title, plus the
|
|
49
|
+
// template step's search box) and its own Cancel/Next/Back/Create
|
|
50
|
+
// buttons — FmDynamicDialog's default close icon is absolutely
|
|
51
|
+
// positioned in the dialog's own top-right corner regardless of what
|
|
52
|
+
// dialogComponent puts there, so left on it sits on top of the search
|
|
53
|
+
// box instead of a page area with room reserved for it (same fix as
|
|
54
|
+
// PreviewPanel.vue's openLibraryExpandDialog).
|
|
55
|
+
closeButton: !1,
|
|
56
|
+
dialogComponent: J,
|
|
57
|
+
dialogComponentProps: {
|
|
58
|
+
businessId: C.businessId.value,
|
|
59
|
+
projectId: t == null ? void 0 : t.projectId,
|
|
60
|
+
initialName: t == null ? void 0 : t.name,
|
|
61
|
+
onClose: () => v.close(),
|
|
62
|
+
onSaved: (e) => {
|
|
63
|
+
v.close(), t ? g() : i.push(d(e.projectId, "workspace", r.query, { setup: !0, ...b() }));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
function b() {
|
|
69
|
+
return typeof r.query.library == "string" ? { library: r.query.library } : {};
|
|
70
|
+
}
|
|
71
|
+
function N(t) {
|
|
72
|
+
return new Intl.DateTimeFormat(void 0, { dateStyle: "medium", timeStyle: "short" }).format(new Date(t));
|
|
73
|
+
}
|
|
74
|
+
const P = S(() => [
|
|
75
|
+
{
|
|
76
|
+
id: "project",
|
|
77
|
+
header: () => "Project",
|
|
78
|
+
cell: (t) => {
|
|
79
|
+
const e = t.row.original;
|
|
80
|
+
return o("div", { class: "flex min-w-0 flex-col gap-2" }, [
|
|
81
|
+
o("span", { class: "truncate fm-typo-en-body-md-600 text-portal-text-primary" }, e.name),
|
|
82
|
+
o(
|
|
83
|
+
"span",
|
|
84
|
+
{ class: "fm-typo-en-body-sm-400 text-portal-text-muted", title: e.projectId },
|
|
85
|
+
`…${e.projectId.slice(-6)}`
|
|
86
|
+
)
|
|
87
|
+
]);
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: "setup",
|
|
92
|
+
header: () => "Setup",
|
|
93
|
+
size: 130,
|
|
94
|
+
enableSorting: !1,
|
|
95
|
+
cell: (t) => o(
|
|
96
|
+
x,
|
|
97
|
+
{ variant: t.row.original.provisioningStatus === "failed" ? "error" : "neutral", size: "sm" },
|
|
98
|
+
() => H(t.row.original.provisioningStatus)
|
|
99
|
+
)
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
id: "live",
|
|
103
|
+
header: () => "Live",
|
|
104
|
+
size: 200,
|
|
105
|
+
enableSorting: !1,
|
|
106
|
+
// Badges only. The muted sentence this replaces ("Unpublished release
|
|
107
|
+
// available") was the one thing in the row set in prose, and prose in a 200px
|
|
108
|
+
// column wraps — which is what made the cell look crowded. The state it
|
|
109
|
+
// carried is worth keeping, so it becomes a second tag rather than going away:
|
|
110
|
+
// it is the only place in this list that shows a merchant they have work built
|
|
111
|
+
// and waiting to go live.
|
|
112
|
+
//
|
|
113
|
+
// Nothing is rendered for a project with no pending release. That is the
|
|
114
|
+
// resting state of most rows, and a tag saying so would be back to filling the
|
|
115
|
+
// column with "nothing happened".
|
|
116
|
+
cell: (t) => {
|
|
117
|
+
const e = t.row.original;
|
|
118
|
+
return o("div", { class: "flex flex-wrap items-center gap-4" }, [
|
|
119
|
+
// "Live project" in a column headed Live said the word twice, and cost the
|
|
120
|
+
// width that made the line below it wrap.
|
|
121
|
+
o(
|
|
122
|
+
x,
|
|
123
|
+
{ variant: e.isLive ? "success" : "neutral", size: "sm" },
|
|
124
|
+
() => e.isLive ? "Live" : "Not live"
|
|
125
|
+
),
|
|
126
|
+
// `=== true` rather than truthiness: the field is optional in the contract,
|
|
127
|
+
// and an absent value means the state is unknown, not that it is false.
|
|
128
|
+
// This endpoint always sends a boolean, so that is a contract-level
|
|
129
|
+
// possibility rather than one a merchant meets.
|
|
130
|
+
e.hasUnpublishedRelease === !0 ? o(
|
|
131
|
+
x,
|
|
132
|
+
{ variant: "warning", size: "sm", title: "A release is built and waiting to be published" },
|
|
133
|
+
() => "Unpublished"
|
|
134
|
+
) : null
|
|
135
|
+
]);
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
id: "updatedAt",
|
|
140
|
+
header: () => "Last edited",
|
|
141
|
+
size: 170,
|
|
142
|
+
enableSorting: !1,
|
|
143
|
+
cell: (t) => o("span", { class: "fm-typo-en-body-sm-400 text-portal-text-muted" }, N(t.row.original.updatedAt))
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
id: "actions",
|
|
147
|
+
header: () => "",
|
|
148
|
+
size: 340,
|
|
149
|
+
enableSorting: !1,
|
|
150
|
+
cell: (t) => {
|
|
151
|
+
const e = t.row.original;
|
|
152
|
+
return o("div", { class: "flex flex-wrap items-center justify-end gap-4" }, [
|
|
153
|
+
e.provisioningStatus === "ready" ? o(m, {
|
|
154
|
+
icon: "deployed_code",
|
|
155
|
+
variant: "tertiary",
|
|
156
|
+
title: "View releases",
|
|
157
|
+
onClick: _(
|
|
158
|
+
() => i.push(d(e.projectId, "releases", r.query)),
|
|
159
|
+
["stop"]
|
|
160
|
+
)
|
|
161
|
+
}) : null,
|
|
162
|
+
o(m, {
|
|
163
|
+
label: "Rename",
|
|
164
|
+
variant: "tertiary",
|
|
165
|
+
onClick: _(() => u(e), ["stop"])
|
|
166
|
+
}),
|
|
167
|
+
o(m, {
|
|
168
|
+
label: e.provisioningStatus === "ready" ? "Open editor" : "Continue setup",
|
|
169
|
+
variant: "secondary",
|
|
170
|
+
onClick: _(
|
|
171
|
+
() => i.push(d(e.projectId, "workspace", r.query, b())),
|
|
172
|
+
["stop"]
|
|
173
|
+
)
|
|
174
|
+
})
|
|
175
|
+
]);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
]), B = S(() => !p.value && l.value.length > 0);
|
|
179
|
+
return R(() => {
|
|
180
|
+
if (g(), r.query.create === "1") {
|
|
181
|
+
const { create: t, ...e } = r.query;
|
|
182
|
+
i.replace({ query: e }), u();
|
|
183
|
+
}
|
|
184
|
+
}), V(() => f.abort()), (t, e) => {
|
|
185
|
+
const y = I("FmButton"), F = I("FmTable");
|
|
186
|
+
return a(), n("div", Q, [
|
|
187
|
+
s("div", W, [
|
|
188
|
+
s("header", X, [
|
|
189
|
+
s("div", null, [
|
|
190
|
+
e[4] || (e[4] = s("p", { class: "portal-eyebrow" }, "Mobile Ordering", -1)),
|
|
191
|
+
s("h1", null, [
|
|
192
|
+
e[3] || (e[3] = M("Projects ", -1)),
|
|
193
|
+
p.value ? z("", !0) : (a(), n("span", Z, q(l.value.length), 1))
|
|
194
|
+
])
|
|
195
|
+
]),
|
|
196
|
+
B.value ? (a(), D(y, {
|
|
197
|
+
key: 0,
|
|
198
|
+
label: "New project",
|
|
199
|
+
icon: "add",
|
|
200
|
+
onClick: e[0] || (e[0] = (w) => u())
|
|
201
|
+
})) : z("", !0)
|
|
202
|
+
]),
|
|
203
|
+
c.value ? (a(), n("p", ee, [
|
|
204
|
+
M(q(c.value) + " ", 1),
|
|
205
|
+
h(y, {
|
|
206
|
+
label: "Retry",
|
|
207
|
+
variant: "tertiary",
|
|
208
|
+
onClick: g
|
|
209
|
+
})
|
|
210
|
+
])) : p.value ? (a(), n("p", te, "Loading projects…")) : l.value.length ? (a(), n("section", re, [
|
|
211
|
+
h(F, {
|
|
212
|
+
"column-defs": P.value,
|
|
213
|
+
"row-data": l.value,
|
|
214
|
+
"page-size": l.value.length,
|
|
215
|
+
"hide-footer": "",
|
|
216
|
+
"pin-header-row": "",
|
|
217
|
+
onRowClick: e[2] || (e[2] = (w) => k(i).push(k(d)(w.original.projectId, "workspace", k(r).query, b())))
|
|
218
|
+
}, null, 8, ["column-defs", "row-data", "page-size"])
|
|
219
|
+
])) : (a(), n("section", oe, [
|
|
220
|
+
e[5] || (e[5] = s("h2", null, "Your first Mobile project", -1)),
|
|
221
|
+
e[6] || (e[6] = s("p", null, "Create an app from a template to start editing.", -1)),
|
|
222
|
+
h(y, {
|
|
223
|
+
label: "New project",
|
|
224
|
+
icon: "add",
|
|
225
|
+
onClick: e[1] || (e[1] = (w) => u())
|
|
226
|
+
})
|
|
227
|
+
]))
|
|
228
|
+
])
|
|
229
|
+
]);
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
}), ge = /* @__PURE__ */ K(ae, [["__scopeId", "data-v-cd9bd585"]]);
|
|
233
|
+
export {
|
|
234
|
+
ge as default
|
|
235
|
+
};
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import { defineComponent as H, ref as S, computed as f, onMounted as W, onUnmounted as J, openBlock as s, createElementBlock as l, createElementVNode as o, toDisplayString as a, createCommentVNode as A, Fragment as k, renderList as x, normalizeStyle as X, watch as Z, resolveComponent as O, createVNode as ee, unref as i, normalizeClass as g, createBlock as w, createTextVNode as C } from "vue";
|
|
2
|
+
import { useRouter as j, useRoute as te } from "vue-router";
|
|
3
|
+
import { i as ne, u as oe, f as se, s as z, g as le, _ as M, a as re } from "./useModuleCatalog-Daw8KA--.js";
|
|
4
|
+
import { _ as K } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
|
+
const ae = { class: "row" }, ie = { class: "row__head" }, ue = { class: "row__label fm-typo-en-body-md-600 text-portal-text-primary" }, ce = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "row__count fm-typo-en-body-sm-400 text-portal-text-muted"
|
|
8
|
+
}, de = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "row__note fm-typo-en-body-sm-400 text-portal-text-muted"
|
|
11
|
+
}, _e = {
|
|
12
|
+
key: 1,
|
|
13
|
+
class: "row__cards"
|
|
14
|
+
}, pe = ["title", "srcdoc"], me = 322, ye = 267, ve = /* @__PURE__ */ H({
|
|
15
|
+
__name: "ModuleComponentRow",
|
|
16
|
+
props: {
|
|
17
|
+
component: {},
|
|
18
|
+
previewDocument: {},
|
|
19
|
+
query: {},
|
|
20
|
+
showCount: { type: Boolean, default: !0 }
|
|
21
|
+
},
|
|
22
|
+
setup(h) {
|
|
23
|
+
const y = h, D = j(), d = S([]);
|
|
24
|
+
function b(u) {
|
|
25
|
+
return u.styleLabel || u.description || u.name;
|
|
26
|
+
}
|
|
27
|
+
const N = f(() => {
|
|
28
|
+
const u = y.previewDocument;
|
|
29
|
+
return u ? y.component.styles.map((_) => ({
|
|
30
|
+
name: _.name,
|
|
31
|
+
framed: ne(u, [{ name: _.name, label: b(_) }])
|
|
32
|
+
})) : [];
|
|
33
|
+
});
|
|
34
|
+
function L(u) {
|
|
35
|
+
if (!d.value.some((r) => r && r.contentWindow === u.source)) return;
|
|
36
|
+
const _ = u.data;
|
|
37
|
+
if ((_ == null ? void 0 : _.type) !== "fm-library-preview:select" || !_.module) return;
|
|
38
|
+
const c = y.component.styles.find((r) => r.name === _.module);
|
|
39
|
+
c && D.push({ name: "miniprogram-v2-module-detail", params: { name: c.name }, query: y.query });
|
|
40
|
+
}
|
|
41
|
+
return W(() => window.addEventListener("message", L)), J(() => window.removeEventListener("message", L)), (u, _) => (s(), l("section", ae, [
|
|
42
|
+
o("header", ie, [
|
|
43
|
+
o("h3", ue, a(h.component.label), 1),
|
|
44
|
+
h.showCount ? (s(), l("span", ce, a(h.component.styles.length) + " style" + a(h.component.styles.length === 1 ? "" : "s"), 1)) : A("", !0)
|
|
45
|
+
]),
|
|
46
|
+
h.previewDocument ? (s(), l("ul", _e, [
|
|
47
|
+
(s(!0), l(k, null, x(N.value, (c) => (s(), l("li", {
|
|
48
|
+
key: c.name
|
|
49
|
+
}, [
|
|
50
|
+
o("iframe", {
|
|
51
|
+
ref_for: !0,
|
|
52
|
+
ref_key: "frameRefs",
|
|
53
|
+
ref: d,
|
|
54
|
+
class: "row__frame",
|
|
55
|
+
style: X({ width: `${me}px`, height: `${ye}px` }),
|
|
56
|
+
title: c.name,
|
|
57
|
+
sandbox: "allow-scripts",
|
|
58
|
+
srcdoc: c.framed
|
|
59
|
+
}, null, 12, pe)
|
|
60
|
+
]))), 128))
|
|
61
|
+
])) : (s(), l("p", de, "Loading previews…"))
|
|
62
|
+
]));
|
|
63
|
+
}
|
|
64
|
+
}), fe = /* @__PURE__ */ K(ve, [["__scopeId", "data-v-691f1a76"]]), he = { class: "shell" }, be = { class: "centre" }, ge = { class: "centre__inner" }, ke = { class: "centre__head" }, we = {
|
|
65
|
+
class: "centre__platforms",
|
|
66
|
+
role: "tablist",
|
|
67
|
+
"aria-label": "Platform"
|
|
68
|
+
}, Ce = ["aria-selected", "onClick"], xe = {
|
|
69
|
+
key: 0,
|
|
70
|
+
class: "centre__filters"
|
|
71
|
+
}, $e = { class: "centre__facet" }, Me = { class: "centre__chips" }, Ae = ["aria-pressed"], Le = { class: "centre__chip-count" }, qe = ["aria-pressed", "onClick"], Ee = { class: "centre__chip-count" }, Pe = ["aria-pressed"], Se = { class: "centre__chip-count" }, De = { class: "centre__facet" }, Ne = { class: "centre__chips" }, Re = ["aria-pressed"], Be = { class: "centre__chip-count" }, Te = ["aria-pressed", "onClick"], Fe = { class: "centre__chip-count" }, Ue = ["aria-pressed"], Ie = { class: "centre__chip-count" }, Ve = {
|
|
72
|
+
key: 1,
|
|
73
|
+
class: "centre__note fm-typo-en-body-md-400"
|
|
74
|
+
}, ze = {
|
|
75
|
+
key: 6,
|
|
76
|
+
class: "centre__sections"
|
|
77
|
+
}, Ge = { class: "centre__section-head" }, He = { class: "centre__section-title fm-typo-en-body-lg-600 text-portal-text-primary" }, We = { class: "centre__section-summary fm-typo-en-body-sm-400 text-portal-text-muted" }, v = "__unset", G = "Ungrouped", je = "Unset", Ke = /* @__PURE__ */ H({
|
|
78
|
+
__name: "ModuleCenterView",
|
|
79
|
+
setup(h) {
|
|
80
|
+
const y = [
|
|
81
|
+
{ id: "mobile", label: "Mobile" },
|
|
82
|
+
{ id: "tablet", label: "Tablets" },
|
|
83
|
+
{ id: "kiosk", label: "Kiosk" }
|
|
84
|
+
];
|
|
85
|
+
function D(n) {
|
|
86
|
+
return y.some((e) => e.id === n);
|
|
87
|
+
}
|
|
88
|
+
const d = oe(), b = te(), N = j();
|
|
89
|
+
function L(n) {
|
|
90
|
+
return n == null ? [] : (Array.isArray(n) ? n : [n]).filter((e) => e != null);
|
|
91
|
+
}
|
|
92
|
+
function u(n) {
|
|
93
|
+
return L(n)[0];
|
|
94
|
+
}
|
|
95
|
+
const _ = u(b.query.platform), c = S(D(_) ? _ : "mobile"), r = S(u(b.query.group) ?? null), p = S(u(b.query.page) ?? null);
|
|
96
|
+
Z(
|
|
97
|
+
[c, r, p],
|
|
98
|
+
([n, e, P]) => {
|
|
99
|
+
const m = { ...b.query };
|
|
100
|
+
n !== "mobile" ? m.platform = n : delete m.platform, e ? m.group = e : delete m.group, P ? m.page = P : delete m.page, N.replace({ query: m });
|
|
101
|
+
},
|
|
102
|
+
{ deep: !0 }
|
|
103
|
+
);
|
|
104
|
+
const R = f(() => se(d.entries.value ?? [], "")), q = f(() => z(R.value, "group")), E = f(() => z(R.value, "page")), F = f(() => {
|
|
105
|
+
let n = R.value;
|
|
106
|
+
return r.value === v ? n = n.filter((e) => !e.group) : r.value && (n = n.filter((e) => e.group === r.value)), p.value === v ? n = n.filter((e) => !e.page) : p.value && (n = n.filter((e) => e.page === p.value)), n;
|
|
107
|
+
}), Q = f(() => le(F.value)), Y = f(() => r.value !== null || p.value !== null), U = f(() => {
|
|
108
|
+
var n;
|
|
109
|
+
return (((n = d.entries.value) == null ? void 0 : n.length) ?? 0) > 0;
|
|
110
|
+
});
|
|
111
|
+
function I(n) {
|
|
112
|
+
return (e) => {
|
|
113
|
+
n.value = n.value === e ? null : e;
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
const B = I(r), T = I(p);
|
|
117
|
+
function V() {
|
|
118
|
+
r.value = null, p.value = null;
|
|
119
|
+
}
|
|
120
|
+
return W(() => d.load()), (n, e) => {
|
|
121
|
+
var m;
|
|
122
|
+
const P = O("FmButton");
|
|
123
|
+
return s(), l("div", he, [
|
|
124
|
+
o("div", be, [
|
|
125
|
+
o("div", ge, [
|
|
126
|
+
o("header", ke, [
|
|
127
|
+
e[7] || (e[7] = o("div", null, [
|
|
128
|
+
o("h2", { class: "centre__title fm-typo-en-title-sm-600 text-portal-text-primary" }, "Component Library"),
|
|
129
|
+
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. ")
|
|
130
|
+
], -1)),
|
|
131
|
+
ee(P, {
|
|
132
|
+
size: "md",
|
|
133
|
+
variant: "tertiary",
|
|
134
|
+
icon: "refresh",
|
|
135
|
+
onClick: e[0] || (e[0] = (t) => i(d).load(!0))
|
|
136
|
+
})
|
|
137
|
+
]),
|
|
138
|
+
o("nav", we, [
|
|
139
|
+
(s(), l(k, null, x(y, (t) => o("button", {
|
|
140
|
+
key: t.id,
|
|
141
|
+
type: "button",
|
|
142
|
+
role: "tab",
|
|
143
|
+
class: g(["centre__platform-tab fm-typo-en-body-md-600", { "centre__platform-tab--on": c.value === t.id }]),
|
|
144
|
+
"aria-selected": c.value === t.id,
|
|
145
|
+
onClick: ($) => c.value = t.id
|
|
146
|
+
}, a(t.label), 11, Ce)), 64))
|
|
147
|
+
]),
|
|
148
|
+
c.value !== "mobile" ? (s(), w(M, {
|
|
149
|
+
key: 0,
|
|
150
|
+
icon: "devices",
|
|
151
|
+
title: `${(m = y.find((t) => t.id === c.value)) == null ? void 0 : m.label} components are on the way`,
|
|
152
|
+
message: "We're building these for tablet and kiosk. You'll pick their styles here once they're ready.",
|
|
153
|
+
"action-label": "Browse Mobile components",
|
|
154
|
+
onAction: e[1] || (e[1] = (t) => c.value = "mobile")
|
|
155
|
+
}, null, 8, ["title"])) : (s(), l(k, { key: 1 }, [
|
|
156
|
+
U.value ? (s(), l("div", xe, [
|
|
157
|
+
o("div", $e, [
|
|
158
|
+
e[9] || (e[9] = o("span", { class: "centre__facet-label fm-typo-en-body-sm-600 text-portal-text-muted" }, "Category", -1)),
|
|
159
|
+
o("div", Me, [
|
|
160
|
+
o("button", {
|
|
161
|
+
type: "button",
|
|
162
|
+
class: g(["centre__chip centre__chip--pill", { "centre__chip--on": r.value === null }]),
|
|
163
|
+
"aria-pressed": r.value === null,
|
|
164
|
+
onClick: e[2] || (e[2] = (t) => i(B)(null))
|
|
165
|
+
}, [
|
|
166
|
+
e[8] || (e[8] = C(" All ", -1)),
|
|
167
|
+
o("span", Le, a(q.value.total), 1)
|
|
168
|
+
], 10, Ae),
|
|
169
|
+
(s(!0), l(k, null, x(q.value.chips, (t) => (s(), l("button", {
|
|
170
|
+
key: t.value,
|
|
171
|
+
type: "button",
|
|
172
|
+
class: g(["centre__chip centre__chip--pill", { "centre__chip--on": r.value === t.value }]),
|
|
173
|
+
"aria-pressed": r.value === t.value,
|
|
174
|
+
onClick: ($) => i(B)(t.value)
|
|
175
|
+
}, [
|
|
176
|
+
C(a(t.value) + " ", 1),
|
|
177
|
+
o("span", Ee, a(t.count), 1)
|
|
178
|
+
], 10, qe))), 128)),
|
|
179
|
+
q.value.unsetCount ? (s(), l("button", {
|
|
180
|
+
key: 0,
|
|
181
|
+
type: "button",
|
|
182
|
+
class: g(["centre__chip centre__chip--pill centre__chip--dashed", { "centre__chip--on": r.value === v }]),
|
|
183
|
+
"aria-pressed": r.value === v,
|
|
184
|
+
onClick: e[3] || (e[3] = (t) => i(B)(v))
|
|
185
|
+
}, [
|
|
186
|
+
C(a(G) + " "),
|
|
187
|
+
o("span", Se, a(q.value.unsetCount), 1)
|
|
188
|
+
], 10, Pe)) : A("", !0)
|
|
189
|
+
])
|
|
190
|
+
]),
|
|
191
|
+
o("div", De, [
|
|
192
|
+
e[11] || (e[11] = o("span", { class: "centre__facet-label fm-typo-en-body-sm-600 text-portal-text-muted" }, "Page", -1)),
|
|
193
|
+
o("div", Ne, [
|
|
194
|
+
o("button", {
|
|
195
|
+
type: "button",
|
|
196
|
+
class: g(["centre__chip centre__chip--pill", { "centre__chip--on": p.value === null }]),
|
|
197
|
+
"aria-pressed": p.value === null,
|
|
198
|
+
onClick: e[4] || (e[4] = (t) => i(T)(null))
|
|
199
|
+
}, [
|
|
200
|
+
e[10] || (e[10] = C(" All pages ", -1)),
|
|
201
|
+
o("span", Be, a(E.value.total), 1)
|
|
202
|
+
], 10, Re),
|
|
203
|
+
(s(!0), l(k, null, x(E.value.chips, (t) => (s(), l("button", {
|
|
204
|
+
key: t.value,
|
|
205
|
+
type: "button",
|
|
206
|
+
class: g(["centre__chip centre__chip--pill", { "centre__chip--on": p.value === t.value }]),
|
|
207
|
+
"aria-pressed": p.value === t.value,
|
|
208
|
+
onClick: ($) => i(T)(t.value)
|
|
209
|
+
}, [
|
|
210
|
+
C(a(t.value) + " ", 1),
|
|
211
|
+
o("span", Fe, a(t.count), 1)
|
|
212
|
+
], 10, Te))), 128)),
|
|
213
|
+
E.value.unsetCount ? (s(), l("button", {
|
|
214
|
+
key: 0,
|
|
215
|
+
type: "button",
|
|
216
|
+
class: g(["centre__chip centre__chip--pill centre__chip--dashed", { "centre__chip--on": p.value === v }]),
|
|
217
|
+
"aria-pressed": p.value === v,
|
|
218
|
+
onClick: e[5] || (e[5] = (t) => i(T)(v))
|
|
219
|
+
}, [
|
|
220
|
+
C(a(je) + " "),
|
|
221
|
+
o("span", Ie, a(E.value.unsetCount), 1)
|
|
222
|
+
], 10, Ue)) : A("", !0)
|
|
223
|
+
])
|
|
224
|
+
]),
|
|
225
|
+
Y.value ? (s(), l("button", {
|
|
226
|
+
key: 0,
|
|
227
|
+
type: "button",
|
|
228
|
+
class: "centre__clear fm-typo-en-body-sm-600",
|
|
229
|
+
onClick: V
|
|
230
|
+
}, " Clear filters ")) : A("", !0)
|
|
231
|
+
])) : A("", !0),
|
|
232
|
+
i(d).entries.value === null ? (s(), l("p", Ve, "Loading…")) : i(d).loadError.value ? (s(), w(M, {
|
|
233
|
+
key: 2,
|
|
234
|
+
icon: "error_outline",
|
|
235
|
+
tone: "error",
|
|
236
|
+
title: "Could not load the component library",
|
|
237
|
+
message: i(d).loadError.value,
|
|
238
|
+
"action-label": "Try again",
|
|
239
|
+
onAction: e[6] || (e[6] = (t) => i(d).load(!0))
|
|
240
|
+
}, null, 8, ["message"])) : i(d).unpublished.value ? (s(), w(M, {
|
|
241
|
+
key: 3,
|
|
242
|
+
icon: "widgets",
|
|
243
|
+
title: "No component library has been published yet",
|
|
244
|
+
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."
|
|
245
|
+
})) : U.value ? F.value.length ? (s(), l("div", ze, [
|
|
246
|
+
(s(!0), l(k, null, x(Q.value, (t) => (s(), l("section", {
|
|
247
|
+
key: t.group ?? "__ungrouped",
|
|
248
|
+
class: "centre__section"
|
|
249
|
+
}, [
|
|
250
|
+
o("header", Ge, [
|
|
251
|
+
o("h3", He, a(t.group ?? G), 1),
|
|
252
|
+
o("span", We, a(i(re)(t)), 1)
|
|
253
|
+
]),
|
|
254
|
+
(s(!0), l(k, null, x(t.components, ($) => (s(), w(fe, {
|
|
255
|
+
key: $.key,
|
|
256
|
+
component: $,
|
|
257
|
+
"preview-document": i(d).previewDocument.value,
|
|
258
|
+
query: i(b).query,
|
|
259
|
+
"show-count": t.components.length > 1
|
|
260
|
+
}, null, 8, ["component", "preview-document", "query", "show-count"]))), 128))
|
|
261
|
+
]))), 128))
|
|
262
|
+
])) : (s(), w(M, {
|
|
263
|
+
key: 5,
|
|
264
|
+
icon: "search_off",
|
|
265
|
+
title: "No module matches these filters",
|
|
266
|
+
"action-label": "Clear filters",
|
|
267
|
+
onAction: V
|
|
268
|
+
})) : (s(), w(M, {
|
|
269
|
+
key: 4,
|
|
270
|
+
icon: "widgets",
|
|
271
|
+
title: "The component library is empty",
|
|
272
|
+
message: "It has been published, but holds no modules. Nothing here is available to put on a page yet."
|
|
273
|
+
}))
|
|
274
|
+
], 64))
|
|
275
|
+
])
|
|
276
|
+
])
|
|
277
|
+
]);
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
}), Ze = /* @__PURE__ */ K(Ke, [["__scopeId", "data-v-cc7f6ab8"]]);
|
|
281
|
+
export {
|
|
282
|
+
Ze as default
|
|
283
|
+
};
|