999 lines
35 KiB
JavaScript
999 lines
35 KiB
JavaScript
/*
|
|
* Extracted from browser-delivered Turbopack chunk: fd0220e4d10052af.701bdafa2d.js
|
|
* Module id: 679952
|
|
* For reading/searching only; this factory depends on the original Turbopack runtime.
|
|
*/
|
|
|
|
const moduleFactory = (e) => {
|
|
"use strict";
|
|
var t = e.i(462214),
|
|
n = e.i(358379),
|
|
i = e.i(111558),
|
|
r = e.i(433972),
|
|
a = e.i(761922),
|
|
o = e.i(41671),
|
|
s = e.i(113492),
|
|
c = e.i(777784),
|
|
l = e.i(395),
|
|
u = e.i(763910),
|
|
h = e.i(505e3),
|
|
f = e.i(182004),
|
|
d = e.i(374090);
|
|
e.i(135623);
|
|
var p = e.i(168823),
|
|
g = e.i(295085);
|
|
e.i(954175);
|
|
var b = e.i(301710),
|
|
m = e.i(306677);
|
|
let w = [],
|
|
v = {},
|
|
x = (e) =>
|
|
null == e
|
|
? ""
|
|
: "string" == typeof e ||
|
|
"number" == typeof e ||
|
|
"boolean" == typeof e
|
|
? String(e)
|
|
: JSON.stringify(e),
|
|
y = (e, t, n) => {
|
|
let i,
|
|
r,
|
|
a = e.getValue(t);
|
|
if (
|
|
(n && "object" == typeof n && "operator" in n
|
|
? ((i = n.operator), (r = n.value))
|
|
: ((i = "contains"), (r = x(n))),
|
|
!r)
|
|
)
|
|
return !0;
|
|
let o = x(a).toLowerCase(),
|
|
s = r.toLowerCase();
|
|
switch (i) {
|
|
case "contains":
|
|
default:
|
|
return o.includes(s);
|
|
case "equals":
|
|
return o === s;
|
|
case "gt":
|
|
return Number(a) > Number(r);
|
|
case "lt":
|
|
return Number(a) < Number(r);
|
|
}
|
|
};
|
|
function _({
|
|
value: e,
|
|
onChange: i,
|
|
maxLines: r = 0,
|
|
readonly: a = !1,
|
|
centered: o = !1,
|
|
}) {
|
|
let [s, l] = (0, n.useState)(!1),
|
|
[u, h] = (0, n.useState)(e),
|
|
f = (0, n.useRef)(null),
|
|
p = (0, n.useRef)(null);
|
|
(0, n.useEffect)(() => {
|
|
h(e);
|
|
}, [e]),
|
|
(0, n.useEffect)(() => {
|
|
s && f.current && (f.current.focus(), f.current.select());
|
|
}, [s]);
|
|
let g = (0, n.useCallback)(() => {
|
|
l(!1),
|
|
u !== e &&
|
|
(i(u),
|
|
(0, d.filterSensitiveWords)(u).then((e) => {
|
|
e !== u && (h(e), i(e), c.Notify.info("已自动过滤风险内容"));
|
|
}));
|
|
}, [u, e, i]),
|
|
b = (0, n.useCallback)(
|
|
(t) => {
|
|
"Enter" !== t.key || t.shiftKey || (t.preventDefault(), g()),
|
|
"Escape" === t.key && (h(e), l(!1));
|
|
},
|
|
[g, e],
|
|
),
|
|
m = (0, n.useCallback)(() => {
|
|
let e = p.current;
|
|
e && e.select();
|
|
}, []),
|
|
w = (0, n.useCallback)(
|
|
(e) => {
|
|
(e.preventDefault(), e.stopPropagation(), a) ? m() : l(!0);
|
|
},
|
|
[a, m],
|
|
),
|
|
v = { overflowY: "auto" },
|
|
x = "absolute inset-0 box-border flex min-h-0 w-full flex-col p-1",
|
|
y = `nodrag nowheel tiny-scrollbar min-h-0 w-full flex-1 resize-none border-none bg-transparent text-xs outline-none ${o ? "text-center" : ""}`;
|
|
return s && !a
|
|
? (0, t.jsx)("div", {
|
|
className: x,
|
|
children: (0, t.jsx)("textarea", {
|
|
ref: f,
|
|
value: u,
|
|
onChange: (e) => h(e.target.value),
|
|
onBlur: g,
|
|
onKeyDown: b,
|
|
className: `${y} text-fg-default`,
|
|
style: v,
|
|
rows: 1,
|
|
}),
|
|
})
|
|
: (0, t.jsx)("div", {
|
|
className: x,
|
|
children: (0, t.jsx)("textarea", {
|
|
ref: p,
|
|
readOnly: !0,
|
|
value: e || "",
|
|
placeholder: "-",
|
|
"data-script-text-cell": "true",
|
|
title: e,
|
|
onDoubleClick: w,
|
|
className: `${y} text-fg-default placeholder:text-fg-disabled break-words`,
|
|
style: v,
|
|
rows: 1,
|
|
}),
|
|
});
|
|
}
|
|
let S = "application/x-script-char-image";
|
|
function E({
|
|
url: e,
|
|
onChange: r,
|
|
onResourceMetaChange: a,
|
|
alt: d = "图片",
|
|
readonly: w = !1,
|
|
}) {
|
|
let v = (0, n.useRef)(null),
|
|
[x, y] = (0, n.useState)(!1),
|
|
[_, E] = (0, n.useState)(null),
|
|
[M, T] = (0, n.useState)(!1),
|
|
[k, C] = (0, n.useState)(null),
|
|
[A, N] = (0, n.useState)(!1),
|
|
[I, P] = (0, n.useState)(!1),
|
|
R = (0, n.useCallback)(
|
|
(t) => {
|
|
w ||
|
|
x ||
|
|
e ||
|
|
(t.stopPropagation(), C({ x: t.clientX, y: t.clientY + 6 }));
|
|
},
|
|
[w, x, e],
|
|
),
|
|
L = (0, n.useCallback)(
|
|
(t) => {
|
|
e && (t.stopPropagation(), T(!0));
|
|
},
|
|
[e],
|
|
),
|
|
D = (0, n.useCallback)(
|
|
(t) => {
|
|
!w &&
|
|
e &&
|
|
(t.preventDefault(),
|
|
t.stopPropagation(),
|
|
E({ x: t.clientX, y: t.clientY }));
|
|
},
|
|
[w, e],
|
|
),
|
|
j = (0, n.useCallback)(() => E(null), []),
|
|
O = (0, n.useCallback)(() => C(null), []);
|
|
(0, n.useEffect)(() => {
|
|
if (!_ && !k) return;
|
|
let e = () => {
|
|
E(null), C(null);
|
|
};
|
|
return (
|
|
window.addEventListener("click", e),
|
|
window.addEventListener("contextmenu", e),
|
|
() => {
|
|
window.removeEventListener("click", e),
|
|
window.removeEventListener("contextmenu", e);
|
|
}
|
|
);
|
|
}, [_, k]);
|
|
let F = (0, n.useCallback)(() => {
|
|
j(), O(), v.current?.click();
|
|
}, [j, O]),
|
|
U = (0, n.useCallback)(
|
|
(e) => {
|
|
let t = e[0];
|
|
if (!t) return;
|
|
let n = t.thumbnailUrl || t.raw.imageUrl || t.raw.url || "";
|
|
n
|
|
? (r(n), c.Notify.success("添加成功"))
|
|
: c.Notify.error("未获取到可用素材链接"),
|
|
N(!1);
|
|
},
|
|
[r],
|
|
),
|
|
B = (0, n.useCallback)(() => {
|
|
j(), r("");
|
|
}, [j, r]),
|
|
H = (0, n.useCallback)(
|
|
async (e) => {
|
|
let t = e.target.files?.[0];
|
|
if (!t) return;
|
|
e.target.value = "";
|
|
let n = (0, p.getCookie)(h.USER_TOKEN_COOKIE_KEY),
|
|
i = (0, p.getCookie)(h.USER_UUID_COOKIE_KEY);
|
|
if (!n || "string" != typeof n || !i || "string" != typeof i)
|
|
return void c.Notify.error("请先登录");
|
|
y(!0);
|
|
try {
|
|
let e,
|
|
o = await (0, b.uploadViaPreSign)(t, {
|
|
token: n,
|
|
uuid: i,
|
|
onCalcHashEnd: (t) => {
|
|
e = t;
|
|
},
|
|
}),
|
|
s = (0, b.resolveUploadUrl)(o);
|
|
s
|
|
? (r(s),
|
|
a?.(
|
|
(0, m.buildUploadedResourceMeta)(t, f.NodeType.IMAGE, {
|
|
hashSha1: e,
|
|
}),
|
|
),
|
|
c.Notify.success("上传成功"))
|
|
: c.Notify.error("上传失败:未获取到 URL");
|
|
} catch (e) {
|
|
c.Notify.error(e instanceof Error ? e.message : "上传失败");
|
|
} finally {
|
|
y(!1);
|
|
}
|
|
},
|
|
[r, a],
|
|
),
|
|
z = (0, n.useCallback)(
|
|
(t) => {
|
|
w || !e
|
|
? t.preventDefault()
|
|
: (t.stopPropagation(),
|
|
(t.dataTransfer.effectAllowed = "copyMove"),
|
|
t.dataTransfer.setData(S, e));
|
|
},
|
|
[w, e],
|
|
),
|
|
G = (0, n.useCallback)(
|
|
(e) => {
|
|
w ||
|
|
(e.dataTransfer.types.includes(S) &&
|
|
(e.preventDefault(),
|
|
e.stopPropagation(),
|
|
(e.dataTransfer.dropEffect = "copy"),
|
|
P(!0)));
|
|
},
|
|
[w],
|
|
),
|
|
$ = (0, n.useCallback)(() => {
|
|
P(!1);
|
|
}, []),
|
|
V = (0, n.useCallback)(
|
|
(e) => {
|
|
if ((P(!1), w)) return;
|
|
let t = e.dataTransfer.getData(S);
|
|
t && (e.preventDefault(), e.stopPropagation(), r(t));
|
|
},
|
|
[w, r],
|
|
);
|
|
return (0, t.jsxs)("div", {
|
|
className: "relative min-h-[60px] w-full",
|
|
children: [
|
|
x
|
|
? (0, t.jsx)("div", {
|
|
className:
|
|
"flex min-h-[60px] w-full items-center justify-center",
|
|
children: (0, t.jsx)(o.Icons.loader2, {
|
|
className: "text-fg-subtle h-4 w-4 animate-spin",
|
|
}),
|
|
})
|
|
: e
|
|
? (0, t.jsxs)("div", {
|
|
className: "group/img relative w-full",
|
|
onClick: R,
|
|
onDoubleClick: L,
|
|
onContextMenu: D,
|
|
draggable: !w && !!e,
|
|
onDragStart: z,
|
|
onDragOver: G,
|
|
onDragLeave: $,
|
|
onDrop: V,
|
|
children: [
|
|
(0, t.jsx)(l.default, {
|
|
src: (0, g.getFasterImage)(e, { width: 120 }),
|
|
alt: d,
|
|
className: "block h-auto w-full max-w-full align-top",
|
|
iconSize: 16,
|
|
}),
|
|
!w &&
|
|
(0, t.jsx)("button", {
|
|
type: "button",
|
|
className:
|
|
"absolute right-0.5 top-0.5 z-10 flex h-5 w-5 items-center justify-center rounded-full bg-black/60 text-white/70 opacity-0 transition-opacity hover:bg-black/80 hover:text-white group-hover/img:opacity-100",
|
|
onClick: (e) => {
|
|
e.stopPropagation(), r("");
|
|
},
|
|
title: "删除图片",
|
|
children: (0, t.jsx)(o.Icons.Close, {
|
|
width: 12,
|
|
height: 12,
|
|
}),
|
|
}),
|
|
I &&
|
|
(0, t.jsx)("div", {
|
|
className:
|
|
"pointer-events-none absolute inset-0 bg-blue-500/20 ring-2 ring-inset ring-blue-500/60",
|
|
}),
|
|
],
|
|
})
|
|
: (0, t.jsx)("div", {
|
|
className: `text-fg-disabled flex min-h-[60px] w-full items-center justify-center ${w ? "cursor-default" : "hover:text-fg-subtle cursor-pointer"}`,
|
|
onClick: R,
|
|
children: w
|
|
? (0, t.jsx)(o.Icons.ImageS, { width: 16, height: 16 })
|
|
: (0, t.jsx)(o.Icons.PlusS, { width: 16, height: 16 }),
|
|
}),
|
|
(0, t.jsx)("input", {
|
|
ref: v,
|
|
type: "file",
|
|
accept: "image/*",
|
|
className: "hidden",
|
|
onChange: (e) => void H(e),
|
|
}),
|
|
M &&
|
|
e &&
|
|
(0, t.jsx)(s.MediaPreviewOverlay, {
|
|
mediaType: "image",
|
|
src: e,
|
|
zIndex: 1e4,
|
|
onClose: () => T(!1),
|
|
}),
|
|
_ &&
|
|
(0, i.createPortal)(
|
|
(0, t.jsxs)("div", {
|
|
className:
|
|
"border-border-muted fixed z-[9999] min-w-[120px] rounded-md border bg-[#2a2a2a] py-1 shadow-lg",
|
|
style: { left: _.x, top: _.y },
|
|
onClick: (e) => e.stopPropagation(),
|
|
children: [
|
|
(0, t.jsxs)("button", {
|
|
type: "button",
|
|
className:
|
|
"text-fg-default hover:bg-canvas-controls-hover flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs",
|
|
onClick: F,
|
|
children: [
|
|
(0, t.jsx)(o.Icons.Upload, { width: 14, height: 14 }),
|
|
"更换图片",
|
|
],
|
|
}),
|
|
(0, t.jsxs)("button", {
|
|
type: "button",
|
|
className:
|
|
"hover:bg-canvas-controls-hover flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs text-red-400",
|
|
onClick: B,
|
|
children: [
|
|
(0, t.jsx)(o.Icons.Trash, { width: 14, height: 14 }),
|
|
"删除图片",
|
|
],
|
|
}),
|
|
],
|
|
}),
|
|
document.body,
|
|
),
|
|
k &&
|
|
(0, i.createPortal)(
|
|
(0, t.jsxs)("div", {
|
|
className:
|
|
"border-border-muted fixed z-[9999] min-w-[100px] rounded-lg border bg-[#1F1F1F] p-1 shadow-lg",
|
|
style: { left: k.x, top: k.y },
|
|
onClick: (e) => e.stopPropagation(),
|
|
children: [
|
|
(0, t.jsx)("button", {
|
|
type: "button",
|
|
className:
|
|
"text-fg-default hover:bg-canvas-controls-hover w-full cursor-pointer rounded-md px-3 py-2 text-left text-xs transition-colors",
|
|
onClick: F,
|
|
children: "本地上传",
|
|
}),
|
|
(0, t.jsx)("button", {
|
|
type: "button",
|
|
className:
|
|
"text-fg-default hover:bg-canvas-controls-hover w-full cursor-pointer rounded-md px-3 py-2 text-left text-xs transition-colors",
|
|
onClick: () => {
|
|
C(null), N(!0);
|
|
},
|
|
children: "历史图库",
|
|
}),
|
|
],
|
|
}),
|
|
document.body,
|
|
),
|
|
(0, t.jsx)(u.GalleryModal, {
|
|
opened: A,
|
|
onClose: () => N(!1),
|
|
onConfirm: U,
|
|
maxSelect: 1,
|
|
allowedMediaType: "image",
|
|
}),
|
|
],
|
|
});
|
|
}
|
|
function M({
|
|
rows: e,
|
|
onRowsChange: i,
|
|
onResourceMetaChange: o,
|
|
tableConfig: s,
|
|
onTableConfigChange: c,
|
|
shotColumns: l,
|
|
readonly: u = !1,
|
|
showSelection: h = !1,
|
|
selectedRowIds: d,
|
|
onSelectionChange: p,
|
|
}) {
|
|
let g = (0, n.useMemo)(
|
|
() => new Set(e.map((e) => e.hiddenUuid).filter(Boolean)),
|
|
[e],
|
|
),
|
|
b = (0, n.useMemo)(
|
|
() => null != d && g.size > 0 && g.size === d.size,
|
|
[g, d],
|
|
),
|
|
m = (0, n.useMemo)(
|
|
() => null != d && d.size > 0 && d.size < g.size,
|
|
[g, d],
|
|
),
|
|
x = (0, n.useCallback)(() => {
|
|
p && p(b ? new Set() : new Set(g));
|
|
}, [b, g, p]),
|
|
S = (0, n.useCallback)(
|
|
(e) => {
|
|
if (!p || !d) return;
|
|
let t = new Set(d);
|
|
t.has(e) ? t.delete(e) : t.add(e), p(t);
|
|
},
|
|
[d, p],
|
|
),
|
|
[M, T] = (0, n.useState)(null),
|
|
[k, C] = (0, n.useState)(null),
|
|
A = (0, n.useCallback)(
|
|
(t, n, r) => {
|
|
u || i(e.map((e, i) => (i !== t ? e : { ...e, [n]: r })));
|
|
},
|
|
[e, i, u],
|
|
),
|
|
N = (0, n.useCallback)(
|
|
(t, n, r, a) => {
|
|
u ||
|
|
i(
|
|
e.map((e, i) => {
|
|
if (i !== t) return e;
|
|
let o = [...(e.characters ?? [])];
|
|
for (; o.length <= n; )
|
|
o.push({
|
|
characterName: "",
|
|
characterDescription: "",
|
|
characterImageUrl: "",
|
|
});
|
|
return (o[n] = { ...o[n], [r]: a }), { ...e, characters: o };
|
|
}),
|
|
);
|
|
},
|
|
[e, i, u],
|
|
),
|
|
I = (0, n.useCallback)(
|
|
(t, n) => {
|
|
u ||
|
|
i(
|
|
e.map((e, i) =>
|
|
i !== t
|
|
? e
|
|
: {
|
|
...e,
|
|
videoReference: {
|
|
...(e.videoReference ?? {
|
|
startTime: 0,
|
|
endTime: 0,
|
|
referenceFrameImage: "",
|
|
}),
|
|
referenceFrameImage: n,
|
|
},
|
|
},
|
|
),
|
|
);
|
|
},
|
|
[e, i, u],
|
|
),
|
|
P = (0, n.useCallback)(
|
|
(e, t) => {
|
|
u ||
|
|
(T(t),
|
|
(e.dataTransfer.effectAllowed = "move"),
|
|
e.dataTransfer.setData("text/plain", String(t)));
|
|
},
|
|
[u],
|
|
),
|
|
R = (0, n.useCallback)(
|
|
(e, t) => {
|
|
(e.preventDefault(), null === M || M === t) ? C(null) : C(t);
|
|
},
|
|
[M],
|
|
),
|
|
L = (0, n.useCallback)(
|
|
(t, n) => {
|
|
if ((t.preventDefault(), null === M || M === n)) {
|
|
T(null), C(null);
|
|
return;
|
|
}
|
|
let r = [...e],
|
|
[a] = r.splice(M, 1);
|
|
r.splice(n, 0, a),
|
|
i(r.map((e, t) => ({ ...e, shotNumber: t + 1 }))),
|
|
T(null),
|
|
C(null);
|
|
},
|
|
[M, e, i],
|
|
),
|
|
D = (0, n.useCallback)(() => {
|
|
T(null), C(null);
|
|
}, []),
|
|
j = (0, n.useMemo)(() => {
|
|
let t = 0;
|
|
return (
|
|
e.forEach((e) => {
|
|
e.characters?.length > t && (t = e.characters.length);
|
|
}),
|
|
t
|
|
);
|
|
}, [e]),
|
|
O = (0, n.useMemo)(() => {
|
|
let e = [];
|
|
for (let n = 0; n < j; n++) {
|
|
let i = n + 1;
|
|
e.push(
|
|
{
|
|
id: `char_name_${i}`,
|
|
header: `角色${i}`,
|
|
size: 120,
|
|
minSize: 80,
|
|
meta: { centered: !0 },
|
|
accessorFn: (e) => e.characters?.[n]?.characterName ?? "",
|
|
cell: ({ row: e }) =>
|
|
(0, t.jsx)(_, {
|
|
value: e.original.characters?.[n]?.characterName ?? "",
|
|
onChange: (t) => N(e.index, n, "characterName", t),
|
|
maxLines: 2,
|
|
readonly: u,
|
|
centered: !0,
|
|
}),
|
|
},
|
|
{
|
|
id: `char_desc_${i}`,
|
|
header: `角色描述${i}`,
|
|
size: 180,
|
|
minSize: 80,
|
|
accessorFn: (e) =>
|
|
e.characters?.[n]?.characterDescription ?? "",
|
|
cell: ({ row: e }) =>
|
|
(0, t.jsx)(_, {
|
|
value:
|
|
e.original.characters?.[n]?.characterDescription ?? "",
|
|
onChange: (t) => N(e.index, n, "characterDescription", t),
|
|
maxLines: 4,
|
|
readonly: u,
|
|
}),
|
|
},
|
|
{
|
|
id: `char_img_${i}`,
|
|
header: `角色图${i}`,
|
|
size: 80,
|
|
minSize: 60,
|
|
meta: { centered: !0, valignTop: !0 },
|
|
accessorFn: (e) => e.characters?.[n]?.characterImageUrl ?? "",
|
|
cell: ({ row: e }) =>
|
|
(0, t.jsx)(E, {
|
|
url: e.original.characters?.[n]?.characterImageUrl ?? "",
|
|
onChange: (t) => N(e.index, n, "characterImageUrl", t),
|
|
onResourceMetaChange: o,
|
|
alt: `角色${i}图`,
|
|
readonly: u,
|
|
}),
|
|
},
|
|
);
|
|
}
|
|
return e;
|
|
}, [j, N, u]),
|
|
F = (0, n.useMemo)(
|
|
() => [
|
|
{
|
|
id: "shotNumber",
|
|
header: (0, f.getFieldLabel)("shotNumber", l),
|
|
size: 50,
|
|
minSize: 40,
|
|
enableResizing: !1,
|
|
meta: { centered: !0 },
|
|
cell: ({ row: e }) =>
|
|
(0, t.jsx)("div", {
|
|
className:
|
|
"text-fg-muted absolute inset-0 flex items-center justify-center p-1 text-center text-xs",
|
|
children: e.index + 1,
|
|
}),
|
|
},
|
|
{
|
|
accessorKey: "durationSeconds",
|
|
header: (0, f.getFieldLabel)("durationSeconds", l),
|
|
size: 80,
|
|
minSize: 60,
|
|
meta: { centered: !0 },
|
|
cell: ({ getValue: e, row: n }) =>
|
|
(0, t.jsx)(_, {
|
|
value: String(e()),
|
|
onChange: (e) =>
|
|
A(n.index, "durationSeconds", parseFloat(e) || 0),
|
|
maxLines: 1,
|
|
readonly: u,
|
|
centered: !0,
|
|
}),
|
|
},
|
|
{
|
|
accessorKey: "plotDescription",
|
|
header: (0, f.getFieldLabel)("plotDescription", l),
|
|
size: 180,
|
|
minSize: 80,
|
|
cell: ({ getValue: e, row: n }) =>
|
|
(0, t.jsx)(_, {
|
|
value: e(),
|
|
onChange: (e) => A(n.index, "plotDescription", e),
|
|
maxLines: 6,
|
|
readonly: u,
|
|
}),
|
|
},
|
|
...O,
|
|
{
|
|
id: "videoReference",
|
|
header: (0, f.getFieldLabel)("videoReference", l),
|
|
size: 80,
|
|
minSize: 60,
|
|
meta: { centered: !0, valignTop: !0 },
|
|
accessorFn: (e) => e.videoReference?.referenceFrameImage ?? "",
|
|
cell: ({ row: e }) =>
|
|
(0, t.jsx)(E, {
|
|
url: e.original.videoReference?.referenceFrameImage ?? "",
|
|
onChange: (t) => I(e.index, t),
|
|
onResourceMetaChange: o,
|
|
alt: "视频参考图",
|
|
readonly: u,
|
|
}),
|
|
},
|
|
{
|
|
accessorKey: "shotSize",
|
|
header: (0, f.getFieldLabel)("shotSize", l),
|
|
size: 120,
|
|
minSize: 80,
|
|
cell: ({ getValue: e, row: n }) =>
|
|
(0, t.jsx)(_, {
|
|
value: e(),
|
|
onChange: (e) => A(n.index, "shotSize", e),
|
|
maxLines: 2,
|
|
readonly: u,
|
|
}),
|
|
},
|
|
{
|
|
accessorKey: "characterAction",
|
|
header: (0, f.getFieldLabel)("characterAction", l),
|
|
size: 120,
|
|
minSize: 80,
|
|
cell: ({ getValue: e, row: n }) =>
|
|
(0, t.jsx)(_, {
|
|
value: e(),
|
|
onChange: (e) => A(n.index, "characterAction", e),
|
|
maxLines: 3,
|
|
readonly: u,
|
|
}),
|
|
},
|
|
{
|
|
accessorKey: "emotion",
|
|
header: (0, f.getFieldLabel)("emotion", l),
|
|
size: 120,
|
|
minSize: 80,
|
|
cell: ({ getValue: e, row: n }) =>
|
|
(0, t.jsx)(_, {
|
|
value: e(),
|
|
onChange: (e) => A(n.index, "emotion", e),
|
|
maxLines: 3,
|
|
readonly: u,
|
|
}),
|
|
},
|
|
{
|
|
accessorKey: "sceneTags",
|
|
header: (0, f.getFieldLabel)("sceneTags", l),
|
|
size: 120,
|
|
minSize: 80,
|
|
cell: ({ getValue: e, row: n }) =>
|
|
(0, t.jsx)(_, {
|
|
value: e(),
|
|
onChange: (e) => A(n.index, "sceneTags", e),
|
|
maxLines: 2,
|
|
readonly: u,
|
|
}),
|
|
},
|
|
{
|
|
accessorKey: "lightingAndAtmosphere",
|
|
header: (0, f.getFieldLabel)("lightingAndAtmosphere", l),
|
|
size: 120,
|
|
minSize: 80,
|
|
cell: ({ getValue: e, row: n }) =>
|
|
(0, t.jsx)(_, {
|
|
value: e(),
|
|
onChange: (e) => A(n.index, "lightingAndAtmosphere", e),
|
|
maxLines: 3,
|
|
readonly: u,
|
|
}),
|
|
},
|
|
{
|
|
accessorKey: "audioEffects",
|
|
header: (0, f.getFieldLabel)("audioEffects", l),
|
|
size: 120,
|
|
minSize: 80,
|
|
cell: ({ getValue: e, row: n }) =>
|
|
(0, t.jsx)(_, {
|
|
value: e(),
|
|
onChange: (e) => A(n.index, "audioEffects", e),
|
|
maxLines: 2,
|
|
readonly: u,
|
|
}),
|
|
},
|
|
{
|
|
accessorKey: "dialogue",
|
|
header: (0, f.getFieldLabel)("dialogue", l),
|
|
size: 120,
|
|
minSize: 80,
|
|
cell: ({ getValue: e, row: n }) =>
|
|
(0, t.jsx)(_, {
|
|
value: e(),
|
|
onChange: (e) => A(n.index, "dialogue", e),
|
|
maxLines: 3,
|
|
readonly: u,
|
|
}),
|
|
},
|
|
{
|
|
accessorKey: "imageGenerationPrompt",
|
|
header: (0, f.getFieldLabel)("imageGenerationPrompt", l),
|
|
size: 180,
|
|
minSize: 80,
|
|
cell: ({ getValue: e, row: n }) =>
|
|
(0, t.jsx)(_, {
|
|
value: e(),
|
|
onChange: (e) => A(n.index, "imageGenerationPrompt", e),
|
|
maxLines: 6,
|
|
readonly: u,
|
|
}),
|
|
},
|
|
{
|
|
accessorKey: "videoMotionPrompt",
|
|
header: (0, f.getFieldLabel)("videoMotionPrompt", l),
|
|
size: 180,
|
|
minSize: 80,
|
|
cell: ({ getValue: e, row: n }) =>
|
|
(0, t.jsx)(_, {
|
|
value: e(),
|
|
onChange: (e) => A(n.index, "videoMotionPrompt", e),
|
|
maxLines: 6,
|
|
readonly: u,
|
|
}),
|
|
},
|
|
],
|
|
[A, u, O, l],
|
|
),
|
|
U = s?.columnFilters ?? w,
|
|
B = s?.columnVisibility ?? v,
|
|
H = (0, r.useReactTable)({
|
|
data: e,
|
|
columns: F,
|
|
columnResizeMode: "onChange",
|
|
defaultColumn: { filterFn: y },
|
|
getCoreRowModel: (0, a.getCoreRowModel)(),
|
|
getFilteredRowModel: (0, a.getFilteredRowModel)(),
|
|
state: { columnFilters: U, columnVisibility: B },
|
|
onColumnFiltersChange: (e) => {
|
|
if (!c) return;
|
|
let t = "function" == typeof e ? e(U) : e;
|
|
c({ ...s, columnFilters: t });
|
|
},
|
|
onColumnVisibilityChange: (e) => {
|
|
if (!c) return;
|
|
let t = "function" == typeof e ? e(B) : e;
|
|
c({ ...s, columnVisibility: t });
|
|
},
|
|
});
|
|
return (0, t.jsx)("div", {
|
|
className: "relative h-full w-full",
|
|
children: (0, t.jsx)("div", {
|
|
className: "nodrag tiny-scrollbar h-full w-full overflow-auto",
|
|
children: (0, t.jsxs)("table", {
|
|
className: "w-full border-collapse",
|
|
style: { minWidth: H.getCenterTotalSize() },
|
|
children: [
|
|
(0, t.jsx)("thead", {
|
|
className: "sticky top-0 z-10",
|
|
children: H.getHeaderGroups().map((e) =>
|
|
(0, t.jsxs)(
|
|
"tr",
|
|
{
|
|
children: [
|
|
h &&
|
|
(0, t.jsx)("th", {
|
|
className:
|
|
"border-border-muted w-8 border text-center",
|
|
style: {
|
|
background: "var(--bg-surface-secondary)",
|
|
},
|
|
children: (0, t.jsx)("input", {
|
|
type: "checkbox",
|
|
checked: b,
|
|
ref: (e) => {
|
|
e && (e.indeterminate = m);
|
|
},
|
|
onChange: x,
|
|
className:
|
|
"nodrag h-3.5 w-3.5 cursor-pointer accent-white",
|
|
}),
|
|
}),
|
|
!u &&
|
|
(0, t.jsx)("th", {
|
|
className: "border-border-muted w-6 border",
|
|
style: {
|
|
background: "var(--bg-surface-secondary)",
|
|
},
|
|
}),
|
|
e.headers.map((e) =>
|
|
(0, t.jsxs)(
|
|
"th",
|
|
{
|
|
className: `border-border-muted text-fg-muted relative select-none border px-2 py-1.5 text-[11px] font-medium ${e.column.columnDef.meta?.centered ? "text-center" : "text-left"}`,
|
|
style: {
|
|
width: e.getSize(),
|
|
background: "var(--bg-surface-secondary)",
|
|
},
|
|
children: [
|
|
e.isPlaceholder
|
|
? null
|
|
: (0, r.flexRender)(
|
|
e.column.columnDef.header,
|
|
e.getContext(),
|
|
),
|
|
e.column.getCanResize() &&
|
|
(0, t.jsx)("div", {
|
|
onMouseDown: e.getResizeHandler(),
|
|
onTouchStart: e.getResizeHandler(),
|
|
className: `nodrag absolute right-0 top-0 h-full w-1 cursor-col-resize touch-none select-none ${e.column.getIsResizing() ? "bg-blue-500/60" : "bg-transparent hover:bg-white/20"}`,
|
|
}),
|
|
],
|
|
},
|
|
e.id,
|
|
),
|
|
),
|
|
],
|
|
},
|
|
e.id,
|
|
),
|
|
),
|
|
}),
|
|
(0, t.jsx)("tbody", {
|
|
children: H.getRowModel().rows.map((e, n) =>
|
|
(0, t.jsxs)(
|
|
"tr",
|
|
{
|
|
className: `min-h-[60px] hover:bg-white/[0.03] ${k === n ? "border-t-2 border-t-blue-500" : ""} ${M === n ? "opacity-40" : ""}`,
|
|
onDragOver: (e) => R(e, n),
|
|
onDrop: (e) => L(e, n),
|
|
children: [
|
|
h &&
|
|
(0, t.jsx)("td", {
|
|
className:
|
|
"border-border-muted relative w-8 border text-center align-top",
|
|
children: (0, t.jsx)("div", {
|
|
className:
|
|
"absolute inset-0 flex items-center justify-center",
|
|
children: (0, t.jsx)("input", {
|
|
type: "checkbox",
|
|
checked:
|
|
!!e.original.hiddenUuid &&
|
|
(d?.has(e.original.hiddenUuid) ?? !1),
|
|
onChange: () =>
|
|
e.original.hiddenUuid &&
|
|
S(e.original.hiddenUuid),
|
|
className:
|
|
"nodrag h-3.5 w-3.5 cursor-pointer accent-white",
|
|
}),
|
|
}),
|
|
}),
|
|
!u &&
|
|
(0, t.jsx)("td", {
|
|
className:
|
|
"border-border-muted relative w-6 cursor-grab border align-top active:cursor-grabbing",
|
|
draggable: !0,
|
|
onDragStart: (e) => P(e, n),
|
|
onDragEnd: D,
|
|
children: (0, t.jsx)("div", {
|
|
className:
|
|
"absolute inset-0 flex items-center justify-center",
|
|
children: (0, t.jsxs)("svg", {
|
|
width: 12,
|
|
height: 12,
|
|
viewBox: "0 0 24 24",
|
|
fill: "currentColor",
|
|
className: "text-fg-disabled",
|
|
children: [
|
|
(0, t.jsx)("circle", {
|
|
cx: "9",
|
|
cy: "5",
|
|
r: "1.5",
|
|
}),
|
|
(0, t.jsx)("circle", {
|
|
cx: "15",
|
|
cy: "5",
|
|
r: "1.5",
|
|
}),
|
|
(0, t.jsx)("circle", {
|
|
cx: "9",
|
|
cy: "12",
|
|
r: "1.5",
|
|
}),
|
|
(0, t.jsx)("circle", {
|
|
cx: "15",
|
|
cy: "12",
|
|
r: "1.5",
|
|
}),
|
|
(0, t.jsx)("circle", {
|
|
cx: "9",
|
|
cy: "19",
|
|
r: "1.5",
|
|
}),
|
|
(0, t.jsx)("circle", {
|
|
cx: "15",
|
|
cy: "19",
|
|
r: "1.5",
|
|
}),
|
|
],
|
|
}),
|
|
}),
|
|
}),
|
|
e.getVisibleCells().map((e) => {
|
|
let n = e.column.columnDef.meta,
|
|
i =
|
|
n?.valignTop === !0
|
|
? "align-top"
|
|
: n?.centered
|
|
? "align-middle"
|
|
: "align-top";
|
|
return (0, t.jsx)(
|
|
"td",
|
|
{
|
|
className: `border-border-muted relative border ${i}`,
|
|
style: { width: e.column.getSize(), padding: 0 },
|
|
children: (0, r.flexRender)(
|
|
e.column.columnDef.cell,
|
|
e.getContext(),
|
|
),
|
|
},
|
|
e.id,
|
|
);
|
|
}),
|
|
],
|
|
},
|
|
e.id,
|
|
),
|
|
),
|
|
}),
|
|
],
|
|
}),
|
|
}),
|
|
});
|
|
}
|
|
e.s(["default", () => M]);
|
|
};
|
|
|
|
export default moduleFactory;
|