tiptap-ruby 0.6.1 → 0.8.0

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: 509879e5f27755a131f63f83c7375eb4aa2eaffb575d7f7e10531f402a59a617
4
- data.tar.gz: 9a6006a38ca591dca214830907e3a258d6829db4aac044d0b2052c80d281c6cd
3
+ metadata.gz: 72933879434ba89c5d8e4098c88742ca7c0cba2695440de87a549583df48241d
4
+ data.tar.gz: f54733e71099b36b8cf59b3beb83a36f330930cc687c768ff9fad5256175ef74
5
5
  SHA512:
6
- metadata.gz: 62a148965cdaccfc5ba2f18637c681563ee73e83947b6e907d27669ec81f9b24b74a069daf479095433a1ce8c717da7e0846f01217675b2677efdfb109468e7b
7
- data.tar.gz: f72265d70fe15905adade16d29abda9b4b3425c1080e50d4ae34b14aeb29a2017d9276bb6b8352005dfd3d7774164f0a959e7357925353a6e2ae1e46b6c84c9e
6
+ metadata.gz: ec61a23fa173bf933d2296f7eab32d30192f2d2636004012e22bdf80df985c35dcf8438ef714c119a52e683db22493af03750c961fc2293dfe4486de884f07d4
7
+ data.tar.gz: e370161edd3717f8a22641e00a468254962c1cd3e4d3e1c89ff64c90d5d85a90e5872c245dfdd1351acf3f0ad076e0ff55eb8f7a024da21793e92a41868b133e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.8.0] - 2023-11-02
4
+
5
+ ### Breaking
6
+
7
+ - Renamed `as_json` to `to_h` details outlined in https://github.com/chadwilken/tiptap-ruby/issues/10.
8
+
9
+ ## [0.7.0] - 2023-11-02
10
+
11
+ ### Breaking
12
+
13
+ - Renamed `to_json` to `as_json` to follow Ruby/Rails convention.
14
+
15
+ ## [0.6.1] - 2023-11-01
16
+
17
+ - Allow customizing the `separator` when calling `to_plain_text`.
18
+
19
+ ## [0.6.0] - 2023-11-01
20
+
21
+ - Implement `Enumerable` for the `HasContent` module.
22
+
3
23
  ## [0.5.0] - 2023-10-30
4
24
 
5
25
  - Make `Text` a subclass of `Node`.
data/README.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  A gem for parsing, generating, and rendering TipTap Documents and Nodes using Ruby.
4
4
 
5
+ ## Note
6
+
7
+ This gem is under active development and is changing somewhat quickly. There is a chance that there may be breaking changes until a stable version is released.
8
+
5
9
  ## Installation
6
10
 
7
11
  Install the gem and add to the application's Gemfile by executing:
@@ -55,7 +59,7 @@ Once you have a Document with some content you can render it to HTML, JSON, and
55
59
  #### JSON
56
60
 
57
61
  ```ruby
58
- document.to_json # => { type: 'doc', content: […nodes]}
62
+ document.to_h # => { type: 'doc', content: […nodes]}
59
63
  ```
60
64
 
61
65
  ### HTML
@@ -9,9 +9,9 @@ module TipTap
9
9
  end
10
10
 
11
11
  # Generate a JSON object that is useable by the editor
12
- def to_json
12
+ def to_h
13
13
  json = {type: type_name}
14
- json = json.merge(content: content.map(&:to_json)) if should_include_content?
14
+ json = json.merge(content: content.map(&:to_h)) if should_include_content?
15
15
  json = json.merge(attrs: attrs.deep_symbolize_keys) if attrs.present?
16
16
  json
17
17
  end
data/lib/tip_tap/node.rb CHANGED
@@ -12,9 +12,9 @@ require "tip_tap/has_content"
12
12
  module TipTap
13
13
  class Node
14
14
  include Registerable
15
+ include HasContent
15
16
  include HtmlRenderable
16
17
  include JsonRenderable
17
18
  include PlainTextRenderable
18
- include HasContent
19
19
  end
20
20
  end
@@ -21,7 +21,7 @@ module TipTap
21
21
  new(json["text"], marks: Array(json["marks"]))
22
22
  end
23
23
 
24
- def to_json
24
+ def to_h
25
25
  {type: type_name, text: text, marks: marks.map(&:deep_symbolize_keys)}.compact_blank
26
26
  end
27
27
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TipTap
4
- VERSION = "0.6.1"
4
+ VERSION = "0.8.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tiptap-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chad Wilken
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-01 00:00:00.000000000 Z
11
+ date: 2023-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview