2021-01-22 07:27:37 +01:00
|
|
|
// swiftlint:disable all
|
|
|
|
// Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen
|
|
|
|
|
|
|
|
#if os(macOS)
|
|
|
|
import AppKit
|
|
|
|
#elseif os(iOS)
|
|
|
|
import UIKit
|
|
|
|
#elseif os(tvOS) || os(watchOS)
|
|
|
|
import UIKit
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Deprecated typealiases
|
|
|
|
@available(*, deprecated, renamed: "ColorAsset.Color", message: "This typealias will be removed in SwiftGen 7.0")
|
|
|
|
internal typealias AssetColorTypeAlias = ColorAsset.Color
|
2021-02-01 11:06:29 +01:00
|
|
|
@available(*, deprecated, renamed: "ImageAsset.Image", message: "This typealias will be removed in SwiftGen 7.0")
|
|
|
|
internal typealias AssetImageTypeAlias = ImageAsset.Image
|
2021-01-22 07:27:37 +01:00
|
|
|
|
|
|
|
// swiftlint:disable superfluous_disable_command file_length implicit_return
|
|
|
|
|
|
|
|
// MARK: - Asset Catalogs
|
|
|
|
|
|
|
|
// swiftlint:disable identifier_name line_length nesting type_body_length type_name
|
|
|
|
internal enum Asset {
|
|
|
|
internal static let accentColor = ColorAsset(name: "AccentColor")
|
2021-02-23 09:45:00 +01:00
|
|
|
internal enum Asset {
|
2021-04-25 04:50:54 +02:00
|
|
|
internal static let email = ImageAsset(name: "Asset/email")
|
2021-02-23 09:45:00 +01:00
|
|
|
internal static let mastodonTextLogo = ImageAsset(name: "Asset/mastodon.text.logo")
|
|
|
|
}
|
2021-03-03 05:26:14 +01:00
|
|
|
internal enum Circles {
|
|
|
|
internal static let plusCircleFill = ImageAsset(name: "Circles/plus.circle.fill")
|
2021-03-23 11:47:21 +01:00
|
|
|
internal static let plusCircle = ImageAsset(name: "Circles/plus.circle")
|
2021-03-03 05:26:14 +01:00
|
|
|
}
|
2021-02-01 11:06:29 +01:00
|
|
|
internal enum Colors {
|
2021-02-05 04:53:21 +01:00
|
|
|
internal enum Background {
|
2021-03-03 12:34:29 +01:00
|
|
|
internal enum Poll {
|
|
|
|
internal static let disabled = ColorAsset(name: "Colors/Background/Poll/disabled")
|
|
|
|
}
|
2021-04-01 08:39:15 +02:00
|
|
|
internal static let alertYellow = ColorAsset(name: "Colors/Background/alert.yellow")
|
2021-03-18 08:16:35 +01:00
|
|
|
internal static let dangerBorder = ColorAsset(name: "Colors/Background/danger.border")
|
|
|
|
internal static let danger = ColorAsset(name: "Colors/Background/danger")
|
|
|
|
internal static let mediaTypeIndicotor = ColorAsset(name: "Colors/Background/media.type.indicotor")
|
2021-04-07 15:42:43 +02:00
|
|
|
internal static let navigationBar = ColorAsset(name: "Colors/Background/navigationBar")
|
2021-02-22 09:20:44 +01:00
|
|
|
internal static let onboardingBackground = ColorAsset(name: "Colors/Background/onboarding.background")
|
2021-02-23 08:16:55 +01:00
|
|
|
internal static let secondaryGroupedSystemBackground = ColorAsset(name: "Colors/Background/secondary.grouped.system.background")
|
2021-02-05 04:53:21 +01:00
|
|
|
internal static let secondarySystemBackground = ColorAsset(name: "Colors/Background/secondary.system.background")
|
|
|
|
internal static let systemBackground = ColorAsset(name: "Colors/Background/system.background")
|
2021-04-23 03:52:22 +02:00
|
|
|
internal static let systemElevatedBackground = ColorAsset(name: "Colors/Background/system.elevated.background")
|
2021-02-23 08:16:55 +01:00
|
|
|
internal static let systemGroupedBackground = ColorAsset(name: "Colors/Background/system.grouped.background")
|
2021-02-05 04:53:21 +01:00
|
|
|
internal static let tertiarySystemBackground = ColorAsset(name: "Colors/Background/tertiary.system.background")
|
2021-03-23 11:47:21 +01:00
|
|
|
internal static let tertiarySystemGroupedBackground = ColorAsset(name: "Colors/Background/tertiary.system.grouped.background")
|
2021-02-05 04:53:21 +01:00
|
|
|
}
|
2021-04-08 07:30:32 +02:00
|
|
|
internal enum Border {
|
2021-04-14 09:00:48 +02:00
|
|
|
internal static let notification = ColorAsset(name: "Colors/Border/notification")
|
2021-04-08 07:30:32 +02:00
|
|
|
internal static let searchCard = ColorAsset(name: "Colors/Border/searchCard")
|
|
|
|
}
|
2021-02-05 04:53:21 +01:00
|
|
|
internal enum Button {
|
2021-02-23 09:45:00 +01:00
|
|
|
internal static let actionToolbar = ColorAsset(name: "Colors/Button/action.toolbar")
|
2021-02-26 09:43:59 +01:00
|
|
|
internal static let disabled = ColorAsset(name: "Colors/Button/disabled")
|
2021-04-06 10:42:45 +02:00
|
|
|
internal static let inactive = ColorAsset(name: "Colors/Button/inactive")
|
2021-02-05 04:53:21 +01:00
|
|
|
}
|
2021-06-23 14:47:49 +02:00
|
|
|
internal enum ContentWarningOverlay {
|
|
|
|
internal static let background = ColorAsset(name: "Colors/ContentWarningOverlay/background")
|
|
|
|
}
|
2021-02-20 04:14:13 +01:00
|
|
|
internal enum Icon {
|
|
|
|
internal static let plus = ColorAsset(name: "Colors/Icon/plus")
|
|
|
|
}
|
2021-02-05 04:53:21 +01:00
|
|
|
internal enum Label {
|
|
|
|
internal static let primary = ColorAsset(name: "Colors/Label/primary")
|
|
|
|
internal static let secondary = ColorAsset(name: "Colors/Label/secondary")
|
2021-04-22 13:58:42 +02:00
|
|
|
internal static let tertiary = ColorAsset(name: "Colors/Label/tertiary")
|
2021-02-05 04:53:21 +01:00
|
|
|
}
|
2021-04-13 15:31:49 +02:00
|
|
|
internal enum Notification {
|
|
|
|
internal static let favourite = ColorAsset(name: "Colors/Notification/favourite")
|
|
|
|
internal static let mention = ColorAsset(name: "Colors/Notification/mention")
|
|
|
|
internal static let reblog = ColorAsset(name: "Colors/Notification/reblog")
|
|
|
|
}
|
2021-04-08 07:30:32 +02:00
|
|
|
internal enum Shadow {
|
|
|
|
internal static let searchCard = ColorAsset(name: "Colors/Shadow/SearchCard")
|
|
|
|
}
|
2021-03-08 04:42:10 +01:00
|
|
|
internal enum Slider {
|
2021-06-17 12:31:14 +02:00
|
|
|
internal static let track = ColorAsset(name: "Colors/Slider/track")
|
2021-03-08 04:42:10 +01:00
|
|
|
}
|
2021-02-20 06:55:06 +01:00
|
|
|
internal enum TextField {
|
2021-04-25 09:44:38 +02:00
|
|
|
internal static let background = ColorAsset(name: "Colors/TextField/background")
|
2021-02-22 10:48:44 +01:00
|
|
|
internal static let invalid = ColorAsset(name: "Colors/TextField/invalid")
|
|
|
|
internal static let valid = ColorAsset(name: "Colors/TextField/valid")
|
2021-02-20 06:55:06 +01:00
|
|
|
}
|
2021-04-17 08:15:55 +02:00
|
|
|
internal static let battleshipGrey = ColorAsset(name: "Colors/battleshipGrey")
|
2021-04-06 10:42:45 +02:00
|
|
|
internal static let brandBlue = ColorAsset(name: "Colors/brand.blue")
|
2021-06-16 07:47:40 +02:00
|
|
|
internal static let brandBlueDarken20 = ColorAsset(name: "Colors/brand.blue.darken.20")
|
2021-03-26 12:16:19 +01:00
|
|
|
internal static let danger = ColorAsset(name: "Colors/danger")
|
2021-04-06 10:42:45 +02:00
|
|
|
internal static let disabled = ColorAsset(name: "Colors/disabled")
|
|
|
|
internal static let inactive = ColorAsset(name: "Colors/inactive")
|
|
|
|
internal static let successGreen = ColorAsset(name: "Colors/success.green")
|
2021-02-05 04:53:21 +01:00
|
|
|
internal static let systemOrange = ColorAsset(name: "Colors/system.orange")
|
2021-02-01 11:06:29 +01:00
|
|
|
}
|
2021-03-18 08:16:35 +01:00
|
|
|
internal enum Connectivity {
|
|
|
|
internal static let photoFillSplit = ImageAsset(name: "Connectivity/photo.fill.split")
|
|
|
|
}
|
2021-04-15 05:38:47 +02:00
|
|
|
internal enum Human {
|
|
|
|
internal static let faceSmilingAdaptive = ImageAsset(name: "Human/face.smiling.adaptive")
|
2021-04-02 12:13:45 +02:00
|
|
|
}
|
2021-04-14 09:24:54 +02:00
|
|
|
internal enum Scene {
|
|
|
|
internal enum Compose {
|
|
|
|
internal static let background = ColorAsset(name: "Scene/Compose/background")
|
|
|
|
internal static let toolbarBackground = ColorAsset(name: "Scene/Compose/toolbar.background")
|
2021-04-02 12:13:45 +02:00
|
|
|
}
|
2021-04-14 09:24:54 +02:00
|
|
|
internal enum Profile {
|
|
|
|
internal enum Banner {
|
|
|
|
internal static let bioEditBackgroundGray = ColorAsset(name: "Scene/Profile/Banner/bio.edit.background.gray")
|
|
|
|
internal static let nameEditBackgroundGray = ColorAsset(name: "Scene/Profile/Banner/name.edit.background.gray")
|
|
|
|
internal static let usernameGray = ColorAsset(name: "Scene/Profile/Banner/username.gray")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
internal enum Welcome {
|
|
|
|
internal enum Illustration {
|
|
|
|
internal static let backgroundCyan = ColorAsset(name: "Scene/Welcome/illustration/background.cyan")
|
|
|
|
internal static let cloudBase = ImageAsset(name: "Scene/Welcome/illustration/cloud.base")
|
|
|
|
internal static let elephantOnAirplaneWithContrail = ImageAsset(name: "Scene/Welcome/illustration/elephant.on.airplane.with.contrail")
|
|
|
|
internal static let elephantThreeOnGrass = ImageAsset(name: "Scene/Welcome/illustration/elephant.three.on.grass")
|
|
|
|
internal static let elephantThreeOnGrassWithTreeThree = ImageAsset(name: "Scene/Welcome/illustration/elephant.three.on.grass.with.tree.three")
|
|
|
|
internal static let elephantThreeOnGrassWithTreeTwo = ImageAsset(name: "Scene/Welcome/illustration/elephant.three.on.grass.with.tree.two")
|
|
|
|
}
|
|
|
|
internal static let mastodonLogoBlack = ImageAsset(name: "Scene/Welcome/mastodon.logo.black")
|
|
|
|
internal static let mastodonLogoBlackLarge = ImageAsset(name: "Scene/Welcome/mastodon.logo.black.large")
|
|
|
|
internal static let mastodonLogo = ImageAsset(name: "Scene/Welcome/mastodon.logo")
|
|
|
|
internal static let mastodonLogoLarge = ImageAsset(name: "Scene/Welcome/mastodon.logo.large")
|
2021-03-01 10:38:45 +01:00
|
|
|
}
|
2021-02-26 09:43:59 +01:00
|
|
|
}
|
2021-04-17 08:15:55 +02:00
|
|
|
internal enum Settings {
|
|
|
|
internal static let appearanceAutomatic = ImageAsset(name: "Settings/appearance.automatic")
|
|
|
|
internal static let appearanceDark = ImageAsset(name: "Settings/appearance.dark")
|
|
|
|
internal static let appearanceLight = ImageAsset(name: "Settings/appearance.light")
|
|
|
|
}
|
2021-01-22 07:27:37 +01:00
|
|
|
}
|
|
|
|
// swiftlint:enable identifier_name line_length nesting type_body_length type_name
|
|
|
|
|
|
|
|
// MARK: - Implementation Details
|
|
|
|
|
|
|
|
internal final class ColorAsset {
|
|
|
|
internal fileprivate(set) var name: String
|
|
|
|
|
|
|
|
#if os(macOS)
|
|
|
|
internal typealias Color = NSColor
|
|
|
|
#elseif os(iOS) || os(tvOS) || os(watchOS)
|
|
|
|
internal typealias Color = UIColor
|
|
|
|
#endif
|
|
|
|
|
|
|
|
@available(iOS 11.0, tvOS 11.0, watchOS 4.0, macOS 10.13, *)
|
|
|
|
internal private(set) lazy var color: Color = {
|
|
|
|
guard let color = Color(asset: self) else {
|
|
|
|
fatalError("Unable to load color asset named \(name).")
|
|
|
|
}
|
|
|
|
return color
|
|
|
|
}()
|
|
|
|
|
|
|
|
fileprivate init(name: String) {
|
|
|
|
self.name = name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
internal extension ColorAsset.Color {
|
|
|
|
@available(iOS 11.0, tvOS 11.0, watchOS 4.0, macOS 10.13, *)
|
|
|
|
convenience init?(asset: ColorAsset) {
|
|
|
|
let bundle = BundleToken.bundle
|
|
|
|
#if os(iOS) || os(tvOS)
|
|
|
|
self.init(named: asset.name, in: bundle, compatibleWith: nil)
|
|
|
|
#elseif os(macOS)
|
|
|
|
self.init(named: NSColor.Name(asset.name), bundle: bundle)
|
|
|
|
#elseif os(watchOS)
|
|
|
|
self.init(named: asset.name)
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-01 11:06:29 +01:00
|
|
|
internal struct ImageAsset {
|
|
|
|
internal fileprivate(set) var name: String
|
|
|
|
|
|
|
|
#if os(macOS)
|
|
|
|
internal typealias Image = NSImage
|
|
|
|
#elseif os(iOS) || os(tvOS) || os(watchOS)
|
|
|
|
internal typealias Image = UIImage
|
|
|
|
#endif
|
|
|
|
|
|
|
|
internal var image: Image {
|
|
|
|
let bundle = BundleToken.bundle
|
|
|
|
#if os(iOS) || os(tvOS)
|
|
|
|
let image = Image(named: name, in: bundle, compatibleWith: nil)
|
|
|
|
#elseif os(macOS)
|
|
|
|
let name = NSImage.Name(self.name)
|
|
|
|
let image = (bundle == .main) ? NSImage(named: name) : bundle.image(forResource: name)
|
|
|
|
#elseif os(watchOS)
|
|
|
|
let image = Image(named: name)
|
|
|
|
#endif
|
|
|
|
guard let result = image else {
|
|
|
|
fatalError("Unable to load image asset named \(name).")
|
|
|
|
}
|
|
|
|
return result
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
internal extension ImageAsset.Image {
|
|
|
|
@available(macOS, deprecated,
|
|
|
|
message: "This initializer is unsafe on macOS, please use the ImageAsset.image property")
|
|
|
|
convenience init?(asset: ImageAsset) {
|
|
|
|
#if os(iOS) || os(tvOS)
|
|
|
|
let bundle = BundleToken.bundle
|
|
|
|
self.init(named: asset.name, in: bundle, compatibleWith: nil)
|
|
|
|
#elseif os(macOS)
|
|
|
|
self.init(named: NSImage.Name(asset.name))
|
|
|
|
#elseif os(watchOS)
|
|
|
|
self.init(named: asset.name)
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-22 07:27:37 +01:00
|
|
|
// swiftlint:disable convenience_type
|
|
|
|
private final class BundleToken {
|
|
|
|
static let bundle: Bundle = {
|
2021-01-27 09:01:20 +01:00
|
|
|
#if SWIFT_PACKAGE
|
|
|
|
return Bundle.module
|
|
|
|
#else
|
|
|
|
return Bundle(for: BundleToken.self)
|
|
|
|
#endif
|
2021-01-22 07:27:37 +01:00
|
|
|
}()
|
|
|
|
}
|
|
|
|
// swiftlint:enable convenience_type
|