{"_id":"@asiloisad/select-list","_rev":"6-647be3cf25a486f897ae7efb48417e82","name":"@asiloisad/select-list","dist-tags":{"latest":"1.6.3"},"versions":{"1.5.0":{"name":"@asiloisad/select-list","version":"1.5.0","keywords":["pulsar","atom","select","list","fuzzy","filter","ui"],"license":"MIT","_id":"@asiloisad/select-list@1.5.0","maintainers":[{"name":"asiloisad","email":"asiloisad.93@gmail.com"}],"homepage":"https://github.com/asiloisad/pulsar-select-list#readme","bugs":{"url":"https://github.com/asiloisad/pulsar-select-list/issues"},"dist":{"shasum":"4f8b881dc5c69d47a1943e6efaf588489a55ea26","tarball":"https://registry.npmjs.org/@asiloisad/select-list/-/select-list-1.5.0.tgz","fileCount":4,"integrity":"sha512-cvRuhJWi9wMtM62Hmk8EzhBK93vxTSOv18teaZUy42QKUC9YMX8XzypmvcnfWM8KkcwnfLgT8HPJOBhsLsG0gw==","signatures":[{"sig":"MEYCIQDPKKzkzaEAyNVcUSt30cgRN+KFIWVS/Ly2gzvzl0Ip3AIhAI4u4ggbU1LdYQdvXmIIfx0oUnwKyqnQQrI9dATHp9Yh","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":42865},"main":"select.js","gitHead":"d8a952efcecc8207e2048b97868aa38c09f6cef7","_npmUser":{"name":"asiloisad","email":"asiloisad.93@gmail.com"},"repository":{"url":"git+https://github.com/asiloisad/pulsar-select-list.git","type":"git"},"_npmVersion":"10.2.4","description":"A general-purpose select list for use in Pulsar packages","directories":{},"_nodeVersion":"20.11.1","dependencies":{"etch":"^0.14.0","diacritic":"^0.0.2"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/select-list_1.5.0_1772671397532_0.790181859652688","host":"s3://npm-registry-packages-npm-production"}},"1.5.1":{"name":"@asiloisad/select-list","version":"1.5.1","keywords":["pulsar","atom","select","list","fuzzy","filter","ui"],"license":"MIT","_id":"@asiloisad/select-list@1.5.1","maintainers":[{"name":"asiloisad","email":"asiloisad.93@gmail.com"}],"homepage":"https://github.com/asiloisad/pulsar-select-list#readme","bugs":{"url":"https://github.com/asiloisad/pulsar-select-list/issues"},"dist":{"shasum":"2e39495caea5ea32c3a0c2c7c4f9648c4124262c","tarball":"https://registry.npmjs.org/@asiloisad/select-list/-/select-list-1.5.1.tgz","fileCount":4,"integrity":"sha512-QBjQi4dTteVy38MtFUvptcmQZ3EcrbuPmFe1ojc67t4jDE62nLUM4GWolNN4+OmVwpYnWzvZn390ipZHo22jWQ==","signatures":[{"sig":"MEUCIDyCpA/eiELFKwqbqWYrMWddZHVVMBatUs+TEZmlooj7AiEA1uU9XQoM4n07s2H/2HcVeqy/DkmINYRg98VWvIsKWzM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":42863},"main":"select.js","gitHead":"a207086f01d99e06a968db2c04b424bab49699da","_npmUser":{"name":"asiloisad","email":"asiloisad.93@gmail.com"},"repository":{"url":"git+https://github.com/asiloisad/pulsar-select-list.git","type":"git"},"_npmVersion":"10.2.4","description":"A general-purpose select list for use in Pulsar packages","directories":{},"_nodeVersion":"20.11.1","dependencies":{"etch":"^0.14.0","diacritic":"^0.0.2"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/select-list_1.5.1_1774761052491_0.8725648702176618","host":"s3://npm-registry-packages-npm-production"}},"1.6.0":{"name":"@asiloisad/select-list","version":"1.6.0","keywords":["pulsar","atom","select","list","fuzzy","filter","ui"],"license":"MIT","_id":"@asiloisad/select-list@1.6.0","maintainers":[{"name":"asiloisad","email":"asiloisad.93@gmail.com"}],"homepage":"https://github.com/asiloisad/pulsar-select-list#readme","bugs":{"url":"https://github.com/asiloisad/pulsar-select-list/issues"},"dist":{"shasum":"8949bff9cc4890e8af4150cf1983eac45e5582e0","tarball":"https://registry.npmjs.org/@asiloisad/select-list/-/select-list-1.6.0.tgz","fileCount":4,"integrity":"sha512-mMjXY88Mw65L0brtgjjNDXs/WSm1q5kCcA5ArU6t9pNzUxt04XzAe+WiaPSrOA0QDEoliFM/GUDKdcM7wOpKTQ==","signatures":[{"sig":"MEYCIQCWAYXS3j4/rEHuDo5T4a9UPjkLYHarWqOTtR3L81TVXAIhAPs93SziznaP6AIUljHlUn6Avyz/0SKGeTuXRjjCVApZ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":43272},"main":"select.js","gitHead":"5f111be24fa32b8169722249795962e1c11ae502","_npmUser":{"name":"asiloisad","email":"asiloisad.93@gmail.com"},"repository":{"url":"git+https://github.com/asiloisad/pulsar-select-list.git","type":"git"},"_npmVersion":"10.2.4","description":"A general-purpose select list for use in Pulsar packages","directories":{},"_nodeVersion":"20.11.1","dependencies":{"etch":"^0.14.0","diacritic":"^0.0.2"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/select-list_1.6.0_1777635491984_0.8246926651730437","host":"s3://npm-registry-packages-npm-production"}},"1.6.1":{"name":"@asiloisad/select-list","version":"1.6.1","keywords":["pulsar","atom","select","list","fuzzy","filter","ui"],"license":"MIT","_id":"@asiloisad/select-list@1.6.1","maintainers":[{"name":"asiloisad","email":"asiloisad.93@gmail.com"}],"homepage":"https://github.com/asiloisad/pulsar-select-list#readme","bugs":{"url":"https://github.com/asiloisad/pulsar-select-list/issues"},"dist":{"shasum":"809227d2c4dc84b5d44afb71076ef2fcc266f2cb","tarball":"https://registry.npmjs.org/@asiloisad/select-list/-/select-list-1.6.1.tgz","fileCount":4,"integrity":"sha512-eKQYRnrsubMGQr/A/raZT/8fzHDgGLk5TKdu7RycwsPqHXJklxa596j5wk5r2oIrZCKKDXCEcGfAHWfkHCj5Uw==","signatures":[{"sig":"MEUCIBHDwgd+X3a3ID+E4ix7Twhq7oI4bcW9ZV5cdKrbwfTEAiEAwVKf6w9H4oCEiIEop1WqbQIJ7DdXKs3I5pxXDa3GHG4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":43313},"main":"select.js","gitHead":"55c778ae92ff6abf2f04df5925a2aec15b6f0fd6","_npmUser":{"name":"asiloisad","email":"asiloisad.93@gmail.com"},"repository":{"url":"git+https://github.com/asiloisad/pulsar-select-list.git","type":"git"},"_npmVersion":"10.2.4","description":"A general-purpose select list for use in Pulsar packages","directories":{},"_nodeVersion":"20.11.1","dependencies":{"etch":"^0.14.0","diacritic":"^0.0.2"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/select-list_1.6.1_1777898673648_0.054060963414468866","host":"s3://npm-registry-packages-npm-production"}},"1.6.2":{"name":"@asiloisad/select-list","version":"1.6.2","keywords":["pulsar","atom","select","list","fuzzy","filter","ui"],"license":"MIT","_id":"@asiloisad/select-list@1.6.2","maintainers":[{"name":"asiloisad","email":"asiloisad.93@gmail.com"}],"homepage":"https://github.com/asiloisad/pulsar-select-list#readme","bugs":{"url":"https://github.com/asiloisad/pulsar-select-list/issues"},"dist":{"shasum":"30bac59634be6f3e5f373e600b04ac7c21e00863","tarball":"https://registry.npmjs.org/@asiloisad/select-list/-/select-list-1.6.2.tgz","fileCount":4,"integrity":"sha512-dA23yC0Y/GvQXrCbzcRt6LzU+0aoGyNa95dU8LmeyANS4ea+r6Q1dTEoh+WYSAOlfdqRiA1FgagUujTfz6P/lw==","signatures":[{"sig":"MEQCICHjPwg3vfgPIHH6U4OOJTvBClqYUZEQMiy4sZOttBUhAiBgMEONUXBTPM1S3hSUhAKfuY1gtGfXtvazKsNpUtfRow==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":42233},"main":"select.js","gitHead":"dcb6c439db0f8ef2e7e6dbb7c0ae3662ab00ab68","_npmUser":{"name":"asiloisad","email":"asiloisad.93@gmail.com"},"repository":{"url":"git+https://github.com/asiloisad/pulsar-select-list.git","type":"git"},"_npmVersion":"10.2.4","description":"A general-purpose select list for use in Pulsar packages","directories":{},"_nodeVersion":"20.11.1","dependencies":{"etch":"^0.14.0","diacritic":"^0.0.2"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/select-list_1.6.2_1778844657679_0.5746836542327929","host":"s3://npm-registry-packages-npm-production"}},"1.6.3":{"name":"@asiloisad/select-list","description":"A general-purpose select list for use in Pulsar packages","keywords":["pulsar","atom","select","list","fuzzy","filter","ui"],"repository":{"type":"git","url":"git+https://github.com/asiloisad/pulsar-select-list.git"},"version":"1.6.3","license":"MIT","main":"select.js","dependencies":{"diacritic":"^0.0.2","etch":"^0.14.0"},"_id":"@asiloisad/select-list@1.6.3","gitHead":"819fd0446539a328c76ed5e40f4aeb85f3fd97fe","bugs":{"url":"https://github.com/asiloisad/pulsar-select-list/issues"},"homepage":"https://github.com/asiloisad/pulsar-select-list#readme","_nodeVersion":"20.11.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-m3IDWzm9F3Z5ZiiISg6aOnW8QqVrv37PXhxwrgSwtvs/hiXgKqJcTdrvLXAU4xgrZqfJRX8H5xA1HVMXjDv+/w==","shasum":"4d87dc3f13a376ccc56dddb7741ee901b138aa6a","tarball":"https://registry.npmjs.org/@asiloisad/select-list/-/select-list-1.6.3.tgz","fileCount":4,"unpackedSize":44070,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGxB2i8lWRxz9CkC7NKyVMkzS3ELMdajoobVIQ66zZ+mAiEAyFd5MJXxXUF4UAScenhDbo5SWl8yR5s1FNqRuw19q3Y="}]},"_npmUser":{"name":"asiloisad","email":"asiloisad.93@gmail.com"},"directories":{},"maintainers":[{"name":"asiloisad","email":"asiloisad.93@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/select-list_1.6.3_1779710708060_0.7118954233962709"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-05T00:43:17.448Z","modified":"2026-05-25T12:05:08.303Z","1.5.0":"2026-03-05T00:43:17.668Z","1.5.1":"2026-03-29T05:10:52.623Z","1.6.0":"2026-05-01T11:38:12.121Z","1.6.1":"2026-05-04T12:44:33.782Z","1.6.2":"2026-05-15T11:30:57.822Z","1.6.3":"2026-05-25T12:05:08.200Z"},"bugs":{"url":"https://github.com/asiloisad/pulsar-select-list/issues"},"license":"MIT","homepage":"https://github.com/asiloisad/pulsar-select-list#readme","keywords":["pulsar","atom","select","list","fuzzy","filter","ui"],"repository":{"type":"git","url":"git+https://github.com/asiloisad/pulsar-select-list.git"},"description":"A general-purpose select list for use in Pulsar packages","maintainers":[{"name":"asiloisad","email":"asiloisad.93@gmail.com"}],"readme":"# @asiloisad/select-list\n\nFuzzy-searchable select list component for [Pulsar](https://pulsar-edit.dev/). An [etch component](https://github.com/atom/etch) with keyboard/mouse navigation and built-in panel management.\n\nFork of [atom-select-list](https://github.com/atom/atom-select-list). Designed exclusively for use in Pulsar packages.\n\n## Features\n\n- **Fuzzy filtering**: Multiple algorithms including `command-t` for file paths.\n- **Match highlighting**: Built-in helpers for displaying match positions.\n- **Panel management**: Show/hide/toggle with focus restoration.\n- **Lazy match indices**: Match positions computed only when accessed.\n- **Diacritics support**: Accent-insensitive matching option.\n- **Help mode**: Toggle help content in the panel.\n\n## API\n\n### Constructor props\n\nWhen creating a new instance of a select list, or when calling `update` on an existing one, you can supply a JavaScript object that can contain any of the following properties:\n\n#### Required\n\n- `elementForItem: (item: Object, options: Object) -> HTMLElement`: a function that is called whenever an item needs to be displayed.\n  - `options: Object`:\n    - `selected: Boolean`: indicating whether item is selected or not.\n    - `index: Number`: item's index.\n    - `filterKey: String|null`: the text that was matched against (from `filterKeyForItem` or item itself).\n    - `matchIndices: [Number]|null`: lazy getter - character indices in `filterKey` that matched the query. Only computed when accessed.\n\n#### Optional\n\n- `items: [Object]`: an array containing the objects you want to show in the select list.\n- `className: String`: CSS class name(s) to add to the select list element. Multiple classes can be space-separated.\n- `maxResults: Number`: the number of maximum items that are shown.\n- `filter: (items: [Object], query: String) -> [Object]`: a function that allows to decide which items to show whenever the query changes. By default, it uses Pulsar's built-in fuzzy matcher.\n- `filterKeyForItem: (item: Object) -> String`: when `filter` is not provided, this function will be called to retrieve a string property on each item and that will be used to filter them.\n- `filterQuery: (query: String) -> String`: a function that allows to apply a transformation to the user query and whose return value will be used to filter items.\n- `removeDiacritics: Boolean`: when `true`, removes diacritical marks from both the query and item text before filtering, enabling accent-insensitive matching (e.g., \"cafe\" matches \"café\").\n- `filterScoreModifier: (score: Number, item: Object) -> Number`: a function to modify the fuzzy match score for each item. Useful for applying custom ranking factors (e.g., boosting by recency or proximity).\n- `algorithm: String`: the fuzzy matching algorithm to use. Options: `'fuzzaldrin'` (default), `'command-t'` (path-aware, better for file paths).\n- `numThreads: Number`: number of threads for parallel matching. Defaults to 80% of available CPUs.\n- `maxGap: Number`: maximum gap between consecutive matched characters (only for `'command-t'` algorithm). Lower values require tighter matches. Defaults to infinite.\n- `query: String`: a string that will replace the contents of the query editor.\n- `selectQuery: Boolean`: a boolean indicating whether the query text should be selected or not.\n- `order: (item1: Object, item2: Object) -> Number`: a function that allows to change the order in which items are shown.\n- `emptyMessage: String`: a string shown when the list is empty.\n- `errorMessage: String`: a string that needs to be set when you want to notify the user that an error occurred.\n- `infoMessage: String`: a string that needs to be set when you want to provide some information to the user.\n- `helpMessage: String`: HTML content to display when help is toggled.\n- `helpMarkdown: String`: markdown content to display when help is toggled. Rendered using Pulsar's built-in markdown renderer.\n- `loadingMessage: String`: a string that needs to be set when you are loading items in the background.\n- `loadingSpinner: Boolean`: show spinner next to loading message.\n- `loadingBadge: String/Number`: a string or number that needs to be set when the progress status changes.\n- `itemsClassList: [String]`: an array of strings that will be added as class names to the items element.\n- `initialSelectionIndex: Number`: the index of the item to initially select; defaults to `0`.\n- `placeholderText: String`: placeholder text to display in the query editor when empty.\n- `skipCommandsRegistration: Boolean`: when `true`, skips registering default keyboard commands.\n\n### Registered commands\n\nBy default, the component registers these commands on its element:\n\n- `core:move-up` / `core:move-down`: Navigate items\n- `core:move-to-top` / `core:move-to-bottom`: Jump to first/last item\n- `core:confirm`: Confirm selection\n- `core:cancel`: Cancel selection\n- `select-list:help`: Toggle help message visibility (requires `helpMessage` or `helpMarkdown`)\n\n#### Callbacks\n\n- `didChangeQuery: (query: String) -> Void`: called when the query changes.\n- `didChangeSelection: (item: Object) -> Void`: called when the selected item changes.\n- `didConfirmSelection: (item: Object) -> Void`: called when the user clicks or presses Enter on an item.\n- `didConfirmEmptySelection: () -> Void`: called when the user presses Enter but the list is empty.\n- `didCancelSelection: () -> Void`: called when the user presses Esc or the list loses focus.\n- `willShow: () -> Void`: called when transitioning from hidden to visible, useful for data preparation.\n\n### Instance properties\n\n- `processedQuery: String`: The cached result of `getFilterQuery()`, updated after each query change. Useful in `elementForItem` to avoid calling `getFilterQuery()` multiple times.\n- `selectionIndex: Number|undefined`: The index of the currently selected item, or `undefined` if nothing is selected.\n- `refs.queryEditor`: The underlying TextEditor component for the query input.\n\n### Instance methods\n\n#### Panel management\n\n- `show()`: Shows the select list as a modal panel and focuses the query editor. Calls `willShow` callback if provided.\n- `hide()`: Hides the panel and restores focus to the previously focused element.\n- `toggle()`: Toggles the visibility of the panel.\n- `isVisible()`: Returns `true` if the panel is currently visible.\n- `isHelpMode()`: Returns `true` if help is currently displayed.\n- `toggleHelp()`: Toggles help message visibility. Only works if `helpMessage` is set.\n- `hideHelp()`: Hides help message if currently shown.\n\n#### Other methods\n\n- `focus()`: Focuses the query editor.\n- `reset()`: Clears the query editor text.\n- `destroy()`: Disposes of the component and cleans up resources.\n- `update(props)`: Updates the component with new props.\n- `getQuery()`: Returns the current query string.\n- `getFilterKey(item)`: Returns the filter key string for an item (from cache, `filterKeyForItem`, or item itself).\n- `getMatchIndices(item, filterKey?)`: Returns match indices for an item, computing lazily if needed. Prefer using `options.matchIndices` in `elementForItem` instead.\n- `getFilterQuery()`: Returns the filtered query string (applies `filterQuery` transformation).\n- `setQueryFromSelection()`: Sets the query text from the active editor's selection. Returns `true` if successful, `false` if no editor, no selection, or selection contains newlines.\n- `getSelectedItem()`: Returns the currently selected item.\n- `selectPrevious()`: Selects the previous item.\n- `selectNext()`: Selects the next item.\n- `selectFirst()`: Selects the first item.\n- `selectLast()`: Selects the last item.\n- `selectNone()`: Deselects all items.\n- `selectIndex(index)`: Selects the item at the given index.\n- `selectItem(item)`: Selects the given item.\n- `confirmSelection()`: Confirms the current selection.\n- `cancelSelection()`: Cancels the selection.\n\n### Static methods\n\n#### `SelectListView.setScheduler(scheduler)`\n\nSets the etch scheduler used by the component. The component initializes this to `atom.views` automatically when possible.\n\n#### `SelectListView.getScheduler()`\n\nReturns the current etch scheduler.\n\n#### `SelectListView.initializeScheduler()`\n\nInitializes the etch scheduler from `atom.views` if it has not already been configured.\n\n#### `SelectListView.getMatchIndices(text, query, options)`\n\nComputes fuzzy match indices for a text against a query. Useful outside of `elementForItem` context.\n\n```js\nconst { getMatchIndices } = require(\"@asiloisad/select-list\");\n\nconst indices = getMatchIndices(\"MyComponent.js\", \"mcjs\");\n// => [0, 2, 11, 12] or null if no match\n\n// With diacritics removal\nconst indices = getMatchIndices(\"café\", \"cafe\", { removeDiacritics: true });\n// => [0, 1, 2, 3]\n```\n\n#### `SelectListView.highlightMatches(text, matchIndices, options)`\n\nCreates a DocumentFragment with highlighted match characters.\n\n```js\n// In elementForItem, use options.matchIndices (lazy getter):\nelementForItem: (item, { filterKey, matchIndices }) => {\n  const li = document.createElement(\"li\");\n  li.appendChild(SelectListView.highlightMatches(filterKey, matchIndices));\n  return li;\n};\n```\n\n#### `SelectListView.removeDiacritics(str)`\n\nRemoves diacritical marks (accents) from a string.\n\n```js\nSelectListView.removeDiacritics(\"café\"); // => 'cafe'\n```\n\n#### `SelectListView.createTwoLineItem(options)`\n\nCreates a two-line list item element with primary and optional secondary lines.\n\n```js\nelementForItem: (item, { filterKey, matchIndices }) => {\n  return SelectListView.createTwoLineItem({\n    primary: SelectListView.highlightMatches(filterKey, matchIndices),\n    secondary: item.description,\n    icon: [\"icon-file-text\"],\n  });\n};\n```\n\n## Example\n\n```js\nconst SelectListView = require(\"@asiloisad/select-list\");\nconst fs = require(\"fs\");\nconst path = require(\"path\");\n\nclass MyFileList {\n  constructor() {\n    this.selectList = new SelectListView({\n      className: \"my-package my-file-list\",\n      items: [],\n      filterKeyForItem: (item) => item.name,\n      emptyMessage: \"No files found\",\n      willShow: () => {\n        this.loadFiles();\n      },\n      elementForItem: (item, { index, filterKey, matchIndices }) => {\n        const li = document.createElement(\"li\");\n        li.appendChild(SelectListView.highlightMatches(filterKey, matchIndices));\n        return li;\n      },\n      didConfirmSelection: (item) => {\n        atom.workspace.open(item.path);\n        this.selectList.hide();\n      },\n      didCancelSelection: () => {\n        this.selectList.hide();\n      },\n    });\n  }\n\n  toggle() {\n    this.selectList.toggle();\n  }\n\n  destroy() {\n    this.selectList.destroy();\n  }\n}\n```\n\n## Contributing\n\nGot ideas to make this package better, found a bug, or want to help add new features? Just drop your thoughts on GitHub. Any feedback is welcome!\n","readmeFilename":"README.md"}