@plurid/plurid-react 0.0.0-28 → 0.0.0-29
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/distribution/components/structural/Roots/index.d.ts +2 -1
- package/distribution/containers/RouterBrowser/FadeIn/index.d.ts +5 -0
- package/distribution/containers/RouterBrowser/FadeIn/styled.d.ts +3 -0
- package/distribution/index.es.js +35 -7
- package/distribution/index.es.js.map +1 -1
- package/distribution/index.js +35 -7
- package/distribution/index.js.map +1 -1
- package/distribution/index.min.js +24 -15
- package/distribution/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
`,Gt=o.connect((e=>({stateTree:Ot.space.getTree(e)})),(e=>({})),null,{context:Ge})((e=>{const{plane:a,stateTree:n}=e,{location:o}=a,i=r.useContext(He);if(!i)return x.default.createElement(x.default.Fragment,null);const{planesRegistrar:l,planeContext:s,planeContextValue:c,customPlane:u,matchedRoute:d,defaultPubSub:f}=i,p=u,m=e=>{if(!e.children||0===e.children.length)return[];const t=[],a=ie(l);return e.children.forEach((e=>{if(!a)return;const n=e.sourceID,r=a.get(n);if(r){const a=()=>{const t=r.component,a={plane:{value:r.route.absolute,planeID:e.planeID,parentPlaneID:e.parentPlaneID,fragments:r.route.fragments,parameters:r.route.parameters,query:r.route.query},route:{value:(null==d?void 0:d.match.value)||"",parameters:(null==d?void 0:d.match.parameters)||{},query:(null==d?void 0:d.match.query)||{}},pubSub:f},n={plurid:Object.assign({},a),key:"plurid-plane-"+e.planeID},o=Zt(t),i=Zt(p),l={key:"plurid-plane-child-"+e.planeID,plane:r,treePlane:e,planeID:e.planeID,location:e.location};return p&&i?x.default.createElement(p,Object.assign({},l)):o?x.default.createElement(Kt,Object.assign({},l),s?x.default.createElement(s.Provider,{value:c},x.default.createElement(t,Object.assign({},n))):x.default.createElement(t,Object.assign({},n))):x.default.createElement(x.default.Fragment,null)},n=a();t.push(n)}if(e.children){const a=m(e);a&&t.push(...a)}})),t},g=r.useMemo((()=>m(a)),[JSON.stringify(a),JSON.stringify(n)]),h=a.sourceID;if(!h)return x.default.createElement(x.default.Fragment,null);const T=se(h,l);if(!T)return x.default.createElement(x.default.Fragment,null);const E=T.component,v={plane:{value:T.route.absolute,planeID:a.planeID,parentPlaneID:a.parentPlaneID,fragments:T.route.fragments,parameters:T.route.parameters,query:T.route.query},route:{value:(null==d?void 0:d.match.value)||"",parameters:(null==d?void 0:d.match.parameters)||{},query:(null==d?void 0:d.match.query)||{}},pubSub:f},S={plurid:Object.assign({},v),key:"plurid-plane-"+a.planeID};return p?"function"!=typeof p?x.default.createElement(x.default.Fragment,null):x.default.createElement(jt,{"data-plurid-entity":t.PLURID_ENTITY_ROOT},x.default.createElement(p,{plane:T,treePlane:a,planeID:a.planeID,location:o}),g):x.default.createElement(jt,{"data-plurid-entity":t.PLURID_ENTITY_ROOT},x.default.createElement(Kt,{plane:T,treePlane:a,planeID:a.planeID,location:o},s?x.default.createElement(s.Provider,{value:c},x.default.createElement(E,Object.assign({},S))):x.default.createElement(E,Object.assign({},S))),g)})),Wt=M.default.div`
|
|
119
119
|
transform-style: preserve-3d;
|
|
120
120
|
transform-origin: 0 0 0;
|
|
121
|
-
`,Ht=o.connect((e=>({stateConfiguration:Ot.configuration.getConfiguration(e),spaceTransformMatrix:Ot.space.getTransformMatrix(e),spaceAnimatedTransform:Ot.space.getAnimatedTransform(e),spaceTransformTime:Ot.space.getTransformTime(e),stateTree:Ot.space.getTree(e)})),(e=>({})),null,{context:Ge})((e=>{const{spaceTransformMatrix:a,spaceAnimatedTransform:n,spaceTransformTime:r,stateTree:o}=e
|
|
121
|
+
`,Ht=o.connect((e=>({stateConfiguration:Ot.configuration.getConfiguration(e),spaceTransformMatrix:Ot.space.getTransformMatrix(e),spaceAnimatedTransform:Ot.space.getAnimatedTransform(e),spaceTransformTime:Ot.space.getTransformTime(e),stateTree:Ot.space.getTree(e),stateResolvedLayout:Ot.space.getResolvedLayout(e)})),(e=>({})),null,{context:Ge})((e=>{const{spaceTransformMatrix:a,spaceAnimatedTransform:n,spaceTransformTime:r,stateTree:o,stateResolvedLayout:i}=e,l=i?window.innerHeight+"px":0,s=n?`transform ${r}ms ease-in-out`:"initial";return x.default.createElement(Wt,{style:{width:"100%",height:l,transition:s,transform:a},"data-plurid-entity":t.PLURID_ENTITY_ROOTS},o.map((e=>x.default.createElement(Gt,{key:e.planeID,plane:e}))))})),qt=M.default.div`
|
|
122
122
|
position: relative;
|
|
123
123
|
height: 100%;
|
|
124
124
|
overflow: hidden;
|
|
@@ -499,7 +499,16 @@
|
|
|
499
499
|
`,_n=(e,n,r,o,i="origin")=>{if(o||"RoutePlane"===(null==e?void 0:e.kind)){const t=o||e;if(!t)return()=>()=>x.default.createElement(x.default.Fragment,null);return Ln(t,n,i)}if(!e){const e=r.match("/not-found","route");if(e&&"Route"===e.kind){return _n(e,n,r,void 0,i)}return()=>()=>x.default.createElement(x.default.Fragment,null)}const{exterior:s,view:c,planes:u,spaces:d,defaultConfiguration:f,slotted:p,resolver:m}=e.data;m&&m(void 0);const g={value:e.match.value,parameters:e.match.parameters,query:e.match.query};let h;return Zt(s)&&(h=s,h&&(h.displayName="PluridRouteExterior")),!s||!h||c||u||d?c?()=>{const t=new D.default,a=e.data.value,r=x.default.createElement(On,{view:c,planesRegistrar:n,configuration:f,pubsub:t,matchedRoute:e,hostname:i,space:a});return()=>x.default.createElement(x.default.Fragment,null,h&&x.default.createElement(h,{plurid:g,pubsub:t,spaces:p?[r]:void 0}),!p&&x.default.createElement(x.default.Fragment,null,r))}:((e,n="origin")=>{var r,o,i,s,c,u;if("Route"!==e.kind)return()=>()=>x.default.createElement(x.default.Fragment,null);const d="http",f=n,{match:p,data:m}=e,{parameters:g,query:h}=p,T={value:p.value,parameters:g,query:h},{exterior:E,planes:v,spaces:S,slotted:P}=e.data,b=(null===(r=m.multispace)||void 0===r?void 0:r.alignment)||"y",R=(null===(o=m.multispace)||void 0===o?void 0:o.snapType)||"mandatory";let I=()=>x.default.createElement(x.default.Fragment,null);Zt(E)&&(I=E);let C=()=>x.default.createElement(x.default.Fragment,null);const w=[];if(S)for(const e of S){const r=[],o=[];if(e.planes)for(const n of e.planes){const i=ce(n),{component:l}=i,s=[d,f,m.value===t.PLURID_ROUTE_DEFAULT_PATH_VALUE?t.PLURID_ROUTE_DEFAULT_PATH:a.utilities.cleanPathElement(m.value),e.value===t.PLURID_ROUTE_DEFAULT_SPACE_VALUE?t.PLURID_ROUTE_DEFAULT_SPACE:a.utilities.cleanPathElement(e.value),t.PLURID_ROUTE_DEFAULT_UNIVERSE,t.PLURID_ROUTE_DEFAULT_CLUSTER,a.utilities.cleanPathElement(i.value)].join(t.PLURID_ROUTE_SEPARATOR),c={component:l,route:s};r.push(c),o.push(s)}if(e.universes)for(const n of e.universes)if(n.planes)for(const i of n.planes){const l=ce(i),{component:s}=l,c=[d,f,m.value===t.PLURID_ROUTE_DEFAULT_PATH_VALUE?t.PLURID_ROUTE_DEFAULT_PATH:a.utilities.cleanPathElement(m.value),e.value===t.PLURID_ROUTE_DEFAULT_SPACE_VALUE?t.PLURID_ROUTE_DEFAULT_SPACE:a.utilities.cleanPathElement(e.value),n.value===t.PLURID_ROUTE_DEFAULT_UNIVERSE_VALUE?t.PLURID_ROUTE_DEFAULT_UNIVERSE:a.utilities.cleanPathElement(n.value),t.PLURID_ROUTE_DEFAULT_CLUSTER,a.utilities.cleanPathElement(l.value)].join(t.PLURID_ROUTE_SEPARATOR),u={component:s,route:c};r.push(u),o.push(c)}const i=new de([],"localhost:63000"),s=x.default.createElement(On,{key:l.uuid.generate(),id:m.value,planes:r,view:o,configuration:e.configuration,planesRegistrar:i,hostname:n});w.push(s)}if(v){const e=[],r=[];for(const n of v){const o=ce(n),{component:i}=o,l=[d,f,m.value===t.PLURID_ROUTE_DEFAULT_PATH_VALUE?t.PLURID_ROUTE_DEFAULT_PATH:a.utilities.cleanPathElement(m.value),t.PLURID_ROUTE_DEFAULT_SPACE,t.PLURID_ROUTE_DEFAULT_UNIVERSE,t.PLURID_ROUTE_DEFAULT_CLUSTER,a.utilities.cleanPathElement(o.value)].join(t.PLURID_ROUTE_SEPARATOR),s={component:i,route:l};e.push(s),m.view?m.view.includes(o.value)&&r.push(l):r.push(l)}const o=x.default.createElement(On,{key:l.uuid.generate(),id:m.value,planes:e,view:r,configuration:m.defaultConfiguration,hostname:n});w.push(o)}let O,y;return Zt(null===(i=m.multispace)||void 0===i?void 0:i.header)&&(O=null===(s=m.multispace)||void 0===s?void 0:s.header),Zt(null===(c=m.multispace)||void 0===c?void 0:c.footer)&&(y=null===(u=m.multispace)||void 0===u?void 0:u.footer),C=()=>x.default.createElement(yn,{alignment:b,snapType:R,"data-plurid-entity":t.PLURID_ENTITY_MULTISPACE},O&&x.default.createElement(O,{plurid:T}),w,y&&x.default.createElement(y,{plurid:T})),()=>()=>x.default.createElement(x.default.Fragment,null,E&&x.default.createElement(I,{spaces:P?w:void 0,plurid:T}),(S||v)&&!P&&x.default.createElement(C,null))})(e):()=>()=>x.default.createElement(x.default.Fragment,null,h&&x.default.createElement(h,{plurid:g}))},Ln=(e,t,a="origin")=>{if(e.match.query.flat){const a=e.match.query.flat.toLowerCase();if("true"===a||"1"===a){const a=t.get(e.match.value);if(a){const e=a.component;if("function"!=typeof e)return()=>()=>x.default.createElement(x.default.Fragment,null);return()=>()=>x.default.createElement(x.default.Fragment,null,x.default.createElement(e,null))}}}const{defaultConfiguration:n}=null==e?void 0:e.data;return()=>()=>x.default.createElement(x.default.Fragment,null,x.default.createElement(On,{view:[e.match.value],planesRegistrar:t,configuration:n,hostname:a}))},An=M.default.div`
|
|
500
500
|
height: 0;
|
|
501
501
|
width: 0;
|
|
502
|
-
`,Un=
|
|
502
|
+
`,Un=M.default.div`
|
|
503
|
+
position: absolute;
|
|
504
|
+
top: 0;
|
|
505
|
+
left: 0;
|
|
506
|
+
right: 0;
|
|
507
|
+
bottom: 0;
|
|
508
|
+
background-color: black;
|
|
509
|
+
pointer-events: none;
|
|
510
|
+
z-index: 999999;
|
|
511
|
+
`,Dn=e=>{const[t,a]=r.useState(!1);return r.useEffect((()=>{setTimeout((()=>{a(!0)}),10)}),[]),t?x.default.createElement(x.default.Fragment,null):x.default.createElement(Un,null)},xn=e=>{const{routes:a,planes:n,exterior:o,shell:i,hostname:s,scrollToTop:c,static:d,view:f,cleanNavigation:p,notFoundPath:m}=e,g=m||"/not-found",h=((e,t)=>{const a=[];for(const t of e){if(t.planes)for(const e of t.planes){const n=ce(e),r={route:n.link?n.link:n.value.startsWith("/")?n.value:t.value+"/"+n.value,component:n.component};a.push(r)}t.spaces}if(t)for(const e of t){const t=ce(e),n={route:t.value,component:t.component};a.push(n)}return a})(a,n),T=r.useRef(null),E=r.useRef(new de(h,s)),v=r.useRef(new fe({routes:a,routePlanes:n},s)),S=u.useMounted(),[P,b]=r.useState((e=>e?e.path:"undefined"!=typeof window?window.location.pathname+window.location.search:"/")(d)),[R,I]=r.useState(v.current.match(P,"route")),[C,w]=r.useState(_n(R,E.current,v.current,d&&d.directPlane?v.current.match(d.directPlane,"route"):void 0,s)),O=e=>{let t;e&&e.detail&&e.detail.path&&!t&&(t=e.detail.path),p&&f&&!t&&(t=f);const a=window.location.pathname;t||(t=a+window.location.search),b(t),(()=>{if(!T.current||!1===c)return;const e=void 0===c||!0===c||"smooth"===c?"smooth":"auto";T.current.scrollIntoView({behavior:e})})()};let y;r.useEffect((()=>(window.addEventListener("popstate",O),window.addEventListener(t.PLURID_ROUTER_LOCATION_CHANGED,O),()=>{window.removeEventListener("popstate",O),window.removeEventListener(t.PLURID_ROUTER_LOCATION_CHANGED,O)})),[]),r.useEffect((()=>{if(!S)return;p||location.pathname!==P&&history.pushState(null,"",P);let e=v.current.match(P,"route");if(e&&"RoutePlane"===e.kind){const t=Ln(e,E.current,s);return I(e),void w(t)}e||(e=v.current.match(g,"route")),I(e),w(_n(e,E.current,v.current,void 0,s))}),[S,P]),r.useEffect((()=>{if(!R)return;if("Route"!==R.kind)return;const e=R.match.value;l.storage.saveState(e,t.PLURID_ROUTER_STORAGE);const a=new CustomEvent(t.PLURID_ROUTER_LOCATION_STORED,{detail:{path:e}});window.dispatchEvent(a)}),[p,R]),Zt(o)&&(y=o,y&&(y.displayName="PluridRouterExterior"));let _=({children:e})=>x.default.createElement(x.default.Fragment,null,e);return Zt(i)&&(_=i,_&&(_.displayName="PluridRouterShell")),x.default.createElement(x.default.Fragment,null,x.default.createElement(Dn,null),x.default.createElement(An,{ref:T}),y&&x.default.createElement(y,{matchedRoute:R}),x.default.createElement(_,{matchedRoute:R},x.default.createElement(C,null)))},Nn=e=>{const{path:t,directPlane:a,routes:n,planes:r,exterior:o,shell:i,protocol:l,hostname:s,gateway:c,gatewayQuery:u,gatewayEndpoint:d}=e,f=l||"http",p=s||"origin";return x.default.createElement(xn,{routes:n,planes:r,exterior:o,shell:i,static:{path:t,directPlane:a},protocol:f,hostname:p})};class Mn extends r.Component{constructor(e){super(e),this.properties=e}render(){const{metastate:e,children:t}=this.properties;return x.default.createElement(F.Provider,{value:e},t)}}Mn.displayName="PluridProvider";const kn={x:0,y:0},Fn=e=>{const{elementID:t,rootID:a,children:n}=e,r=u.usePortal(t,a);return p.createPortal(n,r)},Bn=M.default.div`
|
|
503
512
|
position: absolute;
|
|
504
513
|
min-width: 600px;
|
|
505
514
|
min-height: 300px;
|
|
@@ -509,7 +518,7 @@
|
|
|
509
518
|
left: ${({linkCoordinates:e})=>e.x+5+"px"};
|
|
510
519
|
background-color: ${({theme:e})=>e.backgroundColorSecondary};
|
|
511
520
|
box-shadow: ${({theme:e})=>e.boxShadowUmbra};
|
|
512
|
-
`,
|
|
521
|
+
`,Yn=o.connect((e=>({stateGeneralTheme:Ot.themes.getGeneralTheme(e),stateInteractionTheme:Ot.themes.getInteractionTheme(e)})),(e=>({})),null,{context:Ge})((e=>{const{planeRoute:t,linkCoordinates:a,previewComponent:n,previewOffsetX:o,previewOffsetY:i,stateGeneralTheme:l}=e,s={x:a.x+(null!=o?o:0),y:a.y+(null!=i?i:0)},c=r.useContext(He);if(!c)return x.default.createElement(x.default.Fragment,null);const{planesRegistrar:u}=c,d=ie(u);if(!d)return x.default.createElement(x.default.Fragment,null);const f=d.get(t);if(!f)return x.default.createElement(x.default.Fragment,null);const p=null!=n?n:f.component;return"function"!=typeof p?x.default.createElement(x.default.Fragment,null):x.default.createElement(Bn,{theme:l,linkCoordinates:s},x.default.createElement(p,null))})),$n=M.default.a`
|
|
513
522
|
/**
|
|
514
523
|
* Forces element to go to the second row if inlined.
|
|
515
524
|
*/
|
|
@@ -525,7 +534,7 @@
|
|
|
525
534
|
::after {
|
|
526
535
|
content: "${({devisible:e,suffix:t})=>e?"":t||"'"}";
|
|
527
536
|
}
|
|
528
|
-
`,
|
|
537
|
+
`,Xn=o.connect((e=>({stateTree:Ot.space.getTree(e),stateLastClosedPlane:Ot.space.getLastClosedPlane(e),stateGeneralTheme:Ot.themes.getGeneralTheme(e),stateConfiguration:Ot.configuration.getConfiguration(e),stateViewSize:Ot.space.getViewSize(e)})),(e=>({dispatch:e,dispatchSetTree:t=>e(qe.space.setTree(t)),dispatchSetSpaceField:t=>e(qe.space.setSpaceField(t)),dispatchUpdateSpaceLinkCoordinates:t=>e(qe.space.updateSpaceLinkCoordinates(t))})),null,{context:Ge})((e=>{const n=r.useContext(He);if(!n)return x.default.createElement(x.default.Fragment,null,e.children);const{hostname:o,planesRegistrar:i,defaultPubSub:s}=n,c=ie(i);if(!c)return x.default.createElement(x.default.Fragment,null,e.children);const{children:d,route:f,devisible:p,suffix:m,atClick:g,style:h,className:T,preview:E,previewComponent:v,previewFadeIn:S,previewFadeOut:P,previewOffsetX:b,previewOffsetY:R,stateTree:I,stateLastClosedPlane:C,stateGeneralTheme:w,stateConfiguration:O,stateViewSize:y,dispatch:_,dispatchSetTree:L,dispatchSetSpaceField:A,dispatchUpdateSpaceLinkCoordinates:U}=e,D=O.elements.plane.controls.show,N=S||t.PLURID_DEFAULT_CONFIGURATION_LINK_PREVIEW_FADE_IN,M=P||t.PLURID_DEFAULT_CONFIGURATION_LINK_PREVIEW_FADE_OUT,k=me(f),F=pe(k,O.network.protocol,o||O.network.host),B=null!=m?m:t.PLURID_DEFAULT_CONFIGURATION_LINK_SUFFIX,Y=null!=p&&p,$=r.useRef(null),X=r.useRef(null),V=r.useRef(null),[z,K]=r.useState(!1),[Z,j]=r.useState(!1),[G,W]=r.useState(!1),[H,q]=r.useState(""),[J,Q]=r.useState(le($.current)),[ee,te]=r.useState(kn),ae=()=>{const e=$.current;if(!e)return Object.assign({},kn);let t=0,a=0,n=!1,r=e,o=!0,i=0,l=0;for(;o;)if("static"!==window.getComputedStyle(r).position||n||(t+=r.offsetTop,a+=r.offsetLeft,n=!0),"relative"===window.getComputedStyle(r).position&&(i+=t,l+=a,t=0,a=0,n=!1),r.scrollLeft&&(l+=-r.scrollLeft),r.scrollTop&&(i+=-r.scrollTop),r.parentElement){"PluridPlane"===r.parentElement.dataset.pluridEntity&&(o=!1),r=r.parentElement}else o=!1;const s=D?56:0;return{x:l+e.offsetWidth,y:i+s}},ne=u.useDebouncedCallback((()=>{(()=>{const e=ae();U({planeID:H,linkCoordinates:e});const t=a.space.tree.logic.updatePlaneLocation(l.objects.clone(I),J,H,l.objects.clone(e));L(t)})()}),t.PLURID_DEFAULT_RESIZE_DEBOUNCE_TIME),re=e=>{const{updatedTree:t,updatedPlane:n}=a.space.tree.logic.togglePlaneFromTree(l.objects.clone(I),H,e);return L(t),W((e=>!e)),j(!1),{updatedPlane:n}},oe=(e,t)=>{t&&(G||(A({field:"isolatePlane",value:""}),Et(_,t,e)))},se=e=>{if(e.altKey&&G&&H){const t=a.space.tree.logic.getTreePlaneByID(I,H);Et(_,t,e)}else G||H?(e=>{const{updatedPlane:t}=re();oe(e,t)})(e):(e=>{if(!J||!F)return;const{route:t}=F,n=ae(),{pluridPlaneID:r,updatedTree:i,updatedTreePlane:s}=a.space.tree.logic.updateTreeWithNewPlane(t,J,n,l.objects.clone(I),c.getAll(),O,o);r&&(oe(e,s),L(i),W(!0),q(r))})(e)},ce=()=>{$.current&&$.current.blur()},ue=r.useCallback((e=>{e.preventDefault(),void 0!==g&&g(e),se(e),ce()}),[J,JSON.stringify(I),$.current]);return r.useEffect((()=>{const e=le($.current);Q(e);const t=ae();te(t)}),[]),r.useEffect((()=>{G&&ne()}),[G,JSON.stringify(y),JSON.stringify(I)]),r.useEffect((()=>{if(E)return z&&V.current&&(X.current=setTimeout((()=>{j(!0)}),N),clearTimeout(V.current)),z||(V.current=setTimeout((()=>{j(!1),X.current&&clearTimeout(X.current)}),M)),()=>{V.current&&clearTimeout(V.current),X.current&&clearTimeout(X.current)}}),[E,z]),r.useEffect((()=>{}),[]),r.useEffect((()=>{const e=s.subscribe({topic:t.PLURID_PUBSUB_TOPIC.OPEN_CLOSED_PLANE,callback:()=>{C===H&&(re(),A({field:"lastClosedPlane",value:""}))}});return()=>{s.unsubscribe(e)}}),[G,H,JSON.stringify(I)]),r.useEffect((()=>{const e=s.subscribe({topic:t.PLURID_PUBSUB_TOPIC.CLOSE_PLANE,callback:e=>{const{id:t}=e;if(t===H&&G){re(!1),A({field:"lastClosedPlane",value:t})}}});return()=>{s.unsubscribe(e)}}),[G,H,JSON.stringify(I)]),r.useEffect((()=>()=>{G&&null===$.current&&(()=>{const e=a.space.tree.logic.removePlaneFromTree(l.objects.clone(I),H);L(e),W((e=>!e)),j(!1)})()}),[G,Z,H,J,JSON.stringify(I)]),x.default.createElement($n,{ref:$,onClick:e=>ue(e),onMouseEnter:()=>K(!0),onMouseLeave:()=>K(!1),onKeyUp:e=>(e=>{if("Enter"===e.code)return ue(e),void ce()})(e),theme:w,suffix:B,devisible:Y,style:Object.assign({},h),className:T,"data-plurid-entity":t.PLURID_ENTITY_LINK,tabIndex:0},d,Z&&!G&&x.default.createElement(Fn,{elementID:`preview-${J}`,rootID:J},x.default.createElement(Yn,{planeRoute:k,linkCoordinates:ee,previewComponent:v,previewOffsetX:b,previewOffsetY:R})))})),Vn=c.css`
|
|
529
538
|
color: ${({theme:e})=>e.colorTertiary};
|
|
530
539
|
|
|
531
540
|
@media (hover:hover) {
|
|
@@ -533,27 +542,27 @@
|
|
|
533
542
|
color: ${({theme:e})=>e.colorPrimary};
|
|
534
543
|
}
|
|
535
544
|
}
|
|
536
|
-
`,
|
|
537
|
-
${
|
|
538
|
-
`,
|
|
545
|
+
`,zn=M.default.a`
|
|
546
|
+
${Vn}
|
|
547
|
+
`,Kn=M.default.div`
|
|
539
548
|
cursor: pointer;
|
|
540
549
|
|
|
541
|
-
${
|
|
542
|
-
`,
|
|
550
|
+
${Vn}
|
|
551
|
+
`,Zn=e=>{const{route:t,children:n,asAnchor:r,target:o,theme:i,style:l,className:c,atClick:u}=e,d=null==r||r,f=i||s.plurid,p=e=>{if(u){if(u(e))return}e.preventDefault(),"_blank"!==o?a.pluridRouterNavigate(t):window.open(t)},m={tabIndex:0,theme:f,style:l,className:c,onClick:p,onKeyUp:e=>{"Enter"!==e.code||p(e)}};return d?x.default.createElement(zn,Object.assign({href:t},m),n):x.default.createElement(Kn,Object.assign({},m),n)},jn=M.default.div`
|
|
543
552
|
position: absolute;
|
|
544
553
|
height: 0;
|
|
545
554
|
width: 0;
|
|
546
555
|
user-select: none;
|
|
547
556
|
pointer-events: none;
|
|
548
|
-
`,
|
|
557
|
+
`,Gn=o.connect((e=>({stateConfiguration:Ot.configuration.getConfiguration(e)})),(e=>({dispatchSetConfiguration:t=>e(qe.configuration.setConfiguration(t))})),null,{context:Ge})((e=>{const n=r.useContext(He);if(!n)return x.default.createElement(x.default.Fragment,null);const{registerPubSub:o}=n,{configuration:i,pubsub:l,stateConfiguration:s,dispatchSetConfiguration:c}=e,u=r.useRef(null);return r.useEffect((()=>{const e=a.general.configuration.merge(i,s);c(e)}),[i]),r.useEffect((()=>{l&&o(l)}),[l]),x.default.createElement(jn,{ref:u,"data-plurid-entity":t.PLURID_ENTITY_APPLICATION_CONFIGURATOR})})),Wn=M.default.div`
|
|
549
558
|
position: absolute;
|
|
550
559
|
height: 0;
|
|
551
560
|
width: 0;
|
|
552
561
|
user-select: none;
|
|
553
562
|
pointer-events: none;
|
|
554
|
-
`,{getPluridPlaneIDByData:
|
|
555
|
-
`,
|
|
556
|
-
`,
|
|
557
|
-
`,
|
|
558
|
-
`,
|
|
563
|
+
`,{getPluridPlaneIDByData:Hn}=a.planes,qn=o.connect((e=>({})),(e=>({})),null,{context:Ge})((e=>{const a=r.useRef(null),[n,o]=r.useState("");return r.useEffect((()=>{const e=Hn(a.current);o(e)}),[]),x.default.createElement(Wn,{ref:a,"data-plurid-entity":t.PLURID_ENTITY_PLANE_CONFIGURATOR})})),Jn=M.default.div`
|
|
564
|
+
`,Qn=o.connect((e=>({stateGeneralTheme:Ot.themes.getGeneralTheme(e),stateInteractionTheme:Ot.themes.getInteractionTheme(e)})),(e=>({})),null,{context:Ge})((e=>{const{plurid:t}=e,a=t.value,n=r.useRef(!1),[o,i]=r.useState();return r.useEffect((()=>(n.current=!0,()=>{n.current=!1}))),r.useEffect((()=>{let e=!1;We(void 0,void 0,void 0,(function*(){if(!e){e=!0;try{const{domain:e,url:t}=(e=>{const t=e.match(/^pttp:\/\/(\w+(\.|:)\w+)\/?/);if(!t)return{domain:"",url:""};const a=t[1];return{domain:a,url:`http://${a}/pttp`}})(a),r=((e,t)=>{if(e)return t.replace(`pttp://${e}`,"")})(e,a);if(!t||!r)return;const o=yield((e,t)=>We(void 0,void 0,void 0,(function*(){try{const a=yield k.default(e,{method:"post",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({path:t}),credentials:"include"}),n=yield a.json();if(!n.element)return;const{element:r}=n,o=new g.ElementQLClient({url:r.url}),{status:i,Elements:l}=yield o.get(r.json,"json");if(!i)return;const s=l[r.name];return()=>s}catch(e){return}})))(t,r);if(!n.current)return;o&&i(o)}catch(e){return}}}))}),[]),x.default.createElement(Jn,null,o&&x.default.createElement(o,null))})),er=M.default.div`
|
|
565
|
+
`,tr=o.connect((e=>({stateGeneralTheme:Ot.themes.getGeneralTheme(e),stateInteractionTheme:Ot.themes.getInteractionTheme(e)})),(e=>({})),null,{context:Ge})((e=>{const{plurid:t}=e,a=t.value;return x.default.createElement(er,null,x.default.createElement("iframe",{src:a}))})),ar=e=>{const{top:t,index:a,element:n,setHeight:o}=e,i=r.useRef(null);return r.useEffect((()=>{i.current&&o(i.current.offsetHeight,a)}),[i.current]),x.default.createElement("div",{ref:i,style:{position:"absolute",top:t+"px"}},n)},{markers:{Spinner:nr}}=f.universal,rr=o.connect((e=>({translationY:Ot.space.getTranslationY(e),viewSize:Ot.space.getViewSize(e)})),(e=>({})),null,{context:Ge})((e=>{const{items:t,generalHeight:a,translationY:n,viewSize:o}=e,i=a||100,s=r.useRef(null),c=r.useRef([]),u=r.useRef(Array(t.length).fill(i)),[d,f]=r.useState(0),[p,m]=r.useState(Math.floor(1e3/i)),[g,h]=r.useState(i*(p-d)),[T,E]=r.useState(!1),v=(e,t)=>{u.current[t]=e};return r.useEffect((()=>{if(u.current){const e=l.mathematics.arithmetic.sum(u.current,u.current.length);h(e)}}),[d,p,u.current]),r.useEffect((()=>{let e=0;for(const[t,a]of u.current.entries())e+=a,n<0?(e<Math.abs(n)&&f(t),e>Math.abs(n)+o.height&&e<Math.abs(n)+o.height+400&&m(t)):(f(0),m(10))}),[o.height,n]),r.useEffect((()=>{E(!0),setTimeout((()=>{const e=l.mathematics.arithmetic.sum(u.current,u.current.length);h(e),E(!1)}),400)}),[o]),x.default.createElement("div",{style:{height:g},ref:s},T&&x.default.createElement(x.default.Fragment,null,x.default.createElement(nr,null)),!T&&x.default.createElement(x.default.Fragment,null,(()=>{c.current=[];for(let e=d;e<=p;e++){const a=t[e];c.current.push(x.default.createElement(ar,{key:e+Math.random(),index:e,top:l.mathematics.arithmetic.sum(u.current,e),element:a,setHeight:v}))}return c.current})()))})),or=M.default.div`
|
|
566
|
+
`,ir=o.connect((e=>({stateGeneralTheme:Ot.themes.getGeneralTheme(e),stateInteractionTheme:Ot.themes.getInteractionTheme(e)})),(e=>({})),null,{context:Ge})((e=>x.default.createElement(or,null,"PluridPlaneDebugger"))),lr=M.default.div`
|
|
567
|
+
`,sr=o.connect((e=>({stateGeneralTheme:Ot.themes.getGeneralTheme(e),stateInteractionTheme:Ot.themes.getInteractionTheme(e)})),(e=>({})),null,{context:Ge})((e=>x.default.createElement(lr,null,"PluridSpaceDebugger"))),cr=(e,n,r,o="origin")=>We(void 0,void 0,void 0,(function*(){const n=yield((e,n,r,o)=>We(void 0,void 0,void 0,(function*(){const n={planes:[],spaces:[],view:[],value:""};let r;if("Route"===e.kind){let t=e.data;r=t.defaultConfiguration,e.data.resolver&&(t=yield e.data.resolver(o)),n.planes=t.planes||[],n.spaces=t.spaces||[],n.view=t.view||[],n.value=e.data.value||""}const{planes:i,spaces:l,view:s}=n,c=[];if(l)for(const e of l){const o=[],i=[];if(e.planes)for(const r of e.planes){const o=ce(r);n.value===t.PLURID_ROUTE_DEFAULT_PATH_VALUE?t.PLURID_ROUTE_DEFAULT_PATH:a.utilities.cleanPathElement(n.value),e.value===t.PLURID_ROUTE_DEFAULT_SPACE_VALUE?t.PLURID_ROUTE_DEFAULT_SPACE:a.utilities.cleanPathElement(e.value),a.utilities.cleanPathElement(o.value)}if(e.universes)for(const r of e.universes){if(r.clusters)for(const o of r.clusters)for(const i of o.planes){const l=ce(i);n.value===t.PLURID_ROUTE_DEFAULT_PATH_VALUE?t.PLURID_ROUTE_DEFAULT_PATH:a.utilities.cleanPathElement(n.value),e.value===t.PLURID_ROUTE_DEFAULT_SPACE_VALUE?t.PLURID_ROUTE_DEFAULT_SPACE:a.utilities.cleanPathElement(e.value),r.value===t.PLURID_ROUTE_DEFAULT_UNIVERSE_VALUE?t.PLURID_ROUTE_DEFAULT_UNIVERSE:a.utilities.cleanPathElement(r.value),o.value===t.PLURID_ROUTE_DEFAULT_CLUSTER_VALUE?t.PLURID_ROUTE_DEFAULT_CLUSTER:a.utilities.cleanPathElement(o.value),a.utilities.cleanPathElement(l.value)}if(r.planes)for(const o of r.planes){const i=ce(o);n.value===t.PLURID_ROUTE_DEFAULT_PATH_VALUE?t.PLURID_ROUTE_DEFAULT_PATH:a.utilities.cleanPathElement(n.value),e.value===t.PLURID_ROUTE_DEFAULT_SPACE_VALUE?t.PLURID_ROUTE_DEFAULT_SPACE:a.utilities.cleanPathElement(e.value),r.value===t.PLURID_ROUTE_DEFAULT_UNIVERSE_VALUE?t.PLURID_ROUTE_DEFAULT_UNIVERSE:a.utilities.cleanPathElement(r.value),a.utilities.cleanPathElement(i.value)}}const l={planes:o,view:i,configuration:r};c.push(l)}if(i){const e=[];for(const r of i){const o=ce(r),{value:i,component:l}=o;n.value===t.PLURID_ROUTE_DEFAULT_PATH_VALUE?t.PLURID_ROUTE_DEFAULT_PATH:a.utilities.cleanPathElement(n.value),a.utilities.cleanPathElement(o.value);const s={component:l,route:i};e.push(s)}const o={planes:e,view:s,configuration:r};c.push(o)}return c})))(e,0,0,r),i={};for(const t of n){const{planes:a,view:n,configuration:r}=t,{computedTree:l,appConfiguration:s}=ht(a,e.data.defaultConfiguration,n,o),c={configuration:Object.assign({},s),shortcuts:{global:!0},themes:{general:N.default.plurid,interaction:N.default.plurid},ui:{toolbarScrollPosition:50},space:{loading:!1,resolvedLayout:!1,animatedTransform:!1,transform:"matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)",scale:1,rotationX:0,rotationY:0,translationX:0,translationY:0,translationZ:0,tree:l,activeUniverseID:"",camera:{x:0,y:0,z:0},viewSize:{width:1440,height:821},spaceSize:{width:1440,height:821,depth:0,topCorner:{x:0,y:0,z:0}},view:n,culledView:[]}};i[e.data.value]=c}return{states:i}})),{IsoMatcher:ur,RouteParser:dr}=a.routing,fr={PluridPlaneBridge:xt,PluridPlaneContent:zt,PluridPlaneControls:Xt,PluridPlaneDebugger:ir,PluridSpaceDebugger:sr},pr={Application:On,RouterStatic:Nn,RouterBrowser:xn,Provider:Mn,Link:Xn,RouterLink:Zn,ApplicationConfigurator:Gn,PlaneConfigurator:qn,ExternalPlane:Qn,IframePlane:tr,VirtualList:rr,SPACE_LAYOUT:t.LAYOUT_TYPES,SIZES:t.SIZES,TRANSFORM_MODES:t.TRANSFORM_MODES,TRANSFORM_TOUCHES:t.TRANSFORM_TOUCHES,PubSub:D.default,PUBSUB_TOPIC:t.PLURID_PUBSUB_TOPIC,serverComputeMetastate:cr,IsoMatcher:ur,routerNavigate:a.pluridRouterNavigate,internals:fr};Object.defineProperty(e,"PLURID_PUBSUB_TOPIC",{enumerable:!0,get:function(){return t.PLURID_PUBSUB_TOPIC}}),Object.defineProperty(e,"PLURID_ROUTER_LOCATION_CHANGED",{enumerable:!0,get:function(){return t.PLURID_ROUTER_LOCATION_CHANGED}}),Object.defineProperty(e,"PLURID_ROUTER_LOCATION_STORED",{enumerable:!0,get:function(){return t.PLURID_ROUTER_LOCATION_STORED}}),Object.defineProperty(e,"SIZES",{enumerable:!0,get:function(){return t.SIZES}}),Object.defineProperty(e,"SPACE_LAYOUT",{enumerable:!0,get:function(){return t.LAYOUT_TYPES}}),Object.defineProperty(e,"TRANSFORM_MODES",{enumerable:!0,get:function(){return t.TRANSFORM_MODES}}),Object.defineProperty(e,"TRANSFORM_TOUCHES",{enumerable:!0,get:function(){return t.TRANSFORM_TOUCHES}}),Object.defineProperty(e,"pluridRouterNavigate",{enumerable:!0,get:function(){return a.pluridRouterNavigate}}),Object.defineProperty(e,"PluridPubSub",{enumerable:!0,get:function(){return D.default}}),e.PluridApplication=On,e.PluridApplicationConfigurator=Gn,e.PluridExternalPlane=Qn,e.PluridIframePlane=tr,e.PluridIsoMatcher=ur,e.PluridLink=Xn,e.PluridPlaneConfigurator=qn,e.PluridProvider=Mn,e.PluridRouteParser=dr,e.PluridRouterBrowser=xn,e.PluridRouterLink=Zn,e.PluridRouterStatic=Nn,e.PluridVirtualList=rr,e.default=pr,e.getDirectPlaneMatch=(e,t,a)=>{let n,r,o;for(const a of t){if(a.planes)for(const t of a.planes){const n=ce(t),i="/"===a.value?n.value:a.value+n.value;if(o=i,e===i){r=t;break}}if(r){n=a;break}}if(a)for(const t of a){if(e===ce(t).value){r=t;break}}return{matchRoute:n,matchPlane:r,matchPath:o}},e.internals=fr,e.pluridStateModules=Ke,e.serverComputeMetastate=cr,e.usePluridRouter=()=>{const[e,a]=r.useState("");return r.useEffect((()=>{const e=()=>{const e=l.storage.loadState(t.PLURID_ROUTER_STORAGE);e&&a(e)};return e(),window.addEventListener(t.PLURID_ROUTER_LOCATION_STORED,e),()=>{window.removeEventListener(t.PLURID_ROUTER_LOCATION_STORED,e)}}),[]),e}}(D);var x,N=(x=D)&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,"default")?x.default:x;exports.default=N;
|
|
559
568
|
//# sourceMappingURL=index.min.js.map
|