@feedmepos/mf-menu 1.0.1-dev.1 → 1.0.1-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.
Files changed (65) hide show
  1. package/dist/{App-CXamBqwS.js → App-DEoljb3M.js} +548 -534
  2. package/dist/{BindingTable.vue_vue_type_script_setup_true_lang-DzNuoUmQ.js → BindingTable.vue_vue_type_script_setup_true_lang-DACfW6SY.js} +1 -1
  3. package/dist/{Catalog-BHb5ZB6_.js → Catalog-B6mXH-Ez.js} +4 -4
  4. package/dist/{CatalogBinding-X-AHRvcJ.js → CatalogBinding-CZbbxQCa.js} +3 -3
  5. package/dist/{CatalogEditTabs.vue_vue_type_script_setup_true_lang-NFeJpXLh.js → CatalogEditTabs.vue_vue_type_script_setup_true_lang-CFjBkgkl.js} +3 -3
  6. package/dist/{CatalogEditor.vue_vue_type_script_setup_true_lang-CrrkUkfD.js → CatalogEditor.vue_vue_type_script_setup_true_lang-owNQUf8y.js} +6 -6
  7. package/dist/{CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-C43Ettr2.js → CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-DJLjbLGK.js} +3 -3
  8. package/dist/{Category-MXhBgKnb.js → Category-B37n9Row.js} +2 -2
  9. package/dist/{Category-DsTyhvYK.js → Category-DHGrowud.js} +5 -5
  10. package/dist/{CategoryList.vue_vue_type_script_setup_true_lang-BJTKjE25.js → CategoryList.vue_vue_type_script_setup_true_lang-_Ux8uXwn.js} +92 -91
  11. package/dist/{CookingGuide-yBqMRWrs.js → CookingGuide-4i1KsBxo.js} +262 -256
  12. package/dist/{Group-CMKmmN3C.js → Group-DVB_G6lM.js} +5 -5
  13. package/dist/{Group-DINfX6Wn.js → Group-N5_9GK2v.js} +2 -2
  14. package/dist/{GroupList.vue_vue_type_script_setup_true_lang-BEBZmPdu.js → GroupList.vue_vue_type_script_setup_true_lang-BDWyiP8J.js} +5 -5
  15. package/dist/{Ingredient-BNQ2LIqN.js → Ingredient-C-puVgJK.js} +3 -3
  16. package/dist/LinkProductSideSheet.vue_vue_type_script_setup_true_lang-ChDd6vJd.js +707 -0
  17. package/dist/{MenuSetting-DARGZW4u.js → MenuSetting-QhU37DTL.js} +546 -513
  18. package/dist/{OrderPacing-DuGDpSLN.js → OrderPacing-COY_HJ8I.js} +96 -93
  19. package/dist/{OrderPacingFields.vue_vue_type_script_setup_true_lang-2V1SiXyH.js → OrderPacingFields.vue_vue_type_script_setup_true_lang-BAbojJnz.js} +1 -1
  20. package/dist/Preview-DrbsRznu.js +321 -0
  21. package/dist/{PriceTierNotice.vue_vue_type_script_setup_true_lang-hbG9eqTr.js → PriceTierNotice.vue_vue_type_script_setup_true_lang-BTJwvrlT.js} +1 -1
  22. package/dist/{PrintRoute-N0gXx2Wx.js → PrintRoute-DVJAvYq-.js} +158 -152
  23. package/dist/{Product-Cp2dYxav.js → Product-ClT1oFVA.js} +4 -4
  24. package/dist/{ProductEditorHost.vue_vue_type_script_setup_true_lang-imCNnKvi.js → ProductEditorHost.vue_vue_type_script_setup_true_lang-B4qpB-yA.js} +2 -2
  25. package/dist/{ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-BqZ2jz39.js → ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-BWZwFal7.js} +3 -3
  26. package/dist/{ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-KrQJLxU2.js → ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-yZSYrcYe.js} +1 -1
  27. package/dist/{ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-i0smKuFw.js → ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-3SaYTgCI.js} +1181 -1174
  28. package/dist/ProductInternalTools-DRcfn5DE.js +2147 -0
  29. package/dist/{ProductInventoryDialog-DmN4sXP_.js → ProductInventoryDialog-i48yqlp_.js} +1 -1
  30. package/dist/{ProductInventoryDialog.vue_vue_type_script_setup_true_lang-UOIkIylV.js → ProductInventoryDialog.vue_vue_type_script_setup_true_lang-C7z4BHKp.js} +1 -1
  31. package/dist/{ProductList.vue_vue_type_script_setup_true_lang-C262_Dsq.js → ProductList.vue_vue_type_script_setup_true_lang-DkIwQeby.js} +1990 -1967
  32. package/dist/{ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-wTwunTLr.js → ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-Dr0r1hYM.js} +1 -1
  33. package/dist/{Products-BSthFwvC.js → Products-B4yaF9Y5.js} +3 -3
  34. package/dist/{Publish-BcUXfV7Z.js → Publish-D8pKpnju.js} +3 -3
  35. package/dist/{Recipe-Nhmop5G3.js → Recipe-Cz4s5W4k.js} +3 -3
  36. package/dist/{Scheduler-DEMpmXNY.js → Scheduler-xE_rjFjJ.js} +3 -3
  37. package/dist/{ServingSequence-Dkd70bsy.js → ServingSequence-BjD1Xn6Q.js} +103 -97
  38. package/dist/{Setting-LWEFUdQK.js → Setting-BrD0NB_a.js} +6 -6
  39. package/dist/{Subcategory-YvAbjlgi.js → Subcategory-wbHw1iCU.js} +141 -129
  40. package/dist/{Takeaway-DUoXWAQT.js → Takeaway-CIqSThUQ.js} +5 -5
  41. package/dist/{Takeaway-CoK-aka9.js → Takeaway-DM7weBPk.js} +2 -2
  42. package/dist/{TakeawayList.vue_vue_type_script_setup_true_lang-D4xu-gHa.js → TakeawayList.vue_vue_type_script_setup_true_lang-HZP5jmAy.js} +117 -111
  43. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-1iGMM-Xt.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-CLeJxNfG.js} +6 -6
  44. package/dist/{Unit-BIoPBeiP.js → Unit-RHuHWCCg.js} +2 -2
  45. package/dist/{Variant-X4llcQO6.js → Variant-MA-mdYxx.js} +114 -108
  46. package/dist/{_id_-gKOWPBVp.js → _id_-CO1c1eIn.js} +3 -3
  47. package/dist/{app-DUyvBFfY.js → app-DnIyFwTs.js} +434 -397
  48. package/dist/app.js +1 -1
  49. package/dist/apps/mf-menu/src/app.d.ts +360 -0
  50. package/dist/apps/mf-menu/src/components/preview/MenuPreview.vue.d.ts +13 -0
  51. package/dist/apps/mf-menu/src/components/preview/simulatorPort.d.ts +23 -0
  52. package/dist/apps/mf-menu/src/router/shared.d.ts +34 -0
  53. package/dist/apps/mf-menu/src/sdk/import-export.d.ts +8 -2
  54. package/dist/apps/mf-menu/src/utils/ruleValueKey.d.ts +12 -0
  55. package/dist/apps/mf-menu/src/views/Preview/Preview.vue.d.ts +2 -0
  56. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  57. package/dist/assets/{menu-compute--bTrGqr1.js → menu-compute-BYzYhsd6.js} +36 -36
  58. package/dist/assets/{validate-menu-mv20U_e_.js → validate-menu-oaYEuMiz.js} +4 -4
  59. package/dist/mf-menu.css +1 -1
  60. package/dist/{provide-CxmHxIEV.js → provide-UZbVvMqZ.js} +57396 -55718
  61. package/dist/ruleValueKey-BF52PuHb.js +10 -0
  62. package/dist/{useActionFeedback-Di6FGqLG.js → useActionFeedback-CfPMryOm.js} +1 -1
  63. package/package.json +1 -1
  64. package/dist/LinkProductSideSheet.vue_vue_type_script_setup_true_lang-B8n517dM.js +0 -671
  65. package/dist/ProductInternalTools-CJG8TsE4.js +0 -2906
@@ -0,0 +1,321 @@
1
+ import { defineComponent as M, ref as K, computed as o, shallowRef as Q, watch as T, onBeforeUnmount as X, resolveComponent as L, openBlock as s, createBlock as p, unref as t, withCtx as Y, createElementBlock as U, Fragment as Z, createElementVNode as i, createCommentVNode as w, toDisplayString as h, createVNode as D, withDirectives as ee, vShow as te } from "vue";
2
+ import { useI18n as le } from "@feedmepos/mf-common";
3
+ import { _ as I } from "./index.vue_vue_type_script_setup_true_lang-CGPDazqs.js";
4
+ import { _ as ae } from "./PageLayout.vue_vue_type_script_setup_true_lang-B3szUH39.js";
5
+ import { b as ue, u as ne, a as se } from "./provide-UZbVvMqZ.js";
6
+ function oe(g, r) {
7
+ const l = new URL(g);
8
+ return l.searchParams.set("parent", r), { src: l.toString(), origin: l.origin };
9
+ }
10
+ function ie(g, r, l = window) {
11
+ return {
12
+ post(k) {
13
+ var d, v;
14
+ (v = (d = g()) == null ? void 0 : d.contentWindow) == null || v.postMessage(k, r);
15
+ },
16
+ subscribe(k) {
17
+ const d = (v) => {
18
+ var n;
19
+ if (v.origin !== r) return;
20
+ const f = (n = g()) == null ? void 0 : n.contentWindow;
21
+ !f || v.source !== f || k(v.data);
22
+ };
23
+ return l.addEventListener("message", d), () => l.removeEventListener("message", d);
24
+ }
25
+ };
26
+ }
27
+ const re = { class: "flex flex-wrap items-end gap-16 pb-24" }, me = {
28
+ key: 4,
29
+ class: "flex flex-col gap-4"
30
+ }, ce = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary" }, de = { class: "flex flex-wrap items-start gap-24" }, ve = { class: "relative flex min-w-0 flex-[999_1_480px] flex-col items-center rounded-lg bg-fm-color-neutral-gray-100 p-16" }, pe = ["src", "title"], _e = {
31
+ key: 0,
32
+ class: "absolute inset-0 flex flex-col items-center justify-center gap-8",
33
+ "data-testid": "menu-preview-loading"
34
+ }, fe = { class: "text-fm-color-typo-secondary" }, we = {
35
+ key: 2,
36
+ class: "pt-8 text-fm-color-typo-secondary",
37
+ "data-testid": "menu-preview-summary"
38
+ }, ge = ["aria-label"], be = { class: "fm-typo-en-body-lg-600" }, he = { class: "flex list-disc flex-col gap-4 pl-16" }, ke = /* @__PURE__ */ M({
39
+ __name: "MenuPreview",
40
+ props: {
41
+ sdk: {},
42
+ simulatorUrl: {},
43
+ parentOrigin: {}
44
+ },
45
+ setup(g) {
46
+ const r = g, { t: l, locale: k } = le(), d = ue(), v = K(null), f = o(
47
+ () => r.simulatorUrl ? oe(
48
+ r.simulatorUrl,
49
+ r.parentOrigin ?? window.location.origin
50
+ ) : null
51
+ ), n = f.value ? r.sdk.preview.open({ appLocale: k.value }) : null, x = n ? ne(n.view) : Q({ status: "loading" }), u = o(
52
+ () => x.value.status === "ready" ? x.value.value : null
53
+ );
54
+ let b = null;
55
+ T(
56
+ v,
57
+ (e) => {
58
+ b == null || b(), b = e && f.value && n ? n.attach(
59
+ ie(() => v.value, f.value.origin)
60
+ ) : null;
61
+ },
62
+ { flush: "post" }
63
+ ), X(() => {
64
+ b == null || b(), n == null || n.dispose();
65
+ });
66
+ const S = (e) => !!e && e.state !== "hidden", F = (e) => (e == null ? void 0 : e.state) === "disabled", R = o(
67
+ () => {
68
+ var e;
69
+ return (((e = u.value) == null ? void 0 : e.restaurants) ?? []).map((a) => ({
70
+ label: a.label,
71
+ value: a.id
72
+ }));
73
+ }
74
+ ), N = {
75
+ default: "menu.menu_preview.usage.default",
76
+ pickup: "menu.menu_preview.usage.pickup",
77
+ takeaway: "menu.menu_preview.usage.takeaway",
78
+ additional: "menu.menu_preview.usage.additional"
79
+ }, $ = o(
80
+ () => {
81
+ var e;
82
+ return (((e = u.value) == null ? void 0 : e.catalogs) ?? []).map((a) => ({
83
+ label: a.name,
84
+ value: a.id,
85
+ ...a.usages.length > 0 ? {
86
+ sublabel: a.usages.map((m) => l(N[m])).join(l("menu.common.labels.list_separator"))
87
+ } : {}
88
+ }));
89
+ }
90
+ ), j = o(
91
+ () => {
92
+ var e;
93
+ return (((e = u.value) == null ? void 0 : e.schedulers) ?? []).map((a) => ({
94
+ label: a.name,
95
+ value: a.id
96
+ }));
97
+ }
98
+ ), G = o(
99
+ () => {
100
+ var e;
101
+ return (((e = u.value) == null ? void 0 : e.locales) ?? []).map((a) => ({
102
+ label: a.name,
103
+ value: a.code
104
+ }));
105
+ }
106
+ ), O = {
107
+ phone: "menu.menu_preview.device.phone",
108
+ tablet: "menu.menu_preview.device.tablet",
109
+ kiosk: "menu.menu_preview.device.kiosk"
110
+ }, W = {
111
+ phone: "smartphone",
112
+ tablet: "tablet",
113
+ kiosk: "tv"
114
+ }, V = o(
115
+ () => {
116
+ var e;
117
+ return (((e = u.value) == null ? void 0 : e.devices) ?? []).map((a) => ({
118
+ device: a,
119
+ item: {
120
+ label: l(O[a]),
121
+ icon: W[a]
122
+ }
123
+ }));
124
+ }
125
+ ), q = o(
126
+ () => {
127
+ var e;
128
+ return ((e = V.value.find((a) => {
129
+ var m;
130
+ return a.device === ((m = u.value) == null ? void 0 : m.device);
131
+ })) == null ? void 0 : e.item) ?? null;
132
+ }
133
+ );
134
+ function z(e) {
135
+ const a = V.value.find((m) => m.item === e);
136
+ a && (n == null || n.selectDevice(a.device));
137
+ }
138
+ const y = o(() => {
139
+ var e;
140
+ return ((e = u.value) == null ? void 0 : e.simulator) ?? null;
141
+ }), A = o(
142
+ () => {
143
+ var e, a;
144
+ return ((e = y.value) == null ? void 0 : e.status) === "connecting" || ((a = y.value) == null ? void 0 : a.status) === "building";
145
+ }
146
+ ), C = o(
147
+ () => {
148
+ var e;
149
+ return ((e = y.value) == null ? void 0 : e.status) === "failed" ? y.value : null;
150
+ }
151
+ ), B = o(() => {
152
+ const e = y.value;
153
+ return (e == null ? void 0 : e.status) !== "ready" ? null : l("menu.menu_preview.status.summary", {
154
+ categories: l(
155
+ "menu.menu_preview.status.categories",
156
+ { count: e.categoryCount },
157
+ e.categoryCount
158
+ ),
159
+ items: l(
160
+ "menu.menu_preview.status.items",
161
+ { count: e.itemCount },
162
+ e.itemCount
163
+ )
164
+ });
165
+ });
166
+ function E() {
167
+ n == null || n.retry();
168
+ }
169
+ return (e, a) => {
170
+ const m = L("FmSelect"), H = L("FmButtonGroup"), J = L("FmCircularProgress");
171
+ return s(), p(ae, {
172
+ heading: t(l)("menu.menu_preview.title"),
173
+ subheading: t(l)("menu.menu_preview.subtitle")
174
+ }, {
175
+ default: Y(() => {
176
+ var P;
177
+ return [
178
+ f.value ? t(x).status === "error" ? (s(), p(t(I), {
179
+ key: 1,
180
+ title: t(l)("menu.menu_preview.load_failed.title"),
181
+ subtitle: t(d)(t(x).error.message),
182
+ action: {
183
+ text: t(l)("menu.menu_preview.actions.retry"),
184
+ icon: "refresh",
185
+ callback: E
186
+ }
187
+ }, null, 8, ["title", "subtitle", "action"])) : t(x).status === "unavailable" ? (s(), p(t(I), {
188
+ key: 2,
189
+ title: t(l)("menu.menu_preview.title"),
190
+ subtitle: t(d)(t(x).reason)
191
+ }, null, 8, ["title", "subtitle"])) : (s(), U(Z, { key: 3 }, [
192
+ i("div", re, [
193
+ u.value && S(u.value.restaurantSelector) ? (s(), p(m, {
194
+ key: 0,
195
+ class: "w-[240px]",
196
+ "data-testid": "menu-preview-restaurant",
197
+ label: t(l)("menu.menu_preview.labels.restaurant"),
198
+ items: R.value,
199
+ "model-value": u.value.restaurantId,
200
+ disabled: F(u.value.restaurantSelector),
201
+ searchable: "",
202
+ "onUpdate:modelValue": a[0] || (a[0] = (_) => {
203
+ var c;
204
+ return (c = t(n)) == null ? void 0 : c.selectRestaurant(_);
205
+ })
206
+ }, null, 8, ["label", "items", "model-value", "disabled"])) : w("", !0),
207
+ u.value && S(u.value.catalogSelector) ? (s(), p(m, {
208
+ key: 1,
209
+ class: "w-[260px]",
210
+ "data-testid": "menu-preview-catalog",
211
+ label: t(l)("menu.menu_preview.labels.catalog"),
212
+ placeholder: t(l)("menu.menu_preview.labels.no_catalog"),
213
+ items: $.value,
214
+ "model-value": u.value.catalogId,
215
+ disabled: F(u.value.catalogSelector),
216
+ "onUpdate:modelValue": a[1] || (a[1] = (_) => {
217
+ var c;
218
+ return (c = t(n)) == null ? void 0 : c.selectCatalog(_);
219
+ })
220
+ }, null, 8, ["label", "placeholder", "items", "model-value", "disabled"])) : w("", !0),
221
+ u.value && S(u.value.schedulerSelector) ? (s(), p(m, {
222
+ key: 2,
223
+ class: "w-[200px]",
224
+ "data-testid": "menu-preview-scheduler",
225
+ label: t(l)("menu.menu_preview.labels.scheduler"),
226
+ items: j.value,
227
+ "model-value": u.value.schedulerId,
228
+ disabled: F(u.value.schedulerSelector),
229
+ "onUpdate:modelValue": a[2] || (a[2] = (_) => {
230
+ var c;
231
+ return (c = t(n)) == null ? void 0 : c.selectScheduler(_);
232
+ })
233
+ }, null, 8, ["label", "items", "model-value", "disabled"])) : w("", !0),
234
+ u.value && S(u.value.localeSelector) ? (s(), p(m, {
235
+ key: 3,
236
+ class: "w-[180px]",
237
+ "data-testid": "menu-preview-locale",
238
+ label: t(l)("menu.menu_preview.labels.menu_language"),
239
+ "label-info": t(l)("menu.menu_preview.labels.menu_language_info"),
240
+ items: G.value,
241
+ "model-value": u.value.locale,
242
+ "onUpdate:modelValue": a[3] || (a[3] = (_) => {
243
+ var c;
244
+ return (c = t(n)) == null ? void 0 : c.selectLocale(_);
245
+ })
246
+ }, null, 8, ["label", "label-info", "items", "model-value"])) : w("", !0),
247
+ u.value ? (s(), U("div", me, [
248
+ i("span", ce, h(t(l)("menu.menu_preview.labels.device")), 1),
249
+ D(H, {
250
+ "data-testid": "menu-preview-device",
251
+ items: V.value.map((_) => _.item),
252
+ "model-value": q.value,
253
+ "onUpdate:modelValue": z
254
+ }, null, 8, ["items", "model-value"])
255
+ ])) : w("", !0)
256
+ ]),
257
+ i("div", de, [
258
+ i("div", ve, [
259
+ ee(i("iframe", {
260
+ ref_key: "frameElement",
261
+ ref: v,
262
+ class: "h-[880px] w-full border-0",
263
+ "data-testid": "menu-preview-frame",
264
+ src: f.value.src,
265
+ title: t(l)("menu.menu_preview.frame_title")
266
+ }, null, 8, pe), [
267
+ [te, !C.value]
268
+ ]),
269
+ A.value ? (s(), U("div", _e, [
270
+ D(J),
271
+ i("span", fe, h(((P = y.value) == null ? void 0 : P.status) === "connecting" ? t(l)("menu.menu_preview.status.connecting") : t(l)("menu.menu_preview.status.building")), 1)
272
+ ])) : w("", !0),
273
+ C.value ? (s(), p(t(I), {
274
+ key: 1,
275
+ "data-testid": "menu-preview-failed",
276
+ title: t(l)("menu.menu_preview.failed.title"),
277
+ subtitle: t(d)(C.value.reason),
278
+ action: C.value.retryable ? {
279
+ text: t(l)("menu.menu_preview.actions.retry"),
280
+ icon: "refresh",
281
+ callback: E
282
+ } : void 0
283
+ }, null, 8, ["title", "subtitle", "action"])) : w("", !0),
284
+ B.value ? (s(), U("p", we, h(B.value), 1)) : w("", !0)
285
+ ]),
286
+ i("section", {
287
+ class: "flex flex-[1_1_280px] flex-col gap-8 rounded-lg border border-fm-color-neutral-gray-200 p-16",
288
+ "aria-label": t(l)("menu.menu_preview.limits.title")
289
+ }, [
290
+ i("h2", be, h(t(l)("menu.menu_preview.limits.title")), 1),
291
+ i("ul", he, [
292
+ i("li", null, h(t(l)("menu.menu_preview.limits.stock")), 1),
293
+ i("li", null, h(t(l)("menu.menu_preview.limits.pricing")), 1),
294
+ i("li", null, h(t(l)("menu.menu_preview.limits.checkout")), 1)
295
+ ])
296
+ ], 8, ge)
297
+ ])
298
+ ], 64)) : (s(), p(t(I), {
299
+ key: 0,
300
+ title: t(l)("menu.menu_preview.not_configured.title"),
301
+ subtitle: t(l)("menu.menu_preview.not_configured.subtitle")
302
+ }, null, 8, ["title", "subtitle"]))
303
+ ];
304
+ }),
305
+ _: 1
306
+ }, 8, ["heading", "subheading"]);
307
+ };
308
+ }
309
+ }), Ie = /* @__PURE__ */ M({
310
+ __name: "Preview",
311
+ setup(g) {
312
+ const r = se(), l = "https://menu-simulator-dev.feedme-dev.workers.dev";
313
+ return (k, d) => (s(), p(ke, {
314
+ sdk: t(r),
315
+ "simulator-url": t(l)
316
+ }, null, 8, ["sdk", "simulator-url"]));
317
+ }
318
+ });
319
+ export {
320
+ Ie as default
321
+ };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as a, computed as c, resolveComponent as m, openBlock as l, createBlock as u, unref as p, createCommentVNode as i } from "vue";
2
2
  import { useI18n as d } from "@feedmepos/mf-common";
3
- import { u as _ } from "./provide-CxmHxIEV.js";
3
+ import { u as _ } from "./provide-UZbVvMqZ.js";
4
4
  const b = /* @__PURE__ */ a({
5
5
  __name: "PriceTierNotice",
6
6
  props: {