@steamfield/decks 1.0.0-rc.1 → 1.1.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 +84 -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/presenter-view.css +14 -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--lhAQ29p.js} +348 -43
- package/dist/{src-C-OfT72W.js → src-BNyL3q7j.js} +212 -3
- package/dist/{src-CmQgaG1b.js → src-Cxck-eLP.js} +588 -68
- 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 +2 -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
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Children, cloneElement, isValidElement, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
|
|
1
|
+
import { C as stepState, S as useSlideScale, v as registerSettleProbe, x as useSlide } from "./src--lhAQ29p.js";
|
|
2
|
+
import { Children, cloneElement, isValidElement, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { flushSync } from "react-dom";
|
|
5
5
|
import "./motion.css";
|
|
6
6
|
import { gsap, gsap as gsap$1 } from "gsap";
|
|
7
7
|
import { CustomEase } from "gsap/CustomEase";
|
|
8
|
+
import { ShikiMagicMovePrecompiled } from "@shikijs/magic-move/react";
|
|
9
|
+
import "./magic-move.css";
|
|
10
|
+
import rough from "roughjs";
|
|
11
|
+
import "./mark.css";
|
|
8
12
|
// ../motion/src/settle.ts
|
|
9
13
|
let pending = 0;
|
|
10
14
|
function pendingTweenNotification(change) {
|
|
@@ -322,6 +326,211 @@ function CountUp({ at, from = 0, to, format = defaultFormat }) {
|
|
|
322
326
|
})]
|
|
323
327
|
});
|
|
324
328
|
}
|
|
329
|
+
// ../motion/src/magic-move.tsx
|
|
330
|
+
/** Compiled fence output; authors write a magic-move fence rather than this component. */
|
|
331
|
+
function MagicMove(props) {
|
|
332
|
+
const { clicks, isActive, renderContext } = useSlide();
|
|
333
|
+
const scale = useSlideScale();
|
|
334
|
+
const steps = useMemo(() => JSON.parse(props.steps), [props.steps]);
|
|
335
|
+
const ranges = useMemo(() => JSON.parse(props.ranges), [props.ranges]);
|
|
336
|
+
const at = Number(props.at);
|
|
337
|
+
let remaining = clicks - at;
|
|
338
|
+
let index = 0;
|
|
339
|
+
while (index < steps.length - 1 && remaining >= Math.max(1, ranges[index]?.length ?? 0)) {
|
|
340
|
+
remaining -= Math.max(1, ranges[index]?.length ?? 0);
|
|
341
|
+
index++;
|
|
342
|
+
}
|
|
343
|
+
const range = clicks < at ? void 0 : ranges[index]?.[Math.max(0, Math.min(remaining, (ranges[index]?.length ?? 0) - 1))];
|
|
344
|
+
const previous = useRef({
|
|
345
|
+
clicks,
|
|
346
|
+
index,
|
|
347
|
+
isActive
|
|
348
|
+
});
|
|
349
|
+
const primed = useRef(false);
|
|
350
|
+
const [rendered, setRendered] = useState({
|
|
351
|
+
index,
|
|
352
|
+
animate: false
|
|
353
|
+
});
|
|
354
|
+
const rendererSteps = useMemo(() => rendered.next === void 0 ? steps : steps.map((step) => ({ ...step })), [steps, rendered.next]);
|
|
355
|
+
const container = useRef(null);
|
|
356
|
+
const options = useMemo(() => ({
|
|
357
|
+
duration: rendered.next === void 0 ? duration.slow * 1e3 : 0,
|
|
358
|
+
globalScale: scale,
|
|
359
|
+
animateContainer: false
|
|
360
|
+
}), [scale, rendered.next]);
|
|
361
|
+
useLayoutEffect(() => {
|
|
362
|
+
const animate = previous.current.clicks + 1 === clicks && previous.current.index + 1 === index && previous.current.isActive && isActive && renderContext === "slide" && motionMode() === "live";
|
|
363
|
+
const from = previous.current.index;
|
|
364
|
+
previous.current = {
|
|
365
|
+
clicks,
|
|
366
|
+
index,
|
|
367
|
+
isActive
|
|
368
|
+
};
|
|
369
|
+
if (animate && !primed.current) {
|
|
370
|
+
primed.current = true;
|
|
371
|
+
setRendered({
|
|
372
|
+
index: from,
|
|
373
|
+
animate: true,
|
|
374
|
+
next: index
|
|
375
|
+
});
|
|
376
|
+
} else setRendered((current) => current.index === index && current.animate === animate && current.next === void 0 ? current : {
|
|
377
|
+
index,
|
|
378
|
+
animate
|
|
379
|
+
});
|
|
380
|
+
}, [
|
|
381
|
+
clicks,
|
|
382
|
+
index,
|
|
383
|
+
isActive,
|
|
384
|
+
renderContext
|
|
385
|
+
]);
|
|
386
|
+
useEffect(() => {
|
|
387
|
+
const pre = container.current?.querySelector("pre");
|
|
388
|
+
if (!pre) return;
|
|
389
|
+
const mark = () => {
|
|
390
|
+
let line = 1;
|
|
391
|
+
for (const token of pre.children) {
|
|
392
|
+
if (!(token instanceof HTMLElement) || token.style.position === "absolute") continue;
|
|
393
|
+
if (token.tagName === "BR") {
|
|
394
|
+
line++;
|
|
395
|
+
continue;
|
|
396
|
+
}
|
|
397
|
+
token.dataset.line = String(line);
|
|
398
|
+
if (range === void 0) delete token.dataset.lineState;
|
|
399
|
+
else token.dataset.lineState = range === "all" || Array.isArray(range) && range.includes(line) ? "active" : "dim";
|
|
400
|
+
}
|
|
401
|
+
};
|
|
402
|
+
mark();
|
|
403
|
+
const observer = new MutationObserver(mark);
|
|
404
|
+
observer.observe(pre, { childList: true });
|
|
405
|
+
return () => observer.disconnect();
|
|
406
|
+
}, [range]);
|
|
407
|
+
return /* @__PURE__ */ jsxs("figure", {
|
|
408
|
+
className: "rd-code rd-magic-move",
|
|
409
|
+
ref: container,
|
|
410
|
+
children: [props.title !== void 0 && /* @__PURE__ */ jsx("figcaption", { children: props.title }), /* @__PURE__ */ jsx(ShikiMagicMovePrecompiled, {
|
|
411
|
+
steps: rendererSteps,
|
|
412
|
+
step: rendered.index,
|
|
413
|
+
animate: rendered.animate,
|
|
414
|
+
options,
|
|
415
|
+
onEnd: () => setRendered((current) => current.next === void 0 ? current : {
|
|
416
|
+
index: current.next,
|
|
417
|
+
animate: true
|
|
418
|
+
})
|
|
419
|
+
})]
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
// ../motion/src/mark.tsx
|
|
423
|
+
const kinds = /* @__PURE__ */ new Set([
|
|
424
|
+
"underline",
|
|
425
|
+
"circle",
|
|
426
|
+
"box",
|
|
427
|
+
"strike",
|
|
428
|
+
"cross",
|
|
429
|
+
"bracket"
|
|
430
|
+
]);
|
|
431
|
+
/** A hand-drawn mark around its children, drawn on a click (architecture section 5.3). */
|
|
432
|
+
function Mark({ kind = "underline", at, until, color = "currentColor", children }) {
|
|
433
|
+
const state = useStepState(at, until);
|
|
434
|
+
const ref = useRef(null);
|
|
435
|
+
const [{ width, height }, setSize] = useState({
|
|
436
|
+
width: 0,
|
|
437
|
+
height: 0
|
|
438
|
+
});
|
|
439
|
+
useLayoutEffect(() => {
|
|
440
|
+
const root = ref.current;
|
|
441
|
+
if (!root) return;
|
|
442
|
+
const measure = () => {
|
|
443
|
+
const width = root.offsetWidth;
|
|
444
|
+
const height = root.offsetHeight;
|
|
445
|
+
setSize((previous) => previous.width === width && previous.height === height ? previous : {
|
|
446
|
+
width,
|
|
447
|
+
height
|
|
448
|
+
});
|
|
449
|
+
};
|
|
450
|
+
measure();
|
|
451
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
452
|
+
const observer = new ResizeObserver(measure);
|
|
453
|
+
observer.observe(root);
|
|
454
|
+
return () => observer.disconnect();
|
|
455
|
+
}, []);
|
|
456
|
+
const outset = kind === "circle" || kind === "box" || kind === "bracket" ? height * .1 : 0;
|
|
457
|
+
const paths = useMemo(() => {
|
|
458
|
+
if (!kinds.has(kind)) throw new Error(`Unknown Mark kind "${kind}"`);
|
|
459
|
+
if (!width || !height) return [];
|
|
460
|
+
const generator = rough.generator({ options: {
|
|
461
|
+
seed: 53,
|
|
462
|
+
roughness: .7,
|
|
463
|
+
bowing: 1
|
|
464
|
+
} });
|
|
465
|
+
let shapes;
|
|
466
|
+
switch (kind) {
|
|
467
|
+
case "underline":
|
|
468
|
+
shapes = { stroke: generator.line(0, height * .95, width, height * .95) };
|
|
469
|
+
break;
|
|
470
|
+
case "circle":
|
|
471
|
+
shapes = { stroke: generator.ellipse(width / 2, height / 2, width + outset * 2, height + outset * 2) };
|
|
472
|
+
break;
|
|
473
|
+
case "box":
|
|
474
|
+
shapes = { stroke: generator.rectangle(-outset, -outset, width + outset * 2, height + outset * 2) };
|
|
475
|
+
break;
|
|
476
|
+
case "strike":
|
|
477
|
+
shapes = { stroke: generator.line(0, height / 2, width, height / 2) };
|
|
478
|
+
break;
|
|
479
|
+
case "cross":
|
|
480
|
+
shapes = {
|
|
481
|
+
descending: generator.line(0, 0, width, height),
|
|
482
|
+
ascending: generator.line(0, height, width, 0)
|
|
483
|
+
};
|
|
484
|
+
break;
|
|
485
|
+
case "bracket": shapes = {
|
|
486
|
+
left: generator.linearPath([
|
|
487
|
+
[0, -outset],
|
|
488
|
+
[-outset, -outset],
|
|
489
|
+
[-outset, height + outset],
|
|
490
|
+
[0, height + outset]
|
|
491
|
+
]),
|
|
492
|
+
right: generator.linearPath([
|
|
493
|
+
[width, -outset],
|
|
494
|
+
[width + outset, -outset],
|
|
495
|
+
[width + outset, height + outset],
|
|
496
|
+
[width, height + outset]
|
|
497
|
+
])
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
return Object.entries(shapes).map(([id, shape]) => ({
|
|
501
|
+
id,
|
|
502
|
+
d: generator.toPaths(shape).map(({ d }) => d).join(" ")
|
|
503
|
+
}));
|
|
504
|
+
}, [
|
|
505
|
+
kind,
|
|
506
|
+
width,
|
|
507
|
+
height,
|
|
508
|
+
outset
|
|
509
|
+
]);
|
|
510
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
511
|
+
ref,
|
|
512
|
+
className: "rd-mark",
|
|
513
|
+
"data-step-state": state,
|
|
514
|
+
"data-step-enter": "fade",
|
|
515
|
+
"data-step-exit": "fade",
|
|
516
|
+
children: [children, width > 0 && height > 0 && /* @__PURE__ */ jsx("svg", {
|
|
517
|
+
"aria-hidden": "true",
|
|
518
|
+
viewBox: `${-outset} ${-outset} ${width + outset * 2} ${height + outset * 2}`,
|
|
519
|
+
style: {
|
|
520
|
+
left: -outset,
|
|
521
|
+
top: -outset,
|
|
522
|
+
width: width + outset * 2,
|
|
523
|
+
height: height + outset * 2
|
|
524
|
+
},
|
|
525
|
+
children: paths.map(({ id, d }) => /* @__PURE__ */ jsx("path", {
|
|
526
|
+
d,
|
|
527
|
+
pathLength: "1",
|
|
528
|
+
fill: "none",
|
|
529
|
+
stroke: color
|
|
530
|
+
}, `${kind}:${id}`))
|
|
531
|
+
})]
|
|
532
|
+
});
|
|
533
|
+
}
|
|
325
534
|
// ../motion/src/morph.tsx
|
|
326
535
|
function Morph({ name, as: Element = "div", className, children }) {
|
|
327
536
|
const { isActive, renderContext } = useSlide();
|
|
@@ -393,4 +602,4 @@ function useTimeline(build, deps = []) {
|
|
|
393
602
|
...deps
|
|
394
603
|
]);
|
|
395
604
|
}
|
|
396
|
-
export {
|
|
605
|
+
export { TextReveal as _, CountUp as a, ease as c, stagger as d, Draw as f, Steps as g, Step as h, MagicMove as i, gsap as l, Stagger as m, Morph as n, useTween as o, Highlight as p, Mark as r, duration as s, useTimeline as t, motionMode as u, useStepState as v, CodeBlock as y };
|