@squiz/formatted-text-editor 1.68.0 → 1.68.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 1.68.1
4
+
5
+ ### Patch Changes
6
+
7
+ - e2010f7: Fixed pasting into FTE from Microsoft office
8
+
3
9
  ## 1.68.0
4
10
 
5
11
  ### Minor Changes
@@ -38,7 +38,10 @@ const WrappedEditor = () => {
38
38
  const preventImagePaste = (0, react_1.useCallback)((event) => {
39
39
  const { clipboardData } = event;
40
40
  const pastedData = clipboardData?.files[0];
41
- if (pastedData?.type && pastedData?.type.startsWith('image/')) {
41
+ if (pastedData?.type &&
42
+ pastedData?.type.startsWith('image/') &&
43
+ // Still allow paste of any text that came through (Word, etc)
44
+ !clipboardData?.types.includes('text/plain')) {
42
45
  event.preventDefault();
43
46
  }
44
47
  // Allow other paste event handlers to be run.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squiz/formatted-text-editor",
3
- "version": "1.68.0",
3
+ "version": "1.68.1",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "private": false,
@@ -25,7 +25,12 @@ const WrappedEditor = () => {
25
25
  const preventImagePaste = useCallback((event) => {
26
26
  const { clipboardData } = event;
27
27
  const pastedData = clipboardData?.files[0];
28
- if (pastedData?.type && pastedData?.type.startsWith('image/')) {
28
+ if (
29
+ pastedData?.type &&
30
+ pastedData?.type.startsWith('image/') &&
31
+ // Still allow paste of any text that came through (Word, etc)
32
+ !clipboardData?.types.includes('text/plain')
33
+ ) {
29
34
  event.preventDefault();
30
35
  }
31
36