@feedmepos/mf-miniprogram-v2 0.2.8-dev.8 → 0.2.8
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-CulUM6bp.js → App-CI4ncIRr.js} +352 -343
- package/dist/{BrandFontPicker-VX2LAN2w.js → BrandFontPicker-Ud9cZQm1.js} +1 -1
- package/dist/BrandKitView-n5K3qyUW.js +276 -0
- package/dist/{ControlPlaneView-BrIrCpIX.js → ControlPlaneView-BPVh5gPy.js} +8940 -8478
- package/dist/{EcosystemView-CVunQHEs.js → EcosystemView-j7eC2CsA.js} +115 -93
- package/dist/{LegacyWorkspaceEntry-lEMtmdIe.js → LegacyWorkspaceEntry-CADRpDkg.js} +1 -1
- package/dist/{MobileProjectDialog-C4wvWZ95.js → MobileProjectDialog-DYlIwjzr.js} +261 -256
- package/dist/{MobileProjectsView-CZVTbgqX.js → MobileProjectsView-BFljhsY0.js} +66 -61
- package/dist/ModuleCenterView-886eyuBg.js +283 -0
- package/dist/ModuleDetailView-B1IXOpig.js +296 -0
- package/dist/{PagesView-DgfNxkGp.js → PagesView-D5uGpfrp.js} +2 -2
- package/dist/{PlatformUnavailableView-ChSD6P3O.js → PlatformUnavailableView-OHEJAztd.js} +1 -1
- package/dist/PortalSettingsView-B7NohuU5.js +123 -0
- package/dist/{TemplateCenterView-BPJSWb12.js → TemplateCenterView-BJ3MBEUa.js} +3 -3
- package/dist/{WorkspaceEntryView-C4MViyFH.js → WorkspaceEntryView-mpPpAsq4.js} +2 -2
- package/dist/app.js +15 -15
- package/dist/{controlPlane-DR5ykj4d.js → controlPlane-DuIuUbyk.js} +11 -11
- package/dist/{adminAccess-DdZ2qPdx.js → localPreference-C18SIo-s.js} +35 -35
- package/dist/package.json +1 -1
- package/dist/{portalContext-DuVkhksq.js → portalContext-BkAoYip4.js} +2 -2
- package/dist/portalNavigation-DLcC7Koh.js +43 -0
- package/dist/{routes-CK4kOaoY.js → routes-B9oMJsaM.js} +2 -4
- package/dist/style.css +1 -1
- package/dist/{useBrandKit-CKn1fm2o.js → useBrandKit-DDqx19_h.js} +265 -233
- package/dist/useModuleCatalog-CLRJw1aG.js +147 -0
- package/package.json +1 -1
- package/dist/BrandKitView-CB7kcVy2.js +0 -249
- package/dist/ModuleCenterView-D0Bv4sKT.js +0 -165
- package/dist/ModuleDetailView-Ue3oCNxk.js +0 -189
- package/dist/PortalSettingsView-DBrKVWjp.js +0 -233
- package/dist/portalNavigation-L5VwKlps.js +0 -42
- package/dist/useModuleCatalog-a4dKLnlS.js +0 -124
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { defineComponent as E, resolveComponent as g, openBlock as p, createElementBlock as v, createVNode as M, createElementVNode as x, normalizeClass as P, toDisplayString as w, createCommentVNode as b, createBlock as _, shallowReadonly as c, ref as m } from "vue";
|
|
2
|
+
import { a as C } from "./routes-B9oMJsaM.js";
|
|
3
|
+
import { c as F, e as $, f as L } from "./controlPlane-DuIuUbyk.js";
|
|
4
|
+
function R(e, t) {
|
|
5
|
+
const n = t.trim().toLowerCase();
|
|
6
|
+
return e.filter((r) => n ? [r.name, r.description ?? "", r.slot ?? "", ...r.labels ?? []].join(" ").toLowerCase().includes(n) : !0);
|
|
7
|
+
}
|
|
8
|
+
function S(e) {
|
|
9
|
+
const t = e.replace(/([a-z0-9])([A-Z])/g, "$1 $2");
|
|
10
|
+
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
11
|
+
}
|
|
12
|
+
function z(e) {
|
|
13
|
+
return e.slot ?? `__ungrouped-component:${e.name}`;
|
|
14
|
+
}
|
|
15
|
+
function U(e) {
|
|
16
|
+
const t = /* @__PURE__ */ new Map(), n = [];
|
|
17
|
+
for (const o of e) {
|
|
18
|
+
const a = o.group ?? null;
|
|
19
|
+
let l = t.get(a);
|
|
20
|
+
l || (l = /* @__PURE__ */ new Map(), t.set(a, l), n.push(a));
|
|
21
|
+
const s = z(o);
|
|
22
|
+
let d = l.get(s);
|
|
23
|
+
d || (d = {
|
|
24
|
+
key: s,
|
|
25
|
+
slot: o.slot,
|
|
26
|
+
label: o.componentLabel ?? (o.slot ? S(o.slot) : o.styleLabel ?? o.description ?? o.name),
|
|
27
|
+
styles: []
|
|
28
|
+
}, l.set(s, d)), d.styles.push(o);
|
|
29
|
+
}
|
|
30
|
+
return [...n].sort((o, a) => o === a ? 0 : o === null ? 1 : a === null ? -1 : o.localeCompare(a)).map((o) => ({ group: o, components: [...t.get(o).values()] }));
|
|
31
|
+
}
|
|
32
|
+
function A(e) {
|
|
33
|
+
const t = e.components.length, n = e.components.reduce((r, o) => r + o.styles.length, 0);
|
|
34
|
+
return `${t} component${t === 1 ? "" : "s"} · ${n} style${n === 1 ? "" : "s"}`;
|
|
35
|
+
}
|
|
36
|
+
function G(e, t) {
|
|
37
|
+
const n = /* @__PURE__ */ new Map();
|
|
38
|
+
let r = 0;
|
|
39
|
+
for (const l of e) {
|
|
40
|
+
const s = l[t];
|
|
41
|
+
s ? n.set(s, (n.get(s) ?? 0) + 1) : r += 1;
|
|
42
|
+
}
|
|
43
|
+
const o = [...n.entries()].sort((l, s) => l[0].localeCompare(s[0])).map(([l, s]) => ({ value: l, count: s }));
|
|
44
|
+
return { total: o.reduce((l, s) => l + s.count, 0), chips: o, unsetCount: r };
|
|
45
|
+
}
|
|
46
|
+
function J(e) {
|
|
47
|
+
const t = e.slot ? ` It is published to fill the ${e.slot} slot.` : "";
|
|
48
|
+
return `Use the block-swap skill. Put the library module ${e.id} on the page, replacing whatever currently fills its slot.${t} Its source is already in this workspace at src/components/library/${e.name}/. Copy that directory to src/components/blocks/${e.name}/ and point the view there — the library directory is delivered per workspace and is not committed, so a view importing from it builds in the workspace and fails the release build. Tell me which page you changed.`;
|
|
49
|
+
}
|
|
50
|
+
function K(e, t) {
|
|
51
|
+
if (!e.includes("</head>")) return e;
|
|
52
|
+
const n = JSON.stringify(t).replace(/</g, "\\u003c");
|
|
53
|
+
return e.replace("</head>", `<script>window.__FM_PREVIEW_MODULE__=${n}<\/script></head>`);
|
|
54
|
+
}
|
|
55
|
+
function T(e, t) {
|
|
56
|
+
if (!e.includes("</head>")) return e;
|
|
57
|
+
const n = JSON.stringify(t).replace(/</g, "\\u003c");
|
|
58
|
+
return e.replace("</head>", `<script>window.__FM_PREVIEW_MODULES__=${n}<\/script></head>`);
|
|
59
|
+
}
|
|
60
|
+
const B = { class: "flex min-h-0 flex-1 flex-col items-center justify-center gap-8 p-24 text-center" }, I = {
|
|
61
|
+
key: 0,
|
|
62
|
+
class: "m-0 max-w-[46ch] fm-typo-en-body-sm-400 text-portal-text-muted"
|
|
63
|
+
}, W = /* @__PURE__ */ E({
|
|
64
|
+
__name: "ModuleEmptyState",
|
|
65
|
+
props: {
|
|
66
|
+
icon: {},
|
|
67
|
+
title: {},
|
|
68
|
+
message: {},
|
|
69
|
+
actionLabel: {},
|
|
70
|
+
tone: {}
|
|
71
|
+
},
|
|
72
|
+
emits: ["action"],
|
|
73
|
+
setup(e) {
|
|
74
|
+
return (t, n) => {
|
|
75
|
+
const r = g("FmIcon"), o = g("FmButton");
|
|
76
|
+
return p(), v("div", B, [
|
|
77
|
+
M(r, {
|
|
78
|
+
name: e.icon,
|
|
79
|
+
size: "xl",
|
|
80
|
+
color: e.tone === "error" ? "typo-warning" : "neutral-gray-300"
|
|
81
|
+
}, null, 8, ["name", "color"]),
|
|
82
|
+
x("p", {
|
|
83
|
+
class: P(["m-0 fm-typo-en-body-md-600", e.tone === "error" ? "text-fm-color-typo-warning" : "text-fm-color-typo-secondary"])
|
|
84
|
+
}, w(e.title), 3),
|
|
85
|
+
e.message ? (p(), v("p", I, w(e.message), 1)) : b("", !0),
|
|
86
|
+
e.actionLabel ? (p(), _(o, {
|
|
87
|
+
key: 1,
|
|
88
|
+
size: "md",
|
|
89
|
+
variant: "secondary",
|
|
90
|
+
label: e.actionLabel,
|
|
91
|
+
onClick: n[0] || (n[0] = (a) => t.$emit("action"))
|
|
92
|
+
}, null, 8, ["label"])) : b("", !0)
|
|
93
|
+
]);
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
}), u = m(null), f = m(null), y = m(!1), k = m(null), h = m(null);
|
|
97
|
+
let i = null;
|
|
98
|
+
async function D() {
|
|
99
|
+
f.value = null, y.value = !1;
|
|
100
|
+
try {
|
|
101
|
+
const e = await F(C.componentLibraryCatalog());
|
|
102
|
+
u.value = e.components ?? [];
|
|
103
|
+
} catch (e) {
|
|
104
|
+
const t = $(e);
|
|
105
|
+
u.value = [], t.includes("no component library has been published") ? y.value = !0 : f.value = t || "Could not load the module library.";
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
async function N() {
|
|
109
|
+
h.value = null;
|
|
110
|
+
try {
|
|
111
|
+
k.value = await L(C.componentLibraryPreview());
|
|
112
|
+
} catch (e) {
|
|
113
|
+
h.value = $(e) || "Could not load the preview document.";
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function Z() {
|
|
117
|
+
function e(n = !1) {
|
|
118
|
+
return !n && (u.value !== null || i) ? i ?? Promise.resolve() : (i = Promise.all([D(), N()]).then(() => {
|
|
119
|
+
}).finally(() => {
|
|
120
|
+
i = null;
|
|
121
|
+
}), i);
|
|
122
|
+
}
|
|
123
|
+
function t(n) {
|
|
124
|
+
var r;
|
|
125
|
+
return ((r = u.value) == null ? void 0 : r.find((o) => o.name === n)) ?? null;
|
|
126
|
+
}
|
|
127
|
+
return {
|
|
128
|
+
entries: c(u),
|
|
129
|
+
loadError: c(f),
|
|
130
|
+
unpublished: c(y),
|
|
131
|
+
previewDocument: c(k),
|
|
132
|
+
previewError: c(h),
|
|
133
|
+
load: e,
|
|
134
|
+
find: t
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
export {
|
|
138
|
+
W as _,
|
|
139
|
+
A as a,
|
|
140
|
+
K as b,
|
|
141
|
+
R as f,
|
|
142
|
+
U as g,
|
|
143
|
+
T as i,
|
|
144
|
+
J as m,
|
|
145
|
+
G as s,
|
|
146
|
+
Z as u
|
|
147
|
+
};
|
package/package.json
CHANGED
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
import { defineComponent as H, ref as K, computed as z, onMounted as S, onScopeDispose as M, resolveComponent as y, openBlock as l, createElementBlock as r, createElementVNode as t, unref as a, createTextVNode as m, createBlock as _, Teleport as O, toDisplayString as p, createCommentVNode as d, createVNode as c, withCtx as Y, normalizeClass as G, normalizeStyle as j, Fragment as b, renderList as f, withDirectives as A, vModelText as I } from "vue";
|
|
2
|
-
import { _ as q, B as J } from "./BrandFontPicker-VX2LAN2w.js";
|
|
3
|
-
import { useRouter as Q, onBeforeRouteLeave as W } from "vue-router";
|
|
4
|
-
import { useDialog as X, useSnackbar as Z } from "@feedmepos/ui-library";
|
|
5
|
-
import { a as ee, C as D, t as E, F as te, u as ae, i as se } from "./useBrandKit-CKn1fm2o.js";
|
|
6
|
-
import { _ as oe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
|
-
const ne = { class: "portal-page bg-portal-bg-canvas text-portal-text-primary" }, le = { class: "portal-page-inner brand-page" }, re = { class: "portal-page-heading" }, ie = { class: "brand-help" }, de = { class: "brand-actions" }, ue = {
|
|
8
|
-
key: 0,
|
|
9
|
-
class: "brand-unsaved"
|
|
10
|
-
}, pe = {
|
|
11
|
-
key: 1,
|
|
12
|
-
class: "portal-notice"
|
|
13
|
-
}, ce = {
|
|
14
|
-
key: 2,
|
|
15
|
-
class: "portal-loading",
|
|
16
|
-
role: "status"
|
|
17
|
-
}, ve = {
|
|
18
|
-
key: 3,
|
|
19
|
-
role: "alert",
|
|
20
|
-
class: "portal-section portal-error"
|
|
21
|
-
}, me = {
|
|
22
|
-
key: 4,
|
|
23
|
-
role: "status"
|
|
24
|
-
}, be = { class: "portal-section" }, he = { class: "portal-section-head" }, ge = { class: "brand-color-grid" }, ye = ["value", "aria-label", "disabled", "onInput"], _e = { class: "brand-field-label" }, fe = ["onUpdate:modelValue", "aria-label", "aria-invalid", "disabled"], ke = {
|
|
25
|
-
key: 0,
|
|
26
|
-
class: "portal-error"
|
|
27
|
-
}, xe = { class: "brand-advanced" }, Ce = { class: "brand-role-grid" }, Be = ["value", "aria-label", "disabled", "onInput"], we = ["onUpdate:modelValue", "aria-label", "aria-invalid", "disabled"], Fe = { class: "portal-section" }, Ve = { class: "portal-section-head" }, Ke = { class: "brand-font-grid" }, Se = /* @__PURE__ */ H({
|
|
28
|
-
__name: "BrandKitView",
|
|
29
|
-
setup(Ae) {
|
|
30
|
-
const e = ae(), h = ee(), k = X(), L = Z(), x = K(!1), T = Q(), u = K(!1), C = ["primary", "secondary", "accent", "background.base", "text.primary"], $ = C.map((n) => D.find((s) => s.path === n)), P = D.filter((n) => !C.includes(n.path)), B = z(
|
|
31
|
-
() => !h.value || !e.state.loaded || e.state.loading || e.state.saving || e.hasInvalidColor.value || e.dirtyCount.value === 0
|
|
32
|
-
), g = (n) => !!(e.state.colors[n] && !se(e.state.colors[n]));
|
|
33
|
-
function w(n, s) {
|
|
34
|
-
e.state.colors[n] = s.target.value, u.value = !1;
|
|
35
|
-
}
|
|
36
|
-
function F(n) {
|
|
37
|
-
n === "colors" ? e.state.colors = { ...e.state.savedColors } : e.state.fonts = { ...e.state.savedFonts }, u.value = !1;
|
|
38
|
-
}
|
|
39
|
-
function U() {
|
|
40
|
-
k.open({
|
|
41
|
-
title: "Save the live Brand Kit?",
|
|
42
|
-
message: "Colors and fonts are shared business settings. Apps using this kit pick up the change immediately. This does not build or publish application code.",
|
|
43
|
-
dismissAway: !0,
|
|
44
|
-
primaryActions: { text: "Save Brand Kit", close: !0 },
|
|
45
|
-
secondaryActions: { text: "Cancel", close: !0 }
|
|
46
|
-
}).onPrimary(() => {
|
|
47
|
-
e.save().then(() => {
|
|
48
|
-
u.value = !0;
|
|
49
|
-
}).catch(() => {
|
|
50
|
-
u.value = !1;
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
S(() => {
|
|
55
|
-
x.value = !0, e.load();
|
|
56
|
-
});
|
|
57
|
-
function V(n) {
|
|
58
|
-
!e.dirtyCount.value && !e.state.saving || (n.preventDefault(), n.returnValue = "");
|
|
59
|
-
}
|
|
60
|
-
return S(() => window.addEventListener("beforeunload", V)), M(() => window.removeEventListener("beforeunload", V)), W((n) => e.state.saving ? !1 : e.dirtyCount.value ? (k.open({
|
|
61
|
-
title: "Discard unsaved Brand Kit changes?",
|
|
62
|
-
message: "Your live Brand Kit has not changed. Leave this page and discard the changes you have not saved?",
|
|
63
|
-
dismissAway: !0,
|
|
64
|
-
primaryActions: { text: "Discard and leave", close: !0 },
|
|
65
|
-
secondaryActions: { text: "Keep editing", close: !0 }
|
|
66
|
-
}).onPrimary(() => {
|
|
67
|
-
e.discardEdits(), T.push(n);
|
|
68
|
-
}), !1) : !0), (n, s) => {
|
|
69
|
-
const N = y("FmIcon"), v = y("FmButton"), R = y("FmCircularProgress");
|
|
70
|
-
return l(), r("div", ne, [
|
|
71
|
-
t("div", le, [
|
|
72
|
-
t("header", re, [
|
|
73
|
-
s[7] || (s[7] = t("div", null, [
|
|
74
|
-
t("p", { class: "portal-eyebrow" }, "Applies to every surface"),
|
|
75
|
-
t("h1", null, "Your Business Identity")
|
|
76
|
-
], -1)),
|
|
77
|
-
t("div", ie, [
|
|
78
|
-
s[6] || (s[6] = t("span", null, "Need help on brand kit?", -1)),
|
|
79
|
-
t("button", {
|
|
80
|
-
class: "brand-ask-remy",
|
|
81
|
-
type: "button",
|
|
82
|
-
onClick: s[0] || (s[0] = (o) => a(L).open({ message: "Coming soon" }, 3e3))
|
|
83
|
-
}, [...s[5] || (s[5] = [
|
|
84
|
-
t("img", {
|
|
85
|
-
src: q,
|
|
86
|
-
alt: "",
|
|
87
|
-
width: "20",
|
|
88
|
-
height: "20"
|
|
89
|
-
}, null, -1),
|
|
90
|
-
m(" Ask Remy ", -1)
|
|
91
|
-
])])
|
|
92
|
-
])
|
|
93
|
-
]),
|
|
94
|
-
x.value ? (l(), _(O, {
|
|
95
|
-
key: 0,
|
|
96
|
-
to: "#portal-page-actions"
|
|
97
|
-
}, [
|
|
98
|
-
t("div", de, [
|
|
99
|
-
a(e).dirtyCount.value ? (l(), r("span", ue, p(a(e).dirtyCount.value) + " unsaved", 1)) : d("", !0),
|
|
100
|
-
c(v, {
|
|
101
|
-
label: "Save",
|
|
102
|
-
disabled: B.value,
|
|
103
|
-
loading: a(e).state.saving,
|
|
104
|
-
onClick: U
|
|
105
|
-
}, {
|
|
106
|
-
default: Y(() => [
|
|
107
|
-
t("span", {
|
|
108
|
-
class: G(["brand-save-content fm-typo-en-body-lg-600", { invisible: a(e).state.saving }])
|
|
109
|
-
}, [
|
|
110
|
-
c(N, {
|
|
111
|
-
name: "save",
|
|
112
|
-
"aria-hidden": "true",
|
|
113
|
-
style: j({ color: B.value ? "#c7c7cc" : "#ffffff", fontSize: "20px", width: "20px", height: "20px", lineHeight: "20px", flex: "0 0 20px" })
|
|
114
|
-
}, null, 8, ["style"]),
|
|
115
|
-
s[8] || (s[8] = m(" Save ", -1))
|
|
116
|
-
], 2)
|
|
117
|
-
]),
|
|
118
|
-
_: 1
|
|
119
|
-
}, 8, ["disabled", "loading"])
|
|
120
|
-
])
|
|
121
|
-
])) : d("", !0),
|
|
122
|
-
a(h) ? d("", !0) : (l(), r("p", pe, " You can view this Brand Kit, but need Brand Kit management permission to save changes. ")),
|
|
123
|
-
a(e).state.loading ? (l(), r("div", ce, [
|
|
124
|
-
c(R, { size: "xl" }),
|
|
125
|
-
s[9] || (s[9] = m("Loading Brand Kit… ", -1))
|
|
126
|
-
])) : d("", !0),
|
|
127
|
-
a(e).state.error ? (l(), r("div", ve, [
|
|
128
|
-
t("p", null, p(a(e).state.error), 1),
|
|
129
|
-
a(e).state.loaded ? d("", !0) : (l(), _(v, {
|
|
130
|
-
key: 0,
|
|
131
|
-
label: "Try again",
|
|
132
|
-
variant: "secondary",
|
|
133
|
-
onClick: s[1] || (s[1] = (o) => a(e).load(!0))
|
|
134
|
-
}))
|
|
135
|
-
])) : d("", !0),
|
|
136
|
-
u.value && !a(e).dirtyCount.value && !a(e).state.error ? (l(), r("p", me, " Brand Kit saved. Apps using this kit can now pick up the changes. ")) : d("", !0),
|
|
137
|
-
a(e).state.loaded && !a(e).state.loading ? (l(), r(b, { key: 5 }, [
|
|
138
|
-
t("section", be, [
|
|
139
|
-
t("div", he, [
|
|
140
|
-
s[10] || (s[10] = t("div", null, [
|
|
141
|
-
t("h2", null, "Colors"),
|
|
142
|
-
t("p", { class: "portal-description" }, "The colors that represent your brand identity.")
|
|
143
|
-
], -1)),
|
|
144
|
-
c(v, {
|
|
145
|
-
label: "Reset unsaved colors",
|
|
146
|
-
variant: "tertiary",
|
|
147
|
-
disabled: a(e).state.saving,
|
|
148
|
-
onClick: s[2] || (s[2] = (o) => F("colors"))
|
|
149
|
-
}, null, 8, ["disabled"])
|
|
150
|
-
]),
|
|
151
|
-
t("div", ge, [
|
|
152
|
-
(l(!0), r(b, null, f(a($), (o) => (l(), r("label", {
|
|
153
|
-
key: o.path,
|
|
154
|
-
class: "brand-color-card"
|
|
155
|
-
}, [
|
|
156
|
-
t("input", {
|
|
157
|
-
type: "color",
|
|
158
|
-
value: a(E)(a(e).state.colors[o.path] ?? ""),
|
|
159
|
-
"aria-label": `${o.label} color picker`,
|
|
160
|
-
disabled: a(e).state.saving,
|
|
161
|
-
onInput: (i) => w(o.path, i)
|
|
162
|
-
}, null, 40, ye),
|
|
163
|
-
t("span", _e, p(o.path === "background.base" ? "Background" : o.path === "text.primary" ? "Text" : o.label), 1),
|
|
164
|
-
A(t("input", {
|
|
165
|
-
"onUpdate:modelValue": (i) => a(e).state.colors[o.path] = i,
|
|
166
|
-
class: "brand-value",
|
|
167
|
-
"aria-label": `${o.path} hex color`,
|
|
168
|
-
"aria-invalid": g(o.path),
|
|
169
|
-
disabled: a(e).state.saving,
|
|
170
|
-
placeholder: "App default",
|
|
171
|
-
spellcheck: "false"
|
|
172
|
-
}, null, 8, fe), [
|
|
173
|
-
[I, a(e).state.colors[o.path]]
|
|
174
|
-
]),
|
|
175
|
-
g(o.path) ? (l(), r("small", ke, "Enter a hex color")) : d("", !0)
|
|
176
|
-
]))), 128))
|
|
177
|
-
]),
|
|
178
|
-
t("details", xe, [
|
|
179
|
-
s[11] || (s[11] = t("summary", null, [
|
|
180
|
-
m("More color roles "),
|
|
181
|
-
t("span", null, "Keep control of text, surfaces and status colors")
|
|
182
|
-
], -1)),
|
|
183
|
-
s[12] || (s[12] = t("p", { class: "portal-description" }, " Each role is saved independently. Changing a brand color does not automatically replace text or status colors. ", -1)),
|
|
184
|
-
t("div", Ce, [
|
|
185
|
-
(l(!0), r(b, null, f(a(P), (o) => (l(), r("label", {
|
|
186
|
-
key: o.path
|
|
187
|
-
}, [
|
|
188
|
-
t("span", null, p(o.group) + " · " + p(o.label), 1),
|
|
189
|
-
t("div", null, [
|
|
190
|
-
t("input", {
|
|
191
|
-
type: "color",
|
|
192
|
-
value: a(E)(a(e).state.colors[o.path] ?? ""),
|
|
193
|
-
"aria-label": `${o.path} color picker`,
|
|
194
|
-
disabled: a(e).state.saving,
|
|
195
|
-
onInput: (i) => w(o.path, i)
|
|
196
|
-
}, null, 40, Be),
|
|
197
|
-
A(t("input", {
|
|
198
|
-
"onUpdate:modelValue": (i) => a(e).state.colors[o.path] = i,
|
|
199
|
-
"aria-label": `${o.path} hex color`,
|
|
200
|
-
"aria-invalid": g(o.path),
|
|
201
|
-
disabled: a(e).state.saving,
|
|
202
|
-
class: "brand-value",
|
|
203
|
-
placeholder: "App default",
|
|
204
|
-
spellcheck: "false"
|
|
205
|
-
}, null, 8, we), [
|
|
206
|
-
[I, a(e).state.colors[o.path]]
|
|
207
|
-
])
|
|
208
|
-
]),
|
|
209
|
-
t("small", null, p(o.hint), 1)
|
|
210
|
-
]))), 128))
|
|
211
|
-
])
|
|
212
|
-
])
|
|
213
|
-
]),
|
|
214
|
-
t("section", Fe, [
|
|
215
|
-
t("div", Ve, [
|
|
216
|
-
s[13] || (s[13] = t("div", null, [
|
|
217
|
-
t("h2", null, "Typeface"),
|
|
218
|
-
t("p", { class: "portal-description" }, "Fonts used in your interfaces.")
|
|
219
|
-
], -1)),
|
|
220
|
-
c(v, {
|
|
221
|
-
label: "Reset unsaved fonts",
|
|
222
|
-
variant: "tertiary",
|
|
223
|
-
disabled: a(e).state.saving,
|
|
224
|
-
onClick: s[3] || (s[3] = (o) => F("fonts"))
|
|
225
|
-
}, null, 8, ["disabled"])
|
|
226
|
-
]),
|
|
227
|
-
t("div", Ke, [
|
|
228
|
-
(l(!0), r(b, null, f(a(te), (o) => (l(), _(J, {
|
|
229
|
-
key: o.path,
|
|
230
|
-
modelValue: a(e).state.fonts[o.path],
|
|
231
|
-
"onUpdate:modelValue": [
|
|
232
|
-
(i) => a(e).state.fonts[o.path] = i,
|
|
233
|
-
s[4] || (s[4] = (i) => u.value = !1)
|
|
234
|
-
],
|
|
235
|
-
label: o.label === "Heading" ? "Headings" : o.label,
|
|
236
|
-
disabled: !a(h) || a(e).state.saving
|
|
237
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "label", "disabled"]))), 128))
|
|
238
|
-
]),
|
|
239
|
-
s[14] || (s[14] = t("p", { class: "portal-description brand-font-help" }, "Supported by Google Fonts", -1))
|
|
240
|
-
])
|
|
241
|
-
], 64)) : d("", !0)
|
|
242
|
-
])
|
|
243
|
-
]);
|
|
244
|
-
};
|
|
245
|
-
}
|
|
246
|
-
}), Pe = /* @__PURE__ */ oe(Se, [["__scopeId", "data-v-69311627"]]);
|
|
247
|
-
export {
|
|
248
|
-
Pe as default
|
|
249
|
-
};
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import { defineComponent as N, openBlock as o, createElementBlock as l, createElementVNode as s, toDisplayString as u, createCommentVNode as q, ref as V, watch as R, computed as h, onMounted as z, resolveComponent as x, createVNode as v, unref as c, Fragment as C, renderList as $, normalizeClass as D, createBlock as k, withCtx as G } from "vue";
|
|
2
|
-
import { useRoute as K, useRouter as O } from "vue-router";
|
|
3
|
-
import { _ as B } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
-
import { u as P, c as U, f as j, _ as b, t as H } from "./useModuleCatalog-a4dKLnlS.js";
|
|
5
|
-
const J = { class: "card" }, Q = { class: "card__head" }, W = { class: "card__name fm-typo-en-body-md-600 text-portal-text-primary" }, X = { class: "card__version fm-typo-en-body-sm-400 text-portal-text-muted" }, Y = { class: "card__description fm-typo-en-body-sm-400 text-portal-text-muted" }, Z = { class: "card__tags" }, ee = { class: "card__tag card__tag--tier fm-typo-en-body-sm-600" }, te = {
|
|
6
|
-
key: 0,
|
|
7
|
-
class: "card__tag card__tag--slot fm-typo-en-body-sm-400"
|
|
8
|
-
}, oe = /* @__PURE__ */ N({
|
|
9
|
-
__name: "ModuleCard",
|
|
10
|
-
props: {
|
|
11
|
-
entry: {}
|
|
12
|
-
},
|
|
13
|
-
setup(i) {
|
|
14
|
-
return (r, m) => (o(), l("article", J, [
|
|
15
|
-
s("header", Q, [
|
|
16
|
-
s("h3", W, u(i.entry.name), 1),
|
|
17
|
-
s("span", X, u(i.entry.version), 1)
|
|
18
|
-
]),
|
|
19
|
-
s("p", Y, u(i.entry.description || i.entry.id), 1),
|
|
20
|
-
s("footer", Z, [
|
|
21
|
-
s("span", ee, u(i.entry.category), 1),
|
|
22
|
-
i.entry.slot ? (o(), l("span", te, u(i.entry.slot), 1)) : q("", !0)
|
|
23
|
-
])
|
|
24
|
-
]));
|
|
25
|
-
}
|
|
26
|
-
}), ne = /* @__PURE__ */ B(oe, [["__scopeId", "data-v-2fbfd7b3"]]), se = { class: "shell" }, le = { class: "centre" }, re = { class: "centre__inner" }, ae = { class: "centre__head" }, ie = {
|
|
27
|
-
key: 0,
|
|
28
|
-
class: "centre__filters"
|
|
29
|
-
}, de = { class: "centre__facet-label fm-typo-en-body-sm-600 text-portal-text-muted" }, ce = { class: "centre__chips" }, ue = ["aria-pressed", "onClick"], me = {
|
|
30
|
-
key: 1,
|
|
31
|
-
class: "centre__note fm-typo-en-body-md-400"
|
|
32
|
-
}, _e = {
|
|
33
|
-
key: 6,
|
|
34
|
-
class: "centre__grid"
|
|
35
|
-
}, pe = /* @__PURE__ */ N({
|
|
36
|
-
__name: "ModuleCenterView",
|
|
37
|
-
setup(i) {
|
|
38
|
-
const r = P(), m = K(), L = O();
|
|
39
|
-
function g(t) {
|
|
40
|
-
return t == null ? [] : (Array.isArray(t) ? t : [t]).filter((n) => n != null);
|
|
41
|
-
}
|
|
42
|
-
const _ = V(g(m.query.q)[0] ?? ""), d = V([
|
|
43
|
-
...g(m.query.tier).map((t) => ({ kind: "tier", value: t })),
|
|
44
|
-
...g(m.query.slot).map((t) => ({ kind: "slot", value: t }))
|
|
45
|
-
]);
|
|
46
|
-
R(
|
|
47
|
-
[_, d],
|
|
48
|
-
([t, n]) => {
|
|
49
|
-
const a = { ...m.query };
|
|
50
|
-
t.trim() ? a.q = t : delete a.q;
|
|
51
|
-
const y = n.filter((e) => e.kind === "tier").map((e) => e.value), f = n.filter((e) => e.kind === "slot").map((e) => e.value);
|
|
52
|
-
y.length ? a.tier = y : delete a.tier, f.length ? a.slot = f : delete a.slot, L.replace({ query: a });
|
|
53
|
-
},
|
|
54
|
-
{ deep: !0 }
|
|
55
|
-
);
|
|
56
|
-
const S = h(() => U(r.entries.value ?? [])), M = h(() => j(r.entries.value ?? [], _.value, d.value)), A = h(() => _.value.trim().length > 0 || d.value.length > 0), w = h(() => {
|
|
57
|
-
var t;
|
|
58
|
-
return (((t = r.entries.value) == null ? void 0 : t.length) ?? 0) > 0;
|
|
59
|
-
}), E = {
|
|
60
|
-
tier: "Type",
|
|
61
|
-
slot: "Slot"
|
|
62
|
-
};
|
|
63
|
-
function F(t) {
|
|
64
|
-
return d.value.some((n) => n.kind === t.kind && n.value === t.value);
|
|
65
|
-
}
|
|
66
|
-
function I(t) {
|
|
67
|
-
d.value = H(d.value, t);
|
|
68
|
-
}
|
|
69
|
-
function T() {
|
|
70
|
-
_.value = "", d.value = [];
|
|
71
|
-
}
|
|
72
|
-
return z(() => r.load()), (t, n) => {
|
|
73
|
-
const a = x("FmButton"), y = x("FmTextField"), f = x("RouterLink");
|
|
74
|
-
return o(), l("div", se, [
|
|
75
|
-
s("div", le, [
|
|
76
|
-
s("div", re, [
|
|
77
|
-
s("header", ae, [
|
|
78
|
-
n[3] || (n[3] = s("div", null, [
|
|
79
|
-
s("h2", { class: "centre__title fm-typo-en-title-sm-600 text-portal-text-primary" }, "Module library"),
|
|
80
|
-
s("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. ")
|
|
81
|
-
], -1)),
|
|
82
|
-
v(a, {
|
|
83
|
-
size: "md",
|
|
84
|
-
variant: "tertiary",
|
|
85
|
-
icon: "refresh",
|
|
86
|
-
onClick: n[0] || (n[0] = (e) => c(r).load(!0))
|
|
87
|
-
})
|
|
88
|
-
]),
|
|
89
|
-
w.value ? (o(), l("div", ie, [
|
|
90
|
-
v(y, {
|
|
91
|
-
modelValue: _.value,
|
|
92
|
-
"onUpdate:modelValue": n[1] || (n[1] = (e) => _.value = e),
|
|
93
|
-
label: "Search",
|
|
94
|
-
placeholder: "name, slot, or label"
|
|
95
|
-
}, null, 8, ["modelValue"]),
|
|
96
|
-
(o(!0), l(C, null, $(S.value, (e) => (o(), l("div", {
|
|
97
|
-
key: e.kind,
|
|
98
|
-
class: "centre__facet"
|
|
99
|
-
}, [
|
|
100
|
-
s("span", de, u(E[e.kind]), 1),
|
|
101
|
-
s("div", ce, [
|
|
102
|
-
(o(!0), l(C, null, $(e.values, (p) => (o(), l("button", {
|
|
103
|
-
key: p,
|
|
104
|
-
type: "button",
|
|
105
|
-
class: D(["centre__chip fm-typo-en-body-sm-400", { "centre__chip--on": F({ kind: e.kind, value: p }) }]),
|
|
106
|
-
"aria-pressed": F({ kind: e.kind, value: p }),
|
|
107
|
-
onClick: (ye) => I({ kind: e.kind, value: p })
|
|
108
|
-
}, u(p), 11, ue))), 128))
|
|
109
|
-
])
|
|
110
|
-
]))), 128)),
|
|
111
|
-
A.value ? (o(), l("button", {
|
|
112
|
-
key: 0,
|
|
113
|
-
type: "button",
|
|
114
|
-
class: "centre__clear fm-typo-en-body-sm-600",
|
|
115
|
-
onClick: T
|
|
116
|
-
}, " Clear filters ")) : q("", !0)
|
|
117
|
-
])) : q("", !0),
|
|
118
|
-
c(r).entries.value === null ? (o(), l("p", me, "Loading…")) : c(r).loadError.value ? (o(), k(b, {
|
|
119
|
-
key: 2,
|
|
120
|
-
icon: "error_outline",
|
|
121
|
-
tone: "error",
|
|
122
|
-
title: "Could not load the module library",
|
|
123
|
-
message: c(r).loadError.value,
|
|
124
|
-
"action-label": "Try again",
|
|
125
|
-
onAction: n[2] || (n[2] = (e) => c(r).load(!0))
|
|
126
|
-
}, null, 8, ["message"])) : c(r).unpublished.value ? (o(), k(b, {
|
|
127
|
-
key: 3,
|
|
128
|
-
icon: "widgets",
|
|
129
|
-
title: "No module library has been published yet",
|
|
130
|
-
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."
|
|
131
|
-
})) : w.value ? M.value.length ? (o(), l("ul", _e, [
|
|
132
|
-
(o(!0), l(C, null, $(M.value, (e) => (o(), l("li", {
|
|
133
|
-
key: e.id
|
|
134
|
-
}, [
|
|
135
|
-
v(f, {
|
|
136
|
-
class: "centre__link",
|
|
137
|
-
to: { name: "miniprogram-v2-module-detail", params: { name: e.name }, query: c(m).query }
|
|
138
|
-
}, {
|
|
139
|
-
default: G(() => [
|
|
140
|
-
v(ne, { entry: e }, null, 8, ["entry"])
|
|
141
|
-
]),
|
|
142
|
-
_: 2
|
|
143
|
-
}, 1032, ["to"])
|
|
144
|
-
]))), 128))
|
|
145
|
-
])) : (o(), k(b, {
|
|
146
|
-
key: 5,
|
|
147
|
-
icon: "search_off",
|
|
148
|
-
title: "No module matches these filters",
|
|
149
|
-
"action-label": "Clear filters",
|
|
150
|
-
onAction: T
|
|
151
|
-
})) : (o(), k(b, {
|
|
152
|
-
key: 4,
|
|
153
|
-
icon: "widgets",
|
|
154
|
-
title: "The module library is empty",
|
|
155
|
-
message: "It has been published, but holds no modules. Nothing here is available to put on a page yet."
|
|
156
|
-
}))
|
|
157
|
-
])
|
|
158
|
-
])
|
|
159
|
-
]);
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
}), be = /* @__PURE__ */ B(pe, [["__scopeId", "data-v-c2239a32"]]);
|
|
163
|
-
export {
|
|
164
|
-
be as default
|
|
165
|
-
};
|