@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
|
@@ -1,27 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default, { forwardRef, useState, useImperativeHandle,
|
|
2
|
+
import React__default, { forwardRef, useState, useImperativeHandle, useRef, useEffect, useCallback, createContext, useContext } from 'react';
|
|
3
3
|
import { useLocation, Link, Switch, Route, useHistory, NavLink, BrowserRouter } from 'react-router-dom';
|
|
4
4
|
import { Grid, Button, Segment, Header, Select, Divider, List, Tab, Form, Dropdown, Search } from 'semantic-ui-react';
|
|
5
5
|
|
|
6
|
-
function createCommonjsModule(fn, basedir, module) {
|
|
7
|
-
return module = {
|
|
8
|
-
path: basedir,
|
|
9
|
-
exports: {},
|
|
10
|
-
require: function (path, base) {
|
|
11
|
-
return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
|
|
12
|
-
}
|
|
13
|
-
}, fn(module, module.exports), module.exports;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function commonjsRequire () {
|
|
17
|
-
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
var build = createCommonjsModule(function (module, exports) {
|
|
21
|
-
!function(e,t){module.exports=t(React__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;}])}));
|
|
22
|
-
|
|
23
|
-
});
|
|
24
|
-
|
|
25
6
|
function _setPrototypeOf(t, e) {
|
|
26
7
|
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
27
8
|
return t.__proto__ = e, t;
|
|
@@ -155,36 +136,33 @@ const KEY_USER_SETTINGS = 'AX_USER_SETTINGS';
|
|
|
155
136
|
const migrateProfileStructuralChanges = () => {
|
|
156
137
|
const existingProfileConfigs = getAllProfiles();
|
|
157
138
|
const migratedProfileConfigs = existingProfileConfigs.map((profile) => {
|
|
158
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
159
139
|
return {
|
|
160
|
-
id:
|
|
161
|
-
name:
|
|
162
|
-
userAuthBaseURL:
|
|
163
|
-
userServiceBaseURL:
|
|
164
|
-
imageServiceBaseURL:
|
|
165
|
-
personalizationServiceBaseURL:
|
|
166
|
-
mediaServiceBaseURL:
|
|
167
|
-
catalogServiceBaseURL:
|
|
168
|
-
entitlementServiceBaseURL:
|
|
169
|
-
tenantId:
|
|
170
|
-
environmentId:
|
|
171
|
-
applicationId:
|
|
172
|
-
applicationKey:
|
|
173
|
-
variables:
|
|
174
|
-
var _a, _b, _c;
|
|
140
|
+
id: profile.id ?? generateShortUniqueId(),
|
|
141
|
+
name: profile.name ?? 'Unknown Profile',
|
|
142
|
+
userAuthBaseURL: profile.userAuthBaseURL ?? 'http://localhost:11101',
|
|
143
|
+
userServiceBaseURL: profile.userServiceBaseURL ?? 'http://localhost:11100',
|
|
144
|
+
imageServiceBaseURL: profile.imageServiceBaseURL ?? 'http://localhost:10400',
|
|
145
|
+
personalizationServiceBaseURL: profile.personalizationServiceBaseURL ?? 'http://localhost:11200',
|
|
146
|
+
mediaServiceBaseURL: profile.mediaServiceBaseURL ?? 'http://localhost:10200',
|
|
147
|
+
catalogServiceBaseURL: profile.catalogServiceBaseURL ?? 'http://localhost:10300',
|
|
148
|
+
entitlementServiceBaseURL: profile.entitlementServiceBaseURL ?? 'http://localhost:11600',
|
|
149
|
+
tenantId: profile.tenantId ?? '00000000-0000-0000-0000-000000000000',
|
|
150
|
+
environmentId: profile.environmentId ?? '00000000-0000-0000-0000-000000000000',
|
|
151
|
+
applicationId: profile.applicationId ?? '00000000-0000-0000-0000-000000000000',
|
|
152
|
+
applicationKey: profile.applicationKey ?? 'key',
|
|
153
|
+
variables: profile.variables?.map((variable) => {
|
|
175
154
|
return {
|
|
176
|
-
key:
|
|
177
|
-
value:
|
|
178
|
-
comment:
|
|
155
|
+
key: variable.key ?? `AUTO_GENERATED_KEY_${generateShortUniqueId()}`,
|
|
156
|
+
value: variable.value ?? '',
|
|
157
|
+
comment: variable.comment ?? '',
|
|
179
158
|
};
|
|
180
|
-
})
|
|
159
|
+
}) ?? [],
|
|
181
160
|
};
|
|
182
161
|
});
|
|
183
162
|
saveAllProfiles(migratedProfileConfigs);
|
|
184
163
|
};
|
|
185
164
|
const getAllProfiles = () => {
|
|
186
|
-
|
|
187
|
-
return JSON.parse((_a = localStorage.getItem(KEY_PROFILE_DATA)) !== null && _a !== void 0 ? _a : '[]');
|
|
165
|
+
return JSON.parse(localStorage.getItem(KEY_PROFILE_DATA) ?? '[]');
|
|
188
166
|
};
|
|
189
167
|
const saveAllProfiles = (profiles) => {
|
|
190
168
|
localStorage.setItem(KEY_PROFILE_DATA, JSON.stringify(profiles.sort((first, second) => (first.name > second.name ? 1 : -1))));
|
|
@@ -201,8 +179,7 @@ const saveProfile = (profileToSave) => {
|
|
|
201
179
|
saveAllProfiles(profiles);
|
|
202
180
|
};
|
|
203
181
|
const getProfileVariable = (profile, key) => {
|
|
204
|
-
|
|
205
|
-
return (_a = profile.variables.find((variable) => variable.key === key)) === null || _a === void 0 ? void 0 : _a.value;
|
|
182
|
+
return profile.variables.find((variable) => variable.key === key)?.value;
|
|
206
183
|
};
|
|
207
184
|
const getProfileVariables = (profile) => {
|
|
208
185
|
return profile.variables;
|
|
@@ -225,13 +202,12 @@ const setProfileVariable = (profile, key, value, comment) => {
|
|
|
225
202
|
* latest `UserSettings` type in code by substituting reasonable defaults where necessary and eliminating obsolete properties.
|
|
226
203
|
*/
|
|
227
204
|
const migrateUserSettingsStructuralChanges = () => {
|
|
228
|
-
var _a, _b;
|
|
229
205
|
const existingUserSettings = getUserSettings();
|
|
230
206
|
const allProfiles = getAllProfiles();
|
|
231
207
|
const firstProfileId = allProfiles.length > 0 ? allProfiles[0].id : undefined;
|
|
232
208
|
const migratedUserSettings = {
|
|
233
|
-
loggerPosition:
|
|
234
|
-
activeProfileId:
|
|
209
|
+
loggerPosition: existingUserSettings.loggerPosition ?? '70%',
|
|
210
|
+
activeProfileId: existingUserSettings.activeProfileId ?? firstProfileId,
|
|
235
211
|
};
|
|
236
212
|
setUserSettings(migratedUserSettings);
|
|
237
213
|
};
|
|
@@ -300,8 +276,111 @@ const ScenarioHostLogger = forwardRef((props, ref) => {
|
|
|
300
276
|
React__default.createElement("p", { style: { color: 'darkgrey' } }, logEntry.scenarioId.substring(1))))))));
|
|
301
277
|
});
|
|
302
278
|
|
|
279
|
+
const MIN_PANE_SIZE_PX = 80;
|
|
280
|
+
const KEYBOARD_STEP_PX = 24;
|
|
281
|
+
const getBoundedPrimarySize = (container, clientY) => {
|
|
282
|
+
const bounds = container.getBoundingClientRect();
|
|
283
|
+
if (bounds.height <= 0) {
|
|
284
|
+
return undefined;
|
|
285
|
+
}
|
|
286
|
+
const minimumPaneSize = Math.min(MIN_PANE_SIZE_PX, bounds.height / 2);
|
|
287
|
+
const primarySize = Math.min(Math.max(clientY - bounds.top, minimumPaneSize), bounds.height - minimumPaneSize);
|
|
288
|
+
return `${((primarySize / bounds.height) * 100).toFixed(2)}%`;
|
|
289
|
+
};
|
|
290
|
+
const getPrimarySizePixels = (value, totalSize) => {
|
|
291
|
+
const numericValue = Number.parseFloat(value);
|
|
292
|
+
if (!Number.isFinite(numericValue)) {
|
|
293
|
+
return totalSize * 0.7;
|
|
294
|
+
}
|
|
295
|
+
return value.trim().endsWith('%')
|
|
296
|
+
? (numericValue / 100) * totalSize
|
|
297
|
+
: numericValue;
|
|
298
|
+
};
|
|
299
|
+
const ScenarioHostSplit = ({ initialPrimarySize, splitterSize, onSplitChanged, children, }) => {
|
|
300
|
+
const containerRef = useRef(null);
|
|
301
|
+
const [primarySize, setPrimarySize] = useState(initialPrimarySize);
|
|
302
|
+
useEffect(() => {
|
|
303
|
+
setPrimarySize(initialPrimarySize);
|
|
304
|
+
}, [initialPrimarySize]);
|
|
305
|
+
const applyPrimarySize = useCallback((value) => {
|
|
306
|
+
setPrimarySize(value);
|
|
307
|
+
onSplitChanged?.(value);
|
|
308
|
+
}, [onSplitChanged]);
|
|
309
|
+
const handlePointerDown = useCallback((event) => {
|
|
310
|
+
const container = containerRef.current;
|
|
311
|
+
if (container === null) {
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
event.preventDefault();
|
|
315
|
+
const ownerDocument = container.ownerDocument;
|
|
316
|
+
const updatePrimarySize = (clientY) => {
|
|
317
|
+
const nextPrimarySize = getBoundedPrimarySize(container, clientY);
|
|
318
|
+
if (nextPrimarySize !== undefined) {
|
|
319
|
+
applyPrimarySize(nextPrimarySize);
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
const handlePointerMove = (pointerEvent) => {
|
|
323
|
+
updatePrimarySize(pointerEvent.clientY);
|
|
324
|
+
};
|
|
325
|
+
const stopDragging = (pointerEvent) => {
|
|
326
|
+
updatePrimarySize(pointerEvent.clientY);
|
|
327
|
+
ownerDocument.removeEventListener('pointermove', handlePointerMove);
|
|
328
|
+
ownerDocument.removeEventListener('pointerup', stopDragging);
|
|
329
|
+
ownerDocument.removeEventListener('pointercancel', stopDragging);
|
|
330
|
+
};
|
|
331
|
+
ownerDocument.addEventListener('pointermove', handlePointerMove);
|
|
332
|
+
ownerDocument.addEventListener('pointerup', stopDragging);
|
|
333
|
+
ownerDocument.addEventListener('pointercancel', stopDragging);
|
|
334
|
+
}, [applyPrimarySize]);
|
|
335
|
+
const adjustPrimarySize = useCallback((delta) => {
|
|
336
|
+
const container = containerRef.current;
|
|
337
|
+
if (container === null) {
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
const bounds = container.getBoundingClientRect();
|
|
341
|
+
const currentPrimarySize = getPrimarySizePixels(primarySize, bounds.height);
|
|
342
|
+
const nextPrimarySize = getBoundedPrimarySize(container, bounds.top + currentPrimarySize + delta);
|
|
343
|
+
if (nextPrimarySize !== undefined) {
|
|
344
|
+
applyPrimarySize(nextPrimarySize);
|
|
345
|
+
}
|
|
346
|
+
}, [applyPrimarySize, primarySize]);
|
|
347
|
+
const handleKeyDown = useCallback((event) => {
|
|
348
|
+
if (event.key === 'ArrowUp') {
|
|
349
|
+
event.preventDefault();
|
|
350
|
+
adjustPrimarySize(-KEYBOARD_STEP_PX);
|
|
351
|
+
}
|
|
352
|
+
else if (event.key === 'ArrowDown') {
|
|
353
|
+
event.preventDefault();
|
|
354
|
+
adjustPrimarySize(KEYBOARD_STEP_PX);
|
|
355
|
+
}
|
|
356
|
+
}, [adjustPrimarySize]);
|
|
357
|
+
const handleDoubleClick = useCallback(() => {
|
|
358
|
+
applyPrimarySize(initialPrimarySize);
|
|
359
|
+
}, [applyPrimarySize, initialPrimarySize]);
|
|
360
|
+
return (React__default.createElement("div", { ref: containerRef, style: {
|
|
361
|
+
display: 'grid',
|
|
362
|
+
gridTemplateRows: `minmax(0, ${primarySize}) ${splitterSize} minmax(0, 1fr)`,
|
|
363
|
+
height: '100%',
|
|
364
|
+
minHeight: 0,
|
|
365
|
+
} },
|
|
366
|
+
React__default.createElement("div", { style: { minHeight: 0, overflow: 'hidden' } }, children[0]),
|
|
367
|
+
React__default.createElement("div", { "aria-orientation": "horizontal", onDoubleClick: handleDoubleClick, onKeyDown: handleKeyDown, onPointerDown: handlePointerDown, role: "separator", tabIndex: 0, style: {
|
|
368
|
+
alignItems: 'center',
|
|
369
|
+
cursor: 'row-resize',
|
|
370
|
+
display: 'flex',
|
|
371
|
+
justifyContent: 'center',
|
|
372
|
+
touchAction: 'none',
|
|
373
|
+
userSelect: 'none',
|
|
374
|
+
} },
|
|
375
|
+
React__default.createElement("div", { style: {
|
|
376
|
+
backgroundColor: 'silver',
|
|
377
|
+
height: '1px',
|
|
378
|
+
width: '100%',
|
|
379
|
+
} })),
|
|
380
|
+
React__default.createElement("div", { style: { minHeight: 0, overflow: 'hidden' } }, children[1])));
|
|
381
|
+
};
|
|
382
|
+
|
|
303
383
|
const ScenarioHost = ({ scenarios }) => {
|
|
304
|
-
var _a;
|
|
305
384
|
const groupedScenarios = getGroupedScenarios(scenarios);
|
|
306
385
|
const { pathname } = useLocation();
|
|
307
386
|
const [userSettings] = useState(getUserSettings());
|
|
@@ -333,7 +412,10 @@ const ScenarioHost = ({ scenarios }) => {
|
|
|
333
412
|
const handleProfileChanged = useCallback((event, data) => {
|
|
334
413
|
const activeProfileIndex = profiles.findIndex((profile) => profile.id === data.value);
|
|
335
414
|
setActiveProfile(profiles[activeProfileIndex]);
|
|
336
|
-
setUserSettings(
|
|
415
|
+
setUserSettings({
|
|
416
|
+
...userSettings,
|
|
417
|
+
activeProfileId: profiles[activeProfileIndex].id,
|
|
418
|
+
});
|
|
337
419
|
}, [profiles, userSettings]);
|
|
338
420
|
const ScenarioErrorFallback = (info) => {
|
|
339
421
|
return (React__default.createElement(Segment, { basic: true },
|
|
@@ -359,8 +441,8 @@ const ScenarioHost = ({ scenarios }) => {
|
|
|
359
441
|
value: profile.id,
|
|
360
442
|
text: profile.name,
|
|
361
443
|
};
|
|
362
|
-
}), onChange: handleProfileChanged, value: activeProfile
|
|
363
|
-
React__default.createElement(Button, { style: { marginBottom: '1rem' }, basic: true, "data-test-id": "profiles-button", color: "blue", floated: "right", as: Link, to: `/profiles/${
|
|
444
|
+
}), onChange: handleProfileChanged, value: activeProfile?.id }),
|
|
445
|
+
React__default.createElement(Button, { style: { marginBottom: '1rem' }, basic: true, "data-test-id": "profiles-button", color: "blue", floated: "right", as: Link, to: `/profiles/${activeProfile?.id ?? ''}` }, "Profiles")),
|
|
364
446
|
React__default.createElement(Divider, { style: { marginTop: 0 } }),
|
|
365
447
|
React__default.createElement(List, { link: true }, [...groupedScenarios.keys()].map((groupName) => {
|
|
366
448
|
const groupedScenario = groupedScenarios.get(groupName);
|
|
@@ -390,7 +472,10 @@ const ScenarioHost = ({ scenarios }) => {
|
|
|
390
472
|
maxHeight: 'calc(100vh - 94px)',
|
|
391
473
|
marginRight: '1rem',
|
|
392
474
|
} }, activeProfile !== undefined ? (React__default.createElement(React__default.Fragment, null,
|
|
393
|
-
React__default.createElement(
|
|
475
|
+
React__default.createElement(ScenarioHostSplit, { initialPrimarySize: getUserSettings().loggerPosition, splitterSize: "25px", onSplitChanged: (value) => setUserSettings({
|
|
476
|
+
...getUserSettings(),
|
|
477
|
+
loggerPosition: value,
|
|
478
|
+
}) },
|
|
394
479
|
React__default.createElement("div", { "data-test-id": "scenario-container", style: { height: '100%', overflowY: 'auto' } },
|
|
395
480
|
React__default.createElement(ScenarioHostContext.Provider, { value: {
|
|
396
481
|
scenarios,
|
|
@@ -406,16 +491,13 @@ const ScenarioHost = ({ scenarios }) => {
|
|
|
406
491
|
},
|
|
407
492
|
logger: {
|
|
408
493
|
log: (...messages) => {
|
|
409
|
-
|
|
410
|
-
(_a = loggerRef.current) === null || _a === void 0 ? void 0 : _a.logMessage(messages, 'LOG');
|
|
494
|
+
loggerRef.current?.logMessage(messages, 'LOG');
|
|
411
495
|
},
|
|
412
496
|
warn: (...messages) => {
|
|
413
|
-
|
|
414
|
-
(_a = loggerRef.current) === null || _a === void 0 ? void 0 : _a.logMessage(messages, 'WARN');
|
|
497
|
+
loggerRef.current?.logMessage(messages, 'WARN');
|
|
415
498
|
},
|
|
416
499
|
error: (...messages) => {
|
|
417
|
-
|
|
418
|
-
(_a = loggerRef.current) === null || _a === void 0 ? void 0 : _a.logMessage(messages, 'ERROR');
|
|
500
|
+
loggerRef.current?.logMessage(messages, 'ERROR');
|
|
419
501
|
},
|
|
420
502
|
},
|
|
421
503
|
} },
|
|
@@ -466,19 +548,19 @@ const getGroupedScenarios = (scenarios) => {
|
|
|
466
548
|
const ProfileURLs = ({ selectedProfile, handleInputChange, }) => {
|
|
467
549
|
return (React__default.createElement(Tab.Pane, null,
|
|
468
550
|
React__default.createElement(Form, null,
|
|
469
|
-
React__default.createElement(Form.Input, { width: 6, label: "User Auth Base URL", name: "userAuthBaseURL", value: selectedProfile
|
|
470
|
-
React__default.createElement(Form.Input, { width: 6, label: "User Service Base URL", name: "userServiceBaseURL", value: selectedProfile
|
|
471
|
-
React__default.createElement(Form.Input, { width: 6, label: "Image Service Base URL", name: "imageServiceBaseURL", value: selectedProfile
|
|
472
|
-
React__default.createElement(Form.Input, { width: 6, label: "Personalization Service Base URL", name: "personalizationServiceBaseURL", value: selectedProfile
|
|
551
|
+
React__default.createElement(Form.Input, { width: 6, label: "User Auth Base URL", name: "userAuthBaseURL", value: selectedProfile?.userAuthBaseURL, onChange: handleInputChange }),
|
|
552
|
+
React__default.createElement(Form.Input, { width: 6, label: "User Service Base URL", name: "userServiceBaseURL", value: selectedProfile?.userServiceBaseURL, onChange: handleInputChange }),
|
|
553
|
+
React__default.createElement(Form.Input, { width: 6, label: "Image Service Base URL", name: "imageServiceBaseURL", value: selectedProfile?.imageServiceBaseURL, onChange: handleInputChange }),
|
|
554
|
+
React__default.createElement(Form.Input, { width: 6, label: "Personalization Service Base URL", name: "personalizationServiceBaseURL", value: selectedProfile?.personalizationServiceBaseURL, onChange: handleInputChange }),
|
|
473
555
|
React__default.createElement(Divider, null),
|
|
474
|
-
React__default.createElement(Form.Input, { width: 6, label: "Media Service Base URL", name: "mediaServiceBaseURL", value: selectedProfile
|
|
475
|
-
React__default.createElement(Form.Input, { width: 6, label: "Catalog Service Base URL", name: "catalogServiceBaseURL", value: selectedProfile
|
|
476
|
-
React__default.createElement(Form.Input, { width: 6, label: "Entitlement Service Base URL", name: "entitlementServiceBaseURL", value: selectedProfile
|
|
556
|
+
React__default.createElement(Form.Input, { width: 6, label: "Media Service Base URL", name: "mediaServiceBaseURL", value: selectedProfile?.mediaServiceBaseURL, onChange: handleInputChange }),
|
|
557
|
+
React__default.createElement(Form.Input, { width: 6, label: "Catalog Service Base URL", name: "catalogServiceBaseURL", value: selectedProfile?.catalogServiceBaseURL, onChange: handleInputChange }),
|
|
558
|
+
React__default.createElement(Form.Input, { width: 6, label: "Entitlement Service Base URL", name: "entitlementServiceBaseURL", value: selectedProfile?.entitlementServiceBaseURL, onChange: handleInputChange }),
|
|
477
559
|
React__default.createElement(Divider, null),
|
|
478
|
-
React__default.createElement(Form.Input, { width: 4, label: "Tenant ID", name: "tenantId", value: selectedProfile
|
|
479
|
-
React__default.createElement(Form.Input, { width: 4, label: "Environment ID", name: "environmentId", value: selectedProfile
|
|
480
|
-
React__default.createElement(Form.Input, { width: 4, label: "Application ID", name: "applicationId", value: selectedProfile
|
|
481
|
-
React__default.createElement(Form.Input, { width: 4, label: "Application Key", name: "applicationKey", value: selectedProfile
|
|
560
|
+
React__default.createElement(Form.Input, { width: 4, label: "Tenant ID", name: "tenantId", value: selectedProfile?.tenantId, onChange: handleInputChange }),
|
|
561
|
+
React__default.createElement(Form.Input, { width: 4, label: "Environment ID", name: "environmentId", value: selectedProfile?.environmentId, onChange: handleInputChange }),
|
|
562
|
+
React__default.createElement(Form.Input, { width: 4, label: "Application ID", name: "applicationId", value: selectedProfile?.applicationId, onChange: handleInputChange }),
|
|
563
|
+
React__default.createElement(Form.Input, { width: 4, label: "Application Key", name: "applicationKey", value: selectedProfile?.applicationKey, onChange: handleInputChange }))));
|
|
482
564
|
};
|
|
483
565
|
|
|
484
566
|
const ProfileVariables = ({ selectedProfile, handleVariableInputChange, insertNewVariable, deleteVariable, }) => {
|
|
@@ -503,19 +585,17 @@ const ProfileVariables = ({ selectedProfile, handleVariableInputChange, insertNe
|
|
|
503
585
|
};
|
|
504
586
|
|
|
505
587
|
const Profiles = ({ match }) => {
|
|
506
|
-
var _a, _b, _c, _d;
|
|
507
588
|
const { pathname } = useLocation();
|
|
508
589
|
const history = useHistory();
|
|
509
590
|
const [profiles, setProfiles] = useState(getAllProfiles());
|
|
510
|
-
const [selectedProfile, setSelectedProfile] = useState(profiles.find((profile) =>
|
|
511
|
-
const [selectedTab, setSelectedTab] = useState(parseInt(
|
|
591
|
+
const [selectedProfile, setSelectedProfile] = useState(profiles.find((profile) => profile.id === match?.params?.profileId));
|
|
592
|
+
const [selectedTab, setSelectedTab] = useState(parseInt(match?.params?.tabId ?? '0'));
|
|
512
593
|
useEffect(() => {
|
|
513
|
-
setSelectedProfile(profiles.find((profile) =>
|
|
514
|
-
}, [
|
|
594
|
+
setSelectedProfile(profiles.find((profile) => profile.id === match?.params?.profileId));
|
|
595
|
+
}, [match?.params?.profileId, profiles]);
|
|
515
596
|
useEffect(() => {
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
}, [(_d = match === null || match === void 0 ? void 0 : match.params) === null || _d === void 0 ? void 0 : _d.tabId]);
|
|
597
|
+
setSelectedTab(parseInt(match?.params?.tabId ?? '0'));
|
|
598
|
+
}, [match?.params?.tabId]);
|
|
519
599
|
const handleNewProfileClick = (type) => () => {
|
|
520
600
|
const newProfileId = generateShortUniqueId();
|
|
521
601
|
setProfiles([
|
|
@@ -548,7 +628,7 @@ const Profiles = ({ match }) => {
|
|
|
548
628
|
history.push(`/profiles/${newProfileId}`);
|
|
549
629
|
};
|
|
550
630
|
const handleSaveProfileClick = () => {
|
|
551
|
-
const activeProfileIndex = profiles.findIndex((env) => env.id ===
|
|
631
|
+
const activeProfileIndex = profiles.findIndex((env) => env.id === selectedProfile?.id);
|
|
552
632
|
if (activeProfileIndex !== -1 && selectedProfile !== undefined) {
|
|
553
633
|
profiles[activeProfileIndex] = selectedProfile;
|
|
554
634
|
setProfiles([...profiles]);
|
|
@@ -556,7 +636,7 @@ const Profiles = ({ match }) => {
|
|
|
556
636
|
}
|
|
557
637
|
};
|
|
558
638
|
const handleDeleteProfileClick = () => {
|
|
559
|
-
const activeProfileIndex = profiles.findIndex((env) => env.id ===
|
|
639
|
+
const activeProfileIndex = profiles.findIndex((env) => env.id === selectedProfile?.id);
|
|
560
640
|
if (activeProfileIndex !== -1 && selectedProfile !== undefined) {
|
|
561
641
|
profiles.splice(activeProfileIndex, 1);
|
|
562
642
|
setProfiles([...profiles]);
|
|
@@ -565,7 +645,7 @@ const Profiles = ({ match }) => {
|
|
|
565
645
|
}
|
|
566
646
|
};
|
|
567
647
|
const handleExportProfileClick = () => {
|
|
568
|
-
const activeProfileIndex = profiles.findIndex((env) => env.id ===
|
|
648
|
+
const activeProfileIndex = profiles.findIndex((env) => env.id === selectedProfile?.id);
|
|
569
649
|
if (activeProfileIndex !== -1 && selectedProfile !== undefined) {
|
|
570
650
|
const fileDownloadLink = document.createElement('a');
|
|
571
651
|
fileDownloadLink.href = URL.createObjectURL(new Blob([JSON.stringify(selectedProfile, null, 2)], {
|
|
@@ -578,22 +658,20 @@ const Profiles = ({ match }) => {
|
|
|
578
658
|
}
|
|
579
659
|
};
|
|
580
660
|
const handleImportProfileClick = () => {
|
|
581
|
-
|
|
582
|
-
(_a = document.getElementById('fileInput')) === null || _a === void 0 ? void 0 : _a.click();
|
|
661
|
+
document.getElementById('fileInput')?.click();
|
|
583
662
|
// Event listener for file input change
|
|
584
|
-
|
|
585
|
-
.getElementById('fileInput')
|
|
586
|
-
|
|
663
|
+
document
|
|
664
|
+
.getElementById('fileInput')
|
|
665
|
+
?.addEventListener('change', function (event) {
|
|
587
666
|
if (event && event.target) {
|
|
588
667
|
const inputElement = event.target;
|
|
589
668
|
// Handle the selected file
|
|
590
669
|
if (inputElement) {
|
|
591
|
-
const file =
|
|
670
|
+
const file = inputElement.files?.[0];
|
|
592
671
|
if (file) {
|
|
593
672
|
const reader = new FileReader();
|
|
594
673
|
reader.onload = function (e) {
|
|
595
|
-
|
|
596
|
-
const fileContent = (_a = e.target) === null || _a === void 0 ? void 0 : _a.result;
|
|
674
|
+
const fileContent = e.target?.result;
|
|
597
675
|
// Save file content to local storage
|
|
598
676
|
saveToLocalStorage(fileContent);
|
|
599
677
|
// Reset the file input value to clear it
|
|
@@ -610,7 +688,7 @@ const Profiles = ({ match }) => {
|
|
|
610
688
|
};
|
|
611
689
|
const saveToLocalStorage = (fileContent) => {
|
|
612
690
|
const importedProfile = JSON.parse(fileContent);
|
|
613
|
-
const profileAlreadyExists = profiles.find((profile) => profile.id ===
|
|
691
|
+
const profileAlreadyExists = profiles.find((profile) => profile.id === importedProfile?.id);
|
|
614
692
|
if (profileAlreadyExists === undefined) {
|
|
615
693
|
// Add new data to the profiles array
|
|
616
694
|
profiles.push(importedProfile);
|
|
@@ -618,7 +696,7 @@ const Profiles = ({ match }) => {
|
|
|
618
696
|
saveAllProfiles(profiles);
|
|
619
697
|
}
|
|
620
698
|
else {
|
|
621
|
-
const existProfileIndex = profiles.findIndex((profile) => profile.id ===
|
|
699
|
+
const existProfileIndex = profiles.findIndex((profile) => profile.id === importedProfile?.id);
|
|
622
700
|
if (existProfileIndex !== -1) {
|
|
623
701
|
profiles[existProfileIndex] = importedProfile;
|
|
624
702
|
setProfiles([...profiles]);
|
|
@@ -633,7 +711,10 @@ const Profiles = ({ match }) => {
|
|
|
633
711
|
const { name, value } = data;
|
|
634
712
|
setSelectedProfile((prevState) => {
|
|
635
713
|
if (prevState !== undefined) {
|
|
636
|
-
const newState =
|
|
714
|
+
const newState = {
|
|
715
|
+
...prevState,
|
|
716
|
+
[name]: value,
|
|
717
|
+
};
|
|
637
718
|
return newState;
|
|
638
719
|
}
|
|
639
720
|
else {
|
|
@@ -657,7 +738,9 @@ const Profiles = ({ match }) => {
|
|
|
657
738
|
else if (name === 'comment') {
|
|
658
739
|
prevState.variables[variableIndex].comment = value;
|
|
659
740
|
}
|
|
660
|
-
const newState =
|
|
741
|
+
const newState = {
|
|
742
|
+
...prevState,
|
|
743
|
+
};
|
|
661
744
|
return newState;
|
|
662
745
|
}
|
|
663
746
|
else {
|
|
@@ -669,7 +752,9 @@ const Profiles = ({ match }) => {
|
|
|
669
752
|
setSelectedProfile((prevState) => {
|
|
670
753
|
if (prevState !== undefined) {
|
|
671
754
|
prevState.variables.push({ key: '', value: '', comment: '' });
|
|
672
|
-
const newState =
|
|
755
|
+
const newState = {
|
|
756
|
+
...prevState,
|
|
757
|
+
};
|
|
673
758
|
return newState;
|
|
674
759
|
}
|
|
675
760
|
else {
|
|
@@ -681,7 +766,9 @@ const Profiles = ({ match }) => {
|
|
|
681
766
|
setSelectedProfile((prevState) => {
|
|
682
767
|
if (prevState !== undefined) {
|
|
683
768
|
prevState.variables.splice(variableIndex, 1);
|
|
684
|
-
const newState =
|
|
769
|
+
const newState = {
|
|
770
|
+
...prevState,
|
|
771
|
+
};
|
|
685
772
|
return newState;
|
|
686
773
|
}
|
|
687
774
|
else {
|
|
@@ -711,13 +798,13 @@ const Profiles = ({ match }) => {
|
|
|
711
798
|
})))),
|
|
712
799
|
selectedProfile === undefined ? (React__default.createElement(React__default.Fragment, null)) : (React__default.createElement(Grid.Column, { stretched: true, width: 12 },
|
|
713
800
|
React__default.createElement(Segment, null,
|
|
714
|
-
React__default.createElement(Header, null,
|
|
715
|
-
selectedProfile
|
|
801
|
+
React__default.createElement(Header, null,
|
|
802
|
+
selectedProfile?.name,
|
|
716
803
|
React__default.createElement(Button, { "data-test-id": "save-profile-button", color: "blue", floated: "right", content: "Save", onClick: handleSaveProfileClick }),
|
|
717
804
|
React__default.createElement(Button, { basic: true, color: "blue", floated: "right", content: "Delete", onClick: handleDeleteProfileClick }),
|
|
718
805
|
React__default.createElement(Button, { basic: true, color: "blue", floated: "right", content: "Export", onClick: handleExportProfileClick })),
|
|
719
806
|
React__default.createElement(Form, null,
|
|
720
|
-
React__default.createElement(Form.Input, { width: 4, label: "Profile Name", name: "name", value: selectedProfile
|
|
807
|
+
React__default.createElement(Form.Input, { width: 4, label: "Profile Name", name: "name", value: selectedProfile?.name, onChange: handleInputChange })),
|
|
721
808
|
React__default.createElement(Divider, null),
|
|
722
809
|
React__default.createElement(Tab, { activeIndex: selectedTab, panes: [
|
|
723
810
|
{
|
|
@@ -755,40 +842,12 @@ const ScenarioHostApp = ({ scenarios, }) => {
|
|
|
755
842
|
React__default.createElement(ScenarioHost, { scenarios: scenarios })))));
|
|
756
843
|
};
|
|
757
844
|
|
|
758
|
-
/*! *****************************************************************************
|
|
759
|
-
Copyright (c) Microsoft Corporation.
|
|
760
|
-
|
|
761
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
762
|
-
purpose with or without fee is hereby granted.
|
|
763
|
-
|
|
764
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
765
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
766
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
767
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
768
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
769
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
770
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
771
|
-
***************************************************************************** */
|
|
772
|
-
|
|
773
|
-
function __rest(s, e) {
|
|
774
|
-
var t = {};
|
|
775
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
776
|
-
t[p] = s[p];
|
|
777
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
778
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
779
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
780
|
-
t[p[i]] = s[p[i]];
|
|
781
|
-
}
|
|
782
|
-
return t;
|
|
783
|
-
}
|
|
784
|
-
|
|
785
845
|
/**
|
|
786
846
|
* This component has built-in support to display all `variables` defined in the active profile when the
|
|
787
847
|
* control is focused. The user may click on an item from this list to select a variable, then its corresponding value will be
|
|
788
848
|
* fetched and assigned into the input field.
|
|
789
849
|
*/
|
|
790
|
-
const VariableSearch = (
|
|
791
|
-
var { label, setStateValue } = _a, rest = __rest(_a, ["label", "setStateValue"]);
|
|
850
|
+
const VariableSearch = ({ label, setStateValue, ...rest }) => {
|
|
792
851
|
const { getVariables, getVariable } = useScenarioHost();
|
|
793
852
|
const allVariables = getVariables();
|
|
794
853
|
const [resultsOpened, setResultsOpened] = useState(false);
|
|
@@ -804,9 +863,8 @@ const VariableSearch = (_a) => {
|
|
|
804
863
|
setResultsOpened(false);
|
|
805
864
|
},
|
|
806
865
|
onSearchChange: (event, data) => {
|
|
807
|
-
var _a;
|
|
808
866
|
if (setStateValue !== undefined) {
|
|
809
|
-
setStateValue(
|
|
867
|
+
setStateValue(data.value ?? '');
|
|
810
868
|
}
|
|
811
869
|
},
|
|
812
870
|
onResultSelect: (event, data) => {
|
|
@@ -816,12 +874,12 @@ const VariableSearch = (_a) => {
|
|
|
816
874
|
setResultsOpened(false);
|
|
817
875
|
},
|
|
818
876
|
};
|
|
819
|
-
return (React__default.createElement(Search,
|
|
877
|
+
return (React__default.createElement(Search, { input: { className: 'left icon' }, placeholder: "Fetch value from a variable or type it in", label: {
|
|
820
878
|
children: label,
|
|
821
879
|
}, results: allVariables.map((variable) => {
|
|
822
880
|
return { title: variable.key, description: variable.comment };
|
|
823
|
-
})
|
|
881
|
+
}), ...searchResultHandlers, ...rest }));
|
|
824
882
|
};
|
|
825
883
|
|
|
826
884
|
export { ScenarioHostApp, VariableSearch, useScenarioHost };
|
|
827
|
-
//# sourceMappingURL=index.
|
|
885
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../../../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","../../../../node_modules/react-error-boundary/dist/react-error-boundary.esm.js"],"sourcesContent":["function _setPrototypeOf(t, e) {\n return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {\n return t.__proto__ = e, t;\n }, _setPrototypeOf(t, e);\n}\nexport { _setPrototypeOf as default };","import setPrototypeOf from \"./setPrototypeOf.js\";\nfunction _inheritsLoose(t, o) {\n t.prototype = Object.create(o.prototype), t.prototype.constructor = t, setPrototypeOf(t, o);\n}\nexport { _inheritsLoose as default };","import _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';\nimport * as React from 'react';\n\nvar changedArray = function changedArray(a, b) {\n if (a === void 0) {\n a = [];\n }\n\n if (b === void 0) {\n b = [];\n }\n\n return a.length !== b.length || a.some(function (item, index) {\n return !Object.is(item, b[index]);\n });\n};\n\nvar initialState = {\n error: null\n};\n\nvar ErrorBoundary = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(ErrorBoundary, _React$Component);\n\n function ErrorBoundary() {\n var _this;\n\n for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {\n _args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;\n _this.state = initialState;\n\n _this.resetErrorBoundary = function () {\n var _this$props;\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n _this.props.onReset == null ? void 0 : (_this$props = _this.props).onReset.apply(_this$props, args);\n\n _this.reset();\n };\n\n return _this;\n }\n\n ErrorBoundary.getDerivedStateFromError = function getDerivedStateFromError(error) {\n return {\n error: error\n };\n };\n\n var _proto = ErrorBoundary.prototype;\n\n _proto.reset = function reset() {\n this.setState(initialState);\n };\n\n _proto.componentDidCatch = function componentDidCatch(error, info) {\n var _this$props$onError, _this$props2;\n\n (_this$props$onError = (_this$props2 = this.props).onError) == null ? void 0 : _this$props$onError.call(_this$props2, error, info);\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {\n var error = this.state.error;\n var resetKeys = this.props.resetKeys; // There's an edge case where if the thing that triggered the error\n // happens to *also* be in the resetKeys array, we'd end up resetting\n // the error boundary immediately. This would likely trigger a second\n // error to be thrown.\n // So we make sure that we don't check the resetKeys on the first call\n // of cDU after the error is set\n\n if (error !== null && prevState.error !== null && changedArray(prevProps.resetKeys, resetKeys)) {\n var _this$props$onResetKe, _this$props3;\n\n (_this$props$onResetKe = (_this$props3 = this.props).onResetKeysChange) == null ? void 0 : _this$props$onResetKe.call(_this$props3, prevProps.resetKeys, resetKeys);\n this.reset();\n }\n };\n\n _proto.render = function render() {\n var error = this.state.error;\n var _this$props4 = this.props,\n fallbackRender = _this$props4.fallbackRender,\n FallbackComponent = _this$props4.FallbackComponent,\n fallback = _this$props4.fallback;\n\n if (error !== null) {\n var _props = {\n error: error,\n resetErrorBoundary: this.resetErrorBoundary\n };\n\n if ( /*#__PURE__*/React.isValidElement(fallback)) {\n return fallback;\n } else if (typeof fallbackRender === 'function') {\n return fallbackRender(_props);\n } else if (FallbackComponent) {\n return /*#__PURE__*/React.createElement(FallbackComponent, _props);\n } else {\n throw new Error('react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop');\n }\n }\n\n return this.props.children;\n };\n\n return ErrorBoundary;\n}(React.Component);\n\nfunction withErrorBoundary(Component, errorBoundaryProps) {\n var Wrapped = function Wrapped(props) {\n return /*#__PURE__*/React.createElement(ErrorBoundary, errorBoundaryProps, /*#__PURE__*/React.createElement(Component, props));\n }; // Format for display in DevTools\n\n\n var name = Component.displayName || Component.name || 'Unknown';\n Wrapped.displayName = \"withErrorBoundary(\" + name + \")\";\n return Wrapped;\n}\n\nfunction useErrorHandler(givenError) {\n var _React$useState = React.useState(null),\n error = _React$useState[0],\n setError = _React$useState[1];\n\n if (givenError != null) throw givenError;\n if (error != null) throw error;\n return setError;\n}\n/*\neslint\n @typescript-eslint/sort-type-union-intersection-members: \"off\",\n @typescript-eslint/no-throw-literal: \"off\",\n @typescript-eslint/prefer-nullish-coalescing: \"off\"\n*/\n\nexport { ErrorBoundary, useErrorHandler, withErrorBoundary };\n"],"names":["setPrototypeOf"],"mappings":";;;;;AAAA,SAAS,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE;AAC/B,EAAE,OAAO,eAAe,GAAG,MAAM,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC,EAAE;AAClG,IAAI,OAAO,CAAC,CAAC,SAAS,GAAG,CAAC,EAAE,CAAC,CAAC;AAC9B,GAAG,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3B;;ACHA,SAAS,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE;AAC9B,EAAE,CAAC,CAAC,SAAS,GAAG,MAAM,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