From 522bb3afe80f5b342664c446134ede60a01f3148 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Thu, 16 May 2019 00:06:03 +0100 Subject: [PATCH 01/12] Update GB reference. --- gutenberg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gutenberg b/gutenberg index 761543e9f0..7880a86a65 160000 --- a/gutenberg +++ b/gutenberg @@ -1 +1 @@ -Subproject commit 761543e9f092e04fcdbb32c1d99afd8fb3d11624 +Subproject commit 7880a86a65c1cc351b4b8bb4a42cd1450516b80b From c646a0b775eef01e93295bd3545e54e6e06f8e0a Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Fri, 10 May 2019 17:27:49 +0100 Subject: [PATCH 02/12] Send the backspace event when deleting new lines. --- react-native-aztec/ios/RNTAztecView/RCTAztecView.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift b/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift index ac5c69845c..fe0562022d 100644 --- a/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift +++ b/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift @@ -279,7 +279,7 @@ class RCTAztecView: Aztec.TextView { } private func interceptBackspace() -> Bool { - guard selectedRange.location == 0 && selectedRange.length == 0, + guard isNewLineBeforeSelection() || (selectedRange.location == 0 && selectedRange.length == 0), let onBackspace = onBackspace else { return false } @@ -289,6 +289,13 @@ class RCTAztecView: Aztec.TextView { return true } + private func isNewLineBeforeSelection() -> Bool { + guard let currentLocation = text.indexFromLocation(selectedRange.location) else { + return false + } + + return text.isStartOfParagraph(at: currentLocation) + } override var keyCommands: [UIKeyCommand]? { // Remove defautls Tab and Shift+Tab commands, leaving just Shift+Enter command. return [carriageReturnKeyCommand] From c82ab4c4d8c294e7f99a6ace480bf1d31e69f843 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Thu, 16 May 2019 00:14:42 +0100 Subject: [PATCH 03/12] Update Aztec version. --- react-native-aztec/ios/Cartfile | 2 +- react-native-aztec/ios/Cartfile.resolved | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/react-native-aztec/ios/Cartfile b/react-native-aztec/ios/Cartfile index a15614d01f..960714197a 100644 --- a/react-native-aztec/ios/Cartfile +++ b/react-native-aztec/ios/Cartfile @@ -1 +1 @@ -github "wordpress-mobile/AztecEditor-iOS" "1.6.1" +github "wordpress-mobile/AztecEditor-iOS" "a23d21e1a99128ff6674fccb4b7b27b98119ec4f" diff --git a/react-native-aztec/ios/Cartfile.resolved b/react-native-aztec/ios/Cartfile.resolved index a15614d01f..960714197a 100644 --- a/react-native-aztec/ios/Cartfile.resolved +++ b/react-native-aztec/ios/Cartfile.resolved @@ -1 +1 @@ -github "wordpress-mobile/AztecEditor-iOS" "1.6.1" +github "wordpress-mobile/AztecEditor-iOS" "a23d21e1a99128ff6674fccb4b7b27b98119ec4f" From bf77dda18510d9531d9314071fc513b0210a9be6 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Thu, 16 May 2019 14:25:44 +0100 Subject: [PATCH 04/12] Update Aztec. --- react-native-aztec/ios/Cartfile | 2 +- react-native-aztec/ios/Cartfile.resolved | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/react-native-aztec/ios/Cartfile b/react-native-aztec/ios/Cartfile index 960714197a..8ca3c02b4a 100644 --- a/react-native-aztec/ios/Cartfile +++ b/react-native-aztec/ios/Cartfile @@ -1 +1 @@ -github "wordpress-mobile/AztecEditor-iOS" "a23d21e1a99128ff6674fccb4b7b27b98119ec4f" +github "wordpress-mobile/AztecEditor-iOS" "ab0f86b7c0bb658df6a40654406e70b010d6f25c" diff --git a/react-native-aztec/ios/Cartfile.resolved b/react-native-aztec/ios/Cartfile.resolved index 960714197a..8ca3c02b4a 100644 --- a/react-native-aztec/ios/Cartfile.resolved +++ b/react-native-aztec/ios/Cartfile.resolved @@ -1 +1 @@ -github "wordpress-mobile/AztecEditor-iOS" "a23d21e1a99128ff6674fccb4b7b27b98119ec4f" +github "wordpress-mobile/AztecEditor-iOS" "ab0f86b7c0bb658df6a40654406e70b010d6f25c" From e1c38731f36251fd260d30a22773cd3875db41bd Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Thu, 16 May 2019 14:26:03 +0100 Subject: [PATCH 05/12] Use separator character. --- react-native-aztec/ios/RNTAztecView/RCTAztecView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift b/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift index fe0562022d..54b9ba4cb0 100644 --- a/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift +++ b/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift @@ -183,7 +183,7 @@ class RCTAztecView: Aztec.TextView { } private func cleanHTML() -> String { - let html = getHTML(prettify: false).replacingOccurrences(of: "\n", with: "") + let html = getHTML(prettify: false).replacingOccurrences(of: String(.paragraphSeparator), with: String(.lineSeparator)) return html } From 382f7e788425e22e3b43f4ca2b2871ad49a45b02 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Thu, 16 May 2019 16:36:48 +0100 Subject: [PATCH 06/12] Make sure the HTML goes clean when selection is updated. --- react-native-aztec/ios/RNTAztecView/RCTAztecView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift b/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift index 54b9ba4cb0..f18b528971 100644 --- a/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift +++ b/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift @@ -323,7 +323,7 @@ class RCTAztecView: Aztec.TextView { (start, end) = (end, start) } - var result: [AnyHashable : Any] = packForRN(getHTML(prettify: false), withName: "text") + var result: [AnyHashable : Any] = packForRN(cleanHTML(), withName: "text") result["selectionStart"] = start result["selectionEnd"] = end From e957b6b5b21460661ed2a362c1a1a5ed13fc5c4a Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Thu, 16 May 2019 18:42:32 +0100 Subject: [PATCH 07/12] Update GB reference. --- gutenberg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gutenberg b/gutenberg index 7880a86a65..4ddc19a5e9 160000 --- a/gutenberg +++ b/gutenberg @@ -1 +1 @@ -Subproject commit 7880a86a65c1cc351b4b8bb4a42cd1450516b80b +Subproject commit 4ddc19a5e9f3b949c815c2abc3ef162f446725e9 From 6c56471cccdb3bcb37b39d5e21186fc19d13573a Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Thu, 16 May 2019 23:56:53 +0100 Subject: [PATCH 08/12] =?UTF-8?q?Don=E2=80=99t=20remove=20anything=20from?= =?UTF-8?q?=20the=20HTML.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- react-native-aztec/ios/RNTAztecView/RCTAztecView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift b/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift index f18b528971..d8b82a00ec 100644 --- a/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift +++ b/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift @@ -183,7 +183,7 @@ class RCTAztecView: Aztec.TextView { } private func cleanHTML() -> String { - let html = getHTML(prettify: false).replacingOccurrences(of: String(.paragraphSeparator), with: String(.lineSeparator)) + let html = getHTML(prettify: false) return html } From c76f0c833adef3c97b236e18fe0447132ad2db93 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Thu, 16 May 2019 23:57:04 +0100 Subject: [PATCH 09/12] Update GB reference. --- gutenberg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gutenberg b/gutenberg index 4ddc19a5e9..6321c4bd62 160000 --- a/gutenberg +++ b/gutenberg @@ -1 +1 @@ -Subproject commit 4ddc19a5e9f3b949c815c2abc3ef162f446725e9 +Subproject commit 6321c4bd6202e8fb38e1db38f49cd6b1d9f368c0 From 8022ed380ea35bcb49062aaf35fd530916f761bc Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Fri, 17 May 2019 11:04:14 +0100 Subject: [PATCH 10/12] Update GB reference. --- gutenberg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gutenberg b/gutenberg index 6321c4bd62..f64027c76d 160000 --- a/gutenberg +++ b/gutenberg @@ -1 +1 @@ -Subproject commit 6321c4bd6202e8fb38e1db38f49cd6b1d9f368c0 +Subproject commit f64027c76d5a8d13aa1d0a81d7fd4333022ad05b From bb6a867b4bab35e9e13b07437db78a80689d8728 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Thu, 23 May 2019 10:33:40 +0100 Subject: [PATCH 11/12] Update GB reference. --- gutenberg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gutenberg b/gutenberg index a083778323..1a20e15a61 160000 --- a/gutenberg +++ b/gutenberg @@ -1 +1 @@ -Subproject commit a0837783231e074724b054c161adc21ac87f8b8a +Subproject commit 1a20e15a615ecb344cfb0dd8b614982910240909 From 8e5422d9dcb07375211c9fafa39f0d3affc52d40 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Thu, 23 May 2019 15:12:58 +0100 Subject: [PATCH 12/12] Update to Aztec official release. --- react-native-aztec/ios/Cartfile | 2 +- react-native-aztec/ios/Cartfile.resolved | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/react-native-aztec/ios/Cartfile b/react-native-aztec/ios/Cartfile index 8ca3c02b4a..736f25bc2f 100644 --- a/react-native-aztec/ios/Cartfile +++ b/react-native-aztec/ios/Cartfile @@ -1 +1 @@ -github "wordpress-mobile/AztecEditor-iOS" "ab0f86b7c0bb658df6a40654406e70b010d6f25c" +github "wordpress-mobile/AztecEditor-iOS" "1.6.4" diff --git a/react-native-aztec/ios/Cartfile.resolved b/react-native-aztec/ios/Cartfile.resolved index 8ca3c02b4a..736f25bc2f 100644 --- a/react-native-aztec/ios/Cartfile.resolved +++ b/react-native-aztec/ios/Cartfile.resolved @@ -1 +1 @@ -github "wordpress-mobile/AztecEditor-iOS" "ab0f86b7c0bb658df6a40654406e70b010d6f25c" +github "wordpress-mobile/AztecEditor-iOS" "1.6.4"