jazz-tools 0.18.36 → 0.18.38

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.
Files changed (32) hide show
  1. package/.turbo/turbo-build.log +55 -55
  2. package/CHANGELOG.md +24 -0
  3. package/dist/inspector/{custom-element-RBBL46TI.js → custom-element-QESCMFY7.js} +492 -409
  4. package/dist/inspector/custom-element-QESCMFY7.js.map +1 -0
  5. package/dist/inspector/index.js +459 -376
  6. package/dist/inspector/index.js.map +1 -1
  7. package/dist/inspector/register-custom-element.js +1 -1
  8. package/dist/inspector/ui/accordion.d.ts +8 -0
  9. package/dist/inspector/ui/accordion.d.ts.map +1 -0
  10. package/dist/inspector/ui/error-boundary.d.ts +19 -0
  11. package/dist/inspector/ui/error-boundary.d.ts.map +1 -0
  12. package/dist/inspector/ui/index.d.ts +1 -0
  13. package/dist/inspector/ui/index.d.ts.map +1 -1
  14. package/dist/inspector/ui/text.d.ts +1 -0
  15. package/dist/inspector/ui/text.d.ts.map +1 -1
  16. package/dist/inspector/viewer/history-view.d.ts.map +1 -1
  17. package/dist/inspector/viewer/page-stack.d.ts.map +1 -1
  18. package/dist/inspector/viewer/raw-data-card.d.ts.map +1 -1
  19. package/dist/tools/exports.d.ts +1 -1
  20. package/dist/tools/exports.d.ts.map +1 -1
  21. package/package.json +4 -4
  22. package/src/inspector/tests/viewer/history-view.test.tsx +114 -12
  23. package/src/inspector/ui/accordion.tsx +52 -0
  24. package/src/inspector/ui/error-boundary.tsx +51 -0
  25. package/src/inspector/ui/index.ts +1 -0
  26. package/src/inspector/ui/text.tsx +1 -0
  27. package/src/inspector/viewer/history-view.tsx +18 -11
  28. package/src/inspector/viewer/page-stack.tsx +11 -8
  29. package/src/inspector/viewer/raw-data-card.tsx +11 -11
  30. package/src/inspector/viewer/use-resolve-covalue.ts +2 -2
  31. package/src/tools/exports.ts +1 -0
  32. package/dist/inspector/custom-element-RBBL46TI.js.map +0 -1
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
 
3
3
  // src/inspector/index.tsx
4
- import React7 from "react";
4
+ import React8 from "react";
5
5
 
6
6
  // src/inspector/viewer/new-app.tsx
7
- import { styled as styled21 } from "goober";
8
- import { useState as useState12 } from "react";
7
+ import { styled as styled23 } from "goober";
8
+ import { useState as useState13 } from "react";
9
9
 
10
10
  // src/inspector/ui/button.tsx
11
11
  import { styled } from "goober";
@@ -180,10 +180,10 @@ var Breadcrumbs = ({
180
180
  };
181
181
 
182
182
  // src/inspector/viewer/page-stack.tsx
183
- import { styled as styled18 } from "goober";
183
+ import { styled as styled20 } from "goober";
184
184
 
185
185
  // src/inspector/viewer/page.tsx
186
- import { styled as styled17 } from "goober";
186
+ import { styled as styled18 } from "goober";
187
187
  import React5 from "react";
188
188
 
189
189
  // src/inspector/ui/badge.tsx
@@ -556,7 +556,7 @@ async function resolveCoValue(coValueId, node) {
556
556
  extendedType = "image";
557
557
  } else if (isAccount(snapshot)) {
558
558
  extendedType = "account";
559
- } else if (isGroup(snapshot)) {
559
+ } else if (value.core.isGroup()) {
560
560
  extendedType = "group";
561
561
  }
562
562
  }
@@ -585,7 +585,7 @@ function subscribeToCoValue(coValueId, node, callback) {
585
585
  extendedType = "image";
586
586
  } else if (isAccount(snapshot)) {
587
587
  extendedType = "account";
588
- } else if (isGroup(snapshot)) {
588
+ } else if (value.core.isGroup()) {
589
589
  extendedType = "group";
590
590
  }
591
591
  } else if (type === "costream") {
@@ -1202,125 +1202,13 @@ function GridView({
1202
1202
  }
1203
1203
 
1204
1204
  // src/inspector/viewer/raw-data-card.tsx
1205
- import { useEffect as useEffect4, useState as useState5 } from "react";
1206
- import { jsx as jsx18, jsxs as jsxs8 } from "react/jsx-runtime";
1207
- function CopyButton({ data }) {
1208
- const [copyCount, setCopyCount] = useState5(0);
1209
- const copied = copyCount > 0;
1210
- const stringifiedData = JSON.stringify(data);
1211
- useEffect4(() => {
1212
- if (copyCount > 0) {
1213
- const timeout = setTimeout(() => setCopyCount(0), 1e3);
1214
- return () => {
1215
- clearTimeout(timeout);
1216
- };
1217
- }
1218
- }, [copyCount]);
1219
- return /* @__PURE__ */ jsx18(
1220
- Button,
1221
- {
1222
- style: {
1223
- position: "absolute",
1224
- top: "10px",
1225
- right: "10px"
1226
- },
1227
- onClick: () => {
1228
- window.navigator.clipboard.writeText(stringifiedData).then(() => {
1229
- setCopyCount((count) => count + 1);
1230
- });
1231
- },
1232
- variant: "secondary",
1233
- children: copied ? "Copied" : "Copy"
1234
- }
1235
- );
1236
- }
1237
- function RawDataCard({ data }) {
1238
- return /* @__PURE__ */ jsxs8(Card, { style: { position: "relative" }, children: [
1239
- /* @__PURE__ */ jsxs8(CardHeader, { children: [
1240
- /* @__PURE__ */ jsx18(Text, { strong: true, children: "Raw data" }),
1241
- /* @__PURE__ */ jsx18(CopyButton, { data })
1242
- ] }),
1243
- /* @__PURE__ */ jsx18(CardBody, { children: /* @__PURE__ */ jsx18(ValueRenderer, { json: data }) })
1244
- ] });
1245
- }
1246
-
1247
- // src/inspector/viewer/account-view.tsx
1248
- import { Fragment as Fragment5, jsx as jsx19, jsxs as jsxs9 } from "react/jsx-runtime";
1249
- function AccountView({
1250
- data,
1251
- onNavigate,
1252
- node
1253
- }) {
1254
- const readableData = { ...data };
1255
- for (const key in readableData) {
1256
- if (key === "readKey" || key.startsWith("sealer_z") || key.startsWith("key_z")) {
1257
- delete readableData[key];
1258
- }
1259
- }
1260
- return /* @__PURE__ */ jsxs9(Fragment5, { children: [
1261
- /* @__PURE__ */ jsx19(GridView, { data: readableData, onNavigate, node }),
1262
- /* @__PURE__ */ jsx19(RawDataCard, { data })
1263
- ] });
1264
- }
1265
-
1266
- // src/inspector/viewer/co-plain-text-view.tsx
1267
- import { Fragment as Fragment6, jsx as jsx20, jsxs as jsxs10 } from "react/jsx-runtime";
1268
- function CoPlainTextView({ data }) {
1269
- if (!data) return;
1270
- return /* @__PURE__ */ jsxs10(Fragment6, { children: [
1271
- /* @__PURE__ */ jsx20("p", { children: Object.values(data).join("") }),
1272
- /* @__PURE__ */ jsx20(RawDataCard, { data })
1273
- ] });
1274
- }
1275
-
1276
- // src/inspector/viewer/group-view.tsx
1277
- import { useState as useState7 } from "react";
1278
-
1279
- // src/inspector/ui/table.tsx
1280
- import { styled as styled12 } from "goober";
1281
- import React4 from "react";
1282
- import { jsx as jsx21 } from "react/jsx-runtime";
1283
- var StyledTable = styled12("table")`
1284
- width: 100%;
1285
- `;
1286
- var StyledThead = styled12("thead")`
1287
- text-align: left;
1288
- border-bottom: 1px solid var(--j-border-color);
1289
- background-color: var(--j-neutral-100);
1290
-
1291
- @media (prefers-color-scheme: dark) {
1292
- background-color: var(--j-neutral-925);
1293
- }
1294
- `;
1295
- var StyledTbody = styled12("tbody")`
1296
- tr {
1297
- border-bottom: 1px solid var(--j-border-color);
1298
-
1299
- &:last-child {
1300
- border-bottom: none;
1301
- }
1302
- }
1303
- `;
1304
- var StyledTh = styled12("th")`
1305
- font-weight: 500;
1306
- padding: 0.5rem 0.75rem;
1307
- color: var(--j-text-color-strong);
1308
- `;
1309
- var StyledTd = styled12("td")`
1310
- padding: 0.5rem 0.75rem;
1311
- `;
1312
- var Table = React4.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ jsx21(StyledTable, { ref, ...props, children }));
1313
- var TableHead = React4.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ jsx21(StyledThead, { ref, ...props, children }));
1314
- var TableBody = React4.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ jsx21(StyledTbody, { ref, ...props, children }));
1315
- var TableRow = React4.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ jsx21("tr", { ref, ...props, children }));
1316
- var TableHeader = React4.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ jsx21(StyledTh, { ref, ...props, children }));
1317
- var TableCell = React4.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ jsx21(StyledTd, { ref, ...props, children }));
1205
+ import { useEffect as useEffect7, useState as useState7 } from "react";
1318
1206
 
1319
1207
  // src/inspector/ui/modal.tsx
1320
- import { styled as styled13 } from "goober";
1321
- import { forwardRef as forwardRef3, useEffect as useEffect5, useRef } from "react";
1322
- import { jsx as jsx22, jsxs as jsxs11 } from "react/jsx-runtime";
1323
- var ModalContent = styled13("dialog")`
1208
+ import { styled as styled12 } from "goober";
1209
+ import { forwardRef as forwardRef3, useEffect as useEffect4, useRef } from "react";
1210
+ import { jsx as jsx18, jsxs as jsxs8 } from "react/jsx-runtime";
1211
+ var ModalContent = styled12("dialog")`
1324
1212
  background-color: var(--j-background);
1325
1213
  border-radius: var(--j-radius-lg);
1326
1214
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
@@ -1333,24 +1221,24 @@ var ModalContent = styled13("dialog")`
1333
1221
  }
1334
1222
 
1335
1223
  `;
1336
- var ModalHeader = styled13("div")`
1224
+ var ModalHeader = styled12("div")`
1337
1225
  display: flex;
1338
1226
  justify-content: space-between;
1339
1227
  align-items: flex-start;
1340
1228
  padding: 1.5rem 1.5rem 0 1.5rem;
1341
1229
  gap: 1rem;
1342
1230
  `;
1343
- var ModalBody = styled13("div")`
1231
+ var ModalBody = styled12("div")`
1344
1232
  padding: 1rem 1.5rem;
1345
1233
  flex: 1;
1346
1234
  `;
1347
- var ModalFooter = styled13("div")`
1235
+ var ModalFooter = styled12("div")`
1348
1236
  display: flex;
1349
1237
  justify-content: flex-end;
1350
1238
  gap: 0.75rem;
1351
1239
  padding: 0 1.5rem 1.5rem 1.5rem;
1352
1240
  `;
1353
- var CloseButton = styled13("button")`
1241
+ var CloseButton = styled12("button")`
1354
1242
  background: none;
1355
1243
  border: none;
1356
1244
  cursor: pointer;
@@ -1389,7 +1277,7 @@ var Modal = forwardRef3(
1389
1277
  className
1390
1278
  }, ref) => {
1391
1279
  const modalRef = useRef(null);
1392
- useEffect5(() => {
1280
+ useEffect4(() => {
1393
1281
  if (isOpen) {
1394
1282
  modalRef.current?.showModal();
1395
1283
  } else {
@@ -1406,7 +1294,7 @@ var Modal = forwardRef3(
1406
1294
  onClose();
1407
1295
  };
1408
1296
  if (!isOpen) return null;
1409
- return /* @__PURE__ */ jsxs11(
1297
+ return /* @__PURE__ */ jsxs8(
1410
1298
  ModalContent,
1411
1299
  {
1412
1300
  ref: ref || modalRef,
@@ -1415,17 +1303,17 @@ var Modal = forwardRef3(
1415
1303
  "aria-labelledby": "modal-heading",
1416
1304
  onClose,
1417
1305
  children: [
1418
- /* @__PURE__ */ jsxs11(ModalHeader, { children: [
1419
- /* @__PURE__ */ jsx22(Heading, { id: "modal-heading", children: heading }),
1420
- /* @__PURE__ */ jsx22(CloseButton, { onClick: onClose, "aria-label": "Close modal", type: "button", children: "\xD7" })
1306
+ /* @__PURE__ */ jsxs8(ModalHeader, { children: [
1307
+ /* @__PURE__ */ jsx18(Heading, { id: "modal-heading", children: heading }),
1308
+ /* @__PURE__ */ jsx18(CloseButton, { onClick: onClose, "aria-label": "Close modal", type: "button", children: "\xD7" })
1421
1309
  ] }),
1422
- /* @__PURE__ */ jsxs11(ModalBody, { children: [
1423
- text && /* @__PURE__ */ jsx22("p", { style: { margin: "0 0 1rem 0", color: "var(--j-text-color)" }, children: text }),
1310
+ /* @__PURE__ */ jsxs8(ModalBody, { children: [
1311
+ text && /* @__PURE__ */ jsx18("p", { style: { margin: "0 0 1rem 0", color: "var(--j-text-color)" }, children: text }),
1424
1312
  children
1425
1313
  ] }),
1426
- showButtons && /* @__PURE__ */ jsxs11(ModalFooter, { children: [
1427
- /* @__PURE__ */ jsx22(Button, { variant: "secondary", onClick: handleCancel, children: cancelText }),
1428
- /* @__PURE__ */ jsx22(Button, { variant: "primary", onClick: handleConfirm, children: confirmText })
1314
+ showButtons && /* @__PURE__ */ jsxs8(ModalFooter, { children: [
1315
+ /* @__PURE__ */ jsx18(Button, { variant: "secondary", onClick: handleCancel, children: cancelText }),
1316
+ /* @__PURE__ */ jsx18(Button, { variant: "primary", onClick: handleConfirm, children: confirmText })
1429
1317
  ] })
1430
1318
  ]
1431
1319
  }
@@ -1435,19 +1323,19 @@ var Modal = forwardRef3(
1435
1323
  Modal.displayName = "Modal";
1436
1324
 
1437
1325
  // src/inspector/ui/select.tsx
1438
- import { styled as styled14 } from "goober";
1326
+ import { styled as styled13 } from "goober";
1439
1327
  import { useId as useId2 } from "react";
1440
- import { jsx as jsx23, jsxs as jsxs12 } from "react/jsx-runtime";
1441
- var SelectContainer = styled14("div")`
1328
+ import { jsx as jsx19, jsxs as jsxs9 } from "react/jsx-runtime";
1329
+ var SelectContainer = styled13("div")`
1442
1330
  display: grid;
1443
1331
  gap: 0.25rem;
1444
1332
  `;
1445
- var SelectWrapper = styled14("div")`
1333
+ var SelectWrapper = styled13("div")`
1446
1334
  position: relative;
1447
1335
  display: flex;
1448
1336
  align-items: center;
1449
1337
  `;
1450
- var StyledSelect = styled14("select")`
1338
+ var StyledSelect = styled13("select")`
1451
1339
  width: 100%;
1452
1340
  border-radius: var(--j-radius-md);
1453
1341
  border: 1px solid var(--j-border-color);
@@ -1465,7 +1353,7 @@ var StyledSelect = styled14("select")`
1465
1353
  background-color: var(--j-foreground);
1466
1354
  }
1467
1355
  `;
1468
- var SelectIcon = styled14("span")`
1356
+ var SelectIcon = styled13("span")`
1469
1357
  position: absolute;
1470
1358
  right: 0.5em;
1471
1359
  color: var(--j-neutral-400);
@@ -1479,18 +1367,60 @@ function Select(props) {
1479
1367
  const { label, hideLabel, id: customId, className, ...selectProps } = props;
1480
1368
  const generatedId = useId2();
1481
1369
  const id = customId || generatedId;
1482
- return /* @__PURE__ */ jsxs12(SelectContainer, { className, children: [
1483
- /* @__PURE__ */ jsx23("label", { htmlFor: id, className: hideLabel ? "j-sr-only" : "", children: label }),
1484
- /* @__PURE__ */ jsxs12(SelectWrapper, { children: [
1485
- /* @__PURE__ */ jsx23(StyledSelect, { ...selectProps, id, children: props.children }),
1486
- /* @__PURE__ */ jsx23(SelectIcon, { children: /* @__PURE__ */ jsx23(Icon, { name: "chevronDown", size: "sm" }) })
1370
+ return /* @__PURE__ */ jsxs9(SelectContainer, { className, children: [
1371
+ /* @__PURE__ */ jsx19("label", { htmlFor: id, className: hideLabel ? "j-sr-only" : "", children: label }),
1372
+ /* @__PURE__ */ jsxs9(SelectWrapper, { children: [
1373
+ /* @__PURE__ */ jsx19(StyledSelect, { ...selectProps, id, children: props.children }),
1374
+ /* @__PURE__ */ jsx19(SelectIcon, { children: /* @__PURE__ */ jsx19(Icon, { name: "chevronDown", size: "sm" }) })
1487
1375
  ] })
1488
1376
  ] });
1489
1377
  }
1490
1378
 
1491
1379
  // src/inspector/ui/data-table.tsx
1492
- import { useEffect as useEffect6, useMemo, useState as useState6 } from "react";
1493
- import { Fragment as Fragment7, jsx as jsx24, jsxs as jsxs13 } from "react/jsx-runtime";
1380
+ import { useEffect as useEffect5, useMemo, useState as useState5 } from "react";
1381
+
1382
+ // src/inspector/ui/table.tsx
1383
+ import { styled as styled14 } from "goober";
1384
+ import React4 from "react";
1385
+ import { jsx as jsx20 } from "react/jsx-runtime";
1386
+ var StyledTable = styled14("table")`
1387
+ width: 100%;
1388
+ `;
1389
+ var StyledThead = styled14("thead")`
1390
+ text-align: left;
1391
+ border-bottom: 1px solid var(--j-border-color);
1392
+ background-color: var(--j-neutral-100);
1393
+
1394
+ @media (prefers-color-scheme: dark) {
1395
+ background-color: var(--j-neutral-925);
1396
+ }
1397
+ `;
1398
+ var StyledTbody = styled14("tbody")`
1399
+ tr {
1400
+ border-bottom: 1px solid var(--j-border-color);
1401
+
1402
+ &:last-child {
1403
+ border-bottom: none;
1404
+ }
1405
+ }
1406
+ `;
1407
+ var StyledTh = styled14("th")`
1408
+ font-weight: 500;
1409
+ padding: 0.5rem 0.75rem;
1410
+ color: var(--j-text-color-strong);
1411
+ `;
1412
+ var StyledTd = styled14("td")`
1413
+ padding: 0.5rem 0.75rem;
1414
+ `;
1415
+ var Table = React4.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ jsx20(StyledTable, { ref, ...props, children }));
1416
+ var TableHead = React4.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ jsx20(StyledThead, { ref, ...props, children }));
1417
+ var TableBody = React4.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ jsx20(StyledTbody, { ref, ...props, children }));
1418
+ var TableRow = React4.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ jsx20("tr", { ref, ...props, children }));
1419
+ var TableHeader = React4.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ jsx20(StyledTh, { ref, ...props, children }));
1420
+ var TableCell = React4.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ jsx20(StyledTd, { ref, ...props, children }));
1421
+
1422
+ // src/inspector/ui/data-table.tsx
1423
+ import { Fragment as Fragment5, jsx as jsx21, jsxs as jsxs10 } from "react/jsx-runtime";
1494
1424
  function DataTable({
1495
1425
  columns,
1496
1426
  data,
@@ -1499,9 +1429,9 @@ function DataTable({
1499
1429
  getRowKey,
1500
1430
  emptyMessage = "No data available"
1501
1431
  }) {
1502
- const [currentPage, setCurrentPage] = useState6(1);
1503
- const [sortConfig, setSortConfig] = useState6(initialSort);
1504
- const [filters, setFilters] = useState6({});
1432
+ const [currentPage, setCurrentPage] = useState5(1);
1433
+ const [sortConfig, setSortConfig] = useState5(initialSort);
1434
+ const [filters, setFilters] = useState5({});
1505
1435
  const filteredData = useMemo(() => {
1506
1436
  return data.filter((row) => {
1507
1437
  return Object.entries(filters).every(([columnId, filterValue]) => {
@@ -1535,7 +1465,7 @@ function DataTable({
1535
1465
  const startIndex = (currentPage - 1) * pageSize;
1536
1466
  const endIndex = startIndex + pageSize;
1537
1467
  const paginatedData = sortedData.slice(startIndex, endIndex);
1538
- useEffect6(() => {
1468
+ useEffect5(() => {
1539
1469
  setCurrentPage(1);
1540
1470
  }, [filters]);
1541
1471
  const handleSort = (columnId) => {
@@ -1560,9 +1490,9 @@ function DataTable({
1560
1490
  const handlePageChange = (page) => {
1561
1491
  setCurrentPage(Math.max(1, Math.min(page, totalPages)));
1562
1492
  };
1563
- return /* @__PURE__ */ jsxs13(Fragment7, { children: [
1564
- /* @__PURE__ */ jsxs13(Table, { children: [
1565
- /* @__PURE__ */ jsx24(TableHead, { children: /* @__PURE__ */ jsx24(TableRow, { children: columns.map((column) => /* @__PURE__ */ jsx24(TableHeader, { children: /* @__PURE__ */ jsxs13(
1493
+ return /* @__PURE__ */ jsxs10(Fragment5, { children: [
1494
+ /* @__PURE__ */ jsxs10(Table, { children: [
1495
+ /* @__PURE__ */ jsx21(TableHead, { children: /* @__PURE__ */ jsx21(TableRow, { children: columns.map((column) => /* @__PURE__ */ jsx21(TableHeader, { children: /* @__PURE__ */ jsxs10(
1566
1496
  "div",
1567
1497
  {
1568
1498
  style: {
@@ -1573,8 +1503,8 @@ function DataTable({
1573
1503
  },
1574
1504
  onClick: () => handleSort(column.id),
1575
1505
  children: [
1576
- /* @__PURE__ */ jsx24("span", { children: column.header }),
1577
- column.sortable && /* @__PURE__ */ jsx24(
1506
+ /* @__PURE__ */ jsx21("span", { children: column.header }),
1507
+ column.sortable && /* @__PURE__ */ jsx21(
1578
1508
  "span",
1579
1509
  {
1580
1510
  style: {
@@ -1587,8 +1517,8 @@ function DataTable({
1587
1517
  ]
1588
1518
  }
1589
1519
  ) }, column.id)) }) }),
1590
- /* @__PURE__ */ jsxs13(TableBody, { children: [
1591
- columns.some((column) => column.filterable) && /* @__PURE__ */ jsx24(TableRow, { children: columns.map((column) => /* @__PURE__ */ jsx24(TableCell, { children: column.filterable && /* @__PURE__ */ jsx24(
1520
+ /* @__PURE__ */ jsxs10(TableBody, { children: [
1521
+ columns.some((column) => column.filterable) && /* @__PURE__ */ jsx21(TableRow, { children: columns.map((column) => /* @__PURE__ */ jsx21(TableCell, { children: column.filterable && /* @__PURE__ */ jsx21(
1592
1522
  Input,
1593
1523
  {
1594
1524
  label: "Filter",
@@ -1600,7 +1530,7 @@ function DataTable({
1600
1530
  onClick: (e) => e.stopPropagation()
1601
1531
  }
1602
1532
  ) }, column.id)) }),
1603
- paginatedData.length === 0 ? /* @__PURE__ */ jsx24(TableRow, { children: /* @__PURE__ */ jsx24(TableCell, { colSpan: columns.length, children: /* @__PURE__ */ jsx24(
1533
+ paginatedData.length === 0 ? /* @__PURE__ */ jsx21(TableRow, { children: /* @__PURE__ */ jsx21(TableCell, { colSpan: columns.length, children: /* @__PURE__ */ jsx21(
1604
1534
  "div",
1605
1535
  {
1606
1536
  style: {
@@ -1610,10 +1540,10 @@ function DataTable({
1610
1540
  },
1611
1541
  children: emptyMessage
1612
1542
  }
1613
- ) }) }) : paginatedData.map((row, index) => /* @__PURE__ */ jsx24(TableRow, { children: columns.map((column) => /* @__PURE__ */ jsx24(TableCell, { children: column.accessor(row) }, column.id)) }, getRowKey(row, startIndex + index)))
1543
+ ) }) }) : paginatedData.map((row, index) => /* @__PURE__ */ jsx21(TableRow, { children: columns.map((column) => /* @__PURE__ */ jsx21(TableCell, { children: column.accessor(row) }, column.id)) }, getRowKey(row, startIndex + index)))
1614
1544
  ] })
1615
1545
  ] }),
1616
- showPagination && /* @__PURE__ */ jsxs13(
1546
+ showPagination && /* @__PURE__ */ jsxs10(
1617
1547
  "div",
1618
1548
  {
1619
1549
  style: {
@@ -1624,7 +1554,7 @@ function DataTable({
1624
1554
  padding: "8px 0"
1625
1555
  },
1626
1556
  children: [
1627
- /* @__PURE__ */ jsxs13("div", { style: { fontSize: "14px", opacity: 0.7 }, children: [
1557
+ /* @__PURE__ */ jsxs10("div", { style: { fontSize: "14px", opacity: 0.7 }, children: [
1628
1558
  "Showing ",
1629
1559
  startIndex + 1,
1630
1560
  " to ",
@@ -1635,8 +1565,8 @@ function DataTable({
1635
1565
  " entries",
1636
1566
  Object.keys(filters).some((key) => filters[key]) && ` (filtered from ${data.length})`
1637
1567
  ] }),
1638
- /* @__PURE__ */ jsxs13("div", { style: { display: "flex", gap: "8px", alignItems: "center" }, children: [
1639
- /* @__PURE__ */ jsx24(
1568
+ /* @__PURE__ */ jsxs10("div", { style: { display: "flex", gap: "8px", alignItems: "center" }, children: [
1569
+ /* @__PURE__ */ jsx21(
1640
1570
  Button,
1641
1571
  {
1642
1572
  variant: "secondary",
@@ -1645,7 +1575,7 @@ function DataTable({
1645
1575
  children: "\xAB\xAB"
1646
1576
  }
1647
1577
  ),
1648
- /* @__PURE__ */ jsx24(
1578
+ /* @__PURE__ */ jsx21(
1649
1579
  Button,
1650
1580
  {
1651
1581
  variant: "secondary",
@@ -1654,13 +1584,13 @@ function DataTable({
1654
1584
  children: "\xAB"
1655
1585
  }
1656
1586
  ),
1657
- /* @__PURE__ */ jsxs13("span", { style: { fontSize: "14px" }, children: [
1587
+ /* @__PURE__ */ jsxs10("span", { style: { fontSize: "14px" }, children: [
1658
1588
  "Page ",
1659
1589
  currentPage,
1660
1590
  " of ",
1661
1591
  totalPages
1662
1592
  ] }),
1663
- /* @__PURE__ */ jsx24(
1593
+ /* @__PURE__ */ jsx21(
1664
1594
  Button,
1665
1595
  {
1666
1596
  variant: "secondary",
@@ -1669,7 +1599,7 @@ function DataTable({
1669
1599
  children: "\xBB"
1670
1600
  }
1671
1601
  ),
1672
- /* @__PURE__ */ jsx24(
1602
+ /* @__PURE__ */ jsx21(
1673
1603
  Button,
1674
1604
  {
1675
1605
  variant: "secondary",
@@ -1685,8 +1615,122 @@ function DataTable({
1685
1615
  ] });
1686
1616
  }
1687
1617
 
1618
+ // src/inspector/ui/accordion.tsx
1619
+ import { styled as styled15 } from "goober";
1620
+ import { useEffect as useEffect6, useState as useState6 } from "react";
1621
+ import { jsx as jsx22, jsxs as jsxs11 } from "react/jsx-runtime";
1622
+ function Accordion({ title, children, storageKey }) {
1623
+ const [open, setOpen] = useStoragedState(storageKey, false);
1624
+ return /* @__PURE__ */ jsxs11(
1625
+ "details",
1626
+ {
1627
+ open,
1628
+ style: { display: "flex", flexDirection: "column", gap: "1rem" },
1629
+ children: [
1630
+ /* @__PURE__ */ jsx22(
1631
+ StyledSummary,
1632
+ {
1633
+ onClick: (e) => {
1634
+ e.preventDefault();
1635
+ setOpen((v) => !v);
1636
+ },
1637
+ children: title
1638
+ }
1639
+ ),
1640
+ children
1641
+ ]
1642
+ }
1643
+ );
1644
+ }
1645
+ function useStoragedState(key, defaultValue) {
1646
+ const [state, setState] = useState6(() => {
1647
+ if (typeof window === "undefined") return defaultValue;
1648
+ const stored = localStorage.getItem(key);
1649
+ return stored ? JSON.parse(stored) : defaultValue;
1650
+ });
1651
+ useEffect6(() => {
1652
+ localStorage.setItem(key, JSON.stringify(state));
1653
+ }, [state]);
1654
+ return [state, setState];
1655
+ }
1656
+ var StyledSummary = styled15("summary")`
1657
+ font-size: 1.125rem;
1658
+ cursor: pointer;
1659
+ font-weight: 500;
1660
+ color: var(--j-text-color-strong);
1661
+ `;
1662
+
1663
+ // src/inspector/viewer/raw-data-card.tsx
1664
+ import { jsx as jsx23, jsxs as jsxs12 } from "react/jsx-runtime";
1665
+ function CopyButton({ data }) {
1666
+ const [copyCount, setCopyCount] = useState7(0);
1667
+ const copied = copyCount > 0;
1668
+ const stringifiedData = JSON.stringify(data);
1669
+ useEffect7(() => {
1670
+ if (copyCount > 0) {
1671
+ const timeout = setTimeout(() => setCopyCount(0), 1e3);
1672
+ return () => {
1673
+ clearTimeout(timeout);
1674
+ };
1675
+ }
1676
+ }, [copyCount]);
1677
+ return /* @__PURE__ */ jsx23(
1678
+ Button,
1679
+ {
1680
+ style: {
1681
+ position: "absolute",
1682
+ top: "10px",
1683
+ right: "10px"
1684
+ },
1685
+ onClick: () => {
1686
+ window.navigator.clipboard.writeText(stringifiedData).then(() => {
1687
+ setCopyCount((count) => count + 1);
1688
+ });
1689
+ },
1690
+ variant: "secondary",
1691
+ children: copied ? "Copied" : "Copy"
1692
+ }
1693
+ );
1694
+ }
1695
+ function RawDataCard({ data }) {
1696
+ return /* @__PURE__ */ jsx23(Accordion, { title: "Raw data", storageKey: "jazz-inspector-show-raw-data", children: /* @__PURE__ */ jsxs12(Card, { style: { position: "relative" }, children: [
1697
+ /* @__PURE__ */ jsx23(CardHeader, { children: /* @__PURE__ */ jsx23(CopyButton, { data }) }),
1698
+ /* @__PURE__ */ jsx23(CardBody, { children: /* @__PURE__ */ jsx23(ValueRenderer, { json: data }) })
1699
+ ] }) });
1700
+ }
1701
+
1702
+ // src/inspector/viewer/account-view.tsx
1703
+ import { Fragment as Fragment6, jsx as jsx24, jsxs as jsxs13 } from "react/jsx-runtime";
1704
+ function AccountView({
1705
+ data,
1706
+ onNavigate,
1707
+ node
1708
+ }) {
1709
+ const readableData = { ...data };
1710
+ for (const key in readableData) {
1711
+ if (key === "readKey" || key.startsWith("sealer_z") || key.startsWith("key_z")) {
1712
+ delete readableData[key];
1713
+ }
1714
+ }
1715
+ return /* @__PURE__ */ jsxs13(Fragment6, { children: [
1716
+ /* @__PURE__ */ jsx24(GridView, { data: readableData, onNavigate, node }),
1717
+ /* @__PURE__ */ jsx24(RawDataCard, { data })
1718
+ ] });
1719
+ }
1720
+
1721
+ // src/inspector/viewer/co-plain-text-view.tsx
1722
+ import { Fragment as Fragment7, jsx as jsx25, jsxs as jsxs14 } from "react/jsx-runtime";
1723
+ function CoPlainTextView({ data }) {
1724
+ if (!data) return;
1725
+ return /* @__PURE__ */ jsxs14(Fragment7, { children: [
1726
+ /* @__PURE__ */ jsx25("p", { children: Object.values(data).join("") }),
1727
+ /* @__PURE__ */ jsx25(RawDataCard, { data })
1728
+ ] });
1729
+ }
1730
+
1688
1731
  // src/inspector/viewer/group-view.tsx
1689
- import { Fragment as Fragment8, jsx as jsx25, jsxs as jsxs14 } from "react/jsx-runtime";
1732
+ import { useState as useState8 } from "react";
1733
+ import { Fragment as Fragment8, jsx as jsx26, jsxs as jsxs15 } from "react/jsx-runtime";
1690
1734
  function partitionMembers(data) {
1691
1735
  const everyone = Object.entries(data).filter(([key]) => key === "everyone").map(([key, value]) => ({
1692
1736
  id: key,
@@ -1714,7 +1758,7 @@ function GroupView({
1714
1758
  onNavigate,
1715
1759
  node
1716
1760
  }) {
1717
- const [addMemberType, setAddMemberType] = useState7(null);
1761
+ const [addMemberType, setAddMemberType] = useState8(null);
1718
1762
  const { everyone, members, parentGroups, childGroups } = partitionMembers(
1719
1763
  data
1720
1764
  );
@@ -1793,28 +1837,28 @@ function GroupView({
1793
1837
  alert(`Failed to add ${addMemberType}: ${error.message}`);
1794
1838
  }
1795
1839
  };
1796
- return /* @__PURE__ */ jsxs14(Fragment8, { children: [
1797
- /* @__PURE__ */ jsxs14(Table, { children: [
1798
- /* @__PURE__ */ jsx25(TableHead, { children: /* @__PURE__ */ jsxs14(TableRow, { children: [
1799
- /* @__PURE__ */ jsx25(TableHeader, { children: "Member" }),
1800
- /* @__PURE__ */ jsx25(TableHeader, { children: "Permission" }),
1801
- /* @__PURE__ */ jsx25(TableHeader, {})
1840
+ return /* @__PURE__ */ jsxs15(Fragment8, { children: [
1841
+ /* @__PURE__ */ jsxs15(Table, { children: [
1842
+ /* @__PURE__ */ jsx26(TableHead, { children: /* @__PURE__ */ jsxs15(TableRow, { children: [
1843
+ /* @__PURE__ */ jsx26(TableHeader, { children: "Member" }),
1844
+ /* @__PURE__ */ jsx26(TableHeader, { children: "Permission" }),
1845
+ /* @__PURE__ */ jsx26(TableHeader, {})
1802
1846
  ] }) }),
1803
- /* @__PURE__ */ jsxs14(TableBody, { children: [
1804
- everyone.map((member) => /* @__PURE__ */ jsxs14(TableRow, { children: [
1805
- /* @__PURE__ */ jsx25(TableCell, { children: member.id }),
1806
- /* @__PURE__ */ jsx25(TableCell, { children: member.role }),
1807
- /* @__PURE__ */ jsx25(TableCell, { children: member.role !== "revoked" && /* @__PURE__ */ jsx25(
1847
+ /* @__PURE__ */ jsxs15(TableBody, { children: [
1848
+ everyone.map((member) => /* @__PURE__ */ jsxs15(TableRow, { children: [
1849
+ /* @__PURE__ */ jsx26(TableCell, { children: member.id }),
1850
+ /* @__PURE__ */ jsx26(TableCell, { children: member.role }),
1851
+ /* @__PURE__ */ jsx26(TableCell, { children: member.role !== "revoked" && /* @__PURE__ */ jsx26(
1808
1852
  Button,
1809
1853
  {
1810
1854
  variant: "secondary",
1811
1855
  onClick: () => onRemoveMember(member.id),
1812
- children: /* @__PURE__ */ jsx25(Icon, { name: "delete" })
1856
+ children: /* @__PURE__ */ jsx26(Icon, { name: "delete" })
1813
1857
  }
1814
1858
  ) })
1815
1859
  ] }, member.id)),
1816
- members.map((member) => /* @__PURE__ */ jsxs14(TableRow, { children: [
1817
- /* @__PURE__ */ jsx25(TableCell, { children: /* @__PURE__ */ jsx25(
1860
+ members.map((member) => /* @__PURE__ */ jsxs15(TableRow, { children: [
1861
+ /* @__PURE__ */ jsx26(TableCell, { children: /* @__PURE__ */ jsx26(
1818
1862
  AccountOrGroupText,
1819
1863
  {
1820
1864
  coId: member.id,
@@ -1825,18 +1869,18 @@ function GroupView({
1825
1869
  }
1826
1870
  }
1827
1871
  ) }),
1828
- /* @__PURE__ */ jsx25(TableCell, { children: member.role }),
1829
- /* @__PURE__ */ jsx25(TableCell, { children: member.role !== "revoked" && /* @__PURE__ */ jsx25(
1872
+ /* @__PURE__ */ jsx26(TableCell, { children: member.role }),
1873
+ /* @__PURE__ */ jsx26(TableCell, { children: member.role !== "revoked" && /* @__PURE__ */ jsx26(
1830
1874
  Button,
1831
1875
  {
1832
1876
  variant: "secondary",
1833
1877
  onClick: () => onRemoveMember(member.id),
1834
- children: /* @__PURE__ */ jsx25(Icon, { name: "delete" })
1878
+ children: /* @__PURE__ */ jsx26(Icon, { name: "delete" })
1835
1879
  }
1836
1880
  ) })
1837
1881
  ] }, member.id)),
1838
- parentGroups.map((group) => /* @__PURE__ */ jsxs14(TableRow, { children: [
1839
- /* @__PURE__ */ jsx25(TableCell, { children: /* @__PURE__ */ jsx25(
1882
+ parentGroups.map((group) => /* @__PURE__ */ jsxs15(TableRow, { children: [
1883
+ /* @__PURE__ */ jsx26(TableCell, { children: /* @__PURE__ */ jsx26(
1840
1884
  AccountOrGroupText,
1841
1885
  {
1842
1886
  coId: group.id,
@@ -1847,19 +1891,19 @@ function GroupView({
1847
1891
  }
1848
1892
  }
1849
1893
  ) }),
1850
- /* @__PURE__ */ jsx25(TableCell, { children: group.role }),
1851
- /* @__PURE__ */ jsx25(TableCell, { children: group.role !== "revoked" && /* @__PURE__ */ jsx25(
1894
+ /* @__PURE__ */ jsx26(TableCell, { children: group.role }),
1895
+ /* @__PURE__ */ jsx26(TableCell, { children: group.role !== "revoked" && /* @__PURE__ */ jsx26(
1852
1896
  Button,
1853
1897
  {
1854
1898
  variant: "secondary",
1855
1899
  onClick: () => onRemoveGroup(group.id),
1856
- children: /* @__PURE__ */ jsx25(Icon, { name: "delete" })
1900
+ children: /* @__PURE__ */ jsx26(Icon, { name: "delete" })
1857
1901
  }
1858
1902
  ) })
1859
1903
  ] }, group.id))
1860
1904
  ] })
1861
1905
  ] }),
1862
- /* @__PURE__ */ jsxs14(
1906
+ /* @__PURE__ */ jsxs15(
1863
1907
  "div",
1864
1908
  {
1865
1909
  style: {
@@ -1869,14 +1913,14 @@ function GroupView({
1869
1913
  marginTop: "1rem"
1870
1914
  },
1871
1915
  children: [
1872
- /* @__PURE__ */ jsx25(Button, { variant: "primary", onClick: () => setAddMemberType("account"), children: "Add Account" }),
1873
- /* @__PURE__ */ jsx25(Button, { variant: "primary", onClick: () => setAddMemberType("group"), children: "Add Group" })
1916
+ /* @__PURE__ */ jsx26(Button, { variant: "primary", onClick: () => setAddMemberType("account"), children: "Add Account" }),
1917
+ /* @__PURE__ */ jsx26(Button, { variant: "primary", onClick: () => setAddMemberType("group"), children: "Add Group" })
1874
1918
  ]
1875
1919
  }
1876
1920
  ),
1877
- childGroups.length > 0 && /* @__PURE__ */ jsxs14(Table, { children: [
1878
- /* @__PURE__ */ jsx25(TableHead, { children: /* @__PURE__ */ jsx25(TableRow, { children: /* @__PURE__ */ jsx25(TableHeader, { children: "Member of" }) }) }),
1879
- /* @__PURE__ */ jsx25(TableBody, { children: childGroups.map((group) => /* @__PURE__ */ jsx25(TableRow, { children: /* @__PURE__ */ jsx25(TableCell, { children: /* @__PURE__ */ jsx25(
1921
+ childGroups.length > 0 && /* @__PURE__ */ jsxs15(Table, { children: [
1922
+ /* @__PURE__ */ jsx26(TableHead, { children: /* @__PURE__ */ jsx26(TableRow, { children: /* @__PURE__ */ jsx26(TableHeader, { children: "Member of" }) }) }),
1923
+ /* @__PURE__ */ jsx26(TableBody, { children: childGroups.map((group) => /* @__PURE__ */ jsx26(TableRow, { children: /* @__PURE__ */ jsx26(TableCell, { children: /* @__PURE__ */ jsx26(
1880
1924
  AccountOrGroupText,
1881
1925
  {
1882
1926
  coId: group.id,
@@ -1888,20 +1932,20 @@ function GroupView({
1888
1932
  }
1889
1933
  ) }) }, group.id)) })
1890
1934
  ] }),
1891
- /* @__PURE__ */ jsx25(RawDataCard, { data }),
1892
- /* @__PURE__ */ jsx25(
1935
+ /* @__PURE__ */ jsx26(RawDataCard, { data }),
1936
+ /* @__PURE__ */ jsx26(
1893
1937
  Modal,
1894
1938
  {
1895
1939
  isOpen: addMemberType !== null,
1896
1940
  onClose: () => setAddMemberType(null),
1897
1941
  heading: addMemberType === "account" ? "Add Account" : "Add Group",
1898
1942
  showButtons: false,
1899
- children: /* @__PURE__ */ jsx25("form", { onSubmit: handleAddMemberSubmit, children: /* @__PURE__ */ jsxs14(
1943
+ children: /* @__PURE__ */ jsx26("form", { onSubmit: handleAddMemberSubmit, children: /* @__PURE__ */ jsxs15(
1900
1944
  "div",
1901
1945
  {
1902
1946
  style: { display: "flex", flexDirection: "column", gap: "1rem" },
1903
1947
  children: [
1904
- /* @__PURE__ */ jsx25(
1948
+ /* @__PURE__ */ jsx26(
1905
1949
  Input,
1906
1950
  {
1907
1951
  name: "memberId",
@@ -1910,13 +1954,13 @@ function GroupView({
1910
1954
  required: true
1911
1955
  }
1912
1956
  ),
1913
- /* @__PURE__ */ jsxs14(Select, { name: "role", label: "Role", children: [
1914
- /* @__PURE__ */ jsx25("option", { value: "reader", children: "Reader" }),
1915
- /* @__PURE__ */ jsx25("option", { value: "writer", children: "Writer" }),
1916
- /* @__PURE__ */ jsx25("option", { value: "admin", children: "Admin" }),
1917
- addMemberType === "account" ? /* @__PURE__ */ jsx25(Fragment8, { children: /* @__PURE__ */ jsx25("option", { value: "writeOnly", children: "Write Only" }) }) : /* @__PURE__ */ jsx25(Fragment8, { children: /* @__PURE__ */ jsx25("option", { value: "inherit", children: "Inherit" }) })
1957
+ /* @__PURE__ */ jsxs15(Select, { name: "role", label: "Role", children: [
1958
+ /* @__PURE__ */ jsx26("option", { value: "reader", children: "Reader" }),
1959
+ /* @__PURE__ */ jsx26("option", { value: "writer", children: "Writer" }),
1960
+ /* @__PURE__ */ jsx26("option", { value: "admin", children: "Admin" }),
1961
+ addMemberType === "account" ? /* @__PURE__ */ jsx26(Fragment8, { children: /* @__PURE__ */ jsx26("option", { value: "writeOnly", children: "Write Only" }) }) : /* @__PURE__ */ jsx26(Fragment8, { children: /* @__PURE__ */ jsx26("option", { value: "inherit", children: "Inherit" }) })
1918
1962
  ] }),
1919
- /* @__PURE__ */ jsxs14(
1963
+ /* @__PURE__ */ jsxs15(
1920
1964
  "div",
1921
1965
  {
1922
1966
  style: {
@@ -1926,7 +1970,7 @@ function GroupView({
1926
1970
  marginTop: "0.5rem"
1927
1971
  },
1928
1972
  children: [
1929
- /* @__PURE__ */ jsx25(
1973
+ /* @__PURE__ */ jsx26(
1930
1974
  Button,
1931
1975
  {
1932
1976
  type: "button",
@@ -1935,7 +1979,7 @@ function GroupView({
1935
1979
  children: "Cancel"
1936
1980
  }
1937
1981
  ),
1938
- /* @__PURE__ */ jsx25(Button, { type: "submit", variant: "primary", children: "Add" })
1982
+ /* @__PURE__ */ jsx26(Button, { type: "submit", variant: "primary", children: "Add" })
1939
1983
  ]
1940
1984
  }
1941
1985
  )
@@ -1948,7 +1992,7 @@ function GroupView({
1948
1992
  }
1949
1993
 
1950
1994
  // src/inspector/viewer/role-display.tsx
1951
- import { jsxs as jsxs15 } from "react/jsx-runtime";
1995
+ import { jsxs as jsxs16 } from "react/jsx-runtime";
1952
1996
  function RoleDisplay({
1953
1997
  node,
1954
1998
  value
@@ -1967,24 +2011,24 @@ function RoleDisplay({
1967
2011
  } else {
1968
2012
  role = "unauthorized";
1969
2013
  }
1970
- return /* @__PURE__ */ jsxs15(Text, { children: [
2014
+ return /* @__PURE__ */ jsxs16(Text, { children: [
1971
2015
  "Role: ",
1972
2016
  role
1973
2017
  ] });
1974
2018
  }
1975
2019
 
1976
2020
  // src/inspector/viewer/table-viewer.tsx
1977
- import { styled as styled15 } from "goober";
1978
- import { useMemo as useMemo2, useState as useState8 } from "react";
1979
- import { Fragment as Fragment9, jsx as jsx26, jsxs as jsxs16 } from "react/jsx-runtime";
1980
- var PaginationContainer = styled15("div")`
2021
+ import { styled as styled16 } from "goober";
2022
+ import { useMemo as useMemo2, useState as useState9 } from "react";
2023
+ import { Fragment as Fragment9, jsx as jsx27, jsxs as jsxs17 } from "react/jsx-runtime";
2024
+ var PaginationContainer = styled16("div")`
1981
2025
  padding: 1rem 0;
1982
2026
  display: flex;
1983
2027
  align-items: center;
1984
2028
  justify-content: space-between;
1985
2029
  gap: 0.5rem;
1986
2030
  `;
1987
- var RedTooltip = styled15("span")`
2031
+ var RedTooltip = styled16("span")`
1988
2032
  position:relative; /* making the .tooltip span a container for the tooltip text */
1989
2033
  border-bottom:1px dashed #000; /* little indicater to indicate it's hoverable */
1990
2034
 
@@ -2021,7 +2065,7 @@ function CoValuesTableView({
2021
2065
  onNavigate,
2022
2066
  onRemove
2023
2067
  }) {
2024
- const [visibleRowsCount, setVisibleRowsCount] = useState8(10);
2068
+ const [visibleRowsCount, setVisibleRowsCount] = useState9(10);
2025
2069
  const [coIdArray, visibleRows] = useMemo2(() => {
2026
2070
  const coIdArray2 = Array.isArray(data) ? data : Object.values(data).every((k) => typeof k === "string" && isCoId(k)) ? Object.values(data).map((k) => k) : [];
2027
2071
  const visibleRows2 = coIdArray2.slice(0, visibleRowsCount);
@@ -2030,10 +2074,10 @@ function CoValuesTableView({
2030
2074
  const resolvedRows = useResolvedCoValues(visibleRows, node);
2031
2075
  const hasMore = visibleRowsCount < coIdArray.length;
2032
2076
  if (!coIdArray.length) {
2033
- return /* @__PURE__ */ jsx26("div", { children: "No data to display" });
2077
+ return /* @__PURE__ */ jsx27("div", { children: "No data to display" });
2034
2078
  }
2035
2079
  if (resolvedRows.length === 0) {
2036
- return /* @__PURE__ */ jsx26("div", { children: "Loading..." });
2080
+ return /* @__PURE__ */ jsx27("div", { children: "Loading..." });
2037
2081
  }
2038
2082
  const keys = Array.from(
2039
2083
  new Set(
@@ -2043,15 +2087,15 @@ function CoValuesTableView({
2043
2087
  const loadMore = () => {
2044
2088
  setVisibleRowsCount((prevVisibleRows) => prevVisibleRows + 10);
2045
2089
  };
2046
- return /* @__PURE__ */ jsxs16(Fragment9, { children: [
2047
- /* @__PURE__ */ jsxs16(Table, { children: [
2048
- /* @__PURE__ */ jsx26(TableHead, { children: /* @__PURE__ */ jsxs16(TableRow, { children: [
2049
- ["ID", ...keys, "Action"].map((key) => /* @__PURE__ */ jsx26(TableHeader, { children: key }, key)),
2050
- onRemove && /* @__PURE__ */ jsx26(TableHeader, {})
2090
+ return /* @__PURE__ */ jsxs17(Fragment9, { children: [
2091
+ /* @__PURE__ */ jsxs17(Table, { children: [
2092
+ /* @__PURE__ */ jsx27(TableHead, { children: /* @__PURE__ */ jsxs17(TableRow, { children: [
2093
+ ["ID", ...keys, "Action"].map((key) => /* @__PURE__ */ jsx27(TableHeader, { children: key }, key)),
2094
+ onRemove && /* @__PURE__ */ jsx27(TableHeader, {})
2051
2095
  ] }) }),
2052
- /* @__PURE__ */ jsx26(TableBody, { children: resolvedRows.slice(0, visibleRowsCount).map((item, index) => /* @__PURE__ */ jsxs16(TableRow, { children: [
2053
- /* @__PURE__ */ jsx26(TableCell, { children: /* @__PURE__ */ jsx26(Text, { mono: true, children: item.snapshot === "unavailable" ? /* @__PURE__ */ jsxs16(RedTooltip, { "data-text": "Unavailable", children: [
2054
- /* @__PURE__ */ jsx26(
2096
+ /* @__PURE__ */ jsx27(TableBody, { children: resolvedRows.slice(0, visibleRowsCount).map((item, index) => /* @__PURE__ */ jsxs17(TableRow, { children: [
2097
+ /* @__PURE__ */ jsx27(TableCell, { children: /* @__PURE__ */ jsx27(Text, { mono: true, children: item.snapshot === "unavailable" ? /* @__PURE__ */ jsxs17(RedTooltip, { "data-text": "Unavailable", children: [
2098
+ /* @__PURE__ */ jsx27(
2055
2099
  Icon,
2056
2100
  {
2057
2101
  name: "caution",
@@ -2064,7 +2108,7 @@ function CoValuesTableView({
2064
2108
  ),
2065
2109
  visibleRows[index]
2066
2110
  ] }) : visibleRows[index] }) }),
2067
- keys.map((key) => /* @__PURE__ */ jsx26(TableCell, { children: item.snapshot !== "unavailable" && /* @__PURE__ */ jsx26(
2111
+ keys.map((key) => /* @__PURE__ */ jsx27(TableCell, { children: item.snapshot !== "unavailable" && /* @__PURE__ */ jsx27(
2068
2112
  ValueRenderer,
2069
2113
  {
2070
2114
  json: item.snapshot[key],
@@ -2085,7 +2129,7 @@ function CoValuesTableView({
2085
2129
  }
2086
2130
  }
2087
2131
  ) }, key)),
2088
- /* @__PURE__ */ jsx26(TableCell, { children: /* @__PURE__ */ jsx26(
2132
+ /* @__PURE__ */ jsx27(TableCell, { children: /* @__PURE__ */ jsx27(
2089
2133
  Button,
2090
2134
  {
2091
2135
  variant: "secondary",
@@ -2098,18 +2142,18 @@ function CoValuesTableView({
2098
2142
  children: "View"
2099
2143
  }
2100
2144
  ) }),
2101
- onRemove && /* @__PURE__ */ jsx26(TableCell, { children: /* @__PURE__ */ jsx26(Button, { variant: "secondary", onClick: () => onRemove(index), children: "Remove" }) })
2145
+ onRemove && /* @__PURE__ */ jsx27(TableCell, { children: /* @__PURE__ */ jsx27(Button, { variant: "secondary", onClick: () => onRemove(index), children: "Remove" }) })
2102
2146
  ] }, index)) })
2103
2147
  ] }),
2104
- /* @__PURE__ */ jsxs16(PaginationContainer, { children: [
2105
- /* @__PURE__ */ jsxs16(Text, { muted: true, small: true, children: [
2148
+ /* @__PURE__ */ jsxs17(PaginationContainer, { children: [
2149
+ /* @__PURE__ */ jsxs17(Text, { muted: true, small: true, children: [
2106
2150
  "Showing ",
2107
2151
  Math.min(visibleRowsCount, coIdArray.length),
2108
2152
  " of",
2109
2153
  " ",
2110
2154
  coIdArray.length
2111
2155
  ] }),
2112
- hasMore && /* @__PURE__ */ jsx26(Button, { variant: "secondary", onClick: loadMore, children: "Load more" })
2156
+ hasMore && /* @__PURE__ */ jsx27(Button, { variant: "secondary", onClick: loadMore, children: "Load more" })
2113
2157
  ] })
2114
2158
  ] });
2115
2159
  }
@@ -2123,7 +2167,7 @@ function TableView({
2123
2167
  return Array.isArray(data) && data.every((k) => isCoId(k));
2124
2168
  }, [data]);
2125
2169
  if (isListOfCoValues) {
2126
- return /* @__PURE__ */ jsx26(
2170
+ return /* @__PURE__ */ jsx27(
2127
2171
  CoValuesTableView,
2128
2172
  {
2129
2173
  data,
@@ -2133,24 +2177,24 @@ function TableView({
2133
2177
  }
2134
2178
  );
2135
2179
  }
2136
- return /* @__PURE__ */ jsxs16(Table, { children: [
2137
- /* @__PURE__ */ jsx26(TableHead, { children: /* @__PURE__ */ jsxs16(TableRow, { children: [
2138
- /* @__PURE__ */ jsx26(TableHeader, { style: { width: "5rem" }, children: "Index" }),
2139
- /* @__PURE__ */ jsx26(TableHeader, { children: "Value" }),
2140
- onRemove && /* @__PURE__ */ jsx26(TableHeader, { children: "Action" })
2180
+ return /* @__PURE__ */ jsxs17(Table, { children: [
2181
+ /* @__PURE__ */ jsx27(TableHead, { children: /* @__PURE__ */ jsxs17(TableRow, { children: [
2182
+ /* @__PURE__ */ jsx27(TableHeader, { style: { width: "5rem" }, children: "Index" }),
2183
+ /* @__PURE__ */ jsx27(TableHeader, { children: "Value" }),
2184
+ onRemove && /* @__PURE__ */ jsx27(TableHeader, { children: "Action" })
2141
2185
  ] }) }),
2142
- /* @__PURE__ */ jsx26(TableBody, { children: Array.isArray(data) && data?.map((value, index) => /* @__PURE__ */ jsxs16(TableRow, { children: [
2143
- /* @__PURE__ */ jsx26(TableCell, { children: /* @__PURE__ */ jsx26(Text, { mono: true, children: index }) }),
2144
- /* @__PURE__ */ jsx26(TableCell, { children: /* @__PURE__ */ jsx26(ValueRenderer, { json: value }) }),
2145
- onRemove && /* @__PURE__ */ jsx26(TableCell, { children: /* @__PURE__ */ jsx26(Button, { variant: "secondary", onClick: () => onRemove(index), children: "Remove" }) })
2186
+ /* @__PURE__ */ jsx27(TableBody, { children: Array.isArray(data) && data?.map((value, index) => /* @__PURE__ */ jsxs17(TableRow, { children: [
2187
+ /* @__PURE__ */ jsx27(TableCell, { children: /* @__PURE__ */ jsx27(Text, { mono: true, children: index }) }),
2188
+ /* @__PURE__ */ jsx27(TableCell, { children: /* @__PURE__ */ jsx27(ValueRenderer, { json: value }) }),
2189
+ onRemove && /* @__PURE__ */ jsx27(TableCell, { children: /* @__PURE__ */ jsx27(Button, { variant: "secondary", onClick: () => onRemove(index), children: "Remove" }) })
2146
2190
  ] }, index)) })
2147
2191
  ] });
2148
2192
  }
2149
2193
 
2150
2194
  // src/inspector/viewer/history-view.tsx
2151
2195
  import { useMemo as useMemo3 } from "react";
2152
- import { styled as styled16 } from "goober";
2153
- import { Fragment as Fragment10, jsx as jsx27, jsxs as jsxs17 } from "react/jsx-runtime";
2196
+ import { styled as styled17 } from "goober";
2197
+ import { Fragment as Fragment10, jsx as jsx28, jsxs as jsxs18 } from "react/jsx-runtime";
2154
2198
  function HistoryView({
2155
2199
  coValue,
2156
2200
  node
@@ -2163,8 +2207,8 @@ function HistoryView({
2163
2207
  {
2164
2208
  id: "author",
2165
2209
  header: "Author",
2166
- accessor: (row) => /* @__PURE__ */ jsxs17(Fragment10, { children: [
2167
- row.isValid || /* @__PURE__ */ jsx27(RedTooltip2, { "data-text": "This transaction is invalid and is not used", children: /* @__PURE__ */ jsx27(
2210
+ accessor: (row) => /* @__PURE__ */ jsxs18(Fragment10, { children: [
2211
+ row.isValid || /* @__PURE__ */ jsx28(RedTooltip2, { "data-text": "This transaction is invalid and is not used", children: /* @__PURE__ */ jsx28(
2168
2212
  Icon,
2169
2213
  {
2170
2214
  name: "caution",
@@ -2177,7 +2221,7 @@ function HistoryView({
2177
2221
  }
2178
2222
  }
2179
2223
  ) }),
2180
- row.author.startsWith("co_") ? /* @__PURE__ */ jsx27(
2224
+ row.author.startsWith("co_") ? /* @__PURE__ */ jsx28(
2181
2225
  AccountOrGroupText,
2182
2226
  {
2183
2227
  coId: row.author,
@@ -2194,7 +2238,16 @@ function HistoryView({
2194
2238
  {
2195
2239
  id: "action",
2196
2240
  header: "Action",
2197
- accessor: (row) => row.action,
2241
+ accessor: (row) => {
2242
+ if (row.isValid) return row.action;
2243
+ return /* @__PURE__ */ jsxs18(Fragment10, { children: [
2244
+ row.action,
2245
+ /* @__PURE__ */ jsxs18("span", { style: { color: "red", display: "block" }, children: [
2246
+ "Invalid transaction: ",
2247
+ row.validationErrorMessage
2248
+ ] })
2249
+ ] });
2250
+ },
2198
2251
  sortable: false,
2199
2252
  filterable: true,
2200
2253
  sortFn: (a, b) => a.action.localeCompare(b.action)
@@ -2208,20 +2261,17 @@ function HistoryView({
2208
2261
  sortFn: (a, b) => a.timestamp.getTime() - b.timestamp.getTime()
2209
2262
  }
2210
2263
  ];
2211
- return /* @__PURE__ */ jsxs17("section", { style: { display: "flex", flexDirection: "column", gap: "1rem" }, children: [
2212
- /* @__PURE__ */ jsx27(Heading, { children: "CoValue history" }),
2213
- /* @__PURE__ */ jsx27(
2214
- DataTable,
2215
- {
2216
- columns,
2217
- data: transactions,
2218
- pageSize: 10,
2219
- initialSort: { columnId: "timestamp", direction: "desc" },
2220
- getRowKey: (row) => row.id,
2221
- emptyMessage: "No history available"
2222
- }
2223
- )
2224
- ] });
2264
+ return /* @__PURE__ */ jsx28(Accordion, { title: "CoValue history", storageKey: "jazz-inspector-show-history", children: /* @__PURE__ */ jsx28(
2265
+ DataTable,
2266
+ {
2267
+ columns,
2268
+ data: transactions,
2269
+ pageSize: 10,
2270
+ initialSort: { columnId: "timestamp", direction: "desc" },
2271
+ getRowKey: (row) => row.id,
2272
+ emptyMessage: "No history available"
2273
+ }
2274
+ ) });
2225
2275
  }
2226
2276
  function getTransactionChanges(tx, coValue) {
2227
2277
  if (tx.isValid === false && tx.tx.privacy === "private") {
@@ -2245,7 +2295,8 @@ function getHistory(coValue) {
2245
2295
  author: tx.author,
2246
2296
  action: mapTransactionToAction(change, coValue),
2247
2297
  timestamp: new Date(tx.currentMadeAt),
2248
- isValid: tx.isValid
2298
+ isValid: tx.isValid,
2299
+ validationErrorMessage: tx.validationErrorMessage
2249
2300
  }));
2250
2301
  });
2251
2302
  }
@@ -2309,7 +2360,7 @@ function mapTransactionToAction(change, coValue) {
2309
2360
  return `Stream ended`;
2310
2361
  }
2311
2362
  if (isPropertySet(change)) {
2312
- return `Property "${change.key}" has been set to "${change.value}"`;
2363
+ return `Property "${change.key}" has been set to ${JSON.stringify(change.value)}`;
2313
2364
  }
2314
2365
  if (isPropertyDeletion(change)) {
2315
2366
  return `Property "${change.key}" has been deleted`;
@@ -2360,7 +2411,7 @@ var isStreamChunk = (change) => {
2360
2411
  var isStreamEnd = (change) => {
2361
2412
  return change?.type === "end";
2362
2413
  };
2363
- var RedTooltip2 = styled16("span")`
2414
+ var RedTooltip2 = styled17("span")`
2364
2415
  position:relative; /* making the .tooltip span a container for the tooltip text */
2365
2416
  border-bottom:1px dashed #000; /* little indicater to indicate it's hoverable */
2366
2417
 
@@ -2393,11 +2444,11 @@ var RedTooltip2 = styled16("span")`
2393
2444
  `;
2394
2445
 
2395
2446
  // src/inspector/viewer/page.tsx
2396
- import { Fragment as Fragment11, jsx as jsx28, jsxs as jsxs18 } from "react/jsx-runtime";
2447
+ import { Fragment as Fragment11, jsx as jsx29, jsxs as jsxs19 } from "react/jsx-runtime";
2397
2448
  var BasePageContainer = React5.forwardRef(
2398
- ({ isTopLevel, ...rest }, ref) => /* @__PURE__ */ jsx28("div", { ref, ...rest })
2449
+ ({ isTopLevel, ...rest }, ref) => /* @__PURE__ */ jsx29("div", { ref, ...rest })
2399
2450
  );
2400
- var PageContainer = styled17(BasePageContainer)`
2451
+ var PageContainer = styled18(BasePageContainer)`
2401
2452
  position: absolute;
2402
2453
  z-index: 10;
2403
2454
  inset: 0;
@@ -2405,36 +2456,36 @@ var PageContainer = styled17(BasePageContainer)`
2405
2456
  height: 100%;
2406
2457
  padding: 0 0.75rem;
2407
2458
  `;
2408
- var BackButton = styled17("div")`
2459
+ var BackButton = styled18("div")`
2409
2460
  position: absolute;
2410
2461
  left: 0;
2411
2462
  right: 0;
2412
2463
  top: 0;
2413
2464
  height: 2.5rem;
2414
2465
  `;
2415
- var HeaderContainer = styled17("div")`
2466
+ var HeaderContainer = styled18("div")`
2416
2467
  display: flex;
2417
2468
  justify-content: space-between;
2418
2469
  align-items: center;
2419
2470
  margin-bottom: 1rem;
2420
2471
  `;
2421
- var TitleContainer = styled17("div")`
2472
+ var TitleContainer = styled18("div")`
2422
2473
  display: flex;
2423
2474
  align-items: center;
2424
2475
  gap: 0.75rem;
2425
2476
  `;
2426
- var Title = styled17(Heading)`
2477
+ var Title = styled18(Heading)`
2427
2478
  display: flex;
2428
2479
  flex-direction: column;
2429
2480
  align-items: flex-start;
2430
2481
  gap: 0.25rem;
2431
2482
  `;
2432
- var BadgeContainer = styled17("div")`
2483
+ var BadgeContainer = styled18("div")`
2433
2484
  display: flex;
2434
2485
  align-items: center;
2435
2486
  gap: 0.75rem;
2436
2487
  `;
2437
- var ContentContainer = styled17("div")`
2488
+ var ContentContainer = styled18("div")`
2438
2489
  overflow: auto;
2439
2490
  display: flex;
2440
2491
  flex-direction: column;
@@ -2455,7 +2506,7 @@ function View(props) {
2455
2506
  const { node, onNavigate } = props;
2456
2507
  if (!snapshot || snapshot === "unavailable") return;
2457
2508
  if (type === "costream") {
2458
- return /* @__PURE__ */ jsx28(
2509
+ return /* @__PURE__ */ jsx29(
2459
2510
  CoStreamView,
2460
2511
  {
2461
2512
  data: snapshot,
@@ -2466,7 +2517,7 @@ function View(props) {
2466
2517
  );
2467
2518
  }
2468
2519
  if (extendedType === "group") {
2469
- return /* @__PURE__ */ jsx28(
2520
+ return /* @__PURE__ */ jsx29(
2470
2521
  GroupView,
2471
2522
  {
2472
2523
  coValue: value,
@@ -2477,10 +2528,10 @@ function View(props) {
2477
2528
  );
2478
2529
  }
2479
2530
  if (extendedType === "account") {
2480
- return /* @__PURE__ */ jsx28(AccountView, { data: snapshot, node, onNavigate });
2531
+ return /* @__PURE__ */ jsx29(AccountView, { data: snapshot, node, onNavigate });
2481
2532
  }
2482
2533
  if (type === "coplaintext") {
2483
- return /* @__PURE__ */ jsx28(CoPlainTextView, { data: snapshot });
2534
+ return /* @__PURE__ */ jsx29(CoPlainTextView, { data: snapshot });
2484
2535
  }
2485
2536
  if (type === "colist") {
2486
2537
  const handleRemove = (index) => {
@@ -2489,7 +2540,7 @@ function View(props) {
2489
2540
  list.delete(index);
2490
2541
  }
2491
2542
  };
2492
- return /* @__PURE__ */ jsx28(
2543
+ return /* @__PURE__ */ jsx29(
2493
2544
  TableView,
2494
2545
  {
2495
2546
  data: snapshot,
@@ -2500,9 +2551,9 @@ function View(props) {
2500
2551
  );
2501
2552
  }
2502
2553
  if (extendedType === "record") {
2503
- return /* @__PURE__ */ jsx28(TableView, { data: snapshot, node, onNavigate });
2554
+ return /* @__PURE__ */ jsx29(TableView, { data: snapshot, node, onNavigate });
2504
2555
  }
2505
- return /* @__PURE__ */ jsx28(GridView, { data: snapshot, onNavigate, node });
2556
+ return /* @__PURE__ */ jsx29(GridView, { data: snapshot, onNavigate, node });
2506
2557
  }
2507
2558
  function Page(props) {
2508
2559
  const {
@@ -2518,13 +2569,13 @@ function Page(props) {
2518
2569
  const coValue = useResolvedCoValue(coId, node);
2519
2570
  const { value, snapshot, type, extendedType } = coValue;
2520
2571
  if (snapshot === "unavailable") {
2521
- return /* @__PURE__ */ jsx28("div", { style, children: "Data unavailable" });
2572
+ return /* @__PURE__ */ jsx29("div", { style, children: "Data unavailable" });
2522
2573
  }
2523
2574
  if (!snapshot) {
2524
- return /* @__PURE__ */ jsx28("div", { style });
2575
+ return /* @__PURE__ */ jsx29("div", { style });
2525
2576
  }
2526
- return /* @__PURE__ */ jsxs18(PageContainer, { style, className, isTopLevel, children: [
2527
- !isTopLevel && /* @__PURE__ */ jsx28(
2577
+ return /* @__PURE__ */ jsxs19(PageContainer, { style, className, isTopLevel, children: [
2578
+ !isTopLevel && /* @__PURE__ */ jsx29(
2528
2579
  BackButton,
2529
2580
  {
2530
2581
  "aria-label": "Back",
@@ -2534,27 +2585,27 @@ function Page(props) {
2534
2585
  "aria-hidden": "true"
2535
2586
  }
2536
2587
  ),
2537
- /* @__PURE__ */ jsx28(HeaderContainer, { children: /* @__PURE__ */ jsxs18(TitleContainer, { children: [
2538
- /* @__PURE__ */ jsx28(Title, { children: /* @__PURE__ */ jsxs18("span", { children: [
2588
+ /* @__PURE__ */ jsx29(HeaderContainer, { children: /* @__PURE__ */ jsxs19(TitleContainer, { children: [
2589
+ /* @__PURE__ */ jsx29(Title, { children: /* @__PURE__ */ jsxs19("span", { children: [
2539
2590
  name,
2540
- typeof snapshot === "object" && "name" in snapshot ? /* @__PURE__ */ jsxs18("span", { style: { color: "#57534e", fontWeight: 500 }, children: [
2591
+ typeof snapshot === "object" && "name" in snapshot ? /* @__PURE__ */ jsxs19("span", { style: { color: "#57534e", fontWeight: 500 }, children: [
2541
2592
  " ",
2542
2593
  snapshot.name
2543
2594
  ] }) : null
2544
2595
  ] }) }),
2545
- /* @__PURE__ */ jsxs18(BadgeContainer, { children: [
2546
- /* @__PURE__ */ jsx28(Badge, { children: type && /* @__PURE__ */ jsx28(TypeIcon, { type, extendedType }) }),
2547
- /* @__PURE__ */ jsx28(Badge, { children: coId })
2596
+ /* @__PURE__ */ jsxs19(BadgeContainer, { children: [
2597
+ /* @__PURE__ */ jsx29(Badge, { children: type && /* @__PURE__ */ jsx29(TypeIcon, { type, extendedType }) }),
2598
+ /* @__PURE__ */ jsx29(Badge, { children: coId })
2548
2599
  ] })
2549
2600
  ] }) }),
2550
- /* @__PURE__ */ jsxs18(ContentContainer, { children: [
2551
- /* @__PURE__ */ jsx28(View, { ...props, coValue }),
2552
- extendedType !== "account" && extendedType !== "group" && /* @__PURE__ */ jsxs18(Fragment11, { children: [
2553
- /* @__PURE__ */ jsx28(RoleDisplay, { node, value }),
2554
- /* @__PURE__ */ jsxs18(Text, { muted: true, children: [
2601
+ /* @__PURE__ */ jsxs19(ContentContainer, { children: [
2602
+ /* @__PURE__ */ jsx29(View, { ...props, coValue }),
2603
+ extendedType !== "account" && extendedType !== "group" && /* @__PURE__ */ jsxs19(Fragment11, { children: [
2604
+ /* @__PURE__ */ jsx29(RoleDisplay, { node, value }),
2605
+ /* @__PURE__ */ jsxs19(Text, { muted: true, children: [
2555
2606
  "Owned by",
2556
2607
  " ",
2557
- /* @__PURE__ */ jsx28(
2608
+ /* @__PURE__ */ jsx29(
2558
2609
  AccountOrGroupText,
2559
2610
  {
2560
2611
  coId: value.group.id,
@@ -2567,14 +2618,46 @@ function Page(props) {
2567
2618
  )
2568
2619
  ] })
2569
2620
  ] }),
2570
- value && /* @__PURE__ */ jsx28(HistoryView, { coValue: value, node })
2621
+ value && /* @__PURE__ */ jsx29(HistoryView, { coValue: value, node })
2571
2622
  ] })
2572
2623
  ] });
2573
2624
  }
2574
2625
 
2626
+ // src/inspector/ui/error-boundary.tsx
2627
+ import React6 from "react";
2628
+ import { styled as styled19 } from "goober";
2629
+ import { jsx as jsx30, jsxs as jsxs20 } from "react/jsx-runtime";
2630
+ var ErrorBoundary = class extends React6.Component {
2631
+ constructor(props) {
2632
+ super(props);
2633
+ this.state = { hasError: false };
2634
+ }
2635
+ static getDerivedStateFromError(error) {
2636
+ return { hasError: true, error };
2637
+ }
2638
+ componentDidCatch(error, errorInfo) {
2639
+ console.error(error);
2640
+ }
2641
+ render() {
2642
+ if (this.state.hasError) {
2643
+ return /* @__PURE__ */ jsxs20("div", { style: { padding: "1rem" }, children: [
2644
+ /* @__PURE__ */ jsx30(StyledHeading2, { children: this.props.title }),
2645
+ /* @__PURE__ */ jsx30(Text, { mono: true, style: { marginTop: "0.5rem", color: "#ef4444" }, children: this.state.error?.message || "An unexpected error occurred" }),
2646
+ /* @__PURE__ */ jsx30("pre", { style: { paddingLeft: "1rem", color: "#ef4444" }, children: this.state.error?.stack })
2647
+ ] });
2648
+ }
2649
+ return this.props.children;
2650
+ }
2651
+ };
2652
+ var StyledHeading2 = styled19("h1")`
2653
+ font-size: 1.125rem;
2654
+ font-weight: 500;
2655
+ color: var(--j-text-color-strong);
2656
+ `;
2657
+
2575
2658
  // src/inspector/viewer/page-stack.tsx
2576
- import { Fragment as Fragment12, jsx as jsx29, jsxs as jsxs19 } from "react/jsx-runtime";
2577
- var PageStackContainer = styled18("div")`
2659
+ import { Fragment as Fragment12, jsx as jsx31, jsxs as jsxs21 } from "react/jsx-runtime";
2660
+ var PageStackContainer = styled20("div")`
2578
2661
  position: relative;
2579
2662
  padding: 0 0.75rem;
2580
2663
  overflow-y: auto;
@@ -2591,9 +2674,9 @@ function PageStack({
2591
2674
  }) {
2592
2675
  const page = path[path.length - 1];
2593
2676
  const index = path.length - 1;
2594
- return /* @__PURE__ */ jsx29(Fragment12, { children: /* @__PURE__ */ jsxs19(PageStackContainer, { children: [
2677
+ return /* @__PURE__ */ jsx31(Fragment12, { children: /* @__PURE__ */ jsxs21(PageStackContainer, { children: [
2595
2678
  children,
2596
- node && page && /* @__PURE__ */ jsx29(
2679
+ node && page && /* @__PURE__ */ jsx31(ErrorBoundary, { title: "An error occurred while rendering this CoValue", children: /* @__PURE__ */ jsx31(
2597
2680
  Page,
2598
2681
  {
2599
2682
  coId: page.coId,
@@ -2603,15 +2686,15 @@ function PageStack({
2603
2686
  onNavigate: addPages,
2604
2687
  isTopLevel: index === path.length - 1
2605
2688
  }
2606
- )
2689
+ ) })
2607
2690
  ] }) });
2608
2691
  }
2609
2692
 
2610
2693
  // src/inspector/viewer/use-page-path.ts
2611
- import { useCallback, useEffect as useEffect7, useState as useState9 } from "react";
2694
+ import { useCallback, useEffect as useEffect8, useState as useState10 } from "react";
2612
2695
  var STORAGE_KEY = "jazz-inspector-paths";
2613
2696
  function usePagePath(defaultPath) {
2614
- const [path, setPath] = useState9(() => {
2697
+ const [path, setPath] = useState10(() => {
2615
2698
  if (typeof window === "undefined") return [];
2616
2699
  const stored = localStorage.getItem(STORAGE_KEY);
2617
2700
  if (stored) {
@@ -2627,7 +2710,7 @@ function usePagePath(defaultPath) {
2627
2710
  setPath(newPath);
2628
2711
  localStorage.setItem(STORAGE_KEY, JSON.stringify(newPath));
2629
2712
  }, []);
2630
- useEffect7(() => {
2713
+ useEffect8(() => {
2631
2714
  if (defaultPath && JSON.stringify(path) !== JSON.stringify(defaultPath)) {
2632
2715
  updatePath(defaultPath);
2633
2716
  }
@@ -2665,8 +2748,8 @@ function usePagePath(defaultPath) {
2665
2748
  }
2666
2749
 
2667
2750
  // src/inspector/ui/global-styles.tsx
2668
- import { styled as styled19 } from "goober";
2669
- var GlobalStyles = styled19("div")`
2751
+ import { styled as styled21 } from "goober";
2752
+ var GlobalStyles = styled21("div")`
2670
2753
  /* Colors */
2671
2754
  --j-primary-color: #146AFF;
2672
2755
  --j-link-color: var(--j-primary-color);
@@ -2740,9 +2823,9 @@ var GlobalStyles = styled19("div")`
2740
2823
  `;
2741
2824
 
2742
2825
  // src/inspector/viewer/inspector-button.tsx
2743
- import { styled as styled20 } from "goober";
2744
- import { jsx as jsx30, jsxs as jsxs20 } from "react/jsx-runtime";
2745
- var StyledInspectorButton = styled20("button")`
2826
+ import { styled as styled22 } from "goober";
2827
+ import { jsx as jsx32, jsxs as jsxs22 } from "react/jsx-runtime";
2828
+ var StyledInspectorButton = styled22("button")`
2746
2829
  position: fixed;
2747
2830
  width: 2.5rem;
2748
2831
  height: 2.5rem;
@@ -2773,7 +2856,7 @@ var StyledInspectorButton = styled20("button")`
2773
2856
  }
2774
2857
  }}
2775
2858
  `;
2776
- var JazzIcon = styled20("svg")`
2859
+ var JazzIcon = styled22("svg")`
2777
2860
  width: 100%;
2778
2861
  height: auto;
2779
2862
  position: relative;
@@ -2784,8 +2867,8 @@ function InspectorButton({
2784
2867
  position = "right",
2785
2868
  ...buttonProps
2786
2869
  }) {
2787
- return /* @__PURE__ */ jsxs20(StyledInspectorButton, { position, ...buttonProps, children: [
2788
- /* @__PURE__ */ jsx30(
2870
+ return /* @__PURE__ */ jsxs22(StyledInspectorButton, { position, ...buttonProps, children: [
2871
+ /* @__PURE__ */ jsx32(
2789
2872
  JazzIcon,
2790
2873
  {
2791
2874
  xmlns: "http://www.w3.org/2000/svg",
@@ -2793,7 +2876,7 @@ function InspectorButton({
2793
2876
  height: "115",
2794
2877
  viewBox: "0 0 119 115",
2795
2878
  fill: "none",
2796
- children: /* @__PURE__ */ jsx30(
2879
+ children: /* @__PURE__ */ jsx32(
2797
2880
  "path",
2798
2881
  {
2799
2882
  fillRule: "evenodd",
@@ -2804,7 +2887,7 @@ function InspectorButton({
2804
2887
  )
2805
2888
  }
2806
2889
  ),
2807
- /* @__PURE__ */ jsx30(
2890
+ /* @__PURE__ */ jsx32(
2808
2891
  "span",
2809
2892
  {
2810
2893
  style: {
@@ -2825,30 +2908,30 @@ function InspectorButton({
2825
2908
  }
2826
2909
 
2827
2910
  // src/inspector/viewer/use-open-inspector.ts
2828
- import { useEffect as useEffect8, useState as useState10 } from "react";
2911
+ import { useEffect as useEffect9, useState as useState11 } from "react";
2829
2912
  var STORAGE_KEY2 = "jazz-inspector-open";
2830
2913
  function useOpenInspector() {
2831
- const [open, setOpen] = useState10(() => {
2914
+ const [open, setOpen] = useState11(() => {
2832
2915
  if (typeof window === "undefined") return false;
2833
2916
  const stored = localStorage.getItem(STORAGE_KEY2);
2834
2917
  return stored ? JSON.parse(stored) : false;
2835
2918
  });
2836
- useEffect8(() => {
2919
+ useEffect9(() => {
2837
2920
  localStorage.setItem(STORAGE_KEY2, JSON.stringify(open));
2838
2921
  }, [open]);
2839
2922
  return [open, setOpen];
2840
2923
  }
2841
2924
 
2842
2925
  // src/inspector/viewer/delete-local-data.tsx
2843
- import { useState as useState11 } from "react";
2844
- import { Fragment as Fragment13, jsx as jsx31, jsxs as jsxs21 } from "react/jsx-runtime";
2926
+ import { useState as useState12 } from "react";
2927
+ import { Fragment as Fragment13, jsx as jsx33, jsxs as jsxs23 } from "react/jsx-runtime";
2845
2928
  var DELETE_LOCAL_DATA_STRING = "delete my local data";
2846
2929
  function DeleteLocalData() {
2847
- const [showDeleteModal, setShowDeleteModal] = useState11(false);
2848
- const [confirmDeleteString, setConfirmDeleteString] = useState11("");
2849
- return /* @__PURE__ */ jsxs21(Fragment13, { children: [
2850
- /* @__PURE__ */ jsx31(Button, { variant: "destructive", onClick: () => setShowDeleteModal(true), children: "Delete my local data" }),
2851
- /* @__PURE__ */ jsxs21(
2930
+ const [showDeleteModal, setShowDeleteModal] = useState12(false);
2931
+ const [confirmDeleteString, setConfirmDeleteString] = useState12("");
2932
+ return /* @__PURE__ */ jsxs23(Fragment13, { children: [
2933
+ /* @__PURE__ */ jsx33(Button, { variant: "destructive", onClick: () => setShowDeleteModal(true), children: "Delete my local data" }),
2934
+ /* @__PURE__ */ jsxs23(
2852
2935
  Modal,
2853
2936
  {
2854
2937
  isOpen: showDeleteModal,
@@ -2856,7 +2939,7 @@ function DeleteLocalData() {
2856
2939
  heading: "Delete Local Data",
2857
2940
  showButtons: false,
2858
2941
  children: [
2859
- /* @__PURE__ */ jsxs21(
2942
+ /* @__PURE__ */ jsxs23(
2860
2943
  "div",
2861
2944
  {
2862
2945
  style: {
@@ -2867,33 +2950,33 @@ function DeleteLocalData() {
2867
2950
  gap: "0.5rem"
2868
2951
  },
2869
2952
  children: [
2870
- /* @__PURE__ */ jsxs21("p", { children: [
2953
+ /* @__PURE__ */ jsxs23("p", { children: [
2871
2954
  "This action ",
2872
- /* @__PURE__ */ jsx31("strong", { children: "cannot" }),
2955
+ /* @__PURE__ */ jsx33("strong", { children: "cannot" }),
2873
2956
  " be undone."
2874
2957
  ] }),
2875
- /* @__PURE__ */ jsxs21("p", { children: [
2958
+ /* @__PURE__ */ jsxs23("p", { children: [
2876
2959
  "Be aware that the following data will be",
2877
2960
  " ",
2878
- /* @__PURE__ */ jsx31("strong", { children: "permanently" }),
2961
+ /* @__PURE__ */ jsx33("strong", { children: "permanently" }),
2879
2962
  " deleted:"
2880
2963
  ] }),
2881
- /* @__PURE__ */ jsxs21("ul", { style: { listStyleType: "disc", paddingLeft: "1rem" }, children: [
2882
- /* @__PURE__ */ jsxs21("li", { children: [
2964
+ /* @__PURE__ */ jsxs23("ul", { style: { listStyleType: "disc", paddingLeft: "1rem" }, children: [
2965
+ /* @__PURE__ */ jsxs23("li", { children: [
2883
2966
  "Unsynced data for ",
2884
- /* @__PURE__ */ jsx31("strong", { children: "all apps" }),
2967
+ /* @__PURE__ */ jsx33("strong", { children: "all apps" }),
2885
2968
  " on",
2886
2969
  " ",
2887
- /* @__PURE__ */ jsx31("code", { children: window.location.origin })
2970
+ /* @__PURE__ */ jsx33("code", { children: window.location.origin })
2888
2971
  ] }),
2889
- /* @__PURE__ */ jsx31("li", { children: "Accounts" }),
2890
- /* @__PURE__ */ jsx31("li", { children: "Logged in sessions" })
2972
+ /* @__PURE__ */ jsx33("li", { children: "Accounts" }),
2973
+ /* @__PURE__ */ jsx33("li", { children: "Logged in sessions" })
2891
2974
  ] }),
2892
- /* @__PURE__ */ jsx31("p", {})
2975
+ /* @__PURE__ */ jsx33("p", {})
2893
2976
  ]
2894
2977
  }
2895
2978
  ),
2896
- /* @__PURE__ */ jsx31(
2979
+ /* @__PURE__ */ jsx33(
2897
2980
  Input,
2898
2981
  {
2899
2982
  label: `Type "${DELETE_LOCAL_DATA_STRING}" to confirm`,
@@ -2904,7 +2987,7 @@ function DeleteLocalData() {
2904
2987
  }
2905
2988
  }
2906
2989
  ),
2907
- /* @__PURE__ */ jsx31(
2990
+ /* @__PURE__ */ jsx33(
2908
2991
  "p",
2909
2992
  {
2910
2993
  style: {
@@ -2914,14 +2997,14 @@ function DeleteLocalData() {
2914
2997
  flexDirection: "column",
2915
2998
  gap: "0.5rem"
2916
2999
  },
2917
- children: /* @__PURE__ */ jsxs21("small", { children: [
3000
+ children: /* @__PURE__ */ jsxs23("small", { children: [
2918
3001
  "Data synced to a sync server will ",
2919
- /* @__PURE__ */ jsx31("strong", { children: "not" }),
3002
+ /* @__PURE__ */ jsx33("strong", { children: "not" }),
2920
3003
  " be deleted, and will be synced when you log in again."
2921
3004
  ] })
2922
3005
  }
2923
3006
  ),
2924
- /* @__PURE__ */ jsxs21(
3007
+ /* @__PURE__ */ jsxs23(
2925
3008
  "div",
2926
3009
  {
2927
3010
  style: {
@@ -2931,8 +3014,8 @@ function DeleteLocalData() {
2931
3014
  gap: "0.5rem"
2932
3015
  },
2933
3016
  children: [
2934
- /* @__PURE__ */ jsx31(Button, { variant: "secondary", onClick: () => setShowDeleteModal(false), children: "Cancel" }),
2935
- /* @__PURE__ */ jsx31(
3017
+ /* @__PURE__ */ jsx33(Button, { variant: "secondary", onClick: () => setShowDeleteModal(false), children: "Cancel" }),
3018
+ /* @__PURE__ */ jsx33(
2936
3019
  Button,
2937
3020
  {
2938
3021
  variant: "destructive",
@@ -2959,8 +3042,8 @@ function DeleteLocalData() {
2959
3042
  }
2960
3043
 
2961
3044
  // src/inspector/viewer/new-app.tsx
2962
- import { Fragment as Fragment14, jsx as jsx32, jsxs as jsxs22 } from "react/jsx-runtime";
2963
- var InspectorContainer = styled21("div")`
3045
+ import { Fragment as Fragment14, jsx as jsx34, jsxs as jsxs24 } from "react/jsx-runtime";
3046
+ var InspectorContainer = styled23("div")`
2964
3047
  position: fixed;
2965
3048
  height: 50vh;
2966
3049
  max-height: 800px;
@@ -2977,17 +3060,17 @@ var InspectorContainer = styled21("div")`
2977
3060
  background-color: var(--j-background);
2978
3061
  }
2979
3062
  `;
2980
- var HeaderContainer2 = styled21("div")`
3063
+ var HeaderContainer2 = styled23("div")`
2981
3064
  display: flex;
2982
3065
  align-items: center;
2983
3066
  gap: 1rem;
2984
3067
  padding: 0 0.75rem;
2985
3068
  margin: 0.75rem 0;
2986
3069
  `;
2987
- var Form = styled21("form")`
3070
+ var Form = styled23("form")`
2988
3071
  width: 24rem;
2989
3072
  `;
2990
- var InitialForm = styled21("form")`
3073
+ var InitialForm = styled23("form")`
2991
3074
  display: flex;
2992
3075
  flex-direction: column;
2993
3076
  position: relative;
@@ -2999,7 +3082,7 @@ var InitialForm = styled21("form")`
2999
3082
  max-width: 24rem;
3000
3083
  margin: 0 auto;
3001
3084
  `;
3002
- var OrText = styled21("p")`
3085
+ var OrText = styled23("p")`
3003
3086
  text-align: center;
3004
3087
  `;
3005
3088
  function JazzInspectorInternal({
@@ -3008,7 +3091,7 @@ function JazzInspectorInternal({
3008
3091
  accountId
3009
3092
  }) {
3010
3093
  const [open, setOpen] = useOpenInspector();
3011
- const [coValueId, setCoValueId] = useState12("");
3094
+ const [coValueId, setCoValueId] = useState13("");
3012
3095
  const { path, addPages, goToIndex, goBack, setPage } = usePagePath();
3013
3096
  const handleCoValueIdSubmit = (e) => {
3014
3097
  e.preventDefault();
@@ -3018,12 +3101,12 @@ function JazzInspectorInternal({
3018
3101
  setCoValueId("");
3019
3102
  };
3020
3103
  if (!open) {
3021
- return /* @__PURE__ */ jsx32(InspectorButton, { position, onClick: () => setOpen(true) });
3104
+ return /* @__PURE__ */ jsx34(InspectorButton, { position, onClick: () => setOpen(true) });
3022
3105
  }
3023
- return /* @__PURE__ */ jsxs22(InspectorContainer, { as: GlobalStyles, style: { zIndex: 999 }, children: [
3024
- /* @__PURE__ */ jsxs22(HeaderContainer2, { children: [
3025
- /* @__PURE__ */ jsx32(Breadcrumbs, { path, onBreadcrumbClick: goToIndex }),
3026
- path.length !== 0 && /* @__PURE__ */ jsx32(Form, { onSubmit: handleCoValueIdSubmit, children: /* @__PURE__ */ jsx32(
3106
+ return /* @__PURE__ */ jsxs24(InspectorContainer, { as: GlobalStyles, style: { zIndex: 999 }, children: [
3107
+ /* @__PURE__ */ jsxs24(HeaderContainer2, { children: [
3108
+ /* @__PURE__ */ jsx34(Breadcrumbs, { path, onBreadcrumbClick: goToIndex }),
3109
+ path.length !== 0 && /* @__PURE__ */ jsx34(Form, { onSubmit: handleCoValueIdSubmit, children: /* @__PURE__ */ jsx34(
3027
3110
  Input,
3028
3111
  {
3029
3112
  label: "CoValue ID",
@@ -3034,24 +3117,24 @@ function JazzInspectorInternal({
3034
3117
  onChange: (e) => setCoValueId(e.target.value)
3035
3118
  }
3036
3119
  ) }),
3037
- /* @__PURE__ */ jsx32(DeleteLocalData, {}),
3038
- /* @__PURE__ */ jsx32(Button, { variant: "plain", type: "button", onClick: () => setOpen(false), children: "Close" })
3120
+ /* @__PURE__ */ jsx34(DeleteLocalData, {}),
3121
+ /* @__PURE__ */ jsx34(Button, { variant: "plain", type: "button", onClick: () => setOpen(false), children: "Close" })
3039
3122
  ] }),
3040
- /* @__PURE__ */ jsx32(
3123
+ /* @__PURE__ */ jsx34(
3041
3124
  PageStack,
3042
3125
  {
3043
3126
  path,
3044
3127
  node: localNode,
3045
3128
  goBack,
3046
3129
  addPages,
3047
- children: path.length <= 0 && /* @__PURE__ */ jsxs22(
3130
+ children: path.length <= 0 && /* @__PURE__ */ jsxs24(
3048
3131
  InitialForm,
3049
3132
  {
3050
3133
  onSubmit: handleCoValueIdSubmit,
3051
3134
  "aria-hidden": path.length !== 0,
3052
3135
  children: [
3053
- /* @__PURE__ */ jsx32(Heading, { children: "Jazz CoValue Inspector" }),
3054
- /* @__PURE__ */ jsx32(
3136
+ /* @__PURE__ */ jsx34(Heading, { children: "Jazz CoValue Inspector" }),
3137
+ /* @__PURE__ */ jsx34(
3055
3138
  Input,
3056
3139
  {
3057
3140
  label: "CoValue ID",
@@ -3062,10 +3145,10 @@ function JazzInspectorInternal({
3062
3145
  onChange: (e) => setCoValueId(e.target.value)
3063
3146
  }
3064
3147
  ),
3065
- /* @__PURE__ */ jsx32(Button, { type: "submit", variant: "primary", children: "Inspect CoValue" }),
3066
- accountId && /* @__PURE__ */ jsxs22(Fragment14, { children: [
3067
- /* @__PURE__ */ jsx32(OrText, { children: "or" }),
3068
- /* @__PURE__ */ jsx32(
3148
+ /* @__PURE__ */ jsx34(Button, { type: "submit", variant: "primary", children: "Inspect CoValue" }),
3149
+ accountId && /* @__PURE__ */ jsxs24(Fragment14, { children: [
3150
+ /* @__PURE__ */ jsx34(OrText, { children: "or" }),
3151
+ /* @__PURE__ */ jsx34(
3069
3152
  Button,
3070
3153
  {
3071
3154
  variant: "secondary",
@@ -3088,12 +3171,12 @@ function JazzInspectorInternal({
3088
3171
  // src/inspector/index.tsx
3089
3172
  import { setup } from "goober";
3090
3173
  import { useJazzContext } from "jazz-tools/react-core";
3091
- import { jsx as jsx33 } from "react/jsx-runtime";
3174
+ import { jsx as jsx35 } from "react/jsx-runtime";
3092
3175
  function JazzInspector({ position = "right" }) {
3093
3176
  const context = useJazzContext();
3094
3177
  const localNode = context.node;
3095
3178
  const me = "me" in context ? context.me : void 0;
3096
- return /* @__PURE__ */ jsx33(
3179
+ return /* @__PURE__ */ jsx35(
3097
3180
  JazzInspectorInternal,
3098
3181
  {
3099
3182
  position,
@@ -3102,7 +3185,7 @@ function JazzInspector({ position = "right" }) {
3102
3185
  }
3103
3186
  );
3104
3187
  }
3105
- setup(React7.createElement);
3188
+ setup(React8.createElement);
3106
3189
  export {
3107
3190
  AccountOrGroupText,
3108
3191
  Breadcrumbs,