ckeditor5 1.24.5 → 1.24.6
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/lib/ckeditor5/rails/assets/webcomponents/utils.mjs +9 -1
- data/lib/ckeditor5/rails/editor/props_external_plugin.rb +1 -4
- data/lib/ckeditor5/rails/editor/props_inline_plugin.rb +0 -1
- data/lib/ckeditor5/rails/editor/props_plugin.rb +6 -1
- data/lib/ckeditor5/rails/version.rb +1 -1
- data/spec/lib/ckeditor5/rails/context/preset_serializer_spec.rb +2 -2
- data/spec/lib/ckeditor5/rails/editor/props_external_plugin_spec.rb +0 -1
- data/spec/lib/ckeditor5/rails/editor/props_inline_plugin_spec.rb +1 -4
- data/spec/lib/ckeditor5/rails/editor/props_plugin_spec.rb +2 -8
- data/spec/lib/ckeditor5/rails/plugins/wproofreader_spec.rb +2 -2
- 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: cb9b907f6916267eea9ff0259ba18545d3c41b9bf0b655466292a55f55390db0
         | 
| 4 | 
            +
              data.tar.gz: f6523d9c201d5dc7abd649890fcb289d920e1db564fb70fc9e283320405b20c5
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 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 | 
            -
               | 
| 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 | 
             
            /**
         | 
| @@ -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. | 
| 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
         | 
| @@ -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
         | 
| @@ -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  | 
| 7 | 
            +
                it 'generates string for standard plugin' do
         | 
| 8 8 | 
             
                  plugin = described_class.new(:Bold)
         | 
| 9 | 
            -
                  expect(plugin.to_h).to  | 
| 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 | 
            +
              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- | 
| 12 | 
            +
            date: 2024-12-22 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: rails
         |