easol-canvas 4.8.2 → 4.12.1

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: 922b6f7386f5890d6f834a72d00be257fd0c0a6a0b74929afdf845b63acbe8be
4
- data.tar.gz: 43f6bc07a9c96089c08aa8db60961c6a80c54dcf51970a2b22a5a816c2700e54
3
+ metadata.gz: 6c045a4c9422791186853fbe0fef45a34ed99a0d95e9dc4ab36e25e36bcbf935
4
+ data.tar.gz: 54dac9fa1f74f703d79e8025ff1d10c32769b95e7bc6c818b9e999b7ac4fbb78
5
5
  SHA512:
6
- metadata.gz: 23ab85461fcc1bde043017f148e16a36b58a26f8e427d7e6cd2619c4ab06e261fa64bdebeaa0691cf86b53bb98368ad8eee9fc7e1ecdea67b0f81f4523441b0b
7
- data.tar.gz: 201db37864ff35a541f1975b88851678a3263a02f6e6ebb13d6329c9c3e90f6cf484560c368ee31f669705484e5553765f6f1d50088cc7edeae5fed25189bbf9
6
+ metadata.gz: a738edc0cce8108b9aa6aad452695b52a93ad1545c5d7ef193370b7e47d9f7235d066990baf6a14553bc929ca87d5ede7d0f409e7b357c3c74aabff9fbd980b9
7
+ data.tar.gz: 5dfe65957a4521bc12315f02a9bd94e82fbd21b3ec1f07f546e9643a72b0153fe6838d6624bdb2c153e202478bddeaaf1e424a8fd3fb35f33e728b79f8e9849f
@@ -43,8 +43,10 @@ module Canvas
43
43
  register_tag("variant_pricing", ::Liquid::Tag)
44
44
  register_tag("experience_slot_search", ::Liquid::Block)
45
45
  register_tag("experience_slot_calendar", ::Liquid::Block)
46
+ register_tag("package_availability", Liquid::Block)
46
47
  register_tag("input", ::Liquid::Tag)
47
48
  register_tag("label", ::Liquid::Tag)
49
+ register_tag("package_step_product_search", ::Liquid::Block)
48
50
  end
49
51
  end
50
52
  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.8.2"
4
+ VERSION = "4.12.1"
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.8.2
4
+ version: 4.12.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: 2024-03-18 00:00:00.000000000 Z
12
+ date: 2024-11-07 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.26
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