easol-canvas 4.9.0 → 4.13.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: 02c7027595d94a6bfb023221cf78d29ad95a0c8af74915beead506548629029b
4
- data.tar.gz: 90921f3ce7429d07a5369d9465f3c2f0186b5edeba0b3e3b378b8976cef91b0e
3
+ metadata.gz: 745819c9b700d8bfd3646c14cf840e09528fa3922513f5b345bd442aadb91e4a
4
+ data.tar.gz: 4bab5f5b7948113b827f1a0c2b30b84521e82538bc8d7ae8b636d3067601e602
5
5
  SHA512:
6
- metadata.gz: 4422e96232c787b1bc923e27d274d76e6072e68101bd8a9437b7ef90e378ad5d43b4584a1a5696b368e807cf6b6703ab15a80eb981514628e10375a2e8968d9a
7
- data.tar.gz: aa5b4215353c94c2c076e23c7664f860fa674772cae72db4a33a9ab58b4111c0b8f3c86ac7d398fe402070d3c4bf053426325dc5d67146586b84291e9b4cab53
6
+ metadata.gz: f4f907799ec76c0c0fcae318e1b4298b74d09feb371349f2f0f3152dc85aa74fd1798bc2004b1a36adfc7b3fabc40af2630c8bddb05bcb7393708d5fa9e79193
7
+ data.tar.gz: 3157b5688bc26b92c30a941fd24cd908e6383ef4ef814c93dfa52ff51f94424cce73dff3d68933d7fc5d4eec734b9c8838eac931ee31d5f7888bb458ef3e8c1f
@@ -44,8 +44,10 @@ module Canvas
44
44
  register_tag("experience_slot_search", ::Liquid::Block)
45
45
  register_tag("experience_slot_calendar", ::Liquid::Block)
46
46
  register_tag("package_availability", Liquid::Block)
47
+ register_tag("package_price", Liquid::Block)
47
48
  register_tag("input", ::Liquid::Tag)
48
49
  register_tag("label", ::Liquid::Tag)
50
+ register_tag("package_step_product_search", ::Liquid::Block)
49
51
  end
50
52
  end
51
53
  end
@@ -37,7 +37,7 @@ module Canvas
37
37
  "date" => SchemaAttribute::Date,
38
38
  "experience_date" => SchemaAttribute::ExperienceDate,
39
39
  "experience_slot" => SchemaAttribute::ExperienceSlot,
40
- "enquiry_form" => SchemaAttribute::Base,
40
+ "enquiry_form" => SchemaAttribute::EnquiryForm,
41
41
  }.freeze
42
42
  RESERVED_NAMES = %w[
43
43
  page
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Canvas
4
+ module Validator
5
+ class SchemaAttribute
6
+ # :documented:
7
+ # Attribute validations specific to enquiry form-type variables.
8
+ class EnquiryForm < Base
9
+ ALLOWED_DEFAULT_VALUES = %w[random].freeze
10
+
11
+ def validate
12
+ super &&
13
+ ensure_default_values_are_valid
14
+ end
15
+
16
+ private
17
+
18
+ def permitted_values_for_default_key
19
+ if attribute["array"]
20
+ Array
21
+ else
22
+ String
23
+ end
24
+ end
25
+
26
+ def ensure_default_values_are_valid
27
+ return true unless attribute.key?("default")
28
+
29
+ if attribute["array"]
30
+ attribute["default"].all? { |value| default_value_is_valid?(value) }
31
+ else
32
+ default_value_is_valid?(attribute["default"])
33
+ end
34
+ end
35
+
36
+ def default_value_is_valid?(value)
37
+ value = value.downcase
38
+ if !ALLOWED_DEFAULT_VALUES.include?(value)
39
+ @errors << "\"default\" for enquiry form-type variables must be "\
40
+ "one of: #{ALLOWED_DEFAULT_VALUES.join(', ')}"
41
+ false
42
+ else
43
+ true
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Canvas
4
- VERSION = "4.9.0"
4
+ VERSION = "4.13.0"
5
5
  end
@@ -46,7 +46,11 @@
46
46
  "elements": {
47
47
  "type": "array",
48
48
  "items": {
49
- "oneOf": [{ "type": "string" }, { "$ref": "#/$defs/attribute" }]
49
+ "oneOf": [
50
+ { "type": "string" },
51
+ { "$ref": "#/$defs/accordion_toggle" },
52
+ { "$ref": "#/$defs/attribute" }
53
+ ]
50
54
  }
51
55
  }
52
56
  }
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.9.0
4
+ version: 4.13.0
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: 2024-04-29 00:00:00.000000000 Z
12
+ date: 2024-11-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
@@ -140,6 +140,7 @@ files:
140
140
  - lib/canvas/validators/schema_attributes/base.rb
141
141
  - lib/canvas/validators/schema_attributes/color.rb
142
142
  - lib/canvas/validators/schema_attributes/date.rb
143
+ - lib/canvas/validators/schema_attributes/enquiry_form.rb
143
144
  - lib/canvas/validators/schema_attributes/experience_date.rb
144
145
  - lib/canvas/validators/schema_attributes/experience_slot.rb
145
146
  - lib/canvas/validators/schema_attributes/image.rb
@@ -175,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
175
176
  - !ruby/object:Gem::Version
176
177
  version: '0'
177
178
  requirements: []
178
- rubygems_version: 3.3.27
179
+ rubygems_version: 3.4.19
179
180
  signing_key:
180
181
  specification_version: 4
181
182
  summary: CLI to help with building themes for Easol