@cjlapao/ui-kit 0.2.35 → 0.2.37
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/dist/{CodeBlock-QDW3hqU0.d.cts → CodeBlock-Sj3AzAca.d.cts} +27 -1
- package/dist/{CodeBlock-QDW3hqU0.d.ts → CodeBlock-Sj3AzAca.d.ts} +27 -1
- package/dist/index.cjs +856 -504
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +24 -0
- package/dist/index.d.cts +173 -9
- package/dist/index.d.ts +173 -9
- package/dist/index.js +1236 -881
- package/dist/index.js.map +1 -1
- package/dist/markdown.cjs +43 -18
- package/dist/markdown.cjs.map +1 -1
- package/dist/markdown.d.cts +2 -2
- package/dist/markdown.d.ts +2 -2
- package/dist/markdown.js +43 -18
- package/dist/markdown.js.map +1 -1
- package/package.json +1 -1
package/dist/markdown.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
2
|
+
import { x as CapsuleBlueprintParameter, a1 as CodeBlockProps } from './CodeBlock-Sj3AzAca.cjs';
|
|
3
|
+
export { a0 as CodeBlock, ao as HelpButton } from './CodeBlock-Sj3AzAca.cjs';
|
|
4
4
|
import { Components } from 'react-markdown';
|
|
5
5
|
|
|
6
6
|
interface MarkdownEditorProps {
|
package/dist/markdown.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
2
|
+
import { x as CapsuleBlueprintParameter, a1 as CodeBlockProps } from './CodeBlock-Sj3AzAca.js';
|
|
3
|
+
export { a0 as CodeBlock, ao as HelpButton } from './CodeBlock-Sj3AzAca.js';
|
|
4
4
|
import { Components } from 'react-markdown';
|
|
5
5
|
|
|
6
6
|
interface MarkdownEditorProps {
|
package/dist/markdown.js
CHANGED
|
@@ -11281,53 +11281,72 @@ var ScrollArea = ({
|
|
|
11281
11281
|
const [hovered, setHovered] = useState3(false);
|
|
11282
11282
|
const [scrolling, setScrolling] = useState3(false);
|
|
11283
11283
|
const dragging = useRef3(null);
|
|
11284
|
+
const virtual = virtualScroll != null;
|
|
11285
|
+
const virtualViewport = virtualScroll?.viewportSize ?? 0;
|
|
11286
|
+
const virtualContent = virtualScroll?.contentSize ?? 0;
|
|
11287
|
+
const virtualOffset = virtualScroll?.offset ?? 0;
|
|
11284
11288
|
const thumb = useCallback3(
|
|
11285
11289
|
(viewport, track, axis) => {
|
|
11286
|
-
const viewportSize = axis === "y" &&
|
|
11287
|
-
const contentSize = axis === "y" &&
|
|
11290
|
+
const viewportSize = axis === "y" && virtual ? virtualViewport : axis === "y" ? viewport.clientHeight : viewport.clientWidth;
|
|
11291
|
+
const contentSize = axis === "y" && virtual ? virtualContent : axis === "y" ? viewport.scrollHeight : viewport.scrollWidth;
|
|
11288
11292
|
const trackSize = (track ? axis === "y" ? track.clientHeight : track.clientWidth : viewportSize) || 1;
|
|
11289
11293
|
const scrollable = contentSize - viewportSize;
|
|
11290
|
-
if (scrollable <= (
|
|
11294
|
+
if (scrollable <= (virtual ? 0 : 1)) return FITTING_THUMB;
|
|
11291
11295
|
const size = Math.max(
|
|
11292
11296
|
MIN_THUMB,
|
|
11293
11297
|
viewportSize / contentSize * trackSize
|
|
11294
11298
|
);
|
|
11295
|
-
const position = axis === "y" &&
|
|
11299
|
+
const position = axis === "y" && virtual ? virtualOffset : axis === "y" ? viewport.scrollTop : viewport.scrollLeft;
|
|
11296
11300
|
return {
|
|
11297
11301
|
size,
|
|
11298
11302
|
offset: position / scrollable * (trackSize - size),
|
|
11299
11303
|
ratio: position / scrollable
|
|
11300
11304
|
};
|
|
11301
11305
|
},
|
|
11302
|
-
[
|
|
11306
|
+
[virtual, virtualViewport, virtualContent, virtualOffset]
|
|
11303
11307
|
);
|
|
11308
|
+
const sameMetrics = (a, b) => a.size === b.size && a.offset === b.offset && a.ratio === b.ratio;
|
|
11304
11309
|
const update = useCallback3(() => {
|
|
11305
11310
|
const viewport = viewportRef.current;
|
|
11306
11311
|
if (!viewport) return;
|
|
11307
|
-
|
|
11308
|
-
|
|
11309
|
-
|
|
11310
|
-
|
|
11311
|
-
setThumbY(thumb(viewport, yTrackRef.current, "y"));
|
|
11312
|
-
setThumbX(
|
|
11313
|
-
horizontal ? thumb(viewport, xTrackRef.current, "x") : FITTING_THUMB
|
|
11312
|
+
const nextX = horizontal && viewport.scrollWidth - viewport.clientWidth > 1;
|
|
11313
|
+
const nextY = virtual ? virtualContent > virtualViewport : viewport.scrollHeight - viewport.clientHeight > 1;
|
|
11314
|
+
setOverflow(
|
|
11315
|
+
(prev) => prev.x === nextX && prev.y === nextY ? prev : { x: nextX, y: nextY }
|
|
11314
11316
|
);
|
|
11315
|
-
|
|
11317
|
+
const nextYThumb = thumb(viewport, yTrackRef.current, "y");
|
|
11318
|
+
setThumbY((prev) => sameMetrics(prev, nextYThumb) ? prev : nextYThumb);
|
|
11319
|
+
const nextXThumb = horizontal ? thumb(viewport, xTrackRef.current, "x") : FITTING_THUMB;
|
|
11320
|
+
setThumbX((prev) => sameMetrics(prev, nextXThumb) ? prev : nextXThumb);
|
|
11321
|
+
}, [thumb, horizontal, virtual, virtualContent, virtualViewport]);
|
|
11322
|
+
const updateRef = useRef3(update);
|
|
11316
11323
|
useEffect3(() => {
|
|
11317
|
-
update
|
|
11324
|
+
updateRef.current = update;
|
|
11325
|
+
});
|
|
11326
|
+
useEffect3(() => {
|
|
11327
|
+
updateRef.current();
|
|
11318
11328
|
let observer;
|
|
11329
|
+
let frame = 0;
|
|
11330
|
+
const schedule = () => {
|
|
11331
|
+
if (frame) return;
|
|
11332
|
+
frame = requestAnimationFrame(() => {
|
|
11333
|
+
frame = 0;
|
|
11334
|
+
updateRef.current();
|
|
11335
|
+
});
|
|
11336
|
+
};
|
|
11319
11337
|
if (typeof ResizeObserver !== "undefined") {
|
|
11320
|
-
observer = new ResizeObserver(
|
|
11338
|
+
observer = new ResizeObserver(schedule);
|
|
11321
11339
|
if (viewportRef.current) observer.observe(viewportRef.current);
|
|
11322
11340
|
if (contentRef.current) observer.observe(contentRef.current);
|
|
11323
11341
|
} else {
|
|
11324
|
-
window.addEventListener("resize",
|
|
11342
|
+
window.addEventListener("resize", schedule);
|
|
11325
11343
|
}
|
|
11326
11344
|
return () => {
|
|
11345
|
+
if (frame) cancelAnimationFrame(frame);
|
|
11327
11346
|
observer?.disconnect();
|
|
11328
|
-
window.removeEventListener("resize",
|
|
11347
|
+
window.removeEventListener("resize", schedule);
|
|
11329
11348
|
};
|
|
11330
|
-
}, [
|
|
11349
|
+
}, []);
|
|
11331
11350
|
useEffect3(() => () => window.clearTimeout(lingerTimer.current), []);
|
|
11332
11351
|
const handleScroll = () => {
|
|
11333
11352
|
update();
|
|
@@ -11465,6 +11484,12 @@ var ScrollArea = ({
|
|
|
11465
11484
|
"data-slot": "scrollarea-content",
|
|
11466
11485
|
className: classNames9(
|
|
11467
11486
|
virtualScroll ? "h-full min-w-full" : "table min-w-full",
|
|
11487
|
+
// The overlay bar's lane is reserved in the content *always*:
|
|
11488
|
+
// the auto/hover bar appears on gesture, and a gutter tied to
|
|
11489
|
+
// its visibility would jog the text sideways on every scroll.
|
|
11490
|
+
// A constant 10px inset is the calmer contract — the thumb then
|
|
11491
|
+
// never sits on the caller's content, or its hover state.
|
|
11492
|
+
"pr-2.5",
|
|
11468
11493
|
contentClassName
|
|
11469
11494
|
),
|
|
11470
11495
|
children
|