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 +4 -4
- data/README.md +1 -1
- data/lib/ckeditor5/rails/assets/assets_bundle_html_serializer.rb +2 -2
- data/lib/ckeditor5/rails/cdn/ckeditor_bundle.rb +2 -2
- data/lib/ckeditor5/rails/cdn/concerns/bundle_builder.rb +5 -7
- data/lib/ckeditor5/rails/editor/props.rb +2 -2
- data/lib/ckeditor5/rails/plugins/custom_translations_loader.rb +1 -1
- data/lib/ckeditor5/rails/presets/preset_builder.rb +0 -6
- data/lib/ckeditor5/rails/presets/special_characters_builder.rb +1 -2
- data/lib/ckeditor5/rails/semver.rb +1 -1
- data/lib/ckeditor5/rails/version.rb +1 -1
- data/spec/e2e/spec_helper.rb +1 -1
- data/spec/lib/ckeditor5/rails/cdn/helpers_spec.rb +0 -11
- data/spec/spec_helper.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7597c46553e634d89338c3a5ef6a28ff03541645a9eab898e32f09b59a0f7cf
|
4
|
+
data.tar.gz: 8ce954837b5b75472270ccc33672e02a04c0ab82db80498ed077f5cd9d8acde9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
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.
|
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
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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
|
@@ -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
|
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
|
#
|
data/spec/e2e/spec_helper.rb
CHANGED
@@ -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.
|
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-
|
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: '
|
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: '
|
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:
|
166
|
+
version: 2.5.0
|
167
167
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
168
168
|
requirements:
|
169
169
|
- - ">="
|