tiptap-ruby 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tip_tap/document.rb +2 -10
- data/lib/tip_tap/json_renderable.rb +0 -19
- data/lib/tip_tap/node.rb +2 -0
- data/lib/tip_tap/nodes/text.rb +2 -0
- data/lib/tip_tap/registerable.rb +26 -0
- data/lib/tip_tap/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60b5aada7f1e70f5781974f227c6957baa22edda85692a1d788a43757c675f2c
|
4
|
+
data.tar.gz: 39b3b083e5fb3023e912ec7b8e778f8c0223feebf20c447a7d46952df03a2ca9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb67a28e811555d08ef569c6827c1b7c3f1bdd97b986d52f48661007abd9163da8fc54b1631b45e310b8a5d3ff073fab8780626c7712017a2806c9294fae7cb5
|
7
|
+
data.tar.gz: db4dec5f0e8004e0387e934d3bda318518e2e552cacdef30e3d547dd116f2d3b70c924e9da9eeb21e3b5897df684ac9d98224bc846a662c3a189f7c72e06298b
|
data/lib/tip_tap/document.rb
CHANGED
@@ -1,19 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "tip_tap/
|
4
|
-
require "tip_tap/json_renderable"
|
5
|
-
require "tip_tap/plain_text_renderable"
|
6
|
-
require "tip_tap/has_content"
|
3
|
+
require "tip_tap/node"
|
7
4
|
|
8
5
|
# This is the class that all child nodes will be added to.
|
9
6
|
# This is the root object for TipTap.
|
10
7
|
module TipTap
|
11
|
-
class Document
|
12
|
-
include JsonRenderable
|
13
|
-
include HtmlRenderable
|
14
|
-
include PlainTextRenderable
|
15
|
-
include HasContent
|
16
|
-
|
8
|
+
class Document < Node
|
17
9
|
self.type_name = "doc"
|
18
10
|
self.html_tag = :div
|
19
11
|
self.html_class_name = "tiptap-document"
|
@@ -4,25 +4,6 @@ require "tip_tap/registry"
|
|
4
4
|
|
5
5
|
module TipTap
|
6
6
|
module JsonRenderable
|
7
|
-
def self.included(base)
|
8
|
-
base.extend(ClassMethods)
|
9
|
-
end
|
10
|
-
|
11
|
-
module ClassMethods
|
12
|
-
def type_name=(type_name)
|
13
|
-
@type_name = type_name
|
14
|
-
Registry.register(type_name, self)
|
15
|
-
end
|
16
|
-
|
17
|
-
def type_name
|
18
|
-
@type_name
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
def type_name
|
23
|
-
self.class.type_name
|
24
|
-
end
|
25
|
-
|
26
7
|
def include_empty_content_in_json?
|
27
8
|
true
|
28
9
|
end
|
data/lib/tip_tap/node.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "tip_tap/registerable"
|
3
4
|
require "tip_tap/html_renderable"
|
4
5
|
require "tip_tap/json_renderable"
|
5
6
|
require "tip_tap/plain_text_renderable"
|
@@ -10,6 +11,7 @@ require "tip_tap/has_content"
|
|
10
11
|
# converting to HTML, JSON, and plain text
|
11
12
|
module TipTap
|
12
13
|
class Node
|
14
|
+
include Registerable
|
13
15
|
include HtmlRenderable
|
14
16
|
include JsonRenderable
|
15
17
|
include PlainTextRenderable
|
data/lib/tip_tap/nodes/text.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "tip_tap/registerable"
|
3
4
|
require "tip_tap/json_renderable"
|
4
5
|
require "tip_tap/html_renderable"
|
5
6
|
|
6
7
|
module TipTap
|
7
8
|
module Nodes
|
8
9
|
class Text
|
10
|
+
include Registerable
|
9
11
|
include JsonRenderable
|
10
12
|
include HtmlRenderable
|
11
13
|
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "tip_tap/registry"
|
4
|
+
|
5
|
+
module TipTap
|
6
|
+
module Registerable
|
7
|
+
def self.included(base)
|
8
|
+
base.extend(ClassMethods)
|
9
|
+
end
|
10
|
+
|
11
|
+
module ClassMethods
|
12
|
+
def type_name=(type_name)
|
13
|
+
@type_name = type_name
|
14
|
+
Registry.register(type_name, self)
|
15
|
+
end
|
16
|
+
|
17
|
+
def type_name
|
18
|
+
@type_name
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def type_name
|
23
|
+
self.class.type_name
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/tip_tap/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tiptap-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chad Wilken
|
@@ -69,6 +69,7 @@ files:
|
|
69
69
|
- lib/tip_tap/nodes/task_list.rb
|
70
70
|
- lib/tip_tap/nodes/text.rb
|
71
71
|
- lib/tip_tap/plain_text_renderable.rb
|
72
|
+
- lib/tip_tap/registerable.rb
|
72
73
|
- lib/tip_tap/registry.rb
|
73
74
|
- lib/tip_tap/version.rb
|
74
75
|
- lib/tiptap.rb
|