@lark-apaas/coding-registry-buildless 0.1.7 → 0.1.8-alpha.20260720122519

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.
@@ -63,9 +63,9 @@
63
63
  // ─────────────────────────────────────────────────────────────────────────────
64
64
 
65
65
  const __TWEAKS_STYLE = `
66
- .twk-panel{position:fixed;right:16px;bottom:16px;z-index:2147483646;width:280px;
66
+ .twk-panel{position:fixed;right:16px;top:16px;z-index:2147483646;width:280px;
67
67
  max-height:calc(100vh - 32px);display:flex;flex-direction:column;
68
- transform:scale(var(--dc-inv-zoom,1));transform-origin:bottom right;
68
+ transform:scale(var(--dc-inv-zoom,1));transform-origin:top right;
69
69
  background:rgba(250,249,247,.78);color:#29261b;
70
70
  -webkit-backdrop-filter:blur(24px) saturate(160%);backdrop-filter:blur(24px) saturate(160%);
71
71
  border:.5px solid rgba(255,255,255,.6);border-radius:14px;
@@ -202,6 +202,10 @@ function useTweaks(defaults) {
202
202
  function TweaksPanel({ title = 'Tweaks', children }) {
203
203
  const [open, setOpen] = React.useState(false);
204
204
  const dragRef = React.useRef(null);
205
+ // x = distance from the viewport's right edge, y = distance from its TOP.
206
+ // The panel anchors top-right (right/top in CSS) so it clears the host's
207
+ // bottom toolbar; both axes still grow inward, so clamp/drag math is
208
+ // symmetric with the old bottom-right anchor.
205
209
  const offsetRef = React.useRef({ x: 16, y: 16 });
206
210
  const PAD = 16;
207
211
 
@@ -210,13 +214,13 @@ function TweaksPanel({ title = 'Tweaks', children }) {
210
214
  if (!panel) return;
211
215
  const w = panel.offsetWidth, h = panel.offsetHeight;
212
216
  const maxRight = Math.max(PAD, window.innerWidth - w - PAD);
213
- const maxBottom = Math.max(PAD, window.innerHeight - h - PAD);
217
+ const maxTop = Math.max(PAD, window.innerHeight - h - PAD);
214
218
  offsetRef.current = {
215
219
  x: Math.min(maxRight, Math.max(PAD, offsetRef.current.x)),
216
- y: Math.min(maxBottom, Math.max(PAD, offsetRef.current.y)),
220
+ y: Math.min(maxTop, Math.max(PAD, offsetRef.current.y)),
217
221
  };
218
222
  panel.style.right = offsetRef.current.x + 'px';
219
- panel.style.bottom = offsetRef.current.y + 'px';
223
+ panel.style.top = offsetRef.current.y + 'px';
220
224
  }, []);
221
225
 
222
226
  React.useEffect(() => {
@@ -253,11 +257,11 @@ function TweaksPanel({ title = 'Tweaks', children }) {
253
257
  const r = panel.getBoundingClientRect();
254
258
  const sx = e.clientX, sy = e.clientY;
255
259
  const startRight = window.innerWidth - r.right;
256
- const startBottom = window.innerHeight - r.bottom;
260
+ const startTop = r.top;
257
261
  const move = (ev) => {
258
262
  offsetRef.current = {
259
263
  x: startRight - (ev.clientX - sx),
260
- y: startBottom - (ev.clientY - sy),
264
+ y: startTop + (ev.clientY - sy),
261
265
  };
262
266
  clampToViewport();
263
267
  };
@@ -274,7 +278,7 @@ function TweaksPanel({ title = 'Tweaks', children }) {
274
278
  <>
275
279
  <style>{__TWEAKS_STYLE}</style>
276
280
  <div ref={dragRef} className="twk-panel" data-miaoda-chrome=""
277
- style={{ right: offsetRef.current.x, bottom: offsetRef.current.y }}>
281
+ style={{ right: offsetRef.current.x, top: offsetRef.current.y }}>
278
282
  <div className="twk-hd" onMouseDown={onDragStart}>
279
283
  <b>{title}</b>
280
284
  <button className="twk-x" aria-label="Close tweaks"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/coding-registry-buildless",
3
- "version": "0.1.7",
3
+ "version": "0.1.8-alpha.20260720122519",
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": [
@@ -38,10 +38,11 @@
38
38
  * a scrollable vertical card list (browse) and a rotated fullscreen
39
39
  * presenting mode. This needs NO authoring changes: never hand-roll
40
40
  * mobile/responsive slide layouts. Desktop behaviour is unchanged.
41
- * Browse mode renders authored CSS animations/transitions at their
42
- * end state (presenting keeps them) — design animations so the end
43
- * state is the complete slide; never gate content visibility on an
44
- * animation having played.
41
+ * Browse mode renders each slide's static base state and never fires
42
+ * entrance animations — exactly like the thumbnail rail and print
43
+ * (presenting keeps animations). One more surface that requires the
44
+ * visible end-state to be the base style (see Entrance animations
45
+ * below).
45
46
  *
46
47
  * Slides are HIDDEN, not unmounted. Non-active slides stay in the DOM with
47
48
  * `visibility: hidden` + `opacity: 0`, so their state (videos, iframes,
@@ -1364,26 +1365,38 @@
1364
1365
  'animation-play-state: running !important; transition-duration: 0s !important; } }';
1365
1366
  }
1366
1367
 
1367
- /** Mobile browse (data-mobile-list) force-shows every card at once, so
1368
- * authored CSS animations all fire together on load — and the ones gated
1369
- * on [data-deck-active] re-fire as scrolling moves that flag between
1370
- * cards. Freeze them at their end state while browsing. Same jump-to-end
1371
- * recipe as the print rule above (NOT animation:none, so a deck that
1372
- * keeps a hidden base state still renders its content), keyed on the
1373
- * host attribute so presenting/desktop keep their animations and no JS
1374
- * toggling is needed. Document-level like the print rule: author
1375
- * animations style light-DOM slide content that shadow CSS can't reach,
1376
- * and <deck-stage> itself is a light-DOM element document CSS can key on. */
1368
+ /** Mobile browse (data-mobile-list) renders each card's static BASE
1369
+ * state — the same semantic as the thumbnail rail, print and
1370
+ * reduced-motion. The USAGE authoring contract makes the base style the
1371
+ * visible end-state (hidden lives only inside keyframes' `from`, gated
1372
+ * on [data-deck-active]), so animation-name:none shows exactly the
1373
+ * intended slide. Freezing at the END state instead would key visible
1374
+ * styling to a flag that MOVES during scroll: keyframe properties
1375
+ * (transform especially — it replaces the base value outright) snap on
1376
+ * and off as [data-deck-active] arrives at and leaves each card,
1377
+ * jolting layout. The timing longhands stay as a backstop: an authored
1378
+ * `animation … !important` that out-cascades our name:none still
1379
+ * collapses to an instant run. The attribute selector is repeated to
1380
+ * out-rank authored !important rules — important-vs-important resolves
1381
+ * by specificity, and the common `[data-deck-active] .x` gate is only
1382
+ * (0,2,0). Document-level like the print rule: author animations style
1383
+ * light-DOM slide content that shadow CSS can't reach, and <deck-stage>
1384
+ * is a light-DOM element document CSS can key on. Presenting/desktop
1385
+ * keep their animations — the rule is keyed on the host attribute, no
1386
+ * JS toggling needed. */
1377
1387
  _syncMobFreezeRule() {
1378
1388
  const id = 'deck-stage-mob-freeze';
1379
1389
  if (document.getElementById(id)) return;
1390
+ const sel = 'deck-stage[data-mobile-list][data-mobile-list][data-mobile-list]';
1380
1391
  const tag = document.createElement('style');
1381
1392
  tag.id = id;
1382
1393
  tag.textContent =
1383
- 'deck-stage[data-mobile-list] *, deck-stage[data-mobile-list] *::before, deck-stage[data-mobile-list] *::after {' +
1394
+ sel + ' *, ' + sel + ' *::before, ' + sel + ' *::after {' +
1395
+ ' animation-name: none !important;' +
1384
1396
  ' animation-delay: -99s !important; animation-duration: .001s !important;' +
1385
1397
  ' animation-iteration-count: 1 !important; animation-fill-mode: both !important;' +
1386
- ' animation-play-state: running !important; transition-duration: 0s !important; }';
1398
+ ' animation-play-state: running !important;' +
1399
+ ' transition-duration: 0s !important; transition-delay: 0s !important; }';
1387
1400
  document.head.appendChild(tag);
1388
1401
  }
1389
1402