@vivix-labs/short-drama-compare 1.0.0-beta.2 → 1.0.0-beta.3
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/client-code.css +35 -0
- package/dist/client-code.js +61 -54
- package/package.json +2 -2
package/dist/client-code.css
CHANGED
|
@@ -745,6 +745,41 @@
|
|
|
745
745
|
.drama-compare-metadata dd {
|
|
746
746
|
margin-bottom: 8px;
|
|
747
747
|
}
|
|
748
|
+
.drama-compare-version {
|
|
749
|
+
display: flex;
|
|
750
|
+
align-items: center;
|
|
751
|
+
gap: var(--vx-space-8);
|
|
752
|
+
padding: 0 var(--vx-space-8) var(--vx-space-8);
|
|
753
|
+
color: var(--vx-text-secondary-readable);
|
|
754
|
+
font: var(--vx-typography-inter-14-medium);
|
|
755
|
+
}
|
|
756
|
+
.drama-compare-version select {
|
|
757
|
+
max-width: 100%;
|
|
758
|
+
min-width: 0;
|
|
759
|
+
padding: var(--vx-space-4) var(--vx-space-8);
|
|
760
|
+
}
|
|
761
|
+
.drama-compare-whole .drama-player {
|
|
762
|
+
gap: 0;
|
|
763
|
+
}
|
|
764
|
+
.drama-compare-whole .drama-player-stage {
|
|
765
|
+
border-end-start-radius: 0;
|
|
766
|
+
border-end-end-radius: 0;
|
|
767
|
+
}
|
|
768
|
+
@media (min-width: 1040px) {
|
|
769
|
+
.drama-compare-whole .drama-player-stage {
|
|
770
|
+
min-block-size: clamp(320px, calc(100dvh - 424px), 520px);
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
.drama-compare-whole .drama-player > .vx-playback-controls {
|
|
774
|
+
border-start-start-radius: 0;
|
|
775
|
+
border-start-end-radius: 0;
|
|
776
|
+
background: var(--vx-black-black);
|
|
777
|
+
color: var(--vx-text-on-content-primary);
|
|
778
|
+
--vx-button-foreground: var(--vx-text-on-content-primary);
|
|
779
|
+
}
|
|
780
|
+
.drama-compare-whole .drama-player-viewport + .vx-playback-controls {
|
|
781
|
+
margin-block-end: var(--vx-space-8);
|
|
782
|
+
}
|
|
748
783
|
.drama-compare-scenes .drama-player {
|
|
749
784
|
margin: 0;
|
|
750
785
|
grid-template-rows: 1fr;
|
package/dist/client-code.js
CHANGED
|
@@ -5,7 +5,7 @@ import { z } from "vivix-studio/sdk/shared";
|
|
|
5
5
|
import { useState as useState12 } from "react";
|
|
6
6
|
|
|
7
7
|
// packages/short-drama-compare/src/compare.tsx
|
|
8
|
-
import { useCallback, useMemo as useMemo2, useState as useState9 } from "react";
|
|
8
|
+
import { useCallback, useMemo as useMemo2, useRef as useRef9, useState as useState9 } from "react";
|
|
9
9
|
|
|
10
10
|
// packages/ui-system/dist/button.js
|
|
11
11
|
import { jsx as _jsx2, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -992,8 +992,11 @@ function Compare(props) {
|
|
|
992
992
|
const [leftCutId, setLeftCutId] = useState9(episode.cuts[0]?.id);
|
|
993
993
|
const [rightCutId, setRightCutId] = useState9(episode.cuts[1]?.id);
|
|
994
994
|
const shot = episode.shots.find((shot2) => shot2.id === shotId) ?? episode.shots[0];
|
|
995
|
-
const
|
|
996
|
-
const
|
|
995
|
+
const focusVersion = useRef9(void 0);
|
|
996
|
+
const cuts = [
|
|
997
|
+
{ side: "A", id: leftCutId, other: rightCutId, set: setLeftCutId },
|
|
998
|
+
{ side: "B", id: rightCutId, other: leftCutId, set: setRightCutId }
|
|
999
|
+
];
|
|
997
1000
|
return /* @__PURE__ */ jsxs3("section", { "aria-label": "Version comparison", children: [
|
|
998
1001
|
/* @__PURE__ */ jsxs3("header", { className: "drama-compare-bar", children: [
|
|
999
1002
|
/* @__PURE__ */ jsxs3("h2", { children: [
|
|
@@ -1057,54 +1060,55 @@ function Compare(props) {
|
|
|
1057
1060
|
onClick: () => props.navigate({ view: "episode", episodeId: episode.id })
|
|
1058
1061
|
}
|
|
1059
1062
|
)
|
|
1060
|
-
] }) : /* @__PURE__ */
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
)
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1063
|
+
] }) : /* @__PURE__ */ jsx3("div", { className: "drama-compare drama-compare-whole", children: cuts.map(({ side, id, other, set }, index) => {
|
|
1064
|
+
const requested = episode.cuts.find((cut2) => cut2.id === id);
|
|
1065
|
+
const cut = requested ?? episode.cuts[index];
|
|
1066
|
+
const otherId = episode.cuts.find((entry) => entry.id === other)?.id ?? episode.cuts[1 - index]?.id;
|
|
1067
|
+
return /* @__PURE__ */ jsx3("section", { "aria-label": `Episode ${side}`, children: /* @__PURE__ */ jsx3(
|
|
1068
|
+
ResolvedPlayer,
|
|
1069
|
+
{
|
|
1070
|
+
...props,
|
|
1071
|
+
label: cut.title,
|
|
1072
|
+
shots: cut.shots,
|
|
1073
|
+
captureId: `episode-${side.toLowerCase()}`,
|
|
1074
|
+
renderFilmstrip: (panel) => /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1075
|
+
/* @__PURE__ */ jsxs3("label", { className: "drama-compare-version", children: [
|
|
1076
|
+
/* @__PURE__ */ jsxs3("span", { children: [
|
|
1077
|
+
"Version ",
|
|
1078
|
+
side
|
|
1079
|
+
] }),
|
|
1080
|
+
/* @__PURE__ */ jsx3(
|
|
1081
|
+
"select",
|
|
1082
|
+
{
|
|
1083
|
+
ref: (node) => {
|
|
1084
|
+
if (node && focusVersion.current === side) {
|
|
1085
|
+
focusVersion.current = void 0;
|
|
1086
|
+
node.focus({ preventScroll: true });
|
|
1087
|
+
}
|
|
1088
|
+
},
|
|
1089
|
+
value: cut.id,
|
|
1090
|
+
onChange: (event) => {
|
|
1091
|
+
focusVersion.current = side;
|
|
1092
|
+
set(event.currentTarget.value);
|
|
1093
|
+
},
|
|
1094
|
+
children: episode.cuts.map((option) => /* @__PURE__ */ jsx3(
|
|
1095
|
+
"option",
|
|
1096
|
+
{
|
|
1097
|
+
value: option.id,
|
|
1098
|
+
disabled: option.id === otherId,
|
|
1099
|
+
children: option.title
|
|
1100
|
+
},
|
|
1101
|
+
option.id
|
|
1102
|
+
))
|
|
1103
|
+
}
|
|
1104
|
+
)
|
|
1105
|
+
] }),
|
|
1106
|
+
panel
|
|
1107
|
+
] })
|
|
1108
|
+
},
|
|
1109
|
+
cut.id
|
|
1110
|
+
) }, side);
|
|
1111
|
+
}) }))
|
|
1108
1112
|
] });
|
|
1109
1113
|
}
|
|
1110
1114
|
var compareSlots = ["A", "B", "C", "D"];
|
|
@@ -1295,7 +1299,10 @@ function ResolvedPlayer({
|
|
|
1295
1299
|
[shots, assets]
|
|
1296
1300
|
);
|
|
1297
1301
|
const resolved = useRequest(read);
|
|
1298
|
-
if (!resolved?.data)
|
|
1302
|
+
if (!resolved?.data) {
|
|
1303
|
+
const message = /* @__PURE__ */ jsx3(LoadMessage, { error: resolved?.error });
|
|
1304
|
+
return resolved?.error && renderFilmstrip ? renderFilmstrip(message) : message;
|
|
1305
|
+
}
|
|
1299
1306
|
return /* @__PURE__ */ jsx3(
|
|
1300
1307
|
SequencePlayer,
|
|
1301
1308
|
{
|
|
@@ -1346,7 +1353,7 @@ async function resolvePreview(assets, ref) {
|
|
|
1346
1353
|
}
|
|
1347
1354
|
|
|
1348
1355
|
// packages/short-drama-compare/src/production-view.tsx
|
|
1349
|
-
import { useCallback as useCallback2, useEffect as useEffect6, useRef as
|
|
1356
|
+
import { useCallback as useCallback2, useEffect as useEffect6, useRef as useRef10, useState as useState11 } from "react";
|
|
1350
1357
|
|
|
1351
1358
|
// packages/short-drama-compare/src/episode-create.tsx
|
|
1352
1359
|
import { useId as useId5, useState as useState10 } from "react";
|
|
@@ -1427,7 +1434,7 @@ function ProductionData({
|
|
|
1427
1434
|
const [busy, setBusy] = useState11(false);
|
|
1428
1435
|
const [failure, setFailure] = useState11("");
|
|
1429
1436
|
const [creatingEpisode, setCreatingEpisode] = useState11(false);
|
|
1430
|
-
const writing =
|
|
1437
|
+
const writing = useRef10(false);
|
|
1431
1438
|
const read = useCallback2(
|
|
1432
1439
|
() => client.invoke({ instanceId, operationId: "production.get" }, {}),
|
|
1433
1440
|
[client, instanceId]
|
package/package.json
CHANGED