ckeditor5 1.10.0 → 1.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +10 -0
- data/README.md +16 -1
- data/lib/ckeditor5/rails/assets/assets_bundle_html_serializer.rb +1 -1
- data/lib/ckeditor5/rails/cdn/ckbox_bundle.rb +17 -8
- data/lib/ckeditor5/rails/cdn/url_generator.rb +7 -5
- data/lib/ckeditor5/rails/presets/preset_builder.rb +4 -1
- data/lib/ckeditor5/rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ff16eff85125b3b08d827a0dc6f25f85c84535ffdc37fada565a256e9a494c6
|
4
|
+
data.tar.gz: 505f43e893d3fa0119fd23365c83a01b729edbbc9236adcaa282c5e6a0791ac4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d93cdc48b6c6f8d10af216f4c0622dbd99ac08c82267ab6c3d5089f1a70395cda15b9ec345b097b40ae59b8611c492711fefc8b6a33d09a42110bf294077465
|
7
|
+
data.tar.gz: 60ea317d04dbc4305cf878925234b28eeb380e508f1991f9021be042e1d88d35ae11914947e1aeca088846b2cad91d2625b79cfb09dafe661fcd32b1e4080acf
|
data/Gemfile
CHANGED
@@ -6,11 +6,21 @@ gem 'bundler', '~> 2.5', '>= 2.5.21'
|
|
6
6
|
|
7
7
|
group :development do
|
8
8
|
gem 'brakeman', '~> 6.1', '>= 6.1.1', require: false
|
9
|
+
gem 'guard', '~> 2.19', '>= 2.19.0'
|
10
|
+
gem 'guard-process', '~> 1.2'
|
11
|
+
gem 'pry', '~> 0.15', '>= 0.15.0'
|
12
|
+
gem 'rails', '~> 7.0', '>= 7.0.0'
|
9
13
|
gem 'rake', '~> 13.2', '>= 13.2.1'
|
10
14
|
gem 'rspec', '~> 3.13'
|
15
|
+
gem 'rspec-expectations', '~> 3.13'
|
16
|
+
gem 'rspec-rails', '~> 7.0'
|
11
17
|
gem 'rubocop', '~> 1.66', require: false
|
12
18
|
gem 'rubocop-rails', '~> 2.26', '>= 2.26.2', require: false
|
13
19
|
gem 'rubocop-rails-omakase', '~> 1.0.0', require: false
|
20
|
+
gem 'simple_form', '~> 5.3', '>= 5.3.0'
|
21
|
+
gem 'slim', '~> 5.2', '>= 5.2.0'
|
22
|
+
gem 'sprockets-rails', '~> 3.2', '>= 3.2.2'
|
23
|
+
gem 'sqlite3', '>= 1.4'
|
14
24
|
end
|
15
25
|
|
16
26
|
group :test, :development do
|
data/README.md
CHANGED
@@ -117,6 +117,7 @@ Voilà! You have CKEditor 5 integrated with your Rails application. 🎉
|
|
117
117
|
- [`editor-error` event](#editor-error-event)
|
118
118
|
- [`editor-change` event](#editor-change-event)
|
119
119
|
- [Inline event handling](#inline-event-handling)
|
120
|
+
- [Gem Development 🛠](#gem-development-)
|
120
121
|
- [Trademarks 📜](#trademarks-)
|
121
122
|
- [License 📜](#license-)
|
122
123
|
|
@@ -1314,7 +1315,21 @@ You can also define event handlers directly in the view using the `oneditorchang
|
|
1314
1315
|
}
|
1315
1316
|
</script>
|
1316
1317
|
|
1317
|
-
<%= ckeditor5_editor
|
1318
|
+
<%= ckeditor5_editor id: 'editor',
|
1319
|
+
oneditorchange: 'onEditorChange',
|
1320
|
+
oneditorerror: 'onEditorError',
|
1321
|
+
oneditorready: 'onEditorReady'
|
1322
|
+
%>
|
1323
|
+
```
|
1324
|
+
|
1325
|
+
## Gem Development 🛠
|
1326
|
+
|
1327
|
+
If you want to contribute to the gem, you can clone the repository and run the following commands:
|
1328
|
+
|
1329
|
+
```sh
|
1330
|
+
gem install bundler -v 2.5.22
|
1331
|
+
bundle install
|
1332
|
+
bundle exec guard
|
1318
1333
|
```
|
1319
1334
|
|
1320
1335
|
## Trademarks 📜
|
@@ -43,7 +43,7 @@ module CKEditor5::Rails::Assets
|
|
43
43
|
|
44
44
|
def window_scripts_tags
|
45
45
|
@window_scripts_tags ||= safe_join(bundle.scripts.filter_map do |script|
|
46
|
-
tag.script(src: script.url, nonce: true,
|
46
|
+
tag.script(src: script.url, nonce: true, crossorigin: 'anonymous') if script.window?
|
47
47
|
end)
|
48
48
|
end
|
49
49
|
|
@@ -8,38 +8,47 @@ module CKEditor5::Rails
|
|
8
8
|
attr_reader :cdn, :version, :theme, :translations
|
9
9
|
|
10
10
|
def initialize(version, theme: :lark, cdn: Engine.default_preset.cdn, translations: [])
|
11
|
-
raise ArgumentError, 'version must be semver' unless version.is_a?(Semver)
|
12
|
-
raise ArgumentError, 'theme must be a string' unless theme.is_a?(String)
|
13
|
-
raise ArgumentError, 'translations must be an array' unless translations.is_a?(Array)
|
14
|
-
|
15
11
|
super()
|
16
12
|
|
17
13
|
@cdn = cdn
|
18
14
|
@version = version
|
19
15
|
@theme = theme
|
20
16
|
@translations = translations
|
17
|
+
|
18
|
+
validate!
|
21
19
|
end
|
22
20
|
|
23
21
|
def scripts
|
24
22
|
@scripts ||= [
|
25
23
|
Assets::JSExportsMeta.new(
|
26
|
-
create_cdn_url('ckbox', 'ckbox.js'
|
27
|
-
*translations_js_exports_meta
|
24
|
+
create_cdn_url('ckbox', version, 'ckbox.js'),
|
25
|
+
*translations_js_exports_meta,
|
26
|
+
window_name: 'CKBox'
|
28
27
|
)
|
29
28
|
]
|
30
29
|
end
|
31
30
|
|
32
31
|
def stylesheets
|
33
32
|
@stylesheets ||= [
|
34
|
-
create_cdn_url('ckbox', "styles/themes/#{theme}.css"
|
33
|
+
create_cdn_url('ckbox', version, "styles/themes/#{theme}.css")
|
35
34
|
]
|
36
35
|
end
|
37
36
|
|
38
37
|
private
|
39
38
|
|
39
|
+
def validate!
|
40
|
+
raise ArgumentError, 'version must be semver' unless version.is_a?(Semver)
|
41
|
+
raise ArgumentError, 'translations must be an array' unless translations.is_a?(Array)
|
42
|
+
|
43
|
+
return if theme.is_a?(String) || theme.is_a?(Symbol)
|
44
|
+
|
45
|
+
raise ArgumentError,
|
46
|
+
'theme must be a string or symbol'
|
47
|
+
end
|
48
|
+
|
40
49
|
def translations_js_exports_meta
|
41
50
|
translations.map do |lang|
|
42
|
-
url = create_cdn_url('ckbox', "translations/#{lang}.js"
|
51
|
+
url = create_cdn_url('ckbox', version, "translations/#{lang}.js")
|
43
52
|
|
44
53
|
Assets::JSExportsMeta.new(url, window_name: 'CKBOX_TRANSLATIONS', translation: true)
|
45
54
|
end
|
@@ -20,9 +20,11 @@ module CKEditor5::Rails::Cdn
|
|
20
20
|
|
21
21
|
CDN_COMMERCIAL_GENERATORS = {
|
22
22
|
cloud: lambda { |bundle, version, path|
|
23
|
-
|
23
|
+
"https://cdn.ckeditor.com/#{bundle}/#{version}/#{path}"
|
24
|
+
},
|
24
25
|
|
25
|
-
|
26
|
+
ckbox: lambda { |bundle, version, path|
|
27
|
+
"https://cdn.ckbox.io/#{bundle}/#{version}/#{path}"
|
26
28
|
}
|
27
29
|
}.freeze
|
28
30
|
|
@@ -31,11 +33,11 @@ module CKEditor5::Rails::Cdn
|
|
31
33
|
end
|
32
34
|
|
33
35
|
def create_cdn_url(bundle, version, path)
|
34
|
-
|
36
|
+
executor = CDN_THIRD_PARTY_GENERATORS[cdn] || CDN_COMMERCIAL_GENERATORS[cdn] || cdn
|
35
37
|
|
36
|
-
raise ArgumentError, "Unknown provider: #{cdn}"
|
38
|
+
raise ArgumentError, "Unknown provider: #{cdn}" if executor.blank? || !executor.respond_to?(:call)
|
37
39
|
|
38
|
-
|
40
|
+
executor.call(bundle, version, path)
|
39
41
|
end
|
40
42
|
end
|
41
43
|
end
|
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.11.1
|
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: 2024-11-
|
12
|
+
date: 2024-11-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|