agentopia 1.1.4 → 1.2.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.
- package/dist/db/schema.js +2 -2
- package/dist/routes/agents.js +6 -6
- package/dist/routes/agents.js.map +1 -1
- package/dist/routes/issues.d.ts.map +1 -1
- package/dist/routes/issues.js +0 -18
- package/dist/routes/issues.js.map +1 -1
- package/dist/services/pre-controller.d.ts.map +1 -1
- package/dist/services/pre-controller.js +0 -2
- package/dist/services/pre-controller.js.map +1 -1
- package/dist/services/process-manager.d.ts +5 -24
- package/dist/services/process-manager.d.ts.map +1 -1
- package/dist/services/process-manager.js +11 -105
- package/dist/services/process-manager.js.map +1 -1
- package/dist/services/scheduler.d.ts.map +1 -1
- package/dist/services/scheduler.js +2 -31
- package/dist/services/scheduler.js.map +1 -1
- package/dist/services/terminal.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/public/js/files-panel.js +20 -4
package/public/js/files-panel.js
CHANGED
|
@@ -421,7 +421,7 @@
|
|
|
421
421
|
iframe.style.cssText = 'width:100%;height:100%;border:none;background:#fff;';
|
|
422
422
|
iframe.src = src;
|
|
423
423
|
if (mode === 'html') {
|
|
424
|
-
iframe.sandbox = 'allow-
|
|
424
|
+
iframe.sandbox = 'allow-scripts allow-forms allow-popups';
|
|
425
425
|
}
|
|
426
426
|
editorEl.appendChild(iframe);
|
|
427
427
|
this.state.previewMode = mode;
|
|
@@ -531,17 +531,32 @@
|
|
|
531
531
|
|
|
532
532
|
async loadOfficeLib(mode) {
|
|
533
533
|
if (mode === 'docx') {
|
|
534
|
-
if (!window.
|
|
534
|
+
if (!window.mammoth) {
|
|
535
535
|
await this._loadScript('https://cdn.jsdelivr.net/npm/mammoth@1.8.0/mammoth.browser.min.js');
|
|
536
|
-
|
|
536
|
+
// Wait for the global to become available
|
|
537
|
+
await this._waitForGlobal('mammoth');
|
|
537
538
|
}
|
|
538
539
|
} else if (mode === 'xlsx') {
|
|
539
540
|
if (!window.XLSX) {
|
|
540
541
|
await this._loadScript('https://cdn.jsdelivr.net/npm/xlsx@0.18.5/dist/xlsx.full.min.js');
|
|
542
|
+
await this._waitForGlobal('XLSX');
|
|
541
543
|
}
|
|
542
544
|
}
|
|
543
545
|
}
|
|
544
546
|
|
|
547
|
+
_waitForGlobal(name, timeout = 5000) {
|
|
548
|
+
return new Promise((resolve, reject) => {
|
|
549
|
+
if (window[name]) return resolve();
|
|
550
|
+
const start = Date.now();
|
|
551
|
+
const check = () => {
|
|
552
|
+
if (window[name]) return resolve();
|
|
553
|
+
if (Date.now() - start > timeout) return reject(new Error(`${name} failed to load`));
|
|
554
|
+
setTimeout(check, 50);
|
|
555
|
+
};
|
|
556
|
+
check();
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
|
|
545
560
|
_loadScript(url) {
|
|
546
561
|
return new Promise((resolve, reject) => {
|
|
547
562
|
const s = document.createElement('script');
|
|
@@ -563,7 +578,8 @@
|
|
|
563
578
|
|
|
564
579
|
let html = '';
|
|
565
580
|
if (mode === 'docx') {
|
|
566
|
-
|
|
581
|
+
if (!window.mammoth) throw new Error('mammoth library not available');
|
|
582
|
+
const result = await window.mammoth.convertToHtml({ arrayBuffer });
|
|
567
583
|
html = '<div style="max-width:800px;margin:0 auto;line-height:1.6">' + result.value + '</div>';
|
|
568
584
|
if (result.messages && result.messages.length > 0) {
|
|
569
585
|
html += '<div style="margin-top:16px;padding:8px;background:#fff3cd;border-radius:4px;font-size:12px;color:#856404">' +
|