ckeditor5 1.14.0 → 1.14.1

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: 6b4d6c95733dd5744553bb787f20f9efaf474086c6268d6842561905747ec10f
4
- data.tar.gz: 17052fae7a4e0e88fcc7c0af8ab397c8fadb3421ce611c64a10fe597d15a9d82
3
+ metadata.gz: a2d481ae5f7ed4d671e8d6ade94e9efa0ab5d0b4bba36f24b8052d84eadd21e9
4
+ data.tar.gz: 3d8ff1d8a23aadc4398e2439996d9a86aa792eec16e33a70837e731e68f6ba9f
5
5
  SHA512:
6
- metadata.gz: 4dbaefb77863ceaeaad0805d430c86b90c7fbec675a7478fc55994a9706bfc3b8ec59c7791ce916389346da508f47a88ce2ff8c38a79d1c9189aa77405769f9f
7
- data.tar.gz: 6b1d599bbfe28b35c81d037b052085c15fe55c1248f8e858efc77b7515c88b5ea2818187082f0db7810192b7d2cdfd3bb45d3dba57f7cf03cd0f53932dfbb202
6
+ metadata.gz: a407f380c8f2295959533cd08966aace68f1d9d20208608a16269921ae167ba450e719663d918ff725ee10f0be6d020c2130d50873b51cc726b00bf4fa55b573
7
+ data.tar.gz: 37f51f50d80ce4e51aeed85188b7bf48963723b0b1cf004bc6faceb5ec561c85c79d00887ca50ce4fe2ed702468677718b35c7cdaceb7af9db10fed5ce088381
data/README.md CHANGED
@@ -62,10 +62,25 @@ In your view:
62
62
 
63
63
  Voilà! You have CKEditor 5 integrated with your Rails application. 🎉
64
64
 
65
+ ## Demos 🚀
66
+
67
+ Interested in more advanced configuration? Visit the demos in the [demo application](https://github.com/Mati365/ckeditor5-rails/tree/main/sandbox/app/views/demos) or take a look at official CKEditor 5 [examples](https://ckeditor.com/docs/ckeditor5/latest/examples/builds/classic-editor.html).
68
+
69
+ In order to run all demos locally, you can clone the repository and run the following commands:
70
+
71
+ ```bash
72
+ bundle install
73
+ cd sandbox
74
+ bundle exec rails server -p 3000
75
+ ```
76
+
77
+ Then visit [http://localhost:3000/demos](http://localhost:3000/) to see the demos in action. 🚀
78
+
65
79
  ## Table of Contents 📚
66
80
 
67
81
  - [CKEditor 5 Rails Integration ✨](#ckeditor-5-rails-integration-)
68
82
  - [Installation 🛠️](#installation-️)
83
+ - [Demos 🚀](#demos-)
69
84
  - [Table of Contents 📚](#table-of-contents-)
70
85
  - [Presets 🎨](#presets-)
71
86
  - [Available Configuration Methods ⚙️](#available-configuration-methods-️)
@@ -590,20 +605,6 @@ CKEditor5::Rails.configure do
590
605
  end
591
606
  ```
592
607
 
593
- Remember to remove the `Base64UploadAdapter` plugin from the plugins list if you want to use the simple upload adapter. It may cause issues.
594
-
595
- ```rb
596
- # config/initializers/ckeditor5.rb
597
-
598
- CKEditor5::Rails.configure do
599
- # ... other configuration
600
-
601
- plugins do
602
- remove :Base64UploadAdapter
603
- end
604
- end
605
- ```
606
-
607
608
  ### Controller / View helpers 📦
608
609
 
609
610
  #### `ckeditor5_element_ref(selector)` method
@@ -24,6 +24,19 @@ module CKEditor5::Rails
24
24
  instance_eval(&block) if block_given?
25
25
  end
26
26
 
27
+ def initialize_copy(source)
28
+ super
29
+
30
+ @translations = source.translations.dup
31
+ @ckbox = source.ckbox.dup if source.ckbox
32
+ @config = {
33
+ plugins: source.config[:plugins].map(&:dup),
34
+ toolbar: deep_copy_toolbar(source.config[:toolbar])
35
+ }.merge(
36
+ source.config.except(:plugins, :toolbar).deep_dup
37
+ )
38
+ end
39
+
27
40
  def premium?
28
41
  @premium
29
42
  end
@@ -174,12 +187,24 @@ module CKEditor5::Rails
174
187
 
175
188
  def simple_upload_adapter(upload_url = '/uploads')
176
189
  plugins do
177
- remove :Base64UploadAdapter
190
+ remove(:Base64UploadAdapter)
178
191
  end
179
192
 
180
193
  plugin(Plugins::SimpleUploadAdapter.new)
181
194
  configure(:simpleUpload, { uploadUrl: upload_url })
182
195
  end
196
+
197
+ private
198
+
199
+ def deep_copy_toolbar(toolbar)
200
+ return toolbar.dup if toolbar.is_a?(Array)
201
+ return {} if toolbar.nil?
202
+
203
+ {
204
+ items: toolbar[:items].dup,
205
+ shouldNotGroupWhenFull: toolbar[:shouldNotGroupWhenFull]
206
+ }
207
+ end
183
208
  end
184
209
  end
185
210
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module CKEditor5
4
4
  module Rails
5
- VERSION = '1.14.0'
5
+ VERSION = '1.14.1'
6
6
  end
7
7
  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.14.0
4
+ version: 1.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mateusz Bagiński