Skip to content

Commit 7051b9a

Browse files
dkoodependabot[bot]miguelpeixematticbotleogermani
authored
Release May 08 (#2448)
* chore(deps-dev): bump phpunit/phpunit from 9.6.6 to 9.6.7 Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.6.6 to 9.6.7. - [Release notes](https://github.com/sebastianbergmann/phpunit/releases) - [Changelog](https://github.com/sebastianbergmann/phpunit/blob/9.6.7/ChangeLog-9.6.md) - [Commits](sebastianbergmann/phpunit@9.6.6...9.6.7) --- updated-dependencies: - dependency-name: phpunit/phpunit dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump @wordpress/browserslist-config Bumps [@wordpress/browserslist-config](https://github.com/WordPress/gutenberg/tree/HEAD/packages/browserslist-config) from 5.13.0 to 5.14.0. - [Release notes](https://github.com/WordPress/gutenberg/releases) - [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/browserslist-config/CHANGELOG.md) - [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/browserslist-config@5.14.0/packages/browserslist-config) --- updated-dependencies: - dependency-name: "@wordpress/browserslist-config" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * fix(newsletters): only attempt token verification for Constant Contact (#2407) Co-authored-by: Derrick Koo <derrick.koo@automattic.com> * fix(perfmatters): exclude Jetpack and Newsletters css delay (#2410) * feat(sign-in): body class when in modal and url hash (#2414) * chore(deps): bump js-cookie from 3.0.1 to 3.0.5 Bumps [js-cookie](https://github.com/js-cookie/js-cookie) from 3.0.1 to 3.0.5. - [Release notes](https://github.com/js-cookie/js-cookie/releases) - [Changelog](https://github.com/js-cookie/js-cookie/blob/main/.release-it.json) - [Commits](js-cookie/js-cookie@v3.0.1...v3.0.5) --- updated-dependencies: - dependency-name: js-cookie dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * feat: memberships block patterns (#2406) * fix: add filter to prompt conflicts check (#2421) * fix: ensure .hooks is excluded from the dist ZIP (#2420) Currently, `.hooks` is being included in the release archive. This change ensures it isn't. * feat: RAS setup UI and default Campaigns wizard (#2426) * feat: start new RAS settings page (#2381) * feat(memberships): content gate page (#2366) * feat: start new RAS settings page * feat: remove setup_complete state and update copy and list of prereqs * chore: update copy of setup links * chore: copy update * chore: more copy updates * fix: Avoid falal error on Reader Revenue wizard (#2382) * chore: add TODO comment so we don’t forget to update the help URL * fix: use correct method for checking ESP configuration --------- Co-authored-by: Miguel Peixe <miguel.peixe@automattic.com> Co-authored-by: leogermani <leogermani@automattic.com> * feat: update RAS settings layout to i3 designs (#2386) * feat: start new RAS settings page * feat: remove setup_complete state and update copy and list of prereqs * chore: update copy of setup links * chore: copy update * chore: more copy updates * chore: add TODO comment so we don’t forget to update the help URL * fix: use correct method for checking ESP configuration * feat: add expandable feature to ActionCard component * chore: add expandable ActionCard example to comopnents demo page * feat: update RAS settings page layout to i3 designs * feat: limit saved config to each fields with save button * feat: collapse cards when completing settings * fix: if settings link to another page, show "Configure" button label instead of "Save" * chore: remove TOOO statements for completed tasks * chore: update inline doc * chore: remove unnecessary inFlight param * fix: error in React in webpack production builds using functional components * fix: allow expandable cards to expand * chore: remove console.log * fix(amp): improved iframe polyfill and include vimeo Co-authored-by: Leo Germani <leogermani@automattic.com> * chore(release): 1.111.1 [skip ci] ## [1.111.1](v1.111.0...v1.111.1) (2023-04-03) ### Bug Fixes * **amp:** improved iframe polyfill and include vimeo ([592eba7](592eba7)) * feat(reader-registration): add recaptcha panel in the editor (#2397) * feat: RAS default prompts wizard UI (#2399) * feat: start new RAS settings page * feat: remove setup_complete state and update copy and list of prereqs * chore: update copy of setup links * chore: copy update * chore: more copy updates * chore: add TODO comment so we don’t forget to update the help URL * fix: use correct method for checking ESP configuration * feat: add expandable feature to ActionCard component * chore: add expandable ActionCard example to comopnents demo page * feat: update RAS settings page layout to i3 designs * feat: limit saved config to each fields with save button * feat: collapse cards when completing settings * fix: if settings link to another page, show "Configure" button label instead of "Save" * chore: remove TOOO statements for completed tasks * chore: update inline doc * chore: remove unnecessary inFlight param * refactor: split Prerequisites checklist item into its own component * fix: missing props * feat: scaffold layout components and user input fields data for prompt wizard * fix: error in React in webpack production builds using functional components * fix: allow expandable cards to expand * chore: remove console.log * feat: fetch prompt config from server or Popups presets * chore: show loading state while prompts are being fetched * feat: save user inputs and populate prompt content * fix: add new components folder to engagement wizard * feat: complete prompt save functionality * feat: enable Continue button when all prompts are ready * refactor: forgot about the "every" method * feat: make RAS Campaign prerequisite card dynamic * chore: improve docblock for update_prompt() method * refactor: refactor Prerequisite component as TS * chore: remove console.logs * chore: add comment pointing to existing schema for prompt object * feat: update path of RAS prompt wizard to be a subroute of RAS route * feat: pre-populate input fields with default values * refactor: prompt.js as prompt.tsx * fix: add missing TS files * chore: remove more console.logs * fix: fixes for TS * refactor: move RAS prompt API endpoints to Newspack Campaigns * fix: error with Button prop * feat: scroll to top on view change * chore: remove unneeded middleware methods * chore: remove unneeded middleware methods * fix: typescript error Co-authored-by: Miguel Peixe <miguel.peixe@automattic.com> * fix: type errors --------- Co-authored-by: Miguel Peixe <miguel.peixe@automattic.com> * feat: add help info for preset prompts (#2415) * feat: add help info for preset prompts * style: tweak colors of recommendation list items * feat: 'completed' splash page (#2416) * feat: start building out completed splash screen * feat: adding second component for individual list items * feat: adding background border * feat: fix bolding and correct number border spacing * feat: switch from flexbox to grid * feat: renaming the steps list compontent * fix: wrong PromptType definition * fix: add tabbed navigation to RAS "complete" screen * fix: don’t collapse prompt card if saving to preview * fix: move link to Complete screen to prompt wizard "Continue" button * fix: section heading styles and add external link to help docs * style: update styles to i3 designs * feat: activation progress bar animation * feat: activate RAS defaults with user input on command * fix: only consider ESP setup if there are enabled lists * fix: allow RAS prereq options to be editable before RAS is enabled * fix: condition for preview request rendering * fix: reader revenue platform requirements * feat: make expandable card titles clickable --------- Co-authored-by: Derrick Koo <derrick.koo@automattic.com> * feat: add handoff message for prerequisites (#2422) * feat: update UI of Newsletters wizard * feat: show handoff instructions and link back to RAS wizard in external wizard [ages * chore: clarify lock message for subscription lists * fix: also show handoff messages in Wizard component * fix: typo * chore: update message copy * fix: only show hand-off message if the prerequisite object has instructions property * chore: update copy throughout RAS UI * fix: re-add missing props from Complete view --------- Co-authored-by: Miguel Peixe <miguel.peixe@automattic.com> Co-authored-by: leogermani <leogermani@automattic.com> Co-authored-by: matticbot <semantic-release-bot@martynus.net> Co-authored-by: Laurel <laurel.fulford@automattic.com> * chore(release): 1.114.0-alpha.1 [skip ci] # [1.114.0-alpha.1](v1.113.0...v1.114.0-alpha.1) (2023-04-28) ### Bug Fixes * add filter to prompt conflicts check ([#2421](#2421)) ([8d1c1d3](8d1c1d3)) * ensure .hooks is excluded from the dist ZIP ([#2420](#2420)) ([75f8f36](75f8f36)) * **newsletters:** only attempt token verification for Constant Contact ([#2407](#2407)) ([c58f9a8](c58f9a8)) * **perfmatters:** exclude Jetpack and Newsletters css delay ([#2410](#2410)) ([d2b167c](d2b167c)) ### Features * memberships block patterns ([#2406](#2406)) ([c96555a](c96555a)) * RAS setup UI and default Campaigns wizard ([#2426](#2426)) ([a1d4eb7](a1d4eb7)), closes [#2381](#2381) [#2366](#2366) [#2382](#2382) * **sign-in:** body class when in modal and url hash ([#2414](#2414)) ([aea4dc9](aea4dc9)) * feat: update NRH settings page and redirect behavior (#2425) * feat: update NRH settings page and redirect behavior * fix: update example custom domain * feat: unslash the custom domain value * fix: use frequency instead of installmentPeriod --------- Co-authored-by: claudiulodro <claudiulodro@gmail.com> * chore(deps): bump @babel/preset-env from 7.21.4 to 7.21.5 Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.21.4 to 7.21.5. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.21.5/packages/babel-preset-env) --- updated-dependencies: - dependency-name: "@babel/preset-env" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump @wordpress/browserslist-config Bumps [@wordpress/browserslist-config](https://github.com/WordPress/gutenberg/tree/HEAD/packages/browserslist-config) from 5.14.0 to 5.15.0. - [Release notes](https://github.com/WordPress/gutenberg/releases) - [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/browserslist-config/CHANGELOG.md) - [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/browserslist-config@5.15.0/packages/browserslist-config) --- updated-dependencies: - dependency-name: "@wordpress/browserslist-config" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps): bump date-fns from 2.29.3 to 2.30.0 Bumps [date-fns](https://github.com/date-fns/date-fns) from 2.29.3 to 2.30.0. - [Release notes](https://github.com/date-fns/date-fns/releases) - [Changelog](https://github.com/date-fns/date-fns/blob/v2.30.0/CHANGELOG.md) - [Commits](date-fns/date-fns@v2.29.3...v2.30.0) --- updated-dependencies: - dependency-name: date-fns dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump lint-staged from 13.2.1 to 13.2.2 Bumps [lint-staged](https://github.com/okonet/lint-staged) from 13.2.1 to 13.2.2. - [Release notes](https://github.com/okonet/lint-staged/releases) - [Commits](lint-staged/lint-staged@v13.2.1...v13.2.2) --- updated-dependencies: - dependency-name: lint-staged dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * fix(ras-defaults): updates for design review feedback (#2435) * fix(ras-defaults): build previews from inputs and don’t require saving * style: update color of preview icon when in disabled state * chore: remove unneeded isDirty state and method * chore(release): 1.114.0-alpha.2 [skip ci] # [1.114.0-alpha.2](v1.114.0-alpha.1...v1.114.0-alpha.2) (2023-05-03) ### Bug Fixes * **ras-defaults:** updates for design review feedback ([#2435](#2435)) ([3aa6de7](3aa6de7)) ### Features * update NRH settings page and redirect behavior ([#2425](#2425)) ([f7a6c6b](f7a6c6b)) * feat(auth): support "register modal" hash url (#2427) * fix(ras-defaults): feedback from QA (#2437) * feat: scroll to reCAPTCHA settings when viewing Connections * feat: allow empty legal text/URL, but show warning if empty * fix: better scrollTo functionality for SectionHeader component * style: make handoff banner sticky * style: ensure handoff banner is on top * fix: try moving scrollTo to Recaptcha component * fix: use timeout instead for scrollIntoView * chore(release): 1.114.0-alpha.3 [skip ci] # [1.114.0-alpha.3](v1.114.0-alpha.2...v1.114.0-alpha.3) (2023-05-03) ### Bug Fixes * **ras-defaults:** feedback from QA ([#2437](#2437)) ([1dd1f36](1dd1f36)) ### Features * **auth:** support "register modal" hash url ([#2427](#2427)) ([fcb1199](fcb1199)) * fix: check for required plugins in RAS setup wizard (#2442) * chore(release): 1.114.0-alpha.4 [skip ci] # [1.114.0-alpha.4](v1.114.0-alpha.3...v1.114.0-alpha.4) (2023-05-08) ### Bug Fixes * check for required plugins in RAS setup wizard ([#2442](#2442)) ([0d5bb63](0d5bb63)) --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Miguel Peixe <miguel.peixe@automattic.com> Co-authored-by: matticbot <sysops+ghmatticbot@automattic.com> Co-authored-by: leogermani <leogermani@automattic.com> Co-authored-by: philipjohn <philip.john@automattic.com> Co-authored-by: matticbot <semantic-release-bot@martynus.net> Co-authored-by: Laurel <laurel.fulford@automattic.com> Co-authored-by: claudiulodro <claudiulodro@gmail.com>
1 parent 2102334 commit 7051b9a

Some content is hidden

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

55 files changed

+2967
-699
lines changed

.distignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*.config.js
77
.git
88
.gitlab-ci.yml
9+
.hooks
910
.travis.yml
1011
.DS_Store
1112
Thumbs.db

CHANGELOG.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,51 @@
1+
# [1.114.0-alpha.4](https://github.com/Automattic/newspack-plugin/compare/v1.114.0-alpha.3...v1.114.0-alpha.4) (2023-05-08)
2+
3+
4+
### Bug Fixes
5+
6+
* check for required plugins in RAS setup wizard ([#2442](https://github.com/Automattic/newspack-plugin/issues/2442)) ([0d5bb63](https://github.com/Automattic/newspack-plugin/commit/0d5bb63e028a13f47712150787f707593a68e969))
7+
8+
# [1.114.0-alpha.3](https://github.com/Automattic/newspack-plugin/compare/v1.114.0-alpha.2...v1.114.0-alpha.3) (2023-05-03)
9+
10+
11+
### Bug Fixes
12+
13+
* **ras-defaults:** feedback from QA ([#2437](https://github.com/Automattic/newspack-plugin/issues/2437)) ([1dd1f36](https://github.com/Automattic/newspack-plugin/commit/1dd1f369427c137f9c24a72a559370a264b77def))
14+
15+
16+
### Features
17+
18+
* **auth:** support "register modal" hash url ([#2427](https://github.com/Automattic/newspack-plugin/issues/2427)) ([fcb1199](https://github.com/Automattic/newspack-plugin/commit/fcb119964dbe6e977efa0ce5d236b736a6af79b0))
19+
20+
# [1.114.0-alpha.2](https://github.com/Automattic/newspack-plugin/compare/v1.114.0-alpha.1...v1.114.0-alpha.2) (2023-05-03)
21+
22+
23+
### Bug Fixes
24+
25+
* **ras-defaults:** updates for design review feedback ([#2435](https://github.com/Automattic/newspack-plugin/issues/2435)) ([3aa6de7](https://github.com/Automattic/newspack-plugin/commit/3aa6de7e9a77d9640f3b42c2e9bf8182f3dc2d1b))
26+
27+
28+
### Features
29+
30+
* update NRH settings page and redirect behavior ([#2425](https://github.com/Automattic/newspack-plugin/issues/2425)) ([f7a6c6b](https://github.com/Automattic/newspack-plugin/commit/f7a6c6b5d9ef5876c1128407b541a6d8cd986a95))
31+
32+
# [1.114.0-alpha.1](https://github.com/Automattic/newspack-plugin/compare/v1.113.0...v1.114.0-alpha.1) (2023-04-28)
33+
34+
35+
### Bug Fixes
36+
37+
* add filter to prompt conflicts check ([#2421](https://github.com/Automattic/newspack-plugin/issues/2421)) ([8d1c1d3](https://github.com/Automattic/newspack-plugin/commit/8d1c1d3e17ae51f97a7d783b05c4fef4a2b6660e))
38+
* ensure .hooks is excluded from the dist ZIP ([#2420](https://github.com/Automattic/newspack-plugin/issues/2420)) ([75f8f36](https://github.com/Automattic/newspack-plugin/commit/75f8f3665bc19ee65333726906e42a1a8724ef25))
39+
* **newsletters:** only attempt token verification for Constant Contact ([#2407](https://github.com/Automattic/newspack-plugin/issues/2407)) ([c58f9a8](https://github.com/Automattic/newspack-plugin/commit/c58f9a8c8036d5c86987768a20117bf7d3c00d68))
40+
* **perfmatters:** exclude Jetpack and Newsletters css delay ([#2410](https://github.com/Automattic/newspack-plugin/issues/2410)) ([d2b167c](https://github.com/Automattic/newspack-plugin/commit/d2b167c19ecc851ef8a3a3a1d052d28c23a1ac83))
41+
42+
43+
### Features
44+
45+
* memberships block patterns ([#2406](https://github.com/Automattic/newspack-plugin/issues/2406)) ([c96555a](https://github.com/Automattic/newspack-plugin/commit/c96555a7297b82644dfa67fb873692411890debc))
46+
* RAS setup UI and default Campaigns wizard ([#2426](https://github.com/Automattic/newspack-plugin/issues/2426)) ([a1d4eb7](https://github.com/Automattic/newspack-plugin/commit/a1d4eb7aad13449cb1d847fb25ee2414028fdb69)), closes [#2381](https://github.com/Automattic/newspack-plugin/issues/2381) [#2366](https://github.com/Automattic/newspack-plugin/issues/2366) [#2382](https://github.com/Automattic/newspack-plugin/issues/2382)
47+
* **sign-in:** body class when in modal and url hash ([#2414](https://github.com/Automattic/newspack-plugin/issues/2414)) ([aea4dc9](https://github.com/Automattic/newspack-plugin/commit/aea4dc949439f459465fa15c695639a65dcb26f8))
48+
149
# [1.113.0](https://github.com/Automattic/newspack-plugin/compare/v1.112.1...v1.113.0) (2023-04-24)
250

351

assets/blocks/reader-registration/index.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function register_block() {
2828
);
2929

3030
// No need to register block styles if Reader Activation is disabled.
31-
if ( ! Reader_Activation::is_enabled() ) {
31+
if ( ! Reader_Activation::is_enabled( false ) ) {
3232
return;
3333
}
3434

@@ -54,8 +54,8 @@ function register_block() {
5454
* Enqueue front-end scripts.
5555
*/
5656
function enqueue_scripts() {
57-
// No need to enqueue scripts if Reader Activation is disabled.
58-
if ( ! Reader_Activation::is_enabled() ) {
57+
// No need to enqueue scripts if Reader Activation is disabled and not a preview request.
58+
if ( ! Reader_Activation::allow_reg_block_render() ) {
5959
return;
6060
}
6161

@@ -99,8 +99,8 @@ function get_form_id() {
9999
* @param string $content Block content (inner blocks) – success state in this case.
100100
*/
101101
function render_block( $attrs, $content ) {
102-
// Render nothing if Reader Activation is disabled.
103-
if ( ! Reader_Activation::is_enabled() ) {
102+
// Render nothing if Reader Activation is disabled and not a preview request.
103+
if ( ! Reader_Activation::allow_reg_block_render() ) {
104104
return '';
105105
}
106106

@@ -152,7 +152,7 @@ function render_block( $attrs, $content ) {
152152
if (
153153
! \is_preview() &&
154154
! $is_admin_preview &&
155-
( ! method_exists( 'Newspack_Popups', 'is_preview_request' ) || ! \Newspack_Popups::is_preview_request() ) &&
155+
( ! method_exists( '\Newspack_Popups', 'is_preview_request' ) || ! \Newspack_Popups::is_preview_request() ) &&
156156
(
157157
\is_user_logged_in() ||
158158
( isset( $_GET['newspack_reader'] ) && absint( $_GET['newspack_reader'] ) )

assets/components/src/action-card/index.js

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88
import { Component } from '@wordpress/element';
99
import { ExternalLink, ToggleControl } from '@wordpress/components';
10-
import { Icon, check } from '@wordpress/icons';
10+
import { Icon, check, chevronDown, chevronUp } from '@wordpress/icons';
1111

1212
/**
1313
* Internal dependencies
@@ -21,12 +21,21 @@ import './style.scss';
2121
import classnames from 'classnames';
2222

2323
class ActionCard extends Component {
24-
backgroundImageStyles = url => {
25-
return url ? { backgroundImage: `url(${ url })` } : {};
24+
state = {
25+
expanded: false,
2626
};
2727

2828
/**
29-
* Render
29+
* When the collapse prop is updated to true, collapse the card if already expanded.
30+
*/
31+
componentDidUpdate( prevProps ) {
32+
if ( ! prevProps.collapse && this.props.collapse && this.state.expanded ) {
33+
this.setState( { expanded: false } );
34+
}
35+
}
36+
37+
/**
38+
* Render.
3039
*/
3140
render() {
3241
const {
@@ -60,19 +69,31 @@ class ActionCard extends Component {
6069
toggleChecked,
6170
toggleOnChange,
6271
hasGreyHeader,
72+
hasWhiteHeader,
6373
isPending,
74+
expandable = false,
6475
} = this.props;
76+
77+
const { expanded } = this.state;
78+
6579
const hasChildren = notification || children;
6680
const classes = classnames(
6781
'newspack-action-card',
6882
simple && 'newspack-card--is-clickable',
6983
hasGreyHeader && 'newspack-card--has-grey-header',
84+
hasWhiteHeader && 'newspack-card--has-white-header',
7085
hasChildren && 'newspack-card--has-children',
7186
indent && 'newspack-card--indent',
7287
isSmall && 'is-small',
7388
isMedium && 'is-medium',
89+
checkbox && 'has-checkbox',
90+
expandable && 'is-expandable',
91+
actionContent && 'has-action-content',
7492
className
7593
);
94+
const backgroundImageStyles = url => {
95+
return url ? { backgroundImage: `url(${ url })` } : {};
96+
};
7697
const titleProps =
7798
toggleOnChange && ! titleLink && ! disabled
7899
? { onClick: () => toggleOnChange( ! toggleChecked ), tabIndex: '0' }
@@ -95,7 +116,7 @@ class ActionCard extends Component {
95116
<a href={ imageLink }>
96117
<div
97118
className="newspack-action-card__image"
98-
style={ this.backgroundImageStyles( image ) }
119+
style={ backgroundImageStyles( image ) }
99120
/>
100121
</a>
101122
</div>
@@ -118,7 +139,13 @@ class ActionCard extends Component {
118139
<Grid columns={ 1 } gutter={ 8 } noMargin>
119140
<h2>
120141
<span className="newspack-action-card__title" { ...titleProps }>
121-
{ titleLink ? <a href={ titleLink }>{ title }</a> : title }
142+
{ titleLink && <a href={ titleLink }>{ title }</a> }
143+
{ ! titleLink && expandable && (
144+
<Button isLink onClick={ () => this.setState( { expanded: ! expanded } ) }>
145+
{ title }
146+
</Button>
147+
) }
148+
{ ! titleLink && ! expandable && title }
122149
</span>
123150
{ badges?.length &&
124151
badges.map( ( badgeText, i ) => (
@@ -135,7 +162,7 @@ class ActionCard extends Component {
135162
) }
136163
</Grid>
137164
</div>
138-
{ ( actionText || isDisplayingSecondaryAction || actionContent ) && (
165+
{ ! expandable && ( actionText || isDisplayingSecondaryAction || actionContent ) && (
139166
<div className="newspack-action-card__region newspack-action-card__region-right">
140167
{ /* eslint-disable no-nested-ternary */ }
141168
{ actionContent && actionContent }
@@ -176,6 +203,11 @@ class ActionCard extends Component {
176203
) }
177204
</div>
178205
) }
206+
{ expandable && (
207+
<Button onClick={ () => this.setState( { expanded: ! expanded } ) }>
208+
<Icon icon={ expanded ? chevronUp : chevronDown } height={ 24 } width={ 24 } />
209+
</Button>
210+
) }
179211
</div>
180212
{ notification && (
181213
<div className="newspack-action-card__notification newspack-action-card__region-children">
@@ -193,7 +225,9 @@ class ActionCard extends Component {
193225
) }
194226
</div>
195227
) }
196-
{ children && <div className="newspack-action-card__region-children">{ children }</div> }
228+
{ children && ( ( expandable && expanded ) || ! expandable ) && (
229+
<div className="newspack-action-card__region-children">{ children }</div>
230+
) }
197231
</Card>
198232
);
199233
}

assets/components/src/action-card/style.scss

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,24 @@
146146
}
147147
}
148148

149+
// Nested children
150+
151+
&.newspack-card--has-children {
152+
.newspack-action-card {
153+
&:first-child {
154+
margin-top: 32px;
155+
}
156+
157+
+ .newspack-action-card {
158+
margin-top: 16px !important;
159+
}
160+
161+
&:last-child {
162+
margin-bottom: 0;
163+
}
164+
}
165+
}
166+
149167
// Has grey header
150168

151169
&.newspack-card--has-grey-header {
@@ -155,6 +173,11 @@
155173
.newspack-action-card__region-top {
156174
border-bottom: 1px solid wp-colors.$gray-300;
157175
}
176+
177+
.is-small > .newspack-action-card__region-top {
178+
padding-bottom: 8px;
179+
padding-top: 8px;
180+
}
158181
}
159182

160183
.newspack-action-card__region-top {
@@ -168,6 +191,13 @@
168191
}
169192
}
170193

194+
&.newspack-card--has-white-header {
195+
.newspack-action-card__region-top {
196+
background-color: transparent;
197+
border: none !important;
198+
}
199+
}
200+
171201
// Indent
172202

173203
&.newspack-card--indent {
@@ -348,6 +378,12 @@
348378
margin-top: 0;
349379
}
350380
}
381+
382+
&.newspack-action-card__region-children {
383+
.newspack-notice {
384+
margin-top: 32px;
385+
}
386+
}
351387
}
352388

353389
// Image
@@ -393,6 +429,49 @@
393429
font-style: italic;
394430
}
395431

432+
// Expandable card children
433+
434+
&.is-expandable {
435+
.newspack-action-card__title .components-button.is-link {
436+
color: inherit;
437+
font-size: inherit;
438+
font-weight: inherit;
439+
text-decoration: inherit;
440+
}
441+
442+
.newspack-action-card__region-children {
443+
border-top: 1px solid wp-colors.$gray-100;
444+
padding-top: 24px;
445+
}
446+
447+
&.is-medium .newspack-action-card__region-children {
448+
padding-top: 32px;
449+
}
450+
451+
&.has-checkbox {
452+
.newspack-action-card__region-children {
453+
padding-left: 72px;
454+
}
455+
456+
&.is-small .newspack-action-card__region-children {
457+
padding-left: 64px;
458+
}
459+
460+
&.is-medium .newspack-action-card__region-children {
461+
padding-left: 56px;
462+
}
463+
}
464+
}
465+
466+
// Action content with multiple buttons
467+
&.has-action-content .newspack-action-card__region-right {
468+
flex-direction: row;
469+
470+
.components-button + .components-button {
471+
margin-left: 8px;
472+
}
473+
}
474+
396475
// Multiple Cards
397476

398477
& + & {

assets/components/src/consts.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export const NEWSPACK_SITE_URL = 'https://newspack.com';
22
export const NEWSPACK_SUPPORT_URL = `${ NEWSPACK_SITE_URL }/support`;
3+
export const HANDOFF_KEY = 'newspack_wizard_handoff_message';

assets/components/src/image-upload/index.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class ImageUpload extends Component {
7575
const {
7676
buttonLabel,
7777
className,
78+
disabled,
7879
help,
7980
image,
8081
info,
@@ -104,17 +105,22 @@ class ImageUpload extends Component {
104105
alt={ __( 'Image preview', 'newspack' ) }
105106
/>
106107
<div className="newspack-image-upload__controls">
107-
<Button onClick={ this.openModal } isLink>
108+
<Button disabled={ disabled } onClick={ this.openModal } isLink>
108109
{ __( 'Replace', 'newspack' ) }
109110
</Button>
110111
<span className="sep" />
111-
<Button onClick={ () => onChange( null ) } isLink isDestructive>
112+
<Button
113+
disabled={ disabled }
114+
onClick={ () => onChange( null ) }
115+
isLink
116+
isDestructive
117+
>
112118
{ __( 'Remove', 'newspack' ) }
113119
</Button>
114120
</div>
115121
</>
116122
) : (
117-
<Button onClick={ this.openModal } isLink>
123+
<Button disabled={ disabled } onClick={ this.openModal } isLink>
118124
{ buttonLabel ? buttonLabel : __( 'Upload', 'newspack' ) }
119125
</Button>
120126
) }

assets/components/src/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ export { default as SectionHeader } from './section-header';
3030
export { default as SelectControl } from './select-control';
3131
export { default as DateRangePicker } from './date-range-picker';
3232
export { default as Settings } from './settings';
33+
export { default as StepsList } from './steps-list';
34+
export { default as StepsListItem } from './steps-list-item';
3335
export { default as StyleCard } from './style-card';
3436
export { default as TabbedNavigation } from './tabbed-navigation';
3537
export { default as TextControl } from './text-control';

assets/components/src/notice/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class Notice extends Component {
2828
className,
2929
debugMode,
3030
isError,
31+
isHandoff,
3132
isHelp,
3233
isSuccess,
3334
isWarning,
@@ -41,6 +42,7 @@ class Notice extends Component {
4142
className,
4243
debugMode && 'newspack-notice__is-debug',
4344
isError && 'newspack-notice__is-error',
45+
isHandoff && 'newspack-notice__is-handoff',
4446
isHelp && 'newspack-notice__is-help',
4547
isSuccess && 'newspack-notice__is-success',
4648
isWarning && 'newspack-notice__is-warning'

0 commit comments

Comments
 (0)