From 9446899ca7fe352de2c95d083609b710fdf8fac6 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Tue, 9 Apr 2024 17:07:14 -0400 Subject: [PATCH 01/25] Digital ACT191 story - Monarch Testing --- .../Molecules/HorizontalCombinationViews/TabBarModel.swift | 4 ++-- .../Atomic/Molecules/NavigationBar/NavigationItemModel.swift | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBarModel.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBarModel.swift index b984a9da..6e8cb4a7 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBarModel.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBarModel.swift @@ -34,7 +34,7 @@ open class TabBarModel: MoleculeModelProtocol { if let selectedColor = _selectedColor { return selectedColor } if let style = style, style == .dark { return Color(uiColor: VDSColor.elementsPrimaryOndark) } - return Color(uiColor: VDSColor.elementsPrimaryOnlight) + return Color(uiColor: UIColor.mfGet(forHex: "#FF1129")) } set { _selectedColor = newValue @@ -54,7 +54,7 @@ open class TabBarModel: MoleculeModelProtocol { } } - open var style: NavigationItemStyle? = .dark + open var style: NavigationItemStyle? = .light // Must be capped to 0...(tabs.count - 1) open var selectedTab: Int = 0 diff --git a/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift b/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift index d39cdeaf..406fe56f 100644 --- a/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift +++ b/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift @@ -106,7 +106,7 @@ open class NavigationItemModel: NavigationItemModelProtocol, MoleculeModelProtoc backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) _tintColor = try typeContainer.decodeIfPresent(Color.self, forKey: .tintColor) if let line = try typeContainer.decodeIfPresent(LineModel.self, forKey: .line) { - self.line = line + //self.line = line } if let hidesSystemBackButton = try typeContainer.decodeIfPresent(Bool.self, forKey: .hidesSystemBackButton) { self.hidesSystemBackButton = hidesSystemBackButton @@ -116,7 +116,7 @@ open class NavigationItemModel: NavigationItemModelProtocol, MoleculeModelProtoc additionalLeftButtons = try typeContainer.decodeModelsIfPresent(codingKey: .additionalLeftButtons) additionalRightButtons = try typeContainer.decodeModelsIfPresent(codingKey: .additionalRightButtons) titleView = try typeContainer.decodeModelIfPresent(codingKey: .titleView) - style = try typeContainer.decodeIfPresent(NavigationItemStyle.self, forKey: .style) + //style = try typeContainer.decodeIfPresent(NavigationItemStyle.self, forKey: .style) if let titleOffset = try typeContainer.decodeIfPresent(UIOffset.self, forKey: .titleOffset) { self.titleOffset = titleOffset } From b8526ac8e1ae452a309daed3ab36167bbe224d41 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Tue, 23 Apr 2024 17:00:22 -0400 Subject: [PATCH 02/25] Monarch colors --- .../TabBarModel.swift | 2 +- .../NavigationBar/NavigationItemModel.swift | 4 ++-- MVMCoreUI/Categories/UIColor+Extension.swift | 17 ++++++++++++++-- .../monarchRed.colorset/Contents.json | 20 +++++++++++++++++++ .../monarchStone.colorset/Contents.json | 20 +++++++++++++++++++ 5 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 MVMCoreUI/Categories/colors.xcassets/monarchRed.colorset/Contents.json create mode 100644 MVMCoreUI/Categories/colors.xcassets/monarchStone.colorset/Contents.json diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBarModel.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBarModel.swift index 13c43afc..c74c3946 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBarModel.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBarModel.swift @@ -34,7 +34,7 @@ open class TabBarModel: MoleculeModelProtocol { if let selectedColor = _selectedColor { return selectedColor } if let style = style, style == .dark { return Color(uiColor: VDSColor.elementsPrimaryOndark) } - return Color(uiColor: UIColor.mfGet(forHex: "#FF1129")) + return Color(uiColor: UIColor.monarchRed) } set { _selectedColor = newValue diff --git a/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift b/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift index 2846d164..67fc779f 100644 --- a/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift +++ b/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift @@ -106,7 +106,7 @@ open class NavigationItemModel: NavigationItemModelProtocol, MoleculeModelProtoc backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) _tintColor = try typeContainer.decodeIfPresent(Color.self, forKey: .tintColor) if let line = try typeContainer.decodeIfPresent(LineModel.self, forKey: .line) { - //self.line = line + self.line = line } if let hidesSystemBackButton = try typeContainer.decodeIfPresent(Bool.self, forKey: .hidesSystemBackButton) { self.hidesSystemBackButton = hidesSystemBackButton @@ -116,7 +116,7 @@ open class NavigationItemModel: NavigationItemModelProtocol, MoleculeModelProtoc additionalLeftButtons = try typeContainer.decodeModelsIfPresent(codingKey: .additionalLeftButtons) additionalRightButtons = try typeContainer.decodeModelsIfPresent(codingKey: .additionalRightButtons) titleView = try typeContainer.decodeModelIfPresent(codingKey: .titleView) - //style = try typeContainer.decodeIfPresent(NavigationItemStyle.self, forKey: .style) + style = try typeContainer.decodeIfPresent(NavigationItemStyle.self, forKey: .style) if let titleOffset = try typeContainer.decodeIfPresent(UIOffset.self, forKey: .titleOffset) { self.titleOffset = titleOffset } diff --git a/MVMCoreUI/Categories/UIColor+Extension.swift b/MVMCoreUI/Categories/UIColor+Extension.swift index f4ef0f7f..854726bb 100644 --- a/MVMCoreUI/Categories/UIColor+Extension.swift +++ b/MVMCoreUI/Categories/UIColor+Extension.swift @@ -54,7 +54,10 @@ extension UIColor { "coolGray10": (.mvmCoolGray10, "#333333"), "upGold1": (.vzupGold1, "#F9D542"), "upGold2": (.vzupGold2, "#F4CA53"), - "upGold3": (.vzupGold3, "#CC9B2D")] + "upGold3": (.vzupGold3, "#CC9B2D"), + "monarchRed": (.monarchRed, "#f50a23"), + "monarchStone": (.monarchStone, "#f3ede0"), + ] //-------------------------------------------------- // MARK: - Helper @@ -84,7 +87,7 @@ extension UIColor { /// HEX: #D52B1E public static let mvmRed = UIColor.assetColor(named: "red") - + //-------------------------------------------------- // MARK: - Pink //-------------------------------------------------- @@ -222,6 +225,16 @@ extension UIColor { /// HEX: #CC9B2D public static let vzupGold3 = UIColor.assetColor(named: "upGold3") + //-------------------------------------------------- + // MARK: - Monarch + //-------------------------------------------------- + + /// HEX: #f50a23 + @objc public static let monarchRed = UIColor.assetColor(named: "monarchRed") + + /// HEX: #f3ede0 + @objc public static let monarchStone = UIColor.assetColor(named: "monarchStone") + //-------------------------------------------------- // MARK: - Functions //-------------------------------------------------- diff --git a/MVMCoreUI/Categories/colors.xcassets/monarchRed.colorset/Contents.json b/MVMCoreUI/Categories/colors.xcassets/monarchRed.colorset/Contents.json new file mode 100644 index 00000000..5f3b4048 --- /dev/null +++ b/MVMCoreUI/Categories/colors.xcassets/monarchRed.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x23", + "green" : "0x0A", + "red" : "0xF5" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MVMCoreUI/Categories/colors.xcassets/monarchStone.colorset/Contents.json b/MVMCoreUI/Categories/colors.xcassets/monarchStone.colorset/Contents.json new file mode 100644 index 00000000..ead33d73 --- /dev/null +++ b/MVMCoreUI/Categories/colors.xcassets/monarchStone.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xE0", + "green" : "0xED", + "red" : "0xF3" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} From 01371a320a1c626f6f5419e812abf5d379fbd520 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Wed, 24 Apr 2024 11:37:31 -0400 Subject: [PATCH 03/25] Digital ACT191 story ONV9720_MVAPP - Updated colors and icons for Monarch MVP --- .../TabBarModel.swift | 2 +- MVMCoreUI/Categories/UIColor+Extension.swift | 38 ++++++++++++++----- MVMCoreUI/Categories/UIColor+MFConvenience.m | 12 ++---- .../Contents.json | 6 +-- .../gray44.colorset/Contents.json | 20 ++++++++++ .../red.colorset/Contents.json | 22 +++++------ .../Contents.json | 0 .../yellow.colorset/Contents.json | 22 +++++------ 8 files changed, 77 insertions(+), 45 deletions(-) rename MVMCoreUI/Categories/colors.xcassets/{monarchRed.colorset => coral.colorset}/Contents.json (75%) create mode 100644 MVMCoreUI/Categories/colors.xcassets/gray44.colorset/Contents.json rename MVMCoreUI/Categories/colors.xcassets/{monarchStone.colorset => stone.colorset}/Contents.json (100%) diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBarModel.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBarModel.swift index c74c3946..bbe11c36 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBarModel.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBarModel.swift @@ -34,7 +34,7 @@ open class TabBarModel: MoleculeModelProtocol { if let selectedColor = _selectedColor { return selectedColor } if let style = style, style == .dark { return Color(uiColor: VDSColor.elementsPrimaryOndark) } - return Color(uiColor: UIColor.monarchRed) + return Color(uiColor: UIColor.mvmRed) } set { _selectedColor = newValue diff --git a/MVMCoreUI/Categories/UIColor+Extension.swift b/MVMCoreUI/Categories/UIColor+Extension.swift index 854726bb..6f994254 100644 --- a/MVMCoreUI/Categories/UIColor+Extension.swift +++ b/MVMCoreUI/Categories/UIColor+Extension.swift @@ -19,7 +19,7 @@ extension UIColor { /// Dictionary to access brand approved colors by name. public static let names: [String: ColorHexTuple] = ["black": (.mvmBlack, "#000000"), "white": (.mvmWhite, "#FFFFFF"), - "red": (.mvmRed, "#D52B1E"), + "red": (.mvmRed, "#F50A23"), "pink": (.mvmPink, "#D90368"), "pink33": (.mvmPink33, "#F2ABCD"), "pink66": (.mvmPink66, "#E6589B"), @@ -47,7 +47,7 @@ extension UIColor { "blueShade1": (.mvmBlueShade1, "#136598"), "blueShade2": (.mvmBlueShade2, "#0B4467"), "blueInverted": (.mvmBlueInverted, "#0088CE"), - "yellow": (.mvmYellow, "#FFBC3D"), + "yellow": (.mvmYellow, "#F5FF1E"), "coolGray1": (.mvmCoolGray1, "#F6F6F6"), "coolGray3": (.mvmCoolGray3, "#D8DADA"), "coolGray6": (.mvmCoolGray6, "#747676"), @@ -55,8 +55,11 @@ extension UIColor { "upGold1": (.vzupGold1, "#F9D542"), "upGold2": (.vzupGold2, "#F4CA53"), "upGold3": (.vzupGold3, "#CC9B2D"), - "monarchRed": (.monarchRed, "#f50a23"), - "monarchStone": (.monarchStone, "#f3ede0"), + "stone": (.stone, "#F3EDE0"), + "coral": (.coral, "#FF3C2D"), + "gray44": (.gray44, "#6F7171"), + "gray85": (.gray85, "#D8DADA"), + "gray95": (.gray95, "#F6F6F6") ] //-------------------------------------------------- @@ -85,7 +88,8 @@ extension UIColor { // MARK: - Red //-------------------------------------------------- - /// HEX: #D52B1E + /// HEX: ##F50A23 + @objc public static let mvmRed = UIColor.assetColor(named: "red") //-------------------------------------------------- @@ -193,7 +197,7 @@ extension UIColor { // MARK: - Yellow //-------------------------------------------------- - /// HEX: #FFBC3D + /// HEX: ##F5FF1E public static let mvmYellow = UIColor.assetColor(named: "yellow") //-------------------------------------------------- @@ -229,11 +233,20 @@ extension UIColor { // MARK: - Monarch //-------------------------------------------------- - /// HEX: #f50a23 - @objc public static let monarchRed = UIColor.assetColor(named: "monarchRed") + /// HEX: #F3EDE0 + @objc public static let stone = UIColor.assetColor(named: "stone") + + // HEX:#FF3C2D + @objc public static let coral = UIColor.assetColor(named: "coral") - /// HEX: #f3ede0 - @objc public static let monarchStone = UIColor.assetColor(named: "monarchStone") + // HEX:#6F7171 + @objc public static let gray44 = UIColor.assetColor(named: "gray44") + + // HEX:#D8DADA + @objc public static let gray85 = mvmCoolGray3 + + // HEX:#F6F6F6 + @objc public static let gray95 = mvmCoolGray1 //-------------------------------------------------- // MARK: - Functions @@ -243,6 +256,11 @@ extension UIColor { return UIColor(named: name, in: MVMCoreUIUtility.bundleForMVMCoreUI(), compatibleWith: nil)! } + @objc + public static func mvmCoreUIColor(with name: String) -> UIColor? { + return UIColor.names[name]?.uiColor + } + /// Convenience to get a grayscale UIColor where the same value is used for red, green, and blue. public class func grayscale(rgb: Int, alpha: CGFloat = 1.0) -> UIColor { diff --git a/MVMCoreUI/Categories/UIColor+MFConvenience.m b/MVMCoreUI/Categories/UIColor+MFConvenience.m index cd809509..77700413 100644 --- a/MVMCoreUI/Categories/UIColor+MFConvenience.m +++ b/MVMCoreUI/Categories/UIColor+MFConvenience.m @@ -7,6 +7,7 @@ // #import "UIColor+MFConvenience.h" +#import @import MVMCore.MVMCoreDispatchUtility; @implementation UIColor (MFConvenience) @@ -302,8 +303,6 @@ static dispatch_once_t once; dispatch_once(&once, ^{ stringColorMapping = @{@"PrimaryRed":[UIColor mfRedColor], - @"black":[UIColor blackColor], - @"red":[UIColor mfRedColor], @"greyish":[UIColor mfLightGrayColor], @"robinsEggBlue" : [UIColor mfRobinsEggBlue], @"lightSalmon" : [UIColor mfLightSalmon], @@ -327,14 +326,9 @@ UIColor *color = nil; if (string && string.length > 0) { - color = [stringColorMapping objectForKey:string]; - if (!color){ - color = [UIColor blackColor]; - } - } else { - color = [UIColor blackColor]; + color = [stringColorMapping objectForKey:string] ?: [UIColor mvmCoreUIColorWith:string]; } - return color; + return color ?: [UIColor blackColor]; } + (nonnull UIColor *)mfGetColorForHex:(nonnull NSString *) hexString { diff --git a/MVMCoreUI/Categories/colors.xcassets/monarchRed.colorset/Contents.json b/MVMCoreUI/Categories/colors.xcassets/coral.colorset/Contents.json similarity index 75% rename from MVMCoreUI/Categories/colors.xcassets/monarchRed.colorset/Contents.json rename to MVMCoreUI/Categories/colors.xcassets/coral.colorset/Contents.json index 5f3b4048..a834049e 100644 --- a/MVMCoreUI/Categories/colors.xcassets/monarchRed.colorset/Contents.json +++ b/MVMCoreUI/Categories/colors.xcassets/coral.colorset/Contents.json @@ -5,9 +5,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0x23", - "green" : "0x0A", - "red" : "0xF5" + "blue" : "0x2D", + "green" : "0x3C", + "red" : "0xFF" } }, "idiom" : "universal" diff --git a/MVMCoreUI/Categories/colors.xcassets/gray44.colorset/Contents.json b/MVMCoreUI/Categories/colors.xcassets/gray44.colorset/Contents.json new file mode 100644 index 00000000..296ef27c --- /dev/null +++ b/MVMCoreUI/Categories/colors.xcassets/gray44.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x71", + "green" : "0x71", + "red" : "0x6F" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MVMCoreUI/Categories/colors.xcassets/red.colorset/Contents.json b/MVMCoreUI/Categories/colors.xcassets/red.colorset/Contents.json index 536ccc9b..5f3b4048 100644 --- a/MVMCoreUI/Categories/colors.xcassets/red.colorset/Contents.json +++ b/MVMCoreUI/Categories/colors.xcassets/red.colorset/Contents.json @@ -1,20 +1,20 @@ { - "info" : { - "version" : 1, - "author" : "xcode" - }, "colors" : [ { - "idiom" : "universal", "color" : { "color-space" : "srgb", "components" : { - "red" : "0xD5", "alpha" : "1.000", - "blue" : "0x1E", - "green" : "0x2B" + "blue" : "0x23", + "green" : "0x0A", + "red" : "0xF5" } - } + }, + "idiom" : "universal" } - ] -} \ No newline at end of file + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MVMCoreUI/Categories/colors.xcassets/monarchStone.colorset/Contents.json b/MVMCoreUI/Categories/colors.xcassets/stone.colorset/Contents.json similarity index 100% rename from MVMCoreUI/Categories/colors.xcassets/monarchStone.colorset/Contents.json rename to MVMCoreUI/Categories/colors.xcassets/stone.colorset/Contents.json diff --git a/MVMCoreUI/Categories/colors.xcassets/yellow.colorset/Contents.json b/MVMCoreUI/Categories/colors.xcassets/yellow.colorset/Contents.json index 5c00b5eb..5d0cb64a 100644 --- a/MVMCoreUI/Categories/colors.xcassets/yellow.colorset/Contents.json +++ b/MVMCoreUI/Categories/colors.xcassets/yellow.colorset/Contents.json @@ -1,20 +1,20 @@ { - "info" : { - "version" : 1, - "author" : "xcode" - }, "colors" : [ { - "idiom" : "universal", "color" : { "color-space" : "srgb", "components" : { - "red" : "0xFF", "alpha" : "1.000", - "blue" : "0x3D", - "green" : "0xBC" + "blue" : "0x1E", + "green" : "0xFF", + "red" : "0xF5" } - } + }, + "idiom" : "universal" } - ] -} \ No newline at end of file + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} From 7eb0d642371bf237751323d041e51e6a438b7476 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Mon, 29 Apr 2024 19:26:49 -0400 Subject: [PATCH 04/25] Digital ACT191 story ONEAPP-7592 - Monarch testing --- MVMCoreUI/Atomic/Atoms/Views/TileContainerModel.swift | 6 ++++-- MVMCoreUI/Atomic/Extensions/VDS-Enums+Codable.swift | 6 +++++- .../Headers/H1/HeadersH1NoButtonsBodyTextModel.swift | 6 +++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/TileContainerModel.swift b/MVMCoreUI/Atomic/Atoms/Views/TileContainerModel.swift index 895bb027..649e5316 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/TileContainerModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/TileContainerModel.swift @@ -8,6 +8,7 @@ import Foundation import VDS +import MVMCore open class TileContainerModel: TileContainerBaseModel, ParentMoleculeModelProtocol, MoleculeModelProtocol { @@ -33,10 +34,11 @@ open class TileContainerModel: TileContainerBaseModel TitleLockupModel { guard let headline = headlineBody.headline else { throw ModelRegistry.Error.decoderOther(message: "headline is required for this use case.") } - var body = headlineBody.body + let body = headlineBody.body switch headlineBody.style ?? defaultStyle { case .landingHeader: headline.fontStyle = Styler.Font.RegularTitle2XLarge @@ -103,13 +103,13 @@ public struct DeprecatedHeadlineBodyHelper { headline.fontStyle = Styler.Font.RegularTitleXLarge body?.fontStyle = Styler.Font.RegularTitleMedium } - let model = try TitleLockupModel(title: headline, subTitle: body) + let model = TitleLockupModel(title: headline, subTitle: body) model.id = headlineBody.id return model } public func createHeadlineBodyModel(titleLockup: TitleLockupModel) -> HeadlineBodyModel { - var headlineBody = HeadlineBodyModel(headline: titleLockup.title) + let headlineBody = HeadlineBodyModel(headline: titleLockup.title) headlineBody.body = titleLockup.subTitle headlineBody.id = titleLockup.id return headlineBody From b0c2a301eb17176184e6a70886200baa0b885468 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Tue, 30 Apr 2024 12:32:15 -0400 Subject: [PATCH 05/25] Digital ACT191 story ONEAPP-7592 - Color Updates to allow strings or hash --- MVMCoreUI/Categories/UIColor+MFConvenience.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MVMCoreUI/Categories/UIColor+MFConvenience.m b/MVMCoreUI/Categories/UIColor+MFConvenience.m index 77700413..259ba747 100644 --- a/MVMCoreUI/Categories/UIColor+MFConvenience.m +++ b/MVMCoreUI/Categories/UIColor+MFConvenience.m @@ -299,6 +299,10 @@ } + (nullable UIColor *)mfGetColorForString:(nullable NSString *)string { + if ([string hasPrefix:@"#"]) { + return [self mfGetColorForHex:string]; + } + static NSDictionary *stringColorMapping; static dispatch_once_t once; dispatch_once(&once, ^{ From c5fa1a251543944461c9895a243de3a446d44d43 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Tue, 30 Apr 2024 13:11:39 -0400 Subject: [PATCH 06/25] Digital ACT191 story ONEAPP-7592 - icon updates --- .../externalLink.imageset/Contents.json | 24 ++++++------------ .../externalLink.imageset/Vector.svg | 3 +++ .../externalLink.imageset/exportBlack.png | Bin 345 -> 0 bytes .../externalLink.imageset/exportBlack@2x.png | Bin 589 -> 0 bytes .../externalLink.imageset/exportBlack@3x.png | Bin 869 -> 0 bytes .../nav_back.imageset/Contents.json | 18 ++++--------- .../nav_back.imageset/Vector.svg | 3 +++ .../nav_back.imageset/nav_back.png | Bin 220 -> 0 bytes .../nav_back.imageset/nav_back@2x.png | Bin 302 -> 0 bytes .../nav_back.imageset/nav_back@3x.png | Bin 394 -> 0 bytes .../nav_close.imageset/Close-1.png | Bin 435 -> 0 bytes .../nav_close.imageset/Close-2.png | Bin 631 -> 0 bytes .../nav_close.imageset/Close.png | Bin 257 -> 0 bytes .../nav_close.imageset/Contents.json | 18 ++++--------- .../nav_close.imageset/Vector.svg | 3 +++ 15 files changed, 27 insertions(+), 42 deletions(-) create mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/Vector.svg delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack.png delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack@2x.png delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack@3x.png create mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/Vector.svg delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/nav_back.png delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/nav_back@2x.png delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/nav_back@3x.png delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/Close-1.png delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/Close-2.png delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/Close.png create mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/Vector.svg diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/Contents.json b/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/Contents.json index 07a5a9f8..702db438 100644 --- a/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/Contents.json +++ b/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/Contents.json @@ -1,23 +1,15 @@ { "images" : [ { - "idiom" : "universal", - "filename" : "exportBlack.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "exportBlack@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "exportBlack@3x.png", - "scale" : "3x" + "filename" : "Vector.svg", + "idiom" : "universal" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true } -} \ No newline at end of file +} diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/Vector.svg b/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/Vector.svg new file mode 100644 index 00000000..bcdaef29 --- /dev/null +++ b/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/Vector.svg @@ -0,0 +1,3 @@ + + + diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack.png b/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack.png deleted file mode 100644 index 34f6d7e9c930cfd3b15aa1fd6be1e88c0e281a28..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 345 zcmV-f0jBPx$6G=otR5%gMk}*yLK@3GFhz__y1QnspDN^PFTp_38DAdpqr9z^BGE$T}%YPov z?wSm%DJZb?$6kMr*JC@SK{`x3FfKSG_gUq$XVa`u7`PWXB0WgIU=Oj*{8U|^!x^py z=}Hm3_fl4sjc-PqA;Ge-tqu#tTdY?n&sTlBLo z?S-ZACVU9Df(Z#~J$E`NHjG)I%RH#=e7oiRO`e=!;#=Y1-&Dnx*c!A}Px%2T4RhR9Fe^mpM|zFc3v&fC~_D2#6sfnRKe)8eD`ka1TNPa&kBX5EDVw(66np zl5LH=%o@0>+Pz7wuhwFFKC9CT^UN6K9>Zu}iOMP6i$vEiN@m5LcLHI&GkH(Sx$NeN)yQE z`(H+vWD1wYtT+S!m1gd9b9eV+QEJj_ZA%FhJHA8|%a=|N2TB!tV7J+fqsPE49-8sW zlAI^QvmKridz4BNkUa$1h8Y4a_~!pHhLi-!*^4_{uMZlPh`Wr=@5W5?!#EydM(#@~ z67_LJ7=05plW3YC^NX}^BHED*;WsE;fG zQU3^NYv)y&6Dc6P{vcj7eCY8S)F-H^ZPM~=t3m=oUhNT$dSePpNi0jcKeEA*&Ts2S z6&69JX{gX?>S*e_0K{(@U`Ej{_s|4rR0X;^O-nXasH*~9@$??z7Tq;uCV77L$$&l_-Z00000NkvXXu0mjf1aSuz diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack@3x.png b/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack@3x.png deleted file mode 100644 index 15f13e3249cc453310cf2b87eed836add51186f8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 869 zcmV-r1DgDaP)Px&A4x<(RA>e5SUYkQF%Y%E0faV*Q;vW+fD>~9LZ5+z09W}41SC{(4k8je;Q+u% zFjWMOTm}8c^R&HEOEc1FXLq*LRdQ=v-TnF_&5U(;VADTaypo<^YH1x)$6D;xo>0T$ z<%@@gI~Rks2z{sE8*_o&Uw^bLk2Yx;i#7;C3A#X!M1aYaTCk=cdp&d!V4ZO^)!qZv z*JREy=R6nyd2fN z|1E+SGH|GHxDHr*%*_WM7Df_4I;X;s)gRxkXvcd_m`gkS)+`j<7i-`OO;ZbwT${ue@I1DV{PhFgE3&M57Mk<9E@h7!cVd1 z0UwopDIS5yHwH!ka1gU|6ADWBmq(x7UmwVUaqE8*$#-RtGkp-{Prbnp;jd);l7Tlu zK**%V83Pb}f&0`|tJc;B05U-dU;9Y>T?5Pl(mf?RVvB9*)XZ$J5orU96edsH%9vNLh;}Puq%e8n{VgLO#OHYhNoq%Z;fvUO z_axnoTdei9Jq|5XYwTSLiZeKNDO21o?DK + + diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/nav_back.png b/MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/nav_back.png deleted file mode 100644 index 895fade7109e9e7ea5b937adaa25e3a8111788aa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 220 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-1!HlL zyA#8@b22Z19F}xPUq=Rpjs4tz5?O)#LQfaRkP61PQ}1#%81S^5pKp7W_s)SmJHzfC z@im!b!`T$NPUJ27^&pP&Eha2Kq$hW$?OVyhGHJ$lg@7~m32}4JxNcp=bkA7EyH?Q6 zIl=!*W5<*UInHi23w8zyC&X8L`^+T7wA=HFOSW>>(eEm}Gx@D;FDkRIS9!t+w4A}y L)z4*}Q$iB}lgCHV diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/nav_back@2x.png b/MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/nav_back@2x.png deleted file mode 100644 index e699cb47470c1e6084ce5374ae7d6d3f49ed5612..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 302 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTC&H|6fVg?2=RS;(M3{v?36l5$8 za(7}_cTVOdki(Mh=%-{4AGgf7Ut8`G{k`18yk^Hgs|7Zn<zopr0GEVw6#xJL diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/nav_back@3x.png b/MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/nav_back@3x.png deleted file mode 100644 index 96e839ed04085187d59f599dc2a822c227b6b3b7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 394 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY1|&n@ZgvM!oCO|{#S9FJ79h;%I?XTvD9BhG zE))=%ok5&U^q~kv+SntXN@y&9@qGMHa$DL zqvV;ZeWKs6>I+R;F_-=cgn6=`%!pz zM7Mp!6{R5jC`2g;1xdL-lK9Yh$wr9%WWA=KrWP7HtNgabI7a6KdyFq5!-1X#ilqF@_H8`DvTMfWH4Fm85 zFxAGhTgs5Lq(Ap+{tDcjjiLw072MM17QkU;*McWGN~f*q2T@_^p_^Qgk?sTeU`2 zmT2mGuy5;VfE$}kxm@{>y&n_fpqGZzhBSfGgfxTGf;5HGfHa3=L%M*YdU^@M@^%Hs zsNoJyx|T~g$(nBAq-wi{lgQv6t~E=|wC_grtC=*1TS0El+|tH_*t2T@o?Qd* d?CKj3zz38L+0W2kewF|L002ovPDHLkV1gc>zia>i diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/Close-2.png b/MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/Close-2.png deleted file mode 100644 index 3cbe291bc07a9ab4e5c50ff9d7e41c3d2f3c4756..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 631 zcmeAS@N?(olHy`uVBq!ia0vp^At21b1|(&&1r7o!&H|6fVg?39a}Z`Uj+kG?z`&&G z>EaktG3V`_hq=uL0;~^;)laCUw)C9gkX(3IMS6$RqM%lVqvtmNeOKY{^tW-+?%z{{ z9QZV!=WyxCZ#v?(-~oq-Okrgez;cJ3uxSl*Rd-#Iw zoKxk_iN2q;CzM8>KYYfnysUnGegC(+#pli+)1Ak4^?cSp$GhC3%Qmjv7oGU7-frT0 zr}oUA(~|y+f|6!kYk%a-UiHah*PCjCb^c44bpHe`a#_k~TX<_rxzAJQtDUtQv{hrP z_zrz(dc}2_d6l(KS;+JmXIA7HMh3+hkT#5jEGh8O*)!6jh#` zh&ztis>`M*1wBynXM>RIm7!Zrg`SfX)W%Z*V-{+5*ocJXWp<2R_coSZ_4Ea PrX&VWS3j3^P62BR0px|at z7sn8f&bwg;c^edX_E<40@Az-h_kbfO;4+JlqwvCBab-^V%=bP!rwNC$7VCy=^B3qk zp{1nBl_SwsYPrFBjdTNR3WIb*iQVj*)1nP{vU4r04oR(uyQJRpvW4TO?!xIMCh9x} zveJ4NQ%s${KhoM8&J$PY`s7{kr;G=@D_4iVJp6mM>e8;ZTVhv^E$=gX^@%)0aPBjmQH!pTX1B&t;ucLK6Us Ca$k!8 diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/Contents.json b/MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/Contents.json index ffda34e6..702db438 100644 --- a/MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/Contents.json +++ b/MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/Contents.json @@ -1,23 +1,15 @@ { "images" : [ { - "filename" : "Close.png", - "idiom" : "universal", - "scale" : "1x" - }, - { - "filename" : "Close-1.png", - "idiom" : "universal", - "scale" : "2x" - }, - { - "filename" : "Close-2.png", - "idiom" : "universal", - "scale" : "3x" + "filename" : "Vector.svg", + "idiom" : "universal" } ], "info" : { "author" : "xcode", "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true } } diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/Vector.svg b/MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/Vector.svg new file mode 100644 index 00000000..1aece044 --- /dev/null +++ b/MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/Vector.svg @@ -0,0 +1,3 @@ + + + From 16cd1601ba2e80de2247625cb4671593bc72c79d Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Wed, 1 May 2024 14:47:37 -0400 Subject: [PATCH 07/25] Digital ACT191 story ONEAPP-7459 - Update back to Vivid Red --- MVMCoreUI/Categories/UIColor+Extension.swift | 4 ++-- MVMCoreUI/Categories/UIColor+MFConvenience.m | 2 +- .../Categories/colors.xcassets/red.colorset/Contents.json | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/MVMCoreUI/Categories/UIColor+Extension.swift b/MVMCoreUI/Categories/UIColor+Extension.swift index 6f994254..3cf8609e 100644 --- a/MVMCoreUI/Categories/UIColor+Extension.swift +++ b/MVMCoreUI/Categories/UIColor+Extension.swift @@ -19,7 +19,7 @@ extension UIColor { /// Dictionary to access brand approved colors by name. public static let names: [String: ColorHexTuple] = ["black": (.mvmBlack, "#000000"), "white": (.mvmWhite, "#FFFFFF"), - "red": (.mvmRed, "#F50A23"), + "red": (.mvmRed, "#EE0000"), "pink": (.mvmPink, "#D90368"), "pink33": (.mvmPink33, "#F2ABCD"), "pink66": (.mvmPink66, "#E6589B"), @@ -88,7 +88,7 @@ extension UIColor { // MARK: - Red //-------------------------------------------------- - /// HEX: ##F50A23 + /// HEX: #EE0000 @objc public static let mvmRed = UIColor.assetColor(named: "red") diff --git a/MVMCoreUI/Categories/UIColor+MFConvenience.m b/MVMCoreUI/Categories/UIColor+MFConvenience.m index 259ba747..d10672a8 100644 --- a/MVMCoreUI/Categories/UIColor+MFConvenience.m +++ b/MVMCoreUI/Categories/UIColor+MFConvenience.m @@ -77,7 +77,7 @@ #pragma mark - legacy + (nonnull UIColor *)mfRedColor { - return [UIColor colorWithRed:.804 green:.016 blue:.043 alpha:1.0]; + return [UIColor mvmRed]; } + (nonnull UIColor *)mfDarkerRedColor { diff --git a/MVMCoreUI/Categories/colors.xcassets/red.colorset/Contents.json b/MVMCoreUI/Categories/colors.xcassets/red.colorset/Contents.json index 5f3b4048..3a204689 100644 --- a/MVMCoreUI/Categories/colors.xcassets/red.colorset/Contents.json +++ b/MVMCoreUI/Categories/colors.xcassets/red.colorset/Contents.json @@ -5,9 +5,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0x23", - "green" : "0x0A", - "red" : "0xF5" + "blue" : "0x00", + "green" : "0x00", + "red" : "0xEE" } }, "idiom" : "universal" From 272465008f4049e248d60fd02a97d35fa1907f35 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Tue, 7 May 2024 10:46:05 -0400 Subject: [PATCH 08/25] Digital ACT191 story ONEAPP-7847 - Updating the VDS tokens library --- MVMCoreUI.xcodeproj/project.pbxproj | 6 ++++-- MVMCoreUI/Atomic/Atoms/Buttons/ButtonModel.swift | 2 +- MVMCoreUI/Atomic/Atoms/Buttons/Link/Link.swift | 2 +- MVMCoreUI/Atomic/Atoms/Buttons/PillButton.swift | 2 +- MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift | 2 +- .../Atoms/Views/CarouselIndicator/CarouselIndicator.swift | 2 +- .../Views/CarouselIndicator/CarouselIndicatorModel.swift | 2 +- MVMCoreUI/Atomic/Atoms/Views/IconModel.swift | 2 +- MVMCoreUI/Atomic/Atoms/Views/LineModel.swift | 2 +- MVMCoreUI/Atomic/Atoms/Views/TooltipModel.swift | 2 +- MVMCoreUI/Atomic/Extensions/VDS-Enums+Codable.swift | 2 +- .../DesignedComponents/LockUps/TitleLockupModel.swift | 2 +- .../Molecules/HorizontalCombinationViews/TabBar.swift | 2 +- .../Molecules/HorizontalCombinationViews/TabBarModel.swift | 2 +- .../Atomic/Molecules/HorizontalCombinationViews/Tabs.swift | 2 +- .../Molecules/HorizontalCombinationViews/TabsModel.swift | 2 +- .../Molecules/NavigationBar/NavigationItemModel.swift | 2 +- .../Molecules/TopNotification/CollapsableNotification.swift | 2 +- MVMCoreUI/Managers/SubNav/SubNavManagerController.swift | 2 +- 19 files changed, 22 insertions(+), 20 deletions(-) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 62792baf..a15ea41d 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -289,6 +289,7 @@ AF1C336F2885A16A006B1001 /* ActionCollapseNotificationHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF1C336E2885A16A006B1001 /* ActionCollapseNotificationHandler.swift */; }; AF1C33712885AE76006B1001 /* MVMCoreUIActionHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF1C33702885AE76006B1001 /* MVMCoreUIActionHandler.swift */; }; AF1C33732885D481006B1001 /* MVMCoreUIActionOpenPageHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF1C33722885D481006B1001 /* MVMCoreUIActionOpenPageHandler.swift */; }; + AF1CEFE82BEA73890001F9A5 /* VDSCoreTokens.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF1CEFE72BEA73890001F9A5 /* VDSCoreTokens.xcframework */; }; 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 */; }; @@ -605,7 +606,6 @@ EABFC1412763BB8D00E78B40 /* FormLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EABFC1402763BB8D00E78B40 /* FormLabel.swift */; }; EABFC152276913E800E78B40 /* FormLabelModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EABFC151276913E800E78B40 /* FormLabelModel.swift */; }; EACCF38C2ABB346700E0F104 /* VDS-Interpreters.swift in Sources */ = {isa = PBXBuildFile; fileRef = EACCF38B2ABB346700E0F104 /* VDS-Interpreters.swift */; }; - EAD715AA2BBC8FAF00DEDA6A /* VDSTokens.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = EAD715A92BBC8FAF00DEDA6A /* VDSTokens.xcframework */; }; FD99130028E21E4900542CC3 /* RuleNotEqualsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD9912FF28E21E4900542CC3 /* RuleNotEqualsModel.swift */; }; /* End PBXBuildFile section */ @@ -897,6 +897,7 @@ AF1C336E2885A16A006B1001 /* ActionCollapseNotificationHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionCollapseNotificationHandler.swift; sourceTree = ""; }; AF1C33702885AE76006B1001 /* MVMCoreUIActionHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MVMCoreUIActionHandler.swift; sourceTree = ""; }; AF1C33722885D481006B1001 /* MVMCoreUIActionOpenPageHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MVMCoreUIActionOpenPageHandler.swift; sourceTree = ""; }; + AF1CEFE72BEA73890001F9A5 /* VDSCoreTokens.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = VDSCoreTokens.xcframework; path = ../SharedFrameworks/VDSCoreTokens.xcframework; 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 = ""; }; @@ -1225,9 +1226,9 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + AF1CEFE82BEA73890001F9A5 /* VDSCoreTokens.xcframework in Frameworks */, D29DF0E621E4F3C7003B2FB9 /* MVMCore.framework in Frameworks */, EA985C602970A3F000F2FF2E /* VDS.framework in Frameworks */, - EAD715AA2BBC8FAF00DEDA6A /* VDSTokens.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2088,6 +2089,7 @@ D29DF0E421E4F3C7003B2FB9 /* Frameworks */ = { isa = PBXGroup; children = ( + AF1CEFE72BEA73890001F9A5 /* VDSCoreTokens.xcframework */, EAD715A92BBC8FAF00DEDA6A /* VDSTokens.xcframework */, EA985C632970A40E00F2FF2E /* VDSTypographyTokens.xcframework */, EA985C5F2970A3F000F2FF2E /* VDS.framework */, diff --git a/MVMCoreUI/Atomic/Atoms/Buttons/ButtonModel.swift b/MVMCoreUI/Atomic/Atoms/Buttons/ButtonModel.swift index dec3480c..0bfeff61 100644 --- a/MVMCoreUI/Atomic/Atoms/Buttons/ButtonModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Buttons/ButtonModel.swift @@ -7,7 +7,7 @@ // import UIKit -import VDSTokens +import VDSCoreTokens import VDS import MVMCore diff --git a/MVMCoreUI/Atomic/Atoms/Buttons/Link/Link.swift b/MVMCoreUI/Atomic/Atoms/Buttons/Link/Link.swift index f9261d97..dcffc9e8 100644 --- a/MVMCoreUI/Atomic/Atoms/Buttons/Link/Link.swift +++ b/MVMCoreUI/Atomic/Atoms/Buttons/Link/Link.swift @@ -7,7 +7,7 @@ // import UIKit -import VDSTokens +import VDSCoreTokens import VDS open class Link: VDS.TextLink, VDSMoleculeViewProtocol { diff --git a/MVMCoreUI/Atomic/Atoms/Buttons/PillButton.swift b/MVMCoreUI/Atomic/Atoms/Buttons/PillButton.swift index 7334ccf5..986d4e72 100644 --- a/MVMCoreUI/Atomic/Atoms/Buttons/PillButton.swift +++ b/MVMCoreUI/Atomic/Atoms/Buttons/PillButton.swift @@ -7,7 +7,7 @@ // import UIKit -import VDSTokens +import VDSCoreTokens import VDS import MVMCore import Combine diff --git a/MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift b/MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift index 2f9ae80a..e73a8d5c 100644 --- a/MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift +++ b/MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift @@ -7,7 +7,7 @@ // import UIKit -import VDSTokens +import VDSCoreTokens @objcMembers open class RadioButton: Control, MFButtonProtocol { //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicator.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicator.swift index 56827bec..21cca600 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicator.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicator.swift @@ -5,7 +5,7 @@ // Created by Kevin Christiano on 1/30/20. // Copyright © 2020 Verizon Wireless. All rights reserved. // -import VDSTokens +import VDSCoreTokens open class CarouselIndicator: Control, CarouselPageControlProtocol { //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicatorModel.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicatorModel.swift index 11bcdd8d..28fa22b0 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicatorModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicatorModel.swift @@ -7,7 +7,7 @@ // import Foundation -import VDSTokens +import VDSCoreTokens open class CarouselIndicatorModel: CarouselPagingModelProtocol, MoleculeModelProtocol, EnableableModelProtocol { //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Atoms/Views/IconModel.swift b/MVMCoreUI/Atomic/Atoms/Views/IconModel.swift index 4fbbd712..ac8e6d9e 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/IconModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/IconModel.swift @@ -8,7 +8,7 @@ import Foundation import VDS -import VDSTokens +import VDSCoreTokens open class IconModel: MoleculeModelProtocol { diff --git a/MVMCoreUI/Atomic/Atoms/Views/LineModel.swift b/MVMCoreUI/Atomic/Atoms/Views/LineModel.swift index 2cfe9b99..1b2d7ec2 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/LineModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/LineModel.swift @@ -7,7 +7,7 @@ // import UIKit -import VDSTokens +import VDSCoreTokens import VDS public class LineModel: MoleculeModelProtocol, Invertable { diff --git a/MVMCoreUI/Atomic/Atoms/Views/TooltipModel.swift b/MVMCoreUI/Atomic/Atoms/Views/TooltipModel.swift index 27400a2c..2b12cead 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/TooltipModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/TooltipModel.swift @@ -8,7 +8,7 @@ import Foundation import VDS -import VDSTokens +import VDSCoreTokens import MVMCore open class TooltipModel: MoleculeModelProtocol { diff --git a/MVMCoreUI/Atomic/Extensions/VDS-Enums+Codable.swift b/MVMCoreUI/Atomic/Extensions/VDS-Enums+Codable.swift index e8b5d90f..a419279b 100644 --- a/MVMCoreUI/Atomic/Extensions/VDS-Enums+Codable.swift +++ b/MVMCoreUI/Atomic/Extensions/VDS-Enums+Codable.swift @@ -8,7 +8,7 @@ import Foundation import VDS -import VDSTokens +import VDSCoreTokens //-------------------------------------------------- // MARK: - Codable Extensions diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/LockUps/TitleLockupModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/LockUps/TitleLockupModel.swift index a280e0b4..07c680b0 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/LockUps/TitleLockupModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/LockUps/TitleLockupModel.swift @@ -6,7 +6,7 @@ // Copyright © 2022 Verizon Wireless. All rights reserved. // -import VDSTokens +import VDSCoreTokens import VDS public class TitleLockupModel: MoleculeModelProtocol, ParentMoleculeModelProtocol { diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBar.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBar.swift index 370b47a6..742fa150 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBar.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBar.swift @@ -5,7 +5,7 @@ // Created by Scott Pfeil on 5/28/20. // Copyright © 2020 Verizon Wireless. All rights reserved. // -import VDSTokens +import VDSCoreTokens @objcMembers open class TabBar: UITabBar, MoleculeViewProtocol, TabBarProtocol, UITabBarDelegate { diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBarModel.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBarModel.swift index bbe11c36..f6a48c6e 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBarModel.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBarModel.swift @@ -7,7 +7,7 @@ // import Foundation -import VDSTokens +import VDSCoreTokens open class TabBarModel: MoleculeModelProtocol { public static var identifier: String = "tabBar" diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift index 5a34245d..d85412aa 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift @@ -7,7 +7,7 @@ // import UIKit -import VDSTokens +import VDSCoreTokens import VDS @objc public protocol TabsDelegate { diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabsModel.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabsModel.swift index a7acadf6..81f384cd 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabsModel.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabsModel.swift @@ -7,7 +7,7 @@ // import UIKit -import VDSTokens +import VDSCoreTokens import VDS open class TabsModel: MoleculeModelProtocol { diff --git a/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift b/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift index 67fc779f..c8aad07f 100644 --- a/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift +++ b/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift @@ -6,7 +6,7 @@ // Copyright © 2020 Verizon Wireless. All rights reserved. // -import VDSTokens +import VDSCoreTokens public enum NavigationItemStyle: String, Codable { case light diff --git a/MVMCoreUI/Atomic/Molecules/TopNotification/CollapsableNotification.swift b/MVMCoreUI/Atomic/Molecules/TopNotification/CollapsableNotification.swift index cef93935..5691390a 100644 --- a/MVMCoreUI/Atomic/Molecules/TopNotification/CollapsableNotification.swift +++ b/MVMCoreUI/Atomic/Molecules/TopNotification/CollapsableNotification.swift @@ -10,7 +10,7 @@ import Foundation import Combine import Dispatch import MVMCore -import VDSTokens +import VDSCoreTokens @objcMembers open class CollapsableNotification: View { //-------------------------------------------------- diff --git a/MVMCoreUI/Managers/SubNav/SubNavManagerController.swift b/MVMCoreUI/Managers/SubNav/SubNavManagerController.swift index 2bde433a..ceca433b 100644 --- a/MVMCoreUI/Managers/SubNav/SubNavManagerController.swift +++ b/MVMCoreUI/Managers/SubNav/SubNavManagerController.swift @@ -8,7 +8,7 @@ import Foundation import MVMCore -import VDSTokens +import VDSCoreTokens open class SubNavManagerController: ViewController, MVMCoreViewManagerProtocol, TabsDelegate, MVMCorePresentationDelegateProtocol, SubNavSwipeNavigationProtocol { /// The number of tabs count or less that will turn on the fillContainer From ef26c27452a8ea41fa60e758fdc56d9dfb045ce7 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Tue, 7 May 2024 12:04:13 -0400 Subject: [PATCH 09/25] Digital ACT191 story ONEAPP-7847 - Updating to use the vds core tokens library for monarch colors --- MVMCoreUI/Categories/UIColor+Extension.swift | 11 +++++----- .../coral.colorset/Contents.json | 20 ------------------- .../gray44.colorset/Contents.json | 20 ------------------- .../stone.colorset/Contents.json | 20 ------------------- 4 files changed, 6 insertions(+), 65 deletions(-) delete mode 100644 MVMCoreUI/Categories/colors.xcassets/coral.colorset/Contents.json delete mode 100644 MVMCoreUI/Categories/colors.xcassets/gray44.colorset/Contents.json delete mode 100644 MVMCoreUI/Categories/colors.xcassets/stone.colorset/Contents.json diff --git a/MVMCoreUI/Categories/UIColor+Extension.swift b/MVMCoreUI/Categories/UIColor+Extension.swift index 6ddd1da1..966436cf 100644 --- a/MVMCoreUI/Categories/UIColor+Extension.swift +++ b/MVMCoreUI/Categories/UIColor+Extension.swift @@ -7,6 +7,7 @@ // import UIKit +import VDSCoreTokens public typealias ColorHexTuple = (uiColor: UIColor, hex: String) @@ -234,19 +235,19 @@ extension UIColor { //-------------------------------------------------- /// HEX: #F3EDE0 - @objc public static let stone = UIColor.assetColor(named: "stone") + @objc public static let stone = VDSCoreTokens.VDSColor.paletteStone // HEX:#FF3C2D - @objc public static let coral = UIColor.assetColor(named: "coral") + @objc public static let coral = VDSCoreTokens.VDSColor.paletteCoral // HEX:#6F7171 - @objc public static let gray44 = UIColor.assetColor(named: "gray44") + @objc public static let gray44 = VDSCoreTokens.VDSColor.paletteGray44 // HEX:#D8DADA - @objc public static let gray85 = mvmCoolGray3 + @objc public static let gray85 = VDSCoreTokens.VDSColor.paletteGray85 // HEX:#F6F6F6 - @objc public static let gray95 = mvmCoolGray1 + @objc public static let gray95 = VDSCoreTokens.VDSColor.paletteGray95 //-------------------------------------------------- // MARK: - Functions diff --git a/MVMCoreUI/Categories/colors.xcassets/coral.colorset/Contents.json b/MVMCoreUI/Categories/colors.xcassets/coral.colorset/Contents.json deleted file mode 100644 index a834049e..00000000 --- a/MVMCoreUI/Categories/colors.xcassets/coral.colorset/Contents.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "colors" : [ - { - "color" : { - "color-space" : "srgb", - "components" : { - "alpha" : "1.000", - "blue" : "0x2D", - "green" : "0x3C", - "red" : "0xFF" - } - }, - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/MVMCoreUI/Categories/colors.xcassets/gray44.colorset/Contents.json b/MVMCoreUI/Categories/colors.xcassets/gray44.colorset/Contents.json deleted file mode 100644 index 296ef27c..00000000 --- a/MVMCoreUI/Categories/colors.xcassets/gray44.colorset/Contents.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "colors" : [ - { - "color" : { - "color-space" : "srgb", - "components" : { - "alpha" : "1.000", - "blue" : "0x71", - "green" : "0x71", - "red" : "0x6F" - } - }, - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/MVMCoreUI/Categories/colors.xcassets/stone.colorset/Contents.json b/MVMCoreUI/Categories/colors.xcassets/stone.colorset/Contents.json deleted file mode 100644 index ead33d73..00000000 --- a/MVMCoreUI/Categories/colors.xcassets/stone.colorset/Contents.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "colors" : [ - { - "color" : { - "color-space" : "srgb", - "components" : { - "alpha" : "1.000", - "blue" : "0xE0", - "green" : "0xED", - "red" : "0xF3" - } - }, - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} From 7e4b2a781dd2624940cefe5c7dcbee40010f525d Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Wed, 8 May 2024 15:28:43 -0400 Subject: [PATCH 10/25] Digital ACT191 story ONEAPP-7847 - neonYellow and monarchRed --- MVMCoreUI/Categories/UIColor+Extension.swift | 4 +++- .../colors.xcassets/yellow.colorset/Contents.json | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/Categories/UIColor+Extension.swift b/MVMCoreUI/Categories/UIColor+Extension.swift index 966436cf..59be616b 100644 --- a/MVMCoreUI/Categories/UIColor+Extension.swift +++ b/MVMCoreUI/Categories/UIColor+Extension.swift @@ -21,6 +21,7 @@ extension UIColor { public static let names: [String: ColorHexTuple] = ["black": (.mvmBlack, "#000000"), "white": (.mvmWhite, "#FFFFFF"), "red": (.mvmRed, "#EE0000"), + "monarchRed": (VDSCoreTokens.VDSColor.paletteMonarchred, "#f50a23"), "pink": (.mvmPink, "#D90368"), "pink33": (.mvmPink33, "#F2ABCD"), "pink66": (.mvmPink66, "#E6589B"), @@ -48,7 +49,8 @@ extension UIColor { "blueShade1": (.mvmBlueShade1, "#136598"), "blueShade2": (.mvmBlueShade2, "#0B4467"), "blueInverted": (.mvmBlueInverted, "#0088CE"), - "yellow": (.mvmYellow, "#F5FF1E"), + "yellow": (.mvmYellow, "#FFBC3D"), + "neonYellow": (VDSCoreTokens.VDSColor.paletteNeonyellow, "#f5ff1e"), "coolGray1": (.mvmCoolGray1, "#F6F6F6"), "coolGray3": (.mvmCoolGray3, "#D8DADA"), "coolGray6": (.mvmCoolGray6, "#747676"), diff --git a/MVMCoreUI/Categories/colors.xcassets/yellow.colorset/Contents.json b/MVMCoreUI/Categories/colors.xcassets/yellow.colorset/Contents.json index 5d0cb64a..8467664a 100644 --- a/MVMCoreUI/Categories/colors.xcassets/yellow.colorset/Contents.json +++ b/MVMCoreUI/Categories/colors.xcassets/yellow.colorset/Contents.json @@ -5,9 +5,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0x1E", - "green" : "0xFF", - "red" : "0xF5" + "blue" : "0x3D", + "green" : "0xBC", + "red" : "0xFF" } }, "idiom" : "universal" From df02a46c62636c0ae4da70ea87755d4906757416 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Tue, 4 Jun 2024 10:48:47 -0400 Subject: [PATCH 11/25] Tableview and collection view optimizations --- MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift | 1 + .../BaseControllers/ThreeLayerTableViewController.swift | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift b/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift index 12399292..6ed0c584 100644 --- a/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift +++ b/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift @@ -177,6 +177,7 @@ open class Carousel: View { if let originalModel, carouselModel.isDeeplyVisuallyEquivalent(to: originalModel) { // Prevents a carousel reset while still updating the cell backing data through reconfigureItems. MVMCoreLoggingHandler.shared()?.handleDebugMessage("[\(Self.self)] Model is visually equivalent. Skipping rebuild...") + prepareMolecules(with: carouselModel) FormValidator.setupValidation(for: carouselModel, delegate: delegateObject?.formHolderDelegate) updateModelIndex() // Ensure the new model indexing matches the old. pagingView?.currentIndex = pageIndex // Trigger a paging view render. diff --git a/MVMCoreUI/BaseControllers/ThreeLayerTableViewController.swift b/MVMCoreUI/BaseControllers/ThreeLayerTableViewController.swift index 9ae3b1c4..d7c60545 100644 --- a/MVMCoreUI/BaseControllers/ThreeLayerTableViewController.swift +++ b/MVMCoreUI/BaseControllers/ThreeLayerTableViewController.swift @@ -56,13 +56,14 @@ open class ThreeLayerTableViewController: ProgrammaticTableViewController, Rotor } open override func updateUI(for molecules: [MoleculeModelProtocol]? = nil) { + let isFirstRender = self.isFirstRender super.updateUI(for: molecules) guard molecules == nil else { return } - + createViewForTableHeader() createViewForTableFooter() - tableView?.reloadData() + // Reloading the table is handled in updateViews. } override open func viewDidLoad() { From 2dcbc9d41b64f61ffdfd53abe3ca8a44ebdc5d52 Mon Sep 17 00:00:00 2001 From: "Hedden, Kyle Matthew" Date: Tue, 11 Jun 2024 19:06:46 -0400 Subject: [PATCH 12/25] Digital PCT265 defect CXTDT-569436: Restore render dispatch in handleNewData. Add optional flag to disable in situations where we want to handle it ourselves. --- .../Atomic/Templates/CollectionTemplate.swift | 4 +-- .../Templates/ModalMoleculeListTemplate.swift | 4 +-- .../ModalMoleculeStackTemplate.swift | 4 +-- .../Templates/MoleculeListTemplate.swift | 4 +-- .../Templates/MoleculeStackTemplate.swift | 4 +-- .../BaseControllers/ViewController.swift | 27 ++++++++++++------- 6 files changed, 27 insertions(+), 20 deletions(-) diff --git a/MVMCoreUI/Atomic/Templates/CollectionTemplate.swift b/MVMCoreUI/Atomic/Templates/CollectionTemplate.swift index e9e8b46f..a88e223b 100644 --- a/MVMCoreUI/Atomic/Templates/CollectionTemplate.swift +++ b/MVMCoreUI/Atomic/Templates/CollectionTemplate.swift @@ -79,10 +79,10 @@ } - open override func handleNewData(_ pageModel: PageModelProtocol? = nil) { + open override func handleNewData(_ pageModel: PageModelProtocol? = nil, shouldTriggerRender: Bool = true) { setup() registerCells() - super.handleNewData(pageModel) + super.handleNewData(pageModel, shouldTriggerRender: shouldTriggerRender) } open override func updateUI(for molecules: [MoleculeModelProtocol]? = nil) { diff --git a/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift b/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift index 16afd5bd..e17eaf89 100644 --- a/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift +++ b/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift @@ -25,8 +25,8 @@ open class ModalMoleculeListTemplate: MoleculeListTemplate { try decoder.decode(ModalListPageTemplateModel.self, from: data) } - override open func handleNewData(_ pageModel: PageModelProtocol? = nil) { - super.handleNewData(pageModel) + override open func handleNewData(_ pageModel: PageModelProtocol? = nil, shouldTriggerRender: Bool = true) { + super.handleNewData(pageModel, shouldTriggerRender: shouldTriggerRender) closeButton = MVMCoreUICommonViewsUtility.addCloseButton(to: view, action: { [weak self] _ in guard let self = self else { return } diff --git a/MVMCoreUI/Atomic/Templates/ModalMoleculeStackTemplate.swift b/MVMCoreUI/Atomic/Templates/ModalMoleculeStackTemplate.swift index f3264b1b..5ca4616d 100644 --- a/MVMCoreUI/Atomic/Templates/ModalMoleculeStackTemplate.swift +++ b/MVMCoreUI/Atomic/Templates/ModalMoleculeStackTemplate.swift @@ -23,8 +23,8 @@ open class ModalMoleculeStackTemplate: MoleculeStackTemplate { // MARK: - Lifecycle //-------------------------------------------------- - override open func handleNewData(_ pageModel: PageModelProtocol? = nil) { - super.handleNewData(pageModel) + override open func handleNewData(_ pageModel: PageModelProtocol? = nil, shouldTriggerRender: Bool = true) { + super.handleNewData(pageModel, shouldTriggerRender: shouldTriggerRender) _ = MVMCoreUICommonViewsUtility.addCloseButton(to: view, action: { [weak self] _ in guard let self = self else { return } let closeAction = (self.templateModel as? ModalStackPageTemplateModel)?.closeAction ?? diff --git a/MVMCoreUI/Atomic/Templates/MoleculeListTemplate.swift b/MVMCoreUI/Atomic/Templates/MoleculeListTemplate.swift index 5eb23107..40bcd134 100644 --- a/MVMCoreUI/Atomic/Templates/MoleculeListTemplate.swift +++ b/MVMCoreUI/Atomic/Templates/MoleculeListTemplate.swift @@ -85,8 +85,8 @@ open class MoleculeListTemplate: ThreeLayerTableViewController, TemplateProtocol return view } - open override func handleNewData(_ pageModel: PageModelProtocol? = nil) { - super.handleNewData(pageModel) + open override func handleNewData(_ pageModel: PageModelProtocol? = nil, shouldTriggerRender: Bool = true) { + super.handleNewData(pageModel, shouldTriggerRender: shouldTriggerRender) if pageModel != nil { setup() diff --git a/MVMCoreUI/Atomic/Templates/MoleculeStackTemplate.swift b/MVMCoreUI/Atomic/Templates/MoleculeStackTemplate.swift index 8ce8cd67..bcfc2db4 100644 --- a/MVMCoreUI/Atomic/Templates/MoleculeStackTemplate.swift +++ b/MVMCoreUI/Atomic/Templates/MoleculeStackTemplate.swift @@ -20,10 +20,10 @@ open class MoleculeStackTemplate: ThreeLayerViewController, TemplateProtocol { // MARK: - Lifecycle //-------------------------------------------------- - open override func handleNewData(_ pageModel: PageModelProtocol? = nil) { + open override func handleNewData(_ pageModel: PageModelProtocol? = nil, shouldTriggerRender: Bool = true) { topViewOutsideOfScroll = templateModel?.anchorHeader ?? false bottomViewOutsideOfScroll = templateModel?.anchorFooter ?? false - super.handleNewData(pageModel) + super.handleNewData(pageModel, shouldTriggerRender: shouldTriggerRender) } // For subclassing the model. diff --git a/MVMCoreUI/BaseControllers/ViewController.swift b/MVMCoreUI/BaseControllers/ViewController.swift index dc2ed356..15b172ce 100644 --- a/MVMCoreUI/BaseControllers/ViewController.swift +++ b/MVMCoreUI/BaseControllers/ViewController.swift @@ -225,9 +225,9 @@ import MVMCore return navigationModel } - /// Processes any new data. Called after the page is loaded the first time and on response updates for this page. Triggers a render refresh. + /// Processes any new data. Called after the page is loaded the first time and on response updates for this page. Triggers a render refresh unless specified otherwise. @MainActor - open func handleNewData(_ pageModel: PageModelProtocol? = nil) { + open func handleNewData(_ pageModel: PageModelProtocol? = nil, shouldTriggerRender: Bool = true) { guard var newPageModel = pageModel ?? self.pageModel else { return } let originalModel = isFirstRender ? nil : self.pageModel as? MVMControllerModelProtocol @@ -279,13 +279,19 @@ import MVMCore // Notify the manager of new data. // Warning: Some flows cause table reloads. Until the UI update is decoupled, should be after the updateUI. manager?.newDataReceived?(in: self) - - if allUpdatedMolecules.isEmpty || isFirstRender { - debugLog("Performing full page render...") - updateUI() - } else { - debugLog("Performing partial render of \(allUpdatedMolecules) molecules...") - updateUI(for: allUpdatedMolecules) + + guard shouldTriggerRender else { return } + + // Dispatch to decouple execution. First massage data through template classes, then render. + Task { @MainActor in + + if allUpdatedMolecules.isEmpty || isFirstRender { + debugLog("Performing full page render...") + updateUI() + } else { + debugLog("Performing partial render of \(allUpdatedMolecules) molecules...") + updateUI(for: allUpdatedMolecules) + } } } @@ -399,7 +405,8 @@ import MVMCore initialLoad() } - handleNewData(pageModel) // Set outside shouldFinishProcessingLoad. + handleNewData(pageModel, shouldTriggerRender: false) // Set outside shouldFinishProcessingLoad. + updateUI() // Force the rendering on the same main UI thread. } open override func viewDidLayoutSubviews() { From 750e50d476bfeb68603caf611ad60376577d83ea Mon Sep 17 00:00:00 2001 From: "Hedden, Kyle Matthew" Date: Wed, 12 Jun 2024 15:59:43 -0400 Subject: [PATCH 13/25] Digital PCT265 story DE307-731: Support 'gone' configuration for carousel cells. --- MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift | 5 +++++ MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift | 4 ++-- MVMCoreUI/Atomic/Organisms/Carousel/CarouselModel.swift | 4 ++++ .../Protocols/ModelProtocols/CarouselItemModelProtocol.swift | 1 + 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift b/MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift index f7b875c1..bbcca3f6 100644 --- a/MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift +++ b/MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift @@ -24,6 +24,7 @@ public var fieldKey: String? public var groupName: String = FormValidator.defaultGroupName public var baseValue: AnyHashable? + public var gone: Bool = false //-------------------------------------------------- // MARK: - Validation @@ -53,6 +54,7 @@ case groupName case enabled case readOnly + case gone } //-------------------------------------------------- @@ -76,6 +78,7 @@ if let readOnly = try typeContainer.decodeIfPresent(Bool.self, forKey: .readOnly) { self.readOnly = readOnly } + gone = try typeContainer.decodeIfPresent(Bool.self, forKey: .gone) ?? false try super.init(from: decoder) } @@ -99,6 +102,7 @@ && fieldValue == model.fieldValue && enabled == model.enabled && readOnly == model.readOnly + && gone == model.gone } public override func isVisuallyEquivalent(to model: any MoleculeModelComparisonProtocol) -> Bool { @@ -107,5 +111,6 @@ && peakingArrowColor == model.peakingArrowColor && enabled == model.enabled && readOnly == model.readOnly + && gone == model.gone } } diff --git a/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift b/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift index 12399292..1601acfe 100644 --- a/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift +++ b/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift @@ -90,7 +90,7 @@ open class Carousel: View { showPeaking(false) // Go to current cell. layoutIfNeeded is needed otherwise cellForItem returns nil for peaking logic. The dispatch is a sad way to ensure the collection view is ready to be scrolled. - guard let model = model as? CarouselModel, !model.molecules.isEmpty else { return } + guard let model = model as? CarouselModel, !model.visibleMolecules.isEmpty else { return } guard (model.paging == true || loop == true) else { DispatchQueue.main.async { [self] in updatePagerVisibility() @@ -228,7 +228,7 @@ open class Carousel: View { //-------------------------------------------------- func prepareMolecules(with carouselModel: CarouselModel?) { - guard let newMolecules = carouselModel?.molecules else { + guard let newMolecules = carouselModel?.visibleMolecules else { numberOfPages = 0 molecules = nil return diff --git a/MVMCoreUI/Atomic/Organisms/Carousel/CarouselModel.swift b/MVMCoreUI/Atomic/Organisms/Carousel/CarouselModel.swift index 42c8363c..58ee28e6 100644 --- a/MVMCoreUI/Atomic/Organisms/Carousel/CarouselModel.swift +++ b/MVMCoreUI/Atomic/Organisms/Carousel/CarouselModel.swift @@ -44,6 +44,10 @@ import UIKit public var selectable = false public var selectedIndex: Int? + public var visibleMolecules: [MoleculeModelProtocol & CarouselItemModelProtocol] { + molecules.filter { !$0.gone } + } + public init(molecules: [MoleculeModelProtocol & CarouselItemModelProtocol]) { self.molecules = molecules } diff --git a/MVMCoreUI/Atomic/Protocols/ModelProtocols/CarouselItemModelProtocol.swift b/MVMCoreUI/Atomic/Protocols/ModelProtocols/CarouselItemModelProtocol.swift index ed09d90e..affa294b 100644 --- a/MVMCoreUI/Atomic/Protocols/ModelProtocols/CarouselItemModelProtocol.swift +++ b/MVMCoreUI/Atomic/Protocols/ModelProtocols/CarouselItemModelProtocol.swift @@ -9,6 +9,7 @@ public protocol CarouselItemModelProtocol: FormFieldProtocol, ContainerModelProtocol { var analyticsData: JSONValueDictionary? { get set } + var gone: Bool { get set } } public extension CarouselItemModelProtocol { From b635ec7d95a1b43b74f76568997f2d682b639dce Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 12 Jun 2024 15:37:52 -0500 Subject: [PATCH 14/25] refactored to vds buttonIcon breaking change Signed-off-by: Matt Bruce --- MVMCoreUI/Atomic/Atoms/Views/ButtonIcon.swift | 4 +++- .../Atomic/Atoms/Views/ButtonIconModel.swift | 16 ++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/ButtonIcon.swift b/MVMCoreUI/Atomic/Atoms/Views/ButtonIcon.swift index 89237662..50802ff9 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/ButtonIcon.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/ButtonIcon.swift @@ -41,7 +41,9 @@ open class ButtonIcon: VDS.ButtonIcon, VDSMoleculeViewProtocol { iconName = viewModel.iconName selectedIconName = viewModel.selectedIconName size = viewModel.size - customSize = viewModel.customSize + customContainerSize = viewModel.customContainerSize + customIconSize = viewModel.customIconSize + customBadgeIndicatorOffset = viewModel.customBadgeIndicatorOffSet floating = viewModel.floating fitToIcon = viewModel.fitToIcon hideBorder = viewModel.hideBorder diff --git a/MVMCoreUI/Atomic/Atoms/Views/ButtonIconModel.swift b/MVMCoreUI/Atomic/Atoms/Views/ButtonIconModel.swift index ed93e969..aefa9dfe 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/ButtonIconModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/ButtonIconModel.swift @@ -31,7 +31,9 @@ open class ButtonIconModel: ButtonModelProtocol, MoleculeModelProtocol { public var iconName: Icon.Name = .info public var selectedIconName: Icon.Name? public var size = ButtonIcon.Size.large - public var customSize : Int? + public var customContainerSize : Int? + public var customIconSize : Int? + public var customBadgeIndicatorOffSet : CGPoint? public var floating: Bool = false public var fitToIcon: Bool = false public var hideBorder: Bool = true @@ -85,7 +87,9 @@ open class ButtonIconModel: ButtonModelProtocol, MoleculeModelProtocol { case iconName case selectedIconName case size - case customSize + case customContainerSize + case customIconSize + case customBadgeIndicatorOffSet case floating case fitToIcon case hideBorder @@ -110,7 +114,9 @@ open class ButtonIconModel: ButtonModelProtocol, MoleculeModelProtocol { iconName = try container.decode(Icon.Name.self, forKey: .iconName) selectedIconName = try container.decodeIfPresent(Icon.Name.self, forKey: .selectedIconName) size = try container.decodeIfPresent(ButtonIcon.Size.self, forKey: .size) ?? .large - customSize = try container.decodeIfPresent(Int.self, forKey: .customSize) + customContainerSize = try container.decodeIfPresent(Int.self, forKey: .customContainerSize) + customIconSize = try container.decodeIfPresent(Int.self, forKey: .customIconSize) + customBadgeIndicatorOffSet = try container.decodeIfPresent(CGPoint.self, forKey: .customBadgeIndicatorOffSet) floating = try container.decodeIfPresent(Bool.self, forKey: .floating) ?? false fitToIcon = try container.decodeIfPresent(Bool.self, forKey: .fitToIcon) ?? false hideBorder = try container.decodeIfPresent(Bool.self, forKey: .hideBorder) ?? false @@ -131,7 +137,9 @@ open class ButtonIconModel: ButtonModelProtocol, MoleculeModelProtocol { try container.encode(iconName, forKey: .iconName) try container.encodeIfPresent(selectedIconName, forKey: .selectedIconName) try container.encodeIfPresent(size, forKey: .size) - try container.encodeIfPresent(customSize, forKey: .customSize) + try container.encodeIfPresent(customContainerSize, forKey: .customContainerSize) + try container.encodeIfPresent(customIconSize, forKey: .customIconSize) + try container.encodeIfPresent(customBadgeIndicatorOffSet, forKey: .customBadgeIndicatorOffSet) try container.encodeIfPresent(floating, forKey: .floating) try container.encodeIfPresent(fitToIcon, forKey: .fitToIcon) try container.encodeIfPresent(hideBorder, forKey: .hideBorder) From 7a4984f2d8515f8ba3a51074ece9003d24e835b3 Mon Sep 17 00:00:00 2001 From: "Hedden, Kyle Matthew" Date: Wed, 12 Jun 2024 23:14:10 -0400 Subject: [PATCH 15/25] Digital PCT265 story DE307-731: Restore missing support for deep replacemenr by moving the template extension to ParentMoleculeModelProtocol. --- .../Atomic/Organisms/Carousel/Carousel.swift | 4 ++- .../CarouselItemModelProtocol.swift | 5 ++++ .../ParentMoleculeModelProtocol.swift | 22 ++++++++++++++- .../TemplateModelProtocol.swift | 28 ------------------- .../ReplaceableMoleculeBehaviorModel.swift | 4 +-- 5 files changed, 31 insertions(+), 32 deletions(-) diff --git a/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift b/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift index 1601acfe..df83fc2a 100644 --- a/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift +++ b/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift @@ -174,7 +174,9 @@ open class Carousel: View { MVMCoreLoggingHandler.shared()?.handleDebugMessage("[\(Self.self)] [\(ObjectIdentifier(self).hashValue)]\noriginal model: \(originalModel?.debugDescription ?? "none")\nnew model: \(model)") if #available(iOS 15.0, *) { - if let originalModel, carouselModel.isDeeplyVisuallyEquivalent(to: originalModel) { + if let originalModel, carouselModel.isDeeplyVisuallyEquivalent(to: originalModel), + originalModel.visibleMolecules.isVisuallyEquivalent(to: molecules ?? []) // Since the carousel model's children are in place replaced and we do not have a deep copy of this model tree, add in this hack to check if the prior captured carousel items match the newly visible ones. + { // Prevents a carousel reset while still updating the cell backing data through reconfigureItems. MVMCoreLoggingHandler.shared()?.handleDebugMessage("[\(Self.self)] Model is visually equivalent. Skipping rebuild...") FormValidator.setupValidation(for: carouselModel, delegate: delegateObject?.formHolderDelegate) diff --git a/MVMCoreUI/Atomic/Protocols/ModelProtocols/CarouselItemModelProtocol.swift b/MVMCoreUI/Atomic/Protocols/ModelProtocols/CarouselItemModelProtocol.swift index affa294b..24a0bb02 100644 --- a/MVMCoreUI/Atomic/Protocols/ModelProtocols/CarouselItemModelProtocol.swift +++ b/MVMCoreUI/Atomic/Protocols/ModelProtocols/CarouselItemModelProtocol.swift @@ -17,4 +17,9 @@ public extension CarouselItemModelProtocol { get { nil } set { analyticsData = newValue } } + + var gone: Bool{ + get { false } + set { } + } } diff --git a/MVMCoreUI/Atomic/Protocols/ModelProtocols/ParentMoleculeModelProtocol.swift b/MVMCoreUI/Atomic/Protocols/ModelProtocols/ParentMoleculeModelProtocol.swift index d0e1c13f..13bb75b3 100644 --- a/MVMCoreUI/Atomic/Protocols/ModelProtocols/ParentMoleculeModelProtocol.swift +++ b/MVMCoreUI/Atomic/Protocols/ModelProtocols/ParentMoleculeModelProtocol.swift @@ -43,7 +43,7 @@ public extension ParentModelProtocol where Self: AnyObject { func replaceChildMolecule(in molecules: inout [T], with replacementMolecule: MoleculeModelProtocol) throws -> MoleculeModelProtocol? { var replacedMolecule: MoleculeModelProtocol? - return try replaceChildMolecule(at: &molecules, with: replacementMolecule, replaced: &replacedMolecule) ? replacedMolecule : nil + return try replaceChildMolecule(in: &molecules, with: replacementMolecule, replaced: &replacedMolecule) ? replacedMolecule : nil } /// Helper for replacing a molecule in place within an array. Note the "in". @@ -67,6 +67,26 @@ public protocol ParentMoleculeModelProtocol: ParentModelProtocol, MoleculeModelP public extension ParentMoleculeModelProtocol { + /// Recursively finds and replaces the first child matching the replacement molecule id property. + mutating func deepReplaceMolecule(with replacementMolecule: MoleculeModelProtocol) throws -> MoleculeModelProtocol? { + var replacedMolecule: MoleculeModelProtocol? + var possibleError: Error? + // Dive into each root. + depthFirstTraverse(options: .parentFirst, depth: 0) { depth, molecule, stop in + guard var parentMolecule = molecule as? ParentMoleculeModelProtocol else { return } + do { + replacedMolecule = try parentMolecule.replaceChildMolecule(with: replacementMolecule) + } catch { + possibleError = error + } + stop = replacedMolecule != nil || possibleError != nil + } + if let error = possibleError { + throw error + } + return replacedMolecule + } + func reduceDepthFirstTraverse(options: TreeTraversalOptions, depth: Int, initialResult: Result, nextPartialResult: (Result, MoleculeModelProtocol, Int) -> Result) -> Result { var result = initialResult if (options == .parentFirst) { diff --git a/MVMCoreUI/Atomic/Protocols/ModelProtocols/TemplateModelProtocol.swift b/MVMCoreUI/Atomic/Protocols/ModelProtocols/TemplateModelProtocol.swift index b598041b..b3d8bb59 100644 --- a/MVMCoreUI/Atomic/Protocols/ModelProtocols/TemplateModelProtocol.swift +++ b/MVMCoreUI/Atomic/Protocols/ModelProtocols/TemplateModelProtocol.swift @@ -40,31 +40,3 @@ public extension TemplateModelProtocol { return rootMolecules.depthFirstTraverse(options: options, depth: depth, onVisit: onVisit) } } - -extension TemplateModelProtocol { - - /// Recursively finds and replaces the first child matching the replacement molecule id property. - mutating func replaceMolecule(with replacementMolecule: MoleculeModelProtocol) throws -> MoleculeModelProtocol? { - // Attempt root level replacement on the template model first. - if let replacedMolecule = try replaceChildMolecule(with: replacementMolecule) { - return replacedMolecule - } - - var replacedMolecule: MoleculeModelProtocol? - var possibleError: Error? - // Dive into each root thereafter. - depthFirstTraverse(options: .parentFirst, depth: 0) { depth, molecule, stop in - guard var parentMolecule = molecule as? ParentMoleculeModelProtocol else { return } - do { - replacedMolecule = try parentMolecule.replaceChildMolecule(with: replacementMolecule) - } catch { - possibleError = error - } - stop = replacedMolecule != nil || possibleError != nil - } - if let error = possibleError { - throw error - } - return replacedMolecule - } -} diff --git a/MVMCoreUI/Behaviors/ReplaceableMoleculeBehaviorModel.swift b/MVMCoreUI/Behaviors/ReplaceableMoleculeBehaviorModel.swift index c03594d4..9cbf85ed 100644 --- a/MVMCoreUI/Behaviors/ReplaceableMoleculeBehaviorModel.swift +++ b/MVMCoreUI/Behaviors/ReplaceableMoleculeBehaviorModel.swift @@ -41,7 +41,7 @@ public class ReplaceableMoleculeBehavior: PageMoleculeTransformationBehavior, Co self.delegateObject = delegateObject guard let pageType = delegateObject?.moleculeDelegate?.getTemplateModel()?.pageType else { return } MVMCoreViewControllerMappingObject.shared()?.addOptionalModules(toMapping: moleculeIds, forPageType: pageType) - Self.debugLog("Initializing for \((model as! ReplaceableMoleculeBehaviorModel).moleculeIds)") + Self.debugLog("Initializing for \(moleculeIds)") } public func onPageNew(rootMolecules: [MoleculeModelProtocol], _ delegateObject: MVMCoreUIDelegateObject?, changes: inout [MoleculeModelProtocol]) -> [MoleculeModelProtocol]? { @@ -85,7 +85,7 @@ public class ReplaceableMoleculeBehavior: PageMoleculeTransformationBehavior, Co moleculeModels.forEach { newMolecule in do { - if let replacedMolecule = try parentMolecule.replaceChildMolecule(with: newMolecule) { + if let replacedMolecule = try parentMolecule.deepReplaceMolecule(with: newMolecule) { guard !replacedMolecule.deepEquals(to: newMolecule) else { // Note: Slight risk here of replacing the something in the original tree and misreporting that is it not replaced based on equality. debugLog("deep molecule \(newMolecule) is the same as \(replacedMolecule). skipping...") From 2ce7a7dbc653ee85003c440971846d17b8a2ce1c Mon Sep 17 00:00:00 2001 From: "Hedden, Kyle Matthew" Date: Thu, 13 Jun 2024 10:19:13 -0400 Subject: [PATCH 16/25] Digital PCT265 story DE307-731: Earlier behavior application. Sumanth catch. --- MVMCoreUI/BaseControllers/ViewController.swift | 12 ++++++++---- .../Protocols/PageBehaviorHandlerProtocol.swift | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/MVMCoreUI/BaseControllers/ViewController.swift b/MVMCoreUI/BaseControllers/ViewController.swift index 15b172ce..78191da5 100644 --- a/MVMCoreUI/BaseControllers/ViewController.swift +++ b/MVMCoreUI/BaseControllers/ViewController.swift @@ -146,6 +146,11 @@ import MVMCore do { let template = try parsePageJSON(loadObject: loadObject) pageModel = template // TODO: Eventually this page parsing should be done outside of this class and then set by the caller. For now, double duty. + // Needed for PageMoleculeTransformationBehavior + PageLocalDataShareBehavior behaviors. + if let behaviorContainer = template as? (PageBehaviorContainerModelProtocol & TemplateModelProtocol) { + var behaviorHandler = self + behaviorHandler.applyBehaviors(pageBehaviorModel: behaviorContainer) + } isFirstRender = true // Assuming this is only on the first page load from the handler. Might need to revist later. if let backgroundRequest = loadObject.requestParameters?.backgroundRequest, !backgroundRequest, let pageType, let identifier = loadObject.identifier { MVMCoreLoggingHandler.shared()?.logCoreEvent(.pageProcessingComplete(pageType: pageType, requestUUID: identifier, webUrl: nil)) @@ -230,11 +235,11 @@ import MVMCore open func handleNewData(_ pageModel: PageModelProtocol? = nil, shouldTriggerRender: Bool = true) { guard var newPageModel = pageModel ?? self.pageModel else { return } - let originalModel = isFirstRender ? nil : self.pageModel as? MVMControllerModelProtocol + let originalModel = self.pageModel as? MVMControllerModelProtocol - // Refresh our behaviors if there is a page change. + // Refresh our behaviors if there is a page change. Originally set up in shouldFinishProcessingLoad. if let behaviorContainer = newPageModel as? (PageBehaviorContainerModelProtocol & TemplateModelProtocol), - (originalModel == nil || originalModel!.id != behaviorContainer.id) { + (originalModel == nil || originalModel!.id != behaviorContainer.id) { var behaviorHandler = self behaviorHandler.applyBehaviors(pageBehaviorModel: behaviorContainer) } @@ -277,7 +282,6 @@ import MVMCore let allUpdatedMolecules = behaviorUpdatedModels //+ pageUpdatedModels // Notify the manager of new data. - // Warning: Some flows cause table reloads. Until the UI update is decoupled, should be after the updateUI. manager?.newDataReceived?(in: self) guard shouldTriggerRender else { return } diff --git a/MVMCoreUI/Behaviors/Protocols/PageBehaviorHandlerProtocol.swift b/MVMCoreUI/Behaviors/Protocols/PageBehaviorHandlerProtocol.swift index 566a3f3d..ad50b9ed 100644 --- a/MVMCoreUI/Behaviors/Protocols/PageBehaviorHandlerProtocol.swift +++ b/MVMCoreUI/Behaviors/Protocols/PageBehaviorHandlerProtocol.swift @@ -41,7 +41,7 @@ public extension PageBehaviorHandlerProtocol { // Apply them to the page. self.behaviors = behaviors.count > 0 ? behaviors : nil - // Ask the session to apply any more. (Curently inverted contol due to Swift <--> Obj-C conflict. + // Ask the session to apply any more. (Currently inverted contol due to Swift <--> Obj-C conflict.) if let viewController = self as? UIViewController { MVMCoreUISession.sharedGlobal()?.applyGlobalBehaviors(to: viewController) } From 725d4e3cd72bf613a1fcb7d9d8d39f1b81b731ea Mon Sep 17 00:00:00 2001 From: "Hedden, Kyle Matthew" Date: Fri, 14 Jun 2024 13:49:18 -0400 Subject: [PATCH 17/25] Digital PCT265 defect CXTDT-573370: Expose VDS bundle helper in MVMCoreUI. --- MVMCoreUI/Utility/MVMCoreUIUtility.h | 3 +++ MVMCoreUI/Utility/MVMCoreUIUtility.m | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/MVMCoreUI/Utility/MVMCoreUIUtility.h b/MVMCoreUI/Utility/MVMCoreUIUtility.h index c6959723..daba0310 100644 --- a/MVMCoreUI/Utility/MVMCoreUIUtility.h +++ b/MVMCoreUI/Utility/MVMCoreUIUtility.h @@ -22,6 +22,9 @@ NS_ASSUME_NONNULL_BEGIN // The bundle for this framework + (nullable NSBundle *)bundleForMVMCoreUI; +/// The bundle for the VDS frameowrk. Handy for accessing VDS resources such as fonts. ++ (nullable NSBundle *)bundleForVDS; + // Returns the hardcoded string from the string file. + (nullable NSString *)hardcodedStringWithKey:(nonnull NSString *)key; diff --git a/MVMCoreUI/Utility/MVMCoreUIUtility.m b/MVMCoreUI/Utility/MVMCoreUIUtility.m index ad7366df..c8e57888 100644 --- a/MVMCoreUI/Utility/MVMCoreUIUtility.m +++ b/MVMCoreUI/Utility/MVMCoreUIUtility.m @@ -22,6 +22,10 @@ return [NSBundle bundleWithIdentifier:@"com.vzw.MVMCoreUI"]; } ++ (nullable NSBundle *)bundleForVDS { + return [NSBundle bundleWithIdentifier:@"com.vzw.vds"]; +} + + (nullable NSString *)hardcodedStringWithKey:(nonnull NSString *)key { // Redirect key with relevant module. return [MVMCoreGetterUtility hardcodedStringWithKey:key bundle:[MVMCoreUIUtility bundleForMVMCoreUI]]; From 19f08dca7993b2a69efea6f790f1e69cb4dcb5a5 Mon Sep 17 00:00:00 2001 From: "Hedden, Kyle Matthew" Date: Fri, 14 Jun 2024 14:15:00 -0400 Subject: [PATCH 18/25] Digital PCT265 defect CXTDT-573370: Code review. Matt's genious. --- MVMCoreUI/Utility/MVMCoreUIUtility.h | 2 +- MVMCoreUI/Utility/MVMCoreUIUtility.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Utility/MVMCoreUIUtility.h b/MVMCoreUI/Utility/MVMCoreUIUtility.h index daba0310..12c1aa34 100644 --- a/MVMCoreUI/Utility/MVMCoreUIUtility.h +++ b/MVMCoreUI/Utility/MVMCoreUIUtility.h @@ -23,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN + (nullable NSBundle *)bundleForMVMCoreUI; /// The bundle for the VDS frameowrk. Handy for accessing VDS resources such as fonts. -+ (nullable NSBundle *)bundleForVDS; ++ (nullable NSBundle *)bundleForFonts; // Returns the hardcoded string from the string file. + (nullable NSString *)hardcodedStringWithKey:(nonnull NSString *)key; diff --git a/MVMCoreUI/Utility/MVMCoreUIUtility.m b/MVMCoreUI/Utility/MVMCoreUIUtility.m index c8e57888..e725114d 100644 --- a/MVMCoreUI/Utility/MVMCoreUIUtility.m +++ b/MVMCoreUI/Utility/MVMCoreUIUtility.m @@ -22,7 +22,7 @@ return [NSBundle bundleWithIdentifier:@"com.vzw.MVMCoreUI"]; } -+ (nullable NSBundle *)bundleForVDS { ++ (nullable NSBundle *)bundleForFonts { return [NSBundle bundleWithIdentifier:@"com.vzw.vds"]; } From be797aaee246d51f1da0a8be9f64f91f7cb98d82 Mon Sep 17 00:00:00 2001 From: "Hedden, Kyle Matthew" Date: Mon, 17 Jun 2024 19:21:19 -0400 Subject: [PATCH 19/25] Digital PCT265 defect DE307-687: Re-log all analytics on page state return. --- .../ReplaceableMoleculeBehaviorModel.swift | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/MVMCoreUI/Behaviors/ReplaceableMoleculeBehaviorModel.swift b/MVMCoreUI/Behaviors/ReplaceableMoleculeBehaviorModel.swift index 9cbf85ed..8b624a7b 100644 --- a/MVMCoreUI/Behaviors/ReplaceableMoleculeBehaviorModel.swift +++ b/MVMCoreUI/Behaviors/ReplaceableMoleculeBehaviorModel.swift @@ -20,7 +20,7 @@ public class ReplaceableMoleculeBehaviorModel: PageBehaviorModelProtocol { } } -public class ReplaceableMoleculeBehavior: PageMoleculeTransformationBehavior, CoreLogging { +public class ReplaceableMoleculeBehavior: PageMoleculeTransformationBehavior, PageVisibilityBehavior, CoreLogging { public var loggingPrefix: String { "\(self) \(ObjectIdentifier(self).hashValue) \(moleculeIds.prefix(3)) \(moleculeIds.count > 3 ? "+ \(moleculeIds.count - 3) more" : ""):\n" @@ -30,6 +30,8 @@ public class ReplaceableMoleculeBehavior: PageMoleculeTransformationBehavior, Co String(describing: Self.self) } + var hasPreviouslyBeenShown = false + var previouslyReplacedIds = Set() var moleculeIds: [String] public var modulesToListenFor: [String] private var observingForResponses: NSObjectProtocol? @@ -75,7 +77,7 @@ public class ReplaceableMoleculeBehavior: PageMoleculeTransformationBehavior, Co return rootMolecule } debugLog("top replacing \(rootMolecule) with \(updatedMolecule)") - logUpdated(molecule: updatedMolecule) + logUpdated(moleculeId: updatedMolecule.id) changeList.append(updatedMolecule) return updatedMolecule } @@ -92,7 +94,7 @@ public class ReplaceableMoleculeBehavior: PageMoleculeTransformationBehavior, Co return } debugLog("deep replacing \(replacedMolecule) with \(newMolecule)") - logUpdated(molecule: newMolecule) + logUpdated(moleculeId: newMolecule.id) changeList.append(newMolecule) } } catch { @@ -111,15 +113,28 @@ public class ReplaceableMoleculeBehavior: PageMoleculeTransformationBehavior, Co return hasReplacement ? updatedRootMolecules : nil } - private func logUpdated(molecule: MoleculeModelProtocol) { - guard let module: [AnyHashable: Any] = delegateObject?.moleculeDelegate?.getModuleWithName(molecule.id), + private func logUpdated(moleculeId: String) { + guard let module: [AnyHashable: Any] = delegateObject?.moleculeDelegate?.getModuleWithName(moleculeId), let viewController = delegateObject?.moleculeDelegate as? MVMCoreViewControllerProtocol else { - debugLog("Missing the originating module \(molecule.id) creating this molecule!") + debugLog("Missing the originating module \(moleculeId) creating this molecule!") return } + previouslyReplacedIds.insert(moleculeId) MVMCoreUILoggingHandler.shared()?.defaultLogPageUpdate(forController: viewController, from: module) } + public func onPageShown(_ delegateObject: MVMCoreUIDelegateObject?) { + guard hasPreviouslyBeenShown else { + // Skip first replacement build handled in onPageNew. (Pulled and reported from cache.) + hasPreviouslyBeenShown = true + return + } + debugLog("Page reshown. Resend replaced molecule analytics for: \(previouslyReplacedIds)") + previouslyReplacedIds.forEach { id in + logUpdated(moleculeId: id) + } + } + deinit { debugLog("deinit") } From 10c63a52b972da383980778dd30cc16a37ca0c97 Mon Sep 17 00:00:00 2001 From: "Hedden, Kyle Matthew" Date: Mon, 17 Jun 2024 19:43:47 -0400 Subject: [PATCH 20/25] Digital PCT265 defect DE307-687: Slightly better logging clarity, making sure the base page is logged before the module counterparts. --- .../ReplaceableMoleculeBehaviorModel.swift | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/MVMCoreUI/Behaviors/ReplaceableMoleculeBehaviorModel.swift b/MVMCoreUI/Behaviors/ReplaceableMoleculeBehaviorModel.swift index 8b624a7b..c35a5d19 100644 --- a/MVMCoreUI/Behaviors/ReplaceableMoleculeBehaviorModel.swift +++ b/MVMCoreUI/Behaviors/ReplaceableMoleculeBehaviorModel.swift @@ -30,7 +30,7 @@ public class ReplaceableMoleculeBehavior: PageMoleculeTransformationBehavior, Pa String(describing: Self.self) } - var hasPreviouslyBeenShown = false + var isPageShowing = false var previouslyReplacedIds = Set() var moleculeIds: [String] public var modulesToListenFor: [String] @@ -120,21 +120,22 @@ public class ReplaceableMoleculeBehavior: PageMoleculeTransformationBehavior, Pa return } previouslyReplacedIds.insert(moleculeId) + guard isPageShowing else { return } // Page has not been made visible yet. (Pulled and replaced from cache on load or background update.) Hold reporting until onPageShown. MVMCoreUILoggingHandler.shared()?.defaultLogPageUpdate(forController: viewController, from: module) } public func onPageShown(_ delegateObject: MVMCoreUIDelegateObject?) { - guard hasPreviouslyBeenShown else { - // Skip first replacement build handled in onPageNew. (Pulled and reported from cache.) - hasPreviouslyBeenShown = true - return - } - debugLog("Page reshown. Resend replaced molecule analytics for: \(previouslyReplacedIds)") + isPageShowing = true + debugLog("Page shown. Send molecule analytics for: \(previouslyReplacedIds)") previouslyReplacedIds.forEach { id in logUpdated(moleculeId: id) } } + public func onPageHidden(_ delegateObject: MVMCoreUIDelegateObject?) { + isPageShowing = false + } + deinit { debugLog("deinit") } From 451758f96d311c98b85b1625802ba9282b1327f5 Mon Sep 17 00:00:00 2001 From: "Hedden, Kyle Matthew" Date: Wed, 19 Jun 2024 14:52:33 -0400 Subject: [PATCH 21/25] Restore table reload to ensure table is synced to model. --- MVMCoreUI/BaseControllers/ThreeLayerTableViewController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/BaseControllers/ThreeLayerTableViewController.swift b/MVMCoreUI/BaseControllers/ThreeLayerTableViewController.swift index d7c60545..ee44218e 100644 --- a/MVMCoreUI/BaseControllers/ThreeLayerTableViewController.swift +++ b/MVMCoreUI/BaseControllers/ThreeLayerTableViewController.swift @@ -56,14 +56,14 @@ open class ThreeLayerTableViewController: ProgrammaticTableViewController, Rotor } open override func updateUI(for molecules: [MoleculeModelProtocol]? = nil) { - let isFirstRender = self.isFirstRender super.updateUI(for: molecules) guard molecules == nil else { return } createViewForTableHeader() createViewForTableFooter() - // Reloading the table is handled in updateViews. + // Reloading the table is handled in updateViews, however, update views is on a separate rendering task than the current thread. The table render needs to be bound and settled to the new model before others put in additional update requests. + tableView.reloadData() } override open func viewDidLoad() { From efa99033e9a443f52d85d06aba3434a4f5e342b4 Mon Sep 17 00:00:00 2001 From: "Hedden, Kyle Matthew" Date: Wed, 19 Jun 2024 15:30:03 -0400 Subject: [PATCH 22/25] Digital PCT265 story CXTDT-574791: Prevent additional reload tables in updateView. --- MVMCoreUI/BaseControllers/ThreeLayerTableViewController.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MVMCoreUI/BaseControllers/ThreeLayerTableViewController.swift b/MVMCoreUI/BaseControllers/ThreeLayerTableViewController.swift index ee44218e..4bd889bd 100644 --- a/MVMCoreUI/BaseControllers/ThreeLayerTableViewController.swift +++ b/MVMCoreUI/BaseControllers/ThreeLayerTableViewController.swift @@ -52,7 +52,9 @@ open class ThreeLayerTableViewController: ProgrammaticTableViewController, Rotor bottomView.updateView(width) showFooter(width) } - tableView.reloadData() + tableView.visibleCells.forEach { cell in + (cell as? MVMCoreViewProtocol)?.updateView(width) + } } open override func updateUI(for molecules: [MoleculeModelProtocol]? = nil) { From 41548b84342d6c38329583add3787b035d3e0490 Mon Sep 17 00:00:00 2001 From: "Hedden, Kyle Matthew" Date: Thu, 20 Jun 2024 16:44:58 -0400 Subject: [PATCH 23/25] Digital PCT265 defect CXTDT-531317: Give the default page type for those that send an empty string. --- MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift b/MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift index da57579d..ea4e0d88 100644 --- a/MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift +++ b/MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift @@ -83,6 +83,9 @@ import Foundation let typeContainer = try decoder.container(keyedBy: CodingKeys.self) if let defaultPageType = Self.defaultPageType() { pageType = try typeContainer.decodeIfPresent(String.self, forKey: .pageType) ?? defaultPageType + if pageType.isEmpty { + pageType = defaultPageType + } } else { pageType = try typeContainer.decode(String.self, forKey: .pageType) } From adb415f72c3cbb2564c5f27a3fee8bfdad7c972e Mon Sep 17 00:00:00 2001 From: "Subramaniam, Ramya" Date: Fri, 21 Jun 2024 12:17:48 +0530 Subject: [PATCH 24/25] Making the view nil to prevent dangling contrainst --- MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift b/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift index 585944bf..3ef117da 100644 --- a/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift +++ b/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift @@ -307,6 +307,7 @@ open class Carousel: View { pagingView?.removeFromSuperview() bottomPin?.isActive = false + pagingView = nil guard var pagingView = view else { bottomPin = bottomAnchor.constraint(equalTo: collectionView.bottomAnchor) From 3108dcdafc931fc81de9b2a4dbf59f359a16ddab Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Fri, 21 Jun 2024 14:11:20 -0500 Subject: [PATCH 25/25] refactored out code that is now in VDS.Label Signed-off-by: Matt Bruce --- .../Atomic/Atoms/Views/Label/Label.swift | 34 ++----------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift index fa71def6..605f2e8a 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift @@ -364,8 +364,8 @@ extension Label { public static func boundingRect(forCharacterRange range: NSRange, in label: Label) -> CGRect { guard let abstractContainer = label.abstractTextContainer() else { return CGRect() } - let textContainer = abstractContainer.0 - let layoutManager = abstractContainer.1 + let textContainer = abstractContainer.textContainer + let layoutManager = abstractContainer.layoutManager var glyphRange = NSRange() @@ -374,36 +374,6 @@ extension Label { return layoutManager.boundingRect(forGlyphRange: glyphRange, in: textContainer) } - - /** - Provides a text container and layout manager of how the text would appear on screen. - They are used in tandem to derive low-level TextKit results of the label. - */ - public func abstractTextContainer() -> (NSTextContainer, NSLayoutManager, NSTextStorage)? { - - // Must configure the attributed string to translate what would appear on screen to accurately analyze. - guard let attributedText = attributedText else { return nil } - - let paragraph = NSMutableParagraphStyle() - paragraph.alignment = textAlignment - - let stagedAttributedString = NSMutableAttributedString(attributedString: attributedText) - stagedAttributedString.addAttributes([NSAttributedString.Key.paragraphStyle: paragraph], range: NSRange(location: 0, length: attributedText.string.count)) - - let textStorage = NSTextStorage(attributedString: stagedAttributedString) - let layoutManager = NSLayoutManager() - let textContainer = NSTextContainer(size: .zero) - - layoutManager.addTextContainer(textContainer) - textStorage.addLayoutManager(layoutManager) - - textContainer.lineFragmentPadding = 0.0 - textContainer.lineBreakMode = lineBreakMode - textContainer.maximumNumberOfLines = numberOfLines - textContainer.size = bounds.size - - return (textContainer, layoutManager, textStorage) - } } // MARK: - Atomization