react-devbelt 0.4.1 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-VVSEYZHW.js → chunk-5QVD43AU.js} +568 -419
- package/dist/chunk-5QVD43AU.js.map +1 -0
- package/dist/{chunk-EYWS436C.js → chunk-6FUPE5IB.js} +2 -2
- package/dist/{chunk-EYWS436C.js.map → chunk-6FUPE5IB.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/install.js +2 -2
- package/dist/plugins.js +2 -2
- package/dist/styles.css +1 -1
- package/dist/{toolbar-entry-4FUDASJW.js → toolbar-entry-PCW72WF5.js} +27 -15
- package/dist/toolbar-entry-PCW72WF5.js.map +1 -0
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-VVSEYZHW.js.map +0 -1
- package/dist/toolbar-entry-4FUDASJW.js.map +0 -1
|
@@ -143,7 +143,7 @@ import {
|
|
|
143
143
|
usePrimitive,
|
|
144
144
|
valueMissingMessage,
|
|
145
145
|
watchFormDisabled
|
|
146
|
-
} from "./chunk-
|
|
146
|
+
} from "./chunk-6FUPE5IB.js";
|
|
147
147
|
import {
|
|
148
148
|
useToolbar
|
|
149
149
|
} from "./chunk-6TOYYHSR.js";
|
|
@@ -2443,10 +2443,10 @@ var ConsoleRow = memo(function ConsoleRow2({
|
|
|
2443
2443
|
{
|
|
2444
2444
|
value: String(entry.id),
|
|
2445
2445
|
label: `${entry.level} ${line}`,
|
|
2446
|
-
className: "grid cursor-default grid-cols-[3.25rem_minmax(0,1fr)
|
|
2446
|
+
className: "grid cursor-default grid-cols-[3.25rem_minmax(0,1fr)_minmax(2rem,auto)_4.5rem] min-h-6 items-center gap-2 rounded-md px-2 py-1 font-mono text-[11px] text-fg data-highlighted:bg-hover-subtle data-selected:bg-accent/15",
|
|
2447
2447
|
children: [
|
|
2448
2448
|
/* @__PURE__ */ jsx9("span", { className: `font-semibold ${LEVEL_CLASS[entry.level]}`, children: entry.level }),
|
|
2449
|
-
/* @__PURE__ */ jsx9("span", { className:
|
|
2449
|
+
/* @__PURE__ */ jsx9("span", { className: `truncate ${line ? "" : "text-fg-tertiary"}`, title: line, children: line || "(empty)" }),
|
|
2450
2450
|
/* @__PURE__ */ jsx9("span", { className: "text-end tabular-nums", children: entry.count > 1 ? `\xD7${entry.count}` : "" }),
|
|
2451
2451
|
/* @__PURE__ */ jsx9("span", { className: "text-end text-fg-secondary tabular-nums", children: new Date(entry.at).toLocaleTimeString() })
|
|
2452
2452
|
]
|
|
@@ -4794,7 +4794,8 @@ function DevGrabPicker({
|
|
|
4794
4794
|
try {
|
|
4795
4795
|
const contexts = await Promise.all(elements2.map(getElementContext));
|
|
4796
4796
|
const view = elements2[0].ownerDocument.defaultView ?? window;
|
|
4797
|
-
const
|
|
4797
|
+
const { pathname, search, hash } = view.location;
|
|
4798
|
+
const header = `[path: ${pathname}${search}${hash}, viewport: ${viewportLabel} ${view.innerWidth}\xD7${view.innerHeight}, dpr ${view.devicePixelRatio}${extra}]`;
|
|
4798
4799
|
const problems = appendix?.();
|
|
4799
4800
|
const body = contexts.map((c, i) => {
|
|
4800
4801
|
const note = notes?.[i];
|
|
@@ -5205,6 +5206,20 @@ function grab() {
|
|
|
5205
5206
|
// src/plugins/network/index.tsx
|
|
5206
5207
|
import { NetworkIcon } from "lucide-react";
|
|
5207
5208
|
|
|
5209
|
+
// src/ui/primitives/middle-truncate.tsx
|
|
5210
|
+
import { jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
5211
|
+
function MiddleTruncate({
|
|
5212
|
+
text: text3,
|
|
5213
|
+
tail = 14,
|
|
5214
|
+
className = ""
|
|
5215
|
+
}) {
|
|
5216
|
+
const split = text3.length > tail * 2 ? text3.length - tail : text3.length;
|
|
5217
|
+
return /* @__PURE__ */ jsxs12("span", { className: `flex min-w-0 ${className}`, title: text3, children: [
|
|
5218
|
+
/* @__PURE__ */ jsx19("span", { className: "min-w-0 truncate", children: text3.slice(0, split) }),
|
|
5219
|
+
split < text3.length ? /* @__PURE__ */ jsx19("span", { className: "shrink-0 whitespace-pre", children: text3.slice(split) }) : null
|
|
5220
|
+
] });
|
|
5221
|
+
}
|
|
5222
|
+
|
|
5208
5223
|
// src/plugins/network/panel.tsx
|
|
5209
5224
|
import {
|
|
5210
5225
|
memo as memo2,
|
|
@@ -5658,7 +5673,7 @@ import "react";
|
|
|
5658
5673
|
|
|
5659
5674
|
// ../../node_modules/.pnpm/@ui-sdk+react@0.1.0-beta.5_@types+react@19.3.0_@ui-sdk+core@0.1.0-beta.5_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/@ui-sdk/react/dist/dialog-parts.js
|
|
5660
5675
|
import * as React7 from "react";
|
|
5661
|
-
import { jsx as
|
|
5676
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
5662
5677
|
var TriggerContext = React7.createContext(null);
|
|
5663
5678
|
var text2 = (state3) => state3.text;
|
|
5664
5679
|
function dialogParts(primitive, name, viewport2) {
|
|
@@ -5676,7 +5691,7 @@ function dialogParts(primitive, name, viewport2) {
|
|
|
5676
5691
|
}) {
|
|
5677
5692
|
const handle = usePrimitive(primitive, options);
|
|
5678
5693
|
useControllerEntry(options.controller, handle);
|
|
5679
|
-
return /* @__PURE__ */
|
|
5694
|
+
return /* @__PURE__ */ jsx20(HandleScope, { handle, children: /* @__PURE__ */ jsx20(ContainerContext2.Provider, { value: container, children }) });
|
|
5680
5695
|
}
|
|
5681
5696
|
function Trigger({
|
|
5682
5697
|
controller,
|
|
@@ -5704,13 +5719,13 @@ function dialogParts(primitive, name, viewport2) {
|
|
|
5704
5719
|
disabled: !!disabled
|
|
5705
5720
|
}
|
|
5706
5721
|
);
|
|
5707
|
-
return /* @__PURE__ */
|
|
5722
|
+
return /* @__PURE__ */ jsx20(TriggerContext.Provider, { value: { shortcut }, children: /* @__PURE__ */ jsx20(
|
|
5708
5723
|
Connected,
|
|
5709
5724
|
{
|
|
5710
5725
|
primitive,
|
|
5711
5726
|
controller,
|
|
5712
5727
|
fallback: unconnected,
|
|
5713
|
-
children: /* @__PURE__ */
|
|
5728
|
+
children: /* @__PURE__ */ jsx20(parts6.Trigger, { ...props })
|
|
5714
5729
|
}
|
|
5715
5730
|
) });
|
|
5716
5731
|
}
|
|
@@ -5746,7 +5761,7 @@ function dialogParts(primitive, name, viewport2) {
|
|
|
5746
5761
|
function Shortcut(props) {
|
|
5747
5762
|
const trigger = React7.useContext(TriggerContext);
|
|
5748
5763
|
if (useNearest(primitive)) {
|
|
5749
|
-
return /* @__PURE__ */
|
|
5764
|
+
return /* @__PURE__ */ jsx20(ShortcutPart, { inherited: trigger?.shortcut, ...props });
|
|
5750
5765
|
}
|
|
5751
5766
|
if (trigger) {
|
|
5752
5767
|
return null;
|
|
@@ -5780,13 +5795,13 @@ function dialogParts(primitive, name, viewport2) {
|
|
|
5780
5795
|
}
|
|
5781
5796
|
|
|
5782
5797
|
// ../../node_modules/.pnpm/@ui-sdk+react@0.1.0-beta.5_@types+react@19.3.0_@ui-sdk+core@0.1.0-beta.5_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/@ui-sdk/react/dist/alert-dialog.js
|
|
5783
|
-
import { jsx as
|
|
5798
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
5784
5799
|
var alertParts = dialogParts(
|
|
5785
5800
|
alertDialog,
|
|
5786
5801
|
"AlertDialog"
|
|
5787
5802
|
);
|
|
5788
5803
|
function AlertDialog(props) {
|
|
5789
|
-
return /* @__PURE__ */
|
|
5804
|
+
return /* @__PURE__ */ jsx21(
|
|
5790
5805
|
alertParts.Root,
|
|
5791
5806
|
{
|
|
5792
5807
|
...props
|
|
@@ -5794,7 +5809,7 @@ function AlertDialog(props) {
|
|
|
5794
5809
|
);
|
|
5795
5810
|
}
|
|
5796
5811
|
function AlertDialogTrigger(props) {
|
|
5797
|
-
return /* @__PURE__ */
|
|
5812
|
+
return /* @__PURE__ */ jsx21(alertParts.Trigger, { ...props });
|
|
5798
5813
|
}
|
|
5799
5814
|
var AlertDialogBackdrop = alertParts.Backdrop;
|
|
5800
5815
|
var AlertDialogContent = alertParts.Content;
|
|
@@ -5834,11 +5849,11 @@ var dialog = dialogPrimitive;
|
|
|
5834
5849
|
|
|
5835
5850
|
// ../../node_modules/.pnpm/@ui-sdk+react@0.1.0-beta.5_@types+react@19.3.0_@ui-sdk+core@0.1.0-beta.5_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/@ui-sdk/react/dist/dialog.js
|
|
5836
5851
|
import "react";
|
|
5837
|
-
import { jsx as
|
|
5852
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
5838
5853
|
var parts5 = dialogParts(dialog, "Dialog", sheetViewport);
|
|
5839
5854
|
var Dialog = parts5.Root;
|
|
5840
5855
|
function DialogTrigger(props) {
|
|
5841
|
-
return /* @__PURE__ */
|
|
5856
|
+
return /* @__PURE__ */ jsx22(parts5.Trigger, { ...props });
|
|
5842
5857
|
}
|
|
5843
5858
|
var DialogBackdrop = parts5.Backdrop;
|
|
5844
5859
|
var DialogContent = parts5.Content;
|
|
@@ -5856,7 +5871,7 @@ import {
|
|
|
5856
5871
|
TrashIcon as TrashIcon2,
|
|
5857
5872
|
XIcon
|
|
5858
5873
|
} from "lucide-react";
|
|
5859
|
-
import { Fragment as Fragment9, jsx as
|
|
5874
|
+
import { Fragment as Fragment9, jsx as jsx23, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
5860
5875
|
var METHOD_CLASS = {
|
|
5861
5876
|
GET: "text-accent-fg",
|
|
5862
5877
|
POST: "text-success-fg",
|
|
@@ -5868,6 +5883,9 @@ var FILTER_METHODS = ["GET", "POST", "PUT", "PATCH", "DELETE"];
|
|
|
5868
5883
|
function isFailed(entry) {
|
|
5869
5884
|
return entry.status === 0 || (entry.status ?? 0) >= 400;
|
|
5870
5885
|
}
|
|
5886
|
+
function formatDuration(ms) {
|
|
5887
|
+
return ms >= 1e4 ? `${Math.round(ms / 1e3)}s` : `${ms}ms`;
|
|
5888
|
+
}
|
|
5871
5889
|
function statusLabel(entry) {
|
|
5872
5890
|
if (entry.status === null) return "\u2026";
|
|
5873
5891
|
if (entry.status === 0) return "ERR";
|
|
@@ -5889,50 +5907,50 @@ function displayPath(url) {
|
|
|
5889
5907
|
}
|
|
5890
5908
|
function HeaderList({ headers }) {
|
|
5891
5909
|
const rows = Object.entries(headers);
|
|
5892
|
-
if (rows.length === 0) return /* @__PURE__ */
|
|
5893
|
-
return /* @__PURE__ */
|
|
5894
|
-
/* @__PURE__ */
|
|
5895
|
-
/* @__PURE__ */
|
|
5910
|
+
if (rows.length === 0) return /* @__PURE__ */ jsx23("p", { className: "text-fg-tertiary", children: "None" });
|
|
5911
|
+
return /* @__PURE__ */ jsx23("dl", { className: "grid grid-cols-[max-content_minmax(0,1fr)] gap-x-3 gap-y-1 font-mono text-[11px]", children: rows.map(([name, value]) => /* @__PURE__ */ jsxs13("div", { className: "contents", children: [
|
|
5912
|
+
/* @__PURE__ */ jsx23("dt", { className: "text-fg-tertiary", children: name }),
|
|
5913
|
+
/* @__PURE__ */ jsx23("dd", { className: "break-all", children: value })
|
|
5896
5914
|
] }, name)) });
|
|
5897
5915
|
}
|
|
5898
5916
|
function Body({ value, title }) {
|
|
5899
5917
|
const text3 = prettyBody(value);
|
|
5900
|
-
if (!text3) return /* @__PURE__ */
|
|
5901
|
-
return /* @__PURE__ */
|
|
5902
|
-
/* @__PURE__ */
|
|
5903
|
-
/* @__PURE__ */
|
|
5918
|
+
if (!text3) return /* @__PURE__ */ jsx23("p", { className: "text-fg-tertiary", children: "No body" });
|
|
5919
|
+
return /* @__PURE__ */ jsxs13("div", { className: "relative", children: [
|
|
5920
|
+
/* @__PURE__ */ jsxs13(Dialog, { children: [
|
|
5921
|
+
/* @__PURE__ */ jsx23(
|
|
5904
5922
|
DialogTrigger,
|
|
5905
5923
|
{
|
|
5906
5924
|
"aria-label": `View ${title.toLowerCase()} fullscreen`,
|
|
5907
5925
|
className: `${iconButtonClass} sticky top-0 float-end ms-2 bg-surface-sticky`,
|
|
5908
|
-
children: /* @__PURE__ */
|
|
5926
|
+
children: /* @__PURE__ */ jsx23(Maximize2Icon, { className: "size-3.5", "aria-hidden": "true" })
|
|
5909
5927
|
}
|
|
5910
5928
|
),
|
|
5911
|
-
/* @__PURE__ */
|
|
5929
|
+
/* @__PURE__ */ jsxs13(
|
|
5912
5930
|
DialogContent,
|
|
5913
5931
|
{
|
|
5914
5932
|
"data-react-grab-ignore": true,
|
|
5915
5933
|
className: "fixed inset-4 m-0 flex h-auto max-h-none w-auto max-w-none flex-col overflow-hidden rounded-xl border border-line bg-surface p-0 text-xs text-fg shadow-2xl transition-[opacity,scale] duration-[240ms] ease-out data-ending-style:duration-[160ms] backdrop:bg-scrim data-ending-style:opacity-0 data-starting-style:scale-[0.98] data-starting-style:opacity-0 motion-reduce:transition-none",
|
|
5916
5934
|
children: [
|
|
5917
|
-
/* @__PURE__ */
|
|
5918
|
-
/* @__PURE__ */
|
|
5919
|
-
/* @__PURE__ */
|
|
5935
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2 border-b border-line px-4 py-2.5", children: [
|
|
5936
|
+
/* @__PURE__ */ jsx23(DialogTitle, { className: "min-w-0 flex-1 truncate text-sm font-semibold", children: title }),
|
|
5937
|
+
/* @__PURE__ */ jsx23(
|
|
5920
5938
|
Button,
|
|
5921
5939
|
{
|
|
5922
5940
|
"aria-label": `Copy ${title.toLowerCase()}`,
|
|
5923
5941
|
className: iconButtonClass,
|
|
5924
5942
|
onClick: () => navigator.clipboard.writeText(text3),
|
|
5925
|
-
children: /* @__PURE__ */
|
|
5943
|
+
children: /* @__PURE__ */ jsx23(CopyIcon3, { className: "size-3.5", "aria-hidden": "true" })
|
|
5926
5944
|
}
|
|
5927
5945
|
),
|
|
5928
|
-
/* @__PURE__ */
|
|
5946
|
+
/* @__PURE__ */ jsx23(DialogClose, { "aria-label": "Close", className: iconButtonClass, children: /* @__PURE__ */ jsx23(XIcon, { className: "size-3.5", "aria-hidden": "true" }) })
|
|
5929
5947
|
] }),
|
|
5930
|
-
/* @__PURE__ */
|
|
5948
|
+
/* @__PURE__ */ jsx23("div", { className: "min-h-0 flex-1 scrollbar-slim scroll-fade overflow-auto p-4 [&_pre]:text-[13px]", children: /* @__PURE__ */ jsx23(JsonCode, { code: text3 }) })
|
|
5931
5949
|
]
|
|
5932
5950
|
}
|
|
5933
5951
|
)
|
|
5934
5952
|
] }),
|
|
5935
|
-
/* @__PURE__ */
|
|
5953
|
+
/* @__PURE__ */ jsx23(JsonCode, { code: text3 })
|
|
5936
5954
|
] });
|
|
5937
5955
|
}
|
|
5938
5956
|
var tabClass = "rounded-md px-2.5 py-1 text-fg-secondary hover:text-fg data-selected:bg-hover data-selected:text-fg focus-visible:outline-2 focus-visible:outline-focus";
|
|
@@ -5964,16 +5982,16 @@ function CopyMenu({ entry }) {
|
|
|
5964
5982
|
writeJson(COPY_PARTS_KEY, next);
|
|
5965
5983
|
return next;
|
|
5966
5984
|
});
|
|
5967
|
-
return /* @__PURE__ */
|
|
5968
|
-
/* @__PURE__ */
|
|
5985
|
+
return /* @__PURE__ */ jsxs13(Popover, { children: [
|
|
5986
|
+
/* @__PURE__ */ jsx23(
|
|
5969
5987
|
PopoverTrigger,
|
|
5970
5988
|
{
|
|
5971
5989
|
"aria-label": "Copy request for agent",
|
|
5972
5990
|
className: iconButtonClass,
|
|
5973
|
-
children: /* @__PURE__ */
|
|
5991
|
+
children: /* @__PURE__ */ jsx23(CopyIcon3, { className: "size-3.5", "aria-hidden": "true" })
|
|
5974
5992
|
}
|
|
5975
5993
|
),
|
|
5976
|
-
/* @__PURE__ */
|
|
5994
|
+
/* @__PURE__ */ jsxs13(
|
|
5977
5995
|
PopoverContent,
|
|
5978
5996
|
{
|
|
5979
5997
|
side: "bottom",
|
|
@@ -5982,19 +6000,19 @@ function CopyMenu({ entry }) {
|
|
|
5982
6000
|
"data-react-grab-ignore": true,
|
|
5983
6001
|
className: "m-0 w-52 rounded-lg border border-line bg-surface-raised p-3 text-xs text-fg shadow-xl",
|
|
5984
6002
|
children: [
|
|
5985
|
-
/* @__PURE__ */
|
|
5986
|
-
/* @__PURE__ */
|
|
6003
|
+
/* @__PURE__ */ jsx23(PopoverTitle, { className: "mb-2 text-xs font-semibold", children: "Copy to clipboard" }),
|
|
6004
|
+
/* @__PURE__ */ jsx23("div", { className: "mb-3 flex flex-col gap-1.5", children: COPY_OPTIONS.map(({ key, label }) => /* @__PURE__ */ jsxs13(
|
|
5987
6005
|
"label",
|
|
5988
6006
|
{
|
|
5989
6007
|
className: "flex cursor-pointer items-center gap-2 rounded-md px-1 py-1 hover:bg-hover-subtle",
|
|
5990
6008
|
children: [
|
|
5991
|
-
/* @__PURE__ */
|
|
6009
|
+
/* @__PURE__ */ jsx23(
|
|
5992
6010
|
Checkbox,
|
|
5993
6011
|
{
|
|
5994
6012
|
checked: parts6[key],
|
|
5995
6013
|
onCheckedChange: (checked) => toggle(key, checked === true),
|
|
5996
6014
|
className: "inline-flex size-4 items-center justify-center rounded border border-line-control bg-transparent text-fg-inverse focus-visible:outline-2 focus-visible:outline-focus data-checked:border-line-inverse data-checked:bg-inverse",
|
|
5997
|
-
children: /* @__PURE__ */
|
|
6015
|
+
children: /* @__PURE__ */ jsx23(CheckboxIndicator, { children: /* @__PURE__ */ jsx23(CheckIcon3, { className: "size-3", "aria-hidden": "true" }) })
|
|
5998
6016
|
}
|
|
5999
6017
|
),
|
|
6000
6018
|
label
|
|
@@ -6002,20 +6020,20 @@ function CopyMenu({ entry }) {
|
|
|
6002
6020
|
},
|
|
6003
6021
|
key
|
|
6004
6022
|
)) }),
|
|
6005
|
-
/* @__PURE__ */
|
|
6023
|
+
/* @__PURE__ */ jsxs13(
|
|
6006
6024
|
PopoverClose,
|
|
6007
6025
|
{
|
|
6008
6026
|
disabled: none,
|
|
6009
6027
|
onClick: () => copyText(formatEntryForAgent(entry, parts6)),
|
|
6010
6028
|
className: "inline-flex h-7 w-full items-center justify-center gap-1.5 rounded-md bg-inverse font-medium text-fg-inverse hover:bg-inverse-hover focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus disabled:opacity-40",
|
|
6011
6029
|
children: [
|
|
6012
|
-
/* @__PURE__ */
|
|
6030
|
+
/* @__PURE__ */ jsx23(CopyIcon3, { className: "size-3.5", "aria-hidden": "true" }),
|
|
6013
6031
|
"Copy"
|
|
6014
6032
|
]
|
|
6015
6033
|
}
|
|
6016
6034
|
),
|
|
6017
|
-
/* @__PURE__ */
|
|
6018
|
-
/* @__PURE__ */
|
|
6035
|
+
/* @__PURE__ */ jsxs13("div", { className: "mt-2 flex gap-2", children: [
|
|
6036
|
+
/* @__PURE__ */ jsx23(
|
|
6019
6037
|
PopoverClose,
|
|
6020
6038
|
{
|
|
6021
6039
|
"aria-label": "Copy as cURL",
|
|
@@ -6024,7 +6042,7 @@ function CopyMenu({ entry }) {
|
|
|
6024
6042
|
children: "cURL"
|
|
6025
6043
|
}
|
|
6026
6044
|
),
|
|
6027
|
-
/* @__PURE__ */
|
|
6045
|
+
/* @__PURE__ */ jsx23(
|
|
6028
6046
|
PopoverClose,
|
|
6029
6047
|
{
|
|
6030
6048
|
"aria-label": "Copy as fetch",
|
|
@@ -6040,9 +6058,9 @@ function CopyMenu({ entry }) {
|
|
|
6040
6058
|
] });
|
|
6041
6059
|
}
|
|
6042
6060
|
function ReplayButton({ entry }) {
|
|
6043
|
-
const icon = /* @__PURE__ */
|
|
6061
|
+
const icon = /* @__PURE__ */ jsx23(RotateCwIcon, { className: "size-3.5", "aria-hidden": "true" });
|
|
6044
6062
|
if (entry.method === "GET") {
|
|
6045
|
-
return /* @__PURE__ */
|
|
6063
|
+
return /* @__PURE__ */ jsx23(
|
|
6046
6064
|
Button,
|
|
6047
6065
|
{
|
|
6048
6066
|
"aria-label": "Replay request",
|
|
@@ -6052,8 +6070,8 @@ function ReplayButton({ entry }) {
|
|
|
6052
6070
|
}
|
|
6053
6071
|
);
|
|
6054
6072
|
}
|
|
6055
|
-
return /* @__PURE__ */
|
|
6056
|
-
/* @__PURE__ */
|
|
6073
|
+
return /* @__PURE__ */ jsxs13(AlertDialog, { children: [
|
|
6074
|
+
/* @__PURE__ */ jsx23(
|
|
6057
6075
|
AlertDialogTrigger,
|
|
6058
6076
|
{
|
|
6059
6077
|
"aria-label": "Replay request",
|
|
@@ -6061,24 +6079,24 @@ function ReplayButton({ entry }) {
|
|
|
6061
6079
|
children: icon
|
|
6062
6080
|
}
|
|
6063
6081
|
),
|
|
6064
|
-
/* @__PURE__ */
|
|
6065
|
-
/* @__PURE__ */
|
|
6082
|
+
/* @__PURE__ */ jsx23(AlertDialogBackdrop, { className: "bg-scrim" }),
|
|
6083
|
+
/* @__PURE__ */ jsxs13(
|
|
6066
6084
|
AlertDialogContent,
|
|
6067
6085
|
{
|
|
6068
6086
|
"data-react-grab-ignore": true,
|
|
6069
6087
|
className: "m-0 w-[min(380px,calc(100vw-32px))] rounded-xl border border-line bg-surface p-4 text-xs text-fg shadow-2xl",
|
|
6070
6088
|
children: [
|
|
6071
|
-
/* @__PURE__ */
|
|
6089
|
+
/* @__PURE__ */ jsxs13(AlertDialogTitle, { className: "text-sm font-semibold [overflow-wrap:anywhere]", children: [
|
|
6072
6090
|
"Replay ",
|
|
6073
6091
|
entry.method,
|
|
6074
6092
|
" ",
|
|
6075
6093
|
displayPath(entry.url),
|
|
6076
6094
|
"?"
|
|
6077
6095
|
] }),
|
|
6078
|
-
/* @__PURE__ */
|
|
6079
|
-
/* @__PURE__ */
|
|
6080
|
-
/* @__PURE__ */
|
|
6081
|
-
/* @__PURE__ */
|
|
6096
|
+
/* @__PURE__ */ jsx23(AlertDialogDescription, { className: "mt-1 text-fg-secondary", children: "This sends the request again and may change data on the server." }),
|
|
6097
|
+
/* @__PURE__ */ jsxs13("div", { className: "mt-4 flex justify-end gap-2", children: [
|
|
6098
|
+
/* @__PURE__ */ jsx23(AlertDialogClose, { className: "inline-flex h-7 items-center rounded-md border border-line-strong px-3 font-medium hover:bg-hover focus-visible:outline-2 focus-visible:outline-focus", children: "Cancel" }),
|
|
6099
|
+
/* @__PURE__ */ jsx23(
|
|
6082
6100
|
AlertDialogClose,
|
|
6083
6101
|
{
|
|
6084
6102
|
value: "confirm",
|
|
@@ -6095,56 +6113,56 @@ function ReplayButton({ entry }) {
|
|
|
6095
6113
|
}
|
|
6096
6114
|
function EntryDetail2({ entry }) {
|
|
6097
6115
|
const name = `${entry.method} ${displayPath(entry.url)}`;
|
|
6098
|
-
return /* @__PURE__ */
|
|
6099
|
-
/* @__PURE__ */
|
|
6100
|
-
/* @__PURE__ */
|
|
6101
|
-
/* @__PURE__ */
|
|
6116
|
+
return /* @__PURE__ */ jsxs13("div", { className: "flex min-h-0 flex-1 flex-col", children: [
|
|
6117
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-start gap-2 border-b border-line px-3 py-2", children: [
|
|
6118
|
+
/* @__PURE__ */ jsxs13("p", { className: "min-w-0 flex-1 font-mono text-[11px] break-all", children: [
|
|
6119
|
+
/* @__PURE__ */ jsx23("span", { className: `font-semibold ${METHOD_CLASS[entry.method] ?? ""}`, children: entry.method }),
|
|
6102
6120
|
" ",
|
|
6103
6121
|
entry.url,
|
|
6104
|
-
/* @__PURE__ */
|
|
6105
|
-
/* @__PURE__ */
|
|
6122
|
+
/* @__PURE__ */ jsxs13("span", { className: "block text-fg-tertiary", children: [
|
|
6123
|
+
/* @__PURE__ */ jsxs13("span", { className: statusClass(entry), children: [
|
|
6106
6124
|
statusLabel(entry),
|
|
6107
6125
|
entry.status ? ` ${statusReason(entry.status) ?? ""}`.trimEnd() : ""
|
|
6108
6126
|
] }),
|
|
6109
|
-
entry.duration != null ? ` \xB7 ${entry.duration}
|
|
6127
|
+
entry.duration != null ? ` \xB7 ${formatDuration(entry.duration)}` : "",
|
|
6110
6128
|
` \xB7 ${new Date(entry.startedAt).toLocaleTimeString()}`
|
|
6111
6129
|
] })
|
|
6112
6130
|
] }),
|
|
6113
|
-
/* @__PURE__ */
|
|
6114
|
-
/* @__PURE__ */
|
|
6131
|
+
/* @__PURE__ */ jsx23(ReplayButton, { entry }),
|
|
6132
|
+
/* @__PURE__ */ jsx23(CopyMenu, { entry })
|
|
6115
6133
|
] }),
|
|
6116
|
-
/* @__PURE__ */
|
|
6117
|
-
/* @__PURE__ */
|
|
6134
|
+
/* @__PURE__ */ jsxs13(Tabs, { defaultValue: "response", className: "flex min-h-0 flex-1 flex-col", children: [
|
|
6135
|
+
/* @__PURE__ */ jsxs13(
|
|
6118
6136
|
TabsList,
|
|
6119
6137
|
{
|
|
6120
6138
|
"aria-label": "Request details",
|
|
6121
6139
|
className: "flex gap-1 border-b border-line px-2 py-1.5",
|
|
6122
6140
|
children: [
|
|
6123
|
-
/* @__PURE__ */
|
|
6124
|
-
/* @__PURE__ */
|
|
6125
|
-
/* @__PURE__ */
|
|
6141
|
+
/* @__PURE__ */ jsx23(TabsTab, { value: "request", className: tabClass, children: "Request" }),
|
|
6142
|
+
/* @__PURE__ */ jsx23(TabsTab, { value: "response", className: tabClass, children: "Response" }),
|
|
6143
|
+
/* @__PURE__ */ jsx23(TabsTab, { value: "headers", className: tabClass, children: "Headers" })
|
|
6126
6144
|
]
|
|
6127
6145
|
}
|
|
6128
6146
|
),
|
|
6129
|
-
/* @__PURE__ */
|
|
6130
|
-
/* @__PURE__ */
|
|
6147
|
+
/* @__PURE__ */ jsx23(TabsPanel, { value: "request", className: "min-h-0 flex-1 scrollbar-slim scroll-fade overflow-auto p-3", children: /* @__PURE__ */ jsx23(Body, { value: entry.requestBody, title: `Request body \xB7 ${name}` }) }),
|
|
6148
|
+
/* @__PURE__ */ jsx23(
|
|
6131
6149
|
TabsPanel,
|
|
6132
6150
|
{
|
|
6133
6151
|
value: "response",
|
|
6134
6152
|
className: "min-h-0 flex-1 scrollbar-slim scroll-fade overflow-auto p-3",
|
|
6135
|
-
children: /* @__PURE__ */
|
|
6153
|
+
children: /* @__PURE__ */ jsx23(Body, { value: entry.responseBody, title: `Response body \xB7 ${name}` })
|
|
6136
6154
|
}
|
|
6137
6155
|
),
|
|
6138
|
-
/* @__PURE__ */
|
|
6156
|
+
/* @__PURE__ */ jsxs13(
|
|
6139
6157
|
TabsPanel,
|
|
6140
6158
|
{
|
|
6141
6159
|
value: "headers",
|
|
6142
6160
|
className: "min-h-0 flex-1 space-y-3 scrollbar-slim scroll-fade overflow-auto p-3",
|
|
6143
6161
|
children: [
|
|
6144
|
-
/* @__PURE__ */
|
|
6145
|
-
/* @__PURE__ */
|
|
6146
|
-
/* @__PURE__ */
|
|
6147
|
-
/* @__PURE__ */
|
|
6162
|
+
/* @__PURE__ */ jsx23("h3", { className: "font-medium text-fg-secondary", children: "Request" }),
|
|
6163
|
+
/* @__PURE__ */ jsx23(HeaderList, { headers: entry.requestHeaders }),
|
|
6164
|
+
/* @__PURE__ */ jsx23("h3", { className: "font-medium text-fg-secondary", children: "Response" }),
|
|
6165
|
+
/* @__PURE__ */ jsx23(HeaderList, { headers: entry.responseHeaders })
|
|
6148
6166
|
]
|
|
6149
6167
|
}
|
|
6150
6168
|
)
|
|
@@ -6177,24 +6195,24 @@ var NetworkRow = memo2(function NetworkRow2({
|
|
|
6177
6195
|
origin
|
|
6178
6196
|
}) {
|
|
6179
6197
|
const pending = entry.duration == null;
|
|
6180
|
-
return /* @__PURE__ */
|
|
6198
|
+
return /* @__PURE__ */ jsxs13(
|
|
6181
6199
|
ListboxItem,
|
|
6182
6200
|
{
|
|
6183
6201
|
value: String(entry.id),
|
|
6184
6202
|
label: `${entry.method} ${displayPath(entry.url)}`,
|
|
6185
6203
|
className: `${ROW_GRID} min-h-6 cursor-default rounded-md px-2 py-1 font-mono text-[11px] text-fg data-highlighted:bg-hover-subtle data-selected:bg-accent/15`,
|
|
6186
6204
|
children: [
|
|
6187
|
-
/* @__PURE__ */
|
|
6205
|
+
/* @__PURE__ */ jsx23(
|
|
6188
6206
|
"span",
|
|
6189
6207
|
{
|
|
6190
6208
|
className: `font-semibold ${METHOD_CLASS[entry.method] ?? "text-fg"}`,
|
|
6191
6209
|
children: entry.method
|
|
6192
6210
|
}
|
|
6193
6211
|
),
|
|
6194
|
-
/* @__PURE__ */
|
|
6195
|
-
/* @__PURE__ */
|
|
6196
|
-
/* @__PURE__ */
|
|
6197
|
-
/* @__PURE__ */
|
|
6212
|
+
/* @__PURE__ */ jsx23(MiddleTruncate, { text: displayPath(entry.url) }),
|
|
6213
|
+
/* @__PURE__ */ jsx23("span", { className: `text-end tabular-nums ${statusClass(entry)}`, children: statusLabel(entry) }),
|
|
6214
|
+
/* @__PURE__ */ jsx23("span", { className: "text-end text-fg tabular-nums", children: entry.duration == null ? "" : formatDuration(entry.duration) }),
|
|
6215
|
+
/* @__PURE__ */ jsx23(
|
|
6198
6216
|
"div",
|
|
6199
6217
|
{
|
|
6200
6218
|
"aria-hidden": "true",
|
|
@@ -6203,7 +6221,7 @@ var NetworkRow = memo2(function NetworkRow2({
|
|
|
6203
6221
|
"--start": entry.startedAt - origin,
|
|
6204
6222
|
"--dur": pending ? `calc(var(--now) - ${entry.startedAt - origin})` : entry.duration
|
|
6205
6223
|
},
|
|
6206
|
-
children: /* @__PURE__ */
|
|
6224
|
+
children: /* @__PURE__ */ jsx23(
|
|
6207
6225
|
"div",
|
|
6208
6226
|
{
|
|
6209
6227
|
className: `absolute inset-y-0.5 rounded-sm ${barClass(entry)}`,
|
|
@@ -6233,19 +6251,19 @@ function NetworkList({
|
|
|
6233
6251
|
return () => window.clearInterval(id);
|
|
6234
6252
|
}, [hasPending]);
|
|
6235
6253
|
const timeline = buildTimeline(visible, now);
|
|
6236
|
-
return /* @__PURE__ */
|
|
6237
|
-
/* @__PURE__ */
|
|
6254
|
+
return /* @__PURE__ */ jsxs13(Fragment9, { children: [
|
|
6255
|
+
/* @__PURE__ */ jsxs13(
|
|
6238
6256
|
"div",
|
|
6239
6257
|
{
|
|
6240
6258
|
className: `${ROW_GRID} border-b border-line px-3 py-1.5 text-[10px] tracking-wide text-fg-tertiary uppercase`,
|
|
6241
6259
|
children: [
|
|
6242
|
-
/* @__PURE__ */
|
|
6243
|
-
/* @__PURE__ */
|
|
6244
|
-
/* @__PURE__ */
|
|
6245
|
-
/* @__PURE__ */
|
|
6246
|
-
/* @__PURE__ */
|
|
6247
|
-
/* @__PURE__ */
|
|
6248
|
-
/* @__PURE__ */
|
|
6260
|
+
/* @__PURE__ */ jsx23("span", { children: "Method" }),
|
|
6261
|
+
/* @__PURE__ */ jsx23("span", { children: "Path" }),
|
|
6262
|
+
/* @__PURE__ */ jsx23("span", { className: "text-end", children: "Status" }),
|
|
6263
|
+
/* @__PURE__ */ jsx23("span", { className: "text-end", children: "Time" }),
|
|
6264
|
+
/* @__PURE__ */ jsxs13("span", { className: "flex justify-between normal-case tabular-nums", children: [
|
|
6265
|
+
/* @__PURE__ */ jsx23("span", { children: "0" }),
|
|
6266
|
+
/* @__PURE__ */ jsxs13("span", { children: [
|
|
6249
6267
|
Math.round(timeline.span),
|
|
6250
6268
|
"ms"
|
|
6251
6269
|
] })
|
|
@@ -6253,11 +6271,11 @@ function NetworkList({
|
|
|
6253
6271
|
]
|
|
6254
6272
|
}
|
|
6255
6273
|
),
|
|
6256
|
-
/* @__PURE__ */
|
|
6274
|
+
/* @__PURE__ */ jsx23(
|
|
6257
6275
|
"div",
|
|
6258
6276
|
{
|
|
6259
6277
|
className: `min-h-0 scrollbar-slim scroll-fade overflow-auto ${selectedOpen ? "max-h-[40%] shrink-0 border-b border-line" : "flex-1"}`,
|
|
6260
|
-
children: visible.length === 0 ? /* @__PURE__ */
|
|
6278
|
+
children: visible.length === 0 ? /* @__PURE__ */ jsx23("p", { className: "p-3 text-fg-tertiary", children: total === 0 ? "No requests yet. API calls show up here as they happen." : "No requests match the filter." }) : /* @__PURE__ */ jsx23(
|
|
6261
6279
|
Listbox,
|
|
6262
6280
|
{
|
|
6263
6281
|
"aria-label": "Requests",
|
|
@@ -6268,7 +6286,7 @@ function NetworkList({
|
|
|
6268
6286
|
"--span": timeline.span,
|
|
6269
6287
|
"--now": now - timeline.start
|
|
6270
6288
|
},
|
|
6271
|
-
children: visible.map((entry) => /* @__PURE__ */
|
|
6289
|
+
children: visible.map((entry) => /* @__PURE__ */ jsx23(
|
|
6272
6290
|
NetworkRow,
|
|
6273
6291
|
{
|
|
6274
6292
|
entry,
|
|
@@ -6311,10 +6329,10 @@ function NetworkPanel() {
|
|
|
6311
6329
|
}, [entries, query, errorsOnly, methods]);
|
|
6312
6330
|
const selected = selectedId ? entries.find((e) => String(e.id) === selectedId) ?? null : null;
|
|
6313
6331
|
const failed = entries.reduce((n, e) => isFailed(e) ? n + 1 : n, 0);
|
|
6314
|
-
return /* @__PURE__ */
|
|
6315
|
-
/* @__PURE__ */
|
|
6316
|
-
/* @__PURE__ */
|
|
6317
|
-
/* @__PURE__ */
|
|
6332
|
+
return /* @__PURE__ */ jsxs13("div", { className: "flex min-h-0 flex-1 flex-col", children: [
|
|
6333
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2 border-b border-line px-3 py-2", children: [
|
|
6334
|
+
/* @__PURE__ */ jsx23("span", { className: "text-fg tabular-nums", children: visible.length === entries.length ? `${entries.length} ${entries.length === 1 ? "request" : "requests"}` : `${visible.length} / ${entries.length} ${entries.length === 1 ? "request" : "requests"}` }),
|
|
6335
|
+
/* @__PURE__ */ jsx23(
|
|
6318
6336
|
Input,
|
|
6319
6337
|
{
|
|
6320
6338
|
"aria-label": "Filter requests",
|
|
@@ -6324,7 +6342,7 @@ function NetworkPanel() {
|
|
|
6324
6342
|
className: "ms-auto h-7 w-56 min-w-0 rounded-md border border-line bg-hover-subtle px-2 text-xs text-fg placeholder:text-fg-disabled focus-visible:outline-2 focus-visible:outline-focus"
|
|
6325
6343
|
}
|
|
6326
6344
|
),
|
|
6327
|
-
/* @__PURE__ */
|
|
6345
|
+
/* @__PURE__ */ jsx23(
|
|
6328
6346
|
Button,
|
|
6329
6347
|
{
|
|
6330
6348
|
"aria-label": "Clear requests",
|
|
@@ -6333,12 +6351,12 @@ function NetworkPanel() {
|
|
|
6333
6351
|
clearNetworkLog();
|
|
6334
6352
|
setSelectedId(null);
|
|
6335
6353
|
},
|
|
6336
|
-
children: /* @__PURE__ */
|
|
6354
|
+
children: /* @__PURE__ */ jsx23(TrashIcon2, { className: "size-3.5", "aria-hidden": "true" })
|
|
6337
6355
|
}
|
|
6338
6356
|
)
|
|
6339
6357
|
] }),
|
|
6340
|
-
/* @__PURE__ */
|
|
6341
|
-
/* @__PURE__ */
|
|
6358
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex flex-wrap items-center gap-1.5 border-b border-line px-3 py-1.5", children: [
|
|
6359
|
+
/* @__PURE__ */ jsxs13(
|
|
6342
6360
|
Toggle,
|
|
6343
6361
|
{
|
|
6344
6362
|
"aria-label": "Errors only",
|
|
@@ -6347,11 +6365,11 @@ function NetworkPanel() {
|
|
|
6347
6365
|
className: chipClass,
|
|
6348
6366
|
children: [
|
|
6349
6367
|
"Errors",
|
|
6350
|
-
/* @__PURE__ */
|
|
6368
|
+
/* @__PURE__ */ jsx23("span", { className: "tabular-nums", children: failed })
|
|
6351
6369
|
]
|
|
6352
6370
|
}
|
|
6353
6371
|
),
|
|
6354
|
-
/* @__PURE__ */
|
|
6372
|
+
/* @__PURE__ */ jsx23(
|
|
6355
6373
|
ToggleGroup,
|
|
6356
6374
|
{
|
|
6357
6375
|
"aria-label": "Filter by method",
|
|
@@ -6359,11 +6377,11 @@ function NetworkPanel() {
|
|
|
6359
6377
|
value: methods,
|
|
6360
6378
|
onValueChange: setMethods,
|
|
6361
6379
|
className: "flex flex-wrap items-center gap-1.5",
|
|
6362
|
-
children: FILTER_METHODS.map((method) => /* @__PURE__ */
|
|
6380
|
+
children: FILTER_METHODS.map((method) => /* @__PURE__ */ jsx23(Toggle, { value: method, className: chipClass, children: method }, method))
|
|
6363
6381
|
}
|
|
6364
6382
|
)
|
|
6365
6383
|
] }),
|
|
6366
|
-
/* @__PURE__ */
|
|
6384
|
+
/* @__PURE__ */ jsx23(
|
|
6367
6385
|
NetworkList,
|
|
6368
6386
|
{
|
|
6369
6387
|
visible,
|
|
@@ -6373,32 +6391,32 @@ function NetworkPanel() {
|
|
|
6373
6391
|
selectedOpen: selected !== null
|
|
6374
6392
|
}
|
|
6375
6393
|
),
|
|
6376
|
-
selected ? /* @__PURE__ */
|
|
6394
|
+
selected ? /* @__PURE__ */ jsx23(EntryDetail2, { entry: selected }, selected.id) : null
|
|
6377
6395
|
] });
|
|
6378
6396
|
}
|
|
6379
6397
|
|
|
6380
6398
|
// src/plugins/network/index.tsx
|
|
6381
|
-
import { Fragment as Fragment10, jsx as
|
|
6399
|
+
import { Fragment as Fragment10, jsx as jsx24 } from "react/jsx-runtime";
|
|
6382
6400
|
function NetworkBadge() {
|
|
6383
6401
|
const { total, failed } = useNetworkSummary();
|
|
6384
|
-
return total > 0 ? /* @__PURE__ */
|
|
6402
|
+
return total > 0 ? /* @__PURE__ */ jsx24(
|
|
6385
6403
|
"span",
|
|
6386
6404
|
{
|
|
6387
6405
|
className: `min-w-4 text-[10px] tabular-nums ${failed > 0 ? "text-danger-fg" : "text-fg"}`,
|
|
6388
|
-
children: /* @__PURE__ */
|
|
6406
|
+
children: /* @__PURE__ */ jsx24(MorphText, { children: total })
|
|
6389
6407
|
}
|
|
6390
6408
|
) : null;
|
|
6391
6409
|
}
|
|
6392
6410
|
function NetworkHint() {
|
|
6393
6411
|
const { failed } = useNetworkSummary();
|
|
6394
|
-
return /* @__PURE__ */
|
|
6412
|
+
return /* @__PURE__ */ jsx24(Fragment10, { children: failed > 0 ? ` \xB7 ${failed} failed` : "" });
|
|
6395
6413
|
}
|
|
6396
6414
|
function network(options = {}) {
|
|
6397
6415
|
return definePlugin({
|
|
6398
6416
|
id: "network",
|
|
6399
6417
|
name: "Network",
|
|
6400
6418
|
label: "Network requests",
|
|
6401
|
-
icon: /* @__PURE__ */
|
|
6419
|
+
icon: /* @__PURE__ */ jsx24(NetworkIcon, { className: "size-4", "aria-hidden": "true" }),
|
|
6402
6420
|
install() {
|
|
6403
6421
|
installNetworkLog(options);
|
|
6404
6422
|
},
|
|
@@ -6464,7 +6482,7 @@ import {
|
|
|
6464
6482
|
SmartphoneIcon,
|
|
6465
6483
|
TabletIcon
|
|
6466
6484
|
} from "lucide-react";
|
|
6467
|
-
import { Fragment as Fragment11, jsx as
|
|
6485
|
+
import { Fragment as Fragment11, jsx as jsx25, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
6468
6486
|
var FRAME_PADDING = { x: 32, top: 24, bottom: 88 };
|
|
6469
6487
|
function registerShortcuts() {
|
|
6470
6488
|
const offs = VIEWPORTS.map(
|
|
@@ -6492,7 +6510,7 @@ function ViewportItem() {
|
|
|
6492
6510
|
const state3 = useViewportState();
|
|
6493
6511
|
const preset = presetOf(state3);
|
|
6494
6512
|
const activeId = preset?.id ?? "full";
|
|
6495
|
-
return /* @__PURE__ */
|
|
6513
|
+
return /* @__PURE__ */ jsx25("div", { className: "relative flex items-center", children: /* @__PURE__ */ jsx25(
|
|
6496
6514
|
ToggleGroup,
|
|
6497
6515
|
{
|
|
6498
6516
|
"aria-label": "Viewport",
|
|
@@ -6502,14 +6520,14 @@ function ViewportItem() {
|
|
|
6502
6520
|
if (value) selectViewport(value);
|
|
6503
6521
|
},
|
|
6504
6522
|
className: "flex items-center gap-0.5",
|
|
6505
|
-
children: VIEWPORTS.map((v) => /* @__PURE__ */
|
|
6506
|
-
/* @__PURE__ */
|
|
6523
|
+
children: VIEWPORTS.map((v) => /* @__PURE__ */ jsxs14(Tooltip, { shortcut: v.keys, children: [
|
|
6524
|
+
/* @__PURE__ */ jsxs14(
|
|
6507
6525
|
TooltipTrigger,
|
|
6508
6526
|
{
|
|
6509
|
-
render: /* @__PURE__ */
|
|
6510
|
-
className: `${toolbarItemClass} px-3 data-pressed:text-fg-inverse data-pressed:hover:bg-transparent`,
|
|
6527
|
+
render: /* @__PURE__ */ jsx25(Toggle, { value: v.id, "aria-label": v.label }),
|
|
6528
|
+
className: `${toolbarItemClass} px-3 max-sm:px-1.5 data-pressed:text-fg-inverse data-pressed:[&_svg]:text-fg-inverse! data-pressed:hover:bg-transparent`,
|
|
6511
6529
|
children: [
|
|
6512
|
-
v.id === activeId ? /* @__PURE__ */
|
|
6530
|
+
v.id === activeId ? /* @__PURE__ */ jsx25(
|
|
6513
6531
|
motion3.span,
|
|
6514
6532
|
{
|
|
6515
6533
|
layoutId: "devbelt-viewport-pill",
|
|
@@ -6518,18 +6536,19 @@ function ViewportItem() {
|
|
|
6518
6536
|
className: "pointer-events-none absolute inset-0 -z-10 rounded-full bg-inverse shadow-sm"
|
|
6519
6537
|
}
|
|
6520
6538
|
) : null,
|
|
6521
|
-
v.
|
|
6539
|
+
/* @__PURE__ */ jsx25(ViewportGlyph, { id: v.id, className: "size-4 sm:hidden" }),
|
|
6540
|
+
/* @__PURE__ */ jsx25("span", { className: "max-sm:hidden", children: v.label })
|
|
6522
6541
|
]
|
|
6523
6542
|
}
|
|
6524
6543
|
),
|
|
6525
|
-
/* @__PURE__ */
|
|
6544
|
+
/* @__PURE__ */ jsxs14(TooltipContent, { side: "top", sideOffset: 8, className: tooltipClass, children: [
|
|
6526
6545
|
v.label,
|
|
6527
|
-
v.width ? /* @__PURE__ */
|
|
6546
|
+
v.width ? /* @__PURE__ */ jsxs14("span", { className: "text-fg-tertiary tabular-nums", children: [
|
|
6528
6547
|
v.width,
|
|
6529
6548
|
"\xD7",
|
|
6530
6549
|
v.height
|
|
6531
6550
|
] }) : null,
|
|
6532
|
-
/* @__PURE__ */
|
|
6551
|
+
/* @__PURE__ */ jsx25(TooltipShortcut, { className: kbdClass })
|
|
6533
6552
|
] })
|
|
6534
6553
|
] }, v.id))
|
|
6535
6554
|
}
|
|
@@ -6540,13 +6559,13 @@ function ViewportOverlay() {
|
|
|
6540
6559
|
const preset = presetOf(state3);
|
|
6541
6560
|
const scale = useFrameScale(preset?.width, preset?.height);
|
|
6542
6561
|
const { hud, src } = state3;
|
|
6543
|
-
return /* @__PURE__ */
|
|
6544
|
-
preset?.width && preset.height && src ? /* @__PURE__ */
|
|
6562
|
+
return /* @__PURE__ */ jsxs14(Fragment11, { children: [
|
|
6563
|
+
preset?.width && preset.height && src ? /* @__PURE__ */ jsx25(
|
|
6545
6564
|
"div",
|
|
6546
6565
|
{
|
|
6547
6566
|
className: "fixed inset-0 z-[9000] flex items-start justify-center overflow-hidden bg-surface-raised",
|
|
6548
6567
|
style: { paddingTop: FRAME_PADDING.top },
|
|
6549
|
-
children: /* @__PURE__ */
|
|
6568
|
+
children: /* @__PURE__ */ jsx25(
|
|
6550
6569
|
"div",
|
|
6551
6570
|
{
|
|
6552
6571
|
className: "overflow-hidden rounded-xl bg-page shadow-2xl ring-1 ring-line-strong",
|
|
@@ -6554,7 +6573,7 @@ function ViewportOverlay() {
|
|
|
6554
6573
|
width: preset.width * scale,
|
|
6555
6574
|
height: preset.height * scale
|
|
6556
6575
|
},
|
|
6557
|
-
children: /* @__PURE__ */
|
|
6576
|
+
children: /* @__PURE__ */ jsx25(
|
|
6558
6577
|
"iframe",
|
|
6559
6578
|
{
|
|
6560
6579
|
ref: setFrame,
|
|
@@ -6574,13 +6593,13 @@ function ViewportOverlay() {
|
|
|
6574
6593
|
)
|
|
6575
6594
|
}
|
|
6576
6595
|
) : null,
|
|
6577
|
-
hud ? /* @__PURE__ */
|
|
6596
|
+
hud ? /* @__PURE__ */ jsx25(
|
|
6578
6597
|
"div",
|
|
6579
6598
|
{
|
|
6580
6599
|
"aria-hidden": "true",
|
|
6581
6600
|
"data-devbelt-hud": true,
|
|
6582
6601
|
className: "pointer-events-none fixed inset-0 z-[10001] grid place-items-center",
|
|
6583
|
-
children: /* @__PURE__ */
|
|
6602
|
+
children: /* @__PURE__ */ jsxs14(
|
|
6584
6603
|
motion3.div,
|
|
6585
6604
|
{
|
|
6586
6605
|
initial: { opacity: 0, scale: 0.9 },
|
|
@@ -6588,8 +6607,8 @@ function ViewportOverlay() {
|
|
|
6588
6607
|
transition: hud.leaving ? spring.slow.exit : spring.slow,
|
|
6589
6608
|
className: "flex flex-col items-center gap-1 rounded-2xl bg-surface-overlay px-6 py-4 text-fg shadow-2xl ring-1 ring-line backdrop-blur-md",
|
|
6590
6609
|
children: [
|
|
6591
|
-
/* @__PURE__ */
|
|
6592
|
-
/* @__PURE__ */
|
|
6610
|
+
/* @__PURE__ */ jsx25("span", { className: "text-2xl font-semibold tracking-tight", children: hud.label }),
|
|
6611
|
+
/* @__PURE__ */ jsx25("span", { className: "text-sm text-fg-secondary tabular-nums", children: hud.size })
|
|
6593
6612
|
]
|
|
6594
6613
|
}
|
|
6595
6614
|
)
|
|
@@ -6606,21 +6625,25 @@ var VIEWPORT_ICONS = {
|
|
|
6606
6625
|
pc: MonitorIcon,
|
|
6607
6626
|
custom: RulerIcon
|
|
6608
6627
|
};
|
|
6628
|
+
function ViewportGlyph({ id, className }) {
|
|
6629
|
+
const Icon = VIEWPORT_ICONS[id] ?? MonitorIcon;
|
|
6630
|
+
return /* @__PURE__ */ jsx25(Icon, { className, "aria-hidden": "true" });
|
|
6631
|
+
}
|
|
6609
6632
|
function ViewportMenuSection() {
|
|
6610
6633
|
const state3 = useViewportState();
|
|
6611
|
-
return /* @__PURE__ */
|
|
6634
|
+
return /* @__PURE__ */ jsxs14(
|
|
6612
6635
|
MenuRadioGroup,
|
|
6613
6636
|
{
|
|
6614
6637
|
name: "viewport",
|
|
6615
6638
|
value: presetOf(state3)?.id ?? "full",
|
|
6616
6639
|
onValueChange: selectViewport,
|
|
6617
6640
|
children: [
|
|
6618
|
-
/* @__PURE__ */
|
|
6641
|
+
/* @__PURE__ */ jsx25(MenuGroupLabel, { className: menuLabelClass, children: "Viewport" }),
|
|
6619
6642
|
VIEWPORTS.map((v) => {
|
|
6620
6643
|
const Icon = VIEWPORT_ICONS[v.id] ?? MonitorIcon;
|
|
6621
|
-
return /* @__PURE__ */
|
|
6622
|
-
/* @__PURE__ */
|
|
6623
|
-
/* @__PURE__ */
|
|
6644
|
+
return /* @__PURE__ */ jsxs14(MenuRadioItem, { value: v.id, className: menuItemClass, children: [
|
|
6645
|
+
/* @__PURE__ */ jsx25(MenuItemIndicator, { keepMounted: true, className: menuIndicatorClass, children: /* @__PURE__ */ jsx25(CheckIcon4, { className: "size-3.5", "aria-hidden": "true" }) }),
|
|
6646
|
+
/* @__PURE__ */ jsx25(Icon, { className: menuIconClass, "aria-hidden": "true" }),
|
|
6624
6647
|
v.label
|
|
6625
6648
|
] }, v.id);
|
|
6626
6649
|
})
|
|
@@ -6631,20 +6654,20 @@ function ViewportMenuSection() {
|
|
|
6631
6654
|
function ViewportStatus() {
|
|
6632
6655
|
const preset = presetOf(useViewportState());
|
|
6633
6656
|
const scale = useFrameScale(preset?.width, preset?.height);
|
|
6634
|
-
return preset?.width ? /* @__PURE__ */
|
|
6657
|
+
return preset?.width ? /* @__PURE__ */ jsx25("span", { className: "px-2 text-fg tabular-nums", children: /* @__PURE__ */ jsx25(MorphText, { children: `${preset.width}\xD7${preset.height}${scale < 1 ? ` \xB7 ${Math.round(scale * 100)}%` : ""}` }) }) : null;
|
|
6635
6658
|
}
|
|
6636
6659
|
function ViewportChip() {
|
|
6637
6660
|
const preset = presetOf(useViewportState());
|
|
6638
|
-
return /* @__PURE__ */
|
|
6639
|
-
/* @__PURE__ */
|
|
6640
|
-
preset?.width ? /* @__PURE__ */
|
|
6661
|
+
return /* @__PURE__ */ jsxs14(Fragment11, { children: [
|
|
6662
|
+
/* @__PURE__ */ jsx25(MorphText, { children: preset?.label ?? "Full" }),
|
|
6663
|
+
preset?.width ? /* @__PURE__ */ jsx25(MorphText, { className: "text-fg-secondary tabular-nums", children: `${preset.width}\xD7${preset.height}` }) : null
|
|
6641
6664
|
] });
|
|
6642
6665
|
}
|
|
6643
6666
|
function viewport() {
|
|
6644
6667
|
return definePlugin({
|
|
6645
6668
|
id: "viewport",
|
|
6646
6669
|
name: "Viewport",
|
|
6647
|
-
icon: /* @__PURE__ */
|
|
6670
|
+
icon: /* @__PURE__ */ jsx25(MonitorSmartphoneIcon, { className: "size-4", "aria-hidden": "true" }),
|
|
6648
6671
|
separatorAfter: true,
|
|
6649
6672
|
install() {
|
|
6650
6673
|
const offShortcuts = registerShortcuts();
|
|
@@ -6762,7 +6785,7 @@ function resolveBreakpoint(width, breakpoints = DEFAULT_BREAKPOINTS, base = BASE
|
|
|
6762
6785
|
}
|
|
6763
6786
|
|
|
6764
6787
|
// src/plugins/breakpoint/index.tsx
|
|
6765
|
-
import { Fragment as Fragment12, jsx as
|
|
6788
|
+
import { Fragment as Fragment12, jsx as jsx26, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
6766
6789
|
var OUTLINE_ATTR = "data-devbelt-outline";
|
|
6767
6790
|
var SKIPPED = ["devbelt-root", "[data-devbelt]", "[data-devbelt-window]"];
|
|
6768
6791
|
var OUTLINE_CSS = `*${SKIPPED.map((s) => `:not(${s}):not(${s} *)`).join("")}{outline:1px solid rgba(239,68,68,.6)!important;outline-offset:-1px!important}`;
|
|
@@ -6825,9 +6848,9 @@ function breakpoint(options = {}) {
|
|
|
6825
6848
|
const offs = [document, getFrameDocument()].filter((doc) => Boolean(doc)).map(applyOutline);
|
|
6826
6849
|
return () => offs.forEach((off) => off());
|
|
6827
6850
|
}, [on2, active, src, frameVersion]);
|
|
6828
|
-
return /* @__PURE__ */
|
|
6829
|
-
/* @__PURE__ */
|
|
6830
|
-
/* @__PURE__ */
|
|
6851
|
+
return /* @__PURE__ */ jsxs15(Fragment12, { children: [
|
|
6852
|
+
/* @__PURE__ */ jsx26("span", { className: "px-2 text-fg tabular-nums", children: /* @__PURE__ */ jsx26(MorphText, { children: describe(width) }) }),
|
|
6853
|
+
/* @__PURE__ */ jsx26(
|
|
6831
6854
|
"button",
|
|
6832
6855
|
{
|
|
6833
6856
|
type: "button",
|
|
@@ -6836,19 +6859,19 @@ function breakpoint(options = {}) {
|
|
|
6836
6859
|
"aria-pressed": on2,
|
|
6837
6860
|
onClick: () => outline.set(!on2),
|
|
6838
6861
|
className: `${toolbarItemClass} px-3 ${on2 ? "bg-inverse text-fg-inverse hover:bg-inverse [&_svg]:text-fg-inverse" : ""}`,
|
|
6839
|
-
children: /* @__PURE__ */
|
|
6862
|
+
children: /* @__PURE__ */ jsx26(SquareDashedIcon, { className: "size-4", "aria-hidden": "true" })
|
|
6840
6863
|
}
|
|
6841
6864
|
)
|
|
6842
6865
|
] });
|
|
6843
6866
|
}
|
|
6844
6867
|
function BreakpointChip() {
|
|
6845
|
-
return /* @__PURE__ */
|
|
6868
|
+
return /* @__PURE__ */ jsx26("span", { className: "tabular-nums", children: /* @__PURE__ */ jsx26(MorphText, { children: describe(useWidth()) }) });
|
|
6846
6869
|
}
|
|
6847
6870
|
return definePlugin({
|
|
6848
6871
|
id: "breakpoint",
|
|
6849
6872
|
name: "Breakpoint",
|
|
6850
6873
|
pinned: false,
|
|
6851
|
-
icon: /* @__PURE__ */
|
|
6874
|
+
icon: /* @__PURE__ */ jsx26(RulerIcon2, { className: "size-4", "aria-hidden": "true" }),
|
|
6852
6875
|
Item: BreakpointItem,
|
|
6853
6876
|
ChipStatus: BreakpointChip,
|
|
6854
6877
|
agentTools: [
|
|
@@ -7032,7 +7055,7 @@ function saveFile(blob, name) {
|
|
|
7032
7055
|
}
|
|
7033
7056
|
|
|
7034
7057
|
// src/plugins/capture/index.tsx
|
|
7035
|
-
import { Fragment as Fragment13, jsx as
|
|
7058
|
+
import { Fragment as Fragment13, jsx as jsx27, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
7036
7059
|
var flash2 = createFlash();
|
|
7037
7060
|
var HIDE_KEY = "capture-hide";
|
|
7038
7061
|
var savedHide = (() => {
|
|
@@ -7152,7 +7175,7 @@ function Elapsed({ since }) {
|
|
|
7152
7175
|
const timer = window.setInterval(() => setNow(Date.now()), 500);
|
|
7153
7176
|
return () => window.clearInterval(timer);
|
|
7154
7177
|
}, []);
|
|
7155
|
-
return /* @__PURE__ */
|
|
7178
|
+
return /* @__PURE__ */ jsx27(MorphText, { className: "tabular-nums", children: clock(now - since) });
|
|
7156
7179
|
}
|
|
7157
7180
|
var MIN_REGION = 8;
|
|
7158
7181
|
var boxOf = (a, b) => ({
|
|
@@ -7191,8 +7214,8 @@ function makeRegionOverlay(scale) {
|
|
|
7191
7214
|
void screenshot("copy", false, scale, area);
|
|
7192
7215
|
}
|
|
7193
7216
|
};
|
|
7194
|
-
return /* @__PURE__ */
|
|
7195
|
-
/* @__PURE__ */
|
|
7217
|
+
return /* @__PURE__ */ jsxs16(Fragment13, { children: [
|
|
7218
|
+
/* @__PURE__ */ jsx27(
|
|
7196
7219
|
"div",
|
|
7197
7220
|
{
|
|
7198
7221
|
"data-react-grab-ignore": true,
|
|
@@ -7214,19 +7237,19 @@ function makeRegionOverlay(scale) {
|
|
|
7214
7237
|
onPointerCancel: () => setDrag(null)
|
|
7215
7238
|
}
|
|
7216
7239
|
),
|
|
7217
|
-
box ? /* @__PURE__ */
|
|
7240
|
+
box ? /* @__PURE__ */ jsx27(
|
|
7218
7241
|
"div",
|
|
7219
7242
|
{
|
|
7220
7243
|
"data-react-grab-ignore": true,
|
|
7221
7244
|
className: "pointer-events-none fixed z-[9999] border border-dashed border-accent bg-accent/10",
|
|
7222
7245
|
style: { left: box.x, top: box.y, width: box.width, height: box.height },
|
|
7223
|
-
children: /* @__PURE__ */
|
|
7246
|
+
children: /* @__PURE__ */ jsxs16("span", { className: "absolute -top-6 left-0 rounded bg-accent-strong px-1.5 py-0.5 font-mono text-[11px] leading-none whitespace-nowrap text-fg", children: [
|
|
7224
7247
|
Math.round(box.width),
|
|
7225
7248
|
"\xD7",
|
|
7226
7249
|
Math.round(box.height)
|
|
7227
7250
|
] })
|
|
7228
7251
|
}
|
|
7229
|
-
) : /* @__PURE__ */
|
|
7252
|
+
) : /* @__PURE__ */ jsx27(
|
|
7230
7253
|
"div",
|
|
7231
7254
|
{
|
|
7232
7255
|
"data-react-grab-ignore": true,
|
|
@@ -7243,12 +7266,12 @@ function makeItem({ scale, hideWhileRecording = true }) {
|
|
|
7243
7266
|
const current = useRecording();
|
|
7244
7267
|
const picking = useSelecting();
|
|
7245
7268
|
const line = flash2.use();
|
|
7246
|
-
return /* @__PURE__ */
|
|
7247
|
-
/* @__PURE__ */
|
|
7248
|
-
/* @__PURE__ */
|
|
7269
|
+
return /* @__PURE__ */ jsxs16(Fragment13, { children: [
|
|
7270
|
+
/* @__PURE__ */ jsxs16(Tooltip, { children: [
|
|
7271
|
+
/* @__PURE__ */ jsx27(
|
|
7249
7272
|
TooltipTrigger,
|
|
7250
7273
|
{
|
|
7251
|
-
render: /* @__PURE__ */
|
|
7274
|
+
render: /* @__PURE__ */ jsx27(
|
|
7252
7275
|
ToolbarButton,
|
|
7253
7276
|
{
|
|
7254
7277
|
"aria-label": "Take screenshot",
|
|
@@ -7256,16 +7279,16 @@ function makeItem({ scale, hideWhileRecording = true }) {
|
|
|
7256
7279
|
}
|
|
7257
7280
|
),
|
|
7258
7281
|
className: toolbarItemClass,
|
|
7259
|
-
children: /* @__PURE__ */
|
|
7282
|
+
children: /* @__PURE__ */ jsx27(CameraIcon, { className: "size-4", "aria-hidden": "true" })
|
|
7260
7283
|
}
|
|
7261
7284
|
),
|
|
7262
|
-
/* @__PURE__ */
|
|
7285
|
+
/* @__PURE__ */ jsx27(TooltipContent, { side: "top", sideOffset: 8, className: tooltipClass, children: "Copy a screenshot of the page" })
|
|
7263
7286
|
] }),
|
|
7264
|
-
/* @__PURE__ */
|
|
7265
|
-
/* @__PURE__ */
|
|
7287
|
+
/* @__PURE__ */ jsxs16(Tooltip, { children: [
|
|
7288
|
+
/* @__PURE__ */ jsx27(
|
|
7266
7289
|
TooltipTrigger,
|
|
7267
7290
|
{
|
|
7268
|
-
render: /* @__PURE__ */
|
|
7291
|
+
render: /* @__PURE__ */ jsx27(
|
|
7269
7292
|
ToolbarButton,
|
|
7270
7293
|
{
|
|
7271
7294
|
"aria-label": "Screenshot a region",
|
|
@@ -7274,16 +7297,16 @@ function makeItem({ scale, hideWhileRecording = true }) {
|
|
|
7274
7297
|
}
|
|
7275
7298
|
),
|
|
7276
7299
|
className: `${toolbarItemClass} ${picking ? "bg-accent/20 [&_svg]:text-accent-fg" : ""}`,
|
|
7277
|
-
children: /* @__PURE__ */
|
|
7300
|
+
children: /* @__PURE__ */ jsx27(CropIcon, { className: "size-4", "aria-hidden": "true" })
|
|
7278
7301
|
}
|
|
7279
7302
|
),
|
|
7280
|
-
/* @__PURE__ */
|
|
7303
|
+
/* @__PURE__ */ jsx27(TooltipContent, { side: "top", sideOffset: 8, className: tooltipClass, children: "Drag over the page to copy a screenshot of that region" })
|
|
7281
7304
|
] }),
|
|
7282
|
-
canRecord() ? /* @__PURE__ */
|
|
7283
|
-
/* @__PURE__ */
|
|
7305
|
+
canRecord() ? /* @__PURE__ */ jsxs16(Tooltip, { children: [
|
|
7306
|
+
/* @__PURE__ */ jsx27(
|
|
7284
7307
|
TooltipTrigger,
|
|
7285
7308
|
{
|
|
7286
|
-
render: /* @__PURE__ */
|
|
7309
|
+
render: /* @__PURE__ */ jsx27(
|
|
7287
7310
|
ToolbarButton,
|
|
7288
7311
|
{
|
|
7289
7312
|
"aria-label": current ? "Stop recording" : "Record screen",
|
|
@@ -7292,15 +7315,15 @@ function makeItem({ scale, hideWhileRecording = true }) {
|
|
|
7292
7315
|
}
|
|
7293
7316
|
),
|
|
7294
7317
|
className: `${toolbarItemClass} ${current ? "text-danger-fg" : ""}`,
|
|
7295
|
-
children: current ? /* @__PURE__ */
|
|
7296
|
-
/* @__PURE__ */
|
|
7297
|
-
/* @__PURE__ */
|
|
7298
|
-
] }) : /* @__PURE__ */
|
|
7318
|
+
children: current ? /* @__PURE__ */ jsxs16(Fragment13, { children: [
|
|
7319
|
+
/* @__PURE__ */ jsx27(SquareIcon, { className: "size-3.5 fill-current", "aria-hidden": "true" }),
|
|
7320
|
+
/* @__PURE__ */ jsx27(Elapsed, { since: current.startedAt })
|
|
7321
|
+
] }) : /* @__PURE__ */ jsx27(CircleIcon, { className: "size-4", "aria-hidden": "true" })
|
|
7299
7322
|
}
|
|
7300
7323
|
),
|
|
7301
|
-
/* @__PURE__ */
|
|
7324
|
+
/* @__PURE__ */ jsx27(TooltipContent, { side: "top", sideOffset: 8, className: tooltipClass, children: current ? "Stop and save the recording" : "Record the screen as a video" })
|
|
7302
7325
|
] }) : null,
|
|
7303
|
-
line ? /* @__PURE__ */
|
|
7326
|
+
line ? /* @__PURE__ */ jsx27("span", { className: "px-2 text-fg", children: /* @__PURE__ */ jsx27(MorphText, { children: line }) }) : null
|
|
7304
7327
|
] });
|
|
7305
7328
|
};
|
|
7306
7329
|
}
|
|
@@ -7309,69 +7332,69 @@ function makeMenuSection({ scale, hideWhileRecording = true }) {
|
|
|
7309
7332
|
const api = useToolbar();
|
|
7310
7333
|
const current = useRecording();
|
|
7311
7334
|
const hide = useSavedHide() ?? hideWhileRecording;
|
|
7312
|
-
return /* @__PURE__ */
|
|
7313
|
-
/* @__PURE__ */
|
|
7314
|
-
/* @__PURE__ */
|
|
7335
|
+
return /* @__PURE__ */ jsxs16(MenuGroup, { children: [
|
|
7336
|
+
/* @__PURE__ */ jsx27(MenuGroupLabel, { className: menuLabelClass, children: "Capture" }),
|
|
7337
|
+
/* @__PURE__ */ jsxs16(
|
|
7315
7338
|
MenuItem,
|
|
7316
7339
|
{
|
|
7317
7340
|
value: "capture:copy",
|
|
7318
7341
|
className: menuItemClass,
|
|
7319
7342
|
onSelect: () => void screenshot("copy", false, scale),
|
|
7320
7343
|
children: [
|
|
7321
|
-
/* @__PURE__ */
|
|
7344
|
+
/* @__PURE__ */ jsx27(CopyIcon4, { className: menuIconClass, "aria-hidden": "true" }),
|
|
7322
7345
|
"Copy screenshot"
|
|
7323
7346
|
]
|
|
7324
7347
|
}
|
|
7325
7348
|
),
|
|
7326
|
-
/* @__PURE__ */
|
|
7349
|
+
/* @__PURE__ */ jsxs16(
|
|
7327
7350
|
MenuItem,
|
|
7328
7351
|
{
|
|
7329
7352
|
value: "capture:region",
|
|
7330
7353
|
className: menuItemClass,
|
|
7331
7354
|
onSelect: () => setSelecting(true),
|
|
7332
7355
|
children: [
|
|
7333
|
-
/* @__PURE__ */
|
|
7356
|
+
/* @__PURE__ */ jsx27(CropIcon, { className: menuIconClass, "aria-hidden": "true" }),
|
|
7334
7357
|
"Screenshot a region"
|
|
7335
7358
|
]
|
|
7336
7359
|
}
|
|
7337
7360
|
),
|
|
7338
|
-
/* @__PURE__ */
|
|
7361
|
+
/* @__PURE__ */ jsxs16(
|
|
7339
7362
|
MenuItem,
|
|
7340
7363
|
{
|
|
7341
7364
|
value: "capture:save",
|
|
7342
7365
|
className: menuItemClass,
|
|
7343
7366
|
onSelect: () => void screenshot("download", false, scale),
|
|
7344
7367
|
children: [
|
|
7345
|
-
/* @__PURE__ */
|
|
7368
|
+
/* @__PURE__ */ jsx27(DownloadIcon, { className: menuIconClass, "aria-hidden": "true" }),
|
|
7346
7369
|
"Save screenshot"
|
|
7347
7370
|
]
|
|
7348
7371
|
}
|
|
7349
7372
|
),
|
|
7350
|
-
/* @__PURE__ */
|
|
7373
|
+
/* @__PURE__ */ jsxs16(
|
|
7351
7374
|
MenuItem,
|
|
7352
7375
|
{
|
|
7353
7376
|
value: "capture:full",
|
|
7354
7377
|
className: menuItemClass,
|
|
7355
7378
|
onSelect: () => void screenshot("download", true, scale),
|
|
7356
7379
|
children: [
|
|
7357
|
-
/* @__PURE__ */
|
|
7380
|
+
/* @__PURE__ */ jsx27(ArrowDownToLineIcon, { className: menuIconClass, "aria-hidden": "true" }),
|
|
7358
7381
|
"Save full-page screenshot"
|
|
7359
7382
|
]
|
|
7360
7383
|
}
|
|
7361
7384
|
),
|
|
7362
|
-
canRecord() ? /* @__PURE__ */
|
|
7385
|
+
canRecord() ? /* @__PURE__ */ jsxs16(
|
|
7363
7386
|
MenuItem,
|
|
7364
7387
|
{
|
|
7365
7388
|
value: "capture:record",
|
|
7366
7389
|
className: menuItemClass,
|
|
7367
7390
|
onSelect: () => void toggleRecording(api, hideWhileRecording),
|
|
7368
7391
|
children: [
|
|
7369
|
-
current ? /* @__PURE__ */
|
|
7392
|
+
current ? /* @__PURE__ */ jsx27(SquareIcon, { className: `${menuIconClass} fill-current`, "aria-hidden": "true" }) : /* @__PURE__ */ jsx27(CircleIcon, { className: menuIconClass, "aria-hidden": "true" }),
|
|
7370
7393
|
current ? "Stop recording" : "Record screen"
|
|
7371
7394
|
]
|
|
7372
7395
|
}
|
|
7373
7396
|
) : null,
|
|
7374
|
-
canRecord() ? /* @__PURE__ */
|
|
7397
|
+
canRecord() ? /* @__PURE__ */ jsxs16(
|
|
7375
7398
|
MenuCheckboxItem,
|
|
7376
7399
|
{
|
|
7377
7400
|
value: "capture:hide",
|
|
@@ -7379,8 +7402,8 @@ function makeMenuSection({ scale, hideWhileRecording = true }) {
|
|
|
7379
7402
|
onCheckedChange: setSavedHide,
|
|
7380
7403
|
className: menuItemClass,
|
|
7381
7404
|
children: [
|
|
7382
|
-
/* @__PURE__ */
|
|
7383
|
-
/* @__PURE__ */
|
|
7405
|
+
/* @__PURE__ */ jsx27(MenuItemIndicator, { keepMounted: true, className: menuIndicatorClass, children: /* @__PURE__ */ jsx27(CheckIcon5, { className: "size-3.5", "aria-hidden": "true" }) }),
|
|
7406
|
+
/* @__PURE__ */ jsx27(EyeOffIcon, { className: menuIconClass, "aria-hidden": "true" }),
|
|
7384
7407
|
"Hide toolbar while recording"
|
|
7385
7408
|
]
|
|
7386
7409
|
}
|
|
@@ -7390,9 +7413,9 @@ function makeMenuSection({ scale, hideWhileRecording = true }) {
|
|
|
7390
7413
|
}
|
|
7391
7414
|
function CaptureChip() {
|
|
7392
7415
|
const current = useRecording();
|
|
7393
|
-
return current ? /* @__PURE__ */
|
|
7394
|
-
/* @__PURE__ */
|
|
7395
|
-
/* @__PURE__ */
|
|
7416
|
+
return current ? /* @__PURE__ */ jsxs16("span", { className: "inline-flex items-center gap-1 text-danger-fg", children: [
|
|
7417
|
+
/* @__PURE__ */ jsx27(CircleIcon, { className: "size-2.5 fill-current", "aria-hidden": "true" }),
|
|
7418
|
+
/* @__PURE__ */ jsx27(Elapsed, { since: current.startedAt })
|
|
7396
7419
|
] }) : null;
|
|
7397
7420
|
}
|
|
7398
7421
|
function capture(options = {}) {
|
|
@@ -7400,7 +7423,7 @@ function capture(options = {}) {
|
|
|
7400
7423
|
id: "capture",
|
|
7401
7424
|
name: "Screenshot & recording",
|
|
7402
7425
|
label: "Screenshot and recording",
|
|
7403
|
-
icon: /* @__PURE__ */
|
|
7426
|
+
icon: /* @__PURE__ */ jsx27(CameraIcon, { className: "size-4", "aria-hidden": "true" }),
|
|
7404
7427
|
Item: makeItem(options),
|
|
7405
7428
|
Overlay: makeRegionOverlay(options.scale),
|
|
7406
7429
|
MenuSection: makeMenuSection(options),
|
|
@@ -7660,9 +7683,17 @@ function pollCookiesWhileOpen() {
|
|
|
7660
7683
|
|
|
7661
7684
|
// src/plugins/storage/panel.tsx
|
|
7662
7685
|
import { useEffect as useEffect8, useState as useState10 } from "react";
|
|
7663
|
-
import {
|
|
7664
|
-
|
|
7686
|
+
import {
|
|
7687
|
+
CheckIcon as CheckIcon6,
|
|
7688
|
+
EyeIcon,
|
|
7689
|
+
EyeOffIcon as EyeOffIcon2,
|
|
7690
|
+
PencilIcon,
|
|
7691
|
+
Trash2Icon as Trash2Icon2,
|
|
7692
|
+
XIcon as XIcon2
|
|
7693
|
+
} from "lucide-react";
|
|
7694
|
+
import { Fragment as Fragment14, jsx as jsx28, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
7665
7695
|
var PREVIEW_CHARS = 80;
|
|
7696
|
+
var ROW_CAP = 200;
|
|
7666
7697
|
var DETAIL_CHARS = 240;
|
|
7667
7698
|
function preview(value) {
|
|
7668
7699
|
return value.length <= PREVIEW_CHARS ? value : `${value.slice(0, PREVIEW_CHARS)}\u2026`;
|
|
@@ -7685,21 +7716,28 @@ function EntryDetail3({
|
|
|
7685
7716
|
const full = hidden ? redact(entry.key, entry.value, pattern) : formatStorageValue(entry.value);
|
|
7686
7717
|
const clipped = !hidden && !expanded && full.length > DETAIL_CHARS;
|
|
7687
7718
|
const text3 = clipped ? `${full.slice(0, DETAIL_CHARS)}\u2026` : full;
|
|
7688
|
-
return /* @__PURE__ */
|
|
7689
|
-
|
|
7690
|
-
|
|
7691
|
-
|
|
7692
|
-
|
|
7693
|
-
|
|
7694
|
-
|
|
7695
|
-
className:
|
|
7696
|
-
|
|
7697
|
-
|
|
7698
|
-
|
|
7699
|
-
|
|
7700
|
-
|
|
7701
|
-
|
|
7702
|
-
|
|
7719
|
+
return /* @__PURE__ */ jsxs17(
|
|
7720
|
+
"section",
|
|
7721
|
+
{
|
|
7722
|
+
"aria-label": `Details for ${entry.key}`,
|
|
7723
|
+
className: "mt-3 border-t border-line pt-3",
|
|
7724
|
+
children: [
|
|
7725
|
+
/* @__PURE__ */ jsxs17("div", { className: "mb-1 flex items-center gap-2", children: [
|
|
7726
|
+
/* @__PURE__ */ jsx28("h3", { className: "font-semibold text-fg", children: entry.key }),
|
|
7727
|
+
!hidden && full.length > DETAIL_CHARS ? /* @__PURE__ */ jsx28(
|
|
7728
|
+
Button,
|
|
7729
|
+
{
|
|
7730
|
+
"aria-label": expanded ? "Collapse value" : "Expand value",
|
|
7731
|
+
className: `${textButtonClass} text-fg-secondary`,
|
|
7732
|
+
onClick: () => setExpanded((current) => !current),
|
|
7733
|
+
children: expanded ? "Collapse" : "Expand"
|
|
7734
|
+
}
|
|
7735
|
+
) : null
|
|
7736
|
+
] }),
|
|
7737
|
+
hidden ? /* @__PURE__ */ jsx28("p", { className: "font-mono text-[11px] break-all text-fg-secondary", children: text3 }) : /* @__PURE__ */ jsx28(JsonCode, { code: text3 })
|
|
7738
|
+
]
|
|
7739
|
+
}
|
|
7740
|
+
);
|
|
7703
7741
|
}
|
|
7704
7742
|
var TAB_KEY = "storage-tab";
|
|
7705
7743
|
function readSavedTab(enabled) {
|
|
@@ -7720,7 +7758,9 @@ function StoragePanel({
|
|
|
7720
7758
|
}) {
|
|
7721
7759
|
const enabled = resolveStorageStores(stores);
|
|
7722
7760
|
const [state3, setState] = useState10(readStorageState);
|
|
7723
|
-
const [active, setActive] = useState10(
|
|
7761
|
+
const [active, setActive] = useState10(
|
|
7762
|
+
() => readSavedTab(enabled)
|
|
7763
|
+
);
|
|
7724
7764
|
const { entries, unavailable } = state3;
|
|
7725
7765
|
const [revealed, setRevealed] = useState10(null);
|
|
7726
7766
|
const [confirming, setConfirming] = useState10(null);
|
|
@@ -7732,7 +7772,9 @@ function StoragePanel({
|
|
|
7732
7772
|
const [newKey, setNewKey] = useState10("");
|
|
7733
7773
|
const [newValue, setNewValue] = useState10("");
|
|
7734
7774
|
useEffect8(() => {
|
|
7735
|
-
const unsubscribe = subscribeStorageChanges(
|
|
7775
|
+
const unsubscribe = subscribeStorageChanges(
|
|
7776
|
+
() => setState(readStorageState())
|
|
7777
|
+
);
|
|
7736
7778
|
const stopPolling = pollCookiesWhileOpen();
|
|
7737
7779
|
return () => {
|
|
7738
7780
|
unsubscribe();
|
|
@@ -7770,218 +7812,325 @@ function StoragePanel({
|
|
|
7770
7812
|
}
|
|
7771
7813
|
refresh();
|
|
7772
7814
|
};
|
|
7773
|
-
return /* @__PURE__ */
|
|
7774
|
-
/* @__PURE__ */
|
|
7775
|
-
error ? /* @__PURE__ */
|
|
7776
|
-
|
|
7777
|
-
|
|
7778
|
-
|
|
7779
|
-
|
|
7780
|
-
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
|
|
7815
|
+
return /* @__PURE__ */ jsxs17("div", { className: "flex min-h-0 flex-1 flex-col", children: [
|
|
7816
|
+
/* @__PURE__ */ jsx28("div", { className: "flex items-center gap-2 border-b border-line px-3 py-2", children: /* @__PURE__ */ jsx28("p", { className: "min-w-0 flex-1 text-fg-secondary", children: HTTP_ONLY_NOTE }) }),
|
|
7817
|
+
error ? /* @__PURE__ */ jsx28(
|
|
7818
|
+
"p",
|
|
7819
|
+
{
|
|
7820
|
+
role: "alert",
|
|
7821
|
+
className: "border-b border-line px-3 py-1 text-danger-fg",
|
|
7822
|
+
children: error
|
|
7823
|
+
}
|
|
7824
|
+
) : null,
|
|
7825
|
+
store ? /* @__PURE__ */ jsxs17(
|
|
7826
|
+
Tabs,
|
|
7827
|
+
{
|
|
7828
|
+
value: store,
|
|
7829
|
+
onValueChange: selectStore,
|
|
7830
|
+
className: "flex min-h-0 flex-1 flex-col",
|
|
7831
|
+
children: [
|
|
7832
|
+
/* @__PURE__ */ jsx28(
|
|
7833
|
+
TabsList,
|
|
7786
7834
|
{
|
|
7787
|
-
"aria-label": "
|
|
7788
|
-
|
|
7789
|
-
value:
|
|
7790
|
-
onChange: (ev) => setQuery(ev.target.value),
|
|
7791
|
-
className: "mb-2 h-7 w-full min-w-0 rounded-md border border-line bg-hover-subtle px-2 text-xs text-fg placeholder:text-fg-disabled focus-visible:outline-2 focus-visible:outline-focus"
|
|
7835
|
+
"aria-label": "Stores",
|
|
7836
|
+
className: "flex gap-1 border-b border-line px-2 py-1.5",
|
|
7837
|
+
children: enabled.map((item) => /* @__PURE__ */ jsx28(TabsTab, { value: item, className: tabClass2, children: TITLE[item] }, item))
|
|
7792
7838
|
}
|
|
7793
7839
|
),
|
|
7794
|
-
/* @__PURE__ */
|
|
7795
|
-
|
|
7796
|
-
|
|
7797
|
-
|
|
7798
|
-
|
|
7799
|
-
|
|
7800
|
-
|
|
7801
|
-
|
|
7802
|
-
|
|
7803
|
-
|
|
7804
|
-
|
|
7805
|
-
|
|
7806
|
-
|
|
7807
|
-
"aria-label": `Confirm clearing ${TITLE[store]}`,
|
|
7808
|
-
className: `${textButtonClass} text-danger-fg`,
|
|
7809
|
-
onClick: () => {
|
|
7810
|
-
setConfirming(null);
|
|
7811
|
-
attempt(() => clearStorageStore(store));
|
|
7812
|
-
},
|
|
7813
|
-
children: "Clear"
|
|
7814
|
-
}
|
|
7815
|
-
),
|
|
7816
|
-
/* @__PURE__ */ jsx27(
|
|
7817
|
-
Button,
|
|
7818
|
-
{
|
|
7819
|
-
"aria-label": `Cancel clearing ${TITLE[store]}`,
|
|
7820
|
-
className: `${textButtonClass} text-fg-secondary`,
|
|
7821
|
-
onClick: () => setConfirming(null),
|
|
7822
|
-
children: "Cancel"
|
|
7823
|
-
}
|
|
7824
|
-
)
|
|
7825
|
-
] }) : all.length > 0 ? /* @__PURE__ */ jsx27(
|
|
7826
|
-
Button,
|
|
7827
|
-
{
|
|
7828
|
-
"aria-label": `Clear ${TITLE[store]}`,
|
|
7829
|
-
className: `${textButtonClass} ml-auto text-fg-secondary`,
|
|
7830
|
-
onClick: () => setConfirming(store),
|
|
7831
|
-
children: "Clear"
|
|
7832
|
-
}
|
|
7833
|
-
) : null,
|
|
7834
|
-
unavailable[store] === void 0 && !adding ? /* @__PURE__ */ jsx27(Button, { "aria-label": "Add entry", className: `${textButtonClass} text-fg-secondary`, onClick: () => setAdding(true), children: "Add" }) : null
|
|
7835
|
-
] }),
|
|
7836
|
-
adding && unavailable[store] === void 0 ? /* @__PURE__ */ jsxs16("div", { className: "mb-2 flex flex-wrap items-center gap-2", children: [
|
|
7837
|
-
/* @__PURE__ */ jsx27(
|
|
7838
|
-
Input,
|
|
7839
|
-
{
|
|
7840
|
-
"aria-label": "New key",
|
|
7841
|
-
placeholder: "Key",
|
|
7842
|
-
value: newKey,
|
|
7843
|
-
onChange: (ev) => setNewKey(ev.target.value),
|
|
7844
|
-
className: "h-7 min-w-0 flex-1 rounded-md border border-line bg-hover-subtle px-2 text-xs text-fg",
|
|
7845
|
-
autoFocus: true
|
|
7846
|
-
}
|
|
7847
|
-
),
|
|
7848
|
-
/* @__PURE__ */ jsx27(
|
|
7849
|
-
Input,
|
|
7850
|
-
{
|
|
7851
|
-
"aria-label": "New value",
|
|
7852
|
-
placeholder: "Value",
|
|
7853
|
-
value: newValue,
|
|
7854
|
-
onChange: (ev) => setNewValue(ev.target.value),
|
|
7855
|
-
onKeyDown: (ev) => {
|
|
7856
|
-
if (ev.key === "Enter") saveNew();
|
|
7857
|
-
if (ev.key === "Escape") setAdding(false);
|
|
7858
|
-
},
|
|
7859
|
-
className: "h-7 min-w-0 flex-1 rounded-md border border-line bg-hover-subtle px-2 text-xs text-fg"
|
|
7860
|
-
}
|
|
7861
|
-
),
|
|
7862
|
-
/* @__PURE__ */ jsx27(Button, { "aria-label": "Save new entry", className: `${textButtonClass} text-fg`, onClick: saveNew, children: "Save" }),
|
|
7863
|
-
/* @__PURE__ */ jsx27(
|
|
7864
|
-
Button,
|
|
7865
|
-
{
|
|
7866
|
-
"aria-label": "Cancel new entry",
|
|
7867
|
-
className: `${textButtonClass} text-fg-secondary`,
|
|
7868
|
-
onClick: () => {
|
|
7869
|
-
setAdding(false);
|
|
7870
|
-
setNewKey("");
|
|
7871
|
-
setNewValue("");
|
|
7872
|
-
},
|
|
7873
|
-
children: "Cancel"
|
|
7874
|
-
}
|
|
7875
|
-
)
|
|
7876
|
-
] }) : null,
|
|
7877
|
-
unavailable[store] !== void 0 ? /* @__PURE__ */ jsxs16("p", { role: "status", className: "text-warning-fg", children: [
|
|
7878
|
-
"Unavailable: ",
|
|
7879
|
-
unavailable[store],
|
|
7880
|
-
". This is not an empty store."
|
|
7881
|
-
] }) : all.length === 0 ? /* @__PURE__ */ jsx27("p", { className: "text-fg-tertiary", children: "Empty." }) : list.length === 0 ? /* @__PURE__ */ jsx27("p", { className: "text-fg-tertiary", children: "No matches." }) : /* @__PURE__ */ jsx27("dl", { className: "grid grid-cols-[minmax(0,12rem)_minmax(0,1fr)_auto_auto] gap-x-3 gap-y-1 font-mono text-[11px]", children: list.map((e) => {
|
|
7882
|
-
const hidden = isRedacted2(e.key, pattern);
|
|
7883
|
-
const isRevealed = hidden && revealed?.store === e.store && revealed.key === e.key;
|
|
7884
|
-
const isEditing = editing?.store === e.store && editing.key === e.key;
|
|
7885
|
-
const save = () => attempt(() => {
|
|
7886
|
-
setStorageEntry(e.store, e.key, editing.draft);
|
|
7887
|
-
setEditing(null);
|
|
7888
|
-
});
|
|
7889
|
-
return /* @__PURE__ */ jsxs16("div", { className: "contents", children: [
|
|
7890
|
-
/* @__PURE__ */ jsx27("dt", { className: "truncate", title: e.key, children: /* @__PURE__ */ jsx27(
|
|
7891
|
-
Button,
|
|
7892
|
-
{
|
|
7893
|
-
"aria-pressed": selected?.store === e.store && selected.key === e.key,
|
|
7894
|
-
className: `${textButtonClass} max-w-full truncate text-fg`,
|
|
7895
|
-
onClick: () => setSelected(
|
|
7896
|
-
selected?.store === e.store && selected.key === e.key ? null : { store: e.store, key: e.key }
|
|
7897
|
-
),
|
|
7898
|
-
children: e.key
|
|
7899
|
-
}
|
|
7900
|
-
) }),
|
|
7901
|
-
/* @__PURE__ */ jsx27("dd", { className: "m-0 break-all text-fg-secondary", children: isEditing ? /* @__PURE__ */ jsx27(
|
|
7902
|
-
Input,
|
|
7903
|
-
{
|
|
7904
|
-
"aria-label": `Value for ${e.key}`,
|
|
7905
|
-
placeholder: isRedacted2(e.key, pattern) ? "New value (current is hidden)" : "",
|
|
7906
|
-
value: editing.draft,
|
|
7907
|
-
onChange: (ev) => setEditing({ ...editing, draft: ev.target.value }),
|
|
7908
|
-
onKeyDown: (ev) => {
|
|
7909
|
-
if (ev.key === "Enter") save();
|
|
7910
|
-
if (ev.key === "Escape") setEditing(null);
|
|
7911
|
-
},
|
|
7912
|
-
autoFocus: true
|
|
7913
|
-
}
|
|
7914
|
-
) : hidden && !isRevealed ? redact(e.key, e.value, pattern) : preview(e.value) }),
|
|
7915
|
-
/* @__PURE__ */ jsx27("dd", { className: "m-0 tabular-nums text-fg-tertiary", children: e.size }),
|
|
7916
|
-
/* @__PURE__ */ jsxs16("dd", { className: "m-0 flex gap-1", children: [
|
|
7917
|
-
isEditing ? /* @__PURE__ */ jsxs16(Fragment14, { children: [
|
|
7918
|
-
/* @__PURE__ */ jsx27(Button, { "aria-label": `Save ${e.key}`, className: iconButtonClass, onClick: save, children: /* @__PURE__ */ jsx27(CheckIcon6, { className: "size-3.5", "aria-hidden": "true" }) }),
|
|
7919
|
-
/* @__PURE__ */ jsx27(
|
|
7920
|
-
Button,
|
|
7921
|
-
{
|
|
7922
|
-
"aria-label": `Cancel editing ${e.key}`,
|
|
7923
|
-
className: iconButtonClass,
|
|
7924
|
-
onClick: () => setEditing(null),
|
|
7925
|
-
children: /* @__PURE__ */ jsx27(XIcon2, { className: "size-3.5", "aria-hidden": "true" })
|
|
7926
|
-
}
|
|
7927
|
-
)
|
|
7928
|
-
] }) : /* @__PURE__ */ jsxs16(Fragment14, { children: [
|
|
7929
|
-
hidden ? /* @__PURE__ */ jsx27(
|
|
7930
|
-
Button,
|
|
7840
|
+
/* @__PURE__ */ jsx28(
|
|
7841
|
+
TabsPanel,
|
|
7842
|
+
{
|
|
7843
|
+
value: store,
|
|
7844
|
+
className: "min-h-0 flex-1 scrollbar-slim scroll-fade overflow-auto p-3",
|
|
7845
|
+
children: (() => {
|
|
7846
|
+
const all = entries.filter((e) => e.store === store);
|
|
7847
|
+
const needle = query.trim().toLowerCase();
|
|
7848
|
+
const list = needle ? all.filter((e) => e.key.toLowerCase().includes(needle)) : all;
|
|
7849
|
+
const section = /* @__PURE__ */ jsxs17("section", { "aria-label": TITLE[store], className: "mb-4", children: [
|
|
7850
|
+
store === "cookies" ? /* @__PURE__ */ jsx28("p", { className: "mb-2 text-fg-secondary", children: COOKIE_PATH_NOTE }) : null,
|
|
7851
|
+
/* @__PURE__ */ jsx28(
|
|
7852
|
+
Input,
|
|
7931
7853
|
{
|
|
7932
|
-
"aria-label":
|
|
7933
|
-
|
|
7934
|
-
|
|
7935
|
-
|
|
7854
|
+
"aria-label": "Filter entries",
|
|
7855
|
+
placeholder: "Filter by key",
|
|
7856
|
+
value: query,
|
|
7857
|
+
onChange: (ev) => setQuery(ev.target.value),
|
|
7858
|
+
className: "mb-2 h-7 w-full min-w-0 rounded-md border border-line bg-hover-subtle px-2 text-xs text-fg placeholder:text-fg-disabled focus-visible:outline-2 focus-visible:outline-focus"
|
|
7936
7859
|
}
|
|
7937
|
-
)
|
|
7938
|
-
/* @__PURE__ */
|
|
7939
|
-
|
|
7860
|
+
),
|
|
7861
|
+
/* @__PURE__ */ jsxs17("div", { className: "mb-1 flex items-center gap-2", children: [
|
|
7862
|
+
/* @__PURE__ */ jsxs17("h3", { className: "font-semibold text-fg", children: [
|
|
7863
|
+
TITLE[store],
|
|
7864
|
+
" ",
|
|
7865
|
+
/* @__PURE__ */ jsx28("span", { className: "tabular-nums text-fg-tertiary", children: list.length })
|
|
7866
|
+
] }),
|
|
7867
|
+
all.length > 0 && confirming === store ? /* @__PURE__ */ jsxs17("span", { className: "ml-auto flex items-center gap-2 text-fg", children: [
|
|
7868
|
+
"Clear all of ",
|
|
7869
|
+
TITLE[store],
|
|
7870
|
+
"?",
|
|
7871
|
+
/* @__PURE__ */ jsx28(
|
|
7872
|
+
Button,
|
|
7873
|
+
{
|
|
7874
|
+
"aria-label": `Confirm clearing ${TITLE[store]}`,
|
|
7875
|
+
className: `${textButtonClass} text-danger-fg`,
|
|
7876
|
+
onClick: () => {
|
|
7877
|
+
setConfirming(null);
|
|
7878
|
+
attempt(() => clearStorageStore(store));
|
|
7879
|
+
},
|
|
7880
|
+
children: "Clear"
|
|
7881
|
+
}
|
|
7882
|
+
),
|
|
7883
|
+
/* @__PURE__ */ jsx28(
|
|
7884
|
+
Button,
|
|
7885
|
+
{
|
|
7886
|
+
"aria-label": `Cancel clearing ${TITLE[store]}`,
|
|
7887
|
+
className: `${textButtonClass} text-fg-secondary`,
|
|
7888
|
+
onClick: () => setConfirming(null),
|
|
7889
|
+
children: "Cancel"
|
|
7890
|
+
}
|
|
7891
|
+
)
|
|
7892
|
+
] }) : all.length > 0 ? /* @__PURE__ */ jsx28(
|
|
7893
|
+
Button,
|
|
7894
|
+
{
|
|
7895
|
+
"aria-label": `Clear ${TITLE[store]}`,
|
|
7896
|
+
className: `${textButtonClass} ml-auto text-fg-secondary`,
|
|
7897
|
+
onClick: () => setConfirming(store),
|
|
7898
|
+
children: "Clear"
|
|
7899
|
+
}
|
|
7900
|
+
) : null,
|
|
7901
|
+
unavailable[store] === void 0 && !adding ? /* @__PURE__ */ jsx28(
|
|
7902
|
+
Button,
|
|
7903
|
+
{
|
|
7904
|
+
"aria-label": "Add entry",
|
|
7905
|
+
className: `${textButtonClass} text-fg-secondary`,
|
|
7906
|
+
onClick: () => setAdding(true),
|
|
7907
|
+
children: "Add"
|
|
7908
|
+
}
|
|
7909
|
+
) : null
|
|
7910
|
+
] }),
|
|
7911
|
+
adding && unavailable[store] === void 0 ? /* @__PURE__ */ jsxs17("div", { className: "mb-2 flex flex-wrap items-center gap-2", children: [
|
|
7912
|
+
/* @__PURE__ */ jsx28(
|
|
7913
|
+
Input,
|
|
7914
|
+
{
|
|
7915
|
+
"aria-label": "New key",
|
|
7916
|
+
placeholder: "Key",
|
|
7917
|
+
value: newKey,
|
|
7918
|
+
onChange: (ev) => setNewKey(ev.target.value),
|
|
7919
|
+
className: "h-7 min-w-0 flex-1 rounded-md border border-line bg-hover-subtle px-2 text-xs text-fg",
|
|
7920
|
+
autoFocus: true
|
|
7921
|
+
}
|
|
7922
|
+
),
|
|
7923
|
+
/* @__PURE__ */ jsx28(
|
|
7924
|
+
Input,
|
|
7925
|
+
{
|
|
7926
|
+
"aria-label": "New value",
|
|
7927
|
+
placeholder: "Value",
|
|
7928
|
+
value: newValue,
|
|
7929
|
+
onChange: (ev) => setNewValue(ev.target.value),
|
|
7930
|
+
onKeyDown: (ev) => {
|
|
7931
|
+
if (ev.key === "Enter") saveNew();
|
|
7932
|
+
if (ev.key === "Escape") setAdding(false);
|
|
7933
|
+
},
|
|
7934
|
+
className: "h-7 min-w-0 flex-1 rounded-md border border-line bg-hover-subtle px-2 text-xs text-fg"
|
|
7935
|
+
}
|
|
7936
|
+
),
|
|
7937
|
+
/* @__PURE__ */ jsx28(
|
|
7938
|
+
Button,
|
|
7939
|
+
{
|
|
7940
|
+
"aria-label": "Save new entry",
|
|
7941
|
+
className: `${textButtonClass} text-fg`,
|
|
7942
|
+
onClick: saveNew,
|
|
7943
|
+
children: "Save"
|
|
7944
|
+
}
|
|
7945
|
+
),
|
|
7946
|
+
/* @__PURE__ */ jsx28(
|
|
7947
|
+
Button,
|
|
7948
|
+
{
|
|
7949
|
+
"aria-label": "Cancel new entry",
|
|
7950
|
+
className: `${textButtonClass} text-fg-secondary`,
|
|
7951
|
+
onClick: () => {
|
|
7952
|
+
setAdding(false);
|
|
7953
|
+
setNewKey("");
|
|
7954
|
+
setNewValue("");
|
|
7955
|
+
},
|
|
7956
|
+
children: "Cancel"
|
|
7957
|
+
}
|
|
7958
|
+
)
|
|
7959
|
+
] }) : null,
|
|
7960
|
+
unavailable[store] !== void 0 ? /* @__PURE__ */ jsxs17("p", { role: "status", className: "text-warning-fg", children: [
|
|
7961
|
+
"Unavailable: ",
|
|
7962
|
+
unavailable[store],
|
|
7963
|
+
". This is not an empty store."
|
|
7964
|
+
] }) : all.length === 0 ? /* @__PURE__ */ jsx28("p", { className: "text-fg-tertiary", children: "Empty." }) : list.length === 0 ? /* @__PURE__ */ jsx28("p", { className: "text-fg-tertiary", children: "No matches." }) : /* @__PURE__ */ jsxs17(Fragment14, { children: [
|
|
7965
|
+
/* @__PURE__ */ jsx28("dl", { className: "grid grid-cols-[minmax(0,12rem)_minmax(0,1fr)_auto_auto] gap-x-3 gap-y-1 font-mono text-[11px]", children: list.slice(0, ROW_CAP).map((e) => {
|
|
7966
|
+
const hidden = isRedacted2(e.key, pattern);
|
|
7967
|
+
const isRevealed = hidden && revealed?.store === e.store && revealed.key === e.key;
|
|
7968
|
+
const isEditing = editing?.store === e.store && editing.key === e.key;
|
|
7969
|
+
const save = () => attempt(() => {
|
|
7970
|
+
setStorageEntry(e.store, e.key, editing.draft);
|
|
7971
|
+
setEditing(null);
|
|
7972
|
+
});
|
|
7973
|
+
return /* @__PURE__ */ jsxs17("div", { className: "contents", children: [
|
|
7974
|
+
/* @__PURE__ */ jsx28("dt", { className: "min-w-0", children: /* @__PURE__ */ jsx28(
|
|
7975
|
+
Button,
|
|
7976
|
+
{
|
|
7977
|
+
"aria-pressed": selected?.store === e.store && selected.key === e.key,
|
|
7978
|
+
className: `${textButtonClass} max-w-full text-fg`,
|
|
7979
|
+
onClick: () => setSelected(
|
|
7980
|
+
selected?.store === e.store && selected.key === e.key ? null : { store: e.store, key: e.key }
|
|
7981
|
+
),
|
|
7982
|
+
children: /* @__PURE__ */ jsx28(MiddleTruncate, { text: e.key })
|
|
7983
|
+
}
|
|
7984
|
+
) }),
|
|
7985
|
+
/* @__PURE__ */ jsx28("dd", { className: "m-0 break-all text-fg-secondary", children: isEditing ? /* @__PURE__ */ jsx28(
|
|
7986
|
+
Input,
|
|
7987
|
+
{
|
|
7988
|
+
"aria-label": `Value for ${e.key}`,
|
|
7989
|
+
placeholder: isRedacted2(e.key, pattern) ? "New value (current is hidden)" : "",
|
|
7990
|
+
value: editing.draft,
|
|
7991
|
+
onChange: (ev) => setEditing({
|
|
7992
|
+
...editing,
|
|
7993
|
+
draft: ev.target.value
|
|
7994
|
+
}),
|
|
7995
|
+
onKeyDown: (ev) => {
|
|
7996
|
+
if (ev.key === "Enter") save();
|
|
7997
|
+
if (ev.key === "Escape") setEditing(null);
|
|
7998
|
+
},
|
|
7999
|
+
autoFocus: true
|
|
8000
|
+
}
|
|
8001
|
+
) : hidden && !isRevealed ? redact(e.key, e.value, pattern) : preview(e.value) }),
|
|
8002
|
+
/* @__PURE__ */ jsx28("dd", { className: "m-0 tabular-nums text-fg-tertiary", children: e.size }),
|
|
8003
|
+
/* @__PURE__ */ jsxs17("dd", { className: "m-0 flex gap-1", children: [
|
|
8004
|
+
isEditing ? /* @__PURE__ */ jsxs17(Fragment14, { children: [
|
|
8005
|
+
/* @__PURE__ */ jsx28(
|
|
8006
|
+
Button,
|
|
8007
|
+
{
|
|
8008
|
+
"aria-label": `Save ${e.key}`,
|
|
8009
|
+
className: iconButtonClass,
|
|
8010
|
+
onClick: save,
|
|
8011
|
+
children: /* @__PURE__ */ jsx28(
|
|
8012
|
+
CheckIcon6,
|
|
8013
|
+
{
|
|
8014
|
+
className: "size-3.5",
|
|
8015
|
+
"aria-hidden": "true"
|
|
8016
|
+
}
|
|
8017
|
+
)
|
|
8018
|
+
}
|
|
8019
|
+
),
|
|
8020
|
+
/* @__PURE__ */ jsx28(
|
|
8021
|
+
Button,
|
|
8022
|
+
{
|
|
8023
|
+
"aria-label": `Cancel editing ${e.key}`,
|
|
8024
|
+
className: iconButtonClass,
|
|
8025
|
+
onClick: () => setEditing(null),
|
|
8026
|
+
children: /* @__PURE__ */ jsx28(
|
|
8027
|
+
XIcon2,
|
|
8028
|
+
{
|
|
8029
|
+
className: "size-3.5",
|
|
8030
|
+
"aria-hidden": "true"
|
|
8031
|
+
}
|
|
8032
|
+
)
|
|
8033
|
+
}
|
|
8034
|
+
)
|
|
8035
|
+
] }) : /* @__PURE__ */ jsxs17(Fragment14, { children: [
|
|
8036
|
+
hidden ? /* @__PURE__ */ jsx28(
|
|
8037
|
+
Button,
|
|
8038
|
+
{
|
|
8039
|
+
"aria-label": `${isRevealed ? "Hide" : "Reveal"} ${e.key}`,
|
|
8040
|
+
className: iconButtonClass,
|
|
8041
|
+
onClick: () => setRevealed(
|
|
8042
|
+
isRevealed ? null : { store: e.store, key: e.key }
|
|
8043
|
+
),
|
|
8044
|
+
children: isRevealed ? /* @__PURE__ */ jsx28(
|
|
8045
|
+
EyeOffIcon2,
|
|
8046
|
+
{
|
|
8047
|
+
className: "size-3.5",
|
|
8048
|
+
"aria-hidden": "true"
|
|
8049
|
+
}
|
|
8050
|
+
) : /* @__PURE__ */ jsx28(
|
|
8051
|
+
EyeIcon,
|
|
8052
|
+
{
|
|
8053
|
+
className: "size-3.5",
|
|
8054
|
+
"aria-hidden": "true"
|
|
8055
|
+
}
|
|
8056
|
+
)
|
|
8057
|
+
}
|
|
8058
|
+
) : null,
|
|
8059
|
+
/* @__PURE__ */ jsx28(
|
|
8060
|
+
Button,
|
|
8061
|
+
{
|
|
8062
|
+
"aria-label": `Edit ${e.key}`,
|
|
8063
|
+
className: iconButtonClass,
|
|
8064
|
+
onClick: () => setEditing({
|
|
8065
|
+
store: e.store,
|
|
8066
|
+
key: e.key,
|
|
8067
|
+
// A Redacted value is never put in the field.
|
|
8068
|
+
draft: isRedacted2(e.key, pattern) ? "" : e.value
|
|
8069
|
+
}),
|
|
8070
|
+
children: /* @__PURE__ */ jsx28(
|
|
8071
|
+
PencilIcon,
|
|
8072
|
+
{
|
|
8073
|
+
className: "size-3.5",
|
|
8074
|
+
"aria-hidden": "true"
|
|
8075
|
+
}
|
|
8076
|
+
)
|
|
8077
|
+
}
|
|
8078
|
+
)
|
|
8079
|
+
] }),
|
|
8080
|
+
/* @__PURE__ */ jsx28(
|
|
8081
|
+
Button,
|
|
8082
|
+
{
|
|
8083
|
+
"aria-label": `Delete ${e.key}`,
|
|
8084
|
+
className: iconButtonClass,
|
|
8085
|
+
onClick: () => attempt(
|
|
8086
|
+
() => deleteStorageEntry(e.store, e.key)
|
|
8087
|
+
),
|
|
8088
|
+
children: /* @__PURE__ */ jsx28(
|
|
8089
|
+
Trash2Icon2,
|
|
8090
|
+
{
|
|
8091
|
+
className: "size-3.5",
|
|
8092
|
+
"aria-hidden": "true"
|
|
8093
|
+
}
|
|
8094
|
+
)
|
|
8095
|
+
}
|
|
8096
|
+
)
|
|
8097
|
+
] })
|
|
8098
|
+
] }, e.key);
|
|
8099
|
+
}) }),
|
|
8100
|
+
list.length > ROW_CAP ? /* @__PURE__ */ jsxs17("p", { className: "text-fg-tertiary", children: [
|
|
8101
|
+
"Showing ",
|
|
8102
|
+
ROW_CAP,
|
|
8103
|
+
" of ",
|
|
8104
|
+
list.length,
|
|
8105
|
+
" entries. Search to narrow them down."
|
|
8106
|
+
] }) : null
|
|
8107
|
+
] })
|
|
8108
|
+
] });
|
|
8109
|
+
const open = selected?.store === store ? entries.find(
|
|
8110
|
+
(entry) => entry.store === store && entry.key === selected.key
|
|
8111
|
+
) : void 0;
|
|
8112
|
+
return /* @__PURE__ */ jsxs17(Fragment14, { children: [
|
|
8113
|
+
section,
|
|
8114
|
+
open ? /* @__PURE__ */ jsx28(
|
|
8115
|
+
EntryDetail3,
|
|
7940
8116
|
{
|
|
7941
|
-
|
|
7942
|
-
|
|
7943
|
-
|
|
7944
|
-
store: e.store,
|
|
7945
|
-
key: e.key,
|
|
7946
|
-
// A Redacted value is never put in the field.
|
|
7947
|
-
draft: isRedacted2(e.key, pattern) ? "" : e.value
|
|
7948
|
-
}),
|
|
7949
|
-
children: /* @__PURE__ */ jsx27(PencilIcon, { className: "size-3.5", "aria-hidden": "true" })
|
|
8117
|
+
entry: open,
|
|
8118
|
+
pattern,
|
|
8119
|
+
revealed: revealed?.store === open.store && revealed.key === open.key
|
|
7950
8120
|
}
|
|
7951
|
-
)
|
|
7952
|
-
] })
|
|
7953
|
-
|
|
7954
|
-
Button,
|
|
7955
|
-
{
|
|
7956
|
-
"aria-label": `Delete ${e.key}`,
|
|
7957
|
-
className: iconButtonClass,
|
|
7958
|
-
onClick: () => attempt(() => deleteStorageEntry(e.store, e.key)),
|
|
7959
|
-
children: /* @__PURE__ */ jsx27(Trash2Icon2, { className: "size-3.5", "aria-hidden": "true" })
|
|
7960
|
-
}
|
|
7961
|
-
)
|
|
7962
|
-
] })
|
|
7963
|
-
] }, e.key);
|
|
7964
|
-
}) })
|
|
7965
|
-
] });
|
|
7966
|
-
const open = selected?.store === store ? entries.find((entry) => entry.store === store && entry.key === selected.key) : void 0;
|
|
7967
|
-
return /* @__PURE__ */ jsxs16(Fragment14, { children: [
|
|
7968
|
-
section,
|
|
7969
|
-
open ? /* @__PURE__ */ jsx27(
|
|
7970
|
-
EntryDetail3,
|
|
7971
|
-
{
|
|
7972
|
-
entry: open,
|
|
7973
|
-
pattern,
|
|
7974
|
-
revealed: revealed?.store === open.store && revealed.key === open.key
|
|
8121
|
+
) : null
|
|
8122
|
+
] });
|
|
8123
|
+
})()
|
|
7975
8124
|
}
|
|
7976
|
-
)
|
|
7977
|
-
]
|
|
7978
|
-
}
|
|
7979
|
-
|
|
8125
|
+
)
|
|
8126
|
+
]
|
|
8127
|
+
}
|
|
8128
|
+
) : /* @__PURE__ */ jsx28("p", { className: "p-3 text-fg-tertiary", children: "No stores are enabled." })
|
|
7980
8129
|
] });
|
|
7981
8130
|
}
|
|
7982
8131
|
|
|
7983
8132
|
// src/plugins/storage/index.tsx
|
|
7984
|
-
import { jsx as
|
|
8133
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
7985
8134
|
function storeProp(stores) {
|
|
7986
8135
|
return {
|
|
7987
8136
|
type: "string",
|
|
@@ -8007,14 +8156,14 @@ function storage(options = {}) {
|
|
|
8007
8156
|
id: "storage",
|
|
8008
8157
|
name: "Storage",
|
|
8009
8158
|
label: "Storage",
|
|
8010
|
-
icon: /* @__PURE__ */
|
|
8159
|
+
icon: /* @__PURE__ */ jsx29(DatabaseIcon, { className: "size-4", "aria-hidden": "true" }),
|
|
8011
8160
|
install() {
|
|
8012
8161
|
return installStorageWatch();
|
|
8013
8162
|
},
|
|
8014
8163
|
window: {
|
|
8015
8164
|
title: "Storage",
|
|
8016
8165
|
size: { width: 640, height: 420, minWidth: 360, minHeight: 220 },
|
|
8017
|
-
Component: () => /* @__PURE__ */
|
|
8166
|
+
Component: () => /* @__PURE__ */ jsx29(StoragePanel, { pattern, stores })
|
|
8018
8167
|
},
|
|
8019
8168
|
debugSections: () => {
|
|
8020
8169
|
const { entries, unavailable } = readStorageState();
|
|
@@ -8163,4 +8312,4 @@ export {
|
|
|
8163
8312
|
storage,
|
|
8164
8313
|
defaultPlugins
|
|
8165
8314
|
};
|
|
8166
|
-
//# sourceMappingURL=chunk-
|
|
8315
|
+
//# sourceMappingURL=chunk-5QVD43AU.js.map
|