@contentful/field-editor-rich-text 2.0.0-next.4 → 2.0.0-next.5

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.
@@ -341,8 +341,8 @@ var schema = {
341
341
  function getContentfulEditorId(sdk) {
342
342
  var entry = sdk.entry,
343
343
  field = sdk.field;
344
- var entryId = entry.getSys().id;
345
- return "rich-text-editor-" + entryId + "-" + field.id + "-" + field.locale;
344
+ var entrySys = entry.getSys();
345
+ return "rich-text-editor-" + entrySys.id + "-" + field.id + "-" + field.locale + "-v" + entrySys.version;
346
346
  }
347
347
 
348
348
  function useContentfulEditorHook(_ref) {
@@ -1135,198 +1135,201 @@ function createCommonjsModule(fn, module) {
1135
1135
  return module = { exports: {} }, fn(module, module.exports), module.exports;
1136
1136
  }
1137
1137
 
1138
- var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
1139
- /**
1140
- * Copyright (c) 2014-present, Facebook, Inc.
1141
- *
1142
- * This source code is licensed under the MIT license found in the
1143
- * LICENSE file in the root directory of this source tree.
1144
- */
1145
- var runtime = function (exports) {
1146
-
1147
- var Op = Object.prototype;
1148
- var hasOwn = Op.hasOwnProperty;
1149
- var undefined$1; // More compressible than void 0.
1150
-
1151
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
1152
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
1153
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
1154
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
1155
-
1156
- function define(obj, key, value) {
1157
- Object.defineProperty(obj, key, {
1158
- value: value,
1159
- enumerable: true,
1160
- configurable: true,
1161
- writable: true
1162
- });
1163
- return obj[key];
1164
- }
1138
+ var runtime_1 = createCommonjsModule(function (module) {
1139
+ /**
1140
+ * Copyright (c) 2014-present, Facebook, Inc.
1141
+ *
1142
+ * This source code is licensed under the MIT license found in the
1143
+ * LICENSE file in the root directory of this source tree.
1144
+ */
1165
1145
 
1166
- try {
1167
- // IE 8 has a broken Object.defineProperty that only works on DOM objects.
1168
- define({}, "");
1169
- } catch (err) {
1170
- define = function define(obj, key, value) {
1171
- return obj[key] = value;
1172
- };
1173
- }
1146
+ var runtime = (function (exports) {
1147
+
1148
+ var Op = Object.prototype;
1149
+ var hasOwn = Op.hasOwnProperty;
1150
+ var undefined$1; // More compressible than void 0.
1151
+ var $Symbol = typeof Symbol === "function" ? Symbol : {};
1152
+ var iteratorSymbol = $Symbol.iterator || "@@iterator";
1153
+ var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
1154
+ var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
1155
+
1156
+ function define(obj, key, value) {
1157
+ Object.defineProperty(obj, key, {
1158
+ value: value,
1159
+ enumerable: true,
1160
+ configurable: true,
1161
+ writable: true
1162
+ });
1163
+ return obj[key];
1164
+ }
1165
+ try {
1166
+ // IE 8 has a broken Object.defineProperty that only works on DOM objects.
1167
+ define({}, "");
1168
+ } catch (err) {
1169
+ define = function(obj, key, value) {
1170
+ return obj[key] = value;
1171
+ };
1172
+ }
1174
1173
 
1175
- function wrap(innerFn, outerFn, self, tryLocsList) {
1176
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
1177
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
1178
- var generator = Object.create(protoGenerator.prototype);
1179
- var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next,
1180
- // .throw, and .return methods.
1174
+ function wrap(innerFn, outerFn, self, tryLocsList) {
1175
+ // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
1176
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
1177
+ var generator = Object.create(protoGenerator.prototype);
1178
+ var context = new Context(tryLocsList || []);
1181
1179
 
1182
- generator._invoke = makeInvokeMethod(innerFn, self, context);
1183
- return generator;
1184
- }
1180
+ // The ._invoke method unifies the implementations of the .next,
1181
+ // .throw, and .return methods.
1182
+ generator._invoke = makeInvokeMethod(innerFn, self, context);
1185
1183
 
1186
- exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion
1187
- // record like context.tryEntries[i].completion. This interface could
1188
- // have been (and was previously) designed to take a closure to be
1189
- // invoked without arguments, but in all the cases we care about we
1190
- // already have an existing method we want to call, so there's no need
1191
- // to create a new function object. We can even get away with assuming
1192
- // the method takes exactly one argument, since that happens to be true
1193
- // in every case, so we don't have to touch the arguments object. The
1194
- // only additional allocation required is the completion record, which
1195
- // has a stable shape and so hopefully should be cheap to allocate.
1196
-
1197
- function tryCatch(fn, obj, arg) {
1198
- try {
1199
- return {
1200
- type: "normal",
1201
- arg: fn.call(obj, arg)
1202
- };
1203
- } catch (err) {
1204
- return {
1205
- type: "throw",
1206
- arg: err
1207
- };
1208
- }
1184
+ return generator;
1185
+ }
1186
+ exports.wrap = wrap;
1187
+
1188
+ // Try/catch helper to minimize deoptimizations. Returns a completion
1189
+ // record like context.tryEntries[i].completion. This interface could
1190
+ // have been (and was previously) designed to take a closure to be
1191
+ // invoked without arguments, but in all the cases we care about we
1192
+ // already have an existing method we want to call, so there's no need
1193
+ // to create a new function object. We can even get away with assuming
1194
+ // the method takes exactly one argument, since that happens to be true
1195
+ // in every case, so we don't have to touch the arguments object. The
1196
+ // only additional allocation required is the completion record, which
1197
+ // has a stable shape and so hopefully should be cheap to allocate.
1198
+ function tryCatch(fn, obj, arg) {
1199
+ try {
1200
+ return { type: "normal", arg: fn.call(obj, arg) };
1201
+ } catch (err) {
1202
+ return { type: "throw", arg: err };
1209
1203
  }
1204
+ }
1210
1205
 
1211
- var GenStateSuspendedStart = "suspendedStart";
1212
- var GenStateSuspendedYield = "suspendedYield";
1213
- var GenStateExecuting = "executing";
1214
- var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as
1215
- // breaking out of the dispatch switch statement.
1216
-
1217
- var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and
1218
- // .constructor.prototype properties for functions that return Generator
1219
- // objects. For full spec compliance, you may wish to configure your
1220
- // minifier not to mangle the names of these two functions.
1221
-
1222
- function Generator() {}
1223
-
1224
- function GeneratorFunction() {}
1225
-
1226
- function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that
1227
- // don't natively support it.
1228
-
1229
-
1230
- var IteratorPrototype = {};
1206
+ var GenStateSuspendedStart = "suspendedStart";
1207
+ var GenStateSuspendedYield = "suspendedYield";
1208
+ var GenStateExecuting = "executing";
1209
+ var GenStateCompleted = "completed";
1210
+
1211
+ // Returning this object from the innerFn has the same effect as
1212
+ // breaking out of the dispatch switch statement.
1213
+ var ContinueSentinel = {};
1214
+
1215
+ // Dummy constructor functions that we use as the .constructor and
1216
+ // .constructor.prototype properties for functions that return Generator
1217
+ // objects. For full spec compliance, you may wish to configure your
1218
+ // minifier not to mangle the names of these two functions.
1219
+ function Generator() {}
1220
+ function GeneratorFunction() {}
1221
+ function GeneratorFunctionPrototype() {}
1222
+
1223
+ // This is a polyfill for %IteratorPrototype% for environments that
1224
+ // don't natively support it.
1225
+ var IteratorPrototype = {};
1226
+ define(IteratorPrototype, iteratorSymbol, function () {
1227
+ return this;
1228
+ });
1231
1229
 
1232
- IteratorPrototype[iteratorSymbol] = function () {
1233
- return this;
1234
- };
1230
+ var getProto = Object.getPrototypeOf;
1231
+ var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
1232
+ if (NativeIteratorPrototype &&
1233
+ NativeIteratorPrototype !== Op &&
1234
+ hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
1235
+ // This environment has a native %IteratorPrototype%; use it instead
1236
+ // of the polyfill.
1237
+ IteratorPrototype = NativeIteratorPrototype;
1238
+ }
1235
1239
 
1236
- var getProto = Object.getPrototypeOf;
1237
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
1240
+ var Gp = GeneratorFunctionPrototype.prototype =
1241
+ Generator.prototype = Object.create(IteratorPrototype);
1242
+ GeneratorFunction.prototype = GeneratorFunctionPrototype;
1243
+ define(Gp, "constructor", GeneratorFunctionPrototype);
1244
+ define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
1245
+ GeneratorFunction.displayName = define(
1246
+ GeneratorFunctionPrototype,
1247
+ toStringTagSymbol,
1248
+ "GeneratorFunction"
1249
+ );
1238
1250
 
1239
- if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
1240
- // This environment has a native %IteratorPrototype%; use it instead
1241
- // of the polyfill.
1242
- IteratorPrototype = NativeIteratorPrototype;
1243
- }
1251
+ // Helper for defining the .next, .throw, and .return methods of the
1252
+ // Iterator interface in terms of a single ._invoke method.
1253
+ function defineIteratorMethods(prototype) {
1254
+ ["next", "throw", "return"].forEach(function(method) {
1255
+ define(prototype, method, function(arg) {
1256
+ return this._invoke(method, arg);
1257
+ });
1258
+ });
1259
+ }
1244
1260
 
1245
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
1246
- GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
1247
- GeneratorFunctionPrototype.constructor = GeneratorFunction;
1248
- GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the
1249
- // Iterator interface in terms of a single ._invoke method.
1261
+ exports.isGeneratorFunction = function(genFun) {
1262
+ var ctor = typeof genFun === "function" && genFun.constructor;
1263
+ return ctor
1264
+ ? ctor === GeneratorFunction ||
1265
+ // For the native GeneratorFunction constructor, the best we can
1266
+ // do is to check its .name property.
1267
+ (ctor.displayName || ctor.name) === "GeneratorFunction"
1268
+ : false;
1269
+ };
1250
1270
 
1251
- function defineIteratorMethods(prototype) {
1252
- ["next", "throw", "return"].forEach(function (method) {
1253
- define(prototype, method, function (arg) {
1254
- return this._invoke(method, arg);
1255
- });
1256
- });
1271
+ exports.mark = function(genFun) {
1272
+ if (Object.setPrototypeOf) {
1273
+ Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
1274
+ } else {
1275
+ genFun.__proto__ = GeneratorFunctionPrototype;
1276
+ define(genFun, toStringTagSymbol, "GeneratorFunction");
1257
1277
  }
1278
+ genFun.prototype = Object.create(Gp);
1279
+ return genFun;
1280
+ };
1258
1281
 
1259
- exports.isGeneratorFunction = function (genFun) {
1260
- var ctor = typeof genFun === "function" && genFun.constructor;
1261
- return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can
1262
- // do is to check its .name property.
1263
- (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
1264
- };
1282
+ // Within the body of any async function, `await x` is transformed to
1283
+ // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
1284
+ // `hasOwn.call(value, "__await")` to determine if the yielded value is
1285
+ // meant to be awaited.
1286
+ exports.awrap = function(arg) {
1287
+ return { __await: arg };
1288
+ };
1265
1289
 
1266
- exports.mark = function (genFun) {
1267
- if (Object.setPrototypeOf) {
1268
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
1290
+ function AsyncIterator(generator, PromiseImpl) {
1291
+ function invoke(method, arg, resolve, reject) {
1292
+ var record = tryCatch(generator[method], generator, arg);
1293
+ if (record.type === "throw") {
1294
+ reject(record.arg);
1269
1295
  } else {
1270
- genFun.__proto__ = GeneratorFunctionPrototype;
1271
- define(genFun, toStringTagSymbol, "GeneratorFunction");
1272
- }
1273
-
1274
- genFun.prototype = Object.create(Gp);
1275
- return genFun;
1276
- }; // Within the body of any async function, `await x` is transformed to
1277
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
1278
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
1279
- // meant to be awaited.
1280
-
1281
-
1282
- exports.awrap = function (arg) {
1283
- return {
1284
- __await: arg
1285
- };
1286
- };
1287
-
1288
- function AsyncIterator(generator, PromiseImpl) {
1289
- function invoke(method, arg, resolve, reject) {
1290
- var record = tryCatch(generator[method], generator, arg);
1291
-
1292
- if (record.type === "throw") {
1293
- reject(record.arg);
1294
- } else {
1295
- var result = record.arg;
1296
- var value = result.value;
1297
-
1298
- if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
1299
- return PromiseImpl.resolve(value.__await).then(function (value) {
1300
- invoke("next", value, resolve, reject);
1301
- }, function (err) {
1302
- invoke("throw", err, resolve, reject);
1303
- });
1304
- }
1305
-
1306
- return PromiseImpl.resolve(value).then(function (unwrapped) {
1307
- // When a yielded Promise is resolved, its final value becomes
1308
- // the .value of the Promise<{value,done}> result for the
1309
- // current iteration.
1310
- result.value = unwrapped;
1311
- resolve(result);
1312
- }, function (error) {
1313
- // If a rejected Promise was yielded, throw the rejection back
1314
- // into the async generator function so it can be handled there.
1315
- return invoke("throw", error, resolve, reject);
1296
+ var result = record.arg;
1297
+ var value = result.value;
1298
+ if (value &&
1299
+ typeof value === "object" &&
1300
+ hasOwn.call(value, "__await")) {
1301
+ return PromiseImpl.resolve(value.__await).then(function(value) {
1302
+ invoke("next", value, resolve, reject);
1303
+ }, function(err) {
1304
+ invoke("throw", err, resolve, reject);
1316
1305
  });
1317
1306
  }
1307
+
1308
+ return PromiseImpl.resolve(value).then(function(unwrapped) {
1309
+ // When a yielded Promise is resolved, its final value becomes
1310
+ // the .value of the Promise<{value,done}> result for the
1311
+ // current iteration.
1312
+ result.value = unwrapped;
1313
+ resolve(result);
1314
+ }, function(error) {
1315
+ // If a rejected Promise was yielded, throw the rejection back
1316
+ // into the async generator function so it can be handled there.
1317
+ return invoke("throw", error, resolve, reject);
1318
+ });
1318
1319
  }
1320
+ }
1319
1321
 
1320
- var previousPromise;
1322
+ var previousPromise;
1321
1323
 
1322
- function enqueue(method, arg) {
1323
- function callInvokeWithMethodAndArg() {
1324
- return new PromiseImpl(function (resolve, reject) {
1325
- invoke(method, arg, resolve, reject);
1326
- });
1327
- }
1324
+ function enqueue(method, arg) {
1325
+ function callInvokeWithMethodAndArg() {
1326
+ return new PromiseImpl(function(resolve, reject) {
1327
+ invoke(method, arg, resolve, reject);
1328
+ });
1329
+ }
1328
1330
 
1329
- return previousPromise = // If enqueue has been called before, then we want to wait until
1331
+ return previousPromise =
1332
+ // If enqueue has been called before, then we want to wait until
1330
1333
  // all previous Promises have been resolved before calling invoke,
1331
1334
  // so that results are always delivered in the correct order. If
1332
1335
  // enqueue has not been called before, then it is important to
@@ -1338,525 +1341,554 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
1338
1341
  // execute code before the first await. Since we implement simple
1339
1342
  // async functions in terms of async generators, it is especially
1340
1343
  // important to get this right, even though it requires care.
1341
- previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later
1342
- // invocations of the iterator.
1343
- callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
1344
- } // Define the unified helper method that is used to implement .next,
1345
- // .throw, and .return (see defineIteratorMethods).
1346
-
1347
-
1348
- this._invoke = enqueue;
1344
+ previousPromise ? previousPromise.then(
1345
+ callInvokeWithMethodAndArg,
1346
+ // Avoid propagating failures to Promises returned by later
1347
+ // invocations of the iterator.
1348
+ callInvokeWithMethodAndArg
1349
+ ) : callInvokeWithMethodAndArg();
1349
1350
  }
1350
1351
 
1351
- defineIteratorMethods(AsyncIterator.prototype);
1352
-
1353
- AsyncIterator.prototype[asyncIteratorSymbol] = function () {
1354
- return this;
1355
- };
1356
-
1357
- exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
1358
- // AsyncIterator objects; they just return a Promise for the value of
1359
- // the final result produced by the iterator.
1360
-
1361
- exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
1362
- if (PromiseImpl === void 0) PromiseImpl = Promise;
1363
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
1364
- return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
1365
- : iter.next().then(function (result) {
1366
- return result.done ? result.value : iter.next();
1367
- });
1368
- };
1352
+ // Define the unified helper method that is used to implement .next,
1353
+ // .throw, and .return (see defineIteratorMethods).
1354
+ this._invoke = enqueue;
1355
+ }
1369
1356
 
1370
- function makeInvokeMethod(innerFn, self, context) {
1371
- var state = GenStateSuspendedStart;
1372
- return function invoke(method, arg) {
1373
- if (state === GenStateExecuting) {
1374
- throw new Error("Generator is already running");
1375
- }
1357
+ defineIteratorMethods(AsyncIterator.prototype);
1358
+ define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
1359
+ return this;
1360
+ });
1361
+ exports.AsyncIterator = AsyncIterator;
1362
+
1363
+ // Note that simple async functions are implemented on top of
1364
+ // AsyncIterator objects; they just return a Promise for the value of
1365
+ // the final result produced by the iterator.
1366
+ exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
1367
+ if (PromiseImpl === void 0) PromiseImpl = Promise;
1368
+
1369
+ var iter = new AsyncIterator(
1370
+ wrap(innerFn, outerFn, self, tryLocsList),
1371
+ PromiseImpl
1372
+ );
1373
+
1374
+ return exports.isGeneratorFunction(outerFn)
1375
+ ? iter // If outerFn is a generator, return the full iterator.
1376
+ : iter.next().then(function(result) {
1377
+ return result.done ? result.value : iter.next();
1378
+ });
1379
+ };
1376
1380
 
1377
- if (state === GenStateCompleted) {
1378
- if (method === "throw") {
1379
- throw arg;
1380
- } // Be forgiving, per 25.3.3.3.3 of the spec:
1381
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
1381
+ function makeInvokeMethod(innerFn, self, context) {
1382
+ var state = GenStateSuspendedStart;
1382
1383
 
1384
+ return function invoke(method, arg) {
1385
+ if (state === GenStateExecuting) {
1386
+ throw new Error("Generator is already running");
1387
+ }
1383
1388
 
1384
- return doneResult();
1389
+ if (state === GenStateCompleted) {
1390
+ if (method === "throw") {
1391
+ throw arg;
1385
1392
  }
1386
1393
 
1387
- context.method = method;
1388
- context.arg = arg;
1389
-
1390
- while (true) {
1391
- var delegate = context.delegate;
1394
+ // Be forgiving, per 25.3.3.3.3 of the spec:
1395
+ // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
1396
+ return doneResult();
1397
+ }
1392
1398
 
1393
- if (delegate) {
1394
- var delegateResult = maybeInvokeDelegate(delegate, context);
1399
+ context.method = method;
1400
+ context.arg = arg;
1395
1401
 
1396
- if (delegateResult) {
1397
- if (delegateResult === ContinueSentinel) continue;
1398
- return delegateResult;
1399
- }
1402
+ while (true) {
1403
+ var delegate = context.delegate;
1404
+ if (delegate) {
1405
+ var delegateResult = maybeInvokeDelegate(delegate, context);
1406
+ if (delegateResult) {
1407
+ if (delegateResult === ContinueSentinel) continue;
1408
+ return delegateResult;
1400
1409
  }
1410
+ }
1401
1411
 
1402
- if (context.method === "next") {
1403
- // Setting context._sent for legacy support of Babel's
1404
- // function.sent implementation.
1405
- context.sent = context._sent = context.arg;
1406
- } else if (context.method === "throw") {
1407
- if (state === GenStateSuspendedStart) {
1408
- state = GenStateCompleted;
1409
- throw context.arg;
1410
- }
1412
+ if (context.method === "next") {
1413
+ // Setting context._sent for legacy support of Babel's
1414
+ // function.sent implementation.
1415
+ context.sent = context._sent = context.arg;
1411
1416
 
1412
- context.dispatchException(context.arg);
1413
- } else if (context.method === "return") {
1414
- context.abrupt("return", context.arg);
1417
+ } else if (context.method === "throw") {
1418
+ if (state === GenStateSuspendedStart) {
1419
+ state = GenStateCompleted;
1420
+ throw context.arg;
1415
1421
  }
1416
1422
 
1417
- state = GenStateExecuting;
1418
- var record = tryCatch(innerFn, self, context);
1423
+ context.dispatchException(context.arg);
1419
1424
 
1420
- if (record.type === "normal") {
1421
- // If an exception is thrown from innerFn, we leave state ===
1422
- // GenStateExecuting and loop back for another invocation.
1423
- state = context.done ? GenStateCompleted : GenStateSuspendedYield;
1425
+ } else if (context.method === "return") {
1426
+ context.abrupt("return", context.arg);
1427
+ }
1424
1428
 
1425
- if (record.arg === ContinueSentinel) {
1426
- continue;
1427
- }
1429
+ state = GenStateExecuting;
1428
1430
 
1429
- return {
1430
- value: record.arg,
1431
- done: context.done
1432
- };
1433
- } else if (record.type === "throw") {
1434
- state = GenStateCompleted; // Dispatch the exception by looping back around to the
1435
- // context.dispatchException(context.arg) call above.
1431
+ var record = tryCatch(innerFn, self, context);
1432
+ if (record.type === "normal") {
1433
+ // If an exception is thrown from innerFn, we leave state ===
1434
+ // GenStateExecuting and loop back for another invocation.
1435
+ state = context.done
1436
+ ? GenStateCompleted
1437
+ : GenStateSuspendedYield;
1436
1438
 
1437
- context.method = "throw";
1438
- context.arg = record.arg;
1439
- }
1440
- }
1441
- };
1442
- } // Call delegate.iterator[context.method](context.arg) and handle the
1443
- // result, either by returning a { value, done } result from the
1444
- // delegate iterator, or by modifying context.method and context.arg,
1445
- // setting context.delegate to null, and returning the ContinueSentinel.
1446
-
1447
-
1448
- function maybeInvokeDelegate(delegate, context) {
1449
- var method = delegate.iterator[context.method];
1450
-
1451
- if (method === undefined$1) {
1452
- // A .throw or .return when the delegate iterator has no .throw
1453
- // method always terminates the yield* loop.
1454
- context.delegate = null;
1455
-
1456
- if (context.method === "throw") {
1457
- // Note: ["return"] must be used for ES3 parsing compatibility.
1458
- if (delegate.iterator["return"]) {
1459
- // If the delegate iterator has a return method, give it a
1460
- // chance to clean up.
1461
- context.method = "return";
1462
- context.arg = undefined$1;
1463
- maybeInvokeDelegate(delegate, context);
1464
-
1465
- if (context.method === "throw") {
1466
- // If maybeInvokeDelegate(context) changed context.method from
1467
- // "return" to "throw", let that override the TypeError below.
1468
- return ContinueSentinel;
1469
- }
1439
+ if (record.arg === ContinueSentinel) {
1440
+ continue;
1470
1441
  }
1471
1442
 
1443
+ return {
1444
+ value: record.arg,
1445
+ done: context.done
1446
+ };
1447
+
1448
+ } else if (record.type === "throw") {
1449
+ state = GenStateCompleted;
1450
+ // Dispatch the exception by looping back around to the
1451
+ // context.dispatchException(context.arg) call above.
1472
1452
  context.method = "throw";
1473
- context.arg = new TypeError("The iterator does not provide a 'throw' method");
1453
+ context.arg = record.arg;
1474
1454
  }
1475
-
1476
- return ContinueSentinel;
1477
1455
  }
1456
+ };
1457
+ }
1478
1458
 
1479
- var record = tryCatch(method, delegate.iterator, context.arg);
1459
+ // Call delegate.iterator[context.method](context.arg) and handle the
1460
+ // result, either by returning a { value, done } result from the
1461
+ // delegate iterator, or by modifying context.method and context.arg,
1462
+ // setting context.delegate to null, and returning the ContinueSentinel.
1463
+ function maybeInvokeDelegate(delegate, context) {
1464
+ var method = delegate.iterator[context.method];
1465
+ if (method === undefined$1) {
1466
+ // A .throw or .return when the delegate iterator has no .throw
1467
+ // method always terminates the yield* loop.
1468
+ context.delegate = null;
1480
1469
 
1481
- if (record.type === "throw") {
1482
- context.method = "throw";
1483
- context.arg = record.arg;
1484
- context.delegate = null;
1485
- return ContinueSentinel;
1486
- }
1470
+ if (context.method === "throw") {
1471
+ // Note: ["return"] must be used for ES3 parsing compatibility.
1472
+ if (delegate.iterator["return"]) {
1473
+ // If the delegate iterator has a return method, give it a
1474
+ // chance to clean up.
1475
+ context.method = "return";
1476
+ context.arg = undefined$1;
1477
+ maybeInvokeDelegate(delegate, context);
1487
1478
 
1488
- var info = record.arg;
1479
+ if (context.method === "throw") {
1480
+ // If maybeInvokeDelegate(context) changed context.method from
1481
+ // "return" to "throw", let that override the TypeError below.
1482
+ return ContinueSentinel;
1483
+ }
1484
+ }
1489
1485
 
1490
- if (!info) {
1491
1486
  context.method = "throw";
1492
- context.arg = new TypeError("iterator result is not an object");
1493
- context.delegate = null;
1494
- return ContinueSentinel;
1487
+ context.arg = new TypeError(
1488
+ "The iterator does not provide a 'throw' method");
1495
1489
  }
1496
1490
 
1497
- if (info.done) {
1498
- // Assign the result of the finished delegate to the temporary
1499
- // variable specified by delegate.resultName (see delegateYield).
1500
- context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield).
1491
+ return ContinueSentinel;
1492
+ }
1501
1493
 
1502
- context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the
1503
- // exception, let the outer generator proceed normally. If
1504
- // context.method was "next", forget context.arg since it has been
1505
- // "consumed" by the delegate iterator. If context.method was
1506
- // "return", allow the original .return call to continue in the
1507
- // outer generator.
1494
+ var record = tryCatch(method, delegate.iterator, context.arg);
1508
1495
 
1509
- if (context.method !== "return") {
1510
- context.method = "next";
1511
- context.arg = undefined$1;
1512
- }
1513
- } else {
1514
- // Re-yield the result returned by the delegate method.
1515
- return info;
1516
- } // The delegate iterator is finished, so forget it and continue with
1517
- // the outer generator.
1496
+ if (record.type === "throw") {
1497
+ context.method = "throw";
1498
+ context.arg = record.arg;
1499
+ context.delegate = null;
1500
+ return ContinueSentinel;
1501
+ }
1518
1502
 
1503
+ var info = record.arg;
1519
1504
 
1505
+ if (! info) {
1506
+ context.method = "throw";
1507
+ context.arg = new TypeError("iterator result is not an object");
1520
1508
  context.delegate = null;
1521
1509
  return ContinueSentinel;
1522
- } // Define Generator.prototype.{next,throw,return} in terms of the
1523
- // unified ._invoke helper method.
1510
+ }
1524
1511
 
1512
+ if (info.done) {
1513
+ // Assign the result of the finished delegate to the temporary
1514
+ // variable specified by delegate.resultName (see delegateYield).
1515
+ context[delegate.resultName] = info.value;
1516
+
1517
+ // Resume execution at the desired location (see delegateYield).
1518
+ context.next = delegate.nextLoc;
1519
+
1520
+ // If context.method was "throw" but the delegate handled the
1521
+ // exception, let the outer generator proceed normally. If
1522
+ // context.method was "next", forget context.arg since it has been
1523
+ // "consumed" by the delegate iterator. If context.method was
1524
+ // "return", allow the original .return call to continue in the
1525
+ // outer generator.
1526
+ if (context.method !== "return") {
1527
+ context.method = "next";
1528
+ context.arg = undefined$1;
1529
+ }
1525
1530
 
1526
- defineIteratorMethods(Gp);
1527
- define(Gp, toStringTagSymbol, "Generator"); // A Generator should always return itself as the iterator object when the
1528
- // @@iterator function is called on it. Some browsers' implementations of the
1529
- // iterator prototype chain incorrectly implement this, causing the Generator
1530
- // object to not be returned from this call. This ensures that doesn't happen.
1531
- // See https://github.com/facebook/regenerator/issues/274 for more details.
1531
+ } else {
1532
+ // Re-yield the result returned by the delegate method.
1533
+ return info;
1534
+ }
1532
1535
 
1533
- Gp[iteratorSymbol] = function () {
1534
- return this;
1535
- };
1536
+ // The delegate iterator is finished, so forget it and continue with
1537
+ // the outer generator.
1538
+ context.delegate = null;
1539
+ return ContinueSentinel;
1540
+ }
1536
1541
 
1537
- Gp.toString = function () {
1538
- return "[object Generator]";
1539
- };
1542
+ // Define Generator.prototype.{next,throw,return} in terms of the
1543
+ // unified ._invoke helper method.
1544
+ defineIteratorMethods(Gp);
1540
1545
 
1541
- function pushTryEntry(locs) {
1542
- var entry = {
1543
- tryLoc: locs[0]
1544
- };
1546
+ define(Gp, toStringTagSymbol, "Generator");
1545
1547
 
1546
- if (1 in locs) {
1547
- entry.catchLoc = locs[1];
1548
- }
1548
+ // A Generator should always return itself as the iterator object when the
1549
+ // @@iterator function is called on it. Some browsers' implementations of the
1550
+ // iterator prototype chain incorrectly implement this, causing the Generator
1551
+ // object to not be returned from this call. This ensures that doesn't happen.
1552
+ // See https://github.com/facebook/regenerator/issues/274 for more details.
1553
+ define(Gp, iteratorSymbol, function() {
1554
+ return this;
1555
+ });
1549
1556
 
1550
- if (2 in locs) {
1551
- entry.finallyLoc = locs[2];
1552
- entry.afterLoc = locs[3];
1553
- }
1557
+ define(Gp, "toString", function() {
1558
+ return "[object Generator]";
1559
+ });
1554
1560
 
1555
- this.tryEntries.push(entry);
1556
- }
1561
+ function pushTryEntry(locs) {
1562
+ var entry = { tryLoc: locs[0] };
1557
1563
 
1558
- function resetTryEntry(entry) {
1559
- var record = entry.completion || {};
1560
- record.type = "normal";
1561
- delete record.arg;
1562
- entry.completion = record;
1564
+ if (1 in locs) {
1565
+ entry.catchLoc = locs[1];
1563
1566
  }
1564
1567
 
1565
- function Context(tryLocsList) {
1566
- // The root entry object (effectively a try statement without a catch
1567
- // or a finally block) gives us a place to store values thrown from
1568
- // locations where there is no enclosing try statement.
1569
- this.tryEntries = [{
1570
- tryLoc: "root"
1571
- }];
1572
- tryLocsList.forEach(pushTryEntry, this);
1573
- this.reset(true);
1568
+ if (2 in locs) {
1569
+ entry.finallyLoc = locs[2];
1570
+ entry.afterLoc = locs[3];
1574
1571
  }
1575
1572
 
1576
- exports.keys = function (object) {
1577
- var keys = [];
1578
-
1579
- for (var key in object) {
1580
- keys.push(key);
1581
- }
1582
-
1583
- keys.reverse(); // Rather than returning an object with a next method, we keep
1584
- // things simple and return the next function itself.
1573
+ this.tryEntries.push(entry);
1574
+ }
1585
1575
 
1586
- return function next() {
1587
- while (keys.length) {
1588
- var key = keys.pop();
1576
+ function resetTryEntry(entry) {
1577
+ var record = entry.completion || {};
1578
+ record.type = "normal";
1579
+ delete record.arg;
1580
+ entry.completion = record;
1581
+ }
1589
1582
 
1590
- if (key in object) {
1591
- next.value = key;
1592
- next.done = false;
1593
- return next;
1594
- }
1595
- } // To avoid creating an additional object, we just hang the .value
1596
- // and .done properties off the next function object itself. This
1597
- // also ensures that the minifier will not anonymize the function.
1583
+ function Context(tryLocsList) {
1584
+ // The root entry object (effectively a try statement without a catch
1585
+ // or a finally block) gives us a place to store values thrown from
1586
+ // locations where there is no enclosing try statement.
1587
+ this.tryEntries = [{ tryLoc: "root" }];
1588
+ tryLocsList.forEach(pushTryEntry, this);
1589
+ this.reset(true);
1590
+ }
1598
1591
 
1592
+ exports.keys = function(object) {
1593
+ var keys = [];
1594
+ for (var key in object) {
1595
+ keys.push(key);
1596
+ }
1597
+ keys.reverse();
1598
+
1599
+ // Rather than returning an object with a next method, we keep
1600
+ // things simple and return the next function itself.
1601
+ return function next() {
1602
+ while (keys.length) {
1603
+ var key = keys.pop();
1604
+ if (key in object) {
1605
+ next.value = key;
1606
+ next.done = false;
1607
+ return next;
1608
+ }
1609
+ }
1599
1610
 
1600
- next.done = true;
1601
- return next;
1602
- };
1611
+ // To avoid creating an additional object, we just hang the .value
1612
+ // and .done properties off the next function object itself. This
1613
+ // also ensures that the minifier will not anonymize the function.
1614
+ next.done = true;
1615
+ return next;
1603
1616
  };
1617
+ };
1604
1618
 
1605
- function values(iterable) {
1606
- if (iterable) {
1607
- var iteratorMethod = iterable[iteratorSymbol];
1608
-
1609
- if (iteratorMethod) {
1610
- return iteratorMethod.call(iterable);
1611
- }
1619
+ function values(iterable) {
1620
+ if (iterable) {
1621
+ var iteratorMethod = iterable[iteratorSymbol];
1622
+ if (iteratorMethod) {
1623
+ return iteratorMethod.call(iterable);
1624
+ }
1612
1625
 
1613
- if (typeof iterable.next === "function") {
1614
- return iterable;
1615
- }
1626
+ if (typeof iterable.next === "function") {
1627
+ return iterable;
1628
+ }
1616
1629
 
1617
- if (!isNaN(iterable.length)) {
1618
- var i = -1,
1619
- next = function next() {
1620
- while (++i < iterable.length) {
1621
- if (hasOwn.call(iterable, i)) {
1622
- next.value = iterable[i];
1623
- next.done = false;
1624
- return next;
1625
- }
1630
+ if (!isNaN(iterable.length)) {
1631
+ var i = -1, next = function next() {
1632
+ while (++i < iterable.length) {
1633
+ if (hasOwn.call(iterable, i)) {
1634
+ next.value = iterable[i];
1635
+ next.done = false;
1636
+ return next;
1626
1637
  }
1638
+ }
1627
1639
 
1628
- next.value = undefined$1;
1629
- next.done = true;
1630
- return next;
1631
- };
1632
-
1633
- return next.next = next;
1634
- }
1635
- } // Return an iterator with no values.
1636
-
1637
-
1638
- return {
1639
- next: doneResult
1640
- };
1641
- }
1640
+ next.value = undefined$1;
1641
+ next.done = true;
1642
1642
 
1643
- exports.values = values;
1643
+ return next;
1644
+ };
1644
1645
 
1645
- function doneResult() {
1646
- return {
1647
- value: undefined$1,
1648
- done: true
1649
- };
1646
+ return next.next = next;
1647
+ }
1650
1648
  }
1651
1649
 
1652
- Context.prototype = {
1653
- constructor: Context,
1654
- reset: function reset(skipTempReset) {
1655
- this.prev = 0;
1656
- this.next = 0; // Resetting context._sent for legacy support of Babel's
1657
- // function.sent implementation.
1650
+ // Return an iterator with no values.
1651
+ return { next: doneResult };
1652
+ }
1653
+ exports.values = values;
1658
1654
 
1659
- this.sent = this._sent = undefined$1;
1660
- this.done = false;
1661
- this.delegate = null;
1662
- this.method = "next";
1663
- this.arg = undefined$1;
1664
- this.tryEntries.forEach(resetTryEntry);
1655
+ function doneResult() {
1656
+ return { value: undefined$1, done: true };
1657
+ }
1665
1658
 
1666
- if (!skipTempReset) {
1667
- for (var name in this) {
1668
- // Not sure about the optimal order of these conditions:
1669
- if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
1670
- this[name] = undefined$1;
1671
- }
1659
+ Context.prototype = {
1660
+ constructor: Context,
1661
+
1662
+ reset: function(skipTempReset) {
1663
+ this.prev = 0;
1664
+ this.next = 0;
1665
+ // Resetting context._sent for legacy support of Babel's
1666
+ // function.sent implementation.
1667
+ this.sent = this._sent = undefined$1;
1668
+ this.done = false;
1669
+ this.delegate = null;
1670
+
1671
+ this.method = "next";
1672
+ this.arg = undefined$1;
1673
+
1674
+ this.tryEntries.forEach(resetTryEntry);
1675
+
1676
+ if (!skipTempReset) {
1677
+ for (var name in this) {
1678
+ // Not sure about the optimal order of these conditions:
1679
+ if (name.charAt(0) === "t" &&
1680
+ hasOwn.call(this, name) &&
1681
+ !isNaN(+name.slice(1))) {
1682
+ this[name] = undefined$1;
1672
1683
  }
1673
1684
  }
1674
- },
1675
- stop: function stop() {
1676
- this.done = true;
1677
- var rootEntry = this.tryEntries[0];
1678
- var rootRecord = rootEntry.completion;
1685
+ }
1686
+ },
1679
1687
 
1680
- if (rootRecord.type === "throw") {
1681
- throw rootRecord.arg;
1682
- }
1688
+ stop: function() {
1689
+ this.done = true;
1683
1690
 
1684
- return this.rval;
1685
- },
1686
- dispatchException: function dispatchException(exception) {
1687
- if (this.done) {
1688
- throw exception;
1689
- }
1691
+ var rootEntry = this.tryEntries[0];
1692
+ var rootRecord = rootEntry.completion;
1693
+ if (rootRecord.type === "throw") {
1694
+ throw rootRecord.arg;
1695
+ }
1690
1696
 
1691
- var context = this;
1697
+ return this.rval;
1698
+ },
1692
1699
 
1693
- function handle(loc, caught) {
1694
- record.type = "throw";
1695
- record.arg = exception;
1696
- context.next = loc;
1700
+ dispatchException: function(exception) {
1701
+ if (this.done) {
1702
+ throw exception;
1703
+ }
1697
1704
 
1698
- if (caught) {
1699
- // If the dispatched exception was caught by a catch block,
1700
- // then let that catch block handle the exception normally.
1701
- context.method = "next";
1702
- context.arg = undefined$1;
1703
- }
1705
+ var context = this;
1706
+ function handle(loc, caught) {
1707
+ record.type = "throw";
1708
+ record.arg = exception;
1709
+ context.next = loc;
1704
1710
 
1705
- return !!caught;
1711
+ if (caught) {
1712
+ // If the dispatched exception was caught by a catch block,
1713
+ // then let that catch block handle the exception normally.
1714
+ context.method = "next";
1715
+ context.arg = undefined$1;
1706
1716
  }
1707
1717
 
1708
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1709
- var entry = this.tryEntries[i];
1710
- var record = entry.completion;
1718
+ return !! caught;
1719
+ }
1711
1720
 
1712
- if (entry.tryLoc === "root") {
1713
- // Exception thrown outside of any try block that could handle
1714
- // it, so set the completion value of the entire function to
1715
- // throw the exception.
1716
- return handle("end");
1717
- }
1721
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1722
+ var entry = this.tryEntries[i];
1723
+ var record = entry.completion;
1718
1724
 
1719
- if (entry.tryLoc <= this.prev) {
1720
- var hasCatch = hasOwn.call(entry, "catchLoc");
1721
- var hasFinally = hasOwn.call(entry, "finallyLoc");
1725
+ if (entry.tryLoc === "root") {
1726
+ // Exception thrown outside of any try block that could handle
1727
+ // it, so set the completion value of the entire function to
1728
+ // throw the exception.
1729
+ return handle("end");
1730
+ }
1722
1731
 
1723
- if (hasCatch && hasFinally) {
1724
- if (this.prev < entry.catchLoc) {
1725
- return handle(entry.catchLoc, true);
1726
- } else if (this.prev < entry.finallyLoc) {
1727
- return handle(entry.finallyLoc);
1728
- }
1729
- } else if (hasCatch) {
1730
- if (this.prev < entry.catchLoc) {
1731
- return handle(entry.catchLoc, true);
1732
- }
1733
- } else if (hasFinally) {
1734
- if (this.prev < entry.finallyLoc) {
1735
- return handle(entry.finallyLoc);
1736
- }
1737
- } else {
1738
- throw new Error("try statement without catch or finally");
1732
+ if (entry.tryLoc <= this.prev) {
1733
+ var hasCatch = hasOwn.call(entry, "catchLoc");
1734
+ var hasFinally = hasOwn.call(entry, "finallyLoc");
1735
+
1736
+ if (hasCatch && hasFinally) {
1737
+ if (this.prev < entry.catchLoc) {
1738
+ return handle(entry.catchLoc, true);
1739
+ } else if (this.prev < entry.finallyLoc) {
1740
+ return handle(entry.finallyLoc);
1739
1741
  }
1740
- }
1741
- }
1742
- },
1743
- abrupt: function abrupt(type, arg) {
1744
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1745
- var entry = this.tryEntries[i];
1746
1742
 
1747
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
1748
- var finallyEntry = entry;
1749
- break;
1743
+ } else if (hasCatch) {
1744
+ if (this.prev < entry.catchLoc) {
1745
+ return handle(entry.catchLoc, true);
1746
+ }
1747
+
1748
+ } else if (hasFinally) {
1749
+ if (this.prev < entry.finallyLoc) {
1750
+ return handle(entry.finallyLoc);
1751
+ }
1752
+
1753
+ } else {
1754
+ throw new Error("try statement without catch or finally");
1750
1755
  }
1751
1756
  }
1757
+ }
1758
+ },
1752
1759
 
1753
- if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
1754
- // Ignore the finally entry if control is not jumping to a
1755
- // location outside the try/catch block.
1756
- finallyEntry = null;
1760
+ abrupt: function(type, arg) {
1761
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1762
+ var entry = this.tryEntries[i];
1763
+ if (entry.tryLoc <= this.prev &&
1764
+ hasOwn.call(entry, "finallyLoc") &&
1765
+ this.prev < entry.finallyLoc) {
1766
+ var finallyEntry = entry;
1767
+ break;
1757
1768
  }
1769
+ }
1758
1770
 
1759
- var record = finallyEntry ? finallyEntry.completion : {};
1760
- record.type = type;
1761
- record.arg = arg;
1771
+ if (finallyEntry &&
1772
+ (type === "break" ||
1773
+ type === "continue") &&
1774
+ finallyEntry.tryLoc <= arg &&
1775
+ arg <= finallyEntry.finallyLoc) {
1776
+ // Ignore the finally entry if control is not jumping to a
1777
+ // location outside the try/catch block.
1778
+ finallyEntry = null;
1779
+ }
1762
1780
 
1763
- if (finallyEntry) {
1764
- this.method = "next";
1765
- this.next = finallyEntry.finallyLoc;
1766
- return ContinueSentinel;
1767
- }
1781
+ var record = finallyEntry ? finallyEntry.completion : {};
1782
+ record.type = type;
1783
+ record.arg = arg;
1768
1784
 
1769
- return this.complete(record);
1770
- },
1771
- complete: function complete(record, afterLoc) {
1772
- if (record.type === "throw") {
1773
- throw record.arg;
1774
- }
1785
+ if (finallyEntry) {
1786
+ this.method = "next";
1787
+ this.next = finallyEntry.finallyLoc;
1788
+ return ContinueSentinel;
1789
+ }
1775
1790
 
1776
- if (record.type === "break" || record.type === "continue") {
1777
- this.next = record.arg;
1778
- } else if (record.type === "return") {
1779
- this.rval = this.arg = record.arg;
1780
- this.method = "return";
1781
- this.next = "end";
1782
- } else if (record.type === "normal" && afterLoc) {
1783
- this.next = afterLoc;
1784
- }
1791
+ return this.complete(record);
1792
+ },
1785
1793
 
1786
- return ContinueSentinel;
1787
- },
1788
- finish: function finish(finallyLoc) {
1789
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1790
- var entry = this.tryEntries[i];
1794
+ complete: function(record, afterLoc) {
1795
+ if (record.type === "throw") {
1796
+ throw record.arg;
1797
+ }
1791
1798
 
1792
- if (entry.finallyLoc === finallyLoc) {
1793
- this.complete(entry.completion, entry.afterLoc);
1794
- resetTryEntry(entry);
1795
- return ContinueSentinel;
1796
- }
1797
- }
1798
- },
1799
- "catch": function _catch(tryLoc) {
1800
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1801
- var entry = this.tryEntries[i];
1799
+ if (record.type === "break" ||
1800
+ record.type === "continue") {
1801
+ this.next = record.arg;
1802
+ } else if (record.type === "return") {
1803
+ this.rval = this.arg = record.arg;
1804
+ this.method = "return";
1805
+ this.next = "end";
1806
+ } else if (record.type === "normal" && afterLoc) {
1807
+ this.next = afterLoc;
1808
+ }
1802
1809
 
1803
- if (entry.tryLoc === tryLoc) {
1804
- var record = entry.completion;
1810
+ return ContinueSentinel;
1811
+ },
1805
1812
 
1806
- if (record.type === "throw") {
1807
- var thrown = record.arg;
1808
- resetTryEntry(entry);
1809
- }
1813
+ finish: function(finallyLoc) {
1814
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1815
+ var entry = this.tryEntries[i];
1816
+ if (entry.finallyLoc === finallyLoc) {
1817
+ this.complete(entry.completion, entry.afterLoc);
1818
+ resetTryEntry(entry);
1819
+ return ContinueSentinel;
1820
+ }
1821
+ }
1822
+ },
1810
1823
 
1811
- return thrown;
1824
+ "catch": function(tryLoc) {
1825
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1826
+ var entry = this.tryEntries[i];
1827
+ if (entry.tryLoc === tryLoc) {
1828
+ var record = entry.completion;
1829
+ if (record.type === "throw") {
1830
+ var thrown = record.arg;
1831
+ resetTryEntry(entry);
1812
1832
  }
1813
- } // The context.catch method must only be called with a location
1814
- // argument that corresponds to a known catch block.
1815
-
1833
+ return thrown;
1834
+ }
1835
+ }
1816
1836
 
1817
- throw new Error("illegal catch attempt");
1818
- },
1819
- delegateYield: function delegateYield(iterable, resultName, nextLoc) {
1820
- this.delegate = {
1821
- iterator: values(iterable),
1822
- resultName: resultName,
1823
- nextLoc: nextLoc
1824
- };
1837
+ // The context.catch method must only be called with a location
1838
+ // argument that corresponds to a known catch block.
1839
+ throw new Error("illegal catch attempt");
1840
+ },
1825
1841
 
1826
- if (this.method === "next") {
1827
- // Deliberately forget the last sent value so that we don't
1828
- // accidentally pass it on to the delegate.
1829
- this.arg = undefined$1;
1830
- }
1842
+ delegateYield: function(iterable, resultName, nextLoc) {
1843
+ this.delegate = {
1844
+ iterator: values(iterable),
1845
+ resultName: resultName,
1846
+ nextLoc: nextLoc
1847
+ };
1831
1848
 
1832
- return ContinueSentinel;
1849
+ if (this.method === "next") {
1850
+ // Deliberately forget the last sent value so that we don't
1851
+ // accidentally pass it on to the delegate.
1852
+ this.arg = undefined$1;
1833
1853
  }
1834
- }; // Regardless of whether this script is executing as a CommonJS module
1835
- // or not, return the runtime object so that we can declare the variable
1836
- // regeneratorRuntime in the outer scope, which allows this module to be
1837
- // injected easily by `bin/regenerator --include-runtime script.js`.
1838
1854
 
1839
- return exports;
1840
- }( // If this script is executing as a CommonJS module, use module.exports
1855
+ return ContinueSentinel;
1856
+ }
1857
+ };
1858
+
1859
+ // Regardless of whether this script is executing as a CommonJS module
1860
+ // or not, return the runtime object so that we can declare the variable
1861
+ // regeneratorRuntime in the outer scope, which allows this module to be
1862
+ // injected easily by `bin/regenerator --include-runtime script.js`.
1863
+ return exports;
1864
+
1865
+ }(
1866
+ // If this script is executing as a CommonJS module, use module.exports
1841
1867
  // as the regeneratorRuntime namespace. Otherwise create a new empty
1842
1868
  // object. Either way, the resulting object will be used to initialize
1843
1869
  // the regeneratorRuntime variable at the top of this file.
1844
- module.exports );
1845
-
1846
- try {
1847
- regeneratorRuntime = runtime;
1848
- } catch (accidentalStrictMode) {
1849
- // This module should not be running in strict mode, so the above
1850
- // assignment should always work unless something is misconfigured. Just
1851
- // in case runtime.js accidentally runs in strict mode, we can escape
1852
- // strict mode using a global Function call. This could conceivably fail
1853
- // if a Content Security Policy forbids using Function, but in that case
1854
- // the proper solution is to fix the accidental strict mode problem. If
1855
- // you've misconfigured your bundler to force strict mode and applied a
1856
- // CSP to forbid Function, and you're not willing to fix either of those
1857
- // problems, please detail your unique predicament in a GitHub issue.
1870
+ module.exports
1871
+ ));
1872
+
1873
+ try {
1874
+ regeneratorRuntime = runtime;
1875
+ } catch (accidentalStrictMode) {
1876
+ // This module should not be running in strict mode, so the above
1877
+ // assignment should always work unless something is misconfigured. Just
1878
+ // in case runtime.js accidentally runs in strict mode, in modern engines
1879
+ // we can explicitly access globalThis. In older engines we can escape
1880
+ // strict mode using a global Function call. This could conceivably fail
1881
+ // if a Content Security Policy forbids using Function, but in that case
1882
+ // the proper solution is to fix the accidental strict mode problem. If
1883
+ // you've misconfigured your bundler to force strict mode and applied a
1884
+ // CSP to forbid Function, and you're not willing to fix either of those
1885
+ // problems, please detail your unique predicament in a GitHub issue.
1886
+ if (typeof globalThis === "object") {
1887
+ globalThis.regeneratorRuntime = runtime;
1888
+ } else {
1858
1889
  Function("r", "regeneratorRuntime = r")(runtime);
1859
1890
  }
1891
+ }
1860
1892
  });
1861
1893
 
1862
1894
  /* eslint-disable you-dont-need-lodash-underscore/find */
@@ -3403,37 +3435,11 @@ function UrlHyperlink(props) {
3403
3435
  var sdk = useSdkContext();
3404
3436
  var uri = props.element.data.uri;
3405
3437
 
3406
- function handleClick(_x) {
3407
- return _handleClick.apply(this, arguments);
3408
- }
3409
-
3410
- function _handleClick() {
3411
- _handleClick = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(event) {
3412
- return runtime_1.wrap(function _callee$(_context) {
3413
- while (1) {
3414
- switch (_context.prev = _context.next) {
3415
- case 0:
3416
- event.preventDefault();
3417
- event.stopPropagation();
3418
-
3419
- if (editor) {
3420
- _context.next = 4;
3421
- break;
3422
- }
3423
-
3424
- return _context.abrupt("return");
3425
-
3426
- case 4:
3427
- addOrEditLink(editor, sdk);
3428
-
3429
- case 5:
3430
- case "end":
3431
- return _context.stop();
3432
- }
3433
- }
3434
- }, _callee);
3435
- }));
3436
- return _handleClick.apply(this, arguments);
3438
+ function handleClick(event) {
3439
+ event.preventDefault();
3440
+ event.stopPropagation();
3441
+ if (!editor) return;
3442
+ addOrEditLink(editor, sdk);
3437
3443
  }
3438
3444
 
3439
3445
  return /*#__PURE__*/createElement(Tooltip, {
@@ -3458,37 +3464,11 @@ function EntityHyperlink(props) {
3458
3464
  var target = props.element.data.target;
3459
3465
  if (!target) return null;
3460
3466
 
3461
- function handleClick(_x2) {
3462
- return _handleClick2.apply(this, arguments);
3463
- }
3464
-
3465
- function _handleClick2() {
3466
- _handleClick2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(event) {
3467
- return runtime_1.wrap(function _callee2$(_context2) {
3468
- while (1) {
3469
- switch (_context2.prev = _context2.next) {
3470
- case 0:
3471
- event.preventDefault();
3472
- event.stopPropagation();
3473
-
3474
- if (editor) {
3475
- _context2.next = 4;
3476
- break;
3477
- }
3478
-
3479
- return _context2.abrupt("return");
3480
-
3481
- case 4:
3482
- addOrEditLink(editor, sdk);
3483
-
3484
- case 5:
3485
- case "end":
3486
- return _context2.stop();
3487
- }
3488
- }
3489
- }, _callee2);
3490
- }));
3491
- return _handleClick2.apply(this, arguments);
3467
+ function handleClick(event) {
3468
+ event.preventDefault();
3469
+ event.stopPropagation();
3470
+ if (!editor) return;
3471
+ addOrEditLink(editor, sdk);
3492
3472
  }
3493
3473
 
3494
3474
  return /*#__PURE__*/createElement(Tooltip, {
@@ -3501,7 +3481,7 @@ function EntityHyperlink(props) {
3501
3481
  placement: "bottom",
3502
3482
  maxWidth: "auto"
3503
3483
  }, /*#__PURE__*/createElement(TextLink, {
3504
- as: "button",
3484
+ as: "a",
3505
3485
  onClick: handleClick,
3506
3486
  isDisabled: isReadOnly,
3507
3487
  className: styles$c.hyperlink,
@@ -3516,21 +3496,21 @@ function ToolbarHyperlinkButton(props) {
3516
3496
  var sdk = useSdkContext();
3517
3497
 
3518
3498
  function handleClick() {
3519
- return _handleClick3.apply(this, arguments);
3499
+ return _handleClick.apply(this, arguments);
3520
3500
  }
3521
3501
 
3522
- function _handleClick3() {
3523
- _handleClick3 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3() {
3524
- return runtime_1.wrap(function _callee3$(_context3) {
3502
+ function _handleClick() {
3503
+ _handleClick = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
3504
+ return runtime_1.wrap(function _callee$(_context) {
3525
3505
  while (1) {
3526
- switch (_context3.prev = _context3.next) {
3506
+ switch (_context.prev = _context.next) {
3527
3507
  case 0:
3528
3508
  if (editor) {
3529
- _context3.next = 2;
3509
+ _context.next = 2;
3530
3510
  break;
3531
3511
  }
3532
3512
 
3533
- return _context3.abrupt("return");
3513
+ return _context.abrupt("return");
3534
3514
 
3535
3515
  case 2:
3536
3516
  if (isActive) {
@@ -3541,12 +3521,12 @@ function ToolbarHyperlinkButton(props) {
3541
3521
 
3542
3522
  case 3:
3543
3523
  case "end":
3544
- return _context3.stop();
3524
+ return _context.stop();
3545
3525
  }
3546
3526
  }
3547
- }, _callee3);
3527
+ }, _callee);
3548
3528
  }));
3549
- return _handleClick3.apply(this, arguments);
3529
+ return _handleClick.apply(this, arguments);
3550
3530
  }
3551
3531
 
3552
3532
  if (!editor) return null;
@@ -4514,6 +4494,38 @@ function Quote(props) {
4514
4494
  }), props.children);
4515
4495
  }
4516
4496
 
4497
+ function toggleQuote(editor) {
4498
+ if (!editor.selection) return;
4499
+ var isActive = isBlockSelected(editor, BLOCKS.QUOTE);
4500
+ Editor.withoutNormalizing(editor, function () {
4501
+ Transforms.unwrapNodes(editor, {
4502
+ match: function match(node) {
4503
+ return Element.isElement(node) && node.type === BLOCKS.QUOTE;
4504
+ },
4505
+ split: true
4506
+ });
4507
+
4508
+ if (!isActive) {
4509
+ var quote = {
4510
+ type: BLOCKS.QUOTE,
4511
+ data: {},
4512
+ children: []
4513
+ };
4514
+ Transforms.wrapNodes(editor, quote);
4515
+ }
4516
+ });
4517
+ }
4518
+ var onKeyDownToggleQuote = function onKeyDownToggleQuote(editor, plugin) {
4519
+ return function (event) {
4520
+ var hotkey = plugin.options.hotkey;
4521
+
4522
+ if (hotkey && isHotkey(hotkey, event)) {
4523
+ event.preventDefault();
4524
+ toggleQuote(editor);
4525
+ }
4526
+ };
4527
+ };
4528
+
4517
4529
  function createQuotePlugin() {
4518
4530
  var _transform;
4519
4531
 
@@ -4526,7 +4538,7 @@ function createQuotePlugin() {
4526
4538
  hotkey: 'mod+shift+1'
4527
4539
  },
4528
4540
  handlers: {
4529
- onKeyDown: onKeyDownToggleElement
4541
+ onKeyDown: onKeyDownToggleQuote
4530
4542
  },
4531
4543
  deserializeHtml: {
4532
4544
  rules: [{
@@ -4540,31 +4552,6 @@ function createQuotePlugin() {
4540
4552
  };
4541
4553
  }
4542
4554
 
4543
- function toggleQuote(editor) {
4544
- if (!editor.selection) return;
4545
- var isActive = isBlockSelected(editor, BLOCKS.QUOTE);
4546
- Editor.withoutNormalizing(editor, function () {
4547
- Transforms.unwrapNodes(editor, {
4548
- match: function match(node) {
4549
- return Element.isElement(node) && node.type === BLOCKS.QUOTE;
4550
- },
4551
- split: true
4552
- });
4553
- Transforms.setNodes(editor, {
4554
- type: isActive ? BLOCKS.PARAGRAPH : BLOCKS.QUOTE
4555
- });
4556
-
4557
- if (!isActive) {
4558
- var quote = {
4559
- type: BLOCKS.QUOTE,
4560
- data: {},
4561
- children: []
4562
- };
4563
- Transforms.wrapNodes(editor, quote);
4564
- }
4565
- });
4566
- }
4567
-
4568
4555
  function ToolbarQuoteButton(props) {
4569
4556
  var editor = useContentfulEditor();
4570
4557