@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.
- package/components/tweaks-panel.jsx +12 -8
- package/package.json +1 -1
- package/scripts/deck-stage.js +29 -16
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
64
64
|
|
|
65
65
|
const __TWEAKS_STYLE = `
|
|
66
|
-
.twk-panel{position:fixed;right:16px;
|
|
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:
|
|
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
|
|
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(
|
|
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.
|
|
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
|
|
260
|
+
const startTop = r.top;
|
|
257
261
|
const move = (ev) => {
|
|
258
262
|
offsetRef.current = {
|
|
259
263
|
x: startRight - (ev.clientX - sx),
|
|
260
|
-
y:
|
|
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,
|
|
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.
|
|
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": [
|
package/scripts/deck-stage.js
CHANGED
|
@@ -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
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
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)
|
|
1368
|
-
*
|
|
1369
|
-
*
|
|
1370
|
-
*
|
|
1371
|
-
*
|
|
1372
|
-
*
|
|
1373
|
-
*
|
|
1374
|
-
*
|
|
1375
|
-
*
|
|
1376
|
-
*
|
|
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
|
-
'
|
|
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;
|
|
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
|
|