Skip to content

Commit

Permalink
Version bump. Updated documentation. Better insideTransitionSpecs.
Browse files Browse the repository at this point in the history
  • Loading branch information
SalomonBrys committed Jun 5, 2024
1 parent e685e2c commit 3a9f90f
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 31 deletions.
2 changes: 1 addition & 1 deletion Compose-Ur-Pres/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {

allprojects {
group = "net.kodein.cup"
version = "1.0.0-Beta-04"
version = "1.0.0-Beta-05"

/*
In a composite build, tasks run from the root will not automatically propagate to subprojects (see
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ public class SourceCodeBuilder internal constructor() {
).also { markers += it }
}

@Deprecated("This is not needed anymore and can be safely removed", replaceWith = ReplaceWith(""), level = DeprecationLevel.ERROR)
public fun ensureStep(@Suppress("UNUSED_PARAMETER") step: Int) {}

internal companion object {
const val START_OPEN = "\u2062«\u2064"
const val START_CLOSE = "\u2064:\u2062"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,13 @@ public fun SlideSpecs.merge(other: SlideSpecs): SlideSpecs {

public operator fun SlideSpecs.plus(other: SlideSpecs): SlideSpecs = merge(other)

public fun insideTransitionSpecs(
public fun Slides.Position.insideTransitionSpecs(
startTransitions: TransitionSet,
endTransitions: TransitionSet,
): (Slides.Position) -> SlideSpecs = {
when {
it.isFirst -> SlideSpecs(endTransitions = endTransitions)
it.isLast -> SlideSpecs(startTransitions = startTransitions)
else -> SlideSpecs(startTransitions = startTransitions, endTransitions = endTransitions)
}
endTransitions: TransitionSet
): SlideSpecs = when {
isFirst -> SlideSpecs(endTransitions = endTransitions)
isLast -> SlideSpecs(startTransitions = startTransitions)
else -> SlideSpecs(startTransitions = startTransitions, endTransitions = endTransitions)
}

@Suppress("DEPRECATION_ERROR", "DeprecatedCallableAddReplaceWith")
Expand Down
2 changes: 0 additions & 2 deletions Compose-Ur-Pres/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ emoji = "2.0.1"
graalvm-js = "23.0.4"
gradle-pluginPublish = "1.2.1"
kotlin = "2.0.0"
kxSerialization = "1.7.0-RC"
markdown = "0.16.0"
mavenPublish = "0.28.0"
npm-ismobilejs = "1.1.1"
Expand All @@ -24,5 +23,4 @@ mavenPublish = { id = "com.vanniktech.maven.publish", version.ref = "mavenPublis
[libraries]
emojiCompose = { module = "org.kodein.emoji:emoji-compose", version.ref = "emoji" }
graalvm-js = { module = "org.graalvm.js:js", version.ref = "graalvm-js" }
kxSerialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "kxSerialization" }
markdown = { module = "com.mikepenz:multiplatform-markdown-renderer-m2", version.ref = "markdown" }
12 changes: 8 additions & 4 deletions Demo/src/commonMain/kotlin/5_Modes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,12 @@ val modes = Slides(
overview,
speakerWindow,
groups,
specs = insideTransitionSpecs(
startTransitions = TransitionSet.moveVertical,
endTransitions = TransitionSet.moveVertical
)
specs = {
it.insideTransitionSpecs(
startTransitions = TransitionSet.moveVertical,
endTransitions = TransitionSet.moveVertical
) + SlideSpecs(
size = SLIDE_SIZE_16_9
)
}
)
25 changes: 21 additions & 4 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,27 @@ image::docs/modules/ROOT/images/cup.png[width=384]
[.lead]
A pure Kotlin Compose Multiplatform presentation system for developer presenters.

== https://kodeinkoders.github.io/CuP[Documentation]
== Get Started

== Other resources
=== https://kodeinkoders.github.io/CuP[Documentation]

* https://github.com/KodeinKoders/CuP-Presentation-Template/tree/main?tab=readme-ov-file[Presentation project template] (to get started).
=== https://github.com/KodeinKoders/CuP-Presentation-Template/tree/main?tab=readme-ov-file[Presentation project template]

* Curated list of cool presentation that use CuP (TODO)
=== https://slack-chats.kotlinlang.org/c/cup-presentations[Join the community on the #cup-presentations Slack channel!]

== Beta

During the time CuP is offered in Beta, the following statements are true:

* When API changes:
** Old API raises depreciation errors (we do not use depreciation warnings) for at least one version (we aim for two when possible).
** We provide a migration path as much as possible (either in the depreciation error message or in the release notes).
* We do *not* ensure binary compatibility between versions, and try to fail early with understandable exceptions (when possible), for at lease one version (we aim for two when possible).

Of course, once we promote CuP to stable, we will provide binary compatibility between minor versions, and full migration cycles between major versions.

== Cool presentation examples

* Stay tuned!

IMPORTANT: If you created a cool presentation with CuP, contact me (`@salomonbrys`) on the https://slack-chats.kotlinlang.org:[Kotlin Slack], and I'll add your presentation to the list!
4 changes: 2 additions & 2 deletions docs/antora.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CuP
title: Compose ur Pres
version: '1.0'
display_version: '1.0.0-Beta-04'
display_version: '1.0.0-Beta-05'
nav:
- modules/ROOT/nav.adoc
- modules/core/nav.adoc
Expand All @@ -10,7 +10,7 @@ nav:
asciidoc:
attributes:
branch: 'main'
version: '1.0.0-Beta-04'
version: '1.0.0-Beta-05'
kotlin: '2.0.0'
compose: '1.6.10'
jdk: '1.8'
5 changes: 2 additions & 3 deletions docs/modules/core/pages/presentation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,7 @@ val modes = Slides(
slide2,
slide3,
specs = {
copyWithInsideTransitions(
config = it,
it.insideTransitionSpecs(
startTransitions = TransitionSet.moveVertical,
endTransitions = TransitionSet.moveVertical
)
Expand All @@ -430,4 +429,4 @@ val modes = Slides(
----

NOTE: In this example, both the `startTransitions` of `slide1` and the `endTransitions` of `slide3` are left unmodified.
Only the transitions that apply between two slides of the same group are modified by `copyWithInsideTransitions`.
Only the transitions that apply between two slides of the same group are modified by `insideTransitionSpecs`.
8 changes: 4 additions & 4 deletions docs/modules/core/pages/slide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -164,22 +164,22 @@ If you want to have more space, you can configure a Slide to have a wider ratio.
[source, kotlin]
----
val helloWorld by Slide(
specs = { copy(size = SLIDE_SIZE_16_9) } //<1>
specs = SlideSpecs(size = SLIDE_SIZE_16_9) //<1>
) {
Text("Hello, World!", fontSize = 24.sp)
}
----
<1> Use `copy` to make a copy of the default configuration, changing only the slide size.
<1> Set the size of the slide to the default 16/9 size.

You can also configure the Slide's transitions:

[source, kotlin]
----
val helloWorld by Slide(
specs = { copy(
specs = SlideSpecs(
startTransitions = TransitionSet.fade, //<1>
endTransitions = TransitionSet.fade //<2>
) }
)
) {
Text("Hello, World!", fontSize = 24.sp)
}
Expand Down

0 comments on commit 3a9f90f

Please sign in to comment.