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