eddev 0.2.1 → 0.2.2-beta.1

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.
@@ -27,6 +27,8 @@ exports.setBlockManifest = exports.installEDGutenbergHooks = void 0;
27
27
  var jsx_runtime_1 = require("react/jsx-runtime");
28
28
  // @ts-ignore
29
29
  var hooks_1 = require("@wordpress/hooks");
30
+ // @ts-ignore
31
+ var data_1 = require("@wordpress/data");
30
32
  var react_1 = require("react");
31
33
  // @ts-ignore
32
34
  var blockAttributes_1 = require("./blockAttributes");
@@ -82,7 +84,17 @@ function installEDGutenbergHooks() {
82
84
  // @ts-ignore
83
85
  window.wp.data.dispatch("core/block-editor").setTemplateValidity(true);
84
86
  }, []);
85
- 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: props.innerBlocks, onChange: function (attrs) {
87
+ console.log("PROPS", props);
88
+ // console.log(useBlockProps(), useBlockEditContext(), useInnerBlocksProps())
89
+ var children = (0, data_1.useSelect)(function (select) {
90
+ var _a = select('core/block-editor'), getBlock = _a.getBlock, getBlockOrder = _a.getBlockOrder;
91
+ var innerBlockIDs = getBlockOrder(props.clientId);
92
+ var children = innerBlockIDs.map(function (id) {
93
+ return getBlock(id);
94
+ });
95
+ return children;
96
+ }, []);
97
+ 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, onChange: function (attrs) {
86
98
  props.setAttributes(__assign(__assign({}, props.attributes), { inline: attrs }));
87
99
  } }, { children: edit_1.call(self, props) }), void 0) }), void 0));
88
100
  };
@@ -154,6 +166,7 @@ function installEDGutenbergHooks() {
154
166
  var parseJSX = acf.parseJSX;
155
167
  // @ts-ignore
156
168
  acf.parseJSX = function (html) {
169
+ console.log('HTML', html);
157
170
  var payload = JSON.parse(html.replace(/(^[^>]+>|<[^>]+>$)/g, ""));
158
171
  return (0, jsx_runtime_1.jsx)(BlockRenderer, { payload: payload }, void 0);
159
172
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eddev",
3
- "version": "0.2.1",
3
+ "version": "0.2.2-beta.1",
4
4
  "main": "./index.js",
5
5
  "license": "MIT",
6
6
  "bin": {