@webx-ui/module-banners 0.3.2 → 0.3.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.
- package/dist/{BannerEditorPage-j7WlEaek.js → BannerEditorPage-B8e-IHkN.js} +2 -2
- package/dist/{BannerEditorPage-j7WlEaek.js.map → BannerEditorPage-B8e-IHkN.js.map} +1 -1
- package/dist/BannersPage-D7hpUcBn.js +607 -0
- package/dist/BannersPage-D7hpUcBn.js.map +1 -0
- package/dist/{index-3RALKrkh.js → index-QnpLuOX2.js} +552 -528
- package/dist/index-QnpLuOX2.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +2 -0
- package/package.json +5 -5
- package/dist/BannersPage-Dl_BCozz.js +0 -591
- package/dist/BannersPage-Dl_BCozz.js.map +0 -1
- package/dist/index-3RALKrkh.js.map +0 -1
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { provide as
|
|
2
|
-
import { useLocales as
|
|
3
|
-
import { useAdmin as
|
|
4
|
-
import { WxMediaField as
|
|
5
|
-
function
|
|
1
|
+
import { provide as St, inject as _t, defineComponent as lt, computed as v, openBlock as f, createElementBlock as x, createElementVNode as w, createVNode as d, unref as e, withCtx as m, createTextVNode as _, toDisplayString as V, Fragment as H, createBlock as W, createCommentVNode as I, isRef as ye, renderList as ie, normalizeClass as J, normalizeStyle as ke, ref as ae, reactive as Ot, watch as Bt, onMounted as Lt, onBeforeUnmount as Nt, resolveDynamicComponent as Pt, withModifiers as De, defineAsyncComponent as nt } from "vue";
|
|
2
|
+
import { useLocales as st, WxInput as qe, WxPopconfirm as ot, WxButton as E, WxIcon as F, WxFormItem as S, WxTextarea as Tt, WxText as Y, WxSelect as pe, WxInputNumber as xe, WxSwitch as Se, WxSegmented as it, WxColorPicker as Ut, WxTooltip as Ge, WxSortableList as Wt } from "@webx-ui/core";
|
|
3
|
+
import { useAdmin as rt, useTranslate as dt, useRemoveConfirm as ut, WxLinkField as It } from "@webx-ui/module-admin";
|
|
4
|
+
import { WxMediaField as Et, createMediaApi as Dt } from "@webx-ui/module-media";
|
|
5
|
+
function At(t) {
|
|
6
6
|
const c = `${t.apiPath}/banners`, r = (s) => `${c}/places/${encodeURIComponent(s)}`, y = (s) => s.data;
|
|
7
7
|
return {
|
|
8
8
|
places: () => t.http.get(`${c}/places`).then(y),
|
|
9
9
|
createPlace: (s) => t.http.post(`${c}/places`, s).then(y),
|
|
10
|
-
renamePlace: (s,
|
|
10
|
+
renamePlace: (s, g) => t.http.put(r(s), { title: g }).then(y),
|
|
11
11
|
removePlace: (s) => t.http.delete(r(s)).then(() => {
|
|
12
12
|
}),
|
|
13
|
-
list: (s,
|
|
13
|
+
list: (s, g = !1) => t.http.get(`${r(s)}/banners${g ? "?trashed=1" : ""}`).then(y),
|
|
14
14
|
get: (s) => t.http.get(`${c}/${s}`).then(y),
|
|
15
|
-
create: (s,
|
|
16
|
-
save: (s,
|
|
15
|
+
create: (s, g) => t.http.post(`${r(s)}/banners`, { values: g }).then(y),
|
|
16
|
+
save: (s, g, O) => t.http.put(
|
|
17
17
|
`${c}/${s}`,
|
|
18
|
-
|
|
18
|
+
O === void 0 ? { values: g } : { values: g, place: O }
|
|
19
19
|
).then(y),
|
|
20
20
|
remove: (s) => t.http.delete(`${c}/${s}`).then(() => {
|
|
21
21
|
}),
|
|
22
22
|
// The resource of the list line, and not the form's pair: a restored banner stays closed.
|
|
23
23
|
restore: (s) => t.http.post(`${c}/${s}/restore`, {}).then(y),
|
|
24
|
-
reorder: (s,
|
|
24
|
+
reorder: (s, g) => t.http.post(`${r(s)}/reorder`, { ids: g }).then(() => {
|
|
25
25
|
}),
|
|
26
26
|
theme: () => t.http.get(`${c}/theme`).then(y)
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
const
|
|
30
|
-
function
|
|
31
|
-
|
|
29
|
+
const ct = /* @__PURE__ */ Symbol("wx-banner-editor");
|
|
30
|
+
function Ma(t) {
|
|
31
|
+
St(ct, t);
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
return
|
|
33
|
+
function Mt() {
|
|
34
|
+
return _t(ct, null);
|
|
35
35
|
}
|
|
36
|
-
const
|
|
36
|
+
const Ft = {
|
|
37
37
|
module: {
|
|
38
38
|
banners: "Banners"
|
|
39
39
|
},
|
|
@@ -228,15 +228,15 @@ const Dt = {
|
|
|
228
228
|
"loop-spin": "Spin",
|
|
229
229
|
"loop-float": "Float"
|
|
230
230
|
}
|
|
231
|
-
},
|
|
232
|
-
function
|
|
231
|
+
}, Xe = /* @__PURE__ */ new WeakSet();
|
|
232
|
+
function Rt() {
|
|
233
233
|
try {
|
|
234
|
-
const { i18n: t } =
|
|
235
|
-
|
|
234
|
+
const { i18n: t } = rt();
|
|
235
|
+
Xe.has(t) || (t.defaults("webx-banners", Ft), Xe.add(t));
|
|
236
236
|
} catch {
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
|
-
const
|
|
239
|
+
const $e = {
|
|
240
240
|
x: [-50, 150, 5],
|
|
241
241
|
y: [-50, 150, 5],
|
|
242
242
|
w: [1, 150, 40],
|
|
@@ -246,7 +246,7 @@ const ke = {
|
|
|
246
246
|
tracking: [-0.2, 1, 0],
|
|
247
247
|
rotate: [-180, 180, 0],
|
|
248
248
|
gap: [0, 10, 1]
|
|
249
|
-
},
|
|
249
|
+
}, Kt = ["tl", "t", "tr", "l", "c", "r", "bl", "b", "br"], jt = {
|
|
250
250
|
tl: [0, 0],
|
|
251
251
|
t: [-50, 0],
|
|
252
252
|
tr: [-100, 0],
|
|
@@ -256,8 +256,8 @@ const ke = {
|
|
|
256
256
|
bl: [0, -100],
|
|
257
257
|
b: [-50, -100],
|
|
258
258
|
br: [-100, -100]
|
|
259
|
-
},
|
|
260
|
-
function
|
|
259
|
+
}, Ye = ["fade", "rise", "slide-start", "slide-end", "zoom"], Qe = ["spin", "float"], Jt = ["title", "text"];
|
|
260
|
+
function re(t = {}) {
|
|
261
261
|
return {
|
|
262
262
|
x: 5,
|
|
263
263
|
y: 5,
|
|
@@ -273,7 +273,7 @@ function ie(t = {}) {
|
|
|
273
273
|
...t
|
|
274
274
|
};
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function _e(t = {}) {
|
|
277
277
|
return {
|
|
278
278
|
font: null,
|
|
279
279
|
weight: 400,
|
|
@@ -288,13 +288,13 @@ function Ce(t = {}) {
|
|
|
288
288
|
...t
|
|
289
289
|
};
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function Oe(t = {}) {
|
|
292
292
|
return { in: null, loop: null, delay: 0, duration: 600, ...t };
|
|
293
293
|
}
|
|
294
|
-
function
|
|
294
|
+
function Ae(t) {
|
|
295
295
|
return JSON.parse(JSON.stringify(t));
|
|
296
296
|
}
|
|
297
|
-
function
|
|
297
|
+
function mt(t = []) {
|
|
298
298
|
const c = new Set(t);
|
|
299
299
|
let r = "";
|
|
300
300
|
do
|
|
@@ -302,21 +302,21 @@ function dt(t = []) {
|
|
|
302
302
|
while (c.has(r) || !/^[a-z0-9]{4,12}$/.test(r));
|
|
303
303
|
return r;
|
|
304
304
|
}
|
|
305
|
-
function
|
|
306
|
-
const y = { id:
|
|
305
|
+
function et(t, c, r) {
|
|
306
|
+
const y = { id: mt(c), type: t, style: _e(), motion: Oe() };
|
|
307
307
|
switch (t) {
|
|
308
308
|
case "text":
|
|
309
309
|
return {
|
|
310
310
|
...y,
|
|
311
311
|
text: { [r]: "Text" },
|
|
312
312
|
tag: "p",
|
|
313
|
-
frames: { desktop:
|
|
313
|
+
frames: { desktop: re({ x: 10, y: 10, size: 2.4 }), mobile: null }
|
|
314
314
|
};
|
|
315
315
|
case "image":
|
|
316
316
|
return {
|
|
317
317
|
...y,
|
|
318
318
|
image: null,
|
|
319
|
-
frames: { desktop:
|
|
319
|
+
frames: { desktop: re({ x: 60, y: 10, w: 20 }), mobile: null }
|
|
320
320
|
};
|
|
321
321
|
case "button":
|
|
322
322
|
return {
|
|
@@ -324,18 +324,18 @@ function Qe(t, c, r) {
|
|
|
324
324
|
text: { [r]: "Button" },
|
|
325
325
|
link: null,
|
|
326
326
|
variant: null,
|
|
327
|
-
frames: { desktop:
|
|
327
|
+
frames: { desktop: re({ x: 10, y: 25, w: 30, size: 1.2 }), mobile: null }
|
|
328
328
|
};
|
|
329
329
|
case "buttons":
|
|
330
330
|
return {
|
|
331
331
|
...y,
|
|
332
|
-
frames: { desktop:
|
|
332
|
+
frames: { desktop: re({ x: 6, y: 27, w: 50, size: 1.2 }), mobile: null }
|
|
333
333
|
};
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function Fa(t) {
|
|
337
337
|
const c = [], r = (y) => {
|
|
338
|
-
const s = { ...y, id:
|
|
338
|
+
const s = { ...y, id: mt(c) };
|
|
339
339
|
return c.push(s.id), s;
|
|
340
340
|
};
|
|
341
341
|
return [
|
|
@@ -343,67 +343,67 @@ function Dl(t) {
|
|
|
343
343
|
type: "text",
|
|
344
344
|
text: { [t]: "{title}" },
|
|
345
345
|
tag: "h2",
|
|
346
|
-
style:
|
|
347
|
-
frames: { desktop:
|
|
348
|
-
motion:
|
|
346
|
+
style: _e({ weight: 700, line_height: 1.05, color: "#ffffff", shadow: !0 }),
|
|
347
|
+
frames: { desktop: re({ x: 6, y: 6, w: 45, size: 4.2 }), mobile: null },
|
|
348
|
+
motion: Oe({ in: "rise" })
|
|
349
349
|
}),
|
|
350
350
|
r({
|
|
351
351
|
type: "text",
|
|
352
352
|
text: { [t]: "{text}" },
|
|
353
353
|
tag: "p",
|
|
354
|
-
style:
|
|
355
|
-
frames: { desktop:
|
|
356
|
-
motion:
|
|
354
|
+
style: _e({ line_height: 1.4, color: "#ffffff", shadow: !0 }),
|
|
355
|
+
frames: { desktop: re({ x: 6, y: 18, w: 40, size: 1.4 }), mobile: null },
|
|
356
|
+
motion: Oe({ in: "rise", delay: 150 })
|
|
357
357
|
}),
|
|
358
358
|
r({
|
|
359
359
|
type: "buttons",
|
|
360
|
-
style:
|
|
361
|
-
frames: { desktop:
|
|
362
|
-
motion:
|
|
360
|
+
style: _e(),
|
|
361
|
+
frames: { desktop: re({ x: 6, y: 28, w: 50, size: 1.2 }), mobile: null },
|
|
362
|
+
motion: Oe({ in: "rise", delay: 300 })
|
|
363
363
|
})
|
|
364
364
|
];
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function Ht(t, c, r, y) {
|
|
367
367
|
const s = t ?? {};
|
|
368
|
-
return ([.../* @__PURE__ */ new Set([c, ...r, ...Object.keys(s)])].map((
|
|
368
|
+
return ([.../* @__PURE__ */ new Set([c, ...r, ...Object.keys(s)])].map((L) => s[L]).find((L) => (L ?? "").trim() !== "") ?? "").replaceAll("{title}", y.title ?? "").replaceAll("{text}", y.text ?? "").trim();
|
|
369
369
|
}
|
|
370
|
-
function
|
|
371
|
-
return [...t.matchAll(/\{([a-z_.]+)\}/g)].map((c) => c[1] ?? "").filter((c) => !
|
|
370
|
+
function Zt(t) {
|
|
371
|
+
return [...t.matchAll(/\{([a-z_.]+)\}/g)].map((c) => c[1] ?? "").filter((c) => !Jt.includes(c));
|
|
372
372
|
}
|
|
373
|
-
function
|
|
373
|
+
function tt(t) {
|
|
374
374
|
if (typeof t != "string") return null;
|
|
375
375
|
if (/^#[0-9a-f]{6}([0-9a-f]{2})?$/.test(t)) return t;
|
|
376
376
|
const c = /^token:([a-z][a-z0-9-]{0,40})$/.exec(t);
|
|
377
377
|
return c ? `var(--site-color-${c[1]})` : null;
|
|
378
378
|
}
|
|
379
|
-
const
|
|
380
|
-
function
|
|
379
|
+
const bt = (t) => Math.round(t * 100) / 100;
|
|
380
|
+
function qt(t, c) {
|
|
381
381
|
const r = {}, y = t.frames.desktop, s = t.frames.mobile ?? y;
|
|
382
|
-
for (const [
|
|
382
|
+
for (const [L, Q] of [
|
|
383
383
|
["", y],
|
|
384
384
|
["m-", s]
|
|
385
385
|
]) {
|
|
386
|
-
for (const
|
|
387
|
-
r[`--${
|
|
388
|
-
const [p,
|
|
389
|
-
r[`--${
|
|
386
|
+
for (const k of Object.keys($e))
|
|
387
|
+
r[`--${L}${k}`] = String(bt(Q[k]));
|
|
388
|
+
const [p, B] = jt[Q.origin] ?? [0, 0];
|
|
389
|
+
r[`--${L}ox`] = `${p}%`, r[`--${L}oy`] = `${B}%`, r[`--${L}display`] = Q.hidden ? "none" : "block";
|
|
390
390
|
}
|
|
391
391
|
r["--weight"] = String(t.style.weight), r["--leading"] = String(t.style.line_height), r["--opacity"] = String(t.style.opacity), r["--align"] = t.style.align;
|
|
392
|
-
const
|
|
393
|
-
return
|
|
392
|
+
const g = tt(t.style.color), O = tt(t.style.background);
|
|
393
|
+
return g && (r["--color"] = g), O && (r["--background"] = O), t.style.font && (r["--font"] = `var(--site-font-${t.style.font})`), r["z-index"] = String(c), r;
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function Gt(t) {
|
|
396
396
|
const c = ["webx-banner__layer", `webx-banner__layer--${t.type}`];
|
|
397
397
|
return t.style.italic && c.push("is-italic"), t.style.uppercase && c.push("is-uppercase"), t.style.shadow && c.push("is-shadow"), t.style.background && c.push("has-background"), c;
|
|
398
398
|
}
|
|
399
|
-
function
|
|
399
|
+
function at(t, c) {
|
|
400
400
|
if (typeof t == "number") return t > 0 ? t : c;
|
|
401
401
|
const r = /^\s*(\d+(?:\.\d+)?)\s*(?:\/\s*(\d+(?:\.\d+)?))?\s*$/.exec(t ?? "");
|
|
402
402
|
if (!r) return c;
|
|
403
403
|
const y = Number(r[1]) / Number(r[2] ?? 1);
|
|
404
404
|
return Number.isFinite(y) && y > 0 ? y : c;
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function Xt(t, c) {
|
|
407
407
|
if (t > c) {
|
|
408
408
|
const y = c / t * 100;
|
|
409
409
|
return { left: (100 - y) / 2, top: 0, width: y, height: 100 };
|
|
@@ -411,18 +411,18 @@ function Zt(t, c) {
|
|
|
411
411
|
const r = t / c * 100;
|
|
412
412
|
return { left: 0, top: (100 - r) / 2, width: 100, height: r };
|
|
413
413
|
}
|
|
414
|
-
function
|
|
414
|
+
function Yt(t) {
|
|
415
415
|
const c = { ...t };
|
|
416
|
-
for (const r of Object.keys(
|
|
417
|
-
const [y, s] =
|
|
418
|
-
c[r] =
|
|
416
|
+
for (const r of Object.keys($e)) {
|
|
417
|
+
const [y, s] = $e[r];
|
|
418
|
+
c[r] = bt(Math.min(s, Math.max(y, Number(c[r]) || 0)));
|
|
419
419
|
}
|
|
420
420
|
return c;
|
|
421
421
|
}
|
|
422
|
-
const
|
|
422
|
+
const Qt = { class: "wx-banner-layer-inspector" }, ea = { class: "wx-banner-layer-inspector__head" }, ta = { class: "wx-banner-layer-inspector__fields" }, aa = { class: "wx-banner-layer-inspector__group" }, la = { class: "wx-banner-layer-inspector__title" }, na = { class: "wx-banner-layer-inspector__grid" }, sa = ["aria-label"], oa = ["aria-checked", "aria-label", "disabled", "onClick"], ia = {
|
|
423
423
|
key: 5,
|
|
424
424
|
class: "wx-banner-layer-inspector__group"
|
|
425
|
-
},
|
|
425
|
+
}, ra = { class: "wx-banner-layer-inspector__grid" }, da = { class: "wx-banner-layer-inspector__switches" }, ua = { class: "wx-banner-layer-inspector__color" }, ca = ["title", "aria-label", "disabled", "onClick"], ma = { class: "wx-banner-layer-inspector__group" }, ba = { class: "wx-banner-layer-inspector__grid" }, ya = /* @__PURE__ */ lt({
|
|
426
426
|
name: "WxBannerLayerInspector",
|
|
427
427
|
__name: "LayerInspector",
|
|
428
428
|
props: {
|
|
@@ -435,81 +435,81 @@ const Gt = { class: "wx-banner-layer-inspector" }, Xt = { class: "wx-banner-laye
|
|
|
435
435
|
},
|
|
436
436
|
emits: ["update", "frame", "same-as-desktop", "delete"],
|
|
437
437
|
setup(t, { emit: c }) {
|
|
438
|
-
const r = t, y = c, s =
|
|
438
|
+
const r = t, y = c, s = dt("webx-banners"), g = ut(), O = st(), L = v(
|
|
439
439
|
() => r.view === "mobile" ? r.layer.frames.mobile ?? r.layer.frames.desktop : r.layer.frames.desktop
|
|
440
|
-
),
|
|
441
|
-
function
|
|
442
|
-
const
|
|
443
|
-
u(
|
|
440
|
+
), Q = v(() => r.view === "mobile" && r.layer.frames.mobile !== null);
|
|
441
|
+
function p(u) {
|
|
442
|
+
const l = Ae(r.layer);
|
|
443
|
+
u(l), y("update", l);
|
|
444
444
|
}
|
|
445
|
-
function
|
|
446
|
-
|
|
447
|
-
o.style[u] =
|
|
445
|
+
function B(u, l) {
|
|
446
|
+
p((o) => {
|
|
447
|
+
o.style[u] = l;
|
|
448
448
|
});
|
|
449
449
|
}
|
|
450
|
-
const k = v(() => r.layer.type === "text" || r.layer.type === "button"),
|
|
450
|
+
const k = v(() => r.layer.type === "text" || r.layer.type === "button"), C = v({
|
|
451
451
|
get: () => r.layer.text ?? {},
|
|
452
|
-
set: (u) =>
|
|
453
|
-
|
|
452
|
+
set: (u) => p((l) => {
|
|
453
|
+
l.text = u;
|
|
454
454
|
})
|
|
455
455
|
}), D = v({
|
|
456
456
|
get: () => r.layer.name ?? "",
|
|
457
|
-
set: (u) =>
|
|
458
|
-
|
|
457
|
+
set: (u) => p((l) => {
|
|
458
|
+
l.name = u;
|
|
459
459
|
})
|
|
460
|
-
}),
|
|
461
|
-
const u =
|
|
462
|
-
return (u[
|
|
460
|
+
}), P = v(() => Zt(C.value[O.active.value] ?? "")), ee = v(() => P.value.map((u) => `{${u}}`).join(", ")), Z = v(() => {
|
|
461
|
+
const u = C.value, l = O.active.value;
|
|
462
|
+
return (u[l] ?? "").trim() !== "" ? null : [...O.list.value.map((o) => o.code), ...Object.keys(u)].find(
|
|
463
463
|
(o) => (u[o] ?? "").trim() !== ""
|
|
464
464
|
) ?? null;
|
|
465
465
|
});
|
|
466
|
-
function
|
|
467
|
-
const
|
|
468
|
-
|
|
466
|
+
function Ve(u) {
|
|
467
|
+
const l = O.active.value, o = C.value[l] ?? "";
|
|
468
|
+
C.value = { ...C.value, [l]: `${o}${o === "" ? "" : " "}{${u}}` };
|
|
469
469
|
}
|
|
470
470
|
const A = v({
|
|
471
471
|
get: () => r.layer.image ?? null,
|
|
472
|
-
set: (u) =>
|
|
473
|
-
|
|
472
|
+
set: (u) => p((l) => {
|
|
473
|
+
l.image = u;
|
|
474
474
|
})
|
|
475
475
|
}), R = v({
|
|
476
476
|
get: () => r.layer.link ?? null,
|
|
477
|
-
set: (u) =>
|
|
478
|
-
|
|
477
|
+
set: (u) => p((l) => {
|
|
478
|
+
l.link = u;
|
|
479
479
|
})
|
|
480
|
-
}), q = (u,
|
|
480
|
+
}), q = (u, l) => v({
|
|
481
481
|
get: () => u(),
|
|
482
|
-
set: (o) =>
|
|
482
|
+
set: (o) => l(o)
|
|
483
483
|
}), G = q(
|
|
484
484
|
() => r.layer.tag ?? "p",
|
|
485
|
-
(u) =>
|
|
486
|
-
|
|
485
|
+
(u) => p((l) => {
|
|
486
|
+
l.tag = u;
|
|
487
487
|
})
|
|
488
|
-
),
|
|
488
|
+
), de = q(
|
|
489
489
|
() => r.layer.variant ?? r.variants[0]?.value ?? null,
|
|
490
|
-
(u) =>
|
|
491
|
-
|
|
490
|
+
(u) => p((l) => {
|
|
491
|
+
l.variant = u;
|
|
492
492
|
})
|
|
493
493
|
), le = q(
|
|
494
494
|
() => r.layer.style.font ?? "site",
|
|
495
|
-
(u) =>
|
|
496
|
-
),
|
|
495
|
+
(u) => B("font", u === "heading" || u === "body" ? u : null)
|
|
496
|
+
), ne = q(
|
|
497
497
|
() => r.layer.style.weight,
|
|
498
|
-
(u) =>
|
|
498
|
+
(u) => B("weight", Number(u))
|
|
499
499
|
), M = v({
|
|
500
500
|
get: () => r.layer.style.align,
|
|
501
|
-
set: (u) =>
|
|
501
|
+
set: (u) => B("align", u)
|
|
502
502
|
}), K = q(
|
|
503
503
|
() => r.layer.motion.in ?? "none",
|
|
504
|
-
(u) =>
|
|
505
|
-
|
|
504
|
+
(u) => p((l) => {
|
|
505
|
+
l.motion.in = Ye.includes(u) ? u : null;
|
|
506
506
|
})
|
|
507
507
|
), j = q(
|
|
508
508
|
() => r.layer.motion.loop ?? "none",
|
|
509
|
-
(u) =>
|
|
510
|
-
|
|
509
|
+
(u) => p((l) => {
|
|
510
|
+
l.motion.loop = Qe.includes(u) ? u : null;
|
|
511
511
|
})
|
|
512
|
-
),
|
|
512
|
+
), Be = v(() => {
|
|
513
513
|
switch (r.layer.type) {
|
|
514
514
|
case "image":
|
|
515
515
|
return ["x", "y", "w", "radius", "rotate"];
|
|
@@ -518,7 +518,7 @@ const Gt = { class: "wx-banner-layer-inspector" }, Xt = { class: "wx-banner-laye
|
|
|
518
518
|
default:
|
|
519
519
|
return ["x", "y", "w", "size", "pad", "radius", "tracking", "rotate"];
|
|
520
520
|
}
|
|
521
|
-
}),
|
|
521
|
+
}), ue = {
|
|
522
522
|
x: 0.05,
|
|
523
523
|
y: 0.05,
|
|
524
524
|
w: 0.5,
|
|
@@ -529,63 +529,76 @@ const Gt = { class: "wx-banner-layer-inspector" }, Xt = { class: "wx-banner-laye
|
|
|
529
529
|
rotate: 1,
|
|
530
530
|
gap: 0.1
|
|
531
531
|
};
|
|
532
|
-
function
|
|
533
|
-
|
|
532
|
+
function fe(u, l) {
|
|
533
|
+
l === null || Number.isNaN(l) || y("frame", { [u]: l });
|
|
534
534
|
}
|
|
535
|
-
function
|
|
535
|
+
function Le(u) {
|
|
536
536
|
y("frame", { origin: u });
|
|
537
537
|
}
|
|
538
|
-
const
|
|
538
|
+
const Ne = v(() => [
|
|
539
539
|
{ value: "site", label: s("layers.font-site") },
|
|
540
540
|
{ value: "heading", label: s("layers.font-heading") },
|
|
541
541
|
{ value: "body", label: s("layers.font-body") }
|
|
542
|
-
]),
|
|
542
|
+
]), Pe = [100, 200, 300, 400, 500, 600, 700, 800, 900].map((u) => ({
|
|
543
543
|
value: u,
|
|
544
544
|
label: String(u)
|
|
545
|
-
})),
|
|
545
|
+
})), ze = v(() => [
|
|
546
546
|
{ value: "start", label: s("layers.align-start") },
|
|
547
547
|
{ value: "center", label: s("layers.align-center") },
|
|
548
548
|
{ value: "end", label: s("layers.align-end") }
|
|
549
549
|
]), X = v(() => [
|
|
550
550
|
{ value: "none", label: s("layers.motion-none") },
|
|
551
|
-
...
|
|
552
|
-
]),
|
|
551
|
+
...Ye.map((u) => ({ value: u, label: s(`layers.in-${u}`) }))
|
|
552
|
+
]), ce = v(() => [
|
|
553
553
|
{ value: "none", label: s("layers.motion-none") },
|
|
554
|
-
...
|
|
554
|
+
...Qe.map((u) => ({ value: u, label: s(`layers.loop-${u}`) }))
|
|
555
555
|
]);
|
|
556
|
-
function
|
|
557
|
-
const
|
|
558
|
-
return
|
|
556
|
+
function Te(u) {
|
|
557
|
+
const l = r.layer.style[u];
|
|
558
|
+
return l === null ? null : l.startsWith("token:") ? r.palette.find((o) => `token:${o.key}` === l)?.value ?? null : l;
|
|
559
559
|
}
|
|
560
|
-
function
|
|
561
|
-
const o = typeof
|
|
562
|
-
|
|
560
|
+
function ve(u, l) {
|
|
561
|
+
const o = typeof l == "string" && /^#[0-9a-f]{6}([0-9a-f]{2})?$/i.test(l) ? l.toLowerCase() : null;
|
|
562
|
+
B(u, o);
|
|
563
563
|
}
|
|
564
|
-
return (u,
|
|
565
|
-
|
|
566
|
-
d(e(
|
|
564
|
+
return (u, l) => (f(), x("div", Qt, [
|
|
565
|
+
w("div", ea, [
|
|
566
|
+
d(e(qe), {
|
|
567
567
|
modelValue: D.value,
|
|
568
|
-
"onUpdate:modelValue":
|
|
568
|
+
"onUpdate:modelValue": l[0] || (l[0] = (o) => D.value = o),
|
|
569
569
|
size: "sm",
|
|
570
570
|
placeholder: e(s)("layers.name"),
|
|
571
571
|
"aria-label": e(s)("layers.name"),
|
|
572
572
|
disabled: t.disabled
|
|
573
573
|
}, null, 8, ["modelValue", "placeholder", "aria-label", "disabled"]),
|
|
574
|
-
d(e(
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
574
|
+
d(e(ot), {
|
|
575
|
+
title: e(g).confirm,
|
|
576
|
+
"confirm-text": e(g).confirmText,
|
|
577
|
+
"cancel-text": e(g).cancelText,
|
|
578
|
+
"confirm-type": "danger",
|
|
579
|
+
side: "bottom",
|
|
580
|
+
align: "end",
|
|
578
581
|
disabled: t.disabled,
|
|
579
|
-
|
|
582
|
+
onConfirm: l[1] || (l[1] = (o) => y("delete"))
|
|
580
583
|
}, {
|
|
581
|
-
|
|
582
|
-
d(e(
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
584
|
+
trigger: m(() => [
|
|
585
|
+
d(e(E), {
|
|
586
|
+
size: "sm",
|
|
587
|
+
variant: "outline",
|
|
588
|
+
danger: "",
|
|
589
|
+
disabled: t.disabled
|
|
590
|
+
}, {
|
|
591
|
+
icon: m(() => [
|
|
592
|
+
d(e(F), { name: "trash" })
|
|
593
|
+
]),
|
|
594
|
+
default: m(() => [
|
|
595
|
+
_(" " + V(e(s)("layers.delete")), 1)
|
|
596
|
+
]),
|
|
597
|
+
_: 1
|
|
598
|
+
}, 8, ["disabled"])
|
|
586
599
|
]),
|
|
587
600
|
_: 1
|
|
588
|
-
}, 8, ["disabled"])
|
|
601
|
+
}, 8, ["title", "confirm-text", "cancel-text", "disabled"])
|
|
589
602
|
]),
|
|
590
603
|
k.value ? (f(), x(H, { key: 0 }, [
|
|
591
604
|
d(e(S), {
|
|
@@ -593,32 +606,32 @@ const Gt = { class: "wx-banner-layer-inspector" }, Xt = { class: "wx-banner-laye
|
|
|
593
606
|
help: Z.value ? e(s)("layers.falls-back", { code: Z.value.toUpperCase() }) : e(s)("layers.words-help")
|
|
594
607
|
}, {
|
|
595
608
|
default: m(() => [
|
|
596
|
-
t.layer.type === "text" ? (f(), W(e(
|
|
609
|
+
t.layer.type === "text" ? (f(), W(e(Tt), {
|
|
597
610
|
key: 0,
|
|
598
|
-
modelValue:
|
|
599
|
-
"onUpdate:modelValue":
|
|
611
|
+
modelValue: C.value,
|
|
612
|
+
"onUpdate:modelValue": l[2] || (l[2] = (o) => C.value = o),
|
|
600
613
|
localized: "",
|
|
601
614
|
rows: 2,
|
|
602
615
|
disabled: t.disabled
|
|
603
|
-
}, null, 8, ["modelValue", "disabled"])) : (f(), W(e(
|
|
616
|
+
}, null, 8, ["modelValue", "disabled"])) : (f(), W(e(qe), {
|
|
604
617
|
key: 1,
|
|
605
|
-
modelValue:
|
|
606
|
-
"onUpdate:modelValue":
|
|
618
|
+
modelValue: C.value,
|
|
619
|
+
"onUpdate:modelValue": l[3] || (l[3] = (o) => C.value = o),
|
|
607
620
|
localized: "",
|
|
608
621
|
disabled: t.disabled
|
|
609
622
|
}, null, 8, ["modelValue", "disabled"]))
|
|
610
623
|
]),
|
|
611
624
|
_: 1
|
|
612
625
|
}, 8, ["label", "help"]),
|
|
613
|
-
|
|
626
|
+
w("div", ta, [
|
|
614
627
|
d(e(E), {
|
|
615
628
|
size: "sm",
|
|
616
629
|
variant: "text",
|
|
617
630
|
disabled: t.disabled,
|
|
618
|
-
onClick:
|
|
631
|
+
onClick: l[4] || (l[4] = (o) => Ve("title"))
|
|
619
632
|
}, {
|
|
620
|
-
default: m(() => [...
|
|
621
|
-
|
|
633
|
+
default: m(() => [...l[24] || (l[24] = [
|
|
634
|
+
_("+ {title}", -1)
|
|
622
635
|
])]),
|
|
623
636
|
_: 1
|
|
624
637
|
}, 8, ["disabled"]),
|
|
@@ -626,21 +639,21 @@ const Gt = { class: "wx-banner-layer-inspector" }, Xt = { class: "wx-banner-laye
|
|
|
626
639
|
size: "sm",
|
|
627
640
|
variant: "text",
|
|
628
641
|
disabled: t.disabled,
|
|
629
|
-
onClick:
|
|
642
|
+
onClick: l[5] || (l[5] = (o) => Ve("text"))
|
|
630
643
|
}, {
|
|
631
|
-
default: m(() => [...
|
|
632
|
-
|
|
644
|
+
default: m(() => [...l[25] || (l[25] = [
|
|
645
|
+
_("+ {text}", -1)
|
|
633
646
|
])]),
|
|
634
647
|
_: 1
|
|
635
648
|
}, 8, ["disabled"])
|
|
636
649
|
]),
|
|
637
|
-
|
|
650
|
+
P.value.length > 0 ? (f(), W(e(Y), {
|
|
638
651
|
key: 0,
|
|
639
652
|
size: "sm",
|
|
640
653
|
tone: "warning"
|
|
641
654
|
}, {
|
|
642
655
|
default: m(() => [
|
|
643
|
-
|
|
656
|
+
_(V(e(s)("layers.unknown-field", { fields: ee.value })), 1)
|
|
644
657
|
]),
|
|
645
658
|
_: 1
|
|
646
659
|
})) : I("", !0)
|
|
@@ -650,9 +663,9 @@ const Gt = { class: "wx-banner-layer-inspector" }, Xt = { class: "wx-banner-laye
|
|
|
650
663
|
label: e(s)("layers.tag")
|
|
651
664
|
}, {
|
|
652
665
|
default: m(() => [
|
|
653
|
-
d(e(
|
|
666
|
+
d(e(pe), {
|
|
654
667
|
modelValue: e(G),
|
|
655
|
-
"onUpdate:modelValue":
|
|
668
|
+
"onUpdate:modelValue": l[6] || (l[6] = (o) => ye(G) ? G.value = o : null),
|
|
656
669
|
options: t.tags,
|
|
657
670
|
size: "sm",
|
|
658
671
|
disabled: t.disabled
|
|
@@ -665,9 +678,9 @@ const Gt = { class: "wx-banner-layer-inspector" }, Xt = { class: "wx-banner-laye
|
|
|
665
678
|
label: e(s)("layers.image")
|
|
666
679
|
}, {
|
|
667
680
|
default: m(() => [
|
|
668
|
-
d(e(
|
|
681
|
+
d(e(Et), {
|
|
669
682
|
modelValue: A.value,
|
|
670
|
-
"onUpdate:modelValue":
|
|
683
|
+
"onUpdate:modelValue": l[7] || (l[7] = (o) => A.value = o),
|
|
671
684
|
accept: "image",
|
|
672
685
|
aspect: null,
|
|
673
686
|
height: 120,
|
|
@@ -681,9 +694,9 @@ const Gt = { class: "wx-banner-layer-inspector" }, Xt = { class: "wx-banner-laye
|
|
|
681
694
|
label: e(s)("layers.link")
|
|
682
695
|
}, {
|
|
683
696
|
default: m(() => [
|
|
684
|
-
d(e(
|
|
697
|
+
d(e(It), {
|
|
685
698
|
modelValue: R.value,
|
|
686
|
-
"onUpdate:modelValue":
|
|
699
|
+
"onUpdate:modelValue": l[8] || (l[8] = (o) => R.value = o),
|
|
687
700
|
"allow-none": !1,
|
|
688
701
|
disabled: t.disabled
|
|
689
702
|
}, null, 8, ["modelValue", "disabled"])
|
|
@@ -694,9 +707,9 @@ const Gt = { class: "wx-banner-layer-inspector" }, Xt = { class: "wx-banner-laye
|
|
|
694
707
|
label: e(s)("layers.variant")
|
|
695
708
|
}, {
|
|
696
709
|
default: m(() => [
|
|
697
|
-
d(e(
|
|
698
|
-
modelValue: e(
|
|
699
|
-
"onUpdate:modelValue":
|
|
710
|
+
d(e(pe), {
|
|
711
|
+
modelValue: e(de),
|
|
712
|
+
"onUpdate:modelValue": l[9] || (l[9] = (o) => ye(de) ? de.value = o : null),
|
|
700
713
|
options: t.variants,
|
|
701
714
|
size: "sm",
|
|
702
715
|
disabled: t.disabled
|
|
@@ -711,30 +724,30 @@ const Gt = { class: "wx-banner-layer-inspector" }, Xt = { class: "wx-banner-laye
|
|
|
711
724
|
tone: "muted"
|
|
712
725
|
}, {
|
|
713
726
|
default: m(() => [
|
|
714
|
-
|
|
727
|
+
_(V(e(s)("layers.buttons-help")), 1)
|
|
715
728
|
]),
|
|
716
729
|
_: 1
|
|
717
730
|
})) : I("", !0),
|
|
718
|
-
|
|
719
|
-
|
|
731
|
+
w("section", aa, [
|
|
732
|
+
w("div", la, [
|
|
720
733
|
d(e(Y), {
|
|
721
734
|
size: "sm",
|
|
722
735
|
strong: ""
|
|
723
736
|
}, {
|
|
724
737
|
default: m(() => [
|
|
725
|
-
|
|
738
|
+
_(V(t.view === "mobile" ? Q.value ? e(s)("layers.geometry-mobile-own") : e(s)("layers.geometry-mobile-same") : e(s)("layers.geometry-desktop")), 1)
|
|
726
739
|
]),
|
|
727
740
|
_: 1
|
|
728
741
|
}),
|
|
729
|
-
|
|
742
|
+
Q.value ? (f(), W(e(E), {
|
|
730
743
|
key: 0,
|
|
731
744
|
size: "sm",
|
|
732
745
|
variant: "text",
|
|
733
746
|
disabled: t.disabled,
|
|
734
|
-
onClick:
|
|
747
|
+
onClick: l[10] || (l[10] = (o) => y("same-as-desktop"))
|
|
735
748
|
}, {
|
|
736
749
|
default: m(() => [
|
|
737
|
-
|
|
750
|
+
_(V(e(s)("layers.same-as-desktop")), 1)
|
|
738
751
|
]),
|
|
739
752
|
_: 1
|
|
740
753
|
}, 8, ["disabled"])) : I("", !0)
|
|
@@ -744,25 +757,25 @@ const Gt = { class: "wx-banner-layer-inspector" }, Xt = { class: "wx-banner-laye
|
|
|
744
757
|
tone: "muted"
|
|
745
758
|
}, {
|
|
746
759
|
default: m(() => [
|
|
747
|
-
|
|
760
|
+
_(V(e(s)("layers.unit")), 1)
|
|
748
761
|
]),
|
|
749
762
|
_: 1
|
|
750
763
|
}),
|
|
751
|
-
|
|
752
|
-
(f(!0), x(H, null,
|
|
764
|
+
w("div", na, [
|
|
765
|
+
(f(!0), x(H, null, ie(Be.value, (o) => (f(), W(e(S), {
|
|
753
766
|
key: o,
|
|
754
767
|
label: e(s)(`layers.${o}`)
|
|
755
768
|
}, {
|
|
756
769
|
default: m(() => [
|
|
757
|
-
d(e(
|
|
758
|
-
"model-value":
|
|
759
|
-
min: e(
|
|
760
|
-
max: e(
|
|
761
|
-
step:
|
|
770
|
+
d(e(xe), {
|
|
771
|
+
"model-value": L.value[o],
|
|
772
|
+
min: e($e)[o][0],
|
|
773
|
+
max: e($e)[o][1],
|
|
774
|
+
step: ue[o],
|
|
762
775
|
precision: 2,
|
|
763
776
|
size: "sm",
|
|
764
777
|
disabled: t.disabled,
|
|
765
|
-
"onUpdate:modelValue": (
|
|
778
|
+
"onUpdate:modelValue": (z) => fe(o, z ?? null)
|
|
766
779
|
}, null, 8, ["model-value", "min", "max", "step", "disabled", "onUpdate:modelValue"])
|
|
767
780
|
]),
|
|
768
781
|
_: 2
|
|
@@ -773,54 +786,54 @@ const Gt = { class: "wx-banner-layer-inspector" }, Xt = { class: "wx-banner-laye
|
|
|
773
786
|
help: e(s)("layers.origin-help")
|
|
774
787
|
}, {
|
|
775
788
|
default: m(() => [
|
|
776
|
-
|
|
789
|
+
w("div", {
|
|
777
790
|
class: "wx-banner-layer-inspector__origins",
|
|
778
791
|
role: "radiogroup",
|
|
779
792
|
"aria-label": e(s)("layers.origin")
|
|
780
793
|
}, [
|
|
781
|
-
(f(!0), x(H, null,
|
|
794
|
+
(f(!0), x(H, null, ie(e(Kt), (o) => (f(), x("button", {
|
|
782
795
|
key: o,
|
|
783
796
|
type: "button",
|
|
784
797
|
role: "radio",
|
|
785
|
-
"aria-checked":
|
|
798
|
+
"aria-checked": L.value.origin === o,
|
|
786
799
|
"aria-label": o,
|
|
787
800
|
disabled: t.disabled,
|
|
788
801
|
class: J([
|
|
789
802
|
"wx-banner-layer-inspector__origin",
|
|
790
|
-
{ "is-active":
|
|
803
|
+
{ "is-active": L.value.origin === o }
|
|
791
804
|
]),
|
|
792
|
-
onClick: (
|
|
793
|
-
}, null, 10,
|
|
794
|
-
], 8,
|
|
805
|
+
onClick: (z) => Le(o)
|
|
806
|
+
}, null, 10, oa))), 128))
|
|
807
|
+
], 8, sa)
|
|
795
808
|
]),
|
|
796
809
|
_: 1
|
|
797
810
|
}, 8, ["label", "help"]),
|
|
798
|
-
d(e(
|
|
799
|
-
"model-value":
|
|
811
|
+
d(e(Se), {
|
|
812
|
+
"model-value": L.value.hidden,
|
|
800
813
|
label: e(s)("layers.hidden-here"),
|
|
801
814
|
disabled: t.disabled,
|
|
802
|
-
"onUpdate:modelValue":
|
|
815
|
+
"onUpdate:modelValue": l[11] || (l[11] = (o) => y("frame", { hidden: o === !0 }))
|
|
803
816
|
}, null, 8, ["model-value", "label", "disabled"])
|
|
804
817
|
]),
|
|
805
|
-
t.layer.type !== "image" ? (f(), x("section",
|
|
818
|
+
t.layer.type !== "image" ? (f(), x("section", ia, [
|
|
806
819
|
d(e(Y), {
|
|
807
820
|
size: "sm",
|
|
808
821
|
strong: ""
|
|
809
822
|
}, {
|
|
810
823
|
default: m(() => [
|
|
811
|
-
|
|
824
|
+
_(V(e(s)("layers.look")), 1)
|
|
812
825
|
]),
|
|
813
826
|
_: 1
|
|
814
827
|
}),
|
|
815
|
-
|
|
828
|
+
w("div", ra, [
|
|
816
829
|
d(e(S), {
|
|
817
830
|
label: e(s)("layers.font")
|
|
818
831
|
}, {
|
|
819
832
|
default: m(() => [
|
|
820
|
-
d(e(
|
|
833
|
+
d(e(pe), {
|
|
821
834
|
modelValue: e(le),
|
|
822
|
-
"onUpdate:modelValue":
|
|
823
|
-
options:
|
|
835
|
+
"onUpdate:modelValue": l[12] || (l[12] = (o) => ye(le) ? le.value = o : null),
|
|
836
|
+
options: Ne.value,
|
|
824
837
|
size: "sm",
|
|
825
838
|
disabled: t.disabled
|
|
826
839
|
}, null, 8, ["modelValue", "options", "disabled"])
|
|
@@ -831,10 +844,10 @@ const Gt = { class: "wx-banner-layer-inspector" }, Xt = { class: "wx-banner-laye
|
|
|
831
844
|
label: e(s)("layers.weight")
|
|
832
845
|
}, {
|
|
833
846
|
default: m(() => [
|
|
834
|
-
d(e(
|
|
835
|
-
modelValue: e(
|
|
836
|
-
"onUpdate:modelValue":
|
|
837
|
-
options: e(
|
|
847
|
+
d(e(pe), {
|
|
848
|
+
modelValue: e(ne),
|
|
849
|
+
"onUpdate:modelValue": l[13] || (l[13] = (o) => ye(ne) ? ne.value = o : null),
|
|
850
|
+
options: e(Pe),
|
|
838
851
|
size: "sm",
|
|
839
852
|
disabled: t.disabled
|
|
840
853
|
}, null, 8, ["modelValue", "options", "disabled"])
|
|
@@ -845,7 +858,7 @@ const Gt = { class: "wx-banner-layer-inspector" }, Xt = { class: "wx-banner-laye
|
|
|
845
858
|
label: e(s)("layers.line-height")
|
|
846
859
|
}, {
|
|
847
860
|
default: m(() => [
|
|
848
|
-
d(e(
|
|
861
|
+
d(e(xe), {
|
|
849
862
|
"model-value": t.layer.style.line_height,
|
|
850
863
|
min: 0.8,
|
|
851
864
|
max: 3,
|
|
@@ -853,7 +866,7 @@ const Gt = { class: "wx-banner-layer-inspector" }, Xt = { class: "wx-banner-laye
|
|
|
853
866
|
precision: 2,
|
|
854
867
|
size: "sm",
|
|
855
868
|
disabled: t.disabled,
|
|
856
|
-
"onUpdate:modelValue":
|
|
869
|
+
"onUpdate:modelValue": l[14] || (l[14] = (o) => o != null && B("line_height", o))
|
|
857
870
|
}, null, 8, ["model-value", "disabled"])
|
|
858
871
|
]),
|
|
859
872
|
_: 1
|
|
@@ -862,7 +875,7 @@ const Gt = { class: "wx-banner-layer-inspector" }, Xt = { class: "wx-banner-laye
|
|
|
862
875
|
label: e(s)("layers.opacity")
|
|
863
876
|
}, {
|
|
864
877
|
default: m(() => [
|
|
865
|
-
d(e(
|
|
878
|
+
d(e(xe), {
|
|
866
879
|
"model-value": t.layer.style.opacity,
|
|
867
880
|
min: 0,
|
|
868
881
|
max: 1,
|
|
@@ -870,7 +883,7 @@ const Gt = { class: "wx-banner-layer-inspector" }, Xt = { class: "wx-banner-laye
|
|
|
870
883
|
precision: 2,
|
|
871
884
|
size: "sm",
|
|
872
885
|
disabled: t.disabled,
|
|
873
|
-
"onUpdate:modelValue":
|
|
886
|
+
"onUpdate:modelValue": l[15] || (l[15] = (o) => o != null && B("opacity", o))
|
|
874
887
|
}, null, 8, ["model-value", "disabled"])
|
|
875
888
|
]),
|
|
876
889
|
_: 1
|
|
@@ -880,85 +893,85 @@ const Gt = { class: "wx-banner-layer-inspector" }, Xt = { class: "wx-banner-laye
|
|
|
880
893
|
label: e(s)("layers.align")
|
|
881
894
|
}, {
|
|
882
895
|
default: m(() => [
|
|
883
|
-
d(e(
|
|
896
|
+
d(e(it), {
|
|
884
897
|
modelValue: M.value,
|
|
885
|
-
"onUpdate:modelValue":
|
|
886
|
-
options:
|
|
898
|
+
"onUpdate:modelValue": l[16] || (l[16] = (o) => M.value = o),
|
|
899
|
+
options: ze.value,
|
|
887
900
|
size: "sm",
|
|
888
901
|
disabled: t.disabled
|
|
889
902
|
}, null, 8, ["modelValue", "options", "disabled"])
|
|
890
903
|
]),
|
|
891
904
|
_: 1
|
|
892
905
|
}, 8, ["label"]),
|
|
893
|
-
|
|
894
|
-
d(e(
|
|
906
|
+
w("div", da, [
|
|
907
|
+
d(e(Se), {
|
|
895
908
|
"model-value": t.layer.style.italic,
|
|
896
909
|
label: e(s)("layers.italic"),
|
|
897
910
|
disabled: t.disabled,
|
|
898
|
-
"onUpdate:modelValue":
|
|
911
|
+
"onUpdate:modelValue": l[17] || (l[17] = (o) => B("italic", o === !0))
|
|
899
912
|
}, null, 8, ["model-value", "label", "disabled"]),
|
|
900
|
-
d(e(
|
|
913
|
+
d(e(Se), {
|
|
901
914
|
"model-value": t.layer.style.uppercase,
|
|
902
915
|
label: e(s)("layers.uppercase"),
|
|
903
916
|
disabled: t.disabled,
|
|
904
|
-
"onUpdate:modelValue":
|
|
917
|
+
"onUpdate:modelValue": l[18] || (l[18] = (o) => B("uppercase", o === !0))
|
|
905
918
|
}, null, 8, ["model-value", "label", "disabled"]),
|
|
906
|
-
d(e(
|
|
919
|
+
d(e(Se), {
|
|
907
920
|
"model-value": t.layer.style.shadow,
|
|
908
921
|
label: e(s)("layers.shadow"),
|
|
909
922
|
disabled: t.disabled,
|
|
910
|
-
"onUpdate:modelValue":
|
|
923
|
+
"onUpdate:modelValue": l[19] || (l[19] = (o) => B("shadow", o === !0))
|
|
911
924
|
}, null, 8, ["model-value", "label", "disabled"])
|
|
912
925
|
]),
|
|
913
|
-
(f(), x(H, null,
|
|
926
|
+
(f(), x(H, null, ie(["color", "background"], (o) => d(e(S), {
|
|
914
927
|
key: o,
|
|
915
928
|
label: e(s)(`layers.${o}`)
|
|
916
929
|
}, {
|
|
917
930
|
default: m(() => [
|
|
918
|
-
|
|
919
|
-
(f(!0), x(H, null,
|
|
920
|
-
key:
|
|
931
|
+
w("div", ua, [
|
|
932
|
+
(f(!0), x(H, null, ie(t.palette, (z) => (f(), x("button", {
|
|
933
|
+
key: z.key,
|
|
921
934
|
type: "button",
|
|
922
|
-
title:
|
|
923
|
-
"aria-label":
|
|
935
|
+
title: z.key,
|
|
936
|
+
"aria-label": z.key,
|
|
924
937
|
disabled: t.disabled,
|
|
925
938
|
class: J([
|
|
926
939
|
"wx-banner-layer-inspector__swatch",
|
|
927
|
-
{ "is-active": t.layer.style[o] === `token:${
|
|
940
|
+
{ "is-active": t.layer.style[o] === `token:${z.key}` }
|
|
928
941
|
]),
|
|
929
|
-
style:
|
|
930
|
-
onClick: (
|
|
931
|
-
}, null, 14,
|
|
932
|
-
d(e(
|
|
933
|
-
"model-value":
|
|
942
|
+
style: ke({ background: z.value }),
|
|
943
|
+
onClick: (se) => B(o, `token:${z.key}`)
|
|
944
|
+
}, null, 14, ca))), 128)),
|
|
945
|
+
d(e(Ut), {
|
|
946
|
+
"model-value": Te(o),
|
|
934
947
|
clearable: "",
|
|
935
948
|
size: "sm",
|
|
936
949
|
disabled: t.disabled,
|
|
937
|
-
"onUpdate:modelValue": (
|
|
950
|
+
"onUpdate:modelValue": (z) => ve(o, z)
|
|
938
951
|
}, null, 8, ["model-value", "disabled", "onUpdate:modelValue"])
|
|
939
952
|
])
|
|
940
953
|
]),
|
|
941
954
|
_: 2
|
|
942
955
|
}, 1032, ["label"])), 64))
|
|
943
956
|
])) : I("", !0),
|
|
944
|
-
|
|
957
|
+
w("section", ma, [
|
|
945
958
|
d(e(Y), {
|
|
946
959
|
size: "sm",
|
|
947
960
|
strong: ""
|
|
948
961
|
}, {
|
|
949
962
|
default: m(() => [
|
|
950
|
-
|
|
963
|
+
_(V(e(s)("layers.motion")), 1)
|
|
951
964
|
]),
|
|
952
965
|
_: 1
|
|
953
966
|
}),
|
|
954
|
-
|
|
967
|
+
w("div", ba, [
|
|
955
968
|
d(e(S), {
|
|
956
969
|
label: e(s)("layers.entrance")
|
|
957
970
|
}, {
|
|
958
971
|
default: m(() => [
|
|
959
|
-
d(e(
|
|
972
|
+
d(e(pe), {
|
|
960
973
|
modelValue: e(K),
|
|
961
|
-
"onUpdate:modelValue":
|
|
974
|
+
"onUpdate:modelValue": l[20] || (l[20] = (o) => ye(K) ? K.value = o : null),
|
|
962
975
|
options: X.value,
|
|
963
976
|
size: "sm",
|
|
964
977
|
disabled: t.disabled
|
|
@@ -970,10 +983,10 @@ const Gt = { class: "wx-banner-layer-inspector" }, Xt = { class: "wx-banner-laye
|
|
|
970
983
|
label: e(s)("layers.loop")
|
|
971
984
|
}, {
|
|
972
985
|
default: m(() => [
|
|
973
|
-
d(e(
|
|
986
|
+
d(e(pe), {
|
|
974
987
|
modelValue: e(j),
|
|
975
|
-
"onUpdate:modelValue":
|
|
976
|
-
options:
|
|
988
|
+
"onUpdate:modelValue": l[21] || (l[21] = (o) => ye(j) ? j.value = o : null),
|
|
989
|
+
options: ce.value,
|
|
977
990
|
size: "sm",
|
|
978
991
|
disabled: t.disabled
|
|
979
992
|
}, null, 8, ["modelValue", "options", "disabled"])
|
|
@@ -984,14 +997,14 @@ const Gt = { class: "wx-banner-layer-inspector" }, Xt = { class: "wx-banner-laye
|
|
|
984
997
|
label: e(s)("layers.delay")
|
|
985
998
|
}, {
|
|
986
999
|
default: m(() => [
|
|
987
|
-
d(e(
|
|
1000
|
+
d(e(xe), {
|
|
988
1001
|
"model-value": t.layer.motion.delay,
|
|
989
1002
|
min: 0,
|
|
990
1003
|
max: 1e4,
|
|
991
1004
|
step: 50,
|
|
992
1005
|
size: "sm",
|
|
993
1006
|
disabled: t.disabled || t.layer.motion.in === null,
|
|
994
|
-
"onUpdate:modelValue":
|
|
1007
|
+
"onUpdate:modelValue": l[22] || (l[22] = (o) => o != null && p((z) => z.motion.delay = o))
|
|
995
1008
|
}, null, 8, ["model-value", "disabled"])
|
|
996
1009
|
]),
|
|
997
1010
|
_: 1
|
|
@@ -1000,14 +1013,14 @@ const Gt = { class: "wx-banner-layer-inspector" }, Xt = { class: "wx-banner-laye
|
|
|
1000
1013
|
label: e(s)("layers.duration")
|
|
1001
1014
|
}, {
|
|
1002
1015
|
default: m(() => [
|
|
1003
|
-
d(e(
|
|
1016
|
+
d(e(xe), {
|
|
1004
1017
|
"model-value": t.layer.motion.duration,
|
|
1005
1018
|
min: 100,
|
|
1006
1019
|
max: 5e3,
|
|
1007
1020
|
step: 50,
|
|
1008
1021
|
size: "sm",
|
|
1009
1022
|
disabled: t.disabled || t.layer.motion.in === null,
|
|
1010
|
-
"onUpdate:modelValue":
|
|
1023
|
+
"onUpdate:modelValue": l[23] || (l[23] = (o) => o != null && p((z) => z.motion.duration = o))
|
|
1011
1024
|
}, null, 8, ["model-value", "disabled"])
|
|
1012
1025
|
]),
|
|
1013
1026
|
_: 1
|
|
@@ -1016,27 +1029,27 @@ const Gt = { class: "wx-banner-layer-inspector" }, Xt = { class: "wx-banner-laye
|
|
|
1016
1029
|
])
|
|
1017
1030
|
]));
|
|
1018
1031
|
}
|
|
1019
|
-
}),
|
|
1032
|
+
}), yt = (t, c) => {
|
|
1020
1033
|
const r = t.__vccOpts || t;
|
|
1021
1034
|
for (const [y, s] of c)
|
|
1022
1035
|
r[y] = s;
|
|
1023
1036
|
return r;
|
|
1024
|
-
},
|
|
1037
|
+
}, pa = /* @__PURE__ */ yt(ya, [["__scopeId", "data-v-c9a97c91"]]), fa = { class: "wx-banner-layers__bar" }, va = { class: "wx-banner-layers__tools" }, ha = { class: "wx-banner-layers__body" }, wa = { class: "wx-banner-layers__main" }, ga = ["aria-label"], xa = { class: "webx-banner__picture" }, ka = ["src"], $a = {
|
|
1025
1038
|
key: 1,
|
|
1026
1039
|
class: "wx-banner-layers__empty"
|
|
1027
|
-
},
|
|
1040
|
+
}, Va = {
|
|
1028
1041
|
key: 0,
|
|
1029
1042
|
class: "webx-banner__inner wx-banner-layers__words"
|
|
1030
|
-
},
|
|
1043
|
+
}, za = ["src"], Ca = {
|
|
1031
1044
|
key: 2,
|
|
1032
1045
|
class: "webx-banner__inner webx-banner__buttons"
|
|
1033
|
-
},
|
|
1046
|
+
}, Sa = {
|
|
1034
1047
|
key: 3,
|
|
1035
1048
|
class: "webx-banner__inner webx-banner__buttons"
|
|
1036
|
-
},
|
|
1049
|
+
}, _a = {
|
|
1037
1050
|
key: 0,
|
|
1038
1051
|
class: "webx-banner__button"
|
|
1039
|
-
},
|
|
1052
|
+
}, Oa = ["onPointerdown"], Ba = ["onPointerdown"], La = ["onClick"], Na = { class: "wx-banner-layers__name" }, Pa = 3, Ta = 6, Ua = /* @__PURE__ */ lt({
|
|
1040
1053
|
name: "WxBannerLayers",
|
|
1041
1054
|
__name: "LayersField",
|
|
1042
1055
|
props: {
|
|
@@ -1045,68 +1058,68 @@ const Gt = { class: "wx-banner-layer-inspector" }, Xt = { class: "wx-banner-laye
|
|
|
1045
1058
|
},
|
|
1046
1059
|
emits: ["update:modelValue"],
|
|
1047
1060
|
setup(t, { emit: c }) {
|
|
1048
|
-
const r = t, y = c, s =
|
|
1049
|
-
|
|
1050
|
-
const p =
|
|
1051
|
-
const
|
|
1052
|
-
return
|
|
1053
|
-
}),
|
|
1061
|
+
const r = t, y = c, s = rt(), g = Mt(), O = st(), L = Dt(s), Q = At(s);
|
|
1062
|
+
Rt();
|
|
1063
|
+
const p = dt("webx-banners"), B = ut(), k = v(() => r.modelValue ?? []), C = v(() => g?.place.value?.layers ?? null), D = ae("desktop"), P = ae(null), ee = v(() => k.value.find((a) => a.id === P.value) ?? null), Z = v(() => {
|
|
1064
|
+
const a = O.active.value;
|
|
1065
|
+
return O.list.value.some((n) => n.code === a) ? a : O.list.value[0]?.code ?? "en";
|
|
1066
|
+
}), Ve = v(() => O.list.value.map((a) => a.code)), A = ae([]), R = ae([]);
|
|
1054
1067
|
function q() {
|
|
1055
1068
|
A.value = [...A.value.slice(-99), JSON.stringify(k.value)], R.value = [];
|
|
1056
1069
|
}
|
|
1057
|
-
function G(
|
|
1058
|
-
n && q(), y("update:modelValue",
|
|
1070
|
+
function G(a, n = !0) {
|
|
1071
|
+
n && q(), y("update:modelValue", a);
|
|
1059
1072
|
}
|
|
1060
|
-
function
|
|
1061
|
-
const
|
|
1062
|
-
|
|
1073
|
+
function de() {
|
|
1074
|
+
const a = A.value.at(-1);
|
|
1075
|
+
a !== void 0 && (R.value = [...R.value, JSON.stringify(k.value)], A.value = A.value.slice(0, -1), y("update:modelValue", JSON.parse(a)));
|
|
1063
1076
|
}
|
|
1064
1077
|
function le() {
|
|
1065
|
-
const
|
|
1066
|
-
|
|
1078
|
+
const a = R.value.at(-1);
|
|
1079
|
+
a !== void 0 && (A.value = [...A.value, JSON.stringify(k.value)], R.value = R.value.slice(0, -1), y("update:modelValue", JSON.parse(a)));
|
|
1067
1080
|
}
|
|
1068
|
-
function
|
|
1081
|
+
function ne(a, n, i = !0) {
|
|
1069
1082
|
G(
|
|
1070
|
-
k.value.map((b) => b.id ===
|
|
1083
|
+
k.value.map((b) => b.id === a ? n(Ae(b)) : b),
|
|
1071
1084
|
i
|
|
1072
1085
|
);
|
|
1073
1086
|
}
|
|
1074
|
-
function M(
|
|
1075
|
-
return n === "mobile" ?
|
|
1087
|
+
function M(a, n = D.value) {
|
|
1088
|
+
return n === "mobile" ? a.frames.mobile ?? a.frames.desktop : a.frames.desktop;
|
|
1076
1089
|
}
|
|
1077
|
-
function K(
|
|
1078
|
-
|
|
1079
|
-
|
|
1090
|
+
function K(a, n, i = !0) {
|
|
1091
|
+
ne(
|
|
1092
|
+
a,
|
|
1080
1093
|
(b) => {
|
|
1081
|
-
const h =
|
|
1094
|
+
const h = Yt({ ...M(b), ...n });
|
|
1082
1095
|
return D.value === "mobile" ? b.frames.mobile = h : b.frames.desktop = h, b;
|
|
1083
1096
|
},
|
|
1084
1097
|
i
|
|
1085
1098
|
);
|
|
1086
1099
|
}
|
|
1087
1100
|
let j = { id: "", at: 0 };
|
|
1088
|
-
function
|
|
1089
|
-
const n = Date.now(), i = j.id ===
|
|
1090
|
-
j = { id:
|
|
1101
|
+
function Be(a) {
|
|
1102
|
+
const n = Date.now(), i = j.id === a.id && n - j.at < 800;
|
|
1103
|
+
j = { id: a.id, at: n }, ne(a.id, () => a, !i);
|
|
1091
1104
|
}
|
|
1092
|
-
function
|
|
1093
|
-
const n =
|
|
1094
|
-
|
|
1105
|
+
function ue(a) {
|
|
1106
|
+
const n = et(
|
|
1107
|
+
a,
|
|
1095
1108
|
k.value.map((i) => i.id),
|
|
1096
1109
|
Z.value
|
|
1097
1110
|
);
|
|
1098
|
-
G([n, ...k.value]),
|
|
1111
|
+
G([n, ...k.value]), P.value = n.id;
|
|
1099
1112
|
}
|
|
1100
|
-
function
|
|
1101
|
-
G(k.value.filter((n) => n.id !==
|
|
1113
|
+
function fe(a) {
|
|
1114
|
+
G(k.value.filter((n) => n.id !== a)), P.value === a && (P.value = null);
|
|
1102
1115
|
}
|
|
1103
|
-
function
|
|
1104
|
-
const n = k.value.findIndex((
|
|
1116
|
+
function Le(a) {
|
|
1117
|
+
const n = k.value.findIndex((T) => T.id === a), i = k.value[n];
|
|
1105
1118
|
if (!i || i.type === "buttons") return;
|
|
1106
|
-
const b =
|
|
1107
|
-
b.id =
|
|
1119
|
+
const b = Ae(i);
|
|
1120
|
+
b.id = et(
|
|
1108
1121
|
"text",
|
|
1109
|
-
k.value.map((
|
|
1122
|
+
k.value.map((T) => T.id),
|
|
1110
1123
|
Z.value
|
|
1111
1124
|
).id, b.frames.desktop = {
|
|
1112
1125
|
...b.frames.desktop,
|
|
@@ -1114,207 +1127,207 @@ const Gt = { class: "wx-banner-layer-inspector" }, Xt = { class: "wx-banner-laye
|
|
|
1114
1127
|
y: b.frames.desktop.y + 2
|
|
1115
1128
|
};
|
|
1116
1129
|
const h = [...k.value];
|
|
1117
|
-
h.splice(n, 0, b), G(h),
|
|
1130
|
+
h.splice(n, 0, b), G(h), P.value = b.id;
|
|
1118
1131
|
}
|
|
1119
|
-
function
|
|
1120
|
-
K(
|
|
1132
|
+
function Ne(a) {
|
|
1133
|
+
K(a.id, { hidden: !M(a).hidden });
|
|
1121
1134
|
}
|
|
1122
|
-
const
|
|
1135
|
+
const Pe = v(() => k.value.some((a) => a.type === "buttons")), ze = v({
|
|
1123
1136
|
get: () => k.value,
|
|
1124
|
-
set: (
|
|
1125
|
-
}), X =
|
|
1126
|
-
function
|
|
1127
|
-
const n =
|
|
1137
|
+
set: (a) => G(a)
|
|
1138
|
+
}), X = Ot({});
|
|
1139
|
+
function ce(a) {
|
|
1140
|
+
const n = a?.path;
|
|
1128
1141
|
return typeof n == "string" && n !== "" ? n : null;
|
|
1129
1142
|
}
|
|
1130
|
-
async function
|
|
1131
|
-
if (!(
|
|
1132
|
-
X[
|
|
1143
|
+
async function Te(a) {
|
|
1144
|
+
if (!(a === null || a in X)) {
|
|
1145
|
+
X[a] = null;
|
|
1133
1146
|
try {
|
|
1134
|
-
const n = await
|
|
1135
|
-
X[
|
|
1147
|
+
const n = await L.fileByPath(a);
|
|
1148
|
+
X[a] = n ? { url: n.url, ratio: n.width && n.height ? n.width / n.height : null } : null;
|
|
1136
1149
|
} catch {
|
|
1137
|
-
X[
|
|
1150
|
+
X[a] = null;
|
|
1138
1151
|
}
|
|
1139
1152
|
}
|
|
1140
1153
|
}
|
|
1141
|
-
const
|
|
1142
|
-
|
|
1143
|
-
() => [
|
|
1144
|
-
(
|
|
1145
|
-
|
|
1154
|
+
const ve = v(() => ce(g?.values.value.image)), u = v(() => ce(g?.values.value.image_mobile));
|
|
1155
|
+
Bt(
|
|
1156
|
+
() => [ve.value, u.value, ...k.value.map((a) => ce(a.image))],
|
|
1157
|
+
(a) => a.forEach((n) => {
|
|
1158
|
+
Te(n);
|
|
1146
1159
|
}),
|
|
1147
1160
|
{ immediate: !0 }
|
|
1148
1161
|
);
|
|
1149
|
-
const
|
|
1150
|
-
() => D.value === "mobile" ?
|
|
1162
|
+
const l = v(
|
|
1163
|
+
() => D.value === "mobile" ? at(C.value?.ratio_mobile, 0.8) : at(C.value?.ratio, 16 / 6)
|
|
1151
1164
|
), o = v(() => {
|
|
1152
|
-
const
|
|
1153
|
-
return D.value === "mobile" ?
|
|
1154
|
-
}),
|
|
1155
|
-
const
|
|
1156
|
-
return { "--ratio":
|
|
1157
|
-
}),
|
|
1158
|
-
const
|
|
1159
|
-
return { title:
|
|
1165
|
+
const a = u.value === null ? null : X[u.value] ?? null, n = ve.value === null ? null : X[ve.value] ?? null;
|
|
1166
|
+
return D.value === "mobile" ? a ?? n : n;
|
|
1167
|
+
}), z = v(() => o.value?.ratio ?? l.value), se = v(() => Xt(z.value, l.value)), pt = v(() => {
|
|
1168
|
+
const a = String(z.value);
|
|
1169
|
+
return { "--ratio": a, "--ratio-mobile": a, "--img": a, "--img-m": a };
|
|
1170
|
+
}), ft = v(() => {
|
|
1171
|
+
const a = (n) => (g?.values.value[n]?.[Z.value] ?? "").trim();
|
|
1172
|
+
return { title: a("title"), text: a("text") };
|
|
1160
1173
|
});
|
|
1161
|
-
function
|
|
1162
|
-
return
|
|
1174
|
+
function Me(a) {
|
|
1175
|
+
return Ht(a.text, Z.value, Ve.value, ft.value);
|
|
1163
1176
|
}
|
|
1164
|
-
const
|
|
1165
|
-
() => (
|
|
1166
|
-
label: (
|
|
1167
|
-
variant:
|
|
1168
|
-
})).filter((
|
|
1177
|
+
const Fe = v(
|
|
1178
|
+
() => (g?.values.value.buttons ?? []).map((a) => ({
|
|
1179
|
+
label: (a.label?.[Z.value] ?? "").trim(),
|
|
1180
|
+
variant: a.variant ?? C.value?.variants[0]?.value ?? "primary"
|
|
1181
|
+
})).filter((a) => a.label !== "")
|
|
1169
1182
|
);
|
|
1170
|
-
function
|
|
1171
|
-
return
|
|
1183
|
+
function vt(a) {
|
|
1184
|
+
return a.type === "text" && /^(p|span|h[1-6])$/.test(a.tag ?? "") ? a.tag : "div";
|
|
1172
1185
|
}
|
|
1173
|
-
function
|
|
1174
|
-
if (
|
|
1175
|
-
const n =
|
|
1176
|
-
return n.trim() === "{title}" ? p("layers.title-layer") : n.trim() === "{text}" ? p("layers.text-layer") :
|
|
1186
|
+
function ht(a) {
|
|
1187
|
+
if (a.name) return a.name;
|
|
1188
|
+
const n = a.text?.[Z.value] ?? Object.values(a.text ?? {})[0] ?? "";
|
|
1189
|
+
return n.trim() === "{title}" ? p("layers.title-layer") : n.trim() === "{text}" ? p("layers.text-layer") : a.type === "buttons" ? p("layers.buttons-layer") : a.type === "image" ? p("layers.image") : n.trim() || p(`layers.${a.type}`);
|
|
1177
1190
|
}
|
|
1178
|
-
const
|
|
1191
|
+
const wt = {
|
|
1179
1192
|
text: "file-text",
|
|
1180
1193
|
image: "image",
|
|
1181
1194
|
button: "link",
|
|
1182
1195
|
buttons: "grid"
|
|
1183
1196
|
};
|
|
1184
|
-
function
|
|
1185
|
-
const n = M(
|
|
1186
|
-
return $ >
|
|
1197
|
+
function Re(a) {
|
|
1198
|
+
const n = M(a), i = 100 / z.value, b = se.value, h = b.left, T = b.left + b.width, N = b.top / 100 * i, U = (b.top + b.height) / 100 * i, $ = n.x + Ie(n.origin)[0] / 100 * n.w;
|
|
1199
|
+
return $ > T || $ + n.w < h || n.y > U || n.y < N - 50;
|
|
1187
1200
|
}
|
|
1188
|
-
const Ue =
|
|
1189
|
-
function
|
|
1190
|
-
const i = 100 /
|
|
1191
|
-
for (const
|
|
1192
|
-
if (
|
|
1193
|
-
const
|
|
1194
|
-
|
|
1201
|
+
const Ue = ae(null), Ke = ae(null), he = ae([]);
|
|
1202
|
+
function gt(a, n) {
|
|
1203
|
+
const i = 100 / z.value, b = se.value, h = a === "x" ? [0, 50, 100, b.left, b.left + b.width] : [0, i / 2, i, b.top / 100 * i, (b.top + b.height) / 100 * i];
|
|
1204
|
+
for (const T of k.value) {
|
|
1205
|
+
if (T.id === n) continue;
|
|
1206
|
+
const N = M(T);
|
|
1207
|
+
a === "x" ? h.push(N.x, N.x + N.w) : h.push(N.y);
|
|
1195
1208
|
}
|
|
1196
1209
|
return h;
|
|
1197
1210
|
}
|
|
1198
|
-
function
|
|
1199
|
-
if (
|
|
1200
|
-
const
|
|
1211
|
+
function je(a, n, i, b, h, T) {
|
|
1212
|
+
if (T) return n;
|
|
1213
|
+
const N = [0, i / 2, i];
|
|
1201
1214
|
let U = null;
|
|
1202
|
-
for (const $ of
|
|
1203
|
-
for (const
|
|
1204
|
-
const
|
|
1205
|
-
Math.abs(
|
|
1215
|
+
for (const $ of gt(a, h))
|
|
1216
|
+
for (const te of N) {
|
|
1217
|
+
const me = $ - (n + te);
|
|
1218
|
+
Math.abs(me) * b <= Ta && (U === null || Math.abs(me) < Math.abs(U.delta)) && (U = { delta: me, at: $ });
|
|
1206
1219
|
}
|
|
1207
|
-
return U === null ? n : (
|
|
1220
|
+
return U === null ? n : (he.value = [...he.value.filter(($) => $.axis !== a), { axis: a, at: U.at }], n + U.delta);
|
|
1208
1221
|
}
|
|
1209
|
-
function
|
|
1210
|
-
|
|
1222
|
+
function Je(a) {
|
|
1223
|
+
P.value = a.id, Ke.value?.focus({ preventScroll: !0 });
|
|
1211
1224
|
}
|
|
1212
|
-
function We(
|
|
1213
|
-
if (
|
|
1214
|
-
|
|
1215
|
-
const h = Ue.value.getBoundingClientRect().width / 100,
|
|
1216
|
-
let
|
|
1217
|
-
const
|
|
1218
|
-
const
|
|
1219
|
-
if (!
|
|
1220
|
-
if (Math.hypot(be.clientX -
|
|
1221
|
-
|
|
1225
|
+
function We(a, n, i) {
|
|
1226
|
+
if (Je(n), r.disabled || a.button !== 0 || !Ue.value) return;
|
|
1227
|
+
a.preventDefault();
|
|
1228
|
+
const h = Ue.value.getBoundingClientRect().width / 100, N = a.target.closest(".webx-banner__layer")?.getBoundingClientRect(), U = N ? N.height / h : 0, $ = { ...M(n) }, te = { x: a.clientX, y: a.clientY };
|
|
1229
|
+
let me = !1;
|
|
1230
|
+
const Ze = (be) => {
|
|
1231
|
+
const Ee = (be.clientX - te.x) / h, Vt = (be.clientY - te.y) / h;
|
|
1232
|
+
if (!me) {
|
|
1233
|
+
if (Math.hypot(be.clientX - te.x, be.clientY - te.y) < Pa) return;
|
|
1234
|
+
me = !0, q();
|
|
1222
1235
|
}
|
|
1223
|
-
if (
|
|
1224
|
-
const
|
|
1225
|
-
x:
|
|
1226
|
-
y:
|
|
1227
|
-
},
|
|
1228
|
-
K(n.id, { x:
|
|
1236
|
+
if (he.value = [], i === "move") {
|
|
1237
|
+
const oe = {
|
|
1238
|
+
x: Ie($.origin)[0] / 100 * $.w,
|
|
1239
|
+
y: Ie($.origin)[1] / 100 * U
|
|
1240
|
+
}, zt = je("x", $.x + Ee + oe.x, $.w, h, n.id, be.altKey), Ct = je("y", $.y + Vt + oe.y, U, h, n.id, be.altKey);
|
|
1241
|
+
K(n.id, { x: zt - oe.x, y: Ct - oe.y }, !1);
|
|
1229
1242
|
} else if (i === "width")
|
|
1230
|
-
K(n.id, { w: Math.max(1, $.w +
|
|
1243
|
+
K(n.id, { w: Math.max(1, $.w + Ee) }, !1);
|
|
1231
1244
|
else {
|
|
1232
|
-
const
|
|
1233
|
-
K(n.id, { w: $.w *
|
|
1245
|
+
const oe = Math.max(0.05, ($.w + Ee) / $.w);
|
|
1246
|
+
K(n.id, { w: $.w * oe, size: $.size * oe }, !1);
|
|
1234
1247
|
}
|
|
1235
|
-
},
|
|
1236
|
-
window.removeEventListener("pointermove",
|
|
1248
|
+
}, Ce = () => {
|
|
1249
|
+
window.removeEventListener("pointermove", Ze), window.removeEventListener("pointerup", Ce), window.removeEventListener("pointercancel", Ce), he.value = [];
|
|
1237
1250
|
};
|
|
1238
|
-
window.addEventListener("pointermove",
|
|
1251
|
+
window.addEventListener("pointermove", Ze), window.addEventListener("pointerup", Ce), window.addEventListener("pointercancel", Ce);
|
|
1239
1252
|
}
|
|
1240
|
-
function
|
|
1241
|
-
const n =
|
|
1253
|
+
function Ie(a) {
|
|
1254
|
+
const n = a.endsWith("r") ? -100 : a === "t" || a === "c" || a === "b" ? -50 : 0, i = a.startsWith("b") ? -100 : a === "l" || a === "c" || a === "r" ? -50 : 0;
|
|
1242
1255
|
return [n, i];
|
|
1243
1256
|
}
|
|
1244
|
-
function
|
|
1245
|
-
|
|
1257
|
+
function xt(a) {
|
|
1258
|
+
a.target.closest(".webx-banner__layer") || (P.value = null);
|
|
1246
1259
|
}
|
|
1247
|
-
function
|
|
1248
|
-
const n =
|
|
1260
|
+
function kt(a) {
|
|
1261
|
+
const n = a.ctrlKey || a.metaKey, i = a.key.toLowerCase();
|
|
1249
1262
|
if (n && i === "z") {
|
|
1250
|
-
|
|
1263
|
+
a.preventDefault(), a.shiftKey ? le() : de();
|
|
1251
1264
|
return;
|
|
1252
1265
|
}
|
|
1253
1266
|
if (n && i === "y") {
|
|
1254
|
-
|
|
1267
|
+
a.preventDefault(), le();
|
|
1255
1268
|
return;
|
|
1256
1269
|
}
|
|
1257
|
-
const b =
|
|
1270
|
+
const b = ee.value;
|
|
1258
1271
|
if (!b || r.disabled) return;
|
|
1259
1272
|
if (n && i === "d") {
|
|
1260
|
-
|
|
1273
|
+
a.preventDefault(), Le(b.id);
|
|
1261
1274
|
return;
|
|
1262
1275
|
}
|
|
1263
1276
|
if (i === "delete" || i === "backspace") {
|
|
1264
|
-
|
|
1277
|
+
a.preventDefault(), fe(b.id);
|
|
1265
1278
|
return;
|
|
1266
1279
|
}
|
|
1267
1280
|
if (i === "escape") {
|
|
1268
|
-
|
|
1281
|
+
P.value = null;
|
|
1269
1282
|
return;
|
|
1270
1283
|
}
|
|
1271
|
-
const h =
|
|
1284
|
+
const h = a.shiftKey ? 0.5 : 0.05, N = {
|
|
1272
1285
|
arrowleft: [-h, 0],
|
|
1273
1286
|
arrowright: [h, 0],
|
|
1274
1287
|
arrowup: [0, -h],
|
|
1275
1288
|
arrowdown: [0, h]
|
|
1276
1289
|
}[i];
|
|
1277
|
-
if (!
|
|
1278
|
-
|
|
1279
|
-
const U = M(b), $ = Date.now(),
|
|
1280
|
-
j = { id: `arrows:${b.id}`, at: $ }, K(b.id, { x: U.x +
|
|
1290
|
+
if (!N) return;
|
|
1291
|
+
a.preventDefault();
|
|
1292
|
+
const U = M(b), $ = Date.now(), te = j.id === `arrows:${b.id}` && $ - j.at < 800;
|
|
1293
|
+
j = { id: `arrows:${b.id}`, at: $ }, K(b.id, { x: U.x + N[0], y: U.y + N[1] }, !te);
|
|
1281
1294
|
}
|
|
1282
|
-
const
|
|
1283
|
-
let
|
|
1284
|
-
|
|
1295
|
+
const we = ae(null);
|
|
1296
|
+
let ge = null;
|
|
1297
|
+
Lt(async () => {
|
|
1285
1298
|
try {
|
|
1286
|
-
|
|
1299
|
+
we.value = await Q.theme();
|
|
1287
1300
|
} catch {
|
|
1288
|
-
|
|
1301
|
+
we.value = null;
|
|
1289
1302
|
}
|
|
1290
|
-
const
|
|
1291
|
-
${
|
|
1292
|
-
|
|
1293
|
-
}),
|
|
1294
|
-
|
|
1303
|
+
const a = `${we.value?.tokens_css ?? ""}
|
|
1304
|
+
${we.value?.fonts_css ?? ""}`.trim();
|
|
1305
|
+
a !== "" && !document.getElementById("wx-banners-theme") && (ge = document.createElement("style"), ge.id = "wx-banners-theme", ge.textContent = a, document.head.append(ge));
|
|
1306
|
+
}), Nt(() => {
|
|
1307
|
+
ge?.remove();
|
|
1295
1308
|
});
|
|
1296
|
-
const
|
|
1309
|
+
const $t = v(() => [
|
|
1297
1310
|
{ value: "desktop", label: p("layers.desktop"), icon: "monitor" },
|
|
1298
1311
|
{ value: "mobile", label: p("layers.mobile"), icon: "smartphone" }
|
|
1299
|
-
]),
|
|
1312
|
+
]), He = v({
|
|
1300
1313
|
get: () => D.value,
|
|
1301
|
-
set: (
|
|
1302
|
-
D.value =
|
|
1314
|
+
set: (a) => {
|
|
1315
|
+
D.value = a === "mobile" ? "mobile" : "desktop";
|
|
1303
1316
|
}
|
|
1304
1317
|
});
|
|
1305
|
-
return (
|
|
1318
|
+
return (a, n) => (f(), x("div", {
|
|
1306
1319
|
class: J(["wx-banner-layers", { "is-disabled": t.disabled }])
|
|
1307
1320
|
}, [
|
|
1308
|
-
|
|
1309
|
-
d(e(
|
|
1310
|
-
modelValue:
|
|
1311
|
-
"onUpdate:modelValue": n[0] || (n[0] = (i) =>
|
|
1312
|
-
options:
|
|
1321
|
+
w("div", fa, [
|
|
1322
|
+
d(e(it), {
|
|
1323
|
+
modelValue: He.value,
|
|
1324
|
+
"onUpdate:modelValue": n[0] || (n[0] = (i) => He.value = i),
|
|
1325
|
+
options: $t.value,
|
|
1313
1326
|
size: "sm",
|
|
1314
1327
|
"aria-label": e(p)("layers.layout")
|
|
1315
1328
|
}, null, 8, ["modelValue", "options", "aria-label"]),
|
|
1316
|
-
|
|
1317
|
-
d(e(
|
|
1329
|
+
w("div", va, [
|
|
1330
|
+
d(e(Ge), {
|
|
1318
1331
|
content: e(p)("layers.undo")
|
|
1319
1332
|
}, {
|
|
1320
1333
|
default: m(() => [
|
|
@@ -1323,7 +1336,7 @@ ${he.value?.fonts_css ?? ""}`.trim();
|
|
|
1323
1336
|
variant: "text",
|
|
1324
1337
|
disabled: t.disabled || A.value.length === 0,
|
|
1325
1338
|
"aria-label": e(p)("layers.undo"),
|
|
1326
|
-
onClick:
|
|
1339
|
+
onClick: de
|
|
1327
1340
|
}, {
|
|
1328
1341
|
icon: m(() => [
|
|
1329
1342
|
d(e(F), { name: "rotate-left" })
|
|
@@ -1333,7 +1346,7 @@ ${he.value?.fonts_css ?? ""}`.trim();
|
|
|
1333
1346
|
]),
|
|
1334
1347
|
_: 1
|
|
1335
1348
|
}, 8, ["content"]),
|
|
1336
|
-
d(e(
|
|
1349
|
+
d(e(Ge), {
|
|
1337
1350
|
content: e(p)("layers.redo")
|
|
1338
1351
|
}, {
|
|
1339
1352
|
default: m(() => [
|
|
@@ -1356,13 +1369,13 @@ ${he.value?.fonts_css ?? ""}`.trim();
|
|
|
1356
1369
|
size: "sm",
|
|
1357
1370
|
variant: "outline",
|
|
1358
1371
|
disabled: t.disabled,
|
|
1359
|
-
onClick: n[1] || (n[1] = (i) =>
|
|
1372
|
+
onClick: n[1] || (n[1] = (i) => ue("text"))
|
|
1360
1373
|
}, {
|
|
1361
1374
|
icon: m(() => [
|
|
1362
1375
|
d(e(F), { name: "plus" })
|
|
1363
1376
|
]),
|
|
1364
1377
|
default: m(() => [
|
|
1365
|
-
|
|
1378
|
+
_(" " + V(e(p)("layers.text")), 1)
|
|
1366
1379
|
]),
|
|
1367
1380
|
_: 1
|
|
1368
1381
|
}, 8, ["disabled"]),
|
|
@@ -1370,13 +1383,13 @@ ${he.value?.fonts_css ?? ""}`.trim();
|
|
|
1370
1383
|
size: "sm",
|
|
1371
1384
|
variant: "outline",
|
|
1372
1385
|
disabled: t.disabled,
|
|
1373
|
-
onClick: n[2] || (n[2] = (i) =>
|
|
1386
|
+
onClick: n[2] || (n[2] = (i) => ue("image"))
|
|
1374
1387
|
}, {
|
|
1375
1388
|
icon: m(() => [
|
|
1376
1389
|
d(e(F), { name: "plus" })
|
|
1377
1390
|
]),
|
|
1378
1391
|
default: m(() => [
|
|
1379
|
-
|
|
1392
|
+
_(" " + V(e(p)("layers.image")), 1)
|
|
1380
1393
|
]),
|
|
1381
1394
|
_: 1
|
|
1382
1395
|
}, 8, ["disabled"]),
|
|
@@ -1384,145 +1397,145 @@ ${he.value?.fonts_css ?? ""}`.trim();
|
|
|
1384
1397
|
size: "sm",
|
|
1385
1398
|
variant: "outline",
|
|
1386
1399
|
disabled: t.disabled,
|
|
1387
|
-
onClick: n[3] || (n[3] = (i) =>
|
|
1400
|
+
onClick: n[3] || (n[3] = (i) => ue("button"))
|
|
1388
1401
|
}, {
|
|
1389
1402
|
icon: m(() => [
|
|
1390
1403
|
d(e(F), { name: "plus" })
|
|
1391
1404
|
]),
|
|
1392
1405
|
default: m(() => [
|
|
1393
|
-
|
|
1406
|
+
_(" " + V(e(p)("layers.button")), 1)
|
|
1394
1407
|
]),
|
|
1395
1408
|
_: 1
|
|
1396
1409
|
}, 8, ["disabled"]),
|
|
1397
|
-
|
|
1410
|
+
Pe.value ? I("", !0) : (f(), W(e(E), {
|
|
1398
1411
|
key: 0,
|
|
1399
1412
|
size: "sm",
|
|
1400
1413
|
variant: "outline",
|
|
1401
1414
|
disabled: t.disabled,
|
|
1402
|
-
onClick: n[4] || (n[4] = (i) =>
|
|
1415
|
+
onClick: n[4] || (n[4] = (i) => ue("buttons"))
|
|
1403
1416
|
}, {
|
|
1404
1417
|
icon: m(() => [
|
|
1405
1418
|
d(e(F), { name: "plus" })
|
|
1406
1419
|
]),
|
|
1407
1420
|
default: m(() => [
|
|
1408
|
-
|
|
1421
|
+
_(" " + V(e(p)("layers.buttons-layer")), 1)
|
|
1409
1422
|
]),
|
|
1410
1423
|
_: 1
|
|
1411
1424
|
}, 8, ["disabled"]))
|
|
1412
1425
|
])
|
|
1413
1426
|
]),
|
|
1414
|
-
|
|
1427
|
+
C.value ? I("", !0) : (f(), W(e(Y), {
|
|
1415
1428
|
key: 0,
|
|
1416
1429
|
size: "sm",
|
|
1417
1430
|
tone: "muted"
|
|
1418
1431
|
}, {
|
|
1419
1432
|
default: m(() => [
|
|
1420
|
-
|
|
1433
|
+
_(V(e(p)("layers.not-here")), 1)
|
|
1421
1434
|
]),
|
|
1422
1435
|
_: 1
|
|
1423
1436
|
})),
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1437
|
+
w("div", ha, [
|
|
1438
|
+
w("div", wa, [
|
|
1439
|
+
w("div", {
|
|
1427
1440
|
ref_key: "canvas",
|
|
1428
|
-
ref:
|
|
1429
|
-
class: J(["wx-banner-layers__canvas", { "is-overflow":
|
|
1441
|
+
ref: Ke,
|
|
1442
|
+
class: J(["wx-banner-layers__canvas", { "is-overflow": C.value?.overflow }]),
|
|
1430
1443
|
tabindex: "0",
|
|
1431
1444
|
"aria-label": e(p)("layers.canvas"),
|
|
1432
|
-
onPointerdown:
|
|
1433
|
-
onKeydown:
|
|
1445
|
+
onPointerdown: xt,
|
|
1446
|
+
onKeydown: kt
|
|
1434
1447
|
}, [
|
|
1435
|
-
|
|
1448
|
+
w("div", {
|
|
1436
1449
|
class: J(["webx-banner wx-banner-layers__frame", { "is-mobile": D.value === "mobile" }]),
|
|
1437
|
-
style:
|
|
1450
|
+
style: ke(pt.value)
|
|
1438
1451
|
}, [
|
|
1439
|
-
|
|
1452
|
+
w("div", xa, [
|
|
1440
1453
|
o.value ? (f(), x("img", {
|
|
1441
1454
|
key: 0,
|
|
1442
1455
|
class: "webx-banner__image",
|
|
1443
1456
|
src: o.value.url,
|
|
1444
1457
|
alt: ""
|
|
1445
|
-
}, null, 8,
|
|
1458
|
+
}, null, 8, ka)) : (f(), x("div", $a, V(e(p)("layers.no-picture")), 1))
|
|
1446
1459
|
]),
|
|
1447
|
-
|
|
1460
|
+
w("div", {
|
|
1448
1461
|
ref_key: "stage",
|
|
1449
1462
|
ref: Ue,
|
|
1450
1463
|
class: "webx-banner__stage"
|
|
1451
1464
|
}, [
|
|
1452
|
-
(f(!0), x(H, null,
|
|
1465
|
+
(f(!0), x(H, null, ie(k.value, (i, b) => (f(), W(Pt(vt(i)), {
|
|
1453
1466
|
key: i.id,
|
|
1454
1467
|
class: J([
|
|
1455
|
-
...e(
|
|
1456
|
-
{ "is-selected": i.id ===
|
|
1468
|
+
...e(Gt)(i),
|
|
1469
|
+
{ "is-selected": i.id === P.value, "is-outside": Re(i) }
|
|
1457
1470
|
]),
|
|
1458
|
-
style:
|
|
1459
|
-
onPointerdown:
|
|
1471
|
+
style: ke(e(qt)(i, k.value.length - b)),
|
|
1472
|
+
onPointerdown: De((h) => We(h, i, "move"), ["stop"])
|
|
1460
1473
|
}, {
|
|
1461
1474
|
default: m(() => [
|
|
1462
|
-
i.type === "text" ? (f(), x("span",
|
|
1475
|
+
i.type === "text" ? (f(), x("span", Va, V(Me(i) || "…"), 1)) : i.type === "image" ? (f(), x("img", {
|
|
1463
1476
|
key: 1,
|
|
1464
1477
|
class: "webx-banner__inner",
|
|
1465
|
-
src: X[
|
|
1478
|
+
src: X[ce(i.image) ?? ""]?.url ?? "",
|
|
1466
1479
|
alt: "",
|
|
1467
1480
|
draggable: "false"
|
|
1468
|
-
}, null, 8,
|
|
1469
|
-
|
|
1481
|
+
}, null, 8, za)) : i.type === "button" ? (f(), x("span", Ca, [
|
|
1482
|
+
w("span", {
|
|
1470
1483
|
class: J([
|
|
1471
1484
|
"webx-banner__button",
|
|
1472
|
-
`webx-banner__button--${i.variant ??
|
|
1485
|
+
`webx-banner__button--${i.variant ?? C.value?.variants[0]?.value ?? "primary"}`
|
|
1473
1486
|
])
|
|
1474
|
-
},
|
|
1475
|
-
])) : (f(), x("span",
|
|
1476
|
-
(f(!0), x(H, null,
|
|
1477
|
-
key:
|
|
1487
|
+
}, V(Me(i) || "…"), 3)
|
|
1488
|
+
])) : (f(), x("span", Sa, [
|
|
1489
|
+
(f(!0), x(H, null, ie(Fe.value, (h, T) => (f(), x("span", {
|
|
1490
|
+
key: T,
|
|
1478
1491
|
class: J(["webx-banner__button", `webx-banner__button--${h.variant}`])
|
|
1479
|
-
},
|
|
1480
|
-
|
|
1492
|
+
}, V(h.label), 3))), 128)),
|
|
1493
|
+
Fe.value.length === 0 ? (f(), x("span", _a, V(e(p)("layers.buttons-layer")), 1)) : I("", !0)
|
|
1481
1494
|
])),
|
|
1482
|
-
i.id ===
|
|
1483
|
-
|
|
1495
|
+
i.id === P.value && !t.disabled ? (f(), x(H, { key: 4 }, [
|
|
1496
|
+
w("span", {
|
|
1484
1497
|
class: "wx-banner-layers__handle wx-banner-layers__handle--width",
|
|
1485
|
-
onPointerdown:
|
|
1486
|
-
}, null, 40,
|
|
1487
|
-
|
|
1498
|
+
onPointerdown: De((h) => We(h, i, "width"), ["stop"])
|
|
1499
|
+
}, null, 40, Oa),
|
|
1500
|
+
w("span", {
|
|
1488
1501
|
class: "wx-banner-layers__handle wx-banner-layers__handle--scale",
|
|
1489
|
-
onPointerdown:
|
|
1490
|
-
}, null, 40,
|
|
1502
|
+
onPointerdown: De((h) => We(h, i, "scale"), ["stop"])
|
|
1503
|
+
}, null, 40, Ba)
|
|
1491
1504
|
], 64)) : I("", !0)
|
|
1492
1505
|
]),
|
|
1493
1506
|
_: 2
|
|
1494
1507
|
}, 1064, ["class", "style", "onPointerdown"]))), 128))
|
|
1495
1508
|
], 512),
|
|
1496
|
-
|
|
1509
|
+
w("div", {
|
|
1497
1510
|
class: "wx-banner-layers__crop",
|
|
1498
|
-
style:
|
|
1499
|
-
left: `${
|
|
1500
|
-
top: `${
|
|
1501
|
-
width: `${
|
|
1502
|
-
height: `${
|
|
1511
|
+
style: ke({
|
|
1512
|
+
left: `${se.value.left}%`,
|
|
1513
|
+
top: `${se.value.top}%`,
|
|
1514
|
+
width: `${se.value.width}%`,
|
|
1515
|
+
height: `${se.value.height}%`
|
|
1503
1516
|
})
|
|
1504
1517
|
}, null, 4),
|
|
1505
|
-
(f(!0), x(H, null,
|
|
1518
|
+
(f(!0), x(H, null, ie(he.value, (i) => (f(), x("div", {
|
|
1506
1519
|
key: i.axis,
|
|
1507
1520
|
class: J(["wx-banner-layers__guide", `wx-banner-layers__guide--${i.axis}`]),
|
|
1508
|
-
style:
|
|
1521
|
+
style: ke(
|
|
1509
1522
|
i.axis === "x" ? { left: `${i.at}%` } : { top: `calc(${i.at} * 1cqw)` }
|
|
1510
1523
|
)
|
|
1511
1524
|
}, null, 6))), 128))
|
|
1512
1525
|
], 6)
|
|
1513
|
-
], 42,
|
|
1526
|
+
], 42, ga),
|
|
1514
1527
|
d(e(Y), {
|
|
1515
1528
|
size: "sm",
|
|
1516
1529
|
tone: "muted"
|
|
1517
1530
|
}, {
|
|
1518
1531
|
default: m(() => [
|
|
1519
|
-
|
|
1532
|
+
_(V(e(p)("layers.hint")), 1)
|
|
1520
1533
|
]),
|
|
1521
1534
|
_: 1
|
|
1522
1535
|
}),
|
|
1523
|
-
d(e(
|
|
1524
|
-
modelValue:
|
|
1525
|
-
"onUpdate:modelValue": n[5] || (n[5] = (i) =>
|
|
1536
|
+
d(e(Wt), {
|
|
1537
|
+
modelValue: ze.value,
|
|
1538
|
+
"onUpdate:modelValue": n[5] || (n[5] = (i) => ze.value = i),
|
|
1526
1539
|
class: "wx-banner-layers__list",
|
|
1527
1540
|
"item-key": "id",
|
|
1528
1541
|
size: "sm",
|
|
@@ -1531,22 +1544,22 @@ ${he.value?.fonts_css ?? ""}`.trim();
|
|
|
1531
1544
|
"aria-label": e(p)("layers.list")
|
|
1532
1545
|
}, {
|
|
1533
1546
|
default: m(({ item: i }) => [
|
|
1534
|
-
|
|
1547
|
+
w("button", {
|
|
1535
1548
|
type: "button",
|
|
1536
|
-
class: J(["wx-banner-layers__row", { "is-selected": i.id ===
|
|
1537
|
-
onClick: (b) =>
|
|
1549
|
+
class: J(["wx-banner-layers__row", { "is-selected": i.id === P.value }]),
|
|
1550
|
+
onClick: (b) => Je(i)
|
|
1538
1551
|
}, [
|
|
1539
1552
|
d(e(F), {
|
|
1540
|
-
name:
|
|
1553
|
+
name: wt[i.type]
|
|
1541
1554
|
}, null, 8, ["name"]),
|
|
1542
|
-
|
|
1543
|
-
|
|
1555
|
+
w("span", Na, V(ht(i)), 1),
|
|
1556
|
+
Re(i) ? (f(), W(e(F), {
|
|
1544
1557
|
key: 0,
|
|
1545
1558
|
name: "warning",
|
|
1546
1559
|
class: "wx-banner-layers__warn",
|
|
1547
1560
|
"aria-label": e(p)("layers.outside")
|
|
1548
1561
|
}, null, 8, ["aria-label"])) : I("", !0)
|
|
1549
|
-
], 10,
|
|
1562
|
+
], 10, La)
|
|
1550
1563
|
]),
|
|
1551
1564
|
actions: m(({ item: i }) => [
|
|
1552
1565
|
d(e(E), {
|
|
@@ -1554,7 +1567,7 @@ ${he.value?.fonts_css ?? ""}`.trim();
|
|
|
1554
1567
|
variant: "text",
|
|
1555
1568
|
disabled: t.disabled,
|
|
1556
1569
|
"aria-label": M(i).hidden ? e(p)("layers.show") : e(p)("layers.hide"),
|
|
1557
|
-
onClick: (b) =>
|
|
1570
|
+
onClick: (b) => Ne(i)
|
|
1558
1571
|
}, {
|
|
1559
1572
|
icon: m(() => [
|
|
1560
1573
|
d(e(F), {
|
|
@@ -1563,38 +1576,49 @@ ${he.value?.fonts_css ?? ""}`.trim();
|
|
|
1563
1576
|
]),
|
|
1564
1577
|
_: 2
|
|
1565
1578
|
}, 1032, ["disabled", "aria-label", "onClick"]),
|
|
1566
|
-
d(e(
|
|
1567
|
-
|
|
1568
|
-
|
|
1579
|
+
d(e(ot), {
|
|
1580
|
+
title: e(B).confirm,
|
|
1581
|
+
"confirm-text": e(B).confirmText,
|
|
1582
|
+
"cancel-text": e(B).cancelText,
|
|
1583
|
+
"confirm-type": "danger",
|
|
1569
1584
|
disabled: t.disabled,
|
|
1570
|
-
|
|
1571
|
-
onClick: (b) => pe(i.id)
|
|
1585
|
+
onConfirm: (b) => fe(i.id)
|
|
1572
1586
|
}, {
|
|
1573
|
-
|
|
1574
|
-
d(e(
|
|
1587
|
+
trigger: m(() => [
|
|
1588
|
+
d(e(E), {
|
|
1589
|
+
size: "sm",
|
|
1590
|
+
variant: "text",
|
|
1591
|
+
disabled: t.disabled,
|
|
1592
|
+
"aria-label": e(p)("layers.delete")
|
|
1593
|
+
}, {
|
|
1594
|
+
icon: m(() => [
|
|
1595
|
+
d(e(F), { name: "trash" })
|
|
1596
|
+
]),
|
|
1597
|
+
_: 1
|
|
1598
|
+
}, 8, ["disabled", "aria-label"])
|
|
1575
1599
|
]),
|
|
1576
1600
|
_: 1
|
|
1577
|
-
}, 8, ["
|
|
1601
|
+
}, 8, ["title", "confirm-text", "cancel-text", "disabled", "onConfirm"])
|
|
1578
1602
|
]),
|
|
1579
1603
|
_: 1
|
|
1580
1604
|
}, 8, ["modelValue", "disabled", "empty-text", "aria-label"])
|
|
1581
1605
|
]),
|
|
1582
|
-
|
|
1606
|
+
ee.value ? (f(), W(pa, {
|
|
1583
1607
|
key: 0,
|
|
1584
1608
|
class: "wx-banner-layers__inspector",
|
|
1585
|
-
layer:
|
|
1609
|
+
layer: ee.value,
|
|
1586
1610
|
view: D.value,
|
|
1587
|
-
tags:
|
|
1588
|
-
variants:
|
|
1589
|
-
palette:
|
|
1611
|
+
tags: C.value?.tags ?? [],
|
|
1612
|
+
variants: C.value?.variants ?? [],
|
|
1613
|
+
palette: we.value?.palette ?? [],
|
|
1590
1614
|
disabled: t.disabled,
|
|
1591
|
-
onUpdate:
|
|
1592
|
-
onFrame: n[6] || (n[6] = (i) => K(
|
|
1593
|
-
onSameAsDesktop: n[7] || (n[7] = (i) =>
|
|
1615
|
+
onUpdate: Be,
|
|
1616
|
+
onFrame: n[6] || (n[6] = (i) => K(ee.value.id, i)),
|
|
1617
|
+
onSameAsDesktop: n[7] || (n[7] = (i) => ne(ee.value.id, (b) => ({
|
|
1594
1618
|
...b,
|
|
1595
1619
|
frames: { ...b.frames, mobile: null }
|
|
1596
1620
|
}))),
|
|
1597
|
-
onDelete: n[8] || (n[8] = (i) =>
|
|
1621
|
+
onDelete: n[8] || (n[8] = (i) => fe(ee.value.id))
|
|
1598
1622
|
}, null, 8, ["layer", "view", "tags", "variants", "palette", "disabled"])) : (f(), W(e(Y), {
|
|
1599
1623
|
key: 1,
|
|
1600
1624
|
class: "wx-banner-layers__inspector",
|
|
@@ -1602,15 +1626,15 @@ ${he.value?.fonts_css ?? ""}`.trim();
|
|
|
1602
1626
|
tone: "muted"
|
|
1603
1627
|
}, {
|
|
1604
1628
|
default: m(() => [
|
|
1605
|
-
|
|
1629
|
+
_(V(e(p)("layers.choose")), 1)
|
|
1606
1630
|
]),
|
|
1607
1631
|
_: 1
|
|
1608
1632
|
}))
|
|
1609
1633
|
])
|
|
1610
1634
|
], 2));
|
|
1611
1635
|
}
|
|
1612
|
-
}),
|
|
1613
|
-
function
|
|
1636
|
+
}), Wa = /* @__PURE__ */ yt(Ua, [["__scopeId", "data-v-90d46ca5"]]);
|
|
1637
|
+
function Ra(t = {}) {
|
|
1614
1638
|
const c = t.path ?? "/banners";
|
|
1615
1639
|
return {
|
|
1616
1640
|
id: "banners",
|
|
@@ -1620,20 +1644,20 @@ function Al(t = {}) {
|
|
|
1620
1644
|
{
|
|
1621
1645
|
path: c,
|
|
1622
1646
|
name: "webx.banners",
|
|
1623
|
-
component: () => import("./BannersPage-
|
|
1647
|
+
component: () => import("./BannersPage-D7hpUcBn.js"),
|
|
1624
1648
|
props: { base: c }
|
|
1625
1649
|
},
|
|
1626
1650
|
// A banner not written yet: the place it goes to rides in the query (`?place=hero`).
|
|
1627
1651
|
{
|
|
1628
1652
|
path: `${c}/new`,
|
|
1629
1653
|
name: "webx.banners.new",
|
|
1630
|
-
component: () => import("./BannerEditorPage-
|
|
1654
|
+
component: () => import("./BannerEditorPage-B8e-IHkN.js"),
|
|
1631
1655
|
props: { base: c }
|
|
1632
1656
|
},
|
|
1633
1657
|
{
|
|
1634
1658
|
path: `${c}/:id(\\d+)`,
|
|
1635
1659
|
name: "webx.banners.edit",
|
|
1636
|
-
component: () => import("./BannerEditorPage-
|
|
1660
|
+
component: () => import("./BannerEditorPage-B8e-IHkN.js"),
|
|
1637
1661
|
props: { base: c }
|
|
1638
1662
|
}
|
|
1639
1663
|
],
|
|
@@ -1642,40 +1666,40 @@ function Al(t = {}) {
|
|
|
1642
1666
|
* picture. A field like any other — its value is the list of layers.
|
|
1643
1667
|
*/
|
|
1644
1668
|
types: {
|
|
1645
|
-
"wx-banner-layers": { component:
|
|
1669
|
+
"wx-banner-layers": { component: Wa, kind: "field", wide: !0 }
|
|
1646
1670
|
}
|
|
1647
1671
|
};
|
|
1648
1672
|
}
|
|
1649
|
-
const
|
|
1673
|
+
const Ka = nt(() => import("./BannersPage-D7hpUcBn.js")), ja = nt(() => import("./BannerEditorPage-B8e-IHkN.js"));
|
|
1650
1674
|
export {
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1675
|
+
Ye as E,
|
|
1676
|
+
Jt as F,
|
|
1677
|
+
Qe as L,
|
|
1678
|
+
Kt as O,
|
|
1679
|
+
ja as W,
|
|
1680
|
+
yt as _,
|
|
1681
|
+
$e as a,
|
|
1682
|
+
Wa as b,
|
|
1683
|
+
At as c,
|
|
1684
|
+
Fa as d,
|
|
1685
|
+
Ka as e,
|
|
1686
|
+
Ra as f,
|
|
1687
|
+
Ft as g,
|
|
1688
|
+
Yt as h,
|
|
1689
|
+
Ae as i,
|
|
1690
|
+
Xt as j,
|
|
1691
|
+
tt as k,
|
|
1692
|
+
re as l,
|
|
1693
|
+
Gt as m,
|
|
1694
|
+
mt as n,
|
|
1695
|
+
qt as o,
|
|
1696
|
+
Ma as p,
|
|
1697
|
+
Ht as q,
|
|
1698
|
+
Oe as r,
|
|
1699
|
+
et as s,
|
|
1700
|
+
at as t,
|
|
1701
|
+
Rt as u,
|
|
1702
|
+
_e as v,
|
|
1703
|
+
Zt as w
|
|
1680
1704
|
};
|
|
1681
|
-
//# sourceMappingURL=index-
|
|
1705
|
+
//# sourceMappingURL=index-QnpLuOX2.js.map
|