Skip to content

Commit

Permalink
chore(release): 3.111.0 [skip ci]
Browse files Browse the repository at this point in the history
# [3.111.0](v3.110.1...v3.111.0) (2025-02-11)

### Bug Fixes

* **rte:** removes tables not created by quill and does not query selection if editor isn't focused ([31acf28](31acf28))

### Features

* **rte:** removes table elements from existing markup, which breaks the original functionality we were going for, but fixes an issue where most tables looked horrible ([436642e](436642e))
  • Loading branch information
semantic-release-bot committed Feb 11, 2025
1 parent 106e686 commit 7c38556
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# [3.111.0](https://github.com/ClearC2/grid-form-builder/compare/v3.110.1...v3.111.0) (2025-02-11)


### Bug Fixes

* **rte:** removes tables not created by quill and does not query selection if editor isn't focused ([31acf28](https://github.com/ClearC2/grid-form-builder/commit/31acf28c89dc053c33c114c8232599745c106cc9))


### Features

* **rte:** removes table elements from existing markup, which breaks the original functionality we were going for, but fixes an issue where most tables looked horrible ([436642e](https://github.com/ClearC2/grid-form-builder/commit/436642e7d88df85cf94deabd14f440d7760b56b0))

## [3.110.1](https://github.com/ClearC2/grid-form-builder/compare/v3.110.0...v3.110.1) (2025-02-04)


Expand Down
21 changes: 20 additions & 1 deletion dist/cjs/Inputs/Richtextarea/Quill.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ var _setTimeout2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-j

var _replaceAll = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/replace-all"));

var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/index-of"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
Expand Down Expand Up @@ -145,16 +147,33 @@ var ReactQuill = /*#__PURE__*/function (_Component) {
var isFocused = _this.props.isFocused;
var value = _this.props.value;
if (!_this.editor || typeof value === 'undefined') return;
var cursor = _this.editor.getSelection(true) ? _this.editor.getSelection(true).index : 0;

if (typeof value === 'string') {
value = (0, _replaceAll.default)(value).call(value, ' <', '&nbsp;<');
value = (0, _replaceAll.default)(value).call(value, ' ', '&nbsp;&nbsp;'); // this fixes an issue where multiple spaces/trailing spaces in the markup are truncated - JRA 01/16/25

if ((0, _indexOf.default)(value).call(value, '<html') > -1) {
// this markup was generated by something else, Quill does not include the html tag - JRA 01/31/25
value = (0, _replaceAll.default)(value).call(value, '<html', '<div'); // replace this reference so the user can use normal tables - JRA 01/31/25

value = (0, _replaceAll.default)(value).call(value, '</html', '</div'); // replace this reference so the user can use normal tables - JRA 01/31/25

value = (0, _replaceAll.default)(value).call(value, '<table', '<div');
value = (0, _replaceAll.default)(value).call(value, '</table', '</div');
value = (0, _replaceAll.default)(value).call(value, '<tbody', '<div style="display: flex; flex-direction: column;"');
value = (0, _replaceAll.default)(value).call(value, '</tbody', '</div');
value = (0, _replaceAll.default)(value).call(value, '<tr', '<div style="display: flex; flex-direction: row;"');
value = (0, _replaceAll.default)(value).call(value, '</tr', '</div');
value = (0, _replaceAll.default)(value).call(value, '<td', '<div style="display: flex; flex-direction: column;"');
value = (0, _replaceAll.default)(value).call(value, '</td', '</div');
}
}

_this.editor.clipboard.dangerouslyPasteHTML(value);

if (isFocused) {
var cursor = _this.editor.getSelection(true) ? _this.editor.getSelection(true).index : 0;

_this.editor.setSelection(cursor);
} else {
_this.editor.blur();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "grid-form-builder",
"version": "3.110.1",
"version": "3.111.0",
"description": "Form Builder built on top of React Grid Layout",
"repository": {
"type": "git",
Expand Down

0 comments on commit 7c38556

Please sign in to comment.