@hankchen/canvas-editor-vue 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas/CanvasSurface.d.ts +28 -1
- package/dist/canvas/{ContentTypePill.d.ts → EditOverlayToolbar.d.ts} +19 -0
- package/dist/canvas/TextEditingOverlay.d.ts +31 -3
- package/dist/canvas/index.d.ts +1 -1
- package/dist/canvas/useTextEditing.d.ts +30 -8
- package/dist/{canvas-ZMyaouKe.js → canvas-CX1RdlFC.js} +816 -437
- package/dist/canvas.js +2 -2
- package/dist/index.js +15 -14
- package/dist/layer-panel/LayerPanel.d.ts +1 -27
- package/dist/layer-panel/TemplateTableForm.d.ts +38 -0
- package/dist/layer-panel/addMenu.d.ts +20 -8
- package/dist/layer-panel/index.d.ts +6 -3
- package/dist/{layer-panel-CEyB57XM.js → layer-panel-kOceTf8H.js} +329 -243
- package/dist/layer-panel.js +2 -2
- package/dist/panel-theme.css +24 -0
- package/dist/{completionAnchor-Da8VhzMQ.js → popupPosition-Ck5Gsvjy.js} +163 -107
- package/dist/property-panel/PropertyField.d.ts +6 -0
- package/dist/property-panel/fieldSchema.d.ts +7 -1
- package/dist/property-panel/fields/ImageSrcField.d.ts +5 -1
- package/dist/property-panel/fields/ResourceValueField.d.ts +19 -0
- package/dist/property-panel/fields/TextareaField.d.ts +1 -0
- package/dist/property-panel/fields/ValueTypeSegmented.d.ts +3 -1
- package/dist/property-panel/index.d.ts +5 -3
- package/dist/property-panel/usePropertyPanel.d.ts +16 -4
- package/dist/{property-panel-DmSf_GPu.js → property-panel-B32ZBQdf.js} +472 -376
- package/dist/property-panel.js +3 -2
- package/dist/resourceTemplate-cdcQtp9a.js +246 -0
- package/dist/shared/ExpressionPathPicker.d.ts +25 -0
- package/dist/shared/completion.d.ts +14 -10
- package/dist/shared/expressionContext.d.ts +2 -2
- package/dist/shared/index.d.ts +14 -1
- package/dist/shared/mergeKey.d.ts +2 -0
- package/dist/shared/pathPickerModel.d.ts +11 -0
- package/dist/shared/popupPosition.d.ts +41 -0
- package/dist/shared/resourceTemplate.d.ts +7 -0
- package/dist/shared/useExpressionCompletion.d.ts +0 -7
- package/dist/shared/useExpressionDiagnostics.d.ts +15 -0
- package/dist/shared.js +10 -9
- package/dist/style.css +1 -1
- package/dist/uploadFile-D1RY-ji0.js +516 -0
- package/dist/usePathCompletion-Do17CQ6l.js +220 -0
- package/package.json +2 -2
- package/dist/uploadFile-DXAEX9kG.js +0 -455
- package/dist/usePathCompletion-C52F4phW.js +0 -229
- /package/dist/{property-panel → shared}/fontPicker.d.ts +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as e } from "./createLucideIcon-SCvtEGVf.js";
|
|
2
2
|
import { i as t, r as n, t as r } from "./layerPath-uy2ywyld.js";
|
|
3
|
-
import { i,
|
|
3
|
+
import { o as i, s as a, u as o } from "./popupPosition-Ck5Gsvjy.js";
|
|
4
4
|
import { c as s, i as c, s as l, t as u } from "./useTransientFeedback-CTjmMmFF.js";
|
|
5
|
-
import { n as
|
|
6
|
-
import { n as
|
|
7
|
-
import { Fragment as
|
|
8
|
-
var
|
|
5
|
+
import { n as d, t as f } from "./usePathCompletion-Do17CQ6l.js";
|
|
6
|
+
import { n as p, t as m } from "./useDataSourceSchema-CGbldbUj.js";
|
|
7
|
+
import { Fragment as h, computed as g, createBlock as _, createCommentVNode as v, createElementBlock as y, createElementVNode as b, createVNode as x, defineComponent as S, nextTick as ee, normalizeClass as C, normalizeStyle as te, onScopeDispose as ne, openBlock as w, ref as T, renderList as re, shallowRef as E, toDisplayString as D, unref as O, vModelText as k, watch as ie, withCtx as A, withDirectives as j, withKeys as ae, withModifiers as M } from "vue";
|
|
8
|
+
var oe = e({
|
|
9
9
|
name: "eye-off",
|
|
10
10
|
size: 24,
|
|
11
11
|
node: [
|
|
@@ -26,7 +26,7 @@ var ue = e({
|
|
|
26
26
|
key: "1ooewy"
|
|
27
27
|
}]
|
|
28
28
|
]
|
|
29
|
-
}),
|
|
29
|
+
}), se = e({
|
|
30
30
|
name: "eye",
|
|
31
31
|
size: 24,
|
|
32
32
|
node: [["path", {
|
|
@@ -38,7 +38,7 @@ var ue = e({
|
|
|
38
38
|
r: "3",
|
|
39
39
|
key: "1v7zrd"
|
|
40
40
|
}]]
|
|
41
|
-
}),
|
|
41
|
+
}), ce = e({
|
|
42
42
|
name: "grip-vertical",
|
|
43
43
|
size: 24,
|
|
44
44
|
node: [
|
|
@@ -79,7 +79,7 @@ var ue = e({
|
|
|
79
79
|
key: "f4zoj3"
|
|
80
80
|
}]
|
|
81
81
|
]
|
|
82
|
-
}),
|
|
82
|
+
}), le = e({
|
|
83
83
|
name: "lock-open",
|
|
84
84
|
size: 24,
|
|
85
85
|
node: [["rect", {
|
|
@@ -95,7 +95,7 @@ var ue = e({
|
|
|
95
95
|
key: "1mm8w8"
|
|
96
96
|
}]],
|
|
97
97
|
aliases: ["unlock"]
|
|
98
|
-
}),
|
|
98
|
+
}), ue = e({
|
|
99
99
|
name: "lock",
|
|
100
100
|
size: 24,
|
|
101
101
|
node: [["rect", {
|
|
@@ -110,7 +110,7 @@ var ue = e({
|
|
|
110
110
|
d: "M7 11V7a5 5 0 0 1 10 0v4",
|
|
111
111
|
key: "fwvmzm"
|
|
112
112
|
}]]
|
|
113
|
-
}),
|
|
113
|
+
}), de = e({
|
|
114
114
|
name: "pencil",
|
|
115
115
|
size: 24,
|
|
116
116
|
node: [["path", {
|
|
@@ -123,7 +123,7 @@ var ue = e({
|
|
|
123
123
|
});
|
|
124
124
|
//#endregion
|
|
125
125
|
//#region ../canvas-editor/src/editing/layerPanel.ts
|
|
126
|
-
function
|
|
126
|
+
function N(e) {
|
|
127
127
|
switch (e.type) {
|
|
128
128
|
case "TableLayer": return e.template === null ? [{
|
|
129
129
|
key: "rows",
|
|
@@ -149,7 +149,7 @@ function k(e) {
|
|
|
149
149
|
}];
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function P(e) {
|
|
153
153
|
switch (e.type) {
|
|
154
154
|
case "TextLayer":
|
|
155
155
|
case "ImageLayer":
|
|
@@ -157,22 +157,22 @@ function A(e) {
|
|
|
157
157
|
default: return null;
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
var
|
|
161
|
-
function
|
|
162
|
-
let t =
|
|
160
|
+
var F = "{{…}}";
|
|
161
|
+
function I(e) {
|
|
162
|
+
let t = P(e);
|
|
163
163
|
if (t === null) return "";
|
|
164
164
|
let n = o(t).parts.flatMap((e) => e.kind === "fragment" && e.expr !== "" ? [e.expr] : []);
|
|
165
|
-
return n.length === 0 ?
|
|
165
|
+
return n.length === 0 ? F : n.map((e) => `{{${e}}}`).join(" ");
|
|
166
166
|
}
|
|
167
|
-
function
|
|
167
|
+
function L(e, t, n, i) {
|
|
168
168
|
let a = [];
|
|
169
|
-
for (let { key: n, layers: r } of
|
|
169
|
+
for (let { key: n, layers: r } of N(e)) for (let e = 0; e < r.length; e += 1) {
|
|
170
170
|
let o = n === "rows" ? "row" : n === "cells" ? "cell" : n === "template" ? "templateRow" : "content", s = n === "content" ? [...t, "content"] : n === "template" ? [...t, "template"] : [
|
|
171
171
|
...t,
|
|
172
172
|
n,
|
|
173
173
|
e
|
|
174
174
|
];
|
|
175
|
-
a.push(
|
|
175
|
+
a.push(L(r[e], s, o, i));
|
|
176
176
|
}
|
|
177
177
|
return {
|
|
178
178
|
type: e.type,
|
|
@@ -181,17 +181,17 @@ function N(e, t, n, i) {
|
|
|
181
181
|
name: e.name,
|
|
182
182
|
visible: e.visible,
|
|
183
183
|
locked: r(t, i),
|
|
184
|
-
expressionPrefix:
|
|
184
|
+
expressionPrefix: I(e),
|
|
185
185
|
...e.type === "TableLayer" ? { templated: e.template !== null } : null,
|
|
186
186
|
children: a
|
|
187
187
|
};
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function R(e, t = []) {
|
|
190
190
|
let n = [];
|
|
191
|
-
for (let r = e.layers.length - 1; r >= 0; --r) n.push(
|
|
191
|
+
for (let r = e.layers.length - 1; r >= 0; --r) n.push(L(e.layers[r], ["layers", r], "root", t));
|
|
192
192
|
return n;
|
|
193
193
|
}
|
|
194
|
-
var
|
|
194
|
+
var z = [
|
|
195
195
|
{
|
|
196
196
|
id: "heading",
|
|
197
197
|
fontSize: 40
|
|
@@ -204,7 +204,47 @@ var F = [
|
|
|
204
204
|
id: "body",
|
|
205
205
|
fontSize: 16
|
|
206
206
|
}
|
|
207
|
-
],
|
|
207
|
+
], B = [
|
|
208
|
+
{
|
|
209
|
+
id: "free",
|
|
210
|
+
ratio: null
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
id: "1:1",
|
|
214
|
+
ratio: {
|
|
215
|
+
w: 1,
|
|
216
|
+
h: 1
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
id: "4:3",
|
|
221
|
+
ratio: {
|
|
222
|
+
w: 4,
|
|
223
|
+
h: 3
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
id: "3:4",
|
|
228
|
+
ratio: {
|
|
229
|
+
w: 3,
|
|
230
|
+
h: 4
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
id: "16:9",
|
|
235
|
+
ratio: {
|
|
236
|
+
w: 16,
|
|
237
|
+
h: 9
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
id: "9:16",
|
|
242
|
+
ratio: {
|
|
243
|
+
w: 9,
|
|
244
|
+
h: 16
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
], V = [
|
|
208
248
|
{
|
|
209
249
|
kind: "layer",
|
|
210
250
|
type: "TextLayer",
|
|
@@ -234,52 +274,131 @@ var F = [
|
|
|
234
274
|
label: "模板表",
|
|
235
275
|
title: "新增模板表(行模板 + 数据行展开)"
|
|
236
276
|
}
|
|
237
|
-
],
|
|
277
|
+
], H = {
|
|
238
278
|
heading: "标题",
|
|
239
279
|
subheading: "副标题",
|
|
240
280
|
body: "正文"
|
|
241
|
-
},
|
|
281
|
+
}, U = z.map(({ id: e, fontSize: t }) => ({
|
|
242
282
|
kind: "text-preset",
|
|
243
283
|
preset: e,
|
|
244
|
-
label:
|
|
245
|
-
title: `画拉建${
|
|
246
|
-
})),
|
|
247
|
-
|
|
284
|
+
label: H[e],
|
|
285
|
+
title: `画拉建${H[e]}文本层(字号 ${t},点击后在画布拖拽定落位与尺寸,Esc 取消)`
|
|
286
|
+
})), W = {
|
|
287
|
+
free: "自由",
|
|
288
|
+
"1:1": "1:1",
|
|
289
|
+
"4:3": "4:3",
|
|
290
|
+
"3:4": "3:4",
|
|
291
|
+
"16:9": "16:9",
|
|
292
|
+
"9:16": "9:16"
|
|
293
|
+
};
|
|
294
|
+
function G(e) {
|
|
295
|
+
return e === null ? "任意宽高" : e.w === e.h ? "正方形" : e.w > e.h ? "横向" : "纵向";
|
|
296
|
+
}
|
|
297
|
+
var K = B.map(({ id: e, ratio: t }) => ({
|
|
298
|
+
kind: "ratio-preset",
|
|
299
|
+
preset: e,
|
|
300
|
+
label: W[e],
|
|
301
|
+
title: e === "free" ? "画拉建自由比例图片层(任意宽高,画拉中按住 Shift 临时锁 1:1;点击后在画布拖拽定落位与尺寸,Esc 取消)" : `画拉建 ${e} 图片层(${G(t)},画拉中按住 Shift 临时自由;点击后在画布拖拽定落位与尺寸,Esc 取消)`
|
|
302
|
+
}));
|
|
303
|
+
function q(e, t, n) {
|
|
304
|
+
let r = e.findIndex(n);
|
|
248
305
|
return [
|
|
249
|
-
...
|
|
250
|
-
...
|
|
251
|
-
...
|
|
306
|
+
...e.slice(0, r + 1),
|
|
307
|
+
...t,
|
|
308
|
+
...e.slice(r + 1)
|
|
252
309
|
];
|
|
253
|
-
}
|
|
310
|
+
}
|
|
311
|
+
var J = (e) => (t) => t.kind === "layer" && t.type === e, Y = q(q(V, U, J("TextLayer")), K, J("ImageLayer")), fe = V, pe = {
|
|
312
|
+
key: 0,
|
|
313
|
+
class: "px-2 pb-1 text-[11px] text-cn-danger"
|
|
314
|
+
}, me = { class: "flex gap-1 p-1" }, he = /* @__PURE__ */ S({
|
|
315
|
+
__name: "TemplateTableForm",
|
|
316
|
+
props: { editor: {} },
|
|
317
|
+
emits: ["confirm", "cancel"],
|
|
318
|
+
setup(e, { emit: t }) {
|
|
319
|
+
let n = e, r = t, a = T(""), o = T(!1);
|
|
320
|
+
function s() {
|
|
321
|
+
let e = a.value.trim();
|
|
322
|
+
if (e === "") {
|
|
323
|
+
o.value = !0;
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
r("confirm", e);
|
|
327
|
+
}
|
|
328
|
+
let c = m(n.editor), l = g(() => d(c.value)), u = T(null), p = T(null), { popup: h, accept: _ } = f({
|
|
329
|
+
target: u,
|
|
330
|
+
enabled: () => !0,
|
|
331
|
+
resolve: (e) => l.value?.(e) ?? null,
|
|
332
|
+
popupEl: g(() => p.value?.rootEl ?? null)
|
|
333
|
+
});
|
|
334
|
+
function S(e) {
|
|
335
|
+
if (e.key === "Enter") {
|
|
336
|
+
if (h.open && h.items.length > 0) return;
|
|
337
|
+
e.preventDefault(), s();
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
e.key === "Escape" && (h.open ? e.stopPropagation() : r("cancel"));
|
|
341
|
+
}
|
|
342
|
+
return (e, t) => (w(), y("div", null, [
|
|
343
|
+
t[3] ||= b("p", { class: "px-2 pt-1 text-[11px] leading-4 text-cn-muted" }, "模板行按数据行路径展开成表", -1),
|
|
344
|
+
j(b("input", {
|
|
345
|
+
ref_key: "rowsPathInputEl",
|
|
346
|
+
ref: u,
|
|
347
|
+
"onUpdate:modelValue": t[0] ||= (e) => a.value = e,
|
|
348
|
+
"data-template-rows-path": "",
|
|
349
|
+
type: "text",
|
|
350
|
+
placeholder: "如 order.items",
|
|
351
|
+
class: C(["mx-1 my-1 w-[calc(100%-8px)] rounded border bg-cn-field px-2 py-1 text-[12px] text-cn-fg outline-none focus:border-cn-accent/60", o.value ? "border-cn-danger" : "border-cn-field-line"]),
|
|
352
|
+
onInput: t[1] ||= (e) => o.value = !1,
|
|
353
|
+
onKeydown: S
|
|
354
|
+
}, null, 34), [[k, a.value]]),
|
|
355
|
+
o.value ? (w(), y("p", pe, "rowsPath 必填")) : v("", !0),
|
|
356
|
+
b("div", me, [b("button", {
|
|
357
|
+
type: "button",
|
|
358
|
+
"data-template-confirm": "",
|
|
359
|
+
class: "flex-1 rounded bg-cn-accent/20 px-2 py-1 text-[12px] text-cn-accent hover:bg-cn-accent/30",
|
|
360
|
+
onClick: s
|
|
361
|
+
}, " 创建 "), b("button", {
|
|
362
|
+
type: "button",
|
|
363
|
+
"data-template-cancel": "",
|
|
364
|
+
class: "flex-1 rounded px-2 py-1 text-[12px] text-cn-muted hover:text-cn-fg",
|
|
365
|
+
onClick: t[2] ||= (e) => r("cancel")
|
|
366
|
+
}, " 取消 ")]),
|
|
367
|
+
x(i, {
|
|
368
|
+
ref_key: "pathPopupRef",
|
|
369
|
+
ref: p,
|
|
370
|
+
state: O(h),
|
|
371
|
+
onSelect: O(_)
|
|
372
|
+
}, null, 8, ["state", "onSelect"])
|
|
373
|
+
]));
|
|
374
|
+
}
|
|
375
|
+
});
|
|
254
376
|
//#endregion
|
|
255
377
|
//#region src/layer-panel/useLayerPanel.ts
|
|
256
|
-
function
|
|
257
|
-
let t =
|
|
378
|
+
function ge(e) {
|
|
379
|
+
let t = E(e.store.doc), n = E(e.store.ui.selection), r = E(e.store.ui.hovered), i = E(e.store.ui.renaming), a = E(e.store.ui.lockedPaths), o = e.subscribe((o) => {
|
|
258
380
|
o.scope === "doc" ? (t.value = e.store.doc, n.value = e.store.ui.selection, r.value = e.store.ui.hovered, i.value = e.store.ui.renaming, a.value = e.store.ui.lockedPaths) : o.branch === "selection" ? n.value = e.store.ui.selection : o.branch === "hovered" ? r.value = e.store.ui.hovered : o.branch === "renaming" ? i.value = e.store.ui.renaming : o.branch === "lockedPaths" && (a.value = e.store.ui.lockedPaths);
|
|
259
381
|
});
|
|
260
|
-
return
|
|
261
|
-
outline:
|
|
262
|
-
selection:
|
|
263
|
-
hovered:
|
|
264
|
-
renaming:
|
|
382
|
+
return ne(o, !0), {
|
|
383
|
+
outline: g(() => t.value ? R(t.value, a.value) : []),
|
|
384
|
+
selection: g(() => n.value),
|
|
385
|
+
hovered: g(() => r.value),
|
|
386
|
+
renaming: g(() => i.value)
|
|
265
387
|
};
|
|
266
388
|
}
|
|
267
|
-
function
|
|
389
|
+
function _e(e, t) {
|
|
268
390
|
return t > 0 && e < t / 2;
|
|
269
391
|
}
|
|
270
392
|
//#endregion
|
|
271
393
|
//#region src/layer-panel/LayerPanel.vue?vue&type=script&setup=true&lang.ts
|
|
272
|
-
var
|
|
394
|
+
var ve = { class: "cn-props flex w-[232px] 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)]" }, ye = { class: "sticky top-0 z-10 flex items-center justify-between border-b border-cn-line bg-cn-bg-elevated/95 px-3.5 py-2.5" }, be = { class: "flex items-center gap-1" }, xe = [
|
|
273
395
|
"aria-expanded",
|
|
274
396
|
"onClick",
|
|
275
397
|
"onKeydown"
|
|
276
|
-
],
|
|
277
|
-
key: 0,
|
|
278
|
-
class: "px-2 pb-1 text-[11px] text-cn-danger"
|
|
279
|
-
}, Se = { class: "flex gap-1 p-1" }, Ce = ["onClick"], we = ["onClick"], Te = {
|
|
398
|
+
], Se = {
|
|
280
399
|
key: 0,
|
|
281
400
|
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"
|
|
282
|
-
},
|
|
401
|
+
}, Ce = [
|
|
283
402
|
"data-key",
|
|
284
403
|
"draggable",
|
|
285
404
|
"onClick",
|
|
@@ -287,31 +406,27 @@ var ge = { class: "cn-props flex w-[232px] shrink-0 flex-col overflow-y-auto rou
|
|
|
287
406
|
"onDragstart",
|
|
288
407
|
"onDragover",
|
|
289
408
|
"onDrop"
|
|
290
|
-
],
|
|
409
|
+
], we = ["onDragstart"], Te = ["title"], Ee = ["onDblclick"], De = [
|
|
291
410
|
"title",
|
|
292
411
|
"aria-pressed",
|
|
293
412
|
"onClick"
|
|
294
|
-
],
|
|
413
|
+
], Oe = [
|
|
295
414
|
"title",
|
|
296
415
|
"aria-pressed",
|
|
297
416
|
"onClick"
|
|
298
|
-
],
|
|
417
|
+
], ke = ["onClick"], Ae = [
|
|
299
418
|
"disabled",
|
|
300
419
|
"title",
|
|
301
420
|
"onClick"
|
|
302
|
-
],
|
|
421
|
+
], je = ["onClick"], Me = ["onClick"], Ne = [
|
|
303
422
|
"disabled",
|
|
304
423
|
"title",
|
|
305
424
|
"onClick"
|
|
306
|
-
],
|
|
425
|
+
], X = /* @__PURE__ */ S({
|
|
307
426
|
__name: "LayerPanel",
|
|
308
427
|
props: { editor: {} },
|
|
309
428
|
setup(e) {
|
|
310
|
-
let r = e,
|
|
311
|
-
function j() {
|
|
312
|
-
S.value = !1, k.value = "", A.value = !1;
|
|
313
|
-
}
|
|
314
|
-
let M = f(() => S.value ? [] : z.map((e) => e.kind === "layer" ? {
|
|
429
|
+
let r = e, i = `解锁图层(${s("toggleLayerLock", l())})`, o = `图层已锁定(${s("toggleLayerLock", l())} 解锁后可删除)`, d = ge(r.editor), f = T(!1), m = g(() => f.value ? [] : Y.map((e) => e.kind === "layer" ? {
|
|
315
430
|
label: e.label,
|
|
316
431
|
title: e.title,
|
|
317
432
|
dataAttrs: { "data-add-layer": e.type },
|
|
@@ -328,44 +443,35 @@ var ge = { class: "cn-props flex w-[232px] shrink-0 flex-col overflow-y-auto rou
|
|
|
328
443
|
run: () => {
|
|
329
444
|
r.editor.armLayerCreate("TextLayer", e.preset), u().show(c);
|
|
330
445
|
}
|
|
446
|
+
} : e.kind === "ratio-preset" ? {
|
|
447
|
+
label: e.label,
|
|
448
|
+
title: e.title,
|
|
449
|
+
dataAttrs: {
|
|
450
|
+
"data-add-layer": "ImageLayer",
|
|
451
|
+
"data-ratio-preset": e.preset
|
|
452
|
+
},
|
|
453
|
+
run: () => {
|
|
454
|
+
r.editor.armLayerCreate("ImageLayer", e.preset), u().show(c);
|
|
455
|
+
}
|
|
331
456
|
} : {
|
|
332
457
|
label: e.label,
|
|
333
458
|
title: e.title,
|
|
334
459
|
dataAttrs: { "data-add-layer": "template-table" },
|
|
335
460
|
keepsOpen: !0,
|
|
336
461
|
run: () => {
|
|
337
|
-
|
|
462
|
+
f.value = !0;
|
|
338
463
|
}
|
|
339
464
|
}));
|
|
340
|
-
function
|
|
341
|
-
|
|
342
|
-
if (t === "") {
|
|
343
|
-
A.value = !0;
|
|
344
|
-
return;
|
|
345
|
-
}
|
|
346
|
-
r.editor.addTemplateTable(t), j(), e();
|
|
347
|
-
}
|
|
348
|
-
function P(e) {
|
|
349
|
-
j(), e();
|
|
465
|
+
function S(e, t) {
|
|
466
|
+
r.editor.armTemplateTableCreate(e), u().show(c), t();
|
|
350
467
|
}
|
|
351
|
-
function
|
|
352
|
-
|
|
468
|
+
function ne(e) {
|
|
469
|
+
f.value = !1, e();
|
|
353
470
|
}
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
enabled: () => S.value,
|
|
357
|
-
resolve: (e) => L.value?.(e) ?? null,
|
|
358
|
-
popupEl: f(() => B.value?.rootEl ?? null)
|
|
359
|
-
});
|
|
360
|
-
function Re(e, t) {
|
|
361
|
-
if (e.key === "Enter") {
|
|
362
|
-
if (U.open && U.items.length > 0) return;
|
|
363
|
-
e.preventDefault(), N(t);
|
|
364
|
-
return;
|
|
365
|
-
}
|
|
366
|
-
e.key === "Escape" && U.open && e.stopPropagation();
|
|
471
|
+
function E() {
|
|
472
|
+
f.value = !1;
|
|
367
473
|
}
|
|
368
|
-
function
|
|
474
|
+
function N(e, t) {
|
|
369
475
|
switch (e.role) {
|
|
370
476
|
case "root": return e.name === "" ? `${e.type} ${t}` : e.name;
|
|
371
477
|
case "row": return `行 ${Number(e.path[e.path.length - 1]) + 1}`;
|
|
@@ -374,7 +480,7 @@ var ge = { class: "cn-props flex w-[232px] shrink-0 flex-col overflow-y-auto rou
|
|
|
374
480
|
case "content": return e.type;
|
|
375
481
|
}
|
|
376
482
|
}
|
|
377
|
-
let
|
|
483
|
+
let P = g(() => {
|
|
378
484
|
let e = [], t = /* @__PURE__ */ new Map();
|
|
379
485
|
function r(i, a, o, s) {
|
|
380
486
|
let c = i.role === "row" ? i.path.slice(0, -2) : i.role === "templateRow" ? i.path.slice(0, -1) : s, l = 0;
|
|
@@ -382,42 +488,42 @@ var ge = { class: "cn-props flex w-[232px] shrink-0 flex-col overflow-y-auto rou
|
|
|
382
488
|
key: i.path.join("."),
|
|
383
489
|
node: i,
|
|
384
490
|
indentLevel: a,
|
|
385
|
-
label:
|
|
491
|
+
label: N(i, l),
|
|
386
492
|
indexInGroup: o,
|
|
387
493
|
tablePath: c,
|
|
388
494
|
inTemplate: n(i.path),
|
|
389
495
|
draggable: i.role === "root" || i.role === "row" || i.role === "cell"
|
|
390
496
|
}), i.children.forEach((e, t) => r(e, a + 1, t, c));
|
|
391
497
|
}
|
|
392
|
-
return
|
|
393
|
-
}),
|
|
394
|
-
function
|
|
498
|
+
return d.outline.value.forEach((e, t) => r(e, 0, t, null)), e;
|
|
499
|
+
}), F = g(() => P.value.length > 0);
|
|
500
|
+
function I(e) {
|
|
395
501
|
r.editor.setSelection(e.node.path);
|
|
396
502
|
}
|
|
397
|
-
function
|
|
503
|
+
function L(e) {
|
|
398
504
|
r.editor.setHovered(e === null ? null : e.node.path);
|
|
399
505
|
}
|
|
400
|
-
function
|
|
506
|
+
function R(e) {
|
|
401
507
|
r.editor.addTableRow(e.node.path);
|
|
402
508
|
}
|
|
403
|
-
function
|
|
509
|
+
function z(e) {
|
|
404
510
|
r.editor.addTableCell(e.node.path);
|
|
405
511
|
}
|
|
406
|
-
function
|
|
512
|
+
function B(e) {
|
|
407
513
|
r.editor.addTemplateCell(e.node.path.slice(0, -1));
|
|
408
514
|
}
|
|
409
|
-
function
|
|
515
|
+
function V(e) {
|
|
410
516
|
r.editor.deleteLayer(e.node.path);
|
|
411
517
|
}
|
|
412
|
-
function
|
|
518
|
+
function H(e) {
|
|
413
519
|
r.editor.toggleLayerVisibility(e.node.path);
|
|
414
520
|
}
|
|
415
|
-
function
|
|
521
|
+
function U(e) {
|
|
416
522
|
r.editor.toggleLayerLock(e.node.path);
|
|
417
523
|
}
|
|
418
|
-
let
|
|
419
|
-
function
|
|
420
|
-
let r =
|
|
524
|
+
let W = T(null), G = T(null);
|
|
525
|
+
function K(e) {
|
|
526
|
+
let r = W.value;
|
|
421
527
|
if (!r) return !1;
|
|
422
528
|
if (r.kind === "root") return e.node.role === "root";
|
|
423
529
|
if (r.kind === "row") return e.node.role === "row";
|
|
@@ -425,11 +531,11 @@ var ge = { class: "cn-props flex w-[232px] shrink-0 flex-col overflow-y-auto rou
|
|
|
425
531
|
let i = n(r.cellPath);
|
|
426
532
|
return i === e.inTemplate ? !i || t(r.cellPath.slice(0, -2), e.node.path.slice(0, -2)) : !1;
|
|
427
533
|
}
|
|
428
|
-
function
|
|
534
|
+
function q(e) {
|
|
429
535
|
return e.node.role === "root";
|
|
430
536
|
}
|
|
431
|
-
function
|
|
432
|
-
e.draggable && (
|
|
537
|
+
function J(e, t) {
|
|
538
|
+
e.draggable && (W.value = e.node.role === "root" ? {
|
|
433
539
|
kind: "root",
|
|
434
540
|
from: e.indexInGroup
|
|
435
541
|
} : e.node.role === "row" ? {
|
|
@@ -443,74 +549,74 @@ var ge = { class: "cn-props flex w-[232px] shrink-0 flex-col overflow-y-auto rou
|
|
|
443
549
|
cellPath: e.node.path
|
|
444
550
|
}, t.dataTransfer?.setData("text/plain", e.key), t.dataTransfer && (t.dataTransfer.effectAllowed = "move"));
|
|
445
551
|
}
|
|
446
|
-
function
|
|
447
|
-
|
|
552
|
+
function fe(e, t) {
|
|
553
|
+
q(e) || J(e, t);
|
|
448
554
|
}
|
|
449
|
-
function
|
|
450
|
-
if (!
|
|
555
|
+
function pe(e) {
|
|
556
|
+
if (!q(e)) return e.draggable || void 0;
|
|
451
557
|
}
|
|
452
|
-
function
|
|
453
|
-
if (!
|
|
454
|
-
let n = t.currentTarget.getBoundingClientRect(), r =
|
|
455
|
-
t.preventDefault(),
|
|
558
|
+
function me(e, t) {
|
|
559
|
+
if (!K(e)) return;
|
|
560
|
+
let n = t.currentTarget.getBoundingClientRect(), r = _e(t.clientY - n.top, n.height);
|
|
561
|
+
t.preventDefault(), G.value = {
|
|
456
562
|
key: e.key,
|
|
457
563
|
edge: r ? "before" : "after"
|
|
458
564
|
};
|
|
459
565
|
}
|
|
460
|
-
function
|
|
461
|
-
if (!
|
|
462
|
-
let n =
|
|
566
|
+
function X(e, t) {
|
|
567
|
+
if (!K(e)) return;
|
|
568
|
+
let n = G.value, i = W.value;
|
|
463
569
|
if (!i || !n || n.key !== e.key) return;
|
|
464
570
|
t.preventDefault();
|
|
465
571
|
let a = n.edge === "before" ? e.indexInGroup : e.indexInGroup + 1;
|
|
466
|
-
i.kind === "root" ? r.editor.moveRootLayer(i.from, a) : i.kind === "row" ? e.tablePath !== null && e.tablePath.join(".") === i.tablePath.join(".") ? r.editor.moveTableRow(i.tablePath, i.from, a) : r.editor.moveTableRowToTable(i.rowPath, e.tablePath, a) : r.editor.moveTableCellToRow(i.cellPath, e.node.path.slice(0, -2), a),
|
|
572
|
+
i.kind === "root" ? r.editor.moveRootLayer(i.from, a) : i.kind === "row" ? e.tablePath !== null && e.tablePath.join(".") === i.tablePath.join(".") ? r.editor.moveTableRow(i.tablePath, i.from, a) : r.editor.moveTableRowToTable(i.rowPath, e.tablePath, a) : r.editor.moveTableCellToRow(i.cellPath, e.node.path.slice(0, -2), a), W.value = null, G.value = null;
|
|
467
573
|
}
|
|
468
|
-
function
|
|
469
|
-
|
|
574
|
+
function Pe() {
|
|
575
|
+
W.value = null, G.value = null;
|
|
470
576
|
}
|
|
471
|
-
function
|
|
472
|
-
return t(
|
|
577
|
+
function Fe(e) {
|
|
578
|
+
return t(d.selection.value, e.node.path);
|
|
473
579
|
}
|
|
474
|
-
function
|
|
475
|
-
return t(
|
|
580
|
+
function Ie(e) {
|
|
581
|
+
return t(d.hovered.value, e.node.path);
|
|
476
582
|
}
|
|
477
|
-
let
|
|
478
|
-
function
|
|
479
|
-
|
|
583
|
+
let Z = T(""), Q = null, Le = null;
|
|
584
|
+
function Re(e) {
|
|
585
|
+
Le = e instanceof HTMLInputElement ? e : null;
|
|
480
586
|
}
|
|
481
|
-
function
|
|
482
|
-
return t(
|
|
587
|
+
function ze(e) {
|
|
588
|
+
return t(d.renaming.value, e.node.path);
|
|
483
589
|
}
|
|
484
|
-
function
|
|
485
|
-
|
|
590
|
+
function Be(e) {
|
|
591
|
+
q(e) && r.editor.beginRename(e.node.path);
|
|
486
592
|
}
|
|
487
|
-
function
|
|
488
|
-
let e =
|
|
489
|
-
if (
|
|
593
|
+
function $() {
|
|
594
|
+
let e = Z.value.trim();
|
|
595
|
+
if (Q !== null && e === Q.trim()) {
|
|
490
596
|
r.editor.cancelRename();
|
|
491
597
|
return;
|
|
492
598
|
}
|
|
493
599
|
r.editor.commitRename(e);
|
|
494
600
|
}
|
|
495
|
-
function
|
|
601
|
+
function Ve() {
|
|
496
602
|
r.editor.cancelRename();
|
|
497
603
|
}
|
|
498
|
-
return
|
|
604
|
+
return ie(d.renaming, async (e) => {
|
|
499
605
|
if (e === null) {
|
|
500
|
-
|
|
606
|
+
Q = null;
|
|
501
607
|
return;
|
|
502
608
|
}
|
|
503
|
-
let n =
|
|
504
|
-
|
|
505
|
-
let r =
|
|
609
|
+
let n = P.value.find((n) => t(n.node.path, e));
|
|
610
|
+
Z.value = n?.label ?? "", Q = Z.value, await ee();
|
|
611
|
+
let r = Le;
|
|
506
612
|
r && (r.focus({ preventScroll: !0 }), r.select());
|
|
507
|
-
}), (e, t) => (
|
|
508
|
-
|
|
613
|
+
}), (e, t) => (w(), y("aside", ve, [
|
|
614
|
+
b("header", ye, [t[7] ||= b("span", { class: "text-[12px] font-medium tracking-wide text-cn-fg/90" }, "图层", -1), b("div", be, [x(p, {
|
|
509
615
|
label: "新增图层",
|
|
510
|
-
items:
|
|
511
|
-
onClosed:
|
|
616
|
+
items: m.value,
|
|
617
|
+
onClosed: E
|
|
512
618
|
}, {
|
|
513
|
-
trigger:
|
|
619
|
+
trigger: A(({ open: e, toggle: t, triggerRef: n, onKeydown: r }) => [b("button", {
|
|
514
620
|
ref: n,
|
|
515
621
|
type: "button",
|
|
516
622
|
"data-add-menu": "",
|
|
@@ -520,171 +626,151 @@ var ge = { class: "cn-props flex w-[232px] shrink-0 flex-col overflow-y-auto rou
|
|
|
520
626
|
class: "flex size-6 items-center justify-center rounded border border-cn-field-line bg-cn-field text-[13px] leading-none text-cn-fg/80 hover:border-cn-accent/40 hover:text-cn-accent",
|
|
521
627
|
onClick: t,
|
|
522
628
|
onKeydown: r
|
|
523
|
-
}, " + ", 40,
|
|
524
|
-
body:
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
onKeydown: (t) => Re(t, e)
|
|
535
|
-
}, null, 42, be), [[w, k.value]]),
|
|
536
|
-
A.value ? (b(), m("p", xe, "rowsPath 必填")) : p("", !0),
|
|
537
|
-
h("div", Se, [h("button", {
|
|
538
|
-
type: "button",
|
|
539
|
-
"data-template-confirm": "",
|
|
540
|
-
class: "flex-1 rounded bg-cn-accent/20 px-2 py-1 text-[12px] text-cn-accent hover:bg-cn-accent/30",
|
|
541
|
-
onClick: (t) => N(e)
|
|
542
|
-
}, " 创建 ", 8, Ce), h("button", {
|
|
543
|
-
type: "button",
|
|
544
|
-
class: "flex-1 rounded px-2 py-1 text-[12px] text-cn-muted hover:text-cn-fg",
|
|
545
|
-
onClick: (t) => P(e)
|
|
546
|
-
}, " 取消 ", 8, we)])
|
|
547
|
-
], 64)) : p("", !0)]),
|
|
629
|
+
}, " + ", 40, xe)]),
|
|
630
|
+
body: A(({ closeMenu: e }) => [f.value ? (w(), _(he, {
|
|
631
|
+
key: 0,
|
|
632
|
+
editor: r.editor,
|
|
633
|
+
onConfirm: (t) => S(t, e),
|
|
634
|
+
onCancel: (t) => ne(e)
|
|
635
|
+
}, null, 8, [
|
|
636
|
+
"editor",
|
|
637
|
+
"onConfirm",
|
|
638
|
+
"onCancel"
|
|
639
|
+
])) : v("", !0)]),
|
|
548
640
|
_: 1
|
|
549
|
-
}, 8, ["items"])
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
ref: B,
|
|
553
|
-
state: C(U),
|
|
554
|
-
onSelect: C(Le)
|
|
555
|
-
}, null, 8, ["state", "onSelect"])) : p("", !0)])]),
|
|
556
|
-
Be.value ? p("", !0) : (b(), m("p", Te, " 画布还没有图层,用上方按钮新增 ")),
|
|
557
|
-
h("ul", {
|
|
641
|
+
}, 8, ["items"])])]),
|
|
642
|
+
F.value ? v("", !0) : (w(), y("p", Se, " 画布还没有图层,用上方按钮新增 ")),
|
|
643
|
+
b("ul", {
|
|
558
644
|
class: "cn-layers__tree flex flex-col gap-0.5 px-1.5 py-1",
|
|
559
|
-
onDragend:
|
|
560
|
-
}, [(
|
|
645
|
+
onDragend: Pe
|
|
646
|
+
}, [(w(!0), y(h, null, re(P.value, (e) => (w(), y("li", {
|
|
561
647
|
key: e.key,
|
|
562
648
|
"data-key": e.key,
|
|
563
|
-
draggable:
|
|
564
|
-
class:
|
|
565
|
-
"cn-layers__row--selected":
|
|
566
|
-
"cn-layers__row--hovered":
|
|
567
|
-
"cn-layers__row--hidden":
|
|
649
|
+
draggable: pe(e),
|
|
650
|
+
class: C(["cn-layers__row group flex cursor-default select-none items-center gap-1 py-1 pr-1 text-[12px]", {
|
|
651
|
+
"cn-layers__row--selected": Fe(e),
|
|
652
|
+
"cn-layers__row--hovered": Ie(e) && !Fe(e),
|
|
653
|
+
"cn-layers__row--hidden": q(e) && !e.node.visible,
|
|
568
654
|
"cn-layers__row--template": e.inTemplate,
|
|
569
|
-
"cursor-grab": e.draggable && !
|
|
570
|
-
"cn-layers__row--drop-before":
|
|
571
|
-
"cn-layers__row--drop-after":
|
|
655
|
+
"cursor-grab": e.draggable && !q(e),
|
|
656
|
+
"cn-layers__row--drop-before": G.value?.key === e.key && G.value?.edge === "before",
|
|
657
|
+
"cn-layers__row--drop-after": G.value?.key === e.key && G.value?.edge === "after"
|
|
572
658
|
}]),
|
|
573
|
-
style:
|
|
574
|
-
onClick: (t) =>
|
|
575
|
-
onMouseenter: (t) =>
|
|
576
|
-
onMouseleave: t[
|
|
577
|
-
onDragstart: (t) =>
|
|
578
|
-
onDragover: (t) =>
|
|
579
|
-
onDrop: (t) =>
|
|
659
|
+
style: te({ paddingLeft: `${4 + e.indentLevel * 14}px` }),
|
|
660
|
+
onClick: (t) => I(e),
|
|
661
|
+
onMouseenter: (t) => L(e),
|
|
662
|
+
onMouseleave: t[6] ||= (e) => L(null),
|
|
663
|
+
onDragstart: (t) => fe(e, t),
|
|
664
|
+
onDragover: (t) => me(e, t),
|
|
665
|
+
onDrop: (t) => X(e, t)
|
|
580
666
|
}, [
|
|
581
|
-
|
|
667
|
+
q(e) ? (w(), y("span", {
|
|
582
668
|
key: 0,
|
|
583
669
|
"data-drag-handle": "",
|
|
584
670
|
draggable: "true",
|
|
585
671
|
title: "拖动排序",
|
|
586
672
|
class: "cn-layers__handle shrink-0",
|
|
587
|
-
onDragstart: (t) =>
|
|
588
|
-
}, [
|
|
589
|
-
icon:
|
|
673
|
+
onDragstart: (t) => J(e, t)
|
|
674
|
+
}, [x(a, {
|
|
675
|
+
icon: O(ce),
|
|
590
676
|
size: 12,
|
|
591
677
|
"stroke-width": 2.5
|
|
592
|
-
}, null, 8, ["icon"])], 40,
|
|
593
|
-
e.node.expressionPrefix === "" ?
|
|
678
|
+
}, null, 8, ["icon"])], 40, we)) : v("", !0),
|
|
679
|
+
e.node.expressionPrefix === "" ? v("", !0) : (w(), y("span", {
|
|
594
680
|
key: 1,
|
|
595
681
|
class: "cn-layers__prefix",
|
|
596
682
|
title: e.node.expressionPrefix
|
|
597
|
-
},
|
|
598
|
-
|
|
683
|
+
}, D(e.node.expressionPrefix), 9, Te)),
|
|
684
|
+
ze(e) ? j((w(), y("input", {
|
|
599
685
|
key: 2,
|
|
600
686
|
ref_for: !0,
|
|
601
|
-
ref:
|
|
602
|
-
"onUpdate:modelValue": t[
|
|
687
|
+
ref: Re,
|
|
688
|
+
"onUpdate:modelValue": t[0] ||= (e) => Z.value = e,
|
|
603
689
|
"data-rename-input": "",
|
|
604
690
|
"aria-label": "图层重命名",
|
|
605
691
|
class: "cn-layers__rename-input min-w-0 flex-1",
|
|
606
|
-
onClick: t[
|
|
607
|
-
onDblclick: t[
|
|
608
|
-
onKeydown: [t[
|
|
609
|
-
onBlur: t[
|
|
610
|
-
}, null, 544)), [[
|
|
692
|
+
onClick: t[1] ||= M(() => {}, ["stop"]),
|
|
693
|
+
onDblclick: t[2] ||= M(() => {}, ["stop"]),
|
|
694
|
+
onKeydown: [t[3] ||= ae(M((e) => $(), ["prevent"]), ["enter"]), t[4] ||= ae(M((e) => Ve(), ["prevent"]), ["esc"])],
|
|
695
|
+
onBlur: t[5] ||= (e) => $()
|
|
696
|
+
}, null, 544)), [[k, Z.value]]) : (w(), y("span", {
|
|
611
697
|
key: 3,
|
|
612
698
|
class: "cn-layers__label min-w-0 flex-1 truncate font-mono text-[11px] leading-4",
|
|
613
|
-
onDblclick: (t) =>
|
|
614
|
-
},
|
|
615
|
-
|
|
699
|
+
onDblclick: (t) => Be(e)
|
|
700
|
+
}, D(e.label), 41, Ee)),
|
|
701
|
+
q(e) ? (w(), y("button", {
|
|
616
702
|
key: 4,
|
|
617
703
|
type: "button",
|
|
618
704
|
"data-visibility": "",
|
|
619
|
-
class:
|
|
705
|
+
class: C(["cn-layers__eye size-5 shrink-0 items-center justify-center rounded text-cn-muted hover:bg-cn-accent/15 hover:text-cn-accent", e.node.visible ? "hidden group-hover:flex" : "flex"]),
|
|
620
706
|
title: e.node.visible ? "隐藏图层(最终输出不含该层)" : "显示图层",
|
|
621
707
|
"aria-pressed": !e.node.visible,
|
|
622
|
-
onClick:
|
|
623
|
-
}, [
|
|
624
|
-
icon: e.node.visible ?
|
|
708
|
+
onClick: M((t) => H(e), ["stop"])
|
|
709
|
+
}, [x(a, {
|
|
710
|
+
icon: e.node.visible ? O(se) : O(oe),
|
|
625
711
|
size: 11,
|
|
626
712
|
"stroke-width": 2
|
|
627
|
-
}, null, 8, ["icon"])], 10,
|
|
628
|
-
|
|
713
|
+
}, null, 8, ["icon"])], 10, De)) : v("", !0),
|
|
714
|
+
q(e) ? (w(), y("button", {
|
|
629
715
|
key: 5,
|
|
630
716
|
type: "button",
|
|
631
717
|
"data-lock": "",
|
|
632
|
-
class:
|
|
633
|
-
title: e.node.locked ?
|
|
718
|
+
class: C(["cn-layers__lock size-5 shrink-0 items-center justify-center rounded text-cn-muted hover:bg-cn-accent/15 hover:text-cn-accent", e.node.locked ? "flex" : "hidden group-hover:flex"]),
|
|
719
|
+
title: e.node.locked ? i : "锁定图层(画布不可点选/拖动/删除,渲染照常)",
|
|
634
720
|
"aria-pressed": e.node.locked,
|
|
635
|
-
onClick:
|
|
636
|
-
}, [
|
|
637
|
-
icon: e.node.locked ?
|
|
721
|
+
onClick: M((t) => U(e), ["stop"])
|
|
722
|
+
}, [x(a, {
|
|
723
|
+
icon: e.node.locked ? O(ue) : O(le),
|
|
638
724
|
size: 11,
|
|
639
725
|
"stroke-width": 2
|
|
640
|
-
}, null, 8, ["icon"])], 10,
|
|
641
|
-
|
|
726
|
+
}, null, 8, ["icon"])], 10, Oe)) : v("", !0),
|
|
727
|
+
q(e) ? (w(), y("button", {
|
|
642
728
|
key: 6,
|
|
643
729
|
type: "button",
|
|
644
730
|
"data-rename": "",
|
|
645
731
|
class: "cn-layers__delete hidden size-5 shrink-0 items-center justify-center rounded text-cn-muted hover:bg-cn-accent/15 hover:text-cn-accent group-hover:flex",
|
|
646
732
|
title: "重命名(双击名称或 F2)",
|
|
647
|
-
onClick:
|
|
648
|
-
}, [
|
|
649
|
-
icon:
|
|
733
|
+
onClick: M((t) => Be(e), ["stop"])
|
|
734
|
+
}, [x(a, {
|
|
735
|
+
icon: O(de),
|
|
650
736
|
size: 11,
|
|
651
737
|
"stroke-width": 2
|
|
652
|
-
}, null, 8, ["icon"])], 8,
|
|
653
|
-
e.node.role === "root" && e.node.type === "TableLayer" ? (
|
|
738
|
+
}, null, 8, ["icon"])], 8, ke)) : v("", !0),
|
|
739
|
+
e.node.role === "root" && e.node.type === "TableLayer" ? (w(), y("button", {
|
|
654
740
|
key: 7,
|
|
655
741
|
type: "button",
|
|
656
742
|
"data-add-row": "",
|
|
657
743
|
class: "cn-layers__delete hidden size-5 shrink-0 items-center justify-center rounded text-[10px] leading-none text-cn-muted hover:bg-cn-accent/15 hover:text-cn-accent group-hover:flex disabled:cursor-not-allowed disabled:text-cn-muted/50 disabled:hover:bg-transparent",
|
|
658
744
|
disabled: e.node.templated === !0,
|
|
659
745
|
title: e.node.templated === !0 ? "模板态不可加行——行由数据展开" : "加行(缺省行 + 缺省格与文本,行宽=表宽)",
|
|
660
|
-
onClick:
|
|
661
|
-
}, " +行 ", 8,
|
|
662
|
-
e.node.role === "row" ? (
|
|
746
|
+
onClick: M((t) => R(e), ["stop"])
|
|
747
|
+
}, " +行 ", 8, Ae)) : v("", !0),
|
|
748
|
+
e.node.role === "row" ? (w(), y("button", {
|
|
663
749
|
key: 8,
|
|
664
750
|
type: "button",
|
|
665
751
|
"data-add-cell": "",
|
|
666
752
|
class: "cn-layers__delete hidden size-5 shrink-0 items-center justify-center rounded text-[10px] leading-none text-cn-muted hover:bg-cn-accent/15 hover:text-cn-accent group-hover:flex",
|
|
667
753
|
title: "加格(缺省格 + 文本内容,行高取最高格)",
|
|
668
|
-
onClick:
|
|
669
|
-
}, " +格 ", 8,
|
|
670
|
-
e.node.role === "templateRow" ? (
|
|
754
|
+
onClick: M((t) => z(e), ["stop"])
|
|
755
|
+
}, " +格 ", 8, je)) : v("", !0),
|
|
756
|
+
e.node.role === "templateRow" ? (w(), y("button", {
|
|
671
757
|
key: 9,
|
|
672
758
|
type: "button",
|
|
673
759
|
"data-add-template-cell": "",
|
|
674
760
|
class: "cn-layers__delete hidden size-5 shrink-0 items-center justify-center rounded text-[10px] leading-none text-cn-muted hover:bg-cn-accent/15 hover:text-cn-accent group-hover:flex",
|
|
675
761
|
title: "加格(缺省格 + 文本内容,零高度耦合——行高由数据展开定稿)",
|
|
676
|
-
onClick:
|
|
677
|
-
}, " +格 ", 8,
|
|
678
|
-
|
|
762
|
+
onClick: M((t) => B(e), ["stop"])
|
|
763
|
+
}, " +格 ", 8, Me)) : v("", !0),
|
|
764
|
+
b("button", {
|
|
679
765
|
type: "button",
|
|
680
766
|
class: "cn-layers__delete hidden size-5 shrink-0 items-center justify-center rounded text-[10px] leading-none text-cn-muted hover:bg-cn-danger/15 hover:text-cn-danger group-hover:flex disabled:cursor-not-allowed disabled:text-cn-muted/50 disabled:hover:bg-transparent disabled:hover:text-cn-muted/50",
|
|
681
767
|
disabled: e.node.role === "templateRow" || e.node.locked,
|
|
682
|
-
title: e.node.role === "templateRow" ? "行模板由表持有——转换回普通表请用 V2 转换入口" : e.node.locked ?
|
|
683
|
-
onClick:
|
|
684
|
-
}, " ✕ ", 8,
|
|
685
|
-
], 46,
|
|
768
|
+
title: e.node.role === "templateRow" ? "行模板由表持有——转换回普通表请用 V2 转换入口" : e.node.locked ? o : "删除(含子层)",
|
|
769
|
+
onClick: M((t) => V(e), ["stop"])
|
|
770
|
+
}, " ✕ ", 8, Ne)
|
|
771
|
+
], 46, Ce))), 128))], 32)
|
|
686
772
|
]));
|
|
687
773
|
}
|
|
688
774
|
});
|
|
689
775
|
//#endregion
|
|
690
|
-
export {
|
|
776
|
+
export { fe as a, U as c, he as i, Y as l, _e as n, V as o, ge as r, K as s, X as t };
|