@feedmepos/mf-miniprogram-v2 0.2.0-dev.3 → 0.2.1-dev.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/AppTabs.vue_vue_type_script_setup_true_lang-DP7BBWtM.js +270 -0
- package/dist/{ControlPlaneView-BIHhP7C_.js → ControlPlaneView-B61eRNvP.js} +5212 -5091
- package/dist/ModuleCenterView-D3PNaPqU.js +151 -0
- package/dist/ModuleDetailView-DCXsI6HI.js +191 -0
- package/dist/ModuleEmptyState.vue_vue_type_script_setup_true_lang-Dhv_xE17.js +124 -0
- package/dist/app.js +19 -5
- package/dist/package.json +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { defineComponent as T, openBlock as e, createElementBlock as s, createElementVNode as o, toDisplayString as i, createCommentVNode as g, ref as M, computed as y, onMounted as I, resolveComponent as h, createVNode as m, unref as u, Fragment as v, renderList as b, normalizeClass as A, createBlock as p, withCtx as R } from "vue";
|
|
2
|
+
import { useRouter as z } from "vue-router";
|
|
3
|
+
import { u as D, c as G, f as q, _ as f, t as K } from "./ModuleEmptyState.vue_vue_type_script_setup_true_lang-Dhv_xE17.js";
|
|
4
|
+
import { _ as O } from "./AppTabs.vue_vue_type_script_setup_true_lang-DP7BBWtM.js";
|
|
5
|
+
import { _ as w } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
|
+
const P = { class: "card" }, U = { class: "card__head" }, j = { class: "card__name fm-typo-en-body-md-600 text-fm-color-typo-primary" }, H = { class: "card__version fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, J = { class: "card__description fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Q = { class: "card__tags" }, W = { class: "card__tag card__tag--tier fm-typo-en-body-sm-600" }, X = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "card__tag card__tag--slot fm-typo-en-body-sm-400"
|
|
9
|
+
}, Y = /* @__PURE__ */ T({
|
|
10
|
+
__name: "ModuleCard",
|
|
11
|
+
props: {
|
|
12
|
+
entry: {}
|
|
13
|
+
},
|
|
14
|
+
setup(l) {
|
|
15
|
+
return (n, c) => (e(), s("article", P, [
|
|
16
|
+
o("header", U, [
|
|
17
|
+
o("h3", j, i(l.entry.name), 1),
|
|
18
|
+
o("span", H, i(l.entry.version), 1)
|
|
19
|
+
]),
|
|
20
|
+
o("p", J, i(l.entry.description || l.entry.id), 1),
|
|
21
|
+
o("footer", Q, [
|
|
22
|
+
o("span", W, i(l.entry.category), 1),
|
|
23
|
+
l.entry.slot ? (e(), s("span", X, i(l.entry.slot), 1)) : g("", !0)
|
|
24
|
+
])
|
|
25
|
+
]));
|
|
26
|
+
}
|
|
27
|
+
}), Z = /* @__PURE__ */ w(Y, [["__scopeId", "data-v-653174c0"]]), ee = { class: "shell" }, te = { class: "centre" }, oe = { class: "centre__inner" }, se = { class: "centre__head" }, ne = {
|
|
28
|
+
key: 0,
|
|
29
|
+
class: "centre__filters"
|
|
30
|
+
}, ae = { class: "centre__facet-label fm-typo-en-body-sm-600 text-fm-color-typo-tertiary" }, le = { class: "centre__chips" }, re = ["aria-pressed", "onClick"], ie = {
|
|
31
|
+
key: 1,
|
|
32
|
+
class: "centre__note fm-typo-en-body-md-400"
|
|
33
|
+
}, ce = {
|
|
34
|
+
key: 6,
|
|
35
|
+
class: "centre__grid"
|
|
36
|
+
}, de = /* @__PURE__ */ T({
|
|
37
|
+
__name: "ModuleCenterView",
|
|
38
|
+
setup(l) {
|
|
39
|
+
z();
|
|
40
|
+
const n = D(), c = M(""), d = M([]), F = y(() => G(n.entries.value ?? [])), k = y(() => q(n.entries.value ?? [], c.value, d.value)), V = y(() => c.value.trim().length > 0 || d.value.length > 0), C = y(() => {
|
|
41
|
+
var r;
|
|
42
|
+
return (((r = n.entries.value) == null ? void 0 : r.length) ?? 0) > 0;
|
|
43
|
+
}), N = {
|
|
44
|
+
tier: "Type",
|
|
45
|
+
slot: "Slot",
|
|
46
|
+
label: "Tag"
|
|
47
|
+
};
|
|
48
|
+
function $(r) {
|
|
49
|
+
return d.value.some((a) => a.kind === r.kind && a.value === r.value);
|
|
50
|
+
}
|
|
51
|
+
function B(r) {
|
|
52
|
+
d.value = K(d.value, r);
|
|
53
|
+
}
|
|
54
|
+
function x() {
|
|
55
|
+
c.value = "", d.value = [];
|
|
56
|
+
}
|
|
57
|
+
return I(() => n.load()), (r, a) => {
|
|
58
|
+
const L = h("FmButton"), E = h("FmTextField"), S = h("RouterLink");
|
|
59
|
+
return e(), s("div", ee, [
|
|
60
|
+
m(O, { active: "modules" }),
|
|
61
|
+
o("div", te, [
|
|
62
|
+
o("div", oe, [
|
|
63
|
+
o("header", se, [
|
|
64
|
+
a[3] || (a[3] = o("div", null, [
|
|
65
|
+
o("h2", { class: "centre__title fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, "Module library"),
|
|
66
|
+
o("p", { class: "centre__subtitle fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Modules the agent can put on a page. Published from the platform, not from your app. ")
|
|
67
|
+
], -1)),
|
|
68
|
+
m(L, {
|
|
69
|
+
size: "md",
|
|
70
|
+
variant: "tertiary",
|
|
71
|
+
icon: "refresh",
|
|
72
|
+
onClick: a[0] || (a[0] = (t) => u(n).load(!0))
|
|
73
|
+
})
|
|
74
|
+
]),
|
|
75
|
+
C.value ? (e(), s("div", ne, [
|
|
76
|
+
m(E, {
|
|
77
|
+
modelValue: c.value,
|
|
78
|
+
"onUpdate:modelValue": a[1] || (a[1] = (t) => c.value = t),
|
|
79
|
+
label: "Search",
|
|
80
|
+
placeholder: "name, slot, or label"
|
|
81
|
+
}, null, 8, ["modelValue"]),
|
|
82
|
+
(e(!0), s(v, null, b(F.value, (t) => (e(), s("div", {
|
|
83
|
+
key: t.kind,
|
|
84
|
+
class: "centre__facet"
|
|
85
|
+
}, [
|
|
86
|
+
o("span", ae, i(N[t.kind]), 1),
|
|
87
|
+
o("div", le, [
|
|
88
|
+
(e(!0), s(v, null, b(t.values, (_) => (e(), s("button", {
|
|
89
|
+
key: _,
|
|
90
|
+
type: "button",
|
|
91
|
+
class: A(["centre__chip fm-typo-en-body-sm-400", { "centre__chip--on": $({ kind: t.kind, value: _ }) }]),
|
|
92
|
+
"aria-pressed": $({ kind: t.kind, value: _ }),
|
|
93
|
+
onClick: (ue) => B({ kind: t.kind, value: _ })
|
|
94
|
+
}, i(_), 11, re))), 128))
|
|
95
|
+
])
|
|
96
|
+
]))), 128)),
|
|
97
|
+
V.value ? (e(), s("button", {
|
|
98
|
+
key: 0,
|
|
99
|
+
type: "button",
|
|
100
|
+
class: "centre__clear fm-typo-en-body-sm-600",
|
|
101
|
+
onClick: x
|
|
102
|
+
}, " Clear filters ")) : g("", !0)
|
|
103
|
+
])) : g("", !0),
|
|
104
|
+
u(n).entries.value === null ? (e(), s("p", ie, "Loading…")) : u(n).loadError.value ? (e(), p(f, {
|
|
105
|
+
key: 2,
|
|
106
|
+
icon: "error_outline",
|
|
107
|
+
tone: "error",
|
|
108
|
+
title: "Could not load the module library",
|
|
109
|
+
message: u(n).loadError.value,
|
|
110
|
+
"action-label": "Try again",
|
|
111
|
+
onAction: a[2] || (a[2] = (t) => u(n).load(!0))
|
|
112
|
+
}, null, 8, ["message"])) : u(n).unpublished.value ? (e(), p(f, {
|
|
113
|
+
key: 3,
|
|
114
|
+
icon: "widgets",
|
|
115
|
+
title: "No module library has been published yet",
|
|
116
|
+
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."
|
|
117
|
+
})) : C.value ? k.value.length ? (e(), s("ul", ce, [
|
|
118
|
+
(e(!0), s(v, null, b(k.value, (t) => (e(), s("li", {
|
|
119
|
+
key: t.id
|
|
120
|
+
}, [
|
|
121
|
+
m(S, {
|
|
122
|
+
class: "centre__link",
|
|
123
|
+
to: { name: "miniprogram-v2-module-detail", params: { name: t.name } }
|
|
124
|
+
}, {
|
|
125
|
+
default: R(() => [
|
|
126
|
+
m(Z, { entry: t }, null, 8, ["entry"])
|
|
127
|
+
]),
|
|
128
|
+
_: 2
|
|
129
|
+
}, 1032, ["to"])
|
|
130
|
+
]))), 128))
|
|
131
|
+
])) : (e(), p(f, {
|
|
132
|
+
key: 5,
|
|
133
|
+
icon: "search_off",
|
|
134
|
+
title: "No module matches these filters",
|
|
135
|
+
"action-label": "Clear filters",
|
|
136
|
+
onAction: x
|
|
137
|
+
})) : (e(), p(f, {
|
|
138
|
+
key: 4,
|
|
139
|
+
icon: "widgets",
|
|
140
|
+
title: "The module library is empty",
|
|
141
|
+
message: "It has been published, but holds no modules. Nothing here is available to put on a page yet."
|
|
142
|
+
}))
|
|
143
|
+
])
|
|
144
|
+
])
|
|
145
|
+
]);
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
}), he = /* @__PURE__ */ w(de, [["__scopeId", "data-v-90fb25ab"]]);
|
|
149
|
+
export {
|
|
150
|
+
he as default
|
|
151
|
+
};
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { defineComponent as C, ref as M, computed as u, watch as T, resolveComponent as k, openBlock as n, createElementBlock as l, createElementVNode as e, toDisplayString as i, createCommentVNode as _, Fragment as I, renderList as S, createVNode as f, onMounted as B, withCtx as L, unref as d, createBlock as v } from "vue";
|
|
2
|
+
import { useRoute as N, useRouter as P } from "vue-router";
|
|
3
|
+
import { m as A, i as F, u as V, _ as g } from "./ModuleEmptyState.vue_vue_type_script_setup_true_lang-Dhv_xE17.js";
|
|
4
|
+
import { _ as R } from "./AppTabs.vue_vue_type_script_setup_true_lang-DP7BBWtM.js";
|
|
5
|
+
import { useDialog as j } from "@feedmepos/ui-library";
|
|
6
|
+
import { _ as E } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
|
+
const z = { class: "detail" }, q = { class: "detail__head" }, K = { class: "detail__name fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, O = { class: "detail__version fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, Y = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "detail__description fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
10
|
+
}, G = { class: "detail__columns" }, H = { class: "detail__preview" }, J = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "detail__note detail__note--error fm-typo-en-body-md-400"
|
|
13
|
+
}, Q = {
|
|
14
|
+
key: 1,
|
|
15
|
+
class: "detail__note fm-typo-en-body-md-400"
|
|
16
|
+
}, U = ["srcdoc"], W = { class: "detail__facts" }, X = { class: "detail__section" }, Z = { class: "detail__list fm-typo-en-body-md-400" }, ee = { key: 0 }, te = { key: 1 }, oe = { class: "detail__section" }, ne = {
|
|
17
|
+
key: 0,
|
|
18
|
+
class: "detail__note fm-typo-en-body-md-400"
|
|
19
|
+
}, se = {
|
|
20
|
+
key: 1,
|
|
21
|
+
class: "detail__props"
|
|
22
|
+
}, le = {
|
|
23
|
+
key: 0,
|
|
24
|
+
class: "detail__optional fm-typo-en-body-sm-400"
|
|
25
|
+
}, ae = { class: "detail__section" }, ie = ["value"], re = /* @__PURE__ */ C({
|
|
26
|
+
__name: "ModuleDetail",
|
|
27
|
+
props: {
|
|
28
|
+
entry: {},
|
|
29
|
+
previewDocument: {},
|
|
30
|
+
previewError: {}
|
|
31
|
+
},
|
|
32
|
+
setup(o) {
|
|
33
|
+
const r = o, b = j(), s = M(!1);
|
|
34
|
+
let c;
|
|
35
|
+
const m = u(() => A(r.entry)), y = u(
|
|
36
|
+
() => r.previewDocument ? F(r.previewDocument, r.entry.name) : null
|
|
37
|
+
);
|
|
38
|
+
T(
|
|
39
|
+
() => r.entry.name,
|
|
40
|
+
() => {
|
|
41
|
+
s.value = !1;
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
async function x() {
|
|
45
|
+
try {
|
|
46
|
+
await navigator.clipboard.writeText(m.value), s.value = !0, window.clearTimeout(c), c = window.setTimeout(() => {
|
|
47
|
+
s.value = !1;
|
|
48
|
+
}, 2e3);
|
|
49
|
+
} catch (a) {
|
|
50
|
+
b.open({
|
|
51
|
+
title: "Could not copy",
|
|
52
|
+
message: `${a instanceof Error ? a.message : String(a)}. Select the text below and copy it manually.`,
|
|
53
|
+
dismissAway: !0,
|
|
54
|
+
primaryActions: { close: !0, text: "OK" }
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return (a, t) => {
|
|
59
|
+
var p, D, $;
|
|
60
|
+
const h = k("FmButton");
|
|
61
|
+
return n(), l("div", z, [
|
|
62
|
+
e("header", q, [
|
|
63
|
+
e("h3", K, i(o.entry.name), 1),
|
|
64
|
+
e("span", O, i(o.entry.version), 1),
|
|
65
|
+
o.entry.description ? (n(), l("p", Y, i(o.entry.description), 1)) : _("", !0)
|
|
66
|
+
]),
|
|
67
|
+
e("div", G, [
|
|
68
|
+
e("section", H, [
|
|
69
|
+
t[0] || (t[0] = e("h4", { class: "detail__label fm-typo-en-body-sm-600 text-fm-color-typo-tertiary" }, "Preview", -1)),
|
|
70
|
+
o.previewError ? (n(), l("p", J, i(o.previewError), 1)) : y.value ? (n(), l("iframe", {
|
|
71
|
+
key: o.entry.name,
|
|
72
|
+
class: "detail__frame",
|
|
73
|
+
title: "module preview",
|
|
74
|
+
sandbox: "allow-scripts",
|
|
75
|
+
srcdoc: y.value
|
|
76
|
+
}, null, 8, U)) : (n(), l("p", Q, "Loading preview…")),
|
|
77
|
+
t[1] || (t[1] = e("p", { class: "detail__hint fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, " Stand-in brand colours. Your business's own palette applies in the workspace preview. ", -1))
|
|
78
|
+
]),
|
|
79
|
+
e("div", W, [
|
|
80
|
+
e("section", X, [
|
|
81
|
+
t[6] || (t[6] = e("h4", { class: "detail__label fm-typo-en-body-sm-600 text-fm-color-typo-tertiary" }, "Details", -1)),
|
|
82
|
+
e("dl", Z, [
|
|
83
|
+
t[2] || (t[2] = e("dt", null, "Id", -1)),
|
|
84
|
+
e("dd", null, i(o.entry.id), 1),
|
|
85
|
+
t[3] || (t[3] = e("dt", null, "Slot", -1)),
|
|
86
|
+
e("dd", null, i(o.entry.slot ?? "—"), 1),
|
|
87
|
+
t[4] || (t[4] = e("dt", null, "Data shape", -1)),
|
|
88
|
+
e("dd", null, i(o.entry.dataShape ?? "—"), 1),
|
|
89
|
+
t[5] || (t[5] = e("dt", null, "Type", -1)),
|
|
90
|
+
e("dd", null, i(o.entry.category), 1),
|
|
91
|
+
(p = o.entry.labels) != null && p.length ? (n(), l("dt", ee, "Labels")) : _("", !0),
|
|
92
|
+
(D = o.entry.labels) != null && D.length ? (n(), l("dd", te, i(o.entry.labels.join(", ")), 1)) : _("", !0)
|
|
93
|
+
])
|
|
94
|
+
]),
|
|
95
|
+
e("section", oe, [
|
|
96
|
+
t[7] || (t[7] = e("h4", { class: "detail__label fm-typo-en-body-sm-600 text-fm-color-typo-tertiary" }, "Props", -1)),
|
|
97
|
+
($ = o.entry.props) != null && $.length ? (n(), l("ul", se, [
|
|
98
|
+
(n(!0), l(I, null, S(o.entry.props, (w) => (n(), l("li", {
|
|
99
|
+
key: w.name
|
|
100
|
+
}, [
|
|
101
|
+
e("code", null, i(w.name), 1),
|
|
102
|
+
w.required ? _("", !0) : (n(), l("span", le, "optional"))
|
|
103
|
+
]))), 128))
|
|
104
|
+
])) : (n(), l("p", ne, " This module declares no props interface, so it can only be offered as a like-for-like swap. "))
|
|
105
|
+
]),
|
|
106
|
+
e("section", ae, [
|
|
107
|
+
t[8] || (t[8] = e("h4", { class: "detail__label fm-typo-en-body-sm-600 text-fm-color-typo-tertiary" }, "Ask the agent for it", -1)),
|
|
108
|
+
t[9] || (t[9] = e("p", { class: "detail__hint fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, " Paste this into a workspace chat. The agent copies the module into your app's own code. ", -1)),
|
|
109
|
+
e("textarea", {
|
|
110
|
+
class: "detail__prompt",
|
|
111
|
+
readonly: "",
|
|
112
|
+
value: m.value
|
|
113
|
+
}, null, 8, ie),
|
|
114
|
+
f(h, {
|
|
115
|
+
class: "detail__copy",
|
|
116
|
+
size: "md",
|
|
117
|
+
variant: s.value ? "secondary" : "primary",
|
|
118
|
+
icon: s.value ? "check" : "content_copy",
|
|
119
|
+
label: s.value ? "Copied" : "Copy prompt",
|
|
120
|
+
onClick: x
|
|
121
|
+
}, null, 8, ["variant", "icon", "label"])
|
|
122
|
+
])
|
|
123
|
+
])
|
|
124
|
+
])
|
|
125
|
+
]);
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
}), de = /* @__PURE__ */ E(re, [["__scopeId", "data-v-ad739f79"]]), ce = { class: "shell" }, me = { class: "page" }, ue = { class: "page__inner" }, ye = { class: "page__head" }, pe = {
|
|
129
|
+
key: 0,
|
|
130
|
+
class: "page__note fm-typo-en-body-md-400"
|
|
131
|
+
}, _e = /* @__PURE__ */ C({
|
|
132
|
+
__name: "ModuleDetailView",
|
|
133
|
+
setup(o) {
|
|
134
|
+
const r = N(), b = P(), s = V(), c = u(() => String(r.params.name ?? "")), m = u(() => s.find(c.value)), y = u(() => s.entries.value === null);
|
|
135
|
+
return B(() => s.load()), (x, a) => {
|
|
136
|
+
const t = k("FmIcon"), h = k("RouterLink");
|
|
137
|
+
return n(), l("div", ce, [
|
|
138
|
+
f(R, { active: "modules" }),
|
|
139
|
+
e("div", me, [
|
|
140
|
+
e("div", ue, [
|
|
141
|
+
e("header", ye, [
|
|
142
|
+
f(h, {
|
|
143
|
+
class: "page__back",
|
|
144
|
+
to: { name: "miniprogram-v2-module-center" }
|
|
145
|
+
}, {
|
|
146
|
+
default: L(() => [
|
|
147
|
+
f(t, {
|
|
148
|
+
name: "arrow_back",
|
|
149
|
+
size: "sm",
|
|
150
|
+
color: "typo-secondary"
|
|
151
|
+
}),
|
|
152
|
+
a[2] || (a[2] = e("span", { class: "fm-typo-en-body-sm-600" }, "Module library", -1))
|
|
153
|
+
]),
|
|
154
|
+
_: 1
|
|
155
|
+
})
|
|
156
|
+
]),
|
|
157
|
+
y.value ? (n(), l("p", pe, "Loading…")) : d(s).loadError.value ? (n(), v(g, {
|
|
158
|
+
key: 1,
|
|
159
|
+
icon: "error_outline",
|
|
160
|
+
tone: "error",
|
|
161
|
+
title: "Could not load the module library",
|
|
162
|
+
message: d(s).loadError.value,
|
|
163
|
+
"action-label": "Try again",
|
|
164
|
+
onAction: a[0] || (a[0] = (p) => d(s).load(!0))
|
|
165
|
+
}, null, 8, ["message"])) : d(s).unpublished.value ? (n(), v(g, {
|
|
166
|
+
key: 2,
|
|
167
|
+
icon: "widgets",
|
|
168
|
+
title: "No module library has been published yet",
|
|
169
|
+
message: "Nothing has been published for this page to show."
|
|
170
|
+
})) : m.value ? (n(), v(de, {
|
|
171
|
+
key: 4,
|
|
172
|
+
entry: m.value,
|
|
173
|
+
"preview-document": d(s).previewDocument.value,
|
|
174
|
+
"preview-error": d(s).previewError.value
|
|
175
|
+
}, null, 8, ["entry", "preview-document", "preview-error"])) : (n(), v(g, {
|
|
176
|
+
key: 3,
|
|
177
|
+
icon: "search_off",
|
|
178
|
+
title: `No module named “${c.value}”`,
|
|
179
|
+
message: "It is not in the published library. It may have been renamed, withdrawn, or never published.",
|
|
180
|
+
"action-label": "Back to the library",
|
|
181
|
+
onAction: a[1] || (a[1] = (p) => d(b).push({ name: "miniprogram-v2-module-center" }))
|
|
182
|
+
}, null, 8, ["title"]))
|
|
183
|
+
])
|
|
184
|
+
])
|
|
185
|
+
]);
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
}), ke = /* @__PURE__ */ E(_e, [["__scopeId", "data-v-3450e7c8"]]);
|
|
189
|
+
export {
|
|
190
|
+
ke as default
|
|
191
|
+
};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { shallowReadonly as r, ref as s, 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 } from "vue";
|
|
2
|
+
import { h as M, g as w, e as y, p as $ } from "./AppTabs.vue_vue_type_script_setup_true_lang-DP7BBWtM.js";
|
|
3
|
+
const b = ["tier", "slot", "label"];
|
|
4
|
+
function C(e, t) {
|
|
5
|
+
return t === "tier" ? [e.category] : t === "slot" ? e.slot ? [e.slot] : [] : e.labels ?? [];
|
|
6
|
+
}
|
|
7
|
+
function V(e) {
|
|
8
|
+
return b.map((t) => ({
|
|
9
|
+
kind: t,
|
|
10
|
+
values: [...new Set(e.flatMap((o) => C(o, t)))].sort((o, n) => o.localeCompare(n))
|
|
11
|
+
})).filter((t) => t.values.length > 0);
|
|
12
|
+
}
|
|
13
|
+
function j(e, t) {
|
|
14
|
+
const o = e.filter((n) => !(n.kind === t.kind && n.value === t.value));
|
|
15
|
+
return o.length === e.length ? [...e, t] : o;
|
|
16
|
+
}
|
|
17
|
+
function I(e, t) {
|
|
18
|
+
return b.every((o) => {
|
|
19
|
+
const n = t.filter((c) => c.kind === o);
|
|
20
|
+
if (!n.length) return !0;
|
|
21
|
+
const l = C(e, o);
|
|
22
|
+
return n.some((c) => l.includes(c.value));
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function z(e, t, o = []) {
|
|
26
|
+
const n = t.trim().toLowerCase();
|
|
27
|
+
return e.filter((l) => I(l, o) ? n ? [l.name, l.description ?? "", l.slot ?? "", ...l.labels ?? []].join(" ").toLowerCase().includes(n) : !0 : !1);
|
|
28
|
+
}
|
|
29
|
+
function R(e) {
|
|
30
|
+
const t = e.slot ? ` It is published to fill the ${e.slot} slot.` : "";
|
|
31
|
+
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.`;
|
|
32
|
+
}
|
|
33
|
+
function G(e, t) {
|
|
34
|
+
if (!e.includes("</head>")) return e;
|
|
35
|
+
const o = JSON.stringify(t).replace(/</g, "\\u003c");
|
|
36
|
+
return e.replace("</head>", `<script>window.__FM_PREVIEW_MODULE__=${o}<\/script></head>`);
|
|
37
|
+
}
|
|
38
|
+
const i = s(null), m = s(null), d = s(!1), k = s(null), f = s(null);
|
|
39
|
+
let a = null;
|
|
40
|
+
async function T() {
|
|
41
|
+
m.value = null, d.value = !1;
|
|
42
|
+
try {
|
|
43
|
+
const e = await M(w.componentLibraryCatalog());
|
|
44
|
+
i.value = e.components ?? [];
|
|
45
|
+
} catch (e) {
|
|
46
|
+
const t = y(e);
|
|
47
|
+
i.value = [], t.includes("no component library has been published") ? d.value = !0 : m.value = t || "Could not load the module library.";
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
async function B() {
|
|
51
|
+
f.value = null;
|
|
52
|
+
try {
|
|
53
|
+
k.value = await $(w.componentLibraryPreview());
|
|
54
|
+
} catch (e) {
|
|
55
|
+
f.value = y(e) || "Could not load the preview document.";
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function O() {
|
|
59
|
+
function e(o = !1) {
|
|
60
|
+
return !o && (i.value !== null || a) ? a ?? Promise.resolve() : (a = Promise.all([T(), B()]).then(() => {
|
|
61
|
+
}).finally(() => {
|
|
62
|
+
a = null;
|
|
63
|
+
}), a);
|
|
64
|
+
}
|
|
65
|
+
function t(o) {
|
|
66
|
+
var n;
|
|
67
|
+
return ((n = i.value) == null ? void 0 : n.find((l) => l.name === o)) ?? null;
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
entries: r(i),
|
|
71
|
+
loadError: r(m),
|
|
72
|
+
unpublished: r(d),
|
|
73
|
+
previewDocument: r(k),
|
|
74
|
+
previewError: r(f),
|
|
75
|
+
load: e,
|
|
76
|
+
find: t
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
const D = { class: "flex min-h-0 flex-1 flex-col items-center justify-center gap-8 p-24 text-center" }, N = {
|
|
80
|
+
key: 0,
|
|
81
|
+
class: "m-0 max-w-[46ch] fm-typo-en-body-sm-400 text-fm-color-typo-tertiary"
|
|
82
|
+
}, U = /* @__PURE__ */ x({
|
|
83
|
+
__name: "ModuleEmptyState",
|
|
84
|
+
props: {
|
|
85
|
+
icon: {},
|
|
86
|
+
title: {},
|
|
87
|
+
message: {},
|
|
88
|
+
actionLabel: {},
|
|
89
|
+
tone: {}
|
|
90
|
+
},
|
|
91
|
+
emits: ["action"],
|
|
92
|
+
setup(e) {
|
|
93
|
+
return (t, o) => {
|
|
94
|
+
const n = p("FmIcon"), l = p("FmButton");
|
|
95
|
+
return u(), h("div", D, [
|
|
96
|
+
E(n, {
|
|
97
|
+
name: e.icon,
|
|
98
|
+
size: "xl",
|
|
99
|
+
color: e.tone === "error" ? "typo-warning" : "neutral-gray-300"
|
|
100
|
+
}, null, 8, ["name", "color"]),
|
|
101
|
+
P("p", {
|
|
102
|
+
class: F(["m-0 fm-typo-en-body-md-600", e.tone === "error" ? "text-fm-color-typo-warning" : "text-fm-color-typo-secondary"])
|
|
103
|
+
}, v(e.title), 3),
|
|
104
|
+
e.message ? (u(), h("p", N, v(e.message), 1)) : g("", !0),
|
|
105
|
+
e.actionLabel ? (u(), L(l, {
|
|
106
|
+
key: 1,
|
|
107
|
+
size: "md",
|
|
108
|
+
variant: "secondary",
|
|
109
|
+
label: e.actionLabel,
|
|
110
|
+
onClick: o[0] || (o[0] = (c) => t.$emit("action"))
|
|
111
|
+
}, null, 8, ["label"])) : g("", !0)
|
|
112
|
+
]);
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
export {
|
|
117
|
+
U as _,
|
|
118
|
+
V as c,
|
|
119
|
+
z as f,
|
|
120
|
+
G as i,
|
|
121
|
+
R as m,
|
|
122
|
+
j as t,
|
|
123
|
+
O as u
|
|
124
|
+
};
|
package/dist/app.js
CHANGED
|
@@ -3,16 +3,30 @@ const n = [
|
|
|
3
3
|
{
|
|
4
4
|
path: "/",
|
|
5
5
|
name: "miniprogram-v2-control",
|
|
6
|
-
component: () => import("./ControlPlaneView-
|
|
6
|
+
component: () => import("./ControlPlaneView-B61eRNvP.js")
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
// The shared component library, not this merchant's workspace — which is
|
|
10
|
+
// why it sits beside the control view rather than inside it.
|
|
11
|
+
path: "/modules",
|
|
12
|
+
name: "miniprogram-v2-module-center",
|
|
13
|
+
component: () => import("./ModuleCenterView-D3PNaPqU.js")
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
// Keyed by the module's directory name, which is what the catalog, the
|
|
17
|
+
// delivered library directory and the block-swap skill all already use.
|
|
18
|
+
path: "/modules/:name",
|
|
19
|
+
name: "miniprogram-v2-module-detail",
|
|
20
|
+
component: () => import("./ModuleDetailView-DCXsI6HI.js")
|
|
7
21
|
},
|
|
8
22
|
{
|
|
9
23
|
path: "/:pathMatch(.*)*",
|
|
10
24
|
redirect: { name: "miniprogram-v2-control" }
|
|
11
25
|
}
|
|
12
|
-
],
|
|
26
|
+
], t = {}, e = o(() => import("./App-CaNGbhK8.js")), r = o(() => import("./ControlPlaneView-B61eRNvP.js"));
|
|
13
27
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
28
|
+
e as FmApp,
|
|
29
|
+
r as MiniprogramWorkspace,
|
|
30
|
+
t as i18nMessages,
|
|
17
31
|
n as routes
|
|
18
32
|
};
|