@webx-ui/module-recipes 0.1.12 → 0.2.0
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.
- package/dist/RecipeEditorPage.d.ts +1 -1
- package/dist/api.d.ts +2 -1
- package/dist/index.js +566 -551
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +3 -0
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { reorderItems as Ue, useAdmin as oe, useDates as Be, useTranslate as
|
|
2
|
-
import { provide as
|
|
3
|
-
import { useRoute as
|
|
4
|
-
import { useLocales as
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
const
|
|
1
|
+
import { reorderItems as Ue, useAdmin as oe, useDates as Be, useTranslate as se, useErrorText as $e, useEditing as Le, provideRelationOwner as He, provideRecordAddress as Fe, WxScreenHead as Ke, WxEditingAlerts as Je, WxScreen as Ge, WxSaveState as je, WxDate as Qe, WxDrafts as Xe, WxListScreen as Ye, WxRowMenu as Ze, WxAddressNote as et, categoryRoutes as Se } from "@webx-ui/module-admin";
|
|
2
|
+
import { provide as tt, inject as at, defineComponent as he, computed as f, ref as _, watch as ne, onMounted as Ne, onBeforeUnmount as ze, openBlock as p, createElementBlock as q, Fragment as ee, createVNode as y, unref as e, withCtx as v, createTextVNode as $, toDisplayString as x, createBlock as k, createCommentVNode as D, createElementVNode as A, renderList as qe, normalizeClass as Te, useTemplateRef as it, nextTick as rt, isRef as st, withKeys as nt, resolveDynamicComponent as lt, mergeProps as ot } from "vue";
|
|
3
|
+
import { useRoute as Ae, useRouter as De, onBeforeRouteLeave as ut } from "vue-router";
|
|
4
|
+
import { useLocales as ct, localizedValue as dt, confirm as ae, WxSkeleton as ve, WxCard as pt, WxBadge as Z, WxBreadcrumb as vt, WxBreadcrumbItem as Ve, WxActionBar as ht, WxButton as le, toast as S, WxEmpty as Ee, WxText as ft, useModal as yt, WxDialog as mt, WxFormItem as bt, WxInput as Pe, WxSpace as gt, createModal as wt, WxIcon as _e, WxSelect as ke, WxSortableList as xt, WxTooltip as _t, WxAlert as kt } from "@webx-ui/core";
|
|
5
|
+
const Ce = "recipes";
|
|
6
|
+
function fe(u) {
|
|
7
|
+
const l = `${u.apiPath}/${Ce}`, m = (t) => t.data;
|
|
8
8
|
return {
|
|
9
9
|
list: (t = {}) => {
|
|
10
|
-
const
|
|
11
|
-
return t.q &&
|
|
10
|
+
const o = new URLSearchParams();
|
|
11
|
+
return t.q && o.set("q", t.q), t.category != null && o.set("category", String(t.category)), t.nutrient != null && o.set("nutrient", String(t.nutrient)), t.service != null && o.set("service", String(t.service)), t.status && o.set("status", t.status), t.trashed && o.set("trashed", "1"), u.http.get(o.size > 0 ? `${l}?${o}` : l);
|
|
12
12
|
},
|
|
13
|
-
get: (t) =>
|
|
14
|
-
create: (t) =>
|
|
15
|
-
save: (t,
|
|
16
|
-
discard: (t) =>
|
|
17
|
-
publish: (t) =>
|
|
18
|
-
unpublish: (t) =>
|
|
19
|
-
remove: (t) =>
|
|
13
|
+
get: (t) => u.http.get(`${l}/${t}`).then(m),
|
|
14
|
+
create: (t) => u.http.post(l, t).then(m),
|
|
15
|
+
save: (t, o) => u.http.put(`${l}/${t}`, o).then(m),
|
|
16
|
+
discard: (t) => u.http.post(`${l}/${t}/discard`, {}).then(m),
|
|
17
|
+
publish: (t, o) => u.http.post(`${l}/${t}/publish`, o ? { revision: o } : {}).then(m),
|
|
18
|
+
unpublish: (t) => u.http.post(`${l}/${t}/unpublish`, {}).then(m),
|
|
19
|
+
remove: (t) => u.http.delete(`${l}/${t}`).then(() => {
|
|
20
20
|
}),
|
|
21
|
-
restore: (t) =>
|
|
22
|
-
versions: (t) =>
|
|
23
|
-
restoreVersion: (t,
|
|
24
|
-
reorder: (t) => Ue(
|
|
21
|
+
restore: (t) => u.http.post(`${l}/${t}/restore`, {}).then(m),
|
|
22
|
+
versions: (t) => u.http.get(`${l}/${t}/versions`).then(m),
|
|
23
|
+
restoreVersion: (t, o) => u.http.post(`${l}/${t}/versions/${o}/restore`, {}).then(m),
|
|
24
|
+
reorder: (t) => Ue(u, Ce, t, null)
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
const
|
|
28
|
-
function
|
|
29
|
-
|
|
27
|
+
const Me = /* @__PURE__ */ Symbol("wx-recipe-editor");
|
|
28
|
+
function Tt(u) {
|
|
29
|
+
tt(Me, u);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
return
|
|
31
|
+
function $t() {
|
|
32
|
+
return at(Me, null);
|
|
33
33
|
}
|
|
34
|
-
const
|
|
34
|
+
const Rt = {
|
|
35
35
|
module: {
|
|
36
36
|
group: "Recipes",
|
|
37
37
|
recipes: "Recipes",
|
|
@@ -151,245 +151,270 @@ const xt = {
|
|
|
151
151
|
saved: "Saved.",
|
|
152
152
|
"field-title": "Title"
|
|
153
153
|
}
|
|
154
|
-
},
|
|
155
|
-
function
|
|
154
|
+
}, Ie = /* @__PURE__ */ new WeakSet();
|
|
155
|
+
function ye() {
|
|
156
156
|
try {
|
|
157
|
-
const { i18n:
|
|
158
|
-
|
|
157
|
+
const { i18n: u } = oe();
|
|
158
|
+
Ie.has(u) || (u.defaults("webx-recipes", Rt), Ie.add(u));
|
|
159
159
|
} catch {
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
-
const
|
|
162
|
+
const Wt = 1200, St = /* @__PURE__ */ he({
|
|
163
163
|
__name: "RecipeEditorPage",
|
|
164
164
|
props: {
|
|
165
165
|
base: { default: "/recipes" }
|
|
166
166
|
},
|
|
167
|
-
setup(
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
const r =
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
167
|
+
setup(u) {
|
|
168
|
+
const l = u, m = oe(), t = fe(m), o = Ae(), E = De(), i = ct(), V = Be();
|
|
169
|
+
ye();
|
|
170
|
+
const r = se("webx-recipes"), g = se("webx-admin"), R = $e(), P = f(() => Number(o.params.id)), N = f(() => l.base), n = _(null), b = _({}), h = _(""), M = _(null), B = _(null), F = _(!0), O = _(!1), I = _(!1), j = _({}), Q = _(""), z = f(() => m.can("recipes.manage")), T = Le({
|
|
171
|
+
entity: "recipes",
|
|
172
|
+
id: () => n.value?.id,
|
|
173
|
+
values: b,
|
|
174
|
+
revision: h,
|
|
175
|
+
read: async () => {
|
|
176
|
+
const s = await t.get(P.value);
|
|
177
|
+
return { values: s.values, revision: s.revision };
|
|
178
|
+
},
|
|
179
|
+
adopt: (s) => {
|
|
180
|
+
Q.value = JSON.stringify(s.values);
|
|
181
|
+
},
|
|
182
|
+
// Published or restored by somebody else: the badge and the address follow, and the form
|
|
183
|
+
// stays as it is.
|
|
184
|
+
refresh: () => be(),
|
|
185
|
+
restore: async () => {
|
|
186
|
+
n.value && await t.restore(n.value.id);
|
|
187
|
+
},
|
|
188
|
+
canWrite: () => z.value,
|
|
189
|
+
busy: () => O.value || G !== void 0,
|
|
190
|
+
screen: "recipes.form"
|
|
191
|
+
}), K = T.conflict, me = f(() => !z.value || I.value), U = f(() => JSON.stringify(b.value)), C = f(() => Q.value !== "" && U.value !== Q.value), ie = f(() => O.value ? "saving" : C.value ? "unsaved" : "saved"), X = f(() => {
|
|
192
|
+
const s = b.value.title;
|
|
193
|
+
return dt(s, i.active.value, n.value?.title ?? "");
|
|
194
|
+
}), ue = f(() => {
|
|
195
|
+
const s = n.value;
|
|
196
|
+
return !s || s.status !== "published" && s.status !== "modified" ? "" : r("recipe.live-since", { date: V.short(s.published_at) });
|
|
176
197
|
});
|
|
177
|
-
|
|
178
|
-
values:
|
|
179
|
-
prefix:
|
|
180
|
-
path: f(() =>
|
|
198
|
+
He({ type: "recipe", id: f(() => n.value?.id ?? null) }), Fe({
|
|
199
|
+
values: b,
|
|
200
|
+
prefix: M,
|
|
201
|
+
path: f(() => n.value?.path),
|
|
181
202
|
moving: () => r("recipe.address-moving")
|
|
182
|
-
}),
|
|
183
|
-
function
|
|
184
|
-
|
|
203
|
+
}), Tt({ recipe: n, canManage: z.value, reload: () => J(!0) });
|
|
204
|
+
function ce(s) {
|
|
205
|
+
n.value = s.recipe, b.value = s.values, h.value = s.revision, M.value = s.prefix, B.value = s.preview_url, Q.value = JSON.stringify(s.values), T.opened(s.values), K.value = null;
|
|
185
206
|
}
|
|
186
|
-
async function
|
|
187
|
-
s || (
|
|
207
|
+
async function J(s = !1) {
|
|
208
|
+
s || (F.value = !0);
|
|
188
209
|
try {
|
|
189
|
-
|
|
190
|
-
} catch (
|
|
191
|
-
|
|
210
|
+
ce(await t.get(P.value));
|
|
211
|
+
} catch (w) {
|
|
212
|
+
S.danger(R(w)), E.push(N.value);
|
|
192
213
|
} finally {
|
|
193
|
-
|
|
214
|
+
F.value = !1;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
async function be() {
|
|
218
|
+
try {
|
|
219
|
+
const s = await t.get(P.value);
|
|
220
|
+
n.value = s.recipe, M.value = s.prefix, B.value = s.preview_url;
|
|
221
|
+
} catch {
|
|
194
222
|
}
|
|
195
223
|
}
|
|
196
|
-
let
|
|
197
|
-
function
|
|
198
|
-
!
|
|
199
|
-
|
|
200
|
-
},
|
|
224
|
+
let Y;
|
|
225
|
+
function ge() {
|
|
226
|
+
!z.value || K.value || !C.value || T.stopped.value || (clearTimeout(Y), Y = setTimeout(() => {
|
|
227
|
+
H();
|
|
228
|
+
}, Wt));
|
|
201
229
|
}
|
|
202
|
-
function
|
|
203
|
-
!
|
|
230
|
+
function te() {
|
|
231
|
+
!z.value || K.value || !C.value || O.value || T.stopped.value || (clearTimeout(Y), H());
|
|
204
232
|
}
|
|
205
|
-
let
|
|
206
|
-
async function
|
|
207
|
-
for (;
|
|
208
|
-
const { carried:
|
|
209
|
-
if (await
|
|
233
|
+
let G;
|
|
234
|
+
async function H() {
|
|
235
|
+
for (; G; ) {
|
|
236
|
+
const { carried: W, done: L } = G;
|
|
237
|
+
if (await L, !C.value || K.value || U.value === W) return;
|
|
210
238
|
}
|
|
211
|
-
const s =
|
|
212
|
-
|
|
239
|
+
const s = U.value, w = we();
|
|
240
|
+
G = { carried: s, done: w };
|
|
213
241
|
try {
|
|
214
|
-
await
|
|
242
|
+
await w;
|
|
215
243
|
} finally {
|
|
216
|
-
|
|
244
|
+
G?.done === w && (G = void 0);
|
|
217
245
|
}
|
|
218
246
|
}
|
|
219
|
-
async function
|
|
220
|
-
if (!
|
|
221
|
-
clearTimeout(
|
|
222
|
-
const s =
|
|
223
|
-
|
|
247
|
+
async function we() {
|
|
248
|
+
if (!n.value || !z.value) return;
|
|
249
|
+
clearTimeout(Y);
|
|
250
|
+
const s = U.value, w = b.value;
|
|
251
|
+
O.value = !0, j.value = {};
|
|
224
252
|
try {
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
} catch (
|
|
228
|
-
const
|
|
229
|
-
|
|
253
|
+
const W = await t.save(n.value.id, { values: w, revision: h.value });
|
|
254
|
+
n.value = W.recipe, h.value = W.revision, M.value = W.prefix, B.value = W.preview_url, K.value = null, U.value === s && (Q.value = s), T.opened(w);
|
|
255
|
+
} catch (W) {
|
|
256
|
+
const L = W;
|
|
257
|
+
if (L.status === 409 && L.body?.data) {
|
|
258
|
+
const pe = L.body.data;
|
|
259
|
+
T.refused({
|
|
260
|
+
values: pe.values,
|
|
261
|
+
revision: pe.revision,
|
|
262
|
+
changed: L.body.changed
|
|
263
|
+
}) && (n.value = pe.recipe, H());
|
|
264
|
+
} else L.body?.errors ? (j.value = L.body.errors, S.danger(r("recipe.save-failed"))) : await T.failed(W) || S.danger(R(W));
|
|
230
265
|
} finally {
|
|
231
|
-
|
|
266
|
+
O.value = !1;
|
|
232
267
|
}
|
|
233
268
|
}
|
|
234
|
-
async function
|
|
235
|
-
await
|
|
236
|
-
title: r("recipe.conflict-theirs-title"),
|
|
237
|
-
message: r("recipe.conflict-theirs-text"),
|
|
238
|
-
confirmText: r("recipe.conflict-theirs"),
|
|
239
|
-
cancelText: r("panel.cancel"),
|
|
240
|
-
tone: "danger"
|
|
241
|
-
}) && await K(!0);
|
|
242
|
-
}
|
|
243
|
-
async function ge() {
|
|
244
|
-
const s = I.value;
|
|
245
|
-
s && (m.value = s.data.revision, I.value = null, await M());
|
|
269
|
+
async function xe() {
|
|
270
|
+
await J(!0);
|
|
246
271
|
}
|
|
247
|
-
async function
|
|
248
|
-
if (!(!
|
|
249
|
-
title:
|
|
250
|
-
message:
|
|
272
|
+
async function a() {
|
|
273
|
+
if (!(!n.value || !await ae({
|
|
274
|
+
title: g("editor.discard-title"),
|
|
275
|
+
message: g("editor.discard-text"),
|
|
251
276
|
confirmText: r("recipe.discard"),
|
|
252
277
|
// Not «Cancel»: beside «Discard changes» the two read as the same word.
|
|
253
|
-
cancelText:
|
|
278
|
+
cancelText: g("editor.keep-changes"),
|
|
254
279
|
tone: "danger"
|
|
255
280
|
}))) {
|
|
256
|
-
|
|
281
|
+
I.value = !0;
|
|
257
282
|
try {
|
|
258
|
-
|
|
259
|
-
} catch (
|
|
260
|
-
|
|
283
|
+
ce(await t.discard(n.value.id)), S.success(r("recipe.discarded"));
|
|
284
|
+
} catch (w) {
|
|
285
|
+
S.danger(R(w));
|
|
261
286
|
} finally {
|
|
262
|
-
|
|
287
|
+
I.value = !1;
|
|
263
288
|
}
|
|
264
289
|
}
|
|
265
290
|
}
|
|
266
|
-
async function
|
|
267
|
-
if (
|
|
268
|
-
const s =
|
|
291
|
+
async function d() {
|
|
292
|
+
if (C.value && await H(), K.value || C.value || !n.value) return;
|
|
293
|
+
const s = await T.beforePublish();
|
|
269
294
|
if (!s) return;
|
|
270
|
-
const W =
|
|
271
|
-
if (await
|
|
272
|
-
title: r("recipe.publish-title", { title:
|
|
273
|
-
message: W === null ? r("recipe.publish-nowhere") : r("recipe.publish-text", { address: `/${W}` }) +
|
|
295
|
+
const w = n.value, W = w.next_path ?? w.path, L = w.next_path != null && w.path !== null ? ` ${g("editor.publish-moves", { old: `/${w.path}` })}` : "";
|
|
296
|
+
if (s.asked || await ae({
|
|
297
|
+
title: r("recipe.publish-title", { title: X.value || w.title }),
|
|
298
|
+
message: W === null ? r("recipe.publish-nowhere") : r("recipe.publish-text", { address: `/${W}` }) + L,
|
|
274
299
|
confirmText: r("panel.publish"),
|
|
275
300
|
cancelText: r("panel.cancel")
|
|
276
301
|
})) {
|
|
277
|
-
|
|
302
|
+
I.value = !0;
|
|
278
303
|
try {
|
|
279
|
-
await t.publish(s.
|
|
280
|
-
} catch (
|
|
281
|
-
|
|
304
|
+
await t.publish(w.id, s.revision), await J(!0), S.success(r("panel.published"));
|
|
305
|
+
} catch (We) {
|
|
306
|
+
await T.failed(We) || S.danger(R(We));
|
|
282
307
|
} finally {
|
|
283
|
-
|
|
308
|
+
I.value = !1;
|
|
284
309
|
}
|
|
285
310
|
}
|
|
286
311
|
}
|
|
287
|
-
async function
|
|
288
|
-
const s =
|
|
289
|
-
if (!(!s || !await
|
|
290
|
-
title:
|
|
291
|
-
message:
|
|
292
|
-
confirmText:
|
|
293
|
-
cancelText:
|
|
312
|
+
async function c() {
|
|
313
|
+
const s = n.value;
|
|
314
|
+
if (!(!s || !await ae({
|
|
315
|
+
title: g("editor.unpublish-title"),
|
|
316
|
+
message: g("editor.unpublish-text"),
|
|
317
|
+
confirmText: g("editor.unpublish"),
|
|
318
|
+
cancelText: g("editor.keep-published")
|
|
294
319
|
}))) {
|
|
295
|
-
|
|
320
|
+
I.value = !0;
|
|
296
321
|
try {
|
|
297
|
-
await t.unpublish(s.id), await
|
|
298
|
-
} catch (
|
|
299
|
-
|
|
322
|
+
await t.unpublish(s.id), await J(!0), S.success(g("editor.unpublished"));
|
|
323
|
+
} catch (W) {
|
|
324
|
+
S.danger(R(W));
|
|
300
325
|
} finally {
|
|
301
|
-
|
|
326
|
+
I.value = !1;
|
|
302
327
|
}
|
|
303
328
|
}
|
|
304
329
|
}
|
|
305
|
-
function
|
|
306
|
-
const s =
|
|
330
|
+
function re() {
|
|
331
|
+
const s = n.value?.status;
|
|
307
332
|
return s === "published" || s === "modified" ? "success" : "default";
|
|
308
333
|
}
|
|
309
|
-
function
|
|
310
|
-
|
|
334
|
+
function de(s) {
|
|
335
|
+
C.value && s.preventDefault();
|
|
311
336
|
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
}),
|
|
315
|
-
|
|
337
|
+
ne(U, ge), ne(P, () => {
|
|
338
|
+
J();
|
|
339
|
+
}), Ne(() => {
|
|
340
|
+
J(), window.addEventListener("beforeunload", de);
|
|
316
341
|
}), ze(() => {
|
|
317
|
-
clearTimeout(
|
|
318
|
-
}),
|
|
342
|
+
clearTimeout(Y), window.removeEventListener("beforeunload", de);
|
|
343
|
+
}), ut(async () => !C.value || !z.value || (await H(), !C.value) ? !0 : await ae({
|
|
319
344
|
title: r("recipe.leave-title"),
|
|
320
345
|
message: r("recipe.leave-text"),
|
|
321
346
|
confirmText: r("recipe.leave"),
|
|
322
347
|
cancelText: r("panel.cancel"),
|
|
323
348
|
tone: "danger"
|
|
324
349
|
}));
|
|
325
|
-
const
|
|
350
|
+
const Oe = f(() => {
|
|
326
351
|
const s = [];
|
|
327
|
-
return
|
|
352
|
+
return B.value && s.push({ key: "preview", label: r("recipe.preview"), icon: "eye", href: B.value }), n.value?.url && n.value.status !== "draft" && s.push({
|
|
328
353
|
key: "site",
|
|
329
354
|
label: r("panel.open-on-site"),
|
|
330
355
|
icon: "link",
|
|
331
|
-
href:
|
|
332
|
-
}),
|
|
356
|
+
href: n.value.url
|
|
357
|
+
}), z.value && (n.value?.status === "published" || n.value?.status === "modified") && s.push({
|
|
333
358
|
key: "unpublish",
|
|
334
|
-
label:
|
|
359
|
+
label: g("editor.unpublish"),
|
|
335
360
|
icon: "eye-off",
|
|
336
361
|
run: () => {
|
|
337
|
-
|
|
362
|
+
c();
|
|
338
363
|
}
|
|
339
|
-
}),
|
|
364
|
+
}), n.value?.status === "modified" && s.push({
|
|
340
365
|
key: "discard",
|
|
341
366
|
label: r("recipe.discard"),
|
|
342
367
|
icon: "refresh",
|
|
343
368
|
danger: !0,
|
|
344
369
|
menu: !0,
|
|
345
370
|
run: () => {
|
|
346
|
-
|
|
371
|
+
a();
|
|
347
372
|
}
|
|
348
373
|
}), s;
|
|
349
374
|
});
|
|
350
|
-
return (s,
|
|
375
|
+
return (s, w) => (p(), q("div", {
|
|
351
376
|
class: "wx-recipe-editor",
|
|
352
|
-
onFocusout:
|
|
377
|
+
onFocusout: te
|
|
353
378
|
}, [
|
|
354
|
-
|
|
355
|
-
|
|
379
|
+
F.value || !n.value ? (p(), q(ee, { key: 0 }, [
|
|
380
|
+
y(e(ve), {
|
|
356
381
|
class: "wx-recipe-editor__ghost",
|
|
357
382
|
title: "",
|
|
358
383
|
rows: 1
|
|
359
384
|
}),
|
|
360
|
-
|
|
361
|
-
default:
|
|
362
|
-
|
|
385
|
+
y(e(pt), null, {
|
|
386
|
+
default: v(() => [
|
|
387
|
+
y(e(ve), { rows: 8 })
|
|
363
388
|
]),
|
|
364
389
|
_: 1
|
|
365
390
|
})
|
|
366
|
-
], 64)) : (
|
|
367
|
-
|
|
391
|
+
], 64)) : (p(), q(ee, { key: 1 }, [
|
|
392
|
+
y(e(Ke), {
|
|
368
393
|
divider: "",
|
|
369
|
-
back:
|
|
394
|
+
back: N.value,
|
|
370
395
|
"back-label": e(r)("module.recipes"),
|
|
371
|
-
title:
|
|
372
|
-
subtitle:
|
|
373
|
-
actions:
|
|
396
|
+
title: X.value || e(r)("recipe.untitled"),
|
|
397
|
+
subtitle: ue.value,
|
|
398
|
+
actions: Oe.value
|
|
374
399
|
}, {
|
|
375
|
-
trail:
|
|
376
|
-
|
|
400
|
+
trail: v(() => [
|
|
401
|
+
y(e(vt), {
|
|
377
402
|
size: "sm",
|
|
378
403
|
label: e(r)("recipe.trail")
|
|
379
404
|
}, {
|
|
380
|
-
default:
|
|
381
|
-
|
|
405
|
+
default: v(() => [
|
|
406
|
+
y(e(Ve), {
|
|
382
407
|
as: "router-link",
|
|
383
|
-
to:
|
|
408
|
+
to: N.value
|
|
384
409
|
}, {
|
|
385
|
-
default:
|
|
386
|
-
|
|
410
|
+
default: v(() => [
|
|
411
|
+
$(x(e(r)("module.recipes")), 1)
|
|
387
412
|
]),
|
|
388
413
|
_: 1
|
|
389
414
|
}, 8, ["to"]),
|
|
390
|
-
|
|
391
|
-
default:
|
|
392
|
-
|
|
415
|
+
y(e(Ve), { current: "" }, {
|
|
416
|
+
default: v(() => [
|
|
417
|
+
$(x(X.value || e(r)("recipe.untitled")), 1)
|
|
393
418
|
]),
|
|
394
419
|
_: 1
|
|
395
420
|
})
|
|
@@ -397,257 +422,247 @@ const _t = 1200, kt = /* @__PURE__ */ ce({
|
|
|
397
422
|
_: 1
|
|
398
423
|
}, 8, ["label"])
|
|
399
424
|
]),
|
|
400
|
-
"title-after":
|
|
401
|
-
|
|
402
|
-
type:
|
|
425
|
+
"title-after": v(() => [
|
|
426
|
+
y(e(Z), {
|
|
427
|
+
type: re(),
|
|
403
428
|
dot: ""
|
|
404
429
|
}, {
|
|
405
|
-
default:
|
|
406
|
-
|
|
430
|
+
default: v(() => [
|
|
431
|
+
$(x(e(r)(`panel.status-${n.value.status}`)), 1)
|
|
407
432
|
]),
|
|
408
433
|
_: 1
|
|
409
434
|
}, 8, ["type"]),
|
|
410
|
-
|
|
435
|
+
n.value.status === "modified" ? (p(), k(e(Z), {
|
|
411
436
|
key: 0,
|
|
412
437
|
type: "primary",
|
|
413
438
|
round: ""
|
|
414
439
|
}, {
|
|
415
|
-
default:
|
|
416
|
-
|
|
440
|
+
default: v(() => [
|
|
441
|
+
$(x(e(r)("panel.edits")), 1)
|
|
417
442
|
]),
|
|
418
443
|
_: 1
|
|
419
|
-
})) :
|
|
444
|
+
})) : D("", !0)
|
|
420
445
|
]),
|
|
421
446
|
_: 1
|
|
422
447
|
}, 8, ["back", "back-label", "title", "subtitle", "actions"]),
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
size: "sm",
|
|
432
|
-
variant: "outline",
|
|
433
|
-
onClick: me
|
|
434
|
-
}, {
|
|
435
|
-
default: d(() => [
|
|
436
|
-
_(w(e(r)("recipe.conflict-theirs")), 1)
|
|
437
|
-
]),
|
|
438
|
-
_: 1
|
|
439
|
-
}),
|
|
440
|
-
h(e(ee), {
|
|
441
|
-
size: "sm",
|
|
442
|
-
type: "primary",
|
|
443
|
-
onClick: ge
|
|
444
|
-
}, {
|
|
445
|
-
default: d(() => [
|
|
446
|
-
_(w(e(r)("recipe.conflict-mine")), 1)
|
|
447
|
-
]),
|
|
448
|
-
_: 1
|
|
449
|
-
})
|
|
450
|
-
]),
|
|
451
|
-
_: 1
|
|
452
|
-
}, 8, ["title", "description"])) : q("", !0),
|
|
453
|
-
h(e(Fe), {
|
|
454
|
-
modelValue: g.value,
|
|
455
|
-
"onUpdate:modelValue": W[0] || (W[0] = (C) => g.value = C),
|
|
448
|
+
y(e(Je), {
|
|
449
|
+
editing: e(T),
|
|
450
|
+
onSave: H,
|
|
451
|
+
onTheirs: xe
|
|
452
|
+
}, null, 8, ["editing"]),
|
|
453
|
+
y(e(Ge), {
|
|
454
|
+
modelValue: b.value,
|
|
455
|
+
"onUpdate:modelValue": w[0] || (w[0] = (W) => b.value = W),
|
|
456
456
|
name: "recipes.form",
|
|
457
|
-
errors:
|
|
458
|
-
disabled:
|
|
457
|
+
errors: j.value,
|
|
458
|
+
disabled: me.value
|
|
459
459
|
}, null, 8, ["modelValue", "errors", "disabled"]),
|
|
460
|
-
|
|
461
|
-
state:
|
|
462
|
-
|
|
460
|
+
z.value ? (p(), k(e(ht), { key: 0 }, {
|
|
461
|
+
state: v(() => [
|
|
462
|
+
e(T).stopped.value ? D("", !0) : (p(), k(e(je), {
|
|
463
|
+
key: 0,
|
|
464
|
+
state: ie.value
|
|
465
|
+
}, null, 8, ["state"]))
|
|
463
466
|
]),
|
|
464
|
-
default:
|
|
465
|
-
|
|
467
|
+
default: v(() => [
|
|
468
|
+
y(e(le), {
|
|
466
469
|
variant: "outline",
|
|
467
|
-
loading:
|
|
468
|
-
disabled: !
|
|
469
|
-
|
|
470
|
+
loading: O.value,
|
|
471
|
+
disabled: !C.value || e(T).stopped.value,
|
|
472
|
+
title: e(T).blocked.value,
|
|
473
|
+
onClick: H
|
|
470
474
|
}, {
|
|
471
|
-
default:
|
|
472
|
-
|
|
475
|
+
default: v(() => [
|
|
476
|
+
$(x(e(r)("recipe.save")), 1)
|
|
473
477
|
]),
|
|
474
478
|
_: 1
|
|
475
|
-
}, 8, ["loading", "disabled"]),
|
|
476
|
-
|
|
479
|
+
}, 8, ["loading", "disabled", "title"]),
|
|
480
|
+
y(e(le), {
|
|
477
481
|
type: "primary",
|
|
478
|
-
loading:
|
|
479
|
-
disabled:
|
|
480
|
-
|
|
482
|
+
loading: I.value,
|
|
483
|
+
disabled: e(T).stopped.value || n.value.status === "published" && !C.value,
|
|
484
|
+
title: e(T).blocked.value,
|
|
485
|
+
onClick: d
|
|
481
486
|
}, {
|
|
482
|
-
default:
|
|
483
|
-
|
|
487
|
+
default: v(() => [
|
|
488
|
+
$(x(e(r)("panel.publish")), 1)
|
|
484
489
|
]),
|
|
485
490
|
_: 1
|
|
486
|
-
}, 8, ["loading", "disabled"])
|
|
491
|
+
}, 8, ["loading", "disabled", "title"])
|
|
487
492
|
]),
|
|
488
493
|
_: 1
|
|
489
|
-
})) :
|
|
494
|
+
})) : D("", !0)
|
|
490
495
|
], 64))
|
|
491
496
|
], 32));
|
|
492
497
|
}
|
|
493
|
-
}),
|
|
494
|
-
const
|
|
495
|
-
for (const [t,
|
|
496
|
-
|
|
497
|
-
return
|
|
498
|
-
},
|
|
498
|
+
}), Re = (u, l) => {
|
|
499
|
+
const m = u.__vccOpts || u;
|
|
500
|
+
for (const [t, o] of l)
|
|
501
|
+
m[t] = o;
|
|
502
|
+
return m;
|
|
503
|
+
}, Vt = /* @__PURE__ */ Re(St, [["__scopeId", "data-v-253e5134"]]), Ct = { class: "wx-recipe-history-tab" }, It = { class: "wx-recipe-history" }, Nt = { class: "wx-recipe-history__number" }, zt = { class: "wx-recipe-history__who" }, qt = /* @__PURE__ */ he({
|
|
499
504
|
name: "WxRecipeHistory",
|
|
500
505
|
__name: "RecipeHistory",
|
|
501
|
-
setup(
|
|
502
|
-
const
|
|
503
|
-
|
|
504
|
-
const
|
|
506
|
+
setup(u) {
|
|
507
|
+
const l = oe(), m = fe(l), t = $t();
|
|
508
|
+
ye();
|
|
509
|
+
const o = se("webx-recipes"), E = $e(), i = _(null), V = _(!1), r = f(() => t?.recipe.value ?? null), g = f(() => t?.canManage ?? !1), R = f(
|
|
505
510
|
() => r.value?.status === "published" || r.value?.status === "modified" ? i.value?.[0]?.number ?? null : null
|
|
506
511
|
);
|
|
507
|
-
async function
|
|
508
|
-
const
|
|
509
|
-
if (
|
|
512
|
+
async function P() {
|
|
513
|
+
const n = r.value;
|
|
514
|
+
if (n)
|
|
510
515
|
try {
|
|
511
|
-
i.value = await
|
|
512
|
-
} catch (
|
|
513
|
-
i.value = [],
|
|
516
|
+
i.value = await m.versions(n.id);
|
|
517
|
+
} catch (b) {
|
|
518
|
+
i.value = [], S.danger(E(b));
|
|
514
519
|
}
|
|
515
520
|
}
|
|
516
|
-
async function
|
|
517
|
-
const
|
|
518
|
-
if (!(!
|
|
519
|
-
title:
|
|
520
|
-
message:
|
|
521
|
-
confirmText:
|
|
522
|
-
cancelText:
|
|
521
|
+
async function N(n) {
|
|
522
|
+
const b = r.value;
|
|
523
|
+
if (!(!b || !await ae({
|
|
524
|
+
title: o("recipe.restore-title", { number: n.number }),
|
|
525
|
+
message: o("recipe.restore-text"),
|
|
526
|
+
confirmText: o("recipe.restore-version"),
|
|
527
|
+
cancelText: o("panel.cancel")
|
|
523
528
|
}))) {
|
|
524
|
-
|
|
529
|
+
V.value = !0;
|
|
525
530
|
try {
|
|
526
|
-
await
|
|
527
|
-
} catch (
|
|
528
|
-
|
|
531
|
+
await m.restoreVersion(b.id, n.number), await t?.reload(), S.success(o("recipe.restored-version", { number: n.number }));
|
|
532
|
+
} catch (M) {
|
|
533
|
+
S.danger(E(M));
|
|
529
534
|
} finally {
|
|
530
|
-
|
|
535
|
+
V.value = !1;
|
|
531
536
|
}
|
|
532
537
|
}
|
|
533
538
|
}
|
|
534
|
-
return
|
|
539
|
+
return ne(
|
|
535
540
|
() => [r.value?.id, r.value?.published_at, r.value?.updated_at],
|
|
536
541
|
() => {
|
|
537
|
-
|
|
542
|
+
P();
|
|
538
543
|
},
|
|
539
544
|
{ immediate: !0 }
|
|
540
|
-
), (
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
key:
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
545
|
+
), (n, b) => (p(), q("div", Ct, [
|
|
546
|
+
A("div", It, [
|
|
547
|
+
i.value === null ? (p(), k(e(ve), {
|
|
548
|
+
key: 0,
|
|
549
|
+
class: "wx-recipe-history__ghost",
|
|
550
|
+
rows: 3
|
|
551
|
+
})) : i.value.length === 0 ? (p(), k(e(Ee), {
|
|
552
|
+
key: 1,
|
|
553
|
+
description: e(o)("recipe.history-empty")
|
|
554
|
+
}, null, 8, ["description"])) : (p(!0), q(ee, { key: 2 }, qe(i.value, (h) => (p(), q("div", {
|
|
555
|
+
key: h.number,
|
|
556
|
+
class: Te(["wx-recipe-history__row", { "is-live": h.number === R.value }])
|
|
557
|
+
}, [
|
|
558
|
+
A("code", Nt, x(e(o)("recipe.version", { number: h.number })), 1),
|
|
559
|
+
A("div", zt, [
|
|
560
|
+
h.created_at ? (p(), k(e(Qe), {
|
|
561
|
+
key: 0,
|
|
562
|
+
value: h.created_at,
|
|
563
|
+
size: "md",
|
|
564
|
+
tone: "default"
|
|
565
|
+
}, null, 8, ["value"])) : D("", !0),
|
|
566
|
+
y(e(ft), {
|
|
567
|
+
size: "sm",
|
|
568
|
+
tone: "muted"
|
|
569
|
+
}, {
|
|
570
|
+
default: v(() => [
|
|
571
|
+
$(x(h.author ?? e(o)(`recipe.source-${h.source}`)) + " ", 1),
|
|
572
|
+
h.comment ? (p(), q(ee, { key: 0 }, [
|
|
573
|
+
$(" · " + x(h.comment), 1)
|
|
574
|
+
], 64)) : D("", !0)
|
|
575
|
+
]),
|
|
576
|
+
_: 2
|
|
577
|
+
}, 1024)
|
|
578
|
+
]),
|
|
579
|
+
h.number === R.value ? (p(), k(e(Z), {
|
|
555
580
|
key: 0,
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
581
|
+
type: "success",
|
|
582
|
+
dot: ""
|
|
583
|
+
}, {
|
|
584
|
+
default: v(() => [
|
|
585
|
+
$(x(e(o)("recipe.version-live")), 1)
|
|
586
|
+
]),
|
|
587
|
+
_: 1
|
|
588
|
+
})) : D("", !0),
|
|
589
|
+
g.value && h.number !== R.value ? (p(), k(e(le), {
|
|
590
|
+
key: 1,
|
|
561
591
|
size: "sm",
|
|
562
|
-
|
|
592
|
+
variant: "outline",
|
|
593
|
+
loading: V.value,
|
|
594
|
+
onClick: (M) => N(h)
|
|
563
595
|
}, {
|
|
564
|
-
default:
|
|
565
|
-
|
|
566
|
-
m.comment ? (v(), N(te, { key: 0 }, [
|
|
567
|
-
_(" · " + w(m.comment), 1)
|
|
568
|
-
], 64)) : q("", !0)
|
|
596
|
+
default: v(() => [
|
|
597
|
+
$(x(e(o)("recipe.restore-version")), 1)
|
|
569
598
|
]),
|
|
570
|
-
_:
|
|
571
|
-
},
|
|
572
|
-
]),
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
})) : q("", !0),
|
|
583
|
-
b.value && m.number !== T.value ? (v(), k(e(ee), {
|
|
584
|
-
key: 1,
|
|
585
|
-
size: "sm",
|
|
586
|
-
variant: "outline",
|
|
587
|
-
loading: S.value,
|
|
588
|
-
onClick: (P) => z(m)
|
|
589
|
-
}, {
|
|
590
|
-
default: d(() => [
|
|
591
|
-
_(w(e(u)("recipe.restore-version")), 1)
|
|
592
|
-
]),
|
|
593
|
-
_: 1
|
|
594
|
-
}, 8, ["loading", "onClick"])) : q("", !0)
|
|
595
|
-
], 2))), 128))
|
|
599
|
+
_: 1
|
|
600
|
+
}, 8, ["loading", "onClick"])) : D("", !0)
|
|
601
|
+
], 2))), 128))
|
|
602
|
+
]),
|
|
603
|
+
y(e(Xe), {
|
|
604
|
+
id: r.value?.id,
|
|
605
|
+
entity: "recipes",
|
|
606
|
+
screen: "recipes.form",
|
|
607
|
+
"can-restore": g.value,
|
|
608
|
+
stamp: [r.value?.published_at, r.value?.updated_at],
|
|
609
|
+
onRestored: b[0] || (b[0] = (h) => e(t)?.reload())
|
|
610
|
+
}, null, 8, ["id", "can-restore", "stamp"])
|
|
596
611
|
]));
|
|
597
612
|
}
|
|
598
|
-
}),
|
|
599
|
-
function
|
|
600
|
-
if (
|
|
601
|
-
const
|
|
602
|
-
return
|
|
613
|
+
}), At = /* @__PURE__ */ Re(qt, [["__scopeId", "data-v-23c74649"]]);
|
|
614
|
+
function Dt(u, l) {
|
|
615
|
+
if (u == null || u <= 0) return "";
|
|
616
|
+
const m = Math.floor(u / 60), t = u % 60;
|
|
617
|
+
return m === 0 ? l("panel.minutes", { count: t }) : t === 0 ? l("panel.hours", { hours: m }) : l("panel.hours-minutes", { hours: m, minutes: t });
|
|
603
618
|
}
|
|
604
|
-
const
|
|
619
|
+
const Et = /* @__PURE__ */ he({
|
|
605
620
|
__name: "RecipeCreateDialog",
|
|
606
|
-
setup(
|
|
607
|
-
const { open:
|
|
608
|
-
|
|
609
|
-
const i =
|
|
610
|
-
|
|
611
|
-
await
|
|
621
|
+
setup(u) {
|
|
622
|
+
const { open: l, resolve: m, dismiss: t } = yt(), o = oe(), E = fe(o);
|
|
623
|
+
ye();
|
|
624
|
+
const i = se("webx-recipes"), V = _(""), r = _(!1), g = _({}), R = it("field");
|
|
625
|
+
Ne(async () => {
|
|
626
|
+
await rt(), R.value?.querySelector("input")?.focus();
|
|
612
627
|
});
|
|
613
|
-
async function
|
|
614
|
-
if (!(
|
|
615
|
-
r.value = !0,
|
|
628
|
+
async function P() {
|
|
629
|
+
if (!(V.value.trim() === "" || r.value)) {
|
|
630
|
+
r.value = !0, g.value = {};
|
|
616
631
|
try {
|
|
617
|
-
|
|
618
|
-
} catch (
|
|
619
|
-
|
|
632
|
+
m((await E.create({ title: V.value.trim() })).recipe);
|
|
633
|
+
} catch (N) {
|
|
634
|
+
g.value = N.body?.errors ?? {};
|
|
620
635
|
} finally {
|
|
621
636
|
r.value = !1;
|
|
622
637
|
}
|
|
623
638
|
}
|
|
624
639
|
}
|
|
625
|
-
return (
|
|
626
|
-
open: e(
|
|
627
|
-
"onUpdate:open":
|
|
640
|
+
return (N, n) => (p(), k(e(mt), {
|
|
641
|
+
open: e(l),
|
|
642
|
+
"onUpdate:open": n[2] || (n[2] = (b) => st(l) ? l.value = b : null),
|
|
628
643
|
title: e(i)("panel.new-title"),
|
|
629
644
|
width: 440
|
|
630
645
|
}, {
|
|
631
|
-
footer:
|
|
632
|
-
|
|
633
|
-
default:
|
|
634
|
-
|
|
646
|
+
footer: v(() => [
|
|
647
|
+
y(e(gt), { size: "sm" }, {
|
|
648
|
+
default: v(() => [
|
|
649
|
+
y(e(le), {
|
|
635
650
|
variant: "outline",
|
|
636
|
-
onClick:
|
|
651
|
+
onClick: n[1] || (n[1] = (b) => e(t)())
|
|
637
652
|
}, {
|
|
638
|
-
default:
|
|
639
|
-
|
|
653
|
+
default: v(() => [
|
|
654
|
+
$(x(e(i)("panel.cancel")), 1)
|
|
640
655
|
]),
|
|
641
656
|
_: 1
|
|
642
657
|
}),
|
|
643
|
-
|
|
658
|
+
y(e(le), {
|
|
644
659
|
type: "primary",
|
|
645
660
|
loading: r.value,
|
|
646
|
-
disabled:
|
|
647
|
-
onClick:
|
|
661
|
+
disabled: V.value.trim() === "",
|
|
662
|
+
onClick: P
|
|
648
663
|
}, {
|
|
649
|
-
default:
|
|
650
|
-
|
|
664
|
+
default: v(() => [
|
|
665
|
+
$(x(e(i)("panel.create")), 1)
|
|
651
666
|
]),
|
|
652
667
|
_: 1
|
|
653
668
|
}, 8, ["loading", "disabled"])
|
|
@@ -655,22 +670,22 @@ const zt = /* @__PURE__ */ ce({
|
|
|
655
670
|
_: 1
|
|
656
671
|
})
|
|
657
672
|
]),
|
|
658
|
-
default:
|
|
659
|
-
|
|
673
|
+
default: v(() => [
|
|
674
|
+
y(e(bt), {
|
|
660
675
|
label: e(i)("panel.field-title"),
|
|
661
|
-
error:
|
|
676
|
+
error: g.value.title?.[0] ?? g.value.slug?.[0],
|
|
662
677
|
required: ""
|
|
663
678
|
}, {
|
|
664
|
-
default:
|
|
665
|
-
|
|
679
|
+
default: v(() => [
|
|
680
|
+
A("div", {
|
|
666
681
|
ref_key: "field",
|
|
667
|
-
ref:
|
|
682
|
+
ref: R
|
|
668
683
|
}, [
|
|
669
|
-
|
|
670
|
-
modelValue:
|
|
671
|
-
"onUpdate:modelValue":
|
|
684
|
+
y(e(Pe), {
|
|
685
|
+
modelValue: V.value,
|
|
686
|
+
"onUpdate:modelValue": n[0] || (n[0] = (b) => V.value = b),
|
|
672
687
|
"aria-label": e(i)("panel.field-title"),
|
|
673
|
-
onKeyup:
|
|
688
|
+
onKeyup: nt(P, ["enter"])
|
|
674
689
|
}, null, 8, ["modelValue", "aria-label"])
|
|
675
690
|
], 512)
|
|
676
691
|
]),
|
|
@@ -680,388 +695,388 @@ const zt = /* @__PURE__ */ ce({
|
|
|
680
695
|
_: 1
|
|
681
696
|
}, 8, ["open", "title"]));
|
|
682
697
|
}
|
|
683
|
-
}),
|
|
698
|
+
}), Pt = { class: "wx-recipes" }, Mt = { class: "wx-recipes__bar" }, Ot = ["src"], Ut = { class: "wx-recipe-row__name" }, Bt = { class: "wx-recipe-row__title" }, Lt = { class: "wx-recipe-row__address" }, Ht = { class: "wx-recipe-row__facts" }, Ft = { class: "wx-recipe-row__chips" }, Kt = { class: "wx-recipe-row__state" }, Jt = {
|
|
684
699
|
key: 0,
|
|
685
700
|
class: "wx-recipe-row__time"
|
|
686
|
-
},
|
|
701
|
+
}, Gt = /* @__PURE__ */ he({
|
|
687
702
|
__name: "RecipesPage",
|
|
688
703
|
props: {
|
|
689
704
|
base: { default: "/recipes" }
|
|
690
705
|
},
|
|
691
|
-
setup(
|
|
692
|
-
const
|
|
693
|
-
|
|
694
|
-
const i =
|
|
695
|
-
() =>
|
|
696
|
-
),
|
|
697
|
-
get: () => typeof
|
|
706
|
+
setup(u) {
|
|
707
|
+
const l = u, m = oe(), t = fe(m), o = Ae(), E = De();
|
|
708
|
+
ye();
|
|
709
|
+
const i = se("webx-recipes"), V = $e(), r = _([]), g = _({ categories: [], nutrients: [], services: null }), R = _(!0), P = wt(Et), N = f(() => m.can("recipes.manage")), n = f(
|
|
710
|
+
() => m.state.manifest?.modules.find((a) => a.id === "recipes")?.title ?? i("module.recipes")
|
|
711
|
+
), b = f({
|
|
712
|
+
get: () => typeof o.query.view == "string" ? o.query.view : "",
|
|
698
713
|
set: (a) => {
|
|
699
|
-
|
|
700
|
-
query: { ...
|
|
714
|
+
E.replace({
|
|
715
|
+
query: { ...o.query, view: a === "" ? void 0 : String(a) }
|
|
701
716
|
});
|
|
702
717
|
}
|
|
703
|
-
}),
|
|
704
|
-
function
|
|
705
|
-
const
|
|
706
|
-
return typeof
|
|
718
|
+
}), h = f(() => b.value === "trashed");
|
|
719
|
+
function M(a) {
|
|
720
|
+
const d = o.query[a];
|
|
721
|
+
return typeof d == "string" && d !== "" && Number(d) || null;
|
|
707
722
|
}
|
|
708
|
-
const
|
|
723
|
+
const B = f(() => M("category")), F = f(() => M("nutrient")), O = f(() => M("service")), I = f(() => typeof o.query.q == "string" ? o.query.q : ""), j = _(I.value), Q = f(() => [
|
|
709
724
|
{ value: "", label: i("panel.view-all") },
|
|
710
725
|
{ value: "published", label: i("panel.view-published") },
|
|
711
726
|
{ value: "draft", label: i("panel.view-draft") },
|
|
712
727
|
{ value: "unpublished", label: i("panel.view-unpublished") },
|
|
713
728
|
{ value: "trashed", label: i("panel.bin"), icon: "trash" }
|
|
714
|
-
]),
|
|
715
|
-
() =>
|
|
716
|
-
),
|
|
717
|
-
async function
|
|
718
|
-
|
|
729
|
+
]), z = f(
|
|
730
|
+
() => b.value === "" && I.value.trim() === "" && B.value === null && F.value === null && O.value === null
|
|
731
|
+
), T = f(() => N.value && z.value), K = f(() => i(z.value ? "panel.order-all" : "panel.order-locked")), me = f(() => I.value !== "" ? i("panel.empty-search") : h.value ? i("panel.empty-bin") : i("panel.empty"));
|
|
732
|
+
async function U() {
|
|
733
|
+
R.value = !0;
|
|
719
734
|
try {
|
|
720
735
|
const a = await t.list({
|
|
721
|
-
q:
|
|
722
|
-
category:
|
|
723
|
-
nutrient:
|
|
724
|
-
service:
|
|
725
|
-
status:
|
|
726
|
-
trashed:
|
|
736
|
+
q: I.value,
|
|
737
|
+
category: B.value,
|
|
738
|
+
nutrient: F.value,
|
|
739
|
+
service: O.value,
|
|
740
|
+
status: h.value ? "" : b.value,
|
|
741
|
+
trashed: h.value
|
|
727
742
|
});
|
|
728
|
-
r.value = a.data,
|
|
743
|
+
r.value = a.data, g.value = a.filters;
|
|
729
744
|
} catch (a) {
|
|
730
|
-
|
|
745
|
+
S.danger(V(a));
|
|
731
746
|
} finally {
|
|
732
|
-
|
|
747
|
+
R.value = !1;
|
|
733
748
|
}
|
|
734
749
|
}
|
|
735
|
-
|
|
736
|
-
() => [
|
|
750
|
+
ne(
|
|
751
|
+
() => [b.value, B.value, F.value, O.value, I.value],
|
|
737
752
|
() => {
|
|
738
|
-
|
|
753
|
+
U();
|
|
739
754
|
}
|
|
740
|
-
),
|
|
741
|
-
let
|
|
742
|
-
|
|
743
|
-
clearTimeout(
|
|
744
|
-
|
|
755
|
+
), U();
|
|
756
|
+
let C;
|
|
757
|
+
ne(j, (a) => {
|
|
758
|
+
clearTimeout(C), C = setTimeout(() => {
|
|
759
|
+
E.replace({ query: { ...o.query, q: a.trim() === "" ? void 0 : a } });
|
|
745
760
|
}, 300);
|
|
746
|
-
}), ze(() => clearTimeout(
|
|
747
|
-
function
|
|
748
|
-
|
|
749
|
-
query: { ...
|
|
761
|
+
}), ze(() => clearTimeout(C));
|
|
762
|
+
function ie(a, d) {
|
|
763
|
+
E.replace({
|
|
764
|
+
query: { ...o.query, [a]: typeof d == "number" ? String(d) : void 0 }
|
|
750
765
|
});
|
|
751
766
|
}
|
|
752
|
-
const
|
|
753
|
-
function
|
|
754
|
-
|
|
767
|
+
const X = (a) => (a ?? []).map((d) => ({ value: d.id, label: d.title }));
|
|
768
|
+
function ue(a) {
|
|
769
|
+
E.push({ path: `${l.base}/${a.id}`, query: { ...o.query } });
|
|
755
770
|
}
|
|
756
|
-
async function
|
|
757
|
-
const a = await
|
|
758
|
-
a &&
|
|
771
|
+
async function ce() {
|
|
772
|
+
const a = await P({});
|
|
773
|
+
a && ue(a);
|
|
759
774
|
}
|
|
760
|
-
async function
|
|
775
|
+
async function J() {
|
|
761
776
|
try {
|
|
762
777
|
await t.reorder(r.value.map((a) => a.id));
|
|
763
778
|
} catch (a) {
|
|
764
|
-
|
|
779
|
+
S.danger(V(a, i("panel.reorder-failed"))), await U();
|
|
765
780
|
}
|
|
766
781
|
}
|
|
767
|
-
function
|
|
768
|
-
if (!
|
|
769
|
-
if (
|
|
782
|
+
function be(a) {
|
|
783
|
+
if (!N.value) return [];
|
|
784
|
+
if (h.value)
|
|
770
785
|
return [
|
|
771
786
|
{
|
|
772
787
|
key: "restore",
|
|
773
788
|
icon: "refresh",
|
|
774
789
|
label: i("panel.restore"),
|
|
775
790
|
run: () => {
|
|
776
|
-
|
|
791
|
+
ge(a);
|
|
777
792
|
}
|
|
778
793
|
}
|
|
779
794
|
];
|
|
780
|
-
const
|
|
781
|
-
{ key: "open", icon: "edit", label: i("panel.open"), run: () =>
|
|
795
|
+
const d = [
|
|
796
|
+
{ key: "open", icon: "edit", label: i("panel.open"), run: () => ue(a) }
|
|
782
797
|
];
|
|
783
|
-
return a.url && a.status !== "draft" &&
|
|
798
|
+
return a.url && a.status !== "draft" && d.push({
|
|
784
799
|
key: "site",
|
|
785
800
|
icon: "external-link",
|
|
786
801
|
label: i("panel.open-on-site"),
|
|
787
802
|
href: a.url
|
|
788
|
-
}), a.url &&
|
|
803
|
+
}), a.url && d.push({
|
|
789
804
|
key: "copy",
|
|
790
805
|
icon: "copy",
|
|
791
806
|
label: i("panel.copy-address"),
|
|
792
807
|
run: () => {
|
|
793
|
-
|
|
808
|
+
G(a);
|
|
794
809
|
}
|
|
795
|
-
}),
|
|
810
|
+
}), d.push(
|
|
796
811
|
a.status === "published" || a.status === "modified" ? {
|
|
797
812
|
key: "unpublish",
|
|
798
813
|
icon: "eye-off",
|
|
799
814
|
label: i("panel.unpublish"),
|
|
800
815
|
run: () => {
|
|
801
|
-
|
|
816
|
+
te(() => t.unpublish(a.id), i("panel.unpublished-done"));
|
|
802
817
|
}
|
|
803
818
|
} : {
|
|
804
819
|
key: "publish",
|
|
805
820
|
icon: "upload",
|
|
806
821
|
label: i("panel.publish"),
|
|
807
822
|
run: () => {
|
|
808
|
-
|
|
823
|
+
te(() => t.publish(a.id), i("panel.published"));
|
|
809
824
|
}
|
|
810
825
|
}
|
|
811
|
-
),
|
|
826
|
+
), d.push({
|
|
812
827
|
key: "delete",
|
|
813
828
|
icon: "trash",
|
|
814
829
|
label: i("panel.delete"),
|
|
815
830
|
danger: !0,
|
|
816
831
|
run: () => {
|
|
817
|
-
|
|
832
|
+
Y(a);
|
|
818
833
|
}
|
|
819
|
-
}),
|
|
834
|
+
}), d;
|
|
820
835
|
}
|
|
821
|
-
async function
|
|
822
|
-
await
|
|
836
|
+
async function Y(a) {
|
|
837
|
+
await ae({
|
|
823
838
|
title: i("panel.delete-title", { title: a.title }),
|
|
824
839
|
message: i("panel.delete-text"),
|
|
825
840
|
confirmText: i("panel.delete"),
|
|
826
841
|
cancelText: i("panel.cancel"),
|
|
827
842
|
tone: "danger"
|
|
828
|
-
}) && await
|
|
843
|
+
}) && await te(() => t.remove(a.id), i("panel.deleted"));
|
|
829
844
|
}
|
|
830
|
-
async function
|
|
831
|
-
await
|
|
845
|
+
async function ge(a) {
|
|
846
|
+
await te(() => t.restore(a.id), i("panel.restored"));
|
|
832
847
|
}
|
|
833
|
-
async function
|
|
848
|
+
async function te(a, d) {
|
|
834
849
|
try {
|
|
835
|
-
await a(),
|
|
850
|
+
await a(), S.success(d);
|
|
836
851
|
} catch (c) {
|
|
837
|
-
|
|
852
|
+
S.danger(V(c));
|
|
838
853
|
} finally {
|
|
839
|
-
await
|
|
854
|
+
await U();
|
|
840
855
|
}
|
|
841
856
|
}
|
|
842
|
-
async function
|
|
857
|
+
async function G(a) {
|
|
843
858
|
if (a.url)
|
|
844
859
|
try {
|
|
845
|
-
await navigator.clipboard.writeText(a.url),
|
|
860
|
+
await navigator.clipboard.writeText(a.url), S.success(i("panel.address-copied"));
|
|
846
861
|
} catch {
|
|
847
862
|
}
|
|
848
863
|
}
|
|
849
|
-
function
|
|
864
|
+
function H(a) {
|
|
850
865
|
return a === "published" || a === "modified" ? "success" : "default";
|
|
851
866
|
}
|
|
852
|
-
function
|
|
853
|
-
return
|
|
867
|
+
function we(a) {
|
|
868
|
+
return h.value ? "—" : a.path === null ? i("panel.no-address") : `/${a.path}`;
|
|
854
869
|
}
|
|
855
|
-
const
|
|
856
|
-
() =>
|
|
857
|
-
|
|
870
|
+
const xe = f(
|
|
871
|
+
() => N.value ? [{ key: "new", label: i("panel.new"), icon: "plus", primary: !0, run: () => {
|
|
872
|
+
ce();
|
|
858
873
|
} }] : []
|
|
859
874
|
);
|
|
860
|
-
return (a,
|
|
861
|
-
|
|
862
|
-
view:
|
|
863
|
-
"onUpdate:view":
|
|
864
|
-
title:
|
|
865
|
-
views:
|
|
866
|
-
actions:
|
|
875
|
+
return (a, d) => (p(), q("div", Pt, [
|
|
876
|
+
y(e(Ye), {
|
|
877
|
+
view: b.value,
|
|
878
|
+
"onUpdate:view": d[5] || (d[5] = (c) => b.value = c),
|
|
879
|
+
title: n.value,
|
|
880
|
+
views: Q.value,
|
|
881
|
+
actions: xe.value,
|
|
867
882
|
padding: "sm"
|
|
868
883
|
}, {
|
|
869
|
-
default:
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
modelValue:
|
|
873
|
-
"onUpdate:modelValue":
|
|
884
|
+
default: v(() => [
|
|
885
|
+
A("div", Mt, [
|
|
886
|
+
y(e(Pe), {
|
|
887
|
+
modelValue: j.value,
|
|
888
|
+
"onUpdate:modelValue": d[0] || (d[0] = (c) => j.value = c),
|
|
874
889
|
class: "wx-recipes__search",
|
|
875
890
|
size: "sm",
|
|
876
891
|
clearable: "",
|
|
877
892
|
placeholder: e(i)("panel.search"),
|
|
878
893
|
"aria-label": e(i)("panel.search")
|
|
879
894
|
}, {
|
|
880
|
-
prefix:
|
|
881
|
-
|
|
895
|
+
prefix: v(() => [
|
|
896
|
+
y(e(_e), {
|
|
882
897
|
name: "search",
|
|
883
898
|
size: "sm"
|
|
884
899
|
})
|
|
885
900
|
]),
|
|
886
901
|
_: 1
|
|
887
902
|
}, 8, ["modelValue", "placeholder", "aria-label"]),
|
|
888
|
-
|
|
889
|
-
"model-value":
|
|
890
|
-
options:
|
|
903
|
+
y(e(ke), {
|
|
904
|
+
"model-value": B.value,
|
|
905
|
+
options: X(g.value.categories),
|
|
891
906
|
placeholder: e(i)("panel.any-category"),
|
|
892
907
|
"aria-label": e(i)("panel.filter-category"),
|
|
893
908
|
clearable: "",
|
|
894
909
|
size: "sm",
|
|
895
|
-
"onUpdate:modelValue":
|
|
910
|
+
"onUpdate:modelValue": d[1] || (d[1] = (c) => ie("category", c))
|
|
896
911
|
}, null, 8, ["model-value", "options", "placeholder", "aria-label"]),
|
|
897
|
-
|
|
898
|
-
"model-value":
|
|
899
|
-
options:
|
|
912
|
+
y(e(ke), {
|
|
913
|
+
"model-value": F.value,
|
|
914
|
+
options: X(g.value.nutrients),
|
|
900
915
|
placeholder: e(i)("panel.any-nutrient"),
|
|
901
916
|
"aria-label": e(i)("panel.filter-nutrient"),
|
|
902
917
|
clearable: "",
|
|
903
918
|
size: "sm",
|
|
904
|
-
"onUpdate:modelValue":
|
|
919
|
+
"onUpdate:modelValue": d[2] || (d[2] = (c) => ie("nutrient", c))
|
|
905
920
|
}, null, 8, ["model-value", "options", "placeholder", "aria-label"]),
|
|
906
|
-
|
|
921
|
+
g.value.services !== null ? (p(), k(e(ke), {
|
|
907
922
|
key: 0,
|
|
908
|
-
"model-value":
|
|
909
|
-
options:
|
|
923
|
+
"model-value": O.value,
|
|
924
|
+
options: X(g.value.services),
|
|
910
925
|
placeholder: e(i)("panel.any-service"),
|
|
911
926
|
"aria-label": e(i)("panel.filter-service"),
|
|
912
927
|
clearable: "",
|
|
913
928
|
size: "sm",
|
|
914
|
-
"onUpdate:modelValue":
|
|
915
|
-
}, null, 8, ["model-value", "options", "placeholder", "aria-label"])) :
|
|
929
|
+
"onUpdate:modelValue": d[3] || (d[3] = (c) => ie("service", c))
|
|
930
|
+
}, null, 8, ["model-value", "options", "placeholder", "aria-label"])) : D("", !0)
|
|
916
931
|
]),
|
|
917
|
-
|
|
932
|
+
R.value && r.value.length === 0 ? (p(), k(e(ve), {
|
|
918
933
|
key: 0,
|
|
919
934
|
class: "wx-recipes__loading",
|
|
920
935
|
rows: 5
|
|
921
|
-
})) : r.value.length === 0 ? (
|
|
936
|
+
})) : r.value.length === 0 ? (p(), k(e(Ee), {
|
|
922
937
|
key: 1,
|
|
923
|
-
title:
|
|
924
|
-
description:
|
|
925
|
-
}, null, 8, ["title", "description"])) : (
|
|
926
|
-
|
|
938
|
+
title: me.value,
|
|
939
|
+
description: z.value ? e(i)("panel.empty-help") : void 0
|
|
940
|
+
}, null, 8, ["title", "description"])) : (p(), q(ee, { key: 2 }, [
|
|
941
|
+
y(e(xt), {
|
|
927
942
|
modelValue: r.value,
|
|
928
|
-
"onUpdate:modelValue":
|
|
929
|
-
class:
|
|
943
|
+
"onUpdate:modelValue": d[4] || (d[4] = (c) => r.value = c),
|
|
944
|
+
class: Te(["wx-recipes__list", { "is-loading": R.value }]),
|
|
930
945
|
plain: "",
|
|
931
946
|
"item-key": "id",
|
|
932
|
-
handle:
|
|
947
|
+
handle: T.value ? "grip" : "row",
|
|
933
948
|
"item-label": (c) => c.title,
|
|
934
|
-
disabled: !
|
|
935
|
-
onMove:
|
|
949
|
+
disabled: !T.value,
|
|
950
|
+
onMove: J
|
|
936
951
|
}, {
|
|
937
|
-
default:
|
|
938
|
-
(
|
|
939
|
-
default:
|
|
940
|
-
|
|
941
|
-
class:
|
|
952
|
+
default: v(({ item: c }) => [
|
|
953
|
+
(p(), k(lt(h.value ? "div" : "router-link"), ot({ class: "wx-recipe-row" }, h.value ? {} : { to: { path: `${l.base}/${c.id}`, query: e(o).query } }), {
|
|
954
|
+
default: v(() => [
|
|
955
|
+
A("span", {
|
|
956
|
+
class: Te(["wx-recipe-row__cover", { "is-empty": !c.cover?.thumb }])
|
|
942
957
|
}, [
|
|
943
|
-
c.cover?.thumb ? (
|
|
958
|
+
c.cover?.thumb ? (p(), q("img", {
|
|
944
959
|
key: 0,
|
|
945
960
|
src: c.cover.thumb,
|
|
946
961
|
alt: "",
|
|
947
962
|
loading: "lazy"
|
|
948
|
-
}, null, 8,
|
|
963
|
+
}, null, 8, Ot)) : (p(), k(e(_e), {
|
|
949
964
|
key: 1,
|
|
950
965
|
name: "image",
|
|
951
966
|
size: "sm"
|
|
952
967
|
}))
|
|
953
968
|
], 2),
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
969
|
+
A("span", Ut, [
|
|
970
|
+
A("span", Bt, x(c.title), 1),
|
|
971
|
+
A("span", Lt, [
|
|
972
|
+
$(x(we(c)), 1),
|
|
973
|
+
h.value ? D("", !0) : (p(), k(e(et), {
|
|
959
974
|
key: 0,
|
|
960
975
|
locale: c.address_locale
|
|
961
976
|
}, null, 8, ["locale"]))
|
|
962
977
|
])
|
|
963
978
|
]),
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
(
|
|
967
|
-
key:
|
|
979
|
+
A("span", Ht, [
|
|
980
|
+
A("span", Ft, [
|
|
981
|
+
(p(!0), q(ee, null, qe(c.categories, (re, de) => (p(), q(ee, {
|
|
982
|
+
key: re.id
|
|
968
983
|
}, [
|
|
969
|
-
|
|
984
|
+
de === 0 ? (p(), k(e(_t), {
|
|
970
985
|
key: 0,
|
|
971
986
|
content: e(i)("panel.main-category")
|
|
972
987
|
}, {
|
|
973
|
-
default:
|
|
974
|
-
|
|
988
|
+
default: v(() => [
|
|
989
|
+
y(e(Z), {
|
|
975
990
|
size: "sm",
|
|
976
991
|
round: "",
|
|
977
992
|
type: "primary"
|
|
978
993
|
}, {
|
|
979
|
-
default:
|
|
980
|
-
|
|
994
|
+
default: v(() => [
|
|
995
|
+
$(x(re.title), 1)
|
|
981
996
|
]),
|
|
982
997
|
_: 2
|
|
983
998
|
}, 1024)
|
|
984
999
|
]),
|
|
985
1000
|
_: 2
|
|
986
|
-
}, 1032, ["content"])) : (
|
|
1001
|
+
}, 1032, ["content"])) : (p(), k(e(Z), {
|
|
987
1002
|
key: 1,
|
|
988
1003
|
size: "sm",
|
|
989
1004
|
round: ""
|
|
990
1005
|
}, {
|
|
991
|
-
default:
|
|
992
|
-
|
|
1006
|
+
default: v(() => [
|
|
1007
|
+
$(x(re.title), 1)
|
|
993
1008
|
]),
|
|
994
1009
|
_: 2
|
|
995
1010
|
}, 1024))
|
|
996
1011
|
], 64))), 128))
|
|
997
1012
|
]),
|
|
998
|
-
|
|
999
|
-
c.minutes ? (
|
|
1000
|
-
|
|
1013
|
+
A("span", Kt, [
|
|
1014
|
+
c.minutes ? (p(), q("span", Jt, [
|
|
1015
|
+
y(e(_e), {
|
|
1001
1016
|
name: "clock",
|
|
1002
1017
|
size: "sm"
|
|
1003
1018
|
}),
|
|
1004
|
-
|
|
1005
|
-
])) :
|
|
1006
|
-
|
|
1007
|
-
type:
|
|
1019
|
+
$(x(e(Dt)(c.minutes, e(i))), 1)
|
|
1020
|
+
])) : D("", !0),
|
|
1021
|
+
y(e(Z), {
|
|
1022
|
+
type: H(c.status),
|
|
1008
1023
|
dot: "",
|
|
1009
1024
|
size: "sm"
|
|
1010
1025
|
}, {
|
|
1011
|
-
default:
|
|
1012
|
-
|
|
1026
|
+
default: v(() => [
|
|
1027
|
+
$(x(e(i)(`panel.status-${c.status}`)), 1)
|
|
1013
1028
|
]),
|
|
1014
1029
|
_: 2
|
|
1015
1030
|
}, 1032, ["type"]),
|
|
1016
|
-
c.status === "modified" ? (
|
|
1031
|
+
c.status === "modified" ? (p(), k(e(Z), {
|
|
1017
1032
|
key: 1,
|
|
1018
1033
|
type: "primary",
|
|
1019
1034
|
size: "sm",
|
|
1020
1035
|
round: ""
|
|
1021
1036
|
}, {
|
|
1022
|
-
default:
|
|
1023
|
-
|
|
1037
|
+
default: v(() => [
|
|
1038
|
+
$(x(e(i)("panel.edits")), 1)
|
|
1024
1039
|
]),
|
|
1025
1040
|
_: 1
|
|
1026
|
-
})) :
|
|
1041
|
+
})) : D("", !0)
|
|
1027
1042
|
])
|
|
1028
1043
|
])
|
|
1029
1044
|
]),
|
|
1030
1045
|
_: 2
|
|
1031
1046
|
}, 1040))
|
|
1032
1047
|
]),
|
|
1033
|
-
actions:
|
|
1034
|
-
|
|
1035
|
-
actions:
|
|
1048
|
+
actions: v(({ item: c }) => [
|
|
1049
|
+
y(e(Ze), {
|
|
1050
|
+
actions: be(c),
|
|
1036
1051
|
label: c.title
|
|
1037
1052
|
}, null, 8, ["actions", "label"])
|
|
1038
1053
|
]),
|
|
1039
1054
|
_: 1
|
|
1040
1055
|
}, 8, ["modelValue", "class", "handle", "item-label", "disabled"]),
|
|
1041
|
-
|
|
1056
|
+
N.value && !h.value ? (p(), k(e(kt), {
|
|
1042
1057
|
key: 0,
|
|
1043
1058
|
class: "wx-recipes__note",
|
|
1044
1059
|
type: "info",
|
|
1045
|
-
description:
|
|
1046
|
-
}, null, 8, ["description"])) :
|
|
1060
|
+
description: K.value
|
|
1061
|
+
}, null, 8, ["description"])) : D("", !0)
|
|
1047
1062
|
], 64))
|
|
1048
1063
|
]),
|
|
1049
1064
|
_: 1
|
|
1050
1065
|
}, 8, ["view", "title", "views", "actions"])
|
|
1051
1066
|
]));
|
|
1052
1067
|
}
|
|
1053
|
-
}),
|
|
1054
|
-
function
|
|
1068
|
+
}), jt = /* @__PURE__ */ Re(Gt, [["__scopeId", "data-v-27e46b1b"]]);
|
|
1069
|
+
function Qt(u = "/recipes") {
|
|
1055
1070
|
return {
|
|
1056
1071
|
api: "recipes/categories",
|
|
1057
|
-
path: `${
|
|
1072
|
+
path: `${u}/categories`,
|
|
1058
1073
|
name: "webx.recipes.categories",
|
|
1059
1074
|
module: "recipe-categories",
|
|
1060
1075
|
screen: "recipes.category-form",
|
|
1061
1076
|
manage: "recipes.categories.manage",
|
|
1062
1077
|
count: "recipes_count",
|
|
1063
1078
|
// A category has no order of its own inside it (decision 4): the link shows what is in it.
|
|
1064
|
-
items: (
|
|
1079
|
+
items: (l) => ({ path: u, query: { category: String(l) } }),
|
|
1065
1080
|
words: {
|
|
1066
1081
|
new: "webx-recipes::category.new",
|
|
1067
1082
|
empty: "webx-recipes::category.empty",
|
|
@@ -1081,16 +1096,16 @@ function Ht(l = "/recipes") {
|
|
|
1081
1096
|
}
|
|
1082
1097
|
};
|
|
1083
1098
|
}
|
|
1084
|
-
function
|
|
1099
|
+
function Xt(u = "/recipes") {
|
|
1085
1100
|
return {
|
|
1086
1101
|
api: "recipes/nutrients",
|
|
1087
|
-
path: `${
|
|
1102
|
+
path: `${u}/nutrients`,
|
|
1088
1103
|
name: "webx.recipes.nutrients",
|
|
1089
1104
|
module: "recipe-nutrients",
|
|
1090
1105
|
screen: "recipes.nutrient-form",
|
|
1091
1106
|
manage: "recipes.categories.manage",
|
|
1092
1107
|
count: "recipes_count",
|
|
1093
|
-
items: (
|
|
1108
|
+
items: (l) => ({ path: u, query: { nutrient: String(l) } }),
|
|
1094
1109
|
words: {
|
|
1095
1110
|
new: "webx-recipes::nutrient.new",
|
|
1096
1111
|
empty: "webx-recipes::nutrient.empty",
|
|
@@ -1107,19 +1122,19 @@ function Ft(l = "/recipes") {
|
|
|
1107
1122
|
}
|
|
1108
1123
|
};
|
|
1109
1124
|
}
|
|
1110
|
-
function
|
|
1111
|
-
const
|
|
1125
|
+
function aa(u = {}) {
|
|
1126
|
+
const l = u.path ?? "/recipes";
|
|
1112
1127
|
return [
|
|
1113
1128
|
{
|
|
1114
1129
|
id: "recipes",
|
|
1115
|
-
path:
|
|
1130
|
+
path: l,
|
|
1116
1131
|
routes: [
|
|
1117
|
-
{ path:
|
|
1132
|
+
{ path: l, name: "webx.recipes", component: jt, props: { base: l } },
|
|
1118
1133
|
{
|
|
1119
|
-
path: `${
|
|
1134
|
+
path: `${l}/:id(\\d+)`,
|
|
1120
1135
|
name: "webx.recipes.edit",
|
|
1121
|
-
component:
|
|
1122
|
-
props: { base:
|
|
1136
|
+
component: Vt,
|
|
1137
|
+
props: { base: l }
|
|
1123
1138
|
}
|
|
1124
1139
|
],
|
|
1125
1140
|
/*
|
|
@@ -1127,35 +1142,35 @@ function Qt(l = {}) {
|
|
|
1127
1142
|
* panel's (`wx-slug`, `wx-categories`, `wx-relations`, `wx-gallery`, `wx-rich-text`).
|
|
1128
1143
|
*/
|
|
1129
1144
|
types: {
|
|
1130
|
-
"wx-recipe-history": { component:
|
|
1145
|
+
"wx-recipe-history": { component: At, kind: "display" }
|
|
1131
1146
|
}
|
|
1132
1147
|
},
|
|
1133
1148
|
{
|
|
1134
1149
|
id: "recipe-categories",
|
|
1135
|
-
path: `${
|
|
1136
|
-
routes:
|
|
1150
|
+
path: `${l}/categories`,
|
|
1151
|
+
routes: Se(Qt(l))
|
|
1137
1152
|
},
|
|
1138
1153
|
{
|
|
1139
1154
|
id: "recipe-nutrients",
|
|
1140
|
-
path: `${
|
|
1141
|
-
routes:
|
|
1155
|
+
path: `${l}/nutrients`,
|
|
1156
|
+
routes: Se(Xt(l))
|
|
1142
1157
|
}
|
|
1143
1158
|
];
|
|
1144
1159
|
}
|
|
1145
1160
|
export {
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1161
|
+
Ce as RECIPES_API,
|
|
1162
|
+
Et as WxRecipeCreateDialog,
|
|
1163
|
+
Vt as WxRecipeEditorPage,
|
|
1164
|
+
At as WxRecipeHistory,
|
|
1165
|
+
jt as WxRecipesPage,
|
|
1166
|
+
fe as createRecipesApi,
|
|
1167
|
+
Dt as formatMinutes,
|
|
1168
|
+
Tt as provideRecipeEditor,
|
|
1169
|
+
Qt as recipeCategoriesOptions,
|
|
1170
|
+
Me as recipeEditorKey,
|
|
1171
|
+
Xt as recipeNutrientsOptions,
|
|
1172
|
+
aa as recipes,
|
|
1173
|
+
Rt as recipesMessages,
|
|
1174
|
+
$t as useRecipeEditor
|
|
1160
1175
|
};
|
|
1161
1176
|
//# sourceMappingURL=index.js.map
|