@blocklet/pages-kit 0.5.12 → 0.5.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/esm/api/pages-kit.js
CHANGED
|
@@ -2,7 +2,10 @@ import axios from 'axios';
|
|
|
2
2
|
import { joinURL } from 'ufo';
|
|
3
3
|
const PAGES_KIT_DID = 'z8iZiDFg3vkkrPwsiba1TLXy3H9XHzFERsP8o';
|
|
4
4
|
export async function preloadComponents(input) {
|
|
5
|
-
const prefix =
|
|
5
|
+
const prefix =
|
|
6
|
+
// @ts-ignore
|
|
7
|
+
window.blocklet?.componentMountPoints.find((i) => i.did === PAGES_KIT_DID && i.status === 'running')?.mountPoint ||
|
|
8
|
+
// @ts-ignore
|
|
6
9
|
window?.blocklet?.prefix ||
|
|
7
10
|
'/';
|
|
8
11
|
return axios.post(joinURL(prefix, '/api/components/preload'), input).then((res) => res.data);
|