@steamfield/decks 1.0.0-rc.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1 -1
- package/dist/control-tray.css +80 -0
- package/dist/go-to-dialog.css +57 -0
- package/dist/{index-BURtH7IB.d.ts → index-D3Yj4yT6.d.ts} +11 -2
- package/dist/{index-BV_-6L5L.d.ts → index-DG8UcGQd.d.ts} +77 -1
- package/dist/{index-B2n69xrC.d.ts → index-zg-z6HTy.d.ts} +18 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/kit/term/live-term.module.css +36 -0
- package/dist/kit.d.ts +21 -6
- package/dist/kit.js +252 -8
- package/dist/live-term.module.css +36 -0
- package/dist/magic-move.css +30 -0
- package/dist/mark.css +34 -0
- package/dist/motion.d.ts +2 -2
- package/dist/motion.js +1 -1
- package/dist/node.d.ts +5 -1
- package/dist/node.js +1 -1
- package/dist/plugin/skills/building-a-deck/references/workflow.md +10 -0
- package/dist/plugin/skills/deck-design/references/layout.md +2 -0
- package/dist/plugin/skills/deck-motion/references/motion.md +38 -1
- package/dist/plugin/skills/working-with-decks/references/project.md +4 -0
- package/dist/{prose-patterns-DPqjGBFu.js → prose-patterns-D-tdt0Ab.js} +3 -1
- package/dist/{prose-scan-BrWZ7gxZ.js → prose-scan-ni8g6pc-.js} +2 -2
- package/dist/{src-DizFoqYt.js → src-BHlxNl0Z.js} +347 -42
- package/dist/{src-CmQgaG1b.js → src-BxuWgcUh.js} +581 -67
- package/dist/{src-C-OfT72W.js → src-CDNWEWZz.js} +212 -3
- package/dist/term/shell_pty.py +38 -0
- package/dist/term/zsh/.zshrc +4 -0
- package/dist/term-protocol-B_qHRDEp.js +11 -0
- package/dist/xterm-host-C6OjffSm.js +282 -0
- package/docs/README.md +1 -0
- package/docs/cli.md +1 -1
- package/docs/code-blocks.md +31 -0
- package/docs/config.md +1 -0
- package/docs/getting-started.md +2 -1
- package/docs/kit.md +7 -6
- package/docs/migrating-from-slidev.md +4 -0
- package/docs/motion.md +25 -1
- package/docs/presenting.md +16 -1
- package/docs/slides.md +20 -1
- package/docs/terminal.md +97 -0
- package/package.json +4 -1
package/dist/kit.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import {
|
|
1
|
+
import { c as ease, l as gsap, o as useTween, t as useTimeline, u as motionMode } from "./src-CDNWEWZz.js";
|
|
2
|
+
import { S as useSlideScale, b as useDeck, f as registerCaptionProvider, v as registerSettleProbe, x as useSlide } from "./src-BHlxNl0Z.js";
|
|
3
|
+
import { a as TERM_POSITION, i as TERM_INPUT, n as TERM_DATA, o as TERM_READY, r as TERM_GONE, s as TERM_STATE, t as TERM_ATTACH } from "./term-protocol-B_qHRDEp.js";
|
|
3
4
|
import { useCallback, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
|
|
4
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
import { CustomEase } from "gsap/CustomEase";
|
|
@@ -8,6 +9,7 @@ import { scaleLinear } from "d3-scale";
|
|
|
8
9
|
import { Chart, Graph, compileGraph } from "@opendata-ai/openchart-react";
|
|
9
10
|
import "@opendata-ai/openchart-react/styles.css";
|
|
10
11
|
import { FLUID_SPRING, springDuration } from "@opendata-ai/openchart-core";
|
|
12
|
+
import styles from "./live-term.module.css";
|
|
11
13
|
// \0rolldown/runtime.js
|
|
12
14
|
var __defProp = Object.defineProperty;
|
|
13
15
|
var __exportAll = (all, flags) => {
|
|
@@ -1402,7 +1404,7 @@ const SETTLE_QUIET_MS = 600;
|
|
|
1402
1404
|
const MIN_SETTLE_MS = 1600;
|
|
1403
1405
|
const RESUME_IDLE_MS = 4e3;
|
|
1404
1406
|
const MAX_HANDLE_WAIT_MS = 12e3;
|
|
1405
|
-
function subscribeMotion(notify) {
|
|
1407
|
+
function subscribeMotion$1(notify) {
|
|
1406
1408
|
const observer = new MutationObserver(notify);
|
|
1407
1409
|
observer.observe(document.documentElement, {
|
|
1408
1410
|
attributes: true,
|
|
@@ -1413,7 +1415,7 @@ function subscribeMotion(notify) {
|
|
|
1413
1415
|
function Graph3D({ nodes, edges, orbit = true, dim = 1, zoom = 1, spec, legend = false }) {
|
|
1414
1416
|
const { isActive, renderContext } = useSlide();
|
|
1415
1417
|
const scale = useSlideScale();
|
|
1416
|
-
const mode = useSyncExternalStore(subscribeMotion, motionMode, () => "instant");
|
|
1418
|
+
const mode = useSyncExternalStore(subscribeMotion$1, motionMode, () => "instant");
|
|
1417
1419
|
const live = isActive && renderContext === "slide" && mode === "live";
|
|
1418
1420
|
const [ready, setReady] = useState(false);
|
|
1419
1421
|
const [failure, setFailure] = useState(null);
|
|
@@ -1543,7 +1545,7 @@ function GraphStill({ spec, zoom, legend }) {
|
|
|
1543
1545
|
cy: node.y,
|
|
1544
1546
|
r: node.r,
|
|
1545
1547
|
fill: node.fill,
|
|
1546
|
-
opacity: node.opacity
|
|
1548
|
+
style: { opacity: node.opacity }
|
|
1547
1549
|
}), i < 40 && node.label && /* @__PURE__ */ jsx("text", {
|
|
1548
1550
|
x: node.x + node.r + 5,
|
|
1549
1551
|
y: node.y,
|
|
@@ -3409,6 +3411,247 @@ function StoryLink({ href, label, opacity = 1 }) {
|
|
|
3409
3411
|
children: label ?? href.replace(/^https?:\/\//, "")
|
|
3410
3412
|
});
|
|
3411
3413
|
}
|
|
3414
|
+
// ../kit/src/term/connection.ts
|
|
3415
|
+
function createConnection(transport, pane) {
|
|
3416
|
+
let snapshot = {
|
|
3417
|
+
live: false,
|
|
3418
|
+
busy: false,
|
|
3419
|
+
reason: "",
|
|
3420
|
+
queued: []
|
|
3421
|
+
};
|
|
3422
|
+
let buffer = "";
|
|
3423
|
+
let active = false;
|
|
3424
|
+
let previous;
|
|
3425
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
3426
|
+
const output = /* @__PURE__ */ new Set();
|
|
3427
|
+
const update = (next) => {
|
|
3428
|
+
snapshot = next;
|
|
3429
|
+
for (const listener of listeners) listener();
|
|
3430
|
+
};
|
|
3431
|
+
const matches = (message) => typeof message === "object" && message !== null && "id" in message && message.id === pane.id;
|
|
3432
|
+
const ready = (message) => {
|
|
3433
|
+
if (!matches(message) || typeof message.buffer !== "string") return;
|
|
3434
|
+
buffer = message.buffer;
|
|
3435
|
+
for (const receive of output) receive(`\u001bc${buffer}`, true, false);
|
|
3436
|
+
update({
|
|
3437
|
+
...snapshot,
|
|
3438
|
+
live: true,
|
|
3439
|
+
reason: ""
|
|
3440
|
+
});
|
|
3441
|
+
};
|
|
3442
|
+
const data = (message) => {
|
|
3443
|
+
if (!matches(message) || typeof message.chunk !== "string") return;
|
|
3444
|
+
buffer = (buffer + message.chunk).slice(-204800);
|
|
3445
|
+
for (const receive of output) receive(message.chunk, false, message.immediate === true);
|
|
3446
|
+
};
|
|
3447
|
+
const state = (message) => {
|
|
3448
|
+
if (matches(message) && typeof message.busy === "boolean" && Array.isArray(message.queued) && message.queued.every((click) => typeof click === "number")) update({
|
|
3449
|
+
live: snapshot.live,
|
|
3450
|
+
busy: message.busy,
|
|
3451
|
+
reason: snapshot.reason,
|
|
3452
|
+
queued: [...message.queued]
|
|
3453
|
+
});
|
|
3454
|
+
};
|
|
3455
|
+
const gone = (message) => {
|
|
3456
|
+
if (matches(message) && typeof message.reason === "string") update({
|
|
3457
|
+
live: false,
|
|
3458
|
+
busy: false,
|
|
3459
|
+
reason: message.reason,
|
|
3460
|
+
queued: []
|
|
3461
|
+
});
|
|
3462
|
+
};
|
|
3463
|
+
const disconnect = () => update({
|
|
3464
|
+
live: false,
|
|
3465
|
+
busy: false,
|
|
3466
|
+
reason: "connection lost",
|
|
3467
|
+
queued: []
|
|
3468
|
+
});
|
|
3469
|
+
const handlers = [
|
|
3470
|
+
{
|
|
3471
|
+
event: TERM_READY,
|
|
3472
|
+
receive: ready
|
|
3473
|
+
},
|
|
3474
|
+
{
|
|
3475
|
+
event: TERM_DATA,
|
|
3476
|
+
receive: data
|
|
3477
|
+
},
|
|
3478
|
+
{
|
|
3479
|
+
event: TERM_STATE,
|
|
3480
|
+
receive: state
|
|
3481
|
+
},
|
|
3482
|
+
{
|
|
3483
|
+
event: TERM_GONE,
|
|
3484
|
+
receive: gone
|
|
3485
|
+
},
|
|
3486
|
+
{
|
|
3487
|
+
event: "vite:ws:disconnect",
|
|
3488
|
+
receive: disconnect
|
|
3489
|
+
}
|
|
3490
|
+
];
|
|
3491
|
+
const detach = () => {
|
|
3492
|
+
if (!active) return;
|
|
3493
|
+
active = false;
|
|
3494
|
+
for (const { event, receive } of handlers) transport.off(event, receive);
|
|
3495
|
+
update({
|
|
3496
|
+
live: false,
|
|
3497
|
+
busy: false,
|
|
3498
|
+
reason: "",
|
|
3499
|
+
queued: []
|
|
3500
|
+
});
|
|
3501
|
+
};
|
|
3502
|
+
return {
|
|
3503
|
+
getSnapshot: () => snapshot,
|
|
3504
|
+
subscribe(receive) {
|
|
3505
|
+
listeners.add(receive);
|
|
3506
|
+
return () => {
|
|
3507
|
+
listeners.delete(receive);
|
|
3508
|
+
};
|
|
3509
|
+
},
|
|
3510
|
+
subscribeOutput(receive) {
|
|
3511
|
+
output.add(receive);
|
|
3512
|
+
receive(`\u001bc${buffer}`, true, false);
|
|
3513
|
+
return () => {
|
|
3514
|
+
output.delete(receive);
|
|
3515
|
+
};
|
|
3516
|
+
},
|
|
3517
|
+
navigate(eligible, click, slideActive, stamp) {
|
|
3518
|
+
const before = previous;
|
|
3519
|
+
previous = {
|
|
3520
|
+
active: slideActive,
|
|
3521
|
+
click
|
|
3522
|
+
};
|
|
3523
|
+
if (!eligible) return detach();
|
|
3524
|
+
if (!active) {
|
|
3525
|
+
active = true;
|
|
3526
|
+
for (const { event, receive } of handlers) transport.on(event, receive);
|
|
3527
|
+
transport.send(TERM_ATTACH, { pane });
|
|
3528
|
+
}
|
|
3529
|
+
if (before && (!before.active || click !== before.click)) transport.send(TERM_POSITION, {
|
|
3530
|
+
id: pane.id,
|
|
3531
|
+
click,
|
|
3532
|
+
entered: !before.active,
|
|
3533
|
+
stamp
|
|
3534
|
+
});
|
|
3535
|
+
},
|
|
3536
|
+
input(data) {
|
|
3537
|
+
if (active && snapshot.live) transport.send(TERM_INPUT, {
|
|
3538
|
+
id: pane.id,
|
|
3539
|
+
data
|
|
3540
|
+
});
|
|
3541
|
+
},
|
|
3542
|
+
unavailable(reason) {
|
|
3543
|
+
update({
|
|
3544
|
+
live: false,
|
|
3545
|
+
busy: false,
|
|
3546
|
+
reason,
|
|
3547
|
+
queued: []
|
|
3548
|
+
});
|
|
3549
|
+
},
|
|
3550
|
+
detach
|
|
3551
|
+
};
|
|
3552
|
+
}
|
|
3553
|
+
// ../kit/src/term/use-live-term.ts
|
|
3554
|
+
const recording = {
|
|
3555
|
+
live: false,
|
|
3556
|
+
busy: false,
|
|
3557
|
+
reason: "",
|
|
3558
|
+
queued: []
|
|
3559
|
+
};
|
|
3560
|
+
const noop = () => () => {};
|
|
3561
|
+
function useLiveTerm(transport, pane, eligible, click, slideActive) {
|
|
3562
|
+
const { syncStamp } = useDeck();
|
|
3563
|
+
const key = JSON.stringify([
|
|
3564
|
+
pane.id,
|
|
3565
|
+
pane.rows,
|
|
3566
|
+
pane.cols,
|
|
3567
|
+
pane.cwd,
|
|
3568
|
+
pane.commands
|
|
3569
|
+
]);
|
|
3570
|
+
const [current, setCurrent] = useState(() => ({
|
|
3571
|
+
transport,
|
|
3572
|
+
key,
|
|
3573
|
+
connection: transport ? createConnection(transport, pane) : void 0
|
|
3574
|
+
}));
|
|
3575
|
+
if (current.transport !== transport || current.key !== key) setCurrent({
|
|
3576
|
+
transport,
|
|
3577
|
+
key,
|
|
3578
|
+
connection: transport ? createConnection(transport, pane) : void 0
|
|
3579
|
+
});
|
|
3580
|
+
const connection = current.connection;
|
|
3581
|
+
const state = useSyncExternalStore(connection?.subscribe ?? noop, connection?.getSnapshot ?? (() => recording), () => recording);
|
|
3582
|
+
useEffect(() => {
|
|
3583
|
+
connection?.navigate(eligible, click, slideActive, syncStamp);
|
|
3584
|
+
}, [
|
|
3585
|
+
connection,
|
|
3586
|
+
eligible,
|
|
3587
|
+
click,
|
|
3588
|
+
slideActive,
|
|
3589
|
+
syncStamp
|
|
3590
|
+
]);
|
|
3591
|
+
useEffect(() => () => connection?.detach(), [connection]);
|
|
3592
|
+
return {
|
|
3593
|
+
...state,
|
|
3594
|
+
live: eligible && state.live,
|
|
3595
|
+
connection
|
|
3596
|
+
};
|
|
3597
|
+
}
|
|
3598
|
+
// ../kit/src/term/live-term.tsx
|
|
3599
|
+
function subscribeMotion(notify) {
|
|
3600
|
+
const observer = new MutationObserver(notify);
|
|
3601
|
+
observer.observe(document.documentElement, {
|
|
3602
|
+
attributes: true,
|
|
3603
|
+
attributeFilter: ["data-deck-motion"]
|
|
3604
|
+
});
|
|
3605
|
+
return () => observer.disconnect();
|
|
3606
|
+
}
|
|
3607
|
+
function LiveTerm({ pane, click, fallback, frame }) {
|
|
3608
|
+
const { isActive, renderContext } = useSlide();
|
|
3609
|
+
const { view, embedded } = useDeck();
|
|
3610
|
+
const scale = useSlideScale();
|
|
3611
|
+
const mode = useSyncExternalStore(subscribeMotion, motionMode, () => "instant");
|
|
3612
|
+
const eligible = isActive && renderContext === "slide" && view === "play" && !embedded && mode === "live";
|
|
3613
|
+
const live = useLiveTerm(import.meta.hot, pane, eligible, click, isActive);
|
|
3614
|
+
const [drawn, setDrawn] = useState(false);
|
|
3615
|
+
const [Host, setHost] = useState();
|
|
3616
|
+
useEffect(() => {
|
|
3617
|
+
if (!import.meta.hot || !live.live) return;
|
|
3618
|
+
let cancelled = false;
|
|
3619
|
+
import("./xterm-host-C6OjffSm.js").then(({ XtermHost }) => {
|
|
3620
|
+
if (!cancelled) setHost(() => XtermHost);
|
|
3621
|
+
}, (error) => {
|
|
3622
|
+
if (!cancelled) live.connection?.unavailable(`terminal could not load: ${error instanceof Error ? error.message : String(error)}`);
|
|
3623
|
+
});
|
|
3624
|
+
return () => {
|
|
3625
|
+
cancelled = true;
|
|
3626
|
+
};
|
|
3627
|
+
}, [live.live, live.connection]);
|
|
3628
|
+
const showingLive = live.live && drawn;
|
|
3629
|
+
const content = /* @__PURE__ */ jsxs("div", {
|
|
3630
|
+
className: styles.content,
|
|
3631
|
+
children: [!showingLive && fallback, live.live && Host && live.connection && /* @__PURE__ */ jsx("div", {
|
|
3632
|
+
className: showingLive ? styles.shell : styles.loading,
|
|
3633
|
+
children: /* @__PURE__ */ jsx(Host, {
|
|
3634
|
+
connection: live.connection,
|
|
3635
|
+
rows: pane.rows,
|
|
3636
|
+
cols: pane.cols,
|
|
3637
|
+
scale,
|
|
3638
|
+
onReady: setDrawn
|
|
3639
|
+
})
|
|
3640
|
+
})]
|
|
3641
|
+
});
|
|
3642
|
+
return /* @__PURE__ */ jsx("div", {
|
|
3643
|
+
className: styles.pane,
|
|
3644
|
+
children: frame ? frame(content, {
|
|
3645
|
+
live: showingLive,
|
|
3646
|
+
busy: live.busy,
|
|
3647
|
+
queued: live.queued.length > 0,
|
|
3648
|
+
...live.reason ? { reason: live.reason } : {}
|
|
3649
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [content, !showingLive && live.reason && /* @__PURE__ */ jsx("div", {
|
|
3650
|
+
role: "status",
|
|
3651
|
+
children: live.reason
|
|
3652
|
+
})] })
|
|
3653
|
+
});
|
|
3654
|
+
}
|
|
3412
3655
|
// ../kit/src/theme/chart-theme.ts
|
|
3413
3656
|
const slideChartTheme = {
|
|
3414
3657
|
get colors() {
|
|
@@ -3465,11 +3708,12 @@ function scaleChartTheme(value, scale) {
|
|
|
3465
3708
|
}
|
|
3466
3709
|
};
|
|
3467
3710
|
}
|
|
3711
|
+
/** The chart library takes milliseconds; the values are the deck's own duration tokens. */
|
|
3468
3712
|
const slideChartAnimation = {
|
|
3469
3713
|
enter: {
|
|
3470
|
-
duration:
|
|
3714
|
+
duration: DUR.scale * 1e3,
|
|
3471
3715
|
ease: "smooth"
|
|
3472
3716
|
},
|
|
3473
|
-
annotationDelay:
|
|
3717
|
+
annotationDelay: DUR.eraseDelay * 1e3
|
|
3474
3718
|
};
|
|
3475
|
-
export { BRUSH_DEFAULTS, CANVAS, CATEGORICAL_COLORS, CodeInk, DRAW, DRAW_CSS, DUR, FILTER_IDS, Graph3D, InkBars, InkCardRect, InkChip, InkLine, InkNumber, InkPing, InkRule, InkTimeline, InkTimelineCursor, OdByline, OdCoverHead, OdEyebrow, OdLogo, OdQrCard, OpenChart, RISE, SETTLE, SETTLE_CSS, STAGE, STORY_STYLE, STROKE, StoryCard, StoryCover, StoryLayer, StoryLink, StoryStage, TRACE, TRACE_CSS, UNIT_GRID_DEFAULTS, Underline, UnitGrid, brushRibbon, clamp01, easeHeight, easedStagger, entrance, fadeIn, fadeOutInPlace, filterUrl, gsap, hash, hashRange, hashSigned, ink, inkStyle, installTheme, lerp, parliament_exports as parliament, polylinePath, prefersReducedMotion, resolvePosition, resolveTheme, rippleProgress, riseIn, scaleChartTheme, slideChartAnimation, slideChartTheme, stackEndLabels, stagger, theme, tokenizeSql, unitCellCenter, unitCellHeight, useSlideScale as useFrameScale, useScriptedDemo, useStage, useStageEntrance, useStageMap, xScale, yScale };
|
|
3719
|
+
export { BRUSH_DEFAULTS, CANVAS, CATEGORICAL_COLORS, CodeInk, DRAW, DRAW_CSS, DUR, FILTER_IDS, Graph3D, InkBars, InkCardRect, InkChip, InkLine, InkNumber, InkPing, InkRule, InkTimeline, InkTimelineCursor, LiveTerm, OdByline, OdCoverHead, OdEyebrow, OdLogo, OdQrCard, OpenChart, RISE, SETTLE, SETTLE_CSS, STAGE, STORY_STYLE, STROKE, StoryCard, StoryCover, StoryLayer, StoryLink, StoryStage, TRACE, TRACE_CSS, UNIT_GRID_DEFAULTS, Underline, UnitGrid, brushRibbon, clamp01, easeHeight, easedStagger, entrance, fadeIn, fadeOutInPlace, filterUrl, gsap, hash, hashRange, hashSigned, ink, inkStyle, installTheme, lerp, parliament_exports as parliament, polylinePath, prefersReducedMotion, resolvePosition, resolveTheme, rippleProgress, riseIn, scaleChartTheme, slideChartAnimation, slideChartTheme, stackEndLabels, stagger, theme, tokenizeSql, unitCellCenter, unitCellHeight, useSlideScale as useFrameScale, useScriptedDemo, useStage, useStageEntrance, useStageMap, xScale, yScale };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
.pane {
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 100%;
|
|
4
|
+
min-width: 0;
|
|
5
|
+
min-height: 0;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.viewport {
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: 100%;
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
color: var(--deck-term-foreground, white);
|
|
13
|
+
background-color: var(--deck-term-background, black);
|
|
14
|
+
font-family: var(--deck-term-font, monospace);
|
|
15
|
+
font-size: var(--deck-term-font-size, 1em);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.host {
|
|
19
|
+
transform-origin: top left;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.content {
|
|
23
|
+
position: relative;
|
|
24
|
+
width: 100%;
|
|
25
|
+
height: 100%;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.shell,
|
|
29
|
+
.loading {
|
|
30
|
+
position: absolute;
|
|
31
|
+
inset: 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.loading {
|
|
35
|
+
visibility: hidden;
|
|
36
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
@import "@shikijs/magic-move/style.css" layer(react-decks);
|
|
2
|
+
|
|
3
|
+
@layer react-decks {
|
|
4
|
+
.rd-magic-move pre {
|
|
5
|
+
padding: 28px 32px;
|
|
6
|
+
color: var(--deck-code-foreground);
|
|
7
|
+
font:
|
|
8
|
+
calc(32px * var(--deck-text-scale, 1)) / 1.6 ui-monospace,
|
|
9
|
+
"SFMono-Regular",
|
|
10
|
+
Consolas,
|
|
11
|
+
monospace;
|
|
12
|
+
tab-size: 2;
|
|
13
|
+
}
|
|
14
|
+
.rd-magic-move [data-line] {
|
|
15
|
+
min-width: 0;
|
|
16
|
+
padding: 0;
|
|
17
|
+
transition: opacity var(--deck-dur-base) var(--deck-ease-settle);
|
|
18
|
+
}
|
|
19
|
+
.rd-magic-move .shiki-magic-move-move,
|
|
20
|
+
.rd-magic-move .shiki-magic-move-enter-active,
|
|
21
|
+
.rd-magic-move .shiki-magic-move-leave-active {
|
|
22
|
+
transition-property: transform, color, opacity;
|
|
23
|
+
transition-duration: var(--smm-duration);
|
|
24
|
+
transition-timing-function: var(--deck-ease-settle);
|
|
25
|
+
}
|
|
26
|
+
.rd-magic-move .shiki-magic-move-enter-from,
|
|
27
|
+
.rd-magic-move .shiki-magic-move-leave-to {
|
|
28
|
+
opacity: 0;
|
|
29
|
+
}
|
|
30
|
+
}
|
package/dist/mark.css
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
@layer react-decks {
|
|
2
|
+
.rd-mark[data-step-state] {
|
|
3
|
+
display: inline-block;
|
|
4
|
+
position: relative;
|
|
5
|
+
opacity: 1;
|
|
6
|
+
visibility: visible;
|
|
7
|
+
transition: none;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.rd-mark > svg {
|
|
11
|
+
position: absolute;
|
|
12
|
+
inset: 0;
|
|
13
|
+
width: 100%;
|
|
14
|
+
height: 100%;
|
|
15
|
+
overflow: visible;
|
|
16
|
+
pointer-events: none;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.rd-mark > svg > path {
|
|
20
|
+
stroke-width: var(--deck-mark-width, 3px);
|
|
21
|
+
stroke-dasharray: 1;
|
|
22
|
+
stroke-dashoffset: 0;
|
|
23
|
+
transition: stroke-dashoffset var(--deck-dur-slow) var(--deck-ease-draw);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.rd-mark:is([data-step-state="before"], [data-step-state="gone"]) > svg > path {
|
|
27
|
+
stroke-dashoffset: 1;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
html[data-deck-motion="instant"] .rd-mark > svg > path,
|
|
31
|
+
[data-deck-context]:not([data-deck-context="slide"]) .rd-mark > svg > path {
|
|
32
|
+
transition-duration: 0ms;
|
|
33
|
+
}
|
|
34
|
+
}
|
package/dist/motion.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
export { CodeBlock, CountUp, Draw, Highlight, Morph, Stagger, Step, type StepPreset, Steps, TextReveal, duration, ease, gsap, motionMode, stagger, useStepState, useTimeline, useTween };
|
|
1
|
+
import { _ as Mark, a as gsap, b as CountUp, c as Draw, d as Step, f as StepPreset, g as Morph, h as useStepState, i as ease, l as Highlight, m as TextReveal, n as useTimeline, o as motionMode, p as Steps, r as duration, s as stagger, t as useTween, u as Stagger, v as MarkKind, x as CodeBlock, y as MagicMove } from "./index-zg-z6HTy.js";
|
|
2
|
+
export { CodeBlock, CountUp, Draw, Highlight, MagicMove, Mark, type MarkKind, Morph, Stagger, Step, type StepPreset, Steps, TextReveal, duration, ease, gsap, motionMode, stagger, useStepState, useTimeline, useTween };
|
package/dist/motion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { y as CodeBlock, a as CountUp, f as Draw, p as Highlight, i as MagicMove, r as Mark, n as Morph, m as Stagger, h as Step, g as Steps, _ as TextReveal, s as duration, c as ease, l as gsap, u as motionMode, d as stagger, v as useStepState, t as useTimeline, o as useTween } from "./src-CDNWEWZz.js";
|
package/dist/node.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { U as DeckManifest, W as SlideMeta } from "./index-DG8UcGQd.js";
|
|
2
2
|
import { PluggableList } from "unified";
|
|
3
3
|
import { Plugin, UserConfig } from "vite";
|
|
4
4
|
export declare function runCli(rawArgs?: string[]): Promise<void>;
|
|
@@ -21,6 +21,9 @@ interface DeckConfig {
|
|
|
21
21
|
*/
|
|
22
22
|
readonly credit?: boolean;
|
|
23
23
|
readonly vite?: UserConfig;
|
|
24
|
+
readonly term?: {
|
|
25
|
+
readonly dirs?: Record<string, string>;
|
|
26
|
+
};
|
|
24
27
|
/** remark and rehype plugins added to the slide compiler. */
|
|
25
28
|
readonly mdx?: {
|
|
26
29
|
readonly remarkPlugins?: PluggableList;
|
|
@@ -48,6 +51,7 @@ interface DevServer {
|
|
|
48
51
|
export declare function dev(deck: ResolvedDeck, options?: {
|
|
49
52
|
port?: number;
|
|
50
53
|
open?: boolean;
|
|
54
|
+
liveTerm?: boolean;
|
|
51
55
|
}): Promise<DevServer>;
|
|
52
56
|
export declare function build(deck: ResolvedDeck, options: {
|
|
53
57
|
outDir: string;
|
package/dist/node.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as build,
|
|
1
|
+
export { n as build, a as buildManifest, s as defineDeck, r as dev, c as loadDeck, i as reactDecks, t as runCli, o as scanSlides } from "./src-BxuWgcUh.js";
|
|
@@ -50,6 +50,16 @@ Set `transition: "story"` in `deck.config.ts` and import the kit stylesheet. Wri
|
|
|
50
50
|
|
|
51
51
|
Use `decks:deck-motion` for entrance versus beat state and refs. Use `decks:visualization` before selecting an Ink mark or writing an OpenChart spec. Use no network-dependent live demo to stand in for reproducible evidence.
|
|
52
52
|
|
|
53
|
+
## Live terminal
|
|
54
|
+
|
|
55
|
+
Use `LiveTerm` from `@steamfield/decks/kit` for prepared shell commands inside a slide. Pass a `pane` specification (`id`, `rows`, `cols`, `cwd`, `commands`), the slide's current click, and a required `fallback` recording node. Use `cwd: "temp"` for a fresh temporary directory, or a key declared in `deck.config.ts` under `term.dirs`.
|
|
56
|
+
|
|
57
|
+
Start the deck with `decks dev <deck> --live-term` on macOS or Linux. Only the active play slide with live motion shows the shell. Presenter, overview, print and embeds show the recording. Build, export and shot also show the recording; check it at every click. Full-screen TUIs are unsupported because replaying the output tail cannot reconstruct their screen.
|
|
58
|
+
|
|
59
|
+
Click the terminal to type; press Escape to return keys to the deck. Give the pane a size in the slide layout. Set its font and colours with `--deck-term-*` custom properties; the component supplies no skin.
|
|
60
|
+
|
|
61
|
+
Pass `frame={(content, status) => ...}` to wrap both the shell and recording in your deck's skin. Render `content` in a sized area and label it from `status.live`, `status.busy`, `status.queued` and `status.reason`, for example "Live · busy" or "Recorded · live unavailable: Shell exited (0)". `live` becomes true when the shell can draw; the recording stays visible while the module and font load. With `frame`, show the reason yourself. Without it, the component places the reason below the recording with `role="status"`.
|
|
62
|
+
|
|
53
63
|
## Notes and pacing
|
|
54
64
|
|
|
55
65
|
Put opening narration before the first `[click]` marker in a single `<Notes>` block. For story decks use one plain `[click]` line per click, in order, so the presenter can follow every beat. Notes do not add clicks. Do not hide notes in comments or put the block inside a conditional expression.
|
|
@@ -10,6 +10,8 @@ Basic layouts are available without imports in MDX. `Center`, `Cover` and `Secti
|
|
|
10
10
|
|
|
11
11
|
Their default layout tokens are `--deck-pad-x`, `--deck-pad-y` and `--deck-gap`. Follow the installed guide for values rather than assuming kit classes share the same padding.
|
|
12
12
|
|
|
13
|
+
Use `<Toc />` for an agenda slide: it lists every slide's title and marks the current slide. Use `<Link to={3}>...</Link>` for a cross-reference to slide 3 at click 0. Both are available without imports in MDX. Links navigate in play and presenter views; in previews, overview thumbnails and print they render as plain text.
|
|
14
|
+
|
|
13
15
|
## Typography
|
|
14
16
|
|
|
15
17
|
Establish a short scale for headline, body, label and source. The framework guide's plain-CSS starter uses 96 design pixels for a headline and 40 for body; these are starting values, not rendered kit class guarantees. Do not carry old heading specificity fixes into a new deck. Inspect what actually renders.
|
|
@@ -8,7 +8,7 @@ Without explicit `clicks`, the compiler uses the maximum contribution in MDX:
|
|
|
8
8
|
|
|
9
9
|
| Element | Count contribution |
|
|
10
10
|
| --- | --- |
|
|
11
|
-
| `Step`, `Stagger`, `Highlight`, `Draw` | `until` when present, otherwise `at` |
|
|
11
|
+
| `Step`, `Stagger`, `Highlight`, `Draw`, `Mark` | `until` when present, otherwise `at` |
|
|
12
12
|
| `TextReveal`, `CountUp` | `at` |
|
|
13
13
|
| `Steps` with k children | `from + k - 1` |
|
|
14
14
|
| Fenced code with k emphasis states | `at + k - 1` |
|
|
@@ -31,6 +31,43 @@ Read installed declarations for full props; the commonly needed ones are:
|
|
|
31
31
|
- `Draw`: `at`, optional `until`; wraps direct stroked SVG shapes in a `g`. Supply the stroke through CSS.
|
|
32
32
|
- `Morph`: `name`, optional `as`, `className`. Same name once per slide, shared by adjacent slides for the same object. Use a valid nonreserved CSS identifier. It does not morph under `cut`.
|
|
33
33
|
|
|
34
|
+
## Mark
|
|
35
|
+
|
|
36
|
+
Use `Mark` to draw a rough stroke around or through inline text on a click. Use `Highlight` for a background sweep behind the text. `Mark` keeps the text visible and accessible at every click.
|
|
37
|
+
|
|
38
|
+
Choose `kind="underline"` (the default), `"circle"`, `"box"`, `"strike"`, `"cross"` or `"bracket"`. Set `at` to the drawing click and optional `until` to the click that removes the stroke. Going backward un-draws the mark. Set `color` to any CSS color, including a theme token such as `var(--accent)`; it defaults to `currentColor`.
|
|
39
|
+
|
|
40
|
+
```mdx
|
|
41
|
+
<Mark kind="circle" at={2} until={4} color="var(--accent)">the evidence</Mark>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Marks fit the text box and update when it resizes. Equal boxes produce identical paths across slide, presenter, preview, overview and print. Outside the live slide and in instant mode, the stroke snaps to the pose for that context's click. Set `--deck-mark-width` to change the stroke width (default `3px`).
|
|
45
|
+
|
|
46
|
+
## Magic move
|
|
47
|
+
|
|
48
|
+
Use a fence of four or more backticks with `md magic-move` or `markdown magic-move` to morph code between clicks. Put one code fence inside it for each code version. Text between those fences is ignored. The outer fence accepts a title in quotes or Slidev's `[title]` form and `{at: N, lines: true}`; `at` defaults to 0 and line numbers default to off. An inner fence can override numbering with `{lines: false}`.
|
|
49
|
+
|
|
50
|
+
`````md
|
|
51
|
+
````md magic-move "greet.ts" {at: 1, lines: true}
|
|
52
|
+
```ts {1}
|
|
53
|
+
const greeting = "Hello";
|
|
54
|
+
```
|
|
55
|
+
```ts {1|2} {lines: false}
|
|
56
|
+
const greet = (name: string) => `Hello, ${name}`;
|
|
57
|
+
greet("Ada");
|
|
58
|
+
```
|
|
59
|
+
```ts {all}
|
|
60
|
+
export function greet(name: string) {
|
|
61
|
+
return `Hello, ${name}!`;
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
````
|
|
65
|
+
`````
|
|
66
|
+
|
|
67
|
+
Ranges use the ordinary code-block syntax: commas and hyphens select lines, `|` separates emphasis clicks, and `all` and `none` are keywords. Each version takes at least one click state. Its first range appears when the morph lands; further ranges each take a click. The total contribution is `at + sum(max(1, range count per version)) - 1`. Before `at`, the first version is visible without emphasis.
|
|
68
|
+
|
|
69
|
+
Only an adjacent forward click into the next code version morphs in the active live slide. Backward navigation, jumps, first render, instant motion and other contexts show their click's code immediately. Print follows each page's click; final-only print shows the last version. The compiler supplies `MagicMove` and keyed tokens; do not author the component or tokenize code in the browser. Invalid options and ranges report the slide file and line.
|
|
70
|
+
|
|
34
71
|
## Tokens
|
|
35
72
|
|
|
36
73
|
Import `duration`, `ease`, `stagger` and `gsap` from `@steamfield/decks/motion`. `duration.quick`, `.base`, `.slow` correspond to `--deck-dur-quick`, `--deck-dur-base`, `--deck-dur-slow`. `ease.enter`, `.exit`, `.settle`, `.draw` correspond to `--deck-ease-enter`, `--deck-ease-exit`, `--deck-ease-settle`, `--deck-ease-draw`. `stagger` corresponds to `--deck-stagger`.
|
|
@@ -26,6 +26,10 @@ Only the config and slides are required by the framework. `data/`, `data-sources
|
|
|
26
26
|
- `setup.ts` runs in the browser before component modules. Install the kit theme there with `installTheme(resolveTheme())`, imported from `@steamfield/decks/kit`. For an override, import `./theme.json` and pass it to `resolveTheme`.
|
|
27
27
|
- `public/` contains assets served at the site root. Only `above.tsx`, `below.tsx` and `credit.tsx` are allowed as React layers under `layers/`; each default-exports a component. They render per slide instance.
|
|
28
28
|
|
|
29
|
+
## Presenting controls
|
|
30
|
+
|
|
31
|
+
Move the pointer to the bottom-left corner of the play view to reveal the control tray, or Tab to its buttons. It holds Previous, Next, the slide counter (opens go-to), Overview, Open presenter, fullscreen when supported, and smaller/larger text. The tray is absent in embedded and bridge decks and other views. Use `f` for fullscreen, `o` for overview, `p` for the presenter window, and `g` for go-to. Cmd/Ctrl `+` and `-` change text size; Cmd/Ctrl `0` resets it.
|
|
32
|
+
|
|
29
33
|
## Public import roots
|
|
30
34
|
|
|
31
35
|
| Import | Use |
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { relative } from "node:path";
|
|
2
2
|
import { readFileSync } from "node:fs";
|
|
3
3
|
// ../node/src/dev/errors.ts
|
|
4
|
+
/** Appended to an error that the framework, not the author, caused. */
|
|
5
|
+
const bugNotice = "This is a bug in react-decks.";
|
|
4
6
|
const displayPath = (file) => relative(process.cwd(), file) || ".";
|
|
5
7
|
/** Author input is reported at the CLI or Vite boundary, never where it is detected. */
|
|
6
8
|
var DeckError = class extends Error {
|
|
@@ -73,4 +75,4 @@ function allowOf(line) {
|
|
|
73
75
|
const match = /lint-allow:\s*/.exec(line);
|
|
74
76
|
return match ? line.slice(match.index + match[0].length).replace(/\s*(\*\/|-->|}).*/, "").replace(/\s/g, "").split(",") : [];
|
|
75
77
|
}
|
|
76
|
-
export { authorError as a,
|
|
78
|
+
export { authorError as a, displayPath as c, DeckError as i, validationError as l, loadPatterns as n, bugNotice as o, patternsFile as r, compileError as s, allowOf as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { i as DeckError,
|
|
1
|
+
import { i as DeckError, s as compileError, t as allowOf } from "./prose-patterns-D-tdt0Ab.js";
|
|
2
2
|
import remarkFrontmatter from "remark-frontmatter";
|
|
3
3
|
import { unified } from "unified";
|
|
4
|
-
import remarkMdx from "remark-mdx";
|
|
5
4
|
import remarkParse from "remark-parse";
|
|
5
|
+
import remarkMdx from "remark-mdx";
|
|
6
6
|
import { Visitor, parseSync } from "oxc-parser";
|
|
7
7
|
// ../node/src/prose/prose-offsets.ts
|
|
8
8
|
const markdown = unified().use(remarkParse);
|