@arbidocs/blocks 0.5.191 → 0.5.193

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 (161) hide show
  1. package/bin/arbidocs-mix-take.mjs +34 -0
  2. package/bin/arbidocs-record-take.mjs +77 -11
  3. package/bin/arbidocs-voice-take.mjs +32 -0
  4. package/dist/{ConnectedCallDock-PVBDNOTA.cjs → ConnectedCallDock-ILFVXVCB.cjs} +26 -26
  5. package/dist/{ConnectedCallDock-PVBDNOTA.cjs.map → ConnectedCallDock-ILFVXVCB.cjs.map} +1 -1
  6. package/dist/{ConnectedCallRoom-H2OWGUEN.cjs → ConnectedCallRoom-XUMVIAWS.cjs} +19 -19
  7. package/dist/{ConnectedCallRoom-H2OWGUEN.cjs.map → ConnectedCallRoom-XUMVIAWS.cjs.map} +1 -1
  8. package/dist/{ConnectedNativeDocxComparison-NKVGPLSK.cjs → ConnectedNativeDocxComparison-3KBUDWLO.cjs} +19 -19
  9. package/dist/{ConnectedNativeDocxComparison-NKVGPLSK.cjs.map → ConnectedNativeDocxComparison-3KBUDWLO.cjs.map} +1 -1
  10. package/dist/{ConnectedPresentation-N6HNSYRH.cjs → ConnectedPresentation-LNDESKYE.cjs} +20 -20
  11. package/dist/{ConnectedPresentation-N6HNSYRH.cjs.map → ConnectedPresentation-LNDESKYE.cjs.map} +1 -1
  12. package/dist/{ConnectedProductionSetDialog-KT6BPSRE.cjs → ConnectedProductionSetDialog-SHDI7KP6.cjs} +6 -6
  13. package/dist/{ConnectedProductionSetDialog-KT6BPSRE.cjs.map → ConnectedProductionSetDialog-SHDI7KP6.cjs.map} +1 -1
  14. package/dist/{ConnectedSlidesTab-J7OPUXI4.cjs → ConnectedSlidesTab-LEA5OW75.cjs} +17 -17
  15. package/dist/{ConnectedSlidesTab-J7OPUXI4.cjs.map → ConnectedSlidesTab-LEA5OW75.cjs.map} +1 -1
  16. package/dist/{ConnectedStreamedWordArtifact-BLSAP7NY.cjs → ConnectedStreamedWordArtifact-F4XIWVOG.cjs} +19 -19
  17. package/dist/{ConnectedStreamedWordArtifact-BLSAP7NY.cjs.map → ConnectedStreamedWordArtifact-F4XIWVOG.cjs.map} +1 -1
  18. package/dist/{DocumentReviewCard-C2ZXJ2ZL.cjs → DocumentReviewCard-GWMZMXKZ.cjs} +21 -21
  19. package/dist/{DocumentReviewCard-C2ZXJ2ZL.cjs.map → DocumentReviewCard-GWMZMXKZ.cjs.map} +1 -1
  20. package/dist/{FilesViewerDialog-NUPMAEIC.cjs → FilesViewerDialog-SEMFURAU.cjs} +52 -52
  21. package/dist/{FilesViewerDialog-NUPMAEIC.cjs.map → FilesViewerDialog-SEMFURAU.cjs.map} +1 -1
  22. package/dist/{WorkspaceTableView-CSOPEZFT.cjs → WorkspaceTableView-W6NGKKII.cjs} +11 -11
  23. package/dist/{WorkspaceTableView-CSOPEZFT.cjs.map → WorkspaceTableView-W6NGKKII.cjs.map} +1 -1
  24. package/dist/agents/index.cjs +287 -287
  25. package/dist/{ai-2B4BMS6O.cjs → ai-C5THVAML.cjs} +28 -28
  26. package/dist/ai-C5THVAML.cjs.map +1 -0
  27. package/dist/auth/index.cjs +12 -12
  28. package/dist/calls/index.cjs +126 -126
  29. package/dist/chat/index.cjs +48 -48
  30. package/dist/{chunk-VNUBBRJM.cjs → chunk-2K5DLB7B.cjs} +3 -3
  31. package/dist/{chunk-VNUBBRJM.cjs.map → chunk-2K5DLB7B.cjs.map} +1 -1
  32. package/dist/{chunk-NTXII2XQ.cjs → chunk-3EIO4ZH5.cjs} +6 -6
  33. package/dist/{chunk-NTXII2XQ.cjs.map → chunk-3EIO4ZH5.cjs.map} +1 -1
  34. package/dist/{chunk-3U6XE7SF.cjs → chunk-3P766LID.cjs} +4 -4
  35. package/dist/{chunk-3U6XE7SF.cjs.map → chunk-3P766LID.cjs.map} +1 -1
  36. package/dist/{chunk-B5AOYT4U.cjs → chunk-5FSULBPE.cjs} +3 -3
  37. package/dist/{chunk-B5AOYT4U.cjs.map → chunk-5FSULBPE.cjs.map} +1 -1
  38. package/dist/{chunk-SKIQ54TG.cjs → chunk-5IRDGXB2.cjs} +11 -11
  39. package/dist/{chunk-SKIQ54TG.cjs.map → chunk-5IRDGXB2.cjs.map} +1 -1
  40. package/dist/{chunk-3P6KGC46.cjs → chunk-5OD6DRG7.cjs} +3 -3
  41. package/dist/{chunk-3P6KGC46.cjs.map → chunk-5OD6DRG7.cjs.map} +1 -1
  42. package/dist/{chunk-XKQKHXRU.cjs → chunk-6AFAYGJW.cjs} +5 -5
  43. package/dist/{chunk-XKQKHXRU.cjs.map → chunk-6AFAYGJW.cjs.map} +1 -1
  44. package/dist/{chunk-PVT4EZUR.cjs → chunk-6QFHYV2J.cjs} +4 -4
  45. package/dist/{chunk-PVT4EZUR.cjs.map → chunk-6QFHYV2J.cjs.map} +1 -1
  46. package/dist/{chunk-DFQWX2XY.cjs → chunk-7GVKG3G4.cjs} +13 -13
  47. package/dist/{chunk-DFQWX2XY.cjs.map → chunk-7GVKG3G4.cjs.map} +1 -1
  48. package/dist/{chunk-GY4T4JSC.cjs → chunk-C4UNKFG6.cjs} +4 -4
  49. package/dist/{chunk-GY4T4JSC.cjs.map → chunk-C4UNKFG6.cjs.map} +1 -1
  50. package/dist/{chunk-CUYELFKB.cjs → chunk-DRYJIRBS.cjs} +4 -4
  51. package/dist/{chunk-CUYELFKB.cjs.map → chunk-DRYJIRBS.cjs.map} +1 -1
  52. package/dist/{chunk-R37KPMUZ.cjs → chunk-E56TJFIR.cjs} +8 -8
  53. package/dist/{chunk-R37KPMUZ.cjs.map → chunk-E56TJFIR.cjs.map} +1 -1
  54. package/dist/{chunk-YNFETLNZ.cjs → chunk-ER2MRSLT.cjs} +3 -3
  55. package/dist/{chunk-YNFETLNZ.cjs.map → chunk-ER2MRSLT.cjs.map} +1 -1
  56. package/dist/{chunk-CM2LUZ7K.cjs → chunk-GLYPVBBI.cjs} +29 -29
  57. package/dist/{chunk-CM2LUZ7K.cjs.map → chunk-GLYPVBBI.cjs.map} +1 -1
  58. package/dist/{chunk-SOJYSRO4.cjs → chunk-H4N6BZNU.cjs} +9 -9
  59. package/dist/{chunk-SOJYSRO4.cjs.map → chunk-H4N6BZNU.cjs.map} +1 -1
  60. package/dist/{chunk-H3CYXI46.cjs → chunk-HH5MKRBL.cjs} +7 -7
  61. package/dist/{chunk-H3CYXI46.cjs.map → chunk-HH5MKRBL.cjs.map} +1 -1
  62. package/dist/{chunk-E62542RM.cjs → chunk-I6JXZ4FU.cjs} +18 -18
  63. package/dist/{chunk-E62542RM.cjs.map → chunk-I6JXZ4FU.cjs.map} +1 -1
  64. package/dist/{chunk-GEVBY536.cjs → chunk-IOTSI4IZ.cjs} +37 -37
  65. package/dist/{chunk-GEVBY536.cjs.map → chunk-IOTSI4IZ.cjs.map} +1 -1
  66. package/dist/{chunk-4GMPS6VX.cjs → chunk-IRDL2EC6.cjs} +49 -49
  67. package/dist/{chunk-4GMPS6VX.cjs.map → chunk-IRDL2EC6.cjs.map} +1 -1
  68. package/dist/{chunk-SNYCK354.cjs → chunk-JEHGTPS2.cjs} +4 -4
  69. package/dist/{chunk-SNYCK354.cjs.map → chunk-JEHGTPS2.cjs.map} +1 -1
  70. package/dist/{chunk-JGU6YLIA.cjs → chunk-KQJUY2OE.cjs} +11 -11
  71. package/dist/{chunk-JGU6YLIA.cjs.map → chunk-KQJUY2OE.cjs.map} +1 -1
  72. package/dist/{chunk-KJ5M72M2.cjs → chunk-KSBXPXWT.cjs} +9 -8
  73. package/dist/chunk-KSBXPXWT.cjs.map +1 -0
  74. package/dist/{chunk-X6TSOKEP.cjs → chunk-LYJFE37D.cjs} +3 -3
  75. package/dist/{chunk-X6TSOKEP.cjs.map → chunk-LYJFE37D.cjs.map} +1 -1
  76. package/dist/{chunk-WHU7ABQE.cjs → chunk-M2KZ2GPP.cjs} +3 -3
  77. package/dist/{chunk-WHU7ABQE.cjs.map → chunk-M2KZ2GPP.cjs.map} +1 -1
  78. package/dist/{chunk-NBW67JUB.cjs → chunk-OHWYQI3B.cjs} +12 -12
  79. package/dist/{chunk-NBW67JUB.cjs.map → chunk-OHWYQI3B.cjs.map} +1 -1
  80. package/dist/{chunk-SLVWSTFY.cjs → chunk-OO5GWDXK.cjs} +28 -28
  81. package/dist/{chunk-SLVWSTFY.cjs.map → chunk-OO5GWDXK.cjs.map} +1 -1
  82. package/dist/{chunk-JEUHT7XH.cjs → chunk-PMZHUK3O.cjs} +6 -6
  83. package/dist/{chunk-JEUHT7XH.cjs.map → chunk-PMZHUK3O.cjs.map} +1 -1
  84. package/dist/{chunk-5UNZO4FA.cjs → chunk-POTF3QQB.cjs} +51 -51
  85. package/dist/{chunk-5UNZO4FA.cjs.map → chunk-POTF3QQB.cjs.map} +1 -1
  86. package/dist/{chunk-WXRAU2FF.cjs → chunk-QSY2VW7V.cjs} +6 -6
  87. package/dist/{chunk-WXRAU2FF.cjs.map → chunk-QSY2VW7V.cjs.map} +1 -1
  88. package/dist/{chunk-MXM4BTXY.cjs → chunk-RQN45P3L.cjs} +4 -4
  89. package/dist/{chunk-MXM4BTXY.cjs.map → chunk-RQN45P3L.cjs.map} +1 -1
  90. package/dist/{chunk-GOLLGCGK.cjs → chunk-S6SG5J4I.cjs} +71 -70
  91. package/dist/chunk-S6SG5J4I.cjs.map +1 -0
  92. package/dist/{chunk-W7TSEN3J.cjs → chunk-TLIZD6DV.cjs} +6 -6
  93. package/dist/{chunk-W7TSEN3J.cjs.map → chunk-TLIZD6DV.cjs.map} +1 -1
  94. package/dist/{chunk-ZLOPSDVW.cjs → chunk-UYYN3T73.cjs} +4 -4
  95. package/dist/{chunk-ZLOPSDVW.cjs.map → chunk-UYYN3T73.cjs.map} +1 -1
  96. package/dist/{chunk-NS7PWOL7.cjs → chunk-VD3HI5RF.cjs} +3 -3
  97. package/dist/{chunk-NS7PWOL7.cjs.map → chunk-VD3HI5RF.cjs.map} +1 -1
  98. package/dist/{chunk-6N7QT2DH.cjs → chunk-VDHBLDQC.cjs} +3 -3
  99. package/dist/{chunk-6N7QT2DH.cjs.map → chunk-VDHBLDQC.cjs.map} +1 -1
  100. package/dist/{chunk-6ZJBUMNK.cjs → chunk-VDT7TEAH.cjs} +3 -3
  101. package/dist/{chunk-6ZJBUMNK.cjs.map → chunk-VDT7TEAH.cjs.map} +1 -1
  102. package/dist/{chunk-QOTDPA62.cjs → chunk-VLB6ETIQ.cjs} +10 -10
  103. package/dist/{chunk-QOTDPA62.cjs.map → chunk-VLB6ETIQ.cjs.map} +1 -1
  104. package/dist/{chunk-HO2AURAQ.cjs → chunk-WBPP7IEW.cjs} +6 -6
  105. package/dist/{chunk-HO2AURAQ.cjs.map → chunk-WBPP7IEW.cjs.map} +1 -1
  106. package/dist/{chunk-XYMM6ZPS.cjs → chunk-WK4MI52B.cjs} +64 -64
  107. package/dist/{chunk-XYMM6ZPS.cjs.map → chunk-WK4MI52B.cjs.map} +1 -1
  108. package/dist/{chunk-MWJPCTBV.cjs → chunk-XKXKEVHH.cjs} +6 -6
  109. package/dist/{chunk-MWJPCTBV.cjs.map → chunk-XKXKEVHH.cjs.map} +1 -1
  110. package/dist/{chunk-YK3GUFZX.cjs → chunk-XP7BO4JJ.cjs} +15 -15
  111. package/dist/{chunk-YK3GUFZX.cjs.map → chunk-XP7BO4JJ.cjs.map} +1 -1
  112. package/dist/{chunk-DJ7LSKBJ.cjs → chunk-XQPJWPWE.cjs} +3 -3
  113. package/dist/{chunk-DJ7LSKBJ.cjs.map → chunk-XQPJWPWE.cjs.map} +1 -1
  114. package/dist/{chunk-VJFU2KKF.cjs → chunk-ZS74MKNV.cjs} +4 -4
  115. package/dist/{chunk-VJFU2KKF.cjs.map → chunk-ZS74MKNV.cjs.map} +1 -1
  116. package/dist/collaboration/index.cjs +13 -13
  117. package/dist/connect/docx.cjs +22 -22
  118. package/dist/connect/index.cjs +1233 -1220
  119. package/dist/connect/index.cjs.map +1 -1
  120. package/dist/connect/viewer.cjs +40 -40
  121. package/dist/connection/config/useDeveloperConfig.d.ts +1 -0
  122. package/dist/connection/config/useModelPicker.d.ts +4 -0
  123. package/dist/connection/conversation/AgentSteps.js +1 -0
  124. package/dist/connection/conversation/AgentSteps.js.map +2 -2
  125. package/dist/connection/facts/useFactFilters.d.ts +3 -0
  126. package/dist/connection/settings-page/ConnectedPremiumModels.js +14 -1
  127. package/dist/connection/settings-page/ConnectedPremiumModels.js.map +2 -2
  128. package/dist/connection/tags/ConnectedTagTable.d.ts +1 -0
  129. package/dist/connection/workspace-list/useConnectedWorkspaceList.d.ts +1 -1
  130. package/dist/dashboards/index.cjs +1 -1
  131. package/dist/embed/index.cjs +48 -48
  132. package/dist/facts/index.cjs +40 -40
  133. package/dist/files/index.cjs +222 -222
  134. package/dist/home/index.cjs +10 -10
  135. package/dist/index.cjs +1667 -1667
  136. package/dist/pages/index.cjs +38 -38
  137. package/dist/record/band.d.ts +95 -0
  138. package/dist/record/index.cjs +414 -13
  139. package/dist/record/index.cjs.map +1 -1
  140. package/dist/record/index.d.ts +35 -2
  141. package/dist/record/index.js +402 -15
  142. package/dist/record/index.js.map +1 -1
  143. package/dist/record/narration.d.ts +71 -0
  144. package/dist/settings/index.cjs +140 -140
  145. package/dist/shell/index.cjs +82 -82
  146. package/dist/site/index.cjs +9 -9
  147. package/dist/studio/index.cjs +31 -31
  148. package/dist/styles.css +1 -1
  149. package/dist/tags/TagColumnsEditor.js +2 -1
  150. package/dist/tags/TagColumnsEditor.js.map +2 -2
  151. package/dist/workflow-canvas/index.cjs +64 -64
  152. package/dist/workspaces/index.cjs +5 -5
  153. package/node_modules/@arbidocs/coedit/package.json +1 -1
  154. package/package.json +11 -6
  155. package/record/SKILL.md +178 -26
  156. package/record/mix-take.py +320 -0
  157. package/record/recap-slide.mjs +118 -0
  158. package/record/voice-take.py +129 -0
  159. package/dist/ai-2B4BMS6O.cjs.map +0 -1
  160. package/dist/chunk-GOLLGCGK.cjs.map +0 -1
  161. package/dist/chunk-KJ5M72M2.cjs.map +0 -1
@@ -9,6 +9,352 @@ var path__default = /*#__PURE__*/_interopDefault(path);
9
9
 
10
10
  // src/record/index.ts
11
11
 
12
+ // src/record/band.ts
13
+ var BAND_HEIGHT = 64;
14
+ var PLAYER_STRIP = 84;
15
+ var CHUNK_MS = 100;
16
+ var BAND_LABEL_WIDTH = 360;
17
+ var BAND_BOX = {
18
+ x: BAND_LABEL_WIDTH,
19
+ y: 0,
20
+ width: 1600 - BAND_LABEL_WIDTH,
21
+ height: BAND_HEIGHT
22
+ };
23
+ var BAND_FRAME = "__BAND_FRAME__";
24
+ var DEFAULT_FONT = "'Space Grotesk', 'Trebuchet MS', system-ui, sans-serif";
25
+ var DEFAULT_FONT_URL = "https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&display=swap";
26
+ var DEFAULT_GROUND = "#07090c";
27
+ var DEFAULT_TEXT = "#f6f0e2";
28
+ function captionChunks(text) {
29
+ const chunks = [];
30
+ let run = [];
31
+ for (const word of text.split(/\s+/).filter(Boolean)) {
32
+ run.push(word);
33
+ if (run.length === 3 || /[,.;:?!…]$/.test(word)) {
34
+ chunks.push(run.join(" "));
35
+ run = [];
36
+ }
37
+ }
38
+ if (run.length) chunks.push(run.join(" "));
39
+ return chunks;
40
+ }
41
+ function readingMs(text) {
42
+ return Math.min(4200, 900 + text.length * 45);
43
+ }
44
+ async function installBand(page, skin, options = {}) {
45
+ const frame = `calc(100dvh - ${BAND_HEIGHT + PLAYER_STRIP}px)`;
46
+ await page.addInitScript(
47
+ ({ H, B, L, ink, accent, sans, ground, text, root, extra, fontUrl }) => {
48
+ const boot = () => {
49
+ if (document.getElementById("__band")) return;
50
+ const w = window;
51
+ const style = document.createElement("style");
52
+ style.textContent = `
53
+ html, body { background: ${ink} !important; }
54
+ /* The app sits between the band and the player's strip. Its transform keeps the app's own
55
+ * fixed parts (the toasts) inside it; the dialogs and menus, portalled to the body, open
56
+ * at the viewport's centre, which is the app's. */
57
+ ${root} {
58
+ position: fixed !important; top: ${H}px; bottom: ${B}px; left: 0; right: 0; height: auto !important;
59
+ overflow: hidden; transform: translateZ(0); background: var(--color-background, #fff);
60
+ }
61
+ .h-dvh, .h-screen, .h-svh, .h-lvh { height: calc(100dvh - ${H + B}px) !important; }
62
+ .min-h-dvh, .min-h-screen, .min-h-svh, .min-h-lvh { min-height: calc(100dvh - ${H + B}px) !important; }
63
+ .max-h-dvh, .max-h-screen { max-height: calc(100dvh - ${H + B}px) !important; }
64
+ ${extra}
65
+ /* The stage's floating caption stays hidden: captions are painted in the band. */
66
+ #__cine_cap { display: none !important; }
67
+ #__band_cap span { opacity: 0; transition: opacity .18s ease-out; }
68
+ #__band_cap span.on { opacity: 1; }
69
+ /* A click: at full strength for a moment, then the ring spreads out and fades. */
70
+ @keyframes __band_ring {
71
+ 0% { width: 18px; height: 18px; margin: -9px 0 0 -9px; opacity: 1; }
72
+ 45% { opacity: 1; }
73
+ 100% { width: 72px; height: 72px; margin: -36px 0 0 -36px; opacity: 0; border-width: 2px; }
74
+ }
75
+ @keyframes __band_dot { 0% { transform: scale(.4); opacity: 1; } 45% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.1); opacity: 0; } }
76
+ `;
77
+ document.head.appendChild(style);
78
+ if (fontUrl) {
79
+ const font = document.createElement("link");
80
+ font.rel = "stylesheet";
81
+ font.href = fontUrl;
82
+ document.head.appendChild(font);
83
+ }
84
+ const bar = (edge, height) => {
85
+ const el = document.createElement("div");
86
+ el.style.cssText = `position:fixed;left:0;right:0;${edge}:0;height:${height}px;z-index:2147483645;background:${ground};display:flex;box-shadow:inset 0 ${edge === "top" ? -3 : 3}px 0 ${accent};align-items:center;pointer-events:none;font-family:${sans};`;
87
+ document.body.appendChild(el);
88
+ return el;
89
+ };
90
+ const band = bar("top", H);
91
+ band.id = "__band";
92
+ bar("bottom", B).id = "__band_strip";
93
+ const label = document.createElement("div");
94
+ label.style.cssText = `width:${L}px;flex:none;padding:0 24px;display:flex;flex-direction:column;justify-content:center;gap:4px;`;
95
+ const kicker = document.createElement("div");
96
+ kicker.id = "__band_kicker";
97
+ kicker.style.cssText = `font:600 12px/1 ${sans};letter-spacing:.12em;text-transform:uppercase;color:${accent};`;
98
+ const name = document.createElement("div");
99
+ name.id = "__band_feature";
100
+ name.style.cssText = `font:700 20px/1.2 ${sans};color:${text};white-space:nowrap;overflow:hidden;text-overflow:ellipsis;`;
101
+ label.append(kicker, name);
102
+ const cap = document.createElement("div");
103
+ cap.id = "__band_cap";
104
+ cap.style.cssText = `flex:1;min-width:0;height:100%;display:flex;align-items:center;padding:0 28px 0 24px;border-left:2px solid ${accent}66;font:500 19px/1.3 ${sans};color:${text};letter-spacing:.01em;`;
105
+ const words = document.createElement("div");
106
+ words.style.cssText = "display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;";
107
+ cap.appendChild(words);
108
+ band.append(label, cap);
109
+ const show = (k, n) => {
110
+ kicker.textContent = k;
111
+ name.textContent = n;
112
+ };
113
+ w.__band_feature = (k, n) => {
114
+ sessionStorage.setItem("__band_feature", JSON.stringify([k, n]));
115
+ show(k, n);
116
+ };
117
+ let timers = [];
118
+ let clearer = 0;
119
+ const paint = (line, chunks, chunkMs) => {
120
+ timers.forEach(clearTimeout);
121
+ timers = [];
122
+ words.textContent = "";
123
+ words.dataset.text = line;
124
+ chunks.forEach((chunk, i) => {
125
+ const span = document.createElement("span");
126
+ span.textContent = chunk;
127
+ words.append(span, i < chunks.length - 1 ? " " : "");
128
+ if (chunkMs <= 0) span.classList.add("on");
129
+ else timers.push(window.setTimeout(() => span.classList.add("on"), i * chunkMs));
130
+ });
131
+ return chunkMs > 0 ? chunks.length * chunkMs : 0;
132
+ };
133
+ w.__band_say = (line, chunks, chunkMs = 100, clearMs = 0) => {
134
+ window.clearTimeout(clearer);
135
+ sessionStorage.setItem(
136
+ "__band_cap",
137
+ JSON.stringify([line, clearMs > 0 ? Date.now() + clearMs : 0])
138
+ );
139
+ if (clearMs > 0) clearer = window.setTimeout(() => w.__band_say?.("", []), clearMs);
140
+ if (line && words.dataset.text === line) return 0;
141
+ return paint(line, chunks, chunkMs);
142
+ };
143
+ window.__cine_cap = (t) => void w.__band_say?.(t, t ? [t] : [], 0);
144
+ const pulse = (x, y) => {
145
+ const dot = document.createElement("div");
146
+ dot.style.cssText = `position:fixed;left:${x}px;top:${y}px;z-index:2147483646;width:34px;height:34px;margin:-17px 0 0 -17px;border-radius:50%;pointer-events:none;background:${accent}99;box-shadow:0 0 0 2px rgba(255,255,255,.8);animation:__band_dot .6s ease-out forwards;`;
147
+ const ring = document.createElement("div");
148
+ ring.style.cssText = `position:fixed;left:${x}px;top:${y}px;z-index:2147483646;width:18px;height:18px;margin:-9px 0 0 -9px;border-radius:50%;pointer-events:none;border:4px solid ${accent};box-shadow:0 0 0 2px #fff,0 0 0 3.5px ${ink}55,0 0 18px ${accent}aa;animation:__band_ring .75s cubic-bezier(.3,.6,.4,1) forwards;`;
149
+ document.body.append(dot, ring);
150
+ window.setTimeout(() => {
151
+ dot.remove();
152
+ ring.remove();
153
+ }, 800);
154
+ };
155
+ w.__band_pulse = pulse;
156
+ const press = (down) => {
157
+ const cursor = document.getElementById("__cine_cursor");
158
+ if (!cursor) return;
159
+ const moved = cursor.style.transform.replace(/\s*scale\([^)]*\)/, "");
160
+ cursor.style.transform = down ? `${moved} scale(.72)` : moved;
161
+ };
162
+ window.addEventListener(
163
+ "pointerdown",
164
+ (e) => {
165
+ pulse(e.clientX, e.clientY);
166
+ press(true);
167
+ },
168
+ true
169
+ );
170
+ window.addEventListener("pointerup", () => press(false), true);
171
+ try {
172
+ const saved = JSON.parse(sessionStorage.getItem("__band_feature") || "null");
173
+ if (saved) show(saved[0], saved[1]);
174
+ const [line, until] = JSON.parse(sessionStorage.getItem("__band_cap") || '["",0]');
175
+ if (line && (!until || until > Date.now())) {
176
+ paint(line, [line], 0);
177
+ if (until) clearer = window.setTimeout(() => w.__band_say?.("", []), until - Date.now());
178
+ }
179
+ } catch {
180
+ }
181
+ };
182
+ if (document.body) boot();
183
+ else document.addEventListener("DOMContentLoaded", boot);
184
+ },
185
+ {
186
+ H: BAND_HEIGHT,
187
+ B: PLAYER_STRIP,
188
+ L: BAND_LABEL_WIDTH,
189
+ ink: skin.ink,
190
+ accent: skin.accent,
191
+ sans: options.font ?? DEFAULT_FONT,
192
+ ground: options.ground ?? DEFAULT_GROUND,
193
+ text: options.text ?? DEFAULT_TEXT,
194
+ root: options.root ?? "#root",
195
+ extra: (options.css ?? "").split(BAND_FRAME).join(frame),
196
+ fontUrl: options.fontUrl === void 0 ? DEFAULT_FONT_URL : options.fontUrl
197
+ }
198
+ );
199
+ }
200
+ async function feature(page, kicker, name) {
201
+ await page.evaluate(
202
+ ([k, n]) => window.__band_feature?.(k, n),
203
+ [kicker, name]
204
+ );
205
+ }
206
+ async function bandSay(page, text, holdMs, clearMs = 0) {
207
+ const reveal = await page.evaluate(
208
+ ([t, chunks, ms, clear]) => window.__band_say?.(t, chunks, ms, clear) ?? 0,
209
+ [text, captionChunks(text), CHUNK_MS, clearMs]
210
+ ) ?? 0;
211
+ if (holdMs === 0 || !text) return;
212
+ await page.waitForTimeout(Math.max(holdMs ?? readingMs(text), reveal + 1500));
213
+ }
214
+ async function pulseAt(page, box) {
215
+ if (!box) return;
216
+ await page.evaluate(
217
+ ([x, y]) => window.__band_pulse?.(x, y),
218
+ [box.x + box.width / 2, box.y + box.height / 2]
219
+ );
220
+ }
221
+ async function interlude(page, skin, card, holdMs) {
222
+ const FADE = 350;
223
+ await page.evaluate(
224
+ ({ card: card2, ink, accent, sans, FADE: FADE2, H, B }) => {
225
+ document.getElementById("__interlude")?.remove();
226
+ const veil = document.createElement("div");
227
+ veil.id = "__interlude";
228
+ veil.style.cssText = `position:fixed;left:0;right:0;top:${H}px;bottom:${B}px;z-index:2147483644;display:flex;align-items:center;justify-content:center;pointer-events:none;background:rgba(8,14,24,.38);opacity:0;transition:opacity ${FADE2}ms ease;font-family:${sans};`;
229
+ const box = document.createElement("div");
230
+ box.style.cssText = `width:760px;max-width:80%;padding:34px 44px 38px;border-radius:18px;color:#fff;background:linear-gradient(135deg, ${ink} 0%, ${ink} 55%, ${accent}66 140%);box-shadow:0 24px 70px rgba(0,0,0,.45), inset 0 0 0 1px ${accent}55;transform:translateY(10px) scale(.98);transition:transform ${FADE2}ms ease;`;
231
+ const k = document.createElement("div");
232
+ k.textContent = card2.kicker;
233
+ k.style.cssText = `font-size:14px;letter-spacing:.14em;text-transform:uppercase;color:${accent};font-weight:600;margin-bottom:12px;`;
234
+ const t = document.createElement("div");
235
+ t.textContent = card2.title;
236
+ t.style.cssText = "font-size:38px;line-height:1.15;font-weight:700;margin-bottom:12px;";
237
+ const s = document.createElement("div");
238
+ s.textContent = card2.subtitle ?? "";
239
+ s.style.cssText = "font-size:18px;line-height:1.45;color:#c8d3dd;";
240
+ box.append(k, t, s);
241
+ veil.append(box);
242
+ document.body.append(veil);
243
+ requestAnimationFrame(
244
+ () => requestAnimationFrame(() => {
245
+ veil.style.opacity = "1";
246
+ box.style.transform = "none";
247
+ })
248
+ );
249
+ },
250
+ {
251
+ card,
252
+ ink: skin.ink,
253
+ accent: skin.accent,
254
+ sans: skin.sansFont,
255
+ FADE,
256
+ H: BAND_HEIGHT,
257
+ B: PLAYER_STRIP
258
+ }
259
+ );
260
+ await page.waitForTimeout(FADE + holdMs);
261
+ await page.evaluate((fade) => {
262
+ const veil = document.getElementById("__interlude");
263
+ if (!veil) return;
264
+ veil.style.opacity = "0";
265
+ window.setTimeout(() => veil.remove(), fade + 50);
266
+ }, FADE);
267
+ await page.waitForTimeout(FADE + 50);
268
+ }
269
+ var NARRATION_GAP_MS = 520;
270
+ var NARRATION_LINGER_MS = 700;
271
+ function readingSeconds(text) {
272
+ return 1 + text.split(/\s+/).filter(Boolean).length / 2.9;
273
+ }
274
+ var Narrator = class {
275
+ constructor(take, story, options = {}) {
276
+ this.take = take;
277
+ const scriptFile = path__default.default.resolve(options.scriptDir ?? "e2e/record", `${story}.narration.json`);
278
+ const script = JSON.parse(fs.readFileSync(scriptFile, "utf8"));
279
+ const clips = path__default.default.resolve(options.clipsDir ?? "e2e/videos/narration", story);
280
+ const manifest = path__default.default.join(clips, "manifest.json");
281
+ const spoken = fs.existsSync(manifest) ? JSON.parse(fs.readFileSync(manifest, "utf8")).lines : {};
282
+ this.voiced = Object.keys(spoken).length > 0;
283
+ for (const { id, text } of script.lines) {
284
+ const clip = spoken[id];
285
+ this.lines.set(
286
+ id,
287
+ clip && clip.text === text ? { text, duration: clip.duration, file: path__default.default.join(clips, clip.file) } : { text, duration: readingSeconds(text) }
288
+ );
289
+ }
290
+ this.stale = [...this.lines].filter(([, l]) => !l.file).map(([id]) => id);
291
+ if (this.voiced && this.stale.length)
292
+ console.warn(`[narration] not spoken yet (run arbidocs-voice-take): ${this.stale.join(", ")}`);
293
+ this.logFile = take.focusFile.replace(/\.focus\.json$/, ".narration.json");
294
+ this.save();
295
+ }
296
+ take;
297
+ lines = /* @__PURE__ */ new Map();
298
+ said = [];
299
+ logFile;
300
+ until = 0;
301
+ /** Whether any line has a clip (else the take is a silent rehearsal, paced by reading time). */
302
+ voiced;
303
+ /** The lines whose clip is missing or was spoken from other words. */
304
+ stale;
305
+ /** The line `id` of the script. */
306
+ line(id) {
307
+ const line = this.lines.get(id);
308
+ if (!line) throw new Error(`no line "${id}" in the narration`);
309
+ return line;
310
+ }
311
+ /**
312
+ * Say the line `id`, captioned in the band: once the line before it has ended, and held until
313
+ * it has been said, and `afterMs` more. `over`: return at once, the line said over what the
314
+ * story does next (start a line as the screen begins to change, so the speech covers the change
315
+ * instead of waiting for it). `caption: false` for a line said over a card, which covers the
316
+ * band: the frame stays still as the card fades in.
317
+ */
318
+ async say(id, { over = false, afterMs = 0, caption = true } = {}) {
319
+ const line = this.line(id);
320
+ await this.hush();
321
+ let start = this.take.now();
322
+ if (caption) {
323
+ await bandSay(this.take.page, line.text, 0, line.duration * 1e3 + NARRATION_LINGER_MS);
324
+ start = this.take.now();
325
+ }
326
+ this.until = start + line.duration;
327
+ this.take.record({
328
+ kind: "read",
329
+ mode: "none",
330
+ label: `narration: ${id}`,
331
+ start,
332
+ end: this.until,
333
+ box: BAND_BOX
334
+ });
335
+ this.said.push({
336
+ id,
337
+ start: Math.round(start * 1e3) / 1e3,
338
+ duration: line.duration,
339
+ file: line.file,
340
+ caption
341
+ });
342
+ this.save();
343
+ if (!over) await this.hush(afterMs);
344
+ }
345
+ /**
346
+ * Wait for the line being said to end, a narrator's breath after it (and `extraMs`). Call it
347
+ * before any logged wait and before a card: speech cannot be cut.
348
+ */
349
+ async hush(extraMs = 0) {
350
+ const left = (this.until - this.take.now()) * 1e3 + NARRATION_GAP_MS + extraMs;
351
+ if (left > 0) await this.take.page.waitForTimeout(left);
352
+ }
353
+ save() {
354
+ fs.writeFileSync(this.logFile, JSON.stringify({ lines: this.said }, null, 1));
355
+ }
356
+ };
357
+
12
358
  // src/record/runs.ts
13
359
  async function spaGo(page, url) {
14
360
  await page.evaluate((to) => {
@@ -17,12 +363,12 @@ async function spaGo(page, url) {
17
363
  }, url);
18
364
  }
19
365
  async function openWordById(take, documentId, {
20
- path: path2 = "/app/documents",
366
+ path: path3 = "/app/documents",
21
367
  lowerThird,
22
368
  timeoutMs = 12e4
23
369
  } = {}) {
24
370
  const { page } = take;
25
- await spaGo(page, `${path2}?doc=${encodeURIComponent(documentId)}`);
371
+ await spaGo(page, `${path3}?doc=${encodeURIComponent(documentId)}`);
26
372
  const editor = page.getByTestId("native-docx-editor");
27
373
  await take.wait(
28
374
  "word: editor opens",
@@ -183,12 +529,12 @@ function createRunKit(cine, config = {}) {
183
529
  );
184
530
  }
185
531
  async function resumeRun(page, { env = "E2E_RESUME_RUN", readyTestId } = {}) {
186
- const path2 = process.env[env];
187
- if (!path2) return null;
188
- await spaGo(page, path2);
532
+ const path3 = process.env[env];
533
+ if (!path3) return null;
534
+ await spaGo(page, path3);
189
535
  const ready = readyTestId ? page.getByTestId(readyTestId) : page.locator(`[data-testid^="${prefix}-step-"], [data-testid^="workflow-thread-step-"]`);
190
536
  await ready.first().waitFor({ state: "visible", timeout: 6e4 });
191
- return path2;
537
+ return path3;
192
538
  }
193
539
  return { stepChip, currentStep, whileWorking, driveRun, approveStep, pickTile, resumeRun };
194
540
  }
@@ -370,6 +716,8 @@ function createCinematic(config) {
370
716
  logout: config.testIds?.logout ?? "app-logout"
371
717
  };
372
718
  const toastSelector = config.toastSelector ?? "[data-sonner-toast]";
719
+ const style = config.style ?? "band";
720
+ const band = style === "band";
373
721
  const resolve = (page, t) => typeof t === "string" ? page.getByTestId(t) : t;
374
722
  async function boxOf(page, loc) {
375
723
  const box = await loc.boundingBox().catch(() => null);
@@ -393,7 +741,7 @@ function createCinematic(config) {
393
741
  return { loc, box };
394
742
  }
395
743
  async function take(page, options) {
396
- return new Take(page, options, b);
744
+ return new Take(page, band ? { zoom: false, pip: false, ...options } : options, b);
397
745
  }
398
746
  async function installStage(page) {
399
747
  await page.addInitScript(
@@ -426,9 +774,9 @@ function createCinematic(config) {
426
774
  cap.id = "__cine_cap";
427
775
  cap.style.cssText = `position:fixed;left:50%;bottom:34px;transform:translateX(-50%) translateY(8px);z-index:2147483646;max-width:72%;padding:13px 24px;border-radius:13px;font:500 17px/1.45 ${s.sansFont};color:#fff;letter-spacing:.01em;background:${s.ink}e0;backdrop-filter:blur(7px);box-shadow:0 10px 34px rgba(0,0,0,.4);text-align:center;opacity:0;transition:opacity .35s,transform .35s;`;
428
776
  document.body.appendChild(cap);
429
- const style = document.createElement("style");
430
- style.textContent = "@keyframes __cine_ripple{to{width:46px;height:46px;margin:-23px 0 0 -23px;opacity:0}}";
431
- document.head.appendChild(style);
777
+ const style2 = document.createElement("style");
778
+ style2.textContent = "@keyframes __cine_ripple{to{width:46px;height:46px;margin:-23px 0 0 -23px;opacity:0}}";
779
+ document.head.appendChild(style2);
432
780
  window.__cine_cap = (t) => {
433
781
  cap.textContent = t;
434
782
  cap.style.opacity = t ? "1" : "0";
@@ -459,6 +807,27 @@ function createCinematic(config) {
459
807
  },
460
808
  { s: skin, t0: Take.on(page)?.t0 ?? null, TC: TIMECODE_CELL }
461
809
  );
810
+ if (band) await installBand(page, skin, config.band);
811
+ }
812
+ async function feature2(page, kicker, name) {
813
+ if (band) await feature(page, kicker, name);
814
+ }
815
+ async function pulseAt2(page, box) {
816
+ if (band) await pulseAt(page, box);
817
+ }
818
+ async function interlude2(page, card, holdMs = 2200) {
819
+ if (!band) throw new Error("interlude is the band style's card: use chapter() in 'overlay'");
820
+ await interlude(page, skin, card, holdMs);
821
+ }
822
+ async function still(page) {
823
+ const toasts = page.locator(toastSelector);
824
+ const until = Date.now() + 8e3;
825
+ while (await toasts.count() && Date.now() < until) await page.waitForTimeout(200);
826
+ await page.waitForTimeout(500);
827
+ }
828
+ function narrator(take2, story, options) {
829
+ if (!band) throw new Error("a narrated take is captioned in the band: not in 'overlay'");
830
+ return new Narrator(take2, story, options);
462
831
  }
463
832
  async function cover(page, { kicker, title, subtitle }, holdMs = 2600) {
464
833
  const running = Take.on(page);
@@ -501,18 +870,30 @@ function createCinematic(config) {
501
870
  }
502
871
  async function caption(page, text, holdMs) {
503
872
  const running = Take.on(page);
504
- if (running) running.captionStart(text);
873
+ const hold = holdMs ?? readingMs(text);
874
+ if (band) {
875
+ const start = running?.now() ?? 0;
876
+ await bandSay(page, text, 0);
877
+ running?.record({
878
+ kind: "read",
879
+ mode: "none",
880
+ label: "caption",
881
+ start,
882
+ end: start + hold / 1e3,
883
+ box: BAND_BOX
884
+ });
885
+ } else if (running) running.captionStart(text);
505
886
  else
506
887
  await page.evaluate(
507
888
  (t) => window.__cine_cap?.(t),
508
889
  text
509
890
  );
510
- const hold = holdMs ?? Math.min(4200, 900 + text.length * 45);
511
891
  await page.waitForTimeout(hold);
512
892
  }
513
893
  async function clearCaption(page) {
514
894
  const running = Take.on(page);
515
- if (running) running.captionEnd();
895
+ if (band) await bandSay(page, "", 0);
896
+ else if (running) running.captionEnd();
516
897
  else
517
898
  await page.evaluate(
518
899
  () => window.__cine_cap?.("")
@@ -616,8 +997,14 @@ function createCinematic(config) {
616
997
  await page.getByTestId(ids.userMenu).waitFor({ state: "visible", timeout: 6e4 });
617
998
  }
618
999
  return {
1000
+ style,
619
1001
  take,
620
1002
  installStage,
1003
+ feature: feature2,
1004
+ pulseAt: pulseAt2,
1005
+ interlude: interlude2,
1006
+ still,
1007
+ narrator,
621
1008
  cover,
622
1009
  chapter,
623
1010
  uncover,
@@ -636,13 +1023,27 @@ function createCinematic(config) {
636
1023
  };
637
1024
  }
638
1025
 
1026
+ exports.BAND_BOX = BAND_BOX;
1027
+ exports.BAND_FRAME = BAND_FRAME;
1028
+ exports.BAND_HEIGHT = BAND_HEIGHT;
1029
+ exports.BAND_LABEL_WIDTH = BAND_LABEL_WIDTH;
1030
+ exports.CHUNK_MS = CHUNK_MS;
1031
+ exports.NARRATION_GAP_MS = NARRATION_GAP_MS;
1032
+ exports.NARRATION_LINGER_MS = NARRATION_LINGER_MS;
1033
+ exports.Narrator = Narrator;
1034
+ exports.PLAYER_STRIP = PLAYER_STRIP;
639
1035
  exports.TIMECODE_CELL = TIMECODE_CELL;
640
1036
  exports.Take = Take;
1037
+ exports.bandSay = bandSay;
1038
+ exports.captionChunks = captionChunks;
641
1039
  exports.cinematicSkin = cinematicSkin;
642
1040
  exports.createCinematic = createCinematic;
643
1041
  exports.createRunKit = createRunKit;
644
1042
  exports.fillSecret = fillSecret;
1043
+ exports.installBand = installBand;
645
1044
  exports.openWordById = openWordById;
1045
+ exports.readingMs = readingMs;
1046
+ exports.readingSeconds = readingSeconds;
646
1047
  exports.spaGo = spaGo;
647
1048
  //# sourceMappingURL=index.cjs.map
648
1049
  //# sourceMappingURL=index.cjs.map