@ncukondo/reference-manager 0.15.3 → 0.16.1
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/chunks/alternate-screen-DcxkOKfW.js +19 -0
- package/dist/chunks/alternate-screen-DcxkOKfW.js.map +1 -0
- package/dist/chunks/format-BPeCbpFG.js +924 -0
- package/dist/chunks/format-BPeCbpFG.js.map +1 -0
- package/dist/chunks/index-7bmkSgzh.js +531 -0
- package/dist/chunks/index-7bmkSgzh.js.map +1 -0
- package/dist/chunks/{index-DVFYLuQx.js → index-BzHJQ7Or.js} +2 -2
- package/dist/chunks/index-BzHJQ7Or.js.map +1 -0
- package/dist/chunks/{index-TKhWlXl1.js → index-Ddq16wFm.js} +104 -76
- package/dist/chunks/index-Ddq16wFm.js.map +1 -0
- package/dist/chunks/jsx-runtime-Q5cUjSur.js +322 -0
- package/dist/chunks/jsx-runtime-Q5cUjSur.js.map +1 -0
- package/dist/chunks/reference-select-Cs3hsy-1.js +214 -0
- package/dist/chunks/reference-select-Cs3hsy-1.js.map +1 -0
- package/dist/chunks/{style-select-BNQHC79W.js → style-select-tmKOHx_B.js} +6 -31
- package/dist/chunks/style-select-tmKOHx_B.js.map +1 -0
- package/dist/cli/commands/attach.d.ts.map +1 -1
- package/dist/cli/commands/cite.d.ts.map +1 -1
- package/dist/cli/commands/edit.d.ts.map +1 -1
- package/dist/cli/commands/fulltext.d.ts.map +1 -1
- package/dist/cli/commands/remove.d.ts.map +1 -1
- package/dist/cli/commands/search.d.ts +1 -1
- package/dist/cli/commands/search.d.ts.map +1 -1
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/helpers.d.ts.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/features/interactive/action-menu.d.ts +10 -12
- package/dist/features/interactive/action-menu.d.ts.map +1 -1
- package/dist/features/interactive/alternate-screen.d.ts +42 -0
- package/dist/features/interactive/alternate-screen.d.ts.map +1 -0
- package/dist/features/interactive/apps/CiteFlowApp.d.ts +52 -0
- package/dist/features/interactive/apps/CiteFlowApp.d.ts.map +1 -0
- package/dist/features/interactive/apps/SearchFlowApp.d.ts +34 -0
- package/dist/features/interactive/apps/SearchFlowApp.d.ts.map +1 -0
- package/dist/features/interactive/apps/index.d.ts +11 -0
- package/dist/features/interactive/apps/index.d.ts.map +1 -0
- package/dist/features/interactive/apps/runCiteFlow.d.ts +42 -0
- package/dist/features/interactive/apps/runCiteFlow.d.ts.map +1 -0
- package/dist/features/interactive/apps/runSearchFlow.d.ts +28 -0
- package/dist/features/interactive/apps/runSearchFlow.d.ts.map +1 -0
- package/dist/features/interactive/components/SearchableMultiSelect.d.ts +49 -0
- package/dist/features/interactive/components/SearchableMultiSelect.d.ts.map +1 -0
- package/dist/features/interactive/components/Select.d.ts +26 -0
- package/dist/features/interactive/components/Select.d.ts.map +1 -0
- package/dist/features/interactive/components/index.d.ts +8 -0
- package/dist/features/interactive/components/index.d.ts.map +1 -0
- package/dist/features/interactive/search-prompt.d.ts +15 -12
- package/dist/features/interactive/search-prompt.d.ts.map +1 -1
- package/dist/features/interactive/style-select.d.ts +3 -11
- package/dist/features/interactive/style-select.d.ts.map +1 -1
- package/package.json +7 -4
- package/dist/chunks/action-menu-yzuB0WT3.js +0 -119
- package/dist/chunks/action-menu-yzuB0WT3.js.map +0 -1
- package/dist/chunks/index-DVFYLuQx.js.map +0 -1
- package/dist/chunks/index-TKhWlXl1.js.map +0 -1
- package/dist/chunks/reference-select-B9w9CLa1.js +0 -52
- package/dist/chunks/reference-select-B9w9CLa1.js.map +0 -1
- package/dist/chunks/search-prompt-BrWpOcij.js +0 -265
- package/dist/chunks/search-prompt-BrWpOcij.js.map +0 -1
- package/dist/chunks/style-select-BNQHC79W.js.map +0 -1
- /package/bin/{reference-manager.js → cli.js} +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const ENTER_ALT_SCREEN = "\x1B[?1049h";
|
|
2
|
+
const EXIT_ALT_SCREEN = "\x1B[?1049l";
|
|
3
|
+
async function withAlternateScreen(fn) {
|
|
4
|
+
process.stdout.write(ENTER_ALT_SCREEN);
|
|
5
|
+
try {
|
|
6
|
+
return await fn();
|
|
7
|
+
} finally {
|
|
8
|
+
process.stdout.write(EXIT_ALT_SCREEN);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function restoreStdinAfterInk() {
|
|
12
|
+
setTimeout(() => {
|
|
13
|
+
}, 100);
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
restoreStdinAfterInk,
|
|
17
|
+
withAlternateScreen
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=alternate-screen-DcxkOKfW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alternate-screen-DcxkOKfW.js","sources":["../../src/features/interactive/alternate-screen.ts"],"sourcesContent":["/**\n * Alternate screen buffer utilities for TUI sessions.\n *\n * When running fullscreen TUI applications, we switch to the alternate\n * screen buffer to preserve the terminal's scrollback history.\n * This is similar to how vim, less, and other TUI apps work.\n */\n\n// ANSI escape sequences for alternate screen buffer\nconst ENTER_ALT_SCREEN = \"\\x1b[?1049h\";\nconst EXIT_ALT_SCREEN = \"\\x1b[?1049l\";\n\n/**\n * Run a function within an alternate screen buffer session.\n *\n * This preserves the terminal's scrollback history by:\n * 1. Switching to alternate screen buffer before running the function\n * 2. Switching back to the main screen buffer after the function completes\n *\n * Use this to wrap TUI sessions that may take over the full terminal.\n *\n * @param fn - Async function to run in alternate screen\n * @returns The result of the function\n *\n * @example\n * ```typescript\n * const result = await withAlternateScreen(async () => {\n * const refs = await runReferenceSelect(...);\n * const style = await runStyleSelect(...);\n * return { refs, style };\n * });\n * ```\n */\nexport async function withAlternateScreen<T>(fn: () => Promise<T>): Promise<T> {\n process.stdout.write(ENTER_ALT_SCREEN);\n try {\n return await fn();\n } finally {\n process.stdout.write(EXIT_ALT_SCREEN);\n }\n}\n\n/**\n * Restore stdin after Ink exits.\n *\n * Ink calls stdin.unref() when it exits, which can cause the Node.js process\n * to exit prematurely if there's still async work to do. This function uses\n * a short-lived ref'd timer to keep the event loop alive long enough for\n * subsequent async operations to start (e.g., file I/O, database operations),\n * which will then keep the event loop alive on their own.\n *\n * Call this after Ink's waitUntilExit() resolves.\n */\nexport function restoreStdinAfterInk(): void {\n // Use a ref'd timer to keep the event loop alive for 100ms.\n // This gives async operations time to start and take over keeping\n // the event loop alive. The timer will then expire naturally.\n setTimeout(() => {}, 100);\n}\n"],"names":[],"mappings":"AASA,MAAM,mBAAmB;AACzB,MAAM,kBAAkB;AAuBxB,eAAsB,oBAAuB,IAAkC;AAC7E,UAAQ,OAAO,MAAM,gBAAgB;AACrC,MAAI;AACF,WAAO,MAAM,GAAA;AAAA,EACf,UAAA;AACE,YAAQ,OAAO,MAAM,eAAe;AAAA,EACtC;AACF;AAaO,SAAS,uBAA6B;AAI3C,aAAW,MAAM;AAAA,EAAC,GAAG,GAAG;AAC1B;"}
|