commandbar 1.6.6 → 1.6.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- !function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.commandbar=r():t.commandbar=r()}(this,(function(){return(()=>{var t={296:(t,r,e)=>{"use strict";var o=e(102),n=e(307),i=e(339),a=e(957),s=e(246),c=t.exports=function(t,r){var e,n,c,u,l;return arguments.length<2||"string"!=typeof t?(u=r,r=t,t=null):u=arguments[2],o(t)?(e=s.call(t,"c"),n=s.call(t,"e"),c=s.call(t,"w")):(e=c=!0,n=!1),l={value:r,configurable:e,enumerable:n,writable:c},u?i(a(u),l):l};c.gs=function(t,r,e){var c,u,l,f;return"string"!=typeof t?(l=e,e=r,r=t,t=null):l=arguments[3],o(r)?n(r)?o(e)?n(e)||(l=e,e=void 0):e=void 0:(l=r,r=e=void 0):r=void 0,o(t)?(c=s.call(t,"c"),u=s.call(t,"e")):(c=!0,u=!1),f={get:r,set:e,configurable:c,enumerable:u},l?i(a(l),f):f}},817:t=>{"use strict";t.exports=function(){}},339:(t,r,e)=>{"use strict";t.exports=e(994)()?Object.assign:e(963)},994:t=>{"use strict";t.exports=function(){var t,r=Object.assign;return"function"==typeof r&&(r(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},963:(t,r,e)=>{"use strict";var o=e(450),n=e(836),i=Math.max;t.exports=function(t,r){var e,a,s,c=i(arguments.length,2);for(t=Object(n(t)),s=function(o){try{t[o]=r[o]}catch(t){e||(e=t)}},a=1;a<c;++a)o(r=arguments[a]).forEach(s);if(void 0!==e)throw e;return t}},349:(t,r,e)=>{"use strict";var o=e(817)();t.exports=function(t){return t!==o&&null!==t}},450:(t,r,e)=>{"use strict";t.exports=e(446)()?Object.keys:e(177)},446:t=>{"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},177:(t,r,e)=>{"use strict";var o=e(349),n=Object.keys;t.exports=function(t){return n(o(t)?Object(t):t)}},957:(t,r,e)=>{"use strict";var o=e(349),n=Array.prototype.forEach,i=Object.create,a=function(t,r){var e;for(e in t)r[e]=t[e]};t.exports=function(t){var r=i(null);return n.call(arguments,(function(t){o(t)&&a(Object(t),r)})),r}},836:(t,r,e)=>{"use strict";var o=e(349);t.exports=function(t){if(!o(t))throw new TypeError("Cannot use null or undefined");return t}},246:(t,r,e)=>{"use strict";t.exports=e(711)()?String.prototype.contains:e(370)},711:t=>{"use strict";var r="razdwatrzy";t.exports=function(){return"function"==typeof r.contains&&!0===r.contains("dwa")&&!1===r.contains("foo")}},370:t=>{"use strict";var r=String.prototype.indexOf;t.exports=function(t){return r.call(this,t,arguments[1])>-1}},992:(t,r,e)=>{"use strict";e(98).polyfill()},98:t=>{"use strict";function r(t,r){if(null==t)throw new TypeError("Cannot convert first argument to object");for(var e=Object(t),o=1;o<arguments.length;o++){var n=arguments[o];if(null!=n)for(var i=Object.keys(Object(n)),a=0,s=i.length;a<s;a++){var c=i[a],u=Object.getOwnPropertyDescriptor(n,c);void 0!==u&&u.enumerable&&(e[c]=n[c])}}return e}t.exports={assign:r,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:r})}}},769:(t,r,e)=>{"use strict";e(614)()||Object.defineProperty(e(119),"Symbol",{value:e(798),configurable:!0,enumerable:!1,writable:!0})},614:(t,r,e)=>{"use strict";var o=e(119),n={object:!0,symbol:!0};t.exports=function(){var t,r=o.Symbol;if("function"!=typeof r)return!1;t=r("test symbol");try{String(t)}catch(t){return!1}return!!n[typeof r.iterator]&&!!n[typeof r.toPrimitive]&&!!n[typeof r.toStringTag]}},64:t=>{"use strict";t.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&"Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag])}},573:(t,r,e)=>{"use strict";var o=e(296),n=Object.create,i=Object.defineProperty,a=Object.prototype,s=n(null);t.exports=function(t){for(var r,e,n=0;s[t+(n||"")];)++n;return s[t+=n||""]=!0,i(a,r="@@"+t,o.gs(null,(function(t){e||(e=!0,i(this,r,o(t)),e=!1)}))),r}},572:(t,r,e)=>{"use strict";var o=e(296),n=e(119).Symbol;t.exports=function(t){return Object.defineProperties(t,{hasInstance:o("",n&&n.hasInstance||t("hasInstance")),isConcatSpreadable:o("",n&&n.isConcatSpreadable||t("isConcatSpreadable")),iterator:o("",n&&n.iterator||t("iterator")),match:o("",n&&n.match||t("match")),replace:o("",n&&n.replace||t("replace")),search:o("",n&&n.search||t("search")),species:o("",n&&n.species||t("species")),split:o("",n&&n.split||t("split")),toPrimitive:o("",n&&n.toPrimitive||t("toPrimitive")),toStringTag:o("",n&&n.toStringTag||t("toStringTag")),unscopables:o("",n&&n.unscopables||t("unscopables"))})}},781:(t,r,e)=>{"use strict";var o=e(296),n=e(11),i=Object.create(null);t.exports=function(t){return Object.defineProperties(t,{for:o((function(r){return i[r]?i[r]:i[r]=t(String(r))})),keyFor:o((function(t){var r;for(r in n(t),i)if(i[r]===t)return r}))})}},798:(t,r,e)=>{"use strict";var o,n,i,a=e(296),s=e(11),c=e(119).Symbol,u=e(573),l=e(572),f=e(781),p=Object.create,d=Object.defineProperties,m=Object.defineProperty;if("function"==typeof c)try{String(c()),i=!0}catch(t){}else c=null;n=function(t){if(this instanceof n)throw new TypeError("Symbol is not a constructor");return o(t)},t.exports=o=function t(r){var e;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return i?c(r):(e=p(n.prototype),r=void 0===r?"":String(r),d(e,{__description__:a("",r),__name__:a("",u(r))}))},l(o),f(o),d(n.prototype,{constructor:a(o),toString:a("",(function(){return this.__name__}))}),d(o.prototype,{toString:a((function(){return"Symbol ("+s(this).__description__+")"})),valueOf:a((function(){return s(this)}))}),m(o.prototype,o.toPrimitive,a("",(function(){var t=s(this);return"symbol"==typeof t?t:t.toString()}))),m(o.prototype,o.toStringTag,a("c","Symbol")),m(n.prototype,o.toStringTag,a("c",o.prototype[o.toStringTag])),m(n.prototype,o.toPrimitive,a("c",o.prototype[o.toPrimitive]))},11:(t,r,e)=>{"use strict";var o=e(64);t.exports=function(t){if(!o(t))throw new TypeError(t+" is not a symbol");return t}},308:t=>{var r=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};t.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return r()}try{return __global__||r()}finally{delete Object.prototype.__global__}}()},119:(t,r,e)=>{"use strict";t.exports=e(801)()?globalThis:e(308)},801:t=>{"use strict";t.exports=function(){return"object"==typeof globalThis&&!!globalThis&&globalThis.Array===Array}},656:(t,r,e)=>{"use strict";var o;(o="undefined"!=typeof process&&"[object process]"==={}.toString.call(process)||"undefined"!=typeof navigator&&"ReactNative"===navigator.product?e.g:self).Proxy||(o.Proxy=e(659)(),o.Proxy.revocable=o.Proxy.revocable)},659:t=>{t.exports=function(){let t,r=null;function e(t){return!!t&&("object"==typeof t||"function"==typeof t)}function o(t){if(null!==t&&!e(t))throw new TypeError("Object prototype may only be an Object or null: "+t)}const n=Object,i=Boolean(n.create)||!({__proto__:null}instanceof n),a=n.create||(i?function(t){return o(t),{__proto__:t}}:function(t){if(o(t),null===t)throw new SyntaxError("Native Object.create is required to create objects with null prototype");var r=function(){};return r.prototype=t,new r}),s=function(){return null},c=n.getPrototypeOf||([].__proto__===Array.prototype?function(t){const r=t.__proto__;return e(r)?r:null}:s);return t=function(u,l){if(void 0===(this&&this instanceof t?this.constructor:void 0))throw new TypeError("Constructor Proxy requires 'new'");if(!e(u)||!e(l))throw new TypeError("Cannot create proxy with a non-object as target or handler");let f=function(){};r=function(){u=null,f=function(t){throw new TypeError(`Cannot perform '${t}' on a proxy that has been revoked`)}},setTimeout((function(){r=null}),0);const p=l;l={get:null,set:null,apply:null,construct:null};for(let t in p){if(!(t in l))throw new TypeError(`Proxy polyfill does not support trap '${t}'`);l[t]=p[t]}"function"==typeof p&&(l.apply=p.apply.bind(p));const d=c(u);let m,y=!1,b=!1;"function"==typeof u?(m=function(){const t=this&&this.constructor===m,r=Array.prototype.slice.call(arguments);return f(t?"construct":"apply"),t&&l.construct?l.construct.call(this,u,r):!t&&l.apply?l.apply(u,this,r):t?(r.unshift(u),new(u.bind.apply(u,r))):u.apply(this,r)},y=!0):u instanceof Array?(m=[],b=!0):m=i||null!==d?a(d):{};const _=l.get?function(t){return f("get"),l.get(this,t,m)}:function(t){return f("get"),this[t]},v=l.set?function(t,r){f("set"),l.set(this,t,r,m)}:function(t,r){f("set"),this[t]=r},h=n.getOwnPropertyNames(u),g={};h.forEach((function(t){if((y||b)&&t in m)return;const r=n.getOwnPropertyDescriptor(u,t),e={enumerable:Boolean(r.enumerable),get:_.bind(u,t),set:v.bind(u,t)};n.defineProperty(m,t,e),g[t]=!0}));let w=!0;if(y||b){const t=n.setPrototypeOf||([].__proto__===Array.prototype?function(t,r){return o(r),t.__proto__=r,t}:s);d&&t(m,d)||(w=!1)}if(l.get||!w)for(let t in u)g[t]||n.defineProperty(m,t,{get:_.bind(u,t)});return n.seal(u),n.seal(m),m},t.revocable=function(e,o){return{proxy:new t(e,o),revoke:r}},t}},14:function(t,r,e){"use strict";var o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0}),r.CommandBarClientSDK=r.snippet=r.initProxy=r.init=void 0;var n=e(343);Object.defineProperty(r,"CommandBarClientSDK",{enumerable:!0,get:function(){return n.CommandBarClientSDK}});var i=e(956);Object.defineProperty(r,"init",{enumerable:!0,get:function(){return o(i).default}});var a=e(737);Object.defineProperty(r,"initProxy",{enumerable:!0,get:function(){return a.initProxySDK}});var s=e(890);Object.defineProperty(r,"snippet",{enumerable:!0,get:function(){return s.snippet}})},956:function(t,r,e){"use strict";var o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var r,e=1,o=arguments.length;e<o;e++)for(var n in r=arguments[e])Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n]);return t},o.apply(this,arguments)};Object.defineProperty(r,"__esModule",{value:!0}),e(656),e(992),e(769);var n=e(737),i=e(207),a=function(t){if("complete"===document.readyState){var r=function(t){var r="https://api.commandbar.com",e=[],o=localStorage.getItem("commandbar.lc");o&&o.includes("local")?r="http://localhost:8000":o||"10d7dc04"!==t||(r="https://api-cu.commandbar.com");var n=r+"/latest/"+t;return o&&e.push("lc="+o),e.push("version=2"),n+"?"+e.join("&")}(t),e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src=r,document.head.appendChild(e)}else window.addEventListener("load",a.bind(null,t),{capture:!1,once:!0})},s={debug:!1};r.default=function(t,r){void 0===r&&(r=s);var e=o(o({},s),r);t?(e.debug&&console.log("CommandBar init...",{environment:r.environment,version:r.version}),(0,n.getProxySDK)()[i._configuration]={uuid:t,environment:r.environment,version:r.version,config:r.config},a(t)):console.error("No org specified for CommandBar.init")}},890:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.snippet=void 0,r.snippet=function(t){var r=["Object.assign","Symbol","Symbol.for"].join("%2C"),e=window;function o(t,r){void 0===r&&(r=!1),"complete"!==document.readyState&&window.addEventListener("load",o.bind(null,t,r),{capture:!1,once:!0});var e=document.createElement("script");e.type="text/javascript",e.async=r,e.src=t,document.head.appendChild(e)}function n(){var r;if(void 0===e.CommandBar){delete e.__CommandBarBootstrap__;var n=Symbol.for("CommandBar::configuration"),i=Symbol.for("CommandBar::orgConfig"),a=Symbol.for("CommandBar::disposed"),s=Symbol.for("CommandBar::isProxy"),c=Symbol.for("CommandBar::queue"),u=Symbol.for("CommandBar::unwrap"),l=[],f=localStorage.getItem("commandbar.lc"),p=f&&f.includes("local")?"http://localhost:8000":"https://api.commandbar.com",d=Object.assign(((r={})[n]={uuid:t},r[i]={},r[a]=!1,r[s]=!0,r[c]=new Array,r[u]=function(){return d},r),e.CommandBar),m=["addCommand","boot"],y=d;Object.assign(d,{shareCallbacks:function(){return{}},shareContext:function(){return{}}}),e.CommandBar=new Proxy(d,{get:function(t,r){return r in y?d[r]:m.includes(r)?function(){var t=Array.prototype.slice.call(arguments);return new Promise((function(e,o){t.unshift(r,e,o),d[c].push(t)}))}:function(){var t=Array.prototype.slice.call(arguments);t.unshift(r),d[c].push(t)}}}),null!==f&&l.push("lc=".concat(f)),l.push("version=2"),o("".concat(p,"/latest/").concat(t,"?").concat(l.join("&")),!0)}}void 0===Object.assign||"undefined"==typeof Symbol||void 0===Symbol.for?(e.__CommandBarBootstrap__=n,o("https://polyfill.io/v3/polyfill.min.js?version=3.101.0&callback=__CommandBarBootstrap__&features="+r)):n()}},343:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ASYNC_METHODS=void 0,r.ASYNC_METHODS=["addCommand","boot"]},737:(t,r,e)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.initProxySDK=r.getProxySDK=void 0;var o=e(314),n=e(343),i=e(207);function a(){var t,r,e,o,a=window.CommandBar,s=window.CommandBar;Array.isArray(null==a?void 0:a.q)||"string"==typeof(null==a?void 0:a.uid)?(e=null==a?void 0:a.uid,o=null==a?void 0:a.q):(e=null===(r=null==s?void 0:s[i._configuration])||void 0===r?void 0:r.uuid,o=null==s?void 0:s[i._queue]);var c=((t={})[i._configuration]={uuid:"string"==typeof e?e:""},t[i._disposed]=!1,t[i._isProxy]=!0,t[i._queue]=Array.isArray(o)?o:[],t[i._unwrap]=function(){return c},t),u=c;Object.assign(c,{shareCallbacks:function(){return{}},shareContext:function(){return{}}}),window.CommandBar=new Proxy(c,{get:function(t,r){return r in u?u[r]:n.ASYNC_METHODS.includes(r)?function(){var t=Array.prototype.slice.call(arguments);return new Promise((function(e,o){t.unshift(r,e,o),c[i._queue].push(t)}))}:function(){var t=Array.prototype.slice.call(arguments);t.unshift(r),c[i._queue].push(t)}}})}r.getProxySDK=function(){var t=window.CommandBar;return((0,o.isDisposed)(t)||"boolean"!=typeof t[i._isProxy])&&a(),window.CommandBar[i._unwrap]()},r.initProxySDK=a},207:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r._userAttributes=r._user=r._unwrap=r._state=r._showMessage=r._showGuide=r._setEditorVisible=r._setTestMode=r._setPreviewMode=r._setDashboard=r._search=r._reporter=r._report=r._reloadPlaceholders=r._reloadOrganization=r._reloadCommands=r._queue=r._programmaticTheme=r._perf=r._orgConfig=r._loadEditor=r._isProxy=r._instanceAttributes=r._disposed=r._dispose=r._dispatch=r._configUser=r._configure=r._configuration=r._access=void 0,r._access=Symbol.for("CommandBar::access"),r._configuration=Symbol.for("CommandBar::configuration"),r._configure=Symbol.for("CommandBar::configure"),r._configUser=Symbol.for("CommandBar::configUser"),r._dispatch=Symbol.for("CommandBar::dispatch"),r._dispose=Symbol.for("CommandBar::dispose"),r._disposed=Symbol.for("CommandBar::disposed"),r._instanceAttributes=Symbol.for("CommandBar::instanceAttributes"),r._isProxy=Symbol.for("CommandBar::isProxy"),r._loadEditor=Symbol.for("CommandBar::loadEditor"),r._orgConfig=Symbol.for("CommandBar::orgConfig"),r._perf=Symbol.for("CommandBar::perf"),r._programmaticTheme=Symbol.for("CommandBar::programmaticTheme"),r._queue=Symbol.for("CommandBar::queue"),r._reloadCommands=Symbol.for("CommandBar::reloadCommands"),r._reloadOrganization=Symbol.for("CommandBar::reloadOrganization"),r._reloadPlaceholders=Symbol.for("CommandBar::reloadPlaceholders"),r._report=Symbol.for("CommandBar::report"),r._reporter=Symbol.for("CommandBar::reporter"),r._search=Symbol.for("CommandBar::search"),r._setDashboard=Symbol.for("CommandBar::setDashboard"),r._setPreviewMode=Symbol.for("CommandBar::setPreviewMode"),r._setTestMode=Symbol.for("CommandBar::setTestMode"),r._setEditorVisible=Symbol.for("CommandBar::setEditorVisible"),r._showGuide=Symbol.for("CommandBar::showGuide"),r._showMessage=Symbol.for("CommandBar::showMessage"),r._state=Symbol.for("CommandBar::state"),r._unwrap=Symbol.for("CommandBar::unwrap"),r._user=Symbol.for("CommandBar::user"),r._userAttributes=Symbol.for("CommandBar::userAttributes")},314:(t,r,e)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.dispose=r.isDisposed=r.isDisposable=void 0;var o=e(207),n=function(t){return void 0!==t&&void 0!==t.dispose},i=function(t){return void 0!==t&&void 0!==t[o._dispose]};r.isDisposable=function(t){return void 0===t||n(t)||i(t)},r.isDisposed=function(t){return void 0===t||n(t)&&!0===t._disposed||i(t)&&!0===t[o._disposed]},r.dispose=function(t){void 0!==t&&(i(t)?t[o._dispose]():t.dispose())}},111:(t,r,e)=>{"use strict";var o=e(666);t.exports=function(t){if("function"!=typeof t)return!1;if(!hasOwnProperty.call(t,"length"))return!1;try{if("number"!=typeof t.length)return!1;if("function"!=typeof t.call)return!1;if("function"!=typeof t.apply)return!1}catch(t){return!1}return!o(t)}},617:(t,r,e)=>{"use strict";var o=e(102),n={object:!0,function:!0,undefined:!0};t.exports=function(t){return!!o(t)&&hasOwnProperty.call(n,typeof t)}},307:(t,r,e)=>{"use strict";var o=e(111),n=/^\s*class[\s{/}]/,i=Function.prototype.toString;t.exports=function(t){return!!o(t)&&!n.test(i.call(t))}},666:(t,r,e)=>{"use strict";var o=e(617);t.exports=function(t){if(!o(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},102:t=>{"use strict";t.exports=function(t){return null!=t}}},r={};function e(o){var n=r[o];if(void 0!==n)return n.exports;var i=r[o]={exports:{}};return t[o].call(i.exports,i,i.exports,e),i.exports}return e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),e(14)})()}));
1
+ !function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.commandbar=r():t.commandbar=r()}(this,(function(){return(()=>{var t={296:(t,r,e)=>{"use strict";var o=e(102),n=e(307),i=e(339),a=e(957),s=e(246),c=t.exports=function(t,r){var e,n,c,u,l;return arguments.length<2||"string"!=typeof t?(u=r,r=t,t=null):u=arguments[2],o(t)?(e=s.call(t,"c"),n=s.call(t,"e"),c=s.call(t,"w")):(e=c=!0,n=!1),l={value:r,configurable:e,enumerable:n,writable:c},u?i(a(u),l):l};c.gs=function(t,r,e){var c,u,l,f;return"string"!=typeof t?(l=e,e=r,r=t,t=null):l=arguments[3],o(r)?n(r)?o(e)?n(e)||(l=e,e=void 0):e=void 0:(l=r,r=e=void 0):r=void 0,o(t)?(c=s.call(t,"c"),u=s.call(t,"e")):(c=!0,u=!1),f={get:r,set:e,configurable:c,enumerable:u},l?i(a(l),f):f}},817:t=>{"use strict";t.exports=function(){}},339:(t,r,e)=>{"use strict";t.exports=e(994)()?Object.assign:e(963)},994:t=>{"use strict";t.exports=function(){var t,r=Object.assign;return"function"==typeof r&&(r(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},963:(t,r,e)=>{"use strict";var o=e(450),n=e(836),i=Math.max;t.exports=function(t,r){var e,a,s,c=i(arguments.length,2);for(t=Object(n(t)),s=function(o){try{t[o]=r[o]}catch(t){e||(e=t)}},a=1;a<c;++a)o(r=arguments[a]).forEach(s);if(void 0!==e)throw e;return t}},349:(t,r,e)=>{"use strict";var o=e(817)();t.exports=function(t){return t!==o&&null!==t}},450:(t,r,e)=>{"use strict";t.exports=e(446)()?Object.keys:e(177)},446:t=>{"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},177:(t,r,e)=>{"use strict";var o=e(349),n=Object.keys;t.exports=function(t){return n(o(t)?Object(t):t)}},957:(t,r,e)=>{"use strict";var o=e(349),n=Array.prototype.forEach,i=Object.create,a=function(t,r){var e;for(e in t)r[e]=t[e]};t.exports=function(t){var r=i(null);return n.call(arguments,(function(t){o(t)&&a(Object(t),r)})),r}},836:(t,r,e)=>{"use strict";var o=e(349);t.exports=function(t){if(!o(t))throw new TypeError("Cannot use null or undefined");return t}},246:(t,r,e)=>{"use strict";t.exports=e(711)()?String.prototype.contains:e(370)},711:t=>{"use strict";var r="razdwatrzy";t.exports=function(){return"function"==typeof r.contains&&!0===r.contains("dwa")&&!1===r.contains("foo")}},370:t=>{"use strict";var r=String.prototype.indexOf;t.exports=function(t){return r.call(this,t,arguments[1])>-1}},992:(t,r,e)=>{"use strict";e(98).polyfill()},98:t=>{"use strict";function r(t,r){if(null==t)throw new TypeError("Cannot convert first argument to object");for(var e=Object(t),o=1;o<arguments.length;o++){var n=arguments[o];if(null!=n)for(var i=Object.keys(Object(n)),a=0,s=i.length;a<s;a++){var c=i[a],u=Object.getOwnPropertyDescriptor(n,c);void 0!==u&&u.enumerable&&(e[c]=n[c])}}return e}t.exports={assign:r,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:r})}}},769:(t,r,e)=>{"use strict";e(614)()||Object.defineProperty(e(119),"Symbol",{value:e(798),configurable:!0,enumerable:!1,writable:!0})},614:(t,r,e)=>{"use strict";var o=e(119),n={object:!0,symbol:!0};t.exports=function(){var t,r=o.Symbol;if("function"!=typeof r)return!1;t=r("test symbol");try{String(t)}catch(t){return!1}return!!n[typeof r.iterator]&&!!n[typeof r.toPrimitive]&&!!n[typeof r.toStringTag]}},64:t=>{"use strict";t.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&"Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag])}},573:(t,r,e)=>{"use strict";var o=e(296),n=Object.create,i=Object.defineProperty,a=Object.prototype,s=n(null);t.exports=function(t){for(var r,e,n=0;s[t+(n||"")];)++n;return s[t+=n||""]=!0,i(a,r="@@"+t,o.gs(null,(function(t){e||(e=!0,i(this,r,o(t)),e=!1)}))),r}},572:(t,r,e)=>{"use strict";var o=e(296),n=e(119).Symbol;t.exports=function(t){return Object.defineProperties(t,{hasInstance:o("",n&&n.hasInstance||t("hasInstance")),isConcatSpreadable:o("",n&&n.isConcatSpreadable||t("isConcatSpreadable")),iterator:o("",n&&n.iterator||t("iterator")),match:o("",n&&n.match||t("match")),replace:o("",n&&n.replace||t("replace")),search:o("",n&&n.search||t("search")),species:o("",n&&n.species||t("species")),split:o("",n&&n.split||t("split")),toPrimitive:o("",n&&n.toPrimitive||t("toPrimitive")),toStringTag:o("",n&&n.toStringTag||t("toStringTag")),unscopables:o("",n&&n.unscopables||t("unscopables"))})}},781:(t,r,e)=>{"use strict";var o=e(296),n=e(11),i=Object.create(null);t.exports=function(t){return Object.defineProperties(t,{for:o((function(r){return i[r]?i[r]:i[r]=t(String(r))})),keyFor:o((function(t){var r;for(r in n(t),i)if(i[r]===t)return r}))})}},798:(t,r,e)=>{"use strict";var o,n,i,a=e(296),s=e(11),c=e(119).Symbol,u=e(573),l=e(572),f=e(781),p=Object.create,d=Object.defineProperties,m=Object.defineProperty;if("function"==typeof c)try{String(c()),i=!0}catch(t){}else c=null;n=function(t){if(this instanceof n)throw new TypeError("Symbol is not a constructor");return o(t)},t.exports=o=function t(r){var e;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return i?c(r):(e=p(n.prototype),r=void 0===r?"":String(r),d(e,{__description__:a("",r),__name__:a("",u(r))}))},l(o),f(o),d(n.prototype,{constructor:a(o),toString:a("",(function(){return this.__name__}))}),d(o.prototype,{toString:a((function(){return"Symbol ("+s(this).__description__+")"})),valueOf:a((function(){return s(this)}))}),m(o.prototype,o.toPrimitive,a("",(function(){var t=s(this);return"symbol"==typeof t?t:t.toString()}))),m(o.prototype,o.toStringTag,a("c","Symbol")),m(n.prototype,o.toStringTag,a("c",o.prototype[o.toStringTag])),m(n.prototype,o.toPrimitive,a("c",o.prototype[o.toPrimitive]))},11:(t,r,e)=>{"use strict";var o=e(64);t.exports=function(t){if(!o(t))throw new TypeError(t+" is not a symbol");return t}},308:t=>{var r=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};t.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return r()}try{return __global__||r()}finally{delete Object.prototype.__global__}}()},119:(t,r,e)=>{"use strict";t.exports=e(801)()?globalThis:e(308)},801:t=>{"use strict";t.exports=function(){return"object"==typeof globalThis&&!!globalThis&&globalThis.Array===Array}},656:(t,r,e)=>{"use strict";var o;(o="undefined"!=typeof process&&"[object process]"==={}.toString.call(process)||"undefined"!=typeof navigator&&"ReactNative"===navigator.product?e.g:self).Proxy||(o.Proxy=e(659)(),o.Proxy.revocable=o.Proxy.revocable)},659:t=>{t.exports=function(){let t,r=null;function e(t){return!!t&&("object"==typeof t||"function"==typeof t)}function o(t){if(null!==t&&!e(t))throw new TypeError("Object prototype may only be an Object or null: "+t)}const n=Object,i=Boolean(n.create)||!({__proto__:null}instanceof n),a=n.create||(i?function(t){return o(t),{__proto__:t}}:function(t){if(o(t),null===t)throw new SyntaxError("Native Object.create is required to create objects with null prototype");var r=function(){};return r.prototype=t,new r}),s=function(){return null},c=n.getPrototypeOf||([].__proto__===Array.prototype?function(t){const r=t.__proto__;return e(r)?r:null}:s);return t=function(u,l){if(void 0===(this&&this instanceof t?this.constructor:void 0))throw new TypeError("Constructor Proxy requires 'new'");if(!e(u)||!e(l))throw new TypeError("Cannot create proxy with a non-object as target or handler");let f=function(){};r=function(){u=null,f=function(t){throw new TypeError(`Cannot perform '${t}' on a proxy that has been revoked`)}},setTimeout((function(){r=null}),0);const p=l;l={get:null,set:null,apply:null,construct:null};for(let t in p){if(!(t in l))throw new TypeError(`Proxy polyfill does not support trap '${t}'`);l[t]=p[t]}"function"==typeof p&&(l.apply=p.apply.bind(p));const d=c(u);let m,y=!1,b=!1;"function"==typeof u?(m=function(){const t=this&&this.constructor===m,r=Array.prototype.slice.call(arguments);return f(t?"construct":"apply"),t&&l.construct?l.construct.call(this,u,r):!t&&l.apply?l.apply(u,this,r):t?(r.unshift(u),new(u.bind.apply(u,r))):u.apply(this,r)},y=!0):u instanceof Array?(m=[],b=!0):m=i||null!==d?a(d):{};const _=l.get?function(t){return f("get"),l.get(this,t,m)}:function(t){return f("get"),this[t]},v=l.set?function(t,r){f("set"),l.set(this,t,r,m)}:function(t,r){f("set"),this[t]=r},h=n.getOwnPropertyNames(u),g={};h.forEach((function(t){if((y||b)&&t in m)return;const r=n.getOwnPropertyDescriptor(u,t),e={enumerable:Boolean(r.enumerable),get:_.bind(u,t),set:v.bind(u,t)};n.defineProperty(m,t,e),g[t]=!0}));let S=!0;if(y||b){const t=n.setPrototypeOf||([].__proto__===Array.prototype?function(t,r){return o(r),t.__proto__=r,t}:s);d&&t(m,d)||(S=!1)}if(l.get||!S)for(let t in u)g[t]||n.defineProperty(m,t,{get:_.bind(u,t)});return n.seal(u),n.seal(m),m},t.revocable=function(e,o){return{proxy:new t(e,o),revoke:r}},t}},14:function(t,r,e){"use strict";var o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0}),r.CommandBarClientSDK=r.snippet=r.initProxy=r.init=void 0;var n=e(343);Object.defineProperty(r,"CommandBarClientSDK",{enumerable:!0,get:function(){return n.CommandBarClientSDK}});var i=e(956);Object.defineProperty(r,"init",{enumerable:!0,get:function(){return o(i).default}});var a=e(737);Object.defineProperty(r,"initProxy",{enumerable:!0,get:function(){return a.initProxySDK}});var s=e(890);Object.defineProperty(r,"snippet",{enumerable:!0,get:function(){return s.snippet}})},956:function(t,r,e){"use strict";var o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var r,e=1,o=arguments.length;e<o;e++)for(var n in r=arguments[e])Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n]);return t},o.apply(this,arguments)};Object.defineProperty(r,"__esModule",{value:!0}),e(656),e(992),e(769);var n=e(737),i=e(207),a=function(t){if("complete"===document.readyState){var r=function(t){var r="https://api.commandbar.com",e=[],o=localStorage.getItem("commandbar.lc");o&&o.includes("local")?r="http://localhost:8000":o||"10d7dc04"!==t||(r="https://api-cu.commandbar.com");var n=r+"/latest/"+t;return o&&e.push("lc="+o),e.push("version=2"),n+"?"+e.join("&")}(t),e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src=r,document.head.appendChild(e)}else window.addEventListener("load",a.bind(null,t),{capture:!1,once:!0})},s={debug:!1};r.default=function(t,r){void 0===r&&(r=s);var e=o(o({},s),r);t?(e.debug&&console.log("CommandBar init...",{environment:r.environment,version:r.version}),(0,n.getProxySDK)()[i._configuration]={uuid:t,environment:r.environment,version:r.version,config:r.config},a(t)):console.error("No org specified for CommandBar.init")}},890:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.snippet=void 0,r.snippet=function(t){var r=["Object.assign","Symbol","Symbol.for"].join("%2C"),e=window;function o(t,r){void 0===r&&(r=!1),"complete"!==document.readyState&&window.addEventListener("load",o.bind(null,t,r),{capture:!1,once:!0});var e=document.createElement("script");e.type="text/javascript",e.async=r,e.src=t,document.head.appendChild(e)}function n(){var r;if(void 0===e.CommandBar){delete e.__CommandBarBootstrap__;var n=Symbol.for("CommandBar::configuration"),i=Symbol.for("CommandBar::orgConfig"),a=Symbol.for("CommandBar::disposed"),s=Symbol.for("CommandBar::isProxy"),c=Symbol.for("CommandBar::queue"),u=Symbol.for("CommandBar::unwrap"),l=[],f=localStorage.getItem("commandbar.lc"),p=f&&f.includes("local")?"http://localhost:8000":"https://api.commandbar.com",d=Object.assign(((r={})[n]={uuid:t},r[i]={},r[a]=!1,r[s]=!0,r[c]=new Array,r[u]=function(){return d},r),e.CommandBar),m=["addCommand","boot"],y=d;Object.assign(d,{shareCallbacks:function(){return{}},shareContext:function(){return{}}}),e.CommandBar=new Proxy(d,{get:function(t,r){return r in y?d[r]:m.includes(r)?function(){var t=Array.prototype.slice.call(arguments);return new Promise((function(e,o){t.unshift(r,e,o),d[c].push(t)}))}:function(){var t=Array.prototype.slice.call(arguments);t.unshift(r),d[c].push(t)}}}),null!==f&&l.push("lc=".concat(f)),l.push("version=2"),o("".concat(p,"/latest/").concat(t,"?").concat(l.join("&")),!0)}}void 0===Object.assign||"undefined"==typeof Symbol||void 0===Symbol.for?(e.__CommandBarBootstrap__=n,o("https://polyfill.io/v3/polyfill.min.js?version=3.101.0&callback=__CommandBarBootstrap__&features="+r)):n()}},343:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ASYNC_METHODS=void 0,r.ASYNC_METHODS=["addCommand","boot"]},737:(t,r,e)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.initProxySDK=r.getProxySDK=void 0;var o=e(314),n=e(343),i=e(207);function a(){var t,r,e,o,a=window.CommandBar,s=window.CommandBar;Array.isArray(null==a?void 0:a.q)||"string"==typeof(null==a?void 0:a.uid)?(e=null==a?void 0:a.uid,o=null==a?void 0:a.q):(e=null===(r=null==s?void 0:s[i._configuration])||void 0===r?void 0:r.uuid,o=null==s?void 0:s[i._queue]);var c=((t={})[i._configuration]={uuid:"string"==typeof e?e:""},t[i._disposed]=!1,t[i._isProxy]=!0,t[i._queue]=Array.isArray(o)?o:[],t[i._unwrap]=function(){return c},t),u=c;Object.assign(c,{shareCallbacks:function(){return{}},shareContext:function(){return{}}}),window.CommandBar=new Proxy(c,{get:function(t,r){return r in u?u[r]:n.ASYNC_METHODS.includes(r)?function(){var t=Array.prototype.slice.call(arguments);return new Promise((function(e,o){t.unshift(r,e,o),c[i._queue].push(t)}))}:function(){var t=Array.prototype.slice.call(arguments);t.unshift(r),c[i._queue].push(t)}}})}r.getProxySDK=function(){var t=window.CommandBar;return((0,o.isDisposed)(t)||"boolean"!=typeof t[i._isProxy])&&a(),window.CommandBar[i._unwrap]()},r.initProxySDK=a},207:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r._userAttributes=r._user=r._unwrap=r._state=r._showMessage=r._showGuide=r._shareProgrammaticCommands=r._shareContextSettings=r._setEditorVisible=r._setTestMode=r._setPreviewMode=r._setDashboard=r._search=r._reporter=r._report=r._reloadPlaceholders=r._reloadOrganization=r._reloadCommands=r._queue=r._programmaticTheme=r._perf=r._orgConfig=r._loadEditor=r._isProxy=r._instanceAttributes=r._disposed=r._dispose=r._dispatch=r._configUser=r._configure=r._configuration=r._access=void 0,r._access=Symbol.for("CommandBar::access"),r._configuration=Symbol.for("CommandBar::configuration"),r._configure=Symbol.for("CommandBar::configure"),r._configUser=Symbol.for("CommandBar::configUser"),r._dispatch=Symbol.for("CommandBar::dispatch"),r._dispose=Symbol.for("CommandBar::dispose"),r._disposed=Symbol.for("CommandBar::disposed"),r._instanceAttributes=Symbol.for("CommandBar::instanceAttributes"),r._isProxy=Symbol.for("CommandBar::isProxy"),r._loadEditor=Symbol.for("CommandBar::loadEditor"),r._orgConfig=Symbol.for("CommandBar::orgConfig"),r._perf=Symbol.for("CommandBar::perf"),r._programmaticTheme=Symbol.for("CommandBar::programmaticTheme"),r._queue=Symbol.for("CommandBar::queue"),r._reloadCommands=Symbol.for("CommandBar::reloadCommands"),r._reloadOrganization=Symbol.for("CommandBar::reloadOrganization"),r._reloadPlaceholders=Symbol.for("CommandBar::reloadPlaceholders"),r._report=Symbol.for("CommandBar::report"),r._reporter=Symbol.for("CommandBar::reporter"),r._search=Symbol.for("CommandBar::search"),r._setDashboard=Symbol.for("CommandBar::setDashboard"),r._setPreviewMode=Symbol.for("CommandBar::setPreviewMode"),r._setTestMode=Symbol.for("CommandBar::setTestMode"),r._setEditorVisible=Symbol.for("CommandBar::setEditorVisible"),r._shareContextSettings=Symbol.for("CommandBar::shareContextSettings"),r._shareProgrammaticCommands=Symbol.for("CommandBar::shareProgrammaticCommands"),r._showGuide=Symbol.for("CommandBar::showGuide"),r._showMessage=Symbol.for("CommandBar::showMessage"),r._state=Symbol.for("CommandBar::state"),r._unwrap=Symbol.for("CommandBar::unwrap"),r._user=Symbol.for("CommandBar::user"),r._userAttributes=Symbol.for("CommandBar::userAttributes")},314:(t,r,e)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.dispose=r.isDisposed=r.isDisposable=void 0;var o=e(207),n=function(t){return void 0!==t&&void 0!==t.dispose},i=function(t){return void 0!==t&&void 0!==t[o._dispose]};r.isDisposable=function(t){return void 0===t||n(t)||i(t)},r.isDisposed=function(t){return void 0===t||n(t)&&!0===t._disposed||i(t)&&!0===t[o._disposed]},r.dispose=function(t){void 0!==t&&(i(t)?t[o._dispose]():t.dispose())}},111:(t,r,e)=>{"use strict";var o=e(666);t.exports=function(t){if("function"!=typeof t)return!1;if(!hasOwnProperty.call(t,"length"))return!1;try{if("number"!=typeof t.length)return!1;if("function"!=typeof t.call)return!1;if("function"!=typeof t.apply)return!1}catch(t){return!1}return!o(t)}},617:(t,r,e)=>{"use strict";var o=e(102),n={object:!0,function:!0,undefined:!0};t.exports=function(t){return!!o(t)&&hasOwnProperty.call(n,typeof t)}},307:(t,r,e)=>{"use strict";var o=e(111),n=/^\s*class[\s{/}]/,i=Function.prototype.toString;t.exports=function(t){return!!o(t)&&!n.test(i.call(t))}},666:(t,r,e)=>{"use strict";var o=e(617);t.exports=function(t){if(!o(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},102:t=>{"use strict";t.exports=function(t){return null!=t}}},r={};function e(o){var n=r[o];if(void 0!==n)return n.exports;var i=r[o]={exports:{}};return t[o].call(i.exports,i,i.exports,e),i.exports}return e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),e(14)})()}));
@@ -1,7 +1,7 @@
1
1
  import 'proxy-polyfill';
2
2
  import 'es6-object-assign/auto';
3
3
  import 'es6-symbol/implement';
4
- import { IConfigEndpointResponse } from '@commandbar/internal/middleware/types';
4
+ import { IConfigEndpointResponse } from '../../internal/src/middleware/types';
5
5
  interface IInitOptions {
6
6
  debug?: boolean;
7
7
  environment?: string;
@@ -1,8 +1,19 @@
1
+ export declare type DataRow = {
2
+ icon?: string;
3
+ category?: string;
4
+ label?: string;
5
+ description?: string;
6
+ __actionIcon?: string;
7
+ __breadcrumbs?: string;
8
+ __extraHTML?: string | ((elem: HTMLElement, record: any) => void);
9
+ __preserveSVG?: boolean;
10
+ [key: string]: any;
11
+ } | string;
1
12
  export interface SearchResultsPaginated {
2
13
  pagination: unknown;
3
- data: unknown[];
14
+ data: DataRow[];
4
15
  }
5
- export declare type SearchFunction = (input: string) => unknown[] | Promise<unknown[]>;
16
+ export declare type SearchFunction = (input: string) => DataRow[] | Promise<DataRow[]>;
6
17
  export declare type SearchFunctionPaginated = (input: string, pagination?: unknown) => SearchResultsPaginated | Promise<SearchResultsPaginated>;
7
18
  /** Options to customize CommandBar properties for `key`. */
8
19
  export interface AddContextOptions {
@@ -19,6 +30,10 @@ export interface AddContextOptions {
19
30
  quickFind?: boolean;
20
31
  /** Turn on unfurling for `key`. */
21
32
  unfurl?: boolean;
33
+ /** Show records by default with no input */
34
+ showInDefaultEmptyState?: boolean;
35
+ /** Sort key */
36
+ categorySortKey?: number;
22
37
  };
23
38
  /** Options to customize the style of `key` objects. */
24
39
  renderOptions?: {
@@ -38,7 +53,10 @@ export interface AddContextOptions {
38
53
  * A list of object fields to be searched. If a custom `searchFunction` is provided, matches will be highlighted in
39
54
  * these fields. Field names will be transformed from _camelCase_ or _snake_case_ into _Sentence case_.
40
55
  */
41
- fields?: string[];
56
+ fields?: (string | {
57
+ key: string;
58
+ label: string;
59
+ })[];
42
60
  /**
43
61
  * Adds a custom search function to CommandBar for `key`. This custom search function should take a single argument `input` and return an array of results.
44
62
  *
@@ -53,5 +71,38 @@ export interface AddContextOptions {
53
71
  * @param input What the user has typed into CommandBar
54
72
  */
55
73
  searchFunction?: SearchFunction | SearchFunctionPaginated;
74
+ sortFunction?: (a: DataRow, b: DataRow) => number;
75
+ };
76
+ }
77
+ export interface ArgumentOptions {
78
+ /** The value key of `key` objects you want to use to display the object's label. */
79
+ labelKey?: string;
80
+ /** The value key of `key` objects you want to use to display the object's description (subtext under label). */
81
+ descriptionKey?: string;
82
+ /**
83
+ * Default icon to show alongside `key` objects. Can be a URL (absolute or relative) or emoji character. You can
84
+ * specify a custom icon for every object by setting an `.icon` field.
85
+ */
86
+ defaultIcon?: string;
87
+ /**
88
+ * A list of object fields to be searched. If a custom `searchFunction` is provided, matches will be highlighted in
89
+ * these fields. Field names will be transformed from _camelCase_ or _snake_case_ into _Sentence case_.
90
+ */
91
+ searchableFields?: (string | {
92
+ key: string;
93
+ label: string;
94
+ })[];
95
+ onInputChange?: SearchFunction | SearchFunctionPaginated;
96
+ }
97
+ export interface RecordOptions extends ArgumentOptions {
98
+ recordOptions?: {
99
+ /** The category header name for `key` objects shown during search (not used if `unfurl` is on). */
100
+ categoryName?: string;
101
+ /** Turn on unfurling for `key`. */
102
+ unfurl?: boolean;
103
+ /** Show records by default with no input */
104
+ showInDefaultEmptyState?: boolean;
105
+ /** Sort key */
106
+ categorySortKey?: number;
56
107
  };
57
108
  }
@@ -1,8 +1,10 @@
1
- import { AddContextOptions } from './AddContextOptions';
1
+ import { AddContextOptions, ArgumentOptions, DataRow, RecordOptions } from './AddContextOptions';
2
2
  import { EventHandler } from './EventHandler';
3
3
  import { ICommandFromClientType } from '../middleware/ICommandFromClientType';
4
4
  import { IResourceSettings } from '../middleware/IResourceSettings';
5
- import { ICommandCategoryType } from '../middleware/types';
5
+ import { ICommandCategoryType, DetailPreviewType, DataRowMedata } from '../middleware/types';
6
+ export type { DataRow } from './AddContextOptions';
7
+ export type { DataRowMedata } from '../middleware/types';
6
8
  export declare const ASYNC_METHODS: Array<keyof CommandBarClientSDK>;
7
9
  export declare type BootOptions = string | (UserAttributes & {
8
10
  id: string;
@@ -30,6 +32,7 @@ export declare type InstanceAttributes = {
30
32
  };
31
33
  export declare type CallbackFunction<T, U = Metadata> = (args: T, context: U) => void;
32
34
  export declare type ContextLoader = (chosenValues?: undefined | Record<string, unknown[]>) => unknown;
35
+ export declare type RecordsOrArgumentListLoader = (chosenValues?: undefined | Record<string, unknown[]>) => DataRow[];
33
36
  export declare type CallbackMap = {
34
37
  [name: string]: CallbackFunction<any, any>;
35
38
  };
@@ -59,36 +62,42 @@ export declare type CommandBarClientSDK = Readonly<{
59
62
  */
60
63
  setCategoryConfig(category: string | number, config: Partial<ICommandCategoryType>): void;
61
64
  /**
62
- * Adds any new (key, value) pairs to context. For any existing keys, updates values. Conceptually, `addContext` does
63
- * the following:
64
- * ```typescript
65
- * newContext = {...oldContext, ...ctx}
66
- * ```
65
+ * Provides a list of argument choices to CommandBar. For any keys previously set, updates values.
67
66
  *
68
- * To replace context, use [setContext](#CommandBarClientApi.setContext).
67
+ * @param key Key for the argument choices. Used to associate an argument with choices in the Editor.
69
68
  *
70
- * @param key Key for the object to be added to context, or an object containing multiple context keys to update.
71
- *
72
- * @param initialValue The initial value of `key` in context.
69
+ * @param initialValue The initial choices
73
70
  *
74
71
  * There are two options:
75
72
  * * Static: A literal value (e.g. `["foo", "bar"]`)
76
73
  * * Dynamic: A function to load a set of values for `key`, used to lazily load a list of values. This function will
77
- * be passed as an argument a dictionary of the previously selected argument values, if there are any. Useful for
74
+ * be passed as an argument a dictionary of the previously selected argument values, if the argument is not the first. Useful for
78
75
  * lazily loading longer lists, or loading lists that are dependent on previous arguments.
79
76
  *
80
- * If an array of objects is provided (statically or dynamically) the following reserved keys in those objects will
81
- * trigger special behavior:
82
- * * `category`: Used to visually group the list of values with others that have the same category value.
83
- * * `icon`: Icon to be shown next to each value. Can be a URL (absolute or relative), emoji character, or an SVG
84
- * string (which *must* begin with `<svg` ). Specifying a `.icon` property will override any default set in
85
- * `options.renderOptions.defaultIcon`.
77
+ * If providing a list of objects, there are some reserved fields that will trigger special behavior. See DataRow type
78
+ * for the list of those fields.
86
79
  *
87
80
  * @param options Options to customize CommandBar properties for `key`.
88
81
  *
89
- * @see [AddContextOptions](#AddContextOptions).
82
+ * @see [ArgumentOptions](#ArgumentOptions).
83
+ */
84
+ addArgumentChoices(key: string, initial: DataRow[] | RecordsOrArgumentListLoader, options?: ArgumentOptions): void;
85
+ /**
86
+ * Adds a key, value pair to CommandBar that can be referenced to customize commands: such as in command URLs, availability rules, and recommendation rules.
87
+ *
88
+ * @param key Key for the metadata. Used to reference metadata.
89
+ *
90
+ * @param value The value of the key
91
+ *
92
+ * There are two options:
93
+ * * Static: A literal value (e.g. `addMetadata('isAdmin', true)`)
94
+ * * Dynamic: A function to load a set of values for `key`, used to lazily load a value. Useful for
95
+ * lazily loading data.
90
96
  */
97
+ addMetadata(key: string, value: unknown | ContextLoader): void;
98
+ /** @deprecated Use addRecords, addArgumentChoices, or addMetadata instead. */
91
99
  addContext(key: string, initialValue: ContextLoader, options?: AddContextOptions): void;
100
+ /** @deprecated Use addRecords, addArgumentChoices, or addMetadata instead. */
92
101
  addContext(key: string, initialValue: unknown, options?: AddContextOptions): void;
93
102
  /** @deprecated Use setContext instead. */
94
103
  addContext(ctx: Metadata): void;
@@ -111,6 +120,38 @@ export declare type CommandBarClientSDK = Readonly<{
111
120
  * [eventData you pass to .boot()](https://app.commandbar.com/sdk#boot-eventdata) will be added to each event.
112
121
  */
113
122
  addEventHandler(eventHandler: EventHandler): Promise<void>;
123
+ /**
124
+ * Add a record action for a key
125
+ *
126
+ * @param recordKey The key for record for which to attach an action to
127
+ *
128
+ * @param action The record action
129
+ *
130
+ * @param isDefault Whether this record action should be the default. Only needs to be included if multiple record actions are provided
131
+ *
132
+ * @param showInDefaultList Whether this record action should also be shown in the default list as a command
133
+ */
134
+ addRecordAction(recordKey: string, action: ICommandFromClientType, isDefault?: boolean, showInDefaultList?: boolean): Promise<void>;
135
+ /**
136
+ * Makes records available to CommandBar. Records are searchable data. For any keys previously set, updates values.
137
+ *
138
+ * @param key Key for the records. Used to refer to records in the Editor, such as when creating record actions.
139
+ *
140
+ * @param initialValue The initial records
141
+ *
142
+ * There are two options:
143
+ * * Static: A literal value (e.g. `["foo", "bar"]`)
144
+ * * Dynamic: A function to load a set of values for `key`, used to lazily load a list of values. * Useful for
145
+ * lazily loading longer lists of records.
146
+ *
147
+ * If providing a list of objects, there are some reserved fields that will trigger special behavior. See DataRow type
148
+ * for the list of those fields.
149
+ *
150
+ * @param options Options to customize CommandBar properties for `key`.
151
+ *
152
+ * @see [RecordOptions](#RecordOptions).
153
+ */
154
+ addRecords(key: string, initial: DataRow[] | RecordsOrArgumentListLoader, options?: RecordOptions): void;
114
155
  /**
115
156
  * Sets a router function that link command can use to update the page's URL without triggering a reload. To lean more about using `addRouter` see [Adding a router](https://app.commandbar.com/docs/commands/actions/link#link-types).
116
157
  *
@@ -142,6 +183,14 @@ export declare type CommandBarClientSDK = Readonly<{
142
183
  * @param id The command id to execute. For commands defined via the Editor, you can find this id in the Editor by selecting "Copy code" in the command's ellipsis menu. For commands defined via the SDK, this is the `name` field.
143
184
  */
144
185
  execute(id: number | string): void;
186
+ /**
187
+ * Defines a function
188
+ *
189
+ * @param fn The preview detail generator function. It should accept the following arguments:
190
+ * * `row` {any}
191
+ * * `node` {any}
192
+ */
193
+ generateDetailPreview(fn: (data: DataRow, metadata: DataRowMedata) => undefined | DetailPreviewType): void;
145
194
  /**
146
195
  * Returns an array returning all commands that fit the optional filter function. By default, all commands are returned
147
196
  * @param filter A function that filters out commands based on its properties. These are:
@@ -198,7 +247,7 @@ export declare type CommandBarClientSDK = Readonly<{
198
247
  * @param slug Component slug
199
248
  * @param getHTML Function that returns an html string to be rendered as the component
200
249
  */
201
- setCustomComponent(slug: 'header' | 'footer' | 'input' | 'sidepanel', getHTML: () => string): void;
250
+ setCustomComponent(slug: 'header' | 'input' | 'sidepanel' | 'footer', getHTML: (step?: 'base' | 'multiselect' | 'longtextinput' | 'textinput' | 'select') => string): void;
202
251
  /**
203
252
  * Similar to `addContext`, but also removes any keys that are omitted from the supplied `ctx` from context. It may be
204
253
  * helpful to use this to make large context changes, such as when a user logs out.
@@ -1,11 +1,13 @@
1
1
  import { CommandBarClientSDK, InstanceAttributes, Metadata } from './CommandBarClientSDK';
2
2
  import { EVENT_NAME } from './AnalyticsEventTypes';
3
3
  import { SentryReporter } from './SentryReporter';
4
- import { _access, _configuration, _configure, _configUser, _dispose, _disposed, _userAttributes, _isProxy, _loadEditor, _orgConfig, _perf, _programmaticTheme, _reloadCommands, _reloadOrganization, _reloadPlaceholders, _report, _reporter, _search, _setDashboard, _setPreviewMode, _setTestMode, _showGuide, _showMessage, _user, _instanceAttributes, _setEditorVisible } from './symbols';
4
+ import { _access, _configuration, _configure, _configUser, _dispose, _disposed, _userAttributes, _isProxy, _loadEditor, _orgConfig, _perf, _programmaticTheme, _reloadCommands, _reloadOrganization, _reloadPlaceholders, _report, _reporter, _search, _setDashboard, _setPreviewMode, _setTestMode, _showGuide, _showMessage, _user, _instanceAttributes, _setEditorVisible, _shareContextSettings, _shareProgrammaticCommands } from './symbols';
5
5
  import { SDKConfig } from './SDKConfig';
6
+ import { ICommandType, IResourceSettingsByContextKey } from '../middleware/types';
6
7
  export interface OrgConfig {
7
8
  name?: string;
8
9
  silent?: boolean;
10
+ eventAttributeBlockList?: string[];
9
11
  }
10
12
  export type { SDKConfig } from './SDKConfig';
11
13
  export interface CommandBarSDK extends CommandBarClientSDK {
@@ -36,6 +38,11 @@ export interface CommandBarSDK extends CommandBarClientSDK {
36
38
  readonly [_setPreviewMode]: (on: boolean) => void;
37
39
  readonly [_setTestMode]: (on: boolean) => void;
38
40
  readonly [_setEditorVisible]: (visible: boolean) => void;
41
+ readonly [_shareContextSettings]: () => {
42
+ local: IResourceSettingsByContextKey;
43
+ server: IResourceSettingsByContextKey;
44
+ };
45
+ readonly [_shareProgrammaticCommands]: () => ICommandType[];
39
46
  /** @deprecated */
40
47
  readonly [_showGuide]: (eventName: string, preview?: boolean) => void;
41
48
  /** @deprecated */
@@ -22,6 +22,8 @@ export declare const _setDashboard: unique symbol;
22
22
  export declare const _setPreviewMode: unique symbol;
23
23
  export declare const _setTestMode: unique symbol;
24
24
  export declare const _setEditorVisible: unique symbol;
25
+ export declare const _shareContextSettings: unique symbol;
26
+ export declare const _shareProgrammaticCommands: unique symbol;
25
27
  export declare const _showGuide: unique symbol;
26
28
  export declare const _showMessage: unique symbol;
27
29
  export declare const _state: unique symbol;
@@ -33,6 +33,31 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
33
33
  object: t.StringC;
34
34
  hoverTooltip: t.BooleanC;
35
35
  operation: t.UnionC<[t.LiteralC<"router">, t.LiteralC<"self">, t.LiteralC<"blank">, t.UndefinedC]>;
36
+ }>]>]>, t.IntersectionC<[t.TypeC<{
37
+ type: t.LiteralC<"request">;
38
+ value: t.IntersectionC<[t.TypeC<{
39
+ method: t.UnionC<[t.LiteralC<"get">, t.LiteralC<"delete">, t.LiteralC<"head">, t.LiteralC<"options">, t.LiteralC<"post">, t.LiteralC<"put">, t.LiteralC<"patch">]>;
40
+ url: t.StringC;
41
+ }>, t.PartialC<{
42
+ headers: t.UnknownRecordC;
43
+ body: t.UnknownRecordC;
44
+ onSend: t.StringC;
45
+ onSuccess: t.StringC;
46
+ onError: t.StringC;
47
+ }>]>;
48
+ }>, t.IntersectionC<[t.TypeC<{}>, t.PartialC<{
49
+ commandType: t.UnionC<[t.LiteralC<"independent">, t.LiteralC<"object">, t.LiteralC<"help">]>;
50
+ object: t.StringC;
51
+ hoverTooltip: t.BooleanC;
52
+ operation: t.UnionC<[t.LiteralC<"router">, t.LiteralC<"self">, t.LiteralC<"blank">, t.UndefinedC]>;
53
+ }>]>]>, t.IntersectionC<[t.TypeC<{
54
+ type: t.LiteralC<"appcues">;
55
+ value: t.StringC;
56
+ }>, t.IntersectionC<[t.TypeC<{}>, t.PartialC<{
57
+ commandType: t.UnionC<[t.LiteralC<"independent">, t.LiteralC<"object">, t.LiteralC<"help">]>;
58
+ object: t.StringC;
59
+ hoverTooltip: t.BooleanC;
60
+ operation: t.UnionC<[t.LiteralC<"router">, t.LiteralC<"self">, t.LiteralC<"blank">, t.UndefinedC]>;
36
61
  }>]>]>]>;
37
62
  text: t.StringC;
38
63
  }>, t.PartialC<{
@@ -62,6 +87,8 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
62
87
  loaded: t.ArrayC<t.AnyC>;
63
88
  allow_create: t.BooleanC;
64
89
  allow_create_label: t.StringC;
90
+ show_in_record_action_list: t.BooleanC;
91
+ show_in_default_list: t.BooleanC;
65
92
  }>]>, t.IntersectionC<[t.TypeC<{
66
93
  type: t.LiteralC<"set">;
67
94
  value: t.UnionC<[t.ArrayC<t.StringC>, t.ArrayC<t.NumberC>, t.ArrayC<t.UnknownRecordC>]>;
@@ -142,7 +169,20 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
142
169
  }>]>]>>;
143
170
  category: t.UnionC<[t.NumberC, t.StringC, t.NullC]>;
144
171
  icon: t.UnionC<[t.StringC, t.NullC]>;
145
- celebrate: t.UnionC<[t.RecordC<t.StringC, t.AnyC>, t.NullC]>;
172
+ celebrate: t.UnionC<[t.BooleanC, t.PartialC<{
173
+ angle: t.NumberC;
174
+ spread: t.NumberC;
175
+ width: t.StringC;
176
+ height: t.StringC;
177
+ duration: t.NumberC;
178
+ dragFriction: t.NumberC;
179
+ stagger: t.NumberC;
180
+ startVelocity: t.NumberC;
181
+ elementCount: t.NumberC;
182
+ decay: t.NumberC;
183
+ colors: t.ArrayC<t.StringC>;
184
+ random: t.AnyC;
185
+ }>, t.NullC]>;
146
186
  availability_rules: t.ArrayC<t.IntersectionC<[t.TypeC<{
147
187
  type: t.UnionC<[t.LiteralC<"context">, t.LiteralC<"url">, t.LiteralC<"element">]>;
148
188
  operator: t.KeyofC<{
@@ -202,4 +242,11 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
202
242
  value: t.StringC;
203
243
  reason: t.StringC;
204
244
  }>]>]>>;
245
+ detail: t.UnionC<[t.StringC, t.TypeC<{
246
+ type: t.UnionC<[t.LiteralC<"plaintext">, t.LiteralC<"markdown">, t.LiteralC<"html">, t.LiteralC<"reader">, t.LiteralC<"react">]>;
247
+ value: t.StringC;
248
+ }>, t.ArrayC<t.TypeC<{
249
+ type: t.UnionC<[t.LiteralC<"plaintext">, t.LiteralC<"markdown">, t.LiteralC<"html">, t.LiteralC<"reader">, t.LiteralC<"react">]>;
250
+ value: t.StringC;
251
+ }>>]>;
205
252
  }>]>;
@@ -1,3 +1,5 @@
1
1
  import * as t from 'io-ts';
2
2
  import { CommandFromClientV } from './CommandFromClientV';
3
+ import { ContextArgumentV } from './helpers/argument';
3
4
  export declare type ICommandFromClientType = t.TypeOf<typeof CommandFromClientV>;
5
+ export declare type IContextArgument = t.TypeOf<typeof ContextArgumentV>;
@@ -16,7 +16,10 @@ declare const OrganizationAdditionalV: t.TypeC<{
16
16
  search: t.BooleanC;
17
17
  label_field: t.StringC;
18
18
  useCategory: t.BooleanC;
19
- search_fields: t.ArrayC<t.StringC>;
19
+ search_fields: t.ArrayC<t.UnionC<[t.StringC, t.TypeC<{
20
+ key: t.StringC;
21
+ label: t.StringC;
22
+ }>]>>;
20
23
  auto_execute: t.BooleanC;
21
24
  unfurl: t.BooleanC;
22
25
  description_field: t.StringC;
@@ -24,7 +27,8 @@ declare const OrganizationAdditionalV: t.TypeC<{
24
27
  sort_key: t.NumberC;
25
28
  max_options_count: t.UnionC<[t.NumberC, t.NullC]>;
26
29
  sortFunction: t.AnyC;
27
- default_command_id: t.UnionC<[t.NumberC, t.UndefinedC]>;
30
+ default_command_id: t.UnionC<[t.NumberC, t.StringC, t.UndefinedC]>;
31
+ render_as: t.UnionC<[t.LiteralC<"list">, t.LiteralC<"grid">]>;
28
32
  showResources: t.BooleanC;
29
33
  show_with_no_results: t.BooleanC;
30
34
  search_tab_enabled: t.BooleanC;
@@ -42,7 +46,8 @@ declare const OrganizationAdditionalV: t.TypeC<{
42
46
  allow_event_handlers: t.BooleanC;
43
47
  in_bar_feedback: t.BooleanC;
44
48
  summon_hotkey_override: t.UnionC<[t.StringC, t.NullC]>;
45
- end_user_hotkeys: t.BooleanC;
49
+ end_user_hotkeys: t.UnionC<[t.UndefinedC, t.BooleanC]>;
50
+ end_user_shortcuts_enabled: t.BooleanC;
46
51
  releases_available: t.BooleanC;
47
52
  releases_enabled: t.BooleanC;
48
53
  }>;
@@ -68,7 +73,10 @@ export declare const OrganizationV: t.IntersectionC<[t.IntersectionC<[t.TypeC<{
68
73
  search: t.BooleanC;
69
74
  label_field: t.StringC;
70
75
  useCategory: t.BooleanC;
71
- search_fields: t.ArrayC<t.StringC>;
76
+ search_fields: t.ArrayC<t.UnionC<[t.StringC, t.TypeC<{
77
+ key: t.StringC;
78
+ label: t.StringC;
79
+ }>]>>;
72
80
  auto_execute: t.BooleanC;
73
81
  unfurl: t.BooleanC;
74
82
  description_field: t.StringC;
@@ -76,7 +84,8 @@ export declare const OrganizationV: t.IntersectionC<[t.IntersectionC<[t.TypeC<{
76
84
  sort_key: t.NumberC;
77
85
  max_options_count: t.UnionC<[t.NumberC, t.NullC]>;
78
86
  sortFunction: t.AnyC;
79
- default_command_id: t.UnionC<[t.NumberC, t.UndefinedC]>;
87
+ default_command_id: t.UnionC<[t.NumberC, t.StringC, t.UndefinedC]>;
88
+ render_as: t.UnionC<[t.LiteralC<"list">, t.LiteralC<"grid">]>;
80
89
  showResources: t.BooleanC;
81
90
  show_with_no_results: t.BooleanC;
82
91
  search_tab_enabled: t.BooleanC;
@@ -94,7 +103,8 @@ export declare const OrganizationV: t.IntersectionC<[t.IntersectionC<[t.TypeC<{
94
103
  allow_event_handlers: t.BooleanC;
95
104
  in_bar_feedback: t.BooleanC;
96
105
  summon_hotkey_override: t.UnionC<[t.StringC, t.NullC]>;
97
- end_user_hotkeys: t.BooleanC;
106
+ end_user_hotkeys: t.UnionC<[t.UndefinedC, t.BooleanC]>;
107
+ end_user_shortcuts_enabled: t.BooleanC;
98
108
  releases_available: t.BooleanC;
99
109
  releases_enabled: t.BooleanC;
100
110
  }>]>;
@@ -1,10 +1,17 @@
1
1
  import * as t from 'io-ts';
2
+ export declare const SearchFieldConfigV: t.TypeC<{
3
+ key: t.StringC;
4
+ label: t.StringC;
5
+ }>;
2
6
  export declare const ResourceSettingsV: t.PartialC<{
3
7
  name: t.StringC;
4
8
  search: t.BooleanC;
5
9
  label_field: t.StringC;
6
10
  useCategory: t.BooleanC;
7
- search_fields: t.ArrayC<t.StringC>;
11
+ search_fields: t.ArrayC<t.UnionC<[t.StringC, t.TypeC<{
12
+ key: t.StringC;
13
+ label: t.StringC;
14
+ }>]>>;
8
15
  auto_execute: t.BooleanC;
9
16
  unfurl: t.BooleanC;
10
17
  description_field: t.StringC;
@@ -12,7 +19,8 @@ export declare const ResourceSettingsV: t.PartialC<{
12
19
  sort_key: t.NumberC;
13
20
  max_options_count: t.UnionC<[t.NumberC, t.NullC]>;
14
21
  sortFunction: t.AnyC;
15
- default_command_id: t.UnionC<[t.NumberC, t.UndefinedC]>;
22
+ default_command_id: t.UnionC<[t.NumberC, t.StringC, t.UndefinedC]>;
23
+ render_as: t.UnionC<[t.LiteralC<"list">, t.LiteralC<"grid">]>;
16
24
  showResources: t.BooleanC;
17
25
  show_with_no_results: t.BooleanC;
18
26
  search_tab_enabled: t.BooleanC;
@@ -25,7 +33,10 @@ export declare const ResourceSettingsByContextKeyV: t.RecordC<t.StringC, t.Parti
25
33
  search: t.BooleanC;
26
34
  label_field: t.StringC;
27
35
  useCategory: t.BooleanC;
28
- search_fields: t.ArrayC<t.StringC>;
36
+ search_fields: t.ArrayC<t.UnionC<[t.StringC, t.TypeC<{
37
+ key: t.StringC;
38
+ label: t.StringC;
39
+ }>]>>;
29
40
  auto_execute: t.BooleanC;
30
41
  unfurl: t.BooleanC;
31
42
  description_field: t.StringC;
@@ -33,7 +44,8 @@ export declare const ResourceSettingsByContextKeyV: t.RecordC<t.StringC, t.Parti
33
44
  sort_key: t.NumberC;
34
45
  max_options_count: t.UnionC<[t.NumberC, t.NullC]>;
35
46
  sortFunction: t.AnyC;
36
- default_command_id: t.UnionC<[t.NumberC, t.UndefinedC]>;
47
+ default_command_id: t.UnionC<[t.NumberC, t.StringC, t.UndefinedC]>;
48
+ render_as: t.UnionC<[t.LiteralC<"list">, t.LiteralC<"grid">]>;
37
49
  showResources: t.BooleanC;
38
50
  show_with_no_results: t.BooleanC;
39
51
  search_tab_enabled: t.BooleanC;