jazz-tools 0.19.10 → 0.19.12
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 +58 -54
- package/CHANGELOG.md +23 -0
- package/dist/{chunk-FFEEPZEG.js → chunk-AGF4HEDH.js} +61 -28
- package/dist/chunk-AGF4HEDH.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/inspector/account-switcher.d.ts +4 -0
- package/dist/inspector/account-switcher.d.ts.map +1 -0
- package/dist/inspector/chunk-YQNK5Y7B.js +4108 -0
- package/dist/inspector/chunk-YQNK5Y7B.js.map +1 -0
- package/dist/inspector/contexts/node.d.ts +19 -0
- package/dist/inspector/contexts/node.d.ts.map +1 -0
- package/dist/inspector/{custom-element-P76EIWEV.js → custom-element-KYV64IOC.js} +1057 -918
- package/dist/inspector/custom-element-KYV64IOC.js.map +1 -0
- package/dist/inspector/{viewer/new-app.d.ts → in-app.d.ts} +3 -3
- package/dist/inspector/in-app.d.ts.map +1 -0
- package/dist/inspector/index.d.ts +0 -11
- package/dist/inspector/index.d.ts.map +1 -1
- package/dist/inspector/index.js +56 -3910
- package/dist/inspector/index.js.map +1 -1
- package/dist/inspector/pages/home.d.ts +2 -0
- package/dist/inspector/pages/home.d.ts.map +1 -0
- package/dist/inspector/register-custom-element.js +1 -1
- package/dist/inspector/router/context.d.ts +12 -0
- package/dist/inspector/router/context.d.ts.map +1 -0
- package/dist/inspector/router/hash-router.d.ts +7 -0
- package/dist/inspector/router/hash-router.d.ts.map +1 -0
- package/dist/inspector/router/in-memory-router.d.ts +7 -0
- package/dist/inspector/router/in-memory-router.d.ts.map +1 -0
- package/dist/inspector/router/index.d.ts +5 -0
- package/dist/inspector/router/index.d.ts.map +1 -0
- package/dist/inspector/standalone.d.ts +6 -0
- package/dist/inspector/standalone.d.ts.map +1 -0
- package/dist/inspector/standalone.js +420 -0
- package/dist/inspector/standalone.js.map +1 -0
- package/dist/inspector/tests/router/hash-router.test.d.ts +2 -0
- package/dist/inspector/tests/router/hash-router.test.d.ts.map +1 -0
- package/dist/inspector/tests/router/in-memory-router.test.d.ts +2 -0
- package/dist/inspector/tests/router/in-memory-router.test.d.ts.map +1 -0
- package/dist/inspector/tests/utils/transactions-changes.test.d.ts +2 -0
- package/dist/inspector/tests/utils/transactions-changes.test.d.ts.map +1 -0
- package/dist/inspector/ui/modal.d.ts +1 -0
- package/dist/inspector/ui/modal.d.ts.map +1 -1
- package/dist/inspector/utils/transactions-changes.d.ts +13 -13
- package/dist/inspector/utils/transactions-changes.d.ts.map +1 -1
- package/dist/inspector/viewer/breadcrumbs.d.ts +1 -7
- package/dist/inspector/viewer/breadcrumbs.d.ts.map +1 -1
- package/dist/inspector/viewer/header.d.ts +7 -0
- package/dist/inspector/viewer/header.d.ts.map +1 -0
- package/dist/inspector/viewer/page-stack.d.ts +4 -13
- package/dist/inspector/viewer/page-stack.d.ts.map +1 -1
- package/dist/inspector/viewer/page.d.ts.map +1 -1
- package/dist/react/index.js +4 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react/provider.d.ts.map +1 -1
- package/dist/react-core/index.js +2 -2
- package/dist/react-core/index.js.map +1 -1
- package/dist/react-native/index.js +4 -1
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native-core/index.js +4 -1
- package/dist/react-native-core/index.js.map +1 -1
- package/dist/react-native-core/provider.d.ts.map +1 -1
- package/dist/testing.js +1 -1
- package/dist/tools/coValues/account.d.ts +7 -1
- package/dist/tools/coValues/account.d.ts.map +1 -1
- package/dist/tools/implementation/ContextManager.d.ts.map +1 -1
- package/dist/tools/implementation/zodSchema/schemaTypes/AccountSchema.d.ts +8 -1
- package/dist/tools/implementation/zodSchema/schemaTypes/AccountSchema.d.ts.map +1 -1
- package/dist/tools/implementation/zodSchema/zodCo.d.ts.map +1 -1
- package/dist/tools/subscribe/SubscriptionScope.d.ts +3 -6
- package/dist/tools/subscribe/SubscriptionScope.d.ts.map +1 -1
- package/dist/tools/testing.d.ts.map +1 -1
- package/package.json +9 -4
- package/src/inspector/account-switcher.tsx +440 -0
- package/src/inspector/contexts/node.tsx +129 -0
- package/src/inspector/custom-element.tsx +2 -2
- package/src/inspector/in-app.tsx +61 -0
- package/src/inspector/index.tsx +2 -22
- package/src/inspector/pages/home.tsx +77 -0
- package/src/inspector/router/context.ts +21 -0
- package/src/inspector/router/hash-router.tsx +128 -0
- package/src/inspector/{viewer/use-page-path.ts → router/in-memory-router.tsx} +31 -29
- package/src/inspector/router/index.ts +4 -0
- package/src/inspector/standalone.tsx +60 -0
- package/src/inspector/tests/router/hash-router.test.tsx +847 -0
- package/src/inspector/tests/router/in-memory-router.test.tsx +724 -0
- package/src/inspector/tests/utils/transactions-changes.test.ts +102 -0
- package/src/inspector/ui/icons/add-icon.tsx +3 -3
- package/src/inspector/ui/modal.tsx +5 -2
- package/src/inspector/utils/history.ts +6 -6
- package/src/inspector/utils/transactions-changes.ts +37 -3
- package/src/inspector/viewer/breadcrumbs.tsx +5 -11
- package/src/inspector/viewer/header.tsx +67 -0
- package/src/inspector/viewer/history-view.tsx +13 -13
- package/src/inspector/viewer/page-stack.tsx +18 -26
- package/src/inspector/viewer/page.tsx +0 -1
- package/src/react/provider.tsx +6 -1
- package/src/react-core/hooks.ts +2 -2
- package/src/react-core/tests/useSuspenseCoState.test.tsx +47 -0
- package/src/react-native-core/provider.tsx +6 -1
- package/src/tools/coValues/account.ts +13 -2
- package/src/tools/implementation/ContextManager.ts +10 -0
- package/src/tools/implementation/zodSchema/schemaTypes/AccountSchema.ts +8 -1
- package/src/tools/subscribe/SubscriptionScope.ts +61 -39
- package/src/tools/tests/account.test.ts +11 -4
- package/src/tools/tests/schema.resolved.test.ts +3 -3
- package/tsup.config.ts +1 -0
- package/dist/chunk-FFEEPZEG.js.map +0 -1
- package/dist/inspector/custom-element-P76EIWEV.js.map +0 -1
- package/dist/inspector/viewer/new-app.d.ts.map +0 -1
- package/dist/inspector/viewer/use-page-path.d.ts +0 -10
- package/dist/inspector/viewer/use-page-path.d.ts.map +0 -1
- package/src/inspector/viewer/new-app.tsx +0 -156
|
@@ -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 React10 = 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 = React10.__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 React10 = 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 = React10.__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 React10 = 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 = React10.__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 = React10.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 ? React10.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(), React10 = 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 = React10.__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 = React10.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 React10 = 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 = React10.__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
|
+
React10 = {
|
|
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 = React10["react-stack-bottom-frame"].bind(
|
|
31736
|
+
React10,
|
|
31737
31737
|
UnknownOwner
|
|
31738
31738
|
)();
|
|
31739
31739
|
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
@@ -31782,20 +31782,100 @@ var require_jsx_runtime = __commonJS({
|
|
|
31782
31782
|
});
|
|
31783
31783
|
|
|
31784
31784
|
// src/inspector/custom-element.tsx
|
|
31785
|
-
var
|
|
31785
|
+
var import_react32 = __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
|
-
// src/inspector/
|
|
31791
|
-
|
|
31792
|
-
import { styled as styled27 } from "goober";
|
|
31790
|
+
// src/inspector/in-app.tsx
|
|
31791
|
+
import { styled as styled29 } from "goober";
|
|
31793
31792
|
|
|
31794
|
-
// src/inspector/
|
|
31795
|
-
|
|
31793
|
+
// src/inspector/viewer/page-stack.tsx
|
|
31794
|
+
import { styled as styled24 } from "goober";
|
|
31795
|
+
|
|
31796
|
+
// src/inspector/viewer/page.tsx
|
|
31797
|
+
var import_react21 = __toESM(require_react(), 1);
|
|
31798
|
+
import { styled as styled21 } from "goober";
|
|
31799
|
+
|
|
31800
|
+
// src/inspector/ui/badge.tsx
|
|
31796
31801
|
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
|
31797
31802
|
import { styled } from "goober";
|
|
31798
|
-
var
|
|
31803
|
+
var StyledBadge = styled("span")`
|
|
31804
|
+
font-size: 0.875rem;
|
|
31805
|
+
font-weight: 500;
|
|
31806
|
+
padding: 0.125rem 0.25rem;
|
|
31807
|
+
margin-left: -0.125rem;
|
|
31808
|
+
border-radius: var(--j-radius-sm);
|
|
31809
|
+
background-color: var(--j-foreground);
|
|
31810
|
+
display: inline-block;
|
|
31811
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
31812
|
+
color: var(--j-text-color-strong);
|
|
31813
|
+
`;
|
|
31814
|
+
function Badge({
|
|
31815
|
+
children,
|
|
31816
|
+
className
|
|
31817
|
+
}) {
|
|
31818
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledBadge, { className, children });
|
|
31819
|
+
}
|
|
31820
|
+
|
|
31821
|
+
// src/inspector/ui/heading.tsx
|
|
31822
|
+
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
|
|
31823
|
+
import { styled as styled2 } from "goober";
|
|
31824
|
+
var StyledHeading = styled2("h1")`
|
|
31825
|
+
font-size: 1.125rem;
|
|
31826
|
+
text-align: center;
|
|
31827
|
+
font-weight: 500;
|
|
31828
|
+
color: var(--j-text-color-strong);
|
|
31829
|
+
`;
|
|
31830
|
+
function Heading({
|
|
31831
|
+
children,
|
|
31832
|
+
className,
|
|
31833
|
+
id
|
|
31834
|
+
}) {
|
|
31835
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(StyledHeading, { className, id, children });
|
|
31836
|
+
}
|
|
31837
|
+
|
|
31838
|
+
// src/inspector/ui/text.tsx
|
|
31839
|
+
var import_react = __toESM(require_react(), 1);
|
|
31840
|
+
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
|
|
31841
|
+
import { styled as styled3 } from "goober";
|
|
31842
|
+
var BaseText = import_react.default.forwardRef(
|
|
31843
|
+
({ muted, strong, small, inline, mono, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { ref, ...rest })
|
|
31844
|
+
);
|
|
31845
|
+
var StyledText = styled3(BaseText)`
|
|
31846
|
+
${(props) => props.muted && `
|
|
31847
|
+
color: var(--j-neutral-500);
|
|
31848
|
+
`}
|
|
31849
|
+
|
|
31850
|
+
${(props) => props.strong && `
|
|
31851
|
+
font-weight: 500;
|
|
31852
|
+
color: var(--j-text-color-strong);
|
|
31853
|
+
`}
|
|
31854
|
+
|
|
31855
|
+
${(props) => props.small && `
|
|
31856
|
+
font-size: 0.875rem;
|
|
31857
|
+
`}
|
|
31858
|
+
|
|
31859
|
+
${(props) => props.inline && `
|
|
31860
|
+
display: inline;
|
|
31861
|
+
`}
|
|
31862
|
+
|
|
31863
|
+
${(props) => props.mono && `
|
|
31864
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
31865
|
+
`}
|
|
31866
|
+
`;
|
|
31867
|
+
function Text(props) {
|
|
31868
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(StyledText, { ...props });
|
|
31869
|
+
}
|
|
31870
|
+
|
|
31871
|
+
// src/inspector/viewer/account-or-group-text.tsx
|
|
31872
|
+
var import_react5 = __toESM(require_react(), 1);
|
|
31873
|
+
|
|
31874
|
+
// src/inspector/ui/button.tsx
|
|
31875
|
+
var import_react2 = __toESM(require_react(), 1);
|
|
31876
|
+
var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
|
|
31877
|
+
import { styled as styled4 } from "goober";
|
|
31878
|
+
var StyledButton = styled4("button")`
|
|
31799
31879
|
display: inline-flex;
|
|
31800
31880
|
align-items: center;
|
|
31801
31881
|
justify-content: center;
|
|
@@ -31853,7 +31933,7 @@ var StyledButton = styled("button")`
|
|
|
31853
31933
|
}
|
|
31854
31934
|
}}
|
|
31855
31935
|
`;
|
|
31856
|
-
var Button = (0,
|
|
31936
|
+
var Button = (0, import_react2.forwardRef)(
|
|
31857
31937
|
({
|
|
31858
31938
|
className,
|
|
31859
31939
|
children,
|
|
@@ -31862,7 +31942,7 @@ var Button = (0, import_react.forwardRef)(
|
|
|
31862
31942
|
type = "button",
|
|
31863
31943
|
...buttonProps
|
|
31864
31944
|
}, ref) => {
|
|
31865
|
-
return /* @__PURE__ */ (0,
|
|
31945
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
31866
31946
|
StyledButton,
|
|
31867
31947
|
{
|
|
31868
31948
|
ref,
|
|
@@ -31877,181 +31957,14 @@ var Button = (0, import_react.forwardRef)(
|
|
|
31877
31957
|
}
|
|
31878
31958
|
);
|
|
31879
31959
|
|
|
31880
|
-
// src/inspector/ui/input.tsx
|
|
31881
|
-
var import_react2 = __toESM(require_react(), 1);
|
|
31882
|
-
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
|
|
31883
|
-
import { styled as styled2 } from "goober";
|
|
31884
|
-
var Container = styled2("div")`
|
|
31885
|
-
display: grid;
|
|
31886
|
-
gap: 0.25rem;
|
|
31887
|
-
`;
|
|
31888
|
-
var StyledInput = styled2("input")`
|
|
31889
|
-
width: 100%;
|
|
31890
|
-
border-radius: var(--j-radius-md);
|
|
31891
|
-
border: 1px solid var(--j-border-color);
|
|
31892
|
-
padding: 0.5rem 0.875rem;
|
|
31893
|
-
box-shadow: var(--j-shadow-sm);
|
|
31894
|
-
font-weight: 500;
|
|
31895
|
-
background-color: white;
|
|
31896
|
-
color: var(--j-text-color-strong);
|
|
31897
|
-
|
|
31898
|
-
@media (prefers-color-scheme: dark) {
|
|
31899
|
-
background-color: var(--j-foreground);
|
|
31900
|
-
}
|
|
31901
|
-
`;
|
|
31902
|
-
var Input = (0, import_react2.forwardRef)(
|
|
31903
|
-
({ label, className, hideLabel, id: customId, ...inputProps }, ref) => {
|
|
31904
|
-
const generatedId = (0, import_react2.useId)();
|
|
31905
|
-
const id = customId || generatedId;
|
|
31906
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Container, { className, children: [
|
|
31907
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
31908
|
-
"label",
|
|
31909
|
-
{
|
|
31910
|
-
htmlFor: id,
|
|
31911
|
-
className: hideLabel ? "j-sr-only" : "",
|
|
31912
|
-
style: { color: "var(--j-text-color)" },
|
|
31913
|
-
children: label
|
|
31914
|
-
}
|
|
31915
|
-
),
|
|
31916
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(StyledInput, { ref, ...inputProps, id })
|
|
31917
|
-
] });
|
|
31918
|
-
}
|
|
31919
|
-
);
|
|
31920
|
-
|
|
31921
|
-
// src/inspector/viewer/breadcrumbs.tsx
|
|
31922
|
-
var import_react3 = __toESM(require_react(), 1);
|
|
31923
|
-
import { styled as styled3 } from "goober";
|
|
31924
|
-
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
|
|
31925
|
-
var BreadcrumbsContainer = styled3("div")`
|
|
31926
|
-
position: relative;
|
|
31927
|
-
z-index: 20;
|
|
31928
|
-
flex: 1;
|
|
31929
|
-
display: flex;
|
|
31930
|
-
align-items: center;
|
|
31931
|
-
`;
|
|
31932
|
-
var Separator = styled3("span")`
|
|
31933
|
-
padding: 0 0.125rem;
|
|
31934
|
-
`;
|
|
31935
|
-
var Breadcrumbs = ({
|
|
31936
|
-
path,
|
|
31937
|
-
onBreadcrumbClick
|
|
31938
|
-
}) => {
|
|
31939
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(BreadcrumbsContainer, { children: [
|
|
31940
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
31941
|
-
Button,
|
|
31942
|
-
{
|
|
31943
|
-
variant: "link",
|
|
31944
|
-
style: { padding: "0 0.25rem" },
|
|
31945
|
-
onClick: () => onBreadcrumbClick(-1),
|
|
31946
|
-
children: "Home"
|
|
31947
|
-
}
|
|
31948
|
-
),
|
|
31949
|
-
path.map((page, index) => {
|
|
31950
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react3.default.Fragment, { children: [
|
|
31951
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Separator, { "aria-hidden": true, children: "/" }),
|
|
31952
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
31953
|
-
Button,
|
|
31954
|
-
{
|
|
31955
|
-
variant: "link",
|
|
31956
|
-
style: { padding: "0 0.25rem" },
|
|
31957
|
-
onClick: () => onBreadcrumbClick(index),
|
|
31958
|
-
children: index === 0 ? page.name || "Root" : page.name
|
|
31959
|
-
}
|
|
31960
|
-
)
|
|
31961
|
-
] }, page.coId);
|
|
31962
|
-
})
|
|
31963
|
-
] });
|
|
31964
|
-
};
|
|
31965
|
-
|
|
31966
|
-
// src/inspector/viewer/page-stack.tsx
|
|
31967
|
-
import { styled as styled24 } from "goober";
|
|
31968
|
-
|
|
31969
|
-
// src/inspector/viewer/page.tsx
|
|
31970
|
-
var import_react22 = __toESM(require_react(), 1);
|
|
31971
|
-
import { styled as styled22 } from "goober";
|
|
31972
|
-
|
|
31973
|
-
// src/inspector/ui/badge.tsx
|
|
31974
|
-
var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
|
|
31975
|
-
import { styled as styled4 } from "goober";
|
|
31976
|
-
var StyledBadge = styled4("span")`
|
|
31977
|
-
font-size: 0.875rem;
|
|
31978
|
-
font-weight: 500;
|
|
31979
|
-
padding: 0.125rem 0.25rem;
|
|
31980
|
-
margin-left: -0.125rem;
|
|
31981
|
-
border-radius: var(--j-radius-sm);
|
|
31982
|
-
background-color: var(--j-foreground);
|
|
31983
|
-
display: inline-block;
|
|
31984
|
-
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
31985
|
-
color: var(--j-text-color-strong);
|
|
31986
|
-
`;
|
|
31987
|
-
function Badge({
|
|
31988
|
-
children,
|
|
31989
|
-
className
|
|
31990
|
-
}) {
|
|
31991
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(StyledBadge, { className, children });
|
|
31992
|
-
}
|
|
31993
|
-
|
|
31994
|
-
// src/inspector/ui/heading.tsx
|
|
31995
|
-
var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
|
|
31996
|
-
import { styled as styled5 } from "goober";
|
|
31997
|
-
var StyledHeading = styled5("h1")`
|
|
31998
|
-
font-size: 1.125rem;
|
|
31999
|
-
text-align: center;
|
|
32000
|
-
font-weight: 500;
|
|
32001
|
-
color: var(--j-text-color-strong);
|
|
32002
|
-
`;
|
|
32003
|
-
function Heading({
|
|
32004
|
-
children,
|
|
32005
|
-
className,
|
|
32006
|
-
id
|
|
32007
|
-
}) {
|
|
32008
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(StyledHeading, { className, id, children });
|
|
32009
|
-
}
|
|
32010
|
-
|
|
32011
|
-
// src/inspector/ui/text.tsx
|
|
32012
|
-
var import_react4 = __toESM(require_react(), 1);
|
|
32013
|
-
var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
|
|
32014
|
-
import { styled as styled6 } from "goober";
|
|
32015
|
-
var BaseText = import_react4.default.forwardRef(
|
|
32016
|
-
({ muted, strong, small, inline, mono, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { ref, ...rest })
|
|
32017
|
-
);
|
|
32018
|
-
var StyledText = styled6(BaseText)`
|
|
32019
|
-
${(props) => props.muted && `
|
|
32020
|
-
color: var(--j-neutral-500);
|
|
32021
|
-
`}
|
|
32022
|
-
|
|
32023
|
-
${(props) => props.strong && `
|
|
32024
|
-
font-weight: 500;
|
|
32025
|
-
color: var(--j-text-color-strong);
|
|
32026
|
-
`}
|
|
32027
|
-
|
|
32028
|
-
${(props) => props.small && `
|
|
32029
|
-
font-size: 0.875rem;
|
|
32030
|
-
`}
|
|
32031
|
-
|
|
32032
|
-
${(props) => props.inline && `
|
|
32033
|
-
display: inline;
|
|
32034
|
-
`}
|
|
32035
|
-
|
|
32036
|
-
${(props) => props.mono && `
|
|
32037
|
-
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
32038
|
-
`}
|
|
32039
|
-
`;
|
|
32040
|
-
function Text(props) {
|
|
32041
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(StyledText, { ...props });
|
|
32042
|
-
}
|
|
32043
|
-
|
|
32044
|
-
// src/inspector/viewer/account-or-group-text.tsx
|
|
32045
|
-
var import_react7 = __toESM(require_react(), 1);
|
|
32046
|
-
|
|
32047
31960
|
// src/inspector/viewer/use-resolve-covalue.ts
|
|
32048
|
-
var
|
|
31961
|
+
var import_react4 = __toESM(require_react(), 1);
|
|
32049
31962
|
|
|
32050
31963
|
// src/inspector/viewer/co-stream-view.tsx
|
|
32051
|
-
var
|
|
31964
|
+
var import_react3 = __toESM(require_react(), 1);
|
|
32052
31965
|
import { base64URLtoBytes } from "cojson";
|
|
32053
|
-
import { styled as
|
|
32054
|
-
var
|
|
31966
|
+
import { styled as styled5 } from "goober";
|
|
31967
|
+
var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
|
|
32055
31968
|
function isBinaryStreamStart(item) {
|
|
32056
31969
|
return typeof item === "object" && item !== null && "type" in item && item.type === "start";
|
|
32057
31970
|
}
|
|
@@ -32146,23 +32059,23 @@ var BinaryDownloadButton = ({
|
|
|
32146
32059
|
document.body.removeChild(link);
|
|
32147
32060
|
URL.revokeObjectURL(url);
|
|
32148
32061
|
};
|
|
32149
|
-
return /* @__PURE__ */ (0,
|
|
32062
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Button, { variant: "secondary", onClick: downloadFile, children: [
|
|
32150
32063
|
"\u2B07\uFE0F ",
|
|
32151
32064
|
label
|
|
32152
32065
|
] });
|
|
32153
32066
|
};
|
|
32154
|
-
var LabelContentPairContainer =
|
|
32067
|
+
var LabelContentPairContainer = styled5("div")`
|
|
32155
32068
|
display: flex;
|
|
32156
32069
|
flex-direction: column;
|
|
32157
32070
|
gap: 0.375rem;
|
|
32158
32071
|
`;
|
|
32159
|
-
var BinaryStreamGrid =
|
|
32072
|
+
var BinaryStreamGrid = styled5("div")`
|
|
32160
32073
|
display: grid;
|
|
32161
32074
|
grid-template-columns: repeat(3, 1fr);
|
|
32162
32075
|
gap: 0.5rem;
|
|
32163
32076
|
max-width: 48rem;
|
|
32164
32077
|
`;
|
|
32165
|
-
var ImagePreviewContainer =
|
|
32078
|
+
var ImagePreviewContainer = styled5("div")`
|
|
32166
32079
|
background-color: rgb(249 250 251);
|
|
32167
32080
|
padding: 0.75rem;
|
|
32168
32081
|
border-radius: var(--j-radius-md);
|
|
@@ -32170,12 +32083,12 @@ var ImagePreviewContainer = styled7("div")`
|
|
|
32170
32083
|
background-color: rgb(28 25 23);
|
|
32171
32084
|
}
|
|
32172
32085
|
`;
|
|
32173
|
-
var CoStreamGrid =
|
|
32086
|
+
var CoStreamGrid = styled5("div")`
|
|
32174
32087
|
display: grid;
|
|
32175
32088
|
grid-template-columns: repeat(3, 1fr);
|
|
32176
32089
|
gap: 0.5rem;
|
|
32177
32090
|
`;
|
|
32178
|
-
var CoStreamItemContainer =
|
|
32091
|
+
var CoStreamItemContainer = styled5("div")`
|
|
32179
32092
|
padding: 0.75rem;
|
|
32180
32093
|
border-radius: var(--j-radius-lg);
|
|
32181
32094
|
overflow: hidden;
|
|
@@ -32190,18 +32103,18 @@ var LabelContentPair = ({
|
|
|
32190
32103
|
label,
|
|
32191
32104
|
content
|
|
32192
32105
|
}) => {
|
|
32193
|
-
return /* @__PURE__ */ (0,
|
|
32194
|
-
/* @__PURE__ */ (0,
|
|
32195
|
-
/* @__PURE__ */ (0,
|
|
32106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(LabelContentPairContainer, { children: [
|
|
32107
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: label }),
|
|
32108
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: content })
|
|
32196
32109
|
] });
|
|
32197
32110
|
};
|
|
32198
32111
|
function RenderCoBinaryStream({
|
|
32199
32112
|
value,
|
|
32200
32113
|
items
|
|
32201
32114
|
}) {
|
|
32202
|
-
const [file, setFile] = (0,
|
|
32203
|
-
const [isLoading, setIsLoading] = (0,
|
|
32204
|
-
(0,
|
|
32115
|
+
const [file, setFile] = (0, import_react3.useState)(null);
|
|
32116
|
+
const [isLoading, setIsLoading] = (0, import_react3.useState)(true);
|
|
32117
|
+
(0, import_react3.useEffect)(() => {
|
|
32205
32118
|
getBlobFromCoStream({
|
|
32206
32119
|
items,
|
|
32207
32120
|
onlyFirstChunk: true
|
|
@@ -32218,35 +32131,35 @@ function RenderCoBinaryStream({
|
|
|
32218
32131
|
}
|
|
32219
32132
|
}).finally(() => setIsLoading(false));
|
|
32220
32133
|
}, [items]);
|
|
32221
|
-
if (!isLoading && !file) return /* @__PURE__ */ (0,
|
|
32222
|
-
if (isLoading) return /* @__PURE__ */ (0,
|
|
32223
|
-
if (!file) return /* @__PURE__ */ (0,
|
|
32134
|
+
if (!isLoading && !file) return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { children: "No blob" });
|
|
32135
|
+
if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { children: "Loading..." });
|
|
32136
|
+
if (!file) return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { children: "No blob" });
|
|
32224
32137
|
const { blob, mimeType } = file;
|
|
32225
32138
|
const sizeInKB = (file.totalSize || 0) / 1024;
|
|
32226
|
-
return /* @__PURE__ */ (0,
|
|
32227
|
-
/* @__PURE__ */ (0,
|
|
32228
|
-
/* @__PURE__ */ (0,
|
|
32139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
32140
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(BinaryStreamGrid, { children: [
|
|
32141
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
32229
32142
|
LabelContentPair,
|
|
32230
32143
|
{
|
|
32231
32144
|
label: "Mime Type",
|
|
32232
|
-
content: /* @__PURE__ */ (0,
|
|
32145
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Badge, { children: mimeType || "No mime type" })
|
|
32233
32146
|
}
|
|
32234
32147
|
),
|
|
32235
|
-
/* @__PURE__ */ (0,
|
|
32148
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
32236
32149
|
LabelContentPair,
|
|
32237
32150
|
{
|
|
32238
32151
|
label: "Size",
|
|
32239
|
-
content: /* @__PURE__ */ (0,
|
|
32152
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { children: [
|
|
32240
32153
|
sizeInKB.toFixed(2),
|
|
32241
32154
|
" KB"
|
|
32242
32155
|
] })
|
|
32243
32156
|
}
|
|
32244
32157
|
),
|
|
32245
|
-
/* @__PURE__ */ (0,
|
|
32158
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
32246
32159
|
LabelContentPair,
|
|
32247
32160
|
{
|
|
32248
32161
|
label: "Download",
|
|
32249
|
-
content: /* @__PURE__ */ (0,
|
|
32162
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
32250
32163
|
BinaryDownloadButton,
|
|
32251
32164
|
{
|
|
32252
32165
|
fileName: value.id.toString(),
|
|
@@ -32258,11 +32171,11 @@ function RenderCoBinaryStream({
|
|
|
32258
32171
|
}
|
|
32259
32172
|
)
|
|
32260
32173
|
] }),
|
|
32261
|
-
mimeType === "image/png" || mimeType === "image/jpeg" ? /* @__PURE__ */ (0,
|
|
32174
|
+
mimeType === "image/png" || mimeType === "image/jpeg" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
32262
32175
|
LabelContentPair,
|
|
32263
32176
|
{
|
|
32264
32177
|
label: "Preview",
|
|
32265
|
-
content: /* @__PURE__ */ (0,
|
|
32178
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ImagePreviewContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RenderBlobImage, { blob }) })
|
|
32266
32179
|
}
|
|
32267
32180
|
) : null
|
|
32268
32181
|
] });
|
|
@@ -32273,10 +32186,10 @@ function RenderCoStream({
|
|
|
32273
32186
|
}) {
|
|
32274
32187
|
const streamPerUser = Object.keys(value.items);
|
|
32275
32188
|
const userCoIds = streamPerUser.map((stream) => stream.split("_session")[0]);
|
|
32276
|
-
return /* @__PURE__ */ (0,
|
|
32277
|
-
/* @__PURE__ */ (0,
|
|
32189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CoStreamGrid, { children: userCoIds.map((id, idx) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(CoStreamItemContainer, { children: [
|
|
32190
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AccountOrGroupText, { coId: id, node }),
|
|
32278
32191
|
value.items[streamPerUser[idx]]?.map(
|
|
32279
|
-
(item) => /* @__PURE__ */ (0,
|
|
32192
|
+
(item) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
|
|
32280
32193
|
new Date(item.madeAt).toLocaleString(),
|
|
32281
32194
|
" ",
|
|
32282
32195
|
JSON.stringify(item.value)
|
|
@@ -32291,9 +32204,9 @@ function CoStreamView({
|
|
|
32291
32204
|
const streamType = detectCoStreamType(value);
|
|
32292
32205
|
if (streamType.type === "binary") {
|
|
32293
32206
|
if (streamType.items === void 0) {
|
|
32294
|
-
return /* @__PURE__ */ (0,
|
|
32207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { children: "No binary stream" });
|
|
32295
32208
|
}
|
|
32296
|
-
return /* @__PURE__ */ (0,
|
|
32209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
32297
32210
|
RenderCoBinaryStream,
|
|
32298
32211
|
{
|
|
32299
32212
|
value,
|
|
@@ -32302,14 +32215,14 @@ function CoStreamView({
|
|
|
32302
32215
|
);
|
|
32303
32216
|
}
|
|
32304
32217
|
if (streamType.type === "coStream") {
|
|
32305
|
-
return /* @__PURE__ */ (0,
|
|
32218
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RenderCoStream, { value, node });
|
|
32306
32219
|
}
|
|
32307
|
-
if (streamType.type === "unknown") return /* @__PURE__ */ (0,
|
|
32308
|
-
return /* @__PURE__ */ (0,
|
|
32220
|
+
if (streamType.type === "unknown") return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { children: "Unknown stream type" });
|
|
32221
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { children: "Unknown stream type" });
|
|
32309
32222
|
}
|
|
32310
32223
|
function RenderBlobImage({ blob }) {
|
|
32311
32224
|
const urlCreator = window.URL || window.webkitURL;
|
|
32312
|
-
return /* @__PURE__ */ (0,
|
|
32225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("img", { src: urlCreator.createObjectURL(blob) });
|
|
32313
32226
|
}
|
|
32314
32227
|
|
|
32315
32228
|
// src/inspector/viewer/use-resolve-covalue.ts
|
|
@@ -32382,8 +32295,8 @@ function subscribeToCoValue(coValueId, node, callback) {
|
|
|
32382
32295
|
});
|
|
32383
32296
|
}
|
|
32384
32297
|
function useResolvedCoValue(coValueId, node) {
|
|
32385
|
-
const [result, setResult] = (0,
|
|
32386
|
-
(0,
|
|
32298
|
+
const [result, setResult] = (0, import_react4.useState)();
|
|
32299
|
+
(0, import_react4.useEffect)(() => {
|
|
32387
32300
|
let isMounted = true;
|
|
32388
32301
|
const unsubscribe = subscribeToCoValue(coValueId, node, (newResult) => {
|
|
32389
32302
|
if (isMounted) {
|
|
@@ -32403,8 +32316,8 @@ function useResolvedCoValue(coValueId, node) {
|
|
|
32403
32316
|
};
|
|
32404
32317
|
}
|
|
32405
32318
|
function useResolvedCoValues(coValueIds, node) {
|
|
32406
|
-
const [results, setResults] = (0,
|
|
32407
|
-
(0,
|
|
32319
|
+
const [results, setResults] = (0, import_react4.useState)([]);
|
|
32320
|
+
(0, import_react4.useEffect)(() => {
|
|
32408
32321
|
let isMounted = true;
|
|
32409
32322
|
const unsubscribes = [];
|
|
32410
32323
|
coValueIds.forEach((coValueId, index) => {
|
|
@@ -32428,7 +32341,7 @@ function useResolvedCoValues(coValueIds, node) {
|
|
|
32428
32341
|
}
|
|
32429
32342
|
|
|
32430
32343
|
// src/inspector/viewer/account-or-group-text.tsx
|
|
32431
|
-
var
|
|
32344
|
+
var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
|
|
32432
32345
|
function AccountOrGroupText({
|
|
32433
32346
|
coId,
|
|
32434
32347
|
node,
|
|
@@ -32436,8 +32349,8 @@ function AccountOrGroupText({
|
|
|
32436
32349
|
onClick
|
|
32437
32350
|
}) {
|
|
32438
32351
|
const { snapshot, extendedType } = useResolvedCoValue(coId, node);
|
|
32439
|
-
const [name, setName] = (0,
|
|
32440
|
-
(0,
|
|
32352
|
+
const [name, setName] = (0, import_react5.useState)(null);
|
|
32353
|
+
(0, import_react5.useEffect)(() => {
|
|
32441
32354
|
if (snapshot && typeof snapshot === "object" && "profile" in snapshot) {
|
|
32442
32355
|
const profileId = snapshot.profile;
|
|
32443
32356
|
resolveCoValue(profileId, node).then((profileResult) => {
|
|
@@ -32447,32 +32360,32 @@ function AccountOrGroupText({
|
|
|
32447
32360
|
});
|
|
32448
32361
|
}
|
|
32449
32362
|
}, [snapshot, node, extendedType]);
|
|
32450
|
-
if (!snapshot) return /* @__PURE__ */ (0,
|
|
32363
|
+
if (!snapshot) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "Loading..." });
|
|
32451
32364
|
if (extendedType !== "account" && extendedType !== "group") {
|
|
32452
|
-
return /* @__PURE__ */ (0,
|
|
32365
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "CoID is not an account or group" });
|
|
32453
32366
|
}
|
|
32454
32367
|
const displayName = extendedType === "account" ? name || "Account" : "Group";
|
|
32455
32368
|
const displayText = showId ? `${displayName} <${coId}>` : displayName;
|
|
32456
32369
|
if (onClick) {
|
|
32457
|
-
return /* @__PURE__ */ (0,
|
|
32370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Button, { variant: "link", onClick: () => onClick(displayName), children: displayText });
|
|
32458
32371
|
}
|
|
32459
|
-
return /* @__PURE__ */ (0,
|
|
32372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: displayText });
|
|
32460
32373
|
}
|
|
32461
32374
|
|
|
32462
32375
|
// src/inspector/viewer/grid-view.tsx
|
|
32463
|
-
var
|
|
32464
|
-
import { styled as
|
|
32376
|
+
var import_react9 = __toESM(require_react(), 1);
|
|
32377
|
+
import { styled as styled12 } from "goober";
|
|
32465
32378
|
|
|
32466
32379
|
// src/inspector/viewer/type-icon.tsx
|
|
32467
|
-
import { styled as
|
|
32468
|
-
var
|
|
32469
|
-
var IconText =
|
|
32380
|
+
import { styled as styled6 } from "goober";
|
|
32381
|
+
var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
|
|
32382
|
+
var IconText = styled6("span")`
|
|
32470
32383
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
32471
32384
|
`;
|
|
32472
|
-
var UnavailableText =
|
|
32385
|
+
var UnavailableText = styled6("div")`
|
|
32473
32386
|
font-weight: 500;
|
|
32474
32387
|
`;
|
|
32475
|
-
var EmptySpace =
|
|
32388
|
+
var EmptySpace = styled6("div")`
|
|
32476
32389
|
white-space: pre;
|
|
32477
32390
|
width: 3.5rem;
|
|
32478
32391
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
@@ -32494,7 +32407,7 @@ var TypeIcon = ({
|
|
|
32494
32407
|
};
|
|
32495
32408
|
const iconKey = extendedType || type;
|
|
32496
32409
|
const icon2 = iconMap[iconKey];
|
|
32497
|
-
return icon2 ? /* @__PURE__ */ (0,
|
|
32410
|
+
return icon2 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IconText, { children: icon2 }) : null;
|
|
32498
32411
|
};
|
|
32499
32412
|
var ResolveIcon = ({
|
|
32500
32413
|
coId,
|
|
@@ -32502,23 +32415,23 @@ var ResolveIcon = ({
|
|
|
32502
32415
|
}) => {
|
|
32503
32416
|
const { type, extendedType, snapshot } = useResolvedCoValue(coId, node);
|
|
32504
32417
|
if (snapshot === "unavailable" && !type) {
|
|
32505
|
-
return /* @__PURE__ */ (0,
|
|
32418
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(UnavailableText, { children: "Unavailable" });
|
|
32506
32419
|
}
|
|
32507
|
-
if (!type) return /* @__PURE__ */ (0,
|
|
32508
|
-
return /* @__PURE__ */ (0,
|
|
32420
|
+
if (!type) return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EmptySpace, { children: " " });
|
|
32421
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TypeIcon, { type, extendedType });
|
|
32509
32422
|
};
|
|
32510
32423
|
|
|
32511
32424
|
// src/inspector/viewer/types.ts
|
|
32512
32425
|
var isCoId = (coId) => typeof coId === "string" && coId.startsWith("co_") && !coId.includes("inviteSecret");
|
|
32513
32426
|
|
|
32514
32427
|
// src/inspector/viewer/value-renderer.tsx
|
|
32515
|
-
var
|
|
32516
|
-
import { styled as
|
|
32428
|
+
var import_react6 = __toESM(require_react(), 1);
|
|
32429
|
+
import { styled as styled7 } from "goober";
|
|
32517
32430
|
|
|
32518
32431
|
// src/inspector/ui/icons/caution.tsx
|
|
32519
|
-
var
|
|
32432
|
+
var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
|
|
32520
32433
|
function CautionIcon(props) {
|
|
32521
|
-
return /* @__PURE__ */ (0,
|
|
32434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
32522
32435
|
"svg",
|
|
32523
32436
|
{
|
|
32524
32437
|
...props,
|
|
@@ -32530,18 +32443,18 @@ function CautionIcon(props) {
|
|
|
32530
32443
|
stroke: "currentColor",
|
|
32531
32444
|
strokeLinejoin: "round",
|
|
32532
32445
|
children: [
|
|
32533
|
-
/* @__PURE__ */ (0,
|
|
32534
|
-
/* @__PURE__ */ (0,
|
|
32535
|
-
/* @__PURE__ */ (0,
|
|
32446
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("circle", { cx: "12", cy: "12", r: "12", fill: "currentColor" }),
|
|
32447
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("rect", { x: "10.5", y: "6", width: "3", height: "7.5", rx: "1.5", fill: "#fff" }),
|
|
32448
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("rect", { x: "10.5", y: "16.5", width: "3", height: "3", rx: "1.5", fill: "#fff" })
|
|
32536
32449
|
]
|
|
32537
32450
|
}
|
|
32538
32451
|
);
|
|
32539
32452
|
}
|
|
32540
32453
|
|
|
32541
32454
|
// src/inspector/ui/icons/chevron-down-icon.tsx
|
|
32542
|
-
var
|
|
32455
|
+
var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
|
|
32543
32456
|
function ChevronDownIcon(props) {
|
|
32544
|
-
return /* @__PURE__ */ (0,
|
|
32457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
32545
32458
|
"svg",
|
|
32546
32459
|
{
|
|
32547
32460
|
...props,
|
|
@@ -32552,15 +32465,15 @@ function ChevronDownIcon(props) {
|
|
|
32552
32465
|
fill: "none",
|
|
32553
32466
|
stroke: "currentColor",
|
|
32554
32467
|
strokeLinejoin: "round",
|
|
32555
|
-
children: /* @__PURE__ */ (0,
|
|
32468
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "m6 9 6 6 6-6" })
|
|
32556
32469
|
}
|
|
32557
32470
|
);
|
|
32558
32471
|
}
|
|
32559
32472
|
|
|
32560
32473
|
// src/inspector/ui/icons/delete-icon.tsx
|
|
32561
|
-
var
|
|
32474
|
+
var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
|
|
32562
32475
|
function DeleteIcon(props) {
|
|
32563
|
-
return /* @__PURE__ */ (0,
|
|
32476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
32564
32477
|
"svg",
|
|
32565
32478
|
{
|
|
32566
32479
|
...props,
|
|
@@ -32573,18 +32486,18 @@ function DeleteIcon(props) {
|
|
|
32573
32486
|
strokeLinejoin: "round",
|
|
32574
32487
|
className: "lucide lucide-trash-icon lucide-trash",
|
|
32575
32488
|
children: [
|
|
32576
|
-
/* @__PURE__ */ (0,
|
|
32577
|
-
/* @__PURE__ */ (0,
|
|
32578
|
-
/* @__PURE__ */ (0,
|
|
32489
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "M3 6h18" }),
|
|
32490
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" }),
|
|
32491
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" })
|
|
32579
32492
|
]
|
|
32580
32493
|
}
|
|
32581
32494
|
);
|
|
32582
32495
|
}
|
|
32583
32496
|
|
|
32584
32497
|
// src/inspector/ui/icons/edit-icon.tsx
|
|
32585
|
-
var
|
|
32498
|
+
var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
|
|
32586
32499
|
function EditIcon(props) {
|
|
32587
|
-
return /* @__PURE__ */ (0,
|
|
32500
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
32588
32501
|
"svg",
|
|
32589
32502
|
{
|
|
32590
32503
|
...props,
|
|
@@ -32596,15 +32509,15 @@ function EditIcon(props) {
|
|
|
32596
32509
|
stroke: "currentColor",
|
|
32597
32510
|
strokeLinejoin: "round",
|
|
32598
32511
|
className: "lucide lucide-edit lucide-pencil",
|
|
32599
|
-
children: /* @__PURE__ */ (0,
|
|
32512
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("path", { d: "M13.2942 7.95881C13.5533 7.63559 13.5013 7.16358 13.178 6.90453C12.8548 6.64549 12.3828 6.6975 12.1238 7.02072L13.2942 7.95881ZM6.811 14.8488L7.37903 15.3385C7.38489 15.3317 7.39062 15.3248 7.39623 15.3178L6.811 14.8488ZM6.64 15.2668L5.89146 15.2179L5.8908 15.2321L6.64 15.2668ZM6.5 18.2898L5.7508 18.2551C5.74908 18.2923 5.75013 18.3296 5.75396 18.3667L6.5 18.2898ZM7.287 18.9768L7.31152 19.7264C7.36154 19.7247 7.41126 19.7181 7.45996 19.7065L7.287 18.9768ZM10.287 18.2658L10.46 18.9956L10.4716 18.9927L10.287 18.2658ZM10.672 18.0218L11.2506 18.4991L11.2571 18.491L10.672 18.0218ZM17.2971 10.959C17.5562 10.6358 17.5043 10.1638 17.1812 9.90466C16.8581 9.64552 16.386 9.69742 16.1269 10.0206L17.2971 10.959ZM12.1269 7.02052C11.8678 7.34365 11.9196 7.81568 12.2428 8.07484C12.5659 8.33399 13.0379 8.28213 13.2971 7.95901L12.1269 7.02052ZM14.3 5.50976L14.8851 5.97901C14.8949 5.96672 14.9044 5.95412 14.9135 5.94123L14.3 5.50976ZM15.929 5.18976L16.4088 4.61332C16.3849 4.59344 16.3598 4.57507 16.3337 4.5583L15.929 5.18976ZM18.166 7.05176L18.6968 6.52192C18.6805 6.50561 18.6635 6.49007 18.6458 6.47532L18.166 7.05176ZM18.5029 7.87264L19.2529 7.87676V7.87676L18.5029 7.87264ZM18.157 8.68976L17.632 8.15412C17.6108 8.17496 17.5908 8.19704 17.5721 8.22025L18.157 8.68976ZM16.1271 10.0203C15.8678 10.3433 15.9195 10.8153 16.2425 11.0746C16.5655 11.3339 17.0376 11.2823 17.2969 10.9593L16.1271 10.0203ZM13.4537 7.37862C13.3923 6.96898 13.0105 6.68666 12.6009 6.74805C12.1912 6.80943 11.9089 7.19127 11.9703 7.60091L13.4537 7.37862ZM16.813 11.2329C17.2234 11.1772 17.5109 10.7992 17.4552 10.3888C17.3994 9.97834 17.0215 9.69082 16.611 9.74659L16.813 11.2329ZM12.1238 7.02072L6.22577 14.3797L7.39623 15.3178L13.2942 7.95881L12.1238 7.02072ZM6.24297 14.359C6.03561 14.5995 5.91226 14.9011 5.89159 15.218L7.38841 15.3156C7.38786 15.324 7.38457 15.3321 7.37903 15.3385L6.24297 14.359ZM5.8908 15.2321L5.7508 18.2551L7.2492 18.3245L7.3892 15.3015L5.8908 15.2321ZM5.75396 18.3667C5.83563 19.1586 6.51588 19.7524 7.31152 19.7264L7.26248 18.2272C7.25928 18.2273 7.25771 18.2268 7.25669 18.2264C7.25526 18.2259 7.25337 18.2249 7.25144 18.2232C7.2495 18.2215 7.24825 18.2198 7.24754 18.2185C7.24703 18.2175 7.24637 18.216 7.24604 18.2128L5.75396 18.3667ZM7.45996 19.7065L10.46 18.9955L10.114 17.536L7.11404 18.247L7.45996 19.7065ZM10.4716 18.9927C10.7771 18.9151 11.05 18.7422 11.2506 18.499L10.0934 17.5445C10.0958 17.5417 10.0989 17.5397 10.1024 17.5388L10.4716 18.9927ZM11.2571 18.491L17.2971 10.959L16.1269 10.0206L10.0869 17.5526L11.2571 18.491ZM13.2971 7.95901L14.8851 5.97901L13.7149 5.04052L12.1269 7.02052L13.2971 7.95901ZM14.9135 5.94123C15.0521 5.74411 15.3214 5.6912 15.5243 5.82123L16.3337 4.5583C15.4544 3.99484 14.2873 4.2241 13.6865 5.0783L14.9135 5.94123ZM15.4492 5.7662L17.6862 7.6282L18.6458 6.47532L16.4088 4.61332L15.4492 5.7662ZM17.6352 7.58161C17.7111 7.6577 17.7535 7.761 17.7529 7.86852L19.2529 7.87676C19.2557 7.36905 19.0555 6.88127 18.6968 6.52192L17.6352 7.58161ZM17.7529 7.86852C17.7524 7.97604 17.7088 8.07886 17.632 8.15412L18.682 9.22541C19.0446 8.87002 19.2501 8.38447 19.2529 7.87676L17.7529 7.86852ZM17.5721 8.22025L16.1271 10.0203L17.2969 10.9593L18.7419 9.15928L17.5721 8.22025ZM11.9703 7.60091C12.3196 9.93221 14.4771 11.5503 16.813 11.2329L16.611 9.74659C15.0881 9.95352 13.6815 8.89855 13.4537 7.37862L11.9703 7.60091Z" })
|
|
32600
32513
|
}
|
|
32601
32514
|
);
|
|
32602
32515
|
}
|
|
32603
32516
|
|
|
32604
32517
|
// src/inspector/ui/icons/link-icon.tsx
|
|
32605
|
-
var
|
|
32518
|
+
var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
|
|
32606
32519
|
function LinkIcon(props) {
|
|
32607
|
-
return /* @__PURE__ */ (0,
|
|
32520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
32608
32521
|
"svg",
|
|
32609
32522
|
{
|
|
32610
32523
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -32613,7 +32526,7 @@ function LinkIcon(props) {
|
|
|
32613
32526
|
strokeWidth: 1.5,
|
|
32614
32527
|
stroke: "currentColor",
|
|
32615
32528
|
...props,
|
|
32616
|
-
children: /* @__PURE__ */ (0,
|
|
32529
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
32617
32530
|
"path",
|
|
32618
32531
|
{
|
|
32619
32532
|
strokeLinecap: "round",
|
|
@@ -32626,9 +32539,9 @@ function LinkIcon(props) {
|
|
|
32626
32539
|
}
|
|
32627
32540
|
|
|
32628
32541
|
// src/inspector/ui/icons/history.tsx
|
|
32629
|
-
var
|
|
32542
|
+
var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
|
|
32630
32543
|
function HistoryIcon(props) {
|
|
32631
|
-
return /* @__PURE__ */ (0,
|
|
32544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
32632
32545
|
"svg",
|
|
32633
32546
|
{
|
|
32634
32547
|
...props,
|
|
@@ -32641,7 +32554,7 @@ function HistoryIcon(props) {
|
|
|
32641
32554
|
strokeLinejoin: "round",
|
|
32642
32555
|
className: "lucide lucide-trash-icon lucide-trash",
|
|
32643
32556
|
children: [
|
|
32644
|
-
/* @__PURE__ */ (0,
|
|
32557
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
32645
32558
|
"path",
|
|
32646
32559
|
{
|
|
32647
32560
|
d: "M5.52786 16.7023C6.6602 18.2608 8.3169 19.3584 10.1936 19.7934C12.0703 20.2284 14.0409 19.9716 15.7434 19.0701C17.446 18.1687 18.766 16.6832 19.4611 14.8865C20.1562 13.0898 20.1796 11.1027 19.527 9.29011C18.8745 7.47756 17.5898 5.96135 15.909 5.02005C14.2282 4.07875 12.2641 3.77558 10.3777 4.16623C8.49129 4.55689 6.80919 5.61514 5.64045 7.14656C4.47171 8.67797 3.89482 10.5797 4.01579 12.5023M4.01579 12.5023L2.51579 11.0023M4.01579 12.5023L5.51579 11.0023",
|
|
@@ -32650,7 +32563,7 @@ function HistoryIcon(props) {
|
|
|
32650
32563
|
strokeLinejoin: "round"
|
|
32651
32564
|
}
|
|
32652
32565
|
),
|
|
32653
|
-
/* @__PURE__ */ (0,
|
|
32566
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
32654
32567
|
"path",
|
|
32655
32568
|
{
|
|
32656
32569
|
d: "M12 8V12L15 15",
|
|
@@ -32665,9 +32578,9 @@ function HistoryIcon(props) {
|
|
|
32665
32578
|
}
|
|
32666
32579
|
|
|
32667
32580
|
// src/inspector/ui/icons/add-icon.tsx
|
|
32668
|
-
var
|
|
32581
|
+
var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
|
|
32669
32582
|
function AddIcon(props) {
|
|
32670
|
-
return /* @__PURE__ */ (0,
|
|
32583
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
32671
32584
|
"svg",
|
|
32672
32585
|
{
|
|
32673
32586
|
...props,
|
|
@@ -32678,13 +32591,13 @@ function AddIcon(props) {
|
|
|
32678
32591
|
fill: "none",
|
|
32679
32592
|
stroke: "currentColor",
|
|
32680
32593
|
strokeLinejoin: "round",
|
|
32681
|
-
children: /* @__PURE__ */ (0,
|
|
32594
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
32682
32595
|
"path",
|
|
32683
32596
|
{
|
|
32684
32597
|
d: "M4 12H20M12 4V20",
|
|
32685
|
-
|
|
32686
|
-
|
|
32687
|
-
|
|
32598
|
+
strokeWidth: "2",
|
|
32599
|
+
strokeLinecap: "round",
|
|
32600
|
+
strokeLinejoin: "round"
|
|
32688
32601
|
}
|
|
32689
32602
|
)
|
|
32690
32603
|
}
|
|
@@ -32692,7 +32605,7 @@ function AddIcon(props) {
|
|
|
32692
32605
|
}
|
|
32693
32606
|
|
|
32694
32607
|
// src/inspector/ui/icon.tsx
|
|
32695
|
-
var
|
|
32608
|
+
var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
|
|
32696
32609
|
var icons = {
|
|
32697
32610
|
caution: CautionIcon,
|
|
32698
32611
|
chevronDown: ChevronDownIcon,
|
|
@@ -32744,7 +32657,7 @@ function Icon({
|
|
|
32744
32657
|
throw new Error(`Icon not found: ${name}`);
|
|
32745
32658
|
}
|
|
32746
32659
|
const IconComponent = icons?.hasOwnProperty(name) ? icons[name] : icon;
|
|
32747
|
-
return /* @__PURE__ */ (0,
|
|
32660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
32748
32661
|
IconComponent,
|
|
32749
32662
|
{
|
|
32750
32663
|
"aria-hidden": "true",
|
|
@@ -32757,13 +32670,13 @@ function Icon({
|
|
|
32757
32670
|
}
|
|
32758
32671
|
|
|
32759
32672
|
// src/inspector/viewer/value-renderer.tsx
|
|
32760
|
-
var
|
|
32761
|
-
var LinkContainer =
|
|
32673
|
+
var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
|
|
32674
|
+
var LinkContainer = styled7("span")`
|
|
32762
32675
|
display: inline-flex;
|
|
32763
32676
|
gap: 0.25rem;
|
|
32764
32677
|
align-items: center;
|
|
32765
32678
|
`;
|
|
32766
|
-
var BooleanText =
|
|
32679
|
+
var BooleanText = styled7("span")`
|
|
32767
32680
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
32768
32681
|
${(props) => props.value ? `
|
|
32769
32682
|
color: var(--j-success-color);
|
|
@@ -32771,45 +32684,45 @@ var BooleanText = styled9("span")`
|
|
|
32771
32684
|
color: var(--j-destructive-color);
|
|
32772
32685
|
`}
|
|
32773
32686
|
`;
|
|
32774
|
-
var ObjectContent =
|
|
32687
|
+
var ObjectContent = styled7("pre")`
|
|
32775
32688
|
margin-top: 0.375rem;
|
|
32776
32689
|
font-size: 0.875rem;
|
|
32777
32690
|
white-space: pre-wrap;
|
|
32778
32691
|
`;
|
|
32779
|
-
var PreviewContainer =
|
|
32692
|
+
var PreviewContainer = styled7("div")`
|
|
32780
32693
|
font-size: 0.875rem;
|
|
32781
32694
|
display: flex;
|
|
32782
32695
|
flex-direction: column;
|
|
32783
32696
|
gap: 0.5rem;
|
|
32784
32697
|
align-items: flex-start;
|
|
32785
32698
|
`;
|
|
32786
|
-
var PreviewGrid =
|
|
32699
|
+
var PreviewGrid = styled7("div")`
|
|
32787
32700
|
display: grid;
|
|
32788
32701
|
grid-template-columns: auto 1fr;
|
|
32789
32702
|
gap: 0.5rem;
|
|
32790
32703
|
`;
|
|
32791
|
-
var PreviewMoreText =
|
|
32704
|
+
var PreviewMoreText = styled7(Text)`
|
|
32792
32705
|
text-align: left;
|
|
32793
32706
|
margin-top: 0.5rem;
|
|
32794
32707
|
`;
|
|
32795
|
-
var ImagePreviewContainer2 =
|
|
32708
|
+
var ImagePreviewContainer2 = styled7("div")`
|
|
32796
32709
|
display: flex;
|
|
32797
32710
|
flex-direction: column;
|
|
32798
32711
|
align-items: flex-start;
|
|
32799
32712
|
`;
|
|
32800
|
-
var PreviewImage =
|
|
32713
|
+
var PreviewImage = styled7("img")`
|
|
32801
32714
|
width: 2rem;
|
|
32802
32715
|
height: 2rem;
|
|
32803
32716
|
border: 2px solid white;
|
|
32804
32717
|
box-shadow: var(--j-shadow-sm);
|
|
32805
32718
|
margin: 0.5rem 0;
|
|
32806
32719
|
`;
|
|
32807
|
-
var RecordText =
|
|
32720
|
+
var RecordText = styled7("div")`
|
|
32808
32721
|
display: flex;
|
|
32809
32722
|
align-items: center;
|
|
32810
32723
|
gap: 0.25rem;
|
|
32811
32724
|
`;
|
|
32812
|
-
var ListText =
|
|
32725
|
+
var ListText = styled7("div")`
|
|
32813
32726
|
display: flex;
|
|
32814
32727
|
align-items: center;
|
|
32815
32728
|
gap: 0.25rem;
|
|
@@ -32819,20 +32732,20 @@ function ValueRenderer({
|
|
|
32819
32732
|
onCoIDClick,
|
|
32820
32733
|
compact
|
|
32821
32734
|
}) {
|
|
32822
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
32735
|
+
const [isExpanded, setIsExpanded] = (0, import_react6.useState)(false);
|
|
32823
32736
|
if (typeof json === "undefined" || json === void 0) {
|
|
32824
|
-
return /* @__PURE__ */ (0,
|
|
32737
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { muted: true, children: "undefined" });
|
|
32825
32738
|
}
|
|
32826
32739
|
if (json === null) {
|
|
32827
|
-
return /* @__PURE__ */ (0,
|
|
32740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { muted: true, children: "null" });
|
|
32828
32741
|
}
|
|
32829
32742
|
if (typeof json === "string" && isCoId(json)) {
|
|
32830
|
-
const content = /* @__PURE__ */ (0,
|
|
32743
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
32831
32744
|
json,
|
|
32832
|
-
onCoIDClick && /* @__PURE__ */ (0,
|
|
32745
|
+
onCoIDClick && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { name: "link" })
|
|
32833
32746
|
] });
|
|
32834
32747
|
if (onCoIDClick) {
|
|
32835
|
-
return /* @__PURE__ */ (0,
|
|
32748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
32836
32749
|
Button,
|
|
32837
32750
|
{
|
|
32838
32751
|
variant: "link",
|
|
@@ -32843,35 +32756,35 @@ function ValueRenderer({
|
|
|
32843
32756
|
}
|
|
32844
32757
|
);
|
|
32845
32758
|
}
|
|
32846
|
-
return /* @__PURE__ */ (0,
|
|
32759
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LinkContainer, { children: content });
|
|
32847
32760
|
}
|
|
32848
32761
|
if (typeof json === "string") {
|
|
32849
|
-
return /* @__PURE__ */ (0,
|
|
32762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { children: json });
|
|
32850
32763
|
}
|
|
32851
32764
|
if (typeof json === "number") {
|
|
32852
|
-
return /* @__PURE__ */ (0,
|
|
32765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { mono: true, children: json });
|
|
32853
32766
|
}
|
|
32854
32767
|
if (typeof json === "boolean") {
|
|
32855
|
-
return /* @__PURE__ */ (0,
|
|
32768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(BooleanText, { value: json, children: json.toString() });
|
|
32856
32769
|
}
|
|
32857
32770
|
const longJson = JSON.stringify(json, null, 2);
|
|
32858
32771
|
const shortJson = longJson.split("\n").slice(0, compact ? 3 : 8).join("\n");
|
|
32859
32772
|
const hasDifference = longJson !== shortJson;
|
|
32860
32773
|
if (typeof json === "object") {
|
|
32861
|
-
return /* @__PURE__ */ (0,
|
|
32862
|
-
/* @__PURE__ */ (0,
|
|
32774
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
32775
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { children: Array.isArray(json) ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
32863
32776
|
"Array (",
|
|
32864
32777
|
json.length,
|
|
32865
32778
|
")"
|
|
32866
|
-
] }) : /* @__PURE__ */ (0,
|
|
32867
|
-
/* @__PURE__ */ (0,
|
|
32779
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_jsx_runtime16.Fragment, { children: "Object" }) }),
|
|
32780
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(ObjectContent, { children: [
|
|
32868
32781
|
isExpanded ? longJson : shortJson,
|
|
32869
32782
|
hasDifference && !isExpanded ? "\n ..." : null
|
|
32870
32783
|
] }),
|
|
32871
|
-
!compact && hasDifference ? /* @__PURE__ */ (0,
|
|
32784
|
+
!compact && hasDifference ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Button, { variant: "link", onClick: () => setIsExpanded(!isExpanded), children: isExpanded ? "Show less" : "Show more" }) : null
|
|
32872
32785
|
] });
|
|
32873
32786
|
}
|
|
32874
|
-
return /* @__PURE__ */ (0,
|
|
32787
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: String(json) });
|
|
32875
32788
|
}
|
|
32876
32789
|
var CoMapPreview = ({
|
|
32877
32790
|
coId,
|
|
@@ -32883,7 +32796,7 @@ var CoMapPreview = ({
|
|
|
32883
32796
|
node
|
|
32884
32797
|
);
|
|
32885
32798
|
if (!snapshot) {
|
|
32886
|
-
return /* @__PURE__ */ (0,
|
|
32799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
32887
32800
|
"div",
|
|
32888
32801
|
{
|
|
32889
32802
|
style: {
|
|
@@ -32898,15 +32811,15 @@ var CoMapPreview = ({
|
|
|
32898
32811
|
);
|
|
32899
32812
|
}
|
|
32900
32813
|
if (snapshot === "unavailable" && !value) {
|
|
32901
|
-
return /* @__PURE__ */ (0,
|
|
32814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { inline: true, muted: true, children: "Unavailable" });
|
|
32902
32815
|
}
|
|
32903
32816
|
if (type === "coplaintext") {
|
|
32904
|
-
return /* @__PURE__ */ (0,
|
|
32817
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_jsx_runtime16.Fragment, { children: value.toString() });
|
|
32905
32818
|
}
|
|
32906
32819
|
if (extendedType === "image" && isBrowserImage(snapshot)) {
|
|
32907
|
-
return /* @__PURE__ */ (0,
|
|
32908
|
-
/* @__PURE__ */ (0,
|
|
32909
|
-
/* @__PURE__ */ (0,
|
|
32820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(ImagePreviewContainer2, { children: [
|
|
32821
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(PreviewImage, { src: snapshot.placeholderDataURL }),
|
|
32822
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Text, { inline: true, small: true, muted: true, children: [
|
|
32910
32823
|
snapshot.originalSize[0],
|
|
32911
32824
|
" x ",
|
|
32912
32825
|
snapshot.originalSize[1]
|
|
@@ -32914,10 +32827,10 @@ var CoMapPreview = ({
|
|
|
32914
32827
|
] });
|
|
32915
32828
|
}
|
|
32916
32829
|
if (extendedType === "record") {
|
|
32917
|
-
return /* @__PURE__ */ (0,
|
|
32830
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(RecordText, { children: [
|
|
32918
32831
|
"Record",
|
|
32919
32832
|
" ",
|
|
32920
|
-
/* @__PURE__ */ (0,
|
|
32833
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Text, { inline: true, muted: true, children: [
|
|
32921
32834
|
"(",
|
|
32922
32835
|
Object.keys(snapshot).length,
|
|
32923
32836
|
")"
|
|
@@ -32925,10 +32838,10 @@ var CoMapPreview = ({
|
|
|
32925
32838
|
] });
|
|
32926
32839
|
}
|
|
32927
32840
|
if (type === "colist") {
|
|
32928
|
-
return /* @__PURE__ */ (0,
|
|
32841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(ListText, { children: [
|
|
32929
32842
|
"List",
|
|
32930
32843
|
" ",
|
|
32931
|
-
/* @__PURE__ */ (0,
|
|
32844
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Text, { inline: true, muted: true, children: [
|
|
32932
32845
|
"(",
|
|
32933
32846
|
snapshot.length,
|
|
32934
32847
|
")"
|
|
@@ -32939,15 +32852,15 @@ var CoMapPreview = ({
|
|
|
32939
32852
|
const limitedProperties = extendedType === "account" ? properties.filter(
|
|
32940
32853
|
([key]) => !key.startsWith("key_z") && !key.startsWith("sealer_z") && key !== "readKey"
|
|
32941
32854
|
).slice(0, limit) : properties.slice(0, limit);
|
|
32942
|
-
return /* @__PURE__ */ (0,
|
|
32943
|
-
/* @__PURE__ */ (0,
|
|
32944
|
-
/* @__PURE__ */ (0,
|
|
32855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(PreviewContainer, { children: [
|
|
32856
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(PreviewGrid, { children: limitedProperties.map(([key, value2]) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react6.default.Fragment, { children: [
|
|
32857
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Text, { strong: true, children: [
|
|
32945
32858
|
key,
|
|
32946
32859
|
": "
|
|
32947
32860
|
] }),
|
|
32948
|
-
/* @__PURE__ */ (0,
|
|
32861
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ValueRenderer, { compact: true, json: value2 })
|
|
32949
32862
|
] }, key)) }),
|
|
32950
|
-
properties.length > limit && /* @__PURE__ */ (0,
|
|
32863
|
+
properties.length > limit && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(PreviewMoreText, { muted: true, small: true, children: [
|
|
32951
32864
|
properties.length - limit,
|
|
32952
32865
|
" more"
|
|
32953
32866
|
] })
|
|
@@ -32955,23 +32868,23 @@ var CoMapPreview = ({
|
|
|
32955
32868
|
};
|
|
32956
32869
|
|
|
32957
32870
|
// src/inspector/viewer/co-value-editor.tsx
|
|
32958
|
-
var
|
|
32959
|
-
import { styled as
|
|
32871
|
+
var import_react8 = __toESM(require_react(), 1);
|
|
32872
|
+
import { styled as styled9 } from "goober";
|
|
32960
32873
|
|
|
32961
32874
|
// src/inspector/ui/select.tsx
|
|
32962
|
-
var
|
|
32963
|
-
import { styled as
|
|
32964
|
-
var
|
|
32965
|
-
var SelectContainer =
|
|
32875
|
+
var import_react7 = __toESM(require_react(), 1);
|
|
32876
|
+
import { styled as styled8 } from "goober";
|
|
32877
|
+
var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
|
|
32878
|
+
var SelectContainer = styled8("div")`
|
|
32966
32879
|
display: grid;
|
|
32967
32880
|
gap: 0.25rem;
|
|
32968
32881
|
`;
|
|
32969
|
-
var SelectWrapper =
|
|
32882
|
+
var SelectWrapper = styled8("div")`
|
|
32970
32883
|
position: relative;
|
|
32971
32884
|
display: flex;
|
|
32972
32885
|
align-items: center;
|
|
32973
32886
|
`;
|
|
32974
|
-
var StyledSelect =
|
|
32887
|
+
var StyledSelect = styled8("select")`
|
|
32975
32888
|
width: 100%;
|
|
32976
32889
|
border-radius: var(--j-radius-md);
|
|
32977
32890
|
border: 1px solid var(--j-border-color);
|
|
@@ -32989,7 +32902,7 @@ var StyledSelect = styled10("select")`
|
|
|
32989
32902
|
background-color: var(--j-foreground);
|
|
32990
32903
|
}
|
|
32991
32904
|
`;
|
|
32992
|
-
var SelectIcon =
|
|
32905
|
+
var SelectIcon = styled8("span")`
|
|
32993
32906
|
position: absolute;
|
|
32994
32907
|
right: 0.5em;
|
|
32995
32908
|
color: var(--j-neutral-400);
|
|
@@ -33001,19 +32914,19 @@ var SelectIcon = styled10("span")`
|
|
|
33001
32914
|
`;
|
|
33002
32915
|
function Select(props) {
|
|
33003
32916
|
const { label, hideLabel, id: customId, className, ...selectProps } = props;
|
|
33004
|
-
const generatedId = (0,
|
|
32917
|
+
const generatedId = (0, import_react7.useId)();
|
|
33005
32918
|
const id = customId || generatedId;
|
|
33006
|
-
return /* @__PURE__ */ (0,
|
|
33007
|
-
/* @__PURE__ */ (0,
|
|
33008
|
-
/* @__PURE__ */ (0,
|
|
33009
|
-
/* @__PURE__ */ (0,
|
|
33010
|
-
/* @__PURE__ */ (0,
|
|
32919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(SelectContainer, { className, children: [
|
|
32920
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: id, className: hideLabel ? "j-sr-only" : "", children: label }),
|
|
32921
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(SelectWrapper, { children: [
|
|
32922
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(StyledSelect, { ...selectProps, id, children: props.children }),
|
|
32923
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon, { name: "chevronDown", size: "sm" }) })
|
|
33011
32924
|
] })
|
|
33012
32925
|
] });
|
|
33013
32926
|
}
|
|
33014
32927
|
|
|
33015
32928
|
// src/inspector/viewer/co-value-editor.tsx
|
|
33016
|
-
var
|
|
32929
|
+
var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
|
|
33017
32930
|
function CoValueEditor({
|
|
33018
32931
|
node,
|
|
33019
32932
|
property,
|
|
@@ -33030,8 +32943,8 @@ function CoValueEditor({
|
|
|
33030
32943
|
if (typeof value === "object") return "object";
|
|
33031
32944
|
return "undefined";
|
|
33032
32945
|
};
|
|
33033
|
-
const [selectedType, setSelectedType] = (0,
|
|
33034
|
-
const [editValue, setEditValue] = (0,
|
|
32946
|
+
const [selectedType, setSelectedType] = (0, import_react8.useState)(getInitialType());
|
|
32947
|
+
const [editValue, setEditValue] = (0, import_react8.useState)(
|
|
33035
32948
|
value === void 0 || value === null ? "" : typeof value === "object" ? JSON.stringify(value, null, 2) : String(value)
|
|
33036
32949
|
);
|
|
33037
32950
|
const handleSubmit = (e) => {
|
|
@@ -33076,8 +32989,8 @@ function CoValueEditor({
|
|
|
33076
32989
|
onCancel();
|
|
33077
32990
|
};
|
|
33078
32991
|
const showTextarea = selectedType === "number" || selectedType === "string" || selectedType === "object";
|
|
33079
|
-
return /* @__PURE__ */ (0,
|
|
33080
|
-
/* @__PURE__ */ (0,
|
|
32992
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(EditForm, { onSubmit: handleSubmit, children: [
|
|
32993
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
33081
32994
|
Select,
|
|
33082
32995
|
{
|
|
33083
32996
|
label: "Type",
|
|
@@ -33087,17 +33000,17 @@ function CoValueEditor({
|
|
|
33087
33000
|
},
|
|
33088
33001
|
onClick: (e) => e.stopPropagation(),
|
|
33089
33002
|
children: [
|
|
33090
|
-
/* @__PURE__ */ (0,
|
|
33091
|
-
/* @__PURE__ */ (0,
|
|
33092
|
-
/* @__PURE__ */ (0,
|
|
33093
|
-
/* @__PURE__ */ (0,
|
|
33094
|
-
/* @__PURE__ */ (0,
|
|
33095
|
-
/* @__PURE__ */ (0,
|
|
33096
|
-
/* @__PURE__ */ (0,
|
|
33003
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("option", { value: "number", children: "number" }),
|
|
33004
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("option", { value: "string", children: "string" }),
|
|
33005
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("option", { value: "true", children: "true" }),
|
|
33006
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("option", { value: "false", children: "false" }),
|
|
33007
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("option", { value: "object", children: "object" }),
|
|
33008
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("option", { value: "null", children: "null" }),
|
|
33009
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("option", { value: "undefined", children: "undefined" })
|
|
33097
33010
|
]
|
|
33098
33011
|
}
|
|
33099
33012
|
),
|
|
33100
|
-
showTextarea && /* @__PURE__ */ (0,
|
|
33013
|
+
showTextarea && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
33101
33014
|
StyledTextarea,
|
|
33102
33015
|
{
|
|
33103
33016
|
value: editValue,
|
|
@@ -33105,18 +33018,18 @@ function CoValueEditor({
|
|
|
33105
33018
|
onClick: (e) => e.stopPropagation()
|
|
33106
33019
|
}
|
|
33107
33020
|
),
|
|
33108
|
-
/* @__PURE__ */ (0,
|
|
33109
|
-
/* @__PURE__ */ (0,
|
|
33110
|
-
/* @__PURE__ */ (0,
|
|
33021
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(FormActions, { children: [
|
|
33022
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button, { type: "button", variant: "secondary", onClick: onCancel, children: "Cancel" }),
|
|
33023
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button, { type: "submit", variant: "primary", children: "Submit" })
|
|
33111
33024
|
] })
|
|
33112
33025
|
] });
|
|
33113
33026
|
}
|
|
33114
|
-
var EditForm =
|
|
33027
|
+
var EditForm = styled9("form")`
|
|
33115
33028
|
display: flex;
|
|
33116
33029
|
flex-direction: column;
|
|
33117
33030
|
gap: 0.75rem;
|
|
33118
33031
|
`;
|
|
33119
|
-
var StyledTextarea =
|
|
33032
|
+
var StyledTextarea = styled9("textarea")`
|
|
33120
33033
|
width: 100%;
|
|
33121
33034
|
min-height: 120px;
|
|
33122
33035
|
border-radius: var(--j-radius-md);
|
|
@@ -33133,15 +33046,15 @@ var StyledTextarea = styled11("textarea")`
|
|
|
33133
33046
|
background-color: var(--j-foreground);
|
|
33134
33047
|
}
|
|
33135
33048
|
`;
|
|
33136
|
-
var FormActions =
|
|
33049
|
+
var FormActions = styled9("div")`
|
|
33137
33050
|
display: flex;
|
|
33138
33051
|
gap: 0.5rem;
|
|
33139
33052
|
justify-content: flex-end;
|
|
33140
33053
|
`;
|
|
33141
33054
|
|
|
33142
33055
|
// src/inspector/ui/card.tsx
|
|
33143
|
-
import { styled as
|
|
33144
|
-
var Card =
|
|
33056
|
+
import { styled as styled10 } from "goober";
|
|
33057
|
+
var Card = styled10("div")`
|
|
33145
33058
|
background-color: var(--j-background);
|
|
33146
33059
|
border-radius: var(--j-radius-lg);
|
|
33147
33060
|
box-shadow: var(--j-shadow-sm);
|
|
@@ -33153,19 +33066,19 @@ var Card = styled12("div")`
|
|
|
33153
33066
|
flex-direction: column;
|
|
33154
33067
|
gap: 0.5rem;
|
|
33155
33068
|
`;
|
|
33156
|
-
var CardHeader =
|
|
33069
|
+
var CardHeader = styled10("div")`
|
|
33157
33070
|
display: flex;
|
|
33158
33071
|
justify-content: space-between;
|
|
33159
33072
|
align-items: center;
|
|
33160
33073
|
`;
|
|
33161
|
-
var CardBody =
|
|
33074
|
+
var CardBody = styled10("div")`
|
|
33162
33075
|
flex: 1;
|
|
33163
33076
|
`;
|
|
33164
33077
|
|
|
33165
33078
|
// src/inspector/ui/grid.tsx
|
|
33166
|
-
var
|
|
33167
|
-
import { styled as
|
|
33168
|
-
var GridThreeColumns =
|
|
33079
|
+
var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
|
|
33080
|
+
import { styled as styled11 } from "goober";
|
|
33081
|
+
var GridThreeColumns = styled11("div")`
|
|
33169
33082
|
display: grid;
|
|
33170
33083
|
grid-template-columns: repeat(1, minmax(0, 1fr));
|
|
33171
33084
|
gap: 1rem;
|
|
@@ -33178,7 +33091,7 @@ var GridThreeColumns = styled13("div")`
|
|
|
33178
33091
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
33179
33092
|
}
|
|
33180
33093
|
`;
|
|
33181
|
-
var GridTwoColumns =
|
|
33094
|
+
var GridTwoColumns = styled11("div")`
|
|
33182
33095
|
display: grid;
|
|
33183
33096
|
grid-template-columns: repeat(1, minmax(0, 1fr));
|
|
33184
33097
|
gap: 1rem;
|
|
@@ -33187,7 +33100,7 @@ var GridTwoColumns = styled13("div")`
|
|
|
33187
33100
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
33188
33101
|
}
|
|
33189
33102
|
`;
|
|
33190
|
-
var GridOneColumn =
|
|
33103
|
+
var GridOneColumn = styled11("div")`
|
|
33191
33104
|
display: grid;
|
|
33192
33105
|
grid-template-columns: repeat(1, minmax(0, 1fr));
|
|
33193
33106
|
gap: 1rem;
|
|
@@ -33196,11 +33109,11 @@ function Grid(props) {
|
|
|
33196
33109
|
const { cols, children, ...rest } = props;
|
|
33197
33110
|
switch (cols) {
|
|
33198
33111
|
case 1:
|
|
33199
|
-
return /* @__PURE__ */ (0,
|
|
33112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(GridOneColumn, { ...rest, children });
|
|
33200
33113
|
case 2:
|
|
33201
|
-
return /* @__PURE__ */ (0,
|
|
33114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(GridTwoColumns, { ...rest, children });
|
|
33202
33115
|
case 3:
|
|
33203
|
-
return /* @__PURE__ */ (0,
|
|
33116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(GridThreeColumns, { ...rest, children });
|
|
33204
33117
|
default:
|
|
33205
33118
|
throw new Error(`Invalid number of columns: ${cols}`);
|
|
33206
33119
|
}
|
|
@@ -33212,7 +33125,7 @@ function isWriter(role) {
|
|
|
33212
33125
|
}
|
|
33213
33126
|
|
|
33214
33127
|
// src/inspector/viewer/grid-view.tsx
|
|
33215
|
-
var
|
|
33128
|
+
var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
|
|
33216
33129
|
function GridItem({
|
|
33217
33130
|
entry,
|
|
33218
33131
|
onNavigate,
|
|
@@ -33221,7 +33134,7 @@ function GridItem({
|
|
|
33221
33134
|
}) {
|
|
33222
33135
|
const [key, value] = entry;
|
|
33223
33136
|
const isCoValue = isCoId(value);
|
|
33224
|
-
const [isEditing, setIsEditing] = (0,
|
|
33137
|
+
const [isEditing, setIsEditing] = (0, import_react9.useState)(false);
|
|
33225
33138
|
const handleEditClick = (e) => {
|
|
33226
33139
|
e.stopPropagation();
|
|
33227
33140
|
setIsEditing(true);
|
|
@@ -33244,7 +33157,7 @@ function GridItem({
|
|
|
33244
33157
|
}
|
|
33245
33158
|
};
|
|
33246
33159
|
if (isEditing) {
|
|
33247
|
-
return /* @__PURE__ */ (0,
|
|
33160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
33248
33161
|
Card,
|
|
33249
33162
|
{
|
|
33250
33163
|
style: {
|
|
@@ -33252,11 +33165,11 @@ function GridItem({
|
|
|
33252
33165
|
borderColor: "var(--j-foreground)"
|
|
33253
33166
|
},
|
|
33254
33167
|
children: [
|
|
33255
|
-
/* @__PURE__ */ (0,
|
|
33256
|
-
/* @__PURE__ */ (0,
|
|
33257
|
-
/* @__PURE__ */ (0,
|
|
33258
|
-
] }) : /* @__PURE__ */ (0,
|
|
33259
|
-
/* @__PURE__ */ (0,
|
|
33168
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CardHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { display: "flex", alignItems: "center", gap: "0.5rem" }, children: isCoValue ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
33169
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { strong: true, children: key }),
|
|
33170
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Badge, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ResolveIcon, { coId: value, node }) })
|
|
33171
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { strong: true, children: key }) }) }),
|
|
33172
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CardBody, { style: { wordBreak: "break-word" }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
33260
33173
|
CoValueEditor,
|
|
33261
33174
|
{
|
|
33262
33175
|
node,
|
|
@@ -33279,34 +33192,34 @@ function GridItem({
|
|
|
33279
33192
|
borderColor: "var(--j-foreground)"
|
|
33280
33193
|
}
|
|
33281
33194
|
};
|
|
33282
|
-
return /* @__PURE__ */ (0,
|
|
33283
|
-
/* @__PURE__ */ (0,
|
|
33284
|
-
/* @__PURE__ */ (0,
|
|
33285
|
-
/* @__PURE__ */ (0,
|
|
33286
|
-
/* @__PURE__ */ (0,
|
|
33287
|
-
] }) : /* @__PURE__ */ (0,
|
|
33288
|
-
coValue && isWriter(coValue.group.myRole()) && /* @__PURE__ */ (0,
|
|
33289
|
-
/* @__PURE__ */ (0,
|
|
33195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Card, { ...cardProps, children: [
|
|
33196
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(CardHeader, { children: [
|
|
33197
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { display: "flex", alignItems: "center", gap: "0.5rem" }, children: isCoValue ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
33198
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { strong: true, children: key }),
|
|
33199
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Badge, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ResolveIcon, { coId: value, node }) })
|
|
33200
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { strong: true, children: key }) }),
|
|
33201
|
+
coValue && isWriter(coValue.group.myRole()) && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(ActionButtons, { children: [
|
|
33202
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
33290
33203
|
EditButton,
|
|
33291
33204
|
{
|
|
33292
33205
|
onClick: handleEditClick,
|
|
33293
33206
|
type: "button",
|
|
33294
33207
|
"aria-label": "Edit",
|
|
33295
|
-
children: /* @__PURE__ */ (0,
|
|
33208
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Icon, { name: "edit", size: "sm" })
|
|
33296
33209
|
}
|
|
33297
33210
|
),
|
|
33298
|
-
/* @__PURE__ */ (0,
|
|
33211
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
33299
33212
|
DeleteButton,
|
|
33300
33213
|
{
|
|
33301
33214
|
onClick: handleDelete,
|
|
33302
33215
|
type: "button",
|
|
33303
33216
|
"aria-label": "Delete",
|
|
33304
|
-
children: /* @__PURE__ */ (0,
|
|
33217
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Icon, { name: "delete", size: "sm" })
|
|
33305
33218
|
}
|
|
33306
33219
|
)
|
|
33307
33220
|
] })
|
|
33308
33221
|
] }),
|
|
33309
|
-
/* @__PURE__ */ (0,
|
|
33222
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CardBody, { style: { wordBreak: "break-word" }, children: isCoValue ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CoMapPreview, { coId: value, node }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
33310
33223
|
ValueRenderer,
|
|
33311
33224
|
{
|
|
33312
33225
|
json: value,
|
|
@@ -33324,7 +33237,7 @@ function GridView({
|
|
|
33324
33237
|
coValue
|
|
33325
33238
|
}) {
|
|
33326
33239
|
const entries = Object.entries(data);
|
|
33327
|
-
return /* @__PURE__ */ (0,
|
|
33240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Grid, { cols: entries.length === 1 ? 1 : 3, children: entries.map((entry, childIndex) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
33328
33241
|
GridItem,
|
|
33329
33242
|
{
|
|
33330
33243
|
entry,
|
|
@@ -33335,7 +33248,7 @@ function GridView({
|
|
|
33335
33248
|
childIndex
|
|
33336
33249
|
)) });
|
|
33337
33250
|
}
|
|
33338
|
-
var EditButton =
|
|
33251
|
+
var EditButton = styled12("button")`
|
|
33339
33252
|
display: inline-flex;
|
|
33340
33253
|
align-items: center;
|
|
33341
33254
|
justify-content: center;
|
|
@@ -33351,7 +33264,7 @@ var EditButton = styled14("button")`
|
|
|
33351
33264
|
background-color: var(--j-foreground);
|
|
33352
33265
|
}
|
|
33353
33266
|
`;
|
|
33354
|
-
var DeleteButton =
|
|
33267
|
+
var DeleteButton = styled12("button")`
|
|
33355
33268
|
display: inline-flex;
|
|
33356
33269
|
align-items: center;
|
|
33357
33270
|
justify-content: center;
|
|
@@ -33367,25 +33280,25 @@ var DeleteButton = styled14("button")`
|
|
|
33367
33280
|
background-color: var(--j-foreground);
|
|
33368
33281
|
}
|
|
33369
33282
|
`;
|
|
33370
|
-
var ActionButtons =
|
|
33283
|
+
var ActionButtons = styled12("div")`
|
|
33371
33284
|
display: flex;
|
|
33372
33285
|
align-items: center;
|
|
33373
33286
|
gap: 0.25rem;
|
|
33374
33287
|
`;
|
|
33375
33288
|
|
|
33376
33289
|
// src/inspector/viewer/raw-data-card.tsx
|
|
33377
|
-
var
|
|
33290
|
+
var import_react15 = __toESM(require_react(), 1);
|
|
33378
33291
|
|
|
33379
33292
|
// src/inspector/ui/modal.tsx
|
|
33380
|
-
var
|
|
33381
|
-
import { styled as
|
|
33382
|
-
var
|
|
33383
|
-
var ModalContent =
|
|
33293
|
+
var import_react10 = __toESM(require_react(), 1);
|
|
33294
|
+
import { styled as styled13 } from "goober";
|
|
33295
|
+
var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
|
|
33296
|
+
var ModalContent = styled13("dialog")`
|
|
33384
33297
|
background-color: var(--j-background);
|
|
33385
33298
|
border-radius: var(--j-radius-lg);
|
|
33386
33299
|
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
|
|
33387
33300
|
border: 1px solid var(--j-border-color);
|
|
33388
|
-
max-width: 32rem;
|
|
33301
|
+
${(props) => props.wide ? "max-width: 60vw;" : "max-width: 32rem;"}
|
|
33389
33302
|
margin-block: auto;
|
|
33390
33303
|
margin-inline: auto;
|
|
33391
33304
|
&::backdrop {
|
|
@@ -33393,24 +33306,24 @@ var ModalContent = styled15("dialog")`
|
|
|
33393
33306
|
}
|
|
33394
33307
|
|
|
33395
33308
|
`;
|
|
33396
|
-
var ModalHeader =
|
|
33309
|
+
var ModalHeader = styled13("div")`
|
|
33397
33310
|
display: flex;
|
|
33398
33311
|
justify-content: space-between;
|
|
33399
33312
|
align-items: flex-start;
|
|
33400
33313
|
padding: 1.5rem 1.5rem 0 1.5rem;
|
|
33401
33314
|
gap: 1rem;
|
|
33402
33315
|
`;
|
|
33403
|
-
var ModalBody =
|
|
33316
|
+
var ModalBody = styled13("div")`
|
|
33404
33317
|
padding: 1rem 1.5rem;
|
|
33405
33318
|
flex: 1;
|
|
33406
33319
|
`;
|
|
33407
|
-
var ModalFooter =
|
|
33320
|
+
var ModalFooter = styled13("div")`
|
|
33408
33321
|
display: flex;
|
|
33409
33322
|
justify-content: flex-end;
|
|
33410
33323
|
gap: 0.75rem;
|
|
33411
33324
|
padding: 0 1.5rem 1.5rem 1.5rem;
|
|
33412
33325
|
`;
|
|
33413
|
-
var CloseButton =
|
|
33326
|
+
var CloseButton = styled13("button")`
|
|
33414
33327
|
background: none;
|
|
33415
33328
|
border: none;
|
|
33416
33329
|
cursor: pointer;
|
|
@@ -33434,7 +33347,7 @@ var CloseButton = styled15("button")`
|
|
|
33434
33347
|
outline-offset: 2px;
|
|
33435
33348
|
}
|
|
33436
33349
|
`;
|
|
33437
|
-
var Modal = (0,
|
|
33350
|
+
var Modal = (0, import_react10.forwardRef)(
|
|
33438
33351
|
({
|
|
33439
33352
|
isOpen,
|
|
33440
33353
|
onClose,
|
|
@@ -33446,10 +33359,11 @@ var Modal = (0, import_react12.forwardRef)(
|
|
|
33446
33359
|
onConfirm,
|
|
33447
33360
|
onCancel,
|
|
33448
33361
|
showButtons = true,
|
|
33449
|
-
className
|
|
33362
|
+
className,
|
|
33363
|
+
wide = false
|
|
33450
33364
|
}, ref) => {
|
|
33451
|
-
const modalRef = (0,
|
|
33452
|
-
(0,
|
|
33365
|
+
const modalRef = (0, import_react10.useRef)(null);
|
|
33366
|
+
(0, import_react10.useEffect)(() => {
|
|
33453
33367
|
if (isOpen) {
|
|
33454
33368
|
modalRef.current?.showModal();
|
|
33455
33369
|
} else {
|
|
@@ -33466,7 +33380,7 @@ var Modal = (0, import_react12.forwardRef)(
|
|
|
33466
33380
|
onClose();
|
|
33467
33381
|
};
|
|
33468
33382
|
if (!isOpen) return null;
|
|
33469
|
-
return /* @__PURE__ */ (0,
|
|
33383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
33470
33384
|
ModalContent,
|
|
33471
33385
|
{
|
|
33472
33386
|
ref: ref || modalRef,
|
|
@@ -33474,18 +33388,19 @@ var Modal = (0, import_react12.forwardRef)(
|
|
|
33474
33388
|
role: "dialog",
|
|
33475
33389
|
"aria-labelledby": "modal-heading",
|
|
33476
33390
|
onClose,
|
|
33391
|
+
wide,
|
|
33477
33392
|
children: [
|
|
33478
|
-
/* @__PURE__ */ (0,
|
|
33479
|
-
/* @__PURE__ */ (0,
|
|
33480
|
-
/* @__PURE__ */ (0,
|
|
33393
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(ModalHeader, { children: [
|
|
33394
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Heading, { id: "modal-heading", children: heading }),
|
|
33395
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CloseButton, { onClick: onClose, "aria-label": "Close modal", type: "button", children: "\xD7" })
|
|
33481
33396
|
] }),
|
|
33482
|
-
/* @__PURE__ */ (0,
|
|
33483
|
-
text && /* @__PURE__ */ (0,
|
|
33397
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(ModalBody, { children: [
|
|
33398
|
+
text && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { style: { margin: "0 0 1rem 0", color: "var(--j-text-color)" }, children: text }),
|
|
33484
33399
|
children
|
|
33485
33400
|
] }),
|
|
33486
|
-
showButtons && /* @__PURE__ */ (0,
|
|
33487
|
-
/* @__PURE__ */ (0,
|
|
33488
|
-
/* @__PURE__ */ (0,
|
|
33401
|
+
showButtons && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(ModalFooter, { children: [
|
|
33402
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Button, { variant: "secondary", onClick: handleCancel, children: cancelText }),
|
|
33403
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Button, { variant: "primary", onClick: handleConfirm, children: confirmText })
|
|
33489
33404
|
] })
|
|
33490
33405
|
]
|
|
33491
33406
|
}
|
|
@@ -33494,17 +33409,58 @@ var Modal = (0, import_react12.forwardRef)(
|
|
|
33494
33409
|
);
|
|
33495
33410
|
Modal.displayName = "Modal";
|
|
33496
33411
|
|
|
33412
|
+
// src/inspector/ui/input.tsx
|
|
33413
|
+
var import_react11 = __toESM(require_react(), 1);
|
|
33414
|
+
var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
|
|
33415
|
+
import { styled as styled14 } from "goober";
|
|
33416
|
+
var Container = styled14("div")`
|
|
33417
|
+
display: grid;
|
|
33418
|
+
gap: 0.25rem;
|
|
33419
|
+
`;
|
|
33420
|
+
var StyledInput = styled14("input")`
|
|
33421
|
+
width: 100%;
|
|
33422
|
+
border-radius: var(--j-radius-md);
|
|
33423
|
+
border: 1px solid var(--j-border-color);
|
|
33424
|
+
padding: 0.5rem 0.875rem;
|
|
33425
|
+
box-shadow: var(--j-shadow-sm);
|
|
33426
|
+
font-weight: 500;
|
|
33427
|
+
background-color: white;
|
|
33428
|
+
color: var(--j-text-color-strong);
|
|
33429
|
+
|
|
33430
|
+
@media (prefers-color-scheme: dark) {
|
|
33431
|
+
background-color: var(--j-foreground);
|
|
33432
|
+
}
|
|
33433
|
+
`;
|
|
33434
|
+
var Input = (0, import_react11.forwardRef)(
|
|
33435
|
+
({ label, className, hideLabel, id: customId, ...inputProps }, ref) => {
|
|
33436
|
+
const generatedId = (0, import_react11.useId)();
|
|
33437
|
+
const id = customId || generatedId;
|
|
33438
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Container, { className, children: [
|
|
33439
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
33440
|
+
"label",
|
|
33441
|
+
{
|
|
33442
|
+
htmlFor: id,
|
|
33443
|
+
className: hideLabel ? "j-sr-only" : "",
|
|
33444
|
+
style: { color: "var(--j-text-color)" },
|
|
33445
|
+
children: label
|
|
33446
|
+
}
|
|
33447
|
+
),
|
|
33448
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(StyledInput, { ref, ...inputProps, id })
|
|
33449
|
+
] });
|
|
33450
|
+
}
|
|
33451
|
+
);
|
|
33452
|
+
|
|
33497
33453
|
// src/inspector/ui/data-table.tsx
|
|
33498
|
-
var
|
|
33454
|
+
var import_react13 = __toESM(require_react(), 1);
|
|
33499
33455
|
|
|
33500
33456
|
// src/inspector/ui/table.tsx
|
|
33501
|
-
var
|
|
33502
|
-
var
|
|
33503
|
-
import { styled as
|
|
33504
|
-
var StyledTable =
|
|
33457
|
+
var import_react12 = __toESM(require_react(), 1);
|
|
33458
|
+
var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
|
|
33459
|
+
import { styled as styled15 } from "goober";
|
|
33460
|
+
var StyledTable = styled15("table")`
|
|
33505
33461
|
width: 100%;
|
|
33506
33462
|
`;
|
|
33507
|
-
var StyledThead =
|
|
33463
|
+
var StyledThead = styled15("thead")`
|
|
33508
33464
|
text-align: left;
|
|
33509
33465
|
border-bottom: 1px solid var(--j-border-color);
|
|
33510
33466
|
background-color: var(--j-neutral-100);
|
|
@@ -33513,7 +33469,7 @@ var StyledThead = styled16("thead")`
|
|
|
33513
33469
|
background-color: var(--j-neutral-925);
|
|
33514
33470
|
}
|
|
33515
33471
|
`;
|
|
33516
|
-
var StyledTbody =
|
|
33472
|
+
var StyledTbody = styled15("tbody")`
|
|
33517
33473
|
tr {
|
|
33518
33474
|
border-bottom: 1px solid var(--j-border-color);
|
|
33519
33475
|
|
|
@@ -33522,23 +33478,23 @@ var StyledTbody = styled16("tbody")`
|
|
|
33522
33478
|
}
|
|
33523
33479
|
}
|
|
33524
33480
|
`;
|
|
33525
|
-
var StyledTh =
|
|
33481
|
+
var StyledTh = styled15("th")`
|
|
33526
33482
|
font-weight: 500;
|
|
33527
33483
|
padding: 0.5rem 0.75rem;
|
|
33528
33484
|
color: var(--j-text-color-strong);
|
|
33529
33485
|
`;
|
|
33530
|
-
var StyledTd =
|
|
33486
|
+
var StyledTd = styled15("td")`
|
|
33531
33487
|
padding: 0.5rem 0.75rem;
|
|
33532
33488
|
`;
|
|
33533
|
-
var Table =
|
|
33534
|
-
var TableHead =
|
|
33535
|
-
var TableBody =
|
|
33536
|
-
var TableRow =
|
|
33537
|
-
var TableHeader =
|
|
33538
|
-
var TableCell =
|
|
33489
|
+
var Table = import_react12.default.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(StyledTable, { ref, ...props, children }));
|
|
33490
|
+
var TableHead = import_react12.default.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(StyledThead, { ref, ...props, children }));
|
|
33491
|
+
var TableBody = import_react12.default.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(StyledTbody, { ref, ...props, children }));
|
|
33492
|
+
var TableRow = import_react12.default.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("tr", { ref, ...props, children }));
|
|
33493
|
+
var TableHeader = import_react12.default.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(StyledTh, { ref, ...props, children }));
|
|
33494
|
+
var TableCell = import_react12.default.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(StyledTd, { ref, ...props, children }));
|
|
33539
33495
|
|
|
33540
33496
|
// src/inspector/ui/data-table.tsx
|
|
33541
|
-
var
|
|
33497
|
+
var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
|
|
33542
33498
|
function DataTable({
|
|
33543
33499
|
columns,
|
|
33544
33500
|
data,
|
|
@@ -33547,10 +33503,10 @@ function DataTable({
|
|
|
33547
33503
|
getRowKey,
|
|
33548
33504
|
emptyMessage = "No data available"
|
|
33549
33505
|
}) {
|
|
33550
|
-
const [currentPage, setCurrentPage] = (0,
|
|
33551
|
-
const [sortConfig, setSortConfig] = (0,
|
|
33552
|
-
const [filters, setFilters] = (0,
|
|
33553
|
-
const filteredData = (0,
|
|
33506
|
+
const [currentPage, setCurrentPage] = (0, import_react13.useState)(1);
|
|
33507
|
+
const [sortConfig, setSortConfig] = (0, import_react13.useState)(initialSort);
|
|
33508
|
+
const [filters, setFilters] = (0, import_react13.useState)({});
|
|
33509
|
+
const filteredData = (0, import_react13.useMemo)(() => {
|
|
33554
33510
|
return data.filter((row) => {
|
|
33555
33511
|
return Object.entries(filters).every(([columnId, filterValue]) => {
|
|
33556
33512
|
if (!filterValue) return true;
|
|
@@ -33564,7 +33520,7 @@ function DataTable({
|
|
|
33564
33520
|
});
|
|
33565
33521
|
});
|
|
33566
33522
|
}, [data, filters, columns]);
|
|
33567
|
-
const sortedData = (0,
|
|
33523
|
+
const sortedData = (0, import_react13.useMemo)(() => {
|
|
33568
33524
|
if (!sortConfig) return filteredData;
|
|
33569
33525
|
const column = columns.find((col) => col.id === sortConfig.columnId);
|
|
33570
33526
|
if (!column?.sortable) return filteredData;
|
|
@@ -33583,7 +33539,7 @@ function DataTable({
|
|
|
33583
33539
|
const startIndex = (currentPage - 1) * pageSize;
|
|
33584
33540
|
const endIndex = startIndex + pageSize;
|
|
33585
33541
|
const paginatedData = sortedData.slice(startIndex, endIndex);
|
|
33586
|
-
(0,
|
|
33542
|
+
(0, import_react13.useEffect)(() => {
|
|
33587
33543
|
setCurrentPage(1);
|
|
33588
33544
|
}, [filters]);
|
|
33589
33545
|
const handleSort = (columnId) => {
|
|
@@ -33608,9 +33564,9 @@ function DataTable({
|
|
|
33608
33564
|
const handlePageChange = (page) => {
|
|
33609
33565
|
setCurrentPage(Math.max(1, Math.min(page, totalPages)));
|
|
33610
33566
|
};
|
|
33611
|
-
return /* @__PURE__ */ (0,
|
|
33612
|
-
/* @__PURE__ */ (0,
|
|
33613
|
-
/* @__PURE__ */ (0,
|
|
33567
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
33568
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Table, { children: [
|
|
33569
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TableRow, { children: columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
33614
33570
|
"div",
|
|
33615
33571
|
{
|
|
33616
33572
|
style: {
|
|
@@ -33621,8 +33577,8 @@ function DataTable({
|
|
|
33621
33577
|
},
|
|
33622
33578
|
onClick: () => handleSort(column.id),
|
|
33623
33579
|
children: [
|
|
33624
|
-
/* @__PURE__ */ (0,
|
|
33625
|
-
column.sortable && /* @__PURE__ */ (0,
|
|
33580
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: column.header }),
|
|
33581
|
+
column.sortable && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
33626
33582
|
"span",
|
|
33627
33583
|
{
|
|
33628
33584
|
style: {
|
|
@@ -33635,8 +33591,8 @@ function DataTable({
|
|
|
33635
33591
|
]
|
|
33636
33592
|
}
|
|
33637
33593
|
) }, column.id)) }) }),
|
|
33638
|
-
/* @__PURE__ */ (0,
|
|
33639
|
-
columns.some((column) => column.filterable) && /* @__PURE__ */ (0,
|
|
33594
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(TableBody, { children: [
|
|
33595
|
+
columns.some((column) => column.filterable) && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TableRow, { children: columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TableCell, { children: column.filterable && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
33640
33596
|
Input,
|
|
33641
33597
|
{
|
|
33642
33598
|
label: "Filter",
|
|
@@ -33648,7 +33604,7 @@ function DataTable({
|
|
|
33648
33604
|
onClick: (e) => e.stopPropagation()
|
|
33649
33605
|
}
|
|
33650
33606
|
) }, column.id)) }),
|
|
33651
|
-
paginatedData.length === 0 ? /* @__PURE__ */ (0,
|
|
33607
|
+
paginatedData.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TableCell, { colSpan: columns.length, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
33652
33608
|
"div",
|
|
33653
33609
|
{
|
|
33654
33610
|
style: {
|
|
@@ -33658,10 +33614,10 @@ function DataTable({
|
|
|
33658
33614
|
},
|
|
33659
33615
|
children: emptyMessage
|
|
33660
33616
|
}
|
|
33661
|
-
) }) }) : paginatedData.map((row, index) => /* @__PURE__ */ (0,
|
|
33617
|
+
) }) }) : paginatedData.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TableRow, { children: columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TableCell, { children: column.accessor(row) }, column.id)) }, getRowKey(row, startIndex + index)))
|
|
33662
33618
|
] })
|
|
33663
33619
|
] }),
|
|
33664
|
-
showPagination && /* @__PURE__ */ (0,
|
|
33620
|
+
showPagination && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
33665
33621
|
"div",
|
|
33666
33622
|
{
|
|
33667
33623
|
style: {
|
|
@@ -33672,7 +33628,7 @@ function DataTable({
|
|
|
33672
33628
|
padding: "8px 0"
|
|
33673
33629
|
},
|
|
33674
33630
|
children: [
|
|
33675
|
-
/* @__PURE__ */ (0,
|
|
33631
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { fontSize: "14px", opacity: 0.7 }, children: [
|
|
33676
33632
|
"Showing ",
|
|
33677
33633
|
startIndex + 1,
|
|
33678
33634
|
" to ",
|
|
@@ -33683,8 +33639,8 @@ function DataTable({
|
|
|
33683
33639
|
" entries",
|
|
33684
33640
|
Object.keys(filters).some((key) => filters[key]) && ` (filtered from ${data.length})`
|
|
33685
33641
|
] }),
|
|
33686
|
-
/* @__PURE__ */ (0,
|
|
33687
|
-
/* @__PURE__ */ (0,
|
|
33642
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { display: "flex", gap: "8px", alignItems: "center" }, children: [
|
|
33643
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
33688
33644
|
Button,
|
|
33689
33645
|
{
|
|
33690
33646
|
variant: "secondary",
|
|
@@ -33693,7 +33649,7 @@ function DataTable({
|
|
|
33693
33649
|
children: "\xAB\xAB"
|
|
33694
33650
|
}
|
|
33695
33651
|
),
|
|
33696
|
-
/* @__PURE__ */ (0,
|
|
33652
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
33697
33653
|
Button,
|
|
33698
33654
|
{
|
|
33699
33655
|
variant: "secondary",
|
|
@@ -33702,13 +33658,13 @@ function DataTable({
|
|
|
33702
33658
|
children: "\xAB"
|
|
33703
33659
|
}
|
|
33704
33660
|
),
|
|
33705
|
-
/* @__PURE__ */ (0,
|
|
33661
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { style: { fontSize: "14px" }, children: [
|
|
33706
33662
|
"Page ",
|
|
33707
33663
|
currentPage,
|
|
33708
33664
|
" of ",
|
|
33709
33665
|
totalPages
|
|
33710
33666
|
] }),
|
|
33711
|
-
/* @__PURE__ */ (0,
|
|
33667
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
33712
33668
|
Button,
|
|
33713
33669
|
{
|
|
33714
33670
|
variant: "secondary",
|
|
@@ -33717,7 +33673,7 @@ function DataTable({
|
|
|
33717
33673
|
children: "\xBB"
|
|
33718
33674
|
}
|
|
33719
33675
|
),
|
|
33720
|
-
/* @__PURE__ */ (0,
|
|
33676
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
33721
33677
|
Button,
|
|
33722
33678
|
{
|
|
33723
33679
|
variant: "secondary",
|
|
@@ -33734,18 +33690,18 @@ function DataTable({
|
|
|
33734
33690
|
}
|
|
33735
33691
|
|
|
33736
33692
|
// src/inspector/ui/accordion.tsx
|
|
33737
|
-
var
|
|
33738
|
-
var
|
|
33739
|
-
import { styled as
|
|
33693
|
+
var import_react14 = __toESM(require_react(), 1);
|
|
33694
|
+
var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
|
|
33695
|
+
import { styled as styled16 } from "goober";
|
|
33740
33696
|
function Accordion({ title, children, storageKey }) {
|
|
33741
33697
|
const [open, setOpen] = useStoragedState(storageKey, false);
|
|
33742
|
-
return /* @__PURE__ */ (0,
|
|
33698
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
33743
33699
|
"details",
|
|
33744
33700
|
{
|
|
33745
33701
|
open,
|
|
33746
33702
|
style: { display: "flex", flexDirection: "column", gap: "1rem" },
|
|
33747
33703
|
children: [
|
|
33748
|
-
/* @__PURE__ */ (0,
|
|
33704
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
33749
33705
|
StyledSummary,
|
|
33750
33706
|
{
|
|
33751
33707
|
onClick: (e) => {
|
|
@@ -33761,17 +33717,17 @@ function Accordion({ title, children, storageKey }) {
|
|
|
33761
33717
|
);
|
|
33762
33718
|
}
|
|
33763
33719
|
function useStoragedState(key, defaultValue) {
|
|
33764
|
-
const [state, setState] = (0,
|
|
33720
|
+
const [state, setState] = (0, import_react14.useState)(() => {
|
|
33765
33721
|
if (typeof window === "undefined") return defaultValue;
|
|
33766
33722
|
const stored = localStorage.getItem(key);
|
|
33767
33723
|
return stored ? JSON.parse(stored) : defaultValue;
|
|
33768
33724
|
});
|
|
33769
|
-
(0,
|
|
33725
|
+
(0, import_react14.useEffect)(() => {
|
|
33770
33726
|
localStorage.setItem(key, JSON.stringify(state));
|
|
33771
33727
|
}, [state]);
|
|
33772
33728
|
return [state, setState];
|
|
33773
33729
|
}
|
|
33774
|
-
var StyledSummary =
|
|
33730
|
+
var StyledSummary = styled16("summary")`
|
|
33775
33731
|
font-size: 1.125rem;
|
|
33776
33732
|
cursor: pointer;
|
|
33777
33733
|
font-weight: 500;
|
|
@@ -33779,12 +33735,12 @@ var StyledSummary = styled17("summary")`
|
|
|
33779
33735
|
`;
|
|
33780
33736
|
|
|
33781
33737
|
// src/inspector/viewer/raw-data-card.tsx
|
|
33782
|
-
var
|
|
33738
|
+
var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
|
|
33783
33739
|
function CopyButton({ data }) {
|
|
33784
|
-
const [copyCount, setCopyCount] = (0,
|
|
33740
|
+
const [copyCount, setCopyCount] = (0, import_react15.useState)(0);
|
|
33785
33741
|
const copied = copyCount > 0;
|
|
33786
33742
|
const stringifiedData = JSON.stringify(data);
|
|
33787
|
-
(0,
|
|
33743
|
+
(0, import_react15.useEffect)(() => {
|
|
33788
33744
|
if (copyCount > 0) {
|
|
33789
33745
|
const timeout = setTimeout(() => setCopyCount(0), 1e3);
|
|
33790
33746
|
return () => {
|
|
@@ -33792,7 +33748,7 @@ function CopyButton({ data }) {
|
|
|
33792
33748
|
};
|
|
33793
33749
|
}
|
|
33794
33750
|
}, [copyCount]);
|
|
33795
|
-
return /* @__PURE__ */ (0,
|
|
33751
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
33796
33752
|
Button,
|
|
33797
33753
|
{
|
|
33798
33754
|
style: {
|
|
@@ -33811,14 +33767,14 @@ function CopyButton({ data }) {
|
|
|
33811
33767
|
);
|
|
33812
33768
|
}
|
|
33813
33769
|
function RawDataCard({ data }) {
|
|
33814
|
-
return /* @__PURE__ */ (0,
|
|
33815
|
-
/* @__PURE__ */ (0,
|
|
33816
|
-
/* @__PURE__ */ (0,
|
|
33770
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Accordion, { title: "Raw data", storageKey: "jazz-inspector-show-raw-data", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Card, { style: { position: "relative" }, children: [
|
|
33771
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CardHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CopyButton, { data }) }),
|
|
33772
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ValueRenderer, { json: data }) })
|
|
33817
33773
|
] }) });
|
|
33818
33774
|
}
|
|
33819
33775
|
|
|
33820
33776
|
// src/inspector/viewer/account-view.tsx
|
|
33821
|
-
var
|
|
33777
|
+
var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
|
|
33822
33778
|
function AccountView({
|
|
33823
33779
|
data,
|
|
33824
33780
|
onNavigate,
|
|
@@ -33830,24 +33786,24 @@ function AccountView({
|
|
|
33830
33786
|
delete readableData[key];
|
|
33831
33787
|
}
|
|
33832
33788
|
}
|
|
33833
|
-
return /* @__PURE__ */ (0,
|
|
33834
|
-
/* @__PURE__ */ (0,
|
|
33835
|
-
/* @__PURE__ */ (0,
|
|
33789
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
33790
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(GridView, { data: readableData, onNavigate, node }),
|
|
33791
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(RawDataCard, { data })
|
|
33836
33792
|
] });
|
|
33837
33793
|
}
|
|
33838
33794
|
|
|
33839
33795
|
// src/inspector/viewer/co-plain-text-view.tsx
|
|
33840
|
-
var
|
|
33841
|
-
import { styled as
|
|
33796
|
+
var import_react16 = __toESM(require_react(), 1);
|
|
33797
|
+
import { styled as styled17 } from "goober";
|
|
33842
33798
|
import { CoPlainText } from "jazz-tools";
|
|
33843
|
-
var
|
|
33799
|
+
var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
|
|
33844
33800
|
function CoPlainTextView({
|
|
33845
33801
|
data,
|
|
33846
33802
|
coValue
|
|
33847
33803
|
}) {
|
|
33848
33804
|
const currentText = Object.values(data).join("");
|
|
33849
|
-
const [isEditing, setIsEditing] = (0,
|
|
33850
|
-
const [editValue, setEditValue] = (0,
|
|
33805
|
+
const [isEditing, setIsEditing] = (0, import_react16.useState)(false);
|
|
33806
|
+
const [editValue, setEditValue] = (0, import_react16.useState)("");
|
|
33851
33807
|
const canEdit2 = isWriter(coValue.group.myRole());
|
|
33852
33808
|
const handleEditClick = () => {
|
|
33853
33809
|
setIsEditing(true);
|
|
@@ -33866,9 +33822,9 @@ function CoPlainTextView({
|
|
|
33866
33822
|
};
|
|
33867
33823
|
if (!data) return;
|
|
33868
33824
|
if (isEditing) {
|
|
33869
|
-
return /* @__PURE__ */ (0,
|
|
33870
|
-
/* @__PURE__ */ (0,
|
|
33871
|
-
/* @__PURE__ */ (0,
|
|
33825
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
33826
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(EditForm2, { onSubmit: handleSave, children: [
|
|
33827
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
33872
33828
|
StyledTextarea2,
|
|
33873
33829
|
{
|
|
33874
33830
|
value: editValue,
|
|
@@ -33876,27 +33832,27 @@ function CoPlainTextView({
|
|
|
33876
33832
|
onClick: (e) => e.stopPropagation()
|
|
33877
33833
|
}
|
|
33878
33834
|
),
|
|
33879
|
-
/* @__PURE__ */ (0,
|
|
33880
|
-
/* @__PURE__ */ (0,
|
|
33881
|
-
/* @__PURE__ */ (0,
|
|
33835
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(FormActions2, { children: [
|
|
33836
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button, { type: "button", variant: "secondary", onClick: handleCancel, children: "Cancel" }),
|
|
33837
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button, { type: "submit", variant: "primary", children: "Save" })
|
|
33882
33838
|
] })
|
|
33883
33839
|
] }),
|
|
33884
|
-
/* @__PURE__ */ (0,
|
|
33840
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(RawDataCard, { data })
|
|
33885
33841
|
] });
|
|
33886
33842
|
}
|
|
33887
|
-
return /* @__PURE__ */ (0,
|
|
33888
|
-
/* @__PURE__ */ (0,
|
|
33889
|
-
/* @__PURE__ */ (0,
|
|
33890
|
-
/* @__PURE__ */ (0,
|
|
33843
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
33844
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { children: currentText }),
|
|
33845
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { children: canEdit2 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button, { variant: "secondary", onClick: handleEditClick, title: "Edit", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon, { name: "edit" }) }) }),
|
|
33846
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(RawDataCard, { data })
|
|
33891
33847
|
] });
|
|
33892
33848
|
}
|
|
33893
|
-
var EditForm2 =
|
|
33849
|
+
var EditForm2 = styled17("form")`
|
|
33894
33850
|
display: flex;
|
|
33895
33851
|
flex-direction: column;
|
|
33896
33852
|
gap: 0.75rem;
|
|
33897
33853
|
margin-bottom: 1rem;
|
|
33898
33854
|
`;
|
|
33899
|
-
var StyledTextarea2 =
|
|
33855
|
+
var StyledTextarea2 = styled17("textarea")`
|
|
33900
33856
|
width: 100%;
|
|
33901
33857
|
min-height: 120px;
|
|
33902
33858
|
border-radius: var(--j-radius-md);
|
|
@@ -33913,15 +33869,15 @@ var StyledTextarea2 = styled18("textarea")`
|
|
|
33913
33869
|
background-color: var(--j-foreground);
|
|
33914
33870
|
}
|
|
33915
33871
|
`;
|
|
33916
|
-
var FormActions2 =
|
|
33872
|
+
var FormActions2 = styled17("div")`
|
|
33917
33873
|
display: flex;
|
|
33918
33874
|
gap: 0.5rem;
|
|
33919
33875
|
justify-content: flex-end;
|
|
33920
33876
|
`;
|
|
33921
33877
|
|
|
33922
33878
|
// src/inspector/viewer/group-view.tsx
|
|
33923
|
-
var
|
|
33924
|
-
var
|
|
33879
|
+
var import_react17 = __toESM(require_react(), 1);
|
|
33880
|
+
var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
|
|
33925
33881
|
function partitionMembers(data) {
|
|
33926
33882
|
const everyone = Object.entries(data).filter(([key]) => key === "everyone").map(([key, value]) => ({
|
|
33927
33883
|
id: key,
|
|
@@ -33949,7 +33905,7 @@ function GroupView({
|
|
|
33949
33905
|
onNavigate,
|
|
33950
33906
|
node
|
|
33951
33907
|
}) {
|
|
33952
|
-
const [addMemberType, setAddMemberType] = (0,
|
|
33908
|
+
const [addMemberType, setAddMemberType] = (0, import_react17.useState)(null);
|
|
33953
33909
|
const { everyone, members, parentGroups, childGroups } = partitionMembers(
|
|
33954
33910
|
data
|
|
33955
33911
|
);
|
|
@@ -34028,28 +33984,28 @@ function GroupView({
|
|
|
34028
33984
|
alert(`Failed to add ${addMemberType}: ${error.message}`);
|
|
34029
33985
|
}
|
|
34030
33986
|
};
|
|
34031
|
-
return /* @__PURE__ */ (0,
|
|
34032
|
-
/* @__PURE__ */ (0,
|
|
34033
|
-
/* @__PURE__ */ (0,
|
|
34034
|
-
/* @__PURE__ */ (0,
|
|
34035
|
-
/* @__PURE__ */ (0,
|
|
34036
|
-
/* @__PURE__ */ (0,
|
|
33987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
33988
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Table, { children: [
|
|
33989
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(TableRow, { children: [
|
|
33990
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableHeader, { children: "Member" }),
|
|
33991
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableHeader, { children: "Permission" }),
|
|
33992
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableHeader, {})
|
|
34037
33993
|
] }) }),
|
|
34038
|
-
/* @__PURE__ */ (0,
|
|
34039
|
-
everyone.map((member) => /* @__PURE__ */ (0,
|
|
34040
|
-
/* @__PURE__ */ (0,
|
|
34041
|
-
/* @__PURE__ */ (0,
|
|
34042
|
-
/* @__PURE__ */ (0,
|
|
33994
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(TableBody, { children: [
|
|
33995
|
+
everyone.map((member) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(TableRow, { children: [
|
|
33996
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableCell, { children: member.id }),
|
|
33997
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableCell, { children: member.role }),
|
|
33998
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableCell, { children: member.role !== "revoked" && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
34043
33999
|
Button,
|
|
34044
34000
|
{
|
|
34045
34001
|
variant: "secondary",
|
|
34046
34002
|
onClick: () => onRemoveMember(member.id),
|
|
34047
|
-
children: /* @__PURE__ */ (0,
|
|
34003
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, { name: "delete" })
|
|
34048
34004
|
}
|
|
34049
34005
|
) })
|
|
34050
34006
|
] }, member.id)),
|
|
34051
|
-
members.map((member) => /* @__PURE__ */ (0,
|
|
34052
|
-
/* @__PURE__ */ (0,
|
|
34007
|
+
members.map((member) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(TableRow, { children: [
|
|
34008
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
34053
34009
|
AccountOrGroupText,
|
|
34054
34010
|
{
|
|
34055
34011
|
coId: member.id,
|
|
@@ -34060,18 +34016,18 @@ function GroupView({
|
|
|
34060
34016
|
}
|
|
34061
34017
|
}
|
|
34062
34018
|
) }),
|
|
34063
|
-
/* @__PURE__ */ (0,
|
|
34064
|
-
/* @__PURE__ */ (0,
|
|
34019
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableCell, { children: member.role }),
|
|
34020
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableCell, { children: member.role !== "revoked" && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
34065
34021
|
Button,
|
|
34066
34022
|
{
|
|
34067
34023
|
variant: "secondary",
|
|
34068
34024
|
onClick: () => onRemoveMember(member.id),
|
|
34069
|
-
children: /* @__PURE__ */ (0,
|
|
34025
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, { name: "delete" })
|
|
34070
34026
|
}
|
|
34071
34027
|
) })
|
|
34072
34028
|
] }, member.id)),
|
|
34073
|
-
parentGroups.map((group) => /* @__PURE__ */ (0,
|
|
34074
|
-
/* @__PURE__ */ (0,
|
|
34029
|
+
parentGroups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(TableRow, { children: [
|
|
34030
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
34075
34031
|
AccountOrGroupText,
|
|
34076
34032
|
{
|
|
34077
34033
|
coId: group.id,
|
|
@@ -34082,19 +34038,19 @@ function GroupView({
|
|
|
34082
34038
|
}
|
|
34083
34039
|
}
|
|
34084
34040
|
) }),
|
|
34085
|
-
/* @__PURE__ */ (0,
|
|
34086
|
-
/* @__PURE__ */ (0,
|
|
34041
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableCell, { children: group.role }),
|
|
34042
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableCell, { children: group.role !== "revoked" && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
34087
34043
|
Button,
|
|
34088
34044
|
{
|
|
34089
34045
|
variant: "secondary",
|
|
34090
34046
|
onClick: () => onRemoveGroup(group.id),
|
|
34091
|
-
children: /* @__PURE__ */ (0,
|
|
34047
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, { name: "delete" })
|
|
34092
34048
|
}
|
|
34093
34049
|
) })
|
|
34094
34050
|
] }, group.id))
|
|
34095
34051
|
] })
|
|
34096
34052
|
] }),
|
|
34097
|
-
/* @__PURE__ */ (0,
|
|
34053
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
34098
34054
|
"div",
|
|
34099
34055
|
{
|
|
34100
34056
|
style: {
|
|
@@ -34104,14 +34060,14 @@ function GroupView({
|
|
|
34104
34060
|
marginTop: "1rem"
|
|
34105
34061
|
},
|
|
34106
34062
|
children: [
|
|
34107
|
-
/* @__PURE__ */ (0,
|
|
34108
|
-
/* @__PURE__ */ (0,
|
|
34063
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Button, { variant: "primary", onClick: () => setAddMemberType("account"), children: "Add Account" }),
|
|
34064
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Button, { variant: "primary", onClick: () => setAddMemberType("group"), children: "Add Group" })
|
|
34109
34065
|
]
|
|
34110
34066
|
}
|
|
34111
34067
|
),
|
|
34112
|
-
childGroups.length > 0 && /* @__PURE__ */ (0,
|
|
34113
|
-
/* @__PURE__ */ (0,
|
|
34114
|
-
/* @__PURE__ */ (0,
|
|
34068
|
+
childGroups.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Table, { children: [
|
|
34069
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableHeader, { children: "Member of" }) }) }),
|
|
34070
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableBody, { children: childGroups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
34115
34071
|
AccountOrGroupText,
|
|
34116
34072
|
{
|
|
34117
34073
|
coId: group.id,
|
|
@@ -34123,20 +34079,20 @@ function GroupView({
|
|
|
34123
34079
|
}
|
|
34124
34080
|
) }) }, group.id)) })
|
|
34125
34081
|
] }),
|
|
34126
|
-
/* @__PURE__ */ (0,
|
|
34127
|
-
/* @__PURE__ */ (0,
|
|
34082
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(RawDataCard, { data }),
|
|
34083
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
34128
34084
|
Modal,
|
|
34129
34085
|
{
|
|
34130
34086
|
isOpen: addMemberType !== null,
|
|
34131
34087
|
onClose: () => setAddMemberType(null),
|
|
34132
34088
|
heading: addMemberType === "account" ? "Add Account" : "Add Group",
|
|
34133
34089
|
showButtons: false,
|
|
34134
|
-
children: /* @__PURE__ */ (0,
|
|
34090
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("form", { onSubmit: handleAddMemberSubmit, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
34135
34091
|
"div",
|
|
34136
34092
|
{
|
|
34137
34093
|
style: { display: "flex", flexDirection: "column", gap: "1rem" },
|
|
34138
34094
|
children: [
|
|
34139
|
-
/* @__PURE__ */ (0,
|
|
34095
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
34140
34096
|
Input,
|
|
34141
34097
|
{
|
|
34142
34098
|
name: "memberId",
|
|
@@ -34145,13 +34101,13 @@ function GroupView({
|
|
|
34145
34101
|
required: true
|
|
34146
34102
|
}
|
|
34147
34103
|
),
|
|
34148
|
-
/* @__PURE__ */ (0,
|
|
34149
|
-
/* @__PURE__ */ (0,
|
|
34150
|
-
/* @__PURE__ */ (0,
|
|
34151
|
-
/* @__PURE__ */ (0,
|
|
34152
|
-
addMemberType === "account" ? /* @__PURE__ */ (0,
|
|
34104
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Select, { name: "role", label: "Role", children: [
|
|
34105
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("option", { value: "reader", children: "Reader" }),
|
|
34106
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("option", { value: "writer", children: "Writer" }),
|
|
34107
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("option", { value: "admin", children: "Admin" }),
|
|
34108
|
+
addMemberType === "account" ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_jsx_runtime29.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("option", { value: "writeOnly", children: "Write Only" }) }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_jsx_runtime29.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("option", { value: "inherit", children: "Inherit" }) })
|
|
34153
34109
|
] }),
|
|
34154
|
-
/* @__PURE__ */ (0,
|
|
34110
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
34155
34111
|
"div",
|
|
34156
34112
|
{
|
|
34157
34113
|
style: {
|
|
@@ -34161,7 +34117,7 @@ function GroupView({
|
|
|
34161
34117
|
marginTop: "0.5rem"
|
|
34162
34118
|
},
|
|
34163
34119
|
children: [
|
|
34164
|
-
/* @__PURE__ */ (0,
|
|
34120
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
34165
34121
|
Button,
|
|
34166
34122
|
{
|
|
34167
34123
|
type: "button",
|
|
@@ -34170,7 +34126,7 @@ function GroupView({
|
|
|
34170
34126
|
children: "Cancel"
|
|
34171
34127
|
}
|
|
34172
34128
|
),
|
|
34173
|
-
/* @__PURE__ */ (0,
|
|
34129
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Button, { type: "submit", variant: "primary", children: "Add" })
|
|
34174
34130
|
]
|
|
34175
34131
|
}
|
|
34176
34132
|
)
|
|
@@ -34183,7 +34139,7 @@ function GroupView({
|
|
|
34183
34139
|
}
|
|
34184
34140
|
|
|
34185
34141
|
// src/inspector/viewer/role-display.tsx
|
|
34186
|
-
var
|
|
34142
|
+
var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
|
|
34187
34143
|
function RoleDisplay({
|
|
34188
34144
|
node,
|
|
34189
34145
|
value
|
|
@@ -34202,24 +34158,24 @@ function RoleDisplay({
|
|
|
34202
34158
|
} else {
|
|
34203
34159
|
role = "unauthorized";
|
|
34204
34160
|
}
|
|
34205
|
-
return /* @__PURE__ */ (0,
|
|
34161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { children: [
|
|
34206
34162
|
"Role: ",
|
|
34207
34163
|
role
|
|
34208
34164
|
] });
|
|
34209
34165
|
}
|
|
34210
34166
|
|
|
34211
34167
|
// src/inspector/viewer/table-viewer.tsx
|
|
34212
|
-
var
|
|
34213
|
-
import { styled as
|
|
34214
|
-
var
|
|
34215
|
-
var PaginationContainer =
|
|
34168
|
+
var import_react18 = __toESM(require_react(), 1);
|
|
34169
|
+
import { styled as styled18 } from "goober";
|
|
34170
|
+
var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
|
|
34171
|
+
var PaginationContainer = styled18("div")`
|
|
34216
34172
|
padding: 1rem 0;
|
|
34217
34173
|
display: flex;
|
|
34218
34174
|
align-items: center;
|
|
34219
34175
|
justify-content: space-between;
|
|
34220
34176
|
gap: 0.5rem;
|
|
34221
34177
|
`;
|
|
34222
|
-
var RedTooltip =
|
|
34178
|
+
var RedTooltip = styled18("span")`
|
|
34223
34179
|
position:relative; /* making the .tooltip span a container for the tooltip text */
|
|
34224
34180
|
border-bottom:1px dashed #000; /* little indicater to indicate it's hoverable */
|
|
34225
34181
|
|
|
@@ -34256,8 +34212,8 @@ function CoValuesTableView({
|
|
|
34256
34212
|
onNavigate,
|
|
34257
34213
|
onRemove
|
|
34258
34214
|
}) {
|
|
34259
|
-
const [visibleRowsCount, setVisibleRowsCount] = (0,
|
|
34260
|
-
const [coIdArray, visibleRows] = (0,
|
|
34215
|
+
const [visibleRowsCount, setVisibleRowsCount] = (0, import_react18.useState)(10);
|
|
34216
|
+
const [coIdArray, visibleRows] = (0, import_react18.useMemo)(() => {
|
|
34261
34217
|
const coIdArray2 = Array.isArray(data) ? data : Object.values(data).every((k) => typeof k === "string" && isCoId(k)) ? Object.values(data).map((k) => k) : [];
|
|
34262
34218
|
const visibleRows2 = coIdArray2.slice(0, visibleRowsCount);
|
|
34263
34219
|
return [coIdArray2, visibleRows2];
|
|
@@ -34265,10 +34221,10 @@ function CoValuesTableView({
|
|
|
34265
34221
|
const resolvedRows = useResolvedCoValues(visibleRows, node);
|
|
34266
34222
|
const hasMore = visibleRowsCount < coIdArray.length;
|
|
34267
34223
|
if (!coIdArray.length) {
|
|
34268
|
-
return /* @__PURE__ */ (0,
|
|
34224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { children: "No data to display" });
|
|
34269
34225
|
}
|
|
34270
34226
|
if (resolvedRows.length === 0) {
|
|
34271
|
-
return /* @__PURE__ */ (0,
|
|
34227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { children: "Loading..." });
|
|
34272
34228
|
}
|
|
34273
34229
|
const keys = Array.from(
|
|
34274
34230
|
new Set(
|
|
@@ -34278,15 +34234,15 @@ function CoValuesTableView({
|
|
|
34278
34234
|
const loadMore = () => {
|
|
34279
34235
|
setVisibleRowsCount((prevVisibleRows) => prevVisibleRows + 10);
|
|
34280
34236
|
};
|
|
34281
|
-
return /* @__PURE__ */ (0,
|
|
34282
|
-
/* @__PURE__ */ (0,
|
|
34283
|
-
/* @__PURE__ */ (0,
|
|
34284
|
-
["ID", ...keys, "Action"].map((key) => /* @__PURE__ */ (0,
|
|
34285
|
-
onRemove && /* @__PURE__ */ (0,
|
|
34237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
34238
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Table, { children: [
|
|
34239
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(TableRow, { children: [
|
|
34240
|
+
["ID", ...keys, "Action"].map((key) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TableHeader, { children: key }, key)),
|
|
34241
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TableHeader, {})
|
|
34286
34242
|
] }) }),
|
|
34287
|
-
/* @__PURE__ */ (0,
|
|
34288
|
-
/* @__PURE__ */ (0,
|
|
34289
|
-
/* @__PURE__ */ (0,
|
|
34243
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TableBody, { children: resolvedRows.slice(0, visibleRowsCount).map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(TableRow, { children: [
|
|
34244
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { mono: true, children: item.snapshot === "unavailable" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(RedTooltip, { "data-text": "Unavailable", children: [
|
|
34245
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
34290
34246
|
Icon,
|
|
34291
34247
|
{
|
|
34292
34248
|
name: "caution",
|
|
@@ -34299,7 +34255,7 @@ function CoValuesTableView({
|
|
|
34299
34255
|
),
|
|
34300
34256
|
visibleRows[index]
|
|
34301
34257
|
] }) : visibleRows[index] }) }),
|
|
34302
|
-
keys.map((key) => /* @__PURE__ */ (0,
|
|
34258
|
+
keys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TableCell, { children: item.snapshot !== "unavailable" && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
34303
34259
|
ValueRenderer,
|
|
34304
34260
|
{
|
|
34305
34261
|
json: item.snapshot[key],
|
|
@@ -34320,7 +34276,7 @@ function CoValuesTableView({
|
|
|
34320
34276
|
}
|
|
34321
34277
|
}
|
|
34322
34278
|
) }, key)),
|
|
34323
|
-
/* @__PURE__ */ (0,
|
|
34279
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
34324
34280
|
Button,
|
|
34325
34281
|
{
|
|
34326
34282
|
variant: "secondary",
|
|
@@ -34333,18 +34289,18 @@ function CoValuesTableView({
|
|
|
34333
34289
|
children: "View"
|
|
34334
34290
|
}
|
|
34335
34291
|
) }),
|
|
34336
|
-
onRemove && /* @__PURE__ */ (0,
|
|
34292
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Button, { variant: "secondary", onClick: () => onRemove(index), children: "Remove" }) })
|
|
34337
34293
|
] }, index)) })
|
|
34338
34294
|
] }),
|
|
34339
|
-
/* @__PURE__ */ (0,
|
|
34340
|
-
/* @__PURE__ */ (0,
|
|
34295
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(PaginationContainer, { children: [
|
|
34296
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Text, { muted: true, small: true, children: [
|
|
34341
34297
|
"Showing ",
|
|
34342
34298
|
Math.min(visibleRowsCount, coIdArray.length),
|
|
34343
34299
|
" of",
|
|
34344
34300
|
" ",
|
|
34345
34301
|
coIdArray.length
|
|
34346
34302
|
] }),
|
|
34347
|
-
hasMore && /* @__PURE__ */ (0,
|
|
34303
|
+
hasMore && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Button, { variant: "secondary", onClick: loadMore, children: "Load more" })
|
|
34348
34304
|
] })
|
|
34349
34305
|
] });
|
|
34350
34306
|
}
|
|
@@ -34354,11 +34310,11 @@ function TableView({
|
|
|
34354
34310
|
onNavigate,
|
|
34355
34311
|
onRemove
|
|
34356
34312
|
}) {
|
|
34357
|
-
const isListOfCoValues = (0,
|
|
34313
|
+
const isListOfCoValues = (0, import_react18.useMemo)(() => {
|
|
34358
34314
|
return Array.isArray(data) && data.every((k) => isCoId(k));
|
|
34359
34315
|
}, [data]);
|
|
34360
34316
|
if (isListOfCoValues) {
|
|
34361
|
-
return /* @__PURE__ */ (0,
|
|
34317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
34362
34318
|
CoValuesTableView,
|
|
34363
34319
|
{
|
|
34364
34320
|
data,
|
|
@@ -34368,62 +34324,74 @@ function TableView({
|
|
|
34368
34324
|
}
|
|
34369
34325
|
);
|
|
34370
34326
|
}
|
|
34371
|
-
return /* @__PURE__ */ (0,
|
|
34372
|
-
/* @__PURE__ */ (0,
|
|
34373
|
-
/* @__PURE__ */ (0,
|
|
34374
|
-
/* @__PURE__ */ (0,
|
|
34375
|
-
onRemove && /* @__PURE__ */ (0,
|
|
34327
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Table, { children: [
|
|
34328
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(TableRow, { children: [
|
|
34329
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TableHeader, { style: { width: "5rem" }, children: "Index" }),
|
|
34330
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TableHeader, { children: "Value" }),
|
|
34331
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TableHeader, { children: "Action" })
|
|
34376
34332
|
] }) }),
|
|
34377
|
-
/* @__PURE__ */ (0,
|
|
34378
|
-
/* @__PURE__ */ (0,
|
|
34379
|
-
/* @__PURE__ */ (0,
|
|
34380
|
-
onRemove && /* @__PURE__ */ (0,
|
|
34333
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TableBody, { children: Array.isArray(data) && data?.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(TableRow, { children: [
|
|
34334
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { mono: true, children: index }) }),
|
|
34335
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ValueRenderer, { json: value }) }),
|
|
34336
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Button, { variant: "secondary", onClick: () => onRemove(index), children: "Remove" }) })
|
|
34381
34337
|
] }, index)) })
|
|
34382
34338
|
] });
|
|
34383
34339
|
}
|
|
34384
34340
|
|
|
34385
34341
|
// src/inspector/viewer/history-view.tsx
|
|
34386
|
-
var
|
|
34387
|
-
import { styled as
|
|
34342
|
+
var import_react19 = __toESM(require_react(), 1);
|
|
34343
|
+
import { styled as styled19 } from "goober";
|
|
34388
34344
|
|
|
34389
34345
|
// src/inspector/utils/transactions-changes.ts
|
|
34390
|
-
var isGroupExtension = (change) => {
|
|
34346
|
+
var isGroupExtension = (coValue, change) => {
|
|
34347
|
+
if (coValue.core.isGroup() === false) return false;
|
|
34391
34348
|
return change?.op === "set" && change?.value === "extend";
|
|
34392
34349
|
};
|
|
34393
|
-
var isGroupExtendRevocation = (change) => {
|
|
34350
|
+
var isGroupExtendRevocation = (coValue, change) => {
|
|
34351
|
+
if (coValue.core.isGroup() === false) return false;
|
|
34394
34352
|
return change?.op === "set" && change?.value === "revoked";
|
|
34395
34353
|
};
|
|
34396
|
-
var isGroupPromotion = (change) => {
|
|
34354
|
+
var isGroupPromotion = (coValue, change) => {
|
|
34355
|
+
if (coValue.core.isGroup() === false) return false;
|
|
34397
34356
|
return change?.op === "set" && change?.key.startsWith("parent_co_");
|
|
34398
34357
|
};
|
|
34399
|
-
var isUserPromotion = (change) => {
|
|
34358
|
+
var isUserPromotion = (coValue, change) => {
|
|
34359
|
+
if (coValue.core.isGroup() === false) return false;
|
|
34400
34360
|
return change?.op === "set" && (isCoId(change?.key) || change?.key === "everyone");
|
|
34401
34361
|
};
|
|
34402
|
-
var isKeyRevelation = (change) => {
|
|
34362
|
+
var isKeyRevelation = (coValue, change) => {
|
|
34363
|
+
if (coValue.core.isGroup() === false && coValue.headerMeta?.type !== "account")
|
|
34364
|
+
return false;
|
|
34403
34365
|
return change?.op === "set" && change?.key.includes("_for_");
|
|
34404
34366
|
};
|
|
34405
|
-
var isPropertySet = (change) => {
|
|
34367
|
+
var isPropertySet = (coValue, change) => {
|
|
34406
34368
|
return change?.op === "set" && "key" in change && "value" in change;
|
|
34407
34369
|
};
|
|
34408
|
-
var isPropertyDeletion = (change) => {
|
|
34370
|
+
var isPropertyDeletion = (coValue, change) => {
|
|
34409
34371
|
return change?.op === "del" && "key" in change;
|
|
34410
34372
|
};
|
|
34411
|
-
var isItemAppend = (change) => {
|
|
34373
|
+
var isItemAppend = (coValue, change) => {
|
|
34374
|
+
if (coValue.type !== "colist" && coValue.type !== "coplaintext") return false;
|
|
34412
34375
|
return change?.op === "app" && "after" in change && "value" in change;
|
|
34413
34376
|
};
|
|
34414
|
-
var isItemPrepend = (change) => {
|
|
34377
|
+
var isItemPrepend = (coValue, change) => {
|
|
34378
|
+
if (coValue.type !== "colist" && coValue.type !== "coplaintext") return false;
|
|
34415
34379
|
return change?.op === "pre" && "before" in change && "value" in change;
|
|
34416
34380
|
};
|
|
34417
|
-
var isItemDeletion = (change) => {
|
|
34381
|
+
var isItemDeletion = (coValue, change) => {
|
|
34382
|
+
if (coValue.type !== "colist" && coValue.type !== "coplaintext") return false;
|
|
34418
34383
|
return change?.op === "del" && "insertion" in change;
|
|
34419
34384
|
};
|
|
34420
|
-
var isStreamStart = (change) => {
|
|
34385
|
+
var isStreamStart = (coValue, change) => {
|
|
34386
|
+
if (coValue.type !== "coStream") return false;
|
|
34421
34387
|
return change?.type === "start" && "mimeType" in change;
|
|
34422
34388
|
};
|
|
34423
|
-
var isStreamChunk = (change) => {
|
|
34389
|
+
var isStreamChunk = (coValue, change) => {
|
|
34390
|
+
if (coValue.type !== "coStream") return false;
|
|
34424
34391
|
return change?.type === "chunk" && "chunk" in change;
|
|
34425
34392
|
};
|
|
34426
|
-
var isStreamEnd = (change) => {
|
|
34393
|
+
var isStreamEnd = (coValue, change) => {
|
|
34394
|
+
if (coValue.type !== "coStream") return false;
|
|
34427
34395
|
return change?.type === "end";
|
|
34428
34396
|
};
|
|
34429
34397
|
|
|
@@ -34455,8 +34423,8 @@ function getTransactionChanges(tx, coValue) {
|
|
|
34455
34423
|
if (isCoPlainText(coValue)) {
|
|
34456
34424
|
if (tx.changes === void 0 || tx.changes.length === 0) return [];
|
|
34457
34425
|
const firstChange = tx.changes[0];
|
|
34458
|
-
if (isItemAppend(firstChange) && tx.changes.every(
|
|
34459
|
-
(c) => isItemAppend(c) && areSameOpIds(c.after, firstChange.after)
|
|
34426
|
+
if (isItemAppend(coValue, firstChange) && tx.changes.every(
|
|
34427
|
+
(c) => isItemAppend(coValue, c) && areSameOpIds(c.after, firstChange.after)
|
|
34460
34428
|
)) {
|
|
34461
34429
|
const changes = tx.changes;
|
|
34462
34430
|
if (firstChange.after !== "start") {
|
|
@@ -34470,8 +34438,8 @@ function getTransactionChanges(tx, coValue) {
|
|
|
34470
34438
|
}
|
|
34471
34439
|
];
|
|
34472
34440
|
}
|
|
34473
|
-
if (isItemPrepend(firstChange) && tx.changes.every(
|
|
34474
|
-
(c) => isItemPrepend(c) && areSameOpIds(c.before, firstChange.before)
|
|
34441
|
+
if (isItemPrepend(coValue, firstChange) && tx.changes.every(
|
|
34442
|
+
(c) => isItemPrepend(coValue, c) && areSameOpIds(c.before, firstChange.before)
|
|
34475
34443
|
)) {
|
|
34476
34444
|
const changes = tx.changes;
|
|
34477
34445
|
if (firstChange.before !== "end") {
|
|
@@ -34485,7 +34453,7 @@ function getTransactionChanges(tx, coValue) {
|
|
|
34485
34453
|
}
|
|
34486
34454
|
];
|
|
34487
34455
|
}
|
|
34488
|
-
if (isItemDeletion(firstChange) && tx.changes.every((c) => isItemDeletion(c))) {
|
|
34456
|
+
if (isItemDeletion(coValue, firstChange) && tx.changes.every((c) => isItemDeletion(coValue, c))) {
|
|
34489
34457
|
let changesAreConsecutive2 = function(changes) {
|
|
34490
34458
|
if (changes.length < 2) return false;
|
|
34491
34459
|
const mapping = coValueBeforeDeletions.mapping.idxAfterOpID;
|
|
@@ -34562,12 +34530,12 @@ function restoreCoMapToTimestamp(coValue, timestamp, removeUnknownProperties) {
|
|
|
34562
34530
|
}
|
|
34563
34531
|
|
|
34564
34532
|
// src/inspector/viewer/history-view.tsx
|
|
34565
|
-
var
|
|
34533
|
+
var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
|
|
34566
34534
|
function HistoryView({
|
|
34567
34535
|
coValue,
|
|
34568
34536
|
node
|
|
34569
34537
|
}) {
|
|
34570
|
-
const transactions = (0,
|
|
34538
|
+
const transactions = (0, import_react19.useMemo)(
|
|
34571
34539
|
() => getHistory(coValue),
|
|
34572
34540
|
[coValue.core.verifiedTransactions.length]
|
|
34573
34541
|
);
|
|
@@ -34575,8 +34543,8 @@ function HistoryView({
|
|
|
34575
34543
|
{
|
|
34576
34544
|
id: "author",
|
|
34577
34545
|
header: "Author",
|
|
34578
|
-
accessor: (row) => /* @__PURE__ */ (0,
|
|
34579
|
-
row.isValid || /* @__PURE__ */ (0,
|
|
34546
|
+
accessor: (row) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
34547
|
+
row.isValid || /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(RedTooltip2, { "data-text": "This transaction is invalid and is not used", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
34580
34548
|
Icon,
|
|
34581
34549
|
{
|
|
34582
34550
|
name: "caution",
|
|
@@ -34589,7 +34557,7 @@ function HistoryView({
|
|
|
34589
34557
|
}
|
|
34590
34558
|
}
|
|
34591
34559
|
) }),
|
|
34592
|
-
row.author.startsWith("co_") ? /* @__PURE__ */ (0,
|
|
34560
|
+
row.author.startsWith("co_") ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
34593
34561
|
AccountOrGroupText,
|
|
34594
34562
|
{
|
|
34595
34563
|
coId: row.author,
|
|
@@ -34608,9 +34576,9 @@ function HistoryView({
|
|
|
34608
34576
|
header: "Action",
|
|
34609
34577
|
accessor: (row) => {
|
|
34610
34578
|
if (row.isValid) return row.action;
|
|
34611
|
-
return /* @__PURE__ */ (0,
|
|
34579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
34612
34580
|
row.action,
|
|
34613
|
-
/* @__PURE__ */ (0,
|
|
34581
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { style: { color: "red", display: "block" }, children: [
|
|
34614
34582
|
"Invalid transaction: ",
|
|
34615
34583
|
row.validationErrorMessage
|
|
34616
34584
|
] })
|
|
@@ -34629,7 +34597,7 @@ function HistoryView({
|
|
|
34629
34597
|
sortFn: (a, b) => a.timestamp.getTime() - b.timestamp.getTime()
|
|
34630
34598
|
}
|
|
34631
34599
|
];
|
|
34632
|
-
return /* @__PURE__ */ (0,
|
|
34600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Accordion, { title: "CoValue history", storageKey: "jazz-inspector-show-history", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
34633
34601
|
DataTable,
|
|
34634
34602
|
{
|
|
34635
34603
|
columns,
|
|
@@ -34655,29 +34623,29 @@ function getHistory(coValue) {
|
|
|
34655
34623
|
});
|
|
34656
34624
|
}
|
|
34657
34625
|
function mapTransactionToAction(change, coValue) {
|
|
34658
|
-
if (isUserPromotion(change)) {
|
|
34626
|
+
if (isUserPromotion(coValue, change)) {
|
|
34659
34627
|
if (change.value === "revoked") {
|
|
34660
34628
|
return `${change.key} has been revoked`;
|
|
34661
34629
|
}
|
|
34662
34630
|
return `${change.key} has been promoted to ${change.value}`;
|
|
34663
34631
|
}
|
|
34664
|
-
if (isGroupExtension(change)) {
|
|
34632
|
+
if (isGroupExtension(coValue, change)) {
|
|
34665
34633
|
const child = change.key.slice(6);
|
|
34666
34634
|
return `Group became a member of ${child}`;
|
|
34667
34635
|
}
|
|
34668
|
-
if (isGroupExtendRevocation(change)) {
|
|
34636
|
+
if (isGroupExtendRevocation(coValue, change)) {
|
|
34669
34637
|
const child = change.key.slice(6);
|
|
34670
34638
|
return `Group's membership of ${child} has been revoked.`;
|
|
34671
34639
|
}
|
|
34672
|
-
if (isGroupPromotion(change)) {
|
|
34640
|
+
if (isGroupPromotion(coValue, change)) {
|
|
34673
34641
|
const parent = change.key.slice(7);
|
|
34674
34642
|
return `Group ${parent} has been promoted to ${change.value}`;
|
|
34675
34643
|
}
|
|
34676
|
-
if (isKeyRevelation(change)) {
|
|
34644
|
+
if (isKeyRevelation(coValue, change)) {
|
|
34677
34645
|
const [key, target] = change.key.split("_for_");
|
|
34678
34646
|
return `Key "${key}" has been revealed to "${target}"`;
|
|
34679
34647
|
}
|
|
34680
|
-
if (isItemAppend(change)) {
|
|
34648
|
+
if (isItemAppend(coValue, change)) {
|
|
34681
34649
|
if (change.after === "start") {
|
|
34682
34650
|
return `"${change.value}" has been appended`;
|
|
34683
34651
|
}
|
|
@@ -34687,7 +34655,7 @@ function mapTransactionToAction(change, coValue) {
|
|
|
34687
34655
|
}
|
|
34688
34656
|
return `"${change.value}" has been inserted after "${after.value}"`;
|
|
34689
34657
|
}
|
|
34690
|
-
if (isItemPrepend(change)) {
|
|
34658
|
+
if (isItemPrepend(coValue, change)) {
|
|
34691
34659
|
if (change.before === "end") {
|
|
34692
34660
|
return `"${change.value}" has been prepended`;
|
|
34693
34661
|
}
|
|
@@ -34697,26 +34665,26 @@ function mapTransactionToAction(change, coValue) {
|
|
|
34697
34665
|
}
|
|
34698
34666
|
return `"${change.value}" has been inserted before "${before.value}"`;
|
|
34699
34667
|
}
|
|
34700
|
-
if (isItemDeletion(change)) {
|
|
34668
|
+
if (isItemDeletion(coValue, change)) {
|
|
34701
34669
|
const insertion = findListChange(change.insertion, coValue);
|
|
34702
34670
|
if (insertion === void 0) {
|
|
34703
34671
|
return `An undefined item has been deleted`;
|
|
34704
34672
|
}
|
|
34705
34673
|
return `"${insertion.value}" has been deleted`;
|
|
34706
34674
|
}
|
|
34707
|
-
if (isStreamStart(change)) {
|
|
34675
|
+
if (isStreamStart(coValue, change)) {
|
|
34708
34676
|
return `Stream started with mime type "${change.mimeType}" and file name "${change.fileName}"`;
|
|
34709
34677
|
}
|
|
34710
|
-
if (isStreamChunk(change)) {
|
|
34678
|
+
if (isStreamChunk(coValue, change)) {
|
|
34711
34679
|
return `Stream chunk added`;
|
|
34712
34680
|
}
|
|
34713
|
-
if (isStreamEnd(change)) {
|
|
34681
|
+
if (isStreamEnd(coValue, change)) {
|
|
34714
34682
|
return `Stream ended`;
|
|
34715
34683
|
}
|
|
34716
|
-
if (isPropertySet(change)) {
|
|
34684
|
+
if (isPropertySet(coValue, change)) {
|
|
34717
34685
|
return `Property "${change.key}" has been set to ${JSON.stringify(change.value)}`;
|
|
34718
34686
|
}
|
|
34719
|
-
if (isPropertyDeletion(change)) {
|
|
34687
|
+
if (isPropertyDeletion(coValue, change)) {
|
|
34720
34688
|
return `Property "${change.key}" has been deleted`;
|
|
34721
34689
|
}
|
|
34722
34690
|
if (change.op === "custom") {
|
|
@@ -34729,7 +34697,7 @@ var findListChange = (opId, coValue) => {
|
|
|
34729
34697
|
(tx) => tx.txID.sessionID === opId.sessionID && tx.txID.txIndex === opId.txIndex
|
|
34730
34698
|
)?.changes?.[opId.changeIdx];
|
|
34731
34699
|
};
|
|
34732
|
-
var RedTooltip2 =
|
|
34700
|
+
var RedTooltip2 = styled19("span")`
|
|
34733
34701
|
position:relative; /* making the .tooltip span a container for the tooltip text */
|
|
34734
34702
|
border-bottom:1px dashed #000; /* little indicater to indicate it's hoverable */
|
|
34735
34703
|
|
|
@@ -34762,17 +34730,17 @@ var RedTooltip2 = styled20("span")`
|
|
|
34762
34730
|
`;
|
|
34763
34731
|
|
|
34764
34732
|
// src/inspector/viewer/co-map-view.tsx
|
|
34765
|
-
var
|
|
34766
|
-
import { styled as
|
|
34767
|
-
var
|
|
34733
|
+
var import_react20 = __toESM(require_react(), 1);
|
|
34734
|
+
import { styled as styled20 } from "goober";
|
|
34735
|
+
var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
|
|
34768
34736
|
function CoMapView({
|
|
34769
34737
|
coValue,
|
|
34770
34738
|
data,
|
|
34771
34739
|
node,
|
|
34772
34740
|
onNavigate
|
|
34773
34741
|
}) {
|
|
34774
|
-
return /* @__PURE__ */ (0,
|
|
34775
|
-
/* @__PURE__ */ (0,
|
|
34742
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
34743
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
34776
34744
|
GridView,
|
|
34777
34745
|
{
|
|
34778
34746
|
data,
|
|
@@ -34781,8 +34749,8 @@ function CoMapView({
|
|
|
34781
34749
|
coValue
|
|
34782
34750
|
}
|
|
34783
34751
|
),
|
|
34784
|
-
/* @__PURE__ */ (0,
|
|
34785
|
-
/* @__PURE__ */ (0,
|
|
34752
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
|
|
34753
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
34786
34754
|
AddPropertyModal,
|
|
34787
34755
|
{
|
|
34788
34756
|
disabled: !isWriter(coValue.group.myRole()),
|
|
@@ -34791,7 +34759,7 @@ function CoMapView({
|
|
|
34791
34759
|
}
|
|
34792
34760
|
),
|
|
34793
34761
|
" ",
|
|
34794
|
-
/* @__PURE__ */ (0,
|
|
34762
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(RestoreSnapshotModal, { coValue })
|
|
34795
34763
|
] })
|
|
34796
34764
|
] });
|
|
34797
34765
|
}
|
|
@@ -34800,8 +34768,8 @@ function AddPropertyModal({
|
|
|
34800
34768
|
node,
|
|
34801
34769
|
disabled
|
|
34802
34770
|
}) {
|
|
34803
|
-
const [isAddPropertyModalOpen, setIsAddPropertyModalOpen] = (0,
|
|
34804
|
-
const [propertyName, setPropertyName] = (0,
|
|
34771
|
+
const [isAddPropertyModalOpen, setIsAddPropertyModalOpen] = (0, import_react20.useState)(false);
|
|
34772
|
+
const [propertyName, setPropertyName] = (0, import_react20.useState)("");
|
|
34805
34773
|
const openAddPropertyModal = () => {
|
|
34806
34774
|
setIsAddPropertyModalOpen(true);
|
|
34807
34775
|
setPropertyName("");
|
|
@@ -34810,18 +34778,18 @@ function AddPropertyModal({
|
|
|
34810
34778
|
setIsAddPropertyModalOpen(false);
|
|
34811
34779
|
setPropertyName("");
|
|
34812
34780
|
};
|
|
34813
|
-
return /* @__PURE__ */ (0,
|
|
34814
|
-
/* @__PURE__ */ (0,
|
|
34781
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
34782
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
34815
34783
|
Button,
|
|
34816
34784
|
{
|
|
34817
34785
|
title: "Add Property",
|
|
34818
34786
|
variant: "secondary",
|
|
34819
34787
|
disabled,
|
|
34820
34788
|
onClick: openAddPropertyModal,
|
|
34821
|
-
children: /* @__PURE__ */ (0,
|
|
34789
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Icon, { name: "add" })
|
|
34822
34790
|
}
|
|
34823
34791
|
),
|
|
34824
|
-
/* @__PURE__ */ (0,
|
|
34792
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
34825
34793
|
Modal,
|
|
34826
34794
|
{
|
|
34827
34795
|
isOpen: isAddPropertyModalOpen,
|
|
@@ -34829,7 +34797,7 @@ function AddPropertyModal({
|
|
|
34829
34797
|
heading: "Add Property",
|
|
34830
34798
|
showButtons: false,
|
|
34831
34799
|
children: [
|
|
34832
|
-
/* @__PURE__ */ (0,
|
|
34800
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
34833
34801
|
Input,
|
|
34834
34802
|
{
|
|
34835
34803
|
label: "Property Name",
|
|
@@ -34838,7 +34806,7 @@ function AddPropertyModal({
|
|
|
34838
34806
|
placeholder: "Enter property name"
|
|
34839
34807
|
}
|
|
34840
34808
|
),
|
|
34841
|
-
propertyName && /* @__PURE__ */ (0,
|
|
34809
|
+
propertyName && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(EditorContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
34842
34810
|
CoValueEditor,
|
|
34843
34811
|
{
|
|
34844
34812
|
node,
|
|
@@ -34854,14 +34822,14 @@ function AddPropertyModal({
|
|
|
34854
34822
|
] });
|
|
34855
34823
|
}
|
|
34856
34824
|
function RestoreSnapshotModal({ coValue }) {
|
|
34857
|
-
const [isRestoreModalOpen, setIsRestoreModalOpen] = (0,
|
|
34858
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
34859
|
-
const [removeUnknownProperties, setRemoveUnknownProperties] = (0,
|
|
34860
|
-
const timestamps = (0,
|
|
34825
|
+
const [isRestoreModalOpen, setIsRestoreModalOpen] = (0, import_react20.useState)(false);
|
|
34826
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react20.useState)(-1);
|
|
34827
|
+
const [removeUnknownProperties, setRemoveUnknownProperties] = (0, import_react20.useState)(false);
|
|
34828
|
+
const timestamps = (0, import_react20.useMemo)(
|
|
34861
34829
|
() => coValue.core.verifiedTransactions.map((tx) => tx.madeAt),
|
|
34862
34830
|
[coValue.core.verifiedTransactions.length]
|
|
34863
34831
|
);
|
|
34864
|
-
const coMapAtSelectedIndex = (0,
|
|
34832
|
+
const coMapAtSelectedIndex = (0, import_react20.useMemo)(() => {
|
|
34865
34833
|
if (selectedIndex === -1) return null;
|
|
34866
34834
|
return coValue.atTime(timestamps[selectedIndex]).toJSON();
|
|
34867
34835
|
}, [coValue, timestamps, selectedIndex]);
|
|
@@ -34885,9 +34853,9 @@ function RestoreSnapshotModal({ coValue }) {
|
|
|
34885
34853
|
setIsRestoreModalOpen(false);
|
|
34886
34854
|
};
|
|
34887
34855
|
const canRestore = isWriter(coValue.group.myRole());
|
|
34888
|
-
return /* @__PURE__ */ (0,
|
|
34889
|
-
/* @__PURE__ */ (0,
|
|
34890
|
-
/* @__PURE__ */ (0,
|
|
34856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
34857
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Button, { title: "Timeline", variant: "secondary", onClick: openRestoreModal, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Icon, { name: "history" }) }),
|
|
34858
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
34891
34859
|
Modal,
|
|
34892
34860
|
{
|
|
34893
34861
|
isOpen: isRestoreModalOpen,
|
|
@@ -34899,10 +34867,10 @@ function RestoreSnapshotModal({ coValue }) {
|
|
|
34899
34867
|
onCancel: handleClose,
|
|
34900
34868
|
showButtons: timestamps.length > 1 && canRestore,
|
|
34901
34869
|
children: [
|
|
34902
|
-
timestamps.length > 1 && /* @__PURE__ */ (0,
|
|
34903
|
-
/* @__PURE__ */ (0,
|
|
34904
|
-
/* @__PURE__ */ (0,
|
|
34905
|
-
/* @__PURE__ */ (0,
|
|
34870
|
+
timestamps.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
34871
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(RangeContainer, { children: [
|
|
34872
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(RangeLabel, { children: "Select Timestamp" }),
|
|
34873
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
34906
34874
|
RangeInput,
|
|
34907
34875
|
{
|
|
34908
34876
|
type: "range",
|
|
@@ -34913,10 +34881,10 @@ function RestoreSnapshotModal({ coValue }) {
|
|
|
34913
34881
|
disabled: timestamps.length === 0
|
|
34914
34882
|
}
|
|
34915
34883
|
),
|
|
34916
|
-
/* @__PURE__ */ (0,
|
|
34884
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TimestampDisplay, { children: timestamps[selectedIndex] !== void 0 ? new Date(timestamps[selectedIndex]).toISOString() : "No timestamps available" })
|
|
34917
34885
|
] }),
|
|
34918
|
-
canRestore && /* @__PURE__ */ (0,
|
|
34919
|
-
/* @__PURE__ */ (0,
|
|
34886
|
+
canRestore && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(CheckboxContainer, { children: [
|
|
34887
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
34920
34888
|
CheckboxInput,
|
|
34921
34889
|
{
|
|
34922
34890
|
type: "checkbox",
|
|
@@ -34925,28 +34893,28 @@ function RestoreSnapshotModal({ coValue }) {
|
|
|
34925
34893
|
onChange: (e) => setRemoveUnknownProperties(e.target.checked)
|
|
34926
34894
|
}
|
|
34927
34895
|
),
|
|
34928
|
-
/* @__PURE__ */ (0,
|
|
34896
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CheckboxLabel, { htmlFor: "remove-unknown-properties", children: "Remove unknown properties (properties that don't exist in the selected snapshot)" })
|
|
34929
34897
|
] })
|
|
34930
34898
|
] }),
|
|
34931
|
-
timestamps.length > 0 && timestamps[selectedIndex] !== void 0 && /* @__PURE__ */ (0,
|
|
34932
|
-
/* @__PURE__ */ (0,
|
|
34933
|
-
/* @__PURE__ */ (0,
|
|
34899
|
+
timestamps.length > 0 && timestamps[selectedIndex] !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(PreviewSection, { children: [
|
|
34900
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(PreviewLabel, { children: "State at that time:" }),
|
|
34901
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(PreviewPre, { children: JSON.stringify(coMapAtSelectedIndex, null, 2) })
|
|
34934
34902
|
] }),
|
|
34935
|
-
timestamps.length < 2 && /* @__PURE__ */ (0,
|
|
34903
|
+
timestamps.length < 2 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { style: { color: "var(--j-text-color)" }, children: "At least 2 timestamps are required to restore a snapshot." })
|
|
34936
34904
|
]
|
|
34937
34905
|
}
|
|
34938
34906
|
)
|
|
34939
34907
|
] });
|
|
34940
34908
|
}
|
|
34941
|
-
var PreviewSection =
|
|
34909
|
+
var PreviewSection = styled20("div")`
|
|
34942
34910
|
margin-top: 1.5rem;
|
|
34943
34911
|
`;
|
|
34944
|
-
var PreviewLabel =
|
|
34912
|
+
var PreviewLabel = styled20("div")`
|
|
34945
34913
|
font-weight: 500;
|
|
34946
34914
|
margin-bottom: 0.5rem;
|
|
34947
34915
|
color: var(--j-text-color-strong);
|
|
34948
34916
|
`;
|
|
34949
|
-
var PreviewPre =
|
|
34917
|
+
var PreviewPre = styled20("pre")`
|
|
34950
34918
|
background-color: var(--j-foreground);
|
|
34951
34919
|
border: 1px solid var(--j-border-color);
|
|
34952
34920
|
border-radius: var(--j-radius-md);
|
|
@@ -34958,17 +34926,17 @@ var PreviewPre = styled21("pre")`
|
|
|
34958
34926
|
color: var(--j-text-color);
|
|
34959
34927
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
34960
34928
|
`;
|
|
34961
|
-
var RangeContainer =
|
|
34929
|
+
var RangeContainer = styled20("div")`
|
|
34962
34930
|
display: flex;
|
|
34963
34931
|
flex-direction: column;
|
|
34964
34932
|
gap: 0.75rem;
|
|
34965
34933
|
`;
|
|
34966
|
-
var RangeLabel =
|
|
34934
|
+
var RangeLabel = styled20("label")`
|
|
34967
34935
|
font-weight: 500;
|
|
34968
34936
|
color: var(--j-text-color-strong);
|
|
34969
34937
|
font-size: 0.875rem;
|
|
34970
34938
|
`;
|
|
34971
|
-
var RangeInput =
|
|
34939
|
+
var RangeInput = styled20("input")`
|
|
34972
34940
|
width: 100%;
|
|
34973
34941
|
height: 0.5rem;
|
|
34974
34942
|
border-radius: var(--j-radius-sm);
|
|
@@ -35005,7 +34973,7 @@ var RangeInput = styled21("input")`
|
|
|
35005
34973
|
cursor: not-allowed;
|
|
35006
34974
|
}
|
|
35007
34975
|
`;
|
|
35008
|
-
var TimestampDisplay =
|
|
34976
|
+
var TimestampDisplay = styled20("div")`
|
|
35009
34977
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
35010
34978
|
font-size: 0.875rem;
|
|
35011
34979
|
color: var(--j-text-color);
|
|
@@ -35015,35 +34983,35 @@ var TimestampDisplay = styled21("div")`
|
|
|
35015
34983
|
border-radius: var(--j-radius-md);
|
|
35016
34984
|
text-align: center;
|
|
35017
34985
|
`;
|
|
35018
|
-
var CheckboxContainer =
|
|
34986
|
+
var CheckboxContainer = styled20("div")`
|
|
35019
34987
|
display: flex;
|
|
35020
34988
|
align-items: flex-start;
|
|
35021
34989
|
gap: 0.5rem;
|
|
35022
34990
|
margin-top: 1rem;
|
|
35023
34991
|
`;
|
|
35024
|
-
var CheckboxInput =
|
|
34992
|
+
var CheckboxInput = styled20("input")`
|
|
35025
34993
|
width: 1rem;
|
|
35026
34994
|
height: 1rem;
|
|
35027
34995
|
margin-top: 0.125rem;
|
|
35028
34996
|
cursor: pointer;
|
|
35029
34997
|
accent-color: var(--j-primary-color);
|
|
35030
34998
|
`;
|
|
35031
|
-
var CheckboxLabel =
|
|
34999
|
+
var CheckboxLabel = styled20("label")`
|
|
35032
35000
|
font-size: 0.875rem;
|
|
35033
35001
|
color: var(--j-text-color);
|
|
35034
35002
|
cursor: pointer;
|
|
35035
35003
|
line-height: 1.25rem;
|
|
35036
35004
|
`;
|
|
35037
|
-
var EditorContainer =
|
|
35005
|
+
var EditorContainer = styled20("div")`
|
|
35038
35006
|
margin-top: 1rem;
|
|
35039
35007
|
`;
|
|
35040
35008
|
|
|
35041
35009
|
// src/inspector/viewer/page.tsx
|
|
35042
|
-
var
|
|
35043
|
-
var BasePageContainer =
|
|
35044
|
-
({ isTopLevel, ...rest }, ref) => /* @__PURE__ */ (0,
|
|
35010
|
+
var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
|
|
35011
|
+
var BasePageContainer = import_react21.default.forwardRef(
|
|
35012
|
+
({ isTopLevel, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { ref, ...rest })
|
|
35045
35013
|
);
|
|
35046
|
-
var PageContainer =
|
|
35014
|
+
var PageContainer = styled21(BasePageContainer)`
|
|
35047
35015
|
position: absolute;
|
|
35048
35016
|
z-index: 10;
|
|
35049
35017
|
inset: 0;
|
|
@@ -35051,36 +35019,36 @@ var PageContainer = styled22(BasePageContainer)`
|
|
|
35051
35019
|
height: 100%;
|
|
35052
35020
|
padding: 0 0.75rem;
|
|
35053
35021
|
`;
|
|
35054
|
-
var BackButton =
|
|
35022
|
+
var BackButton = styled21("div")`
|
|
35055
35023
|
position: absolute;
|
|
35056
35024
|
left: 0;
|
|
35057
35025
|
right: 0;
|
|
35058
35026
|
top: 0;
|
|
35059
35027
|
height: 2.5rem;
|
|
35060
35028
|
`;
|
|
35061
|
-
var HeaderContainer =
|
|
35029
|
+
var HeaderContainer = styled21("div")`
|
|
35062
35030
|
display: flex;
|
|
35063
35031
|
justify-content: space-between;
|
|
35064
35032
|
align-items: center;
|
|
35065
35033
|
margin-bottom: 1rem;
|
|
35066
35034
|
`;
|
|
35067
|
-
var TitleContainer =
|
|
35035
|
+
var TitleContainer = styled21("div")`
|
|
35068
35036
|
display: flex;
|
|
35069
35037
|
align-items: center;
|
|
35070
35038
|
gap: 0.75rem;
|
|
35071
35039
|
`;
|
|
35072
|
-
var Title =
|
|
35040
|
+
var Title = styled21(Heading)`
|
|
35073
35041
|
display: flex;
|
|
35074
35042
|
flex-direction: column;
|
|
35075
35043
|
align-items: flex-start;
|
|
35076
35044
|
gap: 0.25rem;
|
|
35077
35045
|
`;
|
|
35078
|
-
var BadgeContainer =
|
|
35046
|
+
var BadgeContainer = styled21("div")`
|
|
35079
35047
|
display: flex;
|
|
35080
35048
|
align-items: center;
|
|
35081
35049
|
gap: 0.75rem;
|
|
35082
35050
|
`;
|
|
35083
|
-
var ContentContainer =
|
|
35051
|
+
var ContentContainer = styled21("div")`
|
|
35084
35052
|
overflow: auto;
|
|
35085
35053
|
display: flex;
|
|
35086
35054
|
flex-direction: column;
|
|
@@ -35101,7 +35069,7 @@ function View(props) {
|
|
|
35101
35069
|
const { node, onNavigate } = props;
|
|
35102
35070
|
if (!snapshot || snapshot === "unavailable") return;
|
|
35103
35071
|
if (type === "costream") {
|
|
35104
|
-
return /* @__PURE__ */ (0,
|
|
35072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
35105
35073
|
CoStreamView,
|
|
35106
35074
|
{
|
|
35107
35075
|
data: snapshot,
|
|
@@ -35112,7 +35080,7 @@ function View(props) {
|
|
|
35112
35080
|
);
|
|
35113
35081
|
}
|
|
35114
35082
|
if (extendedType === "group") {
|
|
35115
|
-
return /* @__PURE__ */ (0,
|
|
35083
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
35116
35084
|
GroupView,
|
|
35117
35085
|
{
|
|
35118
35086
|
coValue: value,
|
|
@@ -35123,10 +35091,10 @@ function View(props) {
|
|
|
35123
35091
|
);
|
|
35124
35092
|
}
|
|
35125
35093
|
if (extendedType === "account") {
|
|
35126
|
-
return /* @__PURE__ */ (0,
|
|
35094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(AccountView, { data: snapshot, node, onNavigate });
|
|
35127
35095
|
}
|
|
35128
35096
|
if (type === "coplaintext") {
|
|
35129
|
-
return /* @__PURE__ */ (0,
|
|
35097
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
35130
35098
|
CoPlainTextView,
|
|
35131
35099
|
{
|
|
35132
35100
|
data: snapshot,
|
|
@@ -35142,7 +35110,7 @@ function View(props) {
|
|
|
35142
35110
|
list.delete(index);
|
|
35143
35111
|
}
|
|
35144
35112
|
};
|
|
35145
|
-
return /* @__PURE__ */ (0,
|
|
35113
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
35146
35114
|
TableView,
|
|
35147
35115
|
{
|
|
35148
35116
|
data: snapshot,
|
|
@@ -35153,10 +35121,10 @@ function View(props) {
|
|
|
35153
35121
|
);
|
|
35154
35122
|
}
|
|
35155
35123
|
if (extendedType === "record") {
|
|
35156
|
-
return /* @__PURE__ */ (0,
|
|
35124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TableView, { data: snapshot, node, onNavigate });
|
|
35157
35125
|
}
|
|
35158
35126
|
if (type === "comap") {
|
|
35159
|
-
return /* @__PURE__ */ (0,
|
|
35127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
35160
35128
|
CoMapView,
|
|
35161
35129
|
{
|
|
35162
35130
|
coValue: value,
|
|
@@ -35166,7 +35134,7 @@ function View(props) {
|
|
|
35166
35134
|
}
|
|
35167
35135
|
);
|
|
35168
35136
|
}
|
|
35169
|
-
return /* @__PURE__ */ (0,
|
|
35137
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridView, { data: snapshot, onNavigate, node });
|
|
35170
35138
|
}
|
|
35171
35139
|
function Page(props) {
|
|
35172
35140
|
const {
|
|
@@ -35182,13 +35150,13 @@ function Page(props) {
|
|
|
35182
35150
|
const coValue = useResolvedCoValue(coId, node);
|
|
35183
35151
|
const { value, snapshot, type, extendedType } = coValue;
|
|
35184
35152
|
if (snapshot === "unavailable") {
|
|
35185
|
-
return /* @__PURE__ */ (0,
|
|
35153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { style, children: "Data unavailable" });
|
|
35186
35154
|
}
|
|
35187
35155
|
if (!snapshot) {
|
|
35188
|
-
return /* @__PURE__ */ (0,
|
|
35156
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { style });
|
|
35189
35157
|
}
|
|
35190
|
-
return /* @__PURE__ */ (0,
|
|
35191
|
-
!isTopLevel && /* @__PURE__ */ (0,
|
|
35158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(PageContainer, { style, className, isTopLevel, children: [
|
|
35159
|
+
!isTopLevel && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
35192
35160
|
BackButton,
|
|
35193
35161
|
{
|
|
35194
35162
|
"aria-label": "Back",
|
|
@@ -35198,27 +35166,27 @@ function Page(props) {
|
|
|
35198
35166
|
"aria-hidden": "true"
|
|
35199
35167
|
}
|
|
35200
35168
|
),
|
|
35201
|
-
/* @__PURE__ */ (0,
|
|
35202
|
-
/* @__PURE__ */ (0,
|
|
35169
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(HeaderContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(TitleContainer, { children: [
|
|
35170
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Title, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { children: [
|
|
35203
35171
|
name,
|
|
35204
|
-
typeof snapshot === "object" && "name" in snapshot ? /* @__PURE__ */ (0,
|
|
35172
|
+
typeof snapshot === "object" && "name" in snapshot ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { style: { color: "#57534e", fontWeight: 500 }, children: [
|
|
35205
35173
|
" ",
|
|
35206
35174
|
snapshot.name
|
|
35207
35175
|
] }) : null
|
|
35208
35176
|
] }) }),
|
|
35209
|
-
/* @__PURE__ */ (0,
|
|
35210
|
-
/* @__PURE__ */ (0,
|
|
35211
|
-
/* @__PURE__ */ (0,
|
|
35177
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(BadgeContainer, { children: [
|
|
35178
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Badge, { children: type && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TypeIcon, { type, extendedType }) }),
|
|
35179
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Badge, { children: coId })
|
|
35212
35180
|
] })
|
|
35213
35181
|
] }) }),
|
|
35214
|
-
/* @__PURE__ */ (0,
|
|
35215
|
-
/* @__PURE__ */ (0,
|
|
35216
|
-
extendedType !== "account" && extendedType !== "group" && /* @__PURE__ */ (0,
|
|
35217
|
-
/* @__PURE__ */ (0,
|
|
35218
|
-
/* @__PURE__ */ (0,
|
|
35182
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(ContentContainer, { children: [
|
|
35183
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(View, { ...props, coValue }),
|
|
35184
|
+
extendedType !== "account" && extendedType !== "group" && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
35185
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(RoleDisplay, { node, value }),
|
|
35186
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text, { muted: true, children: [
|
|
35219
35187
|
"Owned by",
|
|
35220
35188
|
" ",
|
|
35221
|
-
/* @__PURE__ */ (0,
|
|
35189
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
35222
35190
|
AccountOrGroupText,
|
|
35223
35191
|
{
|
|
35224
35192
|
coId: value.group.id,
|
|
@@ -35231,16 +35199,16 @@ function Page(props) {
|
|
|
35231
35199
|
)
|
|
35232
35200
|
] })
|
|
35233
35201
|
] }),
|
|
35234
|
-
value && /* @__PURE__ */ (0,
|
|
35202
|
+
value && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(HistoryView, { coValue: value, node })
|
|
35235
35203
|
] })
|
|
35236
35204
|
] });
|
|
35237
35205
|
}
|
|
35238
35206
|
|
|
35239
35207
|
// src/inspector/ui/error-boundary.tsx
|
|
35240
|
-
var
|
|
35241
|
-
var
|
|
35242
|
-
import { styled as
|
|
35243
|
-
var ErrorBoundary = class extends
|
|
35208
|
+
var import_react22 = __toESM(require_react(), 1);
|
|
35209
|
+
var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
|
|
35210
|
+
import { styled as styled22 } from "goober";
|
|
35211
|
+
var ErrorBoundary = class extends import_react22.default.Component {
|
|
35244
35212
|
constructor(props) {
|
|
35245
35213
|
super(props);
|
|
35246
35214
|
this.state = { hasError: false };
|
|
@@ -35253,61 +35221,132 @@ var ErrorBoundary = class extends import_react23.default.Component {
|
|
|
35253
35221
|
}
|
|
35254
35222
|
render() {
|
|
35255
35223
|
if (this.state.hasError) {
|
|
35256
|
-
return /* @__PURE__ */ (0,
|
|
35257
|
-
/* @__PURE__ */ (0,
|
|
35258
|
-
/* @__PURE__ */ (0,
|
|
35259
|
-
/* @__PURE__ */ (0,
|
|
35224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { style: { padding: "1rem" }, children: [
|
|
35225
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(StyledHeading2, { children: this.props.title }),
|
|
35226
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { mono: true, style: { marginTop: "0.5rem", color: "#ef4444" }, children: this.state.error?.message || "An unexpected error occurred" }),
|
|
35227
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("pre", { style: { paddingLeft: "1rem", color: "#ef4444" }, children: this.state.error?.stack })
|
|
35260
35228
|
] });
|
|
35261
35229
|
}
|
|
35262
35230
|
return this.props.children;
|
|
35263
35231
|
}
|
|
35264
35232
|
};
|
|
35265
|
-
var StyledHeading2 =
|
|
35233
|
+
var StyledHeading2 = styled22("h1")`
|
|
35266
35234
|
font-size: 1.125rem;
|
|
35267
35235
|
font-weight: 500;
|
|
35268
35236
|
color: var(--j-text-color-strong);
|
|
35269
35237
|
`;
|
|
35270
35238
|
|
|
35271
|
-
// src/inspector/
|
|
35272
|
-
var
|
|
35273
|
-
var
|
|
35274
|
-
|
|
35275
|
-
|
|
35276
|
-
|
|
35277
|
-
|
|
35278
|
-
|
|
35279
|
-
|
|
35280
|
-
`;
|
|
35281
|
-
function PageStack({
|
|
35282
|
-
path,
|
|
35283
|
-
node,
|
|
35284
|
-
goBack,
|
|
35285
|
-
addPages,
|
|
35286
|
-
children
|
|
35287
|
-
}) {
|
|
35288
|
-
const page = path[path.length - 1];
|
|
35289
|
-
const index = path.length - 1;
|
|
35290
|
-
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_jsx_runtime37.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(PageStackContainer, { children: [
|
|
35291
|
-
children,
|
|
35292
|
-
node && page && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ErrorBoundary, { title: "An error occurred while rendering this CoValue", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
35293
|
-
Page,
|
|
35294
|
-
{
|
|
35295
|
-
coId: page.coId,
|
|
35296
|
-
node,
|
|
35297
|
-
name: page.name || page.coId,
|
|
35298
|
-
onHeaderClick: goBack,
|
|
35299
|
-
onNavigate: addPages,
|
|
35300
|
-
isTopLevel: index === path.length - 1
|
|
35301
|
-
}
|
|
35302
|
-
) })
|
|
35303
|
-
] }) });
|
|
35239
|
+
// src/inspector/router/context.ts
|
|
35240
|
+
var import_react23 = __toESM(require_react(), 1);
|
|
35241
|
+
var RouterContext = (0, import_react23.createContext)(null);
|
|
35242
|
+
function useRouter() {
|
|
35243
|
+
const context = (0, import_react23.useContext)(RouterContext);
|
|
35244
|
+
if (!context) {
|
|
35245
|
+
throw new Error("useRouter must be used within a RouterProvider");
|
|
35246
|
+
}
|
|
35247
|
+
return context;
|
|
35304
35248
|
}
|
|
35305
35249
|
|
|
35306
|
-
// src/inspector/
|
|
35250
|
+
// src/inspector/contexts/node.tsx
|
|
35307
35251
|
var import_react24 = __toESM(require_react(), 1);
|
|
35252
|
+
var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1);
|
|
35253
|
+
import { LocalNode } from "cojson";
|
|
35254
|
+
import { WasmCrypto } from "cojson/crypto/WasmCrypto";
|
|
35255
|
+
import { createWebSocketPeer } from "cojson-transport-ws";
|
|
35256
|
+
var NodeContext = (0, import_react24.createContext)({
|
|
35257
|
+
accountID: null,
|
|
35258
|
+
localNode: null,
|
|
35259
|
+
server: "wss://cloud.jazz.tools/",
|
|
35260
|
+
createLocalNode: async () => {
|
|
35261
|
+
throw new Error("createLocalNode not implemented");
|
|
35262
|
+
},
|
|
35263
|
+
reset: () => {
|
|
35264
|
+
throw new Error("reset not implemented");
|
|
35265
|
+
}
|
|
35266
|
+
});
|
|
35267
|
+
var crypto = null;
|
|
35268
|
+
async function getCrypto() {
|
|
35269
|
+
if (crypto) return crypto;
|
|
35270
|
+
crypto = await WasmCrypto.create();
|
|
35271
|
+
return crypto;
|
|
35272
|
+
}
|
|
35273
|
+
function NodeProvider(props) {
|
|
35274
|
+
const [accountID, setAccountID] = (0, import_react24.useState)(
|
|
35275
|
+
props?.accountID ?? null
|
|
35276
|
+
);
|
|
35277
|
+
const [localNode, setLocalNode] = (0, import_react24.useState)(
|
|
35278
|
+
props?.localNode ?? null
|
|
35279
|
+
);
|
|
35280
|
+
const [server, setServer] = (0, import_react24.useState)(
|
|
35281
|
+
props?.server ?? "wss://cloud.jazz.tools/"
|
|
35282
|
+
);
|
|
35283
|
+
(0, import_react24.useEffect)(() => {
|
|
35284
|
+
if (props.localNode !== void 0) setLocalNode(props.localNode);
|
|
35285
|
+
if (props.accountID !== void 0) setAccountID(props.accountID);
|
|
35286
|
+
if (props.server !== void 0) setServer(props.server);
|
|
35287
|
+
}, [props.localNode, props.accountID, props.server]);
|
|
35288
|
+
async function createLocalNode(accountID2, clientSecret, server2) {
|
|
35289
|
+
if (localNode) {
|
|
35290
|
+
localNode.gracefulShutdown();
|
|
35291
|
+
}
|
|
35292
|
+
setLocalNode(null);
|
|
35293
|
+
const wsPeer = createWebSocketPeer({
|
|
35294
|
+
id: "cloud",
|
|
35295
|
+
websocket: new WebSocket(server2),
|
|
35296
|
+
role: "server"
|
|
35297
|
+
});
|
|
35298
|
+
const crypto2 = await getCrypto();
|
|
35299
|
+
const node = await LocalNode.withLoadedAccount({
|
|
35300
|
+
accountID: accountID2,
|
|
35301
|
+
accountSecret: clientSecret,
|
|
35302
|
+
sessionID: crypto2.newRandomSessionID(accountID2),
|
|
35303
|
+
peers: [wsPeer],
|
|
35304
|
+
crypto: crypto2,
|
|
35305
|
+
migration: async () => {
|
|
35306
|
+
console.log("Not running any migration in inspector");
|
|
35307
|
+
}
|
|
35308
|
+
});
|
|
35309
|
+
setLocalNode(node);
|
|
35310
|
+
setAccountID(accountID2);
|
|
35311
|
+
setServer(server2);
|
|
35312
|
+
}
|
|
35313
|
+
function reset() {
|
|
35314
|
+
if (localNode) {
|
|
35315
|
+
localNode.gracefulShutdown();
|
|
35316
|
+
}
|
|
35317
|
+
setLocalNode(null);
|
|
35318
|
+
setAccountID(null);
|
|
35319
|
+
setServer("wss://cloud.jazz.tools/");
|
|
35320
|
+
}
|
|
35321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
35322
|
+
NodeContext.Provider,
|
|
35323
|
+
{
|
|
35324
|
+
value: { accountID, localNode, server, createLocalNode, reset },
|
|
35325
|
+
children: props.children
|
|
35326
|
+
}
|
|
35327
|
+
);
|
|
35328
|
+
}
|
|
35329
|
+
function useNode() {
|
|
35330
|
+
const context = (0, import_react24.useContext)(NodeContext);
|
|
35331
|
+
if (!context) {
|
|
35332
|
+
throw new Error("useNode must be used within a NodeProvider");
|
|
35333
|
+
}
|
|
35334
|
+
return context;
|
|
35335
|
+
}
|
|
35336
|
+
|
|
35337
|
+
// src/inspector/pages/home.tsx
|
|
35338
|
+
import { styled as styled23 } from "goober";
|
|
35339
|
+
var import_react27 = __toESM(require_react(), 1);
|
|
35340
|
+
|
|
35341
|
+
// src/inspector/router/in-memory-router.tsx
|
|
35342
|
+
var import_react25 = __toESM(require_react(), 1);
|
|
35343
|
+
var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1);
|
|
35308
35344
|
var STORAGE_KEY = "jazz-inspector-paths";
|
|
35309
|
-
function
|
|
35310
|
-
|
|
35345
|
+
function InMemoryRouterProvider({
|
|
35346
|
+
children,
|
|
35347
|
+
defaultPath
|
|
35348
|
+
}) {
|
|
35349
|
+
const [path, setPath] = (0, import_react25.useState)(() => {
|
|
35311
35350
|
if (typeof window === "undefined") return [];
|
|
35312
35351
|
const stored = localStorage.getItem(STORAGE_KEY);
|
|
35313
35352
|
if (stored) {
|
|
@@ -35319,45 +35358,138 @@ function usePagePath(defaultPath) {
|
|
|
35319
35358
|
}
|
|
35320
35359
|
return defaultPath || [];
|
|
35321
35360
|
});
|
|
35322
|
-
const updatePath = (0,
|
|
35361
|
+
const updatePath = (0, import_react25.useCallback)((newPath) => {
|
|
35323
35362
|
setPath(newPath);
|
|
35324
35363
|
localStorage.setItem(STORAGE_KEY, JSON.stringify(newPath));
|
|
35325
35364
|
}, []);
|
|
35326
|
-
(0,
|
|
35365
|
+
(0, import_react25.useEffect)(() => {
|
|
35327
35366
|
if (defaultPath && JSON.stringify(path) !== JSON.stringify(defaultPath)) {
|
|
35328
35367
|
updatePath(defaultPath);
|
|
35329
35368
|
}
|
|
35330
35369
|
}, [defaultPath, path, updatePath]);
|
|
35331
|
-
const
|
|
35332
|
-
(newPages) => {
|
|
35370
|
+
const router = (0, import_react25.useMemo)(() => {
|
|
35371
|
+
const addPages = (newPages) => {
|
|
35333
35372
|
updatePath([...path, ...newPages]);
|
|
35334
|
-
}
|
|
35335
|
-
|
|
35336
|
-
);
|
|
35337
|
-
const goToIndex = (0, import_react24.useCallback)(
|
|
35338
|
-
(index) => {
|
|
35373
|
+
};
|
|
35374
|
+
const goToIndex = (index) => {
|
|
35339
35375
|
updatePath(path.slice(0, index + 1));
|
|
35340
|
-
}
|
|
35341
|
-
|
|
35342
|
-
);
|
|
35343
|
-
const setPage = (0, import_react24.useCallback)(
|
|
35344
|
-
(coId) => {
|
|
35376
|
+
};
|
|
35377
|
+
const setPage = (coId) => {
|
|
35345
35378
|
updatePath([{ coId, name: "Root" }]);
|
|
35346
|
-
}
|
|
35347
|
-
|
|
35348
|
-
);
|
|
35349
|
-
const goBack = (0, import_react24.useCallback)(() => {
|
|
35350
|
-
if (path.length > 1) {
|
|
35379
|
+
};
|
|
35380
|
+
const goBack = () => {
|
|
35351
35381
|
updatePath(path.slice(0, path.length - 1));
|
|
35352
|
-
}
|
|
35382
|
+
};
|
|
35383
|
+
return {
|
|
35384
|
+
path,
|
|
35385
|
+
addPages,
|
|
35386
|
+
goToIndex,
|
|
35387
|
+
setPage,
|
|
35388
|
+
goBack
|
|
35389
|
+
};
|
|
35353
35390
|
}, [path, updatePath]);
|
|
35354
|
-
return {
|
|
35355
|
-
|
|
35356
|
-
|
|
35357
|
-
|
|
35358
|
-
|
|
35359
|
-
|
|
35391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(RouterContext.Provider, { value: router, children });
|
|
35392
|
+
}
|
|
35393
|
+
|
|
35394
|
+
// src/inspector/router/hash-router.tsx
|
|
35395
|
+
var import_react26 = __toESM(require_react(), 1);
|
|
35396
|
+
var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1);
|
|
35397
|
+
|
|
35398
|
+
// src/inspector/pages/home.tsx
|
|
35399
|
+
var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1);
|
|
35400
|
+
function HomePage() {
|
|
35401
|
+
const { localNode, accountID } = useNode();
|
|
35402
|
+
const { path, setPage } = useRouter();
|
|
35403
|
+
const [coValueId, setCoValueId] = (0, import_react27.useState)("");
|
|
35404
|
+
if (!localNode || !accountID) {
|
|
35405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: "Loading..." });
|
|
35406
|
+
}
|
|
35407
|
+
const handleCoValueIdSubmit = (e) => {
|
|
35408
|
+
e.preventDefault();
|
|
35409
|
+
if (coValueId) {
|
|
35410
|
+
setPage(coValueId);
|
|
35411
|
+
}
|
|
35412
|
+
setCoValueId("");
|
|
35360
35413
|
};
|
|
35414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_jsx_runtime39.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
35415
|
+
CenteredForm,
|
|
35416
|
+
{
|
|
35417
|
+
onSubmit: handleCoValueIdSubmit,
|
|
35418
|
+
"aria-hidden": path.length !== 0,
|
|
35419
|
+
children: [
|
|
35420
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Heading, { children: "Jazz CoValue Inspector" }),
|
|
35421
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
35422
|
+
Input,
|
|
35423
|
+
{
|
|
35424
|
+
label: "CoValue ID",
|
|
35425
|
+
className: "font-mono",
|
|
35426
|
+
hideLabel: true,
|
|
35427
|
+
placeholder: "co_z1234567890abcdef123456789",
|
|
35428
|
+
value: coValueId,
|
|
35429
|
+
onChange: (e) => setCoValueId(e.target.value)
|
|
35430
|
+
}
|
|
35431
|
+
),
|
|
35432
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Button, { type: "submit", variant: "primary", children: "Inspect CoValue" }),
|
|
35433
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(OrText, { children: "or" }),
|
|
35434
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
35435
|
+
Button,
|
|
35436
|
+
{
|
|
35437
|
+
variant: "secondary",
|
|
35438
|
+
onClick: () => {
|
|
35439
|
+
setPage(accountID);
|
|
35440
|
+
},
|
|
35441
|
+
children: "Inspect my account"
|
|
35442
|
+
}
|
|
35443
|
+
)
|
|
35444
|
+
]
|
|
35445
|
+
}
|
|
35446
|
+
) });
|
|
35447
|
+
}
|
|
35448
|
+
var CenteredForm = styled23("form")`
|
|
35449
|
+
display: flex;
|
|
35450
|
+
flex-direction: column;
|
|
35451
|
+
position: relative;
|
|
35452
|
+
top: -1.5rem;
|
|
35453
|
+
justify-content: center;
|
|
35454
|
+
gap: 0.5rem;
|
|
35455
|
+
height: 100%;
|
|
35456
|
+
width: 100%;
|
|
35457
|
+
max-width: 24rem;
|
|
35458
|
+
margin: 0 auto;
|
|
35459
|
+
`;
|
|
35460
|
+
var OrText = styled23("p")`
|
|
35461
|
+
text-align: center;
|
|
35462
|
+
`;
|
|
35463
|
+
|
|
35464
|
+
// src/inspector/viewer/page-stack.tsx
|
|
35465
|
+
var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1);
|
|
35466
|
+
var PageStackContainer = styled24("article")`
|
|
35467
|
+
position: relative;
|
|
35468
|
+
padding: 0 0.75rem;
|
|
35469
|
+
overflow-y: auto;
|
|
35470
|
+
flex: 1;
|
|
35471
|
+
color: var(--j-text-color);
|
|
35472
|
+
font-size: 16px;
|
|
35473
|
+
`;
|
|
35474
|
+
function PageStack({ homePage }) {
|
|
35475
|
+
const { path, addPages, goBack } = useRouter();
|
|
35476
|
+
const { localNode } = useNode();
|
|
35477
|
+
const page = path[path.length - 1];
|
|
35478
|
+
const index = path.length - 1;
|
|
35479
|
+
if (path.length <= 0) {
|
|
35480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(PageStackContainer, { children: homePage ?? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(HomePage, {}) });
|
|
35481
|
+
}
|
|
35482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_jsx_runtime40.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(PageStackContainer, { children: localNode && page && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ErrorBoundary, { title: "An error occurred while rendering this CoValue", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
35483
|
+
Page,
|
|
35484
|
+
{
|
|
35485
|
+
coId: page.coId,
|
|
35486
|
+
node: localNode,
|
|
35487
|
+
name: page.name || page.coId,
|
|
35488
|
+
onHeaderClick: goBack,
|
|
35489
|
+
onNavigate: addPages,
|
|
35490
|
+
isTopLevel: index === path.length - 1
|
|
35491
|
+
}
|
|
35492
|
+
) }) }) });
|
|
35361
35493
|
}
|
|
35362
35494
|
|
|
35363
35495
|
// src/inspector/ui/global-styles.tsx
|
|
@@ -35436,7 +35568,7 @@ var GlobalStyles = styled25("div")`
|
|
|
35436
35568
|
`;
|
|
35437
35569
|
|
|
35438
35570
|
// src/inspector/viewer/inspector-button.tsx
|
|
35439
|
-
var
|
|
35571
|
+
var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1);
|
|
35440
35572
|
import { styled as styled26 } from "goober";
|
|
35441
35573
|
var StyledInspectorButton = styled26("button")`
|
|
35442
35574
|
position: fixed;
|
|
@@ -35480,8 +35612,8 @@ function InspectorButton({
|
|
|
35480
35612
|
position = "right",
|
|
35481
35613
|
...buttonProps
|
|
35482
35614
|
}) {
|
|
35483
|
-
return /* @__PURE__ */ (0,
|
|
35484
|
-
/* @__PURE__ */ (0,
|
|
35615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(StyledInspectorButton, { position, ...buttonProps, children: [
|
|
35616
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
35485
35617
|
JazzIcon,
|
|
35486
35618
|
{
|
|
35487
35619
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -35489,7 +35621,7 @@ function InspectorButton({
|
|
|
35489
35621
|
height: "115",
|
|
35490
35622
|
viewBox: "0 0 119 115",
|
|
35491
35623
|
fill: "none",
|
|
35492
|
-
children: /* @__PURE__ */ (0,
|
|
35624
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
35493
35625
|
"path",
|
|
35494
35626
|
{
|
|
35495
35627
|
fillRule: "evenodd",
|
|
@@ -35500,7 +35632,7 @@ function InspectorButton({
|
|
|
35500
35632
|
)
|
|
35501
35633
|
}
|
|
35502
35634
|
),
|
|
35503
|
-
/* @__PURE__ */ (0,
|
|
35635
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
35504
35636
|
"span",
|
|
35505
35637
|
{
|
|
35506
35638
|
style: {
|
|
@@ -35521,30 +35653,77 @@ function InspectorButton({
|
|
|
35521
35653
|
}
|
|
35522
35654
|
|
|
35523
35655
|
// src/inspector/viewer/use-open-inspector.ts
|
|
35524
|
-
var
|
|
35656
|
+
var import_react28 = __toESM(require_react(), 1);
|
|
35525
35657
|
var STORAGE_KEY2 = "jazz-inspector-open";
|
|
35526
35658
|
function useOpenInspector() {
|
|
35527
|
-
const [open, setOpen] = (0,
|
|
35659
|
+
const [open, setOpen] = (0, import_react28.useState)(() => {
|
|
35528
35660
|
if (typeof window === "undefined") return false;
|
|
35529
35661
|
const stored = localStorage.getItem(STORAGE_KEY2);
|
|
35530
35662
|
return stored ? JSON.parse(stored) : false;
|
|
35531
35663
|
});
|
|
35532
|
-
(0,
|
|
35664
|
+
(0, import_react28.useEffect)(() => {
|
|
35533
35665
|
localStorage.setItem(STORAGE_KEY2, JSON.stringify(open));
|
|
35534
35666
|
}, [open]);
|
|
35535
35667
|
return [open, setOpen];
|
|
35536
35668
|
}
|
|
35537
35669
|
|
|
35670
|
+
// src/inspector/viewer/header.tsx
|
|
35671
|
+
var import_react31 = __toESM(require_react(), 1);
|
|
35672
|
+
import { styled as styled28 } from "goober";
|
|
35673
|
+
|
|
35674
|
+
// src/inspector/viewer/breadcrumbs.tsx
|
|
35675
|
+
var import_react29 = __toESM(require_react(), 1);
|
|
35676
|
+
import { styled as styled27 } from "goober";
|
|
35677
|
+
var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1);
|
|
35678
|
+
var BreadcrumbsContainer = styled27("div")`
|
|
35679
|
+
position: relative;
|
|
35680
|
+
z-index: 20;
|
|
35681
|
+
flex: 1;
|
|
35682
|
+
display: flex;
|
|
35683
|
+
align-items: center;
|
|
35684
|
+
`;
|
|
35685
|
+
var Separator = styled27("span")`
|
|
35686
|
+
padding: 0 0.125rem;
|
|
35687
|
+
`;
|
|
35688
|
+
var Breadcrumbs = () => {
|
|
35689
|
+
const { path, goToIndex } = useRouter();
|
|
35690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(BreadcrumbsContainer, { children: [
|
|
35691
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
35692
|
+
Button,
|
|
35693
|
+
{
|
|
35694
|
+
variant: "link",
|
|
35695
|
+
style: { padding: "0 0.25rem" },
|
|
35696
|
+
onClick: () => goToIndex(-1),
|
|
35697
|
+
children: "Home"
|
|
35698
|
+
}
|
|
35699
|
+
),
|
|
35700
|
+
path.map((page, index) => {
|
|
35701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_react29.default.Fragment, { children: [
|
|
35702
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Separator, { "aria-hidden": true, children: "/" }),
|
|
35703
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
35704
|
+
Button,
|
|
35705
|
+
{
|
|
35706
|
+
variant: "link",
|
|
35707
|
+
style: { padding: "0 0.25rem" },
|
|
35708
|
+
onClick: () => goToIndex(index),
|
|
35709
|
+
children: index === 0 ? page.name || "Root" : page.name
|
|
35710
|
+
}
|
|
35711
|
+
)
|
|
35712
|
+
] }, page.coId);
|
|
35713
|
+
})
|
|
35714
|
+
] });
|
|
35715
|
+
};
|
|
35716
|
+
|
|
35538
35717
|
// src/inspector/viewer/delete-local-data.tsx
|
|
35539
|
-
var
|
|
35540
|
-
var
|
|
35718
|
+
var import_react30 = __toESM(require_react(), 1);
|
|
35719
|
+
var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1);
|
|
35541
35720
|
var DELETE_LOCAL_DATA_STRING = "delete my local data";
|
|
35542
35721
|
function DeleteLocalData() {
|
|
35543
|
-
const [showDeleteModal, setShowDeleteModal] = (0,
|
|
35544
|
-
const [confirmDeleteString, setConfirmDeleteString] = (0,
|
|
35545
|
-
return /* @__PURE__ */ (0,
|
|
35546
|
-
/* @__PURE__ */ (0,
|
|
35547
|
-
/* @__PURE__ */ (0,
|
|
35722
|
+
const [showDeleteModal, setShowDeleteModal] = (0, import_react30.useState)(false);
|
|
35723
|
+
const [confirmDeleteString, setConfirmDeleteString] = (0, import_react30.useState)("");
|
|
35724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
|
|
35725
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Button, { variant: "destructive", onClick: () => setShowDeleteModal(true), children: "Delete my local data" }),
|
|
35726
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
35548
35727
|
Modal,
|
|
35549
35728
|
{
|
|
35550
35729
|
isOpen: showDeleteModal,
|
|
@@ -35552,7 +35731,7 @@ function DeleteLocalData() {
|
|
|
35552
35731
|
heading: "Delete Local Data",
|
|
35553
35732
|
showButtons: false,
|
|
35554
35733
|
children: [
|
|
35555
|
-
/* @__PURE__ */ (0,
|
|
35734
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
35556
35735
|
"div",
|
|
35557
35736
|
{
|
|
35558
35737
|
style: {
|
|
@@ -35563,33 +35742,33 @@ function DeleteLocalData() {
|
|
|
35563
35742
|
gap: "0.5rem"
|
|
35564
35743
|
},
|
|
35565
35744
|
children: [
|
|
35566
|
-
/* @__PURE__ */ (0,
|
|
35745
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("p", { children: [
|
|
35567
35746
|
"This action ",
|
|
35568
|
-
/* @__PURE__ */ (0,
|
|
35747
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("strong", { children: "cannot" }),
|
|
35569
35748
|
" be undone."
|
|
35570
35749
|
] }),
|
|
35571
|
-
/* @__PURE__ */ (0,
|
|
35750
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("p", { children: [
|
|
35572
35751
|
"Be aware that the following data will be",
|
|
35573
35752
|
" ",
|
|
35574
|
-
/* @__PURE__ */ (0,
|
|
35753
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("strong", { children: "permanently" }),
|
|
35575
35754
|
" deleted:"
|
|
35576
35755
|
] }),
|
|
35577
|
-
/* @__PURE__ */ (0,
|
|
35578
|
-
/* @__PURE__ */ (0,
|
|
35756
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("ul", { style: { listStyleType: "disc", paddingLeft: "1rem" }, children: [
|
|
35757
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("li", { children: [
|
|
35579
35758
|
"Unsynced data for ",
|
|
35580
|
-
/* @__PURE__ */ (0,
|
|
35759
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("strong", { children: "all apps" }),
|
|
35581
35760
|
" on",
|
|
35582
35761
|
" ",
|
|
35583
|
-
/* @__PURE__ */ (0,
|
|
35762
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("code", { children: window.location.origin })
|
|
35584
35763
|
] }),
|
|
35585
|
-
/* @__PURE__ */ (0,
|
|
35586
|
-
/* @__PURE__ */ (0,
|
|
35764
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("li", { children: "Accounts" }),
|
|
35765
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("li", { children: "Logged in sessions" })
|
|
35587
35766
|
] }),
|
|
35588
|
-
/* @__PURE__ */ (0,
|
|
35767
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", {})
|
|
35589
35768
|
]
|
|
35590
35769
|
}
|
|
35591
35770
|
),
|
|
35592
|
-
/* @__PURE__ */ (0,
|
|
35771
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
35593
35772
|
Input,
|
|
35594
35773
|
{
|
|
35595
35774
|
label: `Type "${DELETE_LOCAL_DATA_STRING}" to confirm`,
|
|
@@ -35600,7 +35779,7 @@ function DeleteLocalData() {
|
|
|
35600
35779
|
}
|
|
35601
35780
|
}
|
|
35602
35781
|
),
|
|
35603
|
-
/* @__PURE__ */ (0,
|
|
35782
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
35604
35783
|
"p",
|
|
35605
35784
|
{
|
|
35606
35785
|
style: {
|
|
@@ -35610,14 +35789,14 @@ function DeleteLocalData() {
|
|
|
35610
35789
|
flexDirection: "column",
|
|
35611
35790
|
gap: "0.5rem"
|
|
35612
35791
|
},
|
|
35613
|
-
children: /* @__PURE__ */ (0,
|
|
35792
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("small", { children: [
|
|
35614
35793
|
"Data synced to a sync server will ",
|
|
35615
|
-
/* @__PURE__ */ (0,
|
|
35794
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("strong", { children: "not" }),
|
|
35616
35795
|
" be deleted, and will be synced when you log in again."
|
|
35617
35796
|
] })
|
|
35618
35797
|
}
|
|
35619
35798
|
),
|
|
35620
|
-
/* @__PURE__ */ (0,
|
|
35799
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
35621
35800
|
"div",
|
|
35622
35801
|
{
|
|
35623
35802
|
style: {
|
|
@@ -35627,8 +35806,8 @@ function DeleteLocalData() {
|
|
|
35627
35806
|
gap: "0.5rem"
|
|
35628
35807
|
},
|
|
35629
35808
|
children: [
|
|
35630
|
-
/* @__PURE__ */ (0,
|
|
35631
|
-
/* @__PURE__ */ (0,
|
|
35809
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Button, { variant: "secondary", onClick: () => setShowDeleteModal(false), children: "Cancel" }),
|
|
35810
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
35632
35811
|
Button,
|
|
35633
35812
|
{
|
|
35634
35813
|
variant: "destructive",
|
|
@@ -35654,136 +35833,96 @@ function DeleteLocalData() {
|
|
|
35654
35833
|
] });
|
|
35655
35834
|
}
|
|
35656
35835
|
|
|
35657
|
-
// src/inspector/viewer/
|
|
35658
|
-
var
|
|
35659
|
-
|
|
35660
|
-
|
|
35661
|
-
|
|
35662
|
-
|
|
35663
|
-
|
|
35664
|
-
|
|
35665
|
-
|
|
35666
|
-
|
|
35667
|
-
|
|
35668
|
-
|
|
35669
|
-
|
|
35670
|
-
|
|
35671
|
-
|
|
35672
|
-
|
|
35673
|
-
|
|
35674
|
-
|
|
35675
|
-
|
|
35676
|
-
|
|
35836
|
+
// src/inspector/viewer/header.tsx
|
|
35837
|
+
var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1);
|
|
35838
|
+
function Header({
|
|
35839
|
+
showDeleteLocalData = false,
|
|
35840
|
+
showClose = false,
|
|
35841
|
+
onClose,
|
|
35842
|
+
children
|
|
35843
|
+
}) {
|
|
35844
|
+
const [coValueId, setCoValueId] = (0, import_react31.useState)("");
|
|
35845
|
+
const { path, setPage } = useRouter();
|
|
35846
|
+
const handleCoValueIdSubmit = (e) => {
|
|
35847
|
+
e.preventDefault();
|
|
35848
|
+
if (coValueId) {
|
|
35849
|
+
setPage(coValueId);
|
|
35850
|
+
}
|
|
35851
|
+
setCoValueId("");
|
|
35852
|
+
};
|
|
35853
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(HeaderContainer2, { children: [
|
|
35854
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Breadcrumbs, {}),
|
|
35855
|
+
path.length !== 0 && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Form, { onSubmit: handleCoValueIdSubmit, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
35856
|
+
Input,
|
|
35857
|
+
{
|
|
35858
|
+
label: "CoValue ID",
|
|
35859
|
+
style: { fontFamily: "monospace" },
|
|
35860
|
+
hideLabel: true,
|
|
35861
|
+
placeholder: "co_z1234567890abcdef123456789",
|
|
35862
|
+
value: coValueId,
|
|
35863
|
+
onChange: (e) => setCoValueId(e.target.value)
|
|
35864
|
+
}
|
|
35865
|
+
) }),
|
|
35866
|
+
children,
|
|
35867
|
+
showDeleteLocalData && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(DeleteLocalData, {}),
|
|
35868
|
+
showClose && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Button, { variant: "plain", type: "button", onClick: onClose, children: "Close" })
|
|
35869
|
+
] });
|
|
35870
|
+
}
|
|
35871
|
+
var HeaderContainer2 = styled28("div")`
|
|
35677
35872
|
display: flex;
|
|
35678
35873
|
align-items: center;
|
|
35679
35874
|
gap: 1rem;
|
|
35680
35875
|
padding: 0 0.75rem;
|
|
35681
35876
|
margin: 0.75rem 0;
|
|
35682
35877
|
`;
|
|
35683
|
-
var Form =
|
|
35878
|
+
var Form = styled28("form")`
|
|
35684
35879
|
width: 24rem;
|
|
35685
35880
|
`;
|
|
35686
|
-
|
|
35687
|
-
|
|
35688
|
-
|
|
35689
|
-
|
|
35690
|
-
top: -1.5rem;
|
|
35691
|
-
justify-content: center;
|
|
35692
|
-
gap: 0.5rem;
|
|
35693
|
-
height: 100%;
|
|
35694
|
-
width: 100%;
|
|
35695
|
-
max-width: 24rem;
|
|
35696
|
-
margin: 0 auto;
|
|
35697
|
-
`;
|
|
35698
|
-
var OrText = styled27("p")`
|
|
35699
|
-
text-align: center;
|
|
35700
|
-
`;
|
|
35701
|
-
function JazzInspectorInternal({
|
|
35881
|
+
|
|
35882
|
+
// src/inspector/in-app.tsx
|
|
35883
|
+
var import_jsx_runtime45 = __toESM(require_jsx_runtime(), 1);
|
|
35884
|
+
function InspectorInApp({
|
|
35702
35885
|
position = "right",
|
|
35703
35886
|
localNode,
|
|
35704
35887
|
accountId
|
|
35705
35888
|
}) {
|
|
35706
35889
|
const [open, setOpen] = useOpenInspector();
|
|
35707
|
-
const [coValueId, setCoValueId] = (0, import_react27.useState)("");
|
|
35708
|
-
const { path, addPages, goToIndex, goBack, setPage } = usePagePath();
|
|
35709
|
-
const handleCoValueIdSubmit = (e) => {
|
|
35710
|
-
e.preventDefault();
|
|
35711
|
-
if (coValueId) {
|
|
35712
|
-
setPage(coValueId);
|
|
35713
|
-
}
|
|
35714
|
-
setCoValueId("");
|
|
35715
|
-
};
|
|
35716
35890
|
if (!open) {
|
|
35717
|
-
return /* @__PURE__ */ (0,
|
|
35891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(InspectorButton, { position, onClick: () => setOpen(true) });
|
|
35718
35892
|
}
|
|
35719
|
-
return /* @__PURE__ */ (0,
|
|
35720
|
-
/* @__PURE__ */ (0,
|
|
35721
|
-
|
|
35722
|
-
path.length !== 0 && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Form, { onSubmit: handleCoValueIdSubmit, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
35723
|
-
Input,
|
|
35724
|
-
{
|
|
35725
|
-
label: "CoValue ID",
|
|
35726
|
-
style: { fontFamily: "monospace" },
|
|
35727
|
-
hideLabel: true,
|
|
35728
|
-
placeholder: "co_z1234567890abcdef123456789",
|
|
35729
|
-
value: coValueId,
|
|
35730
|
-
onChange: (e) => setCoValueId(e.target.value)
|
|
35731
|
-
}
|
|
35732
|
-
) }),
|
|
35733
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(DeleteLocalData, {}),
|
|
35734
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Button, { variant: "plain", type: "button", onClick: () => setOpen(false), children: "Close" })
|
|
35735
|
-
] }),
|
|
35736
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
35737
|
-
PageStack,
|
|
35893
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(NodeProvider, { localNode: localNode ?? null, accountID: accountId ?? null, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(InMemoryRouterProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(InspectorContainer, { as: GlobalStyles, style: { zIndex: 999 }, children: [
|
|
35894
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
35895
|
+
Header,
|
|
35738
35896
|
{
|
|
35739
|
-
|
|
35740
|
-
|
|
35741
|
-
|
|
35742
|
-
addPages,
|
|
35743
|
-
children: path.length <= 0 && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
35744
|
-
InitialForm,
|
|
35745
|
-
{
|
|
35746
|
-
onSubmit: handleCoValueIdSubmit,
|
|
35747
|
-
"aria-hidden": path.length !== 0,
|
|
35748
|
-
children: [
|
|
35749
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Heading, { children: "Jazz CoValue Inspector" }),
|
|
35750
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
35751
|
-
Input,
|
|
35752
|
-
{
|
|
35753
|
-
label: "CoValue ID",
|
|
35754
|
-
style: { minWidth: "21rem", fontFamily: "monospace" },
|
|
35755
|
-
hideLabel: true,
|
|
35756
|
-
placeholder: "co_z1234567890abcdef123456789",
|
|
35757
|
-
value: coValueId,
|
|
35758
|
-
onChange: (e) => setCoValueId(e.target.value)
|
|
35759
|
-
}
|
|
35760
|
-
),
|
|
35761
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Button, { type: "submit", variant: "primary", children: "Inspect CoValue" }),
|
|
35762
|
-
accountId && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
35763
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(OrText, { children: "or" }),
|
|
35764
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
35765
|
-
Button,
|
|
35766
|
-
{
|
|
35767
|
-
variant: "secondary",
|
|
35768
|
-
onClick: () => {
|
|
35769
|
-
setCoValueId(accountId);
|
|
35770
|
-
setPage(accountId);
|
|
35771
|
-
},
|
|
35772
|
-
children: "Inspect my account"
|
|
35773
|
-
}
|
|
35774
|
-
)
|
|
35775
|
-
] })
|
|
35776
|
-
]
|
|
35777
|
-
}
|
|
35778
|
-
)
|
|
35897
|
+
showDeleteLocalData: true,
|
|
35898
|
+
showClose: true,
|
|
35899
|
+
onClose: () => setOpen(false)
|
|
35779
35900
|
}
|
|
35780
|
-
)
|
|
35781
|
-
|
|
35901
|
+
),
|
|
35902
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(PageStack, {})
|
|
35903
|
+
] }) }) });
|
|
35782
35904
|
}
|
|
35905
|
+
var InspectorContainer = styled29("div")`
|
|
35906
|
+
position: fixed;
|
|
35907
|
+
height: 50vh;
|
|
35908
|
+
max-height: 800px;
|
|
35909
|
+
display: flex;
|
|
35910
|
+
flex-direction: column;
|
|
35911
|
+
bottom: 0;
|
|
35912
|
+
left: 0;
|
|
35913
|
+
width: 100%;
|
|
35914
|
+
background-color: white;
|
|
35915
|
+
border-top: 1px solid var(--j-border-color);
|
|
35916
|
+
color: var(--j-text-color);
|
|
35917
|
+
|
|
35918
|
+
@media (prefers-color-scheme: dark) {
|
|
35919
|
+
background-color: var(--j-background);
|
|
35920
|
+
}
|
|
35921
|
+
`;
|
|
35783
35922
|
|
|
35784
35923
|
// src/inspector/custom-element.tsx
|
|
35785
|
-
var
|
|
35786
|
-
setup(
|
|
35924
|
+
var import_jsx_runtime46 = __toESM(require_jsx_runtime(), 1);
|
|
35925
|
+
setup(import_react32.default.createElement);
|
|
35787
35926
|
var JazzInspectorElement = class extends HTMLElement {
|
|
35788
35927
|
constructor() {
|
|
35789
35928
|
super(...arguments);
|
|
@@ -35825,8 +35964,8 @@ var JazzInspectorElement = class extends HTMLElement {
|
|
|
35825
35964
|
return;
|
|
35826
35965
|
}
|
|
35827
35966
|
this.root?.render(
|
|
35828
|
-
/* @__PURE__ */ (0,
|
|
35829
|
-
|
|
35967
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
35968
|
+
InspectorInApp,
|
|
35830
35969
|
{
|
|
35831
35970
|
localNode: this.account.$jazz.localNode,
|
|
35832
35971
|
accountId: this.account.$jazz.raw.id
|
|
@@ -35951,4 +36090,4 @@ react/cjs/react-jsx-runtime.development.js:
|
|
|
35951
36090
|
* LICENSE file in the root directory of this source tree.
|
|
35952
36091
|
*)
|
|
35953
36092
|
*/
|
|
35954
|
-
//# sourceMappingURL=custom-element-
|
|
36093
|
+
//# sourceMappingURL=custom-element-KYV64IOC.js.map
|