@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.
Files changed (36) hide show
  1. package/dist/{App-B7Mai_6F.js → App-Ck_p8Anr.js} +261 -268
  2. package/dist/{BrandFontPicker-JHyoGusq.js → BrandFontPicker-VX2LAN2w.js} +1 -1
  3. package/dist/{BrandKitView-Dlt_ifI0.js → BrandKitView-CB7kcVy2.js} +2 -2
  4. package/dist/ControlPlaneView-CqTLqklv.js +27000 -0
  5. package/dist/{EcosystemView-Cy0N2qNK.js → EcosystemView-Bt-UdWfQ.js} +6 -6
  6. package/dist/MobileProjectDialog-DAYQdrCY.js +452 -0
  7. package/dist/MobileProjectsView-z7GucfWB.js +235 -0
  8. package/dist/ModuleCenterView-t8rhd419.js +283 -0
  9. package/dist/ModuleDetailView-C2TJToR7.js +296 -0
  10. package/dist/{PagesView-DQCIwpnL.js → PagesView-bXfOrylf.js} +2 -2
  11. package/dist/{PlatformUnavailableView-DY2ntpNw.js → PlatformUnavailableView-CkKpF-bi.js} +1 -1
  12. package/dist/{PortalSettingsView-Cz566Ccd.js → PortalSettingsView-D_2Gd3-Y.js} +9 -9
  13. package/dist/StatusBadge.vue_vue_type_script_setup_true_lang-DMm_s9ua.js +41 -0
  14. package/dist/TemplateCenterView-DEN51nfK.js +515 -0
  15. package/dist/{WorkspaceEntryView-B28ASSit.js → WorkspaceEntryView-SLqO3Mi4.js} +2 -2
  16. package/dist/app.js +15 -15
  17. package/dist/{controlPlane-sXaC6pAh.js → controlPlane-DR5ykj4d.js} +8 -8
  18. package/dist/localPreference-Do4VKtxT.js +61 -0
  19. package/dist/package.json +1 -1
  20. package/dist/{portalContext-DV-6uUwp.js → portalContext-BeKN8Bcx.js} +2 -2
  21. package/dist/portalNavigation-DDMi3QTt.js +43 -0
  22. package/dist/{routes-CeuodIgg.js → routes-B9oMJsaM.js} +45 -27
  23. package/dist/style.css +1 -1
  24. package/dist/{useBrandKit-CXLIXo5j.js → useBrandKit-CKn1fm2o.js} +1 -1
  25. package/dist/useModuleCatalog-Daw8KA--.js +147 -0
  26. package/package.json +1 -1
  27. package/dist/AppTemplatePicker.vue_vue_type_script_setup_true_lang-LE_aKvfg.js +0 -198
  28. package/dist/ControlPlaneView-CBGNMsPT.js +0 -25317
  29. package/dist/MobileProjectsView-CvMvePvm.js +0 -333
  30. package/dist/ModuleCenterView-C6mCPATr.js +0 -147
  31. package/dist/ModuleDetailView-CSfMF0Uo.js +0 -189
  32. package/dist/StatusBadge.vue_vue_type_script_setup_true_lang-CMgQ0bd_.js +0 -30
  33. package/dist/TemplateCenterView-DqZLthqh.js +0 -426
  34. package/dist/adminAccess-oXC0xjvK.js +0 -48
  35. package/dist/portalNavigation-BBORm5cp.js +0 -34
  36. package/dist/useModuleCatalog-Cep-pzWO.js +0 -124
@@ -1,6 +1,6 @@
1
1
  import { a as xt, e as jt } from "./index-CIJWcl_6.js";
2
2
  import { computed as nt, reactive as Et } from "vue";
3
- import { h as j, e as ot } from "./controlPlane-sXaC6pAh.js";
3
+ import { h as j, e as ot } from "./controlPlane-DR5ykj4d.js";
4
4
  import { useCoreStore as At } from "@feedmepos/mf-common";
5
5
  import { g as Nt, c as Tt } from "./_commonjsHelpers-DaMA6jEr.js";
6
6
  const it = [
@@ -0,0 +1,147 @@
1
+ import { defineComponent as E, resolveComponent as g, openBlock as p, createElementBlock as v, createVNode as M, createElementVNode as x, normalizeClass as P, toDisplayString as w, createCommentVNode as b, createBlock as _, shallowReadonly as c, ref as m } from "vue";
2
+ import { a as C } from "./routes-B9oMJsaM.js";
3
+ import { c as F, e as $, f as L } from "./controlPlane-DR5ykj4d.js";
4
+ function R(e, t) {
5
+ const n = t.trim().toLowerCase();
6
+ return e.filter((r) => n ? [r.name, r.description ?? "", r.slot ?? "", ...r.labels ?? []].join(" ").toLowerCase().includes(n) : !0);
7
+ }
8
+ function S(e) {
9
+ const t = e.replace(/([a-z0-9])([A-Z])/g, "$1 $2");
10
+ return t.charAt(0).toUpperCase() + t.slice(1);
11
+ }
12
+ function z(e) {
13
+ return e.slot ?? `__ungrouped-component:${e.name}`;
14
+ }
15
+ function U(e) {
16
+ const t = /* @__PURE__ */ new Map(), n = [];
17
+ for (const o of e) {
18
+ const a = o.group ?? null;
19
+ let l = t.get(a);
20
+ l || (l = /* @__PURE__ */ new Map(), t.set(a, l), n.push(a));
21
+ const s = z(o);
22
+ let d = l.get(s);
23
+ d || (d = {
24
+ key: s,
25
+ slot: o.slot,
26
+ label: o.componentLabel ?? (o.slot ? S(o.slot) : o.styleLabel ?? o.description ?? o.name),
27
+ styles: []
28
+ }, l.set(s, d)), d.styles.push(o);
29
+ }
30
+ return [...n].sort((o, a) => o === a ? 0 : o === null ? 1 : a === null ? -1 : o.localeCompare(a)).map((o) => ({ group: o, components: [...t.get(o).values()] }));
31
+ }
32
+ function A(e) {
33
+ const t = e.components.length, n = e.components.reduce((r, o) => r + o.styles.length, 0);
34
+ return `${t} component${t === 1 ? "" : "s"} · ${n} style${n === 1 ? "" : "s"}`;
35
+ }
36
+ function G(e, t) {
37
+ const n = /* @__PURE__ */ new Map();
38
+ let r = 0;
39
+ for (const l of e) {
40
+ const s = l[t];
41
+ s ? n.set(s, (n.get(s) ?? 0) + 1) : r += 1;
42
+ }
43
+ const o = [...n.entries()].sort((l, s) => l[0].localeCompare(s[0])).map(([l, s]) => ({ value: l, count: s }));
44
+ return { total: o.reduce((l, s) => l + s.count, 0), chips: o, unsetCount: r };
45
+ }
46
+ function J(e) {
47
+ const t = e.slot ? ` It is published to fill the ${e.slot} slot.` : "";
48
+ 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.`;
49
+ }
50
+ function K(e, t) {
51
+ if (!e.includes("</head>")) return e;
52
+ const n = JSON.stringify(t).replace(/</g, "\\u003c");
53
+ return e.replace("</head>", `<script>window.__FM_PREVIEW_MODULE__=${n}<\/script></head>`);
54
+ }
55
+ function T(e, t) {
56
+ if (!e.includes("</head>")) return e;
57
+ const n = JSON.stringify(t).replace(/</g, "\\u003c");
58
+ return e.replace("</head>", `<script>window.__FM_PREVIEW_MODULES__=${n}<\/script></head>`);
59
+ }
60
+ const B = { class: "flex min-h-0 flex-1 flex-col items-center justify-center gap-8 p-24 text-center" }, I = {
61
+ key: 0,
62
+ class: "m-0 max-w-[46ch] fm-typo-en-body-sm-400 text-portal-text-muted"
63
+ }, W = /* @__PURE__ */ E({
64
+ __name: "ModuleEmptyState",
65
+ props: {
66
+ icon: {},
67
+ title: {},
68
+ message: {},
69
+ actionLabel: {},
70
+ tone: {}
71
+ },
72
+ emits: ["action"],
73
+ setup(e) {
74
+ return (t, n) => {
75
+ const r = g("FmIcon"), o = g("FmButton");
76
+ return p(), v("div", B, [
77
+ M(r, {
78
+ name: e.icon,
79
+ size: "xl",
80
+ color: e.tone === "error" ? "typo-warning" : "neutral-gray-300"
81
+ }, null, 8, ["name", "color"]),
82
+ x("p", {
83
+ class: P(["m-0 fm-typo-en-body-md-600", e.tone === "error" ? "text-fm-color-typo-warning" : "text-fm-color-typo-secondary"])
84
+ }, w(e.title), 3),
85
+ e.message ? (p(), v("p", I, w(e.message), 1)) : b("", !0),
86
+ e.actionLabel ? (p(), _(o, {
87
+ key: 1,
88
+ size: "md",
89
+ variant: "secondary",
90
+ label: e.actionLabel,
91
+ onClick: n[0] || (n[0] = (a) => t.$emit("action"))
92
+ }, null, 8, ["label"])) : b("", !0)
93
+ ]);
94
+ };
95
+ }
96
+ }), u = m(null), f = m(null), y = m(!1), k = m(null), h = m(null);
97
+ let i = null;
98
+ async function D() {
99
+ f.value = null, y.value = !1;
100
+ try {
101
+ const e = await F(C.componentLibraryCatalog());
102
+ u.value = e.components ?? [];
103
+ } catch (e) {
104
+ const t = $(e);
105
+ u.value = [], t.includes("no component library has been published") ? y.value = !0 : f.value = t || "Could not load the module library.";
106
+ }
107
+ }
108
+ async function N() {
109
+ h.value = null;
110
+ try {
111
+ k.value = await L(C.componentLibraryPreview());
112
+ } catch (e) {
113
+ h.value = $(e) || "Could not load the preview document.";
114
+ }
115
+ }
116
+ function Z() {
117
+ function e(n = !1) {
118
+ return !n && (u.value !== null || i) ? i ?? Promise.resolve() : (i = Promise.all([D(), N()]).then(() => {
119
+ }).finally(() => {
120
+ i = null;
121
+ }), i);
122
+ }
123
+ function t(n) {
124
+ var r;
125
+ return ((r = u.value) == null ? void 0 : r.find((o) => o.name === n)) ?? null;
126
+ }
127
+ return {
128
+ entries: c(u),
129
+ loadError: c(f),
130
+ unpublished: c(y),
131
+ previewDocument: c(k),
132
+ previewError: c(h),
133
+ load: e,
134
+ find: t
135
+ };
136
+ }
137
+ export {
138
+ W as _,
139
+ A as a,
140
+ K as b,
141
+ R as f,
142
+ U as g,
143
+ T as i,
144
+ J as m,
145
+ G as s,
146
+ Z as u
147
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-miniprogram-v2",
3
- "version": "0.2.8-dev.1",
3
+ "version": "0.2.8-dev.10",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -1,198 +0,0 @@
1
- import { defineComponent as k, computed as x, openBlock as a, createElementBlock as l, createStaticVNode as m, createCommentVNode as p, createElementVNode as e, createVNode as b, toDisplayString as h, Fragment as w, renderList as _, normalizeClass as y } from "vue";
2
- function K(t) {
3
- return t === "active" ? "success" : t === "needs_attention" ? "warning" : "neutral";
4
- }
5
- function O(t) {
6
- return t === "active" ? "Active" : t === "needs_attention" ? "Needs attention" : "Archived";
7
- }
8
- function X(t) {
9
- return t === "succeeded" ? "success" : t === "failed" ? "error" : t === "queued" || t === "running" ? "info" : "neutral";
10
- }
11
- function Y(t) {
12
- switch (t) {
13
- case "queued":
14
- return "Queued";
15
- case "running":
16
- return "Running";
17
- case "succeeded":
18
- return "Built";
19
- case "failed":
20
- return "Build failed";
21
- default:
22
- return "No build yet";
23
- }
24
- }
25
- function Z(t) {
26
- switch (t) {
27
- case "ready":
28
- return "Ready";
29
- case "provisioning":
30
- return "Setting up";
31
- case "failed":
32
- return "Setup failed";
33
- default:
34
- return "Not set up";
35
- }
36
- }
37
- const C = ["preview", "published", "rolled_back"];
38
- function tt(t) {
39
- return C.includes(t.status);
40
- }
41
- function et(t) {
42
- return t.is_live === 1 ? "Live" : t.build_status === "queued" || t.build_status === "running" ? "Building" : t.build_status === "failed" ? "Failed" : t.build_status === "succeeded" ? "Ready" : "Draft";
43
- }
44
- function rt(t) {
45
- return t.is_live === 1 ? "primary" : t.build_status === "succeeded" ? "success" : t.build_status === "queued" || t.build_status === "running" ? "info" : t.build_status === "failed" ? "error" : "neutral";
46
- }
47
- const A = {
48
- key: 0,
49
- viewBox: "0 0 56 96",
50
- class: "h-[72px] w-[42px] shrink-0 rounded-[6px] border border-portal-border-default bg-portal-bg-default",
51
- "aria-hidden": "true",
52
- focusable: "false"
53
- }, E = {
54
- key: 0,
55
- fill: "currentColor",
56
- class: "text-fm-color-neutral-gray-300"
57
- }, B = {
58
- key: 1,
59
- fill: "currentColor",
60
- class: "text-fm-color-neutral-gray-300"
61
- }, L = {
62
- key: 2,
63
- fill: "currentColor",
64
- class: "text-fm-color-neutral-gray-300"
65
- }, v = /* @__PURE__ */ k({
66
- __name: "AppTemplateThumbnail",
67
- props: {
68
- restaurantStyle: {}
69
- },
70
- setup(t) {
71
- const d = t, u = x(
72
- () => d.restaurantStyle === "qsr" || d.restaurantStyle === "coffee" || d.restaurantStyle === "tea"
73
- );
74
- return (g, o) => u.value ? (a(), l("svg", A, [
75
- t.restaurantStyle === "qsr" ? (a(), l("g", E, [...o[0] || (o[0] = [
76
- m('<rect x="6" y="7" width="44" height="6" rx="3"></rect><rect x="6" y="18" width="19" height="18" rx="2"></rect><rect x="31" y="18" width="19" height="18" rx="2"></rect><rect x="6" y="40" width="19" height="18" rx="2"></rect><rect x="31" y="40" width="19" height="18" rx="2"></rect><rect x="6" y="62" width="19" height="18" rx="2"></rect><rect x="31" y="62" width="19" height="18" rx="2"></rect><rect x="6" y="85" width="44" height="7" rx="3.5" class="text-fm-color-neutral-gray-400"></rect>', 8)
77
- ])])) : t.restaurantStyle === "coffee" ? (a(), l("g", B, [...o[1] || (o[1] = [
78
- m('<rect x="6" y="7" width="44" height="30" rx="3"></rect><rect x="6" y="43" width="26" height="4" rx="2"></rect><rect x="6" y="53" width="44" height="12" rx="2"></rect><rect x="6" y="69" width="44" height="12" rx="2"></rect><rect x="6" y="87" width="18" height="4" rx="2"></rect>', 5)
79
- ])])) : (a(), l("g", L, [...o[2] || (o[2] = [
80
- m('<rect x="6" y="7" width="44" height="5" rx="2.5"></rect><rect x="6" y="17" width="44" height="9" rx="2"></rect><rect x="6" y="28" width="9" height="4" rx="2" class="text-fm-color-neutral-gray-400"></rect><rect x="18" y="28" width="9" height="4" rx="2" class="text-fm-color-neutral-gray-400"></rect><rect x="30" y="28" width="9" height="4" rx="2" class="text-fm-color-neutral-gray-400"></rect><rect x="6" y="38" width="44" height="9" rx="2"></rect><rect x="6" y="49" width="9" height="4" rx="2" class="text-fm-color-neutral-gray-400"></rect><rect x="18" y="49" width="9" height="4" rx="2" class="text-fm-color-neutral-gray-400"></rect><rect x="6" y="59" width="44" height="9" rx="2"></rect><rect x="6" y="70" width="9" height="4" rx="2" class="text-fm-color-neutral-gray-400"></rect><rect x="18" y="70" width="9" height="4" rx="2" class="text-fm-color-neutral-gray-400"></rect><rect x="30" y="70" width="9" height="4" rx="2" class="text-fm-color-neutral-gray-400"></rect><rect x="6" y="80" width="44" height="9" rx="2"></rect>', 13)
81
- ])]))
82
- ])) : p("", !0);
83
- }
84
- }), N = {
85
- key: 0,
86
- class: "rounded-lg border border-portal-border-default bg-portal-bg-default p-16"
87
- }, T = { class: "mt-12 flex items-start gap-12" }, q = { class: "min-w-0 max-w-[640px] flex-1" }, $ = { class: "m-0 fm-typo-en-body-md-600 text-portal-text-primary" }, D = { class: "m-0 mt-4 fm-typo-en-body-sm-400 text-portal-text-muted" }, R = {
88
- key: 1,
89
- class: "rounded-lg border border-portal-border-default bg-portal-bg-default p-16"
90
- }, P = { class: "mt-12 max-w-[640px]" }, F = {
91
- key: 0,
92
- class: "m-0 mb-8 fm-typo-en-body-sm-600 uppercase tracking-wide text-portal-text-muted"
93
- }, I = { class: "flex flex-col gap-8" }, j = ["aria-checked", "disabled", "onClick"], z = {
94
- key: 0,
95
- class: "h-[6px] w-[6px] rounded-full bg-portal-bg-default"
96
- }, H = { class: "min-w-0 max-w-[640px] flex-1" }, M = { class: "flex flex-wrap items-center gap-8" }, Q = { class: "fm-typo-en-body-md-600 text-portal-text-primary" }, U = {
97
- key: 0,
98
- class: "rounded-full bg-portal-bg-canvas px-8 py-[2px] fm-typo-en-body-sm-400 text-portal-text-muted"
99
- }, W = { class: "mt-4 block fm-typo-en-body-sm-400 text-portal-text-muted" }, st = /* @__PURE__ */ k({
100
- __name: "AppTemplatePicker",
101
- props: {
102
- templates: {},
103
- modelValue: {},
104
- disabled: { type: Boolean }
105
- },
106
- emits: ["update:modelValue"],
107
- setup(t, { emit: d }) {
108
- const u = t, g = d, o = x(() => u.templates.length > 1), f = x(() => u.templates.length === 1 ? u.templates[0] : null), S = x(() => {
109
- const c = [], n = /* @__PURE__ */ new Map();
110
- for (const r of u.templates) {
111
- if (!r.industries.length) {
112
- c.push(r);
113
- continue;
114
- }
115
- for (const i of r.industries) {
116
- const s = n.get(i) ?? [];
117
- s.push(r), n.set(i, s);
118
- }
119
- }
120
- return [
121
- ...c.length ? [{ label: null, templates: c }] : [],
122
- ...[...n.entries()].sort(([r], [i]) => r.localeCompare(i)).map(([r, i]) => ({ label: r, templates: i }))
123
- ];
124
- });
125
- function V(c) {
126
- u.disabled || g("update:modelValue", c);
127
- }
128
- return (c, n) => f.value ? (a(), l("section", N, [
129
- n[0] || (n[0] = e("p", { class: "m-0 fm-typo-en-body-md-600 text-portal-text-primary" }, "App template", -1)),
130
- e("div", T, [
131
- b(v, {
132
- "restaurant-style": f.value.restaurantStyle
133
- }, null, 8, ["restaurant-style"]),
134
- e("div", q, [
135
- e("p", $, h(f.value.label), 1),
136
- e("p", D, h(f.value.description), 1)
137
- ])
138
- ])
139
- ])) : o.value ? (a(), l("section", R, [
140
- n[1] || (n[1] = e("p", { class: "m-0 fm-typo-en-body-md-600 text-portal-text-primary" }, "App template", -1)),
141
- n[2] || (n[2] = e("p", { class: "m-0 mt-4 fm-typo-en-body-sm-400 text-portal-text-muted" }, " Choose how this app looks and works for your customers. This cannot be changed after setup. ", -1)),
142
- e("div", P, [
143
- (a(!0), l(w, null, _(S.value, (r, i) => (a(), l("div", {
144
- key: r.label ?? "__general",
145
- role: "radiogroup",
146
- "aria-label": "App template",
147
- class: y(i === 0 ? "" : "mt-16")
148
- }, [
149
- r.label ? (a(), l("p", F, h(r.label), 1)) : p("", !0),
150
- e("div", I, [
151
- (a(!0), l(w, null, _(r.templates, (s) => (a(), l("button", {
152
- key: s.id,
153
- type: "button",
154
- role: "radio",
155
- "aria-checked": t.modelValue === s.id,
156
- disabled: t.disabled,
157
- class: y([
158
- "flex w-full cursor-pointer items-start gap-12 rounded-lg border p-12 text-left transition disabled:cursor-not-allowed disabled:opacity-60",
159
- t.modelValue === s.id ? "border-fm-color-primary bg-fm-color-primary-50" : "border-fm-color-neutral-gray-200 bg-fm-color-neutral-white hover:border-fm-color-neutral-gray-300"
160
- ]),
161
- onClick: (G) => V(s.id)
162
- }, [
163
- e("span", {
164
- class: y([
165
- "mt-[2px] flex h-16 w-16 shrink-0 items-center justify-center rounded-full border",
166
- t.modelValue === s.id ? "border-fm-color-primary bg-fm-color-primary" : "border-fm-color-neutral-gray-300 bg-fm-color-neutral-white"
167
- ])
168
- }, [
169
- t.modelValue === s.id ? (a(), l("span", z)) : p("", !0)
170
- ], 2),
171
- b(v, {
172
- "restaurant-style": s.restaurantStyle
173
- }, null, 8, ["restaurant-style"]),
174
- e("span", H, [
175
- e("span", M, [
176
- e("span", Q, h(s.label), 1),
177
- s.default ? (a(), l("span", U, " Default ")) : p("", !0)
178
- ]),
179
- e("span", W, h(s.description), 1)
180
- ])
181
- ], 10, j))), 128))
182
- ])
183
- ], 2))), 128))
184
- ])
185
- ])) : p("", !0);
186
- }
187
- });
188
- export {
189
- st as _,
190
- rt as a,
191
- et as b,
192
- O as c,
193
- X as d,
194
- Y as e,
195
- Z as p,
196
- tt as r,
197
- K as s
198
- };