eddev 2.0.0-beta.113 → 2.0.0-beta.114
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.
|
@@ -2,7 +2,7 @@ import { installFieldTypes } from "../lib/admin/installFieldTypes.js";
|
|
|
2
2
|
import { runWidgets } from "../lib/admin/runWidgets.js";
|
|
3
3
|
import { installEDGutenbergHooks } from "../lib/blocks/editor/installGutenbergHooks.js";
|
|
4
4
|
export default function bootAdmin() {
|
|
5
|
-
console.log("Booting admin");
|
|
5
|
+
console.log("Booting admin", window.name);
|
|
6
6
|
if (window.name === "editor-canvas") {
|
|
7
7
|
console.log("Running in the editor canvas");
|
|
8
8
|
}
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { useRouter } from "../routing/index.js";
|
|
2
2
|
function useAppData(selector) {
|
|
3
|
+
if (env.admin) {
|
|
4
|
+
const appData = window.__ED_APP_DATA.data;
|
|
5
|
+
if (appData) {
|
|
6
|
+
if (selector) {
|
|
7
|
+
return selector(appData);
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
return appData;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
3
14
|
const loader = useRouter((r) => r.loader);
|
|
4
15
|
if (selector) {
|
|
5
16
|
return selector(loader.appData);
|