@kubohiroya/turbowarp-extension-security-dialog 0.8.9 → 0.9.0

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 CHANGED
@@ -46,7 +46,7 @@ VM は機能拡張を1つずつ読み込み、そのたびに尋ねます。作
46
46
  | import | 中身 |
47
47
  | --- | --- |
48
48
  | `.` | カタログの読み込み、拡張自身の申告の読み取り、依存の閉包、開く人の選択の記憶、取得待ちのダイアログ、文言 |
49
- | `./react` | 画面そのもの `ExtensionReview` |
49
+ | `./react` | 画面そのもの `ExtensionReview` と、一覧の1行 `ExtensionRow` |
50
50
  | `./turbowarp` | VM を包んで問いを先に出す `installBatchExtensionLoader` |
51
51
  | `./styles.css`、`./webpack4.css` | 画面のスタイル。後者は CSS modules 向けにクラス名を `:global()` で包んだもの |
52
52
 
@@ -132,6 +132,29 @@ import '@kubohiroya/turbowarp-extension-security-dialog/styles.css';
132
132
  **記録された答えは、いまも選択肢である場合だけ尊重します。** 作品が `remote-cacheable` から
133
133
  埋め込みに変わった、行が信頼済みになった、といった場合に、もう提示しない答えを持ち込みません。
134
134
 
135
+ ### 一覧の1行だけを使う
136
+
137
+ `ExtensionRow` は、画面の各行と同じ1行を描きます。拡張の名前(チェックボックス付きも可)、ID、信頼済みの印、版とリリースノートへのリンク、画像、概要、製作者と連絡先です。ほかの画面で機能拡張を並べるときにも、拡張が同じ見た目になります。TurboWarp Plus Editor では、ブロックパレットの表示を選ぶ画面が使います。
138
+
139
+ ```tsx
140
+ import {ExtensionRow} from '@kubohiroya/turbowarp-extension-security-dialog/react';
141
+ import '@kubohiroya/turbowarp-extension-security-dialog/styles.css';
142
+
143
+ <ul>
144
+ <ExtensionRow
145
+ metadata={{name: 'Pen Plus', author: 'Creator', version: '2.0.0'}}
146
+ ids={['penplus']}
147
+ locale="ja"
148
+ pick={{checked: shown, onToggle: () => setShown(!shown)}} // 省くとチェックボックスなし
149
+ itemProps={{'data-key': 'penplus'}}
150
+ >
151
+ {/* 製作者の下に、ホスト自身の内容を置く */}
152
+ </ExtensionRow>
153
+ </ul>
154
+ ```
155
+
156
+ `details` は見出しと画像のあいだに置く内容で、確認画面は読み込み元とダイジェストをここに出します。`children` は製作者の下に置く内容で、確認画面は実行方法と読み込み元の選択をここに出します。行は `<li>` なので、`<ul>` か `<ol>` の中に置きます。`pick.disabled` のときは、チェックボックスも画像も選択を変えません。
157
+
135
158
  ### 読み込みに失敗したとき
136
159
 
137
160
  ```tsx
package/README.md CHANGED
@@ -44,7 +44,7 @@ revisions, bundle integrity, image hashes and interaction checks, and the
44
44
  | Import | What it is |
45
45
  | --- | --- |
46
46
  | `.` | Reading a catalog, reading an extension's own description, closing a selection over its dependencies, remembering what the opener chose, the wait dialog, wording |
47
- | `./react` | `ExtensionReview`, the screen |
47
+ | `./react` | `ExtensionReview`, the screen, and `ExtensionRow`, one row of its list |
48
48
  | `./turbowarp` | `installBatchExtensionLoader`, which wraps a VM so the question comes first |
49
49
  | `./styles.css`, `./webpack4.css` | The screen's styles; the second has class names wrapped in `:global()` for a CSS-modules build |
50
50
 
@@ -123,6 +123,29 @@ GitHub versions link to their release notes. The description preserves line brea
123
123
  HTTP(S) URLs and email addresses into links. The creator's contact appears next to their name
124
124
  when supplied.
125
125
 
126
+ ### Using one row of the list
127
+
128
+ `ExtensionRow` draws the same row the screen draws for each extension: its name (with a checkbox, if it can be chosen), IDs, trusted mark, version with a link to its release notes, picture, description, and creator with contact. Another screen that lists extensions shows them the same way. In TurboWarp Plus Editor, the screen that chooses which block palette groups to show uses it.
129
+
130
+ ```tsx
131
+ import {ExtensionRow} from '@kubohiroya/turbowarp-extension-security-dialog/react';
132
+ import '@kubohiroya/turbowarp-extension-security-dialog/styles.css';
133
+
134
+ <ul>
135
+ <ExtensionRow
136
+ metadata={{name: 'Pen Plus', author: 'Creator', version: '2.0.0'}}
137
+ ids={['penplus']}
138
+ locale="en"
139
+ pick={{checked: shown, onToggle: () => setShown(!shown)}} // leave out for no checkbox
140
+ itemProps={{'data-key': 'penplus'}}
141
+ >
142
+ {/* the host's own content, after the creator */}
143
+ </ExtensionRow>
144
+ </ul>
145
+ ```
146
+
147
+ `details` goes between the heading and the picture; the review screen puts the source and digest there. `children` goes after the creator; the review screen puts its execution and loading choices there. The row is an `<li>`, so put it in a `<ul>` or `<ol>`. When `pick.disabled` is set, neither the checkbox nor the picture changes the choice.
148
+
126
149
  ### When loading fails
127
150
 
128
151
  ```tsx
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubohiroya/turbowarp-extension-security-dialog",
3
- "version": "0.8.9",
4
- "revision": "1fd624a83b400d2937c2985c6474684dcc046cc1",
3
+ "version": "0.9.0",
4
+ "revision": "3b5531912d7999a85c96f2cfcfdc9d3fb2e222fb",
5
5
  "sourceState": "commit"
6
6
  }
@@ -0,0 +1,37 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ExtensionMetadata } from './review-types.js';
3
+ import type { PreviewCache } from './storage.js';
4
+ import React from 'react';
5
+ export interface ExtensionRowPick {
6
+ /** Whether the row is chosen. */
7
+ checked: boolean;
8
+ /** A choice the person cannot change here, such as an extension another one needs. */
9
+ disabled?: boolean;
10
+ onToggle(): void;
11
+ }
12
+ export interface ExtensionRowProps {
13
+ /** What the extension says about itself: name, description, creator, version and links. */
14
+ metadata: ExtensionMetadata;
15
+ /** The extension IDs; shown beside the name, or as the name when the extension has none. */
16
+ ids?: readonly string[];
17
+ locale?: string;
18
+ /** Marks the row as trusted by the host. */
19
+ trusted?: boolean;
20
+ /** Given, the row has a checkbox, and its picture chooses the same way. */
21
+ pick?: ExtensionRowPick;
22
+ /** Where pictures are kept between visits; null keeps nothing. */
23
+ previewCache?: PreviewCache | null;
24
+ /** Extra attributes for the list item, such as `data-key`. */
25
+ itemProps?: Record<string, string | undefined>;
26
+ /** Shown between the heading and the picture, such as where the extension loads from. */
27
+ details?: ReactNode;
28
+ /** Shown after the creator, such as the host's own choices for this extension. */
29
+ children?: ReactNode;
30
+ }
31
+ /**
32
+ * One extension in a list: a heading with its name (and checkbox, when it can be chosen), its
33
+ * picture, what it says it does and who made it. The review screen and any other list of
34
+ * extensions draw the same row, so an extension looks the same wherever it is offered.
35
+ */
36
+ export declare const ExtensionRow: ({ metadata, ids, locale, trusted, pick, previewCache, itemProps, details, children }: ExtensionRowProps) => React.JSX.Element;
37
+ export default ExtensionRow;
package/dist/react.cjs CHANGED
@@ -49,12 +49,13 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
49
49
  var react_exports = {};
50
50
  __export(react_exports, {
51
51
  ExtensionReview: () => ExtensionReview2,
52
+ ExtensionRow: () => ExtensionRow,
52
53
  default: () => react_default
53
54
  });
54
55
  module.exports = __toCommonJS(react_exports);
55
56
 
56
57
  // src/review.tsx
57
- var import_react3 = __toESM(require("react"), 1);
58
+ var import_react4 = __toESM(require("react"), 1);
58
59
 
59
60
  // src/messages.ts
60
61
  var messages = {
@@ -6549,6 +6550,9 @@ function createPreviewCache() {
6549
6550
  });
6550
6551
  }
6551
6552
 
6553
+ // src/extension-row.tsx
6554
+ var import_react3 = __toESM(require("react"), 1);
6555
+
6552
6556
  // src/preview.tsx
6553
6557
  var import_react = __toESM(require("react"), 1);
6554
6558
  var ExtensionPreview = class extends import_react.default.PureComponent {
@@ -6671,6 +6675,98 @@ var LinkedText = ({ text }) => {
6671
6675
  return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, parts);
6672
6676
  };
6673
6677
 
6678
+ // src/extension-row.tsx
6679
+ var fallbackBanner = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMDAiIGhlaWdodD0iMzAwIiB2aWV3Qm94PSIwIDAgMzAwIDMwMCIgcm9sZT0iaW1nIiBhcmlhLWxhYmVsPSJUdXJib1dhcnAtUGx1cyBleHRlbnNpb24iPjx0aXRsZT5UdXJib1dhcnAtUGx1cyBleHR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jE5NiIgcj0iNTgiIGZpbGw9IiMxNmEzNGEiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSIxMiIvPgogIDxwYXRoIGQ9Ik0xNjggMTk4bDIwIDIwIDM4LTQyIiBmaWxsPSJub25lIiBzdHJva2U9IiNmZmYiIHN0cm9rZS13aWR0aD0iMTgiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K";
6681
+ var ExtensionRow = ({
6682
+ metadata,
6683
+ ids = [],
6684
+ locale,
6685
+ trusted = false,
6686
+ pick,
6687
+ previewCache,
6688
+ itemProps,
6689
+ details,
6690
+ children
6691
+ }) => {
6692
+ var _a;
6693
+ const t = (key) => formatMessage(locale, key);
6694
+ const declaredName = (_a = metadata.name) == null ? void 0 : _a.trim();
6695
+ const idText = ids.join(", ");
6696
+ const name = declaredName || idText || t("extensionUnknown");
6697
+ const website = displayURL(metadata.docsURL);
6698
+ const release = releaseURL(metadata);
6699
+ const badge = /* @__PURE__ */ import_react3.default.createElement(
6700
+ "img",
6701
+ {
6702
+ className: "twextsec-trusted",
6703
+ src: trustedBadge,
6704
+ alt: t("trusted"),
6705
+ title: t("trusted")
6706
+ }
6707
+ );
6708
+ const preview = /* @__PURE__ */ import_react3.default.createElement(
6709
+ ExtensionPreview,
6710
+ {
6711
+ url: metadata.banner || fallbackBanner,
6712
+ fallback: !metadata.banner,
6713
+ name,
6714
+ cache: previewCache,
6715
+ locale
6716
+ }
6717
+ );
6718
+ return /* @__PURE__ */ import_react3.default.createElement(
6719
+ "li",
6720
+ __spreadValues({
6721
+ className: "twextsec-row",
6722
+ "data-picking": pick ? "true" : void 0
6723
+ }, itemProps),
6724
+ /* @__PURE__ */ import_react3.default.createElement("div", { className: "twextsec-head" }, pick ? /* @__PURE__ */ import_react3.default.createElement("label", { className: "twextsec-pick" }, /* @__PURE__ */ import_react3.default.createElement(
6725
+ "input",
6726
+ {
6727
+ type: "checkbox",
6728
+ checked: pick.checked,
6729
+ disabled: pick.disabled,
6730
+ onChange: pick.onToggle
6731
+ }
6732
+ ), /* @__PURE__ */ import_react3.default.createElement("strong", null, name)) : /* @__PURE__ */ import_react3.default.createElement("strong", null, name), declaredName && idText && /* @__PURE__ */ import_react3.default.createElement("span", { className: "twextsec-id" }, idText), trusted && (website ? /* @__PURE__ */ import_react3.default.createElement(
6733
+ "a",
6734
+ {
6735
+ className: "twextsec-trusted-link",
6736
+ href: website,
6737
+ target: "_blank",
6738
+ rel: "noopener noreferrer",
6739
+ "aria-label": `${t("extensionPage")}: ${name}`
6740
+ },
6741
+ badge
6742
+ ) : badge), metadata.version && (release ? /* @__PURE__ */ import_react3.default.createElement(
6743
+ "a",
6744
+ {
6745
+ href: release,
6746
+ target: "_blank",
6747
+ rel: "noopener noreferrer",
6748
+ title: t("releaseNotes")
6749
+ },
6750
+ t("version"),
6751
+ " ",
6752
+ metadata.version
6753
+ ) : /* @__PURE__ */ import_react3.default.createElement("span", null, t("version"), " ", metadata.version))),
6754
+ details,
6755
+ pick ? /* @__PURE__ */ import_react3.default.createElement(
6756
+ "span",
6757
+ {
6758
+ className: "twextsec-preview-pick",
6759
+ "aria-hidden": "true",
6760
+ onClick: pick.disabled ? void 0 : pick.onToggle
6761
+ },
6762
+ preview
6763
+ ) : preview,
6764
+ /* @__PURE__ */ import_react3.default.createElement("p", { className: "twextsec-about" }, /* @__PURE__ */ import_react3.default.createElement(LinkedText, { text: getExtensionDescription(metadata, locale) })),
6765
+ /* @__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 }))),
6766
+ children
6767
+ );
6768
+ };
6769
+
6674
6770
  // src/decisions.ts
6675
6771
  var isTrusted = (entry) => Boolean(entry && entry.state && entry.state.trusted);
6676
6772
  var allRequireUnsandboxed = (entries) => entries.length > 0 && entries.every(
@@ -6710,8 +6806,6 @@ function initialDecisions(entries, mode, {
6710
6806
  var contradictsDeclaration = (entry, decision) => decision.execution === "sandboxed" && unsandboxedRequirement(entry.metadata || {}) === "required";
6711
6807
 
6712
6808
  // src/review.tsx
6713
- var fallbackBanner = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMDAiIGhlaWdodD0iMzAwIiB2aWV3Qm94PSIwIDAgMzAwIDMwMCIgcm9sZT0iaW1nIiBhcmlhLWxhYmVsPSJUdXJib1dhcnAtUGx1cyBleHRlbnNpb24iPjx0aXRsZT5UdXJib1dhcnAtUGx1cyBleHRlbnNpb248L3RpdGxlPjxwYXRoIGZpbGw9IiMwZmJkOGMiIGQ9Ik0zMyA4MkM1NSA3OCA4NCA3OSAxMDYgODJDMTA2IDY3IDkwIDY5IDkwIDU0QzkwIDMyIDE3NCAzMCAxNzQgNTRDMTc0IDY5IDE1OCA2NiAxNTggODJDMTc1IDg2IDE5NiA4NSAyMTMgODJDMjE3IDk5IDIxNiAxMTUgMjEzIDEzMEMyMzAgMTMwIDIyNyAxMTQgMjQ1IDExNEMyNzEgMTE0IDI2OSAyMDYgMjQ1IDIwNkMyMjcgMjA2IDIzMCAxOTAgMjEzIDE5MEMyMDkgMjEwIDIxMCAyNDAgMjEzIDI2MkMyMDMgMjY1IDE4OCAyNjYgMTc0IDI2MkMxNzQgMjQ4IDE4OCAyNTAgMTg4IDIzNkMxODggMjE2IDExMiAyMTQgMTEyIDIzNkMxMTIgMjUwIDEyNiAyNDcgMTI2IDI2MkMxMDggMjU4IDYwIDI1OSAzMyAyNjJDMjkgMjQ1IDMwIDIyNSAzMyAyMDlDNDkgMjA5IDQ2IDIyNSA2MiAyMjVDODYgMjI1IDg0IDEzNyA2MiAxMzd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9Ik0xNCAxNDBBMTE0IDExNCAwIDAgMSAxMjggMjYiIHN0cm9rZS13aWR0aD0iMTciLz4KICAgIDxwYXRoIGQ9Ik00OCAxNDBhODAgODAgMCAwIDEgODAtODAiIHN0cm9rZS13aWR0aD0iMTMiIG9wYWNpdHk9Ii42Ii8+CiAgICA8cGF0aCBkPSJNODIgMTQwYTQ2IDQ2IDAgMCAxIDQ2LTQ2IiBzdHJva2Utd2lkdGg9IjkiIG9wYWNpdHk9Ii40Ii8+CiAgPC9nPgoKICA8cGF0aCBkPSJNMTI4IDEwMHY4ME04OCAxNDBoODAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSIyNiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+CgogIDxjaXJjbGUgY3g9IjE5NiIgY3k9IjE5NiIgcj0iNTgiIGZpbGw9IiMxNmEzNGEiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSIxMiIvPgogIDxwYXRoIGQ9Ik0xNjggMTk4bDIwIDIwIDM4LTQyIiBmaWxsPSJub25lIiBzdHJva2U9IiNmZmYiIHN0cm9rZS13aWR0aD0iMTgiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K";
6715
6809
  var isEmbedded = (source) => source.kind === "embedded-file" || source.kind === "embedded-data";
6716
6810
  var sourceLabel = (entry, t) => {
6717
6811
  if (entry.source.kind === "embedded-file") return t("sourceEmbedded");
@@ -6723,15 +6817,15 @@ var sourceLabel = (entry, t) => {
6723
6817
  };
6724
6818
  var Failure = ({ failure, onRetry, t }) => {
6725
6819
  const retry = failure.retryable === true && typeof onRetry === "function";
6726
- return /* @__PURE__ */ import_react3.default.createElement(
6820
+ return /* @__PURE__ */ import_react4.default.createElement(
6727
6821
  "div",
6728
6822
  {
6729
6823
  className: "twextsec-failed",
6730
6824
  role: "alert"
6731
6825
  },
6732
- /* @__PURE__ */ import_react3.default.createElement("p", null, t("failed"), ": ", failure.code && `${failure.code} `, failure.message),
6733
- retry && /* @__PURE__ */ import_react3.default.createElement("p", { className: "twextsec-retry-note" }, t("retryNote")),
6734
- retry && /* @__PURE__ */ import_react3.default.createElement(
6826
+ /* @__PURE__ */ import_react4.default.createElement("p", null, t("failed"), ": ", failure.code && `${failure.code} `, failure.message),
6827
+ retry && /* @__PURE__ */ import_react4.default.createElement("p", { className: "twextsec-retry-note" }, t("retryNote")),
6828
+ retry && /* @__PURE__ */ import_react4.default.createElement(
6735
6829
  "button",
6736
6830
  {
6737
6831
  type: "button",
@@ -6751,15 +6845,15 @@ var choiceIcons = {
6751
6845
  "embedded-file": "\u{1F961}",
6752
6846
  "embedded-data": "\u{1F4E6}"
6753
6847
  };
6754
- 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}`)));
6848
+ var ChoiceLabel = ({ kind, option, t }) => /* @__PURE__ */ import_react4.default.createElement("span", { className: "twextsec-choice-label" }, choiceIcons[option] && /* @__PURE__ */ import_react4.default.createElement("span", { className: "twextsec-choice-icon", "aria-hidden": "true" }, choiceIcons[option]), /* @__PURE__ */ import_react4.default.createElement("span", null, t(`${kind}-${option}`)));
6755
6849
  var UnsandboxedWarning = ({ t }) => {
6756
- const [dismissed, setDismissed] = import_react3.default.useState(false);
6757
- const returnFocus = import_react3.default.useRef(null);
6758
- import_react3.default.useEffect(() => {
6850
+ const [dismissed, setDismissed] = import_react4.default.useState(false);
6851
+ const returnFocus = import_react4.default.useRef(null);
6852
+ import_react4.default.useEffect(() => {
6759
6853
  returnFocus.current = document.activeElement;
6760
6854
  }, []);
6761
6855
  if (dismissed) return null;
6762
- 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(
6856
+ return /* @__PURE__ */ import_react4.default.createElement("aside", { className: "twextsec-warning" }, /* @__PURE__ */ import_react4.default.createElement("span", { role: "status" }, t("unsandboxedWarning")), /* @__PURE__ */ import_react4.default.createElement(
6763
6857
  "button",
6764
6858
  {
6765
6859
  type: "button",
@@ -6774,7 +6868,7 @@ var UnsandboxedWarning = ({ t }) => {
6774
6868
  t("closeWarning")
6775
6869
  ));
6776
6870
  };
6777
- 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(
6871
+ var Choices = ({ name, value, options, disabled, label, onChange, t }) => /* @__PURE__ */ import_react4.default.createElement("fieldset", { className: "twextsec-choice" }, /* @__PURE__ */ import_react4.default.createElement("legend", null, label), options.map((option) => /* @__PURE__ */ import_react4.default.createElement("label", { key: option }, /* @__PURE__ */ import_react4.default.createElement(
6778
6872
  "input",
6779
6873
  {
6780
6874
  type: "radio",
@@ -6784,8 +6878,8 @@ var Choices = ({ name, value, options, disabled, label, onChange, t }) => /* @__
6784
6878
  disabled,
6785
6879
  onChange: () => onChange(option)
6786
6880
  }
6787
- ), /* @__PURE__ */ import_react3.default.createElement(ChoiceLabel, { kind: name.startsWith("loading") ? "loading" : "execution", option, t }))));
6788
- var ExtensionReview = class extends import_react3.default.PureComponent {
6881
+ ), /* @__PURE__ */ import_react4.default.createElement(ChoiceLabel, { kind: name.startsWith("loading") ? "loading" : "execution", option, t }))));
6882
+ var ExtensionReview = class extends import_react4.default.PureComponent {
6789
6883
  constructor(props) {
6790
6884
  super(props);
6791
6885
  __publicField(this, "controller");
@@ -6910,102 +7004,42 @@ var ExtensionReview = class extends import_react3.default.PureComponent {
6910
7004
  });
6911
7005
  }
6912
7006
  renderRow(entry, selection) {
6913
- var _a;
6914
7007
  const { mode } = this.props;
6915
7008
  const t = this.t.bind(this);
6916
7009
  const decision = this.state.decisions.get(entry.key);
6917
7010
  const metadata = this.metadataOf(entry);
6918
- const declaredName = (_a = metadata.name) == null ? void 0 : _a.trim();
6919
- const ids = entry.ids.join(", ");
6920
- const name = declaredName || ids || t("extensionUnknown");
6921
- const website = displayURL(metadata.docsURL);
6922
- const release = releaseURL(metadata);
6923
7011
  const executions = this.executionOptions(entry);
6924
7012
  const loadings = loadingChoices(entry);
6925
7013
  const state = mode === "add" ? selection.stateOf(entry.key) : null;
6926
7014
  const required = state === "dependency";
6927
7015
  const roots = required ? [...selection.requiredBy.get(entry.key) || []] : [];
6928
7016
  const failure = entry.state && entry.state.error;
6929
- const badge = /* @__PURE__ */ import_react3.default.createElement(
6930
- "img",
6931
- {
6932
- className: "twextsec-trusted",
6933
- src: trustedBadge,
6934
- alt: t("trusted"),
6935
- title: t("trusted")
6936
- }
6937
- );
6938
- const preview = /* @__PURE__ */ import_react3.default.createElement(
6939
- ExtensionPreview,
6940
- {
6941
- url: metadata.banner || fallbackBanner,
6942
- fallback: !metadata.banner,
6943
- name,
6944
- cache: this.props.previewCache,
6945
- locale: this.props.locale
6946
- }
6947
- );
6948
- return /* @__PURE__ */ import_react3.default.createElement(
6949
- "li",
7017
+ return /* @__PURE__ */ import_react4.default.createElement(
7018
+ ExtensionRow,
6950
7019
  {
6951
7020
  key: entry.key,
6952
- className: "twextsec-row",
6953
- "data-key": entry.key,
6954
- "data-picking": mode === "add" ? "true" : void 0,
6955
- "data-failed": failure ? "true" : void 0
6956
- },
6957
- /* @__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(
6958
- "input",
6959
- {
6960
- type: "checkbox",
7021
+ metadata,
7022
+ ids: entry.ids,
7023
+ locale: this.props.locale,
7024
+ trusted: isTrusted(entry),
7025
+ previewCache: this.props.previewCache,
7026
+ itemProps: { "data-key": entry.key, "data-failed": failure ? "true" : void 0 },
7027
+ pick: mode === "add" ? {
6961
7028
  checked: selection.selected.has(entry.key),
6962
7029
  disabled: required || state === "loaded",
6963
- onChange: () => this.toggle(entry.key)
6964
- }
6965
- ), /* @__PURE__ */ import_react3.default.createElement("strong", null, name)), mode === "open" && /* @__PURE__ */ import_react3.default.createElement("strong", null, name), declaredName && ids && /* @__PURE__ */ import_react3.default.createElement("span", { className: "twextsec-id" }, ids), isTrusted(entry) && (website ? /* @__PURE__ */ import_react3.default.createElement(
6966
- "a",
6967
- {
6968
- className: "twextsec-trusted-link",
6969
- href: website,
6970
- target: "_blank",
6971
- rel: "noopener noreferrer",
6972
- "aria-label": `${t("extensionPage")}: ${name}`
6973
- },
6974
- badge
6975
- ) : badge), metadata.version && (release ? /* @__PURE__ */ import_react3.default.createElement(
6976
- "a",
6977
- {
6978
- href: release,
6979
- target: "_blank",
6980
- rel: "noopener noreferrer",
6981
- title: t("releaseNotes")
6982
- },
6983
- t("version"),
6984
- " ",
6985
- metadata.version
6986
- ) : /* @__PURE__ */ import_react3.default.createElement("span", null, t("version"), " ", metadata.version))),
6987
- /* @__PURE__ */ import_react3.default.createElement(
6988
- "p",
6989
- {
6990
- className: "twextsec-source",
6991
- title: sourceLabel(entry, t)
6992
- },
6993
- sourceLabel(entry, t)
6994
- ),
6995
- "sha256" in entry.source && entry.source.sha256 && /* @__PURE__ */ import_react3.default.createElement("p", { className: "twextsec-digest" }, t("digest"), " ", entry.source.sha256),
6996
- mode === "add" ? /* @__PURE__ */ import_react3.default.createElement(
6997
- "span",
6998
- {
6999
- className: "twextsec-preview-pick",
7000
- "aria-hidden": "true",
7001
- onClick: required || state === "loaded" ? void 0 : () => this.toggle(entry.key)
7002
- },
7003
- preview
7004
- ) : preview,
7005
- /* @__PURE__ */ import_react3.default.createElement("p", { className: "twextsec-about" }, /* @__PURE__ */ import_react3.default.createElement(LinkedText, { text: getExtensionDescription(metadata, this.props.locale) })),
7006
- /* @__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 }))),
7007
- /* @__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"))),
7008
- failure && /* @__PURE__ */ import_react3.default.createElement(
7030
+ onToggle: () => this.toggle(entry.key)
7031
+ } : void 0,
7032
+ details: /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, /* @__PURE__ */ import_react4.default.createElement(
7033
+ "p",
7034
+ {
7035
+ className: "twextsec-source",
7036
+ title: sourceLabel(entry, t)
7037
+ },
7038
+ sourceLabel(entry, t)
7039
+ ), "sha256" in entry.source && entry.source.sha256 && /* @__PURE__ */ import_react4.default.createElement("p", { className: "twextsec-digest" }, t("digest"), " ", entry.source.sha256))
7040
+ },
7041
+ /* @__PURE__ */ import_react4.default.createElement("div", { className: "twextsec-status" }, (required || state === "loaded") && /* @__PURE__ */ import_react4.default.createElement("span", { className: "twextsec-state" }, required ? t("state-dependency", { names: roots.join(", ") }) : t("state-loaded")), unsandboxedRequirement(metadata) === "required" && /* @__PURE__ */ import_react4.default.createElement("span", { className: "twextsec-requirement" }, t("requirement-required"))),
7042
+ failure && /* @__PURE__ */ import_react4.default.createElement(
7009
7043
  Failure,
7010
7044
  {
7011
7045
  failure,
@@ -7013,7 +7047,7 @@ var ExtensionReview = class extends import_react3.default.PureComponent {
7013
7047
  t
7014
7048
  }
7015
7049
  ),
7016
- /* @__PURE__ */ import_react3.default.createElement("div", { className: "twextsec-choices" }, !isTrusted(entry) && /* @__PURE__ */ import_react3.default.createElement(
7050
+ /* @__PURE__ */ import_react4.default.createElement("div", { className: "twextsec-choices" }, !isTrusted(entry) && /* @__PURE__ */ import_react4.default.createElement(
7017
7051
  Choices,
7018
7052
  {
7019
7053
  name: `execution-${entry.key}`,
@@ -7023,7 +7057,7 @@ var ExtensionReview = class extends import_react3.default.PureComponent {
7023
7057
  onChange: (execution) => this.decide(entry.key, { execution }),
7024
7058
  t
7025
7059
  }
7026
- ), loadings.length > 0 && /* @__PURE__ */ import_react3.default.createElement(
7060
+ ), loadings.length > 0 && /* @__PURE__ */ import_react4.default.createElement(
7027
7061
  Choices,
7028
7062
  {
7029
7063
  name: `loading-${entry.key}`,
@@ -7034,8 +7068,8 @@ var ExtensionReview = class extends import_react3.default.PureComponent {
7034
7068
  t
7035
7069
  }
7036
7070
  )),
7037
- 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 })),
7038
- contradictsDeclaration(entry, decision) && /* @__PURE__ */ import_react3.default.createElement(
7071
+ loadings.length === 0 && decision.loading !== void 0 && /* @__PURE__ */ import_react4.default.createElement("p", { className: "twextsec-loading-fixed" }, /* @__PURE__ */ import_react4.default.createElement(ChoiceLabel, { kind: "loading", option: decision.loading, t })),
7072
+ contradictsDeclaration(entry, decision) && /* @__PURE__ */ import_react4.default.createElement(
7039
7073
  "p",
7040
7074
  {
7041
7075
  className: "twextsec-contradiction",
@@ -7057,14 +7091,14 @@ var ExtensionReview = class extends import_react3.default.PureComponent {
7057
7091
  const bulkExecution = rowExecutions.every((execution) => execution === rowExecutions[0]) ? rowExecutions[0] : void 0;
7058
7092
  const anyUnsandboxed = [...this.included()].some((key) => this.state.decisions.get(key).execution === "unsandboxed");
7059
7093
  const bulkLoadings = loadingModes.filter((mode2) => entries.some((entry) => loadingChoices(entry).includes(mode2)));
7060
- 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(
7094
+ const content = /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, /* @__PURE__ */ import_react4.default.createElement("p", { className: "twextsec-intro" }, t(mode === "add" ? "addIntro" : allRequired ? "allRequiredIntro" : "openIntro")), failure && /* @__PURE__ */ import_react4.default.createElement(
7061
7095
  Failure,
7062
7096
  {
7063
7097
  failure,
7064
7098
  onRetry,
7065
7099
  t
7066
7100
  }
7067
- ), (!allRequired || bulkLoadings.length > 0) && /* @__PURE__ */ import_react3.default.createElement("div", { className: "twextsec-bulk" }, !allRequired && /* @__PURE__ */ import_react3.default.createElement(
7101
+ ), (!allRequired || bulkLoadings.length > 0) && /* @__PURE__ */ import_react4.default.createElement("div", { className: "twextsec-bulk" }, !allRequired && /* @__PURE__ */ import_react4.default.createElement(
7068
7102
  Choices,
7069
7103
  {
7070
7104
  name: "execution-all",
@@ -7074,7 +7108,7 @@ var ExtensionReview = class extends import_react3.default.PureComponent {
7074
7108
  onChange: this.handleBulkExecution,
7075
7109
  t
7076
7110
  }
7077
- ), bulkLoadings.length > 0 && /* @__PURE__ */ import_react3.default.createElement(import_react3.default.Fragment, null, /* @__PURE__ */ import_react3.default.createElement(
7111
+ ), bulkLoadings.length > 0 && /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, /* @__PURE__ */ import_react4.default.createElement(
7078
7112
  Choices,
7079
7113
  {
7080
7114
  name: "loading-all",
@@ -7084,8 +7118,8 @@ var ExtensionReview = class extends import_react3.default.PureComponent {
7084
7118
  onChange: this.handleBulkLoading,
7085
7119
  t
7086
7120
  }
7087
- ), /* @__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))));
7088
- 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(
7121
+ ), /* @__PURE__ */ import_react4.default.createElement("p", { className: "twextsec-note" }, t("loadingNote")))), /* @__PURE__ */ import_react4.default.createElement("ul", { className: "twextsec-rows" }, entries.map((entry) => this.renderRow(entry, selection))));
7122
+ const body = /* @__PURE__ */ import_react4.default.createElement("div", { className: "twextsec-review", "data-mode": mode }, mode === "add" ? /* @__PURE__ */ import_react4.default.createElement("div", { className: "twextsec-scroll" }, content) : content, anyUnsandboxed && /* @__PURE__ */ import_react4.default.createElement(UnsandboxedWarning, { t }), /* @__PURE__ */ import_react4.default.createElement("menu", { className: "twextsec-actions" }, /* @__PURE__ */ import_react4.default.createElement(
7089
7123
  "button",
7090
7124
  {
7091
7125
  type: "button",
@@ -7093,7 +7127,7 @@ var ExtensionReview = class extends import_react3.default.PureComponent {
7093
7127
  onClick: this.handleCancel
7094
7128
  },
7095
7129
  t("cancel")
7096
- ), /* @__PURE__ */ import_react3.default.createElement(
7130
+ ), /* @__PURE__ */ import_react4.default.createElement(
7097
7131
  "button",
7098
7132
  {
7099
7133
  type: "button",
@@ -7103,7 +7137,7 @@ var ExtensionReview = class extends import_react3.default.PureComponent {
7103
7137
  t(mode === "add" ? "add" : "ok")
7104
7138
  )));
7105
7139
  if (mode === "open" && DialogFrame) {
7106
- return /* @__PURE__ */ import_react3.default.createElement(
7140
+ return /* @__PURE__ */ import_react4.default.createElement(
7107
7141
  DialogFrame,
7108
7142
  {
7109
7143
  title: t("openTitle"),
package/dist/react.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  import type { ComponentType } from 'react';
2
+ export { ExtensionRow } from './extension-row.js';
3
+ export type { ExtensionRowPick, ExtensionRowProps } from './extension-row.js';
2
4
  import type { ExtensionMetadata, ReviewDecision, ReviewEntry, ReviewFailure, LoadingMode } from './review-types.js';
3
5
  import type { PreviewCache, ReviewMode } from './index.js';
4
6
  export interface DialogFrameProps {
package/dist/react.mjs CHANGED
@@ -20,7 +20,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
21
21
 
22
22
  // src/review.tsx
23
- import React3 from "react";
23
+ import React4 from "react";
24
24
 
25
25
  // src/messages.ts
26
26
  var messages = {
@@ -6515,6 +6515,9 @@ function createPreviewCache() {
6515
6515
  });
6516
6516
  }
6517
6517
 
6518
+ // src/extension-row.tsx
6519
+ import React3 from "react";
6520
+
6518
6521
  // src/preview.tsx
6519
6522
  import React from "react";
6520
6523
  var ExtensionPreview = class extends React.PureComponent {
@@ -6637,6 +6640,98 @@ var LinkedText = ({ text }) => {
6637
6640
  return /* @__PURE__ */ React2.createElement(React2.Fragment, null, parts);
6638
6641
  };
6639
6642
 
6643
+ // src/extension-row.tsx
6644
+ var fallbackBanner = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMDAiIGhlaWdodD0iMzAwIiB2aWV3Qm94PSIwIDAgMzAwIDMwMCIgcm9sZT0iaW1nIiBhcmlhLWxhYmVsPSJUdXJib1dhcnAtUGx1cyBleHRlbnNpb24iPjx0aXRsZT5UdXJib1dhcnAtUGx1cyBleHRlbnNpb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gcj0iNTgiIGZpbGw9IiMxNmEzNGEiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSIxMiIvPgogIDxwYXRoIGQ9Ik0xNjggMTk4bDIwIDIwIDM4LTQyIiBmaWxsPSJub25lIiBzdHJva2U9IiNmZmYiIHN0cm9rZS13aWR0aD0iMTgiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K";
6646
+ var ExtensionRow = ({
6647
+ metadata,
6648
+ ids = [],
6649
+ locale,
6650
+ trusted = false,
6651
+ pick,
6652
+ previewCache,
6653
+ itemProps,
6654
+ details,
6655
+ children
6656
+ }) => {
6657
+ var _a;
6658
+ const t = (key) => formatMessage(locale, key);
6659
+ const declaredName = (_a = metadata.name) == null ? void 0 : _a.trim();
6660
+ const idText = ids.join(", ");
6661
+ const name = declaredName || idText || t("extensionUnknown");
6662
+ const website = displayURL(metadata.docsURL);
6663
+ const release = releaseURL(metadata);
6664
+ const badge = /* @__PURE__ */ React3.createElement(
6665
+ "img",
6666
+ {
6667
+ className: "twextsec-trusted",
6668
+ src: trustedBadge,
6669
+ alt: t("trusted"),
6670
+ title: t("trusted")
6671
+ }
6672
+ );
6673
+ const preview = /* @__PURE__ */ React3.createElement(
6674
+ ExtensionPreview,
6675
+ {
6676
+ url: metadata.banner || fallbackBanner,
6677
+ fallback: !metadata.banner,
6678
+ name,
6679
+ cache: previewCache,
6680
+ locale
6681
+ }
6682
+ );
6683
+ return /* @__PURE__ */ React3.createElement(
6684
+ "li",
6685
+ __spreadValues({
6686
+ className: "twextsec-row",
6687
+ "data-picking": pick ? "true" : void 0
6688
+ }, itemProps),
6689
+ /* @__PURE__ */ React3.createElement("div", { className: "twextsec-head" }, pick ? /* @__PURE__ */ React3.createElement("label", { className: "twextsec-pick" }, /* @__PURE__ */ React3.createElement(
6690
+ "input",
6691
+ {
6692
+ type: "checkbox",
6693
+ checked: pick.checked,
6694
+ disabled: pick.disabled,
6695
+ onChange: pick.onToggle
6696
+ }
6697
+ ), /* @__PURE__ */ React3.createElement("strong", null, name)) : /* @__PURE__ */ React3.createElement("strong", null, name), declaredName && idText && /* @__PURE__ */ React3.createElement("span", { className: "twextsec-id" }, idText), trusted && (website ? /* @__PURE__ */ React3.createElement(
6698
+ "a",
6699
+ {
6700
+ className: "twextsec-trusted-link",
6701
+ href: website,
6702
+ target: "_blank",
6703
+ rel: "noopener noreferrer",
6704
+ "aria-label": `${t("extensionPage")}: ${name}`
6705
+ },
6706
+ badge
6707
+ ) : badge), metadata.version && (release ? /* @__PURE__ */ React3.createElement(
6708
+ "a",
6709
+ {
6710
+ href: release,
6711
+ target: "_blank",
6712
+ rel: "noopener noreferrer",
6713
+ title: t("releaseNotes")
6714
+ },
6715
+ t("version"),
6716
+ " ",
6717
+ metadata.version
6718
+ ) : /* @__PURE__ */ React3.createElement("span", null, t("version"), " ", metadata.version))),
6719
+ details,
6720
+ pick ? /* @__PURE__ */ React3.createElement(
6721
+ "span",
6722
+ {
6723
+ className: "twextsec-preview-pick",
6724
+ "aria-hidden": "true",
6725
+ onClick: pick.disabled ? void 0 : pick.onToggle
6726
+ },
6727
+ preview
6728
+ ) : preview,
6729
+ /* @__PURE__ */ React3.createElement("p", { className: "twextsec-about" }, /* @__PURE__ */ React3.createElement(LinkedText, { text: getExtensionDescription(metadata, locale) })),
6730
+ /* @__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 }))),
6731
+ children
6732
+ );
6733
+ };
6734
+
6640
6735
  // src/decisions.ts
6641
6736
  var isTrusted = (entry) => Boolean(entry && entry.state && entry.state.trusted);
6642
6737
  var allRequireUnsandboxed = (entries) => entries.length > 0 && entries.every(
@@ -6676,8 +6771,6 @@ function initialDecisions(entries, mode, {
6676
6771
  var contradictsDeclaration = (entry, decision) => decision.execution === "sandboxed" && unsandboxedRequirement(entry.metadata || {}) === "required";
6677
6772
 
6678
6773
  // src/review.tsx
6679
- var fallbackBanner = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMDAiIGhlaWdodD0iMzAwIiB2aWV3Qm94PSIwIDAgMzAwIDMwMCIgcm9sZT0iaW1nIiBhcmlhLWxhYmVsPSJUdXJib1dhcnAtUGx1cyBleHRlbnNpb24iPjx0aXRsZT5UdXJib1dhcnAtUGx1cyBleHRlbnNpb248L3RpdGxlPjxwYXRoIGZpbGw9IiMwZmJkOGMiIGQ9Ik0zMyA4MkM1NSA3OCA4NCA3OSAxMDYgODJDMTA2IDY3IDkwIDY5IDkwIDU0QzkwIDMyIDE3NCAzMCAxNzQgNTRDMTc0IDY5IDE1OCA2NiAxNTggODJDMTc1IDg2IDE5NiA4NSAyMTMgODJDMjE3IDk5IDIxNiAxMTUgMjEzIDEzMEMyMzAgMTMwIDIyNyAxMTQgMjQ1IDExNEMyNzEgMTE0IDI2OSAyMDYgMjQ1IDIwNkMyMjcgMjA2IDIzMCAxOTAgMjEzIDE5MEMyMDkgMjEwIDIxMCAyNDAgMjEzIDI2MkMyMDMgMjY1IDE4OCAyNjYgMTc0IDI2MkMxNzQgMjQ4IDE4OCAyNTAgMTg4IDIzNkMxODggMjE2IDExMiAyMTQgMTEyIDIzNkMxMTIgMjUwIDEyNiAyNDcgMTI2IDI2MkMxMDggMjU4IDYwIDI1OSAzMyAyNjJDMjkgMjQ1IDMwIDIyNSAzMyAyMDlDNDkgMjA5IDQ2IDIyNSA2MiAyMjVDODYgMjI1IDg0IDEzNyA2MiAxMzdDNDYgMTM3IDQ5IDE1MyAzMyAxNTNDMzcgMTMzIDM2IDEwNSAzMyA4MloiLz48cGF0aCBmaWxsPSIjZmZmIi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9Ik00OCAxNDBhODAgODAgMCAwIDEgODAtODAiIHN0cm9rZS13aWR0aD0iMTMiIG9wYWNpdHk9Ii42Ii8+CiAgICA8cGF0aCBkPSJNODIgMTQwYTQ2IDQ2IDAgMCAxIDQ2LTQ2IiBzdHJva2Utd2lkdGg9IjkiIG9wYWNpdHk9Ii40Ii8+CiAgPC9nPgoKICA8cGF0aCBkPSJNMTI4IDEwMHY4ME04OCAxNDBoODAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSIyNiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+CgogIDxjaXJjbGUgY3g9IjE5NiIgY3k9IjE5NiIgcj0iNTgiIGZpbGw9IiMxNmEzNGEiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSIxMiIvPgogIDxwYXRoIGQ9Ik0xNjggMTk4bDIwIDIwIDM4LTQyIiBmaWxsPSJub25lIiBzdHJva2U9IiNmZmYiIHN0cm9rZS13aWR0aD0iMTgiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K";
6681
6774
  var isEmbedded = (source) => source.kind === "embedded-file" || source.kind === "embedded-data";
6682
6775
  var sourceLabel = (entry, t) => {
6683
6776
  if (entry.source.kind === "embedded-file") return t("sourceEmbedded");
@@ -6689,15 +6782,15 @@ var sourceLabel = (entry, t) => {
6689
6782
  };
6690
6783
  var Failure = ({ failure, onRetry, t }) => {
6691
6784
  const retry = failure.retryable === true && typeof onRetry === "function";
6692
- return /* @__PURE__ */ React3.createElement(
6785
+ return /* @__PURE__ */ React4.createElement(
6693
6786
  "div",
6694
6787
  {
6695
6788
  className: "twextsec-failed",
6696
6789
  role: "alert"
6697
6790
  },
6698
- /* @__PURE__ */ React3.createElement("p", null, t("failed"), ": ", failure.code && `${failure.code} `, failure.message),
6699
- retry && /* @__PURE__ */ React3.createElement("p", { className: "twextsec-retry-note" }, t("retryNote")),
6700
- retry && /* @__PURE__ */ React3.createElement(
6791
+ /* @__PURE__ */ React4.createElement("p", null, t("failed"), ": ", failure.code && `${failure.code} `, failure.message),
6792
+ retry && /* @__PURE__ */ React4.createElement("p", { className: "twextsec-retry-note" }, t("retryNote")),
6793
+ retry && /* @__PURE__ */ React4.createElement(
6701
6794
  "button",
6702
6795
  {
6703
6796
  type: "button",
@@ -6717,15 +6810,15 @@ var choiceIcons = {
6717
6810
  "embedded-file": "\u{1F961}",
6718
6811
  "embedded-data": "\u{1F4E6}"
6719
6812
  };
6720
- 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}`)));
6813
+ var ChoiceLabel = ({ kind, option, t }) => /* @__PURE__ */ React4.createElement("span", { className: "twextsec-choice-label" }, choiceIcons[option] && /* @__PURE__ */ React4.createElement("span", { className: "twextsec-choice-icon", "aria-hidden": "true" }, choiceIcons[option]), /* @__PURE__ */ React4.createElement("span", null, t(`${kind}-${option}`)));
6721
6814
  var UnsandboxedWarning = ({ t }) => {
6722
- const [dismissed, setDismissed] = React3.useState(false);
6723
- const returnFocus = React3.useRef(null);
6724
- React3.useEffect(() => {
6815
+ const [dismissed, setDismissed] = React4.useState(false);
6816
+ const returnFocus = React4.useRef(null);
6817
+ React4.useEffect(() => {
6725
6818
  returnFocus.current = document.activeElement;
6726
6819
  }, []);
6727
6820
  if (dismissed) return null;
6728
- return /* @__PURE__ */ React3.createElement("aside", { className: "twextsec-warning" }, /* @__PURE__ */ React3.createElement("span", { role: "status" }, t("unsandboxedWarning")), /* @__PURE__ */ React3.createElement(
6821
+ return /* @__PURE__ */ React4.createElement("aside", { className: "twextsec-warning" }, /* @__PURE__ */ React4.createElement("span", { role: "status" }, t("unsandboxedWarning")), /* @__PURE__ */ React4.createElement(
6729
6822
  "button",
6730
6823
  {
6731
6824
  type: "button",
@@ -6740,7 +6833,7 @@ var UnsandboxedWarning = ({ t }) => {
6740
6833
  t("closeWarning")
6741
6834
  ));
6742
6835
  };
6743
- 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(
6836
+ var Choices = ({ name, value, options, disabled, label, onChange, t }) => /* @__PURE__ */ React4.createElement("fieldset", { className: "twextsec-choice" }, /* @__PURE__ */ React4.createElement("legend", null, label), options.map((option) => /* @__PURE__ */ React4.createElement("label", { key: option }, /* @__PURE__ */ React4.createElement(
6744
6837
  "input",
6745
6838
  {
6746
6839
  type: "radio",
@@ -6750,8 +6843,8 @@ var Choices = ({ name, value, options, disabled, label, onChange, t }) => /* @__
6750
6843
  disabled,
6751
6844
  onChange: () => onChange(option)
6752
6845
  }
6753
- ), /* @__PURE__ */ React3.createElement(ChoiceLabel, { kind: name.startsWith("loading") ? "loading" : "execution", option, t }))));
6754
- var ExtensionReview = class extends React3.PureComponent {
6846
+ ), /* @__PURE__ */ React4.createElement(ChoiceLabel, { kind: name.startsWith("loading") ? "loading" : "execution", option, t }))));
6847
+ var ExtensionReview = class extends React4.PureComponent {
6755
6848
  constructor(props) {
6756
6849
  super(props);
6757
6850
  __publicField(this, "controller");
@@ -6876,102 +6969,42 @@ var ExtensionReview = class extends React3.PureComponent {
6876
6969
  });
6877
6970
  }
6878
6971
  renderRow(entry, selection) {
6879
- var _a;
6880
6972
  const { mode } = this.props;
6881
6973
  const t = this.t.bind(this);
6882
6974
  const decision = this.state.decisions.get(entry.key);
6883
6975
  const metadata = this.metadataOf(entry);
6884
- const declaredName = (_a = metadata.name) == null ? void 0 : _a.trim();
6885
- const ids = entry.ids.join(", ");
6886
- const name = declaredName || ids || t("extensionUnknown");
6887
- const website = displayURL(metadata.docsURL);
6888
- const release = releaseURL(metadata);
6889
6976
  const executions = this.executionOptions(entry);
6890
6977
  const loadings = loadingChoices(entry);
6891
6978
  const state = mode === "add" ? selection.stateOf(entry.key) : null;
6892
6979
  const required = state === "dependency";
6893
6980
  const roots = required ? [...selection.requiredBy.get(entry.key) || []] : [];
6894
6981
  const failure = entry.state && entry.state.error;
6895
- const badge = /* @__PURE__ */ React3.createElement(
6896
- "img",
6897
- {
6898
- className: "twextsec-trusted",
6899
- src: trustedBadge,
6900
- alt: t("trusted"),
6901
- title: t("trusted")
6902
- }
6903
- );
6904
- const preview = /* @__PURE__ */ React3.createElement(
6905
- ExtensionPreview,
6906
- {
6907
- url: metadata.banner || fallbackBanner,
6908
- fallback: !metadata.banner,
6909
- name,
6910
- cache: this.props.previewCache,
6911
- locale: this.props.locale
6912
- }
6913
- );
6914
- return /* @__PURE__ */ React3.createElement(
6915
- "li",
6982
+ return /* @__PURE__ */ React4.createElement(
6983
+ ExtensionRow,
6916
6984
  {
6917
6985
  key: entry.key,
6918
- className: "twextsec-row",
6919
- "data-key": entry.key,
6920
- "data-picking": mode === "add" ? "true" : void 0,
6921
- "data-failed": failure ? "true" : void 0
6922
- },
6923
- /* @__PURE__ */ React3.createElement("div", { className: "twextsec-head" }, mode === "add" && /* @__PURE__ */ React3.createElement("label", { className: "twextsec-pick" }, /* @__PURE__ */ React3.createElement(
6924
- "input",
6925
- {
6926
- type: "checkbox",
6986
+ metadata,
6987
+ ids: entry.ids,
6988
+ locale: this.props.locale,
6989
+ trusted: isTrusted(entry),
6990
+ previewCache: this.props.previewCache,
6991
+ itemProps: { "data-key": entry.key, "data-failed": failure ? "true" : void 0 },
6992
+ pick: mode === "add" ? {
6927
6993
  checked: selection.selected.has(entry.key),
6928
6994
  disabled: required || state === "loaded",
6929
- onChange: () => this.toggle(entry.key)
6930
- }
6931
- ), /* @__PURE__ */ React3.createElement("strong", null, name)), mode === "open" && /* @__PURE__ */ React3.createElement("strong", null, name), declaredName && ids && /* @__PURE__ */ React3.createElement("span", { className: "twextsec-id" }, ids), isTrusted(entry) && (website ? /* @__PURE__ */ React3.createElement(
6932
- "a",
6933
- {
6934
- className: "twextsec-trusted-link",
6935
- href: website,
6936
- target: "_blank",
6937
- rel: "noopener noreferrer",
6938
- "aria-label": `${t("extensionPage")}: ${name}`
6939
- },
6940
- badge
6941
- ) : badge), metadata.version && (release ? /* @__PURE__ */ React3.createElement(
6942
- "a",
6943
- {
6944
- href: release,
6945
- target: "_blank",
6946
- rel: "noopener noreferrer",
6947
- title: t("releaseNotes")
6948
- },
6949
- t("version"),
6950
- " ",
6951
- metadata.version
6952
- ) : /* @__PURE__ */ React3.createElement("span", null, t("version"), " ", metadata.version))),
6953
- /* @__PURE__ */ React3.createElement(
6954
- "p",
6955
- {
6956
- className: "twextsec-source",
6957
- title: sourceLabel(entry, t)
6958
- },
6959
- sourceLabel(entry, t)
6960
- ),
6961
- "sha256" in entry.source && entry.source.sha256 && /* @__PURE__ */ React3.createElement("p", { className: "twextsec-digest" }, t("digest"), " ", entry.source.sha256),
6962
- mode === "add" ? /* @__PURE__ */ React3.createElement(
6963
- "span",
6964
- {
6965
- className: "twextsec-preview-pick",
6966
- "aria-hidden": "true",
6967
- onClick: required || state === "loaded" ? void 0 : () => this.toggle(entry.key)
6968
- },
6969
- preview
6970
- ) : preview,
6971
- /* @__PURE__ */ React3.createElement("p", { className: "twextsec-about" }, /* @__PURE__ */ React3.createElement(LinkedText, { text: getExtensionDescription(metadata, this.props.locale) })),
6972
- /* @__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 }))),
6973
- /* @__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"))),
6974
- failure && /* @__PURE__ */ React3.createElement(
6995
+ onToggle: () => this.toggle(entry.key)
6996
+ } : void 0,
6997
+ details: /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(
6998
+ "p",
6999
+ {
7000
+ className: "twextsec-source",
7001
+ title: sourceLabel(entry, t)
7002
+ },
7003
+ sourceLabel(entry, t)
7004
+ ), "sha256" in entry.source && entry.source.sha256 && /* @__PURE__ */ React4.createElement("p", { className: "twextsec-digest" }, t("digest"), " ", entry.source.sha256))
7005
+ },
7006
+ /* @__PURE__ */ React4.createElement("div", { className: "twextsec-status" }, (required || state === "loaded") && /* @__PURE__ */ React4.createElement("span", { className: "twextsec-state" }, required ? t("state-dependency", { names: roots.join(", ") }) : t("state-loaded")), unsandboxedRequirement(metadata) === "required" && /* @__PURE__ */ React4.createElement("span", { className: "twextsec-requirement" }, t("requirement-required"))),
7007
+ failure && /* @__PURE__ */ React4.createElement(
6975
7008
  Failure,
6976
7009
  {
6977
7010
  failure,
@@ -6979,7 +7012,7 @@ var ExtensionReview = class extends React3.PureComponent {
6979
7012
  t
6980
7013
  }
6981
7014
  ),
6982
- /* @__PURE__ */ React3.createElement("div", { className: "twextsec-choices" }, !isTrusted(entry) && /* @__PURE__ */ React3.createElement(
7015
+ /* @__PURE__ */ React4.createElement("div", { className: "twextsec-choices" }, !isTrusted(entry) && /* @__PURE__ */ React4.createElement(
6983
7016
  Choices,
6984
7017
  {
6985
7018
  name: `execution-${entry.key}`,
@@ -6989,7 +7022,7 @@ var ExtensionReview = class extends React3.PureComponent {
6989
7022
  onChange: (execution) => this.decide(entry.key, { execution }),
6990
7023
  t
6991
7024
  }
6992
- ), loadings.length > 0 && /* @__PURE__ */ React3.createElement(
7025
+ ), loadings.length > 0 && /* @__PURE__ */ React4.createElement(
6993
7026
  Choices,
6994
7027
  {
6995
7028
  name: `loading-${entry.key}`,
@@ -7000,8 +7033,8 @@ var ExtensionReview = class extends React3.PureComponent {
7000
7033
  t
7001
7034
  }
7002
7035
  )),
7003
- 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 })),
7004
- contradictsDeclaration(entry, decision) && /* @__PURE__ */ React3.createElement(
7036
+ loadings.length === 0 && decision.loading !== void 0 && /* @__PURE__ */ React4.createElement("p", { className: "twextsec-loading-fixed" }, /* @__PURE__ */ React4.createElement(ChoiceLabel, { kind: "loading", option: decision.loading, t })),
7037
+ contradictsDeclaration(entry, decision) && /* @__PURE__ */ React4.createElement(
7005
7038
  "p",
7006
7039
  {
7007
7040
  className: "twextsec-contradiction",
@@ -7023,14 +7056,14 @@ var ExtensionReview = class extends React3.PureComponent {
7023
7056
  const bulkExecution = rowExecutions.every((execution) => execution === rowExecutions[0]) ? rowExecutions[0] : void 0;
7024
7057
  const anyUnsandboxed = [...this.included()].some((key) => this.state.decisions.get(key).execution === "unsandboxed");
7025
7058
  const bulkLoadings = loadingModes.filter((mode2) => entries.some((entry) => loadingChoices(entry).includes(mode2)));
7026
- 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(
7059
+ const content = /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement("p", { className: "twextsec-intro" }, t(mode === "add" ? "addIntro" : allRequired ? "allRequiredIntro" : "openIntro")), failure && /* @__PURE__ */ React4.createElement(
7027
7060
  Failure,
7028
7061
  {
7029
7062
  failure,
7030
7063
  onRetry,
7031
7064
  t
7032
7065
  }
7033
- ), (!allRequired || bulkLoadings.length > 0) && /* @__PURE__ */ React3.createElement("div", { className: "twextsec-bulk" }, !allRequired && /* @__PURE__ */ React3.createElement(
7066
+ ), (!allRequired || bulkLoadings.length > 0) && /* @__PURE__ */ React4.createElement("div", { className: "twextsec-bulk" }, !allRequired && /* @__PURE__ */ React4.createElement(
7034
7067
  Choices,
7035
7068
  {
7036
7069
  name: "execution-all",
@@ -7040,7 +7073,7 @@ var ExtensionReview = class extends React3.PureComponent {
7040
7073
  onChange: this.handleBulkExecution,
7041
7074
  t
7042
7075
  }
7043
- ), bulkLoadings.length > 0 && /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(
7076
+ ), bulkLoadings.length > 0 && /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(
7044
7077
  Choices,
7045
7078
  {
7046
7079
  name: "loading-all",
@@ -7050,8 +7083,8 @@ var ExtensionReview = class extends React3.PureComponent {
7050
7083
  onChange: this.handleBulkLoading,
7051
7084
  t
7052
7085
  }
7053
- ), /* @__PURE__ */ React3.createElement("p", { className: "twextsec-note" }, t("loadingNote")))), /* @__PURE__ */ React3.createElement("ul", { className: "twextsec-rows" }, entries.map((entry) => this.renderRow(entry, selection))));
7054
- 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(
7086
+ ), /* @__PURE__ */ React4.createElement("p", { className: "twextsec-note" }, t("loadingNote")))), /* @__PURE__ */ React4.createElement("ul", { className: "twextsec-rows" }, entries.map((entry) => this.renderRow(entry, selection))));
7087
+ const body = /* @__PURE__ */ React4.createElement("div", { className: "twextsec-review", "data-mode": mode }, mode === "add" ? /* @__PURE__ */ React4.createElement("div", { className: "twextsec-scroll" }, content) : content, anyUnsandboxed && /* @__PURE__ */ React4.createElement(UnsandboxedWarning, { t }), /* @__PURE__ */ React4.createElement("menu", { className: "twextsec-actions" }, /* @__PURE__ */ React4.createElement(
7055
7088
  "button",
7056
7089
  {
7057
7090
  type: "button",
@@ -7059,7 +7092,7 @@ var ExtensionReview = class extends React3.PureComponent {
7059
7092
  onClick: this.handleCancel
7060
7093
  },
7061
7094
  t("cancel")
7062
- ), /* @__PURE__ */ React3.createElement(
7095
+ ), /* @__PURE__ */ React4.createElement(
7063
7096
  "button",
7064
7097
  {
7065
7098
  type: "button",
@@ -7069,7 +7102,7 @@ var ExtensionReview = class extends React3.PureComponent {
7069
7102
  t(mode === "add" ? "add" : "ok")
7070
7103
  )));
7071
7104
  if (mode === "open" && DialogFrame) {
7072
- return /* @__PURE__ */ React3.createElement(
7105
+ return /* @__PURE__ */ React4.createElement(
7073
7106
  DialogFrame,
7074
7107
  {
7075
7108
  title: t("openTitle"),
@@ -7093,5 +7126,6 @@ var ExtensionReview2 = review_default;
7093
7126
  var react_default = ExtensionReview2;
7094
7127
  export {
7095
7128
  ExtensionReview2 as ExtensionReview,
7129
+ ExtensionRow,
7096
7130
  react_default as default
7097
7131
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubohiroya/turbowarp-extension-security-dialog",
3
- "version": "0.8.9",
3
+ "version": "0.9.0",
4
4
  "description": "Batch extension security review, previews and per-project defaults for TurboWarp hosts",
5
5
  "type": "module",
6
6
  "author": {