react-cosmos-core 6.0.4-canary.b3b5414.0 → 6.1.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.
@@ -1,10 +1,10 @@
1
1
  import { FixtureStateValue } from './types.js';
2
- export type StandardControlFixtureState = {
2
+ export type StandardInputFixtureState = {
3
3
  type: 'standard';
4
4
  defaultValue: FixtureStateValue;
5
5
  currentValue: FixtureStateValue;
6
6
  };
7
- export type SelectControlFixtureState = {
7
+ export type SelectInputFixtureState = {
8
8
  type: 'select';
9
9
  options: string[] | {
10
10
  group: string;
@@ -13,5 +13,5 @@ export type SelectControlFixtureState = {
13
13
  defaultValue: string;
14
14
  currentValue: string;
15
15
  };
16
- export type ControlFixtureState = StandardControlFixtureState | SelectControlFixtureState;
17
- export type ControlsFixtureState = Record<string, ControlFixtureState>;
16
+ export type InputFixtureState = StandardInputFixtureState | SelectInputFixtureState;
17
+ export type InputsFixtureState = Record<string, InputFixtureState>;
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  export * from './fixtureState/classState.js';
2
2
  export * from './fixtureState/classStateTypes.js';
3
- export * from './fixtureState/controlsTypes.js';
4
3
  export * from './fixtureState/createValues.js';
5
4
  export * from './fixtureState/extendWithValues.js';
6
5
  export * from './fixtureState/fixtureState.js';
6
+ export * from './fixtureState/inputsTypes.js';
7
7
  export * from './fixtureState/props.js';
8
8
  export * from './fixtureState/propsTypes.js';
9
9
  export * from './fixtureState/types.js';
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  export * from './fixtureState/classState.js';
2
2
  export * from './fixtureState/classStateTypes.js';
3
- export * from './fixtureState/controlsTypes.js';
4
3
  export * from './fixtureState/createValues.js';
5
4
  export * from './fixtureState/extendWithValues.js';
6
5
  export * from './fixtureState/fixtureState.js';
6
+ export * from './fixtureState/inputsTypes.js';
7
7
  export * from './fixtureState/props.js';
8
8
  export * from './fixtureState/propsTypes.js';
9
9
  export * from './fixtureState/types.js';
@@ -6,7 +6,7 @@ export function registerPlaygroundShortcuts(runCommand) {
6
6
  }
7
7
  function handleWindowKeyDown(e) {
8
8
  // Allow meta key shortcuts to work when focused on input fields
9
- if (isEditing() && !e.metaKey) {
9
+ if (isEditing(e) && !e.metaKey) {
10
10
  return;
11
11
  }
12
12
  const keyChar = String.fromCharCode(e.keyCode);
@@ -42,7 +42,10 @@ export function registerPlaygroundShortcuts(runCommand) {
42
42
  window.removeEventListener('keydown', handleWindowKeyDown);
43
43
  };
44
44
  }
45
- function isEditing() {
45
+ function isEditing(e) {
46
+ if (e.target instanceof HTMLElement && e.target.isContentEditable) {
47
+ return true;
48
+ }
46
49
  const activeElement = document.activeElement;
47
50
  return activeElement && isInputTag(activeElement.tagName);
48
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-cosmos-core",
3
- "version": "6.0.4-canary.b3b5414.0+b3b5414",
3
+ "version": "6.1.0",
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",
@@ -8,9 +8,9 @@
8
8
  "sideEffects": false,
9
9
  "main": "./dist/index.js",
10
10
  "dependencies": {
11
- "js-base64": "3.7.6",
11
+ "js-base64": "3.7.7",
12
12
  "lodash-es": "4.17.21",
13
13
  "react-is": "18.2.0"
14
14
  },
15
- "gitHead": "b3b5414e2da01cd542fadf9312e4d10375f44033"
15
+ "gitHead": "189ce69cb4c190459226ff7e550de0f1cc364242"
16
16
  }