react-cosmos-core 6.0.0-beta.4 → 6.0.0-beta.7
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.
|
@@ -18,9 +18,13 @@ export function collapseNamedIndexes(treeNode) {
|
|
|
18
18
|
return next();
|
|
19
19
|
const [firstGrandchildName] = grandchildNames;
|
|
20
20
|
const firstGrandchildNode = grandchildren[firstGrandchildName];
|
|
21
|
+
const isUnnamed = firstGrandchildName === 'fixture';
|
|
21
22
|
if (firstGrandchildNode.data.type !== 'fileDir' &&
|
|
22
|
-
noCaseEqual(childName, firstGrandchildName))
|
|
23
|
-
return {
|
|
23
|
+
(noCaseEqual(childName, firstGrandchildName) || isUnnamed))
|
|
24
|
+
return {
|
|
25
|
+
...newChildren,
|
|
26
|
+
[isUnnamed ? childName : firstGrandchildName]: firstGrandchildNode,
|
|
27
|
+
};
|
|
24
28
|
return next();
|
|
25
29
|
}, {}),
|
|
26
30
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export type RawCosmosPluginConfig = {
|
|
2
2
|
name: string;
|
|
3
|
-
ui?: string;
|
|
4
3
|
server?: string;
|
|
4
|
+
ui?: string;
|
|
5
5
|
};
|
|
6
6
|
export type CosmosPluginConfig = {
|
|
7
7
|
name: string;
|
|
8
8
|
rootDir: string;
|
|
9
|
-
ui?: string;
|
|
10
9
|
server?: string;
|
|
10
|
+
ui?: string;
|
|
11
11
|
};
|
|
12
12
|
export type UiCosmosPluginConfig = CosmosPluginConfig & {
|
|
13
13
|
ui: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isEqual } from 'lodash-es';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
// Compied from https://github.com/skidding/react-mock/blob/c33dfa1d6f0c9ce7b3eaba073618d61731a0e82e/packages/state/src/index.js
|
|
4
|
-
class ClassStateMock extends React.Component {
|
|
4
|
+
export class ClassStateMock extends React.Component {
|
|
5
5
|
static cosmosCapture = false;
|
|
6
6
|
childRef = null;
|
|
7
7
|
render() {
|
|
@@ -42,7 +42,6 @@ class ClassStateMock extends React.Component {
|
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
export { ClassStateMock };
|
|
46
45
|
function replaceState(childRef, state, cb) {
|
|
47
46
|
// We need to unset existing state keys because React doesn't provide a
|
|
48
47
|
// replaceState method (anymore)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-cosmos-core",
|
|
3
|
-
"version": "6.0.0-beta.
|
|
3
|
+
"version": "6.0.0-beta.7",
|
|
4
4
|
"description": "React Cosmos Core",
|
|
5
5
|
"repository": "https://github.com/react-cosmos/react-cosmos/tree/main/packages/react-cosmos-core",
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
"lodash-es": "^4.17.21",
|
|
13
13
|
"react-is": "^18.2.0"
|
|
14
14
|
},
|
|
15
|
-
"gitHead": "
|
|
15
|
+
"gitHead": "0d57027263ffb3d55fa1feb31db3640db2e89cc9"
|
|
16
16
|
}
|