Releases: KodeinKoders/CuP
1.0.0-beta-11
What's Changed
- Fix Gradle failure caused by private execute() TaskAction by @LouisCAD in #9
- kotlin 2.1.0 and compose 1.7.3
- Upgrade Gradle wrapper
New Contributors
Full Changelog: v1.0.0-Beta-10...v1.0.0-beta-11
1.0.0-Beta-10
- Detect when in Speaker Window with
isInSpeakerWindow()
1.0.0-Beta-09
- Kotlin 2.0.20
- Compose 1.6.10
1.0.0-Beta-08
Breaking changes
- Speaker notes are now forcibly in Markdown, so
SpeakerNotesMD
is nowSpeakerNotes
.
Features
- Speaker notes can now differ per step (if you have very long slides).
Other
- Enhanced Compose performance by enhancing stability (with KotlinX.Collection.Immutable).
- Some plugin API enhancements.
1.0.0-Beta-07
This version brings no change to the presentation API.
UI Changes & fixes
- Tools & overlays now have a light color theme to make it easier on the eye.
- Laser tool is not active anymore in the overview
Changes to plugin API
- Breaking change: The
CupPlugin.overlay
function now has astate: PresentationState
parameter. - Added the
CupAdditionalOverlay.inMenu
constructor parameter & property to allow the overlay button to appear in an overflow menu.
1.0.0-Beta-06
- Added a new landing page for unsupported browsers (that do not support WebAssembly or Wasm Garbage Collection). Now displays a nice message, instead of a cryptic error message.
- Gradle plugin extensions now implement
ExtensionAware
.
1.0.0-Beta-05
Changes
Breaking changes
SlideSpecs
are now constructed directly, instead of by copy in a lambda. See the migration guide.
Version updates
- Kotlin 2.0.0.
- Compose 1.6.10.
Migration Guide
Kotlin 2.0.0
You need to add the kotlin("plugin.compose")
plugin to your projects. See the dedicated migration guide.
Note that presentations written with CuP 1.0.0-Beta-05
(or superior) must be compiled with at least Kotlin 2.0.0
and Compose 1.6.10
.
In Slide
: new way of defining SlideSpecs
If you changed the size of a particular slide, or its transitions, you would have changed its specs with:
// Correct up to 1.0.0-Beta-04
// Incorrect starting at 1.0.0-Beta-05
val mySlide by Slide(
specs = {
copy(
size = SLIDE_SIZE_16_9,
startTransitions = coolTransition
)
}
) { /*...*/ }
Using copy
meant starting form the global "default" slide specs and overriding some of its values.
This mechanism is now done for you (with a merge
function). The same code is now expressed much more concisely:
// Correct starting at 1.0.0-Beta-05
val mySlide by Slide(
specs = SlideSpecs(
size = SLIDE_SIZE_16_9,
startTransitions = coolTransition
)
) { /*...*/ }
Note that in this example we do not provide endTransitions
, which will be merged down from the default presentation specs.
In Slides
: new way of defining grouped slides inside transitions
CuP provides a way of applying specific transitions in a group of slides.
For example, this is how you would have all slides in a group use vertical transitions between them (note that this changes neither the startTransitions
of the first slide nor the endTransitions
of the last slide since this changes the transitions between the slides of the group):
// Correct up to 1.0.0-Beta-04
// Incorrect starting at 1.0.0-Beta-05
val modes = Slides(
slide1, slide2, slide3,
specs = {
copyWithInsideTransitions(
config = it,
startTransitions = TransitionSet.moveVertical,
endTransitions = TransitionSet.moveVertical
)
}
)
Due to changes in the way SlideSpecs are defined (explained in the next section), the copyWithInsideTransitions
function is replaced by insideTransitionSpecs
:
// Correct starting at 1.0.0-Beta-05
val modes = Slides(
slide1, slide2, slide3,
specs = {
it.insideTransitions(
startTransitions = TransitionSet.moveVertical,
endTransitions = TransitionSet.moveVertical
)
}
)
Note that it
is now the receiver, and no longer a parameter.
In Slides
: new way of defining grouped slides SlideSpecs
and user data
Slides
allows you to group multiple slides, and apply specific SlideSpecs
and user data to all slides in its group.
Here's how you would do that:
// Correct up to 1.0.0-Beta-04
// Incorrect starting at 1.0.0-Beta-05
val modes = Slides(
slide1, slide2, slide3,
// Make all slides in the group 16/9.
specs = { copy(size = SLIDE_SIZE_16_9) },
// Attach that data to all slides in the group.
user = MySpecificDataElement("foo-bar")
)
We have implemented two changes:
SlideSpecs
are now built directly and merged in each Slides.- user data is now built by slide, which allows you to configure it according to its
Slides.Position
.
This code is now expressed as such:
// Correct starting at 1.0.0-Beta-05
val modes = Slides(
slide1, slide2, slide3,
// Make all slides in the group 16/9.
specs = { SlideSpecs(size = SLIDE_SIZE_16_9) },
// Attach that data to all slides in the group.
user = { MySpecificDataElement("foo-bar") }
)
In essence, both specs
and user
now have the same logic :
public class Slides(
private val content: List<SlideGroup>,
private val user: ((Slides.Position) -> DataMap)? = null,
private val specs: ((Slides.Position) -> SlideSpecs)? = null
): SlideGroup
Note that you can merge SlideSpecs
together with the plus
operator.
This is how you would set inside transitions and slide size to slides in a group:
// Correct starting at 1.0.0-Beta-05
val modes = Slides(
slide1, slide2, slide3,
specs = {
it.insideTransitionSpecs(
startTransitions = TransitionSet.moveVertical,
endTransitions = TransitionSet.moveVertical
) + SlideSpecs(
size = SLIDE_SIZE_16_9
)
}
)
1.0.0-Beta-04
- Kotlin 2.0.0
- Compose 1.6.10
1.0.0-Beta-03
- Kotlin 2.0.0-RC3
- Compose 1.6.10-rc01
- Better mac icon
- Updated Highlight.js will all languages
- Fixes SourceCode end of line disappearance when line is too long.
1.0.0-Beta-02
Breaking Change
- The order of the optional parameters of the
SourceCode
function has changed (modifier
is now the first optional parameter to align with Compose convention), which will break your code if you are passing positional (un-named) optional parameters to theSourceCode
function.
Changes
- #4: Move custom UI components into some widget artefacts. You now need to add the Gradle dependency
implementation(cup.widgets.material)
orimplementation(cup.widgets.material3)
to your project.
New features
- #5: Source code update:
- Deprecates the
ensureStep
function. - New
SourceCode
debug
parameters which allows you to see your sections in yourSourceCode
(see documentation).
- Deprecates the
Fixes
- #3: Remove skiko.js from index.html to avoid downloading skiko.wasm twice.