react-router-concent 2.2.10 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("concent"),require("react"),require("react-router-dom")):"function"==typeof define&&define.amd?define(["exports","concent","react","react-router-dom"],t):t(e["react-router-concent"]={},e.concent,e.React,e.rrd)}(this,(function(e,t,n,o){"use strict";var r="default"in t?t.default:t,c=null,i=Array.prototype.slice,a={callByApi:!1,callTime:0};function l(){throw new Error("you may forget to initialize <ConnectRouter /> or call createHistoryProxy in your app!")}function u(){var e=i.call(arguments),t=e[0],n=i.call(e[1]);c?(a={callByApi:!0,callTime:Date.now()},c[t].apply(null,n)):l()}function s(){return a}function f(e){c=e}var d=null;function y(){if(d)return d;var e={block:function(){u("block",arguments)},createHref:function(){u("createHref",arguments)},go:function(){u("go",arguments)},goBack:function(){u("goBack",arguments)},goForward:function(){u("goForward",arguments)},listen:function(){u("listen",arguments)},push:function(){u("push",arguments)},replace:function(){u("replace",arguments)},getRouterHistory:function(){return c}};return window&&window.location&&(e.location=window.location),d=e,window&&!window.cc_history&&(window.cc_history=d),d}const p="$$CONCENT_ROUTER",g="onUrlChanged";var h=p,m=g;const w=function(e){h=e},_=function(){return h},C=function(e){m=e},v=function(){return m};var R=["PUSH","POP","REPLACE"],P=0;let x,k=1;function E(e,n,o){e.__insId||(e.__insId=(k++,k),x=e.__insId);var r=!0===n;P>0&&!t.ccContext.isHotReloadMode()?console.warn("historyProxy already been created! you can not init ConnectedRouter or call createHistoryProxy more than one time."):(P+=1,f(e),e.listen(((n,c)=>{if(e.__insId===x){o&&o(n,c);var i=_(),l=v(),u=s();if(Date.now()-u.time>300&&(a={callByApi:!1,callTime:0}),R.includes(c))t.getState(i)?t.setState(i,n):console.warn("forget to call configRouterModule after cc.run, react-router-concent will ignore writing the changed state");setTimeout((function(){if(r)t.emit(l,n,c,e);else{var o=Date.now();t.emit({name:l,canPerform:e=>{var t=e.ctx.initTime;return o-t>400}},n,c,e)}}),300)}})))}var H={id:"__connect_router_span_by_fantasticsoul__",style:{display:"none",width:0,height:0}},N=o.withRouter(class extends n.Component{constructor(e,t){super(e,t);var n=e.history;E(n,!0===e.callUrlChangedOnInit,e.onUrlChange),e.connected&&e.connected(n)}render(){return this.props.children||n.createElement("span",H)}}),U=y();const I=N,T=function(e){var t=e.style,o=e.to,r=e.onClick,c={className:e.className,href:"javascript:;",onClick:function(t){t.stopPropagation&&(!1===e.stop||t.stopPropagation()),U.push(o),r&&r(o)},style:t};return n.createElement("a",c,e.children)},b=y(),A=E,B=(e={})=>{const t=e.module||p,n=e.onUrlChanged||g;w(t),C(n),r.configure(t,{state:{hash:"",key:"",pathname:"",search:"",state:null}})},L=_,M=v,O=s;var j={ConnectRouter:I,Link:T,history:b,createHistoryProxy:A,configureRoute:B,getModuleName:L,getUrlChangedEvName:M,getLatestCallInfo:O};e.ConnectRouter=I,e.Link=T,e.history=b,e.createHistoryProxy=A,e.configureRoute=B,e.getModuleName=L,e.getUrlChangedEvName=M,e.getLatestCallInfo=O,e.default=j,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("concent"),require("react"),require("react-router-dom")):"function"==typeof define&&define.amd?define(["exports","concent","react","react-router-dom"],t):t(e["react-router-concent"]={},e.concent,e.React,e.rrd)}(this,(function(e,t,n,o){"use strict";var r="default"in t?t.default:t,c=null,i=Array.prototype.slice,a={callByApi:!1,callTime:0};function l(){throw new Error("you may forget to initialize <ConnectRouter /> or call createHistoryProxy in your app!")}function u(){var e=i.call(arguments),t=e[0],n=i.call(e[1]);c?(a={callByApi:!0,callTime:Date.now()},c[t].apply(null,n)):l()}function s(){return a}function f(e){c=e}var d=null;function y(){if(d)return d;var e={block:function(){u("block",arguments)},createHref:function(){u("createHref",arguments)},go:function(){u("go",arguments)},goBack:function(){u("goBack",arguments)},goForward:function(){u("goForward",arguments)},listen:function(){u("listen",arguments)},push:function(){u("push",arguments)},replace:function(){u("replace",arguments)},getRouterHistory:function(){return c}};return window&&window.location&&(e.location=window.location),d=e,window&&!window.cc_history&&(window.cc_history=d),d}const p="$$CONCENT_ROUTER",h="onUrlChanged";var g=p,m=h;const w=function(e){g=e},_=function(){return g},v=function(e){m=e},C=function(){return m};var R=["PUSH","POP","REPLACE"],P=0;let x,E=1;function H(e,n,o){e.__insId||(e.__insId=(E++,E),x=e.__insId);var r=!0===n;P>0&&!t.ccContext.isHotReloadMode()?console.warn("historyProxy already been created! you can not init ConnectedRouter or call createHistoryProxy more than one time."):(P+=1,f(e),e.listen(((n,c)=>{if(e.__insId===x){o&&o(n,c);var i=_(),l=C(),u=s();if(Date.now()-u.time>300&&(a={callByApi:!1,callTime:0}),R.includes(c))t.getState(i)?t.setState(i,n):console.warn("forget to call configRouterModule after cc.run, react-router-concent will ignore writing the changed state");setTimeout((function(){if(r)t.emit(l,n,c,e);else{var o=Date.now();t.emit({name:l,canPerform:e=>{var t=e.ctx.initTime;return o-t>400}},n,c,e)}}),300)}})))}var k={id:"__connect_router_span_by_fantasticsoul__",style:{display:"none",width:0,height:0}},N=o.withRouter;N||(N=e=>t=>{const r=o.useHistory();return n.createElement(e,{history:r,...t})});var U=N(class extends n.Component{constructor(e,t){super(e,t);var n=e.history;H(n,!0===e.callUrlChangedOnInit,e.onUrlChange),e.connected&&e.connected(n)}render(){return this.props.children||n.createElement("span",k)}}),I=y();const T=U,b=function(e){var t=e.style,o=e.to,r=e.onClick,c={className:e.className,href:"javascript:;",onClick:function(t){t.stopPropagation&&(!1===e.stop||t.stopPropagation()),I.push(o),r&&r(o)},style:t};return n.createElement("a",c,e.children)},A=y(),B=H,L=(e={})=>{const t=e.module||p,n=e.onUrlChanged||h;w(t),v(n),r.configure(t,{state:{hash:"",key:"",pathname:"",search:"",state:null}})},M=_,O=C,j=s;var q={ConnectRouter:T,Link:b,history:A,createHistoryProxy:B,configureRoute:L,getModuleName:M,getUrlChangedEvName:O,getLatestCallInfo:j};e.ConnectRouter=T,e.Link=b,e.history=A,e.createHistoryProxy=B,e.configureRoute=L,e.getModuleName=M,e.getUrlChangedEvName=O,e.getLatestCallInfo=j,e.default=q,Object.defineProperty(e,"__esModule",{value:!0})}));
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("concent"),require("react"),require("react-router-dom")):"function"==typeof define&&define.amd?define(["exports","concent","react","react-router-dom"],t):t(e["react-router-concent"]={},e.concent,e.React,e.rrd)}(this,(function(e,t,n,o){"use strict";var r="default"in t?t.default:t,c=null,i=Array.prototype.slice,a={callByApi:!1,callTime:0};function l(){throw new Error("you may forget to initialize <ConnectRouter /> or call createHistoryProxy in your app!")}function u(){var e=i.call(arguments),t=e[0],n=i.call(e[1]);c?(a={callByApi:!0,callTime:Date.now()},c[t].apply(null,n)):l()}function s(){return a}function f(e){c=e}var d=null;function y(){if(d)return d;var e={block:function(){u("block",arguments)},createHref:function(){u("createHref",arguments)},go:function(){u("go",arguments)},goBack:function(){u("goBack",arguments)},goForward:function(){u("goForward",arguments)},listen:function(){u("listen",arguments)},push:function(){u("push",arguments)},replace:function(){u("replace",arguments)},getRouterHistory:function(){return c}};return window&&window.location&&(e.location=window.location),d=e,window&&!window.cc_history&&(window.cc_history=d),d}const p="$$CONCENT_ROUTER",g="onUrlChanged";var h=p,m=g;const w=function(e){h=e},_=function(){return h},C=function(e){m=e},v=function(){return m};var R=["PUSH","POP","REPLACE"],P=0;let x,k=1;function E(e,n,o){e.__insId||(e.__insId=(k++,k),x=e.__insId);var r=!0===n;P>0&&!t.ccContext.isHotReloadMode()?console.warn("historyProxy already been created! you can not init ConnectedRouter or call createHistoryProxy more than one time."):(P+=1,f(e),e.listen(((n,c)=>{if(e.__insId===x){o&&o(n,c);var i=_(),l=v(),u=s();if(Date.now()-u.time>300&&(a={callByApi:!1,callTime:0}),R.includes(c))t.getState(i)?t.setState(i,n):console.warn("forget to call configRouterModule after cc.run, react-router-concent will ignore writing the changed state");setTimeout((function(){if(r)t.emit(l,n,c,e);else{var o=Date.now();t.emit({name:l,canPerform:e=>{var t=e.ctx.initTime;return o-t>400}},n,c,e)}}),300)}})))}var H={id:"__connect_router_span_by_fantasticsoul__",style:{display:"none",width:0,height:0}},N=o.withRouter(class extends n.Component{constructor(e,t){super(e,t);var n=e.history;E(n,!0===e.callUrlChangedOnInit,e.onUrlChange),e.connected&&e.connected(n)}render(){return this.props.children||n.createElement("span",H)}}),U=y();const I=N,T=function(e){var t=e.style,o=e.to,r=e.onClick,c={className:e.className,href:"javascript:;",onClick:function(t){t.stopPropagation&&(!1===e.stop||t.stopPropagation()),U.push(o),r&&r(o)},style:t};return n.createElement("a",c,e.children)},b=y(),A=E,B=(e={})=>{const t=e.module||p,n=e.onUrlChanged||g;w(t),C(n),r.configure(t,{state:{hash:"",key:"",pathname:"",search:"",state:null}})},L=_,M=v,O=s;var j={ConnectRouter:I,Link:T,history:b,createHistoryProxy:A,configureRoute:B,getModuleName:L,getUrlChangedEvName:M,getLatestCallInfo:O};e.ConnectRouter=I,e.Link=T,e.history=b,e.createHistoryProxy=A,e.configureRoute=B,e.getModuleName=L,e.getUrlChangedEvName=M,e.getLatestCallInfo=O,e.default=j,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("concent"),require("react"),require("react-router-dom")):"function"==typeof define&&define.amd?define(["exports","concent","react","react-router-dom"],t):t(e["react-router-concent"]={},e.concent,e.React,e.rrd)}(this,(function(e,t,n,o){"use strict";var r="default"in t?t.default:t,c=null,i=Array.prototype.slice,a={callByApi:!1,callTime:0};function l(){throw new Error("you may forget to initialize <ConnectRouter /> or call createHistoryProxy in your app!")}function u(){var e=i.call(arguments),t=e[0],n=i.call(e[1]);c?(a={callByApi:!0,callTime:Date.now()},c[t].apply(null,n)):l()}function s(){return a}function f(e){c=e}var d=null;function y(){if(d)return d;var e={block:function(){u("block",arguments)},createHref:function(){u("createHref",arguments)},go:function(){u("go",arguments)},goBack:function(){u("goBack",arguments)},goForward:function(){u("goForward",arguments)},listen:function(){u("listen",arguments)},push:function(){u("push",arguments)},replace:function(){u("replace",arguments)},getRouterHistory:function(){return c}};return window&&window.location&&(e.location=window.location),d=e,window&&!window.cc_history&&(window.cc_history=d),d}const p="$$CONCENT_ROUTER",h="onUrlChanged";var g=p,m=h;const w=function(e){g=e},_=function(){return g},v=function(e){m=e},C=function(){return m};var R=["PUSH","POP","REPLACE"],P=0;let x,E=1;function H(e,n,o){e.__insId||(e.__insId=(E++,E),x=e.__insId);var r=!0===n;P>0&&!t.ccContext.isHotReloadMode()?console.warn("historyProxy already been created! you can not init ConnectedRouter or call createHistoryProxy more than one time."):(P+=1,f(e),e.listen(((n,c)=>{if(e.__insId===x){o&&o(n,c);var i=_(),l=C(),u=s();if(Date.now()-u.time>300&&(a={callByApi:!1,callTime:0}),R.includes(c))t.getState(i)?t.setState(i,n):console.warn("forget to call configRouterModule after cc.run, react-router-concent will ignore writing the changed state");setTimeout((function(){if(r)t.emit(l,n,c,e);else{var o=Date.now();t.emit({name:l,canPerform:e=>{var t=e.ctx.initTime;return o-t>400}},n,c,e)}}),300)}})))}var k={id:"__connect_router_span_by_fantasticsoul__",style:{display:"none",width:0,height:0}},N=o.withRouter;N||(N=e=>t=>{const r=o.useHistory();return n.createElement(e,{history:r,...t})});var U=N(class extends n.Component{constructor(e,t){super(e,t);var n=e.history;H(n,!0===e.callUrlChangedOnInit,e.onUrlChange),e.connected&&e.connected(n)}render(){return this.props.children||n.createElement("span",k)}}),I=y();const T=U,b=function(e){var t=e.style,o=e.to,r=e.onClick,c={className:e.className,href:"javascript:;",onClick:function(t){t.stopPropagation&&(!1===e.stop||t.stopPropagation()),I.push(o),r&&r(o)},style:t};return n.createElement("a",c,e.children)},A=y(),B=H,L=(e={})=>{const t=e.module||p,n=e.onUrlChanged||h;w(t),v(n),r.configure(t,{state:{hash:"",key:"",pathname:"",search:"",state:null}})},M=_,O=C,j=s;var q={ConnectRouter:T,Link:b,history:A,createHistoryProxy:B,configureRoute:L,getModuleName:M,getUrlChangedEvName:O,getLatestCallInfo:j};e.ConnectRouter=T,e.Link=b,e.history=A,e.createHistoryProxy=B,e.configureRoute=L,e.getModuleName=M,e.getUrlChangedEvName=O,e.getLatestCallInfo=j,e.default=q,Object.defineProperty(e,"__esModule",{value:!0})}));
@@ -18,7 +18,7 @@ if (!withRouter) {
18
18
  }
19
19
 
20
20
 
21
- export default rrd.withRouter(
21
+ export default withRouter(
22
22
  class extends React.Component {
23
23
  constructor(props, context) {
24
24
  super(props, context);
@@ -26,7 +26,7 @@ if (!withRouter) {
26
26
  };
27
27
  }
28
28
 
29
- export default rrd.withRouter(class extends React.Component {
29
+ export default withRouter(class extends React.Component {
30
30
  constructor(props, context) {
31
31
  super(props, context);
32
32
  var history = props.history;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-router-concent",
3
- "version": "2.2.10",
3
+ "version": "2.3.0",
4
4
  "description": "let using react-router more easily in concent",
5
5
  "main": "dist/react-router-concent.js",
6
6
  "types": "src/index.d.ts",
@@ -18,7 +18,7 @@ if (!withRouter) {
18
18
  }
19
19
 
20
20
 
21
- export default rrd.withRouter(
21
+ export default withRouter(
22
22
  class extends React.Component {
23
23
  constructor(props, context) {
24
24
  super(props, context);