@blackbelt-technology/pi-dashboard-deck3d 0.9.0 → 0.10.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/.pi/skills/deck3d/SKILL.agent.md +78 -0
- package/.pi/skills/deck3d/SKILL.md +68 -0
- package/.pi/skills/deck3d/reference/effects.md +185 -2
- package/.pi/skills/deck3d/reference/ir-fields.md +26 -3
- package/.pi/skills/deck3d-from-pptx/SKILL.md +134 -0
- package/.pi/skills/deck3d-from-pptx/reference/steps.md +72 -0
- package/README.md +30 -2
- package/assets/preview/stub-chrome.png +0 -0
- package/assets/preview/stub-icon.json +59 -0
- package/assets/preview/stub-layout.json +195 -0
- package/assets/preview/stub-outline.json +48 -0
- package/dist/cli.js +11780 -5934
- package/dist/runtime.js +5916 -4007
- package/fixtures/business-2031/assets/stub-chrome.png +0 -0
- package/fixtures/business-2031/assets/stub-icon.json +59 -0
- package/fixtures/business-2031/assets/stub-layout.json +195 -0
- package/fixtures/business-2031/assets/stub-outline.json +48 -0
- package/fixtures/business-2031/build-overrides.mjs +58 -13
- package/fixtures/business-2031/deck.agent.md +60 -0
- package/fixtures/business-2031/deck.json +133 -8
- package/fixtures/business-2031/overrides.json +133 -8
- package/package.json +8 -4
- package/scripts/gen-stub-assets.ts +31 -0
- package/src/art/cutout.ts +97 -0
- package/src/art/decode.ts +169 -0
- package/src/art/icon.ts +380 -0
- package/src/art/png.ts +232 -0
- package/src/art/trace.ts +288 -0
- package/src/check/rules.ts +13 -8
- package/src/cli.ts +313 -51
- package/src/compare/index.ts +131 -0
- package/src/compare/ssim.ts +91 -0
- package/src/fx/art-geometry.ts +137 -0
- package/src/fx/art3d.meta.json +30 -0
- package/src/fx/art3d.ts +131 -0
- package/src/fx/bank.meta.json +26 -0
- package/src/fx/bank.ts +8 -0
- package/src/fx/compose.ts +5 -4
- package/src/fx/crane.meta.json +26 -0
- package/src/fx/crane.ts +8 -0
- package/src/fx/dolly.ts +5 -1
- package/src/fx/fade.ts +5 -1
- package/src/fx/flythrough.ts +5 -1
- package/src/fx/frame-chrome.meta.json +17 -0
- package/src/fx/frame-chrome.ts +134 -0
- package/src/fx/haze.meta.json +19 -0
- package/src/fx/haze.ts +91 -0
- package/src/fx/icon3d.meta.json +21 -0
- package/src/fx/icon3d.ts +167 -0
- package/src/fx/index.ts +96 -66
- package/src/fx/iris.ts +5 -1
- package/src/fx/meta.schema.json +10 -2
- package/src/fx/path.meta.json +25 -0
- package/src/fx/path.ts +8 -0
- package/src/fx/persistent.ts +11 -0
- package/src/fx/revolve.meta.json +26 -0
- package/src/fx/revolve.ts +8 -0
- package/src/fx/slide-layer.meta.json +26 -0
- package/src/fx/slide-layer.ts +557 -0
- package/src/fx/slide-space.ts +142 -0
- package/src/fx/stub-assets.ts +117 -0
- package/src/fx/swing.meta.json +26 -0
- package/src/fx/swing.ts +8 -0
- package/src/fx/types.ts +63 -2
- package/src/ir/merge.ts +5 -2
- package/src/ir/schema.json +140 -3
- package/src/ir/types.ts +54 -0
- package/src/ir/validate.ts +91 -3
- package/src/parse/harvest/index.ts +4 -1
- package/src/parse/markdown.ts +38 -7
- package/src/pptx/baseline.ts +183 -0
- package/src/pptx/extract.ts +161 -0
- package/src/pptx/fallback.ts +70 -0
- package/src/pptx/import.ts +256 -0
- package/src/pptx/master.ts +135 -0
- package/src/pptx/media.ts +81 -0
- package/src/pptx/package.ts +109 -0
- package/src/pptx/ref.ts +100 -0
- package/src/pptx/shapes.ts +276 -0
- package/src/pptx/stage.ts +82 -0
- package/src/pptx/text.ts +202 -0
- package/src/pptx/theme.ts +194 -0
- package/src/pptx/types.ts +159 -0
- package/src/pptx/xfrm.ts +93 -0
- package/src/pptx/xml.ts +106 -0
- package/src/pptx/zip.ts +239 -0
- package/src/render/assets.ts +57 -0
- package/src/render/build.ts +75 -0
- package/src/render/index.ts +7 -2
- package/src/render/template.html +1 -1
- package/src/runtime/assets.ts +75 -0
- package/src/runtime/fade.ts +110 -0
- package/src/runtime/hud.ts +37 -9
- package/src/runtime/index.ts +431 -67
- package/src/runtime/post.ts +11 -5
- package/src/runtime/scene.ts +25 -2
- package/src/runtime/transition.ts +222 -0
- package/src/runtime/types.ts +13 -2
- package/src/serve/index.ts +199 -16
- package/src/util/cleanup.ts +13 -0
- package/src/util/confine.ts +15 -0
- package/src/variants/pick.ts +282 -0
- package/src/variants/render.ts +179 -0
- package/src/variants/schema.json +48 -0
- package/src/variants/style.ts +318 -0
package/src/runtime/hud.ts
CHANGED
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
* embedded IR stays the record of what was rendered, and the panel's state
|
|
7
7
|
* lives in memory plus `localStorage["deck3d:" + derivedHash]`.
|
|
8
8
|
*/
|
|
9
|
+
|
|
9
10
|
import type { BuiltDiagramKind, CardOffset, Defaults, EffectRef, Layout, Material, Mode, Palette, Quality, Rail, TitleEdge } from "../ir/types.js";
|
|
11
|
+
import { TRANSITION_IDS } from "./transition.js";
|
|
10
12
|
|
|
11
13
|
export interface HudSlide {
|
|
12
14
|
id: string;
|
|
@@ -17,9 +19,11 @@ export interface HudSlide {
|
|
|
17
19
|
export interface HudHost {
|
|
18
20
|
slides: HudSlide[];
|
|
19
21
|
/** Every effect the deck can instantiate (corpus + embedded `local:` cards). */
|
|
20
|
-
catalogue: Array<{ id: string; kind: string }>;
|
|
22
|
+
catalogue: Array<{ id: string; kind: string; persistent?: boolean }>;
|
|
21
23
|
/** Deck-level effect ids, PREPENDED to every slide — shown as inherited slots. */
|
|
22
24
|
deckEffects: string[];
|
|
25
|
+
/** Live deck-scope persistent effect ids (deck-wide singletons). */
|
|
26
|
+
persistentEffects?: () => string[];
|
|
23
27
|
/** Deck defaults as embedded (read-only). */
|
|
24
28
|
defaults: Defaults;
|
|
25
29
|
/** Keys already overridden, for the `●` markers. */
|
|
@@ -32,7 +36,8 @@ export interface HudHost {
|
|
|
32
36
|
/** Same, for EVERY slide — a deck-scope value is not a property of one slide. */
|
|
33
37
|
applyDeck: (patchFor: (slideId: string) => SlidePatch) => void;
|
|
34
38
|
/** Recompose the current slide's effects from this list. */
|
|
35
|
-
|
|
39
|
+
/** `scope` decides persistent cards: only a deck-scope list may carry them. */
|
|
40
|
+
applyEffects: (ids: string[], scope: "deck" | "slide") => void;
|
|
36
41
|
/** Declared knobs of the current slide's effects, with values in force. */
|
|
37
42
|
effectParams: () => Array<{ id: string; schema: Record<string, unknown>; values: Record<string, unknown> }>;
|
|
38
43
|
/** Rebuild one effect of the current slide under edited params. */
|
|
@@ -93,7 +98,8 @@ const MATERIALS: Material[] = ["glass", "metal", "matte"];
|
|
|
93
98
|
const LAYOUTS: Layout[] = ["split", "split-reverse"];
|
|
94
99
|
const RAILS: Rail[] = ["line", "orbit", "tunnel", "helix", "grid"];
|
|
95
100
|
const DIAGRAM_KINDS: BuiltDiagramKind[] = ["none", "brain", "loop", "swarm", "bars", "funnel", "timeline-rail", "globe", "orbit-cluster", "stack"];
|
|
96
|
-
|
|
101
|
+
/** Every camera move the runtime plays (corpus `transition` cards + `cut`). */
|
|
102
|
+
const TRANSITIONS: string[] = [...TRANSITION_IDS];
|
|
97
103
|
|
|
98
104
|
/** How one control is rendered. `enum` carries its own option list. */
|
|
99
105
|
type ControlSpec =
|
|
@@ -432,14 +438,19 @@ export function createHud(host: HudHost): Hud {
|
|
|
432
438
|
state.slides[slideId].effects = next;
|
|
433
439
|
}
|
|
434
440
|
persist();
|
|
435
|
-
host.applyEffects(next);
|
|
441
|
+
host.applyEffects(next, scope);
|
|
436
442
|
// The list itself changed shape — rows and the picker's options with it.
|
|
437
443
|
render();
|
|
438
444
|
}
|
|
439
445
|
|
|
440
446
|
/** Effect ids of one kind, sorted — the stepper's ring. */
|
|
447
|
+
/** What the active scope may add: persistent cards are deck-scope only. */
|
|
448
|
+
function offered(): Array<{ id: string; kind: string; persistent?: boolean }> {
|
|
449
|
+
return scope === "slide" ? host.catalogue.filter((c) => !c.persistent) : host.catalogue;
|
|
450
|
+
}
|
|
451
|
+
|
|
441
452
|
function idsOfKind(kind: string): string[] {
|
|
442
|
-
return
|
|
453
|
+
return offered()
|
|
443
454
|
.filter((c) => c.kind === kind)
|
|
444
455
|
.map((c) => c.id)
|
|
445
456
|
.sort();
|
|
@@ -447,7 +458,7 @@ export function createHud(host: HudHost): Hud {
|
|
|
447
458
|
|
|
448
459
|
/** Kinds the catalogue actually carries (background, post, light, …). */
|
|
449
460
|
function kinds(): string[] {
|
|
450
|
-
return [...new Set(
|
|
461
|
+
return [...new Set(offered().map((c) => c.kind))].sort();
|
|
451
462
|
}
|
|
452
463
|
|
|
453
464
|
function kindOf(id: string): string {
|
|
@@ -522,7 +533,10 @@ export function createHud(host: HudHost): Hud {
|
|
|
522
533
|
const list = el("div", { class: "deck3d-hud-effects" });
|
|
523
534
|
const composed = host.slides[host.current() - 1]?.effects ?? [];
|
|
524
535
|
const staged = (scope === "deck" ? state.deck.effects : state.slides[slideId]?.effects) as string[] | undefined;
|
|
525
|
-
const
|
|
536
|
+
const composedIds = composed.map((e) => e.id);
|
|
537
|
+
// Persistent cards never sit in a slide's list; deck scope shows them.
|
|
538
|
+
const persistentIds = scope === "deck" ? (host.persistentEffects?.() ?? []).filter((id) => !composedIds.includes(id)) : [];
|
|
539
|
+
const active = staged ?? [...composedIds, ...persistentIds];
|
|
526
540
|
const fromDeck = new Set(host.deckEffects);
|
|
527
541
|
for (let i = 0; i < active.length; i++) {
|
|
528
542
|
list.appendChild(slotRow(slideId, active, i, scope === "slide" && fromDeck.has(active[i])));
|
|
@@ -537,7 +551,7 @@ export function createHud(host: HudHost): Hud {
|
|
|
537
551
|
button.textContent = "+ add slot";
|
|
538
552
|
button.addEventListener("click", () => {
|
|
539
553
|
const taken = new Set(active);
|
|
540
|
-
const seed = idsOfKind("background").find((id) => !taken.has(id)) ??
|
|
554
|
+
const seed = idsOfKind("background").find((id) => !taken.has(id)) ?? offered().map((c) => c.id).find((id) => !taken.has(id));
|
|
541
555
|
if (seed) commitEffects(slideId, [...active, seed]);
|
|
542
556
|
});
|
|
543
557
|
return button;
|
|
@@ -554,6 +568,9 @@ export function createHud(host: HudHost): Hud {
|
|
|
554
568
|
const box = el("div", { class: "deck3d-hud-fxparams" });
|
|
555
569
|
for (const [key, rawSpec] of Object.entries(decl.schema)) {
|
|
556
570
|
const spec = rawSpec as { type?: string; minimum?: number; maximum?: number; default?: unknown; enum?: string[] };
|
|
571
|
+
// Structured params (layer lists, id maps) have no scalar control; they
|
|
572
|
+
// are edited in deck.json or picked as a variant.
|
|
573
|
+
if (spec.type === "array" || spec.type === "object" || (spec.type === "string" && !spec.enum)) continue;
|
|
557
574
|
const current = decl.values[key] ?? spec.default;
|
|
558
575
|
const line = el("label", { class: "deck3d-hud-fxparam" });
|
|
559
576
|
const tag = el("span");
|
|
@@ -800,8 +817,15 @@ export function createHud(host: HudHost): Hud {
|
|
|
800
817
|
body.appendChild(box);
|
|
801
818
|
}
|
|
802
819
|
|
|
820
|
+
// `serve ?variant=` renders a candidate in memory: it must never reach disk
|
|
821
|
+
// through this panel, so Save/Apply are disabled and the notice says how
|
|
822
|
+
// to choose it properly.
|
|
823
|
+
const variantPreview = (window as { __DECK3D_VARIANT?: { step: string; name: string } }).__DECK3D_VARIANT;
|
|
824
|
+
|
|
803
825
|
const notice = el("div", { class: "deck3d-hud-note" });
|
|
804
|
-
notice.textContent =
|
|
826
|
+
notice.textContent = variantPreview
|
|
827
|
+
? `Previewing variant ${variantPreview.step}:${variantPreview.name}. Save and Apply are disabled; choose a variant with \`deck3d variants pick ${variantPreview.step} ${variantPreview.name}\`.`
|
|
828
|
+
: served
|
|
805
829
|
? "Save writes overrides.json beside the deck. Apply merges into deck.json and rebuilds. Markdown inline overrides win over the file, and a saved effects list pins that scope's effects."
|
|
806
830
|
: "Tuning here is remembered in this browser only. Export writes overrides.json; make it permanent with `deck3d overrides apply deck.json overrides.json`, then rebuild. Markdown inline overrides win over this file, and an exported effects list pins that scope's effects.";
|
|
807
831
|
body.appendChild(notice);
|
|
@@ -816,6 +840,10 @@ export function createHud(host: HudHost): Hud {
|
|
|
816
840
|
apply.textContent = "Apply to deck.json";
|
|
817
841
|
apply.addEventListener("click", () => void postPayload("/__apply", apply));
|
|
818
842
|
body.appendChild(apply);
|
|
843
|
+
if (variantPreview) {
|
|
844
|
+
save.disabled = true;
|
|
845
|
+
apply.disabled = true;
|
|
846
|
+
}
|
|
819
847
|
}
|
|
820
848
|
|
|
821
849
|
const exportButton = el("button", { type: "button", id: "deck3d-hud-export" });
|