eddev 0.3.11 → 0.3.13
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.
|
@@ -15,6 +15,7 @@ declare type BlocksContext = {
|
|
|
15
15
|
prev?: ContentBlock;
|
|
16
16
|
next?: ContentBlock;
|
|
17
17
|
current: ContentBlock;
|
|
18
|
+
index: number;
|
|
18
19
|
};
|
|
19
20
|
export declare const BlocksContext: import("react").Context<BlocksContext | undefined>;
|
|
20
21
|
export declare type ContentBlocksSettings = {
|
package/blocks/ContentBlocks.js
CHANGED
|
@@ -73,7 +73,7 @@ function ContentBlocks(props) {
|
|
|
73
73
|
var blocks = (0, react_1.useMemo)(function () {
|
|
74
74
|
return props.blocks.map(function (block, index) {
|
|
75
75
|
// Create a context object for the current block
|
|
76
|
-
var ctx = __assign(__assign({}, parentContext), { ancestors: __spreadArray(__spreadArray([], ((parentContext === null || parentContext === void 0 ? void 0 : parentContext.ancestors) || []), true), [parentContext === null || parentContext === void 0 ? void 0 : parentContext.current], false).filter(Boolean), parent: parentContext === null || parentContext === void 0 ? void 0 : parentContext.current, current: block, prev: props.blocks[index - 1], next: props.blocks[index + 1] });
|
|
76
|
+
var ctx = __assign(__assign({}, parentContext), { ancestors: __spreadArray(__spreadArray([], ((parentContext === null || parentContext === void 0 ? void 0 : parentContext.ancestors) || []), true), [parentContext === null || parentContext === void 0 ? void 0 : parentContext.current], false).filter(Boolean), parent: parentContext === null || parentContext === void 0 ? void 0 : parentContext.current, current: block, prev: props.blocks[index - 1], next: props.blocks[index + 1], index: index });
|
|
77
77
|
// Figure out the
|
|
78
78
|
var blockNode;
|
|
79
79
|
if (block.blockName in blockTypes) {
|
|
@@ -41,16 +41,31 @@ var useObservable_1 = require("../utils/useObservable");
|
|
|
41
41
|
var BlockContext = (0, react_1.createContext)(undefined);
|
|
42
42
|
// Store the block manifest as a local variable
|
|
43
43
|
var blocksManifest = new Observable_1.Observable(blocks_1.default);
|
|
44
|
+
function listenForHandleResize() {
|
|
45
|
+
var interval = setInterval(function () {
|
|
46
|
+
var viewportTarget = document.querySelector(".interface-interface-skeleton__content");
|
|
47
|
+
if (viewportTarget) {
|
|
48
|
+
var updateSize = function () {
|
|
49
|
+
document.documentElement.style.setProperty("--vw100", viewportTarget.clientWidth + "px");
|
|
50
|
+
};
|
|
51
|
+
var ro = new ResizeObserver(updateSize);
|
|
52
|
+
ro.observe(viewportTarget);
|
|
53
|
+
clearInterval(interval);
|
|
54
|
+
console.log("Got it");
|
|
55
|
+
}
|
|
56
|
+
}, 100);
|
|
57
|
+
}
|
|
44
58
|
function installEDGutenbergHooks() {
|
|
45
59
|
// Skip this if we're not in the block editor
|
|
46
60
|
// @ts-ignore
|
|
47
61
|
if (!window.wp.blockEditor)
|
|
48
62
|
return;
|
|
63
|
+
listenForHandleResize();
|
|
49
64
|
(0, react_2.globalCss)({
|
|
50
65
|
".edit-post-visual-editor__post-title-wrapper": {
|
|
51
66
|
width: "var(--grid-inner-width)",
|
|
52
|
-
marginLeft: "
|
|
53
|
-
marginRight: "
|
|
67
|
+
marginLeft: "20px",
|
|
68
|
+
marginRight: "20px",
|
|
54
69
|
},
|
|
55
70
|
".block-editor-block-list__block:hover": {
|
|
56
71
|
outline: "1px solid #e1e1e1",
|