Class: Rails::Domternal::Configuration
- Inherits:
-
Object
- Object
- Rails::Domternal::Configuration
- Defined in:
- lib/rails/domternal/configuration.rb
Instance Attribute Summary collapse
-
#allowed_mime_types ⇒ Object
Returns the value of attribute allowed_mime_types.
-
#asset_strategy ⇒ Object
:importmap, :jsbundling, or :cdn — how the install generator wires up JS.
-
#default_extensions ⇒ Object
Symbolic extension keys resolved client-side by app/assets/javascripts/domternal/extensions.js.
-
#max_file_size ⇒ Object
Returns the value of attribute max_file_size.
-
#npm_version ⇒ Object
npm dist-tag/version used when pinning packages from a CDN (importmap/:cdn strategies).
-
#sanitizer_allowed_attributes ⇒ Object
Returns the value of attribute sanitizer_allowed_attributes.
-
#sanitizer_allowed_tags ⇒ Object
HTML tags/attributes allowed through the safelist sanitizer applied to incoming bodies.
-
#theme ⇒ Object
:light, :dark, or :auto.
-
#toolbar ⇒ Object
:full, :minimal, :notion, or false.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/rails/domternal/configuration.rb', line 31 def initialize @default_extensions = %i[starter_kit image] @toolbar = :full @theme = :light @asset_strategy = :importmap @npm_version = "latest" @allowed_mime_types = %w[image/png image/jpeg image/gif image/webp image/svg+xml image/avif] @max_file_size = 10.megabytes @sanitizer_allowed_tags = %w[ p br div span h1 h2 h3 h4 h5 h6 strong em b i u s del ins mark sub sup code pre ul ol li blockquote a img figure figcaption table thead tbody tr th td hr details summary ] @sanitizer_allowed_attributes = %w[ href src alt title width height loading crossorigin colspan rowspan align style class data-type data-id data-label ] end |
Instance Attribute Details
#allowed_mime_types ⇒ Object
Returns the value of attribute allowed_mime_types.
24 25 26 |
# File 'lib/rails/domternal/configuration.rb', line 24 def allowed_mime_types @allowed_mime_types end |
#asset_strategy ⇒ Object
:importmap, :jsbundling, or :cdn — how the install generator wires up JS. Informational at runtime; only the generator branches on it.
19 20 21 |
# File 'lib/rails/domternal/configuration.rb', line 19 def asset_strategy @asset_strategy end |
#default_extensions ⇒ Object
Symbolic extension keys resolved client-side by app/assets/javascripts/domternal/extensions.js
7 8 9 |
# File 'lib/rails/domternal/configuration.rb', line 7 def default_extensions @default_extensions end |
#max_file_size ⇒ Object
Returns the value of attribute max_file_size.
25 26 27 |
# File 'lib/rails/domternal/configuration.rb', line 25 def max_file_size @max_file_size end |
#npm_version ⇒ Object
npm dist-tag/version used when pinning packages from a CDN (importmap/:cdn strategies).
22 23 24 |
# File 'lib/rails/domternal/configuration.rb', line 22 def npm_version @npm_version end |
#sanitizer_allowed_attributes ⇒ Object
Returns the value of attribute sanitizer_allowed_attributes.
29 30 31 |
# File 'lib/rails/domternal/configuration.rb', line 29 def sanitizer_allowed_attributes @sanitizer_allowed_attributes end |
#sanitizer_allowed_tags ⇒ Object
HTML tags/attributes allowed through the safelist sanitizer applied to incoming bodies.
28 29 30 |
# File 'lib/rails/domternal/configuration.rb', line 28 def @sanitizer_allowed_tags end |
#theme ⇒ Object
:light, :dark, or :auto
15 16 17 |
# File 'lib/rails/domternal/configuration.rb', line 15 def theme @theme end |
#toolbar ⇒ Object
:full, :minimal, :notion, or false. :notion swaps the fixed toolbar for a selection bubble menu + a "+" floating menu, matching the block handle/slash command UI the :block_controls extension adds — pair the two.
12 13 14 |
# File 'lib/rails/domternal/configuration.rb', line 12 def @toolbar end |