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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"new-app.d.ts","sourceRoot":"","sources":["../../../src/inspector/viewer/new-app.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAc,MAAM,QAAQ,CAAC;AAWjE,OAAO,EAAmB,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAmDvE,wBAAgB,qBAAqB,CAAC,EACpC,QAAkB,EAClB,SAAS,EACT,SAAS,GACV,EAAE;IACD,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,SAAS,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;CAC9B,2CAqFA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CoID, RawCoValue } from "cojson";
|
|
2
|
-
import { PageInfo } from "./types.js";
|
|
3
|
-
export declare function usePagePath(defaultPath?: PageInfo[]): {
|
|
4
|
-
path: PageInfo[];
|
|
5
|
-
setPage: (coId: CoID<RawCoValue>) => void;
|
|
6
|
-
addPages: (newPages: PageInfo[]) => void;
|
|
7
|
-
goToIndex: (index: number) => void;
|
|
8
|
-
goBack: () => void;
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=use-page-path.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-page-path.d.ts","sourceRoot":"","sources":["../../../src/inspector/viewer/use-page-path.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,wBAAgB,WAAW,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE;;oBAwCzC,IAAI,CAAC,UAAU,CAAC;yBAdZ,QAAQ,EAAE;uBAOb,MAAM;;EA0BjB"}
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { CoID, LocalNode, RawAccount, RawCoValue } from "cojson";
|
|
2
|
-
import { styled } from "goober";
|
|
3
|
-
import React, { useState } from "react";
|
|
4
|
-
import { Button } from "../ui/button.js";
|
|
5
|
-
import { Input } from "../ui/input.js";
|
|
6
|
-
import { Breadcrumbs } from "./breadcrumbs.js";
|
|
7
|
-
import { PageStack } from "./page-stack.js";
|
|
8
|
-
import { usePagePath } from "./use-page-path.js";
|
|
9
|
-
|
|
10
|
-
import { GlobalStyles } from "../ui/global-styles.js";
|
|
11
|
-
import { Heading } from "../ui/heading.js";
|
|
12
|
-
import { InspectorButton, type Position } from "./inspector-button.js";
|
|
13
|
-
import { useOpenInspector } from "./use-open-inspector.js";
|
|
14
|
-
import { DeleteLocalData } from "./delete-local-data.js";
|
|
15
|
-
|
|
16
|
-
const InspectorContainer = styled("div")`
|
|
17
|
-
position: fixed;
|
|
18
|
-
height: 50vh;
|
|
19
|
-
max-height: 800px;
|
|
20
|
-
display: flex;
|
|
21
|
-
flex-direction: column;
|
|
22
|
-
bottom: 0;
|
|
23
|
-
left: 0;
|
|
24
|
-
width: 100%;
|
|
25
|
-
background-color: white;
|
|
26
|
-
border-top: 1px solid var(--j-border-color);
|
|
27
|
-
color: var(--j-text-color);
|
|
28
|
-
|
|
29
|
-
@media (prefers-color-scheme: dark) {
|
|
30
|
-
background-color: var(--j-background);
|
|
31
|
-
}
|
|
32
|
-
`;
|
|
33
|
-
|
|
34
|
-
const HeaderContainer = styled("div")`
|
|
35
|
-
display: flex;
|
|
36
|
-
align-items: center;
|
|
37
|
-
gap: 1rem;
|
|
38
|
-
padding: 0 0.75rem;
|
|
39
|
-
margin: 0.75rem 0;
|
|
40
|
-
`;
|
|
41
|
-
|
|
42
|
-
const Form = styled("form")`
|
|
43
|
-
width: 24rem;
|
|
44
|
-
`;
|
|
45
|
-
|
|
46
|
-
const InitialForm = styled("form")`
|
|
47
|
-
display: flex;
|
|
48
|
-
flex-direction: column;
|
|
49
|
-
position: relative;
|
|
50
|
-
top: -1.5rem;
|
|
51
|
-
justify-content: center;
|
|
52
|
-
gap: 0.5rem;
|
|
53
|
-
height: 100%;
|
|
54
|
-
width: 100%;
|
|
55
|
-
max-width: 24rem;
|
|
56
|
-
margin: 0 auto;
|
|
57
|
-
`;
|
|
58
|
-
|
|
59
|
-
const OrText = styled("p")`
|
|
60
|
-
text-align: center;
|
|
61
|
-
`;
|
|
62
|
-
|
|
63
|
-
export function JazzInspectorInternal({
|
|
64
|
-
position = "right",
|
|
65
|
-
localNode,
|
|
66
|
-
accountId,
|
|
67
|
-
}: {
|
|
68
|
-
position?: Position;
|
|
69
|
-
localNode?: LocalNode;
|
|
70
|
-
accountId?: CoID<RawAccount>;
|
|
71
|
-
}) {
|
|
72
|
-
const [open, setOpen] = useOpenInspector();
|
|
73
|
-
const [coValueId, setCoValueId] = useState<CoID<RawCoValue> | "">("");
|
|
74
|
-
const { path, addPages, goToIndex, goBack, setPage } = usePagePath();
|
|
75
|
-
|
|
76
|
-
const handleCoValueIdSubmit = (e: React.FormEvent) => {
|
|
77
|
-
e.preventDefault();
|
|
78
|
-
if (coValueId) {
|
|
79
|
-
setPage(coValueId);
|
|
80
|
-
}
|
|
81
|
-
setCoValueId("");
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
if (!open) {
|
|
85
|
-
return (
|
|
86
|
-
<InspectorButton position={position} onClick={() => setOpen(true)} />
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return (
|
|
91
|
-
<InspectorContainer as={GlobalStyles} style={{ zIndex: 999 }}>
|
|
92
|
-
<HeaderContainer>
|
|
93
|
-
<Breadcrumbs path={path} onBreadcrumbClick={goToIndex} />
|
|
94
|
-
{path.length !== 0 && (
|
|
95
|
-
<Form onSubmit={handleCoValueIdSubmit}>
|
|
96
|
-
<Input
|
|
97
|
-
label="CoValue ID"
|
|
98
|
-
style={{ fontFamily: "monospace" }}
|
|
99
|
-
hideLabel
|
|
100
|
-
placeholder="co_z1234567890abcdef123456789"
|
|
101
|
-
value={coValueId}
|
|
102
|
-
onChange={(e) => setCoValueId(e.target.value as CoID<RawCoValue>)}
|
|
103
|
-
/>
|
|
104
|
-
</Form>
|
|
105
|
-
)}
|
|
106
|
-
<DeleteLocalData />
|
|
107
|
-
<Button variant="plain" type="button" onClick={() => setOpen(false)}>
|
|
108
|
-
Close
|
|
109
|
-
</Button>
|
|
110
|
-
</HeaderContainer>
|
|
111
|
-
|
|
112
|
-
<PageStack
|
|
113
|
-
path={path}
|
|
114
|
-
node={localNode}
|
|
115
|
-
goBack={goBack}
|
|
116
|
-
addPages={addPages}
|
|
117
|
-
>
|
|
118
|
-
{path.length <= 0 && (
|
|
119
|
-
<InitialForm
|
|
120
|
-
onSubmit={handleCoValueIdSubmit}
|
|
121
|
-
aria-hidden={path.length !== 0}
|
|
122
|
-
>
|
|
123
|
-
<Heading>Jazz CoValue Inspector</Heading>
|
|
124
|
-
<Input
|
|
125
|
-
label="CoValue ID"
|
|
126
|
-
style={{ minWidth: "21rem", fontFamily: "monospace" }}
|
|
127
|
-
hideLabel
|
|
128
|
-
placeholder="co_z1234567890abcdef123456789"
|
|
129
|
-
value={coValueId}
|
|
130
|
-
onChange={(e) => setCoValueId(e.target.value as CoID<RawCoValue>)}
|
|
131
|
-
/>
|
|
132
|
-
<Button type="submit" variant="primary">
|
|
133
|
-
Inspect CoValue
|
|
134
|
-
</Button>
|
|
135
|
-
|
|
136
|
-
{accountId && (
|
|
137
|
-
<>
|
|
138
|
-
<OrText>or</OrText>
|
|
139
|
-
|
|
140
|
-
<Button
|
|
141
|
-
variant="secondary"
|
|
142
|
-
onClick={() => {
|
|
143
|
-
setCoValueId(accountId);
|
|
144
|
-
setPage(accountId);
|
|
145
|
-
}}
|
|
146
|
-
>
|
|
147
|
-
Inspect my account
|
|
148
|
-
</Button>
|
|
149
|
-
</>
|
|
150
|
-
)}
|
|
151
|
-
</InitialForm>
|
|
152
|
-
)}
|
|
153
|
-
</PageStack>
|
|
154
|
-
</InspectorContainer>
|
|
155
|
-
);
|
|
156
|
-
}
|