This somehow fixes the random java.lang.NoClassDefFoundError:
org/jetbrains/jewel/bridge/ToolWindowExtensionsKt that we've been seeing
on main when using JBR-21 as the project JDK.
GitOrigin-RevId: 2e93656dc77e625758573c3c9bc7d42cd0537e2d
We weren't using the TextLinkStyles provided by the LinkAnnotation API,
and as a result, our links weren't stateful. We were also not properly
setting a disabled colour — now we do.
Also changed, we force the Markdown text to not be focusable, even if it
is clickable, since we don't want it to get focused. Now only links are
focused while tabbing through Markdown.
This also removes some testing harness left around from #425, and that
we don't need anymore.
Note: links should have a border around them when they are focused, but
that's not possible with the Compose APIs. What we do instead is show
a subtle background color,
taken from the ActionButtons' hover and pressed states, for our focused
and pressed states, respectively.
GitOrigin-RevId: 8cd3eee5791dbdb5f4f96f4e569e1f28923d1619
While it's nice to get ktlint warnings in the IDE, the ktlint IJ plugin
shows an obnoxious editor banner when working on projects where it's not
used.
Since we all work on other projects, and because their maintainers are
not open to improving the UX, I don't recommend keeping this plugin
anymore.
GitOrigin-RevId: a96ab4b26228241b0e874659f7733c66ed8d04fe
* Add segmented controls
* Fix colors and focus behaviour of segmented controls
* Modify focus behaviour and colors of segmented controls
* Add segmented controls
* Fix colors and focus behaviour of segmented controls
* Modify focus behaviour and colors of segmented controls
* Tweak implementation to match actual impl/behaviour
The one thing that is still TODO is avoid focusing the control when it's
clicked. I removed the previous "clear focus" behaviour because it
clears the focus on click even when it shouldn't. I'll come up with a
better solution as soon as I can.
* Change focus behaviour to match Swing's
We made the buttons not focusable anymore, to prevent unwanted focus
movement. There is a bit of focus dark magic, but it now works as we'd
expect.
* Update segmented controls api
---------
Co-authored-by: Sebastiano Poggi <sebp@google.com>
GitOrigin-RevId: 3e847ba84adc08a489518d73ecdc8bd9410b483b
It's like IconActionButton, but it doesn't necessarily hold an icon. For
example, it can be used to implement an equivalent to Swing's
ActionButtonWithText component.
There is a standalone sample, too
GitOrigin-RevId: d26c03d42841d25535d861f0c67941270e16a6dd
* Implement IconActionButton
It's a thin wrapper around IconButton that is slightly easier to use and
can also render a tooltip.
Added sample, too (standalone only).
* Update API signatures
GitOrigin-RevId: 241e7841cc076e16aed42f1bab22e3cb2221397e
We had some en-GB key name spelling (Grey) which wasn't found at runtime
since the actual palette uses en-US spelling (Gray). This PR fixes it.
GitOrigin-RevId: cfeec86b43bd99bde3c32a6a720e78e8c68f6180
* Minor updates to the build files
* Remove javaToolchain, rely only on Kotlin's
* Remove one more javaToolchain
GitOrigin-RevId: fbd2b0301c515e607838fb2b0a242263b99e2f0a
* Improve icon buttons by making them optionally focusable
While in the IJP ActionButtons aren't focusable by default when in
toolbars, we do want them to be, because 1) it's the right thing to do
to improve keyboard navigation, and b) Studio needs this.
* add missing trailing comma in Buttons
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
---------
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
Co-authored-by: Ivan Morgillo <imorgillo@gmail.com>
GitOrigin-RevId: 7ab07123a49d54354e534afe6cac4cf71b634d12
* Bump IJP to 242.20224.38 (242 beta 1)
* Update icon keys generator to use IconPathProvider
This simplifies considerably our code since we do not need to parse the
json mappings anymore.
* Update AllIconsKeys with new icons
* Fix icon keys generator to handle weird partial paths
GitOrigin-RevId: b7d67302ee13e031efeaea7a500f6c310b4a8591
* add kotlin-logging to stand alone app
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
* replace logger in ChipsAndTree
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
* iterate on the logger template
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
* replace logged in Views.kt
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
* idea.log path has changed 🤷
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
* add logger to IDE sample
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
* move LoggerRt into Jewel
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
* fix Compose lint warnings in ComponentShowcaseTab
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
* rename logger to JewelLogger
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
* migrate standalone to JewelLogger
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
* replace logger in JewelDemoAction
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
* replace logger in StandalonePainterHintsProvider
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
* replace logger in ResourcePainterProvider
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
* add missing empty line at EOF in libs.versions.toml
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
* add debug() for Java logger
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
* add and test .trace() to Java logger
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
* tune logger setup for IDE plugin scenario
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
* fix logger category for Views.kt
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
* fix logger category for ChipsAndTree
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
* remove unused logback configuration
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
* replace logger in StandalonePainterHintsProvider
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
* replace logger in ResourcePainterProvider
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
* address PR comments
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
* iterate on logger usage in ResourcePainterProvider
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
* refactor JewelLogger instance factory creation
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
* run apiDump
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
* move log to info in ChipsAndTree
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
* address PR review feedback
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
---------
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
GitOrigin-RevId: d6f89b000bb75b0eb4461867671f9d02d74daa20
This is required by one of our customers, and it allows them to
customize the handling of standard tags (e.g., remove images).
It is an opt-in behaviour and it does not impact existing Markdown
handling code or behaviour.
GitOrigin-RevId: 81cb5b7f45f84b1d5946eb5d9da4ba94e91f3fd1
* replace deprecated UrlAnnotation with LinkAnnotation
* extract determinePointerIcon()
* Replace deprecated UrlAnnotation with LinkAnnotation
* replace deprecated ClickableText
* Introduced LinkAnnotation.Clickable to drive the behaviour of links
* Replaced SimpleClickableText with the good ol' Text
* Successfully wired onUrlClick and onTextClick lambdas
and the enabled flag.
* update api files
* add disabled UI for links
When links are disabled, we show something that looks like a link,
but it's not clickable and has no 👆 pointer icon.
* add a checkbox to toggle links in the Markdown standalone showcase
GitOrigin-RevId: 1e9d914f6734223d39b8472dba08a89a69ab47ef
* add a markdown string to README
* add a disclaimer comment to MarkdownPreview.kt
* refresh Markdown README
* fix a typo in README.md
* address PR comments
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
---------
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
GitOrigin-RevId: d90c92771574610b7a4d5d1e9f34731b767a3756
* Implement icon keys generator
This gradle task generates the icon keys for the platform icons that
we'll need to load icons from a key instead of a path.
* Define IconIdInterpreter and NewUiChecker
* Do icon key generation for AllIcons in ui module
* Implement proper key-based icon loading
* Remove old TODO and unused code
* Undo change to run config
* Rename AllIcons to PlatformIcon, move to its own file
* Remove unnecessary suppression
* Run apiDump
* Made icon generation more maintainable (#432)
* Made icon generation more maintainable
* Cleanup code
* Fix ktlint implicitly trying to check generated code
---------
Co-authored-by: Sebastiano Poggi <sebp@google.com>
---------
Co-authored-by: Lamberto Basti <basti.lamberto@gmail.com>
GitOrigin-RevId: bb5da85d239a72cc907c6edfe873f96629c6e9d2
This in turn requires:
1. Updating the IJP Gradle plugin to 2.0 (beta)
2. Reworking the IDE sample build.gradle.kts in the new 2.0 syntax
3. Bumping the JBR version to 21
4. Removing CodeQL (we're not using it, it's slow, and it won't pick up
a JDK 21 no matter how much you want it to)
GitOrigin-RevId: 3b99a25f5c963fe1af42baea63fa43def3f85878
This configuration updates the API dumps and runs ktlint formatter,
making it easier to check everything is a-ok before pushing.
GitOrigin-RevId: 67c971ac0b6c61d27fd0ba971ef5edd4892fcaac
* The default button was missing spacing between its bg and the focus
outline. Outlined buttons are unaffected.
* The chips were drawing a double-outline when focused and selected. Now
they only draw the selected outline if they are both focused and
selected.
* The chips didn't clearly signal the pressed and selected states. The
background now reflects these states better (standalone only).
There are no specs so we're going with a bit more freedom in the
standalone version, as the Swing impl is quite lacking in polish still
GitOrigin-RevId: f57eba2a16493454cfd978f0a6dedc73e30848bb
Add an overload for Modifier.focusOutline that takes a simple Boolean
instead of a FocusableComponentState, allowing users to use the modifier
even for components that don't have a FocusableComponentState.
GitOrigin-RevId: 82533beb3507ae3553ec8b9db45acc3ac65dace7
* Content was vertically centred, but should top-aligned
* TextAreas didn't respect incoming min constraints
GitOrigin-RevId: c975f77cd14fa9043e690225fe04f04d70f50f7a
* Add PGP signing to publications
Introduce Pretty Good Privacy (PGP) signing to the publication workflows of the project. The signing setup is included in the gradle wiring along with the retrieval of the key details from environment variables. This change is applied in both the publish and hotfix workflows.
* Update key retrieval in build script and workflow file
* Add PGP keys to GitHub Actions workflow
The commit adds PGP_PASSWORD and PGP_PRIVATE_KEY to the environment variables in the publication workflow. These additions permit secure, authenticated signing of packages before publication.
GitOrigin-RevId: cdcb05ed8f159d3c880cc306bbb6605f0788f7d2
* Add PGP signing to publications
Introduce Pretty Good Privacy (PGP) signing to the publication workflows of the project. The signing setup is included in the gradle wiring along with the retrieval of the key details from environment variables. This change is applied in both the publish and hotfix workflows.
* Update key retrieval in build script and workflow file
---------
Co-authored-by: Sebastiano Poggi <rock3r@users.noreply.github.com>
GitOrigin-RevId: df2e29049dfc5d5be47c5a78866afddf293f0da1
* Update all dependencies yey
* Update API files after Kotlin update
* Update Kotlinter Gradle plugin
* Run ktlint -f (lotsa changes)
Looks like we've been on a pretty old ktlint version; new ones are much
stricter/more powerful and so a lot of changes ensued.
This also:
1. Downgrades sarif4k to 0.5.0 (see
https://github.com/jeremymailen/kotlinter-gradle/issues/382)
2. Updates the IDE code style to match ktlint's
* Uncomment code in AndroidStudioReleases.kt
GitOrigin-RevId: 9d677ac1d10ee4fedf11a2bf5892dc9af21195b4
* Fix Markdown functions not using provided styling
* Add semantics support to Markdown, move to right package
Usage in tests:
```kotlin
fun SemanticsNodeInteraction.assertMarkdownEquals(
expected: String
): SemanticsNodeInteraction =
assert(hasMarkdownExactly(expected))
private fun hasMarkdownExactly(expected: String): SemanticsMatcher =
SemanticsMatcher.expectValue(RawMarkdown, expected)
```
* Update API dump
GitOrigin-RevId: 924c43e227c99043a80400a9d13f168c4ed68819
The IDE also has an editor and a console text style, which come from the
editor color scheme. We weren't using them until now, but we now fully
comply to it in the Markdown rendering, too.
GitOrigin-RevId: 6732d567e0a22155ac6b3b0a05c8ab5e371296a3