@hankchen/canvas-editor-vue 2.1.0 → 2.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/README.md +43 -2
- package/dist/{ExpressionPathPicker-DchGsK70.js → Tooltip-9lQOwB7r.js} +260 -195
- package/dist/_plugin-vue_export-helper-CBNdHDnS.js +98 -0
- package/dist/canvas/EditOverlayToolbar.d.ts +1 -1
- package/dist/{canvas-DuvO27sj.js → canvas-DIcS64ZV.js} +614 -554
- package/dist/canvas.js +1 -1
- package/dist/index.js +14 -14
- package/dist/{layer-panel-BouAYiDq.js → layer-panel-DPhB8OJp.js} +246 -240
- package/dist/layer-panel.js +1 -1
- package/dist/panel-theme.css +6 -276
- package/dist/{property-panel-CwdTufiP.js → property-panel-BzpaxWLB.js} +214 -213
- package/dist/property-panel.js +2 -2
- package/dist/{resourceTemplate-D-DKEo7Z.js → resourceTemplate-DLEZMwZl.js} +1 -1
- package/dist/shared/Tooltip.d.ts +24 -0
- package/dist/shared/index.d.ts +8 -1
- package/dist/shared/useCnTheme.d.ts +12 -0
- package/dist/shared/useDropdownMenu.d.ts +13 -1
- package/dist/{shared-CRDKDSpa.js → shared-5EY0LNSa.js} +76 -31
- package/dist/shared.js +9 -9
- package/dist/{status-bar-DBf5kIXY.js → status-bar-CJJSr9Ua.js} +9 -10
- package/dist/status-bar.js +1 -1
- package/dist/style.css +1 -1
- package/dist/theme.css +428 -0
- package/dist/{uploadFile-mXJVPEzm.js → uploadFile-DnW3L-8J.js} +33 -33
- package/dist/useTransientFeedback-CI3j6r7y.js +956 -0
- package/package.json +4 -3
- package/dist/DropdownMenu-CeUNKMDQ.js +0 -450
- package/dist/layerPath-uy2ywyld.js +0 -76
- package/dist/useTransientFeedback-BN_O7V2w.js +0 -498
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as e } from "./createLucideIcon-SCvtEGVf.js";
|
|
2
2
|
import { a as t, c as n, d as r, f as i, i as a, l as o, n as s, p as c, r as l, s as u, t as d, u as f } from "./dist-DGtNmLwo.js";
|
|
3
|
-
import { a as p,
|
|
4
|
-
import { c as
|
|
5
|
-
import { n as b, r as
|
|
6
|
-
import { a as
|
|
7
|
-
import { Fragment as w, computed as T, createBlock as E, createCommentVNode as D, createElementBlock as O, createElementVNode as k, createTextVNode as
|
|
8
|
-
var
|
|
3
|
+
import { a as p, n as m, o as h, s as g } from "./_plugin-vue_export-helper-CBNdHDnS.js";
|
|
4
|
+
import { c as _, l as ee, n as v, s as te, t as y } from "./Tooltip-9lQOwB7r.js";
|
|
5
|
+
import { n as b, r as ne, t as x } from "./resourceTemplate-DLEZMwZl.js";
|
|
6
|
+
import { a as S, f as re, h as C, i as ie, l as ae, m as oe, n as se, o as ce, p as le, s as ue, t as de } from "./uploadFile-DnW3L-8J.js";
|
|
7
|
+
import { Fragment as w, computed as T, createBlock as E, createCommentVNode as D, createElementBlock as O, createElementVNode as k, createTextVNode as fe, createVNode as A, defineComponent as j, inject as pe, markRaw as M, nextTick as me, normalizeClass as N, onScopeDispose as he, openBlock as P, provide as ge, ref as F, renderList as I, resolveDynamicComponent as _e, shallowRef as L, toDisplayString as R, unref as z, vModelText as ve, watch as B, watchEffect as ye, withCtx as be, withDirectives as xe, withModifiers as V } from "vue";
|
|
8
|
+
var Se = e({
|
|
9
9
|
name: "grid-2x2",
|
|
10
10
|
size: 24,
|
|
11
11
|
node: [
|
|
@@ -27,7 +27,7 @@ var xe = e({
|
|
|
27
27
|
}]
|
|
28
28
|
],
|
|
29
29
|
aliases: ["grid-2-x-2"]
|
|
30
|
-
}),
|
|
30
|
+
}), Ce = e({
|
|
31
31
|
name: "square-split-vertical",
|
|
32
32
|
size: 24,
|
|
33
33
|
node: [
|
|
@@ -45,7 +45,7 @@ var xe = e({
|
|
|
45
45
|
}]
|
|
46
46
|
],
|
|
47
47
|
aliases: ["split-square-vertical"]
|
|
48
|
-
}),
|
|
48
|
+
}), we = e({
|
|
49
49
|
name: "square",
|
|
50
50
|
size: 24,
|
|
51
51
|
node: [["rect", {
|
|
@@ -59,7 +59,7 @@ var xe = e({
|
|
|
59
59
|
});
|
|
60
60
|
//#endregion
|
|
61
61
|
//#region ../canvas-editor/src/shared/resourceStatus.ts
|
|
62
|
-
function
|
|
62
|
+
function Te(e, n) {
|
|
63
63
|
if (e.type !== "ImageLayer") return !1;
|
|
64
64
|
if (e.expression !== null || e.src === null || t(e) <= 0 || a(e) <= 0) return !0;
|
|
65
65
|
if (n !== void 0) {
|
|
@@ -70,7 +70,7 @@ function we(e, n) {
|
|
|
70
70
|
}
|
|
71
71
|
//#endregion
|
|
72
72
|
//#region src/property-panel/fieldSchema.ts
|
|
73
|
-
var
|
|
73
|
+
var Ee = "当前层内容未绘制,padding 不影响预览", H = {
|
|
74
74
|
title: "位置与尺寸",
|
|
75
75
|
fields: [
|
|
76
76
|
{
|
|
@@ -160,7 +160,7 @@ var Te = "当前层内容未绘制,padding 不影响预览", H = {
|
|
|
160
160
|
label: "内边距",
|
|
161
161
|
control: "padding",
|
|
162
162
|
title: "内边距作用于内容盒,不改变图层尺寸",
|
|
163
|
-
hint: (e, t) =>
|
|
163
|
+
hint: (e, t) => Te(e, t) ? Ee : null
|
|
164
164
|
},
|
|
165
165
|
{
|
|
166
166
|
key: ["shape", "border"],
|
|
@@ -168,7 +168,7 @@ var Te = "当前层内容未绘制,padding 不影响预览", H = {
|
|
|
168
168
|
control: "border"
|
|
169
169
|
}
|
|
170
170
|
]
|
|
171
|
-
},
|
|
171
|
+
}, De = {
|
|
172
172
|
title: "文本",
|
|
173
173
|
fields: [
|
|
174
174
|
{
|
|
@@ -200,7 +200,7 @@ var Te = "当前层内容未绘制,padding 不影响预览", H = {
|
|
|
200
200
|
control: "boolean"
|
|
201
201
|
}
|
|
202
202
|
]
|
|
203
|
-
},
|
|
203
|
+
}, Oe = "cover", ke = "contain", Ae = "fill", je = "tile", Me = "rect", Ne = "circle", Pe = {
|
|
204
204
|
ImageLayer: [
|
|
205
205
|
H,
|
|
206
206
|
U,
|
|
@@ -220,26 +220,26 @@ var Te = "当前层内容未绘制,padding 不影响预览", H = {
|
|
|
220
220
|
label: "适配",
|
|
221
221
|
control: "select",
|
|
222
222
|
domain: [
|
|
223
|
-
De,
|
|
224
223
|
Oe,
|
|
225
224
|
ke,
|
|
226
|
-
Ae
|
|
225
|
+
Ae,
|
|
226
|
+
je
|
|
227
227
|
],
|
|
228
228
|
optionLabels: {
|
|
229
|
-
[
|
|
230
|
-
[
|
|
231
|
-
[
|
|
232
|
-
[
|
|
229
|
+
[Oe]: "铺满裁切",
|
|
230
|
+
[ke]: "完整显示",
|
|
231
|
+
[Ae]: "拉伸铺满",
|
|
232
|
+
[je]: "平铺"
|
|
233
233
|
}
|
|
234
234
|
},
|
|
235
235
|
{
|
|
236
236
|
key: ["clip"],
|
|
237
237
|
label: "裁剪形状",
|
|
238
238
|
control: "select",
|
|
239
|
-
domain: [
|
|
239
|
+
domain: [Me, Ne],
|
|
240
240
|
optionLabels: {
|
|
241
|
-
[
|
|
242
|
-
[
|
|
241
|
+
[Me]: "矩形",
|
|
242
|
+
[Ne]: "圆形"
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
]
|
|
@@ -249,7 +249,7 @@ var Te = "当前层内容未绘制,padding 不影响预览", H = {
|
|
|
249
249
|
H,
|
|
250
250
|
U,
|
|
251
251
|
W,
|
|
252
|
-
|
|
252
|
+
De
|
|
253
253
|
],
|
|
254
254
|
QrCodeLayer: [
|
|
255
255
|
H,
|
|
@@ -305,15 +305,15 @@ var Te = "当前层内容未绘制,padding 不影响预览", H = {
|
|
|
305
305
|
}]
|
|
306
306
|
}]
|
|
307
307
|
};
|
|
308
|
-
function Pe(e) {
|
|
309
|
-
return Ne[e] ?? [];
|
|
310
|
-
}
|
|
311
308
|
function Fe(e) {
|
|
312
|
-
|
|
309
|
+
return Pe[e] ?? [];
|
|
310
|
+
}
|
|
311
|
+
function Ie(e) {
|
|
312
|
+
if (e[e.length - 1] === "content") return p(e) ? "templateContent" : "content";
|
|
313
313
|
let t = e[e.length - 2];
|
|
314
314
|
return t === "rows" ? "row" : t === "cells" ? "cell" : "root";
|
|
315
315
|
}
|
|
316
|
-
var
|
|
316
|
+
var Le = {
|
|
317
317
|
root: [],
|
|
318
318
|
cell: [],
|
|
319
319
|
row: ["shape.width", "shape.autoWidth"],
|
|
@@ -328,9 +328,9 @@ var Ie = {
|
|
|
328
328
|
function G(e, t) {
|
|
329
329
|
return [...e.key, ...t.key];
|
|
330
330
|
}
|
|
331
|
-
function
|
|
332
|
-
let n = new Set(Ie
|
|
333
|
-
for (let e of
|
|
331
|
+
function Re(e, t) {
|
|
332
|
+
let n = new Set(Le[Ie(e)]), r = [];
|
|
333
|
+
for (let e of Fe(t.type)) {
|
|
334
334
|
let i = [];
|
|
335
335
|
for (let r of e.fields) {
|
|
336
336
|
if (r.items) {
|
|
@@ -350,7 +350,7 @@ function Le(e, t) {
|
|
|
350
350
|
}
|
|
351
351
|
return r;
|
|
352
352
|
}
|
|
353
|
-
var
|
|
353
|
+
var ze = [{
|
|
354
354
|
title: "画布",
|
|
355
355
|
fields: [{
|
|
356
356
|
key: ["width"],
|
|
@@ -378,13 +378,13 @@ var Re = [{
|
|
|
378
378
|
control: "imageSrc"
|
|
379
379
|
}]
|
|
380
380
|
}];
|
|
381
|
-
function
|
|
381
|
+
function Be(e) {
|
|
382
382
|
return e === null ? null : e.background === null ? {
|
|
383
383
|
...e,
|
|
384
|
-
background:
|
|
384
|
+
background: K
|
|
385
385
|
} : e;
|
|
386
386
|
}
|
|
387
|
-
var
|
|
387
|
+
var K = {
|
|
388
388
|
color: null,
|
|
389
389
|
image: null
|
|
390
390
|
};
|
|
@@ -395,7 +395,7 @@ function Ve(e) {
|
|
|
395
395
|
...e.clip === void 0 ? { clip: "rect" } : {}
|
|
396
396
|
} : e;
|
|
397
397
|
}
|
|
398
|
-
function
|
|
398
|
+
function q(e, t) {
|
|
399
399
|
let n = e;
|
|
400
400
|
for (let e = 0; e < t.length; e += 1) {
|
|
401
401
|
if (typeof n != "object" || !n) return { ok: !1 };
|
|
@@ -408,11 +408,7 @@ function K(e, t) {
|
|
|
408
408
|
}
|
|
409
409
|
//#endregion
|
|
410
410
|
//#region src/property-panel/fields/AlignField.vue?vue&type=script&setup=true&lang.ts
|
|
411
|
-
var He = ["aria-label"], Ue = [
|
|
412
|
-
"aria-pressed",
|
|
413
|
-
"title",
|
|
414
|
-
"onClick"
|
|
415
|
-
], We = {
|
|
411
|
+
var He = ["aria-label"], Ue = ["aria-pressed", "onClick"], We = {
|
|
416
412
|
key: 1,
|
|
417
413
|
class: "truncate px-1 text-[10px] leading-none"
|
|
418
414
|
}, Ge = /* @__PURE__ */ j({
|
|
@@ -460,24 +456,29 @@ var He = ["aria-label"], Ue = [
|
|
|
460
456
|
title: t?.[e] ? `${a.field.label}:${t[e].title}` : `${a.field.label}:${e}`
|
|
461
457
|
}));
|
|
462
458
|
});
|
|
463
|
-
function
|
|
459
|
+
function h(e) {
|
|
464
460
|
e !== a.modelValue && u("change", e);
|
|
465
461
|
}
|
|
466
462
|
return (t, n) => (P(), O("span", {
|
|
467
463
|
class: "cn-align flex h-7 min-w-0 flex-1 overflow-hidden rounded-md border border-cn-field-line bg-cn-field",
|
|
468
464
|
role: "group",
|
|
469
465
|
"aria-label": e.field.label
|
|
470
|
-
}, [(P(!0), O(w, null, I(p.value, (t, n) => (P(),
|
|
466
|
+
}, [(P(!0), O(w, null, I(p.value, (t, n) => (P(), E(y, {
|
|
471
467
|
key: t.value,
|
|
472
|
-
|
|
473
|
-
class:
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
468
|
+
label: t.title,
|
|
469
|
+
class: "min-w-0 flex-1"
|
|
470
|
+
}, {
|
|
471
|
+
default: be(() => [k("button", {
|
|
472
|
+
type: "button",
|
|
473
|
+
class: N(["cn-align__option flex min-w-0 flex-1 items-center justify-center p-0 transition-colors duration-100 focus-visible:z-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cn-accent/40", [n > 0 ? "border-l border-cn-field-line" : "", t.value === e.modelValue ? "cn-align__option--active bg-cn-accent-soft text-cn-accent" : "text-cn-muted hover:text-cn-fg"]]),
|
|
474
|
+
"aria-pressed": t.value === e.modelValue,
|
|
475
|
+
onClick: V((e) => h(t.value), ["prevent"])
|
|
476
|
+
}, [t.icon ? (P(), E(m, {
|
|
477
|
+
key: 0,
|
|
478
|
+
icon: t.icon
|
|
479
|
+
}, null, 8, ["icon"])) : (P(), O("span", We, R(t.value), 1))], 10, Ue)]),
|
|
480
|
+
_: 2
|
|
481
|
+
}, 1032, ["label"]))), 128))], 8, He));
|
|
481
482
|
}
|
|
482
483
|
}), Ke = { class: "block" }, qe = ["aria-expanded", "title"], Je = { class: "cn-prop-field__label shrink-0 select-none truncate text-[11px] leading-none text-cn-muted" }, Ye = { class: "flex shrink-0 items-center gap-1.5" }, Xe = {
|
|
483
484
|
viewBox: "0 0 24 24",
|
|
@@ -530,13 +531,13 @@ var He = ["aria-label"], Ue = [
|
|
|
530
531
|
cy: e.cy,
|
|
531
532
|
r: e.index === o.value ? 3.2 : 2.2,
|
|
532
533
|
class: N(e.index === o.value ? "fill-cn-accent" : "fill-cn-muted/35")
|
|
533
|
-
}, null, 10, Ze))), 128))])), A(
|
|
534
|
+
}, null, 10, Ze))), 128))])), A(m, {
|
|
534
535
|
icon: z(u),
|
|
535
536
|
class: N(["text-cn-muted transition-transform duration-150", { "rotate-180": e.expanded }])
|
|
536
537
|
}, null, 8, ["icon", "class"])])], 8, qe), e.expanded ? (P(), O("span", Qe, [k("span", $e, [(P(!0), O(w, null, I(z(i), (t) => (P(), O("button", {
|
|
537
538
|
key: t,
|
|
538
539
|
type: "button",
|
|
539
|
-
class: N(["cn-anchor__cell relative aspect-square min-w-0 rounded-[4px] border p-0 transition-colors duration-100", t === e.modelValue ? "cn-anchor__cell--active border-cn-accent bg-cn-accent shadow-
|
|
540
|
+
class: N(["cn-anchor__cell relative aspect-square min-w-0 rounded-[4px] border p-0 transition-colors duration-100", t === e.modelValue ? "cn-anchor__cell--active border-cn-accent bg-cn-accent shadow-(--cn-accent-glow)" : "border-cn-field-line bg-cn-field hover:border-cn-muted/50"]),
|
|
540
541
|
"aria-pressed": t === e.modelValue,
|
|
541
542
|
title: t,
|
|
542
543
|
onClick: (e) => s(t)
|
|
@@ -552,9 +553,9 @@ var He = ["aria-label"], Ue = [
|
|
|
552
553
|
setup(e, { emit: t }) {
|
|
553
554
|
let n = e, r = t, i = F(null);
|
|
554
555
|
async function a(e) {
|
|
555
|
-
r("change", e.target.checked), await
|
|
556
|
+
r("change", e.target.checked), await me(), i.value && (i.value.checked = n.modelValue);
|
|
556
557
|
}
|
|
557
|
-
return
|
|
558
|
+
return ye(() => {
|
|
558
559
|
i.value && (i.value.checked = n.modelValue);
|
|
559
560
|
}), (t, n) => (P(), O("label", nt, [
|
|
560
561
|
k("input", {
|
|
@@ -642,12 +643,12 @@ function ct(e, t) {
|
|
|
642
643
|
function lt(e, t) {
|
|
643
644
|
return e.top === t.top && e.bottom === t.bottom && e.left === t.left && e.right === t.right;
|
|
644
645
|
}
|
|
645
|
-
function
|
|
646
|
+
function J(e, t) {
|
|
646
647
|
return e === null || t === null ? e === t : e.width === t.width && e.color === t.color;
|
|
647
648
|
}
|
|
648
649
|
function ut(e) {
|
|
649
650
|
let { top: t, bottom: n, left: r, right: i } = e;
|
|
650
|
-
return t === null && n === null && r === null && i === null || t !== null &&
|
|
651
|
+
return t === null && n === null && r === null && i === null || t !== null && J(t, n) && J(t, r) && J(t, i) ? 1 : J(t, n) && J(r, i) ? 2 : 4;
|
|
651
652
|
}
|
|
652
653
|
function dt(e, t) {
|
|
653
654
|
let n = (e) => e === null ? null : { ...e };
|
|
@@ -672,7 +673,7 @@ function dt(e, t) {
|
|
|
672
673
|
return e;
|
|
673
674
|
}
|
|
674
675
|
function ft(e, t) {
|
|
675
|
-
return
|
|
676
|
+
return J(e.top, t.top) && J(e.bottom, t.bottom) && J(e.left, t.left) && J(e.right, t.right);
|
|
676
677
|
}
|
|
677
678
|
//#endregion
|
|
678
679
|
//#region src/property-panel/useShorthandMode.ts
|
|
@@ -695,7 +696,7 @@ function pt(e, t) {
|
|
|
695
696
|
}
|
|
696
697
|
//#endregion
|
|
697
698
|
//#region src/property-panel/controlStyles.ts
|
|
698
|
-
var
|
|
699
|
+
var Y = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-field text-[11.5px] leading-none text-cn-fg outline-none transition-[border-color,box-shadow,background-color] duration-100 placeholder:text-cn-muted/60 hover:border-cn-muted/40 focus:border-cn-accent/70 focus:ring-[3px] focus:ring-cn-accent/15 disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:border-cn-field-line", X = `${Y} text-right font-mono tabular-nums`, mt = Y, ht = "w-full flex-1 min-w-0 resize-y rounded-md border border-cn-field-line bg-cn-field px-2 py-1.5 text-[11.5px] leading-5 text-cn-fg outline-none transition-[border-color,box-shadow] duration-100 placeholder:text-cn-muted/60 hover:border-cn-muted/40 focus:border-cn-accent/70 focus:ring-[3px] focus:ring-cn-accent/15 disabled:cursor-not-allowed disabled:opacity-40", gt = "size-7 shrink-0 cursor-pointer self-center rounded-md border border-cn-field-line bg-cn-field p-0.5 transition-colors hover:border-cn-muted/40 disabled:cursor-not-allowed disabled:opacity-40", _t = ["aria-label"], vt = /* @__PURE__ */ j({
|
|
699
700
|
__name: "BorderWidthInput",
|
|
700
701
|
props: {
|
|
701
702
|
value: {},
|
|
@@ -733,9 +734,9 @@ var J = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
|
|
|
733
734
|
let a = o(t);
|
|
734
735
|
i.value = a === 0 ? "" : String(a), r("change", a);
|
|
735
736
|
}
|
|
736
|
-
return (t, n) =>
|
|
737
|
+
return (t, n) => xe((P(), O("input", {
|
|
737
738
|
"onUpdate:modelValue": n[0] ||= (e) => i.value = e,
|
|
738
|
-
class: N(["cn-field cn-field--number min-w-0 flex-1", z(
|
|
739
|
+
class: N(["cn-field cn-field--number min-w-0 flex-1", z(X)]),
|
|
739
740
|
type: "number",
|
|
740
741
|
"aria-label": e.label,
|
|
741
742
|
min: 0,
|
|
@@ -746,9 +747,9 @@ var J = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
|
|
|
746
747
|
onFocus: n[1] ||= (e) => a.value = !0,
|
|
747
748
|
onBlur: u,
|
|
748
749
|
onChange: u
|
|
749
|
-
}, null, 42, _t)), [[
|
|
750
|
+
}, null, 42, _t)), [[ve, i.value]]);
|
|
750
751
|
}
|
|
751
|
-
}), yt = ["aria-label", "title"],
|
|
752
|
+
}), yt = ["aria-label", "title"], bt = /* @__PURE__ */ j({
|
|
752
753
|
__name: "ShorthandModeButton",
|
|
753
754
|
props: {
|
|
754
755
|
mode: {},
|
|
@@ -758,15 +759,15 @@ var J = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
|
|
|
758
759
|
setup(e, { emit: t }) {
|
|
759
760
|
let n = e, r = t, i = {
|
|
760
761
|
1: {
|
|
761
|
-
icon:
|
|
762
|
+
icon: we,
|
|
762
763
|
title: "统一值"
|
|
763
764
|
},
|
|
764
765
|
2: {
|
|
765
|
-
icon:
|
|
766
|
+
icon: Ce,
|
|
766
767
|
title: "上下/左右"
|
|
767
768
|
},
|
|
768
769
|
4: {
|
|
769
|
-
icon:
|
|
770
|
+
icon: Se,
|
|
770
771
|
title: "四边独立"
|
|
771
772
|
}
|
|
772
773
|
}, a = T(() => i[n.mode]), o = T(() => `${n.label}:${a.value.title}(点击切换值模式)`);
|
|
@@ -776,17 +777,17 @@ var J = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
|
|
|
776
777
|
"aria-label": o.value,
|
|
777
778
|
title: o.value,
|
|
778
779
|
onClick: t[0] ||= V((e) => r("cycle"), ["prevent"])
|
|
779
|
-
}, [A(
|
|
780
|
+
}, [A(m, {
|
|
780
781
|
icon: a.value.icon,
|
|
781
782
|
size: 12
|
|
782
783
|
}, null, 8, ["icon"])], 8, yt));
|
|
783
784
|
}
|
|
784
|
-
}),
|
|
785
|
+
}), xt = { class: "cn-border flex w-full min-w-0 items-center gap-1" }, St = { class: "grid min-w-0 flex-1 gap-1 grid-cols-1" }, Ct = { class: "w-5 shrink-0 select-none text-[10px] leading-none text-cn-muted" }, wt = [
|
|
785
786
|
"value",
|
|
786
787
|
"disabled",
|
|
787
788
|
"onInput",
|
|
788
789
|
"onChange"
|
|
789
|
-
],
|
|
790
|
+
], Tt = "#000000", Et = /* @__PURE__ */ j({
|
|
790
791
|
__name: "BorderField",
|
|
791
792
|
props: {
|
|
792
793
|
field: {},
|
|
@@ -799,7 +800,7 @@ var J = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
|
|
|
799
800
|
return n.modelValue[e.rep]?.width ?? null;
|
|
800
801
|
}
|
|
801
802
|
function c(e) {
|
|
802
|
-
return n.modelValue[e.rep]?.color ??
|
|
803
|
+
return n.modelValue[e.rep]?.color ?? Tt;
|
|
803
804
|
}
|
|
804
805
|
function l(e, t, i) {
|
|
805
806
|
let a = { ...n.modelValue };
|
|
@@ -807,7 +808,7 @@ var J = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
|
|
|
807
808
|
r(i ? "change" : "input", a);
|
|
808
809
|
}
|
|
809
810
|
function u(e, t, r) {
|
|
810
|
-
let i = n.modelValue[e.rep]?.color ??
|
|
811
|
+
let i = n.modelValue[e.rep]?.color ?? Tt;
|
|
811
812
|
l(e, t <= 0 ? null : {
|
|
812
813
|
width: t,
|
|
813
814
|
color: i
|
|
@@ -829,15 +830,15 @@ var J = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
|
|
|
829
830
|
ft(e, n.modelValue) || r("change", e);
|
|
830
831
|
}
|
|
831
832
|
}
|
|
832
|
-
return (t, n) => (P(), O("span",
|
|
833
|
+
return (t, n) => (P(), O("span", xt, [A(bt, {
|
|
833
834
|
mode: z(i),
|
|
834
835
|
label: "边框",
|
|
835
836
|
onCycle: f
|
|
836
|
-
}, null, 8, ["mode"]), k("span",
|
|
837
|
+
}, null, 8, ["mode"]), k("span", St, [(P(!0), O(w, null, I(o.value, (t) => (P(), O("label", {
|
|
837
838
|
key: t.rep,
|
|
838
839
|
class: "flex items-center gap-1.5"
|
|
839
840
|
}, [
|
|
840
|
-
k("span",
|
|
841
|
+
k("span", Ct, R(t.label), 1),
|
|
841
842
|
A(vt, {
|
|
842
843
|
class: "cn-border__width",
|
|
843
844
|
value: s(t),
|
|
@@ -858,17 +859,17 @@ var J = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
|
|
|
858
859
|
disabled: e.modelValue[t.rep] === null,
|
|
859
860
|
onInput: (e) => d(t, e, !1),
|
|
860
861
|
onChange: (e) => d(t, e, !0)
|
|
861
|
-
}, null, 40,
|
|
862
|
+
}, null, 40, wt)
|
|
862
863
|
]))), 128))])]));
|
|
863
864
|
}
|
|
864
|
-
}),
|
|
865
|
+
}), Dt = ["value"], Ot = {
|
|
865
866
|
key: 1,
|
|
866
867
|
class: "flex flex-1 items-center gap-1.5"
|
|
867
|
-
},
|
|
868
|
+
}, kt = ["value"], At = ["value"], jt = [
|
|
868
869
|
"disabled",
|
|
869
870
|
"title",
|
|
870
871
|
"data-upload-error"
|
|
871
|
-
],
|
|
872
|
+
], Mt = /* @__PURE__ */ j({
|
|
872
873
|
__name: "FontField",
|
|
873
874
|
props: {
|
|
874
875
|
field: {},
|
|
@@ -876,7 +877,7 @@ var J = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
|
|
|
876
877
|
},
|
|
877
878
|
emits: ["input", "change"],
|
|
878
879
|
setup(e, { emit: t }) {
|
|
879
|
-
let n = e, r = t, i =
|
|
880
|
+
let n = e, r = t, i = ie(), a = T(() => {
|
|
880
881
|
if (i === null) return [];
|
|
881
882
|
let e = [{
|
|
882
883
|
label: "内置默认字体",
|
|
@@ -920,7 +921,7 @@ var J = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
|
|
|
920
921
|
if (t.value = "", i !== null && n && !p.value) {
|
|
921
922
|
p.value = !0;
|
|
922
923
|
try {
|
|
923
|
-
let e = await i.uploadFont(await
|
|
924
|
+
let e = await i.uploadFont(await de(n));
|
|
924
925
|
r("change", e);
|
|
925
926
|
} catch (e) {
|
|
926
927
|
m.value = e instanceof Error ? e.message : String(e);
|
|
@@ -938,15 +939,15 @@ var J = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
|
|
|
938
939
|
onCompositionstart: u,
|
|
939
940
|
onCompositionend: d,
|
|
940
941
|
onChange: f
|
|
941
|
-
}, null, 42,
|
|
942
|
+
}, null, 42, Dt)) : (P(), O("div", Ot, [
|
|
942
943
|
k("select", {
|
|
943
|
-
class: N(["cn-field cn-select", z(
|
|
944
|
+
class: N(["cn-field cn-select", z(Y)]),
|
|
944
945
|
value: e.modelValue,
|
|
945
946
|
onChange: s
|
|
946
947
|
}, [(P(!0), O(w, null, I(a.value, (e) => (P(), O("option", {
|
|
947
948
|
key: e.value,
|
|
948
949
|
value: e.value
|
|
949
|
-
}, R(e.label), 9,
|
|
950
|
+
}, R(e.label), 9, At))), 128))], 42, kt),
|
|
950
951
|
k("input", {
|
|
951
952
|
ref_key: "fileInput",
|
|
952
953
|
ref: h,
|
|
@@ -963,10 +964,10 @@ var J = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
|
|
|
963
964
|
title: m.value ?? "上传本机字体(加入清单后可选)",
|
|
964
965
|
"data-upload-error": m.value ?? void 0,
|
|
965
966
|
onClick: g
|
|
966
|
-
}, R(p.value ? "…" : m.value ? "!" : "上传"), 9,
|
|
967
|
+
}, R(p.value ? "…" : m.value ? "!" : "上传"), 9, jt)) : D("", !0)
|
|
967
968
|
]));
|
|
968
969
|
}
|
|
969
|
-
}),
|
|
970
|
+
}), Nt = { class: "cn-color flex min-w-0 flex-1 items-center gap-1.5" }, Pt = ["checked"], Ft = ["value", "disabled"], It = ["value", "disabled"], Lt = "#000000", Rt = /* @__PURE__ */ j({
|
|
970
971
|
__name: "ColorField",
|
|
971
972
|
props: {
|
|
972
973
|
field: {},
|
|
@@ -979,7 +980,7 @@ var J = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
|
|
|
979
980
|
i.value = e !== null, i.value && (a.value = o(e));
|
|
980
981
|
});
|
|
981
982
|
function o(e) {
|
|
982
|
-
return e !== null && /^#[0-9a-fA-F]{6}$/.test(e) ? e :
|
|
983
|
+
return e !== null && /^#[0-9a-fA-F]{6}$/.test(e) ? e : Lt;
|
|
983
984
|
}
|
|
984
985
|
function s(e) {
|
|
985
986
|
let t = e.target.checked;
|
|
@@ -1006,7 +1007,7 @@ var J = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
|
|
|
1006
1007
|
}
|
|
1007
1008
|
a.value = o(t), r("change", t);
|
|
1008
1009
|
}
|
|
1009
|
-
return (t, n) => (P(), O("span",
|
|
1010
|
+
return (t, n) => (P(), O("span", Nt, [
|
|
1010
1011
|
e.field.nullable ? (P(), O("input", {
|
|
1011
1012
|
key: 0,
|
|
1012
1013
|
class: "cn-color__toggle size-3.5 shrink-0 cursor-pointer accent-cn-accent",
|
|
@@ -1014,7 +1015,7 @@ var J = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
|
|
|
1014
1015
|
title: "启用颜色",
|
|
1015
1016
|
checked: i.value,
|
|
1016
1017
|
onChange: s
|
|
1017
|
-
}, null, 40,
|
|
1018
|
+
}, null, 40, Pt)) : D("", !0),
|
|
1018
1019
|
k("input", {
|
|
1019
1020
|
class: N(["cn-color__swatch", z(gt)]),
|
|
1020
1021
|
type: "color",
|
|
@@ -1022,35 +1023,35 @@ var J = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
|
|
|
1022
1023
|
disabled: !i.value,
|
|
1023
1024
|
onInput: c,
|
|
1024
1025
|
onChange: l
|
|
1025
|
-
}, null, 42,
|
|
1026
|
+
}, null, 42, Ft),
|
|
1026
1027
|
k("input", {
|
|
1027
|
-
class: N(["cn-color__text min-w-0 flex-1", z(
|
|
1028
|
+
class: N(["cn-color__text min-w-0 flex-1", z(Y)]),
|
|
1028
1029
|
type: "text",
|
|
1029
1030
|
value: e.modelValue ?? "",
|
|
1030
1031
|
disabled: !i.value,
|
|
1031
1032
|
placeholder: "无",
|
|
1032
1033
|
onChange: u
|
|
1033
|
-
}, null, 42,
|
|
1034
|
+
}, null, 42, It)
|
|
1034
1035
|
]));
|
|
1035
1036
|
}
|
|
1036
1037
|
}), Z = Symbol("canvas-image-upload");
|
|
1037
|
-
function
|
|
1038
|
-
return
|
|
1038
|
+
function zt() {
|
|
1039
|
+
return pe(Z, null);
|
|
1039
1040
|
}
|
|
1040
1041
|
//#endregion
|
|
1041
1042
|
//#region src/property-panel/fields/intrinsicSize.ts
|
|
1042
|
-
function
|
|
1043
|
+
function Bt(e, t) {
|
|
1043
1044
|
let n = e, r = t;
|
|
1044
1045
|
for (; r !== 0;) [n, r] = [r, n % r];
|
|
1045
1046
|
let i = e / n, a = t / n;
|
|
1046
1047
|
return Math.max(i, a) <= 32 ? `${i}:${a}` : `${Math.round(e / t * 100) / 100}:1`;
|
|
1047
1048
|
}
|
|
1048
|
-
function
|
|
1049
|
-
return !Number.isFinite(e) || !Number.isFinite(t) || e <= 0 || t <= 0 ? null : `${e}×${t} · ${
|
|
1049
|
+
function Vt(e, t) {
|
|
1050
|
+
return !Number.isFinite(e) || !Number.isFinite(t) || e <= 0 || t <= 0 ? null : `${e}×${t} · ${Bt(e, t)}`;
|
|
1050
1051
|
}
|
|
1051
1052
|
//#endregion
|
|
1052
1053
|
//#region src/property-panel/fields/TextField.vue?vue&type=script&setup=true&lang.ts
|
|
1053
|
-
var
|
|
1054
|
+
var Ht = ["value", "placeholder"], Q = /* @__PURE__ */ j({
|
|
1054
1055
|
__name: "TextField",
|
|
1055
1056
|
props: {
|
|
1056
1057
|
field: {},
|
|
@@ -1088,9 +1089,9 @@ var Vt = ["value", "placeholder"], Q = /* @__PURE__ */ j({
|
|
|
1088
1089
|
onCompositionstart: c,
|
|
1089
1090
|
onCompositionend: l,
|
|
1090
1091
|
onChange: u
|
|
1091
|
-
}, null, 42,
|
|
1092
|
+
}, null, 42, Ht));
|
|
1092
1093
|
}
|
|
1093
|
-
}),
|
|
1094
|
+
}), Ut = /* @__PURE__ */ j({
|
|
1094
1095
|
__name: "ResourceValueField",
|
|
1095
1096
|
props: {
|
|
1096
1097
|
field: {},
|
|
@@ -1106,10 +1107,10 @@ var Vt = ["value", "placeholder"], Q = /* @__PURE__ */ j({
|
|
|
1106
1107
|
return i.value ? b(e) ?? e : "";
|
|
1107
1108
|
});
|
|
1108
1109
|
function o(e) {
|
|
1109
|
-
let t =
|
|
1110
|
+
let t = x(e);
|
|
1110
1111
|
r("input", t), r("change", t);
|
|
1111
1112
|
}
|
|
1112
|
-
return (t, n) => i.value ? (P(), E(
|
|
1113
|
+
return (t, n) => i.value ? (P(), E(v, {
|
|
1113
1114
|
key: 0,
|
|
1114
1115
|
"model-value": a.value,
|
|
1115
1116
|
source: e.source ?? null,
|
|
@@ -1137,20 +1138,20 @@ var Vt = ["value", "placeholder"], Q = /* @__PURE__ */ j({
|
|
|
1137
1138
|
"disabled"
|
|
1138
1139
|
]));
|
|
1139
1140
|
}
|
|
1140
|
-
}),
|
|
1141
|
+
}), Wt = {
|
|
1141
1142
|
key: 0,
|
|
1142
1143
|
class: "flex flex-col gap-1.5"
|
|
1143
|
-
},
|
|
1144
|
+
}, Gt = [
|
|
1144
1145
|
"disabled",
|
|
1145
1146
|
"title",
|
|
1146
1147
|
"data-upload-error"
|
|
1147
|
-
],
|
|
1148
|
+
], Kt = ["src"], qt = {
|
|
1148
1149
|
key: 2,
|
|
1149
1150
|
class: "relative"
|
|
1150
|
-
},
|
|
1151
|
+
}, Jt = { class: "flex items-center gap-1.5" }, Yt = {
|
|
1151
1152
|
key: 0,
|
|
1152
1153
|
class: "cn-imagesrc__intrinsic text-[11px] leading-4 text-cn-muted"
|
|
1153
|
-
},
|
|
1154
|
+
}, Xt = /* @__PURE__ */ j({
|
|
1154
1155
|
__name: "ImageSrcField",
|
|
1155
1156
|
props: {
|
|
1156
1157
|
field: {},
|
|
@@ -1162,7 +1163,7 @@ var Vt = ["value", "placeholder"], Q = /* @__PURE__ */ j({
|
|
|
1162
1163
|
},
|
|
1163
1164
|
emits: ["input", "change"],
|
|
1164
1165
|
setup(e, { emit: t }) {
|
|
1165
|
-
let n = e, r = t, i =
|
|
1166
|
+
let n = e, r = t, i = zt(), a = T(() => i !== null && i.canUpload && n.dataMode !== "expression"), o = T(() => typeof n.modelValue == "string" && n.modelValue !== ""), s = T(() => n.resourceStatus === "pending" ? "装载中" : n.resourceStatus === "failed" ? "失败" : null), c = F(!1), l = F(null), u = F(null), d = F(null), f = T(() => d.value === null ? null : Vt(d.value.width, d.value.height));
|
|
1166
1167
|
function p(e) {
|
|
1167
1168
|
let t = e.target;
|
|
1168
1169
|
d.value = t.naturalWidth > 0 && t.naturalHeight > 0 ? {
|
|
@@ -1181,7 +1182,7 @@ var Vt = ["value", "placeholder"], Q = /* @__PURE__ */ j({
|
|
|
1181
1182
|
if (t.value = "", i !== null && n && !c.value) {
|
|
1182
1183
|
c.value = !0;
|
|
1183
1184
|
try {
|
|
1184
|
-
let e = await i.uploadImage(await
|
|
1185
|
+
let e = await i.uploadImage(await de(n));
|
|
1185
1186
|
e !== null && r("change", e);
|
|
1186
1187
|
} catch (e) {
|
|
1187
1188
|
l.value = e instanceof Error ? e.message : String(e);
|
|
@@ -1190,7 +1191,7 @@ var Vt = ["value", "placeholder"], Q = /* @__PURE__ */ j({
|
|
|
1190
1191
|
}
|
|
1191
1192
|
}
|
|
1192
1193
|
}
|
|
1193
|
-
return (t, n) => a.value ? (P(), O("div",
|
|
1194
|
+
return (t, n) => a.value ? (P(), O("div", Wt, [
|
|
1194
1195
|
k("button", {
|
|
1195
1196
|
type: "button",
|
|
1196
1197
|
class: "cn-imagesrc__thumb relative flex h-16 w-full items-center justify-center overflow-hidden rounded-md border border-dashed border-cn-field-line bg-cn-field/40 text-[11px] leading-none text-cn-muted transition-colors duration-100 hover:border-cn-muted/40 disabled:cursor-not-allowed disabled:opacity-40",
|
|
@@ -1206,13 +1207,13 @@ var Vt = ["value", "placeholder"], Q = /* @__PURE__ */ j({
|
|
|
1206
1207
|
alt: "",
|
|
1207
1208
|
onLoad: p,
|
|
1208
1209
|
onError: n[0] ||= (e) => d.value = null
|
|
1209
|
-
}, null, 40,
|
|
1210
|
+
}, null, 40, Kt)) : D("", !0),
|
|
1210
1211
|
s.value ? (P(), O("span", {
|
|
1211
1212
|
key: 1,
|
|
1212
1213
|
class: N(["cn-imagesrc__status absolute right-1 top-1 rounded bg-cn-bg-elevated/90 px-1 py-0.5 text-[10px] leading-none", e.resourceStatus === "failed" ? "text-red-400" : "text-cn-muted"])
|
|
1213
1214
|
}, R(s.value), 3)) : D("", !0),
|
|
1214
|
-
o.value ? D("", !0) : (P(), O("span",
|
|
1215
|
-
], 8,
|
|
1215
|
+
o.value ? D("", !0) : (P(), O("span", qt, R(c.value ? "…" : l.value ? "!" : "点击上传图片"), 1))
|
|
1216
|
+
], 8, Gt),
|
|
1216
1217
|
k("input", {
|
|
1217
1218
|
ref_key: "fileInput",
|
|
1218
1219
|
ref: u,
|
|
@@ -1221,7 +1222,7 @@ var Vt = ["value", "placeholder"], Q = /* @__PURE__ */ j({
|
|
|
1221
1222
|
accept: "image/*",
|
|
1222
1223
|
onChange: h
|
|
1223
1224
|
}, null, 544),
|
|
1224
|
-
k("div",
|
|
1225
|
+
k("div", Jt, [A(Q, {
|
|
1225
1226
|
class: "flex-1",
|
|
1226
1227
|
field: e.field,
|
|
1227
1228
|
"model-value": e.modelValue ?? "",
|
|
@@ -1239,8 +1240,8 @@ var Vt = ["value", "placeholder"], Q = /* @__PURE__ */ j({
|
|
|
1239
1240
|
title: "清除图片(资源地址置空)",
|
|
1240
1241
|
onClick: n[3] ||= (e) => r("change", "")
|
|
1241
1242
|
}, "清除")) : D("", !0)]),
|
|
1242
|
-
f.value ? (P(), O("span",
|
|
1243
|
-
])) : e.dataMode === "expression" ? (P(), E(
|
|
1243
|
+
f.value ? (P(), O("span", Yt, "源图 " + R(f.value), 1)) : D("", !0)
|
|
1244
|
+
])) : e.dataMode === "expression" ? (P(), E(Ut, {
|
|
1244
1245
|
key: 1,
|
|
1245
1246
|
field: e.field,
|
|
1246
1247
|
"model-value": e.modelValue,
|
|
@@ -1267,7 +1268,7 @@ var Vt = ["value", "placeholder"], Q = /* @__PURE__ */ j({
|
|
|
1267
1268
|
"aria-label"
|
|
1268
1269
|
]));
|
|
1269
1270
|
}
|
|
1270
|
-
}),
|
|
1271
|
+
}), Zt = [
|
|
1271
1272
|
"aria-label",
|
|
1272
1273
|
"min",
|
|
1273
1274
|
"max",
|
|
@@ -1308,9 +1309,9 @@ var Vt = ["value", "placeholder"], Q = /* @__PURE__ */ j({
|
|
|
1308
1309
|
let a = o(t);
|
|
1309
1310
|
i.value = String(a), r("change", a);
|
|
1310
1311
|
}
|
|
1311
|
-
return (t, n) =>
|
|
1312
|
+
return (t, n) => xe((P(), O("input", {
|
|
1312
1313
|
"onUpdate:modelValue": n[0] ||= (e) => i.value = e,
|
|
1313
|
-
class: N(["cn-field cn-field--number", z(
|
|
1314
|
+
class: N(["cn-field cn-field--number", z(X)]),
|
|
1314
1315
|
type: "number",
|
|
1315
1316
|
"aria-label": e.field.label,
|
|
1316
1317
|
min: e.field.min,
|
|
@@ -1320,9 +1321,9 @@ var Vt = ["value", "placeholder"], Q = /* @__PURE__ */ j({
|
|
|
1320
1321
|
onFocus: n[1] ||= (e) => a.value = !0,
|
|
1321
1322
|
onBlur: l,
|
|
1322
1323
|
onChange: l
|
|
1323
|
-
}, null, 42,
|
|
1324
|
+
}, null, 42, Zt)), [[ve, i.value]]);
|
|
1324
1325
|
}
|
|
1325
|
-
}),
|
|
1326
|
+
}), Qt = { class: "cn-padding flex w-full min-w-0 items-center gap-1.5" }, $t = { class: "w-5 shrink-0 select-none text-[10px] leading-none text-cn-muted" }, en = /* @__PURE__ */ j({
|
|
1326
1327
|
__name: "PaddingField",
|
|
1327
1328
|
props: {
|
|
1328
1329
|
field: {},
|
|
@@ -1350,14 +1351,14 @@ var Vt = ["value", "placeholder"], Q = /* @__PURE__ */ j({
|
|
|
1350
1351
|
lt(e, n.modelValue) || r("change", e);
|
|
1351
1352
|
}
|
|
1352
1353
|
}
|
|
1353
|
-
return (t, n) => (P(), O("span",
|
|
1354
|
+
return (t, n) => (P(), O("span", Qt, [A(bt, {
|
|
1354
1355
|
mode: z(i),
|
|
1355
1356
|
label: "内边距",
|
|
1356
1357
|
onCycle: l
|
|
1357
1358
|
}, null, 8, ["mode"]), k("span", { class: N(["grid min-w-0 flex-1 gap-1.5", z(i) === 1 ? "grid-cols-1" : "grid-cols-2"]) }, [(P(!0), O(w, null, I(o.value, (t) => (P(), O("label", {
|
|
1358
1359
|
key: t.rep,
|
|
1359
1360
|
class: "flex min-w-0 items-center gap-1.5"
|
|
1360
|
-
}, [k("span",
|
|
1361
|
+
}, [k("span", $t, R(t.label), 1), A($, {
|
|
1361
1362
|
class: "min-w-0 flex-1",
|
|
1362
1363
|
field: s(t),
|
|
1363
1364
|
"model-value": e.modelValue[t.rep],
|
|
@@ -1370,16 +1371,16 @@ var Vt = ["value", "placeholder"], Q = /* @__PURE__ */ j({
|
|
|
1370
1371
|
"onChange"
|
|
1371
1372
|
])]))), 128))], 2)]));
|
|
1372
1373
|
}
|
|
1373
|
-
}),
|
|
1374
|
+
}), tn = { class: "grid w-full min-w-0 grid-cols-2 gap-1" }, nn = ["title"], rn = { class: "w-3.5 shrink-0 select-none text-[10px] leading-none text-cn-muted" }, an = [
|
|
1374
1375
|
"aria-pressed",
|
|
1375
1376
|
"title",
|
|
1376
1377
|
"onClick"
|
|
1377
|
-
],
|
|
1378
|
+
], on = [
|
|
1378
1379
|
"aria-label",
|
|
1379
1380
|
"value",
|
|
1380
1381
|
"placeholder",
|
|
1381
1382
|
"title"
|
|
1382
|
-
],
|
|
1383
|
+
], sn = /* @__PURE__ */ j({
|
|
1383
1384
|
__name: "PairField",
|
|
1384
1385
|
props: {
|
|
1385
1386
|
field: {},
|
|
@@ -1395,7 +1396,7 @@ var Vt = ["value", "placeholder"], Q = /* @__PURE__ */ j({
|
|
|
1395
1396
|
let n = e, r = t, i = T(() => n.field.items ?? []);
|
|
1396
1397
|
function a(e) {
|
|
1397
1398
|
if (!e.auto) return !1;
|
|
1398
|
-
let t =
|
|
1399
|
+
let t = q(n.modelValue, e.auto.key);
|
|
1399
1400
|
return t.ok && t.value === !0;
|
|
1400
1401
|
}
|
|
1401
1402
|
function o(e) {
|
|
@@ -1418,7 +1419,7 @@ var Vt = ["value", "placeholder"], Q = /* @__PURE__ */ j({
|
|
|
1418
1419
|
r("sub-commit", s(e), !a(e), !0);
|
|
1419
1420
|
}
|
|
1420
1421
|
function u(e) {
|
|
1421
|
-
let t =
|
|
1422
|
+
let t = q(n.modelValue, e.key);
|
|
1422
1423
|
return t.ok && typeof t.value == "number" ? t.value : 0;
|
|
1423
1424
|
}
|
|
1424
1425
|
function d(e) {
|
|
@@ -1435,12 +1436,12 @@ var Vt = ["value", "placeholder"], Q = /* @__PURE__ */ j({
|
|
|
1435
1436
|
let t = d(e);
|
|
1436
1437
|
return t?.preview ? "模板子树:预览盒尺寸(随行实例变化,非文档声明值)" : t === void 0 ? `${e.label}自适应:已开启` : `${e.label}自适应:布局解析值(与画布选择框同源)`;
|
|
1437
1438
|
}
|
|
1438
|
-
return (e, t) => (P(), O("span",
|
|
1439
|
+
return (e, t) => (P(), O("span", tn, [(P(!0), O(w, null, I(i.value, (e) => (P(), O("label", {
|
|
1439
1440
|
key: e.key.join("."),
|
|
1440
1441
|
class: "flex min-w-0 items-center gap-1",
|
|
1441
1442
|
title: e.auto ? void 0 : e.label
|
|
1442
1443
|
}, [
|
|
1443
|
-
k("span",
|
|
1444
|
+
k("span", rn, R(e.label), 1),
|
|
1444
1445
|
e.auto ? (P(), O("button", {
|
|
1445
1446
|
key: 0,
|
|
1446
1447
|
type: "button",
|
|
@@ -1448,17 +1449,17 @@ var Vt = ["value", "placeholder"], Q = /* @__PURE__ */ j({
|
|
|
1448
1449
|
"aria-pressed": a(e),
|
|
1449
1450
|
title: p(e),
|
|
1450
1451
|
onClick: V((t) => l(e), ["prevent"])
|
|
1451
|
-
}, "自", 10,
|
|
1452
|
+
}, "自", 10, an)) : D("", !0),
|
|
1452
1453
|
a(e) ? (P(), O("input", {
|
|
1453
1454
|
key: 2,
|
|
1454
|
-
class: N(["cn-field cn-field--number min-w-0 flex-1", [z(
|
|
1455
|
+
class: N(["cn-field cn-field--number min-w-0 flex-1", [z(X), d(e)?.preview ? "cn-field--preview" : ""]]),
|
|
1455
1456
|
type: "number",
|
|
1456
1457
|
disabled: "",
|
|
1457
1458
|
"aria-label": e.label,
|
|
1458
1459
|
value: f(e),
|
|
1459
1460
|
placeholder: e.auto?.placeholder ?? "",
|
|
1460
1461
|
title: m(e)
|
|
1461
|
-
}, null, 10,
|
|
1462
|
+
}, null, 10, on)) : (P(), E($, {
|
|
1462
1463
|
key: 1,
|
|
1463
1464
|
class: "min-w-0 flex-1",
|
|
1464
1465
|
field: e,
|
|
@@ -1471,9 +1472,9 @@ var Vt = ["value", "placeholder"], Q = /* @__PURE__ */ j({
|
|
|
1471
1472
|
"onInput",
|
|
1472
1473
|
"onChange"
|
|
1473
1474
|
]))
|
|
1474
|
-
], 8,
|
|
1475
|
+
], 8, nn))), 128))]));
|
|
1475
1476
|
}
|
|
1476
|
-
}),
|
|
1477
|
+
}), cn = /* @__PURE__ */ j({
|
|
1477
1478
|
__name: "RowsPathField",
|
|
1478
1479
|
props: {
|
|
1479
1480
|
field: {},
|
|
@@ -1487,7 +1488,7 @@ var Vt = ["value", "placeholder"], Q = /* @__PURE__ */ j({
|
|
|
1487
1488
|
function r(e) {
|
|
1488
1489
|
n("input", e), n("change", e);
|
|
1489
1490
|
}
|
|
1490
|
-
return (t, n) => (P(), E(
|
|
1491
|
+
return (t, n) => (P(), E(v, {
|
|
1491
1492
|
mode: "rowsPath",
|
|
1492
1493
|
"model-value": e.modelValue,
|
|
1493
1494
|
source: e.source ?? null,
|
|
@@ -1502,7 +1503,7 @@ var Vt = ["value", "placeholder"], Q = /* @__PURE__ */ j({
|
|
|
1502
1503
|
"aria-label"
|
|
1503
1504
|
]));
|
|
1504
1505
|
}
|
|
1505
|
-
}),
|
|
1506
|
+
}), ln = ["value"], un = ["value"], dn = /* @__PURE__ */ j({
|
|
1506
1507
|
__name: "SelectField",
|
|
1507
1508
|
props: {
|
|
1508
1509
|
field: {},
|
|
@@ -1521,9 +1522,9 @@ var Vt = ["value", "placeholder"], Q = /* @__PURE__ */ j({
|
|
|
1521
1522
|
}, [(P(!0), O(w, null, I(e.field.domain ?? [], (t) => (P(), O("option", {
|
|
1522
1523
|
key: t,
|
|
1523
1524
|
value: t
|
|
1524
|
-
}, R(e.field.optionLabels?.[t] ?? t), 9,
|
|
1525
|
+
}, R(e.field.optionLabels?.[t] ?? t), 9, un))), 128))], 40, ln));
|
|
1525
1526
|
}
|
|
1526
|
-
}),
|
|
1527
|
+
}), fn = ["value", "disabled"], pn = /* @__PURE__ */ j({
|
|
1527
1528
|
__name: "TextareaField",
|
|
1528
1529
|
props: {
|
|
1529
1530
|
field: {},
|
|
@@ -1555,71 +1556,71 @@ var Vt = ["value", "placeholder"], Q = /* @__PURE__ */ j({
|
|
|
1555
1556
|
onCompositionstart: a,
|
|
1556
1557
|
onCompositionend: o,
|
|
1557
1558
|
onChange: s
|
|
1558
|
-
}, null, 42,
|
|
1559
|
+
}, null, 42, fn));
|
|
1559
1560
|
}
|
|
1560
|
-
}),
|
|
1561
|
+
}), mn = {
|
|
1561
1562
|
number: M($),
|
|
1562
1563
|
text: M(Q),
|
|
1563
|
-
textarea: M(
|
|
1564
|
-
color: M(
|
|
1565
|
-
select: M(
|
|
1564
|
+
textarea: M(pn),
|
|
1565
|
+
color: M(Rt),
|
|
1566
|
+
select: M(dn),
|
|
1566
1567
|
boolean: M(it),
|
|
1567
|
-
pair: M(
|
|
1568
|
+
pair: M(sn),
|
|
1568
1569
|
anchor: M(tt),
|
|
1569
1570
|
align: M(Ge),
|
|
1570
|
-
padding: M(
|
|
1571
|
-
border: M(
|
|
1572
|
-
font: M(
|
|
1573
|
-
imageSrc: M(
|
|
1574
|
-
resourceValue: M(
|
|
1575
|
-
rowsPath: M(
|
|
1571
|
+
padding: M(en),
|
|
1572
|
+
border: M(Et),
|
|
1573
|
+
font: M(Mt),
|
|
1574
|
+
imageSrc: M(Xt),
|
|
1575
|
+
resourceValue: M(Ut),
|
|
1576
|
+
rowsPath: M(cn)
|
|
1576
1577
|
};
|
|
1577
1578
|
//#endregion
|
|
1578
1579
|
//#region src/property-panel/usePropertyPanel.ts
|
|
1579
|
-
function
|
|
1580
|
+
function hn(e) {
|
|
1580
1581
|
let t = L(e.store.doc), n = L(e.store.ui.selection), r = L(e.store.ui.anchorExpanded), i = L(e.store.ui.dataSourceSchema), a = L(e.store.ui.resourceStatuses), o = L(e.store.ui.editing), s = e.subscribe((s) => {
|
|
1581
1582
|
s.scope === "doc" ? (t.value = e.store.doc, n.value = e.store.ui.selection, a.value = e.store.ui.resourceStatuses, o.value = e.store.ui.editing) : s.scope === "ui" && (s.branch === "selection" ? (n.value = e.store.ui.selection, e.store.closeMerge()) : s.branch === "anchorExpanded" ? r.value = e.store.ui.anchorExpanded : s.branch === "dataSourceSchema" ? i.value = e.store.ui.dataSourceSchema : s.branch === "resourceStatuses" ? a.value = e.store.ui.resourceStatuses : s.branch === "editing" && (o.value = e.store.ui.editing));
|
|
1582
1583
|
});
|
|
1583
|
-
|
|
1584
|
+
he(s, !0);
|
|
1584
1585
|
let c = T(() => {
|
|
1585
1586
|
let e = t.value, r = n.value;
|
|
1586
|
-
return e && r ?
|
|
1587
|
+
return e && r ? g(e, r) : null;
|
|
1587
1588
|
}), l = T(() => t.value), u = T(() => {
|
|
1588
1589
|
let e = c.value, r = n.value;
|
|
1589
|
-
return e && r ?
|
|
1590
|
+
return e && r ? Re(r, e) : t.value ? ze : [];
|
|
1590
1591
|
}), d = T(() => {
|
|
1591
1592
|
let r = n.value;
|
|
1592
1593
|
return r && t.value ? e.layerBoxAt(r) : null;
|
|
1593
1594
|
}), f = T(() => {
|
|
1594
1595
|
let e = i.value;
|
|
1595
|
-
return e === null ? null :
|
|
1596
|
-
}),
|
|
1596
|
+
return e === null ? null : re(e, le(e, t.value, n.value));
|
|
1597
|
+
}), p = T(() => ee(t.value, n.value, i.value)), m = T(() => te(p.value)), v = T(() => {
|
|
1597
1598
|
let e = c.value;
|
|
1598
|
-
return e === null || e.type !== "TableLayer" || e.template === null ? !1 :
|
|
1599
|
-
}),
|
|
1599
|
+
return e === null || e.type !== "TableLayer" || e.template === null ? !1 : _(p.value, e.rowsPath);
|
|
1600
|
+
}), y = T(() => n.value?.includes("template") ?? !1), b = T(() => {
|
|
1600
1601
|
let e = o.value, t = n.value;
|
|
1601
|
-
return e !== null && t !== null &&
|
|
1602
|
+
return e !== null && t !== null && h(e.path, t);
|
|
1602
1603
|
});
|
|
1603
|
-
function
|
|
1604
|
+
function ne(t) {
|
|
1604
1605
|
e.store.setAnchorExpanded(t);
|
|
1605
1606
|
}
|
|
1606
|
-
function
|
|
1607
|
+
function x(e) {
|
|
1607
1608
|
if (!e.data) return !1;
|
|
1608
|
-
if (
|
|
1609
|
+
if (b.value) return o.value?.expression === !0;
|
|
1609
1610
|
let t = c.value;
|
|
1610
1611
|
return t !== null && "expression" in t && t.expression !== null;
|
|
1611
1612
|
}
|
|
1612
|
-
function
|
|
1613
|
+
function S(r, i, a) {
|
|
1613
1614
|
if (!t.value) return;
|
|
1614
1615
|
let o = n.value;
|
|
1615
1616
|
if (!o) {
|
|
1616
1617
|
ie(r, i, a);
|
|
1617
1618
|
return;
|
|
1618
1619
|
}
|
|
1619
|
-
let s =
|
|
1620
|
+
let s = se(o, r.key);
|
|
1620
1621
|
if (r.data) {
|
|
1621
|
-
if (
|
|
1622
|
-
let t =
|
|
1622
|
+
if (x(r)) {
|
|
1623
|
+
let t = se(o, ["data", "expression"]);
|
|
1623
1624
|
e.updateDataExpression(o, i, { mergeKey: t }), a && e.store.closeMerge(t);
|
|
1624
1625
|
return;
|
|
1625
1626
|
}
|
|
@@ -1628,7 +1629,7 @@ function mn(e) {
|
|
|
1628
1629
|
}
|
|
1629
1630
|
e.updateSpec(o, r.key, i, { mergeKey: s }), a && e.store.closeMerge(s);
|
|
1630
1631
|
}
|
|
1631
|
-
function
|
|
1632
|
+
function C(t) {
|
|
1632
1633
|
let r = n.value;
|
|
1633
1634
|
r && t.data && e.toggleDataMode(r);
|
|
1634
1635
|
}
|
|
@@ -1645,7 +1646,7 @@ function mn(e) {
|
|
|
1645
1646
|
function ae(t, n, r) {
|
|
1646
1647
|
let i = t.key[1];
|
|
1647
1648
|
if (i !== "color" && i !== "image") return;
|
|
1648
|
-
let a = l.value?.background ??
|
|
1649
|
+
let a = l.value?.background ?? K, o = typeof n == "string" && n !== "" ? n : null, s = {
|
|
1649
1650
|
...a,
|
|
1650
1651
|
[i]: o
|
|
1651
1652
|
}, c = `canvas:background.${i}`;
|
|
@@ -1657,30 +1658,30 @@ function mn(e) {
|
|
|
1657
1658
|
canvas: l,
|
|
1658
1659
|
sections: u,
|
|
1659
1660
|
layerBox: d,
|
|
1660
|
-
isPreviewBox:
|
|
1661
|
+
isPreviewBox: y,
|
|
1661
1662
|
completionSource: f,
|
|
1662
|
-
rowsPathSource:
|
|
1663
|
-
rowsPathDrifted:
|
|
1663
|
+
rowsPathSource: m,
|
|
1664
|
+
rowsPathDrifted: v,
|
|
1664
1665
|
resourceStatuses: T(() => a.value),
|
|
1665
1666
|
anchorExpanded: T(() => r.value),
|
|
1666
|
-
contentLocked:
|
|
1667
|
+
contentLocked: b,
|
|
1667
1668
|
editingSession: T(() => o.value),
|
|
1668
|
-
isDataMarked:
|
|
1669
|
-
commit:
|
|
1670
|
-
toggleDataMode:
|
|
1671
|
-
setAnchorExpanded:
|
|
1669
|
+
isDataMarked: x,
|
|
1670
|
+
commit: S,
|
|
1671
|
+
toggleDataMode: C,
|
|
1672
|
+
setAnchorExpanded: ne
|
|
1672
1673
|
};
|
|
1673
1674
|
}
|
|
1674
1675
|
//#endregion
|
|
1675
1676
|
//#region src/property-panel/fields/ValueTypeSegmented.vue?vue&type=script&setup=true&lang.ts
|
|
1676
|
-
var
|
|
1677
|
+
var gn = ["aria-disabled"], _n = [
|
|
1677
1678
|
"aria-pressed",
|
|
1678
1679
|
"title",
|
|
1679
1680
|
"data-mode-static",
|
|
1680
1681
|
"data-mode-expression",
|
|
1681
1682
|
"disabled",
|
|
1682
1683
|
"onClick"
|
|
1683
|
-
],
|
|
1684
|
+
], vn = /* @__PURE__ */ j({
|
|
1684
1685
|
__name: "ValueTypeSegmented",
|
|
1685
1686
|
props: {
|
|
1686
1687
|
mode: {},
|
|
@@ -1715,15 +1716,15 @@ var hn = ["aria-disabled"], gn = [
|
|
|
1715
1716
|
"data-mode-expression": t.value === "expression" || void 0,
|
|
1716
1717
|
disabled: e.disabled,
|
|
1717
1718
|
onClick: V((e) => a(t.value), ["prevent"])
|
|
1718
|
-
}, R(t.label), 11,
|
|
1719
|
+
}, R(t.label), 11, _n)), 64))], 10, gn));
|
|
1719
1720
|
}
|
|
1720
|
-
}),
|
|
1721
|
+
}), yn = ["title"], bn = {
|
|
1721
1722
|
key: 2,
|
|
1722
1723
|
class: "cn-prop-field__hint col-span-2 block text-[11px] leading-4 text-cn-muted"
|
|
1723
|
-
},
|
|
1724
|
+
}, xn = ["title"], Sn = {
|
|
1724
1725
|
key: 4,
|
|
1725
1726
|
class: "cn-prop-field__hint col-span-2 block text-[11px] leading-4 text-cn-muted"
|
|
1726
|
-
},
|
|
1727
|
+
}, Cn = /* @__PURE__ */ j({
|
|
1727
1728
|
__name: "PropertyField",
|
|
1728
1729
|
props: {
|
|
1729
1730
|
field: {},
|
|
@@ -1743,7 +1744,7 @@ var hn = ["aria-disabled"], gn = [
|
|
|
1743
1744
|
"sub-commit"
|
|
1744
1745
|
],
|
|
1745
1746
|
setup(e, { emit: t }) {
|
|
1746
|
-
let n = e, r = t, i = T(() =>
|
|
1747
|
+
let n = e, r = t, i = T(() => mn[n.field.control]), a = T(() => n.dataMode === "expression"), o = T(() => n.field.control === "pair" ? "cn-prop-field block" : "cn-prop-field grid grid-cols-[60px_minmax(0,1fr)] items-center gap-x-2 gap-y-1.5"), s = T(() => n.field.data === !0 ? "col-span-2" : ""), c = T(() => n.field.data === !0 && n.field.control === "textarea"), l = T(() => n.field.control === "rowsPath"), u = T(() => n.field.resource === !0 || l.value), d = F(null), f = T(() => n.field.data === !0 && a.value && typeof n.value == "string" ? n.field.resource === !0 ? n.value === "" ? [] : ne(n.value) : c.value ? C(n.value) : [] : []), p = T(() => f.value.length === 0 ? "" : n.field.resource === !0 ? ue(n.completion != null) : ce(f.value)), m = T(() => (n.field.resource === !0 ? a.value : l.value) && n.completion == null && f.value.length === 0 ? S : ""), h = T(() => f.value.length > 0 || l.value && n.drifted === !0), g = T(() => n.field.control === "textarea");
|
|
1747
1748
|
function _() {
|
|
1748
1749
|
let e = f.value[0], t = d.value?.$el;
|
|
1749
1750
|
e !== void 0 && (t instanceof HTMLTextAreaElement || t instanceof HTMLInputElement) && (t.focus(), t.setSelectionRange(e.at.start, e.at.end));
|
|
@@ -1752,31 +1753,31 @@ var hn = ["aria-disabled"], gn = [
|
|
|
1752
1753
|
if (!c.value) return null;
|
|
1753
1754
|
let e = d.value?.$el;
|
|
1754
1755
|
return e instanceof HTMLTextAreaElement || e instanceof HTMLInputElement ? e : null;
|
|
1755
|
-
}), v = F(null),
|
|
1756
|
+
}), v = F(null), te = T(() => v.value?.rootEl ?? null), { popup: y, accept: b } = ae({
|
|
1756
1757
|
target: ee,
|
|
1757
1758
|
enabled: () => c.value && a.value && n.completion != null,
|
|
1758
1759
|
pairing: () => c.value && a.value,
|
|
1759
1760
|
resolve: (e) => n.completion?.(e) ?? null,
|
|
1760
|
-
popupEl:
|
|
1761
|
+
popupEl: te
|
|
1761
1762
|
});
|
|
1762
|
-
function
|
|
1763
|
+
function x(e, t, n) {
|
|
1763
1764
|
r("sub-commit", e, t, n);
|
|
1764
1765
|
}
|
|
1765
|
-
return (t, n) => (P(), O(w, null, [(P(), E(
|
|
1766
|
-
default:
|
|
1766
|
+
return (t, n) => (P(), O(w, null, [(P(), E(_e(e.field.control === "pair" || e.field.control === "imageSrc" ? "div" : "label"), { class: N(o.value) }, {
|
|
1767
|
+
default: be(() => [
|
|
1767
1768
|
e.field.control === "pair" ? D("", !0) : (P(), O("span", {
|
|
1768
1769
|
key: 0,
|
|
1769
1770
|
class: "cn-prop-field__label shrink-0 select-none truncate text-[11px] leading-none text-cn-muted",
|
|
1770
1771
|
title: e.field.title
|
|
1771
|
-
}, R(e.field.label), 9,
|
|
1772
|
-
e.field.data ? (P(), E(
|
|
1772
|
+
}, R(e.field.label), 9, yn)),
|
|
1773
|
+
e.field.data ? (P(), E(vn, {
|
|
1773
1774
|
key: 1,
|
|
1774
1775
|
class: "justify-self-end",
|
|
1775
1776
|
mode: e.dataMode ?? "static",
|
|
1776
1777
|
disabled: e.locked,
|
|
1777
1778
|
onChange: n[0] ||= (e) => r("toggle-mode")
|
|
1778
1779
|
}, null, 8, ["mode", "disabled"])) : D("", !0),
|
|
1779
|
-
(P(), E(
|
|
1780
|
+
(P(), E(_e(i.value), {
|
|
1780
1781
|
ref_key: "controlRef",
|
|
1781
1782
|
ref: d,
|
|
1782
1783
|
class: N(["cn-prop-field__control", [s.value, {
|
|
@@ -1792,7 +1793,7 @@ var hn = ["aria-disabled"], gn = [
|
|
|
1792
1793
|
"resource-status": e.field.control === "imageSrc" ? e.resourceStatus : void 0,
|
|
1793
1794
|
onInput: n[1] ||= (e) => r("input", e),
|
|
1794
1795
|
onChange: n[2] ||= (e) => r("change", e),
|
|
1795
|
-
onSubCommit:
|
|
1796
|
+
onSubCommit: x
|
|
1796
1797
|
}, null, 40, [
|
|
1797
1798
|
"class",
|
|
1798
1799
|
"field",
|
|
@@ -1803,33 +1804,33 @@ var hn = ["aria-disabled"], gn = [
|
|
|
1803
1804
|
"source",
|
|
1804
1805
|
"resource-status"
|
|
1805
1806
|
])),
|
|
1806
|
-
e.hint ? (P(), O("span",
|
|
1807
|
+
e.hint ? (P(), O("span", bn, R(e.hint), 1)) : D("", !0),
|
|
1807
1808
|
p.value ? (P(), O("span", {
|
|
1808
1809
|
key: 3,
|
|
1809
1810
|
class: N(["cn-prop-field__hint cn-prop-field__hint--error col-span-2 block text-[11px] leading-4 text-cn-danger", { "cursor-pointer": g.value }]),
|
|
1810
1811
|
title: g.value ? "点击选中出错片段" : void 0,
|
|
1811
1812
|
onClick: _
|
|
1812
|
-
}, R(p.value), 11,
|
|
1813
|
-
m.value ? (P(), O("span",
|
|
1813
|
+
}, R(p.value), 11, xn)) : D("", !0),
|
|
1814
|
+
m.value ? (P(), O("span", Sn, R(m.value), 1)) : D("", !0)
|
|
1814
1815
|
]),
|
|
1815
1816
|
_: 1
|
|
1816
|
-
}, 8, ["class"])), c.value ? (P(), E(
|
|
1817
|
+
}, 8, ["class"])), c.value ? (P(), E(oe, {
|
|
1817
1818
|
key: 0,
|
|
1818
1819
|
ref_key: "popupRef",
|
|
1819
1820
|
ref: v,
|
|
1820
|
-
state: z(
|
|
1821
|
-
onSelect: z(
|
|
1821
|
+
state: z(y),
|
|
1822
|
+
onSelect: z(b)
|
|
1822
1823
|
}, null, 8, ["state", "onSelect"])) : D("", !0)], 64));
|
|
1823
1824
|
}
|
|
1824
|
-
}),
|
|
1825
|
+
}), wn = { class: "cn-props flex w-[288px] shrink-0 flex-col overflow-y-auto rounded-xl border border-cn-line bg-cn-bg text-cn-fg shadow-(--cn-shadow-md)" }, Tn = { class: "sticky top-0 z-10 border-b border-cn-line bg-cn-bg-elevated/95 px-3.5 py-2.5 backdrop-blur-sm" }, En = { class: "flex items-center gap-2" }, Dn = { class: "inline-flex items-center gap-1.5 rounded border border-cn-accent/25 bg-cn-accent-soft px-1.5 py-0.5 font-mono text-[10px] leading-4 text-cn-accent" }, On = { class: "text-[12px] font-medium tracking-wide text-cn-fg/90" }, kn = {
|
|
1825
1826
|
key: 0,
|
|
1826
1827
|
class: "mx-3.5 my-4 rounded-lg border border-dashed border-cn-line px-3 py-6 text-center text-[11px] leading-5 text-cn-muted"
|
|
1827
|
-
},
|
|
1828
|
+
}, An = { class: "cn-props__section-title mb-2 text-[10px] font-semibold uppercase tracking-[0.16em] text-cn-muted" }, jn = { class: "flex flex-col gap-2" }, Mn = "内容编辑中:请在画布编辑框内修改,退出后此处更新", Nn = /* @__PURE__ */ j({
|
|
1828
1829
|
__name: "PropertyPanel",
|
|
1829
1830
|
props: { editor: {} },
|
|
1830
1831
|
setup(e) {
|
|
1831
|
-
let t = e, n =
|
|
1832
|
-
|
|
1832
|
+
let t = e, n = hn(t.editor);
|
|
1833
|
+
ge(Z, {
|
|
1833
1834
|
canUpload: t.editor.canUpload,
|
|
1834
1835
|
uploadImage: (e) => t.editor.uploadImage(e)
|
|
1835
1836
|
});
|
|
@@ -1840,13 +1841,13 @@ var hn = ["aria-disabled"], gn = [
|
|
|
1840
1841
|
let e = n.layer.value;
|
|
1841
1842
|
return e ? e.type : n.canvas.value ? "Canvas" : "—";
|
|
1842
1843
|
}), o = T(() => {
|
|
1843
|
-
let e = n.layer.value === null ? n.selection.value ? null :
|
|
1844
|
+
let e = n.layer.value === null ? n.selection.value ? null : Be(n.canvas.value) : Ve(n.layer.value);
|
|
1844
1845
|
if (!e) return [];
|
|
1845
1846
|
let t = n.selection.value?.join(".") ?? "canvas", r = n.layer.value, i = n.resourceStatuses.value, a = [];
|
|
1846
1847
|
for (let o of n.sections.value) {
|
|
1847
1848
|
let s = [];
|
|
1848
1849
|
for (let a of o.fields) {
|
|
1849
|
-
let o =
|
|
1850
|
+
let o = q(e, a.key);
|
|
1850
1851
|
if (!o.ok) continue;
|
|
1851
1852
|
let c = n.contentLocked.value && a.data === !0;
|
|
1852
1853
|
s.push({
|
|
@@ -1855,7 +1856,7 @@ var hn = ["aria-disabled"], gn = [
|
|
|
1855
1856
|
value: o.value,
|
|
1856
1857
|
dataMode: a.data ? n.isDataMarked(a) ? "expression" : "static" : void 0,
|
|
1857
1858
|
locked: c,
|
|
1858
|
-
hint: c ?
|
|
1859
|
+
hint: c ? Mn : a.hint && r ? a.hint(r, i) ?? void 0 : void 0,
|
|
1859
1860
|
resourceStatus: a.control === "imageSrc" && typeof o.value == "string" && o.value !== "" ? i[o.value] : void 0,
|
|
1860
1861
|
drifted: a.control === "rowsPath" ? n.rowsPathDrifted.value : void 0
|
|
1861
1862
|
});
|
|
@@ -1883,16 +1884,16 @@ var hn = ["aria-disabled"], gn = [
|
|
|
1883
1884
|
function c() {
|
|
1884
1885
|
n.setAnchorExpanded(!n.anchorExpanded.value);
|
|
1885
1886
|
}
|
|
1886
|
-
return (e, t) => (P(), O("aside",
|
|
1887
|
-
k("header",
|
|
1887
|
+
return (e, t) => (P(), O("aside", wn, [
|
|
1888
|
+
k("header", Tn, [k("div", En, [k("span", Dn, [t[0] ||= k("i", {
|
|
1888
1889
|
class: "size-1.5 rounded-full bg-cn-accent",
|
|
1889
1890
|
"aria-hidden": "true"
|
|
1890
|
-
}, null, -1),
|
|
1891
|
-
o.value.length === 0 ? (P(), O("p",
|
|
1891
|
+
}, null, -1), fe(" " + R(a.value), 1)]), k("span", On, R(i.value ? "图层属性" : "画布属性"), 1)])]),
|
|
1892
|
+
o.value.length === 0 ? (P(), O("p", kn, " 打开文档后可编辑属性 ")) : D("", !0),
|
|
1892
1893
|
(P(!0), O(w, null, I(o.value, (e) => (P(), O("section", {
|
|
1893
1894
|
key: e.title,
|
|
1894
1895
|
class: "cn-props__section border-b border-cn-line/70 px-3.5 py-3 last:border-b-0"
|
|
1895
|
-
}, [k("h3",
|
|
1896
|
+
}, [k("h3", An, R(e.title), 1), k("div", jn, [(P(!0), O(w, null, I(e.fields, (e) => (P(), O(w, { key: e.key }, [e.field.control === "anchor" ? (P(), E(tt, {
|
|
1896
1897
|
key: 0,
|
|
1897
1898
|
field: e.field,
|
|
1898
1899
|
"model-value": e.value,
|
|
@@ -1904,7 +1905,7 @@ var hn = ["aria-disabled"], gn = [
|
|
|
1904
1905
|
"model-value",
|
|
1905
1906
|
"expanded",
|
|
1906
1907
|
"onChange"
|
|
1907
|
-
])) : (P(), E(
|
|
1908
|
+
])) : (P(), E(Cn, {
|
|
1908
1909
|
key: 1,
|
|
1909
1910
|
field: e.field,
|
|
1910
1911
|
value: e.value,
|
|
@@ -1938,4 +1939,4 @@ var hn = ["aria-disabled"], gn = [
|
|
|
1938
1939
|
}
|
|
1939
1940
|
});
|
|
1940
1941
|
//#endregion
|
|
1941
|
-
export { Z as a,
|
|
1942
|
+
export { Z as a, Pe as c, Ie as d, q as f, mn as i, Re as l, Cn as n, zt as o, hn as r, ze as s, Nn as t, Fe as u };
|