Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions src/editor/components/add-interaction-popover/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,7 @@ h4.components-menu-group__label {
.interface-interface-skeleton__header:has(.interact-add-interaction-popover) {
z-index: 99 !important;
}

.interact-add-interaction-popover .components-toggle-group-control {
height: auto;
}
6 changes: 5 additions & 1 deletion src/editor/components/interaction-panel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ const InteractionPanel = props => {
{ interactionConfig.options.map( option => {
const { type, condition } = option
const propsToPass = {}
const optionToPass = { ...option }

const Tag = type === 'number' ? NumberControl
: type === 'select' ? SelectControl
Expand All @@ -402,6 +403,9 @@ const InteractionPanel = props => {
} else { // Default value
propsToPass.checked = option.placeholder || false
}
// Wordpress 7.0 Compatibility
// ToggleControl is messed up in Wordpress 7.0 when type prop is added.
delete optionToPass.type
}

// Conditionally display the option.
Expand All @@ -416,7 +420,7 @@ const InteractionPanel = props => {

return (
<Tag
{ ...option }
{ ...optionToPass }
key={ option.name }
value={ editedInteraction.options?.[ option.name ] || '' }
onChange={ value => {
Expand Down
7 changes: 7 additions & 0 deletions src/editor/components/target-selector/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,10 @@
}
}
}

/* Wordpress 7.0 compatibility */

// Text control losses its margin bottom.
.interact-target-block-input .components-base-control__field {
margin-bottom: 8px;
}
1 change: 1 addition & 0 deletions src/editor/components/target-selector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ const TargetSelector = props => {
<FlexLayout justifyContent="start">
{ isHorizontal && targetButton }
<TextControl
className="interact-target-block-input"
id="interact-target-block-input"
label={ __( 'Block Anchor / ID', 'interactions' ) }
value={ value.value }
Expand Down
4 changes: 1 addition & 3 deletions src/editor/components/timeline/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1147,9 +1147,7 @@ const Timeline = props => {
return ! value
} )
} }
>
{ __( 'Live Preview', 'interactions' ) }
</ToggleControl>
/>
) }
</BaseControl>
)
Expand Down
23 changes: 23 additions & 0 deletions src/editor/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,26 @@
.interact-add-interaction-button-wrapper {
--wp-components-color-accent: #05f;
}

/* Wordpress 7.0 compatibility */

.interact-sidebar, .interact-popover {
// Toggle control loses its margin bottom.
.components-toggle-control {
margin-bottom: 12px;
}

// Text control min-height changed from 30px to 40px.
.components-text-control__input {
min-height: 30px !important;
}

// Select control field loses its margin bottom.
.components-select-control .components-base-control__field {
margin-bottom: 8px;
}

.interact-property-control .components-base-control__field {
margin-bottom: 8px;
}
}
Loading