diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index cfe08ede..3433e17b 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -743,7 +743,6 @@ 0AE98BB423FF18D2004C5109 /* Arrow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Arrow.swift; sourceTree = ""; }; 0AE98BB623FF18E9004C5109 /* ArrowModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrowModel.swift; sourceTree = ""; }; 0AF60F0826B3316E00AC3DB4 /* MVMCoreUIUtility+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MVMCoreUIUtility+Extension.swift"; sourceTree = ""; }; - 187FEB292844D2A600BF29C2 /* VDSFormControlsTokens.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = VDSFormControlsTokens.xcframework; path = ../SharedFrameworks/VDSFormControlsTokens.xcframework; sourceTree = ""; }; 1D6D258626899B0B00DEBB08 /* ImageButtonModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ImageButtonModel.swift; path = MVMCoreUI/Atomic/Atoms/Buttons/ImageButtonModel.swift; sourceTree = SOURCE_ROOT; }; 1D6D258726899B0B00DEBB08 /* ImageButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ImageButton.swift; path = MVMCoreUI/Atomic/Atoms/Buttons/ImageButton.swift; sourceTree = SOURCE_ROOT; }; 22B678F829E7944E00CF4196 /* GetNotificationAuthStatusBehavior.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GetNotificationAuthStatusBehavior.swift; sourceTree = ""; }; @@ -923,7 +922,6 @@ AFA4932129E5EF2E001A9663 /* NotificationHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationHandler.swift; sourceTree = ""; }; AFA4933E29E874F0001A9663 /* MVMCoreUILoggingDelegateProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MVMCoreUILoggingDelegateProtocol.swift; sourceTree = ""; }; AFA4935629EE3DCC001A9663 /* AlertDelegateProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertDelegateProtocol.swift; sourceTree = ""; }; - AFE4A1D027DFB5EE00C458D0 /* VDSColorTokens.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = VDSColorTokens.xcframework; path = ../SharedFrameworks/VDSColorTokens.xcframework; sourceTree = ""; }; AFE4A1D527DFBB6F00C458D0 /* UINavigationController+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UINavigationController+Extension.swift"; sourceTree = ""; }; B4CC8FBC29DF34680005D28B /* Badge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Badge.swift; sourceTree = ""; }; B4CC8FBE29DF34730005D28B /* BadgeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BadgeModel.swift; sourceTree = ""; }; @@ -1216,7 +1214,6 @@ EA985C3D2970938F00F2FF2E /* Tilelet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tilelet.swift; sourceTree = ""; }; EA985C3F2970939A00F2FF2E /* TileletModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TileletModel.swift; sourceTree = ""; }; EA985C5F2970A3F000F2FF2E /* VDS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = VDS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - EA985C632970A40E00F2FF2E /* VDSTypographyTokens.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = VDSTypographyTokens.xcframework; path = ../SharedFrameworks/VDSTypographyTokens.xcframework; sourceTree = ""; }; EA985C842981AA9C00F2FF2E /* VDS-Enums+Codable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "VDS-Enums+Codable.swift"; sourceTree = ""; }; EA985C862981AB0F00F2FF2E /* VDS-Tilelet+Codable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "VDS-Tilelet+Codable.swift"; sourceTree = ""; }; EA985C882981AB7100F2FF2E /* VDS-TextStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "VDS-TextStyle.swift"; sourceTree = ""; }; @@ -2144,10 +2141,7 @@ children = ( AF1CEFE72BEA73890001F9A5 /* VDSCoreTokens.xcframework */, EAD715A92BBC8FAF00DEDA6A /* VDSTokens.xcframework */, - EA985C632970A40E00F2FF2E /* VDSTypographyTokens.xcframework */, EA985C5F2970A3F000F2FF2E /* VDS.framework */, - 187FEB292844D2A600BF29C2 /* VDSFormControlsTokens.xcframework */, - AFE4A1D027DFB5EE00C458D0 /* VDSColorTokens.xcframework */, D29DF0E521E4F3C7003B2FB9 /* MVMCore.framework */, ); name = Frameworks; diff --git a/MVMCoreUI/Atomic/Atoms/Views/TileletModel.swift b/MVMCoreUI/Atomic/Atoms/Views/TileletModel.swift index 383c03c2..cf5d382b 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/TileletModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/TileletModel.swift @@ -58,7 +58,7 @@ open class TileletModel: TileContainerBaseModel, Molec textPercentage = try container.decodeIfPresent(CGFloat.self, forKey: .textPercentage) if let color = eyebrow?.textColor?.uiColor { - self.eyebrowColor = .custom(color, color) + self.eyebrowColor = .custom(color) } else if let eyebrowColor = try? container.decodeIfPresent(TitleLockup.TextColor.self, forKey: .eyebrowColor) { self.eyebrowColor = eyebrowColor @@ -68,7 +68,7 @@ open class TileletModel: TileContainerBaseModel, Molec } if let color = title?.textColor?.uiColor { - self.titleColor = .custom(color, color) + self.titleColor = .custom(color) } else if let titleColor = try? container.decodeIfPresent(TitleLockup.TitleTextColor.self, forKey: .titleColor) { self.titleColor = titleColor @@ -78,7 +78,7 @@ open class TileletModel: TileContainerBaseModel, Molec } if let color = subTitle?.textColor?.uiColor { - self.subTitleColor = .custom(color, color) + self.subTitleColor = .custom(color) } else if let subTitleColor = try? container.decodeIfPresent(TitleLockup.TextColor.self, forKey: .subTitleColor) { self.subTitleColor = subTitleColor diff --git a/MVMCoreUI/Atomic/Extensions/VDS-Enums+Codable.swift b/MVMCoreUI/Atomic/Extensions/VDS-Enums+Codable.swift index defa925f..f4eb5500 100644 --- a/MVMCoreUI/Atomic/Extensions/VDS-Enums+Codable.swift +++ b/MVMCoreUI/Atomic/Extensions/VDS-Enums+Codable.swift @@ -197,8 +197,7 @@ extension VDS.TitleLockup.TextColor: Codable { enum CodingKeys: String, CodingKey { case type - case lightColor - case darkColor + case color } enum CustomColorType: String, Codable { @@ -217,9 +216,8 @@ extension VDS.TitleLockup.TextColor: Codable { case .secondary: self = .secondary case .custom: - let lightColor = try container.decode(Color.self, forKey: .lightColor) - let darkColor = try container.decode(Color.self, forKey: .darkColor) - self = .custom(lightColor.uiColor, darkColor.uiColor) + let color = try container.decode(Color.self, forKey: .color) + self = .custom(color.uiColor) } } @@ -230,11 +228,10 @@ extension VDS.TitleLockup.TextColor: Codable { try container.encode(CustomColorType.primary.rawValue, forKey: .type) case .secondary: try container.encode(CustomColorType.secondary.rawValue, forKey: .type) - case .custom(let lightColor, let darkColor): + case .custom(let color): try container.encode(CustomColorType.custom.rawValue, forKey: .type) - try container.encode(Color(uiColor: lightColor), forKey: .lightColor) - try container.encode(Color(uiColor: darkColor), forKey: .darkColor) - @unknown default: + try container.encode(Color(uiColor: color), forKey: .color) + default: break } } @@ -244,8 +241,7 @@ extension VDS.TitleLockup.TitleTextColor: Codable { enum CodingKeys: String, CodingKey { case type - case lightColor - case darkColor + case color } enum CustomColorType: String, Codable { @@ -261,9 +257,8 @@ extension VDS.TitleLockup.TitleTextColor: Codable { case .primary: self = .primary case .custom: - let lightColor = try container.decode(Color.self, forKey: .lightColor) - let darkColor = try container.decode(Color.self, forKey: .darkColor) - self = .custom(lightColor.uiColor, darkColor.uiColor) + let color = try container.decode(Color.self, forKey: .color) + self = .custom(color.uiColor) } } @@ -272,11 +267,10 @@ extension VDS.TitleLockup.TitleTextColor: Codable { switch self { case .primary: try container.encode(CustomColorType.primary.rawValue, forKey: .type) - case .custom(let lightColor, let darkColor): + case .custom(let color): try container.encode(CustomColorType.custom.rawValue, forKey: .type) - try container.encode(Color(uiColor: lightColor), forKey: .lightColor) - try container.encode(Color(uiColor: darkColor), forKey: .darkColor) - @unknown default: + try container.encode(Color(uiColor: color), forKey: .color) + default: break } } diff --git a/MVMCoreUI/Atomic/Extensions/VDS-Tilelet+Codable.swift b/MVMCoreUI/Atomic/Extensions/VDS-Tilelet+Codable.swift index 9d874675..be231f3e 100644 --- a/MVMCoreUI/Atomic/Extensions/VDS-Tilelet+Codable.swift +++ b/MVMCoreUI/Atomic/Extensions/VDS-Tilelet+Codable.swift @@ -46,7 +46,7 @@ extension Tilelet.DescriptiveIcon: Codable { let accessibleText = try container.decodeIfPresent(String.self, forKey: .accessibleText) if let uiColor = color?.uiColor { self.init(name: name, - colorConfiguration: .init(uiColor, uiColor), + iconColor: .custom(uiColor), size: size, accessibleText: accessibleText) } else { @@ -61,7 +61,9 @@ extension Tilelet.DescriptiveIcon: Codable { try container.encode(name, forKey: .name) try container.encode(size, forKey: .size) try container.encodeIfPresent(accessibleText, forKey: .accessibleText) - try container.encodeIfPresent(colorConfiguration.lightColor.hexString, forKey: .color) + if let color = iconColor?.uiColor { + try container.encode(Color(uiColor: color), forKey: .color) + } } } @@ -81,7 +83,7 @@ extension Tilelet.DirectionalIcon: Codable { let accessibleText = try container.decodeIfPresent(String.self, forKey: .accessibleText) if let uiColor = color?.uiColor { self.init(iconType: iconType, - colorConfiguration: .init(uiColor, uiColor), + iconColor: .custom(uiColor), size: size, accessibleText: accessibleText) } else { @@ -96,6 +98,8 @@ extension Tilelet.DirectionalIcon: Codable { try container.encode(iconType, forKey: .name) try container.encode(size, forKey: .size) try container.encodeIfPresent(accessibleText, forKey: .accessibleText) - try container.encodeIfPresent(colorConfiguration.lightColor.hexString, forKey: .color) + if let color = iconColor?.uiColor { + try container.encode(Color(uiColor: color), forKey: .color) + } } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/LockUps/TitleLockupModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/LockUps/TitleLockupModel.swift index 3c523aab..97d37598 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/LockUps/TitleLockupModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/LockUps/TitleLockupModel.swift @@ -99,7 +99,7 @@ public class TitleLockupModel: ParentMoleculeModelProtocol { subTitle = try typeContainer.decodeMoleculeIfPresent(codingKey: .subTitle) if let color = eyebrow?.textColor?.uiColor { - self.eyebrowColor = .custom(color, color) + self.eyebrowColor = .custom(color) } else if let eyebrowColor = try? typeContainer.decodeIfPresent(TitleLockup.TextColor.self, forKey: .eyebrowColor) { self.eyebrowColor = eyebrowColor @@ -109,7 +109,7 @@ public class TitleLockupModel: ParentMoleculeModelProtocol { } if let color = title.textColor?.uiColor { - self.titleColor = .custom(color, color) + self.titleColor = .custom(color) } else if let titleColor = try? typeContainer.decodeIfPresent(TitleLockup.TitleTextColor.self, forKey: .titleColor) { self.titleColor = titleColor @@ -119,7 +119,7 @@ public class TitleLockupModel: ParentMoleculeModelProtocol { } if let color = subTitle?.textColor?.uiColor { - self.subTitleColor = .custom(color, color) + self.subTitleColor = .custom(color) } else if let subTitleColor = try? typeContainer.decodeIfPresent(TitleLockup.TextColor.self, forKey: .subTitleColor) { self.subTitleColor = subTitleColor