@feedmepos/mf-miniprogram-v2 0.2.2-dev.23 → 0.2.2-dev.25
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-BVQ9oPjV.js → App-CfZCp6Re.js} +2 -2
- package/dist/{ControlPlaneView-BPaHROu_.js → ControlPlaneView-C9PhpGVm.js} +3 -3
- package/dist/{EcosystemView-Drggj4cB.js → EcosystemView-DgAgcFmd.js} +2 -2
- package/dist/{MobileProjectsView-DaFYj3UE.js → MobileProjectsView-D-tXKwr7.js} +2 -2
- package/dist/{ModuleCenterView-BI0Vbkcu.js → ModuleCenterView-C6mCPATr.js} +1 -1
- package/dist/{ModuleDetailView-DKmc4Hp2.js → ModuleDetailView-CSfMF0Uo.js} +1 -1
- package/dist/{PagesView-B9YEpCbi.js → PagesView-B1uTuHsK.js} +1 -1
- package/dist/{PortalSettingsView-C3uVMGH5.js → PortalSettingsView-CUOL2tdF.js} +1 -1
- package/dist/TemplateCenterView-DqZLthqh.js +426 -0
- package/dist/{WorkspaceEntryView-C5SWhNI5.js → WorkspaceEntryView-BNl0REzn.js} +1 -1
- package/dist/{adminAccess-D8Cx7BcO.js → adminAccess-oXC0xjvK.js} +1 -1
- package/dist/app.js +10 -10
- package/dist/package.json +1 -1
- package/dist/{portalContext-Bhp7NA0c.js → portalContext-DV-6uUwp.js} +1 -1
- package/dist/{routes-DPGrYgQQ.js → routes-CeuodIgg.js} +44 -34
- package/dist/style.css +1 -1
- package/dist/{useModuleCatalog-CnFFvrBk.js → useModuleCatalog-Cep-pzWO.js} +1 -1
- package/package.json +1 -1
- package/dist/TemplateCenterView-DcVMSYU0.js +0 -395
|
@@ -2,8 +2,8 @@ import { defineComponent as N, computed as y, ref as q, onMounted as V, onBefore
|
|
|
2
2
|
import { useCoreStore as $ } from "@feedmepos/mf-common";
|
|
3
3
|
import { useRoute as D, RouterView as G } from "vue-router";
|
|
4
4
|
import { P as c } from "./PortalIcon-DO0VrIoY.js";
|
|
5
|
-
import { r as I, u as Q, w as L } from "./adminAccess-
|
|
6
|
-
import { p as U } from "./portalContext-
|
|
5
|
+
import { r as I, u as Q, w as L } from "./adminAccess-oXC0xjvK.js";
|
|
6
|
+
import { p as U } from "./portalContext-DV-6uUwp.js";
|
|
7
7
|
import { p as d } from "./portalNavigation-DKCfwTH8.js";
|
|
8
8
|
import { t as H } from "./templatePickerFlag-CosY_15R.js";
|
|
9
9
|
import { _ as J } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
@@ -10,10 +10,10 @@ import { r as Ul, a as eu, b as tu, s as Ua, c as qa, p as nu, A as ru, d as au,
|
|
|
10
10
|
import { _ as ql, B as iu } from "./BrandFontPicker-kQKWf1hL.js";
|
|
11
11
|
import { g as lu, C as Ss, F as Ts, u as Es, i as Fl, a as ou, t as cu } from "./useBrandKit-CkdPQRE-.js";
|
|
12
12
|
import { _ as Bt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
|
-
import { r as uu, w as du, a as pu, u as fu, b as ii } from "./adminAccess-
|
|
14
|
-
import { a as Ve } from "./routes-
|
|
13
|
+
import { r as uu, w as du, a as pu, u as fu, b as ii } from "./adminAccess-oXC0xjvK.js";
|
|
14
|
+
import { a as Ve } from "./routes-CeuodIgg.js";
|
|
15
15
|
import { _ as vn } from "./StatusBadge.vue_vue_type_script_setup_true_lang-CMgQ0bd_.js";
|
|
16
|
-
import { u as hu } from "./portalContext-
|
|
16
|
+
import { u as hu } from "./portalContext-DV-6uUwp.js";
|
|
17
17
|
import { a as mu, w as gu } from "./portalNavigation-DKCfwTH8.js";
|
|
18
18
|
import { t as Fa } from "./templatePickerFlag-CosY_15R.js";
|
|
19
19
|
import { useRoute as li, useRouter as yu } from "vue-router";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as b, computed as p, ref as w, onMounted as D, onScopeDispose as A, resolveComponent as B, openBlock as c, createElementBlock as a, createElementVNode as C, toDisplayString as l, unref as r, Fragment as Z, renderList as E, normalizeStyle as U, createVNode as d, withCtx as H, createTextVNode as g, createCommentVNode as G } from "vue";
|
|
2
2
|
import { useRoute as S } from "vue-router";
|
|
3
|
-
import { a as O } from "./routes-
|
|
3
|
+
import { a as O } from "./routes-CeuodIgg.js";
|
|
4
4
|
import { b as j, c as N, e as q } from "./controlPlane-sXaC6pAh.js";
|
|
5
|
-
import { u as I } from "./portalContext-
|
|
5
|
+
import { u as I } from "./portalContext-DV-6uUwp.js";
|
|
6
6
|
import { p as u } from "./portalNavigation-DKCfwTH8.js";
|
|
7
7
|
import { i as R, u as T } from "./useBrandKit-CkdPQRE-.js";
|
|
8
8
|
import { _ as K } from "./StatusBadge.vue_vue_type_script_setup_true_lang-CMgQ0bd_.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as $, ref as f, onMounted as q, resolveComponent as w, openBlock as l, createBlock as R, withCtx as L, createVNode as g, createElementVNode as c, toDisplayString as N, unref as h, createElementBlock as b, Fragment as O, createCommentVNode as S, computed as E, h as a, withModifiers as T, onScopeDispose as Y, createTextVNode as z } from "vue";
|
|
2
2
|
import { useRoute as H, useRouter as J } from "vue-router";
|
|
3
3
|
import { components as G, useDialog as K } from "@feedmepos/ui-library";
|
|
4
|
-
import { a as P } from "./routes-
|
|
4
|
+
import { a as P } from "./routes-CeuodIgg.js";
|
|
5
5
|
import { c as M, e as B, a as Q } from "./controlPlane-sXaC6pAh.js";
|
|
6
|
-
import { u as W } from "./portalContext-
|
|
6
|
+
import { u as W } from "./portalContext-DV-6uUwp.js";
|
|
7
7
|
import { w as F } from "./portalNavigation-DKCfwTH8.js";
|
|
8
8
|
import { A as X, p as Z } from "./AppTemplatePicker-CNJ6kIJk.js";
|
|
9
9
|
import { m as ee } from "./index-CIJWcl_6.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as F, openBlock as e, createElementBlock as n, createElementVNode as o, toDisplayString as d, createCommentVNode as k, ref as w, computed as m, onMounted as q, resolveComponent as f, createVNode as p, unref as i, Fragment as v, renderList as b, normalizeClass as A, createBlock as y, withCtx as R } from "vue";
|
|
2
2
|
import { useRoute as z } from "vue-router";
|
|
3
3
|
import { _ as T } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
-
import { u as D, c as G, f as K, _ as h, t as O } from "./useModuleCatalog-
|
|
4
|
+
import { u as D, c as G, f as K, _ as h, t as O } from "./useModuleCatalog-Cep-pzWO.js";
|
|
5
5
|
const P = { class: "card" }, U = { class: "card__head" }, j = { class: "card__name fm-typo-en-body-md-600 text-portal-text-primary" }, H = { class: "card__version fm-typo-en-body-sm-400 text-portal-text-muted" }, J = { class: "card__description fm-typo-en-body-sm-400 text-portal-text-muted" }, Q = { class: "card__tags" }, W = { class: "card__tag card__tag--tier fm-typo-en-body-sm-600" }, X = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "card__tag card__tag--slot fm-typo-en-body-sm-400"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as C, ref as M, computed as u, watch as T, resolveComponent as g, openBlock as n, createElementBlock as l, createElementVNode as e, toDisplayString as i, createCommentVNode as _, Fragment as I, renderList as S, createVNode as k, onMounted as B, unref as d, withCtx as L, createBlock as v } from "vue";
|
|
2
2
|
import { useRoute as N, useRouter as P } from "vue-router";
|
|
3
|
-
import { m as q, i as A, u as F, _ as w } from "./useModuleCatalog-
|
|
3
|
+
import { m as q, i as A, u as F, _ as w } from "./useModuleCatalog-Cep-pzWO.js";
|
|
4
4
|
import { useDialog as V } from "@feedmepos/ui-library";
|
|
5
5
|
import { _ as E } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
6
|
const R = { class: "detail" }, j = { class: "detail__head" }, z = { class: "detail__name fm-typo-en-title-sm-600 text-portal-text-primary" }, K = { class: "detail__version fm-typo-en-body-md-400 text-portal-text-muted" }, O = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as p, resolveComponent as i, openBlock as l, createElementBlock as m, createElementVNode as o, createVNode as r, unref as t, withCtx as u, createTextVNode as c } from "vue";
|
|
2
2
|
import { useRoute as d } from "vue-router";
|
|
3
|
-
import { u as g } from "./portalContext-
|
|
3
|
+
import { u as g } from "./portalContext-DV-6uUwp.js";
|
|
4
4
|
import { w as f } from "./portalNavigation-DKCfwTH8.js";
|
|
5
5
|
import { P as k } from "./PortalIcon-DO0VrIoY.js";
|
|
6
6
|
const w = { class: "portal-page" }, y = { class: "portal-page-inner" }, b = { class: "portal-section portal-empty" }, E = /* @__PURE__ */ p({
|
|
@@ -3,7 +3,7 @@ import { useRoute as N } from "vue-router";
|
|
|
3
3
|
import { e as _, a as $ } from "./index-CIJWcl_6.js";
|
|
4
4
|
import { l as B, e as E } from "./controlPlane-sXaC6pAh.js";
|
|
5
5
|
import { useCoreStore as F } from "@feedmepos/mf-common";
|
|
6
|
-
import { u as U } from "./portalContext-
|
|
6
|
+
import { u as U } from "./portalContext-DV-6uUwp.js";
|
|
7
7
|
import { l as V } from "./portalNavigation-DKCfwTH8.js";
|
|
8
8
|
import { _ as q } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
9
|
const L = { class: "portal-page" }, R = { class: "portal-page-inner settings-page" }, T = { class: "portal-page-heading" }, D = ["href"], H = {
|
|
@@ -0,0 +1,426 @@
|
|
|
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,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as s, watchEffect as a, openBlock as n, createElementBlock as p } from "vue";
|
|
2
2
|
import { useRoute as u, useRouter as i } from "vue-router";
|
|
3
|
-
import { u as l } from "./portalContext-
|
|
3
|
+
import { u as l } from "./portalContext-DV-6uUwp.js";
|
|
4
4
|
import { w as m, a as f } from "./portalNavigation-DKCfwTH8.js";
|
|
5
5
|
const _ = {
|
|
6
6
|
class: "portal-loading",
|
package/dist/app.js
CHANGED
|
@@ -4,24 +4,24 @@ const o = [
|
|
|
4
4
|
path: "/platforms/mobile",
|
|
5
5
|
name: "miniprogram-v2-mobile-projects",
|
|
6
6
|
meta: { title: "Mobile" },
|
|
7
|
-
component: () => import("./MobileProjectsView-
|
|
7
|
+
component: () => import("./MobileProjectsView-D-tXKwr7.js")
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
path: "/",
|
|
11
11
|
name: "miniprogram-v2-ecosystem",
|
|
12
12
|
meta: { title: "Ecosystem" },
|
|
13
13
|
beforeEnter: (e) => ["workspace", "releases", "sessions"].includes(String(e.query.view)) ? { name: "miniprogram-v2-control", query: e.query } : !0,
|
|
14
|
-
component: () => import("./EcosystemView-
|
|
14
|
+
component: () => import("./EcosystemView-DgAgcFmd.js")
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
path: "/workspace",
|
|
18
18
|
name: "miniprogram-v2-control",
|
|
19
|
-
component: () => import("./WorkspaceEntryView-
|
|
19
|
+
component: () => import("./WorkspaceEntryView-BNl0REzn.js")
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
path: "/p/:projectId/:view(workspace|releases|sessions)?",
|
|
23
23
|
name: "miniprogram-v2-project",
|
|
24
|
-
component: () => import("./ControlPlaneView-
|
|
24
|
+
component: () => import("./ControlPlaneView-C9PhpGVm.js")
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
path: "/brand-kit",
|
|
@@ -33,13 +33,13 @@ const o = [
|
|
|
33
33
|
path: "/pages",
|
|
34
34
|
name: "miniprogram-v2-pages",
|
|
35
35
|
meta: { title: "Pages" },
|
|
36
|
-
component: () => import("./PagesView-
|
|
36
|
+
component: () => import("./PagesView-B1uTuHsK.js")
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
path: "/settings",
|
|
40
40
|
name: "miniprogram-v2-settings",
|
|
41
41
|
meta: { title: "Settings" },
|
|
42
|
-
component: () => import("./PortalSettingsView-
|
|
42
|
+
component: () => import("./PortalSettingsView-CUOL2tdF.js")
|
|
43
43
|
},
|
|
44
44
|
...["tablet", "kiosk"].map((e) => ({
|
|
45
45
|
path: `/platforms/${e}`,
|
|
@@ -53,7 +53,7 @@ const o = [
|
|
|
53
53
|
path: "/modules",
|
|
54
54
|
name: "miniprogram-v2-module-center",
|
|
55
55
|
meta: { title: "Module library" },
|
|
56
|
-
component: () => import("./ModuleCenterView-
|
|
56
|
+
component: () => import("./ModuleCenterView-C6mCPATr.js")
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
// Keyed by the module's directory name, which is what the catalog, the
|
|
@@ -61,7 +61,7 @@ const o = [
|
|
|
61
61
|
path: "/modules/:name",
|
|
62
62
|
name: "miniprogram-v2-module-detail",
|
|
63
63
|
meta: { title: "Module library" },
|
|
64
|
-
component: () => import("./ModuleDetailView-
|
|
64
|
+
component: () => import("./ModuleDetailView-CSfMF0Uo.js")
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
67
|
// Internal-only: linked from the main nav (App.vue), but only once
|
|
@@ -72,13 +72,13 @@ const o = [
|
|
|
72
72
|
path: "/internal/template-center",
|
|
73
73
|
name: "miniprogram-v2-template-center",
|
|
74
74
|
meta: { title: "Template library", requiresAdmin: !0 },
|
|
75
|
-
component: () => import("./TemplateCenterView-
|
|
75
|
+
component: () => import("./TemplateCenterView-DqZLthqh.js")
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
path: "/:pathMatch(.*)*",
|
|
79
79
|
redirect: (e) => ({ name: "miniprogram-v2-ecosystem", query: e.query, params: {} })
|
|
80
80
|
}
|
|
81
|
-
], r = {}, a = t(() => import("./App-
|
|
81
|
+
], r = {}, a = t(() => import("./App-CfZCp6Re.js")), i = t(() => import("./LegacyWorkspaceEntry-lEMtmdIe.js"));
|
|
82
82
|
export {
|
|
83
83
|
a as FmApp,
|
|
84
84
|
i as MiniprogramWorkspace,
|
package/dist/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as b } from "./routes-
|
|
1
|
+
import { a as b } from "./routes-CeuodIgg.js";
|
|
2
2
|
import { useCoreStore as d } from "@feedmepos/mf-common";
|
|
3
3
|
import { c as g, e as h } from "./controlPlane-sXaC6pAh.js";
|
|
4
4
|
import { provide as y, computed as f, ref as c, watch as C, onScopeDispose as w, inject as x } from "vue";
|