goblin-magic 1.0.3 → 1.0.7
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "goblin-magic",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "goblin-magic",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"react": "^17.0.1",
|
|
31
31
|
"react-dom": "^17.0.1",
|
|
32
32
|
"react-splitter-layout": "^4.0.0",
|
|
33
|
-
"xcraft-core-converters": "^4.
|
|
33
|
+
"xcraft-core-converters": "^4.6.0",
|
|
34
34
|
"xcraft-core-utils": "^4.14.2",
|
|
35
35
|
"xcraft-dev-fontawesome": "^0.1.2",
|
|
36
36
|
"xcraft-dev-prettier": "^2.0.0",
|
|
@@ -15,7 +15,7 @@ class MagicColorFieldButtonNC extends Widget {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
render() {
|
|
18
|
-
const {value, onChange, className = '', ...props} = this.props;
|
|
18
|
+
const {value, onChange, disabled, className = '', ...props} = this.props;
|
|
19
19
|
|
|
20
20
|
return (
|
|
21
21
|
<MagicButton disabled>
|
|
@@ -31,6 +31,7 @@ class MagicColorFieldButtonNC extends Widget {
|
|
|
31
31
|
type="color"
|
|
32
32
|
value={value || ''}
|
|
33
33
|
onChange={(event) => onChange?.(event.target.value)}
|
|
34
|
+
disabled={disabled}
|
|
34
35
|
/>
|
|
35
36
|
</label>
|
|
36
37
|
</MagicButton>
|
|
@@ -50,14 +51,19 @@ class MagicColorFieldNC extends Widget {
|
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
render() {
|
|
53
|
-
const {className = '', ...props} = this.props;
|
|
54
|
+
const {className = '', disabled, ...props} = this.props;
|
|
54
55
|
return (
|
|
55
56
|
<InputGroup>
|
|
56
57
|
<MagicTextField
|
|
57
58
|
{...props}
|
|
58
59
|
className={this.styles.classNames.colorField + ' ' + className}
|
|
60
|
+
disabled={disabled}
|
|
61
|
+
/>
|
|
62
|
+
<MagicColorFieldButton
|
|
63
|
+
value={props.value}
|
|
64
|
+
onChange={props.onChange}
|
|
65
|
+
disabled={disabled}
|
|
59
66
|
/>
|
|
60
|
-
<MagicColorFieldButton value={props.value} onChange={props.onChange} />
|
|
61
67
|
</InputGroup>
|
|
62
68
|
);
|
|
63
69
|
}
|
|
@@ -96,6 +96,10 @@ export default function styles() {
|
|
|
96
96
|
backgroundColor:
|
|
97
97
|
'color-mix(in srgb, var(--accent-color), transparent 90%)',
|
|
98
98
|
},
|
|
99
|
+
':active > *:not(dialog)': {
|
|
100
|
+
backgroundColor:
|
|
101
|
+
'color-mix(in srgb, var(--accent-color), transparent 85%)',
|
|
102
|
+
},
|
|
99
103
|
},
|
|
100
104
|
|
|
101
105
|
'& > :first-child:last-child': {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as styles from './styles.js';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import
|
|
3
|
+
import throttle from 'lodash/throttle.js';
|
|
4
4
|
import Widget from 'goblin-laboratory/widgets/widget';
|
|
5
5
|
import withC from 'goblin-laboratory/widgets/connect-helpers/with-c';
|
|
6
6
|
import {faSquare, faCheckSquare} from '@fortawesome/free-regular-svg-icons';
|
|
@@ -348,7 +348,7 @@ let MagicTable = class extends Widget {
|
|
|
348
348
|
columns: this.props.columns,
|
|
349
349
|
});
|
|
350
350
|
}
|
|
351
|
-
this.onUpdate =
|
|
351
|
+
this.onUpdate = throttle(this.onUpdate, 500);
|
|
352
352
|
}
|
|
353
353
|
|
|
354
354
|
componentDidUpdate() {
|
|
@@ -17,7 +17,10 @@ export default class MagicZen extends Widget {
|
|
|
17
17
|
return this.props.children;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
const {
|
|
20
|
+
const {
|
|
21
|
+
className = '',
|
|
22
|
+
background: Background = MagicBackground,
|
|
23
|
+
} = this.props;
|
|
21
24
|
|
|
22
25
|
return createPortal(
|
|
23
26
|
<Dialog
|
|
@@ -26,7 +29,7 @@ export default class MagicZen extends Widget {
|
|
|
26
29
|
open
|
|
27
30
|
onClose={this.props.onClose}
|
|
28
31
|
>
|
|
29
|
-
<
|
|
32
|
+
<Background>
|
|
30
33
|
<div className={this.styles.classNames.notice}>
|
|
31
34
|
Appuyez sur <span className={this.styles.classNames.key}>ESC</span>{' '}
|
|
32
35
|
pour quitter le mode zen
|
|
@@ -34,7 +37,7 @@ export default class MagicZen extends Widget {
|
|
|
34
37
|
<MagicDiv className={this.styles.classNames.zen + ' ' + className}>
|
|
35
38
|
{this.props.children}
|
|
36
39
|
</MagicDiv>
|
|
37
|
-
</
|
|
40
|
+
</Background>
|
|
38
41
|
</Dialog>,
|
|
39
42
|
document.getElementById('root')
|
|
40
43
|
);
|