react-contenteditable 3.3.6 → 3.3.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.
@@ -20,29 +20,31 @@ export default class ContentEditable extends React.Component<Props> {
20
20
  disabled?: boolean | undefined;
21
21
  className?: string | undefined;
22
22
  style?: Object | undefined;
23
+ key?: React.Key | null | undefined;
24
+ id?: string | undefined;
25
+ color?: string | undefined;
26
+ translate?: "yes" | "no" | undefined;
23
27
  hidden?: boolean | undefined;
24
- dir?: string | undefined;
25
28
  slot?: string | undefined;
26
29
  title?: string | undefined;
27
- color?: string | undefined;
28
- translate?: "yes" | "no" | undefined;
30
+ dir?: string | undefined;
31
+ accessKey?: string | undefined;
32
+ draggable?: (boolean | "false" | "true") | undefined;
33
+ lang?: string | undefined;
29
34
  prefix?: string | undefined;
35
+ role?: React.AriaRole | undefined;
30
36
  children?: React.ReactNode;
31
- key?: React.Key | null | undefined;
37
+ inputMode?: "search" | "numeric" | "none" | "url" | "text" | "tel" | "email" | "decimal" | undefined;
38
+ nonce?: string | undefined;
39
+ tabIndex?: number | undefined;
32
40
  defaultChecked?: boolean | undefined;
33
41
  defaultValue?: string | number | readonly string[] | undefined;
34
42
  suppressContentEditableWarning?: boolean | undefined;
35
43
  suppressHydrationWarning?: boolean | undefined;
36
- accessKey?: string | undefined;
37
44
  contextMenu?: string | undefined;
38
- draggable?: (boolean | "false" | "true") | undefined;
39
- id?: string | undefined;
40
- lang?: string | undefined;
41
45
  placeholder?: string | undefined;
42
46
  spellCheck?: (boolean | "false" | "true") | undefined;
43
- tabIndex?: number | undefined;
44
47
  radioGroup?: string | undefined;
45
- role?: React.AriaRole | undefined;
46
48
  about?: string | undefined;
47
49
  datatype?: string | undefined;
48
50
  inlist?: any;
@@ -61,50 +63,49 @@ export default class ContentEditable extends React.Component<Props> {
61
63
  results?: number | undefined;
62
64
  security?: string | undefined;
63
65
  unselectable?: "on" | "off" | undefined;
64
- inputMode?: "search" | "numeric" | "none" | "text" | "tel" | "url" | "email" | "decimal" | undefined;
65
66
  is?: string | undefined;
66
67
  'aria-activedescendant'?: string | undefined;
67
- 'aria-atomic'?: boolean | "false" | "true" | undefined;
68
- 'aria-autocomplete'?: "both" | "none" | "inline" | "list" | undefined;
69
- 'aria-busy'?: boolean | "false" | "true" | undefined;
68
+ 'aria-atomic'?: (boolean | "false" | "true") | undefined;
69
+ 'aria-autocomplete'?: "inline" | "both" | "none" | "list" | undefined;
70
+ 'aria-busy'?: (boolean | "false" | "true") | undefined;
70
71
  'aria-checked'?: boolean | "mixed" | "false" | "true" | undefined;
71
72
  'aria-colcount'?: number | undefined;
72
73
  'aria-colindex'?: number | undefined;
73
74
  'aria-colspan'?: number | undefined;
74
75
  'aria-controls'?: string | undefined;
75
- 'aria-current'?: boolean | "time" | "page" | "false" | "true" | "step" | "location" | "date" | undefined;
76
+ 'aria-current'?: boolean | "location" | "time" | "page" | "false" | "true" | "step" | "date" | undefined;
76
77
  'aria-describedby'?: string | undefined;
77
78
  'aria-details'?: string | undefined;
78
- 'aria-disabled'?: boolean | "false" | "true" | undefined;
79
+ 'aria-disabled'?: (boolean | "false" | "true") | undefined;
79
80
  'aria-dropeffect'?: "link" | "none" | "copy" | "move" | "execute" | "popup" | undefined;
80
81
  'aria-errormessage'?: string | undefined;
81
- 'aria-expanded'?: boolean | "false" | "true" | undefined;
82
+ 'aria-expanded'?: (boolean | "false" | "true") | undefined;
82
83
  'aria-flowto'?: string | undefined;
83
- 'aria-grabbed'?: boolean | "false" | "true" | undefined;
84
- 'aria-haspopup'?: boolean | "dialog" | "menu" | "listbox" | "grid" | "false" | "true" | "tree" | undefined;
85
- 'aria-hidden'?: boolean | "false" | "true" | undefined;
84
+ 'aria-grabbed'?: (boolean | "false" | "true") | undefined;
85
+ 'aria-haspopup'?: boolean | "grid" | "dialog" | "menu" | "listbox" | "false" | "true" | "tree" | undefined;
86
+ 'aria-hidden'?: (boolean | "false" | "true") | undefined;
86
87
  'aria-invalid'?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
87
88
  'aria-keyshortcuts'?: string | undefined;
88
89
  'aria-label'?: string | undefined;
89
90
  'aria-labelledby'?: string | undefined;
90
91
  'aria-level'?: number | undefined;
91
92
  'aria-live'?: "off" | "assertive" | "polite" | undefined;
92
- 'aria-modal'?: boolean | "false" | "true" | undefined;
93
- 'aria-multiline'?: boolean | "false" | "true" | undefined;
94
- 'aria-multiselectable'?: boolean | "false" | "true" | undefined;
93
+ 'aria-modal'?: (boolean | "false" | "true") | undefined;
94
+ 'aria-multiline'?: (boolean | "false" | "true") | undefined;
95
+ 'aria-multiselectable'?: (boolean | "false" | "true") | undefined;
95
96
  'aria-orientation'?: "horizontal" | "vertical" | undefined;
96
97
  'aria-owns'?: string | undefined;
97
98
  'aria-placeholder'?: string | undefined;
98
99
  'aria-posinset'?: number | undefined;
99
100
  'aria-pressed'?: boolean | "mixed" | "false" | "true" | undefined;
100
- 'aria-readonly'?: boolean | "false" | "true" | undefined;
101
+ 'aria-readonly'?: (boolean | "false" | "true") | undefined;
101
102
  'aria-relevant'?: "all" | "text" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
102
- 'aria-required'?: boolean | "false" | "true" | undefined;
103
+ 'aria-required'?: (boolean | "false" | "true") | undefined;
103
104
  'aria-roledescription'?: string | undefined;
104
105
  'aria-rowcount'?: number | undefined;
105
106
  'aria-rowindex'?: number | undefined;
106
107
  'aria-rowspan'?: number | undefined;
107
- 'aria-selected'?: boolean | "false" | "true" | undefined;
108
+ 'aria-selected'?: (boolean | "false" | "true") | undefined;
108
109
  'aria-setsize'?: number | undefined;
109
110
  'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
110
111
  'aria-valuemax'?: number | undefined;
@@ -281,13 +282,13 @@ export default class ContentEditable extends React.Component<Props> {
281
282
  innerRef: PropTypes.Requireable<object>;
282
283
  };
283
284
  }
284
- export declare type ContentEditableEvent = React.SyntheticEvent<any, Event> & {
285
+ export type ContentEditableEvent = React.SyntheticEvent<any, Event> & {
285
286
  target: {
286
287
  value: string;
287
288
  };
288
289
  };
289
- declare type Modify<T, R> = Pick<T, Exclude<keyof T, keyof R>> & R;
290
- declare type DivProps = Modify<JSX.IntrinsicElements["div"], {
290
+ type Modify<T, R> = Pick<T, Exclude<keyof T, keyof R>> & R;
291
+ type DivProps = Modify<JSX.IntrinsicElements["div"], {
291
292
  onChange: ((event: ContentEditableEvent) => void);
292
293
  }>;
293
294
  export interface Props extends DivProps {
@@ -27,7 +27,11 @@ var __assign = (this && this.__assign) || function () {
27
27
  };
28
28
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
29
29
  if (k2 === undefined) k2 = k;
30
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
30
+ var desc = Object.getOwnPropertyDescriptor(m, k);
31
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
32
+ desc = { enumerable: true, get: function() { return m[k]; } };
33
+ }
34
+ Object.defineProperty(o, k2, desc);
31
35
  }) : (function(o, m, k, k2) {
32
36
  if (k2 === undefined) k2 = k;
33
37
  o[k2] = m[k];
@@ -63,7 +67,7 @@ var React = __importStar(require("react"));
63
67
  var fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
64
68
  var PropTypes = __importStar(require("prop-types"));
65
69
  function normalizeHtml(str) {
66
- return str && str.replace(/&nbsp;|\u202F|\u00A0/g, ' ');
70
+ return str && str.replace(/&nbsp;|\u202F|\u00A0/g, ' ').replace(/<br \/>/g, '<br>');
67
71
  }
68
72
  function replaceCaret(el) {
69
73
  // Place the caret at the end of the element
@@ -139,7 +143,7 @@ var ContentEditable = /** @class */ (function (_super) {
139
143
  props.className !== nextProps.className ||
140
144
  props.innerRef !== nextProps.innerRef ||
141
145
  props.placeholder !== nextProps.placeholder ||
142
- !fast_deep_equal_1.default(props.style, nextProps.style);
146
+ !(0, fast_deep_equal_1.default)(props.style, nextProps.style);
143
147
  };
144
148
  ContentEditable.prototype.componentDidUpdate = function () {
145
149
  var el = this.getEl();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-contenteditable",
3
- "version": "3.3.6",
3
+ "version": "3.3.7",
4
4
  "description": "React component representing an element with editable contents",
5
5
  "main": "./lib/react-contenteditable.js",
6
6
  "types": "./lib/react-contenteditable.d.ts",