coupdoeil 1.0.0.pre.beta.1 → 1.0.0.pre.beta.2
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/CHANGELOG.md +3 -0
- data/README.md +21 -21
- data/app/assets/javascripts/coupdoeil.js +132 -132
- data/app/assets/javascripts/coupdoeil.min.js +1 -1
- data/app/assets/javascripts/coupdoeil.min.js.map +1 -1
- data/app/assets/stylesheets/coupdoeil/popover-animation.css +44 -0
- data/app/assets/stylesheets/coupdoeil/popover-arrow.css +39 -0
- data/app/assets/stylesheets/coupdoeil/popover.css +84 -0
- data/app/controllers/coupdoeil/{hovercards_controller.rb → popovers_controller.rb} +13 -13
- data/app/helpers/coupdoeil/application_helper.rb +4 -4
- data/app/javascript/coupdoeil/elements/coupdoeil_element.js +13 -13
- data/app/javascript/coupdoeil/events/onclick.js +36 -36
- data/app/javascript/coupdoeil/events/onmouseover.js +52 -52
- data/app/javascript/coupdoeil/events.js +4 -4
- data/app/javascript/coupdoeil/index.js +1 -1
- data/app/javascript/coupdoeil/{hovercard → popover}/attributes.js +3 -3
- data/app/javascript/coupdoeil/popover/cache.js +22 -0
- data/app/javascript/coupdoeil/{hovercard → popover}/closing.js +18 -18
- data/app/javascript/coupdoeil/{hovercard → popover}/config.js +6 -6
- data/app/javascript/coupdoeil/popover/controller.js +20 -0
- data/app/javascript/coupdoeil/popover/current.js +13 -0
- data/app/javascript/coupdoeil/{hovercard → popover}/opening.js +26 -26
- data/app/javascript/coupdoeil/{hovercard → popover}/optionsParser.js +5 -5
- data/app/javascript/coupdoeil/{hovercard → popover}/positioning.js +2 -2
- data/app/javascript/coupdoeil/popover/state_check.js +12 -0
- data/app/models/coupdoeil/params.rb +4 -4
- data/app/models/coupdoeil/{hovercard → popover}/option/animation.rb +2 -2
- data/app/models/coupdoeil/{hovercard → popover}/option/cache.rb +2 -2
- data/app/models/coupdoeil/{hovercard → popover}/option/loading.rb +2 -2
- data/app/models/coupdoeil/{hovercard → popover}/option/offset.rb +2 -2
- data/app/models/coupdoeil/{hovercard → popover}/option/opening_delay.rb +2 -2
- data/app/models/coupdoeil/{hovercard → popover}/option/placement.rb +2 -2
- data/app/models/coupdoeil/{hovercard → popover}/option/trigger.rb +2 -2
- data/app/models/coupdoeil/{hovercard → popover}/option.rb +1 -1
- data/app/models/coupdoeil/{hovercard → popover}/options_set.rb +1 -1
- data/app/models/coupdoeil/{hovercard → popover}/registry.rb +2 -2
- data/app/models/coupdoeil/{hovercard → popover}/setup.rb +2 -2
- data/app/models/coupdoeil/{hovercard → popover}/view_context_delegation.rb +3 -3
- data/app/models/coupdoeil/{hovercard.rb → popover.rb} +8 -8
- data/app/models/coupdoeil/tag.rb +15 -15
- data/app/style/{hovercard-animation.scss → popover-animation.scss} +7 -7
- data/app/style/popover-arrow.scss +40 -0
- data/app/style/popover.scss +2 -0
- data/config/routes.rb +1 -1
- data/lib/coupdoeil/engine.rb +8 -8
- data/lib/coupdoeil/version.rb +1 -1
- data/lib/generators/coupdoeil/install/install_generator.rb +8 -8
- data/lib/generators/coupdoeil/install/templates/layout.html.erb.tt +1 -1
- data/lib/generators/coupdoeil/popover/USAGE +15 -0
- data/lib/generators/coupdoeil/popover/popover_generator.rb +22 -0
- data/lib/generators/coupdoeil/{hovercard/templates/hovercard.rb.tt → popover/templates/popover.rb.tt} +1 -1
- metadata +39 -39
- data/app/assets/stylesheets/coupdoeil/hovercard-animation.css +0 -44
- data/app/assets/stylesheets/coupdoeil/hovercard-arrow.css +0 -39
- data/app/assets/stylesheets/coupdoeil/hovercard.css +0 -84
- data/app/javascript/coupdoeil/hovercard/cache.js +0 -22
- data/app/javascript/coupdoeil/hovercard/controller.js +0 -20
- data/app/javascript/coupdoeil/hovercard/current.js +0 -13
- data/app/javascript/coupdoeil/hovercard/state_check.js +0 -12
- data/app/style/hovercard-arrow.scss +0 -40
- data/app/style/hovercard.scss +0 -2
- data/lib/generators/coupdoeil/hovercard/USAGE +0 -15
- data/lib/generators/coupdoeil/hovercard/hovercard_generator.rb +0 -22
- /data/app/javascript/coupdoeil/{hovercard → popover}/actions.js +0 -0
- /data/app/javascript/coupdoeil/{hovercard.js → popover.js} +0 -0
data/app/models/coupdoeil/tag.rb
CHANGED
@@ -2,20 +2,20 @@
|
|
2
2
|
|
3
3
|
module Coupdoeil
|
4
4
|
class Tag
|
5
|
-
def initialize(
|
6
|
-
@
|
5
|
+
def initialize(popover:, popover_options:, attributes:)
|
6
|
+
@popover_setup = popover
|
7
7
|
@attributes = attributes
|
8
|
-
|
9
|
-
@
|
10
|
-
@
|
8
|
+
popover_options = Popover::OptionsSet.new(popover_options)
|
9
|
+
@popover_options_set = popover_setup.default_options.merge(popover_options)
|
10
|
+
@popover_options_set.validate!
|
11
11
|
end
|
12
12
|
|
13
13
|
def render_in(view_context, &block)
|
14
14
|
ActiveSupport::Notifications.instrument("render_tag.coupdoeil") do
|
15
15
|
content = view_context.capture(&block) if block_given?
|
16
|
-
view_context.content_tag("coup-doeil", **@attributes.merge(
|
17
|
-
if
|
18
|
-
view_context.tag.template(view_context.render(
|
16
|
+
view_context.content_tag("coup-doeil", **@attributes.merge(popover_attributes)) do
|
17
|
+
if popover_options_set.preload?
|
18
|
+
view_context.tag.template(view_context.render(popover_setup), class: "popover-content") + content
|
19
19
|
else
|
20
20
|
content
|
21
21
|
end
|
@@ -25,18 +25,18 @@ module Coupdoeil
|
|
25
25
|
|
26
26
|
private
|
27
27
|
|
28
|
-
attr_reader :
|
28
|
+
attr_reader :popover_options_set, :popover_setup
|
29
29
|
|
30
|
-
def
|
31
|
-
attributes = {
|
30
|
+
def popover_attributes
|
31
|
+
attributes = { "popover-options": popover_options_set.to_base36 }
|
32
32
|
|
33
|
-
unless
|
34
|
-
params = Params.serialize(
|
35
|
-
attributes.merge!("
|
33
|
+
unless popover_options_set.preload?
|
34
|
+
params = Params.serialize(popover_setup.params).sole.presence&.to_json
|
35
|
+
attributes.merge!("popover-type" => popover_setup.identifier, "popover-params" => params)
|
36
36
|
end
|
37
37
|
|
38
38
|
if Rails.env.local?
|
39
|
-
attributes.merge!(
|
39
|
+
attributes.merge!(popover_options_set.to_h.transform_keys { "popover-#{_1}" })
|
40
40
|
end
|
41
41
|
|
42
42
|
attributes
|
@@ -1,26 +1,26 @@
|
|
1
|
-
.coupdoeil--
|
1
|
+
.coupdoeil--popover.hidden {
|
2
2
|
display: none
|
3
3
|
}
|
4
4
|
|
5
|
-
.coupdoeil--
|
6
|
-
&.
|
5
|
+
.coupdoeil--popover[data-animation] {
|
6
|
+
&.popover-enter {
|
7
7
|
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
|
8
8
|
}
|
9
|
-
&.
|
9
|
+
&.popover-leave {
|
10
10
|
transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
|
11
11
|
}
|
12
|
-
&.
|
12
|
+
&.popover-enter, &.popover-leave {
|
13
13
|
transition-property: opacity, transform;
|
14
14
|
transition-duration: 150ms;
|
15
15
|
}
|
16
16
|
|
17
|
-
&.
|
17
|
+
&.popover-enter-end, &.popover-leave-start {
|
18
18
|
&[data-animation="fade-in"], &[data-animation="slide-in"], &[data-animation="slide-out"] {
|
19
19
|
opacity: 1;
|
20
20
|
}
|
21
21
|
}
|
22
22
|
|
23
|
-
&.
|
23
|
+
&.popover-enter-start, &.popover-leave-end {
|
24
24
|
&[data-animation="fade-in"], &[data-animation="slide-in"], &[data-animation="slide-out"] {
|
25
25
|
opacity: 0;
|
26
26
|
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
@use 'sass:list';
|
2
|
+
|
3
|
+
.coupdoeil--popover {
|
4
|
+
& [data-popover-arrow] {
|
5
|
+
--co-popover--color: white;
|
6
|
+
--co-popover--border-color: rgb(209 213 219);
|
7
|
+
--co-popover-border-size: 1px;
|
8
|
+
--co-popover-border-style: solid;
|
9
|
+
--co-popover--size-ratio: 1;
|
10
|
+
--co-popover--height: 0.75rem;
|
11
|
+
--co-popover--width: calc(var(--co-popover--height) / var(--co-popover--size-ratio));
|
12
|
+
|
13
|
+
position: absolute;
|
14
|
+
height: var(--co-popover--height);
|
15
|
+
width: var(--co-popover--height);
|
16
|
+
|
17
|
+
&::after, &::before {
|
18
|
+
content: "";
|
19
|
+
width: 0;
|
20
|
+
height: 0;
|
21
|
+
position: absolute;
|
22
|
+
bottom: 0;
|
23
|
+
border: var(--co-popover--base-border-width) var(--co-popover-border-style) transparent;
|
24
|
+
}
|
25
|
+
|
26
|
+
&::after {
|
27
|
+
--co-popover--base-border-width: var(--co-popover--width);
|
28
|
+
border-bottom-color: var(--co-popover--color);
|
29
|
+
left: calc(50% - var(--co-popover--width));
|
30
|
+
}
|
31
|
+
&::before {
|
32
|
+
--co-popover--base-border-width: calc(var(--co-popover--height) + var(--co-popover-border-size));
|
33
|
+
border-bottom-color: var(--co-popover--border-color);
|
34
|
+
left: calc(50% - var(--co-popover--width) - var(--co-popover-border-size));
|
35
|
+
}
|
36
|
+
}
|
37
|
+
&[data-placement|="top"] [data-popover-arrow] { transform: rotate(180deg); }
|
38
|
+
&[data-placement|="right"] [data-popover-arrow] { transform: rotate(-90deg); }
|
39
|
+
&[data-placement|="left"] [data-popover-arrow] { transform: rotate(90deg); }
|
40
|
+
}
|
data/config/routes.rb
CHANGED
data/lib/coupdoeil/engine.rb
CHANGED
@@ -22,15 +22,15 @@ module Coupdoeil
|
|
22
22
|
# If you just want to remove specific css:
|
23
23
|
#
|
24
24
|
# config.after_initialize do
|
25
|
-
# config.assets.precompile -= %w[coupdoeil/
|
25
|
+
# config.assets.precompile -= %w[coupdoeil/popover-arrow.css]
|
26
26
|
# end
|
27
27
|
PRECOMPILE_ASSETS = %w[
|
28
28
|
coupdoeil.js
|
29
29
|
coupdoeil.min.js
|
30
30
|
coupdoeil.min.js.map
|
31
|
-
coupdoeil/
|
32
|
-
coupdoeil/
|
33
|
-
coupdoeil/
|
31
|
+
coupdoeil/popover.css
|
32
|
+
coupdoeil/popover-arrow.css
|
33
|
+
coupdoeil/popover-animation.css
|
34
34
|
]
|
35
35
|
|
36
36
|
initializer "coupdoeil.assets" do
|
@@ -55,15 +55,15 @@ module Coupdoeil
|
|
55
55
|
initializer "coupdoeil.view_paths" do
|
56
56
|
config.to_prepare do
|
57
57
|
views = Rails.application.config.paths["app/views"].existent
|
58
|
-
views += Rails.application.config.paths.add("app/
|
59
|
-
views += Rails.application.config.paths.add("app/
|
60
|
-
Coupdoeil::
|
58
|
+
views += Rails.application.config.paths.add("app/popovers").existent
|
59
|
+
views += Rails.application.config.paths.add("app/popovers/layouts").existent
|
60
|
+
Coupdoeil::Popover.prepend_view_path(views)
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
64
|
initializer "coupdoeil.routes" do |app|
|
65
65
|
app.routes.append do
|
66
|
-
post "coupdoeil/
|
66
|
+
post "coupdoeil/popover", to: "coupdoeil/popovers#create"
|
67
67
|
end
|
68
68
|
end
|
69
69
|
end
|
data/lib/coupdoeil/version.rb
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
class Coupdoeil::InstallGenerator < Rails::Generators::Base
|
2
2
|
Coupdoeil::InstallGenerator.source_root Coupdoeil::Engine.root.join("lib/generators/coupdoeil/install/templates")
|
3
3
|
|
4
|
-
desc "Create base class for
|
4
|
+
desc "Create base class for popovers and default layout."
|
5
5
|
|
6
6
|
def create_base_class
|
7
|
-
create_file "app/
|
8
|
-
class
|
7
|
+
create_file "app/popovers/application_popover.rb", <<~RUBY
|
8
|
+
class ApplicationPopover < Coupdoeil::Popover
|
9
9
|
end
|
10
10
|
RUBY
|
11
11
|
end
|
12
12
|
|
13
13
|
def insert_default_layout
|
14
|
-
template "layout.html.erb.tt", "app/
|
14
|
+
template "layout.html.erb.tt", "app/popovers/layouts/popover.html.erb"
|
15
15
|
end
|
16
16
|
|
17
17
|
def install_javascripts
|
@@ -55,17 +55,17 @@ class Coupdoeil::InstallGenerator < Rails::Generators::Base
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def import_stylesheet
|
58
|
-
puts "To use Coupdoeil
|
58
|
+
puts "To use Coupdoeil popover style, add to your layout's head:"
|
59
59
|
puts ""
|
60
60
|
puts <<-ERB
|
61
|
-
<%= stylesheet_link_tag "coupdoeil/
|
61
|
+
<%= stylesheet_link_tag "coupdoeil/popover" %>
|
62
62
|
ERB
|
63
63
|
puts ""
|
64
64
|
puts "Or one of two:"
|
65
65
|
puts ""
|
66
66
|
puts <<-ERB
|
67
|
-
<%= stylesheet_link_tag "coupdoeil/
|
68
|
-
<%= stylesheet_link_tag "coupdoeil/
|
67
|
+
<%= stylesheet_link_tag "coupdoeil/popover-arrow" %>
|
68
|
+
<%= stylesheet_link_tag "coupdoeil/popover-animation" %>
|
69
69
|
ERB
|
70
70
|
end
|
71
71
|
|
@@ -0,0 +1,15 @@
|
|
1
|
+
Description:
|
2
|
+
Create Popover class and views files.
|
3
|
+
|
4
|
+
Example:
|
5
|
+
bin/rails generate popover Contact details from_project
|
6
|
+
|
7
|
+
creates the following files:
|
8
|
+
app/popovers/contact_popover.rb
|
9
|
+
app/views/contact_popover/details.html.erb
|
10
|
+
app/views/contact_popover/from_project.html.erb
|
11
|
+
|
12
|
+
bin/rails generate popover Contact details from_project --skip-views
|
13
|
+
|
14
|
+
creates only the class file:
|
15
|
+
app/popovers/contact_popover.rb
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class Coupdoeil::PopoverGenerator < Rails::Generators::NamedBase
|
2
|
+
source_root File.expand_path("templates", __dir__)
|
3
|
+
|
4
|
+
check_class_collision suffix: "Popover"
|
5
|
+
|
6
|
+
class_option :skip_views, type: :boolean, desc: "Skip view files", default: false
|
7
|
+
|
8
|
+
argument :action_names, type: :array, default: []
|
9
|
+
|
10
|
+
def create_popover_file
|
11
|
+
template "popover.rb",
|
12
|
+
File.join("app/popovers", class_path, "#{file_name}_popover.rb")
|
13
|
+
unless options.skip_views?
|
14
|
+
action_names.each do |action_name|
|
15
|
+
path = [*class_path, file_name].join('/')
|
16
|
+
create_file "app/popovers/#{path}_popover/#{action_name}.html.erb", <<~ERB
|
17
|
+
<p>Hello from #{class_name}Popover##{action_name}</p>
|
18
|
+
ERB
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coupdoeil
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.pre.beta.
|
4
|
+
version: 1.0.0.pre.beta.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PageHey
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-06-13 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: actionpack
|
@@ -127,7 +127,7 @@ dependencies:
|
|
127
127
|
- - ">="
|
128
128
|
- !ruby/object:Gem::Version
|
129
129
|
version: '0'
|
130
|
-
description: Easy and powerful
|
130
|
+
description: Easy and powerful popover system for Ruby On Rails.
|
131
131
|
email:
|
132
132
|
- pagehey@pm.me
|
133
133
|
executables: []
|
@@ -143,56 +143,56 @@ files:
|
|
143
143
|
- app/assets/javascripts/coupdoeil.min.js
|
144
144
|
- app/assets/javascripts/coupdoeil.min.js.map
|
145
145
|
- app/assets/stylesheets/coupdoeil/application.css
|
146
|
-
- app/assets/stylesheets/coupdoeil/
|
147
|
-
- app/assets/stylesheets/coupdoeil/
|
148
|
-
- app/assets/stylesheets/coupdoeil/
|
149
|
-
- app/controllers/coupdoeil/
|
146
|
+
- app/assets/stylesheets/coupdoeil/popover-animation.css
|
147
|
+
- app/assets/stylesheets/coupdoeil/popover-arrow.css
|
148
|
+
- app/assets/stylesheets/coupdoeil/popover.css
|
149
|
+
- app/controllers/coupdoeil/popovers_controller.rb
|
150
150
|
- app/helpers/coupdoeil/application_helper.rb
|
151
151
|
- app/javascript/coupdoeil/elements/coupdoeil_element.js
|
152
152
|
- app/javascript/coupdoeil/events.js
|
153
153
|
- app/javascript/coupdoeil/events/onclick.js
|
154
154
|
- app/javascript/coupdoeil/events/onmouseover.js
|
155
|
-
- app/javascript/coupdoeil/hovercard.js
|
156
|
-
- app/javascript/coupdoeil/hovercard/actions.js
|
157
|
-
- app/javascript/coupdoeil/hovercard/attributes.js
|
158
|
-
- app/javascript/coupdoeil/hovercard/cache.js
|
159
|
-
- app/javascript/coupdoeil/hovercard/closing.js
|
160
|
-
- app/javascript/coupdoeil/hovercard/config.js
|
161
|
-
- app/javascript/coupdoeil/hovercard/controller.js
|
162
|
-
- app/javascript/coupdoeil/hovercard/current.js
|
163
|
-
- app/javascript/coupdoeil/hovercard/opening.js
|
164
|
-
- app/javascript/coupdoeil/hovercard/optionsParser.js
|
165
|
-
- app/javascript/coupdoeil/hovercard/positioning.js
|
166
|
-
- app/javascript/coupdoeil/hovercard/state_check.js
|
167
155
|
- app/javascript/coupdoeil/index.js
|
168
|
-
- app/
|
169
|
-
- app/
|
170
|
-
- app/
|
171
|
-
- app/
|
172
|
-
- app/
|
173
|
-
- app/
|
174
|
-
- app/
|
175
|
-
- app/
|
176
|
-
- app/
|
177
|
-
- app/
|
178
|
-
- app/
|
179
|
-
- app/
|
180
|
-
- app/models/coupdoeil/hovercard/view_context_delegation.rb
|
156
|
+
- app/javascript/coupdoeil/popover.js
|
157
|
+
- app/javascript/coupdoeil/popover/actions.js
|
158
|
+
- app/javascript/coupdoeil/popover/attributes.js
|
159
|
+
- app/javascript/coupdoeil/popover/cache.js
|
160
|
+
- app/javascript/coupdoeil/popover/closing.js
|
161
|
+
- app/javascript/coupdoeil/popover/config.js
|
162
|
+
- app/javascript/coupdoeil/popover/controller.js
|
163
|
+
- app/javascript/coupdoeil/popover/current.js
|
164
|
+
- app/javascript/coupdoeil/popover/opening.js
|
165
|
+
- app/javascript/coupdoeil/popover/optionsParser.js
|
166
|
+
- app/javascript/coupdoeil/popover/positioning.js
|
167
|
+
- app/javascript/coupdoeil/popover/state_check.js
|
181
168
|
- app/models/coupdoeil/params.rb
|
169
|
+
- app/models/coupdoeil/popover.rb
|
170
|
+
- app/models/coupdoeil/popover/option.rb
|
171
|
+
- app/models/coupdoeil/popover/option/animation.rb
|
172
|
+
- app/models/coupdoeil/popover/option/cache.rb
|
173
|
+
- app/models/coupdoeil/popover/option/loading.rb
|
174
|
+
- app/models/coupdoeil/popover/option/offset.rb
|
175
|
+
- app/models/coupdoeil/popover/option/opening_delay.rb
|
176
|
+
- app/models/coupdoeil/popover/option/placement.rb
|
177
|
+
- app/models/coupdoeil/popover/option/trigger.rb
|
178
|
+
- app/models/coupdoeil/popover/options_set.rb
|
179
|
+
- app/models/coupdoeil/popover/registry.rb
|
180
|
+
- app/models/coupdoeil/popover/setup.rb
|
181
|
+
- app/models/coupdoeil/popover/view_context_delegation.rb
|
182
182
|
- app/models/coupdoeil/tag.rb
|
183
|
-
- app/style/
|
184
|
-
- app/style/
|
185
|
-
- app/style/
|
183
|
+
- app/style/popover-animation.scss
|
184
|
+
- app/style/popover-arrow.scss
|
185
|
+
- app/style/popover.scss
|
186
186
|
- app/views/layouts/coupdoeil/application.html.erb
|
187
187
|
- config/routes.rb
|
188
188
|
- lib/coupdoeil.rb
|
189
189
|
- lib/coupdoeil/engine.rb
|
190
190
|
- lib/coupdoeil/version.rb
|
191
|
-
- lib/generators/coupdoeil/hovercard/USAGE
|
192
|
-
- lib/generators/coupdoeil/hovercard/hovercard_generator.rb
|
193
|
-
- lib/generators/coupdoeil/hovercard/templates/hovercard.rb.tt
|
194
191
|
- lib/generators/coupdoeil/install/install_generator.rb
|
195
192
|
- lib/generators/coupdoeil/install/templates/layout.html.erb.tt
|
193
|
+
- lib/generators/coupdoeil/popover/USAGE
|
194
|
+
- lib/generators/coupdoeil/popover/popover_generator.rb
|
195
|
+
- lib/generators/coupdoeil/popover/templates/popover.rb.tt
|
196
196
|
- lib/tasks/coupdoeil_tasks.rake
|
197
197
|
homepage: https://coupdoeil.org
|
198
198
|
licenses:
|
@@ -217,5 +217,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
217
217
|
requirements: []
|
218
218
|
rubygems_version: 3.6.2
|
219
219
|
specification_version: 4
|
220
|
-
summary: A framework to easily
|
220
|
+
summary: A framework to easily create popovers.
|
221
221
|
test_files: []
|
@@ -1,44 +0,0 @@
|
|
1
|
-
.coupdoeil--hovercard.hidden {
|
2
|
-
display: none;
|
3
|
-
}
|
4
|
-
|
5
|
-
.coupdoeil--hovercard[data-animation].hovercard-enter {
|
6
|
-
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
|
7
|
-
}
|
8
|
-
.coupdoeil--hovercard[data-animation].hovercard-leave {
|
9
|
-
transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
|
10
|
-
}
|
11
|
-
.coupdoeil--hovercard[data-animation].hovercard-enter, .coupdoeil--hovercard[data-animation].hovercard-leave {
|
12
|
-
transition-property: opacity, transform;
|
13
|
-
transition-duration: 150ms;
|
14
|
-
}
|
15
|
-
.coupdoeil--hovercard[data-animation].hovercard-enter-end[data-animation=fade-in], .coupdoeil--hovercard[data-animation].hovercard-enter-end[data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-enter-end[data-animation=slide-out], .coupdoeil--hovercard[data-animation].hovercard-leave-start[data-animation=fade-in], .coupdoeil--hovercard[data-animation].hovercard-leave-start[data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-leave-start[data-animation=slide-out] {
|
16
|
-
opacity: 1;
|
17
|
-
}
|
18
|
-
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-animation=fade-in], .coupdoeil--hovercard[data-animation].hovercard-enter-start[data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-enter-start[data-animation=slide-out], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-animation=fade-in], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-animation=slide-out] {
|
19
|
-
opacity: 0;
|
20
|
-
}
|
21
|
-
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=right][data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=right][data-animation=slide-in] {
|
22
|
-
transform: translateX(1rem);
|
23
|
-
}
|
24
|
-
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=right][data-animation=slide-out], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=right][data-animation=slide-out] {
|
25
|
-
transform: translateX(-1rem);
|
26
|
-
}
|
27
|
-
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=left][data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=left][data-animation=slide-in] {
|
28
|
-
transform: translateX(-1rem);
|
29
|
-
}
|
30
|
-
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=left][data-animation=slide-out], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=left][data-animation=slide-out] {
|
31
|
-
transform: translateX(1rem);
|
32
|
-
}
|
33
|
-
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=top][data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=top][data-animation=slide-in] {
|
34
|
-
transform: translateY(-1rem);
|
35
|
-
}
|
36
|
-
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=top][data-animation=slide-out], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=top][data-animation=slide-out] {
|
37
|
-
transform: translateY(1rem);
|
38
|
-
}
|
39
|
-
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=bottom][data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=bottom][data-animation=slide-in] {
|
40
|
-
transform: translateY(1rem);
|
41
|
-
}
|
42
|
-
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=bottom][data-animation=slide-out], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=bottom][data-animation=slide-out] {
|
43
|
-
transform: translateY(-1rem);
|
44
|
-
}
|
@@ -1,39 +0,0 @@
|
|
1
|
-
.coupdoeil--hovercard [data-hovercard-arrow] {
|
2
|
-
--co-hovercard--color: white;
|
3
|
-
--co-hovercard--border-color: rgb(209 213 219);
|
4
|
-
--co-hovercard-border-size: 1px;
|
5
|
-
--co-hovercard-border-style: solid;
|
6
|
-
--co-hovercard--size-ratio: 1;
|
7
|
-
--co-hovercard--height: 0.75rem;
|
8
|
-
--co-hovercard--width: calc(var(--co-hovercard--height) / var(--co-hovercard--size-ratio));
|
9
|
-
position: absolute;
|
10
|
-
height: var(--co-hovercard--height);
|
11
|
-
width: var(--co-hovercard--height);
|
12
|
-
}
|
13
|
-
.coupdoeil--hovercard [data-hovercard-arrow]::after, .coupdoeil--hovercard [data-hovercard-arrow]::before {
|
14
|
-
content: "";
|
15
|
-
width: 0;
|
16
|
-
height: 0;
|
17
|
-
position: absolute;
|
18
|
-
bottom: 0;
|
19
|
-
border: var(--co-hovercard--base-border-width) var(--co-hovercard-border-style) transparent;
|
20
|
-
}
|
21
|
-
.coupdoeil--hovercard [data-hovercard-arrow]::after {
|
22
|
-
--co-hovercard--base-border-width: var(--co-hovercard--width);
|
23
|
-
border-bottom-color: var(--co-hovercard--color);
|
24
|
-
left: calc(50% - var(--co-hovercard--width));
|
25
|
-
}
|
26
|
-
.coupdoeil--hovercard [data-hovercard-arrow]::before {
|
27
|
-
--co-hovercard--base-border-width: calc(var(--co-hovercard--height) + var(--co-hovercard-border-size));
|
28
|
-
border-bottom-color: var(--co-hovercard--border-color);
|
29
|
-
left: calc(50% - var(--co-hovercard--width) - var(--co-hovercard-border-size));
|
30
|
-
}
|
31
|
-
.coupdoeil--hovercard[data-placement|=top] [data-hovercard-arrow] {
|
32
|
-
transform: rotate(180deg);
|
33
|
-
}
|
34
|
-
.coupdoeil--hovercard[data-placement|=right] [data-hovercard-arrow] {
|
35
|
-
transform: rotate(-90deg);
|
36
|
-
}
|
37
|
-
.coupdoeil--hovercard[data-placement|=left] [data-hovercard-arrow] {
|
38
|
-
transform: rotate(90deg);
|
39
|
-
}
|
@@ -1,84 +0,0 @@
|
|
1
|
-
.coupdoeil--hovercard.hidden {
|
2
|
-
display: none;
|
3
|
-
}
|
4
|
-
|
5
|
-
.coupdoeil--hovercard[data-animation].hovercard-enter {
|
6
|
-
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
|
7
|
-
}
|
8
|
-
.coupdoeil--hovercard[data-animation].hovercard-leave {
|
9
|
-
transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
|
10
|
-
}
|
11
|
-
.coupdoeil--hovercard[data-animation].hovercard-enter, .coupdoeil--hovercard[data-animation].hovercard-leave {
|
12
|
-
transition-property: opacity, transform;
|
13
|
-
transition-duration: 150ms;
|
14
|
-
}
|
15
|
-
.coupdoeil--hovercard[data-animation].hovercard-enter-end[data-animation=fade-in], .coupdoeil--hovercard[data-animation].hovercard-enter-end[data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-enter-end[data-animation=slide-out], .coupdoeil--hovercard[data-animation].hovercard-leave-start[data-animation=fade-in], .coupdoeil--hovercard[data-animation].hovercard-leave-start[data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-leave-start[data-animation=slide-out] {
|
16
|
-
opacity: 1;
|
17
|
-
}
|
18
|
-
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-animation=fade-in], .coupdoeil--hovercard[data-animation].hovercard-enter-start[data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-enter-start[data-animation=slide-out], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-animation=fade-in], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-animation=slide-out] {
|
19
|
-
opacity: 0;
|
20
|
-
}
|
21
|
-
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=right][data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=right][data-animation=slide-in] {
|
22
|
-
transform: translateX(1rem);
|
23
|
-
}
|
24
|
-
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=right][data-animation=slide-out], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=right][data-animation=slide-out] {
|
25
|
-
transform: translateX(-1rem);
|
26
|
-
}
|
27
|
-
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=left][data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=left][data-animation=slide-in] {
|
28
|
-
transform: translateX(-1rem);
|
29
|
-
}
|
30
|
-
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=left][data-animation=slide-out], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=left][data-animation=slide-out] {
|
31
|
-
transform: translateX(1rem);
|
32
|
-
}
|
33
|
-
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=top][data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=top][data-animation=slide-in] {
|
34
|
-
transform: translateY(-1rem);
|
35
|
-
}
|
36
|
-
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=top][data-animation=slide-out], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=top][data-animation=slide-out] {
|
37
|
-
transform: translateY(1rem);
|
38
|
-
}
|
39
|
-
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=bottom][data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=bottom][data-animation=slide-in] {
|
40
|
-
transform: translateY(1rem);
|
41
|
-
}
|
42
|
-
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=bottom][data-animation=slide-out], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=bottom][data-animation=slide-out] {
|
43
|
-
transform: translateY(-1rem);
|
44
|
-
}
|
45
|
-
|
46
|
-
.coupdoeil--hovercard [data-hovercard-arrow] {
|
47
|
-
--co-hovercard--color: white;
|
48
|
-
--co-hovercard--border-color: rgb(209 213 219);
|
49
|
-
--co-hovercard-border-size: 1px;
|
50
|
-
--co-hovercard-border-style: solid;
|
51
|
-
--co-hovercard--size-ratio: 1;
|
52
|
-
--co-hovercard--height: 0.75rem;
|
53
|
-
--co-hovercard--width: calc(var(--co-hovercard--height) / var(--co-hovercard--size-ratio));
|
54
|
-
position: absolute;
|
55
|
-
height: var(--co-hovercard--height);
|
56
|
-
width: var(--co-hovercard--height);
|
57
|
-
}
|
58
|
-
.coupdoeil--hovercard [data-hovercard-arrow]::after, .coupdoeil--hovercard [data-hovercard-arrow]::before {
|
59
|
-
content: "";
|
60
|
-
width: 0;
|
61
|
-
height: 0;
|
62
|
-
position: absolute;
|
63
|
-
bottom: 0;
|
64
|
-
border: var(--co-hovercard--base-border-width) var(--co-hovercard-border-style) transparent;
|
65
|
-
}
|
66
|
-
.coupdoeil--hovercard [data-hovercard-arrow]::after {
|
67
|
-
--co-hovercard--base-border-width: var(--co-hovercard--width);
|
68
|
-
border-bottom-color: var(--co-hovercard--color);
|
69
|
-
left: calc(50% - var(--co-hovercard--width));
|
70
|
-
}
|
71
|
-
.coupdoeil--hovercard [data-hovercard-arrow]::before {
|
72
|
-
--co-hovercard--base-border-width: calc(var(--co-hovercard--height) + var(--co-hovercard-border-size));
|
73
|
-
border-bottom-color: var(--co-hovercard--border-color);
|
74
|
-
left: calc(50% - var(--co-hovercard--width) - var(--co-hovercard-border-size));
|
75
|
-
}
|
76
|
-
.coupdoeil--hovercard[data-placement|=top] [data-hovercard-arrow] {
|
77
|
-
transform: rotate(180deg);
|
78
|
-
}
|
79
|
-
.coupdoeil--hovercard[data-placement|=right] [data-hovercard-arrow] {
|
80
|
-
transform: rotate(-90deg);
|
81
|
-
}
|
82
|
-
.coupdoeil--hovercard[data-placement|=left] [data-hovercard-arrow] {
|
83
|
-
transform: rotate(90deg);
|
84
|
-
}
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import {getParams, getType, preloadedContentElement} from './attributes'
|
2
|
-
|
3
|
-
export const hovercardContentHTMLMap = new Map()
|
4
|
-
|
5
|
-
function cacheMapKey(controller) {
|
6
|
-
if (preloadedContentElement(controller)) {
|
7
|
-
return controller.coupdoeilElement.uniqueId
|
8
|
-
}
|
9
|
-
return getType(controller) + getParams(controller)
|
10
|
-
}
|
11
|
-
|
12
|
-
export function getHovercardContentHTML(controller) {
|
13
|
-
return hovercardContentHTMLMap.get(cacheMapKey(controller))
|
14
|
-
}
|
15
|
-
|
16
|
-
export function setHovercardContentHTML(controller, value) {
|
17
|
-
hovercardContentHTMLMap.set(cacheMapKey(controller), value)
|
18
|
-
}
|
19
|
-
|
20
|
-
export function clearHovercardContentCache() {
|
21
|
-
hovercardContentHTMLMap.clear()
|
22
|
-
}
|
@@ -1,20 +0,0 @@
|
|
1
|
-
export class HovercardController {
|
2
|
-
constructor(coupdoeilElement) {
|
3
|
-
this.coupdoeilElement = coupdoeilElement
|
4
|
-
|
5
|
-
this.card = null // can go on coupdoeil element, renamed 'hovercardElement'
|
6
|
-
|
7
|
-
this.children = new Set() // can go on hovercardElement
|
8
|
-
this.parent = null // can go on hovercardElement
|
9
|
-
|
10
|
-
this.closingRequest = null // can go on coupdoeil element
|
11
|
-
}
|
12
|
-
|
13
|
-
get isOpen() {
|
14
|
-
return !!this.coupdoeilElement.dataset.hovercardOpen
|
15
|
-
}
|
16
|
-
|
17
|
-
get isClosed() {
|
18
|
-
return !this.isOpen
|
19
|
-
}
|
20
|
-
}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
export const CURRENT_HOVERCARDS_BY_ID = new Map()
|
2
|
-
|
3
|
-
export function currentHovercardsById() {
|
4
|
-
return CURRENT_HOVERCARDS_BY_ID
|
5
|
-
}
|
6
|
-
|
7
|
-
export function addToCurrents(coupdoeilElement) {
|
8
|
-
CURRENT_HOVERCARDS_BY_ID.set(coupdoeilElement.uniqueId, coupdoeilElement)
|
9
|
-
}
|
10
|
-
|
11
|
-
export function removeFromCurrents(coupdoeilElement) {
|
12
|
-
CURRENT_HOVERCARDS_BY_ID.delete(coupdoeilElement.uniqueId)
|
13
|
-
}
|