@kud/ink-ui 0.5.0 → 0.6.0
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/index.d.ts +2 -1
- package/dist/index.js +4 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -119,8 +119,9 @@ type StyledLine = {
|
|
|
119
119
|
type ScrollViewProps = {
|
|
120
120
|
lines: StyledLine[];
|
|
121
121
|
showIndicator?: boolean;
|
|
122
|
+
initialStart?: number;
|
|
122
123
|
};
|
|
123
|
-
declare const ScrollView: ({ lines, showIndicator, }: ScrollViewProps) => React.JSX.Element;
|
|
124
|
+
declare const ScrollView: ({ lines, showIndicator, initialStart, }: ScrollViewProps) => React.JSX.Element;
|
|
124
125
|
|
|
125
126
|
type TabItem<T extends string = string> = {
|
|
126
127
|
value: T;
|
package/dist/index.js
CHANGED
|
@@ -251,11 +251,13 @@ var ConfirmInput = ({
|
|
|
251
251
|
};
|
|
252
252
|
var ScrollView = ({
|
|
253
253
|
lines,
|
|
254
|
-
showIndicator = true
|
|
254
|
+
showIndicator = true,
|
|
255
|
+
initialStart = 0
|
|
255
256
|
}) => {
|
|
256
257
|
const ref = useRef(null);
|
|
257
258
|
const [height, setHeight] = useState(1);
|
|
258
|
-
const [start, setStart] = useState(
|
|
259
|
+
const [start, setStart] = useState(initialStart);
|
|
260
|
+
useEffect(() => setStart(initialStart), [initialStart]);
|
|
259
261
|
useLayoutEffect(() => {
|
|
260
262
|
if (!ref.current) return;
|
|
261
263
|
const { height: h } = measureElement(ref.current);
|