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 +4 -4
- data/README.md +15 -14
- data/lib/ckeditor5/rails/presets/preset_builder.rb +26 -1
- data/lib/ckeditor5/rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2d481ae5f7ed4d671e8d6ade94e9efa0ab5d0b4bba36f24b8052d84eadd21e9
|
4
|
+
data.tar.gz: 3d8ff1d8a23aadc4398e2439996d9a86aa792eec16e33a70837e731e68f6ba9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|