Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/lists #704

Merged
merged 42 commits into from
Apr 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
3d2133b
Update GB version.
SergioEstevao Feb 18, 2019
ee9236a
Merge branch 'issue/624-fix-pasting-in-header' into feature/lists
SergioEstevao Mar 4, 2019
0cdad09
Merge branch 'develop' into feature/lists
SergioEstevao Mar 4, 2019
9118be9
Send clientId has a prop down to block edit.
SergioEstevao Mar 5, 2019
e5b668d
Make sure that onEnter is only set if the original prop is set.
SergioEstevao Mar 5, 2019
2f0c5c4
Update Gutenberg reference.
SergioEstevao Mar 5, 2019
79eba00
Merge branch 'develop' into feature/lists
SergioEstevao Mar 5, 2019
c1f01c0
Merge branch 'develop' into feature/lists
SergioEstevao Mar 11, 2019
02fedaf
Update GB reference.
SergioEstevao Mar 20, 2019
889c955
Fix onEnter assignment.
SergioEstevao Mar 20, 2019
a3b2b13
Merge branch 'develop' into feature/lists
SergioEstevao Mar 20, 2019
cee5993
Update GB reference.
SergioEstevao Mar 20, 2019
578c645
Update AztecView to version 1.5.0
SergioEstevao Mar 25, 2019
fc4d46b
Add multiline property to RCTAzteView.
SergioEstevao Mar 25, 2019
8f81590
Update GB reference.
SergioEstevao Mar 26, 2019
d1c93b0
Merge branch 'develop' into feature/lists
SergioEstevao Mar 26, 2019
86af452
Update gutenberg reference.
SergioEstevao Mar 26, 2019
0149325
Update GB reference.
SergioEstevao Mar 26, 2019
750c94f
Update GB reference.
SergioEstevao Mar 27, 2019
d4480ce
Update aztec version being used in iOS.
SergioEstevao Mar 27, 2019
bb83187
Update AztecView to support break on multiline aztec views when doing…
SergioEstevao Mar 27, 2019
0e6c792
Update GB reference.
SergioEstevao Mar 29, 2019
d243e7a
Remove multiline property.
SergioEstevao Mar 29, 2019
6c99072
Merge branch 'develop' into feature/lists
SergioEstevao Mar 29, 2019
67e5621
Update GB reference.
SergioEstevao Mar 29, 2019
10b2258
Do not prettify the HTML when outputting to GB.
SergioEstevao Apr 1, 2019
83b28d5
Get html without any formatting.
SergioEstevao Apr 1, 2019
ad9eb10
Merge branch 'develop' into feature/lists
SergioEstevao Apr 2, 2019
0816ca5
Update GB reference.
SergioEstevao Apr 2, 2019
596163e
Merge branch 'develop' into feature/lists
SergioEstevao Apr 3, 2019
25a4e7f
Merge branch 'develop' into feature/lists
SergioEstevao Apr 4, 2019
7f43ee0
Update GB reference.
SergioEstevao Apr 4, 2019
b7a3f57
Convert to whitespaces.
SergioEstevao Apr 4, 2019
84755cc
Remove unecessary variable.
SergioEstevao Apr 4, 2019
43da5ba
Update GB ref
hypest Apr 4, 2019
fe71487
Merge branch 'develop' into feature/lists
SergioEstevao Apr 4, 2019
26f021e
Update GB reference.
SergioEstevao Apr 5, 2019
595f8ee
Update Aztec version.
SergioEstevao Apr 5, 2019
c6f1589
Update GB reference.
SergioEstevao Apr 5, 2019
ca04558
Merge branch 'develop' into feature/lists
SergioEstevao Apr 5, 2019
f02ba73
Update GB reference.
SergioEstevao Apr 5, 2019
2c0104b
Update bundles.
SergioEstevao Apr 5, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
988 changes: 496 additions & 492 deletions bundle/android/App.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/App.js.map

Large diffs are not rendered by default.

1,000 changes: 502 additions & 498 deletions bundle/ios/App.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/ios/App.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion react-native-aztec/ios/Cartfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "wordpress-mobile/AztecEditor-iOS" ~> 1.5.0
github "wordpress-mobile/AztecEditor-iOS" ~> 1.5.2

2 changes: 1 addition & 1 deletion react-native-aztec/ios/Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "wordpress-mobile/AztecEditor-iOS" "1.5.0"
github "wordpress-mobile/AztecEditor-iOS" "1.5.2"
13 changes: 9 additions & 4 deletions react-native-aztec/ios/RNTAztecView/RCTAztecView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@ class RCTAztecView: Aztec.TextView {
return String(data: data, encoding: .utf8)
}

private func cleanHTML() -> String {
let html = getHTML(prettify: false).replacingOccurrences(of: "\n", with: "")
return html
}

func saveToDisk(image: UIImage) -> URL? {
let fileName = "\(ProcessInfo.processInfo.globallyUniqueString)_file.jpg"

Expand Down Expand Up @@ -217,7 +222,7 @@ class RCTAztecView: Aztec.TextView {
let imagesURLs = self.images(from: pasteboard)

onPaste?([
"currentContent": getHTML(),
"currentContent": cleanHTML(),
"selectionStart": start,
"selectionEnd": end,
"pastedText": text,
Expand Down Expand Up @@ -264,7 +269,7 @@ class RCTAztecView: Aztec.TextView {
let onEnter = onEnter else {
return false
}

let caretData = packCaretDataForRN()
onEnter(caretData)
return true
Expand Down Expand Up @@ -303,7 +308,7 @@ class RCTAztecView: Aztec.TextView {
(start, end) = (end, start)
}

var result: [AnyHashable : Any] = packForRN(getHTML(), withName: "text")
var result: [AnyHashable : Any] = packForRN(getHTML(prettify: false), withName: "text")

result["selectionStart"] = start
result["selectionEnd"] = end
Expand Down Expand Up @@ -482,7 +487,7 @@ class RCTAztecView: Aztec.TextView {

func propagateContentChanges() {
if let onChange = onChange {
let text = packForRN(getHTML(), withName: "text")
let text = packForRN(cleanHTML(), withName: "text")
onChange(text)
}
}
Expand Down
9 changes: 6 additions & 3 deletions react-native-aztec/src/AztecView.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class AztecView extends React.Component {
onSelectionChange: PropTypes.func,
onHTMLContentWithCursor: PropTypes.func,
onCaretVerticalPositionChange: PropTypes.func,
blockType: PropTypes.object,
blockType: PropTypes.object,
...ViewPropTypes, // include the default view properties
}

Expand Down Expand Up @@ -157,10 +157,13 @@ class AztecView extends React.Component {
onContentSizeChange = { this._onContentSizeChange }
onHTMLContentWithCursor = { this._onHTMLContentWithCursor }
onSelectionChange = { this._onSelectionChange }
onEnter = { this._onEnter }
onEnter = { this.props.onEnter && this._onEnter }
// IMPORTANT: the onFocus events are thrown away as these are handled by onPress() in the upper level.
// It's necessary to do this otherwise onFocus may be set by `{...otherProps}` and thus the onPress + onFocus
// combination generate an infinite loop as described in https://github.com/wordpress-mobile/gutenberg-mobile/issues/302
onFocus = { this._onAztecFocus }
onBlur = { this._onBlur }
onBackspace = { this._onBackspace }
onBackspace = { this._onBackspace }
/>
</TouchableWithoutFeedback>
);
Expand Down
1 change: 1 addition & 0 deletions src/block-management/block-holder.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ export class BlockHolder extends React.Component<PropsType, StateType> {
insertBlocksAfter={ this.insertBlocksAfter }
mergeBlocks={ this.mergeBlocks }
onCaretVerticalPositionChange={ this.props.onCaretVerticalPositionChange }
clientId={ this.props.clientId }
SergioEstevao marked this conversation as resolved.
Show resolved Hide resolved
/>
);
}
Expand Down