@contentful/field-editor-rich-text 2.0.0-next.8 → 2.0.0-next.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +410 -0
- package/dist/field-editor-rich-text.cjs.development.js +51 -41
- package/dist/field-editor-rich-text.cjs.development.js.map +1 -1
- package/dist/field-editor-rich-text.cjs.production.min.js +1 -1
- package/dist/field-editor-rich-text.cjs.production.min.js.map +1 -1
- package/dist/field-editor-rich-text.esm.js +51 -41
- package/dist/field-editor-rich-text.esm.js.map +1 -1
- package/dist/test-utils/jsx.d.ts +1 -1
- package/dist/test-utils/mockPlugin.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1273,11 +1273,9 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
1273
1273
|
|
|
1274
1274
|
|
|
1275
1275
|
var IteratorPrototype = {};
|
|
1276
|
-
|
|
1277
|
-
IteratorPrototype[iteratorSymbol] = function () {
|
|
1276
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
1278
1277
|
return this;
|
|
1279
|
-
};
|
|
1280
|
-
|
|
1278
|
+
});
|
|
1281
1279
|
var getProto = Object.getPrototypeOf;
|
|
1282
1280
|
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
1283
1281
|
|
|
@@ -1288,8 +1286,9 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
1288
1286
|
}
|
|
1289
1287
|
|
|
1290
1288
|
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
1291
|
-
GeneratorFunction.prototype =
|
|
1292
|
-
|
|
1289
|
+
GeneratorFunction.prototype = GeneratorFunctionPrototype;
|
|
1290
|
+
define(Gp, "constructor", GeneratorFunctionPrototype);
|
|
1291
|
+
define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
|
|
1293
1292
|
GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the
|
|
1294
1293
|
// Iterator interface in terms of a single ._invoke method.
|
|
1295
1294
|
|
|
@@ -1394,11 +1393,9 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
1394
1393
|
}
|
|
1395
1394
|
|
|
1396
1395
|
defineIteratorMethods(AsyncIterator.prototype);
|
|
1397
|
-
|
|
1398
|
-
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
|
|
1396
|
+
define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
1399
1397
|
return this;
|
|
1400
|
-
};
|
|
1401
|
-
|
|
1398
|
+
});
|
|
1402
1399
|
exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
|
|
1403
1400
|
// AsyncIterator objects; they just return a Promise for the value of
|
|
1404
1401
|
// the final result produced by the iterator.
|
|
@@ -1575,13 +1572,12 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
1575
1572
|
// object to not be returned from this call. This ensures that doesn't happen.
|
|
1576
1573
|
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
1577
1574
|
|
|
1578
|
-
Gp
|
|
1575
|
+
define(Gp, iteratorSymbol, function () {
|
|
1579
1576
|
return this;
|
|
1580
|
-
};
|
|
1581
|
-
|
|
1582
|
-
Gp.toString = function () {
|
|
1577
|
+
});
|
|
1578
|
+
define(Gp, "toString", function () {
|
|
1583
1579
|
return "[object Generator]";
|
|
1584
|
-
};
|
|
1580
|
+
});
|
|
1585
1581
|
|
|
1586
1582
|
function pushTryEntry(locs) {
|
|
1587
1583
|
var entry = {
|
|
@@ -1893,14 +1889,19 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
1893
1889
|
} catch (accidentalStrictMode) {
|
|
1894
1890
|
// This module should not be running in strict mode, so the above
|
|
1895
1891
|
// assignment should always work unless something is misconfigured. Just
|
|
1896
|
-
// in case runtime.js accidentally runs in strict mode,
|
|
1892
|
+
// in case runtime.js accidentally runs in strict mode, in modern engines
|
|
1893
|
+
// we can explicitly access globalThis. In older engines we can escape
|
|
1897
1894
|
// strict mode using a global Function call. This could conceivably fail
|
|
1898
1895
|
// if a Content Security Policy forbids using Function, but in that case
|
|
1899
1896
|
// the proper solution is to fix the accidental strict mode problem. If
|
|
1900
1897
|
// you've misconfigured your bundler to force strict mode and applied a
|
|
1901
1898
|
// CSP to forbid Function, and you're not willing to fix either of those
|
|
1902
1899
|
// problems, please detail your unique predicament in a GitHub issue.
|
|
1903
|
-
|
|
1900
|
+
if (typeof globalThis === "object") {
|
|
1901
|
+
globalThis.regeneratorRuntime = runtime;
|
|
1902
|
+
} else {
|
|
1903
|
+
Function("r", "regeneratorRuntime = r")(runtime);
|
|
1904
|
+
}
|
|
1904
1905
|
}
|
|
1905
1906
|
});
|
|
1906
1907
|
|
|
@@ -5535,32 +5536,15 @@ function createTextPlugin() {
|
|
|
5535
5536
|
}; // When pressing delete instead of backspace
|
|
5536
5537
|
|
|
5537
5538
|
|
|
5538
|
-
var deleteForward = editor.deleteForward
|
|
5539
|
-
|
|
5540
|
-
editor.deleteForward = function (unit) {
|
|
5541
|
-
var entry = getAbove(editor, {
|
|
5542
|
-
match: {
|
|
5543
|
-
type: TEXT_CONTAINERS
|
|
5544
|
-
}
|
|
5545
|
-
});
|
|
5546
|
-
|
|
5547
|
-
if (entry) {
|
|
5548
|
-
var paragraphOrHeading = entry[0],
|
|
5549
|
-
path = entry[1];
|
|
5550
|
-
var isTextEmpty = isAncestorEmpty(editor, paragraphOrHeading); // We ignore paragraphs/headings that are children of ul, ol, blockquote, tables, etc
|
|
5539
|
+
var deleteForward = editor.deleteForward,
|
|
5540
|
+
deleteBackward = editor.deleteBackward;
|
|
5551
5541
|
|
|
5552
|
-
|
|
5542
|
+
editor.deleteBackward = function (unit) {
|
|
5543
|
+
deleteEmptyParagraph(unit, editor, deleteBackward);
|
|
5544
|
+
};
|
|
5553
5545
|
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
at: path
|
|
5557
|
-
});
|
|
5558
|
-
} else {
|
|
5559
|
-
deleteForward(unit);
|
|
5560
|
-
}
|
|
5561
|
-
} else {
|
|
5562
|
-
deleteForward(unit);
|
|
5563
|
-
}
|
|
5546
|
+
editor.deleteForward = function (unit) {
|
|
5547
|
+
deleteEmptyParagraph(unit, editor, deleteForward);
|
|
5564
5548
|
};
|
|
5565
5549
|
|
|
5566
5550
|
return editor;
|
|
@@ -5568,6 +5552,32 @@ function createTextPlugin() {
|
|
|
5568
5552
|
};
|
|
5569
5553
|
}
|
|
5570
5554
|
|
|
5555
|
+
function deleteEmptyParagraph(unit, editor, deleteFunction) {
|
|
5556
|
+
var entry = getAbove(editor, {
|
|
5557
|
+
match: {
|
|
5558
|
+
type: TEXT_CONTAINERS
|
|
5559
|
+
}
|
|
5560
|
+
});
|
|
5561
|
+
|
|
5562
|
+
if (entry) {
|
|
5563
|
+
var paragraphOrHeading = entry[0],
|
|
5564
|
+
path = entry[1];
|
|
5565
|
+
var isTextEmpty = isAncestorEmpty(editor, paragraphOrHeading); // We ignore paragraphs/headings that are children of ul, ol, blockquote, tables, etc
|
|
5566
|
+
|
|
5567
|
+
var isRootLevel = path.length === 1;
|
|
5568
|
+
|
|
5569
|
+
if (isTextEmpty && isRootLevel) {
|
|
5570
|
+
Transforms.removeNodes(editor, {
|
|
5571
|
+
at: path
|
|
5572
|
+
});
|
|
5573
|
+
} else {
|
|
5574
|
+
deleteFunction(unit);
|
|
5575
|
+
}
|
|
5576
|
+
} else {
|
|
5577
|
+
deleteFunction(unit);
|
|
5578
|
+
}
|
|
5579
|
+
}
|
|
5580
|
+
|
|
5571
5581
|
var createTrailingParagraphPlugin = function createTrailingParagraphPlugin() {
|
|
5572
5582
|
return createTrailingBlockPlugin({
|
|
5573
5583
|
options: {
|