jazz-tools 0.16.3 → 0.16.5

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
 
2
- > jazz-tools@0.16.3 build /home/runner/_work/jazz/jazz/packages/jazz-tools
2
+ > jazz-tools@0.16.5 build /home/runner/_work/jazz/jazz/packages/jazz-tools
3
3
  > tsup && pnpm types && pnpm build:svelte
4
4
 
5
5
  CLI Building entry: {"index":"src/index.ts","testing":"src/testing.ts"}
@@ -107,18 +107,18 @@
107
107
  ESM Build start
108
108
  CLI Cleaning output folder
109
109
  ESM Build start
110
- ESM dist/worker/index.js 2.31 KB
111
- ESM dist/worker/index.js.map 4.77 KB
112
- ESM ⚡️ Build success in 16ms
113
110
  ESM dist/tiptap/index.js 564.00 B
114
111
  ESM dist/tiptap/index.js.map 1.21 KB
115
- ESM ⚡️ Build success in 17ms
112
+ ESM ⚡️ Build success in 15ms
116
113
  ESM dist/react/ssr.js 688.00 B
117
114
  ESM dist/react/ssr.js.map 1.12 KB
118
- ESM ⚡️ Build success in 19ms
115
+ ESM ⚡️ Build success in 17ms
116
+ ESM dist/worker/index.js 2.31 KB
117
+ ESM dist/worker/index.js.map 4.77 KB
118
+ ESM ⚡️ Build success in 15ms
119
119
  ESM dist/browser-media-images/index.js 2.55 KB
120
120
  ESM dist/browser-media-images/index.js.map 5.46 KB
121
- ESM ⚡️ Build success in 21ms
121
+ ESM ⚡️ Build success in 20ms
122
122
  ESM dist/react-native-media-images/index.js 6.19 KB
123
123
  ESM dist/react-native-media-images/index.js.map 10.96 KB
124
124
  ESM ⚡️ Build success in 18ms
@@ -128,60 +128,60 @@
128
128
  ESM dist/react-core/index.js.map 20.69 KB
129
129
  ESM dist/react-core/testing.js.map 1.82 KB
130
130
  ESM dist/react-core/chunk-7DYMJ74I.js.map 533.00 B
131
- ESM ⚡️ Build success in 25ms
132
- ESM dist/browser/index.js 13.43 KB
133
- ESM dist/browser/index.js.map 28.65 KB
134
- ESM ⚡️ Build success in 38ms
131
+ ESM ⚡️ Build success in 19ms
135
132
  ESM dist/react-native/index.js 2.53 KB
136
133
  ESM dist/react-native/testing.js 120.00 B
137
134
  ESM dist/react-native/crypto.js 117.00 B
138
135
  ESM dist/react-native/index.js.map 5.68 KB
139
136
  ESM dist/react-native/testing.js.map 176.00 B
140
137
  ESM dist/react-native/crypto.js.map 174.00 B
141
- ESM ⚡️ Build success in 35ms
142
- ESM dist/react/testing.js 122.00 B
143
- ESM dist/react/index.js 20.70 KB
144
- ESM dist/react/testing.js.map 165.00 B
145
- ESM dist/react/index.js.map 34.14 KB
146
- ESM ⚡️ Build success in 36ms
147
- ESM dist/expo/index.js 4.65 KB
138
+ ESM ⚡️ Build success in 20ms
139
+ ESM dist/browser/index.js 13.43 KB
140
+ ESM dist/browser/index.js.map 28.65 KB
141
+ ESM ⚡️ Build success in 24ms
148
142
  ESM dist/expo/testing.js 112.00 B
143
+ ESM dist/expo/index.js 4.65 KB
149
144
  ESM dist/expo/crypto.js 109.00 B
150
- ESM dist/expo/index.js.map 10.17 KB
151
- ESM dist/expo/crypto.js.map 166.00 B
152
145
  ESM dist/expo/testing.js.map 168.00 B
153
- ESM ⚡️ Build success in 39ms
146
+ ESM dist/expo/crypto.js.map 166.00 B
147
+ ESM dist/expo/index.js.map 10.17 KB
148
+ ESM ⚡️ Build success in 30ms
149
+ ESM dist/react/index.js 20.70 KB
150
+ ESM dist/react/testing.js 122.00 B
151
+ ESM dist/react/index.js.map 34.14 KB
152
+ ESM dist/react/testing.js.map 165.00 B
153
+ ESM ⚡️ Build success in 37ms
154
154
  ESM dist/react-native-core/index.js 16.95 KB
155
155
  ESM dist/react-native-core/testing.js 119.00 B
156
156
  ESM dist/react-native-core/crypto.js 2.10 KB
157
157
  ESM dist/react-native-core/index.js.map 33.57 KB
158
158
  ESM dist/react-native-core/testing.js.map 175.00 B
159
159
  ESM dist/react-native-core/crypto.js.map 4.25 KB
160
- ESM ⚡️ Build success in 37ms
160
+ ESM ⚡️ Build success in 36ms
161
161
  ESM dist/prosemirror/index.js 76.90 KB
162
162
  ESM dist/prosemirror/index.js.map 305.53 KB
163
- ESM ⚡️ Build success in 51ms
163
+ ESM ⚡️ Build success in 39ms
164
164
  ESM dist/inspector/index.js 60.37 KB
165
165
  ESM dist/inspector/index.js.map 107.85 KB
166
- ESM ⚡️ Build success in 57ms
166
+ ESM ⚡️ Build success in 52ms
167
167
  ESM dist/testing.js 6.76 KB
168
168
  ESM dist/index.js 26.00 KB
169
- ESM dist/chunk-RAMDW4VL.js 150.32 KB
169
+ ESM dist/chunk-H3BIFFQG.js 151.06 KB
170
170
  ESM dist/testing.js.map 13.06 KB
171
171
  ESM dist/index.js.map 52.65 KB
172
- ESM dist/chunk-RAMDW4VL.js.map 359.88 KB
173
- ESM ⚡️ Build success in 76ms
172
+ ESM dist/chunk-H3BIFFQG.js.map 362.50 KB
173
+ ESM ⚡️ Build success in 69ms
174
174
  ESM dist/inspector/register-custom-element.js 218.00 B
175
175
  ESM dist/inspector/register-custom-element.js.map 314.00 B
176
176
  ESM dist/inspector/custom-element-TUXKXSZU.js 1.53 MB
177
177
  ESM dist/inspector/custom-element-TUXKXSZU.js.map 2.35 MB
178
- ESM ⚡️ Build success in 116ms
178
+ ESM ⚡️ Build success in 107ms
179
179
 
180
- > jazz-tools@0.16.3 types /home/runner/_work/jazz/jazz/packages/jazz-tools
180
+ > jazz-tools@0.16.5 types /home/runner/_work/jazz/jazz/packages/jazz-tools
181
181
  > tsc --outDir dist
182
182
 
183
183
 
184
- > jazz-tools@0.16.3 build:svelte /home/runner/_work/jazz/jazz/packages/jazz-tools
184
+ > jazz-tools@0.16.5 build:svelte /home/runner/_work/jazz/jazz/packages/jazz-tools
185
185
  > rm -rf dist/svelte && svelte-package -i src/svelte -o dist/svelte --tsconfig tsconfig.svelte.json
186
186
 
187
187
  src/svelte -> dist/svelte
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # jazz-tools
2
2
 
3
+ ## 0.16.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 3cd1586: Makes the key rotation not fail when child groups are unavailable or their readkey is not accessible.
8
+
9
+ Also changes the Group.removeMember method to not return a Promise, because:
10
+
11
+ - All the locally available child groups are rotated immediately
12
+ - All the remote child groups are rotated in background, but since they are not locally available the user won't need the new key immediately
13
+
14
+ - 33ebbf0: Fix error when using nested discriminatedUnion
15
+ - Updated dependencies [3cd1586]
16
+ - Updated dependencies [267f689]
17
+ - cojson@0.16.5
18
+ - cojson-storage-indexeddb@0.16.5
19
+ - cojson-transport-ws@0.16.5
20
+
21
+ ## 0.16.4
22
+
23
+ ### Patch Changes
24
+
25
+ - 16764f6: Added `pick()` and `partial()` methods to CoMapSchema
26
+ - Updated dependencies [f9d538f]
27
+ - Updated dependencies [802b5a3]
28
+ - cojson@0.16.4
29
+ - cojson-storage-indexeddb@0.16.4
30
+ - cojson-transport-ws@0.16.4
31
+
3
32
  ## 0.16.3
4
33
 
5
34
  ### Patch Changes
@@ -118,11 +118,6 @@ function isAnyCoValueSchema(schema) {
118
118
  return "collaborative" in schema && schema.collaborative === true;
119
119
  }
120
120
 
121
- // src/tools/coValues/interfaces.ts
122
- import {
123
- emptyKnownState
124
- } from "cojson";
125
-
126
121
  // src/tools/coValues/CoValueBase.ts
127
122
  import { ControlledAccount, RawAccount } from "cojson";
128
123
  var CoValueBase = class {
@@ -2095,7 +2090,7 @@ var _Group = class _Group extends CoValueBase {
2095
2090
  }
2096
2091
  removeMember(member) {
2097
2092
  if (member !== "everyone" && member._type === "Group") {
2098
- return this._raw.revokeExtend(member._raw);
2093
+ this._raw.revokeExtend(member._raw);
2099
2094
  } else {
2100
2095
  return this._raw.removeMember(
2101
2096
  member === "everyone" ? member : member._raw
@@ -4063,6 +4058,33 @@ function enrichCoMapSchema(schema, coValueClass) {
4063
4058
  },
4064
4059
  optional: () => {
4065
4060
  return coOptionalDefiner(coValueSchema);
4061
+ },
4062
+ pick: (keys) => {
4063
+ const keysSet = new Set(Object.keys(keys));
4064
+ const pickedShape = {};
4065
+ for (const [key, value] of Object.entries(coValueSchema.shape)) {
4066
+ if (keysSet.has(key)) {
4067
+ pickedShape[key] = value;
4068
+ }
4069
+ }
4070
+ return coMapDefiner(pickedShape);
4071
+ },
4072
+ partial: () => {
4073
+ const partialShape = {};
4074
+ for (const [key, value] of Object.entries(coValueSchema.shape)) {
4075
+ if (isAnyCoValueSchema2(value)) {
4076
+ partialShape[key] = coOptionalDefiner(value);
4077
+ } else {
4078
+ partialShape[key] = z.optional(coValueSchema.shape[key]);
4079
+ }
4080
+ }
4081
+ const partialCoMapSchema = coMapDefiner(partialShape);
4082
+ if (coValueSchema.catchAll) {
4083
+ return partialCoMapSchema.catchall(
4084
+ coValueSchema.catchAll
4085
+ );
4086
+ }
4087
+ return partialCoMapSchema;
4066
4088
  }
4067
4089
  });
4068
4090
  return coValueSchema;
@@ -4292,7 +4314,7 @@ function schemaUnionDiscriminatorFor(schema) {
4292
4314
  continue;
4293
4315
  }
4294
4316
  }
4295
- if (discriminatorDef._zod.def.type !== "literal") {
4317
+ if (discriminatorDef._zod?.def.type !== "literal") {
4296
4318
  break;
4297
4319
  }
4298
4320
  const literalDef = discriminatorDef._zod.def;
@@ -5211,8 +5233,8 @@ function loadContentPiecesFromCoValue(core2, valuesExported, contentPieces) {
5211
5233
  loadContentPiecesFromCoValue(depCoValue, valuesExported, contentPieces);
5212
5234
  }
5213
5235
  }
5214
- const pieces = core2.verified.newContentSince(emptyKnownState(core2.id));
5215
- for (const piece of pieces ?? []) {
5236
+ const pieces = core2.verified.newContentSince(void 0) ?? [];
5237
+ for (const piece of pieces) {
5216
5238
  contentPieces.push(piece);
5217
5239
  }
5218
5240
  }
@@ -5265,4 +5287,4 @@ export {
5265
5287
  JazzContextManager
5266
5288
  };
5267
5289
  /* istanbul ignore file -- @preserve */
5268
- //# sourceMappingURL=chunk-RAMDW4VL.js.map
5290
+ //# sourceMappingURL=chunk-H3BIFFQG.js.map