@wordpress/format-library 4.11.0 → 4.12.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 (100) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/bold/index.js +6 -8
  3. package/build/bold/index.js.map +1 -1
  4. package/build/code/index.js +6 -8
  5. package/build/code/index.js.map +1 -1
  6. package/build/image/index.js +24 -28
  7. package/build/image/index.js.map +1 -1
  8. package/build/index.js +4 -7
  9. package/build/index.js.map +1 -1
  10. package/build/italic/index.js +6 -8
  11. package/build/italic/index.js.map +1 -1
  12. package/build/keyboard/index.js +6 -8
  13. package/build/keyboard/index.js.map +1 -1
  14. package/build/language/index.js +31 -20
  15. package/build/language/index.js.map +1 -1
  16. package/build/link/index.js +17 -17
  17. package/build/link/index.js.map +1 -1
  18. package/build/link/index.native.js +2 -6
  19. package/build/link/index.native.js.map +1 -1
  20. package/build/link/inline.js +11 -11
  21. package/build/link/inline.js.map +1 -1
  22. package/build/link/modal-screens/link-picker-screen.native.js +4 -6
  23. package/build/link/modal-screens/link-picker-screen.native.js.map +1 -1
  24. package/build/link/modal-screens/link-settings-screen.native.js +25 -33
  25. package/build/link/modal-screens/link-settings-screen.native.js.map +1 -1
  26. package/build/link/modal.native.js +8 -10
  27. package/build/link/modal.native.js.map +1 -1
  28. package/build/link/utils.js +18 -44
  29. package/build/link/utils.js.map +1 -1
  30. package/build/strikethrough/index.js +6 -8
  31. package/build/strikethrough/index.js.map +1 -1
  32. package/build/subscript/index.js +6 -8
  33. package/build/subscript/index.js.map +1 -1
  34. package/build/superscript/index.js +6 -8
  35. package/build/superscript/index.js.map +1 -1
  36. package/build/text-color/index.js +11 -14
  37. package/build/text-color/index.js.map +1 -1
  38. package/build/text-color/index.native.js +16 -23
  39. package/build/text-color/index.native.js.map +1 -1
  40. package/build/text-color/inline.js +15 -21
  41. package/build/text-color/inline.js.map +1 -1
  42. package/build/text-color/inline.native.js +16 -24
  43. package/build/text-color/inline.native.js.map +1 -1
  44. package/build/underline/index.js +4 -6
  45. package/build/underline/index.js.map +1 -1
  46. package/build/unknown/index.js +6 -8
  47. package/build/unknown/index.js.map +1 -1
  48. package/build-module/bold/index.js +6 -8
  49. package/build-module/bold/index.js.map +1 -1
  50. package/build-module/code/index.js +6 -8
  51. package/build-module/code/index.js.map +1 -1
  52. package/build-module/image/index.js +24 -28
  53. package/build-module/image/index.js.map +1 -1
  54. package/build-module/index.js +4 -7
  55. package/build-module/index.js.map +1 -1
  56. package/build-module/italic/index.js +6 -8
  57. package/build-module/italic/index.js.map +1 -1
  58. package/build-module/keyboard/index.js +6 -8
  59. package/build-module/keyboard/index.js.map +1 -1
  60. package/build-module/language/index.js +31 -20
  61. package/build-module/language/index.js.map +1 -1
  62. package/build-module/link/index.js +17 -17
  63. package/build-module/link/index.js.map +1 -1
  64. package/build-module/link/index.native.js +2 -6
  65. package/build-module/link/index.native.js.map +1 -1
  66. package/build-module/link/inline.js +11 -11
  67. package/build-module/link/inline.js.map +1 -1
  68. package/build-module/link/modal-screens/link-picker-screen.native.js +4 -5
  69. package/build-module/link/modal-screens/link-picker-screen.native.js.map +1 -1
  70. package/build-module/link/modal-screens/link-settings-screen.native.js +25 -33
  71. package/build-module/link/modal-screens/link-settings-screen.native.js.map +1 -1
  72. package/build-module/link/modal.native.js +8 -9
  73. package/build-module/link/modal.native.js.map +1 -1
  74. package/build-module/link/utils.js +18 -44
  75. package/build-module/link/utils.js.map +1 -1
  76. package/build-module/strikethrough/index.js +6 -8
  77. package/build-module/strikethrough/index.js.map +1 -1
  78. package/build-module/subscript/index.js +6 -8
  79. package/build-module/subscript/index.js.map +1 -1
  80. package/build-module/superscript/index.js +6 -8
  81. package/build-module/superscript/index.js.map +1 -1
  82. package/build-module/text-color/index.js +11 -14
  83. package/build-module/text-color/index.js.map +1 -1
  84. package/build-module/text-color/index.native.js +16 -23
  85. package/build-module/text-color/index.native.js.map +1 -1
  86. package/build-module/text-color/inline.js +15 -21
  87. package/build-module/text-color/inline.js.map +1 -1
  88. package/build-module/text-color/inline.native.js +16 -24
  89. package/build-module/text-color/inline.native.js.map +1 -1
  90. package/build-module/underline/index.js +4 -6
  91. package/build-module/underline/index.js.map +1 -1
  92. package/build-module/unknown/index.js +6 -8
  93. package/build-module/unknown/index.js.map +1 -1
  94. package/package.json +13 -13
  95. package/src/language/index.js +73 -66
  96. package/src/link/index.js +4 -2
  97. package/src/link/inline.js +1 -0
  98. package/src/link/test/__snapshots__/modal.native.js.snap +476 -0
  99. package/src/link/test/index.native.js +15 -15
  100. package/src/link/test/modal.native.js +5 -2
@@ -2,7 +2,7 @@
2
2
  * External dependencies
3
3
  */
4
4
  import { Keyboard, Platform } from 'react-native';
5
- import { render, fireEvent, waitFor } from 'test/helpers';
5
+ import { render, fireEvent } from 'test/helpers';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -53,9 +53,7 @@ describe( 'Android', () => {
53
53
  screen.getByLabelText( 'Link to, Search or type URL' )
54
54
  );
55
55
  // Await back button to allow async state updates to complete
56
- const backButton = await waitFor( () =>
57
- screen.getByLabelText( 'Go back' )
58
- );
56
+ const backButton = await screen.findByLabelText( 'Go back' );
59
57
  Keyboard.dismiss.mockClear();
60
58
  fireEvent.press( backButton );
61
59
 
@@ -63,7 +61,7 @@ describe( 'Android', () => {
63
61
  } );
64
62
 
65
63
  it( 'improves apply animation performance by dismissing keyboard beforehand', async () => {
66
- const { getByLabelText } = render(
64
+ const screen = render(
67
65
  <LinkEditSlot
68
66
  activeAttributes={ {} }
69
67
  onChange={ () => {} }
@@ -74,10 +72,12 @@ describe( 'Android', () => {
74
72
  } }
75
73
  />
76
74
  );
77
- fireEvent.press( getByLabelText( 'Link' ) );
78
- fireEvent.press( getByLabelText( 'Link to, Search or type URL' ) );
75
+ fireEvent.press( screen.getByLabelText( 'Link' ) );
76
+ fireEvent.press(
77
+ screen.getByLabelText( 'Link to, Search or type URL' )
78
+ );
79
79
  // Await back button to allow async state updates to complete
80
- const backButton = await waitFor( () => getByLabelText( 'Apply' ) );
80
+ const backButton = await screen.findByLabelText( 'Apply' );
81
81
  Keyboard.dismiss.mockClear();
82
82
  fireEvent.press( backButton );
83
83
 
@@ -112,9 +112,7 @@ describe( 'iOS', () => {
112
112
  screen.getByLabelText( 'Link to, Search or type URL' )
113
113
  );
114
114
  // Await back button to allow async state updates to complete
115
- const backButton = await waitFor( () =>
116
- screen.getByLabelText( 'Go back' )
117
- );
115
+ const backButton = await screen.findByLabelText( 'Go back' );
118
116
  Keyboard.dismiss.mockClear();
119
117
  fireEvent.press( backButton );
120
118
 
@@ -122,7 +120,7 @@ describe( 'iOS', () => {
122
120
  } );
123
121
 
124
122
  it( 'improves apply animation performance by dismissing keyboard beforehand', async () => {
125
- const { getByLabelText } = render(
123
+ const screen = render(
126
124
  <LinkEditSlot
127
125
  activeAttributes={ {} }
128
126
  onChange={ () => {} }
@@ -133,10 +131,12 @@ describe( 'iOS', () => {
133
131
  } }
134
132
  />
135
133
  );
136
- fireEvent.press( getByLabelText( 'Link' ) );
137
- fireEvent.press( getByLabelText( 'Link to, Search or type URL' ) );
134
+ fireEvent.press( screen.getByLabelText( 'Link' ) );
135
+ fireEvent.press(
136
+ screen.getByLabelText( 'Link to, Search or type URL' )
137
+ );
138
138
  // Await back button to allow async state updates to complete
139
- const backButton = await waitFor( () => getByLabelText( 'Apply' ) );
139
+ const backButton = await screen.findByLabelText( 'Apply' );
140
140
  Keyboard.dismiss.mockClear();
141
141
  fireEvent.press( backButton );
142
142
 
@@ -9,7 +9,10 @@ import { render } from 'test/helpers';
9
9
 
10
10
  describe( 'LinksUI', () => {
11
11
  it( 'LinksUI renders', () => {
12
- const screen = render( <ModalLinkUI /> );
13
- expect( screen.container ).toBeTruthy();
12
+ const value = { text: '' }; // empty `RichTextValue`
13
+ const screen = render(
14
+ <ModalLinkUI isVisible value={ value } activeAttributes={ {} } />
15
+ );
16
+ expect( screen.toJSON() ).toMatchSnapshot();
14
17
  } );
15
18
  } );