-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add deployment scripts * Refactoring and cleanup * Add RichTextManager
- Loading branch information
1 parent
699e084
commit 19f804f
Showing
26 changed files
with
631 additions
and
697 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Publish | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
publish: | ||
name: Release build and publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: adopt | ||
java-version: 17 | ||
|
||
- name: Publish to MavenCentral | ||
run: ./gradlew rich-editor-compose:publishReleasePublicationToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository | ||
env: | ||
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | ||
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | ||
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} | ||
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | ||
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | ||
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Copyright 2023 Canopas Software LLP | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
{ | ||
"spans": [ | ||
{ | ||
"from": 0, | ||
"to": 10, | ||
"style": "h1" | ||
}, | ||
{ | ||
"from": 0, | ||
"to": 10, | ||
"style": "bold" | ||
}, | ||
{ | ||
"from": 19, | ||
"to": 27, | ||
"style": "bold" | ||
}, | ||
{ | ||
"from": 44, | ||
"to": 59, | ||
"style": "bold" | ||
}, | ||
{ | ||
"from": 44, | ||
"to": 59, | ||
"style": "italic" | ||
}, | ||
{ | ||
"from": 44, | ||
"to": 59, | ||
"style": "underline" | ||
}, | ||
{ | ||
"from": 61, | ||
"to": 69, | ||
"style": "h3" | ||
}, | ||
{ | ||
"from": 62, | ||
"to": 69, | ||
"style": "bold" | ||
}, | ||
{ | ||
"from": 103, | ||
"to": 118, | ||
"style": "bold" | ||
}, | ||
{ | ||
"from": 119, | ||
"to": 126, | ||
"style": "italic" | ||
}, | ||
{ | ||
"from": 130, | ||
"to": 138, | ||
"style": "underline" | ||
}, | ||
{ | ||
"from": 160, | ||
"to": 167, | ||
"style": "h3" | ||
}, | ||
{ | ||
"from": 161, | ||
"to": 167, | ||
"style": "bold" | ||
}, | ||
{ | ||
"from": 169, | ||
"to": 180, | ||
"style": "bold" | ||
}, | ||
{ | ||
"from": 224, | ||
"to": 235, | ||
"style": "bold" | ||
}, | ||
{ | ||
"from": 224, | ||
"to": 235, | ||
"style": "italic" | ||
}, | ||
{ | ||
"from": 224, | ||
"to": 235, | ||
"style": "underline" | ||
}, | ||
{ | ||
"from": 237, | ||
"to": 251, | ||
"style": "h4" | ||
}, | ||
{ | ||
"from": 238, | ||
"to": 250, | ||
"style": "bold" | ||
}, | ||
{ | ||
"from": 238, | ||
"to": 250, | ||
"style": "italic" | ||
}, | ||
{ | ||
"from": 238, | ||
"to": 250, | ||
"style": "underline" | ||
} | ||
], | ||
"text": "Rich Editor\nAndroid WYSIWYG Rich editor for Jetpack compose.\n\nFeatures\nThe editor offers the following options\n\n- Bold\n- Italic\n- Underline\n- Different headers\n\nCredits\nRich Editor for compose is owned and maintained by the canopas team\n\nThanks You ☺️\n" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
app/src/main/java/com/example/texteditor/parser/JsonEditorParser.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.example.texteditor.parser | ||
|
||
import com.canopas.editor.ui.model.RichText | ||
import com.canopas.editor.ui.model.RichTextSpan | ||
import com.canopas.editor.ui.parser.EditorAdapter | ||
import com.google.gson.Gson | ||
import com.google.gson.GsonBuilder | ||
import com.google.gson.reflect.TypeToken | ||
|
||
class JsonEditorParser : EditorAdapter { | ||
|
||
private val gson: Gson = GsonBuilder() | ||
.registerTypeAdapter(RichTextSpan::class.java, RichTextSpanAdapter()) | ||
.create() | ||
|
||
override fun encode(input: String): RichText { | ||
return gson.fromJson(input, object : TypeToken<RichText>() {}.type) | ||
} | ||
|
||
override fun decode(editorValue: RichText): String { | ||
return gson.toJson(editorValue) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.