@axinom/mosaic-fe-samples-host 0.42.0 → 0.43.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Profiles → cjs/Profiles}/ProfileURLs.d.ts +2 -2
- package/dist/cjs/Profiles/ProfileURLs.d.ts.map +1 -0
- package/dist/{Profiles → cjs/Profiles}/ProfileVariables.d.ts +2 -2
- package/dist/cjs/Profiles/ProfileVariables.d.ts.map +1 -0
- package/dist/{Profiles → cjs/Profiles}/Profiles.d.ts +1 -1
- package/dist/cjs/Profiles/Profiles.d.ts.map +1 -0
- package/dist/{ScenarioHost → cjs/ScenarioHost}/ScenarioHost.d.ts +3 -3
- package/dist/cjs/ScenarioHost/ScenarioHost.d.ts.map +1 -0
- package/dist/{ScenarioHost → cjs/ScenarioHost}/ScenarioHostLogger.d.ts +1 -1
- package/dist/cjs/ScenarioHost/ScenarioHostLogger.d.ts.map +1 -0
- package/dist/cjs/ScenarioHost/ScenarioHostSplit.d.ts +10 -0
- package/dist/cjs/ScenarioHost/ScenarioHostSplit.d.ts.map +1 -0
- package/dist/{ScenarioHostApp → cjs/ScenarioHostApp}/ScenarioHostApp.d.ts +1 -1
- package/dist/cjs/ScenarioHostApp/ScenarioHostApp.d.ts.map +1 -0
- package/dist/{VariableSearch → cjs/VariableSearch}/VariableSearch.d.ts +1 -1
- package/dist/cjs/VariableSearch/VariableSearch.d.ts.map +1 -0
- package/dist/cjs/common/types/logger.d.ts.map +1 -0
- package/dist/cjs/common/types/profile-config.d.ts.map +1 -0
- package/dist/{common → cjs/common}/types/scenario-registration.d.ts +1 -1
- package/dist/cjs/common/types/scenario-registration.d.ts.map +1 -0
- package/dist/cjs/common/types/user-settings.d.ts.map +1 -0
- package/dist/{common → cjs/common}/utils/storage-utils.d.ts +2 -2
- package/dist/cjs/common/utils/storage-utils.d.ts.map +1 -0
- package/dist/cjs/index.d.ts +7 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/{index.js → cjs/index.js} +203 -145
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/esm/Profiles/ProfileURLs.d.ts +10 -0
- package/dist/esm/Profiles/ProfileURLs.d.ts.map +1 -0
- package/dist/esm/Profiles/ProfileVariables.d.ts +12 -0
- package/dist/esm/Profiles/ProfileVariables.d.ts.map +1 -0
- package/dist/esm/Profiles/Profiles.d.ts +11 -0
- package/dist/esm/Profiles/Profiles.d.ts.map +1 -0
- package/dist/esm/ScenarioHost/ScenarioHost.d.ts +21 -0
- package/dist/esm/ScenarioHost/ScenarioHost.d.ts.map +1 -0
- package/dist/esm/ScenarioHost/ScenarioHostLogger.d.ts +14 -0
- package/dist/esm/ScenarioHost/ScenarioHostLogger.d.ts.map +1 -0
- package/dist/esm/ScenarioHost/ScenarioHostSplit.d.ts +10 -0
- package/dist/esm/ScenarioHost/ScenarioHostSplit.d.ts.map +1 -0
- package/dist/esm/ScenarioHostApp/ScenarioHostApp.d.ts +7 -0
- package/dist/esm/ScenarioHostApp/ScenarioHostApp.d.ts.map +1 -0
- package/dist/esm/VariableSearch/VariableSearch.d.ts +19 -0
- package/dist/esm/VariableSearch/VariableSearch.d.ts.map +1 -0
- package/dist/esm/common/types/logger.d.ts +14 -0
- package/dist/esm/common/types/logger.d.ts.map +1 -0
- package/dist/esm/common/types/profile-config.d.ts +22 -0
- package/dist/esm/common/types/profile-config.d.ts.map +1 -0
- package/dist/esm/common/types/scenario-registration.d.ts +34 -0
- package/dist/esm/common/types/scenario-registration.d.ts.map +1 -0
- package/dist/esm/common/types/user-settings.d.ts +5 -0
- package/dist/esm/common/types/user-settings.d.ts.map +1 -0
- package/dist/esm/common/utils/storage-utils.d.ts +31 -0
- package/dist/esm/common/utils/storage-utils.d.ts.map +1 -0
- package/dist/esm/index.d.ts +7 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/{index.es.js → esm/index.js} +189 -131
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +1 -0
- package/package.json +16 -8
- package/src/Profiles/ProfileURLs.tsx +2 -2
- package/src/Profiles/ProfileVariables.tsx +2 -2
- package/src/Profiles/Profiles.tsx +2 -2
- package/src/ScenarioHost/ScenarioHost.tsx +12 -11
- package/src/ScenarioHost/ScenarioHostLogger.tsx +1 -1
- package/src/ScenarioHost/ScenarioHostSplit.tsx +180 -0
- package/src/ScenarioHostApp/ScenarioHostApp.tsx +1 -1
- package/src/VariableSearch/VariableSearch.tsx +5 -1
- package/src/common/types/scenario-registration.ts +1 -1
- package/src/common/utils/storage-utils.ts +2 -2
- package/src/index.ts +9 -6
- package/dist/Profiles/ProfileURLs.d.ts.map +0 -1
- package/dist/Profiles/ProfileVariables.d.ts.map +0 -1
- package/dist/Profiles/Profiles.d.ts.map +0 -1
- package/dist/ScenarioHost/ScenarioHost.d.ts.map +0 -1
- package/dist/ScenarioHost/ScenarioHostLogger.d.ts.map +0 -1
- package/dist/ScenarioHostApp/ScenarioHostApp.d.ts.map +0 -1
- package/dist/VariableSearch/VariableSearch.d.ts.map +0 -1
- package/dist/common/types/logger.d.ts.map +0 -1
- package/dist/common/types/profile-config.d.ts.map +0 -1
- package/dist/common/types/scenario-registration.d.ts.map +0 -1
- package/dist/common/types/user-settings.d.ts.map +0 -1
- package/dist/common/utils/storage-utils.d.ts.map +0 -1
- package/dist/index.d.ts +0 -7
- package/dist/index.d.ts.map +0 -1
- package/dist/index.es.js.map +0 -1
- package/dist/index.js.map +0 -1
- /package/dist/{common → cjs/common}/types/logger.d.ts +0 -0
- /package/dist/{common → cjs/common}/types/profile-config.d.ts +0 -0
- /package/dist/{common → cjs/common}/types/user-settings.d.ts +0 -0
|
@@ -9,44 +9,25 @@ var semanticUiReact = require('semantic-ui-react');
|
|
|
9
9
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
10
|
|
|
11
11
|
function _interopNamespace(e) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
if (e && e.__esModule) return e;
|
|
13
|
+
var n = Object.create(null);
|
|
14
|
+
if (e) {
|
|
15
|
+
Object.keys(e).forEach(function (k) {
|
|
16
|
+
if (k !== 'default') {
|
|
17
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
18
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () { return e[k]; }
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
n["default"] = e;
|
|
26
|
+
return Object.freeze(n);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
30
29
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
31
|
-
|
|
32
|
-
function createCommonjsModule(fn, basedir, module) {
|
|
33
|
-
return module = {
|
|
34
|
-
path: basedir,
|
|
35
|
-
exports: {},
|
|
36
|
-
require: function (path, base) {
|
|
37
|
-
return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
|
|
38
|
-
}
|
|
39
|
-
}, fn(module, module.exports), module.exports;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function commonjsRequire () {
|
|
43
|
-
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
var build = createCommonjsModule(function (module, exports) {
|
|
47
|
-
!function(e,t){module.exports=t(React__default["default"]);}(window,(function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r});},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=9)}([function(t,n){t.exports=e;},function(e,t,n){e.exports=n(13)();},function(e,t,n){n.d(t,"a",(function(){return o}));var r=n(0);n(11);const i=e=>(e%2==0?2:3)+"px",o=e=>{const{dragging:t,pixelSize:n,color:o="silver",hoverColor:s="gray",dragColor:a="black"}=e,c={"--default-splitter-line-margin":(l=n,Math.max(0,Math.floor(l/2)-1)+"px"),"--default-splitter-line-size":i(n),"--default-splitter-line-color":t?a:o,"--default-splitter-line-hover-color":t?a:s};var l;return r.createElement("div",{className:"default-splitter",style:c},r.createElement("div",{className:"line"}))};},function(e,t,n){var r,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head;}catch(e){n=null;}e[t]=n;}return e[t]}}(),s=[];function a(e){for(var t=-1,n=0;n<s.length;n++)if(s[n].identifier===e){t=n;break}return t}function c(e,t){for(var n={},r=[],i=0;i<e.length;i++){var o=e[i],c=t.base?o[0]+t.base:o[0],l=n[c]||0,u="".concat(c," ").concat(l);n[c]=l+1;var p=a(u),d={css:o[1],media:o[2],sourceMap:o[3]};-1!==p?(s[p].references++,s[p].updater(d)):s.push({identifier:u,updater:m(d,t),references:1}),r.push(u);}return r}function l(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var i=n.nc;i&&(r.nonce=i);}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e]);})),"function"==typeof e.insert)e.insert(t);else {var s=o(e.insert||"head");if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(t);}return t}var u,p=(u=[],function(e,t){return u[e]=t,u.filter(Boolean).join("\n")});function d(e,t,n,r){var i=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=p(t,i);else {var o=document.createTextNode(i),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(o,s[t]):e.appendChild(o);}}function f(e,t,n){var r=n.css,i=n.media,o=n.sourceMap;if(i?e.setAttribute("media",i):e.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleSheet)e.styleSheet.cssText=r;else {for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r));}}var h=null,v=0;function m(e,t){var n,r,i;if(t.singleton){var o=v++;n=h||(h=l(t)),r=d.bind(null,n,o,!1),i=d.bind(null,n,o,!0);}else n=l(t),r=f.bind(null,n,t),i=function(){!function(e){if(null===e.parentNode)return !1;e.parentNode.removeChild(e);}(n);};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t);}else i();}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=i());var n=c(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var i=a(n[r]);s[i].references--;}for(var o=c(e,t),l=0;l<n.length;l++){var u=a(n[l]);0===s[u].references&&(s[u].updater(),s.splice(u,1));}n=o;}}};},function(e,t,n){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var i=(s=r,a=btoa(unescape(encodeURIComponent(JSON.stringify(s)))),c="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(a),"/*# ".concat(c," */")),o=r.sources.map((function(e){return "/*# sourceURL=".concat(r.sourceRoot||"").concat(e," */")}));return [n].concat(o).concat([i]).join("\n")}var s,a,c;return [n].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(r)for(var o=0;o<this.length;o++){var s=this[o][0];null!=s&&(i[s]=!0);}for(var a=0;a<e.length;a++){var c=[].concat(e[a]);r&&i[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),t.push(c));}},t};},function(e,t){},function(e,t,n){n.d(t,"a",(function(){return _}));var r=n(0);function i(){return (i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);}return e}).apply(this,arguments)}var o=n(7);var s=n(1),a=n.n(s),c=n(8),l=["client","offset","scroll","bounds","margin"];function u(e){var t=[];return l.forEach((function(n){e[n]&&t.push(n);})),t}function p(e,t){var n={};if(t.indexOf("client")>-1&&(n.client={top:e.clientTop,left:e.clientLeft,width:e.clientWidth,height:e.clientHeight}),t.indexOf("offset")>-1&&(n.offset={top:e.offsetTop,left:e.offsetLeft,width:e.offsetWidth,height:e.offsetHeight}),t.indexOf("scroll")>-1&&(n.scroll={top:e.scrollTop,left:e.scrollLeft,width:e.scrollWidth,height:e.scrollHeight}),t.indexOf("bounds")>-1){var r=e.getBoundingClientRect();n.bounds={top:r.top,right:r.right,bottom:r.bottom,left:r.left,width:r.width,height:r.height};}if(t.indexOf("margin")>-1){var i=getComputedStyle(e);n.margin={top:i?parseInt(i.marginTop):0,right:i?parseInt(i.marginRight):0,bottom:i?parseInt(i.marginBottom):0,left:i?parseInt(i.marginLeft):0};}return n}function d(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||window}var f,h,v,b=(f=function(e){var t=e.measure,n=e.measureRef,r=e.contentRect;return (0, e.children)({measure:t,measureRef:n,contentRect:r})},v=h=function(e){var t,n;function s(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return (t=e.call.apply(e,[this].concat(r))||this).state={contentRect:{entry:{},client:{},offset:{},scroll:{},bounds:{},margin:{}}},t._animationFrameID=null,t._resizeObserver=null,t._node=null,t._window=null,t.measure=function(e){var n=p(t._node,u(t.props));e&&(n.entry=e[0].contentRect),t._animationFrameID=t._window.requestAnimationFrame((function(){null!==t._resizeObserver&&(t.setState({contentRect:n}),"function"==typeof t.props.onResize&&t.props.onResize(n));}));},t._handleRef=function(e){null!==t._resizeObserver&&null!==t._node&&t._resizeObserver.unobserve(t._node),t._node=e,t._window=d(t._node);var n=t.props.innerRef;n&&("function"==typeof n?n(t._node):n.current=t._node),null!==t._resizeObserver&&null!==t._node&&t._resizeObserver.observe(t._node);},t}n=e,(t=s).prototype=Object.create(n.prototype),t.prototype.constructor=t,o(t,n);var a=s.prototype;return a.componentDidMount=function(){this._resizeObserver=null!==this._window&&this._window.ResizeObserver?new this._window.ResizeObserver(this.measure):new c.a(this.measure),null!==this._node&&(this._resizeObserver.observe(this._node),"function"==typeof this.props.onResize&&this.props.onResize(p(this._node,u(this.props))));},a.componentWillUnmount=function(){null!==this._window&&this._window.cancelAnimationFrame(this._animationFrameID),null!==this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null);},a.render=function(){var e=this.props,t=(e.innerRef,e.onResize,function(e,t){if(null==e)return {};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,["innerRef","onResize"]));return Object(r.createElement)(f,i({},t,{measureRef:this._handleRef,measure:this.measure,contentRect:this.state.contentRect}))},s}(r.Component),h.propTypes={client:a.a.bool,offset:a.a.bool,scroll:a.a.bool,bounds:a.a.bool,margin:a.a.bool,innerRef:a.a.oneOfType([a.a.object,a.a.func]),onResize:a.a.func},v);b.displayName="Measure",b.propTypes.children=a.a.func;var g=b,y=n(2);n(16);const _=e=>{const{horizontal:t=!1,initialPrimarySize:n="50%",minPrimarySize:i="0px",minSecondarySize:o="0px",splitterSize:s="7px",renderSplitter:a,resetOnDoubleClick:c=!1,defaultSplitterColors:l={color:"silver",hover:"gray",drag:"black"},onSplitChanged:u,onMeasuredSizesChanged:p}=e,[d,f]=r.useState({height:0,width:0}),[h,v]=r.useState({height:0,width:0}),[m,b]=r.useState({height:0,width:0}),_=r.useMemo(()=>t?d.height:d.width,[t,d]),w=r.useMemo(()=>t?h.height:h.width,[t,h]),O=r.useMemo(()=>t?m.height:m.width,[t,m]),[x,E]=r.useState(void 0),[z,R]=r.useState(0),[T,S]=r.useState(0),[M,j]=r.useState(!1);r.useEffect(()=>{u&&u(void 0!==x?x+"%":n);},[x,n]),r.useEffect(()=>{p&&p({primary:w,splitter:O,secondary:_-(w+O)});},[t,_,w,O]);const C=e=>{e.bounds&&v({height:e.bounds.height,width:e.bounds.width});},A=e=>{e.bounds&&b({height:e.bounds.height,width:e.bounds.width});},P=e=>{e.currentTarget.setPointerCapture(e.pointerId),R(t?e.clientY:e.clientX),S(w),j(!0);},k=e=>{if(e.currentTarget.hasPointerCapture(e.pointerId)){const n=t?e.clientY:e.clientX,r=T+(n-z),i=Math.max(0,Math.min(r,_));E(i/_*100);}},D=e=>{e.currentTarget.releasePointerCapture(e.pointerId),j(!1);},I=()=>{c&&E(void 0);},N=r.Children.toArray(e.children),L=N.length>0?N[0]:r.createElement("div",null),W=N.length>1?N[1]:r.createElement("div",null),F={primary:void 0!==x?x+"%":n,minPrimary:null!=i?i:"0px",minSecondary:null!=o?o:"0px"},q={pixelSize:O,horizontal:t,dragging:M},B=null!=a?a:()=>r.createElement(y.a,Object.assign({},q,{color:M?l.drag:l.color,hoverColor:M?l.drag:l.hover})),H=t?"split-container horizontal":"split-container vertical",U={"--react-split-min-primary":F.minPrimary,"--react-split-min-secondary":F.minSecondary,"--react-split-primary":F.primary,"--react-split-splitter":s};return r.createElement(g,{bounds:!0,onResize:e=>{e.bounds&&f({height:e.bounds.height,width:e.bounds.width});}},({measureRef:e})=>r.createElement("div",{className:"react-split",ref:e},r.createElement("div",{className:H,style:U},r.createElement("div",{className:"primary"},r.createElement(g,{bounds:!0,onResize:C},({measureRef:e})=>r.createElement("div",{className:"full-content",ref:e},L))),r.createElement("div",{className:"splitter",tabIndex:-1,onPointerDown:P,onPointerUp:D,onPointerMove:k,onDoubleClick:I},r.createElement(g,{bounds:!0,onResize:A},({measureRef:e})=>r.createElement("div",{className:"full-content",ref:e},B(q)))),r.createElement("div",{className:"secondary"},r.createElement("div",{className:"full-content"},W)))))};},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,n(t,r)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0;},function(e,t,n){(function(e){var n=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,r){return e[0]===t&&(n=r,!0)})),n}return function(){function t(){this.__entries__=[];}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n]);},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1);},t.prototype.has=function(t){return !!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0);},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n<r.length;n++){var i=r[n];e.call(t,i[1],i[0]);}},t}()}(),r="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,i=void 0!==e&&e.Math===Math?e:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),o="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(i):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)};var s=["top","right","bottom","left","width","height","size","weight"],a="undefined"!=typeof MutationObserver,c=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,r=!1,i=0;function s(){n&&(n=!1,e()),r&&c();}function a(){o(s);}function c(){var e=Date.now();if(n){if(e-i<2)return;r=!0;}else n=!0,r=!1,setTimeout(a,t);i=e;}return c}(this.refresh.bind(this),20);}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_();},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_();},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh();},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),a?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0);},e.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1);},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;s.some((function(e){return !!~n.indexOf(e)}))&&this.refresh();},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),l=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0});}return e},u=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||i},p=b(0,0,0,0);function d(e){return parseFloat(e)||0}function f(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+d(e["border-"+n+"-width"])}),0)}function h(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return p;var r=u(e).getComputedStyle(e),i=function(e){for(var t={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var i=r[n],o=e["padding-"+i];t[i]=d(o);}return t}(r),o=i.left+i.right,s=i.top+i.bottom,a=d(r.width),c=d(r.height);if("border-box"===r.boxSizing&&(Math.round(a+o)!==t&&(a-=f(r,"left","right")+o),Math.round(c+s)!==n&&(c-=f(r,"top","bottom")+s)),!function(e){return e===u(e).document.documentElement}(e)){var l=Math.round(a+o)-t,h=Math.round(c+s)-n;1!==Math.abs(l)&&(a-=l),1!==Math.abs(h)&&(c-=h);}return b(i.left,i.top,a,c)}var v="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof u(e).SVGGraphicsElement}:function(e){return e instanceof u(e).SVGElement&&"function"==typeof e.getBBox};function m(e){return r?v(e)?function(e){var t=e.getBBox();return b(0,0,t.width,t.height)}(e):h(e):p}function b(e,t,n,r){return {x:e,y:t,width:n,height:r}}var g=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=b(0,0,0,0),this.target=e;}return e.prototype.isActive=function(){var e=m(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),y=function(e,t){var n,r,i,o,s,a,c,u=(r=(n=t).x,i=n.y,o=n.width,s=n.height,a="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,c=Object.create(a.prototype),l(c,{x:r,y:i,width:o,height:s,top:i,right:r+o,bottom:s+i,left:r}),c);l(this,{target:e,contentRect:u});},_=function(){function e(e,t,r){if(this.activeObservations_=[],this.observations_=new n,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=r;}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof u(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new g(e)),this.controller_.addObserver(this),this.controller_.refresh());}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof u(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this));}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this);},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t);}));},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new y(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive();}},e.prototype.clearActive=function(){this.activeObservations_.splice(0);},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),w="undefined"!=typeof WeakMap?new WeakMap:new n,O=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=c.getInstance(),r=new _(t,n,this);w.set(this,r);};["observe","unobserve","disconnect"].forEach((function(e){O.prototype[e]=function(){var t;return (t=w.get(this))[e].apply(t,arguments)};}));var x=void 0!==i.ResizeObserver?i.ResizeObserver:O;t.a=x;}).call(this,n(15));},function(e,t,n){e.exports=n(10);},function(e,t,n){n.r(t);var r=n(2);n.d(t,"DefaultSplitter",(function(){return r.a}));var i=n(5);for(var o in i)["default","DefaultSplitter"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return i[e]}));}(o);var s=n(6);n.d(t,"Split",(function(){return s.a}));},function(e,t,n){var r=n(3),i=n(12);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{};},function(e,t,n){(t=n(4)(!1)).push([e.i,"\r\n/* The default splitter within a react-split */\r\n.react-split > .split-container > .splitter .default-splitter {\r\n box-sizing: border-box;\r\n height: 100%;\r\n outline: none;\r\n overflow: hidden;\r\n user-select: none;\r\n width: 100%;\r\n --default-splitter-line-color: silver;\r\n --default-splitter-line-hover-color: black;\r\n --default-splitter-line-margin: 2px;\r\n --default-splitter-line-size: 3px;\r\n}\r\n\r\n.react-split > .split-container.horizontal > .splitter .default-splitter {\r\n cursor: row-resize;\r\n}\r\n\r\n.react-split > .split-container.vertical > .splitter .default-splitter {\r\n cursor: col-resize;\r\n}\r\n\r\n/* The thin line within a default splitter hit area */\r\n.react-split > .split-container > .splitter .default-splitter > .line {\r\n background: var(--default-splitter-line-color);\r\n}\r\n\r\n.react-split > .split-container > .splitter .default-splitter:hover > .line {\r\n background: var(--default-splitter-line-hover-color);\r\n}\r\n\r\n.react-split > .split-container.horizontal > .splitter .default-splitter > .line {\r\n height: var(--default-splitter-line-size);\r\n width: 100%;\r\n margin-top: var(--default-splitter-line-margin);\r\n margin-left: 0;\r\n}\r\n\r\n.react-split > .split-container.vertical > .splitter .default-splitter > .line {\r\n height: 100%;\r\n width: var(--default-splitter-line-size);\r\n margin-top: 0;\r\n margin-left: var(--default-splitter-line-margin);\r\n}",""]),e.exports=t;},function(e,t,n){var r=n(14);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,s){if(s!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n};},function(e,t,n){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")();}catch(e){"object"==typeof window&&(n=window);}e.exports=n;},function(e,t,n){var r=n(3),i=n(17);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{};},function(e,t,n){(t=n(4)(!1)).push([e.i,'/* The top-level element of the splitter*/\r\n.react-split {\r\n width: 100%;\r\n height: 100%;\r\n box-sizing: border-box;\r\n outline: none;\r\n overflow: hidden;\r\n --react-split-min-primary: 0;\r\n --react-split-min-secondary: 0;\r\n --react-split-primary: 50%;\r\n --react-split-splitter: 7px;\r\n}\r\n\r\n/* The container for the primary pane, splitter, and secondary pane.*/\r\n.react-split > .split-container {\r\n width: 100%;\r\n height: 100%;\r\n box-sizing: border-box;\r\n outline: none;\r\n overflow: hidden;\r\n display: grid;\r\n}\r\n\r\n/* When the container is splitting horizontally */\r\n.react-split > .split-container.horizontal {\r\n grid-template-columns: 1fr;\r\n grid-template-rows: minmax(var(--react-split-min-primary),var(--react-split-primary)) var(--react-split-splitter) minmax(var(--react-split-min-secondary), 1fr);\r\n grid-template-areas: "primary" "split" "secondary";\r\n}\r\n\r\n/* When the container is splitting vertical */\r\n.react-split > .split-container.vertical {\r\n grid-template-columns: minmax(var(--react-split-min-primary),var(--react-split-primary)) var(--react-split-splitter) minmax(var(--react-split-min-secondary), 1fr);\r\n grid-template-rows: 1fr;\r\n grid-template-areas: "primary split secondary";\r\n}\r\n\r\n/* The primary pane. This is either the left or top depending on the split type */\r\n.react-split > .split-container > .primary {\r\n grid-area: primary;\r\n box-sizing: border-box;\r\n outline: none;\r\n overflow: hidden;\r\n}\r\n\r\n.react-split > .split-container.horizontal > .primary {\r\n height: auto;\r\n width: 100%;\r\n}\r\n\r\n.react-split > .split-container.vertical > .primary {\r\n height: 100%;\r\n width: auto;\r\n}\r\n\r\n/* The splitter between panes. */\r\n.react-split > .split-container > .splitter {\r\n grid-area: split;\r\n background: transparent;\r\n user-select: none;\r\n box-sizing: border-box;\r\n outline: none;\r\n overflow: hidden;\r\n}\r\n\r\n.react-split > .split-container.horizontal > .splitter {\r\n height: auto;\r\n width: 100%;\r\n cursor: row-resize;\r\n}\r\n\r\n.react-split > .split-container.vertical > .splitter {\r\n height: 100%;\r\n width: auto;\r\n cursor: col-resize;\r\n}\r\n\r\n/* The secondary pane. This is either the right or bottom depending on the split type */\r\n.react-split > .split-container >.secondary {\r\n grid-area: secondary;\r\n box-sizing: border-box;\r\n outline: none;\r\n overflow: hidden;\r\n}\r\n\r\n.react-split > .split-container.horizontal > .secondary {\r\n height: auto;\r\n width: 100%;\r\n}\r\n\r\n.react-split > .split-container.vertical > .secondary {\r\n height: 100%;\r\n width: auto;\r\n}\r\n\r\n/* The content within the primary pane, splitter, or secondary pane.*/\r\n.react-split .full-content {\r\n width: 100%;\r\n height: 100%;\r\n box-sizing: border-box;\r\n outline: none;\r\n overflow: hidden;\r\n}\r\n',""]),e.exports=t;}])}));
|
|
48
|
-
|
|
49
|
-
});
|
|
30
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
50
31
|
|
|
51
32
|
function _setPrototypeOf(t, e) {
|
|
52
33
|
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
@@ -181,36 +162,33 @@ const KEY_USER_SETTINGS = 'AX_USER_SETTINGS';
|
|
|
181
162
|
const migrateProfileStructuralChanges = () => {
|
|
182
163
|
const existingProfileConfigs = getAllProfiles();
|
|
183
164
|
const migratedProfileConfigs = existingProfileConfigs.map((profile) => {
|
|
184
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
185
165
|
return {
|
|
186
|
-
id:
|
|
187
|
-
name:
|
|
188
|
-
userAuthBaseURL:
|
|
189
|
-
userServiceBaseURL:
|
|
190
|
-
imageServiceBaseURL:
|
|
191
|
-
personalizationServiceBaseURL:
|
|
192
|
-
mediaServiceBaseURL:
|
|
193
|
-
catalogServiceBaseURL:
|
|
194
|
-
entitlementServiceBaseURL:
|
|
195
|
-
tenantId:
|
|
196
|
-
environmentId:
|
|
197
|
-
applicationId:
|
|
198
|
-
applicationKey:
|
|
199
|
-
variables:
|
|
200
|
-
var _a, _b, _c;
|
|
166
|
+
id: profile.id ?? generateShortUniqueId(),
|
|
167
|
+
name: profile.name ?? 'Unknown Profile',
|
|
168
|
+
userAuthBaseURL: profile.userAuthBaseURL ?? 'http://localhost:11101',
|
|
169
|
+
userServiceBaseURL: profile.userServiceBaseURL ?? 'http://localhost:11100',
|
|
170
|
+
imageServiceBaseURL: profile.imageServiceBaseURL ?? 'http://localhost:10400',
|
|
171
|
+
personalizationServiceBaseURL: profile.personalizationServiceBaseURL ?? 'http://localhost:11200',
|
|
172
|
+
mediaServiceBaseURL: profile.mediaServiceBaseURL ?? 'http://localhost:10200',
|
|
173
|
+
catalogServiceBaseURL: profile.catalogServiceBaseURL ?? 'http://localhost:10300',
|
|
174
|
+
entitlementServiceBaseURL: profile.entitlementServiceBaseURL ?? 'http://localhost:11600',
|
|
175
|
+
tenantId: profile.tenantId ?? '00000000-0000-0000-0000-000000000000',
|
|
176
|
+
environmentId: profile.environmentId ?? '00000000-0000-0000-0000-000000000000',
|
|
177
|
+
applicationId: profile.applicationId ?? '00000000-0000-0000-0000-000000000000',
|
|
178
|
+
applicationKey: profile.applicationKey ?? 'key',
|
|
179
|
+
variables: profile.variables?.map((variable) => {
|
|
201
180
|
return {
|
|
202
|
-
key:
|
|
203
|
-
value:
|
|
204
|
-
comment:
|
|
181
|
+
key: variable.key ?? `AUTO_GENERATED_KEY_${generateShortUniqueId()}`,
|
|
182
|
+
value: variable.value ?? '',
|
|
183
|
+
comment: variable.comment ?? '',
|
|
205
184
|
};
|
|
206
|
-
})
|
|
185
|
+
}) ?? [],
|
|
207
186
|
};
|
|
208
187
|
});
|
|
209
188
|
saveAllProfiles(migratedProfileConfigs);
|
|
210
189
|
};
|
|
211
190
|
const getAllProfiles = () => {
|
|
212
|
-
|
|
213
|
-
return JSON.parse((_a = localStorage.getItem(KEY_PROFILE_DATA)) !== null && _a !== void 0 ? _a : '[]');
|
|
191
|
+
return JSON.parse(localStorage.getItem(KEY_PROFILE_DATA) ?? '[]');
|
|
214
192
|
};
|
|
215
193
|
const saveAllProfiles = (profiles) => {
|
|
216
194
|
localStorage.setItem(KEY_PROFILE_DATA, JSON.stringify(profiles.sort((first, second) => (first.name > second.name ? 1 : -1))));
|
|
@@ -227,8 +205,7 @@ const saveProfile = (profileToSave) => {
|
|
|
227
205
|
saveAllProfiles(profiles);
|
|
228
206
|
};
|
|
229
207
|
const getProfileVariable = (profile, key) => {
|
|
230
|
-
|
|
231
|
-
return (_a = profile.variables.find((variable) => variable.key === key)) === null || _a === void 0 ? void 0 : _a.value;
|
|
208
|
+
return profile.variables.find((variable) => variable.key === key)?.value;
|
|
232
209
|
};
|
|
233
210
|
const getProfileVariables = (profile) => {
|
|
234
211
|
return profile.variables;
|
|
@@ -251,13 +228,12 @@ const setProfileVariable = (profile, key, value, comment) => {
|
|
|
251
228
|
* latest `UserSettings` type in code by substituting reasonable defaults where necessary and eliminating obsolete properties.
|
|
252
229
|
*/
|
|
253
230
|
const migrateUserSettingsStructuralChanges = () => {
|
|
254
|
-
var _a, _b;
|
|
255
231
|
const existingUserSettings = getUserSettings();
|
|
256
232
|
const allProfiles = getAllProfiles();
|
|
257
233
|
const firstProfileId = allProfiles.length > 0 ? allProfiles[0].id : undefined;
|
|
258
234
|
const migratedUserSettings = {
|
|
259
|
-
loggerPosition:
|
|
260
|
-
activeProfileId:
|
|
235
|
+
loggerPosition: existingUserSettings.loggerPosition ?? '70%',
|
|
236
|
+
activeProfileId: existingUserSettings.activeProfileId ?? firstProfileId,
|
|
261
237
|
};
|
|
262
238
|
setUserSettings(migratedUserSettings);
|
|
263
239
|
};
|
|
@@ -326,8 +302,111 @@ const ScenarioHostLogger = React.forwardRef((props, ref) => {
|
|
|
326
302
|
React__default["default"].createElement("p", { style: { color: 'darkgrey' } }, logEntry.scenarioId.substring(1))))))));
|
|
327
303
|
});
|
|
328
304
|
|
|
305
|
+
const MIN_PANE_SIZE_PX = 80;
|
|
306
|
+
const KEYBOARD_STEP_PX = 24;
|
|
307
|
+
const getBoundedPrimarySize = (container, clientY) => {
|
|
308
|
+
const bounds = container.getBoundingClientRect();
|
|
309
|
+
if (bounds.height <= 0) {
|
|
310
|
+
return undefined;
|
|
311
|
+
}
|
|
312
|
+
const minimumPaneSize = Math.min(MIN_PANE_SIZE_PX, bounds.height / 2);
|
|
313
|
+
const primarySize = Math.min(Math.max(clientY - bounds.top, minimumPaneSize), bounds.height - minimumPaneSize);
|
|
314
|
+
return `${((primarySize / bounds.height) * 100).toFixed(2)}%`;
|
|
315
|
+
};
|
|
316
|
+
const getPrimarySizePixels = (value, totalSize) => {
|
|
317
|
+
const numericValue = Number.parseFloat(value);
|
|
318
|
+
if (!Number.isFinite(numericValue)) {
|
|
319
|
+
return totalSize * 0.7;
|
|
320
|
+
}
|
|
321
|
+
return value.trim().endsWith('%')
|
|
322
|
+
? (numericValue / 100) * totalSize
|
|
323
|
+
: numericValue;
|
|
324
|
+
};
|
|
325
|
+
const ScenarioHostSplit = ({ initialPrimarySize, splitterSize, onSplitChanged, children, }) => {
|
|
326
|
+
const containerRef = React.useRef(null);
|
|
327
|
+
const [primarySize, setPrimarySize] = React.useState(initialPrimarySize);
|
|
328
|
+
React.useEffect(() => {
|
|
329
|
+
setPrimarySize(initialPrimarySize);
|
|
330
|
+
}, [initialPrimarySize]);
|
|
331
|
+
const applyPrimarySize = React.useCallback((value) => {
|
|
332
|
+
setPrimarySize(value);
|
|
333
|
+
onSplitChanged?.(value);
|
|
334
|
+
}, [onSplitChanged]);
|
|
335
|
+
const handlePointerDown = React.useCallback((event) => {
|
|
336
|
+
const container = containerRef.current;
|
|
337
|
+
if (container === null) {
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
event.preventDefault();
|
|
341
|
+
const ownerDocument = container.ownerDocument;
|
|
342
|
+
const updatePrimarySize = (clientY) => {
|
|
343
|
+
const nextPrimarySize = getBoundedPrimarySize(container, clientY);
|
|
344
|
+
if (nextPrimarySize !== undefined) {
|
|
345
|
+
applyPrimarySize(nextPrimarySize);
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
const handlePointerMove = (pointerEvent) => {
|
|
349
|
+
updatePrimarySize(pointerEvent.clientY);
|
|
350
|
+
};
|
|
351
|
+
const stopDragging = (pointerEvent) => {
|
|
352
|
+
updatePrimarySize(pointerEvent.clientY);
|
|
353
|
+
ownerDocument.removeEventListener('pointermove', handlePointerMove);
|
|
354
|
+
ownerDocument.removeEventListener('pointerup', stopDragging);
|
|
355
|
+
ownerDocument.removeEventListener('pointercancel', stopDragging);
|
|
356
|
+
};
|
|
357
|
+
ownerDocument.addEventListener('pointermove', handlePointerMove);
|
|
358
|
+
ownerDocument.addEventListener('pointerup', stopDragging);
|
|
359
|
+
ownerDocument.addEventListener('pointercancel', stopDragging);
|
|
360
|
+
}, [applyPrimarySize]);
|
|
361
|
+
const adjustPrimarySize = React.useCallback((delta) => {
|
|
362
|
+
const container = containerRef.current;
|
|
363
|
+
if (container === null) {
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
const bounds = container.getBoundingClientRect();
|
|
367
|
+
const currentPrimarySize = getPrimarySizePixels(primarySize, bounds.height);
|
|
368
|
+
const nextPrimarySize = getBoundedPrimarySize(container, bounds.top + currentPrimarySize + delta);
|
|
369
|
+
if (nextPrimarySize !== undefined) {
|
|
370
|
+
applyPrimarySize(nextPrimarySize);
|
|
371
|
+
}
|
|
372
|
+
}, [applyPrimarySize, primarySize]);
|
|
373
|
+
const handleKeyDown = React.useCallback((event) => {
|
|
374
|
+
if (event.key === 'ArrowUp') {
|
|
375
|
+
event.preventDefault();
|
|
376
|
+
adjustPrimarySize(-KEYBOARD_STEP_PX);
|
|
377
|
+
}
|
|
378
|
+
else if (event.key === 'ArrowDown') {
|
|
379
|
+
event.preventDefault();
|
|
380
|
+
adjustPrimarySize(KEYBOARD_STEP_PX);
|
|
381
|
+
}
|
|
382
|
+
}, [adjustPrimarySize]);
|
|
383
|
+
const handleDoubleClick = React.useCallback(() => {
|
|
384
|
+
applyPrimarySize(initialPrimarySize);
|
|
385
|
+
}, [applyPrimarySize, initialPrimarySize]);
|
|
386
|
+
return (React__default["default"].createElement("div", { ref: containerRef, style: {
|
|
387
|
+
display: 'grid',
|
|
388
|
+
gridTemplateRows: `minmax(0, ${primarySize}) ${splitterSize} minmax(0, 1fr)`,
|
|
389
|
+
height: '100%',
|
|
390
|
+
minHeight: 0,
|
|
391
|
+
} },
|
|
392
|
+
React__default["default"].createElement("div", { style: { minHeight: 0, overflow: 'hidden' } }, children[0]),
|
|
393
|
+
React__default["default"].createElement("div", { "aria-orientation": "horizontal", onDoubleClick: handleDoubleClick, onKeyDown: handleKeyDown, onPointerDown: handlePointerDown, role: "separator", tabIndex: 0, style: {
|
|
394
|
+
alignItems: 'center',
|
|
395
|
+
cursor: 'row-resize',
|
|
396
|
+
display: 'flex',
|
|
397
|
+
justifyContent: 'center',
|
|
398
|
+
touchAction: 'none',
|
|
399
|
+
userSelect: 'none',
|
|
400
|
+
} },
|
|
401
|
+
React__default["default"].createElement("div", { style: {
|
|
402
|
+
backgroundColor: 'silver',
|
|
403
|
+
height: '1px',
|
|
404
|
+
width: '100%',
|
|
405
|
+
} })),
|
|
406
|
+
React__default["default"].createElement("div", { style: { minHeight: 0, overflow: 'hidden' } }, children[1])));
|
|
407
|
+
};
|
|
408
|
+
|
|
329
409
|
const ScenarioHost = ({ scenarios }) => {
|
|
330
|
-
var _a;
|
|
331
410
|
const groupedScenarios = getGroupedScenarios(scenarios);
|
|
332
411
|
const { pathname } = reactRouterDom.useLocation();
|
|
333
412
|
const [userSettings] = React.useState(getUserSettings());
|
|
@@ -359,7 +438,10 @@ const ScenarioHost = ({ scenarios }) => {
|
|
|
359
438
|
const handleProfileChanged = React.useCallback((event, data) => {
|
|
360
439
|
const activeProfileIndex = profiles.findIndex((profile) => profile.id === data.value);
|
|
361
440
|
setActiveProfile(profiles[activeProfileIndex]);
|
|
362
|
-
setUserSettings(
|
|
441
|
+
setUserSettings({
|
|
442
|
+
...userSettings,
|
|
443
|
+
activeProfileId: profiles[activeProfileIndex].id,
|
|
444
|
+
});
|
|
363
445
|
}, [profiles, userSettings]);
|
|
364
446
|
const ScenarioErrorFallback = (info) => {
|
|
365
447
|
return (React__default["default"].createElement(semanticUiReact.Segment, { basic: true },
|
|
@@ -385,8 +467,8 @@ const ScenarioHost = ({ scenarios }) => {
|
|
|
385
467
|
value: profile.id,
|
|
386
468
|
text: profile.name,
|
|
387
469
|
};
|
|
388
|
-
}), onChange: handleProfileChanged, value: activeProfile
|
|
389
|
-
React__default["default"].createElement(semanticUiReact.Button, { style: { marginBottom: '1rem' }, basic: true, "data-test-id": "profiles-button", color: "blue", floated: "right", as: reactRouterDom.Link, to: `/profiles/${
|
|
470
|
+
}), onChange: handleProfileChanged, value: activeProfile?.id }),
|
|
471
|
+
React__default["default"].createElement(semanticUiReact.Button, { style: { marginBottom: '1rem' }, basic: true, "data-test-id": "profiles-button", color: "blue", floated: "right", as: reactRouterDom.Link, to: `/profiles/${activeProfile?.id ?? ''}` }, "Profiles")),
|
|
390
472
|
React__default["default"].createElement(semanticUiReact.Divider, { style: { marginTop: 0 } }),
|
|
391
473
|
React__default["default"].createElement(semanticUiReact.List, { link: true }, [...groupedScenarios.keys()].map((groupName) => {
|
|
392
474
|
const groupedScenario = groupedScenarios.get(groupName);
|
|
@@ -416,7 +498,10 @@ const ScenarioHost = ({ scenarios }) => {
|
|
|
416
498
|
maxHeight: 'calc(100vh - 94px)',
|
|
417
499
|
marginRight: '1rem',
|
|
418
500
|
} }, activeProfile !== undefined ? (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
419
|
-
React__default["default"].createElement(
|
|
501
|
+
React__default["default"].createElement(ScenarioHostSplit, { initialPrimarySize: getUserSettings().loggerPosition, splitterSize: "25px", onSplitChanged: (value) => setUserSettings({
|
|
502
|
+
...getUserSettings(),
|
|
503
|
+
loggerPosition: value,
|
|
504
|
+
}) },
|
|
420
505
|
React__default["default"].createElement("div", { "data-test-id": "scenario-container", style: { height: '100%', overflowY: 'auto' } },
|
|
421
506
|
React__default["default"].createElement(ScenarioHostContext.Provider, { value: {
|
|
422
507
|
scenarios,
|
|
@@ -432,16 +517,13 @@ const ScenarioHost = ({ scenarios }) => {
|
|
|
432
517
|
},
|
|
433
518
|
logger: {
|
|
434
519
|
log: (...messages) => {
|
|
435
|
-
|
|
436
|
-
(_a = loggerRef.current) === null || _a === void 0 ? void 0 : _a.logMessage(messages, 'LOG');
|
|
520
|
+
loggerRef.current?.logMessage(messages, 'LOG');
|
|
437
521
|
},
|
|
438
522
|
warn: (...messages) => {
|
|
439
|
-
|
|
440
|
-
(_a = loggerRef.current) === null || _a === void 0 ? void 0 : _a.logMessage(messages, 'WARN');
|
|
523
|
+
loggerRef.current?.logMessage(messages, 'WARN');
|
|
441
524
|
},
|
|
442
525
|
error: (...messages) => {
|
|
443
|
-
|
|
444
|
-
(_a = loggerRef.current) === null || _a === void 0 ? void 0 : _a.logMessage(messages, 'ERROR');
|
|
526
|
+
loggerRef.current?.logMessage(messages, 'ERROR');
|
|
445
527
|
},
|
|
446
528
|
},
|
|
447
529
|
} },
|
|
@@ -492,19 +574,19 @@ const getGroupedScenarios = (scenarios) => {
|
|
|
492
574
|
const ProfileURLs = ({ selectedProfile, handleInputChange, }) => {
|
|
493
575
|
return (React__default["default"].createElement(semanticUiReact.Tab.Pane, null,
|
|
494
576
|
React__default["default"].createElement(semanticUiReact.Form, null,
|
|
495
|
-
React__default["default"].createElement(semanticUiReact.Form.Input, { width: 6, label: "User Auth Base URL", name: "userAuthBaseURL", value: selectedProfile
|
|
496
|
-
React__default["default"].createElement(semanticUiReact.Form.Input, { width: 6, label: "User Service Base URL", name: "userServiceBaseURL", value: selectedProfile
|
|
497
|
-
React__default["default"].createElement(semanticUiReact.Form.Input, { width: 6, label: "Image Service Base URL", name: "imageServiceBaseURL", value: selectedProfile
|
|
498
|
-
React__default["default"].createElement(semanticUiReact.Form.Input, { width: 6, label: "Personalization Service Base URL", name: "personalizationServiceBaseURL", value: selectedProfile
|
|
577
|
+
React__default["default"].createElement(semanticUiReact.Form.Input, { width: 6, label: "User Auth Base URL", name: "userAuthBaseURL", value: selectedProfile?.userAuthBaseURL, onChange: handleInputChange }),
|
|
578
|
+
React__default["default"].createElement(semanticUiReact.Form.Input, { width: 6, label: "User Service Base URL", name: "userServiceBaseURL", value: selectedProfile?.userServiceBaseURL, onChange: handleInputChange }),
|
|
579
|
+
React__default["default"].createElement(semanticUiReact.Form.Input, { width: 6, label: "Image Service Base URL", name: "imageServiceBaseURL", value: selectedProfile?.imageServiceBaseURL, onChange: handleInputChange }),
|
|
580
|
+
React__default["default"].createElement(semanticUiReact.Form.Input, { width: 6, label: "Personalization Service Base URL", name: "personalizationServiceBaseURL", value: selectedProfile?.personalizationServiceBaseURL, onChange: handleInputChange }),
|
|
499
581
|
React__default["default"].createElement(semanticUiReact.Divider, null),
|
|
500
|
-
React__default["default"].createElement(semanticUiReact.Form.Input, { width: 6, label: "Media Service Base URL", name: "mediaServiceBaseURL", value: selectedProfile
|
|
501
|
-
React__default["default"].createElement(semanticUiReact.Form.Input, { width: 6, label: "Catalog Service Base URL", name: "catalogServiceBaseURL", value: selectedProfile
|
|
502
|
-
React__default["default"].createElement(semanticUiReact.Form.Input, { width: 6, label: "Entitlement Service Base URL", name: "entitlementServiceBaseURL", value: selectedProfile
|
|
582
|
+
React__default["default"].createElement(semanticUiReact.Form.Input, { width: 6, label: "Media Service Base URL", name: "mediaServiceBaseURL", value: selectedProfile?.mediaServiceBaseURL, onChange: handleInputChange }),
|
|
583
|
+
React__default["default"].createElement(semanticUiReact.Form.Input, { width: 6, label: "Catalog Service Base URL", name: "catalogServiceBaseURL", value: selectedProfile?.catalogServiceBaseURL, onChange: handleInputChange }),
|
|
584
|
+
React__default["default"].createElement(semanticUiReact.Form.Input, { width: 6, label: "Entitlement Service Base URL", name: "entitlementServiceBaseURL", value: selectedProfile?.entitlementServiceBaseURL, onChange: handleInputChange }),
|
|
503
585
|
React__default["default"].createElement(semanticUiReact.Divider, null),
|
|
504
|
-
React__default["default"].createElement(semanticUiReact.Form.Input, { width: 4, label: "Tenant ID", name: "tenantId", value: selectedProfile
|
|
505
|
-
React__default["default"].createElement(semanticUiReact.Form.Input, { width: 4, label: "Environment ID", name: "environmentId", value: selectedProfile
|
|
506
|
-
React__default["default"].createElement(semanticUiReact.Form.Input, { width: 4, label: "Application ID", name: "applicationId", value: selectedProfile
|
|
507
|
-
React__default["default"].createElement(semanticUiReact.Form.Input, { width: 4, label: "Application Key", name: "applicationKey", value: selectedProfile
|
|
586
|
+
React__default["default"].createElement(semanticUiReact.Form.Input, { width: 4, label: "Tenant ID", name: "tenantId", value: selectedProfile?.tenantId, onChange: handleInputChange }),
|
|
587
|
+
React__default["default"].createElement(semanticUiReact.Form.Input, { width: 4, label: "Environment ID", name: "environmentId", value: selectedProfile?.environmentId, onChange: handleInputChange }),
|
|
588
|
+
React__default["default"].createElement(semanticUiReact.Form.Input, { width: 4, label: "Application ID", name: "applicationId", value: selectedProfile?.applicationId, onChange: handleInputChange }),
|
|
589
|
+
React__default["default"].createElement(semanticUiReact.Form.Input, { width: 4, label: "Application Key", name: "applicationKey", value: selectedProfile?.applicationKey, onChange: handleInputChange }))));
|
|
508
590
|
};
|
|
509
591
|
|
|
510
592
|
const ProfileVariables = ({ selectedProfile, handleVariableInputChange, insertNewVariable, deleteVariable, }) => {
|
|
@@ -529,19 +611,17 @@ const ProfileVariables = ({ selectedProfile, handleVariableInputChange, insertNe
|
|
|
529
611
|
};
|
|
530
612
|
|
|
531
613
|
const Profiles = ({ match }) => {
|
|
532
|
-
var _a, _b, _c, _d;
|
|
533
614
|
const { pathname } = reactRouterDom.useLocation();
|
|
534
615
|
const history = reactRouterDom.useHistory();
|
|
535
616
|
const [profiles, setProfiles] = React.useState(getAllProfiles());
|
|
536
|
-
const [selectedProfile, setSelectedProfile] = React.useState(profiles.find((profile) =>
|
|
537
|
-
const [selectedTab, setSelectedTab] = React.useState(parseInt(
|
|
617
|
+
const [selectedProfile, setSelectedProfile] = React.useState(profiles.find((profile) => profile.id === match?.params?.profileId));
|
|
618
|
+
const [selectedTab, setSelectedTab] = React.useState(parseInt(match?.params?.tabId ?? '0'));
|
|
538
619
|
React.useEffect(() => {
|
|
539
|
-
setSelectedProfile(profiles.find((profile) =>
|
|
540
|
-
}, [
|
|
620
|
+
setSelectedProfile(profiles.find((profile) => profile.id === match?.params?.profileId));
|
|
621
|
+
}, [match?.params?.profileId, profiles]);
|
|
541
622
|
React.useEffect(() => {
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
}, [(_d = match === null || match === void 0 ? void 0 : match.params) === null || _d === void 0 ? void 0 : _d.tabId]);
|
|
623
|
+
setSelectedTab(parseInt(match?.params?.tabId ?? '0'));
|
|
624
|
+
}, [match?.params?.tabId]);
|
|
545
625
|
const handleNewProfileClick = (type) => () => {
|
|
546
626
|
const newProfileId = generateShortUniqueId();
|
|
547
627
|
setProfiles([
|
|
@@ -574,7 +654,7 @@ const Profiles = ({ match }) => {
|
|
|
574
654
|
history.push(`/profiles/${newProfileId}`);
|
|
575
655
|
};
|
|
576
656
|
const handleSaveProfileClick = () => {
|
|
577
|
-
const activeProfileIndex = profiles.findIndex((env) => env.id ===
|
|
657
|
+
const activeProfileIndex = profiles.findIndex((env) => env.id === selectedProfile?.id);
|
|
578
658
|
if (activeProfileIndex !== -1 && selectedProfile !== undefined) {
|
|
579
659
|
profiles[activeProfileIndex] = selectedProfile;
|
|
580
660
|
setProfiles([...profiles]);
|
|
@@ -582,7 +662,7 @@ const Profiles = ({ match }) => {
|
|
|
582
662
|
}
|
|
583
663
|
};
|
|
584
664
|
const handleDeleteProfileClick = () => {
|
|
585
|
-
const activeProfileIndex = profiles.findIndex((env) => env.id ===
|
|
665
|
+
const activeProfileIndex = profiles.findIndex((env) => env.id === selectedProfile?.id);
|
|
586
666
|
if (activeProfileIndex !== -1 && selectedProfile !== undefined) {
|
|
587
667
|
profiles.splice(activeProfileIndex, 1);
|
|
588
668
|
setProfiles([...profiles]);
|
|
@@ -591,7 +671,7 @@ const Profiles = ({ match }) => {
|
|
|
591
671
|
}
|
|
592
672
|
};
|
|
593
673
|
const handleExportProfileClick = () => {
|
|
594
|
-
const activeProfileIndex = profiles.findIndex((env) => env.id ===
|
|
674
|
+
const activeProfileIndex = profiles.findIndex((env) => env.id === selectedProfile?.id);
|
|
595
675
|
if (activeProfileIndex !== -1 && selectedProfile !== undefined) {
|
|
596
676
|
const fileDownloadLink = document.createElement('a');
|
|
597
677
|
fileDownloadLink.href = URL.createObjectURL(new Blob([JSON.stringify(selectedProfile, null, 2)], {
|
|
@@ -604,22 +684,20 @@ const Profiles = ({ match }) => {
|
|
|
604
684
|
}
|
|
605
685
|
};
|
|
606
686
|
const handleImportProfileClick = () => {
|
|
607
|
-
|
|
608
|
-
(_a = document.getElementById('fileInput')) === null || _a === void 0 ? void 0 : _a.click();
|
|
687
|
+
document.getElementById('fileInput')?.click();
|
|
609
688
|
// Event listener for file input change
|
|
610
|
-
|
|
611
|
-
.getElementById('fileInput')
|
|
612
|
-
|
|
689
|
+
document
|
|
690
|
+
.getElementById('fileInput')
|
|
691
|
+
?.addEventListener('change', function (event) {
|
|
613
692
|
if (event && event.target) {
|
|
614
693
|
const inputElement = event.target;
|
|
615
694
|
// Handle the selected file
|
|
616
695
|
if (inputElement) {
|
|
617
|
-
const file =
|
|
696
|
+
const file = inputElement.files?.[0];
|
|
618
697
|
if (file) {
|
|
619
698
|
const reader = new FileReader();
|
|
620
699
|
reader.onload = function (e) {
|
|
621
|
-
|
|
622
|
-
const fileContent = (_a = e.target) === null || _a === void 0 ? void 0 : _a.result;
|
|
700
|
+
const fileContent = e.target?.result;
|
|
623
701
|
// Save file content to local storage
|
|
624
702
|
saveToLocalStorage(fileContent);
|
|
625
703
|
// Reset the file input value to clear it
|
|
@@ -636,7 +714,7 @@ const Profiles = ({ match }) => {
|
|
|
636
714
|
};
|
|
637
715
|
const saveToLocalStorage = (fileContent) => {
|
|
638
716
|
const importedProfile = JSON.parse(fileContent);
|
|
639
|
-
const profileAlreadyExists = profiles.find((profile) => profile.id ===
|
|
717
|
+
const profileAlreadyExists = profiles.find((profile) => profile.id === importedProfile?.id);
|
|
640
718
|
if (profileAlreadyExists === undefined) {
|
|
641
719
|
// Add new data to the profiles array
|
|
642
720
|
profiles.push(importedProfile);
|
|
@@ -644,7 +722,7 @@ const Profiles = ({ match }) => {
|
|
|
644
722
|
saveAllProfiles(profiles);
|
|
645
723
|
}
|
|
646
724
|
else {
|
|
647
|
-
const existProfileIndex = profiles.findIndex((profile) => profile.id ===
|
|
725
|
+
const existProfileIndex = profiles.findIndex((profile) => profile.id === importedProfile?.id);
|
|
648
726
|
if (existProfileIndex !== -1) {
|
|
649
727
|
profiles[existProfileIndex] = importedProfile;
|
|
650
728
|
setProfiles([...profiles]);
|
|
@@ -659,7 +737,10 @@ const Profiles = ({ match }) => {
|
|
|
659
737
|
const { name, value } = data;
|
|
660
738
|
setSelectedProfile((prevState) => {
|
|
661
739
|
if (prevState !== undefined) {
|
|
662
|
-
const newState =
|
|
740
|
+
const newState = {
|
|
741
|
+
...prevState,
|
|
742
|
+
[name]: value,
|
|
743
|
+
};
|
|
663
744
|
return newState;
|
|
664
745
|
}
|
|
665
746
|
else {
|
|
@@ -683,7 +764,9 @@ const Profiles = ({ match }) => {
|
|
|
683
764
|
else if (name === 'comment') {
|
|
684
765
|
prevState.variables[variableIndex].comment = value;
|
|
685
766
|
}
|
|
686
|
-
const newState =
|
|
767
|
+
const newState = {
|
|
768
|
+
...prevState,
|
|
769
|
+
};
|
|
687
770
|
return newState;
|
|
688
771
|
}
|
|
689
772
|
else {
|
|
@@ -695,7 +778,9 @@ const Profiles = ({ match }) => {
|
|
|
695
778
|
setSelectedProfile((prevState) => {
|
|
696
779
|
if (prevState !== undefined) {
|
|
697
780
|
prevState.variables.push({ key: '', value: '', comment: '' });
|
|
698
|
-
const newState =
|
|
781
|
+
const newState = {
|
|
782
|
+
...prevState,
|
|
783
|
+
};
|
|
699
784
|
return newState;
|
|
700
785
|
}
|
|
701
786
|
else {
|
|
@@ -707,7 +792,9 @@ const Profiles = ({ match }) => {
|
|
|
707
792
|
setSelectedProfile((prevState) => {
|
|
708
793
|
if (prevState !== undefined) {
|
|
709
794
|
prevState.variables.splice(variableIndex, 1);
|
|
710
|
-
const newState =
|
|
795
|
+
const newState = {
|
|
796
|
+
...prevState,
|
|
797
|
+
};
|
|
711
798
|
return newState;
|
|
712
799
|
}
|
|
713
800
|
else {
|
|
@@ -737,13 +824,13 @@ const Profiles = ({ match }) => {
|
|
|
737
824
|
})))),
|
|
738
825
|
selectedProfile === undefined ? (React__default["default"].createElement(React__default["default"].Fragment, null)) : (React__default["default"].createElement(semanticUiReact.Grid.Column, { stretched: true, width: 12 },
|
|
739
826
|
React__default["default"].createElement(semanticUiReact.Segment, null,
|
|
740
|
-
React__default["default"].createElement(semanticUiReact.Header, null,
|
|
741
|
-
selectedProfile
|
|
827
|
+
React__default["default"].createElement(semanticUiReact.Header, null,
|
|
828
|
+
selectedProfile?.name,
|
|
742
829
|
React__default["default"].createElement(semanticUiReact.Button, { "data-test-id": "save-profile-button", color: "blue", floated: "right", content: "Save", onClick: handleSaveProfileClick }),
|
|
743
830
|
React__default["default"].createElement(semanticUiReact.Button, { basic: true, color: "blue", floated: "right", content: "Delete", onClick: handleDeleteProfileClick }),
|
|
744
831
|
React__default["default"].createElement(semanticUiReact.Button, { basic: true, color: "blue", floated: "right", content: "Export", onClick: handleExportProfileClick })),
|
|
745
832
|
React__default["default"].createElement(semanticUiReact.Form, null,
|
|
746
|
-
React__default["default"].createElement(semanticUiReact.Form.Input, { width: 4, label: "Profile Name", name: "name", value: selectedProfile
|
|
833
|
+
React__default["default"].createElement(semanticUiReact.Form.Input, { width: 4, label: "Profile Name", name: "name", value: selectedProfile?.name, onChange: handleInputChange })),
|
|
747
834
|
React__default["default"].createElement(semanticUiReact.Divider, null),
|
|
748
835
|
React__default["default"].createElement(semanticUiReact.Tab, { activeIndex: selectedTab, panes: [
|
|
749
836
|
{
|
|
@@ -781,40 +868,12 @@ const ScenarioHostApp = ({ scenarios, }) => {
|
|
|
781
868
|
React__default["default"].createElement(ScenarioHost, { scenarios: scenarios })))));
|
|
782
869
|
};
|
|
783
870
|
|
|
784
|
-
/*! *****************************************************************************
|
|
785
|
-
Copyright (c) Microsoft Corporation.
|
|
786
|
-
|
|
787
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
788
|
-
purpose with or without fee is hereby granted.
|
|
789
|
-
|
|
790
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
791
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
792
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
793
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
794
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
795
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
796
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
797
|
-
***************************************************************************** */
|
|
798
|
-
|
|
799
|
-
function __rest(s, e) {
|
|
800
|
-
var t = {};
|
|
801
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
802
|
-
t[p] = s[p];
|
|
803
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
804
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
805
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
806
|
-
t[p[i]] = s[p[i]];
|
|
807
|
-
}
|
|
808
|
-
return t;
|
|
809
|
-
}
|
|
810
|
-
|
|
811
871
|
/**
|
|
812
872
|
* This component has built-in support to display all `variables` defined in the active profile when the
|
|
813
873
|
* control is focused. The user may click on an item from this list to select a variable, then its corresponding value will be
|
|
814
874
|
* fetched and assigned into the input field.
|
|
815
875
|
*/
|
|
816
|
-
const VariableSearch = (
|
|
817
|
-
var { label, setStateValue } = _a, rest = __rest(_a, ["label", "setStateValue"]);
|
|
876
|
+
const VariableSearch = ({ label, setStateValue, ...rest }) => {
|
|
818
877
|
const { getVariables, getVariable } = useScenarioHost();
|
|
819
878
|
const allVariables = getVariables();
|
|
820
879
|
const [resultsOpened, setResultsOpened] = React.useState(false);
|
|
@@ -830,9 +889,8 @@ const VariableSearch = (_a) => {
|
|
|
830
889
|
setResultsOpened(false);
|
|
831
890
|
},
|
|
832
891
|
onSearchChange: (event, data) => {
|
|
833
|
-
var _a;
|
|
834
892
|
if (setStateValue !== undefined) {
|
|
835
|
-
setStateValue(
|
|
893
|
+
setStateValue(data.value ?? '');
|
|
836
894
|
}
|
|
837
895
|
},
|
|
838
896
|
onResultSelect: (event, data) => {
|
|
@@ -842,11 +900,11 @@ const VariableSearch = (_a) => {
|
|
|
842
900
|
setResultsOpened(false);
|
|
843
901
|
},
|
|
844
902
|
};
|
|
845
|
-
return (React__default["default"].createElement(semanticUiReact.Search,
|
|
903
|
+
return (React__default["default"].createElement(semanticUiReact.Search, { input: { className: 'left icon' }, placeholder: "Fetch value from a variable or type it in", label: {
|
|
846
904
|
children: label,
|
|
847
905
|
}, results: allVariables.map((variable) => {
|
|
848
906
|
return { title: variable.key, description: variable.comment };
|
|
849
|
-
})
|
|
907
|
+
}), ...searchResultHandlers, ...rest }));
|
|
850
908
|
};
|
|
851
909
|
|
|
852
910
|
exports.ScenarioHostApp = ScenarioHostApp;
|