-
Notifications
You must be signed in to change notification settings - Fork 794
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
PaidBlocks: Add Paid Icon Indicator #16556
Conversation
There was a problem hiding this 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
- 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.
Caution: This PR has changes that must be merged to WordPress.com |
- remove dot indicator from placeholder icon - delete not used file - move isUpgradeNudgeEnabled function to plan-utils
…paid-blocks-symbol
Tested following the instructions and works / feels as expected. LGTM! |
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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: 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>
* 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>
Adds paid block indicator to blocks that Jetpack has control over.
Changes proposed in this Pull Request:
<PaidSymbol />
<PaidSymbol />
to paid blocksisUpgradeNudgeEnabled()
toextensions/shared
'enable_upgrade_nudge' => apply_filters( 'jetpack_block_editor_enable_upgrade_nudge', false ),
to theJetpack_Editor_Initial_State
window objectisUpgradeNudgeEnabled()
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:
D46777
to your sandboxbuild-extensions --watch
to your sandbox, you'll need to add the changes fromclass.jetpack-gutenberg.php
: Adding'enable_upgrade_nudge' => apply_filters( 'jetpack_block_editor_enable_upgrade_nudge', false ),
to thejetpack
array.Proposed changelog entry for your changes: