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 +4 -4
- data/Gemfile +1 -0
- data/lib/ckeditor5/rails/assets/webcomponent_bundle.rb +14 -3
- data/lib/ckeditor5/rails/version.rb +1 -1
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6209f7ab70666ad0c3e5c368f47832871d740429238bb62199c5956ca73fe77
|
4
|
+
data.tar.gz: 3e3af0099b5150b6c2df7bb578a11cd63b81f88cb9ded596806e5ea980ebf90a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d7f113a286468066aa941cba9d735c5312d8558ed83a1d3f9fa7e4a2959d7c58a843f6b0bf8fd4e296b0ab34dedc303f0a6533c5adf6af1c60a1a77dbe4c5e9
|
7
|
+
data.tar.gz: c4304b80a54b9bf94629b9aa8c27d640e2ff0783e3d78d2a577400d3cd29df337aa1a8b40fc7bc8f050bc3ee3c528becfa0a12b68158fdb980df5ea2b897b6f8
|
data/Gemfile
CHANGED
@@ -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 ||=
|
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
|
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.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: []
|