@feedmepos/mf-miniprogram-v2 0.2.2-dev.0 → 0.2.2-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/App-D7vZDj-a.js +213 -0
- package/dist/BrandKitView-B8t8RkHr.js +221 -0
- package/dist/{ControlPlaneView-krmwG-w_.js → ControlPlaneView-DmhLvgWt.js} +7002 -7093
- package/dist/EcosystemView--S4hk_t4.js +232 -0
- package/dist/LegacyWorkspaceEntry-7DvIosoj.js +36 -0
- package/dist/ModuleCenterView-Dqp-2hbL.js +147 -0
- package/dist/{ModuleDetailView-D5P-_5Ms.js → ModuleDetailView-cpQ_UfS9.js} +63 -65
- package/dist/PagesView-BHo_fnWa.js +43 -0
- package/dist/PlatformUnavailableView-C1RltAIw.js +40 -0
- package/dist/PortalIcon-DO0VrIoY.js +28 -0
- package/dist/PortalSettingsView-CkW-avwg.js +123 -0
- package/dist/StatusBadge.vue_vue_type_script_setup_true_lang-Bh9Eoe_H.js +26 -0
- package/dist/WorkspaceEntryView-ZdXuMQoJ.js +21 -0
- package/dist/app.js +49 -11
- package/dist/controlPlane-wUT1G_Gr.js +144 -0
- package/dist/index-BDHUHtRw.js +46 -0
- package/dist/localPreference-DneUpUrQ.js +34 -0
- package/dist/package.json +2 -1
- package/dist/portalContext-CTVzkJV7.js +47 -0
- package/dist/portalNavigation-DKCfwTH8.js +28 -0
- package/dist/routes-L0ady_Wy.js +53 -0
- package/dist/style.css +1 -1
- package/dist/useBrandKit-CpyR2j6m.js +924 -0
- package/dist/{useModuleCatalog-CTgQG6Dx.js → useModuleCatalog-CD5N246F.js} +16 -15
- package/package.json +2 -1
- package/dist/App-CaNGbhK8.js +0 -20
- package/dist/AppTabs.vue_vue_type_script_setup_true_lang-BKOXPYIU.js +0 -284
- package/dist/ModuleCenterView-54GneqaO.js +0 -148
|
@@ -1,9 +1,10 @@
|
|
|
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 {
|
|
2
|
+
import { a as w } from "./routes-L0ady_Wy.js";
|
|
3
|
+
import { a as M, e as y, m as $ } from "./controlPlane-wUT1G_Gr.js";
|
|
3
4
|
const I = { class: "flex min-h-0 flex-1 flex-col items-center justify-center gap-8 p-24 text-center" }, T = {
|
|
4
5
|
key: 0,
|
|
5
6
|
class: "m-0 max-w-[46ch] fm-typo-en-body-sm-400 text-fm-color-typo-tertiary"
|
|
6
|
-
},
|
|
7
|
+
}, j = /* @__PURE__ */ x({
|
|
7
8
|
__name: "ModuleEmptyState",
|
|
8
9
|
props: {
|
|
9
10
|
icon: {},
|
|
@@ -40,13 +41,13 @@ const I = { class: "flex min-h-0 flex-1 flex-col items-center justify-center gap
|
|
|
40
41
|
function C(e, t) {
|
|
41
42
|
return t === "tier" ? [e.category] : e.slot ? [e.slot] : [];
|
|
42
43
|
}
|
|
43
|
-
function
|
|
44
|
+
function z(e) {
|
|
44
45
|
return b.map((t) => ({
|
|
45
46
|
kind: t,
|
|
46
47
|
values: [...new Set(e.flatMap((o) => C(o, t)))].sort((o, n) => o.localeCompare(n))
|
|
47
48
|
})).filter((t) => t.values.length > 0);
|
|
48
49
|
}
|
|
49
|
-
function
|
|
50
|
+
function R(e, t) {
|
|
50
51
|
const o = e.filter((n) => !(n.kind === t.kind && n.value === t.value));
|
|
51
52
|
return o.length === e.length ? [...e, t] : o;
|
|
52
53
|
}
|
|
@@ -58,15 +59,15 @@ function B(e, t) {
|
|
|
58
59
|
return n.some((c) => l.includes(c.value));
|
|
59
60
|
});
|
|
60
61
|
}
|
|
61
|
-
function
|
|
62
|
+
function G(e, t, o = []) {
|
|
62
63
|
const n = t.trim().toLowerCase();
|
|
63
64
|
return e.filter((l) => B(l, o) ? n ? [l.name, l.description ?? "", l.slot ?? "", ...l.labels ?? []].join(" ").toLowerCase().includes(n) : !0 : !1);
|
|
64
65
|
}
|
|
65
|
-
function
|
|
66
|
+
function O(e) {
|
|
66
67
|
const t = e.slot ? ` It is published to fill the ${e.slot} slot.` : "";
|
|
67
68
|
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.`;
|
|
68
69
|
}
|
|
69
|
-
function
|
|
70
|
+
function U(e, t) {
|
|
70
71
|
if (!e.includes("</head>")) return e;
|
|
71
72
|
const o = JSON.stringify(t).replace(/</g, "\\u003c");
|
|
72
73
|
return e.replace("</head>", `<script>window.__FM_PREVIEW_MODULE__=${o}<\/script></head>`);
|
|
@@ -91,7 +92,7 @@ async function N() {
|
|
|
91
92
|
f.value = y(e) || "Could not load the preview document.";
|
|
92
93
|
}
|
|
93
94
|
}
|
|
94
|
-
function
|
|
95
|
+
function A() {
|
|
95
96
|
function e(o = !1) {
|
|
96
97
|
return !o && (i.value !== null || a) ? a ?? Promise.resolve() : (a = Promise.all([D(), N()]).then(() => {
|
|
97
98
|
}).finally(() => {
|
|
@@ -113,11 +114,11 @@ function U() {
|
|
|
113
114
|
};
|
|
114
115
|
}
|
|
115
116
|
export {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
117
|
+
j as _,
|
|
118
|
+
z as c,
|
|
119
|
+
G as f,
|
|
120
|
+
U as i,
|
|
121
|
+
O as m,
|
|
122
|
+
R as t,
|
|
123
|
+
A as u
|
|
123
124
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@feedmepos/mf-miniprogram-v2",
|
|
3
|
-
"version": "0.2.2-dev.
|
|
3
|
+
"version": "0.2.2-dev.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"deploy:npm:prod": "pnpm run build-only:prod && pnpm run publish:npm latest"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
+
"@casl/ability": "3.4.0",
|
|
40
41
|
"@feedmepos/media-picker": "2.0.0",
|
|
41
42
|
"@feedmepos/mf-common": "^1.27.9",
|
|
42
43
|
"@feedmepos/ui-library": "1.8.4",
|
package/dist/App-CaNGbhK8.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { defineComponent as o, openBlock as r, createElementBlock as p, Fragment as l, createElementVNode as t, createVNode as n, unref as s } from "vue";
|
|
2
|
-
import { RouterView as m } from "vue-router";
|
|
3
|
-
import { _ as a } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
-
const c = { class: "mpv2-app h-full min-h-0 bg-fm-color-neutral-white text-fm-color-typo-primary" }, f = /* @__PURE__ */ o({
|
|
5
|
-
__name: "App",
|
|
6
|
-
setup(i) {
|
|
7
|
-
return (_, e) => (r(), p(l, null, [
|
|
8
|
-
e[0] || (e[0] = t("link", {
|
|
9
|
-
href: "https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,400,0..1,0",
|
|
10
|
-
rel: "stylesheet"
|
|
11
|
-
}, null, -1)),
|
|
12
|
-
t("div", c, [
|
|
13
|
-
n(s(m))
|
|
14
|
-
])
|
|
15
|
-
], 64));
|
|
16
|
-
}
|
|
17
|
-
}), g = /* @__PURE__ */ a(f, [["__scopeId", "data-v-33574bf5"]]);
|
|
18
|
-
export {
|
|
19
|
-
g as default
|
|
20
|
-
};
|
|
@@ -1,284 +0,0 @@
|
|
|
1
|
-
import { useCoreStore as l, FeedMeAuth as h } from "@feedmepos/mf-common";
|
|
2
|
-
import { defineComponent as $, computed as g, resolveComponent as w, openBlock as b, createElementBlock as k, createVNode as y, renderSlot as B } from "vue";
|
|
3
|
-
import "@feedmepos/ui-library";
|
|
4
|
-
import { useRouter as C } from "vue-router";
|
|
5
|
-
const c = (e, s) => `/api/businesses/${e}/projects/${s}`, t = {
|
|
6
|
-
portalContext: (e) => `/api/businesses/${e}/portal-context`,
|
|
7
|
-
project: (e, s) => c(e, s),
|
|
8
|
-
provision: (e, s) => `${c(e, s)}/provision`,
|
|
9
|
-
refreshSlug: (e, s) => `${c(e, s)}/refresh-slug`,
|
|
10
|
-
sessions: (e, s) => `${c(e, s)}/sessions`,
|
|
11
|
-
session: (e, s, r) => `${c(e, s)}/sessions/${r}`,
|
|
12
|
-
messages: (e, s, r) => `${t.session(e, s, r)}/messages`,
|
|
13
|
-
startStatus: (e, s, r) => `${t.session(e, s, r)}/start-status`,
|
|
14
|
-
changes: (e, s, r, n = !1) => `${t.session(e, s, r)}/changes${n ? "?refresh=1" : ""}`,
|
|
15
|
-
checkpoints: (e, s, r) => `${t.session(e, s, r)}/checkpoints`,
|
|
16
|
-
aiBillingPreflight: (e, s, r) => `${t.session(e, s, r)}/ai-billing/preflight`,
|
|
17
|
-
restoreCheckpoint: (e, s, r, n) => `${t.checkpoints(e, s, r)}/${n}/restore`,
|
|
18
|
-
previewBridgeTicket: (e, s, r) => `${t.session(e, s, r)}/preview-bridge/ticket`,
|
|
19
|
-
previewBridgeSocket: (e, s, r) => `${t.session(e, s, r)}/preview-bridge/socket`,
|
|
20
|
-
uploads: (e, s, r, n = "") => `${t.session(e, s, r)}/uploads${n ? `?${n}` : ""}`,
|
|
21
|
-
archive: (e, s, r) => `${t.session(e, s, r)}/archive`,
|
|
22
|
-
commit: (e, s, r) => `${t.session(e, s, r)}/commit`,
|
|
23
|
-
resume: (e, s, r) => `${t.session(e, s, r)}/resume`,
|
|
24
|
-
restartPreview: (e, s, r) => `${t.session(e, s, r)}/restart-preview`,
|
|
25
|
-
fork: (e, s, r) => `${t.session(e, s, r)}/fork`,
|
|
26
|
-
flushEvents: (e, s, r) => `${t.session(e, s, r)}/events/flush`,
|
|
27
|
-
revertTurn: (e, s, r) => `${t.session(e, s, r)}/turns/revert`,
|
|
28
|
-
unrevertTurn: (e, s, r) => `${t.session(e, s, r)}/turns/unrevert`,
|
|
29
|
-
releases: (e, s) => `${c(e, s)}/releases`,
|
|
30
|
-
publishRelease: (e, s, r) => `${t.releases(e, s)}/${r}/publish`,
|
|
31
|
-
releasePreviewUrl: (e, s, r) => `${t.releases(e, s)}/${r}/preview-url`,
|
|
32
|
-
rollbackToRelease: (e, s, r) => `${c(e, s)}/rollback-to-release/${r}`,
|
|
33
|
-
rollbackToV1: (e, s) => `${c(e, s)}/rollback-to-v1`,
|
|
34
|
-
start: (e, s, r) => {
|
|
35
|
-
const n = new URLSearchParams();
|
|
36
|
-
e && n.set("businessId", e), s && n.set("projectId", s), r && n.set("sessionId", r);
|
|
37
|
-
const i = n.toString();
|
|
38
|
-
return `/api/start${i ? `?${i}` : ""}`;
|
|
39
|
-
},
|
|
40
|
-
opencode: (e = "") => `/api/opencode${e ? `/${e.replace(/^\/+/, "")}` : ""}`,
|
|
41
|
-
/** The shared component library's catalog. Deliberately not under a
|
|
42
|
-
* business/project path: the library belongs to no business, and the
|
|
43
|
-
* module centre is not inside a workspace. */
|
|
44
|
-
componentLibraryCatalog: () => "/api/component-library/catalog",
|
|
45
|
-
/** The self-contained preview document the module centre frames. Fetched with
|
|
46
|
-
* the portal's bearer and assigned to an iframe's `srcdoc`, never used as an
|
|
47
|
-
* `<iframe src>` — a navigation request carries no Authorization header,
|
|
48
|
-
* which is what a signed URL would otherwise exist to work around. */
|
|
49
|
-
componentLibraryPreview: () => "/api/component-library/preview",
|
|
50
|
-
/** The application templates this environment can provision, for the portal's
|
|
51
|
-
* picker. Not under a business/project path: the answer is a property of
|
|
52
|
-
* the environment, and it is needed BEFORE a project exists. */
|
|
53
|
-
appTemplates: () => "/api/app-templates"
|
|
54
|
-
}, T = [
|
|
55
|
-
"AE",
|
|
56
|
-
"AU",
|
|
57
|
-
"BN",
|
|
58
|
-
"GB",
|
|
59
|
-
"ID",
|
|
60
|
-
"JP",
|
|
61
|
-
"MA",
|
|
62
|
-
"MO",
|
|
63
|
-
"MV",
|
|
64
|
-
"MY",
|
|
65
|
-
"PK",
|
|
66
|
-
"SG",
|
|
67
|
-
"TH",
|
|
68
|
-
"VN"
|
|
69
|
-
];
|
|
70
|
-
function E(e) {
|
|
71
|
-
return typeof e == "string" && T.includes(e);
|
|
72
|
-
}
|
|
73
|
-
function U(e) {
|
|
74
|
-
if (typeof e != "string") return null;
|
|
75
|
-
const s = e.trim().toUpperCase();
|
|
76
|
-
return E(s) ? s : null;
|
|
77
|
-
}
|
|
78
|
-
function S(e, s) {
|
|
79
|
-
const r = s === "MY" ? "" : `.${s.toLowerCase()}`, n = e === "dev" ? "-dev" : "", i = e === "dev" ? "https://portal.feedmedev.cc" : "https://portal.feedme.cc", o = e === "dev" ? "https://license.feedmedev.cc" : "https://license.feedme.cc";
|
|
80
|
-
return {
|
|
81
|
-
country: s,
|
|
82
|
-
portalApiBaseUrl: `https://portal-v2${n}${r}.feedmeapi.com`,
|
|
83
|
-
licenseApiBaseUrl: `https://license-v2${n}${r}.feedmeapi.com/api`,
|
|
84
|
-
purchaseUrl: `${i}/purchase`,
|
|
85
|
-
aiTokenPurchaseUrl: `${o}/purchase`,
|
|
86
|
-
usageUrl: `${o}/token`
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
function X(e, s, r) {
|
|
90
|
-
const n = new URL(S(e, s).usageUrl);
|
|
91
|
-
return n.searchParams.set("businessId", r), n.searchParams.set("country", s), n.toString();
|
|
92
|
-
}
|
|
93
|
-
const P = "69cde0740c0106001ca83dff", N = {
|
|
94
|
-
dev: {
|
|
95
|
-
env: "dev",
|
|
96
|
-
liveDomain: "feedmedev.vip",
|
|
97
|
-
apiOrigin: "https://api.feedmedev.vip",
|
|
98
|
-
workerNamePrefix: "miniprogram-v2-dev",
|
|
99
|
-
d1DatabaseName: "miniprogram-v2-dev-metadata",
|
|
100
|
-
r2BucketName: "miniprogram-v2-dev-artifacts",
|
|
101
|
-
v1Origin: "https://brand.feedmedev.vip"
|
|
102
|
-
},
|
|
103
|
-
prod: {
|
|
104
|
-
env: "prod",
|
|
105
|
-
liveDomain: "feedme.vip",
|
|
106
|
-
apiOrigin: "https://api.feedme.vip",
|
|
107
|
-
workerNamePrefix: "miniprogram-v2-prod",
|
|
108
|
-
d1DatabaseName: "miniprogram-v2-prod-metadata",
|
|
109
|
-
r2BucketName: "miniprogram-v2-prod-artifacts",
|
|
110
|
-
v1Origin: "https://brand.feedme.vip"
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
function _(e) {
|
|
114
|
-
return e === "dev" || e === "prod";
|
|
115
|
-
}
|
|
116
|
-
function M(e) {
|
|
117
|
-
if (!_(e))
|
|
118
|
-
throw new Error(`MINIPROGRAM_ENV must be 'dev' or 'prod', got ${JSON.stringify(e)}`);
|
|
119
|
-
return N[e];
|
|
120
|
-
}
|
|
121
|
-
function x(e) {
|
|
122
|
-
const s = e.toLowerCase().replace(/^fmmf:/, "");
|
|
123
|
-
return s === "prod" || s === "production" ? "prod" : "dev";
|
|
124
|
-
}
|
|
125
|
-
const D = /^[a-f0-9]{24}$/;
|
|
126
|
-
function R(e) {
|
|
127
|
-
return D.test(e);
|
|
128
|
-
}
|
|
129
|
-
function Z(e) {
|
|
130
|
-
if (!R(e)) throw new Error(`Invalid business id: ${e}`);
|
|
131
|
-
return `prj${e}`;
|
|
132
|
-
}
|
|
133
|
-
function O(e) {
|
|
134
|
-
return e.replace(/\/+$/, "");
|
|
135
|
-
}
|
|
136
|
-
function I() {
|
|
137
|
-
return O("https://miniprogram-v2-api.feedmedev.vip");
|
|
138
|
-
}
|
|
139
|
-
function A(e) {
|
|
140
|
-
const s = I();
|
|
141
|
-
return s ? `${s}${e.startsWith("/") ? e : `/${e}`}` : e;
|
|
142
|
-
}
|
|
143
|
-
function u() {
|
|
144
|
-
return l().currentBusiness.value;
|
|
145
|
-
}
|
|
146
|
-
function m() {
|
|
147
|
-
var e;
|
|
148
|
-
return ((e = u()) == null ? void 0 : e._id) ?? P;
|
|
149
|
-
}
|
|
150
|
-
function L() {
|
|
151
|
-
var e;
|
|
152
|
-
return ((e = u()) == null ? void 0 : e.url) ?? void 0;
|
|
153
|
-
}
|
|
154
|
-
function ee() {
|
|
155
|
-
var e;
|
|
156
|
-
return ((e = u()) == null ? void 0 : e.name) ?? m();
|
|
157
|
-
}
|
|
158
|
-
function F() {
|
|
159
|
-
return l().currentCountry.value;
|
|
160
|
-
}
|
|
161
|
-
function se() {
|
|
162
|
-
var n;
|
|
163
|
-
const e = (n = L()) == null ? void 0 : n.trim().toLowerCase(), s = e && /^[a-z0-9-]+$/.test(e) ? e : m(), r = M(x("fmmf:dev")).liveDomain;
|
|
164
|
-
return `https://${s}.${r}`;
|
|
165
|
-
}
|
|
166
|
-
function j(e) {
|
|
167
|
-
return new Promise((s) => window.setTimeout(s, e));
|
|
168
|
-
}
|
|
169
|
-
function re(e) {
|
|
170
|
-
return e instanceof Error ? e.message : String(e);
|
|
171
|
-
}
|
|
172
|
-
class q extends Error {
|
|
173
|
-
constructor(s, r) {
|
|
174
|
-
super(r), this.status = s, this.body = r;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
function p() {
|
|
178
|
-
var s;
|
|
179
|
-
return ((s = l().sessionUser.value) == null ? void 0 : s.token) || h.token || "";
|
|
180
|
-
}
|
|
181
|
-
async function z() {
|
|
182
|
-
let e = p();
|
|
183
|
-
const s = Date.now() + 5e3;
|
|
184
|
-
for (; !e && Date.now() < s; )
|
|
185
|
-
await j(100), e = p();
|
|
186
|
-
return e ? `Bearer ${e}` : null;
|
|
187
|
-
}
|
|
188
|
-
async function V(e, s = {}) {
|
|
189
|
-
const r = new Request(e, s), n = await z();
|
|
190
|
-
n && r.headers.set("Authorization", n);
|
|
191
|
-
const i = U(F());
|
|
192
|
-
return i && r.headers.set("x-feedme-country", i), fetch(r);
|
|
193
|
-
}
|
|
194
|
-
async function d(e, s = {}) {
|
|
195
|
-
const r = new Headers(s.headers);
|
|
196
|
-
s.body && !r.has("Content-Type") && r.set("Content-Type", "application/json");
|
|
197
|
-
const n = new AbortController(), i = window.setTimeout(() => n.abort(), 15e3);
|
|
198
|
-
try {
|
|
199
|
-
const o = await V(A(e), {
|
|
200
|
-
...s,
|
|
201
|
-
headers: r,
|
|
202
|
-
signal: s.signal ?? n.signal
|
|
203
|
-
});
|
|
204
|
-
if (!o.ok) throw new q(o.status, await o.text());
|
|
205
|
-
return o;
|
|
206
|
-
} catch (o) {
|
|
207
|
-
throw o instanceof DOMException && o.name === "AbortError" ? new Error("Control-plane request timed out") : o;
|
|
208
|
-
} finally {
|
|
209
|
-
window.clearTimeout(i);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
async function ne(e, s = {}) {
|
|
213
|
-
return (await d(e, s)).json();
|
|
214
|
-
}
|
|
215
|
-
async function te(e, s = {}) {
|
|
216
|
-
return (await d(e, s)).text();
|
|
217
|
-
}
|
|
218
|
-
const G = { class: "flex min-w-0 shrink-0 items-center gap-12 border-b border-fm-color-neutral-gray-100 bg-fm-color-neutral-white px-16" }, H = "miniprogram-v2-module-center", oe = /* @__PURE__ */ $({
|
|
219
|
-
__name: "AppTabs",
|
|
220
|
-
props: {
|
|
221
|
-
active: {},
|
|
222
|
-
sessionCount: {}
|
|
223
|
-
},
|
|
224
|
-
emits: ["select"],
|
|
225
|
-
setup(e, { emit: s }) {
|
|
226
|
-
const r = e, n = s, i = C(), o = g(() => [
|
|
227
|
-
{ label: "Workspace", value: "workspace", icon: "space_dashboard" },
|
|
228
|
-
{ label: "Releases", value: "releases", icon: "rocket_launch" },
|
|
229
|
-
...r.sessionCount == null ? [{ label: "Sessions", value: "sessions", icon: "history" }] : [{ label: "Sessions", value: "sessions", icon: "history", badge: r.sessionCount }],
|
|
230
|
-
{ label: "Module library", value: "modules", icon: "widgets" }
|
|
231
|
-
]);
|
|
232
|
-
function f(a) {
|
|
233
|
-
if (a === "modules") {
|
|
234
|
-
i.push({ name: H });
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
237
|
-
if (!(a !== "workspace" && a !== "releases" && a !== "sessions")) {
|
|
238
|
-
if (r.active === "modules") {
|
|
239
|
-
i.push({
|
|
240
|
-
name: "miniprogram-v2-control",
|
|
241
|
-
query: a === "workspace" ? {} : { view: a }
|
|
242
|
-
});
|
|
243
|
-
return;
|
|
244
|
-
}
|
|
245
|
-
n("select", a);
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
return (a, J) => {
|
|
249
|
-
const v = w("FmTabs");
|
|
250
|
-
return b(), k("header", G, [
|
|
251
|
-
y(v, {
|
|
252
|
-
class: "min-w-0 flex-1",
|
|
253
|
-
items: o.value,
|
|
254
|
-
"model-value": e.active,
|
|
255
|
-
"onUpdate:modelValue": f
|
|
256
|
-
}, null, 8, ["items", "model-value"]),
|
|
257
|
-
B(a.$slots, "actions")
|
|
258
|
-
]);
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
});
|
|
262
|
-
export {
|
|
263
|
-
q as C,
|
|
264
|
-
P as D,
|
|
265
|
-
oe as _,
|
|
266
|
-
M as a,
|
|
267
|
-
x as b,
|
|
268
|
-
m as c,
|
|
269
|
-
V as d,
|
|
270
|
-
re as e,
|
|
271
|
-
A as f,
|
|
272
|
-
t as g,
|
|
273
|
-
ne as h,
|
|
274
|
-
z as i,
|
|
275
|
-
L as j,
|
|
276
|
-
F as k,
|
|
277
|
-
Z as l,
|
|
278
|
-
ee as m,
|
|
279
|
-
U as n,
|
|
280
|
-
X as o,
|
|
281
|
-
se as p,
|
|
282
|
-
te as q,
|
|
283
|
-
j as s
|
|
284
|
-
};
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { defineComponent as w, openBlock as e, createElementBlock as n, createElementVNode as o, toDisplayString as i, createCommentVNode as k, 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 z } from "vue";
|
|
2
|
-
import { _ as D } from "./AppTabs.vue_vue_type_script_setup_true_lang-BKOXPYIU.js";
|
|
3
|
-
import { _ as F } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
-
import { u as G, c as R, f as q, _ as f, t as K } from "./useModuleCatalog-CTgQG6Dx.js";
|
|
5
|
-
const O = { class: "card" }, P = { class: "card__head" }, U = { class: "card__name fm-typo-en-body-md-600 text-fm-color-typo-primary" }, j = { class: "card__version fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, H = { class: "card__description fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, J = { class: "card__tags" }, Q = { class: "card__tag card__tag--tier fm-typo-en-body-sm-600" }, W = {
|
|
6
|
-
key: 0,
|
|
7
|
-
class: "card__tag card__tag--slot fm-typo-en-body-sm-400"
|
|
8
|
-
}, X = /* @__PURE__ */ w({
|
|
9
|
-
__name: "ModuleCard",
|
|
10
|
-
props: {
|
|
11
|
-
entry: {}
|
|
12
|
-
},
|
|
13
|
-
setup(l) {
|
|
14
|
-
return (s, c) => (e(), n("article", O, [
|
|
15
|
-
o("header", P, [
|
|
16
|
-
o("h3", U, i(l.entry.name), 1),
|
|
17
|
-
o("span", j, i(l.entry.version), 1)
|
|
18
|
-
]),
|
|
19
|
-
o("p", H, i(l.entry.description || l.entry.id), 1),
|
|
20
|
-
o("footer", J, [
|
|
21
|
-
o("span", Q, i(l.entry.category), 1),
|
|
22
|
-
l.entry.slot ? (e(), n("span", W, i(l.entry.slot), 1)) : k("", !0)
|
|
23
|
-
])
|
|
24
|
-
]));
|
|
25
|
-
}
|
|
26
|
-
}), Y = /* @__PURE__ */ F(X, [["__scopeId", "data-v-653174c0"]]), Z = { class: "shell" }, ee = { class: "centre" }, te = { class: "centre__inner" }, oe = { class: "centre__head" }, ne = {
|
|
27
|
-
key: 0,
|
|
28
|
-
class: "centre__filters"
|
|
29
|
-
}, se = { class: "centre__facet-label fm-typo-en-body-sm-600 text-fm-color-typo-tertiary" }, ae = { class: "centre__chips" }, le = ["aria-pressed", "onClick"], re = {
|
|
30
|
-
key: 1,
|
|
31
|
-
class: "centre__note fm-typo-en-body-md-400"
|
|
32
|
-
}, ie = {
|
|
33
|
-
key: 6,
|
|
34
|
-
class: "centre__grid"
|
|
35
|
-
}, ce = /* @__PURE__ */ w({
|
|
36
|
-
__name: "ModuleCenterView",
|
|
37
|
-
setup(l) {
|
|
38
|
-
const s = G(), c = M(""), d = M([]), T = y(() => R(s.entries.value ?? [])), g = y(() => q(s.entries.value ?? [], c.value, d.value)), V = y(() => c.value.trim().length > 0 || d.value.length > 0), C = y(() => {
|
|
39
|
-
var r;
|
|
40
|
-
return (((r = s.entries.value) == null ? void 0 : r.length) ?? 0) > 0;
|
|
41
|
-
}), N = {
|
|
42
|
-
tier: "Type",
|
|
43
|
-
slot: "Slot"
|
|
44
|
-
};
|
|
45
|
-
function $(r) {
|
|
46
|
-
return d.value.some((a) => a.kind === r.kind && a.value === r.value);
|
|
47
|
-
}
|
|
48
|
-
function B(r) {
|
|
49
|
-
d.value = K(d.value, r);
|
|
50
|
-
}
|
|
51
|
-
function x() {
|
|
52
|
-
c.value = "", d.value = [];
|
|
53
|
-
}
|
|
54
|
-
return I(() => s.load()), (r, a) => {
|
|
55
|
-
const L = h("FmButton"), E = h("FmTextField"), S = h("RouterLink");
|
|
56
|
-
return e(), n("div", Z, [
|
|
57
|
-
m(D, { active: "modules" }),
|
|
58
|
-
o("div", ee, [
|
|
59
|
-
o("div", te, [
|
|
60
|
-
o("header", oe, [
|
|
61
|
-
a[3] || (a[3] = o("div", null, [
|
|
62
|
-
o("h2", { class: "centre__title fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, "Module library"),
|
|
63
|
-
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. ")
|
|
64
|
-
], -1)),
|
|
65
|
-
m(L, {
|
|
66
|
-
size: "md",
|
|
67
|
-
variant: "tertiary",
|
|
68
|
-
icon: "refresh",
|
|
69
|
-
onClick: a[0] || (a[0] = (t) => u(s).load(!0))
|
|
70
|
-
})
|
|
71
|
-
]),
|
|
72
|
-
C.value ? (e(), n("div", ne, [
|
|
73
|
-
m(E, {
|
|
74
|
-
modelValue: c.value,
|
|
75
|
-
"onUpdate:modelValue": a[1] || (a[1] = (t) => c.value = t),
|
|
76
|
-
label: "Search",
|
|
77
|
-
placeholder: "name, slot, or label"
|
|
78
|
-
}, null, 8, ["modelValue"]),
|
|
79
|
-
(e(!0), n(v, null, b(T.value, (t) => (e(), n("div", {
|
|
80
|
-
key: t.kind,
|
|
81
|
-
class: "centre__facet"
|
|
82
|
-
}, [
|
|
83
|
-
o("span", se, i(N[t.kind]), 1),
|
|
84
|
-
o("div", ae, [
|
|
85
|
-
(e(!0), n(v, null, b(t.values, (_) => (e(), n("button", {
|
|
86
|
-
key: _,
|
|
87
|
-
type: "button",
|
|
88
|
-
class: A(["centre__chip fm-typo-en-body-sm-400", { "centre__chip--on": $({ kind: t.kind, value: _ }) }]),
|
|
89
|
-
"aria-pressed": $({ kind: t.kind, value: _ }),
|
|
90
|
-
onClick: (de) => B({ kind: t.kind, value: _ })
|
|
91
|
-
}, i(_), 11, le))), 128))
|
|
92
|
-
])
|
|
93
|
-
]))), 128)),
|
|
94
|
-
V.value ? (e(), n("button", {
|
|
95
|
-
key: 0,
|
|
96
|
-
type: "button",
|
|
97
|
-
class: "centre__clear fm-typo-en-body-sm-600",
|
|
98
|
-
onClick: x
|
|
99
|
-
}, " Clear filters ")) : k("", !0)
|
|
100
|
-
])) : k("", !0),
|
|
101
|
-
u(s).entries.value === null ? (e(), n("p", re, "Loading…")) : u(s).loadError.value ? (e(), p(f, {
|
|
102
|
-
key: 2,
|
|
103
|
-
icon: "error_outline",
|
|
104
|
-
tone: "error",
|
|
105
|
-
title: "Could not load the module library",
|
|
106
|
-
message: u(s).loadError.value,
|
|
107
|
-
"action-label": "Try again",
|
|
108
|
-
onAction: a[2] || (a[2] = (t) => u(s).load(!0))
|
|
109
|
-
}, null, 8, ["message"])) : u(s).unpublished.value ? (e(), p(f, {
|
|
110
|
-
key: 3,
|
|
111
|
-
icon: "widgets",
|
|
112
|
-
title: "No module library has been published yet",
|
|
113
|
-
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."
|
|
114
|
-
})) : C.value ? g.value.length ? (e(), n("ul", ie, [
|
|
115
|
-
(e(!0), n(v, null, b(g.value, (t) => (e(), n("li", {
|
|
116
|
-
key: t.id
|
|
117
|
-
}, [
|
|
118
|
-
m(S, {
|
|
119
|
-
class: "centre__link",
|
|
120
|
-
to: { name: "miniprogram-v2-module-detail", params: { name: t.name } }
|
|
121
|
-
}, {
|
|
122
|
-
default: z(() => [
|
|
123
|
-
m(Y, { entry: t }, null, 8, ["entry"])
|
|
124
|
-
]),
|
|
125
|
-
_: 2
|
|
126
|
-
}, 1032, ["to"])
|
|
127
|
-
]))), 128))
|
|
128
|
-
])) : (e(), p(f, {
|
|
129
|
-
key: 5,
|
|
130
|
-
icon: "search_off",
|
|
131
|
-
title: "No module matches these filters",
|
|
132
|
-
"action-label": "Clear filters",
|
|
133
|
-
onAction: x
|
|
134
|
-
})) : (e(), p(f, {
|
|
135
|
-
key: 4,
|
|
136
|
-
icon: "widgets",
|
|
137
|
-
title: "The module library is empty",
|
|
138
|
-
message: "It has been published, but holds no modules. Nothing here is available to put on a page yet."
|
|
139
|
-
}))
|
|
140
|
-
])
|
|
141
|
-
])
|
|
142
|
-
]);
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
}), pe = /* @__PURE__ */ F(ce, [["__scopeId", "data-v-349aeb50"]]);
|
|
146
|
-
export {
|
|
147
|
-
pe as default
|
|
148
|
-
};
|