jazz-tools 0.18.36 → 0.18.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +55 -55
- package/CHANGELOG.md +24 -0
- package/dist/inspector/{custom-element-RBBL46TI.js → custom-element-QESCMFY7.js} +492 -409
- package/dist/inspector/custom-element-QESCMFY7.js.map +1 -0
- package/dist/inspector/index.js +459 -376
- package/dist/inspector/index.js.map +1 -1
- package/dist/inspector/register-custom-element.js +1 -1
- package/dist/inspector/ui/accordion.d.ts +8 -0
- package/dist/inspector/ui/accordion.d.ts.map +1 -0
- package/dist/inspector/ui/error-boundary.d.ts +19 -0
- package/dist/inspector/ui/error-boundary.d.ts.map +1 -0
- package/dist/inspector/ui/index.d.ts +1 -0
- package/dist/inspector/ui/index.d.ts.map +1 -1
- package/dist/inspector/ui/text.d.ts +1 -0
- package/dist/inspector/ui/text.d.ts.map +1 -1
- package/dist/inspector/viewer/history-view.d.ts.map +1 -1
- package/dist/inspector/viewer/page-stack.d.ts.map +1 -1
- package/dist/inspector/viewer/raw-data-card.d.ts.map +1 -1
- package/dist/tools/exports.d.ts +1 -1
- package/dist/tools/exports.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/inspector/tests/viewer/history-view.test.tsx +114 -12
- package/src/inspector/ui/accordion.tsx +52 -0
- package/src/inspector/ui/error-boundary.tsx +51 -0
- package/src/inspector/ui/index.ts +1 -0
- package/src/inspector/ui/text.tsx +1 -0
- package/src/inspector/viewer/history-view.tsx +18 -11
- package/src/inspector/viewer/page-stack.tsx +11 -8
- package/src/inspector/viewer/raw-data-card.tsx +11 -11
- package/src/inspector/viewer/use-resolve-covalue.ts +2 -2
- package/src/tools/exports.ts +1 -0
- package/dist/inspector/custom-element-RBBL46TI.js.map +0 -1
|
@@ -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"}
|
|
@@ -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"}
|
|
@@ -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;
|
|
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,
|
|
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,2CAoFA"}
|
|
@@ -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;
|
|
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;
|
|
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"}
|
package/dist/tools/exports.d.ts
CHANGED
|
@@ -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,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAElD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAEnC,YAAY,EACV,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,mBAAmB,EACnB,oBAAoB,IAAI,SAAS,EACjC,WAAW,EACX,OAAO,EACP,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,KAAK,EACL,MAAM,EACN,cAAc,EACd,MAAM,EACN,QAAQ,EACR,UAAU,EACV,WAAW,EACX,UAAU,EACV,OAAO,EACP,mBAAmB,EACnB,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,GAAG,EACH,mBAAmB,GACpB,MAAM,eAAe,CAAC;AAE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EACL,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,KAAK,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,iBAAiB,GAClB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,kBAAkB,EAClB,0BAA0B,EAC1B,wCAAwC,EACxC,8BAA8B,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.
|
|
190
|
+
"version": "0.18.38",
|
|
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.
|
|
208
|
-
"cojson-storage-indexeddb": "0.18.
|
|
209
|
-
"cojson-transport-ws": "0.18.
|
|
207
|
+
"cojson": "0.18.38",
|
|
208
|
+
"cojson-storage-indexeddb": "0.18.38",
|
|
209
|
+
"cojson-transport-ws": "0.18.38"
|
|
210
210
|
},
|
|
211
211
|
"devDependencies": {
|
|
212
212
|
"@scure/bip39": "^1.3.0",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @vitest-environment happy-dom
|
|
2
|
-
import { afterEach, beforeAll, describe, expect, it } from "vitest";
|
|
2
|
+
import { afterEach, assert, beforeAll, describe, expect, it } from "vitest";
|
|
3
3
|
import { createJazzTestAccount, setupJazzTestSync } from "jazz-tools/testing";
|
|
4
4
|
import { co, z } from "jazz-tools";
|
|
5
5
|
import {
|
|
@@ -45,7 +45,7 @@ describe("HistoryView", async () => {
|
|
|
45
45
|
.create({ foo: "bar" }, account);
|
|
46
46
|
|
|
47
47
|
render(
|
|
48
|
-
<HistoryView coValue={value.$jazz.raw} node={
|
|
48
|
+
<HistoryView coValue={value.$jazz.raw} node={account.$jazz.localNode} />,
|
|
49
49
|
);
|
|
50
50
|
|
|
51
51
|
expect(
|
|
@@ -69,20 +69,113 @@ describe("HistoryView", async () => {
|
|
|
69
69
|
value.$jazz.delete("certified");
|
|
70
70
|
|
|
71
71
|
render(
|
|
72
|
-
<HistoryView
|
|
72
|
+
<HistoryView
|
|
73
|
+
coValue={value.$jazz.raw}
|
|
74
|
+
node={account.$jazz.localNode}
|
|
75
|
+
/>,
|
|
73
76
|
);
|
|
74
77
|
|
|
75
78
|
const history = [
|
|
76
79
|
'Property "pet" has been set to "dog"',
|
|
77
|
-
'Property "age" has been set to
|
|
78
|
-
'Property "certified" has been set to
|
|
80
|
+
'Property "age" has been set to 10',
|
|
81
|
+
'Property "certified" has been set to false',
|
|
79
82
|
'Property "pet" has been set to "cat"',
|
|
80
|
-
'Property "age" has been set to
|
|
81
|
-
'Property "certified" has been set to
|
|
83
|
+
'Property "age" has been set to 20',
|
|
84
|
+
'Property "certified" has been set to true',
|
|
82
85
|
'Property "certified" has been deleted',
|
|
83
86
|
].toReversed(); // Default sort is descending
|
|
84
87
|
|
|
85
|
-
|
|
88
|
+
await waitFor(() => {
|
|
89
|
+
expect(screen.getAllByRole("row")[2]?.textContent).toContain(
|
|
90
|
+
account.$jazz.id,
|
|
91
|
+
);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
expect(extractActions()).toEqual(history);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it("should render invalid changes", async () => {
|
|
98
|
+
const account2 = await createJazzTestAccount();
|
|
99
|
+
const group = co.group().create(account);
|
|
100
|
+
group.addMember(account2, "reader");
|
|
101
|
+
|
|
102
|
+
const Schema = co.map({
|
|
103
|
+
pet: z.string(),
|
|
104
|
+
age: z.number(),
|
|
105
|
+
certified: z.boolean().optional(),
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
const value = Schema.create(
|
|
109
|
+
{ pet: "dog", age: 10, certified: false },
|
|
110
|
+
group,
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
const valueOnAccount2 = await Schema.load(value.$jazz.id, {
|
|
114
|
+
loadAs: account2,
|
|
115
|
+
});
|
|
116
|
+
assert(valueOnAccount2);
|
|
117
|
+
|
|
118
|
+
// This is invalid, since account2 is a reader
|
|
119
|
+
valueOnAccount2.$jazz.set("pet", "cat");
|
|
120
|
+
|
|
121
|
+
render(
|
|
122
|
+
<HistoryView
|
|
123
|
+
coValue={valueOnAccount2.$jazz.raw}
|
|
124
|
+
node={account2.$jazz.localNode}
|
|
125
|
+
/>,
|
|
126
|
+
);
|
|
127
|
+
|
|
128
|
+
const history = [
|
|
129
|
+
'Property "pet" has been set to "dog"',
|
|
130
|
+
'Property "age" has been set to 10',
|
|
131
|
+
'Property "certified" has been set to false',
|
|
132
|
+
|
|
133
|
+
// Account2 can't write to the value
|
|
134
|
+
'Property "pet" has been set to "cat"Invalid transaction: Transactor has no write permissions',
|
|
135
|
+
].toReversed(); // Default sort is descending
|
|
136
|
+
|
|
137
|
+
await waitFor(() => {
|
|
138
|
+
expect(screen.getAllByRole("row")[2]?.textContent).toContain(
|
|
139
|
+
account2.$jazz.id,
|
|
140
|
+
);
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
expect(extractActions()).toEqual(history);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it("should render co.map changes with json", async () => {
|
|
147
|
+
const d = new Date();
|
|
148
|
+
const value = co
|
|
149
|
+
.map({
|
|
150
|
+
pet: z.object({
|
|
151
|
+
name: z.string(),
|
|
152
|
+
age: z.number(),
|
|
153
|
+
}),
|
|
154
|
+
d: z.date(),
|
|
155
|
+
n: z.number().optional(),
|
|
156
|
+
s: z.string().nullable(),
|
|
157
|
+
})
|
|
158
|
+
.create(
|
|
159
|
+
{ pet: { name: "dog", age: 10 }, d, n: 10, s: "hello" },
|
|
160
|
+
account,
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
value.$jazz.set("pet", { name: "cat", age: 20 });
|
|
164
|
+
value.$jazz.set("n", undefined);
|
|
165
|
+
value.$jazz.set("s", null);
|
|
166
|
+
render(
|
|
167
|
+
<HistoryView coValue={value.$jazz.raw} node={value.$jazz.localNode} />,
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
const history = [
|
|
171
|
+
'Property "pet" has been set to {"name":"dog","age":10}',
|
|
172
|
+
`Property "d" has been set to "${d.toISOString()}"`,
|
|
173
|
+
'Property "n" has been set to 10',
|
|
174
|
+
'Property "s" has been set to "hello"',
|
|
175
|
+
'Property "pet" has been set to {"name":"cat","age":20}',
|
|
176
|
+
'Property "n" has been set to undefined',
|
|
177
|
+
'Property "s" has been set to null',
|
|
178
|
+
].toReversed(); // Default sort is descending
|
|
86
179
|
|
|
87
180
|
await waitFor(() => {
|
|
88
181
|
expect(screen.getAllByRole("row")[2]?.textContent).toContain(
|
|
@@ -105,7 +198,10 @@ describe("HistoryView", async () => {
|
|
|
105
198
|
value.$jazz.shift();
|
|
106
199
|
|
|
107
200
|
render(
|
|
108
|
-
<HistoryView
|
|
201
|
+
<HistoryView
|
|
202
|
+
coValue={value.$jazz.raw}
|
|
203
|
+
node={account.$jazz.localNode}
|
|
204
|
+
/>,
|
|
109
205
|
);
|
|
110
206
|
|
|
111
207
|
const history = [
|
|
@@ -152,7 +248,10 @@ describe("HistoryView", async () => {
|
|
|
152
248
|
value.$jazz.shift();
|
|
153
249
|
|
|
154
250
|
render(
|
|
155
|
-
<HistoryView
|
|
251
|
+
<HistoryView
|
|
252
|
+
coValue={value.$jazz.raw}
|
|
253
|
+
node={account.$jazz.localNode}
|
|
254
|
+
/>,
|
|
156
255
|
);
|
|
157
256
|
|
|
158
257
|
const history = [
|
|
@@ -181,8 +280,11 @@ describe("HistoryView", async () => {
|
|
|
181
280
|
const group3 = co.group().create(account);
|
|
182
281
|
group3.addMember(group, "inherit");
|
|
183
282
|
|
|
184
|
-
|
|
185
|
-
<HistoryView
|
|
283
|
+
render(
|
|
284
|
+
<HistoryView
|
|
285
|
+
coValue={group.$jazz.raw}
|
|
286
|
+
node={account.$jazz.localNode}
|
|
287
|
+
/>,
|
|
186
288
|
);
|
|
187
289
|
|
|
188
290
|
const history = [
|
|
@@ -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
|
+
`;
|
|
@@ -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;
|
|
@@ -32,6 +31,7 @@ type HistoryEntry = {
|
|
|
32
31
|
action: string;
|
|
33
32
|
timestamp: Date;
|
|
34
33
|
isValid: boolean;
|
|
34
|
+
validationErrorMessage: string | undefined;
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
export function HistoryView({
|
|
@@ -86,7 +86,18 @@ export function HistoryView({
|
|
|
86
86
|
{
|
|
87
87
|
id: "action",
|
|
88
88
|
header: "Action",
|
|
89
|
-
accessor: (row) =>
|
|
89
|
+
accessor: (row) => {
|
|
90
|
+
if (row.isValid) return row.action;
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<>
|
|
94
|
+
{row.action}
|
|
95
|
+
<span style={{ color: "red", display: "block" }}>
|
|
96
|
+
Invalid transaction: {row.validationErrorMessage}
|
|
97
|
+
</span>
|
|
98
|
+
</>
|
|
99
|
+
);
|
|
100
|
+
},
|
|
90
101
|
sortable: false,
|
|
91
102
|
filterable: true,
|
|
92
103
|
sortFn: (a, b) => a.action.localeCompare(b.action),
|
|
@@ -102,8 +113,7 @@ export function HistoryView({
|
|
|
102
113
|
];
|
|
103
114
|
|
|
104
115
|
return (
|
|
105
|
-
<
|
|
106
|
-
<Heading>CoValue history</Heading>
|
|
116
|
+
<Accordion title="CoValue history" storageKey="jazz-inspector-show-history">
|
|
107
117
|
<DataTable
|
|
108
118
|
columns={columns}
|
|
109
119
|
data={transactions}
|
|
@@ -112,7 +122,7 @@ export function HistoryView({
|
|
|
112
122
|
getRowKey={(row) => row.id}
|
|
113
123
|
emptyMessage="No history available"
|
|
114
124
|
/>
|
|
115
|
-
</
|
|
125
|
+
</Accordion>
|
|
116
126
|
);
|
|
117
127
|
}
|
|
118
128
|
|
|
@@ -133,10 +143,6 @@ function getTransactionChanges(
|
|
|
133
143
|
readKey,
|
|
134
144
|
) ?? []
|
|
135
145
|
);
|
|
136
|
-
|
|
137
|
-
// const decryptedString = coValue.core.verified.sessions.get(tx.txID.sessionID)?.impl.decryptNextTransactionChangesJson(tx.txID.txIndex, readKey);
|
|
138
|
-
|
|
139
|
-
// return decryptedString ? [decryptedString] : [];
|
|
140
146
|
}
|
|
141
147
|
|
|
142
148
|
return tx.changes ?? (tx.tx as any).changes ?? [];
|
|
@@ -152,6 +158,7 @@ function getHistory(coValue: RawCoValue): HistoryEntry[] {
|
|
|
152
158
|
action: mapTransactionToAction(change, coValue),
|
|
153
159
|
timestamp: new Date(tx.currentMadeAt),
|
|
154
160
|
isValid: tx.isValid,
|
|
161
|
+
validationErrorMessage: tx.validationErrorMessage,
|
|
155
162
|
}));
|
|
156
163
|
});
|
|
157
164
|
}
|
|
@@ -242,7 +249,7 @@ function mapTransactionToAction(
|
|
|
242
249
|
|
|
243
250
|
// coMap changes
|
|
244
251
|
if (isPropertySet(change)) {
|
|
245
|
-
return `Property "${change.key}" has been set to
|
|
252
|
+
return `Property "${change.key}" has been set to ${JSON.stringify(change.value)}`;
|
|
246
253
|
}
|
|
247
254
|
|
|
248
255
|
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
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
|
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
|
-
<
|
|
44
|
-
<
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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(
|
|
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(
|
|
130
|
+
} else if (value.core.isGroup()) {
|
|
131
131
|
extendedType = "group";
|
|
132
132
|
}
|
|
133
133
|
} else if (type === "costream") {
|