@stackflow/react
Advanced tools
Comparing version 0.14.0 to 0.14.1
@@ -0,1 +1,2 @@ | ||
export * from "./CoreActionsContext"; | ||
export * from "./CoreProvider"; | ||
@@ -2,0 +3,0 @@ export * from "./CoreStateContext"; |
@@ -1,2 +0,2 @@ | ||
"use strict";var bt=Object.create;var b=Object.defineProperty,Bt=Object.defineProperties,Nt=Object.getOwnPropertyDescriptor,Mt=Object.getOwnPropertyDescriptors,Ft=Object.getOwnPropertyNames,X=Object.getOwnPropertySymbols,Ut=Object.getPrototypeOf,Z=Object.prototype.hasOwnProperty,Ht=Object.prototype.propertyIsEnumerable;var Y=(t,e,o)=>e in t?b(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,p=(t,e)=>{for(var o in e||(e={}))Z.call(e,o)&&Y(t,o,e[o]);if(X)for(var o of X(e))Ht.call(e,o)&&Y(t,o,e[o]);return t},k=(t,e)=>Bt(t,Mt(e));var Vt=(t,e)=>{for(var o in e)b(t,o,{get:e[o],enumerable:!0})},tt=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let m of Ft(e))!Z.call(t,m)&&m!==o&&b(t,m,{get:()=>e[m],enumerable:!(n=Nt(e,m))||n.enumerable});return t};var d=(t,e,o)=>(o=t!=null?bt(Ut(t)):{},tt(e||!t||!t.__esModule?b(o,"default",{value:t,enumerable:!0}):o,t)),qt=t=>tt(b({},"__esModule",{value:!0}),t);var Xt={};Vt(Xt,{stackflow:()=>Qt,useActions:()=>J,useActivity:()=>Kt,useActivityParams:()=>_t,useInitContext:()=>B,useStack:()=>Gt});module.exports=qt(Xt);var ot=require("react");var et=require("react"),T=(0,et.createContext)(null);var Kt=()=>(0,ot.useContext)(T);var rt=require("react");function _t(){return(0,rt.useContext)(T).params}var nt=d(require("react"));var it=require("react"),M=(0,it.createContext)({});function B(){return nt.default.useContext(M)}var st=require("react");var at=require("react"),F=(0,at.createContext)(null);var Gt=()=>(0,st.useContext)(F);var g=d(require("react"));var A=require("@stackflow/core"),v=d(require("react")),Ct=d(require("react-fast-compare"));var mt=d(require("react"));var U=require("react"),ct=d(require("react-fast-compare"));function H(t){let e=(0,U.useRef)(t),o=e.current,n=(0,ct.default)(o,t);return(0,U.useEffect)(()=>{n||(e.current=t)}),n?o:t}var pt=({children:t,value:e})=>mt.default.createElement(T.Provider,{value:H(e)},t);var ft=require("@stackflow/core");function D(){return(0,ft.id)()}var ut=d(require("react"));var vt=({children:t,value:e})=>ut.default.createElement(M.Provider,{value:e},t);var lt=require("react"),V=(0,lt.createContext)(null);var dt=d(require("react"));var Pt=({children:t,value:e})=>dt.default.createElement(V.Provider,{value:e},t);var xt=require("react");function C(){return(0,xt.useContext)(V)}var yt=require("react"),q=(0,yt.createContext)(null);var kt=require("react"),K=(0,kt.createContext)(null);var Lt=1e3,Wt=Lt/60,At=({transitionDuration:t,initialActivity:e,activities:o,children:n})=>{let m=C(),c=B(),r=(0,v.useMemo)(()=>{let y=new Date().getTime()-t,f=e?(0,A.makeEvent)("Pushed",{activityId:D(),activityName:e({initContext:c}),activityParams:{},eventDate:y,skipEnterActiveState:!1}):null,x=m.reduce((N,W)=>{var z,Q;return(Q=(z=W.overrideInitialPushedEvent)==null?void 0:z.call(W,{pushedEvent:N}))!=null?Q:N},f);!!x&&!!f&&x.id!==f.id&&console.warn(`Stackflow - Some plugin overrides an "initialActivity" option. The "initialActivity" option you set to "${f.activityName}" in the "stackflow" is ignored.`);let R=x;R||console.warn("Stackflow - There is no initial activity. If you want to set the initial activity, add the `initialActivity` option of the `stackflow()` function or add a plugin that sets the initial activity. (e.g. `@stackflow/plugin-history-sync`)");let Ot=Object.keys(o).map(N=>(0,A.makeEvent)("ActivityRegistered",{activityName:N,eventDate:y})),$=[(0,A.makeEvent)("Initialized",{transitionDuration:t,eventDate:y}),...Ot];return R&&$.push(R),$},[]),a=(0,v.useMemo)(()=>(0,A.aggregate)(r,new Date().getTime()),[]),[s,i]=(0,v.useState)(()=>a),u=(0,v.useRef)(r),l=(0,v.useRef)(a),P=(0,v.useCallback)(()=>l.current,[l]),w=(0,v.useCallback)((y,f)=>{let x=(0,A.makeEvent)(y,f),h=[...u.current,x];u.current=h,i((0,A.aggregate)(h,new Date().getTime()))},[u,i]);return(0,v.useEffect)(()=>{let y=setInterval(()=>{let f=u.current,x=(0,A.aggregate)(f,new Date().getTime());(0,Ct.default)(s,x)||(i(x),l.current=x),x.globalTransitionState==="idle"&&clearInterval(y)},Wt);return()=>{clearInterval(y)}},[u,s,i]),v.default.createElement(K.Provider,{value:s},v.default.createElement(q.Provider,{value:(0,v.useMemo)(()=>({getStack:P,dispatchEvent:w}),[P,w])},n))};var S=d(require("react"));var St=t=>JSON.parse(JSON.stringify(t)),_=()=>{let t=C(),e=B(),{dispatchEvent:o,getStack:n}=S.default.useContext(q),m=(0,S.useCallback)(i=>{let{isPrevented:u,params:l}=s("PUSHED",i);u||o("Pushed",p({},l))},[o]),c=(0,S.useCallback)(i=>{let{isPrevented:u,params:l}=s("REPLACED",i);u||o("Replaced",p({},l))},[o]),r=(0,S.useCallback)(i=>{let u=i!=null?i:{},{isPrevented:l,params:P}=s("POPPED",u);l||o("Popped",p({},P))},[o]),a=(0,S.useMemo)(()=>({dispatchEvent:o,getStack:n,push:m,replace:c,pop:r}),[o,n,m,c,r]),s=(0,S.useCallback)((i,u)=>{let l=!1,P=St(u),w=()=>{l=!0},y=f=>{P=St(f)};return t.forEach(f=>{var x,h,R;switch(i){case"PUSHED":(x=f.onBeforePush)==null||x.call(f,{actionParams:P,actions:k(p({},a),{preventDefault:w,overrideActionParams:y})});break;case"REPLACED":(h=f.onBeforeReplace)==null||h.call(f,{actionParams:P,actions:k(p({},a),{preventDefault:w,overrideActionParams:y})});break;case"POPPED":(R=f.onBeforePop)==null||R.call(f,{actionParams:P,actions:k(p({},a),{preventDefault:w,overrideActionParams:y})});break;default:break}}),{isPrevented:l,params:P}},[t,e]);return a};var gt=d(require("react"));var I=()=>gt.default.useContext(K);var Et=require("@stackflow/core"),E=require("react");var jt=()=>{let t=C(),e=I(),o=_(),n=(0,E.useCallback)(r=>{t.forEach(a=>{var s;(s=a.onInit)==null||s.call(a,r)})},[]),m=(0,E.useCallback)(({actions:r,effect:a})=>{switch(a._TAG){case"PUSHED":{t.forEach(s=>{var i;return(i=s.onPushed)==null?void 0:i.call(s,{actions:r,effect:a})});break}case"POPPED":{t.forEach(s=>{var i;return(i=s.onPopped)==null?void 0:i.call(s,{actions:r,effect:a})});break}case"REPLACED":{t.forEach(s=>{var i;return(i=s.onReplaced)==null?void 0:i.call(s,{actions:r,effect:a})});break}case"%SOMETHING_CHANGED%":{t.forEach(s=>{var i;return(i=s.onChanged)==null?void 0:i.call(s,{actions:r,effect:a})});break}default:break}},[]);(0,E.useEffect)(()=>{n==null||n({actions:o})},[]);let c=(0,E.useRef)(e);return(0,E.useEffect)(()=>{let r=c.current;(r?(0,Et.produceEffects)(r,e):[]).forEach(s=>{m({actions:o,effect:s})}),c.current=p({},e)},[e]),null},wt=jt;var O=d(require("react"));var G=d(require("react"));var ht=d(require("react"));var Rt=({children:t,value:e})=>ht.default.createElement(F.Provider,{value:H(e)},t);var Jt=({activities:t,plugin:e})=>{let o=I(),n=C();return e.render({stack:k(p({},o),{render(m){let c=p(p({},o),m);return{activities:c.activities.map(r=>k(p({},r),{key:r.id,render(a){let s=t[r.name],i=G.default.createElement(s,{params:r.params});return n.forEach(u=>{var l,P;i=(P=(l=u.wrapActivity)==null?void 0:l.call(u,{activity:k(p({},r),{render:()=>i})}))!=null?P:i}),G.default.createElement(Rt,{value:c},G.default.createElement(pt,{key:r.id,value:p(p({},r),a)},i))}}))}}})})},Tt=Jt;var $t=({activities:t})=>{let e=I(),o=C(),n=o.filter(c=>!!c.render);(0,O.useEffect)(()=>{n.length===0&&console.warn(`Stackflow - There is no rendering plugin, so "<Stack />" doesn't render anything. If you want to render some UI, use "@stackflow/plugin-renderer-basic" or add another rendering plugin.`)},[n]);let m=O.default.createElement(O.default.Fragment,null,n.map(c=>O.default.createElement(Tt,{activities:t,key:c.key,plugin:c})));return o.forEach(c=>{var r,a;m=(a=(r=c.wrapStack)==null?void 0:r.call(c,{stack:k(p({},e),{render(){return m}})}))!=null?a:m}),m},Dt=$t;var L=d(require("react"));function j(t){return t?t.animate===void 0||t.animate==null?{skipActiveState:!1}:{skipActiveState:!t.animate}:{skipActiveState:!1}}var It,zt=(It=L.default.useTransition)!=null?It:()=>[!1,t=>t()];function J(){let t=_(),[e,o]=zt();return(0,L.useMemo)(()=>({pending:e,push(n,m,c){let r=D();return o(()=>{t.push({activityId:r,activityName:n,activityParams:m,skipEnterActiveState:j(c).skipActiveState})}),{activityId:r}},replace(n,m,c){let r=D();return o(()=>{var a;t.replace({activityId:(a=c==null?void 0:c.activityId)!=null?a:D(),activityName:n,activityParams:m,skipEnterActiveState:j(c).skipActiveState})}),{activityId:r}},pop(n){o(()=>{t.pop({skipExitActiveState:j(n).skipActiveState})})}}),[t.push,t.replace,t.pop,e,o])}function Qt(t){let e=Object.entries(t.activities).reduce((o,[n,m])=>k(p({},o),{[n]:g.default.memo(m)}),{});return typeof window!="undefined"&&window.document.documentElement.style.setProperty("--stackflow-transition-duration",`${t.transitionDuration}ms`),{Stack(o){var m;let n=(0,g.useMemo)(()=>{var c;return((c=t.plugins)!=null?c:[]).reduce((r,a)=>[...r,...Array.isArray(a)?a:[a]],[]).map(r=>r({initContext:o.initContext}))},[]);return g.default.createElement(vt,{value:(m=o.initContext)!=null?m:{}},g.default.createElement(Pt,{value:n},g.default.createElement(At,{activities:e,initialActivity:t.initialActivity,transitionDuration:t.transitionDuration},g.default.createElement(Dt,{activities:e}),g.default.createElement(wt,null))))},useFlow:J}} | ||
"use strict";var Mt=Object.create;var b=Object.defineProperty,Nt=Object.defineProperties,Ut=Object.getOwnPropertyDescriptor,Ft=Object.getOwnPropertyDescriptors,Ht=Object.getOwnPropertyNames,Y=Object.getOwnPropertySymbols,Vt=Object.getPrototypeOf,tt=Object.prototype.hasOwnProperty,qt=Object.prototype.propertyIsEnumerable;var Z=(t,o,e)=>o in t?b(t,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[o]=e,f=(t,o)=>{for(var e in o||(o={}))tt.call(o,e)&&Z(t,e,o[e]);if(Y)for(var e of Y(o))qt.call(o,e)&&Z(t,e,o[e]);return t},k=(t,o)=>Nt(t,Ft(o));var Kt=(t,o)=>{for(var e in o)b(t,e,{get:o[e],enumerable:!0})},et=(t,o,e,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let p of Ht(o))!tt.call(t,p)&&p!==e&&b(t,p,{get:()=>o[p],enumerable:!(a=Ut(o,p))||a.enumerable});return t};var d=(t,o,e)=>(e=t!=null?Mt(Vt(t)):{},et(o||!t||!t.__esModule?b(e,"default",{value:t,enumerable:!0}):e,t)),_t=t=>et(b({},"__esModule",{value:!0}),t);var te={};Kt(te,{stackflow:()=>Zt,useActions:()=>N,useActivity:()=>Gt,useActivityParams:()=>Lt,useInitContext:()=>M,useStack:()=>Wt});module.exports=_t(te);var rt=require("react");var ot=require("react"),T=(0,ot.createContext)(null);var Gt=()=>(0,rt.useContext)(T);var it=require("react");function Lt(){return(0,it.useContext)(T).params}var at=d(require("react"));var nt=require("react"),F=(0,nt.createContext)({});function M(){return at.default.useContext(F)}var st=require("react");var ct=require("react"),H=(0,ct.createContext)(null);var Wt=()=>(0,st.useContext)(H);var C=d(require("react"));var pt=require("react"),V=(0,pt.createContext)(null);var S=require("@stackflow/core"),v=d(require("react")),Ct=d(require("react-fast-compare"));var ft=d(require("react"));var q=require("react"),mt=d(require("react-fast-compare"));function K(t){let o=(0,q.useRef)(t),e=o.current,a=(0,mt.default)(e,t);return(0,q.useEffect)(()=>{a||(o.current=t)}),a?e:t}var ut=({children:t,value:o})=>ft.default.createElement(T.Provider,{value:K(o)},t);var lt=require("@stackflow/core");function D(){return(0,lt.id)()}var vt=d(require("react"));var dt=({children:t,value:o})=>vt.default.createElement(F.Provider,{value:o},t);var Pt=require("react"),_=(0,Pt.createContext)(null);var yt=d(require("react"));var xt=({children:t,value:o})=>yt.default.createElement(_.Provider,{value:o},t);var kt=require("react");function A(){return(0,kt.useContext)(_)}var At=require("react"),G=(0,At.createContext)(null);var jt=1e3,$t=jt/60,St=({transitionDuration:t,initialActivity:o,activities:e,children:a})=>{let p=A(),s=M(),r=(0,v.useMemo)(()=>{let x=new Date().getTime()-t,u=o?(0,S.makeEvent)("Pushed",{activityId:D(),activityName:o({initContext:s}),activityParams:{},eventDate:x,skipEnterActiveState:!1}):null,y=p.reduce((U,j)=>{var Q,X;return(X=(Q=j.overrideInitialPushedEvent)==null?void 0:Q.call(j,{pushedEvent:U}))!=null?X:U},u);!!y&&!!u&&y.id!==u.id&&console.warn(`Stackflow - Some plugin overrides an "initialActivity" option. The "initialActivity" option you set to "${u.activityName}" in the "stackflow" is ignored.`);let R=y;R||console.warn("Stackflow - There is no initial activity. If you want to set the initial activity, add the `initialActivity` option of the `stackflow()` function or add a plugin that sets the initial activity. (e.g. `@stackflow/plugin-history-sync`)");let bt=Object.keys(e).map(U=>(0,S.makeEvent)("ActivityRegistered",{activityName:U,eventDate:x})),z=[(0,S.makeEvent)("Initialized",{transitionDuration:t,eventDate:x}),...bt];return R&&z.push(R),z},[]),n=(0,v.useMemo)(()=>(0,S.aggregate)(r,new Date().getTime()),[]),[i,c]=(0,v.useState)(()=>n),m=(0,v.useRef)(r),l=(0,v.useRef)(n),P=(0,v.useCallback)(()=>l.current,[l]),w=(0,v.useCallback)((x,u)=>{let y=(0,S.makeEvent)(x,u),h=[...m.current,y];m.current=h,c((0,S.aggregate)(h,new Date().getTime()))},[m,c]);return(0,v.useEffect)(()=>{let x=setInterval(()=>{let u=m.current,y=(0,S.aggregate)(u,new Date().getTime());(0,Ct.default)(i,y)||(c(y),l.current=y),y.globalTransitionState==="idle"&&clearInterval(x)},$t);return()=>{clearInterval(x)}},[m,i,c]),v.default.createElement(G.Provider,{value:i},v.default.createElement(V.Provider,{value:(0,v.useMemo)(()=>({getStack:P,dispatchEvent:w}),[P,w])},a))};var g=d(require("react"));var gt=t=>JSON.parse(JSON.stringify(t)),I=()=>{let t=A(),o=M(),{dispatchEvent:e,getStack:a}=g.default.useContext(V),p=(0,g.useCallback)(c=>{let{isPrevented:m,params:l}=i("PUSHED",c);m||e("Pushed",f({},l))},[e]),s=(0,g.useCallback)(c=>{let{isPrevented:m,params:l}=i("REPLACED",c);m||e("Replaced",f({},l))},[e]),r=(0,g.useCallback)(c=>{let m=c!=null?c:{},{isPrevented:l,params:P}=i("POPPED",m);l||e("Popped",f({},P))},[e]),n=(0,g.useMemo)(()=>({dispatchEvent:e,getStack:a,push:p,replace:s,pop:r}),[e,a,p,s,r]),i=(0,g.useCallback)((c,m)=>{let l=!1,P=gt(m),w=()=>{l=!0},x=u=>{P=gt(u)};return t.forEach(u=>{var y,h,R;switch(c){case"PUSHED":(y=u.onBeforePush)==null||y.call(u,{actionParams:P,actions:k(f({},n),{preventDefault:w,overrideActionParams:x})});break;case"REPLACED":(h=u.onBeforeReplace)==null||h.call(u,{actionParams:P,actions:k(f({},n),{preventDefault:w,overrideActionParams:x})});break;case"POPPED":(R=u.onBeforePop)==null||R.call(u,{actionParams:P,actions:k(f({},n),{preventDefault:w,overrideActionParams:x})});break;default:break}}),{isPrevented:l,params:P}},[t,o]);return n};var Et=d(require("react"));var O=()=>Et.default.useContext(G);var wt=require("@stackflow/core"),E=require("react");var Jt=()=>{let t=A(),o=O(),e=I(),a=(0,E.useCallback)(r=>{t.forEach(n=>{var i;(i=n.onInit)==null||i.call(n,r)})},[]),p=(0,E.useCallback)(({actions:r,effect:n})=>{switch(n._TAG){case"PUSHED":{t.forEach(i=>{var c;return(c=i.onPushed)==null?void 0:c.call(i,{actions:r,effect:n})});break}case"POPPED":{t.forEach(i=>{var c;return(c=i.onPopped)==null?void 0:c.call(i,{actions:r,effect:n})});break}case"REPLACED":{t.forEach(i=>{var c;return(c=i.onReplaced)==null?void 0:c.call(i,{actions:r,effect:n})});break}case"%SOMETHING_CHANGED%":{t.forEach(i=>{var c;return(c=i.onChanged)==null?void 0:c.call(i,{actions:r,effect:n})});break}default:break}},[]);(0,E.useEffect)(()=>{a==null||a({actions:e})},[]);let s=(0,E.useRef)(o);return(0,E.useEffect)(()=>{let r=s.current;(r?(0,wt.produceEffects)(r,o):[]).forEach(i=>{p({actions:e,effect:i})}),s.current=f({},o)},[o]),null},ht=Jt;var B=d(require("react"));var L=d(require("react"));var Rt=d(require("react"));var Tt=({children:t,value:o})=>Rt.default.createElement(H.Provider,{value:K(o)},t);var zt=({activities:t,plugin:o})=>{let e=O(),a=A();return o.render({stack:k(f({},e),{render(p){let s=f(f({},e),p);return{activities:s.activities.map(r=>k(f({},r),{key:r.id,render(n){let i=t[r.name],c=L.default.createElement(i,{params:r.params});return a.forEach(m=>{var l,P;c=(P=(l=m.wrapActivity)==null?void 0:l.call(m,{activity:k(f({},r),{render:()=>c})}))!=null?P:c}),L.default.createElement(Tt,{value:s},L.default.createElement(ut,{key:r.id,value:f(f({},r),n)},c))}}))}}})})},Dt=zt;var Qt=({activities:t})=>{let o=O(),e=A(),a=e.filter(s=>!!s.render);(0,B.useEffect)(()=>{a.length===0&&console.warn(`Stackflow - There is no rendering plugin, so "<Stack />" doesn't render anything. If you want to render some UI, use "@stackflow/plugin-renderer-basic" or add another rendering plugin.`)},[a]);let p=B.default.createElement(B.default.Fragment,null,a.map(s=>B.default.createElement(Dt,{activities:t,key:s.key,plugin:s})));return e.forEach(s=>{var r,n;p=(n=(r=s.wrapStack)==null?void 0:r.call(s,{stack:k(f({},o),{render(){return p}})}))!=null?n:p}),p},It=Qt;var J=d(require("react"));var W=d(require("react"));function $(t){return t?t.animate===void 0||t.animate==null?{skipActiveState:!1}:{skipActiveState:!t.animate}:{skipActiveState:!1}}var Ot,Xt=(Ot=W.default.useTransition)!=null?Ot:()=>[!1,t=>t()];function N(){let t=I(),[o,e]=Xt();return(0,W.useMemo)(()=>({pending:o,push(a,p,s){let r=D();return e(()=>{t.push({activityId:r,activityName:a,activityParams:p,skipEnterActiveState:$(s).skipActiveState})}),{activityId:r}},replace(a,p,s){let r=D();return e(()=>{var n;t.replace({activityId:(n=s==null?void 0:s.activityId)!=null?n:D(),activityName:a,activityParams:p,skipEnterActiveState:$(s).skipActiveState})}),{activityId:r}},pop(a){e(()=>{t.pop({skipExitActiveState:$(a).skipActiveState})})}}),[t.push,t.replace,t.pop,o,e])}var Yt=J.default.forwardRef((t,o)=>{let{dispatchEvent:e,getStack:a}=I(),{push:p,pop:s,replace:r}=N();return J.default.useImperativeHandle(o,()=>({actions:{dispatchEvent:e,getStack:a,push:p,pop:s,replace:r}})),null}),Bt=Yt;function Zt(t){let o=Object.entries(t.activities).reduce((r,[n,i])=>k(f({},r),{[n]:C.default.memo(i)}),{});typeof window!="undefined"&&window.document.documentElement.style.setProperty("--stackflow-transition-duration",`${t.transitionDuration}ms`);let e={current:null},a=r=>`\`<Stack />\` component has not been mounted. Make sure you include \`<Stack />\` within your React tree. Or, make sure you call \`${r}()\` after it is rendered.`;return{Stack:r=>{var i;let n=(0,C.useMemo)(()=>{var c;return((c=t.plugins)!=null?c:[]).reduce((m,l)=>[...m,...Array.isArray(l)?l:[l]],[]).map(m=>m({initContext:r.initContext}))},[]);return C.default.createElement(dt,{value:(i=r.initContext)!=null?i:{}},C.default.createElement(xt,{value:n},C.default.createElement(St,{activities:o,initialActivity:t.initialActivity,transitionDuration:t.transitionDuration},C.default.createElement(It,{activities:o}),C.default.createElement(ht,null),C.default.createElement(Bt,{ref:e}))))},useFlow:N,actions:{dispatchEvent(r,n){if(!e.current)throw new Error(a("dispatchEvent"));return e.current.actions.dispatchEvent(r,n)},getStack(){if(!e.current)throw new Error(a("getStack"));return e.current.actions.getStack()},push(r,n,i){if(!e.current)throw new Error(a("push"));return e.current.actions.push(r,n,i)},pop(r){if(!e.current)throw new Error(a("pop"));return e.current.actions.pop(r)},replace(r,n,i){if(!e.current)throw new Error(a("replace"));return e.current.actions.replace(r,n,i)}}}} | ||
//# sourceMappingURL=index.js.map |
@@ -0,6 +1,8 @@ | ||
import type { StackflowPluginActions } from "@stackflow/core"; | ||
import React from "react"; | ||
import type { BaseActivities } from "./BaseActivities"; | ||
import type { StackflowReactPlugin } from "./StackflowReactPlugin"; | ||
import type { StackRefCurrentType } from "./StackRefManager"; | ||
import type { UseActionsOutputType } from "./useActions"; | ||
export declare type StackProps = { | ||
export interface StackProps { | ||
/** | ||
@@ -10,4 +12,5 @@ * Context data to pass to plugins in render time | ||
initContext?: {}; | ||
}; | ||
} | ||
export declare type StackComponentType = React.FC<StackProps>; | ||
export declare type StackRefType<T extends BaseActivities> = React.MutableRefObject<StackRefCurrentType<T> | null>; | ||
export declare type StackflowOptions<T extends BaseActivities> = { | ||
@@ -43,2 +46,6 @@ /** | ||
useFlow: () => UseActionsOutputType<T>; | ||
/** | ||
* Created action triggers | ||
*/ | ||
actions: Pick<StackflowPluginActions, "dispatchEvent" | "getStack"> & Pick<UseActionsOutputType<T>, "push" | "pop" | "replace">; | ||
}; | ||
@@ -45,0 +52,0 @@ /** |
{ | ||
"name": "@stackflow/react", | ||
"version": "0.14.0", | ||
"version": "0.14.1", | ||
"license": "MIT", | ||
@@ -52,3 +52,3 @@ "exports": { | ||
}, | ||
"gitHead": "4fb28179888fe8b5595ee3543c98cdb116a55429" | ||
"gitHead": "488a965bebd810fd83e8c25c629228fea939f804" | ||
} |
@@ -0,1 +1,2 @@ | ||
export * from "./CoreActionsContext"; | ||
export * from "./CoreProvider"; | ||
@@ -2,0 +3,0 @@ export * from "./CoreStateContext"; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
150282
81
1309