gomtm 0.0.388 → 0.0.389

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.
@@ -68,10 +68,19 @@ const BlockItem = (props) => {
68
68
  if (!children) {
69
69
  return /* @__PURE__ */ jsx("div", { children: "no children" });
70
70
  }
71
- return /* @__PURE__ */ jsx(BlockItemProvider, { children: /* @__PURE__ */ jsxs("div", { children: [
72
- /* @__PURE__ */ jsx("h1", { children: "BlockItem" }),
73
- /* @__PURE__ */ jsx(ChildrenDebugInner, { children })
74
- ] }) });
71
+ return /* @__PURE__ */ jsxs(BlockItemProvider, { children: [
72
+ /* @__PURE__ */ jsx(BlockItemSetup, {}),
73
+ /* @__PURE__ */ jsx(BlockItemDesignToolbar, {}),
74
+ /* @__PURE__ */ jsxs("div", { children: [
75
+ /* @__PURE__ */ jsx("h1", { children: "BlockItem" }),
76
+ /* @__PURE__ */ jsx(ChildrenDebugInner, { children })
77
+ ] })
78
+ ] });
79
+ };
80
+ const BlockItemSetup = () => {
81
+ const setDesignMode = useDemoChildrenBlock((x) => x.setDesignMode);
82
+ const designMode = useDemoChildrenBlock((x) => x.designMode);
83
+ return null;
75
84
  };
76
85
  const ChildrenDebugInner = (props) => {
77
86
  const { children } = props;
@@ -116,7 +125,13 @@ function ChildrenEditMode(props) {
116
125
  return originPropsList[i];
117
126
  }, [i, originPropsList]);
118
127
  const Editor = (_a = child.type) == null ? void 0 : _a.Editor;
119
- const overProps = useMemo(() => originPropsList && originPropsList[i].props, [i, originPropsList]);
128
+ console.log("child.type555555555", child.type);
129
+ const overProps = useMemo(() => {
130
+ var _a2;
131
+ if (originPropsList) {
132
+ return (_a2 = originPropsList[i]) == null ? void 0 : _a2.props;
133
+ }
134
+ }, [i, originPropsList]);
120
135
  return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
121
136
  /* @__PURE__ */ jsxs(
122
137
  MtButton,
@@ -151,7 +166,7 @@ const BlockItemDesignToolbar = () => {
151
166
  if (!designMode) {
152
167
  return null;
153
168
  }
154
- return /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-1 bg-slate-600 p-2", children: [
169
+ return /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-1 bg-blue-300 p-1", children: [
155
170
  /* @__PURE__ */ jsx(MtButton, { onClick: () => {
156
171
  setDesignMode(!designMode);
157
172
  }, children: "edit" }),
@@ -110,7 +110,12 @@ const ChildrenDebugInner = (props) => {
110
110
  function ChildrenOrigin(props) {
111
111
  const { child, i } = props;
112
112
  const originPropsList = useDemoChildrenBlock((x) => x.originPropsList);
113
- const overProps = useMemo(() => originPropsList && originPropsList[i].props, [i, originPropsList]);
113
+ const overProps = useMemo(() => {
114
+ var _a;
115
+ if (originPropsList) {
116
+ return (_a = originPropsList[i]) == null ? void 0 : _a.props;
117
+ }
118
+ }, [i, originPropsList]);
114
119
  return /* @__PURE__ */ jsx(Fragment, { children: createElement(child.type, __spreadValues(__spreadValues({}, child.props), overProps)) });
115
120
  }
116
121
  function ChildrenEditMode(props) {
@@ -123,7 +128,12 @@ function ChildrenEditMode(props) {
123
128
  return originPropsList[i];
124
129
  }, [i, originPropsList]);
125
130
  const Editor = (_a = child.type) == null ? void 0 : _a.Editor;
126
- const overProps = useMemo(() => originPropsList && originPropsList[i].props, [i, originPropsList]);
131
+ const overProps = useMemo(() => {
132
+ var _a2;
133
+ if (originPropsList) {
134
+ return (_a2 = originPropsList[i]) == null ? void 0 : _a2.props;
135
+ }
136
+ }, [i, originPropsList]);
127
137
  return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
128
138
  /* @__PURE__ */ jsxs(
129
139
  MtButton,