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