sheet-happens 0.0.11 → 0.0.13

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.
package/dist/index.d.ts CHANGED
@@ -51,6 +51,7 @@ export interface SheetProps {
51
51
  onChange?: (changes: Array<Change>) => void;
52
52
  onCellWidthChange?: (index: number, value: number) => void;
53
53
  onCellHeightChange?: (index: number, value: number) => void;
54
+ onScrollChange?: (scrollX: number, scrolLY: number) => void;
54
55
  }
55
56
  export interface Style {
56
57
  color?: string;
package/dist/index.js CHANGED
@@ -1052,12 +1052,12 @@ function Sheet(props) {
1052
1052
  var clipboardData = e.clipboardData || window.clipboardData;
1053
1053
  var types = clipboardData.types;
1054
1054
 
1055
- if (types.includes('text/html')) {
1056
- var pastedHtml = clipboardData.getData('text/html');
1057
- parsePastedHtml(pastedHtml);
1058
- } else if (types.includes('text/plain')) {
1055
+ if (types.includes('text/rtf') && types.includes('text/plain') || types.includes('text/plain') && !types.includes('text/html')) {
1059
1056
  var text = clipboardData.getData('text/plain');
1060
1057
  parsePastedText(text);
1058
+ } else if (types.includes('text/html')) {
1059
+ var pastedHtml = clipboardData.getData('text/html');
1060
+ parsePastedHtml(pastedHtml);
1061
1061
  }
1062
1062
  };
1063
1063
 
@@ -1319,6 +1319,10 @@ function Sheet(props) {
1319
1319
  x: cellX,
1320
1320
  y: cellY
1321
1321
  });
1322
+
1323
+ if (props.onScrollChange) {
1324
+ props.onScrollChange(cellX, cellY);
1325
+ }
1322
1326
  }
1323
1327
 
1324
1328
  var newMaxScroll = _extends({}, maxScroll);