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

Add @-mention support #2163

Merged
merged 38 commits into from
May 20, 2020
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
82b609f
Add empty mention implementation for demo app
mchowning Apr 16, 2020
2cbc40a
Update release notes
mchowning Apr 15, 2020
4b76cff
Update gutenberg ref
mchowning Apr 10, 2020
0d04a82
Add stub function for iOS
SergioEstevao Apr 16, 2020
ce88a8a
Implement delegate method for requesting mentions.
SergioEstevao Apr 16, 2020
a0a3ec5
Merge branch 'develop' into issue_331/mention_support
SergioEstevao Apr 17, 2020
fae7dc6
Merge branch 'develop' into issue_331/mention_support
SergioEstevao Apr 20, 2020
41dbe0a
User error domain and code information on the promise's rejecter
SergioEstevao Apr 20, 2020
8446c5b
Stub demo app to always mention "matt"
mchowning Apr 20, 2020
db492a3
Merge branch 'develop' into issue_331/mention_support
SergioEstevao Apr 21, 2020
7532fb4
Update GB reference.
SergioEstevao Apr 21, 2020
58d372e
Update bundles.
SergioEstevao Apr 21, 2020
c06e7b6
Update GB reference.
SergioEstevao Apr 22, 2020
411492e
Update GB reference.
SergioEstevao Apr 23, 2020
8eb2c1b
Update bundles.
SergioEstevao Apr 23, 2020
65383b8
Update GB reference.
SergioEstevao Apr 24, 2020
167a947
Merge branch 'develop' into issue_331/mention_support
SergioEstevao Apr 24, 2020
c9cfbb0
Add capabilities check support for mentions.
SergioEstevao Apr 24, 2020
3ec3a90
Update bundles.
SergioEstevao Apr 24, 2020
1a57491
Make sure there is a default value for capabilities when is not defined.
SergioEstevao Apr 24, 2020
e49d01b
Formating fix to make Prettier happy
mchowning Apr 24, 2020
08f760f
Add capabilities initial prop for Android
mchowning Apr 24, 2020
5c7bea0
Merge branch 'develop' into issue_331/mention_support
SergioEstevao Apr 27, 2020
166cca2
Update GB reference.
SergioEstevao Apr 27, 2020
4d923da
Update GB reference.
SergioEstevao Apr 27, 2020
94cca3d
Update GB reference.
SergioEstevao Apr 28, 2020
f145c1b
Update bundles.
SergioEstevao Apr 28, 2020
27411aa
Update gutenberg ref
mchowning Apr 28, 2020
f3552d1
Merge branch 'develop' into issue_331/mention_support
SergioEstevao Apr 30, 2020
4a0547e
Update GB reference.
SergioEstevao May 8, 2020
5980b5e
Merge branch 'develop' into issue_331/mention_support
SergioEstevao May 8, 2020
7b1cc91
Update bundles.
SergioEstevao May 11, 2020
b33bbb0
Merge branch 'develop' into issue_331/mention_support
SergioEstevao May 11, 2020
76e43cb
Update bundles.
SergioEstevao May 11, 2020
db05178
Update GB reference.
SergioEstevao May 19, 2020
f6346f6
Merge branch 'develop' into issue_331/mention_support
SergioEstevao May 19, 2020
a0df91e
Update GB reference.
SergioEstevao May 20, 2020
1f5ee28
Update bundles.
SergioEstevao May 20, 2020
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
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
1.27.0
------
* Block Editor: Add dialog for mentioning other users in your post
* Prefill caption for image blocks when available on the Media library
* New block: Buttons. From now you’ll be able to add the individual Button block only inside the Buttons block
* Fix bug where whitespaces at start of text blocks were being removed
Expand Down
22 changes: 22 additions & 0 deletions android/app/src/main/java/com/gutenberg/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
package com.gutenberg;

import android.os.Bundle;

import androidx.annotation.Nullable;

import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;

import org.wordpress.mobile.WPAndroidGlue.WPAndroidGlueCode;

public class MainActivity extends ReactActivity {

Expand All @@ -12,4 +19,19 @@ public class MainActivity extends ReactActivity {
protected String getMainComponentName() {
return "gutenberg";
}

@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new ReactActivityDelegate(this, getMainComponentName()) {
@Nullable
@Override
protected Bundle getLaunchOptions() {
Bundle bundle = new Bundle();
Bundle capabilities = new Bundle();
capabilities.putBoolean(WPAndroidGlueCode.PROP_NAME_CAPABILITIES_MENTIONS, true);
bundle.putBundle(WPAndroidGlueCode.PROP_NAME_CAPABILITIES, capabilities);
return bundle;
}
};
}
}
5 changes: 5 additions & 0 deletions android/app/src/main/java/com/gutenberg/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ public void editorDidEmitLog(String message, LogLevel logLevel) {
@Override
public void performRequest(String path, Consumer<String> onSuccess, Consumer<Bundle> onError) {}

@Override
public void onAddMention(Consumer<String> onSuccess) {
onSuccess.accept("matt");
}

}, isDarkMode());

return new ReactNativeHost(this) {
Expand Down
2,251 changes: 1,128 additions & 1,123 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.

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "core/archives",
"category": "widgets",
"attributes": {
"align": {
"type": "string",
"enum": [ "left", "center", "right", "wide", "full" ]
},
"className": {
"type": "string"
},
"displayAsDropdown": {
"type": "boolean",
"default": false
},
"showPostCounts": {
"type": "boolean",
"default": false
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "core/block",
"category": "reusable",
"attributes": {
"ref": {
"type": "number"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@
},
"borderRadius": {
"type": "number"
},
"style": {
"type": "object"
},
"backgroundColor": {
"type": "string"
},
"textColor": {
"type": "string"
},
"gradient": {
"type": "string"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "core/buttons",
"category": "layout",
"attributes": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "core/calendar",
"category": "widgets",
"attributes": {
"align": {
"type": "string",
"enum": [ "left", "center", "right", "wide", "full" ]
},
"className": {
"type": "string"
},
"month": {
"type": "integer"
},
"year": {
"type": "integer"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "core/categories",
"category": "widgets",
"attributes": {
"align": {
"type": "string",
"enum": [ "left", "center", "right", "wide", "full" ]
},
"className": {
"type": "string"
},
"displayAsDropdown": {
"type": "boolean",
"default": false
},
"showHierarchy": {
"type": "boolean",
"default": false
},
"showPostCounts": {
"type": "boolean",
"default": false
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "core/latest-comments",
"category": "widgets",
"attributes": {
"align": {
"type": "string",
"enum": [ "left", "center", "right", "wide", "full" ]
},
"className": {
"type": "string"
},
"commentsToShow": {
"type": "number",
"default": 5,
"minimum": 1,
"maximum": 100
},
"displayAvatar": {
"type": "boolean",
"default": true
},
"displayDate": {
"type": "boolean",
"default": true
},
"displayExcerpt": {
"type": "boolean",
"default": true
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
"type": "string"
},
"categories": {
"type": "array"
"type": "array",
"items": {
"type": "object"
}
},
"postsToShow": {
"type": "number",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "core/rss",
"category": "widgets",
"attributes": {
"align": {
"type": "string",
"enum": [ "left", "center", "right", "wide", "full" ]
},
"className": {
"type": "string"
},
"columns": {
"type": "number",
"default": 2
},
"blockLayout": {
"type": "string",
"default": "list"
},
"feedURL": {
"type": "string",
"default": ""
},
"itemsToShow": {
"type": "number",
"default": 5
},
"displayExcerpt": {
"type": "boolean",
"default": false
},
"displayAuthor": {
"type": "boolean",
"default": false
},
"displayDate": {
"type": "boolean",
"default": false
},
"excerptLength": {
"type": "number",
"default": 55
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "core/tag-cloud",
"category": "widgets",
"attributes": {
"align": {
"type": "string",
"enum": [ "left", "center", "right", "wide", "full" ]
},
"className": {
"type": "string"
},
"taxonomy": {
"type": "string",
"default": "post_tag"
},
"showTagCounts": {
"type": "boolean",
"default": false
}
}
}
2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_ar.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_bg.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_bo.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_ca.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_cs.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_cy.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_da.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_de.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_el.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_enau.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_enca.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_engb.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_ennz.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_enza.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_es.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_esar.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_escl.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_escr.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_fa.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_fr.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_gl.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_he.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_hr.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_hu.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_id.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_is.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_it.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_ja.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_ka.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_ko.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_nb.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_nl.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_nlbe.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_pl.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_pt.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_ptbr.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_ro.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_ru.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_sk.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_sq.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_sr.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_sv.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_th.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_tr.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_uk.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_ur.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_vi.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_zhcn.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/raw/i18ncache_data_zhtw.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions bundle/android/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ translators: sample content for "Services" page template -->
<string name="gutenberg_native_hide_keyboard" tools:ignore="UnusedResources">Hide keyboard</string>
<!-- translators: accessibility text. %s: image caption. -->
<string name="gutenberg_native_image_caption_s" tools:ignore="UnusedResources">Image caption. %s</string>
<string name="gutenberg_native_insert_mention" tools:ignore="UnusedResources">Insert mention</string>
<!-- translators: sample content for "Services" page template -->
<string name="gutenberg_native_inspiration" tools:ignore="UnusedResources">Inspiration</string>
<!-- translators: sample content for "About" page template -->
Expand Down
Loading