Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PaidBlocks: Add Paid Icon Indicator #16556

Conversation

jeryj
Copy link
Contributor

@jeryj jeryj commented Jul 22, 2020

Adds paid block indicator to blocks that Jetpack has control over.

Changes proposed in this Pull Request:

  • Adds a <PaidSymbol />
  • Adds the <PaidSymbol /> to paid blocks
  • Adds isUpgradeNudgeEnabled() to extensions/shared
  • Adds 'enable_upgrade_nudge' => apply_filters( 'jetpack_block_editor_enable_upgrade_nudge', false ), to the Jetpack_Editor_Initial_State window object
  • Defaults to hiding the premium icon, and, if isUpgradeNudgeEnabled() is true, will add a body class 'jetpack-enable-upgrade-nudge' to display the <PaidSymbol />

Note: This PR does not address FSE's Premium Content block and WPcom will be handled separately.

Testing instructions:

  • Apply patch D46777 to your sandbox
  • If testing with build-extensions --watch to your sandbox, you'll need to add the changes from class.jetpack-gutenberg.php: Adding 'enable_upgrade_nudge' => apply_filters( 'jetpack_block_editor_enable_upgrade_nudge', false ), to the jetpack array.

Proposed changelog entry for your changes:

  • Merging into a base branch that will include the changelog. If one is needed for this, then "Adds a premium icon indicator to block icons that require a paid plan to use."

Copy link

@test-case-reminder test-case-reminder bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are some suggested test cases for this PR.

Gutenberg extensions

  • Use Core's block editor
  • Use latest stable Gutenberg plugin

Blocks

  • Tiled Gallery
  • Business Hours
  • Calendly
  • Form
  • Contact Info
  • Eventbrite
  • Google calendar
  • Mailchimp
  • Map
  • OpenTable
  • Pinterest
  • Podcast player
  • Star rating
  • Recurring Payments
  • Repeat Visitor
  • Revue
  • Simple Payments
  • Slideshow

Extensions

  • Publicize
  • Likes

If you think that suggestions should be improved please edit the configuration file here. You can also modify/add test-suites to be used in the configuration file.

@matticbot
Copy link
Contributor

Caution: This PR has changes that must be merged to WordPress.com
Hello jeryj! These changes need to be synced to WordPress.com - If you 're an a11n, please commandeer and confirm D46777-code works as expected before merging this PR. Once this PR is merged, please commit the changes to WP.com. Thank you!
This revision will be updated with each commit to this PR

@jeryj jeryj self-assigned this Jul 22, 2020
@jeryj jeryj added [Status] Needs Team Review [Focus] Blocks Issues related to the block editor, aka Gutenberg, and its extensions developed in Jetpack labels Jul 22, 2020
@jeryj jeryj changed the title Update/add paid blocks symbol PaidBlocks: Add Paid Icon Indicator Jul 22, 2020
@jeryj jeryj marked this pull request as ready for review July 22, 2020 20:28
cpap and others added 2 commits July 23, 2020 01:10
- remove dot indicator from placeholder icon
- delete not used file
- move isUpgradeNudgeEnabled function to  plan-utils
@cpapazoglou
Copy link
Contributor

cpapazoglou commented Jul 22, 2020

Tested following the instructions and works / feels as expected.
I just added a CSS to hide the dot in the block placeholder as discussed and moved isUpgradeNudgeEnabled function to plan-utils

LGTM!

@cpapazoglou cpapazoglou merged this pull request into update/paid-blocks-add-upgrade-banner Jul 22, 2020
@cpapazoglou cpapazoglou deleted the update/add-paid-blocks-symbol branch July 22, 2020 22:28
retrofox pushed a commit that referenced this pull request Jul 23, 2020
* Add paid block symbol

* Add paid symbol to paid block icons

* Add enable_upgrade_nudge to the Jetpack_Editor_Initial_State

* Added upgrade nudge body class

* Paid Blocks: dot indicator:
- remove dot indicator from placeholder icon
- delete not used file
- move isUpgradeNudgeEnabled function to  plan-utils

Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>
retrofox pushed a commit that referenced this pull request Jul 28, 2020
* Add paid block symbol

* Add paid symbol to paid block icons

* Add enable_upgrade_nudge to the Jetpack_Editor_Initial_State

* Added upgrade nudge body class

* Paid Blocks: dot indicator:
- remove dot indicator from placeholder icon
- delete not used file
- move isUpgradeNudgeEnabled function to  plan-utils

Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>
retrofox added a commit that referenced this pull request Jul 28, 2020
* Add paid block symbol

* Add paid symbol to paid block icons

* Add enable_upgrade_nudge to the Jetpack_Editor_Initial_State

* Added upgrade nudge body class

* Paid Blocks: dot indicator:
- remove dot indicator from placeholder icon
- delete not used file
- move isUpgradeNudgeEnabled function to  plan-utils

Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>

Co-authored-by: Jerry Jones <jones.jeremydavid@gmail.com>
Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>
retrofox added a commit that referenced this pull request Jul 29, 2020
* Add paid block symbol

* Add paid symbol to paid block icons

* Add enable_upgrade_nudge to the Jetpack_Editor_Initial_State

* Added upgrade nudge body class

* Paid Blocks: dot indicator:
- remove dot indicator from placeholder icon
- delete not used file
- move isUpgradeNudgeEnabled function to  plan-utils

Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>

Co-authored-by: Jerry Jones <jones.jeremydavid@gmail.com>
Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>
retrofox added a commit that referenced this pull request Aug 4, 2020
* Add paid block symbol

* Add paid symbol to paid block icons

* Add enable_upgrade_nudge to the Jetpack_Editor_Initial_State

* Added upgrade nudge body class

* Paid Blocks: dot indicator:
- remove dot indicator from placeholder icon
- delete not used file
- move isUpgradeNudgeEnabled function to  plan-utils

Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>

Co-authored-by: Jerry Jones <jones.jeremydavid@gmail.com>
Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>
retrofox added a commit that referenced this pull request Aug 11, 2020
* Add paid block symbol

* Add paid symbol to paid block icons

* Add enable_upgrade_nudge to the Jetpack_Editor_Initial_State

* Added upgrade nudge body class

* Paid Blocks: dot indicator:
- remove dot indicator from placeholder icon
- delete not used file
- move isUpgradeNudgeEnabled function to  plan-utils

Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>

Co-authored-by: Jerry Jones <jones.jeremydavid@gmail.com>
Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>
retrofox added a commit that referenced this pull request Aug 13, 2020
* Add paid block symbol

* Add paid symbol to paid block icons

* Add enable_upgrade_nudge to the Jetpack_Editor_Initial_State

* Added upgrade nudge body class

* Paid Blocks: dot indicator:
- remove dot indicator from placeholder icon
- delete not used file
- move isUpgradeNudgeEnabled function to  plan-utils

Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>

Co-authored-by: Jerry Jones <jones.jeremydavid@gmail.com>
Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>
retrofox added a commit that referenced this pull request Aug 17, 2020
* Add paid block symbol

* Add paid symbol to paid block icons

* Add enable_upgrade_nudge to the Jetpack_Editor_Initial_State

* Added upgrade nudge body class

* Paid Blocks: dot indicator:
- remove dot indicator from placeholder icon
- delete not used file
- move isUpgradeNudgeEnabled function to  plan-utils

Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>

Co-authored-by: Jerry Jones <jones.jeremydavid@gmail.com>
Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>
retrofox added a commit that referenced this pull request Aug 17, 2020
* Add paid block symbol

* Add paid symbol to paid block icons

* Add enable_upgrade_nudge to the Jetpack_Editor_Initial_State

* Added upgrade nudge body class

* Paid Blocks: dot indicator:
- remove dot indicator from placeholder icon
- delete not used file
- move isUpgradeNudgeEnabled function to  plan-utils

Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>

Co-authored-by: Jerry Jones <jones.jeremydavid@gmail.com>
Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>
retrofox added a commit that referenced this pull request Aug 18, 2020
* Add paid block symbol

* Add paid symbol to paid block icons

* Add enable_upgrade_nudge to the Jetpack_Editor_Initial_State

* Added upgrade nudge body class

* Paid Blocks: dot indicator:
- remove dot indicator from placeholder icon
- delete not used file
- move isUpgradeNudgeEnabled function to  plan-utils

Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>

Co-authored-by: Jerry Jones <jones.jeremydavid@gmail.com>
Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>
retrofox added a commit that referenced this pull request Aug 18, 2020
* Add paid block symbol

* Add paid symbol to paid block icons

* Add enable_upgrade_nudge to the Jetpack_Editor_Initial_State

* Added upgrade nudge body class

* Paid Blocks: dot indicator:
- remove dot indicator from placeholder icon
- delete not used file
- move isUpgradeNudgeEnabled function to  plan-utils

Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>

Co-authored-by: Jerry Jones <jones.jeremydavid@gmail.com>
Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>
retrofox added a commit that referenced this pull request Aug 18, 2020
* Premium Blocks: Remove Upgrade Nudges (#16598)

* register-jetpack-block: do not wrap premium blocks

* videopress: do not wrap with paid core/video block

* Premium Blocks: add CSS class to body when Upgrade Nudge is enabled (#16601)

* expose enable_upgrade_nudge property to the client

* plan-utils: add isUpgradeNudgeEnabled() helper fn

* paid-blocks: add custom class to doc body

* extensions: add premium-blocks lib

* PaidBlocks: Add Paid Icon Indicator (#16556) (#16602)

* Add paid block symbol

* Add paid symbol to paid block icons

* Add enable_upgrade_nudge to the Jetpack_Editor_Initial_State

* Added upgrade nudge body class

* Paid Blocks: dot indicator:
- remove dot indicator from placeholder icon
- delete not used file
- move isUpgradeNudgeEnabled function to  plan-utils

Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>

Co-authored-by: Jerry Jones <jones.jeremydavid@gmail.com>
Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>

* Paid Blocks: remove the upgrade nudge banner from frontend (#16614)

Co-authored-by: cpap <papazoglou.charalampos@gmail.com>

* Premium Blocks: Add upgrade banner to block inspector (#16603)

* refact -> create getUpgradeUrl() util helper

* premium-block: add upgrade banner component

* regiter-jetpack-blocks: export requiresPaidPlan fn

* plan-utils: add isUpgradable() helper fn

* premium-blocks: add block edit component

* premium-block: extend block edit for premium

* premium-blocks: fix rebasing issues

* upgrade-banner: replace HOC by hooks

* plan-utils: minor jsdoc improvements

* upgrade-banner: render button with a valid URL

* Premium Blocks: Add Upgrade banner to premium block in the editor canvas (#16618)

* premium-blocks: add HOC to add banner in editor

* premium-blocks: adjust styles for banner in editor

* premium-blocks: extend BlockList for Premium

* premium-blocks: minor improvements

* upgrade-banner: set margin rule stronger

* premium-blocks: do not hardcode core/video block

* Paid Blocks: add dot indicator to donations block (#16629)

Co-authored-by: cpap <papazoglou.charalampos@gmail.com>

* Paid Blocks: remove paid wording (#16632)

Co-authored-by: cpap <papazoglou.charalampos@gmail.com>

* premium-blocks: populate keywords with premium key (#16649)

* Override premium block icons (#16696)

* Paid Blocks: override icons

* Paid Blocks: icon indicator:
- remove paid icons from hardcoded premium blocks
- fix the the helper function

* Paid Blocks: fixes typo

* Update extensions/shared/premium-blocks/render-premium-icon.js

Co-authored-by: Damián Suárez <rdsuarez@gmail.com>

Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Damián Suárez <rdsuarez@gmail.com>

* Premium Blocks: Handle core/cover block (#16688)

* premium-blocks: add/export context and provider

* upgrade-banner: allow set visibility via context

* plan-utils: remove core/cover exception

* cover: hide upgrade banner by default

* cover: handle banner with media placeholder

* plan-utils: add isStillUsableWithFreePlan helper

* upgrade-banner: handle dual mode

* cover: remove BlockEdit filter/hook

* upgrade-banner: check plan selector before select

* cover: use premium instead cover context

* cover: simplify hooking filters

* plan-utils: jsdoc

* upgrade-banner: set CSS class dinamycally

* cover: fix placeholder styles

* cover: check if cover is upgradable. Clean.

* upgrade-banner: do bot forget to add the plan store

* upgrade-banner: tidy code

* simple-payments: remove paid symbol from icon

* premium-blocks: use @automattic/color-studio

* Clone icon element to prperly set children prop.

Avoids a type error caused by trying to overwrite a read-only property.

* Tighten up banner styles.

* premium-blocks: use select const

* Premium Icon: remove unused arguement, added docblock

* Premium Icon: adds basic tests

* Premium Blocks: Handle core/audio block (#16717)

* cover: refact -> move helper function to shared

* cover: move media placeholder out of cover

* premium-blocks: handle media placeholder component

* plan-utils: set audio as dual behavior

* premium-block: move media placeholder styles

* premium-blocks: move helper to utils

* premium-blocks: refact plan utils helpers

* premium-blocks: remove blocks/cover folder. Handle audio

* format code

* premum-block: rename replace flow HOC

* premium-blocks: rename hekper fn to isFileOfType

* premium-block: control replace flow in core/audio

* premium-blocks: tweak some styles

* plan-utils: donot check site type when upgradable

* premium-blocks: add README file

* upgrade-banner: fix overlaping

* Update class.jetpack-gutenberg.php

Co-authored-by: Jeremy Herve <jeremy@jeremy.hu>

* Update extensions/shared/premium-blocks/upgrade-plan-banner.jsx

Co-authored-by: Jeremy Herve <jeremy@jeremy.hu>

* paid-blocks: is the new premium-blocks

* upgrade-banner: remove unneeded title attr

* upgrade-banner: improve dark styles

* paid-blocks: unregister styles for paid blocks

* paid-blocks: remove console.log

* upgrade-banner: remove label prop

* upgrade-banner: add target to upgrade link

* paid-icon: add extend helper function

* send-a-message: extend default-variation icon

* PaidBlocks: Add Paid Icon Indicator (#16556) (#16602)

* Add paid block symbol

* Add paid symbol to paid block icons

* Add enable_upgrade_nudge to the Jetpack_Editor_Initial_State

* Added upgrade nudge body class

* Paid Blocks: dot indicator:
- remove dot indicator from placeholder icon
- delete not used file
- move isUpgradeNudgeEnabled function to  plan-utils

Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>

Co-authored-by: Jerry Jones <jones.jeremydavid@gmail.com>
Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>

* Premium Blocks: Add upgrade banner to block inspector (#16603)

* refact -> create getUpgradeUrl() util helper

* premium-block: add upgrade banner component

* regiter-jetpack-blocks: export requiresPaidPlan fn

* plan-utils: add isUpgradable() helper fn

* premium-blocks: add block edit component

* premium-block: extend block edit for premium

* premium-blocks: fix rebasing issues

* upgrade-banner: replace HOC by hooks

* plan-utils: minor jsdoc improvements

* upgrade-banner: render button with a valid URL

* Paid Blocks: add dot indicator to donations block (#16629)

Co-authored-by: cpap <papazoglou.charalampos@gmail.com>

* Override premium block icons (#16696)

* Paid Blocks: override icons

* Paid Blocks: icon indicator:
- remove paid icons from hardcoded premium blocks
- fix the the helper function

* Paid Blocks: fixes typo

* Update extensions/shared/premium-blocks/render-premium-icon.js

Co-authored-by: Damián Suárez <rdsuarez@gmail.com>

Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Damián Suárez <rdsuarez@gmail.com>

* simple-payments: remove paid symbol from icon

* premium-blocks: use @automattic/color-studio

* Tighten up banner styles.

* Premium Icon: adds basic tests

* Premium Blocks: Handle core/audio block (#16717)

* cover: refact -> move helper function to shared

* cover: move media placeholder out of cover

* premium-blocks: handle media placeholder component

* plan-utils: set audio as dual behavior

* premium-block: move media placeholder styles

* premium-blocks: move helper to utils

* premium-blocks: refact plan utils helpers

* premium-blocks: remove blocks/cover folder. Handle audio

* format code

* premum-block: rename replace flow HOC

* premium-blocks: rename hekper fn to isFileOfType

* premium-block: control replace flow in core/audio

* premium-blocks: add README file

* paid-blocks: is the new premium-blocks

* upgrade-banner: remove unneeded title attr

* upgrade-banner: remove label prop

* Update extensions/extended-blocks/paid-blocks/README.md

Co-authored-by: Dave Smith <getdavemail@gmail.com>

* Update extensions/extended-blocks/paid-blocks/README.md

Co-authored-by: Dave Smith <getdavemail@gmail.com>

* Update extensions/extended-blocks/paid-blocks/README.md

Co-authored-by: Dave Smith <getdavemail@gmail.com>

* Update extensions/extended-blocks/paid-blocks/index.js

Co-authored-by: Dave Smith <getdavemail@gmail.com>

* Update extensions/extended-blocks/paid-blocks/README.md

Co-authored-by: Dave Smith <getdavemail@gmail.com>

* Update extensions/extended-blocks/paid-blocks/README.md

Co-authored-by: Dave Smith <getdavemail@gmail.com>

* paid-blocks: format code

* paid-blocks: do not extend icon free-usable blocks

* Allow "dual mode" (partially free) blocks to have customized banners

Current "Dual Mode" blocks:
- core/video: Allows users to upload images for free, but videos are premium.
- core/audio: Allows users to link to mp3s for free, but uploading one is premium.

The default message, "Upgrade your plan to use this premium block,"
doesn't let the user know that they can still use parts of the block for
free.

Here we have two customized messages:
core/video: 'Upgrade your plan to use video covers'
core/audio: 'Upgrade your plan to upload audio'

* use-upgrade-flow: first approach

* upgrade-banner: use useUpgradeFlow() hook

* Small cleanup

* Update extensions/extended-blocks/paid-blocks/README.md

Co-authored-by: Dave Smith <getdavemail@gmail.com>

* Update extensions/extended-blocks/paid-blocks/README.md

Co-authored-by: Dave Smith <getdavemail@gmail.com>

* Update extensions/extended-blocks/paid-blocks/README.md

Co-authored-by: Dave Smith <getdavemail@gmail.com>

* Run prettier on files

* upgrade-banner: fix getting upgrade data bug

* paid-blocks: set required plan properly

* use-upgrade-flow: Visual feedback to user that something is happening

* use-upgrade-flow: Tweak visual feedback to user that something is happening

- Disabled -> .is-busy class for accessibility (Doesn't drop focus)
- Change button text
- Bring visual styles in line with autosave button in WordPress.org

* Avoid "Invalid DOM property `stroke-width`" warning

* Avoid unique key warning

* Add dedicated function for plan retrieval

Separates update and plan checks for a clearer API.

* Paid Blocks:
- adds key to PaidSymbol so tests pass
- renames file to render-paid-icon

* upgrade-banner: add context property
Use this property to define the context where the banner is mounted. It could be used to add recording event properties, etc

* upgrade-banner: tweak styles in editor canvas

* paid-blocks: set banner context

Co-authored-by: Jerry Jones <jones.jeremydavid@gmail.com>
Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>
Co-authored-by: Konstantin Obenland <obenland@gmx.de>
Co-authored-by: Jeremy Herve <jeremy@jeremy.hu>
Co-authored-by: Dave Smith <getdavemail@gmail.com>
Co-authored-by: Matthew Reishus <mreishus@users.noreply.github.com>
pereirinha pushed a commit that referenced this pull request Sep 10, 2020
* Premium Blocks: Remove Upgrade Nudges (#16598)

* register-jetpack-block: do not wrap premium blocks

* videopress: do not wrap with paid core/video block

* Premium Blocks: add CSS class to body when Upgrade Nudge is enabled (#16601)

* expose enable_upgrade_nudge property to the client

* plan-utils: add isUpgradeNudgeEnabled() helper fn

* paid-blocks: add custom class to doc body

* extensions: add premium-blocks lib

* PaidBlocks: Add Paid Icon Indicator (#16556) (#16602)

* Add paid block symbol

* Add paid symbol to paid block icons

* Add enable_upgrade_nudge to the Jetpack_Editor_Initial_State

* Added upgrade nudge body class

* Paid Blocks: dot indicator:
- remove dot indicator from placeholder icon
- delete not used file
- move isUpgradeNudgeEnabled function to  plan-utils

Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>

Co-authored-by: Jerry Jones <jones.jeremydavid@gmail.com>
Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>

* Paid Blocks: remove the upgrade nudge banner from frontend (#16614)

Co-authored-by: cpap <papazoglou.charalampos@gmail.com>

* Premium Blocks: Add upgrade banner to block inspector (#16603)

* refact -> create getUpgradeUrl() util helper

* premium-block: add upgrade banner component

* regiter-jetpack-blocks: export requiresPaidPlan fn

* plan-utils: add isUpgradable() helper fn

* premium-blocks: add block edit component

* premium-block: extend block edit for premium

* premium-blocks: fix rebasing issues

* upgrade-banner: replace HOC by hooks

* plan-utils: minor jsdoc improvements

* upgrade-banner: render button with a valid URL

* Premium Blocks: Add Upgrade banner to premium block in the editor canvas (#16618)

* premium-blocks: add HOC to add banner in editor

* premium-blocks: adjust styles for banner in editor

* premium-blocks: extend BlockList for Premium

* premium-blocks: minor improvements

* upgrade-banner: set margin rule stronger

* premium-blocks: do not hardcode core/video block

* Paid Blocks: add dot indicator to donations block (#16629)

Co-authored-by: cpap <papazoglou.charalampos@gmail.com>

* Paid Blocks: remove paid wording (#16632)

Co-authored-by: cpap <papazoglou.charalampos@gmail.com>

* premium-blocks: populate keywords with premium key (#16649)

* Override premium block icons (#16696)

* Paid Blocks: override icons

* Paid Blocks: icon indicator:
- remove paid icons from hardcoded premium blocks
- fix the the helper function

* Paid Blocks: fixes typo

* Update extensions/shared/premium-blocks/render-premium-icon.js

Co-authored-by: Damián Suárez <rdsuarez@gmail.com>

Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Damián Suárez <rdsuarez@gmail.com>

* Premium Blocks: Handle core/cover block (#16688)

* premium-blocks: add/export context and provider

* upgrade-banner: allow set visibility via context

* plan-utils: remove core/cover exception

* cover: hide upgrade banner by default

* cover: handle banner with media placeholder

* plan-utils: add isStillUsableWithFreePlan helper

* upgrade-banner: handle dual mode

* cover: remove BlockEdit filter/hook

* upgrade-banner: check plan selector before select

* cover: use premium instead cover context

* cover: simplify hooking filters

* plan-utils: jsdoc

* upgrade-banner: set CSS class dinamycally

* cover: fix placeholder styles

* cover: check if cover is upgradable. Clean.

* upgrade-banner: do bot forget to add the plan store

* upgrade-banner: tidy code

* simple-payments: remove paid symbol from icon

* premium-blocks: use @automattic/color-studio

* Clone icon element to prperly set children prop.

Avoids a type error caused by trying to overwrite a read-only property.

* Tighten up banner styles.

* premium-blocks: use select const

* Premium Icon: remove unused arguement, added docblock

* Premium Icon: adds basic tests

* Premium Blocks: Handle core/audio block (#16717)

* cover: refact -> move helper function to shared

* cover: move media placeholder out of cover

* premium-blocks: handle media placeholder component

* plan-utils: set audio as dual behavior

* premium-block: move media placeholder styles

* premium-blocks: move helper to utils

* premium-blocks: refact plan utils helpers

* premium-blocks: remove blocks/cover folder. Handle audio

* format code

* premum-block: rename replace flow HOC

* premium-blocks: rename hekper fn to isFileOfType

* premium-block: control replace flow in core/audio

* premium-blocks: tweak some styles

* plan-utils: donot check site type when upgradable

* premium-blocks: add README file

* upgrade-banner: fix overlaping

* Update class.jetpack-gutenberg.php

Co-authored-by: Jeremy Herve <jeremy@jeremy.hu>

* Update extensions/shared/premium-blocks/upgrade-plan-banner.jsx

Co-authored-by: Jeremy Herve <jeremy@jeremy.hu>

* paid-blocks: is the new premium-blocks

* upgrade-banner: remove unneeded title attr

* upgrade-banner: improve dark styles

* paid-blocks: unregister styles for paid blocks

* paid-blocks: remove console.log

* upgrade-banner: remove label prop

* upgrade-banner: add target to upgrade link

* paid-icon: add extend helper function

* send-a-message: extend default-variation icon

* PaidBlocks: Add Paid Icon Indicator (#16556) (#16602)

* Add paid block symbol

* Add paid symbol to paid block icons

* Add enable_upgrade_nudge to the Jetpack_Editor_Initial_State

* Added upgrade nudge body class

* Paid Blocks: dot indicator:
- remove dot indicator from placeholder icon
- delete not used file
- move isUpgradeNudgeEnabled function to  plan-utils

Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>

Co-authored-by: Jerry Jones <jones.jeremydavid@gmail.com>
Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>

* Premium Blocks: Add upgrade banner to block inspector (#16603)

* refact -> create getUpgradeUrl() util helper

* premium-block: add upgrade banner component

* regiter-jetpack-blocks: export requiresPaidPlan fn

* plan-utils: add isUpgradable() helper fn

* premium-blocks: add block edit component

* premium-block: extend block edit for premium

* premium-blocks: fix rebasing issues

* upgrade-banner: replace HOC by hooks

* plan-utils: minor jsdoc improvements

* upgrade-banner: render button with a valid URL

* Paid Blocks: add dot indicator to donations block (#16629)

Co-authored-by: cpap <papazoglou.charalampos@gmail.com>

* Override premium block icons (#16696)

* Paid Blocks: override icons

* Paid Blocks: icon indicator:
- remove paid icons from hardcoded premium blocks
- fix the the helper function

* Paid Blocks: fixes typo

* Update extensions/shared/premium-blocks/render-premium-icon.js

Co-authored-by: Damián Suárez <rdsuarez@gmail.com>

Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Damián Suárez <rdsuarez@gmail.com>

* simple-payments: remove paid symbol from icon

* premium-blocks: use @automattic/color-studio

* Tighten up banner styles.

* Premium Icon: adds basic tests

* Premium Blocks: Handle core/audio block (#16717)

* cover: refact -> move helper function to shared

* cover: move media placeholder out of cover

* premium-blocks: handle media placeholder component

* plan-utils: set audio as dual behavior

* premium-block: move media placeholder styles

* premium-blocks: move helper to utils

* premium-blocks: refact plan utils helpers

* premium-blocks: remove blocks/cover folder. Handle audio

* format code

* premum-block: rename replace flow HOC

* premium-blocks: rename hekper fn to isFileOfType

* premium-block: control replace flow in core/audio

* premium-blocks: add README file

* paid-blocks: is the new premium-blocks

* upgrade-banner: remove unneeded title attr

* upgrade-banner: remove label prop

* Update extensions/extended-blocks/paid-blocks/README.md

Co-authored-by: Dave Smith <getdavemail@gmail.com>

* Update extensions/extended-blocks/paid-blocks/README.md

Co-authored-by: Dave Smith <getdavemail@gmail.com>

* Update extensions/extended-blocks/paid-blocks/README.md

Co-authored-by: Dave Smith <getdavemail@gmail.com>

* Update extensions/extended-blocks/paid-blocks/index.js

Co-authored-by: Dave Smith <getdavemail@gmail.com>

* Update extensions/extended-blocks/paid-blocks/README.md

Co-authored-by: Dave Smith <getdavemail@gmail.com>

* Update extensions/extended-blocks/paid-blocks/README.md

Co-authored-by: Dave Smith <getdavemail@gmail.com>

* paid-blocks: format code

* paid-blocks: do not extend icon free-usable blocks

* Allow "dual mode" (partially free) blocks to have customized banners

Current "Dual Mode" blocks:
- core/video: Allows users to upload images for free, but videos are premium.
- core/audio: Allows users to link to mp3s for free, but uploading one is premium.

The default message, "Upgrade your plan to use this premium block,"
doesn't let the user know that they can still use parts of the block for
free.

Here we have two customized messages:
core/video: 'Upgrade your plan to use video covers'
core/audio: 'Upgrade your plan to upload audio'

* use-upgrade-flow: first approach

* upgrade-banner: use useUpgradeFlow() hook

* Small cleanup

* Update extensions/extended-blocks/paid-blocks/README.md

Co-authored-by: Dave Smith <getdavemail@gmail.com>

* Update extensions/extended-blocks/paid-blocks/README.md

Co-authored-by: Dave Smith <getdavemail@gmail.com>

* Update extensions/extended-blocks/paid-blocks/README.md

Co-authored-by: Dave Smith <getdavemail@gmail.com>

* Run prettier on files

* upgrade-banner: fix getting upgrade data bug

* paid-blocks: set required plan properly

* use-upgrade-flow: Visual feedback to user that something is happening

* use-upgrade-flow: Tweak visual feedback to user that something is happening

- Disabled -> .is-busy class for accessibility (Doesn't drop focus)
- Change button text
- Bring visual styles in line with autosave button in WordPress.org

* Avoid "Invalid DOM property `stroke-width`" warning

* Avoid unique key warning

* Add dedicated function for plan retrieval

Separates update and plan checks for a clearer API.

* Paid Blocks:
- adds key to PaidSymbol so tests pass
- renames file to render-paid-icon

* upgrade-banner: add context property
Use this property to define the context where the banner is mounted. It could be used to add recording event properties, etc

* upgrade-banner: tweak styles in editor canvas

* paid-blocks: set banner context

Co-authored-by: Jerry Jones <jones.jeremydavid@gmail.com>
Co-authored-by: cpap <papazoglou.charalampos@gmail.com>
Co-authored-by: Harris Papazolgou <hrrsppzgl@gmail.com>
Co-authored-by: Konstantin Obenland <obenland@gmx.de>
Co-authored-by: Jeremy Herve <jeremy@jeremy.hu>
Co-authored-by: Dave Smith <getdavemail@gmail.com>
Co-authored-by: Matthew Reishus <mreishus@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Blocks Issues related to the block editor, aka Gutenberg, and its extensions developed in Jetpack Touches WP.com Files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants