@lwrjs/router 0.22.1 → 0.22.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/build/bundle/prod/lwr/navigation/navigation.js +1 -1
- package/build/bundle/prod/lwr/routerContainer/routerContainer.js +1 -1
- package/build/cjs/services/index.cjs +4 -3
- package/build/es/modules/lwr/contextUtils/contextInfo.js +1 -5
- package/build/es/modules/lwr/contextUtils/contextUtils.js +1 -2
- package/build/es/modules/lwr/domRouter/domRouter.js +48 -55
- package/build/es/modules/lwr/historyRouter/historyRouter.js +5 -2
- package/build/es/modules/lwr/outlet/outlet.js +14 -8
- package/build/es/modules/lwr/router/router.js +2 -9
- package/build/es/modules/lwr/routerBridge/routerBridge.js +17 -20
- package/build/es/modules/lwr/routerContainer/routerContainer.js +5 -7
- package/build/es/modules/lwr/serverRouter/serverRouter.js +1 -7
- package/build/es/services/index.js +5 -3
- package/build/es/services/module-provider/index.js +2 -8
- package/build/modules/lwr/outlet/outlet.js +5 -0
- package/build/modules/lwr/routerContainer/routerContainer.js +2 -0
- package/package.json +9 -9
- package/pageObjects/outlet.cjs +1 -1
- package/pageObjects/outlet.d.cts +1 -1
- package/pageObjects/outlet.d.ts +1 -1
- package/pageObjects/outlet.js +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function e(e){if(null==e)throw new TypeError("Provider must be defined.")}class t{constructor(e){this.infoMap=new WeakMap,this.defaultValue=
|
|
1
|
+
function e(e){if(null==e)throw new TypeError("Provider must be defined.")}class t{constructor(e){this.infoMap=new WeakMap,this.defaultValue=e}getInfo(e){let t=this.infoMap.get(e);return void 0===t&&(t={consumers:new Set},this.infoMap.set(e,t)),t}setContext(t,n){e(t);const o=n,s=this.getInfo(t);s.contextValue=n,s.consumers.forEach((e=>e.provide(o))),0===s.consumers.size&&o?.onComplete&&o.onComplete()}getContext(t){e(t);const{contextValue:n}=this.getInfo(t);return void 0!==n?n:this.defaultValue}clearContext(t){e(t),this.infoMap.delete(t)}subscribeContext(t,n){e(t);const{consumers:o,contextValue:s}=this.getInfo(t);o.has(n)||(o.add(n),n.provide(s))}unsubscribeContext(t,n){e(t),this.getInfo(t).consumers.delete(n)}}const n="LWR",o=1;function s(e,t){return Array.isArray(t)?e.replace(/\{([0-9]+)\}/g,((e,n)=>t[n])):e}function a(e,t){return`${e.code}: ${s(e.message,t)}`}function i(e,t){const n={...e,message:s(e.message,t)};return e.address&&(n.address=s(e.address,t)),e.stack&&(n.stack=s(e.stack,t)),n}const r={INVALID_MIXIN_CMP:{code:`${n}4001`,message:"{0} must be an Element type",level:o},MISSING_CONTEXT:{code:`${n}4002`,message:"Could not find context to perform navigation action.",level:o},INVALID_CONTEXT:{code:`${n}4003`,message:"Cannot register navigation context; it must have this shape: { navigate, generateUrl, subscribe }",level:o},MULTIPLE_ROOTS:{code:`${n}4004`,message:"Router connection failed. There can only be one root router.",level:o},MULTIPLE_CHILDREN:{code:`${n}4005`,message:"Could not add to the navigation hierarchy. There can only be one child per navigation node.",level:o},MISSING_ROUTE:{code:`${n}4006`,message:'A route cannot be created to navigate to URL "{0}"',level:o,address:"{0}"},MISSING_URL:{code:`${n}4007`,message:'A URL cannot be created to navigate to route "{0}"',level:o,address:"{0}"},PRENAV_FAILED:{code:`${n}4008`,message:'A preNavigate hook listener blocked routing to "{0}"',level:2,address:"{0}"},MISSING_ROUTE_TEMPLATE:{code:`${n}4009`,message:'Route definition with id "{0}" is missing a "uri" property.',level:o,address:"{0}"},MISSING_ROUTE_CMP:{code:`${n}4016`,message:"Expected a route view component with a default export.",level:o},MISSING_DATA_CONTEXT:{code:`${n}4018`,message:"Could not find context to retrieve navigation data.",level:o},INVALID_ROUTE_QUERY:{code:`${n}4019`,message:"Invalid query param in route definition.",level:o},MISSING_PAGE_BINDING:{code:`${n}4020`,message:'Route definition with id "{0}" is missing a "page" binding.',level:o,address:"{0}"},INVALID_PAGE_BINDING:{code:`${n}4021`,message:'Route definition with id "{0}" has an invalid "page" binding.',level:o,address:"{0}"},INVALID_URI_SYNTAX:{code:`${n}4022`,message:'Route definition with id "{0}" has invalid "uri" syntax. URI cannot contain *, +, (, ), ',level:o,address:"{0}"},VIEW_IMPORT_FAILED:{code:`${n}4023`,message:'Error importing view with name "{0}", failure was: {1}',level:o,stack:"{2}"},VIEW_MISSING:{code:`${n}4024`,message:'Expected a view with name "{0}" in the viewset',level:o},VIEW_IMPORT_FAILED_WITH_SPECIFIER:{code:`${n}4025`,message:'Error importing module "{0}" from view with name "{1}", failure was: {2}',level:o,stack:"{3}"},NO_ROUTE_MATCH:{code:`${n}4026`,message:"A routing match cannot be found for: {0}",level:o},INVALID_ROUTE_HANDLER:{code:`${n}4027`,message:'Route definition "{0}" does not have a valid route handler module',level:o},DESTINATION_NOT_FOUND:{code:`${n}4028`,message:"Route handler returned 404: Not Found",level:o},DESTINATION_ERROR:{code:`${n}4029`,message:"Route handler returned error status {0}: {1}",level:o,stack:"{2}"},NO_INIT_URL:{code:`${n}4030`,message:'Cannot initialize a server router without a "url"',level:o}},c=new WeakMap;function l(e){const t=c.get(e);if(!t||!t.value)throw new Error(a(r.MISSING_CONTEXT));return t.value}function d(e,t){const n={id:e,value:t,update:e=>{n.value=e}};return c.set(n.id,n),n}function u(e){var t;return(t=class{constructor(e){this._callback=e}connect(){}disconnect(){}update(e,t){t&&this._callback(t)}static setContext(t,n){e.setContext(t,n)}static getContext(t){return e.getContext(t)}static clearContext(t){e.clearContext(t)}static subscribeContext(t,n){e.subscribeContext(t,n)}static unsubscribeContext(t,n){e.unsubscribeContext(t,n)}}).contextSchema={value:"required"},t}const I=u(new t(void 0)),v=u(new t(void 0)),g=new t(void 0),m=class extends(u(g)){async update(e,t){if(t){const n=e&&e.viewName?e.viewName:"default",o=t.viewset[n],s=o,a=s&&s.module||o;let c;if(a)try{const e=await a(),t=e&&e.default;if(!t||void 0===t.constructor)throw new Error("error occurred with view import");this._callback(t)}catch(e){const t=e;c=s.specifier?i(r.VIEW_IMPORT_FAILED_WITH_SPECIFIER,[s.specifier,n,t.message,t.stack||""]):i(r.VIEW_IMPORT_FAILED,[n,t.message,t.stack||""])}else c=i(r.VIEW_MISSING,[n]);t.onComplete&&t.onComplete(c)}}};function h(e,t,n,o){l(e).navigate(t,n,o)}function f(e,t,n){return l(e).generateUrl(t,n)}const E=`universalcontainergetnavigationcontext${Math.floor(65536*(1+Math.random())).toString(16).substring(1)}`,_=Symbol("Navigate"),N=Symbol("GenerateUrl"),p=Symbol("NavContext"),w=Symbol("NavContext"),C="undefined"==typeof window;function T(e){!function(e,t,n){if(!e)throw new Error(a(t,n))}("function"==typeof e.prototype.dispatchEvent,r.INVALID_MIXIN_CMP,[e.toString()]);return class extends e{[w](){if(!this[p]&&(this.dispatchEvent(new CustomEvent(E,{bubbles:!0,composed:!0,detail:{callback:e=>{this[p]=e}}})),!this[p]))throw new Error(a(r.MISSING_CONTEXT))}[_](e,t,n){C||(this[w](),h(this[p],e,t,n))}async[N](e,t){return C?null:(this[w](),function(e,t,n){return l(e).generateUrlAsync(t,n)}(this[p],e,t))}}}T.Navigate=_,T.GenerateUrl=N,T.NavContext=p;export{t as ContextInfo,v as CurrentPageReference,m as CurrentView,I as NavigationContext,T as NavigationMixin,u as generateContextualWireAdapter,f as generateUrl,l as getNavigationHelm,h as navigate,d as registerNavigationHelm};
|
|
2
2
|
//# sourceMappingURL=navigation.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{parseFragment as e,registerTemplate as t,freezeTemplate as i,createContextProvider as r,registerDecorators as s,registerComponent as n,LightningElement as o}from"lwc";import{ROUTER_VIEW as a,ROUTER_NAV as c,ROUTER_ERROR as d}from"lwr/metrics";import{logOperationEnd as h,logOperationStart as l}from"lwr/profiler";function u(e,t,i){return"span.router-title"+(e?"."+e:"")+" {position: absolute;margin: -1px;border: 0;padding: 0;width: 1px;height: 1px;overflow: hidden;clip: rect(0 0 0 0);text-transform: none;white-space: nowrap;}"}u.$scoped$=!0;var p=[u];const v=e`<span class="router-title${0}" aria-live="polite" aria-atomic="true"${2}></span>`,g={key:0},m=[],f={ref:"title"};function E(e,t,i,r){const{s:s,sp:n,st:o}=e;return[s("",g,m,i),o(v,2,[n(0,f,null)])]}var I=t(E);function b(e){if(null==e)throw new TypeError("Provider must be defined.")}E.slots=[""],E.renderMode="light",E.hasRefs=!0,E.stylesheets=[],E.stylesheetToken="lwc-7bis3qj4jjc",E.legacyStylesheetToken="lwr-routerContainer_routerContainer",p&&E.stylesheets.push.apply(E.stylesheets,p),i(E);class w{constructor(e){this.infoMap=new WeakMap,this.defaultValue=void 0,this.defaultValue=e}getInfo(e){let t=this.infoMap.get(e);return void 0===t&&(t={consumers:new Set},this.infoMap.set(e,t)),t}setContext(e,t){b(e);const i=t,r=this.getInfo(e);r.contextValue=t,r.consumers.forEach((e=>e.provide(i))),0===r.consumers.size&&i?.onComplete&&i.onComplete()}getContext(e){b(e);const{contextValue:t}=this.getInfo(e);return void 0!==t?t:this.defaultValue}clearContext(e){b(e),this.infoMap.delete(e)}subscribeContext(e,t){b(e);const{consumers:i,contextValue:r}=this.getInfo(e);i.has(t)||(i.add(t),t.provide(r))}unsubscribeContext(e,t){b(e),this.getInfo(e).consumers.delete(t)}}const N="LWR",_=1;function R(e,t){return Array.isArray(t)?e.replace(/\{([0-9]+)\}/g,((e,i)=>t[i])):e}function x(e,t){const i={...e,message:R(e.message,t)};return e.address&&(i.address=R(e.address,t)),e.stack&&(i.stack=R(e.stack,t)),i}function C(e,t,i){if(!e)throw new Error(function(e,t){return`${e.code}: ${R(e.message,t)}`}(t,i))}const T={INVALID_MIXIN_CMP:{code:`${N}4001`,message:"{0} must be an Element type",level:_},MISSING_CONTEXT:{code:`${N}4002`,message:"Could not find context to perform navigation action.",level:_},INVALID_CONTEXT:{code:`${N}4003`,message:"Cannot register navigation context; it must have this shape: { navigate, generateUrl, subscribe }",level:_},MULTIPLE_ROOTS:{code:`${N}4004`,message:"Router connection failed. There can only be one root router.",level:_},MULTIPLE_CHILDREN:{code:`${N}4005`,message:"Could not add to the navigation hierarchy. There can only be one child per navigation node.",level:_},MISSING_ROUTE:{code:`${N}4006`,message:'A route cannot be created to navigate to URL "{0}"',level:_,address:"{0}"},MISSING_URL:{code:`${N}4007`,message:'A URL cannot be created to navigate to route "{0}"',level:_,address:"{0}"},PRENAV_FAILED:{code:`${N}4008`,message:'A preNavigate hook listener blocked routing to "{0}"',level:2,address:"{0}"},MISSING_ROUTE_TEMPLATE:{code:`${N}4009`,message:'Route definition with id "{0}" is missing a "uri" property.',level:_,address:"{0}"},MISSING_ROUTE_CMP:{code:`${N}4016`,message:"Expected a route view component with a default export.",level:_},MISSING_DATA_CONTEXT:{code:`${N}4018`,message:"Could not find context to retrieve navigation data.",level:_},INVALID_ROUTE_QUERY:{code:`${N}4019`,message:"Invalid query param in route definition.",level:_},MISSING_PAGE_BINDING:{code:`${N}4020`,message:'Route definition with id "{0}" is missing a "page" binding.',level:_,address:"{0}"},INVALID_PAGE_BINDING:{code:`${N}4021`,message:'Route definition with id "{0}" has an invalid "page" binding.',level:_,address:"{0}"},INVALID_URI_SYNTAX:{code:`${N}4022`,message:'Route definition with id "{0}" has invalid "uri" syntax. URI cannot contain *, +, (, ), ',level:_,address:"{0}"},VIEW_IMPORT_FAILED:{code:`${N}4023`,message:'Error importing view with name "{0}", failure was: {1}',level:_,stack:"{2}"},VIEW_MISSING:{code:`${N}4024`,message:'Expected a view with name "{0}" in the viewset',level:_},VIEW_IMPORT_FAILED_WITH_SPECIFIER:{code:`${N}4025`,message:'Error importing module "{0}" from view with name "{1}", failure was: {2}',level:_,stack:"{3}"},NO_ROUTE_MATCH:{code:`${N}4026`,message:"A routing match cannot be found for: {0}",level:_},INVALID_ROUTE_HANDLER:{code:`${N}4027`,message:'Route definition "{0}" does not have a valid route handler module',level:_},DESTINATION_NOT_FOUND:{code:`${N}4028`,message:"Route handler returned 404: Not Found",level:_},DESTINATION_ERROR:{code:`${N}4029`,message:"Route handler returned error status {0}: {1}",level:_,stack:"{2}"},NO_INIT_URL:{code:`${N}4030`,message:'Cannot initialize a server router without a "url"',level:_}},y=new WeakMap;function P(e){var t;return(t=class{constructor(e){this._callback=void 0,this._callback=e}connect(){}disconnect(){}update(e,t){t&&this._callback(t)}static setContext(t,i){e.setContext(t,i)}static getContext(t){return e.getContext(t)}static clearContext(t){e.clearContext(t)}static subscribeContext(t,i){e.subscribeContext(t,i)}static unsubscribeContext(t,i){e.unsubscribeContext(t,i)}}).contextSchema={value:"required"},t}const U=P(new w(void 0)),$=P(new w(void 0)),A=new w(void 0),O=class extends(P(A)){async update(e,t){if(t){const i=e&&e.viewName?e.viewName:"default",r=t.viewset[i],s=r,n=s&&s.module||r;let o;if(n)try{const e=await n(),t=e&&e.default;if(!t||void 0===t.constructor)throw new Error("error occurred with view import");this._callback(t)}catch(e){const t=e;o=s.specifier?x(T.VIEW_IMPORT_FAILED_WITH_SPECIFIER,[s.specifier,i,t.message,t.stack||""]):x(T.VIEW_IMPORT_FAILED,[i,t.message,t.stack||""])}else o=x(T.VIEW_MISSING,[i]);t.onComplete&&t.onComplete(o)}}};function M(){const e=[],t=t=>{"function"==typeof t&&e.push(t)};return{add:(e=[])=>{Array.isArray(e)?e.forEach((e=>t(e))):t(e)},compile:t=>0===e.length?Promise.resolve(!0):e.reduce(((e,i)=>e.then((e=>!1===e?Promise.reject():Promise.resolve(i(t))))),Promise.resolve(!0)).then((e=>!1!==e)).catch((e=>{if(e instanceof Error)throw e;return!1})),empty:()=>0===e.length}}function S(e=""){return e=e||"",decodeURIComponent(e)}function L(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}const D="undefined"!=typeof document,k=`universalcontainergetnavigationcontext${L()}`,F=r($),V=D?r(O):void 0,G=r(U);function W(e,t,i,r){i&&r&&(r.setContext(t,e),i(t,{consumerConnectedCallback:r.subscribeContext.bind(r,t),consumerDisconnectedCallback:r.unsubscribeContext.bind(r,t)}))}function j(){let e,t,i=[];const r=r=>{i.filter((e=>null!==e)).forEach((e=>e.error&&e.error(r))),e=void 0,t=r};return{next:r=>{i.filter((e=>null!==e)).forEach((e=>e.next&&e.next(r))),e=r,t=void 0},error:r,complete:()=>{i.filter((e=>null!==e)).forEach((e=>e.complete&&e.complete())),i=[],e=void 0,t=void 0},subscribe:(s,n=!0)=>{(e=>{i.push(e)})(s),e&&n&&s.next(e),t&&r(t);const o=i.length-1;return{unsubscribe:()=>(e=>{i=[...i.slice(0,e),...i.slice(e+1)]})(o)}}}}const H=`universalcontainernavigationevent${L()}`,B=`universalcontainerparentevent${L()}`;class X{constructor(e,t,i){this.config=void 0,this.target=void 0,this.router=void 0,this.pendingRoute=null,this.committedRoute=null,this.routeObservable=void 0,this.eventId=void 0,this.contextId=Object.freeze((()=>{})),this.connected=!1,this.parent=void 0,this.child=void 0,this.preNavFilters=M(),this.errorNavFilters=M(),this._handleNavigationEvent=e=>{const t=e;if(t.detail&&"object"==typeof t.detail){const{url:e,replace:i,address:r}=t.detail;this.config.handleNavigation(r,i)?this.root&&!e?this.root.processError(x(T.MISSING_URL,[JSON.stringify(r)])):this.parent||this.process(e,i):t.stopPropagation()}},this._handleParentEvent=e=>{e.stopImmediatePropagation();const t=e;t&&t.detail&&"function"==typeof t.detail&&t.detail(this)},this.config={handleNavigation:e.handleNavigation||(()=>!0)},this.target=i||window,this.router=t,this.router.contextId=this.contextId,this.routeObservable=j()}get root(){if(!this.parent)return this;let e=this.parent;for(;e;){if(!e.parent)return e;e=e.parent}throw new Error("No root router could be found")}updateWires(e,t,i){if(i)this.processError(i);else{if(this.committedRoute&&e.route===this.committedRoute.route)return;h({id:a,specifier:this.eventId}),this.pendingRoute=this.pendingRoute||{...e,url:t},this.committedRoute={...this.pendingRoute,...e},$.setContext(this.target,e.route.pageReference),this.routeObservable.next({...this.committedRoute,viewset:e.viewset}),h({id:c,specifier:this.eventId}),this.child&&this.child.process(this._stripUrlForChild(this.committedRoute.url))}}connect(){this._sendEvent(B,(e=>{this.parent=e,e.addChild(this)}));const e={navigate:(e,t)=>this.navigate(e,t),generateUrl:(e,t)=>this.generateUrl(e,t),generateUrlAsync:(e,t)=>this.generateUrlAsync(e,t),subscribe:(e,t)=>this.subscribe(e,t)};!function(e,t){const i={id:e,value:t,update:e=>{i.value=e}};y.set(i.id,i)}(this.contextId,e),W(this.contextId,this.target,G,U),W(void 0,this.target,F,$),W(void 0,this.target,V,O),this.router.subscribe((e=>{if(404===e.status)return void this.processError(x(T.DESTINATION_NOT_FOUND));if(e.status&&e.status>=400){const t=e.error||new Error;return void this.processError(x(T.DESTINATION_ERROR,[e.status.toString(),t.message,t.stack||""]))}const t=e.route.pageReference||{},i=this.router.generateUrl(t)||"";if(l({id:a,specifier:this.eventId}),e.viewset){const t={viewset:e.viewset,onComplete:this.updateWires.bind(this,e,i)};O.setContext(this.target,t)}else e.route.pageReference&&this.updateWires(e,i)}),!0),D&&(this.target.addEventListener(H,this._handleNavigationEvent),this.target.addEventListener(B,this._handleParentEvent),this.target.addEventListener(k,(e=>{const t=e;t.detail.callback&&t.detail.callback(this.contextId)}))),this.connected=!0}disconnect(){this.target.removeEventListener(H,this._handleNavigationEvent),this.target.removeEventListener(B,this._handleParentEvent),this.parent&&(this.parent.child=void 0),this.parent=void 0,this.child&&(this.child.parent=void 0),this.child=void 0,this.connected=!1}addPreNavigate(e){this.preNavFilters.add(e)}addErrorNavigate(e){this.errorNavFilters.add(e)}async addChild(e){if(await new Promise((t=>{setTimeout((()=>{C(!this.child,T.MULTIPLE_CHILDREN),this.child=e,t()}),0)})),this.child&&this.committedRoute){const e=this._stripUrlForChild(this.committedRoute.url);await this.child.preProcess(e)&&this.child.process(e)}}async process(e,t,i,r){this.eventId=(new Date).getTime().toString(),l({id:c,specifier:this.eventId});try{this.parent||await this.preProcess(e,i)}catch(e){if(e.code)return this.processError(e),!1;throw e}const s=this.router.parseUrl(e);return s&&this.router.navigate(s,i),!0}preProcess(e,t){const i=this.router.parseUrl(e),r=i&&this.router.matchRoute(i,t);if(!r)return Promise.reject(x(T.MISSING_ROUTE,[e]));this.pendingRoute={url:e,...r};return(this.preNavFilters.empty()?Promise.resolve(!0):this.preNavFilters.compile({current:this.committedRoute||void 0,next:this.pendingRoute})).then((t=>t&&this.child?this.child.preProcess(this._stripUrlForChild(e)):t)).then((t=>t||Promise.reject(x(T.PRENAV_FAILED,[e]))))}processError(e){l({id:d}),this.errorNavFilters.compile(e),this.child&&this.child.processError(e)}navigate(e,t,i){const r=this.filterNavigateOptions(i);let s=this.router.generateUrl(e,r);if(s){s=(this.parent&&this.parent.committedRoute&&this.parent.committedRoute.pathMatch||"").concat(s)}this._sendEvent(H,{url:s,replace:t,address:e})}generateUrl(e,t){const i=this.filterNavigateOptions(t),r=this.router.generateUrl(e,i);if(!r)return null;return`${this.parent&&this.parent.committedRoute&&this.parent.committedRoute.pathMatch||""}${r}`}async generateUrlAsync(e,t){const i=this.filterNavigateOptions(t),r=await this.router.generateUrlAsync(e,i);if(!r)return null;return`${this.parent&&this.parent.committedRoute&&this.parent.committedRoute.pathMatch||""}${r}`}subscribe(e,t){return this.routeObservable.subscribe({next:e,error:()=>{},complete:()=>{}},Boolean(t))}_sendEvent(e,t){D&&this.target.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))}_stripUrlForChild(e){return this.pendingRoute&&0===e.indexOf(this.pendingRoute.pathMatch)?e.replace(this.pendingRoute.pathMatch,""):e}filterNavigateOptions(e){const t=!this.parent;return{...e,locale:t?e?.locale:void 0}}}function q(e){const t=function(e=""){if((e=e||"").indexOf("://")<0){const t=window.location.port?`:${window.location.port}`:"",i=`${window.location.protocol}//${window.location.hostname}${t}`,r="/"===e.charAt(0)?"":"/";e=i+r+e}const t={},i=document.createElement("a");i.href=e;const r=i.search.substring(1);return r&&r.split("&").forEach((e=>{const[i,r=""]=e.split("=");t[S(i)]=S(r)})),{href:i.href,origin:`${i.protocol}//${i.hostname}${i.port?`:${i.port}`:""}`,pathname:i.pathname.replace(/(\/)?/,"/"),searchParams:t}}(e),i=t.href.replace(/:\d+/,""),r=t.origin.replace(/:\d+/,"");return i.replace(r,"")}class z extends X{constructor(...e){super(...e),this.historyDisabled=!1,this.currentUrl=""}connect(){super.connect(),this.historyDisabled||(D&&window.addEventListener("popstate",this.onpopstate.bind(this)),this.onpopstate())}onpopstate(){if(!this.parent&&D){const e=q(window.location.href),t=this.router.basePath.includes("#")?e:function(e){const t=e.indexOf("#");return-1!==t?e.substring(0,t):e}(e);t!==this.currentUrl&&this.catchBrowserUpdate(t)}}disconnect(){super.disconnect(),D&&window.removeEventListener("popstate",this.onpopstate)}async process(e,t,i,r=!0){const s=await super.process(e,t,i,r);return s&&this.connected&&!this.parent&&(this.currentUrl=e,!this.historyDisabled&&r&&(t?function(e,t){const i=t||{};window.history.replaceState(i,"",e)}(e):function(e,t){const i=t||{};window.history.pushState(i,"",e)}(e))),s}catchBrowserUpdate(e){this.process(e,!1,{},!1)}}s(z,{fields:["historyDisabled","currentUrl"]});let Y=!1;class J extends o{constructor(){super(),this.router=void 0,this.historyDisabled=!1,this.currentTitle=D?document.title:""}connectedCallback(){const e={historyDisabled:this.historyDisabled,handleNavigation:this.handleNavigation.bind(this)};D&&this.router&&(this.routerApi=function(e,t={},i){const r=t.historyDisabled?new X(t,i,e):new z(t,i,e),s={addPreNavigate:e=>(r.addPreNavigate(e),s),addPostNavigate:e=>(r.subscribe(e),s),addErrorNavigate:e=>(r.addErrorNavigate(e),s),connect:()=>{r.connect(),C(!Y||!!r.parent,T.MULTIPLE_ROOTS),Y=Y||!r.parent,s.id=r.contextId},disconnect:()=>{Y=Y&&!!r.parent,r.disconnect()}};return s}(this,e,this.router),this.routerApi.addPreNavigate(this.preNavigate.bind(this)).addPostNavigate(this.postNavigate.bind(this)).addErrorNavigate(this.errorNavigate.bind(this)).connect())}preNavigate(e){const t=this._createEvent("prenavigate",e,!0);return this.dispatchEvent(t),!t.defaultPrevented}postNavigate(e){this.dispatchEvent(this._createEvent("postnavigate",e));const t=e.routeDefinition.metadata&&e.routeDefinition.metadata.title;t&&(this.currentTitle=t.replace(/[<>&"']/g,(e=>{switch(e){case"<":return"<";case">":return">";case"&":return"&";case'"':return""";case"'":return"'";default:return e}})),document.title=this.currentTitle);const i=this.refs?.title;i&&(i.innerHTML=this.currentTitle,setTimeout((()=>{i.innerHTML=""}),500))}errorNavigate(e){return this.dispatchEvent(this._createEvent("errornavigate",e)),!0}handleNavigation(e,t){const i=this._createEvent("handlenavigation",{address:e,replace:t},!0);return this.dispatchEvent(i),!i.defaultPrevented}disconnectedCallback(){this.routerApi&&this.routerApi.disconnect()}_createEvent(e,t,i){return new CustomEvent(e,{detail:t,bubbles:!1,composed:!1,cancelable:i})}}J.renderMode="light",s(J,{publicProps:{router:{config:0},historyDisabled:{config:0}}});const Q=n(J,{tmpl:I,sel:"lwr-router-container",apiVersion:66});export{Q as default};
|
|
1
|
+
import{parseFragment as e,registerTemplate as t,freezeTemplate as i,createContextProvider as r,registerDecorators as s,registerComponent as n,LightningElement as o}from"lwc";import{ROUTER_VIEW as a,ROUTER_NAV as c,ROUTER_ERROR as d}from"lwr/metrics";import{logOperationEnd as h,logOperationStart as l}from"lwr/profiler";function u(e,t,i){return"span.router-title"+(e?"."+e:"")+" {position: absolute;margin: -1px;border: 0;padding: 0;width: 1px;height: 1px;overflow: hidden;clip: rect(0 0 0 0);text-transform: none;white-space: nowrap;}"}u.$scoped$=!0;var p=[u];const v=e`<span class="router-title${0}" aria-live="polite" aria-atomic="true"${2}></span>`,g={key:0},m=[],f={ref:"title"};function E(e,t,i,r){const{s:s,sp:n,st:o}=e;return[s("",g,m,i),o(v,2,[n(0,f,null)])]}var I=t(E);function b(e){if(null==e)throw new TypeError("Provider must be defined.")}E.slots=[""],E.renderMode="light",E.hasRefs=!0,E.stylesheets=[],E.stylesheetToken="lwc-7bis3qj4jjc",E.legacyStylesheetToken="lwr-routerContainer_routerContainer",p&&E.stylesheets.push.apply(E.stylesheets,p),i(E);class w{constructor(e){this.infoMap=new WeakMap,this.defaultValue=e}getInfo(e){let t=this.infoMap.get(e);return void 0===t&&(t={consumers:new Set},this.infoMap.set(e,t)),t}setContext(e,t){b(e);const i=t,r=this.getInfo(e);r.contextValue=t,r.consumers.forEach((e=>e.provide(i))),0===r.consumers.size&&i?.onComplete&&i.onComplete()}getContext(e){b(e);const{contextValue:t}=this.getInfo(e);return void 0!==t?t:this.defaultValue}clearContext(e){b(e),this.infoMap.delete(e)}subscribeContext(e,t){b(e);const{consumers:i,contextValue:r}=this.getInfo(e);i.has(t)||(i.add(t),t.provide(r))}unsubscribeContext(e,t){b(e),this.getInfo(e).consumers.delete(t)}}const N="LWR",_=1;function R(e,t){return Array.isArray(t)?e.replace(/\{([0-9]+)\}/g,((e,i)=>t[i])):e}function x(e,t){const i={...e,message:R(e.message,t)};return e.address&&(i.address=R(e.address,t)),e.stack&&(i.stack=R(e.stack,t)),i}function C(e,t,i){if(!e)throw new Error(function(e,t){return`${e.code}: ${R(e.message,t)}`}(t,i))}const T={INVALID_MIXIN_CMP:{code:`${N}4001`,message:"{0} must be an Element type",level:_},MISSING_CONTEXT:{code:`${N}4002`,message:"Could not find context to perform navigation action.",level:_},INVALID_CONTEXT:{code:`${N}4003`,message:"Cannot register navigation context; it must have this shape: { navigate, generateUrl, subscribe }",level:_},MULTIPLE_ROOTS:{code:`${N}4004`,message:"Router connection failed. There can only be one root router.",level:_},MULTIPLE_CHILDREN:{code:`${N}4005`,message:"Could not add to the navigation hierarchy. There can only be one child per navigation node.",level:_},MISSING_ROUTE:{code:`${N}4006`,message:'A route cannot be created to navigate to URL "{0}"',level:_,address:"{0}"},MISSING_URL:{code:`${N}4007`,message:'A URL cannot be created to navigate to route "{0}"',level:_,address:"{0}"},PRENAV_FAILED:{code:`${N}4008`,message:'A preNavigate hook listener blocked routing to "{0}"',level:2,address:"{0}"},MISSING_ROUTE_TEMPLATE:{code:`${N}4009`,message:'Route definition with id "{0}" is missing a "uri" property.',level:_,address:"{0}"},MISSING_ROUTE_CMP:{code:`${N}4016`,message:"Expected a route view component with a default export.",level:_},MISSING_DATA_CONTEXT:{code:`${N}4018`,message:"Could not find context to retrieve navigation data.",level:_},INVALID_ROUTE_QUERY:{code:`${N}4019`,message:"Invalid query param in route definition.",level:_},MISSING_PAGE_BINDING:{code:`${N}4020`,message:'Route definition with id "{0}" is missing a "page" binding.',level:_,address:"{0}"},INVALID_PAGE_BINDING:{code:`${N}4021`,message:'Route definition with id "{0}" has an invalid "page" binding.',level:_,address:"{0}"},INVALID_URI_SYNTAX:{code:`${N}4022`,message:'Route definition with id "{0}" has invalid "uri" syntax. URI cannot contain *, +, (, ), ',level:_,address:"{0}"},VIEW_IMPORT_FAILED:{code:`${N}4023`,message:'Error importing view with name "{0}", failure was: {1}',level:_,stack:"{2}"},VIEW_MISSING:{code:`${N}4024`,message:'Expected a view with name "{0}" in the viewset',level:_},VIEW_IMPORT_FAILED_WITH_SPECIFIER:{code:`${N}4025`,message:'Error importing module "{0}" from view with name "{1}", failure was: {2}',level:_,stack:"{3}"},NO_ROUTE_MATCH:{code:`${N}4026`,message:"A routing match cannot be found for: {0}",level:_},INVALID_ROUTE_HANDLER:{code:`${N}4027`,message:'Route definition "{0}" does not have a valid route handler module',level:_},DESTINATION_NOT_FOUND:{code:`${N}4028`,message:"Route handler returned 404: Not Found",level:_},DESTINATION_ERROR:{code:`${N}4029`,message:"Route handler returned error status {0}: {1}",level:_,stack:"{2}"},NO_INIT_URL:{code:`${N}4030`,message:'Cannot initialize a server router without a "url"',level:_}},y=new WeakMap;function P(e){var t;return(t=class{constructor(e){this._callback=e}connect(){}disconnect(){}update(e,t){t&&this._callback(t)}static setContext(t,i){e.setContext(t,i)}static getContext(t){return e.getContext(t)}static clearContext(t){e.clearContext(t)}static subscribeContext(t,i){e.subscribeContext(t,i)}static unsubscribeContext(t,i){e.unsubscribeContext(t,i)}}).contextSchema={value:"required"},t}const U=P(new w(void 0)),$=P(new w(void 0)),A=new w(void 0),O=class extends(P(A)){async update(e,t){if(t){const i=e&&e.viewName?e.viewName:"default",r=t.viewset[i],s=r,n=s&&s.module||r;let o;if(n)try{const e=await n(),t=e&&e.default;if(!t||void 0===t.constructor)throw new Error("error occurred with view import");this._callback(t)}catch(e){const t=e;o=s.specifier?x(T.VIEW_IMPORT_FAILED_WITH_SPECIFIER,[s.specifier,i,t.message,t.stack||""]):x(T.VIEW_IMPORT_FAILED,[i,t.message,t.stack||""])}else o=x(T.VIEW_MISSING,[i]);t.onComplete&&t.onComplete(o)}}};function M(){const e=[],t=t=>{"function"==typeof t&&e.push(t)};return{add:(e=[])=>{Array.isArray(e)?e.forEach((e=>t(e))):t(e)},compile:t=>0===e.length?Promise.resolve(!0):e.reduce(((e,i)=>e.then((e=>!1===e?Promise.reject():Promise.resolve(i(t))))),Promise.resolve(!0)).then((e=>!1!==e)).catch((e=>{if(e instanceof Error)throw e;return!1})),empty:()=>0===e.length}}function S(e=""){return e=e||"",decodeURIComponent(e)}function L(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}const D="undefined"!=typeof document,k=`universalcontainergetnavigationcontext${L()}`,F=r($),V=D?r(O):void 0,G=r(U);function W(e,t,i,r){i&&r&&(r.setContext(t,e),i(t,{consumerConnectedCallback:r.subscribeContext.bind(r,t),consumerDisconnectedCallback:r.unsubscribeContext.bind(r,t)}))}function j(){let e,t,i=[];const r=r=>{i.filter((e=>null!==e)).forEach((e=>e.error&&e.error(r))),e=void 0,t=r};return{next:r=>{i.filter((e=>null!==e)).forEach((e=>e.next&&e.next(r))),e=r,t=void 0},error:r,complete:()=>{i.filter((e=>null!==e)).forEach((e=>e.complete&&e.complete())),i=[],e=void 0,t=void 0},subscribe:(s,n=!0)=>{(e=>{i.push(e)})(s),e&&n&&s.next(e),t&&r(t);const o=i.length-1;return{unsubscribe:()=>(e=>{i=[...i.slice(0,e),...i.slice(e+1)]})(o)}}}}const H=`universalcontainernavigationevent${L()}`,B=`universalcontainerparentevent${L()}`;class X{constructor(e,t,i){this.pendingRoute=null,this.committedRoute=null,this.contextId=Object.freeze((()=>{})),this.connected=!1,this.preNavFilters=M(),this.errorNavFilters=M(),this._handleNavigationEvent=e=>{const t=e;if(t.detail&&"object"==typeof t.detail){const{url:e,replace:i,address:r}=t.detail;this.config.handleNavigation(r,i)?this.root&&!e?this.root.processError(x(T.MISSING_URL,[JSON.stringify(r)])):this.parent||this.process(e,i):t.stopPropagation()}},this._handleParentEvent=e=>{e.stopImmediatePropagation();const t=e;t&&t.detail&&"function"==typeof t.detail&&t.detail(this)},this.config={handleNavigation:e.handleNavigation||(()=>!0)},this.target=i||window,this.router=t,this.router.contextId=this.contextId,this.routeObservable=j()}get root(){if(!this.parent)return this;let e=this.parent;for(;e;){if(!e.parent)return e;e=e.parent}throw new Error("No root router could be found")}updateWires(e,t,i){if(i)this.processError(i);else{if(this.committedRoute&&e.route===this.committedRoute.route)return;h({id:a,specifier:this.eventId}),this.pendingRoute=this.pendingRoute||{...e,url:t},this.committedRoute={...this.pendingRoute,...e},$.setContext(this.target,e.route.pageReference),this.routeObservable.next({...this.committedRoute,viewset:e.viewset}),h({id:c,specifier:this.eventId}),this.child&&this.child.process(this._stripUrlForChild(this.committedRoute.url))}}connect(){this._sendEvent(B,(e=>{this.parent=e,e.addChild(this)}));const e={navigate:(e,t)=>this.navigate(e,t),generateUrl:(e,t)=>this.generateUrl(e,t),generateUrlAsync:(e,t)=>this.generateUrlAsync(e,t),subscribe:(e,t)=>this.subscribe(e,t)};!function(e,t){const i={id:e,value:t,update:e=>{i.value=e}};y.set(i.id,i)}(this.contextId,e),W(this.contextId,this.target,G,U),W(void 0,this.target,F,$),W(void 0,this.target,V,O),this.router.subscribe((e=>{if(404===e.status)return void this.processError(x(T.DESTINATION_NOT_FOUND));if(e.status&&e.status>=400){const t=e.error||new Error;return void this.processError(x(T.DESTINATION_ERROR,[e.status.toString(),t.message,t.stack||""]))}const t=e.route.pageReference||{},i=this.router.generateUrl(t)||"";if(l({id:a,specifier:this.eventId}),e.viewset){const t={viewset:e.viewset,onComplete:this.updateWires.bind(this,e,i)};O.setContext(this.target,t)}else e.route.pageReference&&this.updateWires(e,i)}),!0),D&&(this.target.addEventListener(H,this._handleNavigationEvent),this.target.addEventListener(B,this._handleParentEvent),this.target.addEventListener(k,(e=>{const t=e;t.detail.callback&&t.detail.callback(this.contextId)}))),this.connected=!0}disconnect(){this.target.removeEventListener(H,this._handleNavigationEvent),this.target.removeEventListener(B,this._handleParentEvent),this.parent&&(this.parent.child=void 0),this.parent=void 0,this.child&&(this.child.parent=void 0),this.child=void 0,this.connected=!1}addPreNavigate(e){this.preNavFilters.add(e)}addErrorNavigate(e){this.errorNavFilters.add(e)}async addChild(e){if(await new Promise((t=>{setTimeout((()=>{C(!this.child,T.MULTIPLE_CHILDREN),this.child=e,t()}),0)})),this.child&&this.committedRoute){const e=this._stripUrlForChild(this.committedRoute.url);await this.child.preProcess(e)&&this.child.process(e)}}async process(e,t,i,r){this.eventId=(new Date).getTime().toString(),l({id:c,specifier:this.eventId});try{this.parent||await this.preProcess(e,i)}catch(e){if(e.code)return this.processError(e),!1;throw e}const s=this.router.parseUrl(e);return s&&this.router.navigate(s,i),!0}preProcess(e,t){const i=this.router.parseUrl(e),r=i&&this.router.matchRoute(i,t);if(!r)return Promise.reject(x(T.MISSING_ROUTE,[e]));this.pendingRoute={url:e,...r};return(this.preNavFilters.empty()?Promise.resolve(!0):this.preNavFilters.compile({current:this.committedRoute||void 0,next:this.pendingRoute})).then((t=>t&&this.child?this.child.preProcess(this._stripUrlForChild(e)):t)).then((t=>t||Promise.reject(x(T.PRENAV_FAILED,[e]))))}processError(e){l({id:d}),this.errorNavFilters.compile(e),this.child&&this.child.processError(e)}navigate(e,t,i){const r=this.filterNavigateOptions(i);let s=this.router.generateUrl(e,r);if(s){s=(this.parent&&this.parent.committedRoute&&this.parent.committedRoute.pathMatch||"").concat(s)}this._sendEvent(H,{url:s,replace:t,address:e})}generateUrl(e,t){const i=this.filterNavigateOptions(t),r=this.router.generateUrl(e,i);if(!r)return null;return`${this.parent&&this.parent.committedRoute&&this.parent.committedRoute.pathMatch||""}${r}`}async generateUrlAsync(e,t){const i=this.filterNavigateOptions(t),r=await this.router.generateUrlAsync(e,i);if(!r)return null;return`${this.parent&&this.parent.committedRoute&&this.parent.committedRoute.pathMatch||""}${r}`}subscribe(e,t){return this.routeObservable.subscribe({next:e,error:()=>{},complete:()=>{}},Boolean(t))}_sendEvent(e,t){D&&this.target.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))}_stripUrlForChild(e){return this.pendingRoute&&0===e.indexOf(this.pendingRoute.pathMatch)?e.replace(this.pendingRoute.pathMatch,""):e}filterNavigateOptions(e){const t=!this.parent;return{...e,locale:t?e?.locale:void 0}}}function q(e){const t=function(e=""){if((e=e||"").indexOf("://")<0){const t=window.location.port?`:${window.location.port}`:"",i=`${window.location.protocol}//${window.location.hostname}${t}`,r="/"===e.charAt(0)?"":"/";e=i+r+e}const t={},i=document.createElement("a");i.href=e;const r=i.search.substring(1);return r&&r.split("&").forEach((e=>{const[i,r=""]=e.split("=");t[S(i)]=S(r)})),{href:i.href,origin:`${i.protocol}//${i.hostname}${i.port?`:${i.port}`:""}`,pathname:i.pathname.replace(/(\/)?/,"/"),searchParams:t}}(e),i=t.href.replace(/:\d+/,""),r=t.origin.replace(/:\d+/,"");return i.replace(r,"")}class z extends X{constructor(...e){super(...e),this.historyDisabled=!1,this.currentUrl=""}connect(){super.connect(),this.historyDisabled||(D&&window.addEventListener("popstate",this.onpopstate.bind(this)),this.onpopstate())}onpopstate(){if(!this.parent&&D){const e=q(window.location.href),t=this.router.basePath.includes("#")?e:function(e){const t=e.indexOf("#");return-1!==t?e.substring(0,t):e}(e);t!==this.currentUrl&&this.catchBrowserUpdate(t)}}disconnect(){super.disconnect(),D&&window.removeEventListener("popstate",this.onpopstate)}async process(e,t,i,r=!0){const s=await super.process(e,t,i,r);return s&&this.connected&&!this.parent&&(this.currentUrl=e,!this.historyDisabled&&r&&(t?function(e,t){const i=t||{};window.history.replaceState(i,"",e)}(e):function(e,t){const i=t||{};window.history.pushState(i,"",e)}(e))),s}catchBrowserUpdate(e){this.process(e,!1,{},!1)}}s(z,{fields:["historyDisabled","currentUrl"]});let Y=!1;class J extends o{constructor(){super(),this.router=void 0,this.historyDisabled=!1,this.currentTitle=D?document.title:""}connectedCallback(){const e={historyDisabled:this.historyDisabled,handleNavigation:this.handleNavigation.bind(this)};D&&this.router&&(this.routerApi=function(e,t={},i){const r=t.historyDisabled?new X(t,i,e):new z(t,i,e),s={addPreNavigate:e=>(r.addPreNavigate(e),s),addPostNavigate:e=>(r.subscribe(e),s),addErrorNavigate:e=>(r.addErrorNavigate(e),s),connect:()=>{r.connect(),C(!Y||!!r.parent,T.MULTIPLE_ROOTS),Y=Y||!r.parent,s.id=r.contextId},disconnect:()=>{Y=Y&&!!r.parent,r.disconnect()}};return s}(this,e,this.router),this.routerApi.addPreNavigate(this.preNavigate.bind(this)).addPostNavigate(this.postNavigate.bind(this)).addErrorNavigate(this.errorNavigate.bind(this)).connect())}preNavigate(e){const t=this._createEvent("prenavigate",e,!0);return this.dispatchEvent(t),!t.defaultPrevented}postNavigate(e){this.dispatchEvent(this._createEvent("postnavigate",e));const t=e.routeDefinition.metadata&&e.routeDefinition.metadata.title;t&&(this.currentTitle=t.replace(/[<>&"']/g,(e=>{switch(e){case"<":return"<";case">":return">";case"&":return"&";case'"':return""";case"'":return"'";default:return e}})),document.title=this.currentTitle);const i=this.refs?.title;i&&(i.innerHTML=this.currentTitle,setTimeout((()=>{i.innerHTML=""}),500))}errorNavigate(e){return this.dispatchEvent(this._createEvent("errornavigate",e)),!0}handleNavigation(e,t){const i=this._createEvent("handlenavigation",{address:e,replace:t},!0);return this.dispatchEvent(i),!i.defaultPrevented}disconnectedCallback(){this.routerApi&&this.routerApi.disconnect()}_createEvent(e,t,i){return new CustomEvent(e,{detail:t,bubbles:!1,composed:!1,cancelable:i})}}J.renderMode="light",s(J,{publicProps:{router:{config:0},historyDisabled:{config:0}}});const Q=n(J,{tmpl:I,sel:"lwr-router-container",apiVersion:66});export{Q as default};
|
|
2
2
|
//# sourceMappingURL=routerContainer.js.map
|
|
@@ -107,7 +107,8 @@ function getClientRoutes(path) {
|
|
|
107
107
|
if (!validate(json)) {
|
|
108
108
|
throw new Error(ajv.errorsText(validate.errors, {separator: "\n"}));
|
|
109
109
|
}
|
|
110
|
-
const
|
|
110
|
+
const config = json;
|
|
111
|
+
const routes = config.routes;
|
|
111
112
|
routes.forEach((route, index) => {
|
|
112
113
|
const {id, handler, component} = route;
|
|
113
114
|
if (routes.findIndex((r) => r.id === id) !== index) {
|
|
@@ -120,8 +121,8 @@ function getClientRoutes(path) {
|
|
|
120
121
|
throw new Error('A route definition must contain either "handler" or "component"');
|
|
121
122
|
}
|
|
122
123
|
});
|
|
123
|
-
routerConfigJsonCache.set(path,
|
|
124
|
-
return
|
|
124
|
+
routerConfigJsonCache.set(path, config);
|
|
125
|
+
return config;
|
|
125
126
|
} catch (e) {
|
|
126
127
|
throw new import_diagnostics.LwrUnresolvableError(import_diagnostics.descriptions.UNRESOLVABLE.ROUTES_MODULE(path, e.message), "module");
|
|
127
128
|
}
|
|
@@ -7,12 +7,8 @@ function validateProvider(obj) {
|
|
|
7
7
|
* Manages context for various providers
|
|
8
8
|
*/
|
|
9
9
|
export class ContextInfo {
|
|
10
|
-
infoMap = new WeakMap();
|
|
11
|
-
/**
|
|
12
|
-
* The default value to be returned in the absence of a defined context
|
|
13
|
-
*/
|
|
14
|
-
defaultValue;
|
|
15
10
|
constructor(defaultValue) {
|
|
11
|
+
this.infoMap = new WeakMap();
|
|
16
12
|
this.defaultValue = defaultValue;
|
|
17
13
|
}
|
|
18
14
|
/**
|
|
@@ -12,7 +12,6 @@ export function generateContextualWireAdapter(contextInstance) {
|
|
|
12
12
|
disconnect() {
|
|
13
13
|
// no-op
|
|
14
14
|
}
|
|
15
|
-
_callback;
|
|
16
15
|
// The default update method services wires that emit context as TEmit when their value changes.
|
|
17
16
|
// Wires that need more complex logic or use another emit type should override this method.
|
|
18
17
|
update(config, context) {
|
|
@@ -69,7 +68,7 @@ export function generateContextualWireAdapter(contextInstance) {
|
|
|
69
68
|
static unsubscribeContext(targetProvider, consumer) {
|
|
70
69
|
contextInstance.unsubscribeContext(targetProvider, consumer);
|
|
71
70
|
}
|
|
72
|
-
static contextSchema = { value: 'required' };
|
|
71
|
+
static { this.contextSchema = { value: 'required' }; }
|
|
73
72
|
};
|
|
74
73
|
return Adapter;
|
|
75
74
|
}
|
|
@@ -18,19 +18,6 @@ export const NAV_EVENT = `universalcontainernavigationevent${guid()}`;
|
|
|
18
18
|
// Event fired to find nearest parent
|
|
19
19
|
export const PARENT_EVENT = `universalcontainerparentevent${guid()}`;
|
|
20
20
|
export class DomRouterImpl {
|
|
21
|
-
config;
|
|
22
|
-
target;
|
|
23
|
-
router;
|
|
24
|
-
pendingRoute = null;
|
|
25
|
-
committedRoute = null;
|
|
26
|
-
routeObservable;
|
|
27
|
-
eventId; // used for instrumentation
|
|
28
|
-
contextId = Object.freeze(() => undefined);
|
|
29
|
-
connected = false;
|
|
30
|
-
parent;
|
|
31
|
-
child;
|
|
32
|
-
preNavFilters = createFilterChain();
|
|
33
|
-
errorNavFilters = createFilterChain();
|
|
34
21
|
/**
|
|
35
22
|
* Create and configure the Router.
|
|
36
23
|
*
|
|
@@ -39,6 +26,54 @@ export class DomRouterImpl {
|
|
|
39
26
|
* @param {HTMLElement} target - DOM node to attach to
|
|
40
27
|
*/
|
|
41
28
|
constructor(config, router, target) {
|
|
29
|
+
this.pendingRoute = null;
|
|
30
|
+
this.committedRoute = null;
|
|
31
|
+
this.contextId = Object.freeze(() => undefined);
|
|
32
|
+
this.connected = false;
|
|
33
|
+
this.preNavFilters = createFilterChain();
|
|
34
|
+
this.errorNavFilters = createFilterChain();
|
|
35
|
+
/**
|
|
36
|
+
* Inspect a navigation event bubbling up from a descendent component.
|
|
37
|
+
* This node can choose to stop the event by returning false.
|
|
38
|
+
* If propagation is not stopped, and this node is the root (no parent),
|
|
39
|
+
* then begin the root -> leaf processing of this new route.
|
|
40
|
+
* This will update the navigation event subscribers in each DomRouter, top down.
|
|
41
|
+
*
|
|
42
|
+
* @param {Event} event - With detail: { url, options }
|
|
43
|
+
*/
|
|
44
|
+
this._handleNavigationEvent = (event) => {
|
|
45
|
+
const navigationEvent = event;
|
|
46
|
+
if (navigationEvent.detail && typeof navigationEvent.detail === 'object') {
|
|
47
|
+
const { url, replace, address } = navigationEvent.detail;
|
|
48
|
+
const continueNavigation = this.config.handleNavigation(address, replace);
|
|
49
|
+
if (!continueNavigation) {
|
|
50
|
+
navigationEvent.stopPropagation();
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
if (this.root && !url) {
|
|
54
|
+
// handle navigation can avoid the error message if it indicates navigation
|
|
55
|
+
// shouldn't continue, even if url is missing
|
|
56
|
+
this.root.processError(generateMessageObject(messages.MISSING_URL, [JSON.stringify(address)]));
|
|
57
|
+
}
|
|
58
|
+
else if (!this.parent) {
|
|
59
|
+
this.process(url, replace);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Be discovered as a parent for descendent components.
|
|
66
|
+
* Stop immediate propagation because we only want 1 parent to be found.
|
|
67
|
+
*
|
|
68
|
+
* @param {Event} event - With detail: callback
|
|
69
|
+
*/
|
|
70
|
+
this._handleParentEvent = (event) => {
|
|
71
|
+
event.stopImmediatePropagation();
|
|
72
|
+
const parentRouterEvent = event;
|
|
73
|
+
if (parentRouterEvent && parentRouterEvent.detail && typeof parentRouterEvent.detail === 'function') {
|
|
74
|
+
parentRouterEvent.detail(this);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
42
77
|
this.config = {
|
|
43
78
|
handleNavigation: config.handleNavigation || (() => true),
|
|
44
79
|
};
|
|
@@ -393,48 +428,6 @@ export class DomRouterImpl {
|
|
|
393
428
|
},
|
|
394
429
|
}, Boolean(replay));
|
|
395
430
|
}
|
|
396
|
-
/**
|
|
397
|
-
* Inspect a navigation event bubbling up from a descendent component.
|
|
398
|
-
* This node can choose to stop the event by returning false.
|
|
399
|
-
* If propagation is not stopped, and this node is the root (no parent),
|
|
400
|
-
* then begin the root -> leaf processing of this new route.
|
|
401
|
-
* This will update the navigation event subscribers in each DomRouter, top down.
|
|
402
|
-
*
|
|
403
|
-
* @param {Event} event - With detail: { url, options }
|
|
404
|
-
*/
|
|
405
|
-
_handleNavigationEvent = (event) => {
|
|
406
|
-
const navigationEvent = event;
|
|
407
|
-
if (navigationEvent.detail && typeof navigationEvent.detail === 'object') {
|
|
408
|
-
const { url, replace, address } = navigationEvent.detail;
|
|
409
|
-
const continueNavigation = this.config.handleNavigation(address, replace);
|
|
410
|
-
if (!continueNavigation) {
|
|
411
|
-
navigationEvent.stopPropagation();
|
|
412
|
-
}
|
|
413
|
-
else {
|
|
414
|
-
if (this.root && !url) {
|
|
415
|
-
// handle navigation can avoid the error message if it indicates navigation
|
|
416
|
-
// shouldn't continue, even if url is missing
|
|
417
|
-
this.root.processError(generateMessageObject(messages.MISSING_URL, [JSON.stringify(address)]));
|
|
418
|
-
}
|
|
419
|
-
else if (!this.parent) {
|
|
420
|
-
this.process(url, replace);
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
};
|
|
425
|
-
/**
|
|
426
|
-
* Be discovered as a parent for descendent components.
|
|
427
|
-
* Stop immediate propagation because we only want 1 parent to be found.
|
|
428
|
-
*
|
|
429
|
-
* @param {Event} event - With detail: callback
|
|
430
|
-
*/
|
|
431
|
-
_handleParentEvent = (event) => {
|
|
432
|
-
event.stopImmediatePropagation();
|
|
433
|
-
const parentRouterEvent = event;
|
|
434
|
-
if (parentRouterEvent && parentRouterEvent.detail && typeof parentRouterEvent.detail === 'function') {
|
|
435
|
-
parentRouterEvent.detail(this);
|
|
436
|
-
}
|
|
437
|
-
};
|
|
438
431
|
_sendEvent(name, payload) {
|
|
439
432
|
hasDocument &&
|
|
440
433
|
this.target.dispatchEvent(new CustomEvent(name, {
|
|
@@ -11,8 +11,11 @@ import { hasDocument } from 'lwr/routerUtils';
|
|
|
11
11
|
* Provides a Router rooted to the window, which controls the browser history by default.
|
|
12
12
|
*/
|
|
13
13
|
export class HistoryRouter extends DomRouterImpl {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.historyDisabled = false;
|
|
17
|
+
this.currentUrl = '';
|
|
18
|
+
}
|
|
16
19
|
/**
|
|
17
20
|
* Override.
|
|
18
21
|
* Initialize with the current route and listen to the popstate event for future changes.
|
|
@@ -6,15 +6,20 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { LightningElement, api, wire } from 'lwc';
|
|
8
8
|
import { CurrentView } from 'lwr/navigation';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
class Outlet extends LightningElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
// @ts-expect-error - LWC @api uses legacy decorator format; types expect new TC39 format (TS 5.0+)
|
|
13
|
+
this.refocusOff = false;
|
|
14
|
+
// @ts-expect-error - LWC @api decorator compatibility with experimentalDecorators
|
|
15
|
+
this.viewName = 'default';
|
|
16
|
+
this.viewCtor = undefined;
|
|
17
|
+
this.previousViewCtor = undefined;
|
|
18
|
+
this.hasError = false;
|
|
19
|
+
}
|
|
20
|
+
static { this.renderMode = 'light'; }
|
|
17
21
|
// Get a reference to the current view
|
|
22
|
+
// @ts-expect-error - LWC @wire decorator compatibility with experimentalDecorators
|
|
18
23
|
setView(currentView) {
|
|
19
24
|
this.hasError = false;
|
|
20
25
|
this.viewCtor = currentView;
|
|
@@ -64,4 +69,5 @@ __decorate([
|
|
|
64
69
|
__decorate([
|
|
65
70
|
wire(CurrentView, { viewName: '$viewName' })
|
|
66
71
|
], Outlet.prototype, "setView", null);
|
|
72
|
+
export default Outlet;
|
|
67
73
|
//# sourceMappingURL=outlet.js.map
|
|
@@ -8,21 +8,14 @@ import { freeze, getUrlFromPageReference, getPageReferenceFromUrl, matchRouteByU
|
|
|
8
8
|
import { generateMessage, messages } from 'lwr/routerErrors';
|
|
9
9
|
import { createObservable } from 'lwr/observable';
|
|
10
10
|
class RouterImpl {
|
|
11
|
-
config;
|
|
12
|
-
basePath;
|
|
13
|
-
deprecatedConfig = {};
|
|
14
|
-
compiledRoutes;
|
|
15
|
-
// The in-flight route state to be committed once the view mapping is handled
|
|
16
|
-
pendingRoute;
|
|
17
|
-
routeObservable;
|
|
18
|
-
routeHandler;
|
|
19
|
-
routeHandlerId = 0;
|
|
20
11
|
/**
|
|
21
12
|
* Create and configure the Router.
|
|
22
13
|
*
|
|
23
14
|
* @param {object} config - The router config object, all properties are optional
|
|
24
15
|
*/
|
|
25
16
|
constructor(config) {
|
|
17
|
+
this.deprecatedConfig = {};
|
|
18
|
+
this.routeHandlerId = 0;
|
|
26
19
|
this.compiledRoutes = [];
|
|
27
20
|
this.routeObservable = createObservable();
|
|
28
21
|
this.basePath = config.basePath || '';
|
|
@@ -2,10 +2,24 @@ import { PARENT_EVENT } from 'lwr/domRouter';
|
|
|
2
2
|
// Bridge navigation events, without access to a <lwr-router-container> or NavigationContext
|
|
3
3
|
// Used to allow a bridge between a LWR Router and vanilla HTML/JS (eg: in LWR Everywhere)
|
|
4
4
|
class DomRouterBridge {
|
|
5
|
-
config;
|
|
6
|
-
target;
|
|
7
|
-
bridgedRouter;
|
|
8
5
|
constructor(config = {}, target = window) {
|
|
6
|
+
// Routers send out the PARENT_EVENT to build a router hierarchy
|
|
7
|
+
// Listen for this event to find the topmost router located beneath the bridge in the DOM
|
|
8
|
+
// NOTE: because of the restrictions on "lwr/router" hierachy, this is only called 0 or 1 time(s)
|
|
9
|
+
// - only ONE root router is allowed in a document
|
|
10
|
+
// - sibling routers are NOT allowed
|
|
11
|
+
this.handleParentEvent = (event) => {
|
|
12
|
+
const parentEvent = event;
|
|
13
|
+
if (parentEvent && parentEvent.detail && typeof parentEvent.detail === 'function') {
|
|
14
|
+
// event.detail() will call this.addChild()
|
|
15
|
+
parentEvent.detail(this);
|
|
16
|
+
if (this.bridgedRouter) {
|
|
17
|
+
// Ensure the bridge does not become part of the router hierarchy
|
|
18
|
+
this.bridgedRouter.parent = undefined;
|
|
19
|
+
this.target.removeEventListener(PARENT_EVENT, this.handleParentEvent);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
};
|
|
9
23
|
// Provide fallbacks for missing config values
|
|
10
24
|
this.config = {
|
|
11
25
|
historyDisabled: !!config.historyDisabled,
|
|
@@ -26,23 +40,6 @@ class DomRouterBridge {
|
|
|
26
40
|
this.target = target;
|
|
27
41
|
this.target.addEventListener(PARENT_EVENT, this.handleParentEvent);
|
|
28
42
|
}
|
|
29
|
-
// Routers send out the PARENT_EVENT to build a router hierarchy
|
|
30
|
-
// Listen for this event to find the topmost router located beneath the bridge in the DOM
|
|
31
|
-
// NOTE: because of the restrictions on "lwr/router" hierachy, this is only called 0 or 1 time(s)
|
|
32
|
-
// - only ONE root router is allowed in a document
|
|
33
|
-
// - sibling routers are NOT allowed
|
|
34
|
-
handleParentEvent = (event) => {
|
|
35
|
-
const parentEvent = event;
|
|
36
|
-
if (parentEvent && parentEvent.detail && typeof parentEvent.detail === 'function') {
|
|
37
|
-
// event.detail() will call this.addChild()
|
|
38
|
-
parentEvent.detail(this);
|
|
39
|
-
if (this.bridgedRouter) {
|
|
40
|
-
// Ensure the bridge does not become part of the router hierarchy
|
|
41
|
-
this.bridgedRouter.parent = undefined;
|
|
42
|
-
this.target.removeEventListener(PARENT_EVENT, this.handleParentEvent);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
43
|
// Save an observed router and subscribe to its navigation and error updates
|
|
47
44
|
async addChild(child) {
|
|
48
45
|
this.bridgedRouter = child;
|
|
@@ -16,15 +16,12 @@ import { hasDocument } from 'lwr/routerUtils';
|
|
|
16
16
|
/*
|
|
17
17
|
* Provides a LWC router component. These can be nested and all report to the root router.
|
|
18
18
|
*/
|
|
19
|
-
|
|
20
|
-
static renderMode = 'light';
|
|
21
|
-
// Instance of the Router class for this LWC.
|
|
22
|
-
routerApi;
|
|
23
|
-
router;
|
|
24
|
-
historyDisabled = false;
|
|
25
|
-
currentTitle;
|
|
19
|
+
class RouterContainer extends LightningElement {
|
|
20
|
+
static { this.renderMode = 'light'; }
|
|
26
21
|
constructor() {
|
|
27
22
|
super();
|
|
23
|
+
// @ts-expect-error - LWC @api decorator compatibility with experimentalDecorators
|
|
24
|
+
this.historyDisabled = false;
|
|
28
25
|
this.currentTitle = hasDocument ? document.title : '';
|
|
29
26
|
}
|
|
30
27
|
/**
|
|
@@ -138,4 +135,5 @@ __decorate([
|
|
|
138
135
|
__decorate([
|
|
139
136
|
api
|
|
140
137
|
], RouterContainer.prototype, "historyDisabled", void 0);
|
|
138
|
+
export default RouterContainer;
|
|
141
139
|
//# sourceMappingURL=routerContainer.js.map
|
|
@@ -7,14 +7,8 @@ import { createRouter } from 'lwr/router';
|
|
|
7
7
|
import { generateMessageObject, messages } from 'lwr/routerErrors';
|
|
8
8
|
import { hasDocument } from 'lwr/routerUtils';
|
|
9
9
|
export class ServerRouter {
|
|
10
|
-
router;
|
|
11
|
-
target;
|
|
12
|
-
contextId = Object.freeze(() => undefined);
|
|
13
|
-
handleNavHook;
|
|
14
|
-
preNavHook;
|
|
15
|
-
errorNavHook;
|
|
16
|
-
currentRoute;
|
|
17
10
|
constructor(config, router, target) {
|
|
11
|
+
this.contextId = Object.freeze(() => undefined);
|
|
18
12
|
this.router = router;
|
|
19
13
|
this.target = target;
|
|
20
14
|
this.handleNavHook = config.handleNavigation;
|
|
@@ -86,10 +86,12 @@ export function getClientRoutes(path) {
|
|
|
86
86
|
if (!validate(json)) {
|
|
87
87
|
throw new Error(ajv.errorsText(validate.errors, { separator: '\n' }));
|
|
88
88
|
}
|
|
89
|
+
// Schema validated - safe to use as LwrRouterConfig
|
|
90
|
+
const config = json;
|
|
91
|
+
const routes = config.routes;
|
|
89
92
|
// Additional validation:
|
|
90
93
|
// 1. Ensure each route definition "id" is unique
|
|
91
94
|
// 2. Ensure each route definition has either a "handler" or a "component", but NOT BOTH
|
|
92
|
-
const routes = json.routes;
|
|
93
95
|
routes.forEach((route, index) => {
|
|
94
96
|
const { id, handler, component } = route;
|
|
95
97
|
if (routes.findIndex((r) => r.id === id) !== index) {
|
|
@@ -102,8 +104,8 @@ export function getClientRoutes(path) {
|
|
|
102
104
|
throw new Error('A route definition must contain either "handler" or "component"');
|
|
103
105
|
}
|
|
104
106
|
});
|
|
105
|
-
routerConfigJsonCache.set(path,
|
|
106
|
-
return
|
|
107
|
+
routerConfigJsonCache.set(path, config);
|
|
108
|
+
return config;
|
|
107
109
|
}
|
|
108
110
|
catch (e) {
|
|
109
111
|
throw new LwrUnresolvableError(descriptions.UNRESOLVABLE.ROUTES_MODULE(path, e.message), 'module');
|
|
@@ -3,15 +3,9 @@ import { generateModule, getRouterConfigPath, parseSpecifier, setUpWatcher } fro
|
|
|
3
3
|
import { deleteRouterConfigJsonCacheEntry, getClientRoutes } from '../index.js';
|
|
4
4
|
const DEFAULT_DIR = '$rootDir/src/routes';
|
|
5
5
|
export default class RouterModuleProvider {
|
|
6
|
-
name = 'router-module-provider';
|
|
7
|
-
version;
|
|
8
|
-
routesDir;
|
|
9
|
-
appBasePath;
|
|
10
|
-
i18n;
|
|
11
|
-
// Watch the Router Config files and recompile the modules on change
|
|
12
|
-
routerWatcher;
|
|
13
|
-
watchedFileSet = new Set(); // <config path, module id>
|
|
14
6
|
constructor({ routesDir = DEFAULT_DIR }, context) {
|
|
7
|
+
this.name = 'router-module-provider';
|
|
8
|
+
this.watchedFileSet = new Set(); // <config path, module id>
|
|
15
9
|
const { config: { rootDir, contentDir, i18n, layoutsDir }, runtimeEnvironment: { lwrVersion, watchFiles }, watcherFactory, } = context;
|
|
16
10
|
this.version = lwrVersion;
|
|
17
11
|
this.i18n = i18n;
|
|
@@ -2,10 +2,14 @@ import { LightningElement, api, wire } from 'lwc';
|
|
|
2
2
|
import { CurrentView } from 'lwr/navigation';
|
|
3
3
|
export default class Outlet extends LightningElement {
|
|
4
4
|
static renderMode = 'light';
|
|
5
|
+
|
|
6
|
+
// @ts-expect-error - LWC @api uses legacy decorator format; types expect new TC39 format (TS 5.0+)
|
|
5
7
|
@api
|
|
6
8
|
refocusOff = false;
|
|
9
|
+
// @ts-expect-error - LWC @api decorator compatibility with experimentalDecorators
|
|
7
10
|
@api
|
|
8
11
|
outletErrorCallback;
|
|
12
|
+
// @ts-expect-error - LWC @api decorator compatibility with experimentalDecorators
|
|
9
13
|
@api
|
|
10
14
|
viewName = 'default';
|
|
11
15
|
viewCtor = undefined;
|
|
@@ -13,6 +17,7 @@ export default class Outlet extends LightningElement {
|
|
|
13
17
|
hasError = false;
|
|
14
18
|
|
|
15
19
|
// Get a reference to the current view
|
|
20
|
+
// @ts-expect-error - LWC @wire decorator compatibility with experimentalDecorators
|
|
16
21
|
@wire(CurrentView, {
|
|
17
22
|
viewName: '$viewName'
|
|
18
23
|
})
|
|
@@ -16,8 +16,10 @@ export default class RouterContainer extends LightningElement {
|
|
|
16
16
|
|
|
17
17
|
// Instance of the Router class for this LWC.
|
|
18
18
|
|
|
19
|
+
// @ts-expect-error - LWC @api decorator compatibility with experimentalDecorators
|
|
19
20
|
@api
|
|
20
21
|
router;
|
|
22
|
+
// @ts-expect-error - LWC @api decorator compatibility with experimentalDecorators
|
|
21
23
|
@api
|
|
22
24
|
historyDisabled = false;
|
|
23
25
|
constructor() {
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
|
-
"version": "0.22.
|
|
8
|
+
"version": "0.22.2",
|
|
9
9
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -53,21 +53,21 @@
|
|
|
53
53
|
"test:server": "jest --config ./jest.server.config.cjs"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@lwrjs/client-modules": "0.22.
|
|
57
|
-
"@lwrjs/diagnostics": "0.22.
|
|
58
|
-
"@lwrjs/shared-utils": "0.22.
|
|
59
|
-
"ajv": "
|
|
56
|
+
"@lwrjs/client-modules": "0.22.2",
|
|
57
|
+
"@lwrjs/diagnostics": "0.22.2",
|
|
58
|
+
"@lwrjs/shared-utils": "0.22.2",
|
|
59
|
+
"ajv": "8.18.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@lwc/jest-preset": "^18.1.2",
|
|
63
|
-
"@lwrjs/fs-watch": "0.22.
|
|
63
|
+
"@lwrjs/fs-watch": "0.22.2",
|
|
64
64
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
65
65
|
"jest": "29.7.0",
|
|
66
66
|
"memfs": "^4.13.0",
|
|
67
67
|
"rollup": "^2.79.2",
|
|
68
68
|
"ts-jest": "^29.2.6",
|
|
69
|
-
"typescript": "
|
|
70
|
-
"utam": "3.
|
|
69
|
+
"typescript": "5.0.4",
|
|
70
|
+
"utam": "3.3.0"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"lwc": ">= 2.x"
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
"volta": {
|
|
101
101
|
"extends": "../../../package.json"
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "30870e466e15e6691d238e75836e9266a45203e3"
|
|
104
104
|
}
|
package/pageObjects/outlet.cjs
CHANGED
|
@@ -11,7 +11,7 @@ async function _utam_get_content(driver, root) {
|
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @lwrjs/router Outlet dynamically renders LWC view components.
|
|
14
|
-
* generated from JSON
|
|
14
|
+
* generated from JSON src/modules/lwr/outlet/__utam__/outlet.utam.json
|
|
15
15
|
* @version 0.10
|
|
16
16
|
* @author lwr-js
|
|
17
17
|
*/
|
package/pageObjects/outlet.d.cts
CHANGED
|
@@ -3,7 +3,7 @@ import { Driver as _Driver, Element as _Element, Locator as _Locator, ContainerC
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @lwrjs/router Outlet dynamically renders LWC view components.
|
|
6
|
-
* generated from JSON
|
|
6
|
+
* generated from JSON src/modules/lwr/outlet/__utam__/outlet.utam.json
|
|
7
7
|
* @version 0.10
|
|
8
8
|
* @author lwr-js
|
|
9
9
|
*/
|
package/pageObjects/outlet.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { Driver as _Driver, Element as _Element, Locator as _Locator, ContainerC
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @lwrjs/router Outlet dynamically renders LWC view components.
|
|
6
|
-
* generated from JSON
|
|
6
|
+
* generated from JSON src/modules/lwr/outlet/__utam__/outlet.utam.json
|
|
7
7
|
* @version 0.10
|
|
8
8
|
* @author lwr-js
|
|
9
9
|
*/
|
package/pageObjects/outlet.js
CHANGED
|
@@ -9,7 +9,7 @@ async function _utam_get_content(driver, root) {
|
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @lwrjs/router Outlet dynamically renders LWC view components.
|
|
12
|
-
* generated from JSON
|
|
12
|
+
* generated from JSON src/modules/lwr/outlet/__utam__/outlet.utam.json
|
|
13
13
|
* @version 0.10
|
|
14
14
|
* @author lwr-js
|
|
15
15
|
*/
|