katalyst-kpop 2.0.9 → 3.0.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -43
- data/app/assets/builds/katalyst/kpop.esm.js +599 -0
- data/app/assets/builds/katalyst/kpop.js +479 -519
- data/app/assets/builds/katalyst/kpop.min.js +2 -1
- data/app/assets/builds/katalyst/kpop.min.js.map +1 -0
- data/app/assets/builds/katalyst/kpop.umd.js +5890 -0
- data/app/assets/config/kpop.js +1 -1
- data/app/assets/stylesheets/katalyst/kpop/_frame.scss +104 -0
- data/app/assets/stylesheets/katalyst/kpop/_modal.scss +95 -0
- data/app/assets/stylesheets/katalyst/kpop/_scrim.scss +33 -3
- data/app/assets/stylesheets/katalyst/kpop/_side_panel.scss +64 -0
- data/app/assets/stylesheets/katalyst/kpop/_variables.scss +25 -0
- data/app/assets/stylesheets/katalyst/kpop.scss +6 -1
- data/app/components/concerns/kpop/has_html_attributes.rb +78 -0
- data/app/components/kpop/frame_component.html.erb +14 -0
- data/app/components/kpop/frame_component.rb +45 -0
- data/app/components/kpop/modal/title_component.html.erb +6 -0
- data/app/components/kpop/modal/title_component.rb +28 -0
- data/app/components/kpop/modal_component.html.erb +8 -0
- data/app/components/kpop/modal_component.rb +39 -0
- data/app/components/scrim_component.rb +32 -0
- data/app/helpers/kpop_helper.rb +12 -35
- data/app/javascript/kpop/application.js +15 -0
- data/app/javascript/kpop/controllers/close_controller.js +9 -0
- data/app/javascript/kpop/controllers/frame_controller.js +189 -0
- data/app/javascript/kpop/controllers/modal_controller.js +30 -0
- data/app/javascript/kpop/controllers/redirect_controller.js +22 -0
- data/app/{assets/javascripts → javascript/kpop}/controllers/scrim_controller.js +76 -72
- data/app/javascript/kpop/debug.js +3 -0
- data/app/javascript/kpop/modals/content_modal.js +46 -0
- data/app/javascript/kpop/modals/frame_modal.js +41 -0
- data/app/javascript/kpop/modals/modal.js +69 -0
- data/app/javascript/kpop/modals/stream_modal.js +49 -0
- data/app/javascript/kpop/modals/stream_renderer.js +15 -0
- data/app/views/layouts/kpop.html.erb +1 -1
- data/config/importmap.rb +1 -4
- data/lib/katalyst/kpop/engine.rb +13 -12
- data/lib/katalyst/kpop/matchers/base.rb +18 -0
- data/lib/katalyst/kpop/matchers/capybara_matcher.rb +46 -0
- data/lib/katalyst/kpop/matchers/capybara_parser.rb +17 -0
- data/lib/katalyst/kpop/matchers/chained_matcher.rb +40 -0
- data/lib/katalyst/kpop/matchers/frame_matcher.rb +16 -0
- data/lib/katalyst/kpop/matchers/modal_matcher.rb +20 -0
- data/lib/katalyst/kpop/matchers/redirect_finder.rb +16 -0
- data/lib/katalyst/kpop/matchers/redirect_matcher.rb +28 -0
- data/lib/katalyst/kpop/matchers/response_matcher.rb +33 -0
- data/lib/katalyst/kpop/matchers/stream_matcher.rb +16 -0
- data/lib/katalyst/kpop/matchers/title_finder.rb +16 -0
- data/lib/katalyst/kpop/matchers/title_matcher.rb +28 -0
- data/lib/katalyst/kpop/matchers.rb +79 -0
- data/lib/katalyst/kpop/turbo.rb +56 -0
- data/lib/katalyst/kpop/version.rb +1 -1
- data/lib/katalyst/kpop.rb +4 -0
- metadata +90 -15
- data/app/assets/builds/katalyst/kpop.css +0 -117
- data/app/assets/javascripts/controllers/kpop_controller.js +0 -72
- data/app/assets/javascripts/katalyst/kpop.js +0 -9
- data/app/assets/stylesheets/katalyst/kpop/_index.scss +0 -2
- data/app/assets/stylesheets/katalyst/kpop/_kpop.scss +0 -133
- data/app/helpers/kpop/modal.rb +0 -98
- data/app/helpers/scrim_helper.rb +0 -13
data/config/importmap.rb
CHANGED
@@ -1,6 +1,3 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
under: "controllers",
|
5
|
-
# preload in tests so that we don't start clicking before controllers load
|
6
|
-
preload: Rails.env.test?
|
3
|
+
pin "@katalyst/kpop", to: "katalyst/kpop.js", preload: true
|
data/lib/katalyst/kpop/engine.rb
CHANGED
@@ -1,34 +1,35 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "rails"
|
4
|
+
require "turbo-rails"
|
4
5
|
|
5
6
|
module Katalyst
|
6
7
|
module Kpop
|
7
8
|
class Engine < ::Rails::Engine
|
8
9
|
config.autoload_once_paths = %W(#{root}/app/helpers)
|
9
10
|
|
10
|
-
|
11
|
-
ActiveSupport.on_load(:action_controller_base) do
|
12
|
-
helper Katalyst::Kpop::Engine.helpers
|
13
|
-
end
|
11
|
+
PRECOMPILE_ASSETS = %w(kpop.js kpop.min.js kpop.min.js.map).freeze
|
14
12
|
|
15
|
-
|
16
|
-
|
13
|
+
initializer "kpop.assets" do
|
14
|
+
if Rails.application.config.respond_to?(:assets)
|
15
|
+
Rails.application.config.assets.precompile += PRECOMPILE_ASSETS
|
17
16
|
end
|
18
17
|
end
|
19
18
|
|
20
|
-
initializer "kpop.
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
19
|
+
initializer "kpop.helpers", before: :load_config_initializers do
|
20
|
+
::Turbo::Streams::TagBuilder.define_method(:kpop) do
|
21
|
+
Katalyst::Kpop::Turbo::TagBuilder.new(self)
|
22
|
+
end
|
23
|
+
|
24
|
+
ActiveSupport.on_load(:action_controller_base) do
|
25
|
+
helper Katalyst::Kpop::Engine.helpers
|
25
26
|
end
|
26
27
|
end
|
27
28
|
|
28
29
|
initializer "kpop.importmap", before: "importmap" do |app|
|
29
30
|
if app.config.respond_to?(:importmap)
|
30
31
|
app.config.importmap.paths << root.join("config/importmap.rb")
|
31
|
-
app.config.importmap.cache_sweepers << root.join("app/assets/
|
32
|
+
app.config.importmap.cache_sweepers << root.join("app/assets/builds")
|
32
33
|
end
|
33
34
|
end
|
34
35
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rspec/rails/matchers/base_matcher"
|
4
|
+
|
5
|
+
module Katalyst
|
6
|
+
module Kpop
|
7
|
+
module Matchers
|
8
|
+
class Base < RSpec::Rails::Matchers::BaseMatcher
|
9
|
+
attr_reader :matched
|
10
|
+
|
11
|
+
def matches?(actual)
|
12
|
+
@matched = super
|
13
|
+
@matched.present?
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "katalyst/kpop/matchers/base"
|
4
|
+
|
5
|
+
module Katalyst
|
6
|
+
module Kpop
|
7
|
+
module Matchers
|
8
|
+
# @api private
|
9
|
+
class CapybaraMatcher < Base
|
10
|
+
attr_reader :matched
|
11
|
+
|
12
|
+
def matches?(actual)
|
13
|
+
super
|
14
|
+
rescue ::Capybara::ElementNotFound
|
15
|
+
nil
|
16
|
+
end
|
17
|
+
|
18
|
+
def match(expected, actual)
|
19
|
+
actual.find(expected)
|
20
|
+
end
|
21
|
+
|
22
|
+
def description
|
23
|
+
"match #{expected}"
|
24
|
+
end
|
25
|
+
|
26
|
+
def describe_expected
|
27
|
+
expected.inspect
|
28
|
+
end
|
29
|
+
|
30
|
+
def describe_actual
|
31
|
+
response = actual.native.children.to_html.gsub(/\s+/, " ")
|
32
|
+
response = "#{response[0..120]}..." if response.length > 120
|
33
|
+
response.inspect
|
34
|
+
end
|
35
|
+
|
36
|
+
def failure_message
|
37
|
+
"expected #{describe_expected} but received #{describe_actual} instead"
|
38
|
+
end
|
39
|
+
|
40
|
+
def failure_message_when_negated
|
41
|
+
"expected not to find #{expected}"
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "katalyst/kpop/matchers/base"
|
4
|
+
|
5
|
+
module Katalyst
|
6
|
+
module Kpop
|
7
|
+
module Matchers
|
8
|
+
# @api private
|
9
|
+
class CapybaraParser < Base
|
10
|
+
def match(_, actual)
|
11
|
+
@html = Nokogiri::HTML5.parse(actual.body)
|
12
|
+
Capybara::Node::Simple.new(@html)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rspec/rails/matchers/base_matcher"
|
4
|
+
|
5
|
+
module Katalyst
|
6
|
+
module Kpop
|
7
|
+
module Matchers
|
8
|
+
# @api private
|
9
|
+
class ChainedMatcher < RSpec::Rails::Matchers::BaseMatcher
|
10
|
+
Input = Struct.new(:matched)
|
11
|
+
|
12
|
+
delegate :failure_message, :failure_message_when_negated, to: :@matcher
|
13
|
+
|
14
|
+
def initialize(*matchers)
|
15
|
+
super()
|
16
|
+
matchers.each { |m| self << m }
|
17
|
+
end
|
18
|
+
|
19
|
+
def <<(matcher)
|
20
|
+
matcher = matcher.new if matcher.is_a?(Class)
|
21
|
+
(@matchers ||= []) << matcher
|
22
|
+
self
|
23
|
+
end
|
24
|
+
|
25
|
+
def match(_, actual)
|
26
|
+
@matcher = Input.new(actual)
|
27
|
+
@matchers.all? do |matcher|
|
28
|
+
input = @matcher.matched
|
29
|
+
@matcher = matcher
|
30
|
+
matcher.matches?(input)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def description
|
35
|
+
@matchers.last.description
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "katalyst/kpop/matchers/capybara_matcher"
|
4
|
+
|
5
|
+
module Katalyst
|
6
|
+
module Kpop
|
7
|
+
module Matchers
|
8
|
+
# @api private
|
9
|
+
class FrameMatcher < CapybaraMatcher
|
10
|
+
def initialize(id: "kpop")
|
11
|
+
super("turbo-frame##{id}")
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "katalyst/kpop/matchers/capybara_matcher"
|
4
|
+
|
5
|
+
module Katalyst
|
6
|
+
module Kpop
|
7
|
+
module Matchers
|
8
|
+
# @api private
|
9
|
+
class ModalMatcher < CapybaraMatcher
|
10
|
+
def initialize
|
11
|
+
super("[data-controller*='kpop--modal']")
|
12
|
+
end
|
13
|
+
|
14
|
+
def description
|
15
|
+
"contain a kpop modal"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "katalyst/kpop/matchers/capybara_matcher"
|
4
|
+
|
5
|
+
module Katalyst
|
6
|
+
module Kpop
|
7
|
+
module Matchers
|
8
|
+
# @api private
|
9
|
+
class RedirectFinder < CapybaraMatcher
|
10
|
+
def initialize
|
11
|
+
super("[data-controller='kpop--redirect']")
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "katalyst/kpop/matchers/base"
|
4
|
+
|
5
|
+
module Katalyst
|
6
|
+
module Kpop
|
7
|
+
module Matchers
|
8
|
+
# @api private
|
9
|
+
class RedirectMatcher < Base
|
10
|
+
def match(expected, actual)
|
11
|
+
actual["data-kpop--redirect-path-value"].to_s.match?(expected)
|
12
|
+
end
|
13
|
+
|
14
|
+
def description
|
15
|
+
"kpop redirect to #{expected.inspect}"
|
16
|
+
end
|
17
|
+
|
18
|
+
def failure_message
|
19
|
+
"expected a kpop redirect to #{expected.inspect} but received #{actual.native.to_html.inspect} instead"
|
20
|
+
end
|
21
|
+
|
22
|
+
def failure_message_when_negated
|
23
|
+
"expected not to find a kpop redirect to #{expected.inspect}"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "katalyst/kpop/matchers/base"
|
4
|
+
|
5
|
+
module Katalyst
|
6
|
+
module Kpop
|
7
|
+
module Matchers
|
8
|
+
# @api private
|
9
|
+
class ResponseMatcher < Base
|
10
|
+
def match(_, actual)
|
11
|
+
case actual
|
12
|
+
when ::ActionDispatch::Response
|
13
|
+
::ActionDispatch::TestResponse.from_response(actual)
|
14
|
+
when ::ActionDispatch::TestResponse
|
15
|
+
actual
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def description
|
20
|
+
"a response"
|
21
|
+
end
|
22
|
+
|
23
|
+
def failure_message
|
24
|
+
"expected a response but received #{actual.inspect} instead"
|
25
|
+
end
|
26
|
+
|
27
|
+
def failure_message_when_negated
|
28
|
+
"expected not to receive a response"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "katalyst/kpop/matchers/capybara_matcher"
|
4
|
+
|
5
|
+
module Katalyst
|
6
|
+
module Kpop
|
7
|
+
module Matchers
|
8
|
+
# @api private
|
9
|
+
class StreamMatcher < CapybaraMatcher
|
10
|
+
def initialize(id: "kpop", action: "update")
|
11
|
+
super("turbo-stream[action='#{action}'][target='#{id}']")
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "katalyst/kpop/matchers/capybara_matcher"
|
4
|
+
|
5
|
+
module Katalyst
|
6
|
+
module Kpop
|
7
|
+
module Matchers
|
8
|
+
# @api private
|
9
|
+
class TitleFinder < CapybaraMatcher
|
10
|
+
def initialize
|
11
|
+
super(".kpop-title")
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "katalyst/kpop/matchers/base"
|
4
|
+
|
5
|
+
module Katalyst
|
6
|
+
module Kpop
|
7
|
+
module Matchers
|
8
|
+
# @api private
|
9
|
+
class TitleMatcher < Base
|
10
|
+
def description
|
11
|
+
"contain a kpop modal with title #{expected.inspect}"
|
12
|
+
end
|
13
|
+
|
14
|
+
def match(expected, actual)
|
15
|
+
expected.match?(actual.text)
|
16
|
+
end
|
17
|
+
|
18
|
+
def failure_message
|
19
|
+
"expected a kpop modal with title #{expected.inspect} but received #{actual.native.to_html.inspect} instead"
|
20
|
+
end
|
21
|
+
|
22
|
+
def failure_message_when_negated
|
23
|
+
"expected not to find a kpop modal with title #{expected}"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "katalyst/kpop/matchers/base"
|
4
|
+
require "katalyst/kpop/matchers/capybara_matcher"
|
5
|
+
require "katalyst/kpop/matchers/capybara_parser"
|
6
|
+
require "katalyst/kpop/matchers/chained_matcher"
|
7
|
+
require "katalyst/kpop/matchers/frame_matcher"
|
8
|
+
require "katalyst/kpop/matchers/modal_matcher"
|
9
|
+
require "katalyst/kpop/matchers/redirect_finder"
|
10
|
+
require "katalyst/kpop/matchers/redirect_matcher"
|
11
|
+
require "katalyst/kpop/matchers/response_matcher"
|
12
|
+
require "katalyst/kpop/matchers/stream_matcher"
|
13
|
+
require "katalyst/kpop/matchers/title_finder"
|
14
|
+
require "katalyst/kpop/matchers/title_matcher"
|
15
|
+
|
16
|
+
module Katalyst
|
17
|
+
module Kpop
|
18
|
+
module Matchers
|
19
|
+
# @api public
|
20
|
+
# Passes if `response` contains a turbo response with a kpop dismiss action.
|
21
|
+
#
|
22
|
+
# @example
|
23
|
+
# expect(response).to kpop_dismiss
|
24
|
+
def kpop_dismiss(id: "kpop")
|
25
|
+
ChainedMatcher.new(ResponseMatcher, CapybaraParser, StreamMatcher.new(id:, action: "append"))
|
26
|
+
end
|
27
|
+
|
28
|
+
# @api public
|
29
|
+
# Passes if `response` contains a turbo response with a kpop redirect to
|
30
|
+
# the provided `target`.
|
31
|
+
#
|
32
|
+
# @example Matching a path against a turbo response containing a kpop redirect
|
33
|
+
# expect(response).to kpop_redirect_to("/path/to/resource")
|
34
|
+
def kpop_redirect_to(target, id: "kpop")
|
35
|
+
raise ArgumentError, "Invalid target: nil" unless target
|
36
|
+
|
37
|
+
ChainedMatcher.new(ResponseMatcher,
|
38
|
+
CapybaraParser,
|
39
|
+
StreamMatcher.new(id:, action: "append"),
|
40
|
+
RedirectFinder,
|
41
|
+
RedirectMatcher.new(target))
|
42
|
+
end
|
43
|
+
|
44
|
+
# @api public
|
45
|
+
# Passes if `response` contains a turbo stream response with a kpop modal.
|
46
|
+
# Supports matching on:
|
47
|
+
# * id – kpop frame id
|
48
|
+
# * title - modal title
|
49
|
+
#
|
50
|
+
# @example Matching turbo stream response with a Shopping Cart modal
|
51
|
+
# expect(response).to render_kpop_stream(title: "Shopping Cart")
|
52
|
+
def render_kpop_stream(id: "kpop", title: nil)
|
53
|
+
matcher = ChainedMatcher.new(ResponseMatcher, CapybaraParser, StreamMatcher.new(id:, action: "kpop_open"),
|
54
|
+
ModalMatcher)
|
55
|
+
matcher << TitleFinder << TitleMatcher.new(title) if title.present?
|
56
|
+
matcher
|
57
|
+
end
|
58
|
+
|
59
|
+
# @api public
|
60
|
+
# Passes if `response` contains a turbo frame with a kpop modal.
|
61
|
+
# Supports matching on:
|
62
|
+
# * id – turbo frame id
|
63
|
+
# * title - modal title
|
64
|
+
#
|
65
|
+
# @example Matching turbo stream response with a Shopping Cart modal
|
66
|
+
# expect(response).to render_kpop_frame(title: "Shopping Cart")
|
67
|
+
def render_kpop_frame(id: "kpop", title: nil)
|
68
|
+
matcher = ChainedMatcher.new(ResponseMatcher, CapybaraParser, FrameMatcher.new(id:), ModalMatcher)
|
69
|
+
matcher << TitleFinder << TitleMatcher.new(title) if title.present?
|
70
|
+
matcher
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
RSpec.configure do |config|
|
77
|
+
config.include Katalyst::Kpop::Matchers, type: :component
|
78
|
+
config.include Katalyst::Kpop::Matchers, type: :request
|
79
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "katalyst/kpop/engine"
|
4
|
+
|
5
|
+
module Katalyst
|
6
|
+
module Kpop
|
7
|
+
module Turbo
|
8
|
+
class TagBuilder
|
9
|
+
delegate :action, :append, :tag, to: :@builder
|
10
|
+
|
11
|
+
def initialize(builder)
|
12
|
+
@builder = builder
|
13
|
+
end
|
14
|
+
|
15
|
+
# Open a modal in the kpop frame identified by <tt>id</tt> either the <tt>content</tt> passed in or a
|
16
|
+
# rendering result determined by the <tt>rendering</tt> keyword arguments, the content in the block,
|
17
|
+
# or the rendering of the content as a record. Examples:
|
18
|
+
#
|
19
|
+
# <%= turbo_stream.kpop.open modal %>
|
20
|
+
# <%= turbo_stream.kpop.open partial: "modals/modal", locals: { record: } %>
|
21
|
+
# <%= turbo_stream.kpop.open do %>
|
22
|
+
# <%= render Kpop::ModalComponent.new(title: "Example") do %>
|
23
|
+
# ...
|
24
|
+
# <% end %>
|
25
|
+
# <% end %>
|
26
|
+
def open(content = nil, id: "kpop", **, &)
|
27
|
+
@builder.action(:kpop_open, id, content, **, &)
|
28
|
+
end
|
29
|
+
|
30
|
+
# Render a turbo stream action that will dismiss any open kpop modal.
|
31
|
+
def dismiss(id: "kpop")
|
32
|
+
append(id) do
|
33
|
+
tag.div("", data: {
|
34
|
+
controller: "kpop--close",
|
35
|
+
kpop__close_kpop__frame_outlet: "##{id}",
|
36
|
+
turbo_temporary: "",
|
37
|
+
})
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
# Renders a kpop redirect controller response that will escape the frame and navigate to the given URL.
|
42
|
+
def redirect_to(url, id: "kpop", target: nil)
|
43
|
+
append(id) do
|
44
|
+
tag.div("", data: {
|
45
|
+
controller: "kpop--redirect",
|
46
|
+
kpop__redirect_kpop__frame_outlet: "##{id}",
|
47
|
+
kpop__redirect_path_value: url,
|
48
|
+
kpop__redirect_target_value: target,
|
49
|
+
turbo_temporary: "",
|
50
|
+
})
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
data/lib/katalyst/kpop.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: katalyst-kpop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0.beta.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Katalyst Interactive
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
12
|
-
dependencies:
|
11
|
+
date: 2023-10-26 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: html-attributes-utils
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: turbo-rails
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: view_component
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
13
55
|
description:
|
14
56
|
email:
|
15
57
|
- developers@katalyst.com.au
|
@@ -18,25 +60,58 @@ extensions: []
|
|
18
60
|
extra_rdoc_files: []
|
19
61
|
files:
|
20
62
|
- README.md
|
21
|
-
- app/assets/builds/katalyst/kpop.
|
63
|
+
- app/assets/builds/katalyst/kpop.esm.js
|
22
64
|
- app/assets/builds/katalyst/kpop.js
|
23
65
|
- app/assets/builds/katalyst/kpop.min.js
|
66
|
+
- app/assets/builds/katalyst/kpop.min.js.map
|
67
|
+
- app/assets/builds/katalyst/kpop.umd.js
|
24
68
|
- app/assets/config/kpop.js
|
25
|
-
- app/assets/javascripts/controllers/kpop_controller.js
|
26
|
-
- app/assets/javascripts/controllers/scrim_controller.js
|
27
|
-
- app/assets/javascripts/katalyst/kpop.js
|
28
69
|
- app/assets/stylesheets/katalyst/kpop.scss
|
29
|
-
- app/assets/stylesheets/katalyst/kpop/
|
30
|
-
- app/assets/stylesheets/katalyst/kpop/
|
70
|
+
- app/assets/stylesheets/katalyst/kpop/_frame.scss
|
71
|
+
- app/assets/stylesheets/katalyst/kpop/_modal.scss
|
31
72
|
- app/assets/stylesheets/katalyst/kpop/_scrim.scss
|
32
|
-
- app/
|
73
|
+
- app/assets/stylesheets/katalyst/kpop/_side_panel.scss
|
74
|
+
- app/assets/stylesheets/katalyst/kpop/_variables.scss
|
75
|
+
- app/components/concerns/kpop/has_html_attributes.rb
|
76
|
+
- app/components/kpop/frame_component.html.erb
|
77
|
+
- app/components/kpop/frame_component.rb
|
78
|
+
- app/components/kpop/modal/title_component.html.erb
|
79
|
+
- app/components/kpop/modal/title_component.rb
|
80
|
+
- app/components/kpop/modal_component.html.erb
|
81
|
+
- app/components/kpop/modal_component.rb
|
82
|
+
- app/components/scrim_component.rb
|
33
83
|
- app/helpers/kpop_helper.rb
|
34
|
-
- app/
|
84
|
+
- app/javascript/kpop/application.js
|
85
|
+
- app/javascript/kpop/controllers/close_controller.js
|
86
|
+
- app/javascript/kpop/controllers/frame_controller.js
|
87
|
+
- app/javascript/kpop/controllers/modal_controller.js
|
88
|
+
- app/javascript/kpop/controllers/redirect_controller.js
|
89
|
+
- app/javascript/kpop/controllers/scrim_controller.js
|
90
|
+
- app/javascript/kpop/debug.js
|
91
|
+
- app/javascript/kpop/modals/content_modal.js
|
92
|
+
- app/javascript/kpop/modals/frame_modal.js
|
93
|
+
- app/javascript/kpop/modals/modal.js
|
94
|
+
- app/javascript/kpop/modals/stream_modal.js
|
95
|
+
- app/javascript/kpop/modals/stream_renderer.js
|
35
96
|
- app/views/layouts/kpop.html.erb
|
36
97
|
- config/importmap.rb
|
37
98
|
- config/routes.rb
|
38
99
|
- lib/katalyst/kpop.rb
|
39
100
|
- lib/katalyst/kpop/engine.rb
|
101
|
+
- lib/katalyst/kpop/matchers.rb
|
102
|
+
- lib/katalyst/kpop/matchers/base.rb
|
103
|
+
- lib/katalyst/kpop/matchers/capybara_matcher.rb
|
104
|
+
- lib/katalyst/kpop/matchers/capybara_parser.rb
|
105
|
+
- lib/katalyst/kpop/matchers/chained_matcher.rb
|
106
|
+
- lib/katalyst/kpop/matchers/frame_matcher.rb
|
107
|
+
- lib/katalyst/kpop/matchers/modal_matcher.rb
|
108
|
+
- lib/katalyst/kpop/matchers/redirect_finder.rb
|
109
|
+
- lib/katalyst/kpop/matchers/redirect_matcher.rb
|
110
|
+
- lib/katalyst/kpop/matchers/response_matcher.rb
|
111
|
+
- lib/katalyst/kpop/matchers/stream_matcher.rb
|
112
|
+
- lib/katalyst/kpop/matchers/title_finder.rb
|
113
|
+
- lib/katalyst/kpop/matchers/title_matcher.rb
|
114
|
+
- lib/katalyst/kpop/turbo.rb
|
40
115
|
- lib/katalyst/kpop/version.rb
|
41
116
|
homepage: https://github.com/katalyst/kpop
|
42
117
|
licenses:
|
@@ -51,14 +126,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
51
126
|
requirements:
|
52
127
|
- - ">="
|
53
128
|
- !ruby/object:Gem::Version
|
54
|
-
version: '3.
|
129
|
+
version: '3.2'
|
55
130
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
131
|
requirements:
|
57
|
-
- - "
|
132
|
+
- - ">"
|
58
133
|
- !ruby/object:Gem::Version
|
59
|
-
version:
|
134
|
+
version: 1.3.1
|
60
135
|
requirements: []
|
61
|
-
rubygems_version: 3.4.
|
136
|
+
rubygems_version: 3.4.20
|
62
137
|
signing_key:
|
63
138
|
specification_version: 4
|
64
139
|
summary: Modal library that uses Turbo and Stimulus.
|