@lark-apaas/coding-registry-buildless 0.1.10 → 0.1.11-alpha.20260729142428

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.
@@ -14,9 +14,6 @@
14
14
  // ←/→ seek, space, and 0-to-reset controls, and persists the playhead.
15
15
  // Set the optional `poster` prop (seconds) to the moment your opening scene is
16
16
  // fully composed — the product thumbnail freezes on that frame (default ~1s).
17
- // Stage also exposes window.__stage — seek(t) / pause() / play() / time() /
18
- // playing() / duration — the deterministic way to drive the playhead from
19
- // outside (tooling, self-checks); never synthesize key/scrubber events for that.
20
17
  // Inside <Stage>, any child can call useTime() to read the current
21
18
  // playhead (seconds). Or wrap content in <Sprite start={1} end={4}>...</Sprite>
22
19
  // to only render during that window (outside it, children are unmounted from
@@ -439,24 +436,6 @@ function Stage({
439
436
  return () => window.removeEventListener('keydown', onKey);
440
437
  }, [duration]);
441
438
 
442
- // Programmatic driver for tooling (preflight / screenshot-at-t): freezes the
443
- // playhead on an exact frame, unlike synthesized key/scrubber events.
444
- const timeRef = React.useRef(time);
445
- timeRef.current = time;
446
- const playingRef = React.useRef(playing);
447
- playingRef.current = playing;
448
- React.useEffect(() => {
449
- window.__stage = {
450
- duration,
451
- seek: (t) => { setPlaying(false); setTime(clamp(t, 0, duration)); },
452
- pause: () => setPlaying(false),
453
- play: () => setPlaying(true),
454
- time: () => timeRef.current,
455
- playing: () => playingRef.current,
456
- };
457
- return () => { delete window.__stage; };
458
- }, [duration]);
459
-
460
439
  const ctxValue = React.useMemo(
461
440
  () => ({ time, duration, playing, setTime, setPlaying }),
462
441
  [time, duration, playing]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/coding-registry-buildless",
3
- "version": "0.1.10",
3
+ "version": "0.1.11-alpha.20260729142428",
4
4
  "description": "Miaoda registry (buildless runtime) — shadcn-style copy-in SDKs (globals + CDN-pinned, browser Babel) for buildless static HTML stacks",
5
5
  "type": "module",
6
6
  "files": [
@@ -43,6 +43,11 @@
43
43
  * (presenting keeps animations). One more surface that requires the
44
44
  * visible end-state to be the base style (see Entrance animations
45
45
  * below).
46
+ * (h) preflight mode — add `?preflight=1` to the URL to enter
47
+ * mobile-list layout on any device (including desktop). Identical to
48
+ * mobile browse except the outer frame background is transparent,
49
+ * preventing the model from confusing the frame background with slide
50
+ * content during automated visual inspection.
46
51
  *
47
52
  * Slides are HIDDEN, not unmounted. Non-active slides stay in the DOM with
48
53
  * `visibility: hidden` + `opacity: 0`, so their state (videos, iframes,
@@ -433,6 +438,12 @@
433
438
  (The equivalent rule further down lives inside @media print only.) */
434
439
  :host([data-mobile-list]) ::slotted([data-deck-skip]) { display: none !important; }
435
440
 
441
+ /* ── Preflight (质检) mode: mobile-list layout with transparent outer
442
+ background so the model doesn't confuse the frame with slide content.
443
+ Activated by ?preflight=1 in the URL. ── */
444
+ :host([data-preflight]) { background: transparent; position: static; overflow: visible; }
445
+ :host([data-preflight]) .stage { background: transparent; position: static; overflow: visible; }
446
+
436
447
  /* ── Mobile presenting: CSS pseudo-landscape (no orientation.lock) ──
437
448
  Rotate only while the device is physically portrait. Once the user
438
449
  turns the phone (system auto-rotate) the viewport itself is landscape,
@@ -703,6 +714,7 @@
703
714
  // windowed margin/shadow, see _fit. A bare load with no #N hash starts at
704
715
  // slide 1, so ?thumbnail=1 alone yields a clean first-slide frame.
705
716
  this._snthumb = /[?&](_snthumb|thumbnail)=/.test(location.search);
717
+ this._preflight = /[?&]preflight=/.test(location.search);
706
718
  this._mobile = isMobileUA();
707
719
  // Layout-driven size signal. window.resize is unreliable inside
708
720
  // prerendered/reframed iOS WebViews and host-managed iframes — the
@@ -715,7 +727,14 @@
715
727
  this._mobSizeRo.observe(document.documentElement);
716
728
  }
717
729
  this._syncMobileMode();
718
- if (this._mobile) this._syncMobFreezeRule();
730
+ if (this._mobile || this._preflight) this._syncMobFreezeRule();
731
+ if (this._preflight) {
732
+ this.setAttribute('data-preflight', '');
733
+ // Override page-level background set by LLM-authored CSS so the
734
+ // preflight screenshot doesn't pick up the theme's body color.
735
+ document.documentElement.style.background = '#fff';
736
+ document.body.style.background = '#fff';
737
+ }
719
738
  if (this._snthumb) this.setAttribute('no-rail', '');
720
739
  this._render();
721
740
  this._loadNotes();
@@ -1546,11 +1565,11 @@
1546
1565
 
1547
1566
  // The two mobile presentations are mutually exclusive. noscale and
1548
1567
  // _snthumb are capture modes whose output must keep desktop geometry,
1549
- // so they opt out of both.
1568
+ // so they opt out of both. ?preflight=1 forces mobile-list on desktop.
1550
1569
  _syncMobileMode() {
1551
- const eligible = this._mobile && !this.hasAttribute('noscale') && !this._snthumb;
1570
+ const eligible = (this._mobile || this._preflight) && !this.hasAttribute('noscale') && !this._snthumb;
1552
1571
  this.toggleAttribute('data-mobile-list', eligible && !this._presenting);
1553
- this.toggleAttribute('data-mobile-present', eligible && !!this._presenting);
1572
+ this.toggleAttribute('data-mobile-present', eligible && !!this._presenting && !this._preflight);
1554
1573
  }
1555
1574
 
1556
1575
  _fitMobileList() {