coradoc 2.0.29 → 2.0.30

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 72d8a4fe9a86a7ed8f5dc806492ea147f321367f7a470b3c934747de9ea2b305
4
- data.tar.gz: '042824f44538b6b64252c0667eb8d56f2ed059de0dab8866631c84394bee6a64'
3
+ metadata.gz: 9ebca4a6342273f099bbbd2b47471ea28416669106fe33ee08dc929387019334
4
+ data.tar.gz: ee9464a2876d263910ff6f03694a3370dc259a6d040fc7ea27e9ef7a13d66430
5
5
  SHA512:
6
- metadata.gz: 6a603de0773f6b27449ccb511c3ec53860e6ec37aeb55a62f63f5902b7d0c4c0e74c5681dd1749b5f09411bd04ca34ff7bca45e4da4f9e8d4bd74f4cec3972b9
7
- data.tar.gz: ebbc0d4ae30878f6793964a437dfd62a0ba79aafdfa57f3307d6e0b5c865650627bb6f025aa94f2c18813b16973819e3358a1458eecd3d6d9db5ac47af99efb8
6
+ metadata.gz: a0df65e13a8ef23c1a09b31fe9872cf1b5fec5b71528765c4c09651eb63edc9d4ec18d88b64b4276e881a6de04ce1cf8fd75c3b88ab45d2516c5da1fd5160eee
7
+ data.tar.gz: d1ee6224713d08bbd2270917c59f7106235216d2253a0a5639c6079497649561dee38cb6962fc8515ee6688619e71ce745fe365132c9334fd5484796fd1188b4
@@ -2,57 +2,6 @@
2
2
 
3
3
  module Coradoc
4
4
  module CoreModel
5
- # Represents a single item within a list
6
- #
7
- # A list item can contain:
8
- # - Simple text content
9
- # - A nested list
10
- # - Child elements (paragraphs, blocks, etc.)
11
- #
12
- # Note: The nested_list attribute type is set after ListBlock is defined
13
- # to avoid circular dependency issues.
14
- #
15
- # @example Simple list item
16
- # item = ListItem.new(
17
- # marker: "*",
18
- # content: "Item text"
19
- # )
20
- #
21
- # @example List item with nested list
22
- # item = ListItem.new(
23
- # marker: "*",
24
- # content: "Parent item",
25
- # nested_list: nested_list_block
26
- # )
27
- class ListItem < Base
28
- # @!attribute marker
29
- # @return [String, nil] the marker character(s) for this item
30
- # (e.g., '*', '**', '.', '..', '-')
31
- attribute :marker, :string
32
-
33
- # @!attribute content
34
- # @return [String, nil] text content of the list item
35
- attribute :content, :string
36
-
37
- # @!attribute nested_list
38
- # @return [ListBlock, nil] nested list within this item
39
- # Note: Typed as string initially, retyped after ListBlock defined
40
- attribute :nested_list, :string
41
-
42
- private
43
-
44
- # Attributes to compare for semantic equivalence
45
- #
46
- # List items are semantically equivalent if they have the same
47
- # content, nested list, and children, regardless of the specific
48
- # marker used.
49
- #
50
- # @return [Array<Symbol>] list of comparable attributes
51
- def comparable_attributes
52
- %i[content nested_list children]
53
- end
54
- end
55
-
56
5
  # Represents a list block with proper nesting support
57
6
  #
58
7
  # Handles all list types:
@@ -106,7 +55,7 @@ module Coradoc
106
55
 
107
56
  # @!attribute items
108
57
  # @return [Array<ListItem>] collection of list items
109
- attribute :items, ListItem, collection: true
58
+ attribute :items, 'Coradoc::CoreModel::ListItem', collection: true
110
59
 
111
60
  # -- Fluent construction helpers (paired with Base.build) --
112
61
 
@@ -138,15 +87,51 @@ module Coradoc
138
87
  end
139
88
  end
140
89
 
141
- # Re-open ListItem to properly type nested_list now that ListBlock
142
- # is defined
143
- class ListItem
144
- # Remove the temporary string-typed attribute
145
- remove_method :nested_list if method_defined?(:nested_list)
146
- remove_method :nested_list= if method_defined?(:nested_list=)
90
+ # Represents a single item within a list
91
+ #
92
+ # A list item can contain:
93
+ # - Simple text content
94
+ # - A nested list
95
+ # - Child elements (paragraphs, blocks, etc.)
96
+ #
97
+ # @example Simple list item
98
+ # item = ListItem.new(
99
+ # marker: "*",
100
+ # content: "Item text"
101
+ # )
102
+ #
103
+ # @example List item with nested list
104
+ # item = ListItem.new(
105
+ # marker: "*",
106
+ # content: "Parent item",
107
+ # nested_list: nested_list_block
108
+ # )
109
+ class ListItem < Base
110
+ # @!attribute marker
111
+ # @return [String, nil] the marker character(s) for this item
112
+ # (e.g., '*', '**', '.', '..', '-')
113
+ attribute :marker, :string
114
+
115
+ # @!attribute content
116
+ # @return [String, nil] text content of the list item
117
+ attribute :content, :string
118
+
119
+ # @!attribute nested_list
120
+ # @return [ListBlock, nil] nested list within this item
121
+ attribute :nested_list, Coradoc::CoreModel::ListBlock
122
+
123
+ private
147
124
 
148
- # Re-define with proper ListBlock type
149
- attribute :nested_list, ListBlock
125
+ # Attributes to compare for semantic equivalence
126
+ #
127
+ # List items are semantically equivalent if they have the same
128
+ # content, nested list, and children, regardless of the specific
129
+ # marker used.
130
+ #
131
+ # @return [Array<Symbol>] list of comparable attributes
132
+ def comparable_attributes
133
+ %i[content nested_list children]
134
+ end
150
135
  end
151
136
  end
152
137
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Coradoc
4
- VERSION = '2.0.29'
4
+ VERSION = '2.0.30'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coradoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.29
4
+ version: 2.0.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.