@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.cjs CHANGED
@@ -1842,7 +1842,11 @@ function yXmlFragmentToProsemirrorJSON (xmlFragment) {
1842
1842
  * @param {any} _user user data
1843
1843
  * @return {boolean}
1844
1844
  */
1845
- const defaultAwarenessStateFilter = (currentClientId, userClientId, _user) => currentClientId !== userClientId;
1845
+ const defaultAwarenessStateFilter = (
1846
+ currentClientId,
1847
+ userClientId,
1848
+ _user
1849
+ ) => currentClientId !== userClientId;
1846
1850
 
1847
1851
  /**
1848
1852
  * Default generator for a cursor element
@@ -1896,10 +1900,14 @@ const createDecorations = (
1896
1900
  createSelection
1897
1901
  ) => {
1898
1902
  const ystate = ySyncPluginKey.getState(state);
1903
+ if (ystate == null || ystate.doc == null || ystate.binding == null) {
1904
+ return prosemirrorView.DecorationSet.create(state.doc, [])
1905
+ }
1899
1906
  const y = ystate.doc;
1900
1907
  const decorations = [];
1901
1908
  if (
1902
- ystate.snapshot != null || ystate.prevSnapshot != null ||
1909
+ ystate.snapshot != null ||
1910
+ ystate.prevSnapshot != null ||
1903
1911
  ystate.binding.mapping.size === 0
1904
1912
  ) {
1905
1913
  // do not render cursors while snapshot is active