diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index df8096d8..1c687d65 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -46,7 +46,29 @@ jobs: with: java-version: '17' distribution: 'temurin' - - name: Build with Gradle - uses: gradle/gradle-build-action@ce999babab2de1c4b649dc15f0ee67e6246c994f + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + + - name: Run tests + run: ./gradlew ${{ matrix.target }} + + deploy: + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + needs: build + runs-on: macos-14 + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 with: - arguments: ${{ matrix.target }} + java-version: '17' + distribution: 'temurin' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + + - name: Deploy snapshot + env: + VERSION: 1.0.0-SNAPSHOT + run: ./gradlew publish \ No newline at end of file diff --git a/richeditor-compose/src/commonMain/kotlin/com/mohamedrejeb/richeditor/ui/BasicRichTextEditor.kt b/richeditor-compose/src/commonMain/kotlin/com/mohamedrejeb/richeditor/ui/BasicRichTextEditor.kt index f9581515..e48580f0 100644 --- a/richeditor-compose/src/commonMain/kotlin/com/mohamedrejeb/richeditor/ui/BasicRichTextEditor.kt +++ b/richeditor-compose/src/commonMain/kotlin/com/mohamedrejeb/richeditor/ui/BasicRichTextEditor.kt @@ -193,7 +193,6 @@ internal fun BasicRichTextEditor( @Composable { innerTextField -> innerTextField() }, contentPadding: PaddingValues ) { - val scope = rememberCoroutineScope() val density = LocalDensity.current val localTextStyle = LocalTextStyle.current val layoutDirection = LocalLayoutDirection.current @@ -232,13 +231,11 @@ internal fun BasicRichTextEditor( CompositionLocalProvider(LocalClipboardManager provides richClipboardManager) { BasicTextField( - value = state.textFieldValue, + value = state.textFieldValue.copy(annotatedString = state.annotatedString), onValueChange = { if (readOnly) return@BasicTextField if (it.text.length > maxLength) return@BasicTextField -// scope.launch { -// state.emitTextFieldValue(it) -// } + state.onTextFieldValueChange(it) }, modifier = modifier @@ -276,7 +273,6 @@ internal fun BasicRichTextEditor( singleLine = singleLine, maxLines = maxLines, minLines = minLines, - visualTransformation = state.visualTransformation, onTextLayout = { state.onTextLayout( textLayoutResult = it,