newspack-components 2.2.1 → 3.0.0-alpha.2

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 (308) hide show
  1. package/babel.config.js +25 -0
  2. package/copy-styles.js +2 -10
  3. package/dist/{cjs/accordion → accordion}/index.js +17 -13
  4. package/dist/{cjs/accordion → accordion}/style.scss +7 -3
  5. package/dist/{cjs/action-card → action-card}/index.js +39 -43
  6. package/dist/{esm/action-card → action-card}/style.scss +9 -9
  7. package/dist/{cjs/autocomplete-tokenfield → autocomplete-tokenfield}/index.js +67 -29
  8. package/dist/{esm/autocomplete-tokenfield → autocomplete-tokenfield}/style.scss +14 -8
  9. package/dist/{cjs/autocomplete-with-suggestions → autocomplete-with-suggestions}/index.js +61 -73
  10. package/dist/{esm/autocomplete-with-suggestions → autocomplete-with-suggestions}/style.scss +9 -17
  11. package/dist/button/index.js +51 -0
  12. package/{src/button/index.js → dist/button/index.tsx} +12 -5
  13. package/dist/{cjs/button → button}/style.scss +1 -1
  14. package/dist/{cjs/button-card → button-card}/index.js +9 -10
  15. package/dist/{cjs/button-card → button-card}/style.scss +19 -13
  16. package/dist/{cjs/card → card}/index.js +4 -5
  17. package/dist/{esm/card → card}/style.scss +1 -1
  18. package/dist/{cjs/category-autocomplete → category-autocomplete}/index.js +51 -53
  19. package/dist/{esm/category-autocomplete → category-autocomplete}/style.scss +2 -2
  20. package/dist/{cjs/color-picker → color-picker}/index.js +14 -16
  21. package/dist/{cjs/color-picker → color-picker}/style.scss +3 -3
  22. package/dist/consts.js +7 -0
  23. package/dist/{cjs/custom-select-control → custom-select-control}/index.js +4 -5
  24. package/dist/{cjs/custom-select-control → custom-select-control}/style.scss +11 -10
  25. package/dist/{cjs/date-range-picker → date-range-picker}/index.js +9 -11
  26. package/dist/{cjs/date-range-picker → date-range-picker}/style.scss +6 -6
  27. package/dist/{cjs/footer → footer}/index.js +33 -36
  28. package/dist/{cjs/footer → footer}/style.scss +1 -1
  29. package/dist/{cjs/form-token-field → form-token-field}/index.js +6 -7
  30. package/dist/{esm/form-token-field → form-token-field}/style.scss +1 -1
  31. package/dist/{cjs/global-notices → global-notices}/index.js +4 -5
  32. package/dist/grid/index.js +44 -0
  33. package/dist/grid/index.tsx +34 -0
  34. package/dist/{cjs/grid → grid}/style.scss +9 -9
  35. package/dist/{cjs/handoff → handoff}/index.js +73 -71
  36. package/dist/{cjs/handoff-message → handoff-message}/index.js +5 -3
  37. package/dist/hooks/index.js +29 -0
  38. package/{src/hooks/index.js → dist/hooks/index.ts} +1 -1
  39. package/dist/{cjs/hooks → hooks}/useObjectState.js +2 -3
  40. package/dist/{cjs/hooks → hooks}/useObjectState.test.js +9 -9
  41. package/dist/{cjs/hooks → hooks}/useOnClickOutside.js +1 -2
  42. package/dist/hooks/usePrompt.js +47 -0
  43. package/{src/hooks/usePrompt.js → dist/hooks/usePrompt.ts} +4 -8
  44. package/dist/image-upload/index.js +148 -0
  45. package/dist/{cjs/image-upload → image-upload}/index.test.js +13 -6
  46. package/dist/{esm/image-upload → image-upload}/style.scss +5 -5
  47. package/dist/{cjs/index.js → index.js} +1 -1
  48. package/dist/{cjs/info-button → info-button}/index.js +6 -7
  49. package/dist/{cjs/modal → modal}/index.js +4 -5
  50. package/dist/{esm/modal → modal}/style.scss +5 -5
  51. package/dist/{cjs/newspack-icon → newspack-icon}/index.js +5 -6
  52. package/dist/{cjs/newspack-icon → newspack-icon}/style.scss +1 -1
  53. package/dist/{cjs/newspack-logo → newspack-logo}/index.js +5 -6
  54. package/dist/{cjs/newspack-logo → newspack-logo}/style.scss +1 -1
  55. package/dist/{cjs/notice → notice}/index.js +12 -10
  56. package/dist/{cjs/notice → notice}/style.scss +11 -11
  57. package/dist/patrons-logo/index.js +77 -0
  58. package/dist/plugin-installer/index.js +297 -0
  59. package/dist/{cjs/plugin-installer → plugin-installer}/style.scss +1 -1
  60. package/dist/{cjs/plugin-settings → plugin-settings}/SettingsSection.js +13 -13
  61. package/dist/plugin-settings/index.js +228 -0
  62. package/dist/{cjs/plugin-settings → plugin-settings}/style.scss +1 -1
  63. package/dist/plugin-toggle/README.md +53 -0
  64. package/dist/plugin-toggle/index.js +222 -0
  65. package/dist/{esm/plugin-toggle → plugin-toggle}/style.scss +1 -1
  66. package/dist/{cjs/popover → popover}/index.js +4 -5
  67. package/dist/{cjs/popover → popover}/style.scss +7 -7
  68. package/dist/{cjs/position-control → position-control}/index.js +33 -32
  69. package/dist/{cjs/position-control → position-control}/style.scss +8 -8
  70. package/dist/{cjs/progress-bar → progress-bar}/index.js +9 -10
  71. package/dist/{cjs/progress-bar → progress-bar}/index.test.js +16 -16
  72. package/dist/{cjs/progress-bar → progress-bar}/style.scss +2 -2
  73. package/dist/proxied-imports/router.js +15 -0
  74. package/dist/{cjs/radio-control → radio-control}/index.js +4 -5
  75. package/dist/{cjs/radio-control → radio-control}/style.scss +3 -3
  76. package/dist/{cjs/section-header → section-header}/index.js +20 -21
  77. package/dist/{esm/section-header → section-header}/style.scss +5 -1
  78. package/dist/{cjs/select-control → select-control}/ButtonGroupControl.js +17 -19
  79. package/dist/{cjs/select-control → select-control}/GroupedSelectControl.js +32 -35
  80. package/dist/{cjs/select-control → select-control}/index.js +7 -8
  81. package/dist/{cjs/select-control → select-control}/style.scss +4 -4
  82. package/dist/settings/MinMaxSetting.js +60 -0
  83. package/dist/{cjs/settings → settings}/SettingsCard.js +14 -16
  84. package/dist/settings/SettingsSection.js +33 -0
  85. package/dist/{cjs/settings → settings}/index.js +3 -4
  86. package/dist/{cjs/settings → settings}/style.scss +15 -2
  87. package/dist/sortable-newsletter-list-control/index.js +135 -0
  88. package/dist/sortable-newsletter-list-control/style.scss +45 -0
  89. package/dist/{cjs/steps-list → steps-list}/index.js +5 -6
  90. package/dist/{esm/steps-list → steps-list}/style.scss +2 -2
  91. package/dist/{cjs/steps-list-item → steps-list-item}/index.js +6 -7
  92. package/dist/{cjs/steps-list-item → steps-list-item}/style.scss +5 -5
  93. package/dist/{cjs/style-card → style-card}/index.js +21 -19
  94. package/dist/{esm/style-card → style-card}/style.scss +4 -4
  95. package/dist/{esm/style.scss → style.scss} +14 -2
  96. package/dist/{cjs/tabbed-navigation → tabbed-navigation}/index.js +16 -19
  97. package/dist/{cjs/tabbed-navigation → tabbed-navigation}/style.scss +4 -4
  98. package/dist/text-control/index.js +76 -0
  99. package/dist/text-control/index.tsx +71 -0
  100. package/dist/utils/index.js +36 -0
  101. package/dist/{cjs/waiting → waiting}/index.js +4 -5
  102. package/dist/web-preview/index.js +191 -0
  103. package/dist/{cjs/web-preview → web-preview}/style.scss +5 -5
  104. package/dist/with-wizard/index.js +328 -0
  105. package/dist/{esm/with-wizard → with-wizard}/style.scss +44 -22
  106. package/dist/{cjs/with-wizard-screen → with-wizard-screen}/index.js +40 -43
  107. package/dist/{esm/with-wizard-screen → with-wizard-screen}/style.scss +7 -7
  108. package/dist/{cjs/wizard → wizard}/components/WizardError.js +16 -17
  109. package/dist/{cjs/wizard → wizard}/index.js +44 -46
  110. package/dist/{cjs/wizard → wizard}/store/index.js +37 -38
  111. package/dist/{cjs/wizard → wizard}/store/utils.js +1 -4
  112. package/package.json +16 -14
  113. package/shared/scss/_mixins.scss +2 -2
  114. package/src/accordion/index.js +4 -1
  115. package/src/accordion/style.scss +7 -3
  116. package/src/action-card/style.scss +9 -9
  117. package/src/autocomplete-tokenfield/index.js +48 -15
  118. package/src/autocomplete-tokenfield/style.scss +14 -8
  119. package/src/autocomplete-with-suggestions/index.js +59 -62
  120. package/src/autocomplete-with-suggestions/style.scss +9 -17
  121. package/src/button/index.tsx +48 -0
  122. package/src/button/style.scss +1 -1
  123. package/src/button-card/style.scss +19 -13
  124. package/src/card/style.scss +1 -1
  125. package/src/category-autocomplete/style.scss +2 -2
  126. package/src/color-picker/style.scss +3 -3
  127. package/src/consts.js +0 -2
  128. package/src/custom-select-control/style.scss +11 -10
  129. package/src/date-range-picker/style.scss +6 -6
  130. package/src/footer/index.js +7 -7
  131. package/src/footer/style.scss +1 -1
  132. package/src/form-token-field/style.scss +1 -1
  133. package/src/grid/index.tsx +34 -0
  134. package/src/grid/style.scss +9 -9
  135. package/src/handoff/index.js +7 -6
  136. package/src/handoff-message/index.js +3 -1
  137. package/src/hooks/index.ts +15 -0
  138. package/src/hooks/usePrompt.ts +46 -0
  139. package/src/image-upload/index.js +5 -5
  140. package/src/image-upload/index.test.js +6 -1
  141. package/src/image-upload/style.scss +5 -5
  142. package/src/modal/style.scss +5 -5
  143. package/src/newspack-icon/style.scss +1 -1
  144. package/src/newspack-logo/style.scss +1 -1
  145. package/src/notice/index.js +1 -1
  146. package/src/notice/style.scss +11 -11
  147. package/src/patrons-logo/index.js +4 -1
  148. package/src/plugin-installer/index.js +7 -7
  149. package/src/plugin-installer/style.scss +1 -1
  150. package/src/plugin-settings/index.js +1 -1
  151. package/src/plugin-settings/style.scss +1 -1
  152. package/src/plugin-toggle/index.js +13 -12
  153. package/src/plugin-toggle/style.scss +1 -1
  154. package/src/popover/style.scss +7 -7
  155. package/src/position-control/index.js +63 -64
  156. package/src/position-control/style.scss +8 -8
  157. package/src/progress-bar/style.scss +2 -2
  158. package/src/radio-control/style.scss +3 -3
  159. package/src/section-header/index.js +3 -3
  160. package/src/section-header/style.scss +5 -1
  161. package/src/select-control/GroupedSelectControl.js +1 -1
  162. package/src/select-control/style.scss +4 -4
  163. package/src/settings/MinMaxSetting.js +8 -6
  164. package/src/settings/style.scss +15 -2
  165. package/src/sortable-newsletter-list-control/index.js +137 -0
  166. package/src/sortable-newsletter-list-control/style.scss +45 -0
  167. package/src/steps-list/style.scss +2 -2
  168. package/src/steps-list-item/style.scss +5 -5
  169. package/src/style-card/index.js +11 -5
  170. package/src/style-card/style.scss +4 -4
  171. package/src/style.scss +14 -2
  172. package/src/tabbed-navigation/style.scss +4 -4
  173. package/src/text-control/index.tsx +65 -0
  174. package/src/web-preview/index.js +6 -6
  175. package/src/web-preview/style.scss +5 -5
  176. package/src/with-wizard/index.js +4 -4
  177. package/src/with-wizard/style.scss +44 -22
  178. package/src/with-wizard-screen/index.js +1 -1
  179. package/src/with-wizard-screen/style.scss +7 -7
  180. package/src/wizard/components/WizardError.js +1 -1
  181. package/src/wizard/index.js +3 -3
  182. package/src/wizard/store/index.js +9 -2
  183. package/dist/cjs/action-card/style.scss +0 -483
  184. package/dist/cjs/autocomplete-tokenfield/style.scss +0 -43
  185. package/dist/cjs/autocomplete-with-suggestions/style.scss +0 -171
  186. package/dist/cjs/button/index.js +0 -57
  187. package/dist/cjs/card/style.scss +0 -168
  188. package/dist/cjs/category-autocomplete/style.scss +0 -34
  189. package/dist/cjs/consts.js +0 -12
  190. package/dist/cjs/form-token-field/style.scss +0 -37
  191. package/dist/cjs/grid/index.js +0 -54
  192. package/dist/cjs/hooks/index.js +0 -26
  193. package/dist/cjs/hooks/usePrompt.js +0 -52
  194. package/dist/cjs/image-upload/index.js +0 -144
  195. package/dist/cjs/image-upload/style.scss +0 -103
  196. package/dist/cjs/modal/style.scss +0 -56
  197. package/dist/cjs/patrons-logo/index.js +0 -82
  198. package/dist/cjs/plugin-installer/index.js +0 -299
  199. package/dist/cjs/plugin-settings/index.js +0 -222
  200. package/dist/cjs/plugin-toggle/index.js +0 -222
  201. package/dist/cjs/plugin-toggle/style.scss +0 -20
  202. package/dist/cjs/proxied-imports/router.js +0 -15
  203. package/dist/cjs/section-header/style.scss +0 -41
  204. package/dist/cjs/settings/MinMaxSetting.js +0 -57
  205. package/dist/cjs/settings/SettingsSection.js +0 -37
  206. package/dist/cjs/steps-list/style.scss +0 -11
  207. package/dist/cjs/style-card/style.scss +0 -94
  208. package/dist/cjs/style.scss +0 -43
  209. package/dist/cjs/text-control/index.js +0 -71
  210. package/dist/cjs/utils/index.js +0 -40
  211. package/dist/cjs/web-preview/index.js +0 -189
  212. package/dist/cjs/with-wizard/index.js +0 -318
  213. package/dist/cjs/with-wizard/style.scss +0 -260
  214. package/dist/cjs/with-wizard-screen/style.scss +0 -160
  215. package/dist/esm/accordion/index.js +0 -38
  216. package/dist/esm/accordion/style.scss +0 -27
  217. package/dist/esm/action-card/index.js +0 -222
  218. package/dist/esm/autocomplete-tokenfield/index.js +0 -223
  219. package/dist/esm/autocomplete-with-suggestions/index.js +0 -289
  220. package/dist/esm/button/index.js +0 -48
  221. package/dist/esm/button/style.scss +0 -11
  222. package/dist/esm/button-card/index.js +0 -65
  223. package/dist/esm/button-card/style.scss +0 -174
  224. package/dist/esm/card/index.js +0 -43
  225. package/dist/esm/category-autocomplete/index.js +0 -185
  226. package/dist/esm/color-picker/index.js +0 -61
  227. package/dist/esm/color-picker/style.scss +0 -37
  228. package/dist/esm/consts.js +0 -3
  229. package/dist/esm/custom-select-control/index.js +0 -37
  230. package/dist/esm/custom-select-control/style.scss +0 -92
  231. package/dist/esm/date-range-picker/index.js +0 -32
  232. package/dist/esm/date-range-picker/style.scss +0 -148
  233. package/dist/esm/footer/index.js +0 -105
  234. package/dist/esm/footer/style.scss +0 -82
  235. package/dist/esm/form-token-field/index.js +0 -50
  236. package/dist/esm/global-notices/index.js +0 -30
  237. package/dist/esm/grid/index.js +0 -45
  238. package/dist/esm/grid/style.scss +0 -166
  239. package/dist/esm/handoff/index.js +0 -177
  240. package/dist/esm/handoff-message/index.js +0 -45
  241. package/dist/esm/hooks/index.js +0 -17
  242. package/dist/esm/hooks/useObjectState.js +0 -31
  243. package/dist/esm/hooks/useObjectState.test.js +0 -83
  244. package/dist/esm/hooks/useOnClickOutside.js +0 -31
  245. package/dist/esm/hooks/usePrompt.js +0 -43
  246. package/dist/esm/image-upload/index.js +0 -141
  247. package/dist/esm/image-upload/index.test.js +0 -28
  248. package/dist/esm/index.js +0 -47
  249. package/dist/esm/info-button/index.js +0 -42
  250. package/dist/esm/info-button/style.scss +0 -18
  251. package/dist/esm/modal/index.js +0 -39
  252. package/dist/esm/newspack-icon/index.js +0 -50
  253. package/dist/esm/newspack-icon/style.scss +0 -26
  254. package/dist/esm/newspack-logo/index.js +0 -46
  255. package/dist/esm/newspack-logo/style.scss +0 -30
  256. package/dist/esm/notice/index.js +0 -67
  257. package/dist/esm/notice/style.scss +0 -111
  258. package/dist/esm/patrons-logo/index.js +0 -76
  259. package/dist/esm/plugin-installer/index.js +0 -295
  260. package/dist/esm/plugin-installer/style.scss +0 -72
  261. package/dist/esm/plugin-settings/SettingsSection.js +0 -136
  262. package/dist/esm/plugin-settings/index.js +0 -217
  263. package/dist/esm/plugin-settings/style.scss +0 -7
  264. package/dist/esm/plugin-toggle/index.js +0 -217
  265. package/dist/esm/popover/index.js +0 -41
  266. package/dist/esm/popover/style.scss +0 -161
  267. package/dist/esm/position-control/index.js +0 -109
  268. package/dist/esm/position-control/style.scss +0 -66
  269. package/dist/esm/progress-bar/index.js +0 -69
  270. package/dist/esm/progress-bar/index.test.js +0 -110
  271. package/dist/esm/progress-bar/style.scss +0 -42
  272. package/dist/esm/proxied-imports/router.js +0 -8
  273. package/dist/esm/radio-control/index.js +0 -37
  274. package/dist/esm/radio-control/style.scss +0 -92
  275. package/dist/esm/section-header/index.js +0 -68
  276. package/dist/esm/select-control/ButtonGroupControl.js +0 -54
  277. package/dist/esm/select-control/GroupedSelectControl.js +0 -84
  278. package/dist/esm/select-control/index.js +0 -51
  279. package/dist/esm/select-control/style.scss +0 -108
  280. package/dist/esm/settings/MinMaxSetting.js +0 -53
  281. package/dist/esm/settings/SettingsCard.js +0 -39
  282. package/dist/esm/settings/SettingsSection.js +0 -30
  283. package/dist/esm/settings/index.js +0 -9
  284. package/dist/esm/settings/style.scss +0 -106
  285. package/dist/esm/steps-list/index.js +0 -43
  286. package/dist/esm/steps-list-item/index.js +0 -48
  287. package/dist/esm/steps-list-item/style.scss +0 -47
  288. package/dist/esm/style-card/index.js +0 -76
  289. package/dist/esm/tabbed-navigation/index.js +0 -56
  290. package/dist/esm/tabbed-navigation/style.scss +0 -86
  291. package/dist/esm/text-control/index.js +0 -66
  292. package/dist/esm/text-control/style.scss +0 -32
  293. package/dist/esm/utils/index.js +0 -32
  294. package/dist/esm/waiting/index.js +0 -44
  295. package/dist/esm/waiting/style.scss +0 -27
  296. package/dist/esm/web-preview/index.js +0 -184
  297. package/dist/esm/web-preview/style.scss +0 -155
  298. package/dist/esm/with-wizard/index.js +0 -313
  299. package/dist/esm/with-wizard-screen/index.js +0 -116
  300. package/dist/esm/wizard/components/WizardError.js +0 -69
  301. package/dist/esm/wizard/index.js +0 -126
  302. package/dist/esm/wizard/store/index.js +0 -155
  303. package/dist/esm/wizard/store/utils.js +0 -17
  304. package/src/grid/index.js +0 -44
  305. package/src/text-control/index.js +0 -56
  306. /package/dist/{cjs/info-button → info-button}/style.scss +0 -0
  307. /package/dist/{cjs/text-control → text-control}/style.scss +0 -0
  308. /package/dist/{cjs/waiting → waiting}/style.scss +0 -0
@@ -2,14 +2,14 @@
2
2
  * With Wizard
3
3
  */
4
4
 
5
- @use '~@wordpress/base-styles/colors' as wp-colors;
6
- @use '../../../shared/scss/colors';
5
+ @use "~@wordpress/base-styles/colors" as wp-colors;
6
+ @use "../../../shared/scss/colors";
7
7
 
8
8
  // Reset Padding of the Admin Page
9
9
 
10
- .toplevel_page_newspack:not( .menu-top ),
11
- body[class*='newspack_page_newspack-'],
12
- body[class*='admin_page_newspack-'] {
10
+ .toplevel_page_newspack:not(.menu-top),
11
+ body[class*="newspack_page_newspack-"],
12
+ body[class*="admin_page_newspack-"] {
13
13
  background: white;
14
14
 
15
15
  #wpcontent {
@@ -33,7 +33,7 @@ body[class*='admin_page_newspack-'] {
33
33
  svg {
34
34
  &.newspack--error {
35
35
  fill: wp-colors.$alert-red;
36
- transform: rotate( 180deg );
36
+ transform: rotate(180deg);
37
37
  }
38
38
  &.newspack--success {
39
39
  fill: wp-colors.$alert-green;
@@ -87,38 +87,51 @@ svg {
87
87
  &::before,
88
88
  &::after {
89
89
  animation: loading 2s ease-in-out infinite;
90
- content: '';
90
+ content: "";
91
91
  display: block;
92
92
  }
93
93
 
94
94
  &::before {
95
95
  background: colors.$primary-500;
96
- box-shadow: 24px 0 0 white, 69px 0 0 -15px wp-colors.$gray-900,
97
- 99px 0 0 -15px wp-colors.$gray-900, 129px 0 0 -15px wp-colors.$gray-900,
98
- 159px 0 0 -15px wp-colors.$gray-900, 189px 0 0 -15px wp-colors.$gray-900;
96
+ box-shadow:
97
+ 24px 0 0 white,
98
+ 69px 0 0 -15px wp-colors.$gray-900,
99
+ 99px 0 0 -15px wp-colors.$gray-900,
100
+ 129px 0 0 -15px wp-colors.$gray-900,
101
+ 159px 0 0 -15px wp-colors.$gray-900,
102
+ 189px 0 0 -15px wp-colors.$gray-900;
99
103
  height: 60px;
100
104
  width: 60px;
101
105
  }
102
106
 
103
107
  &::after {
104
108
  background: wp-colors.$gray-900;
105
- box-shadow: inset -40vw 0 0 0 white, 0 64px 0 0 wp-colors.$gray-700, 40vw 96px 0 0 white,
109
+ box-shadow:
110
+ inset -40vw 0 0 0 white,
111
+ 0 64px 0 0 wp-colors.$gray-700,
112
+ 40vw 96px 0 0 white,
106
113
  0 96px 0 0 wp-colors.$gray-700;
107
114
  height: 24px;
108
115
  margin: 68px auto 0;
109
116
  max-width: 1040px;
110
- width: calc( 100% - ( 32px * 2 ) );
117
+ width: calc(100% - ( 32px * 2 ));
111
118
 
112
119
  @media screen and ( min-width: 744px ) {
113
- box-shadow: inset -400px 0 0 0 white, 0 64px 0 0 wp-colors.$gray-700, 200px 96px 0 0 white,
120
+ box-shadow:
121
+ inset -400px 0 0 0 white,
122
+ 0 64px 0 0 wp-colors.$gray-700,
123
+ 200px 96px 0 0 white,
114
124
  0 96px 0 0 wp-colors.$gray-700;
115
- width: calc( 100% - ( 64px * 2 ) );
125
+ width: calc(100% - ( 64px * 2 ));
116
126
  }
117
127
 
118
128
  @media screen and ( min-width: 1224px ) {
119
- box-shadow: inset -600px 0 0 0 white, 0 64px 0 0 wp-colors.$gray-700, 512px 96px 0 0 white,
129
+ box-shadow:
130
+ inset -600px 0 0 0 white,
131
+ 0 64px 0 0 wp-colors.$gray-700,
132
+ 512px 96px 0 0 white,
120
133
  0 96px 0 0 wp-colors.$gray-700;
121
- width: calc( 100% - ( 64px * 2 ) );
134
+ width: calc(100% - ( 64px * 2 ));
122
135
  }
123
136
  }
124
137
 
@@ -151,7 +164,7 @@ svg {
151
164
 
152
165
  &::before,
153
166
  &::after {
154
- content: '';
167
+ content: "";
155
168
  cursor: wait;
156
169
  display: block;
157
170
  left: 0;
@@ -187,7 +200,7 @@ svg {
187
200
  }
188
201
 
189
202
  &::after {
190
- background: rgba( white, 0.7 );
203
+ background: rgba(white, 0.7);
191
204
  bottom: 0;
192
205
  right: 0;
193
206
  z-index: 9998;
@@ -206,10 +219,13 @@ svg {
206
219
 
207
220
  &::after {
208
221
  animation: loading 2s ease-in-out infinite;
209
- content: '';
222
+ content: "";
210
223
  display: block;
211
224
  background: wp-colors.$gray-900;
212
- box-shadow: inset -40vw 0 0 0 white, 0 64px 0 0 wp-colors.$gray-700, 40vw 96px 0 0 white,
225
+ box-shadow:
226
+ inset -40vw 0 0 0 white,
227
+ 0 64px 0 0 wp-colors.$gray-700,
228
+ 40vw 96px 0 0 white,
213
229
  0 96px 0 0 wp-colors.$gray-700;
214
230
  height: 24px;
215
231
  margin: 0 auto;
@@ -217,12 +233,18 @@ svg {
217
233
  width: 100%;
218
234
 
219
235
  @media screen and ( min-width: 744px ) {
220
- box-shadow: inset -400px 0 0 0 white, 0 64px 0 0 wp-colors.$gray-700, 200px 96px 0 0 white,
236
+ box-shadow:
237
+ inset -400px 0 0 0 white,
238
+ 0 64px 0 0 wp-colors.$gray-700,
239
+ 200px 96px 0 0 white,
221
240
  0 96px 0 0 wp-colors.$gray-700;
222
241
  }
223
242
 
224
243
  @media screen and ( min-width: 1224px ) {
225
- box-shadow: inset -600px 0 0 0 white, 0 64px 0 0 wp-colors.$gray-700, 520px 96px 0 0 white,
244
+ box-shadow:
245
+ inset -600px 0 0 0 white,
246
+ 0 64px 0 0 wp-colors.$gray-700,
247
+ 520px 96px 0 0 white,
226
248
  0 96px 0 0 wp-colors.$gray-700;
227
249
  }
228
250
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
@@ -11,24 +11,24 @@ var _ = require("../");
11
11
  var _js = require("../../../shared/js/");
12
12
  require("./style.scss");
13
13
  var _classnames = _interopRequireDefault(require("classnames"));
14
- var _jsxRuntime = require("@emotion/react/jsx-runtime");
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
15
  /**
16
16
  * WordPress dependencies.
17
17
  */
18
- const __ = _i18n.__;
18
+
19
19
  /**
20
20
  * Internal dependencies
21
21
  */
22
+
22
23
  /**
23
24
  * External dependencies
24
25
  */
26
+
25
27
  /**
26
28
  * Higher-Order Component to provide plugin management and error handling to Newspack Wizards.
27
- */
28
- function withWizardScreen(WrappedComponent) {
29
- let {
30
- hidePrimaryButton
31
- } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
29
+ */function withWizardScreen(WrappedComponent, {
30
+ hidePrimaryButton
31
+ } = {}) {
32
32
  const WrappedWithWizardScreen = props => {
33
33
  const {
34
34
  className,
@@ -48,64 +48,61 @@ function withWizardScreen(WrappedComponent) {
48
48
  const SecondaryCTAComponent = retrievedSecondaryButtonProps.plugin ? _.Handoff : _.Button;
49
49
  const shouldRenderPrimaryButton = buttonText && buttonAction;
50
50
  const shouldRenderSecondaryButton = secondaryButtonText && secondaryButtonAction;
51
- const renderPrimaryButton = function () {
52
- let overridingProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
53
- return retrievedButtonProps.plugin ? (0, _jsxRuntime.jsx)(_.Handoff, {
54
- isPrimary: true,
55
- ...retrievedButtonProps,
56
- ...overridingProps,
57
- children: buttonText
58
- }) : (0, _jsxRuntime.jsx)(_.Button, {
59
- isPrimary: !buttonDisabled,
60
- isSecondary: !!buttonDisabled,
61
- disabled: buttonDisabled
62
- // Allow overridingProps to set children.
63
- // eslint-disable-next-line react/no-children-prop
64
- ,
65
- children: buttonText,
66
- ...retrievedButtonProps,
67
- ...overridingProps
68
- });
69
- };
70
- return (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
71
- children: [newspack_aux_data.is_debug_mode && (0, _jsxRuntime.jsx)(_.Notice, {
51
+ const renderPrimaryButton = (overridingProps = {}) => retrievedButtonProps.plugin ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Handoff, {
52
+ isPrimary: true,
53
+ ...retrievedButtonProps,
54
+ ...overridingProps,
55
+ children: buttonText
56
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Button, {
57
+ isPrimary: !buttonDisabled,
58
+ isSecondary: !!buttonDisabled,
59
+ disabled: buttonDisabled
60
+ // Allow overridingProps to set children.
61
+ // eslint-disable-next-line react/no-children-prop
62
+ ,
63
+ children: buttonText,
64
+ ...retrievedButtonProps,
65
+ ...overridingProps
66
+ });
67
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
68
+ children: [newspack_aux_data.is_debug_mode && /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Notice, {
72
69
  debugMode: true
73
- }), (0, _jsxRuntime.jsx)("div", {
70
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
74
71
  className: "newspack-wizard__header",
75
- children: (0, _jsxRuntime.jsx)("div", {
72
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
76
73
  className: "newspack-wizard__header__inner",
77
- children: (0, _jsxRuntime.jsxs)("div", {
74
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
78
75
  className: "newspack-wizard__title",
79
- children: [(0, _jsxRuntime.jsx)(_.Button, {
76
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.Button, {
80
77
  isLink: true,
81
78
  href: newspack_urls.dashboard,
82
- label: __('Return to Dashboard', 'newspack'),
79
+ label: (0, _i18n.__)('Return to Dashboard', 'newspack-plugin'),
83
80
  showTooltip: true,
84
81
  icon: _icons.category,
85
82
  iconSize: 36,
86
- children: (0, _jsxRuntime.jsx)(_.NewspackIcon, {
83
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.NewspackIcon, {
87
84
  size: 36
88
85
  })
89
- }), (0, _jsxRuntime.jsxs)("div", {
90
- children: [headerText && (0, _jsxRuntime.jsx)("h2", {
86
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
87
+ children: [headerText && /*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
91
88
  children: headerText
92
- }), subHeaderText && (0, _jsxRuntime.jsx)("span", {
89
+ }), subHeaderText && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
93
90
  children: subHeaderText
94
91
  })]
95
92
  })]
96
93
  })
97
94
  })
98
- }), tabbedNavigation && (0, _jsxRuntime.jsx)(_.TabbedNavigation, {
95
+ }), tabbedNavigation && /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TabbedNavigation, {
99
96
  disableUpcoming: disableUpcomingInTabbedNavigation,
100
97
  items: tabbedNavigation.filter(item => !item.isHiddenInNav)
101
- }), (0, _jsxRuntime.jsx)(_.HandoffMessage, {}), (0, _jsxRuntime.jsxs)("div", {
98
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.HandoffMessage, {}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
102
99
  className: (0, _classnames.default)('newspack-wizard newspack-wizard__content', className),
103
- children: [typeof renderAboveContent === 'function' ? renderAboveContent() : null, (0, _jsxRuntime.jsx)(WrappedComponent, {
100
+ children: [typeof renderAboveContent === 'function' ? renderAboveContent() : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(WrappedComponent, {
104
101
  ...props,
105
102
  renderPrimaryButton: renderPrimaryButton
106
- }), (shouldRenderPrimaryButton || shouldRenderSecondaryButton) && (0, _jsxRuntime.jsxs)("div", {
103
+ }), (shouldRenderPrimaryButton || shouldRenderSecondaryButton) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
107
104
  className: "newspack-buttons-card",
108
- children: [shouldRenderPrimaryButton && !hidePrimaryButton && renderPrimaryButton(), shouldRenderSecondaryButton && (0, _jsxRuntime.jsx)(SecondaryCTAComponent, {
105
+ children: [shouldRenderPrimaryButton && !hidePrimaryButton && renderPrimaryButton(), shouldRenderSecondaryButton && /*#__PURE__*/(0, _jsxRuntime.jsx)(SecondaryCTAComponent, {
109
106
  isSecondary: true,
110
107
  ...retrievedSecondaryButtonProps,
111
108
  children: secondaryButtonText
@@ -2,8 +2,8 @@
2
2
  * With Wizard Screen
3
3
  */
4
4
 
5
- @use '~@wordpress/base-styles/colors' as wp-colors;
6
- @use '../../../shared/scss/colors';
5
+ @use "~@wordpress/base-styles/colors" as wp-colors;
6
+ @use "../../../shared/scss/colors";
7
7
 
8
8
  .newspack-wizard {
9
9
  // Color
@@ -29,16 +29,16 @@
29
29
 
30
30
  // Links
31
31
  a {
32
- color: var( --wp-admin-theme-color );
32
+ color: var(--wp-admin-theme-color);
33
33
 
34
34
  &:active,
35
35
  &:focus,
36
36
  &:hover {
37
- color: var( --wp-admin-theme-color-darker-10 );
37
+ color: var(--wp-admin-theme-color-darker-10);
38
38
  }
39
39
 
40
40
  &:focus {
41
- box-shadow: 0 0 0 var( --wp-admin-border-width-focus ) var( --wp-admin-theme-color );
41
+ box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
42
42
  outline: 3px solid transparent;
43
43
  }
44
44
  }
@@ -82,7 +82,7 @@
82
82
  margin-bottom: -1px !important;
83
83
  }
84
84
 
85
- &:not( .newspack-icon ) {
85
+ &:not(.newspack-icon) {
86
86
  background: colors.$primary-500;
87
87
  left: 50%;
88
88
  margin: -28px 0 0 -28px !important;
@@ -110,7 +110,7 @@
110
110
  &::before {
111
111
  border: 2px solid white;
112
112
  border-radius: 2px;
113
- content: '';
113
+ content: "";
114
114
  display: block;
115
115
  inset: 6px 6px 5px;
116
116
  position: absolute;
@@ -8,20 +8,20 @@ var _i18n = require("@wordpress/i18n");
8
8
  var _data = require("@wordpress/data");
9
9
  var _ = require("../..");
10
10
  var _store = require("../store");
11
- var _jsxRuntime = require("@emotion/react/jsx-runtime");
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
12
  /**
13
13
  * WordPress dependencies.
14
14
  */
15
- const __ = _i18n.__;
15
+
16
16
  /**
17
17
  * Internal dependencies.
18
18
  */
19
- const parseError = _ref => {
20
- let {
21
- data,
22
- message,
23
- code
24
- } = _ref;
19
+
20
+ const parseError = ({
21
+ data,
22
+ message,
23
+ code
24
+ }) => {
25
25
  let level = 'fatal';
26
26
  if (!!data && 'level' in data) {
27
27
  level = data.level;
@@ -44,31 +44,30 @@ const WizardError = () => {
44
44
  } = parseError(error);
45
45
  if ('fatal' === level) {
46
46
  const fallbackURL = typeof newspack_urls !== 'undefined' && newspack_urls.dashboard;
47
- return (0, _jsxRuntime.jsxs)(_.Modal, {
48
- title: __('Unrecoverable error'),
47
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.Modal, {
48
+ title: (0, _i18n.__)('Unrecoverable error'),
49
49
  onRequestClose: fallbackURL ? () => window.location = fallbackURL : undefined,
50
- children: [(0, _jsxRuntime.jsx)(_.Notice, {
50
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.Notice, {
51
51
  noticeText: message,
52
52
  isError: true,
53
53
  rawHTML: true
54
- }), fallbackURL && (0, _jsxRuntime.jsx)(_.Card, {
54
+ }), fallbackURL && /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Card, {
55
55
  buttonsCard: true,
56
56
  noBorder: true,
57
57
  className: "justify-end",
58
- children: (0, _jsxRuntime.jsx)(_.Button, {
58
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Button, {
59
59
  isPrimary: true,
60
60
  href: fallbackURL,
61
- children: __('Return to Dashboard', 'newspack')
61
+ children: (0, _i18n.__)('Return to Dashboard', 'newspack-plugin')
62
62
  })
63
63
  })]
64
64
  });
65
65
  }
66
- return (0, _jsxRuntime.jsx)(_.Notice, {
66
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Notice, {
67
67
  isError: true,
68
68
  className: "newspack-wizard__above-header",
69
69
  noticeText: message,
70
70
  rawHTML: true
71
71
  });
72
72
  };
73
- var _default = WizardError;
74
- exports.default = _default;
73
+ var _default = exports.default = WizardError;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
@@ -16,17 +15,21 @@ var _router = _interopRequireDefault(require("../proxied-imports/router"));
16
15
  var _store = _interopRequireWildcard(require("./store"));
17
16
  var _utils = require("./store/utils");
18
17
  var _WizardError = _interopRequireDefault(require("./components/WizardError"));
19
- var _jsxRuntime = require("@emotion/react/jsx-runtime");
18
+ var _jsxRuntime = require("react/jsx-runtime");
19
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
20
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
20
21
  /**
21
22
  * External dependencies.
22
23
  */
24
+
23
25
  /**
24
26
  * WordPress dependencies.
25
27
  */
26
- const __ = _i18n.__;
28
+
27
29
  /**
28
30
  * Internal dependencies
29
31
  */
32
+
30
33
  (0, _store.default)();
31
34
  const {
32
35
  HashRouter,
@@ -34,17 +37,16 @@ const {
34
37
  Route,
35
38
  Switch
36
39
  } = _router.default;
37
- const Wizard = _ref => {
38
- let {
39
- sections = [],
40
- apiSlug,
41
- headerText,
42
- subHeaderText,
43
- hasSimpleFooter,
44
- className,
45
- renderAboveSections,
46
- requiredPlugins = []
47
- } = _ref;
40
+ const Wizard = ({
41
+ sections = [],
42
+ apiSlug,
43
+ headerText,
44
+ subHeaderText,
45
+ hasSimpleFooter,
46
+ className,
47
+ renderAboveSections,
48
+ requiredPlugins = []
49
+ }) => {
48
50
  const isLoading = (0, _data.useSelect)(select => select(_store.WIZARD_STORE_NAMESPACE).isLoading());
49
51
  const isQuietLoading = (0, _data.useSelect)(select => select(_store.WIZARD_STORE_NAMESPACE).isQuietLoading());
50
52
 
@@ -54,78 +56,74 @@ const Wizard = _ref => {
54
56
  let displayedSections = sections.filter(section => !section.isHidden);
55
57
  const [pluginRequirementsSatisfied, setPluginRequirementsSatisfied] = (0, _element.useState)(requiredPlugins.length === 0);
56
58
  if (!pluginRequirementsSatisfied) {
57
- headerText = requiredPlugins.length > 1 ? __('Required plugins', 'newspack') : __('Required plugin', 'newspack');
59
+ headerText = requiredPlugins.length > 1 ? (0, _i18n.__)('Required plugins', 'newspack-plugin') : (0, _i18n.__)('Required plugin', 'newspack-plugin');
58
60
  displayedSections = [{
59
61
  path: '/',
60
- render: () => (0, _jsxRuntime.jsx)(_.PluginInstaller, {
62
+ render: () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_.PluginInstaller, {
61
63
  plugins: requiredPlugins,
62
- onStatus: _ref2 => {
63
- let {
64
- complete
65
- } = _ref2;
66
- return setPluginRequirementsSatisfied(complete);
67
- }
64
+ onStatus: ({
65
+ complete
66
+ }) => setPluginRequirementsSatisfied(complete)
68
67
  })
69
68
  }];
70
69
  }
71
- return (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
72
- children: [(0, _jsxRuntime.jsx)("div", {
70
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
71
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
73
72
  className: (0, _classnames.default)(isLoading ? 'newspack-wizard__is-loading' : 'newspack-wizard__is-loaded', {
74
73
  'newspack-wizard__is-loading-quiet': isQuietLoading
75
74
  }),
76
- children: (0, _jsxRuntime.jsxs)(HashRouter, {
75
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(HashRouter, {
77
76
  hashType: "slash",
78
- children: [newspack_aux_data.is_debug_mode && (0, _jsxRuntime.jsx)(_.Notice, {
77
+ children: [newspack_aux_data.is_debug_mode && /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Notice, {
79
78
  debugMode: true
80
- }), (0, _jsxRuntime.jsx)("div", {
79
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
81
80
  className: "bg-white",
82
- children: (0, _jsxRuntime.jsx)("div", {
81
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
83
82
  className: "newspack-wizard__header__inner",
84
- children: (0, _jsxRuntime.jsxs)("div", {
83
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
85
84
  className: "newspack-wizard__title",
86
- children: [(0, _jsxRuntime.jsx)(_.Button, {
85
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.Button, {
87
86
  isLink: true,
88
87
  href: newspack_urls.dashboard,
89
- label: __('Return to Dashboard', 'newspack'),
88
+ label: (0, _i18n.__)('Return to Dashboard', 'newspack-plugin'),
90
89
  showTooltip: true,
91
90
  icon: _icons.category,
92
91
  iconSize: 36,
93
- children: (0, _jsxRuntime.jsx)(_.NewspackIcon, {
92
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.NewspackIcon, {
94
93
  size: 36
95
94
  })
96
- }), (0, _jsxRuntime.jsxs)("div", {
97
- children: [headerText && (0, _jsxRuntime.jsx)("h2", {
95
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
96
+ children: [headerText && /*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
98
97
  children: headerText
99
- }), subHeaderText && (0, _jsxRuntime.jsx)("span", {
98
+ }), subHeaderText && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
100
99
  children: subHeaderText
101
100
  })]
102
101
  })]
103
102
  })
104
103
  })
105
- }), displayedSections.length > 1 && (0, _jsxRuntime.jsx)(_.TabbedNavigation, {
104
+ }), displayedSections.length > 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TabbedNavigation, {
106
105
  items: displayedSections,
107
- children: (0, _jsxRuntime.jsx)(_WizardError.default, {})
108
- }), (0, _jsxRuntime.jsx)(_.HandoffMessage, {}), (0, _jsxRuntime.jsxs)(Switch, {
106
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_WizardError.default, {})
107
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.HandoffMessage, {}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Switch, {
109
108
  children: [displayedSections.map((section, index) => {
110
109
  const SectionComponent = section.render;
111
- return (0, _jsxRuntime.jsx)(Route, {
110
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Route, {
112
111
  path: section.path,
113
- children: (0, _jsxRuntime.jsxs)("div", {
112
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
114
113
  className: (0, _classnames.default)('newspack-wizard newspack-wizard__content', className),
115
- children: ['function' === typeof renderAboveSections ? renderAboveSections() : null, (0, _jsxRuntime.jsx)(SectionComponent, {})]
114
+ children: ['function' === typeof renderAboveSections ? renderAboveSections() : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(SectionComponent, {})]
116
115
  })
117
116
  }, index);
118
- }), (0, _jsxRuntime.jsx)(Redirect, {
117
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Redirect, {
119
118
  to: displayedSections[0].path
120
119
  })]
121
120
  })]
122
121
  })
123
- }), !isLoading && (0, _jsxRuntime.jsx)(_.Footer, {
122
+ }), !isLoading && /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Footer, {
124
123
  simple: hasSimpleFooter
125
124
  })]
126
125
  });
127
126
  };
128
127
  Wizard.useWizardData = _utils.useWizardData;
129
128
  Wizard.STORE_NAMESPACE = _store.WIZARD_STORE_NAMESPACE;
130
- var _default = Wizard;
131
- exports.default = _default;
129
+ var _default = exports.default = Wizard;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
@@ -19,8 +19,7 @@ var _utils = require("./utils.js");
19
19
  * WordPress dependencies.
20
20
  */
21
21
 
22
- const WIZARD_STORE_NAMESPACE = 'newspack/wizards';
23
- exports.WIZARD_STORE_NAMESPACE = WIZARD_STORE_NAMESPACE;
22
+ const WIZARD_STORE_NAMESPACE = exports.WIZARD_STORE_NAMESPACE = 'newspack/wizards';
24
23
  const DEFAULT_STATE = {
25
24
  isLoading: true,
26
25
  isQuietLoading: false,
@@ -34,12 +33,10 @@ const DEFAULT_STATE = {
34
33
  * unless the state was cloned first.
35
34
  */
36
35
  const clone = objectToClone => JSON.parse(JSON.stringify(objectToClone));
37
- const reducer = function () {
38
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_STATE;
39
- let {
40
- type,
41
- payload = {}
42
- } = arguments.length > 1 ? arguments[1] : undefined;
36
+ const reducer = (state = DEFAULT_STATE, {
37
+ type,
38
+ payload = {}
39
+ }) => {
43
40
  switch (type) {
44
41
  case 'START_LOADING_DATA':
45
42
  if (payload.isQuietLoading) {
@@ -80,36 +77,38 @@ const actions = {
80
77
  updateWizardSettings: (0, _utils.createAction)('UPDATE_WIZARD_SETTINGS'),
81
78
  setError: (0, _utils.createAction)('SET_ERROR'),
82
79
  // Async actions. These will not show up in Redux devtools.
83
- saveWizardSettings(_ref) {
84
- let {
85
- slug,
86
- section = '',
87
- payloadPath = false,
88
- updatePayload = null
89
- } = _ref;
90
- return function* () {
91
- // Optionally data can be updated before saving - an immediate update case
92
- // (without an explicit "save" action).
93
- if (updatePayload) {
94
- yield actions.updateWizardSettings({
95
- slug,
96
- ...updatePayload
97
- });
98
- }
99
- const wizardState = (0, _data.select)(WIZARD_STORE_NAMESPACE).getWizardAPIData(slug);
100
- const updatedData = yield actions.fetchFromAPI({
101
- path: `/newspack/v1/wizard/${slug}/${section}`,
102
- method: 'POST',
103
- data: payloadPath ? (0, _get.default)(wizardState, payloadPath) : wizardState,
104
- isQuietFetch: true
80
+ *saveWizardSettings({
81
+ slug,
82
+ section = '',
83
+ payloadPath = false,
84
+ auxData = {},
85
+ updatePayload = null
86
+ }) {
87
+ // Optionally data can be updated before saving - an immediate update case
88
+ // (without an explicit "save" action).
89
+ if (updatePayload) {
90
+ yield actions.updateWizardSettings({
91
+ slug,
92
+ ...updatePayload
105
93
  });
106
- if (!(0, _isEmpty.default)(updatedData) && !updatedData.error) {
107
- return actions.setAPIDataForWizard({
108
- slug,
109
- data: updatedData
110
- });
111
- }
112
- }();
94
+ }
95
+ const wizardState = (0, _data.select)(WIZARD_STORE_NAMESPACE).getWizardAPIData(slug);
96
+ const data = payloadPath ? (0, _get.default)(wizardState, payloadPath) : wizardState;
97
+ const updatedData = yield actions.fetchFromAPI({
98
+ path: `/newspack/v1/wizard/${slug}/${section}`,
99
+ method: 'POST',
100
+ data: {
101
+ ...data,
102
+ ...auxData
103
+ },
104
+ isQuietFetch: true
105
+ });
106
+ if (!(0, _isEmpty.default)(updatedData) && !updatedData.error) {
107
+ return actions.setAPIDataForWizard({
108
+ slug,
109
+ data: updatedData
110
+ });
111
+ }
113
112
  },
114
113
  *wizardApiFetch(fetchConfig) {
115
114
  // Just a proxy to fetchFromAPI, but it has to be a generator.