easol-canvas 4.9.0 → 4.12.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 02c7027595d94a6bfb023221cf78d29ad95a0c8af74915beead506548629029b
4
- data.tar.gz: 90921f3ce7429d07a5369d9465f3c2f0186b5edeba0b3e3b378b8976cef91b0e
3
+ metadata.gz: 6c045a4c9422791186853fbe0fef45a34ed99a0d95e9dc4ab36e25e36bcbf935
4
+ data.tar.gz: 54dac9fa1f74f703d79e8025ff1d10c32769b95e7bc6c818b9e999b7ac4fbb78
5
5
  SHA512:
6
- metadata.gz: 4422e96232c787b1bc923e27d274d76e6072e68101bd8a9437b7ef90e378ad5d43b4584a1a5696b368e807cf6b6703ab15a80eb981514628e10375a2e8968d9a
7
- data.tar.gz: aa5b4215353c94c2c076e23c7664f860fa674772cae72db4a33a9ab58b4111c0b8f3c86ac7d398fe402070d3c4bf053426325dc5d67146586b84291e9b4cab53
6
+ metadata.gz: a738edc0cce8108b9aa6aad452695b52a93ad1545c5d7ef193370b7e47d9f7235d066990baf6a14553bc929ca87d5ede7d0f409e7b357c3c74aabff9fbd980b9
7
+ data.tar.gz: 5dfe65957a4521bc12315f02a9bd94e82fbd21b3ec1f07f546e9643a72b0153fe6838d6624bdb2c153e202478bddeaaf1e424a8fd3fb35f33e728b79f8e9849f
@@ -46,6 +46,7 @@ module Canvas
46
46
  register_tag("package_availability", Liquid::Block)
47
47
  register_tag("input", ::Liquid::Tag)
48
48
  register_tag("label", ::Liquid::Tag)
49
+ register_tag("package_step_product_search", ::Liquid::Block)
49
50
  end
50
51
  end
51
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.9.0"
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.9.0
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-04-29 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.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