react-cosmos-ui 6.0.0-beta.2 → 6.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.
- package/dist/playground.bundle.js +5 -5
- package/dist/playground.bundle.js.map +1 -1
- package/dist/plugins/RendererPreview/RendererPreview.js +1 -1
- package/dist/plugins/Root/navOpen.js +1 -1
- package/dist/plugins/Root/panelOpen.js +1 -1
- package/dist/plugins/Router/index.js +8 -1
- package/dist/plugins/Router/spec.d.ts +3 -0
- package/package.json +3 -3
|
@@ -12,7 +12,7 @@ export const RendererPreview = React.memo(function RendererPreview({ rendererUrl
|
|
|
12
12
|
}
|
|
13
13
|
return (React.createElement(Slot, { name: "rendererPreviewOuter" },
|
|
14
14
|
React.createElement(Container, null,
|
|
15
|
-
React.createElement(Iframe, { "data-testid": "previewIframe", ref: onIframeRef, src: createRendererUrl(rendererUrl), frameBorder: 0, allow: "clipboard-write
|
|
15
|
+
React.createElement(Iframe, { "data-testid": "previewIframe", ref: onIframeRef, src: createRendererUrl(rendererUrl), frameBorder: 0, allow: "clipboard-write *; fullscreen *;" }),
|
|
16
16
|
React.createElement(RendererOverlay, { runtimeStatus: runtimeStatus }))));
|
|
17
17
|
});
|
|
18
18
|
const Container = styled.div `
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const NAV_OPEN_STORAGE_KEY = 'navOpen';
|
|
2
|
-
const NAV_OPEN_DEFAULT =
|
|
2
|
+
const NAV_OPEN_DEFAULT = window.innerWidth >= 640;
|
|
3
3
|
export function isNavOpen(context) {
|
|
4
4
|
const storage = context.getMethodsOf('storage');
|
|
5
5
|
const open = storage.getItem(NAV_OPEN_STORAGE_KEY);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const PANEL_OPEN_STORAGE_KEY = 'sidePanelOpen';
|
|
2
|
-
const PANEL_OPEN_DEFAULT =
|
|
2
|
+
const PANEL_OPEN_DEFAULT = window.innerWidth >= 960;
|
|
3
3
|
export function isPanelOpen(context) {
|
|
4
4
|
const storage = context.getMethodsOf('storage');
|
|
5
5
|
const open = storage.getItem(PANEL_OPEN_STORAGE_KEY);
|
|
@@ -3,6 +3,9 @@ import { createPlugin } from 'react-plugin';
|
|
|
3
3
|
import { getUrlParams, pushUrlParams, subscribeToLocationChanges, } from '../../shared/url.js';
|
|
4
4
|
const { onLoad, register } = createPlugin({
|
|
5
5
|
name: 'router',
|
|
6
|
+
defaultConfig: {
|
|
7
|
+
initialFixtureId: null,
|
|
8
|
+
},
|
|
6
9
|
initialState: {
|
|
7
10
|
urlParams: {},
|
|
8
11
|
},
|
|
@@ -13,8 +16,12 @@ const { onLoad, register } = createPlugin({
|
|
|
13
16
|
},
|
|
14
17
|
});
|
|
15
18
|
onLoad(context => {
|
|
16
|
-
const { setState } = context;
|
|
19
|
+
const { getConfig, setState } = context;
|
|
17
20
|
setState({ urlParams: getUrlParams() });
|
|
21
|
+
const { initialFixtureId } = getConfig();
|
|
22
|
+
if (initialFixtureId) {
|
|
23
|
+
selectFixture(context, initialFixtureId);
|
|
24
|
+
}
|
|
18
25
|
return subscribeToLocationChanges((urlParams) => {
|
|
19
26
|
const { fixtureId } = context.getState().urlParams;
|
|
20
27
|
const fixtureChanged = !isEqual(urlParams.fixtureId, fixtureId);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-cosmos-ui",
|
|
3
|
-
"version": "6.0.0-beta.
|
|
3
|
+
"version": "6.0.0-beta.4",
|
|
4
4
|
"description": "React Cosmos UI",
|
|
5
5
|
"repository": "https://github.com/react-cosmos/react-cosmos/tree/main/packages/react-cosmos-ui",
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"lodash-es": "^4.17.21",
|
|
18
|
-
"react-cosmos-core": "6.0.0-beta.
|
|
18
|
+
"react-cosmos-core": "6.0.0-beta.4"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"fuzzaldrin-plus": "^0.6.0",
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"react-plugin": "^3.0.0-alpha.4",
|
|
24
24
|
"styled-components": "^5.3.10"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "e2cf7cc4fdfb1f82715f6848b0b8cbca8397e036"
|
|
27
27
|
}
|