@hankchen/canvas-editor-vue 0.5.0 → 0.6.1

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.
@@ -2,11 +2,11 @@ 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
3
  import { a as p, i as m, r as h } from "./layerPath-uy2ywyld.js";
4
4
  import { o as g, s as _ } from "./popupPosition-Ck5Gsvjy.js";
5
- import { a as ee, c as v, i as y, l as b, n as x, s as S, t as C, u as w } from "./uploadFile-D1RY-ji0.js";
6
- import { a as te, n as ne, r as re, t as ie } from "./resourceTemplate-cdcQtp9a.js";
7
- import { n as ae, r as oe, t as se } from "./usePathCompletion-Do17CQ6l.js";
8
- import { Fragment as T, computed as E, createBlock as D, createCommentVNode as O, createElementBlock as k, createElementVNode as A, createTextVNode as ce, createVNode as j, defineComponent as M, inject as le, markRaw as N, nextTick as ue, normalizeClass as P, onScopeDispose as de, openBlock as F, provide as fe, ref as I, renderList as L, resolveDynamicComponent as pe, shallowRef as R, toDisplayString as z, unref as B, vModelText as me, watch as V, watchEffect as he, withCtx as ge, withDirectives as _e, withModifiers as H } from "vue";
9
- var ve = e({
5
+ import { a as ee, n as v, r as y, t as b } from "./resourceTemplate-cdcQtp9a.js";
6
+ import { a as te, d as x, f as ne, i as re, l as ie, n as S, o as ae, s as oe, t as C, u as se } from "./uploadFile-DbB-KhII.js";
7
+ import { n as ce, r as le, t as ue } from "./usePathCompletion-Do17CQ6l.js";
8
+ import { Fragment as w, computed as T, createBlock as E, createCommentVNode as D, createElementBlock as O, createElementVNode as k, createTextVNode as de, createVNode as A, defineComponent as j, inject as fe, markRaw as M, nextTick as pe, normalizeClass as N, onScopeDispose as me, openBlock as P, provide as he, ref as F, renderList as I, resolveDynamicComponent as ge, shallowRef as L, toDisplayString as R, unref as z, vModelText as _e, watch as B, watchEffect as ve, withCtx as ye, withDirectives as be, withModifiers as V } from "vue";
9
+ var xe = e({
10
10
  name: "grid-2x2",
11
11
  size: 24,
12
12
  node: [
@@ -28,7 +28,7 @@ var ve = e({
28
28
  }]
29
29
  ],
30
30
  aliases: ["grid-2-x-2"]
31
- }), ye = e({
31
+ }), Se = e({
32
32
  name: "square-split-vertical",
33
33
  size: 24,
34
34
  node: [
@@ -46,7 +46,7 @@ var ve = e({
46
46
  }]
47
47
  ],
48
48
  aliases: ["split-square-vertical"]
49
- }), be = e({
49
+ }), Ce = e({
50
50
  name: "square",
51
51
  size: 24,
52
52
  node: [["rect", {
@@ -60,7 +60,7 @@ var ve = e({
60
60
  });
61
61
  //#endregion
62
62
  //#region ../canvas-editor/src/shared/resourceStatus.ts
63
- function xe(e, n) {
63
+ function we(e, n) {
64
64
  if (e.type !== "ImageLayer") return !1;
65
65
  if (e.expression !== null || e.src === null || t(e) <= 0 || a(e) <= 0) return !0;
66
66
  if (n !== void 0) {
@@ -71,7 +71,7 @@ function xe(e, n) {
71
71
  }
72
72
  //#endregion
73
73
  //#region src/property-panel/fieldSchema.ts
74
- var Se = "当前层内容未绘制,padding 不影响预览", U = {
74
+ var Te = "当前层内容未绘制,padding 不影响预览", H = {
75
75
  title: "位置与尺寸",
76
76
  fields: [
77
77
  {
@@ -126,7 +126,7 @@ var Se = "当前层内容未绘制,padding 不影响预览", U = {
126
126
  control: "anchor"
127
127
  }
128
128
  ]
129
- }, W = {
129
+ }, U = {
130
130
  title: "对齐",
131
131
  fields: [{
132
132
  key: ["align", "horizontal"],
@@ -139,7 +139,7 @@ var Se = "当前层内容未绘制,padding 不影响预览", U = {
139
139
  control: "align",
140
140
  domain: l
141
141
  }]
142
- }, G = {
142
+ }, W = {
143
143
  title: "形状",
144
144
  fields: [
145
145
  {
@@ -161,7 +161,7 @@ var Se = "当前层内容未绘制,padding 不影响预览", U = {
161
161
  label: "内边距",
162
162
  control: "padding",
163
163
  title: "内边距作用于内容盒,不改变图层尺寸",
164
- hint: (e, t) => xe(e, t) ? Se : null
164
+ hint: (e, t) => we(e, t) ? Te : null
165
165
  },
166
166
  {
167
167
  key: ["shape", "border"],
@@ -169,11 +169,11 @@ var Se = "当前层内容未绘制,padding 不影响预览", U = {
169
169
  control: "border"
170
170
  }
171
171
  ]
172
- }, Ce = {
172
+ }, Ee = {
173
173
  ImageLayer: [
174
+ H,
174
175
  U,
175
176
  W,
176
- G,
177
177
  {
178
178
  title: "图片",
179
179
  fields: [{
@@ -186,9 +186,9 @@ var Se = "当前层内容未绘制,padding 不影响预览", U = {
186
186
  }
187
187
  ],
188
188
  TextLayer: [
189
+ H,
189
190
  U,
190
191
  W,
191
- G,
192
192
  {
193
193
  title: "文本",
194
194
  fields: [
@@ -224,9 +224,9 @@ var Se = "当前层内容未绘制,padding 不影响预览", U = {
224
224
  }
225
225
  ],
226
226
  QrCodeLayer: [
227
+ H,
227
228
  U,
228
229
  W,
229
- G,
230
230
  {
231
231
  title: "二维码",
232
232
  fields: [{
@@ -239,9 +239,9 @@ var Se = "当前层内容未绘制,padding 不影响预览", U = {
239
239
  }
240
240
  ],
241
241
  TableLayer: [
242
+ H,
242
243
  U,
243
244
  W,
244
- G,
245
245
  {
246
246
  title: "数据",
247
247
  fields: [{
@@ -256,14 +256,14 @@ var Se = "当前层内容未绘制,padding 不影响预览", U = {
256
256
  }
257
257
  ],
258
258
  TableRowLayer: [
259
+ H,
259
260
  U,
260
- W,
261
- G
261
+ W
262
262
  ],
263
263
  TableCellLayer: [
264
+ H,
264
265
  U,
265
- W,
266
- G
266
+ W
267
267
  ],
268
268
  TableRowTemplate: [{
269
269
  title: "行模板(行宽由表宽同步)",
@@ -280,15 +280,15 @@ var Se = "当前层内容未绘制,padding 不影响预览", U = {
280
280
  }]
281
281
  }]
282
282
  };
283
- function we(e) {
284
- return Ce[e] ?? [];
283
+ function De(e) {
284
+ return Ee[e] ?? [];
285
285
  }
286
- function Te(e) {
286
+ function Oe(e) {
287
287
  if (e[e.length - 1] === "content") return h(e) ? "templateContent" : "content";
288
288
  let t = e[e.length - 2];
289
289
  return t === "rows" ? "row" : t === "cells" ? "cell" : "root";
290
290
  }
291
- var Ee = {
291
+ var ke = {
292
292
  root: [],
293
293
  cell: [],
294
294
  row: ["shape.width", "shape.autoWidth"],
@@ -300,16 +300,16 @@ var Ee = {
300
300
  ],
301
301
  templateContent: ["shape.width", "shape.autoWidth"]
302
302
  };
303
- function K(e, t) {
303
+ function G(e, t) {
304
304
  return [...e.key, ...t.key];
305
305
  }
306
- function De(e, t) {
307
- let n = new Set(Ee[Te(e)]), r = [];
308
- for (let e of we(t.type)) {
306
+ function Ae(e, t) {
307
+ let n = new Set(ke[Oe(e)]), r = [];
308
+ for (let e of De(t.type)) {
309
309
  let i = [];
310
310
  for (let r of e.fields) {
311
311
  if (r.items) {
312
- let e = r.items.filter((e) => !n.has(K(r, e).join(".")) && (!e.visibleWhen || e.visibleWhen(t)));
312
+ let e = r.items.filter((e) => !n.has(G(r, e).join(".")) && (!e.visibleWhen || e.visibleWhen(t)));
313
313
  e.length > 0 && i.push({
314
314
  ...r,
315
315
  items: e
@@ -325,7 +325,7 @@ function De(e, t) {
325
325
  }
326
326
  return r;
327
327
  }
328
- var Oe = [{
328
+ var je = [{
329
329
  title: "画布",
330
330
  fields: [{
331
331
  key: ["width"],
@@ -341,7 +341,7 @@ var Oe = [{
341
341
  min: 1
342
342
  }]
343
343
  }];
344
- function q(e, t) {
344
+ function K(e, t) {
345
345
  let n = e;
346
346
  for (let e = 0; e < t.length; e += 1) {
347
347
  if (typeof n != "object" || !n) return { ok: !1 };
@@ -354,14 +354,14 @@ function q(e, t) {
354
354
  }
355
355
  //#endregion
356
356
  //#region src/property-panel/fields/AlignField.vue?vue&type=script&setup=true&lang.ts
357
- var ke = ["aria-label"], Ae = [
357
+ var Me = ["aria-label"], Ne = [
358
358
  "aria-pressed",
359
359
  "title",
360
360
  "onClick"
361
- ], je = {
361
+ ], Pe = {
362
362
  key: 1,
363
363
  class: "truncate px-1 text-[10px] leading-none"
364
- }, Me = /* @__PURE__ */ M({
364
+ }, Fe = /* @__PURE__ */ j({
365
365
  __name: "AlignField",
366
366
  props: {
367
367
  field: {},
@@ -398,7 +398,7 @@ var ke = ["aria-label"], Ae = [
398
398
  title: "底对齐"
399
399
  }
400
400
  }
401
- }, p = E(() => {
401
+ }, p = T(() => {
402
402
  let e = a.field.domain ?? [], t = d[e.join(".")];
403
403
  return e.map((e) => ({
404
404
  value: e,
@@ -409,42 +409,42 @@ var ke = ["aria-label"], Ae = [
409
409
  function m(e) {
410
410
  e !== a.modelValue && u("change", e);
411
411
  }
412
- return (t, n) => (F(), k("span", {
412
+ return (t, n) => (P(), O("span", {
413
413
  class: "cn-align flex h-7 min-w-0 flex-1 overflow-hidden rounded-md border border-cn-field-line bg-cn-field",
414
414
  role: "group",
415
415
  "aria-label": e.field.label
416
- }, [(F(!0), k(T, null, L(p.value, (t, n) => (F(), k("button", {
416
+ }, [(P(!0), O(w, null, I(p.value, (t, n) => (P(), O("button", {
417
417
  key: t.value,
418
418
  type: "button",
419
- class: P(["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"]]),
419
+ 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"]]),
420
420
  "aria-pressed": t.value === e.modelValue,
421
421
  title: t.title,
422
- onClick: H((e) => m(t.value), ["prevent"])
423
- }, [t.icon ? (F(), D(_, {
422
+ onClick: V((e) => m(t.value), ["prevent"])
423
+ }, [t.icon ? (P(), E(_, {
424
424
  key: 0,
425
425
  icon: t.icon
426
- }, null, 8, ["icon"])) : (F(), k("span", je, z(t.value), 1))], 10, Ae))), 128))], 8, ke));
426
+ }, null, 8, ["icon"])) : (P(), O("span", Pe, R(t.value), 1))], 10, Ne))), 128))], 8, Me));
427
427
  }
428
- }), Ne = { class: "block" }, Pe = ["aria-expanded", "title"], Fe = { class: "cn-prop-field__label shrink-0 select-none truncate text-[11px] leading-none text-cn-muted" }, Ie = { class: "flex shrink-0 items-center gap-1.5" }, Le = {
428
+ }), Ie = { class: "block" }, Le = ["aria-expanded", "title"], Re = { class: "cn-prop-field__label shrink-0 select-none truncate text-[11px] leading-none text-cn-muted" }, ze = { class: "flex shrink-0 items-center gap-1.5" }, Be = {
429
429
  viewBox: "0 0 24 24",
430
430
  class: "size-3.5",
431
431
  "aria-hidden": "true"
432
- }, Re = [
432
+ }, Ve = [
433
433
  "cx",
434
434
  "cy",
435
435
  "r"
436
- ], ze = {
436
+ ], He = {
437
437
  key: 0,
438
438
  class: "mt-2 flex justify-end"
439
- }, Be = {
439
+ }, Ue = {
440
440
  class: "cn-anchor grid w-[66px] shrink-0 grid-cols-3 gap-[3px]",
441
441
  role: "group",
442
442
  "aria-label": "九宫锚点"
443
- }, Ve = [
443
+ }, We = [
444
444
  "aria-pressed",
445
445
  "title",
446
446
  "onClick"
447
- ], He = /* @__PURE__ */ M({
447
+ ], Ge = /* @__PURE__ */ j({
448
448
  __name: "AnchorDisclosureField",
449
449
  props: {
450
450
  field: {},
@@ -453,42 +453,42 @@ var ke = ["aria-label"], Ae = [
453
453
  },
454
454
  emits: ["change", "toggle"],
455
455
  setup(e, { emit: t }) {
456
- let n = e, r = t, i = N(d), a = Array.from({ length: 9 }, (e, t) => ({
456
+ let n = e, r = t, i = M(d), a = Array.from({ length: 9 }, (e, t) => ({
457
457
  index: t,
458
458
  cx: 4 + t % 3 * 8,
459
459
  cy: 4 + Math.floor(t / 3) * 8
460
- })), o = E(() => {
460
+ })), o = T(() => {
461
461
  let e = n.modelValue.includes("top") ? 0 : n.modelValue.includes("bottom") ? 2 : 1, t = n.modelValue.includes("left") ? 0 : n.modelValue.includes("right") ? 2 : 1;
462
462
  return e * 3 + t;
463
463
  });
464
464
  function s(e) {
465
465
  r("change", e);
466
466
  }
467
- return (t, n) => (F(), k("span", Ne, [A("button", {
467
+ return (t, n) => (P(), O("span", Ie, [k("button", {
468
468
  type: "button",
469
469
  class: "cn-anchor-disclosure__header flex w-full items-center justify-between gap-2",
470
470
  "aria-expanded": e.expanded,
471
471
  title: e.expanded ? "收起锚点" : `锚点:${e.modelValue}(点击展开调整)`,
472
472
  onClick: n[0] ||= (e) => r("toggle")
473
- }, [A("span", Fe, z(e.field.label), 1), A("span", Ie, [(F(), k("svg", Le, [(F(!0), k(T, null, L(B(a), (e) => (F(), k("circle", {
473
+ }, [k("span", Re, R(e.field.label), 1), k("span", ze, [(P(), O("svg", Be, [(P(!0), O(w, null, I(z(a), (e) => (P(), O("circle", {
474
474
  key: e.index,
475
475
  cx: e.cx,
476
476
  cy: e.cy,
477
477
  r: e.index === o.value ? 3.2 : 2.2,
478
- class: P(e.index === o.value ? "fill-cn-accent" : "fill-cn-muted/35")
479
- }, null, 10, Re))), 128))])), j(_, {
480
- icon: B(u),
481
- class: P(["text-cn-muted transition-transform duration-150", { "rotate-180": e.expanded }])
482
- }, null, 8, ["icon", "class"])])], 8, Pe), e.expanded ? (F(), k("span", ze, [A("span", Be, [(F(!0), k(T, null, L(B(i), (t) => (F(), k("button", {
478
+ class: N(e.index === o.value ? "fill-cn-accent" : "fill-cn-muted/35")
479
+ }, null, 10, Ve))), 128))])), A(_, {
480
+ icon: z(u),
481
+ class: N(["text-cn-muted transition-transform duration-150", { "rotate-180": e.expanded }])
482
+ }, null, 8, ["icon", "class"])])], 8, Le), e.expanded ? (P(), O("span", He, [k("span", Ue, [(P(!0), O(w, null, I(z(i), (t) => (P(), O("button", {
483
483
  key: t,
484
484
  type: "button",
485
- class: P(["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-[0_0_8px_rgba(56,189,248,0.35)]" : "border-cn-field-line bg-cn-field hover:border-cn-muted/50"]),
485
+ 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-[0_0_8px_rgba(56,189,248,0.35)]" : "border-cn-field-line bg-cn-field hover:border-cn-muted/50"]),
486
486
  "aria-pressed": t === e.modelValue,
487
487
  title: t,
488
488
  onClick: (e) => s(t)
489
- }, null, 10, Ve))), 128))])])) : O("", !0)]));
489
+ }, null, 10, We))), 128))])])) : D("", !0)]));
490
490
  }
491
- }), Ue = { class: "cn-bool relative inline-flex h-4 w-7 shrink-0 cursor-pointer items-center" }, We = ["checked"], Ge = /* @__PURE__ */ M({
491
+ }), Ke = { class: "cn-bool relative inline-flex h-4 w-7 shrink-0 cursor-pointer items-center" }, qe = ["checked"], Je = /* @__PURE__ */ j({
492
492
  __name: "BooleanField",
493
493
  props: {
494
494
  field: {},
@@ -496,26 +496,26 @@ var ke = ["aria-label"], Ae = [
496
496
  },
497
497
  emits: ["input", "change"],
498
498
  setup(e, { emit: t }) {
499
- let n = e, r = t, i = I(null);
499
+ let n = e, r = t, i = F(null);
500
500
  async function a(e) {
501
- r("change", e.target.checked), await ue(), i.value && (i.value.checked = n.modelValue);
501
+ r("change", e.target.checked), await pe(), i.value && (i.value.checked = n.modelValue);
502
502
  }
503
- return he(() => {
503
+ return ve(() => {
504
504
  i.value && (i.value.checked = n.modelValue);
505
- }), (t, n) => (F(), k("label", Ue, [
506
- A("input", {
505
+ }), (t, n) => (P(), O("label", Ke, [
506
+ k("input", {
507
507
  ref_key: "inputRef",
508
508
  ref: i,
509
509
  class: "cn-bool__input peer sr-only",
510
510
  type: "checkbox",
511
511
  checked: e.modelValue,
512
512
  onChange: a
513
- }, null, 40, We),
514
- n[0] ||= A("span", { class: "absolute inset-0 rounded-full border border-cn-field-line bg-cn-field transition-colors duration-150 peer-checked:border-cn-accent/60 peer-checked:bg-cn-accent/30 peer-focus-visible:ring-[3px] peer-focus-visible:ring-cn-accent/20" }, null, -1),
515
- n[1] ||= A("span", { class: "relative mx-0.5 size-3 rounded-full bg-cn-muted shadow-sm transition-transform duration-150 peer-checked:translate-x-3 peer-checked:bg-cn-accent" }, null, -1)
513
+ }, null, 40, qe),
514
+ n[0] ||= k("span", { class: "absolute inset-0 rounded-full border border-cn-field-line bg-cn-field transition-colors duration-150 peer-checked:border-cn-accent/60 peer-checked:bg-cn-accent/30 peer-focus-visible:ring-[3px] peer-focus-visible:ring-cn-accent/20" }, null, -1),
515
+ n[1] ||= k("span", { class: "relative mx-0.5 size-3 rounded-full bg-cn-muted shadow-sm transition-transform duration-150 peer-checked:translate-x-3 peer-checked:bg-cn-accent" }, null, -1)
516
516
  ]));
517
517
  }
518
- }), Ke = {
518
+ }), Ye = {
519
519
  1: [{
520
520
  label: "四边",
521
521
  rep: "top",
@@ -558,13 +558,13 @@ var ke = ["aria-label"], Ae = [
558
558
  }
559
559
  ]
560
560
  };
561
- function qe(e) {
561
+ function Xe(e) {
562
562
  return e === 1 ? 2 : e === 2 ? 4 : 1;
563
563
  }
564
- function Je(e) {
564
+ function Ze(e) {
565
565
  return e.top === e.bottom && e.bottom === e.left && e.left === e.right ? 1 : e.top === e.bottom && e.left === e.right ? 2 : 4;
566
566
  }
567
- function Ye(e, t) {
567
+ function Qe(e, t) {
568
568
  if (t === 1) {
569
569
  let { top: t } = e;
570
570
  return {
@@ -585,17 +585,17 @@ function Ye(e, t) {
585
585
  }
586
586
  return e;
587
587
  }
588
- function Xe(e, t) {
588
+ function $e(e, t) {
589
589
  return e.top === t.top && e.bottom === t.bottom && e.left === t.left && e.right === t.right;
590
590
  }
591
- function J(e, t) {
591
+ function q(e, t) {
592
592
  return e === null || t === null ? e === t : e.width === t.width && e.color === t.color;
593
593
  }
594
- function Ze(e) {
594
+ function et(e) {
595
595
  let { top: t, bottom: n, left: r, right: i } = e;
596
- 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;
596
+ return t === null && n === null && r === null && i === null || t !== null && q(t, n) && q(t, r) && q(t, i) ? 1 : q(t, n) && q(r, i) ? 2 : 4;
597
597
  }
598
- function Qe(e, t) {
598
+ function tt(e, t) {
599
599
  let n = (e) => e === null ? null : { ...e };
600
600
  if (t === 1) {
601
601
  let t = n(e.top);
@@ -617,18 +617,18 @@ function Qe(e, t) {
617
617
  }
618
618
  return e;
619
619
  }
620
- function $e(e, t) {
621
- return J(e.top, t.top) && J(e.bottom, t.bottom) && J(e.left, t.left) && J(e.right, t.right);
620
+ function nt(e, t) {
621
+ return q(e.top, t.top) && q(e.bottom, t.bottom) && q(e.left, t.left) && q(e.right, t.right);
622
622
  }
623
623
  //#endregion
624
624
  //#region src/property-panel/useShorthandMode.ts
625
- function et(e, t) {
626
- let n = E(() => t(e())), r = I(null), i = E(() => r.value ?? n.value);
627
- V(e, () => {
625
+ function rt(e, t) {
626
+ let n = T(() => t(e())), r = F(null), i = T(() => r.value ?? n.value);
627
+ B(e, () => {
628
628
  r.value = null;
629
629
  });
630
630
  function a() {
631
- let e = i.value, t = qe(e);
631
+ let e = i.value, t = Xe(e);
632
632
  return r.value = t, {
633
633
  from: e,
634
634
  to: t
@@ -641,7 +641,7 @@ function et(e, t) {
641
641
  }
642
642
  //#endregion
643
643
  //#region src/property-panel/controlStyles.ts
644
- 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`, tt = Y, nt = "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", rt = "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", it = ["aria-label"], at = /* @__PURE__ */ M({
644
+ var J = "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", Y = `${J} text-right font-mono tabular-nums`, it = J, at = "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", ot = "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", st = ["aria-label"], ct = /* @__PURE__ */ j({
645
645
  __name: "BorderWidthInput",
646
646
  props: {
647
647
  value: {},
@@ -649,8 +649,8 @@ var Y = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
649
649
  },
650
650
  emits: ["input", "change"],
651
651
  setup(e, { emit: t }) {
652
- let n = e, r = t, i = I(n.value === null ? "" : String(n.value)), a = I(!1);
653
- V(() => n.value, (e) => {
652
+ let n = e, r = t, i = F(n.value === null ? "" : String(n.value)), a = F(!1);
653
+ B(() => n.value, (e) => {
654
654
  a.value || (i.value = e === null ? "" : String(e));
655
655
  });
656
656
  function o(e) {
@@ -679,9 +679,9 @@ var Y = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
679
679
  let a = o(t);
680
680
  i.value = a === 0 ? "" : String(a), r("change", a);
681
681
  }
682
- return (t, n) => _e((F(), k("input", {
682
+ return (t, n) => be((P(), O("input", {
683
683
  "onUpdate:modelValue": n[0] ||= (e) => i.value = e,
684
- class: P(["cn-field cn-field--number min-w-0 flex-1", B(X)]),
684
+ class: N(["cn-field cn-field--number min-w-0 flex-1", z(Y)]),
685
685
  type: "number",
686
686
  "aria-label": e.label,
687
687
  min: 0,
@@ -692,9 +692,9 @@ var Y = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
692
692
  onFocus: n[1] ||= (e) => a.value = !0,
693
693
  onBlur: u,
694
694
  onChange: u
695
- }, null, 42, it)), [[me, i.value]]);
695
+ }, null, 42, st)), [[_e, i.value]]);
696
696
  }
697
- }), ot = ["aria-label", "title"], st = /* @__PURE__ */ M({
697
+ }), lt = ["aria-label", "title"], ut = /* @__PURE__ */ j({
698
698
  __name: "ShorthandModeButton",
699
699
  props: {
700
700
  mode: {},
@@ -704,35 +704,35 @@ var Y = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
704
704
  setup(e, { emit: t }) {
705
705
  let n = e, r = t, i = {
706
706
  1: {
707
- icon: be,
707
+ icon: Ce,
708
708
  title: "统一值"
709
709
  },
710
710
  2: {
711
- icon: ye,
711
+ icon: Se,
712
712
  title: "上下/左右"
713
713
  },
714
714
  4: {
715
- icon: ve,
715
+ icon: xe,
716
716
  title: "四边独立"
717
717
  }
718
- }, a = E(() => i[n.mode]), o = E(() => `${n.label}:${a.value.title}(点击切换值模式)`);
719
- return (e, t) => (F(), k("button", {
718
+ }, a = T(() => i[n.mode]), o = T(() => `${n.label}:${a.value.title}(点击切换值模式)`);
719
+ return (e, t) => (P(), O("button", {
720
720
  type: "button",
721
721
  class: "cn-props__mode-toggle shrink-0",
722
722
  "aria-label": o.value,
723
723
  title: o.value,
724
- onClick: t[0] ||= H((e) => r("cycle"), ["prevent"])
725
- }, [j(_, {
724
+ onClick: t[0] ||= V((e) => r("cycle"), ["prevent"])
725
+ }, [A(_, {
726
726
  icon: a.value.icon,
727
727
  size: 12
728
- }, null, 8, ["icon"])], 8, ot));
728
+ }, null, 8, ["icon"])], 8, lt));
729
729
  }
730
- }), ct = { class: "cn-border flex w-full min-w-0 items-center gap-1" }, lt = { class: "grid min-w-0 flex-1 gap-1 grid-cols-1" }, ut = { class: "w-5 shrink-0 select-none text-[10px] leading-none text-cn-muted" }, dt = [
730
+ }), dt = { class: "cn-border flex w-full min-w-0 items-center gap-1" }, ft = { class: "grid min-w-0 flex-1 gap-1 grid-cols-1" }, pt = { class: "w-5 shrink-0 select-none text-[10px] leading-none text-cn-muted" }, mt = [
731
731
  "value",
732
732
  "disabled",
733
733
  "onInput",
734
734
  "onChange"
735
- ], ft = "#000000", pt = /* @__PURE__ */ M({
735
+ ], X = "#000000", ht = /* @__PURE__ */ j({
736
736
  __name: "BorderField",
737
737
  props: {
738
738
  field: {},
@@ -740,12 +740,12 @@ var Y = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
740
740
  },
741
741
  emits: ["input", "change"],
742
742
  setup(e, { emit: t }) {
743
- let n = e, r = t, { mode: i, cycle: a } = et(() => n.modelValue, Ze), o = E(() => Ke[i.value]);
743
+ let n = e, r = t, { mode: i, cycle: a } = rt(() => n.modelValue, et), o = T(() => Ye[i.value]);
744
744
  function s(e) {
745
745
  return n.modelValue[e.rep]?.width ?? null;
746
746
  }
747
747
  function c(e) {
748
- return n.modelValue[e.rep]?.color ?? ft;
748
+ return n.modelValue[e.rep]?.color ?? X;
749
749
  }
750
750
  function l(e, t, i) {
751
751
  let a = { ...n.modelValue };
@@ -753,7 +753,7 @@ var Y = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
753
753
  r(i ? "change" : "input", a);
754
754
  }
755
755
  function u(e, t, r) {
756
- let i = n.modelValue[e.rep]?.color ?? ft;
756
+ let i = n.modelValue[e.rep]?.color ?? X;
757
757
  l(e, t <= 0 ? null : {
758
758
  width: t,
759
759
  color: i
@@ -771,20 +771,20 @@ var Y = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
771
771
  function f() {
772
772
  let { from: e, to: t } = a();
773
773
  if (t < e) {
774
- let e = Qe(n.modelValue, t);
775
- $e(e, n.modelValue) || r("change", e);
774
+ let e = tt(n.modelValue, t);
775
+ nt(e, n.modelValue) || r("change", e);
776
776
  }
777
777
  }
778
- return (t, n) => (F(), k("span", ct, [j(st, {
779
- mode: B(i),
778
+ return (t, n) => (P(), O("span", dt, [A(ut, {
779
+ mode: z(i),
780
780
  label: "边框",
781
781
  onCycle: f
782
- }, null, 8, ["mode"]), A("span", lt, [(F(!0), k(T, null, L(o.value, (t) => (F(), k("label", {
782
+ }, null, 8, ["mode"]), k("span", ft, [(P(!0), O(w, null, I(o.value, (t) => (P(), O("label", {
783
783
  key: t.rep,
784
784
  class: "flex items-center gap-1.5"
785
785
  }, [
786
- A("span", ut, z(t.label), 1),
787
- j(at, {
786
+ k("span", pt, R(t.label), 1),
787
+ A(ct, {
788
788
  class: "cn-border__width",
789
789
  value: s(t),
790
790
  label: t.label,
@@ -796,7 +796,7 @@ var Y = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
796
796
  "onInput",
797
797
  "onChange"
798
798
  ]),
799
- A("input", {
799
+ k("input", {
800
800
  class: "cn-border__color size-6 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",
801
801
  type: "color",
802
802
  title: "边框颜色",
@@ -804,17 +804,17 @@ var Y = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
804
804
  disabled: e.modelValue[t.rep] === null,
805
805
  onInput: (e) => d(t, e, !1),
806
806
  onChange: (e) => d(t, e, !0)
807
- }, null, 40, dt)
807
+ }, null, 40, mt)
808
808
  ]))), 128))])]));
809
809
  }
810
- }), mt = ["value"], ht = {
810
+ }), gt = ["value"], _t = {
811
811
  key: 1,
812
812
  class: "flex flex-1 items-center gap-1.5"
813
- }, gt = ["value"], _t = ["value"], vt = [
813
+ }, vt = ["value"], yt = ["value"], bt = [
814
814
  "disabled",
815
815
  "title",
816
816
  "data-upload-error"
817
- ], yt = /* @__PURE__ */ M({
817
+ ], xt = /* @__PURE__ */ j({
818
818
  __name: "FontField",
819
819
  props: {
820
820
  field: {},
@@ -822,7 +822,7 @@ var Y = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
822
822
  },
823
823
  emits: ["input", "change"],
824
824
  setup(e, { emit: t }) {
825
- let n = e, r = t, i = y(), a = E(() => {
825
+ let n = e, r = t, i = re(), a = T(() => {
826
826
  if (i === null) return [];
827
827
  let e = [{
828
828
  label: "内置默认字体",
@@ -857,7 +857,7 @@ var Y = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
857
857
  function f(e) {
858
858
  c = !1, r("change", e.target.value);
859
859
  }
860
- let p = I(!1), m = I(null), h = I(null);
860
+ let p = F(!1), m = F(null), h = F(null);
861
861
  function g() {
862
862
  m.value = null, h.value?.click();
863
863
  }
@@ -875,25 +875,25 @@ var Y = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
875
875
  }
876
876
  }
877
877
  }
878
- return (t, n) => B(i) === null ? (F(), k("input", {
878
+ return (t, n) => z(i) === null ? (P(), O("input", {
879
879
  key: 0,
880
- class: P(["cn-field", B(tt)]),
880
+ class: N(["cn-field", z(it)]),
881
881
  type: "text",
882
882
  value: e.modelValue,
883
883
  onInput: l,
884
884
  onCompositionstart: u,
885
885
  onCompositionend: d,
886
886
  onChange: f
887
- }, null, 42, mt)) : (F(), k("div", ht, [
888
- A("select", {
889
- class: P(["cn-field cn-select", B(Y)]),
887
+ }, null, 42, gt)) : (P(), O("div", _t, [
888
+ k("select", {
889
+ class: N(["cn-field cn-select", z(J)]),
890
890
  value: e.modelValue,
891
891
  onChange: s
892
- }, [(F(!0), k(T, null, L(a.value, (e) => (F(), k("option", {
892
+ }, [(P(!0), O(w, null, I(a.value, (e) => (P(), O("option", {
893
893
  key: e.value,
894
894
  value: e.value
895
- }, z(e.label), 9, _t))), 128))], 42, gt),
896
- A("input", {
895
+ }, R(e.label), 9, yt))), 128))], 42, vt),
896
+ k("input", {
897
897
  ref_key: "fileInput",
898
898
  ref: h,
899
899
  type: "file",
@@ -901,7 +901,7 @@ var Y = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
901
901
  accept: ".ttf,.otf,.woff,.woff2,font/ttf,font/otf,font/woff,font/woff2",
902
902
  onChange: _
903
903
  }, null, 544),
904
- B(i).canUpload ? (F(), k("button", {
904
+ z(i).canUpload ? (P(), O("button", {
905
905
  key: 0,
906
906
  type: "button",
907
907
  class: "h-7 shrink-0 rounded-md border border-cn-field-line bg-cn-field px-2 text-[11px] leading-none text-cn-fg transition-colors duration-100 hover:border-cn-muted/40 disabled:cursor-not-allowed disabled:opacity-40",
@@ -909,10 +909,10 @@ var Y = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
909
909
  title: m.value ?? "上传本机字体(加入清单后可选)",
910
910
  "data-upload-error": m.value ?? void 0,
911
911
  onClick: g
912
- }, z(p.value ? "…" : m.value ? "!" : "上传"), 9, vt)) : O("", !0)
912
+ }, R(p.value ? "…" : m.value ? "!" : "上传"), 9, bt)) : D("", !0)
913
913
  ]));
914
914
  }
915
- }), bt = { class: "cn-color flex min-w-0 flex-1 items-center gap-1.5" }, xt = ["checked"], St = ["value", "disabled"], Ct = ["value", "disabled"], wt = "#000000", Tt = /* @__PURE__ */ M({
915
+ }), St = { class: "cn-color flex min-w-0 flex-1 items-center gap-1.5" }, Ct = ["checked"], wt = ["value", "disabled"], Tt = ["value", "disabled"], Et = "#000000", Dt = /* @__PURE__ */ j({
916
916
  __name: "ColorField",
917
917
  props: {
918
918
  field: {},
@@ -920,12 +920,12 @@ var Y = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
920
920
  },
921
921
  emits: ["input", "change"],
922
922
  setup(e, { emit: t }) {
923
- let n = e, r = t, i = I(n.modelValue !== null), a = I(o(n.modelValue));
924
- V(() => n.modelValue, (e) => {
923
+ let n = e, r = t, i = F(n.modelValue !== null), a = F(o(n.modelValue));
924
+ B(() => n.modelValue, (e) => {
925
925
  i.value = e !== null, i.value && (a.value = o(e));
926
926
  });
927
927
  function o(e) {
928
- return e !== null && /^#[0-9a-fA-F]{6}$/.test(e) ? e : wt;
928
+ return e !== null && /^#[0-9a-fA-F]{6}$/.test(e) ? e : Et;
929
929
  }
930
930
  function s(e) {
931
931
  let t = e.target.checked;
@@ -952,40 +952,40 @@ var Y = "h-7 flex-1 w-full min-w-0 rounded-md border border-cn-field-line bg-cn-
952
952
  }
953
953
  a.value = o(t), r("change", t);
954
954
  }
955
- return (t, n) => (F(), k("span", bt, [
956
- e.field.nullable ? (F(), k("input", {
955
+ return (t, n) => (P(), O("span", St, [
956
+ e.field.nullable ? (P(), O("input", {
957
957
  key: 0,
958
958
  class: "cn-color__toggle size-3.5 shrink-0 cursor-pointer accent-cn-accent",
959
959
  type: "checkbox",
960
960
  title: "启用颜色",
961
961
  checked: i.value,
962
962
  onChange: s
963
- }, null, 40, xt)) : O("", !0),
964
- A("input", {
965
- class: P(["cn-color__swatch", B(rt)]),
963
+ }, null, 40, Ct)) : D("", !0),
964
+ k("input", {
965
+ class: N(["cn-color__swatch", z(ot)]),
966
966
  type: "color",
967
967
  value: a.value,
968
968
  disabled: !i.value,
969
969
  onInput: c,
970
970
  onChange: l
971
- }, null, 42, St),
972
- A("input", {
973
- class: P(["cn-color__text min-w-0 flex-1", B(Y)]),
971
+ }, null, 42, wt),
972
+ k("input", {
973
+ class: N(["cn-color__text min-w-0 flex-1", z(J)]),
974
974
  type: "text",
975
975
  value: e.modelValue ?? "",
976
976
  disabled: !i.value,
977
977
  placeholder: "无",
978
978
  onChange: u
979
- }, null, 42, Ct)
979
+ }, null, 42, Tt)
980
980
  ]));
981
981
  }
982
982
  }), Z = Symbol("canvas-image-upload");
983
- function Et() {
984
- return le(Z, null);
983
+ function Ot() {
984
+ return fe(Z, null);
985
985
  }
986
986
  //#endregion
987
987
  //#region src/property-panel/fields/TextField.vue?vue&type=script&setup=true&lang.ts
988
- var Dt = ["value", "placeholder"], Q = /* @__PURE__ */ M({
988
+ var kt = ["value", "placeholder"], Q = /* @__PURE__ */ j({
989
989
  __name: "TextField",
990
990
  props: {
991
991
  field: {},
@@ -993,7 +993,7 @@ var Dt = ["value", "placeholder"], Q = /* @__PURE__ */ M({
993
993
  },
994
994
  emits: ["input", "change"],
995
995
  setup(e, { emit: t }) {
996
- let n = e, r = t, i = !1, a = I(!1);
996
+ let n = e, r = t, i = !1, a = F(!1);
997
997
  function o(e) {
998
998
  return n.field.nonEmpty === !0 ? e.trim() === "" ? (a.value = !0, !0) : (a.value = !1, !1) : !1;
999
999
  }
@@ -1014,8 +1014,8 @@ var Dt = ["value", "placeholder"], Q = /* @__PURE__ */ M({
1014
1014
  let t = e.target.value;
1015
1015
  o(t) || r("change", t);
1016
1016
  }
1017
- return (t, n) => (F(), k("input", {
1018
- class: P(["cn-field", [B(tt), a.value ? "cn-field--invalid" : ""]]),
1017
+ return (t, n) => (P(), O("input", {
1018
+ class: N(["cn-field", [z(it), a.value ? "cn-field--invalid" : ""]]),
1019
1019
  type: "text",
1020
1020
  value: e.modelValue,
1021
1021
  placeholder: e.field.placeholder,
@@ -1023,9 +1023,9 @@ var Dt = ["value", "placeholder"], Q = /* @__PURE__ */ M({
1023
1023
  onCompositionstart: c,
1024
1024
  onCompositionend: l,
1025
1025
  onChange: u
1026
- }, null, 42, Dt));
1026
+ }, null, 42, kt));
1027
1027
  }
1028
- }), Ot = /* @__PURE__ */ M({
1028
+ }), At = /* @__PURE__ */ j({
1029
1029
  __name: "ResourceValueField",
1030
1030
  props: {
1031
1031
  field: {},
@@ -1036,15 +1036,15 @@ var Dt = ["value", "placeholder"], Q = /* @__PURE__ */ M({
1036
1036
  },
1037
1037
  emits: ["input", "change"],
1038
1038
  setup(e, { emit: t }) {
1039
- let n = e, r = t, i = E(() => n.dataMode === "expression"), a = E(() => {
1039
+ let n = e, r = t, i = T(() => n.dataMode === "expression"), a = T(() => {
1040
1040
  let e = n.modelValue ?? "";
1041
- return i.value ? ne(e) ?? e : "";
1041
+ return i.value ? v(e) ?? e : "";
1042
1042
  });
1043
1043
  function o(e) {
1044
- let t = ie(e);
1044
+ let t = b(e);
1045
1045
  r("input", t), r("change", t);
1046
1046
  }
1047
- return (t, n) => i.value ? (F(), D(re, {
1047
+ return (t, n) => i.value ? (P(), E(y, {
1048
1048
  key: 0,
1049
1049
  "model-value": a.value,
1050
1050
  source: e.source ?? null,
@@ -1057,7 +1057,7 @@ var Dt = ["value", "placeholder"], Q = /* @__PURE__ */ M({
1057
1057
  "source",
1058
1058
  "disabled",
1059
1059
  "aria-label"
1060
- ])) : (F(), D(Q, {
1060
+ ])) : (P(), E(Q, {
1061
1061
  key: 1,
1062
1062
  field: e.field,
1063
1063
  "model-value": e.modelValue ?? "",
@@ -1072,17 +1072,17 @@ var Dt = ["value", "placeholder"], Q = /* @__PURE__ */ M({
1072
1072
  "disabled"
1073
1073
  ]));
1074
1074
  }
1075
- }), kt = {
1075
+ }), jt = {
1076
1076
  key: 0,
1077
1077
  class: "flex flex-col gap-1.5"
1078
- }, At = [
1078
+ }, Mt = [
1079
1079
  "disabled",
1080
1080
  "title",
1081
1081
  "data-upload-error"
1082
- ], jt = ["src"], Mt = {
1082
+ ], Nt = ["src"], Pt = {
1083
1083
  key: 2,
1084
1084
  class: "relative"
1085
- }, Nt = { class: "flex items-center gap-1.5" }, Pt = /* @__PURE__ */ M({
1085
+ }, Ft = { class: "flex items-center gap-1.5" }, It = /* @__PURE__ */ j({
1086
1086
  __name: "ImageSrcField",
1087
1087
  props: {
1088
1088
  field: {},
@@ -1094,7 +1094,7 @@ var Dt = ["value", "placeholder"], Q = /* @__PURE__ */ M({
1094
1094
  },
1095
1095
  emits: ["input", "change"],
1096
1096
  setup(e, { emit: t }) {
1097
- let n = e, r = t, i = Et(), a = E(() => i !== null && i.canUpload && n.dataMode !== "expression"), o = E(() => typeof n.modelValue == "string" && n.modelValue !== ""), s = E(() => n.resourceStatus === "pending" ? "装载中" : n.resourceStatus === "failed" ? "失败" : null), c = I(!1), l = I(null), u = I(null);
1097
+ let n = e, r = t, i = Ot(), 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);
1098
1098
  function d() {
1099
1099
  l.value = null, u.value?.click();
1100
1100
  }
@@ -1112,8 +1112,8 @@ var Dt = ["value", "placeholder"], Q = /* @__PURE__ */ M({
1112
1112
  }
1113
1113
  }
1114
1114
  }
1115
- return (t, n) => a.value ? (F(), k("div", kt, [
1116
- A("button", {
1115
+ return (t, n) => a.value ? (P(), O("div", jt, [
1116
+ k("button", {
1117
1117
  type: "button",
1118
1118
  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",
1119
1119
  disabled: c.value,
@@ -1121,19 +1121,19 @@ var Dt = ["value", "placeholder"], Q = /* @__PURE__ */ M({
1121
1121
  "data-upload-error": l.value ?? void 0,
1122
1122
  onClick: d
1123
1123
  }, [
1124
- o.value ? (F(), k("img", {
1124
+ o.value ? (P(), O("img", {
1125
1125
  key: 0,
1126
1126
  src: e.modelValue ?? void 0,
1127
1127
  class: "absolute inset-0 size-full object-cover",
1128
1128
  alt: ""
1129
- }, null, 8, jt)) : O("", !0),
1130
- s.value ? (F(), k("span", {
1129
+ }, null, 8, Nt)) : D("", !0),
1130
+ s.value ? (P(), O("span", {
1131
1131
  key: 1,
1132
- class: P(["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"])
1133
- }, z(s.value), 3)) : O("", !0),
1134
- o.value ? O("", !0) : (F(), k("span", Mt, z(c.value ? "…" : l.value ? "!" : "点击上传图片"), 1))
1135
- ], 8, At),
1136
- A("input", {
1132
+ 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"])
1133
+ }, R(s.value), 3)) : D("", !0),
1134
+ o.value ? D("", !0) : (P(), O("span", Pt, R(c.value ? "…" : l.value ? "!" : "点击上传图片"), 1))
1135
+ ], 8, Mt),
1136
+ k("input", {
1137
1137
  ref_key: "fileInput",
1138
1138
  ref: u,
1139
1139
  type: "file",
@@ -1141,7 +1141,7 @@ var Dt = ["value", "placeholder"], Q = /* @__PURE__ */ M({
1141
1141
  accept: "image/*",
1142
1142
  onChange: f
1143
1143
  }, null, 544),
1144
- A("div", Nt, [j(Q, {
1144
+ k("div", Ft, [A(Q, {
1145
1145
  class: "flex-1",
1146
1146
  field: e.field,
1147
1147
  "model-value": e.modelValue ?? "",
@@ -1152,14 +1152,14 @@ var Dt = ["value", "placeholder"], Q = /* @__PURE__ */ M({
1152
1152
  "field",
1153
1153
  "model-value",
1154
1154
  "aria-label"
1155
- ]), o.value ? (F(), k("button", {
1155
+ ]), o.value ? (P(), O("button", {
1156
1156
  key: 0,
1157
1157
  type: "button",
1158
1158
  class: "cn-imagesrc__clear h-7 shrink-0 rounded-md border border-cn-field-line bg-cn-field px-2 text-[11px] leading-none text-cn-fg transition-colors duration-100 hover:border-cn-muted/40",
1159
1159
  title: "清除图片(资源地址置空)",
1160
1160
  onClick: n[2] ||= (e) => r("change", "")
1161
- }, "清除")) : O("", !0)])
1162
- ])) : e.dataMode === "expression" ? (F(), D(Ot, {
1161
+ }, "清除")) : D("", !0)])
1162
+ ])) : e.dataMode === "expression" ? (P(), E(At, {
1163
1163
  key: 1,
1164
1164
  field: e.field,
1165
1165
  "model-value": e.modelValue,
@@ -1173,7 +1173,7 @@ var Dt = ["value", "placeholder"], Q = /* @__PURE__ */ M({
1173
1173
  "model-value",
1174
1174
  "source",
1175
1175
  "disabled"
1176
- ])) : (F(), D(Q, {
1176
+ ])) : (P(), E(Q, {
1177
1177
  key: 2,
1178
1178
  field: e.field,
1179
1179
  "model-value": e.modelValue ?? "",
@@ -1186,12 +1186,12 @@ var Dt = ["value", "placeholder"], Q = /* @__PURE__ */ M({
1186
1186
  "aria-label"
1187
1187
  ]));
1188
1188
  }
1189
- }), Ft = [
1189
+ }), Lt = [
1190
1190
  "aria-label",
1191
1191
  "min",
1192
1192
  "max",
1193
1193
  "step"
1194
- ], $ = /* @__PURE__ */ M({
1194
+ ], $ = /* @__PURE__ */ j({
1195
1195
  __name: "NumberField",
1196
1196
  props: {
1197
1197
  field: {},
@@ -1199,8 +1199,8 @@ var Dt = ["value", "placeholder"], Q = /* @__PURE__ */ M({
1199
1199
  },
1200
1200
  emits: ["input", "change"],
1201
1201
  setup(e, { emit: t }) {
1202
- let n = e, r = t, i = I(String(n.modelValue)), a = I(!1);
1203
- V(() => n.modelValue, (e) => {
1202
+ let n = e, r = t, i = F(String(n.modelValue)), a = F(!1);
1203
+ B(() => n.modelValue, (e) => {
1204
1204
  a.value || (i.value = String(e));
1205
1205
  });
1206
1206
  function o(e) {
@@ -1227,9 +1227,9 @@ var Dt = ["value", "placeholder"], Q = /* @__PURE__ */ M({
1227
1227
  let a = o(t);
1228
1228
  i.value = String(a), r("change", a);
1229
1229
  }
1230
- return (t, n) => _e((F(), k("input", {
1230
+ return (t, n) => be((P(), O("input", {
1231
1231
  "onUpdate:modelValue": n[0] ||= (e) => i.value = e,
1232
- class: P(["cn-field cn-field--number", B(X)]),
1232
+ class: N(["cn-field cn-field--number", z(Y)]),
1233
1233
  type: "number",
1234
1234
  "aria-label": e.field.label,
1235
1235
  min: e.field.min,
@@ -1239,9 +1239,9 @@ var Dt = ["value", "placeholder"], Q = /* @__PURE__ */ M({
1239
1239
  onFocus: n[1] ||= (e) => a.value = !0,
1240
1240
  onBlur: l,
1241
1241
  onChange: l
1242
- }, null, 42, Ft)), [[me, i.value]]);
1242
+ }, null, 42, Lt)), [[_e, i.value]]);
1243
1243
  }
1244
- }), It = { class: "cn-padding flex w-full min-w-0 items-center gap-1.5" }, Lt = { class: "w-5 shrink-0 select-none text-[10px] leading-none text-cn-muted" }, Rt = /* @__PURE__ */ M({
1244
+ }), Rt = { class: "cn-padding flex w-full min-w-0 items-center gap-1.5" }, zt = { class: "w-5 shrink-0 select-none text-[10px] leading-none text-cn-muted" }, Bt = /* @__PURE__ */ j({
1245
1245
  __name: "PaddingField",
1246
1246
  props: {
1247
1247
  field: {},
@@ -1249,7 +1249,7 @@ var Dt = ["value", "placeholder"], Q = /* @__PURE__ */ M({
1249
1249
  },
1250
1250
  emits: ["input", "change"],
1251
1251
  setup(e, { emit: t }) {
1252
- let n = e, r = t, { mode: i, cycle: a } = et(() => n.modelValue, Je), o = E(() => Ke[i.value]);
1252
+ let n = e, r = t, { mode: i, cycle: a } = rt(() => n.modelValue, Ze), o = T(() => Ye[i.value]);
1253
1253
  function s(e) {
1254
1254
  return {
1255
1255
  key: ["padding", e.rep],
@@ -1265,18 +1265,18 @@ var Dt = ["value", "placeholder"], Q = /* @__PURE__ */ M({
1265
1265
  function l() {
1266
1266
  let { from: e, to: t } = a();
1267
1267
  if (t < e) {
1268
- let e = Ye(n.modelValue, t);
1269
- Xe(e, n.modelValue) || r("change", e);
1268
+ let e = Qe(n.modelValue, t);
1269
+ $e(e, n.modelValue) || r("change", e);
1270
1270
  }
1271
1271
  }
1272
- return (t, n) => (F(), k("span", It, [j(st, {
1273
- mode: B(i),
1272
+ return (t, n) => (P(), O("span", Rt, [A(ut, {
1273
+ mode: z(i),
1274
1274
  label: "内边距",
1275
1275
  onCycle: l
1276
- }, null, 8, ["mode"]), A("span", { class: P(["grid min-w-0 flex-1 gap-1.5", B(i) === 1 ? "grid-cols-1" : "grid-cols-2"]) }, [(F(!0), k(T, null, L(o.value, (t) => (F(), k("label", {
1276
+ }, 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", {
1277
1277
  key: t.rep,
1278
1278
  class: "flex min-w-0 items-center gap-1.5"
1279
- }, [A("span", Lt, z(t.label), 1), j($, {
1279
+ }, [k("span", zt, R(t.label), 1), A($, {
1280
1280
  class: "min-w-0 flex-1",
1281
1281
  field: s(t),
1282
1282
  "model-value": e.modelValue[t.rep],
@@ -1289,16 +1289,16 @@ var Dt = ["value", "placeholder"], Q = /* @__PURE__ */ M({
1289
1289
  "onChange"
1290
1290
  ])]))), 128))], 2)]));
1291
1291
  }
1292
- }), zt = { class: "grid w-full min-w-0 grid-cols-2 gap-1" }, Bt = ["title"], Vt = { class: "w-3.5 shrink-0 select-none text-[10px] leading-none text-cn-muted" }, Ht = [
1292
+ }), Vt = { class: "grid w-full min-w-0 grid-cols-2 gap-1" }, Ht = ["title"], Ut = { class: "w-3.5 shrink-0 select-none text-[10px] leading-none text-cn-muted" }, Wt = [
1293
1293
  "aria-pressed",
1294
1294
  "title",
1295
1295
  "onClick"
1296
- ], Ut = [
1296
+ ], Gt = [
1297
1297
  "aria-label",
1298
1298
  "value",
1299
1299
  "placeholder",
1300
1300
  "title"
1301
- ], Wt = /* @__PURE__ */ M({
1301
+ ], Kt = /* @__PURE__ */ j({
1302
1302
  __name: "PairField",
1303
1303
  props: {
1304
1304
  field: {},
@@ -1311,16 +1311,16 @@ var Dt = ["value", "placeholder"], Q = /* @__PURE__ */ M({
1311
1311
  "sub-commit"
1312
1312
  ],
1313
1313
  setup(e, { emit: t }) {
1314
- let n = e, r = t, i = E(() => n.field.items ?? []);
1314
+ let n = e, r = t, i = T(() => n.field.items ?? []);
1315
1315
  function a(e) {
1316
1316
  if (!e.auto) return !1;
1317
- let t = q(n.modelValue, e.auto.key);
1317
+ let t = K(n.modelValue, e.auto.key);
1318
1318
  return t.ok && t.value === !0;
1319
1319
  }
1320
1320
  function o(e) {
1321
1321
  return {
1322
1322
  ...e,
1323
- key: K(n.field, e)
1323
+ key: G(n.field, e)
1324
1324
  };
1325
1325
  }
1326
1326
  function s(e) {
@@ -1337,11 +1337,11 @@ var Dt = ["value", "placeholder"], Q = /* @__PURE__ */ M({
1337
1337
  r("sub-commit", s(e), !a(e), !0);
1338
1338
  }
1339
1339
  function u(e) {
1340
- let t = q(n.modelValue, e.key);
1340
+ let t = K(n.modelValue, e.key);
1341
1341
  return t.ok && typeof t.value == "number" ? t.value : 0;
1342
1342
  }
1343
1343
  function d(e) {
1344
- return n.displays?.[K(n.field, e).join(".")];
1344
+ return n.displays?.[G(n.field, e).join(".")];
1345
1345
  }
1346
1346
  function f(e) {
1347
1347
  let t = d(e);
@@ -1354,30 +1354,30 @@ var Dt = ["value", "placeholder"], Q = /* @__PURE__ */ M({
1354
1354
  let t = d(e);
1355
1355
  return t?.preview ? "模板子树:预览盒尺寸(随行实例变化,非文档声明值)" : t === void 0 ? `${e.label}自适应:已开启` : `${e.label}自适应:布局解析值(与画布选择框同源)`;
1356
1356
  }
1357
- return (e, t) => (F(), k("span", zt, [(F(!0), k(T, null, L(i.value, (e) => (F(), k("label", {
1357
+ return (e, t) => (P(), O("span", Vt, [(P(!0), O(w, null, I(i.value, (e) => (P(), O("label", {
1358
1358
  key: e.key.join("."),
1359
1359
  class: "flex min-w-0 items-center gap-1",
1360
1360
  title: e.auto ? void 0 : e.label
1361
1361
  }, [
1362
- A("span", Vt, z(e.label), 1),
1363
- e.auto ? (F(), k("button", {
1362
+ k("span", Ut, R(e.label), 1),
1363
+ e.auto ? (P(), O("button", {
1364
1364
  key: 0,
1365
1365
  type: "button",
1366
- class: P(["cn-props__auto-toggle shrink-0", { "cn-props__auto-toggle--active": a(e) }]),
1366
+ class: N(["cn-props__auto-toggle shrink-0", { "cn-props__auto-toggle--active": a(e) }]),
1367
1367
  "aria-pressed": a(e),
1368
1368
  title: p(e),
1369
- onClick: H((t) => l(e), ["prevent"])
1370
- }, "自", 10, Ht)) : O("", !0),
1371
- a(e) ? (F(), k("input", {
1369
+ onClick: V((t) => l(e), ["prevent"])
1370
+ }, "自", 10, Wt)) : D("", !0),
1371
+ a(e) ? (P(), O("input", {
1372
1372
  key: 2,
1373
- class: P(["cn-field cn-field--number min-w-0 flex-1", [B(X), d(e)?.preview ? "cn-field--preview" : ""]]),
1373
+ class: N(["cn-field cn-field--number min-w-0 flex-1", [z(Y), d(e)?.preview ? "cn-field--preview" : ""]]),
1374
1374
  type: "number",
1375
1375
  disabled: "",
1376
1376
  "aria-label": e.label,
1377
1377
  value: f(e),
1378
1378
  placeholder: e.auto?.placeholder ?? "",
1379
1379
  title: m(e)
1380
- }, null, 10, Ut)) : (F(), D($, {
1380
+ }, null, 10, Gt)) : (P(), E($, {
1381
1381
  key: 1,
1382
1382
  class: "min-w-0 flex-1",
1383
1383
  field: e,
@@ -1390,9 +1390,9 @@ var Dt = ["value", "placeholder"], Q = /* @__PURE__ */ M({
1390
1390
  "onInput",
1391
1391
  "onChange"
1392
1392
  ]))
1393
- ], 8, Bt))), 128))]));
1393
+ ], 8, Ht))), 128))]));
1394
1394
  }
1395
- }), Gt = ["value"], Kt = ["value"], qt = /* @__PURE__ */ M({
1395
+ }), qt = ["value"], Jt = ["value"], Yt = /* @__PURE__ */ j({
1396
1396
  __name: "SelectField",
1397
1397
  props: {
1398
1398
  field: {},
@@ -1404,16 +1404,16 @@ var Dt = ["value", "placeholder"], Q = /* @__PURE__ */ M({
1404
1404
  function r(e) {
1405
1405
  n("change", e.target.value);
1406
1406
  }
1407
- return (t, n) => (F(), k("select", {
1407
+ return (t, n) => (P(), O("select", {
1408
1408
  class: "cn-select h-7 w-full min-w-0 flex-1 cursor-pointer appearance-none rounded-md border border-cn-field-line bg-cn-field py-0 pl-2 pr-6 text-[11px] leading-none text-cn-fg outline-none transition-[border-color,box-shadow] duration-100 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",
1409
1409
  value: e.modelValue,
1410
1410
  onChange: r
1411
- }, [(F(!0), k(T, null, L(e.field.domain ?? [], (e) => (F(), k("option", {
1411
+ }, [(P(!0), O(w, null, I(e.field.domain ?? [], (e) => (P(), O("option", {
1412
1412
  key: e,
1413
1413
  value: e
1414
- }, z(e), 9, Kt))), 128))], 40, Gt));
1414
+ }, R(e), 9, Jt))), 128))], 40, qt));
1415
1415
  }
1416
- }), Jt = ["value", "disabled"], Yt = /* @__PURE__ */ M({
1416
+ }), Xt = ["value", "disabled"], Zt = /* @__PURE__ */ j({
1417
1417
  __name: "TextareaField",
1418
1418
  props: {
1419
1419
  field: {},
@@ -1436,8 +1436,8 @@ var Dt = ["value", "placeholder"], Q = /* @__PURE__ */ M({
1436
1436
  function s(e) {
1437
1437
  r = !1, n("change", e.target.value);
1438
1438
  }
1439
- return (t, n) => (F(), k("textarea", {
1440
- class: P(["cn-field", B(nt)]),
1439
+ return (t, n) => (P(), O("textarea", {
1440
+ class: N(["cn-field", z(at)]),
1441
1441
  rows: "3",
1442
1442
  value: e.modelValue,
1443
1443
  disabled: e.disabled,
@@ -1445,67 +1445,67 @@ var Dt = ["value", "placeholder"], Q = /* @__PURE__ */ M({
1445
1445
  onCompositionstart: a,
1446
1446
  onCompositionend: o,
1447
1447
  onChange: s
1448
- }, null, 42, Jt));
1448
+ }, null, 42, Xt));
1449
1449
  }
1450
- }), Xt = {
1451
- number: N($),
1452
- text: N(Q),
1453
- textarea: N(Yt),
1454
- color: N(Tt),
1455
- select: N(qt),
1456
- boolean: N(Ge),
1457
- pair: N(Wt),
1458
- anchor: N(He),
1459
- align: N(Me),
1460
- padding: N(Rt),
1461
- border: N(pt),
1462
- font: N(yt),
1463
- imageSrc: N(Pt),
1464
- resourceValue: N(Ot)
1450
+ }), Qt = {
1451
+ number: M($),
1452
+ text: M(Q),
1453
+ textarea: M(Zt),
1454
+ color: M(Dt),
1455
+ select: M(Yt),
1456
+ boolean: M(Je),
1457
+ pair: M(Kt),
1458
+ anchor: M(Ge),
1459
+ align: M(Fe),
1460
+ padding: M(Bt),
1461
+ border: M(ht),
1462
+ font: M(xt),
1463
+ imageSrc: M(It),
1464
+ resourceValue: M(At)
1465
1465
  };
1466
1466
  //#endregion
1467
1467
  //#region src/property-panel/usePropertyPanel.ts
1468
- function Zt(e) {
1469
- let t = R(e.store.doc), n = R(e.store.ui.selection), r = R(e.store.ui.anchorExpanded), i = R(e.store.ui.dataSourceSchema), a = R(e.store.ui.resourceStatuses), o = R(e.store.ui.editing), s = e.subscribe((s) => {
1468
+ function $t(e) {
1469
+ 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) => {
1470
1470
  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));
1471
1471
  });
1472
- de(s, !0);
1473
- let c = E(() => {
1472
+ me(s, !0);
1473
+ let c = T(() => {
1474
1474
  let e = t.value, r = n.value;
1475
1475
  return e && r ? p(e, r) : null;
1476
- }), l = E(() => t.value), u = E(() => {
1476
+ }), l = T(() => t.value), u = T(() => {
1477
1477
  let e = c.value, r = n.value;
1478
- return e && r ? De(r, e) : t.value ? Oe : [];
1479
- }), d = E(() => {
1478
+ return e && r ? Ae(r, e) : t.value ? je : [];
1479
+ }), d = T(() => {
1480
1480
  let r = n.value;
1481
1481
  return r && t.value ? e.layerBoxAt(r) : null;
1482
- }), f = E(() => {
1482
+ }), f = T(() => {
1483
1483
  let e = i.value;
1484
- return e === null ? null : v(e, b(e, t.value, n.value));
1485
- }), h = E(() => ae(oe(t.value, n.value, i.value))), g = E(() => n.value?.includes("template") ?? !1), _ = E(() => {
1484
+ return e === null ? null : se(e, x(e, t.value, n.value));
1485
+ }), h = T(() => ce(le(t.value, n.value, i.value))), g = T(() => n.value?.includes("template") ?? !1), _ = T(() => {
1486
1486
  let e = o.value, t = n.value;
1487
1487
  return e !== null && t !== null && m(e.path, t);
1488
1488
  });
1489
1489
  function ee(t) {
1490
1490
  e.store.setAnchorExpanded(t);
1491
1491
  }
1492
- function y(e) {
1492
+ function v(e) {
1493
1493
  if (!e.data) return !1;
1494
1494
  if (_.value) return o.value?.expression === !0;
1495
1495
  let t = c.value;
1496
1496
  return t !== null && "expression" in t && t.expression !== null;
1497
1497
  }
1498
- function S(r, i, a) {
1498
+ function y(r, i, a) {
1499
1499
  if (!t.value) return;
1500
1500
  let o = n.value;
1501
1501
  if (!o) {
1502
- w(r, i, a);
1502
+ te(r, i, a);
1503
1503
  return;
1504
1504
  }
1505
- let s = x(o, r.key);
1505
+ let s = S(o, r.key);
1506
1506
  if (r.data) {
1507
- if (y(r)) {
1508
- let t = x(o, ["data", "expression"]);
1507
+ if (v(r)) {
1508
+ let t = S(o, ["data", "expression"]);
1509
1509
  e.updateDataExpression(o, i, { mergeKey: t }), a && e.store.closeMerge(t);
1510
1510
  return;
1511
1511
  }
@@ -1514,18 +1514,18 @@ function Zt(e) {
1514
1514
  }
1515
1515
  e.updateSpec(o, r.key, i, { mergeKey: s }), a && e.store.closeMerge(s);
1516
1516
  }
1517
- function C(t) {
1517
+ function b(t) {
1518
1518
  let r = n.value;
1519
1519
  r && t.data && e.toggleDataMode(r);
1520
1520
  }
1521
- function w(t, n, r) {
1521
+ function te(t, n, r) {
1522
1522
  let i = t.key[0];
1523
1523
  if (i !== "width" && i !== "height" || typeof n != "number") return;
1524
1524
  let a = `canvas:${i}`;
1525
1525
  e.updateCanvasProp(i, n, { mergeKey: a }), r && e.store.closeMerge(a);
1526
1526
  }
1527
1527
  return {
1528
- selection: E(() => n.value),
1528
+ selection: T(() => n.value),
1529
1529
  layer: c,
1530
1530
  canvas: l,
1531
1531
  sections: u,
@@ -1533,26 +1533,26 @@ function Zt(e) {
1533
1533
  isPreviewBox: g,
1534
1534
  completionSource: f,
1535
1535
  rowsPathSource: h,
1536
- resourceStatuses: E(() => a.value),
1537
- anchorExpanded: E(() => r.value),
1536
+ resourceStatuses: T(() => a.value),
1537
+ anchorExpanded: T(() => r.value),
1538
1538
  contentLocked: _,
1539
- editingSession: E(() => o.value),
1540
- isDataMarked: y,
1541
- commit: S,
1542
- toggleDataMode: C,
1539
+ editingSession: T(() => o.value),
1540
+ isDataMarked: v,
1541
+ commit: y,
1542
+ toggleDataMode: b,
1543
1543
  setAnchorExpanded: ee
1544
1544
  };
1545
1545
  }
1546
1546
  //#endregion
1547
1547
  //#region src/property-panel/fields/ValueTypeSegmented.vue?vue&type=script&setup=true&lang.ts
1548
- var Qt = ["aria-disabled"], $t = [
1548
+ var en = ["aria-disabled"], tn = [
1549
1549
  "aria-pressed",
1550
1550
  "title",
1551
1551
  "data-mode-static",
1552
1552
  "data-mode-expression",
1553
1553
  "disabled",
1554
1554
  "onClick"
1555
- ], en = /* @__PURE__ */ M({
1555
+ ], nn = /* @__PURE__ */ j({
1556
1556
  __name: "ValueTypeSegmented",
1557
1557
  props: {
1558
1558
  mode: {},
@@ -1572,27 +1572,30 @@ var Qt = ["aria-disabled"], $t = [
1572
1572
  function a(e) {
1573
1573
  n.disabled || e !== n.mode && r("change", e);
1574
1574
  }
1575
- return (t, n) => (F(), k("span", {
1576
- class: P(["cn-valuetype flex h-7 shrink-0 items-stretch overflow-hidden rounded-md border border-cn-field-line bg-cn-field", { "opacity-60": e.disabled }]),
1575
+ return (t, n) => (P(), O("span", {
1576
+ class: N(["cn-valuetype flex h-7 shrink-0 items-stretch overflow-hidden rounded-md border border-cn-field-line bg-cn-field", { "opacity-60": e.disabled }]),
1577
1577
  role: "group",
1578
1578
  "aria-label": "取值方式",
1579
1579
  "aria-disabled": e.disabled ? "true" : void 0
1580
- }, [(F(), k(T, null, L(i, (t, n) => A("button", {
1580
+ }, [(P(), O(w, null, I(i, (t, n) => k("button", {
1581
1581
  key: t.value,
1582
1582
  type: "button",
1583
- class: P(["cn-valuetype__option flex items-center justify-center p-0 px-1.5 text-[10px] leading-none 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.mode ? "cn-valuetype__option--active bg-cn-accent-soft text-cn-accent" : "text-cn-muted hover:text-cn-fg"]]),
1583
+ class: N(["cn-valuetype__option flex items-center justify-center p-0 px-1.5 text-[10px] leading-none 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.mode ? "cn-valuetype__option--active bg-cn-accent-soft text-cn-accent" : "text-cn-muted hover:text-cn-fg"]]),
1584
1584
  "aria-pressed": t.value === e.mode,
1585
1585
  title: t.value === e.mode ? t.title : `${t.title};点击切换`,
1586
1586
  "data-mode-static": t.value === "static" || void 0,
1587
1587
  "data-mode-expression": t.value === "expression" || void 0,
1588
1588
  disabled: e.disabled,
1589
- onClick: H((e) => a(t.value), ["prevent"])
1590
- }, z(t.label), 11, $t)), 64))], 10, Qt));
1589
+ onClick: V((e) => a(t.value), ["prevent"])
1590
+ }, R(t.label), 11, tn)), 64))], 10, en));
1591
1591
  }
1592
- }), tn = ["title"], nn = {
1592
+ }), rn = ["title"], an = {
1593
1593
  key: 2,
1594
1594
  class: "cn-prop-field__hint col-span-2 block text-[11px] leading-4 text-cn-muted"
1595
- }, rn = ["title"], an = /* @__PURE__ */ M({
1595
+ }, on = ["title"], sn = {
1596
+ key: 4,
1597
+ class: "cn-prop-field__hint col-span-2 block text-[11px] leading-4 text-cn-muted"
1598
+ }, cn = /* @__PURE__ */ j({
1596
1599
  __name: "PropertyField",
1597
1600
  props: {
1598
1601
  field: {},
@@ -1611,48 +1614,48 @@ var Qt = ["aria-disabled"], $t = [
1611
1614
  "sub-commit"
1612
1615
  ],
1613
1616
  setup(e, { emit: t }) {
1614
- let n = e, r = t, i = E(() => Xt[n.field.control]), a = E(() => n.dataMode === "expression"), o = E(() => 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 = E(() => n.field.data === !0 ? "col-span-2" : ""), c = E(() => n.field.data === !0 && n.field.control === "textarea"), l = E(() => n.field.completion === "rowsPath"), u = E(() => c.value || l.value), d = E(() => n.field.resource === !0), f = I(null), p = E(() => n.field.data === !0 && a.value && typeof n.value == "string" ? n.field.resource === !0 ? te(n.value) : c.value ? w(n.value) : [] : []), m = E(() => ee(p.value)), h = E(() => n.field.control === "textarea");
1615
- function _() {
1617
+ let n = e, r = t, i = T(() => Qt[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.completion === "rowsPath"), u = T(() => c.value || l.value), d = T(() => n.field.resource === !0), f = F(null), p = T(() => n.field.data === !0 && a.value && typeof n.value == "string" ? n.field.resource === !0 ? n.value === "" ? [] : ee(n.value) : c.value ? ne(n.value) : [] : []), m = T(() => p.value.length === 0 ? "" : n.field.resource === !0 ? oe(n.completion != null) : ae(p.value)), h = T(() => n.field.resource === !0 && a.value && n.completion == null && p.value.length === 0 ? te : ""), _ = T(() => n.field.control === "textarea");
1618
+ function v() {
1616
1619
  let e = p.value[0], t = f.value?.$el;
1617
1620
  e !== void 0 && (t instanceof HTMLTextAreaElement || t instanceof HTMLInputElement) && (t.focus(), t.setSelectionRange(e.at.start, e.at.end));
1618
1621
  }
1619
- let v = E(() => {
1622
+ let y = T(() => {
1620
1623
  if (!u.value) return null;
1621
1624
  let e = f.value?.$el;
1622
1625
  return e instanceof HTMLTextAreaElement || e instanceof HTMLInputElement ? e : null;
1623
- }), y = I(null), b = E(() => y.value?.rootEl ?? null), { popup: x, accept: C } = S({
1624
- target: v,
1626
+ }), b = F(null), x = T(() => b.value?.rootEl ?? null), { popup: re, accept: S } = ie({
1627
+ target: y,
1625
1628
  enabled: () => c.value && a.value && n.completion != null,
1626
1629
  pairing: () => c.value && a.value,
1627
1630
  resolve: (e) => n.completion?.(e) ?? null,
1628
- popupEl: b
1629
- }), { popup: ne, accept: re } = se({
1630
- target: v,
1631
+ popupEl: x
1632
+ }), { popup: C, accept: se } = ue({
1633
+ target: y,
1631
1634
  enabled: () => l.value && n.completion != null,
1632
1635
  resolve: (e) => n.completion?.(e) ?? null,
1633
- popupEl: b
1636
+ popupEl: x
1634
1637
  });
1635
- function ie(e, t, n) {
1638
+ function ce(e, t, n) {
1636
1639
  r("sub-commit", e, t, n);
1637
1640
  }
1638
- return (t, n) => (F(), k(T, null, [(F(), D(pe(e.field.control === "pair" || e.field.control === "imageSrc" ? "div" : "label"), { class: P(o.value) }, {
1639
- default: ge(() => [
1640
- e.field.control === "pair" ? O("", !0) : (F(), k("span", {
1641
+ return (t, n) => (P(), O(w, null, [(P(), E(ge(e.field.control === "pair" || e.field.control === "imageSrc" ? "div" : "label"), { class: N(o.value) }, {
1642
+ default: ye(() => [
1643
+ e.field.control === "pair" ? D("", !0) : (P(), O("span", {
1641
1644
  key: 0,
1642
1645
  class: "cn-prop-field__label shrink-0 select-none truncate text-[11px] leading-none text-cn-muted",
1643
1646
  title: e.field.title
1644
- }, z(e.field.label), 9, tn)),
1645
- e.field.data ? (F(), D(en, {
1647
+ }, R(e.field.label), 9, rn)),
1648
+ e.field.data ? (P(), E(nn, {
1646
1649
  key: 1,
1647
1650
  class: "justify-self-end",
1648
1651
  mode: e.dataMode ?? "static",
1649
1652
  disabled: e.locked,
1650
1653
  onChange: n[0] ||= (e) => r("toggle-mode")
1651
- }, null, 8, ["mode", "disabled"])) : O("", !0),
1652
- (F(), D(pe(i.value), {
1654
+ }, null, 8, ["mode", "disabled"])) : D("", !0),
1655
+ (P(), E(ge(i.value), {
1653
1656
  ref_key: "controlRef",
1654
1657
  ref: f,
1655
- class: P(["cn-prop-field__control", [s.value, {
1658
+ class: N(["cn-prop-field__control", [s.value, {
1656
1659
  "cn-field--expression": a.value,
1657
1660
  "cn-field--invalid": p.value.length > 0
1658
1661
  }]]),
@@ -1665,7 +1668,7 @@ var Qt = ["aria-disabled"], $t = [
1665
1668
  "resource-status": e.field.control === "imageSrc" ? e.resourceStatus : void 0,
1666
1669
  onInput: n[1] ||= (e) => r("input", e),
1667
1670
  onChange: n[2] ||= (e) => r("change", e),
1668
- onSubCommit: ie
1671
+ onSubCommit: ce
1669
1672
  }, null, 40, [
1670
1673
  "class",
1671
1674
  "field",
@@ -1676,55 +1679,56 @@ var Qt = ["aria-disabled"], $t = [
1676
1679
  "source",
1677
1680
  "resource-status"
1678
1681
  ])),
1679
- e.hint ? (F(), k("span", nn, z(e.hint), 1)) : O("", !0),
1680
- m.value ? (F(), k("span", {
1682
+ e.hint ? (P(), O("span", an, R(e.hint), 1)) : D("", !0),
1683
+ m.value ? (P(), O("span", {
1681
1684
  key: 3,
1682
- class: P(["cn-prop-field__hint cn-prop-field__hint--error col-span-2 block text-[11px] leading-4 text-cn-danger", { "cursor-pointer": h.value }]),
1683
- title: h.value ? "点击选中出错片段" : void 0,
1684
- onClick: _
1685
- }, z(m.value), 11, rn)) : O("", !0)
1685
+ class: N(["cn-prop-field__hint cn-prop-field__hint--error col-span-2 block text-[11px] leading-4 text-cn-danger", { "cursor-pointer": _.value }]),
1686
+ title: _.value ? "点击选中出错片段" : void 0,
1687
+ onClick: v
1688
+ }, R(m.value), 11, on)) : D("", !0),
1689
+ h.value ? (P(), O("span", sn, R(h.value), 1)) : D("", !0)
1686
1690
  ]),
1687
1691
  _: 1
1688
- }, 8, ["class"])), c.value ? (F(), D(g, {
1692
+ }, 8, ["class"])), c.value ? (P(), E(g, {
1689
1693
  key: 0,
1690
1694
  ref_key: "popupRef",
1691
- ref: y,
1692
- state: B(x),
1693
- onSelect: B(C)
1694
- }, null, 8, ["state", "onSelect"])) : l.value ? (F(), D(g, {
1695
+ ref: b,
1696
+ state: z(re),
1697
+ onSelect: z(S)
1698
+ }, null, 8, ["state", "onSelect"])) : l.value ? (P(), E(g, {
1695
1699
  key: 1,
1696
1700
  ref_key: "popupRef",
1697
- ref: y,
1698
- state: B(ne),
1699
- onSelect: B(re)
1700
- }, null, 8, ["state", "onSelect"])) : O("", !0)], 64));
1701
+ ref: b,
1702
+ state: z(C),
1703
+ onSelect: z(se)
1704
+ }, null, 8, ["state", "onSelect"])) : D("", !0)], 64));
1701
1705
  }
1702
- }), on = { 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-[0_16px_40px_-12px_rgba(2,6,23,0.55)]" }, sn = { 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" }, cn = { class: "flex items-center gap-2" }, ln = { 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" }, un = { class: "text-[12px] font-medium tracking-wide text-cn-fg/90" }, dn = {
1706
+ }), ln = { 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-[0_16px_40px_-12px_rgba(2,6,23,0.55)]" }, un = { 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" }, dn = { class: "flex items-center gap-2" }, fn = { 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" }, pn = { class: "text-[12px] font-medium tracking-wide text-cn-fg/90" }, mn = {
1703
1707
  key: 0,
1704
1708
  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"
1705
- }, fn = { class: "cn-props__section-title mb-2 text-[10px] font-semibold uppercase tracking-[0.16em] text-cn-muted" }, pn = { class: "flex flex-col gap-2" }, mn = "内容编辑中:请在画布编辑框内修改,退出后此处更新", hn = /* @__PURE__ */ M({
1709
+ }, hn = { class: "cn-props__section-title mb-2 text-[10px] font-semibold uppercase tracking-[0.16em] text-cn-muted" }, gn = { class: "flex flex-col gap-2" }, _n = "内容编辑中:请在画布编辑框内修改,退出后此处更新", vn = /* @__PURE__ */ j({
1706
1710
  __name: "PropertyPanel",
1707
1711
  props: { editor: {} },
1708
1712
  setup(e) {
1709
- let t = e, n = Zt(t.editor);
1710
- fe(Z, {
1713
+ let t = e, n = $t(t.editor);
1714
+ he(Z, {
1711
1715
  canUpload: t.editor.canUpload,
1712
1716
  uploadImage: (e) => t.editor.uploadImage(e)
1713
1717
  });
1714
1718
  function r(e) {
1715
1719
  return e.completion === "rowsPath" ? n.rowsPathSource.value : n.completionSource.value;
1716
1720
  }
1717
- let i = E(() => n.layer.value !== null), a = E(() => {
1721
+ let i = T(() => n.layer.value !== null), a = T(() => {
1718
1722
  let e = n.layer.value;
1719
1723
  return e ? e.type : n.canvas.value ? "Canvas" : "—";
1720
- }), o = E(() => {
1724
+ }), o = T(() => {
1721
1725
  let e = n.layer.value ?? (n.selection.value ? null : n.canvas.value);
1722
1726
  if (!e) return [];
1723
1727
  let t = n.selection.value?.join(".") ?? "canvas", r = n.layer.value, i = n.resourceStatuses.value, a = [];
1724
1728
  for (let o of n.sections.value) {
1725
1729
  let s = [];
1726
1730
  for (let a of o.fields) {
1727
- let o = q(e, a.key);
1731
+ let o = K(e, a.key);
1728
1732
  if (!o.ok) continue;
1729
1733
  let c = n.contentLocked.value && a.data === !0;
1730
1734
  s.push({
@@ -1733,7 +1737,7 @@ var Qt = ["aria-disabled"], $t = [
1733
1737
  value: o.value,
1734
1738
  dataMode: a.data ? n.isDataMarked(a) ? "expression" : "static" : void 0,
1735
1739
  locked: c,
1736
- hint: c ? mn : a.hint && r ? a.hint(r, i) ?? void 0 : void 0,
1740
+ hint: c ? _n : a.hint && r ? a.hint(r, i) ?? void 0 : void 0,
1737
1741
  resourceStatus: a.control === "imageSrc" && typeof o.value == "string" && o.value !== "" ? i[o.value] : void 0
1738
1742
  });
1739
1743
  }
@@ -1743,14 +1747,14 @@ var Qt = ["aria-disabled"], $t = [
1743
1747
  });
1744
1748
  }
1745
1749
  return a;
1746
- }), s = E(() => {
1750
+ }), s = T(() => {
1747
1751
  let e = {}, t = n.layerBox.value, r = n.layer.value;
1748
1752
  if (!t || !r) return e;
1749
1753
  let i = /* @__PURE__ */ new Map();
1750
1754
  if (r.shape.autoWidth && i.set("autoWidth", Math.round(t.width * 100) / 100), r.shape.autoHeight && i.set("autoHeight", Math.round(t.height * 100) / 100), i.size === 0) return e;
1751
1755
  for (let t of n.sections.value) for (let r of t.fields) for (let t of r.items ?? []) {
1752
1756
  let a = t.auto ? i.get(t.auto.key.join(".")) : void 0;
1753
- a !== void 0 && (e[K(r, t).join(".")] = {
1757
+ a !== void 0 && (e[G(r, t).join(".")] = {
1754
1758
  value: a,
1755
1759
  preview: n.isPreviewBox.value
1756
1760
  });
@@ -1760,28 +1764,28 @@ var Qt = ["aria-disabled"], $t = [
1760
1764
  function c() {
1761
1765
  n.setAnchorExpanded(!n.anchorExpanded.value);
1762
1766
  }
1763
- return (e, t) => (F(), k("aside", on, [
1764
- A("header", sn, [A("div", cn, [A("span", ln, [t[0] ||= A("i", {
1767
+ return (e, t) => (P(), O("aside", ln, [
1768
+ k("header", un, [k("div", dn, [k("span", fn, [t[0] ||= k("i", {
1765
1769
  class: "size-1.5 rounded-full bg-cn-accent",
1766
1770
  "aria-hidden": "true"
1767
- }, null, -1), ce(" " + z(a.value), 1)]), A("span", un, z(i.value ? "图层属性" : "画布属性"), 1)])]),
1768
- o.value.length === 0 ? (F(), k("p", dn, " 打开文档后可编辑属性 ")) : O("", !0),
1769
- (F(!0), k(T, null, L(o.value, (e) => (F(), k("section", {
1771
+ }, null, -1), de(" " + R(a.value), 1)]), k("span", pn, R(i.value ? "图层属性" : "画布属性"), 1)])]),
1772
+ o.value.length === 0 ? (P(), O("p", mn, " 打开文档后可编辑属性 ")) : D("", !0),
1773
+ (P(!0), O(w, null, I(o.value, (e) => (P(), O("section", {
1770
1774
  key: e.title,
1771
1775
  class: "cn-props__section border-b border-cn-line/70 px-3.5 py-3 last:border-b-0"
1772
- }, [A("h3", fn, z(e.title), 1), A("div", pn, [(F(!0), k(T, null, L(e.fields, (e) => (F(), k(T, { key: e.key }, [e.field.control === "anchor" ? (F(), D(He, {
1776
+ }, [k("h3", hn, R(e.title), 1), k("div", gn, [(P(!0), O(w, null, I(e.fields, (e) => (P(), O(w, { key: e.key }, [e.field.control === "anchor" ? (P(), E(Ge, {
1773
1777
  key: 0,
1774
1778
  field: e.field,
1775
1779
  "model-value": e.value,
1776
- expanded: B(n).anchorExpanded.value,
1777
- onChange: (t) => B(n).commit(e.field, t, !0),
1780
+ expanded: z(n).anchorExpanded.value,
1781
+ onChange: (t) => z(n).commit(e.field, t, !0),
1778
1782
  onToggle: c
1779
1783
  }, null, 8, [
1780
1784
  "field",
1781
1785
  "model-value",
1782
1786
  "expanded",
1783
1787
  "onChange"
1784
- ])) : (F(), D(an, {
1788
+ ])) : (P(), E(cn, {
1785
1789
  key: 1,
1786
1790
  field: e.field,
1787
1791
  value: e.value,
@@ -1791,10 +1795,10 @@ var Qt = ["aria-disabled"], $t = [
1791
1795
  completion: r(e.field),
1792
1796
  displays: s.value,
1793
1797
  "resource-status": e.resourceStatus,
1794
- onInput: (t) => B(n).commit(e.field, t, !1),
1795
- onChange: (t) => B(n).commit(e.field, t, !0),
1796
- onToggleMode: (t) => B(n).toggleDataMode(e.field),
1797
- onSubCommit: B(n).commit
1798
+ onInput: (t) => z(n).commit(e.field, t, !1),
1799
+ onChange: (t) => z(n).commit(e.field, t, !0),
1800
+ onToggleMode: (t) => z(n).toggleDataMode(e.field),
1801
+ onSubCommit: z(n).commit
1798
1802
  }, null, 8, [
1799
1803
  "field",
1800
1804
  "value",
@@ -1813,4 +1817,4 @@ var Qt = ["aria-disabled"], $t = [
1813
1817
  }
1814
1818
  });
1815
1819
  //#endregion
1816
- export { Z as a, Ce as c, Te as d, q as f, Xt as i, De as l, an as n, Et as o, Zt as r, Oe as s, hn as t, we as u };
1820
+ export { Z as a, Ee as c, Oe as d, K as f, Qt as i, Ae as l, cn as n, Ot as o, $t as r, je as s, vn as t, De as u };