lexxy 0.1.4.beta → 0.1.5.beta
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 +4 -4
- data/README.md +51 -11
- data/app/assets/javascript/lexxy.js +41 -30
- data/app/assets/javascript/lexxy.js.br +0 -0
- data/app/assets/javascript/lexxy.js.gz +0 -0
- data/app/assets/javascript/lexxy.min.js +3 -3
- data/app/assets/javascript/lexxy.min.js.br +0 -0
- data/app/assets/javascript/lexxy.min.js.gz +0 -0
- data/app/assets/stylesheets/lexxy-editor.css +25 -23
- data/lib/lexxy/action_text_tag.rb +1 -1
- data/lib/lexxy/engine.rb +5 -0
- data/lib/lexxy/form_builder.rb +3 -3
- data/lib/lexxy/form_helper.rb +2 -2
- data/lib/lexxy/rich_text_area_tag.rb +2 -2
- data/lib/lexxy/version.rb +1 -1
- data/lib/lexxy.rb +16 -1
- metadata +2 -2
Binary file
|
Binary file
|
@@ -78,40 +78,40 @@
|
|
78
78
|
/* -------------------------------------------------------------------------- */
|
79
79
|
|
80
80
|
:where(lexxy-toolbar) {
|
81
|
+
--lexxy-toolbar-icon-size: 1em;
|
82
|
+
|
81
83
|
border-block-end: 1px solid var(--lexxy-color-ink-lighter);
|
82
84
|
color: currentColor;
|
83
85
|
display: flex;
|
84
86
|
font-size: inherit;
|
85
87
|
gap: var(--lexxy-toolbar-gap);
|
86
88
|
max-inline-size: 100%;
|
87
|
-
/* overflow-x: auto; */
|
88
89
|
padding: 2px;
|
89
90
|
position: relative;
|
91
|
+
}
|
90
92
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
place-items: center;
|
98
|
-
|
99
|
-
svg {
|
100
|
-
-webkit-touch-callout: none;
|
101
|
-
block-size: 0.85em;
|
102
|
-
fill: currentColor;
|
103
|
-
grid-area: 1/1;
|
104
|
-
inline-size: auto;
|
105
|
-
user-select: none;
|
106
|
-
}
|
93
|
+
:where(.lexxy-editor__toolbar-button) {
|
94
|
+
aspect-ratio: 1;
|
95
|
+
block-size: 2lh;
|
96
|
+
color: currentColor;
|
97
|
+
display: grid;
|
98
|
+
place-items: center;
|
107
99
|
|
108
|
-
|
109
|
-
|
110
|
-
|
100
|
+
&:is(:active) {
|
101
|
+
background-color: var(--lexxy-color-selected);
|
102
|
+
}
|
111
103
|
|
112
|
-
|
113
|
-
|
114
|
-
|
104
|
+
&[aria-pressed="true"] {
|
105
|
+
background-color: var(--lexxy-color-selected);
|
106
|
+
}
|
107
|
+
|
108
|
+
svg {
|
109
|
+
-webkit-touch-callout: none;
|
110
|
+
block-size: var(--lexxy-toolbar-icon-size);
|
111
|
+
fill: currentColor;
|
112
|
+
grid-area: 1/1;
|
113
|
+
inline-size: var(--lexxy-toolbar-icon-size);
|
114
|
+
user-select: none;
|
115
115
|
}
|
116
116
|
}
|
117
117
|
|
@@ -147,6 +147,8 @@
|
|
147
147
|
/* -------------------------------------------------------------------------- */
|
148
148
|
|
149
149
|
:where(.lexxy-link-dialog) {
|
150
|
+
display: contents;
|
151
|
+
|
150
152
|
dialog {
|
151
153
|
background-color: var(--lexxy-color-canvas);
|
152
154
|
border: 1px solid var(--lexxy-color-ink-lighter);
|
@@ -11,7 +11,7 @@ module Lexxy
|
|
11
11
|
|
12
12
|
add_default_name_and_id(options)
|
13
13
|
options["input"] ||= dom_id(object, [ options["id"], :trix_input ].compact.join("_")) if object
|
14
|
-
html_tag = @template_object.
|
14
|
+
html_tag = @template_object.lexxy_rich_textarea_tag(options.delete("name"), options.fetch("value") { value }, options.except("value"), &@block)
|
15
15
|
error_wrapping(html_tag)
|
16
16
|
end
|
17
17
|
end
|
data/lib/lexxy/engine.rb
CHANGED
@@ -9,6 +9,9 @@ module Lexxy
|
|
9
9
|
class Engine < ::Rails::Engine
|
10
10
|
isolate_namespace Lexxy
|
11
11
|
|
12
|
+
config.lexxy = ActiveSupport::OrderedOptions.new
|
13
|
+
config.lexxy.override_action_text_defaults = true
|
14
|
+
|
12
15
|
initializer "lexxy.initialize" do |app|
|
13
16
|
app.config.to_prepare do
|
14
17
|
# TODO: We need to move these extensions to Action Text
|
@@ -16,6 +19,8 @@ module Lexxy
|
|
16
19
|
ActionView::Helpers::FormHelper.prepend(Lexxy::FormHelper)
|
17
20
|
ActionView::Helpers::FormBuilder.prepend(Lexxy::FormBuilder)
|
18
21
|
ActionView::Helpers::Tags::ActionText.prepend(Lexxy::ActionTextTag)
|
22
|
+
|
23
|
+
Lexxy.override_action_text_defaults if app.config.lexxy.override_action_text_defaults
|
19
24
|
end
|
20
25
|
end
|
21
26
|
|
data/lib/lexxy/form_builder.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
module Lexxy
|
2
2
|
module FormBuilder
|
3
|
-
def
|
4
|
-
@template.
|
3
|
+
def lexxy_rich_textarea(method, options = {}, &block)
|
4
|
+
@template.lexxy_rich_textarea(@object_name, method, objectify_options(options), &block)
|
5
5
|
end
|
6
6
|
|
7
|
-
alias_method :
|
7
|
+
alias_method :lexxy_rich_text_area, :lexxy_rich_textarea
|
8
8
|
end
|
9
9
|
end
|
data/lib/lexxy/form_helper.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
module Lexxy
|
2
2
|
module FormHelper
|
3
|
-
def
|
3
|
+
def lexxy_rich_textarea(object_name, method, options = {}, &block)
|
4
4
|
ActionView::Helpers::Tags::ActionText.new(object_name, method, self, options, &block).render
|
5
5
|
end
|
6
6
|
|
7
|
-
alias_method :
|
7
|
+
alias_method :lexxy_rich_text_area, :lexxy_rich_textarea
|
8
8
|
end
|
9
9
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Lexxy
|
2
2
|
module TagHelper
|
3
|
-
def
|
3
|
+
def lexxy_rich_textarea_tag(name, value = nil, options = {}, &block)
|
4
4
|
options = options.symbolize_keys
|
5
5
|
form = options.delete(:form)
|
6
6
|
|
@@ -18,7 +18,7 @@ module Lexxy
|
|
18
18
|
editor_tag
|
19
19
|
end
|
20
20
|
|
21
|
-
alias_method :
|
21
|
+
alias_method :lexxy_rich_text_area_tag, :lexxy_rich_textarea_tag
|
22
22
|
|
23
23
|
private
|
24
24
|
# Tempoary: we need to *adaptarize* action text
|
data/lib/lexxy/version.rb
CHANGED
data/lib/lexxy.rb
CHANGED
@@ -2,5 +2,20 @@ require "lexxy/version"
|
|
2
2
|
require "lexxy/engine"
|
3
3
|
|
4
4
|
module Lexxy
|
5
|
-
|
5
|
+
def self.override_action_text_defaults
|
6
|
+
ActionText::TagHelper.module_eval do
|
7
|
+
alias_method :rich_textarea_tag, :lexxy_rich_textarea_tag
|
8
|
+
alias_method :rich_text_area_tag, :lexxy_rich_textarea_tag
|
9
|
+
end
|
10
|
+
|
11
|
+
ActionView::Helpers::FormHelper.module_eval do
|
12
|
+
alias_method :rich_textarea, :lexxy_rich_textarea
|
13
|
+
alias_method :rich_text_area, :lexxy_rich_textarea
|
14
|
+
end
|
15
|
+
|
16
|
+
ActionView::Helpers::FormBuilder.module_eval do
|
17
|
+
alias_method :rich_textarea, :lexxy_rich_textarea
|
18
|
+
alias_method :rich_text_area, :lexxy_rich_textarea
|
19
|
+
end
|
20
|
+
end
|
6
21
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lexxy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5.beta
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jorge Manrubia
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-09-
|
10
|
+
date: 2025-09-10 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rails
|