react-cosmos-core 6.0.4-canary.a484ae0.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.
- package/dist/fixtureState/{controlsTypes.d.ts → inputsTypes.d.ts} +4 -4
- package/dist/fixtureState/types.d.ts +0 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/playground/registerPlaygroundShortcuts.js +5 -2
- package/package.json +3 -3
- /package/dist/fixtureState/{controlsTypes.js → inputsTypes.js} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { FixtureStateValue } from './types.js';
|
|
2
|
-
export type
|
|
2
|
+
export type StandardInputFixtureState = {
|
|
3
3
|
type: 'standard';
|
|
4
4
|
defaultValue: FixtureStateValue;
|
|
5
5
|
currentValue: FixtureStateValue;
|
|
6
6
|
};
|
|
7
|
-
export type
|
|
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
|
|
17
|
-
export type
|
|
16
|
+
export type InputFixtureState = StandardInputFixtureState | SelectInputFixtureState;
|
|
17
|
+
export type InputsFixtureState = Record<string, InputFixtureState>;
|
|
@@ -11,7 +11,6 @@ export type FixtureStateUnserializableValue = {
|
|
|
11
11
|
export type PrimitiveData = string | number | boolean | null | undefined;
|
|
12
12
|
export type ObjectData = Record<string, unknown>;
|
|
13
13
|
export type ArrayData = unknown[];
|
|
14
|
-
export type FixtureStateData = PrimitiveData | ObjectData | ArrayData;
|
|
15
14
|
export type FixtureStatePrimitiveValue = {
|
|
16
15
|
type: 'primitive';
|
|
17
16
|
data: PrimitiveData;
|
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.
|
|
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.
|
|
11
|
+
"js-base64": "3.7.7",
|
|
12
12
|
"lodash-es": "4.17.21",
|
|
13
13
|
"react-is": "18.2.0"
|
|
14
14
|
},
|
|
15
|
-
"gitHead": "
|
|
15
|
+
"gitHead": "189ce69cb4c190459226ff7e550de0f1cc364242"
|
|
16
16
|
}
|
|
File without changes
|