@wordpress/format-library 5.47.0 → 5.48.1

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 (42) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/image/index.cjs +5 -3
  3. package/build/image/index.cjs.map +3 -3
  4. package/build/language/index.cjs +6 -4
  5. package/build/language/index.cjs.map +3 -3
  6. package/build/link/css-classes-setting.cjs +1 -1
  7. package/build/link/css-classes-setting.cjs.map +3 -3
  8. package/build/math/index.cjs +2 -1
  9. package/build/math/index.cjs.map +3 -3
  10. package/build/text-color/inline.cjs +6 -7
  11. package/build/text-color/inline.cjs.map +3 -3
  12. package/build-module/image/index.mjs +5 -6
  13. package/build-module/image/index.mjs.map +2 -2
  14. package/build-module/language/index.mjs +7 -7
  15. package/build-module/language/index.mjs.map +2 -2
  16. package/build-module/link/css-classes-setting.mjs +3 -4
  17. package/build-module/link/css-classes-setting.mjs.map +2 -2
  18. package/build-module/math/index.mjs +2 -2
  19. package/build-module/math/index.mjs.map +2 -2
  20. package/build-module/text-color/inline.mjs +7 -11
  21. package/build-module/text-color/inline.mjs.map +2 -2
  22. package/package.json +24 -20
  23. package/src/image/index.js +8 -9
  24. package/src/language/index.js +8 -8
  25. package/src/link/css-classes-setting.js +3 -4
  26. package/src/math/index.js +3 -3
  27. package/src/text-color/inline.js +11 -16
  28. package/src/default-formats.native.js +0 -10
  29. package/src/link/index.native.js +0 -176
  30. package/src/link/modal-screens/link-picker-screen.native.js +0 -61
  31. package/src/link/modal-screens/link-settings-screen.native.js +0 -229
  32. package/src/link/modal-screens/screens.native.js +0 -4
  33. package/src/link/modal.native.js +0 -44
  34. package/src/link/modal.native.scss +0 -16
  35. package/src/link/test/__snapshots__/modal.native.js.snap +0 -553
  36. package/src/link/test/index.native.js +0 -145
  37. package/src/link/test/modal.native.js +0 -18
  38. package/src/text-color/index.native.js +0 -172
  39. package/src/text-color/inline.native.js +0 -169
  40. package/src/text-color/style.native.scss +0 -22
  41. package/src/text-color/test/__snapshots__/index.native.js.snap +0 -23
  42. package/src/text-color/test/index.native.js +0 -192
@@ -1,553 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`LinksUI LinksUI renders 1`] = `
4
- <Modal
5
- animationInTiming={400}
6
- animationOutTiming={300}
7
- backdropOpacity={0.2}
8
- backdropTransitionInTiming={50}
9
- backdropTransitionOutTiming={50}
10
- hardwareAccelerated={true}
11
- isVisible={true}
12
- onAccessibilityEscape={[Function]}
13
- onBackButtonPress={[Function]}
14
- onBackdropPress={[Function]}
15
- onModalHide={[Function]}
16
- onMoveShouldSetResponder={[Function]}
17
- onMoveShouldSetResponderCapture={[Function]}
18
- onSwipeComplete={[Function]}
19
- preferredColorScheme="light"
20
- swipeDirection="down"
21
- testID="link-settings-modal"
22
- useNativeDriverForBackdrop={true}
23
- >
24
- <View
25
- behavior={false}
26
- style={
27
- {
28
- "borderColor": "rgba(0, 0, 0, 0.1)",
29
- "flex": undefined,
30
- "marginTop": 0,
31
- "maxWidth": 512,
32
- }
33
- }
34
- >
35
- <View
36
- onLayout={[Function]}
37
- testID="link-settings-modal-header"
38
- >
39
- <View />
40
- </View>
41
- <View
42
- style={
43
- {
44
- "maxHeight": 787.06,
45
- }
46
- }
47
- >
48
- <View
49
- animatedStyle={
50
- {
51
- "value": {
52
- "height": 1,
53
- },
54
- }
55
- }
56
- collapsable={false}
57
- style={
58
- {
59
- "height": 1,
60
- }
61
- }
62
- >
63
- <RNGestureHandlerRootView
64
- style={
65
- {
66
- "flex": 1,
67
- }
68
- }
69
- >
70
- <View
71
- style={
72
- [
73
- {
74
- "backgroundColor": undefined,
75
- "flex": 1,
76
- },
77
- undefined,
78
- ]
79
- }
80
- >
81
- <View
82
- onLayout={[Function]}
83
- style={
84
- {
85
- "flex": 1,
86
- }
87
- }
88
- >
89
- <View
90
- collapsable={false}
91
- pointerEvents="box-none"
92
- style={
93
- {
94
- "bottom": 0,
95
- "display": "flex",
96
- "left": 0,
97
- "position": "absolute",
98
- "right": 0,
99
- "top": 0,
100
- }
101
- }
102
- >
103
- <View
104
- collapsable={false}
105
- style={
106
- {
107
- "opacity": 1,
108
- }
109
- }
110
- />
111
- <View
112
- accessibilityElementsHidden={false}
113
- closing={false}
114
- gestureVelocityImpact={0.3}
115
- importantForAccessibility="auto"
116
- onClose={[Function]}
117
- onGestureBegin={[Function]}
118
- onGestureCanceled={[Function]}
119
- onGestureEnd={[Function]}
120
- onOpen={[Function]}
121
- onTransition={[Function]}
122
- pointerEvents="box-none"
123
- style={
124
- [
125
- {
126
- "display": "flex",
127
- "overflow": undefined,
128
- },
129
- {
130
- "bottom": 0,
131
- "left": 0,
132
- "position": "absolute",
133
- "right": 0,
134
- "top": 0,
135
- },
136
- ]
137
- }
138
- transitionSpec={
139
- {
140
- "close": {
141
- "animation": "timing",
142
- "config": {
143
- "duration": 200,
144
- "easing": [Function],
145
- },
146
- },
147
- "open": {
148
- "animation": "timing",
149
- "config": {
150
- "duration": 200,
151
- "easing": [Function],
152
- },
153
- },
154
- }
155
- }
156
- >
157
- <View
158
- pointerEvents="box-none"
159
- style={
160
- {
161
- "bottom": 0,
162
- "left": 0,
163
- "position": "absolute",
164
- "right": 0,
165
- "top": 0,
166
- }
167
- }
168
- />
169
- <View
170
- collapsable={false}
171
- pointerEvents="box-none"
172
- style={
173
- {
174
- "flex": 1,
175
- }
176
- }
177
- >
178
- <View
179
- collapsable={false}
180
- handlerTag={1}
181
- handlerType="PanGestureHandler"
182
- needsOffscreenAlphaCompositing={true}
183
- onGestureHandlerEvent={[Function]}
184
- onGestureHandlerStateChange={[Function]}
185
- style={
186
- {
187
- "flex": 1,
188
- "opacity": 1,
189
- }
190
- }
191
- >
192
- <View
193
- pointerEvents="box-none"
194
- style={
195
- [
196
- {
197
- "flex": 1,
198
- "overflow": "hidden",
199
- },
200
- [
201
- {
202
- "backgroundColor": undefined,
203
- },
204
- undefined,
205
- ],
206
- ]
207
- }
208
- >
209
- <View
210
- style={
211
- {
212
- "flex": 1,
213
- "flexDirection": "column-reverse",
214
- }
215
- }
216
- >
217
- <View
218
- style={
219
- {
220
- "flex": 1,
221
- }
222
- }
223
- >
224
- <RCTScrollView
225
- automaticallyAdjustContentInsets={false}
226
- bounces={false}
227
- contentContainerStyle={
228
- [
229
- {
230
- "paddingLeft": 8,
231
- "paddingRight": 8,
232
- },
233
- undefined,
234
- {},
235
- false,
236
- ]
237
- }
238
- disableScrollViewPanResponder={true}
239
- onScroll={[Function]}
240
- safeAreaBottomInset={0}
241
- scrollEnabled={true}
242
- scrollEventThrottle={16}
243
- style={
244
- {
245
- "maxHeight": 787.06,
246
- }
247
- }
248
- >
249
- <View>
250
- <View
251
- accessibilityValue={
252
- {
253
- "max": undefined,
254
- "min": undefined,
255
- "now": undefined,
256
- "text": undefined,
257
- }
258
- }
259
- accessible={false}
260
- focusable={false}
261
- onClick={[Function]}
262
- onResponderGrant={[Function]}
263
- onResponderMove={[Function]}
264
- onResponderRelease={[Function]}
265
- onResponderTerminate={[Function]}
266
- onResponderTerminationRequest={[Function]}
267
- onStartShouldSetResponder={[Function]}
268
- >
269
- <View
270
- onLayout={[Function]}
271
- testID="navigation-screen-linkSettings"
272
- >
273
- <View
274
- accessibilityLabel="Link to, Search or type URL"
275
- accessibilityRole="button"
276
- accessibilityState={
277
- {
278
- "busy": undefined,
279
- "checked": undefined,
280
- "disabled": false,
281
- "expanded": undefined,
282
- "selected": undefined,
283
- }
284
- }
285
- accessibilityValue={
286
- {
287
- "max": undefined,
288
- "min": undefined,
289
- "now": undefined,
290
- "text": undefined,
291
- }
292
- }
293
- accessible={true}
294
- collapsable={false}
295
- focusable={true}
296
- onClick={[Function]}
297
- onResponderGrant={[Function]}
298
- onResponderMove={[Function]}
299
- onResponderRelease={[Function]}
300
- onResponderTerminate={[Function]}
301
- onResponderTerminationRequest={[Function]}
302
- onStartShouldSetResponder={[Function]}
303
- style={
304
- {
305
- "opacity": 1,
306
- }
307
- }
308
- >
309
- <View
310
- pointerEvents="auto"
311
- style={
312
- [
313
- undefined,
314
- {},
315
- ]
316
- }
317
- >
318
- <View
319
- style={
320
- [
321
- undefined,
322
- {},
323
- ]
324
- }
325
- >
326
- <View>
327
- <View
328
- style={
329
- [
330
- undefined,
331
- undefined,
332
- ]
333
- }
334
- >
335
- <Svg
336
- height={24}
337
- lock={true}
338
- style={{}}
339
- viewBox="0 0 24 24"
340
- width={24}
341
- xmlns="http://www.w3.org/2000/svg"
342
- >
343
- Path
344
- </Svg>
345
- <View />
346
- </View>
347
- <Text
348
- style={
349
- [
350
- undefined,
351
- {},
352
- ]
353
- }
354
- >
355
- Link to
356
- </Text>
357
- </View>
358
- </View>
359
- <Text
360
- ellipsizeMode="middle"
361
- numberOfLines={1}
362
- style={
363
- {
364
- "color": "gray",
365
- }
366
- }
367
- >
368
- Search or type URL
369
- </Text>
370
- <View
371
- pointerEvents="auto"
372
- style={
373
- [
374
- false,
375
- undefined,
376
- ]
377
- }
378
- >
379
- <Svg
380
- height={24}
381
- style={{}}
382
- viewBox="0 0 24 24"
383
- width={24}
384
- xmlns="http://www.w3.org/2000/svg"
385
- >
386
- Path
387
- </Svg>
388
- </View>
389
- </View>
390
- <View
391
- style={{}}
392
- />
393
- </View>
394
- <View
395
- accessibilityHint="Double tap to edit this value"
396
- accessibilityLabel="Link text. Empty"
397
- accessibilityRole="button"
398
- accessibilityState={
399
- {
400
- "busy": undefined,
401
- "checked": undefined,
402
- "disabled": false,
403
- "expanded": undefined,
404
- "selected": undefined,
405
- }
406
- }
407
- accessibilityValue={
408
- {
409
- "max": undefined,
410
- "min": undefined,
411
- "now": undefined,
412
- "text": undefined,
413
- }
414
- }
415
- accessible={true}
416
- collapsable={false}
417
- focusable={true}
418
- onClick={[Function]}
419
- onResponderGrant={[Function]}
420
- onResponderMove={[Function]}
421
- onResponderRelease={[Function]}
422
- onResponderTerminate={[Function]}
423
- onResponderTerminationRequest={[Function]}
424
- onStartShouldSetResponder={[Function]}
425
- style={
426
- {
427
- "opacity": 1,
428
- }
429
- }
430
- >
431
- <View
432
- pointerEvents="auto"
433
- style={
434
- [
435
- undefined,
436
- {},
437
- ]
438
- }
439
- >
440
- <View
441
- style={
442
- [
443
- undefined,
444
- {},
445
- ]
446
- }
447
- >
448
- <View>
449
- <View
450
- style={
451
- [
452
- undefined,
453
- undefined,
454
- ]
455
- }
456
- >
457
- <Svg
458
- height={24}
459
- lock={true}
460
- style={{}}
461
- viewBox="0 0 24 24"
462
- width={24}
463
- xmlns="http://www.w3.org/2000/svg"
464
- >
465
- Path
466
- </Svg>
467
- <View />
468
- </View>
469
- <Text
470
- style={
471
- [
472
- undefined,
473
- {},
474
- ]
475
- }
476
- >
477
- Link text
478
- </Text>
479
- </View>
480
- </View>
481
- <TextInput
482
- disabled={false}
483
- editable={true}
484
- keyboardType="default"
485
- numberOfLines={1}
486
- onBlur={[Function]}
487
- onChangeText={[Function]}
488
- onFocus={[Function]}
489
- onSubmitEditing={[Function]}
490
- placeholder="Add link text"
491
- placeholderTextColor="gray"
492
- pointerEvents="none"
493
- preferredColorScheme="light"
494
- style={{}}
495
- value=""
496
- />
497
- <View
498
- pointerEvents="auto"
499
- style={
500
- [
501
- false,
502
- undefined,
503
- ]
504
- }
505
- />
506
- </View>
507
- <View />
508
- </View>
509
- <View
510
- style={
511
- {
512
- "height": 20,
513
- }
514
- }
515
- />
516
- </View>
517
- </View>
518
- </View>
519
- </RCTScrollView>
520
- </View>
521
- <View
522
- collapsable={false}
523
- pointerEvents="box-none"
524
- style={{}}
525
- />
526
- </View>
527
- </View>
528
- </View>
529
- </View>
530
- </View>
531
- </View>
532
- </View>
533
- <View
534
- collapsable={false}
535
- pointerEvents="box-none"
536
- style={
537
- {
538
- "height": 56,
539
- "left": 0,
540
- "position": "absolute",
541
- "right": 0,
542
- "top": 0,
543
- "zIndex": 1,
544
- }
545
- }
546
- />
547
- </View>
548
- </RNGestureHandlerRootView>
549
- </View>
550
- </View>
551
- </View>
552
- </Modal>
553
- `;
@@ -1,145 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { Keyboard, Platform } from 'react-native';
5
- import { render, fireEvent } from 'test/helpers';
6
-
7
- /**
8
- * WordPress dependencies
9
- */
10
- import { Slot, SlotFillProvider } from '@wordpress/components';
11
-
12
- /**
13
- * Internal dependencies
14
- */
15
- import { link } from '../index';
16
-
17
- const { edit: LinkEdit } = link;
18
-
19
- // Simplified tree to render link format component
20
- const LinkEditSlot = ( props ) => (
21
- <SlotFillProvider>
22
- <Slot name="RichText.ToolbarControls.link" />
23
- <LinkEdit { ...props } />
24
- </SlotFillProvider>
25
- );
26
-
27
- jest.spyOn( Keyboard, 'dismiss' );
28
-
29
- beforeAll( () => {
30
- jest.useFakeTimers( { legacyFakeTimers: true } );
31
- } );
32
-
33
- afterAll( () => {
34
- jest.runOnlyPendingTimers();
35
- jest.useRealTimers();
36
- } );
37
-
38
- describe( 'Android', () => {
39
- it( 'improves back animation performance by dismissing keyboard beforehand', async () => {
40
- const screen = render(
41
- <LinkEditSlot
42
- activeAttributes={ {} }
43
- onChange={ () => {} }
44
- value={ {
45
- text: '',
46
- formats: [],
47
- replacements: [],
48
- } }
49
- />
50
- );
51
- fireEvent.press( screen.getByLabelText( 'Link' ) );
52
- fireEvent.press(
53
- screen.getByLabelText( 'Link to, Search or type URL' )
54
- );
55
- // Await back button to allow async state updates to complete
56
- const backButton = await screen.findByLabelText( 'Go back' );
57
- Keyboard.dismiss.mockClear();
58
- fireEvent.press( backButton );
59
-
60
- expect( Keyboard.dismiss ).toHaveBeenCalledTimes( 1 );
61
- } );
62
-
63
- it( 'improves apply animation performance by dismissing keyboard beforehand', async () => {
64
- const screen = render(
65
- <LinkEditSlot
66
- activeAttributes={ {} }
67
- onChange={ () => {} }
68
- value={ {
69
- text: '',
70
- formats: [],
71
- replacements: [],
72
- } }
73
- />
74
- );
75
- fireEvent.press( screen.getByLabelText( 'Link' ) );
76
- fireEvent.press(
77
- screen.getByLabelText( 'Link to, Search or type URL' )
78
- );
79
- // Await back button to allow async state updates to complete
80
- const backButton = await screen.findByLabelText( 'Apply' );
81
- Keyboard.dismiss.mockClear();
82
- fireEvent.press( backButton );
83
-
84
- expect( Keyboard.dismiss ).toHaveBeenCalledTimes( 1 );
85
- } );
86
- } );
87
-
88
- describe( 'iOS', () => {
89
- const originalPlatform = Platform.OS;
90
- beforeAll( () => {
91
- Platform.OS = 'ios';
92
- } );
93
-
94
- afterAll( () => {
95
- Platform.OS = originalPlatform;
96
- } );
97
-
98
- it( 'improves back animation performance by dismissing keyboard beforehand', async () => {
99
- const screen = render(
100
- <LinkEditSlot
101
- activeAttributes={ {} }
102
- onChange={ () => {} }
103
- value={ {
104
- text: '',
105
- formats: [],
106
- replacements: [],
107
- } }
108
- />
109
- );
110
- fireEvent.press( screen.getByLabelText( 'Link' ) );
111
- fireEvent.press(
112
- screen.getByLabelText( 'Link to, Search or type URL' )
113
- );
114
- // Await back button to allow async state updates to complete
115
- const backButton = await screen.findByLabelText( 'Go back' );
116
- Keyboard.dismiss.mockClear();
117
- fireEvent.press( backButton );
118
-
119
- expect( Keyboard.dismiss ).toHaveBeenCalledTimes( 1 );
120
- } );
121
-
122
- it( 'improves apply animation performance by dismissing keyboard beforehand', async () => {
123
- const screen = render(
124
- <LinkEditSlot
125
- activeAttributes={ {} }
126
- onChange={ () => {} }
127
- value={ {
128
- text: '',
129
- formats: [],
130
- replacements: [],
131
- } }
132
- />
133
- );
134
- fireEvent.press( screen.getByLabelText( 'Link' ) );
135
- fireEvent.press(
136
- screen.getByLabelText( 'Link to, Search or type URL' )
137
- );
138
- // Await back button to allow async state updates to complete
139
- const backButton = await screen.findByLabelText( 'Apply' );
140
- Keyboard.dismiss.mockClear();
141
- fireEvent.press( backButton );
142
-
143
- expect( Keyboard.dismiss ).toHaveBeenCalledTimes( 1 );
144
- } );
145
- } );