ckeditor5 1.24.4 → 1.24.6

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: cca06dbc54bf1070cfebfd54b85ea203ada266e4316e65f3c1862f9897728b06
4
- data.tar.gz: 142ea208fe9629f060e44c641f15a0b5f6f3bdebaae11756e3dd3389cc5785d1
3
+ metadata.gz: cb9b907f6916267eea9ff0259ba18545d3c41b9bf0b655466292a55f55390db0
4
+ data.tar.gz: f6523d9c201d5dc7abd649890fcb289d920e1db564fb70fc9e283320405b20c5
5
5
  SHA512:
6
- metadata.gz: 47a5040ef3c012676d0c2fb4ded7798ccb1d9f6a0a59ac399b6d8584ed0b07041cbce13b8fefbca040d64eedde569a3cc899ad70d9fdb8aa7295e5a36dcf733f
7
- data.tar.gz: 394210568ca3100e7c0af2e14565b923348b0fce2918c1bb02d01ae3840b3c8fe7b9c82c1c805bbbb320fa9fa50c2767436458de2a03fe61c5293648cbf180b3
6
+ metadata.gz: 8dc490ea35504b217dd74f38d000ba835765c1e281c9c72117c3521e4adf5c6180dcd1e6ed87bda67e358a6f6e0a57f6781bb7f4a64b9bbfc12d955b5cfd18f5
7
+ data.tar.gz: f517ef5558c2789ccb011a0e8427424bf8d4d28fd3d9fd4be7ea3f34bafe46596261b941a80b28a85a316bc419c17778bfc42dc2410022ce0680edbfd197334d
@@ -78,7 +78,15 @@ function loadAsyncImports(imports = []) {
78
78
  return imported;
79
79
  };
80
80
 
81
- return Promise.all(imports.map(loadExternalPlugin));
81
+ function uncompressImport(pkg) {
82
+ if (typeof pkg === 'string') {
83
+ return loadExternalPlugin({ import_name: 'ckeditor5', import_as: pkg });
84
+ }
85
+
86
+ return loadExternalPlugin(pkg);
87
+ }
88
+
89
+ return Promise.all(imports.map(uncompressImport));
82
90
  }
83
91
 
84
92
  /**
@@ -26,10 +26,7 @@ module CKEditor5::Rails::Editor
26
26
  end
27
27
 
28
28
  def to_h
29
- @js_import_meta.to_h.merge(
30
- type: :external,
31
- stylesheets: @stylesheets
32
- )
29
+ @js_import_meta.to_h.merge(stylesheets: @stylesheets)
33
30
  end
34
31
  end
35
32
  end
@@ -20,7 +20,6 @@ module CKEditor5::Rails::Editor
20
20
 
21
21
  def to_h
22
22
  {
23
- type: :external,
24
23
  window_name: name
25
24
  }
26
25
  end
@@ -19,8 +19,13 @@ module CKEditor5::Rails::Editor
19
19
  )
20
20
  end
21
21
 
22
+ # Compress a little bit default plugins to make output smaller
22
23
  def to_h
23
- @js_import_meta.to_h.merge(type: :external)
24
+ if @js_import_meta.import_name == 'ckeditor5'
25
+ @js_import_meta.import_as.to_s
26
+ else
27
+ @js_import_meta.to_h
28
+ end
24
29
  end
25
30
  end
26
31
  end
@@ -82,6 +82,7 @@ module CKEditor5::Rails::Plugins
82
82
 
83
83
  def initialize
84
84
  super(:SimpleUploadAdapter, PLUGIN_CODE)
85
+ compress!
85
86
  end
86
87
  end
87
88
  end
@@ -69,6 +69,7 @@ module CKEditor5::Rails::Plugins
69
69
 
70
70
  def initialize
71
71
  super(:WProofreaderSync, PLUGIN_CODE)
72
+ compress!
72
73
  end
73
74
  end
74
75
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module CKEditor5
4
4
  module Rails
5
- VERSION = '1.24.4'
5
+ VERSION = '1.24.6'
6
6
 
7
7
  DEFAULT_CKEDITOR_VERSION = '44.1.0'
8
8
  end
@@ -45,12 +45,12 @@ RSpec.describe CKEditor5::Rails::Context::PresetSerializer do
45
45
  plugins = JSON.parse(plugins_json)
46
46
 
47
47
  expect(plugins.size).to eq(2)
48
+
48
49
  expect(plugins.first).to include(
49
- 'type' => 'external',
50
50
  'import_name' => '@ckeditor/plugin1'
51
51
  )
52
+
52
53
  expect(plugins.last).to include(
53
- 'type' => 'external',
54
54
  'window_name' => 'plugin2'
55
55
  )
56
56
  end
@@ -49,7 +49,6 @@ RSpec.describe CKEditor5::Rails::Editor::PropsExternalPlugin do
49
49
  )
50
50
 
51
51
  expect(plugin.to_h).to include(
52
- type: :external,
53
52
  import_name: 'https://example.org/plugin.js',
54
53
  import_as: 'TestPlugin',
55
54
  window_name: 'TestWindow',
@@ -29,10 +29,7 @@ RSpec.describe CKEditor5::Rails::Editor::PropsInlinePlugin do
29
29
  describe '#to_h' do
30
30
  it 'returns correct hash representation' do
31
31
  plugin = described_class.new(:CustomPlugin, valid_code)
32
- expect(plugin.to_h).to eq({
33
- type: :external,
34
- window_name: :CustomPlugin
35
- })
32
+ expect(plugin.to_h).to eq({ window_name: :CustomPlugin })
36
33
  end
37
34
  end
38
35
  end
@@ -4,19 +4,14 @@ require 'spec_helper'
4
4
 
5
5
  RSpec.describe CKEditor5::Rails::Editor::PropsPlugin do
6
6
  describe '#to_h' do
7
- it 'generates hash for standard plugin' do
7
+ it 'generates string for standard plugin' do
8
8
  plugin = described_class.new(:Bold)
9
- expect(plugin.to_h).to include(
10
- type: :external,
11
- import_name: 'ckeditor5',
12
- import_as: :Bold
13
- )
9
+ expect(plugin.to_h).to eq('Bold')
14
10
  end
15
11
 
16
12
  it 'generates hash for premium plugin' do
17
13
  plugin = described_class.new(:Bold, premium: true)
18
14
  expect(plugin.to_h).to include(
19
- type: :external,
20
15
  import_name: 'ckeditor5-premium-features',
21
16
  import_as: :Bold
22
17
  )
@@ -27,7 +22,6 @@ RSpec.describe CKEditor5::Rails::Editor::PropsPlugin do
27
22
  import_name: 'custom-module',
28
23
  window_name: 'CustomPlugin')
29
24
  expect(plugin.to_h).to include(
30
- type: :external,
31
25
  import_name: 'custom-module',
32
26
  window_name: 'CustomPlugin'
33
27
  )
@@ -22,13 +22,13 @@ RSpec.describe CKEditor5::Rails::Plugins::WProofreader do
22
22
 
23
23
  it 'returns correct hash representation' do
24
24
  expected_hash = {
25
- type: :external,
26
25
  stylesheets: ["#{default_cdn}@#{default_version}/dist/browser/index.css"],
27
26
  translation: false,
28
27
  url: "#{default_cdn}@#{default_version}/dist/browser/index.js",
29
28
  import_name: "#{default_cdn}@#{default_version}/dist/browser/index.js",
30
29
  import_as: 'WProofreader'
31
30
  }
31
+
32
32
  expect(plugin.to_h).to eq(expected_hash)
33
33
  end
34
34
  end
@@ -46,13 +46,13 @@ RSpec.describe CKEditor5::Rails::Plugins::WProofreader do
46
46
 
47
47
  it 'returns correct hash representation with custom CDN' do
48
48
  expected_hash = {
49
- type: :external,
50
49
  stylesheets: ["#{custom_cdn}@#{custom_version}/dist/browser/index.css"],
51
50
  translation: false,
52
51
  url: "#{custom_cdn}@#{custom_version}/dist/browser/index.js",
53
52
  import_name: "#{custom_cdn}@#{custom_version}/dist/browser/index.js",
54
53
  import_as: 'WProofreader'
55
54
  }
55
+
56
56
  expect(plugin.to_h).to eq(expected_hash)
57
57
  end
58
58
  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.24.4
4
+ version: 1.24.6
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-12-21 00:00:00.000000000 Z
12
+ date: 2024-12-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails