react-cosmos-ui 7.2.1-canary.e6e39db.0 → 7.3.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/Icon.d.ts +1 -1
- package/dist/components/Illustration.d.ts +1 -1
- package/dist/components/TreeView.d.ts +4 -3
- package/dist/components/ValueInputTree/ExpandCollapseValues.d.ts +2 -2
- 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.d.ts +2 -2
- package/dist/components/ValueInputTree/ValueInputTree.d.ts +2 -2
- package/dist/components/ValueInputTree/ValueInputTree.js +14 -15
- package/dist/components/ValueInputTree/index.d.ts +1 -1
- package/dist/components/ValueInputTree/shared.d.ts +1 -1
- package/dist/components/ValueInputTree/valueGroups.d.ts +1 -1
- package/dist/components/ValueInputTree/valueTree.d.ts +2 -2
- package/dist/components/ValueInputTree/valueTreeExpansion.d.ts +2 -2
- package/dist/components/ValueInputTree/valueTreeExpansion.js +1 -1
- package/dist/components/icons/index.d.ts +1 -1
- package/dist/components/inputs/Select.d.ts +1 -1
- package/dist/components/inputs/Select.js +1 -1
- package/dist/playground.bundle.js +4 -4
- package/dist/playground.bundle.js.map +1 -1
- package/dist/playground.d.ts +1 -1
- package/dist/playgroundConfig.d.ts +3 -3
- package/dist/plugins/ClassStatePanel/ClassStatePanel/ComponentClassState.d.ts +3 -3
- package/dist/plugins/ClassStatePanel/ClassStatePanel/ComponentClassState.js +1 -1
- package/dist/plugins/ClassStatePanel/ClassStatePanel/index.d.ts +3 -3
- package/dist/plugins/ClassStatePanel/ClassStatePanel/shared.d.ts +1 -1
- package/dist/plugins/ClassStatePanel/ClassStatePanel/shared.js +1 -1
- package/dist/plugins/ClassStatePanel/index.js +1 -1
- package/dist/plugins/ClassStatePanel/shared.d.ts +1 -1
- package/dist/plugins/FixtureBookmark/FixtureBookmarks.d.ts +1 -1
- package/dist/plugins/FixtureBookmark/FixtureBookmarks.js +1 -1
- package/dist/plugins/FixtureSearch/FixtureSearchOverlay.d.ts +1 -1
- package/dist/plugins/FixtureSearch/FixtureSearchResult.d.ts +1 -1
- package/dist/plugins/FixtureTree/FixtureSelectContext.d.ts +3 -2
- package/dist/plugins/FixtureTree/FixtureTree/FixtureButton.d.ts +2 -1
- package/dist/plugins/FixtureTree/FixtureTree/FixtureLink.d.ts +3 -2
- package/dist/plugins/FixtureTree/FixtureTree/FixtureTree.d.ts +4 -3
- package/dist/plugins/FixtureTree/FixtureTree/FixtureTree.js +17 -18
- package/dist/plugins/FixtureTree/FixtureTree/MultiFixtureButton.d.ts +3 -2
- package/dist/plugins/FixtureTree/FixtureTree/MultiFixtureChildButton.d.ts +3 -2
- package/dist/plugins/FixtureTree/FixtureTreeContainer.d.ts +2 -2
- package/dist/plugins/FixtureTree/FixtureTreeHeader.d.ts +2 -2
- package/dist/plugins/FixtureTree/revealFixture.d.ts +2 -2
- package/dist/plugins/FixtureTree/revealFixture.js +2 -2
- package/dist/plugins/FixtureTree/shared.d.ts +4 -4
- package/dist/plugins/FixtureTree/spec.d.ts +1 -1
- package/dist/plugins/FixtureTree/useScrollToSelected.d.ts +1 -1
- package/dist/plugins/InputsPanel/InputsPanel.d.ts +2 -2
- package/dist/plugins/InputsPanel/InputsPanel.js +1 -1
- package/dist/plugins/InputsPanel/shared.d.ts +1 -1
- package/dist/plugins/MessageHandler/shared.d.ts +2 -2
- package/dist/plugins/MessageHandler/socket.d.ts +2 -2
- package/dist/plugins/MessageHandler/socket.js +1 -1
- package/dist/plugins/MessageHandler/spec.d.ts +1 -1
- package/dist/plugins/Notifications/Notifications.d.ts +1 -1
- package/dist/plugins/Notifications/pushNotification.d.ts +2 -2
- package/dist/plugins/Notifications/pushNotification.js +1 -1
- package/dist/plugins/Notifications/shared.d.ts +2 -2
- package/dist/plugins/Notifications/spec.d.ts +1 -1
- package/dist/plugins/PropsPanel/PropsPanel/ComponentProps.d.ts +3 -3
- package/dist/plugins/PropsPanel/PropsPanel/index.d.ts +3 -3
- package/dist/plugins/PropsPanel/PropsPanel/shared.d.ts +1 -1
- package/dist/plugins/PropsPanel/PropsPanel/shared.js +1 -1
- package/dist/plugins/PropsPanel/index.js +1 -1
- package/dist/plugins/PropsPanel/shared.d.ts +1 -1
- package/dist/plugins/RemoteRenderer/RemoteButton/copyToClipboard.js +2 -2
- package/dist/plugins/RemoteRenderer/RemoteButton/index.d.ts +1 -1
- package/dist/plugins/RemoteRenderer/RemoteButton/index.js +2 -2
- package/dist/plugins/RemoteRenderer/shared.d.ts +2 -2
- package/dist/plugins/RendererCore/onRouterFixtureReselect.d.ts +2 -2
- package/dist/plugins/RendererCore/onRouterFixtureSelect.d.ts +2 -2
- package/dist/plugins/RendererCore/onRouterFixtureUnselect.d.ts +1 -1
- package/dist/plugins/RendererCore/receiveResponse/fixtureChange.d.ts +2 -2
- package/dist/plugins/RendererCore/receiveResponse/fixtureListUpdate.d.ts +2 -2
- package/dist/plugins/RendererCore/receiveResponse/fixtureStateChange.d.ts +2 -2
- package/dist/plugins/RendererCore/receiveResponse/index.d.ts +2 -2
- package/dist/plugins/RendererCore/receiveResponse/playgroundCommand.d.ts +2 -2
- package/dist/plugins/RendererCore/receiveResponse/pushStickyNotification.d.ts +2 -2
- package/dist/plugins/RendererCore/receiveResponse/pushTimedNotification.d.ts +2 -2
- package/dist/plugins/RendererCore/receiveResponse/removeStickyNotification.d.ts +2 -2
- package/dist/plugins/RendererCore/receiveResponse/rendererReady.d.ts +2 -2
- package/dist/plugins/RendererCore/reloadRenderer.d.ts +1 -1
- package/dist/plugins/RendererCore/setFixtureState.d.ts +2 -2
- package/dist/plugins/RendererCore/setFixtureState.js +1 -1
- package/dist/plugins/RendererCore/setGlobalFixtureState.d.ts +1 -1
- package/dist/plugins/RendererCore/shared/index.d.ts +2 -2
- package/dist/plugins/RendererCore/shared/postRequest.d.ts +2 -2
- package/dist/plugins/RendererCore/shared/router.d.ts +1 -1
- package/dist/plugins/RendererCore/spec.d.ts +1 -1
- package/dist/plugins/RendererPreview/RendererOverlay/RendererOverlay.d.ts +1 -1
- package/dist/plugins/RendererPreview/RendererPreview.d.ts +1 -1
- package/dist/plugins/RendererPreview/handleRendererRequests.d.ts +2 -2
- package/dist/plugins/RendererPreview/handleRendererRequests.js +1 -1
- package/dist/plugins/RendererPreview/handleWindowMessages.d.ts +1 -1
- package/dist/plugins/RendererPreview/shared.d.ts +2 -2
- package/dist/plugins/ResponsivePreview/ResponsivePreview/ResponsiveHeader.d.ts +2 -2
- package/dist/plugins/ResponsivePreview/ResponsivePreview/ResponsivePreview.d.ts +4 -3
- package/dist/plugins/ResponsivePreview/ResponsivePreview/ResponsivePreview.js +1 -1
- package/dist/plugins/ResponsivePreview/ResponsivePreview/style.d.ts +1 -1
- package/dist/plugins/ResponsivePreview/shared.d.ts +4 -4
- package/dist/plugins/ResponsivePreview/spec.d.ts +1 -1
- package/dist/plugins/Root/ControlPanel.d.ts +2 -2
- package/dist/plugins/Root/RendererHeader.d.ts +1 -1
- package/dist/plugins/Root/Root.d.ts +2 -2
- package/dist/plugins/Root/persistentState/controlPanelOpen.d.ts +1 -1
- package/dist/plugins/Root/persistentState/controlPanelWidth.d.ts +1 -1
- package/dist/plugins/Root/persistentState/drawerPanels.d.ts +1 -1
- package/dist/plugins/Root/persistentState/navPanelOpen.d.ts +1 -1
- package/dist/plugins/Root/persistentState/navPanelWidth.d.ts +1 -1
- package/dist/plugins/Root/shared.d.ts +2 -2
- package/dist/plugins/Router/spec.d.ts +1 -1
- package/dist/plugins/SelectInput/SelectValueInput.d.ts +1 -1
- package/dist/plugins/StandardInput/storage.d.ts +3 -3
- package/dist/shared/fixtureTree.d.ts +1 -1
- package/dist/shared/treeExpansion.d.ts +1 -1
- package/dist/shared/url.d.ts +1 -1
- package/dist/slots/ControlPanelRowSlot.d.ts +2 -2
- package/dist/slots/FixtureActionSlot.d.ts +1 -1
- package/dist/slots/InputSlot.d.ts +1 -1
- package/dist/slots/InputsActionSlot.d.ts +1 -1
- package/dist/slots/RendererActionSlot.d.ts +1 -1
- package/dist/slots/ValueInputSlot.d.ts +3 -2
- package/dist/testHelpers/pluginHelpers.d.ts +1 -1
- package/dist/testHelpers/pluginHelpers.js +1 -1
- package/dist/testHelpers/pluginMocks.d.ts +50 -50
- package/dist/testHelpers/pluginMocks.js +1 -1
- package/package.json +3 -3
- package/tsconfig.build.tsbuildinfo +1 -0
- package/dist/tsconfig.build.tsbuildinfo +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { TreeNode } from 'react-cosmos-core';
|
|
4
|
+
import type { TreeExpansion } from '../shared/treeExpansion.js';
|
|
4
5
|
type Props<Item> = {
|
|
5
6
|
node: TreeNode<Item>;
|
|
6
7
|
name?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FixtureStateValues } from 'react-cosmos-core';
|
|
3
|
-
import { TreeExpansion } from '../../shared/treeExpansion.js';
|
|
2
|
+
import type { FixtureStateValues } from 'react-cosmos-core';
|
|
3
|
+
import type { TreeExpansion } from '../../shared/treeExpansion.js';
|
|
4
4
|
type Props = {
|
|
5
5
|
values: FixtureStateValues;
|
|
6
6
|
expansion: TreeExpansion;
|
|
@@ -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),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { PrimitiveData } from 'react-cosmos-core';
|
|
3
|
-
import { LeafValue } from '../shared.js';
|
|
2
|
+
import type { PrimitiveData } from 'react-cosmos-core';
|
|
3
|
+
import type { LeafValue } from '../shared.js';
|
|
4
4
|
type Props = {
|
|
5
5
|
value: LeafValue;
|
|
6
6
|
name: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FixtureStateValues } from 'react-cosmos-core';
|
|
3
|
-
import { TreeExpansion } from '../../shared/treeExpansion.js';
|
|
2
|
+
import type { FixtureStateValues } from 'react-cosmos-core';
|
|
3
|
+
import type { TreeExpansion } from '../../shared/treeExpansion.js';
|
|
4
4
|
type Props = {
|
|
5
5
|
id: string;
|
|
6
6
|
values: FixtureStateValues;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { setByPath
|
|
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';
|
|
@@ -8,20 +8,19 @@ import { ValueInputDir } from './ValueInputDir.js';
|
|
|
8
8
|
import { createValueTree } from './valueTree.js';
|
|
9
9
|
export const ValueInputTree = React.memo(function ValueInputTree({ id, values, expansion, setExpansion, onValueChange, }) {
|
|
10
10
|
const rootNode = createValueTree(values);
|
|
11
|
-
return (React.createElement(Container, null,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} })));
|
|
11
|
+
return (React.createElement(Container, null, React.createElement(TreeView, { node: rootNode, expansion: expansion, setExpansion: setExpansion, renderNode: ({ node, name, parents, expanded, onToggle }) => {
|
|
12
|
+
const { data, children } = node;
|
|
13
|
+
if (data.type === 'item') {
|
|
14
|
+
return (React.createElement(ValueInput, { value: data.value, name: name, id: getInputId(id, parents, name), indentLevel: parents.length, onChange: newData => onValueChange(setValueAtPath(values, { type: 'primitive', data: newData }, getValuePath(name, parents))) }));
|
|
15
|
+
}
|
|
16
|
+
if (children) {
|
|
17
|
+
const childKeys = Object.keys(children);
|
|
18
|
+
return (React.createElement(ValueInputDir, { name: name, childrenText: getChildrenText(childKeys, data.isArray), disabled: childKeys.length === 0, expanded: expanded, indentLevel: parents.length, onToggle: onToggle }));
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
} })));
|
|
25
24
|
});
|
|
26
25
|
function getInputId(treeId, parents, name) {
|
|
27
26
|
return `${treeId}-${[...parents, name].join('-')}`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { stringifyElementId } from './shared.js';
|
|
2
2
|
export { hasFsValues, sortFsValueGroups } from './valueGroups.js';
|
|
3
3
|
export { ValueInputTree } from './ValueInputTree.js';
|
|
4
|
-
export { FixtureExpansion, FixtureExpansionGroup, OnElementExpansionChange, getFixtureExpansion, updateElementExpansion, } from './valueTreeExpansion.js';
|
|
4
|
+
export { type FixtureExpansion, type FixtureExpansionGroup, type OnElementExpansionChange, getFixtureExpansion, updateElementExpansion, } from './valueTreeExpansion.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FixtureElementId, FixtureStatePrimitiveValue, FixtureStateUnserializableValue, TreeNode } from 'react-cosmos-core';
|
|
1
|
+
import type { FixtureElementId, FixtureStatePrimitiveValue, FixtureStateUnserializableValue, TreeNode } from 'react-cosmos-core';
|
|
2
2
|
export type LeafValue = FixtureStatePrimitiveValue | FixtureStateUnserializableValue;
|
|
3
3
|
export type ValueNodeData = {
|
|
4
4
|
type: 'collection';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { FixtureStateValues } from 'react-cosmos-core';
|
|
2
|
-
import { ValueNode } from './shared.js';
|
|
1
|
+
import type { FixtureStateValues } from 'react-cosmos-core';
|
|
2
|
+
import type { ValueNode } from './shared.js';
|
|
3
3
|
export declare function createValueTree(values: FixtureStateValues, isArray?: boolean): ValueNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FixtureElementId, FixtureId } from 'react-cosmos-core';
|
|
2
|
-
import { TreeExpansion } from '../../shared/treeExpansion.js';
|
|
1
|
+
import type { FixtureElementId, FixtureId } from 'react-cosmos-core';
|
|
2
|
+
import type { TreeExpansion } from '../../shared/treeExpansion.js';
|
|
3
3
|
export type FixtureExpansion = Record<string, void | TreeExpansion>;
|
|
4
4
|
export type FixtureExpansionGroup = Record<string, void | FixtureExpansion>;
|
|
5
5
|
export type OnElementExpansionChange = (elementId: FixtureElementId, treeExpansion: TreeExpansion) => unknown;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { IconProps } from '../Icon.js';
|
|
2
|
+
import type { IconProps } from '../Icon.js';
|
|
3
3
|
export declare const ChevronLeftIcon: () => React.JSX.Element;
|
|
4
4
|
export declare const ChevronRightIcon: () => React.JSX.Element;
|
|
5
5
|
export declare const ChevronDownIcon: () => React.JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { useFocus } from '../../hooks/useFocus.js';
|
|
4
|
-
import { isGroupedOptions
|
|
4
|
+
import { isGroupedOptions } from '../../shared/groupedOptions.js';
|
|
5
5
|
import { blue, grey32 } from '../../style/colors.js';
|
|
6
6
|
import { ChevronDownIcon } from '../icons/index.js';
|
|
7
7
|
const CUSTOM_LABEL = 'Custom';
|