pptx-react-viewer 3.1.5 → 3.3.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.
Files changed (160) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/{AiChatPanel-ITCVRVKP.mjs → AiChatPanel-BNFDBP4S.mjs} +9 -8
  3. package/dist/AiChatPanel-BNFDBP4S.mjs.br +0 -0
  4. package/dist/AiChatPanel-BNFDBP4S.mjs.gz +0 -0
  5. package/dist/{AiChatPanel-TO5PHBGW.js → AiChatPanel-WNQCTQB5.js} +29 -28
  6. package/dist/AiChatPanel-WNQCTQB5.js.br +0 -0
  7. package/dist/AiChatPanel-WNQCTQB5.js.gz +0 -0
  8. package/dist/{Area3DChartScene-2UNQ3J3V.js → Area3DChartScene-FXBSLIGX.js} +2 -2
  9. package/dist/Area3DChartScene-FXBSLIGX.js.br +0 -0
  10. package/dist/Area3DChartScene-FXBSLIGX.js.gz +0 -0
  11. package/dist/{Area3DChartScene-7PHPDOTG.mjs → Area3DChartScene-SAQVRYOH.mjs} +1 -1
  12. package/dist/Area3DChartScene-SAQVRYOH.mjs.br +0 -0
  13. package/dist/Area3DChartScene-SAQVRYOH.mjs.gz +0 -0
  14. package/dist/{Bar3DChartScene-MC5S3AGT.js → Bar3DChartScene-7HVUTP2E.js} +2 -2
  15. package/dist/Bar3DChartScene-7HVUTP2E.js.br +0 -0
  16. package/dist/Bar3DChartScene-7HVUTP2E.js.gz +0 -0
  17. package/dist/{Bar3DChartScene-BLPUHYRZ.mjs → Bar3DChartScene-LUA6E2K6.mjs} +1 -1
  18. package/dist/Bar3DChartScene-LUA6E2K6.mjs.br +3 -0
  19. package/dist/Bar3DChartScene-LUA6E2K6.mjs.gz +0 -0
  20. package/dist/{Line3DChartScene-L5B4YFG3.mjs → Line3DChartScene-IW4JGH57.mjs} +1 -1
  21. package/dist/Line3DChartScene-IW4JGH57.mjs.br +0 -0
  22. package/dist/Line3DChartScene-IW4JGH57.mjs.gz +0 -0
  23. package/dist/{Line3DChartScene-JVVZRIDD.js → Line3DChartScene-OVPULUTF.js} +2 -2
  24. package/dist/Line3DChartScene-OVPULUTF.js.br +0 -0
  25. package/dist/Line3DChartScene-OVPULUTF.js.gz +0 -0
  26. package/dist/{Model3DScene-LRDNQNKJ.js → Model3DScene-5KP6BVCV.js} +2 -2
  27. package/dist/Model3DScene-5KP6BVCV.js.br +0 -0
  28. package/dist/Model3DScene-5KP6BVCV.js.gz +0 -0
  29. package/dist/{Model3DScene-6TNWS5LV.mjs → Model3DScene-BERTZYCJ.mjs} +1 -1
  30. package/dist/Model3DScene-BERTZYCJ.mjs.br +0 -0
  31. package/dist/Model3DScene-BERTZYCJ.mjs.gz +0 -0
  32. package/dist/{PieChart3DScene-PZWZCXHX.js → PieChart3DScene-3R2ETTGA.js} +2 -2
  33. package/dist/PieChart3DScene-3R2ETTGA.js.br +0 -0
  34. package/dist/PieChart3DScene-3R2ETTGA.js.gz +0 -0
  35. package/dist/{PieChart3DScene-XXAIVP4I.mjs → PieChart3DScene-O6FFK5L7.mjs} +1 -1
  36. package/dist/PieChart3DScene-O6FFK5L7.mjs.br +0 -0
  37. package/dist/PieChart3DScene-O6FFK5L7.mjs.gz +0 -0
  38. package/dist/{SurfaceChart3DScene-CRUGJSCY.mjs → SurfaceChart3DScene-OCR26R5D.mjs} +1 -1
  39. package/dist/SurfaceChart3DScene-OCR26R5D.mjs.br +0 -0
  40. package/dist/SurfaceChart3DScene-OCR26R5D.mjs.gz +0 -0
  41. package/dist/{SurfaceChart3DScene-UBQV3ZN2.js → SurfaceChart3DScene-TGFAOLHL.js} +2 -2
  42. package/dist/SurfaceChart3DScene-TGFAOLHL.js.br +0 -0
  43. package/dist/SurfaceChart3DScene-TGFAOLHL.js.gz +0 -0
  44. package/dist/{chunk-QOLYY7E3.mjs → chunk-2FTJAMFA.mjs} +300 -66
  45. package/dist/chunk-2FTJAMFA.mjs.br +0 -0
  46. package/dist/chunk-2FTJAMFA.mjs.gz +0 -0
  47. package/dist/{chunk-P3VXXUZM.mjs → chunk-3B5FRKYU.mjs} +137 -438
  48. package/dist/chunk-3B5FRKYU.mjs.br +0 -0
  49. package/dist/chunk-3B5FRKYU.mjs.gz +0 -0
  50. package/dist/{chunk-SWRY3SI5.js → chunk-3P7FYHJH.js} +47 -1
  51. package/dist/chunk-3P7FYHJH.js.br +0 -0
  52. package/dist/chunk-3P7FYHJH.js.gz +0 -0
  53. package/dist/{chunk-T2QG2HD5.js → chunk-44CQ67GQ.js} +173 -262
  54. package/dist/chunk-44CQ67GQ.js.br +0 -0
  55. package/dist/chunk-44CQ67GQ.js.gz +0 -0
  56. package/dist/{chunk-ARJE3V6V.mjs → chunk-AMRT3AE4.mjs} +47 -1
  57. package/dist/chunk-AMRT3AE4.mjs.br +0 -0
  58. package/dist/chunk-AMRT3AE4.mjs.gz +0 -0
  59. package/dist/{chunk-XIHK52SB.mjs → chunk-DM2IZCSD.mjs} +8499 -3404
  60. package/dist/chunk-DM2IZCSD.mjs.br +0 -0
  61. package/dist/chunk-DM2IZCSD.mjs.gz +0 -0
  62. package/dist/{chunk-LGVNUG3G.js → chunk-FSQCEAMG.js} +305 -68
  63. package/dist/chunk-FSQCEAMG.js.br +0 -0
  64. package/dist/chunk-FSQCEAMG.js.gz +0 -0
  65. package/dist/{chunk-LXYDXLKZ.js → chunk-GR6SJJIT.js} +463 -776
  66. package/dist/chunk-GR6SJJIT.js.br +0 -0
  67. package/dist/chunk-GR6SJJIT.js.gz +0 -0
  68. package/dist/{chunk-BPWSJLLG.mjs → chunk-ITN5NYYM.mjs} +10 -98
  69. package/dist/chunk-ITN5NYYM.mjs.br +0 -0
  70. package/dist/chunk-ITN5NYYM.mjs.gz +0 -0
  71. package/dist/{chunk-YDEEINER.js → chunk-K6R2JNCK.js} +8531 -3410
  72. package/dist/chunk-K6R2JNCK.js.br +0 -0
  73. package/dist/chunk-K6R2JNCK.js.gz +0 -0
  74. package/dist/{chunk-A2UAUSJM.mjs → chunk-QEEU4S4Z.mjs} +65 -378
  75. package/dist/chunk-QEEU4S4Z.mjs.br +0 -0
  76. package/dist/chunk-QEEU4S4Z.mjs.gz +0 -0
  77. package/dist/{chunk-ZPF4L6SD.js → chunk-QKSYKQEL.js} +1243 -1544
  78. package/dist/chunk-QKSYKQEL.js.br +0 -0
  79. package/dist/chunk-QKSYKQEL.js.gz +0 -0
  80. package/dist/i18n.js +4 -4
  81. package/dist/i18n.js.br +0 -0
  82. package/dist/i18n.js.gz +0 -0
  83. package/dist/i18n.mjs +1 -1
  84. package/dist/i18n.mjs.br +0 -0
  85. package/dist/i18n.mjs.gz +0 -0
  86. package/dist/index.d.ts +170 -17
  87. package/dist/index.js +47 -47
  88. package/dist/index.js.br +0 -0
  89. package/dist/index.js.gz +0 -0
  90. package/dist/index.mjs +6 -6
  91. package/dist/index.mjs.br +0 -0
  92. package/dist/index.mjs.gz +0 -0
  93. package/dist/internals.d.ts +170 -17
  94. package/dist/internals.d.ts.map +1 -1
  95. package/dist/internals.js +79 -79
  96. package/dist/internals.js.br +0 -0
  97. package/dist/internals.js.gz +0 -0
  98. package/dist/internals.mjs +4 -4
  99. package/dist/internals.mjs.br +0 -0
  100. package/dist/internals.mjs.gz +0 -0
  101. package/dist/viewer/index.d.ts +170 -17
  102. package/dist/viewer/index.js +27 -27
  103. package/dist/viewer/index.js.br +0 -0
  104. package/dist/viewer/index.js.gz +0 -0
  105. package/dist/viewer/index.mjs +6 -6
  106. package/dist/viewer/index.mjs.br +0 -0
  107. package/dist/viewer/index.mjs.gz +0 -0
  108. package/package.json +1 -1
  109. package/dist/AiChatPanel-ITCVRVKP.mjs.br +0 -0
  110. package/dist/AiChatPanel-ITCVRVKP.mjs.gz +0 -0
  111. package/dist/AiChatPanel-TO5PHBGW.js.br +0 -0
  112. package/dist/AiChatPanel-TO5PHBGW.js.gz +0 -0
  113. package/dist/Area3DChartScene-2UNQ3J3V.js.br +0 -0
  114. package/dist/Area3DChartScene-2UNQ3J3V.js.gz +0 -0
  115. package/dist/Area3DChartScene-7PHPDOTG.mjs.br +0 -0
  116. package/dist/Area3DChartScene-7PHPDOTG.mjs.gz +0 -0
  117. package/dist/Bar3DChartScene-BLPUHYRZ.mjs.br +0 -0
  118. package/dist/Bar3DChartScene-BLPUHYRZ.mjs.gz +0 -0
  119. package/dist/Bar3DChartScene-MC5S3AGT.js.br +0 -0
  120. package/dist/Bar3DChartScene-MC5S3AGT.js.gz +0 -0
  121. package/dist/Line3DChartScene-JVVZRIDD.js.br +0 -0
  122. package/dist/Line3DChartScene-JVVZRIDD.js.gz +0 -0
  123. package/dist/Line3DChartScene-L5B4YFG3.mjs.br +0 -0
  124. package/dist/Line3DChartScene-L5B4YFG3.mjs.gz +0 -0
  125. package/dist/Model3DScene-6TNWS5LV.mjs.br +0 -0
  126. package/dist/Model3DScene-6TNWS5LV.mjs.gz +0 -0
  127. package/dist/Model3DScene-LRDNQNKJ.js.br +0 -0
  128. package/dist/Model3DScene-LRDNQNKJ.js.gz +0 -0
  129. package/dist/PieChart3DScene-PZWZCXHX.js.br +0 -0
  130. package/dist/PieChart3DScene-PZWZCXHX.js.gz +0 -0
  131. package/dist/PieChart3DScene-XXAIVP4I.mjs.br +0 -0
  132. package/dist/PieChart3DScene-XXAIVP4I.mjs.gz +0 -0
  133. package/dist/SurfaceChart3DScene-CRUGJSCY.mjs.br +0 -1
  134. package/dist/SurfaceChart3DScene-CRUGJSCY.mjs.gz +0 -0
  135. package/dist/SurfaceChart3DScene-UBQV3ZN2.js.br +0 -0
  136. package/dist/SurfaceChart3DScene-UBQV3ZN2.js.gz +0 -0
  137. package/dist/chunk-A2UAUSJM.mjs.br +0 -0
  138. package/dist/chunk-A2UAUSJM.mjs.gz +0 -0
  139. package/dist/chunk-ARJE3V6V.mjs.br +0 -0
  140. package/dist/chunk-ARJE3V6V.mjs.gz +0 -0
  141. package/dist/chunk-BPWSJLLG.mjs.br +0 -0
  142. package/dist/chunk-BPWSJLLG.mjs.gz +0 -0
  143. package/dist/chunk-LGVNUG3G.js.br +0 -0
  144. package/dist/chunk-LGVNUG3G.js.gz +0 -0
  145. package/dist/chunk-LXYDXLKZ.js.br +0 -0
  146. package/dist/chunk-LXYDXLKZ.js.gz +0 -0
  147. package/dist/chunk-P3VXXUZM.mjs.br +0 -0
  148. package/dist/chunk-P3VXXUZM.mjs.gz +0 -0
  149. package/dist/chunk-QOLYY7E3.mjs.br +0 -0
  150. package/dist/chunk-QOLYY7E3.mjs.gz +0 -0
  151. package/dist/chunk-SWRY3SI5.js.br +0 -0
  152. package/dist/chunk-SWRY3SI5.js.gz +0 -0
  153. package/dist/chunk-T2QG2HD5.js.br +0 -0
  154. package/dist/chunk-T2QG2HD5.js.gz +0 -0
  155. package/dist/chunk-XIHK52SB.mjs.br +0 -0
  156. package/dist/chunk-XIHK52SB.mjs.gz +0 -0
  157. package/dist/chunk-YDEEINER.js.br +0 -0
  158. package/dist/chunk-YDEEINER.js.gz +0 -0
  159. package/dist/chunk-ZPF4L6SD.js.br +0 -0
  160. package/dist/chunk-ZPF4L6SD.js.gz +0 -0
Binary file
Binary file
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkYDEEINER_js = require('./chunk-YDEEINER.js');
3
+ var chunkK6R2JNCK_js = require('./chunk-K6R2JNCK.js');
4
4
  var chunk4VNS5WPM_js = require('./chunk-4VNS5WPM.js');
5
5
  var mcp = require('pptx-viewer-mcp');
6
6
  var mcpSchemas = require('pptx-viewer-mcp/schemas');
@@ -14879,7 +14879,7 @@ async function buildSlideMarkdown(slides, slideIndex2, meta3, options = {}) {
14879
14879
  };
14880
14880
  let markdown;
14881
14881
  try {
14882
- const converter = new chunkYDEEINER_js.PptxMarkdownConverter(
14882
+ const converter = new chunkK6R2JNCK_js.PptxMarkdownConverter(
14883
14883
  "",
14884
14884
  {
14885
14885
  sourceName: meta3.title ?? "deck.pptx",
@@ -15471,7 +15471,7 @@ var getTheme = (ctx) => {
15471
15471
  name: theme?.name,
15472
15472
  colorScheme: theme?.colorScheme,
15473
15473
  fontScheme: theme?.fontScheme,
15474
- availablePresets: Object.keys(chunkYDEEINER_js.ThemePresets)
15474
+ availablePresets: Object.keys(chunkK6R2JNCK_js.ThemePresets)
15475
15475
  };
15476
15476
  };
15477
15477
  var readExecutors = {
@@ -16218,11 +16218,6 @@ function changeGhostStyle(change, phase, config2) {
16218
16218
  }
16219
16219
  init_chat_history_store();
16220
16220
  init_chat_history_store();
16221
- function deckIdFromBridge(bridge) {
16222
- const meta3 = bridge.getDeckMeta();
16223
- const title = (meta3.title ?? "deck").trim().toLowerCase().replace(/\s+/gu, "-").slice(0, 60);
16224
- return `${title || "deck"}::${meta3.slideCount}`;
16225
- }
16226
16221
  function isTextPart(part) {
16227
16222
  return part.type === "text";
16228
16223
  }
@@ -16263,6 +16258,304 @@ function toRenderableParts(message) {
16263
16258
  }
16264
16259
  return out;
16265
16260
  }
16261
+ function isoOf(ms) {
16262
+ const n = Number.isFinite(ms) ? ms : 0;
16263
+ return new Date(n).toISOString();
16264
+ }
16265
+ function toLogChat(chat, detailed) {
16266
+ const messages = chat.messages.map((message) => {
16267
+ const parts = toRenderableParts(message);
16268
+ const textRuns = [];
16269
+ const toolCalls = [];
16270
+ for (const part of parts) {
16271
+ if (part.kind === "text") {
16272
+ textRuns.push(part.text);
16273
+ continue;
16274
+ }
16275
+ toolCalls.push({
16276
+ toolName: part.toolName,
16277
+ toolCallId: part.toolCallId,
16278
+ state: part.state,
16279
+ input: detailed ? part.input : void 0,
16280
+ output: detailed ? part.output : void 0,
16281
+ errorText: part.errorText
16282
+ });
16283
+ }
16284
+ return {
16285
+ role: message.role,
16286
+ text: textRuns.join("\n\n"),
16287
+ toolCalls
16288
+ };
16289
+ });
16290
+ return {
16291
+ id: chat.id,
16292
+ title: chat.title,
16293
+ deckId: chat.deckId,
16294
+ createdAt: chat.createdAt,
16295
+ updatedAt: chat.updatedAt,
16296
+ createdAtIso: isoOf(chat.createdAt),
16297
+ updatedAtIso: isoOf(chat.updatedAt),
16298
+ messageCount: chat.messages.length,
16299
+ messages
16300
+ };
16301
+ }
16302
+ function buildChatLogExport(chats, options) {
16303
+ const detailed = options?.detailed ?? true;
16304
+ const now = options?.now ?? Date.now();
16305
+ return {
16306
+ format: "pptx-ai-chat-log",
16307
+ version: 1,
16308
+ exportedAt: isoOf(now),
16309
+ detailed,
16310
+ chatCount: chats.length,
16311
+ chats: chats.map((chat) => toLogChat(chat, detailed))
16312
+ };
16313
+ }
16314
+ function toolCallLine(call, detailed) {
16315
+ const lines = [`- Tool \`${call.toolName}\` (${call.state})`];
16316
+ if (call.errorText) {
16317
+ lines.push(` - error: ${call.errorText}`);
16318
+ }
16319
+ if (detailed) {
16320
+ lines.push(" - input:");
16321
+ lines.push(" ```json");
16322
+ lines.push(JSON.stringify(call.input ?? null, null, 2));
16323
+ lines.push(" ```");
16324
+ lines.push(" - output:");
16325
+ lines.push(" ```json");
16326
+ lines.push(JSON.stringify(call.output ?? null, null, 2));
16327
+ lines.push(" ```");
16328
+ }
16329
+ return lines.join("\n");
16330
+ }
16331
+ function buildChatLogMarkdown(doc) {
16332
+ const out = [
16333
+ `# AI chat logs`,
16334
+ "",
16335
+ `Exported: ${doc.exportedAt}`,
16336
+ `Chats: ${doc.chatCount}`,
16337
+ ""
16338
+ ];
16339
+ for (const chat of doc.chats) {
16340
+ out.push(`## ${chat.title || chat.id}`);
16341
+ out.push("");
16342
+ out.push(`- id: ${chat.id}`);
16343
+ if (chat.deckId) {
16344
+ out.push(`- deck: ${chat.deckId}`);
16345
+ }
16346
+ out.push(`- created: ${chat.createdAtIso}`);
16347
+ out.push(`- updated: ${chat.updatedAtIso}`);
16348
+ out.push(`- messages: ${chat.messageCount}`);
16349
+ out.push("");
16350
+ for (const message of chat.messages) {
16351
+ out.push(`### ${message.role}`);
16352
+ out.push("");
16353
+ if (message.text) {
16354
+ out.push(message.text);
16355
+ out.push("");
16356
+ }
16357
+ for (const call of message.toolCalls) {
16358
+ out.push(toolCallLine(call, doc.detailed));
16359
+ out.push("");
16360
+ }
16361
+ }
16362
+ }
16363
+ return out.join("\n");
16364
+ }
16365
+ async function collectStoredChats(store = createChatHistoryStore()) {
16366
+ const summaries = await store.listChats();
16367
+ const chats = [];
16368
+ for (const summary of summaries) {
16369
+ const chat = await store.loadChat(summary.id);
16370
+ if (chat) {
16371
+ chats.push(chat);
16372
+ }
16373
+ }
16374
+ return chats;
16375
+ }
16376
+ function timestampSlug(now) {
16377
+ const d = new Date(now);
16378
+ const p = (n) => String(n).padStart(2, "0");
16379
+ return `${d.getFullYear()}${p(d.getMonth() + 1)}${p(d.getDate())}-${p(d.getHours())}${p(d.getMinutes())}${p(d.getSeconds())}`;
16380
+ }
16381
+ function exportAiChatLogs(chats, meta3, save) {
16382
+ if (chats.length === 0) {
16383
+ return 0;
16384
+ }
16385
+ const now = meta3?.now ?? Date.now();
16386
+ const doc = buildChatLogExport(chats, { detailed: meta3?.detailed ?? true, now });
16387
+ const slug = timestampSlug(now);
16388
+ const format = meta3?.format ?? "json";
16389
+ if (format === "markdown") {
16390
+ save(`pptx-ai-chats-${slug}.md`, buildChatLogMarkdown(doc), "text/markdown");
16391
+ } else {
16392
+ save(`pptx-ai-chats-${slug}.json`, JSON.stringify(doc, null, 2), "application/json");
16393
+ }
16394
+ return chats.length;
16395
+ }
16396
+ function computeFocusTargets(input) {
16397
+ const { activeSlideIndex, selectedElementIds, selectedElementId } = input;
16398
+ const ids = selectedElementIds.length > 0 ? [...selectedElementIds] : selectedElementId ? [selectedElementId] : [];
16399
+ if (ids.length === 0) {
16400
+ return [{ kind: "slide", slideIndex: activeSlideIndex }];
16401
+ }
16402
+ return ids.map((elementId2) => ({ kind: "element", slideIndex: activeSlideIndex, elementId: elementId2 }));
16403
+ }
16404
+ function elementTypeLabel(type) {
16405
+ if (type === "smartArt") {
16406
+ return "SmartArt";
16407
+ }
16408
+ if (type === "ole") {
16409
+ return "OLE";
16410
+ }
16411
+ return type.charAt(0).toUpperCase() + type.slice(1);
16412
+ }
16413
+ function shortElementId(id) {
16414
+ const trailingNumber = id.match(/(\d+)\s*$/u);
16415
+ if (trailingNumber) {
16416
+ return trailingNumber[1];
16417
+ }
16418
+ const tail = id.replace(/^.*[/.-]/u, "");
16419
+ return tail || id;
16420
+ }
16421
+ function focusTargetChips(targets, slides) {
16422
+ return targets.map((target, index) => {
16423
+ if (target.kind === "slide") {
16424
+ const label2 = `Slide ${target.slideIndex + 1}`;
16425
+ return { key: `slide-${target.slideIndex}-${index}`, label: label2, title: label2 };
16426
+ }
16427
+ const el = slides[target.slideIndex]?.elements.find((e) => e.id === target.elementId);
16428
+ const typeLabel = el ? elementTypeLabel(el.type) : "Element";
16429
+ const label = el ? `${typeLabel} ${shortElementId(target.elementId)}` : `${typeLabel} (missing)`;
16430
+ return {
16431
+ key: `el-${target.elementId}-${index}`,
16432
+ label,
16433
+ title: `${typeLabel}: ${target.elementId}`
16434
+ };
16435
+ });
16436
+ }
16437
+ function isTwoTableFocus(targets, slides) {
16438
+ if (targets.length !== 2 || targets.some((target) => target.kind !== "element")) {
16439
+ return false;
16440
+ }
16441
+ const [a, b] = targets;
16442
+ if (a.slideIndex !== b.slideIndex) {
16443
+ return false;
16444
+ }
16445
+ const slide = slides[a.slideIndex];
16446
+ const elA = slide?.elements.find((e) => e.id === a.elementId);
16447
+ const elB = slide?.elements.find((e) => e.id === b.elementId);
16448
+ if (elA?.type !== "table" || elB?.type !== "table") {
16449
+ return false;
16450
+ }
16451
+ return { slideIndex: a.slideIndex, elementIdA: a.elementId, elementIdB: b.elementId };
16452
+ }
16453
+ function mergeTablesDirective(slideIndex2, elementIdA, elementIdB) {
16454
+ return `Merge the two selected tables (elementIdA=${elementIdA}, elementIdB=${elementIdB}) on slide ${slideIndex2 + 1} using merge_tables; stage it now, do not ask me to confirm.`;
16455
+ }
16456
+ init_chat_history_store();
16457
+ function deckIdFromBridge(bridge) {
16458
+ const meta3 = bridge.getDeckMeta();
16459
+ const title = (meta3.title ?? "deck").trim().toLowerCase().replace(/\s+/gu, "-").slice(0, 60);
16460
+ return `${title || "deck"}::${meta3.slideCount}`;
16461
+ }
16462
+ function applyElementUpdate(el, u) {
16463
+ if (u.x !== void 0) {
16464
+ el.x = u.x;
16465
+ }
16466
+ if (u.y !== void 0) {
16467
+ el.y = u.y;
16468
+ }
16469
+ if (u.width !== void 0) {
16470
+ el.width = u.width;
16471
+ }
16472
+ if (u.height !== void 0) {
16473
+ el.height = u.height;
16474
+ }
16475
+ if (u.rotation !== void 0) {
16476
+ el.rotation = u.rotation;
16477
+ }
16478
+ if (u.opacity !== void 0) {
16479
+ el.opacity = u.opacity;
16480
+ }
16481
+ if (u.hidden !== void 0) {
16482
+ el.hidden = u.hidden;
16483
+ }
16484
+ if (u.flipHorizontal !== void 0) {
16485
+ el.flipHorizontal = u.flipHorizontal;
16486
+ }
16487
+ if (u.flipVertical !== void 0) {
16488
+ el.flipVertical = u.flipVertical;
16489
+ }
16490
+ applyTextUpdate(el, u);
16491
+ applyShapeStyleUpdate(el, u);
16492
+ }
16493
+ function applyTextUpdate(el, u) {
16494
+ if (!chunkK6R2JNCK_js.hasTextProperties(el)) {
16495
+ return;
16496
+ }
16497
+ const textEl = el;
16498
+ if (u.text !== void 0) {
16499
+ textEl.text = u.text;
16500
+ if (textEl.textSegments && textEl.textSegments.length > 0) {
16501
+ textEl.textSegments[0].text = u.text;
16502
+ } else {
16503
+ textEl.textSegments = [{ text: u.text, style: {} }];
16504
+ }
16505
+ }
16506
+ if (u.fontSize === void 0 && u.fontFamily === void 0 && u.fontColor === void 0 && u.bold === void 0 && u.italic === void 0 && u.underline === void 0 && u.align === void 0) {
16507
+ return;
16508
+ }
16509
+ const textStyle = {};
16510
+ if (u.fontSize !== void 0) {
16511
+ textStyle.fontSize = u.fontSize;
16512
+ }
16513
+ if (u.fontFamily !== void 0) {
16514
+ textStyle.fontFamily = u.fontFamily;
16515
+ }
16516
+ if (u.fontColor !== void 0) {
16517
+ textStyle.color = u.fontColor;
16518
+ }
16519
+ if (u.bold !== void 0) {
16520
+ textStyle.bold = u.bold;
16521
+ }
16522
+ if (u.italic !== void 0) {
16523
+ textStyle.italic = u.italic;
16524
+ }
16525
+ if (u.underline !== void 0) {
16526
+ textStyle.underline = u.underline;
16527
+ }
16528
+ if (u.align !== void 0) {
16529
+ textStyle.align = u.align;
16530
+ }
16531
+ textEl.textStyle = { ...textEl.textStyle, ...textStyle };
16532
+ if (textEl.textSegments) {
16533
+ textEl.textSegments = textEl.textSegments.map((seg) => ({
16534
+ ...seg,
16535
+ style: { ...seg.style, ...textStyle }
16536
+ }));
16537
+ }
16538
+ }
16539
+ function applyShapeStyleUpdate(el, u) {
16540
+ if (u.fillColor === void 0 && u.strokeColor === void 0 && u.strokeWidth === void 0) {
16541
+ return;
16542
+ }
16543
+ if (!chunkK6R2JNCK_js.hasShapeProperties(el)) {
16544
+ return;
16545
+ }
16546
+ const holder = el;
16547
+ holder.shapeStyle ??= {};
16548
+ const style = holder.shapeStyle;
16549
+ if (u.fillColor !== void 0) {
16550
+ style.fillColor = u.fillColor;
16551
+ }
16552
+ if (u.strokeColor !== void 0) {
16553
+ style.strokeColor = u.strokeColor;
16554
+ }
16555
+ if (u.strokeWidth !== void 0) {
16556
+ style.strokeWidth = u.strokeWidth;
16557
+ }
16558
+ }
16266
16559
  function toolLabel(toolName) {
16267
16560
  if (!toolName) {
16268
16561
  return "Tool";
@@ -16664,78 +16957,22 @@ function toolCanvasTarget(toolName, input) {
16664
16957
  return { slideIndex: slideIndex2, elementIds };
16665
16958
  }
16666
16959
 
16667
- // src/viewer/hooks/ai/focus-targets.ts
16668
- function computeFocusTargets(input) {
16669
- const { activeSlideIndex, selectedElementIds, selectedElementId } = input;
16670
- const ids = selectedElementIds.length > 0 ? selectedElementIds : selectedElementId ? [selectedElementId] : [];
16671
- if (ids.length === 0) {
16672
- return [{ kind: "slide", slideIndex: activeSlideIndex }];
16673
- }
16674
- return ids.map((elementId2) => ({ kind: "element", slideIndex: activeSlideIndex, elementId: elementId2 }));
16675
- }
16676
- function elementTypeLabel(type) {
16677
- if (type === "smartArt") {
16678
- return "SmartArt";
16679
- }
16680
- if (type === "ole") {
16681
- return "OLE";
16682
- }
16683
- return type.charAt(0).toUpperCase() + type.slice(1);
16684
- }
16685
- function shortElementId(id) {
16686
- const trailingNumber = id.match(/(\d+)\s*$/u);
16687
- if (trailingNumber) {
16688
- return trailingNumber[1];
16689
- }
16690
- const tail = id.replace(/^.*[/.-]/u, "");
16691
- return tail || id;
16692
- }
16693
- function focusTargetChips(targets, slides) {
16694
- return targets.map((target, index) => {
16695
- if (target.kind === "slide") {
16696
- const label2 = `Slide ${target.slideIndex + 1}`;
16697
- return { key: `slide-${target.slideIndex}-${index}`, label: label2, title: label2 };
16698
- }
16699
- const el = slides[target.slideIndex]?.elements.find((e) => e.id === target.elementId);
16700
- const typeLabel = el ? elementTypeLabel(el.type) : "Element";
16701
- const label = el ? `${typeLabel} ${shortElementId(target.elementId)}` : `${typeLabel} (missing)`;
16702
- return {
16703
- key: `el-${target.elementId}-${index}`,
16704
- label,
16705
- title: `${typeLabel}: ${target.elementId}`
16706
- };
16707
- });
16708
- }
16709
- function isTwoTableFocus(targets, slides) {
16710
- if (targets.length !== 2 || targets.some((t) => t.kind !== "element")) {
16711
- return false;
16712
- }
16713
- const [a, b] = targets;
16714
- if (a.slideIndex !== b.slideIndex) {
16715
- return false;
16716
- }
16717
- const slide = slides[a.slideIndex];
16718
- const elA = slide?.elements.find((e) => e.id === a.elementId);
16719
- const elB = slide?.elements.find((e) => e.id === b.elementId);
16720
- if (elA?.type !== "table" || elB?.type !== "table") {
16721
- return false;
16722
- }
16723
- return { slideIndex: a.slideIndex, elementIdA: a.elementId, elementIdB: b.elementId };
16724
- }
16725
-
16726
16960
  exports.aiChangeAnimationCss = aiChangeAnimationCss;
16961
+ exports.applyElementUpdate = applyElementUpdate;
16727
16962
  exports.buildDeckContext = buildDeckContext;
16728
16963
  exports.changeGhostStyle = changeGhostStyle;
16964
+ exports.collectStoredChats = collectStoredChats;
16729
16965
  exports.computeFocusTargets = computeFocusTargets;
16730
16966
  exports.createAiChatSession = createAiChatSession;
16731
16967
  exports.createChatHistoryStore = createChatHistoryStore;
16732
16968
  exports.deckIdFromBridge = deckIdFromBridge;
16733
16969
  exports.describeToolActivity = describeToolActivity;
16970
+ exports.exportAiChatLogs = exportAiChatLogs;
16734
16971
  exports.focusTargetChips = focusTargetChips;
16735
16972
  exports.humanizeDiffLine = humanizeDiffLine;
16736
16973
  exports.isAiAvailable = isAiAvailable;
16737
16974
  exports.isTwoTableFocus = isTwoTableFocus;
16975
+ exports.mergeTablesDirective = mergeTablesDirective;
16738
16976
  exports.summarizeToolArgs = summarizeToolArgs;
16739
- exports.toRenderableParts = toRenderableParts;
16740
16977
  exports.toolCanvasTarget = toolCanvasTarget;
16741
16978
  exports.toolLabel = toolLabel;
Binary file
Binary file