Skip to content

Commit 9f48231

Browse files
tour tweaks
1 parent 3330c34 commit 9f48231

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

src/components/guided-modal-tour/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ const ModalTour = props => {
261261
let clickListener = null
262262

263263
if ( nextEventTarget ) {
264-
if ( nextEvent === 'click' || nextEvent === 'mousedown' ) {
264+
if ( nextEvent === 'click' || nextEvent === 'mousedown' || nextEvent === 'mouseup' ) {
265265
clickListener = event => {
266266
// Check if the event target matches the selector or is inside an element that matches
267267
if (
@@ -284,7 +284,7 @@ const ModalTour = props => {
284284

285285
return () => {
286286
if ( nextEventTarget ) {
287-
if ( ( nextEvent === 'click' || nextEvent === 'mousedown' ) && clickListener ) {
287+
if ( ( nextEvent === 'click' || nextEvent === 'mousedown' || nextEvent === 'mouseup' ) && clickListener ) {
288288
// Use ownerDocument instead of document directly
289289
const doc = modalRef.current?.ownerDocument || document
290290
doc.removeEventListener( nextEvent, clickListener )

src/components/guided-modal-tour/tours/blocks.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,11 @@ export const blocks = {
8989
steps: [
9090
{
9191
title: '👋 ' + __( 'Welcome to Your Stackable Blocks', i18n ),
92-
description: __( 'I\'ve added some Stackable blocks for you. This inspector is contains all the settings for this block, let\'s explore it!', i18n ),
92+
description: __( 'This inspector is contains all the settings for this block, let\'s explore it!', i18n ),
9393
help: createInterpolateElement( __( 'If you\'re familiar with <strong>page builders</strong>, then you\'ll feel right at home.', i18n ), {
9494
strong: <strong />,
9595
} ),
96+
size: 'medium',
9697
anchor: '.ugb--has-panel-tabs',
9798
position: 'left',
9899
glowTarget: '.ugb--has-panel-tabs',
@@ -103,7 +104,7 @@ export const blocks = {
103104
},
104105
{
105106
title: __( 'The Layout Tab', i18n ),
106-
description: __( 'Stackable blocks usually have 3 tabs, each with different settings. The Layout Tab contains layout-related options like flex controls, spacing and margins.', i18n ),
107+
description: __( 'Stackable blocks normally have 3 tabs, each with different settings. The Layout Tab contains layout-related options like flex controls, spacing and margins.', i18n ),
107108
help: createInterpolateElement( __( 'Open the <strong>Layout Tab</strong> to continue.', i18n ), {
108109
strong: <strong />,
109110
} ),
@@ -134,7 +135,7 @@ export const blocks = {
134135
},
135136
{
136137
title: __( 'Try Changing Alignments', i18n ),
137-
description: __( 'Let\'s try changing the Column Alignment to Center or End, and see how it affects our block.', i18n ),
138+
description: __( 'Let\'s try changing this option and see how it affects our block.', i18n ),
138139
help: createInterpolateElement( __( 'Pick <strong>Center or End</strong> Column Alignment to continue.', i18n ), {
139140
strong: <strong />,
140141
} ),
@@ -169,7 +170,7 @@ export const blocks = {
169170
},
170171
{
171172
title: __( 'The Style Tab', i18n ),
172-
description: __( 'I\'ve selected the Columns block now, let\'s try to add a background to it. The Style Tab contains style-related options like backgrounds, color, borders and typography.', i18n ),
173+
description: __( 'Let\'s try to add a background to the main Columns block. The Style Tab contains style-related options like backgrounds, color, borders and typography.', i18n ),
173174
help: createInterpolateElement( __( 'Click the <strong>Style Tab</strong> to continue.', i18n ), {
174175
strong: <strong />,
175176
} ),
@@ -220,12 +221,14 @@ export const blocks = {
220221
document.querySelector( '.edit-post-sidebar__panel-tab.ugb-tab--style:not(.is-active)' )?.click()
221222
}, 100 )
222223
},
223-
postStep: () => {
224-
const checkbox = document.querySelector( '.ugb-block-background-panel .components-panel__body-title input[type="checkbox"]' )
225-
if ( checkbox && ! checkbox.checked ) {
226-
checkbox.click()
227-
}
228-
},
224+
// postStep: () => {
225+
// setTimeout( () => {
226+
// const checkbox = document.querySelector( '.ugb-block-background-panel .components-panel__body-title input[type="checkbox"]' )
227+
// if ( checkbox && checkbox.value !== 'on' ) {
228+
// checkbox.click()
229+
// }
230+
// }, 100 )
231+
// },
229232
},
230233
{
231234
title: __( 'The Advanced Tab', i18n ),
@@ -257,6 +260,7 @@ export const blocks = {
257260
title: __( 'Consistent Options Everywhere', i18n ),
258261
description: __( 'Once you get the hang of these settings, you\'ll spot them in almost every Stackable block. This makes it easy and familiar to build any design you want.', i18n ),
259262
anchor: '.ugb--has-panel-tabs',
263+
size: 'medium',
260264
position: 'left',
261265
preStep: () => {
262266
// Open the inspector sidebar

src/components/guided-modal-tour/tours/design-library.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const designLibrary = {
2020
} ),
2121
size: 'medium',
2222
nextEventTarget: '.ugb-design-library-item',
23-
nextEvent: 'mousedown',
23+
nextEvent: 'mouseup',
2424
offsetX: '-400px',
2525
postStep: () => {
2626
// Make sure the first one (or at least there is one) that's toggled

0 commit comments

Comments
 (0)