commandbar 1.6.13 → 1.6.16

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.
@@ -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},g=n.getOwnPropertyNames(u),h={};g.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),h[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)h[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");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){var e;void 0===r&&(r=s);var c=o(o({},s),r);t?(null===(e=(0,n.getProxySDK)()[i._configuration])||void 0===e?void 0:e.uuid)?console.warn("CommandBar init was called more than once. Skipping the redundant initialization..."):(c.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.DEFAULT_INSTANCE_ATTRIBUTES=r.ASYNC_METHODS=void 0,r.ASYNC_METHODS=["addCommand","boot"],r.DEFAULT_INSTANCE_ATTRIBUTES={canOpenEditor:!0,formFactor:{type:"modal"}}},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
+ !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},g=n.getOwnPropertyNames(u),h={};g.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),h[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)h[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");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){var e;void 0===r&&(r=s);var c=o(o({},s),r);t?(null===(e=(0,n.getProxySDK)()[i._configuration])||void 0===e?void 0:e.uuid)?console.warn("CommandBar init was called more than once. Skipping the redundant initialization..."):(c.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.DEFAULT_INSTANCE_ATTRIBUTES=r.ASYNC_METHODS=void 0,r.ASYNC_METHODS=["addCommand","boot"],r.DEFAULT_INSTANCE_ATTRIBUTES={canOpenEditor:!0,formFactor:{type:"modal"}}},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._reloadNudges=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._reloadNudges=Symbol.for("CommandBar::reloadNudges"),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,9 +1,13 @@
1
+ import { DetailPreviewType } from '../middleware/detailPreview';
1
2
  export declare type DataRow = {
2
3
  icon?: string;
3
4
  category?: string;
4
5
  label?: string;
5
6
  description?: string;
6
7
  __actionIcon?: string;
8
+ __image?: string;
9
+ __heading?: string;
10
+ /** @deprecated Use \_\_heading */
7
11
  __breadcrumbs?: string;
8
12
  __extraHTML?: string | ((elem: HTMLElement, record: any) => void);
9
13
  __preserveSVG?: boolean;
@@ -47,6 +51,7 @@ export interface AddContextOptions {
47
51
  * specify a custom icon for every object by setting an `.icon` field.
48
52
  */
49
53
  defaultIcon?: string;
54
+ detail?: DetailPreviewType;
50
55
  /** The value key of `key` objects you want to use to display the object's description (subtext under label). */
51
56
  descriptionKey?: string;
52
57
  /** The value key of `key` objects you want to use to display the object's label. */
@@ -89,6 +94,7 @@ export interface ArgumentOptions {
89
94
  * specify a custom icon for every object by setting an `.icon` field.
90
95
  */
91
96
  defaultIcon?: string;
97
+ detail?: DetailPreviewType;
92
98
  /**
93
99
  * A list of object fields to be searched. If a custom `searchFunction` is provided, matches will be highlighted in
94
100
  * these fields. Field names will be transformed from _camelCase_ or _snake_case_ into _Sentence case_.
@@ -2,9 +2,10 @@ import { AddContextOptions, ArgumentOptions, DataRow, RecordOptions } from './Ad
2
2
  import { EventHandler } from './EventHandler';
3
3
  import { ICommandFromClientType } from '../middleware/ICommandFromClientType';
4
4
  import { IResourceSettings } from '../middleware/IResourceSettings';
5
- import { ICommandCategoryType, DetailPreviewType, DataRowMedata, ISkinType } from '../middleware/types';
5
+ import { ICommandCategoryType, DetailPreviewType, ISkinType } from '../middleware/types';
6
+ import { DataRowMetadata } from '../middleware/detailPreview';
6
7
  export type { DataRow } from './AddContextOptions';
7
- export type { DataRowMedata } from '../middleware/types';
8
+ export type { DataRowMetadata } from '../middleware/types';
8
9
  export declare const ASYNC_METHODS: Array<keyof CommandBarClientSDK>;
9
10
  export declare type BootOptions = string | (UserAttributes & {
10
11
  id: string;
@@ -47,6 +48,19 @@ export declare type RecordsOrArgumentListLoader = (chosenValues?: undefined | Re
47
48
  export declare type CallbackMap = {
48
49
  [name: string]: CallbackFunction<any, any>;
49
50
  };
51
+ export declare type CustomComponent = {
52
+ mount: (node: HTMLElement) => CustomComponentInstance;
53
+ };
54
+ export declare type CustomComponentInstance = {
55
+ render: (data: DataRow, metadata: DataRowMetadata) => void;
56
+ unmount: () => void;
57
+ };
58
+ export declare type NudgeHandler = ({ slug, content, onClick, timeout, }: {
59
+ slug: string;
60
+ content: string;
61
+ onClick: () => void;
62
+ timeout: number | null;
63
+ }) => void;
50
64
  export declare type CommandBarClientSDK = Readonly<{
51
65
  /**
52
66
  * Adds a callback function to CommandBar. The callback function provided is mapped to `callbackKey`, and can be
@@ -131,6 +145,20 @@ export declare type CommandBarClientSDK = Readonly<{
131
145
  * [eventData you pass to .boot()](https://app.commandbar.com/sdk#boot-eventdata) will be added to each event.
132
146
  */
133
147
  addEventHandler(eventHandler: EventHandler): Promise<void>;
148
+ /**
149
+ * Captures Nudges to be handled by your code. Nudges are a way to send a messages to the user.
150
+ * They are defined in the editor with a trigger and conditions. When the trigger occurs, and the conditions are met,
151
+ * the nudgeHandler is called with the nudge information.
152
+ *
153
+ * You can handle this as you would other in-app messages / notifications / toasts.
154
+ *
155
+ * @param nudgeHandler A function for handling nudges. It is passed an object with the following properties:
156
+ * * `slug`: The slug of the nudge
157
+ * * `content`: The content of the nudge
158
+ * * `onClick`: The default on click behavior for the nudge. E.g., if a nudge is defined in the editor
159
+ * to execute a command on click, then calling `onClick` will execute that command.
160
+ **/
161
+ addNudgeHandler(nudgeHandler: NudgeHandler): void;
134
162
  /**
135
163
  * Add a record action for a key
136
164
  *
@@ -214,7 +242,9 @@ export declare type CommandBarClientSDK = Readonly<{
214
242
  * * `row` {any}
215
243
  * * `node` {any}
216
244
  */
217
- generateDetailPreview(fn: (data: DataRow, metadata: DataRowMedata) => undefined | DetailPreviewType): void;
245
+ generateDetailPreview(fn: (data: DataRow, metadata: DataRowMetadata) => undefined | DetailPreviewType): void;
246
+ addComponent(key: string, name: string, component: CustomComponent): void;
247
+ removeComponent(key: string): void;
218
248
  /**
219
249
  * Returns an array returning all commands that fit the optional filter function. By default, all commands are returned
220
250
  * @param filter A function that filters out commands based on its properties. These are:
@@ -304,6 +334,12 @@ export declare type CommandBarClientSDK = Readonly<{
304
334
  * callback keys, and the values are the supplied functions.
305
335
  */
306
336
  shareCallbacks(): Record<string, CallbackFunction<unknown>>;
337
+ /**
338
+ * Returns dictionary representing the Custom Components currently defined (via addComponent).
339
+ *
340
+ * The keys represent component keys, and the value is the name of the component.
341
+ */
342
+ shareComponentNamesByKey(): Record<string, string>;
307
343
  /** Returns the key value dictionary representing the current state of context */
308
344
  shareContext(): Metadata;
309
345
  /**
@@ -1,7 +1,7 @@
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, _shareContextSettings, _shareProgrammaticCommands } from './symbols';
4
+ import { _access, _configuration, _configure, _configUser, _dispose, _disposed, _userAttributes, _isProxy, _loadEditor, _orgConfig, _perf, _programmaticTheme, _reloadCommands, _reloadOrganization, _reloadPlaceholders, _reloadNudges, _report, _reporter, _search, _setDashboard, _setPreviewMode, _setTestMode, _showGuide, _showMessage, _user, _instanceAttributes, _setEditorVisible, _shareContextSettings, _shareProgrammaticCommands } from './symbols';
5
5
  import { SDKConfig } from './SDKConfig';
6
6
  import { ICommandType, IResourceSettingsByContextKey } from '../middleware/types';
7
7
  import { OrgConfig } from './OrgConfig';
@@ -27,6 +27,7 @@ export interface CommandBarSDK extends CommandBarClientSDK {
27
27
  readonly [_reloadCommands]: () => void;
28
28
  readonly [_reloadOrganization]: () => void;
29
29
  readonly [_reloadPlaceholders]: () => void;
30
+ readonly [_reloadNudges]: () => void;
30
31
  /** @deprecated */
31
32
  readonly [_report]: (event: EVENT_NAME, data?: Metadata) => void;
32
33
  /** @deprecated */
@@ -1,4 +1,5 @@
1
1
  export interface AbandonedSearchEvent {
2
+ type: 'abandoned_search';
2
3
  /** Event data passed for `abandoned_search` events (deadends). */
3
4
  /** The id of the currently active command, if there is one. */
4
5
  command?: number;
@@ -9,7 +10,7 @@ export interface AbandonedSearchEvent {
9
10
  /** The context key of the currently active resource, if there is one. */
10
11
  resource?: string;
11
12
  /** The trigger for the deadend. */
12
- type: 'Backspaced' | 'Closed with text' | 'Resetting search';
13
+ trigger: 'Backspaced' | 'Closed with text' | 'Resetting search';
13
14
  /** The number of {CommandOptions, ParameterOptions}, if there are any. */
14
15
  results?: {
15
16
  numCommands: number;
@@ -19,6 +20,7 @@ export interface AbandonedSearchEvent {
19
20
  previousCommands?: string[];
20
21
  }
21
22
  export interface ClosedEvent {
23
+ type: 'closed';
22
24
  /** Event data passed for `command_execution` events. */
23
25
  /** The user's input text when the bar was closed. */
24
26
  inputText: string;
@@ -26,6 +28,7 @@ export interface ClosedEvent {
26
28
  shortcut?: boolean;
27
29
  }
28
30
  export interface CommandExecutionEvent {
31
+ type: 'command_execution';
29
32
  /** Event data passed for `command_execution` events. */
30
33
  /** The category id of the command. Only provided if the command has a category. */
31
34
  category?: string | number | null;
@@ -49,9 +52,12 @@ export interface CommandExecutionEvent {
49
52
  /** command_ids of previously executed commands in the session */
50
53
  previousCommands?: string[];
51
54
  /** Command types, as defined at: https://www.commandbar.com/docs/commands/types/overview */
52
- commandType?: 'admin' | 'link' | 'script' | 'clickByXpath' | 'clickBySelector' | 'click' | 'callback' | 'builtin' | 'webhook' | 'request' | 'video' | 'appcues';
55
+ commandType?: 'admin' | 'link' | 'script' | 'clickByXpath' | 'clickBySelector' | 'click' | 'callback' | 'builtin' | 'webhook' | 'request' | 'video' | 'helpdoc' | 'appcues';
56
+ /** Selected arguments */
57
+ selections?: Record<string, unknown>;
53
58
  }
54
59
  export interface EndUserShortcutChangedEvent {
60
+ type: 'shortcut_edited';
55
61
  /** Event data passed for `command_execution` events. */
56
62
  /** The category id of the command. Only provided if the command has a category. */
57
63
  category?: number | null;
@@ -70,10 +76,12 @@ export interface EndUserShortcutChangedEvent {
70
76
  defaultShortcut: string;
71
77
  }
72
78
  export interface CommandSuggestionEvent {
79
+ type: 'command_suggestion';
73
80
  /** The text of the suggestion. */
74
81
  text: string;
75
82
  }
76
83
  export interface OpenedEvent {
84
+ type: 'opened';
77
85
  /** Event data passed for `command_execution` events. */
78
86
  /**
79
87
  * The entrypoint through which the bar was opened.
@@ -84,16 +92,17 @@ export interface OpenedEvent {
84
92
  * [commandbar-launcher](https://www.npmjs.com/package/commandbar-launcher) component register as programmatic
85
93
  * opens.
86
94
  */
87
- trigger: 'launcher' | 'keyboard' | 'programmatic';
95
+ trigger: 'launcher' | 'keyboard' | 'programmatic' | 'nudge';
88
96
  /** The placeholder showing when the user opened the bar. */
89
97
  placeholder: string;
90
98
  }
91
99
  export declare type OpenedEventTrigger = OpenedEvent['trigger'];
92
100
  export interface NoResultsForQueryEvent {
101
+ type: 'no_results_for_query';
93
102
  /** Event data passed for `no_results_for_query` event */
94
103
  /** The user's input text when the no results state was reached. */
95
104
  inputText: string;
96
105
  }
97
- export declare type EventData = AbandonedSearchEvent | ClosedEvent | CommandExecutionEvent | CommandSuggestionEvent | OpenedEvent | NoResultsForQueryEvent;
106
+ export declare type EventData = AbandonedSearchEvent | ClosedEvent | CommandExecutionEvent | CommandSuggestionEvent | OpenedEvent | NoResultsForQueryEvent | EndUserShortcutChangedEvent;
98
107
  export declare type EventHandler = (eventName: EventType, eventData: EventData) => void;
99
108
  export declare type EventType = 'abandoned_search' | 'command_suggestion' | 'command_execution' | 'opened' | 'closed' | 'no_results_for_query' | 'client_error' | 'shortcut_edited';
@@ -15,6 +15,7 @@ export declare const _queue: unique symbol;
15
15
  export declare const _reloadCommands: unique symbol;
16
16
  export declare const _reloadOrganization: unique symbol;
17
17
  export declare const _reloadPlaceholders: unique symbol;
18
+ export declare const _reloadNudges: unique symbol;
18
19
  export declare const _report: unique symbol;
19
20
  export declare const _reporter: unique symbol;
20
21
  export declare const _search: unique symbol;
@@ -178,12 +178,13 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
178
178
  auto_choose: t.BooleanC;
179
179
  is_private: t.BooleanC;
180
180
  }>]>, t.IntersectionC<[t.TypeC<{
181
- type: t.LiteralC<"video">;
181
+ type: t.UnionC<[t.LiteralC<"video">, t.LiteralC<"html">]>;
182
182
  value: t.IntersectionC<[t.TypeC<{
183
183
  source: t.StringC;
184
184
  }>, t.PartialC<{
185
185
  title: t.StringC;
186
186
  description: t.StringC;
187
+ url: t.StringC;
187
188
  }>]>;
188
189
  order_key: t.NumberC;
189
190
  }>, t.PartialC<{
@@ -206,6 +207,7 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
206
207
  }>]>]>>;
207
208
  category: t.UnionC<[t.NumberC, t.StringC, t.NullC]>;
208
209
  icon: t.UnionC<[t.StringC, t.NullC]>;
210
+ image: t.UnionC<[t.StringC, t.NullC]>;
209
211
  celebrate: t.UnionC<[t.BooleanC, t.PartialC<{
210
212
  angle: t.NumberC;
211
213
  spread: t.NumberC;
@@ -279,13 +281,15 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
279
281
  value: t.StringC;
280
282
  reason: t.StringC;
281
283
  }>]>]>>;
284
+ availability_expression: t.ArrayC<t.Type<import("./helpers/rules").RuleExpression, import("./helpers/rules").RuleExpression, unknown>>;
285
+ recommend_expression: t.ArrayC<t.Type<import("./helpers/rules").RuleExpression, import("./helpers/rules").RuleExpression, unknown>>;
282
286
  detail: t.UnionC<[t.StringC, t.IntersectionC<[t.TypeC<{
283
- type: t.UnionC<[t.LiteralC<"plaintext">, t.LiteralC<"markdown">, t.LiteralC<"html">, t.LiteralC<"react">, t.LiteralC<"video">, t.NullC]>;
287
+ type: t.UnionC<[t.LiteralC<"plaintext">, t.LiteralC<"markdown">, t.LiteralC<"html">, t.LiteralC<"react">, t.LiteralC<"video">, t.LiteralC<"component">]>;
284
288
  value: t.StringC;
285
289
  }>, t.PartialC<{
286
290
  position: t.UnionC<[t.LiteralC<"inline">, t.LiteralC<"popover">]>;
287
291
  }>]>, t.ArrayC<t.IntersectionC<[t.TypeC<{
288
- type: t.UnionC<[t.LiteralC<"plaintext">, t.LiteralC<"markdown">, t.LiteralC<"html">, t.LiteralC<"react">, t.LiteralC<"video">, t.NullC]>;
292
+ type: t.UnionC<[t.LiteralC<"plaintext">, t.LiteralC<"markdown">, t.LiteralC<"html">, t.LiteralC<"react">, t.LiteralC<"video">, t.LiteralC<"component">]>;
289
293
  value: t.StringC;
290
294
  }>, t.PartialC<{
291
295
  position: t.UnionC<[t.LiteralC<"inline">, t.LiteralC<"popover">]>;
@@ -24,6 +24,7 @@ declare const OrganizationAdditionalV: t.TypeC<{
24
24
  unfurl: t.BooleanC;
25
25
  description_field: t.StringC;
26
26
  icon: t.StringC;
27
+ image: t.StringC;
27
28
  sort_key: t.NumberC;
28
29
  max_options_count: t.UnionC<[t.NumberC, t.NullC]>;
29
30
  sortFunction: t.AnyC;
@@ -38,6 +39,17 @@ declare const OrganizationAdditionalV: t.TypeC<{
38
39
  search_tab_instruction: t.UnionC<[t.StringC, t.NullC]>;
39
40
  setting_pin_to_bottom: t.BooleanC;
40
41
  track_recents: t.BooleanC;
42
+ detail: t.UnionC<[t.NullC, t.StringC, t.IntersectionC<[t.TypeC<{
43
+ type: t.UnionC<[t.LiteralC<"plaintext">, t.LiteralC<"markdown">, t.LiteralC<"html">, t.LiteralC<"react">, t.LiteralC<"video">, t.LiteralC<"component">]>;
44
+ value: t.StringC;
45
+ }>, t.PartialC<{
46
+ position: t.UnionC<[t.LiteralC<"inline">, t.LiteralC<"popover">]>;
47
+ }>]>, t.ArrayC<t.UnionC<[t.StringC, t.IntersectionC<[t.TypeC<{
48
+ type: t.UnionC<[t.LiteralC<"plaintext">, t.LiteralC<"markdown">, t.LiteralC<"html">, t.LiteralC<"react">, t.LiteralC<"video">, t.LiteralC<"component">]>;
49
+ value: t.StringC;
50
+ }>, t.PartialC<{
51
+ position: t.UnionC<[t.LiteralC<"inline">, t.LiteralC<"popover">]>;
52
+ }>]>]>>]>;
41
53
  }>>;
42
54
  should_show_onboarding: t.BooleanC;
43
55
  last_snippet_request: t.UnionC<[t.StringC, t.NullC]>;
@@ -93,6 +105,7 @@ export declare const OrganizationV: t.IntersectionC<[t.IntersectionC<[t.TypeC<{
93
105
  unfurl: t.BooleanC;
94
106
  description_field: t.StringC;
95
107
  icon: t.StringC;
108
+ image: t.StringC;
96
109
  sort_key: t.NumberC;
97
110
  max_options_count: t.UnionC<[t.NumberC, t.NullC]>;
98
111
  sortFunction: t.AnyC;
@@ -107,6 +120,17 @@ export declare const OrganizationV: t.IntersectionC<[t.IntersectionC<[t.TypeC<{
107
120
  search_tab_instruction: t.UnionC<[t.StringC, t.NullC]>;
108
121
  setting_pin_to_bottom: t.BooleanC;
109
122
  track_recents: t.BooleanC;
123
+ detail: t.UnionC<[t.NullC, t.StringC, t.IntersectionC<[t.TypeC<{
124
+ type: t.UnionC<[t.LiteralC<"plaintext">, t.LiteralC<"markdown">, t.LiteralC<"html">, t.LiteralC<"react">, t.LiteralC<"video">, t.LiteralC<"component">]>;
125
+ value: t.StringC;
126
+ }>, t.PartialC<{
127
+ position: t.UnionC<[t.LiteralC<"inline">, t.LiteralC<"popover">]>;
128
+ }>]>, t.ArrayC<t.UnionC<[t.StringC, t.IntersectionC<[t.TypeC<{
129
+ type: t.UnionC<[t.LiteralC<"plaintext">, t.LiteralC<"markdown">, t.LiteralC<"html">, t.LiteralC<"react">, t.LiteralC<"video">, t.LiteralC<"component">]>;
130
+ value: t.StringC;
131
+ }>, t.PartialC<{
132
+ position: t.UnionC<[t.LiteralC<"inline">, t.LiteralC<"popover">]>;
133
+ }>]>]>>]>;
110
134
  }>>;
111
135
  should_show_onboarding: t.BooleanC;
112
136
  last_snippet_request: t.UnionC<[t.StringC, t.NullC]>;
@@ -16,6 +16,7 @@ export declare const ResourceSettingsV: t.PartialC<{
16
16
  unfurl: t.BooleanC;
17
17
  description_field: t.StringC;
18
18
  icon: t.StringC;
19
+ image: t.StringC;
19
20
  sort_key: t.NumberC;
20
21
  max_options_count: t.UnionC<[t.NumberC, t.NullC]>;
21
22
  sortFunction: t.AnyC;
@@ -30,6 +31,17 @@ export declare const ResourceSettingsV: t.PartialC<{
30
31
  search_tab_instruction: t.UnionC<[t.StringC, t.NullC]>;
31
32
  setting_pin_to_bottom: t.BooleanC;
32
33
  track_recents: t.BooleanC;
34
+ detail: t.UnionC<[t.NullC, t.StringC, t.IntersectionC<[t.TypeC<{
35
+ type: t.UnionC<[t.LiteralC<"plaintext">, t.LiteralC<"markdown">, t.LiteralC<"html">, t.LiteralC<"react">, t.LiteralC<"video">, t.LiteralC<"component">]>;
36
+ value: t.StringC;
37
+ }>, t.PartialC<{
38
+ position: t.UnionC<[t.LiteralC<"inline">, t.LiteralC<"popover">]>;
39
+ }>]>, t.ArrayC<t.UnionC<[t.StringC, t.IntersectionC<[t.TypeC<{
40
+ type: t.UnionC<[t.LiteralC<"plaintext">, t.LiteralC<"markdown">, t.LiteralC<"html">, t.LiteralC<"react">, t.LiteralC<"video">, t.LiteralC<"component">]>;
41
+ value: t.StringC;
42
+ }>, t.PartialC<{
43
+ position: t.UnionC<[t.LiteralC<"inline">, t.LiteralC<"popover">]>;
44
+ }>]>]>>]>;
33
45
  }>;
34
46
  export declare const ResourceSettingsByContextKeyV: t.RecordC<t.StringC, t.PartialC<{
35
47
  name: t.StringC;
@@ -44,6 +56,7 @@ export declare const ResourceSettingsByContextKeyV: t.RecordC<t.StringC, t.Parti
44
56
  unfurl: t.BooleanC;
45
57
  description_field: t.StringC;
46
58
  icon: t.StringC;
59
+ image: t.StringC;
47
60
  sort_key: t.NumberC;
48
61
  max_options_count: t.UnionC<[t.NumberC, t.NullC]>;
49
62
  sortFunction: t.AnyC;
@@ -58,4 +71,15 @@ export declare const ResourceSettingsByContextKeyV: t.RecordC<t.StringC, t.Parti
58
71
  search_tab_instruction: t.UnionC<[t.StringC, t.NullC]>;
59
72
  setting_pin_to_bottom: t.BooleanC;
60
73
  track_recents: t.BooleanC;
74
+ detail: t.UnionC<[t.NullC, t.StringC, t.IntersectionC<[t.TypeC<{
75
+ type: t.UnionC<[t.LiteralC<"plaintext">, t.LiteralC<"markdown">, t.LiteralC<"html">, t.LiteralC<"react">, t.LiteralC<"video">, t.LiteralC<"component">]>;
76
+ value: t.StringC;
77
+ }>, t.PartialC<{
78
+ position: t.UnionC<[t.LiteralC<"inline">, t.LiteralC<"popover">]>;
79
+ }>]>, t.ArrayC<t.UnionC<[t.StringC, t.IntersectionC<[t.TypeC<{
80
+ type: t.UnionC<[t.LiteralC<"plaintext">, t.LiteralC<"markdown">, t.LiteralC<"html">, t.LiteralC<"react">, t.LiteralC<"video">, t.LiteralC<"component">]>;
81
+ value: t.StringC;
82
+ }>, t.PartialC<{
83
+ position: t.UnionC<[t.LiteralC<"inline">, t.LiteralC<"popover">]>;
84
+ }>]>]>>]>;
61
85
  }>>;