jazz-tools 0.18.35 → 0.18.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/.turbo/turbo-build.log +60 -60
  2. package/CHANGELOG.md +22 -0
  3. package/dist/inspector/{custom-element-RBBL46TI.js → custom-element-SUVJ7CPN.js} +480 -407
  4. package/dist/inspector/custom-element-SUVJ7CPN.js.map +1 -0
  5. package/dist/inspector/index.js +447 -374
  6. package/dist/inspector/index.js.map +1 -1
  7. package/dist/inspector/register-custom-element.js +1 -1
  8. package/dist/inspector/ui/accordion.d.ts +8 -0
  9. package/dist/inspector/ui/accordion.d.ts.map +1 -0
  10. package/dist/inspector/ui/error-boundary.d.ts +19 -0
  11. package/dist/inspector/ui/error-boundary.d.ts.map +1 -0
  12. package/dist/inspector/ui/index.d.ts +1 -0
  13. package/dist/inspector/ui/index.d.ts.map +1 -1
  14. package/dist/inspector/ui/text.d.ts +1 -0
  15. package/dist/inspector/ui/text.d.ts.map +1 -1
  16. package/dist/inspector/viewer/history-view.d.ts.map +1 -1
  17. package/dist/inspector/viewer/page-stack.d.ts.map +1 -1
  18. package/dist/inspector/viewer/raw-data-card.d.ts.map +1 -1
  19. package/dist/tools/exports.d.ts +1 -1
  20. package/dist/tools/exports.d.ts.map +1 -1
  21. package/package.json +4 -4
  22. package/src/inspector/tests/viewer/history-view.test.tsx +46 -4
  23. package/src/inspector/ui/accordion.tsx +52 -0
  24. package/src/inspector/ui/error-boundary.tsx +51 -0
  25. package/src/inspector/ui/index.ts +1 -0
  26. package/src/inspector/ui/text.tsx +1 -0
  27. package/src/inspector/viewer/history-view.tsx +4 -6
  28. package/src/inspector/viewer/page-stack.tsx +11 -8
  29. package/src/inspector/viewer/raw-data-card.tsx +11 -11
  30. package/src/inspector/viewer/use-resolve-covalue.ts +2 -2
  31. package/src/tools/exports.ts +1 -0
  32. package/dist/inspector/custom-element-RBBL46TI.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  // src/inspector/register-custom-element.ts
2
2
  if (typeof window !== "undefined" && process.env.NODE_ENV === "development") {
3
- import("./custom-element-RBBL46TI.js");
3
+ import("./custom-element-SUVJ7CPN.js");
4
4
  }
5
5
  //# sourceMappingURL=register-custom-element.js.map
@@ -0,0 +1,8 @@
1
+ import { PropsWithChildren } from "react";
2
+ type AccordionProps = PropsWithChildren<{
3
+ title: string;
4
+ storageKey: string;
5
+ }>;
6
+ export declare function Accordion({ title, children, storageKey }: AccordionProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=accordion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../../src/inspector/ui/accordion.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAuB,MAAM,OAAO,CAAC;AAE/D,KAAK,cAAc,GAAG,iBAAiB,CAAC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEH,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,cAAc,2CAmBxE"}
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ interface ErrorBoundaryState {
3
+ hasError: boolean;
4
+ error?: Error;
5
+ }
6
+ export declare class ErrorBoundary extends React.Component<{
7
+ children: React.ReactNode;
8
+ title: string;
9
+ }, ErrorBoundaryState> {
10
+ constructor(props: {
11
+ children: React.ReactNode;
12
+ title: string;
13
+ });
14
+ static getDerivedStateFromError(error: Error): ErrorBoundaryState;
15
+ componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
16
+ render(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
17
+ }
18
+ export {};
19
+ //# sourceMappingURL=error-boundary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-boundary.d.ts","sourceRoot":"","sources":["../../../src/inspector/ui/error-boundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,qBAAa,aAAc,SAAQ,KAAK,CAAC,SAAS,CAChD;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAC5C,kBAAkB,CACnB;gBACa,KAAK,EAAE;QAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE;IAK/D,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG,kBAAkB;IAIjE,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI;IAIjE,MAAM;CAkBP"}
@@ -4,4 +4,5 @@ export { Modal } from "./modal.js";
4
4
  export { Input } from "./input.js";
5
5
  export { Select } from "./select.js";
6
6
  export { DataTable } from "./data-table.js";
7
+ export { Accordion } from "./accordion.js";
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/inspector/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/inspector/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
@@ -6,5 +6,6 @@ export declare function Text(props: React.PropsWithChildren<{
6
6
  inline?: boolean;
7
7
  small?: boolean;
8
8
  mono?: boolean;
9
+ style?: React.CSSProperties;
9
10
  }>): import("react/jsx-runtime").JSX.Element;
10
11
  //# sourceMappingURL=text.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/inspector/ui/text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAiD1B,wBAAgB,IAAI,CAClB,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC,2CAGH"}
1
+ {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/inspector/ui/text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAiD1B,wBAAgB,IAAI,CAClB,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC,2CAGH"}
@@ -1 +1 @@
1
- {"version":3,"file":"history-view.d.ts","sourceRoot":"","sources":["../../../src/inspector/viewer/history-view.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,SAAS,EAET,UAAU,EAEX,MAAM,QAAQ,CAAC;AA2BhB,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,IAAI,GACL,EAAE;IACD,OAAO,EAAE,UAAU,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;CACjB,2CA0EA"}
1
+ {"version":3,"file":"history-view.d.ts","sourceRoot":"","sources":["../../../src/inspector/viewer/history-view.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,SAAS,EAET,UAAU,EAEX,MAAM,QAAQ,CAAC;AA0BhB,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,IAAI,GACL,EAAE;IACD,OAAO,EAAE,UAAU,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;CACjB,2CAyEA"}
@@ -1 +1 @@
1
- {"version":3,"file":"page-stack.d.ts","sourceRoot":"","sources":["../../../src/inspector/viewer/page-stack.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAKrD,UAAU,QAAQ;IAChB,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAGD,UAAU,cAAc;IACtB,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IACtC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAWD,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,QAAQ,GACT,EAAE,cAAc,2CAqBhB"}
1
+ {"version":3,"file":"page-stack.d.ts","sourceRoot":"","sources":["../../../src/inspector/viewer/page-stack.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAMrD,UAAU,QAAQ;IAChB,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAGD,UAAU,cAAc;IACtB,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IACtC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAWD,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,QAAQ,GACT,EAAE,cAAc,2CAuBhB"}
@@ -1 +1 @@
1
- {"version":3,"file":"raw-data-card.d.ts","sourceRoot":"","sources":["../../../src/inspector/viewer/raw-data-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAwCpC,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,2CAYzD"}
1
+ {"version":3,"file":"raw-data-card.d.ts","sourceRoot":"","sources":["../../../src/inspector/viewer/raw-data-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAuCpC,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,2CAazD"}
@@ -8,7 +8,7 @@ export { CoValueBase } from "./internal.js";
8
8
  export { Profile } from "./internal.js";
9
9
  export { SchemaUnion } from "./internal.js";
10
10
  export { co } from "./internal.js";
11
- export type { CoValueClass, CoValueFromRaw, DeeplyLoaded, Resolved, RefsToResolve, RefsToResolveStrict, CoMapInit_DEPRECATED as CoMapInit, CoFeedEntry, TextPos, AccountClass, AccountCreationProps, BaseProfileShape, } from "./internal.js";
11
+ export type { CoValueClass, CoValueFromRaw, DeeplyLoaded, Resolved, RefsToResolve, RefsToResolveStrict, CoMapInit_DEPRECATED as CoMapInit, CoFeedEntry, SingleCoFeedEntry, TextPos, AccountClass, AccountCreationProps, BaseProfileShape, } from "./internal.js";
12
12
  export { CoMap, CoList, BinaryCoStream, CoFeed, CoStream, FileStream, CoPlainText, CoRichText, Account, isControlledAccount, loadCoValue, subscribeToCoValue, ImageDefinition, SubscriptionScope, exportCoValue, importContentPieces, Ref, unstable_loadUnique, } from "./internal.js";
13
13
  export { JazzContextManager, type JazzContextManagerAuthProps, } from "./internal.js";
14
14
  export { AuthSecretStorage, type AuthSetPayload, } from "./auth/AuthSecretStorage.js";
@@ -1 +1 @@
1
- {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../src/tools/exports.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,IAAI,EACJ,SAAS,EACT,WAAW,GACZ,MAAM,QAAQ,CAAC;AAEhB,OAAO,KAAK,CAAC,MAAM,2CAA2C,CAAC;AAE/D,YAAY,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,QAAQ,EA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B,EAC9B,iBAAiB,EACjB,qBAAqB,EACrB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,GACtB,MAAM,eAAe,CAAC;AAEvB,mBAAmB,YAAY,CAAC;AAEhC,OAAO,EACL,oCAAoC,EACpC,KAAK,gBAAgB,EACrB,KAAK,gCAAgC,EACrC,KAAK,oBAAoB,EACzB,KAAK,MAAM,EACX,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,IAAI,gBAAgB,EAC1C,KAAK,YAAY,EACjB,KAAK,kBAAkB,GACxB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,0BAA0B,EAC1B,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,KAAK,SAAS,GACf,MAAM,uBAAuB,CAAC;AAE/B,cAAc,gBAAgB,CAAC"}
package/package.json CHANGED
@@ -187,7 +187,7 @@
187
187
  },
188
188
  "type": "module",
189
189
  "license": "MIT",
190
- "version": "0.18.35",
190
+ "version": "0.18.37",
191
191
  "dependencies": {
192
192
  "@manuscripts/prosemirror-recreate-steps": "^0.1.4",
193
193
  "@scure/base": "1.2.1",
@@ -204,9 +204,9 @@
204
204
  "prosemirror-transform": "^1.9.0",
205
205
  "use-sync-external-store": "^1.5.0",
206
206
  "zod": "4.1.11",
207
- "cojson": "0.18.35",
208
- "cojson-storage-indexeddb": "0.18.35",
209
- "cojson-transport-ws": "0.18.35"
207
+ "cojson": "0.18.37",
208
+ "cojson-storage-indexeddb": "0.18.37",
209
+ "cojson-transport-ws": "0.18.37"
210
210
  },
211
211
  "devDependencies": {
212
212
  "@scure/bip39": "^1.3.0",
@@ -74,11 +74,11 @@ describe("HistoryView", async () => {
74
74
 
75
75
  const history = [
76
76
  'Property "pet" has been set to "dog"',
77
- 'Property "age" has been set to "10"',
78
- 'Property "certified" has been set to "false"',
77
+ 'Property "age" has been set to 10',
78
+ 'Property "certified" has been set to false',
79
79
  'Property "pet" has been set to "cat"',
80
- 'Property "age" has been set to "20"',
81
- 'Property "certified" has been set to "true"',
80
+ 'Property "age" has been set to 20',
81
+ 'Property "certified" has been set to true',
82
82
  'Property "certified" has been deleted',
83
83
  ].toReversed(); // Default sort is descending
84
84
 
@@ -90,6 +90,48 @@ describe("HistoryView", async () => {
90
90
  );
91
91
  });
92
92
 
93
+ expect(extractActions()).toEqual(history);
94
+ });
95
+ it("should render co.map changes with json", async () => {
96
+ const d = new Date();
97
+ const value = co
98
+ .map({
99
+ pet: z.object({
100
+ name: z.string(),
101
+ age: z.number(),
102
+ }),
103
+ d: z.date(),
104
+ n: z.number().optional(),
105
+ s: z.string().nullable(),
106
+ })
107
+ .create(
108
+ { pet: { name: "dog", age: 10 }, d, n: 10, s: "hello" },
109
+ account,
110
+ );
111
+
112
+ value.$jazz.set("pet", { name: "cat", age: 20 });
113
+ value.$jazz.set("n", undefined);
114
+ value.$jazz.set("s", null);
115
+ render(
116
+ <HistoryView coValue={value.$jazz.raw} node={value.$jazz.localNode} />,
117
+ );
118
+
119
+ const history = [
120
+ 'Property "pet" has been set to {"name":"dog","age":10}',
121
+ `Property "d" has been set to "${d.toISOString()}"`,
122
+ 'Property "n" has been set to 10',
123
+ 'Property "s" has been set to "hello"',
124
+ 'Property "pet" has been set to {"name":"cat","age":20}',
125
+ 'Property "n" has been set to undefined',
126
+ 'Property "s" has been set to null',
127
+ ].toReversed(); // Default sort is descending
128
+
129
+ await waitFor(() => {
130
+ expect(screen.getAllByRole("row")[2]?.textContent).toContain(
131
+ account.$jazz.id,
132
+ );
133
+ });
134
+
93
135
  expect(extractActions()).toEqual(history);
94
136
  });
95
137
  });
@@ -0,0 +1,52 @@
1
+ import { styled } from "goober";
2
+ import { PropsWithChildren, useEffect, useState } from "react";
3
+
4
+ type AccordionProps = PropsWithChildren<{
5
+ title: string;
6
+ storageKey: string;
7
+ }>;
8
+
9
+ export function Accordion({ title, children, storageKey }: AccordionProps) {
10
+ const [open, setOpen] = useStoragedState(storageKey, false);
11
+
12
+ return (
13
+ <details
14
+ open={open}
15
+ style={{ display: "flex", flexDirection: "column", gap: "1rem" }}
16
+ >
17
+ <StyledSummary
18
+ onClick={(e) => {
19
+ e.preventDefault();
20
+ setOpen((v) => !v);
21
+ }}
22
+ >
23
+ {title}
24
+ </StyledSummary>
25
+ {children}
26
+ </details>
27
+ );
28
+ }
29
+
30
+ function useStoragedState<T>(
31
+ key: string,
32
+ defaultValue: T,
33
+ ): [T, React.Dispatch<React.SetStateAction<T>>] {
34
+ const [state, setState] = useState<T>(() => {
35
+ if (typeof window === "undefined") return defaultValue;
36
+ const stored = localStorage.getItem(key);
37
+ return stored ? JSON.parse(stored) : defaultValue;
38
+ });
39
+
40
+ useEffect(() => {
41
+ localStorage.setItem(key, JSON.stringify(state));
42
+ }, [state]);
43
+
44
+ return [state, setState];
45
+ }
46
+
47
+ const StyledSummary = styled("summary")`
48
+ font-size: 1.125rem;
49
+ cursor: pointer;
50
+ font-weight: 500;
51
+ color: var(--j-text-color-strong);
52
+ `;
@@ -0,0 +1,51 @@
1
+ import React from "react";
2
+ import { Text } from "./text";
3
+ import { styled } from "goober";
4
+
5
+ interface ErrorBoundaryState {
6
+ hasError: boolean;
7
+ error?: Error;
8
+ }
9
+
10
+ export class ErrorBoundary extends React.Component<
11
+ { children: React.ReactNode; title: string },
12
+ ErrorBoundaryState
13
+ > {
14
+ constructor(props: { children: React.ReactNode; title: string }) {
15
+ super(props);
16
+ this.state = { hasError: false };
17
+ }
18
+
19
+ static getDerivedStateFromError(error: Error): ErrorBoundaryState {
20
+ return { hasError: true, error };
21
+ }
22
+
23
+ componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void {
24
+ console.error(error);
25
+ }
26
+
27
+ render() {
28
+ if (this.state.hasError) {
29
+ return (
30
+ <div style={{ padding: "1rem" }}>
31
+ <StyledHeading>{this.props.title}</StyledHeading>
32
+ <Text mono style={{ marginTop: "0.5rem", color: "#ef4444" }}>
33
+ {this.state.error?.message || "An unexpected error occurred"}
34
+ </Text>
35
+
36
+ <pre style={{ paddingLeft: "1rem", color: "#ef4444" }}>
37
+ {this.state.error?.stack}
38
+ </pre>
39
+ </div>
40
+ );
41
+ }
42
+
43
+ return this.props.children;
44
+ }
45
+ }
46
+
47
+ const StyledHeading = styled("h1")<{ className?: string }>`
48
+ font-size: 1.125rem;
49
+ font-weight: 500;
50
+ color: var(--j-text-color-strong);
51
+ `;
@@ -4,3 +4,4 @@ export { Modal } from "./modal.js";
4
4
  export { Input } from "./input.js";
5
5
  export { Select } from "./select.js";
6
6
  export { DataTable } from "./data-table.js";
7
+ export { Accordion } from "./accordion.js";
@@ -56,6 +56,7 @@ export function Text(
56
56
  inline?: boolean;
57
57
  small?: boolean;
58
58
  mono?: boolean;
59
+ style?: React.CSSProperties;
59
60
  }>,
60
61
  ) {
61
62
  return <StyledText {...props} />;
@@ -13,7 +13,6 @@ import { styled } from "goober";
13
13
  import { isCoId } from "./types";
14
14
  import { AccountOrGroupText } from "./account-or-group-text";
15
15
  import { DataTable, ColumnDef } from "../ui/data-table";
16
- import { Heading } from "../ui/heading";
17
16
  import { MapOpPayload } from "cojson/dist/coValues/coMap.js";
18
17
  import {
19
18
  DeletionOpPayload,
@@ -24,7 +23,7 @@ import {
24
23
  BinaryStreamEnd,
25
24
  } from "cojson/dist/coValues/coStream.js";
26
25
  import { VerifiedTransaction } from "cojson/dist/coValueCore/coValueCore.js";
27
- import { Icon } from "../ui";
26
+ import { Icon, Accordion } from "../ui";
28
27
 
29
28
  type HistoryEntry = {
30
29
  id: string;
@@ -102,8 +101,7 @@ export function HistoryView({
102
101
  ];
103
102
 
104
103
  return (
105
- <section style={{ display: "flex", flexDirection: "column", gap: "1rem" }}>
106
- <Heading>CoValue history</Heading>
104
+ <Accordion title="CoValue history" storageKey="jazz-inspector-show-history">
107
105
  <DataTable
108
106
  columns={columns}
109
107
  data={transactions}
@@ -112,7 +110,7 @@ export function HistoryView({
112
110
  getRowKey={(row) => row.id}
113
111
  emptyMessage="No history available"
114
112
  />
115
- </section>
113
+ </Accordion>
116
114
  );
117
115
  }
118
116
 
@@ -242,7 +240,7 @@ function mapTransactionToAction(
242
240
 
243
241
  // coMap changes
244
242
  if (isPropertySet(change)) {
245
- return `Property "${change.key}" has been set to "${change.value}"`;
243
+ return `Property "${change.key}" has been set to ${JSON.stringify(change.value)}`;
246
244
  }
247
245
 
248
246
  if (isPropertyDeletion(change)) {
@@ -1,6 +1,7 @@
1
1
  import { CoID, LocalNode, RawCoValue } from "cojson";
2
2
  import { styled } from "goober";
3
3
  import { Page } from "./page.js";
4
+ import { ErrorBoundary } from "../ui/error-boundary.js";
4
5
 
5
6
  // Define the structure of a page in the path
6
7
  interface PageInfo {
@@ -41,14 +42,16 @@ export function PageStack({
41
42
  <PageStackContainer>
42
43
  {children}
43
44
  {node && page && (
44
- <Page
45
- coId={page.coId}
46
- node={node}
47
- name={page.name || page.coId}
48
- onHeaderClick={goBack}
49
- onNavigate={addPages}
50
- isTopLevel={index === path.length - 1}
51
- />
45
+ <ErrorBoundary title="An error occurred while rendering this CoValue">
46
+ <Page
47
+ coId={page.coId}
48
+ node={node}
49
+ name={page.name || page.coId}
50
+ onHeaderClick={goBack}
51
+ onNavigate={addPages}
52
+ isTopLevel={index === path.length - 1}
53
+ />
54
+ </ErrorBoundary>
52
55
  )}
53
56
  </PageStackContainer>
54
57
  </>
@@ -1,8 +1,7 @@
1
1
  import { JsonObject } from "cojson";
2
2
  import { useEffect, useState } from "react";
3
- import { Button } from "../ui/button.js";
3
+ import { Button, Accordion } from "../ui";
4
4
  import { Card, CardBody, CardHeader } from "../ui/card.js";
5
- import { Text } from "../ui/text.js";
6
5
  import { ValueRenderer } from "./value-renderer.js";
7
6
 
8
7
  function CopyButton({ data }: { data: JsonObject }) {
@@ -40,14 +39,15 @@ function CopyButton({ data }: { data: JsonObject }) {
40
39
 
41
40
  export function RawDataCard({ data }: { data: JsonObject }) {
42
41
  return (
43
- <Card style={{ position: "relative" }}>
44
- <CardHeader>
45
- <Text strong>Raw data</Text>
46
- <CopyButton data={data} />
47
- </CardHeader>
48
- <CardBody>
49
- <ValueRenderer json={data} />
50
- </CardBody>
51
- </Card>
42
+ <Accordion title="Raw data" storageKey="jazz-inspector-show-raw-data">
43
+ <Card style={{ position: "relative" }}>
44
+ <CardHeader>
45
+ <CopyButton data={data} />
46
+ </CardHeader>
47
+ <CardBody>
48
+ <ValueRenderer json={data} />
49
+ </CardBody>
50
+ </Card>
51
+ </Accordion>
52
52
  );
53
53
  }
@@ -91,7 +91,7 @@ export async function resolveCoValue(
91
91
  extendedType = "image";
92
92
  } else if (isAccount(snapshot)) {
93
93
  extendedType = "account";
94
- } else if (isGroup(snapshot)) {
94
+ } else if (value.core.isGroup()) {
95
95
  extendedType = "group";
96
96
  }
97
97
  }
@@ -127,7 +127,7 @@ function subscribeToCoValue(
127
127
  extendedType = "image";
128
128
  } else if (isAccount(snapshot)) {
129
129
  extendedType = "account";
130
- } else if (isGroup(snapshot)) {
130
+ } else if (value.core.isGroup()) {
131
131
  extendedType = "group";
132
132
  }
133
133
  } else if (type === "costream") {
@@ -32,6 +32,7 @@ export type {
32
32
  RefsToResolveStrict,
33
33
  CoMapInit_DEPRECATED as CoMapInit,
34
34
  CoFeedEntry,
35
+ SingleCoFeedEntry,
35
36
  TextPos,
36
37
  AccountClass,
37
38
  AccountCreationProps,