@feedmepos/mf-miniprogram-v2 0.2.2-dev.9 → 0.2.2
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-KzUdmcX4.js +214 -0
- package/dist/{AppTemplatePicker-eKlQ0c54.js → AppTemplatePicker-CNJ6kIJk.js} +158 -105
- package/dist/BrandFontPicker-Bd30BHsN.js +241 -0
- package/dist/BrandKitView-z2Pu8wAQ.js +249 -0
- package/dist/{ControlPlaneView-DGDA8EFh.js → ControlPlaneView-Bd_Fl_3b.js} +7751 -7323
- package/dist/{EcosystemView-Cx-3k7lB.js → EcosystemView-BDXgMQN_.js} +7 -7
- package/dist/{LegacyWorkspaceEntry-opz_kWz9.js → LegacyWorkspaceEntry-CADRpDkg.js} +2 -2
- package/dist/MobileProjectsView-CvCPtFAF.js +313 -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/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 +2 -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/templatePickerFlag-CosY_15R.js +13 -0
- package/dist/{useBrandKit-BlKlqpo2.js → useBrandKit-CKN2zLC8.js} +3 -3
- package/dist/{useModuleCatalog-CkNuZzNM.js → useModuleCatalog-B9HXHA-e.js} +3 -3
- package/package.json +2 -1
- package/dist/App-BtDqnBq4.js +0 -193
- 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,13 @@
|
|
|
1
|
+
const t = "templatePicker";
|
|
2
|
+
function a() {
|
|
3
|
+
if (typeof window > "u") return !1;
|
|
4
|
+
try {
|
|
5
|
+
const e = new URLSearchParams(window.location.search).get(t);
|
|
6
|
+
return e !== null && e !== "0" && e !== "false";
|
|
7
|
+
} catch {
|
|
8
|
+
return !1;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
a as t
|
|
13
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as jt, e as xt } from "./index-
|
|
1
|
+
import { a as jt, e as xt } from "./index-CIJWcl_6.js";
|
|
2
2
|
import { computed as nt, reactive as Et } from "vue";
|
|
3
|
-
import { h as x, e as ot } from "./controlPlane-
|
|
3
|
+
import { h as x, e as ot } from "./controlPlane-DT3t_ftg.js";
|
|
4
4
|
import { useCoreStore as At } from "@feedmepos/mf-common";
|
|
5
5
|
const it = [
|
|
6
6
|
"Inter",
|
|
@@ -796,7 +796,7 @@ function ye(e) {
|
|
|
796
796
|
return `#${s}${s}${r}${r}${n}${n}`;
|
|
797
797
|
}
|
|
798
798
|
function oe() {
|
|
799
|
-
return jt(xt("fmmf:
|
|
799
|
+
return jt(xt("fmmf:prod")).apiOrigin;
|
|
800
800
|
}
|
|
801
801
|
function st(e) {
|
|
802
802
|
return `${oe()}/metadata/${e}/brandkit`;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as x, resolveComponent as p, openBlock as u, createElementBlock as h, createVNode as E, createElementVNode as P, normalizeClass as F, toDisplayString as v, createCommentVNode as g, createBlock as L, shallowReadonly as r, ref as s } from "vue";
|
|
2
|
-
import { a as w } from "./routes-
|
|
3
|
-
import { c as M, e as y, m as $ } from "./controlPlane-
|
|
2
|
+
import { a as w } from "./routes-CeuodIgg.js";
|
|
3
|
+
import { c as M, e as y, m as $ } from "./controlPlane-DT3t_ftg.js";
|
|
4
4
|
const I = { class: "flex min-h-0 flex-1 flex-col items-center justify-center gap-8 p-24 text-center" }, T = {
|
|
5
5
|
key: 0,
|
|
6
|
-
class: "m-0 max-w-[46ch] fm-typo-en-body-sm-400 text-
|
|
6
|
+
class: "m-0 max-w-[46ch] fm-typo-en-body-sm-400 text-portal-text-muted"
|
|
7
7
|
}, j = /* @__PURE__ */ x({
|
|
8
8
|
__name: "ModuleEmptyState",
|
|
9
9
|
props: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@feedmepos/mf-miniprogram-v2",
|
|
3
|
-
"version": "0.2.2
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"vue-router": "^4.6.4"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
+
"@tanstack/vue-table": "8.21.3",
|
|
55
56
|
"@tsconfig/node20": "^20.1.6",
|
|
56
57
|
"@types/node": "^24.13.2",
|
|
57
58
|
"@vitejs/plugin-vue": "^5.0.4",
|
package/dist/App-BtDqnBq4.js
DELETED
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import { defineComponent as j, computed as y, ref as P, onMounted as z, onBeforeUnmount as K, resolveComponent as f, openBlock as s, createElementBlock as i, Fragment as S, createElementVNode as a, normalizeClass as M, createVNode as t, renderList as h, unref as l, withCtx as u, toDisplayString as d, createCommentVNode as N, createBlock as V } from "vue";
|
|
2
|
-
import { useRoute as A, RouterView as O } from "vue-router";
|
|
3
|
-
import { useCoreStore as $ } from "@feedmepos/mf-common";
|
|
4
|
-
import { P as c } from "./PortalIcon-DO0VrIoY.js";
|
|
5
|
-
import { p as D } from "./portalContext-C4HL_0kl.js";
|
|
6
|
-
import { p as v } from "./portalNavigation-DOF4Ah49.js";
|
|
7
|
-
import { r as w, w as q } from "./localPreference-DneUpUrQ.js";
|
|
8
|
-
import { _ as G } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
|
-
const Q = {
|
|
10
|
-
class: "portal-sidebar",
|
|
11
|
-
"aria-label": "Mini Program navigation"
|
|
12
|
-
}, U = ["aria-expanded", "aria-label"], H = {
|
|
13
|
-
id: "miniprogram-navigation",
|
|
14
|
-
class: "portal-nav"
|
|
15
|
-
}, J = { class: "portal-nav-label" }, W = { class: "portal-nav-label" }, X = { class: "portal-main" }, Y = {
|
|
16
|
-
key: 0,
|
|
17
|
-
class: "portal-breadcrumb",
|
|
18
|
-
"aria-label": "Breadcrumb"
|
|
19
|
-
}, Z = {
|
|
20
|
-
id: "miniprogram-content",
|
|
21
|
-
class: "portal-content",
|
|
22
|
-
tabindex: "-1"
|
|
23
|
-
}, ee = {
|
|
24
|
-
key: 0,
|
|
25
|
-
class: "portal-empty"
|
|
26
|
-
}, ae = {
|
|
27
|
-
key: 1,
|
|
28
|
-
class: "portal-loading",
|
|
29
|
-
role: "status"
|
|
30
|
-
}, le = {
|
|
31
|
-
key: 2,
|
|
32
|
-
class: "portal-empty",
|
|
33
|
-
role: "alert"
|
|
34
|
-
}, oe = /* @__PURE__ */ j({
|
|
35
|
-
__name: "App",
|
|
36
|
-
setup(te) {
|
|
37
|
-
const r = A(), k = $(), n = D(), p = y(() => r.name === "miniprogram-v2-project"), b = P(
|
|
38
|
-
w(
|
|
39
|
-
"mpv2:portal-collapsed",
|
|
40
|
-
typeof window < "u" && window.matchMedia("(max-width: 1000px)").matches
|
|
41
|
-
)
|
|
42
|
-
), g = P(w("mpv2:editor-collapsed", !0)), _ = y(() => p.value ? g.value : b.value), B = y(
|
|
43
|
-
() => {
|
|
44
|
-
var C;
|
|
45
|
-
return p.value ? (C = n.context.value) == null ? void 0 : C.project.name : String(r.meta.title ?? "Ecosystem");
|
|
46
|
-
}
|
|
47
|
-
), F = [
|
|
48
|
-
{ name: "miniprogram-v2-ecosystem", label: "Ecosystem", icon: "ecosystem" },
|
|
49
|
-
{ name: "miniprogram-v2-brand-kit", label: "Brand Kit", icon: "brand" },
|
|
50
|
-
{ name: "miniprogram-v2-pages", label: "Pages", icon: "pages" }
|
|
51
|
-
], I = y(() => ({ name: "miniprogram-v2-mobile-projects", query: v(r.query) }));
|
|
52
|
-
let x = !1;
|
|
53
|
-
z(() => {
|
|
54
|
-
x = k.hideSidebar.value, k.hideSidebar.value = !0;
|
|
55
|
-
}), K(() => {
|
|
56
|
-
k.hideSidebar.value = x;
|
|
57
|
-
});
|
|
58
|
-
function L() {
|
|
59
|
-
p.value ? (g.value = !g.value, q("mpv2:editor-collapsed", g.value)) : (b.value = !b.value, q("mpv2:portal-collapsed", b.value));
|
|
60
|
-
}
|
|
61
|
-
return (C, e) => {
|
|
62
|
-
const m = f("RouterLink"), R = f("FmIcon"), E = f("FmCircularProgress"), T = f("FmButton");
|
|
63
|
-
return s(), i(S, null, [
|
|
64
|
-
e[11] || (e[11] = a("link", {
|
|
65
|
-
href: "https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,400,0..1,0",
|
|
66
|
-
rel: "stylesheet"
|
|
67
|
-
}, null, -1)),
|
|
68
|
-
a("div", {
|
|
69
|
-
class: M(["mpv2-app portal-shell", { "portal-shell--collapsed": _.value }])
|
|
70
|
-
}, [
|
|
71
|
-
e[10] || (e[10] = a("a", {
|
|
72
|
-
class: "portal-skip",
|
|
73
|
-
href: "#miniprogram-content"
|
|
74
|
-
}, "Skip to content", -1)),
|
|
75
|
-
a("aside", Q, [
|
|
76
|
-
a("button", {
|
|
77
|
-
class: "portal-sidebar-toggle",
|
|
78
|
-
type: "button",
|
|
79
|
-
"aria-expanded": !_.value,
|
|
80
|
-
"aria-controls": "miniprogram-navigation",
|
|
81
|
-
"aria-label": _.value ? "Expand navigation" : "Collapse navigation",
|
|
82
|
-
onClick: L
|
|
83
|
-
}, [
|
|
84
|
-
t(c, { name: "collapse" }),
|
|
85
|
-
e[0] || (e[0] = a("span", { class: "portal-nav-label" }, "Mini Program", -1))
|
|
86
|
-
], 8, U),
|
|
87
|
-
a("nav", H, [
|
|
88
|
-
(s(), i(S, null, h(F, (o) => t(m, {
|
|
89
|
-
key: o.name,
|
|
90
|
-
to: { name: o.name, query: l(v)(l(r).query) },
|
|
91
|
-
class: "portal-nav-item",
|
|
92
|
-
title: o.label,
|
|
93
|
-
"aria-label": o.label,
|
|
94
|
-
"aria-current": l(r).name === o.name ? "page" : void 0
|
|
95
|
-
}, {
|
|
96
|
-
default: u(() => [
|
|
97
|
-
t(c, {
|
|
98
|
-
name: o.icon
|
|
99
|
-
}, null, 8, ["name"]),
|
|
100
|
-
a("span", J, d(o.label), 1)
|
|
101
|
-
]),
|
|
102
|
-
_: 2
|
|
103
|
-
}, 1032, ["to", "title", "aria-label", "aria-current"])), 64)),
|
|
104
|
-
e[3] || (e[3] = a("p", { class: "portal-nav-caption" }, "Platforms", -1)),
|
|
105
|
-
t(m, {
|
|
106
|
-
to: I.value,
|
|
107
|
-
class: M(["portal-nav-item", { "router-link-active": p.value }]),
|
|
108
|
-
title: "Mobile Ordering",
|
|
109
|
-
"aria-label": "Mobile Ordering",
|
|
110
|
-
"aria-current": p.value ? "page" : void 0
|
|
111
|
-
}, {
|
|
112
|
-
default: u(() => [
|
|
113
|
-
t(c, { name: "mobile" }),
|
|
114
|
-
e[1] || (e[1] = a("span", { class: "portal-nav-label" }, "Mobile Ordering", -1))
|
|
115
|
-
]),
|
|
116
|
-
_: 1
|
|
117
|
-
}, 8, ["to", "class", "aria-current"]),
|
|
118
|
-
(s(), i(S, null, h(["tablet", "kiosk"], (o) => t(m, {
|
|
119
|
-
key: o,
|
|
120
|
-
to: { name: `miniprogram-v2-${o}`, query: l(v)(l(r).query) },
|
|
121
|
-
class: "portal-nav-item",
|
|
122
|
-
title: o === "tablet" ? "Tablet" : "Kiosk",
|
|
123
|
-
"aria-label": o === "tablet" ? "Tablet" : "Kiosk"
|
|
124
|
-
}, {
|
|
125
|
-
default: u(() => [
|
|
126
|
-
t(c, { name: o }, null, 8, ["name"]),
|
|
127
|
-
a("span", W, d(o === "tablet" ? "Tablet" : "Kiosk"), 1)
|
|
128
|
-
]),
|
|
129
|
-
_: 2
|
|
130
|
-
}, 1032, ["to", "title", "aria-label"])), 64)),
|
|
131
|
-
e[4] || (e[4] = a("div", { class: "portal-nav-divider" }, null, -1)),
|
|
132
|
-
t(m, {
|
|
133
|
-
to: { name: "miniprogram-v2-module-center", query: l(v)(l(r).query) },
|
|
134
|
-
class: M(["portal-nav-item", { "router-link-active": l(r).name === "miniprogram-v2-module-detail" }]),
|
|
135
|
-
title: "Module library",
|
|
136
|
-
"aria-label": "Module library"
|
|
137
|
-
}, {
|
|
138
|
-
default: u(() => [
|
|
139
|
-
t(R, {
|
|
140
|
-
name: "widgets",
|
|
141
|
-
size: "md"
|
|
142
|
-
}),
|
|
143
|
-
e[2] || (e[2] = a("span", { class: "portal-nav-label" }, "Module library", -1))
|
|
144
|
-
]),
|
|
145
|
-
_: 1
|
|
146
|
-
}, 8, ["to", "class"])
|
|
147
|
-
]),
|
|
148
|
-
t(m, {
|
|
149
|
-
to: { name: "miniprogram-v2-settings", query: l(v)(l(r).query) },
|
|
150
|
-
class: "portal-nav-item portal-settings-link",
|
|
151
|
-
title: "Settings",
|
|
152
|
-
"aria-label": "Settings"
|
|
153
|
-
}, {
|
|
154
|
-
default: u(() => [
|
|
155
|
-
t(c, { name: "settings" }),
|
|
156
|
-
e[5] || (e[5] = a("span", { class: "portal-nav-label" }, "Settings", -1))
|
|
157
|
-
]),
|
|
158
|
-
_: 1
|
|
159
|
-
}, 8, ["to"])
|
|
160
|
-
]),
|
|
161
|
-
a("div", X, [
|
|
162
|
-
p.value ? N("", !0) : (s(), i("header", Y, [
|
|
163
|
-
a("span", null, d(l(n).businessName.value), 1),
|
|
164
|
-
e[6] || (e[6] = a("span", { "aria-hidden": "true" }, "/", -1)),
|
|
165
|
-
a("span", null, d(B.value), 1)
|
|
166
|
-
])),
|
|
167
|
-
a("div", Z, [
|
|
168
|
-
l(n).businessId.value ? l(n).loading.value ? (s(), i("div", ae, [
|
|
169
|
-
t(E, { size: "xl" }),
|
|
170
|
-
e[8] || (e[8] = a("span", null, "Loading your Mini Program…", -1))
|
|
171
|
-
])) : l(n).error.value ? (s(), i("section", le, [
|
|
172
|
-
e[9] || (e[9] = a("h1", null, "Could not open this Mini Program", -1)),
|
|
173
|
-
a("p", null, d(l(n).error.value), 1),
|
|
174
|
-
t(T, {
|
|
175
|
-
label: "Try again",
|
|
176
|
-
onClick: l(n).refresh
|
|
177
|
-
}, null, 8, ["onClick"])
|
|
178
|
-
])) : (s(), V(l(O), {
|
|
179
|
-
key: `${l(n).businessId.value}:${l(r).params.projectId ?? String(l(r).name)}`
|
|
180
|
-
})) : (s(), i("section", ee, [...e[7] || (e[7] = [
|
|
181
|
-
a("h1", null, "Select a business", -1),
|
|
182
|
-
a("p", null, "Choose a business in the Portal header to open its Mini Program.", -1)
|
|
183
|
-
])]))
|
|
184
|
-
])
|
|
185
|
-
])
|
|
186
|
-
], 2)
|
|
187
|
-
], 64);
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
}), ce = /* @__PURE__ */ G(oe, [["__scopeId", "data-v-930b981c"]]);
|
|
191
|
-
export {
|
|
192
|
-
ce as default
|
|
193
|
-
};
|
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
import { defineComponent as oe, ref as n, computed as S, watch as N, resolveComponent as K, openBlock as s, createElementBlock as i, withKeys as T, withModifiers as $, createElementVNode as a, toDisplayString as b, createVNode as E, withCtx as R, normalizeStyle as P, withDirectives as z, vModelText as L, Fragment as j, renderList as te, createCommentVNode as p, unref as A, createBlock as ae, createTextVNode as W, nextTick as le } from "vue";
|
|
2
|
-
import { G, f as ne, b as m, l as se } from "./useBrandKit-BlKlqpo2.js";
|
|
3
|
-
import { _ as re } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
-
const ie = ["onKeydown"], ue = { class: "font-picker__label" }, de = ["disabled", "aria-label", "aria-expanded"], ce = ["onKeydown", "aria-label"], pe = {
|
|
5
|
-
key: 0,
|
|
6
|
-
class: "font-picker__muted"
|
|
7
|
-
}, ve = ["aria-pressed", "onClick"], me = { key: 0 }, fe = { key: 1 }, ye = {
|
|
8
|
-
key: 0,
|
|
9
|
-
class: "font-picker__muted",
|
|
10
|
-
role: "status"
|
|
11
|
-
}, _e = { class: "font-picker__preview" }, ke = { class: "font-picker__muted" }, be = {
|
|
12
|
-
key: 0,
|
|
13
|
-
class: "font-picker__muted",
|
|
14
|
-
role: "status"
|
|
15
|
-
}, he = {
|
|
16
|
-
key: 1,
|
|
17
|
-
class: "font-picker__muted"
|
|
18
|
-
}, we = {
|
|
19
|
-
key: 0,
|
|
20
|
-
class: "font-picker__muted"
|
|
21
|
-
}, ge = /* @__PURE__ */ oe({
|
|
22
|
-
__name: "BrandFontPicker",
|
|
23
|
-
props: {
|
|
24
|
-
modelValue: {},
|
|
25
|
-
label: {},
|
|
26
|
-
disabled: { type: Boolean }
|
|
27
|
-
},
|
|
28
|
-
emits: ["update:modelValue"],
|
|
29
|
-
setup(d, { emit: J }) {
|
|
30
|
-
const f = d, Q = J, D = n(), h = n(), q = n(), O = n(360), U = n(), I = n(), v = n(!1), w = n(""), l = n(""), M = n("The quick brown fox jumps over the lazy dog. 0123456789"), c = n({}), y = S(
|
|
31
|
-
() => [
|
|
32
|
-
{ name: "App default", value: "", group: "Defaults" },
|
|
33
|
-
{ name: "System font", value: "system-ui, sans-serif", group: "Defaults" },
|
|
34
|
-
...G.map((e) => ({ name: e, value: ne(e), group: "Google Fonts" }))
|
|
35
|
-
].filter((e) => e.name.toLowerCase().includes(w.value.trim().toLowerCase()))
|
|
36
|
-
), g = S(() => m(f.modelValue || "")), F = S(() => m(l.value)), X = S(
|
|
37
|
-
() => !!l.value && !G.some((e) => e === F.value) && l.value !== "system-ui, sans-serif"
|
|
38
|
-
);
|
|
39
|
-
async function C(e) {
|
|
40
|
-
if (!(!G.some((o) => o === 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
|
-
N(g, (e) => void C(e), { immediate: !0 }), N(y, (e) => {
|
|
50
|
-
v.value && e.forEach((o) => void C(o.name));
|
|
51
|
-
}), N(
|
|
52
|
-
() => f.disabled,
|
|
53
|
-
(e) => {
|
|
54
|
-
e && x();
|
|
55
|
-
}
|
|
56
|
-
), N(() => f.modelValue, x);
|
|
57
|
-
async function Y(e) {
|
|
58
|
-
var o, r;
|
|
59
|
-
v.value = e, e && (O.value = Math.max(320, ((o = D.value) == null ? void 0 : o.getBoundingClientRect().width) || 360), l.value = f.modelValue || "", w.value = "", v.value = !0, y.value.forEach((u) => void C(u.name)), await le(), (r = I.value) == null || r.focus());
|
|
60
|
-
}
|
|
61
|
-
function x() {
|
|
62
|
-
var e;
|
|
63
|
-
v.value = !1, (e = q.value) == null || e.hide();
|
|
64
|
-
}
|
|
65
|
-
function V() {
|
|
66
|
-
var e;
|
|
67
|
-
x(), (e = U.value) == null || e.focus();
|
|
68
|
-
}
|
|
69
|
-
function Z() {
|
|
70
|
-
f.disabled || (Q("update:modelValue", l.value.trim()), V());
|
|
71
|
-
}
|
|
72
|
-
function H(e) {
|
|
73
|
-
var r, u;
|
|
74
|
-
const o = e.relatedTarget;
|
|
75
|
-
o && !((r = D.value) != null && r.contains(o)) && !((u = h.value) != null && u.contains(o)) && x();
|
|
76
|
-
}
|
|
77
|
-
function ee(e) {
|
|
78
|
-
var B, t;
|
|
79
|
-
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(e.key)) return;
|
|
80
|
-
const o = [...((B = h.value) == null ? void 0 : B.querySelectorAll("[data-font-option]")) || []];
|
|
81
|
-
if (!o.length) return;
|
|
82
|
-
e.preventDefault();
|
|
83
|
-
const r = o.indexOf(document.activeElement), u = e.key === "Home" ? 0 : e.key === "End" ? o.length - 1 : (r + (e.key === "ArrowDown" ? 1 : -1) + o.length) % o.length;
|
|
84
|
-
(t = o[u]) == null || t.focus();
|
|
85
|
-
}
|
|
86
|
-
return (e, o) => {
|
|
87
|
-
const r = K("FmIcon"), u = K("FmButton"), B = K("FmPopover");
|
|
88
|
-
return s(), i("div", {
|
|
89
|
-
ref_key: "root",
|
|
90
|
-
ref: D,
|
|
91
|
-
class: "font-picker",
|
|
92
|
-
onFocusout: H,
|
|
93
|
-
onKeydown: T($(V, ["stop", "prevent"]), ["esc"])
|
|
94
|
-
}, [
|
|
95
|
-
a("span", ue, b(d.label), 1),
|
|
96
|
-
E(B, {
|
|
97
|
-
ref_key: "popover",
|
|
98
|
-
ref: q,
|
|
99
|
-
"show-popover": v.value,
|
|
100
|
-
disabled: d.disabled,
|
|
101
|
-
onPopoverChanged: Y
|
|
102
|
-
}, {
|
|
103
|
-
"popover-button": R(() => [
|
|
104
|
-
a("button", {
|
|
105
|
-
ref_key: "trigger",
|
|
106
|
-
ref: U,
|
|
107
|
-
type: "button",
|
|
108
|
-
class: "font-picker__trigger",
|
|
109
|
-
disabled: d.disabled,
|
|
110
|
-
"aria-label": `${d.label} font: ${g.value}`,
|
|
111
|
-
"aria-haspopup": "dialog",
|
|
112
|
-
"aria-expanded": v.value
|
|
113
|
-
}, [
|
|
114
|
-
a("span", {
|
|
115
|
-
style: P({ fontFamily: d.modelValue || "inherit" })
|
|
116
|
-
}, b(g.value), 5),
|
|
117
|
-
E(r, {
|
|
118
|
-
name: "expand_more",
|
|
119
|
-
size: "sm"
|
|
120
|
-
})
|
|
121
|
-
], 8, de)
|
|
122
|
-
]),
|
|
123
|
-
default: R(() => [
|
|
124
|
-
a("div", {
|
|
125
|
-
ref_key: "menu",
|
|
126
|
-
ref: h,
|
|
127
|
-
class: "font-picker__menu",
|
|
128
|
-
style: P({ width: `${O.value}px` }),
|
|
129
|
-
onFocusout: H,
|
|
130
|
-
onKeydown: T($(V, ["stop", "prevent"]), ["esc"]),
|
|
131
|
-
role: "dialog",
|
|
132
|
-
"aria-label": `Choose ${d.label.toLowerCase()} font`
|
|
133
|
-
}, [
|
|
134
|
-
o[7] || (o[7] = a("span", { class: "font-picker__muted" }, "Fonts available", -1)),
|
|
135
|
-
z(a("input", {
|
|
136
|
-
ref_key: "search",
|
|
137
|
-
ref: I,
|
|
138
|
-
"onUpdate:modelValue": o[0] || (o[0] = (t) => w.value = t),
|
|
139
|
-
type: "search",
|
|
140
|
-
placeholder: "Search fonts",
|
|
141
|
-
"aria-label": "Search fonts",
|
|
142
|
-
class: "font-picker__input",
|
|
143
|
-
onKeydown: o[1] || (o[1] = T($((t) => {
|
|
144
|
-
var _, k;
|
|
145
|
-
return (k = (_ = h.value) == null ? void 0 : _.querySelector("[data-font-option]")) == null ? void 0 : k.focus();
|
|
146
|
-
}, ["prevent"]), ["down"]))
|
|
147
|
-
}, null, 544), [
|
|
148
|
-
[L, w.value]
|
|
149
|
-
]),
|
|
150
|
-
a("div", {
|
|
151
|
-
class: "font-picker__options",
|
|
152
|
-
onKeydown: ee
|
|
153
|
-
}, [
|
|
154
|
-
(s(!0), i(j, null, te(y.value, (t, _) => {
|
|
155
|
-
var k;
|
|
156
|
-
return s(), i(j, {
|
|
157
|
-
key: t.name
|
|
158
|
-
}, [
|
|
159
|
-
_ === 0 || ((k = y.value[_ - 1]) == null ? void 0 : k.group) !== t.group ? (s(), i("p", pe, b(t.group), 1)) : p("", !0),
|
|
160
|
-
a("button", {
|
|
161
|
-
type: "button",
|
|
162
|
-
"data-font-option": "",
|
|
163
|
-
class: "font-picker__option",
|
|
164
|
-
"aria-pressed": A(m)(l.value) === A(m)(t.value),
|
|
165
|
-
onClick: (Fe) => l.value = t.value
|
|
166
|
-
}, [
|
|
167
|
-
a("span", {
|
|
168
|
-
style: P({ fontFamily: t.value || "inherit" })
|
|
169
|
-
}, b(t.name), 5),
|
|
170
|
-
c.value[t.name] === "loading" ? (s(), i("small", me, "Loading…")) : c.value[t.name] === "error" ? (s(), i("small", fe, "Preview unavailable")) : p("", !0),
|
|
171
|
-
A(m)(l.value) === A(m)(t.value) ? (s(), ae(r, {
|
|
172
|
-
key: 2,
|
|
173
|
-
name: "check",
|
|
174
|
-
size: "sm"
|
|
175
|
-
})) : p("", !0)
|
|
176
|
-
], 8, ve)
|
|
177
|
-
], 64);
|
|
178
|
-
}), 128)),
|
|
179
|
-
y.value.length ? p("", !0) : (s(), i("p", ye, "No fonts found. Try another name."))
|
|
180
|
-
], 32),
|
|
181
|
-
a("div", _e, [
|
|
182
|
-
a("label", ke, [
|
|
183
|
-
W("Preview · " + b(F.value) + " ", 1),
|
|
184
|
-
z(a("textarea", {
|
|
185
|
-
"onUpdate:modelValue": o[2] || (o[2] = (t) => M.value = t),
|
|
186
|
-
rows: "2",
|
|
187
|
-
"aria-label": "Font preview text",
|
|
188
|
-
style: P({ fontFamily: l.value || "inherit" })
|
|
189
|
-
}, null, 4), [
|
|
190
|
-
[L, M.value]
|
|
191
|
-
])
|
|
192
|
-
]),
|
|
193
|
-
c.value[F.value] === "error" ? (s(), i("p", be, [
|
|
194
|
-
o[5] || (o[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: o[3] || (o[3] = (t) => C(F.value))
|
|
199
|
-
}, "Retry")
|
|
200
|
-
])) : p("", !0),
|
|
201
|
-
a("details", null, [
|
|
202
|
-
o[6] || (o[6] = a("summary", null, "Custom font stack", -1)),
|
|
203
|
-
z(a("input", {
|
|
204
|
-
"onUpdate:modelValue": o[4] || (o[4] = (t) => l.value = t),
|
|
205
|
-
class: "font-picker__input",
|
|
206
|
-
"aria-label": "Custom font stack",
|
|
207
|
-
placeholder: "App default",
|
|
208
|
-
spellcheck: "false"
|
|
209
|
-
}, null, 512), [
|
|
210
|
-
[L, l.value]
|
|
211
|
-
])
|
|
212
|
-
]),
|
|
213
|
-
X.value ? (s(), i("p", he, "Custom fonts preview only if installed or already loaded.")) : p("", !0)
|
|
214
|
-
]),
|
|
215
|
-
a("footer", null, [
|
|
216
|
-
E(u, {
|
|
217
|
-
label: "Cancel",
|
|
218
|
-
variant: "tertiary",
|
|
219
|
-
size: "md",
|
|
220
|
-
onClick: V
|
|
221
|
-
}),
|
|
222
|
-
E(u, {
|
|
223
|
-
label: "Apply",
|
|
224
|
-
size: "md",
|
|
225
|
-
disabled: d.disabled,
|
|
226
|
-
onClick: Z
|
|
227
|
-
}, null, 8, ["disabled"])
|
|
228
|
-
])
|
|
229
|
-
], 44, ce)
|
|
230
|
-
]),
|
|
231
|
-
_: 1
|
|
232
|
-
}, 8, ["show-popover", "disabled"]),
|
|
233
|
-
c.value[g.value] === "error" ? (s(), i("p", we, " Preview unavailable; showing a fallback font. ")) : p("", !0)
|
|
234
|
-
], 40, ie);
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
}), Be = /* @__PURE__ */ re(ge, [["__scopeId", "data-v-ba271d8c"]]);
|
|
238
|
-
export {
|
|
239
|
-
Be as B
|
|
240
|
-
};
|