katalyst-content 3.0.3 → 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: 21f461f16b190c9c6cb7147c3ac17588a837b01726384bfa00795c416f83f369
4
- data.tar.gz: a21d83642982020ee92faed0df79c0811f8b4dc9b6af1b08e86cc2fc999ec656
3
+ metadata.gz: d1be194d961a873a0cdb20f871b5ff57f57ff1b5b503dfc8716b1004b6b6a4e6
4
+ data.tar.gz: b3f45e0d9e23450e39055da1cd5b15b3b93865fa7b37b6cc632ff900041e0d60
5
5
  SHA512:
6
- metadata.gz: a15304c5a37802474e1f332c05398aaaf726ba3f3afd7e9f19608895a0b4a39a5202bc96450e357d3f34ea59e1f534e6e7cbea924d20e2c93dd2fc9737775ead
7
- data.tar.gz: 34617f5e64ee96aac094dd1b7c6f4a866c27d4ca4e13b1b322f742c49db283d1371ab5e1c499f2aee10a199648cf9d7d8f500b994585eb179d4257fbf3e08b5a
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::Config.table_sanitizer_allowed_tags
34
+ Katalyst::Content.config.table_sanitizer_allowed_tags
35
35
  end
36
36
 
37
37
  def content_table_allowed_attributes
38
- Katalyst::Content::Config.table_sanitizer_allowed_attributes
38
+ Katalyst::Content.config.table_sanitizer_allowed_attributes
39
39
  end
40
40
 
41
41
  # rubocop:disable Rails/HelperInstanceVariable
@@ -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
- include ActiveSupport::Configurable
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
- config_accessor(:themes) { %w[light dark] }
11
- config_accessor(:default_theme) { themes.first }
12
- alias_method :backgrounds, :themes
13
- alias_method :backgrounds=, :themes=
19
+ def initialize
20
+ self.themes = %w[light dark]
21
+ self.default_theme = themes.first
14
22
 
15
- config_accessor(:heading_styles) { %w[none default] }
16
- config_accessor(:items) do
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
- end
27
- config_accessor(:image_mime_types) { %w[image/png image/gif image/jpeg image/webp] }
28
- config_accessor(:max_image_size) { 20 }
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
- # Components
31
- config_accessor(:errors_component) { "Katalyst::Content::Editor::ErrorsComponent" }
37
+ self.base_controller = "ApplicationController"
32
38
 
33
- config_accessor(:base_controller) { "ApplicationController" }
34
-
35
- # Sanitizer
36
- config_accessor(:table_sanitizer_allowed_tags) do
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: katalyst-content
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katalyst Interactive