easol-canvas 4.21.0 → 4.23.1
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/canvas/checks/valid_liquid_check.rb +1 -0
- data/lib/canvas/dartsass.rb +17 -28
- data/lib/canvas/validators/menu_schema.rb +13 -1
- data/lib/canvas/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 94f4dc27cf361fbf85c47c331913ce6b671126adac19148c17a5ae4c32d6bf51
|
|
4
|
+
data.tar.gz: 6c955f86cdeef741fc861780d0bfb5eb77789ea9a423d0c4cae7b273a29dafbf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2cddea94e53ac37253e2c7b54fda0628d80c29bb2659fe80901049b332865d8128f527c6e1ee45e55d9c570ad9c03ed7267ed123a39c6cbb75e06dbad2e267c9
|
|
7
|
+
data.tar.gz: 53a7fab10d4801a7695a9d759534b776be54d4f2394815f13de4a6a5beba7dce354f8dc0823bb29fd68cf0a61fa59ad9dde3d041d6c6ec7ce56e9cee83dfb210
|
|
@@ -46,6 +46,7 @@ module Canvas
|
|
|
46
46
|
register_tag("accommodation_availability", ::Liquid::Block)
|
|
47
47
|
register_tag("cache", ::Liquid::Block)
|
|
48
48
|
register_tag("experience_slot_calendar", ::Liquid::Block)
|
|
49
|
+
register_tag("experience_slot_lookup", ::Liquid::Block)
|
|
49
50
|
register_tag("experience_slot_search", ::Liquid::Block)
|
|
50
51
|
register_tag("form", ::Liquid::Block)
|
|
51
52
|
register_tag("json", ::Liquid::Block)
|
data/lib/canvas/dartsass.rb
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require "
|
|
3
|
+
require "sass-embedded"
|
|
4
4
|
|
|
5
5
|
module Canvas
|
|
6
|
-
#
|
|
7
|
-
# dartsass-rails.
|
|
6
|
+
# Compiles SCSS with dart-sass via the sass-embedded Ruby API.
|
|
8
7
|
#
|
|
9
8
|
# It is compatible with SassC::Engine as much as we were using it, but 100%
|
|
10
9
|
# compatability is not a goal.
|
|
10
|
+
#
|
|
11
|
+
# We use the in-process API rather than shelling out to the `dartsass`
|
|
12
|
+
# executable: the CLI resolves `Gem.bin_path("sass-embedded", "sass")`, which
|
|
13
|
+
# is ambiguous (and noisy on stderr) whenever another bundled gem — e.g. the
|
|
14
|
+
# legacy `sass` gem — also ships a `sass` executable. The API has no such
|
|
15
|
+
# dependency on executable resolution and avoids a subprocess per render.
|
|
11
16
|
class DartSass
|
|
12
17
|
Error = Class.new(StandardError)
|
|
13
18
|
|
|
@@ -17,31 +22,15 @@ module Canvas
|
|
|
17
22
|
end
|
|
18
23
|
|
|
19
24
|
def render
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
private
|
|
30
|
-
|
|
31
|
-
def command
|
|
32
|
-
[dartsass, "--stdin", style, *load_paths].compact
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
def dartsass
|
|
36
|
-
Gem.bin_path("dartsass-rails", "dartsass").shellescape
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def style
|
|
40
|
-
(s = @config[:style]) && "--style=#{s.to_s.shellescape}"
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
def load_paths
|
|
44
|
-
Array(@config[:load_paths]).map { "--load-path=#{_1.shellescape}" }
|
|
25
|
+
Sass.compile_string(
|
|
26
|
+
@css,
|
|
27
|
+
load_paths: Array(@config[:load_paths]),
|
|
28
|
+
style: @config[:style] || :expanded
|
|
29
|
+
).css
|
|
30
|
+
rescue Sass::CompileError => e
|
|
31
|
+
# detailed_message keeps the formatted dart-sass error (source snippet and
|
|
32
|
+
# line:column) the CLI used to print to stderr; highlight: false strips ANSI.
|
|
33
|
+
raise Error.new(e.detailed_message(highlight: false))
|
|
45
34
|
end
|
|
46
35
|
end
|
|
47
36
|
end
|
|
@@ -33,7 +33,7 @@ module Canvas
|
|
|
33
33
|
# ]
|
|
34
34
|
# }
|
|
35
35
|
class MenuSchema
|
|
36
|
-
PERMITTED_KEYS = %w[max_item_levels supports_open_new_tab attributes layout].freeze
|
|
36
|
+
PERMITTED_KEYS = %w[cache max_item_levels supports_open_new_tab attributes layout].freeze
|
|
37
37
|
ADDITIONAL_RESERVED_NAMES = %w[items type].freeze
|
|
38
38
|
|
|
39
39
|
attr_reader :schema, :errors
|
|
@@ -49,6 +49,7 @@ module Canvas
|
|
|
49
49
|
def validate
|
|
50
50
|
if ensure_valid_format
|
|
51
51
|
ensure_no_unrecognized_keys
|
|
52
|
+
ensure_cache_is_valid
|
|
52
53
|
ensure_max_item_levels_is_valid
|
|
53
54
|
ensure_layout_is_valid
|
|
54
55
|
ensure_attributes_are_valid
|
|
@@ -75,6 +76,17 @@ module Canvas
|
|
|
75
76
|
false
|
|
76
77
|
end
|
|
77
78
|
|
|
79
|
+
def ensure_cache_is_valid
|
|
80
|
+
return true unless schema.key?("cache")
|
|
81
|
+
|
|
82
|
+
value = schema["cache"]
|
|
83
|
+
return true if value == true || value == false
|
|
84
|
+
return true if value.to_s == "true" || value.to_s == "false"
|
|
85
|
+
|
|
86
|
+
@errors << "\"cache\" must be true or false"
|
|
87
|
+
false
|
|
88
|
+
end
|
|
89
|
+
|
|
78
90
|
def ensure_max_item_levels_is_valid
|
|
79
91
|
return true unless schema.key?("max_item_levels")
|
|
80
92
|
return true if [1, 2, 3].include?(schema["max_item_levels"].to_i)
|
data/lib/canvas/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: easol-canvas
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.
|
|
4
|
+
version: 4.23.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kyle Byrne
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2026-
|
|
12
|
+
date: 2026-08-20 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: thor
|
|
@@ -81,6 +81,20 @@ dependencies:
|
|
|
81
81
|
- - "~>"
|
|
82
82
|
- !ruby/object:Gem::Version
|
|
83
83
|
version: '0.4'
|
|
84
|
+
- !ruby/object:Gem::Dependency
|
|
85
|
+
name: sass-embedded
|
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
|
87
|
+
requirements:
|
|
88
|
+
- - "~>"
|
|
89
|
+
- !ruby/object:Gem::Version
|
|
90
|
+
version: '1.0'
|
|
91
|
+
type: :runtime
|
|
92
|
+
prerelease: false
|
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
94
|
+
requirements:
|
|
95
|
+
- - "~>"
|
|
96
|
+
- !ruby/object:Gem::Version
|
|
97
|
+
version: '1.0'
|
|
84
98
|
- !ruby/object:Gem::Dependency
|
|
85
99
|
name: json-schema
|
|
86
100
|
requirement: !ruby/object:Gem::Requirement
|