react-cosmos-ui 7.2.0 → 7.2.1-canary.3822d76.0
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/components/ValueInputTree/ValueInput/BooleanValueInput.d.ts +1 -1
- package/dist/components/ValueInputTree/ValueInput/BooleanValueInput.js +1 -1
- package/dist/components/ValueInputTree/ValueInput/ValueInput.js +1 -1
- package/dist/components/ValueInputTree/ValueInputTree.js +2 -3
- package/dist/components/ValueInputTree/valueTreeExpansion.js +7 -7
- package/dist/playground.bundle.js +295 -295
- package/dist/playground.bundle.js.map +1 -1
- package/dist/plugins/ClassStatePanel/ClassStatePanel/ComponentClassState.js +3 -4
- package/dist/plugins/Core/index.js +1 -2
- package/dist/plugins/FixtureBookmark/FixtureBookmarks.js +7 -3
- package/dist/plugins/FixtureBookmark/index.js +1 -1
- package/dist/plugins/FixtureSearch/FixtureSearchHeader.js +1 -1
- package/dist/plugins/FixtureSearch/FixtureSearchOverlay.js +1 -2
- package/dist/plugins/InputsPanel/InputsPanel.js +3 -3
- package/dist/plugins/PropsPanel/PropsPanel/ComponentProps.js +3 -4
- package/dist/plugins/RemoteRenderer/RemoteButton/copyToClipboard.js +2 -2
- package/dist/plugins/RemoteRenderer/RemoteButton/index.js +2 -2
- package/dist/plugins/RendererCore/receiveResponse/fixtureStateChange.js +1 -1
- package/dist/plugins/RendererCore/receiveResponse/rendererReady.js +1 -1
- package/dist/plugins/RendererPreview/handleRendererRequests.js +1 -1
- package/dist/plugins/RendererPreview/index.js +1 -1
- package/dist/plugins/ResponsivePreview/ResponsivePreview/ResponsiveHeader.js +1 -1
- package/dist/plugins/ResponsivePreview/ResponsivePreview/ResponsivePreview.js +1 -1
- package/dist/plugins/ResponsivePreview/index.js +1 -1
- package/dist/plugins/Root/RendererHeader.js +1 -1
- package/dist/plugins/Root/index.js +1 -1
- package/dist/plugins/Router/index.js +1 -1
- package/dist/plugins/SelectInput/SelectValueInput.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -4
|
@@ -5,5 +5,5 @@ type Props = {
|
|
|
5
5
|
data: boolean;
|
|
6
6
|
onChange: (data: boolean) => unknown;
|
|
7
7
|
};
|
|
8
|
-
export declare function BooleanValueInput({
|
|
8
|
+
export declare function BooleanValueInput({ name, data, onChange }: Props): React.JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { blue, lightBlue } from '../../../style/colors.js';
|
|
4
4
|
import { Label, ValueDataContainer } from './shared.js';
|
|
5
|
-
export function BooleanValueInput({
|
|
5
|
+
export function BooleanValueInput({ name, data, onChange }) {
|
|
6
6
|
const onToggle = React.useCallback(() => onChange(!data), [onChange, data]);
|
|
7
7
|
return (React.createElement(React.Fragment, null,
|
|
8
8
|
React.createElement(Label, { title: name, as: "span", onClick: onToggle }, name),
|
|
@@ -4,10 +4,10 @@ import { ValueTreeItem } from '../shared.js';
|
|
|
4
4
|
import { BooleanValueInput } from './BooleanValueInput.js';
|
|
5
5
|
import { NullValueInput } from './NullValueInput.js';
|
|
6
6
|
import { NumberValueInput } from './NumberValueInput.js';
|
|
7
|
+
import { ValueInputContainer } from './shared.js';
|
|
7
8
|
import { StringValueInput } from './StringValueInput.js';
|
|
8
9
|
import { UndefinedValueInput } from './UndefinedValueInput.js';
|
|
9
10
|
import { UnserializableValueInput } from './UnserializableValueInput.js';
|
|
10
|
-
import { ValueInputContainer } from './shared.js';
|
|
11
11
|
export function ValueInput({ value, name, id, indentLevel, onChange }) {
|
|
12
12
|
return (React.createElement(ValueInputSlot, { slotProps: { id, name, value, indentLevel, onChange } },
|
|
13
13
|
React.createElement(ValueTreeItem, { indentLevel: indentLevel },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { clone, setWith } from 'lodash-es';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import { setByPath, } from 'react-cosmos-core';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { grey248, grey32 } from '../../style/colors.js';
|
|
5
5
|
import { TreeView } from '../TreeView.js';
|
|
@@ -30,8 +30,7 @@ function getValuePath(valueKey, parentKeys) {
|
|
|
30
30
|
return [...parentKeys.map(p => `${p}.values`), valueKey].join('.');
|
|
31
31
|
}
|
|
32
32
|
function setValueAtPath(values, newValue, valuePath) {
|
|
33
|
-
|
|
34
|
-
return setWith(clone(values), valuePath, newValue, clone);
|
|
33
|
+
return setByPath(values, valuePath, newValue);
|
|
35
34
|
}
|
|
36
35
|
function getChildrenText(childKeys, isArray) {
|
|
37
36
|
if (childKeys.length > 0) {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { clone, setWith } from 'lodash-es';
|
|
2
1
|
import { stringifyFixtureId, } from 'react-cosmos-core';
|
|
3
2
|
import { stringifyElementId } from './shared.js';
|
|
4
3
|
const DEFAULT_EXPANSION = {};
|
|
@@ -6,12 +5,13 @@ export function getFixtureExpansion(groupExpansion, fixtureId) {
|
|
|
6
5
|
return groupExpansion[stringifyFixtureId(fixtureId)] || DEFAULT_EXPANSION;
|
|
7
6
|
}
|
|
8
7
|
export function updateElementExpansion(groupExpansion, fixtureId, elementId, treeExpansion) {
|
|
9
|
-
const valuePath = createElementExpansionPath(fixtureId, elementId);
|
|
10
|
-
// Inspired by https://github.com/lodash/lodash/issues/1696#issuecomment-328335502
|
|
11
|
-
return setWith(clone(groupExpansion), valuePath, treeExpansion, clone);
|
|
12
|
-
}
|
|
13
|
-
function createElementExpansionPath(fixtureId, elementId) {
|
|
14
8
|
const strFixtureId = stringifyFixtureId(fixtureId);
|
|
15
9
|
const strElementId = stringifyElementId(elementId);
|
|
16
|
-
return
|
|
10
|
+
return {
|
|
11
|
+
...groupExpansion,
|
|
12
|
+
[strFixtureId]: {
|
|
13
|
+
...groupExpansion[strFixtureId],
|
|
14
|
+
[strElementId]: treeExpansion,
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
17
|
}
|