Skip to content

Kadal Deck 0.4.1

Choose a tag to compare

@pmithunish pmithunish released this 22 Oct 03:39
· 9 commits to main since this release
cae5463

Patch Changes

  • fa42a5d: Three code-toolkit follow-ups.

    Magic move highlights. The inner fences of a md magic-move block take highlight steps, Slidev's way: ```ts {*|2|4-5} ```` lights all lines, then line 2, then lines 4–5, a click
    each, before the next morph. Lines outside the step dim, on screen, in print (a page per step) and
    in PPTX. The morph also animates again: without a {duration} the animation's timing was
    "undefinedms" and every transition was switched off; it now uses the block's `{duration}`, else
    the deck's `magicMoveDuration` (800 ms). Under `prefers-reduced-motion` the steps change at once.

    Code follows the theme menu. Picking another theme from the menu (T) now recolours code in
    that theme's own Shiki pair (kadal.theme.shiki): plain blocks, notation marks, TwoSlash, magic
    move and Monaco editors, in light and dark, on screen and in exports. The build highlights each
    token once with every distinct Shiki theme the menu needs, as CSS variables, plus a few rules in
    the deck's stylesheet; a deck whose menu shares one pair (the default menu) builds exactly as
    before. A slide that forces a colour scheme now also gets that scheme's code colours (a light
    slide in a dark deck used to keep the dark ones). The hosted shell's editors wear the deck's
    theme too, not always GitHub's.

    Monaco types for imported packages. {monaco} and {monaco-run} editors get the
    declarations of the npm packages they import, so hovers, completions and errors are the
    package's own: bundled from the deck's node_modules by kadal-deck build (offline), else fetched
    from jsDelivr (only declaration files, the ones the imports reach, within size limits, cached in
    the browser). monacoTypes: auto | local | cdn | none, monacoPackages (names, or versions to
    pin), monacoTypesIgnore; Slidev's monacoTypesSource, monacoTypesAdditionalPackages and
    monacoTypesIgnorePackages are read too, and the importer carries them over. Offline with
    nothing cached, editors behave as before. A {monaco-run} bare import (import { z } from "zod") now loads from esm.sh at the pinned version (monacoRunImports: another CDN or template,
    or false for the old error).

  • 1c4dc5e: Slidev's authoring leftovers, natively:

    • Comark (formerly MDC) syntax, opt-in with comark: true (or Slidev's mdc: true), in both the Vite plugin and the in-browser compiler: :badge[New]{tone="good"} inline components, [text]{.class style="…"} spans, {…} after bold, code, links and images, and ::name{props} … :: blocks with YAML props, #slot sections that arrive as props, and nesting by colons. ::right:: slot markers, ::code-group and MDX {expressions} keep their meaning; kadal-deck check checks Comark components like JSX ones, and kadal-deck import slidev now carries comark: true over instead of reporting it.
    • custom-nav-controls layer: custom-nav-controls.tsx beside deck.mdx (or a theme's or addon's layers) adds buttons beside the controls in play and to the presenter's toolbar. Slidev's custom-nav-controls.vue imports to it.
    • <ClickCount> and useClicks(): the slide's click count (Slidev's $clicks), with when={(c) => c > 2} for click-dependent content. The importer maps {{ $clicks }}, $clicksContext.current/total and v-if="$clicks > n" chains to it.
    • Dragged positions sync live: a <Drag> or <DragArrow> moved under kadal-deck dev follows in every other open window (presenter, second screen, projector) as it moves, with no reload.
    • Pages of the deck's own: routes.tsx beside deck.mdx (or setup/routes.ts), <Deck routes>, a package's routes or api.addRoute() add pages at <base><path> inside the deck's providers, with :params; the build copies index.html to each plain path for static hosts.
  • @kadal/prettier-plugin@0.4.1

Packages

Published from release.yml through npm trusted publishing, with provenance.

npm create @kadal/deck@latest my-talk      # a new deck
npm install @kadal/deck@0.4.1            # or upgrade one