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
|
@@ -1970,7 +1970,7 @@ var require_scheduler = __commonJS({
|
|
|
1970
1970
|
var require_react_dom_production = __commonJS({
|
|
1971
1971
|
"../../node_modules/react-dom/cjs/react-dom.production.js"(exports) {
|
|
1972
1972
|
"use strict";
|
|
1973
|
-
var
|
|
1973
|
+
var React9 = require_react();
|
|
1974
1974
|
function formatProdErrorMessage(code) {
|
|
1975
1975
|
var url = "https://react.dev/errors/" + code;
|
|
1976
1976
|
if (1 < arguments.length) {
|
|
@@ -2010,7 +2010,7 @@ var require_react_dom_production = __commonJS({
|
|
|
2010
2010
|
implementation
|
|
2011
2011
|
};
|
|
2012
2012
|
}
|
|
2013
|
-
var ReactSharedInternals =
|
|
2013
|
+
var ReactSharedInternals = React9.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
2014
2014
|
function getCrossOriginStringAs(as, input) {
|
|
2015
2015
|
if ("font" === as) return "";
|
|
2016
2016
|
if ("string" === typeof input)
|
|
@@ -2164,7 +2164,7 @@ var require_react_dom_development = __commonJS({
|
|
|
2164
2164
|
return dispatcher;
|
|
2165
2165
|
}
|
|
2166
2166
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
2167
|
-
var
|
|
2167
|
+
var React9 = require_react(), Internals = {
|
|
2168
2168
|
d: {
|
|
2169
2169
|
f: noop,
|
|
2170
2170
|
r: function() {
|
|
@@ -2182,7 +2182,7 @@ var require_react_dom_development = __commonJS({
|
|
|
2182
2182
|
},
|
|
2183
2183
|
p: 0,
|
|
2184
2184
|
findDOMNode: null
|
|
2185
|
-
}, REACT_PORTAL_TYPE = Symbol.for("react.portal"), ReactSharedInternals =
|
|
2185
|
+
}, REACT_PORTAL_TYPE = Symbol.for("react.portal"), ReactSharedInternals = React9.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
2186
2186
|
"function" === typeof Map && null != Map.prototype && "function" === typeof Map.prototype.forEach && "function" === typeof Set && null != Set.prototype && "function" === typeof Set.prototype.clear && "function" === typeof Set.prototype.forEach || console.error(
|
|
2187
2187
|
"React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"
|
|
2188
2188
|
);
|
|
@@ -2390,7 +2390,7 @@ var require_react_dom_client_production = __commonJS({
|
|
|
2390
2390
|
"../../node_modules/react-dom/cjs/react-dom-client.production.js"(exports) {
|
|
2391
2391
|
"use strict";
|
|
2392
2392
|
var Scheduler = require_scheduler();
|
|
2393
|
-
var
|
|
2393
|
+
var React9 = require_react();
|
|
2394
2394
|
var ReactDOM = require_react_dom();
|
|
2395
2395
|
function formatProdErrorMessage(code) {
|
|
2396
2396
|
var url = "https://react.dev/errors/" + code;
|
|
@@ -2578,7 +2578,7 @@ var require_react_dom_client_production = __commonJS({
|
|
|
2578
2578
|
return null;
|
|
2579
2579
|
}
|
|
2580
2580
|
var isArrayImpl = Array.isArray;
|
|
2581
|
-
var ReactSharedInternals =
|
|
2581
|
+
var ReactSharedInternals = React9.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
2582
2582
|
var ReactDOMSharedInternals = ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
2583
2583
|
var sharedNotPendingObject = {
|
|
2584
2584
|
pending: false,
|
|
@@ -13570,7 +13570,7 @@ var require_react_dom_client_production = __commonJS({
|
|
|
13570
13570
|
0 === i && attemptExplicitHydrationTarget(target);
|
|
13571
13571
|
}
|
|
13572
13572
|
};
|
|
13573
|
-
var isomorphicReactPackageVersion$jscomp$inline_1785 =
|
|
13573
|
+
var isomorphicReactPackageVersion$jscomp$inline_1785 = React9.version;
|
|
13574
13574
|
if ("19.1.0" !== isomorphicReactPackageVersion$jscomp$inline_1785)
|
|
13575
13575
|
throw Error(
|
|
13576
13576
|
formatProdErrorMessage(
|
|
@@ -15021,7 +15021,7 @@ var require_react_dom_client_development = __commonJS({
|
|
|
15021
15021
|
"number" === type && getActiveElement(node.ownerDocument) === node || node.defaultValue === "" + value || (node.defaultValue = "" + value);
|
|
15022
15022
|
}
|
|
15023
15023
|
function validateOptionProps(element, props) {
|
|
15024
|
-
null == props.value && ("object" === typeof props.children && null !== props.children ?
|
|
15024
|
+
null == props.value && ("object" === typeof props.children && null !== props.children ? React9.Children.forEach(props.children, function(child) {
|
|
15025
15025
|
null == child || "string" === typeof child || "number" === typeof child || "bigint" === typeof child || didWarnInvalidChild || (didWarnInvalidChild = true, console.error(
|
|
15026
15026
|
"Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>."
|
|
15027
15027
|
));
|
|
@@ -28603,14 +28603,14 @@ var require_react_dom_client_development = __commonJS({
|
|
|
28603
28603
|
));
|
|
28604
28604
|
}
|
|
28605
28605
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
28606
|
-
var Scheduler = require_scheduler(),
|
|
28606
|
+
var Scheduler = require_scheduler(), React9 = require_react(), ReactDOM = require_react_dom(), assign = Object.assign, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_PROVIDER_TYPE = Symbol.for("react.provider"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
28607
28607
|
Symbol.for("react.scope");
|
|
28608
28608
|
var REACT_ACTIVITY_TYPE = Symbol.for("react.activity");
|
|
28609
28609
|
Symbol.for("react.legacy_hidden");
|
|
28610
28610
|
Symbol.for("react.tracing_marker");
|
|
28611
28611
|
var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
|
|
28612
28612
|
Symbol.for("react.view_transition");
|
|
28613
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator, REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), isArrayImpl = Array.isArray, ReactSharedInternals =
|
|
28613
|
+
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator, REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), isArrayImpl = Array.isArray, ReactSharedInternals = React9.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, ReactDOMSharedInternals = ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, NotPending = Object.freeze({
|
|
28614
28614
|
pending: false,
|
|
28615
28615
|
data: null,
|
|
28616
28616
|
method: null,
|
|
@@ -31324,7 +31324,7 @@ var require_react_dom_client_development = __commonJS({
|
|
|
31324
31324
|
}
|
|
31325
31325
|
};
|
|
31326
31326
|
(function() {
|
|
31327
|
-
var isomorphicReactPackageVersion =
|
|
31327
|
+
var isomorphicReactPackageVersion = React9.version;
|
|
31328
31328
|
if ("19.1.0" !== isomorphicReactPackageVersion)
|
|
31329
31329
|
throw Error(
|
|
31330
31330
|
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + "\n - react-dom: 19.1.0\nLearn more: https://react.dev/warnings/version-mismatch")
|
|
@@ -31720,20 +31720,20 @@ var require_react_jsx_runtime_development = __commonJS({
|
|
|
31720
31720
|
function validateChildKeys(node) {
|
|
31721
31721
|
"object" === typeof node && null !== node && node.$$typeof === REACT_ELEMENT_TYPE && node._store && (node._store.validated = 1);
|
|
31722
31722
|
}
|
|
31723
|
-
var
|
|
31723
|
+
var React9 = require_react(), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
31724
31724
|
Symbol.for("react.provider");
|
|
31725
|
-
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals =
|
|
31725
|
+
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React9.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
|
|
31726
31726
|
return null;
|
|
31727
31727
|
};
|
|
31728
|
-
|
|
31728
|
+
React9 = {
|
|
31729
31729
|
"react-stack-bottom-frame": function(callStackForError) {
|
|
31730
31730
|
return callStackForError();
|
|
31731
31731
|
}
|
|
31732
31732
|
};
|
|
31733
31733
|
var specialPropKeyWarningShown;
|
|
31734
31734
|
var didWarnAboutElementRef = {};
|
|
31735
|
-
var unknownOwnerDebugStack =
|
|
31736
|
-
|
|
31735
|
+
var unknownOwnerDebugStack = React9["react-stack-bottom-frame"].bind(
|
|
31736
|
+
React9,
|
|
31737
31737
|
UnknownOwner
|
|
31738
31738
|
)();
|
|
31739
31739
|
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
@@ -31782,14 +31782,14 @@ var require_jsx_runtime = __commonJS({
|
|
|
31782
31782
|
});
|
|
31783
31783
|
|
|
31784
31784
|
// src/inspector/custom-element.tsx
|
|
31785
|
-
var
|
|
31785
|
+
var import_react24 = __toESM(require_react(), 1);
|
|
31786
31786
|
var import_client = __toESM(require_client(), 1);
|
|
31787
31787
|
import { setup } from "goober";
|
|
31788
31788
|
import { Account } from "jazz-tools";
|
|
31789
31789
|
|
|
31790
31790
|
// src/inspector/viewer/new-app.tsx
|
|
31791
|
-
var
|
|
31792
|
-
import { styled as
|
|
31791
|
+
var import_react23 = __toESM(require_react(), 1);
|
|
31792
|
+
import { styled as styled23 } from "goober";
|
|
31793
31793
|
|
|
31794
31794
|
// src/inspector/ui/button.tsx
|
|
31795
31795
|
var import_react = __toESM(require_react(), 1);
|
|
@@ -31964,11 +31964,11 @@ var Breadcrumbs = ({
|
|
|
31964
31964
|
};
|
|
31965
31965
|
|
|
31966
31966
|
// src/inspector/viewer/page-stack.tsx
|
|
31967
|
-
import { styled as
|
|
31967
|
+
import { styled as styled20 } from "goober";
|
|
31968
31968
|
|
|
31969
31969
|
// src/inspector/viewer/page.tsx
|
|
31970
|
-
var
|
|
31971
|
-
import { styled as
|
|
31970
|
+
var import_react18 = __toESM(require_react(), 1);
|
|
31971
|
+
import { styled as styled18 } from "goober";
|
|
31972
31972
|
|
|
31973
31973
|
// src/inspector/ui/badge.tsx
|
|
31974
31974
|
var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
|
|
@@ -32340,7 +32340,7 @@ async function resolveCoValue(coValueId, node) {
|
|
|
32340
32340
|
extendedType = "image";
|
|
32341
32341
|
} else if (isAccount(snapshot)) {
|
|
32342
32342
|
extendedType = "account";
|
|
32343
|
-
} else if (isGroup(
|
|
32343
|
+
} else if (value.core.isGroup()) {
|
|
32344
32344
|
extendedType = "group";
|
|
32345
32345
|
}
|
|
32346
32346
|
}
|
|
@@ -32369,7 +32369,7 @@ function subscribeToCoValue(coValueId, node, callback) {
|
|
|
32369
32369
|
extendedType = "image";
|
|
32370
32370
|
} else if (isAccount(snapshot)) {
|
|
32371
32371
|
extendedType = "account";
|
|
32372
|
-
} else if (isGroup(
|
|
32372
|
+
} else if (value.core.isGroup()) {
|
|
32373
32373
|
extendedType = "group";
|
|
32374
32374
|
}
|
|
32375
32375
|
} else if (type === "costream") {
|
|
@@ -32986,125 +32986,13 @@ function GridView({
|
|
|
32986
32986
|
}
|
|
32987
32987
|
|
|
32988
32988
|
// src/inspector/viewer/raw-data-card.tsx
|
|
32989
|
-
var import_react9 = __toESM(require_react(), 1);
|
|
32990
|
-
var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
|
|
32991
|
-
function CopyButton({ data }) {
|
|
32992
|
-
const [copyCount, setCopyCount] = (0, import_react9.useState)(0);
|
|
32993
|
-
const copied = copyCount > 0;
|
|
32994
|
-
const stringifiedData = JSON.stringify(data);
|
|
32995
|
-
(0, import_react9.useEffect)(() => {
|
|
32996
|
-
if (copyCount > 0) {
|
|
32997
|
-
const timeout = setTimeout(() => setCopyCount(0), 1e3);
|
|
32998
|
-
return () => {
|
|
32999
|
-
clearTimeout(timeout);
|
|
33000
|
-
};
|
|
33001
|
-
}
|
|
33002
|
-
}, [copyCount]);
|
|
33003
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
33004
|
-
Button,
|
|
33005
|
-
{
|
|
33006
|
-
style: {
|
|
33007
|
-
position: "absolute",
|
|
33008
|
-
top: "10px",
|
|
33009
|
-
right: "10px"
|
|
33010
|
-
},
|
|
33011
|
-
onClick: () => {
|
|
33012
|
-
window.navigator.clipboard.writeText(stringifiedData).then(() => {
|
|
33013
|
-
setCopyCount((count) => count + 1);
|
|
33014
|
-
});
|
|
33015
|
-
},
|
|
33016
|
-
variant: "secondary",
|
|
33017
|
-
children: copied ? "Copied" : "Copy"
|
|
33018
|
-
}
|
|
33019
|
-
);
|
|
33020
|
-
}
|
|
33021
|
-
function RawDataCard({ data }) {
|
|
33022
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Card, { style: { position: "relative" }, children: [
|
|
33023
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(CardHeader, { children: [
|
|
33024
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text, { strong: true, children: "Raw data" }),
|
|
33025
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CopyButton, { data })
|
|
33026
|
-
] }),
|
|
33027
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ValueRenderer, { json: data }) })
|
|
33028
|
-
] });
|
|
33029
|
-
}
|
|
33030
|
-
|
|
33031
|
-
// src/inspector/viewer/account-view.tsx
|
|
33032
|
-
var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
|
|
33033
|
-
function AccountView({
|
|
33034
|
-
data,
|
|
33035
|
-
onNavigate,
|
|
33036
|
-
node
|
|
33037
|
-
}) {
|
|
33038
|
-
const readableData = { ...data };
|
|
33039
|
-
for (const key in readableData) {
|
|
33040
|
-
if (key === "readKey" || key.startsWith("sealer_z") || key.startsWith("key_z")) {
|
|
33041
|
-
delete readableData[key];
|
|
33042
|
-
}
|
|
33043
|
-
}
|
|
33044
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
33045
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(GridView, { data: readableData, onNavigate, node }),
|
|
33046
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(RawDataCard, { data })
|
|
33047
|
-
] });
|
|
33048
|
-
}
|
|
33049
|
-
|
|
33050
|
-
// src/inspector/viewer/co-plain-text-view.tsx
|
|
33051
|
-
var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
|
|
33052
|
-
function CoPlainTextView({ data }) {
|
|
33053
|
-
if (!data) return;
|
|
33054
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
33055
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: Object.values(data).join("") }),
|
|
33056
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(RawDataCard, { data })
|
|
33057
|
-
] });
|
|
33058
|
-
}
|
|
33059
|
-
|
|
33060
|
-
// src/inspector/viewer/group-view.tsx
|
|
33061
32989
|
var import_react14 = __toESM(require_react(), 1);
|
|
33062
32990
|
|
|
33063
|
-
// src/inspector/ui/table.tsx
|
|
33064
|
-
var import_react10 = __toESM(require_react(), 1);
|
|
33065
|
-
var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
|
|
33066
|
-
import { styled as styled12 } from "goober";
|
|
33067
|
-
var StyledTable = styled12("table")`
|
|
33068
|
-
width: 100%;
|
|
33069
|
-
`;
|
|
33070
|
-
var StyledThead = styled12("thead")`
|
|
33071
|
-
text-align: left;
|
|
33072
|
-
border-bottom: 1px solid var(--j-border-color);
|
|
33073
|
-
background-color: var(--j-neutral-100);
|
|
33074
|
-
|
|
33075
|
-
@media (prefers-color-scheme: dark) {
|
|
33076
|
-
background-color: var(--j-neutral-925);
|
|
33077
|
-
}
|
|
33078
|
-
`;
|
|
33079
|
-
var StyledTbody = styled12("tbody")`
|
|
33080
|
-
tr {
|
|
33081
|
-
border-bottom: 1px solid var(--j-border-color);
|
|
33082
|
-
|
|
33083
|
-
&:last-child {
|
|
33084
|
-
border-bottom: none;
|
|
33085
|
-
}
|
|
33086
|
-
}
|
|
33087
|
-
`;
|
|
33088
|
-
var StyledTh = styled12("th")`
|
|
33089
|
-
font-weight: 500;
|
|
33090
|
-
padding: 0.5rem 0.75rem;
|
|
33091
|
-
color: var(--j-text-color-strong);
|
|
33092
|
-
`;
|
|
33093
|
-
var StyledTd = styled12("td")`
|
|
33094
|
-
padding: 0.5rem 0.75rem;
|
|
33095
|
-
`;
|
|
33096
|
-
var Table = import_react10.default.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StyledTable, { ref, ...props, children }));
|
|
33097
|
-
var TableHead = import_react10.default.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StyledThead, { ref, ...props, children }));
|
|
33098
|
-
var TableBody = import_react10.default.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StyledTbody, { ref, ...props, children }));
|
|
33099
|
-
var TableRow = import_react10.default.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tr", { ref, ...props, children }));
|
|
33100
|
-
var TableHeader = import_react10.default.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StyledTh, { ref, ...props, children }));
|
|
33101
|
-
var TableCell = import_react10.default.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StyledTd, { ref, ...props, children }));
|
|
33102
|
-
|
|
33103
32991
|
// src/inspector/ui/modal.tsx
|
|
33104
|
-
var
|
|
33105
|
-
import { styled as
|
|
33106
|
-
var
|
|
33107
|
-
var ModalContent =
|
|
32992
|
+
var import_react9 = __toESM(require_react(), 1);
|
|
32993
|
+
import { styled as styled12 } from "goober";
|
|
32994
|
+
var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
|
|
32995
|
+
var ModalContent = styled12("dialog")`
|
|
33108
32996
|
background-color: var(--j-background);
|
|
33109
32997
|
border-radius: var(--j-radius-lg);
|
|
33110
32998
|
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
|
|
@@ -33117,24 +33005,24 @@ var ModalContent = styled13("dialog")`
|
|
|
33117
33005
|
}
|
|
33118
33006
|
|
|
33119
33007
|
`;
|
|
33120
|
-
var ModalHeader =
|
|
33008
|
+
var ModalHeader = styled12("div")`
|
|
33121
33009
|
display: flex;
|
|
33122
33010
|
justify-content: space-between;
|
|
33123
33011
|
align-items: flex-start;
|
|
33124
33012
|
padding: 1.5rem 1.5rem 0 1.5rem;
|
|
33125
33013
|
gap: 1rem;
|
|
33126
33014
|
`;
|
|
33127
|
-
var ModalBody =
|
|
33015
|
+
var ModalBody = styled12("div")`
|
|
33128
33016
|
padding: 1rem 1.5rem;
|
|
33129
33017
|
flex: 1;
|
|
33130
33018
|
`;
|
|
33131
|
-
var ModalFooter =
|
|
33019
|
+
var ModalFooter = styled12("div")`
|
|
33132
33020
|
display: flex;
|
|
33133
33021
|
justify-content: flex-end;
|
|
33134
33022
|
gap: 0.75rem;
|
|
33135
33023
|
padding: 0 1.5rem 1.5rem 1.5rem;
|
|
33136
33024
|
`;
|
|
33137
|
-
var CloseButton =
|
|
33025
|
+
var CloseButton = styled12("button")`
|
|
33138
33026
|
background: none;
|
|
33139
33027
|
border: none;
|
|
33140
33028
|
cursor: pointer;
|
|
@@ -33158,7 +33046,7 @@ var CloseButton = styled13("button")`
|
|
|
33158
33046
|
outline-offset: 2px;
|
|
33159
33047
|
}
|
|
33160
33048
|
`;
|
|
33161
|
-
var Modal = (0,
|
|
33049
|
+
var Modal = (0, import_react9.forwardRef)(
|
|
33162
33050
|
({
|
|
33163
33051
|
isOpen,
|
|
33164
33052
|
onClose,
|
|
@@ -33172,8 +33060,8 @@ var Modal = (0, import_react11.forwardRef)(
|
|
|
33172
33060
|
showButtons = true,
|
|
33173
33061
|
className
|
|
33174
33062
|
}, ref) => {
|
|
33175
|
-
const modalRef = (0,
|
|
33176
|
-
(0,
|
|
33063
|
+
const modalRef = (0, import_react9.useRef)(null);
|
|
33064
|
+
(0, import_react9.useEffect)(() => {
|
|
33177
33065
|
if (isOpen) {
|
|
33178
33066
|
modalRef.current?.showModal();
|
|
33179
33067
|
} else {
|
|
@@ -33190,7 +33078,7 @@ var Modal = (0, import_react11.forwardRef)(
|
|
|
33190
33078
|
onClose();
|
|
33191
33079
|
};
|
|
33192
33080
|
if (!isOpen) return null;
|
|
33193
|
-
return /* @__PURE__ */ (0,
|
|
33081
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
33194
33082
|
ModalContent,
|
|
33195
33083
|
{
|
|
33196
33084
|
ref: ref || modalRef,
|
|
@@ -33199,17 +33087,17 @@ var Modal = (0, import_react11.forwardRef)(
|
|
|
33199
33087
|
"aria-labelledby": "modal-heading",
|
|
33200
33088
|
onClose,
|
|
33201
33089
|
children: [
|
|
33202
|
-
/* @__PURE__ */ (0,
|
|
33203
|
-
/* @__PURE__ */ (0,
|
|
33204
|
-
/* @__PURE__ */ (0,
|
|
33090
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(ModalHeader, { children: [
|
|
33091
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Heading, { id: "modal-heading", children: heading }),
|
|
33092
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CloseButton, { onClick: onClose, "aria-label": "Close modal", type: "button", children: "\xD7" })
|
|
33205
33093
|
] }),
|
|
33206
|
-
/* @__PURE__ */ (0,
|
|
33207
|
-
text && /* @__PURE__ */ (0,
|
|
33094
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(ModalBody, { children: [
|
|
33095
|
+
text && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { style: { margin: "0 0 1rem 0", color: "var(--j-text-color)" }, children: text }),
|
|
33208
33096
|
children
|
|
33209
33097
|
] }),
|
|
33210
|
-
showButtons && /* @__PURE__ */ (0,
|
|
33211
|
-
/* @__PURE__ */ (0,
|
|
33212
|
-
/* @__PURE__ */ (0,
|
|
33098
|
+
showButtons && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(ModalFooter, { children: [
|
|
33099
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button, { variant: "secondary", onClick: handleCancel, children: cancelText }),
|
|
33100
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button, { variant: "primary", onClick: handleConfirm, children: confirmText })
|
|
33213
33101
|
] })
|
|
33214
33102
|
]
|
|
33215
33103
|
}
|
|
@@ -33219,19 +33107,19 @@ var Modal = (0, import_react11.forwardRef)(
|
|
|
33219
33107
|
Modal.displayName = "Modal";
|
|
33220
33108
|
|
|
33221
33109
|
// src/inspector/ui/select.tsx
|
|
33222
|
-
var
|
|
33223
|
-
import { styled as
|
|
33224
|
-
var
|
|
33225
|
-
var SelectContainer =
|
|
33110
|
+
var import_react10 = __toESM(require_react(), 1);
|
|
33111
|
+
import { styled as styled13 } from "goober";
|
|
33112
|
+
var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
|
|
33113
|
+
var SelectContainer = styled13("div")`
|
|
33226
33114
|
display: grid;
|
|
33227
33115
|
gap: 0.25rem;
|
|
33228
33116
|
`;
|
|
33229
|
-
var SelectWrapper =
|
|
33117
|
+
var SelectWrapper = styled13("div")`
|
|
33230
33118
|
position: relative;
|
|
33231
33119
|
display: flex;
|
|
33232
33120
|
align-items: center;
|
|
33233
33121
|
`;
|
|
33234
|
-
var StyledSelect =
|
|
33122
|
+
var StyledSelect = styled13("select")`
|
|
33235
33123
|
width: 100%;
|
|
33236
33124
|
border-radius: var(--j-radius-md);
|
|
33237
33125
|
border: 1px solid var(--j-border-color);
|
|
@@ -33249,7 +33137,7 @@ var StyledSelect = styled14("select")`
|
|
|
33249
33137
|
background-color: var(--j-foreground);
|
|
33250
33138
|
}
|
|
33251
33139
|
`;
|
|
33252
|
-
var SelectIcon =
|
|
33140
|
+
var SelectIcon = styled13("span")`
|
|
33253
33141
|
position: absolute;
|
|
33254
33142
|
right: 0.5em;
|
|
33255
33143
|
color: var(--j-neutral-400);
|
|
@@ -33261,20 +33149,62 @@ var SelectIcon = styled14("span")`
|
|
|
33261
33149
|
`;
|
|
33262
33150
|
function Select(props) {
|
|
33263
33151
|
const { label, hideLabel, id: customId, className, ...selectProps } = props;
|
|
33264
|
-
const generatedId = (0,
|
|
33152
|
+
const generatedId = (0, import_react10.useId)();
|
|
33265
33153
|
const id = customId || generatedId;
|
|
33266
|
-
return /* @__PURE__ */ (0,
|
|
33267
|
-
/* @__PURE__ */ (0,
|
|
33268
|
-
/* @__PURE__ */ (0,
|
|
33269
|
-
/* @__PURE__ */ (0,
|
|
33270
|
-
/* @__PURE__ */ (0,
|
|
33154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(SelectContainer, { className, children: [
|
|
33155
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("label", { htmlFor: id, className: hideLabel ? "j-sr-only" : "", children: label }),
|
|
33156
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(SelectWrapper, { children: [
|
|
33157
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(StyledSelect, { ...selectProps, id, children: props.children }),
|
|
33158
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SelectIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "chevronDown", size: "sm" }) })
|
|
33271
33159
|
] })
|
|
33272
33160
|
] });
|
|
33273
33161
|
}
|
|
33274
33162
|
|
|
33275
33163
|
// src/inspector/ui/data-table.tsx
|
|
33276
|
-
var
|
|
33277
|
-
|
|
33164
|
+
var import_react12 = __toESM(require_react(), 1);
|
|
33165
|
+
|
|
33166
|
+
// src/inspector/ui/table.tsx
|
|
33167
|
+
var import_react11 = __toESM(require_react(), 1);
|
|
33168
|
+
var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
|
|
33169
|
+
import { styled as styled14 } from "goober";
|
|
33170
|
+
var StyledTable = styled14("table")`
|
|
33171
|
+
width: 100%;
|
|
33172
|
+
`;
|
|
33173
|
+
var StyledThead = styled14("thead")`
|
|
33174
|
+
text-align: left;
|
|
33175
|
+
border-bottom: 1px solid var(--j-border-color);
|
|
33176
|
+
background-color: var(--j-neutral-100);
|
|
33177
|
+
|
|
33178
|
+
@media (prefers-color-scheme: dark) {
|
|
33179
|
+
background-color: var(--j-neutral-925);
|
|
33180
|
+
}
|
|
33181
|
+
`;
|
|
33182
|
+
var StyledTbody = styled14("tbody")`
|
|
33183
|
+
tr {
|
|
33184
|
+
border-bottom: 1px solid var(--j-border-color);
|
|
33185
|
+
|
|
33186
|
+
&:last-child {
|
|
33187
|
+
border-bottom: none;
|
|
33188
|
+
}
|
|
33189
|
+
}
|
|
33190
|
+
`;
|
|
33191
|
+
var StyledTh = styled14("th")`
|
|
33192
|
+
font-weight: 500;
|
|
33193
|
+
padding: 0.5rem 0.75rem;
|
|
33194
|
+
color: var(--j-text-color-strong);
|
|
33195
|
+
`;
|
|
33196
|
+
var StyledTd = styled14("td")`
|
|
33197
|
+
padding: 0.5rem 0.75rem;
|
|
33198
|
+
`;
|
|
33199
|
+
var Table = import_react11.default.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(StyledTable, { ref, ...props, children }));
|
|
33200
|
+
var TableHead = import_react11.default.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(StyledThead, { ref, ...props, children }));
|
|
33201
|
+
var TableBody = import_react11.default.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(StyledTbody, { ref, ...props, children }));
|
|
33202
|
+
var TableRow = import_react11.default.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("tr", { ref, ...props, children }));
|
|
33203
|
+
var TableHeader = import_react11.default.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(StyledTh, { ref, ...props, children }));
|
|
33204
|
+
var TableCell = import_react11.default.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(StyledTd, { ref, ...props, children }));
|
|
33205
|
+
|
|
33206
|
+
// src/inspector/ui/data-table.tsx
|
|
33207
|
+
var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
|
|
33278
33208
|
function DataTable({
|
|
33279
33209
|
columns,
|
|
33280
33210
|
data,
|
|
@@ -33283,10 +33213,10 @@ function DataTable({
|
|
|
33283
33213
|
getRowKey,
|
|
33284
33214
|
emptyMessage = "No data available"
|
|
33285
33215
|
}) {
|
|
33286
|
-
const [currentPage, setCurrentPage] = (0,
|
|
33287
|
-
const [sortConfig, setSortConfig] = (0,
|
|
33288
|
-
const [filters, setFilters] = (0,
|
|
33289
|
-
const filteredData = (0,
|
|
33216
|
+
const [currentPage, setCurrentPage] = (0, import_react12.useState)(1);
|
|
33217
|
+
const [sortConfig, setSortConfig] = (0, import_react12.useState)(initialSort);
|
|
33218
|
+
const [filters, setFilters] = (0, import_react12.useState)({});
|
|
33219
|
+
const filteredData = (0, import_react12.useMemo)(() => {
|
|
33290
33220
|
return data.filter((row) => {
|
|
33291
33221
|
return Object.entries(filters).every(([columnId, filterValue]) => {
|
|
33292
33222
|
if (!filterValue) return true;
|
|
@@ -33300,7 +33230,7 @@ function DataTable({
|
|
|
33300
33230
|
});
|
|
33301
33231
|
});
|
|
33302
33232
|
}, [data, filters, columns]);
|
|
33303
|
-
const sortedData = (0,
|
|
33233
|
+
const sortedData = (0, import_react12.useMemo)(() => {
|
|
33304
33234
|
if (!sortConfig) return filteredData;
|
|
33305
33235
|
const column = columns.find((col) => col.id === sortConfig.columnId);
|
|
33306
33236
|
if (!column?.sortable) return filteredData;
|
|
@@ -33319,7 +33249,7 @@ function DataTable({
|
|
|
33319
33249
|
const startIndex = (currentPage - 1) * pageSize;
|
|
33320
33250
|
const endIndex = startIndex + pageSize;
|
|
33321
33251
|
const paginatedData = sortedData.slice(startIndex, endIndex);
|
|
33322
|
-
(0,
|
|
33252
|
+
(0, import_react12.useEffect)(() => {
|
|
33323
33253
|
setCurrentPage(1);
|
|
33324
33254
|
}, [filters]);
|
|
33325
33255
|
const handleSort = (columnId) => {
|
|
@@ -33344,9 +33274,9 @@ function DataTable({
|
|
|
33344
33274
|
const handlePageChange = (page) => {
|
|
33345
33275
|
setCurrentPage(Math.max(1, Math.min(page, totalPages)));
|
|
33346
33276
|
};
|
|
33347
|
-
return /* @__PURE__ */ (0,
|
|
33348
|
-
/* @__PURE__ */ (0,
|
|
33349
|
-
/* @__PURE__ */ (0,
|
|
33277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
33278
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Table, { children: [
|
|
33279
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TableRow, { children: columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
33350
33280
|
"div",
|
|
33351
33281
|
{
|
|
33352
33282
|
style: {
|
|
@@ -33357,8 +33287,8 @@ function DataTable({
|
|
|
33357
33287
|
},
|
|
33358
33288
|
onClick: () => handleSort(column.id),
|
|
33359
33289
|
children: [
|
|
33360
|
-
/* @__PURE__ */ (0,
|
|
33361
|
-
column.sortable && /* @__PURE__ */ (0,
|
|
33290
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: column.header }),
|
|
33291
|
+
column.sortable && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
33362
33292
|
"span",
|
|
33363
33293
|
{
|
|
33364
33294
|
style: {
|
|
@@ -33371,8 +33301,8 @@ function DataTable({
|
|
|
33371
33301
|
]
|
|
33372
33302
|
}
|
|
33373
33303
|
) }, column.id)) }) }),
|
|
33374
|
-
/* @__PURE__ */ (0,
|
|
33375
|
-
columns.some((column) => column.filterable) && /* @__PURE__ */ (0,
|
|
33304
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(TableBody, { children: [
|
|
33305
|
+
columns.some((column) => column.filterable) && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TableRow, { children: columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TableCell, { children: column.filterable && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
33376
33306
|
Input,
|
|
33377
33307
|
{
|
|
33378
33308
|
label: "Filter",
|
|
@@ -33384,7 +33314,7 @@ function DataTable({
|
|
|
33384
33314
|
onClick: (e) => e.stopPropagation()
|
|
33385
33315
|
}
|
|
33386
33316
|
) }, column.id)) }),
|
|
33387
|
-
paginatedData.length === 0 ? /* @__PURE__ */ (0,
|
|
33317
|
+
paginatedData.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TableCell, { colSpan: columns.length, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
33388
33318
|
"div",
|
|
33389
33319
|
{
|
|
33390
33320
|
style: {
|
|
@@ -33394,10 +33324,10 @@ function DataTable({
|
|
|
33394
33324
|
},
|
|
33395
33325
|
children: emptyMessage
|
|
33396
33326
|
}
|
|
33397
|
-
) }) }) : paginatedData.map((row, index) => /* @__PURE__ */ (0,
|
|
33327
|
+
) }) }) : paginatedData.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TableRow, { children: columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TableCell, { children: column.accessor(row) }, column.id)) }, getRowKey(row, startIndex + index)))
|
|
33398
33328
|
] })
|
|
33399
33329
|
] }),
|
|
33400
|
-
showPagination && /* @__PURE__ */ (0,
|
|
33330
|
+
showPagination && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
33401
33331
|
"div",
|
|
33402
33332
|
{
|
|
33403
33333
|
style: {
|
|
@@ -33408,7 +33338,7 @@ function DataTable({
|
|
|
33408
33338
|
padding: "8px 0"
|
|
33409
33339
|
},
|
|
33410
33340
|
children: [
|
|
33411
|
-
/* @__PURE__ */ (0,
|
|
33341
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { fontSize: "14px", opacity: 0.7 }, children: [
|
|
33412
33342
|
"Showing ",
|
|
33413
33343
|
startIndex + 1,
|
|
33414
33344
|
" to ",
|
|
@@ -33419,8 +33349,8 @@ function DataTable({
|
|
|
33419
33349
|
" entries",
|
|
33420
33350
|
Object.keys(filters).some((key) => filters[key]) && ` (filtered from ${data.length})`
|
|
33421
33351
|
] }),
|
|
33422
|
-
/* @__PURE__ */ (0,
|
|
33423
|
-
/* @__PURE__ */ (0,
|
|
33352
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { display: "flex", gap: "8px", alignItems: "center" }, children: [
|
|
33353
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
33424
33354
|
Button,
|
|
33425
33355
|
{
|
|
33426
33356
|
variant: "secondary",
|
|
@@ -33429,7 +33359,7 @@ function DataTable({
|
|
|
33429
33359
|
children: "\xAB\xAB"
|
|
33430
33360
|
}
|
|
33431
33361
|
),
|
|
33432
|
-
/* @__PURE__ */ (0,
|
|
33362
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
33433
33363
|
Button,
|
|
33434
33364
|
{
|
|
33435
33365
|
variant: "secondary",
|
|
@@ -33438,13 +33368,13 @@ function DataTable({
|
|
|
33438
33368
|
children: "\xAB"
|
|
33439
33369
|
}
|
|
33440
33370
|
),
|
|
33441
|
-
/* @__PURE__ */ (0,
|
|
33371
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { style: { fontSize: "14px" }, children: [
|
|
33442
33372
|
"Page ",
|
|
33443
33373
|
currentPage,
|
|
33444
33374
|
" of ",
|
|
33445
33375
|
totalPages
|
|
33446
33376
|
] }),
|
|
33447
|
-
/* @__PURE__ */ (0,
|
|
33377
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
33448
33378
|
Button,
|
|
33449
33379
|
{
|
|
33450
33380
|
variant: "secondary",
|
|
@@ -33453,7 +33383,7 @@ function DataTable({
|
|
|
33453
33383
|
children: "\xBB"
|
|
33454
33384
|
}
|
|
33455
33385
|
),
|
|
33456
|
-
/* @__PURE__ */ (0,
|
|
33386
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
33457
33387
|
Button,
|
|
33458
33388
|
{
|
|
33459
33389
|
variant: "secondary",
|
|
@@ -33469,8 +33399,122 @@ function DataTable({
|
|
|
33469
33399
|
] });
|
|
33470
33400
|
}
|
|
33471
33401
|
|
|
33472
|
-
// src/inspector/
|
|
33402
|
+
// src/inspector/ui/accordion.tsx
|
|
33403
|
+
var import_react13 = __toESM(require_react(), 1);
|
|
33404
|
+
var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
|
|
33405
|
+
import { styled as styled15 } from "goober";
|
|
33406
|
+
function Accordion({ title, children, storageKey }) {
|
|
33407
|
+
const [open, setOpen] = useStoragedState(storageKey, false);
|
|
33408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
33409
|
+
"details",
|
|
33410
|
+
{
|
|
33411
|
+
open,
|
|
33412
|
+
style: { display: "flex", flexDirection: "column", gap: "1rem" },
|
|
33413
|
+
children: [
|
|
33414
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
33415
|
+
StyledSummary,
|
|
33416
|
+
{
|
|
33417
|
+
onClick: (e) => {
|
|
33418
|
+
e.preventDefault();
|
|
33419
|
+
setOpen((v) => !v);
|
|
33420
|
+
},
|
|
33421
|
+
children: title
|
|
33422
|
+
}
|
|
33423
|
+
),
|
|
33424
|
+
children
|
|
33425
|
+
]
|
|
33426
|
+
}
|
|
33427
|
+
);
|
|
33428
|
+
}
|
|
33429
|
+
function useStoragedState(key, defaultValue) {
|
|
33430
|
+
const [state, setState] = (0, import_react13.useState)(() => {
|
|
33431
|
+
if (typeof window === "undefined") return defaultValue;
|
|
33432
|
+
const stored = localStorage.getItem(key);
|
|
33433
|
+
return stored ? JSON.parse(stored) : defaultValue;
|
|
33434
|
+
});
|
|
33435
|
+
(0, import_react13.useEffect)(() => {
|
|
33436
|
+
localStorage.setItem(key, JSON.stringify(state));
|
|
33437
|
+
}, [state]);
|
|
33438
|
+
return [state, setState];
|
|
33439
|
+
}
|
|
33440
|
+
var StyledSummary = styled15("summary")`
|
|
33441
|
+
font-size: 1.125rem;
|
|
33442
|
+
cursor: pointer;
|
|
33443
|
+
font-weight: 500;
|
|
33444
|
+
color: var(--j-text-color-strong);
|
|
33445
|
+
`;
|
|
33446
|
+
|
|
33447
|
+
// src/inspector/viewer/raw-data-card.tsx
|
|
33448
|
+
var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
|
|
33449
|
+
function CopyButton({ data }) {
|
|
33450
|
+
const [copyCount, setCopyCount] = (0, import_react14.useState)(0);
|
|
33451
|
+
const copied = copyCount > 0;
|
|
33452
|
+
const stringifiedData = JSON.stringify(data);
|
|
33453
|
+
(0, import_react14.useEffect)(() => {
|
|
33454
|
+
if (copyCount > 0) {
|
|
33455
|
+
const timeout = setTimeout(() => setCopyCount(0), 1e3);
|
|
33456
|
+
return () => {
|
|
33457
|
+
clearTimeout(timeout);
|
|
33458
|
+
};
|
|
33459
|
+
}
|
|
33460
|
+
}, [copyCount]);
|
|
33461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
33462
|
+
Button,
|
|
33463
|
+
{
|
|
33464
|
+
style: {
|
|
33465
|
+
position: "absolute",
|
|
33466
|
+
top: "10px",
|
|
33467
|
+
right: "10px"
|
|
33468
|
+
},
|
|
33469
|
+
onClick: () => {
|
|
33470
|
+
window.navigator.clipboard.writeText(stringifiedData).then(() => {
|
|
33471
|
+
setCopyCount((count) => count + 1);
|
|
33472
|
+
});
|
|
33473
|
+
},
|
|
33474
|
+
variant: "secondary",
|
|
33475
|
+
children: copied ? "Copied" : "Copy"
|
|
33476
|
+
}
|
|
33477
|
+
);
|
|
33478
|
+
}
|
|
33479
|
+
function RawDataCard({ data }) {
|
|
33480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Accordion, { title: "Raw data", storageKey: "jazz-inspector-show-raw-data", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Card, { style: { position: "relative" }, children: [
|
|
33481
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CardHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CopyButton, { data }) }),
|
|
33482
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ValueRenderer, { json: data }) })
|
|
33483
|
+
] }) });
|
|
33484
|
+
}
|
|
33485
|
+
|
|
33486
|
+
// src/inspector/viewer/account-view.tsx
|
|
33487
|
+
var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
|
|
33488
|
+
function AccountView({
|
|
33489
|
+
data,
|
|
33490
|
+
onNavigate,
|
|
33491
|
+
node
|
|
33492
|
+
}) {
|
|
33493
|
+
const readableData = { ...data };
|
|
33494
|
+
for (const key in readableData) {
|
|
33495
|
+
if (key === "readKey" || key.startsWith("sealer_z") || key.startsWith("key_z")) {
|
|
33496
|
+
delete readableData[key];
|
|
33497
|
+
}
|
|
33498
|
+
}
|
|
33499
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
33500
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(GridView, { data: readableData, onNavigate, node }),
|
|
33501
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(RawDataCard, { data })
|
|
33502
|
+
] });
|
|
33503
|
+
}
|
|
33504
|
+
|
|
33505
|
+
// src/inspector/viewer/co-plain-text-view.tsx
|
|
33473
33506
|
var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
|
|
33507
|
+
function CoPlainTextView({ data }) {
|
|
33508
|
+
if (!data) return;
|
|
33509
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
33510
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { children: Object.values(data).join("") }),
|
|
33511
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(RawDataCard, { data })
|
|
33512
|
+
] });
|
|
33513
|
+
}
|
|
33514
|
+
|
|
33515
|
+
// src/inspector/viewer/group-view.tsx
|
|
33516
|
+
var import_react15 = __toESM(require_react(), 1);
|
|
33517
|
+
var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
|
|
33474
33518
|
function partitionMembers(data) {
|
|
33475
33519
|
const everyone = Object.entries(data).filter(([key]) => key === "everyone").map(([key, value]) => ({
|
|
33476
33520
|
id: key,
|
|
@@ -33498,7 +33542,7 @@ function GroupView({
|
|
|
33498
33542
|
onNavigate,
|
|
33499
33543
|
node
|
|
33500
33544
|
}) {
|
|
33501
|
-
const [addMemberType, setAddMemberType] = (0,
|
|
33545
|
+
const [addMemberType, setAddMemberType] = (0, import_react15.useState)(null);
|
|
33502
33546
|
const { everyone, members, parentGroups, childGroups } = partitionMembers(
|
|
33503
33547
|
data
|
|
33504
33548
|
);
|
|
@@ -33577,28 +33621,28 @@ function GroupView({
|
|
|
33577
33621
|
alert(`Failed to add ${addMemberType}: ${error.message}`);
|
|
33578
33622
|
}
|
|
33579
33623
|
};
|
|
33580
|
-
return /* @__PURE__ */ (0,
|
|
33581
|
-
/* @__PURE__ */ (0,
|
|
33582
|
-
/* @__PURE__ */ (0,
|
|
33583
|
-
/* @__PURE__ */ (0,
|
|
33584
|
-
/* @__PURE__ */ (0,
|
|
33585
|
-
/* @__PURE__ */ (0,
|
|
33624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
33625
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Table, { children: [
|
|
33626
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(TableRow, { children: [
|
|
33627
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TableHeader, { children: "Member" }),
|
|
33628
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TableHeader, { children: "Permission" }),
|
|
33629
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TableHeader, {})
|
|
33586
33630
|
] }) }),
|
|
33587
|
-
/* @__PURE__ */ (0,
|
|
33588
|
-
everyone.map((member) => /* @__PURE__ */ (0,
|
|
33589
|
-
/* @__PURE__ */ (0,
|
|
33590
|
-
/* @__PURE__ */ (0,
|
|
33591
|
-
/* @__PURE__ */ (0,
|
|
33631
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(TableBody, { children: [
|
|
33632
|
+
everyone.map((member) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(TableRow, { children: [
|
|
33633
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TableCell, { children: member.id }),
|
|
33634
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TableCell, { children: member.role }),
|
|
33635
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TableCell, { children: member.role !== "revoked" && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
33592
33636
|
Button,
|
|
33593
33637
|
{
|
|
33594
33638
|
variant: "secondary",
|
|
33595
33639
|
onClick: () => onRemoveMember(member.id),
|
|
33596
|
-
children: /* @__PURE__ */ (0,
|
|
33640
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { name: "delete" })
|
|
33597
33641
|
}
|
|
33598
33642
|
) })
|
|
33599
33643
|
] }, member.id)),
|
|
33600
|
-
members.map((member) => /* @__PURE__ */ (0,
|
|
33601
|
-
/* @__PURE__ */ (0,
|
|
33644
|
+
members.map((member) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(TableRow, { children: [
|
|
33645
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
33602
33646
|
AccountOrGroupText,
|
|
33603
33647
|
{
|
|
33604
33648
|
coId: member.id,
|
|
@@ -33609,18 +33653,18 @@ function GroupView({
|
|
|
33609
33653
|
}
|
|
33610
33654
|
}
|
|
33611
33655
|
) }),
|
|
33612
|
-
/* @__PURE__ */ (0,
|
|
33613
|
-
/* @__PURE__ */ (0,
|
|
33656
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TableCell, { children: member.role }),
|
|
33657
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TableCell, { children: member.role !== "revoked" && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
33614
33658
|
Button,
|
|
33615
33659
|
{
|
|
33616
33660
|
variant: "secondary",
|
|
33617
33661
|
onClick: () => onRemoveMember(member.id),
|
|
33618
|
-
children: /* @__PURE__ */ (0,
|
|
33662
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { name: "delete" })
|
|
33619
33663
|
}
|
|
33620
33664
|
) })
|
|
33621
33665
|
] }, member.id)),
|
|
33622
|
-
parentGroups.map((group) => /* @__PURE__ */ (0,
|
|
33623
|
-
/* @__PURE__ */ (0,
|
|
33666
|
+
parentGroups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(TableRow, { children: [
|
|
33667
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
33624
33668
|
AccountOrGroupText,
|
|
33625
33669
|
{
|
|
33626
33670
|
coId: group.id,
|
|
@@ -33631,19 +33675,19 @@ function GroupView({
|
|
|
33631
33675
|
}
|
|
33632
33676
|
}
|
|
33633
33677
|
) }),
|
|
33634
|
-
/* @__PURE__ */ (0,
|
|
33635
|
-
/* @__PURE__ */ (0,
|
|
33678
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TableCell, { children: group.role }),
|
|
33679
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TableCell, { children: group.role !== "revoked" && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
33636
33680
|
Button,
|
|
33637
33681
|
{
|
|
33638
33682
|
variant: "secondary",
|
|
33639
33683
|
onClick: () => onRemoveGroup(group.id),
|
|
33640
|
-
children: /* @__PURE__ */ (0,
|
|
33684
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { name: "delete" })
|
|
33641
33685
|
}
|
|
33642
33686
|
) })
|
|
33643
33687
|
] }, group.id))
|
|
33644
33688
|
] })
|
|
33645
33689
|
] }),
|
|
33646
|
-
/* @__PURE__ */ (0,
|
|
33690
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
33647
33691
|
"div",
|
|
33648
33692
|
{
|
|
33649
33693
|
style: {
|
|
@@ -33653,14 +33697,14 @@ function GroupView({
|
|
|
33653
33697
|
marginTop: "1rem"
|
|
33654
33698
|
},
|
|
33655
33699
|
children: [
|
|
33656
|
-
/* @__PURE__ */ (0,
|
|
33657
|
-
/* @__PURE__ */ (0,
|
|
33700
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Button, { variant: "primary", onClick: () => setAddMemberType("account"), children: "Add Account" }),
|
|
33701
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Button, { variant: "primary", onClick: () => setAddMemberType("group"), children: "Add Group" })
|
|
33658
33702
|
]
|
|
33659
33703
|
}
|
|
33660
33704
|
),
|
|
33661
|
-
childGroups.length > 0 && /* @__PURE__ */ (0,
|
|
33662
|
-
/* @__PURE__ */ (0,
|
|
33663
|
-
/* @__PURE__ */ (0,
|
|
33705
|
+
childGroups.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Table, { children: [
|
|
33706
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TableHeader, { children: "Member of" }) }) }),
|
|
33707
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TableBody, { children: childGroups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
33664
33708
|
AccountOrGroupText,
|
|
33665
33709
|
{
|
|
33666
33710
|
coId: group.id,
|
|
@@ -33672,20 +33716,20 @@ function GroupView({
|
|
|
33672
33716
|
}
|
|
33673
33717
|
) }) }, group.id)) })
|
|
33674
33718
|
] }),
|
|
33675
|
-
/* @__PURE__ */ (0,
|
|
33676
|
-
/* @__PURE__ */ (0,
|
|
33719
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(RawDataCard, { data }),
|
|
33720
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
33677
33721
|
Modal,
|
|
33678
33722
|
{
|
|
33679
33723
|
isOpen: addMemberType !== null,
|
|
33680
33724
|
onClose: () => setAddMemberType(null),
|
|
33681
33725
|
heading: addMemberType === "account" ? "Add Account" : "Add Group",
|
|
33682
33726
|
showButtons: false,
|
|
33683
|
-
children: /* @__PURE__ */ (0,
|
|
33727
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("form", { onSubmit: handleAddMemberSubmit, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
33684
33728
|
"div",
|
|
33685
33729
|
{
|
|
33686
33730
|
style: { display: "flex", flexDirection: "column", gap: "1rem" },
|
|
33687
33731
|
children: [
|
|
33688
|
-
/* @__PURE__ */ (0,
|
|
33732
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
33689
33733
|
Input,
|
|
33690
33734
|
{
|
|
33691
33735
|
name: "memberId",
|
|
@@ -33694,13 +33738,13 @@ function GroupView({
|
|
|
33694
33738
|
required: true
|
|
33695
33739
|
}
|
|
33696
33740
|
),
|
|
33697
|
-
/* @__PURE__ */ (0,
|
|
33698
|
-
/* @__PURE__ */ (0,
|
|
33699
|
-
/* @__PURE__ */ (0,
|
|
33700
|
-
/* @__PURE__ */ (0,
|
|
33701
|
-
addMemberType === "account" ? /* @__PURE__ */ (0,
|
|
33741
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Select, { name: "role", label: "Role", children: [
|
|
33742
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("option", { value: "reader", children: "Reader" }),
|
|
33743
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("option", { value: "writer", children: "Writer" }),
|
|
33744
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("option", { value: "admin", children: "Admin" }),
|
|
33745
|
+
addMemberType === "account" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("option", { value: "writeOnly", children: "Write Only" }) }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("option", { value: "inherit", children: "Inherit" }) })
|
|
33702
33746
|
] }),
|
|
33703
|
-
/* @__PURE__ */ (0,
|
|
33747
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
33704
33748
|
"div",
|
|
33705
33749
|
{
|
|
33706
33750
|
style: {
|
|
@@ -33710,7 +33754,7 @@ function GroupView({
|
|
|
33710
33754
|
marginTop: "0.5rem"
|
|
33711
33755
|
},
|
|
33712
33756
|
children: [
|
|
33713
|
-
/* @__PURE__ */ (0,
|
|
33757
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
33714
33758
|
Button,
|
|
33715
33759
|
{
|
|
33716
33760
|
type: "button",
|
|
@@ -33719,7 +33763,7 @@ function GroupView({
|
|
|
33719
33763
|
children: "Cancel"
|
|
33720
33764
|
}
|
|
33721
33765
|
),
|
|
33722
|
-
/* @__PURE__ */ (0,
|
|
33766
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Button, { type: "submit", variant: "primary", children: "Add" })
|
|
33723
33767
|
]
|
|
33724
33768
|
}
|
|
33725
33769
|
)
|
|
@@ -33732,7 +33776,7 @@ function GroupView({
|
|
|
33732
33776
|
}
|
|
33733
33777
|
|
|
33734
33778
|
// src/inspector/viewer/role-display.tsx
|
|
33735
|
-
var
|
|
33779
|
+
var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
|
|
33736
33780
|
function RoleDisplay({
|
|
33737
33781
|
node,
|
|
33738
33782
|
value
|
|
@@ -33751,24 +33795,24 @@ function RoleDisplay({
|
|
|
33751
33795
|
} else {
|
|
33752
33796
|
role = "unauthorized";
|
|
33753
33797
|
}
|
|
33754
|
-
return /* @__PURE__ */ (0,
|
|
33798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { children: [
|
|
33755
33799
|
"Role: ",
|
|
33756
33800
|
role
|
|
33757
33801
|
] });
|
|
33758
33802
|
}
|
|
33759
33803
|
|
|
33760
33804
|
// src/inspector/viewer/table-viewer.tsx
|
|
33761
|
-
var
|
|
33762
|
-
import { styled as
|
|
33763
|
-
var
|
|
33764
|
-
var PaginationContainer =
|
|
33805
|
+
var import_react16 = __toESM(require_react(), 1);
|
|
33806
|
+
import { styled as styled16 } from "goober";
|
|
33807
|
+
var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
|
|
33808
|
+
var PaginationContainer = styled16("div")`
|
|
33765
33809
|
padding: 1rem 0;
|
|
33766
33810
|
display: flex;
|
|
33767
33811
|
align-items: center;
|
|
33768
33812
|
justify-content: space-between;
|
|
33769
33813
|
gap: 0.5rem;
|
|
33770
33814
|
`;
|
|
33771
|
-
var RedTooltip =
|
|
33815
|
+
var RedTooltip = styled16("span")`
|
|
33772
33816
|
position:relative; /* making the .tooltip span a container for the tooltip text */
|
|
33773
33817
|
border-bottom:1px dashed #000; /* little indicater to indicate it's hoverable */
|
|
33774
33818
|
|
|
@@ -33805,8 +33849,8 @@ function CoValuesTableView({
|
|
|
33805
33849
|
onNavigate,
|
|
33806
33850
|
onRemove
|
|
33807
33851
|
}) {
|
|
33808
|
-
const [visibleRowsCount, setVisibleRowsCount] = (0,
|
|
33809
|
-
const [coIdArray, visibleRows] = (0,
|
|
33852
|
+
const [visibleRowsCount, setVisibleRowsCount] = (0, import_react16.useState)(10);
|
|
33853
|
+
const [coIdArray, visibleRows] = (0, import_react16.useMemo)(() => {
|
|
33810
33854
|
const coIdArray2 = Array.isArray(data) ? data : Object.values(data).every((k) => typeof k === "string" && isCoId(k)) ? Object.values(data).map((k) => k) : [];
|
|
33811
33855
|
const visibleRows2 = coIdArray2.slice(0, visibleRowsCount);
|
|
33812
33856
|
return [coIdArray2, visibleRows2];
|
|
@@ -33814,10 +33858,10 @@ function CoValuesTableView({
|
|
|
33814
33858
|
const resolvedRows = useResolvedCoValues(visibleRows, node);
|
|
33815
33859
|
const hasMore = visibleRowsCount < coIdArray.length;
|
|
33816
33860
|
if (!coIdArray.length) {
|
|
33817
|
-
return /* @__PURE__ */ (0,
|
|
33861
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { children: "No data to display" });
|
|
33818
33862
|
}
|
|
33819
33863
|
if (resolvedRows.length === 0) {
|
|
33820
|
-
return /* @__PURE__ */ (0,
|
|
33864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { children: "Loading..." });
|
|
33821
33865
|
}
|
|
33822
33866
|
const keys = Array.from(
|
|
33823
33867
|
new Set(
|
|
@@ -33827,15 +33871,15 @@ function CoValuesTableView({
|
|
|
33827
33871
|
const loadMore = () => {
|
|
33828
33872
|
setVisibleRowsCount((prevVisibleRows) => prevVisibleRows + 10);
|
|
33829
33873
|
};
|
|
33830
|
-
return /* @__PURE__ */ (0,
|
|
33831
|
-
/* @__PURE__ */ (0,
|
|
33832
|
-
/* @__PURE__ */ (0,
|
|
33833
|
-
["ID", ...keys, "Action"].map((key) => /* @__PURE__ */ (0,
|
|
33834
|
-
onRemove && /* @__PURE__ */ (0,
|
|
33874
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
33875
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Table, { children: [
|
|
33876
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(TableRow, { children: [
|
|
33877
|
+
["ID", ...keys, "Action"].map((key) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableHeader, { children: key }, key)),
|
|
33878
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableHeader, {})
|
|
33835
33879
|
] }) }),
|
|
33836
|
-
/* @__PURE__ */ (0,
|
|
33837
|
-
/* @__PURE__ */ (0,
|
|
33838
|
-
/* @__PURE__ */ (0,
|
|
33880
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableBody, { children: resolvedRows.slice(0, visibleRowsCount).map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(TableRow, { children: [
|
|
33881
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { mono: true, children: item.snapshot === "unavailable" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(RedTooltip, { "data-text": "Unavailable", children: [
|
|
33882
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
33839
33883
|
Icon,
|
|
33840
33884
|
{
|
|
33841
33885
|
name: "caution",
|
|
@@ -33848,7 +33892,7 @@ function CoValuesTableView({
|
|
|
33848
33892
|
),
|
|
33849
33893
|
visibleRows[index]
|
|
33850
33894
|
] }) : visibleRows[index] }) }),
|
|
33851
|
-
keys.map((key) => /* @__PURE__ */ (0,
|
|
33895
|
+
keys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableCell, { children: item.snapshot !== "unavailable" && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
33852
33896
|
ValueRenderer,
|
|
33853
33897
|
{
|
|
33854
33898
|
json: item.snapshot[key],
|
|
@@ -33869,7 +33913,7 @@ function CoValuesTableView({
|
|
|
33869
33913
|
}
|
|
33870
33914
|
}
|
|
33871
33915
|
) }, key)),
|
|
33872
|
-
/* @__PURE__ */ (0,
|
|
33916
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
33873
33917
|
Button,
|
|
33874
33918
|
{
|
|
33875
33919
|
variant: "secondary",
|
|
@@ -33882,18 +33926,18 @@ function CoValuesTableView({
|
|
|
33882
33926
|
children: "View"
|
|
33883
33927
|
}
|
|
33884
33928
|
) }),
|
|
33885
|
-
onRemove && /* @__PURE__ */ (0,
|
|
33929
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button, { variant: "secondary", onClick: () => onRemove(index), children: "Remove" }) })
|
|
33886
33930
|
] }, index)) })
|
|
33887
33931
|
] }),
|
|
33888
|
-
/* @__PURE__ */ (0,
|
|
33889
|
-
/* @__PURE__ */ (0,
|
|
33932
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(PaginationContainer, { children: [
|
|
33933
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { muted: true, small: true, children: [
|
|
33890
33934
|
"Showing ",
|
|
33891
33935
|
Math.min(visibleRowsCount, coIdArray.length),
|
|
33892
33936
|
" of",
|
|
33893
33937
|
" ",
|
|
33894
33938
|
coIdArray.length
|
|
33895
33939
|
] }),
|
|
33896
|
-
hasMore && /* @__PURE__ */ (0,
|
|
33940
|
+
hasMore && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button, { variant: "secondary", onClick: loadMore, children: "Load more" })
|
|
33897
33941
|
] })
|
|
33898
33942
|
] });
|
|
33899
33943
|
}
|
|
@@ -33903,11 +33947,11 @@ function TableView({
|
|
|
33903
33947
|
onNavigate,
|
|
33904
33948
|
onRemove
|
|
33905
33949
|
}) {
|
|
33906
|
-
const isListOfCoValues = (0,
|
|
33950
|
+
const isListOfCoValues = (0, import_react16.useMemo)(() => {
|
|
33907
33951
|
return Array.isArray(data) && data.every((k) => isCoId(k));
|
|
33908
33952
|
}, [data]);
|
|
33909
33953
|
if (isListOfCoValues) {
|
|
33910
|
-
return /* @__PURE__ */ (0,
|
|
33954
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
33911
33955
|
CoValuesTableView,
|
|
33912
33956
|
{
|
|
33913
33957
|
data,
|
|
@@ -33917,29 +33961,29 @@ function TableView({
|
|
|
33917
33961
|
}
|
|
33918
33962
|
);
|
|
33919
33963
|
}
|
|
33920
|
-
return /* @__PURE__ */ (0,
|
|
33921
|
-
/* @__PURE__ */ (0,
|
|
33922
|
-
/* @__PURE__ */ (0,
|
|
33923
|
-
/* @__PURE__ */ (0,
|
|
33924
|
-
onRemove && /* @__PURE__ */ (0,
|
|
33964
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Table, { children: [
|
|
33965
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(TableRow, { children: [
|
|
33966
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableHeader, { style: { width: "5rem" }, children: "Index" }),
|
|
33967
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableHeader, { children: "Value" }),
|
|
33968
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableHeader, { children: "Action" })
|
|
33925
33969
|
] }) }),
|
|
33926
|
-
/* @__PURE__ */ (0,
|
|
33927
|
-
/* @__PURE__ */ (0,
|
|
33928
|
-
/* @__PURE__ */ (0,
|
|
33929
|
-
onRemove && /* @__PURE__ */ (0,
|
|
33970
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableBody, { children: Array.isArray(data) && data?.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(TableRow, { children: [
|
|
33971
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { mono: true, children: index }) }),
|
|
33972
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ValueRenderer, { json: value }) }),
|
|
33973
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button, { variant: "secondary", onClick: () => onRemove(index), children: "Remove" }) })
|
|
33930
33974
|
] }, index)) })
|
|
33931
33975
|
] });
|
|
33932
33976
|
}
|
|
33933
33977
|
|
|
33934
33978
|
// src/inspector/viewer/history-view.tsx
|
|
33935
|
-
var
|
|
33936
|
-
import { styled as
|
|
33937
|
-
var
|
|
33979
|
+
var import_react17 = __toESM(require_react(), 1);
|
|
33980
|
+
import { styled as styled17 } from "goober";
|
|
33981
|
+
var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
|
|
33938
33982
|
function HistoryView({
|
|
33939
33983
|
coValue,
|
|
33940
33984
|
node
|
|
33941
33985
|
}) {
|
|
33942
|
-
const transactions = (0,
|
|
33986
|
+
const transactions = (0, import_react17.useMemo)(
|
|
33943
33987
|
() => getHistory(coValue),
|
|
33944
33988
|
[coValue.core.verifiedTransactions.length]
|
|
33945
33989
|
);
|
|
@@ -33947,8 +33991,8 @@ function HistoryView({
|
|
|
33947
33991
|
{
|
|
33948
33992
|
id: "author",
|
|
33949
33993
|
header: "Author",
|
|
33950
|
-
accessor: (row) => /* @__PURE__ */ (0,
|
|
33951
|
-
row.isValid || /* @__PURE__ */ (0,
|
|
33994
|
+
accessor: (row) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
33995
|
+
row.isValid || /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(RedTooltip2, { "data-text": "This transaction is invalid and is not used", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
33952
33996
|
Icon,
|
|
33953
33997
|
{
|
|
33954
33998
|
name: "caution",
|
|
@@ -33961,7 +34005,7 @@ function HistoryView({
|
|
|
33961
34005
|
}
|
|
33962
34006
|
}
|
|
33963
34007
|
) }),
|
|
33964
|
-
row.author.startsWith("co_") ? /* @__PURE__ */ (0,
|
|
34008
|
+
row.author.startsWith("co_") ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
33965
34009
|
AccountOrGroupText,
|
|
33966
34010
|
{
|
|
33967
34011
|
coId: row.author,
|
|
@@ -33992,20 +34036,17 @@ function HistoryView({
|
|
|
33992
34036
|
sortFn: (a, b) => a.timestamp.getTime() - b.timestamp.getTime()
|
|
33993
34037
|
}
|
|
33994
34038
|
];
|
|
33995
|
-
return /* @__PURE__ */ (0,
|
|
33996
|
-
|
|
33997
|
-
|
|
33998
|
-
|
|
33999
|
-
|
|
34000
|
-
|
|
34001
|
-
|
|
34002
|
-
|
|
34003
|
-
|
|
34004
|
-
|
|
34005
|
-
|
|
34006
|
-
}
|
|
34007
|
-
)
|
|
34008
|
-
] });
|
|
34039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Accordion, { title: "CoValue history", storageKey: "jazz-inspector-show-history", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
34040
|
+
DataTable,
|
|
34041
|
+
{
|
|
34042
|
+
columns,
|
|
34043
|
+
data: transactions,
|
|
34044
|
+
pageSize: 10,
|
|
34045
|
+
initialSort: { columnId: "timestamp", direction: "desc" },
|
|
34046
|
+
getRowKey: (row) => row.id,
|
|
34047
|
+
emptyMessage: "No history available"
|
|
34048
|
+
}
|
|
34049
|
+
) });
|
|
34009
34050
|
}
|
|
34010
34051
|
function getTransactionChanges(tx, coValue) {
|
|
34011
34052
|
if (tx.isValid === false && tx.tx.privacy === "private") {
|
|
@@ -34093,7 +34134,7 @@ function mapTransactionToAction(change, coValue) {
|
|
|
34093
34134
|
return `Stream ended`;
|
|
34094
34135
|
}
|
|
34095
34136
|
if (isPropertySet(change)) {
|
|
34096
|
-
return `Property "${change.key}" has been set to
|
|
34137
|
+
return `Property "${change.key}" has been set to ${JSON.stringify(change.value)}`;
|
|
34097
34138
|
}
|
|
34098
34139
|
if (isPropertyDeletion(change)) {
|
|
34099
34140
|
return `Property "${change.key}" has been deleted`;
|
|
@@ -34144,7 +34185,7 @@ var isStreamChunk = (change) => {
|
|
|
34144
34185
|
var isStreamEnd = (change) => {
|
|
34145
34186
|
return change?.type === "end";
|
|
34146
34187
|
};
|
|
34147
|
-
var RedTooltip2 =
|
|
34188
|
+
var RedTooltip2 = styled17("span")`
|
|
34148
34189
|
position:relative; /* making the .tooltip span a container for the tooltip text */
|
|
34149
34190
|
border-bottom:1px dashed #000; /* little indicater to indicate it's hoverable */
|
|
34150
34191
|
|
|
@@ -34177,11 +34218,11 @@ var RedTooltip2 = styled16("span")`
|
|
|
34177
34218
|
`;
|
|
34178
34219
|
|
|
34179
34220
|
// src/inspector/viewer/page.tsx
|
|
34180
|
-
var
|
|
34181
|
-
var BasePageContainer =
|
|
34182
|
-
({ isTopLevel, ...rest }, ref) => /* @__PURE__ */ (0,
|
|
34221
|
+
var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
|
|
34222
|
+
var BasePageContainer = import_react18.default.forwardRef(
|
|
34223
|
+
({ isTopLevel, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { ref, ...rest })
|
|
34183
34224
|
);
|
|
34184
|
-
var PageContainer =
|
|
34225
|
+
var PageContainer = styled18(BasePageContainer)`
|
|
34185
34226
|
position: absolute;
|
|
34186
34227
|
z-index: 10;
|
|
34187
34228
|
inset: 0;
|
|
@@ -34189,36 +34230,36 @@ var PageContainer = styled17(BasePageContainer)`
|
|
|
34189
34230
|
height: 100%;
|
|
34190
34231
|
padding: 0 0.75rem;
|
|
34191
34232
|
`;
|
|
34192
|
-
var BackButton =
|
|
34233
|
+
var BackButton = styled18("div")`
|
|
34193
34234
|
position: absolute;
|
|
34194
34235
|
left: 0;
|
|
34195
34236
|
right: 0;
|
|
34196
34237
|
top: 0;
|
|
34197
34238
|
height: 2.5rem;
|
|
34198
34239
|
`;
|
|
34199
|
-
var HeaderContainer =
|
|
34240
|
+
var HeaderContainer = styled18("div")`
|
|
34200
34241
|
display: flex;
|
|
34201
34242
|
justify-content: space-between;
|
|
34202
34243
|
align-items: center;
|
|
34203
34244
|
margin-bottom: 1rem;
|
|
34204
34245
|
`;
|
|
34205
|
-
var TitleContainer =
|
|
34246
|
+
var TitleContainer = styled18("div")`
|
|
34206
34247
|
display: flex;
|
|
34207
34248
|
align-items: center;
|
|
34208
34249
|
gap: 0.75rem;
|
|
34209
34250
|
`;
|
|
34210
|
-
var Title =
|
|
34251
|
+
var Title = styled18(Heading)`
|
|
34211
34252
|
display: flex;
|
|
34212
34253
|
flex-direction: column;
|
|
34213
34254
|
align-items: flex-start;
|
|
34214
34255
|
gap: 0.25rem;
|
|
34215
34256
|
`;
|
|
34216
|
-
var BadgeContainer =
|
|
34257
|
+
var BadgeContainer = styled18("div")`
|
|
34217
34258
|
display: flex;
|
|
34218
34259
|
align-items: center;
|
|
34219
34260
|
gap: 0.75rem;
|
|
34220
34261
|
`;
|
|
34221
|
-
var ContentContainer =
|
|
34262
|
+
var ContentContainer = styled18("div")`
|
|
34222
34263
|
overflow: auto;
|
|
34223
34264
|
display: flex;
|
|
34224
34265
|
flex-direction: column;
|
|
@@ -34239,7 +34280,7 @@ function View(props) {
|
|
|
34239
34280
|
const { node, onNavigate } = props;
|
|
34240
34281
|
if (!snapshot || snapshot === "unavailable") return;
|
|
34241
34282
|
if (type === "costream") {
|
|
34242
|
-
return /* @__PURE__ */ (0,
|
|
34283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
34243
34284
|
CoStreamView,
|
|
34244
34285
|
{
|
|
34245
34286
|
data: snapshot,
|
|
@@ -34250,7 +34291,7 @@ function View(props) {
|
|
|
34250
34291
|
);
|
|
34251
34292
|
}
|
|
34252
34293
|
if (extendedType === "group") {
|
|
34253
|
-
return /* @__PURE__ */ (0,
|
|
34294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
34254
34295
|
GroupView,
|
|
34255
34296
|
{
|
|
34256
34297
|
coValue: value,
|
|
@@ -34261,10 +34302,10 @@ function View(props) {
|
|
|
34261
34302
|
);
|
|
34262
34303
|
}
|
|
34263
34304
|
if (extendedType === "account") {
|
|
34264
|
-
return /* @__PURE__ */ (0,
|
|
34305
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AccountView, { data: snapshot, node, onNavigate });
|
|
34265
34306
|
}
|
|
34266
34307
|
if (type === "coplaintext") {
|
|
34267
|
-
return /* @__PURE__ */ (0,
|
|
34308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CoPlainTextView, { data: snapshot });
|
|
34268
34309
|
}
|
|
34269
34310
|
if (type === "colist") {
|
|
34270
34311
|
const handleRemove = (index) => {
|
|
@@ -34273,7 +34314,7 @@ function View(props) {
|
|
|
34273
34314
|
list.delete(index);
|
|
34274
34315
|
}
|
|
34275
34316
|
};
|
|
34276
|
-
return /* @__PURE__ */ (0,
|
|
34317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
34277
34318
|
TableView,
|
|
34278
34319
|
{
|
|
34279
34320
|
data: snapshot,
|
|
@@ -34284,9 +34325,9 @@ function View(props) {
|
|
|
34284
34325
|
);
|
|
34285
34326
|
}
|
|
34286
34327
|
if (extendedType === "record") {
|
|
34287
|
-
return /* @__PURE__ */ (0,
|
|
34328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TableView, { data: snapshot, node, onNavigate });
|
|
34288
34329
|
}
|
|
34289
|
-
return /* @__PURE__ */ (0,
|
|
34330
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(GridView, { data: snapshot, onNavigate, node });
|
|
34290
34331
|
}
|
|
34291
34332
|
function Page(props) {
|
|
34292
34333
|
const {
|
|
@@ -34302,13 +34343,13 @@ function Page(props) {
|
|
|
34302
34343
|
const coValue = useResolvedCoValue(coId, node);
|
|
34303
34344
|
const { value, snapshot, type, extendedType } = coValue;
|
|
34304
34345
|
if (snapshot === "unavailable") {
|
|
34305
|
-
return /* @__PURE__ */ (0,
|
|
34346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { style, children: "Data unavailable" });
|
|
34306
34347
|
}
|
|
34307
34348
|
if (!snapshot) {
|
|
34308
|
-
return /* @__PURE__ */ (0,
|
|
34349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { style });
|
|
34309
34350
|
}
|
|
34310
|
-
return /* @__PURE__ */ (0,
|
|
34311
|
-
!isTopLevel && /* @__PURE__ */ (0,
|
|
34351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(PageContainer, { style, className, isTopLevel, children: [
|
|
34352
|
+
!isTopLevel && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
34312
34353
|
BackButton,
|
|
34313
34354
|
{
|
|
34314
34355
|
"aria-label": "Back",
|
|
@@ -34318,27 +34359,27 @@ function Page(props) {
|
|
|
34318
34359
|
"aria-hidden": "true"
|
|
34319
34360
|
}
|
|
34320
34361
|
),
|
|
34321
|
-
/* @__PURE__ */ (0,
|
|
34322
|
-
/* @__PURE__ */ (0,
|
|
34362
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(HeaderContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(TitleContainer, { children: [
|
|
34363
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Title, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { children: [
|
|
34323
34364
|
name,
|
|
34324
|
-
typeof snapshot === "object" && "name" in snapshot ? /* @__PURE__ */ (0,
|
|
34365
|
+
typeof snapshot === "object" && "name" in snapshot ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { style: { color: "#57534e", fontWeight: 500 }, children: [
|
|
34325
34366
|
" ",
|
|
34326
34367
|
snapshot.name
|
|
34327
34368
|
] }) : null
|
|
34328
34369
|
] }) }),
|
|
34329
|
-
/* @__PURE__ */ (0,
|
|
34330
|
-
/* @__PURE__ */ (0,
|
|
34331
|
-
/* @__PURE__ */ (0,
|
|
34370
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(BadgeContainer, { children: [
|
|
34371
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Badge, { children: type && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TypeIcon, { type, extendedType }) }),
|
|
34372
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Badge, { children: coId })
|
|
34332
34373
|
] })
|
|
34333
34374
|
] }) }),
|
|
34334
|
-
/* @__PURE__ */ (0,
|
|
34335
|
-
/* @__PURE__ */ (0,
|
|
34336
|
-
extendedType !== "account" && extendedType !== "group" && /* @__PURE__ */ (0,
|
|
34337
|
-
/* @__PURE__ */ (0,
|
|
34338
|
-
/* @__PURE__ */ (0,
|
|
34375
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(ContentContainer, { children: [
|
|
34376
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(View, { ...props, coValue }),
|
|
34377
|
+
extendedType !== "account" && extendedType !== "group" && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
34378
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(RoleDisplay, { node, value }),
|
|
34379
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { muted: true, children: [
|
|
34339
34380
|
"Owned by",
|
|
34340
34381
|
" ",
|
|
34341
|
-
/* @__PURE__ */ (0,
|
|
34382
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
34342
34383
|
AccountOrGroupText,
|
|
34343
34384
|
{
|
|
34344
34385
|
coId: value.group.id,
|
|
@@ -34351,14 +34392,46 @@ function Page(props) {
|
|
|
34351
34392
|
)
|
|
34352
34393
|
] })
|
|
34353
34394
|
] }),
|
|
34354
|
-
value && /* @__PURE__ */ (0,
|
|
34395
|
+
value && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(HistoryView, { coValue: value, node })
|
|
34355
34396
|
] })
|
|
34356
34397
|
] });
|
|
34357
34398
|
}
|
|
34358
34399
|
|
|
34400
|
+
// src/inspector/ui/error-boundary.tsx
|
|
34401
|
+
var import_react19 = __toESM(require_react(), 1);
|
|
34402
|
+
var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
|
|
34403
|
+
import { styled as styled19 } from "goober";
|
|
34404
|
+
var ErrorBoundary = class extends import_react19.default.Component {
|
|
34405
|
+
constructor(props) {
|
|
34406
|
+
super(props);
|
|
34407
|
+
this.state = { hasError: false };
|
|
34408
|
+
}
|
|
34409
|
+
static getDerivedStateFromError(error) {
|
|
34410
|
+
return { hasError: true, error };
|
|
34411
|
+
}
|
|
34412
|
+
componentDidCatch(error, errorInfo) {
|
|
34413
|
+
console.error(error);
|
|
34414
|
+
}
|
|
34415
|
+
render() {
|
|
34416
|
+
if (this.state.hasError) {
|
|
34417
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { style: { padding: "1rem" }, children: [
|
|
34418
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(StyledHeading2, { children: this.props.title }),
|
|
34419
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { mono: true, style: { marginTop: "0.5rem", color: "#ef4444" }, children: this.state.error?.message || "An unexpected error occurred" }),
|
|
34420
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("pre", { style: { paddingLeft: "1rem", color: "#ef4444" }, children: this.state.error?.stack })
|
|
34421
|
+
] });
|
|
34422
|
+
}
|
|
34423
|
+
return this.props.children;
|
|
34424
|
+
}
|
|
34425
|
+
};
|
|
34426
|
+
var StyledHeading2 = styled19("h1")`
|
|
34427
|
+
font-size: 1.125rem;
|
|
34428
|
+
font-weight: 500;
|
|
34429
|
+
color: var(--j-text-color-strong);
|
|
34430
|
+
`;
|
|
34431
|
+
|
|
34359
34432
|
// src/inspector/viewer/page-stack.tsx
|
|
34360
|
-
var
|
|
34361
|
-
var PageStackContainer =
|
|
34433
|
+
var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
|
|
34434
|
+
var PageStackContainer = styled20("div")`
|
|
34362
34435
|
position: relative;
|
|
34363
34436
|
padding: 0 0.75rem;
|
|
34364
34437
|
overflow-y: auto;
|
|
@@ -34375,9 +34448,9 @@ function PageStack({
|
|
|
34375
34448
|
}) {
|
|
34376
34449
|
const page = path[path.length - 1];
|
|
34377
34450
|
const index = path.length - 1;
|
|
34378
|
-
return /* @__PURE__ */ (0,
|
|
34451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_jsx_runtime32.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(PageStackContainer, { children: [
|
|
34379
34452
|
children,
|
|
34380
|
-
node && page && /* @__PURE__ */ (0,
|
|
34453
|
+
node && page && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ErrorBoundary, { title: "An error occurred while rendering this CoValue", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
34381
34454
|
Page,
|
|
34382
34455
|
{
|
|
34383
34456
|
coId: page.coId,
|
|
@@ -34387,15 +34460,15 @@ function PageStack({
|
|
|
34387
34460
|
onNavigate: addPages,
|
|
34388
34461
|
isTopLevel: index === path.length - 1
|
|
34389
34462
|
}
|
|
34390
|
-
)
|
|
34463
|
+
) })
|
|
34391
34464
|
] }) });
|
|
34392
34465
|
}
|
|
34393
34466
|
|
|
34394
34467
|
// src/inspector/viewer/use-page-path.ts
|
|
34395
|
-
var
|
|
34468
|
+
var import_react20 = __toESM(require_react(), 1);
|
|
34396
34469
|
var STORAGE_KEY = "jazz-inspector-paths";
|
|
34397
34470
|
function usePagePath(defaultPath) {
|
|
34398
|
-
const [path, setPath] = (0,
|
|
34471
|
+
const [path, setPath] = (0, import_react20.useState)(() => {
|
|
34399
34472
|
if (typeof window === "undefined") return [];
|
|
34400
34473
|
const stored = localStorage.getItem(STORAGE_KEY);
|
|
34401
34474
|
if (stored) {
|
|
@@ -34407,34 +34480,34 @@ function usePagePath(defaultPath) {
|
|
|
34407
34480
|
}
|
|
34408
34481
|
return defaultPath || [];
|
|
34409
34482
|
});
|
|
34410
|
-
const updatePath = (0,
|
|
34483
|
+
const updatePath = (0, import_react20.useCallback)((newPath) => {
|
|
34411
34484
|
setPath(newPath);
|
|
34412
34485
|
localStorage.setItem(STORAGE_KEY, JSON.stringify(newPath));
|
|
34413
34486
|
}, []);
|
|
34414
|
-
(0,
|
|
34487
|
+
(0, import_react20.useEffect)(() => {
|
|
34415
34488
|
if (defaultPath && JSON.stringify(path) !== JSON.stringify(defaultPath)) {
|
|
34416
34489
|
updatePath(defaultPath);
|
|
34417
34490
|
}
|
|
34418
34491
|
}, [defaultPath, path, updatePath]);
|
|
34419
|
-
const addPages = (0,
|
|
34492
|
+
const addPages = (0, import_react20.useCallback)(
|
|
34420
34493
|
(newPages) => {
|
|
34421
34494
|
updatePath([...path, ...newPages]);
|
|
34422
34495
|
},
|
|
34423
34496
|
[path, updatePath]
|
|
34424
34497
|
);
|
|
34425
|
-
const goToIndex = (0,
|
|
34498
|
+
const goToIndex = (0, import_react20.useCallback)(
|
|
34426
34499
|
(index) => {
|
|
34427
34500
|
updatePath(path.slice(0, index + 1));
|
|
34428
34501
|
},
|
|
34429
34502
|
[path, updatePath]
|
|
34430
34503
|
);
|
|
34431
|
-
const setPage = (0,
|
|
34504
|
+
const setPage = (0, import_react20.useCallback)(
|
|
34432
34505
|
(coId) => {
|
|
34433
34506
|
updatePath([{ coId, name: "Root" }]);
|
|
34434
34507
|
},
|
|
34435
34508
|
[updatePath]
|
|
34436
34509
|
);
|
|
34437
|
-
const goBack = (0,
|
|
34510
|
+
const goBack = (0, import_react20.useCallback)(() => {
|
|
34438
34511
|
if (path.length > 1) {
|
|
34439
34512
|
updatePath(path.slice(0, path.length - 1));
|
|
34440
34513
|
}
|
|
@@ -34449,8 +34522,8 @@ function usePagePath(defaultPath) {
|
|
|
34449
34522
|
}
|
|
34450
34523
|
|
|
34451
34524
|
// src/inspector/ui/global-styles.tsx
|
|
34452
|
-
import { styled as
|
|
34453
|
-
var GlobalStyles =
|
|
34525
|
+
import { styled as styled21 } from "goober";
|
|
34526
|
+
var GlobalStyles = styled21("div")`
|
|
34454
34527
|
/* Colors */
|
|
34455
34528
|
--j-primary-color: #146AFF;
|
|
34456
34529
|
--j-link-color: var(--j-primary-color);
|
|
@@ -34524,9 +34597,9 @@ var GlobalStyles = styled19("div")`
|
|
|
34524
34597
|
`;
|
|
34525
34598
|
|
|
34526
34599
|
// src/inspector/viewer/inspector-button.tsx
|
|
34527
|
-
var
|
|
34528
|
-
import { styled as
|
|
34529
|
-
var StyledInspectorButton =
|
|
34600
|
+
var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
|
|
34601
|
+
import { styled as styled22 } from "goober";
|
|
34602
|
+
var StyledInspectorButton = styled22("button")`
|
|
34530
34603
|
position: fixed;
|
|
34531
34604
|
width: 2.5rem;
|
|
34532
34605
|
height: 2.5rem;
|
|
@@ -34557,7 +34630,7 @@ var StyledInspectorButton = styled20("button")`
|
|
|
34557
34630
|
}
|
|
34558
34631
|
}}
|
|
34559
34632
|
`;
|
|
34560
|
-
var JazzIcon =
|
|
34633
|
+
var JazzIcon = styled22("svg")`
|
|
34561
34634
|
width: 100%;
|
|
34562
34635
|
height: auto;
|
|
34563
34636
|
position: relative;
|
|
@@ -34568,8 +34641,8 @@ function InspectorButton({
|
|
|
34568
34641
|
position = "right",
|
|
34569
34642
|
...buttonProps
|
|
34570
34643
|
}) {
|
|
34571
|
-
return /* @__PURE__ */ (0,
|
|
34572
|
-
/* @__PURE__ */ (0,
|
|
34644
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(StyledInspectorButton, { position, ...buttonProps, children: [
|
|
34645
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
34573
34646
|
JazzIcon,
|
|
34574
34647
|
{
|
|
34575
34648
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -34577,7 +34650,7 @@ function InspectorButton({
|
|
|
34577
34650
|
height: "115",
|
|
34578
34651
|
viewBox: "0 0 119 115",
|
|
34579
34652
|
fill: "none",
|
|
34580
|
-
children: /* @__PURE__ */ (0,
|
|
34653
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
34581
34654
|
"path",
|
|
34582
34655
|
{
|
|
34583
34656
|
fillRule: "evenodd",
|
|
@@ -34588,7 +34661,7 @@ function InspectorButton({
|
|
|
34588
34661
|
)
|
|
34589
34662
|
}
|
|
34590
34663
|
),
|
|
34591
|
-
/* @__PURE__ */ (0,
|
|
34664
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
34592
34665
|
"span",
|
|
34593
34666
|
{
|
|
34594
34667
|
style: {
|
|
@@ -34609,30 +34682,30 @@ function InspectorButton({
|
|
|
34609
34682
|
}
|
|
34610
34683
|
|
|
34611
34684
|
// src/inspector/viewer/use-open-inspector.ts
|
|
34612
|
-
var
|
|
34685
|
+
var import_react21 = __toESM(require_react(), 1);
|
|
34613
34686
|
var STORAGE_KEY2 = "jazz-inspector-open";
|
|
34614
34687
|
function useOpenInspector() {
|
|
34615
|
-
const [open, setOpen] = (0,
|
|
34688
|
+
const [open, setOpen] = (0, import_react21.useState)(() => {
|
|
34616
34689
|
if (typeof window === "undefined") return false;
|
|
34617
34690
|
const stored = localStorage.getItem(STORAGE_KEY2);
|
|
34618
34691
|
return stored ? JSON.parse(stored) : false;
|
|
34619
34692
|
});
|
|
34620
|
-
(0,
|
|
34693
|
+
(0, import_react21.useEffect)(() => {
|
|
34621
34694
|
localStorage.setItem(STORAGE_KEY2, JSON.stringify(open));
|
|
34622
34695
|
}, [open]);
|
|
34623
34696
|
return [open, setOpen];
|
|
34624
34697
|
}
|
|
34625
34698
|
|
|
34626
34699
|
// src/inspector/viewer/delete-local-data.tsx
|
|
34627
|
-
var
|
|
34628
|
-
var
|
|
34700
|
+
var import_react22 = __toESM(require_react(), 1);
|
|
34701
|
+
var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
|
|
34629
34702
|
var DELETE_LOCAL_DATA_STRING = "delete my local data";
|
|
34630
34703
|
function DeleteLocalData() {
|
|
34631
|
-
const [showDeleteModal, setShowDeleteModal] = (0,
|
|
34632
|
-
const [confirmDeleteString, setConfirmDeleteString] = (0,
|
|
34633
|
-
return /* @__PURE__ */ (0,
|
|
34634
|
-
/* @__PURE__ */ (0,
|
|
34635
|
-
/* @__PURE__ */ (0,
|
|
34704
|
+
const [showDeleteModal, setShowDeleteModal] = (0, import_react22.useState)(false);
|
|
34705
|
+
const [confirmDeleteString, setConfirmDeleteString] = (0, import_react22.useState)("");
|
|
34706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
34707
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Button, { variant: "destructive", onClick: () => setShowDeleteModal(true), children: "Delete my local data" }),
|
|
34708
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
34636
34709
|
Modal,
|
|
34637
34710
|
{
|
|
34638
34711
|
isOpen: showDeleteModal,
|
|
@@ -34640,7 +34713,7 @@ function DeleteLocalData() {
|
|
|
34640
34713
|
heading: "Delete Local Data",
|
|
34641
34714
|
showButtons: false,
|
|
34642
34715
|
children: [
|
|
34643
|
-
/* @__PURE__ */ (0,
|
|
34716
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
34644
34717
|
"div",
|
|
34645
34718
|
{
|
|
34646
34719
|
style: {
|
|
@@ -34651,33 +34724,33 @@ function DeleteLocalData() {
|
|
|
34651
34724
|
gap: "0.5rem"
|
|
34652
34725
|
},
|
|
34653
34726
|
children: [
|
|
34654
|
-
/* @__PURE__ */ (0,
|
|
34727
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("p", { children: [
|
|
34655
34728
|
"This action ",
|
|
34656
|
-
/* @__PURE__ */ (0,
|
|
34729
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("strong", { children: "cannot" }),
|
|
34657
34730
|
" be undone."
|
|
34658
34731
|
] }),
|
|
34659
|
-
/* @__PURE__ */ (0,
|
|
34732
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("p", { children: [
|
|
34660
34733
|
"Be aware that the following data will be",
|
|
34661
34734
|
" ",
|
|
34662
|
-
/* @__PURE__ */ (0,
|
|
34735
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("strong", { children: "permanently" }),
|
|
34663
34736
|
" deleted:"
|
|
34664
34737
|
] }),
|
|
34665
|
-
/* @__PURE__ */ (0,
|
|
34666
|
-
/* @__PURE__ */ (0,
|
|
34738
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("ul", { style: { listStyleType: "disc", paddingLeft: "1rem" }, children: [
|
|
34739
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("li", { children: [
|
|
34667
34740
|
"Unsynced data for ",
|
|
34668
|
-
/* @__PURE__ */ (0,
|
|
34741
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("strong", { children: "all apps" }),
|
|
34669
34742
|
" on",
|
|
34670
34743
|
" ",
|
|
34671
|
-
/* @__PURE__ */ (0,
|
|
34744
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("code", { children: window.location.origin })
|
|
34672
34745
|
] }),
|
|
34673
|
-
/* @__PURE__ */ (0,
|
|
34674
|
-
/* @__PURE__ */ (0,
|
|
34746
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("li", { children: "Accounts" }),
|
|
34747
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("li", { children: "Logged in sessions" })
|
|
34675
34748
|
] }),
|
|
34676
|
-
/* @__PURE__ */ (0,
|
|
34749
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", {})
|
|
34677
34750
|
]
|
|
34678
34751
|
}
|
|
34679
34752
|
),
|
|
34680
|
-
/* @__PURE__ */ (0,
|
|
34753
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
34681
34754
|
Input,
|
|
34682
34755
|
{
|
|
34683
34756
|
label: `Type "${DELETE_LOCAL_DATA_STRING}" to confirm`,
|
|
@@ -34688,7 +34761,7 @@ function DeleteLocalData() {
|
|
|
34688
34761
|
}
|
|
34689
34762
|
}
|
|
34690
34763
|
),
|
|
34691
|
-
/* @__PURE__ */ (0,
|
|
34764
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
34692
34765
|
"p",
|
|
34693
34766
|
{
|
|
34694
34767
|
style: {
|
|
@@ -34698,14 +34771,14 @@ function DeleteLocalData() {
|
|
|
34698
34771
|
flexDirection: "column",
|
|
34699
34772
|
gap: "0.5rem"
|
|
34700
34773
|
},
|
|
34701
|
-
children: /* @__PURE__ */ (0,
|
|
34774
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("small", { children: [
|
|
34702
34775
|
"Data synced to a sync server will ",
|
|
34703
|
-
/* @__PURE__ */ (0,
|
|
34776
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("strong", { children: "not" }),
|
|
34704
34777
|
" be deleted, and will be synced when you log in again."
|
|
34705
34778
|
] })
|
|
34706
34779
|
}
|
|
34707
34780
|
),
|
|
34708
|
-
/* @__PURE__ */ (0,
|
|
34781
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
34709
34782
|
"div",
|
|
34710
34783
|
{
|
|
34711
34784
|
style: {
|
|
@@ -34715,8 +34788,8 @@ function DeleteLocalData() {
|
|
|
34715
34788
|
gap: "0.5rem"
|
|
34716
34789
|
},
|
|
34717
34790
|
children: [
|
|
34718
|
-
/* @__PURE__ */ (0,
|
|
34719
|
-
/* @__PURE__ */ (0,
|
|
34791
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Button, { variant: "secondary", onClick: () => setShowDeleteModal(false), children: "Cancel" }),
|
|
34792
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
34720
34793
|
Button,
|
|
34721
34794
|
{
|
|
34722
34795
|
variant: "destructive",
|
|
@@ -34743,8 +34816,8 @@ function DeleteLocalData() {
|
|
|
34743
34816
|
}
|
|
34744
34817
|
|
|
34745
34818
|
// src/inspector/viewer/new-app.tsx
|
|
34746
|
-
var
|
|
34747
|
-
var InspectorContainer =
|
|
34819
|
+
var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
|
|
34820
|
+
var InspectorContainer = styled23("div")`
|
|
34748
34821
|
position: fixed;
|
|
34749
34822
|
height: 50vh;
|
|
34750
34823
|
max-height: 800px;
|
|
@@ -34761,17 +34834,17 @@ var InspectorContainer = styled21("div")`
|
|
|
34761
34834
|
background-color: var(--j-background);
|
|
34762
34835
|
}
|
|
34763
34836
|
`;
|
|
34764
|
-
var HeaderContainer2 =
|
|
34837
|
+
var HeaderContainer2 = styled23("div")`
|
|
34765
34838
|
display: flex;
|
|
34766
34839
|
align-items: center;
|
|
34767
34840
|
gap: 1rem;
|
|
34768
34841
|
padding: 0 0.75rem;
|
|
34769
34842
|
margin: 0.75rem 0;
|
|
34770
34843
|
`;
|
|
34771
|
-
var Form =
|
|
34844
|
+
var Form = styled23("form")`
|
|
34772
34845
|
width: 24rem;
|
|
34773
34846
|
`;
|
|
34774
|
-
var InitialForm =
|
|
34847
|
+
var InitialForm = styled23("form")`
|
|
34775
34848
|
display: flex;
|
|
34776
34849
|
flex-direction: column;
|
|
34777
34850
|
position: relative;
|
|
@@ -34783,7 +34856,7 @@ var InitialForm = styled21("form")`
|
|
|
34783
34856
|
max-width: 24rem;
|
|
34784
34857
|
margin: 0 auto;
|
|
34785
34858
|
`;
|
|
34786
|
-
var OrText =
|
|
34859
|
+
var OrText = styled23("p")`
|
|
34787
34860
|
text-align: center;
|
|
34788
34861
|
`;
|
|
34789
34862
|
function JazzInspectorInternal({
|
|
@@ -34792,7 +34865,7 @@ function JazzInspectorInternal({
|
|
|
34792
34865
|
accountId
|
|
34793
34866
|
}) {
|
|
34794
34867
|
const [open, setOpen] = useOpenInspector();
|
|
34795
|
-
const [coValueId, setCoValueId] = (0,
|
|
34868
|
+
const [coValueId, setCoValueId] = (0, import_react23.useState)("");
|
|
34796
34869
|
const { path, addPages, goToIndex, goBack, setPage } = usePagePath();
|
|
34797
34870
|
const handleCoValueIdSubmit = (e) => {
|
|
34798
34871
|
e.preventDefault();
|
|
@@ -34802,12 +34875,12 @@ function JazzInspectorInternal({
|
|
|
34802
34875
|
setCoValueId("");
|
|
34803
34876
|
};
|
|
34804
34877
|
if (!open) {
|
|
34805
|
-
return /* @__PURE__ */ (0,
|
|
34878
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(InspectorButton, { position, onClick: () => setOpen(true) });
|
|
34806
34879
|
}
|
|
34807
|
-
return /* @__PURE__ */ (0,
|
|
34808
|
-
/* @__PURE__ */ (0,
|
|
34809
|
-
/* @__PURE__ */ (0,
|
|
34810
|
-
path.length !== 0 && /* @__PURE__ */ (0,
|
|
34880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(InspectorContainer, { as: GlobalStyles, style: { zIndex: 999 }, children: [
|
|
34881
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(HeaderContainer2, { children: [
|
|
34882
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Breadcrumbs, { path, onBreadcrumbClick: goToIndex }),
|
|
34883
|
+
path.length !== 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Form, { onSubmit: handleCoValueIdSubmit, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
34811
34884
|
Input,
|
|
34812
34885
|
{
|
|
34813
34886
|
label: "CoValue ID",
|
|
@@ -34818,24 +34891,24 @@ function JazzInspectorInternal({
|
|
|
34818
34891
|
onChange: (e) => setCoValueId(e.target.value)
|
|
34819
34892
|
}
|
|
34820
34893
|
) }),
|
|
34821
|
-
/* @__PURE__ */ (0,
|
|
34822
|
-
/* @__PURE__ */ (0,
|
|
34894
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(DeleteLocalData, {}),
|
|
34895
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Button, { variant: "plain", type: "button", onClick: () => setOpen(false), children: "Close" })
|
|
34823
34896
|
] }),
|
|
34824
|
-
/* @__PURE__ */ (0,
|
|
34897
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
34825
34898
|
PageStack,
|
|
34826
34899
|
{
|
|
34827
34900
|
path,
|
|
34828
34901
|
node: localNode,
|
|
34829
34902
|
goBack,
|
|
34830
34903
|
addPages,
|
|
34831
|
-
children: path.length <= 0 && /* @__PURE__ */ (0,
|
|
34904
|
+
children: path.length <= 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
34832
34905
|
InitialForm,
|
|
34833
34906
|
{
|
|
34834
34907
|
onSubmit: handleCoValueIdSubmit,
|
|
34835
34908
|
"aria-hidden": path.length !== 0,
|
|
34836
34909
|
children: [
|
|
34837
|
-
/* @__PURE__ */ (0,
|
|
34838
|
-
/* @__PURE__ */ (0,
|
|
34910
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Heading, { children: "Jazz CoValue Inspector" }),
|
|
34911
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
34839
34912
|
Input,
|
|
34840
34913
|
{
|
|
34841
34914
|
label: "CoValue ID",
|
|
@@ -34846,10 +34919,10 @@ function JazzInspectorInternal({
|
|
|
34846
34919
|
onChange: (e) => setCoValueId(e.target.value)
|
|
34847
34920
|
}
|
|
34848
34921
|
),
|
|
34849
|
-
/* @__PURE__ */ (0,
|
|
34850
|
-
accountId && /* @__PURE__ */ (0,
|
|
34851
|
-
/* @__PURE__ */ (0,
|
|
34852
|
-
/* @__PURE__ */ (0,
|
|
34922
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Button, { type: "submit", variant: "primary", children: "Inspect CoValue" }),
|
|
34923
|
+
accountId && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
34924
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(OrText, { children: "or" }),
|
|
34925
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
34853
34926
|
Button,
|
|
34854
34927
|
{
|
|
34855
34928
|
variant: "secondary",
|
|
@@ -34870,8 +34943,8 @@ function JazzInspectorInternal({
|
|
|
34870
34943
|
}
|
|
34871
34944
|
|
|
34872
34945
|
// src/inspector/custom-element.tsx
|
|
34873
|
-
var
|
|
34874
|
-
setup(
|
|
34946
|
+
var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1);
|
|
34947
|
+
setup(import_react24.default.createElement);
|
|
34875
34948
|
var JazzInspectorElement = class extends HTMLElement {
|
|
34876
34949
|
constructor() {
|
|
34877
34950
|
super(...arguments);
|
|
@@ -34913,7 +34986,7 @@ var JazzInspectorElement = class extends HTMLElement {
|
|
|
34913
34986
|
return;
|
|
34914
34987
|
}
|
|
34915
34988
|
this.root?.render(
|
|
34916
|
-
/* @__PURE__ */ (0,
|
|
34989
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
34917
34990
|
JazzInspectorInternal,
|
|
34918
34991
|
{
|
|
34919
34992
|
localNode: this.account.$jazz.localNode,
|
|
@@ -35039,4 +35112,4 @@ react/cjs/react-jsx-runtime.development.js:
|
|
|
35039
35112
|
* LICENSE file in the root directory of this source tree.
|
|
35040
35113
|
*)
|
|
35041
35114
|
*/
|
|
35042
|
-
//# sourceMappingURL=custom-element-
|
|
35115
|
+
//# sourceMappingURL=custom-element-SUVJ7CPN.js.map
|