@dxos/plugin-transcription 0.8.1-main.ba2dec9 → 0.8.1-staging.391c573
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/lib/browser/{TranscriptContainer-N4KQHMY4.mjs → TranscriptContainer-HAZP6CA4.mjs} +2 -2
- package/dist/lib/browser/{chunk-BDVUIRBP.mjs → chunk-6ZBM4EDB.mjs} +2 -2
- package/dist/lib/browser/chunk-7WGWZT65.mjs +393 -0
- package/dist/lib/browser/chunk-7WGWZT65.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +7 -5
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-UPTZBHVB.mjs → react-surface-Q7TXDD4O.mjs} +3 -3
- package/dist/lib/node/{TranscriptContainer-4BWXOVML.cjs → TranscriptContainer-34ARMIII.cjs} +7 -7
- package/dist/lib/node/{TranscriptContainer-4BWXOVML.cjs.map → TranscriptContainer-34ARMIII.cjs.map} +2 -2
- package/dist/lib/node/{chunk-I35KHI2G.cjs → chunk-5SKPVCFI.cjs} +5 -5
- package/dist/lib/node/{chunk-ANSWGFMS.cjs → chunk-SHYOIEFT.cjs} +226 -73
- package/dist/lib/node/chunk-SHYOIEFT.cjs.map +7 -0
- package/dist/lib/node/index.cjs +9 -7
- package/dist/lib/node/index.cjs.map +2 -2
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-NCKXB7EQ.cjs → react-surface-GDE6AIDT.cjs} +7 -7
- package/dist/lib/node-esm/{TranscriptContainer-6IKRASR6.mjs → TranscriptContainer-GJXPGREG.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-2CPKXRN6.mjs → chunk-5I6S5KWM.mjs} +2 -2
- package/dist/lib/node-esm/chunk-V2GWVMQL.mjs +394 -0
- package/dist/lib/node-esm/chunk-V2GWVMQL.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +7 -5
- package/dist/lib/node-esm/index.mjs.map +2 -2
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-2WJQ67LB.mjs → react-surface-54E3UGAN.mjs} +3 -3
- package/dist/types/src/components/Transcript/Transcript.d.ts +3 -0
- package/dist/types/src/components/Transcript/Transcript.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts.map +1 -1
- package/dist/types/src/components/TranscriptContainer.d.ts.map +1 -1
- package/package.json +38 -36
- package/src/components/Transcript/Transcript.stories.tsx +17 -11
- package/src/components/Transcript/Transcript.tsx +218 -49
- package/src/components/TranscriptContainer.tsx +13 -19
- package/src/components/transcription.stories.tsx +1 -1
- package/src/translations.ts +1 -1
- package/dist/lib/browser/chunk-YX447BJ4.mjs +0 -241
- package/dist/lib/browser/chunk-YX447BJ4.mjs.map +0 -7
- package/dist/lib/node/chunk-ANSWGFMS.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZMK2QLW2.mjs +0 -242
- package/dist/lib/node-esm/chunk-ZMK2QLW2.mjs.map +0 -7
- /package/dist/lib/browser/{TranscriptContainer-N4KQHMY4.mjs.map → TranscriptContainer-HAZP6CA4.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-BDVUIRBP.mjs.map → chunk-6ZBM4EDB.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-UPTZBHVB.mjs.map → react-surface-Q7TXDD4O.mjs.map} +0 -0
- /package/dist/lib/node/{chunk-I35KHI2G.cjs.map → chunk-5SKPVCFI.cjs.map} +0 -0
- /package/dist/lib/node/{react-surface-NCKXB7EQ.cjs.map → react-surface-GDE6AIDT.cjs.map} +0 -0
- /package/dist/lib/node-esm/{TranscriptContainer-6IKRASR6.mjs.map → TranscriptContainer-GJXPGREG.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-2CPKXRN6.mjs.map → chunk-5I6S5KWM.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-surface-2WJQ67LB.mjs.map → react-surface-54E3UGAN.mjs.map} +0 -0
|
@@ -26,13 +26,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_SHYOIEFT_exports = {};
|
|
30
|
+
__export(chunk_SHYOIEFT_exports, {
|
|
31
31
|
Transcript: () => Transcript,
|
|
32
32
|
TranscriptContainer_default: () => TranscriptContainer_default,
|
|
33
|
-
TranscriptionContainer: () => TranscriptionContainer
|
|
33
|
+
TranscriptionContainer: () => TranscriptionContainer,
|
|
34
|
+
formatElapsed: () => formatElapsed
|
|
34
35
|
});
|
|
35
|
-
module.exports = __toCommonJS(
|
|
36
|
+
module.exports = __toCommonJS(chunk_SHYOIEFT_exports);
|
|
36
37
|
var import_chunk_UIHEGU6Q = require("./chunk-UIHEGU6Q.cjs");
|
|
37
38
|
var import_effect = require("effect");
|
|
38
39
|
var import_react = __toESM(require("react"));
|
|
@@ -50,65 +51,217 @@ var import_types2 = require("@dxos/plugin-space/types");
|
|
|
50
51
|
var import_react_client = require("@dxos/react-client");
|
|
51
52
|
var import_react_edge_client = require("@dxos/react-edge-client");
|
|
52
53
|
var import_react_ui = require("@dxos/react-ui");
|
|
53
|
-
var import_react_ui_components = require("@dxos/react-ui-components");
|
|
54
54
|
var import_react_ui_stack = require("@dxos/react-ui-stack");
|
|
55
55
|
var import_schema = require("@dxos/schema");
|
|
56
|
-
var
|
|
56
|
+
var import_intervalToDuration = require("date-fns/intervalToDuration");
|
|
57
57
|
var import_react2 = __toESM(require("react"));
|
|
58
|
-
var
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
var import_react_resize_detector = require("react-resize-detector");
|
|
59
|
+
var import_log2 = require("@dxos/log");
|
|
60
|
+
var import_react_ui_attention = require("@dxos/react-ui-attention");
|
|
61
|
+
var import_react_ui_grid = require("@dxos/react-ui-grid");
|
|
62
|
+
var import_react_ui_theme = require("@dxos/react-ui-theme");
|
|
63
|
+
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/experimental/plugin-transcription/src/components/Transcript/Transcript.tsx";
|
|
64
|
+
var timeWidth = 70;
|
|
65
|
+
var lineHeight = 24;
|
|
66
|
+
var cellSpacing = 12;
|
|
67
|
+
var authorClasses = "text-[16px] leading-[24px] dx-tag";
|
|
68
|
+
var segmentTextClasses = "text-[16px] leading-[24px] whitespace-pre-wrap break-words hyphens-none";
|
|
69
|
+
var Transcript = ({ attendableId, ignoreAttention, blocks }) => {
|
|
70
|
+
const { hasAttention } = (0, import_react_ui_attention.useAttention)(attendableId);
|
|
71
|
+
const { ref, width } = (0, import_react_resize_detector.useResizeDetector)();
|
|
72
|
+
const measureRef = (0, import_react2.useRef)(null);
|
|
73
|
+
const textWidth = width ? width - timeWidth : 0;
|
|
74
|
+
const transcriptColumns = width ? {
|
|
75
|
+
grid: {
|
|
76
|
+
0: {
|
|
77
|
+
size: timeWidth
|
|
78
|
+
},
|
|
79
|
+
1: {
|
|
80
|
+
size: textWidth
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
} : void 0;
|
|
84
|
+
const transcriptRows = {
|
|
85
|
+
grid: {
|
|
86
|
+
size: lineHeight
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const [queueMap, setQueueMap] = (0, import_react2.useState)([]);
|
|
90
|
+
(0, import_react2.useEffect)(() => {
|
|
91
|
+
if (measureRef.current) {
|
|
92
|
+
void mapTranscriptQueue(measureRef.current, blocks, true).then((queueMap2) => {
|
|
93
|
+
setQueueMap(queueMap2);
|
|
94
|
+
if (measureRef.current) {
|
|
95
|
+
void mapTranscriptQueue(measureRef.current, blocks, false).then(setQueueMap);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}, [
|
|
100
|
+
blocks,
|
|
101
|
+
measureRef.current
|
|
102
|
+
]);
|
|
103
|
+
const rows = (0, import_react2.useMemo)(() => ({
|
|
104
|
+
grid: queueMap.reduce((acc, row, rowIndex) => {
|
|
105
|
+
acc[rowIndex] = {
|
|
106
|
+
size: row[2]
|
|
107
|
+
};
|
|
108
|
+
return acc;
|
|
109
|
+
}, {})
|
|
110
|
+
}), [
|
|
111
|
+
queueMap
|
|
112
|
+
]);
|
|
113
|
+
const [dxGrid, setDxGrid] = (0, import_react2.useState)(null);
|
|
114
|
+
(0, import_react2.useEffect)(() => {
|
|
115
|
+
if (dxGrid && Array.isArray(blocks)) {
|
|
116
|
+
const start = blocks[0]?.segments[0]?.started ?? 0;
|
|
117
|
+
dxGrid.getCells = (range, plane) => {
|
|
118
|
+
switch (plane) {
|
|
119
|
+
case "grid": {
|
|
120
|
+
const cells = {};
|
|
121
|
+
for (let row = range.start.row; row <= range.end.row && row < queueMap.length; row++) {
|
|
122
|
+
const [blockIndex, segmentIndex] = queueMap[row];
|
|
123
|
+
const { author, segments } = blocks[blockIndex] ?? {
|
|
124
|
+
author: "",
|
|
125
|
+
segments: []
|
|
126
|
+
};
|
|
127
|
+
const { started: end, text } = segments[segmentIndex] ?? {
|
|
128
|
+
started: 0,
|
|
129
|
+
text: ""
|
|
130
|
+
};
|
|
131
|
+
cells[(0, import_react_ui_grid.toPlaneCellIndex)({
|
|
132
|
+
col: 0,
|
|
133
|
+
row
|
|
134
|
+
})] = segmentIndex === 0 ? {
|
|
135
|
+
readonly: true,
|
|
136
|
+
accessoryHtml: `<span class="pbs-1 text-xs text-neutral-500">${formatElapsed(start, end)}</span>`
|
|
137
|
+
} : {};
|
|
138
|
+
cells[(0, import_react_ui_grid.toPlaneCellIndex)({
|
|
139
|
+
col: 1,
|
|
140
|
+
row
|
|
141
|
+
})] = segmentIndex < 0 ? {
|
|
142
|
+
value: author,
|
|
143
|
+
readonly: true,
|
|
144
|
+
// TODO(burdon): Color based on username.
|
|
145
|
+
className: authorClasses
|
|
146
|
+
} : {
|
|
147
|
+
readonly: true,
|
|
148
|
+
accessoryHtml: `<div class="${segmentTextClasses}">${text.trim()}</div>`
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
return cells;
|
|
152
|
+
}
|
|
153
|
+
default:
|
|
154
|
+
return {};
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
}, [
|
|
159
|
+
dxGrid,
|
|
160
|
+
queueMap,
|
|
161
|
+
blocks
|
|
162
|
+
]);
|
|
163
|
+
const handleWheel = (0, import_react2.useCallback)((event) => {
|
|
164
|
+
if (!ignoreAttention && !hasAttention) {
|
|
165
|
+
event.stopPropagation();
|
|
166
|
+
}
|
|
167
|
+
}, [
|
|
168
|
+
hasAttention,
|
|
169
|
+
ignoreAttention
|
|
170
|
+
]);
|
|
62
171
|
return /* @__PURE__ */ import_react2.default.createElement("div", {
|
|
63
|
-
role: "
|
|
64
|
-
|
|
65
|
-
}, blocks?.map((block) => /* @__PURE__ */ import_react2.default.createElement("div", {
|
|
66
|
-
role: "listitem",
|
|
67
|
-
key: block.id,
|
|
68
|
-
className: "flex flex-col py-1 border border-transparent hover:border-separator rounded"
|
|
69
|
-
}, /* @__PURE__ */ import_react2.default.createElement("div", {
|
|
70
|
-
className: "group flex items-center px-2"
|
|
71
|
-
}, /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.Icon, {
|
|
72
|
-
icon: "ph--user--regular"
|
|
73
|
-
}), /* @__PURE__ */ import_react2.default.createElement("div", {
|
|
74
|
-
className: "px-2 text-sm text-subdued"
|
|
75
|
-
}, block.author), /* @__PURE__ */ import_react2.default.createElement("div", {
|
|
172
|
+
role: "none",
|
|
173
|
+
ref,
|
|
76
174
|
className: "grow"
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
icon: "ph--x--regular",
|
|
80
|
-
label: t("delete button"),
|
|
81
|
-
iconOnly: true,
|
|
82
|
-
size: 4,
|
|
83
|
-
classNames: hoverButton
|
|
84
|
-
})), block.segments.map((segment, i) => /* @__PURE__ */ import_react2.default.createElement("div", {
|
|
85
|
-
key: i,
|
|
86
|
-
className: "group flex flex-col"
|
|
175
|
+
}, transcriptColumns && /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, /* @__PURE__ */ import_react2.default.createElement("div", {
|
|
176
|
+
className: "relative"
|
|
87
177
|
}, /* @__PURE__ */ import_react2.default.createElement("div", {
|
|
88
|
-
className: "
|
|
89
|
-
|
|
90
|
-
|
|
178
|
+
className: "absolute top-0 z-10 p-1 border invisible",
|
|
179
|
+
style: {
|
|
180
|
+
left: timeWidth,
|
|
181
|
+
width: transcriptColumns.grid["1"].size
|
|
182
|
+
}
|
|
91
183
|
}, /* @__PURE__ */ import_react2.default.createElement("div", {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
184
|
+
ref: measureRef,
|
|
185
|
+
className: (0, import_react_ui_theme.mx)(segmentTextClasses)
|
|
186
|
+
}))), /* @__PURE__ */ import_react2.default.createElement(import_react_ui_grid.Grid.Root, {
|
|
187
|
+
id: `${attendableId}--transcript`
|
|
188
|
+
}, /* @__PURE__ */ import_react2.default.createElement(import_react_ui_grid.Grid.Content, {
|
|
189
|
+
ref: setDxGrid,
|
|
190
|
+
className: "[--dx-grid-base:var(--dx-baseSurface)] [--dx-grid-lines:var(--dx-baseSurface)] [&_.dx-grid]:min-bs-0 [&_.dx-grid]:select-auto",
|
|
191
|
+
columns: transcriptColumns,
|
|
192
|
+
rowDefault: transcriptRows,
|
|
193
|
+
rows,
|
|
194
|
+
limitColumns: 2,
|
|
195
|
+
limitRows: queueMap.length,
|
|
196
|
+
onWheel: handleWheel
|
|
197
|
+
}))));
|
|
198
|
+
};
|
|
199
|
+
var mapTranscriptQueue = async (div, blocks, estimate = false) => {
|
|
200
|
+
if (!blocks || !Array.isArray(blocks) || blocks.length === 0) {
|
|
201
|
+
return [];
|
|
202
|
+
} else {
|
|
203
|
+
const ts = Date.now();
|
|
204
|
+
await document.fonts.ready;
|
|
205
|
+
const rows = [];
|
|
206
|
+
let blockIndex = 0;
|
|
207
|
+
for (const block of blocks) {
|
|
208
|
+
rows.push([
|
|
209
|
+
blockIndex,
|
|
210
|
+
-1,
|
|
211
|
+
lineHeight + cellSpacing
|
|
212
|
+
]);
|
|
213
|
+
let segmentIndex = 0;
|
|
214
|
+
for (const segment of block.segments) {
|
|
215
|
+
const height = await measureSegment(div, segment.text, estimate);
|
|
216
|
+
rows.push([
|
|
217
|
+
blockIndex,
|
|
218
|
+
segmentIndex,
|
|
219
|
+
height + cellSpacing
|
|
220
|
+
]);
|
|
221
|
+
segmentIndex++;
|
|
222
|
+
}
|
|
223
|
+
blockIndex++;
|
|
224
|
+
}
|
|
225
|
+
(0, import_log2.log)("render", {
|
|
226
|
+
duration: Date.now() - ts
|
|
227
|
+
}, {
|
|
228
|
+
F: __dxlog_file,
|
|
229
|
+
L: 196,
|
|
230
|
+
S: void 0,
|
|
231
|
+
C: (f, a) => f(...a)
|
|
232
|
+
});
|
|
233
|
+
return rows;
|
|
234
|
+
}
|
|
105
235
|
};
|
|
106
|
-
var
|
|
236
|
+
var measureSegment = async (div, text, estimate = false) => {
|
|
237
|
+
return new Promise((resolve) => {
|
|
238
|
+
div.innerHTML = text;
|
|
239
|
+
if (estimate) {
|
|
240
|
+
const { height } = div.getBoundingClientRect();
|
|
241
|
+
resolve(height);
|
|
242
|
+
} else {
|
|
243
|
+
requestAnimationFrame(() => {
|
|
244
|
+
const { height } = div.getBoundingClientRect();
|
|
245
|
+
resolve(height);
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
};
|
|
250
|
+
var formatElapsed = (start, end) => {
|
|
251
|
+
const { hours, minutes, seconds } = (0, import_intervalToDuration.intervalToDuration)({
|
|
252
|
+
start,
|
|
253
|
+
end
|
|
254
|
+
});
|
|
255
|
+
const pad = (n = 0) => String(n).padStart(2, "0");
|
|
256
|
+
return `${pad(hours)}:${pad(minutes)}:${pad(seconds)}`;
|
|
257
|
+
};
|
|
258
|
+
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/experimental/plugin-transcription/src/components/TranscriptContainer.tsx";
|
|
107
259
|
var TranscriptionContainer = ({ transcript }) => {
|
|
108
260
|
const { t } = (0, import_react_ui.useTranslation)(import_chunk_UIHEGU6Q.TRANSCRIPTION_PLUGIN);
|
|
109
261
|
const edge = (0, import_react_edge_client.useEdgeClient)();
|
|
110
262
|
const ai = useAiServiceClient();
|
|
111
263
|
const { dispatchPromise: dispatch } = (0, import_app_framework.useIntentDispatcher)();
|
|
264
|
+
const attendableId = (0, import_echo.fullyQualifiedId)(transcript);
|
|
112
265
|
const queue = (0, import_react_edge_client.useQueue)(edge, transcript.queue ? import_keys.DXN.parse(transcript.queue) : void 0, {
|
|
113
266
|
pollInterval: 1e3
|
|
114
267
|
});
|
|
@@ -116,11 +269,11 @@ var TranscriptionContainer = ({ transcript }) => {
|
|
|
116
269
|
const handleSummarize = (0, import_react.useCallback)(async () => {
|
|
117
270
|
setIsSummarizing(true);
|
|
118
271
|
try {
|
|
119
|
-
const
|
|
272
|
+
const document2 = await summarizeTranscript(edge, ai, transcript);
|
|
120
273
|
const space = (0, import_echo.getSpace)(transcript);
|
|
121
274
|
const target = space?.properties[import_types2.CollectionType.typename]?.target;
|
|
122
275
|
await dispatch((0, import_effect.pipe)((0, import_app_framework.createIntent)(import_types2.SpaceAction.AddObject, {
|
|
123
|
-
object:
|
|
276
|
+
object: document2,
|
|
124
277
|
target
|
|
125
278
|
}), (0, import_app_framework.chain)(import_app_framework.LayoutAction.Open, {
|
|
126
279
|
part: "main"
|
|
@@ -133,27 +286,26 @@ var TranscriptionContainer = ({ transcript }) => {
|
|
|
133
286
|
edge
|
|
134
287
|
]);
|
|
135
288
|
return /* @__PURE__ */ import_react.default.createElement(import_react_ui_stack.StackItem.Content, {
|
|
136
|
-
toolbar:
|
|
137
|
-
|
|
138
|
-
|
|
289
|
+
toolbar: false,
|
|
290
|
+
classNames: "relative"
|
|
291
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_react_ui.Toolbar.Root, {
|
|
292
|
+
classNames: "absolute block-start-1 inline-end-1 z-[1] is-min"
|
|
139
293
|
}, /* @__PURE__ */ import_react.default.createElement(import_react_ui.IconButton, {
|
|
140
|
-
icon: "ph--
|
|
141
|
-
iconOnly: true,
|
|
294
|
+
icon: "ph--pen--regular",
|
|
142
295
|
size: 5,
|
|
143
296
|
disabled: isSummarizing,
|
|
144
297
|
onClick: handleSummarize,
|
|
145
|
-
label: t("summary button")
|
|
146
|
-
}),
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
})));
|
|
298
|
+
label: t(isSummarizing ? "summarizing label" : "summary button")
|
|
299
|
+
})), /* @__PURE__ */ import_react.default.createElement(Transcript, {
|
|
300
|
+
blocks: queue?.items,
|
|
301
|
+
attendableId
|
|
302
|
+
}));
|
|
151
303
|
};
|
|
152
304
|
var TranscriptContainer_default = TranscriptionContainer;
|
|
153
305
|
var summarizeTranscript = async (edge, ai, transcript) => {
|
|
154
306
|
(0, import_invariant.invariant)(transcript.queue, "No queue found for transcript", {
|
|
155
|
-
F:
|
|
156
|
-
L:
|
|
307
|
+
F: __dxlog_file2,
|
|
308
|
+
L: 80,
|
|
157
309
|
S: void 0,
|
|
158
310
|
A: [
|
|
159
311
|
"transcript.queue",
|
|
@@ -167,8 +319,8 @@ var summarizeTranscript = async (edge, ai, transcript) => {
|
|
|
167
319
|
import_log.log.info("summarizing transcript", {
|
|
168
320
|
blockCount: queue.items.length
|
|
169
321
|
}, {
|
|
170
|
-
F:
|
|
171
|
-
L:
|
|
322
|
+
F: __dxlog_file2,
|
|
323
|
+
L: 91,
|
|
172
324
|
S: void 0,
|
|
173
325
|
C: (f, a) => f(...a)
|
|
174
326
|
});
|
|
@@ -190,14 +342,14 @@ var summarizeTranscript = async (edge, ai, transcript) => {
|
|
|
190
342
|
import_log.log.info("transcript summary", {
|
|
191
343
|
output
|
|
192
344
|
}, {
|
|
193
|
-
F:
|
|
194
|
-
L:
|
|
345
|
+
F: __dxlog_file2,
|
|
346
|
+
L: 100,
|
|
195
347
|
S: void 0,
|
|
196
348
|
C: (f, a) => f(...a)
|
|
197
349
|
});
|
|
198
350
|
(0, import_invariant.invariant)(output[0].content[0].type === "text", "Expected text content", {
|
|
199
|
-
F:
|
|
200
|
-
L:
|
|
351
|
+
F: __dxlog_file2,
|
|
352
|
+
L: 101,
|
|
201
353
|
S: void 0,
|
|
202
354
|
A: [
|
|
203
355
|
"output[0].content[0].type === 'text'",
|
|
@@ -262,6 +414,7 @@ var useAiServiceClient = () => {
|
|
|
262
414
|
0 && (module.exports = {
|
|
263
415
|
Transcript,
|
|
264
416
|
TranscriptContainer_default,
|
|
265
|
-
TranscriptionContainer
|
|
417
|
+
TranscriptionContainer,
|
|
418
|
+
formatElapsed
|
|
266
419
|
});
|
|
267
|
-
//# sourceMappingURL=chunk-
|
|
420
|
+
//# sourceMappingURL=chunk-SHYOIEFT.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/TranscriptContainer.tsx", "../../../src/components/Transcript/Transcript.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { pipe } from 'effect';\nimport React, { useCallback, useMemo, useState, type FC } from 'react';\n\nimport { chain, createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { Message } from '@dxos/artifact';\nimport { AIServiceEdgeClient, DEFAULT_LLM_MODEL, MixedStreamParser, type AIServiceClient } from '@dxos/assistant';\nimport { create, fullyQualifiedId, getSpace, makeRef } from '@dxos/client/echo';\nimport { QueueImpl } from '@dxos/echo-db';\nimport { createStatic, isInstanceOf } from '@dxos/echo-schema';\nimport { invariant } from '@dxos/invariant';\nimport { DXN } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { DocumentType } from '@dxos/plugin-markdown/types';\nimport { CollectionType, SpaceAction } from '@dxos/plugin-space/types';\nimport { useConfig } from '@dxos/react-client';\nimport { useEdgeClient, useQueue, type EdgeHttpClient } from '@dxos/react-edge-client';\nimport { IconButton, Toolbar, useTranslation } from '@dxos/react-ui';\nimport { StackItem } from '@dxos/react-ui-stack';\nimport { TextType } from '@dxos/schema';\n\nimport { Transcript } from './Transcript';\nimport { TRANSCRIPTION_PLUGIN } from '../meta';\nimport { TranscriptBlock, type TranscriptType } from '../types';\n\nexport const TranscriptionContainer: FC<{ transcript: TranscriptType }> = ({ transcript }) => {\n const { t } = useTranslation(TRANSCRIPTION_PLUGIN);\n const edge = useEdgeClient();\n const ai = useAiServiceClient();\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const attendableId = fullyQualifiedId(transcript);\n\n const queue = useQueue<TranscriptBlock>(edge, transcript.queue ? DXN.parse(transcript.queue) : undefined, {\n pollInterval: 1_000,\n });\n\n // TODO(dmaretskyi): Pending state and errors should be handled by the framework!!!\n const [isSummarizing, setIsSummarizing] = useState(false);\n const handleSummarize = useCallback(async () => {\n setIsSummarizing(true);\n try {\n const document = await summarizeTranscript(edge, ai, transcript);\n const space = getSpace(transcript);\n const target = space?.properties[CollectionType.typename]?.target;\n await dispatch(\n pipe(\n createIntent(SpaceAction.AddObject, { object: document, target }),\n chain(LayoutAction.Open, { part: 'main' }),\n ),\n );\n } finally {\n setIsSummarizing(false);\n }\n }, [transcript, edge]);\n\n // TODO(dmaretskyi): Move action to menu.\n return (\n <StackItem.Content toolbar={false} classNames='relative'>\n <Toolbar.Root classNames='absolute block-start-1 inline-end-1 z-[1] is-min'>\n <IconButton\n icon='ph--pen--regular'\n size={5}\n disabled={isSummarizing}\n onClick={handleSummarize}\n label={t(isSummarizing ? 'summarizing label' : 'summary button')}\n />\n </Toolbar.Root>\n <Transcript blocks={queue?.items} attendableId={attendableId} />\n </StackItem.Content>\n );\n};\n\nexport default TranscriptionContainer;\n\n// TODO(dmaretskyi): Extract to the new file once transcript refactoring has settled.\nconst summarizeTranscript = async (edge: EdgeHttpClient, ai: AIServiceClient, transcript: TranscriptType) => {\n invariant(transcript.queue, 'No queue found for transcript');\n\n const queue = new QueueImpl(edge, DXN.parse(transcript.queue));\n await queue.refresh();\n const content = queue.items\n .filter((block) => isInstanceOf(TranscriptBlock, block))\n .map((block) => `${block.author}: ${block.segments.map((segment) => segment.text).join('\\n')}`)\n .join('\\n\\n');\n\n const parser = new MixedStreamParser();\n\n log.info('summarizing transcript', { blockCount: queue.items.length });\n const output = await parser.parse(\n await ai.exec({\n model: DEFAULT_LLM_MODEL,\n systemPrompt: SUMMARIZE_PROMPT,\n history: [createStatic(Message, { role: 'user', content: [{ type: 'text', text: content }] })],\n }),\n );\n\n log.info('transcript summary', { output });\n invariant(output[0].content[0].type === 'text', 'Expected text content');\n const summary = output[0].content[0].text;\n\n // TODO(dmaretskyi): .started is missing.\n const name = `Summary ${(transcript.started ?? new Date()).toLocaleString('en-US', {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n })}`;\n\n return create(DocumentType, {\n name,\n content: makeRef(create(TextType, { content: summary })),\n threads: [],\n });\n};\n\n// TODO(dmaretskyi): Add example to set consistent structure for the summary.\nconst SUMMARIZE_PROMPT = `\n # Goal\n Create a markdown summary of the transcript provided.\n\n # Formatting\n - Format the summary as a markdown document without extra comments like \"Here is the summary of the transcript:\".\n - Use markdown formatting for headings and bullet points.\n - Format the summary as a list of key points and takeaways.\n - All names of people should be in bold.\n\n # Note Taking\n - Correlate items in the summary with the person of origin to build a coherent narrative.\n - Include short quotes verbatim where appropriate. Especially when concerned with design decisions and problem descriptions.\n\n # Tasks\n At the end of the summary include tasks.\n Extract only the tasks that are:\n - Directly actionable.\n - Clearly assigned to a person or team (or can easily be inferred).\n - Strongly implied by the conversation and/or user note (no speculative tasks).\n - Specific enough that someone reading them would know exactly what to do next.\n\n Format all tasks as markdown checkboxes using the syntax:\n - [ ] Task description\n\n Additional information can be included (indented).\n\n If no actionable tasks are found, omit this tasks section.\n`;\n\n// TODO(dmaretskyi): Extract?\n// Also this conflicts with plugin automation providing the ai client via a capability. Need to reconcile.\nconst useAiServiceClient = (): AIServiceClient => {\n const config = useConfig();\n const endpoint = config.values.runtime?.services?.ai?.server ?? 'http://localhost:8788'; // TOOD(burdon): Standardize consts.\n return useMemo(() => new AIServiceEdgeClient({ endpoint }), [endpoint]);\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { intervalToDuration } from 'date-fns/intervalToDuration';\nimport React, { type FC, useCallback, useEffect, useMemo, useRef, useState, type WheelEvent } from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\n\nimport { log } from '@dxos/log';\nimport { useAttention } from '@dxos/react-ui-attention';\nimport {\n type DxGridCellValue,\n type DxGridElement,\n type DxGridAxisMeta,\n type DxGridPlaneCells,\n Grid,\n toPlaneCellIndex,\n} from '@dxos/react-ui-grid';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport { type TranscriptBlock } from '../../types';\n\n// TODO(burdon): Actions (e.g., mark, summarize, translate, label, delete).\n\nconst timeWidth = 70;\nconst lineHeight = 24;\nconst cellSpacing = 12;\n\nconst authorClasses = 'text-[16px] leading-[24px] dx-tag';\n\n// NOTE: These classes are required for synchronous measurement.\nconst segmentTextClasses = 'text-[16px] leading-[24px] whitespace-pre-wrap break-words hyphens-none';\n\ntype QueueRows = [number, number, number][];\n\nexport type TranscriptProps = {\n attendableId?: string;\n ignoreAttention?: boolean;\n blocks?: TranscriptBlock[];\n};\n\nexport const Transcript: FC<TranscriptProps> = ({ attendableId, ignoreAttention, blocks }) => {\n const { hasAttention } = useAttention(attendableId);\n const { ref, width } = useResizeDetector();\n const measureRef = useRef<HTMLDivElement>(null);\n\n const textWidth = width ? width - timeWidth : 0;\n const transcriptColumns = width\n ? {\n grid: {\n 0: { size: timeWidth },\n 1: { size: textWidth },\n },\n }\n : undefined;\n\n const transcriptRows = {\n grid: { size: lineHeight },\n };\n\n const [queueMap, setQueueMap] = useState<QueueRows>([]);\n useEffect(() => {\n if (measureRef.current) {\n // TODO(burdon): Only measure rows that have changed. Cache other values.\n // TODO(burdon): Build into grid with estimated height and correct on the fly.\n void mapTranscriptQueue(measureRef.current, blocks, true).then((queueMap) => {\n setQueueMap(queueMap);\n if (measureRef.current) {\n void mapTranscriptQueue(measureRef.current, blocks, false).then(setQueueMap);\n }\n });\n }\n }, [blocks, measureRef.current]);\n\n const rows = useMemo(\n () =>\n ({\n grid: queueMap.reduce((acc: DxGridAxisMeta['grid'], row, rowIndex) => {\n acc[rowIndex] = { size: row[2] };\n return acc;\n }, {}),\n }) satisfies DxGridAxisMeta,\n [queueMap],\n );\n\n const [dxGrid, setDxGrid] = useState<DxGridElement | null>(null);\n useEffect(() => {\n if (dxGrid && Array.isArray(blocks)) {\n const start = blocks[0]?.segments[0]?.started ?? 0;\n\n dxGrid.getCells = (range, plane) => {\n switch (plane) {\n case 'grid': {\n const cells: DxGridPlaneCells = {};\n for (let row = range.start.row; row <= range.end.row && row < queueMap.length; row++) {\n const [blockIndex, segmentIndex] = queueMap[row];\n const { author, segments } = blocks[blockIndex] ?? { author: '', segments: [] };\n const { started: end, text } = segments[segmentIndex] ?? { started: 0, text: '' };\n\n cells[toPlaneCellIndex({ col: 0, row })] = (\n segmentIndex === 0\n ? {\n readonly: true,\n accessoryHtml: `<span class=\"pbs-1 text-xs text-neutral-500\">${formatElapsed(start, end)}</span>`,\n }\n : {}\n ) satisfies DxGridCellValue;\n\n cells[toPlaneCellIndex({ col: 1, row })] = (\n segmentIndex < 0\n ? {\n value: author,\n readonly: true,\n // TODO(burdon): Color based on username.\n className: authorClasses,\n }\n : {\n readonly: true,\n accessoryHtml: `<div class=\"${segmentTextClasses}\">${text.trim()}</div>`,\n }\n ) satisfies DxGridCellValue;\n }\n\n return cells;\n }\n default:\n return {};\n }\n };\n }\n }, [dxGrid, queueMap, blocks]);\n\n const handleWheel = useCallback(\n (event: WheelEvent) => {\n if (!ignoreAttention && !hasAttention) {\n event.stopPropagation();\n }\n },\n [hasAttention, ignoreAttention],\n );\n\n return (\n <div role='none' ref={ref} className='grow'>\n {transcriptColumns && (\n <>\n <div className='relative'>\n <div\n className='absolute top-0 z-10 p-1 border invisible'\n style={{ left: timeWidth, width: transcriptColumns.grid['1'].size }}\n >\n <div ref={measureRef} className={mx(segmentTextClasses)} />\n </div>\n </div>\n <Grid.Root id={`${attendableId}--transcript`}>\n <Grid.Content\n ref={setDxGrid}\n className='[--dx-grid-base:var(--dx-baseSurface)] [--dx-grid-lines:var(--dx-baseSurface)] [&_.dx-grid]:min-bs-0 [&_.dx-grid]:select-auto'\n columns={transcriptColumns}\n rowDefault={transcriptRows}\n rows={rows}\n limitColumns={2}\n limitRows={queueMap.length}\n onWheel={handleWheel}\n />\n </Grid.Root>\n </>\n )}\n </div>\n );\n};\n\nconst mapTranscriptQueue = async (\n div: HTMLDivElement,\n blocks?: TranscriptBlock[],\n estimate = false,\n): Promise<QueueRows> => {\n if (!blocks || !Array.isArray(blocks) || blocks.length === 0) {\n return [];\n } else {\n const ts = Date.now();\n await document.fonts.ready;\n\n const rows: QueueRows = [];\n let blockIndex = 0;\n for (const block of blocks) {\n rows.push([blockIndex, -1, lineHeight + cellSpacing]);\n let segmentIndex = 0;\n for (const segment of block.segments) {\n const height = await measureSegment(div, segment.text, estimate);\n rows.push([blockIndex, segmentIndex, height + cellSpacing]);\n segmentIndex++;\n }\n blockIndex++;\n }\n\n log('render', { duration: Date.now() - ts });\n return rows;\n\n // return blocks.flatMap((block, blockIndex) => {\n // return [\n // [blockIndex, -1, lineHeight + cellSpacing],\n // ...block.segments.map((segment, segmentIndex) => {\n // div.innerHTML = segment.text;\n // const height = measureSegmentSync(div, segment.text) + cellSpacing;\n // return [blockIndex, segmentIndex, height] as [number, number, number];\n // }),\n // ];\n // });\n }\n};\n\n// TODO(burdon): Occasional random measurement error (-1 actual lines).\n// const measureSegmentSync = (div: HTMLDivElement, text: string): number => {\n// div.innerHTML = text;\n// void div.offsetHeight;\n// return div.offsetHeight;\n// };\n\nconst measureSegment = async (div: HTMLDivElement, text: string, estimate = false): Promise<number> => {\n return new Promise((resolve) => {\n div.innerHTML = text;\n if (estimate) {\n const { height } = div.getBoundingClientRect();\n resolve(height);\n } else {\n requestAnimationFrame(() => {\n const { height } = div.getBoundingClientRect();\n resolve(height);\n });\n }\n });\n};\n\nexport const formatElapsed = (start: Date, end: Date) => {\n const { hours, minutes, seconds } = intervalToDuration({ start, end });\n const pad = (n = 0) => String(n).padStart(2, '0');\n return `${pad(hours)}:${pad(minutes)}:${pad(seconds)}`;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,oBAAqB;AACrB,mBAA+D;AAE/D,2BAAuE;AACvE,sBAAwB;AACxB,uBAAgG;AAChG,kBAA4D;AAC5D,qBAA0B;AAC1B,yBAA2C;AAC3C,uBAA0B;AAC1B,kBAAoB;AACpB,iBAAoB;AACpB,mBAA6B;AAC7B,IAAAA,gBAA4C;AAC5C,0BAA0B;AAC1B,+BAA6D;AAC7D,sBAAoD;AACpD,4BAA0B;AAC1B,oBAAyB;AClBzB,gCAAmC;AACnC,IAAAC,gBAAmG;AACnG,mCAAkC;AAElC,IAAAC,cAAoB;AACpB,gCAA6B;AAC7B,2BAOO;AACP,4BAAmB;;AAMnB,IAAMC,YAAY;AAClB,IAAMC,aAAa;AACnB,IAAMC,cAAc;AAEpB,IAAMC,gBAAgB;AAGtB,IAAMC,qBAAqB;AAUpB,IAAMC,aAAkC,CAAC,EAAEC,cAAcC,iBAAiBC,OAAM,MAAE;AACvF,QAAM,EAAEC,aAAY,QAAKC,wCAAaJ,YAAAA;AACtC,QAAM,EAAEK,KAAKC,MAAK,QAAKC,gDAAAA;AACvB,QAA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AC;YAAEmB,MAAM;YAAQ5H,MAAMyG;UAAQ;;MAAG,CAAA;;EAC7F,CAAA,CAAA;AAGFjE,aAAAA,IAAIyE,KAAK,sBAAsB;IAAEE;EAAO,GAAA;;;;;;AACxCb,kCAAUa,OAAO,CAAA,EAAGV,QAAQ,CAAA,EAAGmB,SAAS,QAAQ,yBAAA;;;;;;;;;AAChD,QAAMC,UAAUV,OAAO,CAAA,EAAGV,QAAQ,CAAA,EAAGzG;AAGrC,QAAM8H,OAAO,YAAYtE,WAAWlE,WAAW,oBAAIwC,KAAAA,GAAQiG,eAAe,SAAS;IACjFC,MAAM;IACNC,OAAO;IACPC,KAAK;IACLC,MAAM;IACNC,QAAQ;EACV,CAAA,CAAA;AAEA,aAAOC,oBAAOC,2BAAc;IAC1BR;IACArB,aAAS8B,yBAAQF,oBAAOG,wBAAU;MAAE/B,SAASoB;IAAQ,CAAA,CAAA;IACrDY,SAAS,CAAA;EACX,CAAA;AACF;AAGA,IAAMjB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCzB,IAAMzD,qBAAqB,MAAA;AACzB,QAAM2E,aAASC,+BAAAA;AACf,QAAMC,WAAWF,OAAOG,OAAOC,SAASC,UAAUjF,IAAIkF,UAAU;AAChE,aAAOrK,aAAAA,SAAQ,MAAM,IAAIsK,qCAAoB;IAAEL;EAAS,CAAA,GAAI;IAACA;GAAS;AACxE;",
|
|
6
|
+
"names": ["import_types", "import_react", "import_log", "timeWidth", "lineHeight", "cellSpacing", "authorClasses", "segmentTextClasses", "Transcript", "attendableId", "ignoreAttention", "blocks", "hasAttention", "useAttention", "ref", "width", "useResizeDetector", "measureRef", "useRef", "textWidth", "transcriptColumns", "grid", "size", "undefined", "transcriptRows", "queueMap", "setQueueMap", "useState", "useEffect", "current", "mapTranscriptQueue", "then", "rows", "useMemo", "reduce", "acc", "row", "rowIndex", "dxGrid", "setDxGrid", "Array", "isArray", "start", "segments", "started", "getCells", "range", "plane", "cells", "end", "length", "blockIndex", "segmentIndex", "author", "text", "toPlaneCellIndex", "col", "readonly", "accessoryHtml", "formatElapsed", "value", "className", "trim", "handleWheel", "useCallback", "event", "stopPropagation", "React", "div", "role", "style", "left", "mx", "Grid", "Root", "id", "Content", "columns", "rowDefault", "limitColumns", "limitRows", "onWheel", "estimate", "ts", "Date", "now", "document", "fonts", "ready", "block", "push", "segment", "height", "measureSegment", "log", "duration", "Promise", "resolve", "innerHTML", "getBoundingClientRect", "requestAnimationFrame", "hours", "minutes", "seconds", "intervalToDuration", "pad", "n", "String", "padStart", "TranscriptionContainer", "transcript", "t", "useTranslation", "TRANSCRIPTION_PLUGIN", "edge", "useEdgeClient", "ai", "useAiServiceClient", "dispatchPromise", "dispatch", "useIntentDispatcher", "fullyQualifiedId", "queue", "useQueue", "DXN", "parse", "pollInterval", "isSummarizing", "setIsSummarizing", "handleSummarize", "summarizeTranscript", "space", "getSpace", "target", "properties", "CollectionType", "typename", "pipe", "createIntent", "SpaceAction", "AddObject", "object", "chain", "LayoutAction", "Open", "part", "StackItem", "toolbar", "classNames", "Toolbar", "IconButton", "icon", "disabled", "onClick", "label", "items", "invariant", "QueueImpl", "refresh", "content", "filter", "isInstanceOf", "TranscriptBlock", "map", "join", "parser", "MixedStreamParser", "info", "blockCount", "output", "exec", "model", "DEFAULT_LLM_MODEL", "systemPrompt", "SUMMARIZE_PROMPT", "history", "createStatic", "Message", "type", "summary", "name", "toLocaleString", "year", "month", "day", "hour", "minute", "create", "DocumentType", "makeRef", "TextType", "threads", "config", "useConfig", "endpoint", "values", "runtime", "services", "server", "AIServiceEdgeClient"]
|
|
7
|
+
}
|
package/dist/lib/node/index.cjs
CHANGED
|
@@ -34,12 +34,13 @@ __export(node_exports, {
|
|
|
34
34
|
ReactSurface: () => ReactSurface,
|
|
35
35
|
TRANSCRIPTION_PLUGIN: () => import_chunk_UIHEGU6Q.TRANSCRIPTION_PLUGIN,
|
|
36
36
|
Transcriber: () => Transcriber,
|
|
37
|
-
Transcript: () =>
|
|
38
|
-
TranscriptContainer: () =>
|
|
37
|
+
Transcript: () => import_chunk_SHYOIEFT.Transcript,
|
|
38
|
+
TranscriptContainer: () => import_chunk_5SKPVCFI.TranscriptContainer,
|
|
39
39
|
TranscriptionCapabilities: () => TranscriptionCapabilities,
|
|
40
|
-
TranscriptionContainer: () =>
|
|
40
|
+
TranscriptionContainer: () => import_chunk_SHYOIEFT.TranscriptionContainer,
|
|
41
41
|
TranscriptionManager: () => TranscriptionManager,
|
|
42
42
|
TranscriptionPlugin: () => TranscriptionPlugin,
|
|
43
|
+
formatElapsed: () => import_chunk_SHYOIEFT.formatElapsed,
|
|
43
44
|
meta: () => import_chunk_UIHEGU6Q.meta,
|
|
44
45
|
useAudioFile: () => useAudioFile,
|
|
45
46
|
useAudioTrack: () => useAudioTrack,
|
|
@@ -48,8 +49,8 @@ __export(node_exports, {
|
|
|
48
49
|
});
|
|
49
50
|
module.exports = __toCommonJS(node_exports);
|
|
50
51
|
var import_chunk_HDRXDMK2 = require("./chunk-HDRXDMK2.cjs");
|
|
51
|
-
var
|
|
52
|
-
var
|
|
52
|
+
var import_chunk_5SKPVCFI = require("./chunk-5SKPVCFI.cjs");
|
|
53
|
+
var import_chunk_SHYOIEFT = require("./chunk-SHYOIEFT.cjs");
|
|
53
54
|
var import_chunk_UIHEGU6Q = require("./chunk-UIHEGU6Q.cjs");
|
|
54
55
|
var import_app_framework = require("@dxos/app-framework");
|
|
55
56
|
var import_app_framework2 = require("@dxos/app-framework");
|
|
@@ -87,7 +88,7 @@ var TranscriptionCapabilities;
|
|
|
87
88
|
})(TranscriptionCapabilities || (TranscriptionCapabilities = {}));
|
|
88
89
|
var AppGraphBuilder = (0, import_app_framework.lazy)(() => import("./app-graph-builder-YFBX3OTP.cjs"));
|
|
89
90
|
var IntentResolver = (0, import_app_framework.lazy)(() => import("./intent-resolver-KLBZ25XJ.cjs"));
|
|
90
|
-
var ReactSurface = (0, import_app_framework.lazy)(() => import("./react-surface-
|
|
91
|
+
var ReactSurface = (0, import_app_framework.lazy)(() => import("./react-surface-GDE6AIDT.cjs"));
|
|
91
92
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/experimental/plugin-transcription/src/hooks/useAudioFile.ts";
|
|
92
93
|
var useAudioFile = (audioUrl) => {
|
|
93
94
|
const [{ audio, stream, track }, setStream] = (0, import_react.useState)({});
|
|
@@ -688,7 +689,7 @@ var translations_default = [
|
|
|
688
689
|
"delete calls label": "Delete",
|
|
689
690
|
"delete button": "Delete",
|
|
690
691
|
"bookmark button": "Bookmark",
|
|
691
|
-
"summary button": "
|
|
692
|
+
"summary button": "Summarize",
|
|
692
693
|
"summarizing label": "Summarizing..."
|
|
693
694
|
}
|
|
694
695
|
}
|
|
@@ -760,6 +761,7 @@ var TranscriptionPlugin = () => (0, import_app_framework3.definePlugin)(import_c
|
|
|
760
761
|
TranscriptionContainer,
|
|
761
762
|
TranscriptionManager,
|
|
762
763
|
TranscriptionPlugin,
|
|
764
|
+
formatElapsed,
|
|
763
765
|
meta,
|
|
764
766
|
useAudioFile,
|
|
765
767
|
useAudioTrack,
|