jazz-tools 0.18.36 → 0.18.37
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/.turbo/turbo-build.log +57 -57
- package/CHANGELOG.md +13 -0
- package/dist/inspector/{custom-element-RBBL46TI.js → custom-element-SUVJ7CPN.js} +480 -407
- package/dist/inspector/custom-element-SUVJ7CPN.js.map +1 -0
- package/dist/inspector/index.js +447 -374
- package/dist/inspector/index.js.map +1 -1
- package/dist/inspector/register-custom-element.js +1 -1
- package/dist/inspector/ui/accordion.d.ts +8 -0
- package/dist/inspector/ui/accordion.d.ts.map +1 -0
- package/dist/inspector/ui/error-boundary.d.ts +19 -0
- package/dist/inspector/ui/error-boundary.d.ts.map +1 -0
- package/dist/inspector/ui/index.d.ts +1 -0
- package/dist/inspector/ui/index.d.ts.map +1 -1
- package/dist/inspector/ui/text.d.ts +1 -0
- package/dist/inspector/ui/text.d.ts.map +1 -1
- package/dist/inspector/viewer/history-view.d.ts.map +1 -1
- package/dist/inspector/viewer/page-stack.d.ts.map +1 -1
- package/dist/inspector/viewer/raw-data-card.d.ts.map +1 -1
- package/dist/tools/exports.d.ts +1 -1
- package/dist/tools/exports.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/inspector/tests/viewer/history-view.test.tsx +46 -4
- package/src/inspector/ui/accordion.tsx +52 -0
- package/src/inspector/ui/error-boundary.tsx +51 -0
- package/src/inspector/ui/index.ts +1 -0
- package/src/inspector/ui/text.tsx +1 -0
- package/src/inspector/viewer/history-view.tsx +4 -6
- package/src/inspector/viewer/page-stack.tsx +11 -8
- package/src/inspector/viewer/raw-data-card.tsx +11 -11
- package/src/inspector/viewer/use-resolve-covalue.ts +2 -2
- package/src/tools/exports.ts +1 -0
- package/dist/inspector/custom-element-RBBL46TI.js.map +0 -1
package/dist/inspector/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
// src/inspector/index.tsx
|
|
4
|
-
import
|
|
4
|
+
import React8 from "react";
|
|
5
5
|
|
|
6
6
|
// src/inspector/viewer/new-app.tsx
|
|
7
|
-
import { styled as
|
|
8
|
-
import { useState as
|
|
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
|
|
183
|
+
import { styled as styled20 } from "goober";
|
|
184
184
|
|
|
185
185
|
// src/inspector/viewer/page.tsx
|
|
186
|
-
import { styled as
|
|
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(
|
|
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(
|
|
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
|
|
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
|
|
1321
|
-
import { forwardRef as forwardRef3, useEffect as
|
|
1322
|
-
import { jsx as
|
|
1323
|
-
var ModalContent =
|
|
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 =
|
|
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 =
|
|
1231
|
+
var ModalBody = styled12("div")`
|
|
1344
1232
|
padding: 1rem 1.5rem;
|
|
1345
1233
|
flex: 1;
|
|
1346
1234
|
`;
|
|
1347
|
-
var ModalFooter =
|
|
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 =
|
|
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
|
-
|
|
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__ */
|
|
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__ */
|
|
1419
|
-
/* @__PURE__ */
|
|
1420
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1423
|
-
text && /* @__PURE__ */
|
|
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__ */
|
|
1427
|
-
/* @__PURE__ */
|
|
1428
|
-
/* @__PURE__ */
|
|
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
|
|
1326
|
+
import { styled as styled13 } from "goober";
|
|
1439
1327
|
import { useId as useId2 } from "react";
|
|
1440
|
-
import { jsx as
|
|
1441
|
-
var SelectContainer =
|
|
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 =
|
|
1333
|
+
var SelectWrapper = styled13("div")`
|
|
1446
1334
|
position: relative;
|
|
1447
1335
|
display: flex;
|
|
1448
1336
|
align-items: center;
|
|
1449
1337
|
`;
|
|
1450
|
-
var StyledSelect =
|
|
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 =
|
|
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__ */
|
|
1483
|
-
/* @__PURE__ */
|
|
1484
|
-
/* @__PURE__ */
|
|
1485
|
-
/* @__PURE__ */
|
|
1486
|
-
/* @__PURE__ */
|
|
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
|
|
1493
|
-
|
|
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] =
|
|
1503
|
-
const [sortConfig, setSortConfig] =
|
|
1504
|
-
const [filters, setFilters] =
|
|
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
|
-
|
|
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__ */
|
|
1564
|
-
/* @__PURE__ */
|
|
1565
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1577
|
-
column.sortable && /* @__PURE__ */
|
|
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__ */
|
|
1591
|
-
columns.some((column) => column.filterable) && /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
1639
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
1587
|
+
/* @__PURE__ */ jsxs10("span", { style: { fontSize: "14px" }, children: [
|
|
1658
1588
|
"Page ",
|
|
1659
1589
|
currentPage,
|
|
1660
1590
|
" of ",
|
|
1661
1591
|
totalPages
|
|
1662
1592
|
] }),
|
|
1663
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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 {
|
|
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] =
|
|
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__ */
|
|
1797
|
-
/* @__PURE__ */
|
|
1798
|
-
/* @__PURE__ */
|
|
1799
|
-
/* @__PURE__ */
|
|
1800
|
-
/* @__PURE__ */
|
|
1801
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1804
|
-
everyone.map((member) => /* @__PURE__ */
|
|
1805
|
-
/* @__PURE__ */
|
|
1806
|
-
/* @__PURE__ */
|
|
1807
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1856
|
+
children: /* @__PURE__ */ jsx26(Icon, { name: "delete" })
|
|
1813
1857
|
}
|
|
1814
1858
|
) })
|
|
1815
1859
|
] }, member.id)),
|
|
1816
|
-
members.map((member) => /* @__PURE__ */
|
|
1817
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1829
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1878
|
+
children: /* @__PURE__ */ jsx26(Icon, { name: "delete" })
|
|
1835
1879
|
}
|
|
1836
1880
|
) })
|
|
1837
1881
|
] }, member.id)),
|
|
1838
|
-
parentGroups.map((group) => /* @__PURE__ */
|
|
1839
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1851
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1900
|
+
children: /* @__PURE__ */ jsx26(Icon, { name: "delete" })
|
|
1857
1901
|
}
|
|
1858
1902
|
) })
|
|
1859
1903
|
] }, group.id))
|
|
1860
1904
|
] })
|
|
1861
1905
|
] }),
|
|
1862
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1873
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1878
|
-
/* @__PURE__ */
|
|
1879
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1892
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
1914
|
-
/* @__PURE__ */
|
|
1915
|
-
/* @__PURE__ */
|
|
1916
|
-
/* @__PURE__ */
|
|
1917
|
-
addMemberType === "account" ? /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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
|
|
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__ */
|
|
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
|
|
1978
|
-
import { useMemo as useMemo2, useState as
|
|
1979
|
-
import { Fragment as Fragment9, jsx as
|
|
1980
|
-
var PaginationContainer =
|
|
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 =
|
|
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] =
|
|
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__ */
|
|
2077
|
+
return /* @__PURE__ */ jsx27("div", { children: "No data to display" });
|
|
2034
2078
|
}
|
|
2035
2079
|
if (resolvedRows.length === 0) {
|
|
2036
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
2047
|
-
/* @__PURE__ */
|
|
2048
|
-
/* @__PURE__ */
|
|
2049
|
-
["ID", ...keys, "Action"].map((key) => /* @__PURE__ */
|
|
2050
|
-
onRemove && /* @__PURE__ */
|
|
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__ */
|
|
2053
|
-
/* @__PURE__ */
|
|
2054
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
2145
|
+
onRemove && /* @__PURE__ */ jsx27(TableCell, { children: /* @__PURE__ */ jsx27(Button, { variant: "secondary", onClick: () => onRemove(index), children: "Remove" }) })
|
|
2102
2146
|
] }, index)) })
|
|
2103
2147
|
] }),
|
|
2104
|
-
/* @__PURE__ */
|
|
2105
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
2137
|
-
/* @__PURE__ */
|
|
2138
|
-
/* @__PURE__ */
|
|
2139
|
-
/* @__PURE__ */
|
|
2140
|
-
onRemove && /* @__PURE__ */
|
|
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__ */
|
|
2143
|
-
/* @__PURE__ */
|
|
2144
|
-
/* @__PURE__ */
|
|
2145
|
-
onRemove && /* @__PURE__ */
|
|
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
|
|
2153
|
-
import { Fragment as Fragment10, jsx as
|
|
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__ */
|
|
2167
|
-
row.isValid || /* @__PURE__ */
|
|
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__ */
|
|
2224
|
+
row.author.startsWith("co_") ? /* @__PURE__ */ jsx28(
|
|
2181
2225
|
AccountOrGroupText,
|
|
2182
2226
|
{
|
|
2183
2227
|
coId: row.author,
|
|
@@ -2208,20 +2252,17 @@ function HistoryView({
|
|
|
2208
2252
|
sortFn: (a, b) => a.timestamp.getTime() - b.timestamp.getTime()
|
|
2209
2253
|
}
|
|
2210
2254
|
];
|
|
2211
|
-
return /* @__PURE__ */
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
}
|
|
2223
|
-
)
|
|
2224
|
-
] });
|
|
2255
|
+
return /* @__PURE__ */ jsx28(Accordion, { title: "CoValue history", storageKey: "jazz-inspector-show-history", children: /* @__PURE__ */ jsx28(
|
|
2256
|
+
DataTable,
|
|
2257
|
+
{
|
|
2258
|
+
columns,
|
|
2259
|
+
data: transactions,
|
|
2260
|
+
pageSize: 10,
|
|
2261
|
+
initialSort: { columnId: "timestamp", direction: "desc" },
|
|
2262
|
+
getRowKey: (row) => row.id,
|
|
2263
|
+
emptyMessage: "No history available"
|
|
2264
|
+
}
|
|
2265
|
+
) });
|
|
2225
2266
|
}
|
|
2226
2267
|
function getTransactionChanges(tx, coValue) {
|
|
2227
2268
|
if (tx.isValid === false && tx.tx.privacy === "private") {
|
|
@@ -2309,7 +2350,7 @@ function mapTransactionToAction(change, coValue) {
|
|
|
2309
2350
|
return `Stream ended`;
|
|
2310
2351
|
}
|
|
2311
2352
|
if (isPropertySet(change)) {
|
|
2312
|
-
return `Property "${change.key}" has been set to
|
|
2353
|
+
return `Property "${change.key}" has been set to ${JSON.stringify(change.value)}`;
|
|
2313
2354
|
}
|
|
2314
2355
|
if (isPropertyDeletion(change)) {
|
|
2315
2356
|
return `Property "${change.key}" has been deleted`;
|
|
@@ -2360,7 +2401,7 @@ var isStreamChunk = (change) => {
|
|
|
2360
2401
|
var isStreamEnd = (change) => {
|
|
2361
2402
|
return change?.type === "end";
|
|
2362
2403
|
};
|
|
2363
|
-
var RedTooltip2 =
|
|
2404
|
+
var RedTooltip2 = styled17("span")`
|
|
2364
2405
|
position:relative; /* making the .tooltip span a container for the tooltip text */
|
|
2365
2406
|
border-bottom:1px dashed #000; /* little indicater to indicate it's hoverable */
|
|
2366
2407
|
|
|
@@ -2393,11 +2434,11 @@ var RedTooltip2 = styled16("span")`
|
|
|
2393
2434
|
`;
|
|
2394
2435
|
|
|
2395
2436
|
// src/inspector/viewer/page.tsx
|
|
2396
|
-
import { Fragment as Fragment11, jsx as
|
|
2437
|
+
import { Fragment as Fragment11, jsx as jsx29, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2397
2438
|
var BasePageContainer = React5.forwardRef(
|
|
2398
|
-
({ isTopLevel, ...rest }, ref) => /* @__PURE__ */
|
|
2439
|
+
({ isTopLevel, ...rest }, ref) => /* @__PURE__ */ jsx29("div", { ref, ...rest })
|
|
2399
2440
|
);
|
|
2400
|
-
var PageContainer =
|
|
2441
|
+
var PageContainer = styled18(BasePageContainer)`
|
|
2401
2442
|
position: absolute;
|
|
2402
2443
|
z-index: 10;
|
|
2403
2444
|
inset: 0;
|
|
@@ -2405,36 +2446,36 @@ var PageContainer = styled17(BasePageContainer)`
|
|
|
2405
2446
|
height: 100%;
|
|
2406
2447
|
padding: 0 0.75rem;
|
|
2407
2448
|
`;
|
|
2408
|
-
var BackButton =
|
|
2449
|
+
var BackButton = styled18("div")`
|
|
2409
2450
|
position: absolute;
|
|
2410
2451
|
left: 0;
|
|
2411
2452
|
right: 0;
|
|
2412
2453
|
top: 0;
|
|
2413
2454
|
height: 2.5rem;
|
|
2414
2455
|
`;
|
|
2415
|
-
var HeaderContainer =
|
|
2456
|
+
var HeaderContainer = styled18("div")`
|
|
2416
2457
|
display: flex;
|
|
2417
2458
|
justify-content: space-between;
|
|
2418
2459
|
align-items: center;
|
|
2419
2460
|
margin-bottom: 1rem;
|
|
2420
2461
|
`;
|
|
2421
|
-
var TitleContainer =
|
|
2462
|
+
var TitleContainer = styled18("div")`
|
|
2422
2463
|
display: flex;
|
|
2423
2464
|
align-items: center;
|
|
2424
2465
|
gap: 0.75rem;
|
|
2425
2466
|
`;
|
|
2426
|
-
var Title =
|
|
2467
|
+
var Title = styled18(Heading)`
|
|
2427
2468
|
display: flex;
|
|
2428
2469
|
flex-direction: column;
|
|
2429
2470
|
align-items: flex-start;
|
|
2430
2471
|
gap: 0.25rem;
|
|
2431
2472
|
`;
|
|
2432
|
-
var BadgeContainer =
|
|
2473
|
+
var BadgeContainer = styled18("div")`
|
|
2433
2474
|
display: flex;
|
|
2434
2475
|
align-items: center;
|
|
2435
2476
|
gap: 0.75rem;
|
|
2436
2477
|
`;
|
|
2437
|
-
var ContentContainer =
|
|
2478
|
+
var ContentContainer = styled18("div")`
|
|
2438
2479
|
overflow: auto;
|
|
2439
2480
|
display: flex;
|
|
2440
2481
|
flex-direction: column;
|
|
@@ -2455,7 +2496,7 @@ function View(props) {
|
|
|
2455
2496
|
const { node, onNavigate } = props;
|
|
2456
2497
|
if (!snapshot || snapshot === "unavailable") return;
|
|
2457
2498
|
if (type === "costream") {
|
|
2458
|
-
return /* @__PURE__ */
|
|
2499
|
+
return /* @__PURE__ */ jsx29(
|
|
2459
2500
|
CoStreamView,
|
|
2460
2501
|
{
|
|
2461
2502
|
data: snapshot,
|
|
@@ -2466,7 +2507,7 @@ function View(props) {
|
|
|
2466
2507
|
);
|
|
2467
2508
|
}
|
|
2468
2509
|
if (extendedType === "group") {
|
|
2469
|
-
return /* @__PURE__ */
|
|
2510
|
+
return /* @__PURE__ */ jsx29(
|
|
2470
2511
|
GroupView,
|
|
2471
2512
|
{
|
|
2472
2513
|
coValue: value,
|
|
@@ -2477,10 +2518,10 @@ function View(props) {
|
|
|
2477
2518
|
);
|
|
2478
2519
|
}
|
|
2479
2520
|
if (extendedType === "account") {
|
|
2480
|
-
return /* @__PURE__ */
|
|
2521
|
+
return /* @__PURE__ */ jsx29(AccountView, { data: snapshot, node, onNavigate });
|
|
2481
2522
|
}
|
|
2482
2523
|
if (type === "coplaintext") {
|
|
2483
|
-
return /* @__PURE__ */
|
|
2524
|
+
return /* @__PURE__ */ jsx29(CoPlainTextView, { data: snapshot });
|
|
2484
2525
|
}
|
|
2485
2526
|
if (type === "colist") {
|
|
2486
2527
|
const handleRemove = (index) => {
|
|
@@ -2489,7 +2530,7 @@ function View(props) {
|
|
|
2489
2530
|
list.delete(index);
|
|
2490
2531
|
}
|
|
2491
2532
|
};
|
|
2492
|
-
return /* @__PURE__ */
|
|
2533
|
+
return /* @__PURE__ */ jsx29(
|
|
2493
2534
|
TableView,
|
|
2494
2535
|
{
|
|
2495
2536
|
data: snapshot,
|
|
@@ -2500,9 +2541,9 @@ function View(props) {
|
|
|
2500
2541
|
);
|
|
2501
2542
|
}
|
|
2502
2543
|
if (extendedType === "record") {
|
|
2503
|
-
return /* @__PURE__ */
|
|
2544
|
+
return /* @__PURE__ */ jsx29(TableView, { data: snapshot, node, onNavigate });
|
|
2504
2545
|
}
|
|
2505
|
-
return /* @__PURE__ */
|
|
2546
|
+
return /* @__PURE__ */ jsx29(GridView, { data: snapshot, onNavigate, node });
|
|
2506
2547
|
}
|
|
2507
2548
|
function Page(props) {
|
|
2508
2549
|
const {
|
|
@@ -2518,13 +2559,13 @@ function Page(props) {
|
|
|
2518
2559
|
const coValue = useResolvedCoValue(coId, node);
|
|
2519
2560
|
const { value, snapshot, type, extendedType } = coValue;
|
|
2520
2561
|
if (snapshot === "unavailable") {
|
|
2521
|
-
return /* @__PURE__ */
|
|
2562
|
+
return /* @__PURE__ */ jsx29("div", { style, children: "Data unavailable" });
|
|
2522
2563
|
}
|
|
2523
2564
|
if (!snapshot) {
|
|
2524
|
-
return /* @__PURE__ */
|
|
2565
|
+
return /* @__PURE__ */ jsx29("div", { style });
|
|
2525
2566
|
}
|
|
2526
|
-
return /* @__PURE__ */
|
|
2527
|
-
!isTopLevel && /* @__PURE__ */
|
|
2567
|
+
return /* @__PURE__ */ jsxs19(PageContainer, { style, className, isTopLevel, children: [
|
|
2568
|
+
!isTopLevel && /* @__PURE__ */ jsx29(
|
|
2528
2569
|
BackButton,
|
|
2529
2570
|
{
|
|
2530
2571
|
"aria-label": "Back",
|
|
@@ -2534,27 +2575,27 @@ function Page(props) {
|
|
|
2534
2575
|
"aria-hidden": "true"
|
|
2535
2576
|
}
|
|
2536
2577
|
),
|
|
2537
|
-
/* @__PURE__ */
|
|
2538
|
-
/* @__PURE__ */
|
|
2578
|
+
/* @__PURE__ */ jsx29(HeaderContainer, { children: /* @__PURE__ */ jsxs19(TitleContainer, { children: [
|
|
2579
|
+
/* @__PURE__ */ jsx29(Title, { children: /* @__PURE__ */ jsxs19("span", { children: [
|
|
2539
2580
|
name,
|
|
2540
|
-
typeof snapshot === "object" && "name" in snapshot ? /* @__PURE__ */
|
|
2581
|
+
typeof snapshot === "object" && "name" in snapshot ? /* @__PURE__ */ jsxs19("span", { style: { color: "#57534e", fontWeight: 500 }, children: [
|
|
2541
2582
|
" ",
|
|
2542
2583
|
snapshot.name
|
|
2543
2584
|
] }) : null
|
|
2544
2585
|
] }) }),
|
|
2545
|
-
/* @__PURE__ */
|
|
2546
|
-
/* @__PURE__ */
|
|
2547
|
-
/* @__PURE__ */
|
|
2586
|
+
/* @__PURE__ */ jsxs19(BadgeContainer, { children: [
|
|
2587
|
+
/* @__PURE__ */ jsx29(Badge, { children: type && /* @__PURE__ */ jsx29(TypeIcon, { type, extendedType }) }),
|
|
2588
|
+
/* @__PURE__ */ jsx29(Badge, { children: coId })
|
|
2548
2589
|
] })
|
|
2549
2590
|
] }) }),
|
|
2550
|
-
/* @__PURE__ */
|
|
2551
|
-
/* @__PURE__ */
|
|
2552
|
-
extendedType !== "account" && extendedType !== "group" && /* @__PURE__ */
|
|
2553
|
-
/* @__PURE__ */
|
|
2554
|
-
/* @__PURE__ */
|
|
2591
|
+
/* @__PURE__ */ jsxs19(ContentContainer, { children: [
|
|
2592
|
+
/* @__PURE__ */ jsx29(View, { ...props, coValue }),
|
|
2593
|
+
extendedType !== "account" && extendedType !== "group" && /* @__PURE__ */ jsxs19(Fragment11, { children: [
|
|
2594
|
+
/* @__PURE__ */ jsx29(RoleDisplay, { node, value }),
|
|
2595
|
+
/* @__PURE__ */ jsxs19(Text, { muted: true, children: [
|
|
2555
2596
|
"Owned by",
|
|
2556
2597
|
" ",
|
|
2557
|
-
/* @__PURE__ */
|
|
2598
|
+
/* @__PURE__ */ jsx29(
|
|
2558
2599
|
AccountOrGroupText,
|
|
2559
2600
|
{
|
|
2560
2601
|
coId: value.group.id,
|
|
@@ -2567,14 +2608,46 @@ function Page(props) {
|
|
|
2567
2608
|
)
|
|
2568
2609
|
] })
|
|
2569
2610
|
] }),
|
|
2570
|
-
value && /* @__PURE__ */
|
|
2611
|
+
value && /* @__PURE__ */ jsx29(HistoryView, { coValue: value, node })
|
|
2571
2612
|
] })
|
|
2572
2613
|
] });
|
|
2573
2614
|
}
|
|
2574
2615
|
|
|
2616
|
+
// src/inspector/ui/error-boundary.tsx
|
|
2617
|
+
import React6 from "react";
|
|
2618
|
+
import { styled as styled19 } from "goober";
|
|
2619
|
+
import { jsx as jsx30, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2620
|
+
var ErrorBoundary = class extends React6.Component {
|
|
2621
|
+
constructor(props) {
|
|
2622
|
+
super(props);
|
|
2623
|
+
this.state = { hasError: false };
|
|
2624
|
+
}
|
|
2625
|
+
static getDerivedStateFromError(error) {
|
|
2626
|
+
return { hasError: true, error };
|
|
2627
|
+
}
|
|
2628
|
+
componentDidCatch(error, errorInfo) {
|
|
2629
|
+
console.error(error);
|
|
2630
|
+
}
|
|
2631
|
+
render() {
|
|
2632
|
+
if (this.state.hasError) {
|
|
2633
|
+
return /* @__PURE__ */ jsxs20("div", { style: { padding: "1rem" }, children: [
|
|
2634
|
+
/* @__PURE__ */ jsx30(StyledHeading2, { children: this.props.title }),
|
|
2635
|
+
/* @__PURE__ */ jsx30(Text, { mono: true, style: { marginTop: "0.5rem", color: "#ef4444" }, children: this.state.error?.message || "An unexpected error occurred" }),
|
|
2636
|
+
/* @__PURE__ */ jsx30("pre", { style: { paddingLeft: "1rem", color: "#ef4444" }, children: this.state.error?.stack })
|
|
2637
|
+
] });
|
|
2638
|
+
}
|
|
2639
|
+
return this.props.children;
|
|
2640
|
+
}
|
|
2641
|
+
};
|
|
2642
|
+
var StyledHeading2 = styled19("h1")`
|
|
2643
|
+
font-size: 1.125rem;
|
|
2644
|
+
font-weight: 500;
|
|
2645
|
+
color: var(--j-text-color-strong);
|
|
2646
|
+
`;
|
|
2647
|
+
|
|
2575
2648
|
// src/inspector/viewer/page-stack.tsx
|
|
2576
|
-
import { Fragment as Fragment12, jsx as
|
|
2577
|
-
var PageStackContainer =
|
|
2649
|
+
import { Fragment as Fragment12, jsx as jsx31, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2650
|
+
var PageStackContainer = styled20("div")`
|
|
2578
2651
|
position: relative;
|
|
2579
2652
|
padding: 0 0.75rem;
|
|
2580
2653
|
overflow-y: auto;
|
|
@@ -2591,9 +2664,9 @@ function PageStack({
|
|
|
2591
2664
|
}) {
|
|
2592
2665
|
const page = path[path.length - 1];
|
|
2593
2666
|
const index = path.length - 1;
|
|
2594
|
-
return /* @__PURE__ */
|
|
2667
|
+
return /* @__PURE__ */ jsx31(Fragment12, { children: /* @__PURE__ */ jsxs21(PageStackContainer, { children: [
|
|
2595
2668
|
children,
|
|
2596
|
-
node && page && /* @__PURE__ */
|
|
2669
|
+
node && page && /* @__PURE__ */ jsx31(ErrorBoundary, { title: "An error occurred while rendering this CoValue", children: /* @__PURE__ */ jsx31(
|
|
2597
2670
|
Page,
|
|
2598
2671
|
{
|
|
2599
2672
|
coId: page.coId,
|
|
@@ -2603,15 +2676,15 @@ function PageStack({
|
|
|
2603
2676
|
onNavigate: addPages,
|
|
2604
2677
|
isTopLevel: index === path.length - 1
|
|
2605
2678
|
}
|
|
2606
|
-
)
|
|
2679
|
+
) })
|
|
2607
2680
|
] }) });
|
|
2608
2681
|
}
|
|
2609
2682
|
|
|
2610
2683
|
// src/inspector/viewer/use-page-path.ts
|
|
2611
|
-
import { useCallback, useEffect as
|
|
2684
|
+
import { useCallback, useEffect as useEffect8, useState as useState10 } from "react";
|
|
2612
2685
|
var STORAGE_KEY = "jazz-inspector-paths";
|
|
2613
2686
|
function usePagePath(defaultPath) {
|
|
2614
|
-
const [path, setPath] =
|
|
2687
|
+
const [path, setPath] = useState10(() => {
|
|
2615
2688
|
if (typeof window === "undefined") return [];
|
|
2616
2689
|
const stored = localStorage.getItem(STORAGE_KEY);
|
|
2617
2690
|
if (stored) {
|
|
@@ -2627,7 +2700,7 @@ function usePagePath(defaultPath) {
|
|
|
2627
2700
|
setPath(newPath);
|
|
2628
2701
|
localStorage.setItem(STORAGE_KEY, JSON.stringify(newPath));
|
|
2629
2702
|
}, []);
|
|
2630
|
-
|
|
2703
|
+
useEffect8(() => {
|
|
2631
2704
|
if (defaultPath && JSON.stringify(path) !== JSON.stringify(defaultPath)) {
|
|
2632
2705
|
updatePath(defaultPath);
|
|
2633
2706
|
}
|
|
@@ -2665,8 +2738,8 @@ function usePagePath(defaultPath) {
|
|
|
2665
2738
|
}
|
|
2666
2739
|
|
|
2667
2740
|
// src/inspector/ui/global-styles.tsx
|
|
2668
|
-
import { styled as
|
|
2669
|
-
var GlobalStyles =
|
|
2741
|
+
import { styled as styled21 } from "goober";
|
|
2742
|
+
var GlobalStyles = styled21("div")`
|
|
2670
2743
|
/* Colors */
|
|
2671
2744
|
--j-primary-color: #146AFF;
|
|
2672
2745
|
--j-link-color: var(--j-primary-color);
|
|
@@ -2740,9 +2813,9 @@ var GlobalStyles = styled19("div")`
|
|
|
2740
2813
|
`;
|
|
2741
2814
|
|
|
2742
2815
|
// src/inspector/viewer/inspector-button.tsx
|
|
2743
|
-
import { styled as
|
|
2744
|
-
import { jsx as
|
|
2745
|
-
var StyledInspectorButton =
|
|
2816
|
+
import { styled as styled22 } from "goober";
|
|
2817
|
+
import { jsx as jsx32, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2818
|
+
var StyledInspectorButton = styled22("button")`
|
|
2746
2819
|
position: fixed;
|
|
2747
2820
|
width: 2.5rem;
|
|
2748
2821
|
height: 2.5rem;
|
|
@@ -2773,7 +2846,7 @@ var StyledInspectorButton = styled20("button")`
|
|
|
2773
2846
|
}
|
|
2774
2847
|
}}
|
|
2775
2848
|
`;
|
|
2776
|
-
var JazzIcon =
|
|
2849
|
+
var JazzIcon = styled22("svg")`
|
|
2777
2850
|
width: 100%;
|
|
2778
2851
|
height: auto;
|
|
2779
2852
|
position: relative;
|
|
@@ -2784,8 +2857,8 @@ function InspectorButton({
|
|
|
2784
2857
|
position = "right",
|
|
2785
2858
|
...buttonProps
|
|
2786
2859
|
}) {
|
|
2787
|
-
return /* @__PURE__ */
|
|
2788
|
-
/* @__PURE__ */
|
|
2860
|
+
return /* @__PURE__ */ jsxs22(StyledInspectorButton, { position, ...buttonProps, children: [
|
|
2861
|
+
/* @__PURE__ */ jsx32(
|
|
2789
2862
|
JazzIcon,
|
|
2790
2863
|
{
|
|
2791
2864
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2793,7 +2866,7 @@ function InspectorButton({
|
|
|
2793
2866
|
height: "115",
|
|
2794
2867
|
viewBox: "0 0 119 115",
|
|
2795
2868
|
fill: "none",
|
|
2796
|
-
children: /* @__PURE__ */
|
|
2869
|
+
children: /* @__PURE__ */ jsx32(
|
|
2797
2870
|
"path",
|
|
2798
2871
|
{
|
|
2799
2872
|
fillRule: "evenodd",
|
|
@@ -2804,7 +2877,7 @@ function InspectorButton({
|
|
|
2804
2877
|
)
|
|
2805
2878
|
}
|
|
2806
2879
|
),
|
|
2807
|
-
/* @__PURE__ */
|
|
2880
|
+
/* @__PURE__ */ jsx32(
|
|
2808
2881
|
"span",
|
|
2809
2882
|
{
|
|
2810
2883
|
style: {
|
|
@@ -2825,30 +2898,30 @@ function InspectorButton({
|
|
|
2825
2898
|
}
|
|
2826
2899
|
|
|
2827
2900
|
// src/inspector/viewer/use-open-inspector.ts
|
|
2828
|
-
import { useEffect as
|
|
2901
|
+
import { useEffect as useEffect9, useState as useState11 } from "react";
|
|
2829
2902
|
var STORAGE_KEY2 = "jazz-inspector-open";
|
|
2830
2903
|
function useOpenInspector() {
|
|
2831
|
-
const [open, setOpen] =
|
|
2904
|
+
const [open, setOpen] = useState11(() => {
|
|
2832
2905
|
if (typeof window === "undefined") return false;
|
|
2833
2906
|
const stored = localStorage.getItem(STORAGE_KEY2);
|
|
2834
2907
|
return stored ? JSON.parse(stored) : false;
|
|
2835
2908
|
});
|
|
2836
|
-
|
|
2909
|
+
useEffect9(() => {
|
|
2837
2910
|
localStorage.setItem(STORAGE_KEY2, JSON.stringify(open));
|
|
2838
2911
|
}, [open]);
|
|
2839
2912
|
return [open, setOpen];
|
|
2840
2913
|
}
|
|
2841
2914
|
|
|
2842
2915
|
// src/inspector/viewer/delete-local-data.tsx
|
|
2843
|
-
import { useState as
|
|
2844
|
-
import { Fragment as Fragment13, jsx as
|
|
2916
|
+
import { useState as useState12 } from "react";
|
|
2917
|
+
import { Fragment as Fragment13, jsx as jsx33, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2845
2918
|
var DELETE_LOCAL_DATA_STRING = "delete my local data";
|
|
2846
2919
|
function DeleteLocalData() {
|
|
2847
|
-
const [showDeleteModal, setShowDeleteModal] =
|
|
2848
|
-
const [confirmDeleteString, setConfirmDeleteString] =
|
|
2849
|
-
return /* @__PURE__ */
|
|
2850
|
-
/* @__PURE__ */
|
|
2851
|
-
/* @__PURE__ */
|
|
2920
|
+
const [showDeleteModal, setShowDeleteModal] = useState12(false);
|
|
2921
|
+
const [confirmDeleteString, setConfirmDeleteString] = useState12("");
|
|
2922
|
+
return /* @__PURE__ */ jsxs23(Fragment13, { children: [
|
|
2923
|
+
/* @__PURE__ */ jsx33(Button, { variant: "destructive", onClick: () => setShowDeleteModal(true), children: "Delete my local data" }),
|
|
2924
|
+
/* @__PURE__ */ jsxs23(
|
|
2852
2925
|
Modal,
|
|
2853
2926
|
{
|
|
2854
2927
|
isOpen: showDeleteModal,
|
|
@@ -2856,7 +2929,7 @@ function DeleteLocalData() {
|
|
|
2856
2929
|
heading: "Delete Local Data",
|
|
2857
2930
|
showButtons: false,
|
|
2858
2931
|
children: [
|
|
2859
|
-
/* @__PURE__ */
|
|
2932
|
+
/* @__PURE__ */ jsxs23(
|
|
2860
2933
|
"div",
|
|
2861
2934
|
{
|
|
2862
2935
|
style: {
|
|
@@ -2867,33 +2940,33 @@ function DeleteLocalData() {
|
|
|
2867
2940
|
gap: "0.5rem"
|
|
2868
2941
|
},
|
|
2869
2942
|
children: [
|
|
2870
|
-
/* @__PURE__ */
|
|
2943
|
+
/* @__PURE__ */ jsxs23("p", { children: [
|
|
2871
2944
|
"This action ",
|
|
2872
|
-
/* @__PURE__ */
|
|
2945
|
+
/* @__PURE__ */ jsx33("strong", { children: "cannot" }),
|
|
2873
2946
|
" be undone."
|
|
2874
2947
|
] }),
|
|
2875
|
-
/* @__PURE__ */
|
|
2948
|
+
/* @__PURE__ */ jsxs23("p", { children: [
|
|
2876
2949
|
"Be aware that the following data will be",
|
|
2877
2950
|
" ",
|
|
2878
|
-
/* @__PURE__ */
|
|
2951
|
+
/* @__PURE__ */ jsx33("strong", { children: "permanently" }),
|
|
2879
2952
|
" deleted:"
|
|
2880
2953
|
] }),
|
|
2881
|
-
/* @__PURE__ */
|
|
2882
|
-
/* @__PURE__ */
|
|
2954
|
+
/* @__PURE__ */ jsxs23("ul", { style: { listStyleType: "disc", paddingLeft: "1rem" }, children: [
|
|
2955
|
+
/* @__PURE__ */ jsxs23("li", { children: [
|
|
2883
2956
|
"Unsynced data for ",
|
|
2884
|
-
/* @__PURE__ */
|
|
2957
|
+
/* @__PURE__ */ jsx33("strong", { children: "all apps" }),
|
|
2885
2958
|
" on",
|
|
2886
2959
|
" ",
|
|
2887
|
-
/* @__PURE__ */
|
|
2960
|
+
/* @__PURE__ */ jsx33("code", { children: window.location.origin })
|
|
2888
2961
|
] }),
|
|
2889
|
-
/* @__PURE__ */
|
|
2890
|
-
/* @__PURE__ */
|
|
2962
|
+
/* @__PURE__ */ jsx33("li", { children: "Accounts" }),
|
|
2963
|
+
/* @__PURE__ */ jsx33("li", { children: "Logged in sessions" })
|
|
2891
2964
|
] }),
|
|
2892
|
-
/* @__PURE__ */
|
|
2965
|
+
/* @__PURE__ */ jsx33("p", {})
|
|
2893
2966
|
]
|
|
2894
2967
|
}
|
|
2895
2968
|
),
|
|
2896
|
-
/* @__PURE__ */
|
|
2969
|
+
/* @__PURE__ */ jsx33(
|
|
2897
2970
|
Input,
|
|
2898
2971
|
{
|
|
2899
2972
|
label: `Type "${DELETE_LOCAL_DATA_STRING}" to confirm`,
|
|
@@ -2904,7 +2977,7 @@ function DeleteLocalData() {
|
|
|
2904
2977
|
}
|
|
2905
2978
|
}
|
|
2906
2979
|
),
|
|
2907
|
-
/* @__PURE__ */
|
|
2980
|
+
/* @__PURE__ */ jsx33(
|
|
2908
2981
|
"p",
|
|
2909
2982
|
{
|
|
2910
2983
|
style: {
|
|
@@ -2914,14 +2987,14 @@ function DeleteLocalData() {
|
|
|
2914
2987
|
flexDirection: "column",
|
|
2915
2988
|
gap: "0.5rem"
|
|
2916
2989
|
},
|
|
2917
|
-
children: /* @__PURE__ */
|
|
2990
|
+
children: /* @__PURE__ */ jsxs23("small", { children: [
|
|
2918
2991
|
"Data synced to a sync server will ",
|
|
2919
|
-
/* @__PURE__ */
|
|
2992
|
+
/* @__PURE__ */ jsx33("strong", { children: "not" }),
|
|
2920
2993
|
" be deleted, and will be synced when you log in again."
|
|
2921
2994
|
] })
|
|
2922
2995
|
}
|
|
2923
2996
|
),
|
|
2924
|
-
/* @__PURE__ */
|
|
2997
|
+
/* @__PURE__ */ jsxs23(
|
|
2925
2998
|
"div",
|
|
2926
2999
|
{
|
|
2927
3000
|
style: {
|
|
@@ -2931,8 +3004,8 @@ function DeleteLocalData() {
|
|
|
2931
3004
|
gap: "0.5rem"
|
|
2932
3005
|
},
|
|
2933
3006
|
children: [
|
|
2934
|
-
/* @__PURE__ */
|
|
2935
|
-
/* @__PURE__ */
|
|
3007
|
+
/* @__PURE__ */ jsx33(Button, { variant: "secondary", onClick: () => setShowDeleteModal(false), children: "Cancel" }),
|
|
3008
|
+
/* @__PURE__ */ jsx33(
|
|
2936
3009
|
Button,
|
|
2937
3010
|
{
|
|
2938
3011
|
variant: "destructive",
|
|
@@ -2959,8 +3032,8 @@ function DeleteLocalData() {
|
|
|
2959
3032
|
}
|
|
2960
3033
|
|
|
2961
3034
|
// src/inspector/viewer/new-app.tsx
|
|
2962
|
-
import { Fragment as Fragment14, jsx as
|
|
2963
|
-
var InspectorContainer =
|
|
3035
|
+
import { Fragment as Fragment14, jsx as jsx34, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3036
|
+
var InspectorContainer = styled23("div")`
|
|
2964
3037
|
position: fixed;
|
|
2965
3038
|
height: 50vh;
|
|
2966
3039
|
max-height: 800px;
|
|
@@ -2977,17 +3050,17 @@ var InspectorContainer = styled21("div")`
|
|
|
2977
3050
|
background-color: var(--j-background);
|
|
2978
3051
|
}
|
|
2979
3052
|
`;
|
|
2980
|
-
var HeaderContainer2 =
|
|
3053
|
+
var HeaderContainer2 = styled23("div")`
|
|
2981
3054
|
display: flex;
|
|
2982
3055
|
align-items: center;
|
|
2983
3056
|
gap: 1rem;
|
|
2984
3057
|
padding: 0 0.75rem;
|
|
2985
3058
|
margin: 0.75rem 0;
|
|
2986
3059
|
`;
|
|
2987
|
-
var Form =
|
|
3060
|
+
var Form = styled23("form")`
|
|
2988
3061
|
width: 24rem;
|
|
2989
3062
|
`;
|
|
2990
|
-
var InitialForm =
|
|
3063
|
+
var InitialForm = styled23("form")`
|
|
2991
3064
|
display: flex;
|
|
2992
3065
|
flex-direction: column;
|
|
2993
3066
|
position: relative;
|
|
@@ -2999,7 +3072,7 @@ var InitialForm = styled21("form")`
|
|
|
2999
3072
|
max-width: 24rem;
|
|
3000
3073
|
margin: 0 auto;
|
|
3001
3074
|
`;
|
|
3002
|
-
var OrText =
|
|
3075
|
+
var OrText = styled23("p")`
|
|
3003
3076
|
text-align: center;
|
|
3004
3077
|
`;
|
|
3005
3078
|
function JazzInspectorInternal({
|
|
@@ -3008,7 +3081,7 @@ function JazzInspectorInternal({
|
|
|
3008
3081
|
accountId
|
|
3009
3082
|
}) {
|
|
3010
3083
|
const [open, setOpen] = useOpenInspector();
|
|
3011
|
-
const [coValueId, setCoValueId] =
|
|
3084
|
+
const [coValueId, setCoValueId] = useState13("");
|
|
3012
3085
|
const { path, addPages, goToIndex, goBack, setPage } = usePagePath();
|
|
3013
3086
|
const handleCoValueIdSubmit = (e) => {
|
|
3014
3087
|
e.preventDefault();
|
|
@@ -3018,12 +3091,12 @@ function JazzInspectorInternal({
|
|
|
3018
3091
|
setCoValueId("");
|
|
3019
3092
|
};
|
|
3020
3093
|
if (!open) {
|
|
3021
|
-
return /* @__PURE__ */
|
|
3094
|
+
return /* @__PURE__ */ jsx34(InspectorButton, { position, onClick: () => setOpen(true) });
|
|
3022
3095
|
}
|
|
3023
|
-
return /* @__PURE__ */
|
|
3024
|
-
/* @__PURE__ */
|
|
3025
|
-
/* @__PURE__ */
|
|
3026
|
-
path.length !== 0 && /* @__PURE__ */
|
|
3096
|
+
return /* @__PURE__ */ jsxs24(InspectorContainer, { as: GlobalStyles, style: { zIndex: 999 }, children: [
|
|
3097
|
+
/* @__PURE__ */ jsxs24(HeaderContainer2, { children: [
|
|
3098
|
+
/* @__PURE__ */ jsx34(Breadcrumbs, { path, onBreadcrumbClick: goToIndex }),
|
|
3099
|
+
path.length !== 0 && /* @__PURE__ */ jsx34(Form, { onSubmit: handleCoValueIdSubmit, children: /* @__PURE__ */ jsx34(
|
|
3027
3100
|
Input,
|
|
3028
3101
|
{
|
|
3029
3102
|
label: "CoValue ID",
|
|
@@ -3034,24 +3107,24 @@ function JazzInspectorInternal({
|
|
|
3034
3107
|
onChange: (e) => setCoValueId(e.target.value)
|
|
3035
3108
|
}
|
|
3036
3109
|
) }),
|
|
3037
|
-
/* @__PURE__ */
|
|
3038
|
-
/* @__PURE__ */
|
|
3110
|
+
/* @__PURE__ */ jsx34(DeleteLocalData, {}),
|
|
3111
|
+
/* @__PURE__ */ jsx34(Button, { variant: "plain", type: "button", onClick: () => setOpen(false), children: "Close" })
|
|
3039
3112
|
] }),
|
|
3040
|
-
/* @__PURE__ */
|
|
3113
|
+
/* @__PURE__ */ jsx34(
|
|
3041
3114
|
PageStack,
|
|
3042
3115
|
{
|
|
3043
3116
|
path,
|
|
3044
3117
|
node: localNode,
|
|
3045
3118
|
goBack,
|
|
3046
3119
|
addPages,
|
|
3047
|
-
children: path.length <= 0 && /* @__PURE__ */
|
|
3120
|
+
children: path.length <= 0 && /* @__PURE__ */ jsxs24(
|
|
3048
3121
|
InitialForm,
|
|
3049
3122
|
{
|
|
3050
3123
|
onSubmit: handleCoValueIdSubmit,
|
|
3051
3124
|
"aria-hidden": path.length !== 0,
|
|
3052
3125
|
children: [
|
|
3053
|
-
/* @__PURE__ */
|
|
3054
|
-
/* @__PURE__ */
|
|
3126
|
+
/* @__PURE__ */ jsx34(Heading, { children: "Jazz CoValue Inspector" }),
|
|
3127
|
+
/* @__PURE__ */ jsx34(
|
|
3055
3128
|
Input,
|
|
3056
3129
|
{
|
|
3057
3130
|
label: "CoValue ID",
|
|
@@ -3062,10 +3135,10 @@ function JazzInspectorInternal({
|
|
|
3062
3135
|
onChange: (e) => setCoValueId(e.target.value)
|
|
3063
3136
|
}
|
|
3064
3137
|
),
|
|
3065
|
-
/* @__PURE__ */
|
|
3066
|
-
accountId && /* @__PURE__ */
|
|
3067
|
-
/* @__PURE__ */
|
|
3068
|
-
/* @__PURE__ */
|
|
3138
|
+
/* @__PURE__ */ jsx34(Button, { type: "submit", variant: "primary", children: "Inspect CoValue" }),
|
|
3139
|
+
accountId && /* @__PURE__ */ jsxs24(Fragment14, { children: [
|
|
3140
|
+
/* @__PURE__ */ jsx34(OrText, { children: "or" }),
|
|
3141
|
+
/* @__PURE__ */ jsx34(
|
|
3069
3142
|
Button,
|
|
3070
3143
|
{
|
|
3071
3144
|
variant: "secondary",
|
|
@@ -3088,12 +3161,12 @@ function JazzInspectorInternal({
|
|
|
3088
3161
|
// src/inspector/index.tsx
|
|
3089
3162
|
import { setup } from "goober";
|
|
3090
3163
|
import { useJazzContext } from "jazz-tools/react-core";
|
|
3091
|
-
import { jsx as
|
|
3164
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
3092
3165
|
function JazzInspector({ position = "right" }) {
|
|
3093
3166
|
const context = useJazzContext();
|
|
3094
3167
|
const localNode = context.node;
|
|
3095
3168
|
const me = "me" in context ? context.me : void 0;
|
|
3096
|
-
return /* @__PURE__ */
|
|
3169
|
+
return /* @__PURE__ */ jsx35(
|
|
3097
3170
|
JazzInspectorInternal,
|
|
3098
3171
|
{
|
|
3099
3172
|
position,
|
|
@@ -3102,7 +3175,7 @@ function JazzInspector({ position = "right" }) {
|
|
|
3102
3175
|
}
|
|
3103
3176
|
);
|
|
3104
3177
|
}
|
|
3105
|
-
setup(
|
|
3178
|
+
setup(React8.createElement);
|
|
3106
3179
|
export {
|
|
3107
3180
|
AccountOrGroupText,
|
|
3108
3181
|
Breadcrumbs,
|