ckeditor5 1.25.0 → 1.26.0
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 +91 -3
- data/lib/ckeditor5/rails/editor/helpers.rb +1 -0
- data/lib/ckeditor5/rails/editor/props_patch_plugin.rb +38 -0
- data/lib/ckeditor5/rails/engine.rb +1 -3
- data/lib/ckeditor5/rails/plugins/patches/fix_color_picker_race_condition.rb +51 -0
- data/lib/ckeditor5/rails/plugins/wproofreader.rb +0 -1
- data/lib/ckeditor5/rails/plugins.rb +14 -0
- data/lib/ckeditor5/rails/presets/concerns/plugin_methods.rb +18 -0
- data/lib/ckeditor5/rails/presets/preset_builder.rb +16 -3
- data/lib/ckeditor5/rails/version.rb +1 -1
- data/spec/lib/ckeditor5/rails/cdn/helpers_spec.rb +2 -2
- data/spec/lib/ckeditor5/rails/editor/props_patch_plugin_spec.rb +71 -0
- data/spec/lib/ckeditor5/rails/presets/manager_spec.rb +2 -2
- data/spec/lib/ckeditor5/rails/presets/preset_builder_spec.rb +66 -0
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae47ab2c50827fd1a0716bc093475ce4e55a237ad3a9f4c35ba0b66d8ea46f7c
|
4
|
+
data.tar.gz: 13e648a1a348203b84f7220b7160c9d98e25753a97a207e4c5260d8d4d598571
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c311294593a9de01ba525eab43d6dbf0418f454e6c7754a8c2a607464539ca82ed39f61a66d58f5c3a977f89a39c591adfb60b63711c47f3c2657e6c3442c49e
|
7
|
+
data.tar.gz: 64f021c1316971588676e9819d422b09d83bea982d74e94544ccbcc703ffb381778dc08aa308620559701a030d88423c20b5b3a678abfc1854daebb33f9fccc1
|
data/README.md
CHANGED
@@ -119,8 +119,7 @@ For extending CKEditor's functionality, refer to the [plugins directory](https:/
|
|
119
119
|
- [Automatic upgrades 🔄](#automatic-upgrades-)
|
120
120
|
- [Available Configuration Methods ⚙️](#available-configuration-methods-️)
|
121
121
|
- [`cdn(cdn = nil, &block)` method](#cdncdn--nil-block-method)
|
122
|
-
- [`version(version)` method](#versionversion-method)
|
123
|
-
- [`automatic_upgrades(enabled: true)` method](#automatic_upgradesenabled-true-method)
|
122
|
+
- [`version(version, apply_patches: true)` method](#versionversion-apply_patches-true-method)
|
124
123
|
- [`gpl` method](#gpl-method)
|
125
124
|
- [`license_key(key)` method](#license_keykey-method)
|
126
125
|
- [`premium` method](#premium-method)
|
@@ -138,6 +137,8 @@ For extending CKEditor's functionality, refer to the [plugins directory](https:/
|
|
138
137
|
- [`plugins(*names, **kwargs)` method](#pluginsnames-kwargs-method)
|
139
138
|
- [`inline_plugin(name, code)` method](#inline_pluginname-code-method)
|
140
139
|
- [`external_plugin(name, script:, import_as: nil, window_name: nil, stylesheets: [])` method](#external_pluginname-script-import_as-nil-window_name-nil-stylesheets--method)
|
140
|
+
- [`patch_plugin(plugin)`](#patch_pluginplugin)
|
141
|
+
- [`apply_integration_patches` method](#apply_integration_patches-method)
|
141
142
|
- [`simple_upload_adapter(url)` method](#simple_upload_adapterurl-method)
|
142
143
|
- [`special_characters(&block)` method](#special_charactersblock-method)
|
143
144
|
- [`wproofreader(version: nil, cdn: nil, **config)` method](#wproofreaderversion-nil-cdn-nil-config-method)
|
@@ -317,7 +318,7 @@ end
|
|
317
318
|
```
|
318
319
|
</details>
|
319
320
|
|
320
|
-
#### `version(version)` method
|
321
|
+
#### `version(version, apply_patches: true)` method
|
321
322
|
|
322
323
|
<details>
|
323
324
|
<summary>Set up the version of CKEditor 5 to be used by the integration</summary>
|
@@ -335,6 +336,23 @@ CKEditor5::Rails.configure do
|
|
335
336
|
version '44.1.0'
|
336
337
|
end
|
337
338
|
```
|
339
|
+
|
340
|
+
In order to disable default patches, you can pass the `apply_patches: false` keyword argument to the `version` method.
|
341
|
+
|
342
|
+
```rb
|
343
|
+
# config/initializers/ckeditor5.rb
|
344
|
+
|
345
|
+
CKEditor5::Rails.configure do
|
346
|
+
# ... other configuration
|
347
|
+
|
348
|
+
version '44.1.0', apply_patches: false
|
349
|
+
end
|
350
|
+
```
|
351
|
+
|
352
|
+
The patches are defined in the `lib/ckeditor5/rails/plugins/patches` directory. If you want to apply custom patches, you can use the `patch_plugin` method.
|
353
|
+
|
354
|
+
```rb
|
355
|
+
|
338
356
|
</details>
|
339
357
|
|
340
358
|
#### `automatic_upgrades(enabled: true)` method
|
@@ -979,6 +997,76 @@ end
|
|
979
997
|
|
980
998
|
</details>
|
981
999
|
|
1000
|
+
#### `patch_plugin(plugin)`
|
1001
|
+
|
1002
|
+
<details>
|
1003
|
+
<summary>Appends plugin that applies patch to the specific versions of CKEditor 5</summary>
|
1004
|
+
|
1005
|
+
<br />
|
1006
|
+
|
1007
|
+
Defines a plugin that applies a patch to the specific versions of CKEditor 5. The example below shows how to define a plugin that applies a patch to the `44.1.0` version:
|
1008
|
+
|
1009
|
+
```rb
|
1010
|
+
# config/initializers/ckeditor5.rb
|
1011
|
+
|
1012
|
+
CKEditor5::Rails.configure do
|
1013
|
+
# ... other configuration
|
1014
|
+
|
1015
|
+
patch_plugin MyPatchPlugin.new
|
1016
|
+
end
|
1017
|
+
```
|
1018
|
+
|
1019
|
+
where the `MyPatchPlugin` should inherit from `KEditor5::Rails::Editor::PropsPatchPlugin` and implement the `initialize` method. For example:
|
1020
|
+
|
1021
|
+
```rb
|
1022
|
+
class YourPatch < CKEditor5::Rails::Editor::PropsPatchPlugin
|
1023
|
+
PLUGIN_CODE = <<~JS
|
1024
|
+
const { Plugin, ColorPickerView, debounce } = await import( 'ckeditor5' );
|
1025
|
+
|
1026
|
+
return class YourPatch extends Plugin {
|
1027
|
+
static get pluginName() {
|
1028
|
+
return 'YourPatch';
|
1029
|
+
}
|
1030
|
+
|
1031
|
+
constructor(editor) {
|
1032
|
+
super(editor);
|
1033
|
+
|
1034
|
+
// ... your patch
|
1035
|
+
}
|
1036
|
+
}
|
1037
|
+
JS
|
1038
|
+
|
1039
|
+
def initialize
|
1040
|
+
super(:YourPatch, PLUGIN_CODE, min_version: nil, max_version: '45.0.0')
|
1041
|
+
compress!
|
1042
|
+
end
|
1043
|
+
end
|
1044
|
+
```
|
1045
|
+
</details>
|
1046
|
+
|
1047
|
+
#### `apply_integration_patches` method
|
1048
|
+
|
1049
|
+
<details>
|
1050
|
+
<summary>Apply patches to the specific versions of CKEditor 5</summary>
|
1051
|
+
|
1052
|
+
<br />
|
1053
|
+
|
1054
|
+
Defines a method that applies patches to the specific versions of CKEditor 5. The example below shows how to apply patches to the `44.1.0` version:
|
1055
|
+
|
1056
|
+
```rb
|
1057
|
+
# config/initializers/ckeditor5.rb
|
1058
|
+
|
1059
|
+
CKEditor5::Rails.configure do
|
1060
|
+
# ... other configuration
|
1061
|
+
|
1062
|
+
apply_integration_patches
|
1063
|
+
end
|
1064
|
+
```
|
1065
|
+
|
1066
|
+
It's useful when you want to apply patches to the specific versions of CKEditor 5. The patches are defined in the `lib/ckeditor5/rails/plugins/patches` directory.
|
1067
|
+
|
1068
|
+
</details>
|
1069
|
+
|
982
1070
|
#### `simple_upload_adapter(url)` method
|
983
1071
|
|
984
1072
|
<details>
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../semver'
|
4
|
+
require_relative 'props_inline_plugin'
|
5
|
+
|
6
|
+
module CKEditor5::Rails::Editor
|
7
|
+
class PropsPatchPlugin < PropsInlinePlugin
|
8
|
+
attr_reader :min_version, :max_version
|
9
|
+
|
10
|
+
def initialize(name, code, min_version: nil, max_version: nil)
|
11
|
+
super(name, code)
|
12
|
+
|
13
|
+
@min_version = min_version && CKEditor5::Rails::Semver.new(min_version)
|
14
|
+
@max_version = max_version && CKEditor5::Rails::Semver.new(max_version)
|
15
|
+
|
16
|
+
compress!
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.applicable_for_version?(editor_version, min_version: nil, max_version: nil)
|
20
|
+
return true if min_version.nil? && max_version.nil?
|
21
|
+
|
22
|
+
current_version = CKEditor5::Rails::Semver.new(editor_version)
|
23
|
+
|
24
|
+
min_check = min_version.nil? || current_version >= CKEditor5::Rails::Semver.new(min_version)
|
25
|
+
max_check = max_version.nil? || current_version <= CKEditor5::Rails::Semver.new(max_version)
|
26
|
+
|
27
|
+
min_check && max_check
|
28
|
+
end
|
29
|
+
|
30
|
+
def applicable_for_version?(editor_version)
|
31
|
+
self.class.applicable_for_version?(
|
32
|
+
editor_version,
|
33
|
+
min_version: @min_version&.to_s,
|
34
|
+
max_version: @max_version&.to_s
|
35
|
+
)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -3,9 +3,7 @@
|
|
3
3
|
require 'rails/engine'
|
4
4
|
|
5
5
|
require_relative 'presets/manager'
|
6
|
-
require_relative 'plugins
|
7
|
-
require_relative 'plugins/wproofreader'
|
8
|
-
require_relative 'plugins/special_characters_bootstrap'
|
6
|
+
require_relative 'plugins'
|
9
7
|
|
10
8
|
module CKEditor5::Rails
|
11
9
|
class PresetNotFoundError < ArgumentError; end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../editor/props_patch_plugin'
|
4
|
+
|
5
|
+
module CKEditor5::Rails::Plugins::Patches
|
6
|
+
# Fixes focus management issues in the CKEditor5 color picker component
|
7
|
+
# by ensuring proper focus handling when the color picker is opened.
|
8
|
+
#
|
9
|
+
# The patch modifies the ColorPickerView's focus behavior to properly
|
10
|
+
# focus either the hex input field (when visible) or the first slider.
|
11
|
+
#
|
12
|
+
# @see https://github.com/ckeditor/ckeditor5/issues/17069
|
13
|
+
class FixColorPickerRaceCondition < CKEditor5::Rails::Editor::PropsPatchPlugin
|
14
|
+
PLUGIN_CODE = <<~JS
|
15
|
+
const { Plugin, ColorPickerView, debounce } = await import( 'ckeditor5' );
|
16
|
+
|
17
|
+
return class FixColorPickerRaceCondition extends Plugin {
|
18
|
+
static get pluginName() {
|
19
|
+
return 'FixColorPickerRaceCondition';
|
20
|
+
}
|
21
|
+
|
22
|
+
constructor(editor) {
|
23
|
+
super(editor);
|
24
|
+
this.editor = editor;
|
25
|
+
this.#applyPatch();
|
26
|
+
}
|
27
|
+
|
28
|
+
#applyPatch() {
|
29
|
+
const { focus } = ColorPickerView.prototype;
|
30
|
+
|
31
|
+
ColorPickerView.prototype.focus = function() {
|
32
|
+
try {
|
33
|
+
if (!this._config.hideInput) {
|
34
|
+
this.hexInputRow.children.get( 1 ).focus();
|
35
|
+
}
|
36
|
+
|
37
|
+
this.slidersView.first.focus();
|
38
|
+
} catch (error) {
|
39
|
+
focus.apply(this, arguments);
|
40
|
+
}
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
44
|
+
JS
|
45
|
+
|
46
|
+
def initialize
|
47
|
+
super(:FixColorPickerRaceCondition, PLUGIN_CODE)
|
48
|
+
compress!
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CKEditor5::Rails::Plugins
|
4
|
+
module Patches
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
8
|
+
# Core plugins
|
9
|
+
require_relative 'plugins/simple_upload_adapter'
|
10
|
+
require_relative 'plugins/wproofreader'
|
11
|
+
require_relative 'plugins/special_characters_bootstrap'
|
12
|
+
|
13
|
+
# Plugin patches and fixes
|
14
|
+
require_relative 'plugins/patches/fix_color_picker_race_condition'
|
@@ -12,6 +12,7 @@ module CKEditor5::Rails
|
|
12
12
|
class DisallowedInlinePluginError < ArgumentError; end
|
13
13
|
class MissingInlinePluginError < StandardError; end
|
14
14
|
class UnsupportedESModuleError < StandardError; end
|
15
|
+
class InvalidPatchPluginError < ArgumentError; end
|
15
16
|
|
16
17
|
included do
|
17
18
|
attr_reader :disallow_inline_plugins, :disallow_inline_plugin_compression
|
@@ -67,6 +68,23 @@ module CKEditor5::Rails
|
|
67
68
|
register_plugin(plugin)
|
68
69
|
end
|
69
70
|
|
71
|
+
# Registers a patch plugin that modifies CKEditor behavior for specific versions
|
72
|
+
#
|
73
|
+
# @param plugin [Editor::PropsPatchPlugin] Patch plugin instance to register
|
74
|
+
# @raise [InvalidPatchPluginError] When provided plugin is not a PropsPatchPlugin
|
75
|
+
# @return [Editor::PropsPatchPlugin, nil] Returns plugin if registered, nil if not applicable
|
76
|
+
# @example Apply patch for specific CKEditor versions
|
77
|
+
# patch_plugin PropsPatchPlugin.new(:PatchName, code, min_version: '35.0.0', max_version: '36.0.0')
|
78
|
+
def patch_plugin(plugin)
|
79
|
+
unless plugin.is_a?(Editor::PropsPatchPlugin)
|
80
|
+
raise InvalidPatchPluginError, 'Provided plugin must be a PropsPatchPlugin instance'
|
81
|
+
end
|
82
|
+
|
83
|
+
return unless plugin.applicable_for_version?(config[:version])
|
84
|
+
|
85
|
+
register_plugin(plugin)
|
86
|
+
end
|
87
|
+
|
70
88
|
# Register a single plugin by name
|
71
89
|
#
|
72
90
|
# @param name [Symbol, Editor::PropsBasePlugin] Plugin name or instance
|
@@ -172,11 +172,16 @@ module CKEditor5::Rails
|
|
172
172
|
end
|
173
173
|
|
174
174
|
# Set or get editor version
|
175
|
-
# @param version [String, nil] Editor version
|
175
|
+
# @param version [String, nil] Editor version to set
|
176
|
+
# @param apply_patches [Boolean] Whether to apply integration patches after setting version
|
176
177
|
# @example Set specific version
|
177
178
|
# version '43.3.1'
|
178
|
-
# @
|
179
|
-
|
179
|
+
# @example Set version without applying patches
|
180
|
+
# version '43.3.1', apply_patches: false
|
181
|
+
# @example Get current version
|
182
|
+
# version # => "43.3.1"
|
183
|
+
# @return [String, nil] Current version string or nil if not set
|
184
|
+
def version(version = nil, apply_patches: true)
|
180
185
|
return @version&.to_s if version.nil?
|
181
186
|
|
182
187
|
if @automatic_upgrades && version
|
@@ -185,6 +190,14 @@ module CKEditor5::Rails
|
|
185
190
|
else
|
186
191
|
@version = Semver.new(version)
|
187
192
|
end
|
193
|
+
|
194
|
+
apply_integration_patches if apply_patches
|
195
|
+
end
|
196
|
+
|
197
|
+
# Apply integration patches for the current version
|
198
|
+
# @return [void]
|
199
|
+
def apply_integration_patches
|
200
|
+
patch_plugin Plugins::Patches::FixColorPickerRaceCondition.new
|
188
201
|
end
|
189
202
|
|
190
203
|
# Enable or disable automatic version upgrades
|
@@ -20,7 +20,7 @@ RSpec.describe CKEditor5::Rails::Cdn::Helpers do
|
|
20
20
|
let(:helper) { test_class.new }
|
21
21
|
let(:preset) do
|
22
22
|
CKEditor5::Rails::Presets::PresetBuilder.new do
|
23
|
-
version '34.1.0'
|
23
|
+
version '34.1.0', apply_patches: false
|
24
24
|
type :classic
|
25
25
|
translations :pl
|
26
26
|
cdn :cloud
|
@@ -151,7 +151,7 @@ RSpec.describe CKEditor5::Rails::Cdn::Helpers do
|
|
151
151
|
context 'when overriding preset values' do
|
152
152
|
let(:preset) do
|
153
153
|
CKEditor5::Rails::Presets::PresetBuilder.new do
|
154
|
-
version '34.1.0'
|
154
|
+
version '34.1.0', apply_patches: false
|
155
155
|
type :classic
|
156
156
|
language :pl
|
157
157
|
cdn :cloud
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe CKEditor5::Rails::Editor::PropsPatchPlugin do
|
6
|
+
let(:plugin_name) { 'testPlugin' }
|
7
|
+
let(:plugin_code) { 'console.log("test");' }
|
8
|
+
|
9
|
+
describe '#initialize' do
|
10
|
+
it 'creates plugin with version constraints' do
|
11
|
+
plugin = described_class.new(plugin_name, plugin_code, min_version: '29.0.0', max_version: '30.0.0')
|
12
|
+
|
13
|
+
expect(plugin.min_version.to_s).to eq('29.0.0')
|
14
|
+
expect(plugin.max_version.to_s).to eq('30.0.0')
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'creates plugin without version constraints' do
|
18
|
+
plugin = described_class.new(plugin_name, plugin_code)
|
19
|
+
|
20
|
+
expect(plugin.min_version).to be_nil
|
21
|
+
expect(plugin.max_version).to be_nil
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
describe '.applicable_for_version?' do
|
26
|
+
it 'returns true when no version constraints' do
|
27
|
+
expect(described_class.applicable_for_version?('29.0.0')).to be true
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'returns true when version is within constraints' do
|
31
|
+
result = described_class.applicable_for_version?(
|
32
|
+
'29.1.0',
|
33
|
+
min_version: '29.0.0',
|
34
|
+
max_version: '30.0.0'
|
35
|
+
)
|
36
|
+
expect(result).to be true
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'returns false when version is too low' do
|
40
|
+
result = described_class.applicable_for_version?(
|
41
|
+
'28.9.9',
|
42
|
+
min_version: '29.0.0',
|
43
|
+
max_version: '30.0.0'
|
44
|
+
)
|
45
|
+
expect(result).to be false
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'returns false when version is too high' do
|
49
|
+
result = described_class.applicable_for_version?(
|
50
|
+
'30.0.1',
|
51
|
+
min_version: '29.0.0',
|
52
|
+
max_version: '30.0.0'
|
53
|
+
)
|
54
|
+
expect(result).to be false
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
describe '#applicable_for_version?' do
|
59
|
+
let(:plugin) do
|
60
|
+
described_class.new(plugin_name, plugin_code, min_version: '29.0.0', max_version: '30.0.0')
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'returns true for version within constraints' do
|
64
|
+
expect(plugin.applicable_for_version?('29.1.0')).to be true
|
65
|
+
end
|
66
|
+
|
67
|
+
it 'returns false for version outside constraints' do
|
68
|
+
expect(plugin.applicable_for_version?('28.9.9')).to be false
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -20,7 +20,7 @@ RSpec.describe CKEditor5::Rails::Presets::Manager do
|
|
20
20
|
it 'creates new preset based on default' do
|
21
21
|
manager.define(:custom) do
|
22
22
|
automatic_upgrades enabled: false
|
23
|
-
version '36.0.0'
|
23
|
+
version '36.0.0', apply_patches: false
|
24
24
|
end
|
25
25
|
|
26
26
|
expect(manager[:custom].version).to eq('36.0.0')
|
@@ -32,7 +32,7 @@ RSpec.describe CKEditor5::Rails::Presets::Manager do
|
|
32
32
|
it 'creates completely new preset' do
|
33
33
|
manager.define(:custom, inherit: false) do
|
34
34
|
automatic_upgrades enabled: false
|
35
|
-
version '36.0.0'
|
35
|
+
version '36.0.0', apply_patches: false
|
36
36
|
end
|
37
37
|
|
38
38
|
expect(manager[:custom].version).to eq('36.0.0')
|
@@ -593,4 +593,70 @@ RSpec.describe CKEditor5::Rails::Presets::PresetBuilder do
|
|
593
593
|
)
|
594
594
|
end
|
595
595
|
end
|
596
|
+
|
597
|
+
describe '#patch_plugin' do
|
598
|
+
let(:patch_plugin) do
|
599
|
+
CKEditor5::Rails::Editor::PropsPatchPlugin.new(
|
600
|
+
:TestPatch,
|
601
|
+
<<~JAVASCRIPT
|
602
|
+
const { Plugin } = await import('ckeditor5');
|
603
|
+
return class TestPatch extends Plugin {
|
604
|
+
init() {}
|
605
|
+
}
|
606
|
+
JAVASCRIPT
|
607
|
+
)
|
608
|
+
end
|
609
|
+
|
610
|
+
it 'raises error when plugin is not a PropsPatchPlugin' do
|
611
|
+
invalid_plugin = CKEditor5::Rails::Editor::PropsPlugin.new(:InvalidPatch)
|
612
|
+
|
613
|
+
expect { builder.patch_plugin(invalid_plugin) }
|
614
|
+
.to raise_error(
|
615
|
+
CKEditor5::Rails::Presets::Concerns::PluginMethods::InvalidPatchPluginError,
|
616
|
+
'Provided plugin must be a PropsPatchPlugin instance'
|
617
|
+
)
|
618
|
+
end
|
619
|
+
|
620
|
+
it 'applies patch when applicable' do
|
621
|
+
allow(patch_plugin).to receive(:applicable_for_version?).and_return(true)
|
622
|
+
|
623
|
+
builder.version('35.0.0', apply_patches: false)
|
624
|
+
builder.patch_plugin(patch_plugin)
|
625
|
+
|
626
|
+
plugin_names = builder.config[:plugins].map(&:name)
|
627
|
+
expect(plugin_names).to include(:TestPatch)
|
628
|
+
end
|
629
|
+
|
630
|
+
it 'skips patch when not applicable' do
|
631
|
+
allow(patch_plugin).to receive(:applicable_for_version?).and_return(false)
|
632
|
+
|
633
|
+
builder.version('35.0.0')
|
634
|
+
builder.patch_plugin(patch_plugin)
|
635
|
+
|
636
|
+
plugin_names = builder.config[:plugins].map(&:name)
|
637
|
+
expect(plugin_names).not_to include(:TestPatch)
|
638
|
+
end
|
639
|
+
|
640
|
+
it 'applies patch when version is not set' do
|
641
|
+
builder.patch_plugin(patch_plugin)
|
642
|
+
|
643
|
+
plugin_names = builder.config[:plugins].map(&:name)
|
644
|
+
expect(plugin_names).to include(:TestPatch)
|
645
|
+
end
|
646
|
+
end
|
647
|
+
|
648
|
+
describe '#apply_integration_patches' do
|
649
|
+
it 'applies known integration patches' do
|
650
|
+
builder.version('35.0.0', apply_patches: false)
|
651
|
+
expect { builder.apply_integration_patches }
|
652
|
+
.to change { builder.config[:plugins].count }
|
653
|
+
.by(1)
|
654
|
+
end
|
655
|
+
|
656
|
+
it 'apply patches when version is not set' do
|
657
|
+
expect { builder.apply_integration_patches }
|
658
|
+
.to change { builder.config[:plugins].count }
|
659
|
+
.by(1)
|
660
|
+
end
|
661
|
+
end
|
596
662
|
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
|
+
version: 1.26.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: 2025-02-
|
12
|
+
date: 2025-02-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -82,12 +82,15 @@ files:
|
|
82
82
|
- lib/ckeditor5/rails/editor/props_base_plugin.rb
|
83
83
|
- lib/ckeditor5/rails/editor/props_external_plugin.rb
|
84
84
|
- lib/ckeditor5/rails/editor/props_inline_plugin.rb
|
85
|
+
- lib/ckeditor5/rails/editor/props_patch_plugin.rb
|
85
86
|
- lib/ckeditor5/rails/editor/props_plugin.rb
|
86
87
|
- lib/ckeditor5/rails/engine.rb
|
87
88
|
- lib/ckeditor5/rails/helpers.rb
|
88
89
|
- lib/ckeditor5/rails/hooks/form.rb
|
89
90
|
- lib/ckeditor5/rails/hooks/importmap.rb
|
90
91
|
- lib/ckeditor5/rails/hooks/simple_form.rb
|
92
|
+
- lib/ckeditor5/rails/plugins.rb
|
93
|
+
- lib/ckeditor5/rails/plugins/patches/fix_color_picker_race_condition.rb
|
91
94
|
- lib/ckeditor5/rails/plugins/simple_upload_adapter.rb
|
92
95
|
- lib/ckeditor5/rails/plugins/special_characters_bootstrap.rb
|
93
96
|
- lib/ckeditor5/rails/plugins/wproofreader.rb
|
@@ -125,6 +128,7 @@ files:
|
|
125
128
|
- spec/lib/ckeditor5/rails/editor/props_base_plugin_spec.rb
|
126
129
|
- spec/lib/ckeditor5/rails/editor/props_external_plugin_spec.rb
|
127
130
|
- spec/lib/ckeditor5/rails/editor/props_inline_plugin_spec.rb
|
131
|
+
- spec/lib/ckeditor5/rails/editor/props_patch_plugin_spec.rb
|
128
132
|
- spec/lib/ckeditor5/rails/editor/props_plugin_spec.rb
|
129
133
|
- spec/lib/ckeditor5/rails/editor/props_spec.rb
|
130
134
|
- spec/lib/ckeditor5/rails/engine_spec.rb
|
@@ -194,6 +198,7 @@ test_files:
|
|
194
198
|
- spec/lib/ckeditor5/rails/editor/props_base_plugin_spec.rb
|
195
199
|
- spec/lib/ckeditor5/rails/editor/props_external_plugin_spec.rb
|
196
200
|
- spec/lib/ckeditor5/rails/editor/props_inline_plugin_spec.rb
|
201
|
+
- spec/lib/ckeditor5/rails/editor/props_patch_plugin_spec.rb
|
197
202
|
- spec/lib/ckeditor5/rails/editor/props_plugin_spec.rb
|
198
203
|
- spec/lib/ckeditor5/rails/editor/props_spec.rb
|
199
204
|
- spec/lib/ckeditor5/rails/engine_spec.rb
|