@feedmepos/mf-miniprogram-v2 0.2.2-dev.1 → 0.2.2-dev.11

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 (33) hide show
  1. package/dist/App-agMiJ0tU.js +197 -0
  2. package/dist/AppTemplatePicker-C0lZyhK2.js +184 -0
  3. package/dist/BrandFontPicker-BFjp8k2W.js +241 -0
  4. package/dist/BrandKitView-DUbIT3c8.js +249 -0
  5. package/dist/{ControlPlaneView-DmhLvgWt.js → ControlPlaneView-BN9srEtl.js} +7850 -7509
  6. package/dist/EcosystemView-BgjtBJy_.js +186 -0
  7. package/dist/{LegacyWorkspaceEntry-7DvIosoj.js → LegacyWorkspaceEntry-opz_kWz9.js} +1 -1
  8. package/dist/MobileProjectsView-QbURgYLB.js +296 -0
  9. package/dist/{ModuleCenterView-Dqp-2hbL.js → ModuleCenterView-DyMr3iWV.js} +34 -34
  10. package/dist/{ModuleDetailView-cpQ_UfS9.js → ModuleDetailView-BeXK89Cs.js} +49 -49
  11. package/dist/{PagesView-CrVOYOT9.js → PagesView-CegMd6GC.js} +3 -3
  12. package/dist/{PlatformUnavailableView-Cdy-1zpi.js → PlatformUnavailableView-j0_2YBKm.js} +2 -2
  13. package/dist/PortalIcon-DO0VrIoY.js +28 -0
  14. package/dist/{PortalSettingsView-CkW-avwg.js → PortalSettingsView-Bqw8tMZb.js} +5 -5
  15. package/dist/WorkspaceEntryView-e2EUnq9A.js +21 -0
  16. package/dist/app.js +17 -11
  17. package/dist/{controlPlane-wUT1G_Gr.js → controlPlane-CoEgf9BA.js} +9 -9
  18. package/dist/{index-BDHUHtRw.js → index-D5qXvcfE.js} +24 -15
  19. package/dist/package.json +1 -1
  20. package/dist/{portalContext-CTVzkJV7.js → portalContext-C4HL_0kl.js} +2 -2
  21. package/dist/portalNavigation-DOF4Ah49.js +28 -0
  22. package/dist/{routes-L0ady_Wy.js → routes-Boz_WlNM.js} +1 -0
  23. package/dist/style.css +1 -1
  24. package/dist/useBrandKit-BlKlqpo2.js +1020 -0
  25. package/dist/{useModuleCatalog-CD5N246F.js → useModuleCatalog-DqECds3F.js} +3 -3
  26. package/package.json +1 -1
  27. package/dist/App-C-7evg9W.js +0 -216
  28. package/dist/BrandKitView-B8t8RkHr.js +0 -221
  29. package/dist/EcosystemView--S4hk_t4.js +0 -232
  30. package/dist/PortalIcon-D1RqQMzD.js +0 -19
  31. package/dist/WorkspaceEntryView-ZdXuMQoJ.js +0 -21
  32. package/dist/portalNavigation-DKCfwTH8.js +0 -28
  33. package/dist/useBrandKit-CpyR2j6m.js +0 -924
@@ -0,0 +1,249 @@
1
+ import { defineComponent as H, ref as K, computed as z, onMounted as S, onScopeDispose as M, resolveComponent as y, openBlock as l, createElementBlock as r, createElementVNode as t, unref as a, createTextVNode as m, createBlock as _, Teleport as O, toDisplayString as p, createCommentVNode as d, createVNode as c, withCtx as Y, normalizeClass as G, normalizeStyle as j, Fragment as b, renderList as f, withDirectives as A, vModelText as I } from "vue";
2
+ import { _ as q, B as J } from "./BrandFontPicker-BFjp8k2W.js";
3
+ import { useRouter as Q, onBeforeRouteLeave as W } from "vue-router";
4
+ import { useDialog as X, useSnackbar as Z } from "@feedmepos/ui-library";
5
+ import { a as ee, C as D, t as E, F as te, u as ae, i as se } from "./useBrandKit-BlKlqpo2.js";
6
+ import { _ as oe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
+ const ne = { class: "portal-page bg-portal-bg-canvas text-portal-text-primary" }, le = { class: "portal-page-inner brand-page" }, re = { class: "portal-page-heading" }, ie = { class: "brand-help" }, de = { class: "brand-actions" }, ue = {
8
+ key: 0,
9
+ class: "brand-unsaved"
10
+ }, pe = {
11
+ key: 1,
12
+ class: "portal-notice"
13
+ }, ce = {
14
+ key: 2,
15
+ class: "portal-loading",
16
+ role: "status"
17
+ }, ve = {
18
+ key: 3,
19
+ role: "alert",
20
+ class: "portal-section portal-error"
21
+ }, me = {
22
+ key: 4,
23
+ role: "status"
24
+ }, be = { class: "portal-section" }, he = { class: "portal-section-head" }, ge = { class: "brand-color-grid" }, ye = ["value", "aria-label", "disabled", "onInput"], _e = { class: "brand-field-label" }, fe = ["onUpdate:modelValue", "aria-label", "aria-invalid", "disabled"], ke = {
25
+ key: 0,
26
+ class: "portal-error"
27
+ }, xe = { class: "brand-advanced" }, Ce = { class: "brand-role-grid" }, Be = ["value", "aria-label", "disabled", "onInput"], we = ["onUpdate:modelValue", "aria-label", "aria-invalid", "disabled"], Fe = { class: "portal-section" }, Ve = { class: "portal-section-head" }, Ke = { class: "brand-font-grid" }, Se = /* @__PURE__ */ H({
28
+ __name: "BrandKitView",
29
+ setup(Ae) {
30
+ const e = ae(), h = ee(), k = X(), L = Z(), x = K(!1), T = Q(), u = K(!1), C = ["primary", "secondary", "accent", "background.base", "text.primary"], $ = C.map((n) => D.find((s) => s.path === n)), P = D.filter((n) => !C.includes(n.path)), B = z(
31
+ () => !h.value || !e.state.loaded || e.state.loading || e.state.saving || e.hasInvalidColor.value || e.dirtyCount.value === 0
32
+ ), g = (n) => !!(e.state.colors[n] && !se(e.state.colors[n]));
33
+ function w(n, s) {
34
+ e.state.colors[n] = s.target.value, u.value = !1;
35
+ }
36
+ function F(n) {
37
+ n === "colors" ? e.state.colors = { ...e.state.savedColors } : e.state.fonts = { ...e.state.savedFonts }, u.value = !1;
38
+ }
39
+ function U() {
40
+ k.open({
41
+ title: "Save the live Brand Kit?",
42
+ message: "Colors and fonts are shared business settings. Apps using this kit pick up the change immediately. This does not build or publish application code.",
43
+ dismissAway: !0,
44
+ primaryActions: { text: "Save Brand Kit", close: !0 },
45
+ secondaryActions: { text: "Cancel", close: !0 }
46
+ }).onPrimary(() => {
47
+ e.save().then(() => {
48
+ u.value = !0;
49
+ }).catch(() => {
50
+ u.value = !1;
51
+ });
52
+ });
53
+ }
54
+ S(() => {
55
+ x.value = !0, e.load();
56
+ });
57
+ function V(n) {
58
+ !e.dirtyCount.value && !e.state.saving || (n.preventDefault(), n.returnValue = "");
59
+ }
60
+ return S(() => window.addEventListener("beforeunload", V)), M(() => window.removeEventListener("beforeunload", V)), W((n) => e.state.saving ? !1 : e.dirtyCount.value ? (k.open({
61
+ title: "Discard unsaved Brand Kit changes?",
62
+ message: "Your live Brand Kit has not changed. Leave this page and discard the changes you have not saved?",
63
+ dismissAway: !0,
64
+ primaryActions: { text: "Discard and leave", close: !0 },
65
+ secondaryActions: { text: "Keep editing", close: !0 }
66
+ }).onPrimary(() => {
67
+ e.discardEdits(), T.push(n);
68
+ }), !1) : !0), (n, s) => {
69
+ const N = y("FmIcon"), v = y("FmButton"), R = y("FmCircularProgress");
70
+ return l(), r("div", ne, [
71
+ t("div", le, [
72
+ t("header", re, [
73
+ s[7] || (s[7] = t("div", null, [
74
+ t("p", { class: "portal-eyebrow" }, "Applies to every surface"),
75
+ t("h1", null, "Your Business Identity")
76
+ ], -1)),
77
+ t("div", ie, [
78
+ s[6] || (s[6] = t("span", null, "Need help on brand kit?", -1)),
79
+ t("button", {
80
+ class: "brand-ask-remy",
81
+ type: "button",
82
+ onClick: s[0] || (s[0] = (o) => a(L).open({ message: "Coming soon" }, 3e3))
83
+ }, [...s[5] || (s[5] = [
84
+ t("img", {
85
+ src: q,
86
+ alt: "",
87
+ width: "20",
88
+ height: "20"
89
+ }, null, -1),
90
+ m(" Ask Remy ", -1)
91
+ ])])
92
+ ])
93
+ ]),
94
+ x.value ? (l(), _(O, {
95
+ key: 0,
96
+ to: "#portal-page-actions"
97
+ }, [
98
+ t("div", de, [
99
+ a(e).dirtyCount.value ? (l(), r("span", ue, p(a(e).dirtyCount.value) + " unsaved", 1)) : d("", !0),
100
+ c(v, {
101
+ label: "Save",
102
+ disabled: B.value,
103
+ loading: a(e).state.saving,
104
+ onClick: U
105
+ }, {
106
+ default: Y(() => [
107
+ t("span", {
108
+ class: G(["brand-save-content fm-typo-en-body-lg-600", { invisible: a(e).state.saving }])
109
+ }, [
110
+ c(N, {
111
+ name: "save",
112
+ "aria-hidden": "true",
113
+ style: j({ color: B.value ? "#c7c7cc" : "#ffffff", fontSize: "20px", width: "20px", height: "20px", lineHeight: "20px", flex: "0 0 20px" })
114
+ }, null, 8, ["style"]),
115
+ s[8] || (s[8] = m(" Save ", -1))
116
+ ], 2)
117
+ ]),
118
+ _: 1
119
+ }, 8, ["disabled", "loading"])
120
+ ])
121
+ ])) : d("", !0),
122
+ a(h) ? d("", !0) : (l(), r("p", pe, " You can view this Brand Kit, but need Brand Kit management permission to save changes. ")),
123
+ a(e).state.loading ? (l(), r("div", ce, [
124
+ c(R, { size: "xl" }),
125
+ s[9] || (s[9] = m("Loading Brand Kit… ", -1))
126
+ ])) : d("", !0),
127
+ a(e).state.error ? (l(), r("div", ve, [
128
+ t("p", null, p(a(e).state.error), 1),
129
+ a(e).state.loaded ? d("", !0) : (l(), _(v, {
130
+ key: 0,
131
+ label: "Try again",
132
+ variant: "secondary",
133
+ onClick: s[1] || (s[1] = (o) => a(e).load(!0))
134
+ }))
135
+ ])) : d("", !0),
136
+ u.value && !a(e).dirtyCount.value && !a(e).state.error ? (l(), r("p", me, " Brand Kit saved. Apps using this kit can now pick up the changes. ")) : d("", !0),
137
+ a(e).state.loaded && !a(e).state.loading ? (l(), r(b, { key: 5 }, [
138
+ t("section", be, [
139
+ t("div", he, [
140
+ s[10] || (s[10] = t("div", null, [
141
+ t("h2", null, "Colors"),
142
+ t("p", { class: "portal-description" }, "The colors that represent your brand identity.")
143
+ ], -1)),
144
+ c(v, {
145
+ label: "Reset unsaved colors",
146
+ variant: "tertiary",
147
+ disabled: a(e).state.saving,
148
+ onClick: s[2] || (s[2] = (o) => F("colors"))
149
+ }, null, 8, ["disabled"])
150
+ ]),
151
+ t("div", ge, [
152
+ (l(!0), r(b, null, f(a($), (o) => (l(), r("label", {
153
+ key: o.path,
154
+ class: "brand-color-card"
155
+ }, [
156
+ t("input", {
157
+ type: "color",
158
+ value: a(E)(a(e).state.colors[o.path] ?? ""),
159
+ "aria-label": `${o.label} color picker`,
160
+ disabled: a(e).state.saving,
161
+ onInput: (i) => w(o.path, i)
162
+ }, null, 40, ye),
163
+ t("span", _e, p(o.path === "background.base" ? "Background" : o.path === "text.primary" ? "Text" : o.label), 1),
164
+ A(t("input", {
165
+ "onUpdate:modelValue": (i) => a(e).state.colors[o.path] = i,
166
+ class: "brand-value",
167
+ "aria-label": `${o.path} hex color`,
168
+ "aria-invalid": g(o.path),
169
+ disabled: a(e).state.saving,
170
+ placeholder: "App default",
171
+ spellcheck: "false"
172
+ }, null, 8, fe), [
173
+ [I, a(e).state.colors[o.path]]
174
+ ]),
175
+ g(o.path) ? (l(), r("small", ke, "Enter a hex color")) : d("", !0)
176
+ ]))), 128))
177
+ ]),
178
+ t("details", xe, [
179
+ s[11] || (s[11] = t("summary", null, [
180
+ m("More color roles "),
181
+ t("span", null, "Keep control of text, surfaces and status colors")
182
+ ], -1)),
183
+ s[12] || (s[12] = t("p", { class: "portal-description" }, " Each role is saved independently. Changing a brand color does not automatically replace text or status colors. ", -1)),
184
+ t("div", Ce, [
185
+ (l(!0), r(b, null, f(a(P), (o) => (l(), r("label", {
186
+ key: o.path
187
+ }, [
188
+ t("span", null, p(o.group) + " · " + p(o.label), 1),
189
+ t("div", null, [
190
+ t("input", {
191
+ type: "color",
192
+ value: a(E)(a(e).state.colors[o.path] ?? ""),
193
+ "aria-label": `${o.path} color picker`,
194
+ disabled: a(e).state.saving,
195
+ onInput: (i) => w(o.path, i)
196
+ }, null, 40, Be),
197
+ A(t("input", {
198
+ "onUpdate:modelValue": (i) => a(e).state.colors[o.path] = i,
199
+ "aria-label": `${o.path} hex color`,
200
+ "aria-invalid": g(o.path),
201
+ disabled: a(e).state.saving,
202
+ class: "brand-value",
203
+ placeholder: "App default",
204
+ spellcheck: "false"
205
+ }, null, 8, we), [
206
+ [I, a(e).state.colors[o.path]]
207
+ ])
208
+ ]),
209
+ t("small", null, p(o.hint), 1)
210
+ ]))), 128))
211
+ ])
212
+ ])
213
+ ]),
214
+ t("section", Fe, [
215
+ t("div", Ve, [
216
+ s[13] || (s[13] = t("div", null, [
217
+ t("h2", null, "Typeface"),
218
+ t("p", { class: "portal-description" }, "Fonts used in your interfaces.")
219
+ ], -1)),
220
+ c(v, {
221
+ label: "Reset unsaved fonts",
222
+ variant: "tertiary",
223
+ disabled: a(e).state.saving,
224
+ onClick: s[3] || (s[3] = (o) => F("fonts"))
225
+ }, null, 8, ["disabled"])
226
+ ]),
227
+ t("div", Ke, [
228
+ (l(!0), r(b, null, f(a(te), (o) => (l(), _(J, {
229
+ key: o.path,
230
+ modelValue: a(e).state.fonts[o.path],
231
+ "onUpdate:modelValue": [
232
+ (i) => a(e).state.fonts[o.path] = i,
233
+ s[4] || (s[4] = (i) => u.value = !1)
234
+ ],
235
+ label: o.label === "Heading" ? "Headings" : o.label,
236
+ disabled: !a(h) || a(e).state.saving
237
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "disabled"]))), 128))
238
+ ]),
239
+ s[14] || (s[14] = t("p", { class: "portal-description brand-font-help" }, "Supported by Google Fonts", -1))
240
+ ])
241
+ ], 64)) : d("", !0)
242
+ ])
243
+ ]);
244
+ };
245
+ }
246
+ }), Pe = /* @__PURE__ */ oe(Se, [["__scopeId", "data-v-69311627"]]);
247
+ export {
248
+ Pe as default
249
+ };