initialState->provideInitialState( 'workspace_available', $this->configService->isRichWorkspaceAvailable() ); $this->initialState->provideInitialState( 'workspace_enabled', $this->configService->isRichWorkspaceEnabledForUser($this->userId) ); $this->initialState->provideInitialState( 'open_read_only_enabled', $this->configService->isOpenReadOnlyEnabled() ); $this->initialState->provideInitialState( 'default_file_extension', $this->configService->getDefaultFileExtension() ); $this->initialState->provideInitialState( 'rich_editing_enabled', $this->configService->isRichEditingEnabled() ); $taskTypes = $this->taskProcessingManager->getAvailableTaskTypes(); $fromLanguages = $taskTypes['core:text2text:translate']['inputShapeEnumValues']['origin_language'] ?? []; $toLanguages = $taskTypes['core:text2text:translate']['inputShapeEnumValues']['target_language'] ?? []; $this->initialState->provideInitialState( 'translation_languages', [ 'from' => $fromLanguages, 'to' => $toLanguages, ] ); $filteredTypes = array_filter($taskTypes, static function (string $taskType) { return in_array($taskType, self::ASSISTANT_TASK_TYPES, true); }, ARRAY_FILTER_USE_KEY); $this->initialState->provideInitialState( 'taskprocessing', array_map(static function (string $typeId, array $taskType) { $taskType['id'] = $typeId; return $taskType; }, array_keys($filteredTypes), array_values($filteredTypes)), ); $this->initialState->provideInitialState( 'notify_push', $this->configService->isNotifyPushSyncEnabled(), ); $this->initialState->provideInitialState( 'is_full_width_editor', $this->configService->isFullWidthEditor($this->userId), ); } public function provideFileId(int $fileId): void { $this->initialState->provideInitialState('file_id', $fileId); } public function provideFile(array $fileData): void { $this->initialState->provideInitialState('file', $fileData); } public function provideDirectEditToken(string $token): void { $this->initialState->provideInitialState('directEditingToken', $token); } }