@kubohiroya/turbowarp-extension-security-dialog 0.8.4 → 0.8.5
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/README.ja.md +25 -1
- package/README.md +2 -1
- package/dist/build-info.json +2 -2
- package/dist/index.cjs +28 -2
- package/dist/index.mjs +28 -2
- package/dist/react.cjs +168 -43
- package/dist/react.mjs +168 -43
- package/dist/review-types.d.ts +4 -1
- package/package.json +1 -1
- package/styles.css +37 -1
- package/webpack4.css +37 -1
package/README.ja.md
CHANGED
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
[MPL-2.0](LICENSE) です。「Incompatible With Secondary Licenses」の表示を付けていないので、
|
|
7
7
|
GPL-3.0 で配布する大きな作品に組み込めます。TurboWarp-Plus-Editor はそうやって配信しています。
|
|
8
8
|
|
|
9
|
+
0.8.5は、閉じられる注意表示、選択欄の配置、紹介・リリース・連絡先リンク、概要の改行、
|
|
10
|
+
常時表示の追加/キャンセルボタンと、実行・保存方法のアイコンを含むnpm公開版です。
|
|
11
|
+
詳細と互換性・切戻しは[0.8.5の公開記録](https://github.com/kubohiroya/turbowarp-extension-security-dialog/blob/v0.8.5/docs/releases/0.8.5.ja.md)を参照してください。
|
|
12
|
+
|
|
9
13
|
## 何を解決するか
|
|
10
14
|
|
|
11
15
|
VM は機能拡張を1つずつ読み込み、そのたびに尋ねます。作品を開くことが確認の行列になり、最後の
|
|
@@ -92,6 +96,25 @@ import '@kubohiroya/turbowarp-extension-security-dialog/styles.css';
|
|
|
92
96
|
カタログからの追加、通常・未申告・任意指定・取得失敗が混ざる作品では、従来どおり
|
|
93
97
|
サンドボックスの中を既定にし、実行方法を選べます。必須の申告に反する選択は警告します。
|
|
94
98
|
|
|
99
|
+
追加画面の各行は、左からチェックボックス、アイコン、拡張名の順に並べます。
|
|
100
|
+
名前やアイコンをクリックしても選択できます。
|
|
101
|
+
|
|
102
|
+
「キャンセル」「追加」はダイアログ下部に常時表示します。案内・一括設定・一覧の領域だけを
|
|
103
|
+
スクロールするので、最下部まで移動せずに追加やキャンセルができます。注意のスナックバーは
|
|
104
|
+
操作ボタンの上に表示し、ボタンを覆いません。
|
|
105
|
+
|
|
106
|
+
タイトル行の信頼済みアイコンは、登録された紹介ページ(`docsURL`)を別タブで開きます。
|
|
107
|
+
バージョン表記は、GitHubリポジトリの該当する `v{version}` リリースノートへリンクします。
|
|
108
|
+
紹介ページ・リポジトリ・バージョンの情報が不足する場合は、リンクを付けずに表示します。
|
|
109
|
+
概要は改行を保持し、HTTP(S) URL、`mailto:`、メールアドレスをリンクとして表示します。
|
|
110
|
+
製作者名の右横には、登録済みの連絡先(`authorURL`)を表示します。HTTP(S)と`mailto:`に対応し、
|
|
111
|
+
連絡先がなければ省略します。HTMLは文字として表示し、リンクの操作で拡張の選択は変わりません。
|
|
112
|
+
|
|
113
|
+
サンドボックスなしで動く拡張を選ぶと、画面下部にスナックバーで注意を表示します。
|
|
114
|
+
一覧やスクロール位置は動かず、明暗どちらのテーマでも濃紺の背景と白い文字で表示します。
|
|
115
|
+
自動では消えず、「閉じる」で非表示にしても選択や許可は変わりません。警告が必要な選択を
|
|
116
|
+
すべて解除するまでは閉じた状態を保ち、再び選択したときは表示し直します。
|
|
117
|
+
|
|
95
118
|
**信頼済みの行は、尋ねずに述べます。** カタログに載っている拡張はホストの標準ギャラリーと同じ
|
|
96
119
|
扱いで、サンドボックスなしで動き、実行の選択肢を出しません。信頼済みの行だけの作品は止める
|
|
97
120
|
価値が無いので、`requiresReview` が画面を出さなくてよいと答えます。
|
|
@@ -204,7 +227,8 @@ const uninstall = installBatchExtensionLoader(vm, review, defaultURLs, createDec
|
|
|
204
227
|
|
|
205
228
|
```sh
|
|
206
229
|
pnpm install
|
|
207
|
-
pnpm run check #
|
|
230
|
+
pnpm run check # ビルド、単体テスト、pack の dry run
|
|
231
|
+
node --test test/wait.browser.mjs test/review.browser.mjs # 取得待ち・選択画面の実ブラウザ検証
|
|
208
232
|
```
|
|
209
233
|
|
|
210
234
|
React と React DOM は peerDependencies なので、ホストが用意します。実行時の依存はありません。
|
package/README.md
CHANGED
|
@@ -215,7 +215,8 @@ what a bundle says about its members is theirs, not its own.
|
|
|
215
215
|
|
|
216
216
|
```sh
|
|
217
217
|
pnpm install
|
|
218
|
-
pnpm run check # build,
|
|
218
|
+
pnpm run check # build, unit tests, and a packing dry run
|
|
219
|
+
node --test test/wait.browser.mjs test/review.browser.mjs
|
|
219
220
|
```
|
|
220
221
|
|
|
221
222
|
React and React DOM are peer dependencies, so the host supplies them. There are no runtime
|
package/dist/build-info.json
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -59,6 +59,26 @@ __export(index_exports, {
|
|
|
59
59
|
});
|
|
60
60
|
module.exports = __toCommonJS(index_exports);
|
|
61
61
|
|
|
62
|
+
// src/display-urls.js
|
|
63
|
+
var displayURL = (value, allowMail = false) => {
|
|
64
|
+
if (typeof value !== "string" || !value || /[\u0000-\u0020\u007f]/.test(value)) return null;
|
|
65
|
+
try {
|
|
66
|
+
const url = new URL(value);
|
|
67
|
+
if (url.username || url.password) return null;
|
|
68
|
+
if (url.protocol === "http:" || url.protocol === "https:") return value;
|
|
69
|
+
if (allowMail && url.protocol === "mailto:" && /^[^\s@]+@[^\s@]+$/.test(decodeURIComponent(url.pathname))) return value;
|
|
70
|
+
} catch (error) {
|
|
71
|
+
}
|
|
72
|
+
return null;
|
|
73
|
+
};
|
|
74
|
+
var contactURL = (value) => {
|
|
75
|
+
const address = displayURL(value, true);
|
|
76
|
+
if (!address || address.length > 2048 || new URL(address).hash) {
|
|
77
|
+
throw new Error("authorURL must be HTTP(S) or mailto without credentials or a fragment");
|
|
78
|
+
}
|
|
79
|
+
return address;
|
|
80
|
+
};
|
|
81
|
+
|
|
62
82
|
// src/catalog.js
|
|
63
83
|
var ID = /^[A-Za-z0-9]+$/;
|
|
64
84
|
var fail = (message) => {
|
|
@@ -106,7 +126,7 @@ var metadataOf = (value) => {
|
|
|
106
126
|
for (const key of ["repository", "docsURL"]) {
|
|
107
127
|
if (source[key] !== void 0) result[key] = reviewURL(source[key], key);
|
|
108
128
|
}
|
|
109
|
-
if (source.authorURL !== void 0) result.authorURL =
|
|
129
|
+
if (source.authorURL !== void 0) result.authorURL = contactURL(source.authorURL);
|
|
110
130
|
if (source.descriptions !== void 0) {
|
|
111
131
|
const descriptions = object(source.descriptions, "descriptions");
|
|
112
132
|
result.descriptions = {};
|
|
@@ -227,7 +247,7 @@ function parseExtensionMetadata(source) {
|
|
|
227
247
|
}
|
|
228
248
|
if (["repository", "docsURL", "authorURL"].includes(name)) {
|
|
229
249
|
try {
|
|
230
|
-
metadata[name] =
|
|
250
|
+
metadata[name] = name === "authorURL" ? contactURL(value) : reviewURL(value, name);
|
|
231
251
|
} catch (error) {
|
|
232
252
|
}
|
|
233
253
|
return;
|
|
@@ -550,6 +570,7 @@ var messages = {
|
|
|
550
570
|
"loading-embedded-data": "In the project, as a data address",
|
|
551
571
|
loadingNote: "A kept copy is verified and reused, so the project opens without the network. Fetching each time leaves nothing in this browser.",
|
|
552
572
|
unsandboxedWarning: "Without the sandbox, an extension can reach the project, the editor and this site\u2019s data. Choose it only for code you trust.",
|
|
573
|
+
closeWarning: "Close",
|
|
553
574
|
"requirement-required": "\u26A0\uFE0F Needs to run without the sandbox",
|
|
554
575
|
trusted: "Trusted by TurboWarp Plus: runs without the sandbox",
|
|
555
576
|
trustedNote: "Catalog extensions are treated like TurboWarp\u2019s own gallery and are not asked about.",
|
|
@@ -562,6 +583,8 @@ var messages = {
|
|
|
562
583
|
creatorUnknown: "Not stated",
|
|
563
584
|
licenseUnknown: "Not stated",
|
|
564
585
|
version: "Version",
|
|
586
|
+
extensionPage: "Extension website",
|
|
587
|
+
releaseNotes: "Release notes",
|
|
565
588
|
digest: "SHA-256",
|
|
566
589
|
failed: "Could not be loaded",
|
|
567
590
|
retryNote: "This may be a network problem.",
|
|
@@ -593,6 +616,7 @@ var messages = {
|
|
|
593
616
|
"loading-embedded-data": "\u4F5C\u54C1\u306E\u4E2D\u306E data: \u30A2\u30C9\u30EC\u30B9\u304B\u3089",
|
|
594
617
|
loadingNote: "\u30AD\u30E3\u30C3\u30B7\u30E5\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",
|
|
595
618
|
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",
|
|
619
|
+
closeWarning: "\u9589\u3058\u308B",
|
|
596
620
|
"requirement-required": "\u26A0\uFE0F \u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u304C\u5FC5\u8981",
|
|
597
621
|
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",
|
|
598
622
|
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",
|
|
@@ -605,6 +629,8 @@ var messages = {
|
|
|
605
629
|
creatorUnknown: "\u8A18\u8F09\u306A\u3057",
|
|
606
630
|
licenseUnknown: "\u8A18\u8F09\u306A\u3057",
|
|
607
631
|
version: "\u30D0\u30FC\u30B8\u30E7\u30F3",
|
|
632
|
+
extensionPage: "\u6A5F\u80FD\u62E1\u5F35\u306E\u7D39\u4ECB\u30DA\u30FC\u30B8",
|
|
633
|
+
releaseNotes: "\u30EA\u30EA\u30FC\u30B9\u30CE\u30FC\u30C8",
|
|
608
634
|
digest: "SHA-256",
|
|
609
635
|
failed: "\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",
|
|
610
636
|
retryNote: "\u901A\u4FE1\u306E\u554F\u984C\u306E\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002",
|
package/dist/index.mjs
CHANGED
|
@@ -15,6 +15,26 @@ var __spreadValues = (a, b) => {
|
|
|
15
15
|
return a;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
+
// src/display-urls.js
|
|
19
|
+
var displayURL = (value, allowMail = false) => {
|
|
20
|
+
if (typeof value !== "string" || !value || /[\u0000-\u0020\u007f]/.test(value)) return null;
|
|
21
|
+
try {
|
|
22
|
+
const url = new URL(value);
|
|
23
|
+
if (url.username || url.password) return null;
|
|
24
|
+
if (url.protocol === "http:" || url.protocol === "https:") return value;
|
|
25
|
+
if (allowMail && url.protocol === "mailto:" && /^[^\s@]+@[^\s@]+$/.test(decodeURIComponent(url.pathname))) return value;
|
|
26
|
+
} catch (error) {
|
|
27
|
+
}
|
|
28
|
+
return null;
|
|
29
|
+
};
|
|
30
|
+
var contactURL = (value) => {
|
|
31
|
+
const address = displayURL(value, true);
|
|
32
|
+
if (!address || address.length > 2048 || new URL(address).hash) {
|
|
33
|
+
throw new Error("authorURL must be HTTP(S) or mailto without credentials or a fragment");
|
|
34
|
+
}
|
|
35
|
+
return address;
|
|
36
|
+
};
|
|
37
|
+
|
|
18
38
|
// src/catalog.js
|
|
19
39
|
var ID = /^[A-Za-z0-9]+$/;
|
|
20
40
|
var fail = (message) => {
|
|
@@ -62,7 +82,7 @@ var metadataOf = (value) => {
|
|
|
62
82
|
for (const key of ["repository", "docsURL"]) {
|
|
63
83
|
if (source[key] !== void 0) result[key] = reviewURL(source[key], key);
|
|
64
84
|
}
|
|
65
|
-
if (source.authorURL !== void 0) result.authorURL =
|
|
85
|
+
if (source.authorURL !== void 0) result.authorURL = contactURL(source.authorURL);
|
|
66
86
|
if (source.descriptions !== void 0) {
|
|
67
87
|
const descriptions = object(source.descriptions, "descriptions");
|
|
68
88
|
result.descriptions = {};
|
|
@@ -183,7 +203,7 @@ function parseExtensionMetadata(source) {
|
|
|
183
203
|
}
|
|
184
204
|
if (["repository", "docsURL", "authorURL"].includes(name)) {
|
|
185
205
|
try {
|
|
186
|
-
metadata[name] =
|
|
206
|
+
metadata[name] = name === "authorURL" ? contactURL(value) : reviewURL(value, name);
|
|
187
207
|
} catch (error) {
|
|
188
208
|
}
|
|
189
209
|
return;
|
|
@@ -506,6 +526,7 @@ var messages = {
|
|
|
506
526
|
"loading-embedded-data": "In the project, as a data address",
|
|
507
527
|
loadingNote: "A kept copy is verified and reused, so the project opens without the network. Fetching each time leaves nothing in this browser.",
|
|
508
528
|
unsandboxedWarning: "Without the sandbox, an extension can reach the project, the editor and this site\u2019s data. Choose it only for code you trust.",
|
|
529
|
+
closeWarning: "Close",
|
|
509
530
|
"requirement-required": "\u26A0\uFE0F Needs to run without the sandbox",
|
|
510
531
|
trusted: "Trusted by TurboWarp Plus: runs without the sandbox",
|
|
511
532
|
trustedNote: "Catalog extensions are treated like TurboWarp\u2019s own gallery and are not asked about.",
|
|
@@ -518,6 +539,8 @@ var messages = {
|
|
|
518
539
|
creatorUnknown: "Not stated",
|
|
519
540
|
licenseUnknown: "Not stated",
|
|
520
541
|
version: "Version",
|
|
542
|
+
extensionPage: "Extension website",
|
|
543
|
+
releaseNotes: "Release notes",
|
|
521
544
|
digest: "SHA-256",
|
|
522
545
|
failed: "Could not be loaded",
|
|
523
546
|
retryNote: "This may be a network problem.",
|
|
@@ -549,6 +572,7 @@ var messages = {
|
|
|
549
572
|
"loading-embedded-data": "\u4F5C\u54C1\u306E\u4E2D\u306E data: \u30A2\u30C9\u30EC\u30B9\u304B\u3089",
|
|
550
573
|
loadingNote: "\u30AD\u30E3\u30C3\u30B7\u30E5\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",
|
|
551
574
|
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",
|
|
575
|
+
closeWarning: "\u9589\u3058\u308B",
|
|
552
576
|
"requirement-required": "\u26A0\uFE0F \u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u304C\u5FC5\u8981",
|
|
553
577
|
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
578
|
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",
|
|
@@ -561,6 +585,8 @@ var messages = {
|
|
|
561
585
|
creatorUnknown: "\u8A18\u8F09\u306A\u3057",
|
|
562
586
|
licenseUnknown: "\u8A18\u8F09\u306A\u3057",
|
|
563
587
|
version: "\u30D0\u30FC\u30B8\u30E7\u30F3",
|
|
588
|
+
extensionPage: "\u6A5F\u80FD\u62E1\u5F35\u306E\u7D39\u4ECB\u30DA\u30FC\u30B8",
|
|
589
|
+
releaseNotes: "\u30EA\u30EA\u30FC\u30B9\u30CE\u30FC\u30C8",
|
|
564
590
|
digest: "SHA-256",
|
|
565
591
|
failed: "\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",
|
|
566
592
|
retryNote: "\u901A\u4FE1\u306E\u554F\u984C\u306E\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002",
|
package/dist/react.cjs
CHANGED
|
@@ -52,7 +52,7 @@ __export(react_exports, {
|
|
|
52
52
|
module.exports = __toCommonJS(react_exports);
|
|
53
53
|
|
|
54
54
|
// src/review.jsx
|
|
55
|
-
var
|
|
55
|
+
var import_react3 = __toESM(require("react"), 1);
|
|
56
56
|
|
|
57
57
|
// src/messages.js
|
|
58
58
|
var messages = {
|
|
@@ -77,6 +77,7 @@ var messages = {
|
|
|
77
77
|
"loading-embedded-data": "In the project, as a data address",
|
|
78
78
|
loadingNote: "A kept copy is verified and reused, so the project opens without the network. Fetching each time leaves nothing in this browser.",
|
|
79
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.",
|
|
80
|
+
closeWarning: "Close",
|
|
80
81
|
"requirement-required": "\u26A0\uFE0F Needs to run without the sandbox",
|
|
81
82
|
trusted: "Trusted by TurboWarp Plus: runs without the sandbox",
|
|
82
83
|
trustedNote: "Catalog extensions are treated like TurboWarp\u2019s own gallery and are not asked about.",
|
|
@@ -89,6 +90,8 @@ var messages = {
|
|
|
89
90
|
creatorUnknown: "Not stated",
|
|
90
91
|
licenseUnknown: "Not stated",
|
|
91
92
|
version: "Version",
|
|
93
|
+
extensionPage: "Extension website",
|
|
94
|
+
releaseNotes: "Release notes",
|
|
92
95
|
digest: "SHA-256",
|
|
93
96
|
failed: "Could not be loaded",
|
|
94
97
|
retryNote: "This may be a network problem.",
|
|
@@ -120,6 +123,7 @@ var messages = {
|
|
|
120
123
|
"loading-embedded-data": "\u4F5C\u54C1\u306E\u4E2D\u306E data: \u30A2\u30C9\u30EC\u30B9\u304B\u3089",
|
|
121
124
|
loadingNote: "\u30AD\u30E3\u30C3\u30B7\u30E5\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",
|
|
122
125
|
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",
|
|
126
|
+
closeWarning: "\u9589\u3058\u308B",
|
|
123
127
|
"requirement-required": "\u26A0\uFE0F \u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u304C\u5FC5\u8981",
|
|
124
128
|
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",
|
|
125
129
|
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",
|
|
@@ -132,6 +136,8 @@ var messages = {
|
|
|
132
136
|
creatorUnknown: "\u8A18\u8F09\u306A\u3057",
|
|
133
137
|
licenseUnknown: "\u8A18\u8F09\u306A\u3057",
|
|
134
138
|
version: "\u30D0\u30FC\u30B8\u30E7\u30F3",
|
|
139
|
+
extensionPage: "\u6A5F\u80FD\u62E1\u5F35\u306E\u7D39\u4ECB\u30DA\u30FC\u30B8",
|
|
140
|
+
releaseNotes: "\u30EA\u30EA\u30FC\u30B9\u30CE\u30FC\u30C8",
|
|
135
141
|
digest: "SHA-256",
|
|
136
142
|
failed: "\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",
|
|
137
143
|
retryNote: "\u901A\u4FE1\u306E\u554F\u984C\u306E\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002",
|
|
@@ -151,6 +157,28 @@ var formatMessage = (locale, key, values = {}) => {
|
|
|
151
157
|
return template.replace(/\{(\w+)\}/g, (match, name) => values[name] === void 0 ? match : String(values[name]));
|
|
152
158
|
};
|
|
153
159
|
|
|
160
|
+
// src/display-urls.js
|
|
161
|
+
var displayURL = (value, allowMail = false) => {
|
|
162
|
+
if (typeof value !== "string" || !value || /[\u0000-\u0020\u007f]/.test(value)) return null;
|
|
163
|
+
try {
|
|
164
|
+
const url = new URL(value);
|
|
165
|
+
if (url.username || url.password) return null;
|
|
166
|
+
if (url.protocol === "http:" || url.protocol === "https:") return value;
|
|
167
|
+
if (allowMail && url.protocol === "mailto:" && /^[^\s@]+@[^\s@]+$/.test(decodeURIComponent(url.pathname))) return value;
|
|
168
|
+
} catch (error) {
|
|
169
|
+
}
|
|
170
|
+
return null;
|
|
171
|
+
};
|
|
172
|
+
var releaseURL = (metadata) => {
|
|
173
|
+
if (!displayURL(metadata.repository) || !/^v?\d+\.\d+\.\d+(?:-[\w.-]+)?(?:\+[\w.-]+)?$/.test(metadata.version || "")) return null;
|
|
174
|
+
const repository = new URL(metadata.repository);
|
|
175
|
+
if (repository.origin !== "https://github.com" || repository.search || repository.hash) return null;
|
|
176
|
+
const path = /^\/([\w.-]+)\/([\w.-]+?)\/?$/.exec(repository.pathname);
|
|
177
|
+
if (!path) return null;
|
|
178
|
+
const version = metadata.version.replace(/^v/, "");
|
|
179
|
+
return `https://github.com/${path[1]}/${path[2].replace(/\.git$/, "")}/releases/tag/${encodeURIComponent(`v${version}`)}`;
|
|
180
|
+
};
|
|
181
|
+
|
|
154
182
|
// src/metadata.js
|
|
155
183
|
var HEADER_FIELDS = Object.freeze({
|
|
156
184
|
name: "name",
|
|
@@ -379,6 +407,53 @@ var ExtensionPreview = class extends import_react.default.PureComponent {
|
|
|
379
407
|
}
|
|
380
408
|
};
|
|
381
409
|
|
|
410
|
+
// src/linked-text.jsx
|
|
411
|
+
var import_react2 = __toESM(require("react"), 1);
|
|
412
|
+
var addresses = /https?:\/\/[^\s<>"'。、「」『』【】]+|mailto:[^\s<>"'。、「」『』【】]+|[\w.!#$%&'*+/=?^`{|}~-]+@[A-Z0-9](?:[A-Z0-9.-]*[A-Z0-9])?\.[A-Z]{2,}/gi;
|
|
413
|
+
var trimPunctuation = (text) => {
|
|
414
|
+
let result = text;
|
|
415
|
+
while (result) {
|
|
416
|
+
const last = result.slice(-1);
|
|
417
|
+
if (/[.,;:!?!?]/.test(last)) {
|
|
418
|
+
result = result.slice(0, -1);
|
|
419
|
+
continue;
|
|
420
|
+
}
|
|
421
|
+
const opener = { ")": "(", "]": "[", "}": "{", "\uFF09": "\uFF08" }[last];
|
|
422
|
+
if (opener && result.split(last).length > result.split(opener).length) {
|
|
423
|
+
result = result.slice(0, -1);
|
|
424
|
+
continue;
|
|
425
|
+
}
|
|
426
|
+
break;
|
|
427
|
+
}
|
|
428
|
+
return result;
|
|
429
|
+
};
|
|
430
|
+
var LinkedText = ({ text }) => {
|
|
431
|
+
const parts = [];
|
|
432
|
+
const input = String(text || "");
|
|
433
|
+
const matcher = new RegExp(addresses.source, addresses.flags);
|
|
434
|
+
let cursor = 0;
|
|
435
|
+
let match;
|
|
436
|
+
while (match = matcher.exec(input)) {
|
|
437
|
+
parts.push(input.slice(cursor, match.index));
|
|
438
|
+
const label = trimPunctuation(match[0]);
|
|
439
|
+
const href = displayURL(/^(?:https?:\/\/|mailto:)/i.test(label) ? label : `mailto:${label}`, true);
|
|
440
|
+
parts.push(href ? /* @__PURE__ */ import_react2.default.createElement(
|
|
441
|
+
"a",
|
|
442
|
+
{
|
|
443
|
+
key: match.index,
|
|
444
|
+
href,
|
|
445
|
+
target: /^mailto:/i.test(href) ? void 0 : "_blank",
|
|
446
|
+
rel: "noopener noreferrer"
|
|
447
|
+
},
|
|
448
|
+
label
|
|
449
|
+
) : label);
|
|
450
|
+
parts.push(match[0].slice(label.length));
|
|
451
|
+
cursor = matcher.lastIndex;
|
|
452
|
+
}
|
|
453
|
+
parts.push(input.slice(cursor));
|
|
454
|
+
return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, parts);
|
|
455
|
+
};
|
|
456
|
+
|
|
382
457
|
// src/decisions.js
|
|
383
458
|
var isTrusted = (entry) => Boolean(entry && entry.state && entry.state.trusted);
|
|
384
459
|
var allRequireUnsandboxed = (entries) => entries.length > 0 && entries.every(
|
|
@@ -434,15 +509,15 @@ var sourceLabel = (entry, t) => {
|
|
|
434
509
|
};
|
|
435
510
|
var Failure = ({ failure, onRetry, t }) => {
|
|
436
511
|
const retry = failure.retryable === true && typeof onRetry === "function";
|
|
437
|
-
return /* @__PURE__ */
|
|
512
|
+
return /* @__PURE__ */ import_react3.default.createElement(
|
|
438
513
|
"div",
|
|
439
514
|
{
|
|
440
515
|
className: "twextsec-failed",
|
|
441
516
|
role: "alert"
|
|
442
517
|
},
|
|
443
|
-
/* @__PURE__ */
|
|
444
|
-
retry && /* @__PURE__ */
|
|
445
|
-
retry && /* @__PURE__ */
|
|
518
|
+
/* @__PURE__ */ import_react3.default.createElement("p", null, t("failed"), ": ", failure.code && `${failure.code} `, failure.message),
|
|
519
|
+
retry && /* @__PURE__ */ import_react3.default.createElement("p", { className: "twextsec-retry-note" }, t("retryNote")),
|
|
520
|
+
retry && /* @__PURE__ */ import_react3.default.createElement(
|
|
446
521
|
"button",
|
|
447
522
|
{
|
|
448
523
|
type: "button",
|
|
@@ -454,7 +529,38 @@ var Failure = ({ failure, onRetry, t }) => {
|
|
|
454
529
|
)
|
|
455
530
|
);
|
|
456
531
|
};
|
|
457
|
-
var
|
|
532
|
+
var choiceIcons = {
|
|
533
|
+
sandboxed: "\u{1F6E1}\uFE0F",
|
|
534
|
+
unsandboxed: "\u26A0\uFE0F",
|
|
535
|
+
"remote-cacheable": "\u{1F4BC}",
|
|
536
|
+
"remote-non-cacheable": "\u2B07\uFE0F",
|
|
537
|
+
"embedded-file": "\u{1F961}",
|
|
538
|
+
"embedded-data": "\u{1F4E6}"
|
|
539
|
+
};
|
|
540
|
+
var ChoiceLabel = ({ kind, option, t }) => /* @__PURE__ */ import_react3.default.createElement("span", { className: "twextsec-choice-label" }, choiceIcons[option] && /* @__PURE__ */ import_react3.default.createElement("span", { className: "twextsec-choice-icon", "aria-hidden": "true" }, choiceIcons[option]), /* @__PURE__ */ import_react3.default.createElement("span", null, t(`${kind}-${option}`)));
|
|
541
|
+
var UnsandboxedWarning = ({ t }) => {
|
|
542
|
+
const [dismissed, setDismissed] = import_react3.default.useState(false);
|
|
543
|
+
const returnFocus = import_react3.default.useRef(null);
|
|
544
|
+
import_react3.default.useEffect(() => {
|
|
545
|
+
returnFocus.current = document.activeElement;
|
|
546
|
+
}, []);
|
|
547
|
+
if (dismissed) return null;
|
|
548
|
+
return /* @__PURE__ */ import_react3.default.createElement("aside", { className: "twextsec-warning" }, /* @__PURE__ */ import_react3.default.createElement("span", { role: "status" }, t("unsandboxedWarning")), /* @__PURE__ */ import_react3.default.createElement(
|
|
549
|
+
"button",
|
|
550
|
+
{
|
|
551
|
+
type: "button",
|
|
552
|
+
className: "twextsec-warning-close",
|
|
553
|
+
onClick: () => {
|
|
554
|
+
if (returnFocus.current && returnFocus.current.isConnected) {
|
|
555
|
+
returnFocus.current.focus({ preventScroll: true });
|
|
556
|
+
}
|
|
557
|
+
setDismissed(true);
|
|
558
|
+
}
|
|
559
|
+
},
|
|
560
|
+
t("closeWarning")
|
|
561
|
+
));
|
|
562
|
+
};
|
|
563
|
+
var Choices = ({ name, value, options, disabled, label, onChange, t }) => /* @__PURE__ */ import_react3.default.createElement("fieldset", { className: "twextsec-choice" }, /* @__PURE__ */ import_react3.default.createElement("legend", null, label), options.map((option) => /* @__PURE__ */ import_react3.default.createElement("label", { key: option }, /* @__PURE__ */ import_react3.default.createElement(
|
|
458
564
|
"input",
|
|
459
565
|
{
|
|
460
566
|
type: "radio",
|
|
@@ -464,8 +570,8 @@ var Choices = ({ name, value, options, disabled, label, onChange, t }) => /* @__
|
|
|
464
570
|
disabled,
|
|
465
571
|
onChange
|
|
466
572
|
}
|
|
467
|
-
),
|
|
468
|
-
var ExtensionReview = class extends
|
|
573
|
+
), /* @__PURE__ */ import_react3.default.createElement(ChoiceLabel, { kind: name.startsWith("loading") ? "loading" : "execution", option, t }))));
|
|
574
|
+
var ExtensionReview = class extends import_react3.default.PureComponent {
|
|
469
575
|
constructor(props) {
|
|
470
576
|
super(props);
|
|
471
577
|
bind(this, ["handleBulkExecution", "handleBulkLoading", "handleComplete", "handleCancel"]);
|
|
@@ -583,13 +689,24 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
583
689
|
const t = this.t.bind(this);
|
|
584
690
|
const decision = this.state.decisions.get(entry.key);
|
|
585
691
|
const metadata = this.metadataOf(entry);
|
|
692
|
+
const website = displayURL(metadata.docsURL);
|
|
693
|
+
const release = releaseURL(metadata);
|
|
586
694
|
const executions = this.executionOptions(entry);
|
|
587
695
|
const loadings = loadingChoices(entry);
|
|
588
696
|
const state = mode === "add" ? selection.stateOf(entry.key) : null;
|
|
589
697
|
const required = state === "dependency";
|
|
590
698
|
const roots = required ? [...selection.requiredBy.get(entry.key) || []] : [];
|
|
591
699
|
const failure = entry.state && entry.state.error;
|
|
592
|
-
const
|
|
700
|
+
const badge = /* @__PURE__ */ import_react3.default.createElement(
|
|
701
|
+
"img",
|
|
702
|
+
{
|
|
703
|
+
className: "twextsec-trusted",
|
|
704
|
+
src: trustedBadge,
|
|
705
|
+
alt: t("trusted"),
|
|
706
|
+
title: t("trusted")
|
|
707
|
+
}
|
|
708
|
+
);
|
|
709
|
+
const preview = /* @__PURE__ */ import_react3.default.createElement(
|
|
593
710
|
ExtensionPreview,
|
|
594
711
|
{
|
|
595
712
|
url: metadata.banner || fallbackBanner,
|
|
@@ -599,15 +716,16 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
599
716
|
locale: this.props.locale
|
|
600
717
|
}
|
|
601
718
|
);
|
|
602
|
-
return /* @__PURE__ */
|
|
719
|
+
return /* @__PURE__ */ import_react3.default.createElement(
|
|
603
720
|
"li",
|
|
604
721
|
{
|
|
605
722
|
key: entry.key,
|
|
606
723
|
className: "twextsec-row",
|
|
607
724
|
"data-key": entry.key,
|
|
725
|
+
"data-picking": mode === "add" ? "true" : void 0,
|
|
608
726
|
"data-failed": failure ? "true" : void 0
|
|
609
727
|
},
|
|
610
|
-
/* @__PURE__ */
|
|
728
|
+
/* @__PURE__ */ import_react3.default.createElement("div", { className: "twextsec-head" }, mode === "add" && /* @__PURE__ */ import_react3.default.createElement("label", { className: "twextsec-pick" }, /* @__PURE__ */ import_react3.default.createElement(
|
|
611
729
|
"input",
|
|
612
730
|
{
|
|
613
731
|
type: "checkbox",
|
|
@@ -615,16 +733,29 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
615
733
|
disabled: required || state === "loaded",
|
|
616
734
|
onChange: () => this.toggle(entry.key)
|
|
617
735
|
}
|
|
618
|
-
), /* @__PURE__ */
|
|
619
|
-
"
|
|
736
|
+
), /* @__PURE__ */ import_react3.default.createElement("strong", null, metadata.name || entry.key)), mode === "open" && /* @__PURE__ */ import_react3.default.createElement("strong", null, metadata.name || entry.key), metadata.name && /* @__PURE__ */ import_react3.default.createElement("span", { className: "twextsec-id" }, entry.ids.join(", ")), isTrusted(entry) && (website ? /* @__PURE__ */ import_react3.default.createElement(
|
|
737
|
+
"a",
|
|
620
738
|
{
|
|
621
|
-
className: "twextsec-trusted",
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
739
|
+
className: "twextsec-trusted-link",
|
|
740
|
+
href: website,
|
|
741
|
+
target: "_blank",
|
|
742
|
+
rel: "noopener noreferrer",
|
|
743
|
+
"aria-label": `${t("extensionPage")}: ${metadata.name || entry.key}`
|
|
744
|
+
},
|
|
745
|
+
badge
|
|
746
|
+
) : badge), metadata.version && (release ? /* @__PURE__ */ import_react3.default.createElement(
|
|
747
|
+
"a",
|
|
748
|
+
{
|
|
749
|
+
href: release,
|
|
750
|
+
target: "_blank",
|
|
751
|
+
rel: "noopener noreferrer",
|
|
752
|
+
title: t("releaseNotes")
|
|
753
|
+
},
|
|
754
|
+
t("version"),
|
|
755
|
+
" ",
|
|
756
|
+
metadata.version
|
|
757
|
+
) : /* @__PURE__ */ import_react3.default.createElement("span", null, t("version"), " ", metadata.version))),
|
|
758
|
+
/* @__PURE__ */ import_react3.default.createElement(
|
|
628
759
|
"p",
|
|
629
760
|
{
|
|
630
761
|
className: "twextsec-source",
|
|
@@ -632,8 +763,8 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
632
763
|
},
|
|
633
764
|
sourceLabel(entry, t)
|
|
634
765
|
),
|
|
635
|
-
entry.source.sha256 && /* @__PURE__ */
|
|
636
|
-
mode === "add" ? /* @__PURE__ */
|
|
766
|
+
entry.source.sha256 && /* @__PURE__ */ import_react3.default.createElement("p", { className: "twextsec-digest" }, t("digest"), " ", entry.source.sha256),
|
|
767
|
+
mode === "add" ? /* @__PURE__ */ import_react3.default.createElement(
|
|
637
768
|
"span",
|
|
638
769
|
{
|
|
639
770
|
className: "twextsec-preview-pick",
|
|
@@ -642,10 +773,10 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
642
773
|
},
|
|
643
774
|
preview
|
|
644
775
|
) : preview,
|
|
645
|
-
/* @__PURE__ */
|
|
646
|
-
/* @__PURE__ */
|
|
647
|
-
/* @__PURE__ */
|
|
648
|
-
failure && /* @__PURE__ */
|
|
776
|
+
/* @__PURE__ */ import_react3.default.createElement("p", { className: "twextsec-about" }, /* @__PURE__ */ import_react3.default.createElement(LinkedText, { text: getExtensionDescription(metadata, this.props.locale) })),
|
|
777
|
+
/* @__PURE__ */ import_react3.default.createElement("p", { className: "twextsec-claim" }, t("creator"), ": ", /* @__PURE__ */ import_react3.default.createElement(LinkedText, { text: metadata.author || t("creatorUnknown") }), metadata.authorURL && /* @__PURE__ */ import_react3.default.createElement("span", { className: "twextsec-contact" }, " ", /* @__PURE__ */ import_react3.default.createElement(LinkedText, { text: metadata.authorURL }))),
|
|
778
|
+
/* @__PURE__ */ import_react3.default.createElement("div", { className: "twextsec-status" }, (required || state === "loaded") && /* @__PURE__ */ import_react3.default.createElement("span", { className: "twextsec-state" }, required ? t("state-dependency", { names: roots.join(", ") }) : t("state-loaded")), unsandboxedRequirement(metadata) === "required" && /* @__PURE__ */ import_react3.default.createElement("span", { className: "twextsec-requirement" }, t("requirement-required"))),
|
|
779
|
+
failure && /* @__PURE__ */ import_react3.default.createElement(
|
|
649
780
|
Failure,
|
|
650
781
|
{
|
|
651
782
|
failure,
|
|
@@ -653,7 +784,7 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
653
784
|
t
|
|
654
785
|
}
|
|
655
786
|
),
|
|
656
|
-
/* @__PURE__ */
|
|
787
|
+
/* @__PURE__ */ import_react3.default.createElement("div", { className: "twextsec-choices" }, !isTrusted(entry) && /* @__PURE__ */ import_react3.default.createElement(
|
|
657
788
|
Choices,
|
|
658
789
|
{
|
|
659
790
|
name: `execution-${entry.key}`,
|
|
@@ -663,7 +794,7 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
663
794
|
onChange: (event) => this.decide(entry.key, { execution: event.target.value }),
|
|
664
795
|
t
|
|
665
796
|
}
|
|
666
|
-
), loadings.length > 0 && /* @__PURE__ */
|
|
797
|
+
), loadings.length > 0 && /* @__PURE__ */ import_react3.default.createElement(
|
|
667
798
|
Choices,
|
|
668
799
|
{
|
|
669
800
|
name: `loading-${entry.key}`,
|
|
@@ -674,8 +805,8 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
674
805
|
t
|
|
675
806
|
}
|
|
676
807
|
)),
|
|
677
|
-
loadings.length === 0 && decision.loading !== void 0 && /* @__PURE__ */
|
|
678
|
-
contradictsDeclaration(entry, decision) && /* @__PURE__ */
|
|
808
|
+
loadings.length === 0 && decision.loading !== void 0 && /* @__PURE__ */ import_react3.default.createElement("p", { className: "twextsec-loading-fixed" }, /* @__PURE__ */ import_react3.default.createElement(ChoiceLabel, { kind: "loading", option: decision.loading, t })),
|
|
809
|
+
contradictsDeclaration(entry, decision) && /* @__PURE__ */ import_react3.default.createElement(
|
|
679
810
|
"p",
|
|
680
811
|
{
|
|
681
812
|
className: "twextsec-contradiction",
|
|
@@ -692,14 +823,14 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
692
823
|
const allRequired = this.allRequired();
|
|
693
824
|
const anyUnsandboxed = [...this.included()].some((key) => this.state.decisions.get(key).execution === "unsandboxed");
|
|
694
825
|
const bulkLoadings = loadingModes.filter((mode2) => entries.some((entry) => loadingChoices(entry).includes(mode2)));
|
|
695
|
-
const
|
|
826
|
+
const content = /* @__PURE__ */ import_react3.default.createElement(import_react3.default.Fragment, null, /* @__PURE__ */ import_react3.default.createElement("p", { className: "twextsec-intro" }, t(mode === "add" ? "addIntro" : allRequired ? "allRequiredIntro" : "openIntro")), failure && /* @__PURE__ */ import_react3.default.createElement(
|
|
696
827
|
Failure,
|
|
697
828
|
{
|
|
698
829
|
failure,
|
|
699
830
|
onRetry,
|
|
700
831
|
t
|
|
701
832
|
}
|
|
702
|
-
), (!allRequired || bulkLoadings.length > 0) && /* @__PURE__ */
|
|
833
|
+
), (!allRequired || bulkLoadings.length > 0) && /* @__PURE__ */ import_react3.default.createElement("div", { className: "twextsec-bulk" }, !allRequired && /* @__PURE__ */ import_react3.default.createElement(
|
|
703
834
|
Choices,
|
|
704
835
|
{
|
|
705
836
|
name: "execution-all",
|
|
@@ -709,7 +840,7 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
709
840
|
onChange: this.handleBulkExecution,
|
|
710
841
|
t
|
|
711
842
|
}
|
|
712
|
-
), bulkLoadings.length > 0 && /* @__PURE__ */
|
|
843
|
+
), bulkLoadings.length > 0 && /* @__PURE__ */ import_react3.default.createElement(import_react3.default.Fragment, null, /* @__PURE__ */ import_react3.default.createElement(
|
|
713
844
|
Choices,
|
|
714
845
|
{
|
|
715
846
|
name: "loading-all",
|
|
@@ -719,14 +850,8 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
719
850
|
onChange: this.handleBulkLoading,
|
|
720
851
|
t
|
|
721
852
|
}
|
|
722
|
-
), /* @__PURE__ */
|
|
723
|
-
|
|
724
|
-
{
|
|
725
|
-
className: "twextsec-warning",
|
|
726
|
-
role: "note"
|
|
727
|
-
},
|
|
728
|
-
t("unsandboxedWarning")
|
|
729
|
-
), /* @__PURE__ */ import_react2.default.createElement("ul", { className: "twextsec-rows" }, entries.map((entry) => this.renderRow(entry, selection))), /* @__PURE__ */ import_react2.default.createElement("menu", { className: "twextsec-actions" }, /* @__PURE__ */ import_react2.default.createElement(
|
|
853
|
+
), /* @__PURE__ */ import_react3.default.createElement("p", { className: "twextsec-note" }, t("loadingNote")))), /* @__PURE__ */ import_react3.default.createElement("ul", { className: "twextsec-rows" }, entries.map((entry) => this.renderRow(entry, selection))));
|
|
854
|
+
const body = /* @__PURE__ */ import_react3.default.createElement("div", { className: "twextsec-review", "data-mode": mode }, mode === "add" ? /* @__PURE__ */ import_react3.default.createElement("div", { className: "twextsec-scroll" }, content) : content, anyUnsandboxed && /* @__PURE__ */ import_react3.default.createElement(UnsandboxedWarning, { t }), /* @__PURE__ */ import_react3.default.createElement("menu", { className: "twextsec-actions" }, /* @__PURE__ */ import_react3.default.createElement(
|
|
730
855
|
"button",
|
|
731
856
|
{
|
|
732
857
|
type: "button",
|
|
@@ -734,7 +859,7 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
734
859
|
onClick: this.handleCancel
|
|
735
860
|
},
|
|
736
861
|
t("cancel")
|
|
737
|
-
), /* @__PURE__ */
|
|
862
|
+
), /* @__PURE__ */ import_react3.default.createElement(
|
|
738
863
|
"button",
|
|
739
864
|
{
|
|
740
865
|
type: "button",
|
|
@@ -744,7 +869,7 @@ var ExtensionReview = class extends import_react2.default.PureComponent {
|
|
|
744
869
|
t(mode === "add" ? "add" : "ok")
|
|
745
870
|
)));
|
|
746
871
|
if (mode === "open" && DialogFrame) {
|
|
747
|
-
return /* @__PURE__ */
|
|
872
|
+
return /* @__PURE__ */ import_react3.default.createElement(
|
|
748
873
|
DialogFrame,
|
|
749
874
|
{
|
|
750
875
|
title: t("openTitle"),
|
package/dist/react.mjs
CHANGED
|
@@ -19,7 +19,7 @@ var __spreadValues = (a, b) => {
|
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
|
|
21
21
|
// src/review.jsx
|
|
22
|
-
import
|
|
22
|
+
import React3 from "react";
|
|
23
23
|
|
|
24
24
|
// src/messages.js
|
|
25
25
|
var messages = {
|
|
@@ -44,6 +44,7 @@ var messages = {
|
|
|
44
44
|
"loading-embedded-data": "In the project, as a data address",
|
|
45
45
|
loadingNote: "A kept copy is verified and reused, so the project opens without the network. Fetching each time leaves nothing in this browser.",
|
|
46
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.",
|
|
47
|
+
closeWarning: "Close",
|
|
47
48
|
"requirement-required": "\u26A0\uFE0F Needs to run without the sandbox",
|
|
48
49
|
trusted: "Trusted by TurboWarp Plus: runs without the sandbox",
|
|
49
50
|
trustedNote: "Catalog extensions are treated like TurboWarp\u2019s own gallery and are not asked about.",
|
|
@@ -56,6 +57,8 @@ var messages = {
|
|
|
56
57
|
creatorUnknown: "Not stated",
|
|
57
58
|
licenseUnknown: "Not stated",
|
|
58
59
|
version: "Version",
|
|
60
|
+
extensionPage: "Extension website",
|
|
61
|
+
releaseNotes: "Release notes",
|
|
59
62
|
digest: "SHA-256",
|
|
60
63
|
failed: "Could not be loaded",
|
|
61
64
|
retryNote: "This may be a network problem.",
|
|
@@ -87,6 +90,7 @@ var messages = {
|
|
|
87
90
|
"loading-embedded-data": "\u4F5C\u54C1\u306E\u4E2D\u306E data: \u30A2\u30C9\u30EC\u30B9\u304B\u3089",
|
|
88
91
|
loadingNote: "\u30AD\u30E3\u30C3\u30B7\u30E5\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",
|
|
89
92
|
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",
|
|
93
|
+
closeWarning: "\u9589\u3058\u308B",
|
|
90
94
|
"requirement-required": "\u26A0\uFE0F \u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306A\u3057\u304C\u5FC5\u8981",
|
|
91
95
|
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",
|
|
92
96
|
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",
|
|
@@ -99,6 +103,8 @@ var messages = {
|
|
|
99
103
|
creatorUnknown: "\u8A18\u8F09\u306A\u3057",
|
|
100
104
|
licenseUnknown: "\u8A18\u8F09\u306A\u3057",
|
|
101
105
|
version: "\u30D0\u30FC\u30B8\u30E7\u30F3",
|
|
106
|
+
extensionPage: "\u6A5F\u80FD\u62E1\u5F35\u306E\u7D39\u4ECB\u30DA\u30FC\u30B8",
|
|
107
|
+
releaseNotes: "\u30EA\u30EA\u30FC\u30B9\u30CE\u30FC\u30C8",
|
|
102
108
|
digest: "SHA-256",
|
|
103
109
|
failed: "\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",
|
|
104
110
|
retryNote: "\u901A\u4FE1\u306E\u554F\u984C\u306E\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002",
|
|
@@ -118,6 +124,28 @@ var formatMessage = (locale, key, values = {}) => {
|
|
|
118
124
|
return template.replace(/\{(\w+)\}/g, (match, name) => values[name] === void 0 ? match : String(values[name]));
|
|
119
125
|
};
|
|
120
126
|
|
|
127
|
+
// src/display-urls.js
|
|
128
|
+
var displayURL = (value, allowMail = false) => {
|
|
129
|
+
if (typeof value !== "string" || !value || /[\u0000-\u0020\u007f]/.test(value)) return null;
|
|
130
|
+
try {
|
|
131
|
+
const url = new URL(value);
|
|
132
|
+
if (url.username || url.password) return null;
|
|
133
|
+
if (url.protocol === "http:" || url.protocol === "https:") return value;
|
|
134
|
+
if (allowMail && url.protocol === "mailto:" && /^[^\s@]+@[^\s@]+$/.test(decodeURIComponent(url.pathname))) return value;
|
|
135
|
+
} catch (error) {
|
|
136
|
+
}
|
|
137
|
+
return null;
|
|
138
|
+
};
|
|
139
|
+
var releaseURL = (metadata) => {
|
|
140
|
+
if (!displayURL(metadata.repository) || !/^v?\d+\.\d+\.\d+(?:-[\w.-]+)?(?:\+[\w.-]+)?$/.test(metadata.version || "")) return null;
|
|
141
|
+
const repository = new URL(metadata.repository);
|
|
142
|
+
if (repository.origin !== "https://github.com" || repository.search || repository.hash) return null;
|
|
143
|
+
const path = /^\/([\w.-]+)\/([\w.-]+?)\/?$/.exec(repository.pathname);
|
|
144
|
+
if (!path) return null;
|
|
145
|
+
const version = metadata.version.replace(/^v/, "");
|
|
146
|
+
return `https://github.com/${path[1]}/${path[2].replace(/\.git$/, "")}/releases/tag/${encodeURIComponent(`v${version}`)}`;
|
|
147
|
+
};
|
|
148
|
+
|
|
121
149
|
// src/metadata.js
|
|
122
150
|
var HEADER_FIELDS = Object.freeze({
|
|
123
151
|
name: "name",
|
|
@@ -346,6 +374,53 @@ var ExtensionPreview = class extends React.PureComponent {
|
|
|
346
374
|
}
|
|
347
375
|
};
|
|
348
376
|
|
|
377
|
+
// src/linked-text.jsx
|
|
378
|
+
import React2 from "react";
|
|
379
|
+
var addresses = /https?:\/\/[^\s<>"'。、「」『』【】]+|mailto:[^\s<>"'。、「」『』【】]+|[\w.!#$%&'*+/=?^`{|}~-]+@[A-Z0-9](?:[A-Z0-9.-]*[A-Z0-9])?\.[A-Z]{2,}/gi;
|
|
380
|
+
var trimPunctuation = (text) => {
|
|
381
|
+
let result = text;
|
|
382
|
+
while (result) {
|
|
383
|
+
const last = result.slice(-1);
|
|
384
|
+
if (/[.,;:!?!?]/.test(last)) {
|
|
385
|
+
result = result.slice(0, -1);
|
|
386
|
+
continue;
|
|
387
|
+
}
|
|
388
|
+
const opener = { ")": "(", "]": "[", "}": "{", "\uFF09": "\uFF08" }[last];
|
|
389
|
+
if (opener && result.split(last).length > result.split(opener).length) {
|
|
390
|
+
result = result.slice(0, -1);
|
|
391
|
+
continue;
|
|
392
|
+
}
|
|
393
|
+
break;
|
|
394
|
+
}
|
|
395
|
+
return result;
|
|
396
|
+
};
|
|
397
|
+
var LinkedText = ({ text }) => {
|
|
398
|
+
const parts = [];
|
|
399
|
+
const input = String(text || "");
|
|
400
|
+
const matcher = new RegExp(addresses.source, addresses.flags);
|
|
401
|
+
let cursor = 0;
|
|
402
|
+
let match;
|
|
403
|
+
while (match = matcher.exec(input)) {
|
|
404
|
+
parts.push(input.slice(cursor, match.index));
|
|
405
|
+
const label = trimPunctuation(match[0]);
|
|
406
|
+
const href = displayURL(/^(?:https?:\/\/|mailto:)/i.test(label) ? label : `mailto:${label}`, true);
|
|
407
|
+
parts.push(href ? /* @__PURE__ */ React2.createElement(
|
|
408
|
+
"a",
|
|
409
|
+
{
|
|
410
|
+
key: match.index,
|
|
411
|
+
href,
|
|
412
|
+
target: /^mailto:/i.test(href) ? void 0 : "_blank",
|
|
413
|
+
rel: "noopener noreferrer"
|
|
414
|
+
},
|
|
415
|
+
label
|
|
416
|
+
) : label);
|
|
417
|
+
parts.push(match[0].slice(label.length));
|
|
418
|
+
cursor = matcher.lastIndex;
|
|
419
|
+
}
|
|
420
|
+
parts.push(input.slice(cursor));
|
|
421
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, parts);
|
|
422
|
+
};
|
|
423
|
+
|
|
349
424
|
// src/decisions.js
|
|
350
425
|
var isTrusted = (entry) => Boolean(entry && entry.state && entry.state.trusted);
|
|
351
426
|
var allRequireUnsandboxed = (entries) => entries.length > 0 && entries.every(
|
|
@@ -401,15 +476,15 @@ var sourceLabel = (entry, t) => {
|
|
|
401
476
|
};
|
|
402
477
|
var Failure = ({ failure, onRetry, t }) => {
|
|
403
478
|
const retry = failure.retryable === true && typeof onRetry === "function";
|
|
404
|
-
return /* @__PURE__ */
|
|
479
|
+
return /* @__PURE__ */ React3.createElement(
|
|
405
480
|
"div",
|
|
406
481
|
{
|
|
407
482
|
className: "twextsec-failed",
|
|
408
483
|
role: "alert"
|
|
409
484
|
},
|
|
410
|
-
/* @__PURE__ */
|
|
411
|
-
retry && /* @__PURE__ */
|
|
412
|
-
retry && /* @__PURE__ */
|
|
485
|
+
/* @__PURE__ */ React3.createElement("p", null, t("failed"), ": ", failure.code && `${failure.code} `, failure.message),
|
|
486
|
+
retry && /* @__PURE__ */ React3.createElement("p", { className: "twextsec-retry-note" }, t("retryNote")),
|
|
487
|
+
retry && /* @__PURE__ */ React3.createElement(
|
|
413
488
|
"button",
|
|
414
489
|
{
|
|
415
490
|
type: "button",
|
|
@@ -421,7 +496,38 @@ var Failure = ({ failure, onRetry, t }) => {
|
|
|
421
496
|
)
|
|
422
497
|
);
|
|
423
498
|
};
|
|
424
|
-
var
|
|
499
|
+
var choiceIcons = {
|
|
500
|
+
sandboxed: "\u{1F6E1}\uFE0F",
|
|
501
|
+
unsandboxed: "\u26A0\uFE0F",
|
|
502
|
+
"remote-cacheable": "\u{1F4BC}",
|
|
503
|
+
"remote-non-cacheable": "\u2B07\uFE0F",
|
|
504
|
+
"embedded-file": "\u{1F961}",
|
|
505
|
+
"embedded-data": "\u{1F4E6}"
|
|
506
|
+
};
|
|
507
|
+
var ChoiceLabel = ({ kind, option, t }) => /* @__PURE__ */ React3.createElement("span", { className: "twextsec-choice-label" }, choiceIcons[option] && /* @__PURE__ */ React3.createElement("span", { className: "twextsec-choice-icon", "aria-hidden": "true" }, choiceIcons[option]), /* @__PURE__ */ React3.createElement("span", null, t(`${kind}-${option}`)));
|
|
508
|
+
var UnsandboxedWarning = ({ t }) => {
|
|
509
|
+
const [dismissed, setDismissed] = React3.useState(false);
|
|
510
|
+
const returnFocus = React3.useRef(null);
|
|
511
|
+
React3.useEffect(() => {
|
|
512
|
+
returnFocus.current = document.activeElement;
|
|
513
|
+
}, []);
|
|
514
|
+
if (dismissed) return null;
|
|
515
|
+
return /* @__PURE__ */ React3.createElement("aside", { className: "twextsec-warning" }, /* @__PURE__ */ React3.createElement("span", { role: "status" }, t("unsandboxedWarning")), /* @__PURE__ */ React3.createElement(
|
|
516
|
+
"button",
|
|
517
|
+
{
|
|
518
|
+
type: "button",
|
|
519
|
+
className: "twextsec-warning-close",
|
|
520
|
+
onClick: () => {
|
|
521
|
+
if (returnFocus.current && returnFocus.current.isConnected) {
|
|
522
|
+
returnFocus.current.focus({ preventScroll: true });
|
|
523
|
+
}
|
|
524
|
+
setDismissed(true);
|
|
525
|
+
}
|
|
526
|
+
},
|
|
527
|
+
t("closeWarning")
|
|
528
|
+
));
|
|
529
|
+
};
|
|
530
|
+
var Choices = ({ name, value, options, disabled, label, onChange, t }) => /* @__PURE__ */ React3.createElement("fieldset", { className: "twextsec-choice" }, /* @__PURE__ */ React3.createElement("legend", null, label), options.map((option) => /* @__PURE__ */ React3.createElement("label", { key: option }, /* @__PURE__ */ React3.createElement(
|
|
425
531
|
"input",
|
|
426
532
|
{
|
|
427
533
|
type: "radio",
|
|
@@ -431,8 +537,8 @@ var Choices = ({ name, value, options, disabled, label, onChange, t }) => /* @__
|
|
|
431
537
|
disabled,
|
|
432
538
|
onChange
|
|
433
539
|
}
|
|
434
|
-
),
|
|
435
|
-
var ExtensionReview = class extends
|
|
540
|
+
), /* @__PURE__ */ React3.createElement(ChoiceLabel, { kind: name.startsWith("loading") ? "loading" : "execution", option, t }))));
|
|
541
|
+
var ExtensionReview = class extends React3.PureComponent {
|
|
436
542
|
constructor(props) {
|
|
437
543
|
super(props);
|
|
438
544
|
bind(this, ["handleBulkExecution", "handleBulkLoading", "handleComplete", "handleCancel"]);
|
|
@@ -550,13 +656,24 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
550
656
|
const t = this.t.bind(this);
|
|
551
657
|
const decision = this.state.decisions.get(entry.key);
|
|
552
658
|
const metadata = this.metadataOf(entry);
|
|
659
|
+
const website = displayURL(metadata.docsURL);
|
|
660
|
+
const release = releaseURL(metadata);
|
|
553
661
|
const executions = this.executionOptions(entry);
|
|
554
662
|
const loadings = loadingChoices(entry);
|
|
555
663
|
const state = mode === "add" ? selection.stateOf(entry.key) : null;
|
|
556
664
|
const required = state === "dependency";
|
|
557
665
|
const roots = required ? [...selection.requiredBy.get(entry.key) || []] : [];
|
|
558
666
|
const failure = entry.state && entry.state.error;
|
|
559
|
-
const
|
|
667
|
+
const badge = /* @__PURE__ */ React3.createElement(
|
|
668
|
+
"img",
|
|
669
|
+
{
|
|
670
|
+
className: "twextsec-trusted",
|
|
671
|
+
src: trustedBadge,
|
|
672
|
+
alt: t("trusted"),
|
|
673
|
+
title: t("trusted")
|
|
674
|
+
}
|
|
675
|
+
);
|
|
676
|
+
const preview = /* @__PURE__ */ React3.createElement(
|
|
560
677
|
ExtensionPreview,
|
|
561
678
|
{
|
|
562
679
|
url: metadata.banner || fallbackBanner,
|
|
@@ -566,15 +683,16 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
566
683
|
locale: this.props.locale
|
|
567
684
|
}
|
|
568
685
|
);
|
|
569
|
-
return /* @__PURE__ */
|
|
686
|
+
return /* @__PURE__ */ React3.createElement(
|
|
570
687
|
"li",
|
|
571
688
|
{
|
|
572
689
|
key: entry.key,
|
|
573
690
|
className: "twextsec-row",
|
|
574
691
|
"data-key": entry.key,
|
|
692
|
+
"data-picking": mode === "add" ? "true" : void 0,
|
|
575
693
|
"data-failed": failure ? "true" : void 0
|
|
576
694
|
},
|
|
577
|
-
/* @__PURE__ */
|
|
695
|
+
/* @__PURE__ */ React3.createElement("div", { className: "twextsec-head" }, mode === "add" && /* @__PURE__ */ React3.createElement("label", { className: "twextsec-pick" }, /* @__PURE__ */ React3.createElement(
|
|
578
696
|
"input",
|
|
579
697
|
{
|
|
580
698
|
type: "checkbox",
|
|
@@ -582,16 +700,29 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
582
700
|
disabled: required || state === "loaded",
|
|
583
701
|
onChange: () => this.toggle(entry.key)
|
|
584
702
|
}
|
|
585
|
-
), /* @__PURE__ */
|
|
586
|
-
"
|
|
703
|
+
), /* @__PURE__ */ React3.createElement("strong", null, metadata.name || entry.key)), mode === "open" && /* @__PURE__ */ React3.createElement("strong", null, metadata.name || entry.key), metadata.name && /* @__PURE__ */ React3.createElement("span", { className: "twextsec-id" }, entry.ids.join(", ")), isTrusted(entry) && (website ? /* @__PURE__ */ React3.createElement(
|
|
704
|
+
"a",
|
|
587
705
|
{
|
|
588
|
-
className: "twextsec-trusted",
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
706
|
+
className: "twextsec-trusted-link",
|
|
707
|
+
href: website,
|
|
708
|
+
target: "_blank",
|
|
709
|
+
rel: "noopener noreferrer",
|
|
710
|
+
"aria-label": `${t("extensionPage")}: ${metadata.name || entry.key}`
|
|
711
|
+
},
|
|
712
|
+
badge
|
|
713
|
+
) : badge), metadata.version && (release ? /* @__PURE__ */ React3.createElement(
|
|
714
|
+
"a",
|
|
715
|
+
{
|
|
716
|
+
href: release,
|
|
717
|
+
target: "_blank",
|
|
718
|
+
rel: "noopener noreferrer",
|
|
719
|
+
title: t("releaseNotes")
|
|
720
|
+
},
|
|
721
|
+
t("version"),
|
|
722
|
+
" ",
|
|
723
|
+
metadata.version
|
|
724
|
+
) : /* @__PURE__ */ React3.createElement("span", null, t("version"), " ", metadata.version))),
|
|
725
|
+
/* @__PURE__ */ React3.createElement(
|
|
595
726
|
"p",
|
|
596
727
|
{
|
|
597
728
|
className: "twextsec-source",
|
|
@@ -599,8 +730,8 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
599
730
|
},
|
|
600
731
|
sourceLabel(entry, t)
|
|
601
732
|
),
|
|
602
|
-
entry.source.sha256 && /* @__PURE__ */
|
|
603
|
-
mode === "add" ? /* @__PURE__ */
|
|
733
|
+
entry.source.sha256 && /* @__PURE__ */ React3.createElement("p", { className: "twextsec-digest" }, t("digest"), " ", entry.source.sha256),
|
|
734
|
+
mode === "add" ? /* @__PURE__ */ React3.createElement(
|
|
604
735
|
"span",
|
|
605
736
|
{
|
|
606
737
|
className: "twextsec-preview-pick",
|
|
@@ -609,10 +740,10 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
609
740
|
},
|
|
610
741
|
preview
|
|
611
742
|
) : preview,
|
|
612
|
-
/* @__PURE__ */
|
|
613
|
-
/* @__PURE__ */
|
|
614
|
-
/* @__PURE__ */
|
|
615
|
-
failure && /* @__PURE__ */
|
|
743
|
+
/* @__PURE__ */ React3.createElement("p", { className: "twextsec-about" }, /* @__PURE__ */ React3.createElement(LinkedText, { text: getExtensionDescription(metadata, this.props.locale) })),
|
|
744
|
+
/* @__PURE__ */ React3.createElement("p", { className: "twextsec-claim" }, t("creator"), ": ", /* @__PURE__ */ React3.createElement(LinkedText, { text: metadata.author || t("creatorUnknown") }), metadata.authorURL && /* @__PURE__ */ React3.createElement("span", { className: "twextsec-contact" }, " ", /* @__PURE__ */ React3.createElement(LinkedText, { text: metadata.authorURL }))),
|
|
745
|
+
/* @__PURE__ */ React3.createElement("div", { className: "twextsec-status" }, (required || state === "loaded") && /* @__PURE__ */ React3.createElement("span", { className: "twextsec-state" }, required ? t("state-dependency", { names: roots.join(", ") }) : t("state-loaded")), unsandboxedRequirement(metadata) === "required" && /* @__PURE__ */ React3.createElement("span", { className: "twextsec-requirement" }, t("requirement-required"))),
|
|
746
|
+
failure && /* @__PURE__ */ React3.createElement(
|
|
616
747
|
Failure,
|
|
617
748
|
{
|
|
618
749
|
failure,
|
|
@@ -620,7 +751,7 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
620
751
|
t
|
|
621
752
|
}
|
|
622
753
|
),
|
|
623
|
-
/* @__PURE__ */
|
|
754
|
+
/* @__PURE__ */ React3.createElement("div", { className: "twextsec-choices" }, !isTrusted(entry) && /* @__PURE__ */ React3.createElement(
|
|
624
755
|
Choices,
|
|
625
756
|
{
|
|
626
757
|
name: `execution-${entry.key}`,
|
|
@@ -630,7 +761,7 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
630
761
|
onChange: (event) => this.decide(entry.key, { execution: event.target.value }),
|
|
631
762
|
t
|
|
632
763
|
}
|
|
633
|
-
), loadings.length > 0 && /* @__PURE__ */
|
|
764
|
+
), loadings.length > 0 && /* @__PURE__ */ React3.createElement(
|
|
634
765
|
Choices,
|
|
635
766
|
{
|
|
636
767
|
name: `loading-${entry.key}`,
|
|
@@ -641,8 +772,8 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
641
772
|
t
|
|
642
773
|
}
|
|
643
774
|
)),
|
|
644
|
-
loadings.length === 0 && decision.loading !== void 0 && /* @__PURE__ */
|
|
645
|
-
contradictsDeclaration(entry, decision) && /* @__PURE__ */
|
|
775
|
+
loadings.length === 0 && decision.loading !== void 0 && /* @__PURE__ */ React3.createElement("p", { className: "twextsec-loading-fixed" }, /* @__PURE__ */ React3.createElement(ChoiceLabel, { kind: "loading", option: decision.loading, t })),
|
|
776
|
+
contradictsDeclaration(entry, decision) && /* @__PURE__ */ React3.createElement(
|
|
646
777
|
"p",
|
|
647
778
|
{
|
|
648
779
|
className: "twextsec-contradiction",
|
|
@@ -659,14 +790,14 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
659
790
|
const allRequired = this.allRequired();
|
|
660
791
|
const anyUnsandboxed = [...this.included()].some((key) => this.state.decisions.get(key).execution === "unsandboxed");
|
|
661
792
|
const bulkLoadings = loadingModes.filter((mode2) => entries.some((entry) => loadingChoices(entry).includes(mode2)));
|
|
662
|
-
const
|
|
793
|
+
const content = /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement("p", { className: "twextsec-intro" }, t(mode === "add" ? "addIntro" : allRequired ? "allRequiredIntro" : "openIntro")), failure && /* @__PURE__ */ React3.createElement(
|
|
663
794
|
Failure,
|
|
664
795
|
{
|
|
665
796
|
failure,
|
|
666
797
|
onRetry,
|
|
667
798
|
t
|
|
668
799
|
}
|
|
669
|
-
), (!allRequired || bulkLoadings.length > 0) && /* @__PURE__ */
|
|
800
|
+
), (!allRequired || bulkLoadings.length > 0) && /* @__PURE__ */ React3.createElement("div", { className: "twextsec-bulk" }, !allRequired && /* @__PURE__ */ React3.createElement(
|
|
670
801
|
Choices,
|
|
671
802
|
{
|
|
672
803
|
name: "execution-all",
|
|
@@ -676,7 +807,7 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
676
807
|
onChange: this.handleBulkExecution,
|
|
677
808
|
t
|
|
678
809
|
}
|
|
679
|
-
), bulkLoadings.length > 0 && /* @__PURE__ */
|
|
810
|
+
), bulkLoadings.length > 0 && /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(
|
|
680
811
|
Choices,
|
|
681
812
|
{
|
|
682
813
|
name: "loading-all",
|
|
@@ -686,14 +817,8 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
686
817
|
onChange: this.handleBulkLoading,
|
|
687
818
|
t
|
|
688
819
|
}
|
|
689
|
-
), /* @__PURE__ */
|
|
690
|
-
|
|
691
|
-
{
|
|
692
|
-
className: "twextsec-warning",
|
|
693
|
-
role: "note"
|
|
694
|
-
},
|
|
695
|
-
t("unsandboxedWarning")
|
|
696
|
-
), /* @__PURE__ */ React2.createElement("ul", { className: "twextsec-rows" }, entries.map((entry) => this.renderRow(entry, selection))), /* @__PURE__ */ React2.createElement("menu", { className: "twextsec-actions" }, /* @__PURE__ */ React2.createElement(
|
|
820
|
+
), /* @__PURE__ */ React3.createElement("p", { className: "twextsec-note" }, t("loadingNote")))), /* @__PURE__ */ React3.createElement("ul", { className: "twextsec-rows" }, entries.map((entry) => this.renderRow(entry, selection))));
|
|
821
|
+
const body = /* @__PURE__ */ React3.createElement("div", { className: "twextsec-review", "data-mode": mode }, mode === "add" ? /* @__PURE__ */ React3.createElement("div", { className: "twextsec-scroll" }, content) : content, anyUnsandboxed && /* @__PURE__ */ React3.createElement(UnsandboxedWarning, { t }), /* @__PURE__ */ React3.createElement("menu", { className: "twextsec-actions" }, /* @__PURE__ */ React3.createElement(
|
|
697
822
|
"button",
|
|
698
823
|
{
|
|
699
824
|
type: "button",
|
|
@@ -701,7 +826,7 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
701
826
|
onClick: this.handleCancel
|
|
702
827
|
},
|
|
703
828
|
t("cancel")
|
|
704
|
-
), /* @__PURE__ */
|
|
829
|
+
), /* @__PURE__ */ React3.createElement(
|
|
705
830
|
"button",
|
|
706
831
|
{
|
|
707
832
|
type: "button",
|
|
@@ -711,7 +836,7 @@ var ExtensionReview = class extends React2.PureComponent {
|
|
|
711
836
|
t(mode === "add" ? "add" : "ok")
|
|
712
837
|
)));
|
|
713
838
|
if (mode === "open" && DialogFrame) {
|
|
714
|
-
return /* @__PURE__ */
|
|
839
|
+
return /* @__PURE__ */ React3.createElement(
|
|
715
840
|
DialogFrame,
|
|
716
841
|
{
|
|
717
842
|
title: t("openTitle"),
|
package/dist/review-types.d.ts
CHANGED
|
@@ -34,7 +34,10 @@ export type LoadingMode =
|
|
|
34
34
|
|
|
35
35
|
export interface ExtensionMetadata {
|
|
36
36
|
name?: string; id?: string; description?: string; descriptions?: Record<string, string>;
|
|
37
|
-
author?: string;
|
|
37
|
+
author?: string;
|
|
38
|
+
/** Display-only HTTP(S) page or mailto contact; never used to fetch extension code. */
|
|
39
|
+
authorURL?: string;
|
|
40
|
+
version?: string; license?: string;
|
|
38
41
|
repository?: string; docsURL?: string; banner?: string; package?: string;
|
|
39
42
|
unsandboxed?: string; updatedAt?: string;
|
|
40
43
|
}
|
package/package.json
CHANGED
package/styles.css
CHANGED
|
@@ -1,15 +1,42 @@
|
|
|
1
1
|
.twextsec-review { box-sizing: border-box; color: var(--ui-modal-foreground, #263145); font: inherit; }
|
|
2
|
+
/* Only the catalog content scrolls; its actions keep their place in the host's available height. */
|
|
3
|
+
.twextsec-review[data-mode="add"] { position: relative; display: grid;
|
|
4
|
+
grid-template-rows: minmax(0, 1fr) auto; height: 100%; min-height: 0; }
|
|
5
|
+
.twextsec-scroll { grid-area: 1 / 1; min-height: 0; overflow: auto; overscroll-behavior: contain;
|
|
6
|
+
scrollbar-gutter: stable; padding-right: 4px; }
|
|
2
7
|
.twextsec-review *, .twextsec-review *::before, .twextsec-review *::after { box-sizing: inherit; }
|
|
8
|
+
.twextsec-review a { color: inherit; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
|
|
9
|
+
.twextsec-review a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 2px; }
|
|
3
10
|
.twextsec-intro { margin: 0 0 12px; }
|
|
4
11
|
.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
12
|
.twextsec-note { flex: 1 1 100%; margin: 0; font-size: .9em; opacity: .8; }
|
|
6
|
-
|
|
13
|
+
/* Keep the notice outside the list's flow and pair its colors across host themes. */
|
|
14
|
+
.twextsec-warning { position: fixed; z-index: 1000; left: 16px; right: 16px;
|
|
15
|
+
bottom: calc(16px + env(safe-area-inset-bottom, 0px)); max-width: 760px; margin: 0 auto;
|
|
16
|
+
display: flex; align-items: flex-start; gap: 16px; padding: 14px 16px;
|
|
17
|
+
max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto;
|
|
18
|
+
border: 1px solid #90a4bf; border-radius: 8px; background: #243247; color: #fff;
|
|
19
|
+
box-shadow: 0 4px 20px #0006; font-size: 14px; line-height: 1.5; }
|
|
20
|
+
.twextsec-review[data-mode="add"] > .twextsec-warning { position: absolute; grid-area: 1 / 1 / 2 / 2;
|
|
21
|
+
bottom: 12px; max-height: calc(100% - 24px); }
|
|
22
|
+
.twextsec-warning > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
|
|
23
|
+
.twextsec-warning-close { flex: none; min-width: 64px; min-height: 44px; padding: 8px 12px;
|
|
24
|
+
border: 1px solid currentColor; border-radius: 6px; background: transparent; color: inherit;
|
|
25
|
+
font: inherit; cursor: pointer; }
|
|
26
|
+
.twextsec-warning-close:hover { background: #ffffff1a; }
|
|
27
|
+
.twextsec-warning-close:focus-visible { outline: 3px solid #ffd166; outline-offset: 2px; }
|
|
7
28
|
.twextsec-rows { margin: 10px 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
|
|
8
29
|
.twextsec-row { padding: 8px 10px; border: 1px solid var(--ui-black-transparent, #0000001a); border-radius: 8px;
|
|
9
30
|
display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 10px; }
|
|
10
31
|
/* The icon sits in its own column beside everything else the row says. */
|
|
11
32
|
.twextsec-row > * { grid-column: 2; }
|
|
12
33
|
.twextsec-row > .twextsec-preview, .twextsec-row > .twextsec-preview-pick { grid-column: 1; grid-row: 1 / span 20; }
|
|
34
|
+
/* Reserve room for the host's larger checkbox before the icon, keeping the name's label intact. */
|
|
35
|
+
.twextsec-row[data-picking="true"] { position: relative; grid-template-columns: 82px minmax(0, 1fr); }
|
|
36
|
+
.twextsec-row[data-picking="true"] > .twextsec-preview-pick { margin-left: 42px; }
|
|
37
|
+
.twextsec-row[data-picking="true"] > .twextsec-head { min-height: 44px; align-items: center; }
|
|
38
|
+
.twextsec-row[data-picking="true"] .twextsec-pick input[type="checkbox"] {
|
|
39
|
+
position: absolute; left: 10px; top: 30px; transform: translateY(-50%); }
|
|
13
40
|
.twextsec-preview-pick { display: block; cursor: pointer; }
|
|
14
41
|
.twextsec-row[data-failed="true"] { border-color: var(--ui-danger, #b91c1c); }
|
|
15
42
|
.twextsec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
|
|
@@ -21,10 +48,14 @@
|
|
|
21
48
|
.twextsec-source { margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
22
49
|
.twextsec-digest { margin: 2px 0 0; }
|
|
23
50
|
.twextsec-about, .twextsec-claim { margin: 2px 0 0; font-size: .9em; }
|
|
51
|
+
.twextsec-about { white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
52
|
+
.twextsec-claim { overflow-wrap: anywhere; }
|
|
53
|
+
.twextsec-contact { margin-left: .5em; }
|
|
24
54
|
.twextsec-claim { font-size: .8em; }
|
|
25
55
|
.twextsec-status { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 4px 0 0; font-size: .9em; }
|
|
26
56
|
.twextsec-claim, .twextsec-requirement { opacity: .8; }
|
|
27
57
|
.twextsec-trusted { width: 22px; height: 22px; align-self: center; flex: none; }
|
|
58
|
+
.twextsec-trusted-link { display: inline-flex; align-self: center; flex: none; }
|
|
28
59
|
.twextsec-status:empty { display: none; }
|
|
29
60
|
.twextsec-failed, .twextsec-contradiction { margin: 6px 0 0; color: var(--ui-danger, #b91c1c); }
|
|
30
61
|
.twextsec-failed p { margin: 0; }
|
|
@@ -34,12 +65,17 @@
|
|
|
34
65
|
.twextsec-choice { margin: 0; padding: 6px 10px; border: 1px solid var(--ui-black-transparent, #0000001a); border-radius: 6px; }
|
|
35
66
|
.twextsec-choice legend { padding: 0 4px; font-size: .85em; opacity: .8; }
|
|
36
67
|
.twextsec-choice label { display: inline-flex; align-items: center; gap: 4px; margin-right: 14px; }
|
|
68
|
+
.twextsec-choice-label { display: inline-flex; align-items: baseline; gap: .25em; }
|
|
69
|
+
.twextsec-choice-icon { flex: none; }
|
|
37
70
|
.twextsec-choices { display: flex; flex-wrap: wrap; gap: 2px 18px; margin: 2px 0 0; }
|
|
38
71
|
.twextsec-choices:empty { display: none; }
|
|
39
72
|
.twextsec-choices .twextsec-choice { padding: 0; border: 0; font-size: .9em; }
|
|
40
73
|
.twextsec-choices .twextsec-choice legend { float: left; padding: 0; margin-right: 8px; }
|
|
41
74
|
.twextsec-choices .twextsec-choice label { margin-right: 10px; }
|
|
42
75
|
.twextsec-actions { display: flex; justify-content: flex-end; gap: 12px; margin: 0; padding: 0; }
|
|
76
|
+
.twextsec-review[data-mode="add"] > .twextsec-actions { grid-area: 2 / 1; padding: 12px 0 env(safe-area-inset-bottom, 0px);
|
|
77
|
+
border-top: 1px solid var(--ui-black-transparent, #0000001a); background: var(--ui-modal-background, #fff); }
|
|
78
|
+
.twextsec-review[data-mode="add"] > .twextsec-actions button { min-height: 44px; }
|
|
43
79
|
.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; }
|
|
44
80
|
.twextsec-actions button[data-testid="twextsec-complete"] { background: var(--looks-secondary, #1d4ed8); color: #fff; border-color: transparent; }
|
|
45
81
|
.twextsec-actions button:focus-visible { outline: 3px solid var(--link-color, #7352d6); outline-offset: 2px; }
|
package/webpack4.css
CHANGED
|
@@ -1,15 +1,42 @@
|
|
|
1
1
|
:global(.twextsec-review) { box-sizing: border-box; color: var(--ui-modal-foreground, #263145); font: inherit; }
|
|
2
|
+
/* Only the catalog content scrolls; its actions keep their place in the host's available height. */
|
|
3
|
+
:global(.twextsec-review)[data-mode="add"] { position: relative; display: grid;
|
|
4
|
+
grid-template-rows: minmax(0, 1fr) auto; height: 100%; min-height: 0; }
|
|
5
|
+
:global(.twextsec-scroll) { grid-area: 1 / 1; min-height: 0; overflow: auto; overscroll-behavior: contain;
|
|
6
|
+
scrollbar-gutter: stable; padding-right: 4px; }
|
|
2
7
|
:global(.twextsec-review) *, :global(.twextsec-review) *::before, :global(.twextsec-review) *::after { box-sizing: inherit; }
|
|
8
|
+
:global(.twextsec-review) a { color: inherit; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
|
|
9
|
+
:global(.twextsec-review) a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 2px; }
|
|
3
10
|
:global(.twextsec-intro) { margin: 0 0 12px; }
|
|
4
11
|
: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
12
|
:global(.twextsec-note) { flex: 1 1 100%; margin: 0; font-size: .9em; opacity: .8; }
|
|
6
|
-
|
|
13
|
+
/* Keep the notice outside the list's flow and pair its colors across host themes. */
|
|
14
|
+
:global(.twextsec-warning) { position: fixed; z-index: 1000; left: 16px; right: 16px;
|
|
15
|
+
bottom: calc(16px + env(safe-area-inset-bottom, 0px)); max-width: 760px; margin: 0 auto;
|
|
16
|
+
display: flex; align-items: flex-start; gap: 16px; padding: 14px 16px;
|
|
17
|
+
max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto;
|
|
18
|
+
border: 1px solid #90a4bf; border-radius: 8px; background: #243247; color: #fff;
|
|
19
|
+
box-shadow: 0 4px 20px #0006; font-size: 14px; line-height: 1.5; }
|
|
20
|
+
:global(.twextsec-review)[data-mode="add"] > :global(.twextsec-warning) { position: absolute; grid-area: 1 / 1 / 2 / 2;
|
|
21
|
+
bottom: 12px; max-height: calc(100% - 24px); }
|
|
22
|
+
:global(.twextsec-warning) > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
|
|
23
|
+
:global(.twextsec-warning-close) { flex: none; min-width: 64px; min-height: 44px; padding: 8px 12px;
|
|
24
|
+
border: 1px solid currentColor; border-radius: 6px; background: transparent; color: inherit;
|
|
25
|
+
font: inherit; cursor: pointer; }
|
|
26
|
+
:global(.twextsec-warning-close):hover { background: #ffffff1a; }
|
|
27
|
+
:global(.twextsec-warning-close):focus-visible { outline: 3px solid #ffd166; outline-offset: 2px; }
|
|
7
28
|
:global(.twextsec-rows) { margin: 10px 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
|
|
8
29
|
:global(.twextsec-row) { padding: 8px 10px; border: 1px solid var(--ui-black-transparent, #0000001a); border-radius: 8px;
|
|
9
30
|
display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 10px; }
|
|
10
31
|
/* The icon sits in its own column beside everything else the row says. */
|
|
11
32
|
:global(.twextsec-row) > * { grid-column: 2; }
|
|
12
33
|
:global(.twextsec-row) > :global(.twextsec-preview), :global(.twextsec-row) > :global(.twextsec-preview-pick) { grid-column: 1; grid-row: 1 / span 20; }
|
|
34
|
+
/* Reserve room for the host's larger checkbox before the icon, keeping the name's label intact. */
|
|
35
|
+
:global(.twextsec-row)[data-picking="true"] { position: relative; grid-template-columns: 82px minmax(0, 1fr); }
|
|
36
|
+
:global(.twextsec-row)[data-picking="true"] > :global(.twextsec-preview-pick) { margin-left: 42px; }
|
|
37
|
+
:global(.twextsec-row)[data-picking="true"] > :global(.twextsec-head) { min-height: 44px; align-items: center; }
|
|
38
|
+
:global(.twextsec-row)[data-picking="true"] :global(.twextsec-pick) input[type="checkbox"] {
|
|
39
|
+
position: absolute; left: 10px; top: 30px; transform: translateY(-50%); }
|
|
13
40
|
:global(.twextsec-preview-pick) { display: block; cursor: pointer; }
|
|
14
41
|
:global(.twextsec-row)[data-failed="true"] { border-color: var(--ui-danger, #b91c1c); }
|
|
15
42
|
:global(.twextsec-head) { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
|
|
@@ -21,10 +48,14 @@
|
|
|
21
48
|
:global(.twextsec-source) { margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
22
49
|
:global(.twextsec-digest) { margin: 2px 0 0; }
|
|
23
50
|
:global(.twextsec-about), :global(.twextsec-claim) { margin: 2px 0 0; font-size: .9em; }
|
|
51
|
+
:global(.twextsec-about) { white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
52
|
+
:global(.twextsec-claim) { overflow-wrap: anywhere; }
|
|
53
|
+
:global(.twextsec-contact) { margin-left: .5em; }
|
|
24
54
|
:global(.twextsec-claim) { font-size: .8em; }
|
|
25
55
|
:global(.twextsec-status) { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 4px 0 0; font-size: .9em; }
|
|
26
56
|
:global(.twextsec-claim), :global(.twextsec-requirement) { opacity: .8; }
|
|
27
57
|
:global(.twextsec-trusted) { width: 22px; height: 22px; align-self: center; flex: none; }
|
|
58
|
+
:global(.twextsec-trusted-link) { display: inline-flex; align-self: center; flex: none; }
|
|
28
59
|
:global(.twextsec-status):empty { display: none; }
|
|
29
60
|
:global(.twextsec-failed), :global(.twextsec-contradiction) { margin: 6px 0 0; color: var(--ui-danger, #b91c1c); }
|
|
30
61
|
:global(.twextsec-failed) p { margin: 0; }
|
|
@@ -34,12 +65,17 @@
|
|
|
34
65
|
:global(.twextsec-choice) { margin: 0; padding: 6px 10px; border: 1px solid var(--ui-black-transparent, #0000001a); border-radius: 6px; }
|
|
35
66
|
:global(.twextsec-choice) legend { padding: 0 4px; font-size: .85em; opacity: .8; }
|
|
36
67
|
:global(.twextsec-choice) label { display: inline-flex; align-items: center; gap: 4px; margin-right: 14px; }
|
|
68
|
+
:global(.twextsec-choice-label) { display: inline-flex; align-items: baseline; gap: .25em; }
|
|
69
|
+
:global(.twextsec-choice-icon) { flex: none; }
|
|
37
70
|
:global(.twextsec-choices) { display: flex; flex-wrap: wrap; gap: 2px 18px; margin: 2px 0 0; }
|
|
38
71
|
:global(.twextsec-choices):empty { display: none; }
|
|
39
72
|
:global(.twextsec-choices) :global(.twextsec-choice) { padding: 0; border: 0; font-size: .9em; }
|
|
40
73
|
:global(.twextsec-choices) :global(.twextsec-choice) legend { float: left; padding: 0; margin-right: 8px; }
|
|
41
74
|
:global(.twextsec-choices) :global(.twextsec-choice) label { margin-right: 10px; }
|
|
42
75
|
:global(.twextsec-actions) { display: flex; justify-content: flex-end; gap: 12px; margin: 0; padding: 0; }
|
|
76
|
+
:global(.twextsec-review)[data-mode="add"] > :global(.twextsec-actions) { grid-area: 2 / 1; padding: 12px 0 env(safe-area-inset-bottom, 0px);
|
|
77
|
+
border-top: 1px solid var(--ui-black-transparent, #0000001a); background: var(--ui-modal-background, #fff); }
|
|
78
|
+
:global(.twextsec-review)[data-mode="add"] > :global(.twextsec-actions) button { min-height: 44px; }
|
|
43
79
|
: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; }
|
|
44
80
|
:global(.twextsec-actions) button[data-testid="twextsec-complete"] { background: var(--looks-secondary, #1d4ed8); color: #fff; border-color: transparent; }
|
|
45
81
|
:global(.twextsec-actions) button:focus-visible { outline: 3px solid var(--link-color, #7352d6); outline-offset: 2px; }
|