tiptap-ruby 0.9.7 → 0.9.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b7fbe41b661b066bd744138a40af63c6b39f361425e3ee148e0febbc1f003721
4
- data.tar.gz: d485d6331471cb4e5afd9e60975a29711be201814cc8ccadc61013a8ccdbdf91
3
+ metadata.gz: 93d68f02438c4ba6923219a2f95d4f9fcc467004ce1cb707566b4c722ea59b95
4
+ data.tar.gz: a396fcf21122fddd2d8715b6377de9434ee0e7a65db219d0f902628cfbd363c5
5
5
  SHA512:
6
- metadata.gz: 4983289e11307556f0cbbf9d7efa0504e08dd19646b2beba0f8a9d3f3c1673a70755bff76928ceb854f3e486f26b9b486707f3831cbc08ca81609077921de973
7
- data.tar.gz: 970f8a83effa41599f27aca6b89ef07f7b4de44faffa7b738575340156993d973b42860b327c52d46fe5aa66787bcbf599562409dbfec1345568a7c5d058ed23
6
+ metadata.gz: 19eeba23f4e4ba545c11ce11e596c41075088e40a84333fc25662fe37db2352aa5db72c1ea6c8a316fe6af6928c185299bd778c7e2571773850ac30a0553d4be
7
+ data.tar.gz: 45969d42781b4349bd686e3350be83ffacb2c109b9d798994cd9a5fae62e61e920102b81f340bb02394242c6c8e788ebc04dc508ea533a7ca50824725d790ad1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.9.9] - 2024-09-19
4
+
5
+ - Added ordered_list to Document
6
+ - Preserve whitespace on Text nodes
7
+
8
+ ## [0.9.8] - 2024-09-10
9
+
10
+ - Table support (Table, TableRow, TableCell, TableHeader)
11
+
3
12
  ## [0.9.6] - 2024-08-06
4
13
 
5
14
  - Bump rexml version to 3.3.4 for CVE
@@ -32,6 +32,12 @@ module TipTap
32
32
  add_content(Nodes::BulletList.new(&block))
33
33
  end
34
34
 
35
+ def ordered_list(&block)
36
+ raise ArgumentError, "Block required" if block.nil?
37
+
38
+ add_content(Nodes::OrderedList.new(&block))
39
+ end
40
+
35
41
  def image(src:)
36
42
  add_content(Nodes::Image.new(src: src))
37
43
  end
@@ -47,5 +53,11 @@ module TipTap
47
53
 
48
54
  add_content(Nodes::Codeblock.new(&block))
49
55
  end
56
+
57
+ def table(&block)
58
+ raise ArgumentError, "Block required" if block.nil?
59
+
60
+ add_content(Nodes::Table.new(&block))
61
+ end
50
62
  end
51
63
  end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "tip_tap/node"
4
+
5
+ module TipTap
6
+ module Nodes
7
+ class Table < Node
8
+ self.type_name = "table"
9
+ self.html_tag = :table
10
+
11
+ def table_row(&block)
12
+ raise ArgumentError, "Block required" if block.nil?
13
+
14
+ add_content(TableRow.new(&block))
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "tip_tap/node"
4
+
5
+ module TipTap
6
+ module Nodes
7
+ class TableCell < Node
8
+ self.type_name = "tableCell"
9
+ self.html_tag = :td
10
+
11
+ def paragraph(&block)
12
+ raise ArgumentError, "Block required" if block.nil?
13
+
14
+ add_content(Paragraph.new(&block))
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "tip_tap/node"
4
+
5
+ module TipTap
6
+ module Nodes
7
+ class TableHeader < Node
8
+ self.type_name = "tableHeader"
9
+ self.html_tag = :th
10
+
11
+ def paragraph(&block)
12
+ raise ArgumentError, "Block required" if block.nil?
13
+
14
+ add_content(Paragraph.new(&block))
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "tip_tap/node"
4
+
5
+ module TipTap
6
+ module Nodes
7
+ class TableRow < Node
8
+ self.type_name = "tableRow"
9
+ self.html_tag = :tr
10
+
11
+ def table_cell(&block)
12
+ raise ArgumentError, "Block required" if block.nil?
13
+
14
+ add_content(TableCell.new(&block))
15
+ end
16
+
17
+ def table_header(&block)
18
+ raise ArgumentError, "Block required" if block.nil?
19
+
20
+ add_content(TableHeader.new(&block))
21
+ end
22
+ end
23
+ end
24
+ end
@@ -22,7 +22,7 @@ module TipTap
22
22
  end
23
23
 
24
24
  def to_h
25
- data = {type: type_name, text: text.presence || ""}
25
+ data = {type: type_name, text: text || ""}
26
26
  data[:marks] = marks.map(&:deep_symbolize_keys) unless marks.empty?
27
27
  data
28
28
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TipTap
4
- VERSION = "0.9.7"
4
+ VERSION = "0.9.9"
5
5
  end
data/lib/tip_tap.rb CHANGED
@@ -16,6 +16,10 @@ require "tip_tap/nodes/text"
16
16
  require "tip_tap/nodes/image"
17
17
  require "tip_tap/nodes/blockquote"
18
18
  require "tip_tap/nodes/codeblock"
19
+ require "tip_tap/nodes/table"
20
+ require "tip_tap/nodes/table_row"
21
+ require "tip_tap/nodes/table_cell"
22
+ require "tip_tap/nodes/table_header"
19
23
 
20
24
  module TipTap
21
25
  class Error < StandardError; 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.9.7
4
+ version: 0.9.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chad Wilken
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-27 00:00:00.000000000 Z
11
+ date: 2024-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview
@@ -65,6 +65,10 @@ files:
65
65
  - lib/tip_tap/nodes/list_item.rb
66
66
  - lib/tip_tap/nodes/ordered_list.rb
67
67
  - lib/tip_tap/nodes/paragraph.rb
68
+ - lib/tip_tap/nodes/table.rb
69
+ - lib/tip_tap/nodes/table_cell.rb
70
+ - lib/tip_tap/nodes/table_header.rb
71
+ - lib/tip_tap/nodes/table_row.rb
68
72
  - lib/tip_tap/nodes/task_item.rb
69
73
  - lib/tip_tap/nodes/task_list.rb
70
74
  - lib/tip_tap/nodes/text.rb
@@ -80,7 +84,7 @@ metadata:
80
84
  homepage_uri: https://github.com/CompanyCam/tiptap-ruby
81
85
  source_code_uri: https://github.com/CompanyCam/tiptap-ruby
82
86
  changelog_uri: https://github.com/CompanyCam/tiptap-ruby/blob/master/CHANGELOG.md
83
- post_install_message:
87
+ post_install_message:
84
88
  rdoc_options: []
85
89
  require_paths:
86
90
  - lib
@@ -95,8 +99,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
99
  - !ruby/object:Gem::Version
96
100
  version: '0'
97
101
  requirements: []
98
- rubygems_version: 3.4.6
99
- signing_key:
102
+ rubygems_version: 3.5.16
103
+ signing_key:
100
104
  specification_version: 4
101
105
  summary: Parse, generate and render TipTap documents in Ruby.
102
106
  test_files: []