ckeditor5 1.22.0 → 1.23.0

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: 541773f43272493bbe29d3baf236cab3e85231f03b31c5d070b4917e6ecdea26
4
- data.tar.gz: cb06989fd313768d6c1a5990f3dd49525fd1482b29a6b542c6d2778092eb3ad5
3
+ metadata.gz: a6209f7ab70666ad0c3e5c368f47832871d740429238bb62199c5956ca73fe77
4
+ data.tar.gz: 3e3af0099b5150b6c2df7bb578a11cd63b81f88cb9ded596806e5ea980ebf90a
5
5
  SHA512:
6
- metadata.gz: 5855d32cb3fcfd5da47b650683c215bda3dc1842f8e9d10af599eecec515d00ca120adc0be299d6410c5bd5a12df7d8df6c4c49b0d0d5d6477e65ccb3841a99a
7
- data.tar.gz: 437632ab7d5599ddcd452b3dfefa218d2541db59896c50cba8ade94081c40ac4c9a9e144c82daa684174f88d50ac300d341eae07e5d675fe6a90f7ef15d667db
6
+ metadata.gz: 1d7f113a286468066aa941cba9d735c5312d8558ed83a1d3f9fa7e4a2959d7c58a843f6b0bf8fd4e296b0ab34dedc303f0a6533c5adf6af1c60a1a77dbe4c5e9
7
+ data.tar.gz: c4304b80a54b9bf94629b9aa8c27d640e2ff0783e3d78d2a577400d3cd29df337aa1a8b40fc7bc8f050bc3ee3c528becfa0a12b68158fdb980df5ea2b897b6f8
data/Gemfile CHANGED
@@ -21,6 +21,7 @@ group :development do
21
21
  gem 'slim', '~> 5.2', '>= 5.2.0'
22
22
  gem 'sqlite3', '>= 1.4'
23
23
  gem 'stimulus-rails'
24
+ gem 'terser', '~> 1.1', '>= 1.1.1'
24
25
  gem 'turbo-rails'
25
26
  end
26
27
 
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'singleton'
4
+ require 'terser'
4
5
 
5
6
  module CKEditor5::Rails::Assets
6
7
  class WebComponentBundle
@@ -17,13 +18,23 @@ module CKEditor5::Rails::Assets
17
18
  ].freeze
18
19
 
19
20
  def source
20
- @source ||= WEBCOMPONENTS_MODULES.map do |file|
21
- File.read(File.join(WEBCOMPONENTS_PATH, file))
22
- end.join("\n").html_safe
21
+ @source ||= compress_source(raw_source)
23
22
  end
24
23
 
25
24
  def to_html
26
25
  @to_html ||= tag.script(source, type: 'module', nonce: true)
27
26
  end
27
+
28
+ private
29
+
30
+ def raw_source
31
+ @raw_source ||= WEBCOMPONENTS_MODULES.map do |file|
32
+ File.read(File.join(WEBCOMPONENTS_PATH, file))
33
+ end.join("\n")
34
+ end
35
+
36
+ def compress_source(code)
37
+ Terser.new(compress: true, mangle: true).compile(code).html_safe
38
+ end
28
39
  end
29
40
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module CKEditor5
4
4
  module Rails
5
- VERSION = '1.22.0'
5
+ VERSION = '1.23.0'
6
6
 
7
7
  DEFAULT_CKEDITOR_VERSION = '44.0.0'
8
8
  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.22.0
4
+ version: 1.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mateusz Bagiński
@@ -31,6 +31,20 @@ dependencies:
31
31
  - - "<"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '9.0'
34
+ - !ruby/object:Gem::Dependency
35
+ name: terser
36
+ requirement: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.0'
41
+ type: :runtime
42
+ prerelease: false
43
+ version_requirements: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.0'
34
48
  description:
35
49
  email: cziken58@gmail.com
36
50
  executables: []