plutonium 0.19.7 → 0.19.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3df0f828455b7b089d1b37ded391dce4f0a6a686ffece56ed924d58a06c1186c
4
- data.tar.gz: 4920459f99392f14f070d51d30261c1e7066d8edba8a4c8f9220b5f5ff74c08a
3
+ metadata.gz: 304744c1553f36ea4c0a56bbbf84fef96125ea0ec6b4280eccaa7d362934ae43
4
+ data.tar.gz: 3f0ec23b889380ec257766338a3c1e3dc4f247484a57aa7b62ed6e789d7346d4
5
5
  SHA512:
6
- metadata.gz: 5aac0589c1a66546d09e4e86730710f18f0466701a9baa7574df3e34c4c84e9403bbed71db3eb81034f903a2be7994ad96f541d5843671a4d6aed07b67ab7f63
7
- data.tar.gz: 92b2e0dc58a7a075149069227f7fa9cdc32a8ab0136ccaa61f00480d6793ea8b64304a26d27b51c18db2df8ea86e1c6a7d5ea0fbe0cf5d8a1476443fb7cab6ab
6
+ metadata.gz: 4a4af1fca2179de9d88c247b10d717a40ca17702dd8342f3045794dee5bd4343eef9af555b8144753143581f4b27ee7988bc6d4817876a9e49864b2d3e75a0f1
7
+ data.tar.gz: 11f274a12630a2bc240743bdf05a0eacd4cdb79d02a010deb5d04f6d97e8213561f1bd0e81afdfcd2d84b4b7491d2ee0055be33869dc44aef270a679d29bdd32
@@ -20,6 +20,11 @@ module Plutonium
20
20
  def attachment_tag(**, &)
21
21
  create_component(Plutonium::UI::Display::Components::Attachment, :attachment, **, &)
22
22
  end
23
+
24
+ def phlexi_render_tag(**, &)
25
+ create_component(Plutonium::UI::Display::Components::PhlexiRender, :phlexi_render, **, &)
26
+ end
27
+ alias_method :phlexi_tag, :phlexi_render_tag
23
28
  end
24
29
 
25
30
  private
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "redcarpet"
4
+
5
+ module Plutonium
6
+ module UI
7
+ module Display
8
+ module Components
9
+ class PhlexiRender < Phlexi::Display::Components::Base
10
+ include Phlexi::Display::Components::Concerns::DisplaysValue
11
+ include Plutonium::UI::Component::Behaviour
12
+
13
+ def render_value(value)
14
+ phlexi_render(build_phlexi_component(value)) {
15
+ p(**attributes) {
16
+ value
17
+ }
18
+ }
19
+ end
20
+
21
+ protected
22
+
23
+ def build_attributes
24
+ super
25
+ @builder = attributes.delete(:with)
26
+ end
27
+
28
+ def build_phlexi_component(value)
29
+ raise "Required option, :with not passed" unless @builder
30
+
31
+ @builder.call(value, attributes)
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -22,7 +22,8 @@ module Plutonium
22
22
  json: "text-sm text-gray-900 dark:text-white mb-1 whitespace-pre font-mono shadow-inner p-4",
23
23
  prefixed_icon: "w-8 h-8 mr-2",
24
24
  markdown: "format dark:format-invert format-primary",
25
- attachment_value_wrapper: "grid grid-cols-[repeat(auto-fill,minmax(0,180px))]"
25
+ attachment_value_wrapper: "grid grid-cols-[repeat(auto-fill,minmax(0,180px))]",
26
+ phlexi_render: :string
26
27
  })
27
28
  end
28
29
  end
@@ -1,5 +1,5 @@
1
1
  module Plutonium
2
- VERSION = "0.19.7"
2
+ VERSION = "0.19.8"
3
3
  NEXT_MAJOR_VERSION = VERSION.split(".").tap { |v|
4
4
  v[1] = v[1].to_i + 1
5
5
  v[2] = 0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plutonium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.7
4
+ version: 0.19.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Froelich
@@ -808,6 +808,7 @@ files:
808
808
  - lib/plutonium/ui/display/components/association.rb
809
809
  - lib/plutonium/ui/display/components/attachment.rb
810
810
  - lib/plutonium/ui/display/components/markdown.rb
811
+ - lib/plutonium/ui/display/components/phlexi_render.rb
811
812
  - lib/plutonium/ui/display/options/inferred_types.rb
812
813
  - lib/plutonium/ui/display/resource.rb
813
814
  - lib/plutonium/ui/display/theme.rb