lexxy 0.1.3.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 +93 -25
- data/app/assets/javascript/lexxy.js +135 -45
- 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-content.css +1 -1
- data/app/assets/stylesheets/lexxy-editor.css +53 -24
- 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
|
@@ -11,10 +11,6 @@
|
|
11
11
|
position: relative;
|
12
12
|
transition: opacity 150ms;
|
13
13
|
|
14
|
-
&:not(:has(lexxy-toolbar)) {
|
15
|
-
opacity: 0;
|
16
|
-
}
|
17
|
-
|
18
14
|
input,
|
19
15
|
button {
|
20
16
|
&:focus-visible {
|
@@ -22,7 +18,8 @@
|
|
22
18
|
}
|
23
19
|
}
|
24
20
|
|
25
|
-
button
|
21
|
+
button,
|
22
|
+
summary {
|
26
23
|
-webkit-appearance: none;
|
27
24
|
appearance: none;
|
28
25
|
background: var(--lexxy-color-canvas);
|
@@ -81,6 +78,8 @@
|
|
81
78
|
/* -------------------------------------------------------------------------- */
|
82
79
|
|
83
80
|
:where(lexxy-toolbar) {
|
81
|
+
--lexxy-toolbar-icon-size: 1em;
|
82
|
+
|
84
83
|
border-block-end: 1px solid var(--lexxy-color-ink-lighter);
|
85
84
|
color: currentColor;
|
86
85
|
display: flex;
|
@@ -89,37 +88,67 @@
|
|
89
88
|
max-inline-size: 100%;
|
90
89
|
padding: 2px;
|
91
90
|
position: relative;
|
91
|
+
}
|
92
92
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
}
|
93
|
+
:where(.lexxy-editor__toolbar-button) {
|
94
|
+
aspect-ratio: 1;
|
95
|
+
block-size: 2lh;
|
96
|
+
color: currentColor;
|
97
|
+
display: grid;
|
98
|
+
place-items: center;
|
99
|
+
|
100
|
+
&:is(:active) {
|
101
|
+
background-color: var(--lexxy-color-selected);
|
102
|
+
}
|
103
|
+
|
104
|
+
&[aria-pressed="true"] {
|
105
|
+
background-color: var(--lexxy-color-selected);
|
106
|
+
}
|
108
107
|
|
109
|
-
|
110
|
-
|
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
|
+
}
|
116
|
+
}
|
117
|
+
|
118
|
+
:where(.lexxy-editor__toolbar-overflow) {
|
119
|
+
display: none;
|
120
|
+
position: relative;
|
121
|
+
z-index: 1;
|
122
|
+
|
123
|
+
summary {
|
124
|
+
list-style: none;
|
125
|
+
|
126
|
+
&::-webkit-details-marker {
|
127
|
+
display: none;
|
111
128
|
}
|
112
129
|
|
113
|
-
|
114
|
-
|
130
|
+
[open] & {
|
131
|
+
filter: brightness(0.9);
|
115
132
|
}
|
116
133
|
}
|
117
134
|
}
|
118
135
|
|
136
|
+
:where(.lexxy-editor__toolbar-overflow-menu) {
|
137
|
+
background-color: var(--lexxy-color-canvas);
|
138
|
+
border-radius: calc(var(--lexxy-radius) + var(--lexxy-toolbar-gap));
|
139
|
+
box-shadow: var(--lexxy-shadow);
|
140
|
+
display: flex;
|
141
|
+
inset-inline-end: 0;
|
142
|
+
padding: var(--lexxy-toolbar-gap);
|
143
|
+
position: absolute;
|
144
|
+
}
|
145
|
+
|
119
146
|
/* Link dialog
|
120
147
|
/* -------------------------------------------------------------------------- */
|
121
148
|
|
122
149
|
:where(.lexxy-link-dialog) {
|
150
|
+
display: contents;
|
151
|
+
|
123
152
|
dialog {
|
124
153
|
background-color: var(--lexxy-color-canvas);
|
125
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
|