@feedmepos/mf-menu 1.0.1-dev.2 → 1.0.1-dev.4

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 (60) hide show
  1. package/dist/{App-CdIN4s5n.js → App-DhYTzDY0.js} +546 -533
  2. package/dist/{BindingTable.vue_vue_type_script_setup_true_lang-CoHlJwpz.js → BindingTable.vue_vue_type_script_setup_true_lang-BUiZxX6w.js} +1 -1
  3. package/dist/{Catalog-DjAubC9s.js → Catalog-DWj_TPwj.js} +4 -4
  4. package/dist/{CatalogBinding-5JNRTbyZ.js → CatalogBinding-DCUFGwTy.js} +3 -3
  5. package/dist/{CatalogEditTabs.vue_vue_type_script_setup_true_lang-BorOjk1k.js → CatalogEditTabs.vue_vue_type_script_setup_true_lang-BYeOydGv.js} +3 -3
  6. package/dist/{CatalogEditor.vue_vue_type_script_setup_true_lang-CkF7O_V-.js → CatalogEditor.vue_vue_type_script_setup_true_lang-BeuAv0jC.js} +6 -6
  7. package/dist/{CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-3fL43MuR.js → CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-EnajbZtY.js} +3 -3
  8. package/dist/{Category-COug7fz8.js → Category-B9jpP8pf.js} +2 -2
  9. package/dist/{Category-BbiN4hd7.js → Category-C9BtFwBO.js} +5 -5
  10. package/dist/{CategoryList.vue_vue_type_script_setup_true_lang-B_9aPMIN.js → CategoryList.vue_vue_type_script_setup_true_lang-C11l9kUD.js} +92 -91
  11. package/dist/{CookingGuide-Dg7kuF6l.js → CookingGuide-xx0mHc6j.js} +262 -256
  12. package/dist/{Group-BRpmTqyT.js → Group-BkyVQTHZ.js} +5 -5
  13. package/dist/{Group-C-hwlkgJ.js → Group-DaNj2hu9.js} +2 -2
  14. package/dist/{GroupList.vue_vue_type_script_setup_true_lang-DowoJ3WM.js → GroupList.vue_vue_type_script_setup_true_lang-By6udos1.js} +5 -5
  15. package/dist/{Ingredient-BQYnARdC.js → Ingredient-DbV2TbTY.js} +3 -3
  16. package/dist/{LinkProductSideSheet.vue_vue_type_script_setup_true_lang-CgTDkHle.js → LinkProductSideSheet.vue_vue_type_script_setup_true_lang-DS7hUQpE.js} +1 -1
  17. package/dist/{MenuSetting-DsdM2_OW.js → MenuSetting-COJaCmJN.js} +3 -3
  18. package/dist/{OrderPacing-5x2YH-_l.js → OrderPacing-D6y9LBM_.js} +96 -93
  19. package/dist/{OrderPacingFields.vue_vue_type_script_setup_true_lang-DVGJjpiM.js → OrderPacingFields.vue_vue_type_script_setup_true_lang--J9nxeca.js} +1 -1
  20. package/dist/Preview-B19pRXmI.js +325 -0
  21. package/dist/{PriceTierNotice.vue_vue_type_script_setup_true_lang-vmxVZ2ya.js → PriceTierNotice.vue_vue_type_script_setup_true_lang-DwwfXWL8.js} +1 -1
  22. package/dist/{PrintRoute-COkCv4gf.js → PrintRoute-DkZaQWrC.js} +158 -152
  23. package/dist/{Product-BJFb_J4h.js → Product-DkxV4IfT.js} +4 -4
  24. package/dist/{ProductEditorHost.vue_vue_type_script_setup_true_lang-Tpp8MBYS.js → ProductEditorHost.vue_vue_type_script_setup_true_lang-BuhTMFZF.js} +2 -2
  25. package/dist/{ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-C25Pwqme.js → ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-B_EmJhpN.js} +3 -3
  26. package/dist/{ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-BMAtAK9D.js → ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-CniqNe-9.js} +1 -1
  27. package/dist/{ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-Dl4Zr5tx.js → ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-Be9Y5Cc1.js} +1181 -1174
  28. package/dist/ProductInternalTools-CW7gKvtC.js +2147 -0
  29. package/dist/{ProductInventoryDialog-C3ruRWU5.js → ProductInventoryDialog-DA1A9YlU.js} +1 -1
  30. package/dist/{ProductInventoryDialog.vue_vue_type_script_setup_true_lang-MpdIixqI.js → ProductInventoryDialog.vue_vue_type_script_setup_true_lang-DDKjs88F.js} +1 -1
  31. package/dist/{ProductList.vue_vue_type_script_setup_true_lang-9_ohgfqE.js → ProductList.vue_vue_type_script_setup_true_lang-63u-Pxh-.js} +2328 -2298
  32. package/dist/{ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-Ctbz-8cd.js → ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-DjrHHLkY.js} +1 -1
  33. package/dist/{Products-DMrjQFfu.js → Products-CFxCduVf.js} +3 -3
  34. package/dist/{Publish-f6g0dIao.js → Publish-C50PRaWB.js} +3 -3
  35. package/dist/{Recipe-p-wxadSN.js → Recipe-CGwAatcb.js} +3 -3
  36. package/dist/{Scheduler-CtebRafn.js → Scheduler-hIe_BdwS.js} +3 -3
  37. package/dist/{ServingSequence-CEd4ywOQ.js → ServingSequence-CIzDiSll.js} +103 -97
  38. package/dist/{Setting-bPKadRu-.js → Setting-Cr6u3Vok.js} +6 -6
  39. package/dist/{Subcategory-DBCnIP0b.js → Subcategory-BYg9Z56P.js} +141 -129
  40. package/dist/{Takeaway-GNRHR5kN.js → Takeaway-BIF4hGTc.js} +2 -2
  41. package/dist/{Takeaway-VBkdW1DM.js → Takeaway-I5kTW17E.js} +5 -5
  42. package/dist/{TakeawayList.vue_vue_type_script_setup_true_lang-DvX3k0Jg.js → TakeawayList.vue_vue_type_script_setup_true_lang-Ph6sSiyp.js} +117 -111
  43. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-D1qaEVUu.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-B3SRYt9b.js} +6 -6
  44. package/dist/{Unit-DbGKIprZ.js → Unit-CHVucFRl.js} +2 -2
  45. package/dist/{Variant-_edSAKif.js → Variant-CS0gRkGz.js} +114 -108
  46. package/dist/{_id_-BNVtBV3q.js → _id_-BpCfEGRx.js} +3 -3
  47. package/dist/{app-BlTv5xag.js → app-BcGXBcUK.js} +420 -409
  48. package/dist/app.js +1 -1
  49. package/dist/apps/mf-menu/src/components/ProductList.vue.d.ts +3 -3
  50. package/dist/apps/mf-menu/src/router/shared.d.ts +33 -0
  51. package/dist/apps/mf-menu/src/sdk/import-export.d.ts +8 -2
  52. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  53. package/dist/assets/{menu-compute-BzchkTYh.js → menu-compute-CFLJZpef.js} +2 -2
  54. package/dist/assets/{validate-menu-CTV_cJNG.js → validate-menu-DPQnAO0-.js} +2 -2
  55. package/dist/mf-menu.css +1 -1
  56. package/dist/{provide-dbE6Qt1z.js → provide-FZ08sGZH.js} +56332 -55258
  57. package/dist/{useActionFeedback-CdY_C_HX.js → useActionFeedback-BNYAkEZw.js} +1 -1
  58. package/package.json +1 -1
  59. package/dist/Preview-AdgGTYlQ.js +0 -321
  60. package/dist/ProductInternalTools-thlSvqbA.js +0 -2906
@@ -0,0 +1,325 @@
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 n, createBlock as p, unref as l, withCtx as Y, createElementBlock as U, createElementVNode as i, createCommentVNode as w, toDisplayString as h, createVNode as D, withDirectives as Z, vShow as ee } 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 te } from "./PageLayout.vue_vue_type_script_setup_true_lang-B3szUH39.js";
5
+ import { b as ae, u as ue, a as se } from "./provide-FZ08sGZH.js";
6
+ function ne(g, r) {
7
+ const t = new URL(g);
8
+ return t.searchParams.set("parent", r), { src: t.toString(), origin: t.origin };
9
+ }
10
+ function oe(g, r, t = 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 s;
19
+ if (v.origin !== r) return;
20
+ const f = (s = g()) == null ? void 0 : s.contentWindow;
21
+ !f || v.source !== f || k(v.data);
22
+ };
23
+ return t.addEventListener("message", d), () => t.removeEventListener("message", d);
24
+ }
25
+ };
26
+ }
27
+ const ie = {
28
+ key: 3,
29
+ class: "flex flex-wrap items-start gap-24"
30
+ }, re = { class: "flex w-[320px] max-w-full shrink-0 flex-col gap-24" }, me = { class: "flex flex-col gap-16" }, ce = {
31
+ key: 4,
32
+ class: "flex flex-col gap-4"
33
+ }, de = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary" }, ve = ["aria-label"], pe = { class: "fm-typo-en-body-lg-600" }, _e = { class: "flex list-disc flex-col gap-4 pl-16" }, fe = { class: "relative flex min-w-0 flex-[1_1_480px] flex-col items-center rounded-lg bg-fm-color-neutral-gray-100 p-16" }, we = ["src", "title"], ge = {
34
+ key: 0,
35
+ class: "absolute inset-0 flex flex-col items-center justify-center gap-8",
36
+ "data-testid": "menu-preview-loading"
37
+ }, be = { class: "text-fm-color-typo-secondary" }, he = {
38
+ key: 2,
39
+ class: "pt-8 text-fm-color-typo-secondary",
40
+ "data-testid": "menu-preview-summary"
41
+ }, ke = /* @__PURE__ */ M({
42
+ __name: "MenuPreview",
43
+ props: {
44
+ sdk: {},
45
+ simulatorUrl: {},
46
+ parentOrigin: {}
47
+ },
48
+ setup(g) {
49
+ const r = g, { t, locale: k } = le(), d = ae(), v = K(null), f = o(
50
+ () => r.simulatorUrl ? ne(
51
+ r.simulatorUrl,
52
+ r.parentOrigin ?? window.location.origin
53
+ ) : null
54
+ ), s = f.value ? r.sdk.preview.open({ appLocale: k.value }) : null, x = s ? ue(s.view) : Q({ status: "loading" }), u = o(
55
+ () => x.value.status === "ready" ? x.value.value : null
56
+ );
57
+ let b = null;
58
+ T(
59
+ v,
60
+ (e) => {
61
+ b == null || b(), b = e && f.value && s ? s.attach(
62
+ oe(() => v.value, f.value.origin)
63
+ ) : null;
64
+ },
65
+ { flush: "post" }
66
+ ), X(() => {
67
+ b == null || b(), s == null || s.dispose();
68
+ });
69
+ const S = (e) => !!e && e.state !== "hidden", V = (e) => (e == null ? void 0 : e.state) === "disabled", R = o(
70
+ () => {
71
+ var e;
72
+ return (((e = u.value) == null ? void 0 : e.restaurants) ?? []).map((a) => ({
73
+ label: a.label,
74
+ value: a.id
75
+ }));
76
+ }
77
+ ), N = {
78
+ default: "menu.menu_preview.usage.default",
79
+ pickup: "menu.menu_preview.usage.pickup",
80
+ takeaway: "menu.menu_preview.usage.takeaway",
81
+ additional: "menu.menu_preview.usage.additional"
82
+ }, $ = o(
83
+ () => {
84
+ var e;
85
+ return (((e = u.value) == null ? void 0 : e.catalogs) ?? []).map((a) => ({
86
+ label: a.name,
87
+ value: a.id,
88
+ ...a.usages.length > 0 ? {
89
+ sublabel: a.usages.map((m) => t(N[m])).join(t("menu.common.labels.list_separator"))
90
+ } : {}
91
+ }));
92
+ }
93
+ ), j = o(
94
+ () => {
95
+ var e;
96
+ return (((e = u.value) == null ? void 0 : e.schedulers) ?? []).map((a) => ({
97
+ label: a.name,
98
+ value: a.id
99
+ }));
100
+ }
101
+ ), G = o(
102
+ () => {
103
+ var e;
104
+ return (((e = u.value) == null ? void 0 : e.locales) ?? []).map((a) => ({
105
+ label: a.name,
106
+ value: a.code
107
+ }));
108
+ }
109
+ ), O = {
110
+ phone: "menu.menu_preview.device.phone",
111
+ tablet: "menu.menu_preview.device.tablet",
112
+ kiosk: "menu.menu_preview.device.kiosk"
113
+ }, W = {
114
+ phone: "smartphone",
115
+ tablet: "tablet",
116
+ kiosk: "tv"
117
+ }, F = o(
118
+ () => {
119
+ var e;
120
+ return (((e = u.value) == null ? void 0 : e.devices) ?? []).map((a) => ({
121
+ device: a,
122
+ item: {
123
+ label: t(O[a]),
124
+ icon: W[a]
125
+ }
126
+ }));
127
+ }
128
+ ), q = o(
129
+ () => {
130
+ var e;
131
+ return ((e = F.value.find((a) => {
132
+ var m;
133
+ return a.device === ((m = u.value) == null ? void 0 : m.device);
134
+ })) == null ? void 0 : e.item) ?? null;
135
+ }
136
+ );
137
+ function z(e) {
138
+ const a = F.value.find((m) => m.item === e);
139
+ a && (s == null || s.selectDevice(a.device));
140
+ }
141
+ const y = o(() => {
142
+ var e;
143
+ return ((e = u.value) == null ? void 0 : e.simulator) ?? null;
144
+ }), A = o(
145
+ () => {
146
+ var e, a;
147
+ return ((e = y.value) == null ? void 0 : e.status) === "connecting" || ((a = y.value) == null ? void 0 : a.status) === "building";
148
+ }
149
+ ), C = o(
150
+ () => {
151
+ var e;
152
+ return ((e = y.value) == null ? void 0 : e.status) === "failed" ? y.value : null;
153
+ }
154
+ ), B = o(() => {
155
+ const e = y.value;
156
+ return (e == null ? void 0 : e.status) !== "ready" ? null : t("menu.menu_preview.status.summary", {
157
+ categories: t(
158
+ "menu.menu_preview.status.categories",
159
+ { count: e.categoryCount },
160
+ e.categoryCount
161
+ ),
162
+ items: t(
163
+ "menu.menu_preview.status.items",
164
+ { count: e.itemCount },
165
+ e.itemCount
166
+ )
167
+ });
168
+ });
169
+ function E() {
170
+ s == null || s.retry();
171
+ }
172
+ return (e, a) => {
173
+ const m = L("FmSelect"), H = L("FmButtonGroup"), J = L("FmCircularProgress");
174
+ return n(), p(te, {
175
+ heading: l(t)("menu.menu_preview.title"),
176
+ subheading: l(t)("menu.menu_preview.subtitle")
177
+ }, {
178
+ default: Y(() => {
179
+ var P;
180
+ return [
181
+ f.value ? l(x).status === "error" ? (n(), p(l(I), {
182
+ key: 1,
183
+ title: l(t)("menu.menu_preview.load_failed.title"),
184
+ subtitle: l(d)(l(x).error.message),
185
+ action: {
186
+ text: l(t)("menu.menu_preview.actions.retry"),
187
+ icon: "refresh",
188
+ callback: E
189
+ }
190
+ }, null, 8, ["title", "subtitle", "action"])) : l(x).status === "unavailable" ? (n(), p(l(I), {
191
+ key: 2,
192
+ title: l(t)("menu.menu_preview.title"),
193
+ subtitle: l(d)(l(x).reason)
194
+ }, null, 8, ["title", "subtitle"])) : (n(), U("div", ie, [
195
+ i("aside", re, [
196
+ i("div", me, [
197
+ u.value && S(u.value.restaurantSelector) ? (n(), p(m, {
198
+ key: 0,
199
+ class: "w-full",
200
+ "data-testid": "menu-preview-restaurant",
201
+ label: l(t)("menu.menu_preview.labels.restaurant"),
202
+ items: R.value,
203
+ "model-value": u.value.restaurantId,
204
+ disabled: V(u.value.restaurantSelector),
205
+ searchable: "",
206
+ "onUpdate:modelValue": a[0] || (a[0] = (_) => {
207
+ var c;
208
+ return (c = l(s)) == null ? void 0 : c.selectRestaurant(_);
209
+ })
210
+ }, null, 8, ["label", "items", "model-value", "disabled"])) : w("", !0),
211
+ u.value && S(u.value.catalogSelector) ? (n(), p(m, {
212
+ key: 1,
213
+ class: "w-full",
214
+ "data-testid": "menu-preview-catalog",
215
+ label: l(t)("menu.menu_preview.labels.catalog"),
216
+ placeholder: l(t)("menu.menu_preview.labels.no_catalog"),
217
+ items: $.value,
218
+ "model-value": u.value.catalogId,
219
+ disabled: V(u.value.catalogSelector),
220
+ "onUpdate:modelValue": a[1] || (a[1] = (_) => {
221
+ var c;
222
+ return (c = l(s)) == null ? void 0 : c.selectCatalog(_);
223
+ })
224
+ }, null, 8, ["label", "placeholder", "items", "model-value", "disabled"])) : w("", !0),
225
+ u.value && S(u.value.schedulerSelector) ? (n(), p(m, {
226
+ key: 2,
227
+ class: "w-full",
228
+ "data-testid": "menu-preview-scheduler",
229
+ label: l(t)("menu.menu_preview.labels.scheduler"),
230
+ items: j.value,
231
+ "model-value": u.value.schedulerId,
232
+ disabled: V(u.value.schedulerSelector),
233
+ "onUpdate:modelValue": a[2] || (a[2] = (_) => {
234
+ var c;
235
+ return (c = l(s)) == null ? void 0 : c.selectScheduler(_);
236
+ })
237
+ }, null, 8, ["label", "items", "model-value", "disabled"])) : w("", !0),
238
+ u.value && S(u.value.localeSelector) ? (n(), p(m, {
239
+ key: 3,
240
+ class: "w-full",
241
+ "data-testid": "menu-preview-locale",
242
+ label: l(t)("menu.menu_preview.labels.menu_language"),
243
+ "label-info": l(t)("menu.menu_preview.labels.menu_language_info"),
244
+ items: G.value,
245
+ "model-value": u.value.locale,
246
+ "onUpdate:modelValue": a[3] || (a[3] = (_) => {
247
+ var c;
248
+ return (c = l(s)) == null ? void 0 : c.selectLocale(_);
249
+ })
250
+ }, null, 8, ["label", "label-info", "items", "model-value"])) : w("", !0),
251
+ u.value ? (n(), U("div", ce, [
252
+ i("span", de, h(l(t)("menu.menu_preview.labels.device")), 1),
253
+ D(H, {
254
+ "data-testid": "menu-preview-device",
255
+ items: F.value.map((_) => _.item),
256
+ "model-value": q.value,
257
+ "onUpdate:modelValue": z
258
+ }, null, 8, ["items", "model-value"])
259
+ ])) : w("", !0)
260
+ ]),
261
+ i("section", {
262
+ class: "flex flex-col gap-8 rounded-lg border border-fm-color-neutral-gray-200 p-16",
263
+ "aria-label": l(t)("menu.menu_preview.limits.title")
264
+ }, [
265
+ i("h2", pe, h(l(t)("menu.menu_preview.limits.title")), 1),
266
+ i("ul", _e, [
267
+ i("li", null, h(l(t)("menu.menu_preview.limits.stock")), 1),
268
+ i("li", null, h(l(t)("menu.menu_preview.limits.pricing")), 1),
269
+ i("li", null, h(l(t)("menu.menu_preview.limits.checkout")), 1)
270
+ ])
271
+ ], 8, ve)
272
+ ]),
273
+ i("div", fe, [
274
+ Z(i("iframe", {
275
+ ref_key: "frameElement",
276
+ ref: v,
277
+ class: "h-[880px] w-full border-0 lg:h-[calc(100dvh-256px)] lg:min-h-[560px]",
278
+ "data-testid": "menu-preview-frame",
279
+ src: f.value.src,
280
+ title: l(t)("menu.menu_preview.frame_title"),
281
+ sandbox: "allow-scripts allow-same-origin"
282
+ }, null, 8, we), [
283
+ [ee, !C.value]
284
+ ]),
285
+ A.value ? (n(), U("div", ge, [
286
+ D(J),
287
+ i("span", be, h(((P = y.value) == null ? void 0 : P.status) === "connecting" ? l(t)("menu.menu_preview.status.connecting") : l(t)("menu.menu_preview.status.building")), 1)
288
+ ])) : w("", !0),
289
+ C.value ? (n(), p(l(I), {
290
+ key: 1,
291
+ "data-testid": "menu-preview-failed",
292
+ title: l(t)("menu.menu_preview.failed.title"),
293
+ subtitle: l(d)(C.value.reason),
294
+ action: C.value.retryable ? {
295
+ text: l(t)("menu.menu_preview.actions.retry"),
296
+ icon: "refresh",
297
+ callback: E
298
+ } : void 0
299
+ }, null, 8, ["title", "subtitle", "action"])) : w("", !0),
300
+ B.value ? (n(), U("p", he, h(B.value), 1)) : w("", !0)
301
+ ])
302
+ ])) : (n(), p(l(I), {
303
+ key: 0,
304
+ title: l(t)("menu.menu_preview.not_configured.title"),
305
+ subtitle: l(t)("menu.menu_preview.not_configured.subtitle")
306
+ }, null, 8, ["title", "subtitle"]))
307
+ ];
308
+ }),
309
+ _: 1
310
+ }, 8, ["heading", "subheading"]);
311
+ };
312
+ }
313
+ }), Ie = /* @__PURE__ */ M({
314
+ __name: "Preview",
315
+ setup(g) {
316
+ const r = se(), t = "https://menu-simulator-dev.feedme-dev.workers.dev";
317
+ return (k, d) => (n(), p(ke, {
318
+ sdk: l(r),
319
+ "simulator-url": l(t)
320
+ }, null, 8, ["sdk", "simulator-url"]));
321
+ }
322
+ });
323
+ export {
324
+ Ie as default
325
+ };
@@ -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-dbE6Qt1z.js";
3
+ import { u as _ } from "./provide-FZ08sGZH.js";
4
4
  const b = /* @__PURE__ */ a({
5
5
  __name: "PriceTierNotice",
6
6
  props: {