@feedmepos/mf-miniprogram-v2 0.2.2-dev.9 → 0.2.3
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-qAELeU_7.js +1120 -0
- package/dist/AppTemplatePicker.vue_vue_type_script_setup_true_lang-CDvGnq6F.js +184 -0
- package/dist/BrandFontPicker-BZyGrK3D.js +241 -0
- package/dist/BrandKitView-CzefaEEN.js +249 -0
- package/dist/{ControlPlaneView-DGDA8EFh.js → ControlPlaneView-CqUxRaS2.js} +7717 -7289
- package/dist/{EcosystemView-Cx-3k7lB.js → EcosystemView-C-y5cPOp.js} +7 -7
- package/dist/{LegacyWorkspaceEntry-opz_kWz9.js → LegacyWorkspaceEntry-CADRpDkg.js} +2 -2
- package/dist/MobileProjectsView-obtkXdEv.js +331 -0
- package/dist/{ModuleCenterView-DEShxy_e.js → ModuleCenterView-B08oZqQw.js} +34 -34
- package/dist/{ModuleDetailView-BSndm4ov.js → ModuleDetailView-lROTkaR7.js} +49 -49
- package/dist/{PagesView-CegMd6GC.js → PagesView-DOG8RSen.js} +2 -2
- package/dist/{PlatformUnavailableView-j0_2YBKm.js → PlatformUnavailableView-C1RltAIw.js} +1 -1
- package/dist/{PortalSettingsView-DFz6FUd9.js → PortalSettingsView-BK6kRgtf.js} +7 -7
- package/dist/StatusBadge.vue_vue_type_script_setup_true_lang-CMgQ0bd_.js +30 -0
- package/dist/TemplateCenterView-niXTXw9y.js +426 -0
- package/dist/WorkspaceEntryView-DzR8DQC5.js +21 -0
- package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/adminAccess-CDxAuQ-M.js +48 -0
- package/dist/app.js +22 -11
- package/dist/{controlPlane-CoEgf9BA.js → controlPlane-DT3t_ftg.js} +11 -11
- package/dist/{index-D5qXvcfE.js → index-CIJWcl_6.js} +10 -9
- package/dist/package.json +3 -1
- package/dist/{portalContext-C4HL_0kl.js → portalContext-B2pXdNtB.js} +2 -2
- package/dist/portalNavigation-DKCfwTH8.js +28 -0
- package/dist/routes-CeuodIgg.js +95 -0
- package/dist/style.css +1 -1
- package/dist/{useBrandKit-BlKlqpo2.js → useBrandKit-CQv08nyY.js} +166 -170
- package/dist/{useModuleCatalog-CkNuZzNM.js → useModuleCatalog-B9HXHA-e.js} +3 -3
- package/package.json +3 -1
- package/dist/App-BtDqnBq4.js +0 -193
- package/dist/AppTemplatePicker-eKlQ0c54.js +0 -184
- package/dist/BrandFontPicker-CyLbp5nr.js +0 -240
- package/dist/BrandKitView-CaxS1T-W.js +0 -217
- package/dist/MobileProjectsView-DEQ6q6Si.js +0 -279
- package/dist/StatusBadge.vue_vue_type_script_setup_true_lang-Bh9Eoe_H.js +0 -26
- package/dist/WorkspaceEntryView-e2EUnq9A.js +0 -21
- package/dist/localPreference-DneUpUrQ.js +0 -34
- package/dist/portalNavigation-DOF4Ah49.js +0 -28
- package/dist/routes-Boz_WlNM.js +0 -54
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { defineComponent as w, computed as p, openBlock as a, createElementBlock as s, createStaticVNode as f, createCommentVNode as h, createElementVNode as n, Fragment as g, renderList as b, normalizeClass as x, toDisplayString as y, createVNode as v } from "vue";
|
|
2
|
+
function M(t) {
|
|
3
|
+
return t === "active" ? "success" : t === "needs_attention" ? "warning" : "neutral";
|
|
4
|
+
}
|
|
5
|
+
function Q(t) {
|
|
6
|
+
return t === "active" ? "Active" : t === "needs_attention" ? "Needs attention" : "Archived";
|
|
7
|
+
}
|
|
8
|
+
function U(t) {
|
|
9
|
+
return t === "succeeded" ? "success" : t === "failed" ? "error" : t === "queued" || t === "running" ? "info" : "neutral";
|
|
10
|
+
}
|
|
11
|
+
function W(t) {
|
|
12
|
+
switch (t) {
|
|
13
|
+
case "queued":
|
|
14
|
+
return "Queued";
|
|
15
|
+
case "running":
|
|
16
|
+
return "Running";
|
|
17
|
+
case "succeeded":
|
|
18
|
+
return "Built";
|
|
19
|
+
case "failed":
|
|
20
|
+
return "Build failed";
|
|
21
|
+
default:
|
|
22
|
+
return "No build yet";
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function G(t) {
|
|
26
|
+
switch (t) {
|
|
27
|
+
case "ready":
|
|
28
|
+
return "Ready";
|
|
29
|
+
case "provisioning":
|
|
30
|
+
return "Setting up";
|
|
31
|
+
case "failed":
|
|
32
|
+
return "Setup failed";
|
|
33
|
+
default:
|
|
34
|
+
return "Not set up";
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const S = ["preview", "published", "rolled_back"];
|
|
38
|
+
function J(t) {
|
|
39
|
+
return S.includes(t.status);
|
|
40
|
+
}
|
|
41
|
+
function K(t) {
|
|
42
|
+
return t.is_live === 1 ? "Live" : t.build_status === "queued" || t.build_status === "running" ? "Building" : t.build_status === "failed" ? "Failed" : t.build_status === "succeeded" ? "Ready" : "Draft";
|
|
43
|
+
}
|
|
44
|
+
function O(t) {
|
|
45
|
+
return t.is_live === 1 ? "primary" : t.build_status === "succeeded" ? "success" : t.build_status === "queued" || t.build_status === "running" ? "info" : t.build_status === "failed" ? "error" : "neutral";
|
|
46
|
+
}
|
|
47
|
+
const V = {
|
|
48
|
+
key: 0,
|
|
49
|
+
viewBox: "0 0 56 96",
|
|
50
|
+
class: "h-[72px] w-[42px] shrink-0 rounded-[6px] border border-portal-border-default bg-portal-bg-default",
|
|
51
|
+
"aria-hidden": "true",
|
|
52
|
+
focusable: "false"
|
|
53
|
+
}, C = {
|
|
54
|
+
key: 0,
|
|
55
|
+
fill: "currentColor",
|
|
56
|
+
class: "text-fm-color-neutral-gray-300"
|
|
57
|
+
}, A = {
|
|
58
|
+
key: 1,
|
|
59
|
+
fill: "currentColor",
|
|
60
|
+
class: "text-fm-color-neutral-gray-300"
|
|
61
|
+
}, E = {
|
|
62
|
+
key: 2,
|
|
63
|
+
fill: "currentColor",
|
|
64
|
+
class: "text-fm-color-neutral-gray-300"
|
|
65
|
+
}, B = /* @__PURE__ */ w({
|
|
66
|
+
__name: "AppTemplateThumbnail",
|
|
67
|
+
props: {
|
|
68
|
+
restaurantStyle: {}
|
|
69
|
+
},
|
|
70
|
+
setup(t) {
|
|
71
|
+
const u = t, d = p(
|
|
72
|
+
() => u.restaurantStyle === "qsr" || u.restaurantStyle === "coffee" || u.restaurantStyle === "tea"
|
|
73
|
+
);
|
|
74
|
+
return (m, i) => d.value ? (a(), s("svg", V, [
|
|
75
|
+
t.restaurantStyle === "qsr" ? (a(), s("g", C, [...i[0] || (i[0] = [
|
|
76
|
+
f('<rect x="6" y="7" width="44" height="6" rx="3"></rect><rect x="6" y="18" width="19" height="18" rx="2"></rect><rect x="31" y="18" width="19" height="18" rx="2"></rect><rect x="6" y="40" width="19" height="18" rx="2"></rect><rect x="31" y="40" width="19" height="18" rx="2"></rect><rect x="6" y="62" width="19" height="18" rx="2"></rect><rect x="31" y="62" width="19" height="18" rx="2"></rect><rect x="6" y="85" width="44" height="7" rx="3.5" class="text-fm-color-neutral-gray-400"></rect>', 8)
|
|
77
|
+
])])) : t.restaurantStyle === "coffee" ? (a(), s("g", A, [...i[1] || (i[1] = [
|
|
78
|
+
f('<rect x="6" y="7" width="44" height="30" rx="3"></rect><rect x="6" y="43" width="26" height="4" rx="2"></rect><rect x="6" y="53" width="44" height="12" rx="2"></rect><rect x="6" y="69" width="44" height="12" rx="2"></rect><rect x="6" y="87" width="18" height="4" rx="2"></rect>', 5)
|
|
79
|
+
])])) : (a(), s("g", E, [...i[2] || (i[2] = [
|
|
80
|
+
f('<rect x="6" y="7" width="44" height="5" rx="2.5"></rect><rect x="6" y="17" width="44" height="9" rx="2"></rect><rect x="6" y="28" width="9" height="4" rx="2" class="text-fm-color-neutral-gray-400"></rect><rect x="18" y="28" width="9" height="4" rx="2" class="text-fm-color-neutral-gray-400"></rect><rect x="30" y="28" width="9" height="4" rx="2" class="text-fm-color-neutral-gray-400"></rect><rect x="6" y="38" width="44" height="9" rx="2"></rect><rect x="6" y="49" width="9" height="4" rx="2" class="text-fm-color-neutral-gray-400"></rect><rect x="18" y="49" width="9" height="4" rx="2" class="text-fm-color-neutral-gray-400"></rect><rect x="6" y="59" width="44" height="9" rx="2"></rect><rect x="6" y="70" width="9" height="4" rx="2" class="text-fm-color-neutral-gray-400"></rect><rect x="18" y="70" width="9" height="4" rx="2" class="text-fm-color-neutral-gray-400"></rect><rect x="30" y="70" width="9" height="4" rx="2" class="text-fm-color-neutral-gray-400"></rect><rect x="6" y="80" width="44" height="9" rx="2"></rect>', 13)
|
|
81
|
+
])]))
|
|
82
|
+
])) : h("", !0);
|
|
83
|
+
}
|
|
84
|
+
}), L = {
|
|
85
|
+
key: 0,
|
|
86
|
+
class: "rounded-lg border border-portal-border-default bg-portal-bg-default p-16"
|
|
87
|
+
}, N = { class: "mt-12 max-w-[640px]" }, q = {
|
|
88
|
+
key: 0,
|
|
89
|
+
class: "m-0 mb-8 fm-typo-en-body-sm-600 uppercase tracking-wide text-portal-text-muted"
|
|
90
|
+
}, T = { class: "flex flex-col gap-8" }, $ = ["aria-checked", "disabled", "onClick"], D = {
|
|
91
|
+
key: 0,
|
|
92
|
+
class: "h-[6px] w-[6px] rounded-full bg-portal-bg-default"
|
|
93
|
+
}, R = { class: "min-w-0 max-w-[640px] flex-1" }, P = { class: "flex flex-wrap items-center gap-8" }, F = { class: "fm-typo-en-body-md-600 text-portal-text-primary" }, I = {
|
|
94
|
+
key: 0,
|
|
95
|
+
class: "rounded-full bg-portal-bg-canvas px-8 py-[2px] fm-typo-en-body-sm-400 text-portal-text-muted"
|
|
96
|
+
}, j = { class: "mt-4 block fm-typo-en-body-sm-400 text-portal-text-muted" }, X = /* @__PURE__ */ w({
|
|
97
|
+
__name: "AppTemplatePicker",
|
|
98
|
+
props: {
|
|
99
|
+
templates: {},
|
|
100
|
+
modelValue: {},
|
|
101
|
+
disabled: { type: Boolean }
|
|
102
|
+
},
|
|
103
|
+
emits: ["update:modelValue"],
|
|
104
|
+
setup(t, { emit: u }) {
|
|
105
|
+
const d = t, m = u, i = p(() => d.templates.length > 1), _ = p(() => {
|
|
106
|
+
const c = [], l = /* @__PURE__ */ new Map();
|
|
107
|
+
for (const e of d.templates) {
|
|
108
|
+
if (!e.industries.length) {
|
|
109
|
+
c.push(e);
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
for (const o of e.industries) {
|
|
113
|
+
const r = l.get(o) ?? [];
|
|
114
|
+
r.push(e), l.set(o, r);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return [
|
|
118
|
+
...c.length ? [{ label: null, templates: c }] : [],
|
|
119
|
+
...[...l.entries()].sort(([e], [o]) => e.localeCompare(o)).map(([e, o]) => ({ label: e, templates: o }))
|
|
120
|
+
];
|
|
121
|
+
});
|
|
122
|
+
function k(c) {
|
|
123
|
+
d.disabled || m("update:modelValue", c);
|
|
124
|
+
}
|
|
125
|
+
return (c, l) => i.value ? (a(), s("section", L, [
|
|
126
|
+
l[0] || (l[0] = n("p", { class: "m-0 fm-typo-en-body-md-600 text-portal-text-primary" }, "App template", -1)),
|
|
127
|
+
l[1] || (l[1] = n("p", { class: "m-0 mt-4 fm-typo-en-body-sm-400 text-portal-text-muted" }, " Choose how this app looks and works for your customers. This cannot be changed after setup. ", -1)),
|
|
128
|
+
n("div", N, [
|
|
129
|
+
(a(!0), s(g, null, b(_.value, (e, o) => (a(), s("div", {
|
|
130
|
+
key: e.label ?? "__general",
|
|
131
|
+
role: "radiogroup",
|
|
132
|
+
"aria-label": "App template",
|
|
133
|
+
class: x(o === 0 ? "" : "mt-16")
|
|
134
|
+
}, [
|
|
135
|
+
e.label ? (a(), s("p", q, y(e.label), 1)) : h("", !0),
|
|
136
|
+
n("div", T, [
|
|
137
|
+
(a(!0), s(g, null, b(e.templates, (r) => (a(), s("button", {
|
|
138
|
+
key: r.id,
|
|
139
|
+
type: "button",
|
|
140
|
+
role: "radio",
|
|
141
|
+
"aria-checked": t.modelValue === r.id,
|
|
142
|
+
disabled: t.disabled,
|
|
143
|
+
class: x([
|
|
144
|
+
"flex w-full cursor-pointer items-start gap-12 rounded-lg border p-12 text-left transition disabled:cursor-not-allowed disabled:opacity-60",
|
|
145
|
+
t.modelValue === r.id ? "border-fm-color-primary bg-fm-color-primary-50" : "border-fm-color-neutral-gray-200 bg-fm-color-neutral-white hover:border-fm-color-neutral-gray-300"
|
|
146
|
+
]),
|
|
147
|
+
onClick: (z) => k(r.id)
|
|
148
|
+
}, [
|
|
149
|
+
n("span", {
|
|
150
|
+
class: x([
|
|
151
|
+
"mt-[2px] flex h-16 w-16 shrink-0 items-center justify-center rounded-full border",
|
|
152
|
+
t.modelValue === r.id ? "border-fm-color-primary bg-fm-color-primary" : "border-fm-color-neutral-gray-300 bg-fm-color-neutral-white"
|
|
153
|
+
])
|
|
154
|
+
}, [
|
|
155
|
+
t.modelValue === r.id ? (a(), s("span", D)) : h("", !0)
|
|
156
|
+
], 2),
|
|
157
|
+
v(B, {
|
|
158
|
+
"restaurant-style": r.restaurantStyle
|
|
159
|
+
}, null, 8, ["restaurant-style"]),
|
|
160
|
+
n("span", R, [
|
|
161
|
+
n("span", P, [
|
|
162
|
+
n("span", F, y(r.label), 1),
|
|
163
|
+
r.default ? (a(), s("span", I, " Default ")) : h("", !0)
|
|
164
|
+
]),
|
|
165
|
+
n("span", j, y(r.description), 1)
|
|
166
|
+
])
|
|
167
|
+
], 10, $))), 128))
|
|
168
|
+
])
|
|
169
|
+
], 2))), 128))
|
|
170
|
+
])
|
|
171
|
+
])) : h("", !0);
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
export {
|
|
175
|
+
X as _,
|
|
176
|
+
O as a,
|
|
177
|
+
K as b,
|
|
178
|
+
Q as c,
|
|
179
|
+
U as d,
|
|
180
|
+
W as e,
|
|
181
|
+
G as p,
|
|
182
|
+
J as r,
|
|
183
|
+
M as s
|
|
184
|
+
};
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { defineComponent as te, ref as n, computed as F, watch as G, resolveComponent as I, openBlock as s, createElementBlock as u, withKeys as L, withModifiers as N, createElementVNode as a, toDisplayString as k, createVNode as P, withCtx as J, normalizeStyle as E, withDirectives as K, vModelText as q, Fragment as S, renderList as oe, createCommentVNode as v, unref as T, createBlock as ae, createTextVNode as W, nextTick as le } from "vue";
|
|
2
|
+
import { G as V, f as ne, b as p, l as se } from "./useBrandKit-CQv08nyY.js";
|
|
3
|
+
import { _ as re } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
+
const xe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAADbZJREFUeAHtW2lsXNUV/t4yi5cZO4mdxUlsEmiBkI2dCkJBAloQSEBaCUoKkahUCYLUqjRFbVVVqlS6qAKVlqpIVBRRlqjwg1KKQNCUJIWELEBQQkgIcZzEThzimfF4PDNv63fufTNeMuN4TSXgSMd3ljfvve9+55577nefjVwuH+BzZCY+Z/YF4M+62fg/W8YB+sRdwA9MOlkwNRNR/qmxAzpQb09OqjntgD9KA139wMcZIOWYsAwoQFHTQJxtjK1NoDY/l9Y0TDoQ4ev6SIDmuIeWuI/x2mkBvI8gt3YDrx8W9gzURYBaeh2vXhOBYlUsCF3MMIaew+EXJxwDx10b+zmxLCDwueMAPqWANx/28fhOYE/GQH0tGYobSEQBj98FgW7FqgaroT0IW1+cL3KegfdzJjodD8vqXUQMjNqmBPDGAx4efsvDu8fIYJ2JRI0Jh+PUtegci55varBEGghJlv6dSTAhttCMcmeU2Bfw8lsOeXQULaTSBr7a4Iwa9KQCTvf7WPtCP9bt9BGLW4jXGfB4haIV0A1E4yaWTzcxr54hmYQK7Xp+L+PYMAImMAMFTxKYgbQzAD0I2RXAJbB+GCHdrol/pyO4rtEZ1T1OGuD3DhRx26MZdGR8WBygLkE6BQuxOuA7SyK4dL6F82cNp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TQv2ap+dsd+um5EthwRak3zZWGEGDRdFFTgPn1OsxMVm0iK+3r9hCvtfXTeOETeRHV6if0IuFn9y8P8OWGsW/zjOkJgPZPfax+NIO1dzZRzzO5Me3jghkuaocVWn/+wMTvtptqe0SAmGYJvL5Z6QQBbw0CZYcdY4efR8Lv5GGYaNhZUYJOcET9+EIf8+swLhvzIw+yBl37dBarVzarxw1k3J7LCufsYb3dQdXzZ1sMvMqtEXMQu6oDwvdWGZTuAHsQYAFaCmErbM9kKfnDZQGa4hi3jesZD1EaNrVzuqqJK/0r62gWL2vycGHT0GPX7TPwl90s7HuMMmB7MOMlwIPBlsCHHSOV1s0LWBcsMlE7QaFlQk/xrN9dxKFYjdqhyBJ4pqCzZyvXpMubNBMzKf61MPw2c9X10I4AW7k5Z0eMISxbg1gvhbh0gMOTdu/txV0E+sDKJCbDJvyc1tGMjz39NmtahnGfgNaPR2SLIiIEXHHJQydSk/vI81JSE8s4iMjTAkQYjZJxojNlqqE+HLAwzlN16D1SUELEY/c14crFE4jhYTbhdd2spEn3saQR2M2l5LqPuZwkQC8wyk/1SBr25dFRJiZ5REKWe/mszxq5qMtF0ZPyvtaVnCIaGAH335TEmhuTVfeIxmvGVPxXyycsgTd0GnibYbypU0R04inIlgmUPCMSqyzzfF7aZysrnwZm/JsWWVh1eQxXLpr8rdiSGafj33h2M2F1ZAK1PdOTF52K7HJXUuZgFlJYOsdA6/TJZbKaGV/839Jn3L4A/Fm3/wGRTH3CBVOXMAAAAABJRU5ErkJggg==", ue = ["onKeydown"], ie = { class: "font-picker__label" }, de = ["disabled", "aria-label", "aria-expanded"], ce = ["onKeydown", "aria-label"], ve = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "font-picker__muted"
|
|
7
|
+
}, me = ["aria-pressed", "onClick"], pe = { key: 0 }, fe = { key: 1 }, Ae = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "font-picker__muted",
|
|
10
|
+
role: "status"
|
|
11
|
+
}, ge = { class: "font-picker__preview" }, be = { class: "font-picker__muted" }, ke = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "font-picker__muted",
|
|
14
|
+
role: "status"
|
|
15
|
+
}, we = {
|
|
16
|
+
key: 1,
|
|
17
|
+
class: "font-picker__muted"
|
|
18
|
+
}, ye = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "font-picker__muted"
|
|
21
|
+
}, he = /* @__PURE__ */ te({
|
|
22
|
+
__name: "BrandFontPicker",
|
|
23
|
+
props: {
|
|
24
|
+
modelValue: {},
|
|
25
|
+
label: {},
|
|
26
|
+
disabled: { type: Boolean }
|
|
27
|
+
},
|
|
28
|
+
emits: ["update:modelValue"],
|
|
29
|
+
setup(d, { emit: H }) {
|
|
30
|
+
const f = d, j = H, Y = n(), w = n(), B = n(), D = n(360), O = n(), U = n(), m = n(!1), y = n(""), l = n(""), X = n("The quick brown fox jumps over the lazy dog. 0123456789"), c = n({}), A = F(
|
|
31
|
+
() => [
|
|
32
|
+
{ name: "App default", value: "", group: "Defaults" },
|
|
33
|
+
{ name: "System font", value: "system-ui, sans-serif", group: "Defaults" },
|
|
34
|
+
...V.map((e) => ({ name: e, value: ne(e), group: "Google Fonts" }))
|
|
35
|
+
].filter((e) => e.name.toLowerCase().includes(y.value.trim().toLowerCase()))
|
|
36
|
+
), h = F(() => p(f.modelValue || "")), M = F(() => p(l.value)), R = F(
|
|
37
|
+
() => !!l.value && !V.some((e) => e === M.value) && l.value !== "system-ui, sans-serif"
|
|
38
|
+
);
|
|
39
|
+
async function C(e) {
|
|
40
|
+
if (!(!V.some((t) => t === e) || c.value[e] === "loaded")) {
|
|
41
|
+
c.value[e] = "loading";
|
|
42
|
+
try {
|
|
43
|
+
await se(e), c.value[e] = "loaded";
|
|
44
|
+
} catch {
|
|
45
|
+
c.value[e] = "error";
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
G(h, (e) => void C(e), { immediate: !0 }), G(A, (e) => {
|
|
50
|
+
m.value && e.forEach((t) => void C(t.name));
|
|
51
|
+
}), G(
|
|
52
|
+
() => f.disabled,
|
|
53
|
+
(e) => {
|
|
54
|
+
e && Z();
|
|
55
|
+
}
|
|
56
|
+
), G(() => f.modelValue, Z);
|
|
57
|
+
async function _(e) {
|
|
58
|
+
var t, r;
|
|
59
|
+
m.value = e, e && (D.value = Math.max(320, ((t = Y.value) == null ? void 0 : t.getBoundingClientRect().width) || 360), l.value = f.modelValue || "", y.value = "", m.value = !0, A.value.forEach((i) => void C(i.name)), await le(), (r = U.value) == null || r.focus());
|
|
60
|
+
}
|
|
61
|
+
function Z() {
|
|
62
|
+
var e;
|
|
63
|
+
m.value = !1, (e = B.value) == null || e.hide();
|
|
64
|
+
}
|
|
65
|
+
function z() {
|
|
66
|
+
var e;
|
|
67
|
+
Z(), (e = O.value) == null || e.focus();
|
|
68
|
+
}
|
|
69
|
+
function $() {
|
|
70
|
+
f.disabled || (j("update:modelValue", l.value.trim()), z());
|
|
71
|
+
}
|
|
72
|
+
function Q(e) {
|
|
73
|
+
var r, i;
|
|
74
|
+
const t = e.relatedTarget;
|
|
75
|
+
t && !((r = Y.value) != null && r.contains(t)) && !((i = w.value) != null && i.contains(t)) && Z();
|
|
76
|
+
}
|
|
77
|
+
function ee(e) {
|
|
78
|
+
var x, o;
|
|
79
|
+
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(e.key)) return;
|
|
80
|
+
const t = [...((x = w.value) == null ? void 0 : x.querySelectorAll("[data-font-option]")) || []];
|
|
81
|
+
if (!t.length) return;
|
|
82
|
+
e.preventDefault();
|
|
83
|
+
const r = t.indexOf(document.activeElement), i = e.key === "Home" ? 0 : e.key === "End" ? t.length - 1 : (r + (e.key === "ArrowDown" ? 1 : -1) + t.length) % t.length;
|
|
84
|
+
(o = t[i]) == null || o.focus();
|
|
85
|
+
}
|
|
86
|
+
return (e, t) => {
|
|
87
|
+
const r = I("FmIcon"), i = I("FmButton"), x = I("FmPopover");
|
|
88
|
+
return s(), u("div", {
|
|
89
|
+
ref_key: "root",
|
|
90
|
+
ref: Y,
|
|
91
|
+
class: "font-picker",
|
|
92
|
+
onFocusout: Q,
|
|
93
|
+
onKeydown: L(N(z, ["stop", "prevent"]), ["esc"])
|
|
94
|
+
}, [
|
|
95
|
+
a("span", ie, k(d.label), 1),
|
|
96
|
+
P(x, {
|
|
97
|
+
ref_key: "popover",
|
|
98
|
+
ref: B,
|
|
99
|
+
"show-popover": m.value,
|
|
100
|
+
disabled: d.disabled,
|
|
101
|
+
onPopoverChanged: _
|
|
102
|
+
}, {
|
|
103
|
+
"popover-button": J(() => [
|
|
104
|
+
a("button", {
|
|
105
|
+
ref_key: "trigger",
|
|
106
|
+
ref: O,
|
|
107
|
+
type: "button",
|
|
108
|
+
class: "font-picker__trigger",
|
|
109
|
+
disabled: d.disabled,
|
|
110
|
+
"aria-label": `${d.label} font: ${h.value}`,
|
|
111
|
+
"aria-haspopup": "dialog",
|
|
112
|
+
"aria-expanded": m.value
|
|
113
|
+
}, [
|
|
114
|
+
a("span", {
|
|
115
|
+
style: E({ fontFamily: d.modelValue || "inherit" })
|
|
116
|
+
}, k(h.value), 5),
|
|
117
|
+
P(r, {
|
|
118
|
+
name: "expand_more",
|
|
119
|
+
size: "sm"
|
|
120
|
+
})
|
|
121
|
+
], 8, de)
|
|
122
|
+
]),
|
|
123
|
+
default: J(() => [
|
|
124
|
+
a("div", {
|
|
125
|
+
ref_key: "menu",
|
|
126
|
+
ref: w,
|
|
127
|
+
class: "font-picker__menu",
|
|
128
|
+
style: E({ width: `${D.value}px` }),
|
|
129
|
+
onFocusout: Q,
|
|
130
|
+
onKeydown: L(N(z, ["stop", "prevent"]), ["esc"]),
|
|
131
|
+
role: "dialog",
|
|
132
|
+
"aria-label": `Choose ${d.label.toLowerCase()} font`
|
|
133
|
+
}, [
|
|
134
|
+
t[7] || (t[7] = a("span", { class: "font-picker__muted" }, "Fonts available", -1)),
|
|
135
|
+
K(a("input", {
|
|
136
|
+
ref_key: "search",
|
|
137
|
+
ref: U,
|
|
138
|
+
"onUpdate:modelValue": t[0] || (t[0] = (o) => y.value = o),
|
|
139
|
+
type: "search",
|
|
140
|
+
placeholder: "Search fonts",
|
|
141
|
+
"aria-label": "Search fonts",
|
|
142
|
+
class: "font-picker__input",
|
|
143
|
+
onKeydown: t[1] || (t[1] = L(N((o) => {
|
|
144
|
+
var g, b;
|
|
145
|
+
return (b = (g = w.value) == null ? void 0 : g.querySelector("[data-font-option]")) == null ? void 0 : b.focus();
|
|
146
|
+
}, ["prevent"]), ["down"]))
|
|
147
|
+
}, null, 544), [
|
|
148
|
+
[q, y.value]
|
|
149
|
+
]),
|
|
150
|
+
a("div", {
|
|
151
|
+
class: "font-picker__options",
|
|
152
|
+
onKeydown: ee
|
|
153
|
+
}, [
|
|
154
|
+
(s(!0), u(S, null, oe(A.value, (o, g) => {
|
|
155
|
+
var b;
|
|
156
|
+
return s(), u(S, {
|
|
157
|
+
key: o.name
|
|
158
|
+
}, [
|
|
159
|
+
g === 0 || ((b = A.value[g - 1]) == null ? void 0 : b.group) !== o.group ? (s(), u("p", ve, k(o.group), 1)) : v("", !0),
|
|
160
|
+
a("button", {
|
|
161
|
+
type: "button",
|
|
162
|
+
"data-font-option": "",
|
|
163
|
+
class: "font-picker__option",
|
|
164
|
+
"aria-pressed": T(p)(l.value) === T(p)(o.value),
|
|
165
|
+
onClick: (Me) => l.value = o.value
|
|
166
|
+
}, [
|
|
167
|
+
a("span", {
|
|
168
|
+
style: E({ fontFamily: o.value || "inherit" })
|
|
169
|
+
}, k(o.name), 5),
|
|
170
|
+
c.value[o.name] === "loading" ? (s(), u("small", pe, "Loading…")) : c.value[o.name] === "error" ? (s(), u("small", fe, "Preview unavailable")) : v("", !0),
|
|
171
|
+
T(p)(l.value) === T(p)(o.value) ? (s(), ae(r, {
|
|
172
|
+
key: 2,
|
|
173
|
+
name: "check",
|
|
174
|
+
size: "sm"
|
|
175
|
+
})) : v("", !0)
|
|
176
|
+
], 8, me)
|
|
177
|
+
], 64);
|
|
178
|
+
}), 128)),
|
|
179
|
+
A.value.length ? v("", !0) : (s(), u("p", Ae, "No fonts found. Try another name."))
|
|
180
|
+
], 32),
|
|
181
|
+
a("div", ge, [
|
|
182
|
+
a("label", be, [
|
|
183
|
+
W("Preview · " + k(M.value) + " ", 1),
|
|
184
|
+
K(a("textarea", {
|
|
185
|
+
"onUpdate:modelValue": t[2] || (t[2] = (o) => X.value = o),
|
|
186
|
+
rows: "2",
|
|
187
|
+
"aria-label": "Font preview text",
|
|
188
|
+
style: E({ fontFamily: l.value || "inherit" })
|
|
189
|
+
}, null, 4), [
|
|
190
|
+
[q, X.value]
|
|
191
|
+
])
|
|
192
|
+
]),
|
|
193
|
+
c.value[M.value] === "error" ? (s(), u("p", ke, [
|
|
194
|
+
t[5] || (t[5] = W(" Font preview could not load. Showing a fallback font. ", -1)),
|
|
195
|
+
a("button", {
|
|
196
|
+
type: "button",
|
|
197
|
+
class: "font-picker__retry",
|
|
198
|
+
onClick: t[3] || (t[3] = (o) => C(M.value))
|
|
199
|
+
}, "Retry")
|
|
200
|
+
])) : v("", !0),
|
|
201
|
+
a("details", null, [
|
|
202
|
+
t[6] || (t[6] = a("summary", null, "Custom font stack", -1)),
|
|
203
|
+
K(a("input", {
|
|
204
|
+
"onUpdate:modelValue": t[4] || (t[4] = (o) => l.value = o),
|
|
205
|
+
class: "font-picker__input",
|
|
206
|
+
"aria-label": "Custom font stack",
|
|
207
|
+
placeholder: "App default",
|
|
208
|
+
spellcheck: "false"
|
|
209
|
+
}, null, 512), [
|
|
210
|
+
[q, l.value]
|
|
211
|
+
])
|
|
212
|
+
]),
|
|
213
|
+
R.value ? (s(), u("p", we, "Custom fonts preview only if installed or already loaded.")) : v("", !0)
|
|
214
|
+
]),
|
|
215
|
+
a("footer", null, [
|
|
216
|
+
P(i, {
|
|
217
|
+
label: "Cancel",
|
|
218
|
+
variant: "tertiary",
|
|
219
|
+
size: "md",
|
|
220
|
+
onClick: z
|
|
221
|
+
}),
|
|
222
|
+
P(i, {
|
|
223
|
+
label: "Apply",
|
|
224
|
+
size: "md",
|
|
225
|
+
disabled: d.disabled,
|
|
226
|
+
onClick: $
|
|
227
|
+
}, null, 8, ["disabled"])
|
|
228
|
+
])
|
|
229
|
+
], 44, ce)
|
|
230
|
+
]),
|
|
231
|
+
_: 1
|
|
232
|
+
}, 8, ["show-popover", "disabled"]),
|
|
233
|
+
c.value[h.value] === "error" ? (s(), u("p", ye, " Preview unavailable; showing a fallback font. ")) : v("", !0)
|
|
234
|
+
], 40, ue);
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
}), Fe = /* @__PURE__ */ re(he, [["__scopeId", "data-v-c563c57c"]]);
|
|
238
|
+
export {
|
|
239
|
+
Fe as B,
|
|
240
|
+
xe as _
|
|
241
|
+
};
|