sass-embedded 1.102.0-aarch64-linux-gnu → 1.103.0-aarch64-linux-gnu

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd98e8aad7fe8d369c41c8dc8acd71dfd422e3a721fde6eedaf7cd23a752beb9
4
- data.tar.gz: bc780e7db83f62e46f339dd512c507c372eba11c4ce857aa8eb66de9138fc414
3
+ metadata.gz: 726b7dcc7b8644e402ba4f87b5ea77df4acd00330b39dbabc50cbdee793d2a1d
4
+ data.tar.gz: f88160a6b017fdd0677584d86b131508a1fef9151ade3e4374d75424929371fc
5
5
  SHA512:
6
- metadata.gz: bb2ac9d4496427a88802bb60f8644f8fc3b771c03a49c23e44bb5a7df16073fe20162fc6a33cde9eb65eef3fff9c8a5fa53eedc9c731583259faa03afa197581
7
- data.tar.gz: 30a891ec57cd22ed2225c5418abd894612a092f54c77589a28256cf1091aaa8d8bade15afbd158719527deb238ca848684e4893c9db693ad51e366b7a361ec13
6
+ metadata.gz: c65d8aa1b9c497c195307ab602dbe94a62dd0b33fdabfc067f2307078de30698b021f1c4d9f41e38faf9f52baccbdb97ccf6d8f56056291015c6049c35538de6
7
+ data.tar.gz: 6e9298dbd552e740c44f2deae7068fd7432a1d2128ee768a6877c5f4590b26303e07cde1e28de2466d5110d84e1f22d067732af63862a06af2c3db079d0d3826
@@ -71,11 +71,7 @@ module Sass
71
71
  @session.backtrace = e.backtrace
72
72
  EmbeddedProtocol::InboundMessage::FunctionCallResponse.new(
73
73
  id: function_call_request.id,
74
- error: if e.respond_to?(:detailed_message)
75
- e.detailed_message(highlight: false)
76
- else # TODO: remove once ruby 3.1 support is dropped
77
- "#{e.message} (#{e.class.name})"
78
- end
74
+ error: e.detailed_message(highlight: false)
79
75
  )
80
76
  end
81
77
 
@@ -82,11 +82,7 @@ module Sass
82
82
  @session.backtrace = e.backtrace
83
83
  EmbeddedProtocol::InboundMessage::CanonicalizeResponse.new(
84
84
  id: canonicalize_request.id,
85
- error: if e.respond_to?(:detailed_message)
86
- e.detailed_message(highlight: false)
87
- else # TODO: remove once ruby 3.1 support is dropped
88
- "#{e.message} (#{e.class.name})"
89
- end
85
+ error: e.detailed_message(highlight: false)
90
86
  )
91
87
  end
92
88
 
@@ -111,11 +107,7 @@ module Sass
111
107
  @session.backtrace = e.backtrace
112
108
  EmbeddedProtocol::InboundMessage::ImportResponse.new(
113
109
  id: import_request.id,
114
- error: if e.respond_to?(:detailed_message)
115
- e.detailed_message(highlight: false)
116
- else # TODO: remove once ruby 3.1 support is dropped
117
- "#{e.message} (#{e.class.name})"
118
- end
110
+ error: e.detailed_message(highlight: false)
119
111
  )
120
112
  end
121
113
 
@@ -134,11 +126,7 @@ module Sass
134
126
  @session.backtrace = e.backtrace
135
127
  EmbeddedProtocol::InboundMessage::FileImportResponse.new(
136
128
  id: file_import_request.id,
137
- error: if e.respond_to?(:detailed_message)
138
- e.detailed_message(highlight: false)
139
- else # TODO: remove once ruby 3.1 support is dropped
140
- "#{e.message} (#{e.class.name})"
141
- end
129
+ error: e.detailed_message(highlight: false)
142
130
  )
143
131
  end
144
132
 
Binary file
Binary file
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sass
4
4
  module Embedded
5
- VERSION = '1.102.0'
5
+ VERSION = '1.103.0'
6
6
  end
7
7
  end
@@ -12,78 +12,25 @@ module Sass
12
12
  # @return [Array<String>]
13
13
  attr_reader :loaded_urls
14
14
 
15
- if Exception.public_method_defined?(:detailed_message, false)
16
- # @!visibility private
17
- def initialize(message, detailed_message, sass_stack, span, loaded_urls)
18
- super(message)
19
-
20
- @detailed_message = detailed_message
21
- @sass_stack = sass_stack
22
- @span = span
23
- @loaded_urls = loaded_urls
24
- end
25
-
26
- # @!visibility private
27
- def detailed_message(highlight: nil, **)
28
- return super if @detailed_message.nil?
29
-
30
- highlight = Exception.to_tty? if highlight.nil?
31
-
32
- detailed_message = @detailed_message.sub(message, super)
33
- detailed_message.gsub!(/\e\[[0-9;]*m/, '') unless highlight
34
- detailed_message
35
- end
36
- else # TODO: remove once ruby 3.1 support is dropped
37
- # @!visibility private
38
- def initialize(message, detailed_message, sass_stack, span, loaded_urls)
39
- super(detailed_message.nil? ? message : detailed_message)
40
-
41
- @message = message
42
- @detailed_message = detailed_message
43
- @sass_stack = sass_stack
44
- @span = span
45
- @loaded_urls = loaded_urls
46
- end
47
-
48
- # @!visibility private
49
- def message
50
- return @message if @detailed_message.nil? || @full_message.nil?
51
-
52
- @detailed_message
53
- end
54
-
55
- # @!visibility private
56
- def detailed_message(highlight: nil, **)
57
- highlight = Exception.to_tty? if highlight.nil?
58
-
59
- super_ = if highlight
60
- lines = message.split("\n")
61
- lines[0] += " (\e[1;4m#{self.class.name}\e[m\e[1m)" unless lines.empty?
62
- lines.map { |line| "\e[1m#{line}\e[m" }.join("\n")
63
- else
64
- lines = message.split("\n", 2)
65
- lines[0] += " (#{self.class.name})" unless lines.empty?
66
- lines.join("\n")
67
- end
15
+ # @!visibility private
16
+ def initialize(message, detailed_message, sass_stack, span, loaded_urls)
17
+ super(message)
68
18
 
69
- return super_ if @detailed_message.nil?
19
+ @detailed_message = detailed_message
20
+ @sass_stack = sass_stack
21
+ @span = span
22
+ @loaded_urls = loaded_urls
23
+ end
70
24
 
71
- detailed_message = @detailed_message.sub(message, super_)
72
- detailed_message.gsub!(/\e\[[0-9;]*m/, '') unless highlight
73
- detailed_message
74
- end
25
+ # @!visibility private
26
+ def detailed_message(highlight: nil, **)
27
+ return super if @detailed_message.nil?
75
28
 
76
- # @!visibility private
77
- def full_message(highlight: nil, order: :top, **)
78
- highlight = Exception.to_tty? if highlight.nil?
29
+ highlight = Exception.to_tty? if highlight.nil?
79
30
 
80
- @full_message = true
81
- full_message = super.force_encoding(message.encoding)
82
- full_message.gsub!(/\e\[[0-9;]*m/, '') unless highlight
83
- full_message
84
- ensure
85
- @full_message = nil
86
- end
31
+ detailed_message = @detailed_message.sub(message, super)
32
+ detailed_message.gsub!(/\e\[[0-9;]*m/, '') unless highlight
33
+ detailed_message
87
34
  end
88
35
 
89
36
  # @return [String]
@@ -8,9 +8,6 @@ module Sass
8
8
  module_function
9
9
 
10
10
  if Process.respond_to?(:_fork)
11
- # TODO: remove next line once ruby 3.1 support is dropped
12
- require 'set' unless defined?(::Set)
13
-
14
11
  SET = Set.new.compare_by_identity
15
12
 
16
13
  MUTEX = Mutex.new
@@ -29,6 +29,30 @@ module Sass
29
29
  end
30
30
 
31
31
  def convert(dest, hue, whiteness, blackness, alpha)
32
+ if whiteness.nil? && blackness.nil?
33
+ return Color.send(:_for_space, dest, nil, nil, nil, alpha) if hue.nil?
34
+
35
+ converted = convert(dest, hue, 0, 0, alpha)
36
+ return case dest
37
+ when HSL
38
+ Color.send(:_for_space,
39
+ dest,
40
+ converted.channel0,
41
+ nil,
42
+ nil,
43
+ converted.alpha)
44
+ when LCH, OKLCH
45
+ Color.send(:_for_space,
46
+ dest,
47
+ nil,
48
+ nil,
49
+ converted.channel2,
50
+ converted.alpha)
51
+ else
52
+ converted
53
+ end
54
+ end
55
+
32
56
  missing_hue = hue.nil?
33
57
 
34
58
  hue = ((hue.nil? ? 0 : hue) % 360) / 30.0
@@ -22,6 +22,14 @@ module Sass
22
22
 
23
23
  def convert(dest, lightness, a, b, alpha, # rubocop:disable Naming/MethodParameterName
24
24
  missing_chroma: false, missing_hue: false)
25
+ if missing_chroma && missing_hue
26
+ a = nil
27
+ b = nil
28
+ elsif a.nil? && b.nil?
29
+ missing_chroma = true
30
+ missing_hue = true
31
+ end
32
+
25
33
  case dest
26
34
  when LAB
27
35
  powerless_ab = lightness.nil? || FuzzyMath.equals?(lightness, 0)
@@ -26,6 +26,23 @@ module Sass
26
26
  missing_hue: false,
27
27
  missing_a: false,
28
28
  missing_b: false)
29
+ if missing_a && missing_b
30
+ missing_chroma = true
31
+ missing_hue = true
32
+ elsif missing_chroma && missing_hue
33
+ missing_a = true
34
+ missing_b = true
35
+ end
36
+
37
+ if (missing_lightness && missing_chroma && missing_hue) || (long.nil? && medium.nil? && short.nil?)
38
+ return Color.send(:_for_space,
39
+ dest,
40
+ nil,
41
+ nil,
42
+ nil,
43
+ alpha)
44
+ end
45
+
29
46
  case dest
30
47
  when OKLAB
31
48
  long_scaled = Math.cbrt(long.nil? ? 0 : long)
@@ -23,37 +23,42 @@ module Sass
23
23
 
24
24
  def convert(dest, lightness, a, b, alpha, # rubocop:disable Naming/MethodParameterName
25
25
  missing_chroma: false, missing_hue: false)
26
- case dest
27
- when OKLCH
28
- Utils.lab_to_lch(dest, lightness, a, b, alpha)
29
- else
30
- missing_lightness = lightness.nil?
31
- missing_a = a.nil?
32
- missing_b = b.nil?
26
+ return Utils.lab_to_lch(dest, lightness, a, b, alpha, missing_chroma:, missing_hue:) if dest == OKLCH
33
27
 
34
- lightness = 0 if missing_lightness
35
- a = 0 if missing_a
36
- b = 0 if missing_b
37
-
38
- LMS.convert(
39
- dest,
40
- ((Conversions::OKLAB_TO_LMS[0] * lightness) +
41
- (Conversions::OKLAB_TO_LMS[1] * a) +
42
- (Conversions::OKLAB_TO_LMS[2] * b))**3,
43
- ((Conversions::OKLAB_TO_LMS[3] * lightness) +
44
- (Conversions::OKLAB_TO_LMS[4] * a) +
45
- (Conversions::OKLAB_TO_LMS[5] * b))**3,
46
- ((Conversions::OKLAB_TO_LMS[6] * lightness) +
47
- (Conversions::OKLAB_TO_LMS[7] * a) +
48
- (Conversions::OKLAB_TO_LMS[8] * b))**3,
49
- alpha,
50
- missing_lightness:,
51
- missing_chroma:,
52
- missing_hue:,
53
- missing_a:,
54
- missing_b:
55
- )
28
+ if a.nil? && b.nil?
29
+ missing_chroma = true
30
+ missing_hue = true
31
+ elsif missing_chroma && missing_hue
32
+ a = nil
33
+ b = nil
56
34
  end
35
+
36
+ missing_lightness = lightness.nil?
37
+ missing_a = a.nil?
38
+ missing_b = b.nil?
39
+
40
+ lightness = 0 if missing_lightness
41
+ a = 0 if missing_a
42
+ b = 0 if missing_b
43
+
44
+ LMS.convert(
45
+ dest,
46
+ ((Conversions::OKLAB_TO_LMS[0] * lightness) +
47
+ (Conversions::OKLAB_TO_LMS[1] * a) +
48
+ (Conversions::OKLAB_TO_LMS[2] * b))**3,
49
+ ((Conversions::OKLAB_TO_LMS[3] * lightness) +
50
+ (Conversions::OKLAB_TO_LMS[4] * a) +
51
+ (Conversions::OKLAB_TO_LMS[5] * b))**3,
52
+ ((Conversions::OKLAB_TO_LMS[6] * lightness) +
53
+ (Conversions::OKLAB_TO_LMS[7] * a) +
54
+ (Conversions::OKLAB_TO_LMS[8] * b))**3,
55
+ alpha,
56
+ missing_lightness:,
57
+ missing_chroma:,
58
+ missing_hue:,
59
+ missing_a:,
60
+ missing_b:
61
+ )
57
62
  end
58
63
  end
59
64
 
@@ -20,6 +20,11 @@ module Sass
20
20
  missing_lightness: false,
21
21
  missing_chroma: false,
22
22
  missing_hue: false)
23
+ if (red.nil? && green.nil? && blue.nil?) ||
24
+ (missing_lightness && missing_chroma && missing_hue)
25
+ return Color.send(:for_space, dest, nil, nil, nil, alpha)
26
+ end
27
+
23
28
  case dest
24
29
  when HSL, HWB
25
30
  red = 0 if red.nil?
@@ -68,8 +73,8 @@ module Sass
68
73
  :for_space_internal,
69
74
  dest,
70
75
  missing_hue || FuzzyMath.greater_than_or_equals?(whiteness + blackness, 100) ? nil : hue % 360,
71
- whiteness,
72
- blackness,
76
+ missing_chroma && missing_lightness ? nil : whiteness,
77
+ missing_chroma && missing_lightness ? nil : blackness,
73
78
  alpha
74
79
  )
75
80
  end
@@ -61,6 +61,9 @@ module Sass
61
61
  # @return [Color]
62
62
  def lab_to_lch(dest, lightness, a, b, alpha, # rubocop:disable Naming/MethodParameterName
63
63
  missing_chroma: false, missing_hue: false)
64
+ missing_chroma ||= a.nil? && b.nil?
65
+ missing_hue ||= a.nil? && b.nil?
66
+
64
67
  chroma = Math.sqrt(((a.nil? ? 0 : a)**2) + ((b.nil? ? 0 : b)**2))
65
68
  hue = if missing_hue || FuzzyMath.equals?(chroma, 0)
66
69
  nil
@@ -22,6 +22,19 @@ module Sass
22
22
  missing_hue: false,
23
23
  missing_a: false,
24
24
  missing_b: false)
25
+ if missing_a && missing_b
26
+ missing_chroma = true
27
+ missing_hue = true
28
+ elsif missing_chroma && missing_hue
29
+ missing_a = true
30
+ missing_b = true
31
+ end
32
+
33
+ if (missing_lightness && missing_chroma && missing_hue) ||
34
+ (x.nil? && y.nil? && z.nil?)
35
+ return Color.send(:_for_space, dest, nil, nil, nil, alpha)
36
+ end
37
+
25
38
  case dest
26
39
  when LAB, LCH
27
40
  f0 = _convert_component_to_lab_f((x.nil? ? 0 : x) / Conversions::D50[0])
@@ -95,6 +95,23 @@ module Sass
95
95
  missing_hue: false,
96
96
  missing_a: false,
97
97
  missing_b: false)
98
+ if missing_a && missing_b
99
+ missing_chroma = true
100
+ missing_hue = true
101
+ elsif missing_chroma && missing_hue
102
+ missing_a = true
103
+ missing_b = true
104
+ end
105
+
106
+ if (missing_lightness && missing_chroma && missing_hue) || (red.nil? && green.nil? && blue.nil?)
107
+ return Color.send(:_for_space,
108
+ dest,
109
+ nil,
110
+ nil,
111
+ nil,
112
+ alpha)
113
+ end
114
+
98
115
  linear_dest = case dest
99
116
  when HSL, HWB
100
117
  SRGB
@@ -508,37 +508,31 @@ module Sass
508
508
  color1 = _to_space(method.space)
509
509
  color2 = other._to_space(method.space)
510
510
 
511
- c1_missing0 = _analogous_channel_missing?(self, color1, 0)
512
- c1_missing1 = _analogous_channel_missing?(self, color1, 1)
513
- c1_missing2 = _analogous_channel_missing?(self, color1, 2)
514
- c2_missing0 = _analogous_channel_missing?(other, color2, 0)
515
- c2_missing1 = _analogous_channel_missing?(other, color2, 1)
516
- c2_missing2 = _analogous_channel_missing?(other, color2, 2)
517
- c1_channel0 = (c1_missing0 ? color2 : color1).channel0
518
- c1_channel1 = (c1_missing1 ? color2 : color1).channel1
519
- c1_channel2 = (c1_missing2 ? color2 : color1).channel2
520
- c2_channel0 = (c2_missing0 ? color1 : color2).channel0
521
- c2_channel1 = (c2_missing1 ? color1 : color2).channel1
522
- c2_channel2 = (c2_missing2 ? color1 : color2).channel2
511
+ c1_channel0 = color1.channel0_or_nil.nil? ? color2.channel0_or_nil : color1.channel0_or_nil
512
+ c1_channel1 = color1.channel1_or_nil.nil? ? color2.channel1_or_nil : color1.channel1_or_nil
513
+ c1_channel2 = color1.channel2_or_nil.nil? ? color2.channel2_or_nil : color1.channel2_or_nil
514
+ c2_channel0 = color2.channel0_or_nil.nil? ? color1.channel0_or_nil : color2.channel0_or_nil
515
+ c2_channel1 = color2.channel1_or_nil.nil? ? color1.channel1_or_nil : color2.channel1_or_nil
516
+ c2_channel2 = color2.channel2_or_nil.nil? ? color1.channel2_or_nil : color2.channel2_or_nil
523
517
  c1_alpha = alpha_or_nil.nil? ? other.alpha : alpha_or_nil
524
518
  c2_alpha = other.alpha_or_nil.nil? ? alpha : other.alpha_or_nil
525
519
 
526
520
  c1_multiplier = (alpha_or_nil.nil? ? 1 : alpha_or_nil) * weight
527
521
  c2_multiplier = (other.alpha_or_nil.nil? ? 1 : other.alpha_or_nil) * (1 - weight)
528
522
  mixed_alpha = alpha_missing? && other.alpha_missing? ? nil : (c1_alpha * weight) + (c2_alpha * (1 - weight))
529
- mixed0 = if c1_missing0 && c2_missing0
523
+ mixed0 = if c1_channel0.nil?
530
524
  nil
531
525
  else
532
526
  ((c1_channel0 * c1_multiplier) + (c2_channel0 * c2_multiplier)) /
533
527
  (mixed_alpha.nil? ? 1 : mixed_alpha)
534
528
  end
535
- mixed1 = if c1_missing1 && c2_missing1
529
+ mixed1 = if c1_channel1.nil?
536
530
  nil
537
531
  else
538
532
  ((c1_channel1 * c1_multiplier) + (c2_channel1 * c2_multiplier)) /
539
533
  (mixed_alpha.nil? ? 1 : mixed_alpha)
540
534
  end
541
- mixed2 = if c1_missing2 && c2_missing2
535
+ mixed2 = if c1_channel2.nil?
542
536
  nil
543
537
  else
544
538
  ((c1_channel2 * c1_multiplier) + (c2_channel2 * c2_multiplier)) /
@@ -549,7 +543,7 @@ module Sass
549
543
  when Space::HSL, Space::HWB
550
544
  Color.send(:for_space_internal,
551
545
  method.space,
552
- c1_missing0 && c2_missing0 ? nil : _interpolate_hues(c1_channel0, c2_channel0, method.hue, weight),
546
+ c1_channel0.nil? ? nil : _interpolate_hues(c1_channel0, c2_channel0, method.hue, weight),
553
547
  mixed1,
554
548
  mixed2,
555
549
  mixed_alpha)
@@ -558,7 +552,7 @@ module Sass
558
552
  method.space,
559
553
  mixed0,
560
554
  mixed1,
561
- c1_missing2 && c2_missing2 ? nil : _interpolate_hues(c1_channel2, c2_channel2, method.hue, weight),
555
+ c1_channel2.nil? ? nil : _interpolate_hues(c1_channel2, c2_channel2, method.hue, weight),
562
556
  mixed_alpha)
563
557
  else
564
558
  Color.send(:_for_space,
@@ -566,21 +560,6 @@ module Sass
566
560
  end._to_space(_space)
567
561
  end
568
562
 
569
- def _analogous_channel_missing?(original, output, output_channel_index)
570
- return true if output.channels_or_nil[output_channel_index].nil?
571
-
572
- return false if original.equal?(output)
573
-
574
- output_channel = output._space.channels[output_channel_index]
575
- original_channel = original._space.channels.find do |channel|
576
- output_channel.analogous?(channel)
577
- end
578
-
579
- return false if original_channel.nil?
580
-
581
- original.channel_missing?(original_channel.name)
582
- end
583
-
584
563
  def _interpolate_hues(hue1, hue2, method, weight)
585
564
  case method
586
565
  when :shorter
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sass-embedded
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.102.0
4
+ version: 1.103.0
5
5
  platform: aarch64-linux-gnu
6
6
  authors:
7
7
  - なつき
@@ -116,8 +116,8 @@ licenses:
116
116
  - MIT
117
117
  metadata:
118
118
  bug_tracker_uri: https://github.com/sass-contrib/sass-embedded-host-ruby/issues
119
- documentation_uri: https://rubydoc.info/gems/sass-embedded/1.102.0
120
- source_code_uri: https://github.com/sass-contrib/sass-embedded-host-ruby/tree/v1.102.0
119
+ documentation_uri: https://rubydoc.info/gems/sass-embedded/1.103.0
120
+ source_code_uri: https://github.com/sass-contrib/sass-embedded-host-ruby/tree/v1.103.0
121
121
  funding_uri: https://github.com/sponsors/ntkme
122
122
  rubygems_mfa_required: 'true'
123
123
  rdoc_options: []
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  - !ruby/object:Gem::Version
135
135
  version: '0'
136
136
  requirements: []
137
- rubygems_version: 4.0.17
137
+ rubygems_version: 4.0.19
138
138
  specification_version: 4
139
139
  summary: Use dart-sass with Ruby!
140
140
  test_files: []