@desynova-digital/components 9.2.5 → 9.2.7

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.
@@ -68,10 +68,10 @@ var RichTextInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
68
68
  };
69
69
  });
70
70
 
71
- /**
72
- *
73
- * @param {*} str
74
- * @returns
71
+ /**
72
+ *
73
+ * @param {*} str
74
+ * @returns
75
75
  */
76
76
  var changeEmToI = function changeEmToI(str) {
77
77
  var updatedStr = str.replace(/\n/g, "").replace(/<br\s*\/?>/gi, "").replace(/<\/?p>/gi, "").replace(/<[/]?em>/g, function (match) {
@@ -268,10 +268,10 @@ var RichTextInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
268
268
  }, errorMessage), maxLength && showLengthCount && quillInstance.current && /*#__PURE__*/_react["default"].createElement(CountWrapper, null, charCount, "/", maxLength));
269
269
  });
270
270
 
271
- /**
272
- *
273
- * @param {*} props
274
- * @returns
271
+ /**
272
+ *
273
+ * @param {*} props
274
+ * @returns
275
275
  */
276
276
  var returnPadding = function returnPadding(props) {
277
277
  var digitCount = props.maxLength.toString().length;
@@ -22,7 +22,7 @@ var _excluded = ["maxLength", "defaultValue", "label", "showLengthCount", "error
22
22
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
23
23
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
24
24
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
25
- var RichTextInputDiv = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n i,\n em {\n font-style: italic;\n }\n strong {\n font-weight: bold;\n }\n .quill-editor-content {\n white-space: pre-wrap; /* Preserve whitespace and line breaks */\n }\n background: transparent;\n font-family: \"SFUIText-Medium\";\n position: relative;\n width: 92%;\n width: ", ";\n margin-bottom: ", ";\n margin-top: ", ";\n\n display: block;\n .ql-container.ql-snow {\n border: none;\n position: relative;\n }\n .ql-editor {\n padding: 0;\n position: relative;\n }\n\n // Custom placeholder styles - this will show the placeholder value from props\n .ql-editor.ql-blank::before {\n color: #999999 !important;\n font-style: normal !important;\n font-family: \"SFUIText-Medium\" !important;\n font-size: 14px !important;\n left: 0 !important;\n right: auto !important;\n opacity: 1 !important;\n visibility: visible !important;\n display: block !important;\n position: absolute !important;\n content: attr(data-placeholder) !important;\n pointer-events: none !important;\n }\n\n // Ensure placeholder is visible even when not focused\n .ql-editor.ql-blank {\n position: relative;\n\n &::before {\n display: block !important;\n opacity: 1 !important;\n visibility: visible !important;\n }\n }\n\n > label {\n color: #999999;\n font-size: 14px;\n font-family: inherit;\n position: absolute;\n pointer-events: none;\n left: 0px;\n top: 5px;\n transition: 0.2s ease all;\n -moz-transition: 0.2s ease all;\n -webkit-transition: 0.2s ease all;\n }\n > div:focus ~ label {\n top: -10px;\n left: 0px;\n font-size: 10px;\n color: #999999;\n text-transform: capitalize;\n }\n > div ~ label.floaton {\n top: -10px;\n left: 0px;\n font-size: 10px;\n color: #999999;\n text-transform: capitalize;\n }\n"])), function (props) {
25
+ var RichTextInputDiv = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n i,\n em {\n font-style: italic;\n }\n strong {\n font-weight: bold;\n }\n .quill-editor-content {\n white-space: pre-wrap; /* Preserve whitespace and line breaks */\n }\n background: transparent;\n font-family: \"SFUIText-Regular\";\n position: relative;\n width: 92%;\n width: ", ";\n margin-bottom: ", ";\n margin-top: ", ";\n\n display: block;\n .ql-container.ql-snow {\n border: none;\n position: relative;\n }\n .ql-editor {\n padding: 0;\n position: relative;\n }\n\n // Custom placeholder styles - this will show the placeholder value from props\n .ql-editor.ql-blank::before {\n color: #999999 !important;\n font-style: normal !important;\n font-family: \"SFUIText-Regular\" !important;\n font-size: 13px !important;\n left: 0 !important;\n right: auto !important;\n opacity: 1 !important;\n visibility: visible !important;\n display: block !important;\n position: absolute !important;\n content: attr(data-placeholder) !important;\n pointer-events: none !important;\n }\n\n // Ensure placeholder is visible even when not focused\n .ql-editor.ql-blank {\n position: relative;\n\n &::before {\n display: block !important;\n opacity: 1 !important;\n visibility: visible !important;\n }\n }\n\n > label {\n color: #999999;\n font-size: 14px;\n font-family: inherit;\n position: absolute;\n pointer-events: none;\n left: 0px;\n top: 5px;\n transition: 0.2s ease all;\n -moz-transition: 0.2s ease all;\n -webkit-transition: 0.2s ease all;\n }\n > div:focus ~ label {\n top: -10px;\n left: 0px;\n font-size: 10px;\n color: #999999;\n text-transform: capitalize;\n }\n > div ~ label.floaton {\n top: -10px;\n left: 0px;\n font-size: 10px;\n color: #999999;\n text-transform: capitalize;\n }\n"])), function (props) {
26
26
  return props.sleek === "sleek" ? "100%" : "92%";
27
27
  }, function (props) {
28
28
  return props.sleek === "sleek" ? "" : "10px";
@@ -93,10 +93,10 @@ var RichTextInputV2 = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
93
93
  };
94
94
  });
95
95
 
96
- /**
97
- *
98
- * @param {*} str
99
- * @returns
96
+ /**
97
+ *
98
+ * @param {*} str
99
+ * @returns
100
100
  */
101
101
  var changeEmToI = function changeEmToI(str) {
102
102
  var updatedStr = str.replace(/\n/g, "").replace(/<br\s*\/?>/gi, "").replace(/<\/?p>/gi, "").replace(/<[/]?em>/g, function (match) {
@@ -112,6 +112,13 @@ var RichTextInputV2 = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
112
112
  // Initialize quill
113
113
  (0, _react.useEffect)(function () {
114
114
  if (!(quillInstance !== null && quillInstance !== void 0 && quillInstance.current)) {
115
+ // Get the keyboard module and remove list autofill binding
116
+ var Keyboard = _quill["default"]["import"]("modules/keyboard");
117
+
118
+ // Remove the list autofill binding
119
+ if (Keyboard && Keyboard.DEFAULTS && Keyboard.DEFAULTS.bindings) {
120
+ delete Keyboard.DEFAULTS.bindings["list autofill"];
121
+ }
115
122
  var quill = new _quill["default"](quillRef.current, {
116
123
  theme: "snow",
117
124
  placeholder: placeholder,
@@ -152,11 +159,13 @@ var RichTextInputV2 = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
152
159
  }
153
160
  }
154
161
  });
155
-
156
- // Ensure plain text is pasted instead of formatted content
157
- quill.clipboard.addMatcher(Node.ELEMENT_NODE, function (node, delta) {
158
- var plainText = node.innerText || node.textContent; // Extract plain text
159
- return new _quillDelta["default"]().insert(plainText); // Insert plain text without formatting
162
+ quill.root.addEventListener("paste", function (e) {
163
+ e.preventDefault();
164
+ var text = (e.clipboardData || window.clipboardData).getData("text/plain");
165
+ var range = quill.getSelection();
166
+ if (range) {
167
+ quill.insertText(range.index, text);
168
+ }
160
169
  });
161
170
  quillInstance.current = quill;
162
171
  if (quill.root) {
@@ -281,10 +290,10 @@ var RichTextInputV2 = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
281
290
  }, errorMessage), maxLength && showLengthCount && quillInstance.current && /*#__PURE__*/_react["default"].createElement(CountWrapper, null, charCount, "/", maxLength));
282
291
  });
283
292
 
284
- /**
285
- *
286
- * @param {*} props
287
- * @returns
293
+ /**
294
+ *
295
+ * @param {*} props
296
+ * @returns
288
297
  */
289
298
  var returnPadding = function returnPadding(props) {
290
299
  if (props.sleek = "sleek") {
@@ -308,7 +317,7 @@ var returnPadding = function returnPadding(props) {
308
317
  return "7px 0px 2px 0px";
309
318
  }
310
319
  };
311
- var RichTextEditorContainer = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n max-height: 48px;\n overflow-y: scroll;\n ::-webkit-scrollbar {\n width: 0;\n background: transparent;\n }\n white-space: nowrap;\n width: 100%;\n text-wrap: wrap;\n box-sizing: border-box;\n font-family: \"SFUIText-Medium\";\n font-size: 14px;\n color: ", ";\n border-bottom: ", ";\n\n display: inline-block;\n position: relative;\n padding: ", ";\n &:hover {\n border-color: ", ";\n }\n\n &:focus-within {\n border-color: ", ";\n }\n\n &::placeholder {\n color: ", ";\n opacity: ", ";\n transition: 0.2s ease all;\n }\n\n &:focus-within::placeholder {\n color: ", ";\n opacity: ", ";\n }\n"])), function (props) {
320
+ var RichTextEditorContainer = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n max-height: 48px;\n overflow-y: scroll;\n ::-webkit-scrollbar {\n width: 0;\n background: transparent;\n }\n white-space: nowrap;\n width: 100%;\n text-wrap: wrap;\n box-sizing: border-box;\n font-family: \"SFUIText-Regular\";\n font-size: 13px;\n color: ", ";\n border-bottom: ", ";\n\n display: inline-block;\n position: relative;\n padding: ", ";\n &:hover {\n border-color: ", ";\n }\n\n &:focus-within {\n border-color: ", ";\n }\n\n &::placeholder {\n color: ", ";\n opacity: ", ";\n transition: 0.2s ease all;\n }\n\n &:focus-within::placeholder {\n color: ", ";\n opacity: ", ";\n }\n"])), function (props) {
312
321
  return props.theme === "light" ? _tokens.colors.light.inputCommon.color : _tokens.colors.dark.inputCommon.color;
313
322
  }, function (props) {
314
323
  return !props.hideBorder ? props.theme === "light" ? _tokens.colors.light.inputCommon.color : _tokens.colors.dark.inputCommon.color : "none";
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@desynova-digital/components",
3
- "version": "9.2.5",
3
+ "version": "9.2.7",
4
4
  "description": "Components for Desynova Digital",
5
5
  "main": "index.js",
6
6
  "author": "desynova-digital",
7
7
  "license": "MIT",
8
8
  "repository": "desynova-digital",
9
9
  "dependencies": {
10
- "@desynova-digital/tokens": "9.2.5",
10
+ "@desynova-digital/tokens": "9.2.7",
11
11
  "prop-types": "^15.7.2",
12
12
  "styled-components": "^4.3.2"
13
13
  },