@luna-editor/engine 0.5.8 → 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/Player.js CHANGED
@@ -16,7 +16,6 @@ import { BackgroundLayer } from "./components/BackgroundLayer";
16
16
  import { ClickWaitIndicator } from "./components/ClickWaitIndicator";
17
17
  import { ConversationBranchBox } from "./components/ConversationBranchBox";
18
18
  import { DialogueBox } from "./components/DialogueBox";
19
- import { EndScreen } from "./components/EndScreen";
20
19
  import { FullscreenTextBox } from "./components/FullscreenTextBox";
21
20
  import { GameScreen } from "./components/GameScreen";
22
21
  import { OverlayUI } from "./components/OverlayUI";
@@ -968,7 +967,7 @@ export const Player = ({ scenario: scenarioProp, settings, plugins = EMPTY_PLUGI
968
967
  return width / height;
969
968
  };
970
969
  // 条件付きレンダリングを JSX で処理(フックの後、early return なし)
971
- return (_jsxs(_Fragment, { children: [!currentBlock && !state.isEnded && (_jsx("div", { className: clsx("flex items-center justify-center p-8", className), children: _jsx("p", { className: "text-gray-500", children: "\u30B7\u30CA\u30EA\u30AA\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093" }) })), state.isEnded && (_jsx(EndScreen, { scenarioName: scenario.name, onRestart: restart, className: className })), currentBlock && !state.isEnded && (_jsxs(_Fragment, { children: [(!imagesLoaded ||
970
+ return (_jsxs(_Fragment, { children: [!currentBlock && !state.isEnded && (_jsx("div", { className: clsx("flex items-center justify-center p-8", className), children: _jsx("p", { className: "text-gray-500", children: "\u30B7\u30CA\u30EA\u30AA\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093" }) })), currentBlock && !state.isEnded && (_jsxs(_Fragment, { children: [(!imagesLoaded ||
972
971
  !fontsLoaded ||
973
972
  !isFirstRenderComplete ||
974
973
  !pluginsLoaded) && (_jsx("div", { className: clsx("luna-player fixed inset-0 bg-black overflow-hidden flex items-center justify-center z-50", className), style: {
@@ -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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luna-editor/engine",
3
- "version": "0.5.8",
3
+ "version": "0.5.10",
4
4
  "description": "Luna Editor scenario playback engine",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",