Minor Changes
-
#22
8b5833fThanks @RostiMelk! - Add@sanity-labs/slides/mediasub-path with a friendly<Image>wrapper. Takes a stringsrc(no more manualArtifactRefconstruction), requiresaltat the type level, and exposeswidth/height(intrinsic pixel dims used by the PPTX runtime for aspect-correct sizing),fit('contain' | 'cover' | 'fill'),opacity, androtate.import { Image } from '@sanity-labs/slides/media'; <Image src="/images/hero.jpg" alt="Team photo at the offsite" width={1920} height={1080} fit="contain" className="w-full aspect-video" />;
Wrapper is a plain React component that renders the primitive
<Image>underneath, so it composes with the same className / Yoga / typography-role pipeline as every other primitive.Runtime behavior:
fit: 'contain'+width/height: PPTX runtime computes an aspect-correct inscribed rect inside the laid-out box (no use of pptxgenjs's buggysizingAPI). Dev viewer uses CSSobject-fit: contain.fit: 'fill'(default): stretches to fit on both runtimes.fit: 'cover': works in the dev viewer (CSSobject-fit: cover); degrades to'fill'on PPTX export with a console warning until raw OOXMLsrcRectemission is added. Verified by opening exported decks in Keynote: pptxgenjs'ssizing.type='cover'produces images that overflow their cells in PowerPoint and Keynote alike.opacity: PPTXtransparency(inverted) + CSSopacity.rotate: PPTXrotate+ CSStransform: rotate(...). Verified end-to-end in Keynote.
The primitive at the root export gains the same
fit/intrinsicWidth/intrinsicHeight/opacity/rotateprops for low-level use, plumbed through the reconciler, the op-translator, the PPTX runtime, and the fake-runtime / dev viewer.@sanity-labs/slides/mediais on the agent's base import allowlist (code-gen/imports-allowlist.ts) so Tier-2 custom components can reach for it without per-template opt-in.