jazz-tools 0.17.7 → 0.17.9

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.
Files changed (34) hide show
  1. package/.turbo/turbo-build.log +35 -35
  2. package/CHANGELOG.md +21 -0
  3. package/dist/{chunk-SJHXI5AB.js → chunk-33NYHM7D.js} +18 -4
  4. package/dist/chunk-33NYHM7D.js.map +1 -0
  5. package/dist/index.js +1 -1
  6. package/dist/prosemirror/index.js +36 -12
  7. package/dist/prosemirror/index.js.map +1 -1
  8. package/dist/prosemirror/lib/sync.d.ts.map +1 -1
  9. package/dist/react/auth/Clerk.d.ts +2 -1
  10. package/dist/react/auth/Clerk.d.ts.map +1 -1
  11. package/dist/react/index.js +4 -3
  12. package/dist/react/index.js.map +1 -1
  13. package/dist/react/provider.d.ts +2 -1
  14. package/dist/react/provider.d.ts.map +1 -1
  15. package/dist/testing.js +1 -1
  16. package/dist/tools/coValues/coMap.d.ts.map +1 -1
  17. package/dist/tools/exports.d.ts +1 -1
  18. package/dist/tools/exports.d.ts.map +1 -1
  19. package/dist/tools/implementation/zodSchema/runtimeConverters/coValueSchemaTransformation.d.ts +1 -1
  20. package/dist/tools/implementation/zodSchema/runtimeConverters/coValueSchemaTransformation.d.ts.map +1 -1
  21. package/dist/tools/implementation/zodSchema/zodCo.d.ts.map +1 -1
  22. package/package.json +4 -4
  23. package/src/prosemirror/lib/sync.ts +46 -16
  24. package/src/prosemirror/tests/plugin.test.ts +87 -31
  25. package/src/react/auth/Clerk.tsx +5 -3
  26. package/src/react/provider.tsx +3 -1
  27. package/src/tools/coValues/coMap.ts +5 -1
  28. package/src/tools/exports.ts +1 -0
  29. package/src/tools/implementation/zodSchema/runtimeConverters/coValueSchemaTransformation.ts +7 -2
  30. package/src/tools/implementation/zodSchema/zodCo.ts +11 -0
  31. package/src/tools/implementation/zodSchema/zodReExport.ts +7 -2
  32. package/src/tools/tests/account.test.ts +6 -0
  33. package/src/tools/tests/coMap.test.ts +6 -0
  34. package/dist/chunk-SJHXI5AB.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
 
2
- > jazz-tools@0.17.7 build /home/runner/_work/jazz/jazz/packages/jazz-tools
2
+ > jazz-tools@0.17.9 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"}
@@ -100,15 +100,15 @@
100
100
  ESM Build start
101
101
  CLI Cleaning output folder
102
102
  ESM Build start
103
- ESM dist/react/ssr.js 688.00 B
104
- ESM dist/react/ssr.js.map 1.12 KB
105
- ESM ⚡️ Build success in 16ms
106
103
  ESM dist/tiptap/index.js 564.00 B
107
104
  ESM dist/tiptap/index.js.map 1.21 KB
108
- ESM ⚡️ Build success in 15ms
105
+ ESM ⚡️ Build success in 11ms
106
+ ESM dist/react/ssr.js 688.00 B
107
+ ESM dist/react/ssr.js.map 1.12 KB
108
+ ESM ⚡️ Build success in 13ms
109
109
  ESM dist/worker/index.js 2.31 KB
110
110
  ESM dist/worker/index.js.map 4.77 KB
111
- ESM ⚡️ Build success in 15ms
111
+ ESM ⚡️ Build success in 13ms
112
112
  ESM dist/media/index.js 236.00 B
113
113
  ESM dist/media/index.browser.js 3.21 KB
114
114
  ESM dist/media/index.native.js 3.53 KB
@@ -117,67 +117,67 @@
117
117
  ESM dist/media/index.browser.js.map 6.02 KB
118
118
  ESM dist/media/index.native.js.map 6.52 KB
119
119
  ESM dist/media/chunk-E5J3WLQW.js.map 15.95 KB
120
- ESM ⚡️ Build success in 22ms
120
+ ESM ⚡️ Build success in 24ms
121
+ ESM dist/expo/index.js 4.65 KB
122
+ ESM dist/expo/testing.js 112.00 B
123
+ ESM dist/expo/crypto.js 153.00 B
124
+ ESM dist/expo/index.js.map 10.17 KB
125
+ ESM dist/expo/testing.js.map 168.00 B
126
+ ESM dist/expo/crypto.js.map 189.00 B
127
+ ESM ⚡️ Build success in 23ms
121
128
  ESM dist/react-core/index.js 8.41 KB
122
129
  ESM dist/react-core/testing.js 1.17 KB
123
130
  ESM dist/react-core/chunk-7DYMJ74I.js 279.00 B
124
131
  ESM dist/react-core/index.js.map 20.68 KB
125
132
  ESM dist/react-core/testing.js.map 1.82 KB
126
133
  ESM dist/react-core/chunk-7DYMJ74I.js.map 533.00 B
127
- ESM ⚡️ Build success in 20ms
134
+ ESM ⚡️ Build success in 21ms
128
135
  ESM dist/react-native/index.js 2.53 KB
129
- ESM dist/react-native/testing.js 120.00 B
130
136
  ESM dist/react-native/crypto.js 161.00 B
137
+ ESM dist/react-native/testing.js 120.00 B
131
138
  ESM dist/react-native/index.js.map 5.68 KB
132
- ESM dist/react-native/testing.js.map 176.00 B
133
139
  ESM dist/react-native/crypto.js.map 197.00 B
134
- ESM ⚡️ Build success in 33ms
140
+ ESM dist/react-native/testing.js.map 176.00 B
141
+ ESM ⚡️ Build success in 21ms
135
142
  ESM dist/browser/index.js 13.43 KB
136
143
  ESM dist/browser/index.js.map 28.65 KB
137
- ESM ⚡️ Build success in 37ms
138
- ESM dist/expo/index.js 4.65 KB
139
- ESM dist/expo/testing.js 112.00 B
140
- ESM dist/expo/crypto.js 153.00 B
141
- ESM dist/expo/index.js.map 10.17 KB
142
- ESM dist/expo/testing.js.map 168.00 B
143
- ESM dist/expo/crypto.js.map 189.00 B
144
- ESM ⚡️ Build success in 36ms
145
- ESM dist/react/index.js 24.55 KB
144
+ ESM ⚡️ Build success in 35ms
146
145
  ESM dist/react/testing.js 122.00 B
147
- ESM dist/react/index.js.map 52.68 KB
146
+ ESM dist/react/index.js 24.59 KB
148
147
  ESM dist/react/testing.js.map 165.00 B
149
- ESM ⚡️ Build success in 35ms
148
+ ESM dist/react/index.js.map 52.82 KB
149
+ ESM ⚡️ Build success in 32ms
150
150
  ESM dist/react-native-core/index.js 17.90 KB
151
151
  ESM dist/react-native-core/testing.js 119.00 B
152
152
  ESM dist/react-native-core/crypto.js 2.10 KB
153
153
  ESM dist/react-native-core/index.js.map 36.65 KB
154
154
  ESM dist/react-native-core/testing.js.map 175.00 B
155
155
  ESM dist/react-native-core/crypto.js.map 4.25 KB
156
- ESM ⚡️ Build success in 36ms
157
- ESM dist/prosemirror/index.js 76.90 KB
158
- ESM dist/prosemirror/index.js.map 305.53 KB
159
- ESM ⚡️ Build success in 45ms
156
+ ESM ⚡️ Build success in 32ms
157
+ ESM dist/prosemirror/index.js 77.61 KB
158
+ ESM dist/prosemirror/index.js.map 306.96 KB
159
+ ESM ⚡️ Build success in 42ms
160
160
  ESM dist/inspector/index.js 60.40 KB
161
161
  ESM dist/inspector/index.js.map 107.91 KB
162
- ESM ⚡️ Build success in 53ms
163
- ESM dist/index.js 25.96 KB
162
+ ESM ⚡️ Build success in 48ms
164
163
  ESM dist/testing.js 6.97 KB
165
- ESM dist/chunk-SJHXI5AB.js 153.63 KB
166
- ESM dist/index.js.map 52.62 KB
164
+ ESM dist/index.js 25.96 KB
165
+ ESM dist/chunk-33NYHM7D.js 154.05 KB
167
166
  ESM dist/testing.js.map 13.65 KB
168
- ESM dist/chunk-SJHXI5AB.js.map 368.28 KB
169
- ESM ⚡️ Build success in 75ms
167
+ ESM dist/index.js.map 52.62 KB
168
+ ESM dist/chunk-33NYHM7D.js.map 369.04 KB
169
+ ESM ⚡️ Build success in 59ms
170
170
  ESM dist/inspector/register-custom-element.js 218.00 B
171
171
  ESM dist/inspector/register-custom-element.js.map 314.00 B
172
172
  ESM dist/inspector/custom-element-I7L56H6B.js 1.53 MB
173
173
  ESM dist/inspector/custom-element-I7L56H6B.js.map 2.35 MB
174
- ESM ⚡️ Build success in 106ms
174
+ ESM ⚡️ Build success in 104ms
175
175
 
176
- > jazz-tools@0.17.7 types /home/runner/_work/jazz/jazz/packages/jazz-tools
176
+ > jazz-tools@0.17.9 types /home/runner/_work/jazz/jazz/packages/jazz-tools
177
177
  > tsc --outDir dist
178
178
 
179
179
 
180
- > jazz-tools@0.17.7 build:svelte /home/runner/_work/jazz/jazz/packages/jazz-tools
180
+ > jazz-tools@0.17.9 build:svelte /home/runner/_work/jazz/jazz/packages/jazz-tools
181
181
  > rm -rf dist/svelte && svelte-package -i src/svelte -o dist/svelte --tsconfig tsconfig.svelte.json
182
182
 
183
183
  src/svelte -> dist/svelte
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # jazz-tools
2
2
 
3
+ ## 0.17.9
4
+
5
+ ### Patch Changes
6
+
7
+ - 52ea0c7: Explicit loadAs in upsertUnique to use it without loaded context
8
+ - Updated dependencies [7586c3b]
9
+ - cojson@0.17.9
10
+ - cojson-storage-indexeddb@0.17.9
11
+ - cojson-transport-ws@0.17.9
12
+
13
+ ## 0.17.8
14
+
15
+ ### Patch Changes
16
+
17
+ - ac3e694: Fixed an issue where CoValue schemas could be incorrectly passed to `co.map` and `co.profile` schema definers.
18
+ - 6dbb053: Prosemirror: fix RangeError triggered when creating invalid HTML
19
+ - 1a182f0: Add missing BaseProfileShape export
20
+ - cojson@0.17.8
21
+ - cojson-storage-indexeddb@0.17.8
22
+ - cojson-transport-ws@0.17.8
23
+
3
24
  ## 0.17.7
4
25
 
5
26
  ### Patch Changes
@@ -115,7 +115,7 @@ function containsCoValueSchema(shape) {
115
115
  return Object.values(removeGetters(shape ?? {})).some(isAnyCoValueSchema);
116
116
  }
117
117
  function isAnyCoValueSchema(schema) {
118
- return "collaborative" in schema && schema.collaborative === true;
118
+ return typeof schema === "object" && schema !== null && "collaborative" in schema && schema.collaborative === true;
119
119
  }
120
120
 
121
121
  // src/tools/coValues/CoValueBase.ts
@@ -523,7 +523,11 @@ var _CoMap = class _CoMap extends CoValueBase {
523
523
  * @category Subscription & Loading
524
524
  */
525
525
  static async upsertUnique(options) {
526
- let mapId = _CoMap._findUnique(options.unique, options.owner.id);
526
+ const mapId = _CoMap._findUnique(
527
+ options.unique,
528
+ options.owner.id,
529
+ options.owner._loadedAs
530
+ );
527
531
  let map = await loadCoValueWithoutMe(this, mapId, {
528
532
  ...options,
529
533
  loadAs: options.owner._loadedAs,
@@ -4007,6 +4011,11 @@ var RichTextSchema = class {
4007
4011
 
4008
4012
  // src/tools/implementation/zodSchema/zodCo.ts
4009
4013
  var coMapDefiner = (shape) => {
4014
+ if (isAnyCoValueSchema2(shape)) {
4015
+ throw new Error(
4016
+ "co.map() expects an object as its argument, not a CoValue schema"
4017
+ );
4018
+ }
4010
4019
  const coreSchema = createCoreCoMapSchema(shape);
4011
4020
  return hydrateCoreCoValueSchema(coreSchema);
4012
4021
  };
@@ -4029,6 +4038,11 @@ var coListDefiner = (element) => {
4029
4038
  return hydrateCoreCoValueSchema(coreSchema);
4030
4039
  };
4031
4040
  var coProfileDefiner = (shape = {}) => {
4041
+ if (isAnyCoValueSchema2(shape)) {
4042
+ throw new Error(
4043
+ "co.profile() expects an object as its argument, not a CoValue schema"
4044
+ );
4045
+ }
4032
4046
  const ehnancedShape = Object.assign(shape, {
4033
4047
  name: z.string(),
4034
4048
  inbox: z.optional(z.string()),
@@ -4557,7 +4571,7 @@ function schemaFieldToCoFieldDef(schema) {
4557
4571
 
4558
4572
  // src/tools/implementation/zodSchema/runtimeConverters/coValueSchemaTransformation.ts
4559
4573
  function isAnyCoValueSchema2(schema) {
4560
- return "collaborative" in schema && schema.collaborative === true;
4574
+ return typeof schema === "object" && schema !== null && "collaborative" in schema && schema.collaborative === true;
4561
4575
  }
4562
4576
  function isCoValueSchema(schema) {
4563
4577
  return isAnyCoValueSchema2(schema) && "getCoValueClass" in schema;
@@ -5372,4 +5386,4 @@ export {
5372
5386
  JazzContextManager
5373
5387
  };
5374
5388
  /* istanbul ignore file -- @preserve */
5375
- //# sourceMappingURL=chunk-SJHXI5AB.js.map
5389
+ //# sourceMappingURL=chunk-33NYHM7D.js.map