@wordpress/components 29.10.0 → 29.12.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/CHANGELOG.md +29 -0
- package/build/drop-zone/index.js +2 -1
- package/build/drop-zone/index.js.map +1 -1
- package/build/drop-zone/types.js.map +1 -1
- package/build/focal-point-picker/styles/focal-point-picker-style.js +11 -11
- package/build/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
- package/build/form-file-upload/index.js +4 -6
- package/build/form-file-upload/index.js.map +1 -1
- package/build/form-token-field/index.js +2 -2
- package/build/form-token-field/index.js.map +1 -1
- package/build/form-token-field/suggestions-list.js +2 -8
- package/build/form-token-field/suggestions-list.js.map +1 -1
- package/build/input-control/input-field.js +0 -14
- package/build/input-control/input-field.js.map +1 -1
- package/build/mobile/image/index.native.js +1 -1
- package/build/mobile/image/index.native.js.map +1 -1
- package/build/mobile/utils/get-px-from-css-unit.native.js +1 -1
- package/build/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
- package/build/private-apis.js +4 -1
- package/build/private-apis.js.map +1 -1
- package/build/utils/strings.js +1 -1
- package/build/utils/strings.js.map +1 -1
- package/build-module/drop-zone/index.js +2 -1
- package/build-module/drop-zone/index.js.map +1 -1
- package/build-module/drop-zone/types.js.map +1 -1
- package/build-module/focal-point-picker/styles/focal-point-picker-style.js +11 -11
- package/build-module/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
- package/build-module/form-file-upload/index.js +4 -6
- package/build-module/form-file-upload/index.js.map +1 -1
- package/build-module/form-token-field/index.js +2 -2
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/form-token-field/suggestions-list.js +2 -8
- package/build-module/form-token-field/suggestions-list.js.map +1 -1
- package/build-module/input-control/input-field.js +0 -14
- package/build-module/input-control/input-field.js.map +1 -1
- package/build-module/mobile/image/index.native.js +1 -1
- package/build-module/mobile/image/index.native.js.map +1 -1
- package/build-module/mobile/utils/get-px-from-css-unit.native.js +1 -1
- package/build-module/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
- package/build-module/private-apis.js +5 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/utils/strings.js +1 -1
- package/build-module/utils/strings.js.map +1 -1
- package/build-style/style-rtl.css +6 -6
- package/build-style/style.css +6 -6
- package/build-types/drop-zone/index.d.ts +1 -1
- package/build-types/drop-zone/index.d.ts.map +1 -1
- package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
- package/build-types/drop-zone/types.d.ts +6 -0
- package/build-types/drop-zone/types.d.ts.map +1 -1
- package/build-types/form-file-upload/index.d.ts.map +1 -1
- package/build-types/form-token-field/index.d.ts.map +1 -1
- package/build-types/form-token-field/suggestions-list.d.ts.map +1 -1
- package/build-types/input-control/input-field.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/utils/strings.d.ts.map +1 -1
- package/package.json +19 -19
- package/src/circular-option-picker/stories/index.story.tsx +2 -2
- package/src/drop-zone/index.tsx +2 -1
- package/src/drop-zone/stories/index.story.tsx +15 -0
- package/src/drop-zone/types.ts +6 -0
- package/src/focal-point-picker/styles/focal-point-picker-style.ts +1 -1
- package/src/form-file-upload/index.tsx +6 -12
- package/src/form-token-field/index.tsx +5 -2
- package/src/form-token-field/suggestions-list.tsx +4 -8
- package/src/form-token-field/test/index.tsx +39 -0
- package/src/input-control/input-field.tsx +0 -18
- package/src/input-control/test/index.js +0 -17
- package/src/mobile/image/index.native.js +1 -1
- package/src/mobile/utils/get-px-from-css-unit.native.js +1 -1
- package/src/private-apis.ts +4 -1
- package/src/toolbar/toolbar/style.scss +3 -6
- package/src/toolbar/toolbar-group/style.scss +4 -4
- package/src/utils/strings.ts +1 -0
- package/src/utils/test/strings.js +11 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -72,23 +72,6 @@ describe( 'InputControl', () => {
|
|
|
72
72
|
} );
|
|
73
73
|
} );
|
|
74
74
|
|
|
75
|
-
describe( 'Ensurance of focus for number inputs', () => {
|
|
76
|
-
it( 'should focus its input on mousedown events', async () => {
|
|
77
|
-
const user = await userEvent.setup();
|
|
78
|
-
const spy = jest.fn();
|
|
79
|
-
render( <InputControl type="number" onFocus={ spy } /> );
|
|
80
|
-
const target = getInput();
|
|
81
|
-
|
|
82
|
-
// Hovers the input and presses (without releasing) primary button.
|
|
83
|
-
await user.pointer( [
|
|
84
|
-
{ target },
|
|
85
|
-
{ keys: '[MouseLeft]', target },
|
|
86
|
-
] );
|
|
87
|
-
|
|
88
|
-
expect( spy ).toHaveBeenCalledTimes( 1 );
|
|
89
|
-
} );
|
|
90
|
-
} );
|
|
91
|
-
|
|
92
75
|
describe( 'Value', () => {
|
|
93
76
|
it( 'should update value onChange', async () => {
|
|
94
77
|
const user = await userEvent.setup();
|
|
@@ -282,7 +282,7 @@ const ImageComponent = ( {
|
|
|
282
282
|
accessible
|
|
283
283
|
disabled={ ! isSelected }
|
|
284
284
|
accessibilityLabel={ alt }
|
|
285
|
-
accessibilityHint={ __( 'Double tap
|
|
285
|
+
accessibilityHint={ __( 'Double tap to view larger.' ) }
|
|
286
286
|
accessibilityRole="imagebutton"
|
|
287
287
|
key={ url }
|
|
288
288
|
style={ imageContainerStyles }
|
|
@@ -116,7 +116,7 @@ function isMathExpression( cssUnit ) {
|
|
|
116
116
|
* Evaluates the math expression and return a px value.
|
|
117
117
|
*
|
|
118
118
|
* @param {string} cssUnit the cssUnit value being evaluated.
|
|
119
|
-
* @return {string} return a
|
|
119
|
+
* @return {string} return a converted value to px.
|
|
120
120
|
*/
|
|
121
121
|
function evalMathExpression( cssUnit ) {
|
|
122
122
|
let errorFound = false;
|
package/src/private-apis.ts
CHANGED
|
@@ -6,7 +6,8 @@ import { Menu } from './menu';
|
|
|
6
6
|
import { ComponentsContext } from './context/context-system-provider';
|
|
7
7
|
import Theme from './theme';
|
|
8
8
|
import { Tabs } from './tabs';
|
|
9
|
-
import { kebabCase } from './utils/strings';
|
|
9
|
+
import { kebabCase, normalizeTextString } from './utils/strings';
|
|
10
|
+
import { withIgnoreIMEEvents } from './utils/with-ignore-ime-events';
|
|
10
11
|
import { lock } from './lock-unlock';
|
|
11
12
|
import Badge from './badge';
|
|
12
13
|
|
|
@@ -18,5 +19,7 @@ lock( privateApis, {
|
|
|
18
19
|
Theme,
|
|
19
20
|
Menu,
|
|
20
21
|
kebabCase,
|
|
22
|
+
withIgnoreIMEEvents,
|
|
21
23
|
Badge,
|
|
24
|
+
normalizeTextString,
|
|
22
25
|
} );
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.components-accessible-toolbar {
|
|
2
2
|
display: inline-flex;
|
|
3
|
-
border: $border-width solid $
|
|
3
|
+
border: $border-width solid $components-color-foreground;
|
|
4
4
|
border-radius: $radius-small;
|
|
5
5
|
flex-shrink: 0;
|
|
6
6
|
|
|
@@ -14,13 +14,11 @@
|
|
|
14
14
|
& > .components-toolbar-group {
|
|
15
15
|
border-right: none;
|
|
16
16
|
}
|
|
17
|
-
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
.components-accessible-toolbar,
|
|
22
21
|
.components-toolbar {
|
|
23
|
-
|
|
24
22
|
&[aria-orientation="vertical"] {
|
|
25
23
|
display: flex;
|
|
26
24
|
flex-direction: column;
|
|
@@ -56,7 +54,7 @@
|
|
|
56
54
|
z-index: -1;
|
|
57
55
|
|
|
58
56
|
// Animate in.
|
|
59
|
-
@media not (prefers-reduced-motion) {
|
|
57
|
+
@media not ( prefers-reduced-motion ) {
|
|
60
58
|
animation: components-button__appear-animation 0.1s ease;
|
|
61
59
|
animation-fill-mode: forwards;
|
|
62
60
|
}
|
|
@@ -79,7 +77,7 @@
|
|
|
79
77
|
}
|
|
80
78
|
|
|
81
79
|
&::before {
|
|
82
|
-
background: $
|
|
80
|
+
background: $components-color-foreground;
|
|
83
81
|
}
|
|
84
82
|
}
|
|
85
83
|
|
|
@@ -99,7 +97,6 @@
|
|
|
99
97
|
}
|
|
100
98
|
}
|
|
101
99
|
|
|
102
|
-
|
|
103
100
|
@keyframes components-button__appear-animation {
|
|
104
101
|
from {
|
|
105
102
|
transform: scaleY(0);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.components-toolbar-group {
|
|
2
2
|
min-height: $block-toolbar-height;
|
|
3
|
-
border-right: $border-width solid $
|
|
4
|
-
background-color: $
|
|
3
|
+
border-right: $border-width solid $components-color-foreground;
|
|
4
|
+
background-color: $components-color-background;
|
|
5
5
|
display: inline-flex;
|
|
6
6
|
flex-shrink: 0;
|
|
7
7
|
flex-wrap: wrap;
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
.components-toolbar {
|
|
42
42
|
min-height: $block-toolbar-height;
|
|
43
43
|
margin: 0;
|
|
44
|
-
border: $border-width solid $
|
|
45
|
-
background-color: $
|
|
44
|
+
border: $border-width solid $components-color-foreground;
|
|
45
|
+
background-color: $components-color-background;
|
|
46
46
|
display: inline-flex;
|
|
47
47
|
flex-shrink: 0;
|
|
48
48
|
flex-wrap: wrap;
|
package/src/utils/strings.ts
CHANGED
|
@@ -169,4 +169,15 @@ describe( 'normalizeTextString', () => {
|
|
|
169
169
|
'-'.repeat( dashCharacters.length )
|
|
170
170
|
);
|
|
171
171
|
} );
|
|
172
|
+
|
|
173
|
+
it( 'should normalize unicode to standard characters', () => {
|
|
174
|
+
expect( normalizeTextString( '①' ) ).toBe( '1' );
|
|
175
|
+
expect( normalizeTextString( 'Ⅸ' ) ).toBe( 'ix' );
|
|
176
|
+
expect( normalizeTextString( 'MC²' ) ).toBe( 'mc2' );
|
|
177
|
+
expect( normalizeTextString( 'PlayStation 2' ) ).toBe(
|
|
178
|
+
'playstation 2'
|
|
179
|
+
);
|
|
180
|
+
expect( normalizeTextString( 'ABC' ) ).toBe( 'abc' );
|
|
181
|
+
expect( normalizeTextString( 'Amélie' ) ).toBe( 'amelie' );
|
|
182
|
+
} );
|
|
172
183
|
} );
|