react-cosmos-ui 7.0.0-beta.1 → 7.0.0-beta.4
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.
|
@@ -484,6 +484,7 @@
|
|
|
484
484
|
background: ${Do};
|
|
485
485
|
overflow-x: hidden;
|
|
486
486
|
overflow-y: auto;
|
|
487
|
+
color-scheme: light;
|
|
487
488
|
`,pu=Le.div`
|
|
488
489
|
padding: 8px 0;
|
|
489
490
|
`,hu=Le.div`
|
|
@@ -824,6 +825,7 @@
|
|
|
824
825
|
margin: 0;
|
|
825
826
|
padding: 0;
|
|
826
827
|
border: 0;
|
|
828
|
+
color-scheme: normal;
|
|
827
829
|
`,qs="renderer-location-change";function Qs(e,t){if(0===t.indexOf("http")&&!t.match(window.location.origin))return!1;try{const{href:n}=e.location;return!n.startsWith(t.replace(/\.html$/,""))}catch(e){return!0}}function Ks(e){return e.getMethodsOf("notifications")}function Gs(e){const t=function(e){return t=>{if(!function(e){return!e.data.source&&e.data.type&&e.data.payload}(t))return;const n=e.getMethodsOf("rendererCore"),r=t.data;n.receiveResponse(r),function({getState:e,setState:t,getMethodsOf:n},r){const{runtimeStatus:o}=e();if("rendererError"===r.type&&n("notifications").pushTimedNotification({id:"renderer-error",type:"error",title:"Renderer error",info:"Check the browser console for details."}),"connected"!==o)switch(r.type){case"rendererReady":return t((e=>({...e,runtimeStatus:"connected"})));case"rendererError":t((e=>({...e,runtimeStatus:"error"})))}}(e,r),"rendererReady"===r.type&&n.selectPrimaryRenderer(r.payload.rendererId)}}(e);return window.addEventListener("message",t,!1),()=>{window.removeEventListener("message",t,!1)}}const{postRendererRequest:Ys,setIframeRef:Xs}=function(){let e=null;return{postRendererRequest:function(t,n){if(!e)return;const{iframeRef:r}=e;if(r.contentWindow){const e=r.contentWindow;"selectFixture"===n.type&&Qs(e,r.src)?(Ks(t).removeStickyNotification(qs),e.location.replace(r.src)):e.postMessage(n,"*")}},setIframeRef:function(t,n){e&&e.iframeRef.removeEventListener("load",e.onIframeLoad),n?(e={iframeRef:n,onIframeLoad(e){const n=e.target,r=n.contentWindow;if(r){const e=Ks(t);Qs(r,n.src)?e.pushStickyNotification({id:qs,type:"info",title:"Renderer iframe location changed",info:"Select a fixture to reset your preview."}):e.removeStickyNotification(qs)}}},n.addEventListener("load",e.onIframeLoad)):e=null}}}(),{onLoad:Js,on:Zs,plug:ef,register:tf}=(0,o.createPlugin)({name:"rendererPreview",defaultConfig:{backgroundColor:"#fff"},initialState:{runtimeStatus:"pending"},methods:{getRuntimeStatus:function({getState:e}){return e().runtimeStatus}}});function nf({getMethodsOf:e}){return e("rendererCore").getRendererUrl()}function rf({getMethodsOf:e}){return e("rendererCore").isRendererConnected()}Zs("rendererCore",{request:Ys}),Js((e=>nf(e)?[Gs(e)]:null)),ef("rendererPreview",(({pluginContext:t})=>e.createElement(Ws,{rendererUrl:nf(t),rendererConnected:rf(t),runtimeStatus:t.getState().runtimeStatus,backgroundColor:t.getConfig().backgroundColor,onIframeRef:function(e){Xs(t,e)}}))),tf();const{plug:of,register:af}=(0,o.createPlugin)({name:"rendererSelect"});of("controlPanelRow",(({pluginContext:t})=>{const{getMethodsOf:n}=t,r=n("rendererCore"),o=r.getPrimaryRendererId(),a=r.getConnectedRendererIds();return o?e.createElement(lf,null,a.map((t=>e.createElement("li",{key:t},e.createElement("small",{onClick:()=>r.selectPrimaryRenderer(t),style:{cursor:"pointer",fontWeight:t===o?"bold":"normal"}},t))))):null})),af();const lf=Le.ul`
|
|
828
830
|
padding: 8px 12px;
|
|
829
831
|
list-style: none;
|
|
@@ -1001,7 +1003,7 @@
|
|
|
1001
1003
|
background: ${Ao};
|
|
1002
1004
|
overflow-x: hidden;
|
|
1003
1005
|
overflow-y: auto;
|
|
1004
|
-
`;function ld(){return e.createElement(ud,null,e.createElement(cd,null,e.createElement(sd,{href:"https://github.com/react-cosmos/react-cosmos/releases",label:"v7.0.0-beta.
|
|
1006
|
+
`;function ld(){return e.createElement(ud,null,e.createElement(cd,null,e.createElement(sd,{href:"https://github.com/react-cosmos/react-cosmos/releases",label:"v7.0.0-beta.3",title:"Releases"}),e.createElement(sd,{icon:e.createElement(Ta,null),href:"https://reactcosmos.org/docs/user-interface",title:"Documentation"}),e.createElement(sd,{icon:e.createElement(Ba,null),href:"https://discord.gg/3X95VgfnW5",title:"Discord"})))}const ud=Le.div`
|
|
1005
1007
|
position: absolute;
|
|
1006
1008
|
top: 0;
|
|
1007
1009
|
bottom: 0;
|
|
@@ -1142,6 +1144,7 @@
|
|
|
1142
1144
|
font-size: 14px;
|
|
1143
1145
|
-webkit-font-smoothing: antialiased;
|
|
1144
1146
|
-webkit-text-size-adjust: none;
|
|
1147
|
+
color-scheme: dark;
|
|
1145
1148
|
}
|
|
1146
1149
|
|
|
1147
1150
|
body, p, ul, ol, li, h1, h2, h3, button, input, textarea, select {
|