add: Tips variation of the Donations block#48584
add: Tips variation of the Donations block#48584angelablake wants to merge 4 commits intoadd/donations-modal-displayfrom
Conversation
Registers a 'jetpack/donations' block variation called Tips, pre-configured for creatives: sticky pop-up modal, coffee icon, "Buy me a coffee" trigger, centered content, full-width button, one-time + monthly only at $3/$5/$8. - block.json: add `variationName` attribute for reliable isActive detection - tips-variation.js: defines and exports the variation + its attributes - editor.js: registers the Tips variation after the block - icons.js: exports the coffee icon for reuse - payments-intro/variations.js: adds Tips as the last picker option - payments-intro/block-picker.js: supports `displayTitle` override so Tips shows its own name instead of the parent block's "Donations Form" title - payments-intro/edit.js: passes variation.attributes to createBlock so clicking Tips inserts a pre-configured block, not a vanilla Donations block Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Proposed changes
Registers a block variation called Tips on top of
jetpack/donations. It appears in the block inserter as its own entry and at the end of the Payments block picker. Selecting it inserts a Donations block pre-configured with defaults suited for creators who collect tips:How it works
donations/block.jsonvariationNameattribute — written to block content soisActivecan identify the variation unambiguouslydonations/tips-variation.jsdonations/editor.jsregisterBlockVariationafter the block registersdonations/icons.jscoffeeso the variation can use it as its iconpayments-intro/variations.jspayments-intro/block-picker.jsdisplayTitleprecedence so Tips shows "Tips" not "Donations Form"payments-intro/edit.jsvariation.attributestocreateBlockso the picker inserts a pre-configured blockRelated product discussion
Part of RSM project: "Little things matter: Improving the Donation block"
Linear: https://linear.app/a8c/project/rsm-donation-form-improvements-wip-061cec72952c/overview
Stacked on #48539 (pop-up display mode).
Does this PR change what data or activity we track or use?
No.
Testing instructions
Block inserter:
Payments block picker:
Existing Donations Form blocks:
5. Open an existing Donations Form block. Confirm it still works normally and does not show "Tips" in the toolbar.
6. Confirm the block inspector controls all still work.