From 5b83adf751b4bb29dc4eca984e764bed62b6280f Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Fri, 16 Jun 2023 14:04:42 -0400 Subject: [PATCH 1/5] Accessibility Traits Coddle --- .../Atomic/Atoms/Views/Label/Label.swift | 3 + .../Atomic/Atoms/Views/Label/LabelModel.swift | 4 + .../UIAccessibilityTraits+Codable.swift | 125 ++++++++++++++++++ 3 files changed, 132 insertions(+) create mode 100644 MVMCoreUI/Atomic/Extensions/UIAccessibilityTraits+Codable.swift diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift index 62dab9c2..01614f31 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift @@ -276,6 +276,9 @@ public typealias ActionBlock = () -> () guard let labelModel = model as? LabelModel else { return } text = labelModel.text + if let accessibilityTraits = labelModel.accessibilityTraits { + self.accessibilityTraits = accessibilityTraits + } resetAttributeStyle() diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/LabelModel.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/LabelModel.swift index d1995d19..70f1cc62 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/LabelModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/LabelModel.swift @@ -28,6 +28,7 @@ public var makeWholeViewClickable: Bool? public var numberOfLines: Int? public var shouldMaskRecordedView: Bool? = false + public var accessibilityTraits: UIAccessibilityTraits? //-------------------------------------------------- // MARK: - Keys @@ -50,6 +51,7 @@ case makeWholeViewClickable case numberOfLines case shouldMaskRecordedView + case accessibilityTraits } enum AttributeTypeKey: String, CodingKey { @@ -96,6 +98,7 @@ makeWholeViewClickable = try typeContainer.decodeIfPresent(Bool.self, forKey: .makeWholeViewClickable) numberOfLines = try typeContainer.decodeIfPresent(Int.self, forKey: .numberOfLines) shouldMaskRecordedView = try typeContainer.decodeIfPresent(Bool.self, forKey: .shouldMaskRecordedView) ?? false + accessibilityTraits = try typeContainer.decodeIfPresent(UIAccessibilityTraits.self, forKey: .accessibilityTraits) // Later make protocol based validate outside of decoding? if let attributes = attributes { @@ -121,5 +124,6 @@ try container.encodeIfPresent(makeWholeViewClickable, forKey: .makeWholeViewClickable) try container.encodeIfPresent(numberOfLines, forKey: .numberOfLines) try container.encodeIfPresent(shouldMaskRecordedView, forKey: .shouldMaskRecordedView) + try container.encodeIfPresent(accessibilityTraits, forKey: .accessibilityTraits) } } diff --git a/MVMCoreUI/Atomic/Extensions/UIAccessibilityTraits+Codable.swift b/MVMCoreUI/Atomic/Extensions/UIAccessibilityTraits+Codable.swift new file mode 100644 index 00000000..4eb1ea2a --- /dev/null +++ b/MVMCoreUI/Atomic/Extensions/UIAccessibilityTraits+Codable.swift @@ -0,0 +1,125 @@ +// +// UIAccessibilityTraits+Codable.swift +// MVMCoreUI +// +// Created by Scott Pfeil on 6/16/23. +// Copyright © 2023 Verizon Wireless. All rights reserved. +// + +import Foundation + +extension UIAccessibilityTraits: Codable { + private static func trait(from string: String) throws -> UIAccessibilityTraits { + switch string { + case "none": + return .none + case "button": + return .button + case "link": + return .link + case "image": + return .image + case "searchField": + return .searchField + case "keyboardKey": + return .keyboardKey + case "staticText": + return .staticText + case "header": + return .header + case "tabBar": + return .tabBar + case "summaryElement": + return .summaryElement + case "selected": + return .selected + case "notEnabled": + return .notEnabled + case "adjustable": + return .adjustable + case "allowsDirectInteraction": + return .allowsDirectInteraction + case "updatesFrequently": + return .updatesFrequently + case "causesPageTurn": + return .causesPageTurn + case "playsSound": + return .playsSound + case "startsMediaSession": + return .startsMediaSession + default: + throw ModelRegistry.Error.decoderOther(message: "Unsupported accessibility trait: \(string)") + } + } + + public init(from decoder: Decoder) throws { + var container = try decoder.unkeyedContainer() + + // Iterate and decode each. + var accessibilityTrait: UIAccessibilityTraits = [] + while !container.isAtEnd { + let traitString = try container.decode(String.self) + let trait = try UIAccessibilityTraits.trait(from: traitString) + accessibilityTrait.insert(trait) + } + self = accessibilityTrait + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.unkeyedContainer() + if self.contains(.none) { + try container.encode("none") + } + if self.contains(.button) { + try container.encode("button") + } + if self.contains(.link) { + try container.encode("link") + } + if self.contains(.image) { + try container.encode("image") + } + if self.contains(.searchField) { + try container.encode("searchField") + } + if self.contains(.keyboardKey) { + try container.encode("keyboardKey") + } + if self.contains(.staticText) { + try container.encode("staticText") + } + if self.contains(.header) { + try container.encode("header") + } + if self.contains(.tabBar) { + try container.encode("tabBar") + } + if self.contains(.summaryElement) { + try container.encode("summaryElement") + } + if self.contains(.selected) { + try container.encode("selected") + } + if self.contains(.notEnabled) { + try container.encode("notEnabled") + } + if self.contains(.adjustable) { + try container.encode("adjustable") + } + if self.contains(.allowsDirectInteraction) { + try container.encode("allowsDirectInteraction") + } + if self.contains(.updatesFrequently) { + try container.encode("updatesFrequently") + } + if self.contains(.causesPageTurn) { + try container.encode("causesPageTurn") + } + if self.contains(.playsSound) { + try container.encode("playsSound") + } + if self.contains(.startsMediaSession) { + try container.encode("startsMediaSession") + } + } +} From 396635eee8a7cb4203b3842fae1d959f712dc43f Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Fri, 16 Jun 2023 14:10:04 -0400 Subject: [PATCH 2/5] Adding header example --- .../Headers/H2/HeadersH2NoButtonsBodyTextModel.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2NoButtonsBodyTextModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2NoButtonsBodyTextModel.swift index 96d30730..2a7994dd 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2NoButtonsBodyTextModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2NoButtonsBodyTextModel.swift @@ -33,6 +33,9 @@ public class HeadersH2NoButtonsBodyTextModel: HeaderModel, MoleculeModelProtocol if bottomPadding == nil { bottomPadding = Padding.Component.VerticalMarginSpacing } + if headlineBody.headline?.accessibilityTraits == nil { + headlineBody.headline?.accessibilityTraits = .header + } super.setDefaults() } From 89a87d597fcc4afb67612acd4da8c5b9e7bb32e0 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Tue, 27 Jun 2023 15:38:59 -0400 Subject: [PATCH 3/5] proj file --- MVMCoreUI.xcodeproj/project.pbxproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 0f339285..645d162f 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -288,6 +288,7 @@ AF1C33732885D481006B1001 /* MVMCoreUIActionOpenPageHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF1C33722885D481006B1001 /* MVMCoreUIActionOpenPageHandler.swift */; }; AF60A7F62892D2E300919EEB /* ActionDismissNotificationModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF60A7F52892D2E300919EEB /* ActionDismissNotificationModel.swift */; }; AF60A7F82892D34D00919EEB /* ActionDismissNotificationHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF60A7F72892D34D00919EEB /* ActionDismissNotificationHandler.swift */; }; + AF766D262A3CD4C600749099 /* UIAccessibilityTraits+Codable.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF766D252A3CD4C600749099 /* UIAccessibilityTraits+Codable.swift */; }; AF7E509829E477C1009DC2AD /* AlertHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF7E509629E477C0009DC2AD /* AlertHandler.swift */; }; AF7E509929E477C1009DC2AD /* AlertController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF7E509729E477C0009DC2AD /* AlertController.swift */; }; AFA4932029E5CA73001A9663 /* AlertOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFA4931F29E5CA73001A9663 /* AlertOperation.swift */; }; @@ -895,6 +896,7 @@ AF1C33722885D481006B1001 /* MVMCoreUIActionOpenPageHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MVMCoreUIActionOpenPageHandler.swift; sourceTree = ""; }; AF60A7F52892D2E300919EEB /* ActionDismissNotificationModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionDismissNotificationModel.swift; sourceTree = ""; }; AF60A7F72892D34D00919EEB /* ActionDismissNotificationHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionDismissNotificationHandler.swift; sourceTree = ""; }; + AF766D252A3CD4C600749099 /* UIAccessibilityTraits+Codable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIAccessibilityTraits+Codable.swift"; sourceTree = ""; }; AF7E509629E477C0009DC2AD /* AlertHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AlertHandler.swift; sourceTree = ""; }; AF7E509729E477C0009DC2AD /* AlertController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AlertController.swift; sourceTree = ""; }; AFA4931F29E5CA73001A9663 /* AlertOperation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertOperation.swift; sourceTree = ""; }; @@ -1623,6 +1625,7 @@ EA985C862981AB0F00F2FF2E /* VDS-Tilelet+Codable.swift */, EA985C882981AB7100F2FF2E /* VDS-TextStyle.swift */, EA985C8A2983259900F2FF2E /* VDS-LabelAttributeModel.swift */, + AF766D252A3CD4C600749099 /* UIAccessibilityTraits+Codable.swift */, ); path = Extensions; sourceTree = ""; @@ -2916,6 +2919,7 @@ 0A7EF86723D8B0AE00B2AAD1 /* DateDropdownEntryFieldModel.swift in Sources */, 444FB7C32821B76B00DFE692 /* TitleLockupModel.swift in Sources */, D29C94D5242901C9003813BA /* MVMCoreUICommonViewsUtility+Extension.swift in Sources */, + AF766D262A3CD4C600749099 /* UIAccessibilityTraits+Codable.swift in Sources */, D260105323CEA61600764D80 /* ToggleModel.swift in Sources */, 014AA72523C501E2006F3E93 /* ContainerModel.swift in Sources */, 0A7EF86523D8AFFF00B2AAD1 /* ItemDropdownEntryFieldModel.swift in Sources */, From ad0087b88a2993645856bf8e742f12d6f83395fe Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Mon, 31 Jul 2023 14:33:20 -0400 Subject: [PATCH 4/5] Header traits --- .../Headers/H1/HeadersH1ButtonModel.swift | 18 +++++++++++++++++- .../H1/HeadersH1LandingPageHeaderModel.swift | 17 ++++++++++++++++- .../H1/HeadersH1NoButtonsBodyTextModel.swift | 17 ++++++++++++++++- .../Headers/H2/HeadersH2ButtonsModel.swift | 9 ++++++++- .../Headers/H2/HeadersH2CaretLinkModel.swift | 9 ++++++++- .../Headers/H2/HeadersH2LinkModel.swift | 9 ++++++++- .../H2/HeadersH2NoButtonsBodyTextModel.swift | 6 +++++- .../H2/HeadersH2PricingTwoRowsModel.swift | 9 ++++++++- .../Headers/H2/HeadersH2TinyButtonModel.swift | 9 ++++++++- ...eColumnFullWidthTextDividerSubsection.swift | 1 + ...mnFullWidthTextDividerSubsectionModel.swift | 6 +++++- ...eColumnTextWithWhitespaceDividerShort.swift | 1 + ...mnTextWithWhitespaceDividerShortModel.swift | 6 +++++- ...neColumnTextWithWhitespaceDividerTall.swift | 1 + ...umnTextWithWhitespaceDividerTallModel.swift | 6 +++++- 15 files changed, 112 insertions(+), 12 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1ButtonModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1ButtonModel.swift index 25f59539..cdb61a4d 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1ButtonModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1ButtonModel.swift @@ -7,7 +7,8 @@ // -public class HeadersH1ButtonModel: HeaderModel, MoleculeModelProtocol { +public class HeadersH1ButtonModel: HeaderModel, MoleculeModelProtocol, ParentMoleculeModelProtocol { + //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- @@ -15,6 +16,10 @@ public class HeadersH1ButtonModel: HeaderModel, MoleculeModelProtocol { public var headlineBody: HeadlineBodyModel public var buttons: TwoButtonViewModel + public var children: [MoleculeModelProtocol] { + [headlineBody, buttons] + } + //-------------------------------------------------- // MARK: - Initializer //-------------------------------------------------- @@ -25,6 +30,17 @@ public class HeadersH1ButtonModel: HeaderModel, MoleculeModelProtocol { super.init() } + //-------------------------------------------------- + // MARK: - Subclass + //-------------------------------------------------- + + public override func setDefaults() { + if headlineBody.headline?.accessibilityTraits == nil { + headlineBody.headline?.accessibilityTraits = .header + } + super.setDefaults() + } + //-------------------------------------------------- // MARK: - Keys //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1LandingPageHeaderModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1LandingPageHeaderModel.swift index d7603886..79705fd9 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1LandingPageHeaderModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1LandingPageHeaderModel.swift @@ -8,7 +8,7 @@ import Foundation -public class HeadersH1LandingPageHeaderModel: HeaderModel, MoleculeModelProtocol { +public class HeadersH1LandingPageHeaderModel: HeaderModel, MoleculeModelProtocol, ParentMoleculeModelProtocol { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- @@ -20,6 +20,10 @@ public class HeadersH1LandingPageHeaderModel: HeaderModel, MoleculeModelProtocol public var link: LinkModel public var buttons: TwoButtonViewModel + public var children: [MoleculeModelProtocol] { + [headline, headline2, subHeadline, body, link, buttons] + } + //-------------------------------------------------- // MARK: - Initializer //-------------------------------------------------- @@ -32,6 +36,17 @@ public class HeadersH1LandingPageHeaderModel: HeaderModel, MoleculeModelProtocol self.buttons = buttons super.init() } + + //-------------------------------------------------- + // MARK: - Subclass + //-------------------------------------------------- + + public override func setDefaults() { + if headline.accessibilityTraits == nil { + headline.accessibilityTraits = .header + } + super.setDefaults() + } //-------------------------------------------------- // MARK: - Keys diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonsBodyTextModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonsBodyTextModel.swift index 864d88f1..9d246d98 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonsBodyTextModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonsBodyTextModel.swift @@ -8,7 +8,7 @@ -public class HeadersH1NoButtonsBodyTextModel: HeaderModel, MoleculeModelProtocol { +public class HeadersH1NoButtonsBodyTextModel: HeaderModel, MoleculeModelProtocol, ParentMoleculeModelProtocol { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- @@ -16,6 +16,10 @@ public class HeadersH1NoButtonsBodyTextModel: HeaderModel, MoleculeModelProtocol public static var identifier: String = "headerH1" public var headlineBody: HeadlineBodyModel + public var children: [MoleculeModelProtocol] { + [headlineBody] + } + //-------------------------------------------------- // MARK: - Initializer //-------------------------------------------------- @@ -25,6 +29,17 @@ public class HeadersH1NoButtonsBodyTextModel: HeaderModel, MoleculeModelProtocol super.init() } + //-------------------------------------------------- + // MARK: - Subclass + //-------------------------------------------------- + + public override func setDefaults() { + if headlineBody.headline?.accessibilityTraits == nil { + headlineBody.headline?.accessibilityTraits = .header + } + super.setDefaults() + } + //-------------------------------------------------- // MARK: - Keys //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2ButtonsModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2ButtonsModel.swift index d3ea7497..77bc25c1 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2ButtonsModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2ButtonsModel.swift @@ -9,7 +9,7 @@ import Foundation -public class HeadersH2ButtonsModel: HeaderModel, MoleculeModelProtocol { +public class HeadersH2ButtonsModel: HeaderModel, MoleculeModelProtocol, ParentMoleculeModelProtocol { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- @@ -18,6 +18,10 @@ public class HeadersH2ButtonsModel: HeaderModel, MoleculeModelProtocol { public var headlineBody: HeadlineBodyModel public var buttons: TwoButtonViewModel + public var children: [MoleculeModelProtocol] { + [headlineBody, buttons] + } + //-------------------------------------------------- // MARK: - Initializer //-------------------------------------------------- @@ -39,6 +43,9 @@ public class HeadersH2ButtonsModel: HeaderModel, MoleculeModelProtocol { if bottomPadding == nil { bottomPadding = Padding.Component.VerticalMarginSpacing } + if headlineBody.headline?.accessibilityTraits == nil { + headlineBody.headline?.accessibilityTraits = .header + } super.setDefaults() } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2CaretLinkModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2CaretLinkModel.swift index 9d56118e..e0831a40 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2CaretLinkModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2CaretLinkModel.swift @@ -7,7 +7,7 @@ // import Foundation -public class HeadersH2CaretLinkModel: HeaderModel, MoleculeModelProtocol { +public class HeadersH2CaretLinkModel: HeaderModel, MoleculeModelProtocol, ParentMoleculeModelProtocol { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- @@ -15,6 +15,10 @@ public class HeadersH2CaretLinkModel: HeaderModel, MoleculeModelProtocol { public var headlineBody: HeadlineBodyModel public var caretLink: CaretLinkModel + public var children: [MoleculeModelProtocol] { + [headlineBody, caretLink] + } + //-------------------------------------------------- // MARK: - Initializer //-------------------------------------------------- @@ -34,6 +38,9 @@ public class HeadersH2CaretLinkModel: HeaderModel, MoleculeModelProtocol { if bottomPadding == nil { bottomPadding = Padding.Component.VerticalMarginSpacing } + if headlineBody.headline?.accessibilityTraits == nil { + headlineBody.headline?.accessibilityTraits = .header + } super.setDefaults() } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2LinkModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2LinkModel.swift index 66189f99..20d6afe2 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2LinkModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2LinkModel.swift @@ -8,7 +8,7 @@ import Foundation -public class HeadersH2LinkModel: HeaderModel, MoleculeModelProtocol { +public class HeadersH2LinkModel: HeaderModel, MoleculeModelProtocol, ParentMoleculeModelProtocol { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- @@ -17,6 +17,10 @@ public class HeadersH2LinkModel: HeaderModel, MoleculeModelProtocol { public var headlineBody: HeadlineBodyModel public var link: LinkModel + public var children: [MoleculeModelProtocol] { + [headlineBody, link] + } + //-------------------------------------------------- // MARK: - Initializer //-------------------------------------------------- @@ -38,6 +42,9 @@ public class HeadersH2LinkModel: HeaderModel, MoleculeModelProtocol { if bottomPadding == nil { bottomPadding = Padding.Component.VerticalMarginSpacing } + if headlineBody.headline?.accessibilityTraits == nil { + headlineBody.headline?.accessibilityTraits = .header + } super.setDefaults() } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2NoButtonsBodyTextModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2NoButtonsBodyTextModel.swift index 2a7994dd..86d38707 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2NoButtonsBodyTextModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2NoButtonsBodyTextModel.swift @@ -9,7 +9,7 @@ import Foundation -public class HeadersH2NoButtonsBodyTextModel: HeaderModel, MoleculeModelProtocol { +public class HeadersH2NoButtonsBodyTextModel: HeaderModel, MoleculeModelProtocol, ParentMoleculeModelProtocol { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- @@ -17,6 +17,10 @@ public class HeadersH2NoButtonsBodyTextModel: HeaderModel, MoleculeModelProtocol public static var identifier: String = "headerH2" public var headlineBody: HeadlineBodyModel + public var children: [MoleculeModelProtocol] { + [headlineBody] + } + //-------------------------------------------------- // MARK: - Initializer //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRowsModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRowsModel.swift index 5ca1eae1..ebca7e25 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRowsModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRowsModel.swift @@ -8,7 +8,7 @@ import Foundation -public class HeadersH2PricingTwoRowsModel: HeaderModel, MoleculeModelProtocol { +public class HeadersH2PricingTwoRowsModel: HeaderModel, MoleculeModelProtocol, ParentMoleculeModelProtocol { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- @@ -21,6 +21,10 @@ public class HeadersH2PricingTwoRowsModel: HeaderModel, MoleculeModelProtocol { public var body3: LabelModel public var subBody3: LabelModel? + public var children: [MoleculeModelProtocol] { + [headline, body, subBody, body2, subBody2, body3, subBody3].compactMap({$0}) + } + //-------------------------------------------------- // MARK: - Initializer //-------------------------------------------------- @@ -45,6 +49,9 @@ public class HeadersH2PricingTwoRowsModel: HeaderModel, MoleculeModelProtocol { if bottomPadding == nil { bottomPadding = Padding.Component.VerticalMarginSpacing } + if headline.accessibilityTraits == nil { + headline.accessibilityTraits = .header + } super.setDefaults() subBody?.attributes = [LabelAttributeStrikeThroughModel(0, subBody?.text.count ?? 0)] subBody2?.attributes = [LabelAttributeStrikeThroughModel(0, subBody2?.text.count ?? 0)] diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2TinyButtonModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2TinyButtonModel.swift index ce27740b..e04ab07f 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2TinyButtonModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2TinyButtonModel.swift @@ -9,7 +9,7 @@ import Foundation -public class HeadersH2TinyButtonModel: HeaderModel, MoleculeModelProtocol { +public class HeadersH2TinyButtonModel: HeaderModel, MoleculeModelProtocol, ParentMoleculeModelProtocol { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- @@ -18,6 +18,10 @@ public class HeadersH2TinyButtonModel: HeaderModel, MoleculeModelProtocol { public var headlineBody: HeadlineBodyModel public var button: ButtonModel + public var children: [MoleculeModelProtocol] { + [headlineBody, button] + } + //-------------------------------------------------- // MARK: - Initializer //-------------------------------------------------- @@ -39,6 +43,9 @@ public class HeadersH2TinyButtonModel: HeaderModel, MoleculeModelProtocol { if bottomPadding == nil { bottomPadding = Padding.Component.VerticalMarginSpacing } + if headlineBody.headline?.accessibilityTraits == nil { + headlineBody.headline?.accessibilityTraits = .header + } super.setDefaults() button.style = .secondary button.size = .small diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift index 3f48c3d8..b73b7129 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift @@ -84,5 +84,6 @@ import Foundation } accessibilityLabel = message + accessibilityTraits.update(with: .header) } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnFullWidthTextDividerSubsectionModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnFullWidthTextDividerSubsectionModel.swift index 5040fbd4..8a039144 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnFullWidthTextDividerSubsectionModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnFullWidthTextDividerSubsectionModel.swift @@ -9,7 +9,7 @@ import Foundation -public class ListOneColumnFullWidthTextDividerSubsectionModel: ListItemModel, MoleculeModelProtocol { +public class ListOneColumnFullWidthTextDividerSubsectionModel: ListItemModel, MoleculeModelProtocol, ParentMoleculeModelProtocol { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- @@ -18,6 +18,10 @@ public class ListOneColumnFullWidthTextDividerSubsectionModel: ListItemModel, Mo public var headline: LabelModel public var body: LabelModel? + public var children: [MoleculeModelProtocol] { + [headline, body].compactMap({$0}) + } + //-------------------------------------------------- // MARK: - Initializer //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShort.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShort.swift index 2f023b78..72dc78c0 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShort.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShort.swift @@ -84,5 +84,6 @@ import Foundation } accessibilityLabel = message + accessibilityTraits.update(with: .header) } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShortModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShortModel.swift index 66025760..6a40ebf7 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShortModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShortModel.swift @@ -9,7 +9,7 @@ import Foundation -public class ListOneColumnTextWithWhitespaceDividerShortModel: ListItemModel, MoleculeModelProtocol { +public class ListOneColumnTextWithWhitespaceDividerShortModel: ListItemModel, MoleculeModelProtocol, ParentMoleculeModelProtocol { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- @@ -18,6 +18,10 @@ public class ListOneColumnTextWithWhitespaceDividerShortModel: ListItemModel, Mo public var headline: LabelModel public var body: LabelModel? + public var children: [MoleculeModelProtocol] { + [headline, body].compactMap({$0}) + } + //-------------------------------------------------- // MARK: - Initializer //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift index 772ec5ac..169c33c9 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift @@ -84,5 +84,6 @@ import Foundation } accessibilityLabel = message + accessibilityTraits.update(with: .header) } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerTallModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerTallModel.swift index c713b0d2..09b462fe 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerTallModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerTallModel.swift @@ -9,7 +9,7 @@ import Foundation -public class ListOneColumnTextWithWhitespaceDividerTallModel: ListItemModel, MoleculeModelProtocol { +public class ListOneColumnTextWithWhitespaceDividerTallModel: ListItemModel, MoleculeModelProtocol, ParentMoleculeModelProtocol { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- @@ -18,6 +18,10 @@ public class ListOneColumnTextWithWhitespaceDividerTallModel: ListItemModel, Mol public var headline: LabelModel public var body: LabelModel? + public var children: [MoleculeModelProtocol] { + [headline, body].compactMap({$0}) + } + //-------------------------------------------------- // MARK: - Initializer //-------------------------------------------------- From d02b346d39589cd5edd1725159502e63eb4027e6 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Mon, 31 Jul 2023 15:00:41 -0400 Subject: [PATCH 5/5] update dependency --- Scripts/download_dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/download_dependencies.sh b/Scripts/download_dependencies.sh index ec05cfd8..ecfdb627 100755 --- a/Scripts/download_dependencies.sh +++ b/Scripts/download_dependencies.sh @@ -22,6 +22,6 @@ fi ./Scripts/download_framework.sh $ARTIFACTORY_URL "$FRAMEWORKS_DIR/VDS.xcframework" BPHV_MobileFirst_IOS/com/vzw/hss/myverizon/VDS/1.0/VDS-1.0-Debug-SNAPSHOT.zip -./Scripts/download_framework.sh $ARTIFACTORY_URL "$FRAMEWORKS_DIR/VDSColorTokens.xcframework" GVJV_VDS_Maven/@vds-tokens/ios/VDSColorTokens.1.0.6.xcframework.zip +./Scripts/download_framework.sh $ARTIFACTORY_URL "$FRAMEWORKS_DIR/VDSColorTokens.xcframework" GVJV_VDS_Maven/@vds-tokens/ios/VDSColorTokens.2.0.0.xcframework.zip ./Scripts/download_framework.sh $ARTIFACTORY_URL "$FRAMEWORKS_DIR/VDSFormControlsTokens.xcframework" GVJV_VDS_Maven/@vds-tokens/ios/VDSFormControlsTokens.1.0.7.xcframework.zip