Skip to content

Commit 04e4ef2

Browse files
committed
Merge branch 'trunk' into add/login/magic-code-prepare-store
# Conflicts: # config/development.json
2 parents 76788ed + 1fb3780 commit 04e4ef2

File tree

114 files changed

+1655
-904
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+1655
-904
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ node_modules/
1717
/desktop/public/
1818
/desktop/release/
1919
/client/state/data-layer/wpcom/activity-log/update-credentials/vendor/
20+
storybook-static/
2021

2122
# Built packages
2223
/packages/*/dist/

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ module.exports = {
6060
},
6161
},
6262
{
63-
files: [ 'bin/**/*', 'test/**/*' ],
63+
files: [ '**/bin/**/*', '**/test/**/*', 'webpack.config.js' ],
6464
...nodeConfig,
6565
},
6666
{

apps/happy-blocks/bin/build-translations-manifest.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env node
22

3-
/* eslint-disable import/no-nodejs-modules */
43
const fs = require( 'fs' );
54
const path = require( 'path' );
65
const glob = require( 'glob' );

apps/happy-blocks/webpack.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/**
22
* WARNING: No ES6 modules here. Not transpiled!
33
*/
4-
// eslint-disable-next-line import/no-nodejs-modules
54
const { existsSync } = require( 'fs' );
65
const path = require( 'path' );
76
const getBaseWebpackConfig = require( '@automattic/calypso-build/webpack.config.js' );

client/blocks/reader-full-post/index.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,10 @@ export class FullPostView extends Component {
625625

626626
const isDefaultLayout = this.props.layout !== 'recent';
627627
const siteName = getSiteName( { site, post } );
628-
const classes = { 'reader-full-post': true };
628+
const classes = {
629+
'reader-full-post': true,
630+
'is-reddit-post': post.is_reddit_post,
631+
};
629632
const showRelatedPosts = post && ! post.is_external && post.site_ID && isDefaultLayout;
630633
const relatedPostsFromOtherSitesTitle = translate(
631634
'More on {{wpLink}}WordPress.com{{/wpLink}}',

client/blocks/reader-full-post/style.scss

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,3 +845,24 @@ $reader-full-post-desktop-min: $reader-full-post-sidebar-width + $reader-full-po
845845
}
846846
}
847847
}
848+
849+
.reader-full-post.is-reddit-post {
850+
.reader-full-post__story-content {
851+
// Remove Reddit table styles
852+
table {
853+
width: 100%;
854+
border-collapse: collapse;
855+
display: block;
856+
857+
tr, td {
858+
display: block;
859+
width: 100%;
860+
}
861+
862+
// Add a margin above the submitted by meta
863+
td .md {
864+
margin-bottom: 24px;
865+
}
866+
}
867+
}
868+
}

client/blocks/upsell-nudge/style.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
.banner__info .banner__title {
3535
color: var(--color-text-inverted);
3636
font-weight: 400;
37+
text-wrap: pretty;
3738
}
3839
.card__link-indicator {
3940
fill: var(--color-text-inverted);

client/components/language-picker/modal.scss

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,38 @@
1010
justify-content: center;
1111
}
1212

13-
.language-picker__modal {
14-
max-width:80%;
15-
min-width: 80%;
16-
@media (max-width: $break-mobile) {
17-
max-width: 90%;
18-
min-width: 90%;
13+
.language-picker-modal__wrapper {
14+
// Limit the height to prevent modal resize on content change, when the modal is not full height.
15+
@media (min-width: $break-small) {
16+
max-height: 600px;
17+
// Limit height on smaller screens.
18+
height:80%;
1919
}
20-
.components-modal__header {
21-
display:none;
20+
21+
.language-picker-modal__content {
22+
display:flex;
23+
flex-direction: column;
24+
// Limit height to container, instead of overflowing and pushing down the footer.
25+
height: 100%;
26+
}
27+
.language-picker-modal__body {
28+
overflow-y: auto;
29+
// Fix cropped box shadow.
30+
padding:1px;
31+
margin:-1px;
32+
}
33+
.language-picker-modal__footer {
34+
margin-top: auto;
2235
}
2336

2437
.components-modal__content {
25-
padding: 24px 0 0 0;
26-
margin-top: 24px;
27-
display:flex;
28-
/* Targeting the content div, we can't alter the HTML of the modal itself */
29-
>div:nth-child(2) {
30-
height: 100%;
31-
display: flex;
32-
flex-direction: column;
33-
}
34-
35-
.components-flex-block {
36-
flex:none;
37-
}
38-
.language-picker-component {
39-
overflow-y: auto;
40-
padding:0 24px;
41-
.language-picker-component__heading {
42-
margin: 6px 0 24px;
43-
}
44-
.components-flex {
45-
flex:initial;
46-
}
47-
}
38+
display: flex;
39+
}
40+
// Force width to 100% even if the content is not that wide.
41+
.components-modal__content > div {
42+
width: 100%;
4843
}
44+
4945
}
5046

5147
.language-picker__modal-empathy-mode {
@@ -101,7 +97,7 @@
10197
}
10298

10399
.language-picker__modal-buttons {
104-
padding: 24px;
100+
padding: 24px 24px 0;
105101
width: 100%;
106102
display: flex;
107103
flex-direction: row;

client/components/language-picker/modal.tsx

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -197,19 +197,24 @@ const LanguagePickerModal: React.FC< Props > = ( {
197197
return (
198198
<Modal
199199
onRequestClose={ onClose }
200-
className="language-picker__modal"
201-
overlayClassName="language-picker__overlay"
200+
className="language-picker-modal__wrapper"
201+
size="large"
202+
title={ __( 'Select a language' ) }
202203
>
203-
<QueryLanguageNames />
204-
<LanguagePicker
205-
headingTitle={ __( 'Select a language' ) }
206-
languages={ languages }
207-
languageGroups={ createLanguageGroups( __ ) }
208-
onSelectLanguage={ setSelectedLanguage }
209-
selectedLanguage={ selectedLanguage }
210-
localizedLanguageNames={ localizedLanguageNames }
211-
/>
212-
<div>{ buttons }</div>
204+
<div className="language-picker-modal__content">
205+
<div className="language-picker-modal__body">
206+
<QueryLanguageNames />
207+
<LanguagePicker
208+
headingTitle
209+
languages={ languages }
210+
languageGroups={ createLanguageGroups( __ ) }
211+
onSelectLanguage={ setSelectedLanguage }
212+
selectedLanguage={ selectedLanguage }
213+
localizedLanguageNames={ localizedLanguageNames }
214+
/>
215+
</div>
216+
<div className="language-picker-modal__footer">{ buttons }</div>
217+
</div>
213218
</Modal>
214219
);
215220
};

client/components/navigation-header/navigation-header.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
text-decoration: none;
5050
font-size: $default-font-size;
5151
transition: color 0.2s ease;
52+
cursor: pointer;
5253

5354
&:hover {
5455
color: var(--wp-components-color-gray-900, $gray-900);

client/components/navigation-header/navigation-header.tsx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
import page from '@automattic/calypso-router';
12
import clsx from 'clsx';
23
import { translate } from 'i18n-calypso';
34
import { ReactNode } from 'react';
5+
import { popCurrentScreenFromHistory } from 'calypso/my-sites/stats/hooks/use-stats-navigation-history';
46
import './navigation-header.scss';
57

68
// Type definitions for the props
79
interface BackLinkProps {
810
url?: string;
911
text?: string;
10-
onBackClick?: ( e: React.MouseEvent< HTMLAnchorElement > ) => void;
12+
onBackClick?: () => void;
1113
}
1214

1315
export interface HeaderProps extends React.HTMLAttributes< HTMLElement > {
@@ -42,18 +44,22 @@ const NavigationHeader: React.FC< HeaderProps > = ( {
4244
backLinkProps,
4345
titleElement,
4446
headElement = backLinkProps?.url && (
45-
<a
47+
<button
4648
className="calypso-navigation-header__back-link"
47-
href={ backLinkProps?.url }
48-
onClick={ ( e ) => {
49+
type="button"
50+
aria-label={ backLinkProps?.text || translate( 'Back' ) }
51+
onClick={ () => {
52+
popCurrentScreenFromHistory();
53+
4954
if ( backLinkProps?.onBackClick ) {
50-
e.preventDefault();
51-
backLinkProps.onBackClick( e );
55+
backLinkProps.onBackClick();
56+
} else if ( backLinkProps?.url ) {
57+
page( backLinkProps.url );
5258
}
5359
} }
5460
>
5561
{ backLinkProps?.text ?? translate( 'Back' ) }
56-
</a>
62+
</button>
5763
),
5864
rightSection,
5965
hasScreenOptionsTab,

client/components/navigation-header/stories/navigation-header.stories.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ export const WithScreenOptions: Story = {
9090
backLinkProps: {
9191
url: '/dashboard',
9292
text: 'Back to Dashboard',
93-
onBackClick: ( e ) => {
94-
e.preventDefault();
93+
onBackClick: () => {
9594
alert( 'Back button clicked!' );
9695
},
9796
},

client/components/sites-add-new-site/content/index.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { recordTracksEvent } from '@automattic/calypso-analytics';
22
import page from '@automattic/calypso-router';
3-
import { WordPressLogo, JetpackLogo } from '@automattic/components';
3+
import { WordPressLogo, JetpackLogo, BigSkyLogo } from '@automattic/components';
44
import { localizeUrl, useHasEnTranslation } from '@automattic/i18n-utils';
55
import { formatNumber } from '@automattic/number-formatters';
66
import { download, reusableBlock, Icon } from '@wordpress/icons';
@@ -45,6 +45,13 @@ const importClick = () => {
4545
);
4646
};
4747

48+
const bigSkyClick = () => {
49+
recordTracksEvent( 'calypso_sites_dashboard_new_site_action_click_item', {
50+
action: 'big-sky',
51+
} );
52+
page( '/setup/ai-site-builder' );
53+
};
54+
4855
const offerClick = () => {
4956
recordTracksEvent( 'calypso_sites_dashboard_new_site_action_click_item', {
5057
action: 'offer',
@@ -66,6 +73,16 @@ export const Content = () => {
6673
onClick: wordpressClick,
6774
} }
6875
/>
76+
<MenuItem
77+
icon={ <BigSkyLogo.Mark /> }
78+
heading={ translate( 'Build with AI' ) }
79+
description={ translate(
80+
'Prompt, edit, and launch WordPress websites with Artificial Intelligence.'
81+
) }
82+
buttonProps={ {
83+
onClick: bigSkyClick,
84+
} }
85+
/>
6986
<MenuItem
7087
icon={ <JetpackLogo /> }
7188
heading={ translate( 'Via the Jetpack plugin' ) }

client/components/social-buttons/apple.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,8 @@ export class AppleLoginButton extends Component {
151151
customButton
152152
) : (
153153
<Button
154-
className={ clsx( 'a8c-components-wp-button social-buttons__button apple', {
155-
disabled: isDisabled,
156-
} ) }
154+
className="a8c-components-wp-button social-buttons__button apple"
155+
disabled={ isDisabled }
157156
data-social-service="apple"
158157
onClick={ this.handleClick }
159158
variant="secondary"

client/components/social-buttons/github.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,8 @@ export const GitHubLoginButton = ( {
181181
customButton
182182
) : (
183183
<Button
184-
className={ clsx( 'a8c-components-wp-button social-buttons__button github', {
185-
disabled: isDisabled,
186-
} ) }
184+
className="a8c-components-wp-button social-buttons__button github"
185+
disabled={ isDisabled }
187186
data-social-service="github"
188187
{ ...eventHandlers }
189188
variant="secondary"

client/components/social-buttons/google.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,7 @@ export class GoogleSocialButton extends Component {
198198
customButton
199199
) : (
200200
<Button
201-
className={ clsx( 'a8c-components-wp-button social-buttons__button google', {
202-
disabled: isDisabled,
203-
} ) }
201+
className="a8c-components-wp-button social-buttons__button google"
204202
onClick={ this.handleClick }
205203
data-social-service="google"
206204
disabled={ isDisabled }

client/components/social-buttons/magic-login.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { recordTracksEvent } from '@automattic/calypso-analytics';
22
import { Button } from '@wordpress/components';
3-
import clsx from 'clsx';
43
import { useTranslate } from 'i18n-calypso';
54
import MailIcon from 'calypso/components/social-icons/mail';
65
import { useSelector, useDispatch } from 'calypso/state';
@@ -29,9 +28,8 @@ export const MagicLoginButton = ( { loginUrl }: MagicLoginButtonProps ) => {
2928

3029
return (
3130
<Button
32-
className={ clsx( 'a8c-components-wp-button social-buttons__button magic-login-link', {
33-
disabled: isDisabled,
34-
} ) }
31+
className="a8c-components-wp-button social-buttons__button magic-login-link"
32+
disabled={ isDisabled }
3533
href={ loginUrl }
3634
onClick={ handleClick }
3735
data-e2e-link="magic-login-link"

client/components/social-buttons/qr-code.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { recordTracksEvent } from '@automattic/calypso-analytics';
22
import { Button } from '@wordpress/components';
3-
import clsx from 'clsx';
43
import { useTranslate } from 'i18n-calypso';
54
import JetpackLogo from 'calypso/components/jetpack-logo';
65
import { useSelector, useDispatch } from 'calypso/state';
@@ -39,9 +38,8 @@ export default function QrCodeLoginButton( { loginUrl }: QrCodeLoginButtonProps
3938

4039
return (
4140
<Button
42-
className={ clsx( 'a8c-components-wp-button social-buttons__button', {
43-
disabled: isDisabled,
44-
} ) }
41+
className="a8c-components-wp-button social-buttons__button"
42+
disabled={ isDisabled }
4543
href={ loginUrl }
4644
onClick={ handleClick }
4745
data-e2e-link="magic-login-link"

client/components/social-buttons/style.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
border-radius: 0;
1111
margin-right: auto;
1212
fill: inherit;
13-
14-
&.disabled {
15-
display: none;
16-
}
1713
}
1814

1915
> span {

0 commit comments

Comments
 (0)