-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.umd.js.map
1 lines (1 loc) · 3.17 KB
/
index.umd.js.map
1
{"version":3,"file":"index.umd.js","sources":["index.jsx"],"sourcesContent":["import * as readline from 'node:readline';\nimport React, { useState, useEffect } from 'react';\nimport { Box, render, Text, useFocus, useFocusManager, useInput } from 'ink';\n\nreadline.emitKeypressEvents(process.stdin);\n\nprocess.stdin.on('keypress', function (str, key) {\n if (key && key.name === 'q') {\n process.stdin.pause();\n }\n});\nprocess.stdin.setRawMode(true);\n\nfunction Item(props) {\n const { id, label } = props;\n const { isFocused } = useFocus({ id });\n\n return (\n <Text inverse={isFocused}>{label}</Text>\n );\n}\n\nfunction App() {\n const { focus } = useFocusManager();\n\n useInput((input) => {\n switch (input) {\n case '1':\n focus('item-1');\n break;\n case '2':\n focus('item-2');\n break;\n case '3':\n focus('item-3');\n break;\n }\n });\n\n return (\n <Box width=\"100%\" height=\"100%\" flexDirection=\"column\">\n <Text>Press 1, 2 or 3 to focus an item. Press Tab to focus next item. Press q to exit.</Text>\n <Item id=\"item-1\" label=\"Item 1\" />\n <Item id=\"item-2\" label=\"Item 2\" />\n <Item id=\"item-3\" label=\"Item 3\" />\n </Box>\n );\n}\n\nrender(<App />);\n"],"names":["readline","emitKeypressEvents","process","stdin","on","str","key","name","pause","setRawMode","Item","props","id","label","isFocused","useFocus","React","createElement","Text","inverse","App","focus","useFocusManager","useInput","input","Box","width","height","flexDirection","render"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIAA,qBAAQ,CAACC,kBAAkB,CAACC,OAAO,CAACC,KAAK,CAAC,CAAA;EAE1CD,OAAO,CAACC,KAAK,CAACC,EAAE,CAAC,UAAU,EAAE,UAAUC,GAAG,EAAEC,GAAG,EAAE;EAC/C,EAAA,IAAIA,GAAG,IAAIA,GAAG,CAACC,IAAI,KAAK,GAAG,EAAE;EAC3BL,IAAAA,OAAO,CAACC,KAAK,CAACK,KAAK,EAAE,CAAA;E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