@feedmepos/mf-miniprogram-v2 0.2.2-dev.4 → 0.2.2-dev.6

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.
@@ -1,150 +1,150 @@
1
- import { defineComponent as F, computed as v, ref as T, onMounted as R, onBeforeUnmount as E, resolveComponent as f, openBlock as s, createElementBlock as i, Fragment as S, createElementVNode as a, normalizeClass as x, createVNode as l, renderList as w, unref as t, withCtx as c, toDisplayString as b, createCommentVNode as N, createTextVNode as V, createBlock as z } from "vue";
2
- import { useRoute as K, RouterView as O } from "vue-router";
3
- import { useCoreStore as A } from "@feedmepos/mf-common";
4
- import { P as g } from "./PortalIcon-DO0VrIoY.js";
5
- import { p as $ } from "./portalContext-CTVzkJV7.js";
6
- import { w as D, p as k } from "./portalNavigation-DKCfwTH8.js";
7
- import { r as G, w as Q } from "./localPreference-DneUpUrQ.js";
8
- import { _ as U } from "./_plugin-vue_export-helper-CHgC5LLL.js";
9
- const H = {
1
+ import { defineComponent as V, computed as d, ref as q, onMounted as z, onBeforeUnmount as K, resolveComponent as k, openBlock as s, createElementBlock as i, Fragment as x, createElementVNode as a, normalizeClass as P, createVNode as l, renderList as B, unref as t, withCtx as v, toDisplayString as c, createCommentVNode as O, createTextVNode as A, createBlock as $ } from "vue";
2
+ import { useRoute as D, RouterView as G } from "vue-router";
3
+ import { useCoreStore as Q } from "@feedmepos/mf-common";
4
+ import { P as b } from "./PortalIcon-DO0VrIoY.js";
5
+ import { p as U } from "./portalContext-CTVzkJV7.js";
6
+ import { w as H, p as _ } from "./portalNavigation-DKCfwTH8.js";
7
+ import { r as I, w as h } from "./localPreference-DneUpUrQ.js";
8
+ import { _ as J } from "./_plugin-vue_export-helper-CHgC5LLL.js";
9
+ const W = {
10
10
  class: "portal-sidebar",
11
11
  "aria-label": "Mini Program navigation"
12
- }, J = ["aria-expanded", "aria-label"], W = {
12
+ }, X = ["aria-expanded", "aria-label"], Y = {
13
13
  id: "miniprogram-navigation",
14
14
  class: "portal-nav"
15
- }, X = { class: "portal-nav-label" }, Y = { class: "portal-nav-label" }, Z = { class: "portal-main" }, ee = {
15
+ }, Z = { class: "portal-nav-label" }, ee = { class: "portal-nav-label" }, ae = { class: "portal-main" }, te = {
16
16
  key: 0,
17
17
  class: "portal-breadcrumb",
18
18
  "aria-label": "Breadcrumb"
19
- }, ae = {
19
+ }, oe = {
20
20
  id: "miniprogram-content",
21
21
  class: "portal-content",
22
22
  tabindex: "-1"
23
- }, te = {
23
+ }, le = {
24
24
  key: 0,
25
25
  class: "portal-empty"
26
- }, oe = {
26
+ }, re = {
27
27
  key: 1,
28
28
  class: "portal-loading",
29
29
  role: "status"
30
- }, le = {
30
+ }, ne = {
31
31
  key: 2,
32
32
  class: "portal-empty",
33
33
  role: "alert"
34
- }, re = {
34
+ }, se = {
35
35
  key: 3,
36
36
  class: "portal-empty"
37
- }, ne = /* @__PURE__ */ F({
37
+ }, ie = /* @__PURE__ */ V({
38
38
  __name: "App",
39
- setup(se) {
40
- const r = K(), _ = A(), n = $(), p = v(() => r.name === "miniprogram-v2-project"), u = T(
41
- G(
39
+ setup(pe) {
40
+ const r = D(), C = Q(), n = U(), p = d(() => r.name === "miniprogram-v2-project"), g = q(
41
+ I(
42
42
  "mpv2:portal-collapsed",
43
- p.value || typeof window < "u" && window.matchMedia("(max-width: 1000px)").matches
43
+ typeof window < "u" && window.matchMedia("(max-width: 1000px)").matches
44
44
  )
45
- ), y = v(() => {
46
- var m;
47
- return (m = n.context.value) == null ? void 0 : m.projectId;
48
- }), M = v(() => p.value && r.params.projectId !== y.value), q = v(
45
+ ), y = q(I("mpv2:editor-collapsed", !0)), S = d(() => p.value ? y.value : g.value), f = d(() => {
46
+ var u;
47
+ return (u = n.context.value) == null ? void 0 : u.projectId;
48
+ }), j = d(() => p.value && r.params.projectId !== f.value), L = d(
49
49
  () => {
50
- var m;
51
- return p.value ? (m = n.context.value) == null ? void 0 : m.project.name : String(r.meta.title ?? "Ecosystem");
50
+ var u;
51
+ return p.value ? (u = n.context.value) == null ? void 0 : u.project.name : String(r.meta.title ?? "Ecosystem");
52
52
  }
53
- ), B = [
53
+ ), F = [
54
54
  { name: "miniprogram-v2-ecosystem", label: "Ecosystem", icon: "ecosystem" },
55
55
  { name: "miniprogram-v2-brand-kit", label: "Brand Kit", icon: "brand" },
56
56
  { name: "miniprogram-v2-pages", label: "Pages", icon: "pages" }
57
- ], C = v(
58
- () => y.value ? D(y.value, "workspace", r.query) : { name: "miniprogram-v2-control", query: r.query }
57
+ ], w = d(
58
+ () => f.value ? H(f.value, "workspace", r.query) : { name: "miniprogram-v2-control", query: r.query }
59
59
  );
60
- let P = !1;
61
- R(() => {
62
- P = _.hideSidebar.value, _.hideSidebar.value = !0;
63
- }), E(() => {
64
- _.hideSidebar.value = P;
60
+ let M = !1;
61
+ z(() => {
62
+ M = C.hideSidebar.value, C.hideSidebar.value = !0;
63
+ }), K(() => {
64
+ C.hideSidebar.value = M;
65
65
  });
66
- function I() {
67
- u.value = !u.value, Q("mpv2:portal-collapsed", u.value);
66
+ function T() {
67
+ p.value ? (y.value = !y.value, h("mpv2:editor-collapsed", y.value)) : (g.value = !g.value, h("mpv2:portal-collapsed", g.value));
68
68
  }
69
- return (m, e) => {
70
- const d = f("RouterLink"), h = f("FmIcon"), j = f("FmCircularProgress"), L = f("FmButton");
71
- return s(), i(S, null, [
69
+ return (u, e) => {
70
+ const m = k("RouterLink"), R = k("FmIcon"), E = k("FmCircularProgress"), N = k("FmButton");
71
+ return s(), i(x, null, [
72
72
  e[14] || (e[14] = a("link", {
73
73
  href: "https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,400,0..1,0",
74
74
  rel: "stylesheet"
75
75
  }, null, -1)),
76
76
  a("div", {
77
- class: x(["mpv2-app portal-shell", { "portal-shell--collapsed": u.value }])
77
+ class: P(["mpv2-app portal-shell", { "portal-shell--collapsed": S.value }])
78
78
  }, [
79
79
  e[13] || (e[13] = a("a", {
80
80
  class: "portal-skip",
81
81
  href: "#miniprogram-content"
82
82
  }, "Skip to content", -1)),
83
- a("aside", H, [
83
+ a("aside", W, [
84
84
  a("button", {
85
85
  class: "portal-sidebar-toggle",
86
86
  type: "button",
87
- "aria-expanded": !u.value,
87
+ "aria-expanded": !S.value,
88
88
  "aria-controls": "miniprogram-navigation",
89
- "aria-label": u.value ? "Expand navigation" : "Collapse navigation",
90
- onClick: I
89
+ "aria-label": S.value ? "Expand navigation" : "Collapse navigation",
90
+ onClick: T
91
91
  }, [
92
- l(g, { name: "collapse" }),
92
+ l(b, { name: "collapse" }),
93
93
  e[0] || (e[0] = a("span", { class: "portal-nav-label" }, "Mini Program", -1))
94
- ], 8, J),
95
- a("nav", W, [
96
- (s(), i(S, null, w(B, (o) => l(d, {
94
+ ], 8, X),
95
+ a("nav", Y, [
96
+ (s(), i(x, null, B(F, (o) => l(m, {
97
97
  key: o.name,
98
- to: { name: o.name, query: t(k)(t(r).query) },
98
+ to: { name: o.name, query: t(_)(t(r).query) },
99
99
  class: "portal-nav-item",
100
100
  title: o.label,
101
101
  "aria-label": o.label,
102
102
  "aria-current": t(r).name === o.name ? "page" : void 0
103
103
  }, {
104
- default: c(() => [
105
- l(g, {
104
+ default: v(() => [
105
+ l(b, {
106
106
  name: o.icon
107
107
  }, null, 8, ["name"]),
108
- a("span", X, b(o.label), 1)
108
+ a("span", Z, c(o.label), 1)
109
109
  ]),
110
110
  _: 2
111
111
  }, 1032, ["to", "title", "aria-label", "aria-current"])), 64)),
112
112
  e[3] || (e[3] = a("p", { class: "portal-nav-caption" }, "Platforms", -1)),
113
- l(d, {
114
- to: C.value,
115
- class: x(["portal-nav-item", { "router-link-active": p.value }]),
113
+ l(m, {
114
+ to: w.value,
115
+ class: P(["portal-nav-item", { "router-link-active": p.value }]),
116
116
  title: "Mobile Ordering",
117
117
  "aria-label": "Mobile Ordering",
118
118
  "aria-current": p.value ? "page" : void 0
119
119
  }, {
120
- default: c(() => [
121
- l(g, { name: "mobile" }),
120
+ default: v(() => [
121
+ l(b, { name: "mobile" }),
122
122
  e[1] || (e[1] = a("span", { class: "portal-nav-label" }, "Mobile Ordering", -1))
123
123
  ]),
124
124
  _: 1
125
125
  }, 8, ["to", "class", "aria-current"]),
126
- (s(), i(S, null, w(["tablet", "kiosk"], (o) => l(d, {
126
+ (s(), i(x, null, B(["tablet", "kiosk"], (o) => l(m, {
127
127
  key: o,
128
- to: { name: `miniprogram-v2-${o}`, query: t(k)(t(r).query) },
128
+ to: { name: `miniprogram-v2-${o}`, query: t(_)(t(r).query) },
129
129
  class: "portal-nav-item",
130
130
  title: o === "tablet" ? "Tablet" : "Kiosk",
131
131
  "aria-label": o === "tablet" ? "Tablet" : "Kiosk"
132
132
  }, {
133
- default: c(() => [
134
- l(g, { name: o }, null, 8, ["name"]),
135
- a("span", Y, b(o === "tablet" ? "Tablet" : "Kiosk"), 1)
133
+ default: v(() => [
134
+ l(b, { name: o }, null, 8, ["name"]),
135
+ a("span", ee, c(o === "tablet" ? "Tablet" : "Kiosk"), 1)
136
136
  ]),
137
137
  _: 2
138
138
  }, 1032, ["to", "title", "aria-label"])), 64)),
139
139
  e[4] || (e[4] = a("div", { class: "portal-nav-divider" }, null, -1)),
140
- l(d, {
141
- to: { name: "miniprogram-v2-module-center", query: t(k)(t(r).query) },
142
- class: x(["portal-nav-item", { "router-link-active": t(r).name === "miniprogram-v2-module-detail" }]),
140
+ l(m, {
141
+ to: { name: "miniprogram-v2-module-center", query: t(_)(t(r).query) },
142
+ class: P(["portal-nav-item", { "router-link-active": t(r).name === "miniprogram-v2-module-detail" }]),
143
143
  title: "Module library",
144
144
  "aria-label": "Module library"
145
145
  }, {
146
- default: c(() => [
147
- l(h, {
146
+ default: v(() => [
147
+ l(R, {
148
148
  name: "widgets",
149
149
  size: "md"
150
150
  }),
@@ -153,51 +153,51 @@ const H = {
153
153
  _: 1
154
154
  }, 8, ["to", "class"])
155
155
  ]),
156
- l(d, {
157
- to: { name: "miniprogram-v2-settings", query: t(k)(t(r).query) },
156
+ l(m, {
157
+ to: { name: "miniprogram-v2-settings", query: t(_)(t(r).query) },
158
158
  class: "portal-nav-item portal-settings-link",
159
159
  title: "Settings",
160
160
  "aria-label": "Settings"
161
161
  }, {
162
- default: c(() => [
163
- l(g, { name: "settings" }),
162
+ default: v(() => [
163
+ l(b, { name: "settings" }),
164
164
  e[5] || (e[5] = a("span", { class: "portal-nav-label" }, "Settings", -1))
165
165
  ]),
166
166
  _: 1
167
167
  }, 8, ["to"])
168
168
  ]),
169
- a("div", Z, [
170
- p.value ? N("", !0) : (s(), i("header", ee, [
171
- a("span", null, b(t(n).businessName.value), 1),
169
+ a("div", ae, [
170
+ p.value ? O("", !0) : (s(), i("header", te, [
171
+ a("span", null, c(t(n).businessName.value), 1),
172
172
  e[6] || (e[6] = a("span", { "aria-hidden": "true" }, "/", -1)),
173
- a("span", null, b(q.value), 1)
173
+ a("span", null, c(L.value), 1)
174
174
  ])),
175
- a("div", ae, [
176
- t(n).businessId.value ? t(n).loading.value ? (s(), i("div", oe, [
177
- l(j, { size: "xl" }),
175
+ a("div", oe, [
176
+ t(n).businessId.value ? t(n).loading.value ? (s(), i("div", re, [
177
+ l(E, { size: "xl" }),
178
178
  e[8] || (e[8] = a("span", null, "Loading your Mini Program…", -1))
179
- ])) : t(n).error.value ? (s(), i("section", le, [
179
+ ])) : t(n).error.value ? (s(), i("section", ne, [
180
180
  e[9] || (e[9] = a("h1", null, "Could not open this Mini Program", -1)),
181
- a("p", null, b(t(n).error.value), 1),
182
- l(L, {
181
+ a("p", null, c(t(n).error.value), 1),
182
+ l(N, {
183
183
  label: "Try again",
184
184
  onClick: t(n).refresh
185
185
  }, null, 8, ["onClick"])
186
- ])) : M.value ? (s(), i("section", re, [
186
+ ])) : j.value ? (s(), i("section", se, [
187
187
  e[11] || (e[11] = a("h1", null, "Project unavailable", -1)),
188
188
  e[12] || (e[12] = a("p", null, "This link does not point to the selected business’s current mobile project.", -1)),
189
- l(d, {
190
- to: C.value,
189
+ l(m, {
190
+ to: w.value,
191
191
  class: "portal-link-button"
192
192
  }, {
193
- default: c(() => [...e[10] || (e[10] = [
194
- V("Open current project", -1)
193
+ default: v(() => [...e[10] || (e[10] = [
194
+ A("Open current project", -1)
195
195
  ])]),
196
196
  _: 1
197
197
  }, 8, ["to"])
198
- ])) : (s(), z(t(O), {
199
- key: `${t(n).businessId.value}:${y.value}`
200
- })) : (s(), i("section", te, [...e[7] || (e[7] = [
198
+ ])) : (s(), $(t(G), {
199
+ key: `${t(n).businessId.value}:${f.value}`
200
+ })) : (s(), i("section", le, [...e[7] || (e[7] = [
201
201
  a("h1", null, "Select a business", -1),
202
202
  a("p", null, "Choose a business in the Portal header to open its Mini Program.", -1)
203
203
  ])]))
@@ -207,7 +207,7 @@ const H = {
207
207
  ], 64);
208
208
  };
209
209
  }
210
- }), ge = /* @__PURE__ */ U(ne, [["__scopeId", "data-v-4eab214e"]]);
210
+ }), fe = /* @__PURE__ */ J(ie, [["__scopeId", "data-v-5b6aacb4"]]);
211
211
  export {
212
- ge as default
212
+ fe as default
213
213
  };