@telia-ace/knowledge-widget-types-grid 1.0.54 → 1.1.1-rc.2
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/create-params-13c11e30.js +1 -0
- package/create-params-4e652cc7.mjs +24 -0
- package/index-373df3a5.js +6 -0
- package/index-37d41a7c.js +1 -0
- package/index-4000749f.mjs +18 -0
- package/index-4a7683d6.mjs +7686 -0
- package/index-53f86cb1.mjs +80 -0
- package/index-5c9c2abf.mjs +883 -0
- package/index-6573c0b0.js +1258 -0
- package/index-83935001.js +1 -0
- package/index-89e0c636.js +1 -0
- package/index-8ea3d174.mjs +81 -0
- package/index-a20f39e4.mjs +1709 -0
- package/index-a53df8cf.js +642 -0
- package/index-da27700c.js +9 -0
- package/index-f2febaed.mjs +792 -0
- package/index.js +1 -0
- package/index.mjs +23 -0
- package/package.json +14 -25
- package/render-6b17449a.js +1 -0
- package/render-e363a527.mjs +57 -0
- package/unmount-063d8ea3.mjs +5 -0
- package/unmount-7ebc3b77.js +1 -0
- package/{dist/widget → widget}/services.d.ts +1 -1
- package/LICENSE.txt +0 -6
- package/README.md +0 -4
- package/dist/index.js +0 -20
- package/dist/index.js.map +0 -1
- /package/{dist/index.d.ts → index.d.ts} +0 -0
- /package/{dist/widget → widget}/extended-widget.d.ts +0 -0
- /package/{dist/widget → widget}/index.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-6573c0b0.js");require("react/jsx-runtime");require("@emotion/styled");require("@emotion/react");require("react");require("react-transition-group");require("react-dom");require("react-router-dom");require("react-router");exports.DataClient=e.DataClient;exports.DataType=e.DataType;exports.FeedbackType=e.FeedbackType;exports.ServiceClientQueryType=e.ServiceClientQueryType;exports.SortingType=e.SortingType;exports.determineServiceClientQueryType=e.determineServiceClientQueryType;exports.formatLegacyData=e.formatLegacyData;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var mt=Object.defineProperty;var vt=(i,t,e)=>t in i?mt(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var R=(i,t,e)=>(vt(i,typeof t!="symbol"?t+"":t,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-6573c0b0.js"),yt=require("./create-params-13c11e30.js");require("react/jsx-runtime");require("@emotion/styled");require("@emotion/react");require("react");require("react-transition-group");require("react-dom");require("react-router-dom");require("react-router");var wt=function(i,t,e,n,s,a,h,p){if(process.env.NODE_ENV!=="production"&&t===void 0)throw new Error("invariant requires an error message argument");if(!i){var u;if(t===void 0)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[e,n,s,a,h,p],b=0;u=new Error(t.replace(/%s/g,function(){return l[b++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}},Pt=wt;const St=r.getDefaultExportFromCjs(Pt);var bt=function(t){return t.charAt(0)==="/"?t:"/"+t},ft=function(t,e){return new RegExp("^"+e+"(\\/|\\?|#|$)","i").test(t)},xt=function(t,e){return ft(t,e)?t.substr(e.length):t},Lt=function(t){return t.charAt(t.length-1)==="/"?t.slice(0,-1):t},Ht=function(t){var e=t||"/",n="",s="",a=e.indexOf("#");a!==-1&&(s=e.substr(a),e=e.substr(0,a));var h=e.indexOf("?");return h!==-1&&(n=e.substr(h),e=e.substr(0,h)),{pathname:e,search:n==="?"?"":n,hash:s==="#"?"":s}},lt=function(t){var e=t.pathname,n=t.search,s=t.hash,a=e||"/";return n&&n!=="?"&&(a+=n.charAt(0)==="?"?n:"?"+n),s&&s!=="#"&&(a+=s.charAt(0)==="#"?s:"#"+s),a},Ot=Object.assign||function(i){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},V=function(t,e,n,s){var a=void 0;typeof t=="string"?(a=Ht(t),a.state=e):(a=Ot({},t),a.pathname===void 0&&(a.pathname=""),a.search?a.search.charAt(0)!=="?"&&(a.search="?"+a.search):a.search="",a.hash?a.hash.charAt(0)!=="#"&&(a.hash="#"+a.hash):a.hash="",e!==void 0&&a.state===void 0&&(a.state=e));try{a.pathname=decodeURI(a.pathname)}catch(h){throw h instanceof URIError?new URIError('Pathname "'+a.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):h}return n&&(a.key=n),s?a.pathname?a.pathname.charAt(0)!=="/"&&(a.pathname=r.resolvePathname(a.pathname,s.pathname)):a.pathname=s.pathname:a.pathname||(a.pathname="/"),a},gt=function(){var t=null,e=function(u){return r.warning(t==null,"A history supports only one prompt at a time"),t=u,function(){t===u&&(t=null)}},n=function(u,l,b,y){if(t!=null){var _=typeof t=="function"?t(u,l):t;typeof _=="string"?typeof b=="function"?b(_,y):(r.warning(!1,"A history needs a getUserConfirmation function in order to use a prompt message"),y(!0)):y(_!==!1)}else y(!0)},s=[],a=function(u){var l=!0,b=function(){l&&u.apply(void 0,arguments)};return s.push(b),function(){l=!1,s=s.filter(function(y){return y!==b})}},h=function(){for(var u=arguments.length,l=Array(u),b=0;b<u;b++)l[b]=arguments[b];s.forEach(function(y){return y.apply(void 0,l)})};return{setPrompt:e,confirmTransitionTo:n,appendListener:a,notifyListeners:h}},Mt=!!(typeof window<"u"&&window.document&&window.document.createElement),tt=function(t,e,n){return t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)},et=function(t,e,n){return t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent("on"+e,n)},Et=function(t,e){return e(window.confirm(t))},Rt=function(){var t=window.navigator.userAgent;return(t.indexOf("Android 2.")!==-1||t.indexOf("Android 4.0")!==-1)&&t.indexOf("Mobile Safari")!==-1&&t.indexOf("Chrome")===-1&&t.indexOf("Windows Phone")===-1?!1:window.history&&"pushState"in window.history},kt=function(){return window.navigator.userAgent.indexOf("Trident")===-1},Tt=function(t){return t.state===void 0&&navigator.userAgent.indexOf("CriOS")===-1},nt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},Ct=Object.assign||function(i){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},at="popstate",rt="hashchange",it=function(){try{return window.history.state||{}}catch{return{}}},_t=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};St(Mt,"Browser history needs a DOM");var e=window.history,n=Rt(),s=!kt(),a=t.forceRefresh,h=a===void 0?!1:a,p=t.getUserConfirmation,u=p===void 0?Et:p,l=t.keyLength,b=l===void 0?6:l,y=t.basename?Lt(bt(t.basename)):"",_=function(o){var g=o||{},w=g.key,m=g.state,O=window.location,S=O.pathname,T=O.search,B=O.hash,C=S+T+B;return r.warning(!y||ft(C,y),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+C+'" to begin with "'+y+'".'),y&&(C=xt(C,y)),V(C,m,w)},F=function(){return Math.random().toString(36).substr(2,b)},I=gt(),U=function(o){Ct(f,o),f.length=e.length,I.notifyListeners(f.location,f.action)},k=function(o){Tt(o)||j(_(o.state))},N=function(){j(_(it()))},W=!1,j=function(o){if(W)W=!1,U();else{var g="POP";I.confirmTransitionTo(o,g,u,function(w){w?U({action:g,location:o}):Y(o)})}},Y=function(o){var g=f.location,w=D.indexOf(g.key);w===-1&&(w=0);var m=D.indexOf(o.key);m===-1&&(m=0);var O=w-m;O&&(W=!0,x(O))},K=_(it()),D=[K.key],v=function(o){return y+lt(o)},L=function(o,g){r.warning(!((typeof o>"u"?"undefined":nt(o))==="object"&&o.state!==void 0&&g!==void 0),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var w="PUSH",m=V(o,g,F(),f.location);I.confirmTransitionTo(m,w,u,function(O){if(O){var S=v(m),T=m.key,B=m.state;if(n)if(e.pushState({key:T,state:B},null,S),h)window.location.href=S;else{var C=D.indexOf(f.location.key),G=D.slice(0,C===-1?0:C+1);G.push(m.key),D=G,U({action:w,location:m})}else r.warning(B===void 0,"Browser history cannot push state in browsers that do not support HTML5 history"),window.location.href=S}})},P=function(o,g){r.warning(!((typeof o>"u"?"undefined":nt(o))==="object"&&o.state!==void 0&&g!==void 0),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var w="REPLACE",m=V(o,g,F(),f.location);I.confirmTransitionTo(m,w,u,function(O){if(O){var S=v(m),T=m.key,B=m.state;if(n)if(e.replaceState({key:T,state:B},null,S),h)window.location.replace(S);else{var C=D.indexOf(f.location.key);C!==-1&&(D[C]=m.key),U({action:w,location:m})}else r.warning(B===void 0,"Browser history cannot replace state in browsers that do not support HTML5 history"),window.location.replace(S)}})},x=function(o){e.go(o)},E=function(){return x(-1)},H=function(){return x(1)},A=0,q=function(o){A+=o,A===1?(tt(window,at,k),s&&tt(window,rt,N)):A===0&&(et(window,at,k),s&&et(window,rt,N))},$=!1,M=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,g=I.setPrompt(o);return $||(q(1),$=!0),function(){return $&&($=!1,q(-1)),g()}},d=function(o){var g=I.appendListener(o);return q(1),function(){q(-1),g()}},f={length:e.length,action:"POP",location:K,createHref:v,push:L,replace:P,go:x,goBack:E,goForward:H,block:M,listen:d};return f},ot=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},It=Object.assign||function(i){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},st=function(t,e,n){return Math.min(Math.max(t,e),n)},Dt=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.getUserConfirmation,n=t.initialEntries,s=n===void 0?["/"]:n,a=t.initialIndex,h=a===void 0?0:a,p=t.keyLength,u=p===void 0?6:p,l=gt(),b=function(P){It(v,P),v.length=v.entries.length,l.notifyListeners(v.location,v.action)},y=function(){return Math.random().toString(36).substr(2,u)},_=st(h,0,s.length-1),F=s.map(function(L){return typeof L=="string"?V(L,void 0,y()):V(L,void 0,L.key||y())}),I=lt,U=function(P,x){r.warning(!((typeof P>"u"?"undefined":ot(P))==="object"&&P.state!==void 0&&x!==void 0),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var E="PUSH",H=V(P,x,y(),v.location);l.confirmTransitionTo(H,E,e,function(A){if(A){var q=v.index,$=q+1,M=v.entries.slice(0);M.length>$?M.splice($,M.length-$,H):M.push(H),b({action:E,location:H,index:$,entries:M})}})},k=function(P,x){r.warning(!((typeof P>"u"?"undefined":ot(P))==="object"&&P.state!==void 0&&x!==void 0),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var E="REPLACE",H=V(P,x,y(),v.location);l.confirmTransitionTo(H,E,e,function(A){A&&(v.entries[v.index]=H,b({action:E,location:H}))})},N=function(P){var x=st(v.index+P,0,v.entries.length-1),E="POP",H=v.entries[x];l.confirmTransitionTo(H,E,e,function(A){A?b({action:E,location:H,index:x}):b()})},W=function(){return N(-1)},j=function(){return N(1)},Y=function(P){var x=v.index+P;return x>=0&&x<v.entries.length},K=function(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return l.setPrompt(P)},D=function(P){return l.appendListener(P)},v={length:F.length,action:"POP",location:F[_],index:_,entries:F,createHref:I,push:U,replace:k,go:N,goBack:W,goForward:j,canGo:Y,block:K,listen:D};return v};const ct="hashchange",At={hashbang:{encodePath:i=>i.charAt(0)==="!"?i:"!/"+r.stripLeadingSlash_1(i),decodePath:i=>i.charAt(0)==="!"?i.substr(1):i},noslash:{encodePath:r.stripLeadingSlash_1,decodePath:r.addLeadingSlash_1},slash:{encodePath:r.addLeadingSlash_1,decodePath:r.addLeadingSlash_1}},z=()=>{const i=window.location.href,t=i.indexOf("#");return t===-1?"":i.substring(t+1)},ht=i=>window.location.hash=i,ut=i=>{const t=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,t>=0?t:0)+"#"+i)},Q=(i="")=>{const t=i.replace(";","?"),e=[{from:/\;+/gi,to:"&"},{from:/:+/gi,to:"="}];let n=t;return e.forEach(({to:s,from:a})=>{n=n.replace(a,s)}),n},pt=(i={})=>{const t=window.history,{getUserConfirmation:e=r.getConfirmation_1,hashType:n="slash"}=i,s=i.basename?r.stripTrailingSlash_1(r.addLeadingSlash_1(i.basename)):"",{encodePath:a}=At[n],h=()=>{const d=z(),f=b(d);return r.createLocation(f,Q)},p=i.transitionManager||r._default(),u=d=>{Object.assign(M,d),M.length=t.length,p.notifyListeners(M.location,M.action,i.widgetName)};let l=!1;const b=d=>{const f=g=>{function w(m,O){const S={};let T;for(;T=O.exec(m);)S[T[1]]=T[2];return S}return w(g,/([^#?&=]+)=([^&#]*)(?!.*?\#)/gi)||null},c="humany-"+i.widgetName;return f(d)[c]},y=()=>{const d=h(),f=M.location;!l&&r.locationsAreEqual_1(f,d)||_(d)},_=d=>{if(l)l=!1,u();else{const f="POP";p.confirmTransitionTo(d,f,e,c=>{c?u({action:f,location:d}):F(d)})}},F=d=>{const f=M.location;let c=k.lastIndexOf(r.createPath_1(f));c===-1&&(c=0);let o=k.lastIndexOf(r.createPath_1(d));o===-1&&(o=0);const g=c-o;g&&(l=!0,v(g))},I=z(),U=a(I);I!==U&&ut(U);let k=[];const N=h();N.pathname!==null&&k.push(r.createPath_1(N));const W=(d="")=>{const f=[{from:/\?+/gi,to:";"},{from:/\&+/gi,to:";"},{from:/\&+/gi,to:";"},{from:/=+/gi,to:":"}];let c=d;return f.forEach(({to:o,from:g})=>{c=c.replace(g,o)}),c},j=(d,f,c)=>{let o="",g=!1;return d.split("&").forEach(m=>{const O=m.split("="),S=O[0],T=O[1];if(S===f){if(g=!0,c===null)return;o.length>0&&(o+="&"),typeof c<"u"?o+=S+"="+c:o+=S}else S&&(o.length>0&&(o+="&"),o+=S+"="+T)}),!g&&c!==null&&(o.length>0&&(o+="&"),typeof c<"u"?o+=f+"="+c:o+=f),o},Y=d=>{const f=d.pathname,c=W(d.search),o=f+(c?`;${c}`:""),w=`humany-${i.widgetName}`,m=z();return`#${j(m,w,o).replace(";;",";")}`},K=(d,f)=>{const c="PUSH",o=r.createLocation(d,Q),g=o.pathname,w=W(o.search),m=g+(w?`${w}`:""),S=`humany-${i.widgetName}`,T=z(),B=j(T,S,m);p.confirmTransitionTo(o,c,e,C=>{if(!C)return;const G=r.createPath_1(o),J=a(B);if(z()!==J){ht(J);const X=k.lastIndexOf(r.createPath_1(M.location)),Z=k.slice(0,X===-1?0:X+1);Z.push(G),k=Z,u({action:c,location:o})}else u()})},D=(d,f)=>{const c="REPLACE",o=r.createLocation(d,Q);p.confirmTransitionTo(o,c,e,g=>{if(!g)return;const w=r.createPath_1(o),m=a(s+w);z()!==m&&ut(m);const S=k.indexOf(r.createPath_1(M.location));S!==-1&&(k[S]=w),u({action:c,location:o})})},v=d=>{t.go(d)},L=()=>v(-1),P=()=>v(1);let x=0;const E=d=>{x+=d,x===1?window.addEventListener(ct,y):x===0&&window.removeEventListener(ct,y)};let H=!1;const A=(d=!1)=>{const f=p.setPrompt(d);return H||(E(1),H=!0),()=>(H&&(H=!1,E(-1)),f())},q=d=>{const f=p.appendListener(d);return E(1),()=>{E(-1),f()}},$=()=>{const d=z(),f=j(d,`humany-${i.widgetName}`,null),c=a(f);ht(c)},M={createHref:Y,createLocation:r.createLocation,push:K,replace:D,go:v,goBack:L,goForward:P,block:A,listen:q,stop:$,length:t.length,action:"POP",location:N};return M},$t=Object.freeze(Object.defineProperty({__proto__:null,decodeSearch:Q,default:pt,getHashPath:z},Symbol.toStringTag,{value:"Module"})),dt="routeData";class Nt{constructor(t,e){R(this,"settings");R(this,"routes");R(this,"steps",[]);R(this,"location");R(this,"history");R(this,"widget");R(this,"match");R(this,"currentRoute");R(this,"historyListenSubscription",()=>{});R(this,"initialized");R(this,"sticky",!1);R(this,"storageWriter",null);R(this,"storageMedium");this.container=t,this.widget=t.get("$widget");const{routes:n,...s}=e;this.settings={...s,...t.get("routingSettings")},this.sticky=r.determineIfSticky(this.settings),this.storageMedium=this.sticky?r.StorageMedium.Local:r.StorageMedium.Session,r.createStorageWriter(t,dt,r.StorageCategory.Necessary,{medium:this.storageMedium}).then(a=>this.storageWriter=a),this.routes=n}initialize(){return this.initialized=this.initialized||this.createHistory().then(t=>{this.history=t,this.location=t.location,this.historyListenSubscription=t.listen((e,n,s)=>this.handleLocationChange(e,s))})}setMatch(t){if(this.match=t,this.location){const e=this.getRouteData(),n={routeData:e,location:this.location},s=this.steps[0],a=e.name===(s==null?void 0:s.routeData.name),h=r.shallowCompare(e.params,(s==null?void 0:s.routeData.params)||{});(!a||!h)&&(this.widget.events.dispatch("router:change",{next:n,previous:s}),this.steps.unshift(n),this.storageWriter&&this.storageWriter(n.routeData),this.widget.events.dispatch("router:changed",{previous:s,current:n}))}}onRouteChange(t){return this.widget.events.subscribe("router:change",t)}isSticky(){return this.sticky}generate(t,e={}){const n=r.findRoute(t,this.routes);if(!n||!this.history)throw`No route found for ${t}`;const s=r.createParamsPath(e,n.path);if(!s)throw`Unable to generate path for "${t}".`;const a=r.createLocation(s,this.settings.decodeSearch);let h=this.history.createHref(a);const{mode:p,basePath:u}=this.settings;return p==="browser"&&u&&(h=h.replace(u,"")),h.charAt(0)!=="/"&&(h=`/${h}`),h}navigate(t,e={}){const n=r.findRoute(t,this.routes);if(!n||!this.history)return;const s=r.createParamsPath(e,n.path);if(!s)return;const a=this.getRouteData(),h=a&&a.name===t&&r.compareParams(a.params,e);if(this.steps[0]&&h)return;const{decodeSearch:u}=this.settings,l=u?u(s):s;this.widget.events.dispatch("router:navigate",{decodedPath:l}),l.charAt(0)!=="/"?this.history.push(`/${l}`):this.history.push(l)}hasBack(){if(this.steps.length>1)return!0;const t=this.getRouteData(this.settings.initialPath),e=this.getRouteData(),n=e.name===t.name,s=r.shallowCompare(e.params,t.params);return!n||!s}goBack(t=1){if(this.steps.length<2){const e=this.getRouteData(this.settings.initialPath);e&&e.name&&(this.navigate(e.name,e.params),this.steps=[])}else{const e=t>=this.steps.length?this.steps.length-1:t,{routeData:n}=this.steps[e];this.steps=[...this.steps.slice(e+1)],this.navigate(n.name,yt.createParams(n.params))}}goForward(){this.history&&this.history.goForward()}current(){return this.location}getInitialRoute(){const{name:t}=this.getRouteData(this.settings.initialPath),e=this.routes.find(n=>n.name===t);return e||(this.routes.length>0?this.routes[0]:(process.env.NODE_ENV!=="production"&&r.Logger.warn("Unable to get initial route as no routes are defined."),null))}getRouteData(t){const e=r.getNotFoundRoute(this.container);if(t){const n=r.matchRoute(t,this.routes);return n?{params:r.removeNullAndUndefinedValues(r.matchParams(t,n.path)),name:n.name}:e||{name:"",params:{}}}if(this.location){const{pathname:n,search:s}=this.location;if(this.currentRoute=this.currentRoute||r.matchRoute(n,this.routes),this.currentRoute){const{path:a,name:h}=this.currentRoute;this.match||(this.match={params:r.matchParams(n,a),isExact:!0,path:a,url:n});const p=r.removeNullAndUndefinedValues({...this.match.params,...s.length>0&&r.queryStringAsObject(s)});return{name:h,params:p}}}return e||{name:"",params:{}}}dispose(){return this.historyListenSubscription(),this.stop()}setupInitialRoute(){return r.readStorage(this.container,dt,this.storageMedium).then(t=>{if(!this.location||!this.history)return;const{initialPath:e,mode:n}=this.settings;switch((()=>{const a=r.onWidgetUrl(this.container);return n===r.HistoryMode.browser||a?r.InitializationMode.path:n===r.HistoryMode.memory&&t?r.InitializationMode.storage:r.InitializationMode.initialPath})()){case r.InitializationMode.initialPath:{const a=this.getRouteData(e);return a&&a.name?this.navigate(a.name,a.params):void 0}case r.InitializationMode.path:{const{pathname:a}=this.location;if(this.currentRoute=r.matchRoute(a,this.routes),this.currentRoute){const{path:p}=this.currentRoute;return this.setMatch({params:r.matchParams(a,p),isExact:!0,path:p,url:a})}const h=r.getNotFoundRoute(this.container);return h?this.setMatch({params:{},isExact:!0,path:h.name,url:a}):void 0}case r.InitializationMode.storage:{const{pathname:a}=this.location;this.currentRoute=r.matchRoute(a,this.routes);const{name:h="",params:p={}}=t||{},u=r.findRoute(h,this.routes);if(u){const l=r.createParamsPath(p,u.path);if(l)return this.history.push(l),this.location={...this.location,pathname:l},this.currentRoute=r.matchRoute(l,this.routes),this.setMatch({params:p,isExact:!0,path:u.path,url:l})}return}}})}start(){return this.setupInitialRoute()}stop(){return this.history&&(this.settings.mode===r.HistoryMode.scopedHash&&this.history.stop(),this.steps=[],this.storageWriter)?this.storageWriter():Promise.resolve()}handleLocationChange(t,e){const{pathname:n}=t,{mode:s}=this.settings;if(n.indexOf("?")>-1||n.indexOf(";")>-1||s===r.HistoryMode.scopedHash&&e!==this.widget.name)return;this.location=t,this.currentRoute=r.matchRoute(n,this.routes);const a=r.getNotFoundRoute(this.container);if(this.currentRoute){const{path:h}=this.currentRoute;this.setMatch({params:r.matchParams(n,h),isExact:!0,path:h,url:n})}else a&&this.setMatch({params:{},isExact:!0,path:a.name,url:n})}createHistory(){return new Promise(t=>{const{mode:e,basePath:n}=this.settings;if(e===r.HistoryMode.scopedHash){const s=this.widget.name,a=r.getTransitionManager(this.container);return Promise.resolve().then(()=>$t).then(h=>{const p=h.default({widgetName:s,transitionManager:a,hashType:"noslash"});return t(p)})}if(e===r.HistoryMode.memory)return t(Dt());if(e===r.HistoryMode.browser)return t(_t({basename:n}));throw"RoutingService: History could not be created."})}}exports.HistoryMode=r.HistoryMode;exports.getScopedHashDOMLocation=r.getScopedHashDOMLocation;exports.getSpecificWidgetPath=r.getSpecificWidgetPath;exports.matchParams=r.matchParams;exports.onWidgetUrl=r.onWidgetUrl;exports.RoutingService=Nt;exports.createHashHistory=pt;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
var p = Object.defineProperty;
|
|
2
|
+
var c = (o, e, t) => e in o ? p(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
+
var n = (o, e, t) => (c(o, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import { L as l } from "./index-4a7683d6.mjs";
|
|
5
|
+
import { A as x, C as E, n as M, o as q, q as D, W as L, m as S, s as V, t as W, x as O, u as P, v as Q, w as U } from "./index-4a7683d6.mjs";
|
|
6
|
+
import "react/jsx-runtime";
|
|
7
|
+
import "@emotion/styled";
|
|
8
|
+
import "@emotion/react";
|
|
9
|
+
import "react";
|
|
10
|
+
import "react-transition-group";
|
|
11
|
+
import "react-dom";
|
|
12
|
+
import "react-router-dom";
|
|
13
|
+
import "react-router";
|
|
14
|
+
class A {
|
|
15
|
+
constructor(e) {
|
|
16
|
+
n(this, "events");
|
|
17
|
+
const { events: t } = e.get("$widget");
|
|
18
|
+
this.events = t.createChild(this);
|
|
19
|
+
}
|
|
20
|
+
action(e, t, s) {
|
|
21
|
+
this.events.dispatch("data:action", { action: t, value: s, target: e }, { bubbles: !0 });
|
|
22
|
+
}
|
|
23
|
+
subscribe(e, t) {
|
|
24
|
+
return this.events.subscribe(
|
|
25
|
+
"data:action",
|
|
26
|
+
(s, { action: r, value: i, target: a }) => e === a && t(e, r, i)
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
class N {
|
|
31
|
+
constructor(e) {
|
|
32
|
+
n(this, "aliases", /* @__PURE__ */ new Map());
|
|
33
|
+
n(this, "components", /* @__PURE__ */ new Map());
|
|
34
|
+
n(this, "events");
|
|
35
|
+
n(this, "logger", new l());
|
|
36
|
+
const { events: t } = e.get("$widget");
|
|
37
|
+
this.events = t;
|
|
38
|
+
}
|
|
39
|
+
getComponent(e) {
|
|
40
|
+
const t = this.aliases.get(e), s = this.components.get(t || e) || null;
|
|
41
|
+
return process.env.NODE_ENV !== "production" && (s || this.logger.warn(
|
|
42
|
+
t || e,
|
|
43
|
+
`Unable to resolve component: "${t || e}". You most likely forgot to register the required plugin for: ${t || e}.`
|
|
44
|
+
)), s;
|
|
45
|
+
}
|
|
46
|
+
registerComponent(e, t) {
|
|
47
|
+
return this.components.set(e, t), this.events.dispatch("component-resolver:resolve", e), () => {
|
|
48
|
+
this.components.delete(e);
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
registerResolver(e, t) {
|
|
52
|
+
return this.events.subscribe("component-resolver:resolve", (s, r) => {
|
|
53
|
+
if (r === e) {
|
|
54
|
+
const i = this.getComponent(e);
|
|
55
|
+
t(i);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
registerAlias(e, t) {
|
|
60
|
+
return this.aliases.set(e, t), this.events.dispatch("component-resolver:resolve", e), () => {
|
|
61
|
+
this.aliases.delete(e);
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
A as ActionResolver,
|
|
67
|
+
x as ActionsController,
|
|
68
|
+
E as ComponentNode,
|
|
69
|
+
M as ComponentNodeController,
|
|
70
|
+
q as ComponentPlatform,
|
|
71
|
+
D as ComponentQuery,
|
|
72
|
+
N as ComponentResolver,
|
|
73
|
+
L as WidgetRenderState,
|
|
74
|
+
S as asDescriptor,
|
|
75
|
+
V as createChildren,
|
|
76
|
+
W as createComponentModel,
|
|
77
|
+
O as createEventSubscriber,
|
|
78
|
+
P as findComponent,
|
|
79
|
+
Q as findVisibleComponents,
|
|
80
|
+
U as traverseComponents
|
|
81
|
+
};
|