@metagptx/web-sdk 0.0.61 → 0.0.63
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/plugins.js +26 -28
- package/package.json +1 -1
package/dist/plugins.js
CHANGED
|
@@ -268,30 +268,30 @@ function onEscape(e) {
|
|
|
268
268
|
if (e.key === 'Escape') removeOverlay();
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
-
function
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
:
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
'
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
271
|
+
function postResolveMessage(err) {
|
|
272
|
+
const message = {
|
|
273
|
+
type: 'errorResolve',
|
|
274
|
+
targetName: window.name || '',
|
|
275
|
+
data: {
|
|
276
|
+
message: err.message || 'Unknown error',
|
|
277
|
+
stack: err.stack || '',
|
|
278
|
+
frame: err.frame || '',
|
|
279
|
+
id: err.id || '',
|
|
280
|
+
loc: err.loc || null,
|
|
281
|
+
},
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
try {
|
|
285
|
+
if (window.top) {
|
|
286
|
+
window.top.postMessage(message, '*');
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
if (window.opener && window.opener !== window.top) {
|
|
290
|
+
window.opener.postMessage(message, '*');
|
|
291
|
+
}
|
|
292
|
+
} catch (error) {
|
|
293
|
+
console.warn('Failed to send resolve message:', error);
|
|
294
|
+
}
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
function createOverlay(err) {
|
|
@@ -310,7 +310,6 @@ function createOverlay(err) {
|
|
|
310
310
|
|
|
311
311
|
'<div style="font-size:14px;line-height:24px;font-weight:400;color:rgba(12,12,12,0.8);text-align:center;">Something is wrong</div>' +
|
|
312
312
|
'<div style="font-size:12px;line-height:18px;color:rgba(12,12,12,0.48);text-align:center;max-width:280px;">' + escapeHtml(err.message || 'Unknown error') + '</div>' +
|
|
313
|
-
createDetails(err) +
|
|
314
313
|
'<div style="display:flex;align-items:flex-start;gap:8px;">' +
|
|
315
314
|
'<button id="cve-reload" style="display:inline-flex;align-items:center;justify-content:center;gap:4px;height:28px;padding:0 12px;border:none;border-radius:8px;background:rgba(12,12,12,0.06);color:rgba(12,12,12,0.95);font-size:14px;font-weight:500;line-height:22px;cursor:pointer;">' +
|
|
316
315
|
'<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M11.105 5.20813C11.3465 5.20827 11.5425 5.40409 11.5425 5.64563C11.5425 8.78666 8.99598 11.333 5.85498 11.3331C4.11675 11.3331 2.56217 10.5521 1.51929 9.32422V10.1779C1.51929 10.4195 1.32341 10.6154 1.08179 10.6154C0.840163 10.6154 0.644287 10.4195 0.644287 10.1779V8.26892C0.644287 8.0273 0.840163 7.83142 1.08179 7.83142H2.99072C3.23235 7.83142 3.42822 8.0273 3.42822 8.26892C3.42814 8.51048 3.2323 8.70642 2.99072 8.70642H2.14392C3.02711 9.77583 4.36095 10.4581 5.85498 10.4581C8.51273 10.458 10.6675 8.30342 10.6675 5.64563C10.6675 5.40401 10.8634 5.20813 11.105 5.20813Z" fill="#0C0C0C" fill-opacity="0.95"/><path d="M5.6875 0C7.42573 0 8.98031 0.781055 10.0232 2.00891V1.15527C10.0232 0.913649 10.2191 0.717773 10.4607 0.717773C10.7023 0.717773 10.8982 0.913649 10.8982 1.15527V3.06421C10.898 3.30566 10.7022 3.50171 10.4607 3.50171H8.55176C8.31026 3.50171 8.11446 3.30566 8.11426 3.06421C8.11434 2.82265 8.31018 2.62671 8.55176 2.62671H9.39856C8.51537 1.5573 7.18153 0.875 5.6875 0.875C3.02975 0.87514 0.875 3.02971 0.875 5.6875C0.874798 5.92895 0.679 6.125 0.4375 6.125C0.196119 6.12486 0.000202109 5.92887 0 5.6875C0 2.54647 2.5465 0.000140261 5.6875 0Z" fill="#0C0C0C" fill-opacity="0.95"/></svg>' +
|
|
@@ -348,12 +347,11 @@ function createOverlay(err) {
|
|
|
348
347
|
});
|
|
349
348
|
}
|
|
350
349
|
|
|
351
|
-
const details = overlay.querySelector('#cve-details');
|
|
352
350
|
const resolveButton = overlay.querySelector('#cve-resolve');
|
|
353
|
-
if (resolveButton
|
|
351
|
+
if (resolveButton) {
|
|
354
352
|
resolveButton.addEventListener('click', function(e) {
|
|
355
353
|
e.stopPropagation();
|
|
356
|
-
|
|
354
|
+
postResolveMessage(err);
|
|
357
355
|
});
|
|
358
356
|
}
|
|
359
357
|
|