ckeditor5 1.24.9 → 1.24.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -1
- data/lib/ckeditor5/rails/editor/props_plugin.rb +13 -9
- data/lib/ckeditor5/rails/version.rb +1 -1
- data/spec/e2e/features/editor_types_spec.rb +9 -0
- 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: bbaa06c0cde62bfe01904bb70ca7c8e0f4db04610d2f71543d1fbd657182e781
|
4
|
+
data.tar.gz: 36ac98e55c8d927fc094cac0b60dd23284a0667ca0d3387b0858d980bc0f33bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 525255ffbc1aadedfe42eea761822f123f3f4de0617e19a443dcb3051d95841ced3f3fda0c8d73241094c84c4e6eac410f26b33ea9ebd1271d9ddd15ab52bcf3
|
7
|
+
data.tar.gz: 85f17299ba06f3187f7211eb345e93c4d5e7efbd6c2772fb855df883c7af732fd61ce8f32c788899fba3012fcb90770627c33b52182a280b70329a88f8361ce6
|
data/README.md
CHANGED
@@ -794,6 +794,23 @@ CKEditor5::Rails.configure do
|
|
794
794
|
plugin :YourPlugin, window_name: 'YourPlugin'
|
795
795
|
end
|
796
796
|
```
|
797
|
+
|
798
|
+
If there is no `window.YourPlugin` object, the plugin will dispatch window event to load. To handle this event, you can use the `window.addEventListener` method:
|
799
|
+
|
800
|
+
```js
|
801
|
+
window.addEventListener('ckeditor:request-cjs-plugin:YourPlugin', () => {
|
802
|
+
window.YourPlugin = (async () => {
|
803
|
+
const { Plugin } = await import('ckeditor5');
|
804
|
+
|
805
|
+
return class YourPlugin extends Plugin {
|
806
|
+
// Your plugin code
|
807
|
+
};
|
808
|
+
})();
|
809
|
+
});
|
810
|
+
```
|
811
|
+
|
812
|
+
⚠️ The event handler must be attached before the plugin is requested. If the plugin is requested before the event handler is attached, the plugin will not be loaded.
|
813
|
+
|
797
814
|
</details>
|
798
815
|
|
799
816
|
#### `plugins(*names, **kwargs)` method
|
@@ -1865,7 +1882,7 @@ end
|
|
1865
1882
|
|
1866
1883
|
```js
|
1867
1884
|
// app/javascript/custom_plugins/highlight.js
|
1868
|
-
|
1885
|
+
const { Plugin, Command, ButtonView } = await import('ckeditor5');
|
1869
1886
|
|
1870
1887
|
return class MyCustomPlugin extends Plugin {
|
1871
1888
|
static get pluginName() {
|
@@ -7,16 +7,20 @@ module CKEditor5::Rails::Editor
|
|
7
7
|
def initialize(name, premium: false, **js_import_meta_attrs)
|
8
8
|
super(name)
|
9
9
|
|
10
|
-
js_import_meta_attrs[:
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
if js_import_meta_attrs[:window_name]
|
11
|
+
@js_import_meta = ::CKEditor5::Rails::Assets::JSImportMeta.new(**js_import_meta_attrs)
|
12
|
+
else
|
13
|
+
js_import_meta_attrs[:import_name] ||= if premium
|
14
|
+
'ckeditor5-premium-features'
|
15
|
+
else
|
16
|
+
'ckeditor5'
|
17
|
+
end
|
15
18
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
19
|
+
@js_import_meta = ::CKEditor5::Rails::Assets::JSImportMeta.new(
|
20
|
+
import_as: name,
|
21
|
+
**js_import_meta_attrs
|
22
|
+
)
|
23
|
+
end
|
20
24
|
end
|
21
25
|
|
22
26
|
# Compress a little bit default plugins to make output smaller
|
@@ -96,6 +96,15 @@ RSpec.describe 'CKEditor5 Types Integration', type: :feature, js: true do
|
|
96
96
|
expect(plugin_exists).to be true
|
97
97
|
end
|
98
98
|
end
|
99
|
+
|
100
|
+
it 'initializes the window plugin' do
|
101
|
+
visit 'classic'
|
102
|
+
|
103
|
+
eventually do
|
104
|
+
plugin_exists = page.evaluate_script('window.__customWindowPlugin !== undefined')
|
105
|
+
expect(plugin_exists).to be true
|
106
|
+
end
|
107
|
+
end
|
99
108
|
end
|
100
109
|
|
101
110
|
describe 'Decoupled Editor' do
|
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.24.
|
4
|
+
version: 1.24.10
|
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-01-
|
12
|
+
date: 2025-01-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|