@leankylin-sheet/react 5.2.62 → 5.2.64

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/index.js CHANGED
@@ -63,6 +63,307 @@ function _objectSpread2(e) {
63
63
  }
64
64
  return e;
65
65
  }
66
+ function _regeneratorRuntime() {
67
+ _regeneratorRuntime = function () {
68
+ return e;
69
+ };
70
+ var t,
71
+ e = {},
72
+ r = Object.prototype,
73
+ n = r.hasOwnProperty,
74
+ o = Object.defineProperty || function (t, e, r) {
75
+ t[e] = r.value;
76
+ },
77
+ i = "function" == typeof Symbol ? Symbol : {},
78
+ a = i.iterator || "@@iterator",
79
+ c = i.asyncIterator || "@@asyncIterator",
80
+ u = i.toStringTag || "@@toStringTag";
81
+ function define(t, e, r) {
82
+ return Object.defineProperty(t, e, {
83
+ value: r,
84
+ enumerable: !0,
85
+ configurable: !0,
86
+ writable: !0
87
+ }), t[e];
88
+ }
89
+ try {
90
+ define({}, "");
91
+ } catch (t) {
92
+ define = function (t, e, r) {
93
+ return t[e] = r;
94
+ };
95
+ }
96
+ function wrap(t, e, r, n) {
97
+ var i = e && e.prototype instanceof Generator ? e : Generator,
98
+ a = Object.create(i.prototype),
99
+ c = new Context(n || []);
100
+ return o(a, "_invoke", {
101
+ value: makeInvokeMethod(t, r, c)
102
+ }), a;
103
+ }
104
+ function tryCatch(t, e, r) {
105
+ try {
106
+ return {
107
+ type: "normal",
108
+ arg: t.call(e, r)
109
+ };
110
+ } catch (t) {
111
+ return {
112
+ type: "throw",
113
+ arg: t
114
+ };
115
+ }
116
+ }
117
+ e.wrap = wrap;
118
+ var h = "suspendedStart",
119
+ l = "suspendedYield",
120
+ f = "executing",
121
+ s = "completed",
122
+ y = {};
123
+ function Generator() {}
124
+ function GeneratorFunction() {}
125
+ function GeneratorFunctionPrototype() {}
126
+ var p = {};
127
+ define(p, a, function () {
128
+ return this;
129
+ });
130
+ var d = Object.getPrototypeOf,
131
+ v = d && d(d(values([])));
132
+ v && v !== r && n.call(v, a) && (p = v);
133
+ var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
134
+ function defineIteratorMethods(t) {
135
+ ["next", "throw", "return"].forEach(function (e) {
136
+ define(t, e, function (t) {
137
+ return this._invoke(e, t);
138
+ });
139
+ });
140
+ }
141
+ function AsyncIterator(t, e) {
142
+ function invoke(r, o, i, a) {
143
+ var c = tryCatch(t[r], t, o);
144
+ if ("throw" !== c.type) {
145
+ var u = c.arg,
146
+ h = u.value;
147
+ return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
148
+ invoke("next", t, i, a);
149
+ }, function (t) {
150
+ invoke("throw", t, i, a);
151
+ }) : e.resolve(h).then(function (t) {
152
+ u.value = t, i(u);
153
+ }, function (t) {
154
+ return invoke("throw", t, i, a);
155
+ });
156
+ }
157
+ a(c.arg);
158
+ }
159
+ var r;
160
+ o(this, "_invoke", {
161
+ value: function (t, n) {
162
+ function callInvokeWithMethodAndArg() {
163
+ return new e(function (e, r) {
164
+ invoke(t, n, e, r);
165
+ });
166
+ }
167
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
168
+ }
169
+ });
170
+ }
171
+ function makeInvokeMethod(e, r, n) {
172
+ var o = h;
173
+ return function (i, a) {
174
+ if (o === f) throw Error("Generator is already running");
175
+ if (o === s) {
176
+ if ("throw" === i) throw a;
177
+ return {
178
+ value: t,
179
+ done: !0
180
+ };
181
+ }
182
+ for (n.method = i, n.arg = a;;) {
183
+ var c = n.delegate;
184
+ if (c) {
185
+ var u = maybeInvokeDelegate(c, n);
186
+ if (u) {
187
+ if (u === y) continue;
188
+ return u;
189
+ }
190
+ }
191
+ if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
192
+ if (o === h) throw o = s, n.arg;
193
+ n.dispatchException(n.arg);
194
+ } else "return" === n.method && n.abrupt("return", n.arg);
195
+ o = f;
196
+ var p = tryCatch(e, r, n);
197
+ if ("normal" === p.type) {
198
+ if (o = n.done ? s : l, p.arg === y) continue;
199
+ return {
200
+ value: p.arg,
201
+ done: n.done
202
+ };
203
+ }
204
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
205
+ }
206
+ };
207
+ }
208
+ function maybeInvokeDelegate(e, r) {
209
+ var n = r.method,
210
+ o = e.iterator[n];
211
+ if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
212
+ var i = tryCatch(o, e.iterator, r.arg);
213
+ if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
214
+ var a = i.arg;
215
+ return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
216
+ }
217
+ function pushTryEntry(t) {
218
+ var e = {
219
+ tryLoc: t[0]
220
+ };
221
+ 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
222
+ }
223
+ function resetTryEntry(t) {
224
+ var e = t.completion || {};
225
+ e.type = "normal", delete e.arg, t.completion = e;
226
+ }
227
+ function Context(t) {
228
+ this.tryEntries = [{
229
+ tryLoc: "root"
230
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
231
+ }
232
+ function values(e) {
233
+ if (e || "" === e) {
234
+ var r = e[a];
235
+ if (r) return r.call(e);
236
+ if ("function" == typeof e.next) return e;
237
+ if (!isNaN(e.length)) {
238
+ var o = -1,
239
+ i = function next() {
240
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
241
+ return next.value = t, next.done = !0, next;
242
+ };
243
+ return i.next = i;
244
+ }
245
+ }
246
+ throw new TypeError(typeof e + " is not iterable");
247
+ }
248
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
249
+ value: GeneratorFunctionPrototype,
250
+ configurable: !0
251
+ }), o(GeneratorFunctionPrototype, "constructor", {
252
+ value: GeneratorFunction,
253
+ configurable: !0
254
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
255
+ var e = "function" == typeof t && t.constructor;
256
+ return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
257
+ }, e.mark = function (t) {
258
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
259
+ }, e.awrap = function (t) {
260
+ return {
261
+ __await: t
262
+ };
263
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
264
+ return this;
265
+ }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
266
+ void 0 === i && (i = Promise);
267
+ var a = new AsyncIterator(wrap(t, r, n, o), i);
268
+ return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
269
+ return t.done ? t.value : a.next();
270
+ });
271
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
272
+ return this;
273
+ }), define(g, "toString", function () {
274
+ return "[object Generator]";
275
+ }), e.keys = function (t) {
276
+ var e = Object(t),
277
+ r = [];
278
+ for (var n in e) r.push(n);
279
+ return r.reverse(), function next() {
280
+ for (; r.length;) {
281
+ var t = r.pop();
282
+ if (t in e) return next.value = t, next.done = !1, next;
283
+ }
284
+ return next.done = !0, next;
285
+ };
286
+ }, e.values = values, Context.prototype = {
287
+ constructor: Context,
288
+ reset: function (e) {
289
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
290
+ },
291
+ stop: function () {
292
+ this.done = !0;
293
+ var t = this.tryEntries[0].completion;
294
+ if ("throw" === t.type) throw t.arg;
295
+ return this.rval;
296
+ },
297
+ dispatchException: function (e) {
298
+ if (this.done) throw e;
299
+ var r = this;
300
+ function handle(n, o) {
301
+ return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
302
+ }
303
+ for (var o = this.tryEntries.length - 1; o >= 0; --o) {
304
+ var i = this.tryEntries[o],
305
+ a = i.completion;
306
+ if ("root" === i.tryLoc) return handle("end");
307
+ if (i.tryLoc <= this.prev) {
308
+ var c = n.call(i, "catchLoc"),
309
+ u = n.call(i, "finallyLoc");
310
+ if (c && u) {
311
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
312
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
313
+ } else if (c) {
314
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
315
+ } else {
316
+ if (!u) throw Error("try statement without catch or finally");
317
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
318
+ }
319
+ }
320
+ }
321
+ },
322
+ abrupt: function (t, e) {
323
+ for (var r = this.tryEntries.length - 1; r >= 0; --r) {
324
+ var o = this.tryEntries[r];
325
+ if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
326
+ var i = o;
327
+ break;
328
+ }
329
+ }
330
+ i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
331
+ var a = i ? i.completion : {};
332
+ return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
333
+ },
334
+ complete: function (t, e) {
335
+ if ("throw" === t.type) throw t.arg;
336
+ return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
337
+ },
338
+ finish: function (t) {
339
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
340
+ var r = this.tryEntries[e];
341
+ if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
342
+ }
343
+ },
344
+ catch: function (t) {
345
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
346
+ var r = this.tryEntries[e];
347
+ if (r.tryLoc === t) {
348
+ var n = r.completion;
349
+ if ("throw" === n.type) {
350
+ var o = n.arg;
351
+ resetTryEntry(r);
352
+ }
353
+ return o;
354
+ }
355
+ }
356
+ throw Error("illegal catch attempt");
357
+ },
358
+ delegateYield: function (e, r, n) {
359
+ return this.delegate = {
360
+ iterator: values(e),
361
+ resultName: r,
362
+ nextLoc: n
363
+ }, "next" === this.method && (this.arg = t), y;
364
+ }
365
+ }, e;
366
+ }
66
367
  function _toPrimitive(t, r) {
67
368
  if ("object" != typeof t || !t) return t;
68
369
  var e = t[Symbol.toPrimitive];
@@ -77,6 +378,36 @@ function _toPropertyKey(t) {
77
378
  var i = _toPrimitive(t, "string");
78
379
  return "symbol" == typeof i ? i : i + "";
79
380
  }
381
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
382
+ try {
383
+ var info = gen[key](arg);
384
+ var value = info.value;
385
+ } catch (error) {
386
+ reject(error);
387
+ return;
388
+ }
389
+ if (info.done) {
390
+ resolve(value);
391
+ } else {
392
+ Promise.resolve(value).then(_next, _throw);
393
+ }
394
+ }
395
+ function _asyncToGenerator(fn) {
396
+ return function () {
397
+ var self = this,
398
+ args = arguments;
399
+ return new Promise(function (resolve, reject) {
400
+ var gen = fn.apply(self, args);
401
+ function _next(value) {
402
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
403
+ }
404
+ function _throw(err) {
405
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
406
+ }
407
+ _next(undefined);
408
+ });
409
+ };
410
+ }
80
411
  function _defineProperty(obj, key, value) {
81
412
  key = _toPropertyKey(key);
82
413
  if (key in obj) {
@@ -10299,16 +10630,49 @@ var SheetTabContextMenu = function SheetTabContextMenu() {
10299
10630
  return ___default['default'].isUndefined(singleSheet.hide) || singleSheet.hide !== 1;
10300
10631
  });
10301
10632
  if (context.luckysheetfile.length > 1 && shownSheets.length > 1) {
10302
- showAlert("".concat(sheetconfig.confirmDelete, "\"").concat(sheet.name, "\"\uFF1F"), "yesno", function () {
10303
- setContext(function (ctx) {
10304
- core.deleteSheet(ctx, sheet.id);
10305
- }, {
10306
- deleteSheetOp: {
10307
- id: sheet.id
10633
+ showAlert("".concat(sheetconfig.confirmDelete, "\"").concat(sheet.name, "\"\uFF1F"), "yesno", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
10634
+ var onDeleteSheetCheck, isAllowed;
10635
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
10636
+ while (1) switch (_context.prev = _context.next) {
10637
+ case 0:
10638
+ onDeleteSheetCheck = settings.onDeleteSheetCheck;
10639
+ if (!onDeleteSheetCheck) {
10640
+ _context.next = 14;
10641
+ break;
10642
+ }
10643
+ _context.prev = 2;
10644
+ _context.next = 5;
10645
+ return onDeleteSheetCheck(sheet.id, sheet);
10646
+ case 5:
10647
+ isAllowed = _context.sent;
10648
+ _context.next = 12;
10649
+ break;
10650
+ case 8:
10651
+ _context.prev = 8;
10652
+ _context.t0 = _context["catch"](2);
10653
+ console.error(_context.t0);
10654
+ isAllowed = false;
10655
+ case 12:
10656
+ if (isAllowed) {
10657
+ _context.next = 14;
10658
+ break;
10659
+ }
10660
+ return _context.abrupt("return");
10661
+ case 14:
10662
+ setContext(function (ctx) {
10663
+ core.deleteSheet(ctx, sheet.id);
10664
+ }, {
10665
+ deleteSheetOp: {
10666
+ id: sheet.id
10667
+ }
10668
+ });
10669
+ hideAlert();
10670
+ case 16:
10671
+ case "end":
10672
+ return _context.stop();
10308
10673
  }
10309
- });
10310
- hideAlert();
10311
- }, undefined, {
10674
+ }, _callee, null, [[2, 8]]);
10675
+ })), undefined, {
10312
10676
  confirmText: sheetconfig.delete,
10313
10677
  danger: true
10314
10678
  });