@feedmepos/mf-miniprogram-v2 0.2.8-dev.2 → 0.2.8-dev.3
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-C8Vn8LvE.js → App-h0NGA3Bx.js} +267 -277
- package/dist/AppTemplatePicker.vue_vue_type_script_setup_true_lang-BeNabALJ.js +270 -0
- package/dist/{BrandFontPicker-JHyoGusq.js → BrandFontPicker-sTKNoOX3.js} +1 -1
- package/dist/{BrandKitView-Dlt_ifI0.js → BrandKitView-DpeuJ5Mj.js} +2 -2
- package/dist/{ControlPlaneView-qDA8RgiR.js → ControlPlaneView-7i6SXbEK.js} +5077 -4831
- package/dist/{EcosystemView-XP9IZ9wn.js → EcosystemView-BUG7Dp_e.js} +5 -5
- package/dist/MobileProjectsView-DP_MBdDX.js +400 -0
- package/dist/ModuleCenterView-DdExY27I.js +165 -0
- package/dist/{ModuleDetailView-CSfMF0Uo.js → ModuleDetailView-2ZG2PgWE.js} +1 -1
- package/dist/{PagesView-DzDqCd8N.js → PagesView-CNnihrLK.js} +2 -2
- package/dist/{PlatformUnavailableView-CdHjkolw.js → PlatformUnavailableView-ChSD6P3O.js} +1 -1
- package/dist/{PortalSettingsView-Df5jChmi.js → PortalSettingsView-tEQ8--VB.js} +9 -9
- package/dist/TemplateCenterView-BjuZj_3I.js +515 -0
- package/dist/{WorkspaceEntryView-DQkYJWdf.js → WorkspaceEntryView-aesHR5VT.js} +2 -2
- package/dist/{adminAccess-D2K-L-Vt.js → adminAccess-Bud1ltTs.js} +2 -2
- package/dist/app.js +12 -12
- package/dist/{controlPlane-sXaC6pAh.js → controlPlane--Q2ulw38.js} +7 -7
- package/dist/package.json +1 -1
- package/dist/{portalContext-DV-6uUwp.js → portalContext-CzdVaxBH.js} +2 -2
- package/dist/portalNavigation-L5VwKlps.js +42 -0
- package/dist/{routes-CeuodIgg.js → routes-CJa85dEy.js} +14 -3
- package/dist/style.css +1 -1
- package/dist/{useBrandKit-CXLIXo5j.js → useBrandKit-Cw3bBugv.js} +1 -1
- package/dist/{useModuleCatalog-Cep-pzWO.js → useModuleCatalog-n2zRBLFf.js} +2 -2
- package/package.json +1 -1
- package/dist/AppTemplatePicker.vue_vue_type_script_setup_true_lang-LE_aKvfg.js +0 -198
- package/dist/MobileProjectsView-aAyHV5G-.js +0 -333
- package/dist/ModuleCenterView-C6mCPATr.js +0 -147
- package/dist/TemplateCenterView-DrWImUYO.js +0 -425
- package/dist/portalNavigation-C29ihtq_.js +0 -38
|
@@ -1,147 +0,0 @@
|
|
|
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
|
-
import { useRoute as z } from "vue-router";
|
|
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-Cep-pzWO.js";
|
|
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
|
-
key: 0,
|
|
7
|
-
class: "card__tag card__tag--slot fm-typo-en-body-sm-400"
|
|
8
|
-
}, Y = /* @__PURE__ */ F({
|
|
9
|
-
__name: "ModuleCard",
|
|
10
|
-
props: {
|
|
11
|
-
entry: {}
|
|
12
|
-
},
|
|
13
|
-
setup(l) {
|
|
14
|
-
return (s, g) => (e(), n("article", P, [
|
|
15
|
-
o("header", U, [
|
|
16
|
-
o("h3", j, d(l.entry.name), 1),
|
|
17
|
-
o("span", H, d(l.entry.version), 1)
|
|
18
|
-
]),
|
|
19
|
-
o("p", J, d(l.entry.description || l.entry.id), 1),
|
|
20
|
-
o("footer", Q, [
|
|
21
|
-
o("span", W, d(l.entry.category), 1),
|
|
22
|
-
l.entry.slot ? (e(), n("span", X, d(l.entry.slot), 1)) : k("", !0)
|
|
23
|
-
])
|
|
24
|
-
]));
|
|
25
|
-
}
|
|
26
|
-
}), Z = /* @__PURE__ */ T(Y, [["__scopeId", "data-v-2fbfd7b3"]]), ee = { class: "shell" }, te = { class: "centre" }, oe = { class: "centre__inner" }, ne = { class: "centre__head" }, se = {
|
|
27
|
-
key: 0,
|
|
28
|
-
class: "centre__filters"
|
|
29
|
-
}, ae = { class: "centre__facet-label fm-typo-en-body-sm-600 text-portal-text-muted" }, le = { class: "centre__chips" }, re = ["aria-pressed", "onClick"], ie = {
|
|
30
|
-
key: 1,
|
|
31
|
-
class: "centre__note fm-typo-en-body-md-400"
|
|
32
|
-
}, de = {
|
|
33
|
-
key: 6,
|
|
34
|
-
class: "centre__grid"
|
|
35
|
-
}, ce = /* @__PURE__ */ F({
|
|
36
|
-
__name: "ModuleCenterView",
|
|
37
|
-
setup(l) {
|
|
38
|
-
const s = D(), g = z(), u = w(""), c = w([]), V = m(() => G(s.entries.value ?? [])), x = m(() => K(s.entries.value ?? [], u.value, c.value)), N = m(() => u.value.trim().length > 0 || c.value.length > 0), C = m(() => {
|
|
39
|
-
var r;
|
|
40
|
-
return (((r = s.entries.value) == null ? void 0 : r.length) ?? 0) > 0;
|
|
41
|
-
}), B = {
|
|
42
|
-
tier: "Type",
|
|
43
|
-
slot: "Slot"
|
|
44
|
-
};
|
|
45
|
-
function $(r) {
|
|
46
|
-
return c.value.some((a) => a.kind === r.kind && a.value === r.value);
|
|
47
|
-
}
|
|
48
|
-
function L(r) {
|
|
49
|
-
c.value = O(c.value, r);
|
|
50
|
-
}
|
|
51
|
-
function M() {
|
|
52
|
-
u.value = "", c.value = [];
|
|
53
|
-
}
|
|
54
|
-
return q(() => s.load()), (r, a) => {
|
|
55
|
-
const E = f("FmButton"), S = f("FmTextField"), I = f("RouterLink");
|
|
56
|
-
return e(), n("div", ee, [
|
|
57
|
-
o("div", te, [
|
|
58
|
-
o("div", oe, [
|
|
59
|
-
o("header", ne, [
|
|
60
|
-
a[3] || (a[3] = o("div", null, [
|
|
61
|
-
o("h2", { class: "centre__title fm-typo-en-title-sm-600 text-portal-text-primary" }, "Module library"),
|
|
62
|
-
o("p", { class: "centre__subtitle fm-typo-en-body-md-400 text-portal-text-muted" }, " Modules the agent can put on a page. Published from the platform, not from your app. ")
|
|
63
|
-
], -1)),
|
|
64
|
-
p(E, {
|
|
65
|
-
size: "md",
|
|
66
|
-
variant: "tertiary",
|
|
67
|
-
icon: "refresh",
|
|
68
|
-
onClick: a[0] || (a[0] = (t) => i(s).load(!0))
|
|
69
|
-
})
|
|
70
|
-
]),
|
|
71
|
-
C.value ? (e(), n("div", se, [
|
|
72
|
-
p(S, {
|
|
73
|
-
modelValue: u.value,
|
|
74
|
-
"onUpdate:modelValue": a[1] || (a[1] = (t) => u.value = t),
|
|
75
|
-
label: "Search",
|
|
76
|
-
placeholder: "name, slot, or label"
|
|
77
|
-
}, null, 8, ["modelValue"]),
|
|
78
|
-
(e(!0), n(v, null, b(V.value, (t) => (e(), n("div", {
|
|
79
|
-
key: t.kind,
|
|
80
|
-
class: "centre__facet"
|
|
81
|
-
}, [
|
|
82
|
-
o("span", ae, d(B[t.kind]), 1),
|
|
83
|
-
o("div", le, [
|
|
84
|
-
(e(!0), n(v, null, b(t.values, (_) => (e(), n("button", {
|
|
85
|
-
key: _,
|
|
86
|
-
type: "button",
|
|
87
|
-
class: A(["centre__chip fm-typo-en-body-sm-400", { "centre__chip--on": $({ kind: t.kind, value: _ }) }]),
|
|
88
|
-
"aria-pressed": $({ kind: t.kind, value: _ }),
|
|
89
|
-
onClick: (ue) => L({ kind: t.kind, value: _ })
|
|
90
|
-
}, d(_), 11, re))), 128))
|
|
91
|
-
])
|
|
92
|
-
]))), 128)),
|
|
93
|
-
N.value ? (e(), n("button", {
|
|
94
|
-
key: 0,
|
|
95
|
-
type: "button",
|
|
96
|
-
class: "centre__clear fm-typo-en-body-sm-600",
|
|
97
|
-
onClick: M
|
|
98
|
-
}, " Clear filters ")) : k("", !0)
|
|
99
|
-
])) : k("", !0),
|
|
100
|
-
i(s).entries.value === null ? (e(), n("p", ie, "Loading…")) : i(s).loadError.value ? (e(), y(h, {
|
|
101
|
-
key: 2,
|
|
102
|
-
icon: "error_outline",
|
|
103
|
-
tone: "error",
|
|
104
|
-
title: "Could not load the module library",
|
|
105
|
-
message: i(s).loadError.value,
|
|
106
|
-
"action-label": "Try again",
|
|
107
|
-
onAction: a[2] || (a[2] = (t) => i(s).load(!0))
|
|
108
|
-
}, null, 8, ["message"])) : i(s).unpublished.value ? (e(), y(h, {
|
|
109
|
-
key: 3,
|
|
110
|
-
icon: "widgets",
|
|
111
|
-
title: "No module library has been published yet",
|
|
112
|
-
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."
|
|
113
|
-
})) : C.value ? x.value.length ? (e(), n("ul", de, [
|
|
114
|
-
(e(!0), n(v, null, b(x.value, (t) => (e(), n("li", {
|
|
115
|
-
key: t.id
|
|
116
|
-
}, [
|
|
117
|
-
p(I, {
|
|
118
|
-
class: "centre__link",
|
|
119
|
-
to: { name: "miniprogram-v2-module-detail", params: { name: t.name }, query: i(g).query }
|
|
120
|
-
}, {
|
|
121
|
-
default: R(() => [
|
|
122
|
-
p(Z, { entry: t }, null, 8, ["entry"])
|
|
123
|
-
]),
|
|
124
|
-
_: 2
|
|
125
|
-
}, 1032, ["to"])
|
|
126
|
-
]))), 128))
|
|
127
|
-
])) : (e(), y(h, {
|
|
128
|
-
key: 5,
|
|
129
|
-
icon: "search_off",
|
|
130
|
-
title: "No module matches these filters",
|
|
131
|
-
"action-label": "Clear filters",
|
|
132
|
-
onAction: M
|
|
133
|
-
})) : (e(), y(h, {
|
|
134
|
-
key: 4,
|
|
135
|
-
icon: "widgets",
|
|
136
|
-
title: "The module library is empty",
|
|
137
|
-
message: "It has been published, but holds no modules. Nothing here is available to put on a page yet."
|
|
138
|
-
}))
|
|
139
|
-
])
|
|
140
|
-
])
|
|
141
|
-
]);
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
}), he = /* @__PURE__ */ T(ce, [["__scopeId", "data-v-644d1ae5"]]);
|
|
145
|
-
export {
|
|
146
|
-
he as default
|
|
147
|
-
};
|
|
@@ -1,425 +0,0 @@
|
|
|
1
|
-
import { defineComponent as L, ref as o, computed as K, resolveComponent as F, openBlock as s, createBlock as S, 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 B } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
|
-
import { w as te } from "./portalNavigation-C29ihtq_.js";
|
|
8
|
-
const ae = ["href"], le = {
|
|
9
|
-
key: 0,
|
|
10
|
-
class: "portal-error",
|
|
11
|
-
role: "alert"
|
|
12
|
-
}, se = "miniprogram-vue-v2", ie = /* @__PURE__ */ L({
|
|
13
|
-
__name: "ForkTemplateDialog",
|
|
14
|
-
emits: ["close", "created"],
|
|
15
|
-
setup(z, { emit: I }) {
|
|
16
|
-
const b = I, 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(
|
|
17
|
-
() => !p.value && q.test(d.value.trim()) && _.value.trim().length > 0 && P.value.trim().length > 0
|
|
18
|
-
);
|
|
19
|
-
async function $() {
|
|
20
|
-
if (m.value) {
|
|
21
|
-
p.value = !0, y.value = "";
|
|
22
|
-
try {
|
|
23
|
-
const f = await C(k.forkAppTemplate(), {
|
|
24
|
-
method: "POST",
|
|
25
|
-
body: JSON.stringify({
|
|
26
|
-
sourceAppTemplateId: se,
|
|
27
|
-
newAppTemplateId: d.value.trim(),
|
|
28
|
-
label: _.value.trim(),
|
|
29
|
-
description: P.value.trim()
|
|
30
|
-
})
|
|
31
|
-
});
|
|
32
|
-
w.value = f.pullRequestUrl, A.value = f.fileCount, b("created");
|
|
33
|
-
} catch (f) {
|
|
34
|
-
y.value = T(f);
|
|
35
|
-
} finally {
|
|
36
|
-
p.value = !1;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return (f, n) => {
|
|
41
|
-
const h = F("FmButton"), E = F("FmTextField"), j = F("FmTextarea"), O = F("FmCard");
|
|
42
|
-
return s(), S(O, { class: "fork-template-dialog" }, {
|
|
43
|
-
default: Q(() => [
|
|
44
|
-
n[7] || (n[7] = a("h2", null, "Create template", -1)),
|
|
45
|
-
w.value ? (s(), i(x, { key: 0 }, [
|
|
46
|
-
a("p", null, [
|
|
47
|
-
R(" Opened a pull request copying " + u(A.value) + " file(s) into a brand-new ", 1),
|
|
48
|
-
a("code", null, "templates/" + u(d.value) + "/", 1),
|
|
49
|
-
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))
|
|
50
|
-
]),
|
|
51
|
-
a("footer", null, [
|
|
52
|
-
a("a", {
|
|
53
|
-
class: "fork-template-dialog__review-link",
|
|
54
|
-
href: w.value,
|
|
55
|
-
target: "_blank",
|
|
56
|
-
rel: "noopener"
|
|
57
|
-
}, "Review PR", 8, ae),
|
|
58
|
-
c(h, {
|
|
59
|
-
label: "Done",
|
|
60
|
-
onClick: n[0] || (n[0] = (g) => b("close"))
|
|
61
|
-
})
|
|
62
|
-
])
|
|
63
|
-
], 64)) : (s(), i(x, { key: 1 }, [
|
|
64
|
-
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)),
|
|
65
|
-
c(E, {
|
|
66
|
-
modelValue: d.value,
|
|
67
|
-
"onUpdate:modelValue": n[1] || (n[1] = (g) => d.value = g),
|
|
68
|
-
label: "New template id",
|
|
69
|
-
placeholder: "e.g. miniprogram-vue-v2-bakery",
|
|
70
|
-
"helper-text": "Lowercase, kebab-case. Also becomes the directory name and GitHub repository name.",
|
|
71
|
-
disabled: p.value,
|
|
72
|
-
rules: [(g) => q.test(g.trim()) || "Lowercase kebab-case, e.g. miniprogram-vue-v2-bakery"]
|
|
73
|
-
}, null, 8, ["modelValue", "disabled", "rules"]),
|
|
74
|
-
c(E, {
|
|
75
|
-
modelValue: _.value,
|
|
76
|
-
"onUpdate:modelValue": n[2] || (n[2] = (g) => _.value = g),
|
|
77
|
-
label: "Label",
|
|
78
|
-
placeholder: "Shown to merchants in the picker",
|
|
79
|
-
disabled: p.value
|
|
80
|
-
}, null, 8, ["modelValue", "disabled"]),
|
|
81
|
-
c(j, {
|
|
82
|
-
modelValue: P.value,
|
|
83
|
-
"onUpdate:modelValue": n[3] || (n[3] = (g) => P.value = g),
|
|
84
|
-
label: "Description",
|
|
85
|
-
placeholder: "One or two sentences on what the merchant gets",
|
|
86
|
-
disabled: p.value
|
|
87
|
-
}, null, 8, ["modelValue", "disabled"]),
|
|
88
|
-
y.value ? (s(), i("p", le, u(y.value), 1)) : v("", !0),
|
|
89
|
-
a("footer", null, [
|
|
90
|
-
c(h, {
|
|
91
|
-
label: "Cancel",
|
|
92
|
-
variant: "tertiary",
|
|
93
|
-
disabled: p.value,
|
|
94
|
-
onClick: n[4] || (n[4] = (g) => b("close"))
|
|
95
|
-
}, null, 8, ["disabled"]),
|
|
96
|
-
c(h, {
|
|
97
|
-
label: "Open pull request",
|
|
98
|
-
loading: p.value,
|
|
99
|
-
disabled: !m.value,
|
|
100
|
-
onClick: $
|
|
101
|
-
}, null, 8, ["loading", "disabled"])
|
|
102
|
-
])
|
|
103
|
-
], 64))
|
|
104
|
-
]),
|
|
105
|
-
_: 1
|
|
106
|
-
});
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
}), ne = /* @__PURE__ */ B(ie, [["__scopeId", "data-v-5a38928f"]]), oe = { class: "portal-page" }, re = { class: "portal-page-inner" }, ue = { class: "portal-page-heading" }, de = { class: "portal-page-heading__actions" }, ce = {
|
|
110
|
-
key: 0,
|
|
111
|
-
class: "portal-error",
|
|
112
|
-
role: "alert"
|
|
113
|
-
}, pe = {
|
|
114
|
-
key: 1,
|
|
115
|
-
"aria-label": "Templates in review"
|
|
116
|
-
}, me = { class: "template-section-heading" }, ve = {
|
|
117
|
-
key: 0,
|
|
118
|
-
class: "portal-error",
|
|
119
|
-
role: "alert"
|
|
120
|
-
}, he = {
|
|
121
|
-
key: 1,
|
|
122
|
-
class: "template-choices__list",
|
|
123
|
-
"aria-label": "Templates in review"
|
|
124
|
-
}, ge = { class: "template-choices__name" }, be = { class: "template-choices__label" }, _e = { key: 0 }, fe = { class: "template-choices__id" }, ye = { class: "template-choices__actions" }, ke = ["href"], we = { class: "template-section-heading" }, Ce = {
|
|
125
|
-
key: 2,
|
|
126
|
-
class: "portal-error",
|
|
127
|
-
role: "alert"
|
|
128
|
-
}, Te = {
|
|
129
|
-
class: "template-choices__list",
|
|
130
|
-
"aria-label": "Physical templates"
|
|
131
|
-
}, Re = { class: "template-choices__name" }, Pe = { class: "template-choices__label" }, Ae = { key: 0 }, qe = { class: "template-choices__id" }, $e = { class: "template-choices__meta" }, Ne = {
|
|
132
|
-
key: 0,
|
|
133
|
-
class: "template-status-badge template-status-badge--draft"
|
|
134
|
-
}, xe = { class: "template-choices__actions" }, De = /* @__PURE__ */ L({
|
|
135
|
-
__name: "TemplateCenterView",
|
|
136
|
-
setup(z) {
|
|
137
|
-
const I = ee(), b = Z(), d = o(""), _ = o(null), P = o([]), p = o(!1), y = o("");
|
|
138
|
-
async function w() {
|
|
139
|
-
p.value = !0, y.value = "";
|
|
140
|
-
try {
|
|
141
|
-
const e = await C(k.appTemplateRegistry());
|
|
142
|
-
P.value = e.templates;
|
|
143
|
-
} catch (e) {
|
|
144
|
-
y.value = T(e);
|
|
145
|
-
} finally {
|
|
146
|
-
p.value = !1;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
const A = o([]), q = o(!1), m = o("");
|
|
150
|
-
async function $() {
|
|
151
|
-
q.value = !0, m.value = "";
|
|
152
|
-
try {
|
|
153
|
-
const e = await C(k.pendingTemplateChanges());
|
|
154
|
-
A.value = e.changes;
|
|
155
|
-
} catch (e) {
|
|
156
|
-
m.value = T(e);
|
|
157
|
-
} finally {
|
|
158
|
-
q.value = !1;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
async function f() {
|
|
162
|
-
await Promise.all([w(), $()]);
|
|
163
|
-
}
|
|
164
|
-
function n() {
|
|
165
|
-
b.open({
|
|
166
|
-
title: "Create template",
|
|
167
|
-
dialogComponent: ne,
|
|
168
|
-
dialogComponentProps: { onClose: () => b.close(), onCreated: () => void f() }
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
const h = o(null);
|
|
172
|
-
async function E(e) {
|
|
173
|
-
h.value = e.pullRequestNumber, m.value = "";
|
|
174
|
-
try {
|
|
175
|
-
await C(k.mergePendingTemplateChange(e.pullRequestNumber), { method: "POST" }), await f();
|
|
176
|
-
} catch (l) {
|
|
177
|
-
m.value = T(l);
|
|
178
|
-
} finally {
|
|
179
|
-
h.value = null;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
async function j(e) {
|
|
183
|
-
h.value = e.pullRequestNumber, m.value = "";
|
|
184
|
-
try {
|
|
185
|
-
await C(k.rejectPendingTemplateChange(e.pullRequestNumber), { method: "POST" }), await f();
|
|
186
|
-
} catch (l) {
|
|
187
|
-
m.value = T(l);
|
|
188
|
-
} finally {
|
|
189
|
-
h.value = null;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
function O(e) {
|
|
193
|
-
const l = e.kind === "delete" ? "delete" : "create";
|
|
194
|
-
b.open({
|
|
195
|
-
title: `Merge — ${l} ${e.appTemplateId}?`,
|
|
196
|
-
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.',
|
|
197
|
-
primaryActions: { text: "Merge", close: !0, variant: "primary" },
|
|
198
|
-
secondaryActions: { text: "Cancel", close: !0, variant: "tertiary" }
|
|
199
|
-
}).onPrimary(() => void E(e));
|
|
200
|
-
}
|
|
201
|
-
function g(e) {
|
|
202
|
-
b.open({
|
|
203
|
-
title: `Reject — ${e.kind === "delete" ? "delete" : "create"} ${e.appTemplateId}?`,
|
|
204
|
-
message: "Closes the pull request without merging and deletes its branch. Nothing of this change is kept.",
|
|
205
|
-
primaryActions: { text: "Reject", close: !0, variant: "destructive" },
|
|
206
|
-
secondaryActions: { text: "Cancel", close: !0, variant: "tertiary" }
|
|
207
|
-
}).onPrimary(() => void j(e));
|
|
208
|
-
}
|
|
209
|
-
const V = o(null);
|
|
210
|
-
async function G(e) {
|
|
211
|
-
V.value = e, d.value = "";
|
|
212
|
-
try {
|
|
213
|
-
await C(k.deleteAppTemplate(e), { method: "POST" }), await $();
|
|
214
|
-
} catch (l) {
|
|
215
|
-
d.value = T(l);
|
|
216
|
-
} finally {
|
|
217
|
-
V.value = null;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
function H(e) {
|
|
221
|
-
b.open({
|
|
222
|
-
title: `Delete ${e}?`,
|
|
223
|
-
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.`,
|
|
224
|
-
primaryActions: { text: "Delete", close: !0, variant: "destructive" },
|
|
225
|
-
secondaryActions: { text: "Cancel", close: !0, variant: "tertiary" }
|
|
226
|
-
}).onPrimary(() => void G(e));
|
|
227
|
-
}
|
|
228
|
-
const N = o(null);
|
|
229
|
-
async function U(e, l) {
|
|
230
|
-
N.value = e, d.value = "";
|
|
231
|
-
try {
|
|
232
|
-
const r = l ? k.publishAppTemplate(e) : k.unpublishAppTemplate(e);
|
|
233
|
-
await C(r, { method: "POST" }), await w();
|
|
234
|
-
} catch (r) {
|
|
235
|
-
d.value = T(r);
|
|
236
|
-
} finally {
|
|
237
|
-
N.value = null;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
function J(e) {
|
|
241
|
-
b.open({
|
|
242
|
-
title: `Unpublish ${e.id}?`,
|
|
243
|
-
message: "Stops offering it to new merchants immediately. Merchants already provisioned from it are unaffected.",
|
|
244
|
-
primaryActions: { text: "Unpublish", close: !0, variant: "destructive" },
|
|
245
|
-
secondaryActions: { text: "Cancel", close: !0, variant: "tertiary" }
|
|
246
|
-
}).onPrimary(() => void U(e.id, !1));
|
|
247
|
-
}
|
|
248
|
-
X(() => void f());
|
|
249
|
-
async function W(e) {
|
|
250
|
-
if (!_.value) {
|
|
251
|
-
_.value = e, d.value = "";
|
|
252
|
-
try {
|
|
253
|
-
const l = await C(
|
|
254
|
-
k.appTemplateEditingProject(e),
|
|
255
|
-
{ method: "POST" }
|
|
256
|
-
);
|
|
257
|
-
await I.push(
|
|
258
|
-
te(l.projectId, "workspace", I.currentRoute.value.query, { templateEditing: !0 })
|
|
259
|
-
);
|
|
260
|
-
} catch (l) {
|
|
261
|
-
d.value = T(l);
|
|
262
|
-
} finally {
|
|
263
|
-
_.value = null;
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
return (e, l) => {
|
|
268
|
-
const r = F("FmButton");
|
|
269
|
-
return s(), i("div", oe, [
|
|
270
|
-
a("div", re, [
|
|
271
|
-
a("header", ue, [
|
|
272
|
-
l[1] || (l[1] = a("div", null, [
|
|
273
|
-
a("p", { class: "portal-eyebrow" }, "Internal"),
|
|
274
|
-
a("h1", null, "Template library")
|
|
275
|
-
], -1)),
|
|
276
|
-
a("div", de, [
|
|
277
|
-
c(r, {
|
|
278
|
-
label: "Create template",
|
|
279
|
-
variant: "primary",
|
|
280
|
-
onClick: l[0] || (l[0] = (t) => n())
|
|
281
|
-
})
|
|
282
|
-
])
|
|
283
|
-
]),
|
|
284
|
-
d.value ? (s(), i("p", ce, u(d.value), 1)) : v("", !0),
|
|
285
|
-
m.value || A.value.length > 0 ? (s(), i("section", pe, [
|
|
286
|
-
a("div", me, [
|
|
287
|
-
l[2] || (l[2] = a("h2", { class: "template-section-title" }, "In review", -1)),
|
|
288
|
-
c(r, {
|
|
289
|
-
label: "Refresh",
|
|
290
|
-
variant: "tertiary",
|
|
291
|
-
size: "md",
|
|
292
|
-
loading: q.value,
|
|
293
|
-
onClick: $
|
|
294
|
-
}, null, 8, ["loading"])
|
|
295
|
-
]),
|
|
296
|
-
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)),
|
|
297
|
-
m.value ? (s(), i("p", ve, [
|
|
298
|
-
R(u(m.value) + " ", 1),
|
|
299
|
-
c(r, {
|
|
300
|
-
label: "Retry",
|
|
301
|
-
variant: "tertiary",
|
|
302
|
-
onClick: $
|
|
303
|
-
})
|
|
304
|
-
])) : v("", !0),
|
|
305
|
-
A.value.length > 0 ? (s(), i("section", he, [
|
|
306
|
-
(s(!0), i(x, null, M(A.value, (t) => (s(), i("article", {
|
|
307
|
-
key: t.pullRequestNumber,
|
|
308
|
-
class: "template-choices__row"
|
|
309
|
-
}, [
|
|
310
|
-
a("div", ge, [
|
|
311
|
-
a("span", be, [
|
|
312
|
-
R(u(t.appTemplateId), 1),
|
|
313
|
-
t.kind === "delete" ? (s(), i("span", _e, " · Delete")) : v("", !0)
|
|
314
|
-
]),
|
|
315
|
-
a("span", fe, "Awaiting review — PR #" + u(t.pullRequestNumber), 1)
|
|
316
|
-
]),
|
|
317
|
-
a("div", ye, [
|
|
318
|
-
a("a", {
|
|
319
|
-
class: "template-review-link",
|
|
320
|
-
href: t.pullRequestUrl,
|
|
321
|
-
target: "_blank",
|
|
322
|
-
rel: "noopener"
|
|
323
|
-
}, "Review PR", 8, ke),
|
|
324
|
-
c(r, {
|
|
325
|
-
label: "Merge",
|
|
326
|
-
variant: "primary",
|
|
327
|
-
loading: h.value === t.pullRequestNumber,
|
|
328
|
-
disabled: h.value !== null,
|
|
329
|
-
onClick: (D) => O(t)
|
|
330
|
-
}, null, 8, ["loading", "disabled", "onClick"]),
|
|
331
|
-
c(r, {
|
|
332
|
-
label: "Reject",
|
|
333
|
-
variant: "destructive",
|
|
334
|
-
disabled: h.value !== null,
|
|
335
|
-
onClick: (D) => g(t)
|
|
336
|
-
}, null, 8, ["disabled", "onClick"])
|
|
337
|
-
])
|
|
338
|
-
]))), 128))
|
|
339
|
-
])) : v("", !0)
|
|
340
|
-
])) : v("", !0),
|
|
341
|
-
a("div", we, [
|
|
342
|
-
l[4] || (l[4] = a("h2", { class: "template-section-title" }, "Physical templates", -1)),
|
|
343
|
-
c(r, {
|
|
344
|
-
label: "Refresh",
|
|
345
|
-
variant: "tertiary",
|
|
346
|
-
size: "md",
|
|
347
|
-
loading: p.value,
|
|
348
|
-
onClick: w
|
|
349
|
-
}, null, 8, ["loading"])
|
|
350
|
-
]),
|
|
351
|
-
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)),
|
|
352
|
-
y.value ? (s(), i("p", Ce, [
|
|
353
|
-
R(u(y.value) + " ", 1),
|
|
354
|
-
c(r, {
|
|
355
|
-
label: "Retry",
|
|
356
|
-
variant: "tertiary",
|
|
357
|
-
onClick: w
|
|
358
|
-
})
|
|
359
|
-
])) : v("", !0),
|
|
360
|
-
a("section", Te, [
|
|
361
|
-
(s(!0), i(x, null, M(P.value, (t) => (s(), i("article", {
|
|
362
|
-
key: t.id,
|
|
363
|
-
class: "template-choices__row"
|
|
364
|
-
}, [
|
|
365
|
-
a("div", Re, [
|
|
366
|
-
a("span", Pe, [
|
|
367
|
-
R(u(t.label), 1),
|
|
368
|
-
t.default ? (s(), i("span", Ae, " · Default")) : v("", !0)
|
|
369
|
-
]),
|
|
370
|
-
a("span", qe, u(t.id), 1),
|
|
371
|
-
a("span", $e, [
|
|
372
|
-
t.restaurantStyle ? (s(), i(x, { key: 0 }, [
|
|
373
|
-
R(u(t.restaurantStyle) + " · ", 1)
|
|
374
|
-
], 64)) : v("", !0),
|
|
375
|
-
R(u(t.industries.join(", ") || "General-purpose") + " · " + u(t.environments.join(", ")), 1)
|
|
376
|
-
])
|
|
377
|
-
]),
|
|
378
|
-
t.pullRequestNumber ? (s(), i("span", Ne, " Awaiting merge — PR #" + u(t.pullRequestNumber), 1)) : (s(), i("span", {
|
|
379
|
-
key: 1,
|
|
380
|
-
class: Y(["template-status-badge", `template-status-badge--${t.status}`])
|
|
381
|
-
}, u(t.status === "published" ? "Published" : "Draft"), 3)),
|
|
382
|
-
a("div", xe, [
|
|
383
|
-
t.pullRequestNumber ? v("", !0) : (s(), i(x, { key: 0 }, [
|
|
384
|
-
t.status === "draft" ? (s(), S(r, {
|
|
385
|
-
key: 0,
|
|
386
|
-
label: "Publish",
|
|
387
|
-
variant: "primary",
|
|
388
|
-
loading: N.value === t.id,
|
|
389
|
-
disabled: N.value !== null,
|
|
390
|
-
onClick: (D) => U(t.id, !0)
|
|
391
|
-
}, null, 8, ["loading", "disabled", "onClick"])) : t.default ? v("", !0) : (s(), S(r, {
|
|
392
|
-
key: 1,
|
|
393
|
-
label: "Unpublish",
|
|
394
|
-
variant: "secondary",
|
|
395
|
-
loading: N.value === t.id,
|
|
396
|
-
disabled: N.value !== null,
|
|
397
|
-
onClick: (D) => J(t)
|
|
398
|
-
}, null, 8, ["loading", "disabled", "onClick"])),
|
|
399
|
-
c(r, {
|
|
400
|
-
label: "Edit code",
|
|
401
|
-
variant: "secondary",
|
|
402
|
-
loading: _.value === t.id,
|
|
403
|
-
disabled: _.value !== null,
|
|
404
|
-
onClick: (D) => W(t.id)
|
|
405
|
-
}, null, 8, ["loading", "disabled", "onClick"])
|
|
406
|
-
], 64)),
|
|
407
|
-
!t.default && !t.pullRequestNumber ? (s(), S(r, {
|
|
408
|
-
key: 1,
|
|
409
|
-
label: "Delete",
|
|
410
|
-
variant: "destructive",
|
|
411
|
-
loading: V.value === t.id,
|
|
412
|
-
disabled: V.value !== null,
|
|
413
|
-
onClick: (D) => H(t.id)
|
|
414
|
-
}, null, 8, ["loading", "disabled", "onClick"])) : v("", !0)
|
|
415
|
-
])
|
|
416
|
-
]))), 128))
|
|
417
|
-
])
|
|
418
|
-
])
|
|
419
|
-
]);
|
|
420
|
-
};
|
|
421
|
-
}
|
|
422
|
-
}), Ue = /* @__PURE__ */ B(De, [["__scopeId", "data-v-0206eae6"]]);
|
|
423
|
-
export {
|
|
424
|
-
Ue as default
|
|
425
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
function a(r) {
|
|
2
|
-
return r === "releases" || r === "sessions" ? r : "workspace";
|
|
3
|
-
}
|
|
4
|
-
function o(r) {
|
|
5
|
-
const { view: n, tpl: e, setup: t, ...s } = r;
|
|
6
|
-
return s;
|
|
7
|
-
}
|
|
8
|
-
function i(r, n, e, t = {}) {
|
|
9
|
-
return {
|
|
10
|
-
name: "miniprogram-v2-project",
|
|
11
|
-
params: { projectId: r, view: n === "workspace" ? void 0 : n },
|
|
12
|
-
query: {
|
|
13
|
-
...o(e),
|
|
14
|
-
...t.templateEditing ? { tpl: "1" } : {},
|
|
15
|
-
...t.setup ? { setup: "1" } : {}
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
function c(r, n, e) {
|
|
20
|
-
if (!n || !e || n === e || r.name !== "miniprogram-v2-project" || r.query.tpl === "1") return null;
|
|
21
|
-
const t = o(r.query);
|
|
22
|
-
return typeof t.businessId == "string" && (t.businessId = e), { name: "miniprogram-v2-mobile-projects", query: t };
|
|
23
|
-
}
|
|
24
|
-
function p(r, n = "settings") {
|
|
25
|
-
const e = new URLSearchParams();
|
|
26
|
-
for (const t of ["businessId", "country", "restaurantId"]) {
|
|
27
|
-
const s = r[t];
|
|
28
|
-
typeof s == "string" && e.set(t, s);
|
|
29
|
-
}
|
|
30
|
-
return `/brand/${n}${e.size ? `?${e}` : ""}`;
|
|
31
|
-
}
|
|
32
|
-
export {
|
|
33
|
-
a,
|
|
34
|
-
c as e,
|
|
35
|
-
p as l,
|
|
36
|
-
o as p,
|
|
37
|
-
i as w
|
|
38
|
-
};
|