@tiptap/y-tiptap 3.0.1 → 3.0.2

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/dist/y-tiptap.js CHANGED
@@ -1808,7 +1808,11 @@ function yXmlFragmentToProsemirrorJSON (xmlFragment) {
1808
1808
  * @param {any} _user user data
1809
1809
  * @return {boolean}
1810
1810
  */
1811
- const defaultAwarenessStateFilter = (currentClientId, userClientId, _user) => currentClientId !== userClientId;
1811
+ const defaultAwarenessStateFilter = (
1812
+ currentClientId,
1813
+ userClientId,
1814
+ _user
1815
+ ) => currentClientId !== userClientId;
1812
1816
 
1813
1817
  /**
1814
1818
  * Default generator for a cursor element
@@ -1862,10 +1866,14 @@ const createDecorations = (
1862
1866
  createSelection
1863
1867
  ) => {
1864
1868
  const ystate = ySyncPluginKey.getState(state);
1869
+ if (ystate == null || ystate.doc == null || ystate.binding == null) {
1870
+ return DecorationSet.create(state.doc, [])
1871
+ }
1865
1872
  const y = ystate.doc;
1866
1873
  const decorations = [];
1867
1874
  if (
1868
- ystate.snapshot != null || ystate.prevSnapshot != null ||
1875
+ ystate.snapshot != null ||
1876
+ ystate.prevSnapshot != null ||
1869
1877
  ystate.binding.mapping.size === 0
1870
1878
  ) {
1871
1879
  // do not render cursors while snapshot is active