@ncukondo/reference-manager 0.16.0 → 0.17.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/chunks/{file-watcher-B_WpVHSV.js → file-watcher-CrsNHUpz.js} +81 -29
- package/dist/chunks/file-watcher-CrsNHUpz.js.map +1 -0
- package/dist/chunks/format-CduFas9k.js +934 -0
- package/dist/chunks/format-CduFas9k.js.map +1 -0
- package/dist/chunks/{index-DHgeuWGP.js → index-B4gr0P83.js} +16 -20
- package/dist/chunks/{index-DHgeuWGP.js.map → index-B4gr0P83.js.map} +1 -1
- package/dist/chunks/{index-CEYp8OSj.js → index-CfuE2EuX.js} +6 -80
- package/dist/chunks/index-CfuE2EuX.js.map +1 -0
- package/dist/chunks/{index-4SVOiraD.js → index-CqrsgD_G.js} +1026 -177
- package/dist/chunks/index-CqrsgD_G.js.map +1 -0
- package/dist/chunks/{index-Bzl4_3Ki.js → index-D_UafVdu.js} +2 -2
- package/dist/chunks/index-D_UafVdu.js.map +1 -0
- package/dist/chunks/{loader-DuhmXjiI.js → loader-BN5sS7lg.js} +2 -2
- package/dist/chunks/{loader-DuhmXjiI.js.map → loader-BN5sS7lg.js.map} +1 -1
- package/dist/chunks/{reference-select-CgM-RBIa.js → reference-select-DbnF3oWs.js} +4 -16
- package/dist/chunks/reference-select-DbnF3oWs.js.map +1 -0
- package/dist/chunks/{style-select-tmKOHx_B.js → style-select-CbV5k3AV.js} +3 -3
- package/dist/chunks/{style-select-tmKOHx_B.js.map → style-select-CbV5k3AV.js.map} +1 -1
- package/dist/cli/commands/edit.d.ts +24 -3
- package/dist/cli/commands/edit.d.ts.map +1 -1
- package/dist/cli/commands/update.d.ts +1 -1
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli.js +2 -2
- package/dist/core/csl-json/types.d.ts +0 -12
- package/dist/core/csl-json/types.d.ts.map +1 -1
- package/dist/core/library-interface.d.ts +14 -2
- package/dist/core/library-interface.d.ts.map +1 -1
- package/dist/core/library.d.ts +10 -1
- package/dist/core/library.d.ts.map +1 -1
- package/dist/features/edit/edit-session.d.ts +4 -0
- package/dist/features/edit/edit-session.d.ts.map +1 -1
- package/dist/features/edit/edit-validator.d.ts +19 -0
- package/dist/features/edit/edit-validator.d.ts.map +1 -0
- package/dist/features/edit/field-transformer.d.ts +4 -0
- package/dist/features/edit/field-transformer.d.ts.map +1 -1
- package/dist/features/edit/index.d.ts +2 -1
- package/dist/features/edit/index.d.ts.map +1 -1
- package/dist/features/edit/json-serializer.d.ts +9 -0
- package/dist/features/edit/json-serializer.d.ts.map +1 -1
- package/dist/features/edit/validation-prompt.d.ts +17 -0
- package/dist/features/edit/validation-prompt.d.ts.map +1 -0
- package/dist/features/edit/yaml-serializer.d.ts +10 -0
- package/dist/features/edit/yaml-serializer.d.ts.map +1 -1
- package/dist/features/fulltext/index.d.ts +0 -1
- package/dist/features/fulltext/index.d.ts.map +1 -1
- package/dist/features/interactive/apps/runCiteFlow.d.ts +1 -1
- package/dist/features/interactive/apps/runCiteFlow.d.ts.map +1 -1
- package/dist/features/interactive/apps/runSearchFlow.d.ts.map +1 -1
- package/dist/features/interactive/components/SearchableMultiSelect.d.ts.map +1 -1
- package/dist/features/interactive/components/index.d.ts +1 -0
- package/dist/features/interactive/components/index.d.ts.map +1 -1
- package/dist/features/interactive/components/layout.d.ts +23 -0
- package/dist/features/interactive/components/layout.d.ts.map +1 -0
- package/dist/features/interactive/search-prompt.d.ts +2 -15
- package/dist/features/interactive/search-prompt.d.ts.map +1 -1
- package/dist/features/operations/change-details.d.ts +27 -0
- package/dist/features/operations/change-details.d.ts.map +1 -0
- package/dist/features/operations/json-output.d.ts +2 -0
- package/dist/features/operations/json-output.d.ts.map +1 -1
- package/dist/features/operations/remove.d.ts +0 -1
- package/dist/features/operations/remove.d.ts.map +1 -1
- package/dist/features/operations/update.d.ts +4 -2
- package/dist/features/operations/update.d.ts.map +1 -1
- package/dist/index.js +16 -15
- package/dist/index.js.map +1 -1
- package/dist/server.js +2 -2
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/object.d.ts +5 -0
- package/dist/utils/object.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/alternate-screen-DcxkOKfW.js +0 -19
- package/dist/chunks/alternate-screen-DcxkOKfW.js.map +0 -1
- package/dist/chunks/file-watcher-B_WpVHSV.js.map +0 -1
- package/dist/chunks/format-C6FA-7hE.js +0 -397
- package/dist/chunks/format-C6FA-7hE.js.map +0 -1
- package/dist/chunks/index-4SVOiraD.js.map +0 -1
- package/dist/chunks/index-Bzl4_3Ki.js.map +0 -1
- package/dist/chunks/index-CEYp8OSj.js.map +0 -1
- package/dist/chunks/jsx-runtime-Q5cUjSur.js +0 -322
- package/dist/chunks/jsx-runtime-Q5cUjSur.js.map +0 -1
- package/dist/chunks/reference-select-CgM-RBIa.js.map +0 -1
- package/dist/features/fulltext/manager.d.ts +0 -109
- package/dist/features/fulltext/manager.d.ts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-Bzl4_3Ki.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-CEYp8OSj.js","sources":["../../src/features/interactive/components/Select.tsx","../../src/features/interactive/action-menu.ts","../../src/features/interactive/apps/SearchFlowApp.tsx","../../src/features/interactive/apps/runSearchFlow.ts","../../src/features/interactive/apps/CiteFlowApp.tsx","../../src/features/interactive/apps/runCiteFlow.ts"],"sourcesContent":["/**\n * Select - A simple single-select component for React Ink\n */\n\nimport { Box, Text, useFocus, useInput } from \"ink\";\nimport type React from \"react\";\nimport { useState } from \"react\";\n\nexport interface SelectOption<T = string> {\n /** Display label */\n label: string;\n /** Associated value */\n value: T;\n /** Optional hint text */\n hint?: string;\n}\n\nexport interface SelectProps<T = string> {\n /** Available options */\n options: SelectOption<T>[];\n /** Prompt message */\n message: string;\n /** Callback when selection is confirmed */\n onSelect: (value: T) => void;\n /** Callback when cancelled */\n onCancel: () => void;\n /** Initial selection index */\n initialIndex?: number;\n}\n\nexport function Select<T = string>({\n options,\n message,\n onSelect,\n onCancel,\n initialIndex = 0,\n}: SelectProps<T>): React.ReactElement {\n const [focusIndex, setFocusIndex] = useState(initialIndex);\n const { isFocused } = useFocus({ autoFocus: true });\n\n useInput(\n (input, key) => {\n // Cancel on Escape\n if (key.escape) {\n onCancel();\n return;\n }\n\n // Submit on Enter\n if (key.return) {\n const selected = options[focusIndex];\n if (selected) {\n onSelect(selected.value);\n }\n return;\n }\n\n // Navigate up\n if (key.upArrow || input === \"k\") {\n setFocusIndex((prev) => Math.max(0, prev - 1));\n return;\n }\n\n // Navigate down\n if (key.downArrow || input === \"j\") {\n setFocusIndex((prev) => Math.min(options.length - 1, prev + 1));\n return;\n }\n },\n { isActive: isFocused }\n );\n\n return (\n <Box flexDirection=\"column\">\n {/* Message */}\n <Box marginBottom={1}>\n <Text bold color=\"cyan\">\n {message}\n </Text>\n </Box>\n\n {/* Options */}\n <Box flexDirection=\"column\">\n {options.map((option, index) => {\n const isFocusedItem = index === focusIndex;\n\n return (\n <Box key={`${option.label}-${index}`} flexDirection=\"row\">\n {/* Focus indicator - fixed width for layout stability */}\n <Box width={2}>{isFocusedItem ? <Text color=\"cyan\">❯</Text> : <Text> </Text>}</Box>\n\n {/* Label */}\n {isFocusedItem ? (\n <Text color=\"cyan\" bold>\n {option.label}\n </Text>\n ) : (\n <Text>{option.label}</Text>\n )}\n\n {/* Hint */}\n {option.hint && <Text dimColor> ({option.hint})</Text>}\n </Box>\n );\n })}\n </Box>\n\n {/* Footer */}\n <Box marginTop={1}>\n <Text dimColor>(↑↓: navigate, Enter: select, Esc: cancel)</Text>\n </Box>\n </Box>\n );\n}\n","/**\n * Action menu for interactive search mode.\n * Allows users to perform actions on selected references.\n */\n\nimport { render } from \"ink\";\nimport { createElement } from \"react\";\nimport type React from \"react\";\nimport type { CslItem } from \"../../core/csl-json/types.js\";\nimport { formatBibliographyCSL, formatBibtex } from \"../format/index.js\";\nimport { restoreStdinAfterInk } from \"./alternate-screen.js\";\nimport { Select, type SelectOption } from \"./components/index.js\";\n\n/**\n * Action types available in the action menu.\n */\nexport type ActionType =\n | \"output-ids\"\n | \"output-csl-json\"\n | \"output-bibtex\"\n | \"cite-apa\"\n | \"cite-choose\"\n | \"cancel\";\n\n/**\n * Result from action menu selection.\n */\nexport interface ActionMenuResult {\n /** Selected action type */\n action: ActionType;\n /** Generated output (empty for cancel) */\n output: string;\n /** Whether the prompt was cancelled */\n cancelled: boolean;\n}\n\n/**\n * Result from style selection prompt.\n */\nexport interface StyleSelectResult {\n /** Selected style (undefined if cancelled) */\n style?: string;\n /** Whether the prompt was cancelled */\n cancelled: boolean;\n}\n\n/**\n * Available action choices for the action menu.\n */\nexport const ACTION_CHOICES: SelectOption<ActionType>[] = [\n { label: \"Output IDs (citation keys)\", value: \"output-ids\" },\n { label: \"Output as CSL-JSON\", value: \"output-csl-json\" },\n { label: \"Output as BibTeX\", value: \"output-bibtex\" },\n { label: \"Generate citation (APA)\", value: \"cite-apa\" },\n { label: \"Generate citation (choose style)\", value: \"cite-choose\" },\n { label: \"Cancel\", value: \"cancel\" },\n];\n\n/**\n * Available style choices for citation style selection.\n */\nexport const STYLE_CHOICES: SelectOption<string>[] = [\n { label: \"APA\", value: \"apa\" },\n { label: \"Vancouver\", value: \"vancouver\" },\n { label: \"Harvard\", value: \"harvard\" },\n];\n\n/**\n * Props for the ActionMenuApp component\n */\ninterface ActionMenuAppProps {\n message: string;\n options: SelectOption<ActionType>[];\n onSelect: (value: ActionType) => void;\n onCancel: () => void;\n}\n\n/**\n * ActionMenuApp component - wraps Select for action menu\n */\nfunction ActionMenuApp({\n message,\n options,\n onSelect,\n onCancel,\n}: ActionMenuAppProps): React.ReactElement {\n return createElement(Select<ActionType>, {\n options,\n message,\n onSelect,\n onCancel,\n });\n}\n\n/**\n * Props for the StyleSelectApp component\n */\ninterface StyleSelectAppProps {\n options: SelectOption<string>[];\n onSelect: (value: string) => void;\n onCancel: () => void;\n}\n\n/**\n * StyleSelectApp component - wraps Select for style selection\n */\nfunction StyleSelectApp({ options, onSelect, onCancel }: StyleSelectAppProps): React.ReactElement {\n return createElement(Select<string>, {\n options,\n message: \"Select citation style:\",\n onSelect,\n onCancel,\n });\n}\n\n/**\n * Generate output for the given action and items.\n */\nexport function generateOutput(action: ActionType, items: CslItem[], style = \"apa\"): string {\n switch (action) {\n case \"output-ids\":\n return items.map((item) => item.id).join(\"\\n\");\n\n case \"output-csl-json\":\n return JSON.stringify(items, null, 2);\n\n case \"output-bibtex\":\n return formatBibtex(items);\n\n case \"cite-apa\":\n return formatBibliographyCSL(items, { style: \"apa\" });\n\n case \"cite-choose\":\n return formatBibliographyCSL(items, { style });\n\n case \"cancel\":\n return \"\";\n\n default:\n return \"\";\n }\n}\n\n/**\n * Run the style selection prompt.\n */\nexport async function runStyleSelectPrompt(): Promise<StyleSelectResult> {\n return new Promise<StyleSelectResult>((resolve) => {\n let result: StyleSelectResult = { cancelled: true };\n\n const handleSelect = (value: string): void => {\n result = {\n style: value,\n cancelled: false,\n };\n };\n\n const handleCancel = (): void => {\n result = {\n cancelled: true,\n };\n };\n\n // Render the Ink app\n const { waitUntilExit } = render(\n createElement(StyleSelectApp, {\n options: STYLE_CHOICES,\n onSelect: handleSelect,\n onCancel: handleCancel,\n })\n );\n\n // Wait for the app to exit, then resolve\n waitUntilExit()\n .then(() => {\n restoreStdinAfterInk();\n resolve(result);\n })\n .catch(() => {\n restoreStdinAfterInk();\n resolve({\n cancelled: true,\n });\n });\n });\n}\n\n/**\n * Process the selected action and generate result.\n */\nasync function processAction(action: ActionType, items: CslItem[]): Promise<ActionMenuResult> {\n // Handle cite-choose: prompt for style first\n if (action === \"cite-choose\") {\n const styleResult = await runStyleSelectPrompt();\n if (styleResult.cancelled) {\n return {\n action: \"cancel\",\n output: \"\",\n cancelled: true,\n };\n }\n return {\n action,\n output: generateOutput(action, items, styleResult.style),\n cancelled: false,\n };\n }\n\n // Handle cancel\n if (action === \"cancel\") {\n return {\n action,\n output: \"\",\n cancelled: true,\n };\n }\n\n // Handle other actions\n return {\n action,\n output: generateOutput(action, items),\n cancelled: false,\n };\n}\n\n/**\n * Run the action menu for selected references.\n *\n * @param items - Selected references\n * @returns Action result with output\n */\nexport async function runActionMenu(items: CslItem[]): Promise<ActionMenuResult> {\n const count = items.length;\n const refWord = count === 1 ? \"reference\" : \"references\";\n const message = `Action for ${count} selected ${refWord}:`;\n\n return new Promise<ActionMenuResult>((resolve) => {\n let selectedAction: ActionType | null = null;\n\n const handleSelect = (action: ActionType): void => {\n selectedAction = action;\n };\n\n const handleCancel = (): void => {\n selectedAction = null;\n };\n\n // Render the Ink app\n const { waitUntilExit } = render(\n createElement(ActionMenuApp, {\n message,\n options: ACTION_CHOICES,\n onSelect: handleSelect,\n onCancel: handleCancel,\n })\n );\n\n // Wait for the app to exit, then process the action\n waitUntilExit()\n .then(async () => {\n restoreStdinAfterInk();\n\n if (selectedAction === null) {\n resolve({\n action: \"cancel\",\n output: \"\",\n cancelled: true,\n });\n } else {\n const result = await processAction(selectedAction, items);\n resolve(result);\n }\n })\n .catch(() => {\n restoreStdinAfterInk();\n resolve({\n action: \"cancel\",\n output: \"\",\n cancelled: true,\n });\n });\n });\n}\n","/**\n * SearchFlowApp - Single App for search -t flow\n *\n * Manages state transitions: search → action → (style if needed)\n * Following React Ink Single App Pattern (ADR-015)\n */\n\nimport { Box, useApp } from \"ink\";\nimport type React from \"react\";\nimport { createElement, useEffect, useState } from \"react\";\nimport type { CslItem } from \"../../../core/csl-json/types.js\";\nimport {\n ACTION_CHOICES,\n type ActionMenuResult,\n type ActionType,\n STYLE_CHOICES,\n generateOutput,\n} from \"../action-menu.js\";\nimport {\n type Choice,\n SearchableMultiSelect,\n Select,\n type SortOption,\n} from \"../components/index.js\";\n\n/**\n * Flow states for the search flow\n */\ntype FlowState = \"search\" | \"action\" | \"style\" | \"exiting\";\n\n/**\n * Props for SearchFlowApp\n */\nexport interface SearchFlowAppProps {\n /** Choices for the search prompt */\n choices: Choice<CslItem>[];\n /** Filter function for search */\n filterFn: (query: string, choices: Choice<CslItem>[]) => Choice<CslItem>[];\n /** Number of visible items */\n visibleCount: number;\n /** Default sort option */\n defaultSort: SortOption;\n /** Callback when flow completes */\n onComplete: (result: ActionMenuResult) => void;\n /** Callback when flow is cancelled */\n onCancel: () => void;\n}\n\n/**\n * SearchFlowApp component\n *\n * Single App that manages search → action → style flow\n */\nexport function SearchFlowApp({\n choices,\n filterFn,\n visibleCount,\n defaultSort,\n onComplete,\n onCancel,\n}: SearchFlowAppProps): React.ReactElement {\n const { exit } = useApp();\n const [state, setState] = useState<FlowState>(\"search\");\n const [selectedItems, setSelectedItems] = useState<CslItem[]>([]);\n const [pendingResult, setPendingResult] = useState<ActionMenuResult | null>(null);\n\n // Exit when entering \"exiting\" state (after rendering empty component)\n useEffect(() => {\n if (state === \"exiting\" && pendingResult) {\n exit();\n if (pendingResult.cancelled) {\n onCancel();\n } else {\n onComplete(pendingResult);\n }\n }\n }, [state, pendingResult, exit, onCancel, onComplete]);\n\n // Transition to exiting state with result\n const exitWith = (result: ActionMenuResult) => {\n setPendingResult(result);\n setState(\"exiting\");\n };\n\n // Handle search submission\n const handleSearchSubmit = (selected: Choice<CslItem>[]) => {\n if (selected.length === 0) {\n exitWith({ action: \"cancel\", output: \"\", cancelled: true });\n return;\n }\n setSelectedItems(selected.map((c) => c.value));\n setState(\"action\");\n };\n\n // Handle search cancel\n const handleSearchCancel = () => {\n exitWith({ action: \"cancel\", output: \"\", cancelled: true });\n };\n\n // Handle action selection\n const handleActionSelect = (action: ActionType) => {\n if (action === \"cancel\") {\n exitWith({ action: \"cancel\", output: \"\", cancelled: true });\n return;\n }\n\n // If cite-choose, go to style selection\n if (action === \"cite-choose\") {\n setState(\"style\");\n return;\n }\n\n // Generate output and complete\n const output = generateOutput(action, selectedItems);\n exitWith({ action, output, cancelled: false });\n };\n\n // Handle action cancel (go back to search)\n const handleActionCancel = () => {\n setState(\"search\");\n };\n\n // Handle style selection\n const handleStyleSelect = (style: string) => {\n const output = generateOutput(\"cite-choose\", selectedItems, style);\n exitWith({ action: \"cite-choose\", output, cancelled: false });\n };\n\n // Handle style cancel (go back to action)\n const handleStyleCancel = () => {\n setState(\"action\");\n };\n\n // Render based on current state\n if (state === \"exiting\") {\n // Empty component - Ink will clear the previous content\n return createElement(Box);\n }\n\n if (state === \"search\") {\n return createElement(SearchableMultiSelect<CslItem>, {\n choices,\n filterFn,\n visibleCount,\n onSubmit: handleSearchSubmit,\n onCancel: handleSearchCancel,\n header: \"Search references\",\n placeholder: \"Type to search...\",\n defaultSort,\n });\n }\n\n if (state === \"action\") {\n const count = selectedItems.length;\n const refWord = count === 1 ? \"reference\" : \"references\";\n return createElement(Select<ActionType>, {\n options: ACTION_CHOICES,\n message: `Action for ${count} selected ${refWord}:`,\n onSelect: handleActionSelect,\n onCancel: handleActionCancel,\n });\n }\n\n // state === \"style\"\n return createElement(Select<string>, {\n options: STYLE_CHOICES,\n message: \"Select citation style:\",\n onSelect: handleStyleSelect,\n onCancel: handleStyleCancel,\n });\n}\n","/**\n * Runner for SearchFlowApp\n *\n * Provides the public API for running the search flow.\n */\n\nimport { render } from \"ink\";\nimport { createElement } from \"react\";\nimport type { CslItem } from \"../../../core/csl-json/types.js\";\nimport type { SearchResult } from \"../../search/types.js\";\nimport type { ActionMenuResult } from \"../action-menu.js\";\nimport { restoreStdinAfterInk } from \"../alternate-screen.js\";\nimport type { Choice, SortOption } from \"../components/index.js\";\nimport { formatAuthors } from \"../format.js\";\nimport { SearchFlowApp } from \"./SearchFlowApp.js\";\n\n/**\n * Configuration for the search flow\n */\nexport interface SearchFlowConfig {\n /** Maximum number of results to display */\n limit: number;\n /** Debounce delay in milliseconds (not used, kept for API compatibility) */\n debounceMs: number;\n}\n\n/**\n * Search function type for filtering references\n */\nexport type SearchFunction = (query: string) => SearchResult[];\n\n/**\n * Gets terminal height, falling back to 24 if not available\n */\nfunction getTerminalHeight(): number {\n return process.stdout.rows ?? 24;\n}\n\n/**\n * Calculates the effective limit for the autocomplete list\n */\nfunction calculateEffectiveLimit(configLimit: number): number {\n const terminalHeight = getTerminalHeight();\n // Reserve lines for: header(2) + search box(3) + status(1) + scroll indicators(2) + footer(2) = 10\n const reservedLines = 10;\n const linesPerItem = 3;\n const availableLines = terminalHeight - reservedLines;\n const maxVisibleChoices = Math.max(1, Math.floor(availableLines / linesPerItem));\n return configLimit > 0 ? Math.min(configLimit, maxVisibleChoices) : maxVisibleChoices;\n}\n\n/**\n * Extract year from CSL item\n */\nfunction extractYear(item: CslItem): number | undefined {\n const dateParts = item.issued?.[\"date-parts\"];\n if (!dateParts || dateParts.length === 0) return undefined;\n const firstDatePart = dateParts[0];\n if (!firstDatePart || firstDatePart.length === 0) return undefined;\n return firstDatePart[0];\n}\n\n/**\n * Extract published date from CSL item\n */\nfunction extractPublishedDate(item: CslItem): Date | undefined {\n const dateParts = item.issued?.[\"date-parts\"];\n if (!dateParts || dateParts.length === 0) return undefined;\n const firstDatePart = dateParts[0];\n if (!firstDatePart || firstDatePart.length === 0) return undefined;\n const [year, month = 1, day = 1] = firstDatePart;\n if (year === undefined) return undefined;\n return new Date(year, month - 1, day);\n}\n\n/**\n * Extract updated date from CSL item (from custom.timestamp)\n */\nfunction extractUpdatedDate(item: CslItem): Date | undefined {\n const dateStr = item.custom?.timestamp;\n if (!dateStr || typeof dateStr !== \"string\") return undefined;\n const date = new Date(dateStr);\n return Number.isNaN(date.getTime()) ? undefined : date;\n}\n\n/**\n * Extract created date from CSL item (from custom.created_at)\n */\nfunction extractCreatedDate(item: CslItem): Date | undefined {\n const dateStr = item.custom?.created_at;\n if (!dateStr || typeof dateStr !== \"string\") return undefined;\n const date = new Date(dateStr);\n return Number.isNaN(date.getTime()) ? undefined : date;\n}\n\n/**\n * Format identifiers for meta line\n */\nfunction formatIdentifiers(item: CslItem): string {\n const parts: string[] = [];\n if (item.DOI) parts.push(`DOI: ${item.DOI}`);\n if (item.PMID) parts.push(`PMID: ${item.PMID}`);\n if (item.PMCID) parts.push(`PMCID: ${item.PMCID}`);\n if (item.ISBN) parts.push(`ISBN: ${item.ISBN}`);\n return parts.join(\" · \");\n}\n\n/**\n * Format item type for display\n */\nfunction formatType(type: string): string {\n const typeMap: Record<string, string> = {\n \"article-journal\": \"Journal article\",\n \"article-magazine\": \"Magazine article\",\n \"article-newspaper\": \"Newspaper article\",\n book: \"Book\",\n chapter: \"Book chapter\",\n \"paper-conference\": \"Conference paper\",\n thesis: \"Thesis\",\n report: \"Report\",\n webpage: \"Web page\",\n };\n return typeMap[type] ?? type;\n}\n\n/**\n * Convert CslItem to Choice for SearchableMultiSelect\n */\nfunction toChoice(item: CslItem): Choice<CslItem> {\n const authors = formatAuthors(item.author);\n const year = extractYear(item);\n const identifiers = formatIdentifiers(item);\n const itemType = formatType(item.type);\n\n // Build meta line: Year · Type · Identifiers\n const metaParts: string[] = [];\n if (year) metaParts.push(String(year));\n metaParts.push(itemType);\n if (identifiers) metaParts.push(identifiers);\n\n const updatedDate = extractUpdatedDate(item);\n const createdDate = extractCreatedDate(item);\n const publishedDate = extractPublishedDate(item);\n\n return {\n id: item.id,\n title: item.title ?? \"(No title)\",\n subtitle: authors || \"(No authors)\",\n meta: metaParts.join(\" · \"),\n value: item,\n ...(updatedDate && { updatedDate }),\n ...(createdDate && { createdDate }),\n ...(publishedDate && { publishedDate }),\n };\n}\n\n/**\n * Run the search flow (search → action → style if needed)\n *\n * This is the main entry point for the `search -t` command.\n */\nexport async function runSearchFlow(\n allReferences: CslItem[],\n searchFn: SearchFunction,\n config: SearchFlowConfig\n): Promise<ActionMenuResult> {\n // Convert references to choices\n const choices = allReferences.map(toChoice);\n\n // Calculate effective visible count\n const effectiveLimit = calculateEffectiveLimit(config.limit);\n\n // Create filter function using the provided search function\n const filterFn = (query: string, choices: Choice<CslItem>[]): Choice<CslItem>[] => {\n if (!query.trim()) return choices;\n\n const results = searchFn(query);\n return results.map((r) => toChoice(r.reference));\n };\n\n // Default sort option\n const defaultSort: SortOption = \"updated-desc\";\n\n // Create a promise to capture the result\n return new Promise<ActionMenuResult>((resolve) => {\n let flowResult: ActionMenuResult = {\n action: \"cancel\",\n output: \"\",\n cancelled: true,\n };\n\n const handleComplete = (result: ActionMenuResult): void => {\n flowResult = result;\n };\n\n const handleCancel = (): void => {\n flowResult = {\n action: \"cancel\",\n output: \"\",\n cancelled: true,\n };\n };\n\n // Render the Ink app (single render for entire flow)\n const { waitUntilExit } = render(\n createElement(SearchFlowApp, {\n choices,\n filterFn,\n visibleCount: effectiveLimit,\n defaultSort,\n onComplete: handleComplete,\n onCancel: handleCancel,\n })\n );\n\n // Wait for the app to exit, then resolve\n waitUntilExit()\n .then(() => {\n restoreStdinAfterInk();\n resolve(flowResult);\n })\n .catch(() => {\n restoreStdinAfterInk();\n resolve({\n action: \"cancel\",\n output: \"\",\n cancelled: true,\n });\n });\n });\n}\n","/**\n * CiteFlowApp - Single App for cite command flow\n *\n * Implements the Single App Pattern (ADR-015) for the cite command.\n * Manages state transitions: reference selection → style selection → exiting\n */\n\nimport { Box, useApp } from \"ink\";\nimport type React from \"react\";\nimport { createElement, useEffect, useState } from \"react\";\nimport type { CslItem } from \"../../../core/csl-json/types.js\";\nimport { SearchableMultiSelect } from \"../components/SearchableMultiSelect.js\";\nimport { Select, type SelectOption } from \"../components/Select.js\";\nimport type { Choice, SortOption } from \"../components/index.js\";\n\n// Flow states\ntype FlowState = \"search\" | \"style\" | \"exiting\";\n\n/**\n * Result from the cite flow\n */\nexport interface CiteFlowResult {\n /** Selected reference IDs */\n identifiers: string[];\n /** Selected style (if style selection was shown) */\n style?: string;\n /** Whether the flow was cancelled */\n cancelled: boolean;\n}\n\n/**\n * Props for CiteFlowApp\n */\nexport interface CiteFlowAppProps {\n /** All reference choices */\n choices: Choice<CslItem>[];\n /** Filter function for search */\n filterFn: (query: string, choices: Choice<CslItem>[]) => Choice<CslItem>[];\n /** Number of visible items */\n visibleCount: number;\n /** Default sort option */\n defaultSort: SortOption;\n /** Style options for style selection */\n styleOptions: SelectOption<string>[];\n /** Whether to show style selection (false if style already specified) */\n showStyleSelect: boolean;\n /** Callback when flow completes */\n onComplete: (result: CiteFlowResult) => void;\n /** Callback when flow is cancelled */\n onCancel: () => void;\n}\n\n/**\n * CiteFlowApp component\n *\n * Single Ink app that handles the entire cite flow:\n * 1. Reference selection (SearchableMultiSelect)\n * 2. Style selection (Select) - optional\n * 3. Exit\n */\nexport function CiteFlowApp({\n choices,\n filterFn,\n visibleCount,\n defaultSort,\n styleOptions,\n showStyleSelect,\n onComplete,\n onCancel,\n}: CiteFlowAppProps): React.ReactElement {\n const { exit } = useApp();\n const [state, setState] = useState<FlowState>(\"search\");\n const [selectedItems, setSelectedItems] = useState<CslItem[]>([]);\n const [pendingResult, setPendingResult] = useState<CiteFlowResult | null>(null);\n\n // Exit when entering \"exiting\" state\n useEffect(() => {\n if (state === \"exiting\" && pendingResult) {\n exit();\n if (pendingResult.cancelled) {\n onCancel();\n } else {\n onComplete(pendingResult);\n }\n }\n }, [state, pendingResult, exit, onCancel, onComplete]);\n\n // Transition to exiting state with result\n const exitWith = (result: CiteFlowResult) => {\n setPendingResult(result);\n setState(\"exiting\");\n };\n\n // Handle search submission\n const handleSearchSubmit = (selected: Choice<CslItem>[]) => {\n if (selected.length === 0) {\n exitWith({ identifiers: [], cancelled: true });\n return;\n }\n const items = selected.map((c) => c.value);\n setSelectedItems(items);\n\n if (showStyleSelect) {\n setState(\"style\");\n } else {\n // No style selection needed, complete immediately\n exitWith({\n identifiers: items.map((item) => item.id),\n cancelled: false,\n });\n }\n };\n\n // Handle search cancel\n const handleSearchCancel = () => {\n exitWith({ identifiers: [], cancelled: true });\n };\n\n // Handle style selection\n const handleStyleSelect = (style: string) => {\n exitWith({\n identifiers: selectedItems.map((item) => item.id),\n style,\n cancelled: false,\n });\n };\n\n // Handle style cancel (go back to search)\n const handleStyleCancel = () => {\n setState(\"search\");\n };\n\n // Render based on current state\n if (state === \"exiting\") {\n return createElement(Box);\n }\n\n if (state === \"search\") {\n return createElement(SearchableMultiSelect<CslItem>, {\n choices,\n filterFn,\n visibleCount,\n onSubmit: handleSearchSubmit,\n onCancel: handleSearchCancel,\n header: \"Select references to cite\",\n placeholder: \"Type to search...\",\n defaultSort,\n });\n }\n\n // state === \"style\"\n const count = selectedItems.length;\n const refWord = count === 1 ? \"reference\" : \"references\";\n return createElement(Select<string>, {\n options: styleOptions,\n message: `Select citation style for ${count} ${refWord}:`,\n onSelect: handleStyleSelect,\n onCancel: handleStyleCancel,\n });\n}\n","/**\n * Runner for CiteFlowApp\n *\n * Provides the public API for running the cite flow.\n */\n\nimport { render } from \"ink\";\nimport { createElement } from \"react\";\nimport type { CslItem } from \"../../../core/csl-json/types.js\";\nimport type { SearchResult } from \"../../search/types.js\";\nimport { restoreStdinAfterInk } from \"../alternate-screen.js\";\nimport type { Choice, SelectOption, SortOption } from \"../components/index.js\";\nimport { formatAuthors } from \"../format.js\";\nimport { CiteFlowApp, type CiteFlowResult } from \"./CiteFlowApp.js\";\n\n/**\n * Configuration for the cite flow\n */\nexport interface CiteFlowConfig {\n /** Maximum number of results to display */\n limit: number;\n}\n\n/**\n * Search function type for filtering references\n */\nexport type SearchFunction = (query: string) => SearchResult[];\n\n/**\n * Gets terminal height, falling back to 24 if not available\n */\nfunction getTerminalHeight(): number {\n return process.stdout.rows ?? 24;\n}\n\n/**\n * Calculates the effective limit for the autocomplete list\n */\nfunction calculateEffectiveLimit(configLimit: number): number {\n const terminalHeight = getTerminalHeight();\n // Reserve lines for: header(2) + search box(3) + status(1) + scroll indicators(2) + footer(2) = 10\n const reservedLines = 10;\n const linesPerItem = 3;\n const availableLines = terminalHeight - reservedLines;\n const maxVisibleChoices = Math.max(1, Math.floor(availableLines / linesPerItem));\n return configLimit > 0 ? Math.min(configLimit, maxVisibleChoices) : maxVisibleChoices;\n}\n\n/**\n * Extract year from CSL item\n */\nfunction extractYear(item: CslItem): number | undefined {\n const dateParts = item.issued?.[\"date-parts\"];\n if (!dateParts || dateParts.length === 0) return undefined;\n const firstDatePart = dateParts[0];\n if (!firstDatePart || firstDatePart.length === 0) return undefined;\n return firstDatePart[0];\n}\n\n/**\n * Extract published date from CSL item\n */\nfunction extractPublishedDate(item: CslItem): Date | undefined {\n const dateParts = item.issued?.[\"date-parts\"];\n if (!dateParts || dateParts.length === 0) return undefined;\n const firstDatePart = dateParts[0];\n if (!firstDatePart || firstDatePart.length === 0) return undefined;\n const [year, month = 1, day = 1] = firstDatePart;\n if (year === undefined) return undefined;\n return new Date(year, month - 1, day);\n}\n\n/**\n * Extract updated date from CSL item (from custom.timestamp)\n */\nfunction extractUpdatedDate(item: CslItem): Date | undefined {\n const dateStr = item.custom?.timestamp;\n if (!dateStr || typeof dateStr !== \"string\") return undefined;\n const date = new Date(dateStr);\n return Number.isNaN(date.getTime()) ? undefined : date;\n}\n\n/**\n * Extract created date from CSL item (from custom.created_at)\n */\nfunction extractCreatedDate(item: CslItem): Date | undefined {\n const dateStr = item.custom?.created_at;\n if (!dateStr || typeof dateStr !== \"string\") return undefined;\n const date = new Date(dateStr);\n return Number.isNaN(date.getTime()) ? undefined : date;\n}\n\n/**\n * Format identifiers for meta line\n */\nfunction formatIdentifiers(item: CslItem): string {\n const parts: string[] = [];\n if (item.DOI) parts.push(`DOI: ${item.DOI}`);\n if (item.PMID) parts.push(`PMID: ${item.PMID}`);\n if (item.PMCID) parts.push(`PMCID: ${item.PMCID}`);\n if (item.ISBN) parts.push(`ISBN: ${item.ISBN}`);\n return parts.join(\" · \");\n}\n\n/**\n * Format item type for display\n */\nfunction formatType(type: string): string {\n const typeMap: Record<string, string> = {\n \"article-journal\": \"Journal article\",\n \"article-magazine\": \"Magazine article\",\n \"article-newspaper\": \"Newspaper article\",\n book: \"Book\",\n chapter: \"Book chapter\",\n \"paper-conference\": \"Conference paper\",\n thesis: \"Thesis\",\n report: \"Report\",\n webpage: \"Web page\",\n };\n return typeMap[type] ?? type;\n}\n\n/**\n * Convert CslItem to Choice for SearchableMultiSelect\n */\nfunction toChoice(item: CslItem): Choice<CslItem> {\n const authors = formatAuthors(item.author);\n const year = extractYear(item);\n const identifiers = formatIdentifiers(item);\n const itemType = formatType(item.type);\n\n // Build meta line: Year · Type · Identifiers\n const metaParts: string[] = [];\n if (year) metaParts.push(String(year));\n metaParts.push(itemType);\n if (identifiers) metaParts.push(identifiers);\n\n const updatedDate = extractUpdatedDate(item);\n const createdDate = extractCreatedDate(item);\n const publishedDate = extractPublishedDate(item);\n\n return {\n id: item.id,\n title: item.title ?? \"(No title)\",\n subtitle: authors || \"(No authors)\",\n meta: metaParts.join(\" · \"),\n value: item,\n ...(updatedDate && { updatedDate }),\n ...(createdDate && { createdDate }),\n ...(publishedDate && { publishedDate }),\n };\n}\n\n/**\n * Options for running the cite flow\n */\nexport interface RunCiteFlowOptions {\n /** All references available for selection */\n allReferences: CslItem[];\n /** Search function for filtering */\n searchFn: SearchFunction;\n /** Flow configuration */\n config: CiteFlowConfig;\n /** Style options for style selection */\n styleOptions: SelectOption<string>[];\n /** Whether to show style selection */\n showStyleSelect: boolean;\n}\n\n/**\n * Run the cite flow (reference selection → style selection if needed)\n *\n * This is the main entry point for interactive cite command.\n */\nexport async function runCiteFlow(options: RunCiteFlowOptions): Promise<CiteFlowResult> {\n const { allReferences, searchFn, config, styleOptions, showStyleSelect } = options;\n\n // Convert references to choices\n const choices = allReferences.map(toChoice);\n\n // Calculate effective visible count\n const effectiveLimit = calculateEffectiveLimit(config.limit);\n\n // Create filter function using the provided search function\n const filterFn = (query: string, choices: Choice<CslItem>[]): Choice<CslItem>[] => {\n if (!query.trim()) return choices;\n\n const results = searchFn(query);\n return results.map((r) => toChoice(r.reference));\n };\n\n // Default sort option\n const defaultSort: SortOption = \"updated-desc\";\n\n // Create a promise to capture the result\n return new Promise<CiteFlowResult>((resolve) => {\n let flowResult: CiteFlowResult = {\n identifiers: [],\n cancelled: true,\n };\n\n const handleComplete = (result: CiteFlowResult): void => {\n flowResult = result;\n };\n\n const handleCancel = (): void => {\n flowResult = {\n identifiers: [],\n cancelled: true,\n };\n };\n\n // Render the Ink app (single render for entire flow)\n const { waitUntilExit } = render(\n createElement(CiteFlowApp, {\n choices,\n filterFn,\n visibleCount: effectiveLimit,\n defaultSort,\n styleOptions,\n showStyleSelect,\n onComplete: handleComplete,\n onCancel: handleCancel,\n })\n );\n\n // Wait for the app to exit, then resolve\n waitUntilExit()\n .then(() => {\n restoreStdinAfterInk();\n resolve(flowResult);\n })\n .catch(() => {\n restoreStdinAfterInk();\n resolve({\n identifiers: [],\n cancelled: true,\n });\n });\n });\n}\n"],"names":["jsxs","jsx","getTerminalHeight","calculateEffectiveLimit","extractYear","extractPublishedDate","extractUpdatedDate","extractCreatedDate","formatIdentifiers","formatType","toChoice","choices"],"mappings":";;;;;;;AA8BO,SAAS,OAAmB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AACjB,GAAuC;AACrC,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,YAAY;AACzD,QAAM,EAAE,UAAA,IAAc,SAAS,EAAE,WAAW,MAAM;AAElD;AAAA,IACE,CAAC,OAAO,QAAQ;AAEd,UAAI,IAAI,QAAQ;AACd,iBAAA;AACA;AAAA,MACF;AAGA,UAAI,IAAI,QAAQ;AACd,cAAM,WAAW,QAAQ,UAAU;AACnC,YAAI,UAAU;AACZ,mBAAS,SAAS,KAAK;AAAA,QACzB;AACA;AAAA,MACF;AAGA,UAAI,IAAI,WAAW,UAAU,KAAK;AAChC,sBAAc,CAAC,SAAS,KAAK,IAAI,GAAG,OAAO,CAAC,CAAC;AAC7C;AAAA,MACF;AAGA,UAAI,IAAI,aAAa,UAAU,KAAK;AAClC,sBAAc,CAAC,SAAS,KAAK,IAAI,QAAQ,SAAS,GAAG,OAAO,CAAC,CAAC;AAC9D;AA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,cAA0B;AAGhC,SAAO,IAAI,QAAwB,CAAC,YAAY;AAC9C,QAAI,aAA6B;AAAA,MAC/B,aAAa,CAAA;AAAA,MACb,WAAW;AAAA,IAAA;AAGb,UAAM,iBAAiB,CAAC,WAAiC;AACvD,mBAAa;AAAA,IACf;AAEA,UAAM,eAAe,MAAY;AAC/B,mBAAa;AAAA,QACX,aAAa,CAAA;AAAA,QACb,WAAW;AAAA,MAAA;AAAA,IAEf;AAGA,UAAM,EAAE,kBAAkB;AAAA,MACxB,cAAc,aAAa;AAAA,QACzB;AAAA,QACA;AAAA,QACA,cAAc;AAAA,QACd;AAAA,QACA;AAAA,QACA;AAAA,QACA,YAAY;AAAA,QACZ,UAAU;AAAA,MAAA,CACX;AAAA,IAAA;AAIH,kBAAA,EACG,KAAK,MAAM;AACV,2BAAA;AACA,cAAQ,UAAU;AAAA,IACpB,CAAC,EACA,MAAM,MAAM;AACX,2BAAA;AACA,cAAQ;AAAA,QACN,aAAa,CAAA;AAAA,QACb,WAAW;AAAA,MAAA,CACZ;AAAA,IACH,CAAC;AAAA,EACL,CAAC;AACH;"}
|
|
@@ -1,322 +0,0 @@
|
|
|
1
|
-
import require$$0 from "react";
|
|
2
|
-
var jsxRuntime = { exports: {} };
|
|
3
|
-
var reactJsxRuntime_production = {};
|
|
4
|
-
/**
|
|
5
|
-
* @license React
|
|
6
|
-
* react-jsx-runtime.production.js
|
|
7
|
-
*
|
|
8
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
9
|
-
*
|
|
10
|
-
* This source code is licensed under the MIT license found in the
|
|
11
|
-
* LICENSE file in the root directory of this source tree.
|
|
12
|
-
*/
|
|
13
|
-
var hasRequiredReactJsxRuntime_production;
|
|
14
|
-
function requireReactJsxRuntime_production() {
|
|
15
|
-
if (hasRequiredReactJsxRuntime_production) return reactJsxRuntime_production;
|
|
16
|
-
hasRequiredReactJsxRuntime_production = 1;
|
|
17
|
-
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
18
|
-
function jsxProd(type, config, maybeKey) {
|
|
19
|
-
var key = null;
|
|
20
|
-
void 0 !== maybeKey && (key = "" + maybeKey);
|
|
21
|
-
void 0 !== config.key && (key = "" + config.key);
|
|
22
|
-
if ("key" in config) {
|
|
23
|
-
maybeKey = {};
|
|
24
|
-
for (var propName in config)
|
|
25
|
-
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
26
|
-
} else maybeKey = config;
|
|
27
|
-
config = maybeKey.ref;
|
|
28
|
-
return {
|
|
29
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
30
|
-
type,
|
|
31
|
-
key,
|
|
32
|
-
ref: void 0 !== config ? config : null,
|
|
33
|
-
props: maybeKey
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE;
|
|
37
|
-
reactJsxRuntime_production.jsx = jsxProd;
|
|
38
|
-
reactJsxRuntime_production.jsxs = jsxProd;
|
|
39
|
-
return reactJsxRuntime_production;
|
|
40
|
-
}
|
|
41
|
-
var reactJsxRuntime_development = {};
|
|
42
|
-
/**
|
|
43
|
-
* @license React
|
|
44
|
-
* react-jsx-runtime.development.js
|
|
45
|
-
*
|
|
46
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
47
|
-
*
|
|
48
|
-
* This source code is licensed under the MIT license found in the
|
|
49
|
-
* LICENSE file in the root directory of this source tree.
|
|
50
|
-
*/
|
|
51
|
-
var hasRequiredReactJsxRuntime_development;
|
|
52
|
-
function requireReactJsxRuntime_development() {
|
|
53
|
-
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
|
|
54
|
-
hasRequiredReactJsxRuntime_development = 1;
|
|
55
|
-
"production" !== process.env.NODE_ENV && (function() {
|
|
56
|
-
function getComponentNameFromType(type) {
|
|
57
|
-
if (null == type) return null;
|
|
58
|
-
if ("function" === typeof type)
|
|
59
|
-
return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
|
60
|
-
if ("string" === typeof type) return type;
|
|
61
|
-
switch (type) {
|
|
62
|
-
case REACT_FRAGMENT_TYPE:
|
|
63
|
-
return "Fragment";
|
|
64
|
-
case REACT_PROFILER_TYPE:
|
|
65
|
-
return "Profiler";
|
|
66
|
-
case REACT_STRICT_MODE_TYPE:
|
|
67
|
-
return "StrictMode";
|
|
68
|
-
case REACT_SUSPENSE_TYPE:
|
|
69
|
-
return "Suspense";
|
|
70
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
71
|
-
return "SuspenseList";
|
|
72
|
-
case REACT_ACTIVITY_TYPE:
|
|
73
|
-
return "Activity";
|
|
74
|
-
}
|
|
75
|
-
if ("object" === typeof type)
|
|
76
|
-
switch ("number" === typeof type.tag && console.error(
|
|
77
|
-
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
78
|
-
), type.$$typeof) {
|
|
79
|
-
case REACT_PORTAL_TYPE:
|
|
80
|
-
return "Portal";
|
|
81
|
-
case REACT_CONTEXT_TYPE:
|
|
82
|
-
return type.displayName || "Context";
|
|
83
|
-
case REACT_CONSUMER_TYPE:
|
|
84
|
-
return (type._context.displayName || "Context") + ".Consumer";
|
|
85
|
-
case REACT_FORWARD_REF_TYPE:
|
|
86
|
-
var innerType = type.render;
|
|
87
|
-
type = type.displayName;
|
|
88
|
-
type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
|
|
89
|
-
return type;
|
|
90
|
-
case REACT_MEMO_TYPE:
|
|
91
|
-
return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
|
|
92
|
-
case REACT_LAZY_TYPE:
|
|
93
|
-
innerType = type._payload;
|
|
94
|
-
type = type._init;
|
|
95
|
-
try {
|
|
96
|
-
return getComponentNameFromType(type(innerType));
|
|
97
|
-
} catch (x) {
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
return null;
|
|
101
|
-
}
|
|
102
|
-
function testStringCoercion(value) {
|
|
103
|
-
return "" + value;
|
|
104
|
-
}
|
|
105
|
-
function checkKeyStringCoercion(value) {
|
|
106
|
-
try {
|
|
107
|
-
testStringCoercion(value);
|
|
108
|
-
var JSCompiler_inline_result = false;
|
|
109
|
-
} catch (e) {
|
|
110
|
-
JSCompiler_inline_result = true;
|
|
111
|
-
}
|
|
112
|
-
if (JSCompiler_inline_result) {
|
|
113
|
-
JSCompiler_inline_result = console;
|
|
114
|
-
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
|
115
|
-
var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
|
116
|
-
JSCompiler_temp_const.call(
|
|
117
|
-
JSCompiler_inline_result,
|
|
118
|
-
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
119
|
-
JSCompiler_inline_result$jscomp$0
|
|
120
|
-
);
|
|
121
|
-
return testStringCoercion(value);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
function getTaskName(type) {
|
|
125
|
-
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
|
126
|
-
if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
|
|
127
|
-
return "<...>";
|
|
128
|
-
try {
|
|
129
|
-
var name = getComponentNameFromType(type);
|
|
130
|
-
return name ? "<" + name + ">" : "<...>";
|
|
131
|
-
} catch (x) {
|
|
132
|
-
return "<...>";
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
function getOwner() {
|
|
136
|
-
var dispatcher = ReactSharedInternals.A;
|
|
137
|
-
return null === dispatcher ? null : dispatcher.getOwner();
|
|
138
|
-
}
|
|
139
|
-
function UnknownOwner() {
|
|
140
|
-
return Error("react-stack-top-frame");
|
|
141
|
-
}
|
|
142
|
-
function hasValidKey(config) {
|
|
143
|
-
if (hasOwnProperty.call(config, "key")) {
|
|
144
|
-
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
145
|
-
if (getter && getter.isReactWarning) return false;
|
|
146
|
-
}
|
|
147
|
-
return void 0 !== config.key;
|
|
148
|
-
}
|
|
149
|
-
function defineKeyPropWarningGetter(props, displayName) {
|
|
150
|
-
function warnAboutAccessingKey() {
|
|
151
|
-
specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
|
|
152
|
-
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
153
|
-
displayName
|
|
154
|
-
));
|
|
155
|
-
}
|
|
156
|
-
warnAboutAccessingKey.isReactWarning = true;
|
|
157
|
-
Object.defineProperty(props, "key", {
|
|
158
|
-
get: warnAboutAccessingKey,
|
|
159
|
-
configurable: true
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
function elementRefGetterWithDeprecationWarning() {
|
|
163
|
-
var componentName = getComponentNameFromType(this.type);
|
|
164
|
-
didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
|
|
165
|
-
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
166
|
-
));
|
|
167
|
-
componentName = this.props.ref;
|
|
168
|
-
return void 0 !== componentName ? componentName : null;
|
|
169
|
-
}
|
|
170
|
-
function ReactElement(type, key, props, owner, debugStack, debugTask) {
|
|
171
|
-
var refProp = props.ref;
|
|
172
|
-
type = {
|
|
173
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
174
|
-
type,
|
|
175
|
-
key,
|
|
176
|
-
props,
|
|
177
|
-
_owner: owner
|
|
178
|
-
};
|
|
179
|
-
null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
|
|
180
|
-
enumerable: false,
|
|
181
|
-
get: elementRefGetterWithDeprecationWarning
|
|
182
|
-
}) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
|
183
|
-
type._store = {};
|
|
184
|
-
Object.defineProperty(type._store, "validated", {
|
|
185
|
-
configurable: false,
|
|
186
|
-
enumerable: false,
|
|
187
|
-
writable: true,
|
|
188
|
-
value: 0
|
|
189
|
-
});
|
|
190
|
-
Object.defineProperty(type, "_debugInfo", {
|
|
191
|
-
configurable: false,
|
|
192
|
-
enumerable: false,
|
|
193
|
-
writable: true,
|
|
194
|
-
value: null
|
|
195
|
-
});
|
|
196
|
-
Object.defineProperty(type, "_debugStack", {
|
|
197
|
-
configurable: false,
|
|
198
|
-
enumerable: false,
|
|
199
|
-
writable: true,
|
|
200
|
-
value: debugStack
|
|
201
|
-
});
|
|
202
|
-
Object.defineProperty(type, "_debugTask", {
|
|
203
|
-
configurable: false,
|
|
204
|
-
enumerable: false,
|
|
205
|
-
writable: true,
|
|
206
|
-
value: debugTask
|
|
207
|
-
});
|
|
208
|
-
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
|
209
|
-
return type;
|
|
210
|
-
}
|
|
211
|
-
function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) {
|
|
212
|
-
var children = config.children;
|
|
213
|
-
if (void 0 !== children)
|
|
214
|
-
if (isStaticChildren)
|
|
215
|
-
if (isArrayImpl(children)) {
|
|
216
|
-
for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++)
|
|
217
|
-
validateChildKeys(children[isStaticChildren]);
|
|
218
|
-
Object.freeze && Object.freeze(children);
|
|
219
|
-
} else
|
|
220
|
-
console.error(
|
|
221
|
-
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
222
|
-
);
|
|
223
|
-
else validateChildKeys(children);
|
|
224
|
-
if (hasOwnProperty.call(config, "key")) {
|
|
225
|
-
children = getComponentNameFromType(type);
|
|
226
|
-
var keys = Object.keys(config).filter(function(k) {
|
|
227
|
-
return "key" !== k;
|
|
228
|
-
});
|
|
229
|
-
isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
230
|
-
didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
231
|
-
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
|
|
232
|
-
isStaticChildren,
|
|
233
|
-
children,
|
|
234
|
-
keys,
|
|
235
|
-
children
|
|
236
|
-
), didWarnAboutKeySpread[children + isStaticChildren] = true);
|
|
237
|
-
}
|
|
238
|
-
children = null;
|
|
239
|
-
void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
|
|
240
|
-
hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
|
|
241
|
-
if ("key" in config) {
|
|
242
|
-
maybeKey = {};
|
|
243
|
-
for (var propName in config)
|
|
244
|
-
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
245
|
-
} else maybeKey = config;
|
|
246
|
-
children && defineKeyPropWarningGetter(
|
|
247
|
-
maybeKey,
|
|
248
|
-
"function" === typeof type ? type.displayName || type.name || "Unknown" : type
|
|
249
|
-
);
|
|
250
|
-
return ReactElement(
|
|
251
|
-
type,
|
|
252
|
-
children,
|
|
253
|
-
maybeKey,
|
|
254
|
-
getOwner(),
|
|
255
|
-
debugStack,
|
|
256
|
-
debugTask
|
|
257
|
-
);
|
|
258
|
-
}
|
|
259
|
-
function validateChildKeys(node) {
|
|
260
|
-
isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
|
|
261
|
-
}
|
|
262
|
-
function isValidElement(object) {
|
|
263
|
-
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
264
|
-
}
|
|
265
|
-
var React = require$$0, REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
|
|
266
|
-
return null;
|
|
267
|
-
};
|
|
268
|
-
React = {
|
|
269
|
-
react_stack_bottom_frame: function(callStackForError) {
|
|
270
|
-
return callStackForError();
|
|
271
|
-
}
|
|
272
|
-
};
|
|
273
|
-
var specialPropKeyWarningShown;
|
|
274
|
-
var didWarnAboutElementRef = {};
|
|
275
|
-
var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(
|
|
276
|
-
React,
|
|
277
|
-
UnknownOwner
|
|
278
|
-
)();
|
|
279
|
-
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
280
|
-
var didWarnAboutKeySpread = {};
|
|
281
|
-
reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
|
|
282
|
-
reactJsxRuntime_development.jsx = function(type, config, maybeKey) {
|
|
283
|
-
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
284
|
-
return jsxDEVImpl(
|
|
285
|
-
type,
|
|
286
|
-
config,
|
|
287
|
-
maybeKey,
|
|
288
|
-
false,
|
|
289
|
-
trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
|
290
|
-
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
291
|
-
);
|
|
292
|
-
};
|
|
293
|
-
reactJsxRuntime_development.jsxs = function(type, config, maybeKey) {
|
|
294
|
-
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
295
|
-
return jsxDEVImpl(
|
|
296
|
-
type,
|
|
297
|
-
config,
|
|
298
|
-
maybeKey,
|
|
299
|
-
true,
|
|
300
|
-
trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
|
301
|
-
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
302
|
-
);
|
|
303
|
-
};
|
|
304
|
-
})();
|
|
305
|
-
return reactJsxRuntime_development;
|
|
306
|
-
}
|
|
307
|
-
var hasRequiredJsxRuntime;
|
|
308
|
-
function requireJsxRuntime() {
|
|
309
|
-
if (hasRequiredJsxRuntime) return jsxRuntime.exports;
|
|
310
|
-
hasRequiredJsxRuntime = 1;
|
|
311
|
-
if (process.env.NODE_ENV === "production") {
|
|
312
|
-
jsxRuntime.exports = requireReactJsxRuntime_production();
|
|
313
|
-
} else {
|
|
314
|
-
jsxRuntime.exports = requireReactJsxRuntime_development();
|
|
315
|
-
}
|
|
316
|
-
return jsxRuntime.exports;
|
|
317
|
-
}
|
|
318
|
-
var jsxRuntimeExports = requireJsxRuntime();
|
|
319
|
-
export {
|
|
320
|
-
jsxRuntimeExports as j
|
|
321
|
-
};
|
|
322
|
-
//# sourceMappingURL=jsx-runtime-Q5cUjSur.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsx-runtime-Q5cUjSur.js","sources":["../../node_modules/react/cjs/react-jsx-runtime.production.js","../../node_modules/react/cjs/react-jsx-runtime.development.js","../../node_modules/react/jsx-runtime.js"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n"],"names":["jsxRuntimeModule","require$$0","require$$1"],"mappings":";;;;;;;;;;;;;;;;AAWA,MAAI,qBAAqB,OAAO,IAAI,4BAA4B,GAC9D,sBAAsB,OAAO,IAAI,gBAAgB;AACnD,WAAS,QAAQ,MAAM,QAAQ,UAAU;AACvC,QAAI,MAAM;AACV,eAAW,aAAa,MAAM,KAAK;AACnC,eAAW,OAAO,QAAQ,MAAM,KAAK,OAAO;AAC5C,QAAI,SAAS,QAAQ;AACnB,iBAAW,CAAA;AACX,eAAS,YAAY;AACnB,kBAAU,aAAa,SAAS,QAAQ,IAAI,OAAO,QAAQ;AAAA,IACjE,MAAS,YAAW;AAClB,aAAS,SAAS;AAClB,WAAO;AAAA,MACL,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA,KAAK,W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AA,WAAmB;AACnB,gCAAA,MAAc,SAAU,MAAM,QAAQ,UAAU;AAC9C,UAAI,mBACF,MAAM,qBAAqB;AAC7B,aAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,mBACI,MAAM,uBAAuB,IAC7B;AAAA,QACJ,mBAAmB,WAAW,YAAY,IAAI,CAAC,IAAI;AAAA;IAE3D;AACI,gCAAA,OAAe,SAAU,MAAM,QAAQ,UAAU;AAC/C,UAAI,mBACF,MAAM,qBAAqB;AAC7B,aAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,mBACI,MAAM,uBAAuB,IAC7B;AAAA,QACJ,mBAAmB,WAAW,YAAY,IAAI,CAAC,IAAI;AAAA;IAE3D;AAAA,EACA,GAAG;;;;;;;AC7VH,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzCA,eAAA,UAAiBC,kCAAA;AAAA,EACnB,OAAO;AACLD,eAAA,UAAiBE,mCAAA;AAAA,EACnB;;;;","x_google_ignoreList":[0,1,2]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reference-select-CgM-RBIa.js","sources":["../../src/features/interactive/search-prompt.ts","../../src/features/interactive/reference-select.ts"],"sourcesContent":["/**\n * Interactive search prompt using React Ink\n *\n * Provides real-time incremental search with multiple selection support.\n */\n\nimport { render, useApp } from \"ink\";\nimport type React from \"react\";\nimport { createElement } from \"react\";\nimport type { CslItem } from \"../../core/csl-json/types.js\";\nimport type { SearchResult } from \"../search/types.js\";\nimport { restoreStdinAfterInk } from \"./alternate-screen.js\";\nimport { type Choice, SearchableMultiSelect, type SortOption } from \"./components/index.js\";\nimport { formatAuthors } from \"./format.js\";\n\n/**\n * Configuration for the search prompt\n */\nexport interface SearchPromptConfig {\n /** Maximum number of results to display */\n limit: number;\n /** Debounce delay in milliseconds (not used in Ink version, kept for API compatibility) */\n debounceMs: number;\n}\n\n/**\n * Search function type for filtering references\n */\nexport type SearchFunction = (query: string) => SearchResult[];\n\n/**\n * Result from the search prompt\n */\nexport interface SearchPromptResult {\n /** Selected references */\n selected: CslItem[];\n /** Whether the prompt was cancelled */\n cancelled: boolean;\n}\n\n/**\n * Gets terminal width, falling back to 80 if not available\n */\nexport function getTerminalWidth(): number {\n return process.stdout.columns ?? 80;\n}\n\n/**\n * Gets terminal height, falling back to 24 if not available\n */\nexport function getTerminalHeight(): number {\n return process.stdout.rows ?? 24;\n}\n\n/**\n * Calculates the effective limit for the autocomplete list\n * based on terminal height to prevent input field from being hidden.\n * Reserves space for: prompt header (1), input line (1), footer hint (1), and padding (2)\n * Each item displays up to 3 lines (author/year, title, identifiers)\n */\nexport function calculateEffectiveLimit(configLimit: number): number {\n const terminalHeight = getTerminalHeight();\n // Reserve lines for: header(2) + search box(3) + status(1) + scroll indicators(2) + footer(2) = 10\n const reservedLines = 10;\n const linesPerItem = 3; // each search result shows up to 3 lines\n const availableLines = terminalHeight - reservedLines;\n const maxVisibleChoices = Math.max(1, Math.floor(availableLines / linesPerItem));\n return configLimit > 0 ? Math.min(configLimit, maxVisibleChoices) : maxVisibleChoices;\n}\n\n/**\n * Extract year from CSL item\n */\nfunction extractYear(item: CslItem): number | undefined {\n const dateParts = item.issued?.[\"date-parts\"];\n if (!dateParts || dateParts.length === 0) return undefined;\n const firstDatePart = dateParts[0];\n if (!firstDatePart || firstDatePart.length === 0) return undefined;\n return firstDatePart[0];\n}\n\n/**\n * Extract published date from CSL item\n */\nfunction extractPublishedDate(item: CslItem): Date | undefined {\n const dateParts = item.issued?.[\"date-parts\"];\n if (!dateParts || dateParts.length === 0) return undefined;\n const firstDatePart = dateParts[0];\n if (!firstDatePart || firstDatePart.length === 0) return undefined;\n const [year, month = 1, day = 1] = firstDatePart;\n if (year === undefined) return undefined;\n return new Date(year, month - 1, day);\n}\n\n/**\n * Extract updated date from CSL item (from custom.timestamp)\n */\nfunction extractUpdatedDate(item: CslItem): Date | undefined {\n const dateStr = item.custom?.timestamp;\n if (!dateStr || typeof dateStr !== \"string\") return undefined;\n const date = new Date(dateStr);\n return Number.isNaN(date.getTime()) ? undefined : date;\n}\n\n/**\n * Extract created date from CSL item (from custom.created_at)\n */\nfunction extractCreatedDate(item: CslItem): Date | undefined {\n const dateStr = item.custom?.created_at;\n if (!dateStr || typeof dateStr !== \"string\") return undefined;\n const date = new Date(dateStr);\n return Number.isNaN(date.getTime()) ? undefined : date;\n}\n\n/**\n * Format identifiers for meta line\n */\nfunction formatIdentifiers(item: CslItem): string {\n const parts: string[] = [];\n if (item.DOI) parts.push(`DOI: ${item.DOI}`);\n if (item.PMID) parts.push(`PMID: ${item.PMID}`);\n if (item.PMCID) parts.push(`PMCID: ${item.PMCID}`);\n if (item.ISBN) parts.push(`ISBN: ${item.ISBN}`);\n return parts.join(\" · \");\n}\n\n/**\n * Format item type for display\n */\nfunction formatType(type: string): string {\n const typeMap: Record<string, string> = {\n \"article-journal\": \"Journal article\",\n \"article-magazine\": \"Magazine article\",\n \"article-newspaper\": \"Newspaper article\",\n book: \"Book\",\n chapter: \"Book chapter\",\n \"paper-conference\": \"Conference paper\",\n thesis: \"Thesis\",\n report: \"Report\",\n webpage: \"Web page\",\n };\n return typeMap[type] ?? type;\n}\n\n/**\n * Convert CslItem to Choice for SearchableMultiSelect\n */\nfunction toChoice(item: CslItem): Choice<CslItem> {\n const authors = formatAuthors(item.author);\n const year = extractYear(item);\n const identifiers = formatIdentifiers(item);\n const itemType = formatType(item.type);\n\n // Build meta line: Year · Type · Identifiers\n const metaParts: string[] = [];\n if (year) metaParts.push(String(year));\n metaParts.push(itemType);\n if (identifiers) metaParts.push(identifiers);\n\n const updatedDate = extractUpdatedDate(item);\n const createdDate = extractCreatedDate(item);\n const publishedDate = extractPublishedDate(item);\n\n return {\n id: item.id,\n title: item.title ?? \"(No title)\",\n subtitle: authors || \"(No authors)\",\n meta: metaParts.join(\" · \"),\n value: item,\n ...(updatedDate && { updatedDate }),\n ...(createdDate && { createdDate }),\n ...(publishedDate && { publishedDate }),\n };\n}\n\n/**\n * Props for the SearchPromptApp component\n */\ninterface SearchPromptAppProps {\n choices: Choice<CslItem>[];\n filterFn: (query: string, choices: Choice<CslItem>[]) => Choice<CslItem>[];\n visibleCount: number;\n defaultSort: SortOption;\n onSubmit: (selected: Choice<CslItem>[]) => void;\n onCancel: () => void;\n}\n\n/**\n * SearchPromptApp component - wraps SearchableMultiSelect for search prompt\n */\nfunction SearchPromptApp({\n choices,\n filterFn,\n visibleCount,\n defaultSort,\n onSubmit,\n onCancel,\n}: SearchPromptAppProps): React.ReactElement {\n const { exit } = useApp();\n\n const handleSubmit = (selected: Choice<CslItem>[]): void => {\n onSubmit(selected);\n exit();\n };\n\n const handleCancel = (): void => {\n onCancel();\n exit();\n };\n\n return createElement(SearchableMultiSelect<CslItem>, {\n choices,\n filterFn,\n visibleCount,\n onSubmit: handleSubmit,\n onCancel: handleCancel,\n header: \"Search references\",\n placeholder: \"Type to search...\",\n defaultSort,\n });\n}\n\n/**\n * Creates and runs an interactive search prompt\n */\nexport async function runSearchPrompt(\n allReferences: CslItem[],\n searchFn: SearchFunction,\n config: SearchPromptConfig,\n _initialQuery = \"\" // kept for API compatibility, not used in Ink version\n): Promise<SearchPromptResult> {\n // Convert references to choices\n const choices = allReferences.map(toChoice);\n\n // Calculate effective visible count\n const effectiveLimit = calculateEffectiveLimit(config.limit);\n\n // Create filter function using the provided search function\n const filterFn = (query: string, choices: Choice<CslItem>[]): Choice<CslItem>[] => {\n if (!query.trim()) return choices;\n\n const results = searchFn(query);\n return results.map((r) => toChoice(r.reference));\n };\n\n // Create a promise to capture the result\n return new Promise<SearchPromptResult>((resolve) => {\n let result: SearchPromptResult = { selected: [], cancelled: true };\n\n const handleSubmit = (selected: Choice<CslItem>[]): void => {\n result = {\n selected: selected.map((c) => c.value),\n cancelled: false,\n };\n };\n\n const handleCancel = (): void => {\n result = {\n selected: [],\n cancelled: true,\n };\n };\n\n // Render the Ink app\n const { waitUntilExit, clear } = render(\n createElement(SearchPromptApp, {\n choices,\n filterFn,\n visibleCount: effectiveLimit,\n defaultSort: \"updated-desc\",\n onSubmit: handleSubmit,\n onCancel: handleCancel,\n })\n );\n\n // Wait for the app to exit, clear the screen, then resolve\n waitUntilExit()\n .then(() => {\n clear();\n restoreStdinAfterInk();\n resolve(result);\n })\n .catch(() => {\n clear();\n restoreStdinAfterInk();\n resolve({\n selected: [],\n cancelled: true,\n });\n });\n });\n}\n\n// Export legacy functions for backward compatibility with existing tests\n// These are no longer used by the React Ink implementation\nexport interface AutoCompleteChoice {\n name: string;\n message: string;\n}\n\n/**\n * Creates choices from search results (legacy, for test compatibility)\n */\nexport function createChoices(\n results: SearchResult[],\n _terminalWidth: number\n): AutoCompleteChoice[] {\n return results.map((result, index) => ({\n name: JSON.stringify({ index, item: result.reference }),\n message: `[${index + 1}] ${result.reference.title ?? \"(No title)\"}`,\n }));\n}\n\n/**\n * Parses selected values back to CslItems (legacy, for test compatibility)\n */\nexport function parseSelectedValues(values: string | string[]): CslItem[] {\n const valueArray = Array.isArray(values) ? values : [values];\n const items: CslItem[] = [];\n\n for (const value of valueArray) {\n if (!value) continue;\n try {\n const data = JSON.parse(value) as { index: number; item: CslItem };\n items.push(data.item);\n } catch {\n // Ignore parse errors\n }\n }\n\n return items;\n}\n","/**\n * Shared reference selection utility for interactive ID selection.\n *\n * This module provides a reusable function to select references interactively\n * using the existing search prompt infrastructure.\n */\n\nimport type { CslItem } from \"../../core/csl-json/types.js\";\nimport { search } from \"../search/matcher.js\";\nimport { tokenize } from \"../search/tokenizer.js\";\nimport { type SearchPromptConfig, runSearchPrompt } from \"./search-prompt.js\";\nimport { checkTTY } from \"./tty.js\";\n\n/**\n * Options for reference selection\n */\nexport interface ReferenceSelectOptions {\n /** Whether to allow multiple selection (default: true) */\n multiSelect: boolean;\n /** Custom prompt message */\n prompt?: string;\n /** Initial search query */\n initialQuery?: string;\n}\n\n/**\n * Result from reference selection\n */\nexport interface ReferenceSelectResult {\n /** Selected references */\n selected: CslItem[];\n /** Whether the selection was cancelled */\n cancelled: boolean;\n}\n\n/**\n * Run interactive reference selection.\n *\n * Launches an interactive search prompt to select references from the library.\n * Supports both single and multiple selection modes.\n *\n * @param allReferences - All references available for selection\n * @param options - Selection options\n * @param config - Interactive prompt configuration\n * @returns Selection result with selected references\n * @throws TTYError if not running in a TTY environment\n */\nexport async function runReferenceSelect(\n allReferences: CslItem[],\n options: ReferenceSelectOptions,\n config: SearchPromptConfig\n): Promise<ReferenceSelectResult> {\n // Check TTY requirement\n checkTTY();\n\n // Create search function for runSearchPrompt\n const searchFn = (query: string) => {\n const { tokens } = tokenize(query);\n return search(allReferences, tokens);\n };\n\n // Run search prompt\n const searchResult = await runSearchPrompt(\n allReferences,\n searchFn,\n config,\n options.initialQuery ?? \"\"\n );\n\n if (searchResult.cancelled) {\n return { selected: [], cancelled: true };\n }\n\n // For single-select mode, return only the first selected item\n const selected = options.multiSelect ? searchResult.selected : searchResult.selected.slice(0, 1);\n\n return {\n selected,\n cancelled: false,\n };\n}\n\n/**\n * Options for selectReferencesOrExit helper\n */\nexport interface SelectReferencesOrExitOptions {\n /** Whether to allow multiple selection */\n multiSelect: boolean;\n /** Initial search query */\n initialQuery?: string;\n}\n\n/**\n * Select references interactively or exit if cancelled/empty.\n *\n * This is a convenience wrapper around runReferenceSelect that handles\n * common patterns:\n * - Exits with code 0 if library is empty\n * - Exits with code 0 if selection is cancelled\n * - Returns selected identifiers\n *\n * @param allReferences - All references available for selection\n * @param options - Selection options\n * @param config - Interactive prompt configuration\n * @returns Array of selected reference IDs (never empty)\n */\nexport async function selectReferencesOrExit(\n allReferences: CslItem[],\n options: SelectReferencesOrExitOptions,\n config: SearchPromptConfig\n): Promise<string[]> {\n if (allReferences.length === 0) {\n process.stderr.write(\"No references in library.\\n\");\n process.exit(0);\n }\n\n const selectResult = await runReferenceSelect(allReferences, options, config);\n\n if (selectResult.cancelled || selectResult.selected.length === 0) {\n process.exit(0);\n }\n\n return selectResult.selected.map((item) => item.id);\n}\n\n/**\n * Select reference items interactively or exit if cancelled/empty.\n *\n * Similar to selectReferencesOrExit but returns full CslItem objects\n * instead of just identifiers. Useful when the caller needs access to\n * the full reference data (e.g., for confirmation dialogs).\n *\n * @param allReferences - All references available for selection\n * @param options - Selection options\n * @param config - Interactive prompt configuration\n * @returns Array of selected CslItem objects (never empty)\n */\nexport async function selectReferenceItemsOrExit(\n allReferences: CslItem[],\n options: SelectReferencesOrExitOptions,\n config: SearchPromptConfig\n): Promise<CslItem[]> {\n if (allReferences.length === 0) {\n process.stderr.write(\"No references in library.\\n\");\n process.exit(0);\n }\n\n const selectResult = await runReferenceSelect(allReferences, options, config);\n\n if (selectResult.cancelled || selectResult.selected.length === 0) {\n process.exit(0);\n }\n\n return selectResult.selected;\n}\n"],"names":["choices"],"mappings":";;;;;;;AAkDO,SAAS,oBAA4B;AAC1C,SAAO,QAAQ,OAAO,QAAQ;AAChC;AAQO,SAAS,wBAAwB,aAA6B;AACnE,QAAM,iBAAiB,kBAAA;AAEvB,QAAM,gBAAgB;AACtB,QAAM,eAAe;AACrB,QAAM,iBAAiB,iBAAiB;AACxC,QAAM,oBAAoB,KAAK,IAAI,GAAG,KAAK,MAAM,iBAAiB,YAAY,CAAC;AAC/E,SAAO,cAAc,IAAI,KAAK,IAAI,aAAa,iBAAiB,IAAI;AACtE;AAKA,SAAS,YAAY,MAAmC;AACtD,QAAM,YAAY,KAAK,SAAS,YAAY;AAC5C,MAAI,CAAC,aAAa,UAAU,WAAW,EAAG,QAAO;AACjD,QAAM,gBAAgB,UAAU,CAAC;AACjC,MAAI,CAAC,iBAAiB,cAAc,WAAW,EAAG,QAAO;AACzD,SAAO,cAAc,CAAC;AACxB;AAKA,SAAS,qBAAqB,MAAiC;AAC7D,QAAM,YAAY,KAAK,SAAS,YAAY;AAC5C,MAAI,CAAC,aAAa,UAAU,WAAW,EAAG,QAAO;AACjD,QAAM,gBAAgB,UAAU,CAAC;AACjC,MAAI,CAAC,iBAAiB,cA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