@white-give/editor-react 1.0.2 → 1.0.3

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/dist/es/index.js CHANGED
@@ -1150,7 +1150,7 @@ const j5 = (t, e) => {
1150
1150
  echarts: {
1151
1151
  // 自定义图表配置
1152
1152
  onSetOptions(t, e) {
1153
- return console.log("onSetOptions", t, e), null;
1153
+ return null;
1154
1154
  }
1155
1155
  },
1156
1156
  page: {
@@ -1166,7 +1166,7 @@ const j5 = (t, e) => {
1166
1166
  async onFileUpload(t) {
1167
1167
  if (!t)
1168
1168
  throw new Error("没有找到要上传的文件");
1169
- return console.log("onUpload", t), await new Promise((e) => setTimeout(e, 3e3)), {
1169
+ return console.log("onFileUpload", t), await new Promise((e) => setTimeout(e, 3e3)), {
1170
1170
  id: Pv(),
1171
1171
  url: t.url ?? URL.createObjectURL(t),
1172
1172
  name: t.name,
@@ -101388,7 +101388,7 @@ function moe(t, e, r) {
101388
101388
  e.titleText && e.titleText !== "" && (n.title = {}, n.title.text = e.titleText, n.title.left = e.titleleft ?? "left");
101389
101389
  let a = [];
101390
101390
  function o() {
101391
- n.legend = {}, n.legend.show = !!e.legend, n.legend[e.legendlocation] = 10, n.legend.left = e.legendleft, n.legend.orient = e.legendorient, n.legend.data = [], a = t.legends, console.log(t, "colNameList"), n.legend.data = t.legends;
101391
+ n.legend = {}, n.legend.show = !!e.legend, n.legend[e.legendlocation] = 10, n.legend.left = e.legendleft, n.legend.orient = e.legendorient, n.legend.data = [], a = t.legends, n.legend.data = t.legends;
101392
101392
  }
101393
101393
  o();
101394
101394
  function s() {
@@ -103654,7 +103654,7 @@ const xVe = (t) => {
103654
103654
  return /* @__PURE__ */ Y(Tu, { as: "span", className: "inline-block mx-[0.3rem] !bg-transparent", children: /* @__PURE__ */ Y(
103655
103655
  "span",
103656
103656
  {
103657
- className: "rounded-[0.2em] px-[0.4em] py-[0.15em] inline-block mx-[0.2em] text-sm font-[500] border-[#0000000d] box-border",
103657
+ className: "rounded-[0.2em] px-[0.4em] py-[0.15em] inline-block mx-[0.2em] text-sm font-[500] border-[#0000000d] box-border select-none",
103658
103658
  style: i,
103659
103659
  children: e.attrs.text
103660
103660
  }
@@ -113242,11 +113242,11 @@ const BGe = ({
113242
113242
  v.key.toUpperCase() === ase.ENTER && d();
113243
113243
  };
113244
113244
  return document.addEventListener("keydown", p), () => {
113245
- document.removeEventListener("keydown", p), t.onUpdateData && (console.log("updateData", c()), t.onUpdateData(c()));
113245
+ document.removeEventListener("keydown", p);
113246
113246
  };
113247
113247
  }, []);
113248
113248
  const h = (p, v, g) => {
113249
- p.preventDefault(), console.log("handlePaste", p.clipboardData, v, g);
113249
+ p.preventDefault();
113250
113250
  };
113251
113251
  return /* @__PURE__ */ Y("div", { className: "white-editor-table-content", ref: s, children: /* @__PURE__ */ Y("table", { children: /* @__PURE__ */ Y("tbody", { children: Array.from({ length: Vj }).map((p, v) => /* @__PURE__ */ Y("tr", { children: Array.from({ length: Hj }).map((g, m) => /* @__PURE__ */ Y(
113252
113252
  "td",
@@ -113260,7 +113260,7 @@ const BGe = ({
113260
113260
  autoComplete: "off",
113261
113261
  onFocus: () => a([v, m]),
113262
113262
  onBlur: () => f(v, m),
113263
- onPaste: (y) => h(y, v, m)
113263
+ onPaste: (y) => h(y)
113264
113264
  }
113265
113265
  )
113266
113266
  },
@@ -113295,7 +113295,6 @@ function qI({
113295
113295
  console.log("图表数据为空");
113296
113296
  return;
113297
113297
  }
113298
- console.log("baseConfig.data", F);
113299
113298
  const V = moe(
113300
113299
  JSON.parse(JSON.stringify(F.data)),
113301
113300
  JSON.parse(JSON.stringify(F.config)),
@@ -113309,7 +113308,7 @@ function qI({
113309
113308
  }, 0);
113310
113309
  }, x = () => {
113311
113310
  const L = { ...v };
113312
- return L.config.seriesType = "bar", L.config.legend = !0, L.config.legendorient = "horizontal", L.config.legendlocation = "top", L.config.legendleft = "center", L.config.titleText = "", L.config.titleleft = "left", L.data = bj[L.config.seriesType], g(L), console.log("newConfig", L), L;
113311
+ return L.config.seriesType = "bar", L.config.legend = !0, L.config.legendorient = "horizontal", L.config.legendlocation = "top", L.config.legendleft = "center", L.config.titleText = "", L.config.titleleft = "left", L.data = bj[L.config.seriesType], g(L), L;
113313
113312
  }, w = async () => {
113314
113313
  if (s(!0), u("type"), r) {
113315
113314
  if (!i) return;
@@ -113358,8 +113357,10 @@ function qI({
113358
113357
  nodeAlign: "center",
113359
113358
  margin: {}
113360
113359
  };
113361
- r ? L.id = f.attrs.id : L.id = Pv(), L.chartConfig = JSON.parse(
113362
- JSON.stringify({ data: v.data, config: v.config })
113360
+ r ? L.id = f.attrs.id : L.id = Pv();
113361
+ let F = v.data;
113362
+ l === "data" && p.current && (F = p.current.getTableData().data), L.chartConfig = JSON.parse(
113363
+ JSON.stringify({ data: F, config: v.config })
113363
113364
  ), r ? i?.commands.updateEcharts(L) : i?.commands.setEcharts(L), s(!1);
113364
113365
  };
113365
113366
  return /* @__PURE__ */ rt(Un, { children: [
package/dist/index.d.ts CHANGED
@@ -116,6 +116,15 @@ declare module '@tiptap/core' {
116
116
  }
117
117
 
118
118
 
119
+ declare module '@tiptap/core' {
120
+ interface Commands<ReturnType> {
121
+ insertDatetime: {
122
+ insertDatetime: (options: any) => ReturnType;
123
+ };
124
+ }
125
+ }
126
+
127
+
119
128
  declare module '@tiptap/core' {
120
129
  interface Commands<ReturnType> {
121
130
  setEcharts: {
@@ -139,54 +148,33 @@ declare module '@tiptap/core' {
139
148
  }
140
149
  }
141
150
 
142
-
143
- declare module '@tiptap/core' {
144
- interface Commands<ReturnType> {
145
- insertDatetime: {
146
- insertDatetime: (options: any) => ReturnType;
147
- };
148
- }
149
- }
150
-
151
-
152
151
  declare module '@tiptap/core' {
153
152
  interface Commands<ReturnType> {
154
- setFormatPainter: {
155
- setFormatPainter: (once: any) => ReturnType;
156
- };
157
- unsetFormatPainter: {
158
- unsetFormatPainter: () => ReturnType;
153
+ setHr: {
154
+ setHr: (option: any) => ReturnType;
159
155
  };
160
156
  }
161
157
  }
162
158
 
163
-
164
159
  declare module '@tiptap/core' {
165
160
  interface Commands<ReturnType> {
166
- setFontSize: {
167
- setFontSize: (fontSize: any) => ReturnType;
161
+ setImage: {
162
+ setImage: (options: any, replace?: any) => ReturnType;
168
163
  };
169
- unsetFontSize: {
170
- unsetFontSize: () => ReturnType;
164
+ setInlineImage: {
165
+ setInlineImage: (options: any, replace?: any) => ReturnType;
171
166
  };
172
167
  }
173
168
  }
174
169
 
175
- declare module '@tiptap/core' {
176
- interface Commands<ReturnType> {
177
- setHr: {
178
- setHr: (option: any) => ReturnType;
179
- };
180
- }
181
- }
182
170
 
183
171
  declare module '@tiptap/core' {
184
172
  interface Commands<ReturnType> {
185
- setImage: {
186
- setImage: (options: any, replace?: any) => ReturnType;
173
+ setFormatPainter: {
174
+ setFormatPainter: (once: any) => ReturnType;
187
175
  };
188
- setInlineImage: {
189
- setInlineImage: (options: any, replace?: any) => ReturnType;
176
+ unsetFormatPainter: {
177
+ unsetFormatPainter: () => ReturnType;
190
178
  };
191
179
  }
192
180
  }
@@ -224,22 +212,22 @@ declare module '@tiptap/core' {
224
212
  }
225
213
  }
226
214
 
227
-
228
215
  declare module '@tiptap/core' {
229
216
  interface Commands<ReturnType> {
230
- setMargin: {
231
- setMargin: (options: any) => ReturnType;
232
- };
233
- unsetMargin: {
234
- unsetMargin: () => ReturnType;
217
+ insertMention: {
218
+ insertMention: (options: any) => ReturnType;
235
219
  };
236
220
  }
237
221
  }
238
222
 
223
+
239
224
  declare module '@tiptap/core' {
240
225
  interface Commands<ReturnType> {
241
- insertMention: {
242
- insertMention: (options: any) => ReturnType;
226
+ setFontSize: {
227
+ setFontSize: (fontSize: any) => ReturnType;
228
+ };
229
+ unsetFontSize: {
230
+ unsetFontSize: () => ReturnType;
243
231
  };
244
232
  }
245
233
  }
@@ -259,8 +247,20 @@ declare module '@tiptap/core' {
259
247
 
260
248
  declare module '@tiptap/core' {
261
249
  interface Commands<ReturnType> {
262
- insertTag: {
263
- insertTag: (options: any) => ReturnType;
250
+ setMargin: {
251
+ setMargin: (options: any) => ReturnType;
252
+ };
253
+ unsetMargin: {
254
+ unsetMargin: () => ReturnType;
255
+ };
256
+ }
257
+ }
258
+
259
+
260
+ declare module '@tiptap/core' {
261
+ interface Commands<ReturnType> {
262
+ setVideo: {
263
+ setVideo: (options: any) => ReturnType;
264
264
  };
265
265
  }
266
266
  }
@@ -280,8 +280,8 @@ declare module '@tiptap/core' {
280
280
 
281
281
  declare module '@tiptap/core' {
282
282
  interface Commands<ReturnType> {
283
- setVideo: {
284
- setVideo: (options: any) => ReturnType;
283
+ insertTag: {
284
+ insertTag: (options: any) => ReturnType;
285
285
  };
286
286
  }
287
287
  }