Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
pacocoursey authored Jan 30, 2024
2 parents 62856f7 + c7fd231 commit dd2bbd4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion cmdk/src/command-score.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,6 @@ export function commandScore(string: string, abbreviation: string, aliases: stri
* in the original, we used to do the lower-casing on each recursive call, but this meant that toLowerCase()
* was the dominating cost in the algorithm, passing both is a little ugly, but considerably faster.
*/
string = aliases && aliases.length > 0 ? `${string + ' ' + aliases.join(' ')}` : string;
string = aliases && aliases.length > 0 ? `${string + ' ' + aliases.join(' ')}` : string
return commandScoreInner(string, abbreviation, formatInput(string), formatInput(abbreviation), 0, 0, {})
}
4 changes: 2 additions & 2 deletions cmdk/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ const Command = React.forwardRef<HTMLDivElement, CommandProps>((props, forwarded
}))
const allItems = useLazyRef<Set<string>>(() => new Set()) // [...itemIds]
const allGroups = useLazyRef<Map<string, Set<string>>>(() => new Map()) // groupId → [...itemIds]
const ids = useLazyRef<Map<string, { value: string, keywords?: string[] }>>(() => new Map()) // id → { value, keywords }
const ids = useLazyRef<Map<string, { value: string; keywords?: string[] }>>(() => new Map()) // id → { value, keywords }
const listeners = useLazyRef<Set<() => void>>(() => new Set()) // [...rerenders]
const propsRef = useAsRef(props)
const {
Expand Down Expand Up @@ -998,7 +998,7 @@ function useValue(
id: string,
ref: React.RefObject<HTMLElement>,
deps: (string | React.ReactNode | React.RefObject<HTMLElement>)[],
aliases: string[] = []
aliases: string[] = [],
) {
const valueRef = React.useRef<string>()
const context = useCommand()
Expand Down
2 changes: 1 addition & 1 deletion test/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const Page = () => {
<Command.Input placeholder="Search…" className="input" />
<Command.List className="list">
<Command.Empty className="empty">No results.</Command.Empty>
<Command.Item keywords={["key"]} onSelect={() => console.log('Item selected')} className="item">
<Command.Item keywords={['key']} onSelect={() => console.log('Item selected')} className="item">
Item
</Command.Item>
<Command.Item value="xxx" className="item">
Expand Down
18 changes: 9 additions & 9 deletions website/components/cmdk/raycast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function RaycastCMDK() {
<Command.List ref={listRef}>
<Command.Empty>No results found.</Command.Empty>
<Command.Group heading="Suggestions">
<Item value="Linear" keywords={["issue", "sprint"]}>
<Item value="Linear" keywords={['issue', 'sprint']}>
<Logo>
<LinearIcon
style={{
Expand All @@ -34,43 +34,43 @@ export function RaycastCMDK() {
</Logo>
Linear
</Item>
<Item value="Figma" keywords={["design", "ui", "ux"]}>
<Item value="Figma" keywords={['design', 'ui', 'ux']}>
<Logo>
<FigmaIcon />
</Logo>
Figma
</Item>
<Item value="Slack" keywords={["chat", "team", "communication"]}>
<Item value="Slack" keywords={['chat', 'team', 'communication']}>
<Logo>
<SlackIcon />
</Logo>
Slack
</Item>
<Item value="YouTube" keywords={["video", "watch", "stream"]}>
<Item value="YouTube" keywords={['video', 'watch', 'stream']}>
<Logo>
<YouTubeIcon />
</Logo>
YouTube
</Item>
<Item value="Raycast" keywords={["productivity", "tools", "apps"]}>
<Item value="Raycast" keywords={['productivity', 'tools', 'apps']}>
<Logo>
<RaycastIcon />
</Logo>
Raycast
</Item>
</Command.Group>
<Command.Group heading="Commands">
<Item isCommand value="Clipboard History" keywords={["copy", "paste", "clipboard"]}>
<Item isCommand value="Clipboard History" keywords={['copy', 'paste', 'clipboard']}>
<Logo>
<ClipboardIcon />
</Logo>
Clipboard History
</Item>
<Item isCommand value="Import Extension" keywords={["import", "extension"]}>
<Item isCommand value="Import Extension" keywords={['import', 'extension']}>
<HammerIcon />
Import Extension
</Item>
<Item isCommand value="Manage Extensions" keywords={["manage", "extension"]}>
<Item isCommand value="Manage Extensions" keywords={['manage', 'extension']}>
<HammerIcon />
Manage Extensions
</Item>
Expand Down Expand Up @@ -101,7 +101,7 @@ function Item({
isCommand = false,
}: {
children: React.ReactNode
value: string,
value: string
keywords?: string[]
isCommand?: boolean
}) {
Expand Down

0 comments on commit dd2bbd4

Please sign in to comment.