@luna-editor/engine 0.5.9 → 0.5.10
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/hooks/useBacklog.js +6 -2
- package/dist/types.d.ts +4 -0
- package/package.json +1 -1
package/dist/hooks/useBacklog.js
CHANGED
|
@@ -26,7 +26,7 @@ export function useBacklog({ scenario, currentBlockIndex, currentBlock, }) {
|
|
|
26
26
|
.map((block, index) => ({ block, realIndex: index }))
|
|
27
27
|
.filter(({ block }) => block.blockType === "dialogue" || block.blockType === "narration");
|
|
28
28
|
conversationBlocks.forEach(({ block, realIndex }) => {
|
|
29
|
-
var _a, _b;
|
|
29
|
+
var _a, _b, _c, _d, _e;
|
|
30
30
|
if (!processedBlocks.current.has(realIndex)) {
|
|
31
31
|
const logEntry = {
|
|
32
32
|
id: `${block.id}_init`,
|
|
@@ -36,6 +36,8 @@ export function useBacklog({ scenario, currentBlockIndex, currentBlock, }) {
|
|
|
36
36
|
content: block.content,
|
|
37
37
|
speakerName: (_a = block.speaker) === null || _a === void 0 ? void 0 : _a.name,
|
|
38
38
|
speakerState: (_b = block.speakerState) === null || _b === void 0 ? void 0 : _b.name,
|
|
39
|
+
speakerId: (_c = block.speakerId) !== null && _c !== void 0 ? _c : undefined,
|
|
40
|
+
speakerImageUrl: (_e = (_d = block.speakerState) === null || _d === void 0 ? void 0 : _d.imageUrl) !== null && _e !== void 0 ? _e : undefined,
|
|
39
41
|
options: block.options,
|
|
40
42
|
};
|
|
41
43
|
addLogEntry(logEntry);
|
|
@@ -46,7 +48,7 @@ export function useBacklog({ scenario, currentBlockIndex, currentBlock, }) {
|
|
|
46
48
|
}, [scenario.blocks, addLogEntry]);
|
|
47
49
|
// 新しいブロックを処理
|
|
48
50
|
useEffect(() => {
|
|
49
|
-
var _a, _b;
|
|
51
|
+
var _a, _b, _c, _d, _e;
|
|
50
52
|
if (!currentBlock || !hasBuiltInitialHistory.current) {
|
|
51
53
|
return;
|
|
52
54
|
}
|
|
@@ -63,6 +65,8 @@ export function useBacklog({ scenario, currentBlockIndex, currentBlock, }) {
|
|
|
63
65
|
content: currentBlock.content,
|
|
64
66
|
speakerName: (_a = currentBlock.speaker) === null || _a === void 0 ? void 0 : _a.name,
|
|
65
67
|
speakerState: (_b = currentBlock.speakerState) === null || _b === void 0 ? void 0 : _b.name,
|
|
68
|
+
speakerId: (_c = currentBlock.speakerId) !== null && _c !== void 0 ? _c : undefined,
|
|
69
|
+
speakerImageUrl: (_e = (_d = currentBlock.speakerState) === null || _d === void 0 ? void 0 : _d.imageUrl) !== null && _e !== void 0 ? _e : undefined,
|
|
66
70
|
options: currentBlock.options,
|
|
67
71
|
};
|
|
68
72
|
addLogEntry(logEntry);
|
package/dist/types.d.ts
CHANGED
|
@@ -390,6 +390,10 @@ export interface BacklogEntry {
|
|
|
390
390
|
content: string | null;
|
|
391
391
|
speakerName?: string;
|
|
392
392
|
speakerState?: string;
|
|
393
|
+
/** 話者のオブジェクトID */
|
|
394
|
+
speakerId?: string;
|
|
395
|
+
/** 話者の画像URL(そのブロック時点の状態の画像) */
|
|
396
|
+
speakerImageUrl?: string;
|
|
393
397
|
/** Block options (for plugin-defined options like bubble style) */
|
|
394
398
|
options?: BlockOptions | null;
|
|
395
399
|
}
|