card-mod-style 0.13.3 → 0.14.2

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: 35d952494f16badaf54891ab982249b6b234ebbaac13a5c945f281911a199a3c
4
- data.tar.gz: c68df3896c0b911e3ce9c5e0d2d9fe7bed734fabbf073aa9f43906eb883a4994
3
+ metadata.gz: 814cec5324e3b869d95b23d9da8ba2dd60d5e35e2a310dddf1b49724b2be46d4
4
+ data.tar.gz: e95a44cf8a1ccffa2fbe235e7f0fad54a3912582decec06a1cccac89e99e3738
5
5
  SHA512:
6
- metadata.gz: 63798bca01c446ae1b50a3074c5973231a6ce86cebfaa7d5bd0971b6da98c2a187003a4e10e068d1eea1107acb039b64cf95481cb99d66e5b022ecf8337c5a0a
7
- data.tar.gz: bbb43eae8e985ea2c8cedc01409919c269178e4e3fd92a8b2b8b881a7f226a2f9e52ec9a85076c4676e284bf8d938e23c70fb010da10970091271f65b30e4483
6
+ metadata.gz: 6b46c15665d3fcbc74932cad74a0b28166c561e1d3bb815aea29edfde5d4e0a6db69a34deb29fb238faac0e5e6b3f8abf7060e2d77cc4486f178b1f3921f1576
7
+ data.tar.gz: ae289492f336612e0eb037e2a955b9c0527c6f6789ab9203df135f3d718fd4518af8091d0ab19c9bccf731cc16533a574934e8ba36abd0da4bf2f48a067d66d6
@@ -31,7 +31,6 @@ $d-yellow-1: #ffd;
31
31
 
32
32
  /* NOTE: we recommend against styling ".d0-card-slot", which is heavily used by javascript */
33
33
 
34
-
35
34
  /* -- hidden info -- */
36
35
 
37
36
  .ui-loader,
@@ -1281,9 +1280,9 @@ body.right-sidebar, body.left-sidebar, body.two-sidebar {
1281
1280
  }
1282
1281
  }
1283
1282
 
1284
- .rename-button-form-group {
1285
- display: flex;
1286
- .btn {
1287
- margin-right: 1rem;
1288
- }
1283
+ .button-form-group {
1284
+ display: flex
1285
+ }
1286
+ .rename-button-form-group .btn {
1287
+ margin-right: 1rem;
1289
1288
  }
@@ -7,19 +7,3 @@ include_set Abstract::AssetFile
7
7
  def compress?
8
8
  @minimize
9
9
  end
10
-
11
- format :css do
12
- view :source do
13
- if @local
14
- card.machine_output_url
15
- else
16
- source
17
- end
18
- end
19
- end
20
-
21
- format :html do
22
- view :stylesheet_include_tag do
23
- stylesheet_include_tag card.machine_output_url
24
- end
25
- end
@@ -4,42 +4,10 @@ require "sassc"
4
4
  require "benchmark"
5
5
  require "coderay"
6
6
 
7
- include_set Abstract::Machine
8
- include_set Abstract::MachineInput
9
-
10
- store_machine_output filetype: "css"
11
-
12
- machine_input do
13
- compress format(:css)._render_core
14
- end
15
-
16
- def compress input
17
- compress? ? SassC::Engine.new(input, style: :compressed).render : input
18
- rescue StandardError => e
19
- raise Card::Error, css_compression_error(e)
20
- end
21
-
22
- def css_compression_error error
23
- # scss is compiled in a view
24
- # If there is a scss syntax error we get the rescued view here
25
- # and the error that the rescued view is no valid css
26
- # To get the original error we have to refer to Card::Error.current
27
- if Card::Error.current
28
- Card::Error.current.message
29
- else
30
- "Sass::SyntaxError (#{name}): #{error.message}"
31
- end
32
- end
33
-
34
7
  def clean_html?
35
8
  false
36
9
  end
37
10
 
38
- def compress?
39
- true
40
- # !Rails.env.development?
41
- end
42
-
43
11
  format do
44
12
  # def default_nest_view
45
13
  # :raw
@@ -80,6 +48,45 @@ format :css do
80
48
  view :import do
81
49
  %{\n@import url("#{_render_url}");\n}
82
50
  end
51
+
52
+ view :compiled do
53
+ compile(_render_core, :nested)
54
+ end
55
+
56
+ view :compressed do
57
+ compress(_render_core)
58
+ end
59
+
60
+ def comment_with_source css
61
+ "// #{card.name}\n#{css}"
62
+ end
63
+
64
+ def compress input
65
+ compress? ? compile(input) : compile(input, :nested)
66
+ end
67
+
68
+ # FIXME: method is repeated called with "nested", but there is no handling for it
69
+ def compile input, _style=:compressed
70
+ SassC::Engine.new(input, style: :compressed).render
71
+ rescue StandardError => e
72
+ raise Card::Error, css_compression_error(e)
73
+ end
74
+
75
+ def css_compression_error error
76
+ # scss is compiled in a view
77
+ # If there is a scss syntax error we get the rescued view here
78
+ # and the error that the rescued view is no valid css
79
+ # To get the original error we have to refer to Card::Error.current
80
+ if Card::Error.current
81
+ Card::Error.current.message
82
+ else
83
+ "Sass::SyntaxError (#{card.name}): #{error.message}"
84
+ end
85
+ end
86
+
87
+ def compress?
88
+ Cardio.config.compress_assets
89
+ end
83
90
  end
84
91
 
85
92
  def diff_args
@@ -1,11 +1,16 @@
1
1
  include_set Abstract::Css
2
2
 
3
- format do
4
- view :core, cache: :never do
5
- compile_scss process_content(_render_raw)
3
+ format :css do
4
+ view :compiled do
5
+ compile_scss _render_core
6
+ end
7
+
8
+ view :core do
9
+ process_content(_render_raw)
6
10
  end
7
11
 
8
12
  def compile_scss scss, style=:expanded
13
+ # return scss if Rails.env.development?
9
14
  SassC::Engine.new(scss, style: style).render
10
15
  rescue SassC::SyntaxError => e
11
16
  raise Card::Error,
@@ -14,6 +19,16 @@ format do
14
19
  end
15
20
  end
16
21
 
22
+ format :scss do
23
+ view :labeled do
24
+ "//#{card.name}\n#{_render_core}"
25
+ end
26
+
27
+ view :core do
28
+ process_content _render_raw
29
+ end
30
+ end
31
+
17
32
  format :html do
18
33
  def ace_mode
19
34
  :scss
@@ -0,0 +1,41 @@
1
+ # A list of styles defined by a manifest group or a "style" asset folder.
2
+ # Usually part of a mod_style_assets card
3
+ include_set Abstract::AssetGroup
4
+
5
+ def asset_input_content
6
+ format(:scss).render_core
7
+ end
8
+
9
+ format :scss do
10
+ view :core do
11
+ card.item_cards.compact.map do |mcard|
12
+ mcard.format(:scss)._render_core
13
+ end.join "\n"
14
+ end
15
+ end
16
+
17
+ def valid_file_extensions
18
+ %w[css scss]
19
+ end
20
+
21
+ def new_asset_constants path
22
+ if path.ends_with? ".scss"
23
+ scss_constants
24
+ elsif path.ends_with? ".css"
25
+ css_constants
26
+ end
27
+ end
28
+
29
+ def scss_constants
30
+ { type_id: ScssID, set_module: Abstract::AssetScss }
31
+ end
32
+
33
+ def css_constants
34
+ { type_id: CssID, set_module: Abstract::AssetCss }
35
+ end
36
+
37
+ format :html do
38
+ view :stylesheet_include_tag do
39
+ stylesheet_include_tag card.asset_output_url
40
+ end
41
+ end
@@ -1 +1,6 @@
1
- include_set Abstract::CodePointer, basket_name: :style_mods
1
+ include_set Abstract::AssetInputter, input_format: :scss
2
+
3
+ # find all theme cards that appear in style rules
4
+ def dependent_asset_inputters
5
+ Card::Assets.active_theme_cards
6
+ end
data/set/type/css.rb CHANGED
@@ -1 +1,2 @@
1
1
  include_set Abstract::Css
2
+ include_set Abstract::AssetInputter, input_format: :css, input_view: :compressed
@@ -1,2 +1,2 @@
1
- include_set Abstract::LocalFolderGroup
2
- include_set Abstract::StyleAssetList
1
+ include_set Abstract::FolderGroup
2
+ include_set Abstract::StyleGroup
@@ -1,2 +1,2 @@
1
1
  include_set Abstract::LocalManifestGroup
2
- include_set Abstract::StyleAssetList
2
+ include_set Abstract::StyleGroup
data/set/type/scss.rb CHANGED
@@ -1 +1,2 @@
1
1
  include_set Abstract::Scss
2
+ include_set Abstract::AssetInputter, input_format: :scss
data/set/type/skin.rb CHANGED
@@ -1,9 +1,11 @@
1
- include_set Abstract::MachineInput
1
+ include_set Abstract::AssetInputter, input_format: :css, input_view: :concat
2
2
  include_set Abstract::SkinBox
3
- include_set Pointer
3
+ include_set List
4
4
 
5
- def machine_input
6
- # only the item of a skin card contribute input to the machine
7
- # not the skin card itself
8
- ""
5
+ format :css do
6
+ view :concat do
7
+ card.item_cards.map do |item|
8
+ item.respond_to?(:asset_input) ? item.asset_input : nest(item, view: :core)
9
+ end.join("\n")
10
+ end
9
11
  end
@@ -0,0 +1,3 @@
1
+ def dependent_asset_inputters
2
+ [left]
3
+ end
@@ -0,0 +1,33 @@
1
+ # card, that lists all styles that belong to one mod, for example:
2
+ # "mod: bootstrap+*style"
3
+
4
+ include_set Abstract::AssetInputter, input_format: :scss
5
+ include_set Abstract::ModAssets
6
+
7
+ def subpath
8
+ "style"
9
+ end
10
+
11
+ def folder_group_type_id
12
+ ::Card::LocalStyleFolderGroupID
13
+ end
14
+
15
+ def local_manifest_group_type_id
16
+ ::Card::LocalStyleManifestGroupID
17
+ end
18
+
19
+ format :html do
20
+ view :stylesheet_include_tag do
21
+ card.item_cards.map do |icard|
22
+ nest icard, view: :stylesheet_include_tag
23
+ end.join("\n")
24
+ end
25
+ end
26
+
27
+ def asset_input_needs_refresh?
28
+ !asset_input_updated_at || source_changed?(since: asset_input_updated_at)
29
+ end
30
+
31
+ def asset_input_updated_at
32
+ asset_input_card&.updated_at
33
+ end
File without changes
@@ -1,16 +1,24 @@
1
1
  require "sassc"
2
- include_set Abstract::Machine
3
2
 
4
- store_machine_output filetype: "css"
3
+ include_set Abstract::Css
4
+ include_set Abstract::AssetOutputter, output_format: :css, output_view: :compressed
5
+
6
+ def output_filetype
7
+ "css"
8
+ end
5
9
 
6
10
  def ok_to_read
7
11
  true
8
12
  end
9
13
 
14
+ def make_asset_output_coded
15
+ super ENV["STYLE_OUTPUT_MOD"]
16
+ end
17
+
10
18
  format do
11
19
  # turn off autodetection of uri's
12
20
  def chunk_list
13
- :nest_only
21
+ :references
14
22
  end
15
23
  end
16
24
 
@@ -38,10 +46,18 @@ end
38
46
 
39
47
  event :customize_theme, :prepare_to_validate, on: :update, when: :customize_theme? do
40
48
  skin_name = free_skin_name
41
- add_subcard skin_name, type_id: CustomizedBootswatchSkinID
49
+ subcard skin_name, type_id: CustomizedBootswatchSkinID
42
50
  self.content = "[[#{skin_name}]]"
43
51
  end
44
52
 
53
+ event :update_theme_input, :finalize,
54
+ before: :update_asset_output_file, changed: :content do
55
+ item_cards.each do |theme_card|
56
+ next unless theme_card.respond_to? :theme_name
57
+ theme_card.update_asset_input
58
+ end
59
+ end
60
+
45
61
  def free_skin_name
46
62
  name = "#{@theme} skin customized"
47
63
  if Card.exist?(name)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card-mod-style
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.3
4
+ version: 0.14.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-09-24 00:00:00.000000000 Z
13
+ date: 2022-01-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: card
@@ -18,42 +18,42 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.103.3
21
+ version: 1.104.2
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 1.103.3
28
+ version: 1.104.2
29
29
  - !ruby/object:Gem::Dependency
30
- name: card-mod-machines
30
+ name: card-mod-assets
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.13.3
35
+ version: 0.14.2
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 0.13.3
42
+ version: 0.14.2
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: card-mod-list
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - '='
48
48
  - !ruby/object:Gem::Version
49
- version: 0.13.3
49
+ version: 0.14.2
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - '='
55
55
  - !ruby/object:Gem::Version
56
- version: 0.13.3
56
+ version: 0.14.2
57
57
  description: ''
58
58
  email:
59
59
  - info@decko.org
@@ -61,10 +61,9 @@ executables: []
61
61
  extensions: []
62
62
  extra_rdoc_files: []
63
63
  files:
64
+ - assets/style/jquery_ui_smoothness.css
65
+ - assets/style/style_cards.scss
64
66
  - db/migrate_core_cards/20200805112346_add_mod_style_assets_type.rb
65
- - lib/stylesheets/style_bootstrap_compatible.css
66
- - lib/stylesheets/style_cards.scss
67
- - lib/stylesheets/style_jquery_ui_smoothness.css
68
67
  - public/jquery-ui-smoothness/ui-bg_glass_55_fbf9ee_1x400.png
69
68
  - public/jquery-ui-smoothness/ui-bg_glass_65_ffffff_1x400.png
70
69
  - public/jquery-ui-smoothness/ui-bg_glass_75_dadada_1x400.png
@@ -83,21 +82,18 @@ files:
83
82
  - set/abstract/03_asset_scss.rb
84
83
  - set/abstract/skin_box.rb
85
84
  - set/abstract/skin_box/box_bottom.haml
86
- - set/abstract/style_asset_list.rb
87
- - set/right/style.rb
88
- - set/right/style/input.haml
85
+ - set/abstract/style_group.rb
89
86
  - set/self/style.rb
90
- - set/self/style_bootstrap_compatible.rb
91
- - set/self/style_cards.rb
92
- - set/self/style_jquery_ui_smoothness.rb
93
- - set/self/style_libraries.rb
94
87
  - set/self/style_mods.rb
95
88
  - set/type/css.rb
96
89
  - set/type/local_style_folder_group.rb
97
90
  - set/type/local_style_manifest_group.rb
98
- - set/type/mod_style_assets.rb
99
91
  - set/type/scss.rb
100
92
  - set/type/skin.rb
93
+ - set/type_plus_right/customized_bootswatch_skin/stylesheets.rb
94
+ - set/type_plus_right/mod/style.rb
95
+ - set/type_plus_right/set/style.rb
96
+ - set/type_plus_right/set/style/input.haml
101
97
  homepage: https://decko.org
102
98
  licenses:
103
99
  - GPL-3.0
@@ -123,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
119
  - !ruby/object:Gem::Version
124
120
  version: '0'
125
121
  requirements: []
126
- rubygems_version: 3.1.6
122
+ rubygems_version: 3.2.15
127
123
  signing_key:
128
124
  specification_version: 4
129
125
  summary: Skins, CSS, SCSS, etc
@@ -1,68 +0,0 @@
1
- /*
2
- This backwards-compatibility stylesheet is intended to keep the old "Classic" skins working.
3
- It is NOT intended to be used in new skins.
4
- */
5
-
6
- #menu {
7
- height: 30px;
8
- div.container-fluid{
9
- display: block;
10
- }
11
- div.navbar-header {
12
- display: none;
13
- }
14
- ul {
15
- font-size: 14px;
16
- margin-top: 5px;
17
- }
18
- li {
19
- display: inline;
20
- }
21
- .navbar-left {
22
- float: left;
23
- }
24
- .navbar-right {
25
- float: right;
26
- margin-right: 15px;
27
- }
28
- .navbar-form {
29
- width: 30%;
30
- margin-top: 5px;
31
- margin-left: 10px;
32
- input {
33
- width: 100%;
34
- }
35
- }
36
- .navbox-form {
37
- input {
38
- display: inline;
39
- min-height: 25px;
40
- }
41
- }
42
- }
43
-
44
- #primary {
45
- clear: both;
46
- }
47
-
48
-
49
- // removed from standard.scss
50
- input, select, textarea {
51
- padding: 0 1%;
52
- }
53
- input, select {
54
- max-width: 97.5%;
55
- }
56
-
57
- fieldset {
58
- border: 0;
59
- padding: 0;
60
- }
61
- .form-group {
62
- padding: 10px;
63
- }
64
-
65
- .alert-info {
66
- background: #ccc;
67
- padding: 5px 10px;
68
- }
@@ -1,32 +0,0 @@
1
- include_set Abstract::Machine
2
- include_set Abstract::MachineInput
3
- include_set Abstract::AssetList
4
-
5
- machine_input { standard_machine_input }
6
- store_machine_output filetype: "css"
7
-
8
- def new_asset_constants path
9
- if path.ends_with? ".scss"
10
- scss_constants
11
- elsif path.ends_with? ".css"
12
- css_constants
13
- end
14
- end
15
-
16
- def scss_constants
17
- { type_id: ScssID, set_module: Abstract::AssetScss }
18
- end
19
-
20
- def css_constants
21
- { type_id: CssID, set_module: Abstract::AssetCss }
22
- end
23
-
24
- def standard_machine_input
25
- render_items_and_compress :css
26
- end
27
-
28
- format :html do
29
- view :stylesheet_include_tag do
30
- stylesheet_include_tag card.machine_output_url
31
- end
32
- end
@@ -1 +0,0 @@
1
- include_set Abstract::CodeFile
@@ -1 +0,0 @@
1
- include_set Abstract::CodeFile
@@ -1 +0,0 @@
1
- include_set Abstract::CodeFile
@@ -1 +0,0 @@
1
- include_set Abstract::CodePointer, basket_name: :style_libraries
@@ -1,22 +0,0 @@
1
-
2
- include_set Abstract::ModAssets
3
-
4
- def subpath
5
- "style"
6
- end
7
-
8
- def local_folder_group_type_id
9
- ::Card::LocalStyleFolderGroupID
10
- end
11
-
12
- def local_manifest_group_type_id
13
- ::Card::LocalStyleManifestGroupID
14
- end
15
-
16
- format :html do
17
- view :stylesheet_include_tag do
18
- card.item_cards.map do |icard|
19
- nest icard, view: :stylesheet_include_tag
20
- end.join("\n")
21
- end
22
- end