@teambit/command-bar 1.0.492 → 1.0.494
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/artifacts/__bit_junit.xml +1 -1
- package/artifacts/preview/teambit_explorer_command_bar-preview.js +1 -1
- package/artifacts/schema.json +3 -3
- package/command-bar.ui.runtime.tsx +1 -1
- package/dist/command-bar.ui.runtime.js +3 -2
- package/dist/command-bar.ui.runtime.js.map +1 -1
- package/dist/{preview-1733950992344.js → preview-1734260112091.js} +2 -2
- package/package.json +7 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<testsuites tests="0" failures="0" errors="0" skipped="0">
|
|
3
|
-
<testsuite name="teambit.explorer/command-bar@1.0.
|
|
3
|
+
<testsuite name="teambit.explorer/command-bar@1.0.494" tests="0" failures="0" errors="0" skipped="0"/>
|
|
4
4
|
</testsuites>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.explorer/command-bar-preview"]=t():e["teambit.explorer/command-bar-preview"]=t()}(self,(()=>(()=>{"use strict";var e={
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.explorer/command-bar-preview"]=t():e["teambit.explorer/command-bar-preview"]=t()}(self,(()=>(()=>{"use strict";var e={78819:(e,t,o)=>{var r={id:"teambit.explorer/command-bar@1.0.494",homepage:"https://bit.cloud/teambit/explorer/command-bar",exported:!0};function n(){const e=i(o(41594));return n=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,n.__bit_component=r,i.__bit_component=r;const a=()=>n().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},n().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/command-bar.svg"}));a.__bit_component=r,t.Logo=a},41594:e=>{e.exports=React}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};o.r(r),o.d(r,{compositions:()=>u,compositions_metadata:()=>b,overview:()=>f});var n={};o.r(n),o.d(n,{default:()=>m});var i=o(78819);o(41594);const a=MdxJsReact,c=TeambitMdxUiMdxScopeContext;var s=["components"];function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)({}).hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},p.apply(null,arguments)}var d={},l="wrapper";function m(e){var t=e.components,o=function(e,t){if(null==e)return{};var o,r,n=function(e,t){if(null==e)return{};var o={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;o[r]=e[r]}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],t.includes(o)||{}.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}(e,s);return(0,a.mdx)(l,p({},d,o,{components:t,mdxType:"MDXLayout"}),(0,a.mdx)(c.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"},(0,a.mdx)("p",null,"Opens on CMD+K and allows searching for components by name. Typing '> ' inside the command bar displays the different commands and their shortcuts.")))}m.isMDXComponent=!0;const u=[i],f=[n],b={compositions:[{displayName:"Logo",identifier:"Logo"}]};return r})()));
|
package/artifacts/schema.json
CHANGED
|
@@ -630,7 +630,7 @@
|
|
|
630
630
|
"type": "({ ResultComponent, onEnter, }: {\n ResultComponent?: React.ComponentType<ResultsComponentProps> | undefined;\n onEnter?: ((value: string) => void) | undefined;\n}) => React.JSX.Element"
|
|
631
631
|
},
|
|
632
632
|
"isOptional": true,
|
|
633
|
-
"defaultValue": "({\n ResultComponent,\n onEnter,\n }: {\n ResultComponent?: ComponentType<ResultsComponentProps>;\n onEnter?: (value: string) => void;\n }) => {\n const [visible, setVisibility] = useState(false);\n this.setVisibility = setVisibility;\n\n const results = useSearcher(this.search, {\n debounce: this.config.debounce,\n });\n\n return (\n <CommandBar\n {...results}\n onEnter={onEnter}\n
|
|
633
|
+
"defaultValue": "({\n ResultComponent,\n onEnter,\n }: {\n ResultComponent?: ComponentType<ResultsComponentProps>;\n onEnter?: (value: string) => void;\n }) => {\n const [visible, setVisibility] = useState(false);\n this.setVisibility = setVisibility;\n\n const results = useSearcher(this.search, {\n debounce: this.config.debounce,\n });\n\n return (\n <CommandBar\n key=\"CommandBarUI\"\n {...results}\n onEnter={onEnter}\n className={styles.commanderUi}\n placeholder=\"Search anything or type > to only search commands\"\n visible={visible}\n ResultsComponent={ResultComponent}\n onVisibilityChange={setVisibility}\n autofocus\n />\n );\n }"
|
|
634
634
|
},
|
|
635
635
|
{
|
|
636
636
|
"__schema": "VariableLikeSchema",
|
|
@@ -1964,7 +1964,7 @@
|
|
|
1964
1964
|
"type": "({ ResultComponent, onEnter, }: {\n ResultComponent?: React.ComponentType<ResultsComponentProps> | undefined;\n onEnter?: ((value: string) => void) | undefined;\n}) => React.JSX.Element"
|
|
1965
1965
|
},
|
|
1966
1966
|
"isOptional": true,
|
|
1967
|
-
"defaultValue": "({\n ResultComponent,\n onEnter,\n }: {\n ResultComponent?: ComponentType<ResultsComponentProps>;\n onEnter?: (value: string) => void;\n }) => {\n const [visible, setVisibility] = useState(false);\n this.setVisibility = setVisibility;\n\n const results = useSearcher(this.search, {\n debounce: this.config.debounce,\n });\n\n return (\n <CommandBar\n {...results}\n onEnter={onEnter}\n
|
|
1967
|
+
"defaultValue": "({\n ResultComponent,\n onEnter,\n }: {\n ResultComponent?: ComponentType<ResultsComponentProps>;\n onEnter?: (value: string) => void;\n }) => {\n const [visible, setVisibility] = useState(false);\n this.setVisibility = setVisibility;\n\n const results = useSearcher(this.search, {\n debounce: this.config.debounce,\n });\n\n return (\n <CommandBar\n key=\"CommandBarUI\"\n {...results}\n onEnter={onEnter}\n className={styles.commanderUi}\n placeholder=\"Search anything or type > to only search commands\"\n visible={visible}\n ResultsComponent={ResultComponent}\n onVisibilityChange={setVisibility}\n autofocus\n />\n );\n }"
|
|
1968
1968
|
},
|
|
1969
1969
|
{
|
|
1970
1970
|
"__schema": "VariableLikeSchema",
|
|
@@ -2469,7 +2469,7 @@
|
|
|
2469
2469
|
"componentId": {
|
|
2470
2470
|
"scope": "teambit.explorer",
|
|
2471
2471
|
"name": "command-bar",
|
|
2472
|
-
"version": "1.0.
|
|
2472
|
+
"version": "1.0.494"
|
|
2473
2473
|
},
|
|
2474
2474
|
"taggedModuleExports": []
|
|
2475
2475
|
}
|
|
@@ -154,9 +154,9 @@ export class CommandBarUI {
|
|
|
154
154
|
|
|
155
155
|
return (
|
|
156
156
|
<CommandBar
|
|
157
|
+
key="CommandBarUI"
|
|
157
158
|
{...results}
|
|
158
159
|
onEnter={onEnter}
|
|
159
|
-
key="CommandBarUI"
|
|
160
160
|
className={styles.commanderUi}
|
|
161
161
|
placeholder="Search anything or type > to only search commands"
|
|
162
162
|
visible={visible}
|
|
@@ -237,9 +237,10 @@ class CommandBarUI {
|
|
|
237
237
|
const results = (0, _explorerUi().useSearcher)(this.search, {
|
|
238
238
|
debounce: this.config.debounce
|
|
239
239
|
});
|
|
240
|
-
return /*#__PURE__*/_react().default.createElement(_explorerUi().CommandBar, _extends({
|
|
240
|
+
return /*#__PURE__*/_react().default.createElement(_explorerUi().CommandBar, _extends({
|
|
241
|
+
key: "CommandBarUI"
|
|
242
|
+
}, results, {
|
|
241
243
|
onEnter: onEnter,
|
|
242
|
-
key: "CommandBarUI",
|
|
243
244
|
className: _commandBarModule().default.commanderUi,
|
|
244
245
|
placeholder: "Search anything or type > to only search commands",
|
|
245
246
|
visible: visible,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireWildcard","require","_lodash","_interopRequireDefault","_mousetrap","_harmony","_ui","_pubsub","_reactRouter","_uiFoundationUi","_explorerUi","_commandBar","_commandBar2","_searchers","_duplicateCommandError","_mousetrapStub","_keybinding","_commandBar3","_commandBarModule","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","_defineProperty","_toPropertyKey","value","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","RESULT_LIMIT","CommandBarUI","addSearcher","commandSearcher","searcherSlot","register","addCommand","originalCommands","forEach","id","commandId","getCommand","undefined","DuplicateCommandError","commands","map","x","displayName","action","keybinding","commandSlot","command","addKeybinding","updateCommandsSearcher","updaters","next","run","commandEntry","relevantCommands","values","find","filter","pop","flat","update","key","mousetrap","constructor","config","isBrowser","Mousetrap","MousetrapStub","CommandSearcher","setVisibility","trigger","term","limit","searchers","flatten","searcher","test","search","items","ResultComponent","onEnter","visible","useState","results","useSearcher","debounce","createElement","CommandBar","className","styles","commanderUi","placeholder","ResultsComponent","onVisibilityChange","autofocus","CommandBarButton","onClick","provider","uiUi","pubsubUI","commandSlots","commandBar","commandBarCommands","open","openCommandBarKeybinding","sub","CommandBarAspect","keyboardEvent","KeyboardEvent","type","document","dispatchEvent","registerHudItem","exports","UIAspect","PubsubAspect","ReactRouterAspect","Slot","withType","UIRuntime","addRuntime"],"sources":["command-bar.ui.runtime.tsx"],"sourcesContent":["import React, { useState, ComponentType } from 'react';\nimport flatten from 'lodash.flatten';\nimport Mousetrap from 'mousetrap';\nimport { Slot, SlotRegistry } from '@teambit/harmony';\nimport { UIAspect, UIRuntime, UiUI } from '@teambit/ui';\nimport { PubsubAspect, PubsubUI } from '@teambit/pubsub';\nimport { ReactRouterAspect } from '@teambit/react-router';\nimport { isBrowser } from '@teambit/ui-foundation.ui.is-browser';\nimport { CommandBar, useSearcher, ResultsComponentProps } from '@teambit/explorer.ui.command-bar';\nimport { CommandBarAspect } from './command-bar.aspect';\nimport { commandBarCommands } from './command-bar.commands';\nimport { CommandSearcher, SearchProvider } from './searchers';\nimport { Keybinding, CommandHandler, CommandId } from './types';\nimport { DuplicateCommandError } from './duplicate-command-error';\nimport { KeyEvent } from './model/key-event';\nimport { MousetrapStub } from './mousetrap-stub';\nimport { openCommandBarKeybinding } from './keybinding';\nimport { CommandBarButton } from './command-bar.button';\nimport styles from './command-bar.module.scss';\n\nconst RESULT_LIMIT = 5;\ntype SearcherSlot = SlotRegistry<SearchProvider[]>;\ntype CommandSlot = SlotRegistry<CommandEntry[]>;\n\nexport type CommandBarConfig = {\n debounce?: number;\n};\n\nexport type CommandEntry = {\n id: CommandId;\n action: CommandHandler;\n keybinding?: Keybinding;\n displayName: string;\n};\n\n/** Quick launch actions. Use the `addSearcher` slot to extend the available actions */\nexport class CommandBarUI {\n private mousetrap = isBrowser ? new Mousetrap() : new MousetrapStub();\n private commandSearcher = new CommandSearcher([]);\n\n /** Opens the command bar */\n open = () => {\n this.setVisibility?.(true);\n return false; // aka prevent default\n };\n\n /** Closes the command bar */\n close = () => {\n this.setVisibility?.(false);\n };\n\n /** Add and autocomplete provider. To support keyboard navigation, each result should have a props `active: boolean`, and `exectue: () => any` */\n addSearcher(...commandSearcher: SearchProvider[]) {\n this.searcherSlot.register(commandSearcher);\n return this;\n }\n\n /**\n * registers a command\n */\n addCommand(...originalCommands: CommandEntry[]) {\n originalCommands.forEach(({ id: commandId }) => {\n if (this.getCommand(commandId) !== undefined) throw new DuplicateCommandError(commandId);\n });\n\n // commands could mutate later on, clone to ensure immutability 👌\n const commands = originalCommands.map((x) => ({\n id: x.id,\n displayName: x.displayName,\n action: x.action,\n keybinding: x.keybinding,\n }));\n\n this.commandSlot.register(commands);\n\n commands.forEach((command) => {\n if (command.keybinding) {\n this.addKeybinding(command.keybinding, command.id);\n }\n });\n\n this.updateCommandsSearcher();\n\n const updaters = commands.map((command) => (next: CommandHandler) => {\n command.action = next;\n });\n return updaters;\n }\n\n /**\n * executes command by name, if exists.\n * @param commandId\n */\n run(commandId: CommandId) {\n const commandEntry = this.getCommand(commandId);\n if (!commandEntry) return undefined;\n\n return commandEntry.action();\n }\n\n /**\n * executes a keyboard shortcut manually\n */\n trigger = (key: string) => {\n this.mousetrap.trigger(key);\n };\n\n private search = (term: string, limit: number = RESULT_LIMIT) => {\n const searchers = flatten(this.searcherSlot.values());\n\n const searcher = searchers.find((x) => x && x.test(term));\n return searcher?.search(term, limit) || { items: [] };\n };\n\n private getCommand(id: CommandId) {\n const relevantCommands = this.commandSlot\n .values()\n .map((commands) => commands.find((command) => command.id === id))\n .filter((x) => !!x);\n\n return relevantCommands.pop();\n }\n\n private updateCommandsSearcher() {\n const commands = this.commandSlot.values().flat();\n this.commandSearcher.update(commands);\n }\n\n private addKeybinding(key: Keybinding, command: CommandId) {\n this.mousetrap.bind(key, this.run.bind(this, command));\n }\n\n /**\n * Opens and closes the command bar UI.\n */\n setVisibility?: (visible: boolean) => void;\n\n /**\n * generate the ui for command bar\n */\n CommandBar = ({\n ResultComponent,\n onEnter,\n }: {\n ResultComponent?: ComponentType<ResultsComponentProps>;\n onEnter?: (value: string) => void;\n }) => {\n const [visible, setVisibility] = useState(false);\n this.setVisibility = setVisibility;\n\n const results = useSearcher(this.search, {\n debounce: this.config.debounce,\n });\n\n return (\n <CommandBar\n {...results}\n onEnter={onEnter}\n key=\"CommandBarUI\"\n className={styles.commanderUi}\n placeholder=\"Search anything or type > to only search commands\"\n visible={visible}\n ResultsComponent={ResultComponent}\n onVisibilityChange={setVisibility}\n autofocus\n />\n );\n };\n\n CommandBarButton = () => <CommandBarButton onClick={() => this.setVisibility?.(true)} />;\n\n constructor(\n private searcherSlot: SearcherSlot,\n private commandSlot: CommandSlot,\n private config: CommandBarConfig\n ) {}\n\n static dependencies = [UIAspect, PubsubAspect, ReactRouterAspect];\n static slots = [Slot.withType<SearchProvider>(), Slot.withType<CommandEntry[]>()];\n static defaultConfig: CommandBarConfig = {\n debounce: undefined,\n };\n\n static runtime = UIRuntime;\n\n static async provider(\n [uiUi, pubsubUI]: [UiUI | undefined, PubsubUI | undefined],\n config: CommandBarConfig,\n [searcherSlot, commandSlots]: [SearcherSlot, CommandSlot]\n ) {\n const commandBar = new CommandBarUI(searcherSlot, commandSlots, config);\n\n commandBar.addSearcher(commandBar.commandSearcher);\n commandBar.addCommand({\n id: commandBarCommands.open,\n action: commandBar.open,\n displayName: 'Open command bar',\n keybinding: openCommandBarKeybinding,\n });\n\n if (pubsubUI) {\n pubsubUI.sub(CommandBarAspect.id, (e: KeyEvent) => {\n const keyboardEvent = new KeyboardEvent(e.type, e.data);\n document.dispatchEvent(keyboardEvent);\n });\n }\n\n if (uiUi) {\n uiUi.registerHudItem(<commandBar.CommandBar key=\"commandBar\" />);\n }\n\n return commandBar;\n }\n}\n\nCommandBarAspect.addRuntime(CommandBarUI);\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAF,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAI,sBAAA,CAAAF,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,SAAA;E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IACd,CAAC,CAAC;IAEF,IAAIL,QAAQ,EAAE;MACZA,QAAQ,CAACM,GAAG,CAACC,8BAAgB,CAACvE,EAAE,EAAG/C,CAAW,IAAK;QACjD,MAAMuH,aAAa,GAAG,IAAIC,aAAa,CAACxH,CAAC,CAACyH,IAAI,EAAEzH,CAAC,CAACpB,IAAI,CAAC;QACvD8I,QAAQ,CAACC,aAAa,CAACJ,aAAa,CAAC;MACvC,CAAC,CAAC;IACJ;IAEA,IAAIT,IAAI,EAAE;MACRA,IAAI,CAACc,eAAe,cAACjJ,MAAA,GAAAuB,OAAA,CAAAgG,aAAA,CAACe,UAAU,CAACd,UAAU;QAAC1B,GAAG,EAAC;MAAY,CAAE,CAAC,CAAC;IAClE;IAEA,OAAOwC,UAAU;EACnB;AACF;AAACY,OAAA,CAAAtF,YAAA,GAAAA,YAAA;AAAAb,eAAA,CAjLYa,YAAY,kBA6ID,CAACuF,cAAQ,EAAEC,sBAAY,EAAEC,gCAAiB,CAAC;AAAAtG,eAAA,CA7ItDa,YAAY,WA8IR,CAAC0F,eAAI,CAACC,QAAQ,CAAiB,CAAC,EAAED,eAAI,CAACC,QAAQ,CAAiB,CAAC,CAAC;AAAAxG,eAAA,CA9ItEa,YAAY,mBA+IkB;EACvC0D,QAAQ,EAAE/C;AACZ,CAAC;AAAAxB,eAAA,CAjJUa,YAAY,aAmJN4F,eAAS;AAgC5Bb,8BAAgB,CAACc,UAAU,CAAC7F,YAAY,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireWildcard","require","_lodash","_interopRequireDefault","_mousetrap","_harmony","_ui","_pubsub","_reactRouter","_uiFoundationUi","_explorerUi","_commandBar","_commandBar2","_searchers","_duplicateCommandError","_mousetrapStub","_keybinding","_commandBar3","_commandBarModule","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","_defineProperty","_toPropertyKey","value","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","RESULT_LIMIT","CommandBarUI","addSearcher","commandSearcher","searcherSlot","register","addCommand","originalCommands","forEach","id","commandId","getCommand","undefined","DuplicateCommandError","commands","map","x","displayName","action","keybinding","commandSlot","command","addKeybinding","updateCommandsSearcher","updaters","next","run","commandEntry","relevantCommands","values","find","filter","pop","flat","update","key","mousetrap","constructor","config","isBrowser","Mousetrap","MousetrapStub","CommandSearcher","setVisibility","trigger","term","limit","searchers","flatten","searcher","test","search","items","ResultComponent","onEnter","visible","useState","results","useSearcher","debounce","createElement","CommandBar","className","styles","commanderUi","placeholder","ResultsComponent","onVisibilityChange","autofocus","CommandBarButton","onClick","provider","uiUi","pubsubUI","commandSlots","commandBar","commandBarCommands","open","openCommandBarKeybinding","sub","CommandBarAspect","keyboardEvent","KeyboardEvent","type","document","dispatchEvent","registerHudItem","exports","UIAspect","PubsubAspect","ReactRouterAspect","Slot","withType","UIRuntime","addRuntime"],"sources":["command-bar.ui.runtime.tsx"],"sourcesContent":["import React, { useState, ComponentType } from 'react';\nimport flatten from 'lodash.flatten';\nimport Mousetrap from 'mousetrap';\nimport { Slot, SlotRegistry } from '@teambit/harmony';\nimport { UIAspect, UIRuntime, UiUI } from '@teambit/ui';\nimport { PubsubAspect, PubsubUI } from '@teambit/pubsub';\nimport { ReactRouterAspect } from '@teambit/react-router';\nimport { isBrowser } from '@teambit/ui-foundation.ui.is-browser';\nimport { CommandBar, useSearcher, ResultsComponentProps } from '@teambit/explorer.ui.command-bar';\nimport { CommandBarAspect } from './command-bar.aspect';\nimport { commandBarCommands } from './command-bar.commands';\nimport { CommandSearcher, SearchProvider } from './searchers';\nimport { Keybinding, CommandHandler, CommandId } from './types';\nimport { DuplicateCommandError } from './duplicate-command-error';\nimport { KeyEvent } from './model/key-event';\nimport { MousetrapStub } from './mousetrap-stub';\nimport { openCommandBarKeybinding } from './keybinding';\nimport { CommandBarButton } from './command-bar.button';\nimport styles from './command-bar.module.scss';\n\nconst RESULT_LIMIT = 5;\ntype SearcherSlot = SlotRegistry<SearchProvider[]>;\ntype CommandSlot = SlotRegistry<CommandEntry[]>;\n\nexport type CommandBarConfig = {\n debounce?: number;\n};\n\nexport type CommandEntry = {\n id: CommandId;\n action: CommandHandler;\n keybinding?: Keybinding;\n displayName: string;\n};\n\n/** Quick launch actions. Use the `addSearcher` slot to extend the available actions */\nexport class CommandBarUI {\n private mousetrap = isBrowser ? new Mousetrap() : new MousetrapStub();\n private commandSearcher = new CommandSearcher([]);\n\n /** Opens the command bar */\n open = () => {\n this.setVisibility?.(true);\n return false; // aka prevent default\n };\n\n /** Closes the command bar */\n close = () => {\n this.setVisibility?.(false);\n };\n\n /** Add and autocomplete provider. To support keyboard navigation, each result should have a props `active: boolean`, and `exectue: () => any` */\n addSearcher(...commandSearcher: SearchProvider[]) {\n this.searcherSlot.register(commandSearcher);\n return this;\n }\n\n /**\n * registers a command\n */\n addCommand(...originalCommands: CommandEntry[]) {\n originalCommands.forEach(({ id: commandId }) => {\n if (this.getCommand(commandId) !== undefined) throw new DuplicateCommandError(commandId);\n });\n\n // commands could mutate later on, clone to ensure immutability 👌\n const commands = originalCommands.map((x) => ({\n id: x.id,\n displayName: x.displayName,\n action: x.action,\n keybinding: x.keybinding,\n }));\n\n this.commandSlot.register(commands);\n\n commands.forEach((command) => {\n if (command.keybinding) {\n this.addKeybinding(command.keybinding, command.id);\n }\n });\n\n this.updateCommandsSearcher();\n\n const updaters = commands.map((command) => (next: CommandHandler) => {\n command.action = next;\n });\n return updaters;\n }\n\n /**\n * executes command by name, if exists.\n * @param commandId\n */\n run(commandId: CommandId) {\n const commandEntry = this.getCommand(commandId);\n if (!commandEntry) return undefined;\n\n return commandEntry.action();\n }\n\n /**\n * executes a keyboard shortcut manually\n */\n trigger = (key: string) => {\n this.mousetrap.trigger(key);\n };\n\n private search = (term: string, limit: number = RESULT_LIMIT) => {\n const searchers = flatten(this.searcherSlot.values());\n\n const searcher = searchers.find((x) => x && x.test(term));\n return searcher?.search(term, limit) || { items: [] };\n };\n\n private getCommand(id: CommandId) {\n const relevantCommands = this.commandSlot\n .values()\n .map((commands) => commands.find((command) => command.id === id))\n .filter((x) => !!x);\n\n return relevantCommands.pop();\n }\n\n private updateCommandsSearcher() {\n const commands = this.commandSlot.values().flat();\n this.commandSearcher.update(commands);\n }\n\n private addKeybinding(key: Keybinding, command: CommandId) {\n this.mousetrap.bind(key, this.run.bind(this, command));\n }\n\n /**\n * Opens and closes the command bar UI.\n */\n setVisibility?: (visible: boolean) => void;\n\n /**\n * generate the ui for command bar\n */\n CommandBar = ({\n ResultComponent,\n onEnter,\n }: {\n ResultComponent?: ComponentType<ResultsComponentProps>;\n onEnter?: (value: string) => void;\n }) => {\n const [visible, setVisibility] = useState(false);\n this.setVisibility = setVisibility;\n\n const results = useSearcher(this.search, {\n debounce: this.config.debounce,\n });\n\n return (\n <CommandBar\n key=\"CommandBarUI\"\n {...results}\n onEnter={onEnter}\n className={styles.commanderUi}\n placeholder=\"Search anything or type > to only search commands\"\n visible={visible}\n ResultsComponent={ResultComponent}\n onVisibilityChange={setVisibility}\n autofocus\n />\n );\n };\n\n CommandBarButton = () => <CommandBarButton onClick={() => this.setVisibility?.(true)} />;\n\n constructor(\n private searcherSlot: SearcherSlot,\n private commandSlot: CommandSlot,\n private config: CommandBarConfig\n ) {}\n\n static dependencies = [UIAspect, PubsubAspect, ReactRouterAspect];\n static slots = [Slot.withType<SearchProvider>(), Slot.withType<CommandEntry[]>()];\n static defaultConfig: CommandBarConfig = {\n debounce: undefined,\n };\n\n static runtime = UIRuntime;\n\n static async provider(\n [uiUi, pubsubUI]: [UiUI | undefined, PubsubUI | undefined],\n config: CommandBarConfig,\n [searcherSlot, commandSlots]: [SearcherSlot, CommandSlot]\n ) {\n const commandBar = new CommandBarUI(searcherSlot, commandSlots, config);\n\n commandBar.addSearcher(commandBar.commandSearcher);\n commandBar.addCommand({\n id: commandBarCommands.open,\n action: commandBar.open,\n displayName: 'Open command bar',\n keybinding: openCommandBarKeybinding,\n });\n\n if (pubsubUI) {\n pubsubUI.sub(CommandBarAspect.id, (e: KeyEvent) => {\n const keyboardEvent = new KeyboardEvent(e.type, e.data);\n document.dispatchEvent(keyboardEvent);\n });\n }\n\n if (uiUi) {\n uiUi.registerHudItem(<commandBar.CommandBar key=\"commandBar\" />);\n }\n\n return commandBar;\n }\n}\n\nCommandBarAspect.addRuntime(CommandBarUI);\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAF,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAI,sBAAA,CAAAF,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,SAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,QAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,IAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,GAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,QAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;EAAAM,OAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,aAAA;EAAA,MAAAT,IAAA,GAAAE,OAAA;EAAAO,YAAA,YAAAA,CAAA;IAAA,OAAAT,IAAA;EAAA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C,UAAU;EACnB;AACF;AAACY,OAAA,CAAAtF,YAAA,GAAAA,YAAA;AAAAb,eAAA,CAjLYa,YAAY,kBA6ID,CAACuF,cAAQ,EAAEC,sBAAY,EAAEC,gCAAiB,CAAC;AAAAtG,eAAA,CA7ItDa,YAAY,WA8IR,CAAC0F,eAAI,CAACC,QAAQ,CAAiB,CAAC,EAAED,eAAI,CAACC,QAAQ,CAAiB,CAAC,CAAC;AAAAxG,eAAA,CA9ItEa,YAAY,mBA+IkB;EACvC0D,QAAQ,EAAE/C;AACZ,CAAC;AAAAxB,eAAA,CAjJUa,YAAY,aAmJN4F,eAAS;AAgC5Bb,8BAAgB,CAACc,UAAU,CAAC7F,YAAY,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.explorer_command-bar@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.explorer_command-bar@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.explorer_command-bar@1.0.494/dist/command-bar.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.explorer_command-bar@1.0.494/dist/command-bar.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/command-bar",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.494",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/explorer/command-bar",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.explorer",
|
|
8
8
|
"name": "command-bar",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.494"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"lodash.flatten": "4.4.0",
|
|
13
13
|
"mousetrap": "1.6.5",
|
|
14
|
-
"is-primitive": "3.0.1",
|
|
15
14
|
"classnames": "2.2.6",
|
|
15
|
+
"is-primitive": "3.0.1",
|
|
16
16
|
"@teambit/harmony": "0.4.6",
|
|
17
17
|
"@teambit/design.buttons.action-button": "0.0.2",
|
|
18
18
|
"@teambit/explorer.ui.command-bar": "2.0.16",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"@teambit/design.ui.styles.ellipsis": "0.0.357",
|
|
23
23
|
"@teambit/ui-foundation.ui.keycap": "0.0.500",
|
|
24
24
|
"@teambit/workspace.ui.use-workspace-mode": "0.0.2",
|
|
25
|
-
"@teambit/pubsub": "1.0.
|
|
26
|
-
"@teambit/react-router": "1.0.
|
|
27
|
-
"@teambit/ui": "1.0.
|
|
25
|
+
"@teambit/pubsub": "1.0.494",
|
|
26
|
+
"@teambit/react-router": "1.0.494",
|
|
27
|
+
"@teambit/ui": "1.0.494"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/lodash.flatten": "4.4.6",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@types/classnames": "2.2.11",
|
|
33
33
|
"@types/mocha": "9.1.0",
|
|
34
34
|
"@teambit/harmony.envs.core-aspect-env": "0.0.63",
|
|
35
|
-
"@teambit/preview": "1.0.
|
|
35
|
+
"@teambit/preview": "1.0.494"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"react": "^17.0.0 || ^18.0.0",
|