@nuvin/ink 7.5.0-alpha → 7.7.0-alpha
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/build/allocated-seek.d.ts +21 -0
- package/build/allocated-seek.js +273 -0
- package/build/allocated-seek.js.map +1 -0
- package/build/ansi-tokenizer.js.map +1 -1
- package/build/components/App.d.ts +5 -1
- package/build/components/App.js +48 -10
- package/build/components/App.js.map +1 -1
- package/build/components/Box.d.ts +95 -0
- package/build/components/Box.js +176 -140
- package/build/components/Box.js.map +1 -1
- package/build/components/Transform.js +1 -1
- package/build/components/Transform.js.map +1 -1
- package/build/components/VLBox.d.ts +87 -0
- package/build/components/VLBox.js +5 -0
- package/build/components/VLBox.js.map +1 -0
- package/build/dom.d.ts +45 -1
- package/build/dom.js +5 -0
- package/build/dom.js.map +1 -1
- package/build/explicit-width-detection.d.ts +45 -0
- package/build/explicit-width-detection.js +172 -0
- package/build/explicit-width-detection.js.map +1 -0
- package/build/explicit-width.d.ts +1 -0
- package/build/explicit-width.js +114 -0
- package/build/explicit-width.js.map +1 -0
- package/build/hooks/use-input.js +3 -3
- package/build/hooks/use-input.js.map +1 -1
- package/build/index.d.ts +2 -0
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/ink.d.ts +45 -2
- package/build/ink.js +691 -164
- package/build/ink.js.map +1 -1
- package/build/input-parser.d.ts +14 -1
- package/build/input-parser.js +74 -4
- package/build/input-parser.js.map +1 -1
- package/build/layout-metadata.d.ts +28 -0
- package/build/layout-metadata.js +302 -0
- package/build/layout-metadata.js.map +1 -0
- package/build/log-update.d.ts +16 -8
- package/build/log-update.js +439 -37
- package/build/log-update.js.map +1 -1
- package/build/measure-text.d.ts +1 -1
- package/build/measure-text.js +2 -2
- package/build/measure-text.js.map +1 -1
- package/build/output.d.ts +1 -0
- package/build/output.js +69 -28
- package/build/output.js.map +1 -1
- package/build/reconciler.js +84 -10
- package/build/reconciler.js.map +1 -1
- package/build/render-background.d.ts +2 -2
- package/build/render-background.js +33 -5
- package/build/render-background.js.map +1 -1
- package/build/render-border.d.ts +2 -2
- package/build/render-border.js +78 -34
- package/build/render-border.js.map +1 -1
- package/build/render-node-to-output.d.ts +7 -1
- package/build/render-node-to-output.js +118 -27
- package/build/render-node-to-output.js.map +1 -1
- package/build/render-to-string.js +2 -1
- package/build/render-to-string.js.map +1 -1
- package/build/render.d.ts +11 -0
- package/build/render.js.map +1 -1
- package/build/renderer.d.ts +1 -0
- package/build/renderer.js +10 -2
- package/build/renderer.js.map +1 -1
- package/build/styles.js.map +1 -1
- package/build/terminal-control.d.ts +6 -0
- package/build/terminal-control.js +124 -0
- package/build/terminal-control.js.map +1 -0
- package/build/terminal-paint.d.ts +38 -0
- package/build/terminal-paint.js +47 -0
- package/build/terminal-paint.js.map +1 -0
- package/build/wrap-text.d.ts +1 -1
- package/build/wrap-text.js +2 -2
- package/build/wrap-text.js.map +1 -1
- package/package.json +3 -1
- package/readme.md +98 -0
- package/build/reflow.d.ts +0 -12
- package/build/reflow.js +0 -47
- package/build/reflow.js.map +0 -1
|
@@ -56,6 +56,101 @@ export type Props = Except<Styles, 'textWrap'> & {
|
|
|
56
56
|
/**
|
|
57
57
|
`<Box>` is an essential Ink component to build your layout. It's like `<div style="display: flex">` in the browser.
|
|
58
58
|
*/
|
|
59
|
+
export declare const createBoxComponent: (displayName: string, viewportCulling: boolean) => React.ForwardRefExoticComponent<{
|
|
60
|
+
readonly position?: "absolute" | "relative" | "static" | "sticky" | undefined;
|
|
61
|
+
readonly top?: number | string | undefined;
|
|
62
|
+
readonly right?: number | string | undefined;
|
|
63
|
+
readonly bottom?: number | string | undefined;
|
|
64
|
+
readonly left?: number | string | undefined;
|
|
65
|
+
readonly columnGap?: number | undefined;
|
|
66
|
+
readonly rowGap?: number | undefined;
|
|
67
|
+
readonly gap?: number | undefined;
|
|
68
|
+
readonly margin?: number | undefined;
|
|
69
|
+
readonly marginX?: number | undefined;
|
|
70
|
+
readonly marginY?: number | undefined;
|
|
71
|
+
readonly marginTop?: number | undefined;
|
|
72
|
+
readonly marginBottom?: number | undefined;
|
|
73
|
+
readonly marginLeft?: number | undefined;
|
|
74
|
+
readonly marginRight?: number | undefined;
|
|
75
|
+
readonly padding?: number | undefined;
|
|
76
|
+
readonly paddingX?: number | undefined;
|
|
77
|
+
readonly paddingY?: number | undefined;
|
|
78
|
+
readonly paddingTop?: number | undefined;
|
|
79
|
+
readonly paddingBottom?: number | undefined;
|
|
80
|
+
readonly paddingLeft?: number | undefined;
|
|
81
|
+
readonly paddingRight?: number | undefined;
|
|
82
|
+
readonly flexGrow?: number | undefined;
|
|
83
|
+
readonly flexShrink?: number | undefined;
|
|
84
|
+
readonly flexDirection?: "row" | "column" | "row-reverse" | "column-reverse" | undefined;
|
|
85
|
+
readonly flexBasis?: number | string | undefined;
|
|
86
|
+
readonly flexWrap?: "nowrap" | "wrap" | "wrap-reverse" | undefined;
|
|
87
|
+
readonly alignItems?: "flex-start" | "center" | "flex-end" | "stretch" | "baseline" | undefined;
|
|
88
|
+
readonly alignSelf?: "flex-start" | "center" | "flex-end" | "auto" | "stretch" | "baseline" | undefined;
|
|
89
|
+
readonly alignContent?: "flex-start" | "flex-end" | "center" | "stretch" | "space-between" | "space-around" | "space-evenly" | undefined;
|
|
90
|
+
readonly justifyContent?: "flex-start" | "flex-end" | "space-between" | "space-around" | "space-evenly" | "center" | undefined;
|
|
91
|
+
readonly width?: number | string | undefined;
|
|
92
|
+
readonly height?: number | string | undefined;
|
|
93
|
+
readonly minWidth?: number | string | undefined;
|
|
94
|
+
readonly minHeight?: number | string | undefined;
|
|
95
|
+
readonly maxWidth?: number | string | undefined;
|
|
96
|
+
readonly maxHeight?: number | string | undefined;
|
|
97
|
+
readonly aspectRatio?: number | undefined;
|
|
98
|
+
readonly display?: "flex" | "none" | undefined;
|
|
99
|
+
readonly borderStyle?: (keyof import("cli-boxes").Boxes | import("cli-boxes").BoxStyle) | undefined;
|
|
100
|
+
readonly borderTop?: boolean | undefined;
|
|
101
|
+
readonly borderBottom?: boolean | undefined;
|
|
102
|
+
readonly borderLeft?: boolean | undefined;
|
|
103
|
+
readonly borderRight?: boolean | undefined;
|
|
104
|
+
readonly borderColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
105
|
+
readonly borderTopColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
106
|
+
readonly borderBottomColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
107
|
+
readonly borderLeftColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
108
|
+
readonly borderRightColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
109
|
+
readonly borderDimColor?: boolean | undefined;
|
|
110
|
+
readonly borderTopDimColor?: boolean | undefined;
|
|
111
|
+
readonly borderBottomDimColor?: boolean | undefined;
|
|
112
|
+
readonly borderLeftDimColor?: boolean | undefined;
|
|
113
|
+
readonly borderRightDimColor?: boolean | undefined;
|
|
114
|
+
readonly borderBackgroundColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
115
|
+
readonly borderTopBackgroundColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
116
|
+
readonly borderBottomBackgroundColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
117
|
+
readonly borderLeftBackgroundColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
118
|
+
readonly borderRightBackgroundColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
119
|
+
readonly overflow?: "visible" | "hidden" | "scroll" | undefined;
|
|
120
|
+
readonly overflowX?: "visible" | "hidden" | "scroll" | undefined;
|
|
121
|
+
readonly overflowY?: "visible" | "hidden" | "scroll" | undefined;
|
|
122
|
+
readonly backgroundColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
123
|
+
readonly zIndex?: number | undefined;
|
|
124
|
+
} & {
|
|
125
|
+
/**
|
|
126
|
+
A label for the element for screen readers.
|
|
127
|
+
*/
|
|
128
|
+
readonly 'aria-label'?: string;
|
|
129
|
+
/**
|
|
130
|
+
Hide the element from screen readers.
|
|
131
|
+
*/
|
|
132
|
+
readonly 'aria-hidden'?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
The role of the element.
|
|
135
|
+
*/
|
|
136
|
+
readonly 'aria-role'?: "button" | "checkbox" | "combobox" | "list" | "listbox" | "listitem" | "menu" | "menuitem" | "option" | "progressbar" | "radio" | "radiogroup" | "tab" | "tablist" | "table" | "textbox" | "timer" | "toolbar";
|
|
137
|
+
/**
|
|
138
|
+
The state of the element.
|
|
139
|
+
*/
|
|
140
|
+
readonly 'aria-state'?: {
|
|
141
|
+
readonly busy?: boolean;
|
|
142
|
+
readonly checked?: boolean;
|
|
143
|
+
readonly disabled?: boolean;
|
|
144
|
+
readonly expanded?: boolean;
|
|
145
|
+
readonly multiline?: boolean;
|
|
146
|
+
readonly multiselectable?: boolean;
|
|
147
|
+
readonly readonly?: boolean;
|
|
148
|
+
readonly required?: boolean;
|
|
149
|
+
readonly selected?: boolean;
|
|
150
|
+
};
|
|
151
|
+
} & {
|
|
152
|
+
children?: React.ReactNode | undefined;
|
|
153
|
+
} & React.RefAttributes<BoxRef>>;
|
|
59
154
|
declare const Box: React.ForwardRefExoticComponent<{
|
|
60
155
|
readonly position?: "absolute" | "relative" | "static" | "sticky" | undefined;
|
|
61
156
|
readonly top?: number | string | undefined;
|
package/build/components/Box.js
CHANGED
|
@@ -1,161 +1,197 @@
|
|
|
1
1
|
import React, { forwardRef, useContext, useImperativeHandle, useLayoutEffect, useRef, useState, } from 'react';
|
|
2
2
|
import Yoga from 'yoga-layout';
|
|
3
|
+
import { clampViewportScroll, getScrollViewportMetadata, requestRootPaint, sameOffset, } from '../layout-metadata.js';
|
|
3
4
|
import { accessibilityContext } from './AccessibilityContext.js';
|
|
4
5
|
import { backgroundContext } from './BackgroundContext.js';
|
|
5
6
|
/**
|
|
6
7
|
`<Box>` is an essential Ink component to build your layout. It's like `<div style="display: flex">` in the browser.
|
|
7
8
|
*/
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const getContentDimensions = () => {
|
|
18
|
-
const { yogaNode } = element;
|
|
19
|
-
if (!yogaNode) {
|
|
20
|
-
return { width: 0, height: 0 };
|
|
9
|
+
export const createBoxComponent = (displayName, viewportCulling) => {
|
|
10
|
+
const Component = forwardRef(({ children, backgroundColor, 'aria-label': ariaLabel, 'aria-hidden': ariaHidden, 'aria-role': role, 'aria-state': ariaState, ...style }, ref) => {
|
|
11
|
+
const internalRef = useRef(null);
|
|
12
|
+
const scrollStateRef = useRef({ x: 0, y: 0 });
|
|
13
|
+
const [scrollVersion, setScrollVersion] = useState(0);
|
|
14
|
+
useImperativeHandle(ref, () => {
|
|
15
|
+
const element = internalRef.current;
|
|
16
|
+
if (!element) {
|
|
17
|
+
return null;
|
|
21
18
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if ('yogaNode' in child && child.yogaNode) {
|
|
27
|
-
const childYoga = child.yogaNode;
|
|
28
|
-
const childX = offsetX + childYoga.getComputedLeft();
|
|
29
|
-
const childY = offsetY + childYoga.getComputedTop();
|
|
30
|
-
const right = childX + childYoga.getComputedWidth();
|
|
31
|
-
const bottom = childY + childYoga.getComputedHeight();
|
|
32
|
-
maxWidth = Math.max(maxWidth, right);
|
|
33
|
-
maxHeight = Math.max(maxHeight, bottom);
|
|
34
|
-
measureNode(child, childX, childY);
|
|
35
|
-
}
|
|
19
|
+
const getContentDimensions = () => {
|
|
20
|
+
const { yogaNode } = element;
|
|
21
|
+
if (!yogaNode) {
|
|
22
|
+
return { width: 0, height: 0 };
|
|
36
23
|
}
|
|
24
|
+
let maxWidth = 0;
|
|
25
|
+
let maxHeight = 0;
|
|
26
|
+
const measureNode = (node, offsetX, offsetY) => {
|
|
27
|
+
for (const child of node.childNodes) {
|
|
28
|
+
if ('yogaNode' in child && child.yogaNode) {
|
|
29
|
+
const childYoga = child.yogaNode;
|
|
30
|
+
const childX = offsetX + childYoga.getComputedLeft();
|
|
31
|
+
const childY = offsetY + childYoga.getComputedTop();
|
|
32
|
+
const right = childX + childYoga.getComputedWidth();
|
|
33
|
+
const bottom = childY + childYoga.getComputedHeight();
|
|
34
|
+
maxWidth = Math.max(maxWidth, right);
|
|
35
|
+
maxHeight = Math.max(maxHeight, bottom);
|
|
36
|
+
measureNode(child, childX, childY);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
measureNode(element, 0, 0);
|
|
41
|
+
return { width: maxWidth, height: maxHeight };
|
|
37
42
|
};
|
|
38
|
-
|
|
39
|
-
return { width: maxWidth, height: maxHeight };
|
|
40
|
-
};
|
|
41
|
-
const getMaxScroll = () => {
|
|
42
|
-
const { yogaNode } = element;
|
|
43
|
-
if (!yogaNode) {
|
|
44
|
-
return { x: 0, y: 0 };
|
|
45
|
-
}
|
|
46
|
-
const containerWidth = yogaNode.getComputedWidth() -
|
|
47
|
-
yogaNode.getComputedBorder(Yoga.EDGE_LEFT) -
|
|
48
|
-
yogaNode.getComputedBorder(Yoga.EDGE_RIGHT);
|
|
49
|
-
const containerHeight = yogaNode.getComputedHeight() -
|
|
50
|
-
yogaNode.getComputedBorder(Yoga.EDGE_TOP) -
|
|
51
|
-
yogaNode.getComputedBorder(Yoga.EDGE_BOTTOM);
|
|
52
|
-
const content = getContentDimensions();
|
|
53
|
-
return {
|
|
54
|
-
x: Math.max(0, content.width - containerWidth),
|
|
55
|
-
y: Math.max(0, content.height - containerHeight),
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
return Object.assign(element, {
|
|
59
|
-
scrollTo({ x, y }) {
|
|
60
|
-
const maxScroll = getMaxScroll();
|
|
61
|
-
if (x !== undefined) {
|
|
62
|
-
scrollStateRef.current.x = Math.max(0, Math.min(x, maxScroll.x));
|
|
63
|
-
}
|
|
64
|
-
if (y !== undefined) {
|
|
65
|
-
scrollStateRef.current.y = Math.max(0, Math.min(y, maxScroll.y));
|
|
66
|
-
}
|
|
67
|
-
element.internal_scrollOffset = { ...scrollStateRef.current };
|
|
68
|
-
setScrollVersion(version => version + 1);
|
|
69
|
-
},
|
|
70
|
-
getScrollPosition() {
|
|
71
|
-
return { ...scrollStateRef.current };
|
|
72
|
-
},
|
|
73
|
-
scrollToTop() {
|
|
74
|
-
scrollStateRef.current.y = 0;
|
|
75
|
-
element.internal_scrollOffset = { ...scrollStateRef.current };
|
|
76
|
-
setScrollVersion(version => version + 1);
|
|
77
|
-
},
|
|
78
|
-
scrollToBottom() {
|
|
79
|
-
const maxScroll = getMaxScroll();
|
|
80
|
-
scrollStateRef.current.y = maxScroll.y;
|
|
81
|
-
element.internal_scrollOffset = { ...scrollStateRef.current };
|
|
82
|
-
setScrollVersion(version => version + 1);
|
|
83
|
-
},
|
|
84
|
-
getBounds() {
|
|
43
|
+
const getMaxScroll = () => {
|
|
85
44
|
const { yogaNode } = element;
|
|
86
45
|
if (!yogaNode) {
|
|
87
|
-
return { x: 0, y: 0
|
|
46
|
+
return { x: 0, y: 0 };
|
|
88
47
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
48
|
+
const containerWidth = yogaNode.getComputedWidth() -
|
|
49
|
+
yogaNode.getComputedBorder(Yoga.EDGE_LEFT) -
|
|
50
|
+
yogaNode.getComputedBorder(Yoga.EDGE_RIGHT);
|
|
51
|
+
const containerHeight = yogaNode.getComputedHeight() -
|
|
52
|
+
yogaNode.getComputedBorder(Yoga.EDGE_TOP) -
|
|
53
|
+
yogaNode.getComputedBorder(Yoga.EDGE_BOTTOM);
|
|
54
|
+
const metadata = getScrollViewportMetadata(element);
|
|
55
|
+
const content = viewportCulling && metadata
|
|
56
|
+
? metadata.contentExtent
|
|
57
|
+
: getContentDimensions();
|
|
58
|
+
return {
|
|
59
|
+
x: Math.max(0, content.width - containerWidth),
|
|
60
|
+
y: Math.max(0, content.height - containerHeight),
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
const applyViewportScroll = (requested) => {
|
|
64
|
+
if (viewportCulling) {
|
|
65
|
+
const current = element.internal_scrollOffset ?? scrollStateRef.current;
|
|
66
|
+
const next = clampViewportScroll(element, requested);
|
|
67
|
+
// Keep the hook ref synchronized before the caller's React controller
|
|
68
|
+
// commit can run this component's layout effect.
|
|
69
|
+
scrollStateRef.current = { ...next };
|
|
70
|
+
if (sameOffset(current, next))
|
|
71
|
+
return;
|
|
72
|
+
element.internal_scrollOffset = { ...next };
|
|
73
|
+
requestRootPaint(element);
|
|
74
|
+
return;
|
|
107
75
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
let root = element;
|
|
112
|
-
while (root.parentNode) {
|
|
113
|
-
root = root.parentNode;
|
|
76
|
+
const maxScroll = getMaxScroll();
|
|
77
|
+
if (requested.x !== undefined) {
|
|
78
|
+
scrollStateRef.current.x = Math.max(0, Math.min(requested.x, maxScroll.x));
|
|
114
79
|
}
|
|
115
|
-
if (
|
|
116
|
-
|
|
117
|
-
element.internal_paintEpoch !== root.internal_paintEpoch) {
|
|
118
|
-
return undefined;
|
|
80
|
+
if (requested.y !== undefined) {
|
|
81
|
+
scrollStateRef.current.y = Math.max(0, Math.min(requested.y, maxScroll.y));
|
|
119
82
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
83
|
+
element.internal_scrollOffset = { ...scrollStateRef.current };
|
|
84
|
+
setScrollVersion(version => version + 1);
|
|
85
|
+
};
|
|
86
|
+
return Object.assign(element, {
|
|
87
|
+
scrollTo(requested) {
|
|
88
|
+
applyViewportScroll(requested);
|
|
89
|
+
},
|
|
90
|
+
getScrollPosition() {
|
|
91
|
+
if (viewportCulling) {
|
|
92
|
+
return { ...(element.internal_scrollOffset ?? { x: 0, y: 0 }) };
|
|
93
|
+
}
|
|
94
|
+
return { ...scrollStateRef.current };
|
|
95
|
+
},
|
|
96
|
+
scrollToTop() {
|
|
97
|
+
applyViewportScroll({ y: 0 });
|
|
98
|
+
},
|
|
99
|
+
scrollToBottom() {
|
|
100
|
+
applyViewportScroll({ y: Number.MAX_SAFE_INTEGER });
|
|
101
|
+
},
|
|
102
|
+
getBounds() {
|
|
103
|
+
const { yogaNode } = element;
|
|
104
|
+
if (!yogaNode) {
|
|
105
|
+
return { x: 0, y: 0, width: 0, height: 0 };
|
|
106
|
+
}
|
|
107
|
+
let x = yogaNode.getComputedLeft();
|
|
108
|
+
let y = yogaNode.getComputedTop();
|
|
109
|
+
const width = yogaNode.getComputedWidth();
|
|
110
|
+
const height = yogaNode.getComputedHeight();
|
|
111
|
+
// A pinned sticky is drawn away from its Yoga-derived position.
|
|
112
|
+
// Prefer its recorded rect only while its paint epoch is current;
|
|
113
|
+
// rejected subtrees can intentionally retain older sticky rects.
|
|
114
|
+
const stickyRect = element.internal_stickyRect;
|
|
115
|
+
if (element.style.position === 'sticky' &&
|
|
116
|
+
stickyRect &&
|
|
117
|
+
element.internal_paintEpoch !== undefined) {
|
|
118
|
+
let root = element;
|
|
119
|
+
while (root.parentNode) {
|
|
120
|
+
root = root.parentNode;
|
|
121
|
+
}
|
|
122
|
+
if (root.nodeName === 'ink-root' &&
|
|
123
|
+
root.internal_paintEpoch !== undefined &&
|
|
124
|
+
element.internal_paintEpoch === root.internal_paintEpoch) {
|
|
125
|
+
return { x: stickyRect.x, y: stickyRect.y, width, height };
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
let parent = element.parentNode;
|
|
129
|
+
while (parent && 'yogaNode' in parent && parent.yogaNode) {
|
|
130
|
+
x += parent.yogaNode.getComputedLeft();
|
|
131
|
+
y += parent.yogaNode.getComputedTop();
|
|
132
|
+
parent = parent.parentNode;
|
|
133
|
+
}
|
|
134
|
+
return { x, y, width, height };
|
|
135
|
+
},
|
|
136
|
+
getPaintOrder() {
|
|
137
|
+
let root = element;
|
|
138
|
+
while (root.parentNode) {
|
|
139
|
+
root = root.parentNode;
|
|
140
|
+
}
|
|
141
|
+
if (element.internal_paintEpoch === undefined ||
|
|
142
|
+
element.internal_paintIndex === undefined ||
|
|
143
|
+
element.internal_paintEpoch !== root.internal_paintEpoch) {
|
|
144
|
+
return undefined;
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
epoch: element.internal_paintEpoch,
|
|
148
|
+
index: element.internal_paintIndex,
|
|
149
|
+
};
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
}, []);
|
|
153
|
+
const isScrollContainer = style.overflow === 'scroll' ||
|
|
154
|
+
style.overflowX === 'scroll' ||
|
|
155
|
+
style.overflowY === 'scroll';
|
|
156
|
+
useLayoutEffect(() => {
|
|
157
|
+
const element = internalRef.current;
|
|
158
|
+
if (!element || !isScrollContainer)
|
|
159
|
+
return;
|
|
160
|
+
if (viewportCulling) {
|
|
161
|
+
const retained = element.internal_scrollOffset ?? scrollStateRef.current;
|
|
162
|
+
scrollStateRef.current = { ...retained };
|
|
163
|
+
element.internal_scrollOffset = { ...retained };
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
element.internal_scrollOffset = scrollStateRef.current;
|
|
125
167
|
});
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
168
|
+
const { isScreenReaderEnabled } = useContext(accessibilityContext);
|
|
169
|
+
const label = ariaLabel ? React.createElement("ink-text", null, ariaLabel) : undefined;
|
|
170
|
+
if (isScreenReaderEnabled && ariaHidden) {
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
const boxElement = (React.createElement("ink-box", { ref: internalRef, internal_viewportCulling: viewportCulling || undefined, style: {
|
|
174
|
+
flexWrap: 'nowrap',
|
|
175
|
+
flexDirection: 'row',
|
|
176
|
+
flexGrow: 0,
|
|
177
|
+
flexShrink: 1,
|
|
178
|
+
...style,
|
|
179
|
+
backgroundColor,
|
|
180
|
+
overflowX: style.overflowX ?? style.overflow ?? 'visible',
|
|
181
|
+
overflowY: style.overflowY ?? style.overflow ?? 'visible',
|
|
182
|
+
}, internal_accessibility: {
|
|
183
|
+
role,
|
|
184
|
+
state: ariaState,
|
|
185
|
+
}, internal_scrollVersion: isScrollContainer ? scrollVersion : undefined }, isScreenReaderEnabled && label ? label : children));
|
|
186
|
+
// If this Box has a background color, provide it to children via context
|
|
187
|
+
if (backgroundColor) {
|
|
188
|
+
return (React.createElement(backgroundContext.Provider, { value: backgroundColor }, boxElement));
|
|
133
189
|
}
|
|
190
|
+
return boxElement;
|
|
134
191
|
});
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
const boxElement = (React.createElement("ink-box", { ref: internalRef, style: {
|
|
141
|
-
flexWrap: 'nowrap',
|
|
142
|
-
flexDirection: 'row',
|
|
143
|
-
flexGrow: 0,
|
|
144
|
-
flexShrink: 1,
|
|
145
|
-
...style,
|
|
146
|
-
backgroundColor,
|
|
147
|
-
overflowX: style.overflowX ?? style.overflow ?? 'visible',
|
|
148
|
-
overflowY: style.overflowY ?? style.overflow ?? 'visible',
|
|
149
|
-
}, internal_accessibility: {
|
|
150
|
-
role,
|
|
151
|
-
state: ariaState,
|
|
152
|
-
}, internal_scrollVersion: isScrollContainer ? scrollVersion : undefined }, isScreenReaderEnabled && label ? label : children));
|
|
153
|
-
// If this Box has a background color, provide it to children via context
|
|
154
|
-
if (backgroundColor) {
|
|
155
|
-
return (React.createElement(backgroundContext.Provider, { value: backgroundColor }, boxElement));
|
|
156
|
-
}
|
|
157
|
-
return boxElement;
|
|
158
|
-
});
|
|
159
|
-
Box.displayName = 'Box';
|
|
192
|
+
Component.displayName = displayName;
|
|
193
|
+
return Component;
|
|
194
|
+
};
|
|
195
|
+
const Box = createBoxComponent('Box', false);
|
|
160
196
|
export default Box;
|
|
161
197
|
//# sourceMappingURL=Box.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Box.js","sourceRoot":"","sources":["../../src/components/Box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACb,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,eAAe,EACf,MAAM,EACN,QAAQ,GAER,MAAM,OAAO,CAAC;AACf,OAAO,IAAI,MAAM,aAAa,CAAC;AAI/B,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AAkEzD;;EAEE;AACF,MAAM,GAAG,GAAG,UAAU,
|
|
1
|
+
{"version":3,"file":"Box.js","sourceRoot":"","sources":["../../src/components/Box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACb,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,eAAe,EACf,MAAM,EACN,QAAQ,GAER,MAAM,OAAO,CAAC;AACf,OAAO,IAAI,MAAM,aAAa,CAAC;AAI/B,OAAO,EACN,mBAAmB,EACnB,yBAAyB,EACzB,gBAAgB,EAChB,UAAU,GACV,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AAkEzD;;EAEE;AACF,MAA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
|
if (children === undefined || children === null) {
|
|
9
9
|
return null;
|
|
10
10
|
}
|
|
11
|
-
return (React.createElement("ink-text", { style: { flexGrow: 0, flexShrink: 1, flexDirection: 'row' }, internal_transform: transform }, isScreenReaderEnabled && accessibilityLabel
|
|
11
|
+
return (React.createElement("ink-text", { internal_transformAffectsGeometry: true, style: { flexGrow: 0, flexShrink: 1, flexDirection: 'row' }, internal_transform: transform }, isScreenReaderEnabled && accessibilityLabel
|
|
12
12
|
? accessibilityLabel
|
|
13
13
|
: children));
|
|
14
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transform.js","sourceRoot":"","sources":["../../src/components/Transform.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAC,UAAU,EAAiB,MAAM,OAAO,CAAC;AACxD,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAgB/D;;EAEE;AACF,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EACjC,QAAQ,EACR,SAAS,EACT,kBAAkB,GACX;IACP,MAAM,EAAC,qBAAqB,EAAC,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;IAEjE,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACjD,OAAO,IAAI,CAAC;IACb,CAAC;IAED,OAAO,CACN,kCACC,KAAK,EAAE,EAAC,QAAQ,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,aAAa,EAAE,KAAK,EAAC,EACzD,kBAAkB,EAAE,SAAS,IAE5B,qBAAqB,IAAI,kBAAkB;QAC3C,CAAC,CAAC,kBAAkB;QACpB,CAAC,CAAC,QAAQ,CACD,CACX,CAAC;AACH,CAAC"}
|
|
1
|
+
{"version":3,"file":"Transform.js","sourceRoot":"","sources":["../../src/components/Transform.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAC,UAAU,EAAiB,MAAM,OAAO,CAAC;AACxD,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAgB/D;;EAEE;AACF,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EACjC,QAAQ,EACR,SAAS,EACT,kBAAkB,GACX;IACP,MAAM,EAAC,qBAAqB,EAAC,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;IAEjE,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACjD,OAAO,IAAI,CAAC;IACb,CAAC;IAED,OAAO,CACN,kCACC,iCAAiC,QACjC,KAAK,EAAE,EAAC,QAAQ,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,aAAa,EAAE,KAAK,EAAC,EACzD,kBAAkB,EAAE,SAAS,IAE5B,qBAAqB,IAAI,kBAAkB;QAC3C,CAAC,CAAC,kBAAkB;QACpB,CAAC,CAAC,QAAQ,CACD,CACX,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { type BoxRef, type Props } from './Box.js';
|
|
2
|
+
export type VLBoxProps = Props;
|
|
3
|
+
export type VLBoxRef = BoxRef;
|
|
4
|
+
declare const VLBox: import("react").ForwardRefExoticComponent<{
|
|
5
|
+
readonly position?: "absolute" | "relative" | "static" | "sticky" | undefined;
|
|
6
|
+
readonly top?: number | string | undefined;
|
|
7
|
+
readonly right?: number | string | undefined;
|
|
8
|
+
readonly bottom?: number | string | undefined;
|
|
9
|
+
readonly left?: number | string | undefined;
|
|
10
|
+
readonly columnGap?: number | undefined;
|
|
11
|
+
readonly rowGap?: number | undefined;
|
|
12
|
+
readonly gap?: number | undefined;
|
|
13
|
+
readonly margin?: number | undefined;
|
|
14
|
+
readonly marginX?: number | undefined;
|
|
15
|
+
readonly marginY?: number | undefined;
|
|
16
|
+
readonly marginTop?: number | undefined;
|
|
17
|
+
readonly marginBottom?: number | undefined;
|
|
18
|
+
readonly marginLeft?: number | undefined;
|
|
19
|
+
readonly marginRight?: number | undefined;
|
|
20
|
+
readonly padding?: number | undefined;
|
|
21
|
+
readonly paddingX?: number | undefined;
|
|
22
|
+
readonly paddingY?: number | undefined;
|
|
23
|
+
readonly paddingTop?: number | undefined;
|
|
24
|
+
readonly paddingBottom?: number | undefined;
|
|
25
|
+
readonly paddingLeft?: number | undefined;
|
|
26
|
+
readonly paddingRight?: number | undefined;
|
|
27
|
+
readonly flexGrow?: number | undefined;
|
|
28
|
+
readonly flexShrink?: number | undefined;
|
|
29
|
+
readonly flexDirection?: "row" | "column" | "row-reverse" | "column-reverse" | undefined;
|
|
30
|
+
readonly flexBasis?: number | string | undefined;
|
|
31
|
+
readonly flexWrap?: "nowrap" | "wrap" | "wrap-reverse" | undefined;
|
|
32
|
+
readonly alignItems?: "flex-start" | "center" | "flex-end" | "stretch" | "baseline" | undefined;
|
|
33
|
+
readonly alignSelf?: "flex-start" | "center" | "flex-end" | "auto" | "stretch" | "baseline" | undefined;
|
|
34
|
+
readonly alignContent?: "flex-start" | "flex-end" | "center" | "stretch" | "space-between" | "space-around" | "space-evenly" | undefined;
|
|
35
|
+
readonly justifyContent?: "flex-start" | "flex-end" | "space-between" | "space-around" | "space-evenly" | "center" | undefined;
|
|
36
|
+
readonly width?: number | string | undefined;
|
|
37
|
+
readonly height?: number | string | undefined;
|
|
38
|
+
readonly minWidth?: number | string | undefined;
|
|
39
|
+
readonly minHeight?: number | string | undefined;
|
|
40
|
+
readonly maxWidth?: number | string | undefined;
|
|
41
|
+
readonly maxHeight?: number | string | undefined;
|
|
42
|
+
readonly aspectRatio?: number | undefined;
|
|
43
|
+
readonly display?: "flex" | "none" | undefined;
|
|
44
|
+
readonly borderStyle?: (keyof import("cli-boxes").Boxes | import("cli-boxes").BoxStyle) | undefined;
|
|
45
|
+
readonly borderTop?: boolean | undefined;
|
|
46
|
+
readonly borderBottom?: boolean | undefined;
|
|
47
|
+
readonly borderLeft?: boolean | undefined;
|
|
48
|
+
readonly borderRight?: boolean | undefined;
|
|
49
|
+
readonly borderColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
50
|
+
readonly borderTopColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
51
|
+
readonly borderBottomColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
52
|
+
readonly borderLeftColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
53
|
+
readonly borderRightColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
54
|
+
readonly borderDimColor?: boolean | undefined;
|
|
55
|
+
readonly borderTopDimColor?: boolean | undefined;
|
|
56
|
+
readonly borderBottomDimColor?: boolean | undefined;
|
|
57
|
+
readonly borderLeftDimColor?: boolean | undefined;
|
|
58
|
+
readonly borderRightDimColor?: boolean | undefined;
|
|
59
|
+
readonly borderBackgroundColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
60
|
+
readonly borderTopBackgroundColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
61
|
+
readonly borderBottomBackgroundColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
62
|
+
readonly borderLeftBackgroundColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
63
|
+
readonly borderRightBackgroundColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
64
|
+
readonly overflow?: "visible" | "hidden" | "scroll" | undefined;
|
|
65
|
+
readonly overflowX?: "visible" | "hidden" | "scroll" | undefined;
|
|
66
|
+
readonly overflowY?: "visible" | "hidden" | "scroll" | undefined;
|
|
67
|
+
readonly backgroundColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
68
|
+
readonly zIndex?: number | undefined;
|
|
69
|
+
} & {
|
|
70
|
+
readonly 'aria-label'?: string;
|
|
71
|
+
readonly 'aria-hidden'?: boolean;
|
|
72
|
+
readonly 'aria-role'?: "button" | "checkbox" | "combobox" | "list" | "listbox" | "listitem" | "menu" | "menuitem" | "option" | "progressbar" | "radio" | "radiogroup" | "tab" | "tablist" | "table" | "textbox" | "timer" | "toolbar";
|
|
73
|
+
readonly 'aria-state'?: {
|
|
74
|
+
readonly busy?: boolean;
|
|
75
|
+
readonly checked?: boolean;
|
|
76
|
+
readonly disabled?: boolean;
|
|
77
|
+
readonly expanded?: boolean;
|
|
78
|
+
readonly multiline?: boolean;
|
|
79
|
+
readonly multiselectable?: boolean;
|
|
80
|
+
readonly readonly?: boolean;
|
|
81
|
+
readonly required?: boolean;
|
|
82
|
+
readonly selected?: boolean;
|
|
83
|
+
};
|
|
84
|
+
} & {
|
|
85
|
+
children?: import("react").ReactNode | undefined;
|
|
86
|
+
} & import("react").RefAttributes<BoxRef>>;
|
|
87
|
+
export default VLBox;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VLBox.js","sourceRoot":"","sources":["../../src/components/VLBox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAA0B,MAAM,UAAU,CAAC;AAOrE,oFAAoF;AACpF,MAAM,KAAK,GAAG,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAChD,eAAe,KAAK,CAAC"}
|