+
diff --git a/package.json b/package.json
index 931dfec..459757b 100644
--- a/package.json
+++ b/package.json
@@ -30,10 +30,12 @@
"./package.json": "./package.json"
},
"dependencies": {
- "lodash-es": "^4.17.21"
+ "lodash-es": "^4.17.21",
+ "@ckeditor/ckeditor5-integrations-common": "^1.0.0"
},
"peerDependencies": {
"ckeditor5": ">=42.0.0 || ^0.0.0-nightly",
+ "ckeditor5-premium-features": ">=42.0.0 || ^0.0.0-nightly",
"vue": "^3.4.0"
},
"devDependencies": {
@@ -48,6 +50,7 @@
"@vitest/ui": "^2.0.0",
"@vue/test-utils": "^2.3.1",
"ckeditor5": "^42.0.0",
+ "ckeditor5-premium-features": "^42.0.2",
"coveralls": "^3.1.1",
"eslint": "^7.32.0",
"eslint-config-ckeditor5": "^5.3.2",
@@ -79,7 +82,7 @@
"build": "vite build && vue-tsc --declaration --emitDeclarationOnly",
"test": "vitest run --coverage",
"test:watch": "vitest --ui --watch",
- "lint": "eslint \"{demo,src,tests}/**/*.{ts,vue}\"",
+ "lint": "eslint \"{demos,src,tests}/**/*.{ts,vue}\"",
"postinstall": "node ./scripts/postinstall.js",
"changelog": "node ./scripts/changelog.js",
"release:prepare-packages": "node ./scripts/preparepackages.js",
diff --git a/scripts/bump-year.js b/scripts/bump-year.js
index 9db1427..d73fc64 100644
--- a/scripts/bump-year.js
+++ b/scripts/bump-year.js
@@ -32,7 +32,7 @@ bumpYear( {
pattern: '.husky/*'
},
{
- pattern: '!(coverage|.nyc_output|dist|demo)/**'
+ pattern: '!(coverage|.nyc_output|dist|demos)/**'
}
]
} );
diff --git a/src/composables/useAsync.ts b/src/composables/useAsync.ts
new file mode 100644
index 0000000..0272c29
--- /dev/null
+++ b/src/composables/useAsync.ts
@@ -0,0 +1,100 @@
+/**
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+import {
+ computed, ref,
+ shallowReadonly, watchEffect,
+ type ComputedRef, type Ref
+} from 'vue';
+
+import { uid } from '@ckeditor/ckeditor5-integrations-common';
+
+/**
+ * A composable that executes an async function and provides the result.
+ *
+ * @param asyncFunc The async function to execute.
+ * @returns The result of the async function.
+ * @example
+ *
+ * ```ts
+ * const { loading, data, error } = useAsync( async () => {
+ * const response = await fetch( 'https://api.example.com/data' );
+ * return response.json();
+ * } );
+ * ```
+ */
+export const useAsync =