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