@pie-lib/editable-html 7.17.8 → 7.17.12

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.
@@ -19,6 +19,7 @@ export class EditorAndToolbar extends React.Component {
19
19
  onChange: PropTypes.func.isRequired,
20
20
  onDone: PropTypes.func.isRequired,
21
21
  onDataChange: PropTypes.func,
22
+ toolbarRef: PropTypes.func,
22
23
  focusedNode: SlatePropTypes.node,
23
24
  readOnly: PropTypes.bool,
24
25
  disableUnderline: PropTypes.bool,
@@ -54,7 +55,8 @@ export class EditorAndToolbar extends React.Component {
54
55
  disableUnderline,
55
56
  pluginProps,
56
57
  toolbarOpts,
57
- onDataChange
58
+ onDataChange,
59
+ toolbarRef
58
60
  } = this.props;
59
61
 
60
62
  const inFocus = value.isFocused || (focusedNode !== null && focusedNode !== undefined);
@@ -95,6 +97,7 @@ export class EditorAndToolbar extends React.Component {
95
97
  onChange={onChange}
96
98
  onDone={onDone}
97
99
  onDataChange={onDataChange}
100
+ toolbarRef={toolbarRef}
98
101
  pluginProps={pluginProps}
99
102
  toolbarOpts={toolbarOpts}
100
103
  />
@@ -43,6 +43,7 @@ export class Toolbar extends React.Component {
43
43
  plugin: PropTypes.object,
44
44
  onImageClick: PropTypes.func,
45
45
  onDone: PropTypes.func.isRequired,
46
+ toolbarRef: PropTypes.func.isRequired,
46
47
  classes: PropTypes.object.isRequired,
47
48
  isFocused: PropTypes.bool,
48
49
  autoWidth: PropTypes.bool,
@@ -52,6 +53,7 @@ export class Toolbar extends React.Component {
52
53
  position: PropTypes.oneOf(['bottom', 'top']),
53
54
  alignment: PropTypes.oneOf(['left', 'right']),
54
55
  alwaysVisible: PropTypes.bool,
56
+ ref: PropTypes.obj,
55
57
  showDone: PropTypes.bool
56
58
  }),
57
59
  onDataChange: PropTypes.func
@@ -133,7 +135,8 @@ export class Toolbar extends React.Component {
133
135
  autoWidth,
134
136
  onChange,
135
137
  isFocused,
136
- onDone
138
+ onDone,
139
+ toolbarRef
137
140
  } = this.props;
138
141
 
139
142
  const node = findSingleNode(value);
@@ -223,7 +226,7 @@ export class Toolbar extends React.Component {
223
226
  });
224
227
 
225
228
  return (
226
- <div className={names} style={extraStyles} onClick={this.onClick}>
229
+ <div className={names} style={extraStyles} onClick={this.onClick} ref={toolbarRef}>
227
230
  {CustomToolbar ? (
228
231
  <CustomToolbar
229
232
  node={node}
@@ -58,7 +58,7 @@ export const parseStyleString = s => {
58
58
  return result;
59
59
  };
60
60
 
61
- export const reactAttributes = o => toStyleObject(o, { camelize: true });
61
+ export const reactAttributes = o => toStyleObject(o, { camelize: true, addUnits: false });
62
62
 
63
63
  const attributesToMap = el => (acc, attribute) => {
64
64
  const value = el.getAttribute(attribute);