@feedmepos/mf-miniprogram-v2 0.2.8-dev.1 → 0.2.8-dev.10
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-B7Mai_6F.js → App-Ck_p8Anr.js} +261 -268
- package/dist/{BrandFontPicker-JHyoGusq.js → BrandFontPicker-VX2LAN2w.js} +1 -1
- package/dist/{BrandKitView-Dlt_ifI0.js → BrandKitView-CB7kcVy2.js} +2 -2
- package/dist/ControlPlaneView-CqTLqklv.js +27000 -0
- package/dist/{EcosystemView-Cy0N2qNK.js → EcosystemView-Bt-UdWfQ.js} +6 -6
- package/dist/MobileProjectDialog-DAYQdrCY.js +452 -0
- package/dist/MobileProjectsView-z7GucfWB.js +235 -0
- package/dist/ModuleCenterView-t8rhd419.js +283 -0
- package/dist/ModuleDetailView-C2TJToR7.js +296 -0
- package/dist/{PagesView-DQCIwpnL.js → PagesView-bXfOrylf.js} +2 -2
- package/dist/{PlatformUnavailableView-DY2ntpNw.js → PlatformUnavailableView-CkKpF-bi.js} +1 -1
- package/dist/{PortalSettingsView-Cz566Ccd.js → PortalSettingsView-D_2Gd3-Y.js} +9 -9
- package/dist/StatusBadge.vue_vue_type_script_setup_true_lang-DMm_s9ua.js +41 -0
- package/dist/TemplateCenterView-DEN51nfK.js +515 -0
- package/dist/{WorkspaceEntryView-B28ASSit.js → WorkspaceEntryView-SLqO3Mi4.js} +2 -2
- package/dist/app.js +15 -15
- package/dist/{controlPlane-sXaC6pAh.js → controlPlane-DR5ykj4d.js} +8 -8
- package/dist/localPreference-Do4VKtxT.js +61 -0
- package/dist/package.json +1 -1
- package/dist/{portalContext-DV-6uUwp.js → portalContext-BeKN8Bcx.js} +2 -2
- package/dist/portalNavigation-DDMi3QTt.js +43 -0
- package/dist/{routes-CeuodIgg.js → routes-B9oMJsaM.js} +45 -27
- package/dist/style.css +1 -1
- package/dist/{useBrandKit-CXLIXo5j.js → useBrandKit-CKn1fm2o.js} +1 -1
- package/dist/useModuleCatalog-Daw8KA--.js +147 -0
- package/package.json +1 -1
- package/dist/AppTemplatePicker.vue_vue_type_script_setup_true_lang-LE_aKvfg.js +0 -198
- package/dist/ControlPlaneView-CBGNMsPT.js +0 -25317
- package/dist/MobileProjectsView-CvMvePvm.js +0 -333
- package/dist/ModuleCenterView-C6mCPATr.js +0 -147
- package/dist/ModuleDetailView-CSfMF0Uo.js +0 -189
- package/dist/StatusBadge.vue_vue_type_script_setup_true_lang-CMgQ0bd_.js +0 -30
- package/dist/TemplateCenterView-DqZLthqh.js +0 -426
- package/dist/adminAccess-oXC0xjvK.js +0 -48
- package/dist/portalNavigation-BBORm5cp.js +0 -34
- package/dist/useModuleCatalog-Cep-pzWO.js +0 -124
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { defineComponent as p, computed as a, openBlock as c, createElementBlock as l, normalizeClass as m, renderSlot as i } from "vue";
|
|
2
|
-
const d = /* @__PURE__ */ p({
|
|
3
|
-
__name: "StatusBadge",
|
|
4
|
-
props: {
|
|
5
|
-
variant: { default: "neutral" },
|
|
6
|
-
size: { default: "md" }
|
|
7
|
-
},
|
|
8
|
-
setup(e) {
|
|
9
|
-
const o = e, t = {
|
|
10
|
-
success: "bg-fm-color-system-success-100 text-fm-color-typo-success",
|
|
11
|
-
warning: "bg-fm-color-system-warning-100 text-fm-color-typo-warning",
|
|
12
|
-
error: "bg-fm-color-system-error-100 text-fm-color-typo-error",
|
|
13
|
-
info: "bg-fm-color-system-info-100 text-fm-color-typo-info",
|
|
14
|
-
neutral: "bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary",
|
|
15
|
-
primary: "bg-fm-color-primary text-fm-color-typo-white"
|
|
16
|
-
}, r = {
|
|
17
|
-
xs: "rounded-[4px] px-[4px] py-[2px] text-[10px] leading-[14px] font-medium tracking-[0.2px]",
|
|
18
|
-
sm: "rounded-[4px] px-[6px] py-[4px] text-[12px] leading-[16px] font-medium tracking-[0.24px]",
|
|
19
|
-
md: "rounded-full px-8 py-2 leading-[16px]"
|
|
20
|
-
}, n = a(() => r[o.size]);
|
|
21
|
-
return (s, x) => (c(), l("span", {
|
|
22
|
-
class: m(["inline-flex shrink-0 items-center gap-4", [t[e.variant], n.value]])
|
|
23
|
-
}, [
|
|
24
|
-
i(s.$slots, "default")
|
|
25
|
-
], 2));
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
export {
|
|
29
|
-
d as _
|
|
30
|
-
};
|
|
@@ -1,426 +0,0 @@
|
|
|
1
|
-
import { defineComponent as B, ref as o, computed as K, resolveComponent as F, openBlock as s, createBlock as V, withCtx as Q, createElementVNode as a, createElementBlock as i, Fragment as x, createTextVNode as R, toDisplayString as u, createVNode as c, createCommentVNode as v, onMounted as X, renderList as M, normalizeClass as Y } from "vue";
|
|
2
|
-
import { a as k } from "./routes-CeuodIgg.js";
|
|
3
|
-
import { useDialog as Z } from "@feedmepos/ui-library";
|
|
4
|
-
import { useRouter as ee } from "vue-router";
|
|
5
|
-
import { c as C, e as T } from "./controlPlane-sXaC6pAh.js";
|
|
6
|
-
import { _ as L } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
|
-
const te = ["href"], ae = {
|
|
8
|
-
key: 0,
|
|
9
|
-
class: "portal-error",
|
|
10
|
-
role: "alert"
|
|
11
|
-
}, le = "miniprogram-vue-v2", se = /* @__PURE__ */ B({
|
|
12
|
-
__name: "ForkTemplateDialog",
|
|
13
|
-
emits: ["close", "created"],
|
|
14
|
-
setup(z, { emit: E }) {
|
|
15
|
-
const b = E, d = o(""), _ = o(""), P = o(""), p = o(!1), y = o(""), w = o(""), A = o(0), q = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/, m = K(
|
|
16
|
-
() => !p.value && q.test(d.value.trim()) && _.value.trim().length > 0 && P.value.trim().length > 0
|
|
17
|
-
);
|
|
18
|
-
async function $() {
|
|
19
|
-
if (m.value) {
|
|
20
|
-
p.value = !0, y.value = "";
|
|
21
|
-
try {
|
|
22
|
-
const f = await C(k.forkAppTemplate(), {
|
|
23
|
-
method: "POST",
|
|
24
|
-
body: JSON.stringify({
|
|
25
|
-
sourceAppTemplateId: le,
|
|
26
|
-
newAppTemplateId: d.value.trim(),
|
|
27
|
-
label: _.value.trim(),
|
|
28
|
-
description: P.value.trim()
|
|
29
|
-
})
|
|
30
|
-
});
|
|
31
|
-
w.value = f.pullRequestUrl, A.value = f.fileCount, b("created");
|
|
32
|
-
} catch (f) {
|
|
33
|
-
y.value = T(f);
|
|
34
|
-
} finally {
|
|
35
|
-
p.value = !1;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return (f, n) => {
|
|
40
|
-
const h = F("FmButton"), I = F("FmTextField"), S = F("FmTextarea"), O = F("FmCard");
|
|
41
|
-
return s(), V(O, { class: "fork-template-dialog" }, {
|
|
42
|
-
default: Q(() => [
|
|
43
|
-
n[7] || (n[7] = a("h2", null, "Create template", -1)),
|
|
44
|
-
w.value ? (s(), i(x, { key: 0 }, [
|
|
45
|
-
a("p", null, [
|
|
46
|
-
R(" Opened a pull request copying " + u(A.value) + " file(s) into a brand-new ", 1),
|
|
47
|
-
a("code", null, "templates/" + u(d.value) + "/", 1),
|
|
48
|
-
n[5] || (n[5] = R(" directory, and registering it in the template catalog. It needs human review and merge — once merged and deployed, it appears here and in the merchant picker automatically; there is no separate step to enable it. ", -1))
|
|
49
|
-
]),
|
|
50
|
-
a("footer", null, [
|
|
51
|
-
a("a", {
|
|
52
|
-
class: "fork-template-dialog__review-link",
|
|
53
|
-
href: w.value,
|
|
54
|
-
target: "_blank",
|
|
55
|
-
rel: "noopener"
|
|
56
|
-
}, "Review PR", 8, te),
|
|
57
|
-
c(h, {
|
|
58
|
-
label: "Done",
|
|
59
|
-
onClick: n[0] || (n[0] = (g) => b("close"))
|
|
60
|
-
})
|
|
61
|
-
])
|
|
62
|
-
], 64)) : (s(), i(x, { key: 1 }, [
|
|
63
|
-
n[6] || (n[6] = a("p", { class: "fork-template-dialog__note" }, " Copies the v2 baseline template's whole directory into a brand-new, independent one — editing the new one can never affect the baseline or any other template. Use this to start a new restaurant style rather than editing a style that other merchants already share. ", -1)),
|
|
64
|
-
c(I, {
|
|
65
|
-
modelValue: d.value,
|
|
66
|
-
"onUpdate:modelValue": n[1] || (n[1] = (g) => d.value = g),
|
|
67
|
-
label: "New template id",
|
|
68
|
-
placeholder: "e.g. miniprogram-vue-v2-bakery",
|
|
69
|
-
"helper-text": "Lowercase, kebab-case. Also becomes the directory name and GitHub repository name.",
|
|
70
|
-
disabled: p.value,
|
|
71
|
-
rules: [(g) => q.test(g.trim()) || "Lowercase kebab-case, e.g. miniprogram-vue-v2-bakery"]
|
|
72
|
-
}, null, 8, ["modelValue", "disabled", "rules"]),
|
|
73
|
-
c(I, {
|
|
74
|
-
modelValue: _.value,
|
|
75
|
-
"onUpdate:modelValue": n[2] || (n[2] = (g) => _.value = g),
|
|
76
|
-
label: "Label",
|
|
77
|
-
placeholder: "Shown to merchants in the picker",
|
|
78
|
-
disabled: p.value
|
|
79
|
-
}, null, 8, ["modelValue", "disabled"]),
|
|
80
|
-
c(S, {
|
|
81
|
-
modelValue: P.value,
|
|
82
|
-
"onUpdate:modelValue": n[3] || (n[3] = (g) => P.value = g),
|
|
83
|
-
label: "Description",
|
|
84
|
-
placeholder: "One or two sentences on what the merchant gets",
|
|
85
|
-
disabled: p.value
|
|
86
|
-
}, null, 8, ["modelValue", "disabled"]),
|
|
87
|
-
y.value ? (s(), i("p", ae, u(y.value), 1)) : v("", !0),
|
|
88
|
-
a("footer", null, [
|
|
89
|
-
c(h, {
|
|
90
|
-
label: "Cancel",
|
|
91
|
-
variant: "tertiary",
|
|
92
|
-
disabled: p.value,
|
|
93
|
-
onClick: n[4] || (n[4] = (g) => b("close"))
|
|
94
|
-
}, null, 8, ["disabled"]),
|
|
95
|
-
c(h, {
|
|
96
|
-
label: "Open pull request",
|
|
97
|
-
loading: p.value,
|
|
98
|
-
disabled: !m.value,
|
|
99
|
-
onClick: $
|
|
100
|
-
}, null, 8, ["loading", "disabled"])
|
|
101
|
-
])
|
|
102
|
-
], 64))
|
|
103
|
-
]),
|
|
104
|
-
_: 1
|
|
105
|
-
});
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
}), ie = /* @__PURE__ */ L(se, [["__scopeId", "data-v-5a38928f"]]), ne = { class: "portal-page" }, oe = { class: "portal-page-inner" }, re = { class: "portal-page-heading" }, ue = { class: "portal-page-heading__actions" }, de = {
|
|
109
|
-
key: 0,
|
|
110
|
-
class: "portal-error",
|
|
111
|
-
role: "alert"
|
|
112
|
-
}, ce = {
|
|
113
|
-
key: 1,
|
|
114
|
-
"aria-label": "Templates in review"
|
|
115
|
-
}, pe = { class: "template-section-heading" }, me = {
|
|
116
|
-
key: 0,
|
|
117
|
-
class: "portal-error",
|
|
118
|
-
role: "alert"
|
|
119
|
-
}, ve = {
|
|
120
|
-
key: 1,
|
|
121
|
-
class: "template-choices__list",
|
|
122
|
-
"aria-label": "Templates in review"
|
|
123
|
-
}, he = { class: "template-choices__name" }, ge = { class: "template-choices__label" }, be = { key: 0 }, _e = { class: "template-choices__id" }, fe = { class: "template-choices__actions" }, ye = ["href"], ke = { class: "template-section-heading" }, we = {
|
|
124
|
-
key: 2,
|
|
125
|
-
class: "portal-error",
|
|
126
|
-
role: "alert"
|
|
127
|
-
}, Ce = {
|
|
128
|
-
class: "template-choices__list",
|
|
129
|
-
"aria-label": "Physical templates"
|
|
130
|
-
}, Te = { class: "template-choices__name" }, Re = { class: "template-choices__label" }, Pe = { key: 0 }, Ae = { class: "template-choices__id" }, qe = { class: "template-choices__meta" }, $e = {
|
|
131
|
-
key: 0,
|
|
132
|
-
class: "template-status-badge template-status-badge--draft"
|
|
133
|
-
}, Ne = { class: "template-choices__actions" }, xe = /* @__PURE__ */ B({
|
|
134
|
-
__name: "TemplateCenterView",
|
|
135
|
-
setup(z) {
|
|
136
|
-
const E = ee(), b = Z(), d = o(""), _ = o(null), P = o([]), p = o(!1), y = o("");
|
|
137
|
-
async function w() {
|
|
138
|
-
p.value = !0, y.value = "";
|
|
139
|
-
try {
|
|
140
|
-
const e = await C(k.appTemplateRegistry());
|
|
141
|
-
P.value = e.templates;
|
|
142
|
-
} catch (e) {
|
|
143
|
-
y.value = T(e);
|
|
144
|
-
} finally {
|
|
145
|
-
p.value = !1;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
const A = o([]), q = o(!1), m = o("");
|
|
149
|
-
async function $() {
|
|
150
|
-
q.value = !0, m.value = "";
|
|
151
|
-
try {
|
|
152
|
-
const e = await C(k.pendingTemplateChanges());
|
|
153
|
-
A.value = e.changes;
|
|
154
|
-
} catch (e) {
|
|
155
|
-
m.value = T(e);
|
|
156
|
-
} finally {
|
|
157
|
-
q.value = !1;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
async function f() {
|
|
161
|
-
await Promise.all([w(), $()]);
|
|
162
|
-
}
|
|
163
|
-
function n() {
|
|
164
|
-
b.open({
|
|
165
|
-
title: "Create template",
|
|
166
|
-
dialogComponent: ie,
|
|
167
|
-
dialogComponentProps: { onClose: () => b.close(), onCreated: () => void f() }
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
const h = o(null);
|
|
171
|
-
async function I(e) {
|
|
172
|
-
h.value = e.pullRequestNumber, m.value = "";
|
|
173
|
-
try {
|
|
174
|
-
await C(k.mergePendingTemplateChange(e.pullRequestNumber), { method: "POST" }), await f();
|
|
175
|
-
} catch (l) {
|
|
176
|
-
m.value = T(l);
|
|
177
|
-
} finally {
|
|
178
|
-
h.value = null;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
async function S(e) {
|
|
182
|
-
h.value = e.pullRequestNumber, m.value = "";
|
|
183
|
-
try {
|
|
184
|
-
await C(k.rejectPendingTemplateChange(e.pullRequestNumber), { method: "POST" }), await f();
|
|
185
|
-
} catch (l) {
|
|
186
|
-
m.value = T(l);
|
|
187
|
-
} finally {
|
|
188
|
-
h.value = null;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
function O(e) {
|
|
192
|
-
const l = e.kind === "delete" ? "delete" : "create";
|
|
193
|
-
b.open({
|
|
194
|
-
title: `Merge — ${l} ${e.appTemplateId}?`,
|
|
195
|
-
message: e.kind === "delete" ? `Merges the pull request into main as-is, without a code review step here. templates/${e.appTemplateId}/ is gone from this repo and its registry row is removed immediately — no control-plane redeploy involved.` : 'Merges the pull request into main as-is, without a code review step here. "Edit code" becomes available for it right away — it stays a draft, invisible to merchants, until you publish it below.',
|
|
196
|
-
primaryActions: { text: "Merge", close: !0, variant: "primary" },
|
|
197
|
-
secondaryActions: { text: "Cancel", close: !0, variant: "tertiary" }
|
|
198
|
-
}).onPrimary(() => void I(e));
|
|
199
|
-
}
|
|
200
|
-
function g(e) {
|
|
201
|
-
b.open({
|
|
202
|
-
title: `Reject — ${e.kind === "delete" ? "delete" : "create"} ${e.appTemplateId}?`,
|
|
203
|
-
message: "Closes the pull request without merging and deletes its branch. Nothing of this change is kept.",
|
|
204
|
-
primaryActions: { text: "Reject", close: !0, variant: "destructive" },
|
|
205
|
-
secondaryActions: { text: "Cancel", close: !0, variant: "tertiary" }
|
|
206
|
-
}).onPrimary(() => void S(e));
|
|
207
|
-
}
|
|
208
|
-
const j = o(null);
|
|
209
|
-
async function G(e) {
|
|
210
|
-
j.value = e, d.value = "";
|
|
211
|
-
try {
|
|
212
|
-
await C(k.deleteAppTemplate(e), { method: "POST" }), await $();
|
|
213
|
-
} catch (l) {
|
|
214
|
-
d.value = T(l);
|
|
215
|
-
} finally {
|
|
216
|
-
j.value = null;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
function H(e) {
|
|
220
|
-
b.open({
|
|
221
|
-
title: `Delete ${e}?`,
|
|
222
|
-
message: `Opens a pull request removing templates/${e}/ and its catalog entry. Nothing is deleted until that PR is reviewed and merged — refused outright if any project still uses this template.`,
|
|
223
|
-
primaryActions: { text: "Delete", close: !0, variant: "destructive" },
|
|
224
|
-
secondaryActions: { text: "Cancel", close: !0, variant: "tertiary" }
|
|
225
|
-
}).onPrimary(() => void G(e));
|
|
226
|
-
}
|
|
227
|
-
const N = o(null);
|
|
228
|
-
async function U(e, l) {
|
|
229
|
-
N.value = e, d.value = "";
|
|
230
|
-
try {
|
|
231
|
-
const r = l ? k.publishAppTemplate(e) : k.unpublishAppTemplate(e);
|
|
232
|
-
await C(r, { method: "POST" }), await w();
|
|
233
|
-
} catch (r) {
|
|
234
|
-
d.value = T(r);
|
|
235
|
-
} finally {
|
|
236
|
-
N.value = null;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
function J(e) {
|
|
240
|
-
b.open({
|
|
241
|
-
title: `Unpublish ${e.id}?`,
|
|
242
|
-
message: "Stops offering it to new merchants immediately. Merchants already provisioned from it are unaffected.",
|
|
243
|
-
primaryActions: { text: "Unpublish", close: !0, variant: "destructive" },
|
|
244
|
-
secondaryActions: { text: "Cancel", close: !0, variant: "tertiary" }
|
|
245
|
-
}).onPrimary(() => void U(e.id, !1));
|
|
246
|
-
}
|
|
247
|
-
X(() => void f());
|
|
248
|
-
async function W(e) {
|
|
249
|
-
if (!_.value) {
|
|
250
|
-
_.value = e, d.value = "";
|
|
251
|
-
try {
|
|
252
|
-
const l = await C(
|
|
253
|
-
k.appTemplateEditingProject(e),
|
|
254
|
-
{ method: "POST" }
|
|
255
|
-
);
|
|
256
|
-
await E.push({
|
|
257
|
-
name: "miniprogram-v2-project",
|
|
258
|
-
params: { projectId: l.projectId, view: "workspace" },
|
|
259
|
-
query: { tpl: "1" }
|
|
260
|
-
});
|
|
261
|
-
} catch (l) {
|
|
262
|
-
d.value = T(l);
|
|
263
|
-
} finally {
|
|
264
|
-
_.value = null;
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
return (e, l) => {
|
|
269
|
-
const r = F("FmButton");
|
|
270
|
-
return s(), i("div", ne, [
|
|
271
|
-
a("div", oe, [
|
|
272
|
-
a("header", re, [
|
|
273
|
-
l[1] || (l[1] = a("div", null, [
|
|
274
|
-
a("p", { class: "portal-eyebrow" }, "Internal"),
|
|
275
|
-
a("h1", null, "Template library")
|
|
276
|
-
], -1)),
|
|
277
|
-
a("div", ue, [
|
|
278
|
-
c(r, {
|
|
279
|
-
label: "Create template",
|
|
280
|
-
variant: "primary",
|
|
281
|
-
onClick: l[0] || (l[0] = (t) => n())
|
|
282
|
-
})
|
|
283
|
-
])
|
|
284
|
-
]),
|
|
285
|
-
d.value ? (s(), i("p", de, u(d.value), 1)) : v("", !0),
|
|
286
|
-
m.value || A.value.length > 0 ? (s(), i("section", ce, [
|
|
287
|
-
a("div", pe, [
|
|
288
|
-
l[2] || (l[2] = a("h2", { class: "template-section-title" }, "In review", -1)),
|
|
289
|
-
c(r, {
|
|
290
|
-
label: "Refresh",
|
|
291
|
-
variant: "tertiary",
|
|
292
|
-
size: "md",
|
|
293
|
-
loading: q.value,
|
|
294
|
-
onClick: $
|
|
295
|
-
}, null, 8, ["loading"])
|
|
296
|
-
]),
|
|
297
|
-
l[3] || (l[3] = a("p", { class: "template-section-note" }, " Waiting on PR review and merge. A row disappears on its own once its pull request merges or is closed — click Refresh to check. ", -1)),
|
|
298
|
-
m.value ? (s(), i("p", me, [
|
|
299
|
-
R(u(m.value) + " ", 1),
|
|
300
|
-
c(r, {
|
|
301
|
-
label: "Retry",
|
|
302
|
-
variant: "tertiary",
|
|
303
|
-
onClick: $
|
|
304
|
-
})
|
|
305
|
-
])) : v("", !0),
|
|
306
|
-
A.value.length > 0 ? (s(), i("section", ve, [
|
|
307
|
-
(s(!0), i(x, null, M(A.value, (t) => (s(), i("article", {
|
|
308
|
-
key: t.pullRequestNumber,
|
|
309
|
-
class: "template-choices__row"
|
|
310
|
-
}, [
|
|
311
|
-
a("div", he, [
|
|
312
|
-
a("span", ge, [
|
|
313
|
-
R(u(t.appTemplateId), 1),
|
|
314
|
-
t.kind === "delete" ? (s(), i("span", be, " · Delete")) : v("", !0)
|
|
315
|
-
]),
|
|
316
|
-
a("span", _e, "Awaiting review — PR #" + u(t.pullRequestNumber), 1)
|
|
317
|
-
]),
|
|
318
|
-
a("div", fe, [
|
|
319
|
-
a("a", {
|
|
320
|
-
class: "template-review-link",
|
|
321
|
-
href: t.pullRequestUrl,
|
|
322
|
-
target: "_blank",
|
|
323
|
-
rel: "noopener"
|
|
324
|
-
}, "Review PR", 8, ye),
|
|
325
|
-
c(r, {
|
|
326
|
-
label: "Merge",
|
|
327
|
-
variant: "primary",
|
|
328
|
-
loading: h.value === t.pullRequestNumber,
|
|
329
|
-
disabled: h.value !== null,
|
|
330
|
-
onClick: (D) => O(t)
|
|
331
|
-
}, null, 8, ["loading", "disabled", "onClick"]),
|
|
332
|
-
c(r, {
|
|
333
|
-
label: "Reject",
|
|
334
|
-
variant: "destructive",
|
|
335
|
-
disabled: h.value !== null,
|
|
336
|
-
onClick: (D) => g(t)
|
|
337
|
-
}, null, 8, ["disabled", "onClick"])
|
|
338
|
-
])
|
|
339
|
-
]))), 128))
|
|
340
|
-
])) : v("", !0)
|
|
341
|
-
])) : v("", !0),
|
|
342
|
-
a("div", ke, [
|
|
343
|
-
l[4] || (l[4] = a("h2", { class: "template-section-title" }, "Physical templates", -1)),
|
|
344
|
-
c(r, {
|
|
345
|
-
label: "Refresh",
|
|
346
|
-
variant: "tertiary",
|
|
347
|
-
size: "md",
|
|
348
|
-
loading: p.value,
|
|
349
|
-
onClick: w
|
|
350
|
-
}, null, 8, ["loading"])
|
|
351
|
-
]),
|
|
352
|
-
l[5] || (l[5] = a("p", { class: "template-section-note" }, ' "Edit code" opens the physical template directly — the same chat + live preview a merchant project gets, saving straight to a pull request against this repo instead of a merchant repo. A draft is invisible to merchants until Published; "Delete" opens a PR removing it instead — refused outright for the default template or one any project still uses. ', -1)),
|
|
353
|
-
y.value ? (s(), i("p", we, [
|
|
354
|
-
R(u(y.value) + " ", 1),
|
|
355
|
-
c(r, {
|
|
356
|
-
label: "Retry",
|
|
357
|
-
variant: "tertiary",
|
|
358
|
-
onClick: w
|
|
359
|
-
})
|
|
360
|
-
])) : v("", !0),
|
|
361
|
-
a("section", Ce, [
|
|
362
|
-
(s(!0), i(x, null, M(P.value, (t) => (s(), i("article", {
|
|
363
|
-
key: t.id,
|
|
364
|
-
class: "template-choices__row"
|
|
365
|
-
}, [
|
|
366
|
-
a("div", Te, [
|
|
367
|
-
a("span", Re, [
|
|
368
|
-
R(u(t.label), 1),
|
|
369
|
-
t.default ? (s(), i("span", Pe, " · Default")) : v("", !0)
|
|
370
|
-
]),
|
|
371
|
-
a("span", Ae, u(t.id), 1),
|
|
372
|
-
a("span", qe, [
|
|
373
|
-
t.restaurantStyle ? (s(), i(x, { key: 0 }, [
|
|
374
|
-
R(u(t.restaurantStyle) + " · ", 1)
|
|
375
|
-
], 64)) : v("", !0),
|
|
376
|
-
R(u(t.industries.join(", ") || "General-purpose") + " · " + u(t.environments.join(", ")), 1)
|
|
377
|
-
])
|
|
378
|
-
]),
|
|
379
|
-
t.pullRequestNumber ? (s(), i("span", $e, " Awaiting merge — PR #" + u(t.pullRequestNumber), 1)) : (s(), i("span", {
|
|
380
|
-
key: 1,
|
|
381
|
-
class: Y(["template-status-badge", `template-status-badge--${t.status}`])
|
|
382
|
-
}, u(t.status === "published" ? "Published" : "Draft"), 3)),
|
|
383
|
-
a("div", Ne, [
|
|
384
|
-
t.pullRequestNumber ? v("", !0) : (s(), i(x, { key: 0 }, [
|
|
385
|
-
t.status === "draft" ? (s(), V(r, {
|
|
386
|
-
key: 0,
|
|
387
|
-
label: "Publish",
|
|
388
|
-
variant: "primary",
|
|
389
|
-
loading: N.value === t.id,
|
|
390
|
-
disabled: N.value !== null,
|
|
391
|
-
onClick: (D) => U(t.id, !0)
|
|
392
|
-
}, null, 8, ["loading", "disabled", "onClick"])) : t.default ? v("", !0) : (s(), V(r, {
|
|
393
|
-
key: 1,
|
|
394
|
-
label: "Unpublish",
|
|
395
|
-
variant: "secondary",
|
|
396
|
-
loading: N.value === t.id,
|
|
397
|
-
disabled: N.value !== null,
|
|
398
|
-
onClick: (D) => J(t)
|
|
399
|
-
}, null, 8, ["loading", "disabled", "onClick"])),
|
|
400
|
-
c(r, {
|
|
401
|
-
label: "Edit code",
|
|
402
|
-
variant: "secondary",
|
|
403
|
-
loading: _.value === t.id,
|
|
404
|
-
disabled: _.value !== null,
|
|
405
|
-
onClick: (D) => W(t.id)
|
|
406
|
-
}, null, 8, ["loading", "disabled", "onClick"])
|
|
407
|
-
], 64)),
|
|
408
|
-
!t.default && !t.pullRequestNumber ? (s(), V(r, {
|
|
409
|
-
key: 1,
|
|
410
|
-
label: "Delete",
|
|
411
|
-
variant: "destructive",
|
|
412
|
-
loading: j.value === t.id,
|
|
413
|
-
disabled: j.value !== null,
|
|
414
|
-
onClick: (D) => H(t.id)
|
|
415
|
-
}, null, 8, ["loading", "disabled", "onClick"])) : v("", !0)
|
|
416
|
-
])
|
|
417
|
-
]))), 128))
|
|
418
|
-
])
|
|
419
|
-
])
|
|
420
|
-
]);
|
|
421
|
-
};
|
|
422
|
-
}
|
|
423
|
-
}), Se = /* @__PURE__ */ L(xe, [["__scopeId", "data-v-ebc2562e"]]);
|
|
424
|
-
export {
|
|
425
|
-
Se as default
|
|
426
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { a as o } from "./routes-CeuodIgg.js";
|
|
2
|
-
import { ref as i } from "vue";
|
|
3
|
-
import { c as u } from "./controlPlane-sXaC6pAh.js";
|
|
4
|
-
function s(t, e) {
|
|
5
|
-
if (typeof window > "u") return e;
|
|
6
|
-
try {
|
|
7
|
-
const n = window.localStorage.getItem(t);
|
|
8
|
-
return n === null ? e : n === "1";
|
|
9
|
-
} catch {
|
|
10
|
-
return e;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
function l(t, e) {
|
|
14
|
-
if (typeof window > "u") return e;
|
|
15
|
-
try {
|
|
16
|
-
const n = Number(window.localStorage.getItem(t));
|
|
17
|
-
return Number.isFinite(n) ? n : e;
|
|
18
|
-
} catch {
|
|
19
|
-
return e;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
function a(t, e) {
|
|
23
|
-
if (!(typeof window > "u"))
|
|
24
|
-
try {
|
|
25
|
-
window.localStorage.setItem(t, e);
|
|
26
|
-
} catch {
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
function w(t, e) {
|
|
30
|
-
a(t, e ? "1" : "0");
|
|
31
|
-
}
|
|
32
|
-
let r = null;
|
|
33
|
-
function d() {
|
|
34
|
-
return r || (r = u(o.adminWhoami()).then((t) => t.isAdmin).catch(() => !1)), r;
|
|
35
|
-
}
|
|
36
|
-
function h() {
|
|
37
|
-
const t = i(!1);
|
|
38
|
-
return d().then((e) => {
|
|
39
|
-
t.value = e;
|
|
40
|
-
}), t;
|
|
41
|
-
}
|
|
42
|
-
export {
|
|
43
|
-
l as a,
|
|
44
|
-
a as b,
|
|
45
|
-
s as r,
|
|
46
|
-
h as u,
|
|
47
|
-
w
|
|
48
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
function a(r) {
|
|
2
|
-
return r === "releases" || r === "sessions" ? r : "workspace";
|
|
3
|
-
}
|
|
4
|
-
function o(r) {
|
|
5
|
-
const { view: n, ...e } = r;
|
|
6
|
-
return e;
|
|
7
|
-
}
|
|
8
|
-
function i(r, n, e) {
|
|
9
|
-
return {
|
|
10
|
-
name: "miniprogram-v2-project",
|
|
11
|
-
params: { projectId: r, view: n === "workspace" ? void 0 : n },
|
|
12
|
-
query: o(e)
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
function c(r, n, e) {
|
|
16
|
-
if (!n || !e || n === e || r.name !== "miniprogram-v2-project" || r.query.tpl === "1") return null;
|
|
17
|
-
const t = o(r.query);
|
|
18
|
-
return typeof t.businessId == "string" && (t.businessId = e), { name: "miniprogram-v2-mobile-projects", query: t };
|
|
19
|
-
}
|
|
20
|
-
function u(r, n = "settings") {
|
|
21
|
-
const e = new URLSearchParams();
|
|
22
|
-
for (const t of ["businessId", "country", "restaurantId"]) {
|
|
23
|
-
const s = r[t];
|
|
24
|
-
typeof s == "string" && e.set(t, s);
|
|
25
|
-
}
|
|
26
|
-
return `/brand/${n}${e.size ? `?${e}` : ""}`;
|
|
27
|
-
}
|
|
28
|
-
export {
|
|
29
|
-
a,
|
|
30
|
-
c as e,
|
|
31
|
-
u as l,
|
|
32
|
-
o as p,
|
|
33
|
-
i as w
|
|
34
|
-
};
|
|
@@ -1,124 +0,0 @@
|
|
|
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-CeuodIgg.js";
|
|
3
|
-
import { c as M, e as y, m as $ } from "./controlPlane-sXaC6pAh.js";
|
|
4
|
-
const I = { class: "flex min-h-0 flex-1 flex-col items-center justify-center gap-8 p-24 text-center" }, T = {
|
|
5
|
-
key: 0,
|
|
6
|
-
class: "m-0 max-w-[46ch] fm-typo-en-body-sm-400 text-portal-text-muted"
|
|
7
|
-
}, j = /* @__PURE__ */ x({
|
|
8
|
-
__name: "ModuleEmptyState",
|
|
9
|
-
props: {
|
|
10
|
-
icon: {},
|
|
11
|
-
title: {},
|
|
12
|
-
message: {},
|
|
13
|
-
actionLabel: {},
|
|
14
|
-
tone: {}
|
|
15
|
-
},
|
|
16
|
-
emits: ["action"],
|
|
17
|
-
setup(e) {
|
|
18
|
-
return (t, o) => {
|
|
19
|
-
const n = p("FmIcon"), l = p("FmButton");
|
|
20
|
-
return u(), h("div", I, [
|
|
21
|
-
E(n, {
|
|
22
|
-
name: e.icon,
|
|
23
|
-
size: "xl",
|
|
24
|
-
color: e.tone === "error" ? "typo-warning" : "neutral-gray-300"
|
|
25
|
-
}, null, 8, ["name", "color"]),
|
|
26
|
-
P("p", {
|
|
27
|
-
class: F(["m-0 fm-typo-en-body-md-600", e.tone === "error" ? "text-fm-color-typo-warning" : "text-fm-color-typo-secondary"])
|
|
28
|
-
}, v(e.title), 3),
|
|
29
|
-
e.message ? (u(), h("p", T, v(e.message), 1)) : g("", !0),
|
|
30
|
-
e.actionLabel ? (u(), L(l, {
|
|
31
|
-
key: 1,
|
|
32
|
-
size: "md",
|
|
33
|
-
variant: "secondary",
|
|
34
|
-
label: e.actionLabel,
|
|
35
|
-
onClick: o[0] || (o[0] = (c) => t.$emit("action"))
|
|
36
|
-
}, null, 8, ["label"])) : g("", !0)
|
|
37
|
-
]);
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
}), b = ["tier", "slot"];
|
|
41
|
-
function C(e, t) {
|
|
42
|
-
return t === "tier" ? [e.category] : e.slot ? [e.slot] : [];
|
|
43
|
-
}
|
|
44
|
-
function z(e) {
|
|
45
|
-
return b.map((t) => ({
|
|
46
|
-
kind: t,
|
|
47
|
-
values: [...new Set(e.flatMap((o) => C(o, t)))].sort((o, n) => o.localeCompare(n))
|
|
48
|
-
})).filter((t) => t.values.length > 0);
|
|
49
|
-
}
|
|
50
|
-
function R(e, t) {
|
|
51
|
-
const o = e.filter((n) => !(n.kind === t.kind && n.value === t.value));
|
|
52
|
-
return o.length === e.length ? [...e, t] : o;
|
|
53
|
-
}
|
|
54
|
-
function B(e, t) {
|
|
55
|
-
return b.every((o) => {
|
|
56
|
-
const n = t.filter((c) => c.kind === o);
|
|
57
|
-
if (!n.length) return !0;
|
|
58
|
-
const l = C(e, o);
|
|
59
|
-
return n.some((c) => l.includes(c.value));
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
function G(e, t, o = []) {
|
|
63
|
-
const n = t.trim().toLowerCase();
|
|
64
|
-
return e.filter((l) => B(l, o) ? n ? [l.name, l.description ?? "", l.slot ?? "", ...l.labels ?? []].join(" ").toLowerCase().includes(n) : !0 : !1);
|
|
65
|
-
}
|
|
66
|
-
function O(e) {
|
|
67
|
-
const t = e.slot ? ` It is published to fill the ${e.slot} slot.` : "";
|
|
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.`;
|
|
69
|
-
}
|
|
70
|
-
function U(e, t) {
|
|
71
|
-
if (!e.includes("</head>")) return e;
|
|
72
|
-
const o = JSON.stringify(t).replace(/</g, "\\u003c");
|
|
73
|
-
return e.replace("</head>", `<script>window.__FM_PREVIEW_MODULE__=${o}<\/script></head>`);
|
|
74
|
-
}
|
|
75
|
-
const i = s(null), m = s(null), d = s(!1), k = s(null), f = s(null);
|
|
76
|
-
let a = null;
|
|
77
|
-
async function D() {
|
|
78
|
-
m.value = null, d.value = !1;
|
|
79
|
-
try {
|
|
80
|
-
const e = await M(w.componentLibraryCatalog());
|
|
81
|
-
i.value = e.components ?? [];
|
|
82
|
-
} catch (e) {
|
|
83
|
-
const t = y(e);
|
|
84
|
-
i.value = [], t.includes("no component library has been published") ? d.value = !0 : m.value = t || "Could not load the module library.";
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
async function N() {
|
|
88
|
-
f.value = null;
|
|
89
|
-
try {
|
|
90
|
-
k.value = await $(w.componentLibraryPreview());
|
|
91
|
-
} catch (e) {
|
|
92
|
-
f.value = y(e) || "Could not load the preview document.";
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
function A() {
|
|
96
|
-
function e(o = !1) {
|
|
97
|
-
return !o && (i.value !== null || a) ? a ?? Promise.resolve() : (a = Promise.all([D(), N()]).then(() => {
|
|
98
|
-
}).finally(() => {
|
|
99
|
-
a = null;
|
|
100
|
-
}), a);
|
|
101
|
-
}
|
|
102
|
-
function t(o) {
|
|
103
|
-
var n;
|
|
104
|
-
return ((n = i.value) == null ? void 0 : n.find((l) => l.name === o)) ?? null;
|
|
105
|
-
}
|
|
106
|
-
return {
|
|
107
|
-
entries: r(i),
|
|
108
|
-
loadError: r(m),
|
|
109
|
-
unpublished: r(d),
|
|
110
|
-
previewDocument: r(k),
|
|
111
|
-
previewError: r(f),
|
|
112
|
-
load: e,
|
|
113
|
-
find: t
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
export {
|
|
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
|
|
124
|
-
};
|