tiptap-python-utils 0.3.0__py3-none-any.whl → 0.4.0__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.
@@ -8,6 +8,8 @@ MARKS = "marks"
8
8
  ID = "id"
9
9
  TIPTAP_ID = "tiptapId"
10
10
  SHARED_ID = "sharedId"
11
+ SHARED = "shared"
12
+ PLACE = "place"
11
13
  LEVEL = "level"
12
14
  CHECKED = "checked"
13
15
  STATUS = "status"
@@ -52,13 +52,22 @@ class SharedFamilies:
52
52
  return len(self._bodies)
53
53
 
54
54
  def merge(self, target: Node) -> Node:
55
- """Return target rewritten from the canonical body, preserving local id and sharedId."""
55
+ """Return target rewritten from the canonical body.
56
+
57
+ Preserves the target's per-copy identity (local id, sharedId) and its
58
+ per-copy ``place`` discriminator. The family-identical ``shared`` core
59
+ rides along from the canonical body unchanged.
60
+ """
56
61
  canonical = self[target.shared_id]
57
62
  raw = canonical.raw()
58
63
  attrs = dict(raw.get(key.ATTRS, {}))
64
+ attrs.pop(key.PLACE, None)
59
65
  if target.id:
60
66
  attrs[key.ID] = target.id
61
67
  if target.shared_id:
62
68
  attrs[key.SHARED_ID] = target.shared_id
69
+ target_attrs = target.raw().get(key.ATTRS, {})
70
+ if key.PLACE in target_attrs:
71
+ attrs[key.PLACE] = target_attrs[key.PLACE]
63
72
  raw[key.ATTRS] = attrs
64
73
  return codec.read_node(raw)
@@ -13,6 +13,9 @@ def fingerprint(node: Node) -> str:
13
13
  attrs = dict(raw.get(key.ATTRS, {}))
14
14
  attrs.pop(key.ID, None)
15
15
  attrs.pop(key.SHARED_ID, None)
16
+ attrs.pop(key.SHARED, None)
17
+ attrs.pop(key.PLACE, None)
18
+ attrs.pop(key.TASK_CANONICAL_ID, None)
16
19
  if attrs:
17
20
  raw[key.ATTRS] = attrs
18
21
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tiptap_python_utils
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: Python utilities for parsing, traversing, editing, and serializing TipTap JSON content.
5
5
  Author: tiptap_python_utils contributors
6
6
  License: MIT License
@@ -8,7 +8,7 @@ tiptap_python_utils/codec/raw.py,sha256=glQWotPxzOFvPkg3nBBk3GbcM03Cj2yRclG62ckb
8
8
  tiptap_python_utils/codec/reader.py,sha256=zBJQZ8NX3MuNNhEZbP2POjj9OnkiO64jnGoKDvbqju0,1376
9
9
  tiptap_python_utils/codec/writer.py,sha256=YkOyHkkiufCRFUDtnuGXd6AD4a57mDsDWksn4ZFzyyc,285
10
10
  tiptap_python_utils/contract/__init__.py,sha256=gJMHPqIl6vkcXAOKNKtZIbs8aQs1abqykEpc5i3abQY,115
11
- tiptap_python_utils/contract/key.py,sha256=6T4Y-26hESduXmLaNOOpbZ-zTYkHgABvDCHjL6b2VDM,260
11
+ tiptap_python_utils/contract/key.py,sha256=JV-pBYY_zO9uZ3XWQtjzrTcmhgisVFO2O-zscrUHhPA,294
12
12
  tiptap_python_utils/contract/kind.py,sha256=I-vkJ9mskw07qjbIR5uC1s3z0AvtwA2y3qovkzTsY2Q,297
13
13
  tiptap_python_utils/contract/policy.py,sha256=AeJfLv07JWqhuJMakUgz1Y-bMpac28h426bj17hKvwk,1193
14
14
  tiptap_python_utils/model/__init__.py,sha256=Xv2GP0fCM72H2_Jxo5vvJfStA6ztDavzjYcaV0U0p9g,1049
@@ -19,8 +19,8 @@ tiptap_python_utils/model/registry.py,sha256=2TbiEvUkVh85W0I0YKjpeVivcvKFCvcO1Gt
19
19
  tiptap_python_utils/select/__init__.py,sha256=lFavos0E3w2D_keUPDa5xkWhIjkQiee7yNK7X-G-U6o,88
20
20
  tiptap_python_utils/select/selection.py,sha256=oTJ5l4o4vr0yKMXcIfhZInzXFqD8X6T9ZhE2WSxpVEY,4999
21
21
  tiptap_python_utils/shared/__init__.py,sha256=XoRaVFjOlCWbnTeTFKw5DdoLqGA6sGdRr0eGpSkFQS8,223
22
- tiptap_python_utils/shared/families.py,sha256=7B39bXpEePfearOl2tzLDuJelo1yG67-anzVlmnidVs,2069
23
- tiptap_python_utils/shared/fingerprint.py,sha256=YUKhUgPXIEFQ_ujUxnh1jPfxT1eilrFP_-hmqXmlkCM,476
22
+ tiptap_python_utils/shared/families.py,sha256=T89HaILztYmEJU_0rWeJYQuTc1uU0oCS1QuYQF_b-wg,2440
23
+ tiptap_python_utils/shared/fingerprint.py,sha256=X0zrxbjM-ATUukXp5YUYBW9XzkeeYxP7szpHeFBsr_8,582
24
24
  tiptap_python_utils/shared/identity.py,sha256=cwUy6CMvlGV15Z8FyY3idDl2tPs9eiIWbwJRsNQgwY0,164
25
25
  tiptap_python_utils/tasks/__init__.py,sha256=EXNu9YfJHBjyUZGf5HJIvaW7Ub_aN6fw_CZBNjBW0Og,154
26
26
  tiptap_python_utils/tasks/query.py,sha256=59hb0fubBHlfOQekv_KY3DbTEBPFdYh_1Tc9LuFsL9w,464
@@ -30,8 +30,8 @@ tiptap_python_utils/tree/__init__.py,sha256=YzlXRkQrlRGYmkWbpZ8mutZOmK4BzmiZaBqU
30
30
  tiptap_python_utils/tree/path.py,sha256=bHmBFIZ3BV4FVlB79HhSgjeP6qHdNXClB9DFovSe8fs,1067
31
31
  tiptap_python_utils/walk/__init__.py,sha256=hKU7DhRY6HVlxCxyWmnZtoobWNx5MCIT0OoErGe4Bp4,120
32
32
  tiptap_python_utils/walk/traversal.py,sha256=6GDFmPAuo_t4FeOeV6hqrqvwcTZ8G93ep21-hrFt7S0,2320
33
- tiptap_python_utils-0.3.0.dist-info/licenses/LICENSE,sha256=pIGeAFdiaTJBpJilmEbR8YQ5agrt7DqbGlTTrzqO6Qo,1089
34
- tiptap_python_utils-0.3.0.dist-info/METADATA,sha256=wuFsehiOaIjsPpYh9FegYN6OeXddbnlnDbIufDlAyPA,10854
35
- tiptap_python_utils-0.3.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
36
- tiptap_python_utils-0.3.0.dist-info/top_level.txt,sha256=t7g66MmK6WqTixs5_ZnXe4j-RvH9thuDRKvxk_8F0AQ,20
37
- tiptap_python_utils-0.3.0.dist-info/RECORD,,
33
+ tiptap_python_utils-0.4.0.dist-info/licenses/LICENSE,sha256=pIGeAFdiaTJBpJilmEbR8YQ5agrt7DqbGlTTrzqO6Qo,1089
34
+ tiptap_python_utils-0.4.0.dist-info/METADATA,sha256=UOD9KXoyarycfxuiloO13KsRJvR8_hvYFtASYHMvP4I,10854
35
+ tiptap_python_utils-0.4.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
36
+ tiptap_python_utils-0.4.0.dist-info/top_level.txt,sha256=t7g66MmK6WqTixs5_ZnXe4j-RvH9thuDRKvxk_8F0AQ,20
37
+ tiptap_python_utils-0.4.0.dist-info/RECORD,,