ckeditor5 1.30.0 → 1.31.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: e3153496741eaf1fd9b8713998c1078e52d96c6e863ffe710d215e7e3b098816
4
- data.tar.gz: 35a1bc0b3e29d51876b4e906a38db93073a65a59ee3ab4436d5e394664bcd833
3
+ metadata.gz: a7597c46553e634d89338c3a5ef6a28ff03541645a9eab898e32f09b59a0f7cf
4
+ data.tar.gz: 8ce954837b5b75472270ccc33672e02a04c0ab82db80498ed077f5cd9d8acde9
5
5
  SHA512:
6
- metadata.gz: 7e7d014c98e5c49572be2d2ccd2affcf57d9d91b0cd4f3ffd1cba2cc6834461075c5262aa112768d43ab5a0a9072dcded1fc7daf50beeb19e039b5ad2ff5b40d
7
- data.tar.gz: a0d7ddf8085a98b4dc9d60e1606b1a9721e3cf9625b24743aca9fba0eb89ca15036b4f1664ed4e9e6c3d98eb6fc0e86b59c80705096a053738d3204c0bcc9063
6
+ metadata.gz: 0c67de9f38b698d7010c4db93791d775cec8878324ddf029e91bb4cc04b7b4ce8660eb8841c027eb65b835be9f25443d52632d064d07854b14e153743167d941
7
+ data.tar.gz: 9eb071ef2de50204b5f4e1122a5a0639a60a1dec02681bc772f21da49caa9eb3c16a947b366ec9462aa7d48912ecccf4fe681536024b52123eda29b5b4db35d5
data/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
  CKEditor 5 Ruby on Rails integration gem. Provides seamless integration of CKEditor 5 with Rails applications through web components and helper methods. This gem supports various editor types, including classic, inline, balloon, and decoupled editors. It also includes support for custom plugins, translations, and configuration options.
12
12
 
13
13
  > [!IMPORTANT]
14
- > This gem is unofficial and not maintained by CKSource. For official CKEditor 5 documentation, visit [ckeditor.com](https://ckeditor.com/docs/ckeditor5/latest/). If you encounter any issues in integration, please report them on the [GitHub repository](https://github.com/Mati365/ckeditor5-rails/issues).
14
+ > This gem is unofficial and not maintained by CKSource. For official CKEditor 5 documentation, visit [ckeditor.com](https://ckeditor.com/docs/ckeditor5/latest/). If you encounter any issues in editor, please report them on the [GitHub repository](https://github.com/ckeditor/ckeditor5/issues).
15
15
 
16
16
  <p align="center">
17
17
  <img src="docs/intro-classic-editor.png" alt="CKEditor 5 Classic Editor in Ruby on Rails application">
@@ -52,9 +52,9 @@ module CKEditor5::Rails::Assets
52
52
  private
53
53
 
54
54
  def window_scripts_tags(nonce: nil)
55
- scripts = bundle.scripts.filter_map do |script|
55
+ scripts = bundle.scripts.map do |script|
56
56
  tag.script(src: script.url, nonce: nonce, crossorigin: 'anonymous') if script.window?
57
- end
57
+ end.compact
58
58
 
59
59
  safe_join(scripts)
60
60
  end
@@ -43,7 +43,7 @@ module CKEditor5::Rails
43
43
  end
44
44
 
45
45
  def translations_js_url_imports
46
- translations.filter_map do |lang|
46
+ translations.map do |lang|
47
47
  next if lang == :en
48
48
 
49
49
  url = create_cdn_url(import_name, version, "translations/#{lang}.js")
@@ -53,7 +53,7 @@ module CKEditor5::Rails
53
53
  import_name: "#{import_name}/translations/#{lang}.js",
54
54
  translation: true
55
55
  )
56
- end
56
+ end.compact
57
57
  end
58
58
  end
59
59
  end
@@ -4,13 +4,11 @@ module CKEditor5::Rails
4
4
  module Cdn::Concerns
5
5
  module BundleBuilder
6
6
  def create_preset_bundle(preset)
7
- preset => {
8
- cdn:,
9
- version:,
10
- translations:,
11
- ckbox:,
12
- premium:
13
- }
7
+ cdn = preset.cdn
8
+ version = preset.version
9
+ translations = preset.translations
10
+ ckbox = preset.ckbox
11
+ premium = preset.premium
14
12
 
15
13
  bundle = build_base_cdn_bundle(cdn, version, translations)
16
14
  bundle << build_premium_cdn_bundle(cdn, version, translations) if premium
@@ -30,9 +30,9 @@ module CKEditor5::Rails::Editor
30
30
 
31
31
  def to_attributes
32
32
  {
33
- type: EDITOR_TYPES[@type],
34
- **serialized_attributes
33
+ type: EDITOR_TYPES[@type]
35
34
  }
35
+ .merge(serialized_attributes)
36
36
  end
37
37
 
38
38
  def self.valid_editor_type?(type)
@@ -5,7 +5,7 @@ require_relative '../editor/props_inline_plugin'
5
5
  module CKEditor5::Rails::Plugins
6
6
  class CustomTranslationsLoader < CKEditor5::Rails::Editor::PropsInlinePlugin
7
7
  def initialize(translations, **kwargs) # rubocop:disable Metrics/MethodLength
8
- code = <<~JS.freeze
8
+ code = <<~JS
9
9
  const { Plugin } = await import('ckeditor5');
10
10
 
11
11
  function resolveTranslationReferences(uiLanguage, config, visited = new WeakSet()) {
@@ -37,12 +37,6 @@ module CKEditor5::Rails
37
37
  instance_eval(&block) if block_given?
38
38
  end
39
39
 
40
- def deconstruct_keys(keys)
41
- keys.index_with do |key|
42
- public_send(key)
43
- end
44
- end
45
-
46
40
  # @example Copy preset and modify it
47
41
  # original = PresetBuilder.new
48
42
  # copied = original.initialize_copy(original)
@@ -20,8 +20,7 @@ module CKEditor5::Rails::Presets
20
20
  # group = Group.new('Emoji', label: 'Emoticons')
21
21
  # group.item('smiley', '😊')
22
22
  class Group
23
- attr_reader :name, :label
24
- private attr_reader :items
23
+ attr_reader :name, :label, :items
25
24
 
26
25
  # Initialize a new special characters group
27
26
  #
@@ -3,7 +3,7 @@
3
3
  module CKEditor5
4
4
  module Rails
5
5
  class Semver
6
- SEMVER_PATTERN = /\A\d+\.\d+\.\d+\z/
6
+ SEMVER_PATTERN = /\A\d+\.\d+\.\d+\z/.freeze
7
7
 
8
8
  attr_reader :major, :minor, :patch
9
9
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  module CKEditor5
4
4
  module Rails
5
- VERSION = '1.30.0'
5
+ VERSION = '1.31.0'
6
6
 
7
7
  DEFAULT_CKEDITOR_VERSION = '45.0.0'
8
8
  end
@@ -47,4 +47,4 @@ RSpec.configure do |config|
47
47
  end
48
48
  end
49
49
 
50
- Dir[File.expand_path('support/**/*.rb', __dir__)].each { |f| require f }
50
+ Dir[File.expand_path('support/**/*.rb', __dir__)].sort.each { |f| require f }
@@ -202,17 +202,6 @@ RSpec.describe CKEditor5::Rails::Cdn::Helpers do
202
202
  end
203
203
  end
204
204
 
205
- context 'with missing required parameters' do
206
- before do
207
- allow(helper).to receive(:merge_with_editor_preset).and_return({})
208
- end
209
-
210
- it 'raises error about missing required parameters' do
211
- expect { helper.ckeditor5_assets(preset: :default) }
212
- .to raise_error(NoMatchingPatternKeyError)
213
- end
214
- end
215
-
216
205
  context 'destructure non-matching preset override' do
217
206
  before do
218
207
  RSpec::Mocks.space.proxy_for(CKEditor5::Rails::Engine).reset
data/spec/spec_helper.rb CHANGED
@@ -34,7 +34,7 @@ require 'rspec/rails'
34
34
  require 'rspec/expectations'
35
35
  require 'rspec-html-matchers'
36
36
 
37
- Dir[File.expand_path('support/**/*.rb', __dir__)].each { |f| require f }
37
+ Dir[File.expand_path('support/**/*.rb', __dir__)].sort.each { |f| require f }
38
38
 
39
39
  Rails.application.initialize! unless Rails.application.initialized?
40
40
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ckeditor5
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.30.0
4
+ version: 1.31.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mateusz Bagiński
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-04-11 00:00:00.000000000 Z
12
+ date: 2025-05-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -17,7 +17,7 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: '6.0'
20
+ version: '5.2'
21
21
  - - "<"
22
22
  - !ruby/object:Gem::Version
23
23
  version: '9.0'
@@ -27,7 +27,7 @@ dependencies:
27
27
  requirements:
28
28
  - - ">="
29
29
  - !ruby/object:Gem::Version
30
- version: '6.0'
30
+ version: '5.2'
31
31
  - - "<"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '9.0'
@@ -163,7 +163,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
- version: 3.0.0
166
+ version: 2.5.0
167
167
  required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  requirements:
169
169
  - - ">="