eddev 0.2.2-beta.4 → 0.2.2-beta.5
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.
|
@@ -14,13 +14,16 @@ declare type PropTypes<T extends ElementType> = {
|
|
|
14
14
|
/** Append a new block when the user hits 'Enter' */
|
|
15
15
|
appendOnEnter?: boolean;
|
|
16
16
|
} & React.ComponentPropsWithoutRef<T>;
|
|
17
|
-
export declare function EditableText<T extends ElementType>({ id, as, ...props }: PropTypes<T>): JSX.Element | null;
|
|
17
|
+
export declare function EditableText<T extends ElementType>({ id, as, appendOnEnter, ...props }: PropTypes<T>): JSX.Element | null;
|
|
18
|
+
declare type AppenderConfig = {
|
|
19
|
+
button?: boolean;
|
|
20
|
+
};
|
|
18
21
|
declare type InnerBlocksProps = {
|
|
19
22
|
allowedBlocks?: string[];
|
|
20
23
|
orientation?: "horizontal" | "vertical";
|
|
21
24
|
templateLock?: any;
|
|
22
25
|
template?: any;
|
|
23
|
-
|
|
26
|
+
appender?: AppenderConfig;
|
|
24
27
|
} & ContentBlocksSettings;
|
|
25
28
|
export declare function InnerBlocks(props: InnerBlocksProps): JSX.Element;
|
|
26
29
|
export {};
|
package/blocks/inlineEditing.js
CHANGED
|
@@ -35,12 +35,12 @@ var react_2 = require("@stitches/react");
|
|
|
35
35
|
var remoteProps_1 = require("../routing/remoteProps");
|
|
36
36
|
var __1 = require("..");
|
|
37
37
|
function EditableText(_a) {
|
|
38
|
-
var id = _a.id, as = _a.as, props = __rest(_a, ["id", "as"]);
|
|
38
|
+
var id = _a.id, as = _a.as, appendOnEnter = _a.appendOnEnter, props = __rest(_a, ["id", "as", "appendOnEnter"]);
|
|
39
39
|
if (process.admin) {
|
|
40
40
|
var _b = (0, blockAttributes_1.useInlineEditableValue)(id), value = _b[0], setValue = _b[1];
|
|
41
41
|
var appendBlocks_1 = (0, blockAttributes_1.useBlockAppender)();
|
|
42
42
|
return ((0, jsx_runtime_1.jsx)(block_editor_1.RichText, __assign({}, props, { tagName: as, value: value || "", onChange: setValue, disableLineBreaks: props.disableLineBreaks, onKeyDownCapture: function (e) {
|
|
43
|
-
if (e.key === "Enter" &&
|
|
43
|
+
if (e.key === "Enter" && appendOnEnter && appendBlocks_1) {
|
|
44
44
|
appendBlocks_1([(0, blocks_1.createBlock)("core/paragraph")]);
|
|
45
45
|
e.preventDefault();
|
|
46
46
|
e.stopPropagation();
|
|
@@ -78,7 +78,9 @@ exports.EditableText = EditableText;
|
|
|
78
78
|
function InnerBlocks(props) {
|
|
79
79
|
if (process.admin) {
|
|
80
80
|
var allowedBlocks = props.allowedBlocks;
|
|
81
|
-
return ((0, jsx_runtime_1.jsx)(InnerBlocksAdminWrapper, __assign({ orientation: props.orientation || "vertical" }, { children: (0, jsx_runtime_1.jsx)(block_editor_1.InnerBlocks, { orientation: props.orientation, allowedBlocks: allowedBlocks,
|
|
81
|
+
return ((0, jsx_runtime_1.jsx)(InnerBlocksAdminWrapper, __assign({ orientation: props.orientation || "vertical" }, { children: (0, jsx_runtime_1.jsx)(block_editor_1.InnerBlocks, { orientation: props.orientation, allowedBlocks: allowedBlocks,
|
|
82
|
+
// renderAppender={ButtonBlockAppender}
|
|
83
|
+
templateLock: props.templateLock, template: props.template }, void 0) }), void 0));
|
|
82
84
|
}
|
|
83
85
|
else {
|
|
84
86
|
var blocks = (0, blockAttributes_1.useInnerBlocks)();
|
|
@@ -181,7 +181,9 @@ function beginWork(opts) {
|
|
|
181
181
|
if (!endpoint) {
|
|
182
182
|
sendSignal({
|
|
183
183
|
code: "error",
|
|
184
|
-
errors: [
|
|
184
|
+
errors: [
|
|
185
|
+
"Could not find DEBUG_GRAPHQL_URL value in .env. This will be automatically populated once you visit WP Admin first the first time!",
|
|
186
|
+
],
|
|
185
187
|
});
|
|
186
188
|
regenerating = false;
|
|
187
189
|
return [2 /*return*/];
|
package/hooks/useAppData.js
CHANGED
|
@@ -22,6 +22,10 @@ function useAppData(selector) {
|
|
|
22
22
|
return selector(value);
|
|
23
23
|
return value;
|
|
24
24
|
}
|
|
25
|
+
else if (process.admin) {
|
|
26
|
+
// @ts-ignore
|
|
27
|
+
return selector ? selector(__ED_APP_DATA.data) : __ED_APP_DATA.data;
|
|
28
|
+
}
|
|
25
29
|
else {
|
|
26
30
|
return useAppDataStore(function (store) {
|
|
27
31
|
if (selector)
|
package/package.json
CHANGED
|
@@ -26,7 +26,9 @@ function Root({ Component, pageProps }: AppProps) {
|
|
|
26
26
|
|
|
27
27
|
if (!appData) return <div />
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
if (!View) {
|
|
30
|
+
console.log(`Could not load view named "${pageProps.view}"`)
|
|
31
|
+
}
|
|
30
32
|
|
|
31
33
|
return (
|
|
32
34
|
<ServerlessAppDataProvider value={appData}>
|