attio 0.0.1-experimental.20240724.2 → 0.0.1-experimental.20240809
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/lib/api/add-connection-definition.d.ts +21 -0
- package/lib/api/add-connection-definition.d.ts.map +1 -0
- package/lib/api/add-connection-definition.js +24 -0
- package/lib/api/add-connection-definition.js.map +1 -0
- package/lib/api/create-dev-version.d.ts +3 -3
- package/lib/api/create-dev-version.d.ts.map +1 -1
- package/lib/api/create-dev-version.js +2 -2
- package/lib/api/create-dev-version.js.map +1 -1
- package/lib/api/remove-connection-definition.d.ts +16 -0
- package/lib/api/remove-connection-definition.d.ts.map +1 -0
- package/lib/api/remove-connection-definition.js +8 -0
- package/lib/api/remove-connection-definition.js.map +1 -0
- package/lib/attio.d.ts +1 -1
- package/lib/attio.js +1 -1
- package/lib/commands/build.js +5 -5
- package/lib/commands/build.js.map +1 -1
- package/lib/commands/connection/add.d.ts +22 -0
- package/lib/commands/connection/add.d.ts.map +1 -0
- package/lib/commands/connection/add.js +66 -0
- package/lib/commands/connection/add.js.map +1 -0
- package/lib/commands/connection/index.d.ts +2 -0
- package/lib/commands/connection/index.d.ts.map +1 -0
- package/lib/commands/connection/index.js +2 -0
- package/lib/commands/connection/index.js.map +1 -0
- package/lib/commands/connection/remove.d.ts +16 -0
- package/lib/commands/connection/remove.d.ts.map +1 -0
- package/lib/commands/connection/remove.js +42 -0
- package/lib/commands/connection/remove.js.map +1 -0
- package/lib/commands/dev.d.ts.map +1 -1
- package/lib/commands/dev.js +65 -76
- package/lib/commands/dev.js.map +1 -1
- package/lib/components/BuildError.d.ts +1 -9
- package/lib/components/BuildError.d.ts.map +1 -1
- package/lib/components/BuildError.js +35 -50
- package/lib/components/BuildError.js.map +1 -1
- package/lib/components/ScrollBox.d.ts +4 -0
- package/lib/components/ScrollBox.d.ts.map +1 -0
- package/lib/components/ScrollBox.js +88 -0
- package/lib/components/ScrollBox.js.map +1 -0
- package/lib/components/ScrollBox.store.d.ts +15 -0
- package/lib/components/ScrollBox.store.d.ts.map +1 -0
- package/lib/components/ScrollBox.store.js +37 -0
- package/lib/components/ScrollBox.store.js.map +1 -0
- package/lib/components/ScrollBox.util.d.ts +4 -0
- package/lib/components/ScrollBox.util.d.ts.map +1 -0
- package/lib/components/ScrollBox.util.js +28 -0
- package/lib/components/ScrollBox.util.js.map +1 -0
- package/lib/components/TypeScriptErrors.d.ts +1 -8
- package/lib/components/TypeScriptErrors.d.ts.map +1 -1
- package/lib/components/TypeScriptErrors.js +7 -15
- package/lib/components/TypeScriptErrors.js.map +1 -1
- package/lib/hooks/useFullScreen.d.ts.map +1 -1
- package/lib/hooks/useFullScreen.js +13 -7
- package/lib/hooks/useFullScreen.js.map +1 -1
- package/lib/hooks/useTerminalTitle.d.ts +2 -0
- package/lib/hooks/useTerminalTitle.d.ts.map +1 -0
- package/lib/hooks/useTerminalTitle.js +12 -0
- package/lib/hooks/useTerminalTitle.js.map +1 -0
- package/lib/machines/add-connection-machine.d.ts +159 -0
- package/lib/machines/add-connection-machine.d.ts.map +1 -0
- package/lib/machines/add-connection-machine.js +224 -0
- package/lib/machines/add-connection-machine.js.map +1 -0
- package/lib/machines/dev-machine.d.ts.map +1 -1
- package/lib/machines/dev-machine.js +3 -3
- package/lib/machines/dev-machine.js.map +1 -1
- package/lib/machines/remove-connection-machine.d.ts +106 -0
- package/lib/machines/remove-connection-machine.d.ts.map +1 -0
- package/lib/machines/remove-connection-machine.js +161 -0
- package/lib/machines/remove-connection-machine.js.map +1 -0
- package/lib/schema.d.ts +5 -5
- package/lib/schema.d.ts.map +1 -1
- package/lib/schema.js +10 -7
- package/lib/schema.js.map +1 -1
- package/lib/schema.json +32 -31
- package/lib/util/app-config.d.ts +11 -0
- package/lib/util/app-config.d.ts.map +1 -0
- package/lib/util/app-config.js +52 -0
- package/lib/util/app-config.js.map +1 -0
- package/package.json +3 -1
- package/lib/util/load-extension-config.d.ts +0 -3
- package/lib/util/load-extension-config.d.ts.map +0 -1
- package/lib/util/load-extension-config.js +0 -32
- package/lib/util/load-extension-config.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuildError.d.ts","sourceRoot":"","sources":["../../src/components/BuildError.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAC,UAAU,EAAC,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"BuildError.d.ts","sourceRoot":"","sources":["../../src/components/BuildError.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAC,UAAU,EAAC,MAAM,aAAa,CAAA;AAgDtC,wBAAgB,iBAAiB,CAAC,EAAC,MAAM,EAAE,QAAQ,EAAC,EAAE,UAAU,uBAS/D"}
|
|
@@ -1,56 +1,41 @@
|
|
|
1
1
|
import { Box, Text } from "ink";
|
|
2
2
|
import React from "react";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
React.createElement(
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
const Error = React.forwardRef(({ message, level }, ref) => (React.createElement(Box, { flexDirection: "column", ref: ref },
|
|
4
|
+
React.createElement(Box, null,
|
|
5
|
+
React.createElement(Text, { color: level === "error" ? "red" : "yellow" },
|
|
6
|
+
level === "error" ? "❌" : "⚠️",
|
|
7
|
+
" ",
|
|
8
|
+
React.createElement(Text, { backgroundColor: level === "error" ? "red" : "yellow", color: "white" },
|
|
8
9
|
" ",
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
level === "error" ? "ERROR" : "WARNING",
|
|
11
|
+
" ")),
|
|
12
|
+
React.createElement(Text, { bold: true }, message.text)),
|
|
13
|
+
React.createElement(Box, { paddingTop: 1, flexDirection: "column" },
|
|
14
|
+
React.createElement(Box, { marginLeft: 4 },
|
|
15
|
+
React.createElement(Text, null,
|
|
16
|
+
message.location.file,
|
|
17
|
+
":",
|
|
18
|
+
message.location.line,
|
|
19
|
+
":",
|
|
20
|
+
message.location.column)),
|
|
21
|
+
React.createElement(Box, { marginLeft: 4, marginTop: 1 },
|
|
22
|
+
React.createElement(Box, { flexDirection: "column", marginRight: 1 },
|
|
23
|
+
React.createElement(Text, null, message.location.line)),
|
|
24
|
+
React.createElement(Box, { flexDirection: "column" },
|
|
16
25
|
React.createElement(Text, null,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
message.location.column
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
React.createElement(Box, { paddingLeft: message.location.column +
|
|
32
|
-
message.location.lineText.trim().length -
|
|
33
|
-
message.location.lineText.length +
|
|
34
|
-
1 },
|
|
35
|
-
React.createElement(Text, { color: "greenBright" }, "^"))))))));
|
|
36
|
-
}
|
|
37
|
-
export function BuildError({ error: { errors, warnings } }) {
|
|
38
|
-
return (React.createElement(Box, { flexDirection: "column" },
|
|
39
|
-
errors.length > 0 && (React.createElement(Box, { flexDirection: "column" },
|
|
40
|
-
React.createElement(Text, { color: "red" },
|
|
41
|
-
errors.length,
|
|
42
|
-
" ERROR",
|
|
43
|
-
errors.length === 1 ? "" : "S",
|
|
44
|
-
":"),
|
|
45
|
-
errors.map((error, index) => (React.createElement(Box, { key: index, marginY: 1 },
|
|
46
|
-
React.createElement(Error, { message: error, level: "error" })))))),
|
|
47
|
-
warnings.length > 0 && (React.createElement(Box, { flexDirection: "column" },
|
|
48
|
-
React.createElement(Text, { color: "red" },
|
|
49
|
-
warnings.length,
|
|
50
|
-
" WARNING",
|
|
51
|
-
warnings.length === 1 ? "" : "S",
|
|
52
|
-
":"),
|
|
53
|
-
warnings.map((warning, index) => (React.createElement(Box, { key: index, marginY: 1 },
|
|
54
|
-
React.createElement(Error, { message: warning, level: "warning" }))))))));
|
|
26
|
+
"| ",
|
|
27
|
+
message.location.lineText.trim()),
|
|
28
|
+
React.createElement(Box, null,
|
|
29
|
+
React.createElement(Text, null, "|"),
|
|
30
|
+
React.createElement(Box, { paddingLeft: message.location.column +
|
|
31
|
+
message.location.lineText.trim().length -
|
|
32
|
+
message.location.lineText.length +
|
|
33
|
+
1 },
|
|
34
|
+
React.createElement(Text, { color: "greenBright" }, "^")))))))));
|
|
35
|
+
export function renderBuildErrors({ errors, warnings }) {
|
|
36
|
+
return [
|
|
37
|
+
...errors.map((error, index) => (React.createElement(Error, { key: `BuildError-${index}`, message: error, level: "error" }))),
|
|
38
|
+
...warnings.map((error, index) => (React.createElement(Error, { key: `BuildError-${index}`, message: error, level: "warning" }))),
|
|
39
|
+
];
|
|
55
40
|
}
|
|
56
41
|
//# sourceMappingURL=BuildError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuildError.js","sourceRoot":"","sources":["../../src/components/BuildError.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,KAAK,CAAA;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,
|
|
1
|
+
{"version":3,"file":"BuildError.js","sourceRoot":"","sources":["../../src/components/BuildError.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,KAAK,CAAA;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAG5B,CAAC,EAAC,OAAO,EAAE,KAAK,EAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CACzB,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,GAAG,EAAE,GAAG;IAChC,oBAAC,GAAG;QACA,oBAAC,IAAI,IAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC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AChC,CAAC;wBAGL,oBAAC,IAAI,IAAC,KAAK,EAAC,aAAa,QAAS,CAChC,CACJ,CACJ,CACJ,CACJ,CACJ,CACT,CAAC,CAAA;AAEF,MAAM,UAAU,iBAAiB,CAAC,EAAC,MAAM,EAAE,QAAQ,EAAa;IAC5D,OAAO;QACH,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAC5B,oBAAC,KAAK,IAAC,GAAG,EAAE,cAAc,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAC,OAAO,GAAG,CACtE,CAAC;QACF,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAC9B,oBAAC,KAAK,IAAC,GAAG,EAAE,cAAc,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAC,SAAS,GAAG,CACxE,CAAC;KACL,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollBox.d.ts","sourceRoot":"","sources":["../../src/components/ScrollBox.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAiC,MAAM,KAAK,CAAA;AACvD,OAAO,KAAK,MAAM,OAAO,CAAA;AAezB,eAAO,MAAM,SAAS,oDACI,MAAM,wBAAwB,CAAC,UAAU,CAAC,uBAwGnE,CAAA"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { useSelector } from "@xstate/react";
|
|
2
|
+
import { Box, Text, measureElement, useInput } from "ink";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { useFullScreen } from "../hooks/useFullScreen.js";
|
|
5
|
+
import { useScrollBoxStore } from "./ScrollBox.store.js";
|
|
6
|
+
import { calculateChildRange } from "./ScrollBox.util.js";
|
|
7
|
+
const GAP = 1;
|
|
8
|
+
export const ScrollBox = React.memo(({ padding, ...props }) => {
|
|
9
|
+
const { height: screenHeight, width } = useFullScreen();
|
|
10
|
+
const [top, setTop] = React.useState(0);
|
|
11
|
+
const height = Number(screenHeight) - top;
|
|
12
|
+
const availableHeight = height - (props.borderStyle ? 2 : 0) - (padding ?? 0) * 2;
|
|
13
|
+
const children = React.useMemo(() => React.Children.toArray(props.children).filter((element) => Boolean(element) && React.isValidElement(element)), [props.children]);
|
|
14
|
+
const store = useScrollBoxStore(children.length, availableHeight, Number(width ?? ""));
|
|
15
|
+
const boxRef = React.useCallback((element) => setTop(element?.yogaNode?.getComputedTop() ?? 0), []);
|
|
16
|
+
const heights = useSelector(store, (state) => state.context.heights);
|
|
17
|
+
const offset = useSelector(store, (state) => state.context.offset);
|
|
18
|
+
const allMeasured = heights.length === children.length;
|
|
19
|
+
const haveOverflow = allMeasured && heights.reduce((a, b) => a + b, 0) > availableHeight;
|
|
20
|
+
const childRange = calculateChildRange(heights, offset, availableHeight);
|
|
21
|
+
const itemsShown = childRange[1] - childRange[0];
|
|
22
|
+
const hiddenAbove = offset;
|
|
23
|
+
const hiddenBelow = children.length - (offset + itemsShown);
|
|
24
|
+
useInput((input, key) => {
|
|
25
|
+
if (input === "j" || key.downArrow) {
|
|
26
|
+
if (key.meta) {
|
|
27
|
+
store.send({ type: "Page Down" });
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
store.send({ type: "Down" });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
else if (input === "k" || key.upArrow) {
|
|
34
|
+
if (key.meta) {
|
|
35
|
+
store.send({ type: "Page Up" });
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
store.send({ type: "Up" });
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else if (input === " " || (input === "d" && key.ctrl)) {
|
|
42
|
+
store.send({ type: "Page Down" });
|
|
43
|
+
}
|
|
44
|
+
else if (input === "b" || (input === "u" && key.ctrl)) {
|
|
45
|
+
store.send({ type: "Page Up" });
|
|
46
|
+
}
|
|
47
|
+
else if (input === "G") {
|
|
48
|
+
store.send({ type: "Bottom" });
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return (React.createElement(Box, { ...props, height: height, ref: boxRef, flexDirection: "column" },
|
|
52
|
+
haveOverflow && (React.createElement(Box, { flexDirection: "column", alignItems: "center", marginBottom: -1 }, hiddenAbove > 0 ? (React.createElement(Text, null,
|
|
53
|
+
"+ ",
|
|
54
|
+
hiddenAbove,
|
|
55
|
+
" item",
|
|
56
|
+
hiddenAbove === 1 ? "" : "s",
|
|
57
|
+
" ... press \u2191 to scroll",
|
|
58
|
+
" ")) : (React.createElement(Text, null, " ")))),
|
|
59
|
+
React.createElement(Box, { flexDirection: "column", gap: GAP, flexGrow: 1, padding: padding }, allMeasured
|
|
60
|
+
? children.map((child, index) => index >= childRange[0] && index < childRange[1]
|
|
61
|
+
? React.cloneElement(child, {
|
|
62
|
+
ref: (element) => {
|
|
63
|
+
const height = element
|
|
64
|
+
? measureElement(element).height + GAP
|
|
65
|
+
: 0;
|
|
66
|
+
if (!height)
|
|
67
|
+
return;
|
|
68
|
+
store.send({ type: "Item Measured", index, height });
|
|
69
|
+
},
|
|
70
|
+
})
|
|
71
|
+
: null)
|
|
72
|
+
:
|
|
73
|
+
React.cloneElement(children[heights.length], {
|
|
74
|
+
ref: (element) => {
|
|
75
|
+
const height = element ? measureElement(element).height + GAP : 0;
|
|
76
|
+
if (!height)
|
|
77
|
+
return;
|
|
78
|
+
store.send({ type: "Item Measured", index: heights.length, height });
|
|
79
|
+
},
|
|
80
|
+
})),
|
|
81
|
+
haveOverflow && (React.createElement(Box, { flexDirection: "column", alignItems: "center", marginTop: -1 }, hiddenBelow > 0 ? (React.createElement(Text, null,
|
|
82
|
+
"+ ",
|
|
83
|
+
hiddenBelow,
|
|
84
|
+
" item",
|
|
85
|
+
hiddenBelow === 1 ? "" : "s",
|
|
86
|
+
" ... press \u2193 to scroll")) : (React.createElement(Text, null, " "))))));
|
|
87
|
+
});
|
|
88
|
+
//# sourceMappingURL=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MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;wBACjE,IAAI,CAAC,MAAM;4BAAE,OAAM;wBACnB,KAAK,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,EAAC,CAAC,CAAA;oBACtE,CAAC;iBACJ,CAAC,CACN;QACL,YAAY,IAAI,CACb,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,UAAU,EAAC,QAAQ,EAAC,SAAS,EAAE,CAAC,CAAC,IACxD,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,CACf,oBAAC,IAAI;;YACE,WAAW;;YAAO,WAAW,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG;0CAE9C,CACV,CAAC,CAAC,CAAC,CACA,oBAAC,IAAI,YAAS,CACjB,CACC,CACT,CACC,CACT,CAAA;AACL,CAAC,CACJ,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare function useScrollBoxStore(numChildren: number, availableHeight: number, width: number): import("@xstate/store").Store<{
|
|
2
|
+
offset: number;
|
|
3
|
+
heights: number[];
|
|
4
|
+
}, import("@xstate/store").ExtractEventsFromPayloadMap<{
|
|
5
|
+
Down: unknown;
|
|
6
|
+
Up: unknown;
|
|
7
|
+
"Page Down": unknown;
|
|
8
|
+
"Page Up": unknown;
|
|
9
|
+
Bottom: unknown;
|
|
10
|
+
"Item Measured": {
|
|
11
|
+
index: number;
|
|
12
|
+
height: number;
|
|
13
|
+
};
|
|
14
|
+
}>>;
|
|
15
|
+
//# sourceMappingURL=ScrollBox.store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollBox.store.d.ts","sourceRoot":"","sources":["../../src/components/ScrollBox.store.ts"],"names":[],"mappings":"AAeA,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;;;;;;;;;;eAyCzB,MAAM;gBAAU,MAAM;;IAQzF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createStoreWithProducer } from "@xstate/store";
|
|
2
|
+
import { produce } from "immer";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { calculateChildRange, calculateLastPageOffset, calculatePreviousPageOffset, } from "./ScrollBox.util.js";
|
|
5
|
+
const initial = {
|
|
6
|
+
offset: 0,
|
|
7
|
+
heights: [],
|
|
8
|
+
};
|
|
9
|
+
export function useScrollBoxStore(numChildren, availableHeight, width) {
|
|
10
|
+
return React.useMemo(() => createStoreWithProducer(produce, initial, {
|
|
11
|
+
"Down": (context) => {
|
|
12
|
+
const [, end] = calculateChildRange(context.heights, context.offset, availableHeight);
|
|
13
|
+
if (end < numChildren) {
|
|
14
|
+
context.offset = Math.min(context.offset + 1, numChildren - 1);
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"Up": (context) => {
|
|
18
|
+
context.offset = Math.max(context.offset - 1, 0);
|
|
19
|
+
},
|
|
20
|
+
"Page Down": (context) => {
|
|
21
|
+
const [, end] = calculateChildRange(context.heights, context.offset, availableHeight);
|
|
22
|
+
if (end < numChildren - 1) {
|
|
23
|
+
context.offset = end;
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"Page Up": (context) => {
|
|
27
|
+
context.offset = calculatePreviousPageOffset(context.heights, context.offset, availableHeight);
|
|
28
|
+
},
|
|
29
|
+
"Bottom": (context) => {
|
|
30
|
+
context.offset = calculateLastPageOffset(context.heights, context.offset, availableHeight);
|
|
31
|
+
},
|
|
32
|
+
"Item Measured": (context, { index, height }) => {
|
|
33
|
+
context.heights[index] = height;
|
|
34
|
+
},
|
|
35
|
+
}), [availableHeight, numChildren, width]);
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=ScrollBox.store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Scroll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,EAAE,CAAC;gBACxB,OAAO,CAAC,MAAM,GAAG,GAAG,CAAA;YACxB,CAAC;QACL,CAAC;QACD,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE;YACnB,OAAO,CAAC,MAAM,GAAG,2BAA2B,CACxC,OAAO,CAAC,OAAO,EACf,OAAO,CAAC,MAAM,EACd,eAAe,CAClB,CAAA;QACL,CAAC;QACD,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE;YAClB,OAAO,CAAC,MAAM,GAAG,uBAAuB,CACpC,OAAO,CAAC,OAAO,EACf,OAAO,CAAC,MAAM,EACd,eAAe,CAClB,CAAA;QACL,CAAC;QACD,eAAe,EAAE,CAAC,OAAO,EAAE,EAAC,KAAK,EAAE,MAAM,EAAkC,EAAE,EAAE;YAC3E,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,CAAA;QACnC,CAAC;KACJ,CAAC,EAGN,CAAC,eAAe,EAAE,WAAW,EAAE,KAAK,CAAC,CACxC,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function calculateChildRange(heights: Array<number>, offset: number, availableHeight: number): [number, number];
|
|
2
|
+
export declare function calculatePreviousPageOffset(heights: Array<number>, offset: number, availableHeight: number): number;
|
|
3
|
+
export declare function calculateLastPageOffset(heights: Array<number>, offset: number, availableHeight: number): number;
|
|
4
|
+
//# sourceMappingURL=ScrollBox.util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollBox.util.d.ts","sourceRoot":"","sources":["../../src/components/ScrollBox.util.ts"],"names":[],"mappings":"AAIA,wBAAgB,mBAAmB,CAC/B,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,EACtB,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAAM,GACxB,CAAC,MAAM,EAAE,MAAM,CAAC,CAQlB;AAMD,wBAAgB,2BAA2B,CACvC,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,EACtB,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAAM,GACxB,MAAM,CAQR;AAMD,wBAAgB,uBAAuB,CACnC,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,EACtB,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAAM,GACxB,MAAM,CAQR"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export function calculateChildRange(heights, offset, availableHeight) {
|
|
2
|
+
let heightUsed = 0;
|
|
3
|
+
for (let index = offset; index < heights.length; index++) {
|
|
4
|
+
heightUsed += heights[index];
|
|
5
|
+
if (heightUsed > availableHeight)
|
|
6
|
+
return [offset, Math.max(index, 1)];
|
|
7
|
+
}
|
|
8
|
+
return [offset, heights.length];
|
|
9
|
+
}
|
|
10
|
+
export function calculatePreviousPageOffset(heights, offset, availableHeight) {
|
|
11
|
+
let heightUsed = 0;
|
|
12
|
+
for (let index = offset - 1; index > 0; index--) {
|
|
13
|
+
heightUsed += heights[index];
|
|
14
|
+
if (heightUsed > availableHeight)
|
|
15
|
+
return index + 1;
|
|
16
|
+
}
|
|
17
|
+
return 0;
|
|
18
|
+
}
|
|
19
|
+
export function calculateLastPageOffset(heights, offset, availableHeight) {
|
|
20
|
+
let heightUsed = 0;
|
|
21
|
+
for (let index = heights.length - 1; index > 0; index--) {
|
|
22
|
+
heightUsed += heights[index];
|
|
23
|
+
if (heightUsed > availableHeight)
|
|
24
|
+
return index + 1;
|
|
25
|
+
}
|
|
26
|
+
return 0;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=ScrollBox.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollBox.util.js","sourceRoot":"","sources":["../../src/components/ScrollBox.util.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,mBAAmB,CAC/B,OAAsB,EACtB,MAAc,EACd,eAAuB;IAEvB,IAAI,UAAU,GAAG,CAAC,CAAA;IAClB,KAAK,IAAI,KAAK,GAAG,MAAM,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;QACvD,UAAU,IAAI,OAAO,CAAC,KAAK,CAAC,CAAA;QAC5B,IAAI,UAAU,GAAG,eAAe;YAAE,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAA;IACzE,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;AACnC,CAAC;AAMD,MAAM,UAAU,2BAA2B,CACvC,OAAsB,EACtB,MAAc,EACd,eAAuB;IAEvB,IAAI,UAAU,GAAG,CAAC,CAAA;IAClB,KAAK,IAAI,KAAK,GAAG,MAAM,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;QAC9C,UAAU,IAAI,OAAO,CAAC,KAAK,CAAC,CAAA;QAC5B,IAAI,UAAU,GAAG,eAAe;YAAE,OAAO,KAAK,GAAG,CAAC,CAAA;IACtD,CAAC;IAED,OAAO,CAAC,CAAA;AACZ,CAAC;AAMD,MAAM,UAAU,uBAAuB,CACnC,OAAsB,EACtB,MAAc,EACd,eAAuB;IAEvB,IAAI,UAAU,GAAG,CAAC,CAAA;IAClB,KAAK,IAAI,KAAK,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;QACtD,UAAU,IAAI,OAAO,CAAC,KAAK,CAAC,CAAA;QAC5B,IAAI,UAAU,GAAG,eAAe;YAAE,OAAO,KAAK,GAAG,CAAC,CAAA;IACtD,CAAC;IAED,OAAO,CAAC,CAAA;AACZ,CAAC"}
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type TypeScriptError } from "../util/typescript.js";
|
|
3
|
-
export declare function
|
|
4
|
-
error: TypeScriptError;
|
|
5
|
-
}): React.JSX.Element;
|
|
6
|
-
interface TypeScriptErrorsProps {
|
|
7
|
-
errors: Array<TypeScriptError>;
|
|
8
|
-
}
|
|
9
|
-
export declare function TypeScriptErrors({ errors }: TypeScriptErrorsProps): React.JSX.Element;
|
|
10
|
-
export {};
|
|
3
|
+
export declare function renderTypeScriptErrors(errors: Array<TypeScriptError>): React.JSX.Element[];
|
|
11
4
|
//# sourceMappingURL=TypeScriptErrors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeScriptErrors.d.ts","sourceRoot":"","sources":["../../src/components/TypeScriptErrors.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAC,KAAK,eAAe,EAAC,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"TypeScriptErrors.d.ts","sourceRoot":"","sources":["../../src/components/TypeScriptErrors.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAC,KAAK,eAAe,EAAC,MAAM,uBAAuB,CAAA;AAgD1D,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,KAAK,CAAC,eAAe,CAAC,uBAEpE"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { Box, Text } from "ink";
|
|
2
2
|
import React from "react";
|
|
3
|
-
|
|
4
|
-
return (React.createElement(Box, { flexDirection: "column" },
|
|
3
|
+
const Error = React.forwardRef(({ error }, ref) => {
|
|
4
|
+
return (React.createElement(Box, { flexDirection: "column", ref: ref },
|
|
5
5
|
React.createElement(Box, null,
|
|
6
6
|
React.createElement(Text, { color: "red" },
|
|
7
|
-
"\u274C",
|
|
8
|
-
" ",
|
|
9
7
|
React.createElement(Text, { backgroundColor: "red", color: "white" },
|
|
10
8
|
" ",
|
|
11
9
|
"TYPESCRIPT ERROR",
|
|
12
|
-
" ")
|
|
10
|
+
" "),
|
|
11
|
+
" "),
|
|
13
12
|
React.createElement(Text, { bold: true }, error.text)),
|
|
14
13
|
error.location && (React.createElement(Box, { paddingTop: 1, flexDirection: "column" },
|
|
15
14
|
React.createElement(Box, { marginLeft: 4 },
|
|
@@ -33,15 +32,8 @@ export function Error({ error }) {
|
|
|
33
32
|
error.location.lineText.length +
|
|
34
33
|
1 },
|
|
35
34
|
React.createElement(Text, { color: "greenBright" }, "^")))))))));
|
|
36
|
-
}
|
|
37
|
-
export function
|
|
38
|
-
return
|
|
39
|
-
React.createElement(Text, { color: "red" },
|
|
40
|
-
errors.length,
|
|
41
|
-
" ERROR",
|
|
42
|
-
errors.length === 1 ? "" : "S",
|
|
43
|
-
":"),
|
|
44
|
-
errors.map((error, index) => (React.createElement(Box, { key: index, marginY: 1 },
|
|
45
|
-
React.createElement(Error, { error: error }))))))));
|
|
35
|
+
});
|
|
36
|
+
export function renderTypeScriptErrors(errors) {
|
|
37
|
+
return errors.map((error, index) => React.createElement(Error, { key: `TypeScriptError-${index}`, error: error }));
|
|
46
38
|
}
|
|
47
39
|
//# sourceMappingURL=TypeScriptErrors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeScriptErrors.js","sourceRoot":"","sources":["../../src/components/TypeScriptErrors.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,KAAK,CAAA;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,
|
|
1
|
+
{"version":3,"file":"TypeScriptErrors.js","sourceRoot":"","sources":["../../src/components/TypeScriptErrors.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,KAAK,CAAA;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAgC,CAAC,EAAC,KAAK,EAAC,EAAE,GAAG,EAAE,EAAE;IAC3E,OAAO,CACH,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,GAAG,EAAE,GAAG;QAChC,o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C,CAAA;AAEF,MAAM,UAAU,sBAAsB,CAAC,MAA8B;IACjE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,oBAAC,KAAK,IAAC,GAAG,EAAE,mBAAmB,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,GAAI,CAAC,CAAA;AACjG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFullScreen.d.ts","sourceRoot":"","sources":["../../src/hooks/useFullScreen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"useFullScreen.d.ts","sourceRoot":"","sources":["../../src/hooks/useFullScreen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAY,MAAM,KAAK,CAAA;AAGvC,eAAO,MAAM,aAAa,QAAO,KAAK,QAAQ,EAAE,OAAO,GAAG,QAAQ,CAuBjE,CAAA"}
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
+
import { useStdout } from "ink";
|
|
1
2
|
import React from "react";
|
|
2
3
|
export const useFullScreen = () => {
|
|
3
|
-
const
|
|
4
|
-
const [
|
|
4
|
+
const { stdout } = useStdout();
|
|
5
|
+
const [columns, setColumns] = React.useState(stdout.columns);
|
|
6
|
+
const [rows, setRows] = React.useState(stdout.rows);
|
|
5
7
|
React.useEffect(() => {
|
|
6
8
|
const handleResize = () => {
|
|
7
|
-
setColumns(
|
|
8
|
-
setRows(
|
|
9
|
+
setColumns(stdout.columns);
|
|
10
|
+
setRows(stdout.rows);
|
|
9
11
|
};
|
|
10
|
-
|
|
12
|
+
stdout.addListener("resize", handleResize);
|
|
13
|
+
stdout.write("\x1b[?1049h");
|
|
14
|
+
process.on("beforeExit", () => {
|
|
15
|
+
stdout.write("\x1b[?1049l");
|
|
16
|
+
});
|
|
11
17
|
return () => {
|
|
12
|
-
|
|
18
|
+
stdout.removeListener("resize", handleResize);
|
|
13
19
|
};
|
|
14
20
|
}, []);
|
|
15
|
-
return { width: columns, height: rows
|
|
21
|
+
return { width: columns, height: rows };
|
|
16
22
|
};
|
|
17
23
|
//# sourceMappingURL=useFullScreen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFullScreen.js","sourceRoot":"","sources":["../../src/hooks/useFullScreen.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useFullScreen.js","sourceRoot":"","sources":["../../src/hooks/useFullScreen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,SAAS,EAAC,MAAM,KAAK,CAAA;AACvC,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,CAAC,MAAM,aAAa,GAAG,GAAuC,EAAE;IAClE,MAAM,EAAC,MAAM,EAAC,GAAG,SAAS,EAAE,CAAA;IAC5B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IAC5D,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACnD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACjB,MAAM,YAAY,GAAG,GAAG,EAAE;YACtB,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;YAC1B,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QACxB,CAAC,CAAA;QACD,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;QAE1C,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;QAC3B,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,GAAG,EAAE;YAC1B,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;QAC/B,CAAC,CAAC,CAAA;QAEF,OAAO,GAAG,EAAE;YACR,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;QACjD,CAAC,CAAA;IAEL,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,EAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAC,CAAA;AACzC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTerminalTitle.d.ts","sourceRoot":"","sources":["../../src/hooks/useTerminalTitle.ts"],"names":[],"mappings":"AAEA,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAQpD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export function useTerminalTitle(title) {
|
|
3
|
+
React.useEffect(() => {
|
|
4
|
+
if (process.platform === "win32") {
|
|
5
|
+
process.title = title;
|
|
6
|
+
}
|
|
7
|
+
else {
|
|
8
|
+
process.stdout.write(`\x1B]2;${title}\x1B\x5C`);
|
|
9
|
+
}
|
|
10
|
+
}, [title]);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=useTerminalTitle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTerminalTitle.js","sourceRoot":"","sources":["../../src/hooks/useTerminalTitle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC1C,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACjB,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;YAC/B,OAAO,CAAC,KAAK,GAAG,KAAK,CAAA;QACzB,CAAC;aAAM,CAAC;YACJ,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,KAAK,UAAU,CAAC,CAAA;QACnD,CAAC;IACL,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;AACf,CAAC"}
|