From facc02a30a2b2664fdbb4ed29b33c885c67c5326 Mon Sep 17 00:00:00 2001 From: Paulo Castellano Date: Sat, 9 May 2026 11:27:24 -0300 Subject: [PATCH 01/10] feat(tiktok): add TikTokPhoto content type for photo carousels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds the enum case TikTokPhoto = 'tiktok_photo' with maxMediaCount 35, supportsImage true, supportsVideo false, 1:1 aspect ratio. The publisher service already calls /post/publish/content/init/ correctly — this enum case is the missing data layer that lets validation, UI, and defaults treat photo posts as a first-class content type. --- app/Enums/PostPlatform/ContentType.php | 9 +++++++- .../TikTokPhotoContentTypeTest.php | 23 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 tests/Unit/Enums/PostPlatform/TikTokPhotoContentTypeTest.php diff --git a/app/Enums/PostPlatform/ContentType.php b/app/Enums/PostPlatform/ContentType.php index 15325a99..5f15b5ec 100644 --- a/app/Enums/PostPlatform/ContentType.php +++ b/app/Enums/PostPlatform/ContentType.php @@ -29,6 +29,7 @@ enum ContentType: string // TikTok case TikTokVideo = 'tiktok_video'; + case TikTokPhoto = 'tiktok_photo'; // YouTube case YouTubeShort = 'youtube_short'; @@ -63,6 +64,7 @@ public function label(): string self::FacebookReel => 'Reel', self::FacebookStory => 'Story', self::TikTokVideo => 'Video', + self::TikTokPhoto => 'Photo carousel', self::YouTubeShort => 'Short', self::XPost => 'Post', self::ThreadsPost => 'Post', @@ -87,6 +89,7 @@ public function description(): string self::FacebookReel => 'Short video up to 90 seconds', self::FacebookStory => 'Disappears after 24 hours', self::TikTokVideo => 'Short-form video content', + self::TikTokPhoto => 'Up to 35 photos as a swipeable carousel', self::YouTubeShort => 'Vertical video up to 60 seconds', self::XPost => 'Tweet with text and media', self::ThreadsPost => 'Text post with optional media', @@ -105,7 +108,7 @@ public function platform(): SocialPlatform self::LinkedInPost, self::LinkedInCarousel => SocialPlatform::LinkedIn, self::LinkedInPagePost, self::LinkedInPageCarousel => SocialPlatform::LinkedInPage, self::FacebookPost, self::FacebookReel, self::FacebookStory => SocialPlatform::Facebook, - self::TikTokVideo => SocialPlatform::TikTok, + self::TikTokVideo, self::TikTokPhoto => SocialPlatform::TikTok, self::YouTubeShort => SocialPlatform::YouTube, self::XPost => SocialPlatform::X, self::ThreadsPost => SocialPlatform::Threads, @@ -156,6 +159,7 @@ public function aspectRatio(): ?string self::InstagramReel, self::InstagramStory => '9:16', self::FacebookReel, self::FacebookStory => '9:16', self::TikTokVideo, self::YouTubeShort => '9:16', + self::TikTokPhoto => '1:1', self::PinterestPin, self::PinterestCarousel => '2:3', self::PinterestVideoPin => '9:16', default => null, @@ -173,6 +177,7 @@ public function maxMediaCount(): int self::FacebookPost => 10, self::FacebookReel, self::FacebookStory => 1, self::TikTokVideo => 1, + self::TikTokPhoto => 35, self::YouTubeShort => 1, self::XPost => 4, self::ThreadsPost => 10, @@ -192,6 +197,7 @@ public function supportsVideo(): bool self::LinkedInCarousel, self::LinkedInPageCarousel => false, self::FacebookPost, self::FacebookReel, self::FacebookStory => true, self::TikTokVideo => true, + self::TikTokPhoto => false, self::YouTubeShort => true, self::XPost => true, self::ThreadsPost => true, @@ -207,6 +213,7 @@ public function supportsImage(): bool return match ($this) { self::InstagramReel => false, self::TikTokVideo => false, + self::TikTokPhoto => true, self::YouTubeShort => false, self::PinterestVideoPin => false, default => true, diff --git a/tests/Unit/Enums/PostPlatform/TikTokPhotoContentTypeTest.php b/tests/Unit/Enums/PostPlatform/TikTokPhotoContentTypeTest.php new file mode 100644 index 00000000..344eaf97 --- /dev/null +++ b/tests/Unit/Enums/PostPlatform/TikTokPhotoContentTypeTest.php @@ -0,0 +1,23 @@ +platform())->toBe(SocialPlatform::TikTok); +}); + +test('tiktok photo content type supports up to 35 images', function () { + expect(ContentType::TikTokPhoto->maxMediaCount())->toBe(35); +}); + +test('tiktok photo content type supports images and not video', function () { + expect(ContentType::TikTokPhoto->supportsImage())->toBeTrue(); + expect(ContentType::TikTokPhoto->supportsVideo())->toBeFalse(); +}); + +test('tiktok photo content type label is human-readable', function () { + expect(ContentType::TikTokPhoto->label())->toBe('Photo carousel'); +}); From 9b42701a9d552865d8ed84fbfe9c19ebde8d7108 Mon Sep 17 00:00:00 2001 From: Paulo Castellano Date: Sat, 9 May 2026 11:35:55 -0300 Subject: [PATCH 02/10] fix(tiktok): use description field for photo posts (4000 char cap) TikTok's photo endpoint caps the 'title' field at 90 UTF-16 runes but allows 'description' up to 4000. Today the publisher always sends the caption in 'title', which would silently fail for any photo caption longer than 90 chars. Split buildPostInfo into buildVideoPostInfo (uses title) and buildPhotoPostInfo (uses description, omits Duet/ Stitch/AIGC since they don't apply to photos). --- app/Services/Social/TikTokPublisher.php | 49 ++++++++++++++--- .../Services/Social/TikTokPublisherTest.php | 54 ++++++++++++++++++- 2 files changed, 95 insertions(+), 8 deletions(-) diff --git a/app/Services/Social/TikTokPublisher.php b/app/Services/Social/TikTokPublisher.php index e2b90893..52209a8b 100644 --- a/app/Services/Social/TikTokPublisher.php +++ b/app/Services/Social/TikTokPublisher.php @@ -97,7 +97,14 @@ private function queryCreatorInfo(SocialAccount $account): array ]; } - private function buildPostInfo(PostPlatform $postPlatform, ?string $content, array $creatorInfo): array + /** + * Build the post_info payload for a VIDEO post. TikTok's video endpoint + * accepts the caption in the `title` field (capped at 2200 chars by the + * platform's maxContentLength). + * + * @return array + */ + private function buildVideoPostInfo(PostPlatform $postPlatform, ?string $content, array $creatorInfo): array { $meta = $postPlatform->meta ?? []; @@ -127,13 +134,45 @@ private function buildPostInfo(PostPlatform $postPlatform, ?string $content, arr return $postInfo; } + /** + * Build the post_info payload for a PHOTO carousel. TikTok's photo endpoint + * accepts the caption in the `description` field (cap 4000 UTF-16 runes). + * The `title` field is a separate 90-char headline that we don't expose, + * so we omit it. Duet/Stitch and is_aigc do not apply to photo posts. + * + * @return array + */ + private function buildPhotoPostInfo(PostPlatform $postPlatform, ?string $content, array $creatorInfo): array + { + $meta = $postPlatform->meta ?? []; + + $privacyLevel = data_get($meta, 'privacy_level') + ?: data_get($creatorInfo, 'privacy_level', 'SELF_ONLY'); + + $postInfo = [ + 'description' => $content ?? '', + 'privacy_level' => $privacyLevel, + 'disable_comment' => ! data_get($meta, 'allow_comments', true), + ]; + + if (data_get($meta, 'brand_content_toggle', false)) { + $postInfo['brand_content_toggle'] = true; + } + + if (data_get($meta, 'brand_organic_toggle', false)) { + $postInfo['brand_organic_toggle'] = true; + } + + return $postInfo; + } + private function publishVideo(PostPlatform $postPlatform, $media, ?string $content): array { $creatorInfo = $this->queryCreatorInfo($postPlatform->socialAccount); $response = $this->getHttpClient() ->post("{$this->baseUrl}/post/publish/video/init/", [ - 'post_info' => $this->buildPostInfo($postPlatform, $content, $creatorInfo), + 'post_info' => $this->buildVideoPostInfo($postPlatform, $content, $creatorInfo), 'source_info' => [ 'source' => 'PULL_FROM_URL', 'video_url' => $media->url, @@ -186,11 +225,9 @@ private function publishPhotos(PostPlatform $postPlatform, $mediaCollection, ?st $creatorInfo = $this->queryCreatorInfo($postPlatform->socialAccount); - $postInfo = $this->buildPostInfo($postPlatform, $content, $creatorInfo); - // Photos don't support duet/stitch/is_aigc - unset($postInfo['disable_duet'], $postInfo['disable_stitch'], $postInfo['is_aigc']); + $postInfo = $this->buildPhotoPostInfo($postPlatform, $content, $creatorInfo); - // Auto add music is only for photos + // Auto add music is only for photos. $meta = $postPlatform->meta ?? []; if (data_get($meta, 'auto_add_music', false)) { $postInfo['auto_add_music'] = true; diff --git a/tests/Unit/Services/Social/TikTokPublisherTest.php b/tests/Unit/Services/Social/TikTokPublisherTest.php index 0fb975ec..bf94f68b 100644 --- a/tests/Unit/Services/Social/TikTokPublisherTest.php +++ b/tests/Unit/Services/Social/TikTokPublisherTest.php @@ -114,7 +114,13 @@ expect($result['id'])->toBe('pub_photo_123'); Http::assertSent(function ($request) { - return str_contains($request->url(), '/post/publish/content/init/'); + if (! str_contains($request->url(), '/post/publish/content/init/')) { + return false; + } + $body = json_decode($request->body(), true); + + return data_get($body, 'post_info.description') === 'Check out this TikTok video!' + && ! isset($body['post_info']['title']); }); }); @@ -481,7 +487,9 @@ return $postInfo['auto_add_music'] === true && ! isset($postInfo['disable_duet']) && ! isset($postInfo['disable_stitch']) - && ! isset($postInfo['is_aigc']); + && ! isset($postInfo['is_aigc']) + && ! isset($postInfo['title']) + && isset($postInfo['description']); }); }); @@ -577,3 +585,45 @@ && ! isset($postInfo['brand_content_toggle']); }); }); + +test('tiktok publisher sends video caption in title field, never description', function () { + $this->post->update([ + 'media' => [ + [ + 'id' => 'test-media-video', + 'path' => 'media/2026-01/test-video.mp4', + 'url' => 'https://example.com/media/2026-01/test-video.mp4', + 'mime_type' => 'video/mp4', + 'original_filename' => 'test-video.mp4', + ], + ], + 'content' => 'My video caption', + ]); + $this->postPlatform->update(['meta' => ['privacy_level' => 'SELF_ONLY']]); + + Http::fake([ + 'https://open.tiktokapis.com/v2/post/publish/creator_info/query/' => Http::response([ + 'data' => [ + 'privacy_level_options' => ['SELF_ONLY'], + ], + ], 200), + 'https://open.tiktokapis.com/v2/post/publish/video/init/' => Http::response([ + 'data' => ['publish_id' => 'pub_video_123'], + ], 200), + 'https://open.tiktokapis.com/v2/post/publish/status/fetch/' => Http::response([ + 'data' => ['status' => 'PUBLISH_COMPLETE', 'publish_id' => 'pub_video_123'], + ], 200), + ]); + + $this->publisher->publish($this->postPlatform); + + Http::assertSent(function ($request) { + if (! str_contains($request->url(), '/post/publish/video/init/')) { + return false; + } + $body = json_decode($request->body(), true); + + return data_get($body, 'post_info.title') === 'My video caption' + && ! isset($body['post_info']['description']); + }); +}); From 2c08da7787ac2fd6ff1e4d7523917ae52218e048 Mon Sep 17 00:00:00 2001 From: Paulo Castellano Date: Sat, 9 May 2026 12:47:49 -0300 Subject: [PATCH 03/10] feat(tiktok): photo carousel support + UX Content Sharing API compliance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Photo carousel support - Adds `ContentType::TikTokPhoto` enum case (max 35 photos, 1:1 aspect, supportsImage true, supportsVideo false) and JS mirror in content-type.ts. - Variant pill picker (Video / Photo carousel) at the top of TikTokSettings, mirroring the Instagram pattern. Wired through ScheduleTab to the parent editor's existing update:platformContentType emit. - i18n keys for variant_label / variant.video / variant.photo in en/pt-BR/es. - Publisher: split buildPostInfo into buildVideoPostInfo (uses `title`, TikTok cap 2200 chars) and buildPhotoPostInfo (uses `description`, cap 4000 chars; omits Duet/Stitch/AIGC since they don't apply). Removed the no-longer-needed queryCreatorInfo() call from publishVideo/publishPhotos — its only previous consumer (silent privacy_level fallback) is gone. ## UX Content Sharing API compliance Per TikTok review feedback citing https://developers.tiktok.com/doc/content-sharing-guidelines#required_ux_implementation_in_your_app Point 1 — already satisfied (creator_info fetch + nickname display). Point 2/4 — Music Usage Confirmation declaration is now always visible in TikTokSettings; text changes between "Music Usage Confirmation" and "Branded Content Policy and Music Usage Confirmation" based on toggle state. Previously the entire `

` block was conditional on a brand toggle being selected, hiding the baseline declaration. Point 2b — privacy_level may not have a default. UI was already correct; backend hardened: UpdatePostRequest now requires meta.privacy_level for tiktok platforms when status is publishing/scheduled (via withValidator); TikTokPublisher::resolveRequiredPrivacyLevel throws TikTokPublishException (ContentPolicy category) when missing instead of silently falling back to the creator's preferred level. Point 2c — interaction settings now condition on content type: - Photo posts hide Duet/Stitch (they don't apply per TikTok docs). - Photo posts hide AIGC (also video-only). - Video posts hide Auto Add Music (photos-only feature). - Max-duration warning hidden when not a video post. Source of truth is the user-selected contentType prop, not inferred from media — ensures the UI reacts immediately to the variant pill. Point 3a — publish button stays disabled when Disclose toggle is on without a sub-selection (already the case via tiktokComplianceValid). The disabled tooltip now uses the verbatim TikTok-required text "You need to indicate if your content promotes yourself, a third party, or both." instead of the generic "Some platform settings are incomplete..." when the only blocker is TikTok disclosure incompleteness. Point 3b — SELF_ONLY (Only me) privacy option is no longer filtered out when Branded Content is checked. It is rendered disabled with a hover tooltip "Branded content visibility cannot be set to private." plus a persistent amber warning paragraph below the dropdown. When the user toggles Branded Content while privacy is SELF_ONLY, the privacy clears and a vue-sonner warning toast surfaces the change. ## Cross-cutting - New `resources/js/enums/platform.ts` mirrors the PHP Platform enum, used in Edit.vue (tiktokComplianceValid + tiktokDisclosureIncomplete) and ScheduleTab.vue (all selected*Platforms computeds) to replace string literal comparisons against `'tiktok'` / `'facebook'` / etc. - PostPlatformFactory tiktok() state defaults meta.privacy_level to SELF_ONLY so existing test fixtures keep passing under the new publisher/FormRequest requirements. ## Tests - New tests/Unit/Enums/PostPlatform/TikTokPhotoContentTypeTest.php covering the new enum case (4 tests). - TikTokPublisherTest: added "video uses title not description" and "throws when meta.privacy_level missing" regression tests; renamed two existing tests that depended on the removed silent fallback. - New tests/Feature/UpdatePostRequestTest.php with 3 tests covering the FormRequest's privacy_level enforcement (publish-rejected, publish-passes, draft-allowed). Full Pest suite: 1490 passed, 2 skipped (pre-existing). --- .../Requests/App/Post/UpdatePostRequest.php | 42 +++++++ app/Services/Social/TikTokPublisher.php | 52 +++----- database/factories/PostPlatformFactory.php | 1 + lang/en/posts.php | 8 +- lang/es/posts.php | 8 +- lang/pt-BR/posts.php | 8 +- .../components/posts/editor/ScheduleTab.vue | 13 +- .../posts/editor/TikTokSettings.vue | 118 +++++++++++++----- resources/js/enums/content-type.ts | 1 + resources/js/enums/platform.ts | 16 +++ resources/js/pages/posts/Edit.vue | 23 +++- tests/Feature/UpdatePostRequestTest.php | 97 ++++++++++++++ .../Services/Social/TikTokPublisherTest.php | 50 +++++++- 13 files changed, 359 insertions(+), 78 deletions(-) create mode 100644 resources/js/enums/platform.ts create mode 100644 tests/Feature/UpdatePostRequestTest.php diff --git a/app/Http/Requests/App/Post/UpdatePostRequest.php b/app/Http/Requests/App/Post/UpdatePostRequest.php index a9f5ed4a..c37a54ad 100644 --- a/app/Http/Requests/App/Post/UpdatePostRequest.php +++ b/app/Http/Requests/App/Post/UpdatePostRequest.php @@ -6,9 +6,11 @@ use App\Enums\Post\Status; use App\Enums\PostPlatform\ContentType; +use App\Enums\SocialAccount\Platform; use App\Rules\ContentTypeCompatibleWithMedia; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rule; +use Illuminate\Validation\Validator; class UpdatePostRequest extends FormRequest { @@ -79,4 +81,44 @@ public function messages(): array 'scheduled_at.after' => 'The scheduled date must be in the future.', ]; } + + public function withValidator(Validator $validator): void + { + $validator->after(function ($validator): void { + if (! $this->isPublishingOrScheduling()) { + return; + } + + $platforms = $this->input('platforms', []); + $ids = collect($platforms)->pluck('id')->filter()->all(); + + // Scope to the current post via the route-bound relation — defensive + // (cross-post leakage is prevented and we use the existing relation + // rather than a separate global query). + $platformsById = $this->route('post') + ->postPlatforms() + ->whereIn('id', $ids) + ->pluck('platform', 'id'); + + foreach ($platforms as $i => $platform) { + $platformEnum = $platformsById[data_get($platform, 'id')] ?? null; + if ($platformEnum === Platform::TikTok + && blank(data_get($platform, 'meta.privacy_level'))) { + $validator->errors()->add( + "platforms.{$i}.meta.privacy_level", + 'TikTok privacy level is required when publishing.', + ); + } + } + }); + } + + private function isPublishingOrScheduling(): bool + { + return in_array( + $this->input('status'), + [Status::Scheduled->value, Status::Publishing->value], + true, + ); + } } diff --git a/app/Services/Social/TikTokPublisher.php b/app/Services/Social/TikTokPublisher.php index 52209a8b..5b2faf74 100644 --- a/app/Services/Social/TikTokPublisher.php +++ b/app/Services/Social/TikTokPublisher.php @@ -75,26 +75,24 @@ private function getHttpClient(): PendingRequest return $this->socialHttp()->asJson()->withToken($this->accessToken); } - private function queryCreatorInfo(SocialAccount $account): array + /** + * Resolve the user-selected privacy_level from meta, throwing when missing. + * TikTok UX Guideline Point 2b forbids any default — the user must pick + * explicitly. The FormRequest validates this upstream; this is the safety + * net for queue/job paths that bypass the request layer. + */ + private function resolveRequiredPrivacyLevel(PostPlatform $postPlatform): string { - $info = app(TikTokCreatorInfo::class)->fetch($account); - $privacyOptions = data_get($info, 'privacy_level_options') ?: ['SELF_ONLY']; + $privacyLevel = data_get($postPlatform->meta ?? [], 'privacy_level'); - // Prefer PUBLIC_TO_EVERYONE > MUTUAL_FOLLOW_FRIENDS > FOLLOWER_OF_CREATOR > SELF_ONLY - $preferred = ['PUBLIC_TO_EVERYONE', 'MUTUAL_FOLLOW_FRIENDS', 'FOLLOWER_OF_CREATOR', 'SELF_ONLY']; - - $privacyLevel = 'SELF_ONLY'; - foreach ($preferred as $level) { - if (in_array($level, $privacyOptions)) { - $privacyLevel = $level; - break; - } + if (blank($privacyLevel)) { + throw new TikTokPublishException( + userMessage: 'TikTok privacy level is required. Please open the post and pick a visibility option.', + category: ErrorCategory::ContentPolicy, + ); } - return [ - 'privacy_level' => $privacyLevel, - 'max_video_post_duration_sec' => data_get($info, 'max_video_post_duration_sec'), - ]; + return (string) $privacyLevel; } /** @@ -104,16 +102,13 @@ private function queryCreatorInfo(SocialAccount $account): array * * @return array */ - private function buildVideoPostInfo(PostPlatform $postPlatform, ?string $content, array $creatorInfo): array + private function buildVideoPostInfo(PostPlatform $postPlatform, ?string $content): array { $meta = $postPlatform->meta ?? []; - $privacyLevel = data_get($meta, 'privacy_level') - ?: data_get($creatorInfo, 'privacy_level', 'SELF_ONLY'); - $postInfo = [ 'title' => $content ?? '', - 'privacy_level' => $privacyLevel, + 'privacy_level' => $this->resolveRequiredPrivacyLevel($postPlatform), 'disable_duet' => ! data_get($meta, 'allow_duet', false), 'disable_comment' => ! data_get($meta, 'allow_comments', true), 'disable_stitch' => ! data_get($meta, 'allow_stitch', false), @@ -142,16 +137,13 @@ private function buildVideoPostInfo(PostPlatform $postPlatform, ?string $content * * @return array */ - private function buildPhotoPostInfo(PostPlatform $postPlatform, ?string $content, array $creatorInfo): array + private function buildPhotoPostInfo(PostPlatform $postPlatform, ?string $content): array { $meta = $postPlatform->meta ?? []; - $privacyLevel = data_get($meta, 'privacy_level') - ?: data_get($creatorInfo, 'privacy_level', 'SELF_ONLY'); - $postInfo = [ 'description' => $content ?? '', - 'privacy_level' => $privacyLevel, + 'privacy_level' => $this->resolveRequiredPrivacyLevel($postPlatform), 'disable_comment' => ! data_get($meta, 'allow_comments', true), ]; @@ -168,11 +160,9 @@ private function buildPhotoPostInfo(PostPlatform $postPlatform, ?string $content private function publishVideo(PostPlatform $postPlatform, $media, ?string $content): array { - $creatorInfo = $this->queryCreatorInfo($postPlatform->socialAccount); - $response = $this->getHttpClient() ->post("{$this->baseUrl}/post/publish/video/init/", [ - 'post_info' => $this->buildVideoPostInfo($postPlatform, $content, $creatorInfo), + 'post_info' => $this->buildVideoPostInfo($postPlatform, $content), 'source_info' => [ 'source' => 'PULL_FROM_URL', 'video_url' => $media->url, @@ -223,9 +213,7 @@ private function publishPhotos(PostPlatform $postPlatform, $mediaCollection, ?st ); } - $creatorInfo = $this->queryCreatorInfo($postPlatform->socialAccount); - - $postInfo = $this->buildPhotoPostInfo($postPlatform, $content, $creatorInfo); + $postInfo = $this->buildPhotoPostInfo($postPlatform, $content); // Auto add music is only for photos. $meta = $postPlatform->meta ?? []; diff --git a/database/factories/PostPlatformFactory.php b/database/factories/PostPlatformFactory.php index 14c1884a..508abec8 100644 --- a/database/factories/PostPlatformFactory.php +++ b/database/factories/PostPlatformFactory.php @@ -111,6 +111,7 @@ public function tiktok(): static return $this->state(fn (array $attributes) => [ 'platform' => Platform::TikTok, 'content_type' => ContentType::TikTokVideo, + 'meta' => ['privacy_level' => 'SELF_ONLY'], ]); } diff --git a/lang/en/posts.php b/lang/en/posts.php index 3b6904c0..a7a684aa 100644 --- a/lang/en/posts.php +++ b/lang/en/posts.php @@ -49,6 +49,11 @@ 'write_caption' => 'Write your caption...', 'tiktok' => [ 'settings' => 'TikTok Settings', + 'variant_label' => 'Post type', + 'variant' => [ + 'video' => 'Video', + 'photo' => 'Photo carousel', + ], 'posting_to' => 'Posting to', 'privacy_level' => 'Who can see this video?', 'privacy_placeholder' => 'Select visibility', @@ -57,6 +62,7 @@ 'friends' => 'Mutual follow friends', 'followers' => 'Followers', 'private' => 'Only me', + 'private_disabled_branded' => 'Branded content visibility cannot be set to private.', ], 'privacy_hint' => 'The available options depend on your TikTok account settings.', 'auto_add_music' => 'Auto add music', @@ -74,7 +80,7 @@ 'promotional_paid_title' => 'Your photo/video will be labeled as "Paid partnership".', 'promotional_description' => 'This cannot be changed once your video is posted.', 'compliance_incomplete' => 'You need to indicate if your content promotes yourself, a third party, or both.', - 'branded_blocks_private' => 'Branded content cannot be private. Choose Public or Mutual follow friends.', + 'branded_cleared_private' => 'Privacy was cleared because Branded Content cannot be private.', 'interaction_disabled_by_creator' => 'Disabled by your TikTok account settings.', 'max_duration_exceeded' => 'Video is :duration s long but this account can only post videos up to :max s.', 'creator_info_loading' => 'Loading your TikTok account settings…', diff --git a/lang/es/posts.php b/lang/es/posts.php index 7adbca73..68777104 100644 --- a/lang/es/posts.php +++ b/lang/es/posts.php @@ -49,6 +49,11 @@ 'write_caption' => 'Escribe tu descripción...', 'tiktok' => [ 'settings' => 'Configuración de TikTok', + 'variant_label' => 'Tipo de publicación', + 'variant' => [ + 'video' => 'Video', + 'photo' => 'Carrusel de fotos', + ], 'posting_to' => 'Publicando en', 'privacy_level' => '¿Quién puede ver este video?', 'privacy_placeholder' => 'Selecciona la visibilidad', @@ -57,6 +62,7 @@ 'friends' => 'Amigos mutuos', 'followers' => 'Seguidores', 'private' => 'Solo yo', + 'private_disabled_branded' => 'El contenido de marca no puede ser privado.', ], 'privacy_hint' => 'Las opciones disponibles dependen de la configuración de tu cuenta de TikTok.', 'auto_add_music' => 'Agregar música automáticamente', @@ -74,7 +80,7 @@ 'promotional_paid_title' => 'Tu foto/video será etiquetado como "Asociación pagada".', 'promotional_description' => 'Esto no se puede cambiar una vez publicado el video.', 'compliance_incomplete' => 'Debes indicar si tu contenido promociona a ti mismo, a un tercero o a ambos.', - 'branded_blocks_private' => 'El contenido patrocinado no puede ser privado. Elige Público o Amigos mutuos.', + 'branded_cleared_private' => 'La visibilidad se borró porque el contenido de marca no puede ser privado.', 'interaction_disabled_by_creator' => 'Desactivado por la configuración de tu cuenta TikTok.', 'max_duration_exceeded' => 'El video dura :duration s pero esta cuenta solo permite videos de hasta :max s.', 'creator_info_loading' => 'Cargando la configuración de tu cuenta TikTok…', diff --git a/lang/pt-BR/posts.php b/lang/pt-BR/posts.php index f7754c83..d7a4da21 100644 --- a/lang/pt-BR/posts.php +++ b/lang/pt-BR/posts.php @@ -49,6 +49,11 @@ 'write_caption' => 'Escreva sua legenda...', 'tiktok' => [ 'settings' => 'Configurações do TikTok', + 'variant_label' => 'Tipo de publicação', + 'variant' => [ + 'video' => 'Vídeo', + 'photo' => 'Carrossel de fotos', + ], 'posting_to' => 'Publicando em', 'privacy_level' => 'Quem pode ver este vídeo?', 'privacy_placeholder' => 'Selecione a visibilidade', @@ -57,6 +62,7 @@ 'friends' => 'Amigos em comum', 'followers' => 'Seguidores', 'private' => 'Apenas eu', + 'private_disabled_branded' => 'Conteúdo de marca não pode ser privado.', ], 'privacy_hint' => 'As opções disponíveis dependem das configurações da sua conta TikTok.', 'auto_add_music' => 'Adicionar música automaticamente', @@ -74,7 +80,7 @@ 'promotional_paid_title' => 'Sua foto/vídeo será rotulado como "Parceria paga".', 'promotional_description' => 'Isso não poderá ser alterado após a publicação.', 'compliance_incomplete' => 'Você precisa indicar se o conteúdo promove você mesmo, terceiros ou ambos.', - 'branded_blocks_private' => 'Conteúdo patrocinado não pode ser privado. Escolha Público ou Amigos em comum.', + 'branded_cleared_private' => 'A visibilidade foi limpa porque conteúdo de marca não pode ser privado.', 'interaction_disabled_by_creator' => 'Desativado pelas configurações da sua conta TikTok.', 'max_duration_exceeded' => 'Vídeo tem :duration s mas esta conta só permite vídeos de até :max s.', 'creator_info_loading' => 'Carregando configurações da sua conta TikTok…', diff --git a/resources/js/components/posts/editor/ScheduleTab.vue b/resources/js/components/posts/editor/ScheduleTab.vue index 5e0cea66..8fc366d6 100644 --- a/resources/js/components/posts/editor/ScheduleTab.vue +++ b/resources/js/components/posts/editor/ScheduleTab.vue @@ -12,6 +12,7 @@ import { Avatar } from '@/components/ui/avatar'; import { Badge } from '@/components/ui/badge'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'; import { getPlatformLabel, getPlatformLogo } from '@/composables/usePlatformLogo'; +import { Platform } from '@/enums/platform'; interface SocialAccount { id: string; @@ -97,33 +98,33 @@ const emit = defineEmits<{ const selectedTikTokPlatforms = computed(() => props.postPlatforms.filter( - (pp) => pp.platform === 'tiktok' && props.selectedPlatformIds.includes(pp.id), + (pp) => pp.platform === Platform.TikTok && props.selectedPlatformIds.includes(pp.id), ), ); const selectedInstagramPlatforms = computed(() => props.postPlatforms.filter( - (pp) => ['instagram', 'instagram-facebook'].includes(pp.platform) + (pp) => (pp.platform === Platform.Instagram || pp.platform === Platform.InstagramFacebook) && props.selectedPlatformIds.includes(pp.id), ), ); const selectedFacebookPlatforms = computed(() => props.postPlatforms.filter( - (pp) => pp.platform === 'facebook' && props.selectedPlatformIds.includes(pp.id), + (pp) => pp.platform === Platform.Facebook && props.selectedPlatformIds.includes(pp.id), ), ); const selectedLinkedInPlatforms = computed(() => props.postPlatforms.filter( - (pp) => ['linkedin', 'linkedin-page'].includes(pp.platform) + (pp) => (pp.platform === Platform.LinkedIn || pp.platform === Platform.LinkedInPage) && props.selectedPlatformIds.includes(pp.id), ), ); const selectedPinterestPlatforms = computed(() => props.postPlatforms.filter( - (pp) => pp.platform === 'pinterest' && props.selectedPlatformIds.includes(pp.id), + (pp) => pp.platform === Platform.Pinterest && props.selectedPlatformIds.includes(pp.id), ), ); @@ -267,8 +268,10 @@ const getPlatformAvatar = (pp: PostPlatform): string | null => :creator-info="getCreatorInfo(pp)" :creator-info-loading="tiktokCreatorInfos === undefined || tiktokCreatorInfos === null" :video-duration-sec="videoDurationSec" + :content-type="platformContentTypes[pp.id] ?? ''" :meta="platformMeta[pp.id] ?? {}" :disabled="isReadOnly" + @update:content-type="emit('update:platformContentType', pp.id, $event)" @update:meta="emit('update:platformMeta', pp.id, $event)" /> diff --git a/resources/js/components/posts/editor/TikTokSettings.vue b/resources/js/components/posts/editor/TikTokSettings.vue index bf735c63..c4511ee6 100644 --- a/resources/js/components/posts/editor/TikTokSettings.vue +++ b/resources/js/components/posts/editor/TikTokSettings.vue @@ -1,6 +1,8 @@