@progress/kendo-react-webmcp 16.2.0-develop.9 → 16.2.0

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.
@@ -40,7 +40,7 @@ function v(t, r) {
40
40
  const o = r.sheets().find((s) => s.name() === e);
41
41
  return o ? (r.activeSheet(o), { content: [{ type: "text", text: `Switched to sheet "${e}".` }] }) : { content: [{ type: "text", text: `Sheet "${e}" not found.` }], isError: !0 };
42
42
  }
43
- function b(t, r) {
43
+ function E(t, r) {
44
44
  if (!(r != null && r.instance))
45
45
  return { content: [{ type: "text", text: "Spreadsheet ref not available." }], isError: !0 };
46
46
  const e = r.instance;
@@ -51,7 +51,7 @@ function b(t, r) {
51
51
  const a = t.name;
52
52
  return { content: [{ type: "text", text: a ? 'Sheet "' + a + '" added.' : "Sheet added." }] };
53
53
  }
54
- function E(t, r) {
54
+ function C(t, r) {
55
55
  if (!(r != null && r.instance))
56
56
  return { content: [{ type: "text", text: "Spreadsheet ref not available." }], isError: !0 };
57
57
  const e = t.name;
@@ -67,10 +67,10 @@ function E(t, r) {
67
67
  return { content: [{ type: "text", text: "Rename sheet is not supported by this instance." }], isError: !0 };
68
68
  return { content: [{ type: "text", text: `Sheet renamed to "${e}".` }] };
69
69
  }
70
- function N(t) {
70
+ function b(t) {
71
71
  return t != null && t.instance ? (t.saveAsExcel({}), { content: [{ type: "text", text: "Export triggered." }] }) : { content: [{ type: "text", text: "Spreadsheet ref not available." }], isError: !0 };
72
72
  }
73
- function g(t, r) {
73
+ function N(t, r) {
74
74
  if (!(r != null && r.instance))
75
75
  return { content: [{ type: "text", text: "Spreadsheet ref not available." }], isError: !0 };
76
76
  const e = t.ref;
@@ -82,7 +82,7 @@ function g(t, r) {
82
82
  const o = a.range(e).value();
83
83
  return { content: [{ type: "text", text: JSON.stringify(o) }] };
84
84
  }
85
- function C(t) {
85
+ function g(t) {
86
86
  if (!t)
87
87
  return { content: [{ type: "text", text: "Spreadsheet ref not available." }], isError: !0 };
88
88
  const r = t.toJSON();
@@ -100,11 +100,19 @@ function $(t) {
100
100
  const e = t.sheets().map((a) => a.name());
101
101
  return { content: [{ type: "text", text: JSON.stringify(e) }] };
102
102
  }
103
- const w = {
104
- bold: !0,
105
- italic: !0,
106
- underline: !0
107
- };
103
+ const w = /* @__PURE__ */ new Set(["bold", "italic", "underline"]), A = /* @__PURE__ */ new Set([
104
+ "undo",
105
+ "redo",
106
+ "AddRowCommand",
107
+ "AddColumnCommand",
108
+ "DeleteRowCommand",
109
+ "DeleteColumnCommand",
110
+ "PropertyChangeCommand",
111
+ "PropertyCleanCommand",
112
+ "AdjustDecimalsCommand",
113
+ "GridLinesChangeCommand",
114
+ "TextWrapCommand"
115
+ ]);
108
116
  function _(t, r) {
109
117
  var a, o;
110
118
  if (!r)
@@ -112,7 +120,7 @@ function _(t, r) {
112
120
  const e = t.command;
113
121
  if (!e)
114
122
  return { content: [{ type: "text", text: "Missing required argument: command" }], isError: !0 };
115
- if (w[e]) {
123
+ if (w.has(e)) {
116
124
  const s = r.activeSheet();
117
125
  if (!s)
118
126
  return { content: [{ type: "text", text: "No active sheet." }], isError: !0 };
@@ -121,13 +129,14 @@ function _(t, r) {
121
129
  command: "PropertyChangeCommand",
122
130
  options: { property: e, value: !u }
123
131
  });
124
- } else {
132
+ } else if (A.has(e)) {
125
133
  const s = t.options || void 0;
126
- r.executeCommand(s ? { command: e, ...s } : { command: e });
127
- }
134
+ r.executeCommand(s ? { ...s, command: e } : { command: e });
135
+ } else
136
+ return { content: [{ type: "text", text: `Command "${e}" is not allowed.` }], isError: !0 };
128
137
  return { content: [{ type: "text", text: `Command "${e}" executed.` }] };
129
138
  }
130
- const A = {
139
+ const O = {
131
140
  componentSuffix: "spreadsheet",
132
141
  createTools(t, r, e, a) {
133
142
  const o = [], s = (c) => `${e.groupName}_${c}`, m = [
@@ -210,9 +219,9 @@ const A = {
210
219
  case n.SetCells:
211
220
  return y(i, t);
212
221
  case n.GetCell:
213
- return g(i, t);
222
+ return N(i, t);
214
223
  case n.GetData:
215
- return C(t);
224
+ return g(t);
216
225
  case n.SetData:
217
226
  return T(i, t);
218
227
  case n.GetSheets:
@@ -221,13 +230,13 @@ const A = {
221
230
  case n.NavigateSheet:
222
231
  return v(i, t);
223
232
  case n.AddSheet:
224
- return b(i, t);
225
- case n.RenameSheet:
226
233
  return E(i, t);
234
+ case n.RenameSheet:
235
+ return C(i, t);
227
236
  case n.ExecuteCommand:
228
237
  return _(i, t);
229
238
  case n.Export:
230
- return N(t);
239
+ return b(t);
231
240
  default:
232
241
  return { content: [{ type: "text", text: `Unknown command: ${c}` }], isError: !0 };
233
242
  }
@@ -252,5 +261,5 @@ const A = {
252
261
  }
253
262
  };
254
263
  export {
255
- A as spreadsheetAdapter
264
+ O as spreadsheetAdapter
256
265
  };