smartrte-react 0.2.7 → 0.2.8

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.
@@ -3419,7 +3419,24 @@ export function ClassicEditor({ value, onChange, placeholder = "Type here…", m
3419
3419
  background: "var(--srte-bg)",
3420
3420
  color: "var(--srte-text)",
3421
3421
  boxSizing: "border-box"
3422
- }, children: [_jsxs("div", { onMouseDown: preserveToolbarMouseDown, style: {
3422
+ }, children: [_jsxs("div", { "aria-disabled": readOnly, onMouseDown: (event) => {
3423
+ if (readOnly) {
3424
+ event.preventDefault();
3425
+ event.stopPropagation();
3426
+ return;
3427
+ }
3428
+ preserveToolbarMouseDown(event);
3429
+ }, onClick: (event) => {
3430
+ if (!readOnly)
3431
+ return;
3432
+ event.preventDefault();
3433
+ event.stopPropagation();
3434
+ }, onKeyDown: (event) => {
3435
+ if (!readOnly)
3436
+ return;
3437
+ event.preventDefault();
3438
+ event.stopPropagation();
3439
+ }, style: {
3423
3440
  display: "flex",
3424
3441
  flexWrap: "wrap",
3425
3442
  maxWidth: "100%",
@@ -3430,6 +3447,9 @@ export function ClassicEditor({ value, onChange, placeholder = "Type here…", m
3430
3447
  position: "sticky",
3431
3448
  top: 0,
3432
3449
  zIndex: 1,
3450
+ opacity: readOnly ? 0.55 : 1,
3451
+ pointerEvents: readOnly ? "none" : "auto",
3452
+ userSelect: readOnly ? "none" : undefined,
3433
3453
  }, children: [media && (_jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", multiple: true, style: { display: "none" }, onChange: (e) => {
3434
3454
  const list = e.currentTarget.files;
3435
3455
  if (list && list.length) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smartrte-react",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "A powerful, feature-rich Rich Text Editor for React with support for tables, mathematical formulas (LaTeX/KaTeX), and media management",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",