Skip to content

Commit

Permalink
chore(release): 3.109.0 [skip ci]
Browse files Browse the repository at this point in the history
# [3.109.0](v3.108.0...v3.109.0) (2025-01-16)

### Features

* **RTE:** switches spaces with non breaking spaces when setting the value into the UI so quill keeps the correct cursor position ([506c964](506c964))
  • Loading branch information
semantic-release-bot committed Jan 16, 2025
1 parent 506c964 commit 63281ca
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 23 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [3.109.0](https://github.com/ClearC2/grid-form-builder/compare/v3.108.0...v3.109.0) (2025-01-16)


### Features

* **RTE:** switches spaces with non breaking spaces when setting the value into the UI so quill keeps the correct cursor position ([506c964](https://github.com/ClearC2/grid-form-builder/commit/506c96451e199e7f70f986bd3284f3a47f109e16))

# [3.108.0](https://github.com/ClearC2/grid-form-builder/compare/v3.107.2...v3.108.0) (2025-01-16)


Expand Down
27 changes: 16 additions & 11 deletions dist/cjs/Inputs/Richtextarea/Quill.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-sta

var _setTimeout2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set-timeout"));

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

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

var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
Expand Down Expand Up @@ -141,16 +143,19 @@ var ReactQuill = /*#__PURE__*/function (_Component) {
}
});
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setCurrentValueInEditor", function () {
var _this$props2 = _this.props,
value = _this$props2.value,
isFocused = _this$props2.isFocused;
var isFocused = _this.props.isFocused;
var value = _this.props.value;
if (!_this.editor || typeof value === 'undefined') return;
var cursor = 0;

if (isFocused && _this.editor.getSelection(true)) {
cursor = _this.editor.getSelection(true).index; // do not poll the selection if the input is not focused because it will scroll the element into view when you don't want it to - JRA 01/13/25
}

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

_this.editor.clipboard.dangerouslyPasteHTML(value);

if (isFocused) {
Expand Down Expand Up @@ -182,14 +187,14 @@ var ReactQuill = /*#__PURE__*/function (_Component) {
}, {
key: "render",
value: function render() {
var _this$props3 = this.props,
name = _this$props3.name,
onFocus = _this$props3.onFocus,
onBlur = _this$props3.onBlur,
_this$props3$css = _this$props3.css,
css = _this$props3$css === void 0 ? {} : _this$props3$css,
tabIndex = _this$props3.tabIndex,
className = _this$props3.className;
var _this$props2 = this.props,
name = _this$props2.name,
onFocus = _this$props2.onFocus,
onBlur = _this$props2.onBlur,
_this$props2$css = _this$props2.css,
css = _this$props2$css === void 0 ? {} : _this$props2$css,
tabIndex = _this$props2.tabIndex,
className = _this$props2.className;
return /*#__PURE__*/_react.default.createElement("div", {
id: name,
className: className,
Expand Down
26 changes: 15 additions & 11 deletions dist/es/Inputs/Richtextarea/Quill.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va

import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
import _replaceAllInstanceProperty from "@babel/runtime-corejs3/core-js/instance/replace-all";

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

Expand Down Expand Up @@ -112,16 +113,19 @@ export var ReactQuill = /*#__PURE__*/function (_Component) {
});

_defineProperty(_assertThisInitialized(_this), "setCurrentValueInEditor", function () {
var _this$props2 = _this.props,
value = _this$props2.value,
isFocused = _this$props2.isFocused;
var isFocused = _this.props.isFocused;
var value = _this.props.value;
if (!_this.editor || typeof value === 'undefined') return;
var cursor = 0;

if (isFocused && _this.editor.getSelection(true)) {
cursor = _this.editor.getSelection(true).index; // do not poll the selection if the input is not focused because it will scroll the element into view when you don't want it to - JRA 01/13/25
}

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

_this.editor.clipboard.dangerouslyPasteHTML(value);

if (isFocused) {
Expand Down Expand Up @@ -154,14 +158,14 @@ export var ReactQuill = /*#__PURE__*/function (_Component) {
}, {
key: "render",
value: function render() {
var _this$props3 = this.props,
name = _this$props3.name,
onFocus = _this$props3.onFocus,
onBlur = _this$props3.onBlur,
_this$props3$css = _this$props3.css,
css = _this$props3$css === void 0 ? {} : _this$props3$css,
tabIndex = _this$props3.tabIndex,
className = _this$props3.className;
var _this$props2 = this.props,
name = _this$props2.name,
onFocus = _this$props2.onFocus,
onBlur = _this$props2.onBlur,
_this$props2$css = _this$props2.css,
css = _this$props2$css === void 0 ? {} : _this$props2$css,
tabIndex = _this$props2.tabIndex,
className = _this$props2.className;
return /*#__PURE__*/React.createElement("div", {
id: name,
className: className,
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.108.0",
"version": "3.109.0",
"description": "Form Builder built on top of React Grid Layout",
"repository": {
"type": "git",
Expand Down

0 comments on commit 63281ca

Please sign in to comment.