@kubohiroya/turbowarp-extension-security-dialog 0.5.0 → 0.5.1
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/NOTICE.md +6 -0
- package/dist/index.cjs +90 -3
- package/dist/index.d.ts +6 -0
- package/dist/index.mjs +90 -3
- package/dist/react.cjs +7 -1
- package/dist/react.mjs +7 -1
- package/package.json +1 -1
- package/styles.css +13 -0
- package/webpack4.css +13 -0
package/NOTICE.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Image attribution
|
|
2
2
|
|
|
3
|
+
## common.svg
|
|
4
|
+
|
|
5
|
+
Original to this package: a jigsaw piece outline with a serif T, drawn for it and derived from no
|
|
6
|
+
other work. It is embedded into `dist` as a base64 data URI by `scripts/build.mjs`, so it ships in
|
|
7
|
+
the published package. It replaced an earlier icon whose origin was not recorded.
|
|
8
|
+
|
|
3
9
|
## custom.svg
|
|
4
10
|
|
|
5
11
|
{ } characters from https://github.com/jesseweed/seti-ui/blob/master/icons/json.svg under the MIT License:
|
package/dist/index.cjs
CHANGED
|
@@ -43,6 +43,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
43
43
|
// src/index.js
|
|
44
44
|
var index_exports = {};
|
|
45
45
|
__export(index_exports, {
|
|
46
|
+
createExtensionWaitDialog: () => createExtensionWaitDialog,
|
|
46
47
|
decodeExtensionDataURL: () => decodeExtensionDataURL,
|
|
47
48
|
encodeChoices: () => encodeChoices,
|
|
48
49
|
fingerprint: () => fingerprint,
|
|
@@ -231,8 +232,8 @@ var import_jszip = __toESM(require("@turbowarp/jszip"), 1);
|
|
|
231
232
|
var DATABASE = "tw-extension-security";
|
|
232
233
|
var STORE = "project-preferences";
|
|
233
234
|
var validMode = (mode) => ["deny", "sandboxed", "unsandboxed"].includes(mode);
|
|
234
|
-
var fingerprint = async (
|
|
235
|
-
const bytes = new _TextEncoder().encode(
|
|
235
|
+
var fingerprint = async (text2) => {
|
|
236
|
+
const bytes = new _TextEncoder().encode(text2);
|
|
236
237
|
const digest = await globalThis.crypto.subtle.digest("SHA-256", bytes);
|
|
237
238
|
return Array.from(new Uint8Array(digest), (value) => value.toString(16).padStart(2, "0")).join("");
|
|
238
239
|
};
|
|
@@ -420,6 +421,9 @@ var messages = {
|
|
|
420
421
|
"source": "Source code",
|
|
421
422
|
"sourceFailed": "Could not retrieve source code.",
|
|
422
423
|
"preview": "Preview for {name}",
|
|
424
|
+
"fetchWaitTitle": "Fetching an extension",
|
|
425
|
+
"fetchWaitRetry": "Could not connect. Trying again ({attempt}/{attempts})",
|
|
426
|
+
"fetchWaitNote": "This takes a few seconds. If it keeps failing, loading stops and the project you had open is restored.",
|
|
423
427
|
"warning": "Extensions without a sandbox can access your project and browser information."
|
|
424
428
|
},
|
|
425
429
|
"ja": {
|
|
@@ -499,6 +503,9 @@ var messages = {
|
|
|
499
503
|
"source": "\u30BD\u30FC\u30B9\u30B3\u30FC\u30C9",
|
|
500
504
|
"sourceFailed": "\u30BD\u30FC\u30B9\u30B3\u30FC\u30C9\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002",
|
|
501
505
|
"preview": "{name} \u306E\u30D7\u30EC\u30D3\u30E5\u30FC",
|
|
506
|
+
"fetchWaitTitle": "\u6A5F\u80FD\u62E1\u5F35\u3092\u53D6\u5F97\u3057\u3066\u3044\u307E\u3059",
|
|
507
|
+
"fetchWaitRetry": "\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u518D\u8A66\u884C\u3057\u3066\u3044\u307E\u3059\uFF08{attempt}/{attempts}\uFF09",
|
|
508
|
+
"fetchWaitNote": "\u6570\u79D2\u3067\u7D42\u308F\u308A\u307E\u3059\u3002\u305D\u308C\u3067\u3082\u53D6\u5F97\u3067\u304D\u306A\u3044\u5834\u5408\u306F\u8AAD\u307F\u8FBC\u307F\u3092\u4E2D\u6B62\u3057\u3001\u958B\u3044\u3066\u3044\u305F\u4F5C\u54C1\u306B\u623B\u3057\u307E\u3059\u3002",
|
|
502
509
|
"warning": "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u306E\u62E1\u5F35\u306F\u3001\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3084\u30D6\u30E9\u30A6\u30B6\u30FC\u306E\u60C5\u5831\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u3059\u3002"
|
|
503
510
|
}
|
|
504
511
|
};
|
|
@@ -508,6 +515,86 @@ var formatMessage = (locale, key, values = {}) => {
|
|
|
508
515
|
return template.replace(/\{(\w+)\}/g, (match, name) => String(values[name] === void 0 ? match : values[name]));
|
|
509
516
|
};
|
|
510
517
|
|
|
518
|
+
// src/wait-dialog.js
|
|
519
|
+
var text = (document, tag, value, className) => {
|
|
520
|
+
const element = document.createElement(tag);
|
|
521
|
+
element.textContent = value;
|
|
522
|
+
if (className) element.className = className;
|
|
523
|
+
return element;
|
|
524
|
+
};
|
|
525
|
+
function createExtensionWaitDialog(document, locale = "en", { delayMs = 300 } = {}) {
|
|
526
|
+
let dialog = null;
|
|
527
|
+
let timer = null;
|
|
528
|
+
let latest = null;
|
|
529
|
+
let disposed = false;
|
|
530
|
+
const label = (key) => formatMessage(locale, key, latest || {});
|
|
531
|
+
const render = () => {
|
|
532
|
+
if (!dialog) return;
|
|
533
|
+
dialog.querySelector('[data-twextsec-wait="attempt"]').textContent = label("fetchWaitRetry");
|
|
534
|
+
dialog.querySelector('[data-twextsec-wait="source"]').textContent = latest.url || "";
|
|
535
|
+
};
|
|
536
|
+
const open = () => {
|
|
537
|
+
timer = null;
|
|
538
|
+
if (disposed || dialog || !document || !document.body) return;
|
|
539
|
+
dialog = document.createElement("dialog");
|
|
540
|
+
dialog.className = "twextsec-wait";
|
|
541
|
+
dialog.setAttribute("data-testid", "twextsec-wait");
|
|
542
|
+
dialog.setAttribute("aria-live", "polite");
|
|
543
|
+
dialog.appendChild(text(document, "h2", formatMessage(locale, "fetchWaitTitle")));
|
|
544
|
+
const attempt = text(document, "p", "");
|
|
545
|
+
attempt.setAttribute("data-twextsec-wait", "attempt");
|
|
546
|
+
const source = text(document, "p", "", "twextsec-wait-source");
|
|
547
|
+
source.setAttribute("data-twextsec-wait", "source");
|
|
548
|
+
dialog.append(
|
|
549
|
+
attempt,
|
|
550
|
+
source,
|
|
551
|
+
text(document, "p", formatMessage(locale, "fetchWaitNote"), "twextsec-wait-note")
|
|
552
|
+
);
|
|
553
|
+
dialog.addEventListener("cancel", (event) => event.preventDefault());
|
|
554
|
+
document.body.appendChild(dialog);
|
|
555
|
+
render();
|
|
556
|
+
try {
|
|
557
|
+
if (typeof dialog.showModal === "function") dialog.showModal();
|
|
558
|
+
} catch (error) {
|
|
559
|
+
}
|
|
560
|
+
};
|
|
561
|
+
return Object.freeze({
|
|
562
|
+
/**
|
|
563
|
+
* Report the attempt now being waited for, opening the dialog once the wait looks real.
|
|
564
|
+
* @param {object} info The url, the attempt it leads to, and how many there are in all.
|
|
565
|
+
* @returns {void}
|
|
566
|
+
*/
|
|
567
|
+
show(info) {
|
|
568
|
+
if (disposed) return;
|
|
569
|
+
latest = info || {};
|
|
570
|
+
if (dialog) render();
|
|
571
|
+
else if (timer === null) timer = setTimeout(open, delayMs);
|
|
572
|
+
},
|
|
573
|
+
/**
|
|
574
|
+
* Take it down: the fetch resolved, one way or the other.
|
|
575
|
+
* @returns {void}
|
|
576
|
+
*/
|
|
577
|
+
hide() {
|
|
578
|
+
if (timer !== null) {
|
|
579
|
+
clearTimeout(timer);
|
|
580
|
+
timer = null;
|
|
581
|
+
}
|
|
582
|
+
latest = null;
|
|
583
|
+
if (!dialog) return;
|
|
584
|
+
try {
|
|
585
|
+
dialog.close();
|
|
586
|
+
} catch (error) {
|
|
587
|
+
}
|
|
588
|
+
dialog.remove();
|
|
589
|
+
dialog = null;
|
|
590
|
+
},
|
|
591
|
+
dispose() {
|
|
592
|
+
disposed = true;
|
|
593
|
+
this.hide();
|
|
594
|
+
}
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
|
|
511
598
|
// src/selection.js
|
|
512
599
|
var httpsURL = (value) => {
|
|
513
600
|
if (typeof value !== "string" || !value.trim()) throw new Error("Expected an HTTPS URL");
|
|
@@ -611,7 +698,7 @@ var parseExtensionCatalog = (data) => {
|
|
|
611
698
|
if (typeof item[field] === "string") metadata[field] = item[field];
|
|
612
699
|
}
|
|
613
700
|
if (item.descriptions && typeof item.descriptions === "object") {
|
|
614
|
-
metadata.descriptions = Object.fromEntries(Object.entries(item.descriptions).filter(([locale,
|
|
701
|
+
metadata.descriptions = Object.fromEntries(Object.entries(item.descriptions).filter(([locale, text2]) => /^[a-z]{2,8}(?:-[a-z0-9]{1,8})*$/.test(locale) && typeof text2 === "string"));
|
|
615
702
|
}
|
|
616
703
|
if (item.banner) metadata.banner = httpsURL(item.banner);
|
|
617
704
|
if (item.repository) metadata.repository = httpsURL(item.repository);
|
package/dist/index.d.ts
CHANGED
|
@@ -41,3 +41,9 @@ export interface ExtensionSelection {
|
|
|
41
41
|
export function resolveExtensionSelection(entries: SelectableExtension[], explicitIds?: Iterable<string>, loadedIds?: Iterable<string>): ExtensionSelection;
|
|
42
42
|
export function parseExtensionCatalog(data: unknown): SelectableExtension[];
|
|
43
43
|
export function loadExtensionCatalog(url: string, signal?: AbortSignal): Promise<SelectableExtension[]>;
|
|
44
|
+
export interface ExtensionWaitDialog {
|
|
45
|
+
show(info: {url?: string; attempt: number; attempts: number}): void;
|
|
46
|
+
hide(): void;
|
|
47
|
+
dispose(): void;
|
|
48
|
+
}
|
|
49
|
+
export function createExtensionWaitDialog(document: Document, locale?: string, options?: {delayMs?: number}): ExtensionWaitDialog;
|
package/dist/index.mjs
CHANGED
|
@@ -182,8 +182,8 @@ import JSZip from "@turbowarp/jszip";
|
|
|
182
182
|
var DATABASE = "tw-extension-security";
|
|
183
183
|
var STORE = "project-preferences";
|
|
184
184
|
var validMode = (mode) => ["deny", "sandboxed", "unsandboxed"].includes(mode);
|
|
185
|
-
var fingerprint = async (
|
|
186
|
-
const bytes = new _TextEncoder().encode(
|
|
185
|
+
var fingerprint = async (text2) => {
|
|
186
|
+
const bytes = new _TextEncoder().encode(text2);
|
|
187
187
|
const digest = await globalThis.crypto.subtle.digest("SHA-256", bytes);
|
|
188
188
|
return Array.from(new Uint8Array(digest), (value) => value.toString(16).padStart(2, "0")).join("");
|
|
189
189
|
};
|
|
@@ -371,6 +371,9 @@ var messages = {
|
|
|
371
371
|
"source": "Source code",
|
|
372
372
|
"sourceFailed": "Could not retrieve source code.",
|
|
373
373
|
"preview": "Preview for {name}",
|
|
374
|
+
"fetchWaitTitle": "Fetching an extension",
|
|
375
|
+
"fetchWaitRetry": "Could not connect. Trying again ({attempt}/{attempts})",
|
|
376
|
+
"fetchWaitNote": "This takes a few seconds. If it keeps failing, loading stops and the project you had open is restored.",
|
|
374
377
|
"warning": "Extensions without a sandbox can access your project and browser information."
|
|
375
378
|
},
|
|
376
379
|
"ja": {
|
|
@@ -450,6 +453,9 @@ var messages = {
|
|
|
450
453
|
"source": "\u30BD\u30FC\u30B9\u30B3\u30FC\u30C9",
|
|
451
454
|
"sourceFailed": "\u30BD\u30FC\u30B9\u30B3\u30FC\u30C9\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002",
|
|
452
455
|
"preview": "{name} \u306E\u30D7\u30EC\u30D3\u30E5\u30FC",
|
|
456
|
+
"fetchWaitTitle": "\u6A5F\u80FD\u62E1\u5F35\u3092\u53D6\u5F97\u3057\u3066\u3044\u307E\u3059",
|
|
457
|
+
"fetchWaitRetry": "\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u518D\u8A66\u884C\u3057\u3066\u3044\u307E\u3059\uFF08{attempt}/{attempts}\uFF09",
|
|
458
|
+
"fetchWaitNote": "\u6570\u79D2\u3067\u7D42\u308F\u308A\u307E\u3059\u3002\u305D\u308C\u3067\u3082\u53D6\u5F97\u3067\u304D\u306A\u3044\u5834\u5408\u306F\u8AAD\u307F\u8FBC\u307F\u3092\u4E2D\u6B62\u3057\u3001\u958B\u3044\u3066\u3044\u305F\u4F5C\u54C1\u306B\u623B\u3057\u307E\u3059\u3002",
|
|
453
459
|
"warning": "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u306E\u62E1\u5F35\u306F\u3001\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3084\u30D6\u30E9\u30A6\u30B6\u30FC\u306E\u60C5\u5831\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u3059\u3002"
|
|
454
460
|
}
|
|
455
461
|
};
|
|
@@ -459,6 +465,86 @@ var formatMessage = (locale, key, values = {}) => {
|
|
|
459
465
|
return template.replace(/\{(\w+)\}/g, (match, name) => String(values[name] === void 0 ? match : values[name]));
|
|
460
466
|
};
|
|
461
467
|
|
|
468
|
+
// src/wait-dialog.js
|
|
469
|
+
var text = (document, tag, value, className) => {
|
|
470
|
+
const element = document.createElement(tag);
|
|
471
|
+
element.textContent = value;
|
|
472
|
+
if (className) element.className = className;
|
|
473
|
+
return element;
|
|
474
|
+
};
|
|
475
|
+
function createExtensionWaitDialog(document, locale = "en", { delayMs = 300 } = {}) {
|
|
476
|
+
let dialog = null;
|
|
477
|
+
let timer = null;
|
|
478
|
+
let latest = null;
|
|
479
|
+
let disposed = false;
|
|
480
|
+
const label = (key) => formatMessage(locale, key, latest || {});
|
|
481
|
+
const render = () => {
|
|
482
|
+
if (!dialog) return;
|
|
483
|
+
dialog.querySelector('[data-twextsec-wait="attempt"]').textContent = label("fetchWaitRetry");
|
|
484
|
+
dialog.querySelector('[data-twextsec-wait="source"]').textContent = latest.url || "";
|
|
485
|
+
};
|
|
486
|
+
const open = () => {
|
|
487
|
+
timer = null;
|
|
488
|
+
if (disposed || dialog || !document || !document.body) return;
|
|
489
|
+
dialog = document.createElement("dialog");
|
|
490
|
+
dialog.className = "twextsec-wait";
|
|
491
|
+
dialog.setAttribute("data-testid", "twextsec-wait");
|
|
492
|
+
dialog.setAttribute("aria-live", "polite");
|
|
493
|
+
dialog.appendChild(text(document, "h2", formatMessage(locale, "fetchWaitTitle")));
|
|
494
|
+
const attempt = text(document, "p", "");
|
|
495
|
+
attempt.setAttribute("data-twextsec-wait", "attempt");
|
|
496
|
+
const source = text(document, "p", "", "twextsec-wait-source");
|
|
497
|
+
source.setAttribute("data-twextsec-wait", "source");
|
|
498
|
+
dialog.append(
|
|
499
|
+
attempt,
|
|
500
|
+
source,
|
|
501
|
+
text(document, "p", formatMessage(locale, "fetchWaitNote"), "twextsec-wait-note")
|
|
502
|
+
);
|
|
503
|
+
dialog.addEventListener("cancel", (event) => event.preventDefault());
|
|
504
|
+
document.body.appendChild(dialog);
|
|
505
|
+
render();
|
|
506
|
+
try {
|
|
507
|
+
if (typeof dialog.showModal === "function") dialog.showModal();
|
|
508
|
+
} catch (error) {
|
|
509
|
+
}
|
|
510
|
+
};
|
|
511
|
+
return Object.freeze({
|
|
512
|
+
/**
|
|
513
|
+
* Report the attempt now being waited for, opening the dialog once the wait looks real.
|
|
514
|
+
* @param {object} info The url, the attempt it leads to, and how many there are in all.
|
|
515
|
+
* @returns {void}
|
|
516
|
+
*/
|
|
517
|
+
show(info) {
|
|
518
|
+
if (disposed) return;
|
|
519
|
+
latest = info || {};
|
|
520
|
+
if (dialog) render();
|
|
521
|
+
else if (timer === null) timer = setTimeout(open, delayMs);
|
|
522
|
+
},
|
|
523
|
+
/**
|
|
524
|
+
* Take it down: the fetch resolved, one way or the other.
|
|
525
|
+
* @returns {void}
|
|
526
|
+
*/
|
|
527
|
+
hide() {
|
|
528
|
+
if (timer !== null) {
|
|
529
|
+
clearTimeout(timer);
|
|
530
|
+
timer = null;
|
|
531
|
+
}
|
|
532
|
+
latest = null;
|
|
533
|
+
if (!dialog) return;
|
|
534
|
+
try {
|
|
535
|
+
dialog.close();
|
|
536
|
+
} catch (error) {
|
|
537
|
+
}
|
|
538
|
+
dialog.remove();
|
|
539
|
+
dialog = null;
|
|
540
|
+
},
|
|
541
|
+
dispose() {
|
|
542
|
+
disposed = true;
|
|
543
|
+
this.hide();
|
|
544
|
+
}
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
|
|
462
548
|
// src/selection.js
|
|
463
549
|
var httpsURL = (value) => {
|
|
464
550
|
if (typeof value !== "string" || !value.trim()) throw new Error("Expected an HTTPS URL");
|
|
@@ -562,7 +648,7 @@ var parseExtensionCatalog = (data) => {
|
|
|
562
648
|
if (typeof item[field] === "string") metadata[field] = item[field];
|
|
563
649
|
}
|
|
564
650
|
if (item.descriptions && typeof item.descriptions === "object") {
|
|
565
|
-
metadata.descriptions = Object.fromEntries(Object.entries(item.descriptions).filter(([locale,
|
|
651
|
+
metadata.descriptions = Object.fromEntries(Object.entries(item.descriptions).filter(([locale, text2]) => /^[a-z]{2,8}(?:-[a-z0-9]{1,8})*$/.test(locale) && typeof text2 === "string"));
|
|
566
652
|
}
|
|
567
653
|
if (item.banner) metadata.banner = httpsURL(item.banner);
|
|
568
654
|
if (item.repository) metadata.repository = httpsURL(item.repository);
|
|
@@ -587,6 +673,7 @@ var loadExtensionCatalog = async (url, signal) => {
|
|
|
587
673
|
return parseExtensionCatalog(await response.json());
|
|
588
674
|
};
|
|
589
675
|
export {
|
|
676
|
+
createExtensionWaitDialog,
|
|
590
677
|
decodeExtensionDataURL,
|
|
591
678
|
encodeChoices,
|
|
592
679
|
fingerprint,
|
package/dist/react.cjs
CHANGED
|
@@ -486,6 +486,9 @@ var messages = {
|
|
|
486
486
|
"source": "Source code",
|
|
487
487
|
"sourceFailed": "Could not retrieve source code.",
|
|
488
488
|
"preview": "Preview for {name}",
|
|
489
|
+
"fetchWaitTitle": "Fetching an extension",
|
|
490
|
+
"fetchWaitRetry": "Could not connect. Trying again ({attempt}/{attempts})",
|
|
491
|
+
"fetchWaitNote": "This takes a few seconds. If it keeps failing, loading stops and the project you had open is restored.",
|
|
489
492
|
"warning": "Extensions without a sandbox can access your project and browser information."
|
|
490
493
|
},
|
|
491
494
|
"ja": {
|
|
@@ -565,6 +568,9 @@ var messages = {
|
|
|
565
568
|
"source": "\u30BD\u30FC\u30B9\u30B3\u30FC\u30C9",
|
|
566
569
|
"sourceFailed": "\u30BD\u30FC\u30B9\u30B3\u30FC\u30C9\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002",
|
|
567
570
|
"preview": "{name} \u306E\u30D7\u30EC\u30D3\u30E5\u30FC",
|
|
571
|
+
"fetchWaitTitle": "\u6A5F\u80FD\u62E1\u5F35\u3092\u53D6\u5F97\u3057\u3066\u3044\u307E\u3059",
|
|
572
|
+
"fetchWaitRetry": "\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u518D\u8A66\u884C\u3057\u3066\u3044\u307E\u3059\uFF08{attempt}/{attempts}\uFF09",
|
|
573
|
+
"fetchWaitNote": "\u6570\u79D2\u3067\u7D42\u308F\u308A\u307E\u3059\u3002\u305D\u308C\u3067\u3082\u53D6\u5F97\u3067\u304D\u306A\u3044\u5834\u5408\u306F\u8AAD\u307F\u8FBC\u307F\u3092\u4E2D\u6B62\u3057\u3001\u958B\u3044\u3066\u3044\u305F\u4F5C\u54C1\u306B\u623B\u3057\u307E\u3059\u3002",
|
|
568
574
|
"warning": "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u306E\u62E1\u5F35\u306F\u3001\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3084\u30D6\u30E9\u30A6\u30B6\u30FC\u306E\u60C5\u5831\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u3059\u3002"
|
|
569
575
|
}
|
|
570
576
|
};
|
|
@@ -575,7 +581,7 @@ var formatMessage = (locale, key, values = {}) => {
|
|
|
575
581
|
};
|
|
576
582
|
|
|
577
583
|
// src/package-description.jsx
|
|
578
|
-
var commonBanner = "data:image/svg+xml;base64,
|
|
584
|
+
var commonBanner = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMDAiIGhlaWdodD0iMzAwIiB2aWV3Qm94PSIwIDAgMzAwIDMwMCIgcm9sZT0iaW1nIiBhcmlhLWxhYmVsPSJUdXJib1dhcnAtUGx1cyBleHRlbnNpb24iPjx0aXRsZT5UdXJib1dhcnAtUGx1cyBleHRlbnNpb248L3RpdGxlPjxwYXRoIGZpbGw9IiMwZmJkOGMiIGQ9Ik0zMyA4MkM1NSA3OCA4NCA3OSAxMDYgODJDMTA2IDY3IDkwIDY5IDkwIDU0QzkwIDMyIDE3NCAzMCAxNzQgNTRDMTc0IDY5IDE1OCA2NiAxNTggODJDMTc1IDg2IDE5NiA4NSAyMTMgODJDMjE3IDk5IDIxNiAxMTUgMjEzIDEzMEMyMzAgMTMwIDIyNyAxMTQgMjQ1IDExNEMyNzEgMTE0IDI2OSAyMDYgMjQ1IDIwNkMyMjcgMjA2IDIzMCAxOTAgMjEzIDE5MEMyMDkgMjEwIDIxMCAyNDAgMjEzIDI2MkMyMDMgMjY1IDE4OCAyNjYgMTc0IDI2MkMxNzQgMjQ4IDE4OCAyNTAgMTg4IDIzNkMxODggMjE2IDExMiAyMTQgMTEyIDIzNkMxMTIgMjUwIDEyNiAyNDcgMTI2IDI2MkMxMDggMjU4IDYwIDI1OSAzMyAyNjJDMjkgMjQ1IDMwIDIyNSAzMyAyMDlDNDkgMjA5IDQ2IDIyNSA2MiAyMjVDODYgMjI1IDg0IDEzNyA2MiAxMzdDNDYgMTM3IDQ5IDE1MyAzMyAxNTNDMzcgMTMzIDM2IDEwNSAzMyA4MloiLz48cGF0aCBmaWxsPSIjZmZmIiBkPSJNOTMuNyAxMDBMMjAxLjcgMTAwTDE5OS45IDEyNkwxODkuOSAxMjZDMTkwLjMgMTIwIDE4OC45IDExMiAxODUuMSAxMDlMMTU5LjEgMTA5TDE1My4xIDE5NEMxNTIuNSAyMDMgMTU3LjMgMjA2IDE2OC4yIDIwN0wxNjggMjEwTDExMiAyMTBMMTEyLjIgMjA3QzEyMy4zIDIwNiAxMjguNSAyMDMgMTI5LjEgMTk0TDEzNS4xIDEwOUwxMDkuMSAxMDlDMTA0LjkgMTEyIDEwMi4zIDEyMCAxMDEuOSAxMjZMOTEuOSAxMjZaIi8+PC9zdmc+Cg==";
|
|
579
585
|
var requiresUnsandboxed = (metadata) => metadata && typeof metadata.unsandboxed === "string" && metadata.unsandboxed.trim().toLowerCase() === "required";
|
|
580
586
|
var resolveSharedPackageMetadata = (entry, sourceMetadata = {}) => {
|
|
581
587
|
const catalog = entry.metadata || {};
|
package/dist/react.mjs
CHANGED
|
@@ -454,6 +454,9 @@ var messages = {
|
|
|
454
454
|
"source": "Source code",
|
|
455
455
|
"sourceFailed": "Could not retrieve source code.",
|
|
456
456
|
"preview": "Preview for {name}",
|
|
457
|
+
"fetchWaitTitle": "Fetching an extension",
|
|
458
|
+
"fetchWaitRetry": "Could not connect. Trying again ({attempt}/{attempts})",
|
|
459
|
+
"fetchWaitNote": "This takes a few seconds. If it keeps failing, loading stops and the project you had open is restored.",
|
|
457
460
|
"warning": "Extensions without a sandbox can access your project and browser information."
|
|
458
461
|
},
|
|
459
462
|
"ja": {
|
|
@@ -533,6 +536,9 @@ var messages = {
|
|
|
533
536
|
"source": "\u30BD\u30FC\u30B9\u30B3\u30FC\u30C9",
|
|
534
537
|
"sourceFailed": "\u30BD\u30FC\u30B9\u30B3\u30FC\u30C9\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002",
|
|
535
538
|
"preview": "{name} \u306E\u30D7\u30EC\u30D3\u30E5\u30FC",
|
|
539
|
+
"fetchWaitTitle": "\u6A5F\u80FD\u62E1\u5F35\u3092\u53D6\u5F97\u3057\u3066\u3044\u307E\u3059",
|
|
540
|
+
"fetchWaitRetry": "\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u518D\u8A66\u884C\u3057\u3066\u3044\u307E\u3059\uFF08{attempt}/{attempts}\uFF09",
|
|
541
|
+
"fetchWaitNote": "\u6570\u79D2\u3067\u7D42\u308F\u308A\u307E\u3059\u3002\u305D\u308C\u3067\u3082\u53D6\u5F97\u3067\u304D\u306A\u3044\u5834\u5408\u306F\u8AAD\u307F\u8FBC\u307F\u3092\u4E2D\u6B62\u3057\u3001\u958B\u3044\u3066\u3044\u305F\u4F5C\u54C1\u306B\u623B\u3057\u307E\u3059\u3002",
|
|
536
542
|
"warning": "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u306E\u62E1\u5F35\u306F\u3001\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3084\u30D6\u30E9\u30A6\u30B6\u30FC\u306E\u60C5\u5831\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u3059\u3002"
|
|
537
543
|
}
|
|
538
544
|
};
|
|
@@ -543,7 +549,7 @@ var formatMessage = (locale, key, values = {}) => {
|
|
|
543
549
|
};
|
|
544
550
|
|
|
545
551
|
// src/package-description.jsx
|
|
546
|
-
var commonBanner = "data:image/svg+xml;base64,
|
|
552
|
+
var commonBanner = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMDAiIGhlaWdodD0iMzAwIiB2aWV3Qm94PSIwIDAgMzAwIDMwMCIgcm9sZT0iaW1nIiBhcmlhLWxhYmVsPSJUdXJib1dhcnAtUGx1cyBleHRlbnNpb24iPjx0aXRsZT5UdXJib1dhcnAtUGx1cyBleHRlbnNpb248L3RpdGxlPjxwYXRoIGZpbGw9IiMwZmJkOGMiIGQ9Ik0zMyA4MkM1NSA3OCA4NCA3OSAxMDYgODJDMTA2IDY3IDkwIDY5IDkwIDU0QzkwIDMyIDE3NCAzMCAxNzQgNTRDMTc0IDY5IDE1OCA2NiAxNTggODJDMTc1IDg2IDE5NiA4NSAyMTMgODJDMjE3IDk5IDIxNiAxMTUgMjEzIDEzMEMyMzAgMTMwIDIyNyAxMTQgMjQ1IDExNEMyNzEgMTE0IDI2OSAyMDYgMjQ1IDIwNkMyMjcgMjA2IDIzMCAxOTAgMjEzIDE5MEMyMDkgMjEwIDIxMCAyNDAgMjEzIDI2MkMyMDMgMjY1IDE4OCAyNjYgMTc0IDI2MkMxNzQgMjQ4IDE4OCAyNTAgMTg4IDIzNkMxODggMjE2IDExMiAyMTQgMTEyIDIzNkMxMTIgMjUwIDEyNiAyNDcgMTI2IDI2MkMxMDggMjU4IDYwIDI1OSAzMyAyNjJDMjkgMjQ1IDMwIDIyNSAzMyAyMDlDNDkgMjA5IDQ2IDIyNSA2MiAyMjVDODYgMjI1IDg0IDEzNyA2MiAxMzdDNDYgMTM3IDQ5IDE1MyAzMyAxNTNDMzcgMTMzIDM2IDEwNSAzMyA4MloiLz48cGF0aCBmaWxsPSIjZmZmIiBkPSJNOTMuNyAxMDBMMjAxLjcgMTAwTDE5OS45IDEyNkwxODkuOSAxMjZDMTkwLjMgMTIwIDE4OC45IDExMiAxODUuMSAxMDlMMTU5LjEgMTA5TDE1My4xIDE5NEMxNTIuNSAyMDMgMTU3LjMgMjA2IDE2OC4yIDIwN0wxNjggMjEwTDExMiAyMTBMMTEyLjIgMjA3QzEyMy4zIDIwNiAxMjguNSAyMDMgMTI5LjEgMTk0TDEzNS4xIDEwOUwxMDkuMSAxMDlDMTA0LjkgMTEyIDEwMi4zIDEyMCAxMDEuOSAxMjZMOTEuOSAxMjZaIi8+PC9zdmc+Cg==";
|
|
547
553
|
var requiresUnsandboxed = (metadata) => metadata && typeof metadata.unsandboxed === "string" && metadata.unsandboxed.trim().toLowerCase() === "required";
|
|
548
554
|
var resolveSharedPackageMetadata = (entry, sourceMetadata = {}) => {
|
|
549
555
|
const catalog = entry.metadata || {};
|
package/package.json
CHANGED
package/styles.css
CHANGED
|
@@ -207,3 +207,16 @@
|
|
|
207
207
|
.twextsec-resize[data-edge="ne"], .twextsec-resize[data-edge="sw"] { cursor: nesw-resize; }
|
|
208
208
|
.twextsec-resize[data-edge="nw"], .twextsec-resize[data-edge="se"] { cursor: nwse-resize; }
|
|
209
209
|
[data-twextsec-maximized] > .twextsec-resize { display: none; }
|
|
210
|
+
|
|
211
|
+
/* A wait the person cannot act on takes the middle of the screen, where the approval dialog that
|
|
212
|
+
follows appears too. Native dialog auto margins follow an overflowing host layout, so centre it
|
|
213
|
+
with viewport units the way the host's own permission dialog does. */
|
|
214
|
+
.twextsec-wait { position: fixed; left: 50vw; top: 50vh; right: auto; bottom: auto; margin: 0; transform: translate(-50%, -50%); box-sizing: border-box; width: min(440px, calc(100vw - 32px)); border: 1px solid var(--ui-black-transparent, #0000001a); border-radius: 12px; padding: 20px 24px; color: var(--ui-modal-foreground, #263145); background: var(--ui-modal-background, #fff); box-shadow: 0 16px 48px #0000004d; font: inherit; }
|
|
215
|
+
.twextsec-wait::backdrop { background: #111827a6; }
|
|
216
|
+
/* showModal focuses the dialog itself because nothing inside it is focusable. The ring marks a
|
|
217
|
+
place the keyboard cannot go, so drop it; the backdrop already shows what has the screen. */
|
|
218
|
+
.twextsec-wait:focus, .twextsec-wait:focus-visible { outline: none; }
|
|
219
|
+
.twextsec-wait h2 { margin: 0 0 10px; font-size: 1.05em; }
|
|
220
|
+
.twextsec-wait p { margin: 0 0 8px; }
|
|
221
|
+
.twextsec-wait-source { overflow-wrap: anywhere; font-size: .85em; opacity: .7; }
|
|
222
|
+
.twextsec-wait-note { margin-bottom: 0; font-size: .9em; opacity: .8; }
|
package/webpack4.css
CHANGED
|
@@ -207,3 +207,16 @@
|
|
|
207
207
|
:global(.twextsec-resize)[data-edge="ne"], :global(.twextsec-resize)[data-edge="sw"] { cursor: nesw-resize; }
|
|
208
208
|
:global(.twextsec-resize)[data-edge="nw"], :global(.twextsec-resize)[data-edge="se"] { cursor: nwse-resize; }
|
|
209
209
|
[data-twextsec-maximized] > :global(.twextsec-resize) { display: none; }
|
|
210
|
+
|
|
211
|
+
/* A wait the person cannot act on takes the middle of the screen, where the approval dialog that
|
|
212
|
+
follows appears too. Native dialog auto margins follow an overflowing host layout, so centre it
|
|
213
|
+
with viewport units the way the host's own permission dialog does. */
|
|
214
|
+
:global(.twextsec-wait) { position: fixed; left: 50vw; top: 50vh; right: auto; bottom: auto; margin: 0; transform: translate(-50%, -50%); box-sizing: border-box; width: min(440px, calc(100vw - 32px)); border: 1px solid var(--ui-black-transparent, #0000001a); border-radius: 12px; padding: 20px 24px; color: var(--ui-modal-foreground, #263145); background: var(--ui-modal-background, #fff); box-shadow: 0 16px 48px #0000004d; font: inherit; }
|
|
215
|
+
:global(.twextsec-wait)::backdrop { background: #111827a6; }
|
|
216
|
+
/* showModal focuses the dialog itself because nothing inside it is focusable. The ring marks a
|
|
217
|
+
place the keyboard cannot go, so drop it; the backdrop already shows what has the screen. */
|
|
218
|
+
:global(.twextsec-wait):focus, :global(.twextsec-wait):focus-visible { outline: none; }
|
|
219
|
+
:global(.twextsec-wait) h2 { margin: 0 0 10px; font-size: 1.05em; }
|
|
220
|
+
:global(.twextsec-wait) p { margin: 0 0 8px; }
|
|
221
|
+
:global(.twextsec-wait-source) { overflow-wrap: anywhere; font-size: .85em; opacity: .7; }
|
|
222
|
+
:global(.twextsec-wait-note) { margin-bottom: 0; font-size: .9em; opacity: .8; }
|