): Int? {
val (start, end) = getInlineSelection()
- val spannable = editorView.text as Spannable
+ val spannable = view.text as Spannable
val spans = spannable.getSpans(start, end, type)
- val isLinkType = type == EditorLinkSpan::class.java
- val isMentionType = type == EditorMentionSpan::class.java
+ val isLinkType = type == EnrichedLinkSpan::class.java
+ val isMentionType = type == EnrichedMentionSpan::class.java
if (isLinkType && spans.isEmpty()) {
emitLinkDetectedEvent(spannable, null, start, end)
@@ -199,9 +199,9 @@ class EditorSelection(private val editorView: ReactNativeRichTextEditorView) {
val spanEnd = spannable.getSpanEnd(span)
if (start >= spanStart && end <= spanEnd) {
- if (isLinkType && span is EditorLinkSpan) {
+ if (isLinkType && span is EnrichedLinkSpan) {
emitLinkDetectedEvent(spannable, span, spanStart, spanEnd)
- } else if (isMentionType && span is EditorMentionSpan) {
+ } else if (isMentionType && span is EnrichedMentionSpan) {
emitMentionDetectedEvent(spannable, span, spanStart, spanEnd)
}
@@ -215,15 +215,15 @@ class EditorSelection(private val editorView: ReactNativeRichTextEditorView) {
private fun emitSelectionChangeEvent(editable: Editable?, start: Int, end: Int) {
if (editable == null) return
- val context = editorView.context as ReactContext
+ val context = view.context as ReactContext
val surfaceId = UIManagerHelper.getSurfaceId(context)
- val dispatcher = UIManagerHelper.getEventDispatcherForReactTag(context, editorView.id)
+ val dispatcher = UIManagerHelper.getEventDispatcherForReactTag(context, view.id)
val text = editable.substring(start, end)
- dispatcher?.dispatchEvent(OnChangeSelectionEvent(surfaceId, editorView.id, text, start ,end))
+ dispatcher?.dispatchEvent(OnChangeSelectionEvent(surfaceId, view.id, text, start ,end))
}
- private fun emitLinkDetectedEvent(spannable: Spannable, span: EditorLinkSpan?, start: Int, end: Int) {
+ private fun emitLinkDetectedEvent(spannable: Spannable, span: EnrichedLinkSpan?, start: Int, end: Int) {
val text = spannable.substring(start, end)
val url = span?.getUrl() ?: ""
@@ -233,13 +233,13 @@ class EditorSelection(private val editorView: ReactNativeRichTextEditorView) {
previousLinkDetectedEvent.put("text", text)
previousLinkDetectedEvent.put("url", url)
- val context = editorView.context as ReactContext
+ val context = view.context as ReactContext
val surfaceId = UIManagerHelper.getSurfaceId(context)
- val dispatcher = UIManagerHelper.getEventDispatcherForReactTag(context, editorView.id)
- dispatcher?.dispatchEvent(OnLinkDetectedEvent(surfaceId, editorView.id, text, url, start, end))
+ val dispatcher = UIManagerHelper.getEventDispatcherForReactTag(context, view.id)
+ dispatcher?.dispatchEvent(OnLinkDetectedEvent(surfaceId, view.id, text, url, start, end))
}
- private fun emitMentionDetectedEvent(spannable: Spannable, span: EditorMentionSpan?, start: Int, end: Int) {
+ private fun emitMentionDetectedEvent(spannable: Spannable, span: EnrichedMentionSpan?, start: Int, end: Int) {
val text = spannable.substring(start, end)
val attributes = span?.getAttributes() ?: emptyMap()
val indicator = span?.getIndicator() ?: ""
@@ -255,9 +255,9 @@ class EditorSelection(private val editorView: ReactNativeRichTextEditorView) {
previousMentionDetectedEvent.put("payload", payload)
previousMentionDetectedEvent.put("indicator", indicator)
- val context = editorView.context as ReactContext
+ val context = view.context as ReactContext
val surfaceId = UIManagerHelper.getSurfaceId(context)
- val dispatcher = UIManagerHelper.getEventDispatcherForReactTag(context, editorView.id)
- dispatcher?.dispatchEvent(OnMentionDetectedEvent(surfaceId, editorView.id, text, indicator, payload))
+ val dispatcher = UIManagerHelper.getEventDispatcherForReactTag(context, view.id)
+ dispatcher?.dispatchEvent(OnMentionDetectedEvent(surfaceId, view.id, text, indicator, payload))
}
}
diff --git a/android/src/main/java/com/swmansion/reactnativerichtexteditor/utils/EditorSpanSpate.kt b/android/src/main/java/com/swmansion/enriched/utils/EditorSpanSpate.kt
similarity index 66%
rename from android/src/main/java/com/swmansion/reactnativerichtexteditor/utils/EditorSpanSpate.kt
rename to android/src/main/java/com/swmansion/enriched/utils/EditorSpanSpate.kt
index 549e0221f..13a567271 100644
--- a/android/src/main/java/com/swmansion/reactnativerichtexteditor/utils/EditorSpanSpate.kt
+++ b/android/src/main/java/com/swmansion/enriched/utils/EditorSpanSpate.kt
@@ -1,14 +1,14 @@
-package com.swmansion.reactnativerichtexteditor.utils
+package com.swmansion.enriched.utils
import com.facebook.react.bridge.Arguments
import com.facebook.react.bridge.ReactContext
import com.facebook.react.bridge.WritableMap
import com.facebook.react.uimanager.UIManagerHelper
-import com.swmansion.reactnativerichtexteditor.ReactNativeRichTextEditorView
-import com.swmansion.reactnativerichtexteditor.events.OnChangeStateEvent
-import com.swmansion.reactnativerichtexteditor.spans.EditorSpans
+import com.swmansion.enriched.EnrichedTextInputView
+import com.swmansion.enriched.events.OnChangeStateEvent
+import com.swmansion.enriched.spans.EnrichedSpans
-class EditorSpanState(private val editorView: ReactNativeRichTextEditorView) {
+class EnrichedSpanState(private val view: EnrichedTextInputView) {
private var previousPayload: WritableMap? = null
var boldStart: Int? = null
@@ -119,21 +119,21 @@ class EditorSpanState(private val editorView: ReactNativeRichTextEditorView) {
fun getStart(name: String): Int? {
val start = when (name) {
- EditorSpans.BOLD -> boldStart
- EditorSpans.ITALIC -> italicStart
- EditorSpans.UNDERLINE -> underlineStart
- EditorSpans.STRIKETHROUGH -> strikethroughStart
- EditorSpans.INLINE_CODE -> inlineCodeStart
- EditorSpans.H1 -> h1Start
- EditorSpans.H2 -> h2Start
- EditorSpans.H3 -> h3Start
- EditorSpans.CODE_BLOCK -> codeBlockStart
- EditorSpans.BLOCK_QUOTE -> blockQuoteStart
- EditorSpans.ORDERED_LIST -> orderedListStart
- EditorSpans.UNORDERED_LIST -> unorderedListStart
- EditorSpans.LINK -> linkStart
- EditorSpans.IMAGE -> imageStart
- EditorSpans.MENTION -> mentionStart
+ EnrichedSpans.BOLD -> boldStart
+ EnrichedSpans.ITALIC -> italicStart
+ EnrichedSpans.UNDERLINE -> underlineStart
+ EnrichedSpans.STRIKETHROUGH -> strikethroughStart
+ EnrichedSpans.INLINE_CODE -> inlineCodeStart
+ EnrichedSpans.H1 -> h1Start
+ EnrichedSpans.H2 -> h2Start
+ EnrichedSpans.H3 -> h3Start
+ EnrichedSpans.CODE_BLOCK -> codeBlockStart
+ EnrichedSpans.BLOCK_QUOTE -> blockQuoteStart
+ EnrichedSpans.ORDERED_LIST -> orderedListStart
+ EnrichedSpans.UNORDERED_LIST -> unorderedListStart
+ EnrichedSpans.LINK -> linkStart
+ EnrichedSpans.IMAGE -> imageStart
+ EnrichedSpans.MENTION -> mentionStart
else -> null
}
@@ -142,21 +142,21 @@ class EditorSpanState(private val editorView: ReactNativeRichTextEditorView) {
fun setStart(name: String, start: Int?) {
when (name) {
- EditorSpans.BOLD -> setBoldStart(start)
- EditorSpans.ITALIC -> setItalicStart(start)
- EditorSpans.UNDERLINE -> setUnderlineStart(start)
- EditorSpans.STRIKETHROUGH -> setStrikethroughStart(start)
- EditorSpans.INLINE_CODE -> setInlineCodeStart(start)
- EditorSpans.H1 -> setH1Start(start)
- EditorSpans.H2 -> setH2Start(start)
- EditorSpans.H3 -> setH3Start(start)
- EditorSpans.CODE_BLOCK -> setCodeBlockStart(start)
- EditorSpans.BLOCK_QUOTE -> setBlockQuoteStart(start)
- EditorSpans.ORDERED_LIST -> setOrderedListStart(start)
- EditorSpans.UNORDERED_LIST -> setUnorderedListStart(start)
- EditorSpans.LINK -> setLinkStart(start)
- EditorSpans.IMAGE -> setImageStart(start)
- EditorSpans.MENTION -> setMentionStart(start)
+ EnrichedSpans.BOLD -> setBoldStart(start)
+ EnrichedSpans.ITALIC -> setItalicStart(start)
+ EnrichedSpans.UNDERLINE -> setUnderlineStart(start)
+ EnrichedSpans.STRIKETHROUGH -> setStrikethroughStart(start)
+ EnrichedSpans.INLINE_CODE -> setInlineCodeStart(start)
+ EnrichedSpans.H1 -> setH1Start(start)
+ EnrichedSpans.H2 -> setH2Start(start)
+ EnrichedSpans.H3 -> setH3Start(start)
+ EnrichedSpans.CODE_BLOCK -> setCodeBlockStart(start)
+ EnrichedSpans.BLOCK_QUOTE -> setBlockQuoteStart(start)
+ EnrichedSpans.ORDERED_LIST -> setOrderedListStart(start)
+ EnrichedSpans.UNORDERED_LIST -> setUnorderedListStart(start)
+ EnrichedSpans.LINK -> setLinkStart(start)
+ EnrichedSpans.IMAGE -> setImageStart(start)
+ EnrichedSpans.MENTION -> setMentionStart(start)
}
}
@@ -187,13 +187,13 @@ class EditorSpanState(private val editorView: ReactNativeRichTextEditorView) {
merge(payload)
}
- val context = editorView.context as ReactContext
+ val context = view.context as ReactContext
val surfaceId = UIManagerHelper.getSurfaceId(context)
- val dispatcher = UIManagerHelper.getEventDispatcherForReactTag(context, editorView.id)
- dispatcher?.dispatchEvent(OnChangeStateEvent(surfaceId, editorView.id, payload))
+ val dispatcher = UIManagerHelper.getEventDispatcherForReactTag(context, view.id)
+ dispatcher?.dispatchEvent(OnChangeStateEvent(surfaceId, view.id, payload))
}
companion object {
- const val NAME = "ReactNativeRichTextEditorView"
+ const val NAME = "ReactNativeEnrichedView"
}
}
diff --git a/android/src/main/java/com/swmansion/reactnativerichtexteditor/utils/EditorParser.java b/android/src/main/java/com/swmansion/enriched/utils/EnrichedParser.java
similarity index 79%
rename from android/src/main/java/com/swmansion/reactnativerichtexteditor/utils/EditorParser.java
rename to android/src/main/java/com/swmansion/enriched/utils/EnrichedParser.java
index d61af3ee2..550774c97 100644
--- a/android/src/main/java/com/swmansion/reactnativerichtexteditor/utils/EditorParser.java
+++ b/android/src/main/java/com/swmansion/enriched/utils/EnrichedParser.java
@@ -1,4 +1,4 @@
-package com.swmansion.reactnativerichtexteditor.utils;
+package com.swmansion.enriched.utils;
import android.graphics.drawable.Drawable;
import android.text.Editable;
@@ -10,26 +10,26 @@
import android.text.style.AlignmentSpan;
import android.text.style.ParagraphStyle;
-import com.swmansion.reactnativerichtexteditor.spans.EditorBlockQuoteSpan;
-import com.swmansion.reactnativerichtexteditor.spans.EditorBoldSpan;
-import com.swmansion.reactnativerichtexteditor.spans.EditorCodeBlockSpan;
-import com.swmansion.reactnativerichtexteditor.spans.EditorH1Span;
-import com.swmansion.reactnativerichtexteditor.spans.EditorH2Span;
-import com.swmansion.reactnativerichtexteditor.spans.EditorH3Span;
-import com.swmansion.reactnativerichtexteditor.spans.EditorImageSpan;
-import com.swmansion.reactnativerichtexteditor.spans.EditorInlineCodeSpan;
-import com.swmansion.reactnativerichtexteditor.spans.EditorItalicSpan;
-import com.swmansion.reactnativerichtexteditor.spans.EditorLinkSpan;
-import com.swmansion.reactnativerichtexteditor.spans.EditorMentionSpan;
-import com.swmansion.reactnativerichtexteditor.spans.EditorOrderedListSpan;
-import com.swmansion.reactnativerichtexteditor.spans.EditorStrikeThroughSpan;
-import com.swmansion.reactnativerichtexteditor.spans.EditorUnderlineSpan;
-import com.swmansion.reactnativerichtexteditor.spans.EditorUnorderedListSpan;
-import com.swmansion.reactnativerichtexteditor.spans.interfaces.EditorBlockSpan;
-import com.swmansion.reactnativerichtexteditor.spans.interfaces.EditorParagraphSpan;
-import com.swmansion.reactnativerichtexteditor.spans.interfaces.EditorInlineSpan;
-import com.swmansion.reactnativerichtexteditor.spans.interfaces.EditorZeroWidthSpaceSpan;
-import com.swmansion.reactnativerichtexteditor.styles.RichTextStyle;
+import com.swmansion.enriched.spans.EnrichedBlockQuoteSpan;
+import com.swmansion.enriched.spans.EnrichedBoldSpan;
+import com.swmansion.enriched.spans.EnrichedCodeBlockSpan;
+import com.swmansion.enriched.spans.EnrichedH1Span;
+import com.swmansion.enriched.spans.EnrichedH2Span;
+import com.swmansion.enriched.spans.EnrichedH3Span;
+import com.swmansion.enriched.spans.EnrichedImageSpan;
+import com.swmansion.enriched.spans.EnrichedInlineCodeSpan;
+import com.swmansion.enriched.spans.EnrichedItalicSpan;
+import com.swmansion.enriched.spans.EnrichedLinkSpan;
+import com.swmansion.enriched.spans.EnrichedMentionSpan;
+import com.swmansion.enriched.spans.EnrichedOrderedListSpan;
+import com.swmansion.enriched.spans.EnrichedStrikeThroughSpan;
+import com.swmansion.enriched.spans.EnrichedUnderlineSpan;
+import com.swmansion.enriched.spans.EnrichedUnorderedListSpan;
+import com.swmansion.enriched.spans.interfaces.EnrichedBlockSpan;
+import com.swmansion.enriched.spans.interfaces.EnrichedParagraphSpan;
+import com.swmansion.enriched.spans.interfaces.EnrichedInlineSpan;
+import com.swmansion.enriched.spans.interfaces.EnrichedZeroWidthSpaceSpan;
+import com.swmansion.enriched.styles.HtmlStyle;
import org.ccil.cowan.tagsoup.HTMLSchema;
import org.ccil.cowan.tagsoup.Parser;
@@ -51,7 +51,7 @@
* Most of the code in this file is copied from the Android source code and adjusted to our needs.
* For the reference see docs
*/
-public class EditorParser {
+public class EnrichedParser {
/**
* Retrieves images for HTML <img> tags.
*/
@@ -68,7 +68,7 @@ public interface ImageGetter {
Drawable getDrawable(String source);
}
- private EditorParser() { }
+ private EnrichedParser() { }
/**
* Lazy initialization holder for HTML parser. This class will
* a) be preloaded by the zygote, or b) not loaded until absolutely
@@ -85,7 +85,7 @@ private static class HtmlParser {
*
* This uses TagSoup to handle real HTML, including all of the brokenness found in the wild.
*/
- public static Spanned fromHtml(String source, RichTextStyle style, ImageGetter imageGetter) {
+ public static Spanned fromHtml(String source, HtmlStyle style, ImageGetter imageGetter) {
Parser parser = new Parser();
try {
parser.setProperty(Parser.schemaProperty, HtmlParser.schema);
@@ -119,11 +119,11 @@ private static void withinHtml(StringBuilder out, Spanned text) {
private static void withinDiv(StringBuilder out, Spanned text, int start, int end) {
int next;
for (int i = start; i < end; i = next) {
- next = text.nextSpanTransition(i, end, EditorBlockSpan.class);
- EditorBlockSpan[] blocks = text.getSpans(i, next, EditorBlockSpan.class);
+ next = text.nextSpanTransition(i, end, EnrichedBlockSpan.class);
+ EnrichedBlockSpan[] blocks = text.getSpans(i, next, EnrichedBlockSpan.class);
String tag = "unknown";
if (blocks.length > 0){
- tag = blocks[0] instanceof EditorCodeBlockSpan ? "codeblock" : "blockquote";
+ tag = blocks[0] instanceof EnrichedCodeBlockSpan ? "codeblock" : "blockquote";
}
// Each block appends a newline by default.
@@ -132,26 +132,26 @@ private static void withinDiv(StringBuilder out, Spanned text, int start, int en
out.replace(out.length() - 5, out.length(), "");
}
- for (EditorBlockSpan ignored : blocks) {
+ for (EnrichedBlockSpan ignored : blocks) {
out.append("<").append(tag).append(">\n");
}
withinBlock(out, text, i, next);
- for (EditorBlockSpan ignored : blocks) {
+ for (EnrichedBlockSpan ignored : blocks) {
out.append("").append(tag).append(">\n");
}
}
}
- private static String getBlockTag(EditorParagraphSpan[] spans) {
- for (EditorParagraphSpan span : spans) {
- if (span instanceof EditorUnorderedListSpan) {
+ private static String getBlockTag(EnrichedParagraphSpan[] spans) {
+ for (EnrichedParagraphSpan span : spans) {
+ if (span instanceof EnrichedUnorderedListSpan) {
return "ul";
- } else if (span instanceof EditorOrderedListSpan) {
+ } else if (span instanceof EnrichedOrderedListSpan) {
return "ol";
- } else if (span instanceof EditorH1Span) {
+ } else if (span instanceof EnrichedH1Span) {
return "h1";
- } else if (span instanceof EditorH2Span) {
+ } else if (span instanceof EnrichedH2Span) {
return "h2";
- } else if (span instanceof EditorH3Span) {
+ } else if (span instanceof EnrichedH3Span) {
return "h3";
}
}
@@ -179,7 +179,7 @@ private static void withinBlock(StringBuilder out, Spanned text, int start, int
}
out.append("
\n");
} else {
- EditorParagraphSpan[] paragraphStyles = text.getSpans(i, next, EditorParagraphSpan.class);
+ EnrichedParagraphSpan[] paragraphStyles = text.getSpans(i, next, EnrichedParagraphSpan.class);
String tag = getBlockTag(paragraphStyles);
boolean isUlListItem = tag.equals("ul");
boolean isOlListItem = tag.equals("ol");
@@ -229,39 +229,39 @@ private static void withinBlock(StringBuilder out, Spanned text, int start, int
private static void withinParagraph(StringBuilder out, Spanned text, int start, int end) {
int next;
for (int i = start; i < end; i = next) {
- next = text.nextSpanTransition(i, end, EditorInlineSpan.class);
- EditorInlineSpan[] style = text.getSpans(i, next, EditorInlineSpan.class);
+ next = text.nextSpanTransition(i, end, EnrichedInlineSpan.class);
+ EnrichedInlineSpan[] style = text.getSpans(i, next, EnrichedInlineSpan.class);
for (int j = 0; j < style.length; j++) {
- if (style[j] instanceof EditorBoldSpan) {
+ if (style[j] instanceof EnrichedBoldSpan) {
out.append("");
}
- if (style[j] instanceof EditorItalicSpan) {
+ if (style[j] instanceof EnrichedItalicSpan) {
out.append("");
}
- if (style[j] instanceof EditorUnderlineSpan) {
+ if (style[j] instanceof EnrichedUnderlineSpan) {
out.append("");
}
- if (style[j] instanceof EditorInlineCodeSpan) {
+ if (style[j] instanceof EnrichedInlineCodeSpan) {
out.append("");
}
- if (style[j] instanceof EditorStrikeThroughSpan) {
+ if (style[j] instanceof EnrichedStrikeThroughSpan) {
out.append("");
}
- if (style[j] instanceof EditorLinkSpan) {
+ if (style[j] instanceof EnrichedLinkSpan) {
out.append("");
}
- if (style[j] instanceof EditorMentionSpan) {
+ if (style[j] instanceof EnrichedMentionSpan) {
out.append(" attributes = ((EditorMentionSpan) style[j]).getAttributes();
+ Map attributes = ((EnrichedMentionSpan) style[j]).getAttributes();
for (Map.Entry entry : attributes.entrySet()) {
out.append(" ");
out.append(entry.getKey());
@@ -272,9 +272,9 @@ private static void withinParagraph(StringBuilder out, Spanned text, int start,
out.append(">");
}
- if (style[j] instanceof EditorImageSpan) {
+ if (style[j] instanceof EnrichedImageSpan) {
out.append("
");
// Don't output the placeholder character underlying the image.
i = next;
@@ -282,25 +282,25 @@ private static void withinParagraph(StringBuilder out, Spanned text, int start,
}
withinStyle(out, text, i, next);
for (int j = style.length - 1; j >= 0; j--) {
- if (style[j] instanceof EditorLinkSpan) {
+ if (style[j] instanceof EnrichedLinkSpan) {
out.append("");
}
- if (style[j] instanceof EditorMentionSpan) {
+ if (style[j] instanceof EnrichedMentionSpan) {
out.append("");
}
- if (style[j] instanceof EditorStrikeThroughSpan) {
+ if (style[j] instanceof EnrichedStrikeThroughSpan) {
out.append("");
}
- if (style[j] instanceof EditorUnderlineSpan) {
+ if (style[j] instanceof EnrichedUnderlineSpan) {
out.append("");
}
- if (style[j] instanceof EditorInlineCodeSpan) {
+ if (style[j] instanceof EnrichedInlineCodeSpan) {
out.append("");
}
- if (style[j] instanceof EditorBoldSpan) {
+ if (style[j] instanceof EnrichedBoldSpan) {
out.append("");
}
- if (style[j] instanceof EditorItalicSpan) {
+ if (style[j] instanceof EnrichedItalicSpan) {
out.append("");
}
}
@@ -343,15 +343,15 @@ private static void withinStyle(StringBuilder out, CharSequence text,
}
}
class HtmlToSpannedConverter implements ContentHandler {
- private final RichTextStyle mStyle;
+ private final HtmlStyle mStyle;
private final String mSource;
private final XMLReader mReader;
private final SpannableStringBuilder mSpannableStringBuilder;
- private final EditorParser.ImageGetter mImageGetter;
+ private final EnrichedParser.ImageGetter mImageGetter;
private static Integer currentOrderedListItemIndex = 0;
private static Boolean isInOrderedList = false;
- public HtmlToSpannedConverter(String source, RichTextStyle style, EditorParser.ImageGetter imageGetter, Parser parser) {
+ public HtmlToSpannedConverter(String source, HtmlStyle style, EnrichedParser.ImageGetter imageGetter, Parser parser) {
mStyle = style;
mSource = source;
mSpannableStringBuilder = new SpannableStringBuilder();
@@ -392,8 +392,8 @@ public Spanned convert() {
}
// Assign zero-width space character to the proper spans.
- EditorZeroWidthSpaceSpan[] zeroWidthSpaceSpans = mSpannableStringBuilder.getSpans(0, mSpannableStringBuilder.length(), EditorZeroWidthSpaceSpan.class);
- for (EditorZeroWidthSpaceSpan zeroWidthSpaceSpan : zeroWidthSpaceSpans) {
+ EnrichedZeroWidthSpaceSpan[] zeroWidthSpaceSpans = mSpannableStringBuilder.getSpans(0, mSpannableStringBuilder.length(), EnrichedZeroWidthSpaceSpan.class);
+ for (EnrichedZeroWidthSpaceSpan zeroWidthSpaceSpan : zeroWidthSpaceSpans) {
int start = mSpannableStringBuilder.getSpanStart(zeroWidthSpaceSpan);
int end = mSpannableStringBuilder.getSpanEnd(zeroWidthSpaceSpan);
mSpannableStringBuilder.insert(start, "\u200B");
@@ -460,9 +460,9 @@ private void handleEndTag(String tag) {
} else if (tag.equalsIgnoreCase("li")) {
endLi(mSpannableStringBuilder, mStyle);
} else if (tag.equalsIgnoreCase("b")) {
- end(mSpannableStringBuilder, Bold.class, new EditorBoldSpan(mStyle));
+ end(mSpannableStringBuilder, Bold.class, new EnrichedBoldSpan(mStyle));
} else if (tag.equalsIgnoreCase("i")) {
- end(mSpannableStringBuilder, Italic.class, new EditorItalicSpan(mStyle));
+ end(mSpannableStringBuilder, Italic.class, new EnrichedItalicSpan(mStyle));
} else if (tag.equalsIgnoreCase("blockquote")) {
endBlockquote(mSpannableStringBuilder, mStyle);
} else if (tag.equalsIgnoreCase("codeblock")) {
@@ -470,9 +470,9 @@ private void handleEndTag(String tag) {
} else if (tag.equalsIgnoreCase("a")) {
endA(mSpannableStringBuilder, mStyle);
} else if (tag.equalsIgnoreCase("u")) {
- end(mSpannableStringBuilder, Underline.class, new EditorUnderlineSpan(mStyle));
+ end(mSpannableStringBuilder, Underline.class, new EnrichedUnderlineSpan(mStyle));
} else if (tag.equalsIgnoreCase("s")) {
- end(mSpannableStringBuilder, Strikethrough.class, new EditorStrikeThroughSpan(mStyle));
+ end(mSpannableStringBuilder, Strikethrough.class, new EnrichedStrikeThroughSpan(mStyle));
} else if (tag.equalsIgnoreCase("h1")) {
endHeading(mSpannableStringBuilder, mStyle, 1);
} else if (tag.equalsIgnoreCase("h2")) {
@@ -480,7 +480,7 @@ private void handleEndTag(String tag) {
} else if (tag.equalsIgnoreCase("h3")) {
endHeading(mSpannableStringBuilder, mStyle, 3);
} else if (tag.equalsIgnoreCase("code")) {
- end(mSpannableStringBuilder, Code.class, new EditorInlineCodeSpan(mStyle));
+ end(mSpannableStringBuilder, Code.class, new EnrichedInlineCodeSpan(mStyle));
} else if (tag.equalsIgnoreCase("mention")) {
endMention(mSpannableStringBuilder, mStyle);
}
@@ -532,15 +532,15 @@ private void startLi(Editable text) {
}
}
- private static void endLi(Editable text, RichTextStyle style) {
+ private static void endLi(Editable text, HtmlStyle style) {
endBlockElement(text);
List l = getLast(text, List.class);
if (l != null) {
if (l.mType.equals("ol")) {
- setParagraphSpanFromMark(text, l, new EditorOrderedListSpan(l.mIndex, style));
+ setParagraphSpanFromMark(text, l, new EnrichedOrderedListSpan(l.mIndex, style));
} else {
- setParagraphSpanFromMark(text, l, new EditorUnorderedListSpan(style));
+ setParagraphSpanFromMark(text, l, new EnrichedUnorderedListSpan(style));
}
}
@@ -552,10 +552,10 @@ private void startBlockquote(Editable text) {
start(text, new Blockquote());
}
- private static void endBlockquote(Editable text, RichTextStyle style) {
+ private static void endBlockquote(Editable text, HtmlStyle style) {
endBlockElement(text);
Blockquote last = getLast(text, Blockquote.class);
- setParagraphSpanFromMark(text, last, new EditorBlockQuoteSpan(style));
+ setParagraphSpanFromMark(text, last, new EnrichedBlockQuoteSpan(style));
}
private void startCodeBlock(Editable text) {
@@ -563,10 +563,10 @@ private void startCodeBlock(Editable text) {
start(text, new CodeBlock());
}
- private static void endCodeBlock(Editable text, RichTextStyle style) {
+ private static void endCodeBlock(Editable text, HtmlStyle style) {
endBlockElement(text);
CodeBlock last = getLast(text, CodeBlock.class);
- setParagraphSpanFromMark(text, last, new EditorCodeBlockSpan(style));
+ setParagraphSpanFromMark(text, last, new EnrichedCodeBlockSpan(style));
}
private void startHeading(Editable text, int level) {
@@ -587,21 +587,21 @@ private void startHeading(Editable text, int level) {
}
}
- private static void endHeading(Editable text, RichTextStyle style, int level) {
+ private static void endHeading(Editable text, HtmlStyle style, int level) {
endBlockElement(text);
switch (level) {
case 1:
H1 lastH1 = getLast(text, H1.class);
- setParagraphSpanFromMark(text, lastH1, new EditorH1Span(style));
+ setParagraphSpanFromMark(text, lastH1, new EnrichedH1Span(style));
break;
case 2:
H2 lastH2 = getLast(text, H2.class);
- setParagraphSpanFromMark(text, lastH2, new EditorH2Span(style));
+ setParagraphSpanFromMark(text, lastH2, new EnrichedH2Span(style));
break;
case 3:
H3 lastH3 = getLast(text, H3.class);
- setParagraphSpanFromMark(text, lastH3, new EditorH3Span(style));
+ setParagraphSpanFromMark(text, lastH3, new EnrichedH3Span(style));
break;
default:
throw new IllegalArgumentException("Unsupported heading level: " + level);
@@ -661,7 +661,7 @@ private static void end(Editable text, Class kind, Object repl) {
}
}
- private static void startImg(Editable text, Attributes attributes, EditorParser.ImageGetter img, RichTextStyle style) {
+ private static void startImg(Editable text, Attributes attributes, EnrichedParser.ImageGetter img, HtmlStyle style) {
String src = attributes.getValue("", "src");
Drawable d = null;
if (img != null) {
@@ -674,7 +674,7 @@ private static void startImg(Editable text, Attributes attributes, EditorParser.
int len = text.length();
text.append("");
- text.setSpan(new EditorImageSpan(d, src, style), len, text.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
+ text.setSpan(new EnrichedImageSpan(d, src, style), len, text.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
}
private static void startA(Editable text, Attributes attributes) {
@@ -682,11 +682,11 @@ private static void startA(Editable text, Attributes attributes) {
start(text, new Href(href));
}
- private void endA(Editable text, RichTextStyle style) {
+ private void endA(Editable text, HtmlStyle style) {
Href h = getLast(text, Href.class);
if (h != null) {
if (h.mHref != null) {
- setSpanFromMark(text, h, new EditorLinkSpan(h.mHref, style));
+ setSpanFromMark(text, h, new EnrichedLinkSpan(h.mHref, style));
}
}
}
@@ -707,13 +707,13 @@ private static void startMention(Editable mention, Attributes attributes) {
start(mention, new Mention(indicator, text, attributesMap));
}
- private void endMention(Editable text, RichTextStyle style) {
+ private void endMention(Editable text, HtmlStyle style) {
Mention m = getLast(text, Mention.class);
if (m == null) return;
if (m.mText == null) return;
- setSpanFromMark(text, m, new EditorMentionSpan(m.mText, m.mIndicator, m.mAttributes, style));
+ setSpanFromMark(text, m, new EnrichedMentionSpan(m.mText, m.mIndicator, m.mAttributes, style));
}
public void setDocumentLocator(Locator locator) {
diff --git a/android/src/main/java/com/swmansion/reactnativerichtexteditor/utils/Utils.kt b/android/src/main/java/com/swmansion/enriched/utils/Utils.kt
similarity index 82%
rename from android/src/main/java/com/swmansion/reactnativerichtexteditor/utils/Utils.kt
rename to android/src/main/java/com/swmansion/enriched/utils/Utils.kt
index 198be65b5..cd7c9c8c9 100644
--- a/android/src/main/java/com/swmansion/reactnativerichtexteditor/utils/Utils.kt
+++ b/android/src/main/java/com/swmansion/enriched/utils/Utils.kt
@@ -1,11 +1,11 @@
-package com.swmansion.reactnativerichtexteditor.utils
+package com.swmansion.enriched.utils
import android.text.Spannable
import android.text.SpannableString
import android.text.SpannableStringBuilder
import android.util.Log
-import com.swmansion.reactnativerichtexteditor.spans.interfaces.EditorBlockSpan
-import com.swmansion.reactnativerichtexteditor.spans.interfaces.EditorParagraphSpan
+import com.swmansion.enriched.spans.interfaces.EnrichedBlockSpan
+import com.swmansion.enriched.spans.interfaces.EnrichedParagraphSpan
import org.json.JSONObject
fun jsonStringToStringMap(json: String): Map {
@@ -19,7 +19,7 @@ fun jsonStringToStringMap(json: String): Map {
}
}
} catch (e: Exception) {
- Log.w("ReactNativeRichTextEditorView", "Failed to parse JSON string to Map: $json", e)
+ Log.w("ReactNativeEnrichedView", "Failed to parse JSON string to Map: $json", e)
}
return result
@@ -67,10 +67,10 @@ fun Spannable.mergeSpannables(start: Int, end: Int, spannable: Spannable): Spann
var finalEnd = end
val builder = SpannableStringBuilder(this)
- val startBlockSpans = spannable.getSpans(0, 0, EditorBlockSpan::class.java)
- val startParagraphSpans = spannable.getSpans(0, 0, EditorParagraphSpan::class.java)
- val endBlockSpans = spannable.getSpans(this.length, this.length, EditorBlockSpan::class.java)
- val endParagraphSpans = spannable.getSpans(this.length, this.length, EditorParagraphSpan::class.java)
+ val startBlockSpans = spannable.getSpans(0, 0, EnrichedBlockSpan::class.java)
+ val startParagraphSpans = spannable.getSpans(0, 0, EnrichedParagraphSpan::class.java)
+ val endBlockSpans = spannable.getSpans(this.length, this.length, EnrichedBlockSpan::class.java)
+ val endParagraphSpans = spannable.getSpans(this.length, this.length, EnrichedParagraphSpan::class.java)
val (paragraphStart, paragraphEnd) = this.getParagraphBounds(start, end)
val isNewLineStart = startBlockSpans.isNotEmpty() || startParagraphSpans.isNotEmpty()
val isNewLineEnd = endBlockSpans.isNotEmpty() || endParagraphSpans.isNotEmpty()
diff --git a/android/src/main/java/com/swmansion/reactnativerichtexteditor/watchers/EditorSpanWatcher.kt b/android/src/main/java/com/swmansion/enriched/watchers/EnrichedSpanWatcher.kt
similarity index 60%
rename from android/src/main/java/com/swmansion/reactnativerichtexteditor/watchers/EditorSpanWatcher.kt
rename to android/src/main/java/com/swmansion/enriched/watchers/EnrichedSpanWatcher.kt
index 45fddcb28..b304816a6 100644
--- a/android/src/main/java/com/swmansion/reactnativerichtexteditor/watchers/EditorSpanWatcher.kt
+++ b/android/src/main/java/com/swmansion/enriched/watchers/EnrichedSpanWatcher.kt
@@ -1,19 +1,19 @@
-package com.swmansion.reactnativerichtexteditor.watchers
+package com.swmansion.enriched.watchers
import android.text.SpanWatcher
import android.text.Spannable
import android.text.style.ParagraphStyle
import com.facebook.react.bridge.ReactContext
import com.facebook.react.uimanager.UIManagerHelper
-import com.swmansion.reactnativerichtexteditor.ReactNativeRichTextEditorView
-import com.swmansion.reactnativerichtexteditor.events.OnChangeHtmlEvent
-import com.swmansion.reactnativerichtexteditor.spans.EditorOrderedListSpan
-import com.swmansion.reactnativerichtexteditor.spans.interfaces.EditorHeadingSpan
-import com.swmansion.reactnativerichtexteditor.spans.interfaces.EditorSpan
-import com.swmansion.reactnativerichtexteditor.utils.EditorParser
-import com.swmansion.reactnativerichtexteditor.utils.getSafeSpanBoundaries
+import com.swmansion.enriched.EnrichedTextInputView
+import com.swmansion.enriched.events.OnChangeHtmlEvent
+import com.swmansion.enriched.spans.EnrichedOrderedListSpan
+import com.swmansion.enriched.spans.interfaces.EnrichedHeadingSpan
+import com.swmansion.enriched.spans.interfaces.EnrichedSpan
+import com.swmansion.enriched.utils.EnrichedParser
+import com.swmansion.enriched.utils.getSafeSpanBoundaries
-class EditorSpanWatcher(private val editorView: ReactNativeRichTextEditorView) : SpanWatcher {
+class EnrichedSpanWatcher(private val view: EnrichedTextInputView) : SpanWatcher {
private var previousHtml: String? = null
override fun onSpanAdded(text: Spannable, what: Any, start: Int, end: Int) {
@@ -33,8 +33,8 @@ class EditorSpanWatcher(private val editorView: ReactNativeRichTextEditorView) :
}
private fun updateUnorderedListSpans(what: Any, text: Spannable, end: Int) {
- if (what is EditorOrderedListSpan) {
- editorView.listStyles?.updateOrderedListIndexes(text, end)
+ if (what is EnrichedOrderedListSpan) {
+ view.listStyles?.updateOrderedListIndexes(text, end)
}
}
@@ -43,7 +43,7 @@ class EditorSpanWatcher(private val editorView: ReactNativeRichTextEditorView) :
private fun updateNextLineLayout(what: Any, text: Spannable, end: Int) {
class EmptySpan : ParagraphStyle {}
- if (what is EditorHeadingSpan) {
+ if (what is EnrichedHeadingSpan) {
val finalStart = (end + 1)
val finalEnd = text.length
val (safeStart, safeEnd) = text.getSafeSpanBoundaries(finalStart, finalEnd)
@@ -53,16 +53,16 @@ class EditorSpanWatcher(private val editorView: ReactNativeRichTextEditorView) :
fun emitEvent(s: Spannable, what: Any?) {
// Emit event only if we change one of ours spans
- if (what != null && what !is EditorSpan) return
+ if (what != null && what !is EnrichedSpan) return
- val html = EditorParser.toHtml(s)
+ val html = EnrichedParser.toHtml(s)
if (html == previousHtml) return
previousHtml = html
- editorView.layoutManager.invalidateLayout(editorView.text)
- val context = editorView.context as ReactContext
+ view.layoutManager.invalidateLayout(view.text)
+ val context = view.context as ReactContext
val surfaceId = UIManagerHelper.getSurfaceId(context)
- val dispatcher = UIManagerHelper.getEventDispatcherForReactTag(context, editorView.id)
- dispatcher?.dispatchEvent(OnChangeHtmlEvent(surfaceId, editorView.id, html))
+ val dispatcher = UIManagerHelper.getEventDispatcherForReactTag(context, view.id)
+ dispatcher?.dispatchEvent(OnChangeHtmlEvent(surfaceId, view.id, html))
}
}
diff --git a/android/src/main/java/com/swmansion/enriched/watchers/EnrichedTextWatcher.kt b/android/src/main/java/com/swmansion/enriched/watchers/EnrichedTextWatcher.kt
new file mode 100644
index 000000000..d22fdd9cf
--- /dev/null
+++ b/android/src/main/java/com/swmansion/enriched/watchers/EnrichedTextWatcher.kt
@@ -0,0 +1,46 @@
+package com.swmansion.enriched.watchers
+
+import android.text.Editable
+import android.text.TextWatcher
+import com.facebook.react.bridge.ReactContext
+import com.facebook.react.uimanager.UIManagerHelper
+import com.swmansion.enriched.EnrichedTextInputView
+import com.swmansion.enriched.events.OnChangeTextEvent
+
+class EnrichedTextWatcher(private val view: EnrichedTextInputView) : TextWatcher {
+ private var endCursorPosition: Int = 0
+ private var previousTextLength: Int = 0
+
+ override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
+ previousTextLength = s?.length ?: 0
+ }
+
+ override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
+ endCursorPosition = start + count
+ view.layoutManager.measureSize(s ?: "")
+ view.isRemovingMany = !view.isSettingValue && before > count + 1
+ }
+
+ override fun afterTextChanged(s: Editable?) {
+ if (s == null) return
+ emitEvents(s)
+
+ if (view.isSettingValue) return
+ applyStyles(s)
+ }
+
+ private fun applyStyles(s: Editable) {
+ view.inlineStyles?.afterTextChanged(s, endCursorPosition)
+ view.paragraphStyles?.afterTextChanged(s, endCursorPosition, previousTextLength)
+ view.listStyles?.afterTextChanged(s, endCursorPosition, previousTextLength)
+ view.parametrizedStyles?.afterTextChanged(s, endCursorPosition)
+ }
+
+ private fun emitEvents(s: Editable) {
+ val context = view.context as ReactContext
+ val surfaceId = UIManagerHelper.getSurfaceId(context)
+ val dispatcher = UIManagerHelper.getEventDispatcherForReactTag(context, view.id)
+ dispatcher?.dispatchEvent(OnChangeTextEvent(surfaceId, view.id, s))
+ view.spanWatcher?.emitEvent(s, null)
+ }
+}
diff --git a/android/src/main/java/com/swmansion/reactnativerichtexteditor/ReactNativeRichTextEditorViewManager.kt b/android/src/main/java/com/swmansion/reactnativerichtexteditor/ReactNativeRichTextEditorViewManager.kt
deleted file mode 100644
index 311eb4627..000000000
--- a/android/src/main/java/com/swmansion/reactnativerichtexteditor/ReactNativeRichTextEditorViewManager.kt
+++ /dev/null
@@ -1,285 +0,0 @@
-package com.swmansion.reactnativerichtexteditor
-
-import android.content.Context
-import com.facebook.react.bridge.ReadableArray
-import com.facebook.react.bridge.ReadableMap
-import com.facebook.react.module.annotations.ReactModule
-import com.facebook.react.uimanager.ReactStylesDiffMap
-import com.facebook.react.uimanager.SimpleViewManager
-import com.facebook.react.uimanager.StateWrapper
-import com.facebook.react.uimanager.ThemedReactContext
-import com.facebook.react.uimanager.ViewDefaults
-import com.facebook.react.uimanager.ViewManagerDelegate
-import com.facebook.react.uimanager.ViewProps
-import com.facebook.react.uimanager.annotations.ReactProp
-import com.facebook.react.viewmanagers.ReactNativeRichTextEditorViewManagerInterface
-import com.facebook.react.viewmanagers.ReactNativeRichTextEditorViewManagerDelegate
-import com.facebook.yoga.YogaMeasureMode
-import com.facebook.yoga.YogaMeasureOutput
-import com.swmansion.reactnativerichtexteditor.events.OnInputBlurEvent
-import com.swmansion.reactnativerichtexteditor.events.OnChangeHtmlEvent
-import com.swmansion.reactnativerichtexteditor.events.OnChangeSelectionEvent
-import com.swmansion.reactnativerichtexteditor.events.OnChangeStateEvent
-import com.swmansion.reactnativerichtexteditor.events.OnChangeTextEvent
-import com.swmansion.reactnativerichtexteditor.events.OnInputFocusEvent
-import com.swmansion.reactnativerichtexteditor.events.OnLinkDetectedEvent
-import com.swmansion.reactnativerichtexteditor.events.OnMentionDetectedEvent
-import com.swmansion.reactnativerichtexteditor.events.OnMentionEvent
-import com.swmansion.reactnativerichtexteditor.spans.EditorSpans
-import com.swmansion.reactnativerichtexteditor.styles.RichTextStyle
-import com.swmansion.reactnativerichtexteditor.utils.jsonStringToStringMap
-
-@ReactModule(name = ReactNativeRichTextEditorViewManager.NAME)
-class ReactNativeRichTextEditorViewManager : SimpleViewManager(),
- ReactNativeRichTextEditorViewManagerInterface {
- private val mDelegate: ViewManagerDelegate
- private var view: ReactNativeRichTextEditorView? = null
-
- init {
- mDelegate = ReactNativeRichTextEditorViewManagerDelegate(this)
- }
-
- override fun getDelegate(): ViewManagerDelegate? {
- return mDelegate
- }
-
- override fun getName(): String {
- return NAME
- }
-
- public override fun createViewInstance(context: ThemedReactContext): ReactNativeRichTextEditorView {
- val view = ReactNativeRichTextEditorView(context)
- this.view = view
-
- return view
- }
-
- override fun updateState(
- view: ReactNativeRichTextEditorView,
- props: ReactStylesDiffMap?,
- stateWrapper: StateWrapper?
- ): Any? {
- view.stateWrapper = stateWrapper
- return super.updateState(view, props, stateWrapper)
- }
-
- override fun getExportedCustomDirectEventTypeConstants(): MutableMap {
- val map = mutableMapOf()
- map.put(OnInputFocusEvent.EVENT_NAME, mapOf("registrationName" to OnInputFocusEvent.EVENT_NAME))
- map.put(OnInputBlurEvent.EVENT_NAME, mapOf("registrationName" to OnInputBlurEvent.EVENT_NAME))
- map.put(OnChangeTextEvent.EVENT_NAME, mapOf("registrationName" to OnChangeTextEvent.EVENT_NAME))
- map.put(OnChangeHtmlEvent.EVENT_NAME, mapOf("registrationName" to OnChangeHtmlEvent.EVENT_NAME))
- map.put(OnChangeStateEvent.EVENT_NAME, mapOf("registrationName" to OnChangeStateEvent.EVENT_NAME))
- map.put(OnLinkDetectedEvent.EVENT_NAME, mapOf("registrationName" to OnLinkDetectedEvent.EVENT_NAME))
- map.put(OnMentionDetectedEvent.EVENT_NAME, mapOf("registrationName" to OnMentionDetectedEvent.EVENT_NAME))
- map.put(OnMentionEvent.EVENT_NAME, mapOf("registrationName" to OnMentionEvent.EVENT_NAME))
- map.put(OnChangeSelectionEvent.EVENT_NAME, mapOf("registrationName" to OnChangeSelectionEvent.EVENT_NAME))
-
- return map
- }
-
- @ReactProp(name = "defaultValue")
- override fun setDefaultValue(view: ReactNativeRichTextEditorView?, value: String?) {
- view?.setValue(value)
- }
-
- @ReactProp(name = "placeholder")
- override fun setPlaceholder(view: ReactNativeRichTextEditorView?, value: String?) {
- view?.setPlaceholder(value)
- }
-
- @ReactProp(name = "placeholderTextColor", customType = "Color")
- override fun setPlaceholderTextColor(view: ReactNativeRichTextEditorView?, color: Int?) {
- view?.setPlaceholderTextColor(color)
- }
-
- @ReactProp(name = "cursorColor", customType = "Color")
- override fun setCursorColor(view: ReactNativeRichTextEditorView?, color: Int?) {
- view?.setCursorColor(color)
- }
-
- @ReactProp(name = "selectionColor", customType = "Color")
- override fun setSelectionColor(view: ReactNativeRichTextEditorView?, color: Int?) {
- view?.setSelectionColor(color)
- }
-
- @ReactProp(name = "autoFocus", defaultBoolean = false)
- override fun setAutoFocus(view: ReactNativeRichTextEditorView?, autoFocus: Boolean) {
- view?.setAutoFocus(autoFocus)
- }
-
- @ReactProp(name = "editable", defaultBoolean = true)
- override fun setEditable(view: ReactNativeRichTextEditorView?, editable: Boolean) {
- view?.isEnabled = editable
- }
-
- @ReactProp(name = "mentionIndicators")
- override fun setMentionIndicators(view: ReactNativeRichTextEditorView?, indicators: ReadableArray?) {
- if (indicators == null) return
-
- val indicatorsList = mutableListOf()
- for (i in 0 until indicators.size()) {
- val stringValue = indicators.getString(i) ?: continue
- indicatorsList.add(stringValue)
- }
-
- val indicatorsArray = indicatorsList.toTypedArray()
- view?.parametrizedStyles?.mentionIndicators = indicatorsArray
- }
-
- @ReactProp(name = "richTextStyle")
- override fun setRichTextStyle(view: ReactNativeRichTextEditorView?, style: ReadableMap?) {
- view?.richTextStyle = RichTextStyle(view, style)
- }
-
- @ReactProp(name = ViewProps.COLOR, customType = "Color")
- override fun setColor(view: ReactNativeRichTextEditorView?, color: Int?) {
- view?.setColor(color)
- }
-
- @ReactProp(name = "fontSize", defaultFloat = ViewDefaults.FONT_SIZE_SP)
- override fun setFontSize(view: ReactNativeRichTextEditorView?, size: Float) {
- view?.setFontSize(size)
- }
-
- @ReactProp(name = "fontFamily")
- override fun setFontFamily(view: ReactNativeRichTextEditorView?, family: String?) {
- view?.setFontFamily(family)
- }
-
- @ReactProp(name = "fontWeight")
- override fun setFontWeight(view: ReactNativeRichTextEditorView?, weight: String?) {
- view?.setFontWeight(weight)
- }
-
- @ReactProp(name = "fontStyle")
- override fun setFontStyle(view: ReactNativeRichTextEditorView?, style: String?) {
- view?.setFontStyle(style)
- }
-
- override fun onAfterUpdateTransaction(view: ReactNativeRichTextEditorView) {
- super.onAfterUpdateTransaction(view)
- view.updateTypeface()
- }
-
- override fun setPadding(
- view: ReactNativeRichTextEditorView?,
- left: Int,
- top: Int,
- right: Int,
- bottom: Int
- ) {
- super.setPadding(view, left, top, right, bottom)
-
- view?.setPadding(left, top, right, bottom)
- }
-
- override fun setIsOnChangeHtmlSet(view: ReactNativeRichTextEditorView?, value: Boolean) {
- // this prop isn't used on Android as of now, but the setter must be present
- }
-
- override fun setAutoCapitalize(view: ReactNativeRichTextEditorView?, flag: String?) {
- view?.setAutoCapitalize(flag)
- }
-
- override fun focus(view: ReactNativeRichTextEditorView?) {
- view?.requestFocusProgrammatically()
- }
-
- override fun blur(view: ReactNativeRichTextEditorView?) {
- view?.clearFocus()
- }
-
- override fun setValue(view: ReactNativeRichTextEditorView?, text: String) {
- view?.setValue(text)
- }
-
- override fun toggleBold(view: ReactNativeRichTextEditorView?) {
- view?.verifyAndToggleStyle(EditorSpans.BOLD)
- }
-
- override fun toggleItalic(view: ReactNativeRichTextEditorView?) {
- view?.verifyAndToggleStyle(EditorSpans.ITALIC)
- }
-
- override fun toggleUnderline(view: ReactNativeRichTextEditorView?) {
- view?.verifyAndToggleStyle(EditorSpans.UNDERLINE)
- }
-
- override fun toggleStrikeThrough(view: ReactNativeRichTextEditorView?) {
- view?.verifyAndToggleStyle(EditorSpans.STRIKETHROUGH)
- }
-
- override fun toggleInlineCode(view: ReactNativeRichTextEditorView?) {
- view?.verifyAndToggleStyle(EditorSpans.INLINE_CODE)
- }
-
- override fun toggleH1(view: ReactNativeRichTextEditorView?) {
- view?.verifyAndToggleStyle(EditorSpans.H1)
- }
-
- override fun toggleH2(view: ReactNativeRichTextEditorView?) {
- view?.verifyAndToggleStyle(EditorSpans.H2)
- }
-
- override fun toggleH3(view: ReactNativeRichTextEditorView?) {
- view?.verifyAndToggleStyle(EditorSpans.H3)
- }
-
- override fun toggleCodeBlock(view: ReactNativeRichTextEditorView?) {
- view?.verifyAndToggleStyle(EditorSpans.CODE_BLOCK)
- }
-
- override fun toggleBlockQuote(view: ReactNativeRichTextEditorView?) {
- view?.verifyAndToggleStyle(EditorSpans.BLOCK_QUOTE)
- }
-
- override fun toggleOrderedList(view: ReactNativeRichTextEditorView?) {
- view?.verifyAndToggleStyle(EditorSpans.ORDERED_LIST)
- }
-
- override fun toggleUnorderedList(view: ReactNativeRichTextEditorView?) {
- view?.verifyAndToggleStyle(EditorSpans.UNORDERED_LIST)
- }
-
- override fun addLink(view: ReactNativeRichTextEditorView?, start: Int, end: Int, text: String, url: String) {
- view?.addLink(start, end, text, url)
- }
-
- override fun addImage(view: ReactNativeRichTextEditorView?, src: String) {
- view?.addImage(src)
- }
-
- override fun startMention(view: ReactNativeRichTextEditorView?, indicator: String) {
- view?.startMention(indicator)
- }
-
- override fun addMention(view: ReactNativeRichTextEditorView?, indicator: String, text: String, payload: String) {
- val attributes = jsonStringToStringMap(payload)
- view?.addMention(text, indicator, attributes)
- }
-
- override fun measure(
- context: Context,
- localData: ReadableMap?,
- props: ReadableMap?,
- state: ReadableMap?,
- width: Float,
- widthMode: YogaMeasureMode?,
- height: Float,
- heightMode: YogaMeasureMode?,
- attachmentsPositions: FloatArray?
- ): Long {
- val size = this.view?.layoutManager?.getMeasuredSize(width)
-
- if (size != null) {
- return YogaMeasureOutput.make(size.first, size.second)
- }
-
- return YogaMeasureOutput.make(0, 0)
- }
-
- companion object {
- const val NAME = "ReactNativeRichTextEditorView"
- }
-}
diff --git a/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/EditorBoldSpan.kt b/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/EditorBoldSpan.kt
deleted file mode 100644
index d0a46910e..000000000
--- a/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/EditorBoldSpan.kt
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.swmansion.reactnativerichtexteditor.spans
-
-import android.graphics.Typeface
-import android.text.style.StyleSpan
-import com.swmansion.reactnativerichtexteditor.spans.interfaces.EditorInlineSpan
-import com.swmansion.reactnativerichtexteditor.styles.RichTextStyle
-
-@Suppress("UNUSED_PARAMETER")
-class EditorBoldSpan(private val richTextStyle: RichTextStyle) : StyleSpan(Typeface.BOLD), EditorInlineSpan {
-}
diff --git a/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/EditorH1Span.kt b/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/EditorH1Span.kt
deleted file mode 100644
index 67501e777..000000000
--- a/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/EditorH1Span.kt
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.swmansion.reactnativerichtexteditor.spans
-
-import android.graphics.Typeface
-import android.text.TextPaint
-import android.text.style.AbsoluteSizeSpan
-import com.swmansion.reactnativerichtexteditor.spans.interfaces.EditorHeadingSpan
-import com.swmansion.reactnativerichtexteditor.styles.RichTextStyle
-
-class EditorH1Span(private val style: RichTextStyle) : AbsoluteSizeSpan(style.h1FontSize), EditorHeadingSpan {
- override fun updateDrawState(tp: TextPaint) {
- super.updateDrawState(tp)
- val bold = style.h1Bold
- if (bold) {
- tp.typeface = Typeface.create(tp.typeface, Typeface.BOLD)
- }
- }
-}
diff --git a/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/EditorH2Span.kt b/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/EditorH2Span.kt
deleted file mode 100644
index bb7a6382e..000000000
--- a/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/EditorH2Span.kt
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.swmansion.reactnativerichtexteditor.spans
-
-import android.graphics.Typeface
-import android.text.TextPaint
-import android.text.style.AbsoluteSizeSpan
-import com.swmansion.reactnativerichtexteditor.spans.interfaces.EditorHeadingSpan
-import com.swmansion.reactnativerichtexteditor.styles.RichTextStyle
-
-class EditorH2Span(private val richTextStyle: RichTextStyle) : AbsoluteSizeSpan(richTextStyle.h2FontSize), EditorHeadingSpan {
- override fun updateDrawState(tp: TextPaint) {
- super.updateDrawState(tp)
- val bold = richTextStyle.h2Bold
- if (bold) {
- tp.typeface = Typeface.create(tp.typeface, Typeface.BOLD)
- }
- }
-}
diff --git a/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/EditorH3Span.kt b/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/EditorH3Span.kt
deleted file mode 100644
index 40544262d..000000000
--- a/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/EditorH3Span.kt
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.swmansion.reactnativerichtexteditor.spans
-
-import android.graphics.Typeface
-import android.text.TextPaint
-import android.text.style.AbsoluteSizeSpan
-import com.swmansion.reactnativerichtexteditor.spans.interfaces.EditorHeadingSpan
-import com.swmansion.reactnativerichtexteditor.styles.RichTextStyle
-
-class EditorH3Span(private val richTextStyle: RichTextStyle) : AbsoluteSizeSpan(richTextStyle.h3FontSize), EditorHeadingSpan {
- override fun updateDrawState(tp: TextPaint) {
- super.updateDrawState(tp)
- val bold = richTextStyle.h3Bold
- if (bold) {
- tp.typeface = Typeface.create(tp.typeface, Typeface.BOLD)
- }
- }
-}
diff --git a/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/EditorInlineCodeSpan.kt b/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/EditorInlineCodeSpan.kt
deleted file mode 100644
index 79166feb4..000000000
--- a/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/EditorInlineCodeSpan.kt
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.swmansion.reactnativerichtexteditor.spans
-
-import android.graphics.Typeface
-import android.text.TextPaint
-import android.text.style.BackgroundColorSpan
-import com.swmansion.reactnativerichtexteditor.spans.interfaces.EditorInlineSpan
-import com.swmansion.reactnativerichtexteditor.styles.RichTextStyle
-
-class EditorInlineCodeSpan(private val richTextStyle: RichTextStyle) : BackgroundColorSpan(richTextStyle.inlineCodeBackgroundColor), EditorInlineSpan {
- override fun updateDrawState(textPaint: TextPaint) {
- super.updateDrawState(textPaint)
-
- textPaint.color = richTextStyle.inlineCodeColor
- textPaint.typeface = Typeface.create(Typeface.MONOSPACE, Typeface.NORMAL)
- }
-}
diff --git a/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/EditorItalicSpan.kt b/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/EditorItalicSpan.kt
deleted file mode 100644
index ce9ce7ba2..000000000
--- a/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/EditorItalicSpan.kt
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.swmansion.reactnativerichtexteditor.spans
-
-import android.graphics.Typeface
-import android.text.style.StyleSpan
-import com.swmansion.reactnativerichtexteditor.spans.interfaces.EditorInlineSpan
-import com.swmansion.reactnativerichtexteditor.styles.RichTextStyle
-
-@Suppress("UNUSED_PARAMETER")
-class EditorItalicSpan(private val richTextStyle: RichTextStyle) : StyleSpan(Typeface.ITALIC), EditorInlineSpan {
-}
diff --git a/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/EditorLinkSpan.kt b/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/EditorLinkSpan.kt
deleted file mode 100644
index 96d0e7665..000000000
--- a/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/EditorLinkSpan.kt
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.swmansion.reactnativerichtexteditor.spans
-
-import android.text.TextPaint
-import android.text.style.ClickableSpan
-import android.view.View
-import com.swmansion.reactnativerichtexteditor.spans.interfaces.EditorInlineSpan
-import com.swmansion.reactnativerichtexteditor.styles.RichTextStyle
-
-class EditorLinkSpan(private val url: String, private val richTextStyle: RichTextStyle) : ClickableSpan(), EditorInlineSpan {
- override fun onClick(view: View) {
- // Do nothing, links inside the editor are not clickable.
- // We are using `ClickableSpan` to allow the text to be styled as a link.
- }
-
- override fun updateDrawState(textPaint: TextPaint) {
- super.updateDrawState(textPaint)
- textPaint.color = richTextStyle.aColor
- textPaint.isUnderlineText = richTextStyle.aUnderline
- }
-
- fun getUrl(): String {
- return url
- }
-}
diff --git a/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/EditorStrikeThroughSpan.kt b/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/EditorStrikeThroughSpan.kt
deleted file mode 100644
index 6868332dd..000000000
--- a/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/EditorStrikeThroughSpan.kt
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.swmansion.reactnativerichtexteditor.spans
-
-import android.text.style.StrikethroughSpan
-import com.swmansion.reactnativerichtexteditor.spans.interfaces.EditorInlineSpan
-import com.swmansion.reactnativerichtexteditor.styles.RichTextStyle
-
-@Suppress("UNUSED_PARAMETER")
-class EditorStrikeThroughSpan(private val richTextStyle: RichTextStyle) : StrikethroughSpan(), EditorInlineSpan {
-}
diff --git a/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/EditorUnderlineSpan.kt b/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/EditorUnderlineSpan.kt
deleted file mode 100644
index befd64eed..000000000
--- a/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/EditorUnderlineSpan.kt
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.swmansion.reactnativerichtexteditor.spans
-
-import android.text.style.UnderlineSpan
-import com.swmansion.reactnativerichtexteditor.spans.interfaces.EditorInlineSpan
-import com.swmansion.reactnativerichtexteditor.styles.RichTextStyle
-
-@Suppress("UNUSED_PARAMETER")
-class EditorUnderlineSpan(private val richTextStyle: RichTextStyle) : UnderlineSpan(), EditorInlineSpan {
-}
diff --git a/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/interfaces/EditorBlockSpan.kt b/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/interfaces/EditorBlockSpan.kt
deleted file mode 100644
index c6edbe356..000000000
--- a/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/interfaces/EditorBlockSpan.kt
+++ /dev/null
@@ -1,4 +0,0 @@
-package com.swmansion.reactnativerichtexteditor.spans.interfaces
-
-interface EditorBlockSpan : EditorSpan, EditorZeroWidthSpaceSpan {
-}
diff --git a/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/interfaces/EditorHeadingSpan.kt b/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/interfaces/EditorHeadingSpan.kt
deleted file mode 100644
index 6fa7a1664..000000000
--- a/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/interfaces/EditorHeadingSpan.kt
+++ /dev/null
@@ -1,4 +0,0 @@
-package com.swmansion.reactnativerichtexteditor.spans.interfaces
-
-interface EditorHeadingSpan : EditorParagraphSpan {
-}
diff --git a/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/interfaces/EditorInlineSpan.kt b/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/interfaces/EditorInlineSpan.kt
deleted file mode 100644
index fd9bc4e10..000000000
--- a/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/interfaces/EditorInlineSpan.kt
+++ /dev/null
@@ -1,4 +0,0 @@
-package com.swmansion.reactnativerichtexteditor.spans.interfaces
-
-interface EditorInlineSpan : EditorSpan {
-}
diff --git a/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/interfaces/EditorParagraphSpan.kt b/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/interfaces/EditorParagraphSpan.kt
deleted file mode 100644
index 65a6e98a7..000000000
--- a/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/interfaces/EditorParagraphSpan.kt
+++ /dev/null
@@ -1,4 +0,0 @@
-package com.swmansion.reactnativerichtexteditor.spans.interfaces
-
-interface EditorParagraphSpan : EditorSpan, EditorZeroWidthSpaceSpan {
-}
diff --git a/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/interfaces/EditorSpan.kt b/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/interfaces/EditorSpan.kt
deleted file mode 100644
index f9f9b38cb..000000000
--- a/android/src/main/java/com/swmansion/reactnativerichtexteditor/spans/interfaces/EditorSpan.kt
+++ /dev/null
@@ -1,4 +0,0 @@
-package com.swmansion.reactnativerichtexteditor.spans.interfaces
-
-interface EditorSpan {
-}
diff --git a/android/src/main/java/com/swmansion/reactnativerichtexteditor/watchers/EditorTextWatcher.kt b/android/src/main/java/com/swmansion/reactnativerichtexteditor/watchers/EditorTextWatcher.kt
deleted file mode 100644
index e13ec89e5..000000000
--- a/android/src/main/java/com/swmansion/reactnativerichtexteditor/watchers/EditorTextWatcher.kt
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.swmansion.reactnativerichtexteditor.watchers
-
-import android.text.Editable
-import android.text.TextWatcher
-import com.facebook.react.bridge.ReactContext
-import com.facebook.react.uimanager.UIManagerHelper
-import com.swmansion.reactnativerichtexteditor.ReactNativeRichTextEditorView
-import com.swmansion.reactnativerichtexteditor.events.OnChangeTextEvent
-
-class EditorTextWatcher(private val editorView: ReactNativeRichTextEditorView) : TextWatcher {
- private var endCursorPosition: Int = 0
- private var previousTextLength: Int = 0
-
- override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
- previousTextLength = s?.length ?: 0
- }
-
- override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
- endCursorPosition = start + count
- editorView.layoutManager.measureSize(s ?: "")
- editorView.isRemovingMany = !editorView.isSettingValue && before > count + 1
- }
-
- override fun afterTextChanged(s: Editable?) {
- if (s == null) return
- emitEvents(s)
-
- if (editorView.isSettingValue) return
- applyStyles(s)
- }
-
- private fun applyStyles(s: Editable) {
- editorView.inlineStyles?.afterTextChanged(s, endCursorPosition)
- editorView.paragraphStyles?.afterTextChanged(s, endCursorPosition, previousTextLength)
- editorView.listStyles?.afterTextChanged(s, endCursorPosition, previousTextLength)
- editorView.parametrizedStyles?.afterTextChanged(s, endCursorPosition)
- }
-
- private fun emitEvents(s: Editable) {
- val context = editorView.context as ReactContext
- val surfaceId = UIManagerHelper.getSurfaceId(context)
- val dispatcher = UIManagerHelper.getEventDispatcherForReactTag(context, editorView.id)
- dispatcher?.dispatchEvent(OnChangeTextEvent(surfaceId, editorView.id, s))
- editorView.spanWatcher?.emitEvent(s, null)
- }
-}
diff --git a/android/src/main/new_arch/CMakeLists.txt b/android/src/main/new_arch/CMakeLists.txt
index e3e12bac2..be99d0f8a 100644
--- a/android/src/main/new_arch/CMakeLists.txt
+++ b/android/src/main/new_arch/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)
-set(LIB_LITERAL RNReactNativeRichTextEditorViewSpec)
+set(LIB_LITERAL RNEnrichedTextInputViewSpec)
set(LIB_TARGET_NAME react_codegen_${LIB_LITERAL})
set(LIB_ANDROID_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../..)
diff --git a/android/src/main/new_arch/RNReactNativeRichTextEditorViewSpec.cpp b/android/src/main/new_arch/RNEnrichedTextInputViewSpec.cpp
similarity index 64%
rename from android/src/main/new_arch/RNReactNativeRichTextEditorViewSpec.cpp
rename to android/src/main/new_arch/RNEnrichedTextInputViewSpec.cpp
index 58b731922..775c9e07c 100644
--- a/android/src/main/new_arch/RNReactNativeRichTextEditorViewSpec.cpp
+++ b/android/src/main/new_arch/RNEnrichedTextInputViewSpec.cpp
@@ -8,13 +8,13 @@
* @generated by codegen project: GenerateModuleJniCpp.js
*/
-#include "RNReactNativeRichTextEditorViewSpec.h"
+#include "RNEnrichedTextInputViewSpec.h"
namespace facebook::react {
-std::shared_ptr RNReactNativeRichTextEditorViewSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms) {
+std::shared_ptr RNEnrichedTextInputViewSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms) {
return nullptr;
}
diff --git a/android/src/main/new_arch/RNReactNativeRichTextEditorViewSpec.h b/android/src/main/new_arch/RNEnrichedTextInputViewSpec.h
similarity index 63%
rename from android/src/main/new_arch/RNReactNativeRichTextEditorViewSpec.h
rename to android/src/main/new_arch/RNEnrichedTextInputViewSpec.h
index cbe6428c4..d37e4e5cc 100644
--- a/android/src/main/new_arch/RNReactNativeRichTextEditorViewSpec.h
+++ b/android/src/main/new_arch/RNEnrichedTextInputViewSpec.h
@@ -14,13 +14,13 @@
#include
#include
-#include
+#include
namespace facebook::react {
JSI_EXPORT
-std::shared_ptr RNReactNativeRichTextEditorViewSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms);
+std::shared_ptr RNEnrichedTextInputViewSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms);
} // namespace facebook::react
diff --git a/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputComponentDescriptor.h b/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputComponentDescriptor.h
new file mode 100644
index 000000000..0e0f51f3c
--- /dev/null
+++ b/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputComponentDescriptor.h
@@ -0,0 +1,35 @@
+#pragma once
+
+#include "EnrichedTextInputMeasurementManager.h"
+#include "EnrichedTextInputShadowNode.h"
+
+#include
+
+namespace facebook::react {
+
+class EnrichedTextInputComponentDescriptor final
+ : public ConcreteComponentDescriptor {
+public:
+ EnrichedTextInputComponentDescriptor(
+ const ComponentDescriptorParameters& parameters)
+ : ConcreteComponentDescriptor(parameters),
+ measurementsManager_(
+ std::make_shared(
+ contextContainer_)) {}
+
+ void adopt(ShadowNode& shadowNode) const override {
+ ConcreteComponentDescriptor::adopt(shadowNode);
+ auto& editorShadowNode = static_cast(shadowNode);
+
+ // `EnrichedTextInputShadowNode` uses
+ // `EnrichedTextInputMeasurementManager` to provide measurements to Yoga.
+ editorShadowNode.setMeasurementsManager(measurementsManager_);
+ }
+
+private:
+ const std::shared_ptr
+ measurementsManager_;
+};
+
+} // namespace facebook::react
+
diff --git a/android/src/main/new_arch/react/renderer/components/RNReactNativeRichTextEditorViewSpec/RichTextEditorMeasurementManager.cpp b/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputMeasurementManager.cpp
similarity index 85%
rename from android/src/main/new_arch/react/renderer/components/RNReactNativeRichTextEditorViewSpec/RichTextEditorMeasurementManager.cpp
rename to android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputMeasurementManager.cpp
index d6132cba9..0906ddbb8 100644
--- a/android/src/main/new_arch/react/renderer/components/RNReactNativeRichTextEditorViewSpec/RichTextEditorMeasurementManager.cpp
+++ b/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputMeasurementManager.cpp
@@ -1,4 +1,4 @@
-#include "RichTextEditorMeasurementManager.h"
+#include "EnrichedTextInputMeasurementManager.h"
#include
#include
@@ -8,9 +8,9 @@ using namespace facebook::jni;
namespace facebook::react {
- Size RichTextEditorMeasurementManager::measure(
+ Size EnrichedTextInputMeasurementManager::measure(
SurfaceId surfaceId,
- const ReactNativeRichTextEditorViewProps& props,
+ const EnrichedTextInputViewProps& props,
LayoutConstraints layoutConstraints) const {
const jni::global_ref& fabricUIManager =
contextContainer_->at>("FabricUIManager");
@@ -31,7 +31,7 @@ namespace facebook::react {
auto minimumSize = layoutConstraints.minimumSize;
auto maximumSize = layoutConstraints.maximumSize;
- local_ref componentName = make_jstring("ReactNativeRichTextEditorView");
+ local_ref componentName = make_jstring("EnrichedTextInputView");
auto measurement = yogaMeassureToSize(measure(
fabricUIManager,
diff --git a/android/src/main/new_arch/react/renderer/components/RNReactNativeRichTextEditorViewSpec/RichTextEditorMeasurementManager.h b/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputMeasurementManager.h
similarity index 69%
rename from android/src/main/new_arch/react/renderer/components/RNReactNativeRichTextEditorViewSpec/RichTextEditorMeasurementManager.h
rename to android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputMeasurementManager.h
index d5a56b032..78b79eead 100644
--- a/android/src/main/new_arch/react/renderer/components/RNReactNativeRichTextEditorViewSpec/RichTextEditorMeasurementManager.h
+++ b/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputMeasurementManager.h
@@ -4,19 +4,19 @@
#include
#include
-#include
+#include
namespace facebook::react {
- class RichTextEditorMeasurementManager {
+ class EnrichedTextInputMeasurementManager {
public:
- RichTextEditorMeasurementManager(
+ EnrichedTextInputMeasurementManager(
const ContextContainer::Shared& contextContainer)
: contextContainer_(contextContainer) {}
Size measure(
SurfaceId surfaceId,
- const ReactNativeRichTextEditorViewProps& props,
+ const EnrichedTextInputViewProps& props,
LayoutConstraints layoutConstraints) const;
private:
diff --git a/android/src/main/new_arch/react/renderer/components/RNReactNativeRichTextEditorViewSpec/ReactNativeRichTextEditorShadowNode.cpp b/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputShadowNode.cpp
similarity index 68%
rename from android/src/main/new_arch/react/renderer/components/RNReactNativeRichTextEditorViewSpec/ReactNativeRichTextEditorShadowNode.cpp
rename to android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputShadowNode.cpp
index c0c424d9f..8d89e816e 100644
--- a/android/src/main/new_arch/react/renderer/components/RNReactNativeRichTextEditorViewSpec/ReactNativeRichTextEditorShadowNode.cpp
+++ b/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputShadowNode.cpp
@@ -1,11 +1,11 @@
-#include "ReactNativeRichTextEditorShadowNode.h"
+#include "EnrichedTextInputShadowNode.h"
#include
namespace facebook::react {
-extern const char ReactNativeRichTextEditorComponentName[] = "ReactNativeRichTextEditorView";
- void ReactNativeRichTextEditorShadowNode::setMeasurementsManager(
- const std::shared_ptr&
+extern const char EnrichedTextInputComponentName[] = "EnrichedTextInputView";
+ void EnrichedTextInputShadowNode::setMeasurementsManager(
+ const std::shared_ptr&
measurementsManager) {
ensureUnsealed();
measurementsManager_ = measurementsManager;
@@ -13,7 +13,7 @@ extern const char ReactNativeRichTextEditorComponentName[] = "ReactNativeRichTex
// Mark layout as dirty after state has been updated
// Once layout is marked as dirty, `measureContent` will be called in order to recalculate layout
- void ReactNativeRichTextEditorShadowNode::dirtyLayoutIfNeeded() {
+ void EnrichedTextInputShadowNode::dirtyLayoutIfNeeded() {
const auto state = this->getStateData();
const auto counter = state.getForceHeightRecalculationCounter();
@@ -24,7 +24,7 @@ extern const char ReactNativeRichTextEditorComponentName[] = "ReactNativeRichTex
}
}
- Size ReactNativeRichTextEditorShadowNode::measureContent(
+ Size EnrichedTextInputShadowNode::measureContent(
const LayoutContext &layoutContext,
const LayoutConstraints &layoutConstraints) const {
diff --git a/android/src/main/new_arch/react/renderer/components/RNReactNativeRichTextEditorViewSpec/ReactNativeRichTextEditorShadowNode.h b/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputShadowNode.h
similarity index 53%
rename from android/src/main/new_arch/react/renderer/components/RNReactNativeRichTextEditorViewSpec/ReactNativeRichTextEditorShadowNode.h
rename to android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputShadowNode.h
index 025eeb582..6ff3e3ce6 100644
--- a/android/src/main/new_arch/react/renderer/components/RNReactNativeRichTextEditorViewSpec/ReactNativeRichTextEditorShadowNode.h
+++ b/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputShadowNode.h
@@ -1,28 +1,28 @@
#pragma once
-#include "RichTextEditorMeasurementManager.h"
-#include "ReactNativeRichTextEditorViewState.h"
+#include "EnrichedTextInputMeasurementManager.h"
+#include "EnrichedTextInputState.h"
#include
-#include
-#include
+#include
+#include
namespace facebook::react {
-JSI_EXPORT extern const char ReactNativeRichTextEditorComponentName[];
+JSI_EXPORT extern const char EnrichedTextInputComponentName[];
/*
- * `ShadowNode` for component.
+ * `ShadowNode` for component.
*/
-class ReactNativeRichTextEditorShadowNode final : public ConcreteViewShadowNode<
- ReactNativeRichTextEditorComponentName,
- ReactNativeRichTextEditorViewProps,
- ReactNativeRichTextEditorViewEventEmitter,
- ReactNativeRichTextEditorViewState> {
+class EnrichedTextInputShadowNode final : public ConcreteViewShadowNode<
+ EnrichedTextInputComponentName,
+ EnrichedTextInputViewProps,
+ EnrichedTextInputViewEventEmitter,
+ EnrichedTextInputState> {
public:
using ConcreteViewShadowNode::ConcreteViewShadowNode;
// This constructor is called when we "update" shadow node, e.g. after updating shadow node's state
- ReactNativeRichTextEditorShadowNode(
+ EnrichedTextInputShadowNode(
ShadowNode const &sourceShadowNode,
ShadowNodeFragment const &fragment)
: ConcreteViewShadowNode(sourceShadowNode, fragment) {
@@ -36,9 +36,9 @@ class ReactNativeRichTextEditorShadowNode final : public ConcreteViewShadowNode<
return traits;
}
- // Associates a shared `RichTextEditorMeasurementManager` with the node.
+ // Associates a shared `EnrichedTextInputMeasurementManager` with the node.
void setMeasurementsManager(
- const std::shared_ptr&
+ const std::shared_ptr&
measurementsManager);
void dirtyLayoutIfNeeded();
@@ -49,6 +49,6 @@ class ReactNativeRichTextEditorShadowNode final : public ConcreteViewShadowNode<
private:
int forceHeightRecalculationCounter_;
- std::shared_ptr measurementsManager_;
+ std::shared_ptr measurementsManager_;
};
} // namespace facebook::react
diff --git a/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputState.cpp b/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputState.cpp
new file mode 100644
index 000000000..31287bd87
--- /dev/null
+++ b/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputState.cpp
@@ -0,0 +1,9 @@
+#include "EnrichedTextInputState.h"
+
+namespace facebook::react {
+
+ int EnrichedTextInputState::getForceHeightRecalculationCounter() const {
+ return forceHeightRecalculationCounter_;
+ }
+
+}
diff --git a/android/src/main/new_arch/react/renderer/components/RNReactNativeRichTextEditorViewSpec/ReactNativeRichTextEditorViewState.h b/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputState.h
similarity index 71%
rename from android/src/main/new_arch/react/renderer/components/RNReactNativeRichTextEditorViewSpec/ReactNativeRichTextEditorViewState.h
rename to android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputState.h
index dc0f68fe1..31980e453 100644
--- a/android/src/main/new_arch/react/renderer/components/RNReactNativeRichTextEditorViewSpec/ReactNativeRichTextEditorViewState.h
+++ b/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputState.h
@@ -4,13 +4,13 @@
namespace facebook::react {
- class ReactNativeRichTextEditorViewState {
+ class EnrichedTextInputState {
public:
- ReactNativeRichTextEditorViewState()
+ EnrichedTextInputState()
: forceHeightRecalculationCounter_(0) {}
// Used by Kotlin to set current text value
- ReactNativeRichTextEditorViewState(ReactNativeRichTextEditorViewState const &previousState, folly::dynamic data)
+ EnrichedTextInputState(EnrichedTextInputState const &previousState, folly::dynamic data)
: forceHeightRecalculationCounter_((int)data["forceHeightRecalculationCounter"].getInt()){};
folly::dynamic getDynamic() const {
return {};
diff --git a/android/src/main/new_arch/react/renderer/components/RNReactNativeRichTextEditorViewSpec/ReactNativeRichTextEditorViewComponentDescriptor.h b/android/src/main/new_arch/react/renderer/components/RNReactNativeRichTextEditorViewSpec/ReactNativeRichTextEditorViewComponentDescriptor.h
deleted file mode 100644
index 02d5a5dfd..000000000
--- a/android/src/main/new_arch/react/renderer/components/RNReactNativeRichTextEditorViewSpec/ReactNativeRichTextEditorViewComponentDescriptor.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#pragma once
-
-#include "RichTextEditorMeasurementManager.h"
-#include "ReactNativeRichTextEditorShadowNode.h"
-
-#include
-
-namespace facebook::react {
-
-class ReactNativeRichTextEditorViewComponentDescriptor final
- : public ConcreteComponentDescriptor {
-public:
- ReactNativeRichTextEditorViewComponentDescriptor(
- const ComponentDescriptorParameters& parameters)
- : ConcreteComponentDescriptor(parameters),
- measurementsManager_(
- std::make_shared(
- contextContainer_)) {}
-
- void adopt(ShadowNode& shadowNode) const override {
- ConcreteComponentDescriptor::adopt(shadowNode);
- auto& editorShadowNode = static_cast(shadowNode);
-
- // `ReactNativeRichTextEditorShadowNode` uses
- // `RichTextEditorMeasurementManager` to provide measurements to Yoga.
- editorShadowNode.setMeasurementsManager(measurementsManager_);
- }
-
-private:
- const std::shared_ptr
- measurementsManager_;
-};
-
-} // namespace facebook::react
-
diff --git a/android/src/main/new_arch/react/renderer/components/RNReactNativeRichTextEditorViewSpec/ReactNativeRichTextEditorViewState.cpp b/android/src/main/new_arch/react/renderer/components/RNReactNativeRichTextEditorViewSpec/ReactNativeRichTextEditorViewState.cpp
deleted file mode 100644
index 54295d2cf..000000000
--- a/android/src/main/new_arch/react/renderer/components/RNReactNativeRichTextEditorViewSpec/ReactNativeRichTextEditorViewState.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-#include "ReactNativeRichTextEditorViewState.h"
-
-namespace facebook::react {
-
- int ReactNativeRichTextEditorViewState::getForceHeightRecalculationCounter() const {
- return forceHeightRecalculationCounter_;
- }
-
-}
diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle
index ed3a6061f..57f92c43b 100644
--- a/example/android/app/build.gradle
+++ b/example/android/app/build.gradle
@@ -77,9 +77,9 @@ android {
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdk rootProject.ext.compileSdkVersion
- namespace "swmansion.reactnativerichtexteditor.example"
+ namespace "swmansion.enriched.example"
defaultConfig {
- applicationId "swmansion.reactnativerichtexteditor.example"
+ applicationId "swmansion.enriched.example"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
diff --git a/example/android/app/src/main/java/swmansion/reactnativerichtexteditor/example/MainActivity.kt b/example/android/app/src/main/java/swmansion/enriched/example/MainActivity.kt
similarity index 85%
rename from example/android/app/src/main/java/swmansion/reactnativerichtexteditor/example/MainActivity.kt
rename to example/android/app/src/main/java/swmansion/enriched/example/MainActivity.kt
index 58e64e5c0..e234b0c52 100644
--- a/example/android/app/src/main/java/swmansion/reactnativerichtexteditor/example/MainActivity.kt
+++ b/example/android/app/src/main/java/swmansion/enriched/example/MainActivity.kt
@@ -1,4 +1,4 @@
-package swmansion.reactnativerichtexteditor.example
+package swmansion.enriched.example
import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate
@@ -11,7 +11,7 @@ class MainActivity : ReactActivity() {
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
*/
- override fun getMainComponentName(): String = "ReactNativeRichTextEditorExample"
+ override fun getMainComponentName(): String = "EnrichedTextInputExample"
/**
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
diff --git a/example/android/app/src/main/java/swmansion/reactnativerichtexteditor/example/MainApplication.kt b/example/android/app/src/main/java/swmansion/enriched/example/MainApplication.kt
similarity index 96%
rename from example/android/app/src/main/java/swmansion/reactnativerichtexteditor/example/MainApplication.kt
rename to example/android/app/src/main/java/swmansion/enriched/example/MainApplication.kt
index 4541cb8bb..af3b37d7a 100644
--- a/example/android/app/src/main/java/swmansion/reactnativerichtexteditor/example/MainApplication.kt
+++ b/example/android/app/src/main/java/swmansion/enriched/example/MainApplication.kt
@@ -1,4 +1,4 @@
-package swmansion.reactnativerichtexteditor.example
+package swmansion.enriched.example
import android.app.Application
import com.facebook.react.PackageList
diff --git a/example/android/app/src/main/res/values/strings.xml b/example/android/app/src/main/res/values/strings.xml
index 146b5853b..312ad6f15 100644
--- a/example/android/app/src/main/res/values/strings.xml
+++ b/example/android/app/src/main/res/values/strings.xml
@@ -1,3 +1,3 @@
- ReactNativeRichTextEditorExample
+ ReactNativeEnrichedExample
diff --git a/example/android/settings.gradle b/example/android/settings.gradle
index ee29500aa..654eb0af1 100644
--- a/example/android/settings.gradle
+++ b/example/android/settings.gradle
@@ -1,6 +1,6 @@
pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
plugins { id("com.facebook.react.settings") }
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
-rootProject.name = 'swmansion.reactnativerichtexteditor.example'
+rootProject.name = 'swmansion.enriched.example'
include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')
diff --git a/example/app.json b/example/app.json
index 6f96d1ab6..d9ebebe7f 100644
--- a/example/app.json
+++ b/example/app.json
@@ -1,4 +1,4 @@
{
- "name": "ReactNativeRichTextEditorExample",
- "displayName": "ReactNativeRichTextEditorExample"
+ "name": "EnrichedTextInputExample",
+ "displayName": "ReactNativeEnrichedExample"
}
diff --git a/example/ios/ReactNativeRichTextEditorExample.xcodeproj/project.pbxproj b/example/ios/EnrichedTextInputExample.xcodeproj/project.pbxproj
similarity index 83%
rename from example/ios/ReactNativeRichTextEditorExample.xcodeproj/project.pbxproj
rename to example/ios/EnrichedTextInputExample.xcodeproj/project.pbxproj
index 69c113344..630ee5059 100644
--- a/example/ios/ReactNativeRichTextEditorExample.xcodeproj/project.pbxproj
+++ b/example/ios/EnrichedTextInputExample.xcodeproj/project.pbxproj
@@ -26,19 +26,17 @@
907A3D37EC6F4B9DA1B70348 /* CascadiaCode-ExtraLight.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 4A13A7631B3C499C989AC38A /* CascadiaCode-ExtraLight.ttf */; };
95A487B0B0A94AFDA7B10C06 /* FontAwesome.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D133E950DA6A4BC0A97DDFFE /* FontAwesome.ttf */; };
970142F6180042E5964006A6 /* CascadiaCode-Light.ttf in Resources */ = {isa = PBXBuildFile; fileRef = DA76D9192FE24EC28C84DE79 /* CascadiaCode-Light.ttf */; };
+ 9CCBAA226FD195143DDD2884 /* libPods-EnrichedTextInputExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D370084B15B932DA6ABD7D8 /* libPods-EnrichedTextInputExample.a */; };
D8B2038262614F14AE6245F0 /* CascadiaCode-SemiBoldItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 4DA2D2AB9E3743888DAD5779 /* CascadiaCode-SemiBoldItalic.ttf */; };
DCB0457B1CAE40B29979CDB9 /* CascadiaCode-VariableFont_wght.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D384E64346204A8C8E773595 /* CascadiaCode-VariableFont_wght.ttf */; };
- E6AE3E75AAB6AEA81E4636B6 /* libPods-ReactNativeRichTextEditorExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1BE313EFA3DE90E22B2A2BB6 /* libPods-ReactNativeRichTextEditorExample.a */; };
F83E68A3773947EA87D1FD9C /* CascadiaCode-SemiBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3FD646A3FF0F4F33AC65021F /* CascadiaCode-SemiBold.ttf */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
- 13B07F961A680F5B00A75B9A /* ReactNativeRichTextEditorExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ReactNativeRichTextEditorExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
- 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = ReactNativeRichTextEditorExample/Images.xcassets; sourceTree = ""; };
- 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = ReactNativeRichTextEditorExample/Info.plist; sourceTree = ""; };
- 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = ReactNativeRichTextEditorExample/PrivacyInfo.xcprivacy; sourceTree = ""; };
- 1BE313EFA3DE90E22B2A2BB6 /* libPods-ReactNativeRichTextEditorExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ReactNativeRichTextEditorExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
- 30BAB32B24F7542D489838C7 /* Pods-ReactNativeRichTextEditorExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativeRichTextEditorExample.release.xcconfig"; path = "Target Support Files/Pods-ReactNativeRichTextEditorExample/Pods-ReactNativeRichTextEditorExample.release.xcconfig"; sourceTree = ""; };
+ 13B07F961A680F5B00A75B9A /* EnrichedTextInputExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EnrichedTextInputExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = EnrichedTextInputExample/Images.xcassets; sourceTree = ""; };
+ 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = EnrichedTextInputExample/Info.plist; sourceTree = ""; };
+ 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = EnrichedTextInputExample/PrivacyInfo.xcprivacy; sourceTree = ""; };
3A18DEB91C24449AA3ECE59A /* CascadiaCode-Italic-VariableFont_wght.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = "CascadiaCode-Italic-VariableFont_wght.ttf"; path = "../assets/fonts/Cascadia_Code/CascadiaCode-Italic-VariableFont_wght.ttf"; sourceTree = ""; };
3FD646A3FF0F4F33AC65021F /* CascadiaCode-SemiBold.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = "CascadiaCode-SemiBold.ttf"; path = "../assets/fonts/Cascadia_Code/static/CascadiaCode-SemiBold.ttf"; sourceTree = ""; };
4A13A7631B3C499C989AC38A /* CascadiaCode-ExtraLight.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = "CascadiaCode-ExtraLight.ttf"; path = "../assets/fonts/Cascadia_Code/static/CascadiaCode-ExtraLight.ttf"; sourceTree = ""; };
@@ -47,16 +45,18 @@
5D1BB596339A4F8E8CBC2087 /* CascadiaCode-BoldItalic.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = "CascadiaCode-BoldItalic.ttf"; path = "../assets/fonts/Cascadia_Code/static/CascadiaCode-BoldItalic.ttf"; sourceTree = ""; };
6352E13F84F841D5A2BA25B4 /* CascadiaCode-Italic.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = "CascadiaCode-Italic.ttf"; path = "../assets/fonts/Cascadia_Code/static/CascadiaCode-Italic.ttf"; sourceTree = ""; };
674C8E7598D647768ECEC0E1 /* OFL.txt */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = OFL.txt; path = ../assets/fonts/Cascadia_Code/OFL.txt; sourceTree = ""; };
- 761780EC2CA45674006654EE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = ReactNativeRichTextEditorExample/AppDelegate.swift; sourceTree = ""; };
+ 6D370084B15B932DA6ABD7D8 /* libPods-EnrichedTextInputExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-EnrichedTextInputExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 761780EC2CA45674006654EE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = EnrichedTextInputExample/AppDelegate.swift; sourceTree = ""; };
78D6C09519344432B162E948 /* CascadiaCode-MediumItalic.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = "CascadiaCode-MediumItalic.ttf"; path = "../assets/fonts/Cascadia_Code/static/CascadiaCode-MediumItalic.ttf"; sourceTree = ""; };
79452663257A4B73B2308643 /* CascadiaCode-Bold.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = "CascadiaCode-Bold.ttf"; path = "../assets/fonts/Cascadia_Code/static/CascadiaCode-Bold.ttf"; sourceTree = ""; };
7DDEBA1C438F415493ECFAB7 /* CascadiaCode-ExtraLightItalic.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = "CascadiaCode-ExtraLightItalic.ttf"; path = "../assets/fonts/Cascadia_Code/static/CascadiaCode-ExtraLightItalic.ttf"; sourceTree = ""; };
7FD036FA17B24AAFA7082B2A /* CascadiaCode-LightItalic.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = "CascadiaCode-LightItalic.ttf"; path = "../assets/fonts/Cascadia_Code/static/CascadiaCode-LightItalic.ttf"; sourceTree = ""; };
- 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = ReactNativeRichTextEditorExample/LaunchScreen.storyboard; sourceTree = ""; };
+ 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = EnrichedTextInputExample/LaunchScreen.storyboard; sourceTree = ""; };
87375222174145AD85B4DE62 /* CascadiaCode-Medium.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = "CascadiaCode-Medium.ttf"; path = "../assets/fonts/Cascadia_Code/static/CascadiaCode-Medium.ttf"; sourceTree = ""; };
8A425B9B75B9488EA0FDF624 /* README.txt */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = README.txt; path = ../assets/fonts/Cascadia_Code/README.txt; sourceTree = ""; };
+ 8D30641E04B3C92750094BD1 /* Pods-EnrichedTextInputExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-EnrichedTextInputExample.release.xcconfig"; path = "Target Support Files/Pods-EnrichedTextInputExample/Pods-EnrichedTextInputExample.release.xcconfig"; sourceTree = ""; };
+ ABB962282C7DB4F364360154 /* Pods-EnrichedTextInputExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-EnrichedTextInputExample.debug.xcconfig"; path = "Target Support Files/Pods-EnrichedTextInputExample/Pods-EnrichedTextInputExample.debug.xcconfig"; sourceTree = ""; };
C667157990F34428AEE8CC93 /* FontAwesome.json */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome.json; path = ../assets/icons/FontAwesome.json; sourceTree = ""; };
- CE2992D25A1E9E45E24B984C /* Pods-ReactNativeRichTextEditorExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativeRichTextEditorExample.debug.xcconfig"; path = "Target Support Files/Pods-ReactNativeRichTextEditorExample/Pods-ReactNativeRichTextEditorExample.debug.xcconfig"; sourceTree = ""; };
D133E950DA6A4BC0A97DDFFE /* FontAwesome.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome.ttf; path = ../assets/icons/FontAwesome.ttf; sourceTree = ""; };
D384E64346204A8C8E773595 /* CascadiaCode-VariableFont_wght.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = "CascadiaCode-VariableFont_wght.ttf"; path = "../assets/fonts/Cascadia_Code/CascadiaCode-VariableFont_wght.ttf"; sourceTree = ""; };
DA76D9192FE24EC28C84DE79 /* CascadiaCode-Light.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = "CascadiaCode-Light.ttf"; path = "../assets/fonts/Cascadia_Code/static/CascadiaCode-Light.ttf"; sourceTree = ""; };
@@ -68,14 +68,14 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- E6AE3E75AAB6AEA81E4636B6 /* libPods-ReactNativeRichTextEditorExample.a in Frameworks */,
+ 9CCBAA226FD195143DDD2884 /* libPods-EnrichedTextInputExample.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
- 13B07FAE1A68108700A75B9A /* ReactNativeRichTextEditorExample */ = {
+ 13B07FAE1A68108700A75B9A /* EnrichedTextInputExample */ = {
isa = PBXGroup;
children = (
13B07FB51A68108700A75B9A /* Images.xcassets */,
@@ -84,14 +84,14 @@
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */,
);
- name = ReactNativeRichTextEditorExample;
+ name = EnrichedTextInputExample;
sourceTree = "";
};
2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
isa = PBXGroup;
children = (
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
- 1BE313EFA3DE90E22B2A2BB6 /* libPods-ReactNativeRichTextEditorExample.a */,
+ 6D370084B15B932DA6ABD7D8 /* libPods-EnrichedTextInputExample.a */,
);
name = Frameworks;
sourceTree = "";
@@ -106,7 +106,7 @@
83CBB9F61A601CBA00E9B192 = {
isa = PBXGroup;
children = (
- 13B07FAE1A68108700A75B9A /* ReactNativeRichTextEditorExample */,
+ 13B07FAE1A68108700A75B9A /* EnrichedTextInputExample */,
832341AE1AAA6A7D00B99B32 /* Libraries */,
83CBBA001A601CBA00E9B192 /* Products */,
2D16E6871FA4F8E400B85C8A /* Frameworks */,
@@ -121,7 +121,7 @@
83CBBA001A601CBA00E9B192 /* Products */ = {
isa = PBXGroup;
children = (
- 13B07F961A680F5B00A75B9A /* ReactNativeRichTextEditorExample.app */,
+ 13B07F961A680F5B00A75B9A /* EnrichedTextInputExample.app */,
);
name = Products;
sourceTree = "";
@@ -129,8 +129,8 @@
BBD78D7AC51CEA395F1C20DB /* Pods */ = {
isa = PBXGroup;
children = (
- CE2992D25A1E9E45E24B984C /* Pods-ReactNativeRichTextEditorExample.debug.xcconfig */,
- 30BAB32B24F7542D489838C7 /* Pods-ReactNativeRichTextEditorExample.release.xcconfig */,
+ ABB962282C7DB4F364360154 /* Pods-EnrichedTextInputExample.debug.xcconfig */,
+ 8D30641E04B3C92750094BD1 /* Pods-EnrichedTextInputExample.release.xcconfig */,
);
path = Pods;
sourceTree = "";
@@ -164,25 +164,25 @@
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
- 13B07F861A680F5B00A75B9A /* ReactNativeRichTextEditorExample */ = {
+ 13B07F861A680F5B00A75B9A /* EnrichedTextInputExample */ = {
isa = PBXNativeTarget;
- buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ReactNativeRichTextEditorExample" */;
+ buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "EnrichedTextInputExample" */;
buildPhases = (
- E8E8B1D71189538899D5EDEB /* [CP] Check Pods Manifest.lock */,
+ 4981A167C0063A82876DD1AB /* [CP] Check Pods Manifest.lock */,
13B07F871A680F5B00A75B9A /* Sources */,
13B07F8C1A680F5B00A75B9A /* Frameworks */,
13B07F8E1A680F5B00A75B9A /* Resources */,
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
- E37ABD7431ADE223A4A33FE5 /* [CP] Embed Pods Frameworks */,
- 89ACA76C9F1E435BFBFA61A5 /* [CP] Copy Pods Resources */,
+ 75C9505AFC16ED96EE5E9ED4 /* [CP] Embed Pods Frameworks */,
+ B600D4E6CF246F817102A773 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
dependencies = (
);
- name = ReactNativeRichTextEditorExample;
- productName = ReactNativeRichTextEditorExample;
- productReference = 13B07F961A680F5B00A75B9A /* ReactNativeRichTextEditorExample.app */;
+ name = EnrichedTextInputExample;
+ productName = EnrichedTextInputExample;
+ productReference = 13B07F961A680F5B00A75B9A /* EnrichedTextInputExample.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
@@ -198,7 +198,7 @@
};
};
};
- buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ReactNativeRichTextEditorExample" */;
+ buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "EnrichedTextInputExample" */;
compatibilityVersion = "Xcode 12.0";
developmentRegion = en;
hasScannedForEncodings = 0;
@@ -211,7 +211,7 @@
projectDirPath = "";
projectRoot = "";
targets = (
- 13B07F861A680F5B00A75B9A /* ReactNativeRichTextEditorExample */,
+ 13B07F861A680F5B00A75B9A /* EnrichedTextInputExample */,
);
};
/* End PBXProject section */
@@ -264,60 +264,60 @@
shellPath = /bin/sh;
shellScript = "set -e\n\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
};
- 89ACA76C9F1E435BFBFA61A5 /* [CP] Copy Pods Resources */ = {
+ 4981A167C0063A82876DD1AB /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
- "${PODS_ROOT}/Target Support Files/Pods-ReactNativeRichTextEditorExample/Pods-ReactNativeRichTextEditorExample-resources-${CONFIGURATION}-input-files.xcfilelist",
);
- name = "[CP] Copy Pods Resources";
+ inputPaths = (
+ "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
+ "${PODS_ROOT}/Manifest.lock",
+ );
+ name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
- "${PODS_ROOT}/Target Support Files/Pods-ReactNativeRichTextEditorExample/Pods-ReactNativeRichTextEditorExample-resources-${CONFIGURATION}-output-files.xcfilelist",
+ );
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/Pods-EnrichedTextInputExample-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ReactNativeRichTextEditorExample/Pods-ReactNativeRichTextEditorExample-resources.sh\"\n";
+ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
- E37ABD7431ADE223A4A33FE5 /* [CP] Embed Pods Frameworks */ = {
+ 75C9505AFC16ED96EE5E9ED4 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
- "${PODS_ROOT}/Target Support Files/Pods-ReactNativeRichTextEditorExample/Pods-ReactNativeRichTextEditorExample-frameworks-${CONFIGURATION}-input-files.xcfilelist",
+ "${PODS_ROOT}/Target Support Files/Pods-EnrichedTextInputExample/Pods-EnrichedTextInputExample-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
- "${PODS_ROOT}/Target Support Files/Pods-ReactNativeRichTextEditorExample/Pods-ReactNativeRichTextEditorExample-frameworks-${CONFIGURATION}-output-files.xcfilelist",
+ "${PODS_ROOT}/Target Support Files/Pods-EnrichedTextInputExample/Pods-EnrichedTextInputExample-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ReactNativeRichTextEditorExample/Pods-ReactNativeRichTextEditorExample-frameworks.sh\"\n";
+ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-EnrichedTextInputExample/Pods-EnrichedTextInputExample-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
- E8E8B1D71189538899D5EDEB /* [CP] Check Pods Manifest.lock */ = {
+ B600D4E6CF246F817102A773 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
+ "${PODS_ROOT}/Target Support Files/Pods-EnrichedTextInputExample/Pods-EnrichedTextInputExample-resources-${CONFIGURATION}-input-files.xcfilelist",
);
- inputPaths = (
- "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
- "${PODS_ROOT}/Manifest.lock",
- );
- name = "[CP] Check Pods Manifest.lock";
+ name = "[CP] Copy Pods Resources";
outputFileListPaths = (
- );
- outputPaths = (
- "$(DERIVED_FILE_DIR)/Pods-ReactNativeRichTextEditorExample-checkManifestLockResult.txt",
+ "${PODS_ROOT}/Target Support Files/Pods-EnrichedTextInputExample/Pods-EnrichedTextInputExample-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
+ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-EnrichedTextInputExample/Pods-EnrichedTextInputExample-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
@@ -336,13 +336,13 @@
/* Begin XCBuildConfiguration section */
13B07F941A680F5B00A75B9A /* Debug */ = {
isa = XCBuildConfiguration;
- baseConfigurationReference = CE2992D25A1E9E45E24B984C /* Pods-ReactNativeRichTextEditorExample.debug.xcconfig */;
+ baseConfigurationReference = ABB962282C7DB4F364360154 /* Pods-EnrichedTextInputExample.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
ENABLE_BITCODE = NO;
- INFOPLIST_FILE = ReactNativeRichTextEditorExample/Info.plist;
+ INFOPLIST_FILE = EnrichedTextInputExample/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
@@ -354,8 +354,8 @@
"-ObjC",
"-lc++",
);
- PRODUCT_BUNDLE_IDENTIFIER = swmansion.reactnativerichtexteditor.example;
- PRODUCT_NAME = ReactNativeRichTextEditorExample;
+ PRODUCT_BUNDLE_IDENTIFIER = swmansion.enrichedtextinputexample.example;
+ PRODUCT_NAME = EnrichedTextInputExample;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
@@ -364,12 +364,12 @@
};
13B07F951A680F5B00A75B9A /* Release */ = {
isa = XCBuildConfiguration;
- baseConfigurationReference = 30BAB32B24F7542D489838C7 /* Pods-ReactNativeRichTextEditorExample.release.xcconfig */;
+ baseConfigurationReference = 8D30641E04B3C92750094BD1 /* Pods-EnrichedTextInputExample.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
- INFOPLIST_FILE = ReactNativeRichTextEditorExample/Info.plist;
+ INFOPLIST_FILE = EnrichedTextInputExample/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
@@ -381,8 +381,8 @@
"-ObjC",
"-lc++",
);
- PRODUCT_BUNDLE_IDENTIFIER = swmansion.reactnativerichtexteditor.example;
- PRODUCT_NAME = ReactNativeRichTextEditorExample;
+ PRODUCT_BUNDLE_IDENTIFIER = swmansion.enrichedtextinputexample.example;
+ PRODUCT_NAME = EnrichedTextInputExample;
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
@@ -543,7 +543,7 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
- 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ReactNativeRichTextEditorExample" */ = {
+ 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "EnrichedTextInputExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
13B07F941A680F5B00A75B9A /* Debug */,
@@ -552,7 +552,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
- 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ReactNativeRichTextEditorExample" */ = {
+ 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "EnrichedTextInputExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
83CBBA201A601CBA00E9B192 /* Debug */,
diff --git a/example/ios/EnrichedTextInputExample.xcodeproj/xcshareddata/xcschemes/EnrichedTextInputExample.xcscheme b/example/ios/EnrichedTextInputExample.xcodeproj/xcshareddata/xcschemes/EnrichedTextInputExample.xcscheme
new file mode 100644
index 000000000..2b96d8bea
--- /dev/null
+++ b/example/ios/EnrichedTextInputExample.xcodeproj/xcshareddata/xcschemes/EnrichedTextInputExample.xcscheme
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/example/ios/ReactNativeRichTextEditorExample.xcodeproj/xcshareddata/xcschemes/ReactNativeRichTextEditorExample.xcscheme b/example/ios/EnrichedTextInputExample.xcodeproj/xcshareddata/xcschemes/ReactNativeRichTextEditorExample.xcscheme
similarity index 74%
rename from example/ios/ReactNativeRichTextEditorExample.xcodeproj/xcshareddata/xcschemes/ReactNativeRichTextEditorExample.xcscheme
rename to example/ios/EnrichedTextInputExample.xcodeproj/xcshareddata/xcschemes/ReactNativeRichTextEditorExample.xcscheme
index e526962ae..8ad6179b8 100644
--- a/example/ios/ReactNativeRichTextEditorExample.xcodeproj/xcshareddata/xcschemes/ReactNativeRichTextEditorExample.xcscheme
+++ b/example/ios/EnrichedTextInputExample.xcodeproj/xcshareddata/xcschemes/ReactNativeRichTextEditorExample.xcscheme
@@ -15,9 +15,9 @@
+ BuildableName = "EnrichedTextInputExample.app"
+ BlueprintName = "EnrichedTextInputExample"
+ ReferencedContainer = "container:EnrichedTextInputExample.xcodeproj">
@@ -33,9 +33,9 @@
+ BuildableName = "EnrichedTextInputExampleTests.xctest"
+ BlueprintName = "EnrichedTextInputExampleTests"
+ ReferencedContainer = "container:EnrichedTextInputExample.xcodeproj">
@@ -55,9 +55,9 @@
+ BuildableName = "EnrichedTextInputExample.app"
+ BlueprintName = "EnrichedTextInputExample"
+ ReferencedContainer = "container:EnrichedTextInputExample.xcodeproj">
@@ -72,9 +72,9 @@
+ BuildableName = "EnrichedTextInputExample.app"
+ BlueprintName = "EnrichedTextInputExample"
+ ReferencedContainer = "container:EnrichedTextInputExample.xcodeproj">
diff --git a/example/ios/ReactNativeRichTextEditorExample.xcworkspace/contents.xcworkspacedata b/example/ios/EnrichedTextInputExample.xcworkspace/contents.xcworkspacedata
similarity index 72%
rename from example/ios/ReactNativeRichTextEditorExample.xcworkspace/contents.xcworkspacedata
rename to example/ios/EnrichedTextInputExample.xcworkspace/contents.xcworkspacedata
index c408a0603..86f37dc9f 100644
--- a/example/ios/ReactNativeRichTextEditorExample.xcworkspace/contents.xcworkspacedata
+++ b/example/ios/EnrichedTextInputExample.xcworkspace/contents.xcworkspacedata
@@ -2,7 +2,7 @@
+ location = "group:EnrichedTextInputExample.xcodeproj">
diff --git a/example/ios/ReactNativeRichTextEditorExample/AppDelegate.swift b/example/ios/EnrichedTextInputExample/AppDelegate.swift
similarity index 95%
rename from example/ios/ReactNativeRichTextEditorExample/AppDelegate.swift
rename to example/ios/EnrichedTextInputExample/AppDelegate.swift
index 60b85f690..71f4f9bd2 100644
--- a/example/ios/ReactNativeRichTextEditorExample/AppDelegate.swift
+++ b/example/ios/EnrichedTextInputExample/AppDelegate.swift
@@ -24,7 +24,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
window = UIWindow(frame: UIScreen.main.bounds)
factory.startReactNative(
- withModuleName: "ReactNativeRichTextEditorExample",
+ withModuleName: "EnrichedTextInputExample",
in: window,
launchOptions: launchOptions
)
diff --git a/example/ios/ReactNativeRichTextEditorExample/Images.xcassets/AppIcon.appiconset/Contents.json b/example/ios/EnrichedTextInputExample/Images.xcassets/AppIcon.appiconset/Contents.json
similarity index 100%
rename from example/ios/ReactNativeRichTextEditorExample/Images.xcassets/AppIcon.appiconset/Contents.json
rename to example/ios/EnrichedTextInputExample/Images.xcassets/AppIcon.appiconset/Contents.json
diff --git a/example/ios/ReactNativeRichTextEditorExample/Images.xcassets/Contents.json b/example/ios/EnrichedTextInputExample/Images.xcassets/Contents.json
similarity index 100%
rename from example/ios/ReactNativeRichTextEditorExample/Images.xcassets/Contents.json
rename to example/ios/EnrichedTextInputExample/Images.xcassets/Contents.json
diff --git a/example/ios/ReactNativeRichTextEditorExample/Info.plist b/example/ios/EnrichedTextInputExample/Info.plist
similarity index 97%
rename from example/ios/ReactNativeRichTextEditorExample/Info.plist
rename to example/ios/EnrichedTextInputExample/Info.plist
index 6ec86947b..75363b512 100644
--- a/example/ios/ReactNativeRichTextEditorExample/Info.plist
+++ b/example/ios/EnrichedTextInputExample/Info.plist
@@ -5,7 +5,7 @@
CFBundleDevelopmentRegion
en
CFBundleDisplayName
- ReactNativeRichTextEditorExample
+ EnrichedTextInputExample
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
diff --git a/example/ios/ReactNativeRichTextEditorExample/LaunchScreen.storyboard b/example/ios/EnrichedTextInputExample/LaunchScreen.storyboard
similarity index 93%
rename from example/ios/ReactNativeRichTextEditorExample/LaunchScreen.storyboard
rename to example/ios/EnrichedTextInputExample/LaunchScreen.storyboard
index 065e079df..9e519f9d7 100644
--- a/example/ios/ReactNativeRichTextEditorExample/LaunchScreen.storyboard
+++ b/example/ios/EnrichedTextInputExample/LaunchScreen.storyboard
@@ -16,7 +16,7 @@
-