@kubohiroya/turbowarp-extension-security-dialog 0.8.1 → 0.8.2
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 +12 -2
- package/README.ja.md +22 -4
- package/README.md +23 -4
- package/dist/build-info.json +2 -2
- package/dist/index.cjs +32 -24
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +32 -24
- package/dist/react.cjs +62 -37
- package/dist/react.mjs +62 -37
- package/dist/turbowarp.cjs +33 -1
- package/dist/turbowarp.mjs +33 -1
- package/package.json +1 -1
- package/styles.css +23 -7
- package/webpack4.css +23 -7
package/NOTICE.md
CHANGED
|
@@ -16,15 +16,25 @@ published package.
|
|
|
16
16
|
|
|
17
17
|
Published archives include `dist/build-info.json` with this package's name, version and full Git
|
|
18
18
|
revision. `sourceState: "commit"` identifies a build from committed inputs; `"working-tree"` marks
|
|
19
|
-
a local build with changes to those inputs.
|
|
19
|
+
a local build with changes to those inputs. `"git-archive"` identifies npm preparing a fixed GitHub
|
|
20
|
+
archive without `.git`; the installer supplies its locked full SHA in `TWEXTSEC_SOURCE_REVISION`
|
|
21
|
+
and verifies that pin against the installed build info. A missing or malformed SHA fails the build.
|
|
22
|
+
This file records provenance, without changing the
|
|
20
23
|
licenses described here.
|
|
21
24
|
|
|
22
25
|
## Screenshots kept in this repository
|
|
23
26
|
|
|
24
|
-
`assets/screenshots/` holds captures of the public Editor
|
|
27
|
+
`assets/screenshots/` holds historical captures and current captures of the public Editor. They are
|
|
25
28
|
**not published**: `files` in `package.json` does not include `assets`, so they stay in the
|
|
26
29
|
repository and never reach npm.
|
|
27
30
|
|
|
28
31
|
They are also **not covered by this package's licence**. The captured interface, icons and banners
|
|
29
32
|
keep their own rights holders and their own terms. Their origin, the Editor revisions they were
|
|
30
33
|
taken from and their hashes are recorded in the JSON files beside them.
|
|
34
|
+
|
|
35
|
+
`assets/screenshots/all-required-open-{en,ja}-20261103.png` show the public TurboWarp-Plus-Editor on
|
|
36
|
+
3 November 2026 with the sole required execution mode preselected, before OK and before any extension runs.
|
|
37
|
+
The source distributions are Camera Source 0.19.4, Asset Cache 0.3.2 and Bubble 0.13.5. The images are
|
|
38
|
+
unmodified browser captures; source integrity, Editor revisions, image hashes and checks are recorded in
|
|
39
|
+
`assets/screenshots/all-required-open-20261103.json`. The captured interface and extension graphics retain
|
|
40
|
+
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,24 @@ 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
|
-
"requirement-optional": "
|
|
546
|
-
"requirement-not-needed": "
|
|
547
|
-
"requirement-unknown": "
|
|
548
|
-
trusted: "
|
|
553
|
+
"requirement-required": "\u2753 Not in the catalog: says it needs to run without the sandbox",
|
|
554
|
+
"requirement-optional": "\u2753 Not in the catalog: says running without the sandbox is optional",
|
|
555
|
+
"requirement-not-needed": "\u2753 Not in the catalog: says the sandbox is fine",
|
|
556
|
+
"requirement-unknown": "\u2753 Not in the catalog: says nothing about the sandbox",
|
|
557
|
+
trusted: "\u{1F4D5} In the catalog: can run without the sandbox",
|
|
549
558
|
trustedNote: "Catalog extensions are treated like TurboWarp\u2019s own gallery and are not asked about.",
|
|
550
|
-
"state-loaded": "Already running",
|
|
551
|
-
"state-selected": "
|
|
552
|
-
"state-dependency": "Needed by {names}",
|
|
553
|
-
"state-unselected": "Not
|
|
559
|
+
"state-loaded": "\u25B6\uFE0F Already running",
|
|
560
|
+
"state-selected": "\u2705 Selected",
|
|
561
|
+
"state-dependency": "\u{1F517} Needed by {names}",
|
|
562
|
+
"state-unselected": "\u2610 Not selected",
|
|
554
563
|
sourceEmbedded: "Stored in the project",
|
|
555
564
|
sourceLegacy: "A custom extension address",
|
|
556
565
|
sourceInline: "Written into the project as a data address",
|
|
557
|
-
creator: "Creator",
|
|
566
|
+
creator: "Creator (unverified claim)",
|
|
558
567
|
creatorUnknown: "Not stated",
|
|
559
568
|
licenseUnknown: "Not stated",
|
|
560
569
|
version: "Version",
|
|
561
570
|
digest: "SHA-256",
|
|
562
|
-
unverified: "The creator\u2019s name is the extension\u2019s own claim and is not verified.",
|
|
563
571
|
failed: "Could not be loaded",
|
|
564
572
|
retryNote: "This may be a network problem.",
|
|
565
573
|
retry: "Try again",
|
|
@@ -576,6 +584,7 @@ var messages = {
|
|
|
576
584
|
openTitle: "\u3053\u306E\u4F5C\u54C1\u306F\u6A5F\u80FD\u62E1\u5F35\u3092\u4F7F\u3044\u307E\u3059",
|
|
577
585
|
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
586
|
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",
|
|
587
|
+
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
588
|
execution: "\u52D5\u304B\u3057\u65B9",
|
|
580
589
|
loading: "\u8AAD\u307F\u8FBC\u307F\u5143",
|
|
581
590
|
executionBulk: "\u3059\u3079\u3066\u306E\u52D5\u304B\u3057\u65B9",
|
|
@@ -589,25 +598,24 @@ var messages = {
|
|
|
589
598
|
"loading-embedded-data": "\u4F5C\u54C1\u306E\u4E2D\u306E data: \u30A2\u30C9\u30EC\u30B9\u304B\u3089",
|
|
590
599
|
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
600
|
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\u3068\u7533\u544A
|
|
593
|
-
"requirement-optional": "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306F\u4EFB\u610F\u3068\u7533\u544A
|
|
594
|
-
"requirement-not-needed": "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u3067\
|
|
595
|
-
"requirement-unknown": "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306B\u3064\u3044\u3066\u7533\u544A\
|
|
596
|
-
trusted: "\u30AB\u30BF\u30ED\u30B0\
|
|
601
|
+
"requirement-required": "\u2753 \u30AB\u30BF\u30ED\u30B0\u8A18\u8F09\u306A\u3057\uFF1A\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u304C\u5FC5\u8981\u3068\u7533\u544A",
|
|
602
|
+
"requirement-optional": "\u2753 \u30AB\u30BF\u30ED\u30B0\u8A18\u8F09\u306A\u3057\uFF1A\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u52D5\u4F5C\u306F\u4EFB\u610F\u3068\u7533\u544A",
|
|
603
|
+
"requirement-not-needed": "\u2753 \u30AB\u30BF\u30ED\u30B0\u8A18\u8F09\u306A\u3057\uFF1A\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u3067\u52D5\u4F5C\u53EF\u3068\u7533\u544A",
|
|
604
|
+
"requirement-unknown": "\u2753 \u30AB\u30BF\u30ED\u30B0\u8A18\u8F09\u306A\u3057\uFF1A\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306B\u3064\u3044\u3066\u7533\u544A\u306A\u3057",
|
|
605
|
+
trusted: "\u{1F4D5} \u30AB\u30BF\u30ED\u30B0\u8A18\u8F09\u3042\u308A\uFF1A\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u52D5\u4F5C\u53EF",
|
|
597
606
|
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-selected": "\u9078\u629E\
|
|
600
|
-
"state-dependency": "{names} \u304C\u5FC5\u8981\u3068\u3057\u3066\u3044\u307E\u3059",
|
|
601
|
-
"state-unselected": "\
|
|
607
|
+
"state-loaded": "\u25B6\uFE0F \u8AAD\u307F\u8FBC\u307F\u6E08\u307F",
|
|
608
|
+
"state-selected": "\u2705 \u9078\u629E\u4E2D",
|
|
609
|
+
"state-dependency": "\u{1F517} {names} \u304C\u5FC5\u8981\u3068\u3057\u3066\u3044\u307E\u3059",
|
|
610
|
+
"state-unselected": "\u2610 \u975E\u9078\u629E",
|
|
602
611
|
sourceEmbedded: "\u4F5C\u54C1\u306E\u4E2D\u306B\u3042\u308A\u307E\u3059",
|
|
603
612
|
sourceLegacy: "\u30AB\u30B9\u30BF\u30E0\u62E1\u5F35\u306E\u30A2\u30C9\u30EC\u30B9",
|
|
604
613
|
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",
|
|
614
|
+
creator: "\u88FD\u4F5C\u8005\uFF08\u672A\u691C\u8A3C\u306E\u7533\u544A\uFF09",
|
|
606
615
|
creatorUnknown: "\u8A18\u8F09\u306A\u3057",
|
|
607
616
|
licenseUnknown: "\u8A18\u8F09\u306A\u3057",
|
|
608
617
|
version: "\u30D0\u30FC\u30B8\u30E7\u30F3",
|
|
609
618
|
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
619
|
failed: "\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",
|
|
612
620
|
retryNote: "\u901A\u4FE1\u306E\u554F\u984C\u306E\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002",
|
|
613
621
|
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,24 @@ 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
|
-
"requirement-optional": "
|
|
503
|
-
"requirement-not-needed": "
|
|
504
|
-
"requirement-unknown": "
|
|
505
|
-
trusted: "
|
|
509
|
+
"requirement-required": "\u2753 Not in the catalog: says it needs to run without the sandbox",
|
|
510
|
+
"requirement-optional": "\u2753 Not in the catalog: says running without the sandbox is optional",
|
|
511
|
+
"requirement-not-needed": "\u2753 Not in the catalog: says the sandbox is fine",
|
|
512
|
+
"requirement-unknown": "\u2753 Not in the catalog: says nothing about the sandbox",
|
|
513
|
+
trusted: "\u{1F4D5} In the catalog: can run without the sandbox",
|
|
506
514
|
trustedNote: "Catalog extensions are treated like TurboWarp\u2019s own gallery and are not asked about.",
|
|
507
|
-
"state-loaded": "Already running",
|
|
508
|
-
"state-selected": "
|
|
509
|
-
"state-dependency": "Needed by {names}",
|
|
510
|
-
"state-unselected": "Not
|
|
515
|
+
"state-loaded": "\u25B6\uFE0F Already running",
|
|
516
|
+
"state-selected": "\u2705 Selected",
|
|
517
|
+
"state-dependency": "\u{1F517} Needed by {names}",
|
|
518
|
+
"state-unselected": "\u2610 Not selected",
|
|
511
519
|
sourceEmbedded: "Stored in the project",
|
|
512
520
|
sourceLegacy: "A custom extension address",
|
|
513
521
|
sourceInline: "Written into the project as a data address",
|
|
514
|
-
creator: "Creator",
|
|
522
|
+
creator: "Creator (unverified claim)",
|
|
515
523
|
creatorUnknown: "Not stated",
|
|
516
524
|
licenseUnknown: "Not stated",
|
|
517
525
|
version: "Version",
|
|
518
526
|
digest: "SHA-256",
|
|
519
|
-
unverified: "The creator\u2019s name is the extension\u2019s own claim and is not verified.",
|
|
520
527
|
failed: "Could not be loaded",
|
|
521
528
|
retryNote: "This may be a network problem.",
|
|
522
529
|
retry: "Try again",
|
|
@@ -533,6 +540,7 @@ var messages = {
|
|
|
533
540
|
openTitle: "\u3053\u306E\u4F5C\u54C1\u306F\u6A5F\u80FD\u62E1\u5F35\u3092\u4F7F\u3044\u307E\u3059",
|
|
534
541
|
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
542
|
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",
|
|
543
|
+
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
544
|
execution: "\u52D5\u304B\u3057\u65B9",
|
|
537
545
|
loading: "\u8AAD\u307F\u8FBC\u307F\u5143",
|
|
538
546
|
executionBulk: "\u3059\u3079\u3066\u306E\u52D5\u304B\u3057\u65B9",
|
|
@@ -546,25 +554,24 @@ var messages = {
|
|
|
546
554
|
"loading-embedded-data": "\u4F5C\u54C1\u306E\u4E2D\u306E data: \u30A2\u30C9\u30EC\u30B9\u304B\u3089",
|
|
547
555
|
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
556
|
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\u3068\u7533\u544A
|
|
550
|
-
"requirement-optional": "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306F\u4EFB\u610F\u3068\u7533\u544A
|
|
551
|
-
"requirement-not-needed": "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u3067\
|
|
552
|
-
"requirement-unknown": "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306B\u3064\u3044\u3066\u7533\u544A\
|
|
553
|
-
trusted: "\u30AB\u30BF\u30ED\u30B0\
|
|
557
|
+
"requirement-required": "\u2753 \u30AB\u30BF\u30ED\u30B0\u8A18\u8F09\u306A\u3057\uFF1A\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u304C\u5FC5\u8981\u3068\u7533\u544A",
|
|
558
|
+
"requirement-optional": "\u2753 \u30AB\u30BF\u30ED\u30B0\u8A18\u8F09\u306A\u3057\uFF1A\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u52D5\u4F5C\u306F\u4EFB\u610F\u3068\u7533\u544A",
|
|
559
|
+
"requirement-not-needed": "\u2753 \u30AB\u30BF\u30ED\u30B0\u8A18\u8F09\u306A\u3057\uFF1A\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u3067\u52D5\u4F5C\u53EF\u3068\u7533\u544A",
|
|
560
|
+
"requirement-unknown": "\u2753 \u30AB\u30BF\u30ED\u30B0\u8A18\u8F09\u306A\u3057\uFF1A\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306B\u3064\u3044\u3066\u7533\u544A\u306A\u3057",
|
|
561
|
+
trusted: "\u{1F4D5} \u30AB\u30BF\u30ED\u30B0\u8A18\u8F09\u3042\u308A\uFF1A\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u52D5\u4F5C\u53EF",
|
|
554
562
|
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-selected": "\u9078\u629E\
|
|
557
|
-
"state-dependency": "{names} \u304C\u5FC5\u8981\u3068\u3057\u3066\u3044\u307E\u3059",
|
|
558
|
-
"state-unselected": "\
|
|
563
|
+
"state-loaded": "\u25B6\uFE0F \u8AAD\u307F\u8FBC\u307F\u6E08\u307F",
|
|
564
|
+
"state-selected": "\u2705 \u9078\u629E\u4E2D",
|
|
565
|
+
"state-dependency": "\u{1F517} {names} \u304C\u5FC5\u8981\u3068\u3057\u3066\u3044\u307E\u3059",
|
|
566
|
+
"state-unselected": "\u2610 \u975E\u9078\u629E",
|
|
559
567
|
sourceEmbedded: "\u4F5C\u54C1\u306E\u4E2D\u306B\u3042\u308A\u307E\u3059",
|
|
560
568
|
sourceLegacy: "\u30AB\u30B9\u30BF\u30E0\u62E1\u5F35\u306E\u30A2\u30C9\u30EC\u30B9",
|
|
561
569
|
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",
|
|
570
|
+
creator: "\u88FD\u4F5C\u8005\uFF08\u672A\u691C\u8A3C\u306E\u7533\u544A\uFF09",
|
|
563
571
|
creatorUnknown: "\u8A18\u8F09\u306A\u3057",
|
|
564
572
|
licenseUnknown: "\u8A18\u8F09\u306A\u3057",
|
|
565
573
|
version: "\u30D0\u30FC\u30B8\u30E7\u30F3",
|
|
566
574
|
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
575
|
failed: "\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",
|
|
569
576
|
retryNote: "\u901A\u4FE1\u306E\u554F\u984C\u306E\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002",
|
|
570
577
|
retry: "\u3082\u3046\u4E00\u5EA6\u8A66\u3059",
|
|
@@ -672,6 +679,7 @@ function createExtensionWaitDialog(document, locale = "en", { delayMs = 300 } =
|
|
|
672
679
|
});
|
|
673
680
|
}
|
|
674
681
|
export {
|
|
682
|
+
allRequireUnsandboxed,
|
|
675
683
|
contradictsDeclaration,
|
|
676
684
|
createDecisionStorage,
|
|
677
685
|
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,24 @@ 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
|
-
"requirement-optional": "
|
|
81
|
-
"requirement-not-needed": "
|
|
82
|
-
"requirement-unknown": "
|
|
83
|
-
trusted: "
|
|
80
|
+
"requirement-required": "\u2753 Not in the catalog: says it needs to run without the sandbox",
|
|
81
|
+
"requirement-optional": "\u2753 Not in the catalog: says running without the sandbox is optional",
|
|
82
|
+
"requirement-not-needed": "\u2753 Not in the catalog: says the sandbox is fine",
|
|
83
|
+
"requirement-unknown": "\u2753 Not in the catalog: says nothing about the sandbox",
|
|
84
|
+
trusted: "\u{1F4D5} In the catalog: can run without the sandbox",
|
|
84
85
|
trustedNote: "Catalog extensions are treated like TurboWarp\u2019s own gallery and are not asked about.",
|
|
85
|
-
"state-loaded": "Already running",
|
|
86
|
-
"state-selected": "
|
|
87
|
-
"state-dependency": "Needed by {names}",
|
|
88
|
-
"state-unselected": "Not
|
|
86
|
+
"state-loaded": "\u25B6\uFE0F Already running",
|
|
87
|
+
"state-selected": "\u2705 Selected",
|
|
88
|
+
"state-dependency": "\u{1F517} Needed by {names}",
|
|
89
|
+
"state-unselected": "\u2610 Not selected",
|
|
89
90
|
sourceEmbedded: "Stored in the project",
|
|
90
91
|
sourceLegacy: "A custom extension address",
|
|
91
92
|
sourceInline: "Written into the project as a data address",
|
|
92
|
-
creator: "Creator",
|
|
93
|
+
creator: "Creator (unverified claim)",
|
|
93
94
|
creatorUnknown: "Not stated",
|
|
94
95
|
licenseUnknown: "Not stated",
|
|
95
96
|
version: "Version",
|
|
96
97
|
digest: "SHA-256",
|
|
97
|
-
unverified: "The creator\u2019s name is the extension\u2019s own claim and is not verified.",
|
|
98
98
|
failed: "Could not be loaded",
|
|
99
99
|
retryNote: "This may be a network problem.",
|
|
100
100
|
retry: "Try again",
|
|
@@ -111,6 +111,7 @@ var messages = {
|
|
|
111
111
|
openTitle: "\u3053\u306E\u4F5C\u54C1\u306F\u6A5F\u80FD\u62E1\u5F35\u3092\u4F7F\u3044\u307E\u3059",
|
|
112
112
|
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
113
|
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",
|
|
114
|
+
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
115
|
execution: "\u52D5\u304B\u3057\u65B9",
|
|
115
116
|
loading: "\u8AAD\u307F\u8FBC\u307F\u5143",
|
|
116
117
|
executionBulk: "\u3059\u3079\u3066\u306E\u52D5\u304B\u3057\u65B9",
|
|
@@ -124,25 +125,24 @@ var messages = {
|
|
|
124
125
|
"loading-embedded-data": "\u4F5C\u54C1\u306E\u4E2D\u306E data: \u30A2\u30C9\u30EC\u30B9\u304B\u3089",
|
|
125
126
|
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
127
|
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\u3068\u7533\u544A
|
|
128
|
-
"requirement-optional": "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306F\u4EFB\u610F\u3068\u7533\u544A
|
|
129
|
-
"requirement-not-needed": "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u3067\
|
|
130
|
-
"requirement-unknown": "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306B\u3064\u3044\u3066\u7533\u544A\
|
|
131
|
-
trusted: "\u30AB\u30BF\u30ED\u30B0\
|
|
128
|
+
"requirement-required": "\u2753 \u30AB\u30BF\u30ED\u30B0\u8A18\u8F09\u306A\u3057\uFF1A\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u304C\u5FC5\u8981\u3068\u7533\u544A",
|
|
129
|
+
"requirement-optional": "\u2753 \u30AB\u30BF\u30ED\u30B0\u8A18\u8F09\u306A\u3057\uFF1A\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u52D5\u4F5C\u306F\u4EFB\u610F\u3068\u7533\u544A",
|
|
130
|
+
"requirement-not-needed": "\u2753 \u30AB\u30BF\u30ED\u30B0\u8A18\u8F09\u306A\u3057\uFF1A\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u3067\u52D5\u4F5C\u53EF\u3068\u7533\u544A",
|
|
131
|
+
"requirement-unknown": "\u2753 \u30AB\u30BF\u30ED\u30B0\u8A18\u8F09\u306A\u3057\uFF1A\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306B\u3064\u3044\u3066\u7533\u544A\u306A\u3057",
|
|
132
|
+
trusted: "\u{1F4D5} \u30AB\u30BF\u30ED\u30B0\u8A18\u8F09\u3042\u308A\uFF1A\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u52D5\u4F5C\u53EF",
|
|
132
133
|
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-selected": "\u9078\u629E\
|
|
135
|
-
"state-dependency": "{names} \u304C\u5FC5\u8981\u3068\u3057\u3066\u3044\u307E\u3059",
|
|
136
|
-
"state-unselected": "\
|
|
134
|
+
"state-loaded": "\u25B6\uFE0F \u8AAD\u307F\u8FBC\u307F\u6E08\u307F",
|
|
135
|
+
"state-selected": "\u2705 \u9078\u629E\u4E2D",
|
|
136
|
+
"state-dependency": "\u{1F517} {names} \u304C\u5FC5\u8981\u3068\u3057\u3066\u3044\u307E\u3059",
|
|
137
|
+
"state-unselected": "\u2610 \u975E\u9078\u629E",
|
|
137
138
|
sourceEmbedded: "\u4F5C\u54C1\u306E\u4E2D\u306B\u3042\u308A\u307E\u3059",
|
|
138
139
|
sourceLegacy: "\u30AB\u30B9\u30BF\u30E0\u62E1\u5F35\u306E\u30A2\u30C9\u30EC\u30B9",
|
|
139
140
|
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",
|
|
141
|
+
creator: "\u88FD\u4F5C\u8005\uFF08\u672A\u691C\u8A3C\u306E\u7533\u544A\uFF09",
|
|
141
142
|
creatorUnknown: "\u8A18\u8F09\u306A\u3057",
|
|
142
143
|
licenseUnknown: "\u8A18\u8F09\u306A\u3057",
|
|
143
144
|
version: "\u30D0\u30FC\u30B8\u30E7\u30F3",
|
|
144
145
|
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
146
|
failed: "\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",
|
|
147
147
|
retryNote: "\u901A\u4FE1\u306E\u554F\u984C\u306E\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002",
|
|
148
148
|
retry: "\u3082\u3046\u4E00\u5EA6\u8A66\u3059",
|
|
@@ -381,7 +381,7 @@ var ExtensionPreview = class extends import_react.default.PureComponent {
|
|
|
381
381
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
382
382
|
"img",
|
|
383
383
|
{
|
|
384
|
-
className: "twextsec-preview",
|
|
384
|
+
className: this.props.fallback ? "twextsec-preview twextsec-preview-fallback" : "twextsec-preview",
|
|
385
385
|
src: this.state.src,
|
|
386
386
|
alt: formatMessage(this.props.locale, "preview", { name: this.props.name })
|
|
387
387
|
}
|
|
@@ -391,6 +391,9 @@ var ExtensionPreview = class extends import_react.default.PureComponent {
|
|
|
391
391
|
|
|
392
392
|
// src/decisions.js
|
|
393
393
|
var isTrusted = (entry) => Boolean(entry && entry.state && entry.state.trusted);
|
|
394
|
+
var allRequireUnsandboxed = (entries) => entries.length > 0 && entries.every(
|
|
395
|
+
(entry) => !(entry.state && entry.state.error) && unsandboxedRequirement(entry.metadata || {}) === "required"
|
|
396
|
+
);
|
|
394
397
|
var loadingModes = Object.freeze([
|
|
395
398
|
"remote-cacheable",
|
|
396
399
|
"remote-non-cacheable",
|
|
@@ -411,11 +414,13 @@ function initialDecisions(entries, mode, {
|
|
|
411
414
|
recorded = /* @__PURE__ */ new Map(),
|
|
412
415
|
fallbackLoading = "remote-cacheable"
|
|
413
416
|
} = {}) {
|
|
417
|
+
const allRequired = mode === "open" && allRequireUnsandboxed(entries);
|
|
414
418
|
return new Map(entries.map((entry) => {
|
|
415
419
|
const base = defaultDecision(entry, mode, fallbackLoading);
|
|
420
|
+
if (allRequired) base.execution = "unsandboxed";
|
|
416
421
|
const previous = recorded.get(entry.key);
|
|
417
422
|
if (!previous) return [entry.key, base];
|
|
418
|
-
const execution = executionChoices(entry, mode).includes(previous.execution) ? previous.execution : base.execution;
|
|
423
|
+
const execution = !allRequired && executionChoices(entry, mode).includes(previous.execution) ? previous.execution : base.execution;
|
|
419
424
|
const loading = loadingChoices(entry).includes(previous.loading) ? previous.loading : base.loading;
|
|
420
425
|
return [entry.key, loading === void 0 ? { execution } : { execution, loading }];
|
|
421
426
|
}));
|
|
@@ -486,6 +491,11 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
486
491
|
componentDidMount() {
|
|
487
492
|
this.describe();
|
|
488
493
|
}
|
|
494
|
+
componentDidUpdate() {
|
|
495
|
+
if (this.allRequired() && this.props.entries.some((entry) => this.state.decisions.get(entry.key).execution !== "unsandboxed")) {
|
|
496
|
+
this.setState((state) => ({ decisions: new Map([...state.decisions].map(([key, decision]) => [key, __spreadProps(__spreadValues({}, decision), { execution: "unsandboxed" })])) }));
|
|
497
|
+
}
|
|
498
|
+
}
|
|
489
499
|
componentWillUnmount() {
|
|
490
500
|
this.controller.abort();
|
|
491
501
|
}
|
|
@@ -512,7 +522,15 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
512
522
|
metadataOf(entry) {
|
|
513
523
|
return entry.metadata || this.state.described.get(entry.key) || {};
|
|
514
524
|
}
|
|
525
|
+
allRequired() {
|
|
526
|
+
return this.props.mode === "open" && allRequireUnsandboxed(this.props.entries.map((entry) => __spreadProps(__spreadValues({}, entry), { metadata: this.metadataOf(entry) })));
|
|
527
|
+
}
|
|
528
|
+
executionOptions(entry) {
|
|
529
|
+
return this.allRequired() && !isTrusted(entry) ? ["unsandboxed"] : executionChoices(entry, this.props.mode);
|
|
530
|
+
}
|
|
515
531
|
decide(key, change) {
|
|
532
|
+
const entry = this.props.entries.find((entry2) => entry2.key === key);
|
|
533
|
+
if (change.execution !== void 0 && !this.executionOptions(entry).includes(change.execution)) return;
|
|
516
534
|
this.setState((state) => ({
|
|
517
535
|
decisions: new Map(state.decisions).set(key, __spreadValues(__spreadValues({}, state.decisions.get(key)), change))
|
|
518
536
|
}));
|
|
@@ -522,7 +540,7 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
522
540
|
this.setState((state) => {
|
|
523
541
|
const decisions = new Map(state.decisions);
|
|
524
542
|
for (const entry of this.props.entries) {
|
|
525
|
-
if (
|
|
543
|
+
if (this.executionOptions(entry).includes(execution)) {
|
|
526
544
|
decisions.set(entry.key, __spreadProps(__spreadValues({}, decisions.get(entry.key)), { execution }));
|
|
527
545
|
}
|
|
528
546
|
}
|
|
@@ -574,7 +592,7 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
574
592
|
const t = this.t.bind(this);
|
|
575
593
|
const decision = this.state.decisions.get(entry.key);
|
|
576
594
|
const metadata = this.metadataOf(entry);
|
|
577
|
-
const executions =
|
|
595
|
+
const executions = this.executionOptions(entry);
|
|
578
596
|
const loadings = loadingChoices(entry);
|
|
579
597
|
const state = mode === "add" ? selection.stateOf(entry.key) : null;
|
|
580
598
|
const required = state === "dependency";
|
|
@@ -596,21 +614,29 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
596
614
|
disabled: required || state === "loaded",
|
|
597
615
|
onChange: () => this.toggle(entry.key)
|
|
598
616
|
}
|
|
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(", ")), metadata.version && /* @__PURE__ */ import_react2.default.createElement("span", null, t("version"), " ", metadata.version)),
|
|
600
|
-
/* @__PURE__ */ import_react2.default.createElement(
|
|
617
|
+
), /* @__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(", ")), metadata.version && /* @__PURE__ */ import_react2.default.createElement("span", null, t("version"), " ", metadata.version)),
|
|
618
|
+
/* @__PURE__ */ import_react2.default.createElement(
|
|
619
|
+
"p",
|
|
620
|
+
{
|
|
621
|
+
className: "twextsec-source",
|
|
622
|
+
title: sourceLabel(entry, t)
|
|
623
|
+
},
|
|
624
|
+
sourceLabel(entry, t)
|
|
625
|
+
),
|
|
601
626
|
entry.source.sha256 && /* @__PURE__ */ import_react2.default.createElement("p", { className: "twextsec-digest" }, t("digest"), " ", entry.source.sha256),
|
|
602
627
|
/* @__PURE__ */ import_react2.default.createElement(
|
|
603
628
|
ExtensionPreview,
|
|
604
629
|
{
|
|
605
630
|
url: metadata.banner || fallbackBanner,
|
|
631
|
+
fallback: !metadata.banner,
|
|
606
632
|
name: metadata.name || entry.key,
|
|
607
633
|
cache: this.props.previewCache,
|
|
608
634
|
locale: this.props.locale
|
|
609
635
|
}
|
|
610
636
|
),
|
|
611
637
|
/* @__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("
|
|
638
|
+
/* @__PURE__ */ import_react2.default.createElement("p", { className: "twextsec-claim" }, t("creator"), ": ", metadata.author || t("creatorUnknown")),
|
|
639
|
+
/* @__PURE__ */ import_react2.default.createElement("div", { className: "twextsec-status" }, state && /* @__PURE__ */ import_react2.default.createElement("span", { className: "twextsec-state" }, required ? t("state-dependency", { names: roots.join(", ") }) : t(`state-${state}`)), isTrusted(entry) ? /* @__PURE__ */ import_react2.default.createElement("span", { className: "twextsec-trusted" }, t("trusted")) : /* @__PURE__ */ import_react2.default.createElement("span", { className: "twextsec-requirement" }, t(`requirement-${unsandboxedRequirement(metadata)}`))),
|
|
614
640
|
failure && /* @__PURE__ */ import_react2.default.createElement(
|
|
615
641
|
Failure,
|
|
616
642
|
{
|
|
@@ -619,7 +645,7 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
619
645
|
t
|
|
620
646
|
}
|
|
621
647
|
),
|
|
622
|
-
|
|
648
|
+
/* @__PURE__ */ import_react2.default.createElement("div", { className: "twextsec-choices" }, !isTrusted(entry) && /* @__PURE__ */ import_react2.default.createElement(
|
|
623
649
|
Choices,
|
|
624
650
|
{
|
|
625
651
|
name: `execution-${entry.key}`,
|
|
@@ -629,9 +655,7 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
629
655
|
onChange: (event) => this.decide(entry.key, { execution: event.target.value }),
|
|
630
656
|
t
|
|
631
657
|
}
|
|
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(
|
|
658
|
+
), loadings.length > 0 && /* @__PURE__ */ import_react2.default.createElement(
|
|
635
659
|
Choices,
|
|
636
660
|
{
|
|
637
661
|
name: `loading-${entry.key}`,
|
|
@@ -641,7 +665,7 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
641
665
|
onChange: (event) => this.decide(entry.key, { loading: event.target.value }),
|
|
642
666
|
t
|
|
643
667
|
}
|
|
644
|
-
),
|
|
668
|
+
)),
|
|
645
669
|
loadings.length === 0 && decision.loading !== void 0 && /* @__PURE__ */ import_react2.default.createElement("p", { className: "twextsec-loading-fixed" }, t(`loading-${decision.loading}`)),
|
|
646
670
|
contradictsDeclaration(entry, decision) && /* @__PURE__ */ import_react2.default.createElement(
|
|
647
671
|
"p",
|
|
@@ -657,16 +681,17 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
657
681
|
const { mode, entries, DialogFrame, failure, onRetry } = this.props;
|
|
658
682
|
const t = this.t.bind(this);
|
|
659
683
|
const selection = this.selection();
|
|
684
|
+
const allRequired = this.allRequired();
|
|
660
685
|
const anyUnsandboxed = [...this.included()].some((key) => this.state.decisions.get(key).execution === "unsandboxed");
|
|
661
686
|
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(
|
|
687
|
+
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
688
|
Failure,
|
|
664
689
|
{
|
|
665
690
|
failure,
|
|
666
691
|
onRetry,
|
|
667
692
|
t
|
|
668
693
|
}
|
|
669
|
-
), /* @__PURE__ */ import_react2.default.createElement("div", { className: "twextsec-bulk" }, /* @__PURE__ */ import_react2.default.createElement(
|
|
694
|
+
), (!allRequired || bulkLoadings.length > 0) && /* @__PURE__ */ import_react2.default.createElement("div", { className: "twextsec-bulk" }, !allRequired && /* @__PURE__ */ import_react2.default.createElement(
|
|
670
695
|
Choices,
|
|
671
696
|
{
|
|
672
697
|
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,24 @@ 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
|
-
"requirement-optional": "
|
|
48
|
-
"requirement-not-needed": "
|
|
49
|
-
"requirement-unknown": "
|
|
50
|
-
trusted: "
|
|
47
|
+
"requirement-required": "\u2753 Not in the catalog: says it needs to run without the sandbox",
|
|
48
|
+
"requirement-optional": "\u2753 Not in the catalog: says running without the sandbox is optional",
|
|
49
|
+
"requirement-not-needed": "\u2753 Not in the catalog: says the sandbox is fine",
|
|
50
|
+
"requirement-unknown": "\u2753 Not in the catalog: says nothing about the sandbox",
|
|
51
|
+
trusted: "\u{1F4D5} In the catalog: can run without the sandbox",
|
|
51
52
|
trustedNote: "Catalog extensions are treated like TurboWarp\u2019s own gallery and are not asked about.",
|
|
52
|
-
"state-loaded": "Already running",
|
|
53
|
-
"state-selected": "
|
|
54
|
-
"state-dependency": "Needed by {names}",
|
|
55
|
-
"state-unselected": "Not
|
|
53
|
+
"state-loaded": "\u25B6\uFE0F Already running",
|
|
54
|
+
"state-selected": "\u2705 Selected",
|
|
55
|
+
"state-dependency": "\u{1F517} Needed by {names}",
|
|
56
|
+
"state-unselected": "\u2610 Not selected",
|
|
56
57
|
sourceEmbedded: "Stored in the project",
|
|
57
58
|
sourceLegacy: "A custom extension address",
|
|
58
59
|
sourceInline: "Written into the project as a data address",
|
|
59
|
-
creator: "Creator",
|
|
60
|
+
creator: "Creator (unverified claim)",
|
|
60
61
|
creatorUnknown: "Not stated",
|
|
61
62
|
licenseUnknown: "Not stated",
|
|
62
63
|
version: "Version",
|
|
63
64
|
digest: "SHA-256",
|
|
64
|
-
unverified: "The creator\u2019s name is the extension\u2019s own claim and is not verified.",
|
|
65
65
|
failed: "Could not be loaded",
|
|
66
66
|
retryNote: "This may be a network problem.",
|
|
67
67
|
retry: "Try again",
|
|
@@ -78,6 +78,7 @@ var messages = {
|
|
|
78
78
|
openTitle: "\u3053\u306E\u4F5C\u54C1\u306F\u6A5F\u80FD\u62E1\u5F35\u3092\u4F7F\u3044\u307E\u3059",
|
|
79
79
|
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
80
|
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",
|
|
81
|
+
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
82
|
execution: "\u52D5\u304B\u3057\u65B9",
|
|
82
83
|
loading: "\u8AAD\u307F\u8FBC\u307F\u5143",
|
|
83
84
|
executionBulk: "\u3059\u3079\u3066\u306E\u52D5\u304B\u3057\u65B9",
|
|
@@ -91,25 +92,24 @@ var messages = {
|
|
|
91
92
|
"loading-embedded-data": "\u4F5C\u54C1\u306E\u4E2D\u306E data: \u30A2\u30C9\u30EC\u30B9\u304B\u3089",
|
|
92
93
|
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
94
|
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\u3068\u7533\u544A
|
|
95
|
-
"requirement-optional": "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306F\u4EFB\u610F\u3068\u7533\u544A
|
|
96
|
-
"requirement-not-needed": "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u3067\
|
|
97
|
-
"requirement-unknown": "\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306B\u3064\u3044\u3066\u7533\u544A\
|
|
98
|
-
trusted: "\u30AB\u30BF\u30ED\u30B0\
|
|
95
|
+
"requirement-required": "\u2753 \u30AB\u30BF\u30ED\u30B0\u8A18\u8F09\u306A\u3057\uFF1A\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u304C\u5FC5\u8981\u3068\u7533\u544A",
|
|
96
|
+
"requirement-optional": "\u2753 \u30AB\u30BF\u30ED\u30B0\u8A18\u8F09\u306A\u3057\uFF1A\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u52D5\u4F5C\u306F\u4EFB\u610F\u3068\u7533\u544A",
|
|
97
|
+
"requirement-not-needed": "\u2753 \u30AB\u30BF\u30ED\u30B0\u8A18\u8F09\u306A\u3057\uFF1A\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u3067\u52D5\u4F5C\u53EF\u3068\u7533\u544A",
|
|
98
|
+
"requirement-unknown": "\u2753 \u30AB\u30BF\u30ED\u30B0\u8A18\u8F09\u306A\u3057\uFF1A\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306B\u3064\u3044\u3066\u7533\u544A\u306A\u3057",
|
|
99
|
+
trusted: "\u{1F4D5} \u30AB\u30BF\u30ED\u30B0\u8A18\u8F09\u3042\u308A\uFF1A\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u52D5\u4F5C\u53EF",
|
|
99
100
|
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-selected": "\u9078\u629E\
|
|
102
|
-
"state-dependency": "{names} \u304C\u5FC5\u8981\u3068\u3057\u3066\u3044\u307E\u3059",
|
|
103
|
-
"state-unselected": "\
|
|
101
|
+
"state-loaded": "\u25B6\uFE0F \u8AAD\u307F\u8FBC\u307F\u6E08\u307F",
|
|
102
|
+
"state-selected": "\u2705 \u9078\u629E\u4E2D",
|
|
103
|
+
"state-dependency": "\u{1F517} {names} \u304C\u5FC5\u8981\u3068\u3057\u3066\u3044\u307E\u3059",
|
|
104
|
+
"state-unselected": "\u2610 \u975E\u9078\u629E",
|
|
104
105
|
sourceEmbedded: "\u4F5C\u54C1\u306E\u4E2D\u306B\u3042\u308A\u307E\u3059",
|
|
105
106
|
sourceLegacy: "\u30AB\u30B9\u30BF\u30E0\u62E1\u5F35\u306E\u30A2\u30C9\u30EC\u30B9",
|
|
106
107
|
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",
|
|
108
|
+
creator: "\u88FD\u4F5C\u8005\uFF08\u672A\u691C\u8A3C\u306E\u7533\u544A\uFF09",
|
|
108
109
|
creatorUnknown: "\u8A18\u8F09\u306A\u3057",
|
|
109
110
|
licenseUnknown: "\u8A18\u8F09\u306A\u3057",
|
|
110
111
|
version: "\u30D0\u30FC\u30B8\u30E7\u30F3",
|
|
111
112
|
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
113
|
failed: "\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",
|
|
114
114
|
retryNote: "\u901A\u4FE1\u306E\u554F\u984C\u306E\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002",
|
|
115
115
|
retry: "\u3082\u3046\u4E00\u5EA6\u8A66\u3059",
|
|
@@ -348,7 +348,7 @@ var ExtensionPreview = class extends React.PureComponent {
|
|
|
348
348
|
return /* @__PURE__ */ React.createElement(
|
|
349
349
|
"img",
|
|
350
350
|
{
|
|
351
|
-
className: "twextsec-preview",
|
|
351
|
+
className: this.props.fallback ? "twextsec-preview twextsec-preview-fallback" : "twextsec-preview",
|
|
352
352
|
src: this.state.src,
|
|
353
353
|
alt: formatMessage(this.props.locale, "preview", { name: this.props.name })
|
|
354
354
|
}
|
|
@@ -358,6 +358,9 @@ var ExtensionPreview = class extends React.PureComponent {
|
|
|
358
358
|
|
|
359
359
|
// src/decisions.js
|
|
360
360
|
var isTrusted = (entry) => Boolean(entry && entry.state && entry.state.trusted);
|
|
361
|
+
var allRequireUnsandboxed = (entries) => entries.length > 0 && entries.every(
|
|
362
|
+
(entry) => !(entry.state && entry.state.error) && unsandboxedRequirement(entry.metadata || {}) === "required"
|
|
363
|
+
);
|
|
361
364
|
var loadingModes = Object.freeze([
|
|
362
365
|
"remote-cacheable",
|
|
363
366
|
"remote-non-cacheable",
|
|
@@ -378,11 +381,13 @@ function initialDecisions(entries, mode, {
|
|
|
378
381
|
recorded = /* @__PURE__ */ new Map(),
|
|
379
382
|
fallbackLoading = "remote-cacheable"
|
|
380
383
|
} = {}) {
|
|
384
|
+
const allRequired = mode === "open" && allRequireUnsandboxed(entries);
|
|
381
385
|
return new Map(entries.map((entry) => {
|
|
382
386
|
const base = defaultDecision(entry, mode, fallbackLoading);
|
|
387
|
+
if (allRequired) base.execution = "unsandboxed";
|
|
383
388
|
const previous = recorded.get(entry.key);
|
|
384
389
|
if (!previous) return [entry.key, base];
|
|
385
|
-
const execution = executionChoices(entry, mode).includes(previous.execution) ? previous.execution : base.execution;
|
|
390
|
+
const execution = !allRequired && executionChoices(entry, mode).includes(previous.execution) ? previous.execution : base.execution;
|
|
386
391
|
const loading = loadingChoices(entry).includes(previous.loading) ? previous.loading : base.loading;
|
|
387
392
|
return [entry.key, loading === void 0 ? { execution } : { execution, loading }];
|
|
388
393
|
}));
|
|
@@ -453,6 +458,11 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
453
458
|
componentDidMount() {
|
|
454
459
|
this.describe();
|
|
455
460
|
}
|
|
461
|
+
componentDidUpdate() {
|
|
462
|
+
if (this.allRequired() && this.props.entries.some((entry) => this.state.decisions.get(entry.key).execution !== "unsandboxed")) {
|
|
463
|
+
this.setState((state) => ({ decisions: new Map([...state.decisions].map(([key, decision]) => [key, __spreadProps(__spreadValues({}, decision), { execution: "unsandboxed" })])) }));
|
|
464
|
+
}
|
|
465
|
+
}
|
|
456
466
|
componentWillUnmount() {
|
|
457
467
|
this.controller.abort();
|
|
458
468
|
}
|
|
@@ -479,7 +489,15 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
479
489
|
metadataOf(entry) {
|
|
480
490
|
return entry.metadata || this.state.described.get(entry.key) || {};
|
|
481
491
|
}
|
|
492
|
+
allRequired() {
|
|
493
|
+
return this.props.mode === "open" && allRequireUnsandboxed(this.props.entries.map((entry) => __spreadProps(__spreadValues({}, entry), { metadata: this.metadataOf(entry) })));
|
|
494
|
+
}
|
|
495
|
+
executionOptions(entry) {
|
|
496
|
+
return this.allRequired() && !isTrusted(entry) ? ["unsandboxed"] : executionChoices(entry, this.props.mode);
|
|
497
|
+
}
|
|
482
498
|
decide(key, change) {
|
|
499
|
+
const entry = this.props.entries.find((entry2) => entry2.key === key);
|
|
500
|
+
if (change.execution !== void 0 && !this.executionOptions(entry).includes(change.execution)) return;
|
|
483
501
|
this.setState((state) => ({
|
|
484
502
|
decisions: new Map(state.decisions).set(key, __spreadValues(__spreadValues({}, state.decisions.get(key)), change))
|
|
485
503
|
}));
|
|
@@ -489,7 +507,7 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
489
507
|
this.setState((state) => {
|
|
490
508
|
const decisions = new Map(state.decisions);
|
|
491
509
|
for (const entry of this.props.entries) {
|
|
492
|
-
if (
|
|
510
|
+
if (this.executionOptions(entry).includes(execution)) {
|
|
493
511
|
decisions.set(entry.key, __spreadProps(__spreadValues({}, decisions.get(entry.key)), { execution }));
|
|
494
512
|
}
|
|
495
513
|
}
|
|
@@ -541,7 +559,7 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
541
559
|
const t = this.t.bind(this);
|
|
542
560
|
const decision = this.state.decisions.get(entry.key);
|
|
543
561
|
const metadata = this.metadataOf(entry);
|
|
544
|
-
const executions =
|
|
562
|
+
const executions = this.executionOptions(entry);
|
|
545
563
|
const loadings = loadingChoices(entry);
|
|
546
564
|
const state = mode === "add" ? selection.stateOf(entry.key) : null;
|
|
547
565
|
const required = state === "dependency";
|
|
@@ -563,21 +581,29 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
563
581
|
disabled: required || state === "loaded",
|
|
564
582
|
onChange: () => this.toggle(entry.key)
|
|
565
583
|
}
|
|
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(", ")), metadata.version && /* @__PURE__ */ React2.createElement("span", null, t("version"), " ", metadata.version)),
|
|
567
|
-
/* @__PURE__ */ React2.createElement(
|
|
584
|
+
), /* @__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(", ")), metadata.version && /* @__PURE__ */ React2.createElement("span", null, t("version"), " ", metadata.version)),
|
|
585
|
+
/* @__PURE__ */ React2.createElement(
|
|
586
|
+
"p",
|
|
587
|
+
{
|
|
588
|
+
className: "twextsec-source",
|
|
589
|
+
title: sourceLabel(entry, t)
|
|
590
|
+
},
|
|
591
|
+
sourceLabel(entry, t)
|
|
592
|
+
),
|
|
568
593
|
entry.source.sha256 && /* @__PURE__ */ React2.createElement("p", { className: "twextsec-digest" }, t("digest"), " ", entry.source.sha256),
|
|
569
594
|
/* @__PURE__ */ React2.createElement(
|
|
570
595
|
ExtensionPreview,
|
|
571
596
|
{
|
|
572
597
|
url: metadata.banner || fallbackBanner,
|
|
598
|
+
fallback: !metadata.banner,
|
|
573
599
|
name: metadata.name || entry.key,
|
|
574
600
|
cache: this.props.previewCache,
|
|
575
601
|
locale: this.props.locale
|
|
576
602
|
}
|
|
577
603
|
),
|
|
578
604
|
/* @__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("
|
|
605
|
+
/* @__PURE__ */ React2.createElement("p", { className: "twextsec-claim" }, t("creator"), ": ", metadata.author || t("creatorUnknown")),
|
|
606
|
+
/* @__PURE__ */ React2.createElement("div", { className: "twextsec-status" }, state && /* @__PURE__ */ React2.createElement("span", { className: "twextsec-state" }, required ? t("state-dependency", { names: roots.join(", ") }) : t(`state-${state}`)), isTrusted(entry) ? /* @__PURE__ */ React2.createElement("span", { className: "twextsec-trusted" }, t("trusted")) : /* @__PURE__ */ React2.createElement("span", { className: "twextsec-requirement" }, t(`requirement-${unsandboxedRequirement(metadata)}`))),
|
|
581
607
|
failure && /* @__PURE__ */ React2.createElement(
|
|
582
608
|
Failure,
|
|
583
609
|
{
|
|
@@ -586,7 +612,7 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
586
612
|
t
|
|
587
613
|
}
|
|
588
614
|
),
|
|
589
|
-
|
|
615
|
+
/* @__PURE__ */ React2.createElement("div", { className: "twextsec-choices" }, !isTrusted(entry) && /* @__PURE__ */ React2.createElement(
|
|
590
616
|
Choices,
|
|
591
617
|
{
|
|
592
618
|
name: `execution-${entry.key}`,
|
|
@@ -596,9 +622,7 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
596
622
|
onChange: (event) => this.decide(entry.key, { execution: event.target.value }),
|
|
597
623
|
t
|
|
598
624
|
}
|
|
599
|
-
),
|
|
600
|
-
!isTrusted(entry) && /* @__PURE__ */ React2.createElement("p", { className: "twextsec-requirement" }, t(`requirement-${unsandboxedRequirement(metadata)}`)),
|
|
601
|
-
loadings.length > 0 && /* @__PURE__ */ React2.createElement(
|
|
625
|
+
), loadings.length > 0 && /* @__PURE__ */ React2.createElement(
|
|
602
626
|
Choices,
|
|
603
627
|
{
|
|
604
628
|
name: `loading-${entry.key}`,
|
|
@@ -608,7 +632,7 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
608
632
|
onChange: (event) => this.decide(entry.key, { loading: event.target.value }),
|
|
609
633
|
t
|
|
610
634
|
}
|
|
611
|
-
),
|
|
635
|
+
)),
|
|
612
636
|
loadings.length === 0 && decision.loading !== void 0 && /* @__PURE__ */ React2.createElement("p", { className: "twextsec-loading-fixed" }, t(`loading-${decision.loading}`)),
|
|
613
637
|
contradictsDeclaration(entry, decision) && /* @__PURE__ */ React2.createElement(
|
|
614
638
|
"p",
|
|
@@ -624,16 +648,17 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
624
648
|
const { mode, entries, DialogFrame, failure, onRetry } = this.props;
|
|
625
649
|
const t = this.t.bind(this);
|
|
626
650
|
const selection = this.selection();
|
|
651
|
+
const allRequired = this.allRequired();
|
|
627
652
|
const anyUnsandboxed = [...this.included()].some((key) => this.state.decisions.get(key).execution === "unsandboxed");
|
|
628
653
|
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(
|
|
654
|
+
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
655
|
Failure,
|
|
631
656
|
{
|
|
632
657
|
failure,
|
|
633
658
|
onRetry,
|
|
634
659
|
t
|
|
635
660
|
}
|
|
636
|
-
), /* @__PURE__ */ React2.createElement("div", { className: "twextsec-bulk" }, /* @__PURE__ */ React2.createElement(
|
|
661
|
+
), (!allRequired || bulkLoadings.length > 0) && /* @__PURE__ */ React2.createElement("div", { className: "twextsec-bulk" }, !allRequired && /* @__PURE__ */ React2.createElement(
|
|
637
662
|
Choices,
|
|
638
663
|
{
|
|
639
664
|
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,40 @@
|
|
|
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 { grid-column: 1; grid-row: 1 / span 20; }
|
|
9
13
|
.twextsec-row[data-failed="true"] { border-color: var(--ui-danger, #b91c1c); }
|
|
10
14
|
.twextsec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
|
|
11
15
|
.twextsec-pick { display: flex; align-items: baseline; gap: 6px; }
|
|
12
|
-
.twextsec-id, .twextsec-source, .twextsec-digest { overflow-wrap: anywhere; font-size: .
|
|
13
|
-
.twextsec-
|
|
16
|
+
.twextsec-id, .twextsec-source, .twextsec-digest { overflow-wrap: anywhere; font-size: .8em; opacity: .7; }
|
|
17
|
+
.twextsec-source { margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
18
|
+
.twextsec-digest { margin: 2px 0 0; }
|
|
19
|
+
.twextsec-about, .twextsec-claim { margin: 2px 0 0; font-size: .9em; }
|
|
20
|
+
.twextsec-claim { font-size: .8em; }
|
|
21
|
+
.twextsec-status { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 4px 0 0; font-size: .9em; }
|
|
14
22
|
.twextsec-claim, .twextsec-requirement { opacity: .8; }
|
|
15
|
-
.twextsec-trusted {
|
|
23
|
+
.twextsec-trusted { font-weight: 500; }
|
|
16
24
|
.twextsec-failed, .twextsec-contradiction { margin: 6px 0 0; color: var(--ui-danger, #b91c1c); }
|
|
17
25
|
.twextsec-failed p { margin: 0; }
|
|
18
26
|
.twextsec-failed .twextsec-retry-note { margin-top: 4px; font-size: .9em; }
|
|
19
27
|
.twextsec-retry { margin-top: 6px; font: inherit; padding: 4px 12px; border: 1px solid currentColor; border-radius: 6px; background: transparent; color: inherit; cursor: pointer; }
|
|
20
|
-
|
|
28
|
+
/* Inside the bulk box the choices keep their frame; in a row they read as one labelled line each. */
|
|
29
|
+
.twextsec-choice { margin: 0; padding: 6px 10px; border: 1px solid var(--ui-black-transparent, #0000001a); border-radius: 6px; }
|
|
21
30
|
.twextsec-choice legend { padding: 0 4px; font-size: .85em; opacity: .8; }
|
|
22
31
|
.twextsec-choice label { display: inline-flex; align-items: center; gap: 4px; margin-right: 14px; }
|
|
32
|
+
.twextsec-choices { display: flex; flex-wrap: wrap; gap: 2px 18px; margin: 2px 0 0; }
|
|
33
|
+
.twextsec-choices:empty { display: none; }
|
|
34
|
+
.twextsec-choices .twextsec-choice { padding: 0; border: 0; font-size: .9em; }
|
|
35
|
+
.twextsec-choices .twextsec-choice legend { float: left; padding: 0; margin-right: 8px; }
|
|
36
|
+
.twextsec-choices .twextsec-choice label { margin-right: 10px; }
|
|
23
37
|
.twextsec-actions { display: flex; justify-content: flex-end; gap: 12px; margin: 0; padding: 0; }
|
|
24
38
|
.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
39
|
.twextsec-actions button[data-testid="twextsec-complete"] { background: var(--looks-secondary, #1d4ed8); color: #fff; border-color: transparent; }
|
|
26
40
|
.twextsec-actions button:focus-visible { outline: 3px solid var(--link-color, #7352d6); outline-offset: 2px; }
|
|
27
|
-
|
|
41
|
+
/* Catalog banners are block icons, so a row shows its picture at icon size, not as a wide banner. */
|
|
42
|
+
.twextsec-preview { display: block; width: 40px; height: 40px; object-fit: contain; margin: 2px 0 0; border-radius: 6px; }
|
|
43
|
+
.twextsec-preview-fallback { opacity: .5; }
|
package/webpack4.css
CHANGED
|
@@ -4,24 +4,40 @@
|
|
|
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) { grid-column: 1; grid-row: 1 / span 20; }
|
|
9
13
|
:global(.twextsec-row)[data-failed="true"] { border-color: var(--ui-danger, #b91c1c); }
|
|
10
14
|
:global(.twextsec-head) { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
|
|
11
15
|
:global(.twextsec-pick) { display: flex; align-items: baseline; gap: 6px; }
|
|
12
|
-
:global(.twextsec-id), :global(.twextsec-source), :global(.twextsec-digest) { overflow-wrap: anywhere; font-size: .
|
|
13
|
-
:global(.twextsec-
|
|
16
|
+
:global(.twextsec-id), :global(.twextsec-source), :global(.twextsec-digest) { overflow-wrap: anywhere; font-size: .8em; opacity: .7; }
|
|
17
|
+
:global(.twextsec-source) { margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
18
|
+
:global(.twextsec-digest) { margin: 2px 0 0; }
|
|
19
|
+
:global(.twextsec-about), :global(.twextsec-claim) { margin: 2px 0 0; font-size: .9em; }
|
|
20
|
+
:global(.twextsec-claim) { font-size: .8em; }
|
|
21
|
+
:global(.twextsec-status) { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 4px 0 0; font-size: .9em; }
|
|
14
22
|
:global(.twextsec-claim), :global(.twextsec-requirement) { opacity: .8; }
|
|
15
|
-
:global(.twextsec-trusted) {
|
|
23
|
+
:global(.twextsec-trusted) { font-weight: 500; }
|
|
16
24
|
:global(.twextsec-failed), :global(.twextsec-contradiction) { margin: 6px 0 0; color: var(--ui-danger, #b91c1c); }
|
|
17
25
|
:global(.twextsec-failed) p { margin: 0; }
|
|
18
26
|
:global(.twextsec-failed) :global(.twextsec-retry-note) { margin-top: 4px; font-size: .9em; }
|
|
19
27
|
: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
|
-
|
|
28
|
+
/* Inside the bulk box the choices keep their frame; in a row they read as one labelled line each. */
|
|
29
|
+
:global(.twextsec-choice) { margin: 0; padding: 6px 10px; border: 1px solid var(--ui-black-transparent, #0000001a); border-radius: 6px; }
|
|
21
30
|
:global(.twextsec-choice) legend { padding: 0 4px; font-size: .85em; opacity: .8; }
|
|
22
31
|
:global(.twextsec-choice) label { display: inline-flex; align-items: center; gap: 4px; margin-right: 14px; }
|
|
32
|
+
:global(.twextsec-choices) { display: flex; flex-wrap: wrap; gap: 2px 18px; margin: 2px 0 0; }
|
|
33
|
+
:global(.twextsec-choices):empty { display: none; }
|
|
34
|
+
:global(.twextsec-choices) :global(.twextsec-choice) { padding: 0; border: 0; font-size: .9em; }
|
|
35
|
+
:global(.twextsec-choices) :global(.twextsec-choice) legend { float: left; padding: 0; margin-right: 8px; }
|
|
36
|
+
:global(.twextsec-choices) :global(.twextsec-choice) label { margin-right: 10px; }
|
|
23
37
|
:global(.twextsec-actions) { display: flex; justify-content: flex-end; gap: 12px; margin: 0; padding: 0; }
|
|
24
38
|
: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
39
|
:global(.twextsec-actions) button[data-testid="twextsec-complete"] { background: var(--looks-secondary, #1d4ed8); color: #fff; border-color: transparent; }
|
|
26
40
|
:global(.twextsec-actions) button:focus-visible { outline: 3px solid var(--link-color, #7352d6); outline-offset: 2px; }
|
|
27
|
-
|
|
41
|
+
/* Catalog banners are block icons, so a row shows its picture at icon size, not as a wide banner. */
|
|
42
|
+
:global(.twextsec-preview) { display: block; width: 40px; height: 40px; object-fit: contain; margin: 2px 0 0; border-radius: 6px; }
|
|
43
|
+
:global(.twextsec-preview-fallback) { opacity: .5; }
|