eddev 2.0.0-beta.86 → 2.0.0-beta.88
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/dist/app/lib/blocks/editor/editor-config.js +15 -1
- package/dist/app/lib/routing/components/Link.js +3 -3
- package/dist/app/lib/routing/utils.d.ts +1 -0
- package/dist/app/lib/routing/utils.js +6 -0
- package/dist/node/cli/version.d.ts +1 -1
- package/dist/node/cli/version.js +1 -1
- package/dist/node/compiler/vinxi-app.js +1 -0
- package/package.json +1 -1
|
@@ -27,9 +27,23 @@ export function configureEditorBlocks(config) {
|
|
|
27
27
|
}
|
|
28
28
|
const currentBlocks = wp.data.select("core/block-editor").getBlocks();
|
|
29
29
|
const templateBlocks = currentBlocks.filter((block) => block.attributes.isFromTemplate);
|
|
30
|
-
let blocks = currentBlocks.filter((block) => !block.attributes.isFromTemplate);
|
|
31
30
|
let header = config.headerTemplate ? syncBlocks(transformTemplateToBlocks(config.headerTemplate)) : [];
|
|
32
31
|
let footer = config.footerTemplate ? syncBlocks(transformTemplateToBlocks(config.footerTemplate)) : [];
|
|
32
|
+
let blocks = currentBlocks.filter((block) => !header.includes(block) && !footer.includes(block));
|
|
33
|
+
blocks.forEach((block) => {
|
|
34
|
+
delete block.attributes.lock;
|
|
35
|
+
delete block.isFromTemplate;
|
|
36
|
+
});
|
|
37
|
+
// const blocksToDelete = currentBlocks.filter((block: any) => {
|
|
38
|
+
// return !header.includes(block) && !footer.includes(block) && !blocks.includes(block)
|
|
39
|
+
// })
|
|
40
|
+
// blocksToDelete.forEach((block: any) => {
|
|
41
|
+
// delete block.attributes.lock
|
|
42
|
+
// delete block.isFromTemplate
|
|
43
|
+
// })
|
|
44
|
+
// blocks = [...blocks, ...blocksToDelete]
|
|
45
|
+
// console.log("blocks", blocks)
|
|
46
|
+
// console.log("blocksToDelete", blocksToDelete)
|
|
33
47
|
if (!blocks.length && config.defaultBlocks) {
|
|
34
48
|
blocks = transformTemplateToBlocks(config.defaultBlocks, false, false);
|
|
35
49
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useMemo } from "react";
|
|
3
|
-
import { parseURL, resolveURL, withoutTrailingSlash
|
|
3
|
+
import { parseURL, resolveURL, withoutTrailingSlash } from "ufo";
|
|
4
4
|
import { useIsSSR } from "../hooks/useIsSSR.js";
|
|
5
5
|
import { useRouter } from "../hooks/useRouter.js";
|
|
6
|
-
import { isSameOrigin } from "../utils.js";
|
|
6
|
+
import { addTrailingSlash, isSameOrigin } from "../utils.js";
|
|
7
7
|
import { useRoute } from "../hooks/useRoute.js";
|
|
8
8
|
import { useRouterState } from "../hooks/useRouterState.js";
|
|
9
9
|
export const Link = forwardRef(({ preferBack, as, ...props }, ref) => {
|
|
@@ -17,7 +17,7 @@ export const Link = forwardRef(({ preferBack, as, ...props }, ref) => {
|
|
|
17
17
|
else {
|
|
18
18
|
const router = useRouter();
|
|
19
19
|
const state = useLinkState(props.href ?? "");
|
|
20
|
-
return (_jsx(Comp, { ref: ref, "data-active": state.active ?? undefined, "data-child-active": state.childActive ?? undefined, "data-pending": state.pending ?? undefined, ...props, href:
|
|
20
|
+
return (_jsx(Comp, { ref: ref, "data-active": state.active ?? undefined, "data-child-active": state.childActive ?? undefined, "data-pending": state.pending ?? undefined, ...props, href: addTrailingSlash(props.href), onMouseEnter: (e) => {
|
|
21
21
|
if (props.onMouseEnter) {
|
|
22
22
|
props.onMouseEnter(e);
|
|
23
23
|
}
|
|
@@ -14,4 +14,5 @@ export declare function stringifyRouteLink(route: RouteLink): string;
|
|
|
14
14
|
export declare function parseQuery(query: string): Record<string, string | string[]>;
|
|
15
15
|
export declare function stringifyQuery(query: any): string;
|
|
16
16
|
export declare function getRouteMeta(data: RouteData): RouteMeta;
|
|
17
|
+
export declare function addTrailingSlash(path?: string | null): string;
|
|
17
18
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "2.0.0-beta.
|
|
1
|
+
export declare const VERSION = "2.0.0-beta.88";
|
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.88";
|