@automattic/jetpack-components 0.68.1 → 0.69.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.
Files changed (262) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/build/components/action-button/index.d.ts +25 -0
  3. package/build/components/action-button/index.js +48 -0
  4. package/build/components/action-popover/index.d.ts +6 -0
  5. package/build/components/action-popover/index.js +38 -0
  6. package/build/components/action-popover/types.d.ts +20 -0
  7. package/build/components/action-popover/types.js +1 -0
  8. package/build/components/admin-page/index.d.ts +12 -0
  9. package/build/components/admin-page/index.js +44 -0
  10. package/build/components/admin-page/types.d.ts +56 -0
  11. package/build/components/admin-page/types.js +1 -0
  12. package/build/components/admin-section/basic/index.d.ts +10 -0
  13. package/build/components/admin-section/basic/index.js +12 -0
  14. package/build/components/admin-section/hero/index.d.ts +10 -0
  15. package/build/components/admin-section/hero/index.js +12 -0
  16. package/build/components/admin-section/types.d.ts +8 -0
  17. package/build/components/admin-section/types.js +1 -0
  18. package/build/components/alert/index.d.ts +23 -0
  19. package/build/components/alert/index.js +33 -0
  20. package/build/components/automattic-byline-logo/index.d.ts +10 -0
  21. package/build/components/automattic-byline-logo/index.js +13 -0
  22. package/build/components/automattic-byline-logo/types.d.ts +15 -0
  23. package/build/components/automattic-byline-logo/types.js +1 -0
  24. package/build/components/automattic-for-agencies-logo/index.d.ts +11 -0
  25. package/build/components/automattic-for-agencies-logo/index.js +12 -0
  26. package/build/components/automattic-icon-logo/index.d.ts +13 -0
  27. package/build/components/automattic-icon-logo/index.js +13 -0
  28. package/build/components/badge/index.d.ts +19 -0
  29. package/build/components/badge/index.js +22 -0
  30. package/build/components/boost-score-bar/index.d.ts +5 -0
  31. package/build/components/boost-score-bar/index.js +35 -0
  32. package/build/components/boost-score-bar/types.d.ts +9 -0
  33. package/build/components/boost-score-bar/types.js +1 -0
  34. package/build/components/boost-score-graph/annotations-plugin.d.ts +16 -0
  35. package/build/components/boost-score-graph/annotations-plugin.js +58 -0
  36. package/build/components/boost-score-graph/background.d.ts +3 -0
  37. package/build/components/boost-score-graph/background.js +5 -0
  38. package/build/components/boost-score-graph/day-highlight-plugin.d.ts +13 -0
  39. package/build/components/boost-score-graph/day-highlight-plugin.js +69 -0
  40. package/build/components/boost-score-graph/get-date-format.d.ts +9 -0
  41. package/build/components/boost-score-graph/get-date-format.js +52 -0
  42. package/build/components/boost-score-graph/index.d.ts +44 -0
  43. package/build/components/boost-score-graph/index.js +42 -0
  44. package/build/components/boost-score-graph/tooltip.d.ts +3 -0
  45. package/build/components/boost-score-graph/tooltip.js +22 -0
  46. package/build/components/boost-score-graph/tooltips-plugin.d.ts +15 -0
  47. package/build/components/boost-score-graph/tooltips-plugin.js +78 -0
  48. package/build/components/boost-score-graph/uplot-line-chart.d.ts +27 -0
  49. package/build/components/boost-score-graph/uplot-line-chart.js +187 -0
  50. package/build/components/boost-score-graph/use-boost-score-transform.d.ts +14 -0
  51. package/build/components/boost-score-graph/use-boost-score-transform.js +26 -0
  52. package/build/components/boost-score-graph/use-resize.d.ts +9 -0
  53. package/build/components/boost-score-graph/use-resize.js +31 -0
  54. package/build/components/button/index.d.ts +10 -0
  55. package/build/components/button/index.js +45 -0
  56. package/build/components/button/types.d.ts +19 -0
  57. package/build/components/button/types.js +1 -0
  58. package/build/components/chip/index.d.ts +15 -0
  59. package/build/components/chip/index.js +16 -0
  60. package/build/components/contextual-upgrade-trigger/index.d.ts +4 -0
  61. package/build/components/contextual-upgrade-trigger/index.js +12 -0
  62. package/build/components/contextual-upgrade-trigger/types.d.ts +9 -0
  63. package/build/components/contextual-upgrade-trigger/types.js +1 -0
  64. package/build/components/copy-to-clipboard/index.d.ts +4 -0
  65. package/build/components/copy-to-clipboard/index.js +40 -0
  66. package/build/components/copy-to-clipboard/types.d.ts +6 -0
  67. package/build/components/copy-to-clipboard/types.js +1 -0
  68. package/build/components/decorative-card/index.d.ts +11 -0
  69. package/build/components/decorative-card/index.js +13 -0
  70. package/build/components/decorative-card/types.d.ts +14 -0
  71. package/build/components/decorative-card/types.js +1 -0
  72. package/build/components/dialog/index.d.ts +20 -0
  73. package/build/components/dialog/index.js +31 -0
  74. package/build/components/diff-viewer/index.d.ts +4 -0
  75. package/build/components/diff-viewer/index.js +33 -0
  76. package/build/components/diff-viewer/parse-filename.d.ts +29 -0
  77. package/build/components/diff-viewer/parse-filename.js +61 -0
  78. package/build/components/diff-viewer/parse-patch.d.ts +9 -0
  79. package/build/components/diff-viewer/parse-patch.js +148 -0
  80. package/build/components/donut-meter/index.d.ts +58 -0
  81. package/build/components/donut-meter/index.js +36 -0
  82. package/build/components/global-notices/global-notices.d.ts +11 -0
  83. package/build/components/global-notices/global-notices.js +19 -0
  84. package/build/components/global-notices/index.d.ts +3 -0
  85. package/build/components/global-notices/index.js +3 -0
  86. package/build/components/global-notices/use-global-notices.d.ts +10 -0
  87. package/build/components/global-notices/use-global-notices.js +30 -0
  88. package/build/components/gridicon/index.d.ts +14 -0
  89. package/build/components/gridicon/index.js +167 -0
  90. package/build/components/gridicon/types.d.ts +39 -0
  91. package/build/components/gridicon/types.js +1 -0
  92. package/build/components/icon-tooltip/index.d.ts +11 -0
  93. package/build/components/icon-tooltip/index.js +75 -0
  94. package/build/components/icon-tooltip/types.d.ts +69 -0
  95. package/build/components/icon-tooltip/types.js +1 -0
  96. package/build/components/icons/index.d.ts +70 -0
  97. package/build/components/icons/index.js +86 -0
  98. package/build/components/icons/types.d.ts +27 -0
  99. package/build/components/icons/types.js +1 -0
  100. package/build/components/indeterminate-progress-bar/index.d.ts +10 -0
  101. package/build/components/indeterminate-progress-bar/index.js +20 -0
  102. package/build/components/indeterminate-progress-bar/types.d.ts +6 -0
  103. package/build/components/indeterminate-progress-bar/types.js +1 -0
  104. package/build/components/jetpack-footer/index.d.ts +11 -0
  105. package/build/components/jetpack-footer/index.js +71 -0
  106. package/build/components/jetpack-footer/types.d.ts +47 -0
  107. package/build/components/jetpack-footer/types.js +1 -0
  108. package/build/components/jetpack-logo/index.d.ts +4 -0
  109. package/build/components/jetpack-logo/index.js +10 -0
  110. package/build/components/jetpack-logo/types.d.ts +7 -0
  111. package/build/components/jetpack-logo/types.js +1 -0
  112. package/build/components/jetpack-protect-logo/index.d.ts +4 -0
  113. package/build/components/jetpack-protect-logo/index.js +10 -0
  114. package/build/components/jetpack-protect-logo/types.d.ts +7 -0
  115. package/build/components/jetpack-protect-logo/types.js +1 -0
  116. package/build/components/jetpack-search-logo/index.d.ts +4 -0
  117. package/build/components/jetpack-search-logo/index.js +7 -0
  118. package/build/components/jetpack-search-logo/types.d.ts +7 -0
  119. package/build/components/jetpack-search-logo/types.js +1 -0
  120. package/build/components/jetpack-vaultpress-backup-logo/index.d.ts +4 -0
  121. package/build/components/jetpack-vaultpress-backup-logo/index.js +8 -0
  122. package/build/components/jetpack-vaultpress-backup-logo/types.d.ts +6 -0
  123. package/build/components/jetpack-vaultpress-backup-logo/types.js +1 -0
  124. package/build/components/jetpack-videopress-logo/index.d.ts +4 -0
  125. package/build/components/jetpack-videopress-logo/index.js +8 -0
  126. package/build/components/jetpack-videopress-logo/types.d.ts +6 -0
  127. package/build/components/jetpack-videopress-logo/types.js +1 -0
  128. package/build/components/layout/col/index.d.ts +10 -0
  129. package/build/components/layout/col/index.js +42 -0
  130. package/build/components/layout/container/index.d.ts +4 -0
  131. package/build/components/layout/container/index.js +30 -0
  132. package/build/components/layout/types.d.ts +58 -0
  133. package/build/components/layout/types.js +1 -0
  134. package/build/components/layout/use-breakpoint-match/index.d.ts +19 -0
  135. package/build/components/layout/use-breakpoint-match/index.js +50 -0
  136. package/build/components/loading-placeholder/index.d.ts +8 -0
  137. package/build/components/loading-placeholder/index.js +7 -0
  138. package/build/components/marked-lines/index.d.ts +4 -0
  139. package/build/components/marked-lines/index.js +50 -0
  140. package/build/components/notice/index.d.ts +29 -0
  141. package/build/components/notice/index.js +35 -0
  142. package/build/components/number-control/index.d.ts +10 -0
  143. package/build/components/number-control/index.js +16 -0
  144. package/build/components/number-format/index.d.ts +9 -0
  145. package/build/components/number-format/index.js +13 -0
  146. package/build/components/number-slider/index.d.ts +12 -0
  147. package/build/components/number-slider/index.js +43 -0
  148. package/build/components/number-slider/types.d.ts +50 -0
  149. package/build/components/number-slider/types.js +1 -0
  150. package/build/components/popover/index.d.ts +9 -0
  151. package/build/components/popover/index.js +6 -0
  152. package/build/components/pricing-card/index.d.ts +11 -0
  153. package/build/components/pricing-card/index.js +32 -0
  154. package/build/components/pricing-card/types.d.ts +51 -0
  155. package/build/components/pricing-card/types.js +1 -0
  156. package/build/components/pricing-table/index.d.ts +7 -0
  157. package/build/components/pricing-table/index.js +66 -0
  158. package/build/components/pricing-table/types.d.ts +68 -0
  159. package/build/components/pricing-table/types.js +1 -0
  160. package/build/components/product-offer/icons-card.d.ts +10 -0
  161. package/build/components/product-offer/icons-card.js +23 -0
  162. package/build/components/product-offer/index.d.ts +11 -0
  163. package/build/components/product-offer/index.js +31 -0
  164. package/build/components/product-offer/product-offer-header.d.ts +9 -0
  165. package/build/components/product-offer/product-offer-header.js +14 -0
  166. package/build/components/product-offer/types.d.ts +102 -0
  167. package/build/components/product-offer/types.js +1 -0
  168. package/build/components/product-price/index.d.ts +11 -0
  169. package/build/components/product-price/index.js +32 -0
  170. package/build/components/product-price/price.d.ts +9 -0
  171. package/build/components/product-price/price.js +19 -0
  172. package/build/components/product-price/types.d.ts +61 -0
  173. package/build/components/product-price/types.js +1 -0
  174. package/build/components/progress-bar/index.d.ts +10 -0
  175. package/build/components/progress-bar/index.js +26 -0
  176. package/build/components/progress-bar/types.d.ts +18 -0
  177. package/build/components/progress-bar/types.js +1 -0
  178. package/build/components/qr-code/index.d.ts +46 -0
  179. package/build/components/qr-code/index.js +21 -0
  180. package/build/components/radio-control/index.d.ts +24 -0
  181. package/build/components/radio-control/index.js +8 -0
  182. package/build/components/record-meter-bar/index.d.ts +62 -0
  183. package/build/components/record-meter-bar/index.js +40 -0
  184. package/build/components/spinner/index.d.ts +13 -0
  185. package/build/components/spinner/index.js +27 -0
  186. package/build/components/split-button/index.d.ts +4 -0
  187. package/build/components/split-button/index.js +8 -0
  188. package/build/components/split-button/types.d.ts +8 -0
  189. package/build/components/split-button/types.js +1 -0
  190. package/build/components/stat-card/index.d.ts +9 -0
  191. package/build/components/stat-card/index.js +27 -0
  192. package/build/components/stat-card/types.d.ts +29 -0
  193. package/build/components/stat-card/types.js +1 -0
  194. package/build/components/status/index.d.ts +8 -0
  195. package/build/components/status/index.js +18 -0
  196. package/build/components/terms-of-service/index.d.ts +5 -0
  197. package/build/components/terms-of-service/index.js +32 -0
  198. package/build/components/terms-of-service/types.d.ts +23 -0
  199. package/build/components/terms-of-service/types.js +1 -0
  200. package/build/components/testimonials/index.d.ts +3 -0
  201. package/build/components/testimonials/index.js +18 -0
  202. package/build/components/testimonials/testimonial.d.ts +4 -0
  203. package/build/components/testimonials/testimonial.js +7 -0
  204. package/build/components/testimonials/types.d.ts +13 -0
  205. package/build/components/testimonials/types.js +1 -0
  206. package/build/components/text/constants.d.ts +14 -0
  207. package/build/components/text/constants.js +29 -0
  208. package/build/components/text/index.d.ts +32 -0
  209. package/build/components/text/index.js +53 -0
  210. package/build/components/text/types.d.ts +50 -0
  211. package/build/components/text/types.js +1 -0
  212. package/build/components/theme-provider/index.d.ts +80 -0
  213. package/build/components/theme-provider/index.js +129 -0
  214. package/build/components/theme-provider/types.d.ts +23 -0
  215. package/build/components/theme-provider/types.js +1 -0
  216. package/build/components/threat-fixer-button/index.d.ts +17 -0
  217. package/build/components/threat-fixer-button/index.js +56 -0
  218. package/build/components/threat-severity-badge/index.d.ts +4 -0
  219. package/build/components/threat-severity-badge/index.js +13 -0
  220. package/build/components/threats-data-views/constants.d.ts +33 -0
  221. package/build/components/threats-data-views/constants.js +37 -0
  222. package/build/components/threats-data-views/index.d.ts +30 -0
  223. package/build/components/threats-data-views/index.js +413 -0
  224. package/build/components/threats-data-views/threats-status-toggle-group-control.d.ts +16 -0
  225. package/build/components/threats-data-views/threats-status-toggle-group-control.js +95 -0
  226. package/build/components/toggle-control/index.d.ts +21 -0
  227. package/build/components/toggle-control/index.js +21 -0
  228. package/build/components/upsell-banner/index.d.ts +14 -0
  229. package/build/components/upsell-banner/index.js +21 -0
  230. package/build/components/upsell-banner/types.d.ts +13 -0
  231. package/build/components/upsell-banner/types.js +1 -0
  232. package/build/components/zendesk-chat/constants.d.ts +1 -0
  233. package/build/components/zendesk-chat/constants.js +2 -0
  234. package/build/components/zendesk-chat/index.d.ts +3 -0
  235. package/build/components/zendesk-chat/index.js +27 -0
  236. package/build/components/zendesk-chat/types.d.ts +11 -0
  237. package/build/components/zendesk-chat/types.js +1 -0
  238. package/build/index.d.ts +67 -0
  239. package/build/index.js +81 -0
  240. package/build/lib/locale/index.d.ts +13 -0
  241. package/build/lib/locale/index.js +34 -0
  242. package/build/tools/get-product-checkout-url/index.d.ts +10 -0
  243. package/build/tools/get-product-checkout-url/index.js +22 -0
  244. package/build/tools/get-site-admin-url/index.d.ts +6 -0
  245. package/build/tools/get-site-admin-url/index.js +13 -0
  246. package/build/tools/jp-redirect/index.d.ts +20 -0
  247. package/build/tools/jp-redirect/index.js +50 -0
  248. package/build/tools/jp-redirect/types.d.ts +39 -0
  249. package/build/tools/jp-redirect/types.js +1 -0
  250. package/build/tools/pricing-utils/index.d.ts +8 -0
  251. package/build/tools/pricing-utils/index.js +9 -0
  252. package/build/tools/pricing-utils/types.d.ts +12 -0
  253. package/build/tools/pricing-utils/types.js +1 -0
  254. package/components/admin-page/index.tsx +2 -0
  255. package/components/admin-page/types.ts +5 -0
  256. package/components/boost-score-graph/uplot-line-chart.tsx +16 -1
  257. package/components/jetpack-footer/index.tsx +7 -24
  258. package/components/jetpack-footer/style.scss +5 -0
  259. package/components/jetpack-footer/types.ts +5 -0
  260. package/components/number-slider/index.tsx +8 -2
  261. package/package.json +13 -5
  262. package/tools/get-site-admin-url/index.ts +3 -0
@@ -0,0 +1,11 @@
1
+ import type { FC } from 'react';
2
+ declare global {
3
+ interface Window {
4
+ zE: Function;
5
+ }
6
+ }
7
+ interface ZendeskChatProps {
8
+ jwt_token: string;
9
+ }
10
+ export type ZendeskChatType = FC<ZendeskChatProps>;
11
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,67 @@
1
+ export { default as JetpackLogo } from './components/jetpack-logo/index.js';
2
+ export { default as JetpackSearchLogo } from './components/jetpack-search-logo/index.js';
3
+ export { default as JetpackProtectLogo } from './components/jetpack-protect-logo/index.js';
4
+ export { default as JetpackVaultPressBackupLogo } from './components/jetpack-vaultpress-backup-logo/index.js';
5
+ export { default as JetpackVideoPressLogo } from './components/jetpack-videopress-logo/index.js';
6
+ export { default as getRedirectUrl } from './tools/jp-redirect/index.js';
7
+ export { default as getProductCheckoutUrl } from './tools/get-product-checkout-url/index.js';
8
+ export { isFirstMonthTrial } from './tools/pricing-utils/index.js';
9
+ export { default as AutomatticBylineLogo } from './components/automattic-byline-logo/index.js';
10
+ export { default as AutomatticIconLogo } from './components/automattic-icon-logo/index.js';
11
+ export { default as AutomatticForAgenciesLogo } from './components/automattic-for-agencies-logo/index.js';
12
+ export { default as JetpackFooter } from './components/jetpack-footer/index.js';
13
+ export { default as Spinner } from './components/spinner/index.js';
14
+ export { default as Gridicon } from './components/gridicon/index.js';
15
+ export { default as IconTooltip } from './components/icon-tooltip/index.js';
16
+ export { default as ActionButton } from './components/action-button/index.js';
17
+ export { default as PricingCard } from './components/pricing-card/index.js';
18
+ export { default as NumberSlider } from './components/number-slider/index.js';
19
+ export { default as AdminSection } from './components/admin-section/basic/index.js';
20
+ export { default as AdminSectionHero } from './components/admin-section/hero/index.js';
21
+ export { default as AdminPage } from './components/admin-page/index.js';
22
+ export { default as DecorativeCard } from './components/decorative-card/index.js';
23
+ export { default as Col } from './components/layout/col/index.js';
24
+ export { default as Testimonials } from './components/testimonials/index.js';
25
+ export { default as Container } from './components/layout/container/index.js';
26
+ export { default as useBreakpointMatch } from './components/layout/use-breakpoint-match/index.js';
27
+ export { default as CopyToClipboard } from './components/copy-to-clipboard/index.js';
28
+ export * from './components/icons/index.js';
29
+ export { default as SplitButton } from './components/split-button/index.js';
30
+ export { default as ThemeProvider } from './components/theme-provider/index.js';
31
+ export { default as ThreatFixerButton } from './components/threat-fixer-button/index.js';
32
+ export { default as ThreatSeverityBadge } from './components/threat-severity-badge/index.js';
33
+ export { default as ThreatsDataViews } from './components/threats-data-views/index.js';
34
+ export { default as Text, H2, H3, Title } from './components/text/index.js';
35
+ export { default as ToggleControl } from './components/toggle-control/index.js';
36
+ export { default as NumberControl } from './components/number-control/index.js';
37
+ export { default as numberFormat } from './components/number-format/index.js';
38
+ export { default as QRCode } from './components/qr-code/index.js';
39
+ export { default as Button } from './components/button/index.js';
40
+ export type { ButtonProps } from './components/button/types.js';
41
+ export { default as LoadingPlaceholder } from './components/loading-placeholder/index.js';
42
+ export { default as TermsOfService } from './components/terms-of-service/index.js';
43
+ export { default as Chip } from './components/chip/index.js';
44
+ export { default as PricingTable, PricingTableColumn, PricingTableHeader, PricingTableItem, } from './components/pricing-table/index.js';
45
+ export { default as BoostScoreBar } from './components/boost-score-bar/index.js';
46
+ export { default as BoostScoreGraph } from './components/boost-score-graph/index.js';
47
+ export { default as ProductPrice } from './components/product-price/index.js';
48
+ export { default as ProductOffer, IconsCard } from './components/product-offer/index.js';
49
+ export { default as Dialog } from './components/dialog/index.js';
50
+ export { default as DonutMeter } from './components/donut-meter/index.js';
51
+ export { default as RecordMeterBar } from './components/record-meter-bar/index.js';
52
+ export { default as ContextualUpgradeTrigger } from './components/contextual-upgrade-trigger/index.js';
53
+ export { default as Alert } from './components/alert/index.js';
54
+ export { default as Notice } from './components/notice/index.js';
55
+ export { default as Popover } from './components/popover/index.js';
56
+ export { default as Status } from './components/status/index.js';
57
+ export { default as IndeterminateProgressBar } from './components/indeterminate-progress-bar/index.js';
58
+ export { default as ActionPopover } from './components/action-popover/index.js';
59
+ export { default as ZendeskChat } from './components/zendesk-chat/index.js';
60
+ export { default as ProgressBar } from './components/progress-bar/index.js';
61
+ export { default as UpsellBanner } from './components/upsell-banner/index.js';
62
+ export { getUserLocale, cleanLocale } from './lib/locale/index.js';
63
+ export { default as RadioControl } from './components/radio-control/index.js';
64
+ export { default as StatCard } from './components/stat-card/index.js';
65
+ export { default as DiffViewer } from './components/diff-viewer/index.js';
66
+ export { default as MarkedLines } from './components/marked-lines/index.js';
67
+ export * from './components/global-notices/index.js';
package/build/index.js ADDED
@@ -0,0 +1,81 @@
1
+ /*
2
+ This program is free software; you can redistribute it and/or
3
+ modify it under the terms of the GNU General Public License
4
+ as published by the Free Software Foundation; either version 2
5
+ of the License, or (at your option) any later version.
6
+
7
+ This program is distributed in the hope that it will be useful,
8
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
9
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
+ GNU General Public License for more details.
11
+
12
+ You should have received a copy of the GNU General Public License
13
+ along with this program; if not, write to the Free Software
14
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15
+ */
16
+ export { default as JetpackLogo } from './components/jetpack-logo/index.js';
17
+ export { default as JetpackSearchLogo } from './components/jetpack-search-logo/index.js';
18
+ export { default as JetpackProtectLogo } from './components/jetpack-protect-logo/index.js';
19
+ export { default as JetpackVaultPressBackupLogo } from './components/jetpack-vaultpress-backup-logo/index.js';
20
+ export { default as JetpackVideoPressLogo } from './components/jetpack-videopress-logo/index.js';
21
+ export { default as getRedirectUrl } from './tools/jp-redirect/index.js';
22
+ export { default as getProductCheckoutUrl } from './tools/get-product-checkout-url/index.js';
23
+ export { isFirstMonthTrial } from './tools/pricing-utils/index.js';
24
+ export { default as AutomatticBylineLogo } from './components/automattic-byline-logo/index.js';
25
+ export { default as AutomatticIconLogo } from './components/automattic-icon-logo/index.js';
26
+ export { default as AutomatticForAgenciesLogo } from './components/automattic-for-agencies-logo/index.js';
27
+ export { default as JetpackFooter } from './components/jetpack-footer/index.js';
28
+ export { default as Spinner } from './components/spinner/index.js';
29
+ export { default as Gridicon } from './components/gridicon/index.js';
30
+ export { default as IconTooltip } from './components/icon-tooltip/index.js';
31
+ export { default as ActionButton } from './components/action-button/index.js';
32
+ export { default as PricingCard } from './components/pricing-card/index.js';
33
+ export { default as NumberSlider } from './components/number-slider/index.js';
34
+ export { default as AdminSection } from './components/admin-section/basic/index.js';
35
+ export { default as AdminSectionHero } from './components/admin-section/hero/index.js';
36
+ export { default as AdminPage } from './components/admin-page/index.js';
37
+ export { default as DecorativeCard } from './components/decorative-card/index.js';
38
+ export { default as Col } from './components/layout/col/index.js';
39
+ export { default as Testimonials } from './components/testimonials/index.js';
40
+ export { default as Container } from './components/layout/container/index.js';
41
+ export { default as useBreakpointMatch } from './components/layout/use-breakpoint-match/index.js';
42
+ export { default as CopyToClipboard } from './components/copy-to-clipboard/index.js';
43
+ export * from './components/icons/index.js';
44
+ export { default as SplitButton } from './components/split-button/index.js';
45
+ export { default as ThemeProvider } from './components/theme-provider/index.js';
46
+ export { default as ThreatFixerButton } from './components/threat-fixer-button/index.js';
47
+ export { default as ThreatSeverityBadge } from './components/threat-severity-badge/index.js';
48
+ export { default as ThreatsDataViews } from './components/threats-data-views/index.js';
49
+ export { default as Text, H2, H3, Title } from './components/text/index.js';
50
+ export { default as ToggleControl } from './components/toggle-control/index.js';
51
+ export { default as NumberControl } from './components/number-control/index.js';
52
+ export { default as numberFormat } from './components/number-format/index.js';
53
+ export { default as QRCode } from './components/qr-code/index.js';
54
+ export { default as Button } from './components/button/index.js';
55
+ export { default as LoadingPlaceholder } from './components/loading-placeholder/index.js';
56
+ export { default as TermsOfService } from './components/terms-of-service/index.js';
57
+ export { default as Chip } from './components/chip/index.js';
58
+ export { default as PricingTable, PricingTableColumn, PricingTableHeader, PricingTableItem, } from './components/pricing-table/index.js';
59
+ export { default as BoostScoreBar } from './components/boost-score-bar/index.js';
60
+ export { default as BoostScoreGraph } from './components/boost-score-graph/index.js';
61
+ export { default as ProductPrice } from './components/product-price/index.js';
62
+ export { default as ProductOffer, IconsCard } from './components/product-offer/index.js';
63
+ export { default as Dialog } from './components/dialog/index.js';
64
+ export { default as DonutMeter } from './components/donut-meter/index.js';
65
+ export { default as RecordMeterBar } from './components/record-meter-bar/index.js';
66
+ export { default as ContextualUpgradeTrigger } from './components/contextual-upgrade-trigger/index.js';
67
+ export { default as Alert } from './components/alert/index.js';
68
+ export { default as Notice } from './components/notice/index.js';
69
+ export { default as Popover } from './components/popover/index.js';
70
+ export { default as Status } from './components/status/index.js';
71
+ export { default as IndeterminateProgressBar } from './components/indeterminate-progress-bar/index.js';
72
+ export { default as ActionPopover } from './components/action-popover/index.js';
73
+ export { default as ZendeskChat } from './components/zendesk-chat/index.js';
74
+ export { default as ProgressBar } from './components/progress-bar/index.js';
75
+ export { default as UpsellBanner } from './components/upsell-banner/index.js';
76
+ export { getUserLocale, cleanLocale } from './lib/locale/index.js';
77
+ export { default as RadioControl } from './components/radio-control/index.js';
78
+ export { default as StatCard } from './components/stat-card/index.js';
79
+ export { default as DiffViewer } from './components/diff-viewer/index.js';
80
+ export { default as MarkedLines } from './components/marked-lines/index.js';
81
+ export * from './components/global-notices/index.js';
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Clean up WP locale so it matches the format expected by browsers.
3
+ *
4
+ * @param {string} locale - Locale given by WordPress.
5
+ * @return {string} Browser-formatted locale.
6
+ */
7
+ export declare const cleanLocale: (locale: string) => string;
8
+ /**
9
+ * Current user locale, or browser locale as fallback.
10
+ *
11
+ * @return {string} Formatted user locale (e.g. `en-US` or `fr-FR`).
12
+ */
13
+ export declare const getUserLocale: () => string;
@@ -0,0 +1,34 @@
1
+ import { getSettings } from '@wordpress/date';
2
+ /**
3
+ * Clean up WP locale so it matches the format expected by browsers.
4
+ *
5
+ * @param {string} locale - Locale given by WordPress.
6
+ * @return {string} Browser-formatted locale.
7
+ */
8
+ export const cleanLocale = (locale) => {
9
+ const regex = /^([a-z]{2,3})(_[a-z]{2}|_[a-z][a-z0-9]{4,7})?(?:_.*)?$/i;
10
+ // Search for the correct locale format:
11
+ // e.g. af, arq, fr_FR, pap_CW, de_DE_formal, art_xpirate
12
+ const localeRegex = locale.match(regex);
13
+ // Locale was set to something that seems invalid, fallback to en-US.
14
+ if (!localeRegex) {
15
+ return 'en-US';
16
+ }
17
+ return (
18
+ // Keep only the language and the region, and replace the underscore used in WP locale by an hyphen.
19
+ `${localeRegex[1]}${localeRegex[2] ? localeRegex[2] : ''}`.replace('_', '-'));
20
+ };
21
+ /**
22
+ * Current user locale, or browser locale as fallback.
23
+ *
24
+ * @return {string} Formatted user locale (e.g. `en-US` or `fr-FR`).
25
+ */
26
+ export const getUserLocale = () => {
27
+ const { l10n: { locale }, } = getSettings();
28
+ if (locale) {
29
+ return cleanLocale(locale);
30
+ }
31
+ // Fallback to the browser locale if necessary.
32
+ const language = global?.window?.navigator?.language ?? 'en-US';
33
+ return language;
34
+ };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Return the checkout URL for the given product.
3
+ *
4
+ * @param {string} productSlug - wpcom product slug.
5
+ * @param {string} siteSuffix - Site suffix
6
+ * @param {string} redirectUrl - Redirect URL used to define redirect_to
7
+ * @param {boolean} isUserConnected - True when the user is connected Jetpack
8
+ * @return {string} The Calypso checkout URL
9
+ */
10
+ export default function getProductCheckoutUrl(productSlug: string, siteSuffix: string, redirectUrl: string, isUserConnected: boolean): string;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Return the checkout URL for the given product.
3
+ *
4
+ * @param {string} productSlug - wpcom product slug.
5
+ * @param {string} siteSuffix - Site suffix
6
+ * @param {string} redirectUrl - Redirect URL used to define redirect_to
7
+ * @param {boolean} isUserConnected - True when the user is connected Jetpack
8
+ * @return {string} The Calypso checkout URL
9
+ */
10
+ export default function getProductCheckoutUrl(productSlug, siteSuffix, redirectUrl, isUserConnected) {
11
+ const checkoutUrl = new URL('https://wordpress.com/checkout/');
12
+ const checkoutProductUrl = new URL(`${checkoutUrl}${siteSuffix}/${productSlug}`);
13
+ // Add redirect_to parameter
14
+ checkoutProductUrl.searchParams.set('redirect_to', redirectUrl);
15
+ // Add unlimited when user is not connected to Jetpack.
16
+ if (!isUserConnected) {
17
+ checkoutProductUrl.searchParams.set('unlinked', '1');
18
+ }
19
+ // Add site to query string.
20
+ checkoutProductUrl.searchParams.set('site', siteSuffix);
21
+ return checkoutProductUrl.toString();
22
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Returns the site admin URL.
3
+ *
4
+ * @return {?string} The site admin URL or null if not available.
5
+ */
6
+ export default function getSiteAdminUrl(): string;
@@ -0,0 +1,13 @@
1
+ import { getScriptData } from '@automattic/jetpack-script-data';
2
+ /**
3
+ * Returns the site admin URL.
4
+ *
5
+ * @return {?string} The site admin URL or null if not available.
6
+ */
7
+ export default function getSiteAdminUrl() {
8
+ return (getScriptData()?.site?.admin_url ||
9
+ window.Initial_State?.adminUrl ||
10
+ window.Jetpack_Editor_Initial_State?.adminUrl ||
11
+ window?.myJetpackInitialState?.adminUrl ||
12
+ null);
13
+ }
@@ -0,0 +1,20 @@
1
+ import { GetRedirectUrlArgs } from './types.js';
2
+ /**
3
+ * Builds an URL using the jetpack.com/redirect/ service
4
+ *
5
+ * If source is a simple slug, it will be sent using the source query parameter. e.g. jetpack.com/redirect/?source=slug
6
+ *
7
+ * If source is a full URL, starting with https://, it will be sent using the url query parameter. e.g. jetpack.com/redirect/?url=https://wordpress.com
8
+ *
9
+ * Note: if using full URL, query parameters and anchor must be passed in args. Any querystring of url fragment in the URL will be discarded.
10
+ *
11
+ * @since 0.2.0
12
+ * @param {string} source - The URL handler registered in the server or the full destination URL (starting with https://).
13
+ * @param {GetRedirectUrlArgs} args - Additional arguments to build the url.
14
+ * This is not a complete list as any argument passed here
15
+ * will be sent to as a query parameter to the Redirect server.
16
+ * These parameters will not necessarily be passed over to the final destination URL.
17
+ * If you want to add a parameter to the final destination URL, use the `query` argument.
18
+ * @return {string} The redirect URL
19
+ */
20
+ export default function getRedirectUrl(source: string, args?: GetRedirectUrlArgs): string;
@@ -0,0 +1,50 @@
1
+ /* global jetpack_redirects */
2
+ /**
3
+ * Builds an URL using the jetpack.com/redirect/ service
4
+ *
5
+ * If source is a simple slug, it will be sent using the source query parameter. e.g. jetpack.com/redirect/?source=slug
6
+ *
7
+ * If source is a full URL, starting with https://, it will be sent using the url query parameter. e.g. jetpack.com/redirect/?url=https://wordpress.com
8
+ *
9
+ * Note: if using full URL, query parameters and anchor must be passed in args. Any querystring of url fragment in the URL will be discarded.
10
+ *
11
+ * @since 0.2.0
12
+ * @param {string} source - The URL handler registered in the server or the full destination URL (starting with https://).
13
+ * @param {GetRedirectUrlArgs} args - Additional arguments to build the url.
14
+ * This is not a complete list as any argument passed here
15
+ * will be sent to as a query parameter to the Redirect server.
16
+ * These parameters will not necessarily be passed over to the final destination URL.
17
+ * If you want to add a parameter to the final destination URL, use the `query` argument.
18
+ * @return {string} The redirect URL
19
+ */
20
+ export default function getRedirectUrl(source, args = {}) {
21
+ const queryVars = {};
22
+ let calypsoEnv;
23
+ if (typeof window !== 'undefined') {
24
+ calypsoEnv = window?.JP_CONNECTION_INITIAL_STATE?.calypsoEnv;
25
+ }
26
+ if (source.search('https://') === 0) {
27
+ const parsedUrl = new URL(source);
28
+ // discard any query and fragments.
29
+ source = `https://${parsedUrl.host}${parsedUrl.pathname}`;
30
+ queryVars.url = encodeURIComponent(source);
31
+ }
32
+ else {
33
+ queryVars.source = encodeURIComponent(source);
34
+ }
35
+ for (const argName in args) {
36
+ queryVars[argName] = encodeURIComponent(args[argName]);
37
+ }
38
+ if (!Object.keys(queryVars).includes('site') &&
39
+ typeof jetpack_redirects !== 'undefined' &&
40
+ Object.hasOwn(jetpack_redirects, 'currentSiteRawUrl')) {
41
+ queryVars.site = jetpack_redirects.currentBlogID ?? jetpack_redirects.currentSiteRawUrl;
42
+ }
43
+ if (calypsoEnv) {
44
+ queryVars.calypso_env = calypsoEnv;
45
+ }
46
+ const queryString = Object.keys(queryVars)
47
+ .map(key => key + '=' + queryVars[key])
48
+ .join('&');
49
+ return `https://jetpack.com/redirect/?` + queryString;
50
+ }
@@ -0,0 +1,39 @@
1
+ export type GetRedirectUrlArgs = {
2
+ /**
3
+ * URL of the current site. Will default to the value of
4
+ * jetpack_redirects.currentSiteRawUrl, if available.
5
+ * Used to fill in the `[site]` placeholder in the target.
6
+ */
7
+ site?: string;
8
+ /**
9
+ * Additional path to be appended to the URL.
10
+ * Used to fill in the `[path]` placeholder in the target.
11
+ */
12
+ path?: string;
13
+ /**
14
+ * Query parameters to be added to the final destination URL.
15
+ * Should be in query string format (e.g. 'key=value&foo=bar').
16
+ */
17
+ query?: string;
18
+ /**
19
+ * Anchor to be added to the URL. Must be a single string.
20
+ * Example: `section1`.
21
+ */
22
+ anchor?: string;
23
+ /**
24
+ * Any other custom arguments to be added to the final destination URL.
25
+ */
26
+ [key: string]: string;
27
+ };
28
+ export type QueryVars = {
29
+ url?: string;
30
+ site?: string;
31
+ source?: string;
32
+ calypso_env?: string;
33
+ };
34
+ declare global {
35
+ const jetpack_redirects: {
36
+ currentSiteRawUrl?: string;
37
+ currentBlogID?: string;
38
+ };
39
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { IntroOffer } from './types.js';
2
+ /**
3
+ * Returns whether an Introductory Offer is a first month trial
4
+ *
5
+ * @param {IntroOffer} introOffer - an intro offer object
6
+ * @return {boolean} Whether it's a first month trial or not
7
+ */
8
+ export declare function isFirstMonthTrial(introOffer: IntroOffer): boolean;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Returns whether an Introductory Offer is a first month trial
3
+ *
4
+ * @param {IntroOffer} introOffer - an intro offer object
5
+ * @return {boolean} Whether it's a first month trial or not
6
+ */
7
+ export function isFirstMonthTrial(introOffer) {
8
+ return introOffer?.interval_count === 1 && introOffer?.interval_unit === 'month';
9
+ }
@@ -0,0 +1,12 @@
1
+ export interface IntroOffer {
2
+ product_id: number;
3
+ product_slug: string;
4
+ currency_code: string;
5
+ formatted_price: string;
6
+ original_price: number;
7
+ raw_price: number;
8
+ discount_percentage: number;
9
+ ineligible_reason: string[] | null;
10
+ interval_unit: string;
11
+ interval_count: number;
12
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -24,6 +24,7 @@ const AdminPage: React.FC< AdminPageProps > = ( {
24
24
  moduleNameHref,
25
25
  showHeader = true,
26
26
  showFooter = true,
27
+ useInternalLinks = false,
27
28
  showBackground = true,
28
29
  sandboxedDomain = '',
29
30
  apiRoot = '',
@@ -90,6 +91,7 @@ const AdminPage: React.FC< AdminPageProps > = ( {
90
91
  moduleName={ moduleName }
91
92
  moduleNameHref={ moduleNameHref }
92
93
  menu={ optionalMenuItems }
94
+ useInternalLinks={ useInternalLinks }
93
95
  />
94
96
  </Col>
95
97
  </Container>
@@ -26,6 +26,11 @@ export type AdminPageProps = {
26
26
  */
27
27
  showFooter?: boolean;
28
28
 
29
+ /**
30
+ * Whether or not to link to Jetpack plugin admin pages.
31
+ */
32
+ useInternalLinks?: boolean;
33
+
29
34
  /**
30
35
  * Link that the Footer Module name will link to (optional).
31
36
  */
@@ -28,6 +28,15 @@ interface UplotChartProps {
28
28
  range?: { startDate: number; endDate: number };
29
29
  }
30
30
 
31
+ interface UplotReactProps {
32
+ options: uPlot.Options;
33
+ data: uPlot.AlignedData;
34
+ target?: HTMLElement | ( ( self: uPlot, init: () => void ) => void );
35
+ onDelete?: ( chart: uPlot ) => void;
36
+ onCreate?: ( chart: uPlot ) => void;
37
+ resetScales?: boolean;
38
+ }
39
+
31
40
  /**
32
41
  * Creates a series information object for uPlot based on the label and color.
33
42
  *
@@ -202,9 +211,15 @@ export default function UplotLineChart( { range, periods, annotations = [] }: Up
202
211
  return ( uplot.current = chart );
203
212
  }, [] );
204
213
 
214
+ /**
215
+ * Type casting to prevent TypeScript error:
216
+ * TS2604: JSX element type 'UplotReact' does not have any construct or call signatures.
217
+ */
218
+ const TypedUplotReact = UplotReact as unknown as React.ComponentType< UplotReactProps >;
219
+
205
220
  return (
206
221
  <div ref={ uplotContainer } className="boost-uplot-container">
207
- <UplotReact data={ data } onCreate={ onCreate } options={ options } />
222
+ <TypedUplotReact data={ data } onCreate={ onCreate } options={ options } />
208
223
  </div>
209
224
  );
210
225
  }
@@ -1,9 +1,7 @@
1
- import { useSelect } from '@wordpress/data';
2
1
  import { __, _x } from '@wordpress/i18n';
3
2
  import { Icon, external } from '@wordpress/icons';
4
3
  import clsx from 'clsx';
5
4
  import React from 'react';
6
- import { STORE_ID as CONNECTION_STORE_ID } from '../../../../js-packages/connection/state/store.jsx';
7
5
  import { getRedirectUrl } from '../../index.js';
8
6
  import getSiteAdminUrl from '../../tools/get-site-admin-url/index.js';
9
7
  import AutomatticBylineLogo from '../automattic-byline-logo/index.js';
@@ -39,6 +37,7 @@ const JetpackFooter: React.FC< JetpackFooterProps > = ( {
39
37
  className,
40
38
  moduleNameHref = 'https://jetpack.com',
41
39
  menu,
40
+ useInternalLinks,
42
41
  onAboutClick,
43
42
  onPrivacyClick,
44
43
  onTermsClick,
@@ -48,42 +47,25 @@ const JetpackFooter: React.FC< JetpackFooterProps > = ( {
48
47
  const [ isMd ] = useBreakpointMatch( 'md', '<=' );
49
48
  const [ isLg ] = useBreakpointMatch( 'lg', '>' );
50
49
 
51
- const { isActive, connectedPlugins } = useSelect( select => {
52
- const connectionStatus = select( CONNECTION_STORE_ID ) as {
53
- getConnectedPlugins: () => { slug: string }[];
54
- getConnectionStatus: () => { isActive: boolean };
55
- };
56
-
57
- return {
58
- connectedPlugins: connectionStatus?.getConnectedPlugins(),
59
- ...connectionStatus.getConnectionStatus(),
60
- };
61
- }, [] );
62
50
  const siteAdminUrl = getSiteAdminUrl();
63
- const areAdminLinksEnabled =
64
- siteAdminUrl &&
65
- // Some admin pages require the site to be connected (e.g., Privacy)
66
- isActive &&
67
- // Admin pages are part of the Jetpack plugin and required it to be installed
68
- connectedPlugins?.some( ( { slug } ) => 'jetpack' === slug );
69
51
 
70
52
  let items: JetpackFooterMenuItem[] = [
71
53
  {
72
54
  label: _x( 'About', 'Link to learn more about Jetpack.', 'jetpack-components' ),
73
55
  title: __( 'About Jetpack', 'jetpack-components' ),
74
- href: areAdminLinksEnabled
56
+ href: useInternalLinks
75
57
  ? new URL( 'admin.php?page=jetpack_about', siteAdminUrl ).href
76
58
  : getRedirectUrl( 'jetpack-about' ),
77
- target: areAdminLinksEnabled ? '_self' : '_blank',
59
+ target: useInternalLinks ? '_self' : '_blank',
78
60
  onClick: onAboutClick,
79
61
  },
80
62
  {
81
63
  label: _x( 'Privacy', 'Shorthand for Privacy Policy.', 'jetpack-components' ),
82
64
  title: __( "Automattic's Privacy Policy", 'jetpack-components' ),
83
- href: areAdminLinksEnabled
65
+ href: useInternalLinks
84
66
  ? new URL( 'admin.php?page=jetpack#/privacy', siteAdminUrl ).href
85
67
  : getRedirectUrl( 'a8c-privacy' ),
86
- target: areAdminLinksEnabled ? '_self' : '_blank',
68
+ target: useInternalLinks ? '_self' : '_blank',
87
69
  onClick: onPrivacyClick,
88
70
  },
89
71
  {
@@ -118,6 +100,7 @@ const JetpackFooter: React.FC< JetpackFooterProps > = ( {
118
100
  className
119
101
  ) }
120
102
  aria-label={ __( 'Jetpack', 'jetpack-components' ) }
103
+ role="contentinfo"
121
104
  { ...otherProps }
122
105
  >
123
106
  <ul>
@@ -156,7 +139,7 @@ const JetpackFooter: React.FC< JetpackFooterProps > = ( {
156
139
  <li className="jp-dashboard-footer__a8c-item">
157
140
  <a
158
141
  href={
159
- areAdminLinksEnabled
142
+ useInternalLinks
160
143
  ? new URL( 'admin.php?page=jetpack_about', siteAdminUrl ).href
161
144
  : getRedirectUrl( 'a8c-about' )
162
145
  }
@@ -25,6 +25,11 @@
25
25
  }
26
26
 
27
27
  &:focus {
28
+ box-shadow: none;
29
+ outline-width: 0;
30
+ }
31
+
32
+ &:focus-visible {
28
33
  border-radius: 2px;
29
34
  box-shadow: none;
30
35
  outline: 1.5px solid currentColor;
@@ -29,6 +29,11 @@ export type JetpackFooterProps = {
29
29
  */
30
30
  menu?: JetpackFooterMenuItem[];
31
31
 
32
+ /**
33
+ * Whether to enable Jetpack admin links.
34
+ */
35
+ useInternalLinks?: boolean;
36
+
32
37
  /**
33
38
  * URL of the site WP Admin.
34
39
  */
@@ -1,6 +1,6 @@
1
1
  import clsx from 'clsx';
2
2
  import React from 'react';
3
- import ReactSlider from 'react-slider';
3
+ import ReactSlider, { ReactSliderProps } from 'react-slider';
4
4
  import { NumberSliderProps } from './types.js';
5
5
  import './style.scss';
6
6
 
@@ -56,9 +56,15 @@ const NumberSlider: React.FC< NumberSliderProps > = ( {
56
56
  );
57
57
  };
58
58
 
59
+ /**
60
+ * Type casting to prevent TypeScript error:
61
+ * TS2604: JSX element type 'ReactSlider' does not have any construct or call signatures.
62
+ */
63
+ const TypedReactSlider = ReactSlider as unknown as React.ComponentType< ReactSliderProps >;
64
+
59
65
  return (
60
66
  <div className={ componentClassName } data-testid="number-slider">
61
- <ReactSlider
67
+ <TypedReactSlider
62
68
  className="jp-components-number-slider__control"
63
69
  thumbClassName="jp-components-number-slider__thumb"
64
70
  thumbActiveClassName="jp-components-number-slider__thumb--is-active"