ckeditor5 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ca43e4ca91ad0af4aab412f708f87189bf13b16604e2abb8e39b9805a03e3c6
4
- data.tar.gz: f2374481093fc8cffd6ecd25b083d3ee1dcf6bb184efb4a5f482fd5d1152828b
3
+ metadata.gz: 0babe5c17bf5e8492ad7e372a23d0c5c3bc900552d18c22f14702d1b1ef27cb4
4
+ data.tar.gz: b4a3eb8f291deb3584dcce52cd3e404c97311321b4d7ccf6767c26face6dcb37
5
5
  SHA512:
6
- metadata.gz: 26f30df68efa28155834fec3355577b6819132b787f05c87ce701bf3a15e7965ca3f42527ac5970cb226cb9ac934b9d91fa40ca2c5382fc76851038ed8d5a3e0
7
- data.tar.gz: 0b4f7a9b47578137eaa4238329797730a434ba2afba8edfda1b314fc956853ce13c0f8ec7edc79cf634ba460c4add35c3db913587dbd2ec9a7f478db82fbc9be
6
+ metadata.gz: 629844431fc4c4eedf849b65d90a05f7df0591c90a24cb44f22c80c348ae84afbaae2428902f0eb47e56bfaaaf6057365f1256a5330d62b759300159dd6c7855
7
+ data.tar.gz: fa122e9c537fd3d17eba7a9c98e39e3d24f15377a03be2cf72df07e85220e9fdbb72ee1dc8c9942ba23216e3b58334e874d2c7d334a2a21fa8ceccc4f3c7f8c9
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # CKEditor 5 Rails Integration ✨
2
2
 
3
- [![License: MIT](https://img.shields.io/badge/License-MIT-orange.svg?style=flat-square)](https://opensource.org/licenses/MIT)
3
+ [![License: GPL v2](https://img.shields.io/badge/License-GPL_v2-blue.svg?style=flat-square)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
4
4
  ![Gem Version](https://img.shields.io/gem/v/ckeditor5?style=flat-square)
5
5
  [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-green.svg?style=flat-square)](http://makeapullrequest.com)
6
6
  ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/mati365/ckeditor5-rails?style=flat-square)
@@ -25,10 +25,8 @@ In your config:
25
25
  ```rb
26
26
  # config/initializers/ckeditor5.rb
27
27
 
28
- CKEditor5::Rails.configure do |config|
29
- config.presets.override :default do
30
- version '43.3.0'
31
- end
28
+ CKEditor5::Rails.configure do
29
+ version '43.3.0'
32
30
  end
33
31
  ```
34
32
 
@@ -91,6 +89,7 @@ Voilà! You have CKEditor 5 integrated with your Rails application. 🎉
91
89
  - [Events fired by the editor 🔊](#events-fired-by-the-editor-)
92
90
  - [`editor-ready` event](#editor-ready-event)
93
91
  - [`editor-error` event](#editor-error-event)
92
+ - [Trademarks 📜](#trademarks-)
94
93
  - [License 📜](#license-)
95
94
 
96
95
  ## Presets 🎨
@@ -102,8 +101,20 @@ You can create your own by defining it in the `config/initializers/ckeditor5.rb`
102
101
  ```rb
103
102
  # config/initializers/ckeditor5.rb
104
103
 
105
- CKEditor5::Rails.configure do |config|
106
- config.presets.define :custom
104
+ CKEditor5::Rails.configure do
105
+ # It's possible to override the default preset right in the initializer.
106
+ version '43.3.0'
107
+
108
+ # New presets inherit properties from the default preset defined in the initializer.
109
+ # In this example, the custom preset inherits everything from default but disables the menubar:
110
+ presets.define :inherited_custom
111
+ menubar visible: false
112
+ end
113
+
114
+ # In order to define preset from scratch, you can use the `inherit: false` option.
115
+ presets.define :blank_preset, inherit: false do
116
+ version '44.0.0'
117
+
107
118
  gpl
108
119
  type :classic
109
120
 
@@ -135,13 +146,11 @@ In order to override existing presets, you can use the `config.presets.override`
135
146
  ```rb
136
147
  # config/initializers/ckeditor5.rb
137
148
 
138
- CKEditor5::Rails.configure do |config|
139
- config.presets.override :default do
140
- menubar visible: false
149
+ CKEditor5::Rails.configure do
150
+ menubar visible: false
141
151
 
142
- toolbar do
143
- remove :underline, :heading
144
- end
152
+ toolbar do
153
+ remove :underline, :heading
145
154
  end
146
155
  end
147
156
  ```
@@ -539,9 +548,8 @@ Set the version in the `config/initializers/ckeditor5.rb` file:
539
548
  # config/initializers/ckeditor5.rb
540
549
 
541
550
  CKEditor5::Rails.configure do
542
- presets.override :default do
543
- version '43.3.0'
544
- end
551
+ gpl
552
+ version '43.3.0'
545
553
  end
546
554
  ```
547
555
 
@@ -581,9 +589,7 @@ Keep in mind, that you need to include the translations in the `config/initializ
581
589
  # config/initializers/ckeditor5.rb
582
590
 
583
591
  CKEditor5::Rails.configure do
584
- presets.override :default do
585
- language :pl
586
- end
592
+ language :pl
587
593
  end
588
594
  ```
589
595
 
@@ -1073,6 +1079,14 @@ document.getElementById('editor').addEventListener('editor-error', () => {
1073
1079
  });
1074
1080
  ```
1075
1081
 
1082
+ ## Trademarks 📜
1083
+
1084
+ CKEditor® is a trademark of [CKSource Holding sp. z o.o.](https://cksource.com/) All rights reserved. For more information about the license of CKEditor® please visit [CKEditor's licensing page](https://ckeditor.com/legal/ckeditor-oss-license/).
1085
+
1086
+ This gem is not owned by CKSource and does not use the CKEditor® trademark for commercial purposes. It should not be associated with or considered an official CKSource product.
1087
+
1076
1088
  ## License 📜
1077
1089
 
1078
1090
  This project is licensed under the terms of the [GNU General Public License v2.0](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html). See the [LICENSE](LICENSE) file for details.
1091
+
1092
+ This project uses CKEditor 5 which is licensed under the terms of [GNU General Public License Version 2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html). For more information about CKEditor 5 licensing, please see their [official documentation](https://ckeditor.com/legal/ckeditor-oss-license/).
@@ -33,8 +33,25 @@ module CKEditor5::Rails
33
33
  config.ckeditor5.presets.default
34
34
  end
35
35
 
36
- def configure
37
- yield config.ckeditor5
36
+ def configure(&block)
37
+ proxy = ConfigurationProxy.new(config.ckeditor5)
38
+ proxy.instance_eval(&block)
39
+ end
40
+ end
41
+
42
+ class ConfigurationProxy
43
+ delegate :presets, to: :@configuration
44
+
45
+ delegate :version, :gpl, :premium, :cdn, :translations, :license_key,
46
+ :type, :menubar, :toolbar, :plugins, :plugin, :inline_plugin,
47
+ :language, :ckbox, :configure, to: :default_preset
48
+
49
+ def initialize(configuration)
50
+ @configuration = configuration
51
+ end
52
+
53
+ def default_preset
54
+ presets.default
38
55
  end
39
56
  end
40
57
  end
@@ -12,8 +12,13 @@ module CKEditor5::Rails::Presets
12
12
  define_default_preset
13
13
  end
14
14
 
15
- def define(name, &block)
16
- preset = PresetBuilder.new
15
+ def define(name, inherit: true, &block)
16
+ preset = if inherit && default.present?
17
+ default.clone
18
+ else
19
+ PresetBuilder.new
20
+ end
21
+
17
22
  preset.instance_eval(&block)
18
23
  @presets[name] = preset
19
24
  end
@@ -22,12 +27,14 @@ module CKEditor5::Rails::Presets
22
27
  @presets[name].instance_eval(&block)
23
28
  end
24
29
 
30
+ alias extend override
31
+
25
32
  def default
26
- @presets[:default] || {}
33
+ @presets[:default]
27
34
  end
28
35
 
29
36
  def [](name)
30
- @presets[name] || {}
37
+ @presets[name]
31
38
  end
32
39
 
33
40
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CKEditor5::Rails
4
- VERSION = '1.4.0'
4
+ VERSION = '1.5.0'
5
5
  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.0
4
+ version: 1.5.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: 2024-11-03 00:00:00.000000000 Z
12
+ date: 2024-11-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails