jazz-tools 0.16.3 → 0.16.4

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.4 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,81 +107,81 @@
107
107
  ESM Build start
108
108
  CLI Cleaning output folder
109
109
  ESM Build start
110
+ ESM dist/browser-media-images/index.js 2.55 KB
111
+ ESM dist/browser-media-images/index.js.map 5.46 KB
112
+ ESM ⚡️ Build success in 25ms
113
+ ESM dist/react/ssr.js 688.00 B
114
+ ESM dist/react/ssr.js.map 1.12 KB
115
+ ESM ⚡️ Build success in 27ms
110
116
  ESM dist/worker/index.js 2.31 KB
111
117
  ESM dist/worker/index.js.map 4.77 KB
112
- ESM ⚡️ Build success in 16ms
118
+ ESM ⚡️ Build success in 25ms
113
119
  ESM dist/tiptap/index.js 564.00 B
114
120
  ESM dist/tiptap/index.js.map 1.21 KB
115
- ESM ⚡️ Build success in 17ms
116
- ESM dist/react/ssr.js 688.00 B
117
- ESM dist/react/ssr.js.map 1.12 KB
118
- ESM ⚡️ Build success in 19ms
119
- ESM dist/browser-media-images/index.js 2.55 KB
120
- ESM dist/browser-media-images/index.js.map 5.46 KB
121
- ESM ⚡️ Build success in 21ms
121
+ ESM ⚡️ Build success in 26ms
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
- ESM ⚡️ Build success in 18ms
124
+ ESM ⚡️ Build success in 30ms
125
125
  ESM dist/react-core/index.js 8.42 KB
126
126
  ESM dist/react-core/testing.js 1.17 KB
127
127
  ESM dist/react-core/chunk-7DYMJ74I.js 279.00 B
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 32ms
132
+ ESM dist/expo/index.js 4.65 KB
133
+ ESM dist/expo/testing.js 112.00 B
134
+ ESM dist/expo/crypto.js 109.00 B
135
+ ESM dist/expo/index.js.map 10.17 KB
136
+ ESM dist/expo/testing.js.map 168.00 B
137
+ ESM dist/expo/crypto.js.map 166.00 B
138
+ ESM ⚡️ Build success in 37ms
135
139
  ESM dist/react-native/index.js 2.53 KB
136
140
  ESM dist/react-native/testing.js 120.00 B
137
141
  ESM dist/react-native/crypto.js 117.00 B
138
142
  ESM dist/react-native/index.js.map 5.68 KB
139
143
  ESM dist/react-native/testing.js.map 176.00 B
140
144
  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
145
+ ESM ⚡️ Build success in 41ms
143
146
  ESM dist/react/index.js 20.70 KB
144
- ESM dist/react/testing.js.map 165.00 B
147
+ ESM dist/react/testing.js 122.00 B
145
148
  ESM dist/react/index.js.map 34.14 KB
146
- ESM ⚡️ Build success in 36ms
147
- ESM dist/expo/index.js 4.65 KB
148
- ESM dist/expo/testing.js 112.00 B
149
- 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
- ESM dist/expo/testing.js.map 168.00 B
153
- ESM ⚡️ Build success in 39ms
149
+ ESM dist/react/testing.js.map 165.00 B
150
+ ESM ⚡️ Build success in 43ms
151
+ ESM dist/browser/index.js 13.43 KB
152
+ ESM dist/browser/index.js.map 28.65 KB
153
+ ESM ⚡️ Build success in 49ms
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 54ms
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 61ms
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 73ms
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-74LZG2M3.js 151.07 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-74LZG2M3.js.map 362.38 KB
173
+ ESM ⚡️ Build success in 91ms
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 135ms
179
179
 
180
- > jazz-tools@0.16.3 types /home/runner/_work/jazz/jazz/packages/jazz-tools
180
+ > jazz-tools@0.16.4 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.4 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,16 @@
1
1
  # jazz-tools
2
2
 
3
+ ## 0.16.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 16764f6: Added `pick()` and `partial()` methods to CoMapSchema
8
+ - Updated dependencies [f9d538f]
9
+ - Updated dependencies [802b5a3]
10
+ - cojson@0.16.4
11
+ - cojson-storage-indexeddb@0.16.4
12
+ - cojson-transport-ws@0.16.4
13
+
3
14
  ## 0.16.3
4
15
 
5
16
  ### 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 {
@@ -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;
@@ -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-74LZG2M3.js.map