jazz-tools 0.18.21 → 0.18.23

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.
@@ -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-G6SPZEBR.js");
3
+ import("./custom-element-XDJT5T57.js");
4
4
  }
5
5
  //# sourceMappingURL=register-custom-element.js.map
@@ -1,7 +1,9 @@
1
+ import { CautionIcon } from "./icons/caution.js";
1
2
  import { ChevronDownIcon } from "./icons/chevron-down-icon.js";
2
3
  import { DeleteIcon } from "./icons/delete-icon.js";
3
4
  import { LinkIcon } from "./icons/link-icon.js";
4
5
  declare const icons: {
6
+ caution: typeof CautionIcon;
5
7
  chevronDown: typeof ChevronDownIcon;
6
8
  delete: typeof DeleteIcon;
7
9
  link: typeof LinkIcon;
@@ -1 +1 @@
1
- {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/inspector/ui/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,QAAA,MAAM,KAAK;;;;CAIV,CAAC;AAGF,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;CAeV,CAAC;AAmBF,wBAAgB,IAAI,CAAC,EACnB,IAAI,EACJ,IAAW,EACX,SAAS,EACT,GAAG,QAAQ,EACZ,EAAE;IACD,IAAI,CAAC,EAAE,MAAM,OAAO,KAAK,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,OAAO,KAAK,CAAC;CAC3B,GAAG,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,2CAiBhC"}
1
+ {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/inspector/ui/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,QAAA,MAAM,KAAK;;;;;CAKV,CAAC;AAGF,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;CAeV,CAAC;AAmBF,wBAAgB,IAAI,CAAC,EACnB,IAAI,EACJ,IAAW,EACX,SAAS,EACT,GAAG,QAAQ,EACZ,EAAE;IACD,IAAI,CAAC,EAAE,MAAM,OAAO,KAAK,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,OAAO,KAAK,CAAC;CAC3B,GAAG,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,2CAiBhC"}
@@ -0,0 +1,2 @@
1
+ export declare function CautionIcon(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=caution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"caution.d.ts","sourceRoot":"","sources":["../../../../src/inspector/ui/icons/caution.tsx"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,2CAiB/D"}
@@ -1 +1 @@
1
- {"version":3,"file":"table-viewer.d.ts","sourceRoot":"","sources":["../../../src/inspector/viewer/table-viewer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,SAAS,EAAc,MAAM,QAAQ,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAIzC,OAAO,EAAE,QAAQ,EAAU,MAAM,YAAY,CAAC;AAgJ9C,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,2CAiDA"}
1
+ {"version":3,"file":"table-viewer.d.ts","sourceRoot":"","sources":["../../../src/inspector/viewer/table-viewer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,SAAS,EAAc,MAAM,QAAQ,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAIzC,OAAO,EAAE,QAAQ,EAAU,MAAM,YAAY,CAAC;AA0M9C,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,2CAiDA"}
@@ -0,0 +1,2 @@
1
+ export * from "cojson/crypto/NapiCrypto";
2
+ //# sourceMappingURL=napi-crypto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"napi-crypto.d.ts","sourceRoot":"","sources":["../../src/worker/napi-crypto.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
@@ -0,0 +1,3 @@
1
+ // src/worker/napi-crypto.ts
2
+ export * from "cojson/crypto/NapiCrypto";
3
+ //# sourceMappingURL=napi-crypto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/worker/napi-crypto.ts"],"sourcesContent":["export * from \"cojson/crypto/NapiCrypto\";\n"],"mappings":";AAAA,cAAc;","names":[]}
package/package.json CHANGED
@@ -178,11 +178,16 @@
178
178
  "@jazz-tools/source": "./src/worker/edge-wasm.ts",
179
179
  "types": "./dist/worker/edge-wasm.d.ts",
180
180
  "default": "./dist/worker/edge-wasm.js"
181
+ },
182
+ "./napi": {
183
+ "@jazz-tools/source": "./src/worker/napi-crypto.ts",
184
+ "types": "./dist/worker/napi-crypto.d.ts",
185
+ "default": "./dist/worker/napi-crypto.js"
181
186
  }
182
187
  },
183
188
  "type": "module",
184
189
  "license": "MIT",
185
- "version": "0.18.21",
190
+ "version": "0.18.23",
186
191
  "dependencies": {
187
192
  "@manuscripts/prosemirror-recreate-steps": "^0.1.4",
188
193
  "@scure/base": "1.2.1",
@@ -199,9 +204,9 @@
199
204
  "prosemirror-transform": "^1.9.0",
200
205
  "use-sync-external-store": "^1.5.0",
201
206
  "zod": "4.1.11",
202
- "cojson": "0.18.21",
203
- "cojson-storage-indexeddb": "0.18.21",
204
- "cojson-transport-ws": "0.18.21"
207
+ "cojson": "0.18.23",
208
+ "cojson-storage-indexeddb": "0.18.23",
209
+ "cojson-transport-ws": "0.18.23"
205
210
  },
206
211
  "devDependencies": {
207
212
  "@scure/bip39": "^1.3.0",
@@ -1,8 +1,10 @@
1
+ import { CautionIcon } from "./icons/caution.js";
1
2
  import { ChevronDownIcon } from "./icons/chevron-down-icon.js";
2
3
  import { DeleteIcon } from "./icons/delete-icon.js";
3
4
  import { LinkIcon } from "./icons/link-icon.js";
4
5
 
5
6
  const icons = {
7
+ caution: CautionIcon,
6
8
  chevronDown: ChevronDownIcon,
7
9
  delete: DeleteIcon,
8
10
  link: LinkIcon,
@@ -0,0 +1,18 @@
1
+ export function CautionIcon(props: React.SVGProps<SVGSVGElement>) {
2
+ return (
3
+ <svg
4
+ {...props}
5
+ xmlns="http://www.w3.org/2000/svg"
6
+ width="24"
7
+ height="24"
8
+ viewBox="0 0 24 24"
9
+ fill="none"
10
+ stroke="currentColor"
11
+ strokeLinejoin="round"
12
+ >
13
+ <circle cx="12" cy="12" r="12" fill="currentColor" />
14
+ <rect x="10.5" y="6" width="3" height="7.5" rx="1.5" fill="#fff" />
15
+ <rect x="10.5" y="16.5" width="3" height="3" rx="1.5" fill="#fff" />
16
+ </svg>
17
+ );
18
+ }
@@ -16,6 +16,7 @@ import {
16
16
  TableRow,
17
17
  } from "../ui/table.js";
18
18
  import { Text } from "../ui/text.js";
19
+ import { Icon } from "../ui/icon.js";
19
20
 
20
21
  const PaginationContainer = styled("div")`
21
22
  padding: 1rem 0;
@@ -25,6 +26,38 @@ const PaginationContainer = styled("div")`
25
26
  gap: 0.5rem;
26
27
  `;
27
28
 
29
+ const RedTooltip = styled("span")`
30
+ position:relative; /* making the .tooltip span a container for the tooltip text */
31
+ border-bottom:1px dashed #000; /* little indicater to indicate it's hoverable */
32
+
33
+ &:before {
34
+ content: attr(data-text);
35
+ background-color: red;
36
+ position:absolute;
37
+
38
+ /* vertically center */
39
+ top:50%;
40
+ transform:translateY(-50%);
41
+
42
+ /* move to right */
43
+ left:100%;
44
+ margin-left:15px; /* and add a small left margin */
45
+
46
+ /* basic styles */
47
+ width:200px;
48
+ padding:10px;
49
+ border-radius:10px;
50
+ color: #fff;
51
+ text-align:center;
52
+
53
+ display:none; /* hide by default */
54
+ }
55
+
56
+ &:hover:before {
57
+ display:block;
58
+ }
59
+ `;
60
+
28
61
  function CoValuesTableView({
29
62
  data,
30
63
  node,
@@ -61,7 +94,11 @@ function CoValuesTableView({
61
94
  }
62
95
 
63
96
  const keys = Array.from(
64
- new Set(resolvedRows.flatMap((item) => Object.keys(item.snapshot || {}))),
97
+ new Set(
98
+ resolvedRows
99
+ .filter((item) => item.snapshot !== "unavailable")
100
+ .flatMap((item) => Object.keys(item.snapshot || {})),
101
+ ),
65
102
  );
66
103
 
67
104
  const loadMore = () => {
@@ -73,7 +110,7 @@ function CoValuesTableView({
73
110
  <Table>
74
111
  <TableHead>
75
112
  <TableRow>
76
- {[...keys, "Action"].map((key) => (
113
+ {["ID", ...keys, "Action"].map((key) => (
77
114
  <TableHeader key={key}>{key}</TableHeader>
78
115
  ))}
79
116
  {onRemove && <TableHeader></TableHeader>}
@@ -82,27 +119,48 @@ function CoValuesTableView({
82
119
  <TableBody>
83
120
  {resolvedRows.slice(0, visibleRowsCount).map((item, index) => (
84
121
  <TableRow key={index}>
122
+ <TableCell>
123
+ <Text mono>
124
+ {item.snapshot === "unavailable" ? (
125
+ <RedTooltip data-text="Unavailable">
126
+ <Icon
127
+ name="caution"
128
+ color="red"
129
+ style={{
130
+ display: "inline-block",
131
+ marginRight: "0.5rem",
132
+ }}
133
+ />
134
+ {visibleRows[index]}
135
+ </RedTooltip>
136
+ ) : (
137
+ visibleRows[index]
138
+ )}
139
+ </Text>
140
+ </TableCell>
85
141
  {keys.map((key) => (
86
142
  <TableCell key={key}>
87
- <ValueRenderer
88
- json={(item.snapshot as JsonObject)[key]}
89
- onCoIDClick={(coId) => {
90
- async function handleClick() {
91
- onNavigate([
92
- {
93
- coId: item.value!.id,
94
- name: index.toString(),
95
- },
96
- {
97
- coId: coId,
98
- name: key,
99
- },
100
- ]);
101
- }
102
-
103
- handleClick();
104
- }}
105
- />
143
+ {item.snapshot !== "unavailable" && (
144
+ <ValueRenderer
145
+ json={item.snapshot[key]}
146
+ onCoIDClick={(coId) => {
147
+ async function handleClick() {
148
+ onNavigate([
149
+ {
150
+ coId: item.value!.id,
151
+ name: index.toString(),
152
+ },
153
+ {
154
+ coId: coId,
155
+ name: key,
156
+ },
157
+ ]);
158
+ }
159
+
160
+ handleClick();
161
+ }}
162
+ />
163
+ )}
106
164
  </TableCell>
107
165
  ))}
108
166
 
@@ -0,0 +1 @@
1
+ export * from "cojson/crypto/NapiCrypto";
package/tsup.config.ts CHANGED
@@ -131,6 +131,7 @@ export default defineConfig([
131
131
  entry: {
132
132
  index: "src/worker/index.ts",
133
133
  "edge-wasm": "src/worker/edge-wasm.ts",
134
+ "napi-crypto": "src/worker/napi-crypto.ts",
134
135
  },
135
136
  outDir: "dist/worker",
136
137
  },