eddev 2.0.0-beta.112 → 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);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "2.0.0-beta.
|
|
1
|
+
export declare const VERSION = "2.0.0-beta.113";
|
package/dist/node/cli/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "2.0.0-beta.
|
|
1
|
+
export const VERSION = "2.0.0-beta.113";
|
|
@@ -164,6 +164,7 @@ export function getViteConfig(args) {
|
|
|
164
164
|
logger.clearScreen = () => {
|
|
165
165
|
args.console.resetLog();
|
|
166
166
|
};
|
|
167
|
+
const entryFile = `./.eddev/${args.mode === "production" ? "prod" : "dev"}-spa/entry.${args.target === "cms" ? "admin" : "client"}.tsx`;
|
|
167
168
|
/** Initial config */
|
|
168
169
|
const config = {
|
|
169
170
|
appType: "custom",
|
|
@@ -182,15 +183,16 @@ export function getViteConfig(args) {
|
|
|
182
183
|
minify: args.mode === "production",
|
|
183
184
|
modulePreload: false,
|
|
184
185
|
outDir: args.outDir,
|
|
185
|
-
lib:
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
186
|
+
lib: args.target === "cms"
|
|
187
|
+
? {
|
|
188
|
+
entry: [entryFile],
|
|
189
|
+
fileName: (format, entryName) => `${entryName}.${format}.js`,
|
|
190
|
+
name: "eddev",
|
|
191
|
+
formats: args.target === "cms" ? ["iife"] : ["es"],
|
|
192
|
+
}
|
|
193
|
+
: undefined,
|
|
193
194
|
rollupOptions: {
|
|
195
|
+
input: args.target === "frontend" ? entryFile : "./.eddev/prod-spa/entry.admin.tsx",
|
|
194
196
|
external: args.target === "cms" ? ["react", "react-dom"] : [],
|
|
195
197
|
onwarn(warning, warn) {
|
|
196
198
|
if (!cliMode.verbose &&
|