@kubohiroya/turbowarp-extension-security-dialog 0.8.1 → 0.8.3
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 +16 -2
- package/README.ja.md +22 -4
- package/README.md +23 -4
- package/dist/build-info.json +2 -2
- package/dist/index.cjs +22 -24
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +22 -24
- package/dist/react.cjs +77 -44
- package/dist/react.mjs +77 -44
- package/dist/turbowarp.cjs +33 -1
- package/dist/turbowarp.mjs +33 -1
- package/package.json +1 -1
- package/styles.css +29 -8
- package/webpack4.css +29 -8
package/NOTICE.md
CHANGED
|
@@ -12,19 +12,33 @@ original to this package: a jigsaw piece outline with a serif T, drawn for it an
|
|
|
12
12
|
other work. `scripts/build.mjs` embeds it into `dist` as a base64 data URI, so it travels in the
|
|
13
13
|
published package.
|
|
14
14
|
|
|
15
|
+
`assets/trusted.svg` is the mark beside an extension the host trusts: the TurboWarp Plus mark (the
|
|
16
|
+
hat block with a warp swirl and a plus sign, drawn by the same author for the TurboWarp-Plus Editor)
|
|
17
|
+
with a green check over it. It is embedded into `dist` the same way.
|
|
18
|
+
|
|
15
19
|
## Build provenance
|
|
16
20
|
|
|
17
21
|
Published archives include `dist/build-info.json` with this package's name, version and full Git
|
|
18
22
|
revision. `sourceState: "commit"` identifies a build from committed inputs; `"working-tree"` marks
|
|
19
|
-
a local build with changes to those inputs.
|
|
23
|
+
a local build with changes to those inputs. `"git-archive"` identifies npm preparing a fixed GitHub
|
|
24
|
+
archive without `.git`; the installer supplies its locked full SHA in `TWEXTSEC_SOURCE_REVISION`
|
|
25
|
+
and verifies that pin against the installed build info. A missing or malformed SHA fails the build.
|
|
26
|
+
This file records provenance, without changing the
|
|
20
27
|
licenses described here.
|
|
21
28
|
|
|
22
29
|
## Screenshots kept in this repository
|
|
23
30
|
|
|
24
|
-
`assets/screenshots/` holds captures of the public Editor
|
|
31
|
+
`assets/screenshots/` holds historical captures and current captures of the public Editor. They are
|
|
25
32
|
**not published**: `files` in `package.json` does not include `assets`, so they stay in the
|
|
26
33
|
repository and never reach npm.
|
|
27
34
|
|
|
28
35
|
They are also **not covered by this package's licence**. The captured interface, icons and banners
|
|
29
36
|
keep their own rights holders and their own terms. Their origin, the Editor revisions they were
|
|
30
37
|
taken from and their hashes are recorded in the JSON files beside them.
|
|
38
|
+
|
|
39
|
+
`assets/screenshots/all-required-open-{en,ja}-20261103.png` show the public TurboWarp-Plus-Editor on
|
|
40
|
+
3 November 2026 with the sole required execution mode preselected, before OK and before any extension runs.
|
|
41
|
+
The source distributions are Camera Source 0.19.4, Asset Cache 0.3.2 and Bubble 0.13.5. The images are
|
|
42
|
+
unmodified browser captures; source integrity, Editor revisions, image hashes and checks are recorded in
|
|
43
|
+
`assets/screenshots/all-required-open-20261103.json`. The captured interface and extension graphics retain
|
|
44
|
+
their respective rights holders and applicable licenses.
|
package/README.ja.md
CHANGED
|
@@ -14,6 +14,19 @@ VM は機能拡張を1つずつ読み込み、そのたびに尋ねます。作
|
|
|
14
14
|
|
|
15
15
|
このパッケージは作品全体をまとめて集め、1つの問いにして、そのあとで読み込みます。
|
|
16
16
|
|
|
17
|
+
## 公開Editorのスクリーンショット
|
|
18
|
+
|
|
19
|
+
2026年11月3日の[公開Editor](https://kubohiroya.github.io/turbowarp-plus-editor/editor.html?lang=ja)で、
|
|
20
|
+
配布済みのCamera Source 0.19.4・Asset Cache 0.3.2・Bubble 0.13.5を開いた実画面です。
|
|
21
|
+
3件すべてが「サンドボックスなし」を必須と申告しているため、その選択肢だけを選択済みで表示します。
|
|
22
|
+
「動かさない」「サンドボックスの中で」と実行方法の一括指定は表示せず、OKで実行するかキャンセルで中止します。
|
|
23
|
+
OK前にはどの拡張も実行していません。
|
|
24
|
+
|
|
25
|
+

|
|
26
|
+
|
|
27
|
+
同じダイアログの[英語版](./README.md)も撮影しました。画像はダイアログ部分を無加工で撮影したもので、
|
|
28
|
+
配布物と画像のhash・Editorの固定revision・日英の確認結果を[撮影台帳](./assets/screenshots/all-required-open-20261103.json)に記録しています。
|
|
29
|
+
|
|
17
30
|
## 入口
|
|
18
31
|
|
|
19
32
|
| import | 中身 |
|
|
@@ -71,10 +84,13 @@ import '@kubohiroya/turbowarp-extension-security-dialog/styles.css';
|
|
|
71
84
|
|
|
72
85
|
### しないこと
|
|
73
86
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
87
|
+
**作品を開くとき、全件がサンドボックスなしを必須と申告していれば、そのモードを選択済みにします。**
|
|
88
|
+
取得失敗がなく、空でない一覧のすべての申告が揃った場合だけ適用します。「動かさない」と
|
|
89
|
+
「サンドボックスの中で」、実行方法の一括指定は表示しません。OKで実行を承認するか、キャンセルで
|
|
90
|
+
中止します。OK前には実行しません。読み込み元や控えを断る選択は別に保ちます。
|
|
91
|
+
|
|
92
|
+
カタログからの追加、通常・未申告・任意指定・取得失敗が混ざる作品では、従来どおり
|
|
93
|
+
サンドボックスの中を既定にし、実行方法を選べます。必須の申告に反する選択は警告します。
|
|
78
94
|
|
|
79
95
|
**信頼済みの行は、尋ねずに述べます。** カタログに載っている拡張はホストの標準ギャラリーと同じ
|
|
80
96
|
扱いで、サンドボックスなしで動き、実行の選択肢を出しません。信頼済みの行だけの作品は止める
|
|
@@ -198,3 +214,5 @@ React と React DOM は peerDependencies なので、ホストが用意します
|
|
|
198
214
|
[MPL-2.0](LICENSE)。何が対象で何が対象外かは [NOTICE.md](./NOTICE.md) を参照してください。
|
|
199
215
|
|
|
200
216
|
0.6.0でMPL-2.0へ書き直したときの設計の記録は [書き直しの設計](docs/mpl-rewrite.ja.md) にあります。
|
|
217
|
+
|
|
218
|
+
npmが固定したGitHubアーカイブを`.git`なしでビルドする場合、インストーラーはlockfileと同じ完全SHAを`TWEXTSEC_SOURCE_REVISION`で渡します。`sourceState: "git-archive"`として記録し、完全SHAがなければビルドを拒否します。ホストはインストール後の記録をmanifest・lockfileと照合します。
|
package/README.md
CHANGED
|
@@ -15,6 +15,20 @@ an extension asks twice: once to pick it, once to allow it.
|
|
|
15
15
|
|
|
16
16
|
This package collects the whole project, puts one question, and only then loads anything.
|
|
17
17
|
|
|
18
|
+
## Public Editor screenshots
|
|
19
|
+
|
|
20
|
+
This is the [public Editor](https://kubohiroya.github.io/turbowarp-plus-editor/editor.html?lang=en) on
|
|
21
|
+
3 November 2026, opening the published Camera Source 0.19.4, Asset Cache 0.3.2 and Bubble 0.13.5 bundles.
|
|
22
|
+
All three declare unsandboxed execution required, so that is the only execution choice shown and is already selected.
|
|
23
|
+
The other two execution choices and execution bulk control are absent. OK runs the extensions; Cancel stops loading.
|
|
24
|
+
No extension has run before OK.
|
|
25
|
+
|
|
26
|
+

|
|
27
|
+
|
|
28
|
+
The same dialog was captured in [Japanese](./README.ja.md). These are unmodified dialog-only browser captures.
|
|
29
|
+
Distribution and image hashes, pinned Editor revisions and the checks for both languages are recorded in
|
|
30
|
+
[the capture manifest](./assets/screenshots/all-required-open-20261103.json).
|
|
31
|
+
|
|
18
32
|
## Entry points
|
|
19
33
|
|
|
20
34
|
| Import | What it is |
|
|
@@ -74,10 +88,13 @@ screen states it instead of asking.
|
|
|
74
88
|
|
|
75
89
|
### What it will not do
|
|
76
90
|
|
|
77
|
-
**
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
91
|
+
**When opening a project whose extensions all declare unsandboxed execution required, that mode is preselected.**
|
|
92
|
+
This applies only to a non-empty list with every declaration available and no failed row. The other two
|
|
93
|
+
execution choices and the execution bulk control are hidden. OK approves execution; Cancel stops it.
|
|
94
|
+
Nothing runs before OK. Loading-source and cache-decline choices remain independent.
|
|
95
|
+
|
|
96
|
+
Adding from the catalog, or opening a mixed, optional, undeclared or failed batch, keeps the sandbox
|
|
97
|
+
as the default and leaves the execution choices available. A choice contradicting a declaration is warned about.
|
|
81
98
|
|
|
82
99
|
**A trusted row is stated, not asked about.** An extension the catalog lists is treated like the
|
|
83
100
|
host's own gallery: it runs without the sandbox and offers no execution choice. A project with
|
|
@@ -209,3 +226,5 @@ dependencies.
|
|
|
209
226
|
[MPL-2.0](LICENSE). See [NOTICE.md](./NOTICE.md) for what is and is not covered.
|
|
210
227
|
|
|
211
228
|
The design record of the MPL-2.0 rewrite in 0.6.0 is in [the rewrite design (Japanese)](docs/mpl-rewrite.ja.md).
|
|
229
|
+
|
|
230
|
+
When npm prepares a pinned GitHub archive without `.git`, the installer must pass its locked full SHA as `TWEXTSEC_SOURCE_REVISION`. The build records `sourceState: "git-archive"` and fails without a full SHA; the host verifies it against its manifest and lockfile.
|
package/dist/build-info.json
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -33,6 +33,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
33
33
|
// src/index.js
|
|
34
34
|
var index_exports = {};
|
|
35
35
|
__export(index_exports, {
|
|
36
|
+
allRequireUnsandboxed: () => allRequireUnsandboxed,
|
|
36
37
|
contradictsDeclaration: () => contradictsDeclaration,
|
|
37
38
|
createDecisionStorage: () => createDecisionStorage,
|
|
38
39
|
createExtensionWaitDialog: () => createExtensionWaitDialog,
|
|
@@ -156,7 +157,9 @@ function parseExtensionCatalog(data) {
|
|
|
156
157
|
ids: [id],
|
|
157
158
|
url,
|
|
158
159
|
dependencies: Object.freeze(dependencies.map((value) => string(value, "dependency", 128))),
|
|
159
|
-
|
|
160
|
+
// The dashboard catalog states name, description, creator and banner beside the URL.
|
|
161
|
+
// A nested `metadata` object, the older shape, still wins where it says something.
|
|
162
|
+
metadata: Object.freeze(metadataOf(__spreadValues(__spreadValues({}, source), source.metadata === void 0 ? {} : object(source.metadata, "metadata"))))
|
|
160
163
|
};
|
|
161
164
|
if (source.sha256 !== void 0) {
|
|
162
165
|
entry.sha256 = string(source.sha256, "sha256", 64);
|
|
@@ -487,6 +490,9 @@ function createPreviewCache() {
|
|
|
487
490
|
|
|
488
491
|
// src/decisions.js
|
|
489
492
|
var isTrusted = (entry) => Boolean(entry && entry.state && entry.state.trusted);
|
|
493
|
+
var allRequireUnsandboxed = (entries) => entries.length > 0 && entries.every(
|
|
494
|
+
(entry) => !(entry.state && entry.state.error) && unsandboxedRequirement(entry.metadata || {}) === "required"
|
|
495
|
+
);
|
|
490
496
|
var loadingModes = Object.freeze([
|
|
491
497
|
"remote-cacheable",
|
|
492
498
|
"remote-non-cacheable",
|
|
@@ -507,11 +513,13 @@ function initialDecisions(entries, mode, {
|
|
|
507
513
|
recorded = /* @__PURE__ */ new Map(),
|
|
508
514
|
fallbackLoading = "remote-cacheable"
|
|
509
515
|
} = {}) {
|
|
516
|
+
const allRequired = mode === "open" && allRequireUnsandboxed(entries);
|
|
510
517
|
return new Map(entries.map((entry) => {
|
|
511
518
|
const base = defaultDecision(entry, mode, fallbackLoading);
|
|
519
|
+
if (allRequired) base.execution = "unsandboxed";
|
|
512
520
|
const previous = recorded.get(entry.key);
|
|
513
521
|
if (!previous) return [entry.key, base];
|
|
514
|
-
const execution = executionChoices(entry, mode).includes(previous.execution) ? previous.execution : base.execution;
|
|
522
|
+
const execution = !allRequired && executionChoices(entry, mode).includes(previous.execution) ? previous.execution : base.execution;
|
|
515
523
|
const loading = loadingChoices(entry).includes(previous.loading) ? previous.loading : base.loading;
|
|
516
524
|
return [entry.key, loading === void 0 ? { execution } : { execution, loading }];
|
|
517
525
|
}));
|
|
@@ -526,6 +534,7 @@ var messages = {
|
|
|
526
534
|
openTitle: "This project wants to run extensions",
|
|
527
535
|
addIntro: "Choose what to add. Anything a chosen extension needs is selected for you.",
|
|
528
536
|
openIntro: "Decide how each one may run before the project starts. Nothing runs until you choose.",
|
|
537
|
+
allRequiredIntro: "All extensions say they need to run without the sandbox. That mode is already selected. Choose OK to run them, or Cancel to stop. Nothing runs before OK.",
|
|
529
538
|
execution: "How it runs",
|
|
530
539
|
loading: "Where it loads from",
|
|
531
540
|
executionBulk: "How they all run",
|
|
@@ -541,25 +550,19 @@ var messages = {
|
|
|
541
550
|
"loading-embedded-data": "In the project, as a data address",
|
|
542
551
|
loadingNote: "A kept copy is verified and reused, so the project opens without the network. Fetching each time leaves nothing in this browser.",
|
|
543
552
|
unsandboxedWarning: "Without the sandbox, an extension can reach the project, the editor and this site\u2019s data. Choose it only for code you trust.",
|
|
544
|
-
"requirement-required": "
|
|
545
|
-
|
|
546
|
-
"requirement-not-needed": "Says the sandbox is fine",
|
|
547
|
-
"requirement-unknown": "Says nothing about the sandbox",
|
|
548
|
-
trusted: "Listed in the catalog, so it runs without the sandbox",
|
|
553
|
+
"requirement-required": "\u26A0\uFE0F Needs to run without the sandbox",
|
|
554
|
+
trusted: "Trusted by TurboWarp Plus: runs without the sandbox",
|
|
549
555
|
trustedNote: "Catalog extensions are treated like TurboWarp\u2019s own gallery and are not asked about.",
|
|
550
|
-
"state-loaded": "Already running",
|
|
551
|
-
"state-
|
|
552
|
-
"state-dependency": "Needed by {names}",
|
|
553
|
-
"state-unselected": "Not chosen",
|
|
556
|
+
"state-loaded": "\u25B6\uFE0F Already running",
|
|
557
|
+
"state-dependency": "\u{1F517} Needed by {names}",
|
|
554
558
|
sourceEmbedded: "Stored in the project",
|
|
555
559
|
sourceLegacy: "A custom extension address",
|
|
556
560
|
sourceInline: "Written into the project as a data address",
|
|
557
|
-
creator: "Creator",
|
|
561
|
+
creator: "Creator (unverified claim)",
|
|
558
562
|
creatorUnknown: "Not stated",
|
|
559
563
|
licenseUnknown: "Not stated",
|
|
560
564
|
version: "Version",
|
|
561
565
|
digest: "SHA-256",
|
|
562
|
-
unverified: "The creator\u2019s name is the extension\u2019s own claim and is not verified.",
|
|
563
566
|
failed: "Could not be loaded",
|
|
564
567
|
retryNote: "This may be a network problem.",
|
|
565
568
|
retry: "Try again",
|
|
@@ -576,6 +579,7 @@ var messages = {
|
|
|
576
579
|
openTitle: "\u3053\u306E\u4F5C\u54C1\u306F\u6A5F\u80FD\u62E1\u5F35\u3092\u4F7F\u3044\u307E\u3059",
|
|
577
580
|
addIntro: "\u8FFD\u52A0\u3059\u308B\u3082\u306E\u3092\u9078\u3093\u3067\u304F\u3060\u3055\u3044\u3002\u9078\u3093\u3060\u62E1\u5F35\u304C\u5FC5\u8981\u3068\u3059\u308B\u3082\u306E\u306F\u81EA\u52D5\u3067\u9078\u3070\u308C\u307E\u3059\u3002",
|
|
578
581
|
openIntro: "\u4F5C\u54C1\u304C\u52D5\u304D\u51FA\u3059\u524D\u306B\u3001\u3069\u3053\u307E\u3067\u52D5\u304B\u3059\u304B\u3092\u6C7A\u3081\u3066\u304F\u3060\u3055\u3044\u3002\u6C7A\u3081\u308B\u307E\u3067\u4F55\u3082\u52D5\u304D\u307E\u305B\u3093\u3002",
|
|
582
|
+
allRequiredIntro: "\u3059\u3079\u3066\u306E\u6A5F\u80FD\u62E1\u5F35\u304C\u300C\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u300D\u3092\u5FC5\u8981\u3068\u7533\u544A\u3057\u3066\u3044\u308B\u305F\u3081\u3001\u9078\u629E\u6E08\u307F\u3067\u3059\u3002\u300COK\u300D\u3067\u5B9F\u884C\u3059\u308B\u304B\u3001\u300C\u30AD\u30E3\u30F3\u30BB\u30EB\u300D\u3067\u4E2D\u6B62\u3057\u3066\u304F\u3060\u3055\u3044\u3002OK\u307E\u3067\u306F\u5B9F\u884C\u3057\u307E\u305B\u3093\u3002",
|
|
579
583
|
execution: "\u52D5\u304B\u3057\u65B9",
|
|
580
584
|
loading: "\u8AAD\u307F\u8FBC\u307F\u5143",
|
|
581
585
|
executionBulk: "\u3059\u3079\u3066\u306E\u52D5\u304B\u3057\u65B9",
|
|
@@ -589,25 +593,19 @@ var messages = {
|
|
|
589
593
|
"loading-embedded-data": "\u4F5C\u54C1\u306E\u4E2D\u306E data: \u30A2\u30C9\u30EC\u30B9\u304B\u3089",
|
|
590
594
|
loadingNote: "\u63A7\u3048\u306F\u691C\u8A3C\u3057\u305F\u3046\u3048\u3067\u4F7F\u3044\u56DE\u3059\u306E\u3067\u3001\u901A\u4FE1\u306A\u3057\u3067\u3082\u4F5C\u54C1\u304C\u958B\u304D\u307E\u3059\u3002\u6BCE\u56DE\u53D6\u5F97\u3059\u308B\u5834\u5408\u306F\u3001\u3053\u306E\u30D6\u30E9\u30A6\u30B6\u30FC\u306B\u4F55\u3082\u6B8B\u308A\u307E\u305B\u3093\u3002",
|
|
591
595
|
unsandboxedWarning: "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u306E\u62E1\u5F35\u306F\u3001\u4F5C\u54C1\u30FB\u30A8\u30C7\u30A3\u30BF\u30FC\u30FB\u3053\u306E\u30B5\u30A4\u30C8\u306E\u30C7\u30FC\u30BF\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u3059\u3002\u4FE1\u983C\u3067\u304D\u308B\u30B3\u30FC\u30C9\u306B\u3060\u3051\u9078\u3093\u3067\u304F\u3060\u3055\u3044\u3002",
|
|
592
|
-
"requirement-required": "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u304C\u5FC5\u8981
|
|
593
|
-
|
|
594
|
-
"requirement-not-needed": "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u3067\u554F\u984C\u306A\u3044\u3068\u7533\u544A\u3057\u3066\u3044\u307E\u3059",
|
|
595
|
-
"requirement-unknown": "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306B\u3064\u3044\u3066\u7533\u544A\u304C\u3042\u308A\u307E\u305B\u3093",
|
|
596
|
-
trusted: "\u30AB\u30BF\u30ED\u30B0\u306B\u63B2\u8F09\u3055\u308C\u3066\u3044\u308B\u306E\u3067\u3001\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u3067\u52D5\u304D\u307E\u3059",
|
|
596
|
+
"requirement-required": "\u26A0\uFE0F \u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u304C\u5FC5\u8981",
|
|
597
|
+
trusted: "TurboWarp Plus \u304C\u4FE1\u983C\u3059\u308B\u62E1\u5F35\uFF1A\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u3067\u52D5\u304D\u307E\u3059",
|
|
597
598
|
trustedNote: "\u30AB\u30BF\u30ED\u30B0\u306E\u62E1\u5F35\u306F TurboWarp \u306E\u6A19\u6E96\u30AE\u30E3\u30E9\u30EA\u30FC\u3068\u540C\u3058\u6271\u3044\u3067\u3001\u78BA\u8A8D\u3092\u6C42\u3081\u307E\u305B\u3093\u3002",
|
|
598
|
-
"state-loaded": "\u8AAD\u307F\u8FBC\u307F\u6E08\u307F",
|
|
599
|
-
"state-
|
|
600
|
-
"state-dependency": "{names} \u304C\u5FC5\u8981\u3068\u3057\u3066\u3044\u307E\u3059",
|
|
601
|
-
"state-unselected": "\u9078\u3093\u3067\u3044\u307E\u305B\u3093",
|
|
599
|
+
"state-loaded": "\u25B6\uFE0F \u8AAD\u307F\u8FBC\u307F\u6E08\u307F",
|
|
600
|
+
"state-dependency": "\u{1F517} {names} \u304C\u5FC5\u8981\u3068\u3057\u3066\u3044\u307E\u3059",
|
|
602
601
|
sourceEmbedded: "\u4F5C\u54C1\u306E\u4E2D\u306B\u3042\u308A\u307E\u3059",
|
|
603
602
|
sourceLegacy: "\u30AB\u30B9\u30BF\u30E0\u62E1\u5F35\u306E\u30A2\u30C9\u30EC\u30B9",
|
|
604
603
|
sourceInline: "\u4F5C\u54C1\u306E\u4E2D\u306B data: \u30A2\u30C9\u30EC\u30B9\u3068\u3057\u3066\u66F8\u304B\u308C\u3066\u3044\u307E\u3059",
|
|
605
|
-
creator: "\u88FD\u4F5C\u8005",
|
|
604
|
+
creator: "\u88FD\u4F5C\u8005\uFF08\u672A\u691C\u8A3C\u306E\u7533\u544A\uFF09",
|
|
606
605
|
creatorUnknown: "\u8A18\u8F09\u306A\u3057",
|
|
607
606
|
licenseUnknown: "\u8A18\u8F09\u306A\u3057",
|
|
608
607
|
version: "\u30D0\u30FC\u30B8\u30E7\u30F3",
|
|
609
608
|
digest: "SHA-256",
|
|
610
|
-
unverified: "\u88FD\u4F5C\u8005\u540D\u306F\u62E1\u5F35\u81EA\u8EAB\u306E\u7533\u544A\u3067\u3001\u691C\u8A3C\u3057\u3066\u3044\u307E\u305B\u3093\u3002",
|
|
611
609
|
failed: "\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",
|
|
612
610
|
retryNote: "\u901A\u4FE1\u306E\u554F\u984C\u306E\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002",
|
|
613
611
|
retry: "\u3082\u3046\u4E00\u5EA6\u8A66\u3059",
|
package/dist/index.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ export function createPreviewCache(): PreviewCache;
|
|
|
46
46
|
|
|
47
47
|
export type ReviewMode = 'add' | 'open';
|
|
48
48
|
export function isTrusted(entry: ReviewEntry): boolean;
|
|
49
|
+
export function allRequireUnsandboxed(entries: ReviewEntry[]): boolean;
|
|
49
50
|
export const loadingModes: readonly LoadingMode[];
|
|
50
51
|
export function loadingChoices(entry: ReviewEntry): LoadingMode[];
|
|
51
52
|
export function executionChoices(entry: ReviewEntry, mode: ReviewMode): ExecutionDecision[];
|
package/dist/index.mjs
CHANGED
|
@@ -113,7 +113,9 @@ function parseExtensionCatalog(data) {
|
|
|
113
113
|
ids: [id],
|
|
114
114
|
url,
|
|
115
115
|
dependencies: Object.freeze(dependencies.map((value) => string(value, "dependency", 128))),
|
|
116
|
-
|
|
116
|
+
// The dashboard catalog states name, description, creator and banner beside the URL.
|
|
117
|
+
// A nested `metadata` object, the older shape, still wins where it says something.
|
|
118
|
+
metadata: Object.freeze(metadataOf(__spreadValues(__spreadValues({}, source), source.metadata === void 0 ? {} : object(source.metadata, "metadata"))))
|
|
117
119
|
};
|
|
118
120
|
if (source.sha256 !== void 0) {
|
|
119
121
|
entry.sha256 = string(source.sha256, "sha256", 64);
|
|
@@ -444,6 +446,9 @@ function createPreviewCache() {
|
|
|
444
446
|
|
|
445
447
|
// src/decisions.js
|
|
446
448
|
var isTrusted = (entry) => Boolean(entry && entry.state && entry.state.trusted);
|
|
449
|
+
var allRequireUnsandboxed = (entries) => entries.length > 0 && entries.every(
|
|
450
|
+
(entry) => !(entry.state && entry.state.error) && unsandboxedRequirement(entry.metadata || {}) === "required"
|
|
451
|
+
);
|
|
447
452
|
var loadingModes = Object.freeze([
|
|
448
453
|
"remote-cacheable",
|
|
449
454
|
"remote-non-cacheable",
|
|
@@ -464,11 +469,13 @@ function initialDecisions(entries, mode, {
|
|
|
464
469
|
recorded = /* @__PURE__ */ new Map(),
|
|
465
470
|
fallbackLoading = "remote-cacheable"
|
|
466
471
|
} = {}) {
|
|
472
|
+
const allRequired = mode === "open" && allRequireUnsandboxed(entries);
|
|
467
473
|
return new Map(entries.map((entry) => {
|
|
468
474
|
const base = defaultDecision(entry, mode, fallbackLoading);
|
|
475
|
+
if (allRequired) base.execution = "unsandboxed";
|
|
469
476
|
const previous = recorded.get(entry.key);
|
|
470
477
|
if (!previous) return [entry.key, base];
|
|
471
|
-
const execution = executionChoices(entry, mode).includes(previous.execution) ? previous.execution : base.execution;
|
|
478
|
+
const execution = !allRequired && executionChoices(entry, mode).includes(previous.execution) ? previous.execution : base.execution;
|
|
472
479
|
const loading = loadingChoices(entry).includes(previous.loading) ? previous.loading : base.loading;
|
|
473
480
|
return [entry.key, loading === void 0 ? { execution } : { execution, loading }];
|
|
474
481
|
}));
|
|
@@ -483,6 +490,7 @@ var messages = {
|
|
|
483
490
|
openTitle: "This project wants to run extensions",
|
|
484
491
|
addIntro: "Choose what to add. Anything a chosen extension needs is selected for you.",
|
|
485
492
|
openIntro: "Decide how each one may run before the project starts. Nothing runs until you choose.",
|
|
493
|
+
allRequiredIntro: "All extensions say they need to run without the sandbox. That mode is already selected. Choose OK to run them, or Cancel to stop. Nothing runs before OK.",
|
|
486
494
|
execution: "How it runs",
|
|
487
495
|
loading: "Where it loads from",
|
|
488
496
|
executionBulk: "How they all run",
|
|
@@ -498,25 +506,19 @@ var messages = {
|
|
|
498
506
|
"loading-embedded-data": "In the project, as a data address",
|
|
499
507
|
loadingNote: "A kept copy is verified and reused, so the project opens without the network. Fetching each time leaves nothing in this browser.",
|
|
500
508
|
unsandboxedWarning: "Without the sandbox, an extension can reach the project, the editor and this site\u2019s data. Choose it only for code you trust.",
|
|
501
|
-
"requirement-required": "
|
|
502
|
-
|
|
503
|
-
"requirement-not-needed": "Says the sandbox is fine",
|
|
504
|
-
"requirement-unknown": "Says nothing about the sandbox",
|
|
505
|
-
trusted: "Listed in the catalog, so it runs without the sandbox",
|
|
509
|
+
"requirement-required": "\u26A0\uFE0F Needs to run without the sandbox",
|
|
510
|
+
trusted: "Trusted by TurboWarp Plus: runs without the sandbox",
|
|
506
511
|
trustedNote: "Catalog extensions are treated like TurboWarp\u2019s own gallery and are not asked about.",
|
|
507
|
-
"state-loaded": "Already running",
|
|
508
|
-
"state-
|
|
509
|
-
"state-dependency": "Needed by {names}",
|
|
510
|
-
"state-unselected": "Not chosen",
|
|
512
|
+
"state-loaded": "\u25B6\uFE0F Already running",
|
|
513
|
+
"state-dependency": "\u{1F517} Needed by {names}",
|
|
511
514
|
sourceEmbedded: "Stored in the project",
|
|
512
515
|
sourceLegacy: "A custom extension address",
|
|
513
516
|
sourceInline: "Written into the project as a data address",
|
|
514
|
-
creator: "Creator",
|
|
517
|
+
creator: "Creator (unverified claim)",
|
|
515
518
|
creatorUnknown: "Not stated",
|
|
516
519
|
licenseUnknown: "Not stated",
|
|
517
520
|
version: "Version",
|
|
518
521
|
digest: "SHA-256",
|
|
519
|
-
unverified: "The creator\u2019s name is the extension\u2019s own claim and is not verified.",
|
|
520
522
|
failed: "Could not be loaded",
|
|
521
523
|
retryNote: "This may be a network problem.",
|
|
522
524
|
retry: "Try again",
|
|
@@ -533,6 +535,7 @@ var messages = {
|
|
|
533
535
|
openTitle: "\u3053\u306E\u4F5C\u54C1\u306F\u6A5F\u80FD\u62E1\u5F35\u3092\u4F7F\u3044\u307E\u3059",
|
|
534
536
|
addIntro: "\u8FFD\u52A0\u3059\u308B\u3082\u306E\u3092\u9078\u3093\u3067\u304F\u3060\u3055\u3044\u3002\u9078\u3093\u3060\u62E1\u5F35\u304C\u5FC5\u8981\u3068\u3059\u308B\u3082\u306E\u306F\u81EA\u52D5\u3067\u9078\u3070\u308C\u307E\u3059\u3002",
|
|
535
537
|
openIntro: "\u4F5C\u54C1\u304C\u52D5\u304D\u51FA\u3059\u524D\u306B\u3001\u3069\u3053\u307E\u3067\u52D5\u304B\u3059\u304B\u3092\u6C7A\u3081\u3066\u304F\u3060\u3055\u3044\u3002\u6C7A\u3081\u308B\u307E\u3067\u4F55\u3082\u52D5\u304D\u307E\u305B\u3093\u3002",
|
|
538
|
+
allRequiredIntro: "\u3059\u3079\u3066\u306E\u6A5F\u80FD\u62E1\u5F35\u304C\u300C\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u300D\u3092\u5FC5\u8981\u3068\u7533\u544A\u3057\u3066\u3044\u308B\u305F\u3081\u3001\u9078\u629E\u6E08\u307F\u3067\u3059\u3002\u300COK\u300D\u3067\u5B9F\u884C\u3059\u308B\u304B\u3001\u300C\u30AD\u30E3\u30F3\u30BB\u30EB\u300D\u3067\u4E2D\u6B62\u3057\u3066\u304F\u3060\u3055\u3044\u3002OK\u307E\u3067\u306F\u5B9F\u884C\u3057\u307E\u305B\u3093\u3002",
|
|
536
539
|
execution: "\u52D5\u304B\u3057\u65B9",
|
|
537
540
|
loading: "\u8AAD\u307F\u8FBC\u307F\u5143",
|
|
538
541
|
executionBulk: "\u3059\u3079\u3066\u306E\u52D5\u304B\u3057\u65B9",
|
|
@@ -546,25 +549,19 @@ var messages = {
|
|
|
546
549
|
"loading-embedded-data": "\u4F5C\u54C1\u306E\u4E2D\u306E data: \u30A2\u30C9\u30EC\u30B9\u304B\u3089",
|
|
547
550
|
loadingNote: "\u63A7\u3048\u306F\u691C\u8A3C\u3057\u305F\u3046\u3048\u3067\u4F7F\u3044\u56DE\u3059\u306E\u3067\u3001\u901A\u4FE1\u306A\u3057\u3067\u3082\u4F5C\u54C1\u304C\u958B\u304D\u307E\u3059\u3002\u6BCE\u56DE\u53D6\u5F97\u3059\u308B\u5834\u5408\u306F\u3001\u3053\u306E\u30D6\u30E9\u30A6\u30B6\u30FC\u306B\u4F55\u3082\u6B8B\u308A\u307E\u305B\u3093\u3002",
|
|
548
551
|
unsandboxedWarning: "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u306E\u62E1\u5F35\u306F\u3001\u4F5C\u54C1\u30FB\u30A8\u30C7\u30A3\u30BF\u30FC\u30FB\u3053\u306E\u30B5\u30A4\u30C8\u306E\u30C7\u30FC\u30BF\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u3059\u3002\u4FE1\u983C\u3067\u304D\u308B\u30B3\u30FC\u30C9\u306B\u3060\u3051\u9078\u3093\u3067\u304F\u3060\u3055\u3044\u3002",
|
|
549
|
-
"requirement-required": "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u304C\u5FC5\u8981
|
|
550
|
-
|
|
551
|
-
"requirement-not-needed": "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u3067\u554F\u984C\u306A\u3044\u3068\u7533\u544A\u3057\u3066\u3044\u307E\u3059",
|
|
552
|
-
"requirement-unknown": "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306B\u3064\u3044\u3066\u7533\u544A\u304C\u3042\u308A\u307E\u305B\u3093",
|
|
553
|
-
trusted: "\u30AB\u30BF\u30ED\u30B0\u306B\u63B2\u8F09\u3055\u308C\u3066\u3044\u308B\u306E\u3067\u3001\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u3067\u52D5\u304D\u307E\u3059",
|
|
552
|
+
"requirement-required": "\u26A0\uFE0F \u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u304C\u5FC5\u8981",
|
|
553
|
+
trusted: "TurboWarp Plus \u304C\u4FE1\u983C\u3059\u308B\u62E1\u5F35\uFF1A\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u3067\u52D5\u304D\u307E\u3059",
|
|
554
554
|
trustedNote: "\u30AB\u30BF\u30ED\u30B0\u306E\u62E1\u5F35\u306F TurboWarp \u306E\u6A19\u6E96\u30AE\u30E3\u30E9\u30EA\u30FC\u3068\u540C\u3058\u6271\u3044\u3067\u3001\u78BA\u8A8D\u3092\u6C42\u3081\u307E\u305B\u3093\u3002",
|
|
555
|
-
"state-loaded": "\u8AAD\u307F\u8FBC\u307F\u6E08\u307F",
|
|
556
|
-
"state-
|
|
557
|
-
"state-dependency": "{names} \u304C\u5FC5\u8981\u3068\u3057\u3066\u3044\u307E\u3059",
|
|
558
|
-
"state-unselected": "\u9078\u3093\u3067\u3044\u307E\u305B\u3093",
|
|
555
|
+
"state-loaded": "\u25B6\uFE0F \u8AAD\u307F\u8FBC\u307F\u6E08\u307F",
|
|
556
|
+
"state-dependency": "\u{1F517} {names} \u304C\u5FC5\u8981\u3068\u3057\u3066\u3044\u307E\u3059",
|
|
559
557
|
sourceEmbedded: "\u4F5C\u54C1\u306E\u4E2D\u306B\u3042\u308A\u307E\u3059",
|
|
560
558
|
sourceLegacy: "\u30AB\u30B9\u30BF\u30E0\u62E1\u5F35\u306E\u30A2\u30C9\u30EC\u30B9",
|
|
561
559
|
sourceInline: "\u4F5C\u54C1\u306E\u4E2D\u306B data: \u30A2\u30C9\u30EC\u30B9\u3068\u3057\u3066\u66F8\u304B\u308C\u3066\u3044\u307E\u3059",
|
|
562
|
-
creator: "\u88FD\u4F5C\u8005",
|
|
560
|
+
creator: "\u88FD\u4F5C\u8005\uFF08\u672A\u691C\u8A3C\u306E\u7533\u544A\uFF09",
|
|
563
561
|
creatorUnknown: "\u8A18\u8F09\u306A\u3057",
|
|
564
562
|
licenseUnknown: "\u8A18\u8F09\u306A\u3057",
|
|
565
563
|
version: "\u30D0\u30FC\u30B8\u30E7\u30F3",
|
|
566
564
|
digest: "SHA-256",
|
|
567
|
-
unverified: "\u88FD\u4F5C\u8005\u540D\u306F\u62E1\u5F35\u81EA\u8EAB\u306E\u7533\u544A\u3067\u3001\u691C\u8A3C\u3057\u3066\u3044\u307E\u305B\u3093\u3002",
|
|
568
565
|
failed: "\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",
|
|
569
566
|
retryNote: "\u901A\u4FE1\u306E\u554F\u984C\u306E\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002",
|
|
570
567
|
retry: "\u3082\u3046\u4E00\u5EA6\u8A66\u3059",
|
|
@@ -672,6 +669,7 @@ function createExtensionWaitDialog(document, locale = "en", { delayMs = 300 } =
|
|
|
672
669
|
});
|
|
673
670
|
}
|
|
674
671
|
export {
|
|
672
|
+
allRequireUnsandboxed,
|
|
675
673
|
contradictsDeclaration,
|
|
676
674
|
createDecisionStorage,
|
|
677
675
|
createExtensionWaitDialog,
|
package/dist/react.cjs
CHANGED
|
@@ -61,6 +61,7 @@ var messages = {
|
|
|
61
61
|
openTitle: "This project wants to run extensions",
|
|
62
62
|
addIntro: "Choose what to add. Anything a chosen extension needs is selected for you.",
|
|
63
63
|
openIntro: "Decide how each one may run before the project starts. Nothing runs until you choose.",
|
|
64
|
+
allRequiredIntro: "All extensions say they need to run without the sandbox. That mode is already selected. Choose OK to run them, or Cancel to stop. Nothing runs before OK.",
|
|
64
65
|
execution: "How it runs",
|
|
65
66
|
loading: "Where it loads from",
|
|
66
67
|
executionBulk: "How they all run",
|
|
@@ -76,25 +77,19 @@ var messages = {
|
|
|
76
77
|
"loading-embedded-data": "In the project, as a data address",
|
|
77
78
|
loadingNote: "A kept copy is verified and reused, so the project opens without the network. Fetching each time leaves nothing in this browser.",
|
|
78
79
|
unsandboxedWarning: "Without the sandbox, an extension can reach the project, the editor and this site\u2019s data. Choose it only for code you trust.",
|
|
79
|
-
"requirement-required": "
|
|
80
|
-
|
|
81
|
-
"requirement-not-needed": "Says the sandbox is fine",
|
|
82
|
-
"requirement-unknown": "Says nothing about the sandbox",
|
|
83
|
-
trusted: "Listed in the catalog, so it runs without the sandbox",
|
|
80
|
+
"requirement-required": "\u26A0\uFE0F Needs to run without the sandbox",
|
|
81
|
+
trusted: "Trusted by TurboWarp Plus: runs without the sandbox",
|
|
84
82
|
trustedNote: "Catalog extensions are treated like TurboWarp\u2019s own gallery and are not asked about.",
|
|
85
|
-
"state-loaded": "Already running",
|
|
86
|
-
"state-
|
|
87
|
-
"state-dependency": "Needed by {names}",
|
|
88
|
-
"state-unselected": "Not chosen",
|
|
83
|
+
"state-loaded": "\u25B6\uFE0F Already running",
|
|
84
|
+
"state-dependency": "\u{1F517} Needed by {names}",
|
|
89
85
|
sourceEmbedded: "Stored in the project",
|
|
90
86
|
sourceLegacy: "A custom extension address",
|
|
91
87
|
sourceInline: "Written into the project as a data address",
|
|
92
|
-
creator: "Creator",
|
|
88
|
+
creator: "Creator (unverified claim)",
|
|
93
89
|
creatorUnknown: "Not stated",
|
|
94
90
|
licenseUnknown: "Not stated",
|
|
95
91
|
version: "Version",
|
|
96
92
|
digest: "SHA-256",
|
|
97
|
-
unverified: "The creator\u2019s name is the extension\u2019s own claim and is not verified.",
|
|
98
93
|
failed: "Could not be loaded",
|
|
99
94
|
retryNote: "This may be a network problem.",
|
|
100
95
|
retry: "Try again",
|
|
@@ -111,6 +106,7 @@ var messages = {
|
|
|
111
106
|
openTitle: "\u3053\u306E\u4F5C\u54C1\u306F\u6A5F\u80FD\u62E1\u5F35\u3092\u4F7F\u3044\u307E\u3059",
|
|
112
107
|
addIntro: "\u8FFD\u52A0\u3059\u308B\u3082\u306E\u3092\u9078\u3093\u3067\u304F\u3060\u3055\u3044\u3002\u9078\u3093\u3060\u62E1\u5F35\u304C\u5FC5\u8981\u3068\u3059\u308B\u3082\u306E\u306F\u81EA\u52D5\u3067\u9078\u3070\u308C\u307E\u3059\u3002",
|
|
113
108
|
openIntro: "\u4F5C\u54C1\u304C\u52D5\u304D\u51FA\u3059\u524D\u306B\u3001\u3069\u3053\u307E\u3067\u52D5\u304B\u3059\u304B\u3092\u6C7A\u3081\u3066\u304F\u3060\u3055\u3044\u3002\u6C7A\u3081\u308B\u307E\u3067\u4F55\u3082\u52D5\u304D\u307E\u305B\u3093\u3002",
|
|
109
|
+
allRequiredIntro: "\u3059\u3079\u3066\u306E\u6A5F\u80FD\u62E1\u5F35\u304C\u300C\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u300D\u3092\u5FC5\u8981\u3068\u7533\u544A\u3057\u3066\u3044\u308B\u305F\u3081\u3001\u9078\u629E\u6E08\u307F\u3067\u3059\u3002\u300COK\u300D\u3067\u5B9F\u884C\u3059\u308B\u304B\u3001\u300C\u30AD\u30E3\u30F3\u30BB\u30EB\u300D\u3067\u4E2D\u6B62\u3057\u3066\u304F\u3060\u3055\u3044\u3002OK\u307E\u3067\u306F\u5B9F\u884C\u3057\u307E\u305B\u3093\u3002",
|
|
114
110
|
execution: "\u52D5\u304B\u3057\u65B9",
|
|
115
111
|
loading: "\u8AAD\u307F\u8FBC\u307F\u5143",
|
|
116
112
|
executionBulk: "\u3059\u3079\u3066\u306E\u52D5\u304B\u3057\u65B9",
|
|
@@ -124,25 +120,19 @@ var messages = {
|
|
|
124
120
|
"loading-embedded-data": "\u4F5C\u54C1\u306E\u4E2D\u306E data: \u30A2\u30C9\u30EC\u30B9\u304B\u3089",
|
|
125
121
|
loadingNote: "\u63A7\u3048\u306F\u691C\u8A3C\u3057\u305F\u3046\u3048\u3067\u4F7F\u3044\u56DE\u3059\u306E\u3067\u3001\u901A\u4FE1\u306A\u3057\u3067\u3082\u4F5C\u54C1\u304C\u958B\u304D\u307E\u3059\u3002\u6BCE\u56DE\u53D6\u5F97\u3059\u308B\u5834\u5408\u306F\u3001\u3053\u306E\u30D6\u30E9\u30A6\u30B6\u30FC\u306B\u4F55\u3082\u6B8B\u308A\u307E\u305B\u3093\u3002",
|
|
126
122
|
unsandboxedWarning: "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u306E\u62E1\u5F35\u306F\u3001\u4F5C\u54C1\u30FB\u30A8\u30C7\u30A3\u30BF\u30FC\u30FB\u3053\u306E\u30B5\u30A4\u30C8\u306E\u30C7\u30FC\u30BF\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u3059\u3002\u4FE1\u983C\u3067\u304D\u308B\u30B3\u30FC\u30C9\u306B\u3060\u3051\u9078\u3093\u3067\u304F\u3060\u3055\u3044\u3002",
|
|
127
|
-
"requirement-required": "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u304C\u5FC5\u8981
|
|
128
|
-
|
|
129
|
-
"requirement-not-needed": "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u3067\u554F\u984C\u306A\u3044\u3068\u7533\u544A\u3057\u3066\u3044\u307E\u3059",
|
|
130
|
-
"requirement-unknown": "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306B\u3064\u3044\u3066\u7533\u544A\u304C\u3042\u308A\u307E\u305B\u3093",
|
|
131
|
-
trusted: "\u30AB\u30BF\u30ED\u30B0\u306B\u63B2\u8F09\u3055\u308C\u3066\u3044\u308B\u306E\u3067\u3001\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u3067\u52D5\u304D\u307E\u3059",
|
|
123
|
+
"requirement-required": "\u26A0\uFE0F \u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u304C\u5FC5\u8981",
|
|
124
|
+
trusted: "TurboWarp Plus \u304C\u4FE1\u983C\u3059\u308B\u62E1\u5F35\uFF1A\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u3067\u52D5\u304D\u307E\u3059",
|
|
132
125
|
trustedNote: "\u30AB\u30BF\u30ED\u30B0\u306E\u62E1\u5F35\u306F TurboWarp \u306E\u6A19\u6E96\u30AE\u30E3\u30E9\u30EA\u30FC\u3068\u540C\u3058\u6271\u3044\u3067\u3001\u78BA\u8A8D\u3092\u6C42\u3081\u307E\u305B\u3093\u3002",
|
|
133
|
-
"state-loaded": "\u8AAD\u307F\u8FBC\u307F\u6E08\u307F",
|
|
134
|
-
"state-
|
|
135
|
-
"state-dependency": "{names} \u304C\u5FC5\u8981\u3068\u3057\u3066\u3044\u307E\u3059",
|
|
136
|
-
"state-unselected": "\u9078\u3093\u3067\u3044\u307E\u305B\u3093",
|
|
126
|
+
"state-loaded": "\u25B6\uFE0F \u8AAD\u307F\u8FBC\u307F\u6E08\u307F",
|
|
127
|
+
"state-dependency": "\u{1F517} {names} \u304C\u5FC5\u8981\u3068\u3057\u3066\u3044\u307E\u3059",
|
|
137
128
|
sourceEmbedded: "\u4F5C\u54C1\u306E\u4E2D\u306B\u3042\u308A\u307E\u3059",
|
|
138
129
|
sourceLegacy: "\u30AB\u30B9\u30BF\u30E0\u62E1\u5F35\u306E\u30A2\u30C9\u30EC\u30B9",
|
|
139
130
|
sourceInline: "\u4F5C\u54C1\u306E\u4E2D\u306B data: \u30A2\u30C9\u30EC\u30B9\u3068\u3057\u3066\u66F8\u304B\u308C\u3066\u3044\u307E\u3059",
|
|
140
|
-
creator: "\u88FD\u4F5C\u8005",
|
|
131
|
+
creator: "\u88FD\u4F5C\u8005\uFF08\u672A\u691C\u8A3C\u306E\u7533\u544A\uFF09",
|
|
141
132
|
creatorUnknown: "\u8A18\u8F09\u306A\u3057",
|
|
142
133
|
licenseUnknown: "\u8A18\u8F09\u306A\u3057",
|
|
143
134
|
version: "\u30D0\u30FC\u30B8\u30E7\u30F3",
|
|
144
135
|
digest: "SHA-256",
|
|
145
|
-
unverified: "\u88FD\u4F5C\u8005\u540D\u306F\u62E1\u5F35\u81EA\u8EAB\u306E\u7533\u544A\u3067\u3001\u691C\u8A3C\u3057\u3066\u3044\u307E\u305B\u3093\u3002",
|
|
146
136
|
failed: "\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",
|
|
147
137
|
retryNote: "\u901A\u4FE1\u306E\u554F\u984C\u306E\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002",
|
|
148
138
|
retry: "\u3082\u3046\u4E00\u5EA6\u8A66\u3059",
|
|
@@ -381,7 +371,7 @@ var ExtensionPreview = class extends import_react.default.PureComponent {
|
|
|
381
371
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
382
372
|
"img",
|
|
383
373
|
{
|
|
384
|
-
className: "twextsec-preview",
|
|
374
|
+
className: this.props.fallback ? "twextsec-preview twextsec-preview-fallback" : "twextsec-preview",
|
|
385
375
|
src: this.state.src,
|
|
386
376
|
alt: formatMessage(this.props.locale, "preview", { name: this.props.name })
|
|
387
377
|
}
|
|
@@ -391,6 +381,9 @@ var ExtensionPreview = class extends import_react.default.PureComponent {
|
|
|
391
381
|
|
|
392
382
|
// src/decisions.js
|
|
393
383
|
var isTrusted = (entry) => Boolean(entry && entry.state && entry.state.trusted);
|
|
384
|
+
var allRequireUnsandboxed = (entries) => entries.length > 0 && entries.every(
|
|
385
|
+
(entry) => !(entry.state && entry.state.error) && unsandboxedRequirement(entry.metadata || {}) === "required"
|
|
386
|
+
);
|
|
394
387
|
var loadingModes = Object.freeze([
|
|
395
388
|
"remote-cacheable",
|
|
396
389
|
"remote-non-cacheable",
|
|
@@ -411,11 +404,13 @@ function initialDecisions(entries, mode, {
|
|
|
411
404
|
recorded = /* @__PURE__ */ new Map(),
|
|
412
405
|
fallbackLoading = "remote-cacheable"
|
|
413
406
|
} = {}) {
|
|
407
|
+
const allRequired = mode === "open" && allRequireUnsandboxed(entries);
|
|
414
408
|
return new Map(entries.map((entry) => {
|
|
415
409
|
const base = defaultDecision(entry, mode, fallbackLoading);
|
|
410
|
+
if (allRequired) base.execution = "unsandboxed";
|
|
416
411
|
const previous = recorded.get(entry.key);
|
|
417
412
|
if (!previous) return [entry.key, base];
|
|
418
|
-
const execution = executionChoices(entry, mode).includes(previous.execution) ? previous.execution : base.execution;
|
|
413
|
+
const execution = !allRequired && executionChoices(entry, mode).includes(previous.execution) ? previous.execution : base.execution;
|
|
419
414
|
const loading = loadingChoices(entry).includes(previous.loading) ? previous.loading : base.loading;
|
|
420
415
|
return [entry.key, loading === void 0 ? { execution } : { execution, loading }];
|
|
421
416
|
}));
|
|
@@ -424,6 +419,7 @@ var contradictsDeclaration = (entry, decision) => decision.execution === "sandbo
|
|
|
424
419
|
|
|
425
420
|
// src/review.jsx
|
|
426
421
|
var fallbackBanner = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMDAiIGhlaWdodD0iMzAwIiB2aWV3Qm94PSIwIDAgMzAwIDMwMCIgcm9sZT0iaW1nIiBhcmlhLWxhYmVsPSJUdXJib1dhcnAtUGx1cyBleHRlbnNpb24iPjx0aXRsZT5UdXJib1dhcnAtUGx1cyBleHRlbnNpb248L3RpdGxlPjxwYXRoIGZpbGw9IiMwZmJkOGMiIGQ9Ik0zMyA4MkM1NSA3OCA4NCA3OSAxMDYgODJDMTA2IDY3IDkwIDY5IDkwIDU0QzkwIDMyIDE3NCAzMCAxNzQgNTRDMTc0IDY5IDE1OCA2NiAxNTggODJDMTc1IDg2IDE5NiA4NSAyMTMgODJDMjE3IDk5IDIxNiAxMTUgMjEzIDEzMEMyMzAgMTMwIDIyNyAxMTQgMjQ1IDExNEMyNzEgMTE0IDI2OSAyMDYgMjQ1IDIwNkMyMjcgMjA2IDIzMCAxOTAgMjEzIDE5MEMyMDkgMjEwIDIxMCAyNDAgMjEzIDI2MkMyMDMgMjY1IDE4OCAyNjYgMTc0IDI2MkMxNzQgMjQ4IDE4OCAyNTAgMTg4IDIzNkMxODggMjE2IDExMiAyMTQgMTEyIDIzNkMxMTIgMjUwIDEyNiAyNDcgMTI2IDI2MkMxMDggMjU4IDYwIDI1OSAzMyAyNjJDMjkgMjQ1IDMwIDIyNSAzMyAyMDlDNDkgMjA5IDQ2IDIyNSA2MiAyMjVDODYgMjI1IDg0IDEzNyA2MiAxMzdDNDYgMTM3IDQ5IDE1MyAzMyAxNTNDMzcgMTMzIDM2IDEwNSAzMyA4MloiLz48cGF0aCBmaWxsPSIjZmZmIiBkPSJNOTMuNyAxMDBMMjAxLjcgMTAwTDE5OS45IDEyNkwxODkuOSAxMjZDMTkwLjMgMTIwIDE4OC45IDExMiAxODUuMSAxMDlMMTU5LjEgMTA5TDE1My4xIDE5NEMxNTIuNSAyMDMgMTU3LjMgMjA2IDE2OC4yIDIwN0wxNjggMjEwTDExMiAyMTBMMTEyLjIgMjA3QzEyMy4zIDIwNiAxMjguNSAyMDMgMTI5LjEgMTk0TDEzNS4xIDEwOUwxMDkuMSAxMDlDMTA0LjkgMTEyIDEwMi4zIDEyMCAxMDEuOSAxMjZMOTEuOSAxMjZaIi8+PC9zdmc+Cg==";
|
|
422
|
+
var trustedBadge = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTYgMjU2IiB3aWR0aD0iMjU2IiBoZWlnaHQ9IjI1NiIgcm9sZT0iaW1nIiBhcmlhLWxhYmVsPSJUdXJib1dhcnAgUGx1cyB0cnVzdGVkIj4KICA8dGl0bGU+VHVyYm9XYXJwIFBsdXMgdHJ1c3RlZDwvdGl0bGU+CiAgPGRlc2M+VGhlIFR1cmJvV2FycCBQbHVzIG1hcmsg4oCUIGEgaGF0IGJsb2NrIGZpbGxlZCB3aXRoIGEgd2FycCBzd2lybCwgY2FycnlpbmcgYSBwbHVzIHNpZ24g4oCUIHdpdGggYSBncmVlbiBjaGVjayBtYXJrIG92ZXIgaXRzIGxvd2VyIHJpZ2h0IGNvcm5lci48L2Rlc2M+CiAgPGRlZnM+CiAgICA8bGluZWFyR3JhZGllbnQgaWQ9ImJvZHkiIHgxPSIwIiB5MT0iMCIgeDI9IjEiIHkyPSIxIj4KICAgICAgPHN0b3Agb2Zmc2V0PSIwIiBzdG9wLWNvbG9yPSIjNmQyOGUwIi8+CiAgICAgIDxzdG9wIG9mZnNldD0iLjUiIHN0b3AtY29sb3I9IiMzYjU1ZTAiLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjMTFhM2Q4Ii8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJ3YXJwIiB4MT0iMCIgeTE9IjEiIHgyPSIxIiB5Mj0iMCI+CiAgICAgIDxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2JkZjRmZiIgc3RvcC1vcGFjaXR5PSIwIi8+CiAgICAgIDxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI2JkZjRmZiIgc3RvcC1vcGFjaXR5PSIuOSIvPgogICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDxjbGlwUGF0aCBpZD0iaW5zaWRlIj48cGF0aCBkPSJNMTYgNzhjOC02MCAyMTYtNjAgMjI0IDBWMTkwYTI2IDI2IDAgMCAxLTI2IDI2SDEzMmMtNCAwLTcgMy04IDZsLTYgMTBjLTMgNS04IDgtMTQgOEg4MGMtNiAwLTExLTMtMTQtOGwtNi0xMGMtMS0zLTQtNi04LTZINDJhMjYgMjYgMCAwIDEtMjYtMjZaIi8+PC9jbGlwUGF0aD4KICA8L2RlZnM+CgogIDxwYXRoIGZpbGw9InVybCgjYm9keSkiIGQ9Ik0xNiA3OGM4LTYwIDIxNi02MCAyMjQgMFYxOTBhMjYgMjYgMCAwIDEtMjYgMjZIMTMyYy00IDAtNyAzLTggNmwtNiAxMGMtMyA1LTggOC0xNCA4SDgwYy02IDAtMTEtMy0xNC04bC02LTEwYy0xLTMtNC02LTgtNkg0MmEyNiAyNiAwIDAgMS0yNi0yNloiLz4KCiAgPGcgY2xpcC1wYXRoPSJ1cmwoI2luc2lkZSkiIGZpbGw9Im5vbmUiIHN0cm9rZT0idXJsKCN3YXJwKSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIj4KICAgIDxwYXRoIGQ9Ik0xNCAxNDBBMTE0IDExNCAwIDAgMSAxMjggMjYiIHN0cm9rZS13aWR0aD0iMTciLz4KICAgIDxwYXRoIGQ9Ik00OCAxNDBhODAgODAgMCAwIDEgODAtODAiIHN0cm9rZS13aWR0aD0iMTMiIG9wYWNpdHk9Ii42Ii8+CiAgICA8cGF0aCBkPSJNODIgMTQwYTQ2IDQ2IDAgMCAxIDQ2LTQ2IiBzdHJva2Utd2lkdGg9IjkiIG9wYWNpdHk9Ii40Ii8+CiAgPC9nPgoKICA8cGF0aCBkPSJNMTI4IDEwMHY4ME04OCAxNDBoODAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSIyNiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+CgogIDxjaXJjbGUgY3g9IjE5NiIgY3k9IjE5NiIgcj0iNTgiIGZpbGw9IiMxNmEzNGEiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSIxMiIvPgogIDxwYXRoIGQ9Ik0xNjggMTk4bDIwIDIwIDM4LTQyIiBmaWxsPSJub25lIiBzdHJva2U9IiNmZmYiIHN0cm9rZS13aWR0aD0iMTgiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K";
|
|
427
423
|
var bind = (instance, names) => names.forEach((name) => {
|
|
428
424
|
instance[name] = instance[name].bind(instance);
|
|
429
425
|
});
|
|
@@ -486,6 +482,11 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
486
482
|
componentDidMount() {
|
|
487
483
|
this.describe();
|
|
488
484
|
}
|
|
485
|
+
componentDidUpdate() {
|
|
486
|
+
if (this.allRequired() && this.props.entries.some((entry) => this.state.decisions.get(entry.key).execution !== "unsandboxed")) {
|
|
487
|
+
this.setState((state) => ({ decisions: new Map([...state.decisions].map(([key, decision]) => [key, __spreadProps(__spreadValues({}, decision), { execution: "unsandboxed" })])) }));
|
|
488
|
+
}
|
|
489
|
+
}
|
|
489
490
|
componentWillUnmount() {
|
|
490
491
|
this.controller.abort();
|
|
491
492
|
}
|
|
@@ -512,7 +513,15 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
512
513
|
metadataOf(entry) {
|
|
513
514
|
return entry.metadata || this.state.described.get(entry.key) || {};
|
|
514
515
|
}
|
|
516
|
+
allRequired() {
|
|
517
|
+
return this.props.mode === "open" && allRequireUnsandboxed(this.props.entries.map((entry) => __spreadProps(__spreadValues({}, entry), { metadata: this.metadataOf(entry) })));
|
|
518
|
+
}
|
|
519
|
+
executionOptions(entry) {
|
|
520
|
+
return this.allRequired() && !isTrusted(entry) ? ["unsandboxed"] : executionChoices(entry, this.props.mode);
|
|
521
|
+
}
|
|
515
522
|
decide(key, change) {
|
|
523
|
+
const entry = this.props.entries.find((entry2) => entry2.key === key);
|
|
524
|
+
if (change.execution !== void 0 && !this.executionOptions(entry).includes(change.execution)) return;
|
|
516
525
|
this.setState((state) => ({
|
|
517
526
|
decisions: new Map(state.decisions).set(key, __spreadValues(__spreadValues({}, state.decisions.get(key)), change))
|
|
518
527
|
}));
|
|
@@ -522,7 +531,7 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
522
531
|
this.setState((state) => {
|
|
523
532
|
const decisions = new Map(state.decisions);
|
|
524
533
|
for (const entry of this.props.entries) {
|
|
525
|
-
if (
|
|
534
|
+
if (this.executionOptions(entry).includes(execution)) {
|
|
526
535
|
decisions.set(entry.key, __spreadProps(__spreadValues({}, decisions.get(entry.key)), { execution }));
|
|
527
536
|
}
|
|
528
537
|
}
|
|
@@ -574,12 +583,22 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
574
583
|
const t = this.t.bind(this);
|
|
575
584
|
const decision = this.state.decisions.get(entry.key);
|
|
576
585
|
const metadata = this.metadataOf(entry);
|
|
577
|
-
const executions =
|
|
586
|
+
const executions = this.executionOptions(entry);
|
|
578
587
|
const loadings = loadingChoices(entry);
|
|
579
588
|
const state = mode === "add" ? selection.stateOf(entry.key) : null;
|
|
580
589
|
const required = state === "dependency";
|
|
581
590
|
const roots = required ? [...selection.requiredBy.get(entry.key) || []] : [];
|
|
582
591
|
const failure = entry.state && entry.state.error;
|
|
592
|
+
const preview = /* @__PURE__ */ import_react2.default.createElement(
|
|
593
|
+
ExtensionPreview,
|
|
594
|
+
{
|
|
595
|
+
url: metadata.banner || fallbackBanner,
|
|
596
|
+
fallback: !metadata.banner,
|
|
597
|
+
name: metadata.name || entry.key,
|
|
598
|
+
cache: this.props.previewCache,
|
|
599
|
+
locale: this.props.locale
|
|
600
|
+
}
|
|
601
|
+
);
|
|
583
602
|
return /* @__PURE__ */ import_react2.default.createElement(
|
|
584
603
|
"li",
|
|
585
604
|
{
|
|
@@ -596,21 +615,36 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
596
615
|
disabled: required || state === "loaded",
|
|
597
616
|
onChange: () => this.toggle(entry.key)
|
|
598
617
|
}
|
|
599
|
-
), /* @__PURE__ */ import_react2.default.createElement("strong", null, metadata.name || entry.key)), mode === "open" && /* @__PURE__ */ import_react2.default.createElement("strong", null, metadata.name || entry.key), /* @__PURE__ */ import_react2.default.createElement("span", { className: "twextsec-id" }, entry.ids.join(", ")),
|
|
600
|
-
|
|
601
|
-
entry.source.sha256 && /* @__PURE__ */ import_react2.default.createElement("p", { className: "twextsec-digest" }, t("digest"), " ", entry.source.sha256),
|
|
602
|
-
/* @__PURE__ */ import_react2.default.createElement(
|
|
603
|
-
ExtensionPreview,
|
|
618
|
+
), /* @__PURE__ */ import_react2.default.createElement("strong", null, metadata.name || entry.key)), mode === "open" && /* @__PURE__ */ import_react2.default.createElement("strong", null, metadata.name || entry.key), metadata.name && /* @__PURE__ */ import_react2.default.createElement("span", { className: "twextsec-id" }, entry.ids.join(", ")), isTrusted(entry) && /* @__PURE__ */ import_react2.default.createElement(
|
|
619
|
+
"img",
|
|
604
620
|
{
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
621
|
+
className: "twextsec-trusted",
|
|
622
|
+
src: trustedBadge,
|
|
623
|
+
alt: t("trusted"),
|
|
624
|
+
title: t("trusted")
|
|
609
625
|
}
|
|
626
|
+
), metadata.version && /* @__PURE__ */ import_react2.default.createElement("span", null, t("version"), " ", metadata.version)),
|
|
627
|
+
/* @__PURE__ */ import_react2.default.createElement(
|
|
628
|
+
"p",
|
|
629
|
+
{
|
|
630
|
+
className: "twextsec-source",
|
|
631
|
+
title: sourceLabel(entry, t)
|
|
632
|
+
},
|
|
633
|
+
sourceLabel(entry, t)
|
|
610
634
|
),
|
|
635
|
+
entry.source.sha256 && /* @__PURE__ */ import_react2.default.createElement("p", { className: "twextsec-digest" }, t("digest"), " ", entry.source.sha256),
|
|
636
|
+
mode === "add" ? /* @__PURE__ */ import_react2.default.createElement(
|
|
637
|
+
"span",
|
|
638
|
+
{
|
|
639
|
+
className: "twextsec-preview-pick",
|
|
640
|
+
"aria-hidden": "true",
|
|
641
|
+
onClick: required || state === "loaded" ? void 0 : () => this.toggle(entry.key)
|
|
642
|
+
},
|
|
643
|
+
preview
|
|
644
|
+
) : preview,
|
|
611
645
|
/* @__PURE__ */ import_react2.default.createElement("p", { className: "twextsec-about" }, getExtensionDescription(metadata, this.props.locale)),
|
|
612
|
-
/* @__PURE__ */ import_react2.default.createElement("p", { className: "twextsec-claim" }, t("creator"), ": ", metadata.author || t("creatorUnknown")
|
|
613
|
-
state && /* @__PURE__ */ import_react2.default.createElement("
|
|
646
|
+
/* @__PURE__ */ import_react2.default.createElement("p", { className: "twextsec-claim" }, t("creator"), ": ", metadata.author || t("creatorUnknown")),
|
|
647
|
+
/* @__PURE__ */ import_react2.default.createElement("div", { className: "twextsec-status" }, (required || state === "loaded") && /* @__PURE__ */ import_react2.default.createElement("span", { className: "twextsec-state" }, required ? t("state-dependency", { names: roots.join(", ") }) : t("state-loaded")), unsandboxedRequirement(metadata) === "required" && /* @__PURE__ */ import_react2.default.createElement("span", { className: "twextsec-requirement" }, t("requirement-required"))),
|
|
614
648
|
failure && /* @__PURE__ */ import_react2.default.createElement(
|
|
615
649
|
Failure,
|
|
616
650
|
{
|
|
@@ -619,7 +653,7 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
619
653
|
t
|
|
620
654
|
}
|
|
621
655
|
),
|
|
622
|
-
|
|
656
|
+
/* @__PURE__ */ import_react2.default.createElement("div", { className: "twextsec-choices" }, !isTrusted(entry) && /* @__PURE__ */ import_react2.default.createElement(
|
|
623
657
|
Choices,
|
|
624
658
|
{
|
|
625
659
|
name: `execution-${entry.key}`,
|
|
@@ -629,9 +663,7 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
629
663
|
onChange: (event) => this.decide(entry.key, { execution: event.target.value }),
|
|
630
664
|
t
|
|
631
665
|
}
|
|
632
|
-
),
|
|
633
|
-
!isTrusted(entry) && /* @__PURE__ */ import_react2.default.createElement("p", { className: "twextsec-requirement" }, t(`requirement-${unsandboxedRequirement(metadata)}`)),
|
|
634
|
-
loadings.length > 0 && /* @__PURE__ */ import_react2.default.createElement(
|
|
666
|
+
), loadings.length > 0 && /* @__PURE__ */ import_react2.default.createElement(
|
|
635
667
|
Choices,
|
|
636
668
|
{
|
|
637
669
|
name: `loading-${entry.key}`,
|
|
@@ -641,7 +673,7 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
641
673
|
onChange: (event) => this.decide(entry.key, { loading: event.target.value }),
|
|
642
674
|
t
|
|
643
675
|
}
|
|
644
|
-
),
|
|
676
|
+
)),
|
|
645
677
|
loadings.length === 0 && decision.loading !== void 0 && /* @__PURE__ */ import_react2.default.createElement("p", { className: "twextsec-loading-fixed" }, t(`loading-${decision.loading}`)),
|
|
646
678
|
contradictsDeclaration(entry, decision) && /* @__PURE__ */ import_react2.default.createElement(
|
|
647
679
|
"p",
|
|
@@ -657,16 +689,17 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
657
689
|
const { mode, entries, DialogFrame, failure, onRetry } = this.props;
|
|
658
690
|
const t = this.t.bind(this);
|
|
659
691
|
const selection = this.selection();
|
|
692
|
+
const allRequired = this.allRequired();
|
|
660
693
|
const anyUnsandboxed = [...this.included()].some((key) => this.state.decisions.get(key).execution === "unsandboxed");
|
|
661
694
|
const bulkLoadings = loadingModes.filter((mode2) => entries.some((entry) => loadingChoices(entry).includes(mode2)));
|
|
662
|
-
const body = /* @__PURE__ */ import_react2.default.createElement("div", { className: "twextsec-review" }, /* @__PURE__ */ import_react2.default.createElement("p", { className: "twextsec-intro" }, t(mode === "add" ? "addIntro" : "openIntro")), failure && /* @__PURE__ */ import_react2.default.createElement(
|
|
695
|
+
const body = /* @__PURE__ */ import_react2.default.createElement("div", { className: "twextsec-review" }, /* @__PURE__ */ import_react2.default.createElement("p", { className: "twextsec-intro" }, t(mode === "add" ? "addIntro" : allRequired ? "allRequiredIntro" : "openIntro")), failure && /* @__PURE__ */ import_react2.default.createElement(
|
|
663
696
|
Failure,
|
|
664
697
|
{
|
|
665
698
|
failure,
|
|
666
699
|
onRetry,
|
|
667
700
|
t
|
|
668
701
|
}
|
|
669
|
-
), /* @__PURE__ */ import_react2.default.createElement("div", { className: "twextsec-bulk" }, /* @__PURE__ */ import_react2.default.createElement(
|
|
702
|
+
), (!allRequired || bulkLoadings.length > 0) && /* @__PURE__ */ import_react2.default.createElement("div", { className: "twextsec-bulk" }, !allRequired && /* @__PURE__ */ import_react2.default.createElement(
|
|
670
703
|
Choices,
|
|
671
704
|
{
|
|
672
705
|
name: "execution-all",
|
package/dist/react.mjs
CHANGED
|
@@ -28,6 +28,7 @@ var messages = {
|
|
|
28
28
|
openTitle: "This project wants to run extensions",
|
|
29
29
|
addIntro: "Choose what to add. Anything a chosen extension needs is selected for you.",
|
|
30
30
|
openIntro: "Decide how each one may run before the project starts. Nothing runs until you choose.",
|
|
31
|
+
allRequiredIntro: "All extensions say they need to run without the sandbox. That mode is already selected. Choose OK to run them, or Cancel to stop. Nothing runs before OK.",
|
|
31
32
|
execution: "How it runs",
|
|
32
33
|
loading: "Where it loads from",
|
|
33
34
|
executionBulk: "How they all run",
|
|
@@ -43,25 +44,19 @@ var messages = {
|
|
|
43
44
|
"loading-embedded-data": "In the project, as a data address",
|
|
44
45
|
loadingNote: "A kept copy is verified and reused, so the project opens without the network. Fetching each time leaves nothing in this browser.",
|
|
45
46
|
unsandboxedWarning: "Without the sandbox, an extension can reach the project, the editor and this site\u2019s data. Choose it only for code you trust.",
|
|
46
|
-
"requirement-required": "
|
|
47
|
-
|
|
48
|
-
"requirement-not-needed": "Says the sandbox is fine",
|
|
49
|
-
"requirement-unknown": "Says nothing about the sandbox",
|
|
50
|
-
trusted: "Listed in the catalog, so it runs without the sandbox",
|
|
47
|
+
"requirement-required": "\u26A0\uFE0F Needs to run without the sandbox",
|
|
48
|
+
trusted: "Trusted by TurboWarp Plus: runs without the sandbox",
|
|
51
49
|
trustedNote: "Catalog extensions are treated like TurboWarp\u2019s own gallery and are not asked about.",
|
|
52
|
-
"state-loaded": "Already running",
|
|
53
|
-
"state-
|
|
54
|
-
"state-dependency": "Needed by {names}",
|
|
55
|
-
"state-unselected": "Not chosen",
|
|
50
|
+
"state-loaded": "\u25B6\uFE0F Already running",
|
|
51
|
+
"state-dependency": "\u{1F517} Needed by {names}",
|
|
56
52
|
sourceEmbedded: "Stored in the project",
|
|
57
53
|
sourceLegacy: "A custom extension address",
|
|
58
54
|
sourceInline: "Written into the project as a data address",
|
|
59
|
-
creator: "Creator",
|
|
55
|
+
creator: "Creator (unverified claim)",
|
|
60
56
|
creatorUnknown: "Not stated",
|
|
61
57
|
licenseUnknown: "Not stated",
|
|
62
58
|
version: "Version",
|
|
63
59
|
digest: "SHA-256",
|
|
64
|
-
unverified: "The creator\u2019s name is the extension\u2019s own claim and is not verified.",
|
|
65
60
|
failed: "Could not be loaded",
|
|
66
61
|
retryNote: "This may be a network problem.",
|
|
67
62
|
retry: "Try again",
|
|
@@ -78,6 +73,7 @@ var messages = {
|
|
|
78
73
|
openTitle: "\u3053\u306E\u4F5C\u54C1\u306F\u6A5F\u80FD\u62E1\u5F35\u3092\u4F7F\u3044\u307E\u3059",
|
|
79
74
|
addIntro: "\u8FFD\u52A0\u3059\u308B\u3082\u306E\u3092\u9078\u3093\u3067\u304F\u3060\u3055\u3044\u3002\u9078\u3093\u3060\u62E1\u5F35\u304C\u5FC5\u8981\u3068\u3059\u308B\u3082\u306E\u306F\u81EA\u52D5\u3067\u9078\u3070\u308C\u307E\u3059\u3002",
|
|
80
75
|
openIntro: "\u4F5C\u54C1\u304C\u52D5\u304D\u51FA\u3059\u524D\u306B\u3001\u3069\u3053\u307E\u3067\u52D5\u304B\u3059\u304B\u3092\u6C7A\u3081\u3066\u304F\u3060\u3055\u3044\u3002\u6C7A\u3081\u308B\u307E\u3067\u4F55\u3082\u52D5\u304D\u307E\u305B\u3093\u3002",
|
|
76
|
+
allRequiredIntro: "\u3059\u3079\u3066\u306E\u6A5F\u80FD\u62E1\u5F35\u304C\u300C\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u300D\u3092\u5FC5\u8981\u3068\u7533\u544A\u3057\u3066\u3044\u308B\u305F\u3081\u3001\u9078\u629E\u6E08\u307F\u3067\u3059\u3002\u300COK\u300D\u3067\u5B9F\u884C\u3059\u308B\u304B\u3001\u300C\u30AD\u30E3\u30F3\u30BB\u30EB\u300D\u3067\u4E2D\u6B62\u3057\u3066\u304F\u3060\u3055\u3044\u3002OK\u307E\u3067\u306F\u5B9F\u884C\u3057\u307E\u305B\u3093\u3002",
|
|
81
77
|
execution: "\u52D5\u304B\u3057\u65B9",
|
|
82
78
|
loading: "\u8AAD\u307F\u8FBC\u307F\u5143",
|
|
83
79
|
executionBulk: "\u3059\u3079\u3066\u306E\u52D5\u304B\u3057\u65B9",
|
|
@@ -91,25 +87,19 @@ var messages = {
|
|
|
91
87
|
"loading-embedded-data": "\u4F5C\u54C1\u306E\u4E2D\u306E data: \u30A2\u30C9\u30EC\u30B9\u304B\u3089",
|
|
92
88
|
loadingNote: "\u63A7\u3048\u306F\u691C\u8A3C\u3057\u305F\u3046\u3048\u3067\u4F7F\u3044\u56DE\u3059\u306E\u3067\u3001\u901A\u4FE1\u306A\u3057\u3067\u3082\u4F5C\u54C1\u304C\u958B\u304D\u307E\u3059\u3002\u6BCE\u56DE\u53D6\u5F97\u3059\u308B\u5834\u5408\u306F\u3001\u3053\u306E\u30D6\u30E9\u30A6\u30B6\u30FC\u306B\u4F55\u3082\u6B8B\u308A\u307E\u305B\u3093\u3002",
|
|
93
89
|
unsandboxedWarning: "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u306E\u62E1\u5F35\u306F\u3001\u4F5C\u54C1\u30FB\u30A8\u30C7\u30A3\u30BF\u30FC\u30FB\u3053\u306E\u30B5\u30A4\u30C8\u306E\u30C7\u30FC\u30BF\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u3059\u3002\u4FE1\u983C\u3067\u304D\u308B\u30B3\u30FC\u30C9\u306B\u3060\u3051\u9078\u3093\u3067\u304F\u3060\u3055\u3044\u3002",
|
|
94
|
-
"requirement-required": "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u304C\u5FC5\u8981
|
|
95
|
-
|
|
96
|
-
"requirement-not-needed": "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u3067\u554F\u984C\u306A\u3044\u3068\u7533\u544A\u3057\u3066\u3044\u307E\u3059",
|
|
97
|
-
"requirement-unknown": "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306B\u3064\u3044\u3066\u7533\u544A\u304C\u3042\u308A\u307E\u305B\u3093",
|
|
98
|
-
trusted: "\u30AB\u30BF\u30ED\u30B0\u306B\u63B2\u8F09\u3055\u308C\u3066\u3044\u308B\u306E\u3067\u3001\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u3067\u52D5\u304D\u307E\u3059",
|
|
90
|
+
"requirement-required": "\u26A0\uFE0F \u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u304C\u5FC5\u8981",
|
|
91
|
+
trusted: "TurboWarp Plus \u304C\u4FE1\u983C\u3059\u308B\u62E1\u5F35\uFF1A\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u3067\u52D5\u304D\u307E\u3059",
|
|
99
92
|
trustedNote: "\u30AB\u30BF\u30ED\u30B0\u306E\u62E1\u5F35\u306F TurboWarp \u306E\u6A19\u6E96\u30AE\u30E3\u30E9\u30EA\u30FC\u3068\u540C\u3058\u6271\u3044\u3067\u3001\u78BA\u8A8D\u3092\u6C42\u3081\u307E\u305B\u3093\u3002",
|
|
100
|
-
"state-loaded": "\u8AAD\u307F\u8FBC\u307F\u6E08\u307F",
|
|
101
|
-
"state-
|
|
102
|
-
"state-dependency": "{names} \u304C\u5FC5\u8981\u3068\u3057\u3066\u3044\u307E\u3059",
|
|
103
|
-
"state-unselected": "\u9078\u3093\u3067\u3044\u307E\u305B\u3093",
|
|
93
|
+
"state-loaded": "\u25B6\uFE0F \u8AAD\u307F\u8FBC\u307F\u6E08\u307F",
|
|
94
|
+
"state-dependency": "\u{1F517} {names} \u304C\u5FC5\u8981\u3068\u3057\u3066\u3044\u307E\u3059",
|
|
104
95
|
sourceEmbedded: "\u4F5C\u54C1\u306E\u4E2D\u306B\u3042\u308A\u307E\u3059",
|
|
105
96
|
sourceLegacy: "\u30AB\u30B9\u30BF\u30E0\u62E1\u5F35\u306E\u30A2\u30C9\u30EC\u30B9",
|
|
106
97
|
sourceInline: "\u4F5C\u54C1\u306E\u4E2D\u306B data: \u30A2\u30C9\u30EC\u30B9\u3068\u3057\u3066\u66F8\u304B\u308C\u3066\u3044\u307E\u3059",
|
|
107
|
-
creator: "\u88FD\u4F5C\u8005",
|
|
98
|
+
creator: "\u88FD\u4F5C\u8005\uFF08\u672A\u691C\u8A3C\u306E\u7533\u544A\uFF09",
|
|
108
99
|
creatorUnknown: "\u8A18\u8F09\u306A\u3057",
|
|
109
100
|
licenseUnknown: "\u8A18\u8F09\u306A\u3057",
|
|
110
101
|
version: "\u30D0\u30FC\u30B8\u30E7\u30F3",
|
|
111
102
|
digest: "SHA-256",
|
|
112
|
-
unverified: "\u88FD\u4F5C\u8005\u540D\u306F\u62E1\u5F35\u81EA\u8EAB\u306E\u7533\u544A\u3067\u3001\u691C\u8A3C\u3057\u3066\u3044\u307E\u305B\u3093\u3002",
|
|
113
103
|
failed: "\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",
|
|
114
104
|
retryNote: "\u901A\u4FE1\u306E\u554F\u984C\u306E\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002",
|
|
115
105
|
retry: "\u3082\u3046\u4E00\u5EA6\u8A66\u3059",
|
|
@@ -348,7 +338,7 @@ var ExtensionPreview = class extends React.PureComponent {
|
|
|
348
338
|
return /* @__PURE__ */ React.createElement(
|
|
349
339
|
"img",
|
|
350
340
|
{
|
|
351
|
-
className: "twextsec-preview",
|
|
341
|
+
className: this.props.fallback ? "twextsec-preview twextsec-preview-fallback" : "twextsec-preview",
|
|
352
342
|
src: this.state.src,
|
|
353
343
|
alt: formatMessage(this.props.locale, "preview", { name: this.props.name })
|
|
354
344
|
}
|
|
@@ -358,6 +348,9 @@ var ExtensionPreview = class extends React.PureComponent {
|
|
|
358
348
|
|
|
359
349
|
// src/decisions.js
|
|
360
350
|
var isTrusted = (entry) => Boolean(entry && entry.state && entry.state.trusted);
|
|
351
|
+
var allRequireUnsandboxed = (entries) => entries.length > 0 && entries.every(
|
|
352
|
+
(entry) => !(entry.state && entry.state.error) && unsandboxedRequirement(entry.metadata || {}) === "required"
|
|
353
|
+
);
|
|
361
354
|
var loadingModes = Object.freeze([
|
|
362
355
|
"remote-cacheable",
|
|
363
356
|
"remote-non-cacheable",
|
|
@@ -378,11 +371,13 @@ function initialDecisions(entries, mode, {
|
|
|
378
371
|
recorded = /* @__PURE__ */ new Map(),
|
|
379
372
|
fallbackLoading = "remote-cacheable"
|
|
380
373
|
} = {}) {
|
|
374
|
+
const allRequired = mode === "open" && allRequireUnsandboxed(entries);
|
|
381
375
|
return new Map(entries.map((entry) => {
|
|
382
376
|
const base = defaultDecision(entry, mode, fallbackLoading);
|
|
377
|
+
if (allRequired) base.execution = "unsandboxed";
|
|
383
378
|
const previous = recorded.get(entry.key);
|
|
384
379
|
if (!previous) return [entry.key, base];
|
|
385
|
-
const execution = executionChoices(entry, mode).includes(previous.execution) ? previous.execution : base.execution;
|
|
380
|
+
const execution = !allRequired && executionChoices(entry, mode).includes(previous.execution) ? previous.execution : base.execution;
|
|
386
381
|
const loading = loadingChoices(entry).includes(previous.loading) ? previous.loading : base.loading;
|
|
387
382
|
return [entry.key, loading === void 0 ? { execution } : { execution, loading }];
|
|
388
383
|
}));
|
|
@@ -391,6 +386,7 @@ var contradictsDeclaration = (entry, decision) => decision.execution === "sandbo
|
|
|
391
386
|
|
|
392
387
|
// src/review.jsx
|
|
393
388
|
var fallbackBanner = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMDAiIGhlaWdodD0iMzAwIiB2aWV3Qm94PSIwIDAgMzAwIDMwMCIgcm9sZT0iaW1nIiBhcmlhLWxhYmVsPSJUdXJib1dhcnAtUGx1cyBleHRlbnNpb24iPjx0aXRsZT5UdXJib1dhcnAtUGx1cyBleHRlbnNpb248L3RpdGxlPjxwYXRoIGZpbGw9IiMwZmJkOGMiIGQ9Ik0zMyA4MkM1NSA3OCA4NCA3OSAxMDYgODJDMTA2IDY3IDkwIDY5IDkwIDU0QzkwIDMyIDE3NCAzMCAxNzQgNTRDMTc0IDY5IDE1OCA2NiAxNTggODJDMTc1IDg2IDE5NiA4NSAyMTMgODJDMjE3IDk5IDIxNiAxMTUgMjEzIDEzMEMyMzAgMTMwIDIyNyAxMTQgMjQ1IDExNEMyNzEgMTE0IDI2OSAyMDYgMjQ1IDIwNkMyMjcgMjA2IDIzMCAxOTAgMjEzIDE5MEMyMDkgMjEwIDIxMCAyNDAgMjEzIDI2MkMyMDMgMjY1IDE4OCAyNjYgMTc0IDI2MkMxNzQgMjQ4IDE4OCAyNTAgMTg4IDIzNkMxODggMjE2IDExMiAyMTQgMTEyIDIzNkMxMTIgMjUwIDEyNiAyNDcgMTI2IDI2MkMxMDggMjU4IDYwIDI1OSAzMyAyNjJDMjkgMjQ1IDMwIDIyNSAzMyAyMDlDNDkgMjA5IDQ2IDIyNSA2MiAyMjVDODYgMjI1IDg0IDEzNyA2MiAxMzdDNDYgMTM3IDQ5IDE1MyAzMyAxNTNDMzcgMTMzIDM2IDEwNSAzMyA4MloiLz48cGF0aCBmaWxsPSIjZmZmIiBkPSJNOTMuNyAxMDBMMjAxLjcgMTAwTDE5OS45IDEyNkwxODkuOSAxMjZDMTkwLjMgMTIwIDE4OC45IDExMiAxODUuMSAxMDlMMTU5LjEgMTA5TDE1My4xIDE5NEMxNTIuNSAyMDMgMTU3LjMgMjA2IDE2OC4yIDIwN0wxNjggMjEwTDExMiAyMTBMMTEyLjIgMjA3QzEyMy4zIDIwNiAxMjguNSAyMDMgMTI5LjEgMTk0TDEzNS4xIDEwOUwxMDkuMSAxMDlDMTA0LjkgMTEyIDEwMi4zIDEyMCAxMDEuOSAxMjZMOTEuOSAxMjZaIi8+PC9zdmc+Cg==";
|
|
389
|
+
var trustedBadge = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTYgMjU2IiB3aWR0aD0iMjU2IiBoZWlnaHQ9IjI1NiIgcm9sZT0iaW1nIiBhcmlhLWxhYmVsPSJUdXJib1dhcnAgUGx1cyB0cnVzdGVkIj4KICA8dGl0bGU+VHVyYm9XYXJwIFBsdXMgdHJ1c3RlZDwvdGl0bGU+CiAgPGRlc2M+VGhlIFR1cmJvV2FycCBQbHVzIG1hcmsg4oCUIGEgaGF0IGJsb2NrIGZpbGxlZCB3aXRoIGEgd2FycCBzd2lybCwgY2FycnlpbmcgYSBwbHVzIHNpZ24g4oCUIHdpdGggYSBncmVlbiBjaGVjayBtYXJrIG92ZXIgaXRzIGxvd2VyIHJpZ2h0IGNvcm5lci48L2Rlc2M+CiAgPGRlZnM+CiAgICA8bGluZWFyR3JhZGllbnQgaWQ9ImJvZHkiIHgxPSIwIiB5MT0iMCIgeDI9IjEiIHkyPSIxIj4KICAgICAgPHN0b3Agb2Zmc2V0PSIwIiBzdG9wLWNvbG9yPSIjNmQyOGUwIi8+CiAgICAgIDxzdG9wIG9mZnNldD0iLjUiIHN0b3AtY29sb3I9IiMzYjU1ZTAiLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjMTFhM2Q4Ii8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJ3YXJwIiB4MT0iMCIgeTE9IjEiIHgyPSIxIiB5Mj0iMCI+CiAgICAgIDxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2JkZjRmZiIgc3RvcC1vcGFjaXR5PSIwIi8+CiAgICAgIDxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI2JkZjRmZiIgc3RvcC1vcGFjaXR5PSIuOSIvPgogICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDxjbGlwUGF0aCBpZD0iaW5zaWRlIj48cGF0aCBkPSJNMTYgNzhjOC02MCAyMTYtNjAgMjI0IDBWMTkwYTI2IDI2IDAgMCAxLTI2IDI2SDEzMmMtNCAwLTcgMy04IDZsLTYgMTBjLTMgNS04IDgtMTQgOEg4MGMtNiAwLTExLTMtMTQtOGwtNi0xMGMtMS0zLTQtNi04LTZINDJhMjYgMjYgMCAwIDEtMjYtMjZaIi8+PC9jbGlwUGF0aD4KICA8L2RlZnM+CgogIDxwYXRoIGZpbGw9InVybCgjYm9keSkiIGQ9Ik0xNiA3OGM4LTYwIDIxNi02MCAyMjQgMFYxOTBhMjYgMjYgMCAwIDEtMjYgMjZIMTMyYy00IDAtNyAzLTggNmwtNiAxMGMtMyA1LTggOC0xNCA4SDgwYy02IDAtMTEtMy0xNC04bC02LTEwYy0xLTMtNC02LTgtNkg0MmEyNiAyNiAwIDAgMS0yNi0yNloiLz4KCiAgPGcgY2xpcC1wYXRoPSJ1cmwoI2luc2lkZSkiIGZpbGw9Im5vbmUiIHN0cm9rZT0idXJsKCN3YXJwKSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIj4KICAgIDxwYXRoIGQ9Ik0xNCAxNDBBMTE0IDExNCAwIDAgMSAxMjggMjYiIHN0cm9rZS13aWR0aD0iMTciLz4KICAgIDxwYXRoIGQ9Ik00OCAxNDBhODAgODAgMCAwIDEgODAtODAiIHN0cm9rZS13aWR0aD0iMTMiIG9wYWNpdHk9Ii42Ii8+CiAgICA8cGF0aCBkPSJNODIgMTQwYTQ2IDQ2IDAgMCAxIDQ2LTQ2IiBzdHJva2Utd2lkdGg9IjkiIG9wYWNpdHk9Ii40Ii8+CiAgPC9nPgoKICA8cGF0aCBkPSJNMTI4IDEwMHY4ME04OCAxNDBoODAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSIyNiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+CgogIDxjaXJjbGUgY3g9IjE5NiIgY3k9IjE5NiIgcj0iNTgiIGZpbGw9IiMxNmEzNGEiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSIxMiIvPgogIDxwYXRoIGQ9Ik0xNjggMTk4bDIwIDIwIDM4LTQyIiBmaWxsPSJub25lIiBzdHJva2U9IiNmZmYiIHN0cm9rZS13aWR0aD0iMTgiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K";
|
|
394
390
|
var bind = (instance, names) => names.forEach((name) => {
|
|
395
391
|
instance[name] = instance[name].bind(instance);
|
|
396
392
|
});
|
|
@@ -453,6 +449,11 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
453
449
|
componentDidMount() {
|
|
454
450
|
this.describe();
|
|
455
451
|
}
|
|
452
|
+
componentDidUpdate() {
|
|
453
|
+
if (this.allRequired() && this.props.entries.some((entry) => this.state.decisions.get(entry.key).execution !== "unsandboxed")) {
|
|
454
|
+
this.setState((state) => ({ decisions: new Map([...state.decisions].map(([key, decision]) => [key, __spreadProps(__spreadValues({}, decision), { execution: "unsandboxed" })])) }));
|
|
455
|
+
}
|
|
456
|
+
}
|
|
456
457
|
componentWillUnmount() {
|
|
457
458
|
this.controller.abort();
|
|
458
459
|
}
|
|
@@ -479,7 +480,15 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
479
480
|
metadataOf(entry) {
|
|
480
481
|
return entry.metadata || this.state.described.get(entry.key) || {};
|
|
481
482
|
}
|
|
483
|
+
allRequired() {
|
|
484
|
+
return this.props.mode === "open" && allRequireUnsandboxed(this.props.entries.map((entry) => __spreadProps(__spreadValues({}, entry), { metadata: this.metadataOf(entry) })));
|
|
485
|
+
}
|
|
486
|
+
executionOptions(entry) {
|
|
487
|
+
return this.allRequired() && !isTrusted(entry) ? ["unsandboxed"] : executionChoices(entry, this.props.mode);
|
|
488
|
+
}
|
|
482
489
|
decide(key, change) {
|
|
490
|
+
const entry = this.props.entries.find((entry2) => entry2.key === key);
|
|
491
|
+
if (change.execution !== void 0 && !this.executionOptions(entry).includes(change.execution)) return;
|
|
483
492
|
this.setState((state) => ({
|
|
484
493
|
decisions: new Map(state.decisions).set(key, __spreadValues(__spreadValues({}, state.decisions.get(key)), change))
|
|
485
494
|
}));
|
|
@@ -489,7 +498,7 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
489
498
|
this.setState((state) => {
|
|
490
499
|
const decisions = new Map(state.decisions);
|
|
491
500
|
for (const entry of this.props.entries) {
|
|
492
|
-
if (
|
|
501
|
+
if (this.executionOptions(entry).includes(execution)) {
|
|
493
502
|
decisions.set(entry.key, __spreadProps(__spreadValues({}, decisions.get(entry.key)), { execution }));
|
|
494
503
|
}
|
|
495
504
|
}
|
|
@@ -541,12 +550,22 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
541
550
|
const t = this.t.bind(this);
|
|
542
551
|
const decision = this.state.decisions.get(entry.key);
|
|
543
552
|
const metadata = this.metadataOf(entry);
|
|
544
|
-
const executions =
|
|
553
|
+
const executions = this.executionOptions(entry);
|
|
545
554
|
const loadings = loadingChoices(entry);
|
|
546
555
|
const state = mode === "add" ? selection.stateOf(entry.key) : null;
|
|
547
556
|
const required = state === "dependency";
|
|
548
557
|
const roots = required ? [...selection.requiredBy.get(entry.key) || []] : [];
|
|
549
558
|
const failure = entry.state && entry.state.error;
|
|
559
|
+
const preview = /* @__PURE__ */ React2.createElement(
|
|
560
|
+
ExtensionPreview,
|
|
561
|
+
{
|
|
562
|
+
url: metadata.banner || fallbackBanner,
|
|
563
|
+
fallback: !metadata.banner,
|
|
564
|
+
name: metadata.name || entry.key,
|
|
565
|
+
cache: this.props.previewCache,
|
|
566
|
+
locale: this.props.locale
|
|
567
|
+
}
|
|
568
|
+
);
|
|
550
569
|
return /* @__PURE__ */ React2.createElement(
|
|
551
570
|
"li",
|
|
552
571
|
{
|
|
@@ -563,21 +582,36 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
563
582
|
disabled: required || state === "loaded",
|
|
564
583
|
onChange: () => this.toggle(entry.key)
|
|
565
584
|
}
|
|
566
|
-
), /* @__PURE__ */ React2.createElement("strong", null, metadata.name || entry.key)), mode === "open" && /* @__PURE__ */ React2.createElement("strong", null, metadata.name || entry.key), /* @__PURE__ */ React2.createElement("span", { className: "twextsec-id" }, entry.ids.join(", ")),
|
|
567
|
-
|
|
568
|
-
entry.source.sha256 && /* @__PURE__ */ React2.createElement("p", { className: "twextsec-digest" }, t("digest"), " ", entry.source.sha256),
|
|
569
|
-
/* @__PURE__ */ React2.createElement(
|
|
570
|
-
ExtensionPreview,
|
|
585
|
+
), /* @__PURE__ */ React2.createElement("strong", null, metadata.name || entry.key)), mode === "open" && /* @__PURE__ */ React2.createElement("strong", null, metadata.name || entry.key), metadata.name && /* @__PURE__ */ React2.createElement("span", { className: "twextsec-id" }, entry.ids.join(", ")), isTrusted(entry) && /* @__PURE__ */ React2.createElement(
|
|
586
|
+
"img",
|
|
571
587
|
{
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
588
|
+
className: "twextsec-trusted",
|
|
589
|
+
src: trustedBadge,
|
|
590
|
+
alt: t("trusted"),
|
|
591
|
+
title: t("trusted")
|
|
576
592
|
}
|
|
593
|
+
), metadata.version && /* @__PURE__ */ React2.createElement("span", null, t("version"), " ", metadata.version)),
|
|
594
|
+
/* @__PURE__ */ React2.createElement(
|
|
595
|
+
"p",
|
|
596
|
+
{
|
|
597
|
+
className: "twextsec-source",
|
|
598
|
+
title: sourceLabel(entry, t)
|
|
599
|
+
},
|
|
600
|
+
sourceLabel(entry, t)
|
|
577
601
|
),
|
|
602
|
+
entry.source.sha256 && /* @__PURE__ */ React2.createElement("p", { className: "twextsec-digest" }, t("digest"), " ", entry.source.sha256),
|
|
603
|
+
mode === "add" ? /* @__PURE__ */ React2.createElement(
|
|
604
|
+
"span",
|
|
605
|
+
{
|
|
606
|
+
className: "twextsec-preview-pick",
|
|
607
|
+
"aria-hidden": "true",
|
|
608
|
+
onClick: required || state === "loaded" ? void 0 : () => this.toggle(entry.key)
|
|
609
|
+
},
|
|
610
|
+
preview
|
|
611
|
+
) : preview,
|
|
578
612
|
/* @__PURE__ */ React2.createElement("p", { className: "twextsec-about" }, getExtensionDescription(metadata, this.props.locale)),
|
|
579
|
-
/* @__PURE__ */ React2.createElement("p", { className: "twextsec-claim" }, t("creator"), ": ", metadata.author || t("creatorUnknown")
|
|
580
|
-
state && /* @__PURE__ */ React2.createElement("
|
|
613
|
+
/* @__PURE__ */ React2.createElement("p", { className: "twextsec-claim" }, t("creator"), ": ", metadata.author || t("creatorUnknown")),
|
|
614
|
+
/* @__PURE__ */ React2.createElement("div", { className: "twextsec-status" }, (required || state === "loaded") && /* @__PURE__ */ React2.createElement("span", { className: "twextsec-state" }, required ? t("state-dependency", { names: roots.join(", ") }) : t("state-loaded")), unsandboxedRequirement(metadata) === "required" && /* @__PURE__ */ React2.createElement("span", { className: "twextsec-requirement" }, t("requirement-required"))),
|
|
581
615
|
failure && /* @__PURE__ */ React2.createElement(
|
|
582
616
|
Failure,
|
|
583
617
|
{
|
|
@@ -586,7 +620,7 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
586
620
|
t
|
|
587
621
|
}
|
|
588
622
|
),
|
|
589
|
-
|
|
623
|
+
/* @__PURE__ */ React2.createElement("div", { className: "twextsec-choices" }, !isTrusted(entry) && /* @__PURE__ */ React2.createElement(
|
|
590
624
|
Choices,
|
|
591
625
|
{
|
|
592
626
|
name: `execution-${entry.key}`,
|
|
@@ -596,9 +630,7 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
596
630
|
onChange: (event) => this.decide(entry.key, { execution: event.target.value }),
|
|
597
631
|
t
|
|
598
632
|
}
|
|
599
|
-
),
|
|
600
|
-
!isTrusted(entry) && /* @__PURE__ */ React2.createElement("p", { className: "twextsec-requirement" }, t(`requirement-${unsandboxedRequirement(metadata)}`)),
|
|
601
|
-
loadings.length > 0 && /* @__PURE__ */ React2.createElement(
|
|
633
|
+
), loadings.length > 0 && /* @__PURE__ */ React2.createElement(
|
|
602
634
|
Choices,
|
|
603
635
|
{
|
|
604
636
|
name: `loading-${entry.key}`,
|
|
@@ -608,7 +640,7 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
608
640
|
onChange: (event) => this.decide(entry.key, { loading: event.target.value }),
|
|
609
641
|
t
|
|
610
642
|
}
|
|
611
|
-
),
|
|
643
|
+
)),
|
|
612
644
|
loadings.length === 0 && decision.loading !== void 0 && /* @__PURE__ */ React2.createElement("p", { className: "twextsec-loading-fixed" }, t(`loading-${decision.loading}`)),
|
|
613
645
|
contradictsDeclaration(entry, decision) && /* @__PURE__ */ React2.createElement(
|
|
614
646
|
"p",
|
|
@@ -624,16 +656,17 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
624
656
|
const { mode, entries, DialogFrame, failure, onRetry } = this.props;
|
|
625
657
|
const t = this.t.bind(this);
|
|
626
658
|
const selection = this.selection();
|
|
659
|
+
const allRequired = this.allRequired();
|
|
627
660
|
const anyUnsandboxed = [...this.included()].some((key) => this.state.decisions.get(key).execution === "unsandboxed");
|
|
628
661
|
const bulkLoadings = loadingModes.filter((mode2) => entries.some((entry) => loadingChoices(entry).includes(mode2)));
|
|
629
|
-
const body = /* @__PURE__ */ React2.createElement("div", { className: "twextsec-review" }, /* @__PURE__ */ React2.createElement("p", { className: "twextsec-intro" }, t(mode === "add" ? "addIntro" : "openIntro")), failure && /* @__PURE__ */ React2.createElement(
|
|
662
|
+
const body = /* @__PURE__ */ React2.createElement("div", { className: "twextsec-review" }, /* @__PURE__ */ React2.createElement("p", { className: "twextsec-intro" }, t(mode === "add" ? "addIntro" : allRequired ? "allRequiredIntro" : "openIntro")), failure && /* @__PURE__ */ React2.createElement(
|
|
630
663
|
Failure,
|
|
631
664
|
{
|
|
632
665
|
failure,
|
|
633
666
|
onRetry,
|
|
634
667
|
t
|
|
635
668
|
}
|
|
636
|
-
), /* @__PURE__ */ React2.createElement("div", { className: "twextsec-bulk" }, /* @__PURE__ */ React2.createElement(
|
|
669
|
+
), (!allRequired || bulkLoadings.length > 0) && /* @__PURE__ */ React2.createElement("div", { className: "twextsec-bulk" }, !allRequired && /* @__PURE__ */ React2.createElement(
|
|
637
670
|
Choices,
|
|
638
671
|
{
|
|
639
672
|
name: "execution-all",
|
package/dist/turbowarp.cjs
CHANGED
|
@@ -24,8 +24,38 @@ __export(turbowarp_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(turbowarp_exports);
|
|
26
26
|
|
|
27
|
+
// src/metadata.js
|
|
28
|
+
var HEADER_FIELDS = Object.freeze({
|
|
29
|
+
name: "name",
|
|
30
|
+
id: "id",
|
|
31
|
+
description: "description",
|
|
32
|
+
by: "author",
|
|
33
|
+
author: "author",
|
|
34
|
+
version: "version",
|
|
35
|
+
license: "license",
|
|
36
|
+
unsandboxed: "unsandboxed",
|
|
37
|
+
repository: "repository",
|
|
38
|
+
source: "repository",
|
|
39
|
+
"docs url": "docsURL",
|
|
40
|
+
docsurl: "docsURL",
|
|
41
|
+
"author url": "authorURL",
|
|
42
|
+
authorurl: "authorURL",
|
|
43
|
+
banner: "banner",
|
|
44
|
+
package: "package"
|
|
45
|
+
});
|
|
46
|
+
function unsandboxedRequirement(metadata) {
|
|
47
|
+
const declared = metadata && typeof metadata.unsandboxed === "string" ? metadata.unsandboxed.trim().toLowerCase() : "";
|
|
48
|
+
if (["required", "true", "yes"].includes(declared)) return "required";
|
|
49
|
+
if (["optional", "maybe"].includes(declared)) return "optional";
|
|
50
|
+
if (["false", "no", "not-needed", "none"].includes(declared)) return "not-needed";
|
|
51
|
+
return "unknown";
|
|
52
|
+
}
|
|
53
|
+
|
|
27
54
|
// src/decisions.js
|
|
28
55
|
var isTrusted = (entry) => Boolean(entry && entry.state && entry.state.trusted);
|
|
56
|
+
var allRequireUnsandboxed = (entries) => entries.length > 0 && entries.every(
|
|
57
|
+
(entry) => !(entry.state && entry.state.error) && unsandboxedRequirement(entry.metadata || {}) === "required"
|
|
58
|
+
);
|
|
29
59
|
var loadingModes = Object.freeze([
|
|
30
60
|
"remote-cacheable",
|
|
31
61
|
"remote-non-cacheable",
|
|
@@ -46,11 +76,13 @@ function initialDecisions(entries, mode, {
|
|
|
46
76
|
recorded = /* @__PURE__ */ new Map(),
|
|
47
77
|
fallbackLoading = "remote-cacheable"
|
|
48
78
|
} = {}) {
|
|
79
|
+
const allRequired = mode === "open" && allRequireUnsandboxed(entries);
|
|
49
80
|
return new Map(entries.map((entry) => {
|
|
50
81
|
const base = defaultDecision(entry, mode, fallbackLoading);
|
|
82
|
+
if (allRequired) base.execution = "unsandboxed";
|
|
51
83
|
const previous = recorded.get(entry.key);
|
|
52
84
|
if (!previous) return [entry.key, base];
|
|
53
|
-
const execution = executionChoices(entry, mode).includes(previous.execution) ? previous.execution : base.execution;
|
|
85
|
+
const execution = !allRequired && executionChoices(entry, mode).includes(previous.execution) ? previous.execution : base.execution;
|
|
54
86
|
const loading = loadingChoices(entry).includes(previous.loading) ? previous.loading : base.loading;
|
|
55
87
|
return [entry.key, loading === void 0 ? { execution } : { execution, loading }];
|
|
56
88
|
}));
|
package/dist/turbowarp.mjs
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
|
+
// src/metadata.js
|
|
2
|
+
var HEADER_FIELDS = Object.freeze({
|
|
3
|
+
name: "name",
|
|
4
|
+
id: "id",
|
|
5
|
+
description: "description",
|
|
6
|
+
by: "author",
|
|
7
|
+
author: "author",
|
|
8
|
+
version: "version",
|
|
9
|
+
license: "license",
|
|
10
|
+
unsandboxed: "unsandboxed",
|
|
11
|
+
repository: "repository",
|
|
12
|
+
source: "repository",
|
|
13
|
+
"docs url": "docsURL",
|
|
14
|
+
docsurl: "docsURL",
|
|
15
|
+
"author url": "authorURL",
|
|
16
|
+
authorurl: "authorURL",
|
|
17
|
+
banner: "banner",
|
|
18
|
+
package: "package"
|
|
19
|
+
});
|
|
20
|
+
function unsandboxedRequirement(metadata) {
|
|
21
|
+
const declared = metadata && typeof metadata.unsandboxed === "string" ? metadata.unsandboxed.trim().toLowerCase() : "";
|
|
22
|
+
if (["required", "true", "yes"].includes(declared)) return "required";
|
|
23
|
+
if (["optional", "maybe"].includes(declared)) return "optional";
|
|
24
|
+
if (["false", "no", "not-needed", "none"].includes(declared)) return "not-needed";
|
|
25
|
+
return "unknown";
|
|
26
|
+
}
|
|
27
|
+
|
|
1
28
|
// src/decisions.js
|
|
2
29
|
var isTrusted = (entry) => Boolean(entry && entry.state && entry.state.trusted);
|
|
30
|
+
var allRequireUnsandboxed = (entries) => entries.length > 0 && entries.every(
|
|
31
|
+
(entry) => !(entry.state && entry.state.error) && unsandboxedRequirement(entry.metadata || {}) === "required"
|
|
32
|
+
);
|
|
3
33
|
var loadingModes = Object.freeze([
|
|
4
34
|
"remote-cacheable",
|
|
5
35
|
"remote-non-cacheable",
|
|
@@ -20,11 +50,13 @@ function initialDecisions(entries, mode, {
|
|
|
20
50
|
recorded = /* @__PURE__ */ new Map(),
|
|
21
51
|
fallbackLoading = "remote-cacheable"
|
|
22
52
|
} = {}) {
|
|
53
|
+
const allRequired = mode === "open" && allRequireUnsandboxed(entries);
|
|
23
54
|
return new Map(entries.map((entry) => {
|
|
24
55
|
const base = defaultDecision(entry, mode, fallbackLoading);
|
|
56
|
+
if (allRequired) base.execution = "unsandboxed";
|
|
25
57
|
const previous = recorded.get(entry.key);
|
|
26
58
|
if (!previous) return [entry.key, base];
|
|
27
|
-
const execution = executionChoices(entry, mode).includes(previous.execution) ? previous.execution : base.execution;
|
|
59
|
+
const execution = !allRequired && executionChoices(entry, mode).includes(previous.execution) ? previous.execution : base.execution;
|
|
28
60
|
const loading = loadingChoices(entry).includes(previous.loading) ? previous.loading : base.loading;
|
|
29
61
|
return [entry.key, loading === void 0 ? { execution } : { execution, loading }];
|
|
30
62
|
}));
|
package/package.json
CHANGED
package/styles.css
CHANGED
|
@@ -4,24 +4,45 @@
|
|
|
4
4
|
.twextsec-bulk { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: flex-start; padding: 12px; border: 1px solid var(--ui-black-transparent, #0000001a); border-radius: 8px; }
|
|
5
5
|
.twextsec-note { flex: 1 1 100%; margin: 0; font-size: .9em; opacity: .8; }
|
|
6
6
|
.twextsec-warning { margin: 12px 0; padding: 10px 12px; border-radius: 8px; background: var(--ui-warning-background, #fff3cd); }
|
|
7
|
-
.twextsec-rows { margin:
|
|
8
|
-
.twextsec-row { padding:
|
|
7
|
+
.twextsec-rows { margin: 10px 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
|
|
8
|
+
.twextsec-row { padding: 8px 10px; border: 1px solid var(--ui-black-transparent, #0000001a); border-radius: 8px;
|
|
9
|
+
display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 10px; }
|
|
10
|
+
/* The icon sits in its own column beside everything else the row says. */
|
|
11
|
+
.twextsec-row > * { grid-column: 2; }
|
|
12
|
+
.twextsec-row > .twextsec-preview, .twextsec-row > .twextsec-preview-pick { grid-column: 1; grid-row: 1 / span 20; }
|
|
13
|
+
.twextsec-preview-pick { display: block; cursor: pointer; }
|
|
9
14
|
.twextsec-row[data-failed="true"] { border-color: var(--ui-danger, #b91c1c); }
|
|
10
15
|
.twextsec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
|
|
11
|
-
.twextsec-pick { display: flex; align-items:
|
|
12
|
-
|
|
13
|
-
.twextsec-
|
|
16
|
+
.twextsec-pick { display: flex; align-items: center; gap: 8px; cursor: pointer; }
|
|
17
|
+
/* A larger box than the browser's default, so it is easy to hit. */
|
|
18
|
+
.twextsec-pick input[type="checkbox"] { width: 20px; height: 20px; margin: 0; flex: none; cursor: pointer; }
|
|
19
|
+
.twextsec-pick input[type="checkbox"]:disabled { cursor: default; }
|
|
20
|
+
.twextsec-id, .twextsec-source, .twextsec-digest { overflow-wrap: anywhere; font-size: .8em; opacity: .7; }
|
|
21
|
+
.twextsec-source { margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
22
|
+
.twextsec-digest { margin: 2px 0 0; }
|
|
23
|
+
.twextsec-about, .twextsec-claim { margin: 2px 0 0; font-size: .9em; }
|
|
24
|
+
.twextsec-claim { font-size: .8em; }
|
|
25
|
+
.twextsec-status { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 4px 0 0; font-size: .9em; }
|
|
14
26
|
.twextsec-claim, .twextsec-requirement { opacity: .8; }
|
|
15
|
-
.twextsec-trusted {
|
|
27
|
+
.twextsec-trusted { width: 22px; height: 22px; align-self: center; flex: none; }
|
|
28
|
+
.twextsec-status:empty { display: none; }
|
|
16
29
|
.twextsec-failed, .twextsec-contradiction { margin: 6px 0 0; color: var(--ui-danger, #b91c1c); }
|
|
17
30
|
.twextsec-failed p { margin: 0; }
|
|
18
31
|
.twextsec-failed .twextsec-retry-note { margin-top: 4px; font-size: .9em; }
|
|
19
32
|
.twextsec-retry { margin-top: 6px; font: inherit; padding: 4px 12px; border: 1px solid currentColor; border-radius: 6px; background: transparent; color: inherit; cursor: pointer; }
|
|
20
|
-
|
|
33
|
+
/* Inside the bulk box the choices keep their frame; in a row they read as one labelled line each. */
|
|
34
|
+
.twextsec-choice { margin: 0; padding: 6px 10px; border: 1px solid var(--ui-black-transparent, #0000001a); border-radius: 6px; }
|
|
21
35
|
.twextsec-choice legend { padding: 0 4px; font-size: .85em; opacity: .8; }
|
|
22
36
|
.twextsec-choice label { display: inline-flex; align-items: center; gap: 4px; margin-right: 14px; }
|
|
37
|
+
.twextsec-choices { display: flex; flex-wrap: wrap; gap: 2px 18px; margin: 2px 0 0; }
|
|
38
|
+
.twextsec-choices:empty { display: none; }
|
|
39
|
+
.twextsec-choices .twextsec-choice { padding: 0; border: 0; font-size: .9em; }
|
|
40
|
+
.twextsec-choices .twextsec-choice legend { float: left; padding: 0; margin-right: 8px; }
|
|
41
|
+
.twextsec-choices .twextsec-choice label { margin-right: 10px; }
|
|
23
42
|
.twextsec-actions { display: flex; justify-content: flex-end; gap: 12px; margin: 0; padding: 0; }
|
|
24
43
|
.twextsec-actions button { font: inherit; padding: 8px 16px; border: 1px solid var(--ui-black-transparent, #0000001a); border-radius: 6px; background: var(--ui-modal-background, #fff); color: inherit; cursor: pointer; }
|
|
25
44
|
.twextsec-actions button[data-testid="twextsec-complete"] { background: var(--looks-secondary, #1d4ed8); color: #fff; border-color: transparent; }
|
|
26
45
|
.twextsec-actions button:focus-visible { outline: 3px solid var(--link-color, #7352d6); outline-offset: 2px; }
|
|
27
|
-
|
|
46
|
+
/* Catalog banners are block icons, so a row shows its picture at icon size, not as a wide banner. */
|
|
47
|
+
.twextsec-preview { display: block; width: 40px; height: 40px; object-fit: contain; margin: 2px 0 0; border-radius: 6px; }
|
|
48
|
+
.twextsec-preview-fallback { opacity: .5; }
|
package/webpack4.css
CHANGED
|
@@ -4,24 +4,45 @@
|
|
|
4
4
|
:global(.twextsec-bulk) { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: flex-start; padding: 12px; border: 1px solid var(--ui-black-transparent, #0000001a); border-radius: 8px; }
|
|
5
5
|
:global(.twextsec-note) { flex: 1 1 100%; margin: 0; font-size: .9em; opacity: .8; }
|
|
6
6
|
:global(.twextsec-warning) { margin: 12px 0; padding: 10px 12px; border-radius: 8px; background: var(--ui-warning-background, #fff3cd); }
|
|
7
|
-
:global(.twextsec-rows) { margin:
|
|
8
|
-
:global(.twextsec-row) { padding:
|
|
7
|
+
:global(.twextsec-rows) { margin: 10px 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
|
|
8
|
+
:global(.twextsec-row) { padding: 8px 10px; border: 1px solid var(--ui-black-transparent, #0000001a); border-radius: 8px;
|
|
9
|
+
display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 10px; }
|
|
10
|
+
/* The icon sits in its own column beside everything else the row says. */
|
|
11
|
+
:global(.twextsec-row) > * { grid-column: 2; }
|
|
12
|
+
:global(.twextsec-row) > :global(.twextsec-preview), :global(.twextsec-row) > :global(.twextsec-preview-pick) { grid-column: 1; grid-row: 1 / span 20; }
|
|
13
|
+
:global(.twextsec-preview-pick) { display: block; cursor: pointer; }
|
|
9
14
|
:global(.twextsec-row)[data-failed="true"] { border-color: var(--ui-danger, #b91c1c); }
|
|
10
15
|
:global(.twextsec-head) { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
|
|
11
|
-
:global(.twextsec-pick) { display: flex; align-items:
|
|
12
|
-
|
|
13
|
-
:global(.twextsec-
|
|
16
|
+
:global(.twextsec-pick) { display: flex; align-items: center; gap: 8px; cursor: pointer; }
|
|
17
|
+
/* A larger box than the browser's default, so it is easy to hit. */
|
|
18
|
+
:global(.twextsec-pick) input[type="checkbox"] { width: 20px; height: 20px; margin: 0; flex: none; cursor: pointer; }
|
|
19
|
+
:global(.twextsec-pick) input[type="checkbox"]:disabled { cursor: default; }
|
|
20
|
+
:global(.twextsec-id), :global(.twextsec-source), :global(.twextsec-digest) { overflow-wrap: anywhere; font-size: .8em; opacity: .7; }
|
|
21
|
+
:global(.twextsec-source) { margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
22
|
+
:global(.twextsec-digest) { margin: 2px 0 0; }
|
|
23
|
+
:global(.twextsec-about), :global(.twextsec-claim) { margin: 2px 0 0; font-size: .9em; }
|
|
24
|
+
:global(.twextsec-claim) { font-size: .8em; }
|
|
25
|
+
:global(.twextsec-status) { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 4px 0 0; font-size: .9em; }
|
|
14
26
|
:global(.twextsec-claim), :global(.twextsec-requirement) { opacity: .8; }
|
|
15
|
-
:global(.twextsec-trusted) {
|
|
27
|
+
:global(.twextsec-trusted) { width: 22px; height: 22px; align-self: center; flex: none; }
|
|
28
|
+
:global(.twextsec-status):empty { display: none; }
|
|
16
29
|
:global(.twextsec-failed), :global(.twextsec-contradiction) { margin: 6px 0 0; color: var(--ui-danger, #b91c1c); }
|
|
17
30
|
:global(.twextsec-failed) p { margin: 0; }
|
|
18
31
|
:global(.twextsec-failed) :global(.twextsec-retry-note) { margin-top: 4px; font-size: .9em; }
|
|
19
32
|
:global(.twextsec-retry) { margin-top: 6px; font: inherit; padding: 4px 12px; border: 1px solid currentColor; border-radius: 6px; background: transparent; color: inherit; cursor: pointer; }
|
|
20
|
-
|
|
33
|
+
/* Inside the bulk box the choices keep their frame; in a row they read as one labelled line each. */
|
|
34
|
+
:global(.twextsec-choice) { margin: 0; padding: 6px 10px; border: 1px solid var(--ui-black-transparent, #0000001a); border-radius: 6px; }
|
|
21
35
|
:global(.twextsec-choice) legend { padding: 0 4px; font-size: .85em; opacity: .8; }
|
|
22
36
|
:global(.twextsec-choice) label { display: inline-flex; align-items: center; gap: 4px; margin-right: 14px; }
|
|
37
|
+
:global(.twextsec-choices) { display: flex; flex-wrap: wrap; gap: 2px 18px; margin: 2px 0 0; }
|
|
38
|
+
:global(.twextsec-choices):empty { display: none; }
|
|
39
|
+
:global(.twextsec-choices) :global(.twextsec-choice) { padding: 0; border: 0; font-size: .9em; }
|
|
40
|
+
:global(.twextsec-choices) :global(.twextsec-choice) legend { float: left; padding: 0; margin-right: 8px; }
|
|
41
|
+
:global(.twextsec-choices) :global(.twextsec-choice) label { margin-right: 10px; }
|
|
23
42
|
:global(.twextsec-actions) { display: flex; justify-content: flex-end; gap: 12px; margin: 0; padding: 0; }
|
|
24
43
|
:global(.twextsec-actions) button { font: inherit; padding: 8px 16px; border: 1px solid var(--ui-black-transparent, #0000001a); border-radius: 6px; background: var(--ui-modal-background, #fff); color: inherit; cursor: pointer; }
|
|
25
44
|
:global(.twextsec-actions) button[data-testid="twextsec-complete"] { background: var(--looks-secondary, #1d4ed8); color: #fff; border-color: transparent; }
|
|
26
45
|
:global(.twextsec-actions) button:focus-visible { outline: 3px solid var(--link-color, #7352d6); outline-offset: 2px; }
|
|
27
|
-
|
|
46
|
+
/* Catalog banners are block icons, so a row shows its picture at icon size, not as a wide banner. */
|
|
47
|
+
:global(.twextsec-preview) { display: block; width: 40px; height: 40px; object-fit: contain; margin: 2px 0 0; border-radius: 6px; }
|
|
48
|
+
:global(.twextsec-preview-fallback) { opacity: .5; }
|