32 Commits

Author SHA1 Message Date
52916d2f4a Rewrite POSIX Tty to actually use the TTY (#805)
And a PTY for testing. Windows still uses stdin/stdout for now.
2025-03-19 20:27:29 +00:00
f71c42d2d0 Make all samples multiplatform (#786) 2025-03-13 13:23:43 -04:00
1d6a300bb8 Upgrade to Kotlin 2.1.20-RC (#734)
Use the new application plugin replacement.
2025-02-24 17:02:18 +00:00
2b4cb8a69c Add rudimentary key handling (#442)
This forces all usages into raw mode, regardless of whether you are listening for keys or not.
2024-09-10 18:11:15 -04:00
e308b86351 Hide and show the cursor automatically during rendering (#452) 2024-08-26 16:30:32 +00:00
4d053dbbd3 Change runMosaic to support effects (#284) 2024-08-16 16:58:08 -04:00
3fc06ec160 Update dependency org.jline:jline to v3.26.3 (#414)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-17 12:25:16 -04:00
8b2abbae64 Update dependency org.jline:jline to v3.26.2 (#403)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-17 08:10:00 -04:00
148502f815 Some code fixes (#384)
- Move `Fill` and `Stroke` inside the `DrawStyle`
- Remove `toString` from `DrawStyle.Stroke` because `@Poko` is already doing it
- In the robot sample, the use of the `offset` modifier in the robot (`Text`)
- Remove `TODO https://github.com/JakeWharton/mosaic/issues/11` in the robot sample, it seems that it is no longer relevant
- In the robot sample, add `isActive` check in the loop for keyboard input
- Fix in the `README.md` `mutableStateOf` to `mutableIntStateOf`, as is correct in newer versions
2024-05-30 07:49:11 -04:00
d542cf1587 Modify DrawScope#drawRect (#383)
- Change the `drawRect` method in `DrawScope` like the method from the Compose UI
- Add support for `DrawStyle`: `Fill` and `Stroke` in `DrawScope#drawRect`
- Add support for drawing a rectangle from text characters
- Add `Filler` with code point
- Change the robot sample to show `drawRect` with `Stroke`
2024-05-29 21:50:07 -04:00
a5ec60767d Update to Kotlin 2.0
* Update Kotlin and Compose to v2

* Kotlin 2.0 updates

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jake Wharton <jw@squareup.com>
2024-05-28 16:55:50 -04:00
074aa9773b Update dependency org.jline:jline to v3.26.1 (#352)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-24 08:28:18 -04:00
6572612751 Update dependency org.jline:jline to v3.26.0 (#349)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-22 13:24:31 -04:00
36fc6a8e3b Update dependency io.nlopez.compose.rules:ktlint to v0.3.15 (#345)
* Update dependency io.nlopez.compose.rules:ktlint to v0.3.15

* Use mutableIntStateOf

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jake Wharton <jw@squareup.com>
2024-04-14 01:34:12 +00:00
e58ceb1dd0 Update dependency com.pinterest.ktlint:ktlint-cli to v1.2.0 (#320)
* Update dependency com.pinterest.ktlint:ktlint-cli to v1.2.0

* Appease ktlint

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jake Wharton <jw@squareup.com>
2024-02-29 02:17:03 +00:00
4482dd33a9 Update dependency org.jline:jline to v3.25.1 (#303)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-23 16:03:42 +00:00
167f6b1e56 Update dependency org.jline:jline to v3.25.0 (#286)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-23 19:49:40 -05:00
e8e498e34f Update robot sample with offset modifier (#256) 2023-11-18 22:08:34 -05:00
340baf8eb3 Allow the robot to move on Windows (#250) 2023-11-13 22:57:50 +00:00
e67cb363c7 Fix Gradle warnings (#248)
* Fix deprecation warning coming from buildconfig plugin.

> Configure project :build-logic:mosaic-gradle-plugin
The Project.getConvention() method has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https://docs.gradle.org/8.4/userguide/upgrading_version_8.html#deprecated_access_to_conventions
        at build_76rlsb2vs9qh6z5gt0vmnl0ip.run(P:\projects\contrib\github-mosaic\mosaic-gradle-plugin\build.gradle:3)

* Fix application plugin related deprecations. `mainClassName` is a convention property, even when it's inside the `application` block.
We cant to set https://docs.gradle.org/8.4/dsl/org.gradle.api.plugins.JavaApplication.html#org.gradle.api.plugins.JavaApplication:mainClass instead.

> Configure project :samples:counter
Build file 'P:\projects\contrib\github-mosaic\samples\counter\build.gradle': line 11
The org.gradle.api.plugins.ApplicationPluginConvention type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https://docs.gradle.org/8.4/userguide/upgrading_version_8.html#application_convention_deprecation
        at build_dw2puawl5bmiuhlfercnbnay0$_run_closure1.doCall$original(P:\projects\contrib\github-mosaic\samples\counter\build.gradle:11)
        at build_dw2puawl5bmiuhlfercnbnay0.run(P:\projects\contrib\github-mosaic\samples\counter\build.gradle:10)

		Build file 'P:\projects\contrib\github-mosaic\samples\counter\build.gradle': line 11
The org.gradle.api.plugins.Convention type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https://docs.gradle.org/8.4/userguide/upgrading_version_8.html#deprecated_access_to_conventions
        at build_dw2puawl5bmiuhlfercnbnay0$_run_closure1.doCall$original(P:\projects\contrib\github-mosaic\samples\counter\build.gradle:11)
        at build_dw2puawl5bmiuhlfercnbnay0.run(P:\projects\contrib\github-mosaic\samples\counter\build.gradle:10)

> Configure project :samples:jest | :samples:robot | :samples:demo
Build file 'P:\projects\contrib\github-mosaic\samples\jest\build.gradle': line 5
The org.gradle.api.plugins.ApplicationPluginConvention type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https://docs.gradle.org/8.4/userguide/upgrading_version_8.html#application_convention_deprecation
        at build_3tv3yi15cjhed4vkpewcfismx.run(P:\projects\contrib\github-mosaic\samples\jest\build.gradle:5)

Build file 'P:\projects\contrib\github-mosaic\samples\jest\build.gradle': line 5
The org.gradle.api.plugins.Convention type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https://docs.gradle.org/8.4/userguide/upgrading_version_8.html#deprecated_access_to_conventions
        at build_3tv3yi15cjhed4vkpewcfismx.run(P:\projects\contrib\github-mosaic\samples\jest\build.gradle:5)

* Ignore warning about Kotlin/Native, there's no way to build mac binaries on Linux and Windows, so no need to nag about it.

> Configure project :mosaic-runtime
w: The following Kotlin/Native targets cannot be built on this machine and are disabled:
macosArm64, macosX64
To hide this message, add 'kotlin.native.ignoreDisabledTargets=true' to the Gradle properties.

> Configure project :samples:counter
w: The following Kotlin/Native targets cannot be built on this machine and are disabled:
macosArm64, macosX64
To hide this message, add 'kotlin.native.ignoreDisabledTargets=true' to the Gradle properties.
2023-11-13 22:37:15 +00:00
9358bd8ad5 Add new demo app for messing around (#246) 2023-11-13 21:16:08 +00:00
bfc8684eb0 Update dependency org.jline:jline to v3.24.1 (#237)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-01 09:30:21 -04:00
d40d0d6fa1 Update dependency org.jline:jline to v3.24.0 (#234)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-25 14:18:35 -04:00
045ff3c44d Update robot example (#226)
Use padding modifier instead of building custom string for Text
2023-10-07 17:54:15 -04:00
e40752e991 Break layout and components into packages, individual files 2023-03-12 00:10:22 -05:00
2bb7ef0f1c Update dependency org.jline:jline to v3.23.0 (#141)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-08 18:11:07 -05:00
2ae0256004 Change entrypoint to a suspend function
...and add support for running in JS!
2023-01-25 23:01:14 -05:00
f8eb590dac Remove extra newline at the end of the GIFs 2023-01-18 16:41:20 -05:00
cd2c26a196 Update dependency org.jline:jline to v3.22.0 2023-01-18 11:21:10 -05:00
73a62c7129 Use agg to render gifs 2023-01-17 23:55:47 -05:00
fd213711ce Update Compose to latest
This brings Kotlin 1.5 and coroutines 1.5.
2021-06-25 10:40:08 -04:00
11d276f2d9 Restructure project to a nested build
This allows the samples (formerly examples) to configure themselves like a regular consumer would (using the Gradle plugin).
2021-05-05 12:37:19 -04:00