@ncukondo/reference-manager 0.15.3 → 0.16.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/alternate-screen-DcxkOKfW.js +19 -0
- package/dist/chunks/alternate-screen-DcxkOKfW.js.map +1 -0
- package/dist/chunks/format-C6FA-7hE.js +397 -0
- package/dist/chunks/format-C6FA-7hE.js.map +1 -0
- package/dist/chunks/{index-TKhWlXl1.js → index-4SVOiraD.js} +104 -76
- package/dist/chunks/index-4SVOiraD.js.map +1 -0
- package/dist/chunks/{index-DVFYLuQx.js → index-Bzl4_3Ki.js} +2 -2
- package/dist/chunks/index-Bzl4_3Ki.js.map +1 -0
- package/dist/chunks/index-CEYp8OSj.js +531 -0
- package/dist/chunks/index-CEYp8OSj.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-CgM-RBIa.js +214 -0
- package/dist/chunks/reference-select-CgM-RBIa.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,322 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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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,IAAI,gBAAgB,GACjD,yBAAyB,OAAO,IAAI,wBAAwB,GAC5D,uBACE,MAAM,iEACR,iBAAiB,OAAO,UAAU,gBAClC,cAAc,MAAM,SACpB,aAAa,QAAQ,aACjB,QAAQ,aACR,WAAY;AACV,aAAO;AAAA,IACnB;AACI,YAAQ;AAAA,MACN,0BAA0B,SAAU,mBAAmB;AACrD,eAAO,kBAAiB;AAAA,MAChC;AAAA;AAEI,QAAI;AACJ,QAAI,yBAAyB,CAAA;AAC7B,QAAI,yBAAyB,MAAM,yBAAyB;AAAA,MAC1D;AAAA,MACA;AAAA,IACN,EAAK;AACD,QAAI,wBAAwB,WAAW,YAAY,YAAY,CAAC;AAChE,QAAI,wBAAwB,CAAA;AAC5B,gCAAA,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]}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { t as tokenize, s as search } from "./file-watcher-B_WpVHSV.js";
|
|
2
|
+
import { render, useApp } from "ink";
|
|
3
|
+
import { createElement } from "react";
|
|
4
|
+
import { restoreStdinAfterInk } from "./alternate-screen-DcxkOKfW.js";
|
|
5
|
+
import { f as formatAuthors, S as SearchableMultiSelect } from "./format-C6FA-7hE.js";
|
|
6
|
+
import "./jsx-runtime-Q5cUjSur.js";
|
|
7
|
+
import { checkTTY } from "./tty-BMyaEOhX.js";
|
|
8
|
+
function getTerminalHeight() {
|
|
9
|
+
return process.stdout.rows ?? 24;
|
|
10
|
+
}
|
|
11
|
+
function calculateEffectiveLimit(configLimit) {
|
|
12
|
+
const terminalHeight = getTerminalHeight();
|
|
13
|
+
const reservedLines = 10;
|
|
14
|
+
const linesPerItem = 3;
|
|
15
|
+
const availableLines = terminalHeight - reservedLines;
|
|
16
|
+
const maxVisibleChoices = Math.max(1, Math.floor(availableLines / linesPerItem));
|
|
17
|
+
return configLimit > 0 ? Math.min(configLimit, maxVisibleChoices) : maxVisibleChoices;
|
|
18
|
+
}
|
|
19
|
+
function extractYear(item) {
|
|
20
|
+
const dateParts = item.issued?.["date-parts"];
|
|
21
|
+
if (!dateParts || dateParts.length === 0) return void 0;
|
|
22
|
+
const firstDatePart = dateParts[0];
|
|
23
|
+
if (!firstDatePart || firstDatePart.length === 0) return void 0;
|
|
24
|
+
return firstDatePart[0];
|
|
25
|
+
}
|
|
26
|
+
function extractPublishedDate(item) {
|
|
27
|
+
const dateParts = item.issued?.["date-parts"];
|
|
28
|
+
if (!dateParts || dateParts.length === 0) return void 0;
|
|
29
|
+
const firstDatePart = dateParts[0];
|
|
30
|
+
if (!firstDatePart || firstDatePart.length === 0) return void 0;
|
|
31
|
+
const [year, month = 1, day = 1] = firstDatePart;
|
|
32
|
+
if (year === void 0) return void 0;
|
|
33
|
+
return new Date(year, month - 1, day);
|
|
34
|
+
}
|
|
35
|
+
function extractUpdatedDate(item) {
|
|
36
|
+
const dateStr = item.custom?.timestamp;
|
|
37
|
+
if (!dateStr || typeof dateStr !== "string") return void 0;
|
|
38
|
+
const date = new Date(dateStr);
|
|
39
|
+
return Number.isNaN(date.getTime()) ? void 0 : date;
|
|
40
|
+
}
|
|
41
|
+
function extractCreatedDate(item) {
|
|
42
|
+
const dateStr = item.custom?.created_at;
|
|
43
|
+
if (!dateStr || typeof dateStr !== "string") return void 0;
|
|
44
|
+
const date = new Date(dateStr);
|
|
45
|
+
return Number.isNaN(date.getTime()) ? void 0 : date;
|
|
46
|
+
}
|
|
47
|
+
function formatIdentifiers(item) {
|
|
48
|
+
const parts = [];
|
|
49
|
+
if (item.DOI) parts.push(`DOI: ${item.DOI}`);
|
|
50
|
+
if (item.PMID) parts.push(`PMID: ${item.PMID}`);
|
|
51
|
+
if (item.PMCID) parts.push(`PMCID: ${item.PMCID}`);
|
|
52
|
+
if (item.ISBN) parts.push(`ISBN: ${item.ISBN}`);
|
|
53
|
+
return parts.join(" · ");
|
|
54
|
+
}
|
|
55
|
+
function formatType(type) {
|
|
56
|
+
const typeMap = {
|
|
57
|
+
"article-journal": "Journal article",
|
|
58
|
+
"article-magazine": "Magazine article",
|
|
59
|
+
"article-newspaper": "Newspaper article",
|
|
60
|
+
book: "Book",
|
|
61
|
+
chapter: "Book chapter",
|
|
62
|
+
"paper-conference": "Conference paper",
|
|
63
|
+
thesis: "Thesis",
|
|
64
|
+
report: "Report",
|
|
65
|
+
webpage: "Web page"
|
|
66
|
+
};
|
|
67
|
+
return typeMap[type] ?? type;
|
|
68
|
+
}
|
|
69
|
+
function toChoice(item) {
|
|
70
|
+
const authors = formatAuthors(item.author);
|
|
71
|
+
const year = extractYear(item);
|
|
72
|
+
const identifiers = formatIdentifiers(item);
|
|
73
|
+
const itemType = formatType(item.type);
|
|
74
|
+
const metaParts = [];
|
|
75
|
+
if (year) metaParts.push(String(year));
|
|
76
|
+
metaParts.push(itemType);
|
|
77
|
+
if (identifiers) metaParts.push(identifiers);
|
|
78
|
+
const updatedDate = extractUpdatedDate(item);
|
|
79
|
+
const createdDate = extractCreatedDate(item);
|
|
80
|
+
const publishedDate = extractPublishedDate(item);
|
|
81
|
+
return {
|
|
82
|
+
id: item.id,
|
|
83
|
+
title: item.title ?? "(No title)",
|
|
84
|
+
subtitle: authors || "(No authors)",
|
|
85
|
+
meta: metaParts.join(" · "),
|
|
86
|
+
value: item,
|
|
87
|
+
...updatedDate && { updatedDate },
|
|
88
|
+
...createdDate && { createdDate },
|
|
89
|
+
...publishedDate && { publishedDate }
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
function SearchPromptApp({
|
|
93
|
+
choices,
|
|
94
|
+
filterFn,
|
|
95
|
+
visibleCount,
|
|
96
|
+
defaultSort,
|
|
97
|
+
onSubmit,
|
|
98
|
+
onCancel
|
|
99
|
+
}) {
|
|
100
|
+
const { exit } = useApp();
|
|
101
|
+
const handleSubmit = (selected) => {
|
|
102
|
+
onSubmit(selected);
|
|
103
|
+
exit();
|
|
104
|
+
};
|
|
105
|
+
const handleCancel = () => {
|
|
106
|
+
onCancel();
|
|
107
|
+
exit();
|
|
108
|
+
};
|
|
109
|
+
return createElement(SearchableMultiSelect, {
|
|
110
|
+
choices,
|
|
111
|
+
filterFn,
|
|
112
|
+
visibleCount,
|
|
113
|
+
onSubmit: handleSubmit,
|
|
114
|
+
onCancel: handleCancel,
|
|
115
|
+
header: "Search references",
|
|
116
|
+
placeholder: "Type to search...",
|
|
117
|
+
defaultSort
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
async function runSearchPrompt(allReferences, searchFn, config, _initialQuery = "") {
|
|
121
|
+
const choices = allReferences.map(toChoice);
|
|
122
|
+
const effectiveLimit = calculateEffectiveLimit(config.limit);
|
|
123
|
+
const filterFn = (query, choices2) => {
|
|
124
|
+
if (!query.trim()) return choices2;
|
|
125
|
+
const results = searchFn(query);
|
|
126
|
+
return results.map((r) => toChoice(r.reference));
|
|
127
|
+
};
|
|
128
|
+
return new Promise((resolve) => {
|
|
129
|
+
let result = { selected: [], cancelled: true };
|
|
130
|
+
const handleSubmit = (selected) => {
|
|
131
|
+
result = {
|
|
132
|
+
selected: selected.map((c) => c.value),
|
|
133
|
+
cancelled: false
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
const handleCancel = () => {
|
|
137
|
+
result = {
|
|
138
|
+
selected: [],
|
|
139
|
+
cancelled: true
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
const { waitUntilExit, clear } = render(
|
|
143
|
+
createElement(SearchPromptApp, {
|
|
144
|
+
choices,
|
|
145
|
+
filterFn,
|
|
146
|
+
visibleCount: effectiveLimit,
|
|
147
|
+
defaultSort: "updated-desc",
|
|
148
|
+
onSubmit: handleSubmit,
|
|
149
|
+
onCancel: handleCancel
|
|
150
|
+
})
|
|
151
|
+
);
|
|
152
|
+
waitUntilExit().then(() => {
|
|
153
|
+
clear();
|
|
154
|
+
restoreStdinAfterInk();
|
|
155
|
+
resolve(result);
|
|
156
|
+
}).catch(() => {
|
|
157
|
+
clear();
|
|
158
|
+
restoreStdinAfterInk();
|
|
159
|
+
resolve({
|
|
160
|
+
selected: [],
|
|
161
|
+
cancelled: true
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
async function runReferenceSelect(allReferences, options, config) {
|
|
167
|
+
checkTTY();
|
|
168
|
+
const searchFn = (query) => {
|
|
169
|
+
const { tokens } = tokenize(query);
|
|
170
|
+
return search(allReferences, tokens);
|
|
171
|
+
};
|
|
172
|
+
const searchResult = await runSearchPrompt(
|
|
173
|
+
allReferences,
|
|
174
|
+
searchFn,
|
|
175
|
+
config,
|
|
176
|
+
options.initialQuery ?? ""
|
|
177
|
+
);
|
|
178
|
+
if (searchResult.cancelled) {
|
|
179
|
+
return { selected: [], cancelled: true };
|
|
180
|
+
}
|
|
181
|
+
const selected = options.multiSelect ? searchResult.selected : searchResult.selected.slice(0, 1);
|
|
182
|
+
return {
|
|
183
|
+
selected,
|
|
184
|
+
cancelled: false
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
async function selectReferencesOrExit(allReferences, options, config) {
|
|
188
|
+
if (allReferences.length === 0) {
|
|
189
|
+
process.stderr.write("No references in library.\n");
|
|
190
|
+
process.exit(0);
|
|
191
|
+
}
|
|
192
|
+
const selectResult = await runReferenceSelect(allReferences, options, config);
|
|
193
|
+
if (selectResult.cancelled || selectResult.selected.length === 0) {
|
|
194
|
+
process.exit(0);
|
|
195
|
+
}
|
|
196
|
+
return selectResult.selected.map((item) => item.id);
|
|
197
|
+
}
|
|
198
|
+
async function selectReferenceItemsOrExit(allReferences, options, config) {
|
|
199
|
+
if (allReferences.length === 0) {
|
|
200
|
+
process.stderr.write("No references in library.\n");
|
|
201
|
+
process.exit(0);
|
|
202
|
+
}
|
|
203
|
+
const selectResult = await runReferenceSelect(allReferences, options, config);
|
|
204
|
+
if (selectResult.cancelled || selectResult.selected.length === 0) {
|
|
205
|
+
process.exit(0);
|
|
206
|
+
}
|
|
207
|
+
return selectResult.selected;
|
|
208
|
+
}
|
|
209
|
+
export {
|
|
210
|
+
runReferenceSelect,
|
|
211
|
+
selectReferenceItemsOrExit,
|
|
212
|
+
selectReferencesOrExit
|
|
213
|
+
};
|
|
214
|
+
//# sourceMappingURL=reference-select-CgM-RBIa.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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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