From 6b32e5e4aa3b03d81a951b15e895c819e52bfc57 Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Fri, 12 Apr 2024 10:58:18 +0200 Subject: [PATCH] Re-enable option to post unlisted/"Quiet public" (#1271) * Add unlisted as option to post (#250) * Replace menu-icons with SF Symbols to match other platforms (#250) * Replace earth with SF-symbol (#250) * Use SF Symbols for visibility (#250) --- .../NotificationView/NotificationView.swift | 3 +- .../Compose/Earth.imageset/Contents.json | 15 -- .../Scene/Compose/Earth.imageset/Earth.pdf | 169 ------------------ .../Compose/Mention.imageset/Contents.json | 15 -- .../Compose/Mention.imageset/Mention.pdf | 102 ----------- .../Scene/Compose/More.imageset/Contents.json | 15 -- .../Scene/Compose/More.imageset/More.pdf | 83 --------- .../Compose/People.imageset/Contents.json | 15 -- .../Scene/Compose/People.imageset/People.pdf | 140 --------------- .../Compose/people.add.imageset/Contents.json | 15 -- .../people.add.imageset/People Add.pdf | 150 ---------------- .../MastodonAsset/Generated/Assets.swift | 5 - .../Entity/Mastodon+Entity+Status.swift | 29 ++- .../Extension/MastodonVisibility+Image.swift | 15 +- .../ComposeContentToolbarView+ViewModel.swift | 8 +- .../Toolbar/ComposeContentToolbarView.swift | 20 +-- .../View/Content/StatusAuthorView.swift | 3 +- 17 files changed, 42 insertions(+), 760 deletions(-) delete mode 100644 MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/Earth.imageset/Contents.json delete mode 100644 MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/Earth.imageset/Earth.pdf delete mode 100644 MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/Mention.imageset/Contents.json delete mode 100644 MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/Mention.imageset/Mention.pdf delete mode 100644 MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/More.imageset/Contents.json delete mode 100644 MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/More.imageset/More.pdf delete mode 100644 MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/People.imageset/Contents.json delete mode 100644 MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/People.imageset/People.pdf delete mode 100644 MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/people.add.imageset/Contents.json delete mode 100644 MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/people.add.imageset/People Add.pdf diff --git a/Mastodon/Scene/Notification/NotificationView/NotificationView.swift b/Mastodon/Scene/Notification/NotificationView/NotificationView.swift index a4ccb2dd3..04bb07078 100644 --- a/Mastodon/Scene/Notification/NotificationView/NotificationView.swift +++ b/Mastodon/Scene/Notification/NotificationView/NotificationView.swift @@ -13,6 +13,7 @@ import MastodonCore import MastodonAsset import MastodonLocalization import MastodonUI +import MastodonSDK public protocol NotificationViewDelegate: AnyObject { func notificationView(_ notificationView: NotificationView, authorAvatarButtonDidPressed button: AvatarButton) @@ -93,7 +94,7 @@ public final class NotificationView: UIView { let imageView = UIImageView() imageView.tintColor = Asset.Colors.Label.secondary.color imageView.contentMode = .scaleAspectFit - imageView.image = Asset.Scene.Compose.earth.image.withRenderingMode(.alwaysTemplate) + imageView.image = Mastodon.Entity.Status.Visibility.public.image.withRenderingMode(.alwaysTemplate) return imageView }() diff --git a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/Earth.imageset/Contents.json b/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/Earth.imageset/Contents.json deleted file mode 100644 index 04f310f98..000000000 --- a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/Earth.imageset/Contents.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "images" : [ - { - "filename" : "Earth.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - }, - "properties" : { - "preserves-vector-representation" : true - } -} diff --git a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/Earth.imageset/Earth.pdf b/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/Earth.imageset/Earth.pdf deleted file mode 100644 index 4f6b948a3..000000000 --- a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/Earth.imageset/Earth.pdf +++ /dev/null @@ -1,169 +0,0 @@ -%PDF-1.7 - -1 0 obj - << >> -endobj - -2 0 obj - << /Length 3 0 R >> -stream -/DeviceRGB CS -/DeviceRGB cs -q -1.000000 0.000000 -0.000000 1.000000 2.000122 2.000000 cm -0.000000 0.000000 0.000000 scn -8.945436 19.952877 m -8.950368 19.945572 l -9.295332 19.981556 9.645513 20.000000 10.000000 20.000000 c -15.522847 20.000000 20.000000 15.522847 20.000000 10.000000 c -20.000000 4.477153 15.522847 0.000000 10.000000 0.000000 c -6.790722 0.000000 3.934541 1.511787 2.104761 3.862055 c -2.102194 3.862638 l -2.102672 3.864738 l -0.784842 5.558613 0.000000 7.687653 0.000000 10.000000 c -0.000000 15.161964 3.911163 19.410429 8.931705 19.943607 c -8.945436 19.952877 l -h -10.000000 18.500000 m -9.946768 18.500000 9.893649 18.499510 9.840650 18.498537 c -9.963233 18.254343 10.094863 17.965696 10.214363 17.648212 c -10.561299 16.726484 10.880171 15.367099 10.314304 14.162127 c -9.791718 13.049316 8.889565 12.761408 8.224188 12.589492 c -8.139534 12.567652 l -7.483193 12.398458 7.230809 12.333397 7.046710 12.053902 c -6.877729 11.797358 6.903327 11.471569 7.108089 10.804317 c -7.122483 10.757413 7.138054 10.707805 7.154294 10.656069 c -7.235397 10.397685 7.333165 10.086211 7.384129 9.793275 c -7.447527 9.428862 7.465442 8.965590 7.232083 8.517794 c -7.000589 8.073575 6.693745 7.770780 6.331198 7.573263 c -5.990655 7.387735 5.637942 7.317377 5.374053 7.270582 c -5.281080 7.254177 l -4.766211 7.163565 4.519922 7.120219 4.280048 6.863250 c -4.093846 6.663777 3.973670 6.311463 3.903486 5.785102 c -3.874918 5.570853 3.857739 5.358463 3.839978 5.138891 c -3.830442 5.021761 l -3.810462 4.779471 3.785685 4.500609 3.731205 4.261164 c -3.730906 4.259850 l -5.284881 2.563602 7.518231 1.500000 10.000000 1.500000 c -11.577014 1.500000 13.053720 1.929466 14.319545 2.677820 c -14.221224 2.777969 14.114439 2.895618 14.009129 3.028202 c -13.669640 3.455608 13.224341 4.191939 13.378761 5.060995 c -13.453023 5.478927 13.677018 5.828774 13.893493 6.097116 c -14.114051 6.370518 14.380263 6.623110 14.613050 6.837366 c -14.668355 6.888268 14.721365 6.936671 14.772196 6.983084 c -14.950412 7.145808 15.101837 7.284072 15.231435 7.419845 c -15.404221 7.600864 15.441820 7.682460 15.443790 7.686735 c -15.511713 7.911400 15.428436 8.070621 15.337708 8.140779 c -15.292102 8.176043 15.230948 8.201571 15.147898 8.202232 c -15.064073 8.202900 14.928219 8.177752 14.746777 8.062835 c -14.537054 7.930006 14.232018 7.847993 13.911026 7.977239 c -13.643642 8.084899 13.495515 8.290975 13.424360 8.408617 c -13.280478 8.646499 13.199624 8.954817 13.146976 9.180877 c -13.106362 9.355261 13.067616 9.553251 13.032258 9.733932 c -13.018108 9.806237 13.004500 9.875771 12.991533 9.939910 c -12.941022 10.189741 12.898354 10.368218 12.857431 10.479053 c -12.856843 10.480482 12.851788 10.492748 12.838216 10.517543 c -12.823483 10.544457 12.802644 10.579025 12.774174 10.622349 c -12.716190 10.710581 12.640428 10.814299 12.546493 10.938749 c -12.512385 10.983936 12.475714 11.032014 12.437285 11.082394 c -12.276200 11.293579 12.084242 11.545244 11.920969 11.794048 c -11.725189 12.092388 11.503861 12.482321 11.433911 12.898157 c -11.396839 13.118542 11.397423 13.373061 11.488866 13.631610 c -11.582505 13.896370 11.753467 14.114110 11.975435 14.280597 c -12.458843 14.643174 13.168970 15.453171 13.798772 16.239641 c -14.086361 16.598770 14.343374 16.935246 14.534719 17.190622 c -13.222366 18.019987 11.667240 18.500000 10.000000 18.500000 c -h -15.727353 16.280794 m -15.529826 16.017342 15.265779 15.671862 14.969622 15.302032 c -14.367900 14.550627 13.570269 13.617192 12.920100 13.114614 c -12.945479 13.015734 13.020371 12.852727 13.175053 12.617016 c -13.306167 12.417215 13.456026 12.220543 13.614124 12.013055 c -13.656691 11.957191 13.700173 11.900127 13.743729 11.842422 c -13.916128 11.614019 14.155027 11.295321 14.264583 10.998598 c -14.350787 10.765120 14.412687 10.480006 14.461784 10.237164 c -14.479100 10.151520 14.495111 10.069643 14.510527 9.990811 c -14.536025 9.860416 14.559895 9.738358 14.585339 9.621376 c -15.187048 9.793123 15.787111 9.689411 16.255274 9.327401 c -16.863905 8.856771 17.118000 8.041076 16.879692 7.252826 c -16.770346 6.891145 16.515705 6.592863 16.316484 6.384149 c -16.147512 6.207124 15.944934 6.022339 15.761238 5.854778 c -15.715802 5.813333 15.671200 5.772646 15.628872 5.733688 c -15.398922 5.522042 15.205485 5.334450 15.060962 5.155299 c -14.912354 4.971087 14.865835 4.856014 14.855629 4.798573 c -14.816802 4.580065 14.923186 4.289124 15.183693 3.961153 c -15.301805 3.812452 15.427599 3.687178 15.525196 3.598549 c -15.536726 3.588078 15.547768 3.578207 15.558244 3.568960 c -17.360012 5.127576 18.500000 7.430659 18.500000 10.000000 c -18.500000 12.488004 17.431046 14.726340 15.727353 16.280794 c -h -1.500000 10.000000 m -1.500000 8.601643 1.837670 7.282152 2.435920 6.118621 c -2.520806 6.676047 2.697947 7.366606 3.183541 7.886808 c -3.783359 8.529375 4.519145 8.649875 4.981673 8.725623 c -5.027948 8.733203 5.071755 8.740378 5.112145 8.747540 c -5.359830 8.791461 5.503073 8.830262 5.613584 8.890469 c -5.702090 8.938686 5.801398 9.018201 5.901872 9.211002 c -5.916738 9.239530 5.944188 9.318548 5.906326 9.536173 c -5.873906 9.722527 5.813122 9.917411 5.733576 10.172447 c -5.714817 10.232594 5.694809 10.296745 5.674091 10.364261 c -5.488935 10.967622 5.193007 11.966541 5.794037 12.879015 c -6.315677 13.670959 7.154699 13.873423 7.687307 14.001944 c -7.745055 14.015879 7.799201 14.028945 7.848949 14.041800 c -8.411874 14.187244 8.732245 14.322063 8.956565 14.799735 c -9.251945 15.428725 9.124854 16.284683 8.810515 17.119806 c -8.661468 17.515793 8.486593 17.863750 8.348099 18.113476 c -8.304624 18.191868 8.265136 18.259853 8.231707 18.315813 c -4.385974 17.502075 1.500000 14.088065 1.500000 10.000000 c -h -f -n -Q - -endstream -endobj - -3 0 obj - 5594 -endobj - -4 0 obj - << /Annots [] - /Type /Page - /MediaBox [ 0.000000 0.000000 24.000000 24.000000 ] - /Resources 1 0 R - /Contents 2 0 R - /Parent 5 0 R - >> -endobj - -5 0 obj - << /Kids [ 4 0 R ] - /Count 1 - /Type /Pages - >> -endobj - -6 0 obj - << /Pages 5 0 R - /Type /Catalog - >> -endobj - -xref -0 7 -0000000000 65535 f -0000000010 00000 n -0000000034 00000 n -0000005684 00000 n -0000005707 00000 n -0000005880 00000 n -0000005954 00000 n -trailer -<< /ID [ (some) (id) ] - /Root 6 0 R - /Size 7 ->> -startxref -6013 -%%EOF \ No newline at end of file diff --git a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/Mention.imageset/Contents.json b/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/Mention.imageset/Contents.json deleted file mode 100644 index 776af5644..000000000 --- a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/Mention.imageset/Contents.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "images" : [ - { - "filename" : "Mention.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - }, - "properties" : { - "preserves-vector-representation" : true - } -} diff --git a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/Mention.imageset/Mention.pdf b/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/Mention.imageset/Mention.pdf deleted file mode 100644 index e797d12c6..000000000 --- a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/Mention.imageset/Mention.pdf +++ /dev/null @@ -1,102 +0,0 @@ -%PDF-1.7 - -1 0 obj - << >> -endobj - -2 0 obj - << /Length 3 0 R >> -stream -/DeviceRGB CS -/DeviceRGB cs -q -1.000000 0.000000 -0.000000 1.000000 2.000000 2.000000 cm -0.000000 0.000000 0.000000 scn -20.000000 10.000000 m -20.000000 8.250000 l -20.000000 6.178932 18.321068 4.500000 16.250000 4.500000 c -14.745829 4.500000 13.448502 5.385603 12.850986 6.663840 c -12.032894 5.644792 10.840015 5.000000 9.500000 5.000000 c -6.992370 5.000000 5.000000 7.258018 5.000000 10.000000 c -5.000000 12.741982 6.992370 15.000000 9.500000 15.000000 c -10.659005 15.000000 11.707939 14.517641 12.500963 13.728080 c -12.500000 14.250000 l -12.500000 14.664213 12.835787 15.000000 13.250000 15.000000 c -13.629696 15.000000 13.943491 14.717846 13.993154 14.351770 c -14.000000 14.250000 l -14.000000 8.250000 l -14.000000 7.007360 15.007360 6.000000 16.250000 6.000000 c -17.440865 6.000000 18.415646 6.925161 18.494810 8.095951 c -18.500000 8.250000 l -18.500000 10.000000 l -18.500000 14.694420 14.694420 18.500000 10.000000 18.500000 c -5.305580 18.500000 1.500000 14.694420 1.500000 10.000000 c -1.500000 5.305580 5.305580 1.500000 10.000000 1.500000 c -11.032966 1.500000 12.039467 1.683977 12.985156 2.038752 c -13.372977 2.184242 13.805312 1.987795 13.950803 1.599974 c -14.096293 1.212152 13.899846 0.779818 13.512025 0.634327 c -12.398500 0.216589 11.213587 0.000000 10.000000 0.000000 c -4.477152 0.000000 0.000000 4.477152 0.000000 10.000000 c -0.000000 15.522848 4.477152 20.000000 10.000000 20.000000 c -15.429239 20.000000 19.847933 15.673328 19.996159 10.279904 c -20.000000 10.000000 l -20.000000 8.250000 l -20.000000 10.000000 l -h -9.500000 13.500000 m -7.865495 13.500000 6.500000 11.952439 6.500000 10.000000 c -6.500000 8.047561 7.865495 6.500000 9.500000 6.500000 c -11.134505 6.500000 12.500000 8.047561 12.500000 10.000000 c -12.500000 11.952439 11.134505 13.500000 9.500000 13.500000 c -h -f -n -Q - -endstream -endobj - -3 0 obj - 1791 -endobj - -4 0 obj - << /Annots [] - /Type /Page - /MediaBox [ 0.000000 0.000000 24.000000 24.000000 ] - /Resources 1 0 R - /Contents 2 0 R - /Parent 5 0 R - >> -endobj - -5 0 obj - << /Kids [ 4 0 R ] - /Count 1 - /Type /Pages - >> -endobj - -6 0 obj - << /Pages 5 0 R - /Type /Catalog - >> -endobj - -xref -0 7 -0000000000 65535 f -0000000010 00000 n -0000000034 00000 n -0000001881 00000 n -0000001904 00000 n -0000002077 00000 n -0000002151 00000 n -trailer -<< /ID [ (some) (id) ] - /Root 6 0 R - /Size 7 ->> -startxref -2210 -%%EOF \ No newline at end of file diff --git a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/More.imageset/Contents.json b/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/More.imageset/Contents.json deleted file mode 100644 index 990bf0cbd..000000000 --- a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/More.imageset/Contents.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "images" : [ - { - "filename" : "More.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - }, - "properties" : { - "preserves-vector-representation" : true - } -} diff --git a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/More.imageset/More.pdf b/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/More.imageset/More.pdf deleted file mode 100644 index 8ae9c73f2..000000000 --- a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/More.imageset/More.pdf +++ /dev/null @@ -1,83 +0,0 @@ -%PDF-1.7 - -1 0 obj - << >> -endobj - -2 0 obj - << /Length 3 0 R >> -stream -/DeviceRGB CS -/DeviceRGB cs -q -1.000000 0.000000 -0.000000 1.000000 4.250000 10.250000 cm -0.000000 0.000000 0.000000 scn -3.500000 1.750000 m -3.500000 0.783502 2.716498 0.000000 1.750000 0.000000 c -0.783502 0.000000 0.000000 0.783502 0.000000 1.750000 c -0.000000 2.716498 0.783502 3.500000 1.750000 3.500000 c -2.716498 3.500000 3.500000 2.716498 3.500000 1.750000 c -h -9.500000 1.750000 m -9.500000 0.783502 8.716498 0.000000 7.750000 0.000000 c -6.783502 0.000000 6.000000 0.783502 6.000000 1.750000 c -6.000000 2.716498 6.783502 3.500000 7.750000 3.500000 c -8.716498 3.500000 9.500000 2.716498 9.500000 1.750000 c -h -13.750000 0.000000 m -14.716498 0.000000 15.500000 0.783502 15.500000 1.750000 c -15.500000 2.716498 14.716498 3.500000 13.750000 3.500000 c -12.783502 3.500000 12.000000 2.716498 12.000000 1.750000 c -12.000000 0.783502 12.783502 0.000000 13.750000 0.000000 c -h -f -n -Q - -endstream -endobj - -3 0 obj - 877 -endobj - -4 0 obj - << /Annots [] - /Type /Page - /MediaBox [ 0.000000 0.000000 24.000000 24.000000 ] - /Resources 1 0 R - /Contents 2 0 R - /Parent 5 0 R - >> -endobj - -5 0 obj - << /Kids [ 4 0 R ] - /Count 1 - /Type /Pages - >> -endobj - -6 0 obj - << /Pages 5 0 R - /Type /Catalog - >> -endobj - -xref -0 7 -0000000000 65535 f -0000000010 00000 n -0000000034 00000 n -0000000967 00000 n -0000000989 00000 n -0000001162 00000 n -0000001236 00000 n -trailer -<< /ID [ (some) (id) ] - /Root 6 0 R - /Size 7 ->> -startxref -1295 -%%EOF \ No newline at end of file diff --git a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/People.imageset/Contents.json b/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/People.imageset/Contents.json deleted file mode 100644 index 8f5a17a88..000000000 --- a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/People.imageset/Contents.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "images" : [ - { - "filename" : "People.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - }, - "properties" : { - "preserves-vector-representation" : true - } -} diff --git a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/People.imageset/People.pdf b/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/People.imageset/People.pdf deleted file mode 100644 index c5345615f..000000000 --- a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/People.imageset/People.pdf +++ /dev/null @@ -1,140 +0,0 @@ -%PDF-1.7 - -1 0 obj - << >> -endobj - -2 0 obj - << /Length 3 0 R >> -stream -/DeviceRGB CS -/DeviceRGB cs -q -1.000000 0.000000 -0.000000 1.000000 2.000000 2.000000 cm -0.000000 0.000000 0.000000 scn -2.000000 8.001000 m -11.000000 8.000000 l -12.053818 8.000000 12.918116 7.184515 12.994511 6.149316 c -13.000000 6.000000 l -13.000000 4.500000 l -12.999000 1.000000 9.284000 0.000000 6.500000 0.000000 c -3.777867 0.000000 0.164695 0.956049 0.005454 4.270353 c -0.000000 4.500000 l -0.000000 6.001000 l -0.000000 7.054819 0.816397 7.919116 1.850808 7.995511 c -2.000000 8.001000 l -h -13.220000 8.000000 m -18.000000 8.000000 l -19.053818 8.000000 19.918116 7.183603 19.994511 6.149192 c -20.000000 6.000000 l -20.000000 5.000000 l -19.999001 1.938000 17.142000 1.000000 15.000000 1.000000 c -14.320000 1.000000 13.568999 1.096001 12.860000 1.322001 c -13.196000 1.708000 13.467000 2.149000 13.662000 2.649000 c -14.205000 2.524000 14.715000 2.500000 15.000000 2.500000 c -15.266544 2.505959 l -16.251810 2.549091 18.352863 2.869398 18.492661 4.795017 c -18.500000 5.000000 l -18.500000 6.000000 l -18.500000 6.245334 18.322222 6.449580 18.089575 6.491940 c -18.000000 6.500000 l -13.949000 6.500000 l -13.865001 7.001375 13.655437 7.456812 13.354479 7.840185 c -13.220000 8.000000 l -18.000000 8.000000 l -13.220000 8.000000 l -h -2.000000 6.501000 m -1.899344 6.491000 l -1.774960 6.465720 1.690000 6.398199 1.646000 6.355000 c -1.602800 6.311000 1.535280 6.226681 1.510000 6.102040 c -1.500000 6.001000 l -1.500000 4.500000 l -1.500000 3.491000 1.950000 2.778000 2.917000 2.257999 c -3.743154 1.813076 4.919508 1.543680 6.182578 1.504868 c -6.500000 1.500000 l -6.817405 1.504868 l -8.080349 1.543680 9.255923 1.813076 10.083000 2.257999 c -10.988626 2.745499 11.441613 3.402630 11.494699 4.315081 c -11.500000 4.500999 l -11.500000 6.000000 l -11.500000 6.245334 11.322222 6.449580 11.089575 6.491940 c -11.000000 6.500000 l -2.000000 6.501000 l -h -6.500000 19.000000 m -8.985000 19.000000 11.000000 16.985001 11.000000 14.500000 c -11.000000 12.015000 8.985000 10.000000 6.500000 10.000000 c -4.015000 10.000000 2.000000 12.015000 2.000000 14.500000 c -2.000000 16.985001 4.015000 19.000000 6.500000 19.000000 c -h -15.500000 17.000000 m -17.433001 17.000000 19.000000 15.433001 19.000000 13.500000 c -19.000000 11.566999 17.433001 10.000000 15.500000 10.000000 c -13.567000 10.000000 12.000000 11.566999 12.000000 13.500000 c -12.000000 15.433001 13.567000 17.000000 15.500000 17.000000 c -h -6.500000 17.500000 m -4.846000 17.500000 3.500000 16.153999 3.500000 14.500000 c -3.500000 12.846000 4.846000 11.500000 6.500000 11.500000 c -8.154000 11.500000 9.500000 12.846000 9.500000 14.500000 c -9.500000 16.153999 8.154000 17.500000 6.500000 17.500000 c -h -15.500000 15.500000 m -14.397000 15.500000 13.500000 14.603001 13.500000 13.500000 c -13.500000 12.396999 14.397000 11.500000 15.500000 11.500000 c -16.603001 11.500000 17.500000 12.396999 17.500000 13.500000 c -17.500000 14.603001 16.603001 15.500000 15.500000 15.500000 c -h -f -n -Q - -endstream -endobj - -3 0 obj - 2893 -endobj - -4 0 obj - << /Annots [] - /Type /Page - /MediaBox [ 0.000000 0.000000 24.000000 24.000000 ] - /Resources 1 0 R - /Contents 2 0 R - /Parent 5 0 R - >> -endobj - -5 0 obj - << /Kids [ 4 0 R ] - /Count 1 - /Type /Pages - >> -endobj - -6 0 obj - << /Pages 5 0 R - /Type /Catalog - >> -endobj - -xref -0 7 -0000000000 65535 f -0000000010 00000 n -0000000034 00000 n -0000002983 00000 n -0000003006 00000 n -0000003179 00000 n -0000003253 00000 n -trailer -<< /ID [ (some) (id) ] - /Root 6 0 R - /Size 7 ->> -startxref -3312 -%%EOF \ No newline at end of file diff --git a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/people.add.imageset/Contents.json b/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/people.add.imageset/Contents.json deleted file mode 100644 index b7086c903..000000000 --- a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/people.add.imageset/Contents.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "images" : [ - { - "filename" : "People Add.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - }, - "properties" : { - "preserves-vector-representation" : true - } -} diff --git a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/people.add.imageset/People Add.pdf b/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/people.add.imageset/People Add.pdf deleted file mode 100644 index a25e5685a..000000000 --- a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Compose/people.add.imageset/People Add.pdf +++ /dev/null @@ -1,150 +0,0 @@ -%PDF-1.7 - -1 0 obj - << >> -endobj - -2 0 obj - << /Length 3 0 R >> -stream -/DeviceRGB CS -/DeviceRGB cs -q -1.000000 0.000000 -0.000000 1.000000 2.000000 1.000000 cm -0.000000 0.000000 0.000000 scn -15.500000 11.000000 m -18.537567 11.000000 21.000000 8.537566 21.000000 5.500000 c -21.000000 2.462433 18.537567 0.000000 15.500000 0.000000 c -12.462434 0.000000 10.000000 2.462433 10.000000 5.500000 c -10.000000 8.537566 12.462434 11.000000 15.500000 11.000000 c -h -2.000000 10.001000 m -10.809396 9.999816 l -10.383152 9.555614 10.019394 9.050992 9.732251 8.500078 c -2.000000 8.501000 l -1.899344 8.491000 l -1.774960 8.465720 1.690000 8.398199 1.646000 8.355000 c -1.602800 8.311000 1.535280 8.226681 1.510000 8.102040 c -1.500000 8.001000 l -1.500000 6.500000 l -1.500000 5.491000 1.950000 4.778000 2.917000 4.257999 c -3.743154 3.813076 4.919508 3.543680 6.182578 3.504868 c -6.500000 3.500000 l -6.817405 3.504868 l -7.681085 3.531410 8.503904 3.665789 9.202351 3.890396 c -9.326429 3.397497 9.508213 2.927378 9.739013 2.486986 c -8.688712 2.137030 7.530568 2.000000 6.500000 2.000000 c -3.777867 2.000000 0.164695 2.956049 0.005454 6.270353 c -0.000000 6.500000 l -0.000000 8.001000 l -0.000000 9.105000 0.896000 10.001000 2.000000 10.001000 c -h -15.500000 8.998419 m -15.410124 8.990363 l -15.206031 8.953320 15.045100 8.792387 15.008057 8.588294 c -15.000000 8.498419 l -15.000000 6.000420 l -12.500000 6.000000 l -12.410125 5.991943 l -12.206032 5.954900 12.045099 5.793969 12.008056 5.589876 c -12.000000 5.500000 l -12.008056 5.410124 l -12.045099 5.206031 12.206032 5.045100 12.410125 5.008057 c -12.500000 5.000000 l -15.000000 5.000420 l -15.000000 2.500000 l -15.008057 2.410124 l -15.045100 2.206030 15.206031 2.045101 15.410124 2.008057 c -15.500000 2.000000 l -15.589876 2.008057 l -15.793969 2.045101 15.954900 2.206030 15.991943 2.410124 c -16.000000 2.500000 l -16.000000 5.000420 l -18.500000 5.000000 l -18.589876 5.008057 l -18.793970 5.045100 18.954899 5.206031 18.991943 5.410124 c -19.000000 5.500000 l -18.991943 5.589876 l -18.954899 5.793969 18.793970 5.954900 18.589876 5.991943 c -18.500000 6.000000 l -16.000000 6.000420 l -16.000000 8.498419 l -15.991943 8.588294 l -15.954900 8.792387 15.793969 8.953320 15.589876 8.990363 c -15.500000 8.998419 l -h -6.500000 21.000000 m -8.985000 21.000000 11.000000 18.985001 11.000000 16.500000 c -11.000000 14.015000 8.985000 12.000000 6.500000 12.000000 c -4.015000 12.000000 2.000000 14.015000 2.000000 16.500000 c -2.000000 18.985001 4.015000 21.000000 6.500000 21.000000 c -h -15.500000 19.000000 m -17.433001 19.000000 19.000000 17.433001 19.000000 15.500000 c -19.000000 13.566999 17.433001 12.000000 15.500000 12.000000 c -13.567000 12.000000 12.000000 13.566999 12.000000 15.500000 c -12.000000 17.433001 13.567000 19.000000 15.500000 19.000000 c -h -6.500000 19.500000 m -4.846000 19.500000 3.500000 18.153999 3.500000 16.500000 c -3.500000 14.846000 4.846000 13.500000 6.500000 13.500000 c -8.154000 13.500000 9.500000 14.846000 9.500000 16.500000 c -9.500000 18.153999 8.154000 19.500000 6.500000 19.500000 c -h -15.500000 17.500000 m -14.397000 17.500000 13.500000 16.603001 13.500000 15.500000 c -13.500000 14.396999 14.397000 13.500000 15.500000 13.500000 c -16.603001 13.500000 17.500000 14.396999 17.500000 15.500000 c -17.500000 16.603001 16.603001 17.500000 15.500000 17.500000 c -h -f -n -Q - -endstream -endobj - -3 0 obj - 3220 -endobj - -4 0 obj - << /Annots [] - /Type /Page - /MediaBox [ 0.000000 0.000000 24.000000 24.000000 ] - /Resources 1 0 R - /Contents 2 0 R - /Parent 5 0 R - >> -endobj - -5 0 obj - << /Kids [ 4 0 R ] - /Count 1 - /Type /Pages - >> -endobj - -6 0 obj - << /Pages 5 0 R - /Type /Catalog - >> -endobj - -xref -0 7 -0000000000 65535 f -0000000010 00000 n -0000000034 00000 n -0000003310 00000 n -0000003333 00000 n -0000003506 00000 n -0000003580 00000 n -trailer -<< /ID [ (some) (id) ] - /Root 6 0 R - /Size 7 ->> -startxref -3639 -%%EOF \ No newline at end of file diff --git a/MastodonSDK/Sources/MastodonAsset/Generated/Assets.swift b/MastodonSDK/Sources/MastodonAsset/Generated/Assets.swift index f6f70b12c..3b961a029 100644 --- a/MastodonSDK/Sources/MastodonAsset/Generated/Assets.swift +++ b/MastodonSDK/Sources/MastodonAsset/Generated/Assets.swift @@ -140,17 +140,12 @@ public enum Asset { public static let retry = ImageAsset(name: "Scene/Compose/Attachment/retry") public static let stop = ImageAsset(name: "Scene/Compose/Attachment/stop") } - public static let earth = ImageAsset(name: "Scene/Compose/Earth") - public static let mention = ImageAsset(name: "Scene/Compose/Mention") - public static let more = ImageAsset(name: "Scene/Compose/More") - public static let people = ImageAsset(name: "Scene/Compose/People") public static let buttonTint = ColorAsset(name: "Scene/Compose/button.tint") public static let chatWarningFill = ImageAsset(name: "Scene/Compose/chat.warning.fill") public static let chatWarning = ImageAsset(name: "Scene/Compose/chat.warning") public static let emojiFill = ImageAsset(name: "Scene/Compose/emoji.fill") public static let emoji = ImageAsset(name: "Scene/Compose/emoji") public static let media = ImageAsset(name: "Scene/Compose/media") - public static let peopleAdd = ImageAsset(name: "Scene/Compose/people.add") public static let pollFill = ImageAsset(name: "Scene/Compose/poll.fill") public static let poll = ImageAsset(name: "Scene/Compose/poll") public static let questionmarkCircle = ImageAsset(name: "Scene/Compose/questionmark.circle") diff --git a/MastodonSDK/Sources/MastodonSDK/Entity/Mastodon+Entity+Status.swift b/MastodonSDK/Sources/MastodonSDK/Entity/Mastodon+Entity+Status.swift index cf401e960..7c9edcb16 100644 --- a/MastodonSDK/Sources/MastodonSDK/Entity/Mastodon+Entity+Status.swift +++ b/MastodonSDK/Sources/MastodonSDK/Entity/Mastodon+Entity+Status.swift @@ -6,6 +6,8 @@ // import Foundation +import UIKit +import MastodonLocalization extension Mastodon.Entity { @@ -109,9 +111,9 @@ extension Mastodon.Entity.Status { case unlisted case `private` case direct - + case _other(String) - + public init?(rawValue: String) { switch rawValue { case "public": self = .public @@ -121,7 +123,7 @@ extension Mastodon.Entity.Status { default: self = ._other(rawValue) } } - + public var rawValue: String { switch self { case .public: return "public" @@ -131,6 +133,27 @@ extension Mastodon.Entity.Status { case ._other(let value): return value } } + + public var title: String { + switch self { + case .public: return L10n.Scene.Compose.Visibility.public + case .unlisted: return L10n.Scene.Compose.Visibility.unlisted + case .private: return L10n.Scene.Compose.Visibility.private + case .direct: return L10n.Scene.Compose.Visibility.direct + case ._other(let value): return value + } + } + + public var image: UIImage { + switch self { + case .public: return UIImage(systemName: "globe.europe.africa")!.withRenderingMode(.alwaysTemplate) + case .unlisted: return UIImage(systemName: "moon")!.withRenderingMode(.alwaysTemplate) + case .private: return UIImage(systemName: "lock")!.withRenderingMode(.alwaysTemplate) + case .direct: return UIImage(systemName: "at")!.withRenderingMode(.alwaysTemplate) + case ._other: return UIImage(systemName: "ellipsis")!.withRenderingMode(.alwaysTemplate) + } + } + } } diff --git a/MastodonSDK/Sources/MastodonUI/Extension/MastodonVisibility+Image.swift b/MastodonSDK/Sources/MastodonUI/Extension/MastodonVisibility+Image.swift index 05dcd5e18..0745b171f 100644 --- a/MastodonSDK/Sources/MastodonUI/Extension/MastodonVisibility+Image.swift +++ b/MastodonSDK/Sources/MastodonUI/Extension/MastodonVisibility+Image.swift @@ -3,18 +3,19 @@ import UIKit import CoreDataStack import MastodonAsset +import MastodonSDK extension MastodonVisibility { public var image: UIImage { - let asset: ImageAsset + let asset: UIImage switch self { - case .public: asset = Asset.Scene.Compose.earth - case .unlisted: asset = Asset.Scene.Compose.people - case .private: asset = Asset.Scene.Compose.peopleAdd - case .direct: asset = Asset.Scene.Compose.mention - case ._other: asset = Asset.Scene.Compose.questionmarkCircle + case .public: asset = Mastodon.Entity.Status.Visibility.public.image + case .unlisted: asset = Mastodon.Entity.Status.Visibility.unlisted.image + case .private: asset = Mastodon.Entity.Status.Visibility.private.image + case .direct: asset = Mastodon.Entity.Status.Visibility.direct.image + case ._other: asset = Mastodon.Entity.Status.Visibility._other("").image } - return asset.image.withRenderingMode(.alwaysTemplate) + return asset.withRenderingMode(.alwaysTemplate) } } diff --git a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Toolbar/ComposeContentToolbarView+ViewModel.swift b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Toolbar/ComposeContentToolbarView+ViewModel.swift index bb550185c..e35ad7b77 100644 --- a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Toolbar/ComposeContentToolbarView+ViewModel.swift +++ b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Toolbar/ComposeContentToolbarView+ViewModel.swift @@ -21,9 +21,7 @@ extension ComposeContentToolbarView { @Published var suggestedLanguages: [String] = [] @Published var highConfidenceSuggestedLanguage: String? @Published var visibility: Mastodon.Entity.Status.Visibility = .public - var allVisibilities: [Mastodon.Entity.Status.Visibility] { - return [.public, .private, .direct] - } + let allVisibilities = [Mastodon.Entity.Status.Visibility.public, .unlisted, .private, .direct] @Published var isVisibilityButtonEnabled = false @Published var isPollActive = false @Published var isEmojiActive = false @@ -67,7 +65,7 @@ extension ComposeContentToolbarView.ViewModel { case .contentWarning: return Asset.Scene.Compose.chatWarningFill.image.withRenderingMode(.alwaysTemplate) case .visibility: - return Asset.Scene.Compose.earth.image.withRenderingMode(.alwaysTemplate) + return Mastodon.Entity.Status.Visibility.public.image.withRenderingMode(.alwaysTemplate) case .language: fatalError("Language’s active image is never accessed") } @@ -84,7 +82,7 @@ extension ComposeContentToolbarView.ViewModel { case .contentWarning: return Asset.Scene.Compose.chatWarning.image.withRenderingMode(.alwaysTemplate) case .visibility: - return Asset.Scene.Compose.earth.image.withRenderingMode(.alwaysTemplate) + return Mastodon.Entity.Status.Visibility.public.image case .language: fatalError("Language’s inactive image is never accessed") } diff --git a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Toolbar/ComposeContentToolbarView.swift b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Toolbar/ComposeContentToolbarView.swift index 324fcdebc..5ed966d02 100644 --- a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Toolbar/ComposeContentToolbarView.swift +++ b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Toolbar/ComposeContentToolbarView.swift @@ -6,6 +6,7 @@ // import SwiftUI +import UIKit import MastodonAsset import MastodonLocalization import MastodonSDK @@ -219,23 +220,4 @@ extension ComposeContentToolbarView { } extension Mastodon.Entity.Status.Visibility { - fileprivate var title: String { - switch self { - case .public: return L10n.Scene.Compose.Visibility.public - case .unlisted: return L10n.Scene.Compose.Visibility.unlisted - case .private: return L10n.Scene.Compose.Visibility.private - case .direct: return L10n.Scene.Compose.Visibility.direct - case ._other(let value): return value - } - } - - fileprivate var image: UIImage { - switch self { - case .public: return Asset.Scene.Compose.earth.image.withRenderingMode(.alwaysTemplate) - case .unlisted: return Asset.Scene.Compose.people.image.withRenderingMode(.alwaysTemplate) - case .private: return Asset.Scene.Compose.peopleAdd.image.withRenderingMode(.alwaysTemplate) - case .direct: return Asset.Scene.Compose.mention.image.withRenderingMode(.alwaysTemplate) - case ._other: return Asset.Scene.Compose.more.image.withRenderingMode(.alwaysTemplate) - } - } } diff --git a/MastodonSDK/Sources/MastodonUI/View/Content/StatusAuthorView.swift b/MastodonSDK/Sources/MastodonUI/View/Content/StatusAuthorView.swift index db34f081c..f5944c3ae 100644 --- a/MastodonSDK/Sources/MastodonUI/View/Content/StatusAuthorView.swift +++ b/MastodonSDK/Sources/MastodonUI/View/Content/StatusAuthorView.swift @@ -12,6 +12,7 @@ import MetaTextKit import MastodonAsset import MastodonCore import MastodonLocalization +import MastodonSDK public class StatusAuthorView: UIStackView { private var _disposeBag = Set() // which lifetime same to view scope @@ -49,7 +50,7 @@ public class StatusAuthorView: UIStackView { let imageView = UIImageView() imageView.tintColor = Asset.Colors.Label.secondary.color imageView.contentMode = .scaleAspectFit - imageView.image = Asset.Scene.Compose.earth.image.withRenderingMode(.alwaysTemplate) + imageView.image = Mastodon.Entity.Status.Visibility.public.image return imageView }()