From fbcf230874be07dfe02286a6698117c076e96726 Mon Sep 17 00:00:00 2001 From: Spocke Date: Fri, 24 Nov 2023 15:11:18 +0100 Subject: [PATCH] TINY-10394: Added pLoadVersion --- CHANGELOG.md | 5 ++++- src/main/ts/api/VersionLoader.ts | 3 ++- src/main/ts/loader/Versions.ts | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7240703..dc230f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,11 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Added +- `VersionLoader.pLoadVersion` function. #TINY-10394 + ### Removed - Removed support for TinyMCE 4.x. #TINY-10142 ### Changed -- Made the VersionLoader.setup functions logs argument optional. #TINY-10394 +- Made the `VersionLoader.setup` functions logs argument optional. #TINY-10394 ## 5.0.1 - 2022-06-29 diff --git a/src/main/ts/api/VersionLoader.ts b/src/main/ts/api/VersionLoader.ts index 019abdd..30c4b16 100644 --- a/src/main/ts/api/VersionLoader.ts +++ b/src/main/ts/api/VersionLoader.ts @@ -1,6 +1,7 @@ import { Pipeline, Step, TestLogs } from '@ephox/agar'; import { TinyLoader } from '@ephox/mcagar'; +import * as Loader from '../loader/Loader'; import { readPlugins, registerPlugins, sRegisterPlugins } from '../loader/Plugins'; import * as TinyVersions from '../loader/Versions'; @@ -42,4 +43,4 @@ export const sSetupVersion = (version: string, testPlugins: string[], call }, settings, next, die, initLogs) ); -export const sWithVersion = TinyVersions.sWithVersion; +export const pLoadVersion = (version: string): Promise => new Promise((resolve, reject) => Loader.load(version, resolve, reject)); diff --git a/src/main/ts/loader/Versions.ts b/src/main/ts/loader/Versions.ts index c449e2c..282a894 100644 --- a/src/main/ts/loader/Versions.ts +++ b/src/main/ts/loader/Versions.ts @@ -35,4 +35,4 @@ const sWithVersion = (version: string, step: Step): Step