katalyst-content 3.0.2 → 3.1.0
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
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: d1be194d961a873a0cdb20f871b5ff57f57ff1b5b503dfc8716b1004b6b6a4e6
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: b3f45e0d9e23450e39055da1cd5b15b3b93865fa7b37b6cc632ff900041e0d60
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 647b389cbc0c4b8c27227c377a910c04906cb46e34be09d12914f368d2699a0d778b73b7a2e5d493dd45c4f6de9303a366f45f4246984db6b3764294ab2f794b
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: af45914d0047b3b13d4ea19051fb2914cfa4aebf81809af22d14ef022332dd51683d49f10fc5685e9e32e8225bd3712d2c0b51c85df7c033cf1d5457458e4e55
         
     | 
| 
         @@ -31,11 +31,11 @@ module Katalyst 
     | 
|
| 
       31 
31 
     | 
    
         
             
                  private
         
     | 
| 
       32 
32 
     | 
    
         | 
| 
       33 
33 
     | 
    
         
             
                  def content_table_allowed_tags
         
     | 
| 
       34 
     | 
    
         
            -
                    Katalyst::Content 
     | 
| 
      
 34 
     | 
    
         
            +
                    Katalyst::Content.config.table_sanitizer_allowed_tags
         
     | 
| 
       35 
35 
     | 
    
         
             
                  end
         
     | 
| 
       36 
36 
     | 
    
         | 
| 
       37 
37 
     | 
    
         
             
                  def content_table_allowed_attributes
         
     | 
| 
       38 
     | 
    
         
            -
                    Katalyst::Content 
     | 
| 
      
 38 
     | 
    
         
            +
                    Katalyst::Content.config.table_sanitizer_allowed_attributes
         
     | 
| 
       39 
39 
     | 
    
         
             
                  end
         
     | 
| 
       40 
40 
     | 
    
         | 
| 
       41 
41 
     | 
    
         
             
                  # rubocop:disable Rails/HelperInstanceVariable
         
     | 
| 
         @@ -1,6 +1,6 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            <%# locals: (form:, content:) %>
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            <%= form.content_heading_fieldset %>
         
     | 
| 
       4 
     | 
    
         
            -
            <%= form.govuk_rich_text_area(:content) %>
         
     | 
| 
      
 4 
     | 
    
         
            +
            <%= form.govuk_rich_text_area(:content, **content_editor_rich_text_attributes) %>
         
     | 
| 
       5 
5 
     | 
    
         
             
            <%= form.content_theme_field %>
         
     | 
| 
       6 
6 
     | 
    
         
             
            <%= form.content_visible_field %>
         
     | 
| 
         @@ -1,20 +1,27 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # frozen_string_literal: true
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
     | 
    
         
            -
            require "active_support/configurable"
         
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
3 
     | 
    
         
             
            module Katalyst
         
     | 
| 
       6 
4 
     | 
    
         
             
              module Content
         
     | 
| 
       7 
5 
     | 
    
         
             
                class Config
         
     | 
| 
       8 
     | 
    
         
            -
                   
     | 
| 
      
 6 
     | 
    
         
            +
                  attr_accessor :base_controller,
         
     | 
| 
      
 7 
     | 
    
         
            +
                                :default_theme,
         
     | 
| 
      
 8 
     | 
    
         
            +
                                :errors_component,
         
     | 
| 
      
 9 
     | 
    
         
            +
                                :heading_styles,
         
     | 
| 
      
 10 
     | 
    
         
            +
                                :image_mime_types,
         
     | 
| 
      
 11 
     | 
    
         
            +
                                :items,
         
     | 
| 
      
 12 
     | 
    
         
            +
                                :max_image_size,
         
     | 
| 
      
 13 
     | 
    
         
            +
                                :table_sanitizer_allowed_attributes,
         
     | 
| 
      
 14 
     | 
    
         
            +
                                :table_sanitizer_allowed_tags,
         
     | 
| 
      
 15 
     | 
    
         
            +
                                :themes
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
                  alias_attribute :backgrounds, :themes
         
     | 
| 
       9 
18 
     | 
    
         | 
| 
       10 
     | 
    
         
            -
                   
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
                  alias_method :backgrounds=, :themes=
         
     | 
| 
      
 19 
     | 
    
         
            +
                  def initialize
         
     | 
| 
      
 20 
     | 
    
         
            +
                    self.themes        = %w[light dark]
         
     | 
| 
      
 21 
     | 
    
         
            +
                    self.default_theme = themes.first
         
     | 
| 
       14 
22 
     | 
    
         | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
                    %w[
         
     | 
| 
      
 23 
     | 
    
         
            +
                    self.heading_styles   = %w[none default]
         
     | 
| 
      
 24 
     | 
    
         
            +
                    self.items            = %w[
         
     | 
| 
       18 
25 
     | 
    
         
             
                      Katalyst::Content::Content
         
     | 
| 
       19 
26 
     | 
    
         
             
                      Katalyst::Content::Figure
         
     | 
| 
       20 
27 
     | 
    
         
             
                      Katalyst::Content::Table
         
     | 
| 
         @@ -23,21 +30,16 @@ module Katalyst 
     | 
|
| 
       23 
30 
     | 
    
         
             
                      Katalyst::Content::Column
         
     | 
| 
       24 
31 
     | 
    
         
             
                      Katalyst::Content::Aside
         
     | 
| 
       25 
32 
     | 
    
         
             
                    ]
         
     | 
| 
       26 
     | 
    
         
            -
             
     | 
| 
       27 
     | 
    
         
            -
             
     | 
| 
       28 
     | 
    
         
            -
             
     | 
| 
      
 33 
     | 
    
         
            +
                    self.image_mime_types = %w[image/png image/gif image/jpeg image/webp]
         
     | 
| 
      
 34 
     | 
    
         
            +
                    self.max_image_size   = 20
         
     | 
| 
      
 35 
     | 
    
         
            +
                    self.errors_component = "Katalyst::Content::Editor::ErrorsComponent"
         
     | 
| 
       29 
36 
     | 
    
         | 
| 
       30 
     | 
    
         
            -
             
     | 
| 
       31 
     | 
    
         
            -
                  config_accessor(:errors_component) { "Katalyst::Content::Editor::ErrorsComponent" }
         
     | 
| 
      
 37 
     | 
    
         
            +
                    self.base_controller = "ApplicationController"
         
     | 
| 
       32 
38 
     | 
    
         | 
| 
       33 
     | 
    
         
            -
             
     | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
       35 
     | 
    
         
            -
             
     | 
| 
       36 
     | 
    
         
            -
             
     | 
| 
       37 
     | 
    
         
            -
                    %w[table thead tbody tr th td caption a strong em span br p text].freeze
         
     | 
| 
       38 
     | 
    
         
            -
                  end
         
     | 
| 
       39 
     | 
    
         
            -
                  config_accessor(:table_sanitizer_allowed_attributes) do
         
     | 
| 
       40 
     | 
    
         
            -
                    %w[colspan rowspan href].freeze
         
     | 
| 
      
 39 
     | 
    
         
            +
                    # Sanitizer
         
     | 
| 
      
 40 
     | 
    
         
            +
                    self.table_sanitizer_allowed_tags       = %w[table thead tbody tr th td caption a strong em span br p
         
     | 
| 
      
 41 
     | 
    
         
            +
                                                                 text].freeze
         
     | 
| 
      
 42 
     | 
    
         
            +
                    self.table_sanitizer_allowed_attributes = %w[colspan rowspan href].freeze
         
     | 
| 
       41 
43 
     | 
    
         
             
                  end
         
     | 
| 
       42 
44 
     | 
    
         
             
                end
         
     | 
| 
       43 
45 
     | 
    
         
             
              end
         
     |