eddev 0.2.67-beta1 → 0.3.0-beta2
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/admin/components/ImageWell.d.ts +2 -2
- package/admin/components/ImageWell.js +51 -39
- package/admin/defineField.d.ts +2 -2
- package/admin/defineWidget.d.ts +1 -1
- package/admin/defineWidget.js +2 -2
- package/admin/index.js +1 -5
- package/admin/installFieldTypes.js +26 -26
- package/admin/runWidgets.js +28 -17
- package/admin/selectMedia.d.ts +2 -2
- package/admin/selectMedia.js +1 -1
- package/blocks/ContentBlocks.d.ts +6 -6
- package/blocks/ContentBlocks.js +66 -58
- package/blocks/ErrorBoundaryEditor.d.ts +1 -1
- package/blocks/ErrorBoundaryEditor.js +45 -16
- package/blocks/ErrorBoundaryFrontend.d.ts +1 -1
- package/blocks/ErrorBoundaryFrontend.js +45 -16
- package/blocks/InspectorControls.d.ts +1 -1
- package/blocks/InspectorControls.js +3 -3
- package/blocks/blockAttributes.d.ts +2 -2
- package/blocks/blockAttributes.js +44 -24
- package/blocks/index.js +1 -5
- package/blocks/inlineEditing.d.ts +6 -6
- package/blocks/inlineEditing.js +55 -36
- package/blocks/installGutenbergHooks.js +68 -48
- package/build/babel/plugin-name-defined-components.js +16 -15
- package/build/build-favicon.js +62 -11
- package/build/clean.js +52 -5
- package/build/create-codegen-worker.js +33 -78
- package/build/create-serverless-dev-worker.js +39 -61
- package/build/create-webpack-worker.js +33 -65
- package/build/file-tree.d.ts +2 -2
- package/build/file-tree.js +12 -12
- package/build/get-webpack-config.js +395 -341
- package/build/graphql-codegen/graphql-codegen-files.js +25 -31
- package/build/graphql-codegen/graphql-codegen-no-duplicates.js +4 -4
- package/build/graphql-codegen/graphql-codegen-queries.js +99 -102
- package/build/manifests/manifest-blocks.d.ts +1 -1
- package/build/manifests/manifest-blocks.js +29 -37
- package/build/manifests/manifest-fields.d.ts +1 -1
- package/build/manifests/manifest-fields.js +21 -23
- package/build/manifests/manifest-views.d.ts +1 -1
- package/build/manifests/manifest-views.js +25 -32
- package/build/manifests/manifest-widgets.d.ts +1 -1
- package/build/manifests/manifest-widgets.js +20 -22
- package/build/manifests/manifest.d.ts +2 -2
- package/build/manifests/manifest.js +94 -30
- package/build/reporter.d.ts +1 -1
- package/build/reporter.js +32 -29
- package/build/serverless/create-next-app.d.ts +1 -1
- package/build/serverless/create-next-app.js +467 -245
- package/build/state/codegen-state.d.ts +4 -4
- package/build/state/compiler-state.d.ts +5 -5
- package/build/state/serverless-state.d.ts +3 -3
- package/build/workers/codegen-worker-script.js +519 -393
- package/build/workers/serverless-worker-dev-script.js +4 -4
- package/build/workers/webpack-worker-script.js +156 -90
- package/cli/build.dev.d.ts +1 -1
- package/cli/build.dev.js +126 -79
- package/cli/build.prod.d.ts +1 -1
- package/cli/build.prod.js +98 -42
- package/cli/cli.js +28 -19
- package/cli/display/components/BundleDisplay.d.ts +1 -1
- package/cli/display/components/BundleDisplay.js +24 -13
- package/cli/display/components/CodegenDisplay.d.ts +1 -1
- package/cli/display/components/CodegenDisplay.js +25 -14
- package/cli/display/components/DevCLIDisplay.d.ts +2 -2
- package/cli/display/components/DevCLIDisplay.js +25 -14
- package/cli/display/components/Fullscreen.js +20 -9
- package/cli/display/components/ServerlessDisplay.d.ts +2 -2
- package/cli/display/components/ServerlessDisplay.js +26 -15
- package/cli/display/components/StatusIcon.d.ts +2 -2
- package/cli/display/components/StatusIcon.js +3 -3
- package/cli/preinstall.js +5 -4
- package/cli/setup.js +73 -25
- package/components/AdminBar.d.ts +1 -1
- package/components/AdminBar.js +3 -37
- package/components/BrowserRouter.d.ts +2 -2
- package/components/BrowserRouter.js +54 -41
- package/components/InlinePage.d.ts +2 -2
- package/components/InlinePage.js +29 -17
- package/components/NextRouter.d.ts +2 -2
- package/components/NextRouter.js +29 -20
- package/components/index.js +1 -5
- package/config/config-schema.d.ts +1 -1
- package/config/config-schema.js +1 -1
- package/config/create-schema-file.js +6 -6
- package/config/get-config.js +13 -10
- package/config/index.js +1 -5
- package/config/parse-config.js +1 -1
- package/config/print-zod-errors.js +3 -3
- package/dev-ui/components/BreakpointColumnHeader.d.ts +2 -2
- package/dev-ui/components/BreakpointColumnHeader.js +18 -7
- package/dev-ui/components/BreakpointIndicator.d.ts +1 -1
- package/dev-ui/components/BreakpointIndicator.js +32 -25
- package/dev-ui/components/DevUI.d.ts +1 -1
- package/dev-ui/components/DevUI.js +13 -13
- package/dev-ui/components/Launcher.d.ts +2 -2
- package/dev-ui/components/Launcher.js +25 -13
- package/dev-ui/components/PanelWrapper.d.ts +2 -2
- package/dev-ui/components/PanelWrapper.js +8 -8
- package/dev-ui/components/ResponsiveLerpControl.d.ts +2 -2
- package/dev-ui/components/ResponsiveLerpControl.js +38 -27
- package/dev-ui/components/ResponsiveScaleEditor.d.ts +4 -4
- package/dev-ui/components/ResponsiveScaleEditor.js +78 -64
- package/dev-ui/components/atoms/Button.js +1 -1
- package/dev-ui/components/atoms/Dropdown.d.ts +3 -3
- package/dev-ui/components/atoms/Dropdown.js +9 -8
- package/dev-ui/components/atoms/NumberField.d.ts +2 -2
- package/dev-ui/components/atoms/NumberField.js +42 -29
- package/dev-ui/components/atoms/Spacer.js +1 -1
- package/dev-ui/components/atoms/Text.js +1 -1
- package/dev-ui/components/atoms/ToggleButton.d.ts +2 -2
- package/dev-ui/components/atoms/ToggleButton.js +16 -5
- package/dev-ui/components/atoms/Tooltip.d.ts +2 -2
- package/dev-ui/components/atoms/Tooltip.js +20 -8
- package/dev-ui/components/panels/AppDataDebugger.d.ts +1 -1
- package/dev-ui/components/panels/AppDataDebugger.js +19 -8
- package/dev-ui/components/panels/ColorEditor.d.ts +1 -1
- package/dev-ui/components/panels/ColorEditor.js +42 -35
- package/dev-ui/components/panels/PageDataDebugger.d.ts +1 -1
- package/dev-ui/components/panels/PageDataDebugger.js +20 -8
- package/dev-ui/components/panels/QueryDebugger.d.ts +1 -1
- package/dev-ui/components/panels/QueryDebugger.js +24 -12
- package/dev-ui/components/panels/SpacingEditor.d.ts +1 -1
- package/dev-ui/components/panels/SpacingEditor.js +48 -34
- package/dev-ui/components/panels/TypographyEditor.d.ts +1 -1
- package/dev-ui/components/panels/TypographyEditor.js +46 -38
- package/dev-ui/hooks/useBreakpoint.d.ts +1 -1
- package/dev-ui/hooks/useBreakpoint.js +13 -13
- package/dev-ui/hooks/usePersistState.js +7 -6
- package/dev-ui/hooks/useStylesheet.js +6 -6
- package/dev-ui/icons.d.ts +15 -15
- package/dev-ui/icons.js +27 -16
- package/dev-ui/index.js +1 -5
- package/dev-ui/loader.d.ts +1 -1
- package/dev-ui/loader.js +9 -13
- package/dev-ui/panels.d.ts +2 -2
- package/dev-ui/panels.js +7 -7
- package/dev-ui/theme.js +3 -3
- package/dynamic/dynamic-component.js +1 -1
- package/dynamic/index.js +1 -5
- package/entry/Root.d.ts +2 -2
- package/entry/Root.js +26 -16
- package/entry/entry.admin.dev.js +4 -4
- package/entry/entry.admin.prod.js +4 -4
- package/entry/entry.monolith.dev.js +5 -5
- package/entry/entry.monolith.prod.js +5 -5
- package/gravityforms/gravity-forms.d.ts +2 -2
- package/gravityforms/index.js +1 -5
- package/gravityforms/useGravityForm.d.ts +2 -2
- package/gravityforms/useGravityForm.js +130 -126
- package/hooks/index.js +1 -5
- package/hooks/queryUtils.d.ts +14 -14
- package/hooks/queryUtils.js +192 -101
- package/hooks/useAppData.d.ts +2 -2
- package/hooks/useAppData.js +9 -9
- package/hooks/usePageLoad.js +4 -4
- package/hooks/useQueryDebug.d.ts +1 -1
- package/hooks/useQueryDebug.js +7 -7
- package/hooks/useRPC.d.ts +4 -4
- package/hooks/useRPC.js +3 -3
- package/package.json +12 -12
- package/routing/index.js +1 -5
- package/routing/remoteProps.d.ts +1 -1
- package/routing/remoteProps.js +72 -31
- package/routing/routing.d.ts +25 -15
- package/routing/routing.js +200 -112
- package/routing/updateEditLink.js +1 -1
- package/serverless/define-api.d.ts +1 -1
- package/serverless/define-rpc-router.js +4 -8
- package/serverless/index.js +2 -6
- package/style/createStitches.js +142 -164
- package/style/index.js +1 -5
- package/tsconfig.json +1 -1
- package/utils/Observable.d.ts +2 -2
- package/utils/Observable.js +15 -12
- package/utils/getRepoName.js +3 -3
- package/utils/promptIfRepoNameIncorrect.js +64 -18
- package/utils/refreshOverlayInterop.js +1 -1
- package/utils/reportErrorStack.d.ts +1 -1
- package/utils/reportErrorStack.js +1 -1
- package/utils/serverlessAppContext.js +1 -1
- package/utils/updateEnvFile.js +69 -19
- package/utils/useObservable.js +3 -3
- package/views/index.js +1 -5
package/blocks/inlineEditing.js
CHANGED
|
@@ -1,32 +1,55 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
2
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
25
|
exports.InnerBlocks = exports.EditableText = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
26
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
27
|
+
var block_editor_1 = require("@wordpress/block-editor");
|
|
6
28
|
// @ts-ignore
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
function EditableText(
|
|
29
|
+
var blocks_1 = require("@wordpress/blocks");
|
|
30
|
+
var ContentBlocks_1 = require("./ContentBlocks");
|
|
31
|
+
var react_1 = require("react");
|
|
32
|
+
var blockAttributes_1 = require("./blockAttributes");
|
|
33
|
+
var react_2 = require("@stitches/react");
|
|
34
|
+
var remoteProps_1 = require("../routing/remoteProps");
|
|
35
|
+
var routing_1 = require("../routing");
|
|
36
|
+
function EditableText(_a) {
|
|
37
|
+
var id = _a.id, as = _a.as, appendOnEnter = _a.appendOnEnter, props = __rest(_a, ["id", "as", "appendOnEnter"]);
|
|
15
38
|
if (process.admin) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return ((0, jsx_runtime_1.jsx)(block_editor_1.RichText, {
|
|
19
|
-
if (e.key === "Enter" && appendOnEnter &&
|
|
20
|
-
|
|
39
|
+
var _b = (0, blockAttributes_1.useInlineEditableValue)(id), value = _b[0], setValue = _b[1];
|
|
40
|
+
var appendBlocks_1 = (0, blockAttributes_1.useBlockAppender)();
|
|
41
|
+
return ((0, jsx_runtime_1.jsx)(block_editor_1.RichText, __assign({}, props, { tagName: as, value: value || "", onChange: setValue, disableLineBreaks: props.disableLineBreaks, onKeyDownCapture: function (e) {
|
|
42
|
+
if (e.key === "Enter" && appendOnEnter && appendBlocks_1) {
|
|
43
|
+
appendBlocks_1([(0, blocks_1.createBlock)("core/paragraph")]);
|
|
21
44
|
e.preventDefault();
|
|
22
45
|
e.stopPropagation();
|
|
23
46
|
}
|
|
24
|
-
} }));
|
|
47
|
+
} }), void 0));
|
|
25
48
|
}
|
|
26
49
|
else {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
50
|
+
var value = (0, blockAttributes_1.useInlineEditableValue)(id)[0];
|
|
51
|
+
var router_1 = (0, routing_1.useRouter)();
|
|
52
|
+
var otherProps = __assign({}, props);
|
|
30
53
|
delete otherProps.inlineToolbar;
|
|
31
54
|
delete otherProps.disableLineBreaks;
|
|
32
55
|
delete otherProps.id;
|
|
@@ -40,46 +63,42 @@ function EditableText({ id, as, appendOnEnter, ...props }) {
|
|
|
40
63
|
return null;
|
|
41
64
|
}
|
|
42
65
|
}
|
|
43
|
-
return (0, react_1.createElement)(as || "div", {
|
|
44
|
-
dangerouslySetInnerHTML: { __html: value },
|
|
45
|
-
onClick: (e) => {
|
|
66
|
+
return (0, react_1.createElement)(as || "div", __assign({ dangerouslySetInnerHTML: { __html: value }, onClick: function (e) {
|
|
46
67
|
if (e.target && e.target instanceof HTMLAnchorElement) {
|
|
47
|
-
if ((0, remoteProps_1.isSameOrigin)(e.target.href) &&
|
|
68
|
+
if ((0, remoteProps_1.isSameOrigin)(e.target.href) && router_1) {
|
|
48
69
|
e.preventDefault();
|
|
49
|
-
|
|
70
|
+
router_1.onNavigate(e.target.href);
|
|
50
71
|
}
|
|
51
72
|
}
|
|
52
|
-
},
|
|
53
|
-
...otherProps,
|
|
54
|
-
});
|
|
73
|
+
} }, otherProps));
|
|
55
74
|
}
|
|
56
75
|
}
|
|
57
76
|
exports.EditableText = EditableText;
|
|
58
|
-
|
|
77
|
+
var Appender = function (props) {
|
|
59
78
|
if (props.type === "button") {
|
|
60
|
-
return (0, jsx_runtime_1.jsx)(block_editor_1.ButtonBlockAppender, {});
|
|
79
|
+
return (0, jsx_runtime_1.jsx)(block_editor_1.ButtonBlockAppender, {}, void 0);
|
|
61
80
|
}
|
|
62
81
|
else if (typeof props.type === "function") {
|
|
63
82
|
return props.type({});
|
|
64
83
|
}
|
|
65
84
|
else {
|
|
66
|
-
return (0, jsx_runtime_1.jsx)(block_editor_1.DefaultBlockAppender, {});
|
|
85
|
+
return (0, jsx_runtime_1.jsx)(block_editor_1.DefaultBlockAppender, {}, void 0);
|
|
67
86
|
}
|
|
68
87
|
};
|
|
69
88
|
function InnerBlocks(props) {
|
|
70
89
|
if (process.admin) {
|
|
71
|
-
|
|
72
|
-
return ((0, jsx_runtime_1.jsx)(InnerBlocksAdminWrapper, { orientation: props.orientation || "vertical", children: (0, jsx_runtime_1.jsx)(block_editor_1.InnerBlocks, { orientation: props.orientation, allowedBlocks: allowedBlocks,
|
|
90
|
+
var allowedBlocks = props.allowedBlocks;
|
|
91
|
+
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,
|
|
73
92
|
// renderAppender={() => <Appender {...props.appender} />}
|
|
74
|
-
templateLock: props.templateLock, template: props.template }) }));
|
|
93
|
+
templateLock: props.templateLock, template: props.template }, void 0) }), void 0));
|
|
75
94
|
}
|
|
76
95
|
else {
|
|
77
|
-
|
|
78
|
-
return (0, jsx_runtime_1.jsx)(ContentBlocks_1.ContentBlocks, { blocks: blocks, spacer: props.spacer, wrapBlock: props.wrapBlock });
|
|
96
|
+
var blocks = (0, blockAttributes_1.useInnerBlocks)();
|
|
97
|
+
return (0, jsx_runtime_1.jsx)(ContentBlocks_1.ContentBlocks, { blocks: blocks, spacer: props.spacer, wrapBlock: props.wrapBlock }, void 0);
|
|
79
98
|
}
|
|
80
99
|
}
|
|
81
100
|
exports.InnerBlocks = InnerBlocks;
|
|
82
|
-
|
|
101
|
+
var InnerBlocksAdminWrapper = (0, react_2.styled)("div", {
|
|
83
102
|
".wp-block": {
|
|
84
103
|
margin: "0",
|
|
85
104
|
},
|
|
@@ -1,26 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
14
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
15
|
+
if (ar || !(i in from)) {
|
|
16
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
17
|
+
ar[i] = from[i];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
21
|
+
};
|
|
2
22
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
23
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
24
|
};
|
|
5
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
26
|
exports.setBlockManifest = exports.installEDGutenbergHooks = void 0;
|
|
7
|
-
|
|
27
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
28
|
// @ts-ignore
|
|
9
|
-
|
|
29
|
+
var hooks_1 = require("@wordpress/hooks");
|
|
10
30
|
// @ts-ignore
|
|
11
|
-
|
|
12
|
-
|
|
31
|
+
var data_1 = require("@wordpress/data");
|
|
32
|
+
var react_1 = require("react");
|
|
13
33
|
// @ts-ignore
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
34
|
+
var blockAttributes_1 = require("./blockAttributes");
|
|
35
|
+
var ErrorBoundaryEditor_1 = require("./ErrorBoundaryEditor");
|
|
36
|
+
var react_2 = require("@stitches/react");
|
|
17
37
|
// @ts-ignore
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
38
|
+
var blocks_1 = __importDefault(require("@manifest/blocks"));
|
|
39
|
+
var Observable_1 = require("../utils/Observable");
|
|
40
|
+
var useObservable_1 = require("../utils/useObservable");
|
|
41
|
+
var BlockContext = (0, react_1.createContext)(undefined);
|
|
22
42
|
// Store the block manifest as a local variable
|
|
23
|
-
|
|
43
|
+
var blocksManifest = new Observable_1.Observable(blocks_1.default);
|
|
24
44
|
function installEDGutenbergHooks() {
|
|
25
45
|
// Skip this if we're not in the block editor
|
|
26
46
|
// @ts-ignore
|
|
@@ -44,10 +64,10 @@ function installEDGutenbergHooks() {
|
|
|
44
64
|
marginRight: "auto",
|
|
45
65
|
},
|
|
46
66
|
})();
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
67
|
+
var allBlockTypeNames = [];
|
|
68
|
+
var blockTypeNamesSeen = {};
|
|
69
|
+
var blocksByChildTag = {};
|
|
70
|
+
var getParentsForTag = function (tag) {
|
|
51
71
|
if (!blocksByChildTag[tag]) {
|
|
52
72
|
blocksByChildTag[tag] = [];
|
|
53
73
|
}
|
|
@@ -56,34 +76,32 @@ function installEDGutenbergHooks() {
|
|
|
56
76
|
}
|
|
57
77
|
return blocksByChildTag[tag];
|
|
58
78
|
};
|
|
59
|
-
(0, hooks_1.addFilter)("blocks.registerBlockType", "ed", (item, name)
|
|
79
|
+
(0, hooks_1.addFilter)("blocks.registerBlockType", "ed", function (item, name) {
|
|
80
|
+
var _a;
|
|
60
81
|
// Hook into ACF blocks, customising the edit mode.
|
|
61
82
|
if (name.startsWith("acf/")) {
|
|
62
|
-
|
|
63
|
-
item.acf = {
|
|
64
|
-
...(item.acf ?? {}),
|
|
65
|
-
mode: item.mode,
|
|
66
|
-
};
|
|
83
|
+
var edit_1 = item.edit;
|
|
84
|
+
item.acf = __assign(__assign({}, ((_a = item.acf) !== null && _a !== void 0 ? _a : {})), { mode: item.mode });
|
|
67
85
|
// Add an 'inline' object attribute, which will hold all inline contents
|
|
68
86
|
item.attributes.inline = { type: "object" };
|
|
69
87
|
item.supports.customClassName = false;
|
|
70
88
|
item.edit = function (props) {
|
|
71
|
-
|
|
72
|
-
(0, react_1.useEffect)(()
|
|
89
|
+
var self = this;
|
|
90
|
+
(0, react_1.useEffect)(function () {
|
|
73
91
|
// @ts-ignore
|
|
74
92
|
window.wp.data.dispatch("core/block-editor").setTemplateValidity(true);
|
|
75
93
|
}, []);
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
94
|
+
var children = (0, data_1.useSelect)(function (select) {
|
|
95
|
+
var _a = select("core/block-editor"), getBlock = _a.getBlock, getBlockOrder = _a.getBlockOrder;
|
|
96
|
+
var innerBlockIDs = getBlockOrder(props.clientId);
|
|
97
|
+
var children = innerBlockIDs.map(function (id) {
|
|
80
98
|
return getBlock(id);
|
|
81
99
|
});
|
|
82
100
|
return children;
|
|
83
101
|
}, []);
|
|
84
|
-
return ((0, jsx_runtime_1.jsx)(BlockContext.Provider, { value: { name, props }, children: (0, jsx_runtime_1.jsx)(blockAttributes_1.InlineEditingContextProvider, { values: props.attributes.inline || {}, innerBlocks: children, block: [name, props], onChange: (attrs)
|
|
85
|
-
props.setAttributes({
|
|
86
|
-
}, insertBlocksAfter: props.insertBlocksAfter, children:
|
|
102
|
+
return ((0, jsx_runtime_1.jsx)(BlockContext.Provider, __assign({ value: { name: name, props: props } }, { children: (0, jsx_runtime_1.jsx)(blockAttributes_1.InlineEditingContextProvider, __assign({ values: props.attributes.inline || {}, innerBlocks: children, block: [name, props], onChange: function (attrs) {
|
|
103
|
+
props.setAttributes(__assign(__assign({}, props.attributes), { inline: attrs }));
|
|
104
|
+
}, insertBlocksAfter: props.insertBlocksAfter }, { children: edit_1.call(self, props) }), void 0) }), void 0));
|
|
87
105
|
};
|
|
88
106
|
}
|
|
89
107
|
// Remember the block type name
|
|
@@ -98,7 +116,7 @@ function installEDGutenbergHooks() {
|
|
|
98
116
|
// @ts-ignore
|
|
99
117
|
if (window.ED_BLOCK_TAGS) {
|
|
100
118
|
// @ts-ignore
|
|
101
|
-
|
|
119
|
+
var tags = window.ED_BLOCK_TAGS[name];
|
|
102
120
|
if (tags) {
|
|
103
121
|
item.tags = tags;
|
|
104
122
|
}
|
|
@@ -116,7 +134,8 @@ function installEDGutenbergHooks() {
|
|
|
116
134
|
else if (!Array.isArray(item.childTags)) {
|
|
117
135
|
item.childTags = [];
|
|
118
136
|
}
|
|
119
|
-
for (
|
|
137
|
+
for (var _i = 0, _b = item.childTags; _i < _b.length; _i++) {
|
|
138
|
+
var tag = _b[_i];
|
|
120
139
|
if (!blocksByChildTag[tag]) {
|
|
121
140
|
blocksByChildTag[tag] = [];
|
|
122
141
|
}
|
|
@@ -126,9 +145,9 @@ function installEDGutenbergHooks() {
|
|
|
126
145
|
if (!item.parent) {
|
|
127
146
|
if (item.tags.length) {
|
|
128
147
|
Object.defineProperty(item, "parent", {
|
|
129
|
-
get: ()
|
|
130
|
-
|
|
131
|
-
return [
|
|
148
|
+
get: function () {
|
|
149
|
+
var result = item.tags.reduce(function (acc, tag) {
|
|
150
|
+
return __spreadArray(__spreadArray([], acc, true), getParentsForTag(tag), true);
|
|
132
151
|
}, []);
|
|
133
152
|
return result;
|
|
134
153
|
},
|
|
@@ -137,28 +156,29 @@ function installEDGutenbergHooks() {
|
|
|
137
156
|
}
|
|
138
157
|
return item;
|
|
139
158
|
});
|
|
140
|
-
function BlockRenderer(
|
|
141
|
-
|
|
159
|
+
function BlockRenderer(_a) {
|
|
160
|
+
var payload = _a.payload;
|
|
161
|
+
var block = (0, react_1.useContext)(BlockContext);
|
|
142
162
|
if (!block)
|
|
143
163
|
return null;
|
|
144
|
-
|
|
145
|
-
|
|
164
|
+
var manifest = (0, useObservable_1.useObservable)(blocksManifest);
|
|
165
|
+
var BlockComponent = manifest[block.name];
|
|
146
166
|
if (!BlockComponent)
|
|
147
|
-
return (0, jsx_runtime_1.jsx)("div", { children: "Unable to load block component" });
|
|
148
|
-
return ((0, jsx_runtime_1.jsx)(ErrorBoundaryEditor_1.ErrorBoundaryEditor, { children: (0, jsx_runtime_1.jsx)(BlockComponent, {
|
|
167
|
+
return (0, jsx_runtime_1.jsx)("div", { children: "Unable to load block component" }, void 0);
|
|
168
|
+
return ((0, jsx_runtime_1.jsx)(ErrorBoundaryEditor_1.ErrorBoundaryEditor, { children: (0, jsx_runtime_1.jsx)(BlockComponent, __assign({}, payload), void 0) }, void 0));
|
|
149
169
|
}
|
|
150
170
|
// @ts-ignore
|
|
151
|
-
|
|
171
|
+
var parseJSX = acf.parseJSX;
|
|
152
172
|
// @ts-ignore
|
|
153
|
-
acf.parseJSX = (html)
|
|
154
|
-
|
|
173
|
+
acf.parseJSX = function (html) {
|
|
174
|
+
var payload;
|
|
155
175
|
try {
|
|
156
176
|
payload = JSON.parse(html.replace(/(^[^>]+>|<[^>]+>$)/g, ""));
|
|
157
177
|
}
|
|
158
178
|
catch (err) {
|
|
159
179
|
throw new Error("eddev: Error parsing block data from: \n" + html);
|
|
160
180
|
}
|
|
161
|
-
return (0, jsx_runtime_1.jsx)(BlockRenderer, { payload: payload });
|
|
181
|
+
return (0, jsx_runtime_1.jsx)(BlockRenderer, { payload: payload }, void 0);
|
|
162
182
|
};
|
|
163
183
|
}
|
|
164
184
|
exports.installEDGutenbergHooks = installEDGutenbergHooks;
|
|
@@ -169,8 +189,8 @@ exports.setBlockManifest = setBlockManifest;
|
|
|
169
189
|
// @ts-ignore
|
|
170
190
|
if (import.meta.webpackHot) {
|
|
171
191
|
// @ts-ignore
|
|
172
|
-
import.meta.webpackHot.accept([require.resolve("@manifest/blocks")], ()
|
|
173
|
-
|
|
192
|
+
import.meta.webpackHot.accept([require.resolve("@manifest/blocks")], function () {
|
|
193
|
+
var updatedManifest = require("@manifest/blocks").default;
|
|
174
194
|
setBlockManifest(updatedManifest);
|
|
175
195
|
});
|
|
176
196
|
}
|
|
@@ -1,40 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
function default_1(
|
|
3
|
+
var pascal_case_1 = require("pascal-case");
|
|
4
|
+
function default_1(_a) {
|
|
5
|
+
var t = _a.types;
|
|
5
6
|
return {
|
|
6
7
|
visitor: {
|
|
7
|
-
CallExpression(path, state) {
|
|
8
|
+
CallExpression: function (path, state) {
|
|
8
9
|
// Does the call expression name match defineBlock or defineView?
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
var callee = path.node.callee;
|
|
11
|
+
var args = path.node.arguments;
|
|
11
12
|
if (callee.type === "Identifier" && (callee.name === "defineBlock" || callee.name === "defineView")) {
|
|
12
13
|
// First argument a string literal?
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
var type = callee.name === "defineBlock" ? "block" : "view";
|
|
15
|
+
var name_1 = "";
|
|
15
16
|
if (args.length > 0 && args[0].type === "StringLiteral") {
|
|
16
|
-
|
|
17
|
+
name_1 = args[0].value;
|
|
17
18
|
// While we're here, make sure that the name matches the filename
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
var filename = state.file.opts.filename;
|
|
20
|
+
var expectedName = filename
|
|
20
21
|
.replace(state.opts.baseDirectory, "")
|
|
21
22
|
.replace(/\.tsx?$/, "")
|
|
22
23
|
.replace(/^\/?(blocks|views)\//, "");
|
|
23
|
-
if (
|
|
24
|
-
throw path.buildCodeFrameError(
|
|
24
|
+
if (name_1 !== expectedName) {
|
|
25
|
+
throw path.buildCodeFrameError("The name in your ".concat(callee.name, " didn't match the filename!\n\nDid you mean ").concat(callee.name, "(\"").concat(expectedName, "\")?"));
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
// Second argument an arrow function?
|
|
28
29
|
if (args.length === 2) {
|
|
29
30
|
if (args[1].type === "ArrowFunctionExpression") {
|
|
30
31
|
// Great! Replace the arrow function with a normal function
|
|
31
|
-
|
|
32
|
+
var body = args[1].body;
|
|
32
33
|
if (t.isExpression(body)) {
|
|
33
34
|
body = t.blockStatement([t.returnStatement(body)]);
|
|
34
35
|
}
|
|
35
36
|
path.replaceWith(t.callExpression(t.identifier(callee.name), [
|
|
36
|
-
t.stringLiteral(
|
|
37
|
-
t.functionExpression(t.identifier((0, pascal_case_1.pascalCase)(type + "-" +
|
|
37
|
+
t.stringLiteral(name_1),
|
|
38
|
+
t.functionExpression(t.identifier((0, pascal_case_1.pascalCase)(type + "-" + name_1)), args[1].params, body, args[1].generator, args[1].async),
|
|
38
39
|
]));
|
|
39
40
|
}
|
|
40
41
|
}
|
package/build/build-favicon.js
CHANGED
|
@@ -1,20 +1,71 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
2
38
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
40
|
};
|
|
5
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
42
|
exports.buildFavicon = void 0;
|
|
7
43
|
// @ts-ignore
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
44
|
+
var to_icon_1 = __importDefault(require("to-icon"));
|
|
45
|
+
var promises_1 = require("fs/promises");
|
|
46
|
+
var glob_promise_1 = __importDefault(require("glob-promise"));
|
|
47
|
+
var path_1 = require("path");
|
|
48
|
+
function buildFavicon(output) {
|
|
49
|
+
if (output === void 0) { output = (0, path_1.join)(process.cwd(), "favicon.ico"); }
|
|
50
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
51
|
+
var files, buffers, buf;
|
|
52
|
+
return __generator(this, function (_a) {
|
|
53
|
+
switch (_a.label) {
|
|
54
|
+
case 0: return [4 /*yield*/, (0, glob_promise_1.default)((0, path_1.join)(process.cwd(), "assets/favicon/favicon-*.png"))];
|
|
55
|
+
case 1:
|
|
56
|
+
files = _a.sent();
|
|
57
|
+
if (!files.length)
|
|
58
|
+
return [2 /*return*/];
|
|
59
|
+
return [4 /*yield*/, Promise.all(files.map(function (file) { return (0, promises_1.readFile)(file); }))];
|
|
60
|
+
case 2:
|
|
61
|
+
buffers = _a.sent();
|
|
62
|
+
return [4 /*yield*/, (0, to_icon_1.default)(buffers)];
|
|
63
|
+
case 3:
|
|
64
|
+
buf = _a.sent();
|
|
65
|
+
(0, promises_1.writeFile)(output, buf);
|
|
66
|
+
return [2 /*return*/];
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
});
|
|
19
70
|
}
|
|
20
71
|
exports.buildFavicon = buildFavicon;
|
package/build/clean.js
CHANGED
|
@@ -1,13 +1,60 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
2
38
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
40
|
};
|
|
5
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
42
|
exports.cleanOutput = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
43
|
+
var rimraf_1 = __importDefault(require("rimraf"));
|
|
44
|
+
var path_1 = require("path");
|
|
45
|
+
function cleanOutput() {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
47
|
+
return __generator(this, function (_a) {
|
|
48
|
+
switch (_a.label) {
|
|
49
|
+
case 0: return [4 /*yield*/, new Promise(function (resolve) { return (0, rimraf_1.default)((0, path_1.join)(process.cwd(), "dist/frontend"), resolve); })];
|
|
50
|
+
case 1:
|
|
51
|
+
_a.sent();
|
|
52
|
+
return [4 /*yield*/, new Promise(function (resolve) { return (0, rimraf_1.default)((0, path_1.join)(process.cwd(), "dist/admin"), resolve); })];
|
|
53
|
+
case 2:
|
|
54
|
+
_a.sent();
|
|
55
|
+
return [2 /*return*/];
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
});
|
|
12
59
|
}
|
|
13
60
|
exports.cleanOutput = cleanOutput;
|