jupyter-ydoc 3.0.0a8__py3-none-any.whl → 3.0.0a9__py3-none-any.whl

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.
jupyter_ydoc/_version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # This file is auto-generated by Hatchling. As such, do not:
2
2
  # - modify
3
3
  # - track in version control e.g. be sure to add to .gitignore
4
- __version__ = VERSION = '3.0.0a8'
4
+ __version__ = VERSION = '3.0.0a9'
jupyter_ydoc/ybasedoc.py CHANGED
@@ -4,7 +4,7 @@
4
4
  from abc import ABC, abstractmethod
5
5
  from typing import Any, Callable, Dict, Optional
6
6
 
7
- from pycrdt import Doc, Map, Subscription, UndoManager
7
+ from pycrdt import Awareness, Doc, Map, Subscription, UndoManager
8
8
 
9
9
 
10
10
  class YBaseDoc(ABC):
@@ -20,17 +20,22 @@ class YBaseDoc(ABC):
20
20
  _subscriptions: Dict[Any, Subscription]
21
21
  _undo_manager: UndoManager
22
22
 
23
- def __init__(self, ydoc: Optional[Doc] = None):
23
+ def __init__(self, ydoc: Optional[Doc] = None, awareness: Optional[Awareness] = None):
24
24
  """
25
25
  Constructs a YBaseDoc.
26
26
 
27
27
  :param ydoc: The :class:`pycrdt.Doc` that will hold the data of the document, if provided.
28
28
  :type ydoc: :class:`pycrdt.Doc`, optional.
29
+ :param awareness: The :class:`pycrdt.Awareness` that shares non persistent data
30
+ between clients.
31
+ :type awareness: :class:`pycrdt.Awareness`, optional.
29
32
  """
30
33
  if ydoc is None:
31
34
  self._ydoc = Doc()
32
35
  else:
33
36
  self._ydoc = ydoc
37
+ self.awareness = awareness
38
+
34
39
  self._ystate = self._ydoc.get("state", type=Map)
35
40
  self._subscriptions = {}
36
41
  self._undo_manager = UndoManager(doc=self._ydoc, capture_timeout_millis=0)
jupyter_ydoc/yblob.py CHANGED
@@ -4,7 +4,7 @@
4
4
  from functools import partial
5
5
  from typing import Any, Callable, Optional
6
6
 
7
- from pycrdt import Doc, Map
7
+ from pycrdt import Awareness, Doc, Map
8
8
 
9
9
  from .ybasedoc import YBaseDoc
10
10
 
@@ -24,14 +24,17 @@ class YBlob(YBaseDoc):
24
24
  }
25
25
  """
26
26
 
27
- def __init__(self, ydoc: Optional[Doc] = None):
27
+ def __init__(self, ydoc: Optional[Doc] = None, awareness: Optional[Awareness] = None):
28
28
  """
29
29
  Constructs a YBlob.
30
30
 
31
31
  :param ydoc: The :class:`pycrdt.Doc` that will hold the data of the document, if provided.
32
32
  :type ydoc: :class:`pycrdt.Doc`, optional.
33
+ :param awareness: The :class:`pycrdt.Awareness` that shares non persistent data
34
+ between clients.
35
+ :type awareness: :class:`pycrdt.Awareness`, optional.
33
36
  """
34
- super().__init__(ydoc)
37
+ super().__init__(ydoc, awareness)
35
38
  self._ysource = self._ydoc.get("source", type=Map)
36
39
  self.undo_manager.expand_scope(self._ysource)
37
40
 
jupyter_ydoc/ynotebook.py CHANGED
@@ -6,7 +6,7 @@ from functools import partial
6
6
  from typing import Any, Callable, Dict, Optional
7
7
  from uuid import uuid4
8
8
 
9
- from pycrdt import Array, Doc, Map, Text
9
+ from pycrdt import Array, Awareness, Doc, Map, Text
10
10
 
11
11
  from .utils import cast_all
12
12
  from .ybasedoc import YBaseDoc
@@ -47,14 +47,17 @@ class YNotebook(YBaseDoc):
47
47
  }
48
48
  """
49
49
 
50
- def __init__(self, ydoc: Optional[Doc] = None):
50
+ def __init__(self, ydoc: Optional[Doc] = None, awareness: Optional[Awareness] = None):
51
51
  """
52
52
  Constructs a YNotebook.
53
53
 
54
54
  :param ydoc: The :class:`pycrdt.Doc` that will hold the data of the document, if provided.
55
55
  :type ydoc: :class:`pycrdt.Doc`, optional.
56
+ :param awareness: The :class:`pycrdt.Awareness` that shares non persistent data
57
+ between clients.
58
+ :type awareness: :class:`pycrdt.Awareness`, optional.
56
59
  """
57
- super().__init__(ydoc)
60
+ super().__init__(ydoc, awareness)
58
61
  self._ymeta = self._ydoc.get("meta", type=Map)
59
62
  self._ycells = self._ydoc.get("cells", type=Array)
60
63
  self.undo_manager.expand_scope(self._ycells)
jupyter_ydoc/yunicode.py CHANGED
@@ -4,7 +4,7 @@
4
4
  from functools import partial
5
5
  from typing import Any, Callable, Optional
6
6
 
7
- from pycrdt import Doc, Text
7
+ from pycrdt import Awareness, Doc, Text
8
8
 
9
9
  from .ybasedoc import YBaseDoc
10
10
 
@@ -23,14 +23,17 @@ class YUnicode(YBaseDoc):
23
23
  }
24
24
  """
25
25
 
26
- def __init__(self, ydoc: Optional[Doc] = None):
26
+ def __init__(self, ydoc: Optional[Doc] = None, awareness: Optional[Awareness] = None):
27
27
  """
28
28
  Constructs a YUnicode.
29
29
 
30
30
  :param ydoc: The :class:`pycrdt.Doc` that will hold the data of the document, if provided.
31
31
  :type ydoc: :class:`pycrdt.Doc`, optional.
32
+ :param awareness: The :class:`pycrdt.Awareness` that shares non persistent data
33
+ between clients.
34
+ :type awareness: :class:`pycrdt.Awareness`, optional.
32
35
  """
33
- super().__init__(ydoc)
36
+ super().__init__(ydoc, awareness)
34
37
  self._ysource = self._ydoc.get("source", type=Text)
35
38
  self.undo_manager.expand_scope(self._ysource)
36
39
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: jupyter-ydoc
3
- Version: 3.0.0a8
3
+ Version: 3.0.0a9
4
4
  Summary: Document structures for collaborative editing using Ypy
5
5
  Project-URL: Homepage, https://jupyter.org
6
6
  Project-URL: Source, https://github.com/jupyter-server/jupyter_ydoc
@@ -10,7 +10,7 @@ License-File: LICENSE
10
10
  Keywords: jupyter,pycrdt,yjs
11
11
  Requires-Python: >=3.8
12
12
  Requires-Dist: importlib-metadata>=3.6; python_version < '3.10'
13
- Requires-Dist: pycrdt<0.10.0,>=0.9.0
13
+ Requires-Dist: pycrdt<0.11.0,>=0.10.1
14
14
  Provides-Extra: dev
15
15
  Requires-Dist: click; extra == 'dev'
16
16
  Requires-Dist: jupyter-releaser; extra == 'dev'
@@ -21,7 +21,7 @@ Requires-Dist: pydata-sphinx-theme; extra == 'docs'
21
21
  Requires-Dist: sphinx; extra == 'docs'
22
22
  Provides-Extra: test
23
23
  Requires-Dist: pre-commit; extra == 'test'
24
- Requires-Dist: pycrdt-websocket<0.15.0,>=0.14.1; extra == 'test'
24
+ Requires-Dist: pycrdt-websocket<0.16.0,>=0.15.0; extra == 'test'
25
25
  Requires-Dist: pytest; extra == 'test'
26
26
  Requires-Dist: pytest-asyncio; extra == 'test'
27
27
  Requires-Dist: websockets>=10.0; extra == 'test'
@@ -0,0 +1,14 @@
1
+ jupyter_ydoc/__init__.py,sha256=cVoElIvmvfj0IECe1gKe3f5vyyO7Dq7dMB_A0s2zjs4,649
2
+ jupyter_ydoc/_version.py,sha256=jM0EXcZQ5WbMklpqcD5La5cLQ4WuyTq2tmqX3Kbz2Bc,173
3
+ jupyter_ydoc/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ jupyter_ydoc/utils.py,sha256=jnjF2uNmioh0z_4ymmMSYiB_2dAKSLmNFzVvR5V5Td0,883
5
+ jupyter_ydoc/ybasedoc.py,sha256=RUkrlfu7xp6UfnxhKLB9tHCQyQDTAH10jmQ_AEY5Suo,5119
6
+ jupyter_ydoc/yblob.py,sha256=44ZUakq9anNLAcaEuM9RpVN-J6Owf5kFpJJ80mTni8c,2253
7
+ jupyter_ydoc/yfile.py,sha256=XTMtAXDWgIOLU2KUQxkLJz2cGvSPlOxpvJc4daXCV6I,198
8
+ jupyter_ydoc/ynotebook.py,sha256=E_9bdWxx5roY6XjTYcn4guwEODa262fmX09BaHiHjxs,8339
9
+ jupyter_ydoc/yunicode.py,sha256=Um1BIGwne10ZQODeRA1qIi_vss-u3MKsjZNjbKodfQM,2385
10
+ jupyter_ydoc-3.0.0a9.dist-info/METADATA,sha256=3INzad1RxC6jBh-U0A3x_y3z0-nBttkgSNVVaCMzM1w,3016
11
+ jupyter_ydoc-3.0.0a9.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
12
+ jupyter_ydoc-3.0.0a9.dist-info/entry_points.txt,sha256=lgvRG-rpsjRKf8cy7LpO7fqwwXy0sBVMCwhGOHgn4mc,164
13
+ jupyter_ydoc-3.0.0a9.dist-info/licenses/LICENSE,sha256=dqphsFbhnlzPK7Vlkc66Zc7g7PS-e1dln07GXIVpFCQ,1567
14
+ jupyter_ydoc-3.0.0a9.dist-info/RECORD,,
@@ -1,14 +0,0 @@
1
- jupyter_ydoc/__init__.py,sha256=cVoElIvmvfj0IECe1gKe3f5vyyO7Dq7dMB_A0s2zjs4,649
2
- jupyter_ydoc/_version.py,sha256=NWh4fpt9rZXQm0_S49cVtVlMj9a3n1kcC0g7QGaxlaM,173
3
- jupyter_ydoc/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- jupyter_ydoc/utils.py,sha256=jnjF2uNmioh0z_4ymmMSYiB_2dAKSLmNFzVvR5V5Td0,883
5
- jupyter_ydoc/ybasedoc.py,sha256=68oZ_0s-uITkBZz8syvw_DvDK_Uht7CHl6slaVSrSqM,4840
6
- jupyter_ydoc/yblob.py,sha256=kTBSgQfUBpzwbfRCP8cs02PIliLoZB2oixrGOdpFsbw,1999
7
- jupyter_ydoc/yfile.py,sha256=XTMtAXDWgIOLU2KUQxkLJz2cGvSPlOxpvJc4daXCV6I,198
8
- jupyter_ydoc/ynotebook.py,sha256=NuW6-zpd0WX99eVINNh9Qbtex6n1qg9kjnkxWeGH_eE,8085
9
- jupyter_ydoc/yunicode.py,sha256=AVjQov_MBetyr6Xop1daLWKgTpXURwC2b-t1Nvzkz14,2131
10
- jupyter_ydoc-3.0.0a8.dist-info/METADATA,sha256=fVVgDmW_JURT8GuDavRGztQ30L6ggE-zNKTusErDpYw,3015
11
- jupyter_ydoc-3.0.0a8.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
12
- jupyter_ydoc-3.0.0a8.dist-info/entry_points.txt,sha256=lgvRG-rpsjRKf8cy7LpO7fqwwXy0sBVMCwhGOHgn4mc,164
13
- jupyter_ydoc-3.0.0a8.dist-info/licenses/LICENSE,sha256=dqphsFbhnlzPK7Vlkc66Zc7g7PS-e1dln07GXIVpFCQ,1567
14
- jupyter_ydoc-3.0.0a8.dist-info/RECORD,,