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.
Files changed (129) hide show
  1. package/dist/components/Icon.d.ts +1 -1
  2. package/dist/components/Illustration.d.ts +1 -1
  3. package/dist/components/TreeView.d.ts +4 -3
  4. package/dist/components/ValueInputTree/ExpandCollapseValues.d.ts +2 -2
  5. package/dist/components/ValueInputTree/ValueInput/BooleanValueInput.d.ts +1 -1
  6. package/dist/components/ValueInputTree/ValueInput/BooleanValueInput.js +1 -1
  7. package/dist/components/ValueInputTree/ValueInput/ValueInput.d.ts +2 -2
  8. package/dist/components/ValueInputTree/ValueInputTree.d.ts +2 -2
  9. package/dist/components/ValueInputTree/ValueInputTree.js +14 -15
  10. package/dist/components/ValueInputTree/index.d.ts +1 -1
  11. package/dist/components/ValueInputTree/shared.d.ts +1 -1
  12. package/dist/components/ValueInputTree/valueGroups.d.ts +1 -1
  13. package/dist/components/ValueInputTree/valueTree.d.ts +2 -2
  14. package/dist/components/ValueInputTree/valueTreeExpansion.d.ts +2 -2
  15. package/dist/components/ValueInputTree/valueTreeExpansion.js +1 -1
  16. package/dist/components/icons/index.d.ts +1 -1
  17. package/dist/components/inputs/Select.d.ts +1 -1
  18. package/dist/components/inputs/Select.js +1 -1
  19. package/dist/playground.bundle.js +4 -4
  20. package/dist/playground.bundle.js.map +1 -1
  21. package/dist/playground.d.ts +1 -1
  22. package/dist/playgroundConfig.d.ts +3 -3
  23. package/dist/plugins/ClassStatePanel/ClassStatePanel/ComponentClassState.d.ts +3 -3
  24. package/dist/plugins/ClassStatePanel/ClassStatePanel/ComponentClassState.js +1 -1
  25. package/dist/plugins/ClassStatePanel/ClassStatePanel/index.d.ts +3 -3
  26. package/dist/plugins/ClassStatePanel/ClassStatePanel/shared.d.ts +1 -1
  27. package/dist/plugins/ClassStatePanel/ClassStatePanel/shared.js +1 -1
  28. package/dist/plugins/ClassStatePanel/index.js +1 -1
  29. package/dist/plugins/ClassStatePanel/shared.d.ts +1 -1
  30. package/dist/plugins/FixtureBookmark/FixtureBookmarks.d.ts +1 -1
  31. package/dist/plugins/FixtureBookmark/FixtureBookmarks.js +1 -1
  32. package/dist/plugins/FixtureSearch/FixtureSearchOverlay.d.ts +1 -1
  33. package/dist/plugins/FixtureSearch/FixtureSearchResult.d.ts +1 -1
  34. package/dist/plugins/FixtureTree/FixtureSelectContext.d.ts +3 -2
  35. package/dist/plugins/FixtureTree/FixtureTree/FixtureButton.d.ts +2 -1
  36. package/dist/plugins/FixtureTree/FixtureTree/FixtureLink.d.ts +3 -2
  37. package/dist/plugins/FixtureTree/FixtureTree/FixtureTree.d.ts +4 -3
  38. package/dist/plugins/FixtureTree/FixtureTree/FixtureTree.js +17 -18
  39. package/dist/plugins/FixtureTree/FixtureTree/MultiFixtureButton.d.ts +3 -2
  40. package/dist/plugins/FixtureTree/FixtureTree/MultiFixtureChildButton.d.ts +3 -2
  41. package/dist/plugins/FixtureTree/FixtureTreeContainer.d.ts +2 -2
  42. package/dist/plugins/FixtureTree/FixtureTreeHeader.d.ts +2 -2
  43. package/dist/plugins/FixtureTree/revealFixture.d.ts +2 -2
  44. package/dist/plugins/FixtureTree/revealFixture.js +2 -2
  45. package/dist/plugins/FixtureTree/shared.d.ts +4 -4
  46. package/dist/plugins/FixtureTree/spec.d.ts +1 -1
  47. package/dist/plugins/FixtureTree/useScrollToSelected.d.ts +1 -1
  48. package/dist/plugins/InputsPanel/InputsPanel.d.ts +2 -2
  49. package/dist/plugins/InputsPanel/InputsPanel.js +1 -1
  50. package/dist/plugins/InputsPanel/shared.d.ts +1 -1
  51. package/dist/plugins/MessageHandler/shared.d.ts +2 -2
  52. package/dist/plugins/MessageHandler/socket.d.ts +2 -2
  53. package/dist/plugins/MessageHandler/socket.js +1 -1
  54. package/dist/plugins/MessageHandler/spec.d.ts +1 -1
  55. package/dist/plugins/Notifications/Notifications.d.ts +1 -1
  56. package/dist/plugins/Notifications/pushNotification.d.ts +2 -2
  57. package/dist/plugins/Notifications/pushNotification.js +1 -1
  58. package/dist/plugins/Notifications/shared.d.ts +2 -2
  59. package/dist/plugins/Notifications/spec.d.ts +1 -1
  60. package/dist/plugins/PropsPanel/PropsPanel/ComponentProps.d.ts +3 -3
  61. package/dist/plugins/PropsPanel/PropsPanel/index.d.ts +3 -3
  62. package/dist/plugins/PropsPanel/PropsPanel/shared.d.ts +1 -1
  63. package/dist/plugins/PropsPanel/PropsPanel/shared.js +1 -1
  64. package/dist/plugins/PropsPanel/index.js +1 -1
  65. package/dist/plugins/PropsPanel/shared.d.ts +1 -1
  66. package/dist/plugins/RemoteRenderer/RemoteButton/copyToClipboard.js +2 -2
  67. package/dist/plugins/RemoteRenderer/RemoteButton/index.d.ts +1 -1
  68. package/dist/plugins/RemoteRenderer/RemoteButton/index.js +2 -2
  69. package/dist/plugins/RemoteRenderer/shared.d.ts +2 -2
  70. package/dist/plugins/RendererCore/onRouterFixtureReselect.d.ts +2 -2
  71. package/dist/plugins/RendererCore/onRouterFixtureSelect.d.ts +2 -2
  72. package/dist/plugins/RendererCore/onRouterFixtureUnselect.d.ts +1 -1
  73. package/dist/plugins/RendererCore/receiveResponse/fixtureChange.d.ts +2 -2
  74. package/dist/plugins/RendererCore/receiveResponse/fixtureListUpdate.d.ts +2 -2
  75. package/dist/plugins/RendererCore/receiveResponse/fixtureStateChange.d.ts +2 -2
  76. package/dist/plugins/RendererCore/receiveResponse/index.d.ts +2 -2
  77. package/dist/plugins/RendererCore/receiveResponse/playgroundCommand.d.ts +2 -2
  78. package/dist/plugins/RendererCore/receiveResponse/pushStickyNotification.d.ts +2 -2
  79. package/dist/plugins/RendererCore/receiveResponse/pushTimedNotification.d.ts +2 -2
  80. package/dist/plugins/RendererCore/receiveResponse/removeStickyNotification.d.ts +2 -2
  81. package/dist/plugins/RendererCore/receiveResponse/rendererReady.d.ts +2 -2
  82. package/dist/plugins/RendererCore/reloadRenderer.d.ts +1 -1
  83. package/dist/plugins/RendererCore/setFixtureState.d.ts +2 -2
  84. package/dist/plugins/RendererCore/setFixtureState.js +1 -1
  85. package/dist/plugins/RendererCore/setGlobalFixtureState.d.ts +1 -1
  86. package/dist/plugins/RendererCore/shared/index.d.ts +2 -2
  87. package/dist/plugins/RendererCore/shared/postRequest.d.ts +2 -2
  88. package/dist/plugins/RendererCore/shared/router.d.ts +1 -1
  89. package/dist/plugins/RendererCore/spec.d.ts +1 -1
  90. package/dist/plugins/RendererPreview/RendererOverlay/RendererOverlay.d.ts +1 -1
  91. package/dist/plugins/RendererPreview/RendererPreview.d.ts +1 -1
  92. package/dist/plugins/RendererPreview/handleRendererRequests.d.ts +2 -2
  93. package/dist/plugins/RendererPreview/handleRendererRequests.js +1 -1
  94. package/dist/plugins/RendererPreview/handleWindowMessages.d.ts +1 -1
  95. package/dist/plugins/RendererPreview/shared.d.ts +2 -2
  96. package/dist/plugins/ResponsivePreview/ResponsivePreview/ResponsiveHeader.d.ts +2 -2
  97. package/dist/plugins/ResponsivePreview/ResponsivePreview/ResponsivePreview.d.ts +4 -3
  98. package/dist/plugins/ResponsivePreview/ResponsivePreview/ResponsivePreview.js +1 -1
  99. package/dist/plugins/ResponsivePreview/ResponsivePreview/style.d.ts +1 -1
  100. package/dist/plugins/ResponsivePreview/shared.d.ts +4 -4
  101. package/dist/plugins/ResponsivePreview/spec.d.ts +1 -1
  102. package/dist/plugins/Root/ControlPanel.d.ts +2 -2
  103. package/dist/plugins/Root/RendererHeader.d.ts +1 -1
  104. package/dist/plugins/Root/Root.d.ts +2 -2
  105. package/dist/plugins/Root/persistentState/controlPanelOpen.d.ts +1 -1
  106. package/dist/plugins/Root/persistentState/controlPanelWidth.d.ts +1 -1
  107. package/dist/plugins/Root/persistentState/drawerPanels.d.ts +1 -1
  108. package/dist/plugins/Root/persistentState/navPanelOpen.d.ts +1 -1
  109. package/dist/plugins/Root/persistentState/navPanelWidth.d.ts +1 -1
  110. package/dist/plugins/Root/shared.d.ts +2 -2
  111. package/dist/plugins/Router/spec.d.ts +1 -1
  112. package/dist/plugins/SelectInput/SelectValueInput.d.ts +1 -1
  113. package/dist/plugins/StandardInput/storage.d.ts +3 -3
  114. package/dist/shared/fixtureTree.d.ts +1 -1
  115. package/dist/shared/treeExpansion.d.ts +1 -1
  116. package/dist/shared/url.d.ts +1 -1
  117. package/dist/slots/ControlPanelRowSlot.d.ts +2 -2
  118. package/dist/slots/FixtureActionSlot.d.ts +1 -1
  119. package/dist/slots/InputSlot.d.ts +1 -1
  120. package/dist/slots/InputsActionSlot.d.ts +1 -1
  121. package/dist/slots/RendererActionSlot.d.ts +1 -1
  122. package/dist/slots/ValueInputSlot.d.ts +3 -2
  123. package/dist/testHelpers/pluginHelpers.d.ts +1 -1
  124. package/dist/testHelpers/pluginHelpers.js +1 -1
  125. package/dist/testHelpers/pluginMocks.d.ts +50 -50
  126. package/dist/testHelpers/pluginMocks.js +1 -1
  127. package/package.json +3 -3
  128. package/tsconfig.build.tsbuildinfo +1 -0
  129. package/dist/tsconfig.build.tsbuildinfo +0 -1
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { SvgChildren } from './BaseSvg.js';
2
+ import type { SvgChildren } from './BaseSvg.js';
3
3
  export type IconProps = {
4
4
  size?: number | string;
5
5
  strokeWidth?: number;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { SvgChildren } from './BaseSvg.js';
2
+ import type { SvgChildren } from './BaseSvg.js';
3
3
  type Props = {
4
4
  children: SvgChildren;
5
5
  viewBox: string;
@@ -1,6 +1,7 @@
1
- import React, { ReactNode } from 'react';
2
- import { TreeNode } from 'react-cosmos-core';
3
- import { TreeExpansion } from '../shared/treeExpansion.js';
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({ id, name, data, onChange }: Props): React.JSX.Element;
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({ id, name, data, onChange }) {
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, } from 'react-cosmos-core';
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
- React.createElement(TreeView, { node: rootNode, expansion: expansion, setExpansion: setExpansion, renderNode: ({ node, name, parents, expanded, onToggle }) => {
13
- const { data, children } = node;
14
- if (data.type === 'item') {
15
- 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))) }));
16
- }
17
- if (children) {
18
- const childKeys = Object.keys(children);
19
- return (React.createElement(ValueInputDir, { name: name, childrenText: getChildrenText(childKeys, data.isArray), disabled: childKeys.length === 0, expanded: expanded, indentLevel: parents.length, onToggle: onToggle }));
20
- }
21
- else {
22
- return null;
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,4 +1,4 @@
1
- import { FixtureElementId, FixtureStateValues } from 'react-cosmos-core';
1
+ import type { FixtureElementId, FixtureStateValues } from 'react-cosmos-core';
2
2
  interface FixtureStateValueGroup {
3
3
  elementId: FixtureElementId;
4
4
  values: FixtureStateValues;
@@ -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,4 +1,4 @@
1
- import { stringifyFixtureId, } from 'react-cosmos-core';
1
+ import { stringifyFixtureId } from 'react-cosmos-core';
2
2
  import { stringifyElementId } from './shared.js';
3
3
  const DEFAULT_EXPANSION = {};
4
4
  export function getFixtureExpansion(groupExpansion, fixtureId) {
@@ -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,5 +1,5 @@
1
1
  import React from 'react';
2
- import { GroupedOptions } from '../../shared/groupedOptions.js';
2
+ import type { GroupedOptions } from '../../shared/groupedOptions.js';
3
3
  type BaseOption = {
4
4
  value: string;
5
5
  label: string;
@@ -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, } from '../../shared/groupedOptions.js';
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';