Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
9deaaf1
add multistep forms!
lezama Jun 12, 2025
29401ba
rebase
lezama Jun 16, 2025
3f68a69
Move Color Settings
lezama Jun 16, 2025
3e2988d
select step on sidebar selection
lezama Jun 16, 2025
f62777d
remove unused prop
lezama Jun 16, 2025
ea4632d
If the class is added - disable-spinner do not display the spinner!
enejb Jun 16, 2025
3ab79ab
fix navigation disappearing
lezama Jun 16, 2025
f8557e3
cleanup
lezama Jun 16, 2025
0d1f3dd
Fix build errors
enejb Jun 16, 2025
4fab54b
Update projects/packages/forms/src/blocks/step/edit.js
lezama Jun 16, 2025
bdecf9a
Update projects/packages/forms/src/blocks/step/edit.js
lezama Jun 16, 2025
893eaf0
use Constants::get_constant
lezama Jun 16, 2025
4468e79
Update projects/packages/forms/src/contact-form/css/grunion.css
lezama Jun 16, 2025
a6c2bdc
Update projects/packages/forms/src/blocks/form-progress-indicator/edi…
lezama Jun 16, 2025
9eaf570
Update projects/packages/forms/src/blocks/form-progress-indicator/sty…
lezama Jun 16, 2025
15370ea
Delete projects/packages/forms/src/blocks/form-step/save.js
lezama Jun 16, 2025
ebc68df
Update projects/packages/forms/src/blocks/form-step-navigation/style.…
lezama Jun 16, 2025
f16a58e
Update projects/packages/forms/src/contact-form/class-contact-form-pl…
lezama Jun 16, 2025
abf74ed
Make the form non tabbable
enejb Jun 16, 2025
4a343f1
space-between by default
lezama Jun 16, 2025
6bbdd44
Make the next input field focus when switching steps
enejb Jun 16, 2025
93bef9d
Make the form errors show up as expected on multistep.
enejb Jun 16, 2025
a3caff4
fix select
lezama Jun 16, 2025
d3fec86
fix undo
lezama Jun 16, 2025
b91c3dd
fix warning
lezama Jun 16, 2025
9078059
cleanup
lezama Jun 16, 2025
0702dd3
fix warning
lezama Jun 16, 2025
88be0b3
git disable AI for multistep forms
dhasilva Jun 16, 2025
6a98163
fix php warning
lezama Jun 16, 2025
a04c930
fix undo
lezama Jun 17, 2025
67f56d0
fix undo
lezama Jun 17, 2025
4989298
magic
lezama Jun 17, 2025
7eb44b4
transformation improvements
lezama Jun 17, 2025
3184501
new line at end of css files
dhasilva Jun 17, 2025
a1ff547
fix transformation undo!
lezama Jun 17, 2025
985779d
Revert "fix transformation undo!"
enejb Jun 18, 2025
4c3fe5d
step navigation
enejb Jun 18, 2025
4ec02ab
fix undo
enejb Jun 18, 2025
f610f2b
More fixes
enejb Jun 18, 2025
f8b3424
fix step label
lezama Jun 18, 2025
66bd360
Fix error wrap
enejb Jun 18, 2025
1592684
improvements to step label names
lezama Jun 18, 2025
8a5b934
FIx errors that we display they should be step specific
enejb Jun 18, 2025
52fc411
Right align
enejb Jun 18, 2025
db02c5a
refactor!
lezama Jun 18, 2025
c85f546
Move to shared components
enejb Jun 18, 2025
22a4548
Also right justify
enejb Jun 18, 2025
049bbad
name step from step break
lezama Jun 18, 2025
fd71263
Use the same styles as Paywall block
lezama Jun 18, 2025
5f41f75
match naming
lezama Jun 19, 2025
5cbc448
multistep -> regular transform
lezama Jun 19, 2025
dfa4ef5
fix steps labels
lezama Jun 19, 2025
c091a14
fix from step dragging
lezama Jun 19, 2025
d45eeaa
Add/multi step auto advance handler (#43989)
CGastrell Jun 19, 2025
13adc5f
add global styles to jetpack/form-step-container
lezama Jun 19, 2025
05d1db0
Update the data attributes to come from the PHP side to avoid the san…
enejb Jun 19, 2025
f447351
cleanup
lezama Jun 19, 2025
576741e
improving colors for progress bar
lezama Jun 19, 2025
e7b3d02
better
lezama Jun 19, 2025
d526fd9
simplify progress bar
lezama Jun 19, 2025
88901be
Update projects/packages/forms/src/blocks/shared/util/block-utils.js
lezama Jun 19, 2025
79c182f
Update projects/packages/forms/src/blocks/form-step-navigation/edit.js
lezama Jun 19, 2025
8902e09
Update projects/packages/forms/src/blocks/form-step-navigation/edit.js
lezama Jun 19, 2025
d4712a1
Add a wrapping div
enejb Jun 19, 2025
19d362a
Add min Height
enejb Jun 19, 2025
ad9488a
Update copy
enejb Jun 19, 2025
e76fddb
remove align for steps container
lezama Jun 19, 2025
9eda1bb
Add hasFeatureFlag function to the editor.
enejb Jun 19, 2025
db475b2
Only render the feature flag if is it available.
enejb Jun 19, 2025
3eb6b6d
changelog
enejb Jun 19, 2025
bdf6d72
Only make the multisite fields appear when the we are running beta
enejb Jun 19, 2025
baa09be
fix linter
enejb Jun 20, 2025
d5d59b8
trying to fix the build
enejb Jun 20, 2025
354dc41
const array ALLOWED_BLOCKS
enejb Jun 20, 2025
e03315c
rename to useStepContainerClientId
enejb Jun 20, 2025
fcfbf68
rename file
enejb Jun 20, 2025
bddbdfa
fix variation toggle
lezama Jun 20, 2025
11c9254
call it form
lezama Jun 20, 2025
e6b1e93
update to use less selects
enejb Jun 20, 2025
736de53
Fix frontend progress css
enejb Jun 20, 2025
071d5f4
Don't allow step divivder into form
enejb Jun 20, 2025
dd61168
Make step navigation and form progress indicator more flexible
enejb Jun 20, 2025
710fb87
Fix colour of icon
enejb Jun 20, 2025
0488f47
Fix the missing butten renaming
enejb Jun 20, 2025
04fa8b3
Not used anywhere.
enejb Jun 20, 2025
c994ae3
Make the error checking more robust hasFeatureFlag
enejb Jun 20, 2025
fcef8f7
add margin to form step navigation
lezama Jun 20, 2025
e6fd668
fix enter on textarea and add shadow and border support to steps
lezama Jun 20, 2025
776970e
Make the width always work.
enejb Jun 20, 2025
190589f
Making buttons work more like expected
enejb Jun 20, 2025
04047a6
small improvement
enejb Jun 20, 2025
19ef9d8
move the css to the correct place
enejb Jun 21, 2025
e146b6a
cleanup attributes
lezama Jun 23, 2025
0f865dd
return
lezama Jun 23, 2025
d9e5802
load styles from block folder
lezama Jun 23, 2025
5f0f190
remove empty line
lezama Jun 23, 2025
d6d1652
fix button alignement
lezama Jun 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: added

Add hasFeatureFlag js function that can be added via the `jetpack_block_editor_feature_flags` filter
1 change: 1 addition & 0 deletions projects/js-packages/shared-extension-utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export { getBlockIconComponent, getBlockIconProp } from './src/get-block-icon-fr
export { default as getJetpackBlocksVariation } from './src/get-jetpack-blocks-variation';
export * from './src/modules-state';
export { default as isMyJetpackAvailable } from './src/is-my-jetpack-available';
export { default as hasFeatureFlag } from './src/has-feature-flag';
export * from './src/libs';
export { default as useUpgradeFlow } from './src/hooks/use-upgrade-flow';
export * from './src/block-editor-actions';
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import getJetpackData from './get-jetpack-data';

/**
* Return the value of the Jetpack feature flag.
*
* To add a new feature flag, you need use the `jetpack_block_editor_feature_flags` filter.
*
* @param {string} flag - The feature flag to check.
*
* @return {boolean} Whether the current user is connected.
*/
export default function hasFeatureFlag( flag ) {
const jetpackData = getJetpackData();
if ( ! jetpackData ) {
return false;
}
if ( ! jetpackData?.feature_flags ) {
return false;
}
return Boolean( jetpackData.feature_flags?.[ flag ] );
}
4 changes: 4 additions & 0 deletions projects/packages/forms/changelog/add-forms-multistep
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: added

Forms: Multistep capabilities
4 changes: 4 additions & 0 deletions projects/packages/forms/src/blocks/contact-form/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export default {
type: 'string',
default: '',
},
variationName: {
type: 'string',
default: '',
},
salesforceData: {
type: 'object',
default: {
Expand Down
16 changes: 16 additions & 0 deletions projects/packages/forms/src/blocks/contact-form/child-blocks.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { hasFeatureFlag } from '@automattic/jetpack-shared-extension-utils';
import DeprecatedOptionCheckbox from '../deprecated/field-option-checkbox';
import DeprecatedOptionRadio from '../deprecated/field-option-radio';
import JetpackDropzone from '../dropzone';
Expand All @@ -15,6 +16,11 @@ import JetpackTelephoneField from '../field-telephone';
import JetpackTextField from '../field-text';
import JetpackTextareaField from '../field-textarea';
import JetpackUrlField from '../field-url';
import JetpackProgressIndicator from '../form-progress-indicator';
import JetpackStep from '../form-step';
import JetpackStepContainer from '../form-step-container';
import JetpackStepDivider from '../form-step-divider';
import JetpackStepNavigation from '../form-step-navigation';
import JetpackInput from '../input';
import JetpackLabel from '../label';
import JetpackOption from '../option';
Expand All @@ -40,9 +46,19 @@ export const childBlocks = [
JetpackTelephoneField,
JetpackTextareaField,
JetpackFieldFile,

// The following are required for these blocks to be parsed correctly in block
// deprecations. They have been flagged with `supports.inserter: false` to
// prevent further use.
DeprecatedOptionCheckbox,
DeprecatedOptionRadio,
...( hasFeatureFlag( 'multistep-form' )
? [
JetpackStep,
JetpackStepContainer,
JetpackStepDivider,
JetpackStepNavigation,
JetpackProgressIndicator,
]
: [] ),
];
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,19 @@ public static function register_block() {

add_filter( 'render_block_data', array( __CLASS__, 'find_nested_html_block' ), 10, 3 );
add_filter( 'render_block_core/html', array( __CLASS__, 'render_wrapped_html_block' ), 10, 2 );
add_filter( 'jetpack_block_editor_feature_flags', array( __CLASS__, 'register_feature' ) );
}
/**
* Register the contact form block feature flag.
*
* @param array $features - the features array.
*
* @return array
*/
public static function register_feature( $features ) {
// Register the contact form block feature flag.
$features['multistep-form'] = Blocks::get_variation() === 'beta';
return $features;
}

/**
Expand Down Expand Up @@ -364,6 +377,31 @@ public static function register_child_blocks() {
'label' => __( 'Button', 'jetpack-forms' ),
)
);

Blocks::jetpack_register_block(
'jetpack/form-step',
array(
'render_callback' => array( Contact_Form_Plugin::class, 'gutenblock_render_form_step' ),
)
);

Blocks::jetpack_register_block(
'jetpack/form-step-navigation',
array(
'render_callback' => array( Contact_Form_Plugin::class, 'gutenblock_render_form_step_navigation' ),
)
);

Blocks::jetpack_register_block(
'jetpack/form-progress-indicator',
array(
'render_callback' => array( Contact_Form_Plugin::class, 'gutenblock_render_form_progress_indicator' ),
)
);

Blocks::jetpack_register_block(
'jetpack/form-step-container'
);
}

/**
Expand Down
Loading
Loading