yrby 0.4.0-x86_64-linux → 0.5.0-x86_64-linux

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: dbd0d24e57ba7484ef5a9853585483169aa6a9ca04df5edba0c7b5145daa20ae
4
- data.tar.gz: 4e87999fa4474abc9c42b6281d92f52cdead13b9fb5e367a594c392b3eb52f93
3
+ metadata.gz: 231867b33dd1e931ddd90b1b8c6dc2ba1b57d2959038bf4bc5e3cf0c18e1974f
4
+ data.tar.gz: 28a227ff609a340c2ec9e52eac3ff5fa0a8853969fbf2aa0b1d3a93d9274f4ef
5
5
  SHA512:
6
- metadata.gz: a538834a7854a3eed5bfa1e8d06b0ff85b03862b480e921f79caf43e8cc16b5437c9c5588b128170da8269c5f871409246b1fed8f3457420c2643e73b6a27422
7
- data.tar.gz: 46f53542bfc7b2305ebdf20326c4546b875185494a9c13686b99d8858ac84b19ba27eea5e8eaf4a28680238d701e6f4c2737f66266129ad7dce9a630056c9d63
6
+ metadata.gz: f1410e692049f9c97a34cda63c174bbd9cf3a72061c1a43db121e1e15b72b9120663129e1bea81c188d65d9255df161b7b19c4c9b3f055960d93faf0baf68ee5
7
+ data.tar.gz: b1057a860265ce47641c11560a5c2eee9ce10acb676c161847484fb8247621288be44899cc95f86c2ccd49bbd8d5699858935e19a62791feff83c8e21eed91f6
data/CHANGELOG.md CHANGED
@@ -6,6 +6,24 @@ to follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.5.0] - 2026-07-08
10
+
11
+ ### Added
12
+
13
+ - **`Y::Lexical` — render Lexical/Lexxy documents to HTML.**
14
+ `Y::Lexical.new(doc).to_html` turns a Lexxy document into HTML on the server,
15
+ with no Node process or headless editor. The output is identical to the HTML
16
+ a `lexxy-editor` submits to Rails; the tests check it byte-for-byte against a
17
+ document captured from a real editor. It covers the whole Lexxy 0.9.x node
18
+ set: headings, every text format, links, bullet/numbered/check/nested lists,
19
+ quotes, code blocks, horizontal rules, tables with header cells, image galleries, and
20
+ ActionText attachments. Unknown nodes fall back to a plain paragraph, and a
21
+ root that isn't Lexical (a ProseMirror document, say) returns `nil`. This is
22
+ what `tiptap-php` does for ProseMirror JSON, applied to the Yjs structure.
23
+ - `read_xml` now pulls text out of attachments too: a mention's text goes
24
+ inline, and an upload adds its caption, alt text, or filename. Before, both
25
+ were dropped.
26
+
9
27
  ## [0.4.0] - 2026-07-07
10
28
 
11
29
  ### Added
data/README.md CHANGED
@@ -157,6 +157,17 @@ doc.handle_sync_message(data) # => [msg_type, sync_type, response]; answers
157
157
  # SyncStep2 (never serves pending structs)
158
158
  ```
159
159
 
160
+ ### Reading document contents
161
+
162
+ Reconstruct a document server-side — search, exports, emails, SSR — with no
163
+ Node process:
164
+
165
+ ```ruby
166
+ doc.read_text("prosemirror") # => plain text of a Y.Text root, or nil
167
+ doc.read_xml("root") # => text of an XML root, one block per line
168
+ doc.read_map("state") # => a Y.Map root as a JSON string; JSON.parse it
169
+ ```
170
+
160
171
  ### Pending structs and gap-free state
161
172
 
162
173
  If a doc applies an update whose causally-prior update is missing (a "gappy"
@@ -177,8 +188,13 @@ guarantees keep serving safe:
177
188
 
178
189
  ### Rendering to HTML
179
190
 
180
- `Y::ProseMirror` renders a ProseMirror or Tiptap document to HTML on the
181
- server, with no Node process or headless editor:
191
+ Two schema-pinned renderers turn a collaborative document into HTML on the
192
+ server, with no Node process or headless editor: `Y::ProseMirror` for
193
+ ProseMirror/Tiptap documents and `Y::Lexical` for
194
+ [Lexxy](https://github.com/basecamp/lexxy) (Lexical) documents. Each returns
195
+ `nil` for a root that belongs to the other schema.
196
+
197
+ #### `Y::ProseMirror`
182
198
 
183
199
  ```ruby
184
200
  prosemirror = Y::ProseMirror.new(doc)
@@ -187,8 +203,7 @@ prosemirror.to_html("content") # or another XML root
187
203
  ```
188
204
 
189
205
  The output matches Tiptap's own `getHTML()`, checked byte-for-byte in the tests
190
- against a document captured from a real editor. So you can render, search, or
191
- email a collaborative document without running a browser. It follows
206
+ against a document captured from a real editor. It follows
192
207
  [`tiptap-php`](https://github.com/ueberdosis/tiptap-php) and reads both name
193
208
  styles editors use — Tiptap's `bulletList`/`bold` and prosemirror-schema-basic's
194
209
  `bullet_list`/`strong`.
@@ -197,8 +212,29 @@ It covers paragraphs, headings, blockquotes, bullet/ordered/task lists, code
197
212
  blocks, links, images, mentions, details, hard breaks, horizontal rules,
198
213
  tables, text styles (color, font family), and every text mark. A table renders
199
214
  as semantic `<table><tbody>`, without the column-width styling Tiptap's editor
200
- view adds. A root that isn't ProseMirror — a Lexical document, say — returns
201
- `nil`.
215
+ view adds.
216
+
217
+ #### `Y::Lexical`
218
+
219
+ ```ruby
220
+ lexical = Y::Lexical.new(doc)
221
+ lexical.to_html # the "root" fragment (Lexical's default root name)
222
+ lexical.to_html("notepad") # or another XML root
223
+ ```
224
+
225
+ The HTML is identical to what a `lexxy-editor` submits to Rails (its `value`).
226
+ The tests check this byte-for-byte against a document captured from a real
227
+ editor.
228
+
229
+ It handles the whole Lexxy 0.9.x node set: paragraphs, headings, every text
230
+ format and their combinations, links, the four list types and nesting,
231
+ blockquotes, code blocks, tabs and soft breaks, horizontal rules, tables with
232
+ header cells, image galleries, and ActionText attachments (uploads and
233
+ mentions both emit `<action-text-attachment>` elements that ActionText can
234
+ re-render).
235
+
236
+ In both renderers an unknown node keeps its content — text falls back to a
237
+ plain paragraph rather than disappearing.
202
238
 
203
239
  ### Protocol codec (module functions)
204
240
 
data/lib/y/3.4/yrby.so CHANGED
Binary file
data/lib/y/4.0/yrby.so CHANGED
Binary file
data/lib/y/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Y
4
- VERSION = "0.4.0"
4
+ VERSION = "0.5.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yrby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - JP Camara
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-07-08 00:00:00.000000000 Z
11
+ date: 2026-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest